From 00d9961c0cb76c0055e7a5d0864dabaa46cdafeb Mon Sep 17 00:00:00 2001 From: Andrea Amorese Date: Fri, 10 Sep 2021 10:36:33 +0200 Subject: [PATCH] Built motion from commit e513bdb2.|2.5.345 --- apidoc/api_project.js | 2 +- apidoc/api_project.json | 2 +- server/api/action/action.attributes.js | 2 +- server/api/action/action.controller.js | 2 +- server/api/action/action.model.js | 2 +- server/api/action/action.rpc.js | 2 +- server/api/action/index.js | 2 +- .../analyticCustomReport.attributes.js | 2 +- .../analyticCustomReport.controller.js | 2 +- .../analyticCustomReport.model.js | 2 +- .../analyticCustomReport.rpc.js | 2 +- server/api/analyticCustomReport/index.js | 2 +- .../analyticDefaultReport.attributes.js | 2 +- .../analyticDefaultReport.controller.js | 2 +- .../analyticDefaultReport.model.js | 2 +- .../analyticDefaultReport.rpc.js | 2 +- server/api/analyticDefaultReport/index.js | 2 +- .../analyticExtractedReport.attributes.js | 2 +- .../analyticExtractedReport.controller.js | 2 +- .../analyticExtractedReport.model.js | 2 +- .../analyticExtractedReport.rpc.js | 2 +- server/api/analyticExtractedReport/index.js | 2 +- .../analyticFieldReport.attributes.js | 2 +- .../analyticFieldReport.controller.js | 2 +- .../analyticFieldReport.model.js | 2 +- .../analyticFieldReport/analyticFieldReport.rpc.js | 2 +- server/api/analyticFieldReport/index.js | 2 +- .../analyticMetric/analyticMetric.attributes.js | 2 +- .../analyticMetric/analyticMetric.controller.js | 2 +- server/api/analyticMetric/analyticMetric.model.js | 2 +- server/api/analyticMetric/analyticMetric.rpc.js | 2 +- server/api/analyticMetric/index.js | 2 +- .../analyticTreeReport.attributes.js | 2 +- .../analyticTreeReport.controller.js | 2 +- .../analyticTreeReport/analyticTreeReport.model.js | 2 +- .../analyticTreeReport/analyticTreeReport.rpc.js | 2 +- server/api/analyticTreeReport/index.js | 2 +- server/api/attachment/attachment.attributes.js | 2 +- server/api/attachment/attachment.controller.js | 2 +- server/api/attachment/attachment.model.js | 2 +- server/api/attachment/attachment.rpc.js | 2 +- server/api/attachment/index.js | 2 +- server/api/authGoogle/authGoogle.controller.js | 2 +- server/api/authGoogle/index.js | 2 +- server/api/authLocal/authLocal.controller.js | 2 +- server/api/authLocal/index.js | 2 +- server/api/automation/automation.attributes.js | 2 +- server/api/automation/automation.controller.js | 2 +- server/api/automation/automation.model.js | 2 +- server/api/automation/automation.rpc.js | 2 +- server/api/automation/index.js | 2 +- server/api/campaign/campaign.attributes.js | 2 +- server/api/campaign/campaign.controller.js | 2 +- server/api/campaign/campaign.model.js | 2 +- server/api/campaign/campaign.rpc.js | 2 +- server/api/campaign/index.js | 2 +- server/api/cannedAnswer/cannedAnswer.attributes.js | 2 +- server/api/cannedAnswer/cannedAnswer.controller.js | 2 +- server/api/cannedAnswer/cannedAnswer.model.js | 2 +- server/api/cannedAnswer/cannedAnswer.rpc.js | 2 +- server/api/cannedAnswer/index.js | 2 +- server/api/cdr/cdr.attributes.js | 2 +- server/api/cdr/cdr.controller.js | 2 +- server/api/cdr/cdr.model.js | 2 +- server/api/cdr/cdr.rpc.js | 2 +- server/api/cdr/index.js | 2 +- .../chatApplication/chatApplication.attributes.js | 2 +- .../chatApplication/chatApplication.controller.js | 2 +- .../api/chatApplication/chatApplication.model.js | 2 +- server/api/chatApplication/chatApplication.rpc.js | 2 +- server/api/chatApplication/index.js | 2 +- server/api/chatGroup/chatGroup.attributes.js | 2 +- server/api/chatGroup/chatGroup.controller.js | 2 +- server/api/chatGroup/chatGroup.events.js | 2 +- server/api/chatGroup/chatGroup.model.js | 2 +- server/api/chatGroup/chatGroup.rpc.js | 2 +- server/api/chatGroup/chatGroup.socket.js | 2 +- server/api/chatGroup/index.js | 2 +- .../chatInteraction/chatInteraction.attributes.js | 2 +- .../chatInteraction/chatInteraction.controller.js | 2 +- .../api/chatInteraction/chatInteraction.events.js | 2 +- .../api/chatInteraction/chatInteraction.model.js | 2 +- server/api/chatInteraction/chatInteraction.rpc.js | 2 +- .../api/chatInteraction/chatInteraction.socket.js | 2 +- server/api/chatInteraction/index.js | 2 +- .../chatInternalMessage.attributes.js | 2 +- .../chatInternalMessage.controller.js | 2 +- .../chatInternalMessage.events.js | 2 +- .../chatInternalMessage.model.js | 2 +- .../chatInternalMessage/chatInternalMessage.rpc.js | 2 +- .../chatInternalMessage.socket.js | 2 +- server/api/chatInternalMessage/index.js | 2 +- server/api/chatMessage/chatMessage.attributes.js | 2 +- server/api/chatMessage/chatMessage.controller.js | 2 +- server/api/chatMessage/chatMessage.events.js | 2 +- server/api/chatMessage/chatMessage.model.js | 2 +- server/api/chatMessage/chatMessage.rpc.js | 2 +- server/api/chatMessage/chatMessage.socket.js | 2 +- server/api/chatMessage/index.js | 2 +- .../chatOfflineMessage.attributes.js | 2 +- .../chatOfflineMessage.controller.js | 2 +- .../chatOfflineMessage/chatOfflineMessage.model.js | 2 +- .../chatOfflineMessage/chatOfflineMessage.rpc.js | 2 +- server/api/chatOfflineMessage/index.js | 2 +- .../chatProactiveAction.attributes.js | 2 +- .../chatProactiveAction.controller.js | 2 +- .../chatProactiveAction.model.js | 2 +- .../chatProactiveAction/chatProactiveAction.rpc.js | 2 +- server/api/chatProactiveAction/index.js | 2 +- server/api/chatQueue/chatQueue.attributes.js | 2 +- server/api/chatQueue/chatQueue.controller.js | 2 +- server/api/chatQueue/chatQueue.events.js | 2 +- server/api/chatQueue/chatQueue.model.js | 2 +- server/api/chatQueue/chatQueue.rpc.js | 2 +- server/api/chatQueue/chatQueue.socket.js | 2 +- server/api/chatQueue/index.js | 2 +- .../chatQueueReport/chatQueueReport.attributes.js | 2 +- .../chatQueueReport/chatQueueReport.controller.js | 2 +- .../api/chatQueueReport/chatQueueReport.model.js | 2 +- server/api/chatQueueReport/chatQueueReport.rpc.js | 2 +- server/api/chatQueueReport/index.js | 2 +- .../chatTransferReport.attributes.js | 2 +- .../chatTransferReport.controller.js | 2 +- .../chatTransferReport/chatTransferReport.model.js | 2 +- .../chatTransferReport/chatTransferReport.rpc.js | 2 +- server/api/chatTransferReport/index.js | 2 +- server/api/chatWebsite/chatWebsite.attributes.js | 2 +- server/api/chatWebsite/chatWebsite.controller.js | 2 +- server/api/chatWebsite/chatWebsite.events.js | 2 +- server/api/chatWebsite/chatWebsite.model.js | 2 +- server/api/chatWebsite/chatWebsite.rpc.js | 2 +- server/api/chatWebsite/chatWebsite.socket.js | 2 +- server/api/chatWebsite/index.js | 2 +- .../api/cloudProvider/cloudProvider.attributes.js | 2 +- .../api/cloudProvider/cloudProvider.controller.js | 2 +- server/api/cloudProvider/cloudProvider.model.js | 2 +- server/api/cloudProvider/cloudProvider.rpc.js | 2 +- server/api/cloudProvider/index.js | 2 +- server/api/cmCompany/cmCompany.attributes.js | 2 +- server/api/cmCompany/cmCompany.controller.js | 2 +- server/api/cmCompany/cmCompany.model.js | 2 +- server/api/cmCompany/cmCompany.rpc.js | 2 +- server/api/cmCompany/index.js | 2 +- server/api/cmContact/cmContact.attributes.js | 2 +- server/api/cmContact/cmContact.controller.js | 2 +- server/api/cmContact/cmContact.events.js | 2 +- server/api/cmContact/cmContact.model.js | 2 +- server/api/cmContact/cmContact.rpc.js | 2 +- server/api/cmContact/cmContact.socket.js | 2 +- server/api/cmContact/index.js | 2 +- .../api/cmCustomField/cmCustomField.attributes.js | 2 +- .../api/cmCustomField/cmCustomField.controller.js | 2 +- server/api/cmCustomField/cmCustomField.model.js | 2 +- server/api/cmCustomField/cmCustomField.rpc.js | 2 +- server/api/cmCustomField/index.js | 2 +- server/api/cmHopper/cmHopper.attributes.js | 2 +- server/api/cmHopper/cmHopper.controller.js | 2 +- server/api/cmHopper/cmHopper.model.js | 2 +- server/api/cmHopper/cmHopper.rpc.js | 2 +- server/api/cmHopper/index.js | 2 +- .../api/cmHopperBlack/cmHopperBlack.attributes.js | 2 +- .../api/cmHopperBlack/cmHopperBlack.controller.js | 2 +- server/api/cmHopperBlack/cmHopperBlack.model.js | 2 +- server/api/cmHopperBlack/cmHopperBlack.rpc.js | 2 +- server/api/cmHopperBlack/index.js | 2 +- .../api/cmHopperFinal/cmHopperFinal.attributes.js | 2 +- .../api/cmHopperFinal/cmHopperFinal.controller.js | 2 +- server/api/cmHopperFinal/cmHopperFinal.model.js | 2 +- server/api/cmHopperFinal/cmHopperFinal.rpc.js | 2 +- server/api/cmHopperFinal/index.js | 2 +- .../cmHopperHistory/cmHopperHistory.attributes.js | 2 +- .../cmHopperHistory/cmHopperHistory.controller.js | 2 +- .../api/cmHopperHistory/cmHopperHistory.model.js | 2 +- server/api/cmHopperHistory/cmHopperHistory.rpc.js | 2 +- server/api/cmHopperHistory/index.js | 2 +- server/api/cmList/cmList.attributes.js | 2 +- server/api/cmList/cmList.controller.js | 2 +- server/api/cmList/cmList.events.js | 2 +- server/api/cmList/cmList.model.js | 2 +- server/api/cmList/cmList.rpc.js | 2 +- server/api/cmList/cmList.socket.js | 2 +- server/api/cmList/index.js | 2 +- server/api/condition/condition.attributes.js | 2 +- server/api/condition/condition.controller.js | 2 +- server/api/condition/condition.model.js | 2 +- server/api/condition/condition.rpc.js | 2 +- server/api/condition/index.js | 2 +- server/api/dashboard/dashboard.attributes.js | 2 +- server/api/dashboard/dashboard.controller.js | 2 +- server/api/dashboard/dashboard.events.js | 2 +- server/api/dashboard/dashboard.model.js | 2 +- server/api/dashboard/dashboard.rpc.js | 2 +- server/api/dashboard/dashboard.socket.js | 2 +- server/api/dashboard/index.js | 2 +- .../api/dashboardItem/dashboardItem.attributes.js | 2 +- .../api/dashboardItem/dashboardItem.controller.js | 2 +- server/api/dashboardItem/dashboardItem.events.js | 2 +- server/api/dashboardItem/dashboardItem.model.js | 2 +- server/api/dashboardItem/dashboardItem.rpc.js | 2 +- server/api/dashboardItem/dashboardItem.socket.js | 2 +- server/api/dashboardItem/index.js | 2 +- server/api/disposition/disposition.attributes.js | 2 +- server/api/disposition/disposition.controller.js | 2 +- server/api/disposition/disposition.model.js | 2 +- server/api/disposition/disposition.rpc.js | 2 +- server/api/disposition/index.js | 2 +- server/api/faxAccount/faxAccount.attributes.js | 2 +- server/api/faxAccount/faxAccount.controller.js | 2 +- server/api/faxAccount/faxAccount.events.js | 2 +- server/api/faxAccount/faxAccount.model.js | 2 +- server/api/faxAccount/faxAccount.rpc.js | 2 +- server/api/faxAccount/faxAccount.socket.js | 2 +- server/api/faxAccount/index.js | 2 +- .../faxApplication/faxApplication.attributes.js | 2 +- .../faxApplication/faxApplication.controller.js | 2 +- server/api/faxApplication/faxApplication.model.js | 2 +- server/api/faxApplication/faxApplication.rpc.js | 2 +- server/api/faxApplication/index.js | 2 +- .../faxInteraction/faxInteraction.attributes.js | 2 +- .../faxInteraction/faxInteraction.controller.js | 2 +- server/api/faxInteraction/faxInteraction.events.js | 2 +- server/api/faxInteraction/faxInteraction.model.js | 2 +- server/api/faxInteraction/faxInteraction.rpc.js | 2 +- server/api/faxInteraction/faxInteraction.socket.js | 2 +- server/api/faxInteraction/index.js | 2 +- server/api/faxMessage/faxMessage.attributes.js | 2 +- server/api/faxMessage/faxMessage.controller.js | 2 +- server/api/faxMessage/faxMessage.events.js | 2 +- server/api/faxMessage/faxMessage.model.js | 2 +- server/api/faxMessage/faxMessage.rpc.js | 2 +- server/api/faxMessage/faxMessage.socket.js | 2 +- server/api/faxMessage/index.js | 2 +- server/api/faxQueue/faxQueue.attributes.js | 2 +- server/api/faxQueue/faxQueue.controller.js | 2 +- server/api/faxQueue/faxQueue.events.js | 2 +- server/api/faxQueue/faxQueue.model.js | 2 +- server/api/faxQueue/faxQueue.rpc.js | 2 +- server/api/faxQueue/faxQueue.socket.js | 2 +- server/api/faxQueue/index.js | 2 +- .../faxQueueReport/faxQueueReport.attributes.js | 2 +- .../faxQueueReport/faxQueueReport.controller.js | 2 +- server/api/faxQueueReport/faxQueueReport.model.js | 2 +- server/api/faxQueueReport/faxQueueReport.rpc.js | 2 +- server/api/faxQueueReport/index.js | 2 +- .../faxTransferReport.attributes.js | 2 +- .../faxTransferReport.controller.js | 2 +- .../faxTransferReport/faxTransferReport.model.js | 2 +- .../api/faxTransferReport/faxTransferReport.rpc.js | 2 +- server/api/faxTransferReport/index.js | 2 +- server/api/intDeskAccount/index.js | 2 +- .../intDeskAccount/intDeskAccount.attributes.js | 2 +- .../intDeskAccount/intDeskAccount.controller.js | 2 +- server/api/intDeskAccount/intDeskAccount.model.js | 2 +- server/api/intDeskAccount/intDeskAccount.rpc.js | 2 +- server/api/intDeskConfiguration/index.js | 2 +- .../intDeskConfiguration.attributes.js | 2 +- .../intDeskConfiguration.controller.js | 2 +- .../intDeskConfiguration.model.js | 2 +- .../intDeskConfiguration.rpc.js | 2 +- server/api/intDeskField/index.js | 2 +- server/api/intDeskField/intDeskField.attributes.js | 2 +- server/api/intDeskField/intDeskField.controller.js | 2 +- server/api/intDeskField/intDeskField.model.js | 2 +- server/api/intDeskField/intDeskField.rpc.js | 2 +- server/api/intDynamics365Account/index.js | 2 +- .../intDynamics365Account.attributes.js | 2 +- .../intDynamics365Account.controller.js | 2 +- .../intDynamics365Account.model.js | 2 +- .../intDynamics365Account.rpc.js | 2 +- server/api/intDynamics365Configuration/index.js | 2 +- .../intDynamics365Configuration.attributes.js | 2 +- .../intDynamics365Configuration.controller.js | 2 +- .../intDynamics365Configuration.model.js | 2 +- .../intDynamics365Configuration.rpc.js | 2 +- server/api/intDynamics365Field/index.js | 2 +- .../intDynamics365Field.attributes.js | 2 +- .../intDynamics365Field.controller.js | 2 +- .../intDynamics365Field.model.js | 2 +- .../intDynamics365Field/intDynamics365Field.rpc.js | 2 +- server/api/intFreshdeskAccount/index.js | 2 +- .../intFreshdeskAccount.attributes.js | 2 +- .../intFreshdeskAccount.controller.js | 2 +- .../intFreshdeskAccount.model.js | 2 +- .../intFreshdeskAccount/intFreshdeskAccount.rpc.js | 2 +- server/api/intFreshdeskConfiguration/index.js | 2 +- .../intFreshdeskConfiguration.attributes.js | 2 +- .../intFreshdeskConfiguration.controller.js | 2 +- .../intFreshdeskConfiguration.model.js | 2 +- .../intFreshdeskConfiguration.rpc.js | 2 +- server/api/intFreshdeskField/index.js | 2 +- .../intFreshdeskField.attributes.js | 2 +- .../intFreshdeskField.controller.js | 2 +- .../intFreshdeskField/intFreshdeskField.model.js | 2 +- .../api/intFreshdeskField/intFreshdeskField.rpc.js | 2 +- server/api/intFreshsalesAccount/index.js | 2 +- .../intFreshsalesAccount.attributes.js | 2 +- .../intFreshsalesAccount.controller.js | 2 +- .../intFreshsalesAccount.model.js | 2 +- .../intFreshsalesAccount.rpc.js | 2 +- server/api/intFreshsalesConfiguration/index.js | 2 +- .../intFreshsalesConfiguration.attributes.js | 2 +- .../intFreshsalesConfiguration.controller.js | 2 +- .../intFreshsalesConfiguration.model.js | 2 +- .../intFreshsalesConfiguration.rpc.js | 2 +- server/api/intFreshsalesField/index.js | 2 +- .../intFreshsalesField.attributes.js | 2 +- .../intFreshsalesField.controller.js | 2 +- .../intFreshsalesField/intFreshsalesField.model.js | 2 +- .../intFreshsalesField/intFreshsalesField.rpc.js | 2 +- server/api/intSalesforceAccount/index.js | 2 +- .../intSalesforceAccount.attributes.js | 2 +- .../intSalesforceAccount.controller.js | 2 +- .../intSalesforceAccount.model.js | 2 +- .../intSalesforceAccount.rpc.js | 2 +- server/api/intSalesforceConfiguration/index.js | 2 +- .../intSalesforceConfiguration.attributes.js | 2 +- .../intSalesforceConfiguration.controller.js | 2 +- .../intSalesforceConfiguration.model.js | 2 +- .../intSalesforceConfiguration.rpc.js | 2 +- server/api/intSalesforceField/index.js | 2 +- .../intSalesforceField.attributes.js | 2 +- .../intSalesforceField.controller.js | 2 +- .../intSalesforceField/intSalesforceField.model.js | 2 +- .../intSalesforceField/intSalesforceField.rpc.js | 2 +- server/api/intServicenowAccount/index.js | 2 +- .../intServicenowAccount.attributes.js | 2 +- .../intServicenowAccount.controller.js | 2 +- .../intServicenowAccount.model.js | 2 +- .../intServicenowAccount.rpc.js | 2 +- server/api/intServicenowConfiguration/index.js | 2 +- .../intServicenowConfiguration.attributes.js | 2 +- .../intServicenowConfiguration.controller.js | 2 +- .../intServicenowConfiguration.model.js | 2 +- .../intServicenowConfiguration.rpc.js | 2 +- server/api/intServicenowField/index.js | 2 +- .../intServicenowField.attributes.js | 2 +- .../intServicenowField.controller.js | 2 +- .../intServicenowField/intServicenowField.model.js | 2 +- .../intServicenowField/intServicenowField.rpc.js | 2 +- server/api/intSugarcrmAccount/index.js | 2 +- .../intSugarcrmAccount.attributes.js | 2 +- .../intSugarcrmAccount.controller.js | 2 +- .../intSugarcrmAccount/intSugarcrmAccount.model.js | 2 +- .../intSugarcrmAccount/intSugarcrmAccount.rpc.js | 2 +- server/api/intSugarcrmConfiguration/index.js | 2 +- .../intSugarcrmConfiguration.attributes.js | 2 +- .../intSugarcrmConfiguration.controller.js | 2 +- .../intSugarcrmConfiguration.model.js | 2 +- .../intSugarcrmConfiguration.rpc.js | 2 +- server/api/intSugarcrmField/index.js | 2 +- .../intSugarcrmField.attributes.js | 2 +- .../intSugarcrmField.controller.js | 2 +- .../api/intSugarcrmField/intSugarcrmField.model.js | 2 +- .../api/intSugarcrmField/intSugarcrmField.rpc.js | 2 +- server/api/intVtigerAccount/index.js | 2 +- .../intVtigerAccount.attributes.js | 2 +- .../intVtigerAccount.controller.js | 2 +- .../api/intVtigerAccount/intVtigerAccount.model.js | 2 +- .../api/intVtigerAccount/intVtigerAccount.rpc.js | 2 +- server/api/intVtigerConfiguration/index.js | 2 +- .../intVtigerConfiguration.attributes.js | 2 +- .../intVtigerConfiguration.controller.js | 2 +- .../intVtigerConfiguration.model.js | 2 +- .../intVtigerConfiguration.rpc.js | 2 +- server/api/intVtigerField/index.js | 2 +- .../intVtigerField/intVtigerField.attributes.js | 2 +- .../intVtigerField/intVtigerField.controller.js | 2 +- server/api/intVtigerField/intVtigerField.model.js | 2 +- server/api/intVtigerField/intVtigerField.rpc.js | 2 +- server/api/intZendeskAccount/index.js | 2 +- .../intZendeskAccount.attributes.js | 2 +- .../intZendeskAccount.controller.js | 2 +- .../intZendeskAccount/intZendeskAccount.model.js | 2 +- .../api/intZendeskAccount/intZendeskAccount.rpc.js | 2 +- server/api/intZendeskConfiguration/index.js | 2 +- .../intZendeskConfiguration.attributes.js | 2 +- .../intZendeskConfiguration.controller.js | 2 +- .../intZendeskConfiguration.model.js | 2 +- .../intZendeskConfiguration.rpc.js | 2 +- server/api/intZendeskField/index.js | 2 +- .../intZendeskField/intZendeskField.attributes.js | 2 +- .../intZendeskField/intZendeskField.controller.js | 2 +- .../api/intZendeskField/intZendeskField.model.js | 2 +- server/api/intZendeskField/intZendeskField.rpc.js | 2 +- server/api/intZohoAccount/index.js | 2 +- .../intZohoAccount/intZohoAccount.attributes.js | 2 +- .../intZohoAccount/intZohoAccount.controller.js | 2 +- server/api/intZohoAccount/intZohoAccount.model.js | 2 +- server/api/intZohoAccount/intZohoAccount.rpc.js | 2 +- server/api/intZohoConfiguration/index.js | 2 +- .../intZohoConfiguration.attributes.js | 2 +- .../intZohoConfiguration.controller.js | 2 +- .../intZohoConfiguration.model.js | 2 +- .../intZohoConfiguration.rpc.js | 2 +- server/api/intZohoField/index.js | 2 +- server/api/intZohoField/intZohoField.attributes.js | 2 +- server/api/intZohoField/intZohoField.controller.js | 2 +- server/api/intZohoField/intZohoField.model.js | 2 +- server/api/intZohoField/intZohoField.rpc.js | 2 +- server/api/integration/index.js | 2 +- server/api/integration/integration.attributes.js | 2 +- server/api/integration/integration.controller.js | 2 +- server/api/integration/integration.model.js | 2 +- server/api/integration/integration.rpc.js | 2 +- server/api/integrationReport/index.js | 2 +- .../integrationReport.attributes.js | 2 +- .../integrationReport.controller.js | 2 +- .../integrationReport/integrationReport.model.js | 2 +- .../api/integrationReport/integrationReport.rpc.js | 2 +- server/api/interval/index.js | 2 +- server/api/interval/interval.attributes.js | 2 +- server/api/interval/interval.controller.js | 2 +- server/api/interval/interval.model.js | 2 +- server/api/interval/interval.rpc.js | 2 +- server/api/jira/index.js | 2 +- server/api/jira/jira.controller.js | 2 +- server/api/jscriptyAnswerReport/index.js | 2 +- .../jscriptyAnswerReport.attributes.js | 2 +- .../jscriptyAnswerReport.controller.js | 2 +- .../jscriptyAnswerReport.model.js | 2 +- .../jscriptyAnswerReport.rpc.js | 2 +- server/api/jscriptyProject/index.js | 2 +- .../jscriptyProject/jscriptyProject.attributes.js | 2 +- .../jscriptyProject/jscriptyProject.controller.js | 2 +- .../api/jscriptyProject/jscriptyProject.model.js | 2 +- server/api/jscriptyProject/jscriptyProject.rpc.js | 2 +- server/api/jscriptyQuestionReport/index.js | 2 +- .../jscriptyQuestionReport.attributes.js | 2 +- .../jscriptyQuestionReport.controller.js | 2 +- .../jscriptyQuestionReport.model.js | 2 +- .../jscriptyQuestionReport.rpc.js | 2 +- server/api/jscriptySessionReport/index.js | 2 +- .../jscriptySessionReport.attributes.js | 2 +- .../jscriptySessionReport.controller.js | 2 +- .../jscriptySessionReport.model.js | 2 +- .../jscriptySessionReport.rpc.js | 2 +- server/api/license/index.js | 2 +- server/api/license/license.attributes.js | 2 +- server/api/license/license.controller.js | 2 +- server/api/license/license.model.js | 2 +- server/api/license/license.rpc.js | 2 +- server/api/mailAccount/index.js | 2 +- server/api/mailAccount/mailAccount.attributes.js | 2 +- server/api/mailAccount/mailAccount.controller.js | 2 +- server/api/mailAccount/mailAccount.events.js | 2 +- server/api/mailAccount/mailAccount.model.js | 2 +- server/api/mailAccount/mailAccount.rpc.js | 2 +- server/api/mailAccount/mailAccount.socket.js | 2 +- server/api/mailApplication/index.js | 2 +- .../mailApplication/mailApplication.attributes.js | 2 +- .../mailApplication/mailApplication.controller.js | 2 +- .../api/mailApplication/mailApplication.model.js | 2 +- server/api/mailApplication/mailApplication.rpc.js | 2 +- server/api/mailInteraction/index.js | 2 +- .../mailInteraction/mailInteraction.attributes.js | 2 +- .../mailInteraction/mailInteraction.controller.js | 2 +- .../api/mailInteraction/mailInteraction.events.js | 2 +- .../api/mailInteraction/mailInteraction.model.js | 2 +- server/api/mailInteraction/mailInteraction.rpc.js | 2 +- .../api/mailInteraction/mailInteraction.socket.js | 2 +- server/api/mailMessage/index.js | 2 +- server/api/mailMessage/mailMessage.attributes.js | 2 +- server/api/mailMessage/mailMessage.controller.js | 2 +- server/api/mailMessage/mailMessage.events.js | 2 +- server/api/mailMessage/mailMessage.model.js | 2 +- server/api/mailMessage/mailMessage.rpc.js | 2 +- server/api/mailMessage/mailMessage.socket.js | 2 +- server/api/mailQueue/index.js | 2 +- server/api/mailQueue/mailQueue.attributes.js | 2 +- server/api/mailQueue/mailQueue.controller.js | 2 +- server/api/mailQueue/mailQueue.events.js | 2 +- server/api/mailQueue/mailQueue.model.js | 2 +- server/api/mailQueue/mailQueue.rpc.js | 2 +- server/api/mailQueue/mailQueue.socket.js | 2 +- server/api/mailQueueReport/index.js | 2 +- .../mailQueueReport/mailQueueReport.attributes.js | 2 +- .../mailQueueReport/mailQueueReport.controller.js | 2 +- .../api/mailQueueReport/mailQueueReport.model.js | 2 +- server/api/mailQueueReport/mailQueueReport.rpc.js | 2 +- server/api/mailServerIn/index.js | 2 +- server/api/mailServerIn/mailServerIn.attributes.js | 2 +- server/api/mailServerIn/mailServerIn.model.js | 2 +- server/api/mailServerIn/mailServerIn.rpc.js | 2 +- server/api/mailServerOut/index.js | 2 +- .../api/mailServerOut/mailServerOut.attributes.js | 2 +- .../api/mailServerOut/mailServerOut.controller.js | 2 +- server/api/mailServerOut/mailServerOut.model.js | 2 +- server/api/mailServerOut/mailServerOut.rpc.js | 2 +- server/api/mailSubstatus/index.js | 2 +- .../api/mailSubstatus/mailSubstatus.attributes.js | 2 +- .../api/mailSubstatus/mailSubstatus.controller.js | 2 +- server/api/mailSubstatus/mailSubstatus.model.js | 2 +- server/api/mailSubstatus/mailSubstatus.rpc.js | 2 +- server/api/mailTransferReport/index.js | 2 +- .../mailTransferReport.attributes.js | 2 +- .../mailTransferReport.controller.js | 2 +- .../mailTransferReport/mailTransferReport.model.js | 2 +- .../mailTransferReport/mailTransferReport.rpc.js | 2 +- server/api/memberReport/index.js | 2 +- server/api/memberReport/memberReport.attributes.js | 2 +- server/api/memberReport/memberReport.controller.js | 2 +- server/api/memberReport/memberReport.model.js | 2 +- server/api/memberReport/memberReport.rpc.js | 2 +- server/api/migration/index.js | 2 +- server/api/migration/migration.attributes.js | 2 +- server/api/migration/migration.controller.js | 2 +- server/api/migration/migration.model.js | 2 +- server/api/migration/migration.rpc.js | 2 +- server/api/network/index.js | 2 +- server/api/network/network.attributes.js | 2 +- server/api/network/network.controller.js | 2 +- server/api/network/network.model.js | 2 +- server/api/network/network.rpc.js | 2 +- server/api/openchannelAccount/index.js | 2 +- .../openchannelAccount.attributes.js | 2 +- .../openchannelAccount.controller.js | 2 +- .../openchannelAccount.events.js | 2 +- .../openchannelAccount/openchannelAccount.model.js | 2 +- .../openchannelAccount/openchannelAccount.rpc.js | 2 +- .../openchannelAccount.socket.js | 2 +- server/api/openchannelApplication/index.js | 2 +- .../openchannelApplication.attributes.js | 2 +- .../openchannelApplication.controller.js | 2 +- .../openchannelApplication.model.js | 2 +- .../openchannelApplication.rpc.js | 2 +- server/api/openchannelInteraction/index.js | 2 +- .../openchannelInteraction.attributes.js | 2 +- .../openchannelInteraction.controller.js | 2 +- .../openchannelInteraction.events.js | 2 +- .../openchannelInteraction.model.js | 2 +- .../openchannelInteraction.rpc.js | 2 +- .../openchannelInteraction.socket.js | 2 +- server/api/openchannelMessage/index.js | 2 +- .../openchannelMessage.attributes.js | 2 +- .../openchannelMessage.controller.js | 2 +- .../openchannelMessage.events.js | 2 +- .../openchannelMessage/openchannelMessage.model.js | 2 +- .../openchannelMessage/openchannelMessage.rpc.js | 2 +- .../openchannelMessage.socket.js | 2 +- server/api/openchannelQueue/index.js | 2 +- .../openchannelQueue.attributes.js | 2 +- .../openchannelQueue.controller.js | 2 +- .../openchannelQueue/openchannelQueue.events.js | 2 +- .../api/openchannelQueue/openchannelQueue.model.js | 2 +- .../api/openchannelQueue/openchannelQueue.rpc.js | 2 +- .../openchannelQueue/openchannelQueue.socket.js | 2 +- server/api/openchannelQueueReport/index.js | 2 +- .../openchannelQueueReport.attributes.js | 2 +- .../openchannelQueueReport.controller.js | 2 +- .../openchannelQueueReport.model.js | 2 +- .../openchannelQueueReport.rpc.js | 2 +- server/api/openchannelTransferReport/index.js | 2 +- .../openchannelTransferReport.attributes.js | 2 +- .../openchannelTransferReport.controller.js | 2 +- .../openchannelTransferReport.model.js | 2 +- .../openchannelTransferReport.rpc.js | 2 +- server/api/pause/index.js | 2 +- server/api/pause/pause.attributes.js | 2 +- server/api/pause/pause.controller.js | 2 +- server/api/pause/pause.model.js | 2 +- server/api/pause/pause.rpc.js | 2 +- server/api/plugin/index.js | 2 +- server/api/plugin/plugin.attributes.js | 2 +- server/api/plugin/plugin.controller.js | 2 +- server/api/plugin/plugin.events.js | 2 +- server/api/plugin/plugin.model.js | 2 +- server/api/plugin/plugin.rpc.js | 2 +- server/api/plugin/plugin.socket.js | 2 +- server/api/pm2/index.js | 2 +- server/api/pm2/pm2.controller.js | 2 +- server/api/realtime/index.js | 2 +- server/api/realtime/realtime.controller.js | 2 +- server/api/reportAgentPreview/index.js | 2 +- .../reportAgentPreview.attributes.js | 2 +- .../reportAgentPreview/reportAgentPreview.model.js | 2 +- .../reportAgentPreview/reportAgentPreview.rpc.js | 2 +- server/api/rpc/index.js | 2 +- server/api/rpc/rpc.controller.js | 2 +- server/api/schedule/index.js | 2 +- server/api/schedule/schedule.attributes.js | 2 +- server/api/schedule/schedule.controller.js | 2 +- server/api/schedule/schedule.model.js | 2 +- server/api/schedule/schedule.rpc.js | 2 +- server/api/screenRecording/index.js | 2 +- .../screenRecording/screenRecording.attributes.js | 2 +- .../screenRecording/screenRecording.controller.js | 2 +- .../api/screenRecording/screenRecording.model.js | 2 +- server/api/screenRecording/screenRecording.rpc.js | 2 +- server/api/setting/index.js | 2 +- server/api/setting/setting.attributes.js | 2 +- server/api/setting/setting.controller.js | 2 +- server/api/setting/setting.model.js | 2 +- server/api/setting/setting.rpc.js | 2 +- server/api/smsAccount/index.js | 2 +- server/api/smsAccount/smsAccount.attributes.js | 2 +- server/api/smsAccount/smsAccount.controller.js | 2 +- server/api/smsAccount/smsAccount.events.js | 2 +- server/api/smsAccount/smsAccount.model.js | 2 +- server/api/smsAccount/smsAccount.rpc.js | 2 +- server/api/smsAccount/smsAccount.socket.js | 2 +- server/api/smsApplication/index.js | 2 +- .../smsApplication/smsApplication.attributes.js | 2 +- .../smsApplication/smsApplication.controller.js | 2 +- server/api/smsApplication/smsApplication.model.js | 2 +- server/api/smsApplication/smsApplication.rpc.js | 2 +- server/api/smsInteraction/index.js | 2 +- .../smsInteraction/smsInteraction.attributes.js | 2 +- .../smsInteraction/smsInteraction.controller.js | 2 +- server/api/smsInteraction/smsInteraction.events.js | 2 +- server/api/smsInteraction/smsInteraction.model.js | 2 +- server/api/smsInteraction/smsInteraction.rpc.js | 2 +- server/api/smsInteraction/smsInteraction.socket.js | 2 +- server/api/smsMessage/index.js | 2 +- server/api/smsMessage/smsMessage.attributes.js | 2 +- server/api/smsMessage/smsMessage.controller.js | 2 +- server/api/smsMessage/smsMessage.events.js | 2 +- server/api/smsMessage/smsMessage.model.js | 2 +- server/api/smsMessage/smsMessage.rpc.js | 2 +- server/api/smsMessage/smsMessage.socket.js | 2 +- server/api/smsQueue/index.js | 2 +- server/api/smsQueue/smsQueue.attributes.js | 2 +- server/api/smsQueue/smsQueue.controller.js | 2 +- server/api/smsQueue/smsQueue.events.js | 2 +- server/api/smsQueue/smsQueue.model.js | 2 +- server/api/smsQueue/smsQueue.rpc.js | 2 +- server/api/smsQueue/smsQueue.socket.js | 2 +- server/api/smsQueueReport/index.js | 2 +- .../smsQueueReport/smsQueueReport.attributes.js | 2 +- .../smsQueueReport/smsQueueReport.controller.js | 2 +- server/api/smsQueueReport/smsQueueReport.model.js | 2 +- server/api/smsQueueReport/smsQueueReport.rpc.js | 2 +- server/api/smsTransferReport/index.js | 2 +- .../smsTransferReport.attributes.js | 2 +- .../smsTransferReport.controller.js | 2 +- .../smsTransferReport/smsTransferReport.model.js | 2 +- .../api/smsTransferReport/smsTransferReport.rpc.js | 2 +- server/api/sound/index.js | 2 +- server/api/sound/sound.attributes.js | 2 +- server/api/sound/sound.controller.js | 2 +- server/api/sound/sound.model.js | 2 +- server/api/sound/sound.rpc.js | 2 +- server/api/squareMessage/index.js | 2 +- .../api/squareMessage/squareMessage.attributes.js | 2 +- .../api/squareMessage/squareMessage.controller.js | 2 +- server/api/squareMessage/squareMessage.model.js | 2 +- server/api/squareMessage/squareMessage.rpc.js | 2 +- server/api/squareOdbc/index.js | 2 +- server/api/squareOdbc/squareOdbc.attributes.js | 2 +- server/api/squareOdbc/squareOdbc.controller.js | 2 +- server/api/squareOdbc/squareOdbc.model.js | 2 +- server/api/squareOdbc/squareOdbc.rpc.js | 2 +- server/api/squareProject/index.js | 2 +- .../api/squareProject/squareProject.attributes.js | 2 +- .../api/squareProject/squareProject.controller.js | 2 +- server/api/squareProject/squareProject.events.js | 2 +- server/api/squareProject/squareProject.model.js | 2 +- server/api/squareProject/squareProject.rpc.js | 2 +- server/api/squareProject/squareProject.socket.js | 2 +- server/api/squareRecording/index.js | 2 +- .../squareRecording/squareRecording.attributes.js | 2 +- .../squareRecording/squareRecording.controller.js | 2 +- .../api/squareRecording/squareRecording.model.js | 2 +- server/api/squareRecording/squareRecording.rpc.js | 2 +- server/api/squareReport/index.js | 2 +- server/api/squareReport/squareReport.attributes.js | 2 +- server/api/squareReport/squareReport.controller.js | 2 +- server/api/squareReport/squareReport.model.js | 2 +- server/api/squareReport/squareReport.rpc.js | 2 +- server/api/squareReportDetail/index.js | 2 +- .../squareReportDetail.attributes.js | 2 +- .../squareReportDetail.controller.js | 2 +- .../squareReportDetail/squareReportDetail.model.js | 2 +- .../squareReportDetail/squareReportDetail.rpc.js | 2 +- server/api/system/index.js | 2 +- server/api/system/system.controller.js | 2 +- server/api/tag/index.js | 2 +- server/api/tag/tag.attributes.js | 2 +- server/api/tag/tag.controller.js | 2 +- server/api/tag/tag.model.js | 2 +- server/api/tag/tag.rpc.js | 2 +- server/api/team/index.js | 2 +- server/api/team/team.attributes.js | 2 +- server/api/team/team.controller.js | 2 +- server/api/team/team.events.js | 2 +- server/api/team/team.model.js | 2 +- server/api/team/team.rpc.js | 2 +- server/api/team/team.socket.js | 2 +- server/api/teamVoicePrefix/index.js | 2 +- .../teamVoicePrefix/teamVoicePrefix.attributes.js | 2 +- .../api/teamVoicePrefix/teamVoicePrefix.model.js | 2 +- server/api/teamVoicePrefix/teamVoicePrefix.rpc.js | 2 +- server/api/teamVoiceQueue/index.js | 2 +- .../teamVoiceQueue/teamVoiceQueue.attributes.js | 2 +- server/api/teamVoiceQueue/teamVoiceQueue.model.js | 2 +- server/api/teamVoiceQueue/teamVoiceQueue.rpc.js | 2 +- server/api/template/index.js | 2 +- server/api/template/template.attributes.js | 2 +- server/api/template/template.controller.js | 2 +- server/api/template/template.model.js | 2 +- server/api/template/template.rpc.js | 2 +- server/api/trigger/index.js | 2 +- server/api/trigger/trigger.attributes.js | 2 +- server/api/trigger/trigger.controller.js | 2 +- server/api/trigger/trigger.model.js | 2 +- server/api/trigger/trigger.rpc.js | 2 +- server/api/trunk/index.js | 2 +- server/api/trunk/trunk.attributes.js | 2 +- server/api/trunk/trunk.controller.js | 2 +- server/api/trunk/trunk.model.js | 2 +- server/api/trunk/trunk.rpc.js | 2 +- server/api/user/index.js | 2 +- server/api/user/user.attributes.js | 2 +- server/api/user/user.controller.js | 2 +- server/api/user/user.events.js | 2 +- server/api/user/user.model.js | 2 +- server/api/user/user.rpc.js | 2 +- server/api/user/user.socket.js | 2 +- server/api/userChatQueue/index.js | 2 +- .../api/userChatQueue/userChatQueue.attributes.js | 2 +- server/api/userChatQueue/userChatQueue.model.js | 2 +- server/api/userChatQueue/userChatQueue.rpc.js | 2 +- server/api/userFaxQueue/index.js | 2 +- server/api/userFaxQueue/userFaxQueue.attributes.js | 2 +- server/api/userFaxQueue/userFaxQueue.model.js | 2 +- server/api/userFaxQueue/userFaxQueue.rpc.js | 2 +- server/api/userMailQueue/index.js | 2 +- .../api/userMailQueue/userMailQueue.attributes.js | 2 +- server/api/userMailQueue/userMailQueue.model.js | 2 +- server/api/userMailQueue/userMailQueue.rpc.js | 2 +- server/api/userNotification/index.js | 2 +- .../userNotification.attributes.js | 2 +- .../userNotification.controller.js | 2 +- .../userNotification/userNotification.events.js | 2 +- .../api/userNotification/userNotification.model.js | 2 +- .../api/userNotification/userNotification.rpc.js | 2 +- .../userNotification/userNotification.socket.js | 2 +- server/api/userOpenchannelQueue/index.js | 2 +- .../userOpenchannelQueue.attributes.js | 2 +- .../userOpenchannelQueue.model.js | 2 +- .../userOpenchannelQueue.rpc.js | 2 +- server/api/userProfile/index.js | 2 +- server/api/userProfile/userProfile.attributes.js | 2 +- server/api/userProfile/userProfile.controller.js | 2 +- server/api/userProfile/userProfile.events.js | 2 +- server/api/userProfile/userProfile.model.js | 2 +- server/api/userProfile/userProfile.rpc.js | 2 +- server/api/userProfile/userProfile.socket.js | 2 +- server/api/userProfileResource/index.js | 2 +- .../userProfileResource.attributes.js | 2 +- .../userProfileResource.controller.js | 2 +- .../userProfileResource.model.js | 2 +- .../userProfileResource/userProfileResource.rpc.js | 2 +- server/api/userProfileSection/index.js | 2 +- .../userProfileSection.attributes.js | 2 +- .../userProfileSection.controller.js | 2 +- .../userProfileSection/userProfileSection.model.js | 2 +- .../userProfileSection/userProfileSection.rpc.js | 2 +- server/api/userSmsQueue/index.js | 2 +- server/api/userSmsQueue/userSmsQueue.attributes.js | 2 +- server/api/userSmsQueue/userSmsQueue.model.js | 2 +- server/api/userSmsQueue/userSmsQueue.rpc.js | 2 +- server/api/userVoicePrefix/index.js | 2 +- .../userVoicePrefix/userVoicePrefix.attributes.js | 2 +- .../api/userVoicePrefix/userVoicePrefix.model.js | 2 +- server/api/userVoicePrefix/userVoicePrefix.rpc.js | 2 +- server/api/userVoiceQueue/index.js | 2 +- .../userVoiceQueue/userVoiceQueue.attributes.js | 2 +- server/api/userVoiceQueue/userVoiceQueue.model.js | 2 +- server/api/userVoiceQueue/userVoiceQueue.rpc.js | 2 +- server/api/userVoiceQueueRt/index.js | 2 +- .../userVoiceQueueRt.attributes.js | 2 +- .../userVoiceQueueRt/userVoiceQueueRt.events.js | 2 +- .../api/userVoiceQueueRt/userVoiceQueueRt.model.js | 2 +- .../api/userVoiceQueueRt/userVoiceQueueRt.rpc.js | 2 +- .../userVoiceQueueRt/userVoiceQueueRt.socket.js | 2 +- server/api/userWhatsappQueue/index.js | 2 +- .../userWhatsappQueue.attributes.js | 2 +- .../userWhatsappQueue/userWhatsappQueue.model.js | 2 +- .../api/userWhatsappQueue/userWhatsappQueue.rpc.js | 2 +- server/api/variable/index.js | 2 +- server/api/variable/variable.attributes.js | 2 +- server/api/variable/variable.controller.js | 2 +- server/api/variable/variable.model.js | 2 +- server/api/variable/variable.rpc.js | 2 +- server/api/version/index.js | 2 +- server/api/version/version.controller.js | 2 +- server/api/voiceAgentReport/index.js | 2 +- .../voiceAgentReport.attributes.js | 2 +- .../voiceAgentReport.controller.js | 2 +- .../api/voiceAgentReport/voiceAgentReport.model.js | 2 +- .../api/voiceAgentReport/voiceAgentReport.rpc.js | 2 +- server/api/voiceCallReport/index.js | 2 +- .../voiceCallReport/voiceCallReport.attributes.js | 2 +- .../voiceCallReport/voiceCallReport.controller.js | 2 +- .../api/voiceCallReport/voiceCallReport.model.js | 2 +- server/api/voiceCallReport/voiceCallReport.rpc.js | 2 +- server/api/voiceChanSpy/index.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.attributes.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.controller.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.model.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.rpc.js | 2 +- server/api/voiceContext/index.js | 2 +- server/api/voiceContext/voiceContext.attributes.js | 2 +- server/api/voiceContext/voiceContext.controller.js | 2 +- server/api/voiceContext/voiceContext.model.js | 2 +- server/api/voiceContext/voiceContext.rpc.js | 2 +- server/api/voiceDialReport/index.js | 2 +- .../voiceDialReport/voiceDialReport.attributes.js | 2 +- .../voiceDialReport/voiceDialReport.controller.js | 2 +- .../api/voiceDialReport/voiceDialReport.model.js | 2 +- server/api/voiceDialReport/voiceDialReport.rpc.js | 2 +- server/api/voiceExtension/index.js | 2 +- .../voiceExtension/voiceExtension.attributes.js | 2 +- .../voiceExtension/voiceExtension.controller.js | 2 +- server/api/voiceExtension/voiceExtension.events.js | 2 +- server/api/voiceExtension/voiceExtension.model.js | 2 +- server/api/voiceExtension/voiceExtension.rpc.js | 2 +- server/api/voiceExtension/voiceExtension.socket.js | 2 +- server/api/voiceMail/index.js | 2 +- server/api/voiceMail/voiceMail.attributes.js | 2 +- server/api/voiceMail/voiceMail.controller.js | 2 +- server/api/voiceMail/voiceMail.model.js | 2 +- server/api/voiceMail/voiceMail.rpc.js | 2 +- server/api/voiceMailMessage/index.js | 2 +- .../voiceMailMessage.attributes.js | 2 +- .../voiceMailMessage.controller.js | 2 +- .../api/voiceMailMessage/voiceMailMessage.model.js | 2 +- .../api/voiceMailMessage/voiceMailMessage.rpc.js | 2 +- server/api/voiceMusicOnHold/index.js | 2 +- .../voiceMusicOnHold.attributes.js | 2 +- .../voiceMusicOnHold.controller.js | 2 +- .../api/voiceMusicOnHold/voiceMusicOnHold.model.js | 2 +- .../api/voiceMusicOnHold/voiceMusicOnHold.rpc.js | 2 +- server/api/voicePrefix/index.js | 2 +- server/api/voicePrefix/voicePrefix.attributes.js | 2 +- server/api/voicePrefix/voicePrefix.controller.js | 2 +- server/api/voicePrefix/voicePrefix.events.js | 2 +- server/api/voicePrefix/voicePrefix.model.js | 2 +- server/api/voicePrefix/voicePrefix.rpc.js | 2 +- server/api/voicePrefix/voicePrefix.socket.js | 2 +- server/api/voiceQueue/index.js | 2 +- server/api/voiceQueue/voiceQueue.attributes.js | 2 +- server/api/voiceQueue/voiceQueue.controller.js | 2 +- server/api/voiceQueue/voiceQueue.events.js | 2 +- server/api/voiceQueue/voiceQueue.model.js | 2 +- server/api/voiceQueue/voiceQueue.rpc.js | 2 +- server/api/voiceQueue/voiceQueue.socket.js | 2 +- server/api/voiceQueueReport/index.js | 2 +- .../voiceQueueReport.attributes.js | 2 +- .../voiceQueueReport.controller.js | 2 +- .../voiceQueueReport/voiceQueueReport.events.js | 2 +- .../api/voiceQueueReport/voiceQueueReport.model.js | 2 +- .../api/voiceQueueReport/voiceQueueReport.rpc.js | 2 +- .../voiceQueueReport/voiceQueueReport.socket.js | 2 +- server/api/voiceQueuesLog/index.js | 2 +- .../voiceQueuesLog/voiceQueuesLog.attributes.js | 2 +- .../voiceQueuesLog/voiceQueuesLog.controller.js | 2 +- server/api/voiceQueuesLog/voiceQueuesLog.model.js | 2 +- server/api/voiceQueuesLog/voiceQueuesLog.rpc.js | 2 +- server/api/voiceRecording/index.js | 2 +- .../voiceRecording/voiceRecording.attributes.js | 2 +- .../voiceRecording/voiceRecording.controller.js | 2 +- server/api/voiceRecording/voiceRecording.model.js | 2 +- server/api/voiceRecording/voiceRecording.rpc.js | 2 +- server/api/voiceTransferReport/index.js | 2 +- .../voiceTransferReport.attributes.js | 2 +- .../voiceTransferReport.controller.js | 2 +- .../voiceTransferReport.model.js | 2 +- .../voiceTransferReport/voiceTransferReport.rpc.js | 2 +- server/api/webbar/index.js | 2 +- server/api/webbar/webbar.controller.js | 2 +- server/api/whatsappAccount/index.js | 2 +- .../whatsappAccount/whatsappAccount.attributes.js | 2 +- .../whatsappAccount/whatsappAccount.controller.js | 2 +- .../api/whatsappAccount/whatsappAccount.events.js | 2 +- .../api/whatsappAccount/whatsappAccount.model.js | 2 +- server/api/whatsappAccount/whatsappAccount.rpc.js | 2 +- .../api/whatsappAccount/whatsappAccount.socket.js | 2 +- server/api/whatsappApplication/index.js | 2 +- .../whatsappApplication.attributes.js | 2 +- .../whatsappApplication.controller.js | 2 +- .../whatsappApplication.model.js | 2 +- .../whatsappApplication/whatsappApplication.rpc.js | 2 +- server/api/whatsappInteraction/index.js | 2 +- .../whatsappInteraction.attributes.js | 2 +- .../whatsappInteraction.controller.js | 2 +- .../whatsappInteraction.events.js | 2 +- .../whatsappInteraction.model.js | 2 +- .../whatsappInteraction/whatsappInteraction.rpc.js | 2 +- .../whatsappInteraction.socket.js | 2 +- server/api/whatsappMessage/index.js | 2 +- .../whatsappMessage/whatsappMessage.attributes.js | 2 +- .../whatsappMessage/whatsappMessage.controller.js | 2 +- .../api/whatsappMessage/whatsappMessage.events.js | 2 +- .../api/whatsappMessage/whatsappMessage.model.js | 2 +- server/api/whatsappMessage/whatsappMessage.rpc.js | 2 +- .../api/whatsappMessage/whatsappMessage.socket.js | 2 +- server/api/whatsappQueue/index.js | 2 +- .../api/whatsappQueue/whatsappQueue.attributes.js | 2 +- .../api/whatsappQueue/whatsappQueue.controller.js | 2 +- server/api/whatsappQueue/whatsappQueue.events.js | 2 +- server/api/whatsappQueue/whatsappQueue.model.js | 2 +- server/api/whatsappQueue/whatsappQueue.rpc.js | 2 +- server/api/whatsappQueue/whatsappQueue.socket.js | 2 +- server/api/whatsappQueueReport/index.js | 2 +- .../whatsappQueueReport.attributes.js | 2 +- .../whatsappQueueReport.controller.js | 2 +- .../whatsappQueueReport.model.js | 2 +- .../whatsappQueueReport/whatsappQueueReport.rpc.js | 2 +- server/api/whatsappTransferReport/index.js | 2 +- .../whatsappTransferReport.attributes.js | 2 +- .../whatsappTransferReport.controller.js | 2 +- .../whatsappTransferReport.model.js | 2 +- .../whatsappTransferReport.rpc.js | 2 +- server/app.js | 2 +- server/components/auth/service.js | 2 +- server/components/encryptor/index.js | 2 +- server/components/export/csv.js | 2 +- server/components/export/pdf.js | 2 +- server/components/export/xlsx.js | 2 +- server/components/extensions/rewrite.js | 2 +- server/components/import/cm/csv.js | 2 +- server/components/import/cm/csv2.js | 2 +- server/components/integrations/configuration.js | 2 +- server/components/interaction/service.js | 2 +- server/components/license/service.js | 2 +- server/components/parsers/advancedSearch.js | 2 +- server/components/parsers/qs.js | 2 +- server/config/express.js | 2 +- server/config/license/hardware.js | 2 +- server/config/license/index.js | 2 +- server/config/license/util.js | 2 +- server/config/local.env.js | 2 +- server/config/logger.js | 2 +- server/config/pm2/config.js | 2 +- server/config/pm2/index.js | 2 +- server/config/schedule/chat.js | 2 +- server/config/schedule/index.js | 2 +- server/config/schedule/transcribe.js | 2 +- server/config/schedule/whatsapp.js | 2 +- server/config/seedContact.js | 2 +- server/config/seedUsers.js | 2 +- server/config/socketio.js | 2 +- server/config/triggers/index.js | 2 +- server/config/utils.js | 2 +- server/errors/index.js | 2 +- server/mysqldb/index.js | 2 +- server/routes.js | 2 +- server/rpc/index.js | 2 +- server/services/agi/channel.js | 2 +- server/services/agi/error.js | 2 +- server/services/agi/graph/index.js | 2 +- server/services/agi/index.js | 2 +- server/services/agi/mailRpc/index.js | 2 +- server/services/agi/reply.js | 2 +- server/services/agi/rpc/index.js | 2 +- server/services/agi/scripts/aws/index.js | 2 +- server/services/agi/scripts/aws/lex/index.js | 2 +- server/services/agi/scripts/aws/lex/lib/api.js | 2 +- server/services/agi/scripts/aws/polly/index.js | 2 +- server/services/agi/scripts/aws/polly/lib/api.js | 2 +- server/services/agi/scripts/google/asr/index.js | 2 +- server/services/agi/scripts/google/asr/lib/api.js | 2 +- server/services/agi/scripts/google/index.js | 2 +- server/services/agi/scripts/index.js | 2 +- server/services/agi/scripts/sestek/index.js | 2 +- server/services/agi/scripts/sestek/nda/index.js | 2 +- server/services/agi/scripts/tilde/asr/index.js | 2 +- server/services/agi/scripts/tilde/asr/lib/api.js | 2 +- server/services/agi/scripts/tilde/index.js | 2 +- server/services/agi/server.js | 2 +- server/services/agi/vertices.js | 2 +- server/services/ami/acw/index.js | 2 +- server/services/ami/ami.js | 2 +- server/services/ami/client.js | 2 +- server/services/ami/dialer/action.js | 2 +- server/services/ami/dialer/agentComplete.js | 2 +- server/services/ami/dialer/final.js | 2 +- server/services/ami/dialer/hangup.js | 2 +- server/services/ami/dialer/history.js | 2 +- server/services/ami/dialer/index.js | 2 +- server/services/ami/dialer/queueCallerAbandon.js | 2 +- server/services/ami/fax/action.js | 2 +- server/services/ami/fax/index.js | 2 +- server/services/ami/fax/rpcDb.js | 2 +- server/services/ami/fax/util/gs.js | 2 +- server/services/ami/fax/util/util.js | 2 +- server/services/ami/index.js | 2 +- server/services/ami/model/agent.js | 2 +- server/services/ami/model/campaign.js | 2 +- server/services/ami/model/channel.js | 2 +- server/services/ami/model/deskAccount.js | 2 +- server/services/ami/model/dynamics365Account.js | 2 +- server/services/ami/model/faxAccount.js | 2 +- server/services/ami/model/freshdeskAccount.js | 2 +- server/services/ami/model/freshsalesAccount.js | 2 +- server/services/ami/model/queueReport.js | 2 +- server/services/ami/model/salesforceAccount.js | 2 +- server/services/ami/model/servicenowAccount.js | 2 +- server/services/ami/model/sugarcrmAccount.js | 2 +- server/services/ami/model/telephone.js | 2 +- server/services/ami/model/template.js | 2 +- server/services/ami/model/trigger.js | 2 +- server/services/ami/model/trunk.js | 2 +- server/services/ami/model/voiceExtension.js | 2 +- server/services/ami/model/voiceQueue.js | 2 +- server/services/ami/model/vtigerAccount.js | 2 +- server/services/ami/model/zendeskAccount.js | 2 +- server/services/ami/model/zohoAccount.js | 2 +- server/services/ami/preview/action.js | 2 +- server/services/ami/preview/index.js | 2 +- server/services/ami/preview/rpcDb.js | 2 +- server/services/ami/preview/util/util.js | 2 +- server/services/ami/properties.js | 2 +- server/services/ami/realtime/index.js | 2 +- server/services/ami/report/index.js | 2 +- server/services/ami/report/userReport.js | 2 +- server/services/ami/report/voiceAgentReport.js | 2 +- server/services/ami/report/voiceCallReport.js | 2 +- server/services/ami/report/voiceDialReport.js | 2 +- server/services/ami/report/voiceQueueReport.js | 2 +- server/services/ami/rpc/agentReportPreview.js | 2 +- server/services/ami/rpc/attachment.js | 2 +- server/services/ami/rpc/campaign.js | 2 +- server/services/ami/rpc/cmContact.js | 2 +- server/services/ami/rpc/cmHopper.js | 2 +- server/services/ami/rpc/cmHopperBlack.js | 2 +- server/services/ami/rpc/cmHopperFinal.js | 2 +- server/services/ami/rpc/cmHopperHistory.js | 2 +- server/services/ami/rpc/faxAccount.js | 2 +- server/services/ami/rpc/faxMessage.js | 2 +- server/services/ami/rpc/integrations/desk.js | 2 +- .../services/ami/rpc/integrations/dynamics365.js | 2 +- server/services/ami/rpc/integrations/freshdesk.js | 2 +- server/services/ami/rpc/integrations/freshsales.js | 2 +- server/services/ami/rpc/integrations/salesforce.js | 2 +- server/services/ami/rpc/integrations/servicenow.js | 2 +- server/services/ami/rpc/integrations/sugarcrm.js | 2 +- server/services/ami/rpc/integrations/vtiger.js | 2 +- server/services/ami/rpc/integrations/zendesk.js | 2 +- server/services/ami/rpc/integrations/zoho.js | 2 +- server/services/ami/rpc/memberReport.js | 2 +- server/services/ami/rpc/setting.js | 2 +- server/services/ami/rpc/template.js | 2 +- server/services/ami/rpc/trigger.js | 2 +- server/services/ami/rpc/trunk.js | 2 +- server/services/ami/rpc/user.js | 2 +- server/services/ami/rpc/voiceAgentReport.js | 2 +- server/services/ami/rpc/voiceCallReport.js | 2 +- server/services/ami/rpc/voiceDialReport.js | 2 +- server/services/ami/rpc/voiceExtension.js | 2 +- server/services/ami/rpc/voiceQueue.js | 2 +- server/services/ami/rpc/voiceQueueReport.js | 2 +- server/services/ami/rpc/voiceQueueRt.js | 2 +- server/services/ami/rpc/voiceRecording.js | 2 +- server/services/ami/rpc/voiceTransferReport.js | 2 +- server/services/ami/server/index.js | 2 +- server/services/ami/trigger/cmContact/index.js | 2 +- server/services/ami/trigger/index.js | 2 +- server/services/ami/trigger/integration/desk.js | 2 +- .../ami/trigger/integration/dynamics365.js | 2 +- .../services/ami/trigger/integration/freshdesk.js | 2 +- .../services/ami/trigger/integration/freshsales.js | 2 +- server/services/ami/trigger/integration/index.js | 2 +- .../services/ami/trigger/integration/salesforce.js | 2 +- .../services/ami/trigger/integration/servicenow.js | 2 +- .../services/ami/trigger/integration/sugarcrm.js | 2 +- server/services/ami/trigger/integration/util.js | 2 +- server/services/ami/trigger/integration/vtiger.js | 2 +- server/services/ami/trigger/integration/zendesk.js | 2 +- server/services/ami/trigger/integration/zoho.js | 2 +- server/services/ami/trigger/script/index.js | 2 +- server/services/ami/trigger/urlforward/index.js | 2 +- server/services/email/client.js | 2 +- server/services/email/index.js | 2 +- server/services/email/lib/email.js | 2 +- server/services/email/lib/imap.js | 2 +- server/services/email/lib/smtp.js | 2 +- server/services/email/lib/utils.js | 2 +- server/services/email/model/mailAccount.js | 2 +- server/services/email/realtime/index.js | 2 +- server/services/email/rpc/mailAccount.js | 2 +- server/services/email/rpc/setting.js | 2 +- server/services/email/server/index.js | 2 +- server/services/express/index.js | 2 +- server/services/routing/client.js | 2 +- server/services/routing/index.js | 2 +- server/services/routing/lib/rule-engine.js | 2 +- server/services/routing/mailRpc/index.js | 2 +- server/services/routing/model/agent.js | 2 +- server/services/routing/model/chatQueue.js | 2 +- server/services/routing/model/faxQueue.js | 2 +- server/services/routing/model/interval.js | 2 +- server/services/routing/model/mailQueue.js | 2 +- server/services/routing/model/openchannelQueue.js | 2 +- server/services/routing/model/smsQueue.js | 2 +- server/services/routing/model/whatsappQueue.js | 2 +- server/services/routing/realtime/index.js | 2 +- server/services/routing/rpc/chatInteraction.js | 2 +- server/services/routing/rpc/chatMessage.js | 2 +- server/services/routing/rpc/chatQueue.js | 2 +- server/services/routing/rpc/chatQueueReport.js | 2 +- server/services/routing/rpc/faxInteraction.js | 2 +- server/services/routing/rpc/faxMessage.js | 2 +- server/services/routing/rpc/faxQueue.js | 2 +- server/services/routing/rpc/faxQueueReport.js | 2 +- server/services/routing/rpc/interval.js | 2 +- server/services/routing/rpc/mailInteraction.js | 2 +- server/services/routing/rpc/mailMessage.js | 2 +- server/services/routing/rpc/mailQueue.js | 2 +- server/services/routing/rpc/mailQueueReport.js | 2 +- .../services/routing/rpc/openchannelInteraction.js | 2 +- server/services/routing/rpc/openchannelMessage.js | 2 +- server/services/routing/rpc/openchannelQueue.js | 2 +- .../services/routing/rpc/openchannelQueueReport.js | 2 +- server/services/routing/rpc/smsInteraction.js | 2 +- server/services/routing/rpc/smsMessage.js | 2 +- server/services/routing/rpc/smsQueue.js | 2 +- server/services/routing/rpc/smsQueueReport.js | 2 +- server/services/routing/rpc/user.js | 2 +- server/services/routing/rpc/whatsappInteraction.js | 2 +- server/services/routing/rpc/whatsappMessage.js | 2 +- server/services/routing/rpc/whatsappQueue.js | 2 +- server/services/routing/rpc/whatsappQueueReport.js | 2 +- .../services/routing/server/applications/agent.js | 2 +- .../routing/server/applications/amazonlex.js | 2 +- .../routing/server/applications/autoreply.js | 2 +- .../services/routing/server/applications/close.js | 2 +- .../routing/server/applications/dialogflow.js | 2 +- .../routing/server/applications/dialogflowV2.js | 2 +- .../services/routing/server/applications/gotoif.js | 2 +- .../services/routing/server/applications/gotop.js | 2 +- .../routing/server/applications/message.js | 2 +- .../services/routing/server/applications/noop.js | 2 +- .../services/routing/server/applications/queue.js | 2 +- .../routing/server/applications/strategy/agent.js | 2 +- .../server/applications/strategy/beepall.js | 2 +- .../routing/server/applications/strategy/index.js | 2 +- .../server/applications/strategy/rrmemory.js | 2 +- .../routing/server/applications/strategy/util.js | 2 +- .../services/routing/server/applications/system.js | 2 +- server/services/routing/server/applications/tag.js | 2 +- .../services/routing/server/applications/utils.js | 2 +- server/services/routing/server/index.js | 2 +- server/services/routing/server/interval.js | 2 +- server/services/xdr/agents.controller.js | 2 +- server/services/xdr/calls.controller.js | 2 +- server/services/xdr/core.controller.js | 2 +- server/services/xdr/dials.controller.js | 2 +- server/services/xdr/index.js | 2 +- server/services/xdr/members.controller.js | 2 +- server/services/xdr/queues.controller.js | 2 +- server/services/xdr/recordings.controller.js | 2 +- server/services/xdr/transfers.controller.js | 2 +- server/services/xdr/utils.js | 2 +- 1155 files changed, 1155 insertions(+), 1155 deletions(-) diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 1d991f1..0c9382f 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2021-09-10T08:04:40.836Z", + "time": "2021-09-10T08:21:38.468Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 1f5a7f6..966c017 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2021-09-10T08:04:40.836Z", + "time": "2021-09-10T08:21:38.468Z", "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 961b474..9e170bc 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 _0x7c09=['contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','urlForward[timeout],\x20browser[windowWidth]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','exports','VIRTUAL','getDataValue','action','STRING','contactManager','integration','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)]'];(function(_0x2a8ead,_0x595e7d){var _0x14ea81=function(_0x41c3ba){while(--_0x41c3ba){_0x2a8ead['push'](_0x2a8ead['shift']());}};_0x14ea81(++_0x595e7d);}(_0x7c09,0x102));var _0x97c0=function(_0x31ab85,_0x1a8001){_0x31ab85=_0x31ab85-0x0;var _0x5e7f39=_0x7c09[_0x31ab85];return _0x5e7f39;};'use strict';var Sequelize=require('sequelize');module[_0x97c0('0x0')]={'name':{'type':Sequelize[_0x97c0('0x1')],'get':function(_0x53ad71){return this[_0x97c0('0x2')](_0x97c0('0x3'));}},'action':{'type':Sequelize[_0x97c0('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x97c0('0x5'),_0x97c0('0x6'),_0x97c0('0x7'),_0x97c0('0x8'),'urlForward','browser','bot',_0x97c0('0x9')]],'msg':_0x97c0('0xa')}},'comment':_0x97c0('0xa')},'data1':{'type':Sequelize[_0x97c0('0x4')](0x1000),'comment':_0x97c0('0xb')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x97c0('0xc')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0x97c0('0xd')},'data4':{'type':Sequelize[_0x97c0('0x4')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0x97c0('0xe')},'data6':{'type':Sequelize[_0x97c0('0x4')],'comments':_0x97c0('0xf')},'data7':{'type':Sequelize[_0x97c0('0x10')],'comments':_0x97c0('0x11')}}; \ No newline at end of file +var _0xa6b0=['integration','motionbar','jscripty','urlForward','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)]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','getDataValue','action','STRING'];(function(_0x4706a6,_0x5a1c63){var _0x1bb705=function(_0x484ebb){while(--_0x484ebb){_0x4706a6['push'](_0x4706a6['shift']());}};_0x1bb705(++_0x5a1c63);}(_0xa6b0,0xaf));var _0x0a6b=function(_0x5a77f6,_0x177a7c){_0x5a77f6=_0x5a77f6-0x0;var _0x35ed9e=_0xa6b0[_0x5a77f6];return _0x35ed9e;};'use strict';var Sequelize=require(_0x0a6b('0x0'));module[_0x0a6b('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x4e988a){return this[_0x0a6b('0x2')](_0x0a6b('0x3'));}},'action':{'type':Sequelize[_0x0a6b('0x4')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0x0a6b('0x5'),_0x0a6b('0x6'),_0x0a6b('0x7'),_0x0a6b('0x8'),_0x0a6b('0x9'),_0x0a6b('0xa'),_0x0a6b('0xb')]],'msg':_0x0a6b('0xc')}},'comment':_0x0a6b('0xc')},'data1':{'type':Sequelize[_0x0a6b('0x4')](0x1000),'comment':_0x0a6b('0xd')},'data2':{'type':Sequelize[_0x0a6b('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['STRING'](0x1000),'comment':_0x0a6b('0xe')},'data4':{'type':Sequelize[_0x0a6b('0x4')](0x1000),'comments':_0x0a6b('0xf')},'data5':{'type':Sequelize[_0x0a6b('0x4')](0x1000),'comments':_0x0a6b('0x10')},'data6':{'type':Sequelize[_0x0a6b('0x4')],'comments':_0x0a6b('0x11')},'data7':{'type':Sequelize[_0x0a6b('0x12')],'comments':_0x0a6b('0x13')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index b8b21ac..dbee071 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 _0xaf5e=['rimraf','request-promise','moment','bluebird','path','sox','ejs','fs-extra','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/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','Content-Range','apply','reject','update','then','destroy','end','stack','name','send','body','Action','find','params','catch'];(function(_0x1f339f,_0x33c107){var _0x278e86=function(_0x3f8f16){while(--_0x3f8f16){_0x1f339f['push'](_0x1f339f['shift']());}};_0x278e86(++_0x33c107);}(_0xaf5e,0x142));var _0xeaf5=function(_0x3b8a62,_0x19c90c){_0x3b8a62=_0x3b8a62-0x0;var _0x22dce3=_0xaf5e[_0x3b8a62];return _0x22dce3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xeaf5('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xeaf5('0x1'));var moment=require(_0xeaf5('0x2'));var BPromise=require(_0xeaf5('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xeaf5('0x4'));var sox=require(_0xeaf5('0x5'));var csv=require('to-csv');var ejs=require(_0xeaf5('0x6'));var fs=require('fs');var fs_extra=require(_0xeaf5('0x7'));var _=require('lodash');var squel=require(_0xeaf5('0x8'));var crypto=require(_0xeaf5('0x9'));var jsforce=require(_0xeaf5('0xa'));var deskjs=require(_0xeaf5('0xb'));var toCsv=require(_0xeaf5('0xc'));var querystring=require(_0xeaf5('0xd'));var Papa=require(_0xeaf5('0xe'));var Redis=require(_0xeaf5('0xf'));var authService=require(_0xeaf5('0x10'));var qs=require(_0xeaf5('0x11'));var as=require(_0xeaf5('0x12'));var hardwareService=require(_0xeaf5('0x13'));var logger=require(_0xeaf5('0x14'))('api');var utils=require(_0xeaf5('0x15'));var config=require(_0xeaf5('0x16'));var licenseUtil=require(_0xeaf5('0x17'));var db=require(_0xeaf5('0x18'))['db'];function respondWithStatusCode(_0x1d6bb5,_0x2f78fe){_0x2f78fe=_0x2f78fe||0xcc;return function(_0x4f802f){if(_0x4f802f){return _0x1d6bb5[_0xeaf5('0x19')](_0x2f78fe);}return _0x1d6bb5['status'](_0x2f78fe)['end']();};}function respondWithResult(_0x353e7a,_0x213b09){_0x213b09=_0x213b09||0xc8;return function(_0x430901){if(_0x430901){return _0x353e7a[_0xeaf5('0x1a')](_0x213b09)['json'](_0x430901);}};}function respondWithFilteredResult(_0x5354d2,_0x5d2ea9){return function(_0x472238){if(_0x472238){var _0xe4e4c7=typeof _0x5d2ea9[_0xeaf5('0x1b')]==='undefined'&&typeof _0x5d2ea9[_0xeaf5('0x1c')]===_0xeaf5('0x1d');var _0x4c985a=_0x472238[_0xeaf5('0x1e')];var _0xb7419b=_0xe4e4c7?0x0:_0x5d2ea9[_0xeaf5('0x1b')];var _0x3ae9b0=_0xe4e4c7?_0x472238[_0xeaf5('0x1e')]:_0x5d2ea9['offset']+_0x5d2ea9[_0xeaf5('0x1c')];var _0x4a8bf0;if(_0x3ae9b0>=_0x4c985a){_0x3ae9b0=_0x4c985a;_0x4a8bf0=0xc8;}else{_0x4a8bf0=0xce;}_0x5354d2['status'](_0x4a8bf0);return _0x5354d2['set'](_0xeaf5('0x1f'),_0xb7419b+'-'+_0x3ae9b0+'/'+_0x4c985a)['json'](_0x472238);}return null;};}function patchUpdates(_0x587131){return function(_0x17a4cc){try{jsonpatch[_0xeaf5('0x20')](_0x17a4cc,_0x587131,!![]);}catch(_0x2f09e0){return BPromise[_0xeaf5('0x21')](_0x2f09e0);}return _0x17a4cc['save']();};}function saveUpdates(_0x5d700f,_0x2ae0fc){return function(_0x5dcba4){if(_0x5dcba4){return _0x5dcba4[_0xeaf5('0x22')](_0x5d700f)[_0xeaf5('0x23')](function(_0x3d0afa){return _0x3d0afa;});}return null;};}function removeEntity(_0x25940a,_0x416b90){return function(_0x36155a){if(_0x36155a){return _0x36155a[_0xeaf5('0x24')]()[_0xeaf5('0x23')](function(){_0x25940a[_0xeaf5('0x1a')](0xcc)[_0xeaf5('0x25')]();});}};}function handleEntityNotFound(_0x1d8162,_0x3f594e){return function(_0x280b3a){if(!_0x280b3a){_0x1d8162[_0xeaf5('0x19')](0x194);}return _0x280b3a;};}function handleError(_0x749abd,_0x53facc){_0x53facc=_0x53facc||0x1f4;return function(_0xa57ad7){logger['error'](_0xa57ad7[_0xeaf5('0x26')]);if(_0xa57ad7[_0xeaf5('0x27')]){delete _0xa57ad7['name'];}_0x749abd['status'](_0x53facc)[_0xeaf5('0x28')](_0xa57ad7);};}exports[_0xeaf5('0x22')]=function(_0x5159be,_0x366ed1){if(_0x5159be[_0xeaf5('0x29')]['id']){delete _0x5159be[_0xeaf5('0x29')]['id'];}return db[_0xeaf5('0x2a')][_0xeaf5('0x2b')]({'where':{'id':_0x5159be['params']['id']}})['then'](handleEntityNotFound(_0x366ed1,null))[_0xeaf5('0x23')](saveUpdates(_0x5159be['body'],null))['then'](respondWithResult(_0x366ed1,null))['catch'](handleError(_0x366ed1,null));};exports[_0xeaf5('0x24')]=function(_0x46819b,_0x14a9a2){return db[_0xeaf5('0x2a')][_0xeaf5('0x2b')]({'where':{'id':_0x46819b[_0xeaf5('0x2c')]['id']}})[_0xeaf5('0x23')](handleEntityNotFound(_0x14a9a2,null))['then'](removeEntity(_0x14a9a2,null))[_0xeaf5('0x2d')](handleError(_0x14a9a2,null));}; \ No newline at end of file +var _0x0c61=['Content-Range','save','update','then','sendStatus','error','name','send','body','Action','params','catch','destroy','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set'];(function(_0x162a5c,_0xd1056a){var _0x319be9=function(_0x537130){while(--_0x537130){_0x162a5c['push'](_0x162a5c['shift']());}};_0x319be9(++_0xd1056a);}(_0x0c61,0x16e));var _0x10c6=function(_0x295a3d,_0x56d487){_0x295a3d=_0x295a3d-0x0;var _0x23a732=_0x0c61[_0x295a3d];return _0x23a732;};'use strict';var emlformat=require(_0x10c6('0x0'));var rimraf=require(_0x10c6('0x1'));var zipdir=require(_0x10c6('0x2'));var jsonpatch=require(_0x10c6('0x3'));var rp=require('request-promise');var moment=require(_0x10c6('0x4'));var BPromise=require(_0x10c6('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x10c6('0x6'));var sox=require(_0x10c6('0x7'));var csv=require(_0x10c6('0x8'));var ejs=require(_0x10c6('0x9'));var fs=require('fs');var fs_extra=require(_0x10c6('0xa'));var _=require('lodash');var squel=require(_0x10c6('0xb'));var crypto=require(_0x10c6('0xc'));var jsforce=require(_0x10c6('0xd'));var deskjs=require(_0x10c6('0xe'));var toCsv=require(_0x10c6('0x8'));var querystring=require(_0x10c6('0xf'));var Papa=require(_0x10c6('0x10'));var Redis=require('ioredis');var authService=require(_0x10c6('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x10c6('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x10c6('0x13'))(_0x10c6('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x10c6('0x15'));var db=require(_0x10c6('0x16'))['db'];function respondWithStatusCode(_0x4719bb,_0x54ca05){_0x54ca05=_0x54ca05||0xcc;return function(_0x1a3522){if(_0x1a3522){return _0x4719bb['sendStatus'](_0x54ca05);}return _0x4719bb[_0x10c6('0x17')](_0x54ca05)[_0x10c6('0x18')]();};}function respondWithResult(_0x164c94,_0x529279){_0x529279=_0x529279||0xc8;return function(_0x195f63){if(_0x195f63){return _0x164c94[_0x10c6('0x17')](_0x529279)['json'](_0x195f63);}};}function respondWithFilteredResult(_0x38b979,_0x42ddd7){return function(_0x30ebee){if(_0x30ebee){var _0x295eb8=typeof _0x42ddd7[_0x10c6('0x19')]===_0x10c6('0x1a')&&typeof _0x42ddd7[_0x10c6('0x1b')]===_0x10c6('0x1a');var _0x1d0860=_0x30ebee[_0x10c6('0x1c')];var _0x1e6336=_0x295eb8?0x0:_0x42ddd7['offset'];var _0xb2020d=_0x295eb8?_0x30ebee['count']:_0x42ddd7[_0x10c6('0x19')]+_0x42ddd7[_0x10c6('0x1b')];var _0x3263c7;if(_0xb2020d>=_0x1d0860){_0xb2020d=_0x1d0860;_0x3263c7=0xc8;}else{_0x3263c7=0xce;}_0x38b979[_0x10c6('0x17')](_0x3263c7);return _0x38b979[_0x10c6('0x1d')](_0x10c6('0x1e'),_0x1e6336+'-'+_0xb2020d+'/'+_0x1d0860)['json'](_0x30ebee);}return null;};}function patchUpdates(_0x3406a6){return function(_0x34c237){try{jsonpatch['apply'](_0x34c237,_0x3406a6,!![]);}catch(_0x43fa5e){return BPromise['reject'](_0x43fa5e);}return _0x34c237[_0x10c6('0x1f')]();};}function saveUpdates(_0x8a98fb,_0x479dc8){return function(_0x2bc32c){if(_0x2bc32c){return _0x2bc32c[_0x10c6('0x20')](_0x8a98fb)['then'](function(_0x4b06d7){return _0x4b06d7;});}return null;};}function removeEntity(_0x4d9c9d,_0x596ac4){return function(_0x125405){if(_0x125405){return _0x125405['destroy']()[_0x10c6('0x21')](function(){_0x4d9c9d[_0x10c6('0x17')](0xcc)[_0x10c6('0x18')]();});}};}function handleEntityNotFound(_0x2aa401,_0x3e0ae3){return function(_0x167829){if(!_0x167829){_0x2aa401[_0x10c6('0x22')](0x194);}return _0x167829;};}function handleError(_0x41279a,_0x2907fc){_0x2907fc=_0x2907fc||0x1f4;return function(_0x2a425d){logger[_0x10c6('0x23')](_0x2a425d['stack']);if(_0x2a425d[_0x10c6('0x24')]){delete _0x2a425d['name'];}_0x41279a['status'](_0x2907fc)[_0x10c6('0x25')](_0x2a425d);};}exports[_0x10c6('0x20')]=function(_0x12e16e,_0x131874){if(_0x12e16e[_0x10c6('0x26')]['id']){delete _0x12e16e['body']['id'];}return db[_0x10c6('0x27')]['find']({'where':{'id':_0x12e16e[_0x10c6('0x28')]['id']}})[_0x10c6('0x21')](handleEntityNotFound(_0x131874,null))[_0x10c6('0x21')](saveUpdates(_0x12e16e[_0x10c6('0x26')],null))[_0x10c6('0x21')](respondWithResult(_0x131874,null))[_0x10c6('0x29')](handleError(_0x131874,null));};exports[_0x10c6('0x2a')]=function(_0x528eed,_0x2e84ee){return db[_0x10c6('0x27')][_0x10c6('0x2b')]({'where':{'id':_0x528eed[_0x10c6('0x28')]['id']}})[_0x10c6('0x21')](handleEntityNotFound(_0x2e84ee,null))[_0x10c6('0x21')](removeEntity(_0x2e84ee,null))['catch'](handleError(_0x2e84ee,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 4e3f328..3d749f5 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 _0x1872=['rimraf','../../config/environment','Action','tools_actions','lodash','util','../../config/logger','request-promise','path'];(function(_0x151002,_0x1c9af6){var _0x1a7a58=function(_0x282ec3){while(--_0x282ec3){_0x151002['push'](_0x151002['shift']());}};_0x1a7a58(++_0x1c9af6);}(_0x1872,0xa6));var _0x2187=function(_0xed01eb,_0x275edb){_0xed01eb=_0xed01eb-0x0;var _0x25b9de=_0x1872[_0xed01eb];return _0x25b9de;};'use strict';var _=require(_0x2187('0x0'));var util=require(_0x2187('0x1'));var logger=require(_0x2187('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2187('0x3'));var fs=require('fs');var path=require(_0x2187('0x4'));var rimraf=require(_0x2187('0x5'));var config=require(_0x2187('0x6'));var attributes=require('./action.attributes');module['exports']=function(_0x111d4f,_0x4135be){return _0x111d4f['define'](_0x2187('0x7'),attributes,{'tableName':_0x2187('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd7ed=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./action.attributes','exports','define','lodash'];(function(_0xc10210,_0x38f8aa){var _0x35ee70=function(_0xdbb978){while(--_0xdbb978){_0xc10210['push'](_0xc10210['shift']());}};_0x35ee70(++_0x38f8aa);}(_0xd7ed,0x1a1));var _0xdd7e=function(_0x1a72f3,_0x217011){_0x1a72f3=_0x1a72f3-0x0;var _0x57ef47=_0xd7ed[_0x1a72f3];return _0x57ef47;};'use strict';var _=require(_0xdd7e('0x0'));var util=require('util');var logger=require(_0xdd7e('0x1'))(_0xdd7e('0x2'));var moment=require('moment');var BPromise=require(_0xdd7e('0x3'));var rp=require(_0xdd7e('0x4'));var fs=require('fs');var path=require(_0xdd7e('0x5'));var rimraf=require(_0xdd7e('0x6'));var config=require(_0xdd7e('0x7'));var attributes=require(_0xdd7e('0x8'));module[_0xdd7e('0x9')]=function(_0x3baff0,_0x46e7df){return _0x3baff0[_0xdd7e('0xa')]('Action',attributes,{'tableName':'tools_actions','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 c9d115c..c131a5f 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 _0x326f=['info','Action,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x3829e7,_0x21ea4e){var _0x30dc68=function(_0x37ca4a){while(--_0x37ca4a){_0x3829e7['push'](_0x3829e7['shift']());}};_0x30dc68(++_0x21ea4e);}(_0x326f,0xd1));var _0xf326=function(_0x4b4623,_0xb74b4d){_0x4b4623=_0x4b4623-0x0;var _0x10a138=_0x326f[_0x4b4623];return _0x10a138;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf326('0x1'));var rs=require(_0xf326('0x2'));var fs=require('fs');var Redis=require(_0xf326('0x3'));var db=require(_0xf326('0x4'))['db'];var utils=require(_0xf326('0x5'));var logger=require(_0xf326('0x6'))(_0xf326('0x7'));var config=require(_0xf326('0x8'));var jayson=require(_0xf326('0x9'));var client=jayson[_0xf326('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c254d,_0x3851eb,_0x165f95){return new BPromise(function(_0x1e7b8a,_0x515bfa){return client['request'](_0x3c254d,_0x165f95)['then'](function(_0x3bacf2){logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));logger[_0xf326('0xe')]('Action,\x20%s,\x20%s,\x20%s',_0x3851eb,_0xf326('0xd'),JSON['stringify'](_0x3bacf2));if(_0x3bacf2[_0xf326('0xf')]){if(_0x3bacf2['error'][_0xf326('0x10')]===0x1f4){logger['error'](_0xf326('0xc'),_0x3851eb,_0x3bacf2[_0xf326('0xf')]['message']);return _0x515bfa(_0x3bacf2[_0xf326('0xf')][_0xf326('0x11')]);}logger[_0xf326('0xf')](_0xf326('0xc'),_0x3851eb,_0x3bacf2['error'][_0xf326('0x11')]);return _0x1e7b8a(_0x3bacf2['error']['message']);}else{logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));_0x1e7b8a(_0x3bacf2[_0xf326('0x12')][_0xf326('0x11')]);}})[_0xf326('0x13')](function(_0x34128e){logger[_0xf326('0xf')]('Action,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});} \ No newline at end of file +var _0x5fab=['../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Action,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x5ae4b6,_0x31540b){var _0x26ad27=function(_0x189703){while(--_0x189703){_0x5ae4b6['push'](_0x5ae4b6['shift']());}};_0x26ad27(++_0x31540b);}(_0x5fab,0x177));var _0xb5fa=function(_0x5db99b,_0xdee23a){_0x5db99b=_0x5db99b-0x0;var _0x4b2d0e=_0x5fab[_0x5db99b];return _0x4b2d0e;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var moment=require('moment');var BPromise=require(_0xb5fa('0x2'));var rs=require(_0xb5fa('0x3'));var fs=require('fs');var Redis=require(_0xb5fa('0x4'));var db=require(_0xb5fa('0x5'))['db'];var utils=require(_0xb5fa('0x6'));var logger=require(_0xb5fa('0x7'))(_0xb5fa('0x8'));var config=require(_0xb5fa('0x9'));var jayson=require(_0xb5fa('0xa'));var client=jayson[_0xb5fa('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d70f6,_0x2e3804,_0x1aec3e){return new BPromise(function(_0x9c7bce,_0x56d018){return client[_0xb5fa('0xc')](_0x5d70f6,_0x1aec3e)[_0xb5fa('0xd')](function(_0x2cf4a5){logger['info']('Action,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));logger[_0xb5fa('0xf')](_0xb5fa('0x10'),_0x2e3804,_0xb5fa('0xe'),JSON[_0xb5fa('0x11')](_0x2cf4a5));if(_0x2cf4a5[_0xb5fa('0x12')]){if(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x13')]===0x1f4){logger[_0xb5fa('0x12')]('Action,\x20%s,\x20%s',_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x56d018(_0x2cf4a5['error'][_0xb5fa('0x14')]);}logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x9c7bce(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);}else{logger['info']('Action,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));_0x9c7bce(_0x2cf4a5[_0xb5fa('0x16')][_0xb5fa('0x14')]);}})[_0xb5fa('0x17')](function(_0x56fe10){logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x56fe10);_0x56d018(_0x56fe10);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index d2e496a..beac9f7 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 _0x1cb5=['../../config/environment','./action.controller','put','/:id','update','delete','isAuthenticated','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x5ee68a,_0x22c32e){var _0x16e095=function(_0x40df1e){while(--_0x40df1e){_0x5ee68a['push'](_0x5ee68a['shift']());}};_0x16e095(++_0x22c32e);}(_0x1cb5,0x79));var _0x51cb=function(_0x38ac54,_0x5cd5d6){_0x38ac54=_0x38ac54-0x0;var _0xa03d8a=_0x1cb5[_0x38ac54];return _0xa03d8a;};'use strict';var multer=require(_0x51cb('0x0'));var util=require(_0x51cb('0x1'));var path=require('path');var timeout=require(_0x51cb('0x2'));var express=require(_0x51cb('0x3'));var router=express[_0x51cb('0x4')]();var fs_extra=require(_0x51cb('0x5'));var auth=require(_0x51cb('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x51cb('0x7'));var controller=require(_0x51cb('0x8'));router[_0x51cb('0x9')](_0x51cb('0xa'),auth['isAuthenticated'](),controller[_0x51cb('0xb')]);router[_0x51cb('0xc')](_0x51cb('0xa'),auth[_0x51cb('0xd')](),controller[_0x51cb('0xe')]);module[_0x51cb('0xf')]=router; \ No newline at end of file +var _0x19f0=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','/:id','update','delete','isAuthenticated','destroy','exports','multer','util','connect-timeout','express'];(function(_0x3715a9,_0x12efaa){var _0x249b88=function(_0x2e0ec1){while(--_0x2e0ec1){_0x3715a9['push'](_0x3715a9['shift']());}};_0x249b88(++_0x12efaa);}(_0x19f0,0x119));var _0x019f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x19f0[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x019f('0x0'));var util=require(_0x019f('0x1'));var path=require('path');var timeout=require(_0x019f('0x2'));var express=require(_0x019f('0x3'));var router=express['Router']();var fs_extra=require(_0x019f('0x4'));var auth=require(_0x019f('0x5'));var interaction=require(_0x019f('0x6'));var config=require(_0x019f('0x7'));var controller=require(_0x019f('0x8'));router['put'](_0x019f('0x9'),auth['isAuthenticated'](),controller[_0x019f('0xa')]);router[_0x019f('0xb')](_0x019f('0x9'),auth[_0x019f('0xc')](),controller[_0x019f('0xd')]);module[_0x019f('0xe')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 14c64c5..96dee0a 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 _0xee14=['STRING','TEXT'];(function(_0x15bd49,_0x5a6b04){var _0x5e5421=function(_0x1ee53d){while(--_0x1ee53d){_0x15bd49['push'](_0x15bd49['shift']());}};_0x5e5421(++_0x5a6b04);}(_0xee14,0x13a));var _0x4ee1=function(_0x25ea38,_0x3397c8){_0x25ea38=_0x25ea38-0x0;var _0x2cc556=_0xee14[_0x25ea38];return _0x2cc556;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4ee1('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0x4ee1('0x0')]},'parent':{'type':Sequelize[_0x4ee1('0x0')]},'table':{'type':Sequelize[_0x4ee1('0x0')]},'conditions':{'type':Sequelize[_0x4ee1('0x1')]},'joins':{'type':Sequelize[_0x4ee1('0x1')]}}; \ No newline at end of file +var _0x5fab=['exports','STRING','TEXT','sequelize'];(function(_0x291167,_0x482eff){var _0x102c7b=function(_0x5c2d5e){while(--_0x5c2d5e){_0x291167['push'](_0x291167['shift']());}};_0x102c7b(++_0x482eff);}(_0x5fab,0x177));var _0xb5fa=function(_0x3ebe6b,_0x50bbf7){_0x3ebe6b=_0x3ebe6b-0x0;var _0x334cfc=_0x5fab[_0x3ebe6b];return _0x334cfc;};'use strict';var Sequelize=require(_0xb5fa('0x0'));module[_0xb5fa('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xb5fa('0x2')]},'parent':{'type':Sequelize[_0xb5fa('0x2')]},'table':{'type':Sequelize[_0xb5fa('0x2')]},'conditions':{'type':Sequelize[_0xb5fa('0x3')]},'joins':{'type':Sequelize[_0xb5fa('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index e4073b5..19ad5ae 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 _0xdb2f=['rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','table','MetricId','metric','replace','function','format','groupBy','orderBy','DESC','joins','parse','foreignTable','foreignKey','parentKey','conditions','clone','toString','sequelize','QueryTypes','SELECT','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','DATE(%s)','IS\x20NOT\x20NULL','AnalyticMetric','select','from','alias','includes','output','web','fullPath','%s-%s.%s','randomstring','generate','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','info','Run\x20Query:','fork','../../files/reports','countTable','run','runReport','%s.%s\x20=\x20%s.%s','debug','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','fs-extra','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','update','then','get','CustomReports','UserProfileResource','destroy','end','stack','name','send','rawAttributes','type','key','model','map','query','keys','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','AnalyticCustomReport','includeAll','include','findAll','rows','show','params','fields','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','autoAssociation','error','find','preview','join','left_join','right_join','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY'];(function(_0x395b11,_0x311cdf){var _0x4380e7=function(_0x1ab6d9){while(--_0x1ab6d9){_0x395b11['push'](_0x395b11['shift']());}};_0x4380e7(++_0x311cdf);}(_0xdb2f,0x17f));var _0xfdb2=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xdb2f[_0xa1e3e3];return _0xc980e9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfdb2('0x0'));var zipdir=require(_0xfdb2('0x1'));var jsonpatch=require(_0xfdb2('0x2'));var rp=require('request-promise');var moment=require(_0xfdb2('0x3'));var BPromise=require(_0xfdb2('0x4'));var Mustache=require('mustache');var util=require(_0xfdb2('0x5'));var path=require(_0xfdb2('0x6'));var sox=require(_0xfdb2('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfdb2('0x8'));var _=require('lodash');var squel=require(_0xfdb2('0x9'));var crypto=require('crypto');var jsforce=require(_0xfdb2('0xa'));var deskjs=require(_0xfdb2('0xb'));var toCsv=require(_0xfdb2('0xc'));var querystring=require(_0xfdb2('0xd'));var Papa=require(_0xfdb2('0xe'));var Redis=require(_0xfdb2('0xf'));var authService=require(_0xfdb2('0x10'));var qs=require(_0xfdb2('0x11'));var as=require(_0xfdb2('0x12'));var hardwareService=require(_0xfdb2('0x13'));var logger=require(_0xfdb2('0x14'))(_0xfdb2('0x15'));var utils=require(_0xfdb2('0x16'));var config=require(_0xfdb2('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xfdb2('0x18'))['db'];var dbH=require(_0xfdb2('0x18'))['dbH'];function respondWithStatusCode(_0x171d22,_0x2a0a7e){_0x2a0a7e=_0x2a0a7e||0xcc;return function(_0x30dbff){if(_0x30dbff){return _0x171d22[_0xfdb2('0x19')](_0x2a0a7e);}return _0x171d22['status'](_0x2a0a7e)['end']();};}function respondWithResult(_0x86bc9a,_0x294ea8){_0x294ea8=_0x294ea8||0xc8;return function(_0x3a2ace){if(_0x3a2ace){return _0x86bc9a[_0xfdb2('0x1a')](_0x294ea8)[_0xfdb2('0x1b')](_0x3a2ace);}};}function respondWithFilteredResult(_0x2fd523,_0x9af4fa){return function(_0x2c0c33){if(_0x2c0c33){var _0x111d39=typeof _0x9af4fa[_0xfdb2('0x1c')]===_0xfdb2('0x1d')&&typeof _0x9af4fa['limit']==='undefined';var _0x1591f2=_0x2c0c33[_0xfdb2('0x1e')];var _0x2d2e1d=_0x111d39?0x0:_0x9af4fa[_0xfdb2('0x1c')];var _0x29d568=_0x111d39?_0x2c0c33['count']:_0x9af4fa[_0xfdb2('0x1c')]+_0x9af4fa[_0xfdb2('0x1f')];var _0x2ea965;if(_0x29d568>=_0x1591f2){_0x29d568=_0x1591f2;_0x2ea965=0xc8;}else{_0x2ea965=0xce;}_0x2fd523['status'](_0x2ea965);return _0x2fd523[_0xfdb2('0x20')](_0xfdb2('0x21'),_0x2d2e1d+'-'+_0x29d568+'/'+_0x1591f2)[_0xfdb2('0x1b')](_0x2c0c33);}return null;};}function patchUpdates(_0x173d0d){return function(_0x4a5809){try{jsonpatch['apply'](_0x4a5809,_0x173d0d,!![]);}catch(_0xefacf4){return BPromise['reject'](_0xefacf4);}return _0x4a5809['save']();};}function saveUpdates(_0x439108,_0xc70277){return function(_0x3d5601){if(_0x3d5601){return _0x3d5601[_0xfdb2('0x22')](_0x439108)[_0xfdb2('0x23')](function(_0xaf664c){return _0xaf664c;});}return null;};}function removeEntity(_0x115d60,_0x5bad11){return function(_0x222843){if(_0x222843){return _0x222843['destroy']()['then'](function(){var _0x5d77ad=_0x222843[_0xfdb2('0x24')]({'plain':!![]});var _0x22ee4c=_0xfdb2('0x25');return db[_0xfdb2('0x26')][_0xfdb2('0x27')]({'where':{'type':_0x22ee4c,'resourceId':_0x5d77ad['id']}})[_0xfdb2('0x23')](function(){return _0x222843;});})[_0xfdb2('0x23')](function(){_0x115d60[_0xfdb2('0x1a')](0xcc)[_0xfdb2('0x28')]();});}};}function handleEntityNotFound(_0xd92203,_0xaa7959){return function(_0x2d4065){if(!_0x2d4065){_0xd92203['sendStatus'](0x194);}return _0x2d4065;};}function handleError(_0x567a7c,_0x3dd2d9){_0x3dd2d9=_0x3dd2d9||0x1f4;return function(_0x1cd4e4){logger['error'](_0x1cd4e4[_0xfdb2('0x29')]);if(_0x1cd4e4[_0xfdb2('0x2a')]){delete _0x1cd4e4[_0xfdb2('0x2a')];}_0x567a7c[_0xfdb2('0x1a')](_0x3dd2d9)[_0xfdb2('0x2b')](_0x1cd4e4);};}exports['index']=function(_0x37fe6f,_0x67373f){var _0x4df906={},_0x1241ef={},_0xc97f03={'count':0x0,'rows':[]};var _0x1035a4=_['map'](db['AnalyticCustomReport'][_0xfdb2('0x2c')],function(_0xdbbec0){return{'name':_0xdbbec0['fieldName'],'type':_0xdbbec0[_0xfdb2('0x2d')][_0xfdb2('0x2e')]};});_0x1241ef[_0xfdb2('0x2f')]=_[_0xfdb2('0x30')](_0x1035a4,_0xfdb2('0x2a'));_0x1241ef[_0xfdb2('0x31')]=_[_0xfdb2('0x32')](_0x37fe6f[_0xfdb2('0x31')]);_0x1241ef['filters']=_['intersection'](_0x1241ef[_0xfdb2('0x2f')],_0x1241ef['query']);_0x4df906[_0xfdb2('0x33')]=_[_0xfdb2('0x34')](_0x1241ef[_0xfdb2('0x2f')],qs['fields'](_0x37fe6f[_0xfdb2('0x31')]['fields']));_0x4df906[_0xfdb2('0x33')]=_0x4df906[_0xfdb2('0x33')][_0xfdb2('0x35')]?_0x4df906['attributes']:_0x1241ef[_0xfdb2('0x2f')];if(!_0x37fe6f[_0xfdb2('0x31')][_0xfdb2('0x36')](_0xfdb2('0x37'))){_0x4df906[_0xfdb2('0x1f')]=qs[_0xfdb2('0x1f')](_0x37fe6f[_0xfdb2('0x31')][_0xfdb2('0x1f')]);_0x4df906[_0xfdb2('0x1c')]=qs[_0xfdb2('0x1c')](_0x37fe6f[_0xfdb2('0x31')][_0xfdb2('0x1c')]);}_0x4df906[_0xfdb2('0x38')]=qs['sort'](_0x37fe6f[_0xfdb2('0x31')][_0xfdb2('0x39')]);_0x4df906[_0xfdb2('0x3a')]=qs[_0xfdb2('0x3b')](_[_0xfdb2('0x3c')](_0x37fe6f[_0xfdb2('0x31')],_0x1241ef[_0xfdb2('0x3b')]),_0x1035a4);if(_0x37fe6f[_0xfdb2('0x31')][_0xfdb2('0x3d')]){_0x4df906[_0xfdb2('0x3a')]=_[_0xfdb2('0x3e')](_0x4df906[_0xfdb2('0x3a')],{'$or':_[_0xfdb2('0x30')](_0x1035a4,function(_0x3d17db){if(_0x3d17db[_0xfdb2('0x2d')]!==_0xfdb2('0x3f')){var _0x1fe7ce={};_0x1fe7ce[_0x3d17db['name']]={'$like':'%'+_0x37fe6f[_0xfdb2('0x31')]['filter']+'%'};return _0x1fe7ce;}})});}_0x4df906=_['merge']({},_0x4df906,_0x37fe6f[_0xfdb2('0x40')]);var _0x2c2613={'where':_0x4df906[_0xfdb2('0x3a')]};return db[_0xfdb2('0x41')][_0xfdb2('0x1e')](_0x2c2613)['then'](function(_0x33528b){_0xc97f03[_0xfdb2('0x1e')]=_0x33528b;if(_0x37fe6f['query'][_0xfdb2('0x42')]){_0x4df906[_0xfdb2('0x43')]=[{'all':!![]}];}return db[_0xfdb2('0x41')][_0xfdb2('0x44')](_0x4df906);})[_0xfdb2('0x23')](function(_0x1ae2ae){_0xc97f03[_0xfdb2('0x45')]=_0x1ae2ae;return _0xc97f03;})[_0xfdb2('0x23')](respondWithFilteredResult(_0x67373f,_0x4df906))['catch'](handleError(_0x67373f,null));};exports[_0xfdb2('0x46')]=function(_0xd8cac3,_0x193529){var _0x3bb043={'raw':![],'where':{'id':_0xd8cac3[_0xfdb2('0x47')]['id']}},_0x1fd5f2={};_0x1fd5f2[_0xfdb2('0x2f')]=_['keys'](db['AnalyticCustomReport'][_0xfdb2('0x2c')]);_0x1fd5f2['query']=_['keys'](_0xd8cac3[_0xfdb2('0x31')]);_0x1fd5f2['filters']=_[_0xfdb2('0x34')](_0x1fd5f2[_0xfdb2('0x2f')],_0x1fd5f2[_0xfdb2('0x31')]);_0x3bb043[_0xfdb2('0x33')]=_[_0xfdb2('0x34')](_0x1fd5f2['model'],qs[_0xfdb2('0x48')](_0xd8cac3[_0xfdb2('0x31')][_0xfdb2('0x48')]));_0x3bb043[_0xfdb2('0x33')]=_0x3bb043[_0xfdb2('0x33')][_0xfdb2('0x35')]?_0x3bb043[_0xfdb2('0x33')]:_0x1fd5f2[_0xfdb2('0x2f')];if(_0xd8cac3[_0xfdb2('0x31')][_0xfdb2('0x42')]){_0x3bb043[_0xfdb2('0x43')]=[{'all':!![]}];}_0x3bb043=_[_0xfdb2('0x3e')]({},_0x3bb043,_0xd8cac3['options']);return db[_0xfdb2('0x41')]['find'](_0x3bb043)[_0xfdb2('0x23')](handleEntityNotFound(_0x193529,null))['then'](respondWithResult(_0x193529,null))[_0xfdb2('0x49')](handleError(_0x193529,null));};exports['create']=function(_0x1bfca3,_0x18f991){return db[_0xfdb2('0x41')][_0xfdb2('0x4a')](_0x1bfca3[_0xfdb2('0x4b')],{})[_0xfdb2('0x23')](function(_0x2750c7){var _0x326935=_0x1bfca3['user'][_0xfdb2('0x24')]({'plain':!![]});if(!_0x326935)throw new Error(_0xfdb2('0x4c'));if(_0x326935[_0xfdb2('0x4d')]===_0xfdb2('0x4e')){var _0x70e6f0=_0x2750c7['get']({'plain':!![]});var _0x5b31c2='Reports';return db['UserProfileSection']['find']({'where':{'name':_0x5b31c2,'userProfileId':_0x326935['userProfileId']},'raw':!![]})[_0xfdb2('0x23')](function(_0x324331){if(_0x324331&&_0x324331[_0xfdb2('0x4f')]===0x0){return db[_0xfdb2('0x26')]['create']({'name':_0x70e6f0[_0xfdb2('0x2a')],'resourceId':_0x70e6f0['id'],'type':_0xfdb2('0x25'),'sectionId':_0x324331['id']},{})['then'](function(){return _0x2750c7;});}else{return _0x2750c7;}})[_0xfdb2('0x49')](function(_0x29e3e8){logger[_0xfdb2('0x50')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x29e3e8);throw _0x29e3e8;});}return _0x2750c7;})[_0xfdb2('0x23')](respondWithResult(_0x18f991,0xc9))[_0xfdb2('0x49')](handleError(_0x18f991,null));};exports['update']=function(_0x263fa2,_0x5abc06){if(_0x263fa2[_0xfdb2('0x4b')]['id']){delete _0x263fa2[_0xfdb2('0x4b')]['id'];}return db[_0xfdb2('0x41')][_0xfdb2('0x51')]({'where':{'id':_0x263fa2[_0xfdb2('0x47')]['id']}})[_0xfdb2('0x23')](handleEntityNotFound(_0x5abc06,null))[_0xfdb2('0x23')](saveUpdates(_0x263fa2['body'],null))[_0xfdb2('0x23')](respondWithResult(_0x5abc06,null))['catch'](handleError(_0x5abc06,null));};exports['destroy']=function(_0x2cd4a4,_0x526b4f){return db[_0xfdb2('0x41')][_0xfdb2('0x51')]({'where':{'id':_0x2cd4a4[_0xfdb2('0x47')]['id']}})[_0xfdb2('0x23')](handleEntityNotFound(_0x526b4f,null))[_0xfdb2('0x23')](removeEntity(_0x526b4f,null))[_0xfdb2('0x49')](handleError(_0x526b4f,null));};exports[_0xfdb2('0x52')]=function(_0x5236d9,_0x5f0205){var _0x573307=0xa;var _0xcc9cff=[_0xfdb2('0x53'),_0xfdb2('0x54'),_0xfdb2('0x55'),'cross_join'];var _0x486d9b={'SUM':'SUM(%s)','COUNT':_0xfdb2('0x56'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xfdb2('0x57'),'MIN':_0xfdb2('0x58'),'AVG':_0xfdb2('0x59'),'GROUP_CONCAT':_0xfdb2('0x5a'),'GROUP_CONCAT ASC':_0xfdb2('0x5b'),'GROUP_CONCAT DESC':_0xfdb2('0x5c')};var _0x16284e={'SEC_TO_TIME':_0xfdb2('0x5d'),'DATE':'DATE(%s)','HOUR':_0xfdb2('0x5e'),'ROUND':_0xfdb2('0x5f'),'UNIX_TIMESTAMP':_0xfdb2('0x60')};var _0x46f5ad=function(_0x3981c1){return!_['includes']([_0xfdb2('0x61'),'IS\x20NOT\x20NULL',_0xfdb2('0x62'),_0xfdb2('0x63')],_0x3981c1);};var _0x1ad9b9=function(_0x25c0a5){if(!_0x25c0a5||!_0x25c0a5[_0xfdb2('0x64')][_0xfdb2('0x35')]){return'';}for(var _0x5bc7da='(',_0xe67cca=0x0;_0xe67cca<_0x25c0a5[_0xfdb2('0x64')][_0xfdb2('0x35')];_0xe67cca+=0x1){_0xe67cca>0x0&&(_0x5bc7da+='\x20'+_0x25c0a5[_0xfdb2('0x65')]+'\x20');_0x5bc7da+=_0x25c0a5[_0xfdb2('0x64')][_0xe67cca][_0xfdb2('0x66')]?_0x1ad9b9(_0x25c0a5[_0xfdb2('0x64')][_0xe67cca][_0xfdb2('0x66')]):_0x25c0a5[_0xfdb2('0x64')][_0xe67cca][_0xfdb2('0x67')]+'\x20'+_0x25c0a5[_0xfdb2('0x64')][_0xe67cca][_0xfdb2('0x68')]+(_0x46f5ad(_0x25c0a5['rules'][_0xe67cca]['condition'])?'\x20'+_0x25c0a5[_0xfdb2('0x64')][_0xe67cca][_0xfdb2('0x69')]:'');}return _0x5bc7da+')';};var _0x4e7b4f={'where':{'id':_0x5236d9[_0xfdb2('0x47')]['id']}},_0x1af3ea,_0x1c9fe5,_0x3f1262,_0x31bbe6,_0x5f40b7;_0x4e7b4f=_[_0xfdb2('0x3e')]({},_0x4e7b4f,_0x5236d9[_0xfdb2('0x40')]);return db['AnalyticCustomReport'][_0xfdb2('0x51')](_0x4e7b4f)[_0xfdb2('0x23')](function(_0x432a14){if(_0x432a14){_0x1af3ea=_0x432a14;return _0x432a14[_0xfdb2('0x6a')]();}return null;})[_0xfdb2('0x23')](function(_0x412fa2){if(_0x412fa2){if(!_0x412fa2['length']){throw new db[(_0xfdb2('0x6b'))][(_0xfdb2('0x6c'))](_0xfdb2('0x6d'),0x193);}_0x1c9fe5=_0x412fa2;return db['AnalyticMetric'][_0xfdb2('0x44')]({'raw':!![]});}return null;})[_0xfdb2('0x23')](function(_0x1d613a){if(_0x1d613a){_0x3f1262=_['keyBy'](_0x1d613a,'id');var _0x15bd96;var _0x35344b=squel['select']();_0x35344b['from'](_0x1af3ea[_0xfdb2('0x6e')]);for(var _0x103de3=0x0;_0x103de3<_0x1c9fe5[_0xfdb2('0x35')];_0x103de3+=0x1){_0x15bd96=_0x1c9fe5[_0x103de3][_0xfdb2('0x6f')]?_0x3f1262[_0x1c9fe5[_0x103de3]['MetricId']][_0xfdb2('0x70')]:_0x1c9fe5[_0x103de3][_0xfdb2('0x67')];_0x15bd96=_0x1c9fe5[_0x103de3]['function']?_[_0xfdb2('0x71')](_0x486d9b[_0x1c9fe5[_0x103de3][_0xfdb2('0x72')]],'%s',_0x15bd96):_0x15bd96;_0x15bd96=_0x1c9fe5[_0x103de3][_0xfdb2('0x73')]?_[_0xfdb2('0x71')](_0x16284e[_0x1c9fe5[_0x103de3]['format']],'%s',_0x15bd96):_0x15bd96;if(_0x1c9fe5[_0x103de3][_0xfdb2('0x74')]){_0x35344b[_0xfdb2('0x66')](_0x15bd96);}_0x1c9fe5[_0x103de3][_0xfdb2('0x75')]&&_0x35344b[_0xfdb2('0x38')](_0x15bd96,_0x1c9fe5[_0x103de3]['orderBy']===_0xfdb2('0x76')?![]:!![]);_0x35344b[_0xfdb2('0x67')](_0x15bd96,_0x1c9fe5[_0x103de3]['alias']||_0x15bd96);}if(_0x1af3ea[_0xfdb2('0x77')]){_0x1af3ea['joins']=JSON[_0xfdb2('0x78')](_0x1af3ea[_0xfdb2('0x77')]);for(var _0x1ed34d=0x0;_0x1ed34d<_0x1af3ea['joins'][_0xfdb2('0x35')];_0x1ed34d+=0x1){if(_0x1af3ea[_0xfdb2('0x77')][_0x1ed34d][_0xfdb2('0x2d')]&&_['includes'](_0xcc9cff,_0x1af3ea[_0xfdb2('0x77')][_0x1ed34d][_0xfdb2('0x2d')])&&_0x1af3ea[_0xfdb2('0x77')][_0x1ed34d]['parentKey']&&_0x1af3ea['joins'][_0x1ed34d][_0xfdb2('0x79')]&&_0x1af3ea[_0xfdb2('0x77')][_0x1ed34d][_0xfdb2('0x7a')]){_0x35344b[_0x1af3ea[_0xfdb2('0x77')][_0x1ed34d]['type']](_0x1af3ea[_0xfdb2('0x77')][_0x1ed34d]['foreignTable'],null,util['format']('%s.%s\x20=\x20%s.%s',_0x1af3ea[_0xfdb2('0x6e')],_0x1af3ea[_0xfdb2('0x77')][_0x1ed34d][_0xfdb2('0x7b')],_0x1af3ea[_0xfdb2('0x77')][_0x1ed34d][_0xfdb2('0x79')],_0x1af3ea[_0xfdb2('0x77')][_0x1ed34d]['foreignKey']));}}}if(_0x1af3ea[_0xfdb2('0x7c')]){_0x1af3ea[_0xfdb2('0x7c')]=JSON[_0xfdb2('0x78')](_0x1af3ea[_0xfdb2('0x7c')]);_0x35344b[_0xfdb2('0x3a')](_0x1ad9b9(_0x1af3ea[_0xfdb2('0x7c')][_0xfdb2('0x66')]));}_0x5f40b7=_0x35344b[_0xfdb2('0x7d')]();_0x35344b[_0xfdb2('0x1f')](_0x573307);_0x35344b[_0xfdb2('0x1c')](0x0);logger['debug']('Limited\x20Query:',_0x35344b[_0xfdb2('0x7e')]());return dbH[_0xfdb2('0x7f')][_0xfdb2('0x31')](_0x35344b[_0xfdb2('0x7e')](),{'type':dbH['sequelize'][_0xfdb2('0x80')][_0xfdb2('0x81')]});}})[_0xfdb2('0x23')](respondWithResult(_0x5f0205,null))[_0xfdb2('0x49')](handleError(_0x5f0205,null));};function runReport(_0x5d75db,_0x11b6ee,_0x4b160d){var _0x8ff979=_0x11b6ee[_0xfdb2('0x2a')];var _0x7e5529=0xa;var _0x4da2d2=[_0xfdb2('0x53'),'left_join','right_join',_0xfdb2('0x82')];var _0x300462={'SUM':_0xfdb2('0x83'),'COUNT':_0xfdb2('0x56'),'COUNT DISTINCT':_0xfdb2('0x84'),'MAX':_0xfdb2('0x57'),'MIN':_0xfdb2('0x58'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xfdb2('0x5a'),'GROUP_CONCAT ASC':_0xfdb2('0x5b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x9bdc97={'SEC_TO_TIME':_0xfdb2('0x5d'),'DATE':_0xfdb2('0x85'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xfdb2('0x60')};var _0x2cd54a=function(_0x8341b8){return!_['includes']([_0xfdb2('0x61'),_0xfdb2('0x86'),'IS\x20EMPTY',_0xfdb2('0x63')],_0x8341b8);};var _0x4731b3=function(_0x57b052){if(!_0x57b052||!_0x57b052['rules'][_0xfdb2('0x35')]){return'';}for(var _0x5ba8c8='(',_0x173806=0x0;_0x173806<_0x57b052[_0xfdb2('0x64')]['length'];_0x173806+=0x1){_0x173806>0x0&&(_0x5ba8c8+='\x20'+_0x57b052[_0xfdb2('0x65')]+'\x20');_0x5ba8c8+=_0x57b052['rules'][_0x173806][_0xfdb2('0x66')]?_0x4731b3(_0x57b052[_0xfdb2('0x64')][_0x173806]['group']):_0x57b052[_0xfdb2('0x64')][_0x173806][_0xfdb2('0x67')]+'\x20'+_0x57b052[_0xfdb2('0x64')][_0x173806]['condition']+(_0x2cd54a(_0x57b052[_0xfdb2('0x64')][_0x173806][_0xfdb2('0x68')])?'\x20'+_0x57b052['rules'][_0x173806][_0xfdb2('0x69')]:'');}return _0x5ba8c8+')';};var _0x28a4df={'where':{'id':_0x5d75db['id']}},_0x649259,_0x3d48bb,_0x15c938,_0x5921fd,_0x1651f9;_0x28a4df=_[_0xfdb2('0x3e')]({},_0x28a4df,_0x4b160d);return db[_0xfdb2('0x41')][_0xfdb2('0x51')](_0x28a4df)[_0xfdb2('0x23')](function(_0x1b7d7b){if(_0x1b7d7b){_0x649259=_0x1b7d7b;return _0x1b7d7b[_0xfdb2('0x6a')]();}return null;})[_0xfdb2('0x23')](function(_0x73febf){if(_0x73febf){if(!_0x73febf[_0xfdb2('0x35')]){throw new db['Sequelize']['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x3d48bb=_0x73febf;return db[_0xfdb2('0x87')][_0xfdb2('0x44')]({'raw':!![]});}return null;})['then'](function(_0x3cde0f){if(_0x3cde0f){_0x15c938=_['keyBy'](_0x3cde0f,'id');var _0x50ea7f;var _0x2c0551=squel[_0xfdb2('0x88')]();_0x2c0551[_0xfdb2('0x89')](_0x649259[_0xfdb2('0x6e')]);for(var _0x82d192=0x0;_0x82d192<_0x3d48bb[_0xfdb2('0x35')];_0x82d192+=0x1){_0x50ea7f=_0x3d48bb[_0x82d192][_0xfdb2('0x6f')]?_0x15c938[_0x3d48bb[_0x82d192][_0xfdb2('0x6f')]][_0xfdb2('0x70')]:_0x3d48bb[_0x82d192]['field'];_0x50ea7f=_0x3d48bb[_0x82d192][_0xfdb2('0x72')]?_[_0xfdb2('0x71')](_0x300462[_0x3d48bb[_0x82d192][_0xfdb2('0x72')]],'%s',_0x50ea7f):_0x50ea7f;_0x50ea7f=_0x3d48bb[_0x82d192]['format']?_[_0xfdb2('0x71')](_0x9bdc97[_0x3d48bb[_0x82d192][_0xfdb2('0x73')]],'%s',_0x50ea7f):_0x50ea7f;if(_0x3d48bb[_0x82d192][_0xfdb2('0x74')]){_0x2c0551[_0xfdb2('0x66')](_0x50ea7f);}_0x3d48bb[_0x82d192][_0xfdb2('0x75')]&&_0x2c0551[_0xfdb2('0x38')](_0x50ea7f,_0x3d48bb[_0x82d192][_0xfdb2('0x75')]===_0xfdb2('0x76')?![]:!![]);_0x2c0551[_0xfdb2('0x67')](_0x50ea7f,_0x3d48bb[_0x82d192][_0xfdb2('0x8a')]||_0x50ea7f);}if(_0x649259[_0xfdb2('0x77')]){_0x649259[_0xfdb2('0x77')]=JSON['parse'](_0x649259[_0xfdb2('0x77')]);for(var _0x4b1adc=0x0;_0x4b1adc<_0x649259[_0xfdb2('0x77')][_0xfdb2('0x35')];_0x4b1adc+=0x1){if(_0x649259['joins'][_0x4b1adc]['type']&&_[_0xfdb2('0x8b')](_0x4da2d2,_0x649259[_0xfdb2('0x77')][_0x4b1adc][_0xfdb2('0x2d')])&&_0x649259[_0xfdb2('0x77')][_0x4b1adc][_0xfdb2('0x7b')]&&_0x649259[_0xfdb2('0x77')][_0x4b1adc][_0xfdb2('0x79')]&&_0x649259['joins'][_0x4b1adc][_0xfdb2('0x7a')]){_0x2c0551[_0x649259[_0xfdb2('0x77')][_0x4b1adc][_0xfdb2('0x2d')]](_0x649259['joins'][_0x4b1adc][_0xfdb2('0x79')],null,util[_0xfdb2('0x73')]('%s.%s\x20=\x20%s.%s',_0x649259[_0xfdb2('0x6e')],_0x649259['joins'][_0x4b1adc][_0xfdb2('0x7b')],_0x649259['joins'][_0x4b1adc][_0xfdb2('0x79')],_0x649259[_0xfdb2('0x77')][_0x4b1adc][_0xfdb2('0x7a')]));}}}if(_0x649259[_0xfdb2('0x7c')]){_0x649259[_0xfdb2('0x7c')]=JSON[_0xfdb2('0x78')](_0x649259[_0xfdb2('0x7c')]);_0x2c0551[_0xfdb2('0x3a')](_0x4731b3(_0x649259[_0xfdb2('0x7c')]['group']));}_0x1651f9=_0x2c0551['clone']();_0x2c0551[_0xfdb2('0x1f')](_0x7e5529);_0x2c0551[_0xfdb2('0x1c')](0x0);return;}})[_0xfdb2('0x23')](function(){if(_0x11b6ee[_0xfdb2('0x8c')]===_0xfdb2('0x8d')){return null;}var _0x118876=_['merge'](_0x11b6ee,{'name':_0x11b6ee[_0xfdb2('0x8e')]||_0x11b6ee[_0xfdb2('0x2a')]||_0x649259[_0xfdb2('0x2a')],'basename':_0x8ff979,'savename':util[_0xfdb2('0x73')](_0xfdb2('0x8f'),_0x11b6ee[_0xfdb2('0x2a')]||_0x649259[_0xfdb2('0x2a')],require(_0xfdb2('0x90'))[_0xfdb2('0x91')](0x4),_0x11b6ee[_0xfdb2('0x8c')]||'csv'),'reportId':_0x649259['id'],'reportType':'custom'});return db[_0xfdb2('0x92')][_0xfdb2('0x4a')](_0x118876,{'raw':!![]});})[_0xfdb2('0x23')](function(_0xce6959){if(_0x649259['table']===_0xfdb2('0x93')){_0x1651f9['where'](_0x649259[_0xfdb2('0x6e')]+_0xfdb2('0x94'),_0x11b6ee['startDate'],_0x11b6ee[_0xfdb2('0x95')]);}else{_0x1651f9[_0xfdb2('0x3a')](_0x649259[_0xfdb2('0x6e')]+_0xfdb2('0x96'),_0x11b6ee[_0xfdb2('0x97')],_0x11b6ee[_0xfdb2('0x95')]);}if(_0xce6959){logger[_0xfdb2('0x98')](_0xfdb2('0x99'),_0x1651f9[_0xfdb2('0x7e')]());require('child_process')[_0xfdb2('0x9a')](path['join'](__dirname,'../../components/export/',_0xce6959[_0xfdb2('0x8c')]),[_0xce6959['id'],_0x1651f9[_0xfdb2('0x7e')](),path[_0xfdb2('0x53')](__dirname,_0xfdb2('0x9b'),_0xce6959['savename']),_0x8ff979]);return _0xce6959;}else{var _0x905afd=squel[_0xfdb2('0x88')]();_0x905afd[_0xfdb2('0x89')]('('+_0x1651f9['toString']()+')',_0xfdb2('0x9c'));_0x905afd[_0xfdb2('0x67')]('COUNT(*)',_0xfdb2('0x1e'));_0x1651f9['limit'](_0x11b6ee['limit']||_0x7e5529);_0x1651f9[_0xfdb2('0x1c')](_0x11b6ee['offset']||0x0);return dbH[_0xfdb2('0x7f')][_0xfdb2('0x31')](_0x905afd['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0xfdb2('0x81')]})[_0xfdb2('0x23')](function(_0x4d9e12){if(!_0x4d9e12[_0xfdb2('0x35')]){_0x5921fd=0x0;}else{_0x5921fd=_0x4d9e12[0x0][_0xfdb2('0x1e')]||0x0;}return dbH[_0xfdb2('0x7f')][_0xfdb2('0x31')](_0x1651f9[_0xfdb2('0x7e')](),{'type':dbH[_0xfdb2('0x7f')][_0xfdb2('0x80')]['SELECT']});})['then'](function(_0x485aff){return{'rows':_0x485aff||[],'count':_0x5921fd};});}});}exports[_0xfdb2('0x9d')]=function(_0x478fc8,_0x116558){return runReport(_0x478fc8[_0xfdb2('0x47')],_0x478fc8[_0xfdb2('0x31')],_0x478fc8[_0xfdb2('0x40')])[_0xfdb2('0x23')](respondWithResult(_0x116558,null))[_0xfdb2('0x49')](handleError(_0x116558,null));};exports[_0xfdb2('0x9e')]=runReport;exports['query']=function(_0x58971e,_0x2f68e8){var _0x2fc1c7=0xa;var _0x8abb2e=[_0xfdb2('0x53'),_0xfdb2('0x54'),_0xfdb2('0x55'),_0xfdb2('0x82')];var _0x360d4d={'SUM':_0xfdb2('0x83'),'COUNT':_0xfdb2('0x56'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xfdb2('0x57'),'MIN':_0xfdb2('0x58'),'AVG':_0xfdb2('0x59'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xfdb2('0x5b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x2a9893={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xfdb2('0x85'),'HOUR':_0xfdb2('0x5e'),'ROUND':_0xfdb2('0x5f'),'UNIX_TIMESTAMP':_0xfdb2('0x60')};var _0x99a945=function(_0x59a8cf){return!_[_0xfdb2('0x8b')](['IS\x20NULL',_0xfdb2('0x86'),_0xfdb2('0x62'),'IS\x20NOT\x20EMPTY'],_0x59a8cf);};var _0x42ce3e=function(_0x2d54c8){if(!_0x2d54c8||!_0x2d54c8[_0xfdb2('0x64')][_0xfdb2('0x35')]){return'';}for(var _0x4400b2='(',_0x13385c=0x0;_0x13385c<_0x2d54c8[_0xfdb2('0x64')][_0xfdb2('0x35')];_0x13385c+=0x1){_0x13385c>0x0&&(_0x4400b2+='\x20'+_0x2d54c8[_0xfdb2('0x65')]+'\x20');_0x4400b2+=_0x2d54c8['rules'][_0x13385c][_0xfdb2('0x66')]?_0x42ce3e(_0x2d54c8[_0xfdb2('0x64')][_0x13385c][_0xfdb2('0x66')]):_0x2d54c8[_0xfdb2('0x64')][_0x13385c]['field']+'\x20'+_0x2d54c8['rules'][_0x13385c][_0xfdb2('0x68')]+(_0x99a945(_0x2d54c8['rules'][_0x13385c]['condition'])?'\x20'+_0x2d54c8[_0xfdb2('0x64')][_0x13385c][_0xfdb2('0x69')]:'');}return _0x4400b2+')';};var _0x2dddd4={'where':{'id':_0x58971e[_0xfdb2('0x47')]['id']}},_0xb810fe,_0x57beec,_0x915636,_0x516793,_0x2b4335;_0x2dddd4=_[_0xfdb2('0x3e')]({},_0x2dddd4,_0x58971e[_0xfdb2('0x40')]);return db['AnalyticCustomReport'][_0xfdb2('0x51')](_0x2dddd4)[_0xfdb2('0x23')](function(_0x40ed7c){if(_0x40ed7c){_0xb810fe=_0x40ed7c;return _0x40ed7c['getFields']();}return null;})['then'](function(_0x21acdf){if(_0x21acdf){if(!_0x21acdf[_0xfdb2('0x35')]){throw new db['Sequelize']['ValidationErrorItem'](_0xfdb2('0x6d'),0x193);}_0x57beec=_0x21acdf;return db[_0xfdb2('0x87')][_0xfdb2('0x44')]({'raw':!![]});}return null;})[_0xfdb2('0x23')](function(_0xf0727f){if(_0xf0727f){_0x915636=_['keyBy'](_0xf0727f,'id');var _0x552694;var _0x522695=squel['select']();_0x522695['from'](_0xb810fe['table']);for(var _0x5228fb=0x0;_0x5228fb<_0x57beec[_0xfdb2('0x35')];_0x5228fb+=0x1){_0x552694=_0x57beec[_0x5228fb][_0xfdb2('0x6f')]?_0x915636[_0x57beec[_0x5228fb][_0xfdb2('0x6f')]][_0xfdb2('0x70')]:_0x57beec[_0x5228fb][_0xfdb2('0x67')];_0x552694=_0x57beec[_0x5228fb][_0xfdb2('0x72')]?_[_0xfdb2('0x71')](_0x360d4d[_0x57beec[_0x5228fb][_0xfdb2('0x72')]],'%s',_0x552694):_0x552694;_0x552694=_0x57beec[_0x5228fb][_0xfdb2('0x73')]?_[_0xfdb2('0x71')](_0x2a9893[_0x57beec[_0x5228fb][_0xfdb2('0x73')]],'%s',_0x552694):_0x552694;if(_0x57beec[_0x5228fb]['groupBy']){_0x522695['group'](_0x552694);}_0x57beec[_0x5228fb][_0xfdb2('0x75')]&&_0x522695['order'](_0x552694,_0x57beec[_0x5228fb]['orderBy']===_0xfdb2('0x76')?![]:!![]);_0x522695[_0xfdb2('0x67')](_0x552694,_0x57beec[_0x5228fb][_0xfdb2('0x8a')]||_0x552694);}if(_0xb810fe[_0xfdb2('0x77')]){_0xb810fe[_0xfdb2('0x77')]=JSON['parse'](_0xb810fe['joins']);for(var _0x12438e=0x0;_0x12438e<_0xb810fe['joins'][_0xfdb2('0x35')];_0x12438e+=0x1){if(_0xb810fe[_0xfdb2('0x77')][_0x12438e][_0xfdb2('0x2d')]&&_[_0xfdb2('0x8b')](_0x8abb2e,_0xb810fe[_0xfdb2('0x77')][_0x12438e][_0xfdb2('0x2d')])&&_0xb810fe['joins'][_0x12438e]['parentKey']&&_0xb810fe[_0xfdb2('0x77')][_0x12438e][_0xfdb2('0x79')]&&_0xb810fe[_0xfdb2('0x77')][_0x12438e][_0xfdb2('0x7a')]){_0x522695[_0xb810fe[_0xfdb2('0x77')][_0x12438e]['type']](_0xb810fe[_0xfdb2('0x77')][_0x12438e]['foreignTable'],null,util['format'](_0xfdb2('0x9f'),_0xb810fe[_0xfdb2('0x6e')],_0xb810fe[_0xfdb2('0x77')][_0x12438e][_0xfdb2('0x7b')],_0xb810fe[_0xfdb2('0x77')][_0x12438e]['foreignTable'],_0xb810fe[_0xfdb2('0x77')][_0x12438e][_0xfdb2('0x7a')]));}}}if(_0xb810fe[_0xfdb2('0x7c')]){_0xb810fe[_0xfdb2('0x7c')]=JSON['parse'](_0xb810fe['conditions']);_0x522695[_0xfdb2('0x3a')](_0x42ce3e(_0xb810fe['conditions'][_0xfdb2('0x66')]));}_0x2b4335=_0x522695[_0xfdb2('0x7d')]();_0x522695['limit'](_0x2fc1c7);_0x522695[_0xfdb2('0x1c')](0x0);logger[_0xfdb2('0xa0')]('Limited\x20Query:',_0x522695[_0xfdb2('0x7e')]());return dbH[_0xfdb2('0x7f')][_0xfdb2('0x31')](_0x522695['toString'](),{'type':dbH[_0xfdb2('0x7f')]['QueryTypes'][_0xfdb2('0x81')]});}})[_0xfdb2('0x23')](function(){return{'sql':_0x2b4335['toString']()};})['then'](respondWithResult(_0x2f68e8,null))[_0xfdb2('0x49')](handleError(_0x2f68e8,null));}; \ No newline at end of file +var _0x48d1=['right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','select','MetricId','metric','replace','function','format','groupBy','orderBy','parse','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','join','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','UNIX_TIMESTAMP(%s)','IS\x20EMPTY','IS\x20NOT\x20EMPTY','value','AnalyticMetric','from','DESC','alias','output','web','fullPath','%s-%s.%s','randomstring','csv','custom','AnalyticExtractedReport','cdr','endDate','startDate','info','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','dbH','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','destroy','then','get','CustomReports','UserProfileResource','end','error','name','index','AnalyticCustomReport','rawAttributes','fieldName','type','map','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','body','preview','left_join'];(function(_0x18e0f3,_0x90c5bf){var _0x1c50ad=function(_0x5113d9){while(--_0x5113d9){_0x18e0f3['push'](_0x18e0f3['shift']());}};_0x1c50ad(++_0x90c5bf);}(_0x48d1,0x1a2));var _0x148d=function(_0x3c717e,_0x13e9ad){_0x3c717e=_0x3c717e-0x0;var _0x2f3ca7=_0x48d1[_0x3c717e];return _0x2f3ca7;};'use strict';var emlformat=require(_0x148d('0x0'));var rimraf=require(_0x148d('0x1'));var zipdir=require(_0x148d('0x2'));var jsonpatch=require(_0x148d('0x3'));var rp=require('request-promise');var moment=require(_0x148d('0x4'));var BPromise=require(_0x148d('0x5'));var Mustache=require(_0x148d('0x6'));var util=require('util');var path=require(_0x148d('0x7'));var sox=require(_0x148d('0x8'));var csv=require(_0x148d('0x9'));var ejs=require(_0x148d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x148d('0xb'));var squel=require(_0x148d('0xc'));var crypto=require(_0x148d('0xd'));var jsforce=require(_0x148d('0xe'));var deskjs=require(_0x148d('0xf'));var toCsv=require(_0x148d('0x9'));var querystring=require('querystring');var Papa=require(_0x148d('0x10'));var Redis=require(_0x148d('0x11'));var authService=require(_0x148d('0x12'));var qs=require(_0x148d('0x13'));var as=require(_0x148d('0x14'));var hardwareService=require(_0x148d('0x15'));var logger=require(_0x148d('0x16'))('api');var utils=require(_0x148d('0x17'));var config=require(_0x148d('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x148d('0x19'))['db'];var dbH=require(_0x148d('0x19'))[_0x148d('0x1a')];function respondWithStatusCode(_0x492d02,_0x1379c1){_0x1379c1=_0x1379c1||0xcc;return function(_0x4675e8){if(_0x4675e8){return _0x492d02[_0x148d('0x1b')](_0x1379c1);}return _0x492d02[_0x148d('0x1c')](_0x1379c1)['end']();};}function respondWithResult(_0x27f90b,_0x185d83){_0x185d83=_0x185d83||0xc8;return function(_0x5cbead){if(_0x5cbead){return _0x27f90b[_0x148d('0x1c')](_0x185d83)[_0x148d('0x1d')](_0x5cbead);}};}function respondWithFilteredResult(_0x9b8172,_0x5ce18a){return function(_0x48e964){if(_0x48e964){var _0x1dc110=typeof _0x5ce18a[_0x148d('0x1e')]===_0x148d('0x1f')&&typeof _0x5ce18a['limit']===_0x148d('0x1f');var _0x8df34=_0x48e964[_0x148d('0x20')];var _0xaee6a0=_0x1dc110?0x0:_0x5ce18a['offset'];var _0x13029f=_0x1dc110?_0x48e964[_0x148d('0x20')]:_0x5ce18a[_0x148d('0x1e')]+_0x5ce18a[_0x148d('0x21')];var _0x914a33;if(_0x13029f>=_0x8df34){_0x13029f=_0x8df34;_0x914a33=0xc8;}else{_0x914a33=0xce;}_0x9b8172[_0x148d('0x1c')](_0x914a33);return _0x9b8172[_0x148d('0x22')](_0x148d('0x23'),_0xaee6a0+'-'+_0x13029f+'/'+_0x8df34)[_0x148d('0x1d')](_0x48e964);}return null;};}function patchUpdates(_0x2b0494){return function(_0x1fa796){try{jsonpatch[_0x148d('0x24')](_0x1fa796,_0x2b0494,!![]);}catch(_0x10e96e){return BPromise[_0x148d('0x25')](_0x10e96e);}return _0x1fa796[_0x148d('0x26')]();};}function saveUpdates(_0x487365,_0x19f773){return function(_0x10825d){if(_0x10825d){return _0x10825d['update'](_0x487365)['then'](function(_0x52819a){return _0x52819a;});}return null;};}function removeEntity(_0x4f8ba4,_0x2a9d7e){return function(_0x3028d7){if(_0x3028d7){return _0x3028d7[_0x148d('0x27')]()[_0x148d('0x28')](function(){var _0x40e522=_0x3028d7[_0x148d('0x29')]({'plain':!![]});var _0x368513=_0x148d('0x2a');return db[_0x148d('0x2b')][_0x148d('0x27')]({'where':{'type':_0x368513,'resourceId':_0x40e522['id']}})[_0x148d('0x28')](function(){return _0x3028d7;});})[_0x148d('0x28')](function(){_0x4f8ba4[_0x148d('0x1c')](0xcc)[_0x148d('0x2c')]();});}};}function handleEntityNotFound(_0x13a41a,_0x18955c){return function(_0x2190cb){if(!_0x2190cb){_0x13a41a['sendStatus'](0x194);}return _0x2190cb;};}function handleError(_0x48a001,_0x329eda){_0x329eda=_0x329eda||0x1f4;return function(_0x4f33d7){logger[_0x148d('0x2d')](_0x4f33d7['stack']);if(_0x4f33d7[_0x148d('0x2e')]){delete _0x4f33d7['name'];}_0x48a001[_0x148d('0x1c')](_0x329eda)['send'](_0x4f33d7);};}exports[_0x148d('0x2f')]=function(_0x5a7ae8,_0x2282b6){var _0xe6f5ca={},_0x350bd4={},_0x3eb2bb={'count':0x0,'rows':[]};var _0x13283f=_['map'](db[_0x148d('0x30')][_0x148d('0x31')],function(_0x288e8c){return{'name':_0x288e8c[_0x148d('0x32')],'type':_0x288e8c[_0x148d('0x33')]['key']};});_0x350bd4['model']=_[_0x148d('0x34')](_0x13283f,'name');_0x350bd4[_0x148d('0x35')]=_[_0x148d('0x36')](_0x5a7ae8[_0x148d('0x35')]);_0x350bd4[_0x148d('0x37')]=_['intersection'](_0x350bd4[_0x148d('0x38')],_0x350bd4[_0x148d('0x35')]);_0xe6f5ca[_0x148d('0x39')]=_[_0x148d('0x3a')](_0x350bd4[_0x148d('0x38')],qs[_0x148d('0x3b')](_0x5a7ae8[_0x148d('0x35')]['fields']));_0xe6f5ca['attributes']=_0xe6f5ca[_0x148d('0x39')]['length']?_0xe6f5ca[_0x148d('0x39')]:_0x350bd4['model'];if(!_0x5a7ae8['query'][_0x148d('0x3c')](_0x148d('0x3d'))){_0xe6f5ca['limit']=qs[_0x148d('0x21')](_0x5a7ae8['query'][_0x148d('0x21')]);_0xe6f5ca['offset']=qs['offset'](_0x5a7ae8[_0x148d('0x35')][_0x148d('0x1e')]);}_0xe6f5ca[_0x148d('0x3e')]=qs[_0x148d('0x3f')](_0x5a7ae8[_0x148d('0x35')][_0x148d('0x3f')]);_0xe6f5ca[_0x148d('0x40')]=qs[_0x148d('0x37')](_[_0x148d('0x41')](_0x5a7ae8['query'],_0x350bd4[_0x148d('0x37')]),_0x13283f);if(_0x5a7ae8[_0x148d('0x35')][_0x148d('0x42')]){_0xe6f5ca[_0x148d('0x40')]=_['merge'](_0xe6f5ca[_0x148d('0x40')],{'$or':_[_0x148d('0x34')](_0x13283f,function(_0x320b81){if(_0x320b81[_0x148d('0x33')]!==_0x148d('0x43')){var _0x4d4203={};_0x4d4203[_0x320b81['name']]={'$like':'%'+_0x5a7ae8['query'][_0x148d('0x42')]+'%'};return _0x4d4203;}})});}_0xe6f5ca=_[_0x148d('0x44')]({},_0xe6f5ca,_0x5a7ae8['options']);var _0x300eae={'where':_0xe6f5ca[_0x148d('0x40')]};return db['AnalyticCustomReport']['count'](_0x300eae)['then'](function(_0x3febd0){_0x3eb2bb[_0x148d('0x20')]=_0x3febd0;if(_0x5a7ae8[_0x148d('0x35')][_0x148d('0x45')]){_0xe6f5ca[_0x148d('0x46')]=[{'all':!![]}];}return db[_0x148d('0x30')][_0x148d('0x47')](_0xe6f5ca);})[_0x148d('0x28')](function(_0x12b3da){_0x3eb2bb[_0x148d('0x48')]=_0x12b3da;return _0x3eb2bb;})[_0x148d('0x28')](respondWithFilteredResult(_0x2282b6,_0xe6f5ca))[_0x148d('0x49')](handleError(_0x2282b6,null));};exports[_0x148d('0x4a')]=function(_0x11999e,_0x4c9d59){var _0x1e0ce1={'raw':![],'where':{'id':_0x11999e[_0x148d('0x4b')]['id']}},_0x116e65={};_0x116e65[_0x148d('0x38')]=_['keys'](db[_0x148d('0x30')]['rawAttributes']);_0x116e65[_0x148d('0x35')]=_[_0x148d('0x36')](_0x11999e[_0x148d('0x35')]);_0x116e65[_0x148d('0x37')]=_['intersection'](_0x116e65[_0x148d('0x38')],_0x116e65[_0x148d('0x35')]);_0x1e0ce1[_0x148d('0x39')]=_[_0x148d('0x3a')](_0x116e65[_0x148d('0x38')],qs[_0x148d('0x3b')](_0x11999e[_0x148d('0x35')][_0x148d('0x3b')]));_0x1e0ce1[_0x148d('0x39')]=_0x1e0ce1['attributes'][_0x148d('0x4c')]?_0x1e0ce1[_0x148d('0x39')]:_0x116e65[_0x148d('0x38')];if(_0x11999e['query'][_0x148d('0x45')]){_0x1e0ce1[_0x148d('0x46')]=[{'all':!![]}];}_0x1e0ce1=_[_0x148d('0x44')]({},_0x1e0ce1,_0x11999e[_0x148d('0x4d')]);return db[_0x148d('0x30')][_0x148d('0x4e')](_0x1e0ce1)[_0x148d('0x28')](handleEntityNotFound(_0x4c9d59,null))['then'](respondWithResult(_0x4c9d59,null))[_0x148d('0x49')](handleError(_0x4c9d59,null));};exports[_0x148d('0x4f')]=function(_0xdf167a,_0x4db442){return db[_0x148d('0x30')][_0x148d('0x4f')](_0xdf167a['body'],{})[_0x148d('0x28')](function(_0x45c564){var _0xe1e577=_0xdf167a['user'][_0x148d('0x29')]({'plain':!![]});if(!_0xe1e577)throw new Error(_0x148d('0x50'));if(_0xe1e577[_0x148d('0x51')]==='user'){var _0x363db4=_0x45c564[_0x148d('0x29')]({'plain':!![]});var _0x30c532=_0x148d('0x52');return db[_0x148d('0x53')][_0x148d('0x4e')]({'where':{'name':_0x30c532,'userProfileId':_0xe1e577[_0x148d('0x54')]},'raw':!![]})[_0x148d('0x28')](function(_0x75af19){if(_0x75af19&&_0x75af19[_0x148d('0x55')]===0x0){return db[_0x148d('0x2b')][_0x148d('0x4f')]({'name':_0x363db4[_0x148d('0x2e')],'resourceId':_0x363db4['id'],'type':_0x148d('0x2a'),'sectionId':_0x75af19['id']},{})[_0x148d('0x28')](function(){return _0x45c564;});}else{return _0x45c564;}})[_0x148d('0x49')](function(_0x185c3d){logger[_0x148d('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x185c3d);throw _0x185c3d;});}return _0x45c564;})[_0x148d('0x28')](respondWithResult(_0x4db442,0xc9))[_0x148d('0x49')](handleError(_0x4db442,null));};exports['update']=function(_0x369b22,_0x582351){if(_0x369b22['body']['id']){delete _0x369b22[_0x148d('0x56')]['id'];}return db[_0x148d('0x30')][_0x148d('0x4e')]({'where':{'id':_0x369b22[_0x148d('0x4b')]['id']}})[_0x148d('0x28')](handleEntityNotFound(_0x582351,null))[_0x148d('0x28')](saveUpdates(_0x369b22[_0x148d('0x56')],null))[_0x148d('0x28')](respondWithResult(_0x582351,null))[_0x148d('0x49')](handleError(_0x582351,null));};exports[_0x148d('0x27')]=function(_0x2651f4,_0x13043f){return db[_0x148d('0x30')][_0x148d('0x4e')]({'where':{'id':_0x2651f4[_0x148d('0x4b')]['id']}})[_0x148d('0x28')](handleEntityNotFound(_0x13043f,null))[_0x148d('0x28')](removeEntity(_0x13043f,null))[_0x148d('0x49')](handleError(_0x13043f,null));};exports[_0x148d('0x57')]=function(_0x520729,_0x3d91a7){var _0x103e63=0xa;var _0x4c2d6c=['join',_0x148d('0x58'),_0x148d('0x59'),_0x148d('0x5a')];var _0x5adece={'SUM':_0x148d('0x5b'),'COUNT':_0x148d('0x5c'),'COUNT DISTINCT':_0x148d('0x5d'),'MAX':_0x148d('0x5e'),'MIN':_0x148d('0x5f'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x148d('0x60'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x26b7e2={'SEC_TO_TIME':_0x148d('0x61'),'DATE':_0x148d('0x62'),'HOUR':_0x148d('0x63'),'ROUND':_0x148d('0x64'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x378bb6=function(_0x443114){return!_[_0x148d('0x65')]([_0x148d('0x66'),_0x148d('0x67'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x443114);};var _0x3bfa93=function(_0xcaf0c8){if(!_0xcaf0c8||!_0xcaf0c8[_0x148d('0x68')][_0x148d('0x4c')]){return'';}for(var _0x1d98dd='(',_0x326f5b=0x0;_0x326f5b<_0xcaf0c8[_0x148d('0x68')]['length'];_0x326f5b+=0x1){_0x326f5b>0x0&&(_0x1d98dd+='\x20'+_0xcaf0c8[_0x148d('0x69')]+'\x20');_0x1d98dd+=_0xcaf0c8['rules'][_0x326f5b][_0x148d('0x6a')]?_0x3bfa93(_0xcaf0c8[_0x148d('0x68')][_0x326f5b]['group']):_0xcaf0c8['rules'][_0x326f5b][_0x148d('0x6b')]+'\x20'+_0xcaf0c8['rules'][_0x326f5b]['condition']+(_0x378bb6(_0xcaf0c8[_0x148d('0x68')][_0x326f5b][_0x148d('0x6c')])?'\x20'+_0xcaf0c8[_0x148d('0x68')][_0x326f5b]['value']:'');}return _0x1d98dd+')';};var _0x5c4dc0={'where':{'id':_0x520729[_0x148d('0x4b')]['id']}},_0x509a90,_0x17934b,_0x25d13f,_0x4828cd,_0x274d64;_0x5c4dc0=_[_0x148d('0x44')]({},_0x5c4dc0,_0x520729[_0x148d('0x4d')]);return db[_0x148d('0x30')]['find'](_0x5c4dc0)['then'](function(_0x50bbe4){if(_0x50bbe4){_0x509a90=_0x50bbe4;return _0x50bbe4[_0x148d('0x6d')]();}return null;})[_0x148d('0x28')](function(_0x3850fd){if(_0x3850fd){if(!_0x3850fd[_0x148d('0x4c')]){throw new db[(_0x148d('0x6e'))][(_0x148d('0x6f'))](_0x148d('0x70'),0x193);}_0x17934b=_0x3850fd;return db['AnalyticMetric'][_0x148d('0x47')]({'raw':!![]});}return null;})[_0x148d('0x28')](function(_0x59dbc9){if(_0x59dbc9){_0x25d13f=_[_0x148d('0x71')](_0x59dbc9,'id');var _0x241c36;var _0x2e6d86=squel[_0x148d('0x72')]();_0x2e6d86['from'](_0x509a90['table']);for(var _0x141ac0=0x0;_0x141ac0<_0x17934b[_0x148d('0x4c')];_0x141ac0+=0x1){_0x241c36=_0x17934b[_0x141ac0][_0x148d('0x73')]?_0x25d13f[_0x17934b[_0x141ac0]['MetricId']][_0x148d('0x74')]:_0x17934b[_0x141ac0][_0x148d('0x6b')];_0x241c36=_0x17934b[_0x141ac0]['function']?_[_0x148d('0x75')](_0x5adece[_0x17934b[_0x141ac0][_0x148d('0x76')]],'%s',_0x241c36):_0x241c36;_0x241c36=_0x17934b[_0x141ac0][_0x148d('0x77')]?_['replace'](_0x26b7e2[_0x17934b[_0x141ac0][_0x148d('0x77')]],'%s',_0x241c36):_0x241c36;if(_0x17934b[_0x141ac0][_0x148d('0x78')]){_0x2e6d86[_0x148d('0x6a')](_0x241c36);}_0x17934b[_0x141ac0]['orderBy']&&_0x2e6d86['order'](_0x241c36,_0x17934b[_0x141ac0][_0x148d('0x79')]==='DESC'?![]:!![]);_0x2e6d86[_0x148d('0x6b')](_0x241c36,_0x17934b[_0x141ac0]['alias']||_0x241c36);}if(_0x509a90['joins']){_0x509a90['joins']=JSON[_0x148d('0x7a')](_0x509a90[_0x148d('0x7b')]);for(var _0x167b81=0x0;_0x167b81<_0x509a90[_0x148d('0x7b')][_0x148d('0x4c')];_0x167b81+=0x1){if(_0x509a90[_0x148d('0x7b')][_0x167b81][_0x148d('0x33')]&&_['includes'](_0x4c2d6c,_0x509a90[_0x148d('0x7b')][_0x167b81][_0x148d('0x33')])&&_0x509a90['joins'][_0x167b81][_0x148d('0x7c')]&&_0x509a90[_0x148d('0x7b')][_0x167b81][_0x148d('0x7d')]&&_0x509a90[_0x148d('0x7b')][_0x167b81][_0x148d('0x7e')]){_0x2e6d86[_0x509a90[_0x148d('0x7b')][_0x167b81][_0x148d('0x33')]](_0x509a90['joins'][_0x167b81][_0x148d('0x7d')],null,util['format'](_0x148d('0x7f'),_0x509a90[_0x148d('0x80')],_0x509a90['joins'][_0x167b81][_0x148d('0x7c')],_0x509a90[_0x148d('0x7b')][_0x167b81][_0x148d('0x7d')],_0x509a90['joins'][_0x167b81]['foreignKey']));}}}if(_0x509a90[_0x148d('0x81')]){_0x509a90[_0x148d('0x81')]=JSON['parse'](_0x509a90[_0x148d('0x81')]);_0x2e6d86[_0x148d('0x40')](_0x3bfa93(_0x509a90[_0x148d('0x81')][_0x148d('0x6a')]));}_0x274d64=_0x2e6d86[_0x148d('0x82')]();_0x2e6d86[_0x148d('0x21')](_0x103e63);_0x2e6d86[_0x148d('0x1e')](0x0);logger[_0x148d('0x83')](_0x148d('0x84'),_0x2e6d86[_0x148d('0x85')]());return dbH[_0x148d('0x86')][_0x148d('0x35')](_0x2e6d86[_0x148d('0x85')](),{'type':dbH[_0x148d('0x86')][_0x148d('0x87')][_0x148d('0x88')]});}})[_0x148d('0x28')](respondWithResult(_0x3d91a7,null))[_0x148d('0x49')](handleError(_0x3d91a7,null));};function runReport(_0x1a5d21,_0xc2da06,_0x420472){var _0x4d8c41=_0xc2da06[_0x148d('0x2e')];var _0x2383da=0xa;var _0x30cf1c=[_0x148d('0x89'),_0x148d('0x58'),_0x148d('0x59'),_0x148d('0x5a')];var _0x579fa0={'SUM':'SUM(%s)','COUNT':_0x148d('0x5c'),'COUNT DISTINCT':_0x148d('0x5d'),'MAX':_0x148d('0x5e'),'MIN':_0x148d('0x5f'),'AVG':_0x148d('0x8a'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x148d('0x8b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x236dc1={'SEC_TO_TIME':_0x148d('0x61'),'DATE':_0x148d('0x62'),'HOUR':_0x148d('0x63'),'ROUND':_0x148d('0x64'),'UNIX_TIMESTAMP':_0x148d('0x8c')};var _0x227db7=function(_0x1aa0a8){return!_[_0x148d('0x65')]([_0x148d('0x66'),_0x148d('0x67'),_0x148d('0x8d'),_0x148d('0x8e')],_0x1aa0a8);};var _0x135b72=function(_0x408833){if(!_0x408833||!_0x408833['rules'][_0x148d('0x4c')]){return'';}for(var _0x22e85c='(',_0x483931=0x0;_0x483931<_0x408833['rules'][_0x148d('0x4c')];_0x483931+=0x1){_0x483931>0x0&&(_0x22e85c+='\x20'+_0x408833['operator']+'\x20');_0x22e85c+=_0x408833[_0x148d('0x68')][_0x483931][_0x148d('0x6a')]?_0x135b72(_0x408833[_0x148d('0x68')][_0x483931][_0x148d('0x6a')]):_0x408833[_0x148d('0x68')][_0x483931][_0x148d('0x6b')]+'\x20'+_0x408833[_0x148d('0x68')][_0x483931][_0x148d('0x6c')]+(_0x227db7(_0x408833[_0x148d('0x68')][_0x483931][_0x148d('0x6c')])?'\x20'+_0x408833['rules'][_0x483931][_0x148d('0x8f')]:'');}return _0x22e85c+')';};var _0x3a7091={'where':{'id':_0x1a5d21['id']}},_0xfc8ad0,_0x54b061,_0x1c81f3,_0x5c8486,_0x19e820;_0x3a7091=_[_0x148d('0x44')]({},_0x3a7091,_0x420472);return db['AnalyticCustomReport'][_0x148d('0x4e')](_0x3a7091)[_0x148d('0x28')](function(_0x17bc13){if(_0x17bc13){_0xfc8ad0=_0x17bc13;return _0x17bc13[_0x148d('0x6d')]();}return null;})['then'](function(_0x2f6b98){if(_0x2f6b98){if(!_0x2f6b98[_0x148d('0x4c')]){throw new db[(_0x148d('0x6e'))][(_0x148d('0x6f'))](_0x148d('0x70'),0x193);}_0x54b061=_0x2f6b98;return db[_0x148d('0x90')][_0x148d('0x47')]({'raw':!![]});}return null;})[_0x148d('0x28')](function(_0x5bb641){if(_0x5bb641){_0x1c81f3=_[_0x148d('0x71')](_0x5bb641,'id');var _0x2caa26;var _0x2fcd8b=squel['select']();_0x2fcd8b[_0x148d('0x91')](_0xfc8ad0[_0x148d('0x80')]);for(var _0x4b7631=0x0;_0x4b7631<_0x54b061[_0x148d('0x4c')];_0x4b7631+=0x1){_0x2caa26=_0x54b061[_0x4b7631][_0x148d('0x73')]?_0x1c81f3[_0x54b061[_0x4b7631][_0x148d('0x73')]][_0x148d('0x74')]:_0x54b061[_0x4b7631][_0x148d('0x6b')];_0x2caa26=_0x54b061[_0x4b7631][_0x148d('0x76')]?_['replace'](_0x579fa0[_0x54b061[_0x4b7631][_0x148d('0x76')]],'%s',_0x2caa26):_0x2caa26;_0x2caa26=_0x54b061[_0x4b7631][_0x148d('0x77')]?_[_0x148d('0x75')](_0x236dc1[_0x54b061[_0x4b7631][_0x148d('0x77')]],'%s',_0x2caa26):_0x2caa26;if(_0x54b061[_0x4b7631][_0x148d('0x78')]){_0x2fcd8b[_0x148d('0x6a')](_0x2caa26);}_0x54b061[_0x4b7631][_0x148d('0x79')]&&_0x2fcd8b[_0x148d('0x3e')](_0x2caa26,_0x54b061[_0x4b7631]['orderBy']===_0x148d('0x92')?![]:!![]);_0x2fcd8b[_0x148d('0x6b')](_0x2caa26,_0x54b061[_0x4b7631][_0x148d('0x93')]||_0x2caa26);}if(_0xfc8ad0['joins']){_0xfc8ad0[_0x148d('0x7b')]=JSON[_0x148d('0x7a')](_0xfc8ad0[_0x148d('0x7b')]);for(var _0x2d73c8=0x0;_0x2d73c8<_0xfc8ad0[_0x148d('0x7b')][_0x148d('0x4c')];_0x2d73c8+=0x1){if(_0xfc8ad0[_0x148d('0x7b')][_0x2d73c8][_0x148d('0x33')]&&_['includes'](_0x30cf1c,_0xfc8ad0[_0x148d('0x7b')][_0x2d73c8][_0x148d('0x33')])&&_0xfc8ad0['joins'][_0x2d73c8][_0x148d('0x7c')]&&_0xfc8ad0['joins'][_0x2d73c8][_0x148d('0x7d')]&&_0xfc8ad0[_0x148d('0x7b')][_0x2d73c8][_0x148d('0x7e')]){_0x2fcd8b[_0xfc8ad0[_0x148d('0x7b')][_0x2d73c8][_0x148d('0x33')]](_0xfc8ad0[_0x148d('0x7b')][_0x2d73c8][_0x148d('0x7d')],null,util['format'](_0x148d('0x7f'),_0xfc8ad0[_0x148d('0x80')],_0xfc8ad0[_0x148d('0x7b')][_0x2d73c8][_0x148d('0x7c')],_0xfc8ad0['joins'][_0x2d73c8][_0x148d('0x7d')],_0xfc8ad0[_0x148d('0x7b')][_0x2d73c8]['foreignKey']));}}}if(_0xfc8ad0[_0x148d('0x81')]){_0xfc8ad0['conditions']=JSON['parse'](_0xfc8ad0[_0x148d('0x81')]);_0x2fcd8b[_0x148d('0x40')](_0x135b72(_0xfc8ad0[_0x148d('0x81')][_0x148d('0x6a')]));}_0x19e820=_0x2fcd8b[_0x148d('0x82')]();_0x2fcd8b['limit'](_0x2383da);_0x2fcd8b['offset'](0x0);return;}})['then'](function(){if(_0xc2da06[_0x148d('0x94')]===_0x148d('0x95')){return null;}var _0x3646f6=_[_0x148d('0x44')](_0xc2da06,{'name':_0xc2da06[_0x148d('0x96')]||_0xc2da06[_0x148d('0x2e')]||_0xfc8ad0['name'],'basename':_0x4d8c41,'savename':util[_0x148d('0x77')](_0x148d('0x97'),_0xc2da06[_0x148d('0x2e')]||_0xfc8ad0['name'],require(_0x148d('0x98'))['generate'](0x4),_0xc2da06[_0x148d('0x94')]||_0x148d('0x99')),'reportId':_0xfc8ad0['id'],'reportType':_0x148d('0x9a')});return db[_0x148d('0x9b')][_0x148d('0x4f')](_0x3646f6,{'raw':!![]});})[_0x148d('0x28')](function(_0x3e31d0){if(_0xfc8ad0['table']===_0x148d('0x9c')){_0x19e820['where'](_0xfc8ad0[_0x148d('0x80')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0xc2da06['startDate'],_0xc2da06[_0x148d('0x9d')]);}else{_0x19e820[_0x148d('0x40')](_0xfc8ad0[_0x148d('0x80')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0xc2da06[_0x148d('0x9e')],_0xc2da06['endDate']);}if(_0x3e31d0){logger[_0x148d('0x9f')]('Run\x20Query:',_0x19e820['toString']());require(_0x148d('0xa0'))[_0x148d('0xa1')](path[_0x148d('0x89')](__dirname,_0x148d('0xa2'),_0x3e31d0[_0x148d('0x94')]),[_0x3e31d0['id'],_0x19e820[_0x148d('0x85')](),path[_0x148d('0x89')](__dirname,_0x148d('0xa3'),_0x3e31d0[_0x148d('0xa4')]),_0x4d8c41]);return _0x3e31d0;}else{var _0x1aec50=squel['select']();_0x1aec50[_0x148d('0x91')]('('+_0x19e820[_0x148d('0x85')]()+')',_0x148d('0xa5'));_0x1aec50[_0x148d('0x6b')](_0x148d('0xa6'),'count');_0x19e820[_0x148d('0x21')](_0xc2da06['limit']||_0x2383da);_0x19e820[_0x148d('0x1e')](_0xc2da06[_0x148d('0x1e')]||0x0);return dbH[_0x148d('0x86')][_0x148d('0x35')](_0x1aec50['toString'](),{'type':dbH['sequelize']['QueryTypes']['SELECT']})[_0x148d('0x28')](function(_0xedfbef){if(!_0xedfbef['length']){_0x5c8486=0x0;}else{_0x5c8486=_0xedfbef[0x0]['count']||0x0;}return dbH[_0x148d('0x86')][_0x148d('0x35')](_0x19e820[_0x148d('0x85')](),{'type':dbH['sequelize'][_0x148d('0x87')]['SELECT']});})[_0x148d('0x28')](function(_0xfe18e0){return{'rows':_0xfe18e0||[],'count':_0x5c8486};});}});}exports['run']=function(_0xaf65cf,_0xa2b52f){return runReport(_0xaf65cf[_0x148d('0x4b')],_0xaf65cf[_0x148d('0x35')],_0xaf65cf[_0x148d('0x4d')])['then'](respondWithResult(_0xa2b52f,null))[_0x148d('0x49')](handleError(_0xa2b52f,null));};exports[_0x148d('0xa7')]=runReport;exports['query']=function(_0x526936,_0xb9460e){var _0x5e5e57=0xa;var _0xdc1e79=['join','left_join',_0x148d('0x59'),_0x148d('0x5a')];var _0x42183e={'SUM':_0x148d('0x5b'),'COUNT':_0x148d('0x5c'),'COUNT DISTINCT':_0x148d('0x5d'),'MAX':_0x148d('0x5e'),'MIN':_0x148d('0x5f'),'AVG':_0x148d('0x8a'),'GROUP_CONCAT':_0x148d('0x60'),'GROUP_CONCAT ASC':_0x148d('0x8b'),'GROUP_CONCAT DESC':_0x148d('0xa8')};var _0x53dcdc={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x148d('0x62'),'HOUR':_0x148d('0x63'),'ROUND':_0x148d('0x64'),'UNIX_TIMESTAMP':_0x148d('0x8c')};var _0x17c957=function(_0x232927){return!_[_0x148d('0x65')](['IS\x20NULL',_0x148d('0x67'),'IS\x20EMPTY',_0x148d('0x8e')],_0x232927);};var _0x2c94d6=function(_0xf4d63b){if(!_0xf4d63b||!_0xf4d63b[_0x148d('0x68')][_0x148d('0x4c')]){return'';}for(var _0x25176a='(',_0x304f38=0x0;_0x304f38<_0xf4d63b[_0x148d('0x68')][_0x148d('0x4c')];_0x304f38+=0x1){_0x304f38>0x0&&(_0x25176a+='\x20'+_0xf4d63b[_0x148d('0x69')]+'\x20');_0x25176a+=_0xf4d63b[_0x148d('0x68')][_0x304f38][_0x148d('0x6a')]?_0x2c94d6(_0xf4d63b[_0x148d('0x68')][_0x304f38][_0x148d('0x6a')]):_0xf4d63b[_0x148d('0x68')][_0x304f38][_0x148d('0x6b')]+'\x20'+_0xf4d63b[_0x148d('0x68')][_0x304f38][_0x148d('0x6c')]+(_0x17c957(_0xf4d63b[_0x148d('0x68')][_0x304f38]['condition'])?'\x20'+_0xf4d63b['rules'][_0x304f38][_0x148d('0x8f')]:'');}return _0x25176a+')';};var _0x3ca41a={'where':{'id':_0x526936[_0x148d('0x4b')]['id']}},_0x2891c9,_0x39873f,_0x1873de,_0x321bd4,_0x479694;_0x3ca41a=_[_0x148d('0x44')]({},_0x3ca41a,_0x526936[_0x148d('0x4d')]);return db['AnalyticCustomReport'][_0x148d('0x4e')](_0x3ca41a)['then'](function(_0x1cfdec){if(_0x1cfdec){_0x2891c9=_0x1cfdec;return _0x1cfdec[_0x148d('0x6d')]();}return null;})[_0x148d('0x28')](function(_0x2ded96){if(_0x2ded96){if(!_0x2ded96['length']){throw new db[(_0x148d('0x6e'))]['ValidationErrorItem'](_0x148d('0x70'),0x193);}_0x39873f=_0x2ded96;return db['AnalyticMetric'][_0x148d('0x47')]({'raw':!![]});}return null;})[_0x148d('0x28')](function(_0x27d563){if(_0x27d563){_0x1873de=_['keyBy'](_0x27d563,'id');var _0x45e866;var _0x4ce5b7=squel['select']();_0x4ce5b7['from'](_0x2891c9[_0x148d('0x80')]);for(var _0x131e12=0x0;_0x131e12<_0x39873f[_0x148d('0x4c')];_0x131e12+=0x1){_0x45e866=_0x39873f[_0x131e12][_0x148d('0x73')]?_0x1873de[_0x39873f[_0x131e12]['MetricId']][_0x148d('0x74')]:_0x39873f[_0x131e12][_0x148d('0x6b')];_0x45e866=_0x39873f[_0x131e12][_0x148d('0x76')]?_[_0x148d('0x75')](_0x42183e[_0x39873f[_0x131e12][_0x148d('0x76')]],'%s',_0x45e866):_0x45e866;_0x45e866=_0x39873f[_0x131e12][_0x148d('0x77')]?_[_0x148d('0x75')](_0x53dcdc[_0x39873f[_0x131e12][_0x148d('0x77')]],'%s',_0x45e866):_0x45e866;if(_0x39873f[_0x131e12][_0x148d('0x78')]){_0x4ce5b7[_0x148d('0x6a')](_0x45e866);}_0x39873f[_0x131e12][_0x148d('0x79')]&&_0x4ce5b7['order'](_0x45e866,_0x39873f[_0x131e12][_0x148d('0x79')]===_0x148d('0x92')?![]:!![]);_0x4ce5b7[_0x148d('0x6b')](_0x45e866,_0x39873f[_0x131e12][_0x148d('0x93')]||_0x45e866);}if(_0x2891c9[_0x148d('0x7b')]){_0x2891c9[_0x148d('0x7b')]=JSON['parse'](_0x2891c9[_0x148d('0x7b')]);for(var _0x13764d=0x0;_0x13764d<_0x2891c9[_0x148d('0x7b')][_0x148d('0x4c')];_0x13764d+=0x1){if(_0x2891c9[_0x148d('0x7b')][_0x13764d][_0x148d('0x33')]&&_['includes'](_0xdc1e79,_0x2891c9['joins'][_0x13764d][_0x148d('0x33')])&&_0x2891c9[_0x148d('0x7b')][_0x13764d][_0x148d('0x7c')]&&_0x2891c9[_0x148d('0x7b')][_0x13764d][_0x148d('0x7d')]&&_0x2891c9[_0x148d('0x7b')][_0x13764d][_0x148d('0x7e')]){_0x4ce5b7[_0x2891c9[_0x148d('0x7b')][_0x13764d][_0x148d('0x33')]](_0x2891c9[_0x148d('0x7b')][_0x13764d][_0x148d('0x7d')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x2891c9[_0x148d('0x80')],_0x2891c9[_0x148d('0x7b')][_0x13764d][_0x148d('0x7c')],_0x2891c9[_0x148d('0x7b')][_0x13764d][_0x148d('0x7d')],_0x2891c9[_0x148d('0x7b')][_0x13764d][_0x148d('0x7e')]));}}}if(_0x2891c9['conditions']){_0x2891c9['conditions']=JSON[_0x148d('0x7a')](_0x2891c9[_0x148d('0x81')]);_0x4ce5b7[_0x148d('0x40')](_0x2c94d6(_0x2891c9[_0x148d('0x81')][_0x148d('0x6a')]));}_0x479694=_0x4ce5b7['clone']();_0x4ce5b7['limit'](_0x5e5e57);_0x4ce5b7['offset'](0x0);logger[_0x148d('0x83')](_0x148d('0x84'),_0x4ce5b7[_0x148d('0x85')]());return dbH['sequelize'][_0x148d('0x35')](_0x4ce5b7['toString'](),{'type':dbH[_0x148d('0x86')]['QueryTypes'][_0x148d('0x88')]});}})[_0x148d('0x28')](function(){return{'sql':_0x479694[_0x148d('0x85')]()};})[_0x148d('0x28')](respondWithResult(_0xb9460e,null))[_0x148d('0x49')](handleError(_0xb9460e,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 59d5de5..747317d 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 _0xc629=['util','api','moment','path','rimraf','../../config/environment','exports','define','AnalyticCustomReport','lodash'];(function(_0x475bf1,_0x5235b6){var _0x4095d1=function(_0x30fe72){while(--_0x30fe72){_0x475bf1['push'](_0x475bf1['shift']());}};_0x4095d1(++_0x5235b6);}(_0xc629,0x153));var _0x9c62=function(_0x201309,_0x536c9d){_0x201309=_0x201309-0x0;var _0x4be513=_0xc629[_0x201309];return _0x4be513;};'use strict';var _=require(_0x9c62('0x0'));var util=require(_0x9c62('0x1'));var logger=require('../../config/logger')(_0x9c62('0x2'));var moment=require(_0x9c62('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9c62('0x4'));var rimraf=require(_0x9c62('0x5'));var config=require(_0x9c62('0x6'));var attributes=require('./analyticCustomReport.attributes');module[_0x9c62('0x7')]=function(_0x4490b6,_0x2cc272){return _0x4490b6[_0x9c62('0x8')](_0x9c62('0x9'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8f55=['path','../../config/environment','./analyticCustomReport.attributes','exports','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x250c81,_0x1d0eb4){var _0x12d6fc=function(_0x5466b7){while(--_0x5466b7){_0x250c81['push'](_0x250c81['shift']());}};_0x12d6fc(++_0x1d0eb4);}(_0x8f55,0x109));var _0x58f5=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8f55[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x58f5('0x0'));var util=require(_0x58f5('0x1'));var logger=require(_0x58f5('0x2'))('api');var moment=require('moment');var BPromise=require(_0x58f5('0x3'));var rp=require(_0x58f5('0x4'));var fs=require('fs');var path=require(_0x58f5('0x5'));var rimraf=require('rimraf');var config=require(_0x58f5('0x6'));var attributes=require(_0x58f5('0x7'));module[_0x58f5('0x8')]=function(_0x1563ec,_0x28db1f){return _0x1563ec['define']('AnalyticCustomReport',attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js index 15b0f9e..eb009d2 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 _0xe4a6=['../../config/environment','client','http','then','AnalyticCustomReport,\x20%s,\x20%s','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x25a0f0,_0x54f2d8){var _0x25846c=function(_0x443b0b){while(--_0x443b0b){_0x25a0f0['push'](_0x25a0f0['shift']());}};_0x25846c(++_0x54f2d8);}(_0xe4a6,0x141));var _0x6e4a=function(_0xdabd59,_0x55e984){_0xdabd59=_0xdabd59-0x0;var _0x4af920=_0xe4a6[_0xdabd59];return _0x4af920;};'use strict';var _=require(_0x6e4a('0x0'));var util=require(_0x6e4a('0x1'));var moment=require(_0x6e4a('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e4a('0x3'));var fs=require('fs');var Redis=require(_0x6e4a('0x4'));var db=require(_0x6e4a('0x5'))['db'];var utils=require(_0x6e4a('0x6'));var logger=require(_0x6e4a('0x7'))(_0x6e4a('0x8'));var config=require(_0x6e4a('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6e4a('0xa')][_0x6e4a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4d12d8,_0x58425d,_0x360375){return new BPromise(function(_0x5b1ec0,_0x3ec504){return client['request'](_0x4d12d8,_0x360375)[_0x6e4a('0xc')](function(_0x5b010f){logger['info'](_0x6e4a('0xd'),_0x58425d,'request\x20sent');logger['debug'](_0x6e4a('0xe'),_0x58425d,_0x6e4a('0xf'),JSON[_0x6e4a('0x10')](_0x5b010f));if(_0x5b010f[_0x6e4a('0x11')]){if(_0x5b010f['error']['code']===0x1f4){logger['error'](_0x6e4a('0xd'),_0x58425d,_0x5b010f[_0x6e4a('0x11')][_0x6e4a('0x12')]);return _0x3ec504(_0x5b010f[_0x6e4a('0x11')]['message']);}logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x58425d,_0x5b010f[_0x6e4a('0x11')][_0x6e4a('0x12')]);return _0x5b1ec0(_0x5b010f['error'][_0x6e4a('0x12')]);}else{logger[_0x6e4a('0x13')]('AnalyticCustomReport,\x20%s,\x20%s',_0x58425d,_0x6e4a('0xf'));_0x5b1ec0(_0x5b010f[_0x6e4a('0x14')][_0x6e4a('0x12')]);}})[_0x6e4a('0x15')](function(_0x5d0c1d){logger[_0x6e4a('0x11')](_0x6e4a('0xd'),_0x58425d,_0x5d0c1d);_0x3ec504(_0x5d0c1d);});});} \ No newline at end of file +var _0x3715=['info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x58be83,_0x5f5526){var _0x12dadb=function(_0x358c26){while(--_0x358c26){_0x58be83['push'](_0x58be83['shift']());}};_0x12dadb(++_0x5f5526);}(_0x3715,0xc3));var _0x5371=function(_0x3efefc,_0xf9f2e0){_0x3efefc=_0x3efefc-0x0;var _0x1cdabe=_0x3715[_0x3efefc];return _0x1cdabe;};'use strict';var _=require(_0x5371('0x0'));var util=require(_0x5371('0x1'));var moment=require(_0x5371('0x2'));var BPromise=require(_0x5371('0x3'));var rs=require(_0x5371('0x4'));var fs=require('fs');var Redis=require(_0x5371('0x5'));var db=require(_0x5371('0x6'))['db'];var utils=require(_0x5371('0x7'));var logger=require(_0x5371('0x8'))(_0x5371('0x9'));var config=require(_0x5371('0xa'));var jayson=require(_0x5371('0xb'));var client=jayson['client'][_0x5371('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x340e44,_0x5edddc,_0x426a2a){return new BPromise(function(_0x16c64a,_0x41d142){return client['request'](_0x340e44,_0x426a2a)[_0x5371('0xd')](function(_0x48b76c){logger['info'](_0x5371('0xe'),_0x5edddc,_0x5371('0xf'));logger[_0x5371('0x10')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x5edddc,_0x5371('0xf'),JSON[_0x5371('0x11')](_0x48b76c));if(_0x48b76c[_0x5371('0x12')]){if(_0x48b76c['error'][_0x5371('0x13')]===0x1f4){logger[_0x5371('0x12')](_0x5371('0xe'),_0x5edddc,_0x48b76c[_0x5371('0x12')]['message']);return _0x41d142(_0x48b76c[_0x5371('0x12')]['message']);}logger[_0x5371('0x12')](_0x5371('0xe'),_0x5edddc,_0x48b76c['error'][_0x5371('0x14')]);return _0x16c64a(_0x48b76c[_0x5371('0x12')][_0x5371('0x14')]);}else{logger[_0x5371('0x15')](_0x5371('0xe'),_0x5edddc,_0x5371('0xf'));_0x16c64a(_0x48b76c[_0x5371('0x16')]['message']);}})[_0x5371('0x17')](function(_0x3e7169){logger[_0x5371('0x12')](_0x5371('0xe'),_0x5edddc,_0x3e7169);_0x41d142(_0x3e7169);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 06eba59..4536d2c 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 _0xda74=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','isAuthenticated','/:id','get','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','delete','destroy','exports','util'];(function(_0x28e5dd,_0x46f8b9){var _0x48dda8=function(_0x420781){while(--_0x420781){_0x28e5dd['push'](_0x28e5dd['shift']());}};_0x48dda8(++_0x46f8b9);}(_0xda74,0x1f3));var _0x4da7=function(_0x26aebd,_0x156290){_0x26aebd=_0x26aebd-0x0;var _0x7fa406=_0xda74[_0x26aebd];return _0x7fa406;};'use strict';var multer=require('multer');var util=require(_0x4da7('0x0'));var path=require(_0x4da7('0x1'));var timeout=require(_0x4da7('0x2'));var express=require(_0x4da7('0x3'));var router=express[_0x4da7('0x4')]();var fs_extra=require(_0x4da7('0x5'));var auth=require(_0x4da7('0x6'));var interaction=require(_0x4da7('0x7'));var config=require(_0x4da7('0x8'));var controller=require(_0x4da7('0x9'));router['get']('/',auth[_0x4da7('0xa')](),controller['index']);router['get'](_0x4da7('0xb'),auth[_0x4da7('0xa')](),controller['show']);router[_0x4da7('0xc')](_0x4da7('0xd'),auth['isAuthenticated'](),controller[_0x4da7('0xe')]);router[_0x4da7('0xc')](_0x4da7('0xf'),auth[_0x4da7('0xa')](),controller[_0x4da7('0x10')]);router['get'](_0x4da7('0x11'),auth[_0x4da7('0xa')](),controller[_0x4da7('0x12')]);router[_0x4da7('0x13')]('/',auth[_0x4da7('0xa')](),controller[_0x4da7('0x14')]);router[_0x4da7('0x15')](_0x4da7('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x4da7('0x16')](_0x4da7('0xb'),auth[_0x4da7('0xa')](),controller[_0x4da7('0x17')]);module[_0x4da7('0x18')]=router; \ No newline at end of file +var _0xbca8=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/preview','preview','/:id/run','/:id/query','query','post','create','put','/:id','update','destroy','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x47a0cd,_0x223224){var _0x21ad28=function(_0x3cf29f){while(--_0x3cf29f){_0x47a0cd['push'](_0x47a0cd['shift']());}};_0x21ad28(++_0x223224);}(_0xbca8,0x1c2));var _0x8bca=function(_0x552feb,_0x41ac88){_0x552feb=_0x552feb-0x0;var _0x21324b=_0xbca8[_0x552feb];return _0x21324b;};'use strict';var multer=require(_0x8bca('0x0'));var util=require(_0x8bca('0x1'));var path=require(_0x8bca('0x2'));var timeout=require(_0x8bca('0x3'));var express=require('express');var router=express[_0x8bca('0x4')]();var fs_extra=require(_0x8bca('0x5'));var auth=require(_0x8bca('0x6'));var interaction=require(_0x8bca('0x7'));var config=require(_0x8bca('0x8'));var controller=require('./analyticCustomReport.controller');router[_0x8bca('0x9')]('/',auth[_0x8bca('0xa')](),controller[_0x8bca('0xb')]);router[_0x8bca('0x9')]('/:id',auth[_0x8bca('0xa')](),controller[_0x8bca('0xc')]);router[_0x8bca('0x9')](_0x8bca('0xd'),auth[_0x8bca('0xa')](),controller[_0x8bca('0xe')]);router[_0x8bca('0x9')](_0x8bca('0xf'),auth[_0x8bca('0xa')](),controller['run']);router['get'](_0x8bca('0x10'),auth[_0x8bca('0xa')](),controller[_0x8bca('0x11')]);router[_0x8bca('0x12')]('/',auth[_0x8bca('0xa')](),controller[_0x8bca('0x13')]);router[_0x8bca('0x14')](_0x8bca('0x15'),auth[_0x8bca('0xa')](),controller[_0x8bca('0x16')]);router['delete']('/:id',auth[_0x8bca('0xa')](),controller[_0x8bca('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 4bc4a2c..ee6aaa3 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 _0x24ca=['sequelize','STRING','TEXT'];(function(_0x5d289a,_0x352880){var _0x14bd5f=function(_0x268766){while(--_0x268766){_0x5d289a['push'](_0x5d289a['shift']());}};_0x14bd5f(++_0x352880);}(_0x24ca,0x1bc));var _0xa24c=function(_0x562f3b,_0x4c65ae){_0x562f3b=_0x562f3b-0x0;var _0x1edd55=_0x24ca[_0x562f3b];return _0x1edd55;};'use strict';var Sequelize=require(_0xa24c('0x0'));module['exports']={'name':{'type':Sequelize[_0xa24c('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xa24c('0x1')]},'parent':{'type':Sequelize[_0xa24c('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0xa24c('0x2')]},'joins':{'type':Sequelize[_0xa24c('0x2')]}}; \ No newline at end of file +var _0xdc97=['exports','STRING','TEXT','sequelize'];(function(_0x510b98,_0x4c4cbb){var _0x45e775=function(_0x29ec11){while(--_0x29ec11){_0x510b98['push'](_0x510b98['shift']());}};_0x45e775(++_0x4c4cbb);}(_0xdc97,0x13b));var _0x7dc9=function(_0x44cf01,_0x7d90b7){_0x44cf01=_0x44cf01-0x0;var _0x42900b=_0xdc97[_0x44cf01];return _0x42900b;};'use strict';var Sequelize=require(_0x7dc9('0x0'));module[_0x7dc9('0x1')]={'name':{'type':Sequelize[_0x7dc9('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x7dc9('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x7dc9('0x3')]},'joins':{'type':Sequelize[_0x7dc9('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index b215286..c3fc612 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 _0x187d=['fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','dbH','sendStatus','status','limit','undefined','count','offset','set','json','save','update','then','get','destroy','error','name','send','map','AnalyticDefaultReport','rawAttributes','fieldName','type','model','keys','filters','intersection','query','fields','attributes','order','sort','filter','where','merge','options','includeAll','rows','catch','include','create','role','user','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','params','preview','left_join','right_join','cross_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\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','length','group','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','findAll','keyBy','from','table','MetricId','metric','replace','format','groupBy','orderBy','field','alias','joins','parse','parentKey','foreignKey','foreignTable','conditions','clone','Limited\x20Query:','toString','sequelize','SELECT','join','IS\x20EMPTY','operator','AnalyticMetric','function','DESC','%s.%s\x20=\x20%s.%s','output','web','fullPath','%s-%s.%s','randomstring','generate','default','AnalyticExtractedReport','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','fork','../../components/export/','savename','select','countTable','QueryTypes','runReport','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs'];(function(_0x4a6efd,_0x14bb86){var _0x5c915e=function(_0x463b3e){while(--_0x463b3e){_0x4a6efd['push'](_0x4a6efd['shift']());}};_0x5c915e(++_0x14bb86);}(_0x187d,0x93));var _0xd187=function(_0x2cf2e9,_0xd58ea1){_0x2cf2e9=_0x2cf2e9-0x0;var _0xd3670d=_0x187d[_0x2cf2e9];return _0xd3670d;};'use strict';var emlformat=require(_0xd187('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd187('0x1'));var jsonpatch=require(_0xd187('0x2'));var rp=require(_0xd187('0x3'));var moment=require(_0xd187('0x4'));var BPromise=require(_0xd187('0x5'));var Mustache=require(_0xd187('0x6'));var util=require('util');var path=require(_0xd187('0x7'));var sox=require(_0xd187('0x8'));var csv=require('to-csv');var ejs=require(_0xd187('0x9'));var fs=require('fs');var fs_extra=require(_0xd187('0xa'));var _=require(_0xd187('0xb'));var squel=require(_0xd187('0xc'));var crypto=require(_0xd187('0xd'));var jsforce=require(_0xd187('0xe'));var deskjs=require(_0xd187('0xf'));var toCsv=require(_0xd187('0x10'));var querystring=require('querystring');var Papa=require(_0xd187('0x11'));var Redis=require(_0xd187('0x12'));var authService=require(_0xd187('0x13'));var qs=require(_0xd187('0x14'));var as=require(_0xd187('0x15'));var hardwareService=require(_0xd187('0x16'));var logger=require('../../config/logger')(_0xd187('0x17'));var utils=require(_0xd187('0x18'));var config=require(_0xd187('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xd187('0x1a'))['db'];var dbH=require(_0xd187('0x1a'))[_0xd187('0x1b')];function respondWithStatusCode(_0x59ee4a,_0x33e3d5){_0x33e3d5=_0x33e3d5||0xcc;return function(_0x18ce42){if(_0x18ce42){return _0x59ee4a[_0xd187('0x1c')](_0x33e3d5);}return _0x59ee4a[_0xd187('0x1d')](_0x33e3d5)['end']();};}function respondWithResult(_0x39a927,_0x2050d5){_0x2050d5=_0x2050d5||0xc8;return function(_0x45ab10){if(_0x45ab10){return _0x39a927[_0xd187('0x1d')](_0x2050d5)['json'](_0x45ab10);}};}function respondWithFilteredResult(_0x245d3e,_0x52a208){return function(_0x5cf218){if(_0x5cf218){var _0x40ed84=typeof _0x52a208['offset']==='undefined'&&typeof _0x52a208[_0xd187('0x1e')]===_0xd187('0x1f');var _0x374fe0=_0x5cf218[_0xd187('0x20')];var _0x21df74=_0x40ed84?0x0:_0x52a208[_0xd187('0x21')];var _0x12b388=_0x40ed84?_0x5cf218[_0xd187('0x20')]:_0x52a208[_0xd187('0x21')]+_0x52a208[_0xd187('0x1e')];var _0x170d5c;if(_0x12b388>=_0x374fe0){_0x12b388=_0x374fe0;_0x170d5c=0xc8;}else{_0x170d5c=0xce;}_0x245d3e[_0xd187('0x1d')](_0x170d5c);return _0x245d3e[_0xd187('0x22')]('Content-Range',_0x21df74+'-'+_0x12b388+'/'+_0x374fe0)[_0xd187('0x23')](_0x5cf218);}return null;};}function patchUpdates(_0x81b988){return function(_0xc5bba5){try{jsonpatch['apply'](_0xc5bba5,_0x81b988,!![]);}catch(_0x5a0360){return BPromise['reject'](_0x5a0360);}return _0xc5bba5[_0xd187('0x24')]();};}function saveUpdates(_0x33741d,_0x249a82){return function(_0x4f62c8){if(_0x4f62c8){return _0x4f62c8[_0xd187('0x25')](_0x33741d)['then'](function(_0x145771){return _0x145771;});}return null;};}function removeEntity(_0x5a7a23,_0x1047f4){return function(_0x54f340){if(_0x54f340){return _0x54f340['destroy']()[_0xd187('0x26')](function(){var _0x4d992b=_0x54f340[_0xd187('0x27')]({'plain':!![]});var _0x598aa4='DefaultReports';return db['UserProfileResource'][_0xd187('0x28')]({'where':{'type':_0x598aa4,'resourceId':_0x4d992b['id']}})[_0xd187('0x26')](function(){return _0x54f340;});})[_0xd187('0x26')](function(){_0x5a7a23[_0xd187('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a20ed,_0x2875c8){return function(_0x5c8e52){if(!_0x5c8e52){_0x2a20ed[_0xd187('0x1c')](0x194);}return _0x5c8e52;};}function handleError(_0x1c87ee,_0x34febe){_0x34febe=_0x34febe||0x1f4;return function(_0x4c50a5){logger[_0xd187('0x29')](_0x4c50a5['stack']);if(_0x4c50a5[_0xd187('0x2a')]){delete _0x4c50a5[_0xd187('0x2a')];}_0x1c87ee[_0xd187('0x1d')](_0x34febe)[_0xd187('0x2b')](_0x4c50a5);};}exports['index']=function(_0x140e54,_0xb38778){var _0x5bba10={},_0x4cc587={},_0x1a1922={'count':0x0,'rows':[]};var _0x1836cf=_[_0xd187('0x2c')](db[_0xd187('0x2d')][_0xd187('0x2e')],function(_0x2d8843){return{'name':_0x2d8843[_0xd187('0x2f')],'type':_0x2d8843[_0xd187('0x30')]['key']};});_0x4cc587[_0xd187('0x31')]=_[_0xd187('0x2c')](_0x1836cf,_0xd187('0x2a'));_0x4cc587['query']=_[_0xd187('0x32')](_0x140e54['query']);_0x4cc587[_0xd187('0x33')]=_[_0xd187('0x34')](_0x4cc587[_0xd187('0x31')],_0x4cc587['query']);_0x5bba10['attributes']=_[_0xd187('0x34')](_0x4cc587[_0xd187('0x31')],qs['fields'](_0x140e54[_0xd187('0x35')][_0xd187('0x36')]));_0x5bba10[_0xd187('0x37')]=_0x5bba10['attributes']['length']?_0x5bba10[_0xd187('0x37')]:_0x4cc587[_0xd187('0x31')];if(!_0x140e54['query']['hasOwnProperty']('nolimit')){_0x5bba10[_0xd187('0x1e')]=qs['limit'](_0x140e54[_0xd187('0x35')][_0xd187('0x1e')]);_0x5bba10['offset']=qs[_0xd187('0x21')](_0x140e54['query'][_0xd187('0x21')]);}_0x5bba10[_0xd187('0x38')]=qs['sort'](_0x140e54[_0xd187('0x35')][_0xd187('0x39')]);_0x5bba10['where']=qs[_0xd187('0x33')](_['pick'](_0x140e54['query'],_0x4cc587[_0xd187('0x33')]),_0x1836cf);if(_0x140e54[_0xd187('0x35')][_0xd187('0x3a')]){_0x5bba10[_0xd187('0x3b')]=_[_0xd187('0x3c')](_0x5bba10['where'],{'$or':_[_0xd187('0x2c')](_0x1836cf,function(_0xe090ad){if(_0xe090ad[_0xd187('0x30')]!=='VIRTUAL'){var _0x4b121c={};_0x4b121c[_0xe090ad['name']]={'$like':'%'+_0x140e54['query'][_0xd187('0x3a')]+'%'};return _0x4b121c;}})});}_0x5bba10=_[_0xd187('0x3c')]({},_0x5bba10,_0x140e54[_0xd187('0x3d')]);var _0x367303={'where':_0x5bba10[_0xd187('0x3b')]};return db[_0xd187('0x2d')][_0xd187('0x20')](_0x367303)[_0xd187('0x26')](function(_0x526060){_0x1a1922[_0xd187('0x20')]=_0x526060;if(_0x140e54[_0xd187('0x35')][_0xd187('0x3e')]){_0x5bba10['include']=[{'all':!![]}];}return db[_0xd187('0x2d')]['findAll'](_0x5bba10);})[_0xd187('0x26')](function(_0x406d29){_0x1a1922[_0xd187('0x3f')]=_0x406d29;return _0x1a1922;})[_0xd187('0x26')](respondWithFilteredResult(_0xb38778,_0x5bba10))[_0xd187('0x40')](handleError(_0xb38778,null));};exports['show']=function(_0x3f0484,_0x3d9e60){var _0x3215b1={'raw':!![],'where':{'id':_0x3f0484['params']['id']}},_0x3fa19c={};_0x3fa19c[_0xd187('0x31')]=_[_0xd187('0x32')](db['AnalyticDefaultReport'][_0xd187('0x2e')]);_0x3fa19c[_0xd187('0x35')]=_['keys'](_0x3f0484['query']);_0x3fa19c[_0xd187('0x33')]=_[_0xd187('0x34')](_0x3fa19c['model'],_0x3fa19c['query']);_0x3215b1['attributes']=_[_0xd187('0x34')](_0x3fa19c[_0xd187('0x31')],qs[_0xd187('0x36')](_0x3f0484[_0xd187('0x35')][_0xd187('0x36')]));_0x3215b1[_0xd187('0x37')]=_0x3215b1[_0xd187('0x37')]['length']?_0x3215b1[_0xd187('0x37')]:_0x3fa19c[_0xd187('0x31')];if(_0x3f0484[_0xd187('0x35')][_0xd187('0x3e')]){_0x3215b1[_0xd187('0x41')]=[{'all':!![]}];}_0x3215b1=_[_0xd187('0x3c')]({},_0x3215b1,_0x3f0484[_0xd187('0x3d')]);return db[_0xd187('0x2d')]['find'](_0x3215b1)[_0xd187('0x26')](handleEntityNotFound(_0x3d9e60,null))[_0xd187('0x26')](respondWithResult(_0x3d9e60,null))[_0xd187('0x40')](handleError(_0x3d9e60,null));};exports[_0xd187('0x42')]=function(_0x36b99d,_0x5ad646){return db[_0xd187('0x2d')][_0xd187('0x42')](_0x36b99d['body'],{})[_0xd187('0x26')](function(_0xd9635d){var _0x55fac6=_0x36b99d['user']['get']({'plain':!![]});if(!_0x55fac6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x55fac6[_0xd187('0x43')]===_0xd187('0x44')){var _0x12d448=_0xd9635d[_0xd187('0x27')]({'plain':!![]});var _0x460202=_0xd187('0x45');return db[_0xd187('0x46')]['find']({'where':{'name':_0x460202,'userProfileId':_0x55fac6[_0xd187('0x47')]},'raw':!![]})[_0xd187('0x26')](function(_0x1b12c4){if(_0x1b12c4&&_0x1b12c4[_0xd187('0x48')]===0x0){return db['UserProfileResource'][_0xd187('0x42')]({'name':_0x12d448['name'],'resourceId':_0x12d448['id'],'type':'DefaultReports','sectionId':_0x1b12c4['id']},{})[_0xd187('0x26')](function(){return _0xd9635d;});}else{return _0xd9635d;}})['catch'](function(_0x1a1252){logger[_0xd187('0x29')](_0xd187('0x49'),_0x1a1252);throw _0x1a1252;});}return _0xd9635d;})[_0xd187('0x26')](respondWithResult(_0x5ad646,0xc9))[_0xd187('0x40')](handleError(_0x5ad646,null));};exports[_0xd187('0x25')]=function(_0x3c7ba6,_0x2b4f9d){if(_0x3c7ba6[_0xd187('0x4a')]['id']){delete _0x3c7ba6['body']['id'];}return db[_0xd187('0x2d')][_0xd187('0x4b')]({'where':{'id':_0x3c7ba6['params']['id']}})[_0xd187('0x26')](handleEntityNotFound(_0x2b4f9d,null))[_0xd187('0x26')](saveUpdates(_0x3c7ba6[_0xd187('0x4a')],null))['then'](respondWithResult(_0x2b4f9d,null))[_0xd187('0x40')](handleError(_0x2b4f9d,null));};exports[_0xd187('0x28')]=function(_0x50073d,_0x457da1){return db[_0xd187('0x2d')]['find']({'where':{'id':_0x50073d[_0xd187('0x4c')]['id']}})['then'](handleEntityNotFound(_0x457da1,null))[_0xd187('0x26')](removeEntity(_0x457da1,null))[_0xd187('0x40')](handleError(_0x457da1,null));};exports[_0xd187('0x4d')]=function(_0x508866,_0x100d64){var _0x2265fb=0xa;var _0x1675d9=['join',_0xd187('0x4e'),_0xd187('0x4f'),_0xd187('0x50')];var _0x56b36b={'SUM':_0xd187('0x51'),'COUNT':_0xd187('0x52'),'COUNT DISTINCT':_0xd187('0x53'),'MAX':_0xd187('0x54'),'MIN':_0xd187('0x55'),'AVG':_0xd187('0x56'),'GROUP_CONCAT':_0xd187('0x57'),'GROUP_CONCAT ASC':_0xd187('0x58'),'GROUP_CONCAT DESC':_0xd187('0x59')};var _0x2c7dd9={'SEC_TO_TIME':_0xd187('0x5a'),'DATE':_0xd187('0x5b'),'HOUR':_0xd187('0x5c'),'ROUND':_0xd187('0x5d'),'UNIX_TIMESTAMP':_0xd187('0x5e')};var _0xaff1e6=function(_0x42fb32){return!_[_0xd187('0x5f')]([_0xd187('0x60'),_0xd187('0x61'),'IS\x20EMPTY',_0xd187('0x62')],_0x42fb32);};var _0x48c82d=function(_0x13d118){if(!_0x13d118||!_0x13d118[_0xd187('0x63')][_0xd187('0x64')]){return'';}for(var _0x4225e6='(',_0x51fbdb=0x0;_0x51fbdb<_0x13d118[_0xd187('0x63')][_0xd187('0x64')];_0x51fbdb+=0x1){_0x51fbdb>0x0&&(_0x4225e6+='\x20'+_0x13d118['operator']+'\x20');_0x4225e6+=_0x13d118['rules'][_0x51fbdb][_0xd187('0x65')]?_0x48c82d(_0x13d118[_0xd187('0x63')][_0x51fbdb][_0xd187('0x65')]):_0x13d118[_0xd187('0x63')][_0x51fbdb]['field']+'\x20'+_0x13d118[_0xd187('0x63')][_0x51fbdb]['condition']+(_0xaff1e6(_0x13d118[_0xd187('0x63')][_0x51fbdb][_0xd187('0x66')])?'\x20'+_0x13d118[_0xd187('0x63')][_0x51fbdb][_0xd187('0x67')]:'');}return _0x4225e6+')';};var _0x57cad7={'where':{'id':_0x508866['params']['id']}},_0x2409a8,_0xaea7e0,_0xd12560,_0x9e82c,_0x151f3c;_0x57cad7=_['merge']({},_0x57cad7,_0x508866[_0xd187('0x3d')]);return db[_0xd187('0x2d')][_0xd187('0x4b')](_0x57cad7)[_0xd187('0x26')](function(_0x13e05a){if(_0x13e05a){_0x2409a8=_0x13e05a;return _0x13e05a[_0xd187('0x68')]();}return null;})[_0xd187('0x26')](function(_0x1291cc){if(_0x1291cc){if(!_0x1291cc[_0xd187('0x64')]){throw new db[(_0xd187('0x69'))][(_0xd187('0x6a'))](_0xd187('0x6b'),0x193);}_0xaea7e0=_0x1291cc;return db['AnalyticMetric'][_0xd187('0x6c')]({'raw':!![]});}return null;})[_0xd187('0x26')](function(_0x54e908){if(_0x54e908){_0xd12560=_[_0xd187('0x6d')](_0x54e908,'id');var _0x1a9979;var _0x4bec3e=squel['select']();_0x4bec3e[_0xd187('0x6e')](_0x2409a8[_0xd187('0x6f')]);for(var _0x2ac56f=0x0;_0x2ac56f<_0xaea7e0[_0xd187('0x64')];_0x2ac56f+=0x1){_0x1a9979=_0xaea7e0[_0x2ac56f]['MetricId']?_0xd12560[_0xaea7e0[_0x2ac56f][_0xd187('0x70')]][_0xd187('0x71')]:_0xaea7e0[_0x2ac56f]['field'];_0x1a9979=_0xaea7e0[_0x2ac56f]['function']?_[_0xd187('0x72')](_0x56b36b[_0xaea7e0[_0x2ac56f]['function']],'%s',_0x1a9979):_0x1a9979;_0x1a9979=_0xaea7e0[_0x2ac56f][_0xd187('0x73')]?_[_0xd187('0x72')](_0x2c7dd9[_0xaea7e0[_0x2ac56f]['format']],'%s',_0x1a9979):_0x1a9979;if(_0xaea7e0[_0x2ac56f][_0xd187('0x74')]){_0x4bec3e['group'](_0x1a9979);}_0xaea7e0[_0x2ac56f][_0xd187('0x75')]&&_0x4bec3e['order'](_0x1a9979,_0xaea7e0[_0x2ac56f]['orderBy']==='DESC'?![]:!![]);_0x4bec3e[_0xd187('0x76')](_0x1a9979,_0xaea7e0[_0x2ac56f][_0xd187('0x77')]||_0x1a9979);}if(_0x2409a8[_0xd187('0x78')]){_0x2409a8[_0xd187('0x78')]=JSON[_0xd187('0x79')](_0x2409a8[_0xd187('0x78')]);for(var _0x11858e=0x0;_0x11858e<_0x2409a8[_0xd187('0x78')]['length'];_0x11858e+=0x1){if(_0x2409a8[_0xd187('0x78')][_0x11858e][_0xd187('0x30')]&&_[_0xd187('0x5f')](_0x1675d9,_0x2409a8['joins'][_0x11858e][_0xd187('0x30')])&&_0x2409a8[_0xd187('0x78')][_0x11858e][_0xd187('0x7a')]&&_0x2409a8[_0xd187('0x78')][_0x11858e]['foreignTable']&&_0x2409a8[_0xd187('0x78')][_0x11858e][_0xd187('0x7b')]){_0x4bec3e[_0x2409a8['joins'][_0x11858e][_0xd187('0x30')]](_0x2409a8[_0xd187('0x78')][_0x11858e][_0xd187('0x7c')],null,util[_0xd187('0x73')]('%s.%s\x20=\x20%s.%s',_0x2409a8[_0xd187('0x6f')],_0x2409a8[_0xd187('0x78')][_0x11858e]['parentKey'],_0x2409a8[_0xd187('0x78')][_0x11858e]['foreignTable'],_0x2409a8['joins'][_0x11858e]['foreignKey']));}}}if(_0x2409a8[_0xd187('0x7d')]){_0x2409a8[_0xd187('0x7d')]=JSON[_0xd187('0x79')](_0x2409a8[_0xd187('0x7d')]);_0x4bec3e[_0xd187('0x3b')](_0x48c82d(_0x2409a8[_0xd187('0x7d')]['group']));}_0x151f3c=_0x4bec3e[_0xd187('0x7e')]();_0x4bec3e[_0xd187('0x1e')](_0x2265fb);_0x4bec3e['offset'](0x0);logger['debug'](_0xd187('0x7f'),_0x4bec3e[_0xd187('0x80')]());return dbH[_0xd187('0x81')][_0xd187('0x35')](_0x4bec3e[_0xd187('0x80')](),{'type':dbH[_0xd187('0x81')]['QueryTypes'][_0xd187('0x82')]});}})[_0xd187('0x26')](respondWithResult(_0x100d64,null))[_0xd187('0x40')](handleError(_0x100d64,null));};function runReport(_0xbc650f,_0x1da684,_0x2879ff){var _0x1982cd=_0x1da684[_0xd187('0x2a')];var _0x3d9b2f=0xa;var _0xf31fac=[_0xd187('0x83'),_0xd187('0x4e'),'right_join','cross_join'];var _0x3d7e97={'SUM':_0xd187('0x51'),'COUNT':_0xd187('0x52'),'COUNT DISTINCT':_0xd187('0x53'),'MAX':_0xd187('0x54'),'MIN':_0xd187('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xd187('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xd187('0x59')};var _0x520f86={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xd187('0x5b'),'HOUR':'HOUR(%s)','ROUND':_0xd187('0x5d'),'UNIX_TIMESTAMP':_0xd187('0x5e')};var _0x1ccb17=function(_0x432995){return!_[_0xd187('0x5f')]([_0xd187('0x60'),_0xd187('0x61'),_0xd187('0x84'),_0xd187('0x62')],_0x432995);};var _0x395e45=function(_0x1e8839){if(!_0x1e8839||!_0x1e8839[_0xd187('0x63')][_0xd187('0x64')]){return'';}for(var _0x2101a3='(',_0x25fc08=0x0;_0x25fc08<_0x1e8839['rules'][_0xd187('0x64')];_0x25fc08+=0x1){_0x25fc08>0x0&&(_0x2101a3+='\x20'+_0x1e8839[_0xd187('0x85')]+'\x20');_0x2101a3+=_0x1e8839[_0xd187('0x63')][_0x25fc08][_0xd187('0x65')]?_0x395e45(_0x1e8839['rules'][_0x25fc08][_0xd187('0x65')]):_0x1e8839[_0xd187('0x63')][_0x25fc08]['field']+'\x20'+_0x1e8839['rules'][_0x25fc08][_0xd187('0x66')]+(_0x1ccb17(_0x1e8839[_0xd187('0x63')][_0x25fc08][_0xd187('0x66')])?'\x20'+_0x1e8839[_0xd187('0x63')][_0x25fc08][_0xd187('0x67')]:'');}return _0x2101a3+')';};var _0x475ea9={'where':{'id':_0xbc650f['id']}},_0x4dd0c7,_0x22900,_0x22424d,_0x5b7870,_0x3244dd;_0x475ea9=_[_0xd187('0x3c')]({},_0x475ea9,_0x2879ff);return db[_0xd187('0x2d')][_0xd187('0x4b')](_0x475ea9)['then'](function(_0x5be1c9){if(_0x5be1c9){_0x4dd0c7=_0x5be1c9;return _0x5be1c9[_0xd187('0x68')]();}return null;})[_0xd187('0x26')](function(_0x1cd0d2){if(_0x1cd0d2){if(!_0x1cd0d2['length']){throw new db[(_0xd187('0x69'))][(_0xd187('0x6a'))](_0xd187('0x6b'),0x193);}_0x22900=_0x1cd0d2;return db[_0xd187('0x86')]['findAll']({'raw':!![]});}return null;})[_0xd187('0x26')](function(_0x4efb9f){if(_0x4efb9f){_0x22424d=_['keyBy'](_0x4efb9f,'id');var _0x4a9310;var _0x54bf98=squel['select']();_0x54bf98['from'](_0x4dd0c7['table']);for(var _0x323311=0x0;_0x323311<_0x22900[_0xd187('0x64')];_0x323311+=0x1){_0x4a9310=_0x22900[_0x323311]['MetricId']?_0x22424d[_0x22900[_0x323311][_0xd187('0x70')]][_0xd187('0x71')]:_0x22900[_0x323311][_0xd187('0x76')];_0x4a9310=_0x22900[_0x323311][_0xd187('0x87')]?_[_0xd187('0x72')](_0x3d7e97[_0x22900[_0x323311]['function']],'%s',_0x4a9310):_0x4a9310;_0x4a9310=_0x22900[_0x323311][_0xd187('0x73')]?_['replace'](_0x520f86[_0x22900[_0x323311][_0xd187('0x73')]],'%s',_0x4a9310):_0x4a9310;if(_0x22900[_0x323311][_0xd187('0x74')]){_0x54bf98[_0xd187('0x65')](_0x4a9310);}_0x22900[_0x323311][_0xd187('0x75')]&&_0x54bf98[_0xd187('0x38')](_0x4a9310,_0x22900[_0x323311][_0xd187('0x75')]===_0xd187('0x88')?![]:!![]);_0x54bf98['field'](_0x4a9310,_0x22900[_0x323311][_0xd187('0x77')]||_0x4a9310);}if(_0x4dd0c7[_0xd187('0x78')]){_0x4dd0c7['joins']=JSON[_0xd187('0x79')](_0x4dd0c7[_0xd187('0x78')]);for(var _0x5df926=0x0;_0x5df926<_0x4dd0c7[_0xd187('0x78')][_0xd187('0x64')];_0x5df926+=0x1){if(_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x30')]&&_[_0xd187('0x5f')](_0xf31fac,_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x30')])&&_0x4dd0c7[_0xd187('0x78')][_0x5df926]['parentKey']&&_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x7c')]&&_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x7b')]){_0x54bf98[_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x30')]](_0x4dd0c7['joins'][_0x5df926]['foreignTable'],null,util[_0xd187('0x73')](_0xd187('0x89'),_0x4dd0c7['table'],_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x7a')],_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x7c')],_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x7b')]));}}}if(_0x4dd0c7['conditions']){_0x4dd0c7[_0xd187('0x7d')]=JSON[_0xd187('0x79')](_0x4dd0c7[_0xd187('0x7d')]);_0x54bf98[_0xd187('0x3b')](_0x395e45(_0x4dd0c7[_0xd187('0x7d')][_0xd187('0x65')]));}_0x3244dd=_0x54bf98[_0xd187('0x7e')]();_0x54bf98[_0xd187('0x1e')](_0x3d9b2f);_0x54bf98[_0xd187('0x21')](0x0);return;}})['then'](function(){if(_0x1da684[_0xd187('0x8a')]===_0xd187('0x8b')){return null;}var _0x25a053=_['merge'](_0x1da684,{'name':_0x1da684[_0xd187('0x8c')]||_0x1da684[_0xd187('0x2a')]||_0x4dd0c7[_0xd187('0x2a')],'basename':_0x1982cd,'savename':util[_0xd187('0x73')](_0xd187('0x8d'),_0x1da684[_0xd187('0x2a')]||_0x4dd0c7['name'],require(_0xd187('0x8e'))[_0xd187('0x8f')](0x4),_0x1da684[_0xd187('0x8a')]||'csv'),'reportId':_0x4dd0c7['id'],'reportType':_0xd187('0x90')});return db[_0xd187('0x91')][_0xd187('0x42')](_0x25a053,{'raw':!![]});})[_0xd187('0x26')](function(_0x12599e){if(_0x4dd0c7[_0xd187('0x6f')]==='cdr'){_0x3244dd[_0xd187('0x3b')](_0x4dd0c7[_0xd187('0x6f')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x1da684[_0xd187('0x92')],_0x1da684[_0xd187('0x93')]);}else{_0x3244dd['where'](_0x4dd0c7[_0xd187('0x6f')]+_0xd187('0x94'),_0x1da684['startDate'],_0x1da684[_0xd187('0x93')]);}if(_0x12599e){logger[_0xd187('0x95')]('Run\x20Query:',_0x3244dd[_0xd187('0x80')]());require('child_process')[_0xd187('0x96')](path[_0xd187('0x83')](__dirname,_0xd187('0x97'),_0x12599e[_0xd187('0x8a')]),[_0x12599e['id'],_0x3244dd[_0xd187('0x80')](),path['join'](__dirname,'../../files/reports',_0x12599e[_0xd187('0x98')]),_0x1982cd]);return _0x12599e;}else{var _0x2a2c7f=squel[_0xd187('0x99')]();_0x2a2c7f[_0xd187('0x6e')]('('+_0x3244dd[_0xd187('0x80')]()+')',_0xd187('0x9a'));_0x2a2c7f[_0xd187('0x76')]('COUNT(*)',_0xd187('0x20'));_0x3244dd[_0xd187('0x1e')](_0x1da684[_0xd187('0x1e')]||_0x3d9b2f);_0x3244dd[_0xd187('0x21')](_0x1da684[_0xd187('0x21')]||0x0);return dbH[_0xd187('0x81')]['query'](_0x2a2c7f[_0xd187('0x80')](),{'type':dbH[_0xd187('0x81')][_0xd187('0x9b')][_0xd187('0x82')]})[_0xd187('0x26')](function(_0x38a7cd){if(!_0x38a7cd[_0xd187('0x64')]){_0x5b7870=0x0;}else{_0x5b7870=_0x38a7cd[0x0][_0xd187('0x20')]||0x0;}return dbH['sequelize'][_0xd187('0x35')](_0x3244dd['toString'](),{'type':dbH[_0xd187('0x81')][_0xd187('0x9b')]['SELECT']});})[_0xd187('0x26')](function(_0x254e0a){return{'rows':_0x254e0a||[],'count':_0x5b7870};});}});}exports['run']=function(_0x1776c1,_0x497a94){return runReport(_0x1776c1[_0xd187('0x4c')],_0x1776c1['query'],_0x1776c1['options'])[_0xd187('0x26')](respondWithResult(_0x497a94,null))[_0xd187('0x40')](handleError(_0x497a94,null));};exports[_0xd187('0x9c')]=runReport;exports[_0xd187('0x35')]=function(_0x568f72,_0x357526){var _0x13ee40=0xa;var _0x20c269=[_0xd187('0x83'),_0xd187('0x4e'),_0xd187('0x4f'),_0xd187('0x50')];var _0x25ff89={'SUM':_0xd187('0x51'),'COUNT':_0xd187('0x52'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xd187('0x54'),'MIN':_0xd187('0x55'),'AVG':_0xd187('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xd187('0x59')};var _0x28798f={'SEC_TO_TIME':_0xd187('0x5a'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xd187('0x5d'),'UNIX_TIMESTAMP':_0xd187('0x5e')};var _0x56fcde=function(_0x37b1b0){return!_[_0xd187('0x5f')]([_0xd187('0x60'),_0xd187('0x61'),'IS\x20EMPTY',_0xd187('0x62')],_0x37b1b0);};var _0x428e6c=function(_0x4524c3){if(!_0x4524c3||!_0x4524c3[_0xd187('0x63')][_0xd187('0x64')]){return'';}for(var _0x3a2937='(',_0xf03f9a=0x0;_0xf03f9a<_0x4524c3['rules'][_0xd187('0x64')];_0xf03f9a+=0x1){_0xf03f9a>0x0&&(_0x3a2937+='\x20'+_0x4524c3['operator']+'\x20');_0x3a2937+=_0x4524c3[_0xd187('0x63')][_0xf03f9a]['group']?_0x428e6c(_0x4524c3[_0xd187('0x63')][_0xf03f9a]['group']):_0x4524c3[_0xd187('0x63')][_0xf03f9a][_0xd187('0x76')]+'\x20'+_0x4524c3[_0xd187('0x63')][_0xf03f9a]['condition']+(_0x56fcde(_0x4524c3[_0xd187('0x63')][_0xf03f9a][_0xd187('0x66')])?'\x20'+_0x4524c3[_0xd187('0x63')][_0xf03f9a][_0xd187('0x67')]:'');}return _0x3a2937+')';};var _0x37405d={'where':{'id':_0x568f72[_0xd187('0x4c')]['id']}},_0xe84f78,_0x12b4a4,_0x3d09a6,_0x5acea7,_0x2a756f;_0x37405d=_[_0xd187('0x3c')]({},_0x37405d,_0x568f72['options']);return db[_0xd187('0x2d')][_0xd187('0x4b')](_0x37405d)[_0xd187('0x26')](function(_0x110af6){if(_0x110af6){_0xe84f78=_0x110af6;return _0x110af6[_0xd187('0x68')]();}return null;})[_0xd187('0x26')](function(_0x2e4db4){if(_0x2e4db4){if(!_0x2e4db4[_0xd187('0x64')]){throw new db[(_0xd187('0x69'))][(_0xd187('0x6a'))](_0xd187('0x6b'),0x193);}_0x12b4a4=_0x2e4db4;return db['AnalyticMetric'][_0xd187('0x6c')]({'raw':!![]});}return null;})[_0xd187('0x26')](function(_0x50d5b8){if(_0x50d5b8){_0x3d09a6=_[_0xd187('0x6d')](_0x50d5b8,'id');var _0x48ef98;var _0x2008e9=squel['select']();_0x2008e9[_0xd187('0x6e')](_0xe84f78[_0xd187('0x6f')]);for(var _0x9b8840=0x0;_0x9b8840<_0x12b4a4[_0xd187('0x64')];_0x9b8840+=0x1){_0x48ef98=_0x12b4a4[_0x9b8840][_0xd187('0x70')]?_0x3d09a6[_0x12b4a4[_0x9b8840]['MetricId']][_0xd187('0x71')]:_0x12b4a4[_0x9b8840][_0xd187('0x76')];_0x48ef98=_0x12b4a4[_0x9b8840][_0xd187('0x87')]?_[_0xd187('0x72')](_0x25ff89[_0x12b4a4[_0x9b8840][_0xd187('0x87')]],'%s',_0x48ef98):_0x48ef98;_0x48ef98=_0x12b4a4[_0x9b8840]['format']?_[_0xd187('0x72')](_0x28798f[_0x12b4a4[_0x9b8840][_0xd187('0x73')]],'%s',_0x48ef98):_0x48ef98;if(_0x12b4a4[_0x9b8840][_0xd187('0x74')]){_0x2008e9['group'](_0x48ef98);}_0x12b4a4[_0x9b8840]['orderBy']&&_0x2008e9[_0xd187('0x38')](_0x48ef98,_0x12b4a4[_0x9b8840][_0xd187('0x75')]===_0xd187('0x88')?![]:!![]);_0x2008e9[_0xd187('0x76')](_0x48ef98,_0x12b4a4[_0x9b8840]['alias']||_0x48ef98);}if(_0xe84f78[_0xd187('0x78')]){_0xe84f78[_0xd187('0x78')]=JSON[_0xd187('0x79')](_0xe84f78[_0xd187('0x78')]);for(var _0x4bff96=0x0;_0x4bff96<_0xe84f78[_0xd187('0x78')]['length'];_0x4bff96+=0x1){if(_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x30')]&&_[_0xd187('0x5f')](_0x20c269,_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x30')])&&_0xe84f78['joins'][_0x4bff96][_0xd187('0x7a')]&&_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x7c')]&&_0xe84f78[_0xd187('0x78')][_0x4bff96]['foreignKey']){_0x2008e9[_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x30')]](_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x7c')],null,util[_0xd187('0x73')](_0xd187('0x89'),_0xe84f78[_0xd187('0x6f')],_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x7a')],_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x7c')],_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x7b')]));}}}if(_0xe84f78['conditions']){_0xe84f78[_0xd187('0x7d')]=JSON['parse'](_0xe84f78[_0xd187('0x7d')]);_0x2008e9['where'](_0x428e6c(_0xe84f78[_0xd187('0x7d')][_0xd187('0x65')]));}_0x2a756f=_0x2008e9[_0xd187('0x7e')]();_0x2008e9[_0xd187('0x1e')](_0x13ee40);_0x2008e9['offset'](0x0);logger['debug'](_0xd187('0x7f'),_0x2008e9[_0xd187('0x80')]());return dbH[_0xd187('0x81')][_0xd187('0x35')](_0x2008e9[_0xd187('0x80')](),{'type':dbH[_0xd187('0x81')]['QueryTypes']['SELECT']});}})[_0xd187('0x26')](function(){return{'sql':_0x2a756f[_0xd187('0x80')]()};})[_0xd187('0x26')](respondWithResult(_0x357526,null))['catch'](handleError(_0x357526,null));}; \ No newline at end of file +var _0xba34=['save','then','destroy','get','DefaultReports','UserProfileResource','error','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','show','params','find','create','body','user','role','UserProfileSection','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%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','Sequelize','ValidationErrorItem','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','SELECT','COUNT(%s)','AVG(%s)','IS\x20NOT\x20NULL','value','order','output','%s-%s.%s','randomstring','generate','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','startDate','info','Run\x20Query:','fork','countTable','QueryTypes','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','ROUND(%s)','Please\x20insert\x20at\x20least\x20one\x20field','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject'];(function(_0x14b9ab,_0x4b5bb2){var _0x6a7e2f=function(_0x1c2870){while(--_0x1c2870){_0x14b9ab['push'](_0x14b9ab['shift']());}};_0x6a7e2f(++_0x4b5bb2);}(_0xba34,0x119));var _0x4ba3=function(_0x464ef7,_0x531fda){_0x464ef7=_0x464ef7-0x0;var _0x2ec8fa=_0xba34[_0x464ef7];return _0x2ec8fa;};'use strict';var emlformat=require(_0x4ba3('0x0'));var rimraf=require(_0x4ba3('0x1'));var zipdir=require(_0x4ba3('0x2'));var jsonpatch=require(_0x4ba3('0x3'));var rp=require(_0x4ba3('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4ba3('0x5'));var path=require(_0x4ba3('0x6'));var sox=require(_0x4ba3('0x7'));var csv=require(_0x4ba3('0x8'));var ejs=require(_0x4ba3('0x9'));var fs=require('fs');var fs_extra=require(_0x4ba3('0xa'));var _=require(_0x4ba3('0xb'));var squel=require('squel');var crypto=require(_0x4ba3('0xc'));var jsforce=require(_0x4ba3('0xd'));var deskjs=require(_0x4ba3('0xe'));var toCsv=require(_0x4ba3('0x8'));var querystring=require(_0x4ba3('0xf'));var Papa=require(_0x4ba3('0x10'));var Redis=require(_0x4ba3('0x11'));var authService=require(_0x4ba3('0x12'));var qs=require(_0x4ba3('0x13'));var as=require(_0x4ba3('0x14'));var hardwareService=require(_0x4ba3('0x15'));var logger=require('../../config/logger')(_0x4ba3('0x16'));var utils=require(_0x4ba3('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x4ba3('0x18'));var db=require('../../mysqldb')['db'];var dbH=require(_0x4ba3('0x19'))['dbH'];function respondWithStatusCode(_0x256f02,_0x4419b4){_0x4419b4=_0x4419b4||0xcc;return function(_0x29e498){if(_0x29e498){return _0x256f02[_0x4ba3('0x1a')](_0x4419b4);}return _0x256f02[_0x4ba3('0x1b')](_0x4419b4)[_0x4ba3('0x1c')]();};}function respondWithResult(_0x3a74f7,_0x12ac90){_0x12ac90=_0x12ac90||0xc8;return function(_0x1dec48){if(_0x1dec48){return _0x3a74f7[_0x4ba3('0x1b')](_0x12ac90)[_0x4ba3('0x1d')](_0x1dec48);}};}function respondWithFilteredResult(_0x301359,_0x29a9d1){return function(_0x25f584){if(_0x25f584){var _0x40e75b=typeof _0x29a9d1[_0x4ba3('0x1e')]==='undefined'&&typeof _0x29a9d1[_0x4ba3('0x1f')]===_0x4ba3('0x20');var _0x5ff7ce=_0x25f584[_0x4ba3('0x21')];var _0x556290=_0x40e75b?0x0:_0x29a9d1[_0x4ba3('0x1e')];var _0xe4eff9=_0x40e75b?_0x25f584[_0x4ba3('0x21')]:_0x29a9d1[_0x4ba3('0x1e')]+_0x29a9d1[_0x4ba3('0x1f')];var _0x125944;if(_0xe4eff9>=_0x5ff7ce){_0xe4eff9=_0x5ff7ce;_0x125944=0xc8;}else{_0x125944=0xce;}_0x301359['status'](_0x125944);return _0x301359['set'](_0x4ba3('0x22'),_0x556290+'-'+_0xe4eff9+'/'+_0x5ff7ce)['json'](_0x25f584);}return null;};}function patchUpdates(_0x18dff5){return function(_0x163967){try{jsonpatch[_0x4ba3('0x23')](_0x163967,_0x18dff5,!![]);}catch(_0xbc7023){return BPromise[_0x4ba3('0x24')](_0xbc7023);}return _0x163967[_0x4ba3('0x25')]();};}function saveUpdates(_0x4a0823,_0x143c78){return function(_0x1f87e1){if(_0x1f87e1){return _0x1f87e1['update'](_0x4a0823)[_0x4ba3('0x26')](function(_0x4ffe39){return _0x4ffe39;});}return null;};}function removeEntity(_0x1ae4de,_0x18abb3){return function(_0x11a917){if(_0x11a917){return _0x11a917[_0x4ba3('0x27')]()[_0x4ba3('0x26')](function(){var _0xe29a49=_0x11a917[_0x4ba3('0x28')]({'plain':!![]});var _0xe1f7d2=_0x4ba3('0x29');return db[_0x4ba3('0x2a')]['destroy']({'where':{'type':_0xe1f7d2,'resourceId':_0xe29a49['id']}})[_0x4ba3('0x26')](function(){return _0x11a917;});})[_0x4ba3('0x26')](function(){_0x1ae4de[_0x4ba3('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x10537e,_0x1fe5e2){return function(_0x44d78c){if(!_0x44d78c){_0x10537e['sendStatus'](0x194);}return _0x44d78c;};}function handleError(_0x10cae6,_0x843276){_0x843276=_0x843276||0x1f4;return function(_0x34ecb4){logger[_0x4ba3('0x2b')](_0x34ecb4['stack']);if(_0x34ecb4['name']){delete _0x34ecb4[_0x4ba3('0x2c')];}_0x10cae6[_0x4ba3('0x1b')](_0x843276)[_0x4ba3('0x2d')](_0x34ecb4);};}exports[_0x4ba3('0x2e')]=function(_0x2cb5d5,_0x11f88f){var _0x48b3b7={},_0x27444b={},_0x28f36c={'count':0x0,'rows':[]};var _0x24d8fc=_[_0x4ba3('0x2f')](db[_0x4ba3('0x30')][_0x4ba3('0x31')],function(_0x457236){return{'name':_0x457236[_0x4ba3('0x32')],'type':_0x457236[_0x4ba3('0x33')][_0x4ba3('0x34')]};});_0x27444b['model']=_['map'](_0x24d8fc,'name');_0x27444b[_0x4ba3('0x35')]=_[_0x4ba3('0x36')](_0x2cb5d5[_0x4ba3('0x35')]);_0x27444b[_0x4ba3('0x37')]=_[_0x4ba3('0x38')](_0x27444b[_0x4ba3('0x39')],_0x27444b[_0x4ba3('0x35')]);_0x48b3b7[_0x4ba3('0x3a')]=_[_0x4ba3('0x38')](_0x27444b[_0x4ba3('0x39')],qs[_0x4ba3('0x3b')](_0x2cb5d5[_0x4ba3('0x35')]['fields']));_0x48b3b7[_0x4ba3('0x3a')]=_0x48b3b7[_0x4ba3('0x3a')][_0x4ba3('0x3c')]?_0x48b3b7['attributes']:_0x27444b[_0x4ba3('0x39')];if(!_0x2cb5d5['query'][_0x4ba3('0x3d')](_0x4ba3('0x3e'))){_0x48b3b7[_0x4ba3('0x1f')]=qs[_0x4ba3('0x1f')](_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x1f')]);_0x48b3b7['offset']=qs[_0x4ba3('0x1e')](_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x1e')]);}_0x48b3b7['order']=qs[_0x4ba3('0x3f')](_0x2cb5d5[_0x4ba3('0x35')]['sort']);_0x48b3b7[_0x4ba3('0x40')]=qs['filters'](_['pick'](_0x2cb5d5[_0x4ba3('0x35')],_0x27444b[_0x4ba3('0x37')]),_0x24d8fc);if(_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x41')]){_0x48b3b7[_0x4ba3('0x40')]=_['merge'](_0x48b3b7[_0x4ba3('0x40')],{'$or':_[_0x4ba3('0x2f')](_0x24d8fc,function(_0x46d2ca){if(_0x46d2ca[_0x4ba3('0x33')]!==_0x4ba3('0x42')){var _0x2acc92={};_0x2acc92[_0x46d2ca[_0x4ba3('0x2c')]]={'$like':'%'+_0x2cb5d5[_0x4ba3('0x35')]['filter']+'%'};return _0x2acc92;}})});}_0x48b3b7=_[_0x4ba3('0x43')]({},_0x48b3b7,_0x2cb5d5[_0x4ba3('0x44')]);var _0x3cb07f={'where':_0x48b3b7[_0x4ba3('0x40')]};return db[_0x4ba3('0x30')][_0x4ba3('0x21')](_0x3cb07f)[_0x4ba3('0x26')](function(_0xdcc2a2){_0x28f36c[_0x4ba3('0x21')]=_0xdcc2a2;if(_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x45')]){_0x48b3b7[_0x4ba3('0x46')]=[{'all':!![]}];}return db[_0x4ba3('0x30')][_0x4ba3('0x47')](_0x48b3b7);})['then'](function(_0x5af671){_0x28f36c['rows']=_0x5af671;return _0x28f36c;})['then'](respondWithFilteredResult(_0x11f88f,_0x48b3b7))['catch'](handleError(_0x11f88f,null));};exports[_0x4ba3('0x48')]=function(_0x5c4659,_0x29e74d){var _0x5567c7={'raw':!![],'where':{'id':_0x5c4659[_0x4ba3('0x49')]['id']}},_0x53d6eb={};_0x53d6eb[_0x4ba3('0x39')]=_[_0x4ba3('0x36')](db[_0x4ba3('0x30')]['rawAttributes']);_0x53d6eb[_0x4ba3('0x35')]=_['keys'](_0x5c4659[_0x4ba3('0x35')]);_0x53d6eb['filters']=_[_0x4ba3('0x38')](_0x53d6eb[_0x4ba3('0x39')],_0x53d6eb[_0x4ba3('0x35')]);_0x5567c7[_0x4ba3('0x3a')]=_[_0x4ba3('0x38')](_0x53d6eb[_0x4ba3('0x39')],qs[_0x4ba3('0x3b')](_0x5c4659['query'][_0x4ba3('0x3b')]));_0x5567c7[_0x4ba3('0x3a')]=_0x5567c7[_0x4ba3('0x3a')][_0x4ba3('0x3c')]?_0x5567c7[_0x4ba3('0x3a')]:_0x53d6eb['model'];if(_0x5c4659['query'][_0x4ba3('0x45')]){_0x5567c7[_0x4ba3('0x46')]=[{'all':!![]}];}_0x5567c7=_[_0x4ba3('0x43')]({},_0x5567c7,_0x5c4659['options']);return db[_0x4ba3('0x30')][_0x4ba3('0x4a')](_0x5567c7)[_0x4ba3('0x26')](handleEntityNotFound(_0x29e74d,null))['then'](respondWithResult(_0x29e74d,null))['catch'](handleError(_0x29e74d,null));};exports[_0x4ba3('0x4b')]=function(_0x482a83,_0x439acf){return db[_0x4ba3('0x30')][_0x4ba3('0x4b')](_0x482a83[_0x4ba3('0x4c')],{})[_0x4ba3('0x26')](function(_0x213eb0){var _0x590739=_0x482a83[_0x4ba3('0x4d')][_0x4ba3('0x28')]({'plain':!![]});if(!_0x590739)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x590739[_0x4ba3('0x4e')]===_0x4ba3('0x4d')){var _0x156c2d=_0x213eb0[_0x4ba3('0x28')]({'plain':!![]});var _0x360472='Reports';return db[_0x4ba3('0x4f')][_0x4ba3('0x4a')]({'where':{'name':_0x360472,'userProfileId':_0x590739['userProfileId']},'raw':!![]})[_0x4ba3('0x26')](function(_0x19d70f){if(_0x19d70f&&_0x19d70f[_0x4ba3('0x50')]===0x0){return db[_0x4ba3('0x2a')][_0x4ba3('0x4b')]({'name':_0x156c2d[_0x4ba3('0x2c')],'resourceId':_0x156c2d['id'],'type':_0x4ba3('0x29'),'sectionId':_0x19d70f['id']},{})[_0x4ba3('0x26')](function(){return _0x213eb0;});}else{return _0x213eb0;}})[_0x4ba3('0x51')](function(_0x428a27){logger[_0x4ba3('0x2b')](_0x4ba3('0x52'),_0x428a27);throw _0x428a27;});}return _0x213eb0;})[_0x4ba3('0x26')](respondWithResult(_0x439acf,0xc9))[_0x4ba3('0x51')](handleError(_0x439acf,null));};exports[_0x4ba3('0x53')]=function(_0x48a3d4,_0x5e7ed5){if(_0x48a3d4['body']['id']){delete _0x48a3d4[_0x4ba3('0x4c')]['id'];}return db[_0x4ba3('0x30')][_0x4ba3('0x4a')]({'where':{'id':_0x48a3d4[_0x4ba3('0x49')]['id']}})[_0x4ba3('0x26')](handleEntityNotFound(_0x5e7ed5,null))['then'](saveUpdates(_0x48a3d4[_0x4ba3('0x4c')],null))[_0x4ba3('0x26')](respondWithResult(_0x5e7ed5,null))[_0x4ba3('0x51')](handleError(_0x5e7ed5,null));};exports[_0x4ba3('0x27')]=function(_0x5359d1,_0x1e83fb){return db[_0x4ba3('0x30')][_0x4ba3('0x4a')]({'where':{'id':_0x5359d1[_0x4ba3('0x49')]['id']}})[_0x4ba3('0x26')](handleEntityNotFound(_0x1e83fb,null))[_0x4ba3('0x26')](removeEntity(_0x1e83fb,null))[_0x4ba3('0x51')](handleError(_0x1e83fb,null));};exports[_0x4ba3('0x54')]=function(_0x328314,_0x4fa64d){var _0x20c849=0xa;var _0x42bb4b=[_0x4ba3('0x55'),_0x4ba3('0x56'),_0x4ba3('0x57'),_0x4ba3('0x58')];var _0x40827a={'SUM':_0x4ba3('0x59'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4ba3('0x5a'),'MAX':_0x4ba3('0x5b'),'MIN':_0x4ba3('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x4ba3('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4ba3('0x5e')};var _0x4cc10a={'SEC_TO_TIME':_0x4ba3('0x5f'),'DATE':_0x4ba3('0x60'),'HOUR':_0x4ba3('0x61'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x4ba3('0x62')};var _0xaef1b=function(_0x2a48fe){return!_[_0x4ba3('0x63')]([_0x4ba3('0x64'),'IS\x20NOT\x20NULL',_0x4ba3('0x65'),_0x4ba3('0x66')],_0x2a48fe);};var _0x34cc21=function(_0x469ef0){if(!_0x469ef0||!_0x469ef0[_0x4ba3('0x67')][_0x4ba3('0x3c')]){return'';}for(var _0x3fdf7f='(',_0x38699e=0x0;_0x38699e<_0x469ef0[_0x4ba3('0x67')][_0x4ba3('0x3c')];_0x38699e+=0x1){_0x38699e>0x0&&(_0x3fdf7f+='\x20'+_0x469ef0[_0x4ba3('0x68')]+'\x20');_0x3fdf7f+=_0x469ef0['rules'][_0x38699e][_0x4ba3('0x69')]?_0x34cc21(_0x469ef0[_0x4ba3('0x67')][_0x38699e]['group']):_0x469ef0['rules'][_0x38699e][_0x4ba3('0x6a')]+'\x20'+_0x469ef0[_0x4ba3('0x67')][_0x38699e]['condition']+(_0xaef1b(_0x469ef0[_0x4ba3('0x67')][_0x38699e][_0x4ba3('0x6b')])?'\x20'+_0x469ef0[_0x4ba3('0x67')][_0x38699e]['value']:'');}return _0x3fdf7f+')';};var _0x1f5815={'where':{'id':_0x328314['params']['id']}},_0x46224,_0x1af489,_0x11209b,_0x24a75a,_0x3a4838;_0x1f5815=_[_0x4ba3('0x43')]({},_0x1f5815,_0x328314[_0x4ba3('0x44')]);return db[_0x4ba3('0x30')]['find'](_0x1f5815)[_0x4ba3('0x26')](function(_0x2f8bcc){if(_0x2f8bcc){_0x46224=_0x2f8bcc;return _0x2f8bcc[_0x4ba3('0x6c')]();}return null;})[_0x4ba3('0x26')](function(_0x21c8b1){if(_0x21c8b1){if(!_0x21c8b1[_0x4ba3('0x3c')]){throw new db[(_0x4ba3('0x6d'))][(_0x4ba3('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x1af489=_0x21c8b1;return db['AnalyticMetric'][_0x4ba3('0x47')]({'raw':!![]});}return null;})['then'](function(_0x13ee2c){if(_0x13ee2c){_0x11209b=_[_0x4ba3('0x6f')](_0x13ee2c,'id');var _0x442d66;var _0x5c7fc2=squel[_0x4ba3('0x70')]();_0x5c7fc2[_0x4ba3('0x71')](_0x46224[_0x4ba3('0x72')]);for(var _0x5baf26=0x0;_0x5baf26<_0x1af489[_0x4ba3('0x3c')];_0x5baf26+=0x1){_0x442d66=_0x1af489[_0x5baf26]['MetricId']?_0x11209b[_0x1af489[_0x5baf26][_0x4ba3('0x73')]][_0x4ba3('0x74')]:_0x1af489[_0x5baf26]['field'];_0x442d66=_0x1af489[_0x5baf26][_0x4ba3('0x75')]?_[_0x4ba3('0x76')](_0x40827a[_0x1af489[_0x5baf26][_0x4ba3('0x75')]],'%s',_0x442d66):_0x442d66;_0x442d66=_0x1af489[_0x5baf26][_0x4ba3('0x77')]?_[_0x4ba3('0x76')](_0x4cc10a[_0x1af489[_0x5baf26][_0x4ba3('0x77')]],'%s',_0x442d66):_0x442d66;if(_0x1af489[_0x5baf26][_0x4ba3('0x78')]){_0x5c7fc2[_0x4ba3('0x69')](_0x442d66);}_0x1af489[_0x5baf26][_0x4ba3('0x79')]&&_0x5c7fc2['order'](_0x442d66,_0x1af489[_0x5baf26][_0x4ba3('0x79')]===_0x4ba3('0x7a')?![]:!![]);_0x5c7fc2[_0x4ba3('0x6a')](_0x442d66,_0x1af489[_0x5baf26][_0x4ba3('0x7b')]||_0x442d66);}if(_0x46224[_0x4ba3('0x7c')]){_0x46224[_0x4ba3('0x7c')]=JSON[_0x4ba3('0x7d')](_0x46224[_0x4ba3('0x7c')]);for(var _0x365d94=0x0;_0x365d94<_0x46224[_0x4ba3('0x7c')][_0x4ba3('0x3c')];_0x365d94+=0x1){if(_0x46224[_0x4ba3('0x7c')][_0x365d94]['type']&&_[_0x4ba3('0x63')](_0x42bb4b,_0x46224[_0x4ba3('0x7c')][_0x365d94]['type'])&&_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x7e')]&&_0x46224['joins'][_0x365d94]['foreignTable']&&_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x7f')]){_0x5c7fc2[_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x33')]](_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x80')],null,util[_0x4ba3('0x77')](_0x4ba3('0x81'),_0x46224['table'],_0x46224[_0x4ba3('0x7c')][_0x365d94]['parentKey'],_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x80')],_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x7f')]));}}}if(_0x46224[_0x4ba3('0x82')]){_0x46224[_0x4ba3('0x82')]=JSON[_0x4ba3('0x7d')](_0x46224[_0x4ba3('0x82')]);_0x5c7fc2['where'](_0x34cc21(_0x46224[_0x4ba3('0x82')][_0x4ba3('0x69')]));}_0x3a4838=_0x5c7fc2[_0x4ba3('0x83')]();_0x5c7fc2['limit'](_0x20c849);_0x5c7fc2[_0x4ba3('0x1e')](0x0);logger[_0x4ba3('0x84')](_0x4ba3('0x85'),_0x5c7fc2[_0x4ba3('0x86')]());return dbH[_0x4ba3('0x87')][_0x4ba3('0x35')](_0x5c7fc2[_0x4ba3('0x86')](),{'type':dbH['sequelize']['QueryTypes'][_0x4ba3('0x88')]});}})['then'](respondWithResult(_0x4fa64d,null))[_0x4ba3('0x51')](handleError(_0x4fa64d,null));};function runReport(_0x15508f,_0x108679,_0x20f7db){var _0x5a3c63=_0x108679['name'];var _0x2d16e5=0xa;var _0x2b2132=['join',_0x4ba3('0x56'),_0x4ba3('0x57'),_0x4ba3('0x58')];var _0x1e8232={'SUM':_0x4ba3('0x59'),'COUNT':_0x4ba3('0x89'),'COUNT DISTINCT':_0x4ba3('0x5a'),'MAX':'MAX(%s)','MIN':_0x4ba3('0x5c'),'AVG':_0x4ba3('0x8a'),'GROUP_CONCAT':_0x4ba3('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4ba3('0x5e')};var _0x13dbc4={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x4ba3('0x60'),'HOUR':_0x4ba3('0x61'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5aa412=function(_0x4ec70e){return!_[_0x4ba3('0x63')]([_0x4ba3('0x64'),_0x4ba3('0x8b'),_0x4ba3('0x65'),_0x4ba3('0x66')],_0x4ec70e);};var _0x333a97=function(_0x30d7a9){if(!_0x30d7a9||!_0x30d7a9['rules'][_0x4ba3('0x3c')]){return'';}for(var _0x4cd4a2='(',_0x31a725=0x0;_0x31a725<_0x30d7a9['rules'][_0x4ba3('0x3c')];_0x31a725+=0x1){_0x31a725>0x0&&(_0x4cd4a2+='\x20'+_0x30d7a9[_0x4ba3('0x68')]+'\x20');_0x4cd4a2+=_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x69')]?_0x333a97(_0x30d7a9[_0x4ba3('0x67')][_0x31a725]['group']):_0x30d7a9['rules'][_0x31a725][_0x4ba3('0x6a')]+'\x20'+_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x6b')]+(_0x5aa412(_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x6b')])?'\x20'+_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x8c')]:'');}return _0x4cd4a2+')';};var _0x3d8606={'where':{'id':_0x15508f['id']}},_0x2d00e3,_0x35441e,_0x217ea4,_0x40dcee,_0x5ea9d0;_0x3d8606=_[_0x4ba3('0x43')]({},_0x3d8606,_0x20f7db);return db['AnalyticDefaultReport'][_0x4ba3('0x4a')](_0x3d8606)[_0x4ba3('0x26')](function(_0x17b970){if(_0x17b970){_0x2d00e3=_0x17b970;return _0x17b970[_0x4ba3('0x6c')]();}return null;})['then'](function(_0x2a2dc2){if(_0x2a2dc2){if(!_0x2a2dc2[_0x4ba3('0x3c')]){throw new db[(_0x4ba3('0x6d'))][(_0x4ba3('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x35441e=_0x2a2dc2;return db['AnalyticMetric'][_0x4ba3('0x47')]({'raw':!![]});}return null;})[_0x4ba3('0x26')](function(_0x3188c8){if(_0x3188c8){_0x217ea4=_['keyBy'](_0x3188c8,'id');var _0x2f793a;var _0x1194a5=squel[_0x4ba3('0x70')]();_0x1194a5[_0x4ba3('0x71')](_0x2d00e3[_0x4ba3('0x72')]);for(var _0x1e2134=0x0;_0x1e2134<_0x35441e['length'];_0x1e2134+=0x1){_0x2f793a=_0x35441e[_0x1e2134][_0x4ba3('0x73')]?_0x217ea4[_0x35441e[_0x1e2134]['MetricId']][_0x4ba3('0x74')]:_0x35441e[_0x1e2134][_0x4ba3('0x6a')];_0x2f793a=_0x35441e[_0x1e2134][_0x4ba3('0x75')]?_[_0x4ba3('0x76')](_0x1e8232[_0x35441e[_0x1e2134]['function']],'%s',_0x2f793a):_0x2f793a;_0x2f793a=_0x35441e[_0x1e2134][_0x4ba3('0x77')]?_[_0x4ba3('0x76')](_0x13dbc4[_0x35441e[_0x1e2134]['format']],'%s',_0x2f793a):_0x2f793a;if(_0x35441e[_0x1e2134][_0x4ba3('0x78')]){_0x1194a5['group'](_0x2f793a);}_0x35441e[_0x1e2134][_0x4ba3('0x79')]&&_0x1194a5[_0x4ba3('0x8d')](_0x2f793a,_0x35441e[_0x1e2134][_0x4ba3('0x79')]===_0x4ba3('0x7a')?![]:!![]);_0x1194a5[_0x4ba3('0x6a')](_0x2f793a,_0x35441e[_0x1e2134]['alias']||_0x2f793a);}if(_0x2d00e3['joins']){_0x2d00e3[_0x4ba3('0x7c')]=JSON[_0x4ba3('0x7d')](_0x2d00e3[_0x4ba3('0x7c')]);for(var _0x56244e=0x0;_0x56244e<_0x2d00e3[_0x4ba3('0x7c')][_0x4ba3('0x3c')];_0x56244e+=0x1){if(_0x2d00e3['joins'][_0x56244e][_0x4ba3('0x33')]&&_[_0x4ba3('0x63')](_0x2b2132,_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x33')])&&_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x7e')]&&_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x80')]&&_0x2d00e3['joins'][_0x56244e][_0x4ba3('0x7f')]){_0x1194a5[_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x33')]](_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x80')],null,util[_0x4ba3('0x77')](_0x4ba3('0x81'),_0x2d00e3[_0x4ba3('0x72')],_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x7e')],_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x80')],_0x2d00e3[_0x4ba3('0x7c')][_0x56244e]['foreignKey']));}}}if(_0x2d00e3['conditions']){_0x2d00e3[_0x4ba3('0x82')]=JSON[_0x4ba3('0x7d')](_0x2d00e3[_0x4ba3('0x82')]);_0x1194a5[_0x4ba3('0x40')](_0x333a97(_0x2d00e3[_0x4ba3('0x82')][_0x4ba3('0x69')]));}_0x5ea9d0=_0x1194a5[_0x4ba3('0x83')]();_0x1194a5['limit'](_0x2d16e5);_0x1194a5['offset'](0x0);return;}})[_0x4ba3('0x26')](function(){if(_0x108679[_0x4ba3('0x8e')]==='web'){return null;}var _0x4fb6b5=_['merge'](_0x108679,{'name':_0x108679['fullPath']||_0x108679[_0x4ba3('0x2c')]||_0x2d00e3[_0x4ba3('0x2c')],'basename':_0x5a3c63,'savename':util[_0x4ba3('0x77')](_0x4ba3('0x8f'),_0x108679[_0x4ba3('0x2c')]||_0x2d00e3['name'],require(_0x4ba3('0x90'))[_0x4ba3('0x91')](0x4),_0x108679[_0x4ba3('0x8e')]||'csv'),'reportId':_0x2d00e3['id'],'reportType':'default'});return db['AnalyticExtractedReport']['create'](_0x4fb6b5,{'raw':!![]});})[_0x4ba3('0x26')](function(_0x17d501){if(_0x2d00e3[_0x4ba3('0x72')]===_0x4ba3('0x92')){_0x5ea9d0[_0x4ba3('0x40')](_0x2d00e3['table']+_0x4ba3('0x93'),_0x108679['startDate'],_0x108679[_0x4ba3('0x94')]);}else{_0x5ea9d0[_0x4ba3('0x40')](_0x2d00e3[_0x4ba3('0x72')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x108679[_0x4ba3('0x95')],_0x108679[_0x4ba3('0x94')]);}if(_0x17d501){logger[_0x4ba3('0x96')](_0x4ba3('0x97'),_0x5ea9d0['toString']());require('child_process')[_0x4ba3('0x98')](path[_0x4ba3('0x55')](__dirname,'../../components/export/',_0x17d501[_0x4ba3('0x8e')]),[_0x17d501['id'],_0x5ea9d0['toString'](),path['join'](__dirname,'../../files/reports',_0x17d501['savename']),_0x5a3c63]);return _0x17d501;}else{var _0x2d2ca3=squel[_0x4ba3('0x70')]();_0x2d2ca3[_0x4ba3('0x71')]('('+_0x5ea9d0[_0x4ba3('0x86')]()+')',_0x4ba3('0x99'));_0x2d2ca3['field']('COUNT(*)',_0x4ba3('0x21'));_0x5ea9d0['limit'](_0x108679[_0x4ba3('0x1f')]||_0x2d16e5);_0x5ea9d0[_0x4ba3('0x1e')](_0x108679[_0x4ba3('0x1e')]||0x0);return dbH['sequelize'][_0x4ba3('0x35')](_0x2d2ca3[_0x4ba3('0x86')](),{'type':dbH[_0x4ba3('0x87')][_0x4ba3('0x9a')][_0x4ba3('0x88')]})[_0x4ba3('0x26')](function(_0xc938c){if(!_0xc938c[_0x4ba3('0x3c')]){_0x40dcee=0x0;}else{_0x40dcee=_0xc938c[0x0][_0x4ba3('0x21')]||0x0;}return dbH['sequelize']['query'](_0x5ea9d0[_0x4ba3('0x86')](),{'type':dbH[_0x4ba3('0x87')][_0x4ba3('0x9a')][_0x4ba3('0x88')]});})[_0x4ba3('0x26')](function(_0xd97c26){return{'rows':_0xd97c26||[],'count':_0x40dcee};});}});}exports['run']=function(_0x1fbdc7,_0x9e45ec){return runReport(_0x1fbdc7['params'],_0x1fbdc7[_0x4ba3('0x35')],_0x1fbdc7[_0x4ba3('0x44')])[_0x4ba3('0x26')](respondWithResult(_0x9e45ec,null))[_0x4ba3('0x51')](handleError(_0x9e45ec,null));};exports[_0x4ba3('0x9b')]=runReport;exports[_0x4ba3('0x35')]=function(_0xddfb0c,_0x41c531){var _0x25bf75=0xa;var _0x18bd77=[_0x4ba3('0x55'),_0x4ba3('0x56'),_0x4ba3('0x57'),_0x4ba3('0x58')];var _0x2e812b={'SUM':'SUM(%s)','COUNT':_0x4ba3('0x89'),'COUNT DISTINCT':_0x4ba3('0x5a'),'MAX':'MAX(%s)','MIN':_0x4ba3('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x4ba3('0x5d'),'GROUP_CONCAT ASC':_0x4ba3('0x9c'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5dc74f={'SEC_TO_TIME':_0x4ba3('0x5f'),'DATE':'DATE(%s)','HOUR':_0x4ba3('0x61'),'ROUND':_0x4ba3('0x9d'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1590f0=function(_0x5efab9){return!_[_0x4ba3('0x63')]([_0x4ba3('0x64'),_0x4ba3('0x8b'),'IS\x20EMPTY',_0x4ba3('0x66')],_0x5efab9);};var _0x4d3262=function(_0x4ad4d3){if(!_0x4ad4d3||!_0x4ad4d3[_0x4ba3('0x67')]['length']){return'';}for(var _0x4529a3='(',_0x9b9c64=0x0;_0x9b9c64<_0x4ad4d3[_0x4ba3('0x67')]['length'];_0x9b9c64+=0x1){_0x9b9c64>0x0&&(_0x4529a3+='\x20'+_0x4ad4d3['operator']+'\x20');_0x4529a3+=_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x69')]?_0x4d3262(_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x69')]):_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64]['field']+'\x20'+_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x6b')]+(_0x1590f0(_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x6b')])?'\x20'+_0x4ad4d3['rules'][_0x9b9c64][_0x4ba3('0x8c')]:'');}return _0x4529a3+')';};var _0x3073c5={'where':{'id':_0xddfb0c[_0x4ba3('0x49')]['id']}},_0x3d1c11,_0xa41747,_0x25c92c,_0x422a8d,_0x225746;_0x3073c5=_[_0x4ba3('0x43')]({},_0x3073c5,_0xddfb0c[_0x4ba3('0x44')]);return db[_0x4ba3('0x30')]['find'](_0x3073c5)[_0x4ba3('0x26')](function(_0x3db4c2){if(_0x3db4c2){_0x3d1c11=_0x3db4c2;return _0x3db4c2['getFields']();}return null;})[_0x4ba3('0x26')](function(_0x4a8449){if(_0x4a8449){if(!_0x4a8449[_0x4ba3('0x3c')]){throw new db[(_0x4ba3('0x6d'))][(_0x4ba3('0x6e'))](_0x4ba3('0x9e'),0x193);}_0xa41747=_0x4a8449;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x4ba3('0x26')](function(_0xfaf98a){if(_0xfaf98a){_0x25c92c=_['keyBy'](_0xfaf98a,'id');var _0x30c904;var _0x267801=squel[_0x4ba3('0x70')]();_0x267801[_0x4ba3('0x71')](_0x3d1c11['table']);for(var _0x1bae1b=0x0;_0x1bae1b<_0xa41747[_0x4ba3('0x3c')];_0x1bae1b+=0x1){_0x30c904=_0xa41747[_0x1bae1b][_0x4ba3('0x73')]?_0x25c92c[_0xa41747[_0x1bae1b][_0x4ba3('0x73')]]['metric']:_0xa41747[_0x1bae1b][_0x4ba3('0x6a')];_0x30c904=_0xa41747[_0x1bae1b]['function']?_[_0x4ba3('0x76')](_0x2e812b[_0xa41747[_0x1bae1b][_0x4ba3('0x75')]],'%s',_0x30c904):_0x30c904;_0x30c904=_0xa41747[_0x1bae1b][_0x4ba3('0x77')]?_[_0x4ba3('0x76')](_0x5dc74f[_0xa41747[_0x1bae1b]['format']],'%s',_0x30c904):_0x30c904;if(_0xa41747[_0x1bae1b]['groupBy']){_0x267801[_0x4ba3('0x69')](_0x30c904);}_0xa41747[_0x1bae1b][_0x4ba3('0x79')]&&_0x267801[_0x4ba3('0x8d')](_0x30c904,_0xa41747[_0x1bae1b]['orderBy']==='DESC'?![]:!![]);_0x267801[_0x4ba3('0x6a')](_0x30c904,_0xa41747[_0x1bae1b][_0x4ba3('0x7b')]||_0x30c904);}if(_0x3d1c11[_0x4ba3('0x7c')]){_0x3d1c11[_0x4ba3('0x7c')]=JSON['parse'](_0x3d1c11[_0x4ba3('0x7c')]);for(var _0x2f4966=0x0;_0x2f4966<_0x3d1c11[_0x4ba3('0x7c')][_0x4ba3('0x3c')];_0x2f4966+=0x1){if(_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x33')]&&_[_0x4ba3('0x63')](_0x18bd77,_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x33')])&&_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x7e')]&&_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x80')]&&_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x7f')]){_0x267801[_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x33')]](_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966]['foreignTable'],null,util[_0x4ba3('0x77')](_0x4ba3('0x81'),_0x3d1c11[_0x4ba3('0x72')],_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x7e')],_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966]['foreignTable'],_0x3d1c11['joins'][_0x2f4966][_0x4ba3('0x7f')]));}}}if(_0x3d1c11[_0x4ba3('0x82')]){_0x3d1c11[_0x4ba3('0x82')]=JSON['parse'](_0x3d1c11[_0x4ba3('0x82')]);_0x267801[_0x4ba3('0x40')](_0x4d3262(_0x3d1c11[_0x4ba3('0x82')][_0x4ba3('0x69')]));}_0x225746=_0x267801[_0x4ba3('0x83')]();_0x267801[_0x4ba3('0x1f')](_0x25bf75);_0x267801[_0x4ba3('0x1e')](0x0);logger[_0x4ba3('0x84')](_0x4ba3('0x85'),_0x267801['toString']());return dbH[_0x4ba3('0x87')]['query'](_0x267801['toString'](),{'type':dbH[_0x4ba3('0x87')][_0x4ba3('0x9a')]['SELECT']});}})[_0x4ba3('0x26')](function(){return{'sql':_0x225746[_0x4ba3('0x86')]()};})[_0x4ba3('0x26')](respondWithResult(_0x41c531,null))[_0x4ba3('0x51')](handleError(_0x41c531,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 552bfb1..bbc1773 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 _0xc327=['./analyticDefaultReport.attributes','exports','define','analytics_default_reports','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x324eb1,_0x5c4bb3){var _0x51fc21=function(_0x438ca4){while(--_0x438ca4){_0x324eb1['push'](_0x324eb1['shift']());}};_0x51fc21(++_0x5c4bb3);}(_0xc327,0x88));var _0x7c32=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xc327[_0x110c3d];return _0x226d67;};'use strict';var _=require('lodash');var util=require(_0x7c32('0x0'));var logger=require(_0x7c32('0x1'))('api');var moment=require(_0x7c32('0x2'));var BPromise=require(_0x7c32('0x3'));var rp=require(_0x7c32('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7c32('0x5'));var config=require(_0x7c32('0x6'));var attributes=require(_0x7c32('0x7'));module[_0x7c32('0x8')]=function(_0xd391f5,_0xeb3fdd){return _0xd391f5[_0x7c32('0x9')]('AnalyticDefaultReport',attributes,{'tableName':_0x7c32('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8f3e=['bluebird','request-promise','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','analytics_default_reports','lodash','util','../../config/logger','moment'];(function(_0x3457b4,_0x4cd8f9){var _0xaa8fa9=function(_0x51897a){while(--_0x51897a){_0x3457b4['push'](_0x3457b4['shift']());}};_0xaa8fa9(++_0x4cd8f9);}(_0x8f3e,0x151));var _0xe8f3=function(_0x5a1f08,_0x562f85){_0x5a1f08=_0x5a1f08-0x0;var _0xdc0e08=_0x8f3e[_0x5a1f08];return _0xdc0e08;};'use strict';var _=require(_0xe8f3('0x0'));var util=require(_0xe8f3('0x1'));var logger=require(_0xe8f3('0x2'))('api');var moment=require(_0xe8f3('0x3'));var BPromise=require(_0xe8f3('0x4'));var rp=require(_0xe8f3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe8f3('0x6'));var config=require(_0xe8f3('0x7'));var attributes=require(_0xe8f3('0x8'));module[_0xe8f3('0x9')]=function(_0x1a0515,_0xf89ce){return _0x1a0515['define']('AnalyticDefaultReport',attributes,{'tableName':_0xe8f3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js index 84999a8..43d3fa7 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 _0x7c6a=['../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x3ed25d,_0x6c37b2){var _0x5e0998=function(_0x3e53a4){while(--_0x3e53a4){_0x3ed25d['push'](_0x3ed25d['shift']());}};_0x5e0998(++_0x6c37b2);}(_0x7c6a,0x1c7));var _0xa7c6=function(_0x55987d,_0x49120d){_0x55987d=_0x55987d-0x0;var _0x238807=_0x7c6a[_0x55987d];return _0x238807;};'use strict';var _=require('lodash');var util=require(_0xa7c6('0x0'));var moment=require(_0xa7c6('0x1'));var BPromise=require(_0xa7c6('0x2'));var rs=require(_0xa7c6('0x3'));var fs=require('fs');var Redis=require(_0xa7c6('0x4'));var db=require(_0xa7c6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa7c6('0x6'))(_0xa7c6('0x7'));var config=require('../../config/environment');var jayson=require(_0xa7c6('0x8'));var client=jayson[_0xa7c6('0x9')][_0xa7c6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x54620d,_0x24b7c7,_0x2aa958){return new BPromise(function(_0x332b38,_0x1b246e){return client[_0xa7c6('0xb')](_0x54620d,_0x2aa958)[_0xa7c6('0xc')](function(_0x37eb7f){logger[_0xa7c6('0xd')](_0xa7c6('0xe'),_0x24b7c7,_0xa7c6('0xf'));logger[_0xa7c6('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x24b7c7,'request\x20sent',JSON[_0xa7c6('0x11')](_0x37eb7f));if(_0x37eb7f[_0xa7c6('0x12')]){if(_0x37eb7f[_0xa7c6('0x12')][_0xa7c6('0x13')]===0x1f4){logger[_0xa7c6('0x12')](_0xa7c6('0xe'),_0x24b7c7,_0x37eb7f['error'][_0xa7c6('0x14')]);return _0x1b246e(_0x37eb7f['error'][_0xa7c6('0x14')]);}logger[_0xa7c6('0x12')](_0xa7c6('0xe'),_0x24b7c7,_0x37eb7f[_0xa7c6('0x12')][_0xa7c6('0x14')]);return _0x332b38(_0x37eb7f[_0xa7c6('0x12')][_0xa7c6('0x14')]);}else{logger[_0xa7c6('0xd')](_0xa7c6('0xe'),_0x24b7c7,'request\x20sent');_0x332b38(_0x37eb7f[_0xa7c6('0x15')]['message']);}})[_0xa7c6('0x16')](function(_0x271500){logger[_0xa7c6('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x24b7c7,_0x271500);_0x1b246e(_0x271500);});});} \ No newline at end of file +var _0xe82b=['code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x4a27b5,_0x4fb040){var _0x533b98=function(_0x444f4e){while(--_0x444f4e){_0x4a27b5['push'](_0x4a27b5['shift']());}};_0x533b98(++_0x4fb040);}(_0xe82b,0x9e));var _0xbe82=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xe82b[_0x484e36];return _0xafc85d;};'use strict';var _=require(_0xbe82('0x0'));var util=require(_0xbe82('0x1'));var moment=require(_0xbe82('0x2'));var BPromise=require(_0xbe82('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbe82('0x4'));var db=require(_0xbe82('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xbe82('0x6'))(_0xbe82('0x7'));var config=require('../../config/environment');var jayson=require(_0xbe82('0x8'));var client=jayson[_0xbe82('0x9')][_0xbe82('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2b67b8,_0x15dc72,_0x4cb776){return new BPromise(function(_0x512ebc,_0x3dcdbc){return client[_0xbe82('0xb')](_0x2b67b8,_0x4cb776)[_0xbe82('0xc')](function(_0xec04f3){logger[_0xbe82('0xd')](_0xbe82('0xe'),_0x15dc72,_0xbe82('0xf'));logger['debug']('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x15dc72,_0xbe82('0xf'),JSON[_0xbe82('0x10')](_0xec04f3));if(_0xec04f3[_0xbe82('0x11')]){if(_0xec04f3[_0xbe82('0x11')][_0xbe82('0x12')]===0x1f4){logger[_0xbe82('0x11')](_0xbe82('0xe'),_0x15dc72,_0xec04f3['error']['message']);return _0x3dcdbc(_0xec04f3['error'][_0xbe82('0x13')]);}logger[_0xbe82('0x11')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x15dc72,_0xec04f3[_0xbe82('0x11')][_0xbe82('0x13')]);return _0x512ebc(_0xec04f3['error'][_0xbe82('0x13')]);}else{logger[_0xbe82('0xd')](_0xbe82('0xe'),_0x15dc72,'request\x20sent');_0x512ebc(_0xec04f3[_0xbe82('0x14')]['message']);}})[_0xbe82('0x15')](function(_0x59a14b){logger[_0xbe82('0x11')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x15dc72,_0x59a14b);_0x3dcdbc(_0x59a14b);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 0bde5d1..617a580 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 _0xef78=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','/:id/preview','preview','/:id/run','/:id/query','query','post','create','put','delete','destroy','multer'];(function(_0x345c86,_0x2b12e0){var _0x41e895=function(_0x2af8c3){while(--_0x2af8c3){_0x345c86['push'](_0x345c86['shift']());}};_0x41e895(++_0x2b12e0);}(_0xef78,0x18b));var _0x8ef7=function(_0x167945,_0x32eb98){_0x167945=_0x167945-0x0;var _0x2ece10=_0xef78[_0x167945];return _0x2ece10;};'use strict';var multer=require(_0x8ef7('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x8ef7('0x1'));var express=require(_0x8ef7('0x2'));var router=express[_0x8ef7('0x3')]();var fs_extra=require(_0x8ef7('0x4'));var auth=require(_0x8ef7('0x5'));var interaction=require(_0x8ef7('0x6'));var config=require(_0x8ef7('0x7'));var controller=require('./analyticDefaultReport.controller');router[_0x8ef7('0x8')]('/',auth['isAuthenticated'](),controller[_0x8ef7('0x9')]);router['get'](_0x8ef7('0xa'),auth[_0x8ef7('0xb')](),controller['show']);router[_0x8ef7('0x8')](_0x8ef7('0xc'),auth[_0x8ef7('0xb')](),controller[_0x8ef7('0xd')]);router[_0x8ef7('0x8')](_0x8ef7('0xe'),auth[_0x8ef7('0xb')](),controller['run']);router[_0x8ef7('0x8')](_0x8ef7('0xf'),auth['isAuthenticated'](),controller[_0x8ef7('0x10')]);router[_0x8ef7('0x11')]('/',auth['isAuthenticated'](),controller[_0x8ef7('0x12')]);router[_0x8ef7('0x13')](_0x8ef7('0xa'),auth[_0x8ef7('0xb')](),controller['update']);router[_0x8ef7('0x14')](_0x8ef7('0xa'),auth[_0x8ef7('0xb')](),controller[_0x8ef7('0x15')]);module['exports']=router; \ No newline at end of file +var _0xfbdf=['get','/:id','show','/:id/preview','preview','run','/:id/query','query','post','create','put','update','exports','multer','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','isAuthenticated','index'];(function(_0x1b3a09,_0x20c774){var _0x357bb8=function(_0xd7c6d2){while(--_0xd7c6d2){_0x1b3a09['push'](_0x1b3a09['shift']());}};_0x357bb8(++_0x20c774);}(_0xfbdf,0xd3));var _0xffbd=function(_0x3d784f,_0x100ef1){_0x3d784f=_0x3d784f-0x0;var _0x32340e=_0xfbdf[_0x3d784f];return _0x32340e;};'use strict';var multer=require(_0xffbd('0x0'));var util=require('util');var path=require(_0xffbd('0x1'));var timeout=require(_0xffbd('0x2'));var express=require('express');var router=express[_0xffbd('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xffbd('0x4'));var config=require(_0xffbd('0x5'));var controller=require(_0xffbd('0x6'));router['get']('/',auth[_0xffbd('0x7')](),controller[_0xffbd('0x8')]);router[_0xffbd('0x9')](_0xffbd('0xa'),auth[_0xffbd('0x7')](),controller[_0xffbd('0xb')]);router['get'](_0xffbd('0xc'),auth[_0xffbd('0x7')](),controller[_0xffbd('0xd')]);router['get']('/:id/run',auth[_0xffbd('0x7')](),controller[_0xffbd('0xe')]);router[_0xffbd('0x9')](_0xffbd('0xf'),auth[_0xffbd('0x7')](),controller[_0xffbd('0x10')]);router[_0xffbd('0x11')]('/',auth[_0xffbd('0x7')](),controller[_0xffbd('0x12')]);router[_0xffbd('0x13')](_0xffbd('0xa'),auth[_0xffbd('0x7')](),controller[_0xffbd('0x14')]);router['delete'](_0xffbd('0xa'),auth[_0xffbd('0x7')](),controller['destroy']);module[_0xffbd('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index ecfe146..732aed6 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 _0x366c=['scheduled','INTEGER','UNSIGNED','sequelize','moment','STRING','ENUM','csv','pdf','xlsx','DATE','Loading','manual'];(function(_0x3902c1,_0x1c9eb2){var _0x1266cc=function(_0x50c2c5){while(--_0x50c2c5){_0x3902c1['push'](_0x3902c1['shift']());}};_0x1266cc(++_0x1c9eb2);}(_0x366c,0x189));var _0xc366=function(_0x23cbed,_0x3f2205){_0x23cbed=_0x23cbed-0x0;var _0xfd017=_0x366c[_0x23cbed];return _0xfd017;};'use strict';var Sequelize=require(_0xc366('0x0'));var moment=require(_0xc366('0x1'));module['exports']={'name':{'type':Sequelize[_0xc366('0x2')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0xc366('0x3')](_0xc366('0x4'),_0xc366('0x5'),_0xc366('0x6')),'allowNull':![],'defaultValue':_0xc366('0x4')},'savename':{'type':Sequelize[_0xc366('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0xc366('0x7')]},'endDate':{'type':Sequelize[_0xc366('0x7')]},'status':{'type':Sequelize[_0xc366('0x2')],'defaultValue':_0xc366('0x8')},'type':{'type':Sequelize[_0xc366('0x3')](_0xc366('0x9'),_0xc366('0xa')),'allowNull':![],'defaultValue':_0xc366('0x9')},'reportId':{'type':Sequelize[_0xc366('0xb')](0xb)[_0xc366('0xc')]},'reportType':{'type':Sequelize[_0xc366('0x2')]}}; \ No newline at end of file +var _0x3843=['moment','exports','STRING','ENUM','csv','pdf','DATE','Loading','scheduled','INTEGER','UNSIGNED','sequelize'];(function(_0x3c9864,_0x488a3c){var _0x416dcd=function(_0x3f03d6){while(--_0x3f03d6){_0x3c9864['push'](_0x3c9864['shift']());}};_0x416dcd(++_0x488a3c);}(_0x3843,0x17f));var _0x3384=function(_0x19da64,_0x1077d){_0x19da64=_0x19da64-0x0;var _0x4fb532=_0x3843[_0x19da64];return _0x4fb532;};'use strict';var Sequelize=require(_0x3384('0x0'));var moment=require(_0x3384('0x1'));module[_0x3384('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x3384('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x3384('0x4')](_0x3384('0x5'),_0x3384('0x6'),'xlsx'),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x3384('0x7')]},'endDate':{'type':Sequelize[_0x3384('0x7')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0x3384('0x8')},'type':{'type':Sequelize[_0x3384('0x4')]('manual',_0x3384('0x9')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0x3384('0xa')](0xb)[_0x3384('0xb')]},'reportType':{'type':Sequelize[_0x3384('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 29a947a..dbe5759 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 _0xc052=['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/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','get','UserProfileResource','destroy','error','stack','index','map','rawAttributes','fieldName','type','key','model','name','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','AnalyticExtractedReport','includeAll','include','findAll','params','length','find','catch','create','body','user','role','ExtractedReports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','output','root','server/files/reports','savename','ValidationError','exists','join','format','basename','toLowerCase','eml-format','rimraf','zip-dir'];(function(_0x48ecd2,_0x481ad3){var _0x5a4457=function(_0xdd9abd){while(--_0xdd9abd){_0x48ecd2['push'](_0x48ecd2['shift']());}};_0x5a4457(++_0x481ad3);}(_0xc052,0xc5));var _0x2c05=function(_0x11f0ef,_0x4ea920){_0x11f0ef=_0x11f0ef-0x0;var _0x166391=_0xc052[_0x11f0ef];return _0x166391;};'use strict';var emlformat=require(_0x2c05('0x0'));var rimraf=require(_0x2c05('0x1'));var zipdir=require(_0x2c05('0x2'));var jsonpatch=require(_0x2c05('0x3'));var rp=require(_0x2c05('0x4'));var moment=require(_0x2c05('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2c05('0x6'));var util=require(_0x2c05('0x7'));var path=require(_0x2c05('0x8'));var sox=require(_0x2c05('0x9'));var csv=require('to-csv');var ejs=require(_0x2c05('0xa'));var fs=require('fs');var fs_extra=require(_0x2c05('0xb'));var _=require(_0x2c05('0xc'));var squel=require(_0x2c05('0xd'));var crypto=require(_0x2c05('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x2c05('0xf'));var toCsv=require(_0x2c05('0x10'));var querystring=require(_0x2c05('0x11'));var Papa=require(_0x2c05('0x12'));var Redis=require(_0x2c05('0x13'));var authService=require(_0x2c05('0x14'));var qs=require(_0x2c05('0x15'));var as=require(_0x2c05('0x16'));var hardwareService=require(_0x2c05('0x17'));var logger=require(_0x2c05('0x18'))(_0x2c05('0x19'));var utils=require(_0x2c05('0x1a'));var config=require(_0x2c05('0x1b'));var licenseUtil=require(_0x2c05('0x1c'));var db=require(_0x2c05('0x1d'))['db'];function respondWithStatusCode(_0x3ebd5a,_0x2102c4){_0x2102c4=_0x2102c4||0xcc;return function(_0x4dc6b2){if(_0x4dc6b2){return _0x3ebd5a[_0x2c05('0x1e')](_0x2102c4);}return _0x3ebd5a['status'](_0x2102c4)[_0x2c05('0x1f')]();};}function respondWithResult(_0x5a4c17,_0x410fcc){_0x410fcc=_0x410fcc||0xc8;return function(_0x927007){if(_0x927007){return _0x5a4c17[_0x2c05('0x20')](_0x410fcc)[_0x2c05('0x21')](_0x927007);}};}function respondWithFilteredResult(_0x2eb4da,_0x3ced6c){return function(_0x2a2e36){if(_0x2a2e36){var _0x1371b4=typeof _0x3ced6c[_0x2c05('0x22')]==='undefined'&&typeof _0x3ced6c[_0x2c05('0x23')]===_0x2c05('0x24');var _0x25fe6a=_0x2a2e36[_0x2c05('0x25')];var _0x52408a=_0x1371b4?0x0:_0x3ced6c[_0x2c05('0x22')];var _0x18bfba=_0x1371b4?_0x2a2e36[_0x2c05('0x25')]:_0x3ced6c['offset']+_0x3ced6c[_0x2c05('0x23')];var _0x300d60;if(_0x18bfba>=_0x25fe6a){_0x18bfba=_0x25fe6a;_0x300d60=0xc8;}else{_0x300d60=0xce;}_0x2eb4da[_0x2c05('0x20')](_0x300d60);return _0x2eb4da[_0x2c05('0x26')](_0x2c05('0x27'),_0x52408a+'-'+_0x18bfba+'/'+_0x25fe6a)[_0x2c05('0x21')](_0x2a2e36);}return null;};}function patchUpdates(_0x3134b){return function(_0x191a4c){try{jsonpatch[_0x2c05('0x28')](_0x191a4c,_0x3134b,!![]);}catch(_0x4d2326){return BPromise[_0x2c05('0x29')](_0x4d2326);}return _0x191a4c[_0x2c05('0x2a')]();};}function saveUpdates(_0x23af34,_0x3896da){return function(_0x37eab7){if(_0x37eab7){return _0x37eab7[_0x2c05('0x2b')](_0x23af34)[_0x2c05('0x2c')](function(_0x28d232){return _0x28d232;});}return null;};}function removeEntity(_0x39217a,_0x55e45f){return function(_0x19bfc7){if(_0x19bfc7){return _0x19bfc7['destroy']()['then'](function(){var _0x3a50f3=_0x19bfc7[_0x2c05('0x2d')]({'plain':!![]});var _0x1bff4d='ExtractedReports';return db[_0x2c05('0x2e')][_0x2c05('0x2f')]({'where':{'type':_0x1bff4d,'resourceId':_0x3a50f3['id']}})['then'](function(){return _0x19bfc7;});})['then'](function(){_0x39217a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2afbee,_0x36bc2d){return function(_0xa48c5f){if(!_0xa48c5f){_0x2afbee['sendStatus'](0x194);}return _0xa48c5f;};}function handleError(_0x2e6f6f,_0x5a1b61){_0x5a1b61=_0x5a1b61||0x1f4;return function(_0x111ec5){logger[_0x2c05('0x30')](_0x111ec5[_0x2c05('0x31')]);if(_0x111ec5['name']){delete _0x111ec5['name'];}_0x2e6f6f['status'](_0x5a1b61)['send'](_0x111ec5);};}exports[_0x2c05('0x32')]=function(_0x502a0a,_0x341a07){var _0x19137b={},_0x46d8b6={},_0x572284={'count':0x0,'rows':[]};var _0x1151b3=_[_0x2c05('0x33')](db['AnalyticExtractedReport'][_0x2c05('0x34')],function(_0x340eea){return{'name':_0x340eea[_0x2c05('0x35')],'type':_0x340eea[_0x2c05('0x36')][_0x2c05('0x37')]};});_0x46d8b6[_0x2c05('0x38')]=_[_0x2c05('0x33')](_0x1151b3,_0x2c05('0x39'));_0x46d8b6['query']=_[_0x2c05('0x3a')](_0x502a0a[_0x2c05('0x3b')]);_0x46d8b6[_0x2c05('0x3c')]=_[_0x2c05('0x3d')](_0x46d8b6['model'],_0x46d8b6[_0x2c05('0x3b')]);_0x19137b[_0x2c05('0x3e')]=_[_0x2c05('0x3d')](_0x46d8b6[_0x2c05('0x38')],qs['fields'](_0x502a0a['query'][_0x2c05('0x3f')]));_0x19137b[_0x2c05('0x3e')]=_0x19137b[_0x2c05('0x3e')]['length']?_0x19137b[_0x2c05('0x3e')]:_0x46d8b6['model'];if(!_0x502a0a['query'][_0x2c05('0x40')](_0x2c05('0x41'))){_0x19137b[_0x2c05('0x23')]=qs['limit'](_0x502a0a[_0x2c05('0x3b')]['limit']);_0x19137b[_0x2c05('0x22')]=qs[_0x2c05('0x22')](_0x502a0a[_0x2c05('0x3b')][_0x2c05('0x22')]);}_0x19137b['order']=qs[_0x2c05('0x42')](_0x502a0a[_0x2c05('0x3b')]['sort']);_0x19137b[_0x2c05('0x43')]=qs[_0x2c05('0x3c')](_['pick'](_0x502a0a[_0x2c05('0x3b')],_0x46d8b6[_0x2c05('0x3c')]),_0x1151b3);if(_0x502a0a['query'][_0x2c05('0x44')]){_0x19137b[_0x2c05('0x43')]=_[_0x2c05('0x45')](_0x19137b[_0x2c05('0x43')],{'$or':_[_0x2c05('0x33')](_0x1151b3,function(_0x500fb3){if(_0x500fb3['type']!==_0x2c05('0x46')){var _0xd210c1={};_0xd210c1[_0x500fb3[_0x2c05('0x39')]]={'$like':'%'+_0x502a0a[_0x2c05('0x3b')]['filter']+'%'};return _0xd210c1;}})});}_0x19137b=_[_0x2c05('0x45')]({},_0x19137b,_0x502a0a[_0x2c05('0x47')]);var _0xa73181={'where':_0x19137b[_0x2c05('0x43')]};return db[_0x2c05('0x48')][_0x2c05('0x25')](_0xa73181)[_0x2c05('0x2c')](function(_0x7fc80f){_0x572284['count']=_0x7fc80f;if(_0x502a0a['query'][_0x2c05('0x49')]){_0x19137b[_0x2c05('0x4a')]=[{'all':!![]}];}return db[_0x2c05('0x48')][_0x2c05('0x4b')](_0x19137b);})[_0x2c05('0x2c')](function(_0x1d787d){_0x572284['rows']=_0x1d787d;return _0x572284;})['then'](respondWithFilteredResult(_0x341a07,_0x19137b))['catch'](handleError(_0x341a07,null));};exports['show']=function(_0x2c5c5d,_0x27071c){var _0x2dff36={'raw':!![],'where':{'id':_0x2c5c5d[_0x2c05('0x4c')]['id']}},_0x4e6513={};_0x4e6513['model']=_[_0x2c05('0x3a')](db[_0x2c05('0x48')]['rawAttributes']);_0x4e6513[_0x2c05('0x3b')]=_['keys'](_0x2c5c5d[_0x2c05('0x3b')]);_0x4e6513['filters']=_[_0x2c05('0x3d')](_0x4e6513['model'],_0x4e6513['query']);_0x2dff36[_0x2c05('0x3e')]=_[_0x2c05('0x3d')](_0x4e6513[_0x2c05('0x38')],qs[_0x2c05('0x3f')](_0x2c5c5d['query'][_0x2c05('0x3f')]));_0x2dff36[_0x2c05('0x3e')]=_0x2dff36['attributes'][_0x2c05('0x4d')]?_0x2dff36[_0x2c05('0x3e')]:_0x4e6513[_0x2c05('0x38')];if(_0x2c5c5d[_0x2c05('0x3b')][_0x2c05('0x49')]){_0x2dff36[_0x2c05('0x4a')]=[{'all':!![]}];}_0x2dff36=_[_0x2c05('0x45')]({},_0x2dff36,_0x2c5c5d[_0x2c05('0x47')]);return db[_0x2c05('0x48')][_0x2c05('0x4e')](_0x2dff36)[_0x2c05('0x2c')](handleEntityNotFound(_0x27071c,null))[_0x2c05('0x2c')](respondWithResult(_0x27071c,null))[_0x2c05('0x4f')](handleError(_0x27071c,null));};exports[_0x2c05('0x50')]=function(_0x378526,_0x2e530a){return db[_0x2c05('0x48')]['create'](_0x378526[_0x2c05('0x51')],{})[_0x2c05('0x2c')](function(_0x562c6c){var _0x274c74=_0x378526[_0x2c05('0x52')][_0x2c05('0x2d')]({'plain':!![]});if(!_0x274c74)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x274c74[_0x2c05('0x53')]===_0x2c05('0x52')){var _0x38b528=_0x562c6c[_0x2c05('0x2d')]({'plain':!![]});var _0xe590c3=_0x2c05('0x54');return db[_0x2c05('0x55')][_0x2c05('0x4e')]({'where':{'name':_0xe590c3,'userProfileId':_0x274c74[_0x2c05('0x56')]},'raw':!![]})[_0x2c05('0x2c')](function(_0x2a38c0){if(_0x2a38c0&&_0x2a38c0[_0x2c05('0x57')]===0x0){return db[_0x2c05('0x2e')][_0x2c05('0x50')]({'name':_0x38b528[_0x2c05('0x39')],'resourceId':_0x38b528['id'],'type':_0x2a38c0[_0x2c05('0x39')],'sectionId':_0x2a38c0['id']},{})[_0x2c05('0x2c')](function(){return _0x562c6c;});}else{return _0x562c6c;}})[_0x2c05('0x4f')](function(_0x4cc23b){logger['error'](_0x2c05('0x58'),_0x4cc23b);throw _0x4cc23b;});}return _0x562c6c;})[_0x2c05('0x2c')](respondWithResult(_0x2e530a,0xc9))['catch'](handleError(_0x2e530a,null));};exports[_0x2c05('0x2b')]=function(_0xaceb6e,_0x3b7dc8){if(_0xaceb6e[_0x2c05('0x51')]['id']){delete _0xaceb6e[_0x2c05('0x51')]['id'];}return db[_0x2c05('0x48')][_0x2c05('0x4e')]({'where':{'id':_0xaceb6e[_0x2c05('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3b7dc8,null))[_0x2c05('0x2c')](saveUpdates(_0xaceb6e[_0x2c05('0x51')],null))['then'](respondWithResult(_0x3b7dc8,null))[_0x2c05('0x4f')](handleError(_0x3b7dc8,null));};exports[_0x2c05('0x2f')]=function(_0x1a3181,_0x31fd4b){return db[_0x2c05('0x48')]['find']({'where':{'id':_0x1a3181['params']['id']}})[_0x2c05('0x2c')](handleEntityNotFound(_0x31fd4b,null))[_0x2c05('0x2c')](removeEntity(_0x31fd4b,null))[_0x2c05('0x4f')](handleError(_0x31fd4b,null));};exports[_0x2c05('0x59')]=function(_0x463a25,_0x57ce27,_0x5bc87b){return db[_0x2c05('0x48')]['find']({'where':{'id':_0x463a25[_0x2c05('0x4c')]['id']},'attributes':[_0x2c05('0x39'),'basename','savename',_0x2c05('0x5a')],'raw':!![]})[_0x2c05('0x2c')](handleEntityNotFound(_0x57ce27,null))[_0x2c05('0x2c')](function(_0x58ac1c){if(_0x58ac1c){if(!fs['existsSync'](path['join'](config[_0x2c05('0x5b')],_0x2c05('0x5c'),_0x58ac1c[_0x2c05('0x5d')]))){throw new db['Sequelize'][(_0x2c05('0x5e'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x463a25[_0x2c05('0x3b')][_0x2c05('0x5f')]){return _0x57ce27[_0x2c05('0x1e')](0xc8);}return _0x57ce27[_0x2c05('0x59')](path[_0x2c05('0x60')](config['root'],'server/files/reports',_0x58ac1c[_0x2c05('0x5d')]),util[_0x2c05('0x61')]('%s.%s',_0x58ac1c[_0x2c05('0x62')]||_0x58ac1c[_0x2c05('0x39')],_0x58ac1c['output'][_0x2c05('0x63')]()));}})['catch'](handleError(_0x57ce27,null));}; \ No newline at end of file +var _0x0544=['../../config/environment','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','get','ExtractedReports','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','findAll','rows','catch','show','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','params','download','basename','output','existsSync','join','root','savename','Sequelize','ValidationError','server/files/reports','format','%s.%s','toLowerCase','rimraf','zip-dir','fast-json-patch','request-promise','util','path','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x4d8710,_0x422d47){var _0x59a08f=function(_0xeba6c){while(--_0xeba6c){_0x4d8710['push'](_0x4d8710['shift']());}};_0x59a08f(++_0x422d47);}(_0x0544,0xa9));var _0x4054=function(_0x11d95f,_0x34f442){_0x11d95f=_0x11d95f-0x0;var _0x2b1a14=_0x0544[_0x11d95f];return _0x2b1a14;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4054('0x0'));var zipdir=require(_0x4054('0x1'));var jsonpatch=require(_0x4054('0x2'));var rp=require(_0x4054('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4054('0x4'));var path=require(_0x4054('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4054('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4054('0x7'));var squel=require(_0x4054('0x8'));var crypto=require('crypto');var jsforce=require(_0x4054('0x9'));var deskjs=require(_0x4054('0xa'));var toCsv=require('to-csv');var querystring=require(_0x4054('0xb'));var Papa=require('papaparse');var Redis=require(_0x4054('0xc'));var authService=require(_0x4054('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x4054('0xe'));var hardwareService=require(_0x4054('0xf'));var logger=require(_0x4054('0x10'))(_0x4054('0x11'));var utils=require(_0x4054('0x12'));var config=require(_0x4054('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x12514c,_0x16c80e){_0x16c80e=_0x16c80e||0xcc;return function(_0x4bc88f){if(_0x4bc88f){return _0x12514c[_0x4054('0x14')](_0x16c80e);}return _0x12514c['status'](_0x16c80e)[_0x4054('0x15')]();};}function respondWithResult(_0x3e3e9f,_0xa50269){_0xa50269=_0xa50269||0xc8;return function(_0x32b9de){if(_0x32b9de){return _0x3e3e9f[_0x4054('0x16')](_0xa50269)[_0x4054('0x17')](_0x32b9de);}};}function respondWithFilteredResult(_0x21c119,_0x1da24e){return function(_0x14cabb){if(_0x14cabb){var _0x43edab=typeof _0x1da24e[_0x4054('0x18')]===_0x4054('0x19')&&typeof _0x1da24e[_0x4054('0x1a')]===_0x4054('0x19');var _0x181712=_0x14cabb['count'];var _0x18e3e1=_0x43edab?0x0:_0x1da24e[_0x4054('0x18')];var _0x54eea4=_0x43edab?_0x14cabb['count']:_0x1da24e[_0x4054('0x18')]+_0x1da24e[_0x4054('0x1a')];var _0x44a0ba;if(_0x54eea4>=_0x181712){_0x54eea4=_0x181712;_0x44a0ba=0xc8;}else{_0x44a0ba=0xce;}_0x21c119[_0x4054('0x16')](_0x44a0ba);return _0x21c119[_0x4054('0x1b')](_0x4054('0x1c'),_0x18e3e1+'-'+_0x54eea4+'/'+_0x181712)[_0x4054('0x17')](_0x14cabb);}return null;};}function patchUpdates(_0x5efe2b){return function(_0x3d0b84){try{jsonpatch[_0x4054('0x1d')](_0x3d0b84,_0x5efe2b,!![]);}catch(_0x3136dc){return BPromise[_0x4054('0x1e')](_0x3136dc);}return _0x3d0b84[_0x4054('0x1f')]();};}function saveUpdates(_0x2a848c,_0x4be10d){return function(_0x135425){if(_0x135425){return _0x135425[_0x4054('0x20')](_0x2a848c)[_0x4054('0x21')](function(_0x22d144){return _0x22d144;});}return null;};}function removeEntity(_0x5771ab,_0x6f88d3){return function(_0x34dcfb){if(_0x34dcfb){return _0x34dcfb['destroy']()['then'](function(){var _0x355ac3=_0x34dcfb[_0x4054('0x22')]({'plain':!![]});var _0x22b35b=_0x4054('0x23');return db[_0x4054('0x24')][_0x4054('0x25')]({'where':{'type':_0x22b35b,'resourceId':_0x355ac3['id']}})['then'](function(){return _0x34dcfb;});})[_0x4054('0x21')](function(){_0x5771ab[_0x4054('0x16')](0xcc)[_0x4054('0x15')]();});}};}function handleEntityNotFound(_0x395a57,_0x2a1e1b){return function(_0x287688){if(!_0x287688){_0x395a57['sendStatus'](0x194);}return _0x287688;};}function handleError(_0x52a21e,_0x2c2f24){_0x2c2f24=_0x2c2f24||0x1f4;return function(_0x29dbaf){logger[_0x4054('0x26')](_0x29dbaf[_0x4054('0x27')]);if(_0x29dbaf[_0x4054('0x28')]){delete _0x29dbaf[_0x4054('0x28')];}_0x52a21e[_0x4054('0x16')](_0x2c2f24)[_0x4054('0x29')](_0x29dbaf);};}exports[_0x4054('0x2a')]=function(_0x436cb2,_0x1b4d71){var _0x57d512={},_0x35b533={},_0x4a83df={'count':0x0,'rows':[]};var _0x327626=_[_0x4054('0x2b')](db[_0x4054('0x2c')][_0x4054('0x2d')],function(_0x16a91f){return{'name':_0x16a91f[_0x4054('0x2e')],'type':_0x16a91f[_0x4054('0x2f')]['key']};});_0x35b533[_0x4054('0x30')]=_[_0x4054('0x2b')](_0x327626,_0x4054('0x28'));_0x35b533[_0x4054('0x31')]=_[_0x4054('0x32')](_0x436cb2[_0x4054('0x31')]);_0x35b533[_0x4054('0x33')]=_[_0x4054('0x34')](_0x35b533[_0x4054('0x30')],_0x35b533[_0x4054('0x31')]);_0x57d512[_0x4054('0x35')]=_[_0x4054('0x34')](_0x35b533['model'],qs['fields'](_0x436cb2['query'][_0x4054('0x36')]));_0x57d512[_0x4054('0x35')]=_0x57d512['attributes'][_0x4054('0x37')]?_0x57d512['attributes']:_0x35b533[_0x4054('0x30')];if(!_0x436cb2['query'][_0x4054('0x38')](_0x4054('0x39'))){_0x57d512[_0x4054('0x1a')]=qs[_0x4054('0x1a')](_0x436cb2[_0x4054('0x31')][_0x4054('0x1a')]);_0x57d512['offset']=qs[_0x4054('0x18')](_0x436cb2['query'][_0x4054('0x18')]);}_0x57d512['order']=qs[_0x4054('0x3a')](_0x436cb2[_0x4054('0x31')][_0x4054('0x3a')]);_0x57d512[_0x4054('0x3b')]=qs[_0x4054('0x33')](_[_0x4054('0x3c')](_0x436cb2[_0x4054('0x31')],_0x35b533[_0x4054('0x33')]),_0x327626);if(_0x436cb2[_0x4054('0x31')][_0x4054('0x3d')]){_0x57d512[_0x4054('0x3b')]=_[_0x4054('0x3e')](_0x57d512[_0x4054('0x3b')],{'$or':_['map'](_0x327626,function(_0x24cab3){if(_0x24cab3['type']!==_0x4054('0x3f')){var _0x2cdf48={};_0x2cdf48[_0x24cab3[_0x4054('0x28')]]={'$like':'%'+_0x436cb2[_0x4054('0x31')]['filter']+'%'};return _0x2cdf48;}})});}_0x57d512=_['merge']({},_0x57d512,_0x436cb2[_0x4054('0x40')]);var _0x11b6a4={'where':_0x57d512[_0x4054('0x3b')]};return db[_0x4054('0x2c')][_0x4054('0x41')](_0x11b6a4)[_0x4054('0x21')](function(_0x37e278){_0x4a83df[_0x4054('0x41')]=_0x37e278;if(_0x436cb2[_0x4054('0x31')][_0x4054('0x42')]){_0x57d512['include']=[{'all':!![]}];}return db[_0x4054('0x2c')][_0x4054('0x43')](_0x57d512);})[_0x4054('0x21')](function(_0x552609){_0x4a83df[_0x4054('0x44')]=_0x552609;return _0x4a83df;})[_0x4054('0x21')](respondWithFilteredResult(_0x1b4d71,_0x57d512))[_0x4054('0x45')](handleError(_0x1b4d71,null));};exports[_0x4054('0x46')]=function(_0x109d28,_0x24b428){var _0x5c9057={'raw':!![],'where':{'id':_0x109d28['params']['id']}},_0x3906a3={};_0x3906a3['model']=_[_0x4054('0x32')](db[_0x4054('0x2c')][_0x4054('0x2d')]);_0x3906a3[_0x4054('0x31')]=_['keys'](_0x109d28['query']);_0x3906a3[_0x4054('0x33')]=_[_0x4054('0x34')](_0x3906a3[_0x4054('0x30')],_0x3906a3[_0x4054('0x31')]);_0x5c9057[_0x4054('0x35')]=_[_0x4054('0x34')](_0x3906a3[_0x4054('0x30')],qs[_0x4054('0x36')](_0x109d28[_0x4054('0x31')][_0x4054('0x36')]));_0x5c9057[_0x4054('0x35')]=_0x5c9057[_0x4054('0x35')][_0x4054('0x37')]?_0x5c9057[_0x4054('0x35')]:_0x3906a3[_0x4054('0x30')];if(_0x109d28['query'][_0x4054('0x42')]){_0x5c9057[_0x4054('0x47')]=[{'all':!![]}];}_0x5c9057=_[_0x4054('0x3e')]({},_0x5c9057,_0x109d28[_0x4054('0x40')]);return db['AnalyticExtractedReport']['find'](_0x5c9057)[_0x4054('0x21')](handleEntityNotFound(_0x24b428,null))[_0x4054('0x21')](respondWithResult(_0x24b428,null))[_0x4054('0x45')](handleError(_0x24b428,null));};exports[_0x4054('0x48')]=function(_0x2f8c35,_0xbadfdd){return db['AnalyticExtractedReport'][_0x4054('0x48')](_0x2f8c35[_0x4054('0x49')],{})[_0x4054('0x21')](function(_0x6e6e11){var _0xb44d59=_0x2f8c35[_0x4054('0x4a')][_0x4054('0x22')]({'plain':!![]});if(!_0xb44d59)throw new Error(_0x4054('0x4b'));if(_0xb44d59[_0x4054('0x4c')]===_0x4054('0x4a')){var _0x2e2436=_0x6e6e11[_0x4054('0x22')]({'plain':!![]});var _0x3ab84c=_0x4054('0x23');return db[_0x4054('0x4d')][_0x4054('0x4e')]({'where':{'name':_0x3ab84c,'userProfileId':_0xb44d59[_0x4054('0x4f')]},'raw':!![]})[_0x4054('0x21')](function(_0xaa0e56){if(_0xaa0e56&&_0xaa0e56['autoAssociation']===0x0){return db[_0x4054('0x24')][_0x4054('0x48')]({'name':_0x2e2436[_0x4054('0x28')],'resourceId':_0x2e2436['id'],'type':_0xaa0e56[_0x4054('0x28')],'sectionId':_0xaa0e56['id']},{})['then'](function(){return _0x6e6e11;});}else{return _0x6e6e11;}})[_0x4054('0x45')](function(_0x2b501e){logger[_0x4054('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2b501e);throw _0x2b501e;});}return _0x6e6e11;})[_0x4054('0x21')](respondWithResult(_0xbadfdd,0xc9))[_0x4054('0x45')](handleError(_0xbadfdd,null));};exports[_0x4054('0x20')]=function(_0x214ede,_0x41cb50){if(_0x214ede[_0x4054('0x49')]['id']){delete _0x214ede['body']['id'];}return db[_0x4054('0x2c')][_0x4054('0x4e')]({'where':{'id':_0x214ede[_0x4054('0x50')]['id']}})[_0x4054('0x21')](handleEntityNotFound(_0x41cb50,null))['then'](saveUpdates(_0x214ede[_0x4054('0x49')],null))['then'](respondWithResult(_0x41cb50,null))['catch'](handleError(_0x41cb50,null));};exports['destroy']=function(_0x40107c,_0x81c10){return db[_0x4054('0x2c')][_0x4054('0x4e')]({'where':{'id':_0x40107c[_0x4054('0x50')]['id']}})[_0x4054('0x21')](handleEntityNotFound(_0x81c10,null))['then'](removeEntity(_0x81c10,null))[_0x4054('0x45')](handleError(_0x81c10,null));};exports[_0x4054('0x51')]=function(_0x2a7474,_0x58c494,_0x3e0224){return db[_0x4054('0x2c')][_0x4054('0x4e')]({'where':{'id':_0x2a7474[_0x4054('0x50')]['id']},'attributes':[_0x4054('0x28'),_0x4054('0x52'),'savename',_0x4054('0x53')],'raw':!![]})[_0x4054('0x21')](handleEntityNotFound(_0x58c494,null))['then'](function(_0x6b1965){if(_0x6b1965){if(!fs[_0x4054('0x54')](path[_0x4054('0x55')](config[_0x4054('0x56')],'server/files/reports',_0x6b1965[_0x4054('0x57')]))){throw new db[(_0x4054('0x58'))][(_0x4054('0x59'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x2a7474[_0x4054('0x31')]['exists']){return _0x58c494[_0x4054('0x14')](0xc8);}return _0x58c494[_0x4054('0x51')](path[_0x4054('0x55')](config[_0x4054('0x56')],_0x4054('0x5a'),_0x6b1965['savename']),util[_0x4054('0x5b')](_0x4054('0x5c'),_0x6b1965[_0x4054('0x52')]||_0x6b1965[_0x4054('0x28')],_0x6b1965[_0x4054('0x53')][_0x4054('0x5d')]()));}})['catch'](handleError(_0x58c494,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 7bbaf61..6fa39b5 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 _0x3883=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','lodash','util'];(function(_0x284863,_0x57e83e){var _0x4562d7=function(_0xbd103f){while(--_0xbd103f){_0x284863['push'](_0x284863['shift']());}};_0x4562d7(++_0x57e83e);}(_0x3883,0x108));var _0x3388=function(_0x4ffd7a,_0x57ae41){_0x4ffd7a=_0x4ffd7a-0x0;var _0x336ecc=_0x3883[_0x4ffd7a];return _0x336ecc;};'use strict';var _=require(_0x3388('0x0'));var util=require(_0x3388('0x1'));var logger=require(_0x3388('0x2'))(_0x3388('0x3'));var moment=require(_0x3388('0x4'));var BPromise=require(_0x3388('0x5'));var rp=require(_0x3388('0x6'));var fs=require('fs');var path=require(_0x3388('0x7'));var rimraf=require(_0x3388('0x8'));var config=require(_0x3388('0x9'));var attributes=require(_0x3388('0xa'));module[_0x3388('0xb')]=function(_0x4118b8,_0x15d917){return _0x4118b8[_0x3388('0xc')](_0x3388('0xd'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x17e8=['define','AnalyticExtractedReport','analytics_extracted_reports','lodash','../../config/logger','moment','bluebird','request-promise','../../config/environment','./analyticExtractedReport.attributes','exports'];(function(_0x1d3d43,_0x26fe51){var _0x24bef2=function(_0x5d7584){while(--_0x5d7584){_0x1d3d43['push'](_0x1d3d43['shift']());}};_0x24bef2(++_0x26fe51);}(_0x17e8,0x1b0));var _0x817e=function(_0x514c1b,_0x855465){_0x514c1b=_0x514c1b-0x0;var _0x496988=_0x17e8[_0x514c1b];return _0x496988;};'use strict';var _=require(_0x817e('0x0'));var util=require('util');var logger=require(_0x817e('0x1'))('api');var moment=require(_0x817e('0x2'));var BPromise=require(_0x817e('0x3'));var rp=require(_0x817e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x817e('0x5'));var attributes=require(_0x817e('0x6'));module[_0x817e('0x7')]=function(_0x5cd417,_0x2d117a){return _0x5cd417[_0x817e('0x8')](_0x817e('0x9'),attributes,{'tableName':_0x817e('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 6563014..0541d28 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 _0x7f65=['AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2ef951,_0x29f086){var _0x124295=function(_0x41abd4){while(--_0x41abd4){_0x2ef951['push'](_0x2ef951['shift']());}};_0x124295(++_0x29f086);}(_0x7f65,0x91));var _0x57f6=function(_0x193634,_0xb42415){_0x193634=_0x193634-0x0;var _0x3b5955=_0x7f65[_0x193634];return _0x3b5955;};'use strict';var _=require(_0x57f6('0x0'));var util=require(_0x57f6('0x1'));var moment=require(_0x57f6('0x2'));var BPromise=require(_0x57f6('0x3'));var rs=require(_0x57f6('0x4'));var fs=require('fs');var Redis=require(_0x57f6('0x5'));var db=require(_0x57f6('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x57f6('0x7'))('rpc');var config=require(_0x57f6('0x8'));var jayson=require(_0x57f6('0x9'));var client=jayson['client'][_0x57f6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xa34d28,_0x2d6d12,_0xedaa76){return new BPromise(function(_0x3dcd2a,_0x3cfd38){return client[_0x57f6('0xb')](_0xa34d28,_0xedaa76)[_0x57f6('0xc')](function(_0x128fda){logger['info'](_0x57f6('0xd'),_0x2d6d12,_0x57f6('0xe'));logger[_0x57f6('0xf')](_0x57f6('0x10'),_0x2d6d12,_0x57f6('0xe'),JSON[_0x57f6('0x11')](_0x128fda));if(_0x128fda[_0x57f6('0x12')]){if(_0x128fda['error'][_0x57f6('0x13')]===0x1f4){logger[_0x57f6('0x12')](_0x57f6('0xd'),_0x2d6d12,_0x128fda[_0x57f6('0x12')][_0x57f6('0x14')]);return _0x3cfd38(_0x128fda[_0x57f6('0x12')][_0x57f6('0x14')]);}logger['error'](_0x57f6('0xd'),_0x2d6d12,_0x128fda['error'][_0x57f6('0x14')]);return _0x3dcd2a(_0x128fda['error'][_0x57f6('0x14')]);}else{logger[_0x57f6('0x15')](_0x57f6('0xd'),_0x2d6d12,'request\x20sent');_0x3dcd2a(_0x128fda['result'][_0x57f6('0x14')]);}})[_0x57f6('0x16')](function(_0x1e3290){logger[_0x57f6('0x12')](_0x57f6('0xd'),_0x2d6d12,_0x1e3290);_0x3cfd38(_0x1e3290);});});} \ No newline at end of file +var _0xb7d0=['debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','AnalyticExtractedReport,\x20%s,\x20%s','message','info','result','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent'];(function(_0x17a0c1,_0x2f9964){var _0x20baab=function(_0x1fdfb9){while(--_0x1fdfb9){_0x17a0c1['push'](_0x17a0c1['shift']());}};_0x20baab(++_0x2f9964);}(_0xb7d0,0x93));var _0x0b7d=function(_0x3df1c2,_0x1d32db){_0x3df1c2=_0x3df1c2-0x0;var _0x70d3e8=_0xb7d0[_0x3df1c2];return _0x70d3e8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0b7d('0x0'));var BPromise=require(_0x0b7d('0x1'));var rs=require(_0x0b7d('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0b7d('0x3'))['db'];var utils=require(_0x0b7d('0x4'));var logger=require(_0x0b7d('0x5'))(_0x0b7d('0x6'));var config=require(_0x0b7d('0x7'));var jayson=require(_0x0b7d('0x8'));var client=jayson['client'][_0x0b7d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xa454e6,_0x1e2245,_0xe050d7){return new BPromise(function(_0x362394,_0x31b10c){return client[_0x0b7d('0xa')](_0xa454e6,_0xe050d7)[_0x0b7d('0xb')](function(_0x4bafec){logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x1e2245,_0x0b7d('0xc'));logger[_0x0b7d('0xd')](_0x0b7d('0xe'),_0x1e2245,_0x0b7d('0xc'),JSON['stringify'](_0x4bafec));if(_0x4bafec[_0x0b7d('0xf')]){if(_0x4bafec[_0x0b7d('0xf')]['code']===0x1f4){logger[_0x0b7d('0xf')](_0x0b7d('0x10'),_0x1e2245,_0x4bafec[_0x0b7d('0xf')][_0x0b7d('0x11')]);return _0x31b10c(_0x4bafec[_0x0b7d('0xf')][_0x0b7d('0x11')]);}logger[_0x0b7d('0xf')](_0x0b7d('0x10'),_0x1e2245,_0x4bafec[_0x0b7d('0xf')][_0x0b7d('0x11')]);return _0x362394(_0x4bafec[_0x0b7d('0xf')][_0x0b7d('0x11')]);}else{logger[_0x0b7d('0x12')](_0x0b7d('0x10'),_0x1e2245,_0x0b7d('0xc'));_0x362394(_0x4bafec[_0x0b7d('0x13')][_0x0b7d('0x11')]);}})['catch'](function(_0x2c0b9a){logger[_0x0b7d('0xf')](_0x0b7d('0x10'),_0x1e2245,_0x2c0b9a);_0x31b10c(_0x2c0b9a);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 91c3cb8..dce391e 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 _0x3f8c=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x1edbe7,_0x140075){var _0x46f827=function(_0x4a0a95){while(--_0x4a0a95){_0x1edbe7['push'](_0x1edbe7['shift']());}};_0x46f827(++_0x140075);}(_0x3f8c,0x7a));var _0xc3f8=function(_0x404341,_0x1d23d8){_0x404341=_0x404341-0x0;var _0x578bdd=_0x3f8c[_0x404341];return _0x578bdd;};'use strict';var multer=require(_0xc3f8('0x0'));var util=require(_0xc3f8('0x1'));var path=require(_0xc3f8('0x2'));var timeout=require(_0xc3f8('0x3'));var express=require(_0xc3f8('0x4'));var router=express[_0xc3f8('0x5')]();var fs_extra=require(_0xc3f8('0x6'));var auth=require(_0xc3f8('0x7'));var interaction=require(_0xc3f8('0x8'));var config=require(_0xc3f8('0x9'));var controller=require(_0xc3f8('0xa'));router[_0xc3f8('0xb')]('/',auth[_0xc3f8('0xc')](),controller[_0xc3f8('0xd')]);router['get'](_0xc3f8('0xe'),auth['isAuthenticated'](),controller[_0xc3f8('0xf')]);router[_0xc3f8('0xb')](_0xc3f8('0x10'),auth[_0xc3f8('0xc')](),controller[_0xc3f8('0x11')]);router[_0xc3f8('0x12')]('/',auth[_0xc3f8('0xc')](),controller[_0xc3f8('0x13')]);router[_0xc3f8('0x14')](_0xc3f8('0xe'),auth['isAuthenticated'](),controller[_0xc3f8('0x15')]);router[_0xc3f8('0x16')](_0xc3f8('0xe'),auth[_0xc3f8('0xc')](),controller[_0xc3f8('0x17')]);module[_0xc3f8('0x18')]=router; \ No newline at end of file +var _0x0042=['put','update','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post'];(function(_0x48e9c8,_0x23f0de){var _0x456afa=function(_0x5b2fb0){while(--_0x5b2fb0){_0x48e9c8['push'](_0x48e9c8['shift']());}};_0x456afa(++_0x23f0de);}(_0x0042,0x158));var _0x2004=function(_0x4c8a8f,_0x997ef){_0x4c8a8f=_0x4c8a8f-0x0;var _0x404500=_0x0042[_0x4c8a8f];return _0x404500;};'use strict';var multer=require('multer');var util=require(_0x2004('0x0'));var path=require(_0x2004('0x1'));var timeout=require(_0x2004('0x2'));var express=require(_0x2004('0x3'));var router=express[_0x2004('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2004('0x5'));var interaction=require(_0x2004('0x6'));var config=require(_0x2004('0x7'));var controller=require('./analyticExtractedReport.controller');router[_0x2004('0x8')]('/',auth[_0x2004('0x9')](),controller[_0x2004('0xa')]);router[_0x2004('0x8')](_0x2004('0xb'),auth['isAuthenticated'](),controller[_0x2004('0xc')]);router['get'](_0x2004('0xd'),auth[_0x2004('0x9')](),controller[_0x2004('0xe')]);router[_0x2004('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2004('0x10')](_0x2004('0xb'),auth[_0x2004('0x9')](),controller[_0x2004('0x11')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x2004('0x12')]);module[_0x2004('0x13')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 4290d70..9c47ccf 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 _0x0da5=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x564b82,_0x4c0db0){var _0x4111d9=function(_0x3d0b66){while(--_0x3d0b66){_0x564b82['push'](_0x564b82['shift']());}};_0x4111d9(++_0x4c0db0);}(_0x0da5,0x18f));var _0x50da=function(_0x9c9ec2,_0x1f7eb1){_0x9c9ec2=_0x9c9ec2-0x0;var _0x1d6877=_0x0da5[_0x9c9ec2];return _0x1d6877;};'use strict';var Sequelize=require(_0x50da('0x0'));module[_0x50da('0x1')]={'field':{'type':Sequelize[_0x50da('0x2')]},'alias':{'type':Sequelize[_0x50da('0x3')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0x50da('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x50da('0x3')]},'custom':{'type':Sequelize[_0x50da('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0xc7f5=['sequelize','exports','TEXT','STRING','BOOLEAN'];(function(_0xd8d422,_0x2a29cb){var _0x554af6=function(_0x4f5385){while(--_0x4f5385){_0xd8d422['push'](_0xd8d422['shift']());}};_0x554af6(++_0x2a29cb);}(_0xc7f5,0x1ef));var _0x5c7f=function(_0x2486a4,_0x3e3650){_0x2486a4=_0x2486a4-0x0;var _0x14cf68=_0xc7f5[_0x2486a4];return _0x14cf68;};'use strict';var Sequelize=require(_0x5c7f('0x0'));module[_0x5c7f('0x1')]={'field':{'type':Sequelize[_0x5c7f('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x5c7f('0x3')]},'groupBy':{'type':Sequelize[_0x5c7f('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x5c7f('0x3')]},'custom':{'type':Sequelize[_0x5c7f('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index 6bf2c16..a2ae96c 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 _0xd9e4=['order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','rawAttributes','fields','find','catch','create','body','bulkCreate','update','addFields','AnalyticCustomReport','sequelize','transaction','CustomReportId','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','then','destroy','error','stack','name','send','map','AnalyticFieldReport','fieldName','type','model','keys','query','filters','intersection','attributes','length'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0xd9e4,0x1f4));var _0x4d9e=function(_0x2bbdc4,_0x2cb88e){_0x2bbdc4=_0x2bbdc4-0x0;var _0x482d0c=_0xd9e4[_0x2bbdc4];return _0x482d0c;};'use strict';var emlformat=require(_0x4d9e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4d9e('0x1'));var jsonpatch=require(_0x4d9e('0x2'));var rp=require(_0x4d9e('0x3'));var moment=require(_0x4d9e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4d9e('0x5'));var util=require(_0x4d9e('0x6'));var path=require(_0x4d9e('0x7'));var sox=require(_0x4d9e('0x8'));var csv=require(_0x4d9e('0x9'));var ejs=require(_0x4d9e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4d9e('0xb'));var squel=require(_0x4d9e('0xc'));var crypto=require('crypto');var jsforce=require(_0x4d9e('0xd'));var deskjs=require(_0x4d9e('0xe'));var toCsv=require(_0x4d9e('0x9'));var querystring=require('querystring');var Papa=require(_0x4d9e('0xf'));var Redis=require('ioredis');var authService=require(_0x4d9e('0x10'));var qs=require(_0x4d9e('0x11'));var as=require(_0x4d9e('0x12'));var hardwareService=require(_0x4d9e('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x4d9e('0x14'));var config=require(_0x4d9e('0x15'));var licenseUtil=require(_0x4d9e('0x16'));var db=require(_0x4d9e('0x17'))['db'];function respondWithStatusCode(_0x19a6e9,_0x3324d2){_0x3324d2=_0x3324d2||0xcc;return function(_0x26eb9b){if(_0x26eb9b){return _0x19a6e9[_0x4d9e('0x18')](_0x3324d2);}return _0x19a6e9['status'](_0x3324d2)[_0x4d9e('0x19')]();};}function respondWithResult(_0xeae0a1,_0x40fe85){_0x40fe85=_0x40fe85||0xc8;return function(_0x553155){if(_0x553155){return _0xeae0a1[_0x4d9e('0x1a')](_0x40fe85)[_0x4d9e('0x1b')](_0x553155);}};}function respondWithFilteredResult(_0x1fc925,_0xb0b1b0){return function(_0x2ee7f5){if(_0x2ee7f5){var _0x152057=typeof _0xb0b1b0[_0x4d9e('0x1c')]===_0x4d9e('0x1d')&&typeof _0xb0b1b0[_0x4d9e('0x1e')]==='undefined';var _0x369fe0=_0x2ee7f5['count'];var _0x583d50=_0x152057?0x0:_0xb0b1b0['offset'];var _0x4dcb99=_0x152057?_0x2ee7f5[_0x4d9e('0x1f')]:_0xb0b1b0[_0x4d9e('0x1c')]+_0xb0b1b0[_0x4d9e('0x1e')];var _0x2fbbe0;if(_0x4dcb99>=_0x369fe0){_0x4dcb99=_0x369fe0;_0x2fbbe0=0xc8;}else{_0x2fbbe0=0xce;}_0x1fc925['status'](_0x2fbbe0);return _0x1fc925[_0x4d9e('0x20')]('Content-Range',_0x583d50+'-'+_0x4dcb99+'/'+_0x369fe0)[_0x4d9e('0x1b')](_0x2ee7f5);}return null;};}function patchUpdates(_0x258f71){return function(_0x282d7e){try{jsonpatch[_0x4d9e('0x21')](_0x282d7e,_0x258f71,!![]);}catch(_0x3a40b8){return BPromise[_0x4d9e('0x22')](_0x3a40b8);}return _0x282d7e[_0x4d9e('0x23')]();};}function saveUpdates(_0x1b3d01,_0x34cf6a){return function(_0x35aa55){if(_0x35aa55){return _0x35aa55['update'](_0x1b3d01)[_0x4d9e('0x24')](function(_0x26b921){return _0x26b921;});}return null;};}function removeEntity(_0x564679,_0x2b1731){return function(_0x154a6e){if(_0x154a6e){return _0x154a6e[_0x4d9e('0x25')]()[_0x4d9e('0x24')](function(){_0x564679['status'](0xcc)[_0x4d9e('0x19')]();});}};}function handleEntityNotFound(_0x52acfe,_0x4984fb){return function(_0x3003e2){if(!_0x3003e2){_0x52acfe['sendStatus'](0x194);}return _0x3003e2;};}function handleError(_0x25cd21,_0x15878b){_0x15878b=_0x15878b||0x1f4;return function(_0x3aaa43){logger[_0x4d9e('0x26')](_0x3aaa43[_0x4d9e('0x27')]);if(_0x3aaa43['name']){delete _0x3aaa43[_0x4d9e('0x28')];}_0x25cd21[_0x4d9e('0x1a')](_0x15878b)[_0x4d9e('0x29')](_0x3aaa43);};}exports['index']=function(_0x5360c5,_0x3a09c0){var _0x8cd97={},_0x14c022={},_0x5d210d={'count':0x0,'rows':[]};var _0xf18497=_[_0x4d9e('0x2a')](db[_0x4d9e('0x2b')]['rawAttributes'],function(_0x1cccb0){return{'name':_0x1cccb0[_0x4d9e('0x2c')],'type':_0x1cccb0[_0x4d9e('0x2d')]['key']};});_0x14c022[_0x4d9e('0x2e')]=_[_0x4d9e('0x2a')](_0xf18497,_0x4d9e('0x28'));_0x14c022['query']=_[_0x4d9e('0x2f')](_0x5360c5[_0x4d9e('0x30')]);_0x14c022[_0x4d9e('0x31')]=_[_0x4d9e('0x32')](_0x14c022[_0x4d9e('0x2e')],_0x14c022['query']);_0x8cd97[_0x4d9e('0x33')]=_[_0x4d9e('0x32')](_0x14c022[_0x4d9e('0x2e')],qs['fields'](_0x5360c5['query']['fields']));_0x8cd97['attributes']=_0x8cd97[_0x4d9e('0x33')][_0x4d9e('0x34')]?_0x8cd97[_0x4d9e('0x33')]:_0x14c022['model'];if(!_0x5360c5[_0x4d9e('0x30')]['hasOwnProperty']('nolimit')){_0x8cd97[_0x4d9e('0x1e')]=qs['limit'](_0x5360c5[_0x4d9e('0x30')][_0x4d9e('0x1e')]);_0x8cd97[_0x4d9e('0x1c')]=qs[_0x4d9e('0x1c')](_0x5360c5[_0x4d9e('0x30')][_0x4d9e('0x1c')]);}_0x8cd97[_0x4d9e('0x35')]=qs['sort'](_0x5360c5['query'][_0x4d9e('0x36')]);_0x8cd97[_0x4d9e('0x37')]=qs[_0x4d9e('0x31')](_[_0x4d9e('0x38')](_0x5360c5['query'],_0x14c022[_0x4d9e('0x31')]),_0xf18497);if(_0x5360c5[_0x4d9e('0x30')][_0x4d9e('0x39')]){_0x8cd97[_0x4d9e('0x37')]=_[_0x4d9e('0x3a')](_0x8cd97[_0x4d9e('0x37')],{'$or':_[_0x4d9e('0x2a')](_0xf18497,function(_0x362e75){if(_0x362e75[_0x4d9e('0x2d')]!==_0x4d9e('0x3b')){var _0x1acd1c={};_0x1acd1c[_0x362e75['name']]={'$like':'%'+_0x5360c5[_0x4d9e('0x30')][_0x4d9e('0x39')]+'%'};return _0x1acd1c;}})});}_0x8cd97=_[_0x4d9e('0x3a')]({},_0x8cd97,_0x5360c5[_0x4d9e('0x3c')]);var _0x5cf4ab={'where':_0x8cd97[_0x4d9e('0x37')]};return db[_0x4d9e('0x2b')]['count'](_0x5cf4ab)[_0x4d9e('0x24')](function(_0x414b2b){_0x5d210d[_0x4d9e('0x1f')]=_0x414b2b;if(_0x5360c5[_0x4d9e('0x30')][_0x4d9e('0x3d')]){_0x8cd97[_0x4d9e('0x3e')]=[{'all':!![]}];}return db[_0x4d9e('0x2b')][_0x4d9e('0x3f')](_0x8cd97);})['then'](function(_0x418495){_0x5d210d[_0x4d9e('0x40')]=_0x418495;return _0x5d210d;})[_0x4d9e('0x24')](respondWithFilteredResult(_0x3a09c0,_0x8cd97))['catch'](handleError(_0x3a09c0,null));};exports['show']=function(_0x160bc9,_0x7dc052){var _0x232293={'raw':![],'where':{'id':_0x160bc9[_0x4d9e('0x41')]['id']}},_0x5912a0={};_0x5912a0[_0x4d9e('0x2e')]=_[_0x4d9e('0x2f')](db['AnalyticFieldReport'][_0x4d9e('0x42')]);_0x5912a0[_0x4d9e('0x30')]=_[_0x4d9e('0x2f')](_0x160bc9[_0x4d9e('0x30')]);_0x5912a0[_0x4d9e('0x31')]=_[_0x4d9e('0x32')](_0x5912a0[_0x4d9e('0x2e')],_0x5912a0[_0x4d9e('0x30')]);_0x232293['attributes']=_['intersection'](_0x5912a0[_0x4d9e('0x2e')],qs[_0x4d9e('0x43')](_0x160bc9[_0x4d9e('0x30')][_0x4d9e('0x43')]));_0x232293[_0x4d9e('0x33')]=_0x232293[_0x4d9e('0x33')][_0x4d9e('0x34')]?_0x232293[_0x4d9e('0x33')]:_0x5912a0[_0x4d9e('0x2e')];if(_0x160bc9[_0x4d9e('0x30')][_0x4d9e('0x3d')]){_0x232293['include']=[{'all':!![]}];}_0x232293=_[_0x4d9e('0x3a')]({},_0x232293,_0x160bc9[_0x4d9e('0x3c')]);return db[_0x4d9e('0x2b')][_0x4d9e('0x44')](_0x232293)[_0x4d9e('0x24')](handleEntityNotFound(_0x7dc052,null))[_0x4d9e('0x24')](respondWithResult(_0x7dc052,null))[_0x4d9e('0x45')](handleError(_0x7dc052,null));};exports[_0x4d9e('0x46')]=function(_0xb73e6a,_0x4d98fc){return db[_0x4d9e('0x2b')][_0x4d9e('0x46')](_0xb73e6a[_0x4d9e('0x47')],{})[_0x4d9e('0x24')](respondWithResult(_0x4d98fc,0xc9))[_0x4d9e('0x45')](handleError(_0x4d98fc,null));};exports[_0x4d9e('0x48')]=function(_0x5e5562,_0x162f2c){return db['AnalyticFieldReport']['bulkCreate'](_0x5e5562['body'],{'raw':![],'individualHooks':!![]})[_0x4d9e('0x24')](respondWithResult(_0x162f2c,0xc9))[_0x4d9e('0x45')](handleError(_0x162f2c,null));};exports[_0x4d9e('0x49')]=function(_0xa61d11,_0x57b3b1){if(_0xa61d11[_0x4d9e('0x47')]['id']){delete _0xa61d11['body']['id'];}return db[_0x4d9e('0x2b')][_0x4d9e('0x44')]({'where':{'id':_0xa61d11['params']['id']}})[_0x4d9e('0x24')](handleEntityNotFound(_0x57b3b1,null))['then'](saveUpdates(_0xa61d11[_0x4d9e('0x47')],null))[_0x4d9e('0x24')](respondWithResult(_0x57b3b1,null))[_0x4d9e('0x45')](handleError(_0x57b3b1,null));};exports[_0x4d9e('0x25')]=function(_0x2bfc02,_0x44fbc9){return db[_0x4d9e('0x2b')][_0x4d9e('0x44')]({'where':{'id':_0x2bfc02[_0x4d9e('0x41')]['id']}})[_0x4d9e('0x24')](handleEntityNotFound(_0x44fbc9,null))['then'](removeEntity(_0x44fbc9,null))[_0x4d9e('0x45')](handleError(_0x44fbc9,null));};exports['bulkDestroy']=function(_0x1865ab,_0x426e20){return db[_0x4d9e('0x2b')][_0x4d9e('0x25')]({'where':{'id':_0x1865ab[_0x4d9e('0x30')]['ids']||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x426e20,0xcc))[_0x4d9e('0x45')](handleError(_0x426e20,null));};exports[_0x4d9e('0x4a')]=function(_0x3e7675,_0x3a53a2,_0x5919e5){return db[_0x4d9e('0x4b')]['findOne']({'where':{'id':_0x3e7675[_0x4d9e('0x41')]['id']}})['then'](handleEntityNotFound(_0x3a53a2,null))[_0x4d9e('0x24')](function(_0x20ecc1){if(_0x20ecc1){return db[_0x4d9e('0x4c')][_0x4d9e('0x4d')](function(_0x371644){return db['AnalyticFieldReport'][_0x4d9e('0x25')]({'where':{'CustomReportId':_0x3e7675[_0x4d9e('0x41')]['id']},'transaction':_0x371644})[_0x4d9e('0x24')](function(_0x27fb11){var _0xf6cc07=_[_0x4d9e('0x2a')](_0x3e7675[_0x4d9e('0x47')],function(_0x44b3df){delete _0x44b3df['id'];_0x44b3df[_0x4d9e('0x4e')]=_0x3e7675[_0x4d9e('0x41')]['id'];return _0x44b3df;});return db[_0x4d9e('0x2b')][_0x4d9e('0x48')](_0xf6cc07,{'transaction':_0x371644});});})[_0x4d9e('0x24')](function(){return db['AnalyticFieldReport'][_0x4d9e('0x3f')]({'where':{'CustomReportId':_0x3e7675['params']['id']}});});}})[_0x4d9e('0x24')](respondWithResult(_0x3a53a2,null))[_0x4d9e('0x45')](handleError(_0x3a53a2,null));}; \ No newline at end of file +var _0xdfe4=['send','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','name','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','bulkCreate','bulkDestroy','ids','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','fs-extra','squel','crypto','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','save','update','then','destroy','error','stack'];(function(_0xe3fb5b,_0x2ee4c3){var _0x2b8d2e=function(_0x2a96f3){while(--_0x2a96f3){_0xe3fb5b['push'](_0xe3fb5b['shift']());}};_0x2b8d2e(++_0x2ee4c3);}(_0xdfe4,0x11a));var _0x4dfe=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xdfe4[_0x49ca18];return _0x145d54;};'use strict';var emlformat=require(_0x4dfe('0x0'));var rimraf=require(_0x4dfe('0x1'));var zipdir=require(_0x4dfe('0x2'));var jsonpatch=require(_0x4dfe('0x3'));var rp=require(_0x4dfe('0x4'));var moment=require('moment');var BPromise=require(_0x4dfe('0x5'));var Mustache=require(_0x4dfe('0x6'));var util=require(_0x4dfe('0x7'));var path=require(_0x4dfe('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4dfe('0x9'));var _=require('lodash');var squel=require(_0x4dfe('0xa'));var crypto=require(_0x4dfe('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x4dfe('0xc'));var toCsv=require(_0x4dfe('0xd'));var querystring=require('querystring');var Papa=require(_0x4dfe('0xe'));var Redis=require('ioredis');var authService=require(_0x4dfe('0xf'));var qs=require(_0x4dfe('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4dfe('0x11'))(_0x4dfe('0x12'));var utils=require('../../config/utils');var config=require(_0x4dfe('0x13'));var licenseUtil=require(_0x4dfe('0x14'));var db=require(_0x4dfe('0x15'))['db'];function respondWithStatusCode(_0x30b342,_0x276810){_0x276810=_0x276810||0xcc;return function(_0x391490){if(_0x391490){return _0x30b342[_0x4dfe('0x16')](_0x276810);}return _0x30b342[_0x4dfe('0x17')](_0x276810)[_0x4dfe('0x18')]();};}function respondWithResult(_0x32c03a,_0x311f70){_0x311f70=_0x311f70||0xc8;return function(_0x8ce64c){if(_0x8ce64c){return _0x32c03a['status'](_0x311f70)[_0x4dfe('0x19')](_0x8ce64c);}};}function respondWithFilteredResult(_0x2ad6d9,_0x15016a){return function(_0x22e6e7){if(_0x22e6e7){var _0x4a38aa=typeof _0x15016a['offset']===_0x4dfe('0x1a')&&typeof _0x15016a[_0x4dfe('0x1b')]===_0x4dfe('0x1a');var _0x5024cd=_0x22e6e7[_0x4dfe('0x1c')];var _0x36ef8c=_0x4a38aa?0x0:_0x15016a[_0x4dfe('0x1d')];var _0x33fa93=_0x4a38aa?_0x22e6e7[_0x4dfe('0x1c')]:_0x15016a[_0x4dfe('0x1d')]+_0x15016a[_0x4dfe('0x1b')];var _0x515d89;if(_0x33fa93>=_0x5024cd){_0x33fa93=_0x5024cd;_0x515d89=0xc8;}else{_0x515d89=0xce;}_0x2ad6d9[_0x4dfe('0x17')](_0x515d89);return _0x2ad6d9[_0x4dfe('0x1e')]('Content-Range',_0x36ef8c+'-'+_0x33fa93+'/'+_0x5024cd)[_0x4dfe('0x19')](_0x22e6e7);}return null;};}function patchUpdates(_0x4bf754){return function(_0x153cf5){try{jsonpatch[_0x4dfe('0x1f')](_0x153cf5,_0x4bf754,!![]);}catch(_0x4bb43d){return BPromise['reject'](_0x4bb43d);}return _0x153cf5[_0x4dfe('0x20')]();};}function saveUpdates(_0x295e68,_0x54b9ea){return function(_0x347304){if(_0x347304){return _0x347304[_0x4dfe('0x21')](_0x295e68)[_0x4dfe('0x22')](function(_0x258415){return _0x258415;});}return null;};}function removeEntity(_0xe2fe1d,_0x5919fb){return function(_0x398fa5){if(_0x398fa5){return _0x398fa5[_0x4dfe('0x23')]()[_0x4dfe('0x22')](function(){_0xe2fe1d[_0x4dfe('0x17')](0xcc)[_0x4dfe('0x18')]();});}};}function handleEntityNotFound(_0x37c320,_0x23f22f){return function(_0x418a46){if(!_0x418a46){_0x37c320[_0x4dfe('0x16')](0x194);}return _0x418a46;};}function handleError(_0x27e269,_0x1a6044){_0x1a6044=_0x1a6044||0x1f4;return function(_0x40bd17){logger[_0x4dfe('0x24')](_0x40bd17[_0x4dfe('0x25')]);if(_0x40bd17['name']){delete _0x40bd17['name'];}_0x27e269[_0x4dfe('0x17')](_0x1a6044)[_0x4dfe('0x26')](_0x40bd17);};}exports[_0x4dfe('0x27')]=function(_0x4ea3f5,_0x5b7ea){var _0x1d08d7={},_0x26d9c5={},_0x47549c={'count':0x0,'rows':[]};var _0x4e3b9d=_[_0x4dfe('0x28')](db[_0x4dfe('0x29')][_0x4dfe('0x2a')],function(_0x3c9824){return{'name':_0x3c9824[_0x4dfe('0x2b')],'type':_0x3c9824[_0x4dfe('0x2c')][_0x4dfe('0x2d')]};});_0x26d9c5['model']=_['map'](_0x4e3b9d,_0x4dfe('0x2e'));_0x26d9c5[_0x4dfe('0x2f')]=_[_0x4dfe('0x30')](_0x4ea3f5[_0x4dfe('0x2f')]);_0x26d9c5[_0x4dfe('0x31')]=_[_0x4dfe('0x32')](_0x26d9c5[_0x4dfe('0x33')],_0x26d9c5[_0x4dfe('0x2f')]);_0x1d08d7[_0x4dfe('0x34')]=_[_0x4dfe('0x32')](_0x26d9c5[_0x4dfe('0x33')],qs[_0x4dfe('0x35')](_0x4ea3f5[_0x4dfe('0x2f')][_0x4dfe('0x35')]));_0x1d08d7[_0x4dfe('0x34')]=_0x1d08d7[_0x4dfe('0x34')]['length']?_0x1d08d7[_0x4dfe('0x34')]:_0x26d9c5[_0x4dfe('0x33')];if(!_0x4ea3f5[_0x4dfe('0x2f')][_0x4dfe('0x36')](_0x4dfe('0x37'))){_0x1d08d7[_0x4dfe('0x1b')]=qs[_0x4dfe('0x1b')](_0x4ea3f5[_0x4dfe('0x2f')][_0x4dfe('0x1b')]);_0x1d08d7[_0x4dfe('0x1d')]=qs[_0x4dfe('0x1d')](_0x4ea3f5[_0x4dfe('0x2f')][_0x4dfe('0x1d')]);}_0x1d08d7['order']=qs[_0x4dfe('0x38')](_0x4ea3f5[_0x4dfe('0x2f')][_0x4dfe('0x38')]);_0x1d08d7[_0x4dfe('0x39')]=qs[_0x4dfe('0x31')](_[_0x4dfe('0x3a')](_0x4ea3f5['query'],_0x26d9c5['filters']),_0x4e3b9d);if(_0x4ea3f5[_0x4dfe('0x2f')][_0x4dfe('0x3b')]){_0x1d08d7['where']=_[_0x4dfe('0x3c')](_0x1d08d7[_0x4dfe('0x39')],{'$or':_[_0x4dfe('0x28')](_0x4e3b9d,function(_0x2bdc79){if(_0x2bdc79[_0x4dfe('0x2c')]!==_0x4dfe('0x3d')){var _0x4c7960={};_0x4c7960[_0x2bdc79[_0x4dfe('0x2e')]]={'$like':'%'+_0x4ea3f5['query'][_0x4dfe('0x3b')]+'%'};return _0x4c7960;}})});}_0x1d08d7=_['merge']({},_0x1d08d7,_0x4ea3f5[_0x4dfe('0x3e')]);var _0x1d030a={'where':_0x1d08d7[_0x4dfe('0x39')]};return db[_0x4dfe('0x29')][_0x4dfe('0x1c')](_0x1d030a)[_0x4dfe('0x22')](function(_0x7a6421){_0x47549c[_0x4dfe('0x1c')]=_0x7a6421;if(_0x4ea3f5[_0x4dfe('0x2f')][_0x4dfe('0x3f')]){_0x1d08d7[_0x4dfe('0x40')]=[{'all':!![]}];}return db[_0x4dfe('0x29')][_0x4dfe('0x41')](_0x1d08d7);})[_0x4dfe('0x22')](function(_0x5ac233){_0x47549c[_0x4dfe('0x42')]=_0x5ac233;return _0x47549c;})[_0x4dfe('0x22')](respondWithFilteredResult(_0x5b7ea,_0x1d08d7))[_0x4dfe('0x43')](handleError(_0x5b7ea,null));};exports[_0x4dfe('0x44')]=function(_0x5bc77e,_0x22c043){var _0x309eec={'raw':![],'where':{'id':_0x5bc77e[_0x4dfe('0x45')]['id']}},_0x4bc0d5={};_0x4bc0d5[_0x4dfe('0x33')]=_['keys'](db['AnalyticFieldReport'][_0x4dfe('0x2a')]);_0x4bc0d5['query']=_[_0x4dfe('0x30')](_0x5bc77e[_0x4dfe('0x2f')]);_0x4bc0d5[_0x4dfe('0x31')]=_[_0x4dfe('0x32')](_0x4bc0d5[_0x4dfe('0x33')],_0x4bc0d5['query']);_0x309eec[_0x4dfe('0x34')]=_[_0x4dfe('0x32')](_0x4bc0d5['model'],qs['fields'](_0x5bc77e[_0x4dfe('0x2f')][_0x4dfe('0x35')]));_0x309eec[_0x4dfe('0x34')]=_0x309eec[_0x4dfe('0x34')][_0x4dfe('0x46')]?_0x309eec[_0x4dfe('0x34')]:_0x4bc0d5[_0x4dfe('0x33')];if(_0x5bc77e[_0x4dfe('0x2f')][_0x4dfe('0x3f')]){_0x309eec['include']=[{'all':!![]}];}_0x309eec=_[_0x4dfe('0x3c')]({},_0x309eec,_0x5bc77e[_0x4dfe('0x3e')]);return db[_0x4dfe('0x29')][_0x4dfe('0x47')](_0x309eec)[_0x4dfe('0x22')](handleEntityNotFound(_0x22c043,null))[_0x4dfe('0x22')](respondWithResult(_0x22c043,null))[_0x4dfe('0x43')](handleError(_0x22c043,null));};exports['create']=function(_0x4addc8,_0x23dc1b){return db[_0x4dfe('0x29')][_0x4dfe('0x48')](_0x4addc8[_0x4dfe('0x49')],{})[_0x4dfe('0x22')](respondWithResult(_0x23dc1b,0xc9))[_0x4dfe('0x43')](handleError(_0x23dc1b,null));};exports[_0x4dfe('0x4a')]=function(_0x48435b,_0x17fa03){return db['AnalyticFieldReport'][_0x4dfe('0x4a')](_0x48435b[_0x4dfe('0x49')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x17fa03,0xc9))[_0x4dfe('0x43')](handleError(_0x17fa03,null));};exports['update']=function(_0x1d6c27,_0x3bb0bb){if(_0x1d6c27[_0x4dfe('0x49')]['id']){delete _0x1d6c27[_0x4dfe('0x49')]['id'];}return db[_0x4dfe('0x29')][_0x4dfe('0x47')]({'where':{'id':_0x1d6c27[_0x4dfe('0x45')]['id']}})[_0x4dfe('0x22')](handleEntityNotFound(_0x3bb0bb,null))[_0x4dfe('0x22')](saveUpdates(_0x1d6c27['body'],null))['then'](respondWithResult(_0x3bb0bb,null))[_0x4dfe('0x43')](handleError(_0x3bb0bb,null));};exports[_0x4dfe('0x23')]=function(_0x2ab389,_0x47a857){return db[_0x4dfe('0x29')]['find']({'where':{'id':_0x2ab389['params']['id']}})[_0x4dfe('0x22')](handleEntityNotFound(_0x47a857,null))[_0x4dfe('0x22')](removeEntity(_0x47a857,null))[_0x4dfe('0x43')](handleError(_0x47a857,null));};exports[_0x4dfe('0x4b')]=function(_0x2c1337,_0x51d460){return db[_0x4dfe('0x29')]['destroy']({'where':{'id':_0x2c1337[_0x4dfe('0x2f')][_0x4dfe('0x4c')]||[]},'raw':![],'individualHooks':!![]})[_0x4dfe('0x22')](respondWithResult(_0x51d460,0xcc))[_0x4dfe('0x43')](handleError(_0x51d460,null));};exports['addFields']=function(_0x3657fc,_0x50e9e1,_0xaa0abd){return db['AnalyticCustomReport']['findOne']({'where':{'id':_0x3657fc['params']['id']}})[_0x4dfe('0x22')](handleEntityNotFound(_0x50e9e1,null))['then'](function(_0x2f999d){if(_0x2f999d){return db[_0x4dfe('0x4d')][_0x4dfe('0x4e')](function(_0x19b00b){return db['AnalyticFieldReport'][_0x4dfe('0x23')]({'where':{'CustomReportId':_0x3657fc['params']['id']},'transaction':_0x19b00b})['then'](function(_0x5e5e55){var _0x16d64e=_[_0x4dfe('0x28')](_0x3657fc['body'],function(_0x2bc798){delete _0x2bc798['id'];_0x2bc798[_0x4dfe('0x4f')]=_0x3657fc[_0x4dfe('0x45')]['id'];return _0x2bc798;});return db['AnalyticFieldReport'][_0x4dfe('0x4a')](_0x16d64e,{'transaction':_0x19b00b});});})[_0x4dfe('0x22')](function(){return db['AnalyticFieldReport'][_0x4dfe('0x41')]({'where':{'CustomReportId':_0x3657fc[_0x4dfe('0x45')]['id']}});});}})[_0x4dfe('0x22')](respondWithResult(_0x50e9e1,null))['catch'](handleError(_0x50e9e1,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 1679b6f..cbab671 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 _0x73f9=['analytics_report_fields','lodash','util','api','bluebird','request-promise','path','rimraf','define','AnalyticFieldReport'];(function(_0x4d8dc3,_0x585fd1){var _0x9b03d9=function(_0x7a31d5){while(--_0x7a31d5){_0x4d8dc3['push'](_0x4d8dc3['shift']());}};_0x9b03d9(++_0x585fd1);}(_0x73f9,0xf1));var _0x973f=function(_0x351579,_0x30565e){_0x351579=_0x351579-0x0;var _0x49f081=_0x73f9[_0x351579];return _0x49f081;};'use strict';var _=require(_0x973f('0x0'));var util=require(_0x973f('0x1'));var logger=require('../../config/logger')(_0x973f('0x2'));var moment=require('moment');var BPromise=require(_0x973f('0x3'));var rp=require(_0x973f('0x4'));var fs=require('fs');var path=require(_0x973f('0x5'));var rimraf=require(_0x973f('0x6'));var config=require('../../config/environment');var attributes=require('./analyticFieldReport.attributes');module['exports']=function(_0x1bd2ac,_0x48e3b5){return _0x1bd2ac[_0x973f('0x7')](_0x973f('0x8'),attributes,{'tableName':_0x973f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2326=['bluebird','path','rimraf','../../config/environment','exports','analytics_report_fields','lodash','util'];(function(_0x16dcd6,_0x547aa4){var _0x49fe35=function(_0x328d09){while(--_0x328d09){_0x16dcd6['push'](_0x16dcd6['shift']());}};_0x49fe35(++_0x547aa4);}(_0x2326,0x6e));var _0x6232=function(_0x7d0db5,_0x3e92e5){_0x7d0db5=_0x7d0db5-0x0;var _0x8ffb01=_0x2326[_0x7d0db5];return _0x8ffb01;};'use strict';var _=require(_0x6232('0x0'));var util=require(_0x6232('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x6232('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6232('0x3'));var rimraf=require(_0x6232('0x4'));var config=require(_0x6232('0x5'));var attributes=require('./analyticFieldReport.attributes');module[_0x6232('0x6')]=function(_0x4d4f8d,_0x426ee1){return _0x4d4f8d['define']('AnalyticFieldReport',attributes,{'tableName':_0x6232('0x7'),'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 ffba23d..10e68ef 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 _0x79f2=['info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x17d3b9,_0x168ca1){var _0x2697e4=function(_0x5ff832){while(--_0x5ff832){_0x17d3b9['push'](_0x17d3b9['shift']());}};_0x2697e4(++_0x168ca1);}(_0x79f2,0xfb));var _0x279f=function(_0x317c7a,_0x31641c){_0x317c7a=_0x317c7a-0x0;var _0x49d02f=_0x79f2[_0x317c7a];return _0x49d02f;};'use strict';var _=require(_0x279f('0x0'));var util=require(_0x279f('0x1'));var moment=require('moment');var BPromise=require(_0x279f('0x2'));var rs=require(_0x279f('0x3'));var fs=require('fs');var Redis=require(_0x279f('0x4'));var db=require(_0x279f('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x279f('0x6'));var config=require(_0x279f('0x7'));var jayson=require(_0x279f('0x8'));var client=jayson[_0x279f('0x9')][_0x279f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x456d81,_0x253a59,_0x3683d6){return new BPromise(function(_0x2d9ef0,_0x180253){return client[_0x279f('0xb')](_0x456d81,_0x3683d6)[_0x279f('0xc')](function(_0x281967){logger[_0x279f('0xd')](_0x279f('0xe'),_0x253a59,_0x279f('0xf'));logger['debug'](_0x279f('0x10'),_0x253a59,_0x279f('0xf'),JSON['stringify'](_0x281967));if(_0x281967[_0x279f('0x11')]){if(_0x281967[_0x279f('0x11')][_0x279f('0x12')]===0x1f4){logger[_0x279f('0x11')](_0x279f('0xe'),_0x253a59,_0x281967['error']['message']);return _0x180253(_0x281967[_0x279f('0x11')][_0x279f('0x13')]);}logger[_0x279f('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x253a59,_0x281967[_0x279f('0x11')][_0x279f('0x13')]);return _0x2d9ef0(_0x281967['error'][_0x279f('0x13')]);}else{logger[_0x279f('0xd')](_0x279f('0xe'),_0x253a59,_0x279f('0xf'));_0x2d9ef0(_0x281967[_0x279f('0x14')][_0x279f('0x13')]);}})[_0x279f('0x15')](function(_0x57175b){logger[_0x279f('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x253a59,_0x57175b);_0x180253(_0x57175b);});});} \ No newline at end of file +var _0x70c1=['randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','AnalyticFieldReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x70c1,0xcb));var _0x170c=function(_0x3364e1,_0x45966d){_0x3364e1=_0x3364e1-0x0;var _0x1e5e03=_0x70c1[_0x3364e1];return _0x1e5e03;};'use strict';var _=require(_0x170c('0x0'));var util=require(_0x170c('0x1'));var moment=require(_0x170c('0x2'));var BPromise=require(_0x170c('0x3'));var rs=require(_0x170c('0x4'));var fs=require('fs');var Redis=require(_0x170c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x170c('0x6'));var logger=require('../../config/logger')(_0x170c('0x7'));var config=require(_0x170c('0x8'));var jayson=require(_0x170c('0x9'));var client=jayson[_0x170c('0xa')][_0x170c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3c8f9f,_0x25348a,_0x3ef8e4){return new BPromise(function(_0x304f2a,_0x267a7a){return client[_0x170c('0xc')](_0x3c8f9f,_0x3ef8e4)['then'](function(_0x5e9a96){logger[_0x170c('0xd')](_0x170c('0xe'),_0x25348a,'request\x20sent');logger[_0x170c('0xf')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x25348a,_0x170c('0x10'),JSON[_0x170c('0x11')](_0x5e9a96));if(_0x5e9a96[_0x170c('0x12')]){if(_0x5e9a96[_0x170c('0x12')][_0x170c('0x13')]===0x1f4){logger[_0x170c('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x25348a,_0x5e9a96[_0x170c('0x12')]['message']);return _0x267a7a(_0x5e9a96[_0x170c('0x12')][_0x170c('0x14')]);}logger[_0x170c('0x12')](_0x170c('0xe'),_0x25348a,_0x5e9a96[_0x170c('0x12')]['message']);return _0x304f2a(_0x5e9a96[_0x170c('0x12')][_0x170c('0x14')]);}else{logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x25348a,'request\x20sent');_0x304f2a(_0x5e9a96[_0x170c('0x15')][_0x170c('0x14')]);}})[_0x170c('0x16')](function(_0x35f205){logger[_0x170c('0x12')](_0x170c('0xe'),_0x25348a,_0x35f205);_0x267a7a(_0x35f205);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index eb73fad..f61bab1 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(_0x491784,_0x4527e8){var _0x2d6ecb=function(_0x2881e3){while(--_0x2881e3){_0x491784['push'](_0x491784['shift']());}};_0x2d6ecb(++_0x4527e8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'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(_0x34f24b,_0x2eff8a){var _0x1026e1=function(_0x2993e1){while(--_0x2993e1){_0x34f24b['push'](_0x34f24b['shift']());}};_0x1026e1(++_0x2eff8a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'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 0687b09..4a7a494 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 _0xc901=['STRING','sequelize','TEXT'];(function(_0x318995,_0x3c241d){var _0x512a01=function(_0x47964f){while(--_0x47964f){_0x318995['push'](_0x318995['shift']());}};_0x512a01(++_0x3c241d);}(_0xc901,0x142));var _0x1c90=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xc901[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require(_0x1c90('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x1c90('0x1')]},'description':{'type':Sequelize[_0x1c90('0x2')]}}; \ No newline at end of file +var _0x049e=['TEXT','STRING','sequelize','exports','name'];(function(_0x5cba0e,_0x4fb1a6){var _0x5e1e19=function(_0x76779c){while(--_0x76779c){_0x5cba0e['push'](_0x5cba0e['shift']());}};_0x5e1e19(++_0x4fb1a6);}(_0x049e,0x16a));var _0xe049=function(_0x55821d,_0x27a22e){_0x55821d=_0x55821d-0x0;var _0x58ea8a=_0x049e[_0x55821d];return _0x58ea8a;};'use strict';var Sequelize=require(_0xe049('0x0'));module[_0xe049('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xe049('0x2')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0xe049('0x3')]},'description':{'type':Sequelize[_0xe049('0x4')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 12ca2e0..9ce5042 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 _0xe14b=['papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','json','apply','save','update','then','get','Metrics','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','fields','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','show','keys','length','includeAll','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','params','eml-format','rimraf','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring'];(function(_0x20882a,_0xaf0f58){var _0x555dc8=function(_0x458a71){while(--_0x458a71){_0x20882a['push'](_0x20882a['shift']());}};_0x555dc8(++_0xaf0f58);}(_0xe14b,0x93));var _0xbe14=function(_0x5eedd2,_0x2da0a5){_0x5eedd2=_0x5eedd2-0x0;var _0x1719e1=_0xe14b[_0x5eedd2];return _0x1719e1;};'use strict';var emlformat=require(_0xbe14('0x0'));var rimraf=require(_0xbe14('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbe14('0x2'));var moment=require(_0xbe14('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xbe14('0x4'));var util=require('util');var path=require('path');var sox=require(_0xbe14('0x5'));var csv=require(_0xbe14('0x6'));var ejs=require(_0xbe14('0x7'));var fs=require('fs');var fs_extra=require(_0xbe14('0x8'));var _=require(_0xbe14('0x9'));var squel=require(_0xbe14('0xa'));var crypto=require(_0xbe14('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbe14('0xc'));var Papa=require(_0xbe14('0xd'));var Redis=require(_0xbe14('0xe'));var authService=require(_0xbe14('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbe14('0x10'));var logger=require(_0xbe14('0x11'))('api');var utils=require(_0xbe14('0x12'));var config=require(_0xbe14('0x13'));var licenseUtil=require(_0xbe14('0x14'));var db=require(_0xbe14('0x15'))['db'];function respondWithStatusCode(_0x27792f,_0x3b898d){_0x3b898d=_0x3b898d||0xcc;return function(_0x23a730){if(_0x23a730){return _0x27792f[_0xbe14('0x16')](_0x3b898d);}return _0x27792f[_0xbe14('0x17')](_0x3b898d)[_0xbe14('0x18')]();};}function respondWithResult(_0x1e4826,_0x33fd54){_0x33fd54=_0x33fd54||0xc8;return function(_0x813399){if(_0x813399){return _0x1e4826['status'](_0x33fd54)['json'](_0x813399);}};}function respondWithFilteredResult(_0x3f58f5,_0x3dc4a9){return function(_0xf4ac9){if(_0xf4ac9){var _0x37ce4e=typeof _0x3dc4a9['offset']===_0xbe14('0x19')&&typeof _0x3dc4a9[_0xbe14('0x1a')]===_0xbe14('0x19');var _0x123ede=_0xf4ac9[_0xbe14('0x1b')];var _0x29ab73=_0x37ce4e?0x0:_0x3dc4a9[_0xbe14('0x1c')];var _0x5ea1f8=_0x37ce4e?_0xf4ac9[_0xbe14('0x1b')]:_0x3dc4a9[_0xbe14('0x1c')]+_0x3dc4a9[_0xbe14('0x1a')];var _0x433459;if(_0x5ea1f8>=_0x123ede){_0x5ea1f8=_0x123ede;_0x433459=0xc8;}else{_0x433459=0xce;}_0x3f58f5[_0xbe14('0x17')](_0x433459);return _0x3f58f5[_0xbe14('0x1d')]('Content-Range',_0x29ab73+'-'+_0x5ea1f8+'/'+_0x123ede)[_0xbe14('0x1e')](_0xf4ac9);}return null;};}function patchUpdates(_0x4a1bbd){return function(_0x417c8d){try{jsonpatch[_0xbe14('0x1f')](_0x417c8d,_0x4a1bbd,!![]);}catch(_0x188ec4){return BPromise['reject'](_0x188ec4);}return _0x417c8d[_0xbe14('0x20')]();};}function saveUpdates(_0x56d845,_0x3c1c85){return function(_0x56e80c){if(_0x56e80c){return _0x56e80c[_0xbe14('0x21')](_0x56d845)['then'](function(_0x274018){return _0x274018;});}return null;};}function removeEntity(_0x3d3608,_0x505dbd){return function(_0x2da350){if(_0x2da350){return _0x2da350['destroy']()[_0xbe14('0x22')](function(){var _0x4851f8=_0x2da350[_0xbe14('0x23')]({'plain':!![]});var _0x5fa043=_0xbe14('0x24');return db[_0xbe14('0x25')][_0xbe14('0x26')]({'where':{'type':_0x5fa043,'resourceId':_0x4851f8['id']}})[_0xbe14('0x22')](function(){return _0x2da350;});})['then'](function(){_0x3d3608[_0xbe14('0x17')](0xcc)[_0xbe14('0x18')]();});}};}function handleEntityNotFound(_0x391556,_0x169369){return function(_0x5dd475){if(!_0x5dd475){_0x391556[_0xbe14('0x16')](0x194);}return _0x5dd475;};}function handleError(_0x29fc64,_0x59bf34){_0x59bf34=_0x59bf34||0x1f4;return function(_0x3c3613){logger[_0xbe14('0x27')](_0x3c3613[_0xbe14('0x28')]);if(_0x3c3613[_0xbe14('0x29')]){delete _0x3c3613[_0xbe14('0x29')];}_0x29fc64[_0xbe14('0x17')](_0x59bf34)[_0xbe14('0x2a')](_0x3c3613);};}exports[_0xbe14('0x2b')]=function(_0x4168c8,_0x16a159){var _0x40538f={},_0x3bf43c={},_0x39dc0a={'count':0x0,'rows':[]};var _0x10ae36=_[_0xbe14('0x2c')](db[_0xbe14('0x2d')][_0xbe14('0x2e')],function(_0x2ff48e){return{'name':_0x2ff48e[_0xbe14('0x2f')],'type':_0x2ff48e[_0xbe14('0x30')]['key']};});_0x3bf43c[_0xbe14('0x31')]=_['map'](_0x10ae36,'name');_0x3bf43c[_0xbe14('0x32')]=_['keys'](_0x4168c8[_0xbe14('0x32')]);_0x3bf43c[_0xbe14('0x33')]=_['intersection'](_0x3bf43c['model'],_0x3bf43c['query']);_0x40538f[_0xbe14('0x34')]=_[_0xbe14('0x35')](_0x3bf43c['model'],qs[_0xbe14('0x36')](_0x4168c8[_0xbe14('0x32')][_0xbe14('0x36')]));_0x40538f[_0xbe14('0x34')]=_0x40538f[_0xbe14('0x34')]['length']?_0x40538f['attributes']:_0x3bf43c[_0xbe14('0x31')];if(!_0x4168c8['query']['hasOwnProperty']('nolimit')){_0x40538f[_0xbe14('0x1a')]=qs[_0xbe14('0x1a')](_0x4168c8[_0xbe14('0x32')][_0xbe14('0x1a')]);_0x40538f[_0xbe14('0x1c')]=qs[_0xbe14('0x1c')](_0x4168c8[_0xbe14('0x32')][_0xbe14('0x1c')]);}_0x40538f[_0xbe14('0x37')]=qs[_0xbe14('0x38')](_0x4168c8[_0xbe14('0x32')][_0xbe14('0x38')]);_0x40538f['where']=qs['filters'](_[_0xbe14('0x39')](_0x4168c8[_0xbe14('0x32')],_0x3bf43c[_0xbe14('0x33')]),_0x10ae36);if(_0x4168c8['query'][_0xbe14('0x3a')]){_0x40538f[_0xbe14('0x3b')]=_[_0xbe14('0x3c')](_0x40538f[_0xbe14('0x3b')],{'$or':_[_0xbe14('0x2c')](_0x10ae36,function(_0x25ee1f){if(_0x25ee1f[_0xbe14('0x30')]!==_0xbe14('0x3d')){var _0x1b2608={};_0x1b2608[_0x25ee1f['name']]={'$like':'%'+_0x4168c8[_0xbe14('0x32')][_0xbe14('0x3a')]+'%'};return _0x1b2608;}})});}_0x40538f=_[_0xbe14('0x3c')]({},_0x40538f,_0x4168c8[_0xbe14('0x3e')]);var _0x3287b9={'where':_0x40538f[_0xbe14('0x3b')]};return db['AnalyticMetric'][_0xbe14('0x1b')](_0x3287b9)[_0xbe14('0x22')](function(_0x1220c9){_0x39dc0a[_0xbe14('0x1b')]=_0x1220c9;if(_0x4168c8['query']['includeAll']){_0x40538f[_0xbe14('0x3f')]=[{'all':!![]}];}return db[_0xbe14('0x2d')][_0xbe14('0x40')](_0x40538f);})['then'](function(_0x5d5318){_0x39dc0a[_0xbe14('0x41')]=_0x5d5318;return _0x39dc0a;})['then'](respondWithFilteredResult(_0x16a159,_0x40538f))['catch'](handleError(_0x16a159,null));};exports[_0xbe14('0x42')]=function(_0x1f0355,_0x8216c3){var _0x5051e4={'raw':!![],'where':{'id':_0x1f0355['params']['id']}},_0x558525={};_0x558525[_0xbe14('0x31')]=_[_0xbe14('0x43')](db[_0xbe14('0x2d')]['rawAttributes']);_0x558525[_0xbe14('0x32')]=_[_0xbe14('0x43')](_0x1f0355[_0xbe14('0x32')]);_0x558525[_0xbe14('0x33')]=_['intersection'](_0x558525['model'],_0x558525[_0xbe14('0x32')]);_0x5051e4[_0xbe14('0x34')]=_[_0xbe14('0x35')](_0x558525[_0xbe14('0x31')],qs[_0xbe14('0x36')](_0x1f0355['query']['fields']));_0x5051e4[_0xbe14('0x34')]=_0x5051e4[_0xbe14('0x34')][_0xbe14('0x44')]?_0x5051e4[_0xbe14('0x34')]:_0x558525['model'];if(_0x1f0355[_0xbe14('0x32')][_0xbe14('0x45')]){_0x5051e4['include']=[{'all':!![]}];}_0x5051e4=_[_0xbe14('0x3c')]({},_0x5051e4,_0x1f0355[_0xbe14('0x3e')]);return db[_0xbe14('0x2d')][_0xbe14('0x46')](_0x5051e4)['then'](handleEntityNotFound(_0x8216c3,null))['then'](respondWithResult(_0x8216c3,null))[_0xbe14('0x47')](handleError(_0x8216c3,null));};exports[_0xbe14('0x48')]=function(_0x4a1a37,_0x5acf90){return db[_0xbe14('0x2d')][_0xbe14('0x48')](_0x4a1a37[_0xbe14('0x49')],{})[_0xbe14('0x22')](function(_0xdbc6e1){var _0xd04fd5=_0x4a1a37[_0xbe14('0x4a')]['get']({'plain':!![]});if(!_0xd04fd5)throw new Error(_0xbe14('0x4b'));if(_0xd04fd5[_0xbe14('0x4c')]===_0xbe14('0x4a')){var _0x22b1f8=_0xdbc6e1[_0xbe14('0x23')]({'plain':!![]});var _0x494c32=_0xbe14('0x24');return db[_0xbe14('0x4d')][_0xbe14('0x46')]({'where':{'name':_0x494c32,'userProfileId':_0xd04fd5[_0xbe14('0x4e')]},'raw':!![]})[_0xbe14('0x22')](function(_0x2dbeb1){if(_0x2dbeb1&&_0x2dbeb1['autoAssociation']===0x0){return db['UserProfileResource'][_0xbe14('0x48')]({'name':_0x22b1f8[_0xbe14('0x29')],'resourceId':_0x22b1f8['id'],'type':_0x2dbeb1[_0xbe14('0x29')],'sectionId':_0x2dbeb1['id']},{})['then'](function(){return _0xdbc6e1;});}else{return _0xdbc6e1;}})['catch'](function(_0x44fe0d){logger[_0xbe14('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x44fe0d);throw _0x44fe0d;});}return _0xdbc6e1;})[_0xbe14('0x22')](respondWithResult(_0x5acf90,0xc9))[_0xbe14('0x47')](handleError(_0x5acf90,null));};exports['update']=function(_0x28f995,_0x4a40d2){if(_0x28f995[_0xbe14('0x49')]['id']){delete _0x28f995[_0xbe14('0x49')]['id'];}return db[_0xbe14('0x2d')]['find']({'where':{'id':_0x28f995[_0xbe14('0x4f')]['id']}})[_0xbe14('0x22')](handleEntityNotFound(_0x4a40d2,null))['then'](saveUpdates(_0x28f995[_0xbe14('0x49')],null))[_0xbe14('0x22')](respondWithResult(_0x4a40d2,null))[_0xbe14('0x47')](handleError(_0x4a40d2,null));};exports[_0xbe14('0x26')]=function(_0x49322f,_0x4f06a3){return db[_0xbe14('0x2d')][_0xbe14('0x46')]({'where':{'id':_0x49322f[_0xbe14('0x4f')]['id']}})[_0xbe14('0x22')](handleEntityNotFound(_0x4f06a3,null))[_0xbe14('0x22')](removeEntity(_0x4f06a3,null))[_0xbe14('0x47')](handleError(_0x4f06a3,null));}; \ No newline at end of file +var _0xdc97=['mustache','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','update','then','get','destroy','sendStatus','error','stack','name','send','AnalyticMetric','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','length','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','includeAll','findAll','rows','catch','params','keys','fields','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Metrics','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','eml-format','rimraf','zip-dir','request-promise','bluebird'];(function(_0x1fca66,_0xa168ce){var _0x3e7c8d=function(_0x496bc0){while(--_0x496bc0){_0x1fca66['push'](_0x1fca66['shift']());}};_0x3e7c8d(++_0xa168ce);}(_0xdc97,0x13b));var _0x7dc9=function(_0x1b7d07,_0x14eb85){_0x1b7d07=_0x1b7d07-0x0;var _0x3de54e=_0xdc97[_0x1b7d07];return _0x3de54e;};'use strict';var emlformat=require(_0x7dc9('0x0'));var rimraf=require(_0x7dc9('0x1'));var zipdir=require(_0x7dc9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7dc9('0x3'));var moment=require('moment');var BPromise=require(_0x7dc9('0x4'));var Mustache=require(_0x7dc9('0x5'));var util=require('util');var path=require(_0x7dc9('0x6'));var sox=require(_0x7dc9('0x7'));var csv=require(_0x7dc9('0x8'));var ejs=require(_0x7dc9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7dc9('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7dc9('0xb'));var deskjs=require(_0x7dc9('0xc'));var toCsv=require(_0x7dc9('0x8'));var querystring=require(_0x7dc9('0xd'));var Papa=require(_0x7dc9('0xe'));var Redis=require('ioredis');var authService=require(_0x7dc9('0xf'));var qs=require(_0x7dc9('0x10'));var as=require(_0x7dc9('0x11'));var hardwareService=require(_0x7dc9('0x12'));var logger=require(_0x7dc9('0x13'))(_0x7dc9('0x14'));var utils=require(_0x7dc9('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x599ef1,_0x94c75a){_0x94c75a=_0x94c75a||0xcc;return function(_0x14e5db){if(_0x14e5db){return _0x599ef1['sendStatus'](_0x94c75a);}return _0x599ef1[_0x7dc9('0x16')](_0x94c75a)[_0x7dc9('0x17')]();};}function respondWithResult(_0xaadf2,_0xf37bc7){_0xf37bc7=_0xf37bc7||0xc8;return function(_0x31d43d){if(_0x31d43d){return _0xaadf2[_0x7dc9('0x16')](_0xf37bc7)['json'](_0x31d43d);}};}function respondWithFilteredResult(_0x3a54f2,_0x278191){return function(_0x1b0aa1){if(_0x1b0aa1){var _0x442819=typeof _0x278191[_0x7dc9('0x18')]===_0x7dc9('0x19')&&typeof _0x278191[_0x7dc9('0x1a')]===_0x7dc9('0x19');var _0x4778d5=_0x1b0aa1['count'];var _0x22577e=_0x442819?0x0:_0x278191['offset'];var _0x1f5906=_0x442819?_0x1b0aa1[_0x7dc9('0x1b')]:_0x278191['offset']+_0x278191[_0x7dc9('0x1a')];var _0x3b738a;if(_0x1f5906>=_0x4778d5){_0x1f5906=_0x4778d5;_0x3b738a=0xc8;}else{_0x3b738a=0xce;}_0x3a54f2[_0x7dc9('0x16')](_0x3b738a);return _0x3a54f2[_0x7dc9('0x1c')](_0x7dc9('0x1d'),_0x22577e+'-'+_0x1f5906+'/'+_0x4778d5)[_0x7dc9('0x1e')](_0x1b0aa1);}return null;};}function patchUpdates(_0x2dad65){return function(_0x2895f5){try{jsonpatch[_0x7dc9('0x1f')](_0x2895f5,_0x2dad65,!![]);}catch(_0x2b38d6){return BPromise['reject'](_0x2b38d6);}return _0x2895f5['save']();};}function saveUpdates(_0x12954f,_0x5981e2){return function(_0x596e0f){if(_0x596e0f){return _0x596e0f[_0x7dc9('0x20')](_0x12954f)[_0x7dc9('0x21')](function(_0x5e9525){return _0x5e9525;});}return null;};}function removeEntity(_0xffc080,_0x43d31f){return function(_0x41110a){if(_0x41110a){return _0x41110a['destroy']()[_0x7dc9('0x21')](function(){var _0x1e3a8d=_0x41110a[_0x7dc9('0x22')]({'plain':!![]});var _0x55a482='Metrics';return db['UserProfileResource'][_0x7dc9('0x23')]({'where':{'type':_0x55a482,'resourceId':_0x1e3a8d['id']}})[_0x7dc9('0x21')](function(){return _0x41110a;});})['then'](function(){_0xffc080['status'](0xcc)[_0x7dc9('0x17')]();});}};}function handleEntityNotFound(_0x5afb7d,_0x2d22eb){return function(_0x1c690b){if(!_0x1c690b){_0x5afb7d[_0x7dc9('0x24')](0x194);}return _0x1c690b;};}function handleError(_0x3e4102,_0xa2aaa9){_0xa2aaa9=_0xa2aaa9||0x1f4;return function(_0x450124){logger[_0x7dc9('0x25')](_0x450124[_0x7dc9('0x26')]);if(_0x450124[_0x7dc9('0x27')]){delete _0x450124[_0x7dc9('0x27')];}_0x3e4102[_0x7dc9('0x16')](_0xa2aaa9)[_0x7dc9('0x28')](_0x450124);};}exports['index']=function(_0x4e929c,_0x513dd6){var _0x49a4a5={},_0x4a68f0={},_0x553a03={'count':0x0,'rows':[]};var _0x58c4e8=_['map'](db[_0x7dc9('0x29')][_0x7dc9('0x2a')],function(_0x29dcef){return{'name':_0x29dcef[_0x7dc9('0x2b')],'type':_0x29dcef[_0x7dc9('0x2c')][_0x7dc9('0x2d')]};});_0x4a68f0['model']=_['map'](_0x58c4e8,'name');_0x4a68f0[_0x7dc9('0x2e')]=_['keys'](_0x4e929c[_0x7dc9('0x2e')]);_0x4a68f0[_0x7dc9('0x2f')]=_[_0x7dc9('0x30')](_0x4a68f0[_0x7dc9('0x31')],_0x4a68f0[_0x7dc9('0x2e')]);_0x49a4a5[_0x7dc9('0x32')]=_[_0x7dc9('0x30')](_0x4a68f0[_0x7dc9('0x31')],qs['fields'](_0x4e929c[_0x7dc9('0x2e')]['fields']));_0x49a4a5[_0x7dc9('0x32')]=_0x49a4a5[_0x7dc9('0x32')][_0x7dc9('0x33')]?_0x49a4a5[_0x7dc9('0x32')]:_0x4a68f0['model'];if(!_0x4e929c[_0x7dc9('0x2e')]['hasOwnProperty'](_0x7dc9('0x34'))){_0x49a4a5['limit']=qs['limit'](_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x1a')]);_0x49a4a5[_0x7dc9('0x18')]=qs[_0x7dc9('0x18')](_0x4e929c['query'][_0x7dc9('0x18')]);}_0x49a4a5[_0x7dc9('0x35')]=qs[_0x7dc9('0x36')](_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x36')]);_0x49a4a5[_0x7dc9('0x37')]=qs[_0x7dc9('0x2f')](_[_0x7dc9('0x38')](_0x4e929c[_0x7dc9('0x2e')],_0x4a68f0[_0x7dc9('0x2f')]),_0x58c4e8);if(_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x39')]){_0x49a4a5['where']=_[_0x7dc9('0x3a')](_0x49a4a5[_0x7dc9('0x37')],{'$or':_[_0x7dc9('0x3b')](_0x58c4e8,function(_0xfd2612){if(_0xfd2612['type']!==_0x7dc9('0x3c')){var _0x89db0e={};_0x89db0e[_0xfd2612[_0x7dc9('0x27')]]={'$like':'%'+_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x39')]+'%'};return _0x89db0e;}})});}_0x49a4a5=_[_0x7dc9('0x3a')]({},_0x49a4a5,_0x4e929c['options']);var _0x553230={'where':_0x49a4a5[_0x7dc9('0x37')]};return db[_0x7dc9('0x29')]['count'](_0x553230)[_0x7dc9('0x21')](function(_0x4a37ec){_0x553a03[_0x7dc9('0x1b')]=_0x4a37ec;if(_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x3d')]){_0x49a4a5['include']=[{'all':!![]}];}return db[_0x7dc9('0x29')][_0x7dc9('0x3e')](_0x49a4a5);})[_0x7dc9('0x21')](function(_0x95513c){_0x553a03[_0x7dc9('0x3f')]=_0x95513c;return _0x553a03;})[_0x7dc9('0x21')](respondWithFilteredResult(_0x513dd6,_0x49a4a5))[_0x7dc9('0x40')](handleError(_0x513dd6,null));};exports['show']=function(_0x187aa6,_0x4f29b2){var _0x52d883={'raw':!![],'where':{'id':_0x187aa6[_0x7dc9('0x41')]['id']}},_0xcced6c={};_0xcced6c[_0x7dc9('0x31')]=_[_0x7dc9('0x42')](db[_0x7dc9('0x29')][_0x7dc9('0x2a')]);_0xcced6c[_0x7dc9('0x2e')]=_[_0x7dc9('0x42')](_0x187aa6[_0x7dc9('0x2e')]);_0xcced6c['filters']=_[_0x7dc9('0x30')](_0xcced6c[_0x7dc9('0x31')],_0xcced6c[_0x7dc9('0x2e')]);_0x52d883[_0x7dc9('0x32')]=_[_0x7dc9('0x30')](_0xcced6c[_0x7dc9('0x31')],qs['fields'](_0x187aa6[_0x7dc9('0x2e')][_0x7dc9('0x43')]));_0x52d883['attributes']=_0x52d883[_0x7dc9('0x32')][_0x7dc9('0x33')]?_0x52d883[_0x7dc9('0x32')]:_0xcced6c['model'];if(_0x187aa6[_0x7dc9('0x2e')]['includeAll']){_0x52d883['include']=[{'all':!![]}];}_0x52d883=_[_0x7dc9('0x3a')]({},_0x52d883,_0x187aa6[_0x7dc9('0x44')]);return db[_0x7dc9('0x29')]['find'](_0x52d883)['then'](handleEntityNotFound(_0x4f29b2,null))[_0x7dc9('0x21')](respondWithResult(_0x4f29b2,null))['catch'](handleError(_0x4f29b2,null));};exports[_0x7dc9('0x45')]=function(_0x4ab558,_0x5e2d59){return db[_0x7dc9('0x29')][_0x7dc9('0x45')](_0x4ab558[_0x7dc9('0x46')],{})[_0x7dc9('0x21')](function(_0x414bf4){var _0x113087=_0x4ab558[_0x7dc9('0x47')][_0x7dc9('0x22')]({'plain':!![]});if(!_0x113087)throw new Error(_0x7dc9('0x48'));if(_0x113087[_0x7dc9('0x49')]===_0x7dc9('0x47')){var _0x13580b=_0x414bf4[_0x7dc9('0x22')]({'plain':!![]});var _0x59be9b=_0x7dc9('0x4a');return db['UserProfileSection']['find']({'where':{'name':_0x59be9b,'userProfileId':_0x113087[_0x7dc9('0x4b')]},'raw':!![]})[_0x7dc9('0x21')](function(_0x40e382){if(_0x40e382&&_0x40e382[_0x7dc9('0x4c')]===0x0){return db[_0x7dc9('0x4d')]['create']({'name':_0x13580b[_0x7dc9('0x27')],'resourceId':_0x13580b['id'],'type':_0x40e382[_0x7dc9('0x27')],'sectionId':_0x40e382['id']},{})[_0x7dc9('0x21')](function(){return _0x414bf4;});}else{return _0x414bf4;}})['catch'](function(_0x341909){logger[_0x7dc9('0x25')](_0x7dc9('0x4e'),_0x341909);throw _0x341909;});}return _0x414bf4;})[_0x7dc9('0x21')](respondWithResult(_0x5e2d59,0xc9))[_0x7dc9('0x40')](handleError(_0x5e2d59,null));};exports[_0x7dc9('0x20')]=function(_0x593132,_0x366b8b){if(_0x593132[_0x7dc9('0x46')]['id']){delete _0x593132[_0x7dc9('0x46')]['id'];}return db[_0x7dc9('0x29')][_0x7dc9('0x4f')]({'where':{'id':_0x593132[_0x7dc9('0x41')]['id']}})[_0x7dc9('0x21')](handleEntityNotFound(_0x366b8b,null))[_0x7dc9('0x21')](saveUpdates(_0x593132[_0x7dc9('0x46')],null))[_0x7dc9('0x21')](respondWithResult(_0x366b8b,null))[_0x7dc9('0x40')](handleError(_0x366b8b,null));};exports[_0x7dc9('0x23')]=function(_0x4fec6e,_0x1767b6){return db[_0x7dc9('0x29')][_0x7dc9('0x4f')]({'where':{'id':_0x4fec6e[_0x7dc9('0x41')]['id']}})[_0x7dc9('0x21')](handleEntityNotFound(_0x1767b6,null))['then'](removeEntity(_0x1767b6,null))[_0x7dc9('0x40')](handleError(_0x1767b6,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index bf1eee9..7d0cd84 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 _0x7c1a=['rimraf','./analyticMetric.attributes','define','AnalyticMetric','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0x7c1a,0x159));var _0xa7c1=function(_0x11af43,_0x26badb){_0x11af43=_0x11af43-0x0;var _0xc26d1=_0x7c1a[_0x11af43];return _0xc26d1;};'use strict';var _=require(_0xa7c1('0x0'));var util=require(_0xa7c1('0x1'));var logger=require(_0xa7c1('0x2'))(_0xa7c1('0x3'));var moment=require(_0xa7c1('0x4'));var BPromise=require(_0xa7c1('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa7c1('0x6'));var rimraf=require(_0xa7c1('0x7'));var config=require('../../config/environment');var attributes=require(_0xa7c1('0x8'));module['exports']=function(_0x3c8e8d,_0xa10122){return _0x3c8e8d[_0xa7c1('0x9')](_0xa7c1('0xa'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9303=['api','bluebird','rimraf','../../config/environment','./analyticMetric.attributes','exports','analytics_metrics','lodash'];(function(_0x514a08,_0x28a8c7){var _0x8da53a=function(_0x547f09){while(--_0x547f09){_0x514a08['push'](_0x514a08['shift']());}};_0x8da53a(++_0x28a8c7);}(_0x9303,0xd7));var _0x3930=function(_0x3d0240,_0x21509a){_0x3d0240=_0x3d0240-0x0;var _0xdf8a7d=_0x9303[_0x3d0240];return _0xdf8a7d;};'use strict';var _=require(_0x3930('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3930('0x1'));var moment=require('moment');var BPromise=require(_0x3930('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3930('0x3'));var config=require(_0x3930('0x4'));var attributes=require(_0x3930('0x5'));module[_0x3930('0x6')]=function(_0x57e19d,_0x44949e){return _0x57e19d['define']('AnalyticMetric',attributes,{'tableName':_0x3930('0x7'),'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 25ccc89..77a5cc1 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 _0xfbf5=['../../config/environment','client','http','request','then','AnalyticMetric,\x20%s,\x20%s','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x57bafc,_0x5b6f89){var _0x3e1d7c=function(_0x210b09){while(--_0x210b09){_0x57bafc['push'](_0x57bafc['shift']());}};_0x3e1d7c(++_0x5b6f89);}(_0xfbf5,0xe7));var _0x5fbf=function(_0x293045,_0x27074d){_0x293045=_0x293045-0x0;var _0x3e2788=_0xfbf5[_0x293045];return _0x3e2788;};'use strict';var _=require(_0x5fbf('0x0'));var util=require(_0x5fbf('0x1'));var moment=require(_0x5fbf('0x2'));var BPromise=require(_0x5fbf('0x3'));var rs=require(_0x5fbf('0x4'));var fs=require('fs');var Redis=require(_0x5fbf('0x5'));var db=require(_0x5fbf('0x6'))['db'];var utils=require(_0x5fbf('0x7'));var logger=require(_0x5fbf('0x8'))('rpc');var config=require(_0x5fbf('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x5fbf('0xa')][_0x5fbf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x387772,_0x520095,_0x1efc61){return new BPromise(function(_0x14acef,_0xc06237){return client[_0x5fbf('0xc')](_0x387772,_0x1efc61)[_0x5fbf('0xd')](function(_0x2fadb6){logger['info'](_0x5fbf('0xe'),_0x520095,'request\x20sent');logger[_0x5fbf('0xf')](_0x5fbf('0x10'),_0x520095,_0x5fbf('0x11'),JSON[_0x5fbf('0x12')](_0x2fadb6));if(_0x2fadb6[_0x5fbf('0x13')]){if(_0x2fadb6[_0x5fbf('0x13')][_0x5fbf('0x14')]===0x1f4){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x520095,_0x2fadb6[_0x5fbf('0x13')]['message']);return _0xc06237(_0x2fadb6[_0x5fbf('0x13')][_0x5fbf('0x15')]);}logger[_0x5fbf('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0x520095,_0x2fadb6['error'][_0x5fbf('0x15')]);return _0x14acef(_0x2fadb6[_0x5fbf('0x13')][_0x5fbf('0x15')]);}else{logger[_0x5fbf('0x16')](_0x5fbf('0xe'),_0x520095,'request\x20sent');_0x14acef(_0x2fadb6['result'][_0x5fbf('0x15')]);}})[_0x5fbf('0x17')](function(_0x24af29){logger[_0x5fbf('0x13')](_0x5fbf('0xe'),_0x520095,_0x24af29);_0xc06237(_0x24af29);});});} \ No newline at end of file +var _0xc72c=['debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticMetric,\x20%s,\x20%s','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','request\x20sent'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xc72c,0x119));var _0xcc72=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0xc72c[_0x334841];return _0x5beb4b;};'use strict';var _=require(_0xcc72('0x0'));var util=require('util');var moment=require(_0xcc72('0x1'));var BPromise=require(_0xcc72('0x2'));var rs=require(_0xcc72('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcc72('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xcc72('0x5'))(_0xcc72('0x6'));var config=require(_0xcc72('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xcc72('0x8')][_0xcc72('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x570b04,_0x2f5728,_0x282c6b){return new BPromise(function(_0x2d302b,_0x3cee4f){return client[_0xcc72('0xa')](_0x570b04,_0x282c6b)[_0xcc72('0xb')](function(_0x4306f5){logger['info']('AnalyticMetric,\x20%s,\x20%s',_0x2f5728,_0xcc72('0xc'));logger[_0xcc72('0xd')](_0xcc72('0xe'),_0x2f5728,_0xcc72('0xc'),JSON[_0xcc72('0xf')](_0x4306f5));if(_0x4306f5['error']){if(_0x4306f5[_0xcc72('0x10')][_0xcc72('0x11')]===0x1f4){logger[_0xcc72('0x10')](_0xcc72('0x12'),_0x2f5728,_0x4306f5['error'][_0xcc72('0x13')]);return _0x3cee4f(_0x4306f5[_0xcc72('0x10')]['message']);}logger[_0xcc72('0x10')](_0xcc72('0x12'),_0x2f5728,_0x4306f5['error'][_0xcc72('0x13')]);return _0x2d302b(_0x4306f5[_0xcc72('0x10')][_0xcc72('0x13')]);}else{logger['info'](_0xcc72('0x12'),_0x2f5728,_0xcc72('0xc'));_0x2d302b(_0x4306f5[_0xcc72('0x14')][_0xcc72('0x13')]);}})['catch'](function(_0x20518a){logger[_0xcc72('0x10')](_0xcc72('0x12'),_0x2f5728,_0x20518a);_0x3cee4f(_0x20518a);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 32d4fc7..e17ed57 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 _0x51f2=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticMetric.controller','get','isAuthenticated','index','show','post','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x51f2,0xeb));var _0x251f=function(_0x3bd53a,_0x134fbb){_0x3bd53a=_0x3bd53a-0x0;var _0x363152=_0x51f2[_0x3bd53a];return _0x363152;};'use strict';var multer=require(_0x251f('0x0'));var util=require(_0x251f('0x1'));var path=require(_0x251f('0x2'));var timeout=require(_0x251f('0x3'));var express=require(_0x251f('0x4'));var router=express[_0x251f('0x5')]();var fs_extra=require(_0x251f('0x6'));var auth=require(_0x251f('0x7'));var interaction=require(_0x251f('0x8'));var config=require('../../config/environment');var controller=require(_0x251f('0x9'));router[_0x251f('0xa')]('/',auth[_0x251f('0xb')](),controller[_0x251f('0xc')]);router[_0x251f('0xa')]('/:id',auth[_0x251f('0xb')](),controller[_0x251f('0xd')]);router[_0x251f('0xe')]('/',auth[_0x251f('0xb')](),controller['create']);router[_0x251f('0xf')](_0x251f('0x10'),auth[_0x251f('0xb')](),controller[_0x251f('0x11')]);router['delete'](_0x251f('0x10'),auth[_0x251f('0xb')](),controller[_0x251f('0x12')]);module[_0x251f('0x13')]=router; \ No newline at end of file +var _0xa423=['post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','show'];(function(_0x2d9881,_0x450fab){var _0x144e1e=function(_0x51ff65){while(--_0x51ff65){_0x2d9881['push'](_0x2d9881['shift']());}};_0x144e1e(++_0x450fab);}(_0xa423,0x16c));var _0x3a42=function(_0x5a3ba1,_0x23c154){_0x5a3ba1=_0x5a3ba1-0x0;var _0x5dcc34=_0xa423[_0x5a3ba1];return _0x5dcc34;};'use strict';var multer=require(_0x3a42('0x0'));var util=require(_0x3a42('0x1'));var path=require(_0x3a42('0x2'));var timeout=require(_0x3a42('0x3'));var express=require(_0x3a42('0x4'));var router=express['Router']();var fs_extra=require(_0x3a42('0x5'));var auth=require(_0x3a42('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x3a42('0x7'));var controller=require(_0x3a42('0x8'));router[_0x3a42('0x9')]('/',auth[_0x3a42('0xa')](),controller[_0x3a42('0xb')]);router['get'](_0x3a42('0xc'),auth[_0x3a42('0xa')](),controller[_0x3a42('0xd')]);router[_0x3a42('0xe')]('/',auth[_0x3a42('0xa')](),controller[_0x3a42('0xf')]);router[_0x3a42('0x10')](_0x3a42('0xc'),auth[_0x3a42('0xa')](),controller[_0x3a42('0x11')]);router[_0x3a42('0x12')]('/:id',auth[_0x3a42('0xa')](),controller[_0x3a42('0x13')]);module[_0x3a42('0x14')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 07ae6eb..31ce2a9 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 _0xb7a9=['sequelize','exports','TEXT'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xb7a9,0x9c));var _0x9b7a=function(_0x22c14b,_0x1bfd98){_0x22c14b=_0x22c14b-0x0;var _0x198e98=_0xb7a9[_0x22c14b];return _0x198e98;};'use strict';var Sequelize=require(_0x9b7a('0x0'));module[_0x9b7a('0x1')]={'tree':{'type':Sequelize[_0x9b7a('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x6104=['exports','TEXT'];(function(_0x4d2cfd,_0x4e3fc0){var _0x50cff9=function(_0xc35646){while(--_0xc35646){_0x4d2cfd['push'](_0x4d2cfd['shift']());}};_0x50cff9(++_0x4e3fc0);}(_0x6104,0x19c));var _0x4610=function(_0x221978,_0x6cb2d5){_0x221978=_0x221978-0x0;var _0x5be5b2=_0x6104[_0x221978];return _0x5be5b2;};'use strict';var Sequelize=require('sequelize');module[_0x4610('0x0')]={'tree':{'type':Sequelize[_0x4610('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 2789122..0994c89 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 _0x1100=['../../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','update','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','AnalyticTreeReport','rows','catch','params','options','find','body','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'];(function(_0x20b082,_0x1d2498){var _0x3ce60f=function(_0x93c5df){while(--_0x93c5df){_0x20b082['push'](_0x20b082['shift']());}};_0x3ce60f(++_0x1d2498);}(_0x1100,0x1c0));var _0x0110=function(_0x526a80,_0x25fd97){_0x526a80=_0x526a80-0x0;var _0x4d5e2a=_0x1100[_0x526a80];return _0x4d5e2a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0110('0x0'));var jsonpatch=require(_0x0110('0x1'));var rp=require(_0x0110('0x2'));var moment=require(_0x0110('0x3'));var BPromise=require(_0x0110('0x4'));var Mustache=require(_0x0110('0x5'));var util=require(_0x0110('0x6'));var path=require(_0x0110('0x7'));var sox=require(_0x0110('0x8'));var csv=require(_0x0110('0x9'));var ejs=require(_0x0110('0xa'));var fs=require('fs');var fs_extra=require(_0x0110('0xb'));var _=require(_0x0110('0xc'));var squel=require(_0x0110('0xd'));var crypto=require(_0x0110('0xe'));var jsforce=require(_0x0110('0xf'));var deskjs=require(_0x0110('0x10'));var toCsv=require(_0x0110('0x9'));var querystring=require(_0x0110('0x11'));var Papa=require(_0x0110('0x12'));var Redis=require(_0x0110('0x13'));var authService=require(_0x0110('0x14'));var qs=require(_0x0110('0x15'));var as=require(_0x0110('0x16'));var hardwareService=require(_0x0110('0x17'));var logger=require(_0x0110('0x18'))(_0x0110('0x19'));var utils=require(_0x0110('0x1a'));var config=require(_0x0110('0x1b'));var licenseUtil=require(_0x0110('0x1c'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1240c2,_0x45609f){_0x45609f=_0x45609f||0xcc;return function(_0x3e534b){if(_0x3e534b){return _0x1240c2[_0x0110('0x1d')](_0x45609f);}return _0x1240c2[_0x0110('0x1e')](_0x45609f)[_0x0110('0x1f')]();};}function respondWithResult(_0x175e4f,_0x5f5941){_0x5f5941=_0x5f5941||0xc8;return function(_0x231c6f){if(_0x231c6f){return _0x175e4f['status'](_0x5f5941)[_0x0110('0x20')](_0x231c6f);}};}function respondWithFilteredResult(_0x290a12,_0x17e7b3){return function(_0x2e5eaf){if(_0x2e5eaf){var _0x218a19=typeof _0x17e7b3[_0x0110('0x21')]===_0x0110('0x22')&&typeof _0x17e7b3[_0x0110('0x23')]==='undefined';var _0x97075d=_0x2e5eaf['count'];var _0x2bb1de=_0x218a19?0x0:_0x17e7b3[_0x0110('0x21')];var _0x39e034=_0x218a19?_0x2e5eaf[_0x0110('0x24')]:_0x17e7b3['offset']+_0x17e7b3['limit'];var _0x2e5f96;if(_0x39e034>=_0x97075d){_0x39e034=_0x97075d;_0x2e5f96=0xc8;}else{_0x2e5f96=0xce;}_0x290a12['status'](_0x2e5f96);return _0x290a12[_0x0110('0x25')](_0x0110('0x26'),_0x2bb1de+'-'+_0x39e034+'/'+_0x97075d)[_0x0110('0x20')](_0x2e5eaf);}return null;};}function patchUpdates(_0x5390fa){return function(_0x55d425){try{jsonpatch['apply'](_0x55d425,_0x5390fa,!![]);}catch(_0x599427){return BPromise[_0x0110('0x27')](_0x599427);}return _0x55d425['save']();};}function saveUpdates(_0x3af265,_0x3f285e){return function(_0x27677){if(_0x27677){return _0x27677[_0x0110('0x28')](_0x3af265)[_0x0110('0x29')](function(_0x290c46){return _0x290c46;});}return null;};}function removeEntity(_0x4b8609,_0x54cd91){return function(_0x4f6cfa){if(_0x4f6cfa){return _0x4f6cfa[_0x0110('0x2a')]()['then'](function(){_0x4b8609[_0x0110('0x1e')](0xcc)[_0x0110('0x1f')]();});}};}function handleEntityNotFound(_0x3cc04a,_0x4d0a1d){return function(_0x2a7031){if(!_0x2a7031){_0x3cc04a[_0x0110('0x1d')](0x194);}return _0x2a7031;};}function handleError(_0x1fa22c,_0x55c47f){_0x55c47f=_0x55c47f||0x1f4;return function(_0x4f1f73){logger[_0x0110('0x2b')](_0x4f1f73[_0x0110('0x2c')]);if(_0x4f1f73[_0x0110('0x2d')]){delete _0x4f1f73[_0x0110('0x2d')];}_0x1fa22c[_0x0110('0x1e')](_0x55c47f)[_0x0110('0x2e')](_0x4f1f73);};}exports['index']=function(_0x56b918,_0x10bd8a){var _0x52e95a={},_0x3f1b67={},_0x64a9f3={'count':0x0,'rows':[]};var _0x367391=_[_0x0110('0x2f')](db['AnalyticTreeReport'][_0x0110('0x30')],function(_0x3f1b0b){return{'name':_0x3f1b0b[_0x0110('0x31')],'type':_0x3f1b0b[_0x0110('0x32')][_0x0110('0x33')]};});_0x3f1b67['model']=_[_0x0110('0x2f')](_0x367391,_0x0110('0x2d'));_0x3f1b67[_0x0110('0x34')]=_[_0x0110('0x35')](_0x56b918[_0x0110('0x34')]);_0x3f1b67[_0x0110('0x36')]=_[_0x0110('0x37')](_0x3f1b67['model'],_0x3f1b67[_0x0110('0x34')]);_0x52e95a[_0x0110('0x38')]=_['intersection'](_0x3f1b67[_0x0110('0x39')],qs[_0x0110('0x3a')](_0x56b918[_0x0110('0x34')][_0x0110('0x3a')]));_0x52e95a[_0x0110('0x38')]=_0x52e95a[_0x0110('0x38')][_0x0110('0x3b')]?_0x52e95a[_0x0110('0x38')]:_0x3f1b67[_0x0110('0x39')];if(!_0x56b918[_0x0110('0x34')][_0x0110('0x3c')](_0x0110('0x3d'))){_0x52e95a[_0x0110('0x23')]=qs[_0x0110('0x23')](_0x56b918[_0x0110('0x34')][_0x0110('0x23')]);_0x52e95a[_0x0110('0x21')]=qs['offset'](_0x56b918[_0x0110('0x34')][_0x0110('0x21')]);}_0x52e95a[_0x0110('0x3e')]=qs[_0x0110('0x3f')](_0x56b918[_0x0110('0x34')]['sort']);_0x52e95a['where']=qs[_0x0110('0x36')](_[_0x0110('0x40')](_0x56b918['query'],_0x3f1b67[_0x0110('0x36')]),_0x367391);if(_0x56b918[_0x0110('0x34')][_0x0110('0x41')]){_0x52e95a[_0x0110('0x42')]=_[_0x0110('0x43')](_0x52e95a[_0x0110('0x42')],{'$or':_[_0x0110('0x2f')](_0x367391,function(_0x59c7f6){if(_0x59c7f6[_0x0110('0x32')]!==_0x0110('0x44')){var _0x1c1f9c={};_0x1c1f9c[_0x59c7f6[_0x0110('0x2d')]]={'$like':'%'+_0x56b918['query'][_0x0110('0x41')]+'%'};return _0x1c1f9c;}})});}_0x52e95a=_[_0x0110('0x43')]({},_0x52e95a,_0x56b918['options']);var _0x316497={'where':_0x52e95a['where']};return db['AnalyticTreeReport'][_0x0110('0x24')](_0x316497)[_0x0110('0x29')](function(_0x428d2f){_0x64a9f3[_0x0110('0x24')]=_0x428d2f;if(_0x56b918['query'][_0x0110('0x45')]){_0x52e95a[_0x0110('0x46')]=[{'all':!![]}];}return db[_0x0110('0x47')]['findAll'](_0x52e95a);})[_0x0110('0x29')](function(_0x4a9289){_0x64a9f3[_0x0110('0x48')]=_0x4a9289;return _0x64a9f3;})[_0x0110('0x29')](respondWithFilteredResult(_0x10bd8a,_0x52e95a))[_0x0110('0x49')](handleError(_0x10bd8a,null));};exports['show']=function(_0x532b95,_0x287435){var _0x5f5758={'raw':!![],'where':{'id':_0x532b95[_0x0110('0x4a')]['id']}},_0xf47389={};_0xf47389['model']=_[_0x0110('0x35')](db[_0x0110('0x47')][_0x0110('0x30')]);_0xf47389[_0x0110('0x34')]=_['keys'](_0x532b95['query']);_0xf47389[_0x0110('0x36')]=_[_0x0110('0x37')](_0xf47389[_0x0110('0x39')],_0xf47389[_0x0110('0x34')]);_0x5f5758[_0x0110('0x38')]=_[_0x0110('0x37')](_0xf47389[_0x0110('0x39')],qs[_0x0110('0x3a')](_0x532b95[_0x0110('0x34')][_0x0110('0x3a')]));_0x5f5758[_0x0110('0x38')]=_0x5f5758['attributes'][_0x0110('0x3b')]?_0x5f5758[_0x0110('0x38')]:_0xf47389[_0x0110('0x39')];if(_0x532b95[_0x0110('0x34')]['includeAll']){_0x5f5758[_0x0110('0x46')]=[{'all':!![]}];}_0x5f5758=_[_0x0110('0x43')]({},_0x5f5758,_0x532b95[_0x0110('0x4b')]);return db[_0x0110('0x47')][_0x0110('0x4c')](_0x5f5758)[_0x0110('0x29')](handleEntityNotFound(_0x287435,null))[_0x0110('0x29')](respondWithResult(_0x287435,null))[_0x0110('0x49')](handleError(_0x287435,null));};exports['create']=function(_0x2c33b5,_0x14836c){return db[_0x0110('0x47')]['create'](_0x2c33b5[_0x0110('0x4d')],{})[_0x0110('0x29')](respondWithResult(_0x14836c,0xc9))[_0x0110('0x49')](handleError(_0x14836c,null));};exports[_0x0110('0x28')]=function(_0x3bdda7,_0x42fa4d){if(_0x3bdda7[_0x0110('0x4d')]['id']){delete _0x3bdda7['body']['id'];}return db[_0x0110('0x47')][_0x0110('0x4c')]({'where':{'id':_0x3bdda7[_0x0110('0x4a')]['id']}})[_0x0110('0x29')](handleEntityNotFound(_0x42fa4d,null))[_0x0110('0x29')](saveUpdates(_0x3bdda7[_0x0110('0x4d')],null))[_0x0110('0x29')](respondWithResult(_0x42fa4d,null))[_0x0110('0x49')](handleError(_0x42fa4d,null));};exports[_0x0110('0x2a')]=function(_0x2be901,_0x8364ec){return db[_0x0110('0x47')][_0x0110('0x4c')]({'where':{'id':_0x2be901[_0x0110('0x4a')]['id']}})[_0x0110('0x29')](handleEntityNotFound(_0x8364ec,null))[_0x0110('0x29')](removeEntity(_0x8364ec,null))[_0x0110('0x49')](handleError(_0x8364ec,null));}; \ No newline at end of file +var _0x53e8=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','json','apply','reject','save','update','then','error','stack','name','send','index','AnalyticTreeReport','rawAttributes','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','keys','include','find','catch','create','body','eml-format','fast-json-patch','request-promise','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service'];(function(_0x2a789c,_0xa0544e){var _0x3a6503=function(_0xf7f1c0){while(--_0xf7f1c0){_0x2a789c['push'](_0x2a789c['shift']());}};_0x3a6503(++_0xa0544e);}(_0x53e8,0x1e8));var _0x853e=function(_0xe66cf2,_0x32ba5f){_0xe66cf2=_0xe66cf2-0x0;var _0x2d84e7=_0x53e8[_0xe66cf2];return _0x2d84e7;};'use strict';var emlformat=require(_0x853e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x853e('0x1'));var rp=require(_0x853e('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x853e('0x3'));var util=require(_0x853e('0x4'));var path=require(_0x853e('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x853e('0x6'));var fs=require('fs');var fs_extra=require(_0x853e('0x7'));var _=require(_0x853e('0x8'));var squel=require(_0x853e('0x9'));var crypto=require(_0x853e('0xa'));var jsforce=require(_0x853e('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x853e('0xc'));var querystring=require('querystring');var Papa=require(_0x853e('0xd'));var Redis=require(_0x853e('0xe'));var authService=require(_0x853e('0xf'));var qs=require(_0x853e('0x10'));var as=require(_0x853e('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x853e('0x12'))(_0x853e('0x13'));var utils=require(_0x853e('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x853e('0x15'))['db'];function respondWithStatusCode(_0x1a5a65,_0x848f1d){_0x848f1d=_0x848f1d||0xcc;return function(_0x4a29dd){if(_0x4a29dd){return _0x1a5a65[_0x853e('0x16')](_0x848f1d);}return _0x1a5a65['status'](_0x848f1d)[_0x853e('0x17')]();};}function respondWithResult(_0x59730a,_0x29c2ba){_0x29c2ba=_0x29c2ba||0xc8;return function(_0xcfff5c){if(_0xcfff5c){return _0x59730a[_0x853e('0x18')](_0x29c2ba)['json'](_0xcfff5c);}};}function respondWithFilteredResult(_0xe06b97,_0x424d6d){return function(_0xb15a9){if(_0xb15a9){var _0x50049e=typeof _0x424d6d[_0x853e('0x19')]===_0x853e('0x1a')&&typeof _0x424d6d[_0x853e('0x1b')]===_0x853e('0x1a');var _0x52d761=_0xb15a9['count'];var _0x4af67e=_0x50049e?0x0:_0x424d6d[_0x853e('0x19')];var _0x5edd52=_0x50049e?_0xb15a9[_0x853e('0x1c')]:_0x424d6d[_0x853e('0x19')]+_0x424d6d[_0x853e('0x1b')];var _0x2da307;if(_0x5edd52>=_0x52d761){_0x5edd52=_0x52d761;_0x2da307=0xc8;}else{_0x2da307=0xce;}_0xe06b97[_0x853e('0x18')](_0x2da307);return _0xe06b97[_0x853e('0x1d')]('Content-Range',_0x4af67e+'-'+_0x5edd52+'/'+_0x52d761)[_0x853e('0x1e')](_0xb15a9);}return null;};}function patchUpdates(_0x2f7eaa){return function(_0x452fa7){try{jsonpatch[_0x853e('0x1f')](_0x452fa7,_0x2f7eaa,!![]);}catch(_0x1766f5){return BPromise[_0x853e('0x20')](_0x1766f5);}return _0x452fa7[_0x853e('0x21')]();};}function saveUpdates(_0x139b67,_0x243b7c){return function(_0x4b9110){if(_0x4b9110){return _0x4b9110[_0x853e('0x22')](_0x139b67)[_0x853e('0x23')](function(_0x4e9bfc){return _0x4e9bfc;});}return null;};}function removeEntity(_0x467323,_0x227123){return function(_0x38ae8d){if(_0x38ae8d){return _0x38ae8d['destroy']()[_0x853e('0x23')](function(){_0x467323[_0x853e('0x18')](0xcc)[_0x853e('0x17')]();});}};}function handleEntityNotFound(_0x2eb88f,_0x30b208){return function(_0xe71bcf){if(!_0xe71bcf){_0x2eb88f[_0x853e('0x16')](0x194);}return _0xe71bcf;};}function handleError(_0x590cb8,_0x579621){_0x579621=_0x579621||0x1f4;return function(_0x5e52c9){logger[_0x853e('0x24')](_0x5e52c9[_0x853e('0x25')]);if(_0x5e52c9[_0x853e('0x26')]){delete _0x5e52c9[_0x853e('0x26')];}_0x590cb8[_0x853e('0x18')](_0x579621)[_0x853e('0x27')](_0x5e52c9);};}exports[_0x853e('0x28')]=function(_0x94a1a7,_0x15d07f){var _0x4be701={},_0x2e7af6={},_0x3a8e2e={'count':0x0,'rows':[]};var _0x18148d=_['map'](db[_0x853e('0x29')][_0x853e('0x2a')],function(_0x5467be){return{'name':_0x5467be[_0x853e('0x2b')],'type':_0x5467be[_0x853e('0x2c')]['key']};});_0x2e7af6[_0x853e('0x2d')]=_[_0x853e('0x2e')](_0x18148d,_0x853e('0x26'));_0x2e7af6[_0x853e('0x2f')]=_['keys'](_0x94a1a7['query']);_0x2e7af6[_0x853e('0x30')]=_[_0x853e('0x31')](_0x2e7af6[_0x853e('0x2d')],_0x2e7af6[_0x853e('0x2f')]);_0x4be701[_0x853e('0x32')]=_[_0x853e('0x31')](_0x2e7af6[_0x853e('0x2d')],qs['fields'](_0x94a1a7[_0x853e('0x2f')][_0x853e('0x33')]));_0x4be701['attributes']=_0x4be701[_0x853e('0x32')][_0x853e('0x34')]?_0x4be701[_0x853e('0x32')]:_0x2e7af6[_0x853e('0x2d')];if(!_0x94a1a7[_0x853e('0x2f')][_0x853e('0x35')]('nolimit')){_0x4be701[_0x853e('0x1b')]=qs[_0x853e('0x1b')](_0x94a1a7[_0x853e('0x2f')][_0x853e('0x1b')]);_0x4be701['offset']=qs[_0x853e('0x19')](_0x94a1a7[_0x853e('0x2f')][_0x853e('0x19')]);}_0x4be701['order']=qs[_0x853e('0x36')](_0x94a1a7[_0x853e('0x2f')][_0x853e('0x36')]);_0x4be701[_0x853e('0x37')]=qs[_0x853e('0x30')](_[_0x853e('0x38')](_0x94a1a7[_0x853e('0x2f')],_0x2e7af6[_0x853e('0x30')]),_0x18148d);if(_0x94a1a7[_0x853e('0x2f')][_0x853e('0x39')]){_0x4be701['where']=_[_0x853e('0x3a')](_0x4be701[_0x853e('0x37')],{'$or':_[_0x853e('0x2e')](_0x18148d,function(_0x1d0597){if(_0x1d0597['type']!==_0x853e('0x3b')){var _0x546d5b={};_0x546d5b[_0x1d0597[_0x853e('0x26')]]={'$like':'%'+_0x94a1a7[_0x853e('0x2f')][_0x853e('0x39')]+'%'};return _0x546d5b;}})});}_0x4be701=_[_0x853e('0x3a')]({},_0x4be701,_0x94a1a7[_0x853e('0x3c')]);var _0x2079b0={'where':_0x4be701['where']};return db['AnalyticTreeReport'][_0x853e('0x1c')](_0x2079b0)['then'](function(_0x124ed5){_0x3a8e2e[_0x853e('0x1c')]=_0x124ed5;if(_0x94a1a7[_0x853e('0x2f')][_0x853e('0x3d')]){_0x4be701['include']=[{'all':!![]}];}return db[_0x853e('0x29')][_0x853e('0x3e')](_0x4be701);})[_0x853e('0x23')](function(_0x230676){_0x3a8e2e[_0x853e('0x3f')]=_0x230676;return _0x3a8e2e;})[_0x853e('0x23')](respondWithFilteredResult(_0x15d07f,_0x4be701))['catch'](handleError(_0x15d07f,null));};exports[_0x853e('0x40')]=function(_0x5f0b9d,_0x2b679a){var _0xc206cc={'raw':!![],'where':{'id':_0x5f0b9d[_0x853e('0x41')]['id']}},_0x4443a6={};_0x4443a6['model']=_[_0x853e('0x42')](db[_0x853e('0x29')][_0x853e('0x2a')]);_0x4443a6['query']=_[_0x853e('0x42')](_0x5f0b9d[_0x853e('0x2f')]);_0x4443a6['filters']=_[_0x853e('0x31')](_0x4443a6['model'],_0x4443a6[_0x853e('0x2f')]);_0xc206cc['attributes']=_[_0x853e('0x31')](_0x4443a6['model'],qs[_0x853e('0x33')](_0x5f0b9d['query']['fields']));_0xc206cc[_0x853e('0x32')]=_0xc206cc[_0x853e('0x32')][_0x853e('0x34')]?_0xc206cc[_0x853e('0x32')]:_0x4443a6[_0x853e('0x2d')];if(_0x5f0b9d['query'][_0x853e('0x3d')]){_0xc206cc[_0x853e('0x43')]=[{'all':!![]}];}_0xc206cc=_[_0x853e('0x3a')]({},_0xc206cc,_0x5f0b9d[_0x853e('0x3c')]);return db['AnalyticTreeReport'][_0x853e('0x44')](_0xc206cc)['then'](handleEntityNotFound(_0x2b679a,null))['then'](respondWithResult(_0x2b679a,null))[_0x853e('0x45')](handleError(_0x2b679a,null));};exports['create']=function(_0x41d778,_0xd2a3fb){return db['AnalyticTreeReport'][_0x853e('0x46')](_0x41d778[_0x853e('0x47')],{})[_0x853e('0x23')](respondWithResult(_0xd2a3fb,0xc9))[_0x853e('0x45')](handleError(_0xd2a3fb,null));};exports[_0x853e('0x22')]=function(_0xefb813,_0x4e3453){if(_0xefb813['body']['id']){delete _0xefb813[_0x853e('0x47')]['id'];}return db[_0x853e('0x29')][_0x853e('0x44')]({'where':{'id':_0xefb813[_0x853e('0x41')]['id']}})[_0x853e('0x23')](handleEntityNotFound(_0x4e3453,null))[_0x853e('0x23')](saveUpdates(_0xefb813['body'],null))['then'](respondWithResult(_0x4e3453,null))[_0x853e('0x45')](handleError(_0x4e3453,null));};exports['destroy']=function(_0x20b31d,_0x32bef6){return db['AnalyticTreeReport'][_0x853e('0x44')]({'where':{'id':_0x20b31d[_0x853e('0x41')]['id']}})[_0x853e('0x23')](handleEntityNotFound(_0x32bef6,null))[_0x853e('0x23')](removeEntity(_0x32bef6,null))[_0x853e('0x45')](handleError(_0x32bef6,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index d073c75..a6fe75e 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 _0x294a=['request-promise','path','rimraf','../../config/environment','exports','define','AnalyticTreeReport','lodash','../../config/logger','api','moment'];(function(_0x45f951,_0x2750c8){var _0x24756c=function(_0x31c931){while(--_0x31c931){_0x45f951['push'](_0x45f951['shift']());}};_0x24756c(++_0x2750c8);}(_0x294a,0x1d5));var _0xa294=function(_0x11314c,_0x2ca8d7){_0x11314c=_0x11314c-0x0;var _0x12cb4a=_0x294a[_0x11314c];return _0x12cb4a;};'use strict';var _=require(_0xa294('0x0'));var util=require('util');var logger=require(_0xa294('0x1'))(_0xa294('0x2'));var moment=require(_0xa294('0x3'));var BPromise=require('bluebird');var rp=require(_0xa294('0x4'));var fs=require('fs');var path=require(_0xa294('0x5'));var rimraf=require(_0xa294('0x6'));var config=require(_0xa294('0x7'));var attributes=require('./analyticTreeReport.attributes');module[_0xa294('0x8')]=function(_0x518a5f,_0x2dbecb){return _0x518a5f[_0xa294('0x9')](_0xa294('0xa'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc472=['AnalyticTreeReport','analytics_report_trees','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define'];(function(_0x2e6d10,_0x5131fc){var _0x1e2581=function(_0x557cea){while(--_0x557cea){_0x2e6d10['push'](_0x2e6d10['shift']());}};_0x1e2581(++_0x5131fc);}(_0xc472,0x1b4));var _0x2c47=function(_0x428774,_0x383962){_0x428774=_0x428774-0x0;var _0x53a01c=_0xc472[_0x428774];return _0x53a01c;};'use strict';var _=require(_0x2c47('0x0'));var util=require('util');var logger=require(_0x2c47('0x1'))(_0x2c47('0x2'));var moment=require(_0x2c47('0x3'));var BPromise=require(_0x2c47('0x4'));var rp=require(_0x2c47('0x5'));var fs=require('fs');var path=require(_0x2c47('0x6'));var rimraf=require(_0x2c47('0x7'));var config=require(_0x2c47('0x8'));var attributes=require(_0x2c47('0x9'));module[_0x2c47('0xa')]=function(_0x2c4e5b,_0x32d65d){return _0x2c4e5b[_0x2c47('0xb')](_0x2c47('0xc'),attributes,{'tableName':_0x2c47('0xd'),'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 22bbb0a..5ced29a 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 _0x5f66=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','code','message','error','info','catch','util','bluebird','randomstring','ioredis'];(function(_0x8e98c5,_0x579fd5){var _0x3201a6=function(_0x1e0fe1){while(--_0x1e0fe1){_0x8e98c5['push'](_0x8e98c5['shift']());}};_0x3201a6(++_0x579fd5);}(_0x5f66,0x1a0));var _0x65f6=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x5f66[_0x5f0089];return _0x193892;};'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});function respondWithRpcPromise(_0x4ed98f,_0x1c0e12,_0x2c6571){return new BPromise(function(_0x112079,_0x8f6451){return client[_0x65f6('0x9')](_0x4ed98f,_0x2c6571)[_0x65f6('0xa')](function(_0x48d85c){logger['info'](_0x65f6('0xb'),_0x1c0e12,_0x65f6('0xc'));logger[_0x65f6('0xd')](_0x65f6('0xe'),_0x1c0e12,'request\x20sent',JSON[_0x65f6('0xf')](_0x48d85c));if(_0x48d85c['error']){if(_0x48d85c['error'][_0x65f6('0x10')]===0x1f4){logger['error'](_0x65f6('0xb'),_0x1c0e12,_0x48d85c['error'][_0x65f6('0x11')]);return _0x8f6451(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);return _0x112079(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}else{logger[_0x65f6('0x13')]('AnalyticTreeReport,\x20%s,\x20%s',_0x1c0e12,_0x65f6('0xc'));_0x112079(_0x48d85c['result']['message']);}})[_0x65f6('0x14')](function(_0x5c69f8){logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x5c69f8);_0x8f6451(_0x5c69f8);});});} \ No newline at end of file +var _0x7a54=['info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7a54,0x106));var _0x47a5=function(_0x11d0d5,_0x1d49dc){_0x11d0d5=_0x11d0d5-0x0;var _0x1c9fea=_0x7a54[_0x11d0d5];return _0x1c9fea;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 7ae516b..09e2395 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 _0x0498=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','update','delete','destroy','multer','util','connect-timeout'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0498,0x10d));var _0x8049=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0x0498[_0x263a74];return _0x2aa86c;};'use strict';var multer=require(_0x8049('0x0'));var util=require(_0x8049('0x1'));var path=require('path');var timeout=require(_0x8049('0x2'));var express=require(_0x8049('0x3'));var router=express[_0x8049('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8049('0x5'));var interaction=require(_0x8049('0x6'));var config=require(_0x8049('0x7'));var controller=require('./analyticTreeReport.controller');router[_0x8049('0x8')]('/',auth[_0x8049('0x9')](),controller[_0x8049('0xa')]);router['get'](_0x8049('0xb'),auth[_0x8049('0x9')](),controller[_0x8049('0xc')]);router[_0x8049('0xd')]('/',auth[_0x8049('0x9')](),controller['create']);router['put']('/:id',auth[_0x8049('0x9')](),controller[_0x8049('0xe')]);router[_0x8049('0xf')](_0x8049('0xb'),auth[_0x8049('0x9')](),controller[_0x8049('0x10')]);module['exports']=router; \ No newline at end of file +var _0x3d3d=['update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','post','create','put'];(function(_0x5de823,_0x4cb43f){var _0x4e2eba=function(_0x16fc9f){while(--_0x16fc9f){_0x5de823['push'](_0x5de823['shift']());}};_0x4e2eba(++_0x4cb43f);}(_0x3d3d,0x1bc));var _0xd3d3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3d3d[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xd3d3('0x0'));var path=require(_0xd3d3('0x1'));var timeout=require(_0xd3d3('0x2'));var express=require(_0xd3d3('0x3'));var router=express[_0xd3d3('0x4')]();var fs_extra=require(_0xd3d3('0x5'));var auth=require(_0xd3d3('0x6'));var interaction=require(_0xd3d3('0x7'));var config=require(_0xd3d3('0x8'));var controller=require(_0xd3d3('0x9'));router[_0xd3d3('0xa')]('/',auth[_0xd3d3('0xb')](),controller[_0xd3d3('0xc')]);router[_0xd3d3('0xa')](_0xd3d3('0xd'),auth['isAuthenticated'](),controller[_0xd3d3('0xe')]);router[_0xd3d3('0xf')]('/',auth['isAuthenticated'](),controller[_0xd3d3('0x10')]);router[_0xd3d3('0x11')]('/:id',auth[_0xd3d3('0xb')](),controller[_0xd3d3('0x12')]);router['delete'](_0xd3d3('0xd'),auth[_0xd3d3('0xb')](),controller[_0xd3d3('0x13')]);module[_0xd3d3('0x14')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index aa489ac..02e15ae 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 _0x684c=['sequelize','exports','STRING'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x684c,0x1b3));var _0xc684=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x684c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xc684('0x0'));module[_0xc684('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0xc684('0x2')]},'type':{'type':Sequelize[_0xc684('0x2')]}}; \ No newline at end of file +var _0xdb4b=['STRING','exports'];(function(_0x34226f,_0x1cd113){var _0x1bf7dc=function(_0x145ecd){while(--_0x145ecd){_0x34226f['push'](_0x34226f['shift']());}};_0x1bf7dc(++_0x1cd113);}(_0xdb4b,0xd7));var _0xbdb4=function(_0x17406e,_0x1049fd){_0x17406e=_0x17406e-0x0;var _0x2bfc5a=_0xdb4b[_0x17406e];return _0x2bfc5a;};'use strict';var Sequelize=require('sequelize');module[_0xbdb4('0x0')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0xbdb4('0x1')]},'type':{'type':Sequelize[_0xbdb4('0x1')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 9e06519..5cf6bc3 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 _0x74e5=['omit','createdAt','body','file','originalname','filename','mimetype','create','download','findOne','root','server/files/attachments/','join','offline-chat/','basename','zip-dir','request-promise','moment','mustache','util','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','error','name','send','map','Attachment','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','keys','find','clone','params','get'];(function(_0x12742e,_0x43f6fa){var _0x173452=function(_0x500743){while(--_0x500743){_0x12742e['push'](_0x12742e['shift']());}};_0x173452(++_0x43f6fa);}(_0x74e5,0x167));var _0x574e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0x74e5[_0x13ea00];return _0x1f7347;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x574e('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x574e('0x1'));var moment=require(_0x574e('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x574e('0x3'));var util=require(_0x574e('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x574e('0x5'));var ejs=require(_0x574e('0x6'));var fs=require('fs');var fs_extra=require(_0x574e('0x7'));var _=require('lodash');var squel=require(_0x574e('0x8'));var crypto=require('crypto');var jsforce=require(_0x574e('0x9'));var deskjs=require(_0x574e('0xa'));var toCsv=require(_0x574e('0x5'));var querystring=require(_0x574e('0xb'));var Papa=require(_0x574e('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x574e('0xd'));var as=require(_0x574e('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x574e('0xf'))(_0x574e('0x10'));var utils=require(_0x574e('0x11'));var config=require(_0x574e('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x574e('0x13'))['db'];function respondWithStatusCode(_0x34cd1f,_0x4e8935){_0x4e8935=_0x4e8935||0xcc;return function(_0x3c7c61){if(_0x3c7c61){return _0x34cd1f[_0x574e('0x14')](_0x4e8935);}return _0x34cd1f[_0x574e('0x15')](_0x4e8935)['end']();};}function respondWithResult(_0x24d421,_0x251e79){_0x251e79=_0x251e79||0xc8;return function(_0x4def2a){if(_0x4def2a){return _0x24d421[_0x574e('0x15')](_0x251e79)[_0x574e('0x16')](_0x4def2a);}};}function respondWithFilteredResult(_0xde4a72,_0x33e909){return function(_0x67aca5){if(_0x67aca5){var _0xe50c39=typeof _0x33e909[_0x574e('0x17')]===_0x574e('0x18')&&typeof _0x33e909[_0x574e('0x19')]==='undefined';var _0x244a14=_0x67aca5[_0x574e('0x1a')];var _0x5e96a7=_0xe50c39?0x0:_0x33e909[_0x574e('0x17')];var _0x1721ba=_0xe50c39?_0x67aca5[_0x574e('0x1a')]:_0x33e909[_0x574e('0x17')]+_0x33e909[_0x574e('0x19')];var _0x3953c8;if(_0x1721ba>=_0x244a14){_0x1721ba=_0x244a14;_0x3953c8=0xc8;}else{_0x3953c8=0xce;}_0xde4a72['status'](_0x3953c8);return _0xde4a72[_0x574e('0x1b')](_0x574e('0x1c'),_0x5e96a7+'-'+_0x1721ba+'/'+_0x244a14)[_0x574e('0x16')](_0x67aca5);}return null;};}function patchUpdates(_0x5c85b8){return function(_0x33214f){try{jsonpatch[_0x574e('0x1d')](_0x33214f,_0x5c85b8,!![]);}catch(_0x28cfc0){return BPromise[_0x574e('0x1e')](_0x28cfc0);}return _0x33214f[_0x574e('0x1f')]();};}function saveUpdates(_0x306adf,_0x9a4e10){return function(_0xdf519c){if(_0xdf519c){return _0xdf519c[_0x574e('0x20')](_0x306adf)[_0x574e('0x21')](function(_0x4b56f2){return _0x4b56f2;});}return null;};}function removeEntity(_0x3f9715,_0x1f624c){return function(_0x5033c){if(_0x5033c){return _0x5033c['destroy']()[_0x574e('0x21')](function(){_0x3f9715[_0x574e('0x15')](0xcc)[_0x574e('0x22')]();});}};}function handleEntityNotFound(_0x4aaac8,_0x31db55){return function(_0x5b8b3e){if(!_0x5b8b3e){_0x4aaac8[_0x574e('0x14')](0x194);}return _0x5b8b3e;};}function handleError(_0x565e5b,_0x48cbbe){_0x48cbbe=_0x48cbbe||0x1f4;return function(_0x5261d4){logger[_0x574e('0x23')](_0x5261d4['stack']);if(_0x5261d4[_0x574e('0x24')]){delete _0x5261d4['name'];}_0x565e5b['status'](_0x48cbbe)[_0x574e('0x25')](_0x5261d4);};}exports['index']=function(_0x4e68db,_0x8e45a2){var _0x4ed9b1={},_0x41baaf={},_0x165727={'count':0x0,'rows':[]};var _0x5485b4=_[_0x574e('0x26')](db[_0x574e('0x27')][_0x574e('0x28')],function(_0x4fd50f){return{'name':_0x4fd50f[_0x574e('0x29')],'type':_0x4fd50f[_0x574e('0x2a')]['key']};});_0x41baaf[_0x574e('0x2b')]=_[_0x574e('0x26')](_0x5485b4,_0x574e('0x24'));_0x41baaf['query']=_['keys'](_0x4e68db[_0x574e('0x2c')]);_0x41baaf[_0x574e('0x2d')]=_['intersection'](_0x41baaf[_0x574e('0x2b')],_0x41baaf[_0x574e('0x2c')]);_0x4ed9b1[_0x574e('0x2e')]=_[_0x574e('0x2f')](_0x41baaf[_0x574e('0x2b')],qs[_0x574e('0x30')](_0x4e68db['query'][_0x574e('0x30')]));_0x4ed9b1[_0x574e('0x2e')]=_0x4ed9b1['attributes'][_0x574e('0x31')]?_0x4ed9b1[_0x574e('0x2e')]:_0x41baaf['model'];if(!_0x4e68db[_0x574e('0x2c')][_0x574e('0x32')](_0x574e('0x33'))){_0x4ed9b1[_0x574e('0x19')]=qs[_0x574e('0x19')](_0x4e68db[_0x574e('0x2c')][_0x574e('0x19')]);_0x4ed9b1['offset']=qs['offset'](_0x4e68db[_0x574e('0x2c')][_0x574e('0x17')]);}_0x4ed9b1[_0x574e('0x34')]=qs[_0x574e('0x35')](_0x4e68db[_0x574e('0x2c')]['sort']);_0x4ed9b1[_0x574e('0x36')]=qs[_0x574e('0x2d')](_[_0x574e('0x37')](_0x4e68db[_0x574e('0x2c')],_0x41baaf[_0x574e('0x2d')]),_0x5485b4);if(_0x4e68db[_0x574e('0x2c')][_0x574e('0x38')]){_0x4ed9b1[_0x574e('0x36')]=_['merge'](_0x4ed9b1['where'],{'$or':_['map'](_0x5485b4,function(_0x301965){if(_0x301965[_0x574e('0x2a')]!==_0x574e('0x39')){var _0x367ab9={};_0x367ab9[_0x301965['name']]={'$like':'%'+_0x4e68db[_0x574e('0x2c')]['filter']+'%'};return _0x367ab9;}})});}_0x4ed9b1=_[_0x574e('0x3a')]({},_0x4ed9b1,_0x4e68db[_0x574e('0x3b')]);var _0x34c991={'where':_0x4ed9b1[_0x574e('0x36')]};return db[_0x574e('0x27')][_0x574e('0x1a')](_0x34c991)[_0x574e('0x21')](function(_0x550c67){_0x165727[_0x574e('0x1a')]=_0x550c67;if(_0x4e68db[_0x574e('0x2c')][_0x574e('0x3c')]){_0x4ed9b1[_0x574e('0x3d')]=[{'all':!![]}];}return db['Attachment'][_0x574e('0x3e')](_0x4ed9b1);})[_0x574e('0x21')](function(_0x1ec85b){_0x165727[_0x574e('0x3f')]=_0x1ec85b;return _0x165727;})[_0x574e('0x21')](respondWithFilteredResult(_0x8e45a2,_0x4ed9b1))[_0x574e('0x40')](handleError(_0x8e45a2,null));};exports[_0x574e('0x41')]=function(_0x5b05b9,_0x584fea){var _0xe9c5e0={'raw':!![],'where':{'id':_0x5b05b9['params']['id']}},_0x56b742={};_0x56b742[_0x574e('0x2b')]=_['keys'](db[_0x574e('0x27')][_0x574e('0x28')]);_0x56b742[_0x574e('0x2c')]=_[_0x574e('0x42')](_0x5b05b9[_0x574e('0x2c')]);_0x56b742['filters']=_[_0x574e('0x2f')](_0x56b742['model'],_0x56b742['query']);_0xe9c5e0['attributes']=_[_0x574e('0x2f')](_0x56b742[_0x574e('0x2b')],qs[_0x574e('0x30')](_0x5b05b9[_0x574e('0x2c')][_0x574e('0x30')]));_0xe9c5e0['attributes']=_0xe9c5e0[_0x574e('0x2e')][_0x574e('0x31')]?_0xe9c5e0['attributes']:_0x56b742[_0x574e('0x2b')];if(_0x5b05b9[_0x574e('0x2c')][_0x574e('0x3c')]){_0xe9c5e0[_0x574e('0x3d')]=[{'all':!![]}];}_0xe9c5e0=_[_0x574e('0x3a')]({},_0xe9c5e0,_0x5b05b9[_0x574e('0x3b')]);return db[_0x574e('0x27')][_0x574e('0x43')](_0xe9c5e0)['then'](handleEntityNotFound(_0x584fea,null))['then'](respondWithResult(_0x584fea,null))[_0x574e('0x40')](handleError(_0x584fea,null));};exports[_0x574e('0x44')]=function(_0xf4b0ab,_0x19be55){var _0x12863a={'where':{'id':_0xf4b0ab[_0x574e('0x45')]['id']}},_0x48728d={};_0x48728d[_0x574e('0x2b')]=_[_0x574e('0x42')](db['Attachment'][_0x574e('0x28')]);_0x12863a['attributes']=_[_0x574e('0x2f')](_0x48728d[_0x574e('0x2b')],qs['fields'](_0xf4b0ab[_0x574e('0x2c')][_0x574e('0x30')]));_0x12863a[_0x574e('0x2e')]=_0x12863a[_0x574e('0x2e')][_0x574e('0x31')]?_0x12863a[_0x574e('0x2e')]:_0x48728d[_0x574e('0x2b')];if(_0xf4b0ab[_0x574e('0x2c')][_0x574e('0x3c')]){_0x12863a[_0x574e('0x3d')]=[{'all':!![]}];}_0x12863a=_[_0x574e('0x3a')]({},_0x12863a,_0xf4b0ab[_0x574e('0x3b')]);return db[_0x574e('0x27')][_0x574e('0x43')](_0x12863a)[_0x574e('0x21')](handleEntityNotFound(_0x19be55,null))[_0x574e('0x21')](function(_0x1d6985){if(_0x1d6985){var _0x47163c=_0x1d6985[_0x574e('0x46')]({'plain':!![]});_0x47163c=qs[_0x574e('0x47')](_0x47163c,['id',_0x574e('0x48'),'updatedAt']);_0xf4b0ab[_0x574e('0x49')]=_['omit'](_0xf4b0ab[_0x574e('0x49')],['id','createdAt','updatedAt']);return db[_0x574e('0x27')]['create'](_[_0x574e('0x3a')](_0x47163c,_0xf4b0ab[_0x574e('0x49')]),{'include':_0xf4b0ab[_0x574e('0x2c')][_0x574e('0x3c')]?[{'all':!![]}]:undefined});}})[_0x574e('0x21')](respondWithResult(_0x19be55,0xc9))[_0x574e('0x40')](handleError(_0x19be55,null));};exports[_0x574e('0x20')]=function(_0x1f04d8,_0x3ddf8b){if(_0x1f04d8[_0x574e('0x49')]['id']){delete _0x1f04d8[_0x574e('0x49')]['id'];}return db['Attachment']['find']({'where':{'id':_0x1f04d8['params']['id']}})[_0x574e('0x21')](handleEntityNotFound(_0x3ddf8b,null))[_0x574e('0x21')](saveUpdates(_0x1f04d8[_0x574e('0x49')],null))[_0x574e('0x21')](respondWithResult(_0x3ddf8b,null))['catch'](handleError(_0x3ddf8b,null));};exports['destroy']=function(_0x2ebb05,_0x547406){return db['Attachment']['find']({'where':{'id':_0x2ebb05[_0x574e('0x45')]['id']}})['then'](handleEntityNotFound(_0x547406,null))[_0x574e('0x21')](removeEntity(_0x547406,null))[_0x574e('0x40')](handleError(_0x547406,null));};exports['create']=function(_0x3b1aff,_0x4fb517,_0x3458d9){_0x3b1aff[_0x574e('0x49')]['name']=_0x3b1aff[_0x574e('0x4a')][_0x574e('0x4b')];_0x3b1aff[_0x574e('0x49')]['basename']=_0x3b1aff[_0x574e('0x4a')][_0x574e('0x4c')];_0x3b1aff[_0x574e('0x49')][_0x574e('0x2a')]=_0x3b1aff[_0x574e('0x4a')][_0x574e('0x4d')];return db[_0x574e('0x27')][_0x574e('0x4e')](_0x3b1aff[_0x574e('0x49')])[_0x574e('0x21')](respondWithResult(_0x4fb517,0xc9))[_0x574e('0x40')](handleError(_0x4fb517,null));};exports[_0x574e('0x4f')]=function(_0x36e6d8,_0x388a80,_0x4d62cf){return db['Attachment'][_0x574e('0x50')]({'where':{'id':_0x36e6d8[_0x574e('0x45')]['id']},'raw':!![]})[_0x574e('0x21')](handleEntityNotFound(_0x388a80,null))[_0x574e('0x21')](function(_0x8413f5){if(_0x8413f5){var _0x32352e=_0x8413f5['ChatOfflineMessageId']!==null;var _0x73e79f=path['join'](config[_0x574e('0x51')],_0x574e('0x52'));if(_0x32352e){_0x73e79f=path[_0x574e('0x53')](_0x73e79f,_0x574e('0x54'));}var _0x10c14a=path[_0x574e('0x53')](_0x73e79f,_0x8413f5[_0x574e('0x55')]);return _0x388a80['download'](_0x10c14a);}})['catch'](handleError(_0x388a80,null));}; \ No newline at end of file +var _0xe259=['destroy','stack','name','index','map','Attachment','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','keys','rawAttributes','include','find','catch','clone','params','get','omit','createdAt','updatedAt','body','create','file','originalname','basename','filename','mimetype','download','findOne','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','Content-Range','save','then'];(function(_0x196119,_0x4108de){var _0xa3ddce=function(_0x2c618a){while(--_0x2c618a){_0x196119['push'](_0x196119['shift']());}};_0xa3ddce(++_0x4108de);}(_0xe259,0x18c));var _0x9e25=function(_0x1da009,_0x43bbb0){_0x1da009=_0x1da009-0x0;var _0x48c764=_0xe259[_0x1da009];return _0x48c764;};'use strict';var emlformat=require(_0x9e25('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9e25('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9e25('0x2'));var moment=require(_0x9e25('0x3'));var BPromise=require(_0x9e25('0x4'));var Mustache=require(_0x9e25('0x5'));var util=require('util');var path=require(_0x9e25('0x6'));var sox=require(_0x9e25('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9e25('0x8'));var squel=require('squel');var crypto=require(_0x9e25('0x9'));var jsforce=require(_0x9e25('0xa'));var deskjs=require(_0x9e25('0xb'));var toCsv=require(_0x9e25('0xc'));var querystring=require(_0x9e25('0xd'));var Papa=require(_0x9e25('0xe'));var Redis=require(_0x9e25('0xf'));var authService=require(_0x9e25('0x10'));var qs=require(_0x9e25('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9e25('0x12'));var logger=require(_0x9e25('0x13'))(_0x9e25('0x14'));var utils=require(_0x9e25('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x9e25('0x16'));var db=require(_0x9e25('0x17'))['db'];function respondWithStatusCode(_0x257c1b,_0x5bfadc){_0x5bfadc=_0x5bfadc||0xcc;return function(_0x3397ad){if(_0x3397ad){return _0x257c1b['sendStatus'](_0x5bfadc);}return _0x257c1b[_0x9e25('0x18')](_0x5bfadc)[_0x9e25('0x19')]();};}function respondWithResult(_0x15a25a,_0x4bff71){_0x4bff71=_0x4bff71||0xc8;return function(_0x4e4850){if(_0x4e4850){return _0x15a25a[_0x9e25('0x18')](_0x4bff71)[_0x9e25('0x1a')](_0x4e4850);}};}function respondWithFilteredResult(_0x11288d,_0x1d1d59){return function(_0x563c31){if(_0x563c31){var _0x16c439=typeof _0x1d1d59[_0x9e25('0x1b')]==='undefined'&&typeof _0x1d1d59[_0x9e25('0x1c')]===_0x9e25('0x1d');var _0x5cd831=_0x563c31[_0x9e25('0x1e')];var _0x4f916a=_0x16c439?0x0:_0x1d1d59[_0x9e25('0x1b')];var _0x12618a=_0x16c439?_0x563c31[_0x9e25('0x1e')]:_0x1d1d59['offset']+_0x1d1d59['limit'];var _0x4f26ee;if(_0x12618a>=_0x5cd831){_0x12618a=_0x5cd831;_0x4f26ee=0xc8;}else{_0x4f26ee=0xce;}_0x11288d[_0x9e25('0x18')](_0x4f26ee);return _0x11288d['set'](_0x9e25('0x1f'),_0x4f916a+'-'+_0x12618a+'/'+_0x5cd831)['json'](_0x563c31);}return null;};}function patchUpdates(_0x23579c){return function(_0x2ddd61){try{jsonpatch['apply'](_0x2ddd61,_0x23579c,!![]);}catch(_0x267d5b){return BPromise['reject'](_0x267d5b);}return _0x2ddd61[_0x9e25('0x20')]();};}function saveUpdates(_0x551cce,_0x59f9e4){return function(_0xbfecb6){if(_0xbfecb6){return _0xbfecb6['update'](_0x551cce)[_0x9e25('0x21')](function(_0x5f1ba5){return _0x5f1ba5;});}return null;};}function removeEntity(_0x2379a7,_0x57a05c){return function(_0x2b9e69){if(_0x2b9e69){return _0x2b9e69[_0x9e25('0x22')]()['then'](function(){_0x2379a7[_0x9e25('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x50db61,_0x4711ca){return function(_0x228424){if(!_0x228424){_0x50db61['sendStatus'](0x194);}return _0x228424;};}function handleError(_0x3c64fe,_0x1249ff){_0x1249ff=_0x1249ff||0x1f4;return function(_0x1dabe3){logger['error'](_0x1dabe3[_0x9e25('0x23')]);if(_0x1dabe3[_0x9e25('0x24')]){delete _0x1dabe3[_0x9e25('0x24')];}_0x3c64fe[_0x9e25('0x18')](_0x1249ff)['send'](_0x1dabe3);};}exports[_0x9e25('0x25')]=function(_0x2c9dd2,_0x23112b){var _0xe690f7={},_0xaabbc2={},_0x319250={'count':0x0,'rows':[]};var _0x5620ce=_[_0x9e25('0x26')](db[_0x9e25('0x27')]['rawAttributes'],function(_0x47538e){return{'name':_0x47538e['fieldName'],'type':_0x47538e[_0x9e25('0x28')][_0x9e25('0x29')]};});_0xaabbc2[_0x9e25('0x2a')]=_['map'](_0x5620ce,_0x9e25('0x24'));_0xaabbc2['query']=_['keys'](_0x2c9dd2[_0x9e25('0x2b')]);_0xaabbc2[_0x9e25('0x2c')]=_[_0x9e25('0x2d')](_0xaabbc2[_0x9e25('0x2a')],_0xaabbc2[_0x9e25('0x2b')]);_0xe690f7[_0x9e25('0x2e')]=_[_0x9e25('0x2d')](_0xaabbc2['model'],qs[_0x9e25('0x2f')](_0x2c9dd2[_0x9e25('0x2b')][_0x9e25('0x2f')]));_0xe690f7[_0x9e25('0x2e')]=_0xe690f7[_0x9e25('0x2e')][_0x9e25('0x30')]?_0xe690f7['attributes']:_0xaabbc2['model'];if(!_0x2c9dd2[_0x9e25('0x2b')][_0x9e25('0x31')](_0x9e25('0x32'))){_0xe690f7['limit']=qs[_0x9e25('0x1c')](_0x2c9dd2[_0x9e25('0x2b')][_0x9e25('0x1c')]);_0xe690f7[_0x9e25('0x1b')]=qs['offset'](_0x2c9dd2[_0x9e25('0x2b')][_0x9e25('0x1b')]);}_0xe690f7[_0x9e25('0x33')]=qs['sort'](_0x2c9dd2[_0x9e25('0x2b')][_0x9e25('0x34')]);_0xe690f7['where']=qs[_0x9e25('0x2c')](_[_0x9e25('0x35')](_0x2c9dd2[_0x9e25('0x2b')],_0xaabbc2[_0x9e25('0x2c')]),_0x5620ce);if(_0x2c9dd2[_0x9e25('0x2b')][_0x9e25('0x36')]){_0xe690f7[_0x9e25('0x37')]=_[_0x9e25('0x38')](_0xe690f7[_0x9e25('0x37')],{'$or':_[_0x9e25('0x26')](_0x5620ce,function(_0x2a3046){if(_0x2a3046[_0x9e25('0x28')]!==_0x9e25('0x39')){var _0x43aa39={};_0x43aa39[_0x2a3046[_0x9e25('0x24')]]={'$like':'%'+_0x2c9dd2[_0x9e25('0x2b')][_0x9e25('0x36')]+'%'};return _0x43aa39;}})});}_0xe690f7=_[_0x9e25('0x38')]({},_0xe690f7,_0x2c9dd2[_0x9e25('0x3a')]);var _0x51d556={'where':_0xe690f7[_0x9e25('0x37')]};return db[_0x9e25('0x27')][_0x9e25('0x1e')](_0x51d556)['then'](function(_0x17774d){_0x319250[_0x9e25('0x1e')]=_0x17774d;if(_0x2c9dd2[_0x9e25('0x2b')][_0x9e25('0x3b')]){_0xe690f7['include']=[{'all':!![]}];}return db[_0x9e25('0x27')][_0x9e25('0x3c')](_0xe690f7);})[_0x9e25('0x21')](function(_0x18d905){_0x319250[_0x9e25('0x3d')]=_0x18d905;return _0x319250;})[_0x9e25('0x21')](respondWithFilteredResult(_0x23112b,_0xe690f7))['catch'](handleError(_0x23112b,null));};exports['show']=function(_0x2c27c7,_0x365a6b){var _0x1b4710={'raw':!![],'where':{'id':_0x2c27c7['params']['id']}},_0x6f270c={};_0x6f270c[_0x9e25('0x2a')]=_[_0x9e25('0x3e')](db['Attachment'][_0x9e25('0x3f')]);_0x6f270c[_0x9e25('0x2b')]=_[_0x9e25('0x3e')](_0x2c27c7[_0x9e25('0x2b')]);_0x6f270c[_0x9e25('0x2c')]=_[_0x9e25('0x2d')](_0x6f270c[_0x9e25('0x2a')],_0x6f270c[_0x9e25('0x2b')]);_0x1b4710[_0x9e25('0x2e')]=_[_0x9e25('0x2d')](_0x6f270c[_0x9e25('0x2a')],qs[_0x9e25('0x2f')](_0x2c27c7[_0x9e25('0x2b')][_0x9e25('0x2f')]));_0x1b4710[_0x9e25('0x2e')]=_0x1b4710[_0x9e25('0x2e')][_0x9e25('0x30')]?_0x1b4710[_0x9e25('0x2e')]:_0x6f270c[_0x9e25('0x2a')];if(_0x2c27c7[_0x9e25('0x2b')]['includeAll']){_0x1b4710[_0x9e25('0x40')]=[{'all':!![]}];}_0x1b4710=_[_0x9e25('0x38')]({},_0x1b4710,_0x2c27c7[_0x9e25('0x3a')]);return db[_0x9e25('0x27')][_0x9e25('0x41')](_0x1b4710)['then'](handleEntityNotFound(_0x365a6b,null))[_0x9e25('0x21')](respondWithResult(_0x365a6b,null))[_0x9e25('0x42')](handleError(_0x365a6b,null));};exports[_0x9e25('0x43')]=function(_0x26ca38,_0x1d462a){var _0x57011d={'where':{'id':_0x26ca38[_0x9e25('0x44')]['id']}},_0x33ec5d={};_0x33ec5d[_0x9e25('0x2a')]=_['keys'](db['Attachment'][_0x9e25('0x3f')]);_0x57011d[_0x9e25('0x2e')]=_[_0x9e25('0x2d')](_0x33ec5d[_0x9e25('0x2a')],qs[_0x9e25('0x2f')](_0x26ca38[_0x9e25('0x2b')]['fields']));_0x57011d[_0x9e25('0x2e')]=_0x57011d[_0x9e25('0x2e')][_0x9e25('0x30')]?_0x57011d[_0x9e25('0x2e')]:_0x33ec5d['model'];if(_0x26ca38[_0x9e25('0x2b')][_0x9e25('0x3b')]){_0x57011d[_0x9e25('0x40')]=[{'all':!![]}];}_0x57011d=_[_0x9e25('0x38')]({},_0x57011d,_0x26ca38[_0x9e25('0x3a')]);return db[_0x9e25('0x27')]['find'](_0x57011d)['then'](handleEntityNotFound(_0x1d462a,null))[_0x9e25('0x21')](function(_0x53764c){if(_0x53764c){var _0x3a1baa=_0x53764c[_0x9e25('0x45')]({'plain':!![]});_0x3a1baa=qs[_0x9e25('0x46')](_0x3a1baa,['id',_0x9e25('0x47'),_0x9e25('0x48')]);_0x26ca38[_0x9e25('0x49')]=_['omit'](_0x26ca38[_0x9e25('0x49')],['id',_0x9e25('0x47'),_0x9e25('0x48')]);return db[_0x9e25('0x27')]['create'](_[_0x9e25('0x38')](_0x3a1baa,_0x26ca38['body']),{'include':_0x26ca38[_0x9e25('0x2b')]['includeAll']?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x1d462a,0xc9))[_0x9e25('0x42')](handleError(_0x1d462a,null));};exports['update']=function(_0x557991,_0xd76c49){if(_0x557991[_0x9e25('0x49')]['id']){delete _0x557991[_0x9e25('0x49')]['id'];}return db[_0x9e25('0x27')][_0x9e25('0x41')]({'where':{'id':_0x557991[_0x9e25('0x44')]['id']}})['then'](handleEntityNotFound(_0xd76c49,null))[_0x9e25('0x21')](saveUpdates(_0x557991[_0x9e25('0x49')],null))[_0x9e25('0x21')](respondWithResult(_0xd76c49,null))[_0x9e25('0x42')](handleError(_0xd76c49,null));};exports[_0x9e25('0x22')]=function(_0x5c21bf,_0x490f00){return db[_0x9e25('0x27')][_0x9e25('0x41')]({'where':{'id':_0x5c21bf[_0x9e25('0x44')]['id']}})[_0x9e25('0x21')](handleEntityNotFound(_0x490f00,null))[_0x9e25('0x21')](removeEntity(_0x490f00,null))[_0x9e25('0x42')](handleError(_0x490f00,null));};exports[_0x9e25('0x4a')]=function(_0x15d484,_0x4a76b8,_0x203168){_0x15d484[_0x9e25('0x49')][_0x9e25('0x24')]=_0x15d484[_0x9e25('0x4b')][_0x9e25('0x4c')];_0x15d484[_0x9e25('0x49')][_0x9e25('0x4d')]=_0x15d484[_0x9e25('0x4b')][_0x9e25('0x4e')];_0x15d484[_0x9e25('0x49')][_0x9e25('0x28')]=_0x15d484[_0x9e25('0x4b')][_0x9e25('0x4f')];return db[_0x9e25('0x27')][_0x9e25('0x4a')](_0x15d484['body'])[_0x9e25('0x21')](respondWithResult(_0x4a76b8,0xc9))[_0x9e25('0x42')](handleError(_0x4a76b8,null));};exports[_0x9e25('0x50')]=function(_0x45d172,_0x1f30ea,_0x5b52d5){return db['Attachment'][_0x9e25('0x51')]({'where':{'id':_0x45d172['params']['id']},'raw':!![]})[_0x9e25('0x21')](handleEntityNotFound(_0x1f30ea,null))[_0x9e25('0x21')](function(_0xc1367){if(_0xc1367){var _0x382a39=_0xc1367[_0x9e25('0x52')]!==null;var _0x4a7185=path[_0x9e25('0x53')](config['root'],_0x9e25('0x54'));if(_0x382a39){_0x4a7185=path['join'](_0x4a7185,_0x9e25('0x55'));}var _0x2c2e70=path[_0x9e25('0x53')](_0x4a7185,_0xc1367[_0x9e25('0x4d')]);return _0x1f30ea['download'](_0x2c2e70);}})[_0x9e25('0x42')](handleError(_0x1f30ea,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 541f0c7..25a0c28 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 _0xfab5=['Attachment','attachments','lodash','util','api','moment','bluebird','../../config/environment','./attachment.attributes','exports','define'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0xfab5,0x86));var _0x5fab=function(_0x1786a6,_0x134d37){_0x1786a6=_0x1786a6-0x0;var _0x560522=_0xfab5[_0x1786a6];return _0x560522;};'use strict';var _=require(_0x5fab('0x0'));var util=require(_0x5fab('0x1'));var logger=require('../../config/logger')(_0x5fab('0x2'));var moment=require(_0x5fab('0x3'));var BPromise=require(_0x5fab('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5fab('0x5'));var attributes=require(_0x5fab('0x6'));module[_0x5fab('0x7')]=function(_0x1758a5,_0x49e537){return _0x1758a5[_0x5fab('0x8')](_0x5fab('0x9'),attributes,{'tableName':_0x5fab('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2909=['../../config/logger','api','bluebird','request-promise','../../config/environment','./attachment.attributes','exports','define','attachments','lodash'];(function(_0x496139,_0x4b7517){var _0x4a7d3e=function(_0x9637ba){while(--_0x9637ba){_0x496139['push'](_0x496139['shift']());}};_0x4a7d3e(++_0x4b7517);}(_0x2909,0x1ad));var _0x9290=function(_0xcdf363,_0x5223c5){_0xcdf363=_0xcdf363-0x0;var _0x2377f4=_0x2909[_0xcdf363];return _0x2377f4;};'use strict';var _=require(_0x9290('0x0'));var util=require('util');var logger=require(_0x9290('0x1'))(_0x9290('0x2'));var moment=require('moment');var BPromise=require(_0x9290('0x3'));var rp=require(_0x9290('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9290('0x5'));var attributes=require(_0x9290('0x6'));module[_0x9290('0x7')]=function(_0x3c2e0b,_0x388c9f){return _0x3c2e0b[_0x9290('0x8')]('Attachment',attributes,{'tableName':_0x9290('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js index dca3090..7391e4d 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 _0xaa88=['debug','Attachment,\x20%s,\x20%s,\x20%s','error','Attachment,\x20%s,\x20%s','message','result','catch','create','body','options','CreateAttachment','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','request\x20sent'];(function(_0x8562c2,_0x1dc62f){var _0x539595=function(_0x449c6){while(--_0x449c6){_0x8562c2['push'](_0x8562c2['shift']());}};_0x539595(++_0x1dc62f);}(_0xaa88,0x137));var _0x8aa8=function(_0x34b821,_0x504e55){_0x34b821=_0x34b821-0x0;var _0x5e00a0=_0xaa88[_0x34b821];return _0x5e00a0;};'use strict';var _=require(_0x8aa8('0x0'));var util=require(_0x8aa8('0x1'));var moment=require(_0x8aa8('0x2'));var BPromise=require(_0x8aa8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8aa8('0x4'));var db=require(_0x8aa8('0x5'))['db'];var utils=require(_0x8aa8('0x6'));var logger=require(_0x8aa8('0x7'))(_0x8aa8('0x8'));var config=require(_0x8aa8('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8aa8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5264ff,_0x449d2d,_0x1ed84d){return new BPromise(function(_0x27c08d,_0x40826f){return client['request'](_0x5264ff,_0x1ed84d)[_0x8aa8('0xb')](function(_0x2d974c){logger[_0x8aa8('0xc')]('Attachment,\x20%s,\x20%s',_0x449d2d,_0x8aa8('0xd'));logger[_0x8aa8('0xe')](_0x8aa8('0xf'),_0x449d2d,_0x8aa8('0xd'),JSON['stringify'](_0x2d974c));if(_0x2d974c[_0x8aa8('0x10')]){if(_0x2d974c[_0x8aa8('0x10')]['code']===0x1f4){logger[_0x8aa8('0x10')](_0x8aa8('0x11'),_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x40826f(_0x2d974c[_0x8aa8('0x10')][_0x8aa8('0x12')]);}logger[_0x8aa8('0x10')]('Attachment,\x20%s,\x20%s',_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x27c08d(_0x2d974c['error'][_0x8aa8('0x12')]);}else{logger[_0x8aa8('0xc')](_0x8aa8('0x11'),_0x449d2d,_0x8aa8('0xd'));_0x27c08d(_0x2d974c[_0x8aa8('0x13')][_0x8aa8('0x12')]);}})[_0x8aa8('0x14')](function(_0xd59fb8){logger[_0x8aa8('0x10')]('Attachment,\x20%s,\x20%s',_0x449d2d,_0xd59fb8);_0x40826f(_0xd59fb8);});});}exports['CreateAttachment']=function(_0x2c1b9a){var _0x49d80d=this;return new Promise(function(_0x557adc,_0xab7af5){return db['Attachment'][_0x8aa8('0x15')](_0x2c1b9a[_0x8aa8('0x16')],{'raw':_0x2c1b9a[_0x8aa8('0x17')]?_0x2c1b9a[_0x8aa8('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x8aa8('0xb')](function(_0x36c445){logger[_0x8aa8('0xc')](_0x8aa8('0x18'),_0x2c1b9a);logger[_0x8aa8('0xe')](_0x8aa8('0x18'),_0x2c1b9a,JSON['stringify'](_0x36c445));_0x557adc(_0x36c445);})[_0x8aa8('0x14')](function(_0x4cc455){logger[_0x8aa8('0x10')]('CreateAttachment',_0x4cc455[_0x8aa8('0x12')],_0x2c1b9a);_0xab7af5(_0x49d80d['error'](0x1f4,_0x4cc455[_0x8aa8('0x12')]));});});}; \ No newline at end of file +var _0x31c2=['CreateAttachment','stringify','lodash','bluebird','randomstring','../../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','catch','Attachment','create','body','options','raw'];(function(_0x12d013,_0x286e4c){var _0x54220c=function(_0x31d518){while(--_0x31d518){_0x12d013['push'](_0x12d013['shift']());}};_0x54220c(++_0x286e4c);}(_0x31c2,0x98));var _0x231c=function(_0x3c1a96,_0x1c9c14){_0x3c1a96=_0x3c1a96-0x0;var _0x18f552=_0x31c2[_0x3c1a96];return _0x18f552;};'use strict';var _=require(_0x231c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x231c('0x1'));var rs=require(_0x231c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x231c('0x3'))['db'];var utils=require(_0x231c('0x4'));var logger=require(_0x231c('0x5'))(_0x231c('0x6'));var config=require(_0x231c('0x7'));var jayson=require(_0x231c('0x8'));var client=jayson[_0x231c('0x9')][_0x231c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5afc76,_0x1e3997,_0x4fd8b8){return new BPromise(function(_0x3dfccb,_0x396da8){return client[_0x231c('0xb')](_0x5afc76,_0x4fd8b8)[_0x231c('0xc')](function(_0x4cd3b8){logger[_0x231c('0xd')](_0x231c('0xe'),_0x1e3997,_0x231c('0xf'));logger[_0x231c('0x10')](_0x231c('0x11'),_0x1e3997,_0x231c('0xf'),JSON['stringify'](_0x4cd3b8));if(_0x4cd3b8['error']){if(_0x4cd3b8['error'][_0x231c('0x12')]===0x1f4){logger[_0x231c('0x13')](_0x231c('0xe'),_0x1e3997,_0x4cd3b8[_0x231c('0x13')][_0x231c('0x14')]);return _0x396da8(_0x4cd3b8[_0x231c('0x13')][_0x231c('0x14')]);}logger[_0x231c('0x13')](_0x231c('0xe'),_0x1e3997,_0x4cd3b8[_0x231c('0x13')][_0x231c('0x14')]);return _0x3dfccb(_0x4cd3b8[_0x231c('0x13')][_0x231c('0x14')]);}else{logger[_0x231c('0xd')]('Attachment,\x20%s,\x20%s',_0x1e3997,_0x231c('0xf'));_0x3dfccb(_0x4cd3b8[_0x231c('0x15')][_0x231c('0x14')]);}})[_0x231c('0x16')](function(_0x40f4f6){logger['error'](_0x231c('0xe'),_0x1e3997,_0x40f4f6);_0x396da8(_0x40f4f6);});});}exports['CreateAttachment']=function(_0x1d48e3){var _0x59282c=this;return new Promise(function(_0x286148,_0x34f391){return db[_0x231c('0x17')][_0x231c('0x18')](_0x1d48e3[_0x231c('0x19')],{'raw':_0x1d48e3[_0x231c('0x1a')]?_0x1d48e3[_0x231c('0x1a')][_0x231c('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x29a94){logger[_0x231c('0xd')](_0x231c('0x1c'),_0x1d48e3);logger['debug']('CreateAttachment',_0x1d48e3,JSON[_0x231c('0x1d')](_0x29a94));_0x286148(_0x29a94);})[_0x231c('0x16')](function(_0x3bd9ed){logger['error'](_0x231c('0x1c'),_0x3bd9ed['message'],_0x1d48e3);_0x34f391(_0x59282c[_0x231c('0x13')](0x1f4,_0x3bd9ed[_0x231c('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index c3dc9ab..7d333e7 100644 --- a/server/api/attachment/index.js +++ b/server/api/attachment/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['originalname','replace','single','file','create','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','download','post','/:id/clone','diskStorage','join','server/files/attachments/','format','%s-%s'];(function(_0x3f54ae,_0x59fe1d){var _0x36c653=function(_0x4a2d27){while(--_0x4a2d27){_0x3f54ae['push'](_0x3f54ae['shift']());}};_0x36c653(++_0x59fe1d);}(_0xb10b,0x12a));var _0xbb10=function(_0x11bee4,_0x117d71){_0x11bee4=_0x11bee4-0x0;var _0x110e2a=_0xb10b[_0x11bee4];return _0x110e2a;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')](_0xbb10('0x10'),auth['isAuthenticated'](),controller['clone']);var upload=multer({'storage':multer[_0xbb10('0x11')]({'destination':function(_0x118a74,_0xce64f3,_0x5e136d){_0x5e136d(null,path[_0xbb10('0x12')](config['root'],_0xbb10('0x13')));},'filename':function(_0x916a32,_0x285009,_0x193a27){_0x193a27(null,util[_0xbb10('0x14')](_0xbb10('0x15'),Date['now'](),_0x285009[_0xbb10('0x16')][_0xbb10('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xbb10('0xf')]('/',upload[_0xbb10('0x18')](_0xbb10('0x19')),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1d')]);router['delete'](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);module[_0xbb10('0x1f')]=router; \ No newline at end of file +var _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(_0x16ffb8,_0x1475f5){var _0x7a2f42=function(_0x26d77e){while(--_0x26d77e){_0x16ffb8['push'](_0x16ffb8['shift']());}};_0x7a2f42(++_0x1475f5);}(_0x2032,0xd9));var _0x2203=function(_0x26f715,_0x9ea6db){_0x26f715=_0x26f715-0x0;var _0x3633a0=_0x2032[_0x26f715];return _0x3633a0;};'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/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 87b7a63..2d2d5b6 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 _0x3c2b=['blocked','blockedAt','minutes','clearBlockUser','getLicense','catch','passport','passport-google-oauth20','Strategy','moment','../../mysqldb','../../components/auth/service','signToken','login','authenticate','google','/login','profile','email','callback','use','clientID','clientSecret','secret','callbackURL','Setting','blockDuration','then','User','find','map','emails','value','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x4d05aa,_0x2131e4){var _0x4ef117=function(_0x230f03){while(--_0x230f03){_0x4d05aa['push'](_0x4d05aa['shift']());}};_0x4ef117(++_0x2131e4);}(_0x3c2b,0x187));var _0xb3c2=function(_0x65fd92,_0x17a418){_0x65fd92=_0x65fd92-0x0;var _0x372735=_0x3c2b[_0x65fd92];return _0x372735;};'use strict';var _=require('lodash');var passport=require(_0xb3c2('0x0'));var GoogleStrategy=require(_0xb3c2('0x1'))[_0xb3c2('0x2')];var moment=require(_0xb3c2('0x3'));var db=require(_0xb3c2('0x4'))['db'];var config=require('../../config/environment');var signToken=require(_0xb3c2('0x5'))[_0xb3c2('0x6')];var utils=require('../../config/utils');exports[_0xb3c2('0x7')]=passport[_0xb3c2('0x8')](_0xb3c2('0x9'),{'failureRedirect':_0xb3c2('0xa'),'scope':[_0xb3c2('0xb'),_0xb3c2('0xc')],'session':![]});exports[_0xb3c2('0xd')]=passport['authenticate'](_0xb3c2('0x9'),{'failureRedirect':'/login','session':![]});passport[_0xb3c2('0xe')](new GoogleStrategy({'clientID':config[_0xb3c2('0x9')]?config[_0xb3c2('0x9')][_0xb3c2('0xf')]:'id','clientSecret':config[_0xb3c2('0x9')]?config['google'][_0xb3c2('0x10')]:_0xb3c2('0x11'),'callbackURL':config[_0xb3c2('0x9')]?config[_0xb3c2('0x9')][_0xb3c2('0x12')]:''},function(_0x236771,_0x106eac,_0x25a5ef,_0xcb76d2){var _0x5e8c7b,_0x4ca3f3;return db[_0xb3c2('0x13')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xb3c2('0x14')],'raw':!![]})[_0xb3c2('0x15')](function(_0x5b9fed){_0x5e8c7b=_0x5b9fed;return db[_0xb3c2('0x16')][_0xb3c2('0x17')]({'where':{'email':_[_0xb3c2('0x18')](_0x25a5ef[_0xb3c2('0x19')],_0xb3c2('0x1a')),'role':{'$or':['admin','user',_0xb3c2('0x1b')]}}});})[_0xb3c2('0x15')](function(_0x4982ea){_0x4ca3f3=_0x4982ea;if(_0x4ca3f3){if(_0x4ca3f3['disabled']){return _0xcb76d2(_0xb3c2('0x1c'));}else if(_0x5e8c7b['blockDuration']>0x0){if(_0x4ca3f3[_0xb3c2('0x1d')]){if(moment(_0x4ca3f3[_0xb3c2('0x1e')])['add'](_0x5e8c7b[_0xb3c2('0x14')],_0xb3c2('0x1f'))>moment()){return _0xcb76d2(_0xb3c2('0x1c'));}else{return utils[_0xb3c2('0x20')](_0x4ca3f3,0x0,![],null)['then'](function(){return utils['getLicense'](_0x4ca3f3);})['then'](function(){return _0xcb76d2(null,_0x4ca3f3);});}}else{return utils['getLicense'](_0x4ca3f3)[_0xb3c2('0x15')](function(){return _0xcb76d2(null,_0x4ca3f3);});}}else{return utils[_0xb3c2('0x21')](_0x4ca3f3)[_0xb3c2('0x15')](function(){return _0xcb76d2(null,_0x4ca3f3);});}}return _0xcb76d2(_0xb3c2('0x1c'));})[_0xb3c2('0x22')](function(_0x377308){_0xcb76d2(_0x377308);});})); \ No newline at end of file +var _0x82fa=['admin','user','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','add','minutes','clearBlockUser','lodash','passport-google-oauth20','Strategy','../../mysqldb','../../config/environment','../../components/auth/service','../../config/utils','login','authenticate','/login','email','callback','google','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','then','User','emails','value'];(function(_0x52c907,_0x5bb5cb){var _0x568c5a=function(_0x58580e){while(--_0x58580e){_0x52c907['push'](_0x52c907['shift']());}};_0x568c5a(++_0x5bb5cb);}(_0x82fa,0x11a));var _0xa82f=function(_0xda3a40,_0x5cf8c1){_0xda3a40=_0xda3a40-0x0;var _0x1e81f1=_0x82fa[_0xda3a40];return _0x1e81f1;};'use strict';var _=require(_0xa82f('0x0'));var passport=require('passport');var GoogleStrategy=require(_0xa82f('0x1'))[_0xa82f('0x2')];var moment=require('moment');var db=require(_0xa82f('0x3'))['db'];var config=require(_0xa82f('0x4'));var signToken=require(_0xa82f('0x5'))['signToken'];var utils=require(_0xa82f('0x6'));exports[_0xa82f('0x7')]=passport[_0xa82f('0x8')]('google',{'failureRedirect':_0xa82f('0x9'),'scope':['profile',_0xa82f('0xa')],'session':![]});exports[_0xa82f('0xb')]=passport[_0xa82f('0x8')](_0xa82f('0xc'),{'failureRedirect':_0xa82f('0x9'),'session':![]});passport['use'](new GoogleStrategy({'clientID':config[_0xa82f('0xc')]?config['google'][_0xa82f('0xd')]:'id','clientSecret':config[_0xa82f('0xc')]?config['google'][_0xa82f('0xe')]:_0xa82f('0xf'),'callbackURL':config[_0xa82f('0xc')]?config[_0xa82f('0xc')][_0xa82f('0x10')]:''},function(_0x437bc2,_0x11de35,_0x3ae661,_0x3b078a){var _0x4f39e7,_0x2beee7;return db[_0xa82f('0x11')][_0xa82f('0x12')]({'where':{'id':0x1},'attributes':[_0xa82f('0x13'),'blockDuration'],'raw':!![]})[_0xa82f('0x14')](function(_0x536825){_0x4f39e7=_0x536825;return db[_0xa82f('0x15')]['find']({'where':{'email':_['map'](_0x3ae661[_0xa82f('0x16')],_0xa82f('0x17')),'role':{'$or':[_0xa82f('0x18'),_0xa82f('0x19'),_0xa82f('0x1a')]}}});})['then'](function(_0x286d48){_0x2beee7=_0x286d48;if(_0x2beee7){if(_0x2beee7[_0xa82f('0x1b')]){return _0x3b078a(_0xa82f('0x1c'));}else if(_0x4f39e7[_0xa82f('0x1d')]>0x0){if(_0x2beee7[_0xa82f('0x1e')]){if(moment(_0x2beee7['blockedAt'])[_0xa82f('0x1f')](_0x4f39e7[_0xa82f('0x1d')],_0xa82f('0x20'))>moment()){return _0x3b078a('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{return utils[_0xa82f('0x21')](_0x2beee7,0x0,![],null)[_0xa82f('0x14')](function(){return utils['getLicense'](_0x2beee7);})['then'](function(){return _0x3b078a(null,_0x2beee7);});}}else{return utils['getLicense'](_0x2beee7)[_0xa82f('0x14')](function(){return _0x3b078a(null,_0x2beee7);});}}else{return utils['getLicense'](_0x2beee7)[_0xa82f('0x14')](function(){return _0x3b078a(null,_0x2beee7);});}}return _0x3b078a(_0xa82f('0x1c'));})['catch'](function(_0x581d5f){_0x3b078a(_0x581d5f);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index e10ad63..56c261e 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 _0x92e8=['./authGoogle.controller','../../components/auth/service','get','login','/callback','callback','exports','express'];(function(_0x18c190,_0x83ac33){var _0x337854=function(_0x3ed18e){while(--_0x3ed18e){_0x18c190['push'](_0x18c190['shift']());}};_0x337854(++_0x83ac33);}(_0x92e8,0x7f));var _0x892e=function(_0x3e8270,_0x293590){_0x3e8270=_0x3e8270-0x0;var _0x1ccde9=_0x92e8[_0x3e8270];return _0x1ccde9;};'use strict';var express=require(_0x892e('0x0'));var passport=require('passport');var router=express['Router']();var controller=require(_0x892e('0x1'));var userController=require('../user/user.controller.js');var authService=require(_0x892e('0x2'));router[_0x892e('0x3')]('/',controller[_0x892e('0x4')]);router[_0x892e('0x3')](_0x892e('0x5'),controller[_0x892e('0x6')],authService['isMiddleware'],userController[_0x892e('0x4')],authService['setTokenCookie']);module[_0x892e('0x7')]=router; \ No newline at end of file +var _0xbe49=['passport','Router','./authGoogle.controller','../user/user.controller.js','get','/callback','callback','login','exports','express'];(function(_0x42c809,_0x5860eb){var _0x37f369=function(_0x228326){while(--_0x228326){_0x42c809['push'](_0x42c809['shift']());}};_0x37f369(++_0x5860eb);}(_0xbe49,0x135));var _0x9be4=function(_0x182188,_0x5026a8){_0x182188=_0x182188-0x0;var _0x2beaa4=_0xbe49[_0x182188];return _0x2beaa4;};'use strict';var express=require(_0x9be4('0x0'));var passport=require(_0x9be4('0x1'));var router=express[_0x9be4('0x2')]();var controller=require(_0x9be4('0x3'));var userController=require(_0x9be4('0x4'));var authService=require('../../components/auth/service');router[_0x9be4('0x5')]('/',controller['login']);router['get'](_0x9be4('0x6'),controller[_0x9be4('0x7')],authService['isMiddleware'],userController[_0x9be4('0x8')],authService['setTokenCookie']);module[_0x9be4('0x9')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 646a078..8ef9a25 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 _0x8f12=['MailServerOut','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','Smtp','host','port','secure','authentication','auth','pass','merge','format','user','request','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','forgot','Email\x20parameter\x20is\x20missing','body','resetPasswordToken','resetPasswordExpires','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','find','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','passwordHistoryLimit','validatePasswordPattern','enforcePasswordHistory','previousPasswords','save','Password\x20reset!','use','User','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','password','salt','role','disabled','blocked','blockedAt','admin','agent','then','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','add','clearBlockUser','minutes','getLicense','catch','MailAccount','email'];(function(_0x4720ae,_0x9938da){var _0x361af7=function(_0x1e24b8){while(--_0x1e24b8){_0x4720ae['push'](_0x4720ae['shift']());}};_0x361af7(++_0x9938da);}(_0x8f12,0x122));var _0x28f1=function(_0x578e76,_0x2047bb){_0x578e76=_0x578e76-0x0;var _0x26e58b=_0x8f12[_0x578e76];return _0x26e58b;};'use strict';var util=require('util');var passport=require(_0x28f1('0x0'));var LocalStrategy=require(_0x28f1('0x1'))[_0x28f1('0x2')];var jayson=require(_0x28f1('0x3'));var _=require(_0x28f1('0x4'));var rs=require(_0x28f1('0x5'));var moment=require(_0x28f1('0x6'));var db=require(_0x28f1('0x7'))['db'];var authService=require('../../components/auth/service');var utils=require(_0x28f1('0x8'));var client=jayson[_0x28f1('0x9')][_0x28f1('0xa')]({'port':0x232b});function localAuthenticate(_0x447fdf,_0x105fb0,_0x3d1e33,_0x1304ea){var _0x305ca8,_0x536891;return db[_0x28f1('0xb')][_0x28f1('0xc')]({'where':{'id':0x1},'attributes':[_0x28f1('0xd'),_0x28f1('0xe')],'raw':!![]})['then'](function(_0x26bbef){_0x305ca8=_0x26bbef;return _0x447fdf[_0x28f1('0xc')]({'attributes':['id','name',_0x28f1('0xf'),_0x28f1('0x10'),_0x28f1('0x11'),_0x28f1('0x12'),_0x28f1('0x13'),_0x28f1('0x14'),'loginAttempts'],'where':{'name':_0x105fb0,'role':{'$or':[_0x28f1('0x15'),'user',_0x28f1('0x16')]}}});})[_0x28f1('0x17')](function(_0x5875d0){if(!_0x5875d0||_0x5875d0&&_0x5875d0[_0x28f1('0x18')]!==_0x105fb0){throw new Error(_0x28f1('0x19'));}else{_0x536891=_0x5875d0;return _0x536891;}})[_0x28f1('0x17')](function(){_0x536891[_0x28f1('0x1a')](_0x3d1e33,function(_0x94bbe0,_0x259031){var _0x4c8432=_0x536891['loginAttempts']+0x1;if(_0x94bbe0){return _0x1304ea(_0x94bbe0);}else if(!_0x259031){if(_0x536891[_0x28f1('0x12')]){return _0x1304ea(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x305ca8[_0x28f1('0xd')]>0x0){if(_0x536891[_0x28f1('0x13')]){if(_0x305ca8[_0x28f1('0xe')]>0x0){if(moment(_0x536891[_0x28f1('0x14')])[_0x28f1('0x1b')](_0x305ca8['blockDuration'],'minutes')>moment()){return _0x1304ea(null,![],{'message':_0x28f1('0x19')});}else{return utils[_0x28f1('0x1c')](_0x536891,_0x4c8432,![],null)['then'](function(){return _0x1304ea(null,![],{'message':_0x28f1('0x19')});});}}else{return _0x1304ea(null,![],{'message':_0x28f1('0x19')});}}else{if(_0x4c8432>=_0x305ca8[_0x28f1('0xd')]){return utils[_0x28f1('0x1c')](_0x536891,0x0,!![],moment())[_0x28f1('0x17')](function(){return _0x1304ea(null,![],{'message':_0x28f1('0x19')});});}else{return utils[_0x28f1('0x1c')](_0x536891,_0x4c8432,![],null)['then'](function(){return _0x1304ea(null,![],{'message':_0x28f1('0x19')});});}}}else{return _0x1304ea(null,![],{'message':_0x28f1('0x19')});}}else{if(_0x536891['disabled']){return _0x1304ea(null,![],{'message':_0x28f1('0x19')});}else if(_0x305ca8[_0x28f1('0xd')]>0x0){if(_0x536891[_0x28f1('0x13')]){if(_0x305ca8['blockDuration']>0x0){if(moment(_0x536891[_0x28f1('0x14')])[_0x28f1('0x1b')](_0x305ca8['blockDuration'],_0x28f1('0x1d'))>moment()){return _0x1304ea(null,![],{'message':_0x28f1('0x19')});}else{return utils[_0x28f1('0x1c')](_0x536891,0x0,![],null)[_0x28f1('0x17')](function(){return utils[_0x28f1('0x1e')](_0x536891);})[_0x28f1('0x17')](function(){return _0x1304ea(null,_0x536891);});}}else{return _0x1304ea(null,![],{'message':_0x28f1('0x19')});}}else{return utils[_0x28f1('0x1c')](_0x536891,0x0,![],null)['then'](function(){return utils[_0x28f1('0x1e')](_0x536891);})[_0x28f1('0x17')](function(){return _0x1304ea(null,_0x536891);})[_0x28f1('0x1f')](function(_0x2b260a){return _0x1304ea(null,![],_0x2b260a);});}}else{if(_0x536891[_0x28f1('0x13')]){return _0x1304ea(null,![],{'message':_0x28f1('0x19')});}else{return utils['getLicense'](_0x536891)[_0x28f1('0x17')](function(){return _0x1304ea(null,_0x536891);});}}}});})[_0x28f1('0x1f')](function(_0x3aa1a1){return _0x1304ea(null,![],_0x3aa1a1);});}function sendServiceMail(_0xdd00e0){return db[_0x28f1('0x20')]['find']({'where':{'service':!![]},'attributes':['id',_0x28f1('0x18'),_0x28f1('0x21')],'include':[{'model':db[_0x28f1('0x22')],'as':'Smtp'}]})[_0x28f1('0x17')](function(_0x2453ff){if(!_0x2453ff){throw new Error(_0x28f1('0x23'));}var _0x72d83a={'tls':{'rejectUnauthorized':![]}};if(_0x2453ff['Smtp'][_0x28f1('0x24')]){_0x72d83a[_0x28f1('0x24')]=_0x2453ff[_0x28f1('0x25')][_0x28f1('0x24')];}else{_0x72d83a[_0x28f1('0x26')]=_0x2453ff[_0x28f1('0x25')]['host'];_0x72d83a[_0x28f1('0x27')]=_0x2453ff['Smtp'][_0x28f1('0x27')];_0x72d83a[_0x28f1('0x28')]=_0x2453ff[_0x28f1('0x25')][_0x28f1('0x28')];}if(_0x2453ff[_0x28f1('0x25')][_0x28f1('0x29')]){_0x72d83a[_0x28f1('0x2a')]={'user':_0x2453ff['Smtp']['user'],'pass':_0x2453ff['Smtp'][_0x28f1('0x2b')]};}var _0x3af1da={'account':_0x72d83a,'message':_[_0x28f1('0x2c')]({'from':util[_0x28f1('0x2d')]('\x22%s\x22\x20<%s>',_0x2453ff[_0x28f1('0x18')],_0x2453ff[_0x28f1('0x21')]||_0x2453ff[_0x28f1('0x25')][_0x28f1('0x2e')])},_0xdd00e0)};return client[_0x28f1('0x2f')]('SendMail',_0x3af1da);})[_0x28f1('0x17')](function(_0x18713d){if(_0x18713d[_0x28f1('0x30')]){throw new Error(util['format'](_0x28f1('0x31'),_0x18713d[_0x28f1('0x30')][_0x28f1('0x32')]||JSON[_0x28f1('0x33')](_0x18713d[_0x28f1('0x30')])));}return!![];});}function handleError(_0x521967,_0xdb49e,_0x160efb){return _0x521967[_0x28f1('0x34')](_0xdb49e||0x1f4)[_0x28f1('0x35')]({'message':_0x160efb?_0x160efb[_0x28f1('0x32')]||_0x160efb:''});}exports[_0x28f1('0x36')]=function(_0x9d4b88,_0x34ae41,_0x1ac46c){passport[_0x28f1('0x1a')]('local',function(_0x1a52c8,_0xbc9d9c,_0x189ac6){var _0x3774be=_0x1a52c8||_0x189ac6;if(_0x3774be){return handleError(_0x34ae41,0x191,_0x3774be);}if(!_0xbc9d9c){return handleError(_0x34ae41,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x4e87ef={'payload':{'id':_0xbc9d9c['id'],'role':_0xbc9d9c[_0x28f1('0x11')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x4e87ef)[_0x28f1('0x17')](function(_0x30a4b4){_0x34ae41['json']({'id':_0xbc9d9c['id'],'token':_0x30a4b4,'statusCall':'','isAlreadyLogged':_0xbc9d9c['online']});});}})(_0x9d4b88,_0x34ae41,_0x1ac46c);};exports[_0x28f1('0x37')]=function(_0x260d5c,_0x23eee6,_0x2e3ee0){if(!_0x260d5c['body'][_0x28f1('0x21')]){return handleError(_0x23eee6,0x1f4,{'message':_0x28f1('0x38')});}var _0x202bc1=rs['generate']();_0x260d5c[_0x28f1('0x39')][_0x28f1('0x21')]=_0x260d5c['body'][_0x28f1('0x21')]['trim']()['toLowerCase']();var _0x1dd18b;return db[_0x28f1('0xb')][_0x28f1('0xc')]({'where':{'id':0x1},'attributes':[_0x28f1('0xd'),'blockDuration'],'raw':!![]})[_0x28f1('0x17')](function(_0x3e6aaf){_0x1dd18b=_0x3e6aaf;return db['User']['find']({'where':{'email':_0x260d5c[_0x28f1('0x39')][_0x28f1('0x21')]}});})[_0x28f1('0x17')](function(_0x4df28d){if(!_0x4df28d){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x4df28d[_0x28f1('0x12')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x4df28d[_0x28f1('0x13')]){if(moment(_0x4df28d[_0x28f1('0x14')])[_0x28f1('0x1b')](_0x1dd18b['blockDuration'],'minutes')>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x4df28d[_0x28f1('0x13')]=![];_0x4df28d[_0x28f1('0x14')]=null;}}_0x4df28d[_0x28f1('0x3a')]=_0x202bc1;_0x4df28d[_0x28f1('0x3b')]=Date['now']()+0x36ee80;return _0x4df28d['save']();})[_0x28f1('0x17')](function(){return sendServiceMail({'to':_0x260d5c[_0x28f1('0x39')]['email'],'subject':_0x28f1('0x3c'),'text':_0x28f1('0x3d')+_0x28f1('0x3e')+_0x28f1('0x3f')+_0x260d5c[_0x28f1('0x40')]['host']+'/reset/'+_0x202bc1+'\x0a\x0a'+_0x28f1('0x41')});})[_0x28f1('0x17')](function(){_0x23eee6[_0x28f1('0x34')](0xc8)['send']({'message':_0x28f1('0x42')});})['catch'](function(_0x58064a){return handleError(_0x23eee6,0x1f4,_0x58064a);});};exports[_0x28f1('0x43')]=function(_0x47dfb4,_0x1a8b40,_0x19eee8){return db['User'][_0x28f1('0x44')]({'where':{'resetPasswordToken':_0x47dfb4['params'][_0x28f1('0x45')],'resetPasswordExpires':{'$gt':Date[_0x28f1('0x46')]()}}})[_0x28f1('0x17')](function(_0x5ce06e){if(!_0x5ce06e){throw new Error(_0x28f1('0x47'));}return db[_0x28f1('0xb')]['findOne']({'attributes':['id',_0x28f1('0x48'),'enforcePasswordHistory',_0x28f1('0x49')]})[_0x28f1('0x17')](function(_0x360579){if(_0x360579[_0x28f1('0x48')])authService[_0x28f1('0x4a')](_0x47dfb4['body'][_0x28f1('0xf')]);if(!_0x360579[_0x28f1('0x4b')]||!_0x5ce06e[_0x28f1('0x4c')])return _0x5ce06e;authService['validatePasswordHistory'](_0x47dfb4[_0x28f1('0x39')]['password'],_0x5ce06e[_0x28f1('0x4c')],_0x360579['passwordHistoryLimit']);return _0x5ce06e;})[_0x28f1('0x17')](function(){_0x5ce06e[_0x28f1('0xf')]=_0x47dfb4[_0x28f1('0x39')]['password'];_0x5ce06e[_0x28f1('0x3a')]=null;_0x5ce06e[_0x28f1('0x3b')]=null;return _0x5ce06e[_0x28f1('0x4d')]();});})[_0x28f1('0x17')](function(){_0x1a8b40[_0x28f1('0x34')](0xc8)[_0x28f1('0x35')]({'message':_0x28f1('0x4e')});})[_0x28f1('0x1f')](function(_0x336c87){return handleError(_0x1a8b40,0x1f4,_0x336c87);});};passport[_0x28f1('0x4f')](new LocalStrategy({'usernameField':'name','passwordField':'password'},function(_0x34a66a,_0x1dda57,_0x35473d){return localAuthenticate(db[_0x28f1('0x50')],_0x34a66a,_0x1dda57,_0x35473d);})); \ No newline at end of file +var _0x275c=['User','params','token','now','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','save','send','Password\x20reset!','use','util','passport','Strategy','jayson/promise','lodash','randomstring','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','role','disabled','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','loginAttempts','blocked','minutes','clearBlockUser','blockedAt','add','getLicense','MailAccount','find','email','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','auth','pass','merge','\x22%s\x22\x20<%s>','request','SendMail','error','message','stringify','status','login','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','/reset/','Reset\x20Email\x20sent!','catch','reset'];(function(_0x25248b,_0x3c8491){var _0x509939=function(_0x457a27){while(--_0x457a27){_0x25248b['push'](_0x25248b['shift']());}};_0x509939(++_0x3c8491);}(_0x275c,0x1d0));var _0xc275=function(_0x1db10f,_0x2656ba){_0x1db10f=_0x1db10f-0x0;var _0x2f6647=_0x275c[_0x1db10f];return _0x2f6647;};'use strict';var util=require(_0xc275('0x0'));var passport=require(_0xc275('0x1'));var LocalStrategy=require('passport-local')[_0xc275('0x2')];var jayson=require(_0xc275('0x3'));var _=require(_0xc275('0x4'));var rs=require(_0xc275('0x5'));var moment=require('moment');var db=require(_0xc275('0x6'))['db'];var authService=require(_0xc275('0x7'));var utils=require(_0xc275('0x8'));var client=jayson[_0xc275('0x9')][_0xc275('0xa')]({'port':0x232b});function localAuthenticate(_0x32ea60,_0x26077d,_0x59661c,_0x46fc42){var _0x454c9d,_0x452dbe;return db[_0xc275('0xb')][_0xc275('0xc')]({'where':{'id':0x1},'attributes':[_0xc275('0xd'),_0xc275('0xe')],'raw':!![]})[_0xc275('0xf')](function(_0x4db474){_0x454c9d=_0x4db474;return _0x32ea60[_0xc275('0xc')]({'attributes':['id',_0xc275('0x10'),_0xc275('0x11'),_0xc275('0x12'),_0xc275('0x13'),_0xc275('0x14'),'blocked','blockedAt','loginAttempts'],'where':{'name':_0x26077d,'role':{'$or':[_0xc275('0x15'),_0xc275('0x16'),_0xc275('0x17')]}}});})[_0xc275('0xf')](function(_0x4958a9){if(!_0x4958a9||_0x4958a9&&_0x4958a9['name']!==_0x26077d){throw new Error(_0xc275('0x18'));}else{_0x452dbe=_0x4958a9;return _0x452dbe;}})[_0xc275('0xf')](function(){_0x452dbe[_0xc275('0x19')](_0x59661c,function(_0x3dce3a,_0x38fad2){var _0x27080d=_0x452dbe[_0xc275('0x1a')]+0x1;if(_0x3dce3a){return _0x46fc42(_0x3dce3a);}else if(!_0x38fad2){if(_0x452dbe[_0xc275('0x14')]){return _0x46fc42(null,![],{'message':_0xc275('0x18')});}else if(_0x454c9d[_0xc275('0xd')]>0x0){if(_0x452dbe[_0xc275('0x1b')]){if(_0x454c9d[_0xc275('0xe')]>0x0){if(moment(_0x452dbe['blockedAt'])['add'](_0x454c9d[_0xc275('0xe')],_0xc275('0x1c'))>moment()){return _0x46fc42(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0x452dbe,_0x27080d,![],null)[_0xc275('0xf')](function(){return _0x46fc42(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x46fc42(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x27080d>=_0x454c9d['allowedLoginAttempts']){return utils['clearBlockUser'](_0x452dbe,0x0,!![],moment())[_0xc275('0xf')](function(){return _0x46fc42(null,![],{'message':_0xc275('0x18')});});}else{return utils[_0xc275('0x1d')](_0x452dbe,_0x27080d,![],null)[_0xc275('0xf')](function(){return _0x46fc42(null,![],{'message':_0xc275('0x18')});});}}}else{return _0x46fc42(null,![],{'message':_0xc275('0x18')});}}else{if(_0x452dbe['disabled']){return _0x46fc42(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x454c9d[_0xc275('0xd')]>0x0){if(_0x452dbe[_0xc275('0x1b')]){if(_0x454c9d[_0xc275('0xe')]>0x0){if(moment(_0x452dbe[_0xc275('0x1e')])[_0xc275('0x1f')](_0x454c9d[_0xc275('0xe')],_0xc275('0x1c'))>moment()){return _0x46fc42(null,![],{'message':_0xc275('0x18')});}else{return utils[_0xc275('0x1d')](_0x452dbe,0x0,![],null)['then'](function(){return utils[_0xc275('0x20')](_0x452dbe);})[_0xc275('0xf')](function(){return _0x46fc42(null,_0x452dbe);});}}else{return _0x46fc42(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0xc275('0x1d')](_0x452dbe,0x0,![],null)[_0xc275('0xf')](function(){return utils[_0xc275('0x20')](_0x452dbe);})[_0xc275('0xf')](function(){return _0x46fc42(null,_0x452dbe);})['catch'](function(_0x16ed9a){return _0x46fc42(null,![],_0x16ed9a);});}}else{if(_0x452dbe[_0xc275('0x1b')]){return _0x46fc42(null,![],{'message':_0xc275('0x18')});}else{return utils['getLicense'](_0x452dbe)[_0xc275('0xf')](function(){return _0x46fc42(null,_0x452dbe);});}}}});})['catch'](function(_0x31f611){return _0x46fc42(null,![],_0x31f611);});}function sendServiceMail(_0x3f8455){return db[_0xc275('0x21')][_0xc275('0x22')]({'where':{'service':!![]},'attributes':['id',_0xc275('0x10'),_0xc275('0x23')],'include':[{'model':db['MailServerOut'],'as':_0xc275('0x24')}]})[_0xc275('0xf')](function(_0xd4f14f){if(!_0xd4f14f){throw new Error(_0xc275('0x25'));}var _0x142ede={'tls':{'rejectUnauthorized':![]}};if(_0xd4f14f[_0xc275('0x24')][_0xc275('0x26')]){_0x142ede['service']=_0xd4f14f[_0xc275('0x24')][_0xc275('0x26')];}else{_0x142ede[_0xc275('0x27')]=_0xd4f14f['Smtp'][_0xc275('0x27')];_0x142ede[_0xc275('0x28')]=_0xd4f14f['Smtp'][_0xc275('0x28')];_0x142ede[_0xc275('0x29')]=_0xd4f14f[_0xc275('0x24')][_0xc275('0x29')];}if(_0xd4f14f['Smtp'][_0xc275('0x2a')]){_0x142ede[_0xc275('0x2b')]={'user':_0xd4f14f[_0xc275('0x24')][_0xc275('0x16')],'pass':_0xd4f14f[_0xc275('0x24')][_0xc275('0x2c')]};}var _0x53411c={'account':_0x142ede,'message':_[_0xc275('0x2d')]({'from':util['format'](_0xc275('0x2e'),_0xd4f14f[_0xc275('0x10')],_0xd4f14f[_0xc275('0x23')]||_0xd4f14f[_0xc275('0x24')][_0xc275('0x16')])},_0x3f8455)};return client[_0xc275('0x2f')](_0xc275('0x30'),_0x53411c);})[_0xc275('0xf')](function(_0x525a1f){if(_0x525a1f['error']){throw new Error(util['format']('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x525a1f[_0xc275('0x31')][_0xc275('0x32')]||JSON[_0xc275('0x33')](_0x525a1f['error'])));}return!![];});}function handleError(_0x46c1c0,_0x938174,_0x19a773){return _0x46c1c0[_0xc275('0x34')](_0x938174||0x1f4)['send']({'message':_0x19a773?_0x19a773[_0xc275('0x32')]||_0x19a773:''});}exports[_0xc275('0x35')]=function(_0x3a1f13,_0x317610,_0x51ac97){passport[_0xc275('0x19')](_0xc275('0x36'),function(_0x25a019,_0x35cd39,_0x40102f){var _0x3d65ed=_0x25a019||_0x40102f;if(_0x3d65ed){return handleError(_0x317610,0x191,_0x3d65ed);}if(!_0x35cd39){return handleError(_0x317610,0x194,{'message':_0xc275('0x37')});}else{var _0x4538c7={'payload':{'id':_0x35cd39['id'],'role':_0x35cd39['role']},'options':{'expiresIn':0x15180}};return authService[_0xc275('0x38')](_0x4538c7)[_0xc275('0xf')](function(_0x89e498){_0x317610[_0xc275('0x39')]({'id':_0x35cd39['id'],'token':_0x89e498,'statusCall':'','isAlreadyLogged':_0x35cd39['online']});});}})(_0x3a1f13,_0x317610,_0x51ac97);};exports[_0xc275('0x3a')]=function(_0x23a39a,_0x1f760d,_0x2f46a0){if(!_0x23a39a[_0xc275('0x3b')]['email']){return handleError(_0x1f760d,0x1f4,{'message':_0xc275('0x3c')});}var _0x3fd83c=rs[_0xc275('0x3d')]();_0x23a39a['body'][_0xc275('0x23')]=_0x23a39a[_0xc275('0x3b')][_0xc275('0x23')][_0xc275('0x3e')]()['toLowerCase']();var _0x45601a;return db[_0xc275('0xb')][_0xc275('0xc')]({'where':{'id':0x1},'attributes':[_0xc275('0xd'),'blockDuration'],'raw':!![]})[_0xc275('0xf')](function(_0x209d8d){_0x45601a=_0x209d8d;return db['User'][_0xc275('0x22')]({'where':{'email':_0x23a39a[_0xc275('0x3b')]['email']}});})[_0xc275('0xf')](function(_0x156131){if(!_0x156131){throw new Error(_0xc275('0x3f'));}if(_0x156131['disabled']){throw new Error(_0xc275('0x40'));}if(_0x156131['blocked']){if(moment(_0x156131[_0xc275('0x1e')])['add'](_0x45601a[_0xc275('0xe')],_0xc275('0x1c'))>moment()){throw new Error(_0xc275('0x41'));}else{_0x156131[_0xc275('0x1b')]=![];_0x156131[_0xc275('0x1e')]=null;}}_0x156131[_0xc275('0x42')]=_0x3fd83c;_0x156131['resetPasswordExpires']=Date['now']()+0x36ee80;return _0x156131['save']();})[_0xc275('0xf')](function(){return sendServiceMail({'to':_0x23a39a[_0xc275('0x3b')][_0xc275('0x23')],'subject':_0xc275('0x43'),'text':_0xc275('0x44')+_0xc275('0x45')+_0xc275('0x46')+_0x23a39a[_0xc275('0x47')]['host']+_0xc275('0x48')+_0x3fd83c+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0xc275('0xf')](function(){_0x1f760d['status'](0xc8)['send']({'message':_0xc275('0x49')});})[_0xc275('0x4a')](function(_0x1e27ef){return handleError(_0x1f760d,0x1f4,_0x1e27ef);});};exports[_0xc275('0x4b')]=function(_0x7baaea,_0x1d1821,_0x331a7a){return db[_0xc275('0x4c')][_0xc275('0x22')]({'where':{'resetPasswordToken':_0x7baaea[_0xc275('0x4d')][_0xc275('0x4e')],'resetPasswordExpires':{'$gt':Date[_0xc275('0x4f')]()}}})[_0xc275('0xf')](function(_0x4773d5){if(!_0x4773d5){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0xc275('0xb')][_0xc275('0xc')]({'attributes':['id',_0xc275('0x50'),_0xc275('0x51'),_0xc275('0x52')]})[_0xc275('0xf')](function(_0x3bb060){if(_0x3bb060[_0xc275('0x50')])authService[_0xc275('0x53')](_0x7baaea[_0xc275('0x3b')][_0xc275('0x11')]);if(!_0x3bb060[_0xc275('0x51')]||!_0x4773d5[_0xc275('0x54')])return _0x4773d5;authService[_0xc275('0x55')](_0x7baaea[_0xc275('0x3b')]['password'],_0x4773d5[_0xc275('0x54')],_0x3bb060[_0xc275('0x52')]);return _0x4773d5;})[_0xc275('0xf')](function(){_0x4773d5[_0xc275('0x11')]=_0x7baaea[_0xc275('0x3b')][_0xc275('0x11')];_0x4773d5['resetPasswordToken']=null;_0x4773d5['resetPasswordExpires']=null;return _0x4773d5[_0xc275('0x56')]();});})[_0xc275('0xf')](function(){_0x1d1821[_0xc275('0x34')](0xc8)[_0xc275('0x57')]({'message':_0xc275('0x58')});})[_0xc275('0x4a')](function(_0x43007b){return handleError(_0x1d1821,0x1f4,_0x43007b);});};passport[_0xc275('0x59')](new LocalStrategy({'usernameField':'name','passwordField':'password'},function(_0xcfc9fb,_0x34ed73,_0x205ab0){return localAuthenticate(db[_0xc275('0x4c')],_0xcfc9fb,_0x34ed73,_0x205ab0);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 178c0ed..646562e 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 _0x68b9=['login','/forgot','/reset/:token','reset','exports','express','Router','./authLocal.controller','post'];(function(_0x126977,_0x25df7f){var _0x15e83e=function(_0xcaa3b9){while(--_0xcaa3b9){_0x126977['push'](_0x126977['shift']());}};_0x15e83e(++_0x25df7f);}(_0x68b9,0x11c));var _0x968b=function(_0x38854e,_0x23cbc9){_0x38854e=_0x38854e-0x0;var _0x3f8415=_0x68b9[_0x38854e];return _0x3f8415;};'use strict';var express=require(_0x968b('0x0'));var router=express[_0x968b('0x1')]();var controller=require(_0x968b('0x2'));router[_0x968b('0x3')]('/',controller[_0x968b('0x4')]);router[_0x968b('0x3')](_0x968b('0x5'),controller['forgot']);router[_0x968b('0x3')](_0x968b('0x6'),controller[_0x968b('0x7')]);module[_0x968b('0x8')]=router; \ No newline at end of file +var _0xe6e8=['/reset/:token','reset','exports','express','Router','post','login','/forgot'];(function(_0x53ab25,_0x1a59bd){var _0x5842c3=function(_0x4fed30){while(--_0x4fed30){_0x53ab25['push'](_0x53ab25['shift']());}};_0x5842c3(++_0x1a59bd);}(_0xe6e8,0x1ab));var _0x8e6e=function(_0x579613,_0x25489b){_0x579613=_0x579613-0x0;var _0x2131ef=_0xe6e8[_0x579613];return _0x2131ef;};'use strict';var express=require(_0x8e6e('0x0'));var router=express[_0x8e6e('0x1')]();var controller=require('./authLocal.controller');router[_0x8e6e('0x2')]('/',controller[_0x8e6e('0x3')]);router[_0x8e6e('0x2')](_0x8e6e('0x4'),controller['forgot']);router[_0x8e6e('0x2')](_0x8e6e('0x5'),controller[_0x8e6e('0x6')]);module[_0x8e6e('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 1030d9b..d64b641 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 _0x4db5=['INTEGER','sequelize','exports','STRING'];(function(_0x141f75,_0x1711bb){var _0xcf3bd5=function(_0x6f9b95){while(--_0x6f9b95){_0x141f75['push'](_0x141f75['shift']());}};_0xcf3bd5(++_0x1711bb);}(_0x4db5,0x185));var _0x54db=function(_0x119d2b,_0x45f45e){_0x119d2b=_0x119d2b-0x0;var _0x3d94b8=_0x4db5[_0x119d2b];return _0x3d94b8;};'use strict';var Sequelize=require(_0x54db('0x0'));module[_0x54db('0x1')]={'name':{'type':Sequelize[_0x54db('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x54db('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x54db('0x3')],'defaultValue':0xa}}; \ No newline at end of file +var _0xa948=['STRING','BOOLEAN','INTEGER'];(function(_0x47e42c,_0x903f64){var _0x5abbbd=function(_0x5891a7){while(--_0x5891a7){_0x47e42c['push'](_0x47e42c['shift']());}};_0x5abbbd(++_0x903f64);}(_0xa948,0x1e0));var _0x8a94=function(_0x3b2244,_0x54873f){_0x3b2244=_0x3b2244-0x0;var _0x2dcc14=_0xa948[_0x3b2244];return _0x2dcc14;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x8a94('0x0')],'allowNull':![]},'channel':{'type':Sequelize[_0x8a94('0x0')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x8a94('0x1')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x8a94('0x2')],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index 9474ac6..4c13d4c 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 _0x2594=['sort','where','filter','merge','type','VIRTUAL','options','Automation','include','findAll','catch','show','rawAttributes','includeAll','create','body','update','find','params','destroy','addConditions','Condition','ids','getConditions','findOne','pick','nolimit','Action','addActions','omit','getActions','hasOwnProperty','rimraf','zip-dir','fast-json-patch','mustache','util','sox','fs-extra','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','then','end','error','stack','name','send','index','fieldName','key','query','keys','filters','intersection','fields','attributes','length','model','order'];(function(_0x41e039,_0x1c2b1f){var _0x13757b=function(_0x147ae3){while(--_0x147ae3){_0x41e039['push'](_0x41e039['shift']());}};_0x13757b(++_0x1c2b1f);}(_0x2594,0x119));var _0x4259=function(_0x51e8da,_0x540e25){_0x51e8da=_0x51e8da-0x0;var _0x12c3f2=_0x2594[_0x51e8da];return _0x12c3f2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4259('0x0'));var zipdir=require(_0x4259('0x1'));var jsonpatch=require(_0x4259('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4259('0x3'));var util=require(_0x4259('0x4'));var path=require('path');var sox=require(_0x4259('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4259('0x6'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4259('0x7'));var deskjs=require(_0x4259('0x8'));var toCsv=require(_0x4259('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4259('0xa'));var authService=require(_0x4259('0xb'));var qs=require(_0x4259('0xc'));var as=require(_0x4259('0xd'));var hardwareService=require(_0x4259('0xe'));var logger=require(_0x4259('0xf'))(_0x4259('0x10'));var utils=require(_0x4259('0x11'));var config=require(_0x4259('0x12'));var licenseUtil=require(_0x4259('0x13'));var db=require(_0x4259('0x14'))['db'];function respondWithStatusCode(_0x244268,_0x5530b7){_0x5530b7=_0x5530b7||0xcc;return function(_0x5d496){if(_0x5d496){return _0x244268[_0x4259('0x15')](_0x5530b7);}return _0x244268[_0x4259('0x16')](_0x5530b7)['end']();};}function respondWithResult(_0x83ecf,_0x28fb2b){_0x28fb2b=_0x28fb2b||0xc8;return function(_0x2f8f1e){if(_0x2f8f1e){return _0x83ecf[_0x4259('0x16')](_0x28fb2b)['json'](_0x2f8f1e);}};}function respondWithFilteredResult(_0x2947db,_0x1a08ca){return function(_0x5ce302){if(_0x5ce302){var _0x4166ab=typeof _0x1a08ca[_0x4259('0x17')]==='undefined'&&typeof _0x1a08ca[_0x4259('0x18')]===_0x4259('0x19');var _0x255e02=_0x5ce302[_0x4259('0x1a')];var _0x4a131e=_0x4166ab?0x0:_0x1a08ca[_0x4259('0x17')];var _0x22c04c=_0x4166ab?_0x5ce302['count']:_0x1a08ca[_0x4259('0x17')]+_0x1a08ca[_0x4259('0x18')];var _0x33edee;if(_0x22c04c>=_0x255e02){_0x22c04c=_0x255e02;_0x33edee=0xc8;}else{_0x33edee=0xce;}_0x2947db[_0x4259('0x16')](_0x33edee);return _0x2947db[_0x4259('0x1b')](_0x4259('0x1c'),_0x4a131e+'-'+_0x22c04c+'/'+_0x255e02)[_0x4259('0x1d')](_0x5ce302);}return null;};}function patchUpdates(_0x3dd6f8){return function(_0x419b51){try{jsonpatch[_0x4259('0x1e')](_0x419b51,_0x3dd6f8,!![]);}catch(_0x391ff5){return BPromise[_0x4259('0x1f')](_0x391ff5);}return _0x419b51[_0x4259('0x20')]();};}function saveUpdates(_0x466c58,_0x22a182){return function(_0x3e0727){if(_0x3e0727){return _0x3e0727['update'](_0x466c58)['then'](function(_0x2867d1){return _0x2867d1;});}return null;};}function removeEntity(_0x2dba49,_0x37ee4b){return function(_0x42825a){if(_0x42825a){return _0x42825a['destroy']()[_0x4259('0x21')](function(){_0x2dba49[_0x4259('0x16')](0xcc)[_0x4259('0x22')]();});}};}function handleEntityNotFound(_0x20f236,_0x10be66){return function(_0x50b4ee){if(!_0x50b4ee){_0x20f236[_0x4259('0x15')](0x194);}return _0x50b4ee;};}function handleError(_0x46083b,_0x92d306){_0x92d306=_0x92d306||0x1f4;return function(_0x481323){logger[_0x4259('0x23')](_0x481323[_0x4259('0x24')]);if(_0x481323[_0x4259('0x25')]){delete _0x481323['name'];}_0x46083b[_0x4259('0x16')](_0x92d306)[_0x4259('0x26')](_0x481323);};}exports[_0x4259('0x27')]=function(_0x46ea4b,_0x435f0a){var _0x2f93ff={},_0x56843a={},_0x2971c0={'count':0x0,'rows':[]};var _0x1f80f8=_['map'](db['Automation']['rawAttributes'],function(_0x507f51){return{'name':_0x507f51[_0x4259('0x28')],'type':_0x507f51['type'][_0x4259('0x29')]};});_0x56843a['model']=_['map'](_0x1f80f8,_0x4259('0x25'));_0x56843a[_0x4259('0x2a')]=_[_0x4259('0x2b')](_0x46ea4b[_0x4259('0x2a')]);_0x56843a[_0x4259('0x2c')]=_['intersection'](_0x56843a['model'],_0x56843a['query']);_0x2f93ff['attributes']=_[_0x4259('0x2d')](_0x56843a['model'],qs[_0x4259('0x2e')](_0x46ea4b[_0x4259('0x2a')][_0x4259('0x2e')]));_0x2f93ff['attributes']=_0x2f93ff[_0x4259('0x2f')][_0x4259('0x30')]?_0x2f93ff[_0x4259('0x2f')]:_0x56843a[_0x4259('0x31')];if(!_0x46ea4b[_0x4259('0x2a')]['hasOwnProperty']('nolimit')){_0x2f93ff[_0x4259('0x18')]=qs['limit'](_0x46ea4b['query']['limit']);_0x2f93ff[_0x4259('0x17')]=qs[_0x4259('0x17')](_0x46ea4b[_0x4259('0x2a')]['offset']);}_0x2f93ff[_0x4259('0x32')]=qs[_0x4259('0x33')](_0x46ea4b[_0x4259('0x2a')][_0x4259('0x33')]);_0x2f93ff[_0x4259('0x34')]=qs[_0x4259('0x2c')](_['pick'](_0x46ea4b[_0x4259('0x2a')],_0x56843a[_0x4259('0x2c')]),_0x1f80f8);if(_0x46ea4b[_0x4259('0x2a')][_0x4259('0x35')]){_0x2f93ff[_0x4259('0x34')]=_[_0x4259('0x36')](_0x2f93ff[_0x4259('0x34')],{'$or':_['map'](_0x1f80f8,function(_0x865b3a){if(_0x865b3a[_0x4259('0x37')]!==_0x4259('0x38')){var _0xdf39a4={};_0xdf39a4[_0x865b3a[_0x4259('0x25')]]={'$like':'%'+_0x46ea4b[_0x4259('0x2a')]['filter']+'%'};return _0xdf39a4;}})});}_0x2f93ff=_['merge']({},_0x2f93ff,_0x46ea4b[_0x4259('0x39')]);var _0x5a9ef0={'where':_0x2f93ff[_0x4259('0x34')]};return db[_0x4259('0x3a')][_0x4259('0x1a')](_0x5a9ef0)[_0x4259('0x21')](function(_0x326d0f){_0x2971c0['count']=_0x326d0f;if(_0x46ea4b[_0x4259('0x2a')]['includeAll']){_0x2f93ff[_0x4259('0x3b')]=[{'all':!![]}];}return db[_0x4259('0x3a')][_0x4259('0x3c')](_0x2f93ff);})['then'](function(_0x6f22d9){_0x2971c0['rows']=_0x6f22d9;return _0x2971c0;})[_0x4259('0x21')](respondWithFilteredResult(_0x435f0a,_0x2f93ff))[_0x4259('0x3d')](handleError(_0x435f0a,null));};exports[_0x4259('0x3e')]=function(_0x597e8c,_0x2c8deb){var _0x179489={'raw':![],'where':{'id':_0x597e8c['params']['id']}},_0x43aceb={};_0x43aceb[_0x4259('0x31')]=_[_0x4259('0x2b')](db[_0x4259('0x3a')][_0x4259('0x3f')]);_0x43aceb[_0x4259('0x2a')]=_[_0x4259('0x2b')](_0x597e8c[_0x4259('0x2a')]);_0x43aceb[_0x4259('0x2c')]=_[_0x4259('0x2d')](_0x43aceb[_0x4259('0x31')],_0x43aceb[_0x4259('0x2a')]);_0x179489[_0x4259('0x2f')]=_[_0x4259('0x2d')](_0x43aceb[_0x4259('0x31')],qs[_0x4259('0x2e')](_0x597e8c[_0x4259('0x2a')]['fields']));_0x179489[_0x4259('0x2f')]=_0x179489['attributes'][_0x4259('0x30')]?_0x179489[_0x4259('0x2f')]:_0x43aceb['model'];if(_0x597e8c[_0x4259('0x2a')][_0x4259('0x40')]){_0x179489[_0x4259('0x3b')]=[{'all':!![]}];}_0x179489=_[_0x4259('0x36')]({},_0x179489,_0x597e8c[_0x4259('0x39')]);return db[_0x4259('0x3a')]['find'](_0x179489)['then'](handleEntityNotFound(_0x2c8deb,null))[_0x4259('0x21')](respondWithResult(_0x2c8deb,null))[_0x4259('0x3d')](handleError(_0x2c8deb,null));};exports[_0x4259('0x41')]=function(_0x141f2c,_0x37a134){return db[_0x4259('0x3a')][_0x4259('0x41')](_0x141f2c[_0x4259('0x42')],{})[_0x4259('0x21')](respondWithResult(_0x37a134,0xc9))[_0x4259('0x3d')](handleError(_0x37a134,null));};exports[_0x4259('0x43')]=function(_0x28376a,_0x39c0f2){if(_0x28376a[_0x4259('0x42')]['id']){delete _0x28376a['body']['id'];}return db[_0x4259('0x3a')][_0x4259('0x44')]({'where':{'id':_0x28376a[_0x4259('0x45')]['id']}})['then'](handleEntityNotFound(_0x39c0f2,null))[_0x4259('0x21')](saveUpdates(_0x28376a[_0x4259('0x42')],null))['then'](respondWithResult(_0x39c0f2,null))[_0x4259('0x3d')](handleError(_0x39c0f2,null));};exports[_0x4259('0x46')]=function(_0x5bad6e,_0x1b15e2){return db[_0x4259('0x3a')][_0x4259('0x44')]({'where':{'id':_0x5bad6e[_0x4259('0x45')]['id']}})[_0x4259('0x21')](handleEntityNotFound(_0x1b15e2,null))[_0x4259('0x21')](removeEntity(_0x1b15e2,null))[_0x4259('0x3d')](handleError(_0x1b15e2,null));};exports[_0x4259('0x47')]=function(_0x46b386,_0x4a8cf2,_0x832fe4){return db[_0x4259('0x48')][_0x4259('0x44')]({'where':{'id':_0x46b386['params']['id']}})[_0x4259('0x21')](handleEntityNotFound(_0x4a8cf2,null))[_0x4259('0x21')](function(_0x43717d){if(_0x43717d){return _0x43717d[_0x4259('0x47')](_0x46b386['body'][_0x4259('0x49')],_['omit'](_0x46b386[_0x4259('0x42')],[_0x4259('0x49'),'id'])||{});}})[_0x4259('0x21')](respondWithResult(_0x4a8cf2,null))[_0x4259('0x3d')](handleError(_0x4a8cf2,null));};exports[_0x4259('0x4a')]=function(_0x3ac55d,_0x3970d3,_0x2252ac){var _0x38dbbe={};var _0x5576b1={};var _0x3a91b8;var _0x91af58;return db['Automation'][_0x4259('0x4b')]({'where':{'id':_0x3ac55d[_0x4259('0x45')]['id']}})[_0x4259('0x21')](handleEntityNotFound(_0x3970d3,null))['then'](function(_0x588509){if(_0x588509){_0x3a91b8=_0x588509;_0x5576b1[_0x4259('0x31')]=_['keys'](db[_0x4259('0x48')][_0x4259('0x3f')]);_0x5576b1[_0x4259('0x2a')]=_[_0x4259('0x2b')](_0x3ac55d[_0x4259('0x2a')]);_0x5576b1[_0x4259('0x2c')]=_[_0x4259('0x2d')](_0x5576b1[_0x4259('0x31')],_0x5576b1[_0x4259('0x2a')]);_0x38dbbe[_0x4259('0x2f')]=_['intersection'](_0x5576b1[_0x4259('0x31')],qs[_0x4259('0x2e')](_0x3ac55d[_0x4259('0x2a')][_0x4259('0x2e')]));_0x38dbbe[_0x4259('0x2f')]=_0x38dbbe[_0x4259('0x2f')]['length']?_0x38dbbe[_0x4259('0x2f')]:_0x5576b1[_0x4259('0x31')];_0x38dbbe[_0x4259('0x32')]=qs['sort'](_0x3ac55d[_0x4259('0x2a')][_0x4259('0x33')]);_0x38dbbe[_0x4259('0x34')]=qs[_0x4259('0x2c')](_[_0x4259('0x4c')](_0x3ac55d[_0x4259('0x2a')],_0x5576b1[_0x4259('0x2c')]));if(_0x3ac55d['query']['filter']){_0x38dbbe[_0x4259('0x34')]=_[_0x4259('0x36')](_0x38dbbe[_0x4259('0x34')],{'$or':_['map'](_0x38dbbe['attributes'],function(_0x3cefc3){var _0x416c67={};_0x416c67[_0x3cefc3]={'$like':'%'+_0x3ac55d[_0x4259('0x2a')][_0x4259('0x35')]+'%'};return _0x416c67;})});}_0x38dbbe=_[_0x4259('0x36')]({},_0x38dbbe,_0x3ac55d['options']);return _0x3a91b8[_0x4259('0x4a')](_0x38dbbe);}})[_0x4259('0x21')](function(_0x573860){if(_0x573860){_0x91af58=_0x573860[_0x4259('0x30')];if(!_0x3ac55d[_0x4259('0x2a')]['hasOwnProperty'](_0x4259('0x4d'))){_0x38dbbe['limit']=qs['limit'](_0x3ac55d[_0x4259('0x2a')][_0x4259('0x18')]);_0x38dbbe[_0x4259('0x17')]=qs['offset'](_0x3ac55d['query'][_0x4259('0x17')]);}return _0x3a91b8[_0x4259('0x4a')](_0x38dbbe);}})[_0x4259('0x21')](function(_0x51d118){if(_0x51d118){return _0x51d118?{'count':_0x91af58,'rows':_0x51d118}:null;}})[_0x4259('0x21')](respondWithResult(_0x3970d3,null))[_0x4259('0x3d')](handleError(_0x3970d3,null));};exports['addActions']=function(_0x9accce,_0x1ef384,_0x218649){return db[_0x4259('0x4e')][_0x4259('0x44')]({'where':{'id':_0x9accce['params']['id']}})[_0x4259('0x21')](handleEntityNotFound(_0x1ef384,null))[_0x4259('0x21')](function(_0x1f49dd){if(_0x1f49dd){return _0x1f49dd[_0x4259('0x4f')](_0x9accce['body'][_0x4259('0x49')],_[_0x4259('0x50')](_0x9accce[_0x4259('0x42')],[_0x4259('0x49'),'id'])||{});}})['then'](respondWithResult(_0x1ef384,null))[_0x4259('0x3d')](handleError(_0x1ef384,null));};exports[_0x4259('0x51')]=function(_0x37cf94,_0x59a99c,_0x38e9ea){var _0xff5986={};var _0x2054b9={};var _0xd4656;var _0x2d5ecf;return db[_0x4259('0x3a')][_0x4259('0x4b')]({'where':{'id':_0x37cf94['params']['id']}})[_0x4259('0x21')](handleEntityNotFound(_0x59a99c,null))[_0x4259('0x21')](function(_0x346882){if(_0x346882){_0xd4656=_0x346882;_0x2054b9['model']=_[_0x4259('0x2b')](db[_0x4259('0x4e')][_0x4259('0x3f')]);_0x2054b9[_0x4259('0x2a')]=_[_0x4259('0x2b')](_0x37cf94['query']);_0x2054b9['filters']=_[_0x4259('0x2d')](_0x2054b9[_0x4259('0x31')],_0x2054b9[_0x4259('0x2a')]);_0xff5986[_0x4259('0x2f')]=_['intersection'](_0x2054b9[_0x4259('0x31')],qs[_0x4259('0x2e')](_0x37cf94['query']['fields']));_0xff5986['attributes']=_0xff5986[_0x4259('0x2f')]['length']?_0xff5986[_0x4259('0x2f')]:_0x2054b9[_0x4259('0x31')];_0xff5986[_0x4259('0x32')]=qs[_0x4259('0x33')](_0x37cf94['query']['sort']);_0xff5986['where']=qs[_0x4259('0x2c')](_[_0x4259('0x4c')](_0x37cf94[_0x4259('0x2a')],_0x2054b9['filters']));if(_0x37cf94[_0x4259('0x2a')][_0x4259('0x35')]){_0xff5986[_0x4259('0x34')]=_[_0x4259('0x36')](_0xff5986[_0x4259('0x34')],{'$or':_['map'](_0xff5986[_0x4259('0x2f')],function(_0x3cda2a){var _0x3c836e={};_0x3c836e[_0x3cda2a]={'$like':'%'+_0x37cf94[_0x4259('0x2a')][_0x4259('0x35')]+'%'};return _0x3c836e;})});}_0xff5986=_[_0x4259('0x36')]({},_0xff5986,_0x37cf94[_0x4259('0x39')]);return _0xd4656['getActions'](_0xff5986);}})[_0x4259('0x21')](function(_0x5885dd){if(_0x5885dd){_0x2d5ecf=_0x5885dd[_0x4259('0x30')];if(!_0x37cf94[_0x4259('0x2a')][_0x4259('0x52')](_0x4259('0x4d'))){_0xff5986[_0x4259('0x18')]=qs['limit'](_0x37cf94[_0x4259('0x2a')][_0x4259('0x18')]);_0xff5986['offset']=qs['offset'](_0x37cf94[_0x4259('0x2a')]['offset']);}return _0xd4656[_0x4259('0x51')](_0xff5986);}})[_0x4259('0x21')](function(_0x11bb8a){if(_0x11bb8a){return _0x11bb8a?{'count':_0x2d5ecf,'rows':_0x11bb8a}:null;}})['then'](respondWithResult(_0x59a99c,null))['catch'](handleError(_0x59a99c,null));}; \ No newline at end of file +var _0x5add=['model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','keys','include','find','create','body','params','Condition','addConditions','ids','getConditions','nolimit','addActions','Action','omit','getActions','findOne','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','update','then','destroy','name','send','index','map','Automation','rawAttributes','fieldName','type','key'];(function(_0x58baf3,_0x3ce651){var _0x1eb9b9=function(_0x40ddc9){while(--_0x40ddc9){_0x58baf3['push'](_0x58baf3['shift']());}};_0x1eb9b9(++_0x3ce651);}(_0x5add,0x124));var _0xd5ad=function(_0x3fcdb9,_0x142ed7){_0x3fcdb9=_0x3fcdb9-0x0;var _0x41da1a=_0x5add[_0x3fcdb9];return _0x41da1a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd5ad('0x0'));var zipdir=require(_0xd5ad('0x1'));var jsonpatch=require(_0xd5ad('0x2'));var rp=require(_0xd5ad('0x3'));var moment=require(_0xd5ad('0x4'));var BPromise=require(_0xd5ad('0x5'));var Mustache=require(_0xd5ad('0x6'));var util=require(_0xd5ad('0x7'));var path=require(_0xd5ad('0x8'));var sox=require(_0xd5ad('0x9'));var csv=require(_0xd5ad('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd5ad('0xb'));var _=require('lodash');var squel=require(_0xd5ad('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd5ad('0xd'));var toCsv=require(_0xd5ad('0xa'));var querystring=require(_0xd5ad('0xe'));var Papa=require('papaparse');var Redis=require(_0xd5ad('0xf'));var authService=require(_0xd5ad('0x10'));var qs=require(_0xd5ad('0x11'));var as=require(_0xd5ad('0x12'));var hardwareService=require(_0xd5ad('0x13'));var logger=require(_0xd5ad('0x14'))(_0xd5ad('0x15'));var utils=require(_0xd5ad('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xd5ad('0x17'));var db=require(_0xd5ad('0x18'))['db'];function respondWithStatusCode(_0x1425dc,_0x184cbb){_0x184cbb=_0x184cbb||0xcc;return function(_0x5c9943){if(_0x5c9943){return _0x1425dc[_0xd5ad('0x19')](_0x184cbb);}return _0x1425dc[_0xd5ad('0x1a')](_0x184cbb)[_0xd5ad('0x1b')]();};}function respondWithResult(_0x2f2710,_0x5c4d92){_0x5c4d92=_0x5c4d92||0xc8;return function(_0x4ee5e9){if(_0x4ee5e9){return _0x2f2710[_0xd5ad('0x1a')](_0x5c4d92)['json'](_0x4ee5e9);}};}function respondWithFilteredResult(_0x3ab581,_0x362498){return function(_0x2a5209){if(_0x2a5209){var _0x3ef4af=typeof _0x362498[_0xd5ad('0x1c')]===_0xd5ad('0x1d')&&typeof _0x362498[_0xd5ad('0x1e')]===_0xd5ad('0x1d');var _0x2b85a8=_0x2a5209[_0xd5ad('0x1f')];var _0x3963ec=_0x3ef4af?0x0:_0x362498[_0xd5ad('0x1c')];var _0x83fb17=_0x3ef4af?_0x2a5209[_0xd5ad('0x1f')]:_0x362498[_0xd5ad('0x1c')]+_0x362498[_0xd5ad('0x1e')];var _0x43c36f;if(_0x83fb17>=_0x2b85a8){_0x83fb17=_0x2b85a8;_0x43c36f=0xc8;}else{_0x43c36f=0xce;}_0x3ab581[_0xd5ad('0x1a')](_0x43c36f);return _0x3ab581[_0xd5ad('0x20')]('Content-Range',_0x3963ec+'-'+_0x83fb17+'/'+_0x2b85a8)[_0xd5ad('0x21')](_0x2a5209);}return null;};}function patchUpdates(_0x3cb515){return function(_0x1a8d28){try{jsonpatch[_0xd5ad('0x22')](_0x1a8d28,_0x3cb515,!![]);}catch(_0x541d79){return BPromise[_0xd5ad('0x23')](_0x541d79);}return _0x1a8d28['save']();};}function saveUpdates(_0x69e410,_0x9e60db){return function(_0x3236a4){if(_0x3236a4){return _0x3236a4[_0xd5ad('0x24')](_0x69e410)[_0xd5ad('0x25')](function(_0x5e0b71){return _0x5e0b71;});}return null;};}function removeEntity(_0x4ce040,_0x3f0bdb){return function(_0x464b23){if(_0x464b23){return _0x464b23[_0xd5ad('0x26')]()['then'](function(){_0x4ce040[_0xd5ad('0x1a')](0xcc)[_0xd5ad('0x1b')]();});}};}function handleEntityNotFound(_0x30dbc9,_0x4dd593){return function(_0x3f1e4b){if(!_0x3f1e4b){_0x30dbc9[_0xd5ad('0x19')](0x194);}return _0x3f1e4b;};}function handleError(_0x285271,_0x5856eb){_0x5856eb=_0x5856eb||0x1f4;return function(_0x2072a3){logger['error'](_0x2072a3['stack']);if(_0x2072a3[_0xd5ad('0x27')]){delete _0x2072a3[_0xd5ad('0x27')];}_0x285271[_0xd5ad('0x1a')](_0x5856eb)[_0xd5ad('0x28')](_0x2072a3);};}exports[_0xd5ad('0x29')]=function(_0x54eac3,_0xf98395){var _0x3c5937={},_0x146e45={},_0x5b2f85={'count':0x0,'rows':[]};var _0x4291c4=_[_0xd5ad('0x2a')](db[_0xd5ad('0x2b')][_0xd5ad('0x2c')],function(_0xfa5e8f){return{'name':_0xfa5e8f[_0xd5ad('0x2d')],'type':_0xfa5e8f[_0xd5ad('0x2e')][_0xd5ad('0x2f')]};});_0x146e45[_0xd5ad('0x30')]=_[_0xd5ad('0x2a')](_0x4291c4,'name');_0x146e45[_0xd5ad('0x31')]=_['keys'](_0x54eac3[_0xd5ad('0x31')]);_0x146e45[_0xd5ad('0x32')]=_['intersection'](_0x146e45[_0xd5ad('0x30')],_0x146e45[_0xd5ad('0x31')]);_0x3c5937[_0xd5ad('0x33')]=_[_0xd5ad('0x34')](_0x146e45[_0xd5ad('0x30')],qs[_0xd5ad('0x35')](_0x54eac3[_0xd5ad('0x31')]['fields']));_0x3c5937[_0xd5ad('0x33')]=_0x3c5937['attributes'][_0xd5ad('0x36')]?_0x3c5937[_0xd5ad('0x33')]:_0x146e45['model'];if(!_0x54eac3[_0xd5ad('0x31')][_0xd5ad('0x37')]('nolimit')){_0x3c5937['limit']=qs[_0xd5ad('0x1e')](_0x54eac3['query'][_0xd5ad('0x1e')]);_0x3c5937['offset']=qs[_0xd5ad('0x1c')](_0x54eac3[_0xd5ad('0x31')][_0xd5ad('0x1c')]);}_0x3c5937[_0xd5ad('0x38')]=qs[_0xd5ad('0x39')](_0x54eac3[_0xd5ad('0x31')][_0xd5ad('0x39')]);_0x3c5937[_0xd5ad('0x3a')]=qs['filters'](_[_0xd5ad('0x3b')](_0x54eac3[_0xd5ad('0x31')],_0x146e45[_0xd5ad('0x32')]),_0x4291c4);if(_0x54eac3[_0xd5ad('0x31')][_0xd5ad('0x3c')]){_0x3c5937[_0xd5ad('0x3a')]=_[_0xd5ad('0x3d')](_0x3c5937[_0xd5ad('0x3a')],{'$or':_[_0xd5ad('0x2a')](_0x4291c4,function(_0x2fd6fb){if(_0x2fd6fb[_0xd5ad('0x2e')]!==_0xd5ad('0x3e')){var _0x182430={};_0x182430[_0x2fd6fb[_0xd5ad('0x27')]]={'$like':'%'+_0x54eac3['query'][_0xd5ad('0x3c')]+'%'};return _0x182430;}})});}_0x3c5937=_['merge']({},_0x3c5937,_0x54eac3[_0xd5ad('0x3f')]);var _0x1cd877={'where':_0x3c5937[_0xd5ad('0x3a')]};return db[_0xd5ad('0x2b')][_0xd5ad('0x1f')](_0x1cd877)[_0xd5ad('0x25')](function(_0x16b0c4){_0x5b2f85[_0xd5ad('0x1f')]=_0x16b0c4;if(_0x54eac3[_0xd5ad('0x31')][_0xd5ad('0x40')]){_0x3c5937['include']=[{'all':!![]}];}return db['Automation'][_0xd5ad('0x41')](_0x3c5937);})['then'](function(_0x1b9b94){_0x5b2f85[_0xd5ad('0x42')]=_0x1b9b94;return _0x5b2f85;})[_0xd5ad('0x25')](respondWithFilteredResult(_0xf98395,_0x3c5937))[_0xd5ad('0x43')](handleError(_0xf98395,null));};exports[_0xd5ad('0x44')]=function(_0x58092a,_0x5a5063){var _0x32c45e={'raw':![],'where':{'id':_0x58092a['params']['id']}},_0x42768d={};_0x42768d[_0xd5ad('0x30')]=_[_0xd5ad('0x45')](db[_0xd5ad('0x2b')][_0xd5ad('0x2c')]);_0x42768d[_0xd5ad('0x31')]=_['keys'](_0x58092a[_0xd5ad('0x31')]);_0x42768d[_0xd5ad('0x32')]=_[_0xd5ad('0x34')](_0x42768d['model'],_0x42768d[_0xd5ad('0x31')]);_0x32c45e[_0xd5ad('0x33')]=_[_0xd5ad('0x34')](_0x42768d[_0xd5ad('0x30')],qs[_0xd5ad('0x35')](_0x58092a[_0xd5ad('0x31')]['fields']));_0x32c45e[_0xd5ad('0x33')]=_0x32c45e[_0xd5ad('0x33')]['length']?_0x32c45e['attributes']:_0x42768d['model'];if(_0x58092a[_0xd5ad('0x31')]['includeAll']){_0x32c45e[_0xd5ad('0x46')]=[{'all':!![]}];}_0x32c45e=_[_0xd5ad('0x3d')]({},_0x32c45e,_0x58092a[_0xd5ad('0x3f')]);return db[_0xd5ad('0x2b')][_0xd5ad('0x47')](_0x32c45e)['then'](handleEntityNotFound(_0x5a5063,null))[_0xd5ad('0x25')](respondWithResult(_0x5a5063,null))[_0xd5ad('0x43')](handleError(_0x5a5063,null));};exports[_0xd5ad('0x48')]=function(_0x52c150,_0x2c1578){return db[_0xd5ad('0x2b')]['create'](_0x52c150['body'],{})[_0xd5ad('0x25')](respondWithResult(_0x2c1578,0xc9))[_0xd5ad('0x43')](handleError(_0x2c1578,null));};exports[_0xd5ad('0x24')]=function(_0x3a0b91,_0x323ccf){if(_0x3a0b91[_0xd5ad('0x49')]['id']){delete _0x3a0b91[_0xd5ad('0x49')]['id'];}return db[_0xd5ad('0x2b')][_0xd5ad('0x47')]({'where':{'id':_0x3a0b91[_0xd5ad('0x4a')]['id']}})[_0xd5ad('0x25')](handleEntityNotFound(_0x323ccf,null))[_0xd5ad('0x25')](saveUpdates(_0x3a0b91['body'],null))['then'](respondWithResult(_0x323ccf,null))[_0xd5ad('0x43')](handleError(_0x323ccf,null));};exports[_0xd5ad('0x26')]=function(_0x22afb0,_0x2b5590){return db['Automation'][_0xd5ad('0x47')]({'where':{'id':_0x22afb0[_0xd5ad('0x4a')]['id']}})[_0xd5ad('0x25')](handleEntityNotFound(_0x2b5590,null))[_0xd5ad('0x25')](removeEntity(_0x2b5590,null))[_0xd5ad('0x43')](handleError(_0x2b5590,null));};exports['addConditions']=function(_0x202bd2,_0x5e3b38,_0x73be65){return db[_0xd5ad('0x4b')][_0xd5ad('0x47')]({'where':{'id':_0x202bd2[_0xd5ad('0x4a')]['id']}})[_0xd5ad('0x25')](handleEntityNotFound(_0x5e3b38,null))['then'](function(_0x340115){if(_0x340115){return _0x340115[_0xd5ad('0x4c')](_0x202bd2[_0xd5ad('0x49')][_0xd5ad('0x4d')],_['omit'](_0x202bd2[_0xd5ad('0x49')],[_0xd5ad('0x4d'),'id'])||{});}})[_0xd5ad('0x25')](respondWithResult(_0x5e3b38,null))[_0xd5ad('0x43')](handleError(_0x5e3b38,null));};exports[_0xd5ad('0x4e')]=function(_0x4b322d,_0x135090,_0x28b8b1){var _0xbc546c={};var _0x16dc82={};var _0x4f28e5;var _0x1ef244;return db['Automation']['findOne']({'where':{'id':_0x4b322d[_0xd5ad('0x4a')]['id']}})[_0xd5ad('0x25')](handleEntityNotFound(_0x135090,null))[_0xd5ad('0x25')](function(_0x344628){if(_0x344628){_0x4f28e5=_0x344628;_0x16dc82[_0xd5ad('0x30')]=_[_0xd5ad('0x45')](db[_0xd5ad('0x4b')]['rawAttributes']);_0x16dc82[_0xd5ad('0x31')]=_['keys'](_0x4b322d[_0xd5ad('0x31')]);_0x16dc82['filters']=_[_0xd5ad('0x34')](_0x16dc82[_0xd5ad('0x30')],_0x16dc82[_0xd5ad('0x31')]);_0xbc546c['attributes']=_[_0xd5ad('0x34')](_0x16dc82[_0xd5ad('0x30')],qs[_0xd5ad('0x35')](_0x4b322d[_0xd5ad('0x31')]['fields']));_0xbc546c[_0xd5ad('0x33')]=_0xbc546c['attributes'][_0xd5ad('0x36')]?_0xbc546c[_0xd5ad('0x33')]:_0x16dc82['model'];_0xbc546c[_0xd5ad('0x38')]=qs[_0xd5ad('0x39')](_0x4b322d['query'][_0xd5ad('0x39')]);_0xbc546c[_0xd5ad('0x3a')]=qs[_0xd5ad('0x32')](_[_0xd5ad('0x3b')](_0x4b322d['query'],_0x16dc82[_0xd5ad('0x32')]));if(_0x4b322d['query'][_0xd5ad('0x3c')]){_0xbc546c[_0xd5ad('0x3a')]=_[_0xd5ad('0x3d')](_0xbc546c[_0xd5ad('0x3a')],{'$or':_['map'](_0xbc546c[_0xd5ad('0x33')],function(_0x13a6df){var _0x37808a={};_0x37808a[_0x13a6df]={'$like':'%'+_0x4b322d[_0xd5ad('0x31')][_0xd5ad('0x3c')]+'%'};return _0x37808a;})});}_0xbc546c=_[_0xd5ad('0x3d')]({},_0xbc546c,_0x4b322d[_0xd5ad('0x3f')]);return _0x4f28e5[_0xd5ad('0x4e')](_0xbc546c);}})[_0xd5ad('0x25')](function(_0x2e51da){if(_0x2e51da){_0x1ef244=_0x2e51da['length'];if(!_0x4b322d[_0xd5ad('0x31')][_0xd5ad('0x37')](_0xd5ad('0x4f'))){_0xbc546c[_0xd5ad('0x1e')]=qs['limit'](_0x4b322d[_0xd5ad('0x31')][_0xd5ad('0x1e')]);_0xbc546c['offset']=qs[_0xd5ad('0x1c')](_0x4b322d[_0xd5ad('0x31')]['offset']);}return _0x4f28e5[_0xd5ad('0x4e')](_0xbc546c);}})['then'](function(_0x3bb261){if(_0x3bb261){return _0x3bb261?{'count':_0x1ef244,'rows':_0x3bb261}:null;}})[_0xd5ad('0x25')](respondWithResult(_0x135090,null))[_0xd5ad('0x43')](handleError(_0x135090,null));};exports[_0xd5ad('0x50')]=function(_0x57fbd3,_0x38e3dc,_0x9c0e8b){return db[_0xd5ad('0x51')][_0xd5ad('0x47')]({'where':{'id':_0x57fbd3[_0xd5ad('0x4a')]['id']}})[_0xd5ad('0x25')](handleEntityNotFound(_0x38e3dc,null))[_0xd5ad('0x25')](function(_0x5079e7){if(_0x5079e7){return _0x5079e7[_0xd5ad('0x50')](_0x57fbd3[_0xd5ad('0x49')][_0xd5ad('0x4d')],_[_0xd5ad('0x52')](_0x57fbd3[_0xd5ad('0x49')],[_0xd5ad('0x4d'),'id'])||{});}})[_0xd5ad('0x25')](respondWithResult(_0x38e3dc,null))[_0xd5ad('0x43')](handleError(_0x38e3dc,null));};exports[_0xd5ad('0x53')]=function(_0x3139d5,_0x3d1328,_0xea4f6){var _0x1e1290={};var _0x25b269={};var _0x50de41;var _0x1aec95;return db['Automation'][_0xd5ad('0x54')]({'where':{'id':_0x3139d5[_0xd5ad('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3d1328,null))[_0xd5ad('0x25')](function(_0x23b050){if(_0x23b050){_0x50de41=_0x23b050;_0x25b269[_0xd5ad('0x30')]=_[_0xd5ad('0x45')](db[_0xd5ad('0x51')][_0xd5ad('0x2c')]);_0x25b269['query']=_[_0xd5ad('0x45')](_0x3139d5[_0xd5ad('0x31')]);_0x25b269[_0xd5ad('0x32')]=_[_0xd5ad('0x34')](_0x25b269['model'],_0x25b269[_0xd5ad('0x31')]);_0x1e1290[_0xd5ad('0x33')]=_[_0xd5ad('0x34')](_0x25b269[_0xd5ad('0x30')],qs[_0xd5ad('0x35')](_0x3139d5[_0xd5ad('0x31')][_0xd5ad('0x35')]));_0x1e1290[_0xd5ad('0x33')]=_0x1e1290['attributes'][_0xd5ad('0x36')]?_0x1e1290[_0xd5ad('0x33')]:_0x25b269[_0xd5ad('0x30')];_0x1e1290[_0xd5ad('0x38')]=qs[_0xd5ad('0x39')](_0x3139d5['query'][_0xd5ad('0x39')]);_0x1e1290[_0xd5ad('0x3a')]=qs[_0xd5ad('0x32')](_[_0xd5ad('0x3b')](_0x3139d5['query'],_0x25b269['filters']));if(_0x3139d5[_0xd5ad('0x31')][_0xd5ad('0x3c')]){_0x1e1290[_0xd5ad('0x3a')]=_['merge'](_0x1e1290[_0xd5ad('0x3a')],{'$or':_['map'](_0x1e1290[_0xd5ad('0x33')],function(_0x5ad5f0){var _0x119cd2={};_0x119cd2[_0x5ad5f0]={'$like':'%'+_0x3139d5['query'][_0xd5ad('0x3c')]+'%'};return _0x119cd2;})});}_0x1e1290=_['merge']({},_0x1e1290,_0x3139d5[_0xd5ad('0x3f')]);return _0x50de41[_0xd5ad('0x53')](_0x1e1290);}})[_0xd5ad('0x25')](function(_0x23186b){if(_0x23186b){_0x1aec95=_0x23186b[_0xd5ad('0x36')];if(!_0x3139d5['query'][_0xd5ad('0x37')]('nolimit')){_0x1e1290[_0xd5ad('0x1e')]=qs[_0xd5ad('0x1e')](_0x3139d5['query'][_0xd5ad('0x1e')]);_0x1e1290['offset']=qs[_0xd5ad('0x1c')](_0x3139d5[_0xd5ad('0x31')][_0xd5ad('0x1c')]);}return _0x50de41[_0xd5ad('0x53')](_0x1e1290);}})[_0xd5ad('0x25')](function(_0x1837c1){if(_0x1837c1){return _0x1837c1?{'count':_0x1aec95,'rows':_0x1837c1}:null;}})[_0xd5ad('0x25')](respondWithResult(_0x3d1328,null))[_0xd5ad('0x43')](handleError(_0x3d1328,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index e83d51c..75b8df4 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 _0x9f6c=['path','rimraf','../../config/environment','./automation.attributes','exports','Automation','tools_automations','lodash','util','../../config/logger','api','bluebird'];(function(_0x528023,_0x150351){var _0x20ed46=function(_0x4323fd){while(--_0x4323fd){_0x528023['push'](_0x528023['shift']());}};_0x20ed46(++_0x150351);}(_0x9f6c,0x1cf));var _0xc9f6=function(_0x501427,_0x3f9bc0){_0x501427=_0x501427-0x0;var _0x492f1d=_0x9f6c[_0x501427];return _0x492f1d;};'use strict';var _=require(_0xc9f6('0x0'));var util=require(_0xc9f6('0x1'));var logger=require(_0xc9f6('0x2'))(_0xc9f6('0x3'));var moment=require('moment');var BPromise=require(_0xc9f6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc9f6('0x5'));var rimraf=require(_0xc9f6('0x6'));var config=require(_0xc9f6('0x7'));var attributes=require(_0xc9f6('0x8'));module[_0xc9f6('0x9')]=function(_0x1f5fb8,_0x1e115d){return _0x1f5fb8['define'](_0xc9f6('0xa'),attributes,{'tableName':_0xc9f6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8b47=['exports','define','Automation','util','../../config/logger','moment','bluebird','rimraf','../../config/environment','./automation.attributes'];(function(_0x24cd8e,_0x14020c){var _0x830ece=function(_0x26fb7a){while(--_0x26fb7a){_0x24cd8e['push'](_0x24cd8e['shift']());}};_0x830ece(++_0x14020c);}(_0x8b47,0xcb));var _0x78b4=function(_0x5e3868,_0x5e9f11){_0x5e3868=_0x5e3868-0x0;var _0x1a005a=_0x8b47[_0x5e3868];return _0x1a005a;};'use strict';var _=require('lodash');var util=require(_0x78b4('0x0'));var logger=require(_0x78b4('0x1'))('api');var moment=require(_0x78b4('0x2'));var BPromise=require(_0x78b4('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x78b4('0x4'));var config=require(_0x78b4('0x5'));var attributes=require(_0x78b4('0x6'));module[_0x78b4('0x7')]=function(_0xfb68ce,_0x3cb03b){return _0xfb68ce[_0x78b4('0x8')](_0x78b4('0x9'),attributes,{'tableName':'tools_automations','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 5575eee..9cec0d2 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 _0x3014=['request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','Automation,\x20%s,\x20%s'];(function(_0x21b0d8,_0x1334ee){var _0x2e6f6a=function(_0x3dff3d){while(--_0x3dff3d){_0x21b0d8['push'](_0x21b0d8['shift']());}};_0x2e6f6a(++_0x1334ee);}(_0x3014,0x1d7));var _0x4301=function(_0x43a2fc,_0x589e0e){_0x43a2fc=_0x43a2fc-0x0;var _0x487ba1=_0x3014[_0x43a2fc];return _0x487ba1;};'use strict';var _=require(_0x4301('0x0'));var util=require(_0x4301('0x1'));var moment=require('moment');var BPromise=require(_0x4301('0x2'));var rs=require(_0x4301('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4301('0x4'));var logger=require(_0x4301('0x5'))(_0x4301('0x6'));var config=require(_0x4301('0x7'));var jayson=require(_0x4301('0x8'));var client=jayson[_0x4301('0x9')][_0x4301('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a6e61,_0x5013c,_0x1dc855){return new BPromise(function(_0x337800,_0x4d5020){return client['request'](_0x3a6e61,_0x1dc855)[_0x4301('0xb')](function(_0x2d6581){logger['info'](_0x4301('0xc'),_0x5013c,_0x4301('0xd'));logger[_0x4301('0xe')](_0x4301('0xf'),_0x5013c,'request\x20sent',JSON[_0x4301('0x10')](_0x2d6581));if(_0x2d6581['error']){if(_0x2d6581[_0x4301('0x11')][_0x4301('0x12')]===0x1f4){logger[_0x4301('0x11')](_0x4301('0xc'),_0x5013c,_0x2d6581[_0x4301('0x11')][_0x4301('0x13')]);return _0x4d5020(_0x2d6581[_0x4301('0x11')][_0x4301('0x13')]);}logger[_0x4301('0x11')](_0x4301('0xc'),_0x5013c,_0x2d6581[_0x4301('0x11')][_0x4301('0x13')]);return _0x337800(_0x2d6581[_0x4301('0x11')]['message']);}else{logger['info']('Automation,\x20%s,\x20%s',_0x5013c,_0x4301('0xd'));_0x337800(_0x2d6581[_0x4301('0x14')][_0x4301('0x13')]);}})[_0x4301('0x15')](function(_0x4da25c){logger['error'](_0x4301('0xc'),_0x5013c,_0x4da25c);_0x4d5020(_0x4da25c);});});} \ No newline at end of file +var _0x1c9a=['http','request','then','info','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','Automation,\x20%s,\x20%s','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x186376,_0x5d988a){var _0x2dbdd9=function(_0x96908e){while(--_0x96908e){_0x186376['push'](_0x186376['shift']());}};_0x2dbdd9(++_0x5d988a);}(_0x1c9a,0x98));var _0xa1c9=function(_0x34cefe,_0x2340aa){_0x34cefe=_0x34cefe-0x0;var _0x3bace2=_0x1c9a[_0x34cefe];return _0x3bace2;};'use strict';var _=require(_0xa1c9('0x0'));var util=require('util');var moment=require(_0xa1c9('0x1'));var BPromise=require('bluebird');var rs=require(_0xa1c9('0x2'));var fs=require('fs');var Redis=require(_0xa1c9('0x3'));var db=require(_0xa1c9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa1c9('0x5'))(_0xa1c9('0x6'));var config=require(_0xa1c9('0x7'));var jayson=require(_0xa1c9('0x8'));var client=jayson['client'][_0xa1c9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5448f2,_0x222624,_0x463c9c){return new BPromise(function(_0x3f07c2,_0x5059df){return client[_0xa1c9('0xa')](_0x5448f2,_0x463c9c)[_0xa1c9('0xb')](function(_0x24136d){logger[_0xa1c9('0xc')]('Automation,\x20%s,\x20%s',_0x222624,_0xa1c9('0xd'));logger[_0xa1c9('0xe')](_0xa1c9('0xf'),_0x222624,_0xa1c9('0xd'),JSON[_0xa1c9('0x10')](_0x24136d));if(_0x24136d[_0xa1c9('0x11')]){if(_0x24136d[_0xa1c9('0x11')][_0xa1c9('0x12')]===0x1f4){logger[_0xa1c9('0x11')](_0xa1c9('0x13'),_0x222624,_0x24136d['error'][_0xa1c9('0x14')]);return _0x5059df(_0x24136d[_0xa1c9('0x11')][_0xa1c9('0x14')]);}logger[_0xa1c9('0x11')](_0xa1c9('0x13'),_0x222624,_0x24136d['error'][_0xa1c9('0x14')]);return _0x3f07c2(_0x24136d[_0xa1c9('0x11')][_0xa1c9('0x14')]);}else{logger[_0xa1c9('0xc')](_0xa1c9('0x13'),_0x222624,_0xa1c9('0xd'));_0x3f07c2(_0x24136d[_0xa1c9('0x15')][_0xa1c9('0x14')]);}})[_0xa1c9('0x16')](function(_0x373f5d){logger['error'](_0xa1c9('0x13'),_0x222624,_0x373f5d);_0x5059df(_0x373f5d);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 3ee0cfe..da052b6 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 _0xdcd0=['create','addConditions','post','addActions','update','multer','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./automation.controller','isAuthenticated','index','get','/:id','show','/:id/conditions','getConditions','/:id/actions'];(function(_0xb935b1,_0x54ed60){var _0x2bd5ce=function(_0x18f61a){while(--_0x18f61a){_0xb935b1['push'](_0xb935b1['shift']());}};_0x2bd5ce(++_0x54ed60);}(_0xdcd0,0xb9));var _0x0dcd=function(_0x2f2bac,_0x24a1da){_0x2f2bac=_0x2f2bac-0x0;var _0x3a4c06=_0xdcd0[_0x2f2bac];return _0x3a4c06;};'use strict';var multer=require(_0x0dcd('0x0'));var util=require('util');var path=require(_0x0dcd('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0dcd('0x2')]();var fs_extra=require(_0x0dcd('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x0dcd('0x4'));var config=require(_0x0dcd('0x5'));var controller=require(_0x0dcd('0x6'));router['get']('/',auth[_0x0dcd('0x7')](),controller[_0x0dcd('0x8')]);router[_0x0dcd('0x9')](_0x0dcd('0xa'),auth['isAuthenticated'](),controller[_0x0dcd('0xb')]);router[_0x0dcd('0x9')](_0x0dcd('0xc'),auth[_0x0dcd('0x7')](),controller[_0x0dcd('0xd')]);router['get'](_0x0dcd('0xe'),auth['isAuthenticated'](),controller['getActions']);router['post']('/',auth['isAuthenticated'](),controller[_0x0dcd('0xf')]);router['post'](_0x0dcd('0xc'),auth[_0x0dcd('0x7')](),controller[_0x0dcd('0x10')]);router[_0x0dcd('0x11')](_0x0dcd('0xe'),auth[_0x0dcd('0x7')](),controller[_0x0dcd('0x12')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x0dcd('0x13')]);router['delete']('/:id',auth[_0x0dcd('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xa049=['create','addConditions','addActions','put','/:id','update','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','index','isAuthenticated','show','/:id/conditions','getConditions','/:id/actions','getActions','post'];(function(_0x460ea6,_0x17998d){var _0x4962d2=function(_0x4ea96d){while(--_0x4ea96d){_0x460ea6['push'](_0x460ea6['shift']());}};_0x4962d2(++_0x17998d);}(_0xa049,0x1db));var _0x9a04=function(_0x56d591,_0x3191a3){_0x56d591=_0x56d591-0x0;var _0x4bf0ff=_0xa049[_0x56d591];return _0x4bf0ff;};'use strict';var multer=require(_0x9a04('0x0'));var util=require(_0x9a04('0x1'));var path=require('path');var timeout=require(_0x9a04('0x2'));var express=require(_0x9a04('0x3'));var router=express[_0x9a04('0x4')]();var fs_extra=require(_0x9a04('0x5'));var auth=require(_0x9a04('0x6'));var interaction=require(_0x9a04('0x7'));var config=require(_0x9a04('0x8'));var controller=require(_0x9a04('0x9'));router[_0x9a04('0xa')]('/',auth['isAuthenticated'](),controller[_0x9a04('0xb')]);router[_0x9a04('0xa')]('/:id',auth[_0x9a04('0xc')](),controller[_0x9a04('0xd')]);router[_0x9a04('0xa')](_0x9a04('0xe'),auth[_0x9a04('0xc')](),controller[_0x9a04('0xf')]);router['get'](_0x9a04('0x10'),auth[_0x9a04('0xc')](),controller[_0x9a04('0x11')]);router[_0x9a04('0x12')]('/',auth[_0x9a04('0xc')](),controller[_0x9a04('0x13')]);router['post'](_0x9a04('0xe'),auth[_0x9a04('0xc')](),controller[_0x9a04('0x14')]);router['post'](_0x9a04('0x10'),auth[_0x9a04('0xc')](),controller[_0x9a04('0x15')]);router[_0x9a04('0x16')](_0x9a04('0x17'),auth['isAuthenticated'](),controller[_0x9a04('0x18')]);router['delete'](_0x9a04('0x17'),auth[_0x9a04('0xc')](),controller['destroy']);module[_0x9a04('0x19')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 67c9a69..008d9de 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 _0x2ddd=['#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)','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','ENUM','always','never','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting'];(function(_0x1a379b,_0x507552){var _0x385502=function(_0x32491b){while(--_0x32491b){_0x1a379b['push'](_0x1a379b['shift']());}};_0x385502(++_0x507552);}(_0x2ddd,0x197));var _0xd2dd=function(_0x5a7d5f,_0x5695cb){_0x5a7d5f=_0x5a7d5f-0x0;var _0x5dcded=_0x2ddd[_0x5a7d5f];return _0x5dcded;};'use strict';var Sequelize=require(_0xd2dd('0x0'));module[_0xd2dd('0x1')]={'name':{'type':Sequelize[_0xd2dd('0x2')],'unique':_0xd2dd('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xd2dd('0x4')),'allowNull':![],'defaultValue':_0xd2dd('0x4')},'description':{'type':Sequelize[_0xd2dd('0x2')]},'active':{'type':Sequelize[_0xd2dd('0x5')],'defaultValue':0x0,'comment':_0xd2dd('0x6')},'limitCalls':{'type':Sequelize[_0xd2dd('0x7')](0x4)[_0xd2dd('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xd2dd('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0xd2dd('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0xd2dd('0x7')](0x3)[_0xd2dd('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd2dd('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0xd2dd('0x7')](0x3)[_0xd2dd('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0xd2dd('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd2dd('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xd2dd('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd2dd('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0xd2dd('0x7')](0x5)[_0xd2dd('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd2dd('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xd2dd('0x7')](0x3)[_0xd2dd('0x8')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xd2dd('0x7')](0x5)[_0xd2dd('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xd2dd('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xd2dd('0xe')},'dialTimezone':{'type':Sequelize[_0xd2dd('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xd2dd('0x2')],'defaultValue':_0xd2dd('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0xd2dd('0x10')](_0xd2dd('0x11'),_0xd2dd('0x12'),_0xd2dd('0x13')),'defaultValue':_0xd2dd('0x11')},'dialAMDActive':{'type':Sequelize[_0xd2dd('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xd2dd('0x7')](0x9)[_0xd2dd('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xd2dd('0x14')},'dialAMDGreeting':{'type':Sequelize[_0xd2dd('0x7')](0x9)[_0xd2dd('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xd2dd('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xd2dd('0x7')](0x9)[_0xd2dd('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xd2dd('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xd2dd('0x7')](0x9)[_0xd2dd('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xd2dd('0x17')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xd2dd('0x7')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xd2dd('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xd2dd('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xd2dd('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xd2dd('0x1a')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xd2dd('0x7')](0x9)[_0xd2dd('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0xd2dd('0x10')](_0xd2dd('0x1b'),_0xd2dd('0x1c')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0xd2dd('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xd2dd('0x7')](0x3)[_0xd2dd('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xd2dd('0x1d')},'dialCutDigit':{'type':Sequelize[_0xd2dd('0x7')](0x3)[_0xd2dd('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xd2dd('0x7')](0x3)[_0xd2dd('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd2dd('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd2dd('0x1f')},'dialDropMaxRetry':{'type':Sequelize[_0xd2dd('0x7')](0x3)[_0xd2dd('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd2dd('0x20')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd2dd('0x21')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xd2dd('0x7')](0x3)[_0xd2dd('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd2dd('0x22')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xd2dd('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0xd2dd('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd2dd('0x23')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xd2dd('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd2dd('0x24')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xd2dd('0x7')](0x3)[_0xd2dd('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd2dd('0x25')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xd2dd('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd2dd('0x26')}}; \ No newline at end of file +var _0xa587=['#NoAnswer\x20Retry\x20(min:1,\x20max:999)','never','onlyIfOpen','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x500d35,_0x3f5d69){var _0x383af4=function(_0x22c7e9){while(--_0x22c7e9){_0x500d35['push'](_0x500d35['shift']());}};_0x383af4(++_0x3f5d69);}(_0xa587,0xa9));var _0x7a58=function(_0x15bd91,_0x333233){_0x15bd91=_0x15bd91-0x0;var _0x5e370d=_0xa587[_0x15bd91];return _0x5e370d;};'use strict';var Sequelize=require(_0x7a58('0x0'));module[_0x7a58('0x1')]={'name':{'type':Sequelize[_0x7a58('0x2')],'unique':_0x7a58('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x7a58('0x4')]('ivr'),'allowNull':![],'defaultValue':_0x7a58('0x5')},'description':{'type':Sequelize[_0x7a58('0x2')]},'active':{'type':Sequelize[_0x7a58('0x6')],'defaultValue':0x0,'comment':_0x7a58('0x7')},'limitCalls':{'type':Sequelize[_0x7a58('0x8')](0x4)[_0x7a58('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x7a58('0xa')},'dialOriginateCallerIdName':{'type':Sequelize[_0x7a58('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x7a58('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x7a58('0x8')](0x3)[_0x7a58('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7a58('0xb')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x7a58('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7a58('0xc')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x7a58('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7a58('0xd')},'dialBusyMaxRetry':{'type':Sequelize[_0x7a58('0x8')](0x3)[_0x7a58('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7a58('0xe')},'dialBusyRetryFrequency':{'type':Sequelize[_0x7a58('0x8')](0x5)[_0x7a58('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7a58('0xf')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x7a58('0x8')](0x3)[_0x7a58('0x9')],'defaultValue':0x3,'comment':_0x7a58('0x10')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x7a58('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x7a58('0x8')](0x3)[_0x7a58('0x9')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x7a58('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x7a58('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0x7a58('0x4')]('always',_0x7a58('0x11'),_0x7a58('0x12')),'defaultValue':_0x7a58('0x13')},'dialAMDActive':{'type':Sequelize[_0x7a58('0x6')],'defaultValue':0x0,'comment':_0x7a58('0x14')},'dialAMDInitialSilence':{'type':Sequelize[_0x7a58('0x8')](0x9)[_0x7a58('0x9')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x7a58('0x15')},'dialAMDGreeting':{'type':Sequelize[_0x7a58('0x8')](0x9)[_0x7a58('0x9')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x7a58('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x7a58('0x8')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x7a58('0x17')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x7a58('0x8')](0x9)[_0x7a58('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x7a58('0x8')](0x9)[_0x7a58('0x9')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x7a58('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x7a58('0x8')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x7a58('0x19')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x7a58('0x8')](0x9)[_0x7a58('0x9')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x7a58('0x1a')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x7a58('0x8')](0x5)[_0x7a58('0x9')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x7a58('0x1b')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x7a58('0x8')](0x9)[_0x7a58('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x7a58('0x1c')},'dialOrderByScheduledAt':{'type':Sequelize[_0x7a58('0x4')]('DESC','ASC'),'defaultValue':_0x7a58('0x1d')},'dialPrefix':{'type':Sequelize[_0x7a58('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x7a58('0x8')](0x3)[_0x7a58('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x7a58('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x7a58('0x8')](0x3)[_0x7a58('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7a58('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x7a58('0x8')](0x5)[_0x7a58('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x7a58('0x8')](0x3)[_0x7a58('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x7a58('0x8')](0x5)[_0x7a58('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7a58('0x1f')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x7a58('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7a58('0x20')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x7a58('0x8')](0x5)[_0x7a58('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7a58('0x21')},'dialMachineMaxRetry':{'type':Sequelize[_0x7a58('0x8')](0x3)[_0x7a58('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7a58('0x22')},'dialMachineRetryFrequency':{'type':Sequelize[_0x7a58('0x8')](0x5)[_0x7a58('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7a58('0x23')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x7a58('0x8')](0x3)[_0x7a58('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x7a58('0x8')](0x5)[_0x7a58('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7a58('0x24')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 850c1c9..7298386 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 _0x0d7b=['onlyIfOpen','fromQuery','cm_hopper','deletedAt\x20IS\x20NULL','push','sequelize','all','removeLists','getBlackLists','addBlackLists','ids','cm_hopper_black','removeBlackLists','eml-format','zip-dir','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','IvrCampaigns','sendStatus','error','stack','name','index','map','Campaign','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','UserProfileResource','clone','omit','createdAt','updatedAt','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findOne','CmHopper','order','pick','CampaignId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','spread','dialCheckDuplicateType','always','insert','into','phone','scheduledAt','ContactId','ListId','select','field','NOW()','CmListId','toString','from','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)'];(function(_0x2e4587,_0x7bf8bd){var _0x422eb7=function(_0x16a22b){while(--_0x16a22b){_0x2e4587['push'](_0x2e4587['shift']());}};_0x422eb7(++_0x7bf8bd);}(_0x0d7b,0x92));var _0xb0d7=function(_0x21615e,_0x1fd2bb){_0x21615e=_0x21615e-0x0;var _0x2b91bc=_0x0d7b[_0x21615e];return _0x2b91bc;};'use strict';var emlformat=require(_0xb0d7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb0d7('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb0d7('0x2'));var moment=require(_0xb0d7('0x3'));var BPromise=require(_0xb0d7('0x4'));var Mustache=require('mustache');var util=require(_0xb0d7('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xb0d7('0x6'));var ejs=require(_0xb0d7('0x7'));var fs=require('fs');var fs_extra=require(_0xb0d7('0x8'));var _=require('lodash');var squel=require(_0xb0d7('0x9'));var crypto=require(_0xb0d7('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb0d7('0x6'));var querystring=require('querystring');var Papa=require(_0xb0d7('0xb'));var Redis=require(_0xb0d7('0xc'));var authService=require(_0xb0d7('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xb0d7('0xe'));var hardwareService=require(_0xb0d7('0xf'));var logger=require(_0xb0d7('0x10'))('api');var utils=require(_0xb0d7('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0xb0d7('0x12'));var db=require(_0xb0d7('0x13'))['db'];function respondWithStatusCode(_0x54c376,_0x5979d8){_0x5979d8=_0x5979d8||0xcc;return function(_0xb4104){if(_0xb4104){return _0x54c376['sendStatus'](_0x5979d8);}return _0x54c376[_0xb0d7('0x14')](_0x5979d8)[_0xb0d7('0x15')]();};}function respondWithResult(_0x4a42da,_0x197ebc){_0x197ebc=_0x197ebc||0xc8;return function(_0x7cde45){if(_0x7cde45){return _0x4a42da[_0xb0d7('0x14')](_0x197ebc)[_0xb0d7('0x16')](_0x7cde45);}};}function respondWithFilteredResult(_0x46fbb8,_0x315dbb){return function(_0x2c99b4){if(_0x2c99b4){var _0x2e22d1=typeof _0x315dbb[_0xb0d7('0x17')]===_0xb0d7('0x18')&&typeof _0x315dbb[_0xb0d7('0x19')]===_0xb0d7('0x18');var _0x340cf0=_0x2c99b4[_0xb0d7('0x1a')];var _0x1a72df=_0x2e22d1?0x0:_0x315dbb[_0xb0d7('0x17')];var _0x2b83b6=_0x2e22d1?_0x2c99b4['count']:_0x315dbb[_0xb0d7('0x17')]+_0x315dbb[_0xb0d7('0x19')];var _0x240784;if(_0x2b83b6>=_0x340cf0){_0x2b83b6=_0x340cf0;_0x240784=0xc8;}else{_0x240784=0xce;}_0x46fbb8[_0xb0d7('0x14')](_0x240784);return _0x46fbb8['set'](_0xb0d7('0x1b'),_0x1a72df+'-'+_0x2b83b6+'/'+_0x340cf0)[_0xb0d7('0x16')](_0x2c99b4);}return null;};}function patchUpdates(_0x462653){return function(_0x4db315){try{jsonpatch[_0xb0d7('0x1c')](_0x4db315,_0x462653,!![]);}catch(_0x1d696c){return BPromise[_0xb0d7('0x1d')](_0x1d696c);}return _0x4db315[_0xb0d7('0x1e')]();};}function saveUpdates(_0x3ce333,_0x55e3bf){return function(_0x293581){if(_0x293581){return _0x293581[_0xb0d7('0x1f')](_0x3ce333)[_0xb0d7('0x20')](function(_0x5f2caf){return _0x5f2caf;});}return null;};}function removeEntity(_0x1cc003,_0x30610f){return function(_0x337780){if(_0x337780){return _0x337780[_0xb0d7('0x21')]()[_0xb0d7('0x20')](function(){var _0x343e48=_0x337780[_0xb0d7('0x22')]({'plain':!![]});var _0x551f83=_0xb0d7('0x23');return db['UserProfileResource']['destroy']({'where':{'type':_0x551f83,'resourceId':_0x343e48['id']}})[_0xb0d7('0x20')](function(){return _0x337780;});})[_0xb0d7('0x20')](function(){_0x1cc003[_0xb0d7('0x14')](0xcc)[_0xb0d7('0x15')]();});}};}function handleEntityNotFound(_0x1b749c,_0x25cdd6){return function(_0x5cdd14){if(!_0x5cdd14){_0x1b749c[_0xb0d7('0x24')](0x194);}return _0x5cdd14;};}function handleError(_0x28b6f5,_0x46dcb9){_0x46dcb9=_0x46dcb9||0x1f4;return function(_0x2aecd9){logger[_0xb0d7('0x25')](_0x2aecd9[_0xb0d7('0x26')]);if(_0x2aecd9[_0xb0d7('0x27')]){delete _0x2aecd9[_0xb0d7('0x27')];}_0x28b6f5['status'](_0x46dcb9)['send'](_0x2aecd9);};}exports[_0xb0d7('0x28')]=function(_0x473e8a,_0x268c9d){var _0x1a8fc0={},_0x3f436e={},_0x16274d={'count':0x0,'rows':[]};var _0x9347a5=_[_0xb0d7('0x29')](db[_0xb0d7('0x2a')][_0xb0d7('0x2b')],function(_0xe8fbb7){return{'name':_0xe8fbb7[_0xb0d7('0x2c')],'type':_0xe8fbb7[_0xb0d7('0x2d')][_0xb0d7('0x2e')]};});_0x3f436e['model']=_[_0xb0d7('0x29')](_0x9347a5,_0xb0d7('0x27'));_0x3f436e[_0xb0d7('0x2f')]=_[_0xb0d7('0x30')](_0x473e8a[_0xb0d7('0x2f')]);_0x3f436e[_0xb0d7('0x31')]=_[_0xb0d7('0x32')](_0x3f436e[_0xb0d7('0x33')],_0x3f436e[_0xb0d7('0x2f')]);_0x1a8fc0[_0xb0d7('0x34')]=_['intersection'](_0x3f436e[_0xb0d7('0x33')],qs[_0xb0d7('0x35')](_0x473e8a[_0xb0d7('0x2f')][_0xb0d7('0x35')]));_0x1a8fc0[_0xb0d7('0x34')]=_0x1a8fc0[_0xb0d7('0x34')]['length']?_0x1a8fc0[_0xb0d7('0x34')]:_0x3f436e['model'];if(!_0x473e8a[_0xb0d7('0x2f')][_0xb0d7('0x36')](_0xb0d7('0x37'))){_0x1a8fc0[_0xb0d7('0x19')]=qs[_0xb0d7('0x19')](_0x473e8a[_0xb0d7('0x2f')][_0xb0d7('0x19')]);_0x1a8fc0[_0xb0d7('0x17')]=qs['offset'](_0x473e8a['query'][_0xb0d7('0x17')]);}_0x1a8fc0['order']=qs[_0xb0d7('0x38')](_0x473e8a[_0xb0d7('0x2f')][_0xb0d7('0x38')]);_0x1a8fc0[_0xb0d7('0x39')]=qs['filters'](_['pick'](_0x473e8a[_0xb0d7('0x2f')],_0x3f436e['filters']),_0x9347a5);if(_0x473e8a[_0xb0d7('0x2f')][_0xb0d7('0x3a')]){_0x1a8fc0['where']=_[_0xb0d7('0x3b')](_0x1a8fc0[_0xb0d7('0x39')],{'$or':_[_0xb0d7('0x29')](_0x9347a5,function(_0x33374a){if(_0x33374a[_0xb0d7('0x2d')]!==_0xb0d7('0x3c')){var _0x2e8965={};_0x2e8965[_0x33374a[_0xb0d7('0x27')]]={'$like':'%'+_0x473e8a['query'][_0xb0d7('0x3a')]+'%'};return _0x2e8965;}})});}_0x1a8fc0=_[_0xb0d7('0x3b')]({},_0x1a8fc0,_0x473e8a[_0xb0d7('0x3d')]);var _0x210ba8={'where':_0x1a8fc0['where']};return db[_0xb0d7('0x2a')][_0xb0d7('0x1a')](_0x210ba8)[_0xb0d7('0x20')](function(_0x578897){_0x16274d[_0xb0d7('0x1a')]=_0x578897;if(_0x473e8a['query'][_0xb0d7('0x3e')]){_0x1a8fc0[_0xb0d7('0x3f')]=[{'all':!![]}];}return db[_0xb0d7('0x2a')][_0xb0d7('0x40')](_0x1a8fc0);})[_0xb0d7('0x20')](function(_0x5bd932){_0x16274d[_0xb0d7('0x41')]=_0x5bd932;return _0x16274d;})[_0xb0d7('0x20')](respondWithFilteredResult(_0x268c9d,_0x1a8fc0))[_0xb0d7('0x42')](handleError(_0x268c9d,null));};exports[_0xb0d7('0x43')]=function(_0x4201f0,_0x5571e0){var _0x3bc74a={'raw':![],'where':{'id':_0x4201f0[_0xb0d7('0x44')]['id']}},_0x10c59c={};_0x10c59c[_0xb0d7('0x33')]=_[_0xb0d7('0x30')](db['Campaign'][_0xb0d7('0x2b')]);_0x10c59c[_0xb0d7('0x2f')]=_[_0xb0d7('0x30')](_0x4201f0['query']);_0x10c59c[_0xb0d7('0x31')]=_[_0xb0d7('0x32')](_0x10c59c[_0xb0d7('0x33')],_0x10c59c[_0xb0d7('0x2f')]);_0x3bc74a[_0xb0d7('0x34')]=_['intersection'](_0x10c59c[_0xb0d7('0x33')],qs[_0xb0d7('0x35')](_0x4201f0[_0xb0d7('0x2f')][_0xb0d7('0x35')]));_0x3bc74a[_0xb0d7('0x34')]=_0x3bc74a[_0xb0d7('0x34')][_0xb0d7('0x45')]?_0x3bc74a[_0xb0d7('0x34')]:_0x10c59c[_0xb0d7('0x33')];if(_0x4201f0['query'][_0xb0d7('0x3e')]){_0x3bc74a[_0xb0d7('0x3f')]=[{'all':!![]}];}_0x3bc74a=_['merge']({},_0x3bc74a,_0x4201f0[_0xb0d7('0x3d')]);return db[_0xb0d7('0x2a')][_0xb0d7('0x46')](_0x3bc74a)[_0xb0d7('0x20')](handleEntityNotFound(_0x5571e0,null))[_0xb0d7('0x20')](respondWithResult(_0x5571e0,null))[_0xb0d7('0x42')](handleError(_0x5571e0,null));};exports[_0xb0d7('0x47')]=function(_0x4cd7f5,_0x3fa8b8){return db[_0xb0d7('0x2a')][_0xb0d7('0x47')](_0x4cd7f5[_0xb0d7('0x48')],{})[_0xb0d7('0x20')](function(_0x9b43bf){var _0x3ed37c=_0x4cd7f5[_0xb0d7('0x49')]['get']({'plain':!![]});if(!_0x3ed37c)throw new Error(_0xb0d7('0x4a'));if(_0x3ed37c['role']===_0xb0d7('0x49')){var _0x1d0580=_0x9b43bf['get']({'plain':!![]});var _0x5943d6=_0xb0d7('0x23');return db[_0xb0d7('0x4b')][_0xb0d7('0x46')]({'where':{'name':_0x5943d6,'userProfileId':_0x3ed37c[_0xb0d7('0x4c')]},'raw':!![]})[_0xb0d7('0x20')](function(_0x68673b){if(_0x68673b&&_0x68673b['autoAssociation']===0x0){return db[_0xb0d7('0x4d')]['create']({'name':_0x1d0580[_0xb0d7('0x27')],'resourceId':_0x1d0580['id'],'type':_0x68673b['name'],'sectionId':_0x68673b['id']},{})[_0xb0d7('0x20')](function(){return _0x9b43bf;});}else{return _0x9b43bf;}})['catch'](function(_0x56ceae){logger[_0xb0d7('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x56ceae);throw _0x56ceae;});}return _0x9b43bf;})[_0xb0d7('0x20')](respondWithResult(_0x3fa8b8,0xc9))[_0xb0d7('0x42')](handleError(_0x3fa8b8,null));};exports[_0xb0d7('0x4e')]=function(_0x1f21f8,_0x302e97){var _0x3239b9={'where':{'id':_0x1f21f8[_0xb0d7('0x44')]['id']}},_0x761b47={};_0x761b47[_0xb0d7('0x33')]=_['keys'](db[_0xb0d7('0x2a')][_0xb0d7('0x2b')]);_0x3239b9[_0xb0d7('0x34')]=_[_0xb0d7('0x32')](_0x761b47[_0xb0d7('0x33')],qs[_0xb0d7('0x35')](_0x1f21f8[_0xb0d7('0x2f')][_0xb0d7('0x35')]));_0x3239b9[_0xb0d7('0x34')]=_0x3239b9[_0xb0d7('0x34')]['length']?_0x3239b9['attributes']:_0x761b47[_0xb0d7('0x33')];if(_0x1f21f8[_0xb0d7('0x2f')][_0xb0d7('0x3e')]){_0x3239b9[_0xb0d7('0x3f')]=[{'all':!![]}];}_0x3239b9=_[_0xb0d7('0x3b')]({},_0x3239b9,_0x1f21f8[_0xb0d7('0x3d')]);return db[_0xb0d7('0x2a')][_0xb0d7('0x46')](_0x3239b9)['then'](handleEntityNotFound(_0x302e97,null))[_0xb0d7('0x20')](function(_0x4f270e){if(_0x4f270e){var _0x36c54f=_0x4f270e[_0xb0d7('0x22')]({'plain':!![]});_0x36c54f=qs[_0xb0d7('0x4f')](_0x36c54f,['id',_0xb0d7('0x50'),'updatedAt']);_0x1f21f8['body']=_[_0xb0d7('0x4f')](_0x1f21f8[_0xb0d7('0x48')],['id',_0xb0d7('0x50'),_0xb0d7('0x51')]);return db[_0xb0d7('0x2a')][_0xb0d7('0x47')](_[_0xb0d7('0x3b')](_0x36c54f,_0x1f21f8[_0xb0d7('0x48')]),{'include':_0x1f21f8['query'][_0xb0d7('0x3e')]?[{'all':!![]}]:undefined})[_0xb0d7('0x20')](function(_0x41803b){var _0x32fb5e=_0x1f21f8['user']['get']({'plain':!![]});if(!_0x32fb5e)throw new Error(_0xb0d7('0x4a'));if(_0x32fb5e[_0xb0d7('0x52')]===_0xb0d7('0x49')){var _0x2e2d11=_0x41803b[_0xb0d7('0x22')]({'plain':!![]});var _0x98130e=_0xb0d7('0x23');return db['UserProfileSection'][_0xb0d7('0x46')]({'where':{'name':_0x98130e,'userProfileId':_0x32fb5e[_0xb0d7('0x4c')]},'raw':!![]})[_0xb0d7('0x20')](function(_0x2e7648){if(_0x2e7648&&_0x2e7648[_0xb0d7('0x53')]===0x0){return db[_0xb0d7('0x4d')][_0xb0d7('0x47')]({'name':_0x2e2d11[_0xb0d7('0x27')],'resourceId':_0x2e2d11['id'],'type':_0x2e7648[_0xb0d7('0x27')],'sectionId':_0x2e7648['id']},{})[_0xb0d7('0x20')](function(){return _0x41803b;});}else{return _0x41803b;}})[_0xb0d7('0x42')](function(_0x3d1a44){logger[_0xb0d7('0x25')](_0xb0d7('0x54'),_0x3d1a44);throw _0x3d1a44;});}return _0x41803b;});}})['then'](respondWithResult(_0x302e97,0xc9))[_0xb0d7('0x42')](handleError(_0x302e97,null));};exports[_0xb0d7('0x1f')]=function(_0x18b48a,_0x345c77){if(_0x18b48a[_0xb0d7('0x48')]['id']){delete _0x18b48a[_0xb0d7('0x48')]['id'];}return db['Campaign'][_0xb0d7('0x46')]({'where':{'id':_0x18b48a[_0xb0d7('0x44')]['id']}})[_0xb0d7('0x20')](handleEntityNotFound(_0x345c77,null))[_0xb0d7('0x20')](saveUpdates(_0x18b48a['body'],null))[_0xb0d7('0x20')](respondWithResult(_0x345c77,null))[_0xb0d7('0x42')](handleError(_0x345c77,null));};exports[_0xb0d7('0x21')]=function(_0x35bb0a,_0x34e8e7){return db['Campaign']['find']({'where':{'id':_0x35bb0a[_0xb0d7('0x44')]['id']}})['then'](handleEntityNotFound(_0x34e8e7,null))[_0xb0d7('0x20')](removeEntity(_0x34e8e7,null))['catch'](handleError(_0x34e8e7,null));};exports['getHoppers']=function(_0x46f23d,_0x472a5d,_0xa95c2a){var _0x58c894={'raw':!![],'where':{}};var _0x5f0efd={};var _0x8347b2={'count':0x0,'rows':[]};return db[_0xb0d7('0x2a')][_0xb0d7('0x55')]({'where':{'id':_0x46f23d['params']['id']}})[_0xb0d7('0x20')](handleEntityNotFound(_0x472a5d,null))[_0xb0d7('0x20')](function(_0x33bec9){if(_0x33bec9){_0x5f0efd[_0xb0d7('0x33')]=_[_0xb0d7('0x30')](db[_0xb0d7('0x56')][_0xb0d7('0x2b')]);_0x5f0efd['query']=_[_0xb0d7('0x30')](_0x46f23d[_0xb0d7('0x2f')]);_0x5f0efd['filters']=_[_0xb0d7('0x32')](_0x5f0efd[_0xb0d7('0x33')],_0x5f0efd['query']);_0x58c894[_0xb0d7('0x34')]=_['intersection'](_0x5f0efd['model'],qs['fields'](_0x46f23d[_0xb0d7('0x2f')][_0xb0d7('0x35')]));_0x58c894[_0xb0d7('0x34')]=_0x58c894['attributes']['length']?_0x58c894[_0xb0d7('0x34')]:_0x5f0efd['model'];if(!_0x46f23d[_0xb0d7('0x2f')][_0xb0d7('0x36')](_0xb0d7('0x37'))){_0x58c894[_0xb0d7('0x19')]=qs['limit'](_0x46f23d[_0xb0d7('0x2f')][_0xb0d7('0x19')]);_0x58c894[_0xb0d7('0x17')]=qs[_0xb0d7('0x17')](_0x46f23d[_0xb0d7('0x2f')]['offset']);}_0x58c894[_0xb0d7('0x57')]=qs[_0xb0d7('0x38')](_0x46f23d[_0xb0d7('0x2f')][_0xb0d7('0x38')]);_0x58c894[_0xb0d7('0x39')]=qs[_0xb0d7('0x31')](_[_0xb0d7('0x58')](_0x46f23d[_0xb0d7('0x2f')],_0x5f0efd['filters']));_0x58c894[_0xb0d7('0x39')][_0xb0d7('0x59')]=_0x33bec9['id'];if(_0x46f23d['query'][_0xb0d7('0x3a')]){_0x58c894[_0xb0d7('0x39')]=_[_0xb0d7('0x3b')](_0x58c894[_0xb0d7('0x39')],{'$or':_[_0xb0d7('0x29')](_0x58c894['attributes'],function(_0x204eb2){var _0x127717={};_0x127717[_0x204eb2]={'$like':'%'+_0x46f23d['query'][_0xb0d7('0x3a')]+'%'};return _0x127717;})});}_0x58c894=_[_0xb0d7('0x3b')]({},_0x58c894,_0x46f23d[_0xb0d7('0x3d')]);return db['CmHopper'][_0xb0d7('0x1a')]({'where':_0x58c894['where']})[_0xb0d7('0x20')](function(_0x576300){_0x8347b2[_0xb0d7('0x1a')]=_0x576300;if(_0x46f23d[_0xb0d7('0x2f')][_0xb0d7('0x3e')]){_0x58c894[_0xb0d7('0x3f')]=[{'all':!![]}];}return db[_0xb0d7('0x56')][_0xb0d7('0x40')](_0x58c894);})[_0xb0d7('0x20')](function(_0x2804e0){_0x8347b2[_0xb0d7('0x41')]=_0x2804e0;return _0x8347b2;});}})[_0xb0d7('0x20')](respondWithFilteredResult(_0x472a5d,_0x58c894))['catch'](handleError(_0x472a5d,null));};exports[_0xb0d7('0x5a')]=function(_0x3ebc48,_0x222382,_0x6bbe20){var _0x486a34={'raw':!![],'where':{}};var _0x4e76e6={};var _0x2ace15={'count':0x0,'rows':[]};return db[_0xb0d7('0x2a')][_0xb0d7('0x55')]({'where':{'id':_0x3ebc48[_0xb0d7('0x44')]['id']}})['then'](handleEntityNotFound(_0x222382,null))[_0xb0d7('0x20')](function(_0x207253){if(_0x207253){_0x4e76e6[_0xb0d7('0x33')]=_[_0xb0d7('0x30')](db[_0xb0d7('0x5b')][_0xb0d7('0x2b')]);_0x4e76e6['query']=_[_0xb0d7('0x30')](_0x3ebc48[_0xb0d7('0x2f')]);_0x4e76e6['filters']=_[_0xb0d7('0x32')](_0x4e76e6[_0xb0d7('0x33')],_0x4e76e6[_0xb0d7('0x2f')]);_0x486a34[_0xb0d7('0x34')]=_[_0xb0d7('0x32')](_0x4e76e6[_0xb0d7('0x33')],qs[_0xb0d7('0x35')](_0x3ebc48[_0xb0d7('0x2f')][_0xb0d7('0x35')]));_0x486a34[_0xb0d7('0x34')]=_0x486a34[_0xb0d7('0x34')][_0xb0d7('0x45')]?_0x486a34[_0xb0d7('0x34')]:_0x4e76e6['model'];if(!_0x3ebc48[_0xb0d7('0x2f')][_0xb0d7('0x36')]('nolimit')){_0x486a34['limit']=qs[_0xb0d7('0x19')](_0x3ebc48['query'][_0xb0d7('0x19')]);_0x486a34['offset']=qs[_0xb0d7('0x17')](_0x3ebc48[_0xb0d7('0x2f')][_0xb0d7('0x17')]);}_0x486a34[_0xb0d7('0x57')]=qs[_0xb0d7('0x38')](_0x3ebc48[_0xb0d7('0x2f')]['sort']);_0x486a34[_0xb0d7('0x39')]=qs[_0xb0d7('0x31')](_[_0xb0d7('0x58')](_0x3ebc48['query'],_0x4e76e6[_0xb0d7('0x31')]));_0x486a34[_0xb0d7('0x39')][_0xb0d7('0x59')]=_0x207253['id'];if(_0x3ebc48[_0xb0d7('0x2f')][_0xb0d7('0x3a')]){_0x486a34['where']=_['merge'](_0x486a34[_0xb0d7('0x39')],{'$or':_['map'](_0x486a34[_0xb0d7('0x34')],function(_0x2c8fe9){var _0x16fee1={};_0x16fee1[_0x2c8fe9]={'$like':'%'+_0x3ebc48[_0xb0d7('0x2f')][_0xb0d7('0x3a')]+'%'};return _0x16fee1;})});}_0x486a34=_[_0xb0d7('0x3b')]({},_0x486a34,_0x3ebc48['options']);return db[_0xb0d7('0x5b')][_0xb0d7('0x1a')]({'where':_0x486a34[_0xb0d7('0x39')]})[_0xb0d7('0x20')](function(_0x156293){_0x2ace15['count']=_0x156293;if(_0x3ebc48['query'][_0xb0d7('0x3e')]){_0x486a34[_0xb0d7('0x3f')]=[{'all':!![]}];}return db[_0xb0d7('0x5b')][_0xb0d7('0x40')](_0x486a34);})[_0xb0d7('0x20')](function(_0x5f1fe8){_0x2ace15[_0xb0d7('0x41')]=_0x5f1fe8;return _0x2ace15;});}})['then'](respondWithFilteredResult(_0x222382,_0x486a34))['catch'](handleError(_0x222382,null));};exports[_0xb0d7('0x5c')]=function(_0x55f0fd,_0x1c023b,_0x5988b2){var _0x4c0b8b={'raw':!![],'where':{}};var _0x525011={};var _0x488c2a={'count':0x0,'rows':[]};return db[_0xb0d7('0x2a')][_0xb0d7('0x55')]({'where':{'id':_0x55f0fd[_0xb0d7('0x44')]['id']}})[_0xb0d7('0x20')](handleEntityNotFound(_0x1c023b,null))[_0xb0d7('0x20')](function(_0x130d98){if(_0x130d98){_0x525011[_0xb0d7('0x33')]=_[_0xb0d7('0x30')](db[_0xb0d7('0x5d')][_0xb0d7('0x2b')]);_0x525011['query']=_[_0xb0d7('0x30')](_0x55f0fd['query']);_0x525011['filters']=_[_0xb0d7('0x32')](_0x525011['model'],_0x525011[_0xb0d7('0x2f')]);_0x4c0b8b[_0xb0d7('0x34')]=_[_0xb0d7('0x32')](_0x525011[_0xb0d7('0x33')],qs['fields'](_0x55f0fd[_0xb0d7('0x2f')][_0xb0d7('0x35')]));_0x4c0b8b['attributes']=_0x4c0b8b[_0xb0d7('0x34')][_0xb0d7('0x45')]?_0x4c0b8b['attributes']:_0x525011[_0xb0d7('0x33')];if(!_0x55f0fd[_0xb0d7('0x2f')]['hasOwnProperty'](_0xb0d7('0x37'))){_0x4c0b8b[_0xb0d7('0x19')]=qs[_0xb0d7('0x19')](_0x55f0fd[_0xb0d7('0x2f')][_0xb0d7('0x19')]);_0x4c0b8b[_0xb0d7('0x17')]=qs[_0xb0d7('0x17')](_0x55f0fd[_0xb0d7('0x2f')][_0xb0d7('0x17')]);}_0x4c0b8b[_0xb0d7('0x57')]=qs[_0xb0d7('0x38')](_0x55f0fd[_0xb0d7('0x2f')][_0xb0d7('0x38')]);_0x4c0b8b[_0xb0d7('0x39')]=qs['filters'](_[_0xb0d7('0x58')](_0x55f0fd['query'],_0x525011[_0xb0d7('0x31')]));_0x4c0b8b[_0xb0d7('0x39')][_0xb0d7('0x59')]=_0x130d98['id'];if(_0x55f0fd[_0xb0d7('0x2f')][_0xb0d7('0x3a')]){_0x4c0b8b[_0xb0d7('0x39')]=_['merge'](_0x4c0b8b[_0xb0d7('0x39')],{'$or':_[_0xb0d7('0x29')](_0x4c0b8b[_0xb0d7('0x34')],function(_0x20dcea){var _0x4e09bf={};_0x4e09bf[_0x20dcea]={'$like':'%'+_0x55f0fd[_0xb0d7('0x2f')][_0xb0d7('0x3a')]+'%'};return _0x4e09bf;})});}_0x4c0b8b=_['merge']({},_0x4c0b8b,_0x55f0fd['options']);return db[_0xb0d7('0x5d')][_0xb0d7('0x1a')]({'where':_0x4c0b8b[_0xb0d7('0x39')]})[_0xb0d7('0x20')](function(_0x52bea4){_0x488c2a[_0xb0d7('0x1a')]=_0x52bea4;if(_0x55f0fd['query'][_0xb0d7('0x3e')]){_0x4c0b8b['include']=[{'all':!![]}];}return db[_0xb0d7('0x5d')][_0xb0d7('0x40')](_0x4c0b8b);})['then'](function(_0x2a2b38){_0x488c2a['rows']=_0x2a2b38;return _0x488c2a;});}})[_0xb0d7('0x20')](respondWithFilteredResult(_0x1c023b,_0x4c0b8b))[_0xb0d7('0x42')](handleError(_0x1c023b,null));};exports[_0xb0d7('0x5e')]=function(_0x48a98c,_0x216c48,_0x110b20){var _0x1374c3={'raw':!![],'where':{}};var _0x35b1ff={};var _0x18166a={'count':0x0,'rows':[]};return db[_0xb0d7('0x2a')][_0xb0d7('0x55')]({'where':{'id':_0x48a98c[_0xb0d7('0x44')]['id']}})[_0xb0d7('0x20')](handleEntityNotFound(_0x216c48,null))[_0xb0d7('0x20')](function(_0x1f502d){if(_0x1f502d){_0x35b1ff['model']=_['keys'](db[_0xb0d7('0x5f')][_0xb0d7('0x2b')]);_0x35b1ff[_0xb0d7('0x2f')]=_[_0xb0d7('0x30')](_0x48a98c[_0xb0d7('0x2f')]);_0x35b1ff[_0xb0d7('0x31')]=_[_0xb0d7('0x32')](_0x35b1ff[_0xb0d7('0x33')],_0x35b1ff[_0xb0d7('0x2f')]);_0x1374c3[_0xb0d7('0x34')]=_[_0xb0d7('0x32')](_0x35b1ff[_0xb0d7('0x33')],qs[_0xb0d7('0x35')](_0x48a98c[_0xb0d7('0x2f')]['fields']));_0x1374c3[_0xb0d7('0x34')]=_0x1374c3[_0xb0d7('0x34')][_0xb0d7('0x45')]?_0x1374c3['attributes']:_0x35b1ff['model'];if(!_0x48a98c[_0xb0d7('0x2f')][_0xb0d7('0x36')](_0xb0d7('0x37'))){_0x1374c3[_0xb0d7('0x19')]=qs['limit'](_0x48a98c[_0xb0d7('0x2f')][_0xb0d7('0x19')]);_0x1374c3['offset']=qs[_0xb0d7('0x17')](_0x48a98c[_0xb0d7('0x2f')][_0xb0d7('0x17')]);}_0x1374c3[_0xb0d7('0x57')]=qs[_0xb0d7('0x38')](_0x48a98c[_0xb0d7('0x2f')][_0xb0d7('0x38')]);_0x1374c3['where']=qs['filters'](_[_0xb0d7('0x58')](_0x48a98c[_0xb0d7('0x2f')],_0x35b1ff[_0xb0d7('0x31')]));_0x1374c3[_0xb0d7('0x39')][_0xb0d7('0x59')]=_0x1f502d['id'];if(_0x48a98c[_0xb0d7('0x2f')][_0xb0d7('0x3a')]){_0x1374c3[_0xb0d7('0x39')]=_[_0xb0d7('0x3b')](_0x1374c3['where'],{'$or':_['map'](_0x1374c3[_0xb0d7('0x34')],function(_0x2c111e){var _0x29924f={};_0x29924f[_0x2c111e]={'$like':'%'+_0x48a98c[_0xb0d7('0x2f')]['filter']+'%'};return _0x29924f;})});}_0x1374c3=_[_0xb0d7('0x3b')]({},_0x1374c3,_0x48a98c[_0xb0d7('0x3d')]);return db[_0xb0d7('0x5f')][_0xb0d7('0x1a')]({'where':_0x1374c3['where']})['then'](function(_0x4b680c){_0x18166a['count']=_0x4b680c;if(_0x48a98c[_0xb0d7('0x2f')][_0xb0d7('0x3e')]){_0x1374c3['include']=[{'all':!![]}];}return db[_0xb0d7('0x5f')]['findAll'](_0x1374c3);})['then'](function(_0x30f530){_0x18166a[_0xb0d7('0x41')]=_0x30f530;return _0x18166a;});}})[_0xb0d7('0x20')](respondWithFilteredResult(_0x216c48,_0x1374c3))[_0xb0d7('0x42')](handleError(_0x216c48,null));};exports['getLists']=function(_0x106d78,_0x421323,_0x111948){var _0x171ea9={};var _0x4ccab1={};var _0x5093c1;var _0x567c00;return db['Campaign']['findOne']({'where':{'id':_0x106d78[_0xb0d7('0x44')]['id']}})[_0xb0d7('0x20')](handleEntityNotFound(_0x421323,null))[_0xb0d7('0x20')](function(_0x5ab7c0){if(_0x5ab7c0){_0x5093c1=_0x5ab7c0;_0x4ccab1['model']=_[_0xb0d7('0x30')](db['CmList'][_0xb0d7('0x2b')]);_0x4ccab1[_0xb0d7('0x2f')]=_['keys'](_0x106d78['query']);_0x4ccab1[_0xb0d7('0x31')]=_[_0xb0d7('0x32')](_0x4ccab1[_0xb0d7('0x33')],_0x4ccab1[_0xb0d7('0x2f')]);_0x171ea9[_0xb0d7('0x34')]=_[_0xb0d7('0x32')](_0x4ccab1[_0xb0d7('0x33')],qs[_0xb0d7('0x35')](_0x106d78['query'][_0xb0d7('0x35')]));_0x171ea9['attributes']=_0x171ea9[_0xb0d7('0x34')]['length']?_0x171ea9[_0xb0d7('0x34')]:_0x4ccab1['model'];_0x171ea9[_0xb0d7('0x57')]=qs[_0xb0d7('0x38')](_0x106d78[_0xb0d7('0x2f')][_0xb0d7('0x38')]);_0x171ea9['where']=qs[_0xb0d7('0x31')](_['pick'](_0x106d78['query'],_0x4ccab1['filters']));if(_0x106d78[_0xb0d7('0x2f')][_0xb0d7('0x3a')]){_0x171ea9[_0xb0d7('0x39')]=_[_0xb0d7('0x3b')](_0x171ea9['where'],{'$or':_[_0xb0d7('0x29')](_0x171ea9[_0xb0d7('0x34')],function(_0x477c77){var _0x10d410={};_0x10d410[_0x477c77]={'$like':'%'+_0x106d78[_0xb0d7('0x2f')][_0xb0d7('0x3a')]+'%'};return _0x10d410;})});}_0x171ea9=_[_0xb0d7('0x3b')]({},_0x171ea9,_0x106d78[_0xb0d7('0x3d')]);return _0x5093c1[_0xb0d7('0x60')](_0x171ea9);}})[_0xb0d7('0x20')](function(_0x2f0c8d){if(_0x2f0c8d){_0x567c00=_0x2f0c8d[_0xb0d7('0x45')];if(!_0x106d78[_0xb0d7('0x2f')][_0xb0d7('0x36')](_0xb0d7('0x37'))){_0x171ea9[_0xb0d7('0x19')]=qs['limit'](_0x106d78[_0xb0d7('0x2f')][_0xb0d7('0x19')]);_0x171ea9[_0xb0d7('0x17')]=qs[_0xb0d7('0x17')](_0x106d78[_0xb0d7('0x2f')][_0xb0d7('0x17')]);}return _0x5093c1['getLists'](_0x171ea9);}})['then'](function(_0x31e949){if(_0x31e949){return _0x31e949?{'count':_0x567c00,'rows':_0x31e949}:null;}})[_0xb0d7('0x20')](respondWithResult(_0x421323,null))[_0xb0d7('0x42')](handleError(_0x421323,null));};exports[_0xb0d7('0x61')]=function(_0x533435,_0x4cfd6d,_0x1d20f0){var _0x2ba765,_0x427251;return db['Campaign'][_0xb0d7('0x46')]({'where':{'id':_0x533435[_0xb0d7('0x44')]['id']}})['then'](handleEntityNotFound(_0x4cfd6d,null))[_0xb0d7('0x20')](function(_0x4cdb8d){if(_0x4cdb8d){_0x427251=_0x4cdb8d;return _0x4cdb8d[_0xb0d7('0x61')](_0x533435[_0xb0d7('0x48')]['ids'],_[_0xb0d7('0x4f')](_0x533435[_0xb0d7('0x48')],['ids','id'])||{});}return null;})[_0xb0d7('0x62')](function(_0x145a6c){var _0x5c07f3;_0x2ba765=_0x145a6c||[];var _0x166686=[];if(_0x145a6c){for(var _0x300bc9=0x0;_0x300bc9<_0x145a6c['length'];_0x300bc9+=0x1){var _0x556016=_0x145a6c[_0x300bc9][_0xb0d7('0x22')]({'plain':!![]});_0x427251['dialCheckDuplicateType']=_0x533435[_0xb0d7('0x48')][_0xb0d7('0x63')]?_0x533435[_0xb0d7('0x48')][_0xb0d7('0x63')]:_0x427251[_0xb0d7('0x63')];switch(_0x427251[_0xb0d7('0x63')]){case _0xb0d7('0x64'):_0x5c07f3=squel[_0xb0d7('0x65')]()[_0xb0d7('0x66')]('cm_hopper')['fromQuery']([_0xb0d7('0x67'),_0xb0d7('0x68'),_0xb0d7('0x69'),_0xb0d7('0x6a'),_0xb0d7('0x59'),_0xb0d7('0x50'),_0xb0d7('0x51')],squel[_0xb0d7('0x6b')]()[_0xb0d7('0x6c')]('phone','phone')[_0xb0d7('0x6c')](_0xb0d7('0x6d'),'scheduledAt')[_0xb0d7('0x6c')]('id','ContactId')[_0xb0d7('0x6c')](_0x556016[_0xb0d7('0x6e')][_0xb0d7('0x6f')](),_0xb0d7('0x6a'))['field'](_0x533435[_0xb0d7('0x44')]['id'][_0xb0d7('0x6f')](),'CampaignId')['field'](_0xb0d7('0x6d'),_0xb0d7('0x50'))[_0xb0d7('0x6c')](_0xb0d7('0x6d'),_0xb0d7('0x51'))[_0xb0d7('0x70')](_0xb0d7('0x71'))[_0xb0d7('0x39')]('deletedAt\x20IS\x20NULL')[_0xb0d7('0x39')](_0xb0d7('0x72'),_0x556016[_0xb0d7('0x6e')][_0xb0d7('0x6f')]())[_0xb0d7('0x39')](_0xb0d7('0x73'))[_0xb0d7('0x39')](_0xb0d7('0x74'),squel['select']()['field']('COALESCE(calleridnum,\x27\x27)')['from'](_0xb0d7('0x75'))[_0xb0d7('0x39')](_0xb0d7('0x76'),_0x533435[_0xb0d7('0x44')]['id'][_0xb0d7('0x6f')]()))[_0xb0d7('0x39')]('phone\x20NOT\x20IN\x20(?)',squel[_0xb0d7('0x6b')]()[_0xb0d7('0x6c')](_0xb0d7('0x77'))[_0xb0d7('0x70')]('cm_hopper')[_0xb0d7('0x39')](_0xb0d7('0x76'),_0x533435[_0xb0d7('0x44')]['id']['toString']())))[_0xb0d7('0x6f')]();break;case _0xb0d7('0x78'):_0x5c07f3=squel[_0xb0d7('0x65')]()[_0xb0d7('0x66')]('cm_hopper')[_0xb0d7('0x79')]([_0xb0d7('0x67'),_0xb0d7('0x68'),_0xb0d7('0x69'),_0xb0d7('0x6a'),'CampaignId',_0xb0d7('0x50'),_0xb0d7('0x51')],squel[_0xb0d7('0x6b')]()[_0xb0d7('0x6c')](_0xb0d7('0x67'),'phone')[_0xb0d7('0x6c')](_0xb0d7('0x6d'),_0xb0d7('0x68'))[_0xb0d7('0x6c')]('id',_0xb0d7('0x69'))[_0xb0d7('0x6c')](_0x556016[_0xb0d7('0x6e')][_0xb0d7('0x6f')](),_0xb0d7('0x6a'))['field'](_0x533435['params']['id'][_0xb0d7('0x6f')](),'CampaignId')[_0xb0d7('0x6c')](_0xb0d7('0x6d'),_0xb0d7('0x50'))[_0xb0d7('0x6c')](_0xb0d7('0x6d'),_0xb0d7('0x51'))[_0xb0d7('0x70')](_0xb0d7('0x71'))[_0xb0d7('0x39')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',_0x556016[_0xb0d7('0x6e')][_0xb0d7('0x6f')]())['where']('phone\x20IS\x20NOT\x20NULL')[_0xb0d7('0x39')](_0xb0d7('0x74'),squel[_0xb0d7('0x6b')]()['field']('COALESCE(phone,\x27\x27)')[_0xb0d7('0x70')]('cm_hopper')[_0xb0d7('0x39')](_0xb0d7('0x76'),_0x533435[_0xb0d7('0x44')]['id'][_0xb0d7('0x6f')]())))[_0xb0d7('0x6f')]();break;default:_0x5c07f3=squel[_0xb0d7('0x65')]()[_0xb0d7('0x66')](_0xb0d7('0x7a'))[_0xb0d7('0x79')]([_0xb0d7('0x67'),_0xb0d7('0x68'),_0xb0d7('0x69'),_0xb0d7('0x6a'),_0xb0d7('0x59'),_0xb0d7('0x50'),'updatedAt'],squel[_0xb0d7('0x6b')]()['field']('phone',_0xb0d7('0x67'))[_0xb0d7('0x6c')](_0xb0d7('0x6d'),_0xb0d7('0x68'))[_0xb0d7('0x6c')]('id',_0xb0d7('0x69'))[_0xb0d7('0x6c')](_0x556016[_0xb0d7('0x6e')][_0xb0d7('0x6f')](),_0xb0d7('0x6a'))['field'](_0x533435[_0xb0d7('0x44')]['id'][_0xb0d7('0x6f')](),_0xb0d7('0x59'))[_0xb0d7('0x6c')](_0xb0d7('0x6d'),_0xb0d7('0x50'))[_0xb0d7('0x6c')](_0xb0d7('0x6d'),'updatedAt')[_0xb0d7('0x70')](_0xb0d7('0x71'))[_0xb0d7('0x39')](_0xb0d7('0x7b'))[_0xb0d7('0x39')]('ListId\x20=\x20?',_0x556016[_0xb0d7('0x6e')]['toString']())[_0xb0d7('0x39')](_0xb0d7('0x73')))[_0xb0d7('0x6f')]();}_0x166686[_0xb0d7('0x7c')](db[_0xb0d7('0x7d')][_0xb0d7('0x2f')](_0x5c07f3));}return BPromise[_0xb0d7('0x7e')](_0x166686);}})[_0xb0d7('0x20')](function(){return _0x2ba765;})[_0xb0d7('0x20')](respondWithResult(_0x4cfd6d,null))['catch'](handleError(_0x4cfd6d,null));};exports['removeLists']=function(_0x1c436b,_0x63d46c,_0x43dd51){return db[_0xb0d7('0x2a')][_0xb0d7('0x46')]({'where':{'id':_0x1c436b[_0xb0d7('0x44')]['id']}})[_0xb0d7('0x20')](handleEntityNotFound(_0x63d46c,null))[_0xb0d7('0x20')](function(_0x55b3bd){if(_0x55b3bd){return _0x55b3bd[_0xb0d7('0x7f')](_0x1c436b[_0xb0d7('0x2f')]['ids']);}})[_0xb0d7('0x20')](function(_0x1bbf9f){if(_0x1bbf9f){return db['CmHopper'][_0xb0d7('0x21')]({'where':{'ListId':_0x1c436b[_0xb0d7('0x2f')]['ids'],'CampaignId':_0x1c436b[_0xb0d7('0x44')]['id']}})[_0xb0d7('0x20')](function(){return _0x1bbf9f;});}})[_0xb0d7('0x20')](respondWithStatusCode(_0x63d46c,null))[_0xb0d7('0x42')](handleError(_0x63d46c,null));};exports['getBlackLists']=function(_0x513ccc,_0x59d696,_0x1b642e){var _0x2afdba={};var _0x517a19={};var _0x3131e0;var _0x24801d;return db['Campaign'][_0xb0d7('0x55')]({'where':{'id':_0x513ccc[_0xb0d7('0x44')]['id']}})[_0xb0d7('0x20')](handleEntityNotFound(_0x59d696,null))[_0xb0d7('0x20')](function(_0x5dbfaf){if(_0x5dbfaf){_0x3131e0=_0x5dbfaf;_0x517a19[_0xb0d7('0x33')]=_[_0xb0d7('0x30')](db['CmList'][_0xb0d7('0x2b')]);_0x517a19[_0xb0d7('0x2f')]=_['keys'](_0x513ccc['query']);_0x517a19[_0xb0d7('0x31')]=_['intersection'](_0x517a19[_0xb0d7('0x33')],_0x517a19[_0xb0d7('0x2f')]);_0x2afdba[_0xb0d7('0x34')]=_[_0xb0d7('0x32')](_0x517a19['model'],qs['fields'](_0x513ccc[_0xb0d7('0x2f')][_0xb0d7('0x35')]));_0x2afdba['attributes']=_0x2afdba[_0xb0d7('0x34')][_0xb0d7('0x45')]?_0x2afdba[_0xb0d7('0x34')]:_0x517a19[_0xb0d7('0x33')];_0x2afdba[_0xb0d7('0x57')]=qs['sort'](_0x513ccc['query'][_0xb0d7('0x38')]);_0x2afdba[_0xb0d7('0x39')]=qs[_0xb0d7('0x31')](_[_0xb0d7('0x58')](_0x513ccc['query'],_0x517a19['filters']));if(_0x513ccc[_0xb0d7('0x2f')][_0xb0d7('0x3a')]){_0x2afdba[_0xb0d7('0x39')]=_[_0xb0d7('0x3b')](_0x2afdba[_0xb0d7('0x39')],{'$or':_['map'](_0x2afdba[_0xb0d7('0x34')],function(_0x213f35){var _0x1ef8a2={};_0x1ef8a2[_0x213f35]={'$like':'%'+_0x513ccc['query'][_0xb0d7('0x3a')]+'%'};return _0x1ef8a2;})});}_0x2afdba=_[_0xb0d7('0x3b')]({},_0x2afdba,_0x513ccc['options']);return _0x3131e0[_0xb0d7('0x80')](_0x2afdba);}})[_0xb0d7('0x20')](function(_0x1dc4b5){if(_0x1dc4b5){_0x24801d=_0x1dc4b5[_0xb0d7('0x45')];if(!_0x513ccc['query'][_0xb0d7('0x36')]('nolimit')){_0x2afdba[_0xb0d7('0x19')]=qs['limit'](_0x513ccc[_0xb0d7('0x2f')][_0xb0d7('0x19')]);_0x2afdba[_0xb0d7('0x17')]=qs[_0xb0d7('0x17')](_0x513ccc['query'][_0xb0d7('0x17')]);}return _0x3131e0[_0xb0d7('0x80')](_0x2afdba);}})[_0xb0d7('0x20')](function(_0x5dcfa2){if(_0x5dcfa2){return _0x5dcfa2?{'count':_0x24801d,'rows':_0x5dcfa2}:null;}})[_0xb0d7('0x20')](respondWithResult(_0x59d696,null))[_0xb0d7('0x42')](handleError(_0x59d696,null));};exports[_0xb0d7('0x81')]=function(_0x40efb7,_0x4c0aa1,_0x5cf758){var _0x2f16ae,_0x84916c;return db[_0xb0d7('0x2a')][_0xb0d7('0x46')]({'where':{'id':_0x40efb7['params']['id']}})[_0xb0d7('0x20')](handleEntityNotFound(_0x4c0aa1,null))[_0xb0d7('0x20')](function(_0x4d1108){if(_0x4d1108){_0x84916c=_0x4d1108;return _0x4d1108['addBlackLists'](_0x40efb7['body'][_0xb0d7('0x82')],_[_0xb0d7('0x4f')](_0x40efb7[_0xb0d7('0x48')],[_0xb0d7('0x82'),'id'])||{});}return null;})[_0xb0d7('0x62')](function(_0x27a70c){var _0xa5b8e;_0x2f16ae=_0x27a70c||[];var _0x43c7d1=[];if(_0x27a70c){for(var _0x20fd69=0x0;_0x20fd69<_0x27a70c[_0xb0d7('0x45')];_0x20fd69+=0x1){var _0x4bfe50=_0x27a70c[_0x20fd69]['get']({'plain':!![]});_0xa5b8e=squel[_0xb0d7('0x65')]()[_0xb0d7('0x66')](_0xb0d7('0x83'))[_0xb0d7('0x79')]([_0xb0d7('0x67'),_0xb0d7('0x69'),'ListId',_0xb0d7('0x59'),_0xb0d7('0x50'),_0xb0d7('0x51')],squel['select']()[_0xb0d7('0x6c')](_0xb0d7('0x67'),_0xb0d7('0x67'))[_0xb0d7('0x6c')]('id',_0xb0d7('0x69'))['field'](_0x4bfe50[_0xb0d7('0x6e')]['toString'](),_0xb0d7('0x6a'))[_0xb0d7('0x6c')](_0x40efb7['params']['id'][_0xb0d7('0x6f')](),_0xb0d7('0x59'))[_0xb0d7('0x6c')](_0xb0d7('0x6d'),'createdAt')[_0xb0d7('0x6c')](_0xb0d7('0x6d'),'updatedAt')[_0xb0d7('0x70')](_0xb0d7('0x71'))[_0xb0d7('0x39')](_0xb0d7('0x7b'))['where']('ListId\x20=\x20?',_0x4bfe50[_0xb0d7('0x6e')][_0xb0d7('0x6f')]())['where'](_0xb0d7('0x73')))['toString']();_0x43c7d1[_0xb0d7('0x7c')](db[_0xb0d7('0x7d')][_0xb0d7('0x2f')](_0xa5b8e));}return BPromise[_0xb0d7('0x7e')](_0x43c7d1);}})[_0xb0d7('0x20')](function(){return _0x2f16ae;})[_0xb0d7('0x20')](respondWithResult(_0x4c0aa1,null))[_0xb0d7('0x42')](handleError(_0x4c0aa1,null));};exports[_0xb0d7('0x84')]=function(_0xd6b871,_0x5967c3,_0xac1b5){return db[_0xb0d7('0x2a')]['find']({'where':{'id':_0xd6b871[_0xb0d7('0x44')]['id']}})[_0xb0d7('0x20')](handleEntityNotFound(_0x5967c3,null))[_0xb0d7('0x20')](function(_0x275a4f){if(_0x275a4f){return _0x275a4f['removeBlackLists'](_0xd6b871[_0xb0d7('0x2f')][_0xb0d7('0x82')]);}})[_0xb0d7('0x20')](function(_0x4cadd5){if(_0x4cadd5){return db[_0xb0d7('0x5f')][_0xb0d7('0x21')]({'where':{'ListId':_0xd6b871[_0xb0d7('0x2f')][_0xb0d7('0x82')],'CampaignId':_0xd6b871['params']['id']}})[_0xb0d7('0x20')](function(){return _0x4cadd5;});}})[_0xb0d7('0x20')](respondWithStatusCode(_0x5967c3,null))[_0xb0d7('0x42')](handleError(_0x5967c3,null));}; \ No newline at end of file +var _0xedf1=['removeLists','getBlackLists','addBlackLists','cm_hopper_black','push','all','removeBlackLists','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/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','get','IvrCampaigns','stack','name','send','index','map','Campaign','rawAttributes','type','model','query','keys','intersection','attributes','hasOwnProperty','nolimit','sort','filters','pick','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','fields','length','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','find','userProfileId','UserProfileResource','create','error','clone','omit','createdAt','updatedAt','body','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','getHoppers','findOne','order','CmHopper','getHopperHistories','CmHopperHistory','CampaignId','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','dialCheckDuplicateType','always','into','cm_hopper','phone','scheduledAt','ContactId','select','field','NOW()','ListId','toString','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','insert','fromQuery','CmListId','sequelize'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xedf1,0x11f));var _0x1edf=function(_0x33f8ae,_0x313780){_0x33f8ae=_0x33f8ae-0x0;var _0x526d4d=_0xedf1[_0x33f8ae];return _0x526d4d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1edf('0x0'));var jsonpatch=require(_0x1edf('0x1'));var rp=require(_0x1edf('0x2'));var moment=require(_0x1edf('0x3'));var BPromise=require(_0x1edf('0x4'));var Mustache=require(_0x1edf('0x5'));var util=require(_0x1edf('0x6'));var path=require('path');var sox=require(_0x1edf('0x7'));var csv=require(_0x1edf('0x8'));var ejs=require(_0x1edf('0x9'));var fs=require('fs');var fs_extra=require(_0x1edf('0xa'));var _=require(_0x1edf('0xb'));var squel=require(_0x1edf('0xc'));var crypto=require(_0x1edf('0xd'));var jsforce=require(_0x1edf('0xe'));var deskjs=require(_0x1edf('0xf'));var toCsv=require('to-csv');var querystring=require(_0x1edf('0x10'));var Papa=require(_0x1edf('0x11'));var Redis=require(_0x1edf('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x1edf('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1edf('0x14'));var logger=require(_0x1edf('0x15'))('api');var utils=require(_0x1edf('0x16'));var config=require(_0x1edf('0x17'));var licenseUtil=require(_0x1edf('0x18'));var db=require(_0x1edf('0x19'))['db'];function respondWithStatusCode(_0x28a87a,_0x315c55){_0x315c55=_0x315c55||0xcc;return function(_0x3508f9){if(_0x3508f9){return _0x28a87a[_0x1edf('0x1a')](_0x315c55);}return _0x28a87a[_0x1edf('0x1b')](_0x315c55)[_0x1edf('0x1c')]();};}function respondWithResult(_0x5aad1d,_0x348444){_0x348444=_0x348444||0xc8;return function(_0x462f4b){if(_0x462f4b){return _0x5aad1d[_0x1edf('0x1b')](_0x348444)[_0x1edf('0x1d')](_0x462f4b);}};}function respondWithFilteredResult(_0x387b27,_0x24db37){return function(_0x1d192c){if(_0x1d192c){var _0x50d440=typeof _0x24db37['offset']===_0x1edf('0x1e')&&typeof _0x24db37[_0x1edf('0x1f')]===_0x1edf('0x1e');var _0x47d619=_0x1d192c[_0x1edf('0x20')];var _0x424f50=_0x50d440?0x0:_0x24db37[_0x1edf('0x21')];var _0x497d6c=_0x50d440?_0x1d192c[_0x1edf('0x20')]:_0x24db37[_0x1edf('0x21')]+_0x24db37[_0x1edf('0x1f')];var _0x17c026;if(_0x497d6c>=_0x47d619){_0x497d6c=_0x47d619;_0x17c026=0xc8;}else{_0x17c026=0xce;}_0x387b27[_0x1edf('0x1b')](_0x17c026);return _0x387b27[_0x1edf('0x22')](_0x1edf('0x23'),_0x424f50+'-'+_0x497d6c+'/'+_0x47d619)['json'](_0x1d192c);}return null;};}function patchUpdates(_0x186d55){return function(_0x3f696b){try{jsonpatch[_0x1edf('0x24')](_0x3f696b,_0x186d55,!![]);}catch(_0x509338){return BPromise[_0x1edf('0x25')](_0x509338);}return _0x3f696b[_0x1edf('0x26')]();};}function saveUpdates(_0x338281,_0x54c463){return function(_0xd674f2){if(_0xd674f2){return _0xd674f2['update'](_0x338281)[_0x1edf('0x27')](function(_0x27f96a){return _0x27f96a;});}return null;};}function removeEntity(_0x57c1ba,_0x5857c9){return function(_0x11d479){if(_0x11d479){return _0x11d479[_0x1edf('0x28')]()[_0x1edf('0x27')](function(){var _0x2a2606=_0x11d479[_0x1edf('0x29')]({'plain':!![]});var _0x545b99=_0x1edf('0x2a');return db['UserProfileResource'][_0x1edf('0x28')]({'where':{'type':_0x545b99,'resourceId':_0x2a2606['id']}})['then'](function(){return _0x11d479;});})[_0x1edf('0x27')](function(){_0x57c1ba[_0x1edf('0x1b')](0xcc)[_0x1edf('0x1c')]();});}};}function handleEntityNotFound(_0x177cf4,_0x3eca37){return function(_0x14bcec){if(!_0x14bcec){_0x177cf4['sendStatus'](0x194);}return _0x14bcec;};}function handleError(_0x3a2828,_0x388fac){_0x388fac=_0x388fac||0x1f4;return function(_0x3d66de){logger['error'](_0x3d66de[_0x1edf('0x2b')]);if(_0x3d66de['name']){delete _0x3d66de[_0x1edf('0x2c')];}_0x3a2828[_0x1edf('0x1b')](_0x388fac)[_0x1edf('0x2d')](_0x3d66de);};}exports[_0x1edf('0x2e')]=function(_0x4c9b1d,_0x1a02ba){var _0x1c7e84={},_0x3a191d={},_0x714308={'count':0x0,'rows':[]};var _0x16241e=_[_0x1edf('0x2f')](db[_0x1edf('0x30')][_0x1edf('0x31')],function(_0x1b3dd4){return{'name':_0x1b3dd4['fieldName'],'type':_0x1b3dd4[_0x1edf('0x32')]['key']};});_0x3a191d[_0x1edf('0x33')]=_[_0x1edf('0x2f')](_0x16241e,'name');_0x3a191d[_0x1edf('0x34')]=_[_0x1edf('0x35')](_0x4c9b1d[_0x1edf('0x34')]);_0x3a191d['filters']=_[_0x1edf('0x36')](_0x3a191d[_0x1edf('0x33')],_0x3a191d[_0x1edf('0x34')]);_0x1c7e84['attributes']=_['intersection'](_0x3a191d[_0x1edf('0x33')],qs['fields'](_0x4c9b1d['query']['fields']));_0x1c7e84[_0x1edf('0x37')]=_0x1c7e84[_0x1edf('0x37')]['length']?_0x1c7e84['attributes']:_0x3a191d[_0x1edf('0x33')];if(!_0x4c9b1d['query'][_0x1edf('0x38')](_0x1edf('0x39'))){_0x1c7e84[_0x1edf('0x1f')]=qs[_0x1edf('0x1f')](_0x4c9b1d['query'][_0x1edf('0x1f')]);_0x1c7e84[_0x1edf('0x21')]=qs[_0x1edf('0x21')](_0x4c9b1d[_0x1edf('0x34')][_0x1edf('0x21')]);}_0x1c7e84['order']=qs[_0x1edf('0x3a')](_0x4c9b1d[_0x1edf('0x34')][_0x1edf('0x3a')]);_0x1c7e84['where']=qs[_0x1edf('0x3b')](_[_0x1edf('0x3c')](_0x4c9b1d[_0x1edf('0x34')],_0x3a191d[_0x1edf('0x3b')]),_0x16241e);if(_0x4c9b1d[_0x1edf('0x34')]['filter']){_0x1c7e84[_0x1edf('0x3d')]=_[_0x1edf('0x3e')](_0x1c7e84[_0x1edf('0x3d')],{'$or':_[_0x1edf('0x2f')](_0x16241e,function(_0x5c25ae){if(_0x5c25ae[_0x1edf('0x32')]!==_0x1edf('0x3f')){var _0x1981fa={};_0x1981fa[_0x5c25ae[_0x1edf('0x2c')]]={'$like':'%'+_0x4c9b1d['query'][_0x1edf('0x40')]+'%'};return _0x1981fa;}})});}_0x1c7e84=_[_0x1edf('0x3e')]({},_0x1c7e84,_0x4c9b1d[_0x1edf('0x41')]);var _0xba2b2f={'where':_0x1c7e84['where']};return db[_0x1edf('0x30')]['count'](_0xba2b2f)[_0x1edf('0x27')](function(_0x5f3c87){_0x714308['count']=_0x5f3c87;if(_0x4c9b1d[_0x1edf('0x34')][_0x1edf('0x42')]){_0x1c7e84[_0x1edf('0x43')]=[{'all':!![]}];}return db[_0x1edf('0x30')][_0x1edf('0x44')](_0x1c7e84);})[_0x1edf('0x27')](function(_0x1dbf22){_0x714308[_0x1edf('0x45')]=_0x1dbf22;return _0x714308;})['then'](respondWithFilteredResult(_0x1a02ba,_0x1c7e84))[_0x1edf('0x46')](handleError(_0x1a02ba,null));};exports[_0x1edf('0x47')]=function(_0x45dc41,_0x434380){var _0x55ab44={'raw':![],'where':{'id':_0x45dc41[_0x1edf('0x48')]['id']}},_0x33ffbf={};_0x33ffbf[_0x1edf('0x33')]=_[_0x1edf('0x35')](db['Campaign']['rawAttributes']);_0x33ffbf['query']=_[_0x1edf('0x35')](_0x45dc41[_0x1edf('0x34')]);_0x33ffbf[_0x1edf('0x3b')]=_['intersection'](_0x33ffbf[_0x1edf('0x33')],_0x33ffbf[_0x1edf('0x34')]);_0x55ab44[_0x1edf('0x37')]=_['intersection'](_0x33ffbf[_0x1edf('0x33')],qs[_0x1edf('0x49')](_0x45dc41['query'][_0x1edf('0x49')]));_0x55ab44[_0x1edf('0x37')]=_0x55ab44[_0x1edf('0x37')][_0x1edf('0x4a')]?_0x55ab44[_0x1edf('0x37')]:_0x33ffbf[_0x1edf('0x33')];if(_0x45dc41[_0x1edf('0x34')]['includeAll']){_0x55ab44['include']=[{'all':!![]}];}_0x55ab44=_[_0x1edf('0x3e')]({},_0x55ab44,_0x45dc41[_0x1edf('0x41')]);return db[_0x1edf('0x30')]['find'](_0x55ab44)['then'](handleEntityNotFound(_0x434380,null))[_0x1edf('0x27')](respondWithResult(_0x434380,null))[_0x1edf('0x46')](handleError(_0x434380,null));};exports['create']=function(_0x548d1b,_0x50f4ba){return db[_0x1edf('0x30')]['create'](_0x548d1b['body'],{})[_0x1edf('0x27')](function(_0x497a01){var _0x3eb1bf=_0x548d1b['user'][_0x1edf('0x29')]({'plain':!![]});if(!_0x3eb1bf)throw new Error(_0x1edf('0x4b'));if(_0x3eb1bf[_0x1edf('0x4c')]===_0x1edf('0x4d')){var _0x15be89=_0x497a01[_0x1edf('0x29')]({'plain':!![]});var _0x3b73bd=_0x1edf('0x2a');return db['UserProfileSection'][_0x1edf('0x4e')]({'where':{'name':_0x3b73bd,'userProfileId':_0x3eb1bf[_0x1edf('0x4f')]},'raw':!![]})['then'](function(_0x47decf){if(_0x47decf&&_0x47decf['autoAssociation']===0x0){return db[_0x1edf('0x50')][_0x1edf('0x51')]({'name':_0x15be89['name'],'resourceId':_0x15be89['id'],'type':_0x47decf[_0x1edf('0x2c')],'sectionId':_0x47decf['id']},{})[_0x1edf('0x27')](function(){return _0x497a01;});}else{return _0x497a01;}})[_0x1edf('0x46')](function(_0x4a5807){logger[_0x1edf('0x52')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4a5807);throw _0x4a5807;});}return _0x497a01;})['then'](respondWithResult(_0x50f4ba,0xc9))[_0x1edf('0x46')](handleError(_0x50f4ba,null));};exports[_0x1edf('0x53')]=function(_0x255e90,_0xda02bb){var _0x3261b1={'where':{'id':_0x255e90[_0x1edf('0x48')]['id']}},_0x1ad7ac={};_0x1ad7ac[_0x1edf('0x33')]=_[_0x1edf('0x35')](db[_0x1edf('0x30')][_0x1edf('0x31')]);_0x3261b1[_0x1edf('0x37')]=_[_0x1edf('0x36')](_0x1ad7ac[_0x1edf('0x33')],qs[_0x1edf('0x49')](_0x255e90[_0x1edf('0x34')][_0x1edf('0x49')]));_0x3261b1[_0x1edf('0x37')]=_0x3261b1['attributes'][_0x1edf('0x4a')]?_0x3261b1[_0x1edf('0x37')]:_0x1ad7ac[_0x1edf('0x33')];if(_0x255e90[_0x1edf('0x34')][_0x1edf('0x42')]){_0x3261b1[_0x1edf('0x43')]=[{'all':!![]}];}_0x3261b1=_[_0x1edf('0x3e')]({},_0x3261b1,_0x255e90[_0x1edf('0x41')]);return db[_0x1edf('0x30')][_0x1edf('0x4e')](_0x3261b1)[_0x1edf('0x27')](handleEntityNotFound(_0xda02bb,null))['then'](function(_0x50bea3){if(_0x50bea3){var _0x13bba0=_0x50bea3[_0x1edf('0x29')]({'plain':!![]});_0x13bba0=qs[_0x1edf('0x54')](_0x13bba0,['id',_0x1edf('0x55'),_0x1edf('0x56')]);_0x255e90[_0x1edf('0x57')]=_[_0x1edf('0x54')](_0x255e90[_0x1edf('0x57')],['id',_0x1edf('0x55'),_0x1edf('0x56')]);return db['Campaign'][_0x1edf('0x51')](_['merge'](_0x13bba0,_0x255e90[_0x1edf('0x57')]),{'include':_0x255e90[_0x1edf('0x34')][_0x1edf('0x42')]?[{'all':!![]}]:undefined})['then'](function(_0x39db8e){var _0x3ec265=_0x255e90[_0x1edf('0x4d')]['get']({'plain':!![]});if(!_0x3ec265)throw new Error(_0x1edf('0x4b'));if(_0x3ec265[_0x1edf('0x4c')]===_0x1edf('0x4d')){var _0x393b0a=_0x39db8e[_0x1edf('0x29')]({'plain':!![]});var _0x7f6276='IvrCampaigns';return db['UserProfileSection'][_0x1edf('0x4e')]({'where':{'name':_0x7f6276,'userProfileId':_0x3ec265[_0x1edf('0x4f')]},'raw':!![]})[_0x1edf('0x27')](function(_0x4b82a3){if(_0x4b82a3&&_0x4b82a3[_0x1edf('0x58')]===0x0){return db['UserProfileResource'][_0x1edf('0x51')]({'name':_0x393b0a[_0x1edf('0x2c')],'resourceId':_0x393b0a['id'],'type':_0x4b82a3[_0x1edf('0x2c')],'sectionId':_0x4b82a3['id']},{})[_0x1edf('0x27')](function(){return _0x39db8e;});}else{return _0x39db8e;}})[_0x1edf('0x46')](function(_0x3fd832){logger[_0x1edf('0x52')](_0x1edf('0x59'),_0x3fd832);throw _0x3fd832;});}return _0x39db8e;});}})[_0x1edf('0x27')](respondWithResult(_0xda02bb,0xc9))['catch'](handleError(_0xda02bb,null));};exports[_0x1edf('0x5a')]=function(_0x36bc6b,_0x1888a4){if(_0x36bc6b['body']['id']){delete _0x36bc6b['body']['id'];}return db[_0x1edf('0x30')][_0x1edf('0x4e')]({'where':{'id':_0x36bc6b[_0x1edf('0x48')]['id']}})[_0x1edf('0x27')](handleEntityNotFound(_0x1888a4,null))[_0x1edf('0x27')](saveUpdates(_0x36bc6b[_0x1edf('0x57')],null))['then'](respondWithResult(_0x1888a4,null))[_0x1edf('0x46')](handleError(_0x1888a4,null));};exports[_0x1edf('0x28')]=function(_0xd6da3f,_0x2eae0c){return db[_0x1edf('0x30')]['find']({'where':{'id':_0xd6da3f[_0x1edf('0x48')]['id']}})[_0x1edf('0x27')](handleEntityNotFound(_0x2eae0c,null))['then'](removeEntity(_0x2eae0c,null))[_0x1edf('0x46')](handleError(_0x2eae0c,null));};exports[_0x1edf('0x5b')]=function(_0x217f0f,_0x417bfa,_0x42b5f2){var _0x45b471={'raw':!![],'where':{}};var _0x22243b={};var _0x36eb81={'count':0x0,'rows':[]};return db['Campaign'][_0x1edf('0x5c')]({'where':{'id':_0x217f0f[_0x1edf('0x48')]['id']}})[_0x1edf('0x27')](handleEntityNotFound(_0x417bfa,null))[_0x1edf('0x27')](function(_0xbc11cf){if(_0xbc11cf){_0x22243b[_0x1edf('0x33')]=_['keys'](db['CmHopper'][_0x1edf('0x31')]);_0x22243b['query']=_[_0x1edf('0x35')](_0x217f0f[_0x1edf('0x34')]);_0x22243b['filters']=_[_0x1edf('0x36')](_0x22243b[_0x1edf('0x33')],_0x22243b[_0x1edf('0x34')]);_0x45b471['attributes']=_[_0x1edf('0x36')](_0x22243b[_0x1edf('0x33')],qs[_0x1edf('0x49')](_0x217f0f[_0x1edf('0x34')]['fields']));_0x45b471['attributes']=_0x45b471[_0x1edf('0x37')]['length']?_0x45b471[_0x1edf('0x37')]:_0x22243b[_0x1edf('0x33')];if(!_0x217f0f[_0x1edf('0x34')][_0x1edf('0x38')](_0x1edf('0x39'))){_0x45b471[_0x1edf('0x1f')]=qs[_0x1edf('0x1f')](_0x217f0f[_0x1edf('0x34')][_0x1edf('0x1f')]);_0x45b471[_0x1edf('0x21')]=qs[_0x1edf('0x21')](_0x217f0f[_0x1edf('0x34')][_0x1edf('0x21')]);}_0x45b471[_0x1edf('0x5d')]=qs[_0x1edf('0x3a')](_0x217f0f[_0x1edf('0x34')][_0x1edf('0x3a')]);_0x45b471[_0x1edf('0x3d')]=qs['filters'](_[_0x1edf('0x3c')](_0x217f0f[_0x1edf('0x34')],_0x22243b[_0x1edf('0x3b')]));_0x45b471[_0x1edf('0x3d')]['CampaignId']=_0xbc11cf['id'];if(_0x217f0f[_0x1edf('0x34')][_0x1edf('0x40')]){_0x45b471[_0x1edf('0x3d')]=_[_0x1edf('0x3e')](_0x45b471[_0x1edf('0x3d')],{'$or':_[_0x1edf('0x2f')](_0x45b471[_0x1edf('0x37')],function(_0x2b1fdf){var _0x209d52={};_0x209d52[_0x2b1fdf]={'$like':'%'+_0x217f0f[_0x1edf('0x34')][_0x1edf('0x40')]+'%'};return _0x209d52;})});}_0x45b471=_['merge']({},_0x45b471,_0x217f0f[_0x1edf('0x41')]);return db['CmHopper']['count']({'where':_0x45b471['where']})['then'](function(_0x420f87){_0x36eb81[_0x1edf('0x20')]=_0x420f87;if(_0x217f0f[_0x1edf('0x34')][_0x1edf('0x42')]){_0x45b471[_0x1edf('0x43')]=[{'all':!![]}];}return db[_0x1edf('0x5e')][_0x1edf('0x44')](_0x45b471);})['then'](function(_0xb820bc){_0x36eb81[_0x1edf('0x45')]=_0xb820bc;return _0x36eb81;});}})['then'](respondWithFilteredResult(_0x417bfa,_0x45b471))[_0x1edf('0x46')](handleError(_0x417bfa,null));};exports[_0x1edf('0x5f')]=function(_0x3d46b9,_0xfcf855,_0x1848f0){var _0x4a02f9={'raw':!![],'where':{}};var _0x5a4cc7={};var _0x38aa47={'count':0x0,'rows':[]};return db['Campaign'][_0x1edf('0x5c')]({'where':{'id':_0x3d46b9[_0x1edf('0x48')]['id']}})['then'](handleEntityNotFound(_0xfcf855,null))[_0x1edf('0x27')](function(_0x3ef66f){if(_0x3ef66f){_0x5a4cc7['model']=_[_0x1edf('0x35')](db[_0x1edf('0x60')][_0x1edf('0x31')]);_0x5a4cc7['query']=_['keys'](_0x3d46b9[_0x1edf('0x34')]);_0x5a4cc7[_0x1edf('0x3b')]=_[_0x1edf('0x36')](_0x5a4cc7['model'],_0x5a4cc7['query']);_0x4a02f9['attributes']=_[_0x1edf('0x36')](_0x5a4cc7[_0x1edf('0x33')],qs[_0x1edf('0x49')](_0x3d46b9['query'][_0x1edf('0x49')]));_0x4a02f9[_0x1edf('0x37')]=_0x4a02f9[_0x1edf('0x37')][_0x1edf('0x4a')]?_0x4a02f9[_0x1edf('0x37')]:_0x5a4cc7[_0x1edf('0x33')];if(!_0x3d46b9[_0x1edf('0x34')][_0x1edf('0x38')](_0x1edf('0x39'))){_0x4a02f9[_0x1edf('0x1f')]=qs[_0x1edf('0x1f')](_0x3d46b9['query'][_0x1edf('0x1f')]);_0x4a02f9[_0x1edf('0x21')]=qs[_0x1edf('0x21')](_0x3d46b9['query'][_0x1edf('0x21')]);}_0x4a02f9[_0x1edf('0x5d')]=qs[_0x1edf('0x3a')](_0x3d46b9[_0x1edf('0x34')][_0x1edf('0x3a')]);_0x4a02f9['where']=qs[_0x1edf('0x3b')](_[_0x1edf('0x3c')](_0x3d46b9[_0x1edf('0x34')],_0x5a4cc7[_0x1edf('0x3b')]));_0x4a02f9[_0x1edf('0x3d')][_0x1edf('0x61')]=_0x3ef66f['id'];if(_0x3d46b9[_0x1edf('0x34')]['filter']){_0x4a02f9[_0x1edf('0x3d')]=_[_0x1edf('0x3e')](_0x4a02f9[_0x1edf('0x3d')],{'$or':_[_0x1edf('0x2f')](_0x4a02f9[_0x1edf('0x37')],function(_0x5e6288){var _0x314144={};_0x314144[_0x5e6288]={'$like':'%'+_0x3d46b9[_0x1edf('0x34')][_0x1edf('0x40')]+'%'};return _0x314144;})});}_0x4a02f9=_['merge']({},_0x4a02f9,_0x3d46b9['options']);return db[_0x1edf('0x60')][_0x1edf('0x20')]({'where':_0x4a02f9[_0x1edf('0x3d')]})['then'](function(_0x1f1c0d){_0x38aa47['count']=_0x1f1c0d;if(_0x3d46b9['query']['includeAll']){_0x4a02f9[_0x1edf('0x43')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x4a02f9);})[_0x1edf('0x27')](function(_0x242e81){_0x38aa47[_0x1edf('0x45')]=_0x242e81;return _0x38aa47;});}})[_0x1edf('0x27')](respondWithFilteredResult(_0xfcf855,_0x4a02f9))[_0x1edf('0x46')](handleError(_0xfcf855,null));};exports[_0x1edf('0x62')]=function(_0x5a692a,_0x4ff030,_0x220e70){var _0x3a90be={'raw':!![],'where':{}};var _0x303153={};var _0x25eab7={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x5a692a[_0x1edf('0x48')]['id']}})[_0x1edf('0x27')](handleEntityNotFound(_0x4ff030,null))[_0x1edf('0x27')](function(_0x16e685){if(_0x16e685){_0x303153[_0x1edf('0x33')]=_['keys'](db[_0x1edf('0x63')]['rawAttributes']);_0x303153[_0x1edf('0x34')]=_[_0x1edf('0x35')](_0x5a692a[_0x1edf('0x34')]);_0x303153['filters']=_['intersection'](_0x303153[_0x1edf('0x33')],_0x303153[_0x1edf('0x34')]);_0x3a90be['attributes']=_[_0x1edf('0x36')](_0x303153[_0x1edf('0x33')],qs[_0x1edf('0x49')](_0x5a692a[_0x1edf('0x34')][_0x1edf('0x49')]));_0x3a90be[_0x1edf('0x37')]=_0x3a90be[_0x1edf('0x37')][_0x1edf('0x4a')]?_0x3a90be[_0x1edf('0x37')]:_0x303153[_0x1edf('0x33')];if(!_0x5a692a['query'][_0x1edf('0x38')](_0x1edf('0x39'))){_0x3a90be[_0x1edf('0x1f')]=qs[_0x1edf('0x1f')](_0x5a692a[_0x1edf('0x34')][_0x1edf('0x1f')]);_0x3a90be[_0x1edf('0x21')]=qs[_0x1edf('0x21')](_0x5a692a['query']['offset']);}_0x3a90be[_0x1edf('0x5d')]=qs['sort'](_0x5a692a[_0x1edf('0x34')][_0x1edf('0x3a')]);_0x3a90be[_0x1edf('0x3d')]=qs['filters'](_['pick'](_0x5a692a['query'],_0x303153['filters']));_0x3a90be[_0x1edf('0x3d')][_0x1edf('0x61')]=_0x16e685['id'];if(_0x5a692a[_0x1edf('0x34')][_0x1edf('0x40')]){_0x3a90be[_0x1edf('0x3d')]=_[_0x1edf('0x3e')](_0x3a90be[_0x1edf('0x3d')],{'$or':_[_0x1edf('0x2f')](_0x3a90be[_0x1edf('0x37')],function(_0x31de99){var _0x3dc040={};_0x3dc040[_0x31de99]={'$like':'%'+_0x5a692a[_0x1edf('0x34')][_0x1edf('0x40')]+'%'};return _0x3dc040;})});}_0x3a90be=_[_0x1edf('0x3e')]({},_0x3a90be,_0x5a692a[_0x1edf('0x41')]);return db[_0x1edf('0x63')]['count']({'where':_0x3a90be[_0x1edf('0x3d')]})[_0x1edf('0x27')](function(_0x20ccca){_0x25eab7[_0x1edf('0x20')]=_0x20ccca;if(_0x5a692a['query'][_0x1edf('0x42')]){_0x3a90be[_0x1edf('0x43')]=[{'all':!![]}];}return db[_0x1edf('0x63')]['findAll'](_0x3a90be);})['then'](function(_0x202d70){_0x25eab7[_0x1edf('0x45')]=_0x202d70;return _0x25eab7;});}})[_0x1edf('0x27')](respondWithFilteredResult(_0x4ff030,_0x3a90be))[_0x1edf('0x46')](handleError(_0x4ff030,null));};exports[_0x1edf('0x64')]=function(_0x412a0e,_0x1d385d,_0x4eb690){var _0x50273a={'raw':!![],'where':{}};var _0x39f81f={};var _0x195497={'count':0x0,'rows':[]};return db['Campaign'][_0x1edf('0x5c')]({'where':{'id':_0x412a0e[_0x1edf('0x48')]['id']}})['then'](handleEntityNotFound(_0x1d385d,null))['then'](function(_0x56e1d3){if(_0x56e1d3){_0x39f81f[_0x1edf('0x33')]=_['keys'](db[_0x1edf('0x65')][_0x1edf('0x31')]);_0x39f81f['query']=_['keys'](_0x412a0e[_0x1edf('0x34')]);_0x39f81f['filters']=_[_0x1edf('0x36')](_0x39f81f[_0x1edf('0x33')],_0x39f81f[_0x1edf('0x34')]);_0x50273a[_0x1edf('0x37')]=_[_0x1edf('0x36')](_0x39f81f[_0x1edf('0x33')],qs[_0x1edf('0x49')](_0x412a0e['query'][_0x1edf('0x49')]));_0x50273a['attributes']=_0x50273a[_0x1edf('0x37')][_0x1edf('0x4a')]?_0x50273a[_0x1edf('0x37')]:_0x39f81f['model'];if(!_0x412a0e[_0x1edf('0x34')][_0x1edf('0x38')](_0x1edf('0x39'))){_0x50273a[_0x1edf('0x1f')]=qs[_0x1edf('0x1f')](_0x412a0e[_0x1edf('0x34')][_0x1edf('0x1f')]);_0x50273a[_0x1edf('0x21')]=qs[_0x1edf('0x21')](_0x412a0e['query'][_0x1edf('0x21')]);}_0x50273a[_0x1edf('0x5d')]=qs[_0x1edf('0x3a')](_0x412a0e[_0x1edf('0x34')][_0x1edf('0x3a')]);_0x50273a['where']=qs[_0x1edf('0x3b')](_['pick'](_0x412a0e[_0x1edf('0x34')],_0x39f81f[_0x1edf('0x3b')]));_0x50273a['where'][_0x1edf('0x61')]=_0x56e1d3['id'];if(_0x412a0e[_0x1edf('0x34')][_0x1edf('0x40')]){_0x50273a[_0x1edf('0x3d')]=_[_0x1edf('0x3e')](_0x50273a[_0x1edf('0x3d')],{'$or':_[_0x1edf('0x2f')](_0x50273a[_0x1edf('0x37')],function(_0x36cd99){var _0x5bad39={};_0x5bad39[_0x36cd99]={'$like':'%'+_0x412a0e['query']['filter']+'%'};return _0x5bad39;})});}_0x50273a=_[_0x1edf('0x3e')]({},_0x50273a,_0x412a0e[_0x1edf('0x41')]);return db[_0x1edf('0x65')]['count']({'where':_0x50273a[_0x1edf('0x3d')]})['then'](function(_0x5376ef){_0x195497['count']=_0x5376ef;if(_0x412a0e['query']['includeAll']){_0x50273a[_0x1edf('0x43')]=[{'all':!![]}];}return db[_0x1edf('0x65')][_0x1edf('0x44')](_0x50273a);})[_0x1edf('0x27')](function(_0x54d156){_0x195497[_0x1edf('0x45')]=_0x54d156;return _0x195497;});}})['then'](respondWithFilteredResult(_0x1d385d,_0x50273a))[_0x1edf('0x46')](handleError(_0x1d385d,null));};exports[_0x1edf('0x66')]=function(_0xa90e04,_0x13d2a5,_0xc904af){var _0x14a427={};var _0x2cb705={};var _0xb2113a;var _0x1df7e3;return db[_0x1edf('0x30')][_0x1edf('0x5c')]({'where':{'id':_0xa90e04[_0x1edf('0x48')]['id']}})[_0x1edf('0x27')](handleEntityNotFound(_0x13d2a5,null))['then'](function(_0x12e06c){if(_0x12e06c){_0xb2113a=_0x12e06c;_0x2cb705[_0x1edf('0x33')]=_['keys'](db[_0x1edf('0x67')]['rawAttributes']);_0x2cb705[_0x1edf('0x34')]=_[_0x1edf('0x35')](_0xa90e04[_0x1edf('0x34')]);_0x2cb705[_0x1edf('0x3b')]=_[_0x1edf('0x36')](_0x2cb705[_0x1edf('0x33')],_0x2cb705[_0x1edf('0x34')]);_0x14a427[_0x1edf('0x37')]=_[_0x1edf('0x36')](_0x2cb705[_0x1edf('0x33')],qs[_0x1edf('0x49')](_0xa90e04[_0x1edf('0x34')]['fields']));_0x14a427['attributes']=_0x14a427[_0x1edf('0x37')][_0x1edf('0x4a')]?_0x14a427[_0x1edf('0x37')]:_0x2cb705[_0x1edf('0x33')];_0x14a427[_0x1edf('0x5d')]=qs[_0x1edf('0x3a')](_0xa90e04[_0x1edf('0x34')][_0x1edf('0x3a')]);_0x14a427['where']=qs[_0x1edf('0x3b')](_[_0x1edf('0x3c')](_0xa90e04['query'],_0x2cb705['filters']));if(_0xa90e04[_0x1edf('0x34')][_0x1edf('0x40')]){_0x14a427['where']=_[_0x1edf('0x3e')](_0x14a427['where'],{'$or':_[_0x1edf('0x2f')](_0x14a427[_0x1edf('0x37')],function(_0x94fe09){var _0x3c5689={};_0x3c5689[_0x94fe09]={'$like':'%'+_0xa90e04[_0x1edf('0x34')][_0x1edf('0x40')]+'%'};return _0x3c5689;})});}_0x14a427=_[_0x1edf('0x3e')]({},_0x14a427,_0xa90e04['options']);return _0xb2113a[_0x1edf('0x66')](_0x14a427);}})[_0x1edf('0x27')](function(_0x4d0133){if(_0x4d0133){_0x1df7e3=_0x4d0133['length'];if(!_0xa90e04[_0x1edf('0x34')]['hasOwnProperty'](_0x1edf('0x39'))){_0x14a427[_0x1edf('0x1f')]=qs[_0x1edf('0x1f')](_0xa90e04[_0x1edf('0x34')][_0x1edf('0x1f')]);_0x14a427[_0x1edf('0x21')]=qs[_0x1edf('0x21')](_0xa90e04['query'][_0x1edf('0x21')]);}return _0xb2113a[_0x1edf('0x66')](_0x14a427);}})['then'](function(_0x4405ff){if(_0x4405ff){return _0x4405ff?{'count':_0x1df7e3,'rows':_0x4405ff}:null;}})[_0x1edf('0x27')](respondWithResult(_0x13d2a5,null))[_0x1edf('0x46')](handleError(_0x13d2a5,null));};exports[_0x1edf('0x68')]=function(_0x8f8a5d,_0x32746d,_0x1cd881){var _0x3e5620,_0x3fc73d;return db[_0x1edf('0x30')][_0x1edf('0x4e')]({'where':{'id':_0x8f8a5d['params']['id']}})['then'](handleEntityNotFound(_0x32746d,null))['then'](function(_0xa059ab){if(_0xa059ab){_0x3fc73d=_0xa059ab;return _0xa059ab[_0x1edf('0x68')](_0x8f8a5d[_0x1edf('0x57')][_0x1edf('0x69')],_['omit'](_0x8f8a5d[_0x1edf('0x57')],[_0x1edf('0x69'),'id'])||{});}return null;})['spread'](function(_0x5402fd){var _0xafc874;_0x3e5620=_0x5402fd||[];var _0x3997fe=[];if(_0x5402fd){for(var _0x2f36ff=0x0;_0x2f36ff<_0x5402fd[_0x1edf('0x4a')];_0x2f36ff+=0x1){var _0x459192=_0x5402fd[_0x2f36ff][_0x1edf('0x29')]({'plain':!![]});_0x3fc73d[_0x1edf('0x6a')]=_0x8f8a5d[_0x1edf('0x57')]['dialCheckDuplicateType']?_0x8f8a5d['body'][_0x1edf('0x6a')]:_0x3fc73d[_0x1edf('0x6a')];switch(_0x3fc73d['dialCheckDuplicateType']){case _0x1edf('0x6b'):_0xafc874=squel['insert']()[_0x1edf('0x6c')](_0x1edf('0x6d'))['fromQuery']([_0x1edf('0x6e'),_0x1edf('0x6f'),_0x1edf('0x70'),'ListId',_0x1edf('0x61'),_0x1edf('0x55'),_0x1edf('0x56')],squel[_0x1edf('0x71')]()[_0x1edf('0x72')](_0x1edf('0x6e'),_0x1edf('0x6e'))[_0x1edf('0x72')](_0x1edf('0x73'),'scheduledAt')[_0x1edf('0x72')]('id','ContactId')[_0x1edf('0x72')](_0x459192['CmListId']['toString'](),_0x1edf('0x74'))[_0x1edf('0x72')](_0x8f8a5d[_0x1edf('0x48')]['id'][_0x1edf('0x75')](),'CampaignId')[_0x1edf('0x72')](_0x1edf('0x73'),_0x1edf('0x55'))[_0x1edf('0x72')]('NOW()',_0x1edf('0x56'))['from'](_0x1edf('0x76'))[_0x1edf('0x3d')](_0x1edf('0x77'))[_0x1edf('0x3d')](_0x1edf('0x78'),_0x459192['CmListId'][_0x1edf('0x75')]())[_0x1edf('0x3d')](_0x1edf('0x79'))[_0x1edf('0x3d')]('phone\x20NOT\x20IN\x20(?)',squel[_0x1edf('0x71')]()[_0x1edf('0x72')](_0x1edf('0x7a'))[_0x1edf('0x7b')](_0x1edf('0x7c'))[_0x1edf('0x3d')](_0x1edf('0x7d'),_0x8f8a5d[_0x1edf('0x48')]['id']['toString']()))[_0x1edf('0x3d')](_0x1edf('0x7e'),squel[_0x1edf('0x71')]()[_0x1edf('0x72')](_0x1edf('0x7f'))[_0x1edf('0x7b')](_0x1edf('0x6d'))[_0x1edf('0x3d')](_0x1edf('0x7d'),_0x8f8a5d[_0x1edf('0x48')]['id'][_0x1edf('0x75')]())))[_0x1edf('0x75')]();break;case _0x1edf('0x80'):_0xafc874=squel[_0x1edf('0x81')]()[_0x1edf('0x6c')]('cm_hopper')[_0x1edf('0x82')](['phone',_0x1edf('0x6f'),'ContactId',_0x1edf('0x74'),_0x1edf('0x61'),_0x1edf('0x55'),'updatedAt'],squel[_0x1edf('0x71')]()[_0x1edf('0x72')](_0x1edf('0x6e'),'phone')[_0x1edf('0x72')](_0x1edf('0x73'),_0x1edf('0x6f'))[_0x1edf('0x72')]('id','ContactId')[_0x1edf('0x72')](_0x459192['CmListId'][_0x1edf('0x75')](),_0x1edf('0x74'))[_0x1edf('0x72')](_0x8f8a5d[_0x1edf('0x48')]['id'][_0x1edf('0x75')](),_0x1edf('0x61'))[_0x1edf('0x72')]('NOW()',_0x1edf('0x55'))[_0x1edf('0x72')](_0x1edf('0x73'),'updatedAt')[_0x1edf('0x7b')](_0x1edf('0x76'))['where'](_0x1edf('0x77'))[_0x1edf('0x3d')]('ListId\x20=\x20?',_0x459192[_0x1edf('0x83')][_0x1edf('0x75')]())[_0x1edf('0x3d')](_0x1edf('0x79'))[_0x1edf('0x3d')](_0x1edf('0x7e'),squel[_0x1edf('0x71')]()['field'](_0x1edf('0x7f'))[_0x1edf('0x7b')](_0x1edf('0x6d'))[_0x1edf('0x3d')](_0x1edf('0x7d'),_0x8f8a5d[_0x1edf('0x48')]['id'][_0x1edf('0x75')]())))[_0x1edf('0x75')]();break;default:_0xafc874=squel[_0x1edf('0x81')]()[_0x1edf('0x6c')](_0x1edf('0x6d'))[_0x1edf('0x82')]([_0x1edf('0x6e'),'scheduledAt',_0x1edf('0x70'),_0x1edf('0x74'),'CampaignId','createdAt',_0x1edf('0x56')],squel['select']()[_0x1edf('0x72')](_0x1edf('0x6e'),'phone')[_0x1edf('0x72')](_0x1edf('0x73'),_0x1edf('0x6f'))[_0x1edf('0x72')]('id',_0x1edf('0x70'))[_0x1edf('0x72')](_0x459192[_0x1edf('0x83')]['toString'](),_0x1edf('0x74'))[_0x1edf('0x72')](_0x8f8a5d['params']['id'][_0x1edf('0x75')](),'CampaignId')['field']('NOW()',_0x1edf('0x55'))[_0x1edf('0x72')](_0x1edf('0x73'),_0x1edf('0x56'))['from']('cm_contacts')[_0x1edf('0x3d')](_0x1edf('0x77'))[_0x1edf('0x3d')]('ListId\x20=\x20?',_0x459192[_0x1edf('0x83')][_0x1edf('0x75')]())[_0x1edf('0x3d')](_0x1edf('0x79')))[_0x1edf('0x75')]();}_0x3997fe['push'](db[_0x1edf('0x84')]['query'](_0xafc874));}return BPromise['all'](_0x3997fe);}})['then'](function(){return _0x3e5620;})['then'](respondWithResult(_0x32746d,null))['catch'](handleError(_0x32746d,null));};exports[_0x1edf('0x85')]=function(_0x5131f3,_0x560fc8,_0x18e77c){return db['Campaign'][_0x1edf('0x4e')]({'where':{'id':_0x5131f3[_0x1edf('0x48')]['id']}})[_0x1edf('0x27')](handleEntityNotFound(_0x560fc8,null))['then'](function(_0x31af44){if(_0x31af44){return _0x31af44['removeLists'](_0x5131f3[_0x1edf('0x34')]['ids']);}})[_0x1edf('0x27')](function(_0x3a7322){if(_0x3a7322){return db[_0x1edf('0x5e')][_0x1edf('0x28')]({'where':{'ListId':_0x5131f3['query'][_0x1edf('0x69')],'CampaignId':_0x5131f3['params']['id']}})[_0x1edf('0x27')](function(){return _0x3a7322;});}})[_0x1edf('0x27')](respondWithStatusCode(_0x560fc8,null))[_0x1edf('0x46')](handleError(_0x560fc8,null));};exports['getBlackLists']=function(_0x31844e,_0x358dba,_0x329418){var _0x17af59={};var _0x3fb0f0={};var _0x1c02fd;var _0x425bf8;return db['Campaign'][_0x1edf('0x5c')]({'where':{'id':_0x31844e[_0x1edf('0x48')]['id']}})[_0x1edf('0x27')](handleEntityNotFound(_0x358dba,null))['then'](function(_0x59a8fd){if(_0x59a8fd){_0x1c02fd=_0x59a8fd;_0x3fb0f0[_0x1edf('0x33')]=_['keys'](db[_0x1edf('0x67')][_0x1edf('0x31')]);_0x3fb0f0[_0x1edf('0x34')]=_['keys'](_0x31844e[_0x1edf('0x34')]);_0x3fb0f0['filters']=_[_0x1edf('0x36')](_0x3fb0f0[_0x1edf('0x33')],_0x3fb0f0['query']);_0x17af59[_0x1edf('0x37')]=_[_0x1edf('0x36')](_0x3fb0f0[_0x1edf('0x33')],qs[_0x1edf('0x49')](_0x31844e[_0x1edf('0x34')]['fields']));_0x17af59['attributes']=_0x17af59[_0x1edf('0x37')][_0x1edf('0x4a')]?_0x17af59['attributes']:_0x3fb0f0['model'];_0x17af59[_0x1edf('0x5d')]=qs[_0x1edf('0x3a')](_0x31844e[_0x1edf('0x34')][_0x1edf('0x3a')]);_0x17af59[_0x1edf('0x3d')]=qs[_0x1edf('0x3b')](_[_0x1edf('0x3c')](_0x31844e[_0x1edf('0x34')],_0x3fb0f0[_0x1edf('0x3b')]));if(_0x31844e[_0x1edf('0x34')]['filter']){_0x17af59[_0x1edf('0x3d')]=_['merge'](_0x17af59[_0x1edf('0x3d')],{'$or':_[_0x1edf('0x2f')](_0x17af59['attributes'],function(_0x1a56ac){var _0x4a0059={};_0x4a0059[_0x1a56ac]={'$like':'%'+_0x31844e[_0x1edf('0x34')][_0x1edf('0x40')]+'%'};return _0x4a0059;})});}_0x17af59=_[_0x1edf('0x3e')]({},_0x17af59,_0x31844e[_0x1edf('0x41')]);return _0x1c02fd['getBlackLists'](_0x17af59);}})['then'](function(_0x5139cb){if(_0x5139cb){_0x425bf8=_0x5139cb[_0x1edf('0x4a')];if(!_0x31844e[_0x1edf('0x34')][_0x1edf('0x38')](_0x1edf('0x39'))){_0x17af59[_0x1edf('0x1f')]=qs[_0x1edf('0x1f')](_0x31844e[_0x1edf('0x34')][_0x1edf('0x1f')]);_0x17af59['offset']=qs[_0x1edf('0x21')](_0x31844e[_0x1edf('0x34')]['offset']);}return _0x1c02fd[_0x1edf('0x86')](_0x17af59);}})[_0x1edf('0x27')](function(_0xded008){if(_0xded008){return _0xded008?{'count':_0x425bf8,'rows':_0xded008}:null;}})[_0x1edf('0x27')](respondWithResult(_0x358dba,null))['catch'](handleError(_0x358dba,null));};exports['addBlackLists']=function(_0x580558,_0x131bcd,_0x4365c4){var _0x25b495,_0x5576be;return db[_0x1edf('0x30')]['find']({'where':{'id':_0x580558[_0x1edf('0x48')]['id']}})[_0x1edf('0x27')](handleEntityNotFound(_0x131bcd,null))[_0x1edf('0x27')](function(_0x1580c8){if(_0x1580c8){_0x5576be=_0x1580c8;return _0x1580c8[_0x1edf('0x87')](_0x580558[_0x1edf('0x57')][_0x1edf('0x69')],_['omit'](_0x580558[_0x1edf('0x57')],['ids','id'])||{});}return null;})['spread'](function(_0x11f560){var _0x2ae08f;_0x25b495=_0x11f560||[];var _0x35ef47=[];if(_0x11f560){for(var _0x2c872d=0x0;_0x2c872d<_0x11f560[_0x1edf('0x4a')];_0x2c872d+=0x1){var _0x3468c1=_0x11f560[_0x2c872d][_0x1edf('0x29')]({'plain':!![]});_0x2ae08f=squel[_0x1edf('0x81')]()[_0x1edf('0x6c')](_0x1edf('0x88'))[_0x1edf('0x82')]([_0x1edf('0x6e'),_0x1edf('0x70'),_0x1edf('0x74'),'CampaignId',_0x1edf('0x55'),'updatedAt'],squel[_0x1edf('0x71')]()['field']('phone',_0x1edf('0x6e'))['field']('id','ContactId')['field'](_0x3468c1[_0x1edf('0x83')][_0x1edf('0x75')](),_0x1edf('0x74'))[_0x1edf('0x72')](_0x580558[_0x1edf('0x48')]['id']['toString'](),_0x1edf('0x61'))[_0x1edf('0x72')](_0x1edf('0x73'),_0x1edf('0x55'))['field']('NOW()',_0x1edf('0x56'))[_0x1edf('0x7b')](_0x1edf('0x76'))[_0x1edf('0x3d')](_0x1edf('0x77'))[_0x1edf('0x3d')]('ListId\x20=\x20?',_0x3468c1[_0x1edf('0x83')][_0x1edf('0x75')]())[_0x1edf('0x3d')]('phone\x20IS\x20NOT\x20NULL'))[_0x1edf('0x75')]();_0x35ef47[_0x1edf('0x89')](db[_0x1edf('0x84')][_0x1edf('0x34')](_0x2ae08f));}return BPromise[_0x1edf('0x8a')](_0x35ef47);}})[_0x1edf('0x27')](function(){return _0x25b495;})['then'](respondWithResult(_0x131bcd,null))[_0x1edf('0x46')](handleError(_0x131bcd,null));};exports[_0x1edf('0x8b')]=function(_0x2f0028,_0xc33859,_0x34a165){return db[_0x1edf('0x30')][_0x1edf('0x4e')]({'where':{'id':_0x2f0028['params']['id']}})['then'](handleEntityNotFound(_0xc33859,null))['then'](function(_0x26d029){if(_0x26d029){return _0x26d029[_0x1edf('0x8b')](_0x2f0028['query'][_0x1edf('0x69')]);}})[_0x1edf('0x27')](function(_0x15f67b){if(_0x15f67b){return db['CmHopperBlack'][_0x1edf('0x28')]({'where':{'ListId':_0x2f0028[_0x1edf('0x34')][_0x1edf('0x69')],'CampaignId':_0x2f0028['params']['id']}})['then'](function(){return _0x15f67b;});}})[_0x1edf('0x27')](respondWithStatusCode(_0xc33859,null))['catch'](handleError(_0xc33859,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 61727ab..d5e3f38 100644 --- a/server/api/campaign/campaign.model.js +++ b/server/api/campaign/campaign.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x5627e1,_0x1b2dbf){var _0x2f013f=function(_0x142015){while(--_0x142015){_0x5627e1['push'](_0x5627e1['shift']());}};_0x2f013f(++_0x1b2dbf);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x4ea972,_0xde1d16){var _0x34db41=function(_0x3487ef){while(--_0x3487ef){_0x4ea972['push'](_0x4ea972['shift']());}};_0x34db41(++_0xde1d16);}(_0x7a54,0x106));var _0x47a5=function(_0x937c76,_0x5a1f2d){_0x937c76=_0x937c76-0x0;var _0x1c408f=_0x7a54[_0x937c76];return _0x1c408f;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index abafa7e..b50d5eb 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 _0x21a3=['include','model','GetCampaign','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','message','result','Campaign','findAll','options','raw','where','attributes','limit','map'];(function(_0x38d7f9,_0x4562bb){var _0x38d3f2=function(_0x53a0a5){while(--_0x53a0a5){_0x38d7f9['push'](_0x38d7f9['shift']());}};_0x38d3f2(++_0x4562bb);}(_0x21a3,0x66));var _0x321a=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x21a3[_0x1928c9];return _0x51b5fb;};'use strict';var _=require(_0x321a('0x0'));var util=require('util');var moment=require(_0x321a('0x1'));var BPromise=require(_0x321a('0x2'));var rs=require(_0x321a('0x3'));var fs=require('fs');var Redis=require(_0x321a('0x4'));var db=require(_0x321a('0x5'))['db'];var utils=require(_0x321a('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x321a('0x7'));var jayson=require(_0x321a('0x8'));var client=jayson[_0x321a('0x9')][_0x321a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5f3b81,_0x388901,_0x24a04c){return new BPromise(function(_0x10c1d3,_0xdfd6b8){return client[_0x321a('0xb')](_0x5f3b81,_0x24a04c)[_0x321a('0xc')](function(_0x2c52dc){logger[_0x321a('0xd')](_0x321a('0xe'),_0x388901,_0x321a('0xf'));logger[_0x321a('0x10')](_0x321a('0x11'),_0x388901,'request\x20sent',JSON[_0x321a('0x12')](_0x2c52dc));if(_0x2c52dc[_0x321a('0x13')]){if(_0x2c52dc['error']['code']===0x1f4){logger[_0x321a('0x13')]('Campaign,\x20%s,\x20%s',_0x388901,_0x2c52dc[_0x321a('0x13')][_0x321a('0x14')]);return _0xdfd6b8(_0x2c52dc['error']['message']);}logger[_0x321a('0x13')](_0x321a('0xe'),_0x388901,_0x2c52dc[_0x321a('0x13')][_0x321a('0x14')]);return _0x10c1d3(_0x2c52dc[_0x321a('0x13')][_0x321a('0x14')]);}else{logger[_0x321a('0xd')](_0x321a('0xe'),_0x388901,'request\x20sent');_0x10c1d3(_0x2c52dc[_0x321a('0x15')][_0x321a('0x14')]);}})['catch'](function(_0x45ceb2){logger[_0x321a('0x13')](_0x321a('0xe'),_0x388901,_0x45ceb2);_0xdfd6b8(_0x45ceb2);});});}exports['GetCampaign']=function(_0x5b1810){var _0x464bd7=this;return new Promise(function(_0x35fd6f,_0x58595b){return db[_0x321a('0x16')][_0x321a('0x17')]({'raw':_0x5b1810[_0x321a('0x18')]?_0x5b1810['options'][_0x321a('0x19')]===undefined?!![]:![]:!![],'where':_0x5b1810[_0x321a('0x18')]?_0x5b1810[_0x321a('0x18')][_0x321a('0x1a')]||null:null,'attributes':_0x5b1810[_0x321a('0x18')]?_0x5b1810[_0x321a('0x18')][_0x321a('0x1b')]||null:null,'limit':_0x5b1810[_0x321a('0x18')]?_0x5b1810[_0x321a('0x18')][_0x321a('0x1c')]||null:null,'include':_0x5b1810[_0x321a('0x18')]?_0x5b1810[_0x321a('0x18')]['include']?_[_0x321a('0x1d')](_0x5b1810[_0x321a('0x18')][_0x321a('0x1e')],function(_0x5ae154){return{'model':db[_0x5ae154[_0x321a('0x1f')]],'as':_0x5ae154['as'],'attributes':_0x5ae154[_0x321a('0x1b')],'include':_0x5ae154['include']?_['map'](_0x5ae154[_0x321a('0x1e')],function(_0x5a66c2){return{'model':db[_0x5a66c2[_0x321a('0x1f')]],'as':_0x5a66c2['as'],'attributes':_0x5a66c2[_0x321a('0x1b')],'include':_0x5a66c2[_0x321a('0x1e')]?_[_0x321a('0x1d')](_0x5a66c2[_0x321a('0x1e')],function(_0xdce138){return{'model':db[_0xdce138['model']],'as':_0xdce138['as'],'attributes':_0xdce138['attributes']};}):[]};}):[]};}):[]:[]})[_0x321a('0xc')](function(_0x105216){logger[_0x321a('0xd')]('GetCampaign',_0x5b1810);logger[_0x321a('0x10')](_0x321a('0x20'),_0x5b1810,JSON[_0x321a('0x12')](_0x105216));_0x35fd6f(_0x105216);})['catch'](function(_0x8a09bb){logger[_0x321a('0x13')](_0x321a('0x20'),_0x8a09bb[_0x321a('0x14')],_0x5b1810);_0x58595b(_0x464bd7[_0x321a('0x13')](0x1f4,_0x8a09bb[_0x321a('0x14')]));});});}; \ No newline at end of file +var _0x8c99=['limit','include','model','map','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCampaign','findAll','options','raw','attributes'];(function(_0x356cd9,_0x425e8a){var _0x4c081d=function(_0x2f3f98){while(--_0x2f3f98){_0x356cd9['push'](_0x356cd9['shift']());}};_0x4c081d(++_0x425e8a);}(_0x8c99,0x1a8));var _0x98c9=function(_0x4ed1d4,_0x512d9a){_0x4ed1d4=_0x4ed1d4-0x0;var _0x28e363=_0x8c99[_0x4ed1d4];return _0x28e363;};'use strict';var _=require(_0x98c9('0x0'));var util=require(_0x98c9('0x1'));var moment=require(_0x98c9('0x2'));var BPromise=require(_0x98c9('0x3'));var rs=require(_0x98c9('0x4'));var fs=require('fs');var Redis=require(_0x98c9('0x5'));var db=require(_0x98c9('0x6'))['db'];var utils=require(_0x98c9('0x7'));var logger=require(_0x98c9('0x8'))(_0x98c9('0x9'));var config=require(_0x98c9('0xa'));var jayson=require(_0x98c9('0xb'));var client=jayson['client'][_0x98c9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2ed2b6,_0x538465,_0x4af8a6){return new BPromise(function(_0x5b983e,_0xc789b1){return client[_0x98c9('0xd')](_0x2ed2b6,_0x4af8a6)[_0x98c9('0xe')](function(_0x4052cf){logger[_0x98c9('0xf')](_0x98c9('0x10'),_0x538465,_0x98c9('0x11'));logger[_0x98c9('0x12')](_0x98c9('0x13'),_0x538465,_0x98c9('0x11'),JSON[_0x98c9('0x14')](_0x4052cf));if(_0x4052cf['error']){if(_0x4052cf[_0x98c9('0x15')][_0x98c9('0x16')]===0x1f4){logger[_0x98c9('0x15')](_0x98c9('0x10'),_0x538465,_0x4052cf['error'][_0x98c9('0x17')]);return _0xc789b1(_0x4052cf[_0x98c9('0x15')][_0x98c9('0x17')]);}logger[_0x98c9('0x15')](_0x98c9('0x10'),_0x538465,_0x4052cf['error'][_0x98c9('0x17')]);return _0x5b983e(_0x4052cf[_0x98c9('0x15')][_0x98c9('0x17')]);}else{logger[_0x98c9('0xf')](_0x98c9('0x10'),_0x538465,_0x98c9('0x11'));_0x5b983e(_0x4052cf[_0x98c9('0x18')][_0x98c9('0x17')]);}})[_0x98c9('0x19')](function(_0x2bb8b6){logger[_0x98c9('0x15')](_0x98c9('0x10'),_0x538465,_0x2bb8b6);_0xc789b1(_0x2bb8b6);});});}exports[_0x98c9('0x1a')]=function(_0x39ed74){var _0x534903=this;return new Promise(function(_0x351254,_0x22fe71){return db['Campaign'][_0x98c9('0x1b')]({'raw':_0x39ed74['options']?_0x39ed74[_0x98c9('0x1c')][_0x98c9('0x1d')]===undefined?!![]:![]:!![],'where':_0x39ed74[_0x98c9('0x1c')]?_0x39ed74[_0x98c9('0x1c')]['where']||null:null,'attributes':_0x39ed74[_0x98c9('0x1c')]?_0x39ed74[_0x98c9('0x1c')][_0x98c9('0x1e')]||null:null,'limit':_0x39ed74[_0x98c9('0x1c')]?_0x39ed74['options'][_0x98c9('0x1f')]||null:null,'include':_0x39ed74[_0x98c9('0x1c')]?_0x39ed74[_0x98c9('0x1c')][_0x98c9('0x20')]?_['map'](_0x39ed74['options'][_0x98c9('0x20')],function(_0x4373cc){return{'model':db[_0x4373cc[_0x98c9('0x21')]],'as':_0x4373cc['as'],'attributes':_0x4373cc['attributes'],'include':_0x4373cc['include']?_['map'](_0x4373cc[_0x98c9('0x20')],function(_0x1653e0){return{'model':db[_0x1653e0['model']],'as':_0x1653e0['as'],'attributes':_0x1653e0[_0x98c9('0x1e')],'include':_0x1653e0[_0x98c9('0x20')]?_[_0x98c9('0x22')](_0x1653e0[_0x98c9('0x20')],function(_0x3f503a){return{'model':db[_0x3f503a[_0x98c9('0x21')]],'as':_0x3f503a['as'],'attributes':_0x3f503a['attributes']};}):[]};}):[]};}):[]:[]})[_0x98c9('0xe')](function(_0x361305){logger[_0x98c9('0xf')](_0x98c9('0x1a'),_0x39ed74);logger[_0x98c9('0x12')]('GetCampaign',_0x39ed74,JSON[_0x98c9('0x14')](_0x361305));_0x351254(_0x361305);})[_0x98c9('0x19')](function(_0x58c6e3){logger[_0x98c9('0x15')]('GetCampaign',_0x58c6e3['message'],_0x39ed74);_0x22fe71(_0x534903[_0x98c9('0x15')](0x1f4,_0x58c6e3['message']));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 3f0fb35..ab4de60 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 _0x94cc=['getHopperHistories','/:id/hopper_finals','getHopperFinals','getHopperBlacks','/:id/lists','/:id/blacklists','getBlackLists','create','post','clone','addLists','addBlackLists','put','/:id','update','delete','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','show','/:id/hoppers','getHoppers'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x94cc,0x133));var _0xc94c=function(_0x54d5db,_0x49c239){_0x54d5db=_0x54d5db-0x0;var _0x38956f=_0x94cc[_0x54d5db];return _0x38956f;};'use strict';var multer=require(_0xc94c('0x0'));var util=require(_0xc94c('0x1'));var path=require(_0xc94c('0x2'));var timeout=require(_0xc94c('0x3'));var express=require('express');var router=express[_0xc94c('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc94c('0x5'));var config=require(_0xc94c('0x6'));var controller=require(_0xc94c('0x7'));router[_0xc94c('0x8')]('/',auth[_0xc94c('0x9')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller[_0xc94c('0xa')]);router[_0xc94c('0x8')](_0xc94c('0xb'),auth[_0xc94c('0x9')](),controller[_0xc94c('0xc')]);router[_0xc94c('0x8')]('/:id/hopper_histories',auth[_0xc94c('0x9')](),controller[_0xc94c('0xd')]);router[_0xc94c('0x8')](_0xc94c('0xe'),auth[_0xc94c('0x9')](),controller[_0xc94c('0xf')]);router['get']('/:id/hopper_black',auth[_0xc94c('0x9')](),controller[_0xc94c('0x10')]);router[_0xc94c('0x8')](_0xc94c('0x11'),auth[_0xc94c('0x9')](),controller['getLists']);router['get'](_0xc94c('0x12'),auth['isAuthenticated'](),controller[_0xc94c('0x13')]);router['post']('/',auth['isAuthenticated'](),controller[_0xc94c('0x14')]);router[_0xc94c('0x15')]('/:id/clone',auth[_0xc94c('0x9')](),controller[_0xc94c('0x16')]);router[_0xc94c('0x15')](_0xc94c('0x11'),auth[_0xc94c('0x9')](),controller[_0xc94c('0x17')]);router[_0xc94c('0x15')](_0xc94c('0x12'),auth[_0xc94c('0x9')](),controller[_0xc94c('0x18')]);router[_0xc94c('0x19')](_0xc94c('0x1a'),auth[_0xc94c('0x9')](),controller[_0xc94c('0x1b')]);router['delete'](_0xc94c('0x1a'),auth[_0xc94c('0x9')](),controller['destroy']);router[_0xc94c('0x1c')]('/:id/lists',auth['isAuthenticated'](),controller[_0xc94c('0x1d')]);router['delete'](_0xc94c('0x12'),auth[_0xc94c('0x9')](),controller[_0xc94c('0x1e')]);module[_0xc94c('0x1f')]=router; \ No newline at end of file +var _0x5a38=['get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists','put','delete','destroy','removeLists','removeBlackLists','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./campaign.controller'];(function(_0x5a08dd,_0x244946){var _0x28f5cf=function(_0x53670c){while(--_0x53670c){_0x5a08dd['push'](_0x5a08dd['shift']());}};_0x28f5cf(++_0x244946);}(_0x5a38,0xaf));var _0x85a3=function(_0x19258b,_0x22e850){_0x19258b=_0x19258b-0x0;var _0x5be66a=_0x5a38[_0x19258b];return _0x5be66a;};'use strict';var multer=require(_0x85a3('0x0'));var util=require(_0x85a3('0x1'));var path=require(_0x85a3('0x2'));var timeout=require(_0x85a3('0x3'));var express=require(_0x85a3('0x4'));var router=express[_0x85a3('0x5')]();var fs_extra=require(_0x85a3('0x6'));var auth=require(_0x85a3('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x85a3('0x8'));var controller=require(_0x85a3('0x9'));router[_0x85a3('0xa')]('/',auth[_0x85a3('0xb')](),controller[_0x85a3('0xc')]);router[_0x85a3('0xa')](_0x85a3('0xd'),auth[_0x85a3('0xb')](),controller[_0x85a3('0xe')]);router[_0x85a3('0xa')](_0x85a3('0xf'),auth[_0x85a3('0xb')](),controller[_0x85a3('0x10')]);router[_0x85a3('0xa')](_0x85a3('0x11'),auth[_0x85a3('0xb')](),controller[_0x85a3('0x12')]);router[_0x85a3('0xa')](_0x85a3('0x13'),auth[_0x85a3('0xb')](),controller[_0x85a3('0x14')]);router['get'](_0x85a3('0x15'),auth[_0x85a3('0xb')](),controller[_0x85a3('0x16')]);router['get'](_0x85a3('0x17'),auth[_0x85a3('0xb')](),controller[_0x85a3('0x18')]);router[_0x85a3('0xa')](_0x85a3('0x19'),auth[_0x85a3('0xb')](),controller[_0x85a3('0x1a')]);router[_0x85a3('0x1b')]('/',auth[_0x85a3('0xb')](),controller[_0x85a3('0x1c')]);router[_0x85a3('0x1b')](_0x85a3('0x1d'),auth[_0x85a3('0xb')](),controller[_0x85a3('0x1e')]);router[_0x85a3('0x1b')](_0x85a3('0x17'),auth[_0x85a3('0xb')](),controller[_0x85a3('0x1f')]);router[_0x85a3('0x1b')](_0x85a3('0x19'),auth[_0x85a3('0xb')](),controller['addBlackLists']);router[_0x85a3('0x20')](_0x85a3('0xd'),auth[_0x85a3('0xb')](),controller['update']);router[_0x85a3('0x21')](_0x85a3('0xd'),auth[_0x85a3('0xb')](),controller[_0x85a3('0x22')]);router[_0x85a3('0x21')](_0x85a3('0x17'),auth[_0x85a3('0xb')](),controller[_0x85a3('0x23')]);router[_0x85a3('0x21')](_0x85a3('0x19'),auth[_0x85a3('0xb')](),controller[_0x85a3('0x24')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index a27e5f8..aaebbfe 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 _0xdf9a=['getDataValue','sequelize','STRING','TEXT','VIRTUAL'];(function(_0x5a3cf0,_0x160a68){var _0x5a64ee=function(_0x34cd1d){while(--_0x34cd1d){_0x5a3cf0['push'](_0x5a3cf0['shift']());}};_0x5a64ee(++_0x160a68);}(_0xdf9a,0xce));var _0xadf9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdf9a[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xadf9('0x0'));module['exports']={'key':{'type':Sequelize[_0xadf9('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0xadf9('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xadf9('0x3')],'get':function(){return this[_0xadf9('0x4')]('key');}}}; \ No newline at end of file +var _0x4de7=['sequelize','exports','STRING','VIRTUAL','getDataValue','key'];(function(_0xe1f268,_0x2150ab){var _0x572864=function(_0x4727b0){while(--_0x4727b0){_0xe1f268['push'](_0xe1f268['shift']());}};_0x572864(++_0x2150ab);}(_0x4de7,0x1ce));var _0x74de=function(_0x130f7b,_0x495691){_0x130f7b=_0x130f7b-0x0;var _0x1f2239=_0x4de7[_0x130f7b];return _0x1f2239;};'use strict';var Sequelize=require(_0x74de('0x0'));module[_0x74de('0x1')]={'key':{'type':Sequelize[_0x74de('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x74de('0x3')],'get':function(){return this[_0x74de('0x4')](_0x74de('0x5'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 152fd7e..d4ee582 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 _0x3e8e=['../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','save','update','then','get','CannedAnswers','UserProfileResource','stack','name','send','index','map','CannedAnswer','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','filters','filter','where','merge','includeAll','findAll','rows','catch','show','params','length','include','options','find','body','destroy','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x3149c6,_0x54f974){var _0x4f4dc9=function(_0x17a268){while(--_0x17a268){_0x3149c6['push'](_0x3149c6['shift']());}};_0x4f4dc9(++_0x54f974);}(_0x3e8e,0x152));var _0xe3e8=function(_0x54ca2c,_0xcae620){_0x54ca2c=_0x54ca2c-0x0;var _0x60ef93=_0x3e8e[_0x54ca2c];return _0x60ef93;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe3e8('0x0'));var zipdir=require(_0xe3e8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe3e8('0x2'));var moment=require(_0xe3e8('0x3'));var BPromise=require(_0xe3e8('0x4'));var Mustache=require(_0xe3e8('0x5'));var util=require(_0xe3e8('0x6'));var path=require(_0xe3e8('0x7'));var sox=require(_0xe3e8('0x8'));var csv=require('to-csv');var ejs=require(_0xe3e8('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xe3e8('0xa'));var crypto=require(_0xe3e8('0xb'));var jsforce=require(_0xe3e8('0xc'));var deskjs=require(_0xe3e8('0xd'));var toCsv=require(_0xe3e8('0xe'));var querystring=require(_0xe3e8('0xf'));var Papa=require('papaparse');var Redis=require(_0xe3e8('0x10'));var authService=require(_0xe3e8('0x11'));var qs=require(_0xe3e8('0x12'));var as=require(_0xe3e8('0x13'));var hardwareService=require(_0xe3e8('0x14'));var logger=require(_0xe3e8('0x15'))('api');var utils=require(_0xe3e8('0x16'));var config=require(_0xe3e8('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xe3e8('0x18'))['db'];function respondWithStatusCode(_0x161edd,_0x4ac162){_0x4ac162=_0x4ac162||0xcc;return function(_0xc07280){if(_0xc07280){return _0x161edd[_0xe3e8('0x19')](_0x4ac162);}return _0x161edd[_0xe3e8('0x1a')](_0x4ac162)[_0xe3e8('0x1b')]();};}function respondWithResult(_0x3253d7,_0xa73cd5){_0xa73cd5=_0xa73cd5||0xc8;return function(_0x26aa3f){if(_0x26aa3f){return _0x3253d7[_0xe3e8('0x1a')](_0xa73cd5)[_0xe3e8('0x1c')](_0x26aa3f);}};}function respondWithFilteredResult(_0x10edb6,_0x2b75f8){return function(_0x446d63){if(_0x446d63){var _0x1aaefd=typeof _0x2b75f8[_0xe3e8('0x1d')]===_0xe3e8('0x1e')&&typeof _0x2b75f8['limit']==='undefined';var _0xb153c3=_0x446d63[_0xe3e8('0x1f')];var _0x514dca=_0x1aaefd?0x0:_0x2b75f8['offset'];var _0x3ed325=_0x1aaefd?_0x446d63[_0xe3e8('0x1f')]:_0x2b75f8[_0xe3e8('0x1d')]+_0x2b75f8[_0xe3e8('0x20')];var _0x52ee86;if(_0x3ed325>=_0xb153c3){_0x3ed325=_0xb153c3;_0x52ee86=0xc8;}else{_0x52ee86=0xce;}_0x10edb6[_0xe3e8('0x1a')](_0x52ee86);return _0x10edb6[_0xe3e8('0x21')](_0xe3e8('0x22'),_0x514dca+'-'+_0x3ed325+'/'+_0xb153c3)[_0xe3e8('0x1c')](_0x446d63);}return null;};}function patchUpdates(_0x1f10e2){return function(_0x11a552){try{jsonpatch['apply'](_0x11a552,_0x1f10e2,!![]);}catch(_0x399da7){return BPromise['reject'](_0x399da7);}return _0x11a552[_0xe3e8('0x23')]();};}function saveUpdates(_0x2c3f2b,_0x3677bf){return function(_0x48d1d1){if(_0x48d1d1){return _0x48d1d1[_0xe3e8('0x24')](_0x2c3f2b)[_0xe3e8('0x25')](function(_0x635db6){return _0x635db6;});}return null;};}function removeEntity(_0x3c318a,_0x4fdedf){return function(_0x550b4b){if(_0x550b4b){return _0x550b4b['destroy']()[_0xe3e8('0x25')](function(){var _0x56372a=_0x550b4b[_0xe3e8('0x26')]({'plain':!![]});var _0xbf8836=_0xe3e8('0x27');return db[_0xe3e8('0x28')]['destroy']({'where':{'type':_0xbf8836,'resourceId':_0x56372a['id']}})[_0xe3e8('0x25')](function(){return _0x550b4b;});})[_0xe3e8('0x25')](function(){_0x3c318a[_0xe3e8('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f1e93,_0x263b9e){return function(_0x4fcfd0){if(!_0x4fcfd0){_0x1f1e93[_0xe3e8('0x19')](0x194);}return _0x4fcfd0;};}function handleError(_0x16b341,_0x2abfb4){_0x2abfb4=_0x2abfb4||0x1f4;return function(_0x1cd936){logger['error'](_0x1cd936[_0xe3e8('0x29')]);if(_0x1cd936['name']){delete _0x1cd936[_0xe3e8('0x2a')];}_0x16b341[_0xe3e8('0x1a')](_0x2abfb4)[_0xe3e8('0x2b')](_0x1cd936);};}exports[_0xe3e8('0x2c')]=function(_0x3a53fc,_0x3ec98){var _0x10c092={},_0x2faa05={},_0x1bd98f={'count':0x0,'rows':[]};var _0x1a7966=_[_0xe3e8('0x2d')](db[_0xe3e8('0x2e')][_0xe3e8('0x2f')],function(_0x396179){return{'name':_0x396179[_0xe3e8('0x30')],'type':_0x396179[_0xe3e8('0x31')][_0xe3e8('0x32')]};});_0x2faa05[_0xe3e8('0x33')]=_[_0xe3e8('0x2d')](_0x1a7966,'name');_0x2faa05[_0xe3e8('0x34')]=_[_0xe3e8('0x35')](_0x3a53fc['query']);_0x2faa05['filters']=_[_0xe3e8('0x36')](_0x2faa05[_0xe3e8('0x33')],_0x2faa05[_0xe3e8('0x34')]);_0x10c092[_0xe3e8('0x37')]=_[_0xe3e8('0x36')](_0x2faa05[_0xe3e8('0x33')],qs['fields'](_0x3a53fc['query'][_0xe3e8('0x38')]));_0x10c092[_0xe3e8('0x37')]=_0x10c092[_0xe3e8('0x37')]['length']?_0x10c092['attributes']:_0x2faa05[_0xe3e8('0x33')];if(!_0x3a53fc[_0xe3e8('0x34')][_0xe3e8('0x39')]('nolimit')){_0x10c092[_0xe3e8('0x20')]=qs['limit'](_0x3a53fc[_0xe3e8('0x34')][_0xe3e8('0x20')]);_0x10c092['offset']=qs[_0xe3e8('0x1d')](_0x3a53fc[_0xe3e8('0x34')][_0xe3e8('0x1d')]);}_0x10c092[_0xe3e8('0x3a')]=qs[_0xe3e8('0x3b')](_0x3a53fc['query'][_0xe3e8('0x3b')]);_0x10c092['where']=qs[_0xe3e8('0x3c')](_['pick'](_0x3a53fc['query'],_0x2faa05['filters']),_0x1a7966);if(_0x3a53fc['query'][_0xe3e8('0x3d')]){_0x10c092[_0xe3e8('0x3e')]=_['merge'](_0x10c092[_0xe3e8('0x3e')],{'$or':[{'key':{'$like':'%'+_0x3a53fc[_0xe3e8('0x34')][_0xe3e8('0x3d')]+'%'}},{'value':{'$like':'%'+_0x3a53fc[_0xe3e8('0x34')][_0xe3e8('0x3d')]+'%'}}]});}_0x10c092=_[_0xe3e8('0x3f')]({},_0x10c092,_0x3a53fc['options']);var _0x33ade0={'where':_0x10c092[_0xe3e8('0x3e')]};return db['CannedAnswer'][_0xe3e8('0x1f')](_0x33ade0)[_0xe3e8('0x25')](function(_0xcaabd4){_0x1bd98f[_0xe3e8('0x1f')]=_0xcaabd4;if(_0x3a53fc[_0xe3e8('0x34')][_0xe3e8('0x40')]){_0x10c092['include']=[{'all':!![]}];}return db['CannedAnswer'][_0xe3e8('0x41')](_0x10c092);})[_0xe3e8('0x25')](function(_0x640a31){_0x1bd98f[_0xe3e8('0x42')]=_0x640a31;return _0x1bd98f;})[_0xe3e8('0x25')](respondWithFilteredResult(_0x3ec98,_0x10c092))[_0xe3e8('0x43')](handleError(_0x3ec98,null));};exports[_0xe3e8('0x44')]=function(_0x458ed5,_0x7d2b24){var _0x3d2565={'raw':!![],'where':{'id':_0x458ed5[_0xe3e8('0x45')]['id']}},_0x56e101={};_0x56e101['model']=_[_0xe3e8('0x35')](db[_0xe3e8('0x2e')]['rawAttributes']);_0x56e101['query']=_[_0xe3e8('0x35')](_0x458ed5['query']);_0x56e101[_0xe3e8('0x3c')]=_[_0xe3e8('0x36')](_0x56e101['model'],_0x56e101[_0xe3e8('0x34')]);_0x3d2565[_0xe3e8('0x37')]=_['intersection'](_0x56e101[_0xe3e8('0x33')],qs[_0xe3e8('0x38')](_0x458ed5[_0xe3e8('0x34')][_0xe3e8('0x38')]));_0x3d2565[_0xe3e8('0x37')]=_0x3d2565[_0xe3e8('0x37')][_0xe3e8('0x46')]?_0x3d2565['attributes']:_0x56e101['model'];if(_0x458ed5['query'][_0xe3e8('0x40')]){_0x3d2565[_0xe3e8('0x47')]=[{'all':!![]}];}_0x3d2565=_[_0xe3e8('0x3f')]({},_0x3d2565,_0x458ed5[_0xe3e8('0x48')]);return db[_0xe3e8('0x2e')][_0xe3e8('0x49')](_0x3d2565)[_0xe3e8('0x25')](handleEntityNotFound(_0x7d2b24,null))[_0xe3e8('0x25')](respondWithResult(_0x7d2b24,null))[_0xe3e8('0x43')](handleError(_0x7d2b24,null));};exports[_0xe3e8('0x24')]=function(_0x1a41ca,_0x4de655){if(_0x1a41ca['body']['id']){delete _0x1a41ca[_0xe3e8('0x4a')]['id'];}return db[_0xe3e8('0x2e')][_0xe3e8('0x49')]({'where':{'id':_0x1a41ca[_0xe3e8('0x45')]['id']}})[_0xe3e8('0x25')](handleEntityNotFound(_0x4de655,null))[_0xe3e8('0x25')](saveUpdates(_0x1a41ca[_0xe3e8('0x4a')],null))[_0xe3e8('0x25')](respondWithResult(_0x4de655,null))[_0xe3e8('0x43')](handleError(_0x4de655,null));};exports[_0xe3e8('0x4b')]=function(_0x2c0d1a,_0xfafff){return db[_0xe3e8('0x2e')][_0xe3e8('0x49')]({'where':{'id':_0x2c0d1a[_0xe3e8('0x45')]['id']}})[_0xe3e8('0x25')](handleEntityNotFound(_0xfafff,null))[_0xe3e8('0x25')](removeEntity(_0xfafff,null))[_0xe3e8('0x43')](handleError(_0xfafff,null));};exports[_0xe3e8('0x4c')]=function(_0x6c0339,_0x3d95a3){var _0x1af860={'key':_0x6c0339[_0xe3e8('0x4a')]['key']};if(_0x6c0339[_0xe3e8('0x4a')][_0xe3e8('0x4d')]){_0x1af860[_0xe3e8('0x4d')]=_0x6c0339[_0xe3e8('0x4a')][_0xe3e8('0x4d')];}else if(_0x6c0339[_0xe3e8('0x4a')][_0xe3e8('0x4e')]){_0x1af860['SmsAccountId']=_0x6c0339['body'][_0xe3e8('0x4e')];}else if(_0x6c0339['body'][_0xe3e8('0x4f')]){_0x1af860[_0xe3e8('0x4f')]=_0x6c0339['body'][_0xe3e8('0x4f')];}else if(_0x6c0339[_0xe3e8('0x4a')][_0xe3e8('0x50')]){_0x1af860['ChatWebsiteId']=_0x6c0339[_0xe3e8('0x4a')][_0xe3e8('0x50')];}return db['CannedAnswer'][_0xe3e8('0x49')]({'where':_0x1af860})[_0xe3e8('0x25')](function(_0x3310b5){if(_0x3310b5){throw new db[(_0xe3e8('0x51'))][(_0xe3e8('0x52'))](_0xe3e8('0x53'));}return db[_0xe3e8('0x2e')]['create'](_0x6c0339[_0xe3e8('0x4a')]);})[_0xe3e8('0x25')](function(_0x5dd140){var _0x40b1de=_0x6c0339[_0xe3e8('0x54')][_0xe3e8('0x26')]({'plain':!![]});if(!_0x40b1de)throw new Error(_0xe3e8('0x55'));if(_0x40b1de[_0xe3e8('0x56')]==='user'){var _0x440371=_0x5dd140[_0xe3e8('0x26')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0xe3e8('0x27'),'userProfileId':_0x40b1de[_0xe3e8('0x57')]},'raw':!![]})[_0xe3e8('0x25')](function(_0x2e8f30){if(_0x2e8f30&&_0x2e8f30['autoAssociation']===0x0){return db[_0xe3e8('0x28')][_0xe3e8('0x4c')]({'name':_0x440371['name'],'resourceId':_0x440371['id'],'type':_0x2e8f30[_0xe3e8('0x2a')],'sectionId':_0x2e8f30['id']},{})[_0xe3e8('0x25')](function(){return _0x5dd140;});}else{return _0x5dd140;}})['catch'](function(_0x5a9155){logger[_0xe3e8('0x58')](_0xe3e8('0x59'),_0x5a9155);throw _0x5a9155;});}return _0x5dd140;})[_0xe3e8('0x25')](respondWithResult(_0x3d95a3,0xc9))[_0xe3e8('0x43')](handleError(_0x3d95a3,null));}; \ No newline at end of file +var _0x1a0f=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','request-promise','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','Content-Range','apply','reject','then','destroy','get','CannedAnswers','UserProfileResource','end','name','send','index','map','rawAttributes','type','key','keys','query','filters','intersection','model','attributes','fields','length','nolimit','order','where','filter','merge','options','CannedAnswer','includeAll','findAll','rows','params','find','catch','update','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x1a0f,0x1ed));var _0xf1a0=function(_0xc08f00,_0x28067f){_0xc08f00=_0xc08f00-0x0;var _0x8649f7=_0x1a0f[_0xc08f00];return _0x8649f7;};'use strict';var emlformat=require(_0xf1a0('0x0'));var rimraf=require(_0xf1a0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf1a0('0x2'));var moment=require(_0xf1a0('0x3'));var BPromise=require(_0xf1a0('0x4'));var Mustache=require(_0xf1a0('0x5'));var util=require('util');var path=require('path');var sox=require(_0xf1a0('0x6'));var csv=require(_0xf1a0('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf1a0('0x8'));var _=require(_0xf1a0('0x9'));var squel=require(_0xf1a0('0xa'));var crypto=require('crypto');var jsforce=require(_0xf1a0('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xf1a0('0x7'));var querystring=require(_0xf1a0('0xc'));var Papa=require(_0xf1a0('0xd'));var Redis=require('ioredis');var authService=require(_0xf1a0('0xe'));var qs=require(_0xf1a0('0xf'));var as=require(_0xf1a0('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf1a0('0x11'))(_0xf1a0('0x12'));var utils=require('../../config/utils');var config=require(_0xf1a0('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xf1a0('0x14'))['db'];function respondWithStatusCode(_0x3c3400,_0x44cb04){_0x44cb04=_0x44cb04||0xcc;return function(_0x43fa73){if(_0x43fa73){return _0x3c3400[_0xf1a0('0x15')](_0x44cb04);}return _0x3c3400[_0xf1a0('0x16')](_0x44cb04)['end']();};}function respondWithResult(_0x4676ad,_0x255778){_0x255778=_0x255778||0xc8;return function(_0x15e10c){if(_0x15e10c){return _0x4676ad['status'](_0x255778)['json'](_0x15e10c);}};}function respondWithFilteredResult(_0x55c0f2,_0x27de89){return function(_0x584618){if(_0x584618){var _0x5f2e65=typeof _0x27de89[_0xf1a0('0x17')]===_0xf1a0('0x18')&&typeof _0x27de89['limit']===_0xf1a0('0x18');var _0x55938d=_0x584618[_0xf1a0('0x19')];var _0x38d6ee=_0x5f2e65?0x0:_0x27de89[_0xf1a0('0x17')];var _0x105e65=_0x5f2e65?_0x584618['count']:_0x27de89[_0xf1a0('0x17')]+_0x27de89[_0xf1a0('0x1a')];var _0x2adbb7;if(_0x105e65>=_0x55938d){_0x105e65=_0x55938d;_0x2adbb7=0xc8;}else{_0x2adbb7=0xce;}_0x55c0f2['status'](_0x2adbb7);return _0x55c0f2[_0xf1a0('0x1b')](_0xf1a0('0x1c'),_0x38d6ee+'-'+_0x105e65+'/'+_0x55938d)['json'](_0x584618);}return null;};}function patchUpdates(_0x9f0bce){return function(_0xa3d1e3){try{jsonpatch[_0xf1a0('0x1d')](_0xa3d1e3,_0x9f0bce,!![]);}catch(_0x5f4542){return BPromise[_0xf1a0('0x1e')](_0x5f4542);}return _0xa3d1e3['save']();};}function saveUpdates(_0x2020ec,_0x190236){return function(_0x35ad71){if(_0x35ad71){return _0x35ad71['update'](_0x2020ec)[_0xf1a0('0x1f')](function(_0x3afbd9){return _0x3afbd9;});}return null;};}function removeEntity(_0x1b3270,_0xe4623d){return function(_0x4722fc){if(_0x4722fc){return _0x4722fc[_0xf1a0('0x20')]()[_0xf1a0('0x1f')](function(){var _0x2c2186=_0x4722fc[_0xf1a0('0x21')]({'plain':!![]});var _0x16b632=_0xf1a0('0x22');return db[_0xf1a0('0x23')]['destroy']({'where':{'type':_0x16b632,'resourceId':_0x2c2186['id']}})[_0xf1a0('0x1f')](function(){return _0x4722fc;});})[_0xf1a0('0x1f')](function(){_0x1b3270[_0xf1a0('0x16')](0xcc)[_0xf1a0('0x24')]();});}};}function handleEntityNotFound(_0x26d186,_0x1dd501){return function(_0x29f55a){if(!_0x29f55a){_0x26d186['sendStatus'](0x194);}return _0x29f55a;};}function handleError(_0x5dc1ce,_0x5b5506){_0x5b5506=_0x5b5506||0x1f4;return function(_0x4fcfa6){logger['error'](_0x4fcfa6['stack']);if(_0x4fcfa6[_0xf1a0('0x25')]){delete _0x4fcfa6[_0xf1a0('0x25')];}_0x5dc1ce[_0xf1a0('0x16')](_0x5b5506)[_0xf1a0('0x26')](_0x4fcfa6);};}exports[_0xf1a0('0x27')]=function(_0x16f214,_0x415eb5){var _0x5ef68f={},_0x41f91d={},_0x12afff={'count':0x0,'rows':[]};var _0x250fab=_[_0xf1a0('0x28')](db['CannedAnswer'][_0xf1a0('0x29')],function(_0x408cac){return{'name':_0x408cac['fieldName'],'type':_0x408cac[_0xf1a0('0x2a')][_0xf1a0('0x2b')]};});_0x41f91d['model']=_[_0xf1a0('0x28')](_0x250fab,_0xf1a0('0x25'));_0x41f91d['query']=_[_0xf1a0('0x2c')](_0x16f214[_0xf1a0('0x2d')]);_0x41f91d[_0xf1a0('0x2e')]=_[_0xf1a0('0x2f')](_0x41f91d[_0xf1a0('0x30')],_0x41f91d[_0xf1a0('0x2d')]);_0x5ef68f[_0xf1a0('0x31')]=_[_0xf1a0('0x2f')](_0x41f91d[_0xf1a0('0x30')],qs['fields'](_0x16f214[_0xf1a0('0x2d')][_0xf1a0('0x32')]));_0x5ef68f[_0xf1a0('0x31')]=_0x5ef68f[_0xf1a0('0x31')][_0xf1a0('0x33')]?_0x5ef68f['attributes']:_0x41f91d['model'];if(!_0x16f214[_0xf1a0('0x2d')]['hasOwnProperty'](_0xf1a0('0x34'))){_0x5ef68f['limit']=qs[_0xf1a0('0x1a')](_0x16f214[_0xf1a0('0x2d')][_0xf1a0('0x1a')]);_0x5ef68f['offset']=qs[_0xf1a0('0x17')](_0x16f214[_0xf1a0('0x2d')][_0xf1a0('0x17')]);}_0x5ef68f[_0xf1a0('0x35')]=qs['sort'](_0x16f214[_0xf1a0('0x2d')]['sort']);_0x5ef68f[_0xf1a0('0x36')]=qs['filters'](_['pick'](_0x16f214[_0xf1a0('0x2d')],_0x41f91d[_0xf1a0('0x2e')]),_0x250fab);if(_0x16f214[_0xf1a0('0x2d')][_0xf1a0('0x37')]){_0x5ef68f[_0xf1a0('0x36')]=_[_0xf1a0('0x38')](_0x5ef68f[_0xf1a0('0x36')],{'$or':[{'key':{'$like':'%'+_0x16f214['query'][_0xf1a0('0x37')]+'%'}},{'value':{'$like':'%'+_0x16f214[_0xf1a0('0x2d')]['filter']+'%'}}]});}_0x5ef68f=_[_0xf1a0('0x38')]({},_0x5ef68f,_0x16f214[_0xf1a0('0x39')]);var _0x4c76e2={'where':_0x5ef68f[_0xf1a0('0x36')]};return db[_0xf1a0('0x3a')]['count'](_0x4c76e2)[_0xf1a0('0x1f')](function(_0x4ea119){_0x12afff[_0xf1a0('0x19')]=_0x4ea119;if(_0x16f214[_0xf1a0('0x2d')][_0xf1a0('0x3b')]){_0x5ef68f['include']=[{'all':!![]}];}return db[_0xf1a0('0x3a')][_0xf1a0('0x3c')](_0x5ef68f);})[_0xf1a0('0x1f')](function(_0x367eb9){_0x12afff[_0xf1a0('0x3d')]=_0x367eb9;return _0x12afff;})[_0xf1a0('0x1f')](respondWithFilteredResult(_0x415eb5,_0x5ef68f))['catch'](handleError(_0x415eb5,null));};exports['show']=function(_0x3085be,_0x31983b){var _0x542c1a={'raw':!![],'where':{'id':_0x3085be[_0xf1a0('0x3e')]['id']}},_0x6e92a={};_0x6e92a[_0xf1a0('0x30')]=_['keys'](db[_0xf1a0('0x3a')][_0xf1a0('0x29')]);_0x6e92a[_0xf1a0('0x2d')]=_[_0xf1a0('0x2c')](_0x3085be[_0xf1a0('0x2d')]);_0x6e92a['filters']=_[_0xf1a0('0x2f')](_0x6e92a[_0xf1a0('0x30')],_0x6e92a[_0xf1a0('0x2d')]);_0x542c1a['attributes']=_[_0xf1a0('0x2f')](_0x6e92a[_0xf1a0('0x30')],qs[_0xf1a0('0x32')](_0x3085be['query'][_0xf1a0('0x32')]));_0x542c1a['attributes']=_0x542c1a[_0xf1a0('0x31')][_0xf1a0('0x33')]?_0x542c1a[_0xf1a0('0x31')]:_0x6e92a['model'];if(_0x3085be[_0xf1a0('0x2d')][_0xf1a0('0x3b')]){_0x542c1a['include']=[{'all':!![]}];}_0x542c1a=_[_0xf1a0('0x38')]({},_0x542c1a,_0x3085be[_0xf1a0('0x39')]);return db[_0xf1a0('0x3a')][_0xf1a0('0x3f')](_0x542c1a)['then'](handleEntityNotFound(_0x31983b,null))[_0xf1a0('0x1f')](respondWithResult(_0x31983b,null))[_0xf1a0('0x40')](handleError(_0x31983b,null));};exports[_0xf1a0('0x41')]=function(_0x59ea35,_0x238923){if(_0x59ea35[_0xf1a0('0x42')]['id']){delete _0x59ea35['body']['id'];}return db[_0xf1a0('0x3a')][_0xf1a0('0x3f')]({'where':{'id':_0x59ea35[_0xf1a0('0x3e')]['id']}})[_0xf1a0('0x1f')](handleEntityNotFound(_0x238923,null))[_0xf1a0('0x1f')](saveUpdates(_0x59ea35[_0xf1a0('0x42')],null))[_0xf1a0('0x1f')](respondWithResult(_0x238923,null))[_0xf1a0('0x40')](handleError(_0x238923,null));};exports[_0xf1a0('0x20')]=function(_0x1c5451,_0x12c29d){return db[_0xf1a0('0x3a')][_0xf1a0('0x3f')]({'where':{'id':_0x1c5451[_0xf1a0('0x3e')]['id']}})[_0xf1a0('0x1f')](handleEntityNotFound(_0x12c29d,null))[_0xf1a0('0x1f')](removeEntity(_0x12c29d,null))['catch'](handleError(_0x12c29d,null));};exports[_0xf1a0('0x43')]=function(_0x45960b,_0x53fc21){var _0x4f713e={'key':_0x45960b[_0xf1a0('0x42')][_0xf1a0('0x2b')]};if(_0x45960b['body'][_0xf1a0('0x44')]){_0x4f713e[_0xf1a0('0x44')]=_0x45960b[_0xf1a0('0x42')][_0xf1a0('0x44')];}else if(_0x45960b[_0xf1a0('0x42')]['SmsAccountId']){_0x4f713e[_0xf1a0('0x45')]=_0x45960b[_0xf1a0('0x42')][_0xf1a0('0x45')];}else if(_0x45960b[_0xf1a0('0x42')][_0xf1a0('0x46')]){_0x4f713e['OpenchannelAccountId']=_0x45960b[_0xf1a0('0x42')][_0xf1a0('0x46')];}else if(_0x45960b[_0xf1a0('0x42')][_0xf1a0('0x47')]){_0x4f713e[_0xf1a0('0x47')]=_0x45960b['body'][_0xf1a0('0x47')];}return db[_0xf1a0('0x3a')]['find']({'where':_0x4f713e})[_0xf1a0('0x1f')](function(_0x4adade){if(_0x4adade){throw new db[(_0xf1a0('0x48'))]['ValidationError'](_0xf1a0('0x49'));}return db[_0xf1a0('0x3a')]['create'](_0x45960b[_0xf1a0('0x42')]);})[_0xf1a0('0x1f')](function(_0x1ebd1e){var _0x4b08c8=_0x45960b[_0xf1a0('0x4a')][_0xf1a0('0x21')]({'plain':!![]});if(!_0x4b08c8)throw new Error(_0xf1a0('0x4b'));if(_0x4b08c8[_0xf1a0('0x4c')]==='user'){var _0x243db5=_0x1ebd1e[_0xf1a0('0x21')]({'plain':!![]});return db[_0xf1a0('0x4d')][_0xf1a0('0x3f')]({'where':{'name':_0xf1a0('0x22'),'userProfileId':_0x4b08c8[_0xf1a0('0x4e')]},'raw':!![]})[_0xf1a0('0x1f')](function(_0x438756){if(_0x438756&&_0x438756[_0xf1a0('0x4f')]===0x0){return db['UserProfileResource']['create']({'name':_0x243db5[_0xf1a0('0x25')],'resourceId':_0x243db5['id'],'type':_0x438756['name'],'sectionId':_0x438756['id']},{})[_0xf1a0('0x1f')](function(){return _0x1ebd1e;});}else{return _0x1ebd1e;}})['catch'](function(_0x4c6221){logger[_0xf1a0('0x50')](_0xf1a0('0x51'),_0x4c6221);throw _0x4c6221;});}return _0x1ebd1e;})['then'](respondWithResult(_0x53fc21,0xc9))[_0xf1a0('0x40')](handleError(_0x53fc21,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 46bd1c9..bcbecb2 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 _0x56c8=['CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./cannedAnswer.attributes','exports'];(function(_0x273417,_0x23d212){var _0x3fdfc1=function(_0x5a13f6){while(--_0x5a13f6){_0x273417['push'](_0x273417['shift']());}};_0x3fdfc1(++_0x23d212);}(_0x56c8,0x170));var _0x856c=function(_0x428a54,_0x5f003f){_0x428a54=_0x428a54-0x0;var _0x5d9462=_0x56c8[_0x428a54];return _0x5d9462;};'use strict';var _=require('lodash');var util=require(_0x856c('0x0'));var logger=require(_0x856c('0x1'))(_0x856c('0x2'));var moment=require(_0x856c('0x3'));var BPromise=require(_0x856c('0x4'));var rp=require(_0x856c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x856c('0x6'));var attributes=require(_0x856c('0x7'));module[_0x856c('0x8')]=function(_0x5dce8c,_0x54b3fc){return _0x5dce8c['define'](_0x856c('0x9'),attributes,{'tableName':_0x856c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x856c('0xb'),'collate':_0x856c('0xc')});}; \ No newline at end of file +var _0xb78f=['path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','CannedAnswer','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','request-promise'];(function(_0x1e822d,_0x59a706){var _0x4d85b8=function(_0x1a1b64){while(--_0x1a1b64){_0x1e822d['push'](_0x1e822d['shift']());}};_0x4d85b8(++_0x59a706);}(_0xb78f,0x128));var _0xfb78=function(_0x25f1ef,_0x7a9334){_0x25f1ef=_0x25f1ef-0x0;var _0x548661=_0xb78f[_0x25f1ef];return _0x548661;};'use strict';var _=require(_0xfb78('0x0'));var util=require('util');var logger=require(_0xfb78('0x1'))('api');var moment=require(_0xfb78('0x2'));var BPromise=require('bluebird');var rp=require(_0xfb78('0x3'));var fs=require('fs');var path=require(_0xfb78('0x4'));var rimraf=require(_0xfb78('0x5'));var config=require(_0xfb78('0x6'));var attributes=require(_0xfb78('0x7'));module[_0xfb78('0x8')]=function(_0x1d7c51,_0x4409d0){return _0x1d7c51['define'](_0xfb78('0x9'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xfb78('0xa'),'collate':_0xfb78('0xb')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 21570e4..e2b9de7 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(_0x576562,_0x2e5c9d){var _0x589e8d=function(_0x5de7e6){while(--_0x5de7e6){_0x576562['push'](_0x576562['shift']());}};_0x589e8d(++_0x2e5c9d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +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(_0x1f907c,_0x1a4eca){var _0x2f6001=function(_0x489c7e){while(--_0x489c7e){_0x1f907c['push'](_0x1f907c['shift']());}};_0x2f6001(++_0x1a4eca);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'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 bf1445b..688cb92 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 _0x290a=['exports','multer','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller','get','isAuthenticated','/:id','show','post','create','put','delete','destroy'];(function(_0x3b1440,_0x493da1){var _0x3c56c5=function(_0x5e656c){while(--_0x5e656c){_0x3b1440['push'](_0x3b1440['shift']());}};_0x3c56c5(++_0x493da1);}(_0x290a,0x9a));var _0xa290=function(_0x3f9e11,_0x12005e){_0x3f9e11=_0x3f9e11-0x0;var _0x548e82=_0x290a[_0x3f9e11];return _0x548e82;};'use strict';var multer=require(_0xa290('0x0'));var util=require('util');var path=require(_0xa290('0x1'));var timeout=require('connect-timeout');var express=require(_0xa290('0x2'));var router=express['Router']();var fs_extra=require(_0xa290('0x3'));var auth=require(_0xa290('0x4'));var interaction=require(_0xa290('0x5'));var config=require('../../config/environment');var controller=require(_0xa290('0x6'));router[_0xa290('0x7')]('/',auth[_0xa290('0x8')](),controller['index']);router[_0xa290('0x7')](_0xa290('0x9'),auth['isAuthenticated'](),controller[_0xa290('0xa')]);router[_0xa290('0xb')]('/',auth[_0xa290('0x8')](),controller[_0xa290('0xc')]);router[_0xa290('0xd')]('/:id',auth[_0xa290('0x8')](),controller['update']);router[_0xa290('0xe')]('/:id',auth[_0xa290('0x8')](),controller[_0xa290('0xf')]);module[_0xa290('0x10')]=router; \ No newline at end of file +var _0x1aa0=['exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','isAuthenticated','index','get','/:id','post','put','update','delete'];(function(_0x456fb1,_0x859a1d){var _0x4083d6=function(_0xe1d0f2){while(--_0xe1d0f2){_0x456fb1['push'](_0x456fb1['shift']());}};_0x4083d6(++_0x859a1d);}(_0x1aa0,0x17b));var _0x01aa=function(_0x1ebd10,_0x4914b4){_0x1ebd10=_0x1ebd10-0x0;var _0x1004d3=_0x1aa0[_0x1ebd10];return _0x1004d3;};'use strict';var multer=require(_0x01aa('0x0'));var util=require('util');var path=require(_0x01aa('0x1'));var timeout=require(_0x01aa('0x2'));var express=require('express');var router=express[_0x01aa('0x3')]();var fs_extra=require(_0x01aa('0x4'));var auth=require(_0x01aa('0x5'));var interaction=require(_0x01aa('0x6'));var config=require(_0x01aa('0x7'));var controller=require(_0x01aa('0x8'));router['get']('/',auth[_0x01aa('0x9')](),controller[_0x01aa('0xa')]);router[_0x01aa('0xb')](_0x01aa('0xc'),auth[_0x01aa('0x9')](),controller['show']);router[_0x01aa('0xd')]('/',auth[_0x01aa('0x9')](),controller['create']);router[_0x01aa('0xe')](_0x01aa('0xc'),auth['isAuthenticated'](),controller[_0x01aa('0xf')]);router[_0x01aa('0x10')](_0x01aa('0xc'),auth[_0x01aa('0x9')](),controller['destroy']);module[_0x01aa('0x11')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index b6be1c1..ac827a5 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 _0xdeb7=['exports','DATE','STRING','INTEGER','sequelize'];(function(_0x597bd0,_0x25db46){var _0x97ae53=function(_0xb33418){while(--_0xb33418){_0x597bd0['push'](_0x597bd0['shift']());}};_0x97ae53(++_0x25db46);}(_0xdeb7,0x77));var _0x7deb=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xdeb7[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0x7deb('0x0'));module[_0x7deb('0x1')]={'calldate':{'type':Sequelize[_0x7deb('0x2')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x7deb('0x3')]},'src':{'type':Sequelize[_0x7deb('0x3')]},'dst':{'type':Sequelize[_0x7deb('0x3')]},'dcontext':{'type':Sequelize[_0x7deb('0x3')]},'channel':{'type':Sequelize[_0x7deb('0x3')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x7deb('0x3')]},'lastdata':{'type':Sequelize[_0x7deb('0x3')]},'duration':{'type':Sequelize[_0x7deb('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x7deb('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x7deb('0x3')]},'amaflags':{'type':Sequelize[_0x7deb('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x7deb('0x3')]},'uniqueid':{'type':Sequelize[_0x7deb('0x3')]},'linkedid':{'type':Sequelize[_0x7deb('0x3')]},'sequence':{'type':Sequelize[_0x7deb('0x3')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x7deb('0x3')]},'tag':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe8cd=['STRING','INTEGER','DATE','1970-01-01\x2000:00:01'];(function(_0x21a361,_0x364fdd){var _0xc220a5=function(_0x2adac6){while(--_0x2adac6){_0x21a361['push'](_0x21a361['shift']());}};_0xc220a5(++_0x364fdd);}(_0xe8cd,0x152));var _0xde8c=function(_0xacb1e2,_0x55e0ab){_0xacb1e2=_0xacb1e2-0x0;var _0x463815=_0xe8cd[_0xacb1e2];return _0x463815;};'use strict';var Sequelize=require('sequelize');module['exports']={'calldate':{'type':Sequelize[_0xde8c('0x0')],'allowNull':![],'defaultValue':_0xde8c('0x1')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0xde8c('0x2')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0xde8c('0x2')]},'channel':{'type':Sequelize[_0xde8c('0x2')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xde8c('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0xde8c('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0xde8c('0x2')]},'uniqueid':{'type':Sequelize[_0xde8c('0x2')]},'linkedid':{'type':Sequelize[_0xde8c('0x2')]},'sequence':{'type':Sequelize[_0xde8c('0x2')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xde8c('0x2')]},'tag':{'type':Sequelize[_0xde8c('0x2')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 874224e..6abab5f 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 _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','Cdr','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x55ca,0x126));var _0xa55c=function(_0x30c2ae,_0x4c98a2){_0x30c2ae=_0x30c2ae-0x0;var _0x1ee1cc=_0x55ca[_0x30c2ae];return _0x1ee1cc;};'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['Cdr'][_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 _0x236d=['undefined','limit','count','set','apply','save','update','then','error','stack','name','send','index','map','Cdr','rawAttributes','fieldName','type','key','model','keys','filters','intersection','attributes','fields','query','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','find','create','body','catch','destroy','params','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x2dbf6d,_0x1ed975){var _0x269475=function(_0x217213){while(--_0x217213){_0x2dbf6d['push'](_0x2dbf6d['shift']());}};_0x269475(++_0x1ed975);}(_0x236d,0x7e));var _0xd236=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x236d[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xd236('0x0'));var rimraf=require(_0xd236('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd236('0x2'));var rp=require('request-promise');var moment=require(_0xd236('0x3'));var BPromise=require(_0xd236('0x4'));var Mustache=require(_0xd236('0x5'));var util=require(_0xd236('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xd236('0x7'));var ejs=require(_0xd236('0x8'));var fs=require('fs');var fs_extra=require(_0xd236('0x9'));var _=require(_0xd236('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd236('0xb'));var deskjs=require(_0xd236('0xc'));var toCsv=require('to-csv');var querystring=require(_0xd236('0xd'));var Papa=require(_0xd236('0xe'));var Redis=require('ioredis');var authService=require(_0xd236('0xf'));var qs=require(_0xd236('0x10'));var as=require(_0xd236('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd236('0x12'))(_0xd236('0x13'));var utils=require(_0xd236('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xd236('0x15'));var db=require(_0xd236('0x16'))['db'];function respondWithStatusCode(_0x3d1076,_0x160cb1){_0x160cb1=_0x160cb1||0xcc;return function(_0x21f27b){if(_0x21f27b){return _0x3d1076[_0xd236('0x17')](_0x160cb1);}return _0x3d1076[_0xd236('0x18')](_0x160cb1)[_0xd236('0x19')]();};}function respondWithResult(_0x22435c,_0x3d7465){_0x3d7465=_0x3d7465||0xc8;return function(_0x348734){if(_0x348734){return _0x22435c[_0xd236('0x18')](_0x3d7465)[_0xd236('0x1a')](_0x348734);}};}function respondWithFilteredResult(_0x3b60a7,_0xd851b5){return function(_0x3b2535){if(_0x3b2535){var _0x2a076d=typeof _0xd851b5[_0xd236('0x1b')]===_0xd236('0x1c')&&typeof _0xd851b5[_0xd236('0x1d')]==='undefined';var _0x4f06c6=_0x3b2535[_0xd236('0x1e')];var _0x1b02a5=_0x2a076d?0x0:_0xd851b5['offset'];var _0x11c6ec=_0x2a076d?_0x3b2535[_0xd236('0x1e')]:_0xd851b5[_0xd236('0x1b')]+_0xd851b5['limit'];var _0x355b65;if(_0x11c6ec>=_0x4f06c6){_0x11c6ec=_0x4f06c6;_0x355b65=0xc8;}else{_0x355b65=0xce;}_0x3b60a7[_0xd236('0x18')](_0x355b65);return _0x3b60a7[_0xd236('0x1f')]('Content-Range',_0x1b02a5+'-'+_0x11c6ec+'/'+_0x4f06c6)[_0xd236('0x1a')](_0x3b2535);}return null;};}function patchUpdates(_0x3b0a27){return function(_0x26c758){try{jsonpatch[_0xd236('0x20')](_0x26c758,_0x3b0a27,!![]);}catch(_0x2f512d){return BPromise['reject'](_0x2f512d);}return _0x26c758[_0xd236('0x21')]();};}function saveUpdates(_0x30e7aa,_0x1e4ddb){return function(_0x3d1e4e){if(_0x3d1e4e){return _0x3d1e4e[_0xd236('0x22')](_0x30e7aa)['then'](function(_0x4a35d0){return _0x4a35d0;});}return null;};}function removeEntity(_0x257f27,_0x4be5ac){return function(_0x22924d){if(_0x22924d){return _0x22924d['destroy']()[_0xd236('0x23')](function(){_0x257f27[_0xd236('0x18')](0xcc)[_0xd236('0x19')]();});}};}function handleEntityNotFound(_0x49d822,_0x41049a){return function(_0x339b08){if(!_0x339b08){_0x49d822[_0xd236('0x17')](0x194);}return _0x339b08;};}function handleError(_0x13ba7a,_0x3a30d8){_0x3a30d8=_0x3a30d8||0x1f4;return function(_0x17f927){logger[_0xd236('0x24')](_0x17f927[_0xd236('0x25')]);if(_0x17f927[_0xd236('0x26')]){delete _0x17f927[_0xd236('0x26')];}_0x13ba7a[_0xd236('0x18')](_0x3a30d8)[_0xd236('0x27')](_0x17f927);};}exports[_0xd236('0x28')]=function(_0x23714d,_0x3108f4){var _0x28175d={},_0x436a19={},_0x471ed6={'count':0x0,'rows':[]};var _0x463fc8=_[_0xd236('0x29')](db[_0xd236('0x2a')][_0xd236('0x2b')],function(_0x3c1617){return{'name':_0x3c1617[_0xd236('0x2c')],'type':_0x3c1617[_0xd236('0x2d')][_0xd236('0x2e')]};});_0x436a19[_0xd236('0x2f')]=_[_0xd236('0x29')](_0x463fc8,_0xd236('0x26'));_0x436a19['query']=_[_0xd236('0x30')](_0x23714d['query']);_0x436a19[_0xd236('0x31')]=_[_0xd236('0x32')](_0x436a19[_0xd236('0x2f')],_0x436a19['query']);_0x28175d[_0xd236('0x33')]=_[_0xd236('0x32')](_0x436a19[_0xd236('0x2f')],qs[_0xd236('0x34')](_0x23714d[_0xd236('0x35')][_0xd236('0x34')]));_0x28175d[_0xd236('0x33')]=_0x28175d['attributes'][_0xd236('0x36')]?_0x28175d['attributes']:_0x436a19[_0xd236('0x2f')];if(!_0x23714d['query'][_0xd236('0x37')](_0xd236('0x38'))){_0x28175d[_0xd236('0x1d')]=qs[_0xd236('0x1d')](_0x23714d[_0xd236('0x35')][_0xd236('0x1d')]);_0x28175d[_0xd236('0x1b')]=qs[_0xd236('0x1b')](_0x23714d[_0xd236('0x35')][_0xd236('0x1b')]);}_0x28175d[_0xd236('0x39')]=qs[_0xd236('0x3a')](_0x23714d[_0xd236('0x35')]['sort']);_0x28175d[_0xd236('0x3b')]=qs[_0xd236('0x31')](_[_0xd236('0x3c')](_0x23714d['query'],_0x436a19[_0xd236('0x31')]),_0x463fc8);if(_0x23714d[_0xd236('0x35')][_0xd236('0x3d')]){_0x28175d[_0xd236('0x3b')]=_[_0xd236('0x3e')](_0x28175d[_0xd236('0x3b')],{'$or':_['map'](_0x463fc8,function(_0x696bed){if(_0x696bed[_0xd236('0x2d')]!==_0xd236('0x3f')){var _0x3c798f={};_0x3c798f[_0x696bed[_0xd236('0x26')]]={'$like':'%'+_0x23714d[_0xd236('0x35')]['filter']+'%'};return _0x3c798f;}})});}_0x28175d=_[_0xd236('0x3e')]({},_0x28175d,_0x23714d[_0xd236('0x40')]);var _0x2ba3ae={'where':_0x28175d['where']};return db[_0xd236('0x2a')]['count'](_0x2ba3ae)[_0xd236('0x23')](function(_0x5793bf){_0x471ed6['count']=_0x5793bf;if(_0x23714d[_0xd236('0x35')][_0xd236('0x41')]){_0x28175d[_0xd236('0x42')]=[{'all':!![]}];}return db[_0xd236('0x2a')][_0xd236('0x43')](_0x28175d);})['then'](function(_0x4d0d65){_0x471ed6[_0xd236('0x44')]=_0x4d0d65;return _0x471ed6;})[_0xd236('0x23')](respondWithFilteredResult(_0x3108f4,_0x28175d))['catch'](handleError(_0x3108f4,null));};exports[_0xd236('0x45')]=function(_0x342fd5,_0x2d815b){var _0x55007d={'raw':!![],'where':{'id':_0x342fd5['params']['id']}},_0x58a93a={};_0x58a93a[_0xd236('0x2f')]=_['keys'](db['Cdr'][_0xd236('0x2b')]);_0x58a93a[_0xd236('0x35')]=_[_0xd236('0x30')](_0x342fd5[_0xd236('0x35')]);_0x58a93a[_0xd236('0x31')]=_['intersection'](_0x58a93a['model'],_0x58a93a[_0xd236('0x35')]);_0x55007d[_0xd236('0x33')]=_[_0xd236('0x32')](_0x58a93a[_0xd236('0x2f')],qs[_0xd236('0x34')](_0x342fd5[_0xd236('0x35')]['fields']));_0x55007d[_0xd236('0x33')]=_0x55007d['attributes'][_0xd236('0x36')]?_0x55007d[_0xd236('0x33')]:_0x58a93a['model'];if(_0x342fd5['query']['includeAll']){_0x55007d['include']=[{'all':!![]}];}_0x55007d=_[_0xd236('0x3e')]({},_0x55007d,_0x342fd5[_0xd236('0x40')]);return db[_0xd236('0x2a')][_0xd236('0x46')](_0x55007d)[_0xd236('0x23')](handleEntityNotFound(_0x2d815b,null))['then'](respondWithResult(_0x2d815b,null))['catch'](handleError(_0x2d815b,null));};exports[_0xd236('0x47')]=function(_0x7c0650,_0xbf4ba9){return db[_0xd236('0x2a')][_0xd236('0x47')](_0x7c0650[_0xd236('0x48')],{})['then'](respondWithResult(_0xbf4ba9,0xc9))[_0xd236('0x49')](handleError(_0xbf4ba9,null));};exports['update']=function(_0x223a14,_0x2c8861){if(_0x223a14['body']['id']){delete _0x223a14[_0xd236('0x48')]['id'];}return db[_0xd236('0x2a')]['find']({'where':{'id':_0x223a14['params']['id']}})[_0xd236('0x23')](handleEntityNotFound(_0x2c8861,null))[_0xd236('0x23')](saveUpdates(_0x223a14[_0xd236('0x48')],null))[_0xd236('0x23')](respondWithResult(_0x2c8861,null))['catch'](handleError(_0x2c8861,null));};exports[_0xd236('0x4a')]=function(_0x43c12b,_0x3d8ca6){return db[_0xd236('0x2a')][_0xd236('0x46')]({'where':{'id':_0x43c12b[_0xd236('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3d8ca6,null))['then'](removeEntity(_0x3d8ca6,null))[_0xd236('0x49')](handleError(_0x3d8ca6,null));};exports['describe']=function(_0xa39da6,_0x30c336){return db['Cdr'][_0xd236('0x4c')]()[_0xd236('0x23')](respondWithResult(_0x30c336,null))['catch'](handleError(_0x30c336,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index dc42364..76259b9 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(_0xa99ff1,_0x4b2416){var _0x4594ba=function(_0x5e547e){while(--_0x5e547e){_0xa99ff1['push'](_0xa99ff1['shift']());}};_0x4594ba(++_0x4b2416);}(_0x7a54,0x106));var _0x47a5=function(_0x2f8df5,_0x23b09e){_0x2f8df5=_0x2f8df5-0x0;var _0x10c3fb=_0x7a54[_0x2f8df5];return _0x10c3fb;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file +var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x277ed4,_0x2b0a9e){var _0x280790=function(_0x34daf3){while(--_0x34daf3){_0x277ed4['push'](_0x277ed4['shift']());}};_0x280790(++_0x2b0a9e);}(_0x7a54,0x106));var _0x47a5=function(_0x4e4fe4,_0x5cf4da){_0x4e4fe4=_0x4e4fe4-0x0;var _0xb97609=_0x7a54[_0x4e4fe4];return _0xb97609;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index 5c9da86..d7a9209 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 _0x9f99=['error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x19e939,_0x301940){var _0x27567c=function(_0x67d3f4){while(--_0x67d3f4){_0x19e939['push'](_0x19e939['shift']());}};_0x27567c(++_0x301940);}(_0x9f99,0x16c));var _0x99f9=function(_0x562844,_0x96767f){_0x562844=_0x562844-0x0;var _0x3d65ae=_0x9f99[_0x562844];return _0x3d65ae;};'use strict';var _=require(_0x99f9('0x0'));var util=require(_0x99f9('0x1'));var moment=require(_0x99f9('0x2'));var BPromise=require(_0x99f9('0x3'));var rs=require(_0x99f9('0x4'));var fs=require('fs');var Redis=require(_0x99f9('0x5'));var db=require(_0x99f9('0x6'))['db'];var utils=require(_0x99f9('0x7'));var logger=require(_0x99f9('0x8'))(_0x99f9('0x9'));var config=require('../../config/environment');var jayson=require(_0x99f9('0xa'));var client=jayson['client'][_0x99f9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x13f423,_0x53e259,_0x5e710a){return new BPromise(function(_0x393425,_0x3a83b2){return client[_0x99f9('0xc')](_0x13f423,_0x5e710a)[_0x99f9('0xd')](function(_0x1156c8){logger[_0x99f9('0xe')](_0x99f9('0xf'),_0x53e259,_0x99f9('0x10'));logger[_0x99f9('0x11')](_0x99f9('0x12'),_0x53e259,_0x99f9('0x10'),JSON[_0x99f9('0x13')](_0x1156c8));if(_0x1156c8[_0x99f9('0x14')]){if(_0x1156c8['error'][_0x99f9('0x15')]===0x1f4){logger[_0x99f9('0x14')](_0x99f9('0xf'),_0x53e259,_0x1156c8[_0x99f9('0x14')]['message']);return _0x3a83b2(_0x1156c8[_0x99f9('0x14')]['message']);}logger[_0x99f9('0x14')]('Cdr,\x20%s,\x20%s',_0x53e259,_0x1156c8[_0x99f9('0x14')][_0x99f9('0x16')]);return _0x393425(_0x1156c8[_0x99f9('0x14')][_0x99f9('0x16')]);}else{logger[_0x99f9('0xe')](_0x99f9('0xf'),_0x53e259,'request\x20sent');_0x393425(_0x1156c8[_0x99f9('0x17')][_0x99f9('0x16')]);}})['catch'](function(_0x422cdd){logger[_0x99f9('0x14')](_0x99f9('0xf'),_0x53e259,_0x422cdd);_0x3a83b2(_0x422cdd);});});} \ No newline at end of file +var _0xcd90=['stringify','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0xcd90,0xec));var _0x0cd9=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xcd90[_0x2bf141];return _0x48277b;};'use strict';var _=require(_0x0cd9('0x0'));var util=require(_0x0cd9('0x1'));var moment=require(_0x0cd9('0x2'));var BPromise=require(_0x0cd9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0cd9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0cd9('0x5'));var logger=require(_0x0cd9('0x6'))(_0x0cd9('0x7'));var config=require(_0x0cd9('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0cd9('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1bc7b8,_0x219a52,_0xcf4ee5){return new BPromise(function(_0x8cb888,_0x387c29){return client[_0x0cd9('0xa')](_0x1bc7b8,_0xcf4ee5)['then'](function(_0x3cab5b){logger[_0x0cd9('0xb')](_0x0cd9('0xc'),_0x219a52,_0x0cd9('0xd'));logger[_0x0cd9('0xe')](_0x0cd9('0xf'),_0x219a52,_0x0cd9('0xd'),JSON[_0x0cd9('0x10')](_0x3cab5b));if(_0x3cab5b['error']){if(_0x3cab5b[_0x0cd9('0x11')][_0x0cd9('0x12')]===0x1f4){logger[_0x0cd9('0x11')]('Cdr,\x20%s,\x20%s',_0x219a52,_0x3cab5b['error']['message']);return _0x387c29(_0x3cab5b[_0x0cd9('0x11')]['message']);}logger[_0x0cd9('0x11')](_0x0cd9('0xc'),_0x219a52,_0x3cab5b[_0x0cd9('0x11')]['message']);return _0x8cb888(_0x3cab5b[_0x0cd9('0x11')][_0x0cd9('0x13')]);}else{logger[_0x0cd9('0xb')](_0x0cd9('0xc'),_0x219a52,_0x0cd9('0xd'));_0x8cb888(_0x3cab5b[_0x0cd9('0x14')][_0x0cd9('0x13')]);}})['catch'](function(_0x13a6de){logger[_0x0cd9('0x11')](_0x0cd9('0xc'),_0x219a52,_0x13a6de);_0x387c29(_0x13a6de);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index b6930d6..e0d44d3 100644 --- a/server/api/cdr/index.js +++ b/server/api/cdr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0xfa2f68,_0x23836e){var _0x252d9a=function(_0x285e61){while(--_0x285e61){_0xfa2f68['push'](_0xfa2f68['shift']());}};_0x252d9a(++_0x23836e);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file +var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x434467,_0x2c6a75){var _0x5248ba=function(_0x5a3811){while(--_0x5a3811){_0x434467['push'](_0x434467['shift']());}};_0x5248ba(++_0x2c6a75);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index c915b86..6657d57 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 _0x9c85=['exports','INTEGER','noop','STRING','*,*,*,*','sequelize'];(function(_0x278b5f,_0x451f15){var _0xd1251b=function(_0x1e770c){while(--_0x1e770c){_0x278b5f['push'](_0x278b5f['shift']());}};_0xd1251b(++_0x451f15);}(_0x9c85,0xf5));var _0x59c8=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x9c85[_0x4e676e];return _0x336a3c;};'use strict';var Sequelize=require(_0x59c8('0x0'));module[_0x59c8('0x1')]={'priority':{'type':Sequelize[_0x59c8('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x59c8('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x59c8('0x4')]},'interval':{'type':Sequelize[_0x59c8('0x4')],'defaultValue':_0x59c8('0x5')}}; \ No newline at end of file +var _0xad98=['INTEGER','noop','STRING','sequelize'];(function(_0x4e0f9b,_0x1a7855){var _0x41d7fd=function(_0x431134){while(--_0x431134){_0x4e0f9b['push'](_0x4e0f9b['shift']());}};_0x41d7fd(++_0x1a7855);}(_0xad98,0x1df));var _0x8ad9=function(_0x245f64,_0x4ae342){_0x245f64=_0x245f64-0x0;var _0x3447e0=_0xad98[_0x245f64];return _0x3447e0;};'use strict';var Sequelize=require(_0x8ad9('0x0'));module['exports']={'priority':{'type':Sequelize[_0x8ad9('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x8ad9('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x8ad9('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 96e6fad..68fd296 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 _0x44d4=['../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','count','offset','limit','Content-Range','json','apply','reject','then','destroy','name','send','model','ChatApplication','query','keys','filters','intersection','attributes','fields','include','merge','options','find','update','body','params','catch','eml-format','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x44d4,0x161));var _0x444d=function(_0x5d2dc8,_0x4088bb){_0x5d2dc8=_0x5d2dc8-0x0;var _0x2e6a66=_0x44d4[_0x5d2dc8];return _0x2e6a66;};'use strict';var emlformat=require(_0x444d('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x444d('0x1'));var moment=require(_0x444d('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x444d('0x3'));var sox=require(_0x444d('0x4'));var csv=require(_0x444d('0x5'));var ejs=require(_0x444d('0x6'));var fs=require('fs');var fs_extra=require(_0x444d('0x7'));var _=require(_0x444d('0x8'));var squel=require(_0x444d('0x9'));var crypto=require('crypto');var jsforce=require(_0x444d('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x444d('0x5'));var querystring=require(_0x444d('0xb'));var Papa=require(_0x444d('0xc'));var Redis=require(_0x444d('0xd'));var authService=require(_0x444d('0xe'));var qs=require(_0x444d('0xf'));var as=require(_0x444d('0x10'));var hardwareService=require(_0x444d('0x11'));var logger=require(_0x444d('0x12'))(_0x444d('0x13'));var utils=require(_0x444d('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x444d('0x15'));var db=require(_0x444d('0x16'))['db'];function respondWithStatusCode(_0x4a997f,_0x11db08){_0x11db08=_0x11db08||0xcc;return function(_0x3a2d03){if(_0x3a2d03){return _0x4a997f[_0x444d('0x17')](_0x11db08);}return _0x4a997f['status'](_0x11db08)[_0x444d('0x18')]();};}function respondWithResult(_0x41b794,_0x390231){_0x390231=_0x390231||0xc8;return function(_0x545a4b){if(_0x545a4b){return _0x41b794[_0x444d('0x19')](_0x390231)['json'](_0x545a4b);}};}function respondWithFilteredResult(_0x40bdbb,_0x43210d){return function(_0x21cbb0){if(_0x21cbb0){var _0x1bd5db=typeof _0x43210d['offset']==='undefined'&&typeof _0x43210d['limit']==='undefined';var _0x1a0e21=_0x21cbb0[_0x444d('0x1a')];var _0x171c35=_0x1bd5db?0x0:_0x43210d['offset'];var _0x54e12a=_0x1bd5db?_0x21cbb0[_0x444d('0x1a')]:_0x43210d[_0x444d('0x1b')]+_0x43210d[_0x444d('0x1c')];var _0x42b26d;if(_0x54e12a>=_0x1a0e21){_0x54e12a=_0x1a0e21;_0x42b26d=0xc8;}else{_0x42b26d=0xce;}_0x40bdbb[_0x444d('0x19')](_0x42b26d);return _0x40bdbb['set'](_0x444d('0x1d'),_0x171c35+'-'+_0x54e12a+'/'+_0x1a0e21)[_0x444d('0x1e')](_0x21cbb0);}return null;};}function patchUpdates(_0x2c0e2a){return function(_0x3bac2f){try{jsonpatch[_0x444d('0x1f')](_0x3bac2f,_0x2c0e2a,!![]);}catch(_0x25e6ae){return BPromise[_0x444d('0x20')](_0x25e6ae);}return _0x3bac2f['save']();};}function saveUpdates(_0x5e071f,_0xe2cd4d){return function(_0x4ef57b){if(_0x4ef57b){return _0x4ef57b['update'](_0x5e071f)[_0x444d('0x21')](function(_0x11563d){return _0x11563d;});}return null;};}function removeEntity(_0x546a9f,_0x5bbc84){return function(_0x17cc83){if(_0x17cc83){return _0x17cc83[_0x444d('0x22')]()[_0x444d('0x21')](function(){_0x546a9f[_0x444d('0x19')](0xcc)[_0x444d('0x18')]();});}};}function handleEntityNotFound(_0x2faf9e,_0x4016b8){return function(_0x394d06){if(!_0x394d06){_0x2faf9e[_0x444d('0x17')](0x194);}return _0x394d06;};}function handleError(_0x49c2fd,_0x5b8f14){_0x5b8f14=_0x5b8f14||0x1f4;return function(_0x240c32){logger['error'](_0x240c32['stack']);if(_0x240c32[_0x444d('0x23')]){delete _0x240c32['name'];}_0x49c2fd[_0x444d('0x19')](_0x5b8f14)[_0x444d('0x24')](_0x240c32);};}exports['show']=function(_0x1f6a96,_0x262fd2){var _0x3a4806={'raw':!![],'where':{'id':_0x1f6a96['params']['id']}},_0xea2b0b={};_0xea2b0b[_0x444d('0x25')]=_['keys'](db[_0x444d('0x26')]['rawAttributes']);_0xea2b0b[_0x444d('0x27')]=_[_0x444d('0x28')](_0x1f6a96[_0x444d('0x27')]);_0xea2b0b[_0x444d('0x29')]=_[_0x444d('0x2a')](_0xea2b0b['model'],_0xea2b0b[_0x444d('0x27')]);_0x3a4806[_0x444d('0x2b')]=_[_0x444d('0x2a')](_0xea2b0b[_0x444d('0x25')],qs[_0x444d('0x2c')](_0x1f6a96[_0x444d('0x27')][_0x444d('0x2c')]));_0x3a4806[_0x444d('0x2b')]=_0x3a4806[_0x444d('0x2b')]['length']?_0x3a4806['attributes']:_0xea2b0b[_0x444d('0x25')];if(_0x1f6a96[_0x444d('0x27')]['includeAll']){_0x3a4806[_0x444d('0x2d')]=[{'all':!![]}];}_0x3a4806=_[_0x444d('0x2e')]({},_0x3a4806,_0x1f6a96[_0x444d('0x2f')]);return db[_0x444d('0x26')][_0x444d('0x30')](_0x3a4806)['then'](handleEntityNotFound(_0x262fd2,null))['then'](respondWithResult(_0x262fd2,null))['catch'](handleError(_0x262fd2,null));};exports[_0x444d('0x31')]=function(_0x3e4658,_0x5935d9){if(_0x3e4658[_0x444d('0x32')]['id']){delete _0x3e4658['body']['id'];}return db[_0x444d('0x26')][_0x444d('0x30')]({'where':{'id':_0x3e4658[_0x444d('0x33')]['id']}})[_0x444d('0x21')](handleEntityNotFound(_0x5935d9,null))[_0x444d('0x21')](saveUpdates(_0x3e4658['body'],null))['then'](respondWithResult(_0x5935d9,null))[_0x444d('0x34')](handleError(_0x5935d9,null));};exports[_0x444d('0x22')]=function(_0x42cfff,_0x2297d3){return db[_0x444d('0x26')][_0x444d('0x30')]({'where':{'id':_0x42cfff[_0x444d('0x33')]['id']}})['then'](handleEntityNotFound(_0x2297d3,null))[_0x444d('0x21')](removeEntity(_0x2297d3,null))[_0x444d('0x34')](handleError(_0x2297d3,null));}; \ No newline at end of file +var _0x67da=['end','sendStatus','error','name','send','show','params','model','keys','ChatApplication','rawAttributes','query','filters','intersection','attributes','fields','length','include','merge','options','find','catch','update','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x67da,0x192));var _0xa67d=function(_0x241fc2,_0xe233db){_0x241fc2=_0x241fc2-0x0;var _0x3b15d9=_0x67da[_0x241fc2];return _0x3b15d9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa67d('0x0'));var zipdir=require(_0xa67d('0x1'));var jsonpatch=require(_0xa67d('0x2'));var rp=require(_0xa67d('0x3'));var moment=require(_0xa67d('0x4'));var BPromise=require(_0xa67d('0x5'));var Mustache=require(_0xa67d('0x6'));var util=require(_0xa67d('0x7'));var path=require(_0xa67d('0x8'));var sox=require(_0xa67d('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa67d('0xa'));var _=require('lodash');var squel=require(_0xa67d('0xb'));var crypto=require(_0xa67d('0xc'));var jsforce=require(_0xa67d('0xd'));var deskjs=require(_0xa67d('0xe'));var toCsv=require(_0xa67d('0xf'));var querystring=require(_0xa67d('0x10'));var Papa=require(_0xa67d('0x11'));var Redis=require(_0xa67d('0x12'));var authService=require(_0xa67d('0x13'));var qs=require(_0xa67d('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa67d('0x15'));var logger=require(_0xa67d('0x16'))(_0xa67d('0x17'));var utils=require(_0xa67d('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xa67d('0x19'));var db=require(_0xa67d('0x1a'))['db'];function respondWithStatusCode(_0x560485,_0x4e86f6){_0x4e86f6=_0x4e86f6||0xcc;return function(_0x304ee2){if(_0x304ee2){return _0x560485['sendStatus'](_0x4e86f6);}return _0x560485[_0xa67d('0x1b')](_0x4e86f6)['end']();};}function respondWithResult(_0x5d757b,_0x22dcc7){_0x22dcc7=_0x22dcc7||0xc8;return function(_0x3b99e3){if(_0x3b99e3){return _0x5d757b['status'](_0x22dcc7)[_0xa67d('0x1c')](_0x3b99e3);}};}function respondWithFilteredResult(_0x267a67,_0x1cfe81){return function(_0x288e5f){if(_0x288e5f){var _0x5a47de=typeof _0x1cfe81['offset']==='undefined'&&typeof _0x1cfe81['limit']===_0xa67d('0x1d');var _0x553811=_0x288e5f[_0xa67d('0x1e')];var _0xf8422c=_0x5a47de?0x0:_0x1cfe81[_0xa67d('0x1f')];var _0x1b58c3=_0x5a47de?_0x288e5f[_0xa67d('0x1e')]:_0x1cfe81[_0xa67d('0x1f')]+_0x1cfe81[_0xa67d('0x20')];var _0x5538a5;if(_0x1b58c3>=_0x553811){_0x1b58c3=_0x553811;_0x5538a5=0xc8;}else{_0x5538a5=0xce;}_0x267a67[_0xa67d('0x1b')](_0x5538a5);return _0x267a67[_0xa67d('0x21')](_0xa67d('0x22'),_0xf8422c+'-'+_0x1b58c3+'/'+_0x553811)[_0xa67d('0x1c')](_0x288e5f);}return null;};}function patchUpdates(_0x28f38b){return function(_0x1c3498){try{jsonpatch['apply'](_0x1c3498,_0x28f38b,!![]);}catch(_0x3f1898){return BPromise[_0xa67d('0x23')](_0x3f1898);}return _0x1c3498[_0xa67d('0x24')]();};}function saveUpdates(_0xed6c3e,_0x48f240){return function(_0x276ef7){if(_0x276ef7){return _0x276ef7['update'](_0xed6c3e)[_0xa67d('0x25')](function(_0x415141){return _0x415141;});}return null;};}function removeEntity(_0x46bbc8,_0x9c2935){return function(_0x559009){if(_0x559009){return _0x559009[_0xa67d('0x26')]()[_0xa67d('0x25')](function(){_0x46bbc8['status'](0xcc)[_0xa67d('0x27')]();});}};}function handleEntityNotFound(_0x3dd0b9,_0x2b890c){return function(_0xe0c7b2){if(!_0xe0c7b2){_0x3dd0b9[_0xa67d('0x28')](0x194);}return _0xe0c7b2;};}function handleError(_0x1d6e68,_0x5ef92a){_0x5ef92a=_0x5ef92a||0x1f4;return function(_0x435e56){logger[_0xa67d('0x29')](_0x435e56['stack']);if(_0x435e56[_0xa67d('0x2a')]){delete _0x435e56[_0xa67d('0x2a')];}_0x1d6e68[_0xa67d('0x1b')](_0x5ef92a)[_0xa67d('0x2b')](_0x435e56);};}exports[_0xa67d('0x2c')]=function(_0x8793cf,_0x42c858){var _0xf4fc64={'raw':!![],'where':{'id':_0x8793cf[_0xa67d('0x2d')]['id']}},_0x204f83={};_0x204f83[_0xa67d('0x2e')]=_[_0xa67d('0x2f')](db[_0xa67d('0x30')][_0xa67d('0x31')]);_0x204f83['query']=_[_0xa67d('0x2f')](_0x8793cf[_0xa67d('0x32')]);_0x204f83[_0xa67d('0x33')]=_[_0xa67d('0x34')](_0x204f83[_0xa67d('0x2e')],_0x204f83['query']);_0xf4fc64[_0xa67d('0x35')]=_[_0xa67d('0x34')](_0x204f83[_0xa67d('0x2e')],qs[_0xa67d('0x36')](_0x8793cf[_0xa67d('0x32')][_0xa67d('0x36')]));_0xf4fc64[_0xa67d('0x35')]=_0xf4fc64[_0xa67d('0x35')][_0xa67d('0x37')]?_0xf4fc64[_0xa67d('0x35')]:_0x204f83['model'];if(_0x8793cf[_0xa67d('0x32')]['includeAll']){_0xf4fc64[_0xa67d('0x38')]=[{'all':!![]}];}_0xf4fc64=_[_0xa67d('0x39')]({},_0xf4fc64,_0x8793cf[_0xa67d('0x3a')]);return db['ChatApplication'][_0xa67d('0x3b')](_0xf4fc64)[_0xa67d('0x25')](handleEntityNotFound(_0x42c858,null))[_0xa67d('0x25')](respondWithResult(_0x42c858,null))[_0xa67d('0x3c')](handleError(_0x42c858,null));};exports[_0xa67d('0x3d')]=function(_0x199e8f,_0x4ded76){if(_0x199e8f[_0xa67d('0x3e')]['id']){delete _0x199e8f[_0xa67d('0x3e')]['id'];}return db['ChatApplication']['find']({'where':{'id':_0x199e8f['params']['id']}})[_0xa67d('0x25')](handleEntityNotFound(_0x4ded76,null))['then'](saveUpdates(_0x199e8f[_0xa67d('0x3e')],null))[_0xa67d('0x25')](respondWithResult(_0x4ded76,null))[_0xa67d('0x3c')](handleError(_0x4ded76,null));};exports[_0xa67d('0x26')]=function(_0x35a0a0,_0x44310e){return db[_0xa67d('0x30')][_0xa67d('0x3b')]({'where':{'id':_0x35a0a0[_0xa67d('0x2d')]['id']}})[_0xa67d('0x25')](handleEntityNotFound(_0x44310e,null))[_0xa67d('0x25')](removeEntity(_0x44310e,null))[_0xa67d('0x3c')](handleError(_0x44310e,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 8b9f7ee..d13df6c 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 _0xbef6=['ChatApplication','utf8mb4_unicode_ci','lodash','util','api','request-promise','rimraf','../../config/environment','exports','define'];(function(_0x3fd921,_0x4c4b58){var _0x386b5e=function(_0x96ae3b){while(--_0x96ae3b){_0x3fd921['push'](_0x3fd921['shift']());}};_0x386b5e(++_0x4c4b58);}(_0xbef6,0x1b0));var _0x6bef=function(_0x1c7a24,_0xdca25a){_0x1c7a24=_0x1c7a24-0x0;var _0xde3e84=_0xbef6[_0x1c7a24];return _0xde3e84;};'use strict';var _=require(_0x6bef('0x0'));var util=require(_0x6bef('0x1'));var logger=require('../../config/logger')(_0x6bef('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6bef('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6bef('0x4'));var config=require(_0x6bef('0x5'));var attributes=require('./chatApplication.attributes');module[_0x6bef('0x6')]=function(_0x307f07,_0x5f2fcf){return _0x307f07[_0x6bef('0x7')](_0x6bef('0x8'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x6bef('0x9')});}; \ No newline at end of file +var _0xf296=['define','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','request-promise','path','../../config/environment','./chatApplication.attributes','exports'];(function(_0x19373c,_0x3eb198){var _0x564519=function(_0x25f53d){while(--_0x25f53d){_0x19373c['push'](_0x19373c['shift']());}};_0x564519(++_0x3eb198);}(_0xf296,0x94));var _0x6f29=function(_0xf458be,_0x1cf158){_0xf458be=_0xf458be-0x0;var _0x52b318=_0xf296[_0xf458be];return _0x52b318;};'use strict';var _=require(_0x6f29('0x0'));var util=require(_0x6f29('0x1'));var logger=require('../../config/logger')(_0x6f29('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6f29('0x3'));var fs=require('fs');var path=require(_0x6f29('0x4'));var rimraf=require('rimraf');var config=require(_0x6f29('0x5'));var attributes=require(_0x6f29('0x6'));module[_0x6f29('0x7')]=function(_0x4f0712,_0x1d9c3f){return _0x4f0712[_0x6f29('0x8')]('ChatApplication',attributes,{'tableName':_0x6f29('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6f29('0xa'),'collate':_0x6f29('0xb')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 5f9f832..684b1b5 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 _0xabc8=['rpc','../../config/environment','jayson/promise','client','http','request','then','ChatApplication,\x20%s,\x20%s','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x1098db,_0x39ba6b){var _0x14f090=function(_0x473ffe){while(--_0x473ffe){_0x1098db['push'](_0x1098db['shift']());}};_0x14f090(++_0x39ba6b);}(_0xabc8,0x1c7));var _0x8abc=function(_0x13524d,_0x505b49){_0x13524d=_0x13524d-0x0;var _0x9918b4=_0xabc8[_0x13524d];return _0x9918b4;};'use strict';var _=require(_0x8abc('0x0'));var util=require(_0x8abc('0x1'));var moment=require(_0x8abc('0x2'));var BPromise=require(_0x8abc('0x3'));var rs=require(_0x8abc('0x4'));var fs=require('fs');var Redis=require(_0x8abc('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8abc('0x6'));var logger=require('../../config/logger')(_0x8abc('0x7'));var config=require(_0x8abc('0x8'));var jayson=require(_0x8abc('0x9'));var client=jayson[_0x8abc('0xa')][_0x8abc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5188de,_0x339162,_0x46f7ec){return new BPromise(function(_0x5eaadd,_0x2b5abf){return client[_0x8abc('0xc')](_0x5188de,_0x46f7ec)[_0x8abc('0xd')](function(_0x460e9b){logger['info'](_0x8abc('0xe'),_0x339162,_0x8abc('0xf'));logger['debug'](_0x8abc('0x10'),_0x339162,'request\x20sent',JSON['stringify'](_0x460e9b));if(_0x460e9b['error']){if(_0x460e9b[_0x8abc('0x11')][_0x8abc('0x12')]===0x1f4){logger['error'](_0x8abc('0xe'),_0x339162,_0x460e9b[_0x8abc('0x11')][_0x8abc('0x13')]);return _0x2b5abf(_0x460e9b[_0x8abc('0x11')][_0x8abc('0x13')]);}logger[_0x8abc('0x11')](_0x8abc('0xe'),_0x339162,_0x460e9b[_0x8abc('0x11')]['message']);return _0x5eaadd(_0x460e9b['error'][_0x8abc('0x13')]);}else{logger[_0x8abc('0x14')]('ChatApplication,\x20%s,\x20%s',_0x339162,_0x8abc('0xf'));_0x5eaadd(_0x460e9b['result'][_0x8abc('0x13')]);}})[_0x8abc('0x15')](function(_0x22cd05){logger[_0x8abc('0x11')]('ChatApplication,\x20%s,\x20%s',_0x339162,_0x22cd05);_0x2b5abf(_0x22cd05);});});} \ No newline at end of file +var _0x39be=['util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x4d2073,_0x37d13c){var _0x132940=function(_0x402e78){while(--_0x402e78){_0x4d2073['push'](_0x4d2073['shift']());}};_0x132940(++_0x37d13c);}(_0x39be,0x83));var _0xe39b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x39be[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe39b('0x0'));var util=require(_0xe39b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe39b('0x2'));var fs=require('fs');var Redis=require(_0xe39b('0x3'));var db=require(_0xe39b('0x4'))['db'];var utils=require(_0xe39b('0x5'));var logger=require(_0xe39b('0x6'))('rpc');var config=require(_0xe39b('0x7'));var jayson=require(_0xe39b('0x8'));var client=jayson['client'][_0xe39b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x126235,_0x5c02bc,_0x59c896){return new BPromise(function(_0xb05a31,_0x76acf1){return client[_0xe39b('0xa')](_0x126235,_0x59c896)[_0xe39b('0xb')](function(_0x24b84e){logger['info'](_0xe39b('0xc'),_0x5c02bc,_0xe39b('0xd'));logger[_0xe39b('0xe')](_0xe39b('0xf'),_0x5c02bc,_0xe39b('0xd'),JSON[_0xe39b('0x10')](_0x24b84e));if(_0x24b84e[_0xe39b('0x11')]){if(_0x24b84e[_0xe39b('0x11')][_0xe39b('0x12')]===0x1f4){logger[_0xe39b('0x11')](_0xe39b('0xc'),_0x5c02bc,_0x24b84e[_0xe39b('0x11')][_0xe39b('0x13')]);return _0x76acf1(_0x24b84e[_0xe39b('0x11')][_0xe39b('0x13')]);}logger[_0xe39b('0x11')](_0xe39b('0xc'),_0x5c02bc,_0x24b84e[_0xe39b('0x11')][_0xe39b('0x13')]);return _0xb05a31(_0x24b84e['error'][_0xe39b('0x13')]);}else{logger['info'](_0xe39b('0xc'),_0x5c02bc,_0xe39b('0xd'));_0xb05a31(_0x24b84e[_0xe39b('0x14')]['message']);}})[_0xe39b('0x15')](function(_0x5d93f5){logger[_0xe39b('0x11')](_0xe39b('0xc'),_0x5c02bc,_0x5d93f5);_0x76acf1(_0x5d93f5);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 9ba2755..4745da5 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 _0x3080=['get','/:id','isAuthenticated','show','update','delete','destroy','exports','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x3080,0x1c8));var _0x0308=function(_0x24a91c,_0x1b3580){_0x24a91c=_0x24a91c-0x0;var _0x209a66=_0x3080[_0x24a91c];return _0x209a66;};'use strict';var multer=require('multer');var util=require(_0x0308('0x0'));var path=require('path');var timeout=require(_0x0308('0x1'));var express=require(_0x0308('0x2'));var router=express['Router']();var fs_extra=require(_0x0308('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x0308('0x4'));var config=require(_0x0308('0x5'));var controller=require('./chatApplication.controller');router[_0x0308('0x6')](_0x0308('0x7'),auth[_0x0308('0x8')](),controller[_0x0308('0x9')]);router['put'](_0x0308('0x7'),auth['isAuthenticated'](),controller[_0x0308('0xa')]);router[_0x0308('0xb')](_0x0308('0x7'),auth[_0x0308('0x8')](),controller[_0x0308('0xc')]);module[_0x0308('0xd')]=router; \ No newline at end of file +var _0x28ce=['util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./chatApplication.controller','/:id','isAuthenticated','delete','exports','multer'];(function(_0x43cd40,_0x5c21d2){var _0x58122c=function(_0x1409ec){while(--_0x1409ec){_0x43cd40['push'](_0x43cd40['shift']());}};_0x58122c(++_0x5c21d2);}(_0x28ce,0x1ee));var _0xe28c=function(_0x45187f,_0x203811){_0x45187f=_0x45187f-0x0;var _0x1f8e4b=_0x28ce[_0x45187f];return _0x1f8e4b;};'use strict';var multer=require(_0xe28c('0x0'));var util=require(_0xe28c('0x1'));var path=require('path');var timeout=require(_0xe28c('0x2'));var express=require('express');var router=express[_0xe28c('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xe28c('0x4'));var interaction=require(_0xe28c('0x5'));var config=require('../../config/environment');var controller=require(_0xe28c('0x6'));router['get'](_0xe28c('0x7'),auth[_0xe28c('0x8')](),controller['show']);router['put']('/:id',auth[_0xe28c('0x8')](),controller['update']);router[_0xe28c('0x9')](_0xe28c('0x7'),auth[_0xe28c('0x8')](),controller['destroy']);module[_0xe28c('0xa')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index df1b610..de55ee4 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 _0xfce5=['STRING','sequelize','exports'];(function(_0x5df3f4,_0xf5a26){var _0x21715b=function(_0x9604fc){while(--_0x9604fc){_0x5df3f4['push'](_0x5df3f4['shift']());}};_0x21715b(++_0xf5a26);}(_0xfce5,0x1d5));var _0x5fce=function(_0x5df3ab,_0x4a0a7e){_0x5df3ab=_0x5df3ab-0x0;var _0x42cce5=_0xfce5[_0x5df3ab];return _0x42cce5;};'use strict';var Sequelize=require(_0x5fce('0x0'));module[_0x5fce('0x1')]={'name':{'type':Sequelize[_0x5fce('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x5fce('0x2')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0xb1b9=['exports','BOOLEAN'];(function(_0x430a84,_0x9b2ae){var _0x454377=function(_0x34da81){while(--_0x34da81){_0x430a84['push'](_0x430a84['shift']());}};_0x454377(++_0x9b2ae);}(_0xb1b9,0x186));var _0x9b1b=function(_0x2ddc5e,_0x4958ef){_0x2ddc5e=_0x2ddc5e-0x0;var _0xb196a0=_0xb1b9[_0x2ddc5e];return _0xb196a0;};'use strict';var Sequelize=require('sequelize');module[_0x9b1b('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0x9b1b('0x1')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index 945f825..3417b36 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 _0xe150=['util','path','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','save','update','then','stack','name','send','index','map','ChatGroup','rawAttributes','fieldName','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','findAll','rows','catch','show','includeAll','include','find','create','body','params','destroy','getUnread','user','toInteger','addMembers','getMembers','findOne','User','removeMembers','addMessage','ChatInternalMessage','getMessages','$gte','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','zip-dir','request-promise','moment','mustache'];(function(_0xe9ce81,_0x4d48bb){var _0x27c089=function(_0x27a214){while(--_0x27a214){_0xe9ce81['push'](_0xe9ce81['shift']());}};_0x27c089(++_0x4d48bb);}(_0xe150,0xb3));var _0x0e15=function(_0x3216f5,_0xe32e8a){_0x3216f5=_0x3216f5-0x0;var _0x17035a=_0xe150[_0x3216f5];return _0x17035a;};'use strict';var emlformat=require(_0x0e15('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0e15('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0e15('0x2'));var moment=require(_0x0e15('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0e15('0x4'));var util=require(_0x0e15('0x5'));var path=require(_0x0e15('0x6'));var sox=require('sox');var csv=require(_0x0e15('0x7'));var ejs=require(_0x0e15('0x8'));var fs=require('fs');var fs_extra=require(_0x0e15('0x9'));var _=require('lodash');var squel=require(_0x0e15('0xa'));var crypto=require('crypto');var jsforce=require(_0x0e15('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0e15('0x7'));var querystring=require(_0x0e15('0xc'));var Papa=require(_0x0e15('0xd'));var Redis=require(_0x0e15('0xe'));var authService=require(_0x0e15('0xf'));var qs=require(_0x0e15('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0e15('0x11'));var logger=require(_0x0e15('0x12'))(_0x0e15('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0e15('0x14'));var db=require(_0x0e15('0x15'))['db'];config[_0x0e15('0x16')]=_[_0x0e15('0x17')](config[_0x0e15('0x16')],{'host':_0x0e15('0x18'),'port':0x18eb});var socket=require(_0x0e15('0x19'))(new Redis(config[_0x0e15('0x16')]));require('./chatGroup.socket')['register'](socket);function respondWithStatusCode(_0x2b954a,_0x1581ef){_0x1581ef=_0x1581ef||0xcc;return function(_0x32878a){if(_0x32878a){return _0x2b954a[_0x0e15('0x1a')](_0x1581ef);}return _0x2b954a[_0x0e15('0x1b')](_0x1581ef)[_0x0e15('0x1c')]();};}function respondWithResult(_0x42b753,_0x1546f5){_0x1546f5=_0x1546f5||0xc8;return function(_0x5d0025){if(_0x5d0025){return _0x42b753[_0x0e15('0x1b')](_0x1546f5)[_0x0e15('0x1d')](_0x5d0025);}};}function respondWithFilteredResult(_0x178977,_0x5e4c8b){return function(_0x135981){if(_0x135981){var _0x2e5694=typeof _0x5e4c8b[_0x0e15('0x1e')]==='undefined'&&typeof _0x5e4c8b[_0x0e15('0x1f')]===_0x0e15('0x20');var _0x4b1689=_0x135981['count'];var _0x567235=_0x2e5694?0x0:_0x5e4c8b[_0x0e15('0x1e')];var _0x1dad43=_0x2e5694?_0x135981[_0x0e15('0x21')]:_0x5e4c8b[_0x0e15('0x1e')]+_0x5e4c8b[_0x0e15('0x1f')];var _0x1fd86c;if(_0x1dad43>=_0x4b1689){_0x1dad43=_0x4b1689;_0x1fd86c=0xc8;}else{_0x1fd86c=0xce;}_0x178977['status'](_0x1fd86c);return _0x178977[_0x0e15('0x22')](_0x0e15('0x23'),_0x567235+'-'+_0x1dad43+'/'+_0x4b1689)[_0x0e15('0x1d')](_0x135981);}return null;};}function patchUpdates(_0x4360ae){return function(_0x3f412d){try{jsonpatch['apply'](_0x3f412d,_0x4360ae,!![]);}catch(_0x36c841){return BPromise['reject'](_0x36c841);}return _0x3f412d[_0x0e15('0x24')]();};}function saveUpdates(_0x1a5f6c,_0x2e7222){return function(_0x3f4234){if(_0x3f4234){return _0x3f4234[_0x0e15('0x25')](_0x1a5f6c)[_0x0e15('0x26')](function(_0x26453a){return _0x26453a;});}return null;};}function removeEntity(_0x498731,_0x2f524d){return function(_0x876b2b){if(_0x876b2b){return _0x876b2b['destroy']()[_0x0e15('0x26')](function(){_0x498731[_0x0e15('0x1b')](0xcc)[_0x0e15('0x1c')]();});}};}function handleEntityNotFound(_0x26ac88,_0x5bce4d){return function(_0x27759b){if(!_0x27759b){_0x26ac88['sendStatus'](0x194);}return _0x27759b;};}function handleError(_0x4d81f1,_0x2dbe7a){_0x2dbe7a=_0x2dbe7a||0x1f4;return function(_0x10f372){logger['error'](_0x10f372[_0x0e15('0x27')]);if(_0x10f372[_0x0e15('0x28')]){delete _0x10f372[_0x0e15('0x28')];}_0x4d81f1[_0x0e15('0x1b')](_0x2dbe7a)[_0x0e15('0x29')](_0x10f372);};}exports[_0x0e15('0x2a')]=function(_0x445c18,_0x58db16){var _0x122af0={},_0x1cc483={},_0x1f8d35={'count':0x0,'rows':[]};var _0x5ee5a2=_[_0x0e15('0x2b')](db[_0x0e15('0x2c')][_0x0e15('0x2d')],function(_0x599927){return{'name':_0x599927[_0x0e15('0x2e')],'type':_0x599927['type'][_0x0e15('0x2f')]};});_0x1cc483['model']=_[_0x0e15('0x2b')](_0x5ee5a2,'name');_0x1cc483[_0x0e15('0x30')]=_[_0x0e15('0x31')](_0x445c18[_0x0e15('0x30')]);_0x1cc483[_0x0e15('0x32')]=_['intersection'](_0x1cc483[_0x0e15('0x33')],_0x1cc483['query']);_0x122af0[_0x0e15('0x34')]=_[_0x0e15('0x35')](_0x1cc483[_0x0e15('0x33')],qs['fields'](_0x445c18[_0x0e15('0x30')][_0x0e15('0x36')]));_0x122af0[_0x0e15('0x34')]=_0x122af0[_0x0e15('0x34')][_0x0e15('0x37')]?_0x122af0['attributes']:_0x1cc483[_0x0e15('0x33')];if(!_0x445c18[_0x0e15('0x30')][_0x0e15('0x38')](_0x0e15('0x39'))){_0x122af0[_0x0e15('0x1f')]=qs[_0x0e15('0x1f')](_0x445c18[_0x0e15('0x30')][_0x0e15('0x1f')]);_0x122af0[_0x0e15('0x1e')]=qs[_0x0e15('0x1e')](_0x445c18['query'][_0x0e15('0x1e')]);}_0x122af0[_0x0e15('0x3a')]=qs[_0x0e15('0x3b')](_0x445c18['query'][_0x0e15('0x3b')]);_0x122af0['where']=qs[_0x0e15('0x32')](_[_0x0e15('0x3c')](_0x445c18[_0x0e15('0x30')],_0x1cc483[_0x0e15('0x32')]),_0x5ee5a2);if(_0x445c18[_0x0e15('0x30')][_0x0e15('0x3d')]){_0x122af0[_0x0e15('0x3e')]=_[_0x0e15('0x3f')](_0x122af0[_0x0e15('0x3e')],{'$or':_[_0x0e15('0x2b')](_0x5ee5a2,function(_0x59844d){if(_0x59844d[_0x0e15('0x40')]!==_0x0e15('0x41')){var _0x55c928={};_0x55c928[_0x59844d[_0x0e15('0x28')]]={'$like':'%'+_0x445c18[_0x0e15('0x30')][_0x0e15('0x3d')]+'%'};return _0x55c928;}})});}_0x122af0=_['merge']({},_0x122af0,_0x445c18[_0x0e15('0x42')]);var _0x364e19={'where':_0x122af0[_0x0e15('0x3e')]};return db[_0x0e15('0x2c')][_0x0e15('0x21')](_0x364e19)[_0x0e15('0x26')](function(_0x5d1500){_0x1f8d35[_0x0e15('0x21')]=_0x5d1500;if(_0x445c18[_0x0e15('0x30')]['includeAll']){_0x122af0['include']=[{'all':!![]}];}return db[_0x0e15('0x2c')][_0x0e15('0x43')](_0x122af0);})[_0x0e15('0x26')](function(_0x2e3348){_0x1f8d35[_0x0e15('0x44')]=_0x2e3348;return _0x1f8d35;})['then'](respondWithFilteredResult(_0x58db16,_0x122af0))[_0x0e15('0x45')](handleError(_0x58db16,null));};exports[_0x0e15('0x46')]=function(_0x274752,_0x576711){var _0x544994={'raw':!![],'where':{'id':_0x274752['params']['id']}},_0x199de1={};_0x199de1['model']=_[_0x0e15('0x31')](db[_0x0e15('0x2c')][_0x0e15('0x2d')]);_0x199de1[_0x0e15('0x30')]=_['keys'](_0x274752[_0x0e15('0x30')]);_0x199de1[_0x0e15('0x32')]=_[_0x0e15('0x35')](_0x199de1[_0x0e15('0x33')],_0x199de1[_0x0e15('0x30')]);_0x544994[_0x0e15('0x34')]=_[_0x0e15('0x35')](_0x199de1[_0x0e15('0x33')],qs[_0x0e15('0x36')](_0x274752['query'][_0x0e15('0x36')]));_0x544994[_0x0e15('0x34')]=_0x544994['attributes'][_0x0e15('0x37')]?_0x544994['attributes']:_0x199de1[_0x0e15('0x33')];if(_0x274752['query'][_0x0e15('0x47')]){_0x544994[_0x0e15('0x48')]=[{'all':!![]}];}_0x544994=_[_0x0e15('0x3f')]({},_0x544994,_0x274752['options']);return db[_0x0e15('0x2c')][_0x0e15('0x49')](_0x544994)[_0x0e15('0x26')](handleEntityNotFound(_0x576711,null))[_0x0e15('0x26')](respondWithResult(_0x576711,null))['catch'](handleError(_0x576711,null));};exports[_0x0e15('0x4a')]=function(_0x51951f,_0x491428){return db[_0x0e15('0x2c')][_0x0e15('0x4a')](_0x51951f[_0x0e15('0x4b')],{})[_0x0e15('0x26')](respondWithResult(_0x491428,0xc9))[_0x0e15('0x45')](handleError(_0x491428,null));};exports[_0x0e15('0x25')]=function(_0x4b64ea,_0x43ea03){if(_0x4b64ea[_0x0e15('0x4b')]['id']){delete _0x4b64ea[_0x0e15('0x4b')]['id'];}return db[_0x0e15('0x2c')][_0x0e15('0x49')]({'where':{'id':_0x4b64ea[_0x0e15('0x4c')]['id']}})[_0x0e15('0x26')](handleEntityNotFound(_0x43ea03,null))[_0x0e15('0x26')](saveUpdates(_0x4b64ea[_0x0e15('0x4b')],null))[_0x0e15('0x26')](respondWithResult(_0x43ea03,null))['catch'](handleError(_0x43ea03,null));};exports[_0x0e15('0x4d')]=function(_0x349454,_0x2b945c){return db[_0x0e15('0x2c')][_0x0e15('0x49')]({'where':{'id':_0x349454[_0x0e15('0x4c')]['id']}})[_0x0e15('0x26')](handleEntityNotFound(_0x2b945c,null))[_0x0e15('0x26')](removeEntity(_0x2b945c,null))[_0x0e15('0x45')](handleError(_0x2b945c,null));};exports['describe']=function(_0x3e4d92,_0x164da4){return db[_0x0e15('0x2c')]['describe']()[_0x0e15('0x26')](respondWithResult(_0x164da4,null))[_0x0e15('0x45')](handleError(_0x164da4,null));};exports[_0x0e15('0x4e')]=function(_0x51d38d,_0x5e9a52,_0x494299){return db['ChatInternalMessage'][_0x0e15('0x21')]({'where':{'ChatGroupId':_0x51d38d['params']['id'],'ToId':_0x51d38d[_0x0e15('0x4f')]['id'],'read':![]}})[_0x0e15('0x26')](function(_0x41df40){return{'id':_[_0x0e15('0x50')](_0x51d38d['params']['id']),'count':_0x41df40};})[_0x0e15('0x26')](respondWithResult(_0x5e9a52,null))['catch'](handleError(_0x5e9a52,null));};exports[_0x0e15('0x51')]=function(_0x13a459,_0x1b1e84,_0x44d177){return db[_0x0e15('0x2c')][_0x0e15('0x49')]({'where':{'id':_0x13a459['params']['id']}})[_0x0e15('0x26')](handleEntityNotFound(_0x1b1e84,null))[_0x0e15('0x26')](function(_0x419492){if(_0x419492){return _0x419492['addMembers'](_0x13a459[_0x0e15('0x4b')]['ids'],_['omit'](_0x13a459['body'],['ids','id'])||{});}})[_0x0e15('0x26')](respondWithResult(_0x1b1e84,null))[_0x0e15('0x45')](handleError(_0x1b1e84,null));};exports[_0x0e15('0x52')]=function(_0x2bc9d8,_0x47cd83,_0x553a75){var _0x28e917={};var _0x2efb3e={};var _0x31f10c;var _0xe828ac;return db[_0x0e15('0x2c')][_0x0e15('0x53')]({'where':{'id':_0x2bc9d8['params']['id']}})['then'](handleEntityNotFound(_0x47cd83,null))[_0x0e15('0x26')](function(_0x1c11e5){if(_0x1c11e5){_0x31f10c=_0x1c11e5;_0x2efb3e['model']=_[_0x0e15('0x31')](db[_0x0e15('0x54')][_0x0e15('0x2d')]);_0x2efb3e[_0x0e15('0x30')]=_[_0x0e15('0x31')](_0x2bc9d8['query']);_0x2efb3e['filters']=_[_0x0e15('0x35')](_0x2efb3e[_0x0e15('0x33')],_0x2efb3e[_0x0e15('0x30')]);_0x28e917[_0x0e15('0x34')]=_[_0x0e15('0x35')](_0x2efb3e[_0x0e15('0x33')],qs['fields'](_0x2bc9d8[_0x0e15('0x30')][_0x0e15('0x36')]));_0x28e917[_0x0e15('0x34')]=_0x28e917[_0x0e15('0x34')][_0x0e15('0x37')]?_0x28e917[_0x0e15('0x34')]:_0x2efb3e[_0x0e15('0x33')];_0x28e917['order']=qs[_0x0e15('0x3b')](_0x2bc9d8[_0x0e15('0x30')][_0x0e15('0x3b')]);_0x28e917[_0x0e15('0x3e')]=qs[_0x0e15('0x32')](_[_0x0e15('0x3c')](_0x2bc9d8[_0x0e15('0x30')],_0x2efb3e[_0x0e15('0x32')]));if(_0x2bc9d8[_0x0e15('0x30')][_0x0e15('0x3d')]){_0x28e917[_0x0e15('0x3e')]=_[_0x0e15('0x3f')](_0x28e917[_0x0e15('0x3e')],{'$or':_['map'](_0x28e917['attributes'],function(_0x50f21d){var _0x31c5cf={};_0x31c5cf[_0x50f21d]={'$like':'%'+_0x2bc9d8['query'][_0x0e15('0x3d')]+'%'};return _0x31c5cf;})});}_0x28e917=_['merge']({},_0x28e917,_0x2bc9d8[_0x0e15('0x42')]);return _0x31f10c[_0x0e15('0x52')](_0x28e917);}})[_0x0e15('0x26')](function(_0x5acc18){if(_0x5acc18){_0xe828ac=_0x5acc18['length'];if(!_0x2bc9d8['query'][_0x0e15('0x38')](_0x0e15('0x39'))){_0x28e917[_0x0e15('0x1f')]=qs[_0x0e15('0x1f')](_0x2bc9d8['query'][_0x0e15('0x1f')]);_0x28e917[_0x0e15('0x1e')]=qs[_0x0e15('0x1e')](_0x2bc9d8['query']['offset']);}return _0x31f10c[_0x0e15('0x52')](_0x28e917);}})['then'](function(_0x3d3dae){if(_0x3d3dae){return _0x3d3dae?{'count':_0xe828ac,'rows':_0x3d3dae}:null;}})[_0x0e15('0x26')](respondWithResult(_0x47cd83,null))[_0x0e15('0x45')](handleError(_0x47cd83,null));};exports[_0x0e15('0x55')]=function(_0x54581e,_0x391078,_0x1ffad2){return db[_0x0e15('0x2c')][_0x0e15('0x49')]({'where':{'id':_0x54581e['params']['id']}})['then'](handleEntityNotFound(_0x391078,null))['then'](function(_0x3406ea){if(_0x3406ea){return _0x3406ea['removeMembers'](_0x54581e['query']['ids']);}})[_0x0e15('0x26')](respondWithStatusCode(_0x391078,null))[_0x0e15('0x45')](handleError(_0x391078,null));};exports[_0x0e15('0x56')]=function(_0x411f94,_0x50e23e,_0x175768){if(_0x411f94[_0x0e15('0x4b')]['id']){delete _0x411f94['body']['id'];}return db['ChatGroup']['find']({'where':{'id':_0x411f94[_0x0e15('0x4c')]['id']}})[_0x0e15('0x26')](handleEntityNotFound(_0x50e23e,null))[_0x0e15('0x26')](function(_0xfc4930){if(_0xfc4930){_0x411f94[_0x0e15('0x4b')]['ChatGroupId']=_0xfc4930['id'];return db[_0x0e15('0x57')]['create'](_0x411f94[_0x0e15('0x4b')]);}})[_0x0e15('0x26')](respondWithResult(_0x50e23e,null))['catch'](handleError(_0x50e23e,null));};exports[_0x0e15('0x58')]=function(_0x31c1c0,_0x1f54c3,_0x3e069f){var _0x3cacd3={};var _0x40e03e={};var _0xa9f77a;var _0xfbe72d;return db[_0x0e15('0x2c')]['findOne']({'where':{'id':_0x31c1c0['params']['id']}})[_0x0e15('0x26')](handleEntityNotFound(_0x1f54c3,null))[_0x0e15('0x26')](function(_0x5b6722){if(_0x5b6722){_0xa9f77a=_0x5b6722;_0x40e03e['model']=_['keys'](db[_0x0e15('0x57')]['rawAttributes']);_0x40e03e['query']=_[_0x0e15('0x31')](_0x31c1c0['query']);_0x40e03e[_0x0e15('0x32')]=_['intersection'](_0x40e03e[_0x0e15('0x33')],_0x40e03e[_0x0e15('0x30')]);_0x3cacd3[_0x0e15('0x34')]=_[_0x0e15('0x35')](_0x40e03e[_0x0e15('0x33')],qs[_0x0e15('0x36')](_0x31c1c0['query'][_0x0e15('0x36')]));_0x3cacd3['attributes']=_0x3cacd3[_0x0e15('0x34')][_0x0e15('0x37')]?_0x3cacd3[_0x0e15('0x34')]:_0x40e03e[_0x0e15('0x33')];_0x3cacd3[_0x0e15('0x3a')]=qs[_0x0e15('0x3b')](_0x31c1c0[_0x0e15('0x30')][_0x0e15('0x3b')]);_0x3cacd3[_0x0e15('0x3e')]=qs[_0x0e15('0x32')](_['pick'](_0x31c1c0[_0x0e15('0x30')],_0x40e03e[_0x0e15('0x32')]));if(_0x31c1c0[_0x0e15('0x30')][_0x0e15('0x3d')]){_0x3cacd3[_0x0e15('0x3e')]=_['merge'](_0x3cacd3[_0x0e15('0x3e')],{'$or':_[_0x0e15('0x2b')](_0x3cacd3['attributes'],function(_0x459b61){var _0xeab4e3={};_0xeab4e3[_0x459b61]={'$like':'%'+_0x31c1c0['query'][_0x0e15('0x3d')]+'%'};return _0xeab4e3;})});}if(_0x31c1c0[_0x0e15('0x30')][_0x0e15('0x59')]){var _0x234b23=_0x31c1c0[_0x0e15('0x30')][_0x0e15('0x59')]['split'](',');var _0x1ae245={};_0x1ae245[_0x234b23[0x0]]={'$gte':moment(_0x234b23[0x1])[_0x0e15('0x5a')](_0x0e15('0x5b'))};_0x3cacd3[_0x0e15('0x3e')]=_['merge'](_0x3cacd3[_0x0e15('0x3e')],_0x1ae245);}_0x3cacd3=_[_0x0e15('0x3f')]({},_0x3cacd3,_0x31c1c0[_0x0e15('0x42')]);return _0xa9f77a[_0x0e15('0x58')](_0x3cacd3);}})['then'](function(_0x29f4ba){if(_0x29f4ba){_0xfbe72d=_0x29f4ba[_0x0e15('0x37')];if(!_0x31c1c0[_0x0e15('0x30')][_0x0e15('0x38')](_0x0e15('0x39'))){_0x3cacd3[_0x0e15('0x1f')]=qs[_0x0e15('0x1f')](_0x31c1c0[_0x0e15('0x30')][_0x0e15('0x1f')]);_0x3cacd3[_0x0e15('0x1e')]=qs[_0x0e15('0x1e')](_0x31c1c0['query'][_0x0e15('0x1e')]);}return _0xa9f77a[_0x0e15('0x58')](_0x3cacd3);}})['then'](function(_0x605dcf){if(_0x605dcf){return _0x605dcf?{'count':_0xfbe72d,'rows':_0x605dcf}:null;}})[_0x0e15('0x26')](respondWithResult(_0x1f54c3,null))['catch'](handleError(_0x1f54c3,null));}; \ No newline at end of file +var _0x039a=['VIRTUAL','options','include','rows','catch','show','params','find','create','body','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','getMembers','findOne','order','removeMembers','ids','addMessage','ChatGroupId','getMessages','$gte','YYYY-MM-DD\x20HH:mm:ss','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','./chatGroup.socket','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','error','name','send','map','ChatGroup','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','type'];(function(_0x14a8c3,_0x3c7e62){var _0x3c1898=function(_0x1581f9){while(--_0x1581f9){_0x14a8c3['push'](_0x14a8c3['shift']());}};_0x3c1898(++_0x3c7e62);}(_0x039a,0x78));var _0xa039=function(_0x44e4f8,_0x4af8bd){_0x44e4f8=_0x44e4f8-0x0;var _0x310967=_0x039a[_0x44e4f8];return _0x310967;};'use strict';var emlformat=require(_0xa039('0x0'));var rimraf=require(_0xa039('0x1'));var zipdir=require(_0xa039('0x2'));var jsonpatch=require(_0xa039('0x3'));var rp=require(_0xa039('0x4'));var moment=require(_0xa039('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xa039('0x6'));var util=require(_0xa039('0x7'));var path=require(_0xa039('0x8'));var sox=require('sox');var csv=require(_0xa039('0x9'));var ejs=require(_0xa039('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa039('0xb'));var squel=require(_0xa039('0xc'));var crypto=require('crypto');var jsforce=require(_0xa039('0xd'));var deskjs=require(_0xa039('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa039('0xf'));var Papa=require('papaparse');var Redis=require(_0xa039('0x10'));var authService=require(_0xa039('0x11'));var qs=require(_0xa039('0x12'));var as=require(_0xa039('0x13'));var hardwareService=require(_0xa039('0x14'));var logger=require(_0xa039('0x15'))(_0xa039('0x16'));var utils=require(_0xa039('0x17'));var config=require(_0xa039('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xa039('0x19'))['db'];config[_0xa039('0x1a')]=_[_0xa039('0x1b')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa039('0x1a')]));require(_0xa039('0x1c'))['register'](socket);function respondWithStatusCode(_0x3b09ba,_0x205a3f){_0x205a3f=_0x205a3f||0xcc;return function(_0x47585b){if(_0x47585b){return _0x3b09ba[_0xa039('0x1d')](_0x205a3f);}return _0x3b09ba[_0xa039('0x1e')](_0x205a3f)[_0xa039('0x1f')]();};}function respondWithResult(_0x21a2d8,_0x341d5b){_0x341d5b=_0x341d5b||0xc8;return function(_0x28e341){if(_0x28e341){return _0x21a2d8[_0xa039('0x1e')](_0x341d5b)[_0xa039('0x20')](_0x28e341);}};}function respondWithFilteredResult(_0x2ee7f5,_0x2d2a6f){return function(_0x2912c5){if(_0x2912c5){var _0x420835=typeof _0x2d2a6f[_0xa039('0x21')]===_0xa039('0x22')&&typeof _0x2d2a6f[_0xa039('0x23')]===_0xa039('0x22');var _0x168038=_0x2912c5['count'];var _0x3cec19=_0x420835?0x0:_0x2d2a6f[_0xa039('0x21')];var _0x471a0c=_0x420835?_0x2912c5[_0xa039('0x24')]:_0x2d2a6f['offset']+_0x2d2a6f[_0xa039('0x23')];var _0x53029c;if(_0x471a0c>=_0x168038){_0x471a0c=_0x168038;_0x53029c=0xc8;}else{_0x53029c=0xce;}_0x2ee7f5[_0xa039('0x1e')](_0x53029c);return _0x2ee7f5['set'](_0xa039('0x25'),_0x3cec19+'-'+_0x471a0c+'/'+_0x168038)[_0xa039('0x20')](_0x2912c5);}return null;};}function patchUpdates(_0x27b70f){return function(_0x27e759){try{jsonpatch[_0xa039('0x26')](_0x27e759,_0x27b70f,!![]);}catch(_0x402b2f){return BPromise[_0xa039('0x27')](_0x402b2f);}return _0x27e759[_0xa039('0x28')]();};}function saveUpdates(_0xa2ebb9,_0x19745b){return function(_0x2e7011){if(_0x2e7011){return _0x2e7011[_0xa039('0x29')](_0xa2ebb9)[_0xa039('0x2a')](function(_0x5511df){return _0x5511df;});}return null;};}function removeEntity(_0x2400c3,_0xb317ed){return function(_0x163372){if(_0x163372){return _0x163372['destroy']()[_0xa039('0x2a')](function(){_0x2400c3[_0xa039('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x42d602,_0xc7463d){return function(_0x47c1f3){if(!_0x47c1f3){_0x42d602['sendStatus'](0x194);}return _0x47c1f3;};}function handleError(_0x5a68b0,_0x280d80){_0x280d80=_0x280d80||0x1f4;return function(_0x432e33){logger[_0xa039('0x2b')](_0x432e33['stack']);if(_0x432e33[_0xa039('0x2c')]){delete _0x432e33[_0xa039('0x2c')];}_0x5a68b0[_0xa039('0x1e')](_0x280d80)[_0xa039('0x2d')](_0x432e33);};}exports['index']=function(_0x4d39b2,_0x289399){var _0x4db35c={},_0x56cb51={},_0x1c0fdf={'count':0x0,'rows':[]};var _0x90aa3=_[_0xa039('0x2e')](db[_0xa039('0x2f')][_0xa039('0x30')],function(_0x55efaa){return{'name':_0x55efaa[_0xa039('0x31')],'type':_0x55efaa['type'][_0xa039('0x32')]};});_0x56cb51[_0xa039('0x33')]=_['map'](_0x90aa3,_0xa039('0x2c'));_0x56cb51[_0xa039('0x34')]=_[_0xa039('0x35')](_0x4d39b2[_0xa039('0x34')]);_0x56cb51[_0xa039('0x36')]=_[_0xa039('0x37')](_0x56cb51[_0xa039('0x33')],_0x56cb51[_0xa039('0x34')]);_0x4db35c[_0xa039('0x38')]=_[_0xa039('0x37')](_0x56cb51['model'],qs['fields'](_0x4d39b2['query'][_0xa039('0x39')]));_0x4db35c[_0xa039('0x38')]=_0x4db35c[_0xa039('0x38')][_0xa039('0x3a')]?_0x4db35c[_0xa039('0x38')]:_0x56cb51['model'];if(!_0x4d39b2[_0xa039('0x34')][_0xa039('0x3b')]('nolimit')){_0x4db35c['limit']=qs[_0xa039('0x23')](_0x4d39b2[_0xa039('0x34')][_0xa039('0x23')]);_0x4db35c['offset']=qs[_0xa039('0x21')](_0x4d39b2['query'][_0xa039('0x21')]);}_0x4db35c['order']=qs[_0xa039('0x3c')](_0x4d39b2['query'][_0xa039('0x3c')]);_0x4db35c[_0xa039('0x3d')]=qs[_0xa039('0x36')](_[_0xa039('0x3e')](_0x4d39b2[_0xa039('0x34')],_0x56cb51[_0xa039('0x36')]),_0x90aa3);if(_0x4d39b2[_0xa039('0x34')][_0xa039('0x3f')]){_0x4db35c[_0xa039('0x3d')]=_[_0xa039('0x40')](_0x4db35c[_0xa039('0x3d')],{'$or':_[_0xa039('0x2e')](_0x90aa3,function(_0x4a24e1){if(_0x4a24e1[_0xa039('0x41')]!==_0xa039('0x42')){var _0x228747={};_0x228747[_0x4a24e1[_0xa039('0x2c')]]={'$like':'%'+_0x4d39b2['query']['filter']+'%'};return _0x228747;}})});}_0x4db35c=_[_0xa039('0x40')]({},_0x4db35c,_0x4d39b2[_0xa039('0x43')]);var _0x2ea838={'where':_0x4db35c['where']};return db['ChatGroup']['count'](_0x2ea838)[_0xa039('0x2a')](function(_0x299e00){_0x1c0fdf['count']=_0x299e00;if(_0x4d39b2['query']['includeAll']){_0x4db35c[_0xa039('0x44')]=[{'all':!![]}];}return db[_0xa039('0x2f')]['findAll'](_0x4db35c);})[_0xa039('0x2a')](function(_0x1fe4f1){_0x1c0fdf[_0xa039('0x45')]=_0x1fe4f1;return _0x1c0fdf;})['then'](respondWithFilteredResult(_0x289399,_0x4db35c))[_0xa039('0x46')](handleError(_0x289399,null));};exports[_0xa039('0x47')]=function(_0x1d211a,_0x417be4){var _0x59fa1b={'raw':!![],'where':{'id':_0x1d211a[_0xa039('0x48')]['id']}},_0x11674a={};_0x11674a[_0xa039('0x33')]=_['keys'](db['ChatGroup'][_0xa039('0x30')]);_0x11674a['query']=_[_0xa039('0x35')](_0x1d211a[_0xa039('0x34')]);_0x11674a[_0xa039('0x36')]=_['intersection'](_0x11674a['model'],_0x11674a['query']);_0x59fa1b['attributes']=_[_0xa039('0x37')](_0x11674a[_0xa039('0x33')],qs[_0xa039('0x39')](_0x1d211a[_0xa039('0x34')][_0xa039('0x39')]));_0x59fa1b[_0xa039('0x38')]=_0x59fa1b[_0xa039('0x38')][_0xa039('0x3a')]?_0x59fa1b[_0xa039('0x38')]:_0x11674a[_0xa039('0x33')];if(_0x1d211a[_0xa039('0x34')]['includeAll']){_0x59fa1b[_0xa039('0x44')]=[{'all':!![]}];}_0x59fa1b=_[_0xa039('0x40')]({},_0x59fa1b,_0x1d211a[_0xa039('0x43')]);return db['ChatGroup'][_0xa039('0x49')](_0x59fa1b)['then'](handleEntityNotFound(_0x417be4,null))[_0xa039('0x2a')](respondWithResult(_0x417be4,null))['catch'](handleError(_0x417be4,null));};exports[_0xa039('0x4a')]=function(_0x1a0691,_0x7a9916){return db[_0xa039('0x2f')][_0xa039('0x4a')](_0x1a0691[_0xa039('0x4b')],{})['then'](respondWithResult(_0x7a9916,0xc9))['catch'](handleError(_0x7a9916,null));};exports[_0xa039('0x29')]=function(_0x5c5d75,_0x297942){if(_0x5c5d75[_0xa039('0x4b')]['id']){delete _0x5c5d75['body']['id'];}return db[_0xa039('0x2f')][_0xa039('0x49')]({'where':{'id':_0x5c5d75[_0xa039('0x48')]['id']}})[_0xa039('0x2a')](handleEntityNotFound(_0x297942,null))[_0xa039('0x2a')](saveUpdates(_0x5c5d75['body'],null))[_0xa039('0x2a')](respondWithResult(_0x297942,null))[_0xa039('0x46')](handleError(_0x297942,null));};exports['destroy']=function(_0x42d6e6,_0x53264c){return db['ChatGroup'][_0xa039('0x49')]({'where':{'id':_0x42d6e6[_0xa039('0x48')]['id']}})[_0xa039('0x2a')](handleEntityNotFound(_0x53264c,null))[_0xa039('0x2a')](removeEntity(_0x53264c,null))['catch'](handleError(_0x53264c,null));};exports[_0xa039('0x4c')]=function(_0x541002,_0x1e5b1e){return db['ChatGroup']['describe']()[_0xa039('0x2a')](respondWithResult(_0x1e5b1e,null))[_0xa039('0x46')](handleError(_0x1e5b1e,null));};exports[_0xa039('0x4d')]=function(_0x2786b8,_0x6efd9c,_0x127c41){return db[_0xa039('0x4e')]['count']({'where':{'ChatGroupId':_0x2786b8[_0xa039('0x48')]['id'],'ToId':_0x2786b8[_0xa039('0x4f')]['id'],'read':![]}})['then'](function(_0x3965ae){return{'id':_[_0xa039('0x50')](_0x2786b8[_0xa039('0x48')]['id']),'count':_0x3965ae};})[_0xa039('0x2a')](respondWithResult(_0x6efd9c,null))[_0xa039('0x46')](handleError(_0x6efd9c,null));};exports[_0xa039('0x51')]=function(_0x5f519c,_0x178e92,_0x30071d){return db[_0xa039('0x2f')][_0xa039('0x49')]({'where':{'id':_0x5f519c[_0xa039('0x48')]['id']}})['then'](handleEntityNotFound(_0x178e92,null))['then'](function(_0x34ac32){if(_0x34ac32){return _0x34ac32['addMembers'](_0x5f519c['body']['ids'],_['omit'](_0x5f519c[_0xa039('0x4b')],['ids','id'])||{});}})[_0xa039('0x2a')](respondWithResult(_0x178e92,null))[_0xa039('0x46')](handleError(_0x178e92,null));};exports[_0xa039('0x52')]=function(_0x91d885,_0x183d00,_0x245623){var _0x58b67a={};var _0x5e6162={};var _0xae1cf4;var _0x5182f5;return db[_0xa039('0x2f')][_0xa039('0x53')]({'where':{'id':_0x91d885['params']['id']}})[_0xa039('0x2a')](handleEntityNotFound(_0x183d00,null))[_0xa039('0x2a')](function(_0x341df2){if(_0x341df2){_0xae1cf4=_0x341df2;_0x5e6162['model']=_[_0xa039('0x35')](db['User']['rawAttributes']);_0x5e6162[_0xa039('0x34')]=_[_0xa039('0x35')](_0x91d885[_0xa039('0x34')]);_0x5e6162['filters']=_[_0xa039('0x37')](_0x5e6162[_0xa039('0x33')],_0x5e6162[_0xa039('0x34')]);_0x58b67a[_0xa039('0x38')]=_[_0xa039('0x37')](_0x5e6162[_0xa039('0x33')],qs[_0xa039('0x39')](_0x91d885['query'][_0xa039('0x39')]));_0x58b67a[_0xa039('0x38')]=_0x58b67a[_0xa039('0x38')]['length']?_0x58b67a['attributes']:_0x5e6162[_0xa039('0x33')];_0x58b67a[_0xa039('0x54')]=qs[_0xa039('0x3c')](_0x91d885[_0xa039('0x34')]['sort']);_0x58b67a[_0xa039('0x3d')]=qs[_0xa039('0x36')](_[_0xa039('0x3e')](_0x91d885[_0xa039('0x34')],_0x5e6162[_0xa039('0x36')]));if(_0x91d885[_0xa039('0x34')][_0xa039('0x3f')]){_0x58b67a['where']=_[_0xa039('0x40')](_0x58b67a[_0xa039('0x3d')],{'$or':_[_0xa039('0x2e')](_0x58b67a[_0xa039('0x38')],function(_0x5d0e25){var _0x38ad93={};_0x38ad93[_0x5d0e25]={'$like':'%'+_0x91d885[_0xa039('0x34')][_0xa039('0x3f')]+'%'};return _0x38ad93;})});}_0x58b67a=_['merge']({},_0x58b67a,_0x91d885[_0xa039('0x43')]);return _0xae1cf4[_0xa039('0x52')](_0x58b67a);}})[_0xa039('0x2a')](function(_0x9e463c){if(_0x9e463c){_0x5182f5=_0x9e463c[_0xa039('0x3a')];if(!_0x91d885[_0xa039('0x34')][_0xa039('0x3b')]('nolimit')){_0x58b67a['limit']=qs['limit'](_0x91d885['query'][_0xa039('0x23')]);_0x58b67a[_0xa039('0x21')]=qs[_0xa039('0x21')](_0x91d885['query'][_0xa039('0x21')]);}return _0xae1cf4[_0xa039('0x52')](_0x58b67a);}})['then'](function(_0x3b9076){if(_0x3b9076){return _0x3b9076?{'count':_0x5182f5,'rows':_0x3b9076}:null;}})[_0xa039('0x2a')](respondWithResult(_0x183d00,null))['catch'](handleError(_0x183d00,null));};exports[_0xa039('0x55')]=function(_0x416336,_0x1e19d7,_0x27ed4c){return db[_0xa039('0x2f')]['find']({'where':{'id':_0x416336[_0xa039('0x48')]['id']}})['then'](handleEntityNotFound(_0x1e19d7,null))[_0xa039('0x2a')](function(_0x241dd8){if(_0x241dd8){return _0x241dd8[_0xa039('0x55')](_0x416336[_0xa039('0x34')][_0xa039('0x56')]);}})[_0xa039('0x2a')](respondWithStatusCode(_0x1e19d7,null))['catch'](handleError(_0x1e19d7,null));};exports[_0xa039('0x57')]=function(_0x383a92,_0x24fc74,_0x1250c0){if(_0x383a92[_0xa039('0x4b')]['id']){delete _0x383a92[_0xa039('0x4b')]['id'];}return db[_0xa039('0x2f')][_0xa039('0x49')]({'where':{'id':_0x383a92['params']['id']}})['then'](handleEntityNotFound(_0x24fc74,null))[_0xa039('0x2a')](function(_0x31e3d9){if(_0x31e3d9){_0x383a92[_0xa039('0x4b')][_0xa039('0x58')]=_0x31e3d9['id'];return db[_0xa039('0x4e')][_0xa039('0x4a')](_0x383a92[_0xa039('0x4b')]);}})['then'](respondWithResult(_0x24fc74,null))['catch'](handleError(_0x24fc74,null));};exports[_0xa039('0x59')]=function(_0x4addb4,_0x1a1868,_0xdd13fb){var _0x612478={};var _0x2b2b88={};var _0x582f60;var _0x19c745;return db[_0xa039('0x2f')][_0xa039('0x53')]({'where':{'id':_0x4addb4['params']['id']}})[_0xa039('0x2a')](handleEntityNotFound(_0x1a1868,null))[_0xa039('0x2a')](function(_0x2dba84){if(_0x2dba84){_0x582f60=_0x2dba84;_0x2b2b88['model']=_['keys'](db[_0xa039('0x4e')][_0xa039('0x30')]);_0x2b2b88[_0xa039('0x34')]=_[_0xa039('0x35')](_0x4addb4[_0xa039('0x34')]);_0x2b2b88[_0xa039('0x36')]=_[_0xa039('0x37')](_0x2b2b88[_0xa039('0x33')],_0x2b2b88[_0xa039('0x34')]);_0x612478[_0xa039('0x38')]=_[_0xa039('0x37')](_0x2b2b88[_0xa039('0x33')],qs[_0xa039('0x39')](_0x4addb4[_0xa039('0x34')][_0xa039('0x39')]));_0x612478[_0xa039('0x38')]=_0x612478[_0xa039('0x38')][_0xa039('0x3a')]?_0x612478['attributes']:_0x2b2b88[_0xa039('0x33')];_0x612478['order']=qs[_0xa039('0x3c')](_0x4addb4['query'][_0xa039('0x3c')]);_0x612478[_0xa039('0x3d')]=qs[_0xa039('0x36')](_['pick'](_0x4addb4[_0xa039('0x34')],_0x2b2b88['filters']));if(_0x4addb4[_0xa039('0x34')]['filter']){_0x612478[_0xa039('0x3d')]=_[_0xa039('0x40')](_0x612478[_0xa039('0x3d')],{'$or':_['map'](_0x612478[_0xa039('0x38')],function(_0xca3525){var _0x38eddb={};_0x38eddb[_0xca3525]={'$like':'%'+_0x4addb4['query'][_0xa039('0x3f')]+'%'};return _0x38eddb;})});}if(_0x4addb4[_0xa039('0x34')][_0xa039('0x5a')]){var _0x5f0ac9=_0x4addb4[_0xa039('0x34')][_0xa039('0x5a')]['split'](',');var _0x1e4d9c={};_0x1e4d9c[_0x5f0ac9[0x0]]={'$gte':moment(_0x5f0ac9[0x1])['format'](_0xa039('0x5b'))};_0x612478['where']=_['merge'](_0x612478['where'],_0x1e4d9c);}_0x612478=_[_0xa039('0x40')]({},_0x612478,_0x4addb4['options']);return _0x582f60[_0xa039('0x59')](_0x612478);}})[_0xa039('0x2a')](function(_0x52c48f){if(_0x52c48f){_0x19c745=_0x52c48f['length'];if(!_0x4addb4[_0xa039('0x34')][_0xa039('0x3b')](_0xa039('0x5c'))){_0x612478[_0xa039('0x23')]=qs[_0xa039('0x23')](_0x4addb4[_0xa039('0x34')][_0xa039('0x23')]);_0x612478[_0xa039('0x21')]=qs['offset'](_0x4addb4[_0xa039('0x34')][_0xa039('0x21')]);}return _0x582f60['getMessages'](_0x612478);}})['then'](function(_0x8d4356){if(_0x8d4356){return _0x8d4356?{'count':_0x19c745,'rows':_0x8d4356}:null;}})[_0xa039('0x2a')](respondWithResult(_0x1a1868,null))[_0xa039('0x46')](handleError(_0x1a1868,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 8f6be04..7303283 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 _0x8512=['hook','exports','events','../../mysqldb','ChatGroup','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x3ce3c,_0x319337){var _0x55a2c9=function(_0x1568d0){while(--_0x1568d0){_0x3ce3c['push'](_0x3ce3c['shift']());}};_0x55a2c9(++_0x319337);}(_0x8512,0x70));var _0x2851=function(_0x7af2ae,_0x846e8a){_0x7af2ae=_0x7af2ae-0x0;var _0x17a7c5=_0x8512[_0x7af2ae];return _0x17a7c5;};'use strict';var EventEmitter=require(_0x2851('0x0'));var ChatGroup=require(_0x2851('0x1'))['db'][_0x2851('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x2851('0x3')](0x0);var events={'afterCreate':_0x2851('0x4'),'afterUpdate':_0x2851('0x5'),'afterDestroy':_0x2851('0x6')};function emitEvent(_0x28fcac){return function(_0x138d42,_0x550320,_0x58bf75){ChatGroupEvents[_0x2851('0x7')](_0x28fcac+':'+_0x138d42['id'],_0x138d42);ChatGroupEvents['emit'](_0x28fcac,_0x138d42);_0x58bf75(null);};}for(var e in events){if(events[_0x2851('0x8')](e)){var event=events[e];ChatGroup[_0x2851('0x9')](e,emitEvent(event));}}module[_0x2851('0xa')]=ChatGroupEvents; \ No newline at end of file +var _0xcf96=['hook','exports','events','ChatGroup','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x59bab9,_0x518fa0){var _0x1fb1ed=function(_0x5b558f){while(--_0x5b558f){_0x59bab9['push'](_0x59bab9['shift']());}};_0x1fb1ed(++_0x518fa0);}(_0xcf96,0xf5));var _0x6cf9=function(_0x12ef39,_0x18d320){_0x12ef39=_0x12ef39-0x0;var _0x47a734=_0xcf96[_0x12ef39];return _0x47a734;};'use strict';var EventEmitter=require(_0x6cf9('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0x6cf9('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x6cf9('0x2')](0x0);var events={'afterCreate':_0x6cf9('0x3'),'afterUpdate':_0x6cf9('0x4'),'afterDestroy':'remove'};function emitEvent(_0x15481e){return function(_0x1fcd2a,_0x38adf0,_0x26dfc2){ChatGroupEvents['emit'](_0x15481e+':'+_0x1fcd2a['id'],_0x1fcd2a);ChatGroupEvents[_0x6cf9('0x5')](_0x15481e,_0x1fcd2a);_0x26dfc2(null);};}for(var e in events){if(events[_0x6cf9('0x6')](e)){var event=events[e];ChatGroup[_0x6cf9('0x7')](e,emitEvent(event));}}module[_0x6cf9('0x8')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index aa3f6bc..59a9277 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 _0x2381=['define','ChatGroup','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','exports'];(function(_0x569a11,_0x9ec478){var _0xcf15b5=function(_0x5ac163){while(--_0x5ac163){_0x569a11['push'](_0x569a11['shift']());}};_0xcf15b5(++_0x9ec478);}(_0x2381,0xbd));var _0x1238=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0x2381[_0x2dea24];return _0x309d58;};'use strict';var _=require(_0x1238('0x0'));var util=require(_0x1238('0x1'));var logger=require(_0x1238('0x2'))('api');var moment=require(_0x1238('0x3'));var BPromise=require(_0x1238('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1238('0x5'));var rimraf=require(_0x1238('0x6'));var config=require(_0x1238('0x7'));var attributes=require('./chatGroup.attributes');module[_0x1238('0x8')]=function(_0x413b47,_0x168e41){return _0x413b47[_0x1238('0x9')](_0x1238('0xa'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x065b=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ChatGroup','lodash','util','../../config/logger','api','moment'];(function(_0x436def,_0x8b44dc){var _0x1223b2=function(_0x4abc61){while(--_0x4abc61){_0x436def['push'](_0x436def['shift']());}};_0x1223b2(++_0x8b44dc);}(_0x065b,0x1dc));var _0xb065=function(_0x1f8784,_0x285f48){_0x1f8784=_0x1f8784-0x0;var _0x2a4e3e=_0x065b[_0x1f8784];return _0x2a4e3e;};'use strict';var _=require(_0xb065('0x0'));var util=require(_0xb065('0x1'));var logger=require(_0xb065('0x2'))(_0xb065('0x3'));var moment=require(_0xb065('0x4'));var BPromise=require(_0xb065('0x5'));var rp=require(_0xb065('0x6'));var fs=require('fs');var path=require(_0xb065('0x7'));var rimraf=require(_0xb065('0x8'));var config=require(_0xb065('0x9'));var attributes=require('./chatGroup.attributes');module[_0xb065('0xa')]=function(_0x4ee352,_0x3811c5){return _0x4ee352[_0xb065('0xb')](_0xb065('0xc'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js index 1688793..5581469 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 _0x8d0e=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','error'];(function(_0x25d1a5,_0x507038){var _0x189bc3=function(_0x3c9537){while(--_0x3c9537){_0x25d1a5['push'](_0x25d1a5['shift']());}};_0x189bc3(++_0x507038);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x397b30,_0x553395){_0x397b30=_0x397b30-0x0;var _0x1bcf08=_0x8d0e[_0x397b30];return _0x1bcf08;};'use strict';var _=require(_0xe8d0('0x0'));var util=require(_0xe8d0('0x1'));var moment=require(_0xe8d0('0x2'));var BPromise=require(_0xe8d0('0x3'));var rs=require(_0xe8d0('0x4'));var fs=require('fs');var Redis=require(_0xe8d0('0x5'));var db=require(_0xe8d0('0x6'))['db'];var utils=require(_0xe8d0('0x7'));var logger=require(_0xe8d0('0x8'))('rpc');var config=require(_0xe8d0('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe8d0('0xa')]({'port':0x232a});config[_0xe8d0('0xb')]=_[_0xe8d0('0xc')](config[_0xe8d0('0xb')],{'host':_0xe8d0('0xd'),'port':0x18eb});var socket=require(_0xe8d0('0xe'))(new Redis(config[_0xe8d0('0xb')]));require(_0xe8d0('0xf'))['register'](socket);function respondWithRpcPromise(_0x10e56c,_0x19c3d0,_0x463159){return new BPromise(function(_0x599bc3,_0x580aab){return client[_0xe8d0('0x10')](_0x10e56c,_0x463159)[_0xe8d0('0x11')](function(_0x3da047){logger[_0xe8d0('0x12')](_0xe8d0('0x13'),_0x19c3d0,_0xe8d0('0x14'));logger['debug'](_0xe8d0('0x15'),_0x19c3d0,_0xe8d0('0x14'),JSON['stringify'](_0x3da047));if(_0x3da047[_0xe8d0('0x16')]){if(_0x3da047['error']['code']===0x1f4){logger[_0xe8d0('0x16')](_0xe8d0('0x13'),_0x19c3d0,_0x3da047[_0xe8d0('0x16')][_0xe8d0('0x17')]);return _0x580aab(_0x3da047[_0xe8d0('0x16')][_0xe8d0('0x17')]);}logger['error'](_0xe8d0('0x13'),_0x19c3d0,_0x3da047['error'][_0xe8d0('0x17')]);return _0x599bc3(_0x3da047[_0xe8d0('0x16')][_0xe8d0('0x17')]);}else{logger['info']('ChatGroup,\x20%s,\x20%s',_0x19c3d0,'request\x20sent');_0x599bc3(_0x3da047[_0xe8d0('0x18')][_0xe8d0('0x17')]);}})[_0xe8d0('0x19')](function(_0x44bbe4){logger[_0xe8d0('0x16')]('ChatGroup,\x20%s,\x20%s',_0x19c3d0,_0x44bbe4);_0x580aab(_0x44bbe4);});});} \ No newline at end of file +var _0x3379=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./chatGroup.socket','register','request','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment'];(function(_0x1f6553,_0x278aa0){var _0x5206da=function(_0x22510d){while(--_0x22510d){_0x1f6553['push'](_0x1f6553['shift']());}};_0x5206da(++_0x278aa0);}(_0x3379,0x115));var _0x9337=function(_0x5d343d,_0x40789f){_0x5d343d=_0x5d343d-0x0;var _0x46758e=_0x3379[_0x5d343d];return _0x46758e;};'use strict';var _=require(_0x9337('0x0'));var util=require(_0x9337('0x1'));var moment=require(_0x9337('0x2'));var BPromise=require(_0x9337('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9337('0x4'));var db=require(_0x9337('0x5'))['db'];var utils=require(_0x9337('0x6'));var logger=require(_0x9337('0x7'))('rpc');var config=require(_0x9337('0x8'));var jayson=require(_0x9337('0x9'));var client=jayson[_0x9337('0xa')][_0x9337('0xb')]({'port':0x232a});config['redis']=_[_0x9337('0xc')](config['redis'],{'host':_0x9337('0xd'),'port':0x18eb});var socket=require(_0x9337('0xe'))(new Redis(config[_0x9337('0xf')]));require(_0x9337('0x10'))[_0x9337('0x11')](socket);function respondWithRpcPromise(_0x55ea19,_0xd9b084,_0x1630bf){return new BPromise(function(_0xc985d1,_0x9a2dcc){return client[_0x9337('0x12')](_0x55ea19,_0x1630bf)['then'](function(_0x2ee523){logger[_0x9337('0x13')](_0x9337('0x14'),_0xd9b084,_0x9337('0x15'));logger[_0x9337('0x16')](_0x9337('0x17'),_0xd9b084,_0x9337('0x15'),JSON['stringify'](_0x2ee523));if(_0x2ee523['error']){if(_0x2ee523[_0x9337('0x18')][_0x9337('0x19')]===0x1f4){logger[_0x9337('0x18')](_0x9337('0x14'),_0xd9b084,_0x2ee523['error']['message']);return _0x9a2dcc(_0x2ee523[_0x9337('0x18')]['message']);}logger['error'](_0x9337('0x14'),_0xd9b084,_0x2ee523[_0x9337('0x18')][_0x9337('0x1a')]);return _0xc985d1(_0x2ee523['error'][_0x9337('0x1a')]);}else{logger[_0x9337('0x13')]('ChatGroup,\x20%s,\x20%s',_0xd9b084,'request\x20sent');_0xc985d1(_0x2ee523[_0x9337('0x1b')][_0x9337('0x1a')]);}})['catch'](function(_0x1bae86){logger[_0x9337('0x18')]('ChatGroup,\x20%s,\x20%s',_0xd9b084,_0x1bae86);_0x9a2dcc(_0x1bae86);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 4abca5d..2b64720 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 _0x71c5=['removeListener','length','chatGroup:','./chatGroup.events','save','remove'];(function(_0x2d4b98,_0x513897){var _0x109161=function(_0x259674){while(--_0x259674){_0x2d4b98['push'](_0x2d4b98['shift']());}};_0x109161(++_0x513897);}(_0x71c5,0x12f));var _0x571c=function(_0x54b078,_0xde2eba){_0x54b078=_0x54b078-0x0;var _0x46de84=_0x71c5[_0x54b078];return _0x46de84;};'use strict';var ChatGroupEvents=require(_0x571c('0x0'));var events=[_0x571c('0x1'),_0x571c('0x2'),'update'];function createListener(_0x25b7b2,_0x12de22){return function(_0x57e03f){_0x12de22['emit'](_0x25b7b2,_0x57e03f);};}function removeListener(_0x10e5bb,_0x126c00){return function(){ChatGroupEvents[_0x571c('0x3')](_0x10e5bb,_0x126c00);};}exports['register']=function(_0xb4ee84){for(var _0x542e03=0x0,_0x4ea49a=events[_0x571c('0x4')];_0x542e03<_0x4ea49a;_0x542e03++){var _0x142a3c=events[_0x542e03];var _0x437f76=createListener(_0x571c('0x5')+_0x142a3c,_0xb4ee84);ChatGroupEvents['on'](_0x142a3c,_0x437f76);}}; \ No newline at end of file +var _0x25fa=['emit','removeListener','register','length','chatGroup:','./chatGroup.events','save','remove','update'];(function(_0x1c3c6c,_0xb3eb41){var _0xc2dcae=function(_0x1231fb){while(--_0x1231fb){_0x1c3c6c['push'](_0x1c3c6c['shift']());}};_0xc2dcae(++_0xb3eb41);}(_0x25fa,0x152));var _0xa25f=function(_0x142e41,_0x361a58){_0x142e41=_0x142e41-0x0;var _0x488a86=_0x25fa[_0x142e41];return _0x488a86;};'use strict';var ChatGroupEvents=require(_0xa25f('0x0'));var events=[_0xa25f('0x1'),_0xa25f('0x2'),_0xa25f('0x3')];function createListener(_0x37002e,_0x4f6ed8){return function(_0x3d23f5){_0x4f6ed8[_0xa25f('0x4')](_0x37002e,_0x3d23f5);};}function removeListener(_0x20b187,_0x3ea162){return function(){ChatGroupEvents[_0xa25f('0x5')](_0x20b187,_0x3ea162);};}exports[_0xa25f('0x6')]=function(_0x54024e){for(var _0x47a62a=0x0,_0x112986=events[_0xa25f('0x7')];_0x47a62a<_0x112986;_0x47a62a++){var _0x77511f=events[_0x47a62a];var _0xc501aa=createListener(_0xa25f('0x8')+_0x77511f,_0x54024e);ChatGroupEvents['on'](_0x77511f,_0xc501aa);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 8190067..9f29a93 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 _0xabb6=['multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','describe','/:id/unread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMembers','addMessage','/:id','update','delete','removeMembers','exports'];(function(_0x39fabb,_0x2744b1){var _0x48361=function(_0xa60722){while(--_0xa60722){_0x39fabb['push'](_0x39fabb['shift']());}};_0x48361(++_0x2744b1);}(_0xabb6,0x195));var _0x6abb=function(_0x3591dc,_0x2b1429){_0x3591dc=_0x3591dc-0x0;var _0x40cddd=_0xabb6[_0x3591dc];return _0x40cddd;};'use strict';var multer=require(_0x6abb('0x0'));var util=require(_0x6abb('0x1'));var path=require(_0x6abb('0x2'));var timeout=require(_0x6abb('0x3'));var express=require(_0x6abb('0x4'));var router=express['Router']();var fs_extra=require(_0x6abb('0x5'));var auth=require(_0x6abb('0x6'));var interaction=require(_0x6abb('0x7'));var config=require(_0x6abb('0x8'));var controller=require(_0x6abb('0x9'));router[_0x6abb('0xa')]('/',auth[_0x6abb('0xb')](),controller['index']);router[_0x6abb('0xa')]('/describe',auth[_0x6abb('0xb')](),controller[_0x6abb('0xc')]);router['get']('/:id',auth[_0x6abb('0xb')](),controller['show']);router[_0x6abb('0xa')](_0x6abb('0xd'),auth[_0x6abb('0xb')](),controller['getUnread']);router[_0x6abb('0xa')](_0x6abb('0xe'),auth[_0x6abb('0xb')](),controller[_0x6abb('0xf')]);router[_0x6abb('0xa')](_0x6abb('0x10'),auth[_0x6abb('0xb')](),controller[_0x6abb('0x11')]);router[_0x6abb('0x12')]('/',auth[_0x6abb('0xb')](),controller[_0x6abb('0x13')]);router[_0x6abb('0x12')](_0x6abb('0xe'),auth[_0x6abb('0xb')](),controller[_0x6abb('0x14')]);router[_0x6abb('0x12')]('/:id/messages',auth['isAuthenticated'](),controller[_0x6abb('0x15')]);router['put'](_0x6abb('0x16'),auth['isAuthenticated'](),controller[_0x6abb('0x17')]);router['delete'](_0x6abb('0x16'),auth[_0x6abb('0xb')](),controller['destroy']);router[_0x6abb('0x18')](_0x6abb('0xe'),auth[_0x6abb('0xb')](),controller[_0x6abb('0x19')]);module[_0x6abb('0x1a')]=router; \ No newline at end of file +var _0x100a=['destroy','removeMembers','exports','multer','util','path','express','fs-extra','../../components/interaction/service','./chatGroup.controller','get','isAuthenticated','/describe','describe','show','/:id/unread','/:id/members','post','create','/:id/messages','addMessage','put','/:id','update','delete'];(function(_0x595dba,_0x5c482d){var _0x5d24b6=function(_0x4ded8d){while(--_0x4ded8d){_0x595dba['push'](_0x595dba['shift']());}};_0x5d24b6(++_0x5c482d);}(_0x100a,0x116));var _0xa100=function(_0xc9fdaa,_0x123fbe){_0xc9fdaa=_0xc9fdaa-0x0;var _0x3c0094=_0x100a[_0xc9fdaa];return _0x3c0094;};'use strict';var multer=require(_0xa100('0x0'));var util=require(_0xa100('0x1'));var path=require(_0xa100('0x2'));var timeout=require('connect-timeout');var express=require(_0xa100('0x3'));var router=express['Router']();var fs_extra=require(_0xa100('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa100('0x5'));var config=require('../../config/environment');var controller=require(_0xa100('0x6'));router[_0xa100('0x7')]('/',auth[_0xa100('0x8')](),controller['index']);router['get'](_0xa100('0x9'),auth[_0xa100('0x8')](),controller[_0xa100('0xa')]);router[_0xa100('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xa100('0xb')]);router['get'](_0xa100('0xc'),auth[_0xa100('0x8')](),controller['getUnread']);router[_0xa100('0x7')](_0xa100('0xd'),auth[_0xa100('0x8')](),controller['getMembers']);router[_0xa100('0x7')]('/:id/messages',auth[_0xa100('0x8')](),controller['getMessages']);router[_0xa100('0xe')]('/',auth['isAuthenticated'](),controller[_0xa100('0xf')]);router[_0xa100('0xe')](_0xa100('0xd'),auth['isAuthenticated'](),controller['addMembers']);router[_0xa100('0xe')](_0xa100('0x10'),auth[_0xa100('0x8')](),controller[_0xa100('0x11')]);router[_0xa100('0x12')](_0xa100('0x13'),auth[_0xa100('0x8')](),controller[_0xa100('0x14')]);router[_0xa100('0x15')](_0xa100('0x13'),auth[_0xa100('0x8')](),controller[_0xa100('0x16')]);router['delete']('/:id/members',auth[_0xa100('0x8')](),controller[_0xa100('0x17')]);module[_0xa100('0x18')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 5de2ea9..c719b66 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 _0x4024=['long','DATE','sequelize','exports','INTEGER','ENUM','thumb','TEXT','STRING'];(function(_0x6b6e9,_0x23f0e3){var _0x16e0ba=function(_0x485e33){while(--_0x485e33){_0x6b6e9['push'](_0x6b6e9['shift']());}};_0x16e0ba(++_0x23f0e3);}(_0x4024,0x89));var _0x4402=function(_0xe00024,_0x4e8cd1){_0xe00024=_0xe00024-0x0;var _0x455ba0=_0x4024[_0xe00024];return _0x455ba0;};'use strict';var Sequelize=require(_0x4402('0x0'));module[_0x4402('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x4402('0x2')]},'ratingType':{'type':Sequelize[_0x4402('0x3')]('star',_0x4402('0x4')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0x4402('0x5')]},'pathTranscript':{'type':Sequelize[_0x4402('0x5')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x4402('0x6')]},'secondDisposition':{'type':Sequelize[_0x4402('0x6')]},'thirdDisposition':{'type':Sequelize[_0x4402('0x6')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x4402('0x6')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x4402('0x6')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x4402('0x6')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x4402('0x6')]},'formData':{'type':Sequelize['TEXT'](_0x4402('0x7'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0x4402('0x8')]},'lastMsgDirection':{'type':Sequelize[_0x4402('0x3')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x4402('0x6')]},'customerPort':{'type':Sequelize[_0x4402('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x4402('0x5')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xc29b=['out','sequelize','exports','BOOLEAN','ENUM','star','TEXT','STRING','DATE','long'];(function(_0x57a4f2,_0x29f351){var _0x298f82=function(_0x131d4b){while(--_0x131d4b){_0x57a4f2['push'](_0x57a4f2['shift']());}};_0x298f82(++_0x29f351);}(_0xc29b,0x12d));var _0xbc29=function(_0x1a0c08,_0x525715){_0x1a0c08=_0x1a0c08-0x0;var _0x22a682=_0xc29b[_0x1a0c08];return _0x22a682;};'use strict';var Sequelize=require(_0xbc29('0x0'));module[_0xbc29('0x1')]={'closed':{'type':Sequelize[_0xbc29('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0xbc29('0x3')](_0xbc29('0x4'),'thumb'),'defaultValue':_0xbc29('0x4')},'ratingMessage':{'type':Sequelize[_0xbc29('0x5')]},'pathTranscript':{'type':Sequelize[_0xbc29('0x5')]},'mailTranscript':{'type':Sequelize[_0xbc29('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xbc29('0x7')]},'disposition':{'type':Sequelize[_0xbc29('0x6')]},'secondDisposition':{'type':Sequelize[_0xbc29('0x6')]},'thirdDisposition':{'type':Sequelize[_0xbc29('0x6')]},'note':{'type':Sequelize[_0xbc29('0x6')]},'browserName':{'type':Sequelize[_0xbc29('0x6')]},'browserVersion':{'type':Sequelize[_0xbc29('0x6')]},'osName':{'type':Sequelize[_0xbc29('0x6')]},'osVersion':{'type':Sequelize[_0xbc29('0x6')]},'deviceModel':{'type':Sequelize[_0xbc29('0x6')]},'deviceVendor':{'type':Sequelize[_0xbc29('0x6')]},'deviceType':{'type':Sequelize[_0xbc29('0x6')]},'referer':{'type':Sequelize[_0xbc29('0x5')]},'customerIp':{'type':Sequelize[_0xbc29('0x6')]},'formData':{'type':Sequelize[_0xbc29('0x5')](_0xbc29('0x8'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0xbc29('0x7')]},'lastMsgDirection':{'type':Sequelize[_0xbc29('0x3')]('in',_0xbc29('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xbc29('0x6')]},'customerPort':{'type':Sequelize[_0xbc29('0x6')]},'vidaooSessionId':{'type':Sequelize[_0xbc29('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0xbc29('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 a3d5a22..a7f1413 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 _0xdd4f=['i.ChatWebsiteId\x20IN\x20?','toString','sequelize','ChatInteraction','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','all','rows','includeAll','include','options','create','params','describe','createVidaooSession','findOne','vidaooApiKey','vidaooEscalation','vidaooNote','vidaooMetadata','email','contact','POST','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooTopic','follow','isNull','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','entity\x20not\x20found','Interaction\x20already\x20assigned','disposition','AbandonInteraction','attachmentUpload','file','basename','mimetype','attachmentDownload','closed','Unauthorized','Attachment','ChatOfflineMessageId','server/files/attachments/','join','offline-chat/','download','close','mailTranscript','root','server/files/chat/upload/','transcript-%s.txt','pathTranscript','Messages','format','%s%d','agentAlias','System','customer','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','pass','SendMail','sendMail','Mail\x20Transcript','addMessage','ids','omit','nolimit','sort','ChatInteractionId','$gte','getMyMessages','filter','findAll','setTags','spread','emit','chatInteractionTags:save','removeTags','unix','tmp','server','files','attachments','transcript-%d-%s.zip','lastName','ChatWebsite','Account','get','mkdirSync','Chat','Owner','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','browserName','osName','referer','customerPort','existsSync','createReadStream','pipe','createWriteStream','out','firstName','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','err','eml-format','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','reject','save','update','destroy','stack','name','send','render','merge','body','interaction','account','Users','map','fullname','Tags','TagIds','split','forEach','push','rawAttributes','type','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','pick','field','from','tools_tags','select','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','o.id\x20=\x20i.UserId','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','parseSearch','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','start','Tag','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','compact','isEmpty','ChatWebsiteId','where','concat','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','replace','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','order','contactName','t.id\x20IN\x20?','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','agent','i.ChatWebsiteId\x20IS\x20NULL'];(function(_0x391ae4,_0x477af5){var _0x189442=function(_0x108e89){while(--_0x108e89){_0x391ae4['push'](_0x391ae4['shift']());}};_0x189442(++_0x477af5);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0x10b5d7,_0x49d478){_0x10b5d7=_0x10b5d7-0x0;var _0x3338c6=_0xdd4f[_0x10b5d7];return _0x3338c6;};'use strict';var emlformat=require(_0xfdd4('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xfdd4('0x1'));var moment=require(_0xfdd4('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xfdd4('0x3'));var util=require(_0xfdd4('0x4'));var path=require(_0xfdd4('0x5'));var sox=require('sox');var csv=require(_0xfdd4('0x6'));var ejs=require(_0xfdd4('0x7'));var fs=require('fs');var fs_extra=require(_0xfdd4('0x8'));var _=require(_0xfdd4('0x9'));var squel=require(_0xfdd4('0xa'));var crypto=require('crypto');var jsforce=require(_0xfdd4('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xfdd4('0x6'));var querystring=require(_0xfdd4('0xc'));var Papa=require(_0xfdd4('0xd'));var Redis=require('ioredis');var authService=require(_0xfdd4('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xfdd4('0xf'));var pdf=require(_0xfdd4('0x10'));var hardwareService=require(_0xfdd4('0x11'));var logger=require(_0xfdd4('0x12'))(_0xfdd4('0x13'));var utils=require(_0xfdd4('0x14'));var config=require(_0xfdd4('0x15'));var licenseUtil=require(_0xfdd4('0x16'));var db=require(_0xfdd4('0x17'))['db'];config[_0xfdd4('0x18')]=_[_0xfdd4('0x19')](config['redis'],{'host':_0xfdd4('0x1a'),'port':0x18eb});var socket=require(_0xfdd4('0x1b'))(new Redis(config[_0xfdd4('0x18')]));require('./chatInteraction.socket')[_0xfdd4('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0xfdd4('0x1d')][_0xfdd4('0x1e')]({'port':0x232b});var client9004=jayson[_0xfdd4('0x1d')][_0xfdd4('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x37b05f,_0x52cf2c,_0x47ed1d,_0x559c77){return new BPromise(function(_0x3a966d,_0x216c7e){var _0x2eb174=_0x559c77||client;return _0x2eb174[_0xfdd4('0x1f')](_0x37b05f,_0x47ed1d)[_0xfdd4('0x20')](function(_0x33d752){logger[_0xfdd4('0x21')](_0xfdd4('0x22'),_0x52cf2c,_0xfdd4('0x23'));logger['debug'](_0xfdd4('0x24'),_0x52cf2c,_0xfdd4('0x23'),JSON[_0xfdd4('0x25')](_0x33d752));if(_0x33d752[_0xfdd4('0x26')]){if(_0x33d752[_0xfdd4('0x26')][_0xfdd4('0x27')]===0x1f4){logger[_0xfdd4('0x26')](_0xfdd4('0x22'),_0x52cf2c,_0x33d752['error'][_0xfdd4('0x28')]);return _0x216c7e(_0x33d752[_0xfdd4('0x26')][_0xfdd4('0x28')]);}logger[_0xfdd4('0x26')](_0xfdd4('0x22'),_0x52cf2c,_0x33d752[_0xfdd4('0x26')][_0xfdd4('0x28')]);return _0x3a966d(_0x33d752[_0xfdd4('0x26')]['message']);}else{logger[_0xfdd4('0x21')](_0xfdd4('0x22'),_0x52cf2c,_0xfdd4('0x23'));_0x3a966d(_0x33d752['result'][_0xfdd4('0x28')]);}})[_0xfdd4('0x29')](function(_0xf9c346){logger[_0xfdd4('0x26')](_0xfdd4('0x22'),_0x52cf2c,_0xf9c346);_0x216c7e(_0xf9c346);});});}function respondWithStatusCode(_0x4a8790,_0x18bafb){_0x18bafb=_0x18bafb||0xcc;return function(_0x2c88ad){if(_0x2c88ad){return _0x4a8790[_0xfdd4('0x2a')](_0x18bafb);}return _0x4a8790[_0xfdd4('0x2b')](_0x18bafb)[_0xfdd4('0x2c')]();};}function respondWithResult(_0x192471,_0x453a48){_0x453a48=_0x453a48||0xc8;return function(_0x37b7a2){if(_0x37b7a2){return _0x192471['status'](_0x453a48)[_0xfdd4('0x2d')](_0x37b7a2);}};}function respondWithFilteredResult(_0x39981f,_0x385a68){return function(_0xef012e){if(_0xef012e){var _0x2207ae=typeof _0x385a68['offset']===_0xfdd4('0x2e')&&typeof _0x385a68[_0xfdd4('0x2f')]===_0xfdd4('0x2e');var _0x2bb793=_0xef012e[_0xfdd4('0x30')];var _0x4d64ce=_0x2207ae?0x0:_0x385a68[_0xfdd4('0x31')];var _0x315568=_0x2207ae?_0xef012e[_0xfdd4('0x30')]:_0x385a68['offset']+_0x385a68[_0xfdd4('0x2f')];var _0x502776;if(_0x315568>=_0x2bb793){_0x315568=_0x2bb793;_0x502776=0xc8;}else{_0x502776=0xce;}_0x39981f[_0xfdd4('0x2b')](_0x502776);return _0x39981f[_0xfdd4('0x32')]('Content-Range',_0x4d64ce+'-'+_0x315568+'/'+_0x2bb793)['json'](_0xef012e);}return null;};}function patchUpdates(_0x41dae6){return function(_0x289f16){try{jsonpatch['apply'](_0x289f16,_0x41dae6,!![]);}catch(_0x557d7b){return BPromise[_0xfdd4('0x33')](_0x557d7b);}return _0x289f16[_0xfdd4('0x34')]();};}function saveUpdates(_0x39eedb,_0x24b1fa){return function(_0x3247f4){if(_0x3247f4){return _0x3247f4[_0xfdd4('0x35')](_0x39eedb)[_0xfdd4('0x20')](function(_0x4734ed){return _0x4734ed;});}return null;};}function removeEntity(_0x3e6bc5,_0x457ab5){return function(_0x6ffe30){if(_0x6ffe30){return _0x6ffe30[_0xfdd4('0x36')]()[_0xfdd4('0x20')](function(){_0x3e6bc5[_0xfdd4('0x2b')](0xcc)[_0xfdd4('0x2c')]();});}};}function handleEntityNotFound(_0x3f5c5a,_0x261d87){return function(_0x3a0102){if(!_0x3a0102){_0x3f5c5a[_0xfdd4('0x2a')](0x194);}return _0x3a0102;};}function handleError(_0x4037c4,_0xc9549b){_0xc9549b=_0xc9549b||0x1f4;return function(_0x2e4c8c){logger[_0xfdd4('0x26')](_0x2e4c8c[_0xfdd4('0x37')]);if(_0x2e4c8c[_0xfdd4('0x38')]){delete _0x2e4c8c[_0xfdd4('0x38')];}_0x4037c4['status'](_0xc9549b)[_0xfdd4('0x39')](_0x2e4c8c);};}function getMustacheRender(_0x3716da,_0x42dc1a){return Mustache[_0xfdd4('0x3a')](_0x3716da,_[_0xfdd4('0x3b')](_0x42dc1a[_0xfdd4('0x3c')],{'contact':_0x42dc1a['contact'],'message':_0x42dc1a[_0xfdd4('0x28')],'agent':_0x42dc1a['agent'],'interaction':_0x42dc1a[_0xfdd4('0x3d')],'account':_0x42dc1a[_0xfdd4('0x3e')]}))||'';}function getInteractionUsers(_0x6a79eb,_0x13efe8){return new BPromise(function(_0x4cccab,_0x1c6f43){try{if(_0x13efe8[_0x6a79eb['id']]){_0x6a79eb[_0xfdd4('0x3f')]=_[_0xfdd4('0x40')](_0x13efe8[_0x6a79eb['id']],function(_0x2ee857){return{'id':_0x2ee857['id'],'fullname':_0x2ee857[_0xfdd4('0x41')]};});}}catch(_0x7e171){_0x1c6f43(_0x7e171);}_0x4cccab(_0x6a79eb);});}function getInteractionTags(_0x28e5e2,_0x55fcec){return new BPromise(function(_0xe65944,_0x83673d){try{if(_0x28e5e2['TagIds']){_0x28e5e2[_0xfdd4('0x42')]=[];_0x28e5e2[_0xfdd4('0x43')][_0xfdd4('0x44')](',')[_0xfdd4('0x45')](function(_0x5173db){_0x28e5e2[_0xfdd4('0x42')][_0xfdd4('0x46')](_0x55fcec[_0x5173db]);});}delete _0x28e5e2[_0xfdd4('0x43')];}catch(_0x2341e5){_0x83673d(_0x2341e5);}_0xe65944(_0x28e5e2);});}function updateChatInteraction(_0x362c4f,_0x496747,_0x1411e0){return new BPromise(function(_0x23af2a,_0xd3780d){return getInteractionUsers(_0x362c4f,_0x1411e0)[_0xfdd4('0x20')](function(_0x912520){return getInteractionTags(_0x912520,_0x496747);})[_0xfdd4('0x20')](function(_0x3d1051){_0x23af2a(_0x3d1051);})['catch'](function(_0x2dd3fa){_0xd3780d(_0x2dd3fa);});});}exports['index']=function(_0x3a0de9,_0x11f241){var _0x3f7273={},_0x137d41={},_0x5367aa={'count':0x0,'rows':[]};var _0x419578=_[_0xfdd4('0x40')](db['ChatInteraction'][_0xfdd4('0x47')],function(_0xbfaa53){return{'name':_0xbfaa53['fieldName'],'type':_0xbfaa53[_0xfdd4('0x48')]['key']};});_0x137d41['model']=_['map'](_0x419578,_0xfdd4('0x38'));_0x137d41[_0xfdd4('0x49')]=_[_0xfdd4('0x4a')](_0x3a0de9['query']);_0x137d41[_0xfdd4('0x4b')]=_[_0xfdd4('0x4c')](_0x137d41['model'],_0x137d41[_0xfdd4('0x49')]);_0x3f7273[_0xfdd4('0x4d')]=_[_0xfdd4('0x4c')](_0x137d41[_0xfdd4('0x4e')],qs[_0xfdd4('0x4f')](_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x4f')]));_0x3f7273[_0xfdd4('0x4d')]=_0x3f7273[_0xfdd4('0x4d')][_0xfdd4('0x50')]?_0x3f7273[_0xfdd4('0x4d')]:_0x137d41[_0xfdd4('0x4e')];if(!_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x51')]('nolimit')){_0x3f7273['limit']=qs[_0xfdd4('0x2f')](_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x2f')]);_0x3f7273[_0xfdd4('0x31')]=qs['offset'](_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x31')]);}_0x3f7273['order']=qs['sort'](_0x3a0de9['query']['sort']);_0x3f7273['where']=qs[_0xfdd4('0x4b')](_[_0xfdd4('0x52')](_0x3a0de9[_0xfdd4('0x49')],_0x137d41[_0xfdd4('0x4b')]),_0x419578);var _0x35c032=[];var _0x49bc61=squel['select']()[_0xfdd4('0x53')]('id')[_0xfdd4('0x53')](_0xfdd4('0x38'))[_0xfdd4('0x53')]('color')[_0xfdd4('0x54')](_0xfdd4('0x55'));var _0x4addd6=squel[_0xfdd4('0x56')]()[_0xfdd4('0x53')]('u.id')['field'](_0xfdd4('0x57'))[_0xfdd4('0x53')](_0xfdd4('0x58'))[_0xfdd4('0x54')](_0xfdd4('0x59'),'ui')[_0xfdd4('0x5a')](_0xfdd4('0x5b'),'u',_0xfdd4('0x5c'));var _0x5848e1=squel[_0xfdd4('0x56')]()['from']('chat_interactions','i')[_0xfdd4('0x5a')](_0xfdd4('0x5d'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join']('users','o',_0xfdd4('0x5e'))[_0xfdd4('0x5a')]('chat_websites','a',_0xfdd4('0x5f'))[_0xfdd4('0x5a')](_0xfdd4('0x60'),'me',_0xfdd4('0x61'))[_0xfdd4('0x5a')]('chat_interaction_has_tags','it','it.ChatInteractionId\x20=\x20i.id')['left_join']('tools_tags','t',_0xfdd4('0x62'));var _0x14d07e=squel['expr']();var _0x1eee3d=[];var _0x2abe50=squel['expr']();var _0x45dcc8;if(_0x3a0de9[_0xfdd4('0x49')]['search']){_0x45dcc8=as[_0xfdd4('0x63')](_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x64')]);var _0x4a5fe6=_0x45dcc8[_0xfdd4('0x65')];for(var _0x3417dd=0x0;_0x3417dd<_0x45dcc8[_0xfdd4('0x66')][_0xfdd4('0x50')];_0x3417dd++){var _0x5c7be=_0x45dcc8['conditions'][_0x3417dd];var _0x2cc3e2='i';var _0x2ee4b6=_[_0xfdd4('0x67')](_0x419578,[_0xfdd4('0x38'),_0x5c7be[_0xfdd4('0x53')]]);if(!_0x2ee4b6){switch(_0x5c7be[_0xfdd4('0x53')]){case _0xfdd4('0x68'):if(_0x5c7be[_0xfdd4('0x69')]==0x1){_0x5848e1[_0xfdd4('0x6a')]('`'+_0x5c7be['field']+_0xfdd4('0x6b'));}else{_0x5848e1[_0xfdd4('0x6a')]('`'+_0x5c7be[_0xfdd4('0x53')]+_0xfdd4('0x6c'));}break;case _0xfdd4('0x6d'):if(_0x5c7be['operator']===_0xfdd4('0x6e')){if(_0x5c7be[_0xfdd4('0x69')][_0xfdd4('0x44')]('\x20')[_0xfdd4('0x50')]>0x1){_0x14d07e[_0x4a5fe6](_0xfdd4('0x6f'),qs[_0xfdd4('0x70')](_0x5c7be[_0xfdd4('0x69')]),null);}else{var _0x276e9='%'+_0x5c7be[_0xfdd4('0x69')]+'%';_0x14d07e[_0x4a5fe6](_0xfdd4('0x71'),_0x276e9,_0x276e9,_0x276e9);}}else{_0x2ee4b6=_[_0xfdd4('0x67')](_0x419578,[_0xfdd4('0x38'),_0xfdd4('0x72')]);_0x5c7be['field']=_0xfdd4('0x72');_0xa55e0f=as['buildExpression'](_0x2cc3e2,_0x2ee4b6[_0xfdd4('0x48')],_0x5c7be);_0x14d07e[_0x4a5fe6](_0xa55e0f[_0xfdd4('0x73')],_0xa55e0f[_0xfdd4('0x69')][_0xfdd4('0x74')],_0xa55e0f[_0xfdd4('0x69')][_0xfdd4('0x2c')]);}break;case _0xfdd4('0x75'):var _0xb0bb50=_0x5c7be[_0xfdd4('0x69')][_0xfdd4('0x44')](',')[_0xfdd4('0x40')](function(_0x207a4c){return Number(_0x207a4c);});_0xb0bb50['forEach'](function(_0x4bac59){_0x2abe50['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x4bac59+',%');});_0x1eee3d=_[_0xfdd4('0x76')](_0x1eee3d,_0xb0bb50);break;case _0xfdd4('0x77'):if(_0x5c7be['operator']===_0xfdd4('0x6e')){_0x14d07e[_0x4a5fe6](_0xfdd4('0x78'),'%'+_0x5c7be[_0xfdd4('0x69')]+'%',null);}else{_0x2ee4b6=_[_0xfdd4('0x67')](_0x419578,[_0xfdd4('0x38'),'UserId']);_0x5c7be[_0xfdd4('0x53')]=_0xfdd4('0x79');_0xa55e0f=as[_0xfdd4('0x7a')](_0x2cc3e2,_0x2ee4b6['type'],_0x5c7be);_0x14d07e[_0x4a5fe6](_0xa55e0f[_0xfdd4('0x73')],_0xa55e0f['value'][_0xfdd4('0x74')],_0xa55e0f[_0xfdd4('0x69')][_0xfdd4('0x2c')]);}break;case _0xfdd4('0x3c'):_0xa55e0f=as['buildExpression']('me',null,_0x5c7be);_0x14d07e[_0x4a5fe6](_0xa55e0f[_0xfdd4('0x73')],_0xa55e0f[_0xfdd4('0x69')]['start'],_0xa55e0f[_0xfdd4('0x69')][_0xfdd4('0x2c')]);break;}}else{var _0xa55e0f=as['buildExpression'](_0x2cc3e2,_0x2ee4b6[_0xfdd4('0x48')],_0x5c7be);_0x14d07e[_0x4a5fe6](_0xa55e0f[_0xfdd4('0x73')],_0xa55e0f[_0xfdd4('0x69')]['start'],_0xa55e0f[_0xfdd4('0x69')][_0xfdd4('0x2c')]);}}}else{var _0x427ded=_(_0x3a0de9[_0xfdd4('0x49')])[_0xfdd4('0x4a')]()[_0xfdd4('0x40')](function(_0x185226){return _['some'](_0x419578,[_0xfdd4('0x38'),_0x185226])?_0x185226:undefined;})[_0xfdd4('0x7b')]()[_0xfdd4('0x69')]();if(!_[_0xfdd4('0x7c')](_0x427ded)){_0x427ded[_0xfdd4('0x45')](function(_0x2cbd27){if(_0x2cbd27===_0xfdd4('0x7d')){_0x5848e1[_0xfdd4('0x7e')]('i.ChatWebsiteId\x20IN\x20?',[][_0xfdd4('0x7f')](_0x3a0de9['query'][_0x2cbd27]));}else if(_0x2cbd27==='createdAt'){var _0x40b2e8=JSON['parse'](_0x3a0de9[_0xfdd4('0x49')][_0x2cbd27])['$gte'];var _0x4576ce=JSON[_0xfdd4('0x80')](_0x3a0de9[_0xfdd4('0x49')][_0x2cbd27])[_0xfdd4('0x81')];_0x5848e1[_0xfdd4('0x7e')](_0xfdd4('0x82'),_0x40b2e8,_0x4576ce);}else{if(_0x3a0de9[_0xfdd4('0x49')][_0x2cbd27]==='null'){_0x5848e1['where']('i.'+_0x2cbd27+_0xfdd4('0x83'));}else{_0x5848e1['where']('i.'+_0x2cbd27+_0xfdd4('0x84'),_0x3a0de9[_0xfdd4('0x49')][_0x2cbd27]);}}});}if(_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x85')]){if(_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x85')]==0x1){_0x5848e1[_0xfdd4('0x6a')]('`unreadMessages`\x20=\x200');}else{_0x5848e1['having'](_0xfdd4('0x86'));}}if(_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x87')]){_0x1eee3d=_[_0xfdd4('0x88')](_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x87')])?_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x87')]:new Array(_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x87')]);_0x1eee3d[_0xfdd4('0x45')](function(_0x32abf5){_0x2abe50['or'](_0xfdd4('0x89'),'%,'+_0x32abf5+',%');});}if(_0x3a0de9['query']['filter']){var _0x3761f2=_0x3a0de9[_0xfdd4('0x49')]['filter']['replace']('\x5c','\x5c\x5c')[_0xfdd4('0x8a')](/'/g,'\x27\x27');if(qs[_0xfdd4('0x8b')](_0x3761f2)){_0x14d07e['or']('i.id\x20LIKE\x20?',_0x3761f2+'%');}else{_0x14d07e['or'](_0xfdd4('0x8c'),qs[_0xfdd4('0x70')](_0x3761f2))['or'](_0xfdd4('0x8d'),_0x3761f2+'%');}}}_0x5848e1[_0xfdd4('0x7e')](_0x14d07e);_0x5848e1[_0xfdd4('0x8e')](_0xfdd4('0x8f'));var _0x5d356c={'type':db[_0xfdd4('0x90')][_0xfdd4('0x91')][_0xfdd4('0x92')],'raw':!![]};var _0x2f8001=_0x5848e1[_0xfdd4('0x93')]();_0x2f8001[_0xfdd4('0x53')](_0xfdd4('0x8f'));_0x2f8001[_0xfdd4('0x53')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x3f7273[_0xfdd4('0x94')]){_0x3f7273['order'][_0xfdd4('0x45')](function(_0x1b4f61){var _0x298906=_0x1b4f61[0x0]===_0xfdd4('0x95')?_0x1b4f61[0x0]:'i.'+_0x1b4f61[0x0];_0x5848e1[_0xfdd4('0x94')](_0x298906,_0x1b4f61[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x1eee3d)){_0x5848e1[_0xfdd4('0x6a')](_0x2abe50);_0x2f8001['where'](_0xfdd4('0x96'),_0x1eee3d);}BPromise['resolve']()[_0xfdd4('0x20')](function(){if(!_0x45dcc8){if(_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x7d')])return;_0x2f8001[_0xfdd4('0x7e')](_0xfdd4('0x97'));_0x5848e1[_0xfdd4('0x7e')](_0xfdd4('0x97'));return;}if(_0x3a0de9[_0xfdd4('0x98')][_0xfdd4('0x99')]!==_0xfdd4('0x9a'))return;return _0x3a0de9[_0xfdd4('0x98')]['getChatWebsites']({'attributes':['id'],'raw':!![]})[_0xfdd4('0x20')](function(_0x1f9e08){if(_[_0xfdd4('0x7c')](_0x1f9e08)){_0x2f8001[_0xfdd4('0x7e')](_0xfdd4('0x9b'));_0x5848e1[_0xfdd4('0x7e')](_0xfdd4('0x9b'));}else{_0x2f8001[_0xfdd4('0x7e')](_0xfdd4('0x9c'),_['map'](_0x1f9e08,'id'));_0x5848e1['where'](_0xfdd4('0x9c'),_[_0xfdd4('0x40')](_0x1f9e08,'id'));}});})[_0xfdd4('0x20')](function(){if(_0x3a0de9['user'][_0xfdd4('0x99')]===_0xfdd4('0x9a')&&!_0x45dcc8&&!_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x7d')])return[];return db['sequelize']['query'](_0x2f8001[_0xfdd4('0x9d')](),_0x5d356c);})[_0xfdd4('0x20')](function(_0x3b75bf){_0x5367aa['count']=_0x3b75bf[_0xfdd4('0x50')];if(_0x5367aa[_0xfdd4('0x30')]===0x0)return[];return db[_0xfdd4('0x9e')][_0xfdd4('0x49')](_0x49bc61[_0xfdd4('0x9d')](),_0x5d356c)[_0xfdd4('0x20')](function(_0x524a8f){_0x35c032=_['keyBy'](_0x524a8f,'id');_0x5d356c=_[_0xfdd4('0x3b')](_0x5d356c,{'model':db[_0xfdd4('0x9f')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x4f')]){_0x3f7273[_0xfdd4('0x4d')][_0xfdd4('0x45')](function(_0x46edc9){_0x5848e1[_0xfdd4('0x53')]('i.'+_0x46edc9);});}else{_0x5848e1['field'](_0xfdd4('0xa0'),'unreadMessages');_0x5848e1[_0xfdd4('0x53')](_0xfdd4('0xa1'),'Account.key');_0x5848e1[_0xfdd4('0x53')](_0xfdd4('0xa2'),_0xfdd4('0xa3'));_0x5848e1[_0xfdd4('0x53')](_0xfdd4('0xa4'),_0xfdd4('0x95'));_0x5848e1[_0xfdd4('0x53')](_0xfdd4('0xa5'));_0x5848e1[_0xfdd4('0x53')]('c.firstName',_0xfdd4('0xa6'));_0x5848e1['field'](_0xfdd4('0xa7'),'Contact.lastName');_0x5848e1['field'](_0xfdd4('0xa8'),_0xfdd4('0xa9'));_0x5848e1[_0xfdd4('0x53')](_0xfdd4('0xaa'),_0xfdd4('0xab'));_0x5848e1['field'](_0xfdd4('0xac'),_0xfdd4('0xad'));_0x5848e1[_0xfdd4('0x53')](_0xfdd4('0xae'),_0xfdd4('0xaf'));_0x5848e1[_0xfdd4('0x53')]('o.fullname',_0xfdd4('0xb0'));_0x5848e1[_0xfdd4('0x53')]('o.internal','Owner.internal');_0x5848e1[_0xfdd4('0x53')](_0xfdd4('0xb1'),_0xfdd4('0x43'));}if(_0x3f7273['limit'])_0x5848e1['limit'](_0x3f7273[_0xfdd4('0x2f')]);if(_0x3f7273[_0xfdd4('0x31')])_0x5848e1[_0xfdd4('0x31')](_0x3f7273['offset']);return db['sequelize'][_0xfdd4('0x49')](_0x5848e1[_0xfdd4('0x9d')](),_0x5d356c);})[_0xfdd4('0x20')](function(_0x4bfb31){if(_0x4bfb31[_0xfdd4('0x50')]>0x0)_0x4addd6['where'](_0xfdd4('0xb2'),_[_0xfdd4('0x40')](_0x4bfb31,'id'));return db[_0xfdd4('0x9e')]['query'](_0x4addd6[_0xfdd4('0x9d')](),_0x5d356c)[_0xfdd4('0x20')](function(_0x1efb08){var _0xe3296c=_[_0xfdd4('0xb3')](_0x1efb08,'ChatInteractionId');var _0x19de84=[];_0x4bfb31[_0xfdd4('0x45')](function(_0x133f56){_0x19de84['push'](updateChatInteraction(_0x133f56,_0x35c032,_0xe3296c));});return BPromise[_0xfdd4('0xb4')](_0x19de84);});});})[_0xfdd4('0x20')](function(_0xb9cb69){_0x5367aa[_0xfdd4('0xb5')]=_0xb9cb69;return _0x5367aa;})['then'](respondWithFilteredResult(_0x11f241,_0x3f7273))[_0xfdd4('0x29')](handleError(_0x11f241,null));};exports['show']=function(_0x4f5ca3,_0x528004){var _0x206a59={'raw':![],'where':{'id':_0x4f5ca3['params']['id']}},_0x545475={};_0x545475['model']=_[_0xfdd4('0x4a')](db[_0xfdd4('0x9f')][_0xfdd4('0x47')]);_0x545475[_0xfdd4('0x49')]=_[_0xfdd4('0x4a')](_0x4f5ca3[_0xfdd4('0x49')]);_0x545475[_0xfdd4('0x4b')]=_[_0xfdd4('0x4c')](_0x545475[_0xfdd4('0x4e')],_0x545475[_0xfdd4('0x49')]);_0x206a59[_0xfdd4('0x4d')]=_[_0xfdd4('0x4c')](_0x545475[_0xfdd4('0x4e')],qs[_0xfdd4('0x4f')](_0x4f5ca3[_0xfdd4('0x49')][_0xfdd4('0x4f')]));_0x206a59[_0xfdd4('0x4d')]=_0x206a59[_0xfdd4('0x4d')][_0xfdd4('0x50')]?_0x206a59[_0xfdd4('0x4d')]:_0x545475[_0xfdd4('0x4e')];if(_0x4f5ca3[_0xfdd4('0x49')][_0xfdd4('0xb6')]){_0x206a59[_0xfdd4('0xb7')]=[{'all':!![]}];}_0x206a59=_[_0xfdd4('0x3b')]({},_0x206a59,_0x4f5ca3[_0xfdd4('0xb8')]);return db['ChatInteraction'][_0xfdd4('0x67')](_0x206a59)[_0xfdd4('0x20')](handleEntityNotFound(_0x528004,null))[_0xfdd4('0x20')](respondWithResult(_0x528004,null))[_0xfdd4('0x29')](handleError(_0x528004,null));};exports[_0xfdd4('0xb9')]=function(_0x577bef,_0x3616e3){return db[_0xfdd4('0x9f')][_0xfdd4('0xb9')](_0x577bef[_0xfdd4('0x3c')],{})[_0xfdd4('0x20')](respondWithResult(_0x3616e3,0xc9))[_0xfdd4('0x29')](handleError(_0x3616e3,null));};exports['update']=function(_0x186d86,_0x1a9e62){if(_0x186d86[_0xfdd4('0x3c')]['id']){delete _0x186d86[_0xfdd4('0x3c')]['id'];}return db[_0xfdd4('0x9f')][_0xfdd4('0x67')]({'where':{'id':_0x186d86['params']['id']}})[_0xfdd4('0x20')](handleEntityNotFound(_0x1a9e62,null))[_0xfdd4('0x20')](saveUpdates(_0x186d86[_0xfdd4('0x3c')],null))['then'](respondWithResult(_0x1a9e62,null))[_0xfdd4('0x29')](handleError(_0x1a9e62,null));};exports[_0xfdd4('0x36')]=function(_0x4de363,_0x5159a5){return db[_0xfdd4('0x9f')][_0xfdd4('0x67')]({'where':{'id':_0x4de363[_0xfdd4('0xba')]['id']}})[_0xfdd4('0x20')](handleEntityNotFound(_0x5159a5,null))['then'](removeEntity(_0x5159a5,null))[_0xfdd4('0x29')](handleError(_0x5159a5,null));};exports['describe']=function(_0xc9955e,_0x42204a){return db[_0xfdd4('0x9f')][_0xfdd4('0xbb')]()[_0xfdd4('0x20')](respondWithResult(_0x42204a,null))[_0xfdd4('0x29')](handleError(_0x42204a,null));};exports[_0xfdd4('0xbc')]=function(_0x46e3ad,_0x29fcd4){var _0xe32bfc=_0x46e3ad[_0xfdd4('0xba')]['id'];var _0x5015a1;var _0xca4f26;var _0x42a3dc;return db[_0xfdd4('0x9f')][_0xfdd4('0xbd')]({'where':{'id':_0xe32bfc}})[_0xfdd4('0x20')](function(_0x4512b0){_0x5015a1=_0x4512b0;return db['ChatWebsite'][_0xfdd4('0xbd')]({'where':{'id':_0x4512b0[_0xfdd4('0x7d')]},'attributes':['id',_0xfdd4('0xbe'),_0xfdd4('0xbf'),'vidaooTopic',_0xfdd4('0xc0'),_0xfdd4('0xc1')],'raw':!![]});})['then'](function(_0x2d506e){if(_0x2d506e&&_0x2d506e[_0xfdd4('0xbe')]&&_0x2d506e[_0xfdd4('0xbf')]){_0xca4f26=_0x2d506e;var _0x204975={'interaction':{'id':_0xe32bfc},'agent':{'id':_0x46e3ad[_0xfdd4('0x98')]['id'],'name':_0x46e3ad[_0xfdd4('0x98')][_0xfdd4('0x38')],'fullname':_0x46e3ad[_0xfdd4('0x98')][_0xfdd4('0x41')],'email':_0x46e3ad[_0xfdd4('0x98')][_0xfdd4('0xc2')]},'contact':_0x46e3ad[_0xfdd4('0x3c')][_0xfdd4('0xc3')],'account':_0x46e3ad[_0xfdd4('0x3c')]['account']};var _0x42253b={'rejectUnauthorized':![],'method':_0xfdd4('0xc4'),'url':_0xfdd4('0xc5'),'headers':{'X-APIKEY':_0x2d506e[_0xfdd4('0xbe')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x46e3ad['user'][_0xfdd4('0xc2')]],'buttons':null,'topic':_0xca4f26[_0xfdd4('0xc6')],'note':_['isNull'](_0xca4f26[_0xfdd4('0xc0')])?null:getMustacheRender(_0xca4f26[_0xfdd4('0xc0')],_0x204975),'metadata':null},'redirect':_0xfdd4('0xc7'),'json':!![]};try{if(!_[_0xfdd4('0xc8')](_0xca4f26['vidaooMetadata'])){var _0x227fcf=getMustacheRender(_0xca4f26['vidaooMetadata'],_0x204975);var _0x2aa3d3=JSON[_0xfdd4('0x80')](_0x227fcf);_0x42253b['body'][_0xfdd4('0xc9')]=_0x2aa3d3;}}catch(_0x5e058b){throw new db['Sequelize'][(_0xfdd4('0xca'))](_0xfdd4('0xcb'));}return rp(_0x42253b);}else{throw new db[(_0xfdd4('0x90'))][(_0xfdd4('0xca'))]('Error\x20in\x20Vidaoo\x20configuration');}})['then'](function(_0x28df36){_0x42a3dc=_0x28df36;if(_0x42a3dc['id']){var _0x1bb704={'body':_0x42a3dc['join_url'],'ChatWebsiteId':_0xca4f26['id'],'ChatInteractionId':_0x5015a1['id'],'direction':'out','UserId':_0x46e3ad[_0xfdd4('0x98')]['id']};return db[_0xfdd4('0xcc')][_0xfdd4('0xb9')](_0x1bb704,{});}else{throw new db['Sequelize'][(_0xfdd4('0xca'))](_0xfdd4('0xcd'));}})[_0xfdd4('0x20')](function(){return _0x5015a1[_0xfdd4('0xce')]({'vidaooSessionId':_0x42a3dc['id']});})['then'](respondWithResult(_0x29fcd4,null))[_0xfdd4('0x29')](handleError(_0x29fcd4,null));};exports[_0xfdd4('0xcf')]=function(_0x23dd10,_0x23746f){if(_0x23dd10[_0xfdd4('0x3c')]['id']){delete _0x23dd10['body']['id'];}return db[_0xfdd4('0x9f')][_0xfdd4('0x67')]({'where':{'id':_0x23dd10['params']['id']},'include':[{'model':db[_0xfdd4('0xd0')],'as':_0xfdd4('0x6d')}]})[_0xfdd4('0x20')](handleEntityNotFound(_0x23746f,null))[_0xfdd4('0x20')](saveUpdates(_0x23dd10[_0xfdd4('0x3c')],null))[_0xfdd4('0x20')](respondWithResult(_0x23746f,null))[_0xfdd4('0x29')](handleError(_0x23746f,null));};exports[_0xfdd4('0xd1')]=function(_0x3b6cfc,_0x20b6b1,_0x308201){if(_0x3b6cfc[_0xfdd4('0x3c')]['id']){delete _0x3b6cfc[_0xfdd4('0x3c')]['id'];}return db[_0xfdd4('0x9f')][_0xfdd4('0x67')]({'where':{'id':_0x3b6cfc['params']['id']}})['then'](function(_0x44b024){if(!_0x44b024){logger['error']('abandonInteraction,\x20%s,\x20%s,\x20%s',_0xfdd4('0xd1'),0x194,_0xfdd4('0xd2'));_0x20b6b1[_0xfdd4('0x2a')](0x194);}else{if(_0x44b024[_0xfdd4('0x79')]){throw new db[(_0xfdd4('0x90'))][(_0xfdd4('0xca'))](_0xfdd4('0xd3'));}}return _0x44b024;})['then'](function(_0x24e4be){if(_0x24e4be){return _0x24e4be[_0xfdd4('0x35')]({'closed':_0x3b6cfc['body']['closed'],'disposition':_0x3b6cfc['body'][_0xfdd4('0xd4')]})['then'](function(_0x28d8d9){return _0x28d8d9;});}})['then'](function(_0x52ff15){return respondWithRpcPromise(_0xfdd4('0xd5'),_0xfdd4('0xd1'),_0x3b6cfc[_0xfdd4('0x3c')],client9004);})[_0xfdd4('0x20')](respondWithResult(_0x20b6b1,null))[_0xfdd4('0x29')](handleError(_0x20b6b1,null));};exports[_0xfdd4('0xd6')]=function(_0x461070,_0x17f504,_0x156173){_0x461070['body'][_0xfdd4('0x38')]=_0x461070[_0xfdd4('0xd7')]['originalname'];_0x461070[_0xfdd4('0x3c')][_0xfdd4('0xd8')]=_0x461070['file']['filename'];_0x461070['body']['type']=_0x461070[_0xfdd4('0xd7')][_0xfdd4('0xd9')];return db['Attachment'][_0xfdd4('0xb9')](_0x461070['body'])[_0xfdd4('0x20')](respondWithResult(_0x17f504,0xc9))[_0xfdd4('0x29')](handleError(_0x17f504,null));};exports[_0xfdd4('0xda')]=function(_0x2093a5,_0x2c36a3,_0x45fa09){return db[_0xfdd4('0x9f')]['findOne']({'where':{'id':_0x2093a5['params']['id']},'raw':!![]})[_0xfdd4('0x20')](handleEntityNotFound(_0x2c36a3,null))[_0xfdd4('0x20')](function(_0x2b65d7){if(_0x2b65d7){if(_0x2b65d7[_0xfdd4('0xdb')]){return _0x2c36a3[_0xfdd4('0x2b')](0x193)['json']({'status':0x193,'message':_0xfdd4('0xdc')});}return db[_0xfdd4('0xdd')][_0xfdd4('0xbd')]({'where':{'id':_0x2093a5['query']['attachId']},'raw':!![]})[_0xfdd4('0x20')](handleEntityNotFound(_0x2c36a3,null));}})[_0xfdd4('0x20')](function(_0x2f6456){if(_0x2f6456){var _0x1ff8d6=_0x2f6456[_0xfdd4('0xde')]!==null;var _0xa64a3b=path['join'](config['root'],_0xfdd4('0xdf'));if(_0x1ff8d6){_0xa64a3b=path[_0xfdd4('0xe0')](_0xa64a3b,_0xfdd4('0xe1'));}var _0x5a4bd4=path[_0xfdd4('0xe0')](_0xa64a3b,_0x2f6456['basename']);return _0x2c36a3[_0xfdd4('0xe2')](_0x5a4bd4);}})['catch'](handleError(_0x2c36a3,null));};exports[_0xfdd4('0xe3')]=function(_0x12beac,_0x5a78bc){var _0x2d1810=null;var _0x308050=null;var _0x1f1ec8=null;var _0x2e3342=null;if(_0x12beac['body']['id']){delete _0x12beac[_0xfdd4('0x3c')]['id'];}if(_0x12beac[_0xfdd4('0x3c')][_0xfdd4('0xe4')]){_0x2e3342=path[_0xfdd4('0xe0')](config[_0xfdd4('0xe5')],_0xfdd4('0xe6'),util['format'](_0xfdd4('0xe7'),Date['now']()));_0x12beac[_0xfdd4('0x3c')][_0xfdd4('0xe8')]=_0x2e3342;}return db[_0xfdd4('0x9f')][_0xfdd4('0x67')]({'where':{'id':_0x12beac[_0xfdd4('0xba')]['id']},'include':[{'model':db[_0xfdd4('0xcc')],'as':_0xfdd4('0xe9'),'include':[{'model':db[_0xfdd4('0x77')],'as':_0xfdd4('0x77')}]}]})[_0xfdd4('0x20')](handleEntityNotFound(_0x5a78bc,null))[_0xfdd4('0x20')](saveUpdates(_0x12beac[_0xfdd4('0x3c')],null))['then'](function(_0x13df51){if(_0x13df51){_0x2d1810=_0x13df51;return db['ChatWebsite'][_0xfdd4('0x67')]({'where':{'id':_0x2d1810['ChatWebsiteId']}});}})['then'](function(_0x17da2a){if(_0x17da2a){_0x1f1ec8=_0x17da2a;return db[_0xfdd4('0xd0')][_0xfdd4('0x67')]({'where':{'id':_0x2d1810[_0xfdd4('0x72')]}});}})[_0xfdd4('0x20')](function(_0x1cf955){if(_0x1cf955){_0x308050=_0x1cf955;if(_0x2e3342){var _0x2d74d1=null;for(var _0x5c70bf=0x1;_0x5c70bf<_0x2d1810[_0xfdd4('0xe9')][_0xfdd4('0x50')];++_0x5c70bf){_0x2d74d1=_0x2d1810[_0xfdd4('0xe9')][_0x5c70bf];var _0x5a7c66=_0x2d74d1[_0xfdd4('0x79')]?util[_0xfdd4('0xea')](_0xfdd4('0xeb'),_0x1f1ec8[_0xfdd4('0xec')],_0x2d74d1[_0xfdd4('0x79')]):_0xfdd4('0xed');var _0x43c681=_0x12beac[_0xfdd4('0x3c')][_0xfdd4('0xee')]||util[_0xfdd4('0xea')](_0xfdd4('0xeb'),'Visitor',_0x2d74d1['ContactId']);switch(_0x1f1ec8[_0xfdd4('0xef')]){case _0xfdd4('0xf0'):_0x5a7c66=_0x2d74d1[_0xfdd4('0x79')]?util[_0xfdd4('0xea')]('%s%d',_0x1f1ec8[_0xfdd4('0xec')],_0x2d74d1['UserId']):_0xfdd4('0xed');break;case _0xfdd4('0xf1'):_0x5a7c66=_0x2d74d1[_0xfdd4('0x79')]?_0x2d74d1['User'][_0xfdd4('0xf2')]||_0x2d74d1[_0xfdd4('0x77')][_0xfdd4('0x41')]:_0xfdd4('0xed');break;case _0xfdd4('0xf3'):_0x5a7c66=_0x2d74d1[_0xfdd4('0x79')]?_0x2d74d1[_0xfdd4('0x77')][_0xfdd4('0x41')]:_0xfdd4('0xed');break;default:_0x5a7c66=_0x2d74d1[_0xfdd4('0x79')]?util[_0xfdd4('0xea')]('%s%d',_0x1f1ec8[_0xfdd4('0xec')],_0x2d74d1[_0xfdd4('0x79')]):'System';}var _0x3621f3=util[_0xfdd4('0xea')](_0xfdd4('0xf4'),moment(_0x2d74d1[_0xfdd4('0xf5')])['format'](_0xfdd4('0xf6')),_0x2d74d1[_0xfdd4('0xf7')]==='in'?_0x43c681:_0x5a7c66,_0x2d74d1[_0xfdd4('0x3c')]);if(!_0x2d74d1[_0xfdd4('0xf8')]){fs[_0xfdd4('0xf9')](_0x2e3342,_0x3621f3);}}return db[_0xfdd4('0xfa')][_0xfdd4('0xbd')]({'where':{'service':!![]},'include':[{'model':db[_0xfdd4('0xfb')],'as':'Smtp','raw':!![]}]});}}})[_0xfdd4('0x20')](function(_0x4c248e){if(_0x4c248e&&_0x4c248e[_0xfdd4('0xfc')]&&_0x12beac['body']){var _0x5e8af7={'tls':{'rejectUnauthorized':![]}};if(_0x4c248e[_0xfdd4('0xfc')][_0xfdd4('0xfd')]){_0x5e8af7[_0xfdd4('0xfd')]=_0x4c248e[_0xfdd4('0xfc')][_0xfdd4('0xfd')];}else{_0x5e8af7[_0xfdd4('0xfe')]=_0x4c248e[_0xfdd4('0xfc')]['host'];_0x5e8af7[_0xfdd4('0xff')]=_0x4c248e[_0xfdd4('0xfc')][_0xfdd4('0xff')];_0x5e8af7[_0xfdd4('0x100')]=_0x4c248e[_0xfdd4('0xfc')][_0xfdd4('0x100')];}if(_0x4c248e[_0xfdd4('0xfc')][_0xfdd4('0x101')]){_0x5e8af7['auth']={'user':_0x4c248e[_0xfdd4('0xfc')][_0xfdd4('0x98')],'pass':_0x4c248e[_0xfdd4('0xfc')][_0xfdd4('0x102')]};}return respondWithRpcPromise(_0xfdd4('0x103'),_0xfdd4('0x104'),{'account':_0x5e8af7,'message':{'from':util[_0xfdd4('0xea')]('\x22%s\x22\x20<%s>',_0x4c248e['name'],_0x4c248e[_0xfdd4('0xc2')]||_0x4c248e[_0xfdd4('0xfc')][_0xfdd4('0x98')]),'to':_0x12beac[_0xfdd4('0x3c')][_0xfdd4('0xe4')],'subject':_0xfdd4('0x105'),'text':util[_0xfdd4('0xea')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x12beac[_0xfdd4('0x3c')][_0xfdd4('0xe4')]),'attachments':[{'path':_0x2e3342}]}})['then'](function(){return _0x2d1810;})['catch'](function(_0x1336e1){console[_0xfdd4('0x26')](_0x1336e1);});}else{return _0x2d1810;}})[_0xfdd4('0x20')](respondWithStatusCode(_0x5a78bc,0xc8))[_0xfdd4('0x29')](handleError(_0x5a78bc,null));};exports[_0xfdd4('0x106')]=function(_0x25656c,_0x5f51e6,_0x4fbd83){return db[_0xfdd4('0xcc')][_0xfdd4('0x67')]({'where':{'id':_0x25656c['params']['id']}})[_0xfdd4('0x20')](handleEntityNotFound(_0x5f51e6,null))['then'](function(_0x13cf75){if(_0x13cf75){return _0x13cf75[_0xfdd4('0x106')](_0x25656c[_0xfdd4('0x3c')][_0xfdd4('0x107')],_[_0xfdd4('0x108')](_0x25656c['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x5f51e6,null))[_0xfdd4('0x29')](handleError(_0x5f51e6,null));};exports['getMessages']=function(_0x106064,_0x536c4b,_0x7101d2){var _0x317d77={'raw':![],'where':{}};var _0x599d63={};var _0x529474={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xfdd4('0xbd')]({'where':{'id':_0x106064[_0xfdd4('0xba')]['id']}})[_0xfdd4('0x20')](handleEntityNotFound(_0x536c4b,null))[_0xfdd4('0x20')](function(_0x4c33bc){if(_0x4c33bc){_0x599d63['model']=_[_0xfdd4('0x4a')](db[_0xfdd4('0xcc')][_0xfdd4('0x47')]);_0x599d63[_0xfdd4('0x49')]=_[_0xfdd4('0x4a')](_0x106064[_0xfdd4('0x49')]);_0x599d63['filters']=_[_0xfdd4('0x4c')](_0x599d63[_0xfdd4('0x4e')],_0x599d63['query']);_0x317d77[_0xfdd4('0x4d')]=_['intersection'](_0x599d63[_0xfdd4('0x4e')],qs[_0xfdd4('0x4f')](_0x106064[_0xfdd4('0x49')][_0xfdd4('0x4f')]));_0x317d77[_0xfdd4('0x4d')]=_0x317d77[_0xfdd4('0x4d')][_0xfdd4('0x50')]?_0x317d77[_0xfdd4('0x4d')]:_0x599d63['model'];if(!_0x106064[_0xfdd4('0x49')][_0xfdd4('0x51')](_0xfdd4('0x109'))){_0x317d77[_0xfdd4('0x2f')]=qs['limit'](_0x106064[_0xfdd4('0x49')]['limit']);_0x317d77[_0xfdd4('0x31')]=qs[_0xfdd4('0x31')](_0x106064[_0xfdd4('0x49')]['offset']);}_0x317d77['order']=qs[_0xfdd4('0x10a')](_0x106064[_0xfdd4('0x49')]['sort']);_0x317d77[_0xfdd4('0x7e')]=qs['filters'](_['pick'](_0x106064[_0xfdd4('0x49')],_0x599d63[_0xfdd4('0x4b')]));_0x317d77[_0xfdd4('0x7e')][_0xfdd4('0x10b')]=_0x4c33bc['id'];if(_0x106064['query']['filter']){_0x317d77[_0xfdd4('0x7e')]=_[_0xfdd4('0x3b')](_0x317d77[_0xfdd4('0x7e')],{'$or':_['map'](_0x317d77[_0xfdd4('0x4d')],function(_0x2b1f92){var _0x57c9bb={};_0x57c9bb[_0x2b1f92]={'$like':'%'+_0x106064[_0xfdd4('0x49')]['filter']+'%'};return _0x57c9bb;})});}if(_0x106064[_0xfdd4('0x49')][_0xfdd4('0x10c')]){var _0x4b97fa=_0x106064['query']['$gte']['split'](',');var _0x54fec8={};_0x54fec8[_0x4b97fa[0x0]]={'$gte':moment(_0x4b97fa[0x1])[_0xfdd4('0xea')]('YYYY-MM-DD\x20HH:mm:ss')};_0x317d77[_0xfdd4('0x7e')]=_[_0xfdd4('0x3b')](_0x317d77[_0xfdd4('0x7e')],_0x54fec8);}_0x317d77=_[_0xfdd4('0x3b')]({},_0x317d77,_0x106064[_0xfdd4('0xb8')]);return db['ChatMessage']['count']({'where':_0x317d77[_0xfdd4('0x7e')]})[_0xfdd4('0x20')](function(_0x22c2b9){_0x529474[_0xfdd4('0x30')]=_0x22c2b9;if(_0x106064[_0xfdd4('0x49')][_0xfdd4('0xb6')]){_0x317d77[_0xfdd4('0xb7')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x317d77);})[_0xfdd4('0x20')](function(_0xa129e4){_0x529474[_0xfdd4('0xb5')]=_0xa129e4;return _0x529474;});}})[_0xfdd4('0x20')](respondWithFilteredResult(_0x536c4b,_0x317d77))[_0xfdd4('0x29')](handleError(_0x536c4b,null));};exports[_0xfdd4('0x10d')]=function(_0x18ad0c,_0x5ba916,_0x2d3c9f){var _0x5de8d0={'where':{}},_0x4f2eea={},_0x3341ae={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xfdd4('0xbd')]({'where':{'id':_0x18ad0c[_0xfdd4('0xba')]['id']}})['then'](handleEntityNotFound(_0x5ba916,null))[_0xfdd4('0x20')](function(_0x20c9f6){if(_0x20c9f6){_0x4f2eea[_0xfdd4('0x4e')]=_[_0xfdd4('0x4a')](db[_0xfdd4('0xcc')]['rawAttributes']);_0x4f2eea[_0xfdd4('0x49')]=_[_0xfdd4('0x4a')](_0x18ad0c[_0xfdd4('0x49')]);_0x4f2eea['filters']=_[_0xfdd4('0x4c')](_0x4f2eea[_0xfdd4('0x4e')],_0x4f2eea['query']);_0x5de8d0[_0xfdd4('0x4d')]=_[_0xfdd4('0x4c')](_0x4f2eea[_0xfdd4('0x4e')],qs[_0xfdd4('0x4f')](_0x18ad0c['query']['fields']));_0x5de8d0[_0xfdd4('0x4d')]=_0x5de8d0['attributes'][_0xfdd4('0x50')]?_0x5de8d0[_0xfdd4('0x4d')]:_0x4f2eea[_0xfdd4('0x4e')];if(!_0x18ad0c[_0xfdd4('0x49')][_0xfdd4('0x51')]('nolimit')){_0x5de8d0[_0xfdd4('0x2f')]=qs[_0xfdd4('0x2f')](_0x18ad0c['query'][_0xfdd4('0x2f')]);_0x5de8d0[_0xfdd4('0x31')]=qs[_0xfdd4('0x31')](_0x18ad0c['query'][_0xfdd4('0x31')]);}_0x5de8d0['order']=qs[_0xfdd4('0x10a')](_0x18ad0c['query']['sort']);_0x5de8d0[_0xfdd4('0x7e')]=qs[_0xfdd4('0x4b')](_[_0xfdd4('0x52')](_0x18ad0c[_0xfdd4('0x49')],_0x4f2eea[_0xfdd4('0x4b')]));_0x5de8d0[_0xfdd4('0x7e')]['ChatInteractionId']=_0x20c9f6['id'];if(_0x18ad0c[_0xfdd4('0x49')][_0xfdd4('0x10e')]){_0x5de8d0[_0xfdd4('0x7e')]=_['merge'](_0x5de8d0['where'],{'$or':_[_0xfdd4('0x40')](_0x5de8d0['attributes'],function(_0xa03de8){var _0x141042={};_0x141042[_0xa03de8]={'$like':'%'+_0x18ad0c[_0xfdd4('0x49')]['filter']+'%'};return _0x141042;})});}_0x5de8d0['where'][_0xfdd4('0xf8')]=![];if(_0x18ad0c[_0xfdd4('0x49')]['id']){_0x5de8d0[_0xfdd4('0x7e')]['id']={'$gt':_0x18ad0c[_0xfdd4('0x49')]['id']};}_0x5de8d0=_[_0xfdd4('0x3b')]({},_0x5de8d0,_0x18ad0c[_0xfdd4('0xb8')]);return db[_0xfdd4('0xcc')][_0xfdd4('0x30')]({'where':_0x5de8d0[_0xfdd4('0x7e')]})[_0xfdd4('0x20')](function(_0x21e917){_0x3341ae['count']=_0x21e917;_0x5de8d0[_0xfdd4('0xb7')]=[];if(_0x18ad0c[_0xfdd4('0x49')]['includeAgent']){_0x5de8d0[_0xfdd4('0xb7')][_0xfdd4('0x46')]({'model':db[_0xfdd4('0x77')],'as':_0xfdd4('0x77'),'attributes':['id',_0xfdd4('0x41'),_0xfdd4('0xf2')]});}if(_0x18ad0c[_0xfdd4('0x49')][_0xfdd4('0xb6')]){_0x5de8d0[_0xfdd4('0xb7')]=[{'all':!![]}];}return db[_0xfdd4('0xcc')][_0xfdd4('0x10f')](_0x5de8d0);})[_0xfdd4('0x20')](function(_0x1c18f8){_0x3341ae['rows']=_0x1c18f8;return _0x3341ae;});}})[_0xfdd4('0x20')](respondWithFilteredResult(_0x5ba916,_0x5de8d0))[_0xfdd4('0x29')](handleError(_0x5ba916,null));};exports['addTags']=function(_0x31db99,_0x692aa1,_0x1003d4){return db['ChatInteraction'][_0xfdd4('0x67')]({'where':{'id':_0x31db99[_0xfdd4('0xba')]['id']}})[_0xfdd4('0x20')](handleEntityNotFound(_0x692aa1,null))['then'](function(_0x5b5edb){if(_0x5b5edb){return _0x5b5edb[_0xfdd4('0x110')](_0x31db99[_0xfdd4('0x3c')][_0xfdd4('0x107')],_[_0xfdd4('0x108')](_0x31db99[_0xfdd4('0x3c')],[_0xfdd4('0x107'),'id'])||{})[_0xfdd4('0x111')](function(){return db[_0xfdd4('0x75')][_0xfdd4('0x10f')]({'attributes':['id',_0xfdd4('0x38'),'color'],'where':{'id':_0x31db99['body']['ids']}});})[_0xfdd4('0x20')](function(_0x1a8c71){socket[_0xfdd4('0x112')](_0xfdd4('0x113'),{'id':Number(_0x31db99[_0xfdd4('0xba')]['id']),'tags':_0x1a8c71||[]});return{'id':Number(_0x31db99[_0xfdd4('0xba')]['id']),'tags':_0x1a8c71||[]};});}})[_0xfdd4('0x20')](respondWithResult(_0x692aa1,null))['catch'](handleError(_0x692aa1,null));};exports[_0xfdd4('0x114')]=function(_0x456534,_0x1178b3,_0x272948){return db[_0xfdd4('0x9f')]['find']({'where':{'id':_0x456534[_0xfdd4('0xba')]['id']}})['then'](handleEntityNotFound(_0x1178b3,null))['then'](function(_0x360298){if(_0x360298){return _0x360298['removeTags'](_0x456534['query'][_0xfdd4('0x107')]);}})['then'](respondWithStatusCode(_0x1178b3,null))[_0xfdd4('0x29')](handleError(_0x1178b3,null));};exports[_0xfdd4('0xe2')]=function(_0x39f38f,_0x4a9e25){var _0x535d2b=moment()[_0xfdd4('0x115')]()[_0xfdd4('0x9d')]();var _0x24b726=path[_0xfdd4('0xe0')](config[_0xfdd4('0xe5')],'server','files',_0xfdd4('0x116'));var _0x260fe6=path[_0xfdd4('0xe0')](config[_0xfdd4('0xe5')],_0xfdd4('0x117'),_0xfdd4('0x118'),_0xfdd4('0x119'));var _0x4d52d3=path['join'](_0x24b726,_0x535d2b);var _0x31124f=util['format'](_0xfdd4('0x11a'),_0x39f38f['params']['id'],_0x535d2b);var _0x38e24c=path[_0xfdd4('0xe0')](_0x24b726,_0x31124f);var _0x25f9c9=[];_0x25f9c9[_0xfdd4('0x46')]({'model':db['User'],'as':_0xfdd4('0x77'),'attributes':['id',_0xfdd4('0x41')],'raw':!![]});_0x25f9c9['push']({'model':db[_0xfdd4('0xd0')],'as':'Contact','attributes':['id','firstName',_0xfdd4('0x11b')],'raw':!![]});if(_0x39f38f['query'][_0xfdd4('0x119')]){_0x25f9c9[_0xfdd4('0x46')]({'model':db[_0xfdd4('0xdd')],'as':_0xfdd4('0xdd'),'raw':!![]});}var _0x1a5c91=[{'model':db[_0xfdd4('0xcc')],'as':_0xfdd4('0xe9'),'attributes':['id','body',_0xfdd4('0xf5'),_0xfdd4('0xf7'),'secret','read'],'include':_0x25f9c9}];_0x1a5c91[_0xfdd4('0x46')]({'model':db[_0xfdd4('0x11c')],'as':_0xfdd4('0x11d'),'attributes':['id','name']});_0x1a5c91[_0xfdd4('0x46')]({'model':db[_0xfdd4('0x77')],'as':'Owner','attributes':['id','fullname']});return db[_0xfdd4('0x9f')]['find']({'where':{'id':_0x39f38f['params']['id']},'include':_0x1a5c91})[_0xfdd4('0x20')](handleEntityNotFound(_0x4a9e25,null))[_0xfdd4('0x20')](function(_0xbde236){if(_0xbde236){var _0x2de8b3=_0xbde236[_0xfdd4('0x11e')]({'plain':!![]});fs[_0xfdd4('0x11f')](_0x4d52d3);var _0x1563a5={'channel':_0xfdd4('0x120'),'account':_0x2de8b3[_0xfdd4('0x11d')][_0xfdd4('0x38')],'agent':_0x2de8b3[_0xfdd4('0x121')]?_0x2de8b3[_0xfdd4('0x121')]['fullname']:_0xfdd4('0x122'),'createdAt':moment(_0x2de8b3[_0xfdd4('0xf5')])[_0xfdd4('0xea')](_0xfdd4('0x123'))[_0xfdd4('0x9d')](),'closedAt':_0x2de8b3['closed']?moment(_0x2de8b3[_0xfdd4('0x124')])[_0xfdd4('0xea')]('YYYY-MM-DD\x20HH:mm:ss')[_0xfdd4('0x9d')]():'','disposition':_0x2de8b3['disposition'],'chatInfo':{'browser':_0x2de8b3[_0xfdd4('0x125')],'os':_0x2de8b3[_0xfdd4('0x126')],'referer':_0x2de8b3[_0xfdd4('0x127')],'customerIp':_0x2de8b3['customerIp'],'customerPort':_0x2de8b3[_0xfdd4('0x128')]?_0x2de8b3[_0xfdd4('0x128')]:_0xfdd4('0x122')},'messages':_(_0x2de8b3[_0xfdd4('0xe9')])['tail']()[_0xfdd4('0x10e')]({'secret':![]})[_0xfdd4('0x40')](function(_0x46e0e2){if(_0x46e0e2['Attachment']){var _0x306fc1=path[_0xfdd4('0xe0')](_0x260fe6,_0x46e0e2['Attachment'][_0xfdd4('0xd8')]);if(fs[_0xfdd4('0x129')](_0x306fc1)){fs[_0xfdd4('0x12a')](_0x306fc1)[_0xfdd4('0x12b')](fs[_0xfdd4('0x12c')](path['join'](_0x4d52d3,_0x46e0e2[_0xfdd4('0xdd')][_0xfdd4('0xd8')])));}}return{'date':moment(_0x46e0e2['createdAt'])[_0xfdd4('0xea')](_0xfdd4('0x123'))[_0xfdd4('0x9d')](),'sender':_0x46e0e2[_0xfdd4('0xf7')]===_0xfdd4('0x12d')?_0x46e0e2[_0xfdd4('0x77')]?_0x46e0e2[_0xfdd4('0x77')][_0xfdd4('0x41')]:'System':_0x46e0e2['Contact'][_0xfdd4('0x12e')]+(_0x46e0e2['Contact']['lastName']?'\x20'+_0x46e0e2[_0xfdd4('0x6d')]['lastName']:''),'body':_0x46e0e2[_0xfdd4('0xdd')]?_0x46e0e2[_0xfdd4('0xdd')]['basename']:_0x46e0e2[_0xfdd4('0x3c')],'direction':_0x46e0e2[_0xfdd4('0xf7')]===_0xfdd4('0x12d')?'A':'C','secret':_0x46e0e2[_0xfdd4('0xf8')],'read':_0x46e0e2[_0xfdd4('0x85')],'attachment':_0x46e0e2['Attachment']};})[_0xfdd4('0x69')]()};return ejs[_0xfdd4('0x12f')](path[_0xfdd4('0xe0')](config[_0xfdd4('0xe5')],_0xfdd4('0x117'),_0xfdd4('0x130'),_0xfdd4('0x131')),{'interaction':_0x1563a5})[_0xfdd4('0x20')](function(_0x5ac931){var _0x2b8e2b=path['join'](_0x4d52d3,_0xfdd4('0x132')+_0x2de8b3['id']+'-'+_0x535d2b+_0xfdd4('0x133'));var _0x4d5a93={'path':_0x2b8e2b,'channel':'Chat','interactionId':_0x2de8b3['id']};return pdf['createPdfFromHTML'](_0x5ac931,_0x4d5a93);})[_0xfdd4('0x20')](function(){return new BPromise(function(_0x4a323c,_0x384933){zipdir(_0x4d52d3,{'saveTo':_0x38e24c},function(_0x13a826,_0x4ce772){if(_0x13a826)return _0x384933(_0x13a826);return _0x4a323c(_0x4ce772);});})['then'](function(){return new BPromise(function(_0x199881,_0x1fa795){rimraf(_0x4d52d3,function(_0x453527){if(_0x453527)_0x1fa795(_0x453527);return _0x199881();});});})[_0xfdd4('0x20')](function(){return _0x4a9e25[_0xfdd4('0xe2')](_0x38e24c,_0x31124f,function(_0x4fa06b){if(_0x4fa06b){console['log'](_0xfdd4('0x134'),_0x4fa06b);}else{fs['unlinkSync'](_0x38e24c);}});});});}else{return _0x4a9e25[_0xfdd4('0x2a')](0xc8);}})[_0xfdd4('0x29')](handleError(_0x4a9e25,null));}; \ No newline at end of file +var _0xbaf0=['../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','stack','name','body','contact','agent','interaction','account','Users','map','fullname','TagIds','Tags','split','forEach','push','index','ChatInteraction','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','tools_tags','u.id','u.fullname','ui.ChatInteractionId','from','user_has_chat_interactions','left_join','users','chat_interactions','cm_contacts','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','having','`\x20=\x200','`\x20>\x200','Contact','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','value','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','find','UserId','compact','isEmpty','ChatWebsiteId','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','DESC','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','role','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','i.ChatWebsiteId\x20IN\x20?','sequelize','toString','merge','a.key','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','c.mobile','Contact.mobile','c.fax','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','rows','show','params','rawAttributes','includeAll','include','options','create','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooMetadata','email','POST','isNull','vidaooNote','follow','Sequelize','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','out','updateAttributes','CmContact','abandon','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','AbandonInteraction','file','originalname','basename','filename','mimetype','attachId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','format','transcript-%s.txt','pathTranscript','ChatMessage','Messages','User','%s%d','agentAlias','System','customer','website_alias','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','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','findAll','getMyMessages','includeAgent','addTags','setTags','emit','chatInteractionTags:save','removeTags','unix','tmp','server','files','attachments','firstName','lastName','Attachment','Owner','get','mkdirSync','Chat','YYYY-MM-DD\x20HH:mm:ss','disposition','browserName','osName','referer','customerIp','customerPort','N.A.','tail','existsSync','createReadStream','pipe','createWriteStream','renderFile','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','log','err','unlinkSync','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x42a0c3,_0x29bac6){var _0x2c0678=function(_0xae2ed){while(--_0xae2ed){_0x42a0c3['push'](_0x42a0c3['shift']());}};_0x2c0678(++_0x29bac6);}(_0xbaf0,0x12a));var _0x0baf=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xbaf0[_0x432682];return _0x463d05;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0baf('0x0'));var zipdir=require(_0x0baf('0x1'));var jsonpatch=require(_0x0baf('0x2'));var rp=require(_0x0baf('0x3'));var moment=require(_0x0baf('0x4'));var BPromise=require(_0x0baf('0x5'));var Mustache=require('mustache');var util=require(_0x0baf('0x6'));var path=require(_0x0baf('0x7'));var sox=require(_0x0baf('0x8'));var csv=require(_0x0baf('0x9'));var ejs=require(_0x0baf('0xa'));var fs=require('fs');var fs_extra=require(_0x0baf('0xb'));var _=require(_0x0baf('0xc'));var squel=require(_0x0baf('0xd'));var crypto=require(_0x0baf('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x0baf('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0baf('0x10'));var Papa=require(_0x0baf('0x11'));var Redis=require(_0x0baf('0x12'));var authService=require(_0x0baf('0x13'));var qs=require(_0x0baf('0x14'));var as=require(_0x0baf('0x15'));var pdf=require(_0x0baf('0x16'));var hardwareService=require(_0x0baf('0x17'));var logger=require(_0x0baf('0x18'))(_0x0baf('0x19'));var utils=require(_0x0baf('0x1a'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0baf('0x1b'))['db'];config[_0x0baf('0x1c')]=_[_0x0baf('0x1d')](config[_0x0baf('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0x0baf('0x1e'))(new Redis(config['redis']));require(_0x0baf('0x1f'))[_0x0baf('0x20')](socket);var jayson=require(_0x0baf('0x21'));var client=jayson[_0x0baf('0x22')][_0x0baf('0x23')]({'port':0x232b});var client9004=jayson[_0x0baf('0x22')]['http']({'port':0x232c});function respondWithRpcPromise(_0x4cd79d,_0x2312c7,_0x38395b,_0x283408){return new BPromise(function(_0x3d83a3,_0x2cf7da){var _0x288a98=_0x283408||client;return _0x288a98['request'](_0x4cd79d,_0x38395b)[_0x0baf('0x24')](function(_0xfbecec){logger[_0x0baf('0x25')](_0x0baf('0x26'),_0x2312c7,_0x0baf('0x27'));logger[_0x0baf('0x28')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x2312c7,'request\x20sent',JSON[_0x0baf('0x29')](_0xfbecec));if(_0xfbecec[_0x0baf('0x2a')]){if(_0xfbecec[_0x0baf('0x2a')][_0x0baf('0x2b')]===0x1f4){logger[_0x0baf('0x2a')](_0x0baf('0x26'),_0x2312c7,_0xfbecec[_0x0baf('0x2a')][_0x0baf('0x2c')]);return _0x2cf7da(_0xfbecec[_0x0baf('0x2a')][_0x0baf('0x2c')]);}logger['error'](_0x0baf('0x26'),_0x2312c7,_0xfbecec['error'][_0x0baf('0x2c')]);return _0x3d83a3(_0xfbecec['error']['message']);}else{logger[_0x0baf('0x25')]('ChatInteraction,\x20%s,\x20%s',_0x2312c7,'request\x20sent');_0x3d83a3(_0xfbecec[_0x0baf('0x2d')][_0x0baf('0x2c')]);}})[_0x0baf('0x2e')](function(_0x19d9fd){logger[_0x0baf('0x2a')]('ChatInteraction,\x20%s,\x20%s',_0x2312c7,_0x19d9fd);_0x2cf7da(_0x19d9fd);});});}function respondWithStatusCode(_0x448617,_0x4681c5){_0x4681c5=_0x4681c5||0xcc;return function(_0x1ca35a){if(_0x1ca35a){return _0x448617[_0x0baf('0x2f')](_0x4681c5);}return _0x448617[_0x0baf('0x30')](_0x4681c5)[_0x0baf('0x31')]();};}function respondWithResult(_0x453525,_0x549fd0){_0x549fd0=_0x549fd0||0xc8;return function(_0x1590b4){if(_0x1590b4){return _0x453525[_0x0baf('0x30')](_0x549fd0)[_0x0baf('0x32')](_0x1590b4);}};}function respondWithFilteredResult(_0x265915,_0x55c715){return function(_0x29dbdf){if(_0x29dbdf){var _0x34a58a=typeof _0x55c715['offset']===_0x0baf('0x33')&&typeof _0x55c715[_0x0baf('0x34')]===_0x0baf('0x33');var _0xb4dbb1=_0x29dbdf[_0x0baf('0x35')];var _0x366924=_0x34a58a?0x0:_0x55c715[_0x0baf('0x36')];var _0x57476f=_0x34a58a?_0x29dbdf[_0x0baf('0x35')]:_0x55c715[_0x0baf('0x36')]+_0x55c715[_0x0baf('0x34')];var _0x3ed995;if(_0x57476f>=_0xb4dbb1){_0x57476f=_0xb4dbb1;_0x3ed995=0xc8;}else{_0x3ed995=0xce;}_0x265915[_0x0baf('0x30')](_0x3ed995);return _0x265915[_0x0baf('0x37')](_0x0baf('0x38'),_0x366924+'-'+_0x57476f+'/'+_0xb4dbb1)[_0x0baf('0x32')](_0x29dbdf);}return null;};}function patchUpdates(_0x59431b){return function(_0x3ded64){try{jsonpatch[_0x0baf('0x39')](_0x3ded64,_0x59431b,!![]);}catch(_0x165d14){return BPromise[_0x0baf('0x3a')](_0x165d14);}return _0x3ded64[_0x0baf('0x3b')]();};}function saveUpdates(_0x57a6bb,_0x2fd426){return function(_0x53ae1d){if(_0x53ae1d){return _0x53ae1d[_0x0baf('0x3c')](_0x57a6bb)[_0x0baf('0x24')](function(_0x35e534){return _0x35e534;});}return null;};}function removeEntity(_0x3d65f2,_0x5300a5){return function(_0x1a2b03){if(_0x1a2b03){return _0x1a2b03[_0x0baf('0x3d')]()['then'](function(){_0x3d65f2[_0x0baf('0x30')](0xcc)[_0x0baf('0x31')]();});}};}function handleEntityNotFound(_0x62a2ed,_0xbaa9a7){return function(_0x1f60bd){if(!_0x1f60bd){_0x62a2ed[_0x0baf('0x2f')](0x194);}return _0x1f60bd;};}function handleError(_0xe03d82,_0x675461){_0x675461=_0x675461||0x1f4;return function(_0x4aa6ed){logger[_0x0baf('0x2a')](_0x4aa6ed[_0x0baf('0x3e')]);if(_0x4aa6ed['name']){delete _0x4aa6ed[_0x0baf('0x3f')];}_0xe03d82['status'](_0x675461)['send'](_0x4aa6ed);};}function getMustacheRender(_0x11bc49,_0x81af83){return Mustache['render'](_0x11bc49,_['merge'](_0x81af83[_0x0baf('0x40')],{'contact':_0x81af83[_0x0baf('0x41')],'message':_0x81af83[_0x0baf('0x2c')],'agent':_0x81af83[_0x0baf('0x42')],'interaction':_0x81af83[_0x0baf('0x43')],'account':_0x81af83[_0x0baf('0x44')]}))||'';}function getInteractionUsers(_0x290464,_0x37c038){return new BPromise(function(_0x631f74,_0x36c6d2){try{if(_0x37c038[_0x290464['id']]){_0x290464[_0x0baf('0x45')]=_[_0x0baf('0x46')](_0x37c038[_0x290464['id']],function(_0x354cb1){return{'id':_0x354cb1['id'],'fullname':_0x354cb1[_0x0baf('0x47')]};});}}catch(_0x53d6b7){_0x36c6d2(_0x53d6b7);}_0x631f74(_0x290464);});}function getInteractionTags(_0x3573ce,_0x1435d5){return new BPromise(function(_0x4f1de9,_0x38006a){try{if(_0x3573ce[_0x0baf('0x48')]){_0x3573ce[_0x0baf('0x49')]=[];_0x3573ce[_0x0baf('0x48')][_0x0baf('0x4a')](',')[_0x0baf('0x4b')](function(_0x57b581){_0x3573ce[_0x0baf('0x49')][_0x0baf('0x4c')](_0x1435d5[_0x57b581]);});}delete _0x3573ce['TagIds'];}catch(_0x35d442){_0x38006a(_0x35d442);}_0x4f1de9(_0x3573ce);});}function updateChatInteraction(_0x412e6f,_0x45c6aa,_0x57903e){return new BPromise(function(_0x504031,_0x193fd3){return getInteractionUsers(_0x412e6f,_0x57903e)[_0x0baf('0x24')](function(_0x301412){return getInteractionTags(_0x301412,_0x45c6aa);})[_0x0baf('0x24')](function(_0x2b6d54){_0x504031(_0x2b6d54);})[_0x0baf('0x2e')](function(_0x33da34){_0x193fd3(_0x33da34);});});}exports[_0x0baf('0x4d')]=function(_0xce1bf0,_0x355033){var _0x56270e={},_0x2a2a7c={},_0x2bc755={'count':0x0,'rows':[]};var _0x1daf1d=_[_0x0baf('0x46')](db[_0x0baf('0x4e')]['rawAttributes'],function(_0x1e7364){return{'name':_0x1e7364[_0x0baf('0x4f')],'type':_0x1e7364[_0x0baf('0x50')][_0x0baf('0x51')]};});_0x2a2a7c[_0x0baf('0x52')]=_['map'](_0x1daf1d,_0x0baf('0x3f'));_0x2a2a7c[_0x0baf('0x53')]=_[_0x0baf('0x54')](_0xce1bf0[_0x0baf('0x53')]);_0x2a2a7c[_0x0baf('0x55')]=_[_0x0baf('0x56')](_0x2a2a7c[_0x0baf('0x52')],_0x2a2a7c['query']);_0x56270e[_0x0baf('0x57')]=_[_0x0baf('0x56')](_0x2a2a7c[_0x0baf('0x52')],qs['fields'](_0xce1bf0[_0x0baf('0x53')][_0x0baf('0x58')]));_0x56270e[_0x0baf('0x57')]=_0x56270e[_0x0baf('0x57')][_0x0baf('0x59')]?_0x56270e[_0x0baf('0x57')]:_0x2a2a7c[_0x0baf('0x52')];if(!_0xce1bf0['query'][_0x0baf('0x5a')](_0x0baf('0x5b'))){_0x56270e[_0x0baf('0x34')]=qs[_0x0baf('0x34')](_0xce1bf0[_0x0baf('0x53')][_0x0baf('0x34')]);_0x56270e[_0x0baf('0x36')]=qs[_0x0baf('0x36')](_0xce1bf0[_0x0baf('0x53')][_0x0baf('0x36')]);}_0x56270e[_0x0baf('0x5c')]=qs['sort'](_0xce1bf0['query'][_0x0baf('0x5d')]);_0x56270e[_0x0baf('0x5e')]=qs[_0x0baf('0x55')](_[_0x0baf('0x5f')](_0xce1bf0[_0x0baf('0x53')],_0x2a2a7c[_0x0baf('0x55')]),_0x1daf1d);var _0x3403d5=[];var _0x4b492c=squel[_0x0baf('0x60')]()[_0x0baf('0x61')]('id')[_0x0baf('0x61')](_0x0baf('0x3f'))[_0x0baf('0x61')](_0x0baf('0x62'))['from'](_0x0baf('0x63'));var _0x5f123c=squel[_0x0baf('0x60')]()['field'](_0x0baf('0x64'))['field'](_0x0baf('0x65'))['field'](_0x0baf('0x66'))[_0x0baf('0x67')](_0x0baf('0x68'),'ui')[_0x0baf('0x69')](_0x0baf('0x6a'),'u','u.id\x20=\x20ui.UserId');var _0x21f179=squel[_0x0baf('0x60')]()[_0x0baf('0x67')](_0x0baf('0x6b'),'i')[_0x0baf('0x69')](_0x0baf('0x6c'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x0baf('0x69')](_0x0baf('0x6a'),'o',_0x0baf('0x6d'))[_0x0baf('0x69')](_0x0baf('0x6e'),'a',_0x0baf('0x6f'))[_0x0baf('0x69')]('chat_messages','me','me.ChatInteractionId\x20=\x20i.id')[_0x0baf('0x69')](_0x0baf('0x70'),'it',_0x0baf('0x71'))[_0x0baf('0x69')](_0x0baf('0x63'),'t',_0x0baf('0x72'));var _0xaa4293=squel[_0x0baf('0x73')]();var _0x3d9a32=[];var _0x585969=squel[_0x0baf('0x73')]();var _0x268be8;if(_0xce1bf0[_0x0baf('0x53')][_0x0baf('0x74')]){_0x268be8=as[_0x0baf('0x75')](_0xce1bf0[_0x0baf('0x53')][_0x0baf('0x74')]);var _0x51d75f=_0x268be8[_0x0baf('0x76')];for(var _0x27f580=0x0;_0x27f580<_0x268be8[_0x0baf('0x77')][_0x0baf('0x59')];_0x27f580++){var _0x1c7d88=_0x268be8[_0x0baf('0x77')][_0x27f580];var _0x14e6d0='i';var _0x12543e=_['find'](_0x1daf1d,[_0x0baf('0x3f'),_0x1c7d88['field']]);if(!_0x12543e){switch(_0x1c7d88[_0x0baf('0x61')]){case'unreadMessages':if(_0x1c7d88['value']==0x1){_0x21f179[_0x0baf('0x78')]('`'+_0x1c7d88['field']+_0x0baf('0x79'));}else{_0x21f179[_0x0baf('0x78')]('`'+_0x1c7d88['field']+_0x0baf('0x7a'));}break;case _0x0baf('0x7b'):if(_0x1c7d88[_0x0baf('0x7c')]==='$substring'){if(_0x1c7d88['value'][_0x0baf('0x4a')]('\x20')[_0x0baf('0x59')]>0x1){_0xaa4293[_0x51d75f](_0x0baf('0x7d'),qs[_0x0baf('0x7e')](_0x1c7d88[_0x0baf('0x7f')]),null);}else{var _0x588b88='%'+_0x1c7d88[_0x0baf('0x7f')]+'%';_0xaa4293[_0x51d75f]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x588b88,_0x588b88,_0x588b88);}}else{_0x12543e=_['find'](_0x1daf1d,['name',_0x0baf('0x80')]);_0x1c7d88['field']='ContactId';_0xf45ec3=as[_0x0baf('0x81')](_0x14e6d0,_0x12543e[_0x0baf('0x50')],_0x1c7d88);_0xaa4293[_0x51d75f](_0xf45ec3[_0x0baf('0x82')],_0xf45ec3[_0x0baf('0x7f')][_0x0baf('0x83')],_0xf45ec3[_0x0baf('0x7f')]['end']);}break;case _0x0baf('0x84'):var _0x1a0a67=_0x1c7d88[_0x0baf('0x7f')][_0x0baf('0x4a')](',')[_0x0baf('0x46')](function(_0x1273f4){return Number(_0x1273f4);});_0x1a0a67['forEach'](function(_0x42e8ad){_0x585969['or'](_0x0baf('0x85'),'%,'+_0x42e8ad+',%');});_0x3d9a32=_[_0x0baf('0x86')](_0x3d9a32,_0x1a0a67);break;case'User':if(_0x1c7d88[_0x0baf('0x7c')]===_0x0baf('0x87')){_0xaa4293[_0x51d75f](_0x0baf('0x88'),'%'+_0x1c7d88[_0x0baf('0x7f')]+'%',null);}else{_0x12543e=_[_0x0baf('0x89')](_0x1daf1d,[_0x0baf('0x3f'),_0x0baf('0x8a')]);_0x1c7d88['field']='UserId';_0xf45ec3=as['buildExpression'](_0x14e6d0,_0x12543e[_0x0baf('0x50')],_0x1c7d88);_0xaa4293[_0x51d75f](_0xf45ec3[_0x0baf('0x82')],_0xf45ec3[_0x0baf('0x7f')][_0x0baf('0x83')],_0xf45ec3[_0x0baf('0x7f')][_0x0baf('0x31')]);}break;case'body':_0xf45ec3=as['buildExpression']('me',null,_0x1c7d88);_0xaa4293[_0x51d75f](_0xf45ec3[_0x0baf('0x82')],_0xf45ec3['value'][_0x0baf('0x83')],_0xf45ec3[_0x0baf('0x7f')]['end']);break;}}else{var _0xf45ec3=as[_0x0baf('0x81')](_0x14e6d0,_0x12543e[_0x0baf('0x50')],_0x1c7d88);_0xaa4293[_0x51d75f](_0xf45ec3[_0x0baf('0x82')],_0xf45ec3[_0x0baf('0x7f')][_0x0baf('0x83')],_0xf45ec3[_0x0baf('0x7f')][_0x0baf('0x31')]);}}}else{var _0xfcc697=_(_0xce1bf0['query'])['keys']()['map'](function(_0x493784){return _['some'](_0x1daf1d,[_0x0baf('0x3f'),_0x493784])?_0x493784:undefined;})[_0x0baf('0x8b')]()[_0x0baf('0x7f')]();if(!_[_0x0baf('0x8c')](_0xfcc697)){_0xfcc697['forEach'](function(_0x1be7f2){if(_0x1be7f2===_0x0baf('0x8d')){_0x21f179['where']('i.ChatWebsiteId\x20IN\x20?',[][_0x0baf('0x8e')](_0xce1bf0[_0x0baf('0x53')][_0x1be7f2]));}else if(_0x1be7f2===_0x0baf('0x8f')){var _0x442e5f=JSON[_0x0baf('0x90')](_0xce1bf0[_0x0baf('0x53')][_0x1be7f2])[_0x0baf('0x91')];var _0x399f40=JSON['parse'](_0xce1bf0[_0x0baf('0x53')][_0x1be7f2])[_0x0baf('0x92')];_0x21f179['where'](_0x0baf('0x93'),_0x442e5f,_0x399f40);}else{if(_0xce1bf0[_0x0baf('0x53')][_0x1be7f2]==='null'){_0x21f179[_0x0baf('0x5e')]('i.'+_0x1be7f2+_0x0baf('0x94'));}else{_0x21f179[_0x0baf('0x5e')]('i.'+_0x1be7f2+_0x0baf('0x95'),_0xce1bf0[_0x0baf('0x53')][_0x1be7f2]);}}});}if(_0xce1bf0['query']['read']){if(_0xce1bf0[_0x0baf('0x53')][_0x0baf('0x96')]==0x1){_0x21f179['having'](_0x0baf('0x97'));}else{_0x21f179[_0x0baf('0x78')](_0x0baf('0x98'));}}if(_0xce1bf0['query'][_0x0baf('0x99')]){_0x3d9a32=_[_0x0baf('0x9a')](_0xce1bf0[_0x0baf('0x53')]['tag'])?_0xce1bf0[_0x0baf('0x53')]['tag']:new Array(_0xce1bf0[_0x0baf('0x53')][_0x0baf('0x99')]);_0x3d9a32[_0x0baf('0x4b')](function(_0x2f009f){_0x585969['or'](_0x0baf('0x85'),'%,'+_0x2f009f+',%');});}if(_0xce1bf0['query'][_0x0baf('0x9b')]){var _0x57f33c=_0xce1bf0['query'][_0x0baf('0x9b')][_0x0baf('0x9c')]('\x5c','\x5c\x5c')[_0x0baf('0x9c')](/'/g,'\x27\x27');if(qs[_0x0baf('0x9d')](_0x57f33c)){_0xaa4293['or'](_0x0baf('0x9e'),_0x57f33c+'%');}else{_0xaa4293['or'](_0x0baf('0x9f'),qs[_0x0baf('0x7e')](_0x57f33c))['or'](_0x0baf('0xa0'),_0x57f33c+'%');}}}_0x21f179[_0x0baf('0x5e')](_0xaa4293);_0x21f179[_0x0baf('0xa1')](_0x0baf('0xa2'));var _0x2c2f09={'type':db['Sequelize']['QueryTypes'][_0x0baf('0xa3')],'raw':!![]};var _0x322a09=_0x21f179[_0x0baf('0xa4')]();_0x322a09['field']('i.id');_0x322a09[_0x0baf('0x61')](_0x0baf('0xa5'),_0x0baf('0xa6'));if(_0x56270e[_0x0baf('0x5c')]){_0x56270e[_0x0baf('0x5c')][_0x0baf('0x4b')](function(_0x191d35){var _0xa2d315=_0x191d35[0x0]===_0x0baf('0xa7')?_0x191d35[0x0]:'i.'+_0x191d35[0x0];_0x21f179['order'](_0xa2d315,_0x191d35[0x1]===_0x0baf('0xa8')?![]:!![]);});}if(!_[_0x0baf('0x8c')](_0x3d9a32)){_0x21f179[_0x0baf('0x78')](_0x585969);_0x322a09[_0x0baf('0x5e')]('t.id\x20IN\x20?',_0x3d9a32);}BPromise['resolve']()['then'](function(){if(!_0x268be8){if(_0xce1bf0[_0x0baf('0x53')][_0x0baf('0x8d')])return;_0x322a09['where']('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x21f179[_0x0baf('0x5e')](_0x0baf('0xa9'));return;}if(_0xce1bf0['user'][_0x0baf('0xaa')]!==_0x0baf('0x42'))return;return _0xce1bf0[_0x0baf('0xab')][_0x0baf('0xac')]({'attributes':['id'],'raw':!![]})[_0x0baf('0x24')](function(_0x25081e){if(_[_0x0baf('0x8c')](_0x25081e)){_0x322a09[_0x0baf('0x5e')](_0x0baf('0xad'));_0x21f179[_0x0baf('0x5e')](_0x0baf('0xad'));}else{_0x322a09[_0x0baf('0x5e')]('i.ChatWebsiteId\x20IN\x20?',_[_0x0baf('0x46')](_0x25081e,'id'));_0x21f179[_0x0baf('0x5e')](_0x0baf('0xae'),_[_0x0baf('0x46')](_0x25081e,'id'));}});})[_0x0baf('0x24')](function(){if(_0xce1bf0[_0x0baf('0xab')]['role']===_0x0baf('0x42')&&!_0x268be8&&!_0xce1bf0[_0x0baf('0x53')][_0x0baf('0x8d')])return[];return db[_0x0baf('0xaf')][_0x0baf('0x53')](_0x322a09['toString'](),_0x2c2f09);})[_0x0baf('0x24')](function(_0x30eac8){_0x2bc755[_0x0baf('0x35')]=_0x30eac8[_0x0baf('0x59')];if(_0x2bc755[_0x0baf('0x35')]===0x0)return[];return db['sequelize']['query'](_0x4b492c[_0x0baf('0xb0')](),_0x2c2f09)['then'](function(_0x477cd5){_0x3403d5=_['keyBy'](_0x477cd5,'id');_0x2c2f09=_[_0x0baf('0xb1')](_0x2c2f09,{'model':db[_0x0baf('0x4e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xce1bf0[_0x0baf('0x53')][_0x0baf('0x58')]){_0x56270e['attributes'][_0x0baf('0x4b')](function(_0x106ffa){_0x21f179[_0x0baf('0x61')]('i.'+_0x106ffa);});}else{_0x21f179['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0x21f179['field'](_0x0baf('0xb2'),_0x0baf('0xb3'));_0x21f179[_0x0baf('0x61')](_0x0baf('0xb4'),'Account.mandatoryDisposition');_0x21f179[_0x0baf('0x61')](_0x0baf('0xb5'),_0x0baf('0xa7'));_0x21f179['field'](_0x0baf('0xb6'));_0x21f179[_0x0baf('0x61')]('c.firstName',_0x0baf('0xb7'));_0x21f179['field'](_0x0baf('0xb8'),_0x0baf('0xb9'));_0x21f179[_0x0baf('0x61')](_0x0baf('0xba'),'Contact.email');_0x21f179['field'](_0x0baf('0xbb'),'Contact.phone');_0x21f179[_0x0baf('0x61')](_0x0baf('0xbc'),_0x0baf('0xbd'));_0x21f179[_0x0baf('0x61')](_0x0baf('0xbe'),'Contact.fax');_0x21f179[_0x0baf('0x61')]('o.fullname',_0x0baf('0xbf'));_0x21f179['field'](_0x0baf('0xc0'),'Owner.internal');_0x21f179[_0x0baf('0x61')](_0x0baf('0xc1'),_0x0baf('0x48'));}if(_0x56270e['limit'])_0x21f179['limit'](_0x56270e[_0x0baf('0x34')]);if(_0x56270e[_0x0baf('0x36')])_0x21f179[_0x0baf('0x36')](_0x56270e[_0x0baf('0x36')]);return db[_0x0baf('0xaf')][_0x0baf('0x53')](_0x21f179['toString'](),_0x2c2f09);})[_0x0baf('0x24')](function(_0x5ee37f){if(_0x5ee37f[_0x0baf('0x59')]>0x0)_0x5f123c['where'](_0x0baf('0xc2'),_[_0x0baf('0x46')](_0x5ee37f,'id'));return db[_0x0baf('0xaf')]['query'](_0x5f123c[_0x0baf('0xb0')](),_0x2c2f09)[_0x0baf('0x24')](function(_0x4879b4){var _0x544498=_[_0x0baf('0xc3')](_0x4879b4,_0x0baf('0xc4'));var _0x20dd04=[];_0x5ee37f[_0x0baf('0x4b')](function(_0x4823a3){_0x20dd04['push'](updateChatInteraction(_0x4823a3,_0x3403d5,_0x544498));});return BPromise[_0x0baf('0xc5')](_0x20dd04);});});})[_0x0baf('0x24')](function(_0x116d52){_0x2bc755[_0x0baf('0xc6')]=_0x116d52;return _0x2bc755;})[_0x0baf('0x24')](respondWithFilteredResult(_0x355033,_0x56270e))[_0x0baf('0x2e')](handleError(_0x355033,null));};exports[_0x0baf('0xc7')]=function(_0xe0b67c,_0x205de6){var _0x2369f0={'raw':![],'where':{'id':_0xe0b67c[_0x0baf('0xc8')]['id']}},_0x58f95c={};_0x58f95c['model']=_[_0x0baf('0x54')](db[_0x0baf('0x4e')][_0x0baf('0xc9')]);_0x58f95c[_0x0baf('0x53')]=_['keys'](_0xe0b67c[_0x0baf('0x53')]);_0x58f95c[_0x0baf('0x55')]=_[_0x0baf('0x56')](_0x58f95c[_0x0baf('0x52')],_0x58f95c[_0x0baf('0x53')]);_0x2369f0[_0x0baf('0x57')]=_[_0x0baf('0x56')](_0x58f95c[_0x0baf('0x52')],qs[_0x0baf('0x58')](_0xe0b67c['query'][_0x0baf('0x58')]));_0x2369f0[_0x0baf('0x57')]=_0x2369f0['attributes'][_0x0baf('0x59')]?_0x2369f0[_0x0baf('0x57')]:_0x58f95c[_0x0baf('0x52')];if(_0xe0b67c[_0x0baf('0x53')][_0x0baf('0xca')]){_0x2369f0[_0x0baf('0xcb')]=[{'all':!![]}];}_0x2369f0=_[_0x0baf('0xb1')]({},_0x2369f0,_0xe0b67c[_0x0baf('0xcc')]);return db[_0x0baf('0x4e')]['find'](_0x2369f0)[_0x0baf('0x24')](handleEntityNotFound(_0x205de6,null))[_0x0baf('0x24')](respondWithResult(_0x205de6,null))[_0x0baf('0x2e')](handleError(_0x205de6,null));};exports[_0x0baf('0xcd')]=function(_0x4328d5,_0x270d69){return db['ChatInteraction'][_0x0baf('0xcd')](_0x4328d5[_0x0baf('0x40')],{})[_0x0baf('0x24')](respondWithResult(_0x270d69,0xc9))['catch'](handleError(_0x270d69,null));};exports['update']=function(_0x5adbd9,_0x1adb84){if(_0x5adbd9[_0x0baf('0x40')]['id']){delete _0x5adbd9['body']['id'];}return db[_0x0baf('0x4e')]['find']({'where':{'id':_0x5adbd9[_0x0baf('0xc8')]['id']}})['then'](handleEntityNotFound(_0x1adb84,null))[_0x0baf('0x24')](saveUpdates(_0x5adbd9[_0x0baf('0x40')],null))['then'](respondWithResult(_0x1adb84,null))[_0x0baf('0x2e')](handleError(_0x1adb84,null));};exports[_0x0baf('0x3d')]=function(_0x25d25e,_0x4494de){return db[_0x0baf('0x4e')][_0x0baf('0x89')]({'where':{'id':_0x25d25e[_0x0baf('0xc8')]['id']}})['then'](handleEntityNotFound(_0x4494de,null))[_0x0baf('0x24')](removeEntity(_0x4494de,null))[_0x0baf('0x2e')](handleError(_0x4494de,null));};exports[_0x0baf('0xce')]=function(_0x2e1629,_0x275cc4){return db[_0x0baf('0x4e')][_0x0baf('0xce')]()[_0x0baf('0x24')](respondWithResult(_0x275cc4,null))[_0x0baf('0x2e')](handleError(_0x275cc4,null));};exports[_0x0baf('0xcf')]=function(_0x308b3f,_0xae8bc2){var _0x1390cd=_0x308b3f[_0x0baf('0xc8')]['id'];var _0x59dd6c;var _0x57b64b;var _0x1cd215;return db[_0x0baf('0x4e')][_0x0baf('0xd0')]({'where':{'id':_0x1390cd}})[_0x0baf('0x24')](function(_0x52e98a){_0x59dd6c=_0x52e98a;return db[_0x0baf('0xd1')][_0x0baf('0xd0')]({'where':{'id':_0x52e98a[_0x0baf('0x8d')]},'attributes':['id',_0x0baf('0xd2'),_0x0baf('0xd3'),_0x0baf('0xd4'),'vidaooNote',_0x0baf('0xd5')],'raw':!![]});})[_0x0baf('0x24')](function(_0x347c39){if(_0x347c39&&_0x347c39['vidaooApiKey']&&_0x347c39[_0x0baf('0xd3')]){_0x57b64b=_0x347c39;var _0x106c6e={'interaction':{'id':_0x1390cd},'agent':{'id':_0x308b3f[_0x0baf('0xab')]['id'],'name':_0x308b3f['user']['name'],'fullname':_0x308b3f['user'][_0x0baf('0x47')],'email':_0x308b3f['user'][_0x0baf('0xd6')]},'contact':_0x308b3f[_0x0baf('0x40')]['contact'],'account':_0x308b3f[_0x0baf('0x40')]['account']};var _0x5737b0={'rejectUnauthorized':![],'method':_0x0baf('0xd7'),'url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x347c39[_0x0baf('0xd2')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x308b3f['user']['email']],'buttons':null,'topic':_0x57b64b['vidaooTopic'],'note':_[_0x0baf('0xd8')](_0x57b64b[_0x0baf('0xd9')])?null:getMustacheRender(_0x57b64b[_0x0baf('0xd9')],_0x106c6e),'metadata':null},'redirect':_0x0baf('0xda'),'json':!![]};try{if(!_[_0x0baf('0xd8')](_0x57b64b[_0x0baf('0xd5')])){var _0x20582a=getMustacheRender(_0x57b64b['vidaooMetadata'],_0x106c6e);var _0x36cd08=JSON[_0x0baf('0x90')](_0x20582a);_0x5737b0[_0x0baf('0x40')]['metadata']=_0x36cd08;}}catch(_0x24672f){throw new db[(_0x0baf('0xdb'))][(_0x0baf('0xdc'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x5737b0);}else{throw new db[(_0x0baf('0xdb'))]['ValidationError'](_0x0baf('0xdd'));}})[_0x0baf('0x24')](function(_0x57846e){_0x1cd215=_0x57846e;if(_0x1cd215['id']){var _0xd4ed40={'body':_0x1cd215[_0x0baf('0xde')],'ChatWebsiteId':_0x57b64b['id'],'ChatInteractionId':_0x59dd6c['id'],'direction':_0x0baf('0xdf'),'UserId':_0x308b3f[_0x0baf('0xab')]['id']};return db['ChatMessage'][_0x0baf('0xcd')](_0xd4ed40,{});}else{throw new db[(_0x0baf('0xdb'))]['ValidationError']('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x0baf('0x24')](function(){return _0x59dd6c[_0x0baf('0xe0')]({'vidaooSessionId':_0x1cd215['id']});})[_0x0baf('0x24')](respondWithResult(_0xae8bc2,null))[_0x0baf('0x2e')](handleError(_0xae8bc2,null));};exports['customUpdate']=function(_0x5571d4,_0x16579f){if(_0x5571d4[_0x0baf('0x40')]['id']){delete _0x5571d4[_0x0baf('0x40')]['id'];}return db[_0x0baf('0x4e')][_0x0baf('0x89')]({'where':{'id':_0x5571d4['params']['id']},'include':[{'model':db[_0x0baf('0xe1')],'as':_0x0baf('0x7b')}]})['then'](handleEntityNotFound(_0x16579f,null))[_0x0baf('0x24')](saveUpdates(_0x5571d4[_0x0baf('0x40')],null))['then'](respondWithResult(_0x16579f,null))[_0x0baf('0x2e')](handleError(_0x16579f,null));};exports[_0x0baf('0xe2')]=function(_0x19457c,_0x1f0b00,_0x2484d4){if(_0x19457c[_0x0baf('0x40')]['id']){delete _0x19457c[_0x0baf('0x40')]['id'];}return db[_0x0baf('0x4e')]['find']({'where':{'id':_0x19457c[_0x0baf('0xc8')]['id']}})[_0x0baf('0x24')](function(_0x226edd){if(!_0x226edd){logger[_0x0baf('0x2a')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x0baf('0xe2'),0x194,_0x0baf('0xe3'));_0x1f0b00['sendStatus'](0x194);}else{if(_0x226edd[_0x0baf('0x8a')]){throw new db[(_0x0baf('0xdb'))][(_0x0baf('0xdc'))](_0x0baf('0xe4'));}}return _0x226edd;})['then'](function(_0x3ca1a6){if(_0x3ca1a6){return _0x3ca1a6[_0x0baf('0x3c')]({'closed':_0x19457c[_0x0baf('0x40')][_0x0baf('0xe5')],'disposition':_0x19457c[_0x0baf('0x40')]['disposition']})[_0x0baf('0x24')](function(_0xc5ec1a){return _0xc5ec1a;});}})[_0x0baf('0x24')](function(_0x5d33b4){return respondWithRpcPromise(_0x0baf('0xe6'),_0x0baf('0xe2'),_0x19457c[_0x0baf('0x40')],client9004);})[_0x0baf('0x24')](respondWithResult(_0x1f0b00,null))[_0x0baf('0x2e')](handleError(_0x1f0b00,null));};exports['attachmentUpload']=function(_0x553084,_0x19898e,_0x315ada){_0x553084[_0x0baf('0x40')]['name']=_0x553084[_0x0baf('0xe7')][_0x0baf('0xe8')];_0x553084[_0x0baf('0x40')][_0x0baf('0xe9')]=_0x553084[_0x0baf('0xe7')][_0x0baf('0xea')];_0x553084[_0x0baf('0x40')][_0x0baf('0x50')]=_0x553084[_0x0baf('0xe7')][_0x0baf('0xeb')];return db['Attachment'][_0x0baf('0xcd')](_0x553084[_0x0baf('0x40')])[_0x0baf('0x24')](respondWithResult(_0x19898e,0xc9))[_0x0baf('0x2e')](handleError(_0x19898e,null));};exports['attachmentDownload']=function(_0x413d0d,_0x3d7667,_0x386928){return db['ChatInteraction'][_0x0baf('0xd0')]({'where':{'id':_0x413d0d[_0x0baf('0xc8')]['id']},'raw':!![]})[_0x0baf('0x24')](handleEntityNotFound(_0x3d7667,null))[_0x0baf('0x24')](function(_0x1e4bf1){if(_0x1e4bf1){if(_0x1e4bf1['closed']){return _0x3d7667[_0x0baf('0x30')](0x193)[_0x0baf('0x32')]({'status':0x193,'message':'Unauthorized'});}return db['Attachment'][_0x0baf('0xd0')]({'where':{'id':_0x413d0d[_0x0baf('0x53')][_0x0baf('0xec')]},'raw':!![]})[_0x0baf('0x24')](handleEntityNotFound(_0x3d7667,null));}})[_0x0baf('0x24')](function(_0xb22125){if(_0xb22125){var _0x37c83a=_0xb22125['ChatOfflineMessageId']!==null;var _0x5deb7b=path[_0x0baf('0xed')](config[_0x0baf('0xee')],_0x0baf('0xef'));if(_0x37c83a){_0x5deb7b=path['join'](_0x5deb7b,_0x0baf('0xf0'));}var _0x3a6bf8=path['join'](_0x5deb7b,_0xb22125[_0x0baf('0xe9')]);return _0x3d7667[_0x0baf('0xf1')](_0x3a6bf8);}})['catch'](handleError(_0x3d7667,null));};exports[_0x0baf('0xf2')]=function(_0x9d6974,_0x939365){var _0x4d6ac4=null;var _0x1d86c9=null;var _0x95fe84=null;var _0x2a7138=null;if(_0x9d6974[_0x0baf('0x40')]['id']){delete _0x9d6974[_0x0baf('0x40')]['id'];}if(_0x9d6974[_0x0baf('0x40')][_0x0baf('0xf3')]){_0x2a7138=path['join'](config[_0x0baf('0xee')],'server/files/chat/upload/',util[_0x0baf('0xf4')](_0x0baf('0xf5'),Date['now']()));_0x9d6974['body'][_0x0baf('0xf6')]=_0x2a7138;}return db[_0x0baf('0x4e')][_0x0baf('0x89')]({'where':{'id':_0x9d6974['params']['id']},'include':[{'model':db[_0x0baf('0xf7')],'as':_0x0baf('0xf8'),'include':[{'model':db[_0x0baf('0xf9')],'as':_0x0baf('0xf9')}]}]})[_0x0baf('0x24')](handleEntityNotFound(_0x939365,null))[_0x0baf('0x24')](saveUpdates(_0x9d6974[_0x0baf('0x40')],null))[_0x0baf('0x24')](function(_0x5f3691){if(_0x5f3691){_0x4d6ac4=_0x5f3691;return db['ChatWebsite'][_0x0baf('0x89')]({'where':{'id':_0x4d6ac4[_0x0baf('0x8d')]}});}})['then'](function(_0x210047){if(_0x210047){_0x95fe84=_0x210047;return db[_0x0baf('0xe1')][_0x0baf('0x89')]({'where':{'id':_0x4d6ac4[_0x0baf('0x80')]}});}})[_0x0baf('0x24')](function(_0x8806f9){if(_0x8806f9){_0x1d86c9=_0x8806f9;if(_0x2a7138){var _0x1cb69a=null;for(var _0x4bc31f=0x1;_0x4bc31f<_0x4d6ac4[_0x0baf('0xf8')]['length'];++_0x4bc31f){_0x1cb69a=_0x4d6ac4[_0x0baf('0xf8')][_0x4bc31f];var _0x32abf2=_0x1cb69a['UserId']?util['format'](_0x0baf('0xfa'),_0x95fe84[_0x0baf('0xfb')],_0x1cb69a[_0x0baf('0x8a')]):_0x0baf('0xfc');var _0x4759d5=_0x9d6974[_0x0baf('0x40')][_0x0baf('0xfd')]||util['format']('%s%d','Visitor',_0x1cb69a[_0x0baf('0x80')]);switch(_0x95fe84['agentIdentifier']){case _0x0baf('0xfe'):_0x32abf2=_0x1cb69a[_0x0baf('0x8a')]?util['format']('%s%d',_0x95fe84[_0x0baf('0xfb')],_0x1cb69a[_0x0baf('0x8a')]):_0x0baf('0xfc');break;case _0x0baf('0xff'):_0x32abf2=_0x1cb69a[_0x0baf('0x8a')]?_0x1cb69a['User'][_0x0baf('0x100')]||_0x1cb69a[_0x0baf('0xf9')][_0x0baf('0x47')]:_0x0baf('0xfc');break;case _0x0baf('0x101'):_0x32abf2=_0x1cb69a[_0x0baf('0x8a')]?_0x1cb69a['User'][_0x0baf('0x47')]:_0x0baf('0xfc');break;default:_0x32abf2=_0x1cb69a[_0x0baf('0x8a')]?util['format'](_0x0baf('0xfa'),_0x95fe84[_0x0baf('0xfb')],_0x1cb69a['UserId']):_0x0baf('0xfc');}var _0xe93008=util[_0x0baf('0xf4')](_0x0baf('0x102'),moment(_0x1cb69a['createdAt'])['format'](_0x0baf('0x103')),_0x1cb69a[_0x0baf('0x104')]==='in'?_0x4759d5:_0x32abf2,_0x1cb69a['body']);if(!_0x1cb69a[_0x0baf('0x105')]){fs[_0x0baf('0x106')](_0x2a7138,_0xe93008);}}return db[_0x0baf('0x107')][_0x0baf('0xd0')]({'where':{'service':!![]},'include':[{'model':db[_0x0baf('0x108')],'as':'Smtp','raw':!![]}]});}}})[_0x0baf('0x24')](function(_0x1fe362){if(_0x1fe362&&_0x1fe362[_0x0baf('0x109')]&&_0x9d6974[_0x0baf('0x40')]){var _0x51287e={'tls':{'rejectUnauthorized':![]}};if(_0x1fe362[_0x0baf('0x109')]['service']){_0x51287e[_0x0baf('0x10a')]=_0x1fe362[_0x0baf('0x109')][_0x0baf('0x10a')];}else{_0x51287e['host']=_0x1fe362[_0x0baf('0x109')][_0x0baf('0x10b')];_0x51287e[_0x0baf('0x10c')]=_0x1fe362[_0x0baf('0x109')][_0x0baf('0x10c')];_0x51287e[_0x0baf('0x10d')]=_0x1fe362[_0x0baf('0x109')][_0x0baf('0x10d')];}if(_0x1fe362[_0x0baf('0x109')][_0x0baf('0x10e')]){_0x51287e[_0x0baf('0x10f')]={'user':_0x1fe362[_0x0baf('0x109')]['user'],'pass':_0x1fe362['Smtp'][_0x0baf('0x110')]};}return respondWithRpcPromise('SendMail','sendMail',{'account':_0x51287e,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x1fe362[_0x0baf('0x3f')],_0x1fe362[_0x0baf('0xd6')]||_0x1fe362['Smtp']['user']),'to':_0x9d6974['body']['mailTranscript'],'subject':_0x0baf('0x111'),'text':util['format'](_0x0baf('0x112'),_0x9d6974[_0x0baf('0x40')][_0x0baf('0xf3')]),'attachments':[{'path':_0x2a7138}]}})[_0x0baf('0x24')](function(){return _0x4d6ac4;})[_0x0baf('0x2e')](function(_0x292469){console[_0x0baf('0x2a')](_0x292469);});}else{return _0x4d6ac4;}})[_0x0baf('0x24')](respondWithStatusCode(_0x939365,0xc8))['catch'](handleError(_0x939365,null));};exports['addMessage']=function(_0x2d7ec3,_0x2a4d79,_0x5ebcad){return db[_0x0baf('0xf7')]['find']({'where':{'id':_0x2d7ec3[_0x0baf('0xc8')]['id']}})['then'](handleEntityNotFound(_0x2a4d79,null))['then'](function(_0x4621ba){if(_0x4621ba){return _0x4621ba[_0x0baf('0x113')](_0x2d7ec3[_0x0baf('0x40')][_0x0baf('0x114')],_[_0x0baf('0x115')](_0x2d7ec3[_0x0baf('0x40')],[_0x0baf('0x114'),'id'])||{});}})[_0x0baf('0x24')](respondWithResult(_0x2a4d79,null))[_0x0baf('0x2e')](handleError(_0x2a4d79,null));};exports[_0x0baf('0x116')]=function(_0x425869,_0x4059e1,_0x2c94ff){var _0x738da0={'raw':![],'where':{}};var _0x268a1c={};var _0x34cb32={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x0baf('0xd0')]({'where':{'id':_0x425869[_0x0baf('0xc8')]['id']}})['then'](handleEntityNotFound(_0x4059e1,null))[_0x0baf('0x24')](function(_0x39526b){if(_0x39526b){_0x268a1c['model']=_[_0x0baf('0x54')](db['ChatMessage'][_0x0baf('0xc9')]);_0x268a1c['query']=_[_0x0baf('0x54')](_0x425869['query']);_0x268a1c[_0x0baf('0x55')]=_[_0x0baf('0x56')](_0x268a1c[_0x0baf('0x52')],_0x268a1c[_0x0baf('0x53')]);_0x738da0['attributes']=_[_0x0baf('0x56')](_0x268a1c[_0x0baf('0x52')],qs[_0x0baf('0x58')](_0x425869[_0x0baf('0x53')]['fields']));_0x738da0['attributes']=_0x738da0[_0x0baf('0x57')][_0x0baf('0x59')]?_0x738da0[_0x0baf('0x57')]:_0x268a1c[_0x0baf('0x52')];if(!_0x425869['query'][_0x0baf('0x5a')](_0x0baf('0x5b'))){_0x738da0[_0x0baf('0x34')]=qs['limit'](_0x425869['query'][_0x0baf('0x34')]);_0x738da0['offset']=qs[_0x0baf('0x36')](_0x425869['query'][_0x0baf('0x36')]);}_0x738da0[_0x0baf('0x5c')]=qs[_0x0baf('0x5d')](_0x425869['query'][_0x0baf('0x5d')]);_0x738da0[_0x0baf('0x5e')]=qs['filters'](_['pick'](_0x425869[_0x0baf('0x53')],_0x268a1c['filters']));_0x738da0[_0x0baf('0x5e')][_0x0baf('0xc4')]=_0x39526b['id'];if(_0x425869['query']['filter']){_0x738da0[_0x0baf('0x5e')]=_[_0x0baf('0xb1')](_0x738da0['where'],{'$or':_[_0x0baf('0x46')](_0x738da0['attributes'],function(_0x309220){var _0x376eb3={};_0x376eb3[_0x309220]={'$like':'%'+_0x425869['query'][_0x0baf('0x9b')]+'%'};return _0x376eb3;})});}if(_0x425869[_0x0baf('0x53')][_0x0baf('0x91')]){var _0x2ef76b=_0x425869[_0x0baf('0x53')]['$gte'][_0x0baf('0x4a')](',');var _0x4ca9ea={};_0x4ca9ea[_0x2ef76b[0x0]]={'$gte':moment(_0x2ef76b[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x738da0[_0x0baf('0x5e')]=_[_0x0baf('0xb1')](_0x738da0['where'],_0x4ca9ea);}_0x738da0=_[_0x0baf('0xb1')]({},_0x738da0,_0x425869[_0x0baf('0xcc')]);return db['ChatMessage'][_0x0baf('0x35')]({'where':_0x738da0[_0x0baf('0x5e')]})[_0x0baf('0x24')](function(_0x3d6ece){_0x34cb32[_0x0baf('0x35')]=_0x3d6ece;if(_0x425869[_0x0baf('0x53')][_0x0baf('0xca')]){_0x738da0[_0x0baf('0xcb')]=[{'all':!![]}];}return db[_0x0baf('0xf7')][_0x0baf('0x117')](_0x738da0);})['then'](function(_0x19727f){_0x34cb32[_0x0baf('0xc6')]=_0x19727f;return _0x34cb32;});}})[_0x0baf('0x24')](respondWithFilteredResult(_0x4059e1,_0x738da0))[_0x0baf('0x2e')](handleError(_0x4059e1,null));};exports[_0x0baf('0x118')]=function(_0x57b26e,_0x3a0a2f,_0x5b676d){var _0x298155={'where':{}},_0xff9b69={},_0x5398c6={'count':0x0,'rows':[]};return db[_0x0baf('0x4e')][_0x0baf('0xd0')]({'where':{'id':_0x57b26e[_0x0baf('0xc8')]['id']}})[_0x0baf('0x24')](handleEntityNotFound(_0x3a0a2f,null))['then'](function(_0x2edcf9){if(_0x2edcf9){_0xff9b69[_0x0baf('0x52')]=_[_0x0baf('0x54')](db[_0x0baf('0xf7')][_0x0baf('0xc9')]);_0xff9b69[_0x0baf('0x53')]=_[_0x0baf('0x54')](_0x57b26e[_0x0baf('0x53')]);_0xff9b69[_0x0baf('0x55')]=_[_0x0baf('0x56')](_0xff9b69[_0x0baf('0x52')],_0xff9b69[_0x0baf('0x53')]);_0x298155[_0x0baf('0x57')]=_[_0x0baf('0x56')](_0xff9b69[_0x0baf('0x52')],qs[_0x0baf('0x58')](_0x57b26e[_0x0baf('0x53')][_0x0baf('0x58')]));_0x298155['attributes']=_0x298155[_0x0baf('0x57')][_0x0baf('0x59')]?_0x298155[_0x0baf('0x57')]:_0xff9b69[_0x0baf('0x52')];if(!_0x57b26e[_0x0baf('0x53')][_0x0baf('0x5a')](_0x0baf('0x5b'))){_0x298155['limit']=qs[_0x0baf('0x34')](_0x57b26e[_0x0baf('0x53')][_0x0baf('0x34')]);_0x298155[_0x0baf('0x36')]=qs[_0x0baf('0x36')](_0x57b26e[_0x0baf('0x53')][_0x0baf('0x36')]);}_0x298155['order']=qs[_0x0baf('0x5d')](_0x57b26e[_0x0baf('0x53')][_0x0baf('0x5d')]);_0x298155[_0x0baf('0x5e')]=qs[_0x0baf('0x55')](_[_0x0baf('0x5f')](_0x57b26e['query'],_0xff9b69[_0x0baf('0x55')]));_0x298155[_0x0baf('0x5e')][_0x0baf('0xc4')]=_0x2edcf9['id'];if(_0x57b26e[_0x0baf('0x53')][_0x0baf('0x9b')]){_0x298155['where']=_['merge'](_0x298155[_0x0baf('0x5e')],{'$or':_[_0x0baf('0x46')](_0x298155[_0x0baf('0x57')],function(_0x2d43ac){var _0x34126b={};_0x34126b[_0x2d43ac]={'$like':'%'+_0x57b26e[_0x0baf('0x53')][_0x0baf('0x9b')]+'%'};return _0x34126b;})});}_0x298155[_0x0baf('0x5e')][_0x0baf('0x105')]=![];if(_0x57b26e[_0x0baf('0x53')]['id']){_0x298155[_0x0baf('0x5e')]['id']={'$gt':_0x57b26e[_0x0baf('0x53')]['id']};}_0x298155=_[_0x0baf('0xb1')]({},_0x298155,_0x57b26e[_0x0baf('0xcc')]);return db[_0x0baf('0xf7')][_0x0baf('0x35')]({'where':_0x298155[_0x0baf('0x5e')]})[_0x0baf('0x24')](function(_0x18d219){_0x5398c6[_0x0baf('0x35')]=_0x18d219;_0x298155[_0x0baf('0xcb')]=[];if(_0x57b26e[_0x0baf('0x53')][_0x0baf('0x119')]){_0x298155[_0x0baf('0xcb')][_0x0baf('0x4c')]({'model':db[_0x0baf('0xf9')],'as':_0x0baf('0xf9'),'attributes':['id','fullname',_0x0baf('0x100')]});}if(_0x57b26e[_0x0baf('0x53')][_0x0baf('0xca')]){_0x298155[_0x0baf('0xcb')]=[{'all':!![]}];}return db[_0x0baf('0xf7')]['findAll'](_0x298155);})[_0x0baf('0x24')](function(_0x344fef){_0x5398c6[_0x0baf('0xc6')]=_0x344fef;return _0x5398c6;});}})[_0x0baf('0x24')](respondWithFilteredResult(_0x3a0a2f,_0x298155))[_0x0baf('0x2e')](handleError(_0x3a0a2f,null));};exports[_0x0baf('0x11a')]=function(_0x3358f5,_0x237a20,_0x26dd4c){return db[_0x0baf('0x4e')][_0x0baf('0x89')]({'where':{'id':_0x3358f5[_0x0baf('0xc8')]['id']}})[_0x0baf('0x24')](handleEntityNotFound(_0x237a20,null))[_0x0baf('0x24')](function(_0x2867b7){if(_0x2867b7){return _0x2867b7[_0x0baf('0x11b')](_0x3358f5[_0x0baf('0x40')][_0x0baf('0x114')],_['omit'](_0x3358f5[_0x0baf('0x40')],['ids','id'])||{})['spread'](function(){return db[_0x0baf('0x84')][_0x0baf('0x117')]({'attributes':['id',_0x0baf('0x3f'),'color'],'where':{'id':_0x3358f5[_0x0baf('0x40')][_0x0baf('0x114')]}});})[_0x0baf('0x24')](function(_0x24bc8f){socket[_0x0baf('0x11c')](_0x0baf('0x11d'),{'id':Number(_0x3358f5['params']['id']),'tags':_0x24bc8f||[]});return{'id':Number(_0x3358f5[_0x0baf('0xc8')]['id']),'tags':_0x24bc8f||[]};});}})[_0x0baf('0x24')](respondWithResult(_0x237a20,null))[_0x0baf('0x2e')](handleError(_0x237a20,null));};exports[_0x0baf('0x11e')]=function(_0x262063,_0x216897,_0x4c2bae){return db[_0x0baf('0x4e')]['find']({'where':{'id':_0x262063[_0x0baf('0xc8')]['id']}})[_0x0baf('0x24')](handleEntityNotFound(_0x216897,null))['then'](function(_0x56da3e){if(_0x56da3e){return _0x56da3e[_0x0baf('0x11e')](_0x262063[_0x0baf('0x53')][_0x0baf('0x114')]);}})['then'](respondWithStatusCode(_0x216897,null))[_0x0baf('0x2e')](handleError(_0x216897,null));};exports[_0x0baf('0xf1')]=function(_0x51d2aa,_0x26d73d){var _0x20cc18=moment()[_0x0baf('0x11f')]()[_0x0baf('0xb0')]();var _0x3fa8eb=path[_0x0baf('0xed')](config[_0x0baf('0xee')],'server','files',_0x0baf('0x120'));var _0x1bd67f=path[_0x0baf('0xed')](config[_0x0baf('0xee')],_0x0baf('0x121'),_0x0baf('0x122'),_0x0baf('0x123'));var _0x4316c5=path[_0x0baf('0xed')](_0x3fa8eb,_0x20cc18);var _0x1d5b73=util['format']('transcript-%d-%s.zip',_0x51d2aa[_0x0baf('0xc8')]['id'],_0x20cc18);var _0x2a84f8=path[_0x0baf('0xed')](_0x3fa8eb,_0x1d5b73);var _0x552504=[];_0x552504['push']({'model':db[_0x0baf('0xf9')],'as':_0x0baf('0xf9'),'attributes':['id',_0x0baf('0x47')],'raw':!![]});_0x552504[_0x0baf('0x4c')]({'model':db['CmContact'],'as':_0x0baf('0x7b'),'attributes':['id',_0x0baf('0x124'),_0x0baf('0x125')],'raw':!![]});if(_0x51d2aa[_0x0baf('0x53')][_0x0baf('0x123')]){_0x552504[_0x0baf('0x4c')]({'model':db[_0x0baf('0x126')],'as':_0x0baf('0x126'),'raw':!![]});}var _0x5bbd33=[{'model':db[_0x0baf('0xf7')],'as':_0x0baf('0xf8'),'attributes':['id',_0x0baf('0x40'),_0x0baf('0x8f'),_0x0baf('0x104'),_0x0baf('0x105'),'read'],'include':_0x552504}];_0x5bbd33[_0x0baf('0x4c')]({'model':db[_0x0baf('0xd1')],'as':'Account','attributes':['id','name']});_0x5bbd33[_0x0baf('0x4c')]({'model':db['User'],'as':_0x0baf('0x127'),'attributes':['id',_0x0baf('0x47')]});return db[_0x0baf('0x4e')][_0x0baf('0x89')]({'where':{'id':_0x51d2aa['params']['id']},'include':_0x5bbd33})[_0x0baf('0x24')](handleEntityNotFound(_0x26d73d,null))[_0x0baf('0x24')](function(_0x32c2a8){if(_0x32c2a8){var _0x58fea2=_0x32c2a8[_0x0baf('0x128')]({'plain':!![]});fs[_0x0baf('0x129')](_0x4316c5);var _0x5f5d45={'channel':_0x0baf('0x12a'),'account':_0x58fea2['Account'][_0x0baf('0x3f')],'agent':_0x58fea2[_0x0baf('0x127')]?_0x58fea2[_0x0baf('0x127')][_0x0baf('0x47')]:'N.A.','createdAt':moment(_0x58fea2[_0x0baf('0x8f')])[_0x0baf('0xf4')]('YYYY-MM-DD\x20HH:mm:ss')[_0x0baf('0xb0')](),'closedAt':_0x58fea2[_0x0baf('0xe5')]?moment(_0x58fea2['closedAt'])[_0x0baf('0xf4')](_0x0baf('0x12b'))['toString']():'','disposition':_0x58fea2[_0x0baf('0x12c')],'chatInfo':{'browser':_0x58fea2[_0x0baf('0x12d')],'os':_0x58fea2[_0x0baf('0x12e')],'referer':_0x58fea2[_0x0baf('0x12f')],'customerIp':_0x58fea2[_0x0baf('0x130')],'customerPort':_0x58fea2[_0x0baf('0x131')]?_0x58fea2['customerPort']:_0x0baf('0x132')},'messages':_(_0x58fea2[_0x0baf('0xf8')])[_0x0baf('0x133')]()[_0x0baf('0x9b')]({'secret':![]})[_0x0baf('0x46')](function(_0x1ca912){if(_0x1ca912[_0x0baf('0x126')]){var _0x70e2e=path[_0x0baf('0xed')](_0x1bd67f,_0x1ca912[_0x0baf('0x126')][_0x0baf('0xe9')]);if(fs[_0x0baf('0x134')](_0x70e2e)){fs[_0x0baf('0x135')](_0x70e2e)[_0x0baf('0x136')](fs[_0x0baf('0x137')](path[_0x0baf('0xed')](_0x4316c5,_0x1ca912[_0x0baf('0x126')][_0x0baf('0xe9')])));}}return{'date':moment(_0x1ca912[_0x0baf('0x8f')])[_0x0baf('0xf4')](_0x0baf('0x12b'))[_0x0baf('0xb0')](),'sender':_0x1ca912['direction']===_0x0baf('0xdf')?_0x1ca912[_0x0baf('0xf9')]?_0x1ca912['User']['fullname']:'System':_0x1ca912[_0x0baf('0x7b')]['firstName']+(_0x1ca912['Contact']['lastName']?'\x20'+_0x1ca912[_0x0baf('0x7b')][_0x0baf('0x125')]:''),'body':_0x1ca912[_0x0baf('0x126')]?_0x1ca912['Attachment'][_0x0baf('0xe9')]:_0x1ca912['body'],'direction':_0x1ca912['direction']===_0x0baf('0xdf')?'A':'C','secret':_0x1ca912[_0x0baf('0x105')],'read':_0x1ca912[_0x0baf('0x96')],'attachment':_0x1ca912['Attachment']};})['value']()};return ejs[_0x0baf('0x138')](path[_0x0baf('0xed')](config[_0x0baf('0xee')],_0x0baf('0x121'),_0x0baf('0x139'),_0x0baf('0x13a')),{'interaction':_0x5f5d45})['then'](function(_0x4c1f01){var _0x217cd8=path[_0x0baf('0xed')](_0x4316c5,'transcript-'+_0x58fea2['id']+'-'+_0x20cc18+_0x0baf('0x13b'));var _0x223d32={'path':_0x217cd8,'channel':_0x0baf('0x12a'),'interactionId':_0x58fea2['id']};return pdf[_0x0baf('0x13c')](_0x4c1f01,_0x223d32);})['then'](function(){return new BPromise(function(_0xcca408,_0x557ec9){zipdir(_0x4316c5,{'saveTo':_0x2a84f8},function(_0x479231,_0x320409){if(_0x479231)return _0x557ec9(_0x479231);return _0xcca408(_0x320409);});})['then'](function(){return new BPromise(function(_0x4a0f32,_0xc6fc4d){rimraf(_0x4316c5,function(_0x46b904){if(_0x46b904)_0xc6fc4d(_0x46b904);return _0x4a0f32();});});})['then'](function(){return _0x26d73d[_0x0baf('0xf1')](_0x2a84f8,_0x1d5b73,function(_0x2dea20){if(_0x2dea20){console[_0x0baf('0x13d')](_0x0baf('0x13e'),_0x2dea20);}else{fs[_0x0baf('0x13f')](_0x2a84f8);}});});});}else{return _0x26d73d[_0x0baf('0x2f')](0xc8);}})['catch'](handleError(_0x26d73d,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 619f80f..8bbb9ca 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 _0xf1ee=['length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','getUsers','then','Users','findAll','unreadMessages'];(function(_0x468b0f,_0x408566){var _0x3e74d9=function(_0x27a545){while(--_0x27a545){_0x468b0f['push'](_0x468b0f['shift']());}};_0x3e74d9(++_0x408566);}(_0xf1ee,0xa8));var _0xef1e=function(_0x433df9,_0x5808c7){_0x433df9=_0x433df9-0x0;var _0x2574cf=_0xf1ee[_0x433df9];return _0x2574cf;};'use strict';var EventEmitter=require(_0xef1e('0x0'));var ChatInteraction=require(_0xef1e('0x1'))['db']['ChatInteraction'];var ChatMessage=require(_0xef1e('0x1'))['db'][_0xef1e('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xef1e('0x3')](0x0);var events={'afterCreate':_0xef1e('0x4'),'afterUpdate':_0xef1e('0x5'),'afterDestroy':_0xef1e('0x6')};function emitEvent(_0x28fe93){return function(_0x10b998,_0x5a2787,_0x1ca7db){_0x10b998[_0xef1e('0x7')]({'attributes':['id'],'raw':!![]})[_0xef1e('0x8')](function(_0x541401){_0x10b998['setDataValue'](_0xef1e('0x9'),_0x541401['map'](function(_0x19c6c8){return{'id':_0x19c6c8['id']};}));return ChatMessage[_0xef1e('0xa')]({'where':{'ChatInteractionId':_0x10b998['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x2a25c7){_0x10b998['setDataValue'](_0xef1e('0xb'),_0x2a25c7[_0xef1e('0xc')]);ChatInteractionEvents['emit'](_0x28fe93+':'+_0x10b998['id'],_0x10b998);ChatInteractionEvents[_0xef1e('0xd')](_0x28fe93,_0x10b998);_0x1ca7db(null);})[_0xef1e('0xe')](_0x1ca7db(null));};}for(var e in events){if(events[_0xef1e('0xf')](e)){var event=events[e];ChatInteraction[_0xef1e('0x10')](e,emitEvent(event));}}module[_0xef1e('0x11')]=ChatInteractionEvents; \ No newline at end of file +var _0x7cef=['ChatInteraction','../../mysqldb','ChatMessage','update','remove','getUsers','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events'];(function(_0x211bcb,_0x40f1b5){var _0x3de2f0=function(_0x2810ff){while(--_0x2810ff){_0x211bcb['push'](_0x211bcb['shift']());}};_0x3de2f0(++_0x40f1b5);}(_0x7cef,0x6b));var _0xf7ce=function(_0x1b1f54,_0x54bdc6){_0x1b1f54=_0x1b1f54-0x0;var _0x39e3dc=_0x7cef[_0x1b1f54];return _0x39e3dc;};'use strict';var EventEmitter=require(_0xf7ce('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0xf7ce('0x1')];var ChatMessage=require(_0xf7ce('0x2'))['db'][_0xf7ce('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xf7ce('0x4'),'afterDestroy':_0xf7ce('0x5')};function emitEvent(_0x5c71f7){return function(_0x4512b2,_0x1987ec,_0x444593){_0x4512b2[_0xf7ce('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x19c6b1){_0x4512b2[_0xf7ce('0x7')](_0xf7ce('0x8'),_0x19c6b1[_0xf7ce('0x9')](function(_0x4b79e9){return{'id':_0x4b79e9['id']};}));return ChatMessage[_0xf7ce('0xa')]({'where':{'ChatInteractionId':_0x4512b2['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x3a8ac1){_0x4512b2[_0xf7ce('0x7')](_0xf7ce('0xb'),_0x3a8ac1[_0xf7ce('0xc')]);ChatInteractionEvents['emit'](_0x5c71f7+':'+_0x4512b2['id'],_0x4512b2);ChatInteractionEvents[_0xf7ce('0xd')](_0x5c71f7,_0x4512b2);_0x444593(null);})[_0xf7ce('0xe')](_0x444593(null));};}for(var e in events){if(events[_0xf7ce('0xf')](e)){var event=events[e];ChatInteraction[_0xf7ce('0x10')](e,emitEvent(event));}}module[_0xf7ce('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 c7506fc..98517fd 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 _0xbe1c=['../../config/environment','./chatInteraction.attributes','exports','define','changed','closed','format','utf8mb4_unicode_ci','../../config/logger','api','bluebird','path'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0xbe1c,0xec));var _0xcbe1=function(_0x204836,_0x34d172){_0x204836=_0x204836-0x0;var _0x335884=_0xbe1c[_0x204836];return _0x335884;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xcbe1('0x0'))(_0xcbe1('0x1'));var moment=require('moment');var BPromise=require(_0xcbe1('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcbe1('0x3'));var rimraf=require('rimraf');var config=require(_0xcbe1('0x4'));var attributes=require(_0xcbe1('0x5'));module[_0xcbe1('0x6')]=function(_0x164677,_0x259967){return _0x164677[_0xcbe1('0x7')]('ChatInteraction',attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1197b2,_0x21e5c0,_0x3f6c1a){if(_0x1197b2[_0xcbe1('0x8')](_0xcbe1('0x9'))){_0x1197b2['closedAt']=moment()[_0xcbe1('0xa')]('YYYY-MM-DD\x20HH:mm:ss');}_0x3f6c1a(null,_0x1197b2);}},'charset':'utf8mb4','collate':_0xcbe1('0xb')});}; \ No newline at end of file +var _0x1aca=['closed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','ChatInteraction','chat_interactions','changed'];(function(_0x5ef7b8,_0x15cc07){var _0x2c7148=function(_0x398519){while(--_0x398519){_0x5ef7b8['push'](_0x5ef7b8['shift']());}};_0x2c7148(++_0x15cc07);}(_0x1aca,0x115));var _0xa1ac=function(_0x7ff50b,_0x399dc0){_0x7ff50b=_0x7ff50b-0x0;var _0x43e570=_0x1aca[_0x7ff50b];return _0x43e570;};'use strict';var _=require('lodash');var util=require(_0xa1ac('0x0'));var logger=require(_0xa1ac('0x1'))(_0xa1ac('0x2'));var moment=require(_0xa1ac('0x3'));var BPromise=require('bluebird');var rp=require(_0xa1ac('0x4'));var fs=require('fs');var path=require(_0xa1ac('0x5'));var rimraf=require(_0xa1ac('0x6'));var config=require(_0xa1ac('0x7'));var attributes=require('./chatInteraction.attributes');module[_0xa1ac('0x8')]=function(_0x141cb4,_0x30ac82){return _0x141cb4['define'](_0xa1ac('0x9'),attributes,{'tableName':_0xa1ac('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3a36af,_0x1fbdf0,_0x40dabb){if(_0x3a36af[_0xa1ac('0xb')](_0xa1ac('0xc'))){_0x3a36af['closedAt']=moment()[_0xa1ac('0xd')](_0xa1ac('0xe'));}_0x40dabb(null,_0x3a36af);}},'charset':_0xa1ac('0xf'),'collate':_0xa1ac('0x10')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 693c29e..1b9983d 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 _0x6254=['info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','ChatInteraction','update','options','attributes','limit','UpdateChatInteraction','catch','AddTagsToChatInteraction','find','body','ids','omit','spread','AddTags','lodash','util','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','then'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x6254,0x128));var _0x4625=function(_0x5ad07c,_0x324dcd){_0x5ad07c=_0x5ad07c-0x0;var _0x204bae=_0x6254[_0x5ad07c];return _0x204bae;};'use strict';var _=require(_0x4625('0x0'));var util=require(_0x4625('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4625('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x4625('0x3'))(_0x4625('0x4'));var config=require(_0x4625('0x5'));var jayson=require(_0x4625('0x6'));var client=jayson[_0x4625('0x7')][_0x4625('0x8')]({'port':0x232a});config[_0x4625('0x9')]=_[_0x4625('0xa')](config[_0x4625('0x9')],{'host':_0x4625('0xb'),'port':0x18eb});var socket=require(_0x4625('0xc'))(new Redis(config[_0x4625('0x9')]));require(_0x4625('0xd'))[_0x4625('0xe')](socket);function respondWithRpcPromise(_0x5287cb,_0x2a5a61,_0x3bdb96){return new BPromise(function(_0x3a4e3f,_0x14db75){return client['request'](_0x5287cb,_0x3bdb96)[_0x4625('0xf')](function(_0x530660){logger[_0x4625('0x10')](_0x4625('0x11'),_0x2a5a61,_0x4625('0x12'));logger[_0x4625('0x13')](_0x4625('0x14'),_0x2a5a61,_0x4625('0x12'),JSON[_0x4625('0x15')](_0x530660));if(_0x530660[_0x4625('0x16')]){if(_0x530660['error']['code']===0x1f4){logger[_0x4625('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x2a5a61,_0x530660[_0x4625('0x16')][_0x4625('0x17')]);return _0x14db75(_0x530660['error'][_0x4625('0x17')]);}logger['error']('ChatInteraction,\x20%s,\x20%s',_0x2a5a61,_0x530660[_0x4625('0x16')][_0x4625('0x17')]);return _0x3a4e3f(_0x530660[_0x4625('0x16')]['message']);}else{logger[_0x4625('0x10')](_0x4625('0x11'),_0x2a5a61,_0x4625('0x12'));_0x3a4e3f(_0x530660[_0x4625('0x18')][_0x4625('0x17')]);}})['catch'](function(_0x3415b6){logger[_0x4625('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x2a5a61,_0x3415b6);_0x14db75(_0x3415b6);});});}exports['UpdateChatInteraction']=function(_0x104e2a){var _0x5a5d2f=this;return new Promise(function(_0xa632d5,_0x1c73c2){return db[_0x4625('0x19')][_0x4625('0x1a')](_0x104e2a['body'],{'raw':_0x104e2a['options']?_0x104e2a[_0x4625('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x104e2a['options']?_0x104e2a[_0x4625('0x1b')]['where']||null:null,'attributes':_0x104e2a['options']?_0x104e2a[_0x4625('0x1b')][_0x4625('0x1c')]||null:null,'limit':_0x104e2a[_0x4625('0x1b')]?_0x104e2a[_0x4625('0x1b')][_0x4625('0x1d')]||null:null})[_0x4625('0xf')](function(_0x401049){logger['info']('UpdateChatInteraction',_0x104e2a);logger['debug'](_0x4625('0x1e'),_0x104e2a,JSON['stringify'](_0x401049));_0xa632d5(_0x401049);})[_0x4625('0x1f')](function(_0x5a3927){logger['error'](_0x4625('0x1e'),_0x5a3927[_0x4625('0x17')],_0x104e2a);_0x1c73c2(_0x5a5d2f[_0x4625('0x16')](0x1f4,_0x5a3927[_0x4625('0x17')]));});});};exports[_0x4625('0x20')]=function(_0x37f0a7){return new Promise(function(_0x2c9d25,_0x15c56b){return db[_0x4625('0x19')][_0x4625('0x21')]({'where':_0x37f0a7[_0x4625('0x1b')]?_0x37f0a7[_0x4625('0x1b')]['where']||null:null})['then'](function(_0x4d78a8){if(_0x4d78a8){return _0x4d78a8['addTags'](_0x37f0a7[_0x4625('0x22')][_0x4625('0x23')],_[_0x4625('0x24')](_0x37f0a7['body'],[_0x4625('0x23'),'id'])||{});}})[_0x4625('0x25')](function(_0x27e8fb){logger['info'](_0x4625('0x26'),_0x37f0a7);logger[_0x4625('0x13')](_0x4625('0x26'),_0x37f0a7,JSON[_0x4625('0x15')](_0x27e8fb));_0x2c9d25(_0x27e8fb);})['catch'](function(_0x3a7173){logger['error'](_0x4625('0x26'),_0x3a7173[_0x4625('0x17')],_0x37f0a7);_0x15c56b(_this[_0x4625('0x16')](0x1f4,_0x3a7173['message']));});});}; \ No newline at end of file +var _0x275d=['result','UpdateChatInteraction','update','options','where','attributes','limit','catch','ChatInteraction','find','addTags','body','ids','omit','spread','AddTags','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','register','request','then','info','ChatInteraction,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message'];(function(_0x3c5ec,_0x58c840){var _0xdb14d2=function(_0x5d8fa8){while(--_0x5d8fa8){_0x3c5ec['push'](_0x3c5ec['shift']());}};_0xdb14d2(++_0x58c840);}(_0x275d,0x1a0));var _0xd275=function(_0x207811,_0x3420a6){_0x207811=_0x207811-0x0;var _0x170d56=_0x275d[_0x207811];return _0x170d56;};'use strict';var _=require(_0xd275('0x0'));var util=require('util');var moment=require(_0xd275('0x1'));var BPromise=require(_0xd275('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd275('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xd275('0x4'));var logger=require(_0xd275('0x5'))(_0xd275('0x6'));var config=require(_0xd275('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd275('0x8')][_0xd275('0x9')]({'port':0x232a});config[_0xd275('0xa')]=_[_0xd275('0xb')](config[_0xd275('0xa')],{'host':_0xd275('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd275('0xa')]));require('./chatInteraction.socket')[_0xd275('0xd')](socket);function respondWithRpcPromise(_0xd2d2eb,_0x199396,_0x8c5ee1){return new BPromise(function(_0x360fcc,_0x5cae32){return client[_0xd275('0xe')](_0xd2d2eb,_0x8c5ee1)[_0xd275('0xf')](function(_0x45f6f2){logger[_0xd275('0x10')](_0xd275('0x11'),_0x199396,'request\x20sent');logger[_0xd275('0x12')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x199396,_0xd275('0x13'),JSON[_0xd275('0x14')](_0x45f6f2));if(_0x45f6f2[_0xd275('0x15')]){if(_0x45f6f2[_0xd275('0x15')][_0xd275('0x16')]===0x1f4){logger[_0xd275('0x15')](_0xd275('0x11'),_0x199396,_0x45f6f2[_0xd275('0x15')][_0xd275('0x17')]);return _0x5cae32(_0x45f6f2['error'][_0xd275('0x17')]);}logger[_0xd275('0x15')](_0xd275('0x11'),_0x199396,_0x45f6f2['error'][_0xd275('0x17')]);return _0x360fcc(_0x45f6f2[_0xd275('0x15')][_0xd275('0x17')]);}else{logger[_0xd275('0x10')](_0xd275('0x11'),_0x199396,_0xd275('0x13'));_0x360fcc(_0x45f6f2[_0xd275('0x18')][_0xd275('0x17')]);}})['catch'](function(_0x23da3a){logger[_0xd275('0x15')](_0xd275('0x11'),_0x199396,_0x23da3a);_0x5cae32(_0x23da3a);});});}exports[_0xd275('0x19')]=function(_0x5039b6){var _0x3034e2=this;return new Promise(function(_0x43305f,_0x489ec0){return db['ChatInteraction'][_0xd275('0x1a')](_0x5039b6['body'],{'raw':_0x5039b6[_0xd275('0x1b')]?_0x5039b6[_0xd275('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5039b6[_0xd275('0x1b')]?_0x5039b6[_0xd275('0x1b')][_0xd275('0x1c')]||null:null,'attributes':_0x5039b6['options']?_0x5039b6[_0xd275('0x1b')][_0xd275('0x1d')]||null:null,'limit':_0x5039b6[_0xd275('0x1b')]?_0x5039b6[_0xd275('0x1b')][_0xd275('0x1e')]||null:null})[_0xd275('0xf')](function(_0x7aaa30){logger['info'](_0xd275('0x19'),_0x5039b6);logger[_0xd275('0x12')](_0xd275('0x19'),_0x5039b6,JSON[_0xd275('0x14')](_0x7aaa30));_0x43305f(_0x7aaa30);})[_0xd275('0x1f')](function(_0x140bdd){logger[_0xd275('0x15')]('UpdateChatInteraction',_0x140bdd[_0xd275('0x17')],_0x5039b6);_0x489ec0(_0x3034e2['error'](0x1f4,_0x140bdd[_0xd275('0x17')]));});});};exports['AddTagsToChatInteraction']=function(_0x37b291){return new Promise(function(_0xbc28c7,_0xf14311){return db[_0xd275('0x20')][_0xd275('0x21')]({'where':_0x37b291[_0xd275('0x1b')]?_0x37b291[_0xd275('0x1b')][_0xd275('0x1c')]||null:null})[_0xd275('0xf')](function(_0x4fa97a){if(_0x4fa97a){return _0x4fa97a[_0xd275('0x22')](_0x37b291[_0xd275('0x23')][_0xd275('0x24')],_[_0xd275('0x25')](_0x37b291['body'],[_0xd275('0x24'),'id'])||{});}})[_0xd275('0x26')](function(_0x5226eb){logger[_0xd275('0x10')](_0xd275('0x27'),_0x37b291);logger[_0xd275('0x12')]('AddTags',_0x37b291,JSON['stringify'](_0x5226eb));_0xbc28c7(_0x5226eb);})[_0xd275('0x1f')](function(_0x43487e){logger[_0xd275('0x15')](_0xd275('0x27'),_0x43487e[_0xd275('0x17')],_0x37b291);_0xf14311(_this[_0xd275('0x15')](0x1f4,_0x43487e[_0xd275('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 08f41bb..2a2e8ac 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 _0x5243=['update','emit','removeListener','length','chatInteraction:','./chatInteraction.events'];(function(_0x39f9f2,_0x1d6714){var _0xff574e=function(_0x28728d){while(--_0x28728d){_0x39f9f2['push'](_0x39f9f2['shift']());}};_0xff574e(++_0x1d6714);}(_0x5243,0x71));var _0x3524=function(_0x3a9b20,_0x2e5be1){_0x3a9b20=_0x3a9b20-0x0;var _0x525273=_0x5243[_0x3a9b20];return _0x525273;};'use strict';var ChatInteractionEvents=require(_0x3524('0x0'));var events=['save','remove',_0x3524('0x1')];function createListener(_0x14d26d,_0x496f0f){return function(_0x5449cf){_0x496f0f[_0x3524('0x2')](_0x14d26d,_0x5449cf);};}function removeListener(_0x34bba7,_0x4855ea){return function(){ChatInteractionEvents[_0x3524('0x3')](_0x34bba7,_0x4855ea);};}exports['register']=function(_0x2d8995){for(var _0x564239=0x0,_0x375729=events[_0x3524('0x4')];_0x564239<_0x375729;_0x564239++){var _0x1e9bf9=events[_0x564239];var _0x371171=createListener(_0x3524('0x5')+_0x1e9bf9,_0x2d8995);ChatInteractionEvents['on'](_0x1e9bf9,_0x371171);}}; \ No newline at end of file +var _0xe2c8=['removeListener','register','length','./chatInteraction.events','remove','update','emit'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0xe2c8,0x17d));var _0x8e2c=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xe2c8[_0x1035c1];return _0x308d67;};'use strict';var ChatInteractionEvents=require(_0x8e2c('0x0'));var events=['save',_0x8e2c('0x1'),_0x8e2c('0x2')];function createListener(_0x1bb98c,_0x5b2266){return function(_0x180c8c){_0x5b2266[_0x8e2c('0x3')](_0x1bb98c,_0x180c8c);};}function removeListener(_0x5cb28e,_0x42e5f6){return function(){ChatInteractionEvents[_0x8e2c('0x4')](_0x5cb28e,_0x42e5f6);};}exports[_0x8e2c('0x5')]=function(_0x23b07a){for(var _0x35ecae=0x0,_0x4c7fcb=events[_0x8e2c('0x6')];_0x35ecae<_0x4c7fcb;_0x35ecae++){var _0x1b15e1=events[_0x35ecae];var _0x52d958=createListener('chatInteraction:'+_0x1b15e1,_0x23b07a);ChatInteractionEvents['on'](_0x1b15e1,_0x52d958);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 467feef..f40272d 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 _0x6494=['/:id/custom_update','/:id/abandon','abandon','/:id/close','close','chatinteraction:destroy','delete','removeTags','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','isChatInteractionAuthorized','show','/:id/attachment_download','/:id/messages','getMessages','getMyMessages','post','create','createVidaooSession','root','server/files/attachments/','format','%s-%s','now','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','/:id','chatinteraction:update','update'];(function(_0x17c5d8,_0x294ae5){var _0x3613ee=function(_0x45d8a8){while(--_0x45d8a8){_0x17c5d8['push'](_0x17c5d8['shift']());}};_0x3613ee(++_0x294ae5);}(_0x6494,0xa8));var _0x4649=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6494[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x4649('0x0'));var util=require(_0x4649('0x1'));var path=require(_0x4649('0x2'));var timeout=require(_0x4649('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x4649('0x4'));var auth=require(_0x4649('0x5'));var interaction=require(_0x4649('0x6'));var config=require(_0x4649('0x7'));var controller=require(_0x4649('0x8'));router[_0x4649('0x9')]('/',auth[_0x4649('0xa')](),controller[_0x4649('0xb')]);router[_0x4649('0x9')](_0x4649('0xc'),auth['isAuthenticated'](),controller[_0x4649('0xd')]);router['get']('/:id',auth[_0x4649('0xe')](),controller[_0x4649('0xf')]);router['get'](_0x4649('0x10'),auth[_0x4649('0xe')](),controller['attachmentDownload']);router[_0x4649('0x9')](_0x4649('0x11'),auth[_0x4649('0xa')](),controller[_0x4649('0x12')]);router[_0x4649('0x9')]('/:id/my_messages',auth[_0x4649('0xe')](),controller[_0x4649('0x13')]);router[_0x4649('0x9')]('/:id/download',auth[_0x4649('0xa')](),controller['download']);router[_0x4649('0x14')]('/',auth[_0x4649('0xa')](),controller[_0x4649('0x15')]);router[_0x4649('0x14')]('/:id/vidaoo',auth[_0x4649('0xa')](),controller[_0x4649('0x16')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xe3b3fa,_0x17fe4f,_0x7c1ca4){_0x7c1ca4(null,path['join'](config[_0x4649('0x17')],_0x4649('0x18')));},'filename':function(_0x29bbcd,_0x577134,_0x1d768e){_0x1d768e(null,util[_0x4649('0x19')](_0x4649('0x1a'),Date[_0x4649('0x1b')](),_0x577134[_0x4649('0x1c')][_0x4649('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x4649('0x14')](_0x4649('0x1e'),upload[_0x4649('0x1f')](_0x4649('0x20')),controller[_0x4649('0x21')]);router[_0x4649('0x14')]('/:id/messages',auth['isChatInteractionAuthorized'](),controller[_0x4649('0x22')]);router[_0x4649('0x14')](_0x4649('0x23'),auth[_0x4649('0xa')](),interaction[_0x4649('0x24')](_0x4649('0x25'),_0x4649('0x26')),controller[_0x4649('0x27')]);router[_0x4649('0x28')](_0x4649('0x29'),auth[_0x4649('0xa')](),interaction[_0x4649('0x24')](_0x4649('0x25'),_0x4649('0x2a')),controller[_0x4649('0x2b')]);router['put'](_0x4649('0x2c'),controller['customUpdate']);router[_0x4649('0x28')](_0x4649('0x2d'),auth[_0x4649('0xe')](),controller[_0x4649('0x2e')]);router['put'](_0x4649('0x2f'),controller[_0x4649('0x30')]);router['delete'](_0x4649('0x29'),auth[_0x4649('0xa')](),interaction['tracked']('chat',_0x4649('0x31')),controller['destroy']);router[_0x4649('0x32')](_0x4649('0x23'),auth[_0x4649('0xa')](),controller[_0x4649('0x33')]);module[_0x4649('0x34')]=router; \ No newline at end of file +var _0xe2cc=['show','/:id/attachment_download','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','post','create','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','originalname','replace','/:id/attachment_upload','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','addTags','put','chatinteraction:update','update','/:id/custom_update','customUpdate','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','removeTags','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','isChatInteractionAuthorized'];(function(_0x2f57db,_0x318730){var _0x5ee309=function(_0x5b73a5){while(--_0x5b73a5){_0x2f57db['push'](_0x2f57db['shift']());}};_0x5ee309(++_0x318730);}(_0xe2cc,0x102));var _0xce2c=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xe2cc[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require(_0xce2c('0x0'));var util=require(_0xce2c('0x1'));var path=require(_0xce2c('0x2'));var timeout=require(_0xce2c('0x3'));var express=require(_0xce2c('0x4'));var router=express[_0xce2c('0x5')]();var fs_extra=require(_0xce2c('0x6'));var auth=require(_0xce2c('0x7'));var interaction=require(_0xce2c('0x8'));var config=require(_0xce2c('0x9'));var controller=require('./chatInteraction.controller');router[_0xce2c('0xa')]('/',auth['isAuthenticated'](),controller[_0xce2c('0xb')]);router[_0xce2c('0xa')](_0xce2c('0xc'),auth[_0xce2c('0xd')](),controller[_0xce2c('0xe')]);router['get'](_0xce2c('0xf'),auth[_0xce2c('0x10')](),controller[_0xce2c('0x11')]);router[_0xce2c('0xa')](_0xce2c('0x12'),auth[_0xce2c('0x10')](),controller['attachmentDownload']);router['get'](_0xce2c('0x13'),auth[_0xce2c('0xd')](),controller[_0xce2c('0x14')]);router[_0xce2c('0xa')](_0xce2c('0x15'),auth[_0xce2c('0x10')](),controller[_0xce2c('0x16')]);router[_0xce2c('0xa')](_0xce2c('0x17'),auth[_0xce2c('0xd')](),controller['download']);router[_0xce2c('0x18')]('/',auth['isAuthenticated'](),controller[_0xce2c('0x19')]);router['post']('/:id/vidaoo',auth[_0xce2c('0xd')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0xce2c('0x1a')]({'destination':function(_0x5573e6,_0x18c738,_0x194ad7){_0x194ad7(null,path[_0xce2c('0x1b')](config[_0xce2c('0x1c')],_0xce2c('0x1d')));},'filename':function(_0x19c0ad,_0x2eaed8,_0xf617bd){_0xf617bd(null,util[_0xce2c('0x1e')](_0xce2c('0x1f'),Date[_0xce2c('0x20')](),_0x2eaed8[_0xce2c('0x21')][_0xce2c('0x22')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xce2c('0x18')](_0xce2c('0x23'),upload['single'](_0xce2c('0x24')),controller[_0xce2c('0x25')]);router[_0xce2c('0x18')](_0xce2c('0x13'),auth['isChatInteractionAuthorized'](),controller[_0xce2c('0x26')]);router[_0xce2c('0x18')](_0xce2c('0x27'),auth[_0xce2c('0xd')](),interaction[_0xce2c('0x28')](_0xce2c('0x29'),'chatinteraction:addtags'),controller[_0xce2c('0x2a')]);router[_0xce2c('0x2b')](_0xce2c('0xf'),auth[_0xce2c('0xd')](),interaction['tracked'](_0xce2c('0x29'),_0xce2c('0x2c')),controller[_0xce2c('0x2d')]);router['put'](_0xce2c('0x2e'),controller[_0xce2c('0x2f')]);router[_0xce2c('0x2b')]('/:id/abandon',auth['isChatInteractionAuthorized'](),controller[_0xce2c('0x30')]);router[_0xce2c('0x2b')](_0xce2c('0x31'),controller[_0xce2c('0x32')]);router[_0xce2c('0x33')]('/:id',auth['isAuthenticated'](),interaction[_0xce2c('0x28')](_0xce2c('0x29'),_0xce2c('0x34')),controller[_0xce2c('0x35')]);router[_0xce2c('0x33')](_0xce2c('0x27'),auth[_0xce2c('0xd')](),controller[_0xce2c('0x36')]);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 d189dce..9e49620 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 _0x8fc2=['INTEGER','sequelize','exports','medium','BOOLEAN'];(function(_0x4a1cc1,_0x169f19){var _0x583943=function(_0x363585){while(--_0x363585){_0x4a1cc1['push'](_0x4a1cc1['shift']());}};_0x583943(++_0x169f19);}(_0x8fc2,0xf6));var _0x28fc=function(_0xd29631,_0x4d7de9){_0xd29631=_0xd29631-0x0;var _0x223b4f=_0x8fc2[_0xd29631];return _0x223b4f;};'use strict';var Sequelize=require(_0x28fc('0x0'));module[_0x28fc('0x1')]={'body':{'type':Sequelize['TEXT'](_0x28fc('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x28fc('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x28fc('0x4')]}}; \ No newline at end of file +var _0x72ec=['medium','INTEGER','exports','TEXT'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x72ec,0x82));var _0xc72e=function(_0x47d060,_0x4a2b1d){_0x47d060=_0x47d060-0x0;var _0xb2d051=_0x72ec[_0x47d060];return _0xb2d051;};'use strict';var Sequelize=require('sequelize');module[_0xc72e('0x0')]={'body':{'type':Sequelize[_0xc72e('0x1')](_0xc72e('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xc72e('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 45e9041..fcd3bae 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 _0x381f=['all','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','undefined','limit','count','offset','set','json','apply','reject','save','then','error','stack','name','send','index','ChatInternalMessage','rawAttributes','fieldName','type','model','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','include','rows','catch','show','params','keys','includeAll','find','create','body','update','destroy','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','User','agent','admin','fullname','role','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','get','user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','findAll','isEmpty','push','messages','createdAt','FromId','ToId','read'];(function(_0x59070e,_0x456189){var _0x597e37=function(_0x5daab7){while(--_0x5daab7){_0x59070e['push'](_0x59070e['shift']());}};_0x597e37(++_0x456189);}(_0x381f,0xeb));var _0xf381=function(_0x2770f2,_0x37e3b5){_0x2770f2=_0x2770f2-0x0;var _0x3ffabd=_0x381f[_0x2770f2];return _0x3ffabd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf381('0x0'));var zipdir=require(_0xf381('0x1'));var jsonpatch=require(_0xf381('0x2'));var rp=require(_0xf381('0x3'));var moment=require(_0xf381('0x4'));var BPromise=require(_0xf381('0x5'));var Mustache=require(_0xf381('0x6'));var util=require(_0xf381('0x7'));var path=require(_0xf381('0x8'));var sox=require(_0xf381('0x9'));var csv=require(_0xf381('0xa'));var ejs=require(_0xf381('0xb'));var fs=require('fs');var fs_extra=require(_0xf381('0xc'));var _=require('lodash');var squel=require(_0xf381('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf381('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf381('0xf'));var Papa=require(_0xf381('0x10'));var Redis=require(_0xf381('0x11'));var authService=require(_0xf381('0x12'));var qs=require(_0xf381('0x13'));var as=require(_0xf381('0x14'));var hardwareService=require(_0xf381('0x15'));var logger=require(_0xf381('0x16'))(_0xf381('0x17'));var utils=require(_0xf381('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xf381('0x19'));var db=require(_0xf381('0x1a'))['db'];config[_0xf381('0x1b')]=_[_0xf381('0x1c')](config['redis'],{'host':_0xf381('0x1d'),'port':0x18eb});var socket=require(_0xf381('0x1e'))(new Redis(config[_0xf381('0x1b')]));require(_0xf381('0x1f'))[_0xf381('0x20')](socket);function respondWithStatusCode(_0x5a13dd,_0x4410e9){_0x4410e9=_0x4410e9||0xcc;return function(_0x5d523c){if(_0x5d523c){return _0x5a13dd[_0xf381('0x21')](_0x4410e9);}return _0x5a13dd[_0xf381('0x22')](_0x4410e9)[_0xf381('0x23')]();};}function respondWithResult(_0x31dbca,_0x43fd2a){_0x43fd2a=_0x43fd2a||0xc8;return function(_0x4260dd){if(_0x4260dd){return _0x31dbca['status'](_0x43fd2a)['json'](_0x4260dd);}};}function respondWithFilteredResult(_0x131015,_0x127fa1){return function(_0x40bce3){if(_0x40bce3){var _0x249a41=typeof _0x127fa1['offset']===_0xf381('0x24')&&typeof _0x127fa1[_0xf381('0x25')]===_0xf381('0x24');var _0x56c28b=_0x40bce3[_0xf381('0x26')];var _0x2b4733=_0x249a41?0x0:_0x127fa1['offset'];var _0x1302eb=_0x249a41?_0x40bce3[_0xf381('0x26')]:_0x127fa1[_0xf381('0x27')]+_0x127fa1[_0xf381('0x25')];var _0x18c40c;if(_0x1302eb>=_0x56c28b){_0x1302eb=_0x56c28b;_0x18c40c=0xc8;}else{_0x18c40c=0xce;}_0x131015['status'](_0x18c40c);return _0x131015[_0xf381('0x28')]('Content-Range',_0x2b4733+'-'+_0x1302eb+'/'+_0x56c28b)[_0xf381('0x29')](_0x40bce3);}return null;};}function patchUpdates(_0xadcc7){return function(_0x395f29){try{jsonpatch[_0xf381('0x2a')](_0x395f29,_0xadcc7,!![]);}catch(_0x236d59){return BPromise[_0xf381('0x2b')](_0x236d59);}return _0x395f29[_0xf381('0x2c')]();};}function saveUpdates(_0x1e8fc4,_0x5a32aa){return function(_0x2b6ca1){if(_0x2b6ca1){return _0x2b6ca1['update'](_0x1e8fc4)[_0xf381('0x2d')](function(_0x499a45){return _0x499a45;});}return null;};}function removeEntity(_0x4f5e06,_0xa403dd){return function(_0x2ec09f){if(_0x2ec09f){return _0x2ec09f['destroy']()['then'](function(){_0x4f5e06[_0xf381('0x22')](0xcc)[_0xf381('0x23')]();});}};}function handleEntityNotFound(_0x412850,_0x15595c){return function(_0x4c8d68){if(!_0x4c8d68){_0x412850[_0xf381('0x21')](0x194);}return _0x4c8d68;};}function handleError(_0x2fdf9d,_0x403379){_0x403379=_0x403379||0x1f4;return function(_0x39617b){logger[_0xf381('0x2e')](_0x39617b[_0xf381('0x2f')]);if(_0x39617b[_0xf381('0x30')]){delete _0x39617b[_0xf381('0x30')];}_0x2fdf9d['status'](_0x403379)[_0xf381('0x31')](_0x39617b);};}exports[_0xf381('0x32')]=function(_0x20a5c7,_0x579848){var _0x474c1b={},_0x5313ca={},_0x408e96={'count':0x0,'rows':[]};var _0x1a3364=_['map'](db[_0xf381('0x33')][_0xf381('0x34')],function(_0x3c779b){return{'name':_0x3c779b[_0xf381('0x35')],'type':_0x3c779b[_0xf381('0x36')]['key']};});_0x5313ca[_0xf381('0x37')]=_['map'](_0x1a3364,'name');_0x5313ca['query']=_['keys'](_0x20a5c7['query']);_0x5313ca[_0xf381('0x38')]=_[_0xf381('0x39')](_0x5313ca[_0xf381('0x37')],_0x5313ca[_0xf381('0x3a')]);_0x474c1b[_0xf381('0x3b')]=_['intersection'](_0x5313ca[_0xf381('0x37')],qs['fields'](_0x20a5c7[_0xf381('0x3a')][_0xf381('0x3c')]));_0x474c1b['attributes']=_0x474c1b[_0xf381('0x3b')][_0xf381('0x3d')]?_0x474c1b['attributes']:_0x5313ca[_0xf381('0x37')];if(!_0x20a5c7[_0xf381('0x3a')][_0xf381('0x3e')](_0xf381('0x3f'))){_0x474c1b['limit']=qs[_0xf381('0x25')](_0x20a5c7[_0xf381('0x3a')]['limit']);_0x474c1b['offset']=qs[_0xf381('0x27')](_0x20a5c7[_0xf381('0x3a')][_0xf381('0x27')]);}_0x474c1b[_0xf381('0x40')]=qs[_0xf381('0x41')](_0x20a5c7['query'][_0xf381('0x41')]);_0x474c1b[_0xf381('0x42')]=qs['filters'](_[_0xf381('0x43')](_0x20a5c7[_0xf381('0x3a')],_0x5313ca['filters']),_0x1a3364);if(_0x20a5c7[_0xf381('0x3a')][_0xf381('0x44')]){_0x474c1b[_0xf381('0x42')]=_[_0xf381('0x45')](_0x474c1b[_0xf381('0x42')],{'$or':_[_0xf381('0x46')](_0x1a3364,function(_0x392bbb){if(_0x392bbb[_0xf381('0x36')]!==_0xf381('0x47')){var _0x38cfcc={};_0x38cfcc[_0x392bbb['name']]={'$like':'%'+_0x20a5c7[_0xf381('0x3a')][_0xf381('0x44')]+'%'};return _0x38cfcc;}})});}_0x474c1b=_[_0xf381('0x45')]({},_0x474c1b,_0x20a5c7[_0xf381('0x48')]);var _0x3dad7d={'where':_0x474c1b['where']};return db[_0xf381('0x33')][_0xf381('0x26')](_0x3dad7d)['then'](function(_0x1116df){_0x408e96['count']=_0x1116df;if(_0x20a5c7[_0xf381('0x3a')]['includeAll']){_0x474c1b[_0xf381('0x49')]=[{'all':!![]}];}return db[_0xf381('0x33')]['findAll'](_0x474c1b);})[_0xf381('0x2d')](function(_0x144b96){_0x408e96[_0xf381('0x4a')]=_0x144b96;return _0x408e96;})[_0xf381('0x2d')](respondWithFilteredResult(_0x579848,_0x474c1b))[_0xf381('0x4b')](handleError(_0x579848,null));};exports[_0xf381('0x4c')]=function(_0xfd2705,_0x19c972){var _0x17b6f8={'raw':!![],'where':{'id':_0xfd2705[_0xf381('0x4d')]['id']}},_0x3dc283={};_0x3dc283[_0xf381('0x37')]=_['keys'](db[_0xf381('0x33')][_0xf381('0x34')]);_0x3dc283['query']=_[_0xf381('0x4e')](_0xfd2705['query']);_0x3dc283[_0xf381('0x38')]=_[_0xf381('0x39')](_0x3dc283['model'],_0x3dc283[_0xf381('0x3a')]);_0x17b6f8[_0xf381('0x3b')]=_['intersection'](_0x3dc283[_0xf381('0x37')],qs['fields'](_0xfd2705[_0xf381('0x3a')][_0xf381('0x3c')]));_0x17b6f8[_0xf381('0x3b')]=_0x17b6f8[_0xf381('0x3b')][_0xf381('0x3d')]?_0x17b6f8['attributes']:_0x3dc283[_0xf381('0x37')];if(_0xfd2705[_0xf381('0x3a')][_0xf381('0x4f')]){_0x17b6f8[_0xf381('0x49')]=[{'all':!![]}];}_0x17b6f8=_[_0xf381('0x45')]({},_0x17b6f8,_0xfd2705[_0xf381('0x48')]);return db[_0xf381('0x33')][_0xf381('0x50')](_0x17b6f8)[_0xf381('0x2d')](handleEntityNotFound(_0x19c972,null))[_0xf381('0x2d')](respondWithResult(_0x19c972,null))[_0xf381('0x4b')](handleError(_0x19c972,null));};exports[_0xf381('0x51')]=function(_0x21d620,_0x3f031e){return db[_0xf381('0x33')][_0xf381('0x51')](_0x21d620[_0xf381('0x52')],{})[_0xf381('0x2d')](respondWithResult(_0x3f031e,0xc9))[_0xf381('0x4b')](handleError(_0x3f031e,null));};exports[_0xf381('0x53')]=function(_0x4626da,_0x486a9d){if(_0x4626da[_0xf381('0x52')]['id']){delete _0x4626da['body']['id'];}return db['ChatInternalMessage'][_0xf381('0x50')]({'where':{'id':_0x4626da['params']['id']}})['then'](handleEntityNotFound(_0x486a9d,null))[_0xf381('0x2d')](saveUpdates(_0x4626da['body'],null))[_0xf381('0x2d')](respondWithResult(_0x486a9d,null))['catch'](handleError(_0x486a9d,null));};exports[_0xf381('0x54')]=function(_0x1eb672,_0xefebc9){return db[_0xf381('0x33')][_0xf381('0x50')]({'where':{'id':_0x1eb672[_0xf381('0x4d')]['id']}})[_0xf381('0x2d')](handleEntityNotFound(_0xefebc9,null))[_0xf381('0x2d')](removeEntity(_0xefebc9,null))['catch'](handleError(_0xefebc9,null));};exports['describe']=function(_0x4efe50,_0x5b9bb7){return db[_0xf381('0x33')]['describe']()[_0xf381('0x2d')](respondWithResult(_0x5b9bb7,null))[_0xf381('0x4b')](handleError(_0x5b9bb7,null));};function wrapUser(_0x439334){return function(_0x2fbcc2){var _0x36dd15=_0x439334['get']({'plain':!![]});_0x36dd15['messages']=[];if(_0x2fbcc2){_0x36dd15[_0xf381('0x55')]=_0x2fbcc2['createdAt'];_0x36dd15['lastMessage']=_0x2fbcc2;}else{_0x36dd15['lastMessageAt']=moment(0x0)[_0xf381('0x56')](_0xf381('0x57'));_0x36dd15[_0xf381('0x58')]={};}return _0x36dd15;};}exports[_0xf381('0x59')]=function(_0x384c17,_0x2df2de,_0x11e31c){var _0x116f50=[];return db[_0xf381('0x5a')]['findAll']({'where':{'role':[_0xf381('0x5b'),_0xf381('0x5c'),'user']},'attributes':['id',_0xf381('0x5d'),_0xf381('0x30'),_0xf381('0x5e'),'userpic',_0xf381('0x5f'),_0xf381('0x60'),_0xf381('0x61'),_0xf381('0x62'),_0xf381('0x63')],'order':qs[_0xf381('0x41')](_0xf381('0x64')),'include':[{'model':db['VoiceQueue'],'as':'VoiceQueues','attributes':['id',_0xf381('0x30'),_0xf381('0x36')],'through':{'attributes':[]}}]})[_0xf381('0x2d')](function(_0x53b3f3){if(_0x53b3f3){var _0x3aef1e=_0x384c17['user'][_0xf381('0x65')]({'plain':!![]});if(!_0x3aef1e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3aef1e[_0xf381('0x5e')]===_0xf381('0x66')){return db[_0xf381('0x67')][_0xf381('0x50')]({'where':{'name':_0xf381('0x68'),'userProfileId':_0x3aef1e[_0xf381('0x69')]},'raw':!![]})['then'](function(_0x4a8d0e){if(_0x4a8d0e){if(_0x4a8d0e[_0xf381('0x6a')]===0x0){return db[_0xf381('0x6b')][_0xf381('0x6c')]({'where':{'sectionId':_0x4a8d0e['id']},'raw':!![]})[_0xf381('0x2d')](function(_0x7de01a){var _0x2ab7ce=[];if(_[_0xf381('0x6d')](_0x7de01a)){_0x2ab7ce=_[_0xf381('0x44')](_0x53b3f3,function(_0xb0197a){if(_0xb0197a[_0xf381('0x5e')]!=='agent'){return _0xb0197a;}});return _0x2ab7ce;}else{for(var _0xb89723=0x0;_0xb89723<_0x53b3f3[_0xf381('0x3d')];_0xb89723++){var _0x752af8=_0x53b3f3[_0xb89723];if(_0x752af8[_0xf381('0x5e')]===_0xf381('0x5b')){var _0x5f0d5d=_[_0xf381('0x50')](_0x7de01a,function(_0x5d78df){return _0x5d78df['resourceId']===_0x752af8['id'];});if(_0x5f0d5d)_0x2ab7ce[_0xf381('0x6e')](_0x752af8);}else{_0x2ab7ce[_0xf381('0x6e')](_0x752af8);}}return _0x2ab7ce;}});}else{return _0x53b3f3;}}else{var _0x4e546f=_['filter'](_0x53b3f3,function(_0x26a965){if(_0x26a965[_0xf381('0x5e')]!==_0xf381('0x5b')){return _0x26a965;}});return _0x4e546f;}});}else{return _0x53b3f3;}}})[_0xf381('0x2d')](function(_0x571ccd){var _0x1c70ae=[];if(_0x571ccd){_0x116f50=_0x571ccd;for(var _0x33b780=0x0;_0x33b780<_0x571ccd[_0xf381('0x3d')];_0x33b780+=0x1){_0x116f50[_0x33b780][_0xf381('0x6f')]=[];_0x1c70ae[_0xf381('0x6e')](db[_0xf381('0x33')][_0xf381('0x50')]({'where':{'FromId':[_0x384c17[_0xf381('0x66')]['id'],_0x571ccd[_0x33b780]['id']],'ToId':[_0x384c17[_0xf381('0x66')]['id'],_0x571ccd[_0x33b780]['id']],'ChatGroupId':null},'attributes':['id',_0xf381('0x70'),_0xf381('0x71'),_0xf381('0x72'),_0xf381('0x73'),_0xf381('0x52')],'order':qs['sort']('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0xf381('0x2d')](wrapUser(_0x571ccd[_0x33b780])));}return BPromise[_0xf381('0x74')](_0x1c70ae);}return[];})[_0xf381('0x2d')](function(_0x1333dc){return{'rows':_0x1333dc,'count':_0x1333dc['length']};})[_0xf381('0x2d')](respondWithResult(_0x2df2de,null))[_0xf381('0x4b')](handleError(_0x2df2de,null));}; \ No newline at end of file +var _0xa1a4=['format','User','agent','admin','user','fullname','userpic','internal','online','showWebBar','-online','VoiceQueue','VoiceQueues','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','messages','FromId','ToId','read','-createdAt','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','sendStatus','status','end','json','offset','undefined','count','set','apply','reject','save','update','then','destroy','stack','name','index','map','ChatInternalMessage','rawAttributes','type','query','model','attributes','intersection','fields','length','limit','order','sort','filters','pick','filter','VIRTUAL','merge','where','includeAll','include','findAll','catch','show','params','options','find','create','body','describe','lastMessageAt','createdAt','lastMessage'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xa1a4,0x14b));var _0x4a1a=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xa1a4[_0x27af45];return _0x18df21;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4a1a('0x0'));var moment=require(_0x4a1a('0x1'));var BPromise=require(_0x4a1a('0x2'));var Mustache=require(_0x4a1a('0x3'));var util=require('util');var path=require(_0x4a1a('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4a1a('0x5'));var fs=require('fs');var fs_extra=require(_0x4a1a('0x6'));var _=require(_0x4a1a('0x7'));var squel=require(_0x4a1a('0x8'));var crypto=require(_0x4a1a('0x9'));var jsforce=require(_0x4a1a('0xa'));var deskjs=require(_0x4a1a('0xb'));var toCsv=require(_0x4a1a('0xc'));var querystring=require(_0x4a1a('0xd'));var Papa=require('papaparse');var Redis=require(_0x4a1a('0xe'));var authService=require(_0x4a1a('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4a1a('0x10'));var logger=require('../../config/logger')(_0x4a1a('0x11'));var utils=require(_0x4a1a('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x4a1a('0x13'));var db=require(_0x4a1a('0x14'))['db'];config[_0x4a1a('0x15')]=_[_0x4a1a('0x16')](config[_0x4a1a('0x15')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4a1a('0x15')]));require('./chatInternalMessage.socket')['register'](socket);function respondWithStatusCode(_0x53c82b,_0x57ae5f){_0x57ae5f=_0x57ae5f||0xcc;return function(_0xe550c7){if(_0xe550c7){return _0x53c82b[_0x4a1a('0x17')](_0x57ae5f);}return _0x53c82b[_0x4a1a('0x18')](_0x57ae5f)[_0x4a1a('0x19')]();};}function respondWithResult(_0xba17d4,_0x43f393){_0x43f393=_0x43f393||0xc8;return function(_0x3a14a3){if(_0x3a14a3){return _0xba17d4['status'](_0x43f393)[_0x4a1a('0x1a')](_0x3a14a3);}};}function respondWithFilteredResult(_0x7a5f83,_0x110534){return function(_0x2f3cc9){if(_0x2f3cc9){var _0x224409=typeof _0x110534[_0x4a1a('0x1b')]===_0x4a1a('0x1c')&&typeof _0x110534['limit']===_0x4a1a('0x1c');var _0x141279=_0x2f3cc9[_0x4a1a('0x1d')];var _0x2f121a=_0x224409?0x0:_0x110534[_0x4a1a('0x1b')];var _0x29c83d=_0x224409?_0x2f3cc9[_0x4a1a('0x1d')]:_0x110534[_0x4a1a('0x1b')]+_0x110534['limit'];var _0x17eb5a;if(_0x29c83d>=_0x141279){_0x29c83d=_0x141279;_0x17eb5a=0xc8;}else{_0x17eb5a=0xce;}_0x7a5f83[_0x4a1a('0x18')](_0x17eb5a);return _0x7a5f83[_0x4a1a('0x1e')]('Content-Range',_0x2f121a+'-'+_0x29c83d+'/'+_0x141279)[_0x4a1a('0x1a')](_0x2f3cc9);}return null;};}function patchUpdates(_0x7d9a3c){return function(_0x28158e){try{jsonpatch[_0x4a1a('0x1f')](_0x28158e,_0x7d9a3c,!![]);}catch(_0x356eec){return BPromise[_0x4a1a('0x20')](_0x356eec);}return _0x28158e[_0x4a1a('0x21')]();};}function saveUpdates(_0x54ec3f,_0x540fcb){return function(_0x226f0a){if(_0x226f0a){return _0x226f0a[_0x4a1a('0x22')](_0x54ec3f)[_0x4a1a('0x23')](function(_0x44f2ce){return _0x44f2ce;});}return null;};}function removeEntity(_0x3eaa4f,_0x31dff3){return function(_0x242579){if(_0x242579){return _0x242579[_0x4a1a('0x24')]()[_0x4a1a('0x23')](function(){_0x3eaa4f['status'](0xcc)[_0x4a1a('0x19')]();});}};}function handleEntityNotFound(_0x443517,_0xf3ea79){return function(_0x306471){if(!_0x306471){_0x443517[_0x4a1a('0x17')](0x194);}return _0x306471;};}function handleError(_0x280c5f,_0x381dca){_0x381dca=_0x381dca||0x1f4;return function(_0x2d7fbc){logger['error'](_0x2d7fbc[_0x4a1a('0x25')]);if(_0x2d7fbc['name']){delete _0x2d7fbc[_0x4a1a('0x26')];}_0x280c5f['status'](_0x381dca)['send'](_0x2d7fbc);};}exports[_0x4a1a('0x27')]=function(_0x3f2461,_0x9329){var _0x345217={},_0x385e84={},_0x3d40d1={'count':0x0,'rows':[]};var _0x1540eb=_[_0x4a1a('0x28')](db[_0x4a1a('0x29')][_0x4a1a('0x2a')],function(_0x5a994d){return{'name':_0x5a994d['fieldName'],'type':_0x5a994d[_0x4a1a('0x2b')]['key']};});_0x385e84['model']=_[_0x4a1a('0x28')](_0x1540eb,'name');_0x385e84[_0x4a1a('0x2c')]=_['keys'](_0x3f2461[_0x4a1a('0x2c')]);_0x385e84['filters']=_['intersection'](_0x385e84[_0x4a1a('0x2d')],_0x385e84[_0x4a1a('0x2c')]);_0x345217[_0x4a1a('0x2e')]=_[_0x4a1a('0x2f')](_0x385e84[_0x4a1a('0x2d')],qs[_0x4a1a('0x30')](_0x3f2461[_0x4a1a('0x2c')][_0x4a1a('0x30')]));_0x345217[_0x4a1a('0x2e')]=_0x345217['attributes'][_0x4a1a('0x31')]?_0x345217['attributes']:_0x385e84['model'];if(!_0x3f2461[_0x4a1a('0x2c')]['hasOwnProperty']('nolimit')){_0x345217[_0x4a1a('0x32')]=qs[_0x4a1a('0x32')](_0x3f2461[_0x4a1a('0x2c')]['limit']);_0x345217[_0x4a1a('0x1b')]=qs[_0x4a1a('0x1b')](_0x3f2461[_0x4a1a('0x2c')]['offset']);}_0x345217[_0x4a1a('0x33')]=qs[_0x4a1a('0x34')](_0x3f2461['query'][_0x4a1a('0x34')]);_0x345217['where']=qs[_0x4a1a('0x35')](_[_0x4a1a('0x36')](_0x3f2461[_0x4a1a('0x2c')],_0x385e84[_0x4a1a('0x35')]),_0x1540eb);if(_0x3f2461[_0x4a1a('0x2c')][_0x4a1a('0x37')]){_0x345217['where']=_['merge'](_0x345217['where'],{'$or':_[_0x4a1a('0x28')](_0x1540eb,function(_0x43d87d){if(_0x43d87d[_0x4a1a('0x2b')]!==_0x4a1a('0x38')){var _0x29d472={};_0x29d472[_0x43d87d[_0x4a1a('0x26')]]={'$like':'%'+_0x3f2461[_0x4a1a('0x2c')][_0x4a1a('0x37')]+'%'};return _0x29d472;}})});}_0x345217=_[_0x4a1a('0x39')]({},_0x345217,_0x3f2461['options']);var _0x3cc098={'where':_0x345217[_0x4a1a('0x3a')]};return db[_0x4a1a('0x29')]['count'](_0x3cc098)['then'](function(_0x1679fe){_0x3d40d1['count']=_0x1679fe;if(_0x3f2461['query'][_0x4a1a('0x3b')]){_0x345217[_0x4a1a('0x3c')]=[{'all':!![]}];}return db[_0x4a1a('0x29')][_0x4a1a('0x3d')](_0x345217);})[_0x4a1a('0x23')](function(_0x9a72f6){_0x3d40d1['rows']=_0x9a72f6;return _0x3d40d1;})[_0x4a1a('0x23')](respondWithFilteredResult(_0x9329,_0x345217))[_0x4a1a('0x3e')](handleError(_0x9329,null));};exports[_0x4a1a('0x3f')]=function(_0x1fd7b3,_0x357728){var _0x58ebb4={'raw':!![],'where':{'id':_0x1fd7b3[_0x4a1a('0x40')]['id']}},_0x2fc3da={};_0x2fc3da[_0x4a1a('0x2d')]=_['keys'](db['ChatInternalMessage'][_0x4a1a('0x2a')]);_0x2fc3da[_0x4a1a('0x2c')]=_['keys'](_0x1fd7b3['query']);_0x2fc3da[_0x4a1a('0x35')]=_[_0x4a1a('0x2f')](_0x2fc3da[_0x4a1a('0x2d')],_0x2fc3da[_0x4a1a('0x2c')]);_0x58ebb4[_0x4a1a('0x2e')]=_[_0x4a1a('0x2f')](_0x2fc3da[_0x4a1a('0x2d')],qs[_0x4a1a('0x30')](_0x1fd7b3[_0x4a1a('0x2c')][_0x4a1a('0x30')]));_0x58ebb4[_0x4a1a('0x2e')]=_0x58ebb4['attributes']['length']?_0x58ebb4[_0x4a1a('0x2e')]:_0x2fc3da['model'];if(_0x1fd7b3[_0x4a1a('0x2c')][_0x4a1a('0x3b')]){_0x58ebb4['include']=[{'all':!![]}];}_0x58ebb4=_[_0x4a1a('0x39')]({},_0x58ebb4,_0x1fd7b3[_0x4a1a('0x41')]);return db[_0x4a1a('0x29')][_0x4a1a('0x42')](_0x58ebb4)['then'](handleEntityNotFound(_0x357728,null))[_0x4a1a('0x23')](respondWithResult(_0x357728,null))['catch'](handleError(_0x357728,null));};exports['create']=function(_0x2bc112,_0x12179d){return db[_0x4a1a('0x29')][_0x4a1a('0x43')](_0x2bc112['body'],{})[_0x4a1a('0x23')](respondWithResult(_0x12179d,0xc9))['catch'](handleError(_0x12179d,null));};exports['update']=function(_0x512c7e,_0x45fc76){if(_0x512c7e[_0x4a1a('0x44')]['id']){delete _0x512c7e['body']['id'];}return db[_0x4a1a('0x29')][_0x4a1a('0x42')]({'where':{'id':_0x512c7e[_0x4a1a('0x40')]['id']}})['then'](handleEntityNotFound(_0x45fc76,null))[_0x4a1a('0x23')](saveUpdates(_0x512c7e[_0x4a1a('0x44')],null))['then'](respondWithResult(_0x45fc76,null))[_0x4a1a('0x3e')](handleError(_0x45fc76,null));};exports[_0x4a1a('0x24')]=function(_0x3e8899,_0xf08687){return db['ChatInternalMessage']['find']({'where':{'id':_0x3e8899[_0x4a1a('0x40')]['id']}})[_0x4a1a('0x23')](handleEntityNotFound(_0xf08687,null))[_0x4a1a('0x23')](removeEntity(_0xf08687,null))[_0x4a1a('0x3e')](handleError(_0xf08687,null));};exports['describe']=function(_0x5de905,_0x427b3c){return db[_0x4a1a('0x29')][_0x4a1a('0x45')]()[_0x4a1a('0x23')](respondWithResult(_0x427b3c,null))[_0x4a1a('0x3e')](handleError(_0x427b3c,null));};function wrapUser(_0x14ddde){return function(_0x843586){var _0x58bc06=_0x14ddde['get']({'plain':!![]});_0x58bc06['messages']=[];if(_0x843586){_0x58bc06[_0x4a1a('0x46')]=_0x843586[_0x4a1a('0x47')];_0x58bc06[_0x4a1a('0x48')]=_0x843586;}else{_0x58bc06[_0x4a1a('0x46')]=moment(0x0)[_0x4a1a('0x49')]('YYYY-MM-DD\x20HH:mm:ss');_0x58bc06[_0x4a1a('0x48')]={};}return _0x58bc06;};}exports['getUsers']=function(_0xa2e32e,_0x219901,_0x4b7ad4){var _0x49ad63=[];return db[_0x4a1a('0x4a')]['findAll']({'where':{'role':[_0x4a1a('0x4b'),_0x4a1a('0x4c'),_0x4a1a('0x4d')]},'attributes':['id',_0x4a1a('0x4e'),'name','role',_0x4a1a('0x4f'),_0x4a1a('0x50'),_0x4a1a('0x51'),'lastLoginAt','allowmessenger',_0x4a1a('0x52')],'order':qs[_0x4a1a('0x34')](_0x4a1a('0x53')),'include':[{'model':db[_0x4a1a('0x54')],'as':_0x4a1a('0x55'),'attributes':['id',_0x4a1a('0x26'),_0x4a1a('0x2b')],'through':{'attributes':[]}}]})[_0x4a1a('0x23')](function(_0xc86608){if(_0xc86608){var _0x3c8f6c=_0xa2e32e[_0x4a1a('0x4d')][_0x4a1a('0x56')]({'plain':!![]});if(!_0x3c8f6c)throw new Error(_0x4a1a('0x57'));if(_0x3c8f6c[_0x4a1a('0x58')]==='user'){return db['UserProfileSection'][_0x4a1a('0x42')]({'where':{'name':_0x4a1a('0x59'),'userProfileId':_0x3c8f6c[_0x4a1a('0x5a')]},'raw':!![]})[_0x4a1a('0x23')](function(_0x5c07b2){if(_0x5c07b2){if(_0x5c07b2[_0x4a1a('0x5b')]===0x0){return db[_0x4a1a('0x5c')][_0x4a1a('0x3d')]({'where':{'sectionId':_0x5c07b2['id']},'raw':!![]})[_0x4a1a('0x23')](function(_0xbe2941){var _0x4f5692=[];if(_[_0x4a1a('0x5d')](_0xbe2941)){_0x4f5692=_['filter'](_0xc86608,function(_0x2bf3b2){if(_0x2bf3b2[_0x4a1a('0x58')]!=='agent'){return _0x2bf3b2;}});return _0x4f5692;}else{for(var _0x391f12=0x0;_0x391f12<_0xc86608[_0x4a1a('0x31')];_0x391f12++){var _0x369412=_0xc86608[_0x391f12];if(_0x369412[_0x4a1a('0x58')]===_0x4a1a('0x4b')){var _0x55112b=_['find'](_0xbe2941,function(_0x3a63c5){return _0x3a63c5[_0x4a1a('0x5e')]===_0x369412['id'];});if(_0x55112b)_0x4f5692[_0x4a1a('0x5f')](_0x369412);}else{_0x4f5692['push'](_0x369412);}}return _0x4f5692;}});}else{return _0xc86608;}}else{var _0x6c6b8e=_[_0x4a1a('0x37')](_0xc86608,function(_0x5c997c){if(_0x5c997c[_0x4a1a('0x58')]!==_0x4a1a('0x4b')){return _0x5c997c;}});return _0x6c6b8e;}});}else{return _0xc86608;}}})[_0x4a1a('0x23')](function(_0x312db6){var _0x380939=[];if(_0x312db6){_0x49ad63=_0x312db6;for(var _0x282cba=0x0;_0x282cba<_0x312db6[_0x4a1a('0x31')];_0x282cba+=0x1){_0x49ad63[_0x282cba][_0x4a1a('0x60')]=[];_0x380939[_0x4a1a('0x5f')](db[_0x4a1a('0x29')][_0x4a1a('0x42')]({'where':{'FromId':[_0xa2e32e[_0x4a1a('0x4d')]['id'],_0x312db6[_0x282cba]['id']],'ToId':[_0xa2e32e[_0x4a1a('0x4d')]['id'],_0x312db6[_0x282cba]['id']],'ChatGroupId':null},'attributes':['id',_0x4a1a('0x47'),_0x4a1a('0x61'),_0x4a1a('0x62'),_0x4a1a('0x63'),'body'],'order':qs[_0x4a1a('0x34')](_0x4a1a('0x64')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x4a1a('0x23')](wrapUser(_0x312db6[_0x282cba])));}return BPromise['all'](_0x380939);}return[];})[_0x4a1a('0x23')](function(_0x23ad35){return{'rows':_0x23ad35,'count':_0x23ad35[_0x4a1a('0x31')]};})[_0x4a1a('0x23')](respondWithResult(_0x219901,null))[_0x4a1a('0x3e')](handleError(_0x219901,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index cefb6ba..80e2118 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 _0x8a17=['hasOwnProperty','hook','exports','events','setMaxListeners','save','update','remove','emit'];(function(_0x5c3a5a,_0x2330d8){var _0x58b45b=function(_0x575d94){while(--_0x575d94){_0x5c3a5a['push'](_0x5c3a5a['shift']());}};_0x58b45b(++_0x2330d8);}(_0x8a17,0x135));var _0x78a1=function(_0x28b0a1,_0x99bd0a){_0x28b0a1=_0x28b0a1-0x0;var _0x21470c=_0x8a17[_0x28b0a1];return _0x21470c;};'use strict';var EventEmitter=require(_0x78a1('0x0'));var ChatInternalMessage=require('../../mysqldb')['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x78a1('0x1')](0x0);var events={'afterCreate':_0x78a1('0x2'),'afterUpdate':_0x78a1('0x3'),'afterDestroy':_0x78a1('0x4')};function emitEvent(_0x4a92b9){return function(_0x2dee4d,_0x168b2c,_0x30124e){ChatInternalMessageEvents[_0x78a1('0x5')](_0x4a92b9+':'+_0x2dee4d['id'],_0x2dee4d);ChatInternalMessageEvents[_0x78a1('0x5')](_0x4a92b9,_0x2dee4d);_0x30124e(null);};}for(var e in events){if(events[_0x78a1('0x6')](e)){var event=events[e];ChatInternalMessage[_0x78a1('0x7')](e,emitEvent(event));}}module[_0x78a1('0x8')]=ChatInternalMessageEvents; \ No newline at end of file +var _0x5d2b=['remove','emit','hook','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save'];(function(_0x1cd116,_0xbc2217){var _0x20f460=function(_0x51f507){while(--_0x51f507){_0x1cd116['push'](_0x1cd116['shift']());}};_0x20f460(++_0xbc2217);}(_0x5d2b,0xbb));var _0xb5d2=function(_0x281e8f,_0x439162){_0x281e8f=_0x281e8f-0x0;var _0x35ca96=_0x5d2b[_0x281e8f];return _0x35ca96;};'use strict';var EventEmitter=require(_0xb5d2('0x0'));var ChatInternalMessage=require(_0xb5d2('0x1'))['db'][_0xb5d2('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xb5d2('0x3')](0x0);var events={'afterCreate':_0xb5d2('0x4'),'afterUpdate':'update','afterDestroy':_0xb5d2('0x5')};function emitEvent(_0x5f5aa4){return function(_0x1120e4,_0x2b622b,_0x267a25){ChatInternalMessageEvents[_0xb5d2('0x6')](_0x5f5aa4+':'+_0x1120e4['id'],_0x1120e4);ChatInternalMessageEvents[_0xb5d2('0x6')](_0x5f5aa4,_0x1120e4);_0x267a25(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0xb5d2('0x7')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 2ed3cab..1566ae5 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 _0x97cd=['rimraf','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','utf8mb4','util','../../config/logger','api','request-promise'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0x97cd,0x1aa));var _0xd97c=function(_0x16b97e,_0x33bb22){_0x16b97e=_0x16b97e-0x0;var _0x232f4d=_0x97cd[_0x16b97e];return _0x232f4d;};'use strict';var _=require('lodash');var util=require(_0xd97c('0x0'));var logger=require(_0xd97c('0x1'))(_0xd97c('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd97c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd97c('0x4'));var config=require('../../config/environment');var attributes=require(_0xd97c('0x5'));module[_0xd97c('0x6')]=function(_0x4f3b78,_0xc6a418){return _0x4f3b78[_0xd97c('0x7')](_0xd97c('0x8'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd97c('0x9'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xd44a=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4_unicode_ci','lodash'];(function(_0x52ddc8,_0xada5d6){var _0x41e9c3=function(_0x432441){while(--_0x432441){_0x52ddc8['push'](_0x52ddc8['shift']());}};_0x41e9c3(++_0xada5d6);}(_0xd44a,0x149));var _0xad44=function(_0x144795,_0x3ffe44){_0x144795=_0x144795-0x0;var _0x2f3227=_0xd44a[_0x144795];return _0x2f3227;};'use strict';var _=require(_0xad44('0x0'));var util=require('util');var logger=require(_0xad44('0x1'))(_0xad44('0x2'));var moment=require(_0xad44('0x3'));var BPromise=require(_0xad44('0x4'));var rp=require(_0xad44('0x5'));var fs=require('fs');var path=require(_0xad44('0x6'));var rimraf=require(_0xad44('0x7'));var config=require(_0xad44('0x8'));var attributes=require(_0xad44('0x9'));module[_0xad44('0xa')]=function(_0x378562,_0x170f53){return _0x378562[_0xad44('0xb')](_0xad44('0xc'),attributes,{'tableName':_0xad44('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xad44('0xe')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 84f5a2c..b10b881 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 _0x98ea=['rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','request','then','info','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','ChatInternalMessage,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x428310,_0x16977c){var _0x4eae4f=function(_0x444bb9){while(--_0x444bb9){_0x428310['push'](_0x428310['shift']());}};_0x4eae4f(++_0x16977c);}(_0x98ea,0x164));var _0xa98e=function(_0x5ac4d3,_0x5456e9){_0x5ac4d3=_0x5ac4d3-0x0;var _0x186a90=_0x98ea[_0x5ac4d3];return _0x186a90;};'use strict';var _=require(_0xa98e('0x0'));var util=require(_0xa98e('0x1'));var moment=require(_0xa98e('0x2'));var BPromise=require(_0xa98e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa98e('0x4'));var db=require(_0xa98e('0x5'))['db'];var utils=require(_0xa98e('0x6'));var logger=require(_0xa98e('0x7'))(_0xa98e('0x8'));var config=require(_0xa98e('0x9'));var jayson=require(_0xa98e('0xa'));var client=jayson[_0xa98e('0xb')][_0xa98e('0xc')]({'port':0x232a});config[_0xa98e('0xd')]=_[_0xa98e('0xe')](config[_0xa98e('0xd')],{'host':_0xa98e('0xf'),'port':0x18eb});var socket=require(_0xa98e('0x10'))(new Redis(config['redis']));require(_0xa98e('0x11'))['register'](socket);function respondWithRpcPromise(_0x2cd653,_0x1357bd,_0x2f6c60){return new BPromise(function(_0x15a499,_0x22b4f9){return client[_0xa98e('0x12')](_0x2cd653,_0x2f6c60)[_0xa98e('0x13')](function(_0x1fd92d){logger[_0xa98e('0x14')]('ChatInternalMessage,\x20%s,\x20%s',_0x1357bd,_0xa98e('0x15'));logger['debug'](_0xa98e('0x16'),_0x1357bd,_0xa98e('0x15'),JSON['stringify'](_0x1fd92d));if(_0x1fd92d[_0xa98e('0x17')]){if(_0x1fd92d[_0xa98e('0x17')]['code']===0x1f4){logger[_0xa98e('0x17')](_0xa98e('0x18'),_0x1357bd,_0x1fd92d[_0xa98e('0x17')][_0xa98e('0x19')]);return _0x22b4f9(_0x1fd92d[_0xa98e('0x17')][_0xa98e('0x19')]);}logger['error'](_0xa98e('0x18'),_0x1357bd,_0x1fd92d['error'][_0xa98e('0x19')]);return _0x15a499(_0x1fd92d[_0xa98e('0x17')][_0xa98e('0x19')]);}else{logger[_0xa98e('0x14')](_0xa98e('0x18'),_0x1357bd,_0xa98e('0x15'));_0x15a499(_0x1fd92d[_0xa98e('0x1a')][_0xa98e('0x19')]);}})[_0xa98e('0x1b')](function(_0x3ad305){logger[_0xa98e('0x17')](_0xa98e('0x18'),_0x1357bd,_0x3ad305);_0x22b4f9(_0x3ad305);});});} \ No newline at end of file +var _0x44f6=['stringify','error','message','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s'];(function(_0x4a5871,_0x5bbf39){var _0xd0f956=function(_0x1adf6d){while(--_0x1adf6d){_0x4a5871['push'](_0x4a5871['shift']());}};_0xd0f956(++_0x5bbf39);}(_0x44f6,0xa4));var _0x644f=function(_0x2132a3,_0x4639e9){_0x2132a3=_0x2132a3-0x0;var _0x21890c=_0x44f6[_0x2132a3];return _0x21890c;};'use strict';var _=require(_0x644f('0x0'));var util=require(_0x644f('0x1'));var moment=require(_0x644f('0x2'));var BPromise=require(_0x644f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x644f('0x4'))['db'];var utils=require(_0x644f('0x5'));var logger=require(_0x644f('0x6'))(_0x644f('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x644f('0x8')][_0x644f('0x9')]({'port':0x232a});config[_0x644f('0xa')]=_[_0x644f('0xb')](config[_0x644f('0xa')],{'host':_0x644f('0xc'),'port':0x18eb});var socket=require(_0x644f('0xd'))(new Redis(config['redis']));require('./chatInternalMessage.socket')['register'](socket);function respondWithRpcPromise(_0x18eee9,_0x12210d,_0x1b7bc9){return new BPromise(function(_0x485c0a,_0x486476){return client[_0x644f('0xe')](_0x18eee9,_0x1b7bc9)[_0x644f('0xf')](function(_0x2e8c6b){logger[_0x644f('0x10')](_0x644f('0x11'),_0x12210d,_0x644f('0x12'));logger['debug'](_0x644f('0x13'),_0x12210d,_0x644f('0x12'),JSON[_0x644f('0x14')](_0x2e8c6b));if(_0x2e8c6b[_0x644f('0x15')]){if(_0x2e8c6b[_0x644f('0x15')]['code']===0x1f4){logger['error'](_0x644f('0x11'),_0x12210d,_0x2e8c6b[_0x644f('0x15')][_0x644f('0x16')]);return _0x486476(_0x2e8c6b[_0x644f('0x15')][_0x644f('0x16')]);}logger[_0x644f('0x15')](_0x644f('0x11'),_0x12210d,_0x2e8c6b[_0x644f('0x15')][_0x644f('0x16')]);return _0x485c0a(_0x2e8c6b[_0x644f('0x15')][_0x644f('0x16')]);}else{logger['info'](_0x644f('0x11'),_0x12210d,_0x644f('0x12'));_0x485c0a(_0x2e8c6b['result'][_0x644f('0x16')]);}})['catch'](function(_0x15a0a2){logger[_0x644f('0x15')](_0x644f('0x11'),_0x12210d,_0x15a0a2);_0x486476(_0x15a0a2);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 3c431a4..9d3ca69 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 _0xada5=['emit','length','chatInternalMessage:','update'];(function(_0x43e854,_0x3daa61){var _0x52409b=function(_0x46e66c){while(--_0x46e66c){_0x43e854['push'](_0x43e854['shift']());}};_0x52409b(++_0x3daa61);}(_0xada5,0xd7));var _0x5ada=function(_0x23fe4a,_0x5e6044){_0x23fe4a=_0x23fe4a-0x0;var _0x13ff94=_0xada5[_0x23fe4a];return _0x13ff94;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=['save','remove',_0x5ada('0x0')];function createListener(_0x4fe421,_0xf27179){return function(_0x1a7a84){_0xf27179[_0x5ada('0x1')](_0x4fe421,_0x1a7a84);};}function removeListener(_0x193eca,_0x500e2a){return function(){ChatInternalMessageEvents['removeListener'](_0x193eca,_0x500e2a);};}exports['register']=function(_0x18949){for(var _0x48a6bf=0x0,_0x3d725f=events[_0x5ada('0x2')];_0x48a6bf<_0x3d725f;_0x48a6bf++){var _0x159b79=events[_0x48a6bf];var _0x2932af=createListener(_0x5ada('0x3')+_0x159b79,_0x18949);ChatInternalMessageEvents['on'](_0x159b79,_0x2932af);}}; \ No newline at end of file +var _0x2df5=['remove','emit','removeListener','register','length','save'];(function(_0x36690b,_0x12e879){var _0x45d7dd=function(_0x132709){while(--_0x132709){_0x36690b['push'](_0x36690b['shift']());}};_0x45d7dd(++_0x12e879);}(_0x2df5,0x89));var _0x52df=function(_0x34000d,_0x15d6ba){_0x34000d=_0x34000d-0x0;var _0x34a9b7=_0x2df5[_0x34000d];return _0x34a9b7;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0x52df('0x0'),_0x52df('0x1'),'update'];function createListener(_0x5fbcf5,_0x45b835){return function(_0x425b68){_0x45b835[_0x52df('0x2')](_0x5fbcf5,_0x425b68);};}function removeListener(_0x3932e3,_0x4d6d45){return function(){ChatInternalMessageEvents[_0x52df('0x3')](_0x3932e3,_0x4d6d45);};}exports[_0x52df('0x4')]=function(_0xcd9119){for(var _0x4867c6=0x0,_0x59730a=events[_0x52df('0x5')];_0x4867c6<_0x59730a;_0x4867c6++){var _0xcf7b69=events[_0x4867c6];var _0x4cbfc4=createListener('chatInternalMessage:'+_0xcf7b69,_0xcd9119);ChatInternalMessageEvents['on'](_0xcf7b69,_0x4cbfc4);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 8974f07..0cbb8c4 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 _0x0e4a=['describe','/users','/:id','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','get','/describe','isAuthenticated'];(function(_0x1cca49,_0x46800d){var _0x64efae=function(_0x280e75){while(--_0x280e75){_0x1cca49['push'](_0x1cca49['shift']());}};_0x64efae(++_0x46800d);}(_0x0e4a,0xc7));var _0xa0e4=function(_0x383d53,_0x3374dd){_0x383d53=_0x383d53-0x0;var _0x3a6eb9=_0x0e4a[_0x383d53];return _0x3a6eb9;};'use strict';var multer=require(_0xa0e4('0x0'));var util=require(_0xa0e4('0x1'));var path=require(_0xa0e4('0x2'));var timeout=require(_0xa0e4('0x3'));var express=require(_0xa0e4('0x4'));var router=express[_0xa0e4('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa0e4('0x6'));var controller=require('./chatInternalMessage.controller');router[_0xa0e4('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xa0e4('0x8'),auth[_0xa0e4('0x9')](),controller[_0xa0e4('0xa')]);router[_0xa0e4('0x7')](_0xa0e4('0xb'),auth[_0xa0e4('0x9')](),controller['getUsers']);router[_0xa0e4('0x7')](_0xa0e4('0xc'),auth[_0xa0e4('0x9')](),controller['show']);router[_0xa0e4('0xd')]('/',auth[_0xa0e4('0x9')](),controller[_0xa0e4('0xe')]);router[_0xa0e4('0xf')](_0xa0e4('0xc'),controller[_0xa0e4('0x10')]);router['delete'](_0xa0e4('0xc'),auth[_0xa0e4('0x9')](),controller[_0xa0e4('0x11')]);module[_0xa0e4('0x12')]=router; \ No newline at end of file +var _0x9559=['util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','/users','getUsers','/:id','create','update','delete','multer'];(function(_0x30cc1a,_0x162bbc){var _0xb3f18f=function(_0x26bdfe){while(--_0x26bdfe){_0x30cc1a['push'](_0x30cc1a['shift']());}};_0xb3f18f(++_0x162bbc);}(_0x9559,0x1c7));var _0x9955=function(_0x2f62aa,_0x108e95){_0x2f62aa=_0x2f62aa-0x0;var _0x1a341f=_0x9559[_0x2f62aa];return _0x1a341f;};'use strict';var multer=require(_0x9955('0x0'));var util=require(_0x9955('0x1'));var path=require(_0x9955('0x2'));var timeout=require(_0x9955('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x9955('0x4'));var auth=require(_0x9955('0x5'));var interaction=require(_0x9955('0x6'));var config=require(_0x9955('0x7'));var controller=require(_0x9955('0x8'));router[_0x9955('0x9')]('/',auth[_0x9955('0xa')](),controller[_0x9955('0xb')]);router['get'](_0x9955('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x9955('0x9')](_0x9955('0xd'),auth[_0x9955('0xa')](),controller[_0x9955('0xe')]);router[_0x9955('0x9')](_0x9955('0xf'),auth[_0x9955('0xa')](),controller['show']);router['post']('/',auth[_0x9955('0xa')](),controller[_0x9955('0x10')]);router['put'](_0x9955('0xf'),controller[_0x9955('0x11')]);router[_0x9955('0x12')](_0x9955('0xf'),auth[_0x9955('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 0916445..60d647f 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 _0xefe2=['TEXT','sequelize','exports','medium','BOOLEAN','ENUM','out','DATE','STRING'];(function(_0x5235a6,_0x680b76){var _0x1cf37e=function(_0x31c173){while(--_0x31c173){_0x5235a6['push'](_0x5235a6['shift']());}};_0x1cf37e(++_0x680b76);}(_0xefe2,0xd9));var _0x2efe=function(_0x4809b9,_0x2b1841){_0x4809b9=_0x4809b9-0x0;var _0x466a1b=_0xefe2[_0x4809b9];return _0x466a1b;};'use strict';var Sequelize=require(_0x2efe('0x0'));module[_0x2efe('0x1')]={'body':{'type':Sequelize['TEXT'](_0x2efe('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x2efe('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x2efe('0x4')]('in','out'),'defaultValue':_0x2efe('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x2efe('0x6')]},'providerName':{'type':Sequelize[_0x2efe('0x7')]},'providerResponse':{'type':Sequelize[_0x2efe('0x8')]}}; \ No newline at end of file +var _0x5a13=['TEXT','sequelize','exports','medium','BOOLEAN','ENUM','out','DATE','STRING'];(function(_0xdc4ef4,_0x48ffd4){var _0x136eeb=function(_0x471d9f){while(--_0x471d9f){_0xdc4ef4['push'](_0xdc4ef4['shift']());}};_0x136eeb(++_0x48ffd4);}(_0x5a13,0x145));var _0x35a1=function(_0x3fb324,_0x5f5908){_0x3fb324=_0x3fb324-0x0;var _0x583007=_0x5a13[_0x3fb324];return _0x583007;};'use strict';var Sequelize=require(_0x35a1('0x0'));module[_0x35a1('0x1')]={'body':{'type':Sequelize['TEXT'](_0x35a1('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x35a1('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x35a1('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x35a1('0x4')]('in',_0x35a1('0x5')),'defaultValue':_0x35a1('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x35a1('0x6')]},'providerName':{'type':Sequelize[_0x35a1('0x7')]},'providerResponse':{'type':Sequelize[_0x35a1('0x8')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 4f31926..421e79e 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 _0x0a63=['create','body','update','destroy','describe','chat-interactions','accept','chat','read','format','UserId','user','agent','get','ChatInteraction','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','SELECT','contact','User','fullname','email','manual','SIP/%s','channel','motionChannel','EventManager','parse','formData','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','ContactId','QueryTypes','internal','interface','event','rejectmessage','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','./chatMessage.socket','jayson/promise','client','http','then','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','ChatMessage,\x20%s,\x20%s','result','catch','sendStatus','status','offset','undefined','count','limit','set','Content-Range','apply','reject','end','stack','name','send','index','map','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','ChatMessage','include','findAll','rows','show','params','keys','find'];(function(_0x2fd5e4,_0x1f80a2){var _0x1d9d38=function(_0x1fe481){while(--_0x1fe481){_0x2fd5e4['push'](_0x2fd5e4['shift']());}};_0x1d9d38(++_0x1f80a2);}(_0x0a63,0xb5));var _0x30a6=function(_0x5c49b4,_0x4d1512){_0x5c49b4=_0x5c49b4-0x0;var _0x54113d=_0x0a63[_0x5c49b4];return _0x54113d;};'use strict';var emlformat=require(_0x30a6('0x0'));var rimraf=require(_0x30a6('0x1'));var zipdir=require(_0x30a6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x30a6('0x3'));var moment=require('moment');var BPromise=require(_0x30a6('0x4'));var Mustache=require(_0x30a6('0x5'));var util=require(_0x30a6('0x6'));var path=require(_0x30a6('0x7'));var sox=require(_0x30a6('0x8'));var csv=require(_0x30a6('0x9'));var ejs=require(_0x30a6('0xa'));var fs=require('fs');var fs_extra=require(_0x30a6('0xb'));var _=require(_0x30a6('0xc'));var squel=require(_0x30a6('0xd'));var crypto=require('crypto');var jsforce=require(_0x30a6('0xe'));var deskjs=require(_0x30a6('0xf'));var toCsv=require(_0x30a6('0x9'));var querystring=require(_0x30a6('0x10'));var Papa=require('papaparse');var Redis=require(_0x30a6('0x11'));var authService=require(_0x30a6('0x12'));var qs=require(_0x30a6('0x13'));var as=require(_0x30a6('0x14'));var hardwareService=require(_0x30a6('0x15'));var logger=require(_0x30a6('0x16'))(_0x30a6('0x17'));var utils=require(_0x30a6('0x18'));var config=require(_0x30a6('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x30a6('0x1a'))['db'];config['redis']=_[_0x30a6('0x1b')](config[_0x30a6('0x1c')],{'host':_0x30a6('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x30a6('0x1e'))['register'](socket);var jayson=require(_0x30a6('0x1f'));var client=jayson[_0x30a6('0x20')]['http']({'port':0x232c});var client9002=jayson['client'][_0x30a6('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x53da8c,_0x253daa,_0x341865,_0x2b8e5c){return new BPromise(function(_0x3941b5,_0x4b5df5){var _0x433b27=_0x2b8e5c||client;return _0x433b27['request'](_0x53da8c,_0x341865)[_0x30a6('0x22')](function(_0x471583){logger[_0x30a6('0x23')]('ChatMessage,\x20%s,\x20%s',_0x253daa,_0x30a6('0x24'));logger[_0x30a6('0x25')](_0x30a6('0x26'),_0x253daa,'request\x20sent',JSON['stringify'](_0x471583));if(_0x471583[_0x30a6('0x27')]){if(_0x471583[_0x30a6('0x27')][_0x30a6('0x28')]===0x1f4){logger[_0x30a6('0x27')]('ChatMessage,\x20%s,\x20%s',_0x253daa,_0x471583['error'][_0x30a6('0x29')]);return _0x4b5df5(_0x471583['error'][_0x30a6('0x29')]);}logger[_0x30a6('0x27')](_0x30a6('0x2a'),_0x253daa,_0x471583[_0x30a6('0x27')]['message']);return _0x3941b5(_0x471583[_0x30a6('0x27')]['message']);}else{logger[_0x30a6('0x23')](_0x30a6('0x2a'),_0x253daa,'request\x20sent');_0x3941b5(_0x471583[_0x30a6('0x2b')][_0x30a6('0x29')]);}})[_0x30a6('0x2c')](function(_0x2d9889){logger[_0x30a6('0x27')](_0x30a6('0x2a'),_0x253daa,_0x2d9889);_0x4b5df5(_0x2d9889);});});}function respondWithStatusCode(_0x48aee6,_0xf5640b){_0xf5640b=_0xf5640b||0xcc;return function(_0x1beb7e){if(_0x1beb7e){return _0x48aee6[_0x30a6('0x2d')](_0xf5640b);}return _0x48aee6[_0x30a6('0x2e')](_0xf5640b)['end']();};}function respondWithResult(_0x49e7a7,_0x313d92){_0x313d92=_0x313d92||0xc8;return function(_0x113934){if(_0x113934){return _0x49e7a7[_0x30a6('0x2e')](_0x313d92)['json'](_0x113934);}};}function respondWithFilteredResult(_0x4a3053,_0xe08c88){return function(_0x68fd68){if(_0x68fd68){var _0x535ee0=typeof _0xe08c88[_0x30a6('0x2f')]===_0x30a6('0x30')&&typeof _0xe08c88['limit']===_0x30a6('0x30');var _0x2f9092=_0x68fd68[_0x30a6('0x31')];var _0x8599e7=_0x535ee0?0x0:_0xe08c88[_0x30a6('0x2f')];var _0xe04b23=_0x535ee0?_0x68fd68[_0x30a6('0x31')]:_0xe08c88[_0x30a6('0x2f')]+_0xe08c88[_0x30a6('0x32')];var _0x1b82ae;if(_0xe04b23>=_0x2f9092){_0xe04b23=_0x2f9092;_0x1b82ae=0xc8;}else{_0x1b82ae=0xce;}_0x4a3053['status'](_0x1b82ae);return _0x4a3053[_0x30a6('0x33')](_0x30a6('0x34'),_0x8599e7+'-'+_0xe04b23+'/'+_0x2f9092)['json'](_0x68fd68);}return null;};}function patchUpdates(_0x2d8fcd){return function(_0x1000b4){try{jsonpatch[_0x30a6('0x35')](_0x1000b4,_0x2d8fcd,!![]);}catch(_0x149e85){return BPromise[_0x30a6('0x36')](_0x149e85);}return _0x1000b4['save']();};}function saveUpdates(_0x41a4bf,_0x5b331d){return function(_0x2c54a9){if(_0x2c54a9){return _0x2c54a9['update'](_0x41a4bf)[_0x30a6('0x22')](function(_0x59f7fd){return _0x59f7fd;});}return null;};}function removeEntity(_0x1e0526,_0x25c3ee){return function(_0x4c810d){if(_0x4c810d){return _0x4c810d['destroy']()[_0x30a6('0x22')](function(){_0x1e0526[_0x30a6('0x2e')](0xcc)[_0x30a6('0x37')]();});}};}function handleEntityNotFound(_0x1841e1,_0x783e8){return function(_0x5016ca){if(!_0x5016ca){_0x1841e1['sendStatus'](0x194);}return _0x5016ca;};}function handleError(_0x17784e,_0x55fff1){_0x55fff1=_0x55fff1||0x1f4;return function(_0x592693){logger[_0x30a6('0x27')](_0x592693[_0x30a6('0x38')]);if(_0x592693[_0x30a6('0x39')]){delete _0x592693[_0x30a6('0x39')];}_0x17784e['status'](_0x55fff1)[_0x30a6('0x3a')](_0x592693);};}exports[_0x30a6('0x3b')]=function(_0x224e4d,_0x1ef7ac){var _0x9a5167={},_0xc4394f={},_0x49952a={'count':0x0,'rows':[]};var _0x67ccbd=_[_0x30a6('0x3c')](db['ChatMessage'][_0x30a6('0x3d')],function(_0x272acb){return{'name':_0x272acb['fieldName'],'type':_0x272acb['type'][_0x30a6('0x3e')]};});_0xc4394f[_0x30a6('0x3f')]=_[_0x30a6('0x3c')](_0x67ccbd,'name');_0xc4394f[_0x30a6('0x40')]=_['keys'](_0x224e4d['query']);_0xc4394f[_0x30a6('0x41')]=_[_0x30a6('0x42')](_0xc4394f[_0x30a6('0x3f')],_0xc4394f[_0x30a6('0x40')]);_0x9a5167[_0x30a6('0x43')]=_['intersection'](_0xc4394f[_0x30a6('0x3f')],qs[_0x30a6('0x44')](_0x224e4d[_0x30a6('0x40')][_0x30a6('0x44')]));_0x9a5167['attributes']=_0x9a5167[_0x30a6('0x43')][_0x30a6('0x45')]?_0x9a5167[_0x30a6('0x43')]:_0xc4394f[_0x30a6('0x3f')];if(!_0x224e4d['query'][_0x30a6('0x46')](_0x30a6('0x47'))){_0x9a5167[_0x30a6('0x32')]=qs[_0x30a6('0x32')](_0x224e4d['query'][_0x30a6('0x32')]);_0x9a5167['offset']=qs['offset'](_0x224e4d[_0x30a6('0x40')][_0x30a6('0x2f')]);}_0x9a5167[_0x30a6('0x48')]=qs[_0x30a6('0x49')](_0x224e4d[_0x30a6('0x40')]['sort']);_0x9a5167[_0x30a6('0x4a')]=qs[_0x30a6('0x41')](_[_0x30a6('0x4b')](_0x224e4d[_0x30a6('0x40')],_0xc4394f['filters']),_0x67ccbd);if(_0x224e4d[_0x30a6('0x40')]['filter']){_0x9a5167[_0x30a6('0x4a')]=_[_0x30a6('0x4c')](_0x9a5167[_0x30a6('0x4a')],{'$or':_['map'](_0x67ccbd,function(_0x167af4){if(_0x167af4[_0x30a6('0x4d')]!==_0x30a6('0x4e')){var _0x2318e6={};_0x2318e6[_0x167af4['name']]={'$like':'%'+_0x224e4d['query'][_0x30a6('0x4f')]+'%'};return _0x2318e6;}})});}_0x9a5167=_[_0x30a6('0x4c')]({},_0x9a5167,_0x224e4d[_0x30a6('0x50')]);var _0xeacced={'where':_0x9a5167[_0x30a6('0x4a')]};return db[_0x30a6('0x51')][_0x30a6('0x31')](_0xeacced)[_0x30a6('0x22')](function(_0x1332a1){_0x49952a[_0x30a6('0x31')]=_0x1332a1;if(_0x224e4d[_0x30a6('0x40')]['includeAll']){_0x9a5167[_0x30a6('0x52')]=[{'all':!![]}];}return db[_0x30a6('0x51')][_0x30a6('0x53')](_0x9a5167);})[_0x30a6('0x22')](function(_0x2a8bca){_0x49952a[_0x30a6('0x54')]=_0x2a8bca;return _0x49952a;})[_0x30a6('0x22')](respondWithFilteredResult(_0x1ef7ac,_0x9a5167))[_0x30a6('0x2c')](handleError(_0x1ef7ac,null));};exports[_0x30a6('0x55')]=function(_0x13ae56,_0x4aaa67){var _0x19ba56={'raw':!![],'where':{'id':_0x13ae56[_0x30a6('0x56')]['id']}},_0x229ea0={};_0x229ea0[_0x30a6('0x3f')]=_[_0x30a6('0x57')](db[_0x30a6('0x51')][_0x30a6('0x3d')]);_0x229ea0[_0x30a6('0x40')]=_[_0x30a6('0x57')](_0x13ae56['query']);_0x229ea0[_0x30a6('0x41')]=_[_0x30a6('0x42')](_0x229ea0[_0x30a6('0x3f')],_0x229ea0[_0x30a6('0x40')]);_0x19ba56[_0x30a6('0x43')]=_[_0x30a6('0x42')](_0x229ea0['model'],qs[_0x30a6('0x44')](_0x13ae56[_0x30a6('0x40')]['fields']));_0x19ba56[_0x30a6('0x43')]=_0x19ba56[_0x30a6('0x43')][_0x30a6('0x45')]?_0x19ba56[_0x30a6('0x43')]:_0x229ea0[_0x30a6('0x3f')];if(_0x13ae56[_0x30a6('0x40')]['includeAll']){_0x19ba56[_0x30a6('0x52')]=[{'all':!![]}];}_0x19ba56=_['merge']({},_0x19ba56,_0x13ae56[_0x30a6('0x50')]);return db[_0x30a6('0x51')][_0x30a6('0x58')](_0x19ba56)[_0x30a6('0x22')](handleEntityNotFound(_0x4aaa67,null))['then'](respondWithResult(_0x4aaa67,null))[_0x30a6('0x2c')](handleError(_0x4aaa67,null));};exports[_0x30a6('0x59')]=function(_0x258214,_0x2abc17){return db[_0x30a6('0x51')][_0x30a6('0x59')](_0x258214[_0x30a6('0x5a')],{})[_0x30a6('0x22')](respondWithResult(_0x2abc17,0xc9))['catch'](handleError(_0x2abc17,null));};exports[_0x30a6('0x5b')]=function(_0x38caf3,_0x5c5c57){if(_0x38caf3[_0x30a6('0x5a')]['id']){delete _0x38caf3[_0x30a6('0x5a')]['id'];}return db['ChatMessage'][_0x30a6('0x58')]({'where':{'id':_0x38caf3[_0x30a6('0x56')]['id']}})[_0x30a6('0x22')](handleEntityNotFound(_0x5c5c57,null))[_0x30a6('0x22')](saveUpdates(_0x38caf3[_0x30a6('0x5a')],null))[_0x30a6('0x22')](respondWithResult(_0x5c5c57,null))[_0x30a6('0x2c')](handleError(_0x5c5c57,null));};exports[_0x30a6('0x5c')]=function(_0x323008,_0x470c78){return db['ChatMessage'][_0x30a6('0x58')]({'where':{'id':_0x323008[_0x30a6('0x56')]['id']}})[_0x30a6('0x22')](handleEntityNotFound(_0x470c78,null))['then'](removeEntity(_0x470c78,null))['catch'](handleError(_0x470c78,null));};exports[_0x30a6('0x5d')]=function(_0x919297,_0x2d3c2d){return db[_0x30a6('0x51')][_0x30a6('0x5d')]()[_0x30a6('0x22')](respondWithResult(_0x2d3c2d,null))[_0x30a6('0x2c')](handleError(_0x2d3c2d,null));};var interaction_log=require(_0x30a6('0x16'))(_0x30a6('0x5e'));exports[_0x30a6('0x5f')]=function(_0x359074,_0x1c35c6,_0x583527){var _0x1020ed={'agent':{},'channel':_0x30a6('0x60')};if(_0x359074[_0x30a6('0x5a')]['id']){delete _0x359074[_0x30a6('0x5a')]['id'];}_0x359074[_0x30a6('0x5a')][_0x30a6('0x61')]=!![];_0x359074[_0x30a6('0x5a')]['readAt']=moment()[_0x30a6('0x62')]('YYYY-MM-DD\x20HH:mm:ss');_0x359074[_0x30a6('0x5a')][_0x30a6('0x63')]=_0x359074['body']['UserId']||_0x359074[_0x30a6('0x64')]['id'];_0x1020ed[_0x30a6('0x65')]['id']=_0x359074['body'][_0x30a6('0x63')];return db['ChatMessage']['find']({'where':{'id':_0x359074[_0x30a6('0x56')]['id'],'UserId':null}})[_0x30a6('0x22')](handleEntityNotFound(_0x1c35c6,null))[_0x30a6('0x22')](saveUpdates(_0x359074[_0x30a6('0x5a')],null))[_0x30a6('0x22')](function(_0x19e6c5){if(_0x19e6c5){_0x1020ed[_0x30a6('0x29')]=_0x19e6c5[_0x30a6('0x66')]({'plain':!![]});return db[_0x30a6('0x67')][_0x30a6('0x58')]({'where':{'id':_0x19e6c5['ChatInteractionId']}});}return null;})[_0x30a6('0x22')](handleEntityNotFound(_0x1c35c6,null))['then'](function(_0xa7fc91){if(_0xa7fc91){return _0xa7fc91[_0x30a6('0x5b')]({'UserId':_0x359074[_0x30a6('0x5a')][_0x30a6('0x63')],'read1stAt':_[_0x30a6('0x68')](_0xa7fc91[_0x30a6('0x69')])?moment()[_0x30a6('0x62')](_0x30a6('0x6a')):undefined});}return null;})[_0x30a6('0x22')](function(_0x60db73){if(_0x60db73){_0x1020ed[_0x30a6('0x6b')]=_0x60db73[_0x30a6('0x66')]({'plain':!![]});interaction_log[_0x30a6('0x23')](_0x30a6('0x6c'),_0x359074[_0x30a6('0x64')]['id'],_0x359074['user'][_0x30a6('0x39')],_0x359074[_0x30a6('0x64')][_0x30a6('0x6d')],_0x1020ed[_0x30a6('0x6b')]['id'],_0x359074[_0x30a6('0x5a')]?JSON['stringify'](_0x359074[_0x30a6('0x5a')]):_0x30a6('0x6e'));return respondWithRpcPromise('AcceptMessage',_0x30a6('0x6f'),_0x1020ed);}return null;})['then'](function(_0xdff0a9){var _0x381150=_0x30a6('0x70')+_0xdff0a9[_0x30a6('0x29')]['ContactId'];return db[_0x30a6('0x71')][_0x30a6('0x40')](_0x381150,{'type':db['Sequelize']['QueryTypes'][_0x30a6('0x72')],'raw':!![]})[_0x30a6('0x22')](function(_0x2868b0){return _0x2868b0;});})[_0x30a6('0x22')](function(_0x24689f){if(_0x24689f){_0x1020ed[_0x30a6('0x29')][_0x30a6('0x73')]=_0x24689f[0x0];if(!_0x359074[_0x30a6('0x5a')][_0x30a6('0x63')])return;return db[_0x30a6('0x74')][_0x30a6('0x58')]({'where':{'id':_0x359074['body'][_0x30a6('0x63')],'role':_0x30a6('0x65')},'attributes':['id',_0x30a6('0x39'),_0x30a6('0x75'),_0x30a6('0x76'),'internal'],'raw':!![]});}return null;})['then'](function(_0x504a81){if(!_0x504a81)return null;_0x1020ed[_0x30a6('0x29')]['agent']=_0x504a81;return _0x1020ed;})['then'](function(_0x4f94cb){if(_0x4f94cb){if(_0x359074['body'][_0x30a6('0x77')]){_0x1020ed['message']['interface']=util[_0x30a6('0x62')](_0x30a6('0x78'),_0x359074[_0x30a6('0x64')][_0x30a6('0x39')]);_0x1020ed[_0x30a6('0x29')][_0x30a6('0x79')]=_0x1020ed['channel'];_0x1020ed[_0x30a6('0x29')][_0x30a6('0x7a')]=_0x1020ed[_0x30a6('0x79')];_0x1020ed[_0x30a6('0x29')]['event']=_0x30a6('0x5f');return respondWithRpcPromise('EventManager',_0x30a6('0x7b'),{'event':'acceptmessage','message':_['merge'](_0x1020ed['message'],JSON[_0x30a6('0x7c')](_0x1020ed[_0x30a6('0x6b')][_0x30a6('0x7d')]))},client9002)[_0x30a6('0x22')](function(){return _0x1020ed;});}return _0x1020ed;}return null;})[_0x30a6('0x22')](respondWithResult(_0x1c35c6,null))[_0x30a6('0x2c')](handleError(_0x1c35c6,null));};var interaction_log=require('../../config/logger')(_0x30a6('0x5e'));exports['reject']=function(_0x367a03,_0x26888a,_0x124a82){var _0x4599f4={'agent':{},'channel':_0x30a6('0x60')};if(_0x367a03['body']['id']){delete _0x367a03[_0x30a6('0x5a')]['id'];}_0x367a03[_0x30a6('0x5a')]['UserId']=_0x367a03['body'][_0x30a6('0x63')]||_0x367a03[_0x30a6('0x64')]['id'];_0x4599f4[_0x30a6('0x65')]['id']=_0x367a03[_0x30a6('0x5a')]['UserId'];return db[_0x30a6('0x51')]['find']({'where':{'id':_0x367a03[_0x30a6('0x56')]['id'],'UserId':null}})[_0x30a6('0x22')](handleEntityNotFound(_0x26888a,null))['then'](function(_0x48cd4f){if(_0x48cd4f){_0x4599f4[_0x30a6('0x29')]=_0x48cd4f[_0x30a6('0x66')]({'plain':!![]});return db[_0x30a6('0x67')][_0x30a6('0x58')]({'where':{'id':_0x48cd4f[_0x30a6('0x7e')]}});}return null;})[_0x30a6('0x22')](handleEntityNotFound(_0x26888a,null))[_0x30a6('0x22')](function(_0x53aa02){if(_0x53aa02){_0x4599f4[_0x30a6('0x6b')]=_0x53aa02[_0x30a6('0x66')]({'plain':!![]});interaction_log[_0x30a6('0x23')](_0x30a6('0x7f'),_0x367a03['user']['id'],_0x367a03[_0x30a6('0x64')][_0x30a6('0x39')],_0x367a03['user'][_0x30a6('0x6d')],_0x4599f4[_0x30a6('0x6b')]['id'],_0x367a03[_0x30a6('0x5a')]?JSON['stringify'](_0x367a03[_0x30a6('0x5a')]):_0x30a6('0x6e'));return respondWithRpcPromise(_0x30a6('0x80'),'rejectMessage',_0x4599f4);}return null;})['then'](function(_0x4be72a){var _0x291b66=_0x30a6('0x70')+_0x4be72a['message'][_0x30a6('0x81')];return db['sequelize'][_0x30a6('0x40')](_0x291b66,{'type':db['Sequelize'][_0x30a6('0x82')][_0x30a6('0x72')],'raw':!![]})[_0x30a6('0x22')](function(_0x197df9){return _0x197df9;});})['then'](function(_0x31753e){if(_0x31753e){_0x4599f4['message'][_0x30a6('0x73')]=_0x31753e[0x0];if(!_0x367a03['body'][_0x30a6('0x63')])return;return db['User'][_0x30a6('0x58')]({'where':{'id':_0x367a03[_0x30a6('0x5a')][_0x30a6('0x63')],'role':'agent'},'attributes':['id','name','fullname',_0x30a6('0x76'),_0x30a6('0x83')],'raw':!![]});}return null;})[_0x30a6('0x22')](function(_0x1b7757){if(!_0x1b7757)return null;_0x4599f4[_0x30a6('0x29')][_0x30a6('0x65')]=_0x1b7757;return _0x4599f4;})[_0x30a6('0x22')](function(_0x2cbad5){if(_0x2cbad5){_0x2cbad5[_0x30a6('0x29')][_0x30a6('0x84')]=util[_0x30a6('0x62')]('SIP/%s',_0x367a03['user'][_0x30a6('0x39')]);_0x2cbad5[_0x30a6('0x29')][_0x30a6('0x79')]=_0x4599f4['channel'];_0x2cbad5['message']['motionChannel']=_0x4599f4['channel'];_0x2cbad5[_0x30a6('0x29')][_0x30a6('0x85')]=_0x30a6('0x36');respondWithRpcPromise(_0x30a6('0x7b'),_0x30a6('0x7b'),{'event':_0x30a6('0x86'),'message':_[_0x30a6('0x4c')](_0x4599f4[_0x30a6('0x29')],JSON['parse'](_0x4599f4[_0x30a6('0x6b')][_0x30a6('0x7d')]))},client9002);return _0x4599f4;}return null;})[_0x30a6('0x22')](respondWithResult(_0x26888a,null))['catch'](handleError(_0x26888a,null));}; \ No newline at end of file +var _0x3311=['SELECT','User','fullname','internal','manual','interface','SIP/%s','channel','event','accept','EventManager','acceptmessage','formData','chat-interactions','reject','chat','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','interaction','null','RejectMessage','rejectMessage','contact','email','motionChannel','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','end','json','offset','undefined','limit','count','Content-Range','apply','update','destroy','sendStatus','name','send','index','map','ChatMessage','fieldName','type','key','model','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','keys','rawAttributes','intersection','find','catch','create','body','params','describe','../../config/logger','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','isNil','read1stAt','role','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x3311,0x12c));var _0x1331=function(_0x557e88,_0x52423b){_0x557e88=_0x557e88-0x0;var _0x55ae36=_0x3311[_0x557e88];return _0x55ae36;};'use strict';var emlformat=require(_0x1331('0x0'));var rimraf=require(_0x1331('0x1'));var zipdir=require(_0x1331('0x2'));var jsonpatch=require(_0x1331('0x3'));var rp=require(_0x1331('0x4'));var moment=require(_0x1331('0x5'));var BPromise=require(_0x1331('0x6'));var Mustache=require(_0x1331('0x7'));var util=require(_0x1331('0x8'));var path=require(_0x1331('0x9'));var sox=require('sox');var csv=require(_0x1331('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1331('0xb'));var _=require(_0x1331('0xc'));var squel=require(_0x1331('0xd'));var crypto=require(_0x1331('0xe'));var jsforce=require(_0x1331('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x1331('0x10'));var Papa=require(_0x1331('0x11'));var Redis=require(_0x1331('0x12'));var authService=require(_0x1331('0x13'));var qs=require(_0x1331('0x14'));var as=require(_0x1331('0x15'));var hardwareService=require(_0x1331('0x16'));var logger=require('../../config/logger')(_0x1331('0x17'));var utils=require('../../config/utils');var config=require(_0x1331('0x18'));var licenseUtil=require(_0x1331('0x19'));var db=require(_0x1331('0x1a'))['db'];config[_0x1331('0x1b')]=_[_0x1331('0x1c')](config['redis'],{'host':_0x1331('0x1d'),'port':0x18eb});var socket=require(_0x1331('0x1e'))(new Redis(config['redis']));require('./chatMessage.socket')[_0x1331('0x1f')](socket);var jayson=require(_0x1331('0x20'));var client=jayson[_0x1331('0x21')][_0x1331('0x22')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x6ceb26,_0x3db63d,_0x4beabd,_0x329b73){return new BPromise(function(_0x1e3792,_0x56effb){var _0x241dfc=_0x329b73||client;return _0x241dfc[_0x1331('0x23')](_0x6ceb26,_0x4beabd)[_0x1331('0x24')](function(_0x41c016){logger[_0x1331('0x25')](_0x1331('0x26'),_0x3db63d,_0x1331('0x27'));logger[_0x1331('0x28')](_0x1331('0x29'),_0x3db63d,_0x1331('0x27'),JSON[_0x1331('0x2a')](_0x41c016));if(_0x41c016[_0x1331('0x2b')]){if(_0x41c016['error'][_0x1331('0x2c')]===0x1f4){logger[_0x1331('0x2b')](_0x1331('0x26'),_0x3db63d,_0x41c016[_0x1331('0x2b')][_0x1331('0x2d')]);return _0x56effb(_0x41c016['error'][_0x1331('0x2d')]);}logger[_0x1331('0x2b')]('ChatMessage,\x20%s,\x20%s',_0x3db63d,_0x41c016[_0x1331('0x2b')][_0x1331('0x2d')]);return _0x1e3792(_0x41c016[_0x1331('0x2b')][_0x1331('0x2d')]);}else{logger[_0x1331('0x25')](_0x1331('0x26'),_0x3db63d,_0x1331('0x27'));_0x1e3792(_0x41c016[_0x1331('0x2e')][_0x1331('0x2d')]);}})['catch'](function(_0x5ecd1b){logger[_0x1331('0x2b')](_0x1331('0x26'),_0x3db63d,_0x5ecd1b);_0x56effb(_0x5ecd1b);});});}function respondWithStatusCode(_0x50ff11,_0xf35ae8){_0xf35ae8=_0xf35ae8||0xcc;return function(_0x3908cb){if(_0x3908cb){return _0x50ff11['sendStatus'](_0xf35ae8);}return _0x50ff11[_0x1331('0x2f')](_0xf35ae8)[_0x1331('0x30')]();};}function respondWithResult(_0x305d3b,_0x32117d){_0x32117d=_0x32117d||0xc8;return function(_0x5b56ea){if(_0x5b56ea){return _0x305d3b[_0x1331('0x2f')](_0x32117d)[_0x1331('0x31')](_0x5b56ea);}};}function respondWithFilteredResult(_0x2d7cbd,_0x690c9c){return function(_0x27ee85){if(_0x27ee85){var _0x49dbbf=typeof _0x690c9c[_0x1331('0x32')]===_0x1331('0x33')&&typeof _0x690c9c[_0x1331('0x34')]===_0x1331('0x33');var _0x1558dd=_0x27ee85['count'];var _0x13fc4e=_0x49dbbf?0x0:_0x690c9c[_0x1331('0x32')];var _0x4f4cbf=_0x49dbbf?_0x27ee85[_0x1331('0x35')]:_0x690c9c[_0x1331('0x32')]+_0x690c9c[_0x1331('0x34')];var _0x440e86;if(_0x4f4cbf>=_0x1558dd){_0x4f4cbf=_0x1558dd;_0x440e86=0xc8;}else{_0x440e86=0xce;}_0x2d7cbd[_0x1331('0x2f')](_0x440e86);return _0x2d7cbd['set'](_0x1331('0x36'),_0x13fc4e+'-'+_0x4f4cbf+'/'+_0x1558dd)[_0x1331('0x31')](_0x27ee85);}return null;};}function patchUpdates(_0x454e95){return function(_0xf7d7f0){try{jsonpatch[_0x1331('0x37')](_0xf7d7f0,_0x454e95,!![]);}catch(_0x29228a){return BPromise['reject'](_0x29228a);}return _0xf7d7f0['save']();};}function saveUpdates(_0x1588d2,_0xf0e19b){return function(_0x1388d3){if(_0x1388d3){return _0x1388d3[_0x1331('0x38')](_0x1588d2)[_0x1331('0x24')](function(_0x322944){return _0x322944;});}return null;};}function removeEntity(_0x12cb06,_0x5e3fd4){return function(_0x5af617){if(_0x5af617){return _0x5af617[_0x1331('0x39')]()['then'](function(){_0x12cb06[_0x1331('0x2f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x478026,_0x2b5e6c){return function(_0x2c083a){if(!_0x2c083a){_0x478026[_0x1331('0x3a')](0x194);}return _0x2c083a;};}function handleError(_0x5e9e54,_0x1972d0){_0x1972d0=_0x1972d0||0x1f4;return function(_0x2a3d80){logger[_0x1331('0x2b')](_0x2a3d80['stack']);if(_0x2a3d80[_0x1331('0x3b')]){delete _0x2a3d80['name'];}_0x5e9e54['status'](_0x1972d0)[_0x1331('0x3c')](_0x2a3d80);};}exports[_0x1331('0x3d')]=function(_0x19fa9a,_0x2d2272){var _0x11eaab={},_0x4f1311={},_0x41a02e={'count':0x0,'rows':[]};var _0x377663=_[_0x1331('0x3e')](db[_0x1331('0x3f')]['rawAttributes'],function(_0x1212c4){return{'name':_0x1212c4[_0x1331('0x40')],'type':_0x1212c4[_0x1331('0x41')][_0x1331('0x42')]};});_0x4f1311[_0x1331('0x43')]=_['map'](_0x377663,_0x1331('0x3b'));_0x4f1311['query']=_['keys'](_0x19fa9a[_0x1331('0x44')]);_0x4f1311['filters']=_['intersection'](_0x4f1311[_0x1331('0x43')],_0x4f1311[_0x1331('0x44')]);_0x11eaab[_0x1331('0x45')]=_['intersection'](_0x4f1311[_0x1331('0x43')],qs[_0x1331('0x46')](_0x19fa9a[_0x1331('0x44')][_0x1331('0x46')]));_0x11eaab['attributes']=_0x11eaab[_0x1331('0x45')]['length']?_0x11eaab[_0x1331('0x45')]:_0x4f1311['model'];if(!_0x19fa9a[_0x1331('0x44')][_0x1331('0x47')](_0x1331('0x48'))){_0x11eaab[_0x1331('0x34')]=qs['limit'](_0x19fa9a['query'][_0x1331('0x34')]);_0x11eaab[_0x1331('0x32')]=qs['offset'](_0x19fa9a[_0x1331('0x44')][_0x1331('0x32')]);}_0x11eaab[_0x1331('0x49')]=qs[_0x1331('0x4a')](_0x19fa9a[_0x1331('0x44')][_0x1331('0x4a')]);_0x11eaab[_0x1331('0x4b')]=qs[_0x1331('0x4c')](_['pick'](_0x19fa9a['query'],_0x4f1311[_0x1331('0x4c')]),_0x377663);if(_0x19fa9a[_0x1331('0x44')][_0x1331('0x4d')]){_0x11eaab['where']=_[_0x1331('0x4e')](_0x11eaab[_0x1331('0x4b')],{'$or':_['map'](_0x377663,function(_0x1c76f8){if(_0x1c76f8[_0x1331('0x41')]!==_0x1331('0x4f')){var _0x6b152b={};_0x6b152b[_0x1c76f8[_0x1331('0x3b')]]={'$like':'%'+_0x19fa9a[_0x1331('0x44')][_0x1331('0x4d')]+'%'};return _0x6b152b;}})});}_0x11eaab=_['merge']({},_0x11eaab,_0x19fa9a[_0x1331('0x50')]);var _0x5d17b7={'where':_0x11eaab[_0x1331('0x4b')]};return db['ChatMessage'][_0x1331('0x35')](_0x5d17b7)[_0x1331('0x24')](function(_0xb13f13){_0x41a02e[_0x1331('0x35')]=_0xb13f13;if(_0x19fa9a['query'][_0x1331('0x51')]){_0x11eaab[_0x1331('0x52')]=[{'all':!![]}];}return db[_0x1331('0x3f')]['findAll'](_0x11eaab);})[_0x1331('0x24')](function(_0x30dd47){_0x41a02e['rows']=_0x30dd47;return _0x41a02e;})[_0x1331('0x24')](respondWithFilteredResult(_0x2d2272,_0x11eaab))['catch'](handleError(_0x2d2272,null));};exports['show']=function(_0x4e9d81,_0x431fae){var _0x23db12={'raw':!![],'where':{'id':_0x4e9d81['params']['id']}},_0x2c8f03={};_0x2c8f03['model']=_[_0x1331('0x53')](db[_0x1331('0x3f')][_0x1331('0x54')]);_0x2c8f03[_0x1331('0x44')]=_['keys'](_0x4e9d81[_0x1331('0x44')]);_0x2c8f03[_0x1331('0x4c')]=_[_0x1331('0x55')](_0x2c8f03[_0x1331('0x43')],_0x2c8f03['query']);_0x23db12[_0x1331('0x45')]=_[_0x1331('0x55')](_0x2c8f03[_0x1331('0x43')],qs[_0x1331('0x46')](_0x4e9d81['query'][_0x1331('0x46')]));_0x23db12[_0x1331('0x45')]=_0x23db12[_0x1331('0x45')]['length']?_0x23db12[_0x1331('0x45')]:_0x2c8f03[_0x1331('0x43')];if(_0x4e9d81[_0x1331('0x44')][_0x1331('0x51')]){_0x23db12[_0x1331('0x52')]=[{'all':!![]}];}_0x23db12=_[_0x1331('0x4e')]({},_0x23db12,_0x4e9d81[_0x1331('0x50')]);return db['ChatMessage'][_0x1331('0x56')](_0x23db12)[_0x1331('0x24')](handleEntityNotFound(_0x431fae,null))[_0x1331('0x24')](respondWithResult(_0x431fae,null))[_0x1331('0x57')](handleError(_0x431fae,null));};exports[_0x1331('0x58')]=function(_0x3365e7,_0x190288){return db[_0x1331('0x3f')][_0x1331('0x58')](_0x3365e7[_0x1331('0x59')],{})[_0x1331('0x24')](respondWithResult(_0x190288,0xc9))['catch'](handleError(_0x190288,null));};exports[_0x1331('0x38')]=function(_0x333b4c,_0x4dd70d){if(_0x333b4c[_0x1331('0x59')]['id']){delete _0x333b4c['body']['id'];}return db[_0x1331('0x3f')][_0x1331('0x56')]({'where':{'id':_0x333b4c[_0x1331('0x5a')]['id']}})[_0x1331('0x24')](handleEntityNotFound(_0x4dd70d,null))[_0x1331('0x24')](saveUpdates(_0x333b4c[_0x1331('0x59')],null))['then'](respondWithResult(_0x4dd70d,null))[_0x1331('0x57')](handleError(_0x4dd70d,null));};exports[_0x1331('0x39')]=function(_0x4dc689,_0x299c08){return db[_0x1331('0x3f')]['find']({'where':{'id':_0x4dc689[_0x1331('0x5a')]['id']}})[_0x1331('0x24')](handleEntityNotFound(_0x299c08,null))['then'](removeEntity(_0x299c08,null))['catch'](handleError(_0x299c08,null));};exports['describe']=function(_0x150581,_0x5eb7ce){return db[_0x1331('0x3f')][_0x1331('0x5b')]()[_0x1331('0x24')](respondWithResult(_0x5eb7ce,null))[_0x1331('0x57')](handleError(_0x5eb7ce,null));};var interaction_log=require(_0x1331('0x5c'))('chat-interactions');exports['accept']=function(_0x43fb66,_0xb03fbb,_0x40b638){var _0x1ab6a4={'agent':{},'channel':'chat'};if(_0x43fb66[_0x1331('0x59')]['id']){delete _0x43fb66[_0x1331('0x59')]['id'];}_0x43fb66[_0x1331('0x59')][_0x1331('0x5d')]=!![];_0x43fb66['body'][_0x1331('0x5e')]=moment()[_0x1331('0x5f')](_0x1331('0x60'));_0x43fb66['body'][_0x1331('0x61')]=_0x43fb66[_0x1331('0x59')][_0x1331('0x61')]||_0x43fb66[_0x1331('0x62')]['id'];_0x1ab6a4[_0x1331('0x63')]['id']=_0x43fb66[_0x1331('0x59')][_0x1331('0x61')];return db['ChatMessage'][_0x1331('0x56')]({'where':{'id':_0x43fb66[_0x1331('0x5a')]['id'],'UserId':null}})[_0x1331('0x24')](handleEntityNotFound(_0xb03fbb,null))['then'](saveUpdates(_0x43fb66[_0x1331('0x59')],null))[_0x1331('0x24')](function(_0xefb4d9){if(_0xefb4d9){_0x1ab6a4[_0x1331('0x2d')]=_0xefb4d9[_0x1331('0x64')]({'plain':!![]});return db[_0x1331('0x65')][_0x1331('0x56')]({'where':{'id':_0xefb4d9['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0xb03fbb,null))['then'](function(_0x29979d){if(_0x29979d){return _0x29979d['update']({'UserId':_0x43fb66['body'][_0x1331('0x61')],'read1stAt':_[_0x1331('0x66')](_0x29979d[_0x1331('0x67')])?moment()[_0x1331('0x5f')](_0x1331('0x60')):undefined});}return null;})[_0x1331('0x24')](function(_0x35a6ee){if(_0x35a6ee){_0x1ab6a4['interaction']=_0x35a6ee[_0x1331('0x64')]({'plain':!![]});interaction_log[_0x1331('0x25')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x43fb66['user']['id'],_0x43fb66['user'][_0x1331('0x3b')],_0x43fb66[_0x1331('0x62')][_0x1331('0x68')],_0x1ab6a4['interaction']['id'],_0x43fb66[_0x1331('0x59')]?JSON[_0x1331('0x2a')](_0x43fb66[_0x1331('0x59')]):'null');return respondWithRpcPromise(_0x1331('0x69'),'acceptMessage',_0x1ab6a4);}return null;})['then'](function(_0x22ddeb){var _0x2f042b=_0x1331('0x6a')+_0x22ddeb['message'][_0x1331('0x6b')];return db[_0x1331('0x6c')][_0x1331('0x44')](_0x2f042b,{'type':db[_0x1331('0x6d')][_0x1331('0x6e')][_0x1331('0x6f')],'raw':!![]})['then'](function(_0x258d65){return _0x258d65;});})[_0x1331('0x24')](function(_0x205724){if(_0x205724){_0x1ab6a4[_0x1331('0x2d')]['contact']=_0x205724[0x0];if(!_0x43fb66[_0x1331('0x59')][_0x1331('0x61')])return;return db[_0x1331('0x70')]['find']({'where':{'id':_0x43fb66[_0x1331('0x59')][_0x1331('0x61')],'role':_0x1331('0x63')},'attributes':['id',_0x1331('0x3b'),_0x1331('0x71'),'email',_0x1331('0x72')],'raw':!![]});}return null;})[_0x1331('0x24')](function(_0x470b00){if(!_0x470b00)return null;_0x1ab6a4[_0x1331('0x2d')][_0x1331('0x63')]=_0x470b00;return _0x1ab6a4;})[_0x1331('0x24')](function(_0xd96175){if(_0xd96175){if(_0x43fb66['body'][_0x1331('0x73')]){_0x1ab6a4[_0x1331('0x2d')][_0x1331('0x74')]=util[_0x1331('0x5f')](_0x1331('0x75'),_0x43fb66[_0x1331('0x62')][_0x1331('0x3b')]);_0x1ab6a4[_0x1331('0x2d')][_0x1331('0x76')]=_0x1ab6a4['channel'];_0x1ab6a4['message']['motionChannel']=_0x1ab6a4['channel'];_0x1ab6a4[_0x1331('0x2d')][_0x1331('0x77')]=_0x1331('0x78');return respondWithRpcPromise(_0x1331('0x79'),_0x1331('0x79'),{'event':_0x1331('0x7a'),'message':_[_0x1331('0x4e')](_0x1ab6a4[_0x1331('0x2d')],JSON['parse'](_0x1ab6a4['interaction'][_0x1331('0x7b')]))},client9002)['then'](function(){return _0x1ab6a4;});}return _0x1ab6a4;}return null;})[_0x1331('0x24')](respondWithResult(_0xb03fbb,null))['catch'](handleError(_0xb03fbb,null));};var interaction_log=require(_0x1331('0x5c'))(_0x1331('0x7c'));exports[_0x1331('0x7d')]=function(_0x247dc7,_0x5255ae,_0x4b91a7){var _0x3f0cc9={'agent':{},'channel':_0x1331('0x7e')};if(_0x247dc7[_0x1331('0x59')]['id']){delete _0x247dc7[_0x1331('0x59')]['id'];}_0x247dc7[_0x1331('0x59')]['UserId']=_0x247dc7[_0x1331('0x59')][_0x1331('0x61')]||_0x247dc7['user']['id'];_0x3f0cc9['agent']['id']=_0x247dc7[_0x1331('0x59')]['UserId'];return db[_0x1331('0x3f')]['find']({'where':{'id':_0x247dc7[_0x1331('0x5a')]['id'],'UserId':null}})[_0x1331('0x24')](handleEntityNotFound(_0x5255ae,null))[_0x1331('0x24')](function(_0x2a766b){if(_0x2a766b){_0x3f0cc9['message']=_0x2a766b['get']({'plain':!![]});return db[_0x1331('0x65')][_0x1331('0x56')]({'where':{'id':_0x2a766b[_0x1331('0x7f')]}});}return null;})[_0x1331('0x24')](handleEntityNotFound(_0x5255ae,null))['then'](function(_0xe46a57){if(_0xe46a57){_0x3f0cc9['interaction']=_0xe46a57[_0x1331('0x64')]({'plain':!![]});interaction_log['info'](_0x1331('0x80'),_0x247dc7[_0x1331('0x62')]['id'],_0x247dc7['user'][_0x1331('0x3b')],_0x247dc7[_0x1331('0x62')][_0x1331('0x68')],_0x3f0cc9[_0x1331('0x81')]['id'],_0x247dc7['body']?JSON['stringify'](_0x247dc7['body']):_0x1331('0x82'));return respondWithRpcPromise(_0x1331('0x83'),_0x1331('0x84'),_0x3f0cc9);}return null;})[_0x1331('0x24')](function(_0x48126e){var _0x39de17=_0x1331('0x6a')+_0x48126e[_0x1331('0x2d')]['ContactId'];return db[_0x1331('0x6c')][_0x1331('0x44')](_0x39de17,{'type':db[_0x1331('0x6d')]['QueryTypes'][_0x1331('0x6f')],'raw':!![]})[_0x1331('0x24')](function(_0xa71e7){return _0xa71e7;});})['then'](function(_0x1bec32){if(_0x1bec32){_0x3f0cc9[_0x1331('0x2d')][_0x1331('0x85')]=_0x1bec32[0x0];if(!_0x247dc7[_0x1331('0x59')]['UserId'])return;return db[_0x1331('0x70')][_0x1331('0x56')]({'where':{'id':_0x247dc7[_0x1331('0x59')][_0x1331('0x61')],'role':_0x1331('0x63')},'attributes':['id',_0x1331('0x3b'),_0x1331('0x71'),_0x1331('0x86'),_0x1331('0x72')],'raw':!![]});}return null;})['then'](function(_0x222652){if(!_0x222652)return null;_0x3f0cc9[_0x1331('0x2d')][_0x1331('0x63')]=_0x222652;return _0x3f0cc9;})[_0x1331('0x24')](function(_0x5ae7de){if(_0x5ae7de){_0x5ae7de[_0x1331('0x2d')][_0x1331('0x74')]=util[_0x1331('0x5f')]('SIP/%s',_0x247dc7['user']['name']);_0x5ae7de[_0x1331('0x2d')]['channel']=_0x3f0cc9[_0x1331('0x76')];_0x5ae7de[_0x1331('0x2d')][_0x1331('0x87')]=_0x3f0cc9[_0x1331('0x76')];_0x5ae7de[_0x1331('0x2d')][_0x1331('0x77')]=_0x1331('0x7d');respondWithRpcPromise(_0x1331('0x79'),_0x1331('0x79'),{'event':_0x1331('0x88'),'message':_[_0x1331('0x4e')](_0x3f0cc9[_0x1331('0x2d')],JSON['parse'](_0x3f0cc9['interaction']['formData']))},client9002);return _0x3f0cc9;}return null;})['then'](respondWithResult(_0x5255ae,null))[_0x1331('0x57')](handleError(_0x5255ae,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index b05a034..1c228c1 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 _0xd069=['events','../../mysqldb','setMaxListeners','save','emit','hasOwnProperty','hook','exports'];(function(_0x593190,_0x4c846c){var _0x1a62ed=function(_0x506d3c){while(--_0x506d3c){_0x593190['push'](_0x593190['shift']());}};_0x1a62ed(++_0x4c846c);}(_0xd069,0x1e8));var _0x9d06=function(_0x2a9951,_0xfd2eb3){_0x2a9951=_0x2a9951-0x0;var _0x31592c=_0xd069[_0x2a9951];return _0x31592c;};'use strict';var EventEmitter=require(_0x9d06('0x0'));var ChatMessage=require(_0x9d06('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x9d06('0x2')](0x0);var events={'afterCreate':_0x9d06('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xa48a54){return function(_0x754f45,_0x1cc8a8,_0x5836dd){ChatMessageEvents[_0x9d06('0x4')](_0xa48a54+':'+_0x754f45['id'],_0x754f45);ChatMessageEvents[_0x9d06('0x4')](_0xa48a54,_0x754f45);_0x5836dd(null);};}for(var e in events){if(events[_0x9d06('0x5')](e)){var event=events[e];ChatMessage[_0x9d06('0x6')](e,emitEvent(event));}}module[_0x9d06('0x7')]=ChatMessageEvents; \ No newline at end of file +var _0xba01=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x5ddbcc,_0x1a00e8){var _0x317e4c=function(_0x364d2b){while(--_0x364d2b){_0x5ddbcc['push'](_0x5ddbcc['shift']());}};_0x317e4c(++_0x1a00e8);}(_0xba01,0x104));var _0x1ba0=function(_0x457b9b,_0x40b09d){_0x457b9b=_0x457b9b-0x0;var _0x99a651=_0xba01[_0x457b9b];return _0x99a651;};'use strict';var EventEmitter=require(_0x1ba0('0x0'));var ChatMessage=require(_0x1ba0('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x1ba0('0x2')](0x0);var events={'afterCreate':_0x1ba0('0x3'),'afterUpdate':_0x1ba0('0x4'),'afterDestroy':_0x1ba0('0x5')};function emitEvent(_0x5af83f){return function(_0x1d31f6,_0x538f51,_0x5adfc6){ChatMessageEvents['emit'](_0x5af83f+':'+_0x1d31f6['id'],_0x1d31f6);ChatMessageEvents[_0x1ba0('0x6')](_0x5af83f,_0x1d31f6);_0x5adfc6(null);};}for(var e in events){if(events[_0x1ba0('0x7')](e)){var event=events[e];ChatMessage[_0x1ba0('0x8')](e,emitEvent(event));}}module[_0x1ba0('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 0ef77b8..253b45c 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 _0x43f3=['findOne','ChatInteractionId','update','createdAt','utf8mb4','util','bluebird','request-promise','rimraf','../../config/environment','./chatMessage.attributes','exports','ChatMessage','fti_chat_messages','body','FULLTEXT','models','direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction'];(function(_0x1c992f,_0x2adab3){var _0x1e9eb6=function(_0x321c15){while(--_0x321c15){_0x1c992f['push'](_0x1c992f['shift']());}};_0x1e9eb6(++_0x2adab3);}(_0x43f3,0x16d));var _0x343f=function(_0x1d87fc,_0x1e5321){_0x1d87fc=_0x1d87fc-0x0;var _0x492b56=_0x43f3[_0x1d87fc];return _0x492b56;};'use strict';var _=require('lodash');var util=require(_0x343f('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x343f('0x1'));var rp=require(_0x343f('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x343f('0x3'));var config=require(_0x343f('0x4'));var attributes=require(_0x343f('0x5'));module[_0x343f('0x6')]=function(_0x5e7e30,_0x4bcbf7){return _0x5e7e30['define'](_0x343f('0x7'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0x343f('0x8'),'fields':[_0x343f('0x9')],'type':_0x343f('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3bef74,_0x541771,_0x46e2e3){var _0x4e3edd=_0x5e7e30[_0x343f('0xb')];var _0xe6f334=_0x3bef74['get']({'plain':!![]});if(_0xe6f334['direction']['toLowerCase']()==='in'||_0xe6f334[_0x343f('0xc')][_0x343f('0xd')]()===_0x343f('0xe')&&!_0xe6f334[_0x343f('0xf')]&&!_[_0x343f('0x10')](_0xe6f334[_0x343f('0x11')])){_0x4e3edd[_0x343f('0x12')][_0x343f('0x13')]({'where':{'id':_0xe6f334[_0x343f('0x14')]}})['then'](function(_0x160e9e){if(_0x160e9e){_0x160e9e[_0x343f('0x15')]({'lastMsgAt':_0xe6f334[_0x343f('0x16')],'lastMsgDirection':_0xe6f334['direction'][_0x343f('0xd')]()});}})['catch'](function(_0x350504){console['error'](_0x350504);});}_0x46e2e3();}},'charset':_0x343f('0x17'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x0d0b=['rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction','ChatInteractionId','then','update','createdAt','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','path'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x0d0b,0x88));var _0xb0d0=function(_0x93704d,_0x400342){_0x93704d=_0x93704d-0x0;var _0x8f7204=_0x0d0b[_0x93704d];return _0x8f7204;};'use strict';var _=require(_0xb0d0('0x0'));var util=require(_0xb0d0('0x1'));var logger=require('../../config/logger')(_0xb0d0('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb0d0('0x3'));var rimraf=require(_0xb0d0('0x4'));var config=require(_0xb0d0('0x5'));var attributes=require(_0xb0d0('0x6'));module[_0xb0d0('0x7')]=function(_0x4aa00e,_0x1f70a7){return _0x4aa00e[_0xb0d0('0x8')](_0xb0d0('0x9'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0xb0d0('0xa'),'fields':[_0xb0d0('0xb')],'type':_0xb0d0('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4902ef,_0x589232,_0x4655ac){var _0x21f13e=_0x4aa00e[_0xb0d0('0xd')];var _0x55e86f=_0x4902ef[_0xb0d0('0xe')]({'plain':!![]});if(_0x55e86f[_0xb0d0('0xf')]['toLowerCase']()==='in'||_0x55e86f[_0xb0d0('0xf')][_0xb0d0('0x10')]()===_0xb0d0('0x11')&&!_0x55e86f[_0xb0d0('0x12')]&&!_[_0xb0d0('0x13')](_0x55e86f[_0xb0d0('0x14')])){_0x21f13e[_0xb0d0('0x15')]['findOne']({'where':{'id':_0x55e86f[_0xb0d0('0x16')]}})[_0xb0d0('0x17')](function(_0x3cc3a0){if(_0x3cc3a0){_0x3cc3a0[_0xb0d0('0x18')]({'lastMsgAt':_0x55e86f[_0xb0d0('0x19')],'lastMsgDirection':_0x55e86f[_0xb0d0('0xf')][_0xb0d0('0x10')]()});}})['catch'](function(_0x3f9281){console['error'](_0x3f9281);});}_0x4655ac();}},'charset':_0xb0d0('0x1a'),'collate':_0xb0d0('0x1b')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 10982a3..3859aa6 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 _0x66ab=['info','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','CreateChatMessage','ChatMessage','body','options','raw','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','request','then'];(function(_0x50cfc3,_0x526cc6){var _0x5c11ef=function(_0xeaf96a){while(--_0xeaf96a){_0x50cfc3['push'](_0x50cfc3['shift']());}};_0x5c11ef(++_0x526cc6);}(_0x66ab,0x128));var _0xb66a=function(_0x468238,_0x392f32){_0x468238=_0x468238-0x0;var _0x43b942=_0x66ab[_0x468238];return _0x43b942;};'use strict';var _=require(_0xb66a('0x0'));var util=require(_0xb66a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb66a('0x2'));var fs=require('fs');var Redis=require(_0xb66a('0x3'));var db=require(_0xb66a('0x4'))['db'];var utils=require(_0xb66a('0x5'));var logger=require(_0xb66a('0x6'))(_0xb66a('0x7'));var config=require(_0xb66a('0x8'));var jayson=require(_0xb66a('0x9'));var client=jayson['client'][_0xb66a('0xa')]({'port':0x232a});config[_0xb66a('0xb')]=_[_0xb66a('0xc')](config[_0xb66a('0xb')],{'host':_0xb66a('0xd'),'port':0x18eb});var socket=require(_0xb66a('0xe'))(new Redis(config['redis']));require(_0xb66a('0xf'))[_0xb66a('0x10')](socket);function respondWithRpcPromise(_0x5c0e56,_0x4e459a,_0x470f22){return new BPromise(function(_0x4e1fbd,_0x4cd1e8){return client[_0xb66a('0x11')](_0x5c0e56,_0x470f22)[_0xb66a('0x12')](function(_0x3fc43a){logger[_0xb66a('0x13')]('ChatMessage,\x20%s,\x20%s',_0x4e459a,'request\x20sent');logger[_0xb66a('0x14')](_0xb66a('0x15'),_0x4e459a,_0xb66a('0x16'),JSON[_0xb66a('0x17')](_0x3fc43a));if(_0x3fc43a[_0xb66a('0x18')]){if(_0x3fc43a['error'][_0xb66a('0x19')]===0x1f4){logger[_0xb66a('0x18')](_0xb66a('0x1a'),_0x4e459a,_0x3fc43a[_0xb66a('0x18')][_0xb66a('0x1b')]);return _0x4cd1e8(_0x3fc43a['error'][_0xb66a('0x1b')]);}logger[_0xb66a('0x18')](_0xb66a('0x1a'),_0x4e459a,_0x3fc43a['error'][_0xb66a('0x1b')]);return _0x4e1fbd(_0x3fc43a[_0xb66a('0x18')][_0xb66a('0x1b')]);}else{logger[_0xb66a('0x13')](_0xb66a('0x1a'),_0x4e459a,_0xb66a('0x16'));_0x4e1fbd(_0x3fc43a[_0xb66a('0x1c')][_0xb66a('0x1b')]);}})[_0xb66a('0x1d')](function(_0x17b962){logger['error'](_0xb66a('0x1a'),_0x4e459a,_0x17b962);_0x4cd1e8(_0x17b962);});});}exports[_0xb66a('0x1e')]=function(_0xd82c99){var _0x11c90f=this;return new Promise(function(_0x541aab,_0x3c8f29){return db[_0xb66a('0x1f')]['create'](_0xd82c99[_0xb66a('0x20')],{'raw':_0xd82c99[_0xb66a('0x21')]?_0xd82c99[_0xb66a('0x21')][_0xb66a('0x22')]===undefined?!![]:![]:!![]})[_0xb66a('0x12')](function(_0x2f5d1a){logger['info'](_0xb66a('0x1e'),_0xd82c99);logger[_0xb66a('0x14')](_0xb66a('0x1e'),_0xd82c99,JSON[_0xb66a('0x17')](_0x2f5d1a));_0x541aab(_0x2f5d1a);})[_0xb66a('0x1d')](function(_0x1090b6){logger[_0xb66a('0x18')](_0xb66a('0x1e'),_0x1090b6[_0xb66a('0x1b')],_0xd82c99);_0x3c8f29(_0x11c90f['error'](0x1f4,_0x1090b6[_0xb66a('0x1b')]));});});}; \ No newline at end of file +var _0x9e78=['../../config/environment','jayson/promise','client','http','redis','localhost','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','CreateChatMessage','ChatMessage','create','body','raw','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x450076,_0x10983b){var _0x2029cc=function(_0x4a5e76){while(--_0x4a5e76){_0x450076['push'](_0x450076['shift']());}};_0x2029cc(++_0x10983b);}(_0x9e78,0xb8));var _0x89e7=function(_0x4bb145,_0x3e7d33){_0x4bb145=_0x4bb145-0x0;var _0x4db596=_0x9e78[_0x4bb145];return _0x4db596;};'use strict';var _=require(_0x89e7('0x0'));var util=require(_0x89e7('0x1'));var moment=require(_0x89e7('0x2'));var BPromise=require(_0x89e7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x89e7('0x4'))['db'];var utils=require(_0x89e7('0x5'));var logger=require(_0x89e7('0x6'))(_0x89e7('0x7'));var config=require(_0x89e7('0x8'));var jayson=require(_0x89e7('0x9'));var client=jayson[_0x89e7('0xa')][_0x89e7('0xb')]({'port':0x232a});config[_0x89e7('0xc')]=_['defaults'](config[_0x89e7('0xc')],{'host':_0x89e7('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x89e7('0xc')]));require(_0x89e7('0xe'))[_0x89e7('0xf')](socket);function respondWithRpcPromise(_0x9cdf7c,_0x4ebe94,_0x3e44e2){return new BPromise(function(_0x5c34bf,_0x269c1a){return client[_0x89e7('0x10')](_0x9cdf7c,_0x3e44e2)[_0x89e7('0x11')](function(_0x1c20db){logger[_0x89e7('0x12')](_0x89e7('0x13'),_0x4ebe94,_0x89e7('0x14'));logger[_0x89e7('0x15')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x4ebe94,_0x89e7('0x14'),JSON[_0x89e7('0x16')](_0x1c20db));if(_0x1c20db[_0x89e7('0x17')]){if(_0x1c20db[_0x89e7('0x17')][_0x89e7('0x18')]===0x1f4){logger[_0x89e7('0x17')](_0x89e7('0x13'),_0x4ebe94,_0x1c20db[_0x89e7('0x17')][_0x89e7('0x19')]);return _0x269c1a(_0x1c20db[_0x89e7('0x17')][_0x89e7('0x19')]);}logger[_0x89e7('0x17')]('ChatMessage,\x20%s,\x20%s',_0x4ebe94,_0x1c20db[_0x89e7('0x17')][_0x89e7('0x19')]);return _0x5c34bf(_0x1c20db[_0x89e7('0x17')][_0x89e7('0x19')]);}else{logger[_0x89e7('0x12')](_0x89e7('0x13'),_0x4ebe94,_0x89e7('0x14'));_0x5c34bf(_0x1c20db['result'][_0x89e7('0x19')]);}})['catch'](function(_0x303047){logger['error'](_0x89e7('0x13'),_0x4ebe94,_0x303047);_0x269c1a(_0x303047);});});}exports[_0x89e7('0x1a')]=function(_0x30f5ab){var _0x491003=this;return new Promise(function(_0x2a4c90,_0x1996af){return db[_0x89e7('0x1b')][_0x89e7('0x1c')](_0x30f5ab[_0x89e7('0x1d')],{'raw':_0x30f5ab['options']?_0x30f5ab['options'][_0x89e7('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x592213){logger[_0x89e7('0x12')](_0x89e7('0x1a'),_0x30f5ab);logger[_0x89e7('0x15')](_0x89e7('0x1a'),_0x30f5ab,JSON[_0x89e7('0x16')](_0x592213));_0x2a4c90(_0x592213);})[_0x89e7('0x1f')](function(_0x482209){logger[_0x89e7('0x17')](_0x89e7('0x1a'),_0x482209[_0x89e7('0x19')],_0x30f5ab);_0x1996af(_0x491003['error'](0x1f4,_0x482209[_0x89e7('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 5a4df36..c9c60d1 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 _0x1670=['./chatMessage.events','save','update','emit','register','length','chatMessage:'];(function(_0x263f4c,_0x438626){var _0x3a78d3=function(_0xbdb00f){while(--_0xbdb00f){_0x263f4c['push'](_0x263f4c['shift']());}};_0x3a78d3(++_0x438626);}(_0x1670,0x9a));var _0x0167=function(_0x9758d1,_0x120d87){_0x9758d1=_0x9758d1-0x0;var _0x479675=_0x1670[_0x9758d1];return _0x479675;};'use strict';var ChatMessageEvents=require(_0x0167('0x0'));var events=[_0x0167('0x1'),'remove',_0x0167('0x2')];function createListener(_0x4dc6f6,_0x1c7a08){return function(_0x45bbfd){_0x1c7a08[_0x0167('0x3')](_0x4dc6f6,_0x45bbfd);};}function removeListener(_0x6f87ae,_0x5786d8){return function(){ChatMessageEvents['removeListener'](_0x6f87ae,_0x5786d8);};}exports[_0x0167('0x4')]=function(_0x1ae650){for(var _0x295e51=0x0,_0x3e1507=events[_0x0167('0x5')];_0x295e51<_0x3e1507;_0x295e51++){var _0x149956=events[_0x295e51];var _0xcdfc5=createListener(_0x0167('0x6')+_0x149956,_0x1ae650);ChatMessageEvents['on'](_0x149956,_0xcdfc5);}}; \ No newline at end of file +var _0xbcba=['length','./chatMessage.events','save','update','emit','register'];(function(_0x326c6c,_0x4b67cb){var _0x1e9fff=function(_0x28eb32){while(--_0x28eb32){_0x326c6c['push'](_0x326c6c['shift']());}};_0x1e9fff(++_0x4b67cb);}(_0xbcba,0x6d));var _0xabcb=function(_0x34ecb6,_0x2afd7c){_0x34ecb6=_0x34ecb6-0x0;var _0x17cc8f=_0xbcba[_0x34ecb6];return _0x17cc8f;};'use strict';var ChatMessageEvents=require(_0xabcb('0x0'));var events=[_0xabcb('0x1'),'remove',_0xabcb('0x2')];function createListener(_0x2c9ee7,_0x2034d2){return function(_0xcbe337){_0x2034d2[_0xabcb('0x3')](_0x2c9ee7,_0xcbe337);};}function removeListener(_0x3e3b9b,_0x5e10df){return function(){ChatMessageEvents['removeListener'](_0x3e3b9b,_0x5e10df);};}exports[_0xabcb('0x4')]=function(_0x1290b2){for(var _0x5c706e=0x0,_0x5322e7=events[_0xabcb('0x5')];_0x5c706e<_0x5322e7;_0x5c706e++){var _0x192b36=events[_0x5c706e];var _0x5e693d=createListener('chatMessage:'+_0x192b36,_0x1290b2);ChatMessageEvents['on'](_0x192b36,_0x5e693d);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index f95c2a3..f9a1ea8 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 _0xb64b=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','chat','chatmessage:create','create','update','put','/:id/accept','accept','/:id/reject','reject'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb64b,0x1c3));var _0xbb64=function(_0xc6b104,_0x1d805a){_0xc6b104=_0xc6b104-0x0;var _0x1c6fce=_0xb64b[_0xc6b104];return _0x1c6fce;};'use strict';var multer=require(_0xbb64('0x0'));var util=require(_0xbb64('0x1'));var path=require(_0xbb64('0x2'));var timeout=require(_0xbb64('0x3'));var express=require(_0xbb64('0x4'));var router=express[_0xbb64('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xbb64('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xbb64('0x7'));var controller=require(_0xbb64('0x8'));router[_0xbb64('0x9')]('/',auth[_0xbb64('0xa')](),controller[_0xbb64('0xb')]);router['get'](_0xbb64('0xc'),auth[_0xbb64('0xa')](),controller[_0xbb64('0xd')]);router[_0xbb64('0x9')](_0xbb64('0xe'),auth[_0xbb64('0xa')](),controller[_0xbb64('0xf')]);router['post']('/',auth[_0xbb64('0xa')](),interaction['tracked'](_0xbb64('0x10'),_0xbb64('0x11')),controller[_0xbb64('0x12')]);router['put'](_0xbb64('0xe'),controller[_0xbb64('0x13')]);router[_0xbb64('0x14')](_0xbb64('0x15'),auth['isAuthenticated'](),controller[_0xbb64('0x16')]);router[_0xbb64('0x14')](_0xbb64('0x17'),auth['isAuthenticated'](),controller[_0xbb64('0x18')]);router[_0xbb64('0x19')](_0xbb64('0xe'),auth[_0xbb64('0xa')](),controller[_0xbb64('0x1a')]);module[_0xbb64('0x1b')]=router; \ No newline at end of file +var _0xedc2=['tracked','chat','put','update','accept','/:id/reject','reject','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','describe','/:id','show','post'];(function(_0x2b6b89,_0x172ec0){var _0x5aa6af=function(_0x19cd5e){while(--_0x19cd5e){_0x2b6b89['push'](_0x2b6b89['shift']());}};_0x5aa6af(++_0x172ec0);}(_0xedc2,0xd2));var _0x2edc=function(_0x5339c7,_0x3ff7a8){_0x5339c7=_0x5339c7-0x0;var _0x5ca169=_0xedc2[_0x5339c7];return _0x5ca169;};'use strict';var multer=require('multer');var util=require(_0x2edc('0x0'));var path=require(_0x2edc('0x1'));var timeout=require(_0x2edc('0x2'));var express=require(_0x2edc('0x3'));var router=express[_0x2edc('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2edc('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x2edc('0x6'));var controller=require(_0x2edc('0x7'));router[_0x2edc('0x8')]('/',auth[_0x2edc('0x9')](),controller[_0x2edc('0xa')]);router[_0x2edc('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x2edc('0xb')]);router[_0x2edc('0x8')](_0x2edc('0xc'),auth[_0x2edc('0x9')](),controller[_0x2edc('0xd')]);router[_0x2edc('0xe')]('/',auth[_0x2edc('0x9')](),interaction[_0x2edc('0xf')](_0x2edc('0x10'),'chatmessage:create'),controller['create']);router[_0x2edc('0x11')](_0x2edc('0xc'),controller[_0x2edc('0x12')]);router[_0x2edc('0x11')]('/:id/accept',auth[_0x2edc('0x9')](),controller[_0x2edc('0x13')]);router[_0x2edc('0x11')](_0x2edc('0x14'),auth[_0x2edc('0x9')](),controller[_0x2edc('0x15')]);router[_0x2edc('0x16')](_0x2edc('0xc'),auth['isAuthenticated'](),controller[_0x2edc('0x17')]);module[_0x2edc('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 90dacfe..573fa42 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 _0x15fe=['sequelize','exports','TEXT','medium'];(function(_0x2f31f6,_0x3b03f0){var _0x3ed300=function(_0x59f294){while(--_0x59f294){_0x2f31f6['push'](_0x2f31f6['shift']());}};_0x3ed300(++_0x3b03f0);}(_0x15fe,0x158));var _0xe15f=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x15fe[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require(_0xe15f('0x0'));module[_0xe15f('0x1')]={'body':{'type':Sequelize[_0xe15f('0x2')](_0xe15f('0x3')),'allowNull':![]}}; \ No newline at end of file +var _0x80bd=['medium','TEXT'];(function(_0x2eee78,_0x4b063f){var _0x6d5f74=function(_0x39e867){while(--_0x39e867){_0x2eee78['push'](_0x2eee78['shift']());}};_0x6d5f74(++_0x4b063f);}(_0x80bd,0x1bf));var _0xd80b=function(_0x54325a,_0x2836c6){_0x54325a=_0x54325a-0x0;var _0x2d4460=_0x80bd[_0x54325a];return _0x2d4460;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0xd80b('0x0')](_0xd80b('0x1')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 4878788..40a95e5 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x2cfb58,_0x3d9412){var _0xd99951=function(_0x329afa){while(--_0x329afa){_0x2cfb58['push'](_0x2cfb58['shift']());}};_0xd99951(++_0x3d9412);}(_0x7a54,0x106));var _0x47a5=function(_0x10495d,_0x531159){_0x10495d=_0x10495d-0x0;var _0x43dc6e=_0x7a54[_0x10495d];return _0x43dc6e;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file +var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x97ad7a,_0x521838){var _0x408c10=function(_0xa52479){while(--_0xa52479){_0x97ad7a['push'](_0x97ad7a['shift']());}};_0x408c10(++_0x521838);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 298ed06..3fd1e00 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 _0x5ed6=['request-promise','path','rimraf','../../config/environment','exports','define','utf8mb4','lodash','util','../../config/logger','moment','bluebird'];(function(_0x4ef826,_0x2e0ac8){var _0x154b8=function(_0x4fae58){while(--_0x4fae58){_0x4ef826['push'](_0x4ef826['shift']());}};_0x154b8(++_0x2e0ac8);}(_0x5ed6,0xd3));var _0x65ed=function(_0x503ffd,_0x8ecde){_0x503ffd=_0x503ffd-0x0;var _0x160437=_0x5ed6[_0x503ffd];return _0x160437;};'use strict';var _=require(_0x65ed('0x0'));var util=require(_0x65ed('0x1'));var logger=require(_0x65ed('0x2'))('api');var moment=require(_0x65ed('0x3'));var BPromise=require(_0x65ed('0x4'));var rp=require(_0x65ed('0x5'));var fs=require('fs');var path=require(_0x65ed('0x6'));var rimraf=require(_0x65ed('0x7'));var config=require(_0x65ed('0x8'));var attributes=require('./chatOfflineMessage.attributes');module[_0x65ed('0x9')]=function(_0x372c5,_0x5178b3){return _0x372c5[_0x65ed('0xa')]('ChatOfflineMessage',attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x65ed('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x71f4=['chat_offline_messages','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage'];(function(_0x32c92a,_0x26ec67){var _0x130f0b=function(_0x323a9d){while(--_0x323a9d){_0x32c92a['push'](_0x32c92a['shift']());}};_0x130f0b(++_0x26ec67);}(_0x71f4,0xe2));var _0x471f=function(_0x396e98,_0x528852){_0x396e98=_0x396e98-0x0;var _0x24ded2=_0x71f4[_0x396e98];return _0x24ded2;};'use strict';var _=require(_0x471f('0x0'));var util=require(_0x471f('0x1'));var logger=require(_0x471f('0x2'))(_0x471f('0x3'));var moment=require(_0x471f('0x4'));var BPromise=require(_0x471f('0x5'));var rp=require(_0x471f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x471f('0x7'));var config=require('../../config/environment');var attributes=require(_0x471f('0x8'));module[_0x471f('0x9')]=function(_0x42c4a6,_0x22445e){return _0x42c4a6[_0x471f('0xa')](_0x471f('0xb'),attributes,{'tableName':_0x471f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x471f('0xd'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 7690b24..0266fc2 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 _0x108e=['../../mysqldb','../../config/logger','jayson/promise','client','http','request','info','ChatOfflineMessage,\x20%s,\x20%s','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','util','moment','randomstring'];(function(_0x2886a3,_0x129ac5){var _0x1887bb=function(_0x57e9c6){while(--_0x57e9c6){_0x2886a3['push'](_0x2886a3['shift']());}};_0x1887bb(++_0x129ac5);}(_0x108e,0x141));var _0xe108=function(_0x4da21c,_0x31c55f){_0x4da21c=_0x4da21c-0x0;var _0x401291=_0x108e[_0x4da21c];return _0x401291;};'use strict';var _=require('lodash');var util=require(_0xe108('0x0'));var moment=require(_0xe108('0x1'));var BPromise=require('bluebird');var rs=require(_0xe108('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe108('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xe108('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe108('0x5'));var client=jayson[_0xe108('0x6')][_0xe108('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x280efa,_0x3dc105,_0x31ab24){return new BPromise(function(_0xcdd046,_0x1f0046){return client[_0xe108('0x8')](_0x280efa,_0x31ab24)['then'](function(_0x3c2b24){logger[_0xe108('0x9')](_0xe108('0xa'),_0x3dc105,'request\x20sent');logger['debug'](_0xe108('0xb'),_0x3dc105,_0xe108('0xc'),JSON[_0xe108('0xd')](_0x3c2b24));if(_0x3c2b24['error']){if(_0x3c2b24[_0xe108('0xe')][_0xe108('0xf')]===0x1f4){logger[_0xe108('0xe')]('ChatOfflineMessage,\x20%s,\x20%s',_0x3dc105,_0x3c2b24['error']['message']);return _0x1f0046(_0x3c2b24[_0xe108('0xe')][_0xe108('0x10')]);}logger[_0xe108('0xe')]('ChatOfflineMessage,\x20%s,\x20%s',_0x3dc105,_0x3c2b24['error']['message']);return _0xcdd046(_0x3c2b24['error'][_0xe108('0x10')]);}else{logger[_0xe108('0x9')]('ChatOfflineMessage,\x20%s,\x20%s',_0x3dc105,'request\x20sent');_0xcdd046(_0x3c2b24[_0xe108('0x11')][_0xe108('0x10')]);}})['catch'](function(_0x209541){logger['error'](_0xe108('0xa'),_0x3dc105,_0x209541);_0x1f0046(_0x209541);});});} \ No newline at end of file +var _0x20e7=['request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s'];(function(_0x30283b,_0x2de9b8){var _0x47defa=function(_0x3e9df0){while(--_0x3e9df0){_0x30283b['push'](_0x30283b['shift']());}};_0x47defa(++_0x2de9b8);}(_0x20e7,0x178));var _0x720e=function(_0xb7fa0f,_0x2687e5){_0xb7fa0f=_0xb7fa0f-0x0;var _0x28fdb1=_0x20e7[_0xb7fa0f];return _0x28fdb1;};'use strict';var _=require(_0x720e('0x0'));var util=require(_0x720e('0x1'));var moment=require('moment');var BPromise=require(_0x720e('0x2'));var rs=require(_0x720e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x720e('0x4'))['db'];var utils=require(_0x720e('0x5'));var logger=require(_0x720e('0x6'))(_0x720e('0x7'));var config=require(_0x720e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x720e('0x9')][_0x720e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf9e10c,_0xe610bc,_0x1a5c02){return new BPromise(function(_0x15355f,_0x54e5d7){return client[_0x720e('0xb')](_0xf9e10c,_0x1a5c02)[_0x720e('0xc')](function(_0x2a1540){logger[_0x720e('0xd')](_0x720e('0xe'),_0xe610bc,_0x720e('0xf'));logger[_0x720e('0x10')](_0x720e('0x11'),_0xe610bc,_0x720e('0xf'),JSON[_0x720e('0x12')](_0x2a1540));if(_0x2a1540[_0x720e('0x13')]){if(_0x2a1540[_0x720e('0x13')][_0x720e('0x14')]===0x1f4){logger[_0x720e('0x13')](_0x720e('0xe'),_0xe610bc,_0x2a1540['error'][_0x720e('0x15')]);return _0x54e5d7(_0x2a1540[_0x720e('0x13')]['message']);}logger[_0x720e('0x13')]('ChatOfflineMessage,\x20%s,\x20%s',_0xe610bc,_0x2a1540[_0x720e('0x13')][_0x720e('0x15')]);return _0x15355f(_0x2a1540[_0x720e('0x13')][_0x720e('0x15')]);}else{logger[_0x720e('0xd')](_0x720e('0xe'),_0xe610bc,_0x720e('0xf'));_0x15355f(_0x2a1540['result']['message']);}})[_0x720e('0x16')](function(_0x4ea471){logger['error'](_0x720e('0xe'),_0xe610bc,_0x4ea471);_0x54e5d7(_0x4ea471);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 9349401..c799761 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 _0x7e78=['/:id','show','create','put','update','delete','destroy','exports','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x4ea0e3,_0x3e3d31){var _0x32128b=function(_0x58f5d9){while(--_0x58f5d9){_0x4ea0e3['push'](_0x4ea0e3['shift']());}};_0x32128b(++_0x3e3d31);}(_0x7e78,0x15e));var _0x87e7=function(_0x2c6bcd,_0x4235eb){_0x2c6bcd=_0x2c6bcd-0x0;var _0x550e57=_0x7e78[_0x2c6bcd];return _0x550e57;};'use strict';var multer=require('multer');var util=require(_0x87e7('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x87e7('0x1')]();var fs_extra=require(_0x87e7('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x87e7('0x3'));var config=require(_0x87e7('0x4'));var controller=require(_0x87e7('0x5'));router[_0x87e7('0x6')]('/',auth[_0x87e7('0x7')](),controller[_0x87e7('0x8')]);router[_0x87e7('0x6')](_0x87e7('0x9'),auth[_0x87e7('0x7')](),controller[_0x87e7('0xa')]);router[_0x87e7('0x6')](_0x87e7('0xb'),auth[_0x87e7('0x7')](),controller[_0x87e7('0xc')]);router['post']('/',auth[_0x87e7('0x7')](),controller[_0x87e7('0xd')]);router[_0x87e7('0xe')](_0x87e7('0xb'),auth['isAuthenticated'](),controller[_0x87e7('0xf')]);router[_0x87e7('0x10')](_0x87e7('0xb'),auth[_0x87e7('0x7')](),controller[_0x87e7('0x11')]);module[_0x87e7('0x12')]=router; \ No newline at end of file +var _0xe044=['describe','/:id','show','post','create','put','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe'];(function(_0x40bd60,_0x3a7bcd){var _0x4f4185=function(_0x9cba77){while(--_0x9cba77){_0x40bd60['push'](_0x40bd60['shift']());}};_0x4f4185(++_0x3a7bcd);}(_0xe044,0x1d6));var _0x4e04=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe044[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x4e04('0x0'));var util=require(_0x4e04('0x1'));var path=require(_0x4e04('0x2'));var timeout=require(_0x4e04('0x3'));var express=require(_0x4e04('0x4'));var router=express[_0x4e04('0x5')]();var fs_extra=require(_0x4e04('0x6'));var auth=require(_0x4e04('0x7'));var interaction=require(_0x4e04('0x8'));var config=require(_0x4e04('0x9'));var controller=require('./chatOfflineMessage.controller');router[_0x4e04('0xa')]('/',auth[_0x4e04('0xb')](),controller[_0x4e04('0xc')]);router[_0x4e04('0xa')](_0x4e04('0xd'),auth[_0x4e04('0xb')](),controller[_0x4e04('0xe')]);router[_0x4e04('0xa')](_0x4e04('0xf'),auth['isAuthenticated'](),controller[_0x4e04('0x10')]);router[_0x4e04('0x11')]('/',auth[_0x4e04('0xb')](),controller[_0x4e04('0x12')]);router[_0x4e04('0x13')](_0x4e04('0xf'),auth[_0x4e04('0xb')](),controller['update']);router[_0x4e04('0x14')](_0x4e04('0xf'),auth[_0x4e04('0xb')](),controller['destroy']);module[_0x4e04('0x15')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 28075f4..5ae43f7 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 _0x3faf=['STRING','ENUM','mouseOver','timeout','INTEGER','sequelize','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x3faf,0x1be));var _0xf3fa=function(_0x1d8c32,_0x37c21c){_0x1d8c32=_0x1d8c32-0x0;var _0x9e0ded=_0x3faf[_0x1d8c32];return _0x9e0ded;};'use strict';var Sequelize=require(_0xf3fa('0x0'));module[_0xf3fa('0x1')]={'name':{'type':Sequelize[_0xf3fa('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xf3fa('0x3')](_0xf3fa('0x4'),_0xf3fa('0x5')),'defaultValue':_0xf3fa('0x4')},'selector':{'type':Sequelize[_0xf3fa('0x2')]},'timeout':{'type':Sequelize[_0xf3fa('0x6')]}}; \ No newline at end of file +var _0x4554=['STRING','sequelize','exports','mouseOver','timeout'];(function(_0x5e1cf5,_0x1e5149){var _0x4fa568=function(_0x19dae9){while(--_0x19dae9){_0x5e1cf5['push'](_0x5e1cf5['shift']());}};_0x4fa568(++_0x1e5149);}(_0x4554,0xa1));var _0x4455=function(_0x5cabdb,_0x1cad25){_0x5cabdb=_0x5cabdb-0x0;var _0x3dfec4=_0x4554[_0x5cabdb];return _0x3dfec4;};'use strict';var Sequelize=require(_0x4455('0x0'));module[_0x4455('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x4455('0x2'),_0x4455('0x3')),'defaultValue':_0x4455('0x2')},'selector':{'type':Sequelize[_0x4455('0x4')]},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index a3142c9..7a92410 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 _0xd8a7=['end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','send','show','model','ChatProactiveAction','rawAttributes','query','keys','filters','intersection','attributes','fields','includeAll','include','options','find','catch','create','body','update','params','eml-format','request-promise','moment','bluebird','util','sox','ejs','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','../../mysqldb','sendStatus'];(function(_0x5c8098,_0x366b7c){var _0x506d53=function(_0x28e730){while(--_0x28e730){_0x5c8098['push'](_0x5c8098['shift']());}};_0x506d53(++_0x366b7c);}(_0xd8a7,0xdf));var _0x7d8a=function(_0x213a20,_0x311649){_0x213a20=_0x213a20-0x0;var _0x156913=_0xd8a7[_0x213a20];return _0x156913;};'use strict';var emlformat=require(_0x7d8a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7d8a('0x1'));var moment=require(_0x7d8a('0x2'));var BPromise=require(_0x7d8a('0x3'));var Mustache=require('mustache');var util=require(_0x7d8a('0x4'));var path=require('path');var sox=require(_0x7d8a('0x5'));var csv=require('to-csv');var ejs=require(_0x7d8a('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7d8a('0x7'));var squel=require(_0x7d8a('0x8'));var crypto=require(_0x7d8a('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x7d8a('0xa'));var toCsv=require(_0x7d8a('0xb'));var querystring=require(_0x7d8a('0xc'));var Papa=require(_0x7d8a('0xd'));var Redis=require(_0x7d8a('0xe'));var authService=require(_0x7d8a('0xf'));var qs=require(_0x7d8a('0x10'));var as=require(_0x7d8a('0x11'));var hardwareService=require(_0x7d8a('0x12'));var logger=require(_0x7d8a('0x13'))(_0x7d8a('0x14'));var utils=require(_0x7d8a('0x15'));var config=require(_0x7d8a('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x7d8a('0x17'))['db'];function respondWithStatusCode(_0xd57f7d,_0x400bd6){_0x400bd6=_0x400bd6||0xcc;return function(_0x1ca39e){if(_0x1ca39e){return _0xd57f7d[_0x7d8a('0x18')](_0x400bd6);}return _0xd57f7d['status'](_0x400bd6)[_0x7d8a('0x19')]();};}function respondWithResult(_0x5a9b2c,_0x14caed){_0x14caed=_0x14caed||0xc8;return function(_0x506c6c){if(_0x506c6c){return _0x5a9b2c[_0x7d8a('0x1a')](_0x14caed)['json'](_0x506c6c);}};}function respondWithFilteredResult(_0x290d0a,_0x164c6c){return function(_0x52ec93){if(_0x52ec93){var _0x12516d=typeof _0x164c6c[_0x7d8a('0x1b')]===_0x7d8a('0x1c')&&typeof _0x164c6c[_0x7d8a('0x1d')]==='undefined';var _0x39fec5=_0x52ec93[_0x7d8a('0x1e')];var _0x5916ed=_0x12516d?0x0:_0x164c6c[_0x7d8a('0x1b')];var _0xcc3354=_0x12516d?_0x52ec93['count']:_0x164c6c[_0x7d8a('0x1b')]+_0x164c6c[_0x7d8a('0x1d')];var _0x4202e1;if(_0xcc3354>=_0x39fec5){_0xcc3354=_0x39fec5;_0x4202e1=0xc8;}else{_0x4202e1=0xce;}_0x290d0a[_0x7d8a('0x1a')](_0x4202e1);return _0x290d0a[_0x7d8a('0x1f')](_0x7d8a('0x20'),_0x5916ed+'-'+_0xcc3354+'/'+_0x39fec5)[_0x7d8a('0x21')](_0x52ec93);}return null;};}function patchUpdates(_0x18c8d1){return function(_0x428aa8){try{jsonpatch[_0x7d8a('0x22')](_0x428aa8,_0x18c8d1,!![]);}catch(_0x33c69f){return BPromise[_0x7d8a('0x23')](_0x33c69f);}return _0x428aa8[_0x7d8a('0x24')]();};}function saveUpdates(_0x4cc9ec,_0x478375){return function(_0x4acdfc){if(_0x4acdfc){return _0x4acdfc['update'](_0x4cc9ec)[_0x7d8a('0x25')](function(_0x1481b2){return _0x1481b2;});}return null;};}function removeEntity(_0xfaf23f,_0x9b324d){return function(_0x51c12d){if(_0x51c12d){return _0x51c12d[_0x7d8a('0x26')]()['then'](function(){_0xfaf23f[_0x7d8a('0x1a')](0xcc)[_0x7d8a('0x19')]();});}};}function handleEntityNotFound(_0x5b57a1,_0x124016){return function(_0x4c6b4f){if(!_0x4c6b4f){_0x5b57a1['sendStatus'](0x194);}return _0x4c6b4f;};}function handleError(_0x2f6720,_0x5c7aef){_0x5c7aef=_0x5c7aef||0x1f4;return function(_0x260eb3){logger[_0x7d8a('0x27')](_0x260eb3[_0x7d8a('0x28')]);if(_0x260eb3[_0x7d8a('0x29')]){delete _0x260eb3['name'];}_0x2f6720[_0x7d8a('0x1a')](_0x5c7aef)[_0x7d8a('0x2a')](_0x260eb3);};}exports[_0x7d8a('0x2b')]=function(_0x124fab,_0x2031c7){var _0x3b7bd8={'raw':!![],'where':{'id':_0x124fab['params']['id']}},_0x370ee6={};_0x370ee6[_0x7d8a('0x2c')]=_['keys'](db[_0x7d8a('0x2d')][_0x7d8a('0x2e')]);_0x370ee6[_0x7d8a('0x2f')]=_[_0x7d8a('0x30')](_0x124fab['query']);_0x370ee6[_0x7d8a('0x31')]=_[_0x7d8a('0x32')](_0x370ee6['model'],_0x370ee6['query']);_0x3b7bd8[_0x7d8a('0x33')]=_[_0x7d8a('0x32')](_0x370ee6[_0x7d8a('0x2c')],qs[_0x7d8a('0x34')](_0x124fab['query'][_0x7d8a('0x34')]));_0x3b7bd8[_0x7d8a('0x33')]=_0x3b7bd8[_0x7d8a('0x33')]['length']?_0x3b7bd8[_0x7d8a('0x33')]:_0x370ee6[_0x7d8a('0x2c')];if(_0x124fab[_0x7d8a('0x2f')][_0x7d8a('0x35')]){_0x3b7bd8[_0x7d8a('0x36')]=[{'all':!![]}];}_0x3b7bd8=_['merge']({},_0x3b7bd8,_0x124fab[_0x7d8a('0x37')]);return db[_0x7d8a('0x2d')][_0x7d8a('0x38')](_0x3b7bd8)[_0x7d8a('0x25')](handleEntityNotFound(_0x2031c7,null))[_0x7d8a('0x25')](respondWithResult(_0x2031c7,null))[_0x7d8a('0x39')](handleError(_0x2031c7,null));};exports[_0x7d8a('0x3a')]=function(_0x1c1d83,_0x3c8ba5){return db[_0x7d8a('0x2d')][_0x7d8a('0x3a')](_0x1c1d83[_0x7d8a('0x3b')],{})[_0x7d8a('0x25')](respondWithResult(_0x3c8ba5,0xc9))[_0x7d8a('0x39')](handleError(_0x3c8ba5,null));};exports[_0x7d8a('0x3c')]=function(_0x4459fb,_0x3321c3){if(_0x4459fb[_0x7d8a('0x3b')]['id']){delete _0x4459fb[_0x7d8a('0x3b')]['id'];}return db[_0x7d8a('0x2d')][_0x7d8a('0x38')]({'where':{'id':_0x4459fb[_0x7d8a('0x3d')]['id']}})[_0x7d8a('0x25')](handleEntityNotFound(_0x3321c3,null))['then'](saveUpdates(_0x4459fb['body'],null))[_0x7d8a('0x25')](respondWithResult(_0x3321c3,null))[_0x7d8a('0x39')](handleError(_0x3321c3,null));};exports[_0x7d8a('0x26')]=function(_0x4c6836,_0x383620){return db['ChatProactiveAction']['find']({'where':{'id':_0x4c6836['params']['id']}})[_0x7d8a('0x25')](handleEntityNotFound(_0x383620,null))[_0x7d8a('0x25')](removeEntity(_0x383620,null))[_0x7d8a('0x39')](handleError(_0x383620,null));}; \ No newline at end of file +var _0xd1f9=['query','filters','intersection','model','fields','attributes','includeAll','merge','find','catch','create','body','zip-dir','fast-json-patch','request-promise','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/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','error','stack','send','show','params','keys','ChatProactiveAction','rawAttributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd1f9,0x88));var _0x9d1f=function(_0x4e0863,_0x1ec822){_0x4e0863=_0x4e0863-0x0;var _0x3133d7=_0xd1f9[_0x4e0863];return _0x3133d7;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9d1f('0x0'));var jsonpatch=require(_0x9d1f('0x1'));var rp=require(_0x9d1f('0x2'));var moment=require(_0x9d1f('0x3'));var BPromise=require(_0x9d1f('0x4'));var Mustache=require(_0x9d1f('0x5'));var util=require(_0x9d1f('0x6'));var path=require(_0x9d1f('0x7'));var sox=require(_0x9d1f('0x8'));var csv=require('to-csv');var ejs=require(_0x9d1f('0x9'));var fs=require('fs');var fs_extra=require(_0x9d1f('0xa'));var _=require(_0x9d1f('0xb'));var squel=require(_0x9d1f('0xc'));var crypto=require(_0x9d1f('0xd'));var jsforce=require(_0x9d1f('0xe'));var deskjs=require(_0x9d1f('0xf'));var toCsv=require(_0x9d1f('0x10'));var querystring=require(_0x9d1f('0x11'));var Papa=require(_0x9d1f('0x12'));var Redis=require(_0x9d1f('0x13'));var authService=require(_0x9d1f('0x14'));var qs=require(_0x9d1f('0x15'));var as=require(_0x9d1f('0x16'));var hardwareService=require(_0x9d1f('0x17'));var logger=require(_0x9d1f('0x18'))(_0x9d1f('0x19'));var utils=require(_0x9d1f('0x1a'));var config=require(_0x9d1f('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0x9d1f('0x1c'))['db'];function respondWithStatusCode(_0x15a999,_0x7edbfa){_0x7edbfa=_0x7edbfa||0xcc;return function(_0x5a4d43){if(_0x5a4d43){return _0x15a999[_0x9d1f('0x1d')](_0x7edbfa);}return _0x15a999['status'](_0x7edbfa)['end']();};}function respondWithResult(_0x71e9c9,_0x38395d){_0x38395d=_0x38395d||0xc8;return function(_0x25c0b0){if(_0x25c0b0){return _0x71e9c9[_0x9d1f('0x1e')](_0x38395d)[_0x9d1f('0x1f')](_0x25c0b0);}};}function respondWithFilteredResult(_0x40a87f,_0x9f8cfc){return function(_0x2488a3){if(_0x2488a3){var _0x24cd8a=typeof _0x9f8cfc[_0x9d1f('0x20')]===_0x9d1f('0x21')&&typeof _0x9f8cfc[_0x9d1f('0x22')]===_0x9d1f('0x21');var _0x57ba11=_0x2488a3[_0x9d1f('0x23')];var _0x42a2b4=_0x24cd8a?0x0:_0x9f8cfc['offset'];var _0x329b69=_0x24cd8a?_0x2488a3['count']:_0x9f8cfc['offset']+_0x9f8cfc['limit'];var _0x2d39f3;if(_0x329b69>=_0x57ba11){_0x329b69=_0x57ba11;_0x2d39f3=0xc8;}else{_0x2d39f3=0xce;}_0x40a87f[_0x9d1f('0x1e')](_0x2d39f3);return _0x40a87f[_0x9d1f('0x24')]('Content-Range',_0x42a2b4+'-'+_0x329b69+'/'+_0x57ba11)[_0x9d1f('0x1f')](_0x2488a3);}return null;};}function patchUpdates(_0x4cfcf5){return function(_0x1c0280){try{jsonpatch['apply'](_0x1c0280,_0x4cfcf5,!![]);}catch(_0x552a84){return BPromise[_0x9d1f('0x25')](_0x552a84);}return _0x1c0280[_0x9d1f('0x26')]();};}function saveUpdates(_0x35a80d,_0x2d861b){return function(_0x44ef15){if(_0x44ef15){return _0x44ef15[_0x9d1f('0x27')](_0x35a80d)[_0x9d1f('0x28')](function(_0x3b10f7){return _0x3b10f7;});}return null;};}function removeEntity(_0x2c6417,_0xc05aa){return function(_0x1ab0f4){if(_0x1ab0f4){return _0x1ab0f4[_0x9d1f('0x29')]()[_0x9d1f('0x28')](function(){_0x2c6417[_0x9d1f('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b234d,_0xa2392f){return function(_0x48245c){if(!_0x48245c){_0x2b234d['sendStatus'](0x194);}return _0x48245c;};}function handleError(_0x1f2b0e,_0xfdd4ae){_0xfdd4ae=_0xfdd4ae||0x1f4;return function(_0x3ca450){logger[_0x9d1f('0x2a')](_0x3ca450[_0x9d1f('0x2b')]);if(_0x3ca450['name']){delete _0x3ca450['name'];}_0x1f2b0e[_0x9d1f('0x1e')](_0xfdd4ae)[_0x9d1f('0x2c')](_0x3ca450);};}exports[_0x9d1f('0x2d')]=function(_0x44515d,_0x1df1b8){var _0x1d8ffe={'raw':!![],'where':{'id':_0x44515d[_0x9d1f('0x2e')]['id']}},_0x48fbf5={};_0x48fbf5['model']=_[_0x9d1f('0x2f')](db[_0x9d1f('0x30')][_0x9d1f('0x31')]);_0x48fbf5[_0x9d1f('0x32')]=_[_0x9d1f('0x2f')](_0x44515d['query']);_0x48fbf5[_0x9d1f('0x33')]=_[_0x9d1f('0x34')](_0x48fbf5[_0x9d1f('0x35')],_0x48fbf5['query']);_0x1d8ffe['attributes']=_[_0x9d1f('0x34')](_0x48fbf5[_0x9d1f('0x35')],qs['fields'](_0x44515d[_0x9d1f('0x32')][_0x9d1f('0x36')]));_0x1d8ffe[_0x9d1f('0x37')]=_0x1d8ffe[_0x9d1f('0x37')]['length']?_0x1d8ffe[_0x9d1f('0x37')]:_0x48fbf5[_0x9d1f('0x35')];if(_0x44515d[_0x9d1f('0x32')][_0x9d1f('0x38')]){_0x1d8ffe['include']=[{'all':!![]}];}_0x1d8ffe=_[_0x9d1f('0x39')]({},_0x1d8ffe,_0x44515d['options']);return db[_0x9d1f('0x30')][_0x9d1f('0x3a')](_0x1d8ffe)[_0x9d1f('0x28')](handleEntityNotFound(_0x1df1b8,null))['then'](respondWithResult(_0x1df1b8,null))[_0x9d1f('0x3b')](handleError(_0x1df1b8,null));};exports[_0x9d1f('0x3c')]=function(_0x324242,_0x236ca3){return db[_0x9d1f('0x30')]['create'](_0x324242[_0x9d1f('0x3d')],{})[_0x9d1f('0x28')](respondWithResult(_0x236ca3,0xc9))[_0x9d1f('0x3b')](handleError(_0x236ca3,null));};exports[_0x9d1f('0x27')]=function(_0x245675,_0x381654){if(_0x245675[_0x9d1f('0x3d')]['id']){delete _0x245675['body']['id'];}return db[_0x9d1f('0x30')][_0x9d1f('0x3a')]({'where':{'id':_0x245675[_0x9d1f('0x2e')]['id']}})[_0x9d1f('0x28')](handleEntityNotFound(_0x381654,null))['then'](saveUpdates(_0x245675[_0x9d1f('0x3d')],null))['then'](respondWithResult(_0x381654,null))['catch'](handleError(_0x381654,null));};exports['destroy']=function(_0x3c9a17,_0x1253e2){return db['ChatProactiveAction'][_0x9d1f('0x3a')]({'where':{'id':_0x3c9a17[_0x9d1f('0x2e')]['id']}})[_0x9d1f('0x28')](handleEntityNotFound(_0x1253e2,null))[_0x9d1f('0x28')](removeEntity(_0x1253e2,null))[_0x9d1f('0x3b')](handleError(_0x1253e2,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 5938bc2..f2c76e1 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 _0x76c2=['lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./chatProactiveAction.attributes','define','ChatProactiveAction','chat_proactive_actions'];(function(_0xd16b5f,_0x47b868){var _0x49d80c=function(_0x245068){while(--_0x245068){_0xd16b5f['push'](_0xd16b5f['shift']());}};_0x49d80c(++_0x47b868);}(_0x76c2,0x78));var _0x276c=function(_0x73f519,_0x15fa15){_0x73f519=_0x73f519-0x0;var _0x410358=_0x76c2[_0x73f519];return _0x410358;};'use strict';var _=require(_0x276c('0x0'));var util=require(_0x276c('0x1'));var logger=require(_0x276c('0x2'))(_0x276c('0x3'));var moment=require(_0x276c('0x4'));var BPromise=require('bluebird');var rp=require(_0x276c('0x5'));var fs=require('fs');var path=require(_0x276c('0x6'));var rimraf=require('rimraf');var config=require(_0x276c('0x7'));var attributes=require(_0x276c('0x8'));module['exports']=function(_0x1373f0,_0x32a1b2){return _0x1373f0[_0x276c('0x9')](_0x276c('0xa'),attributes,{'tableName':_0x276c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6f78=['bluebird','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api','moment'];(function(_0x3ba0cb,_0x1b6b79){var _0x13d4b1=function(_0xeb3351){while(--_0xeb3351){_0x3ba0cb['push'](_0x3ba0cb['shift']());}};_0x13d4b1(++_0x1b6b79);}(_0x6f78,0x103));var _0x86f7=function(_0x4a1a0f,_0x322831){_0x4a1a0f=_0x4a1a0f-0x0;var _0x3ee36f=_0x6f78[_0x4a1a0f];return _0x3ee36f;};'use strict';var _=require(_0x86f7('0x0'));var util=require(_0x86f7('0x1'));var logger=require(_0x86f7('0x2'))(_0x86f7('0x3'));var moment=require(_0x86f7('0x4'));var BPromise=require(_0x86f7('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x86f7('0x6'));var config=require(_0x86f7('0x7'));var attributes=require(_0x86f7('0x8'));module[_0x86f7('0x9')]=function(_0xa397c1,_0x46a8a1){return _0xa397c1['define'](_0x86f7('0xa'),attributes,{'tableName':_0x86f7('0xb'),'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 235f54d..3adcc9f 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 _0x1af4=['then','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x34a5eb,_0x9361be){var _0x427afb=function(_0x368d3e){while(--_0x368d3e){_0x34a5eb['push'](_0x34a5eb['shift']());}};_0x427afb(++_0x9361be);}(_0x1af4,0x78));var _0x41af=function(_0x5b92df,_0x19a2ab){_0x5b92df=_0x5b92df-0x0;var _0xfbd4d4=_0x1af4[_0x5b92df];return _0xfbd4d4;};'use strict';var _=require(_0x41af('0x0'));var util=require('util');var moment=require(_0x41af('0x1'));var BPromise=require(_0x41af('0x2'));var rs=require(_0x41af('0x3'));var fs=require('fs');var Redis=require(_0x41af('0x4'));var db=require(_0x41af('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x41af('0x6'))(_0x41af('0x7'));var config=require(_0x41af('0x8'));var jayson=require(_0x41af('0x9'));var client=jayson['client'][_0x41af('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ebdb5,_0x5d4be8,_0x54d853){return new BPromise(function(_0x16df69,_0x339b01){return client[_0x41af('0xb')](_0x5ebdb5,_0x54d853)[_0x41af('0xc')](function(_0x42bdbc){logger['info'](_0x41af('0xd'),_0x5d4be8,_0x41af('0xe'));logger[_0x41af('0xf')](_0x41af('0x10'),_0x5d4be8,_0x41af('0xe'),JSON[_0x41af('0x11')](_0x42bdbc));if(_0x42bdbc[_0x41af('0x12')]){if(_0x42bdbc['error']['code']===0x1f4){logger[_0x41af('0x12')](_0x41af('0xd'),_0x5d4be8,_0x42bdbc[_0x41af('0x12')][_0x41af('0x13')]);return _0x339b01(_0x42bdbc[_0x41af('0x12')]['message']);}logger[_0x41af('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x5d4be8,_0x42bdbc[_0x41af('0x12')][_0x41af('0x13')]);return _0x16df69(_0x42bdbc['error'][_0x41af('0x13')]);}else{logger[_0x41af('0x14')](_0x41af('0xd'),_0x5d4be8,'request\x20sent');_0x16df69(_0x42bdbc['result'][_0x41af('0x13')]);}})[_0x41af('0x15')](function(_0x1658e0){logger[_0x41af('0x12')](_0x41af('0xd'),_0x5d4be8,_0x1658e0);_0x339b01(_0x1658e0);});});} \ No newline at end of file +var _0xf43e=['jayson/promise','client','http','request','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x32729c,_0xf5afd8){var _0x482cfd=function(_0x231471){while(--_0x231471){_0x32729c['push'](_0x32729c['shift']());}};_0x482cfd(++_0xf5afd8);}(_0xf43e,0x66));var _0xef43=function(_0xb88792,_0x3408d5){_0xb88792=_0xb88792-0x0;var _0x4f8d68=_0xf43e[_0xb88792];return _0x4f8d68;};'use strict';var _=require(_0xef43('0x0'));var util=require(_0xef43('0x1'));var moment=require('moment');var BPromise=require(_0xef43('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xef43('0x3'));var db=require(_0xef43('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xef43('0x5'))(_0xef43('0x6'));var config=require(_0xef43('0x7'));var jayson=require(_0xef43('0x8'));var client=jayson[_0xef43('0x9')][_0xef43('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1264a8,_0x1b7036,_0x129499){return new BPromise(function(_0x226eb8,_0x2d0efa){return client[_0xef43('0xb')](_0x1264a8,_0x129499)['then'](function(_0xe0e2c7){logger[_0xef43('0xc')](_0xef43('0xd'),_0x1b7036,_0xef43('0xe'));logger['debug'](_0xef43('0xf'),_0x1b7036,_0xef43('0xe'),JSON[_0xef43('0x10')](_0xe0e2c7));if(_0xe0e2c7[_0xef43('0x11')]){if(_0xe0e2c7[_0xef43('0x11')][_0xef43('0x12')]===0x1f4){logger[_0xef43('0x11')](_0xef43('0xd'),_0x1b7036,_0xe0e2c7[_0xef43('0x11')][_0xef43('0x13')]);return _0x2d0efa(_0xe0e2c7[_0xef43('0x11')]['message']);}logger['error'](_0xef43('0xd'),_0x1b7036,_0xe0e2c7[_0xef43('0x11')][_0xef43('0x13')]);return _0x226eb8(_0xe0e2c7[_0xef43('0x11')][_0xef43('0x13')]);}else{logger[_0xef43('0xc')](_0xef43('0xd'),_0x1b7036,_0xef43('0xe'));_0x226eb8(_0xe0e2c7[_0xef43('0x14')]['message']);}})[_0xef43('0x15')](function(_0x10e124){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x1b7036,_0x10e124);_0x2d0efa(_0x10e124);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index da8ab3d..158b035 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 _0xdbf5=['post','put','update','delete','destroy','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show'];(function(_0x24e880,_0x466f47){var _0x45c13d=function(_0x294c7d){while(--_0x294c7d){_0x24e880['push'](_0x24e880['shift']());}};_0x45c13d(++_0x466f47);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x37df85,_0x394d8c){_0x37df85=_0x37df85-0x0;var _0x2d7292=_0xdbf5[_0x37df85];return _0x2d7292;};'use strict';var multer=require('multer');var util=require(_0x5dbf('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5dbf('0x1'));var router=express[_0x5dbf('0x2')]();var fs_extra=require(_0x5dbf('0x3'));var auth=require(_0x5dbf('0x4'));var interaction=require(_0x5dbf('0x5'));var config=require(_0x5dbf('0x6'));var controller=require(_0x5dbf('0x7'));router[_0x5dbf('0x8')](_0x5dbf('0x9'),auth[_0x5dbf('0xa')](),controller[_0x5dbf('0xb')]);router[_0x5dbf('0xc')]('/',auth[_0x5dbf('0xa')](),controller['create']);router[_0x5dbf('0xd')]('/:id',auth[_0x5dbf('0xa')](),controller[_0x5dbf('0xe')]);router[_0x5dbf('0xf')](_0x5dbf('0x9'),auth['isAuthenticated'](),controller[_0x5dbf('0x10')]);module['exports']=router; \ No newline at end of file +var _0x3eea=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','post','create','update','isAuthenticated','destroy','multer'];(function(_0x16ae27,_0x3d0212){var _0x4871c5=function(_0x1f226c){while(--_0x1f226c){_0x16ae27['push'](_0x16ae27['shift']());}};_0x4871c5(++_0x3d0212);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x1837ac,_0x3f8d60){_0x1837ac=_0x1837ac-0x0;var _0x50d21e=_0x3eea[_0x1837ac];return _0x50d21e;};'use strict';var multer=require(_0xa3ee('0x0'));var util=require('util');var path=require(_0xa3ee('0x1'));var timeout=require(_0xa3ee('0x2'));var express=require(_0xa3ee('0x3'));var router=express[_0xa3ee('0x4')]();var fs_extra=require(_0xa3ee('0x5'));var auth=require(_0xa3ee('0x6'));var interaction=require(_0xa3ee('0x7'));var config=require(_0xa3ee('0x8'));var controller=require(_0xa3ee('0x9'));router[_0xa3ee('0xa')](_0xa3ee('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xa3ee('0xc')]('/',auth['isAuthenticated'](),controller[_0xa3ee('0xd')]);router['put'](_0xa3ee('0xb'),auth['isAuthenticated'](),controller[_0xa3ee('0xe')]);router['delete'](_0xa3ee('0xb'),auth[_0xa3ee('0xf')](),controller[_0xa3ee('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index e141b70..644e626 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 _0xc4d5=['ENUM','rrmemory','beepall','sequelize','exports','STRING','name','INTEGER'];(function(_0x3493e3,_0x4e11ff){var _0x377c4d=function(_0x3f3aec){while(--_0x3f3aec){_0x3493e3['push'](_0x3493e3['shift']());}};_0x377c4d(++_0x4e11ff);}(_0xc4d5,0xc3));var _0x5c4d=function(_0x3f578f,_0x51f172){_0x3f578f=_0x3f578f-0x0;var _0x32c754=_0xc4d5[_0x3f578f];return _0x32c754;};'use strict';var Sequelize=require(_0x5c4d('0x0'));module[_0x5c4d('0x1')]={'name':{'type':Sequelize[_0x5c4d('0x2')],'unique':_0x5c4d('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x5c4d('0x2')]},'timeout':{'type':Sequelize[_0x5c4d('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x5c4d('0x5')](_0x5c4d('0x6'),_0x5c4d('0x7'),'roundrobin')}}; \ No newline at end of file +var _0xddc2=['sequelize','exports','STRING','name','ENUM','beepall'];(function(_0x38f374,_0x4b1d43){var _0x3c78a0=function(_0x4cbb16){while(--_0x4cbb16){_0x38f374['push'](_0x38f374['shift']());}};_0x3c78a0(++_0x4b1d43);}(_0xddc2,0x78));var _0x2ddc=function(_0x2edd6a,_0x5e6d1a){_0x2edd6a=_0x2edd6a-0x0;var _0x5b7047=_0xddc2[_0x2edd6a];return _0x5b7047;};'use strict';var Sequelize=require(_0x2ddc('0x0'));module[_0x2ddc('0x1')]={'name':{'type':Sequelize[_0x2ddc('0x2')],'unique':_0x2ddc('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2ddc('0x4')]('rrmemory',_0x2ddc('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 5a0d245..ab8b2d0 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 _0x5fff=['body','find','params','describe','getMembers','findOne','ChatQueueId','UserChatQueue','User','chatPause','updatedAt','createdAt','rows','format','SIP','getTeams','nolimit','ids','findAll','Agents','online','interface','sequelize','transaction','each','findOrCreate','forEach','userChatQueue:save','removeTeams','Team','select','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','includes','union','compact','value','isEmpty','removeAgents','emit','userChatQueue:remove','addAgents','omit','getAgents','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./chatQueue.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','get','ChatQueues','stack','name','send','index','map','ChatQueue','rawAttributes','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x38cd0f,_0x37a639){var _0x4727df=function(_0x133d5d){while(--_0x133d5d){_0x38cd0f['push'](_0x38cd0f['shift']());}};_0x4727df(++_0x37a639);}(_0x5fff,0xd1));var _0xf5ff=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x5fff[_0x5f0089];return _0x193892;};'use strict';var emlformat=require(_0xf5ff('0x0'));var rimraf=require(_0xf5ff('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf5ff('0x2'));var moment=require(_0xf5ff('0x3'));var BPromise=require(_0xf5ff('0x4'));var Mustache=require(_0xf5ff('0x5'));var util=require('util');var path=require(_0xf5ff('0x6'));var sox=require('sox');var csv=require(_0xf5ff('0x7'));var ejs=require(_0xf5ff('0x8'));var fs=require('fs');var fs_extra=require(_0xf5ff('0x9'));var _=require(_0xf5ff('0xa'));var squel=require('squel');var crypto=require(_0xf5ff('0xb'));var jsforce=require(_0xf5ff('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf5ff('0xd'));var Papa=require(_0xf5ff('0xe'));var Redis=require(_0xf5ff('0xf'));var authService=require(_0xf5ff('0x10'));var qs=require(_0xf5ff('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf5ff('0x12'));var logger=require(_0xf5ff('0x13'))(_0xf5ff('0x14'));var utils=require(_0xf5ff('0x15'));var config=require(_0xf5ff('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xf5ff('0x17'))['db'];config[_0xf5ff('0x18')]=_[_0xf5ff('0x19')](config[_0xf5ff('0x18')],{'host':_0xf5ff('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf5ff('0x18')]));require(_0xf5ff('0x1b'))[_0xf5ff('0x1c')](socket);var jayson=require(_0xf5ff('0x1d'));var client=jayson[_0xf5ff('0x1e')][_0xf5ff('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x5b24e7,_0x28add6,_0x4b4cbd,_0x495e53){return new BPromise(function(_0xac4101,_0x467d01){var _0x199309=_0x495e53||client;return _0x199309[_0xf5ff('0x20')](_0x5b24e7,_0x4b4cbd)[_0xf5ff('0x21')](function(_0x2bc39b){logger[_0xf5ff('0x22')]('ChatQueue,\x20%s,\x20%s',_0x28add6,_0xf5ff('0x23'));logger[_0xf5ff('0x24')](_0xf5ff('0x25'),_0x28add6,_0xf5ff('0x23'),JSON['stringify'](_0x2bc39b));if(_0x2bc39b[_0xf5ff('0x26')]){if(_0x2bc39b[_0xf5ff('0x26')][_0xf5ff('0x27')]===0x1f4){logger[_0xf5ff('0x26')](_0xf5ff('0x28'),_0x28add6,_0x2bc39b[_0xf5ff('0x26')][_0xf5ff('0x29')]);return _0x467d01(_0x2bc39b[_0xf5ff('0x26')][_0xf5ff('0x29')]);}logger[_0xf5ff('0x26')](_0xf5ff('0x28'),_0x28add6,_0x2bc39b[_0xf5ff('0x26')][_0xf5ff('0x29')]);return _0xac4101(_0x2bc39b[_0xf5ff('0x26')][_0xf5ff('0x29')]);}else{logger['info'](_0xf5ff('0x28'),_0x28add6,'request\x20sent');_0xac4101(_0x2bc39b[_0xf5ff('0x2a')]['message']);}})[_0xf5ff('0x2b')](function(_0x12bf00){logger[_0xf5ff('0x26')](_0xf5ff('0x28'),_0x28add6,_0x12bf00);_0x467d01(_0x12bf00);});});}function respondWithStatusCode(_0x4a08d4,_0x20e086){_0x20e086=_0x20e086||0xcc;return function(_0x4747f0){if(_0x4747f0){return _0x4a08d4[_0xf5ff('0x2c')](_0x20e086);}return _0x4a08d4[_0xf5ff('0x2d')](_0x20e086)[_0xf5ff('0x2e')]();};}function respondWithResult(_0x1367a6,_0x3eee06){_0x3eee06=_0x3eee06||0xc8;return function(_0xb98881){if(_0xb98881){return _0x1367a6[_0xf5ff('0x2d')](_0x3eee06)[_0xf5ff('0x2f')](_0xb98881);}};}function respondWithFilteredResult(_0x3fe789,_0x1c98af){return function(_0x51a235){if(_0x51a235){var _0x136dde=typeof _0x1c98af[_0xf5ff('0x30')]===_0xf5ff('0x31')&&typeof _0x1c98af[_0xf5ff('0x32')]===_0xf5ff('0x31');var _0x2909a3=_0x51a235[_0xf5ff('0x33')];var _0x20124d=_0x136dde?0x0:_0x1c98af[_0xf5ff('0x30')];var _0x555432=_0x136dde?_0x51a235[_0xf5ff('0x33')]:_0x1c98af[_0xf5ff('0x30')]+_0x1c98af['limit'];var _0x4296e5;if(_0x555432>=_0x2909a3){_0x555432=_0x2909a3;_0x4296e5=0xc8;}else{_0x4296e5=0xce;}_0x3fe789[_0xf5ff('0x2d')](_0x4296e5);return _0x3fe789[_0xf5ff('0x34')](_0xf5ff('0x35'),_0x20124d+'-'+_0x555432+'/'+_0x2909a3)[_0xf5ff('0x2f')](_0x51a235);}return null;};}function patchUpdates(_0x25ffc2){return function(_0x1cb656){try{jsonpatch[_0xf5ff('0x36')](_0x1cb656,_0x25ffc2,!![]);}catch(_0x31dd96){return BPromise[_0xf5ff('0x37')](_0x31dd96);}return _0x1cb656['save']();};}function saveUpdates(_0x39e66b,_0x36eb42){return function(_0x52e705){if(_0x52e705){return _0x52e705[_0xf5ff('0x38')](_0x39e66b)[_0xf5ff('0x21')](function(_0x3e0064){return _0x3e0064;});}return null;};}function removeEntity(_0x55eaab,_0x5c61fe){return function(_0xd23180){if(_0xd23180){return _0xd23180[_0xf5ff('0x39')]()['then'](function(){var _0xd486e=_0xd23180[_0xf5ff('0x3a')]({'plain':!![]});var _0x317418=_0xf5ff('0x3b');return db['UserProfileResource'][_0xf5ff('0x39')]({'where':{'type':_0x317418,'resourceId':_0xd486e['id']}})[_0xf5ff('0x21')](function(){return _0xd23180;});})[_0xf5ff('0x21')](function(){_0x55eaab[_0xf5ff('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x120e28,_0x3bca8e){return function(_0x1862f4){if(!_0x1862f4){_0x120e28[_0xf5ff('0x2c')](0x194);}return _0x1862f4;};}function handleError(_0x540d17,_0x5b829a){_0x5b829a=_0x5b829a||0x1f4;return function(_0x1c523b){logger['error'](_0x1c523b[_0xf5ff('0x3c')]);if(_0x1c523b[_0xf5ff('0x3d')]){delete _0x1c523b['name'];}_0x540d17[_0xf5ff('0x2d')](_0x5b829a)[_0xf5ff('0x3e')](_0x1c523b);};}exports[_0xf5ff('0x3f')]=function(_0x4c6863,_0x414c15){var _0xde0a7={},_0x11fead={},_0x2a2b6d={'count':0x0,'rows':[]};var _0x1fb4f1=_[_0xf5ff('0x40')](db[_0xf5ff('0x41')][_0xf5ff('0x42')],function(_0x3e0d77){return{'name':_0x3e0d77['fieldName'],'type':_0x3e0d77['type'][_0xf5ff('0x43')]};});_0x11fead['model']=_[_0xf5ff('0x40')](_0x1fb4f1,_0xf5ff('0x3d'));_0x11fead[_0xf5ff('0x44')]=_[_0xf5ff('0x45')](_0x4c6863['query']);_0x11fead[_0xf5ff('0x46')]=_['intersection'](_0x11fead[_0xf5ff('0x47')],_0x11fead[_0xf5ff('0x44')]);_0xde0a7[_0xf5ff('0x48')]=_[_0xf5ff('0x49')](_0x11fead[_0xf5ff('0x47')],qs[_0xf5ff('0x4a')](_0x4c6863[_0xf5ff('0x44')][_0xf5ff('0x4a')]));_0xde0a7[_0xf5ff('0x48')]=_0xde0a7['attributes'][_0xf5ff('0x4b')]?_0xde0a7[_0xf5ff('0x48')]:_0x11fead[_0xf5ff('0x47')];if(!_0x4c6863[_0xf5ff('0x44')][_0xf5ff('0x4c')]('nolimit')){_0xde0a7['limit']=qs[_0xf5ff('0x32')](_0x4c6863[_0xf5ff('0x44')]['limit']);_0xde0a7[_0xf5ff('0x30')]=qs[_0xf5ff('0x30')](_0x4c6863[_0xf5ff('0x44')][_0xf5ff('0x30')]);}_0xde0a7[_0xf5ff('0x4d')]=qs[_0xf5ff('0x4e')](_0x4c6863['query'][_0xf5ff('0x4e')]);_0xde0a7[_0xf5ff('0x4f')]=qs['filters'](_[_0xf5ff('0x50')](_0x4c6863[_0xf5ff('0x44')],_0x11fead[_0xf5ff('0x46')]),_0x1fb4f1);if(_0x4c6863[_0xf5ff('0x44')][_0xf5ff('0x51')]){_0xde0a7[_0xf5ff('0x4f')]=_[_0xf5ff('0x52')](_0xde0a7[_0xf5ff('0x4f')],{'$or':_[_0xf5ff('0x40')](_0x1fb4f1,function(_0x47481c){if(_0x47481c[_0xf5ff('0x53')]!==_0xf5ff('0x54')){var _0x5c7729={};_0x5c7729[_0x47481c['name']]={'$like':'%'+_0x4c6863[_0xf5ff('0x44')][_0xf5ff('0x51')]+'%'};return _0x5c7729;}})});}_0xde0a7=_[_0xf5ff('0x52')]({},_0xde0a7,_0x4c6863[_0xf5ff('0x55')]);var _0x2e881d={'where':_0xde0a7['where']};return db[_0xf5ff('0x41')]['count'](_0x2e881d)['then'](function(_0x3e7563){_0x2a2b6d[_0xf5ff('0x33')]=_0x3e7563;if(_0x4c6863[_0xf5ff('0x44')][_0xf5ff('0x56')]){_0xde0a7[_0xf5ff('0x57')]=[{'all':!![]}];}return db[_0xf5ff('0x41')]['findAll'](_0xde0a7);})['then'](function(_0x358d5f){_0x2a2b6d['rows']=_0x358d5f;return _0x2a2b6d;})[_0xf5ff('0x21')](respondWithFilteredResult(_0x414c15,_0xde0a7))['catch'](handleError(_0x414c15,null));};exports['show']=function(_0x188b0a,_0x44beb4){var _0x76d700={'raw':!![],'where':{'id':_0x188b0a['params']['id']}},_0x35c8db={};_0x35c8db[_0xf5ff('0x47')]=_[_0xf5ff('0x45')](db[_0xf5ff('0x41')][_0xf5ff('0x42')]);_0x35c8db[_0xf5ff('0x44')]=_[_0xf5ff('0x45')](_0x188b0a[_0xf5ff('0x44')]);_0x35c8db[_0xf5ff('0x46')]=_['intersection'](_0x35c8db[_0xf5ff('0x47')],_0x35c8db[_0xf5ff('0x44')]);_0x76d700['attributes']=_[_0xf5ff('0x49')](_0x35c8db['model'],qs[_0xf5ff('0x4a')](_0x188b0a['query'][_0xf5ff('0x4a')]));_0x76d700['attributes']=_0x76d700[_0xf5ff('0x48')][_0xf5ff('0x4b')]?_0x76d700[_0xf5ff('0x48')]:_0x35c8db[_0xf5ff('0x47')];if(_0x188b0a[_0xf5ff('0x44')][_0xf5ff('0x56')]){_0x76d700[_0xf5ff('0x57')]=[{'all':!![]}];}_0x76d700=_[_0xf5ff('0x52')]({},_0x76d700,_0x188b0a[_0xf5ff('0x55')]);return db[_0xf5ff('0x41')]['find'](_0x76d700)[_0xf5ff('0x21')](handleEntityNotFound(_0x44beb4,null))['then'](respondWithResult(_0x44beb4,null))[_0xf5ff('0x2b')](handleError(_0x44beb4,null));};exports[_0xf5ff('0x58')]=function(_0x5627de,_0x2bd286){return db[_0xf5ff('0x41')][_0xf5ff('0x58')](_0x5627de['body'],{})[_0xf5ff('0x21')](function(_0x112467){var _0x27430c=_0x5627de[_0xf5ff('0x59')][_0xf5ff('0x3a')]({'plain':!![]});if(!_0x27430c)throw new Error(_0xf5ff('0x5a'));if(_0x27430c[_0xf5ff('0x5b')]===_0xf5ff('0x59')){var _0x5ca10a=_0x112467['get']({'plain':!![]});var _0x340554=_0xf5ff('0x3b');return db[_0xf5ff('0x5c')]['find']({'where':{'name':_0x340554,'userProfileId':_0x27430c[_0xf5ff('0x5d')]},'raw':!![]})[_0xf5ff('0x21')](function(_0x2b4972){if(_0x2b4972&&_0x2b4972[_0xf5ff('0x5e')]===0x0){return db[_0xf5ff('0x5f')][_0xf5ff('0x58')]({'name':_0x5ca10a[_0xf5ff('0x3d')],'resourceId':_0x5ca10a['id'],'type':_0x2b4972[_0xf5ff('0x3d')],'sectionId':_0x2b4972['id']},{})[_0xf5ff('0x21')](function(){return _0x112467;});}else{return _0x112467;}})['catch'](function(_0x57a72c){logger[_0xf5ff('0x26')](_0xf5ff('0x60'),_0x57a72c);throw _0x57a72c;});}return _0x112467;})['then'](respondWithResult(_0x2bd286,0xc9))['catch'](handleError(_0x2bd286,null));};exports['update']=function(_0x153656,_0x44303a){if(_0x153656[_0xf5ff('0x61')]['id']){delete _0x153656[_0xf5ff('0x61')]['id'];}return db[_0xf5ff('0x41')][_0xf5ff('0x62')]({'where':{'id':_0x153656[_0xf5ff('0x63')]['id']}})[_0xf5ff('0x21')](handleEntityNotFound(_0x44303a,null))[_0xf5ff('0x21')](saveUpdates(_0x153656[_0xf5ff('0x61')],null))[_0xf5ff('0x21')](respondWithResult(_0x44303a,null))[_0xf5ff('0x2b')](handleError(_0x44303a,null));};exports[_0xf5ff('0x39')]=function(_0x5bcdfc,_0x584772){return db[_0xf5ff('0x41')][_0xf5ff('0x62')]({'where':{'id':_0x5bcdfc['params']['id']}})[_0xf5ff('0x21')](handleEntityNotFound(_0x584772,null))['then'](removeEntity(_0x584772,null))[_0xf5ff('0x2b')](handleError(_0x584772,null));};exports[_0xf5ff('0x64')]=function(_0x4baa75,_0x1cb4e0){return db[_0xf5ff('0x41')][_0xf5ff('0x64')]()['then'](respondWithResult(_0x1cb4e0,null))[_0xf5ff('0x2b')](handleError(_0x1cb4e0,null));};exports[_0xf5ff('0x65')]=function(_0x1755c2,_0x1c4266,_0x26131a){var _0x1cb52e={'raw':!![],'where':{}},_0x4c7a12={},_0x491d20;return db['ChatQueue'][_0xf5ff('0x66')]({'where':{'id':_0x1755c2[_0xf5ff('0x63')]['id']}})[_0xf5ff('0x21')](handleEntityNotFound(_0x1c4266,null))[_0xf5ff('0x21')](function(_0x5494a3){if(_0x5494a3){_0x491d20=_0x5494a3[_0xf5ff('0x3a')]({'plain':!![]});_0x4c7a12[_0xf5ff('0x47')]=_[_0xf5ff('0x45')](db['UserChatQueue']['rawAttributes']);_0x4c7a12[_0xf5ff('0x44')]=_[_0xf5ff('0x45')](_0x1755c2[_0xf5ff('0x44')]);_0x4c7a12[_0xf5ff('0x46')]=_[_0xf5ff('0x49')](_0x4c7a12[_0xf5ff('0x47')],_0x4c7a12['query']);_0x1cb52e[_0xf5ff('0x48')]=_[_0xf5ff('0x49')](_0x4c7a12[_0xf5ff('0x47')],qs[_0xf5ff('0x4a')](_0x1755c2['query'][_0xf5ff('0x4a')]));_0x1cb52e['attributes']=_0x1cb52e[_0xf5ff('0x48')][_0xf5ff('0x4b')]?_0x1cb52e[_0xf5ff('0x48')]:_0x4c7a12[_0xf5ff('0x47')];if(!_0x1755c2['query'][_0xf5ff('0x4c')]('nolimit')){_0x1cb52e['limit']=qs[_0xf5ff('0x32')](_0x1755c2[_0xf5ff('0x44')][_0xf5ff('0x32')]);_0x1cb52e[_0xf5ff('0x30')]=qs[_0xf5ff('0x30')](_0x1755c2[_0xf5ff('0x44')][_0xf5ff('0x30')]);}_0x1cb52e[_0xf5ff('0x4d')]=qs[_0xf5ff('0x4e')](_0x1755c2['query'][_0xf5ff('0x4e')]);_0x1cb52e[_0xf5ff('0x4f')]=qs[_0xf5ff('0x46')](_[_0xf5ff('0x50')](_0x1755c2[_0xf5ff('0x44')],_0x4c7a12[_0xf5ff('0x46')]));_0x1cb52e['where'][_0xf5ff('0x67')]=_0x5494a3['id'];if(_0x1755c2[_0xf5ff('0x44')][_0xf5ff('0x51')]){_0x1cb52e[_0xf5ff('0x4f')]=_[_0xf5ff('0x52')](_0x1cb52e[_0xf5ff('0x4f')],{'$or':_['map'](_0x1cb52e[_0xf5ff('0x48')],function(_0x241ea7){var _0xe08e63={};_0xe08e63[_0x241ea7]={'$like':'%'+_0x1755c2[_0xf5ff('0x44')]['filter']+'%'};return _0xe08e63;})});}_0x1cb52e=_[_0xf5ff('0x52')]({},_0x1cb52e,_0x1755c2[_0xf5ff('0x55')]);return db[_0xf5ff('0x68')]['findAll'](_0x1cb52e);}})[_0xf5ff('0x21')](function(_0x40c3d7){if(_0x40c3d7){return db[_0xf5ff('0x69')]['findAndCountAll']({'where':{'id':_[_0xf5ff('0x40')](_0x40c3d7,'UserId'),'role':'agent'},'attributes':['id',_0xf5ff('0x3d'),_0xf5ff('0x6a'),_0xf5ff('0x6b'),_0xf5ff('0x6c')]});}})[_0xf5ff('0x21')](function(_0x525b87){if(_0x525b87){return{'count':_0x525b87['count'],'rows':_['map'](_0x525b87[_0xf5ff('0x6d')],function(_0x4f1b47){return{'membername':_0x4f1b47[_0xf5ff('0x3d')],'UserId':_0x4f1b47['id'],'queue_name':_0x491d20[_0xf5ff('0x3d')],'ChatQueueId':_0x491d20['id'],'interface':util[_0xf5ff('0x6e')]('%s/%s',_0xf5ff('0x6f'),_0x4f1b47[_0xf5ff('0x3d')]),'penalty':0x0,'paused':_0x4f1b47[_0xf5ff('0x6a')],'createdAt':_0x4f1b47[_0xf5ff('0x6c')],'updatedAt':_0x4f1b47[_0xf5ff('0x6b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xf5ff('0x21')](respondWithFilteredResult(_0x1c4266,_0x1cb52e))[_0xf5ff('0x2b')](handleError(_0x1c4266,null));};exports[_0xf5ff('0x70')]=function(_0x352c0d,_0x246ba2,_0x2c3543){var _0xaca333={};var _0x135533={};var _0x448525;var _0x4c6a1a;return db[_0xf5ff('0x41')][_0xf5ff('0x66')]({'where':{'id':_0x352c0d[_0xf5ff('0x63')]['id']}})['then'](handleEntityNotFound(_0x246ba2,null))[_0xf5ff('0x21')](function(_0x15351b){if(_0x15351b){_0x448525=_0x15351b;_0x135533[_0xf5ff('0x47')]=_['keys'](db['Team'][_0xf5ff('0x42')]);_0x135533['query']=_['keys'](_0x352c0d[_0xf5ff('0x44')]);_0x135533[_0xf5ff('0x46')]=_[_0xf5ff('0x49')](_0x135533[_0xf5ff('0x47')],_0x135533[_0xf5ff('0x44')]);_0xaca333[_0xf5ff('0x48')]=_[_0xf5ff('0x49')](_0x135533[_0xf5ff('0x47')],qs['fields'](_0x352c0d[_0xf5ff('0x44')][_0xf5ff('0x4a')]));_0xaca333[_0xf5ff('0x48')]=_0xaca333[_0xf5ff('0x48')][_0xf5ff('0x4b')]?_0xaca333[_0xf5ff('0x48')]:_0x135533['model'];_0xaca333[_0xf5ff('0x4d')]=qs['sort'](_0x352c0d[_0xf5ff('0x44')][_0xf5ff('0x4e')]);_0xaca333[_0xf5ff('0x4f')]=qs[_0xf5ff('0x46')](_['pick'](_0x352c0d['query'],_0x135533['filters']));if(_0x352c0d['query'][_0xf5ff('0x51')]){_0xaca333[_0xf5ff('0x4f')]=_['merge'](_0xaca333[_0xf5ff('0x4f')],{'$or':_[_0xf5ff('0x40')](_0xaca333[_0xf5ff('0x48')],function(_0x376941){var _0x2a30f1={};_0x2a30f1[_0x376941]={'$like':'%'+_0x352c0d[_0xf5ff('0x44')][_0xf5ff('0x51')]+'%'};return _0x2a30f1;})});}_0xaca333=_[_0xf5ff('0x52')]({},_0xaca333,_0x352c0d[_0xf5ff('0x55')]);return _0x448525[_0xf5ff('0x70')](_0xaca333);}})[_0xf5ff('0x21')](function(_0x4e1aca){if(_0x4e1aca){_0x4c6a1a=_0x4e1aca[_0xf5ff('0x4b')];if(!_0x352c0d['query'][_0xf5ff('0x4c')](_0xf5ff('0x71'))){_0xaca333[_0xf5ff('0x32')]=qs[_0xf5ff('0x32')](_0x352c0d[_0xf5ff('0x44')][_0xf5ff('0x32')]);_0xaca333[_0xf5ff('0x30')]=qs[_0xf5ff('0x30')](_0x352c0d[_0xf5ff('0x44')][_0xf5ff('0x30')]);}return _0x448525[_0xf5ff('0x70')](_0xaca333);}})['then'](function(_0x2e2e0a){if(_0x2e2e0a){return _0x2e2e0a?{'count':_0x4c6a1a,'rows':_0x2e2e0a}:null;}})[_0xf5ff('0x21')](respondWithResult(_0x246ba2,null))[_0xf5ff('0x2b')](handleError(_0x246ba2,null));};exports['addTeams']=function(_0x4d173c,_0x3ed8df,_0x30cc76){var _0x4e963f=_0x4d173c[_0xf5ff('0x61')][_0xf5ff('0x72')];return db['Team'][_0xf5ff('0x73')]({'where':{'id':_0x4e963f},'attributes':['id'],'include':[{'model':db[_0xf5ff('0x69')],'as':_0xf5ff('0x74'),'attributes':['id',_0xf5ff('0x3d'),_0xf5ff('0x75'),'voicePause',_0xf5ff('0x76')],'raw':!![]}]})[_0xf5ff('0x21')](function(_0x19a3a4){if(_0x19a3a4){var _0x15fe6e=_['flatMap'](_0x19a3a4,function(_0x51f096){var _0x3a638e=_0x51f096['get']({'plain':!![]});return _0x3a638e[_0xf5ff('0x74')];});return db['ChatQueue'][_0xf5ff('0x62')]({'where':{'id':_0x4d173c[_0xf5ff('0x63')]['id']}})['then'](function(_0x5341e4){return db[_0xf5ff('0x77')][_0xf5ff('0x78')](function(_0x555c74){return _0x5341e4['addTeams'](_0x4e963f,{'transaction':_0x555c74})[_0xf5ff('0x21')](function(){return BPromise[_0xf5ff('0x79')](_0x15fe6e,function(_0x1d3557){return db['UserChatQueue'][_0xf5ff('0x7a')]({'where':{'UserId':_0x1d3557['id'],'ChatQueueId':_0x4d173c[_0xf5ff('0x63')]['id']},'transaction':_0x555c74});});})['then'](function(){_0x15fe6e[_0xf5ff('0x7b')](function(_0x4121b3){socket['emit'](_0xf5ff('0x7c'),{'UserId':_0x4121b3['id'],'ChatQueueId':_0x5341e4['id']});});});});});}})[_0xf5ff('0x21')](respondWithStatusCode(_0x3ed8df,null))[_0xf5ff('0x2b')](handleError(_0x3ed8df,null));};exports[_0xf5ff('0x7d')]=function(_0x330203,_0x489153,_0x375853){return db[_0xf5ff('0x7e')][_0xf5ff('0x73')]({'where':{'id':_0x330203[_0xf5ff('0x44')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0xf5ff('0x74'),'attributes':['id'],'raw':!![]}]})[_0xf5ff('0x21')](handleEntityNotFound(_0x489153,null))[_0xf5ff('0x21')](function(_0xf35705){var _0x3293d6=_['map'](_0xf35705,'id');var _0x517e44=[];var _0x2ab075=[];var _0x13113f=squel[_0xf5ff('0x7f')]();_0x13113f[_0xf5ff('0x80')](_0xf5ff('0x81'))[_0xf5ff('0x82')]('team_has_chat_queues','tq')[_0xf5ff('0x83')](_0xf5ff('0x84'),'ut',_0xf5ff('0x85'))[_0xf5ff('0x4f')](_0xf5ff('0x86'),_0x330203['params']['id']);for(var _0x3f504c=0x0;_0x3f504c<_0xf35705[_0xf5ff('0x4b')];_0x3f504c+=0x1){let _0x5cd5b7=_0xf35705[_0x3f504c];for(var _0x45d2a6=0x0;_0x45d2a6<_0x5cd5b7[_0xf5ff('0x74')][_0xf5ff('0x4b')];_0x45d2a6+=0x1){let _0x5b4dfc=_0x5cd5b7[_0xf5ff('0x74')][_0x45d2a6];var _0x11485c=_0x13113f[_0xf5ff('0x87')]();_0x11485c[_0xf5ff('0x4f')](_0xf5ff('0x88'),_0x5b4dfc['id']);_0x2ab075['push'](db[_0xf5ff('0x77')][_0xf5ff('0x44')](_0x11485c[_0xf5ff('0x89')](),{'type':db[_0xf5ff('0x77')][_0xf5ff('0x8a')][_0xf5ff('0x8b')]})[_0xf5ff('0x21')](function(_0x57e552){if(_0x57e552[_0xf5ff('0x4b')]===0x1){return _0x5b4dfc['id'];}else{var _0x4bb31b=_[_0xf5ff('0x8c')](_[_0xf5ff('0x40')](_0x57e552,_0xf5ff('0x8d')),function(_0x4d6874){return _[_0xf5ff('0x8e')](_0x3293d6,_0x4d6874);});if(_0x4bb31b){return _0x5b4dfc['id'];}}}));}}return BPromise['all'](_0x2ab075)[_0xf5ff('0x21')](function(_0x3f91ed){_0x517e44=_(_0x517e44)[_0xf5ff('0x8f')](_0x3f91ed)[_0xf5ff('0x90')]()[_0xf5ff('0x91')]();return db[_0xf5ff('0x41')][_0xf5ff('0x62')]({'where':{'id':_0x330203[_0xf5ff('0x63')]['id']}})[_0xf5ff('0x21')](function(_0x3ed309){return db['sequelize']['transaction'](function(_0x3864f6){return _0x3ed309['removeTeams'](_0x330203[_0xf5ff('0x44')][_0xf5ff('0x72')],{'transaction':_0x3864f6})['then'](function(){if(!_[_0xf5ff('0x92')](_0x517e44)){return _0x3ed309[_0xf5ff('0x93')](_0x517e44,{'transaction':_0x3864f6});}})[_0xf5ff('0x21')](function(){_0x517e44['forEach'](function(_0x4cbf53){socket[_0xf5ff('0x94')](_0xf5ff('0x95'),{'UserId':_0x4cbf53,'ChatQueueId':_0x3ed309['id']});});});});});});})[_0xf5ff('0x21')](respondWithStatusCode(_0x489153,null))['catch'](handleError(_0x489153,null));};exports[_0xf5ff('0x96')]=function(_0x293862,_0x4e212d,_0x50d740){return db[_0xf5ff('0x41')][_0xf5ff('0x62')]({'where':{'id':_0x293862['params']['id']}})['then'](handleEntityNotFound(_0x4e212d,null))['then'](function(_0x66ffc8){if(_0x66ffc8){return _0x66ffc8['addAgents'](_0x293862[_0xf5ff('0x61')]['ids'],_[_0xf5ff('0x97')](_0x293862[_0xf5ff('0x61')],[_0xf5ff('0x72'),'id'])||{})['spread'](function(_0x14ccfc){for(var _0x241707=0x0;_0x241707<_0x293862[_0xf5ff('0x61')]['ids'][_0xf5ff('0x4b')];_0x241707+=0x1){socket[_0xf5ff('0x94')](_0xf5ff('0x7c'),{'UserId':Number(_0x293862[_0xf5ff('0x61')][_0xf5ff('0x72')][_0x241707]),'ChatQueueId':Number(_0x293862['params']['id'])});}return _0x14ccfc;});}})[_0xf5ff('0x21')](respondWithResult(_0x4e212d,null))[_0xf5ff('0x2b')](handleError(_0x4e212d,null));};exports[_0xf5ff('0x93')]=function(_0x17332e,_0x249625,_0x38d4d0){return db[_0xf5ff('0x41')]['find']({'where':{'id':_0x17332e[_0xf5ff('0x63')]['id']}})[_0xf5ff('0x21')](handleEntityNotFound(_0x249625,null))[_0xf5ff('0x21')](function(_0x3f0c3c){if(_0x3f0c3c){return _0x3f0c3c['removeAgents'](_0x17332e[_0xf5ff('0x44')]['ids'])['then'](function(){if(_['isArray'](_0x17332e['query'][_0xf5ff('0x72')])){for(var _0xaafb70=0x0;_0xaafb70<_0x17332e[_0xf5ff('0x44')][_0xf5ff('0x72')][_0xf5ff('0x4b')];_0xaafb70+=0x1){socket[_0xf5ff('0x94')](_0xf5ff('0x95'),{'UserId':Number(_0x17332e['query'][_0xf5ff('0x72')][_0xaafb70]),'ChatQueueId':Number(_0x17332e[_0xf5ff('0x63')]['id'])});}}else{socket[_0xf5ff('0x94')](_0xf5ff('0x95'),{'UserId':Number(_0x17332e[_0xf5ff('0x44')][_0xf5ff('0x72')]),'ChatQueueId':Number(_0x17332e[_0xf5ff('0x63')]['id'])});}});}})[_0xf5ff('0x21')](respondWithStatusCode(_0x249625,null))['catch'](handleError(_0x249625,null));};exports[_0xf5ff('0x98')]=function(_0x2e6004,_0x15c155,_0x43227c){var _0x70958f={};var _0x3dac8e={};var _0x3b7f7e;var _0x71a73b;return db[_0xf5ff('0x41')][_0xf5ff('0x66')]({'where':{'id':_0x2e6004[_0xf5ff('0x63')]['id']}})[_0xf5ff('0x21')](handleEntityNotFound(_0x15c155,null))[_0xf5ff('0x21')](function(_0x5cc0f5){if(_0x5cc0f5){_0x3b7f7e=_0x5cc0f5;_0x3dac8e['model']=_['keys'](db[_0xf5ff('0x69')][_0xf5ff('0x42')]);_0x3dac8e[_0xf5ff('0x44')]=_[_0xf5ff('0x45')](_0x2e6004[_0xf5ff('0x44')]);_0x3dac8e[_0xf5ff('0x46')]=_[_0xf5ff('0x49')](_0x3dac8e['model'],_0x3dac8e['query']);_0x70958f[_0xf5ff('0x48')]=_[_0xf5ff('0x49')](_0x3dac8e[_0xf5ff('0x47')],qs[_0xf5ff('0x4a')](_0x2e6004[_0xf5ff('0x44')]['fields']));_0x70958f[_0xf5ff('0x48')]=_0x70958f[_0xf5ff('0x48')][_0xf5ff('0x4b')]?_0x70958f[_0xf5ff('0x48')]:_0x3dac8e[_0xf5ff('0x47')];_0x70958f['order']=qs[_0xf5ff('0x4e')](_0x2e6004['query'][_0xf5ff('0x4e')]);_0x70958f['where']=qs[_0xf5ff('0x46')](_[_0xf5ff('0x50')](_0x2e6004[_0xf5ff('0x44')],_0x3dac8e[_0xf5ff('0x46')]));if(_0x2e6004[_0xf5ff('0x44')][_0xf5ff('0x51')]){_0x70958f['where']=_[_0xf5ff('0x52')](_0x70958f[_0xf5ff('0x4f')],{'$or':_[_0xf5ff('0x40')](_0x70958f['attributes'],function(_0x5ec7bd){var _0x11fb97={};_0x11fb97[_0x5ec7bd]={'$like':'%'+_0x2e6004[_0xf5ff('0x44')][_0xf5ff('0x51')]+'%'};return _0x11fb97;})});}_0x70958f=_['merge']({},_0x70958f,_0x2e6004[_0xf5ff('0x55')]);return _0x3b7f7e[_0xf5ff('0x98')](_0x70958f);}})['then'](function(_0x57875e){if(_0x57875e){_0x71a73b=_0x57875e[_0xf5ff('0x4b')];if(!_0x2e6004[_0xf5ff('0x44')][_0xf5ff('0x4c')](_0xf5ff('0x71'))){_0x70958f['limit']=qs['limit'](_0x2e6004[_0xf5ff('0x44')][_0xf5ff('0x32')]);_0x70958f['offset']=qs[_0xf5ff('0x30')](_0x2e6004[_0xf5ff('0x44')]['offset']);}return _0x3b7f7e[_0xf5ff('0x98')](_0x70958f);}})[_0xf5ff('0x21')](function(_0x4b9c02){if(_0x4b9c02){return _0x4b9c02?{'count':_0x71a73b,'rows':_0x4b9c02}:null;}})[_0xf5ff('0x21')](respondWithResult(_0x15c155,null))[_0xf5ff('0x2b')](handleError(_0x15c155,null));}; \ No newline at end of file +var _0x5c10=['fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatQueues','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','ChatQueueId','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','Agents','online','voicePause','sequelize','transaction','each','findOrCreate','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','every','TeamId','includes','all','value','removeAgents','forEach','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','zip-dir','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','redis','register','client','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','destroy','get','stack','name','send','index','map','ChatQueue'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0x5c10,0x183));var _0x05c1=function(_0x4c159d,_0x362975){_0x4c159d=_0x4c159d-0x0;var _0x363683=_0x5c10[_0x4c159d];return _0x363683;};'use strict';var emlformat=require(_0x05c1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x05c1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x05c1('0x2'));var BPromise=require(_0x05c1('0x3'));var Mustache=require('mustache');var util=require(_0x05c1('0x4'));var path=require(_0x05c1('0x5'));var sox=require('sox');var csv=require(_0x05c1('0x6'));var ejs=require(_0x05c1('0x7'));var fs=require('fs');var fs_extra=require(_0x05c1('0x8'));var _=require(_0x05c1('0x9'));var squel=require('squel');var crypto=require(_0x05c1('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x05c1('0xb'));var toCsv=require(_0x05c1('0x6'));var querystring=require('querystring');var Papa=require(_0x05c1('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x05c1('0xd'));var as=require(_0x05c1('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x05c1('0xf'));var config=require(_0x05c1('0x10'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x05c1('0x11')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x05c1('0x11')]));require('./chatQueue.socket')[_0x05c1('0x12')](socket);var jayson=require('jayson/promise');var client=jayson[_0x05c1('0x13')]['http']({'port':0x232a});function respondWithRpcPromise(_0x83f51,_0x5f38c9,_0x2839ca,_0x7993dd){return new BPromise(function(_0x36bd4f,_0x838b48){var _0x405c3d=_0x7993dd||client;return _0x405c3d[_0x05c1('0x14')](_0x83f51,_0x2839ca)[_0x05c1('0x15')](function(_0x575b8d){logger[_0x05c1('0x16')](_0x05c1('0x17'),_0x5f38c9,_0x05c1('0x18'));logger['debug'](_0x05c1('0x19'),_0x5f38c9,'request\x20sent',JSON[_0x05c1('0x1a')](_0x575b8d));if(_0x575b8d[_0x05c1('0x1b')]){if(_0x575b8d[_0x05c1('0x1b')][_0x05c1('0x1c')]===0x1f4){logger[_0x05c1('0x1b')](_0x05c1('0x17'),_0x5f38c9,_0x575b8d[_0x05c1('0x1b')]['message']);return _0x838b48(_0x575b8d[_0x05c1('0x1b')]['message']);}logger['error'](_0x05c1('0x17'),_0x5f38c9,_0x575b8d[_0x05c1('0x1b')][_0x05c1('0x1d')]);return _0x36bd4f(_0x575b8d[_0x05c1('0x1b')]['message']);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x5f38c9,_0x05c1('0x18'));_0x36bd4f(_0x575b8d['result'][_0x05c1('0x1d')]);}})['catch'](function(_0x3175e6){logger['error'](_0x05c1('0x17'),_0x5f38c9,_0x3175e6);_0x838b48(_0x3175e6);});});}function respondWithStatusCode(_0x41720d,_0x4abc1d){_0x4abc1d=_0x4abc1d||0xcc;return function(_0x833a6b){if(_0x833a6b){return _0x41720d[_0x05c1('0x1e')](_0x4abc1d);}return _0x41720d[_0x05c1('0x1f')](_0x4abc1d)[_0x05c1('0x20')]();};}function respondWithResult(_0x1ef51f,_0x38237e){_0x38237e=_0x38237e||0xc8;return function(_0x39f1a7){if(_0x39f1a7){return _0x1ef51f[_0x05c1('0x1f')](_0x38237e)[_0x05c1('0x21')](_0x39f1a7);}};}function respondWithFilteredResult(_0x16d4c1,_0x4872e3){return function(_0x233577){if(_0x233577){var _0x239255=typeof _0x4872e3[_0x05c1('0x22')]==='undefined'&&typeof _0x4872e3[_0x05c1('0x23')]===_0x05c1('0x24');var _0x469d88=_0x233577[_0x05c1('0x25')];var _0x3a41a3=_0x239255?0x0:_0x4872e3['offset'];var _0x156e6c=_0x239255?_0x233577[_0x05c1('0x25')]:_0x4872e3[_0x05c1('0x22')]+_0x4872e3[_0x05c1('0x23')];var _0x1b8da3;if(_0x156e6c>=_0x469d88){_0x156e6c=_0x469d88;_0x1b8da3=0xc8;}else{_0x1b8da3=0xce;}_0x16d4c1[_0x05c1('0x1f')](_0x1b8da3);return _0x16d4c1[_0x05c1('0x26')](_0x05c1('0x27'),_0x3a41a3+'-'+_0x156e6c+'/'+_0x469d88)[_0x05c1('0x21')](_0x233577);}return null;};}function patchUpdates(_0x252e41){return function(_0x265467){try{jsonpatch[_0x05c1('0x28')](_0x265467,_0x252e41,!![]);}catch(_0x29e690){return BPromise[_0x05c1('0x29')](_0x29e690);}return _0x265467['save']();};}function saveUpdates(_0x587d47,_0x2d2805){return function(_0x22266d){if(_0x22266d){return _0x22266d[_0x05c1('0x2a')](_0x587d47)[_0x05c1('0x15')](function(_0x3c715e){return _0x3c715e;});}return null;};}function removeEntity(_0x61ca37,_0x1f9970){return function(_0x4e658b){if(_0x4e658b){return _0x4e658b[_0x05c1('0x2b')]()[_0x05c1('0x15')](function(){var _0x4c2f9c=_0x4e658b[_0x05c1('0x2c')]({'plain':!![]});var _0x420e60='ChatQueues';return db['UserProfileResource'][_0x05c1('0x2b')]({'where':{'type':_0x420e60,'resourceId':_0x4c2f9c['id']}})[_0x05c1('0x15')](function(){return _0x4e658b;});})[_0x05c1('0x15')](function(){_0x61ca37[_0x05c1('0x1f')](0xcc)[_0x05c1('0x20')]();});}};}function handleEntityNotFound(_0x9b3796,_0x3c139e){return function(_0x5fc8f1){if(!_0x5fc8f1){_0x9b3796[_0x05c1('0x1e')](0x194);}return _0x5fc8f1;};}function handleError(_0x1b20de,_0x2a4f34){_0x2a4f34=_0x2a4f34||0x1f4;return function(_0x113ce3){logger[_0x05c1('0x1b')](_0x113ce3[_0x05c1('0x2d')]);if(_0x113ce3[_0x05c1('0x2e')]){delete _0x113ce3[_0x05c1('0x2e')];}_0x1b20de[_0x05c1('0x1f')](_0x2a4f34)[_0x05c1('0x2f')](_0x113ce3);};}exports[_0x05c1('0x30')]=function(_0x57e7e3,_0x44be9f){var _0x24f2fe={},_0x45b7b3={},_0x35d855={'count':0x0,'rows':[]};var _0x359c56=_[_0x05c1('0x31')](db[_0x05c1('0x32')]['rawAttributes'],function(_0x4b3f7e){return{'name':_0x4b3f7e[_0x05c1('0x33')],'type':_0x4b3f7e[_0x05c1('0x34')][_0x05c1('0x35')]};});_0x45b7b3[_0x05c1('0x36')]=_['map'](_0x359c56,_0x05c1('0x2e'));_0x45b7b3['query']=_[_0x05c1('0x37')](_0x57e7e3[_0x05c1('0x38')]);_0x45b7b3['filters']=_[_0x05c1('0x39')](_0x45b7b3['model'],_0x45b7b3['query']);_0x24f2fe[_0x05c1('0x3a')]=_[_0x05c1('0x39')](_0x45b7b3[_0x05c1('0x36')],qs[_0x05c1('0x3b')](_0x57e7e3[_0x05c1('0x38')][_0x05c1('0x3b')]));_0x24f2fe[_0x05c1('0x3a')]=_0x24f2fe[_0x05c1('0x3a')][_0x05c1('0x3c')]?_0x24f2fe[_0x05c1('0x3a')]:_0x45b7b3[_0x05c1('0x36')];if(!_0x57e7e3['query'][_0x05c1('0x3d')](_0x05c1('0x3e'))){_0x24f2fe['limit']=qs[_0x05c1('0x23')](_0x57e7e3[_0x05c1('0x38')]['limit']);_0x24f2fe[_0x05c1('0x22')]=qs['offset'](_0x57e7e3[_0x05c1('0x38')]['offset']);}_0x24f2fe[_0x05c1('0x3f')]=qs[_0x05c1('0x40')](_0x57e7e3['query'][_0x05c1('0x40')]);_0x24f2fe[_0x05c1('0x41')]=qs[_0x05c1('0x42')](_[_0x05c1('0x43')](_0x57e7e3[_0x05c1('0x38')],_0x45b7b3[_0x05c1('0x42')]),_0x359c56);if(_0x57e7e3[_0x05c1('0x38')][_0x05c1('0x44')]){_0x24f2fe[_0x05c1('0x41')]=_[_0x05c1('0x45')](_0x24f2fe[_0x05c1('0x41')],{'$or':_[_0x05c1('0x31')](_0x359c56,function(_0x4d4db0){if(_0x4d4db0['type']!==_0x05c1('0x46')){var _0x129b04={};_0x129b04[_0x4d4db0[_0x05c1('0x2e')]]={'$like':'%'+_0x57e7e3[_0x05c1('0x38')]['filter']+'%'};return _0x129b04;}})});}_0x24f2fe=_[_0x05c1('0x45')]({},_0x24f2fe,_0x57e7e3[_0x05c1('0x47')]);var _0x21c562={'where':_0x24f2fe[_0x05c1('0x41')]};return db[_0x05c1('0x32')]['count'](_0x21c562)[_0x05c1('0x15')](function(_0xa16f77){_0x35d855[_0x05c1('0x25')]=_0xa16f77;if(_0x57e7e3['query'][_0x05c1('0x48')]){_0x24f2fe[_0x05c1('0x49')]=[{'all':!![]}];}return db[_0x05c1('0x32')][_0x05c1('0x4a')](_0x24f2fe);})[_0x05c1('0x15')](function(_0xf359d9){_0x35d855[_0x05c1('0x4b')]=_0xf359d9;return _0x35d855;})[_0x05c1('0x15')](respondWithFilteredResult(_0x44be9f,_0x24f2fe))[_0x05c1('0x4c')](handleError(_0x44be9f,null));};exports[_0x05c1('0x4d')]=function(_0x1dc4cb,_0x4bde06){var _0x2c0c6b={'raw':!![],'where':{'id':_0x1dc4cb[_0x05c1('0x4e')]['id']}},_0x916b07={};_0x916b07[_0x05c1('0x36')]=_['keys'](db[_0x05c1('0x32')][_0x05c1('0x4f')]);_0x916b07[_0x05c1('0x38')]=_[_0x05c1('0x37')](_0x1dc4cb[_0x05c1('0x38')]);_0x916b07[_0x05c1('0x42')]=_[_0x05c1('0x39')](_0x916b07[_0x05c1('0x36')],_0x916b07[_0x05c1('0x38')]);_0x2c0c6b[_0x05c1('0x3a')]=_['intersection'](_0x916b07[_0x05c1('0x36')],qs[_0x05c1('0x3b')](_0x1dc4cb['query'][_0x05c1('0x3b')]));_0x2c0c6b[_0x05c1('0x3a')]=_0x2c0c6b[_0x05c1('0x3a')]['length']?_0x2c0c6b[_0x05c1('0x3a')]:_0x916b07[_0x05c1('0x36')];if(_0x1dc4cb['query'][_0x05c1('0x48')]){_0x2c0c6b[_0x05c1('0x49')]=[{'all':!![]}];}_0x2c0c6b=_[_0x05c1('0x45')]({},_0x2c0c6b,_0x1dc4cb[_0x05c1('0x47')]);return db[_0x05c1('0x32')][_0x05c1('0x50')](_0x2c0c6b)[_0x05c1('0x15')](handleEntityNotFound(_0x4bde06,null))['then'](respondWithResult(_0x4bde06,null))[_0x05c1('0x4c')](handleError(_0x4bde06,null));};exports[_0x05c1('0x51')]=function(_0x106d18,_0x37fdd5){return db[_0x05c1('0x32')][_0x05c1('0x51')](_0x106d18[_0x05c1('0x52')],{})[_0x05c1('0x15')](function(_0x20d433){var _0x1dc0dd=_0x106d18[_0x05c1('0x53')]['get']({'plain':!![]});if(!_0x1dc0dd)throw new Error(_0x05c1('0x54'));if(_0x1dc0dd[_0x05c1('0x55')]===_0x05c1('0x53')){var _0x4628fb=_0x20d433[_0x05c1('0x2c')]({'plain':!![]});var _0x24f28f=_0x05c1('0x56');return db[_0x05c1('0x57')][_0x05c1('0x50')]({'where':{'name':_0x24f28f,'userProfileId':_0x1dc0dd[_0x05c1('0x58')]},'raw':!![]})[_0x05c1('0x15')](function(_0xccd1de){if(_0xccd1de&&_0xccd1de[_0x05c1('0x59')]===0x0){return db[_0x05c1('0x5a')][_0x05c1('0x51')]({'name':_0x4628fb[_0x05c1('0x2e')],'resourceId':_0x4628fb['id'],'type':_0xccd1de['name'],'sectionId':_0xccd1de['id']},{})[_0x05c1('0x15')](function(){return _0x20d433;});}else{return _0x20d433;}})[_0x05c1('0x4c')](function(_0x5514f9){logger[_0x05c1('0x1b')](_0x05c1('0x5b'),_0x5514f9);throw _0x5514f9;});}return _0x20d433;})['then'](respondWithResult(_0x37fdd5,0xc9))[_0x05c1('0x4c')](handleError(_0x37fdd5,null));};exports[_0x05c1('0x2a')]=function(_0x7cfc55,_0x372bb4){if(_0x7cfc55[_0x05c1('0x52')]['id']){delete _0x7cfc55[_0x05c1('0x52')]['id'];}return db['ChatQueue']['find']({'where':{'id':_0x7cfc55['params']['id']}})[_0x05c1('0x15')](handleEntityNotFound(_0x372bb4,null))[_0x05c1('0x15')](saveUpdates(_0x7cfc55[_0x05c1('0x52')],null))[_0x05c1('0x15')](respondWithResult(_0x372bb4,null))[_0x05c1('0x4c')](handleError(_0x372bb4,null));};exports[_0x05c1('0x2b')]=function(_0x350c6e,_0x1f01f6){return db[_0x05c1('0x32')][_0x05c1('0x50')]({'where':{'id':_0x350c6e[_0x05c1('0x4e')]['id']}})[_0x05c1('0x15')](handleEntityNotFound(_0x1f01f6,null))[_0x05c1('0x15')](removeEntity(_0x1f01f6,null))['catch'](handleError(_0x1f01f6,null));};exports[_0x05c1('0x5c')]=function(_0x3cf522,_0x14fccd){return db['ChatQueue'][_0x05c1('0x5c')]()['then'](respondWithResult(_0x14fccd,null))[_0x05c1('0x4c')](handleError(_0x14fccd,null));};exports[_0x05c1('0x5d')]=function(_0x3e601d,_0x2d4327,_0x27fadf){var _0x2b5e1d={'raw':!![],'where':{}},_0x416541={},_0x3f06fc;return db[_0x05c1('0x32')][_0x05c1('0x5e')]({'where':{'id':_0x3e601d[_0x05c1('0x4e')]['id']}})[_0x05c1('0x15')](handleEntityNotFound(_0x2d4327,null))[_0x05c1('0x15')](function(_0x559a1a){if(_0x559a1a){_0x3f06fc=_0x559a1a[_0x05c1('0x2c')]({'plain':!![]});_0x416541[_0x05c1('0x36')]=_[_0x05c1('0x37')](db[_0x05c1('0x5f')][_0x05c1('0x4f')]);_0x416541[_0x05c1('0x38')]=_[_0x05c1('0x37')](_0x3e601d[_0x05c1('0x38')]);_0x416541['filters']=_[_0x05c1('0x39')](_0x416541[_0x05c1('0x36')],_0x416541[_0x05c1('0x38')]);_0x2b5e1d[_0x05c1('0x3a')]=_[_0x05c1('0x39')](_0x416541[_0x05c1('0x36')],qs[_0x05c1('0x3b')](_0x3e601d[_0x05c1('0x38')][_0x05c1('0x3b')]));_0x2b5e1d['attributes']=_0x2b5e1d[_0x05c1('0x3a')]['length']?_0x2b5e1d[_0x05c1('0x3a')]:_0x416541['model'];if(!_0x3e601d[_0x05c1('0x38')][_0x05c1('0x3d')](_0x05c1('0x3e'))){_0x2b5e1d['limit']=qs[_0x05c1('0x23')](_0x3e601d[_0x05c1('0x38')][_0x05c1('0x23')]);_0x2b5e1d['offset']=qs['offset'](_0x3e601d['query'][_0x05c1('0x22')]);}_0x2b5e1d[_0x05c1('0x3f')]=qs[_0x05c1('0x40')](_0x3e601d['query'][_0x05c1('0x40')]);_0x2b5e1d[_0x05c1('0x41')]=qs[_0x05c1('0x42')](_['pick'](_0x3e601d['query'],_0x416541[_0x05c1('0x42')]));_0x2b5e1d['where'][_0x05c1('0x60')]=_0x559a1a['id'];if(_0x3e601d['query']['filter']){_0x2b5e1d[_0x05c1('0x41')]=_[_0x05c1('0x45')](_0x2b5e1d[_0x05c1('0x41')],{'$or':_[_0x05c1('0x31')](_0x2b5e1d[_0x05c1('0x3a')],function(_0x3fa30b){var _0x1595d1={};_0x1595d1[_0x3fa30b]={'$like':'%'+_0x3e601d[_0x05c1('0x38')][_0x05c1('0x44')]+'%'};return _0x1595d1;})});}_0x2b5e1d=_[_0x05c1('0x45')]({},_0x2b5e1d,_0x3e601d[_0x05c1('0x47')]);return db['UserChatQueue'][_0x05c1('0x4a')](_0x2b5e1d);}})['then'](function(_0xf43f9b){if(_0xf43f9b){return db[_0x05c1('0x61')][_0x05c1('0x62')]({'where':{'id':_['map'](_0xf43f9b,_0x05c1('0x63')),'role':_0x05c1('0x64')},'attributes':['id',_0x05c1('0x2e'),_0x05c1('0x65'),_0x05c1('0x66'),_0x05c1('0x67')]});}})[_0x05c1('0x15')](function(_0x36fe84){if(_0x36fe84){return{'count':_0x36fe84[_0x05c1('0x25')],'rows':_['map'](_0x36fe84[_0x05c1('0x4b')],function(_0x4f25f9){return{'membername':_0x4f25f9[_0x05c1('0x2e')],'UserId':_0x4f25f9['id'],'queue_name':_0x3f06fc['name'],'ChatQueueId':_0x3f06fc['id'],'interface':util[_0x05c1('0x68')](_0x05c1('0x69'),_0x05c1('0x6a'),_0x4f25f9[_0x05c1('0x2e')]),'penalty':0x0,'paused':_0x4f25f9['chatPause'],'createdAt':_0x4f25f9[_0x05c1('0x67')],'updatedAt':_0x4f25f9[_0x05c1('0x66')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x2d4327,_0x2b5e1d))[_0x05c1('0x4c')](handleError(_0x2d4327,null));};exports[_0x05c1('0x6b')]=function(_0xebbf8,_0x57b128,_0x1ad7a2){var _0x832685={};var _0x5a4628={};var _0x2863ab;var _0x1a9a4d;return db[_0x05c1('0x32')]['findOne']({'where':{'id':_0xebbf8[_0x05c1('0x4e')]['id']}})[_0x05c1('0x15')](handleEntityNotFound(_0x57b128,null))[_0x05c1('0x15')](function(_0x9fcfc5){if(_0x9fcfc5){_0x2863ab=_0x9fcfc5;_0x5a4628['model']=_[_0x05c1('0x37')](db[_0x05c1('0x6c')][_0x05c1('0x4f')]);_0x5a4628['query']=_[_0x05c1('0x37')](_0xebbf8[_0x05c1('0x38')]);_0x5a4628['filters']=_[_0x05c1('0x39')](_0x5a4628[_0x05c1('0x36')],_0x5a4628['query']);_0x832685[_0x05c1('0x3a')]=_[_0x05c1('0x39')](_0x5a4628[_0x05c1('0x36')],qs[_0x05c1('0x3b')](_0xebbf8[_0x05c1('0x38')]['fields']));_0x832685[_0x05c1('0x3a')]=_0x832685[_0x05c1('0x3a')]['length']?_0x832685[_0x05c1('0x3a')]:_0x5a4628[_0x05c1('0x36')];_0x832685[_0x05c1('0x3f')]=qs[_0x05c1('0x40')](_0xebbf8[_0x05c1('0x38')][_0x05c1('0x40')]);_0x832685['where']=qs[_0x05c1('0x42')](_[_0x05c1('0x43')](_0xebbf8['query'],_0x5a4628[_0x05c1('0x42')]));if(_0xebbf8[_0x05c1('0x38')]['filter']){_0x832685[_0x05c1('0x41')]=_[_0x05c1('0x45')](_0x832685['where'],{'$or':_[_0x05c1('0x31')](_0x832685[_0x05c1('0x3a')],function(_0x1e3beb){var _0x72ddd3={};_0x72ddd3[_0x1e3beb]={'$like':'%'+_0xebbf8[_0x05c1('0x38')][_0x05c1('0x44')]+'%'};return _0x72ddd3;})});}_0x832685=_[_0x05c1('0x45')]({},_0x832685,_0xebbf8[_0x05c1('0x47')]);return _0x2863ab[_0x05c1('0x6b')](_0x832685);}})[_0x05c1('0x15')](function(_0x52739b){if(_0x52739b){_0x1a9a4d=_0x52739b[_0x05c1('0x3c')];if(!_0xebbf8[_0x05c1('0x38')][_0x05c1('0x3d')](_0x05c1('0x3e'))){_0x832685[_0x05c1('0x23')]=qs['limit'](_0xebbf8[_0x05c1('0x38')][_0x05c1('0x23')]);_0x832685[_0x05c1('0x22')]=qs[_0x05c1('0x22')](_0xebbf8[_0x05c1('0x38')][_0x05c1('0x22')]);}return _0x2863ab[_0x05c1('0x6b')](_0x832685);}})[_0x05c1('0x15')](function(_0x30419c){if(_0x30419c){return _0x30419c?{'count':_0x1a9a4d,'rows':_0x30419c}:null;}})[_0x05c1('0x15')](respondWithResult(_0x57b128,null))[_0x05c1('0x4c')](handleError(_0x57b128,null));};exports[_0x05c1('0x6d')]=function(_0x5e83cc,_0x2e2a12,_0x334273){var _0x483350=_0x5e83cc[_0x05c1('0x52')][_0x05c1('0x6e')];return db[_0x05c1('0x6c')][_0x05c1('0x4a')]({'where':{'id':_0x483350},'attributes':['id'],'include':[{'model':db[_0x05c1('0x61')],'as':_0x05c1('0x6f'),'attributes':['id',_0x05c1('0x2e'),_0x05c1('0x70'),_0x05c1('0x71'),'interface'],'raw':!![]}]})[_0x05c1('0x15')](function(_0x10b734){if(_0x10b734){var _0x271200=_['flatMap'](_0x10b734,function(_0xfd66d7){var _0x17d933=_0xfd66d7[_0x05c1('0x2c')]({'plain':!![]});return _0x17d933[_0x05c1('0x6f')];});return db['ChatQueue']['find']({'where':{'id':_0x5e83cc[_0x05c1('0x4e')]['id']}})['then'](function(_0x54788d){return db[_0x05c1('0x72')][_0x05c1('0x73')](function(_0xb35018){return _0x54788d['addTeams'](_0x483350,{'transaction':_0xb35018})[_0x05c1('0x15')](function(){return BPromise[_0x05c1('0x74')](_0x271200,function(_0x246fd9){return db[_0x05c1('0x5f')][_0x05c1('0x75')]({'where':{'UserId':_0x246fd9['id'],'ChatQueueId':_0x5e83cc['params']['id']},'transaction':_0xb35018});});})['then'](function(){_0x271200['forEach'](function(_0x424e23){socket[_0x05c1('0x76')](_0x05c1('0x77'),{'UserId':_0x424e23['id'],'ChatQueueId':_0x54788d['id']});});});});});}})[_0x05c1('0x15')](respondWithStatusCode(_0x2e2a12,null))['catch'](handleError(_0x2e2a12,null));};exports[_0x05c1('0x78')]=function(_0x8d484a,_0x412846,_0x4e2975){return db[_0x05c1('0x6c')][_0x05c1('0x4a')]({'where':{'id':_0x8d484a[_0x05c1('0x38')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x05c1('0x6f'),'attributes':['id'],'raw':!![]}]})[_0x05c1('0x15')](handleEntityNotFound(_0x412846,null))[_0x05c1('0x15')](function(_0xebe717){var _0x984e5e=_[_0x05c1('0x31')](_0xebe717,'id');var _0x5c0c79=[];var _0x4d0c9f=[];var _0x110823=squel[_0x05c1('0x79')]();_0x110823[_0x05c1('0x7a')](_0x05c1('0x7b'))[_0x05c1('0x7c')](_0x05c1('0x7d'),'tq')[_0x05c1('0x7e')](_0x05c1('0x7f'),'ut',_0x05c1('0x80'))['where']('ChatQueueId\x20=\x20?',_0x8d484a[_0x05c1('0x4e')]['id']);for(var _0x34ed34=0x0;_0x34ed34<_0xebe717[_0x05c1('0x3c')];_0x34ed34+=0x1){let _0x1acfec=_0xebe717[_0x34ed34];for(var _0x14eb5e=0x0;_0x14eb5e<_0x1acfec['Agents']['length'];_0x14eb5e+=0x1){let _0x348876=_0x1acfec['Agents'][_0x14eb5e];var _0x30fb28=_0x110823[_0x05c1('0x81')]();_0x30fb28[_0x05c1('0x41')](_0x05c1('0x82'),_0x348876['id']);_0x4d0c9f[_0x05c1('0x83')](db[_0x05c1('0x72')][_0x05c1('0x38')](_0x30fb28[_0x05c1('0x84')](),{'type':db[_0x05c1('0x72')]['QueryTypes']['SELECT']})[_0x05c1('0x15')](function(_0x1ec977){if(_0x1ec977['length']===0x1){return _0x348876['id'];}else{var _0x55159c=_[_0x05c1('0x85')](_[_0x05c1('0x31')](_0x1ec977,_0x05c1('0x86')),function(_0x394cc6){return _[_0x05c1('0x87')](_0x984e5e,_0x394cc6);});if(_0x55159c){return _0x348876['id'];}}}));}}return BPromise[_0x05c1('0x88')](_0x4d0c9f)[_0x05c1('0x15')](function(_0x132b8a){_0x5c0c79=_(_0x5c0c79)['union'](_0x132b8a)['compact']()[_0x05c1('0x89')]();return db[_0x05c1('0x32')]['find']({'where':{'id':_0x8d484a[_0x05c1('0x4e')]['id']}})['then'](function(_0x3803f6){return db[_0x05c1('0x72')][_0x05c1('0x73')](function(_0x1c54a5){return _0x3803f6[_0x05c1('0x78')](_0x8d484a['query'][_0x05c1('0x6e')],{'transaction':_0x1c54a5})[_0x05c1('0x15')](function(){if(!_['isEmpty'](_0x5c0c79)){return _0x3803f6[_0x05c1('0x8a')](_0x5c0c79,{'transaction':_0x1c54a5});}})['then'](function(){_0x5c0c79[_0x05c1('0x8b')](function(_0x1ca6ff){socket[_0x05c1('0x76')](_0x05c1('0x8c'),{'UserId':_0x1ca6ff,'ChatQueueId':_0x3803f6['id']});});});});});});})[_0x05c1('0x15')](respondWithStatusCode(_0x412846,null))[_0x05c1('0x4c')](handleError(_0x412846,null));};exports[_0x05c1('0x8d')]=function(_0x29e749,_0x5643ac,_0x318abc){return db[_0x05c1('0x32')]['find']({'where':{'id':_0x29e749[_0x05c1('0x4e')]['id']}})[_0x05c1('0x15')](handleEntityNotFound(_0x5643ac,null))[_0x05c1('0x15')](function(_0x46522e){if(_0x46522e){return _0x46522e['addAgents'](_0x29e749['body'][_0x05c1('0x6e')],_[_0x05c1('0x8e')](_0x29e749[_0x05c1('0x52')],[_0x05c1('0x6e'),'id'])||{})[_0x05c1('0x8f')](function(_0x8c8e8f){for(var _0x5e65ff=0x0;_0x5e65ff<_0x29e749[_0x05c1('0x52')][_0x05c1('0x6e')][_0x05c1('0x3c')];_0x5e65ff+=0x1){socket[_0x05c1('0x76')](_0x05c1('0x77'),{'UserId':Number(_0x29e749['body'][_0x05c1('0x6e')][_0x5e65ff]),'ChatQueueId':Number(_0x29e749['params']['id'])});}return _0x8c8e8f;});}})['then'](respondWithResult(_0x5643ac,null))[_0x05c1('0x4c')](handleError(_0x5643ac,null));};exports[_0x05c1('0x8a')]=function(_0x2c4b6e,_0x48092f,_0x4826a6){return db[_0x05c1('0x32')][_0x05c1('0x50')]({'where':{'id':_0x2c4b6e[_0x05c1('0x4e')]['id']}})[_0x05c1('0x15')](handleEntityNotFound(_0x48092f,null))[_0x05c1('0x15')](function(_0x5b389e){if(_0x5b389e){return _0x5b389e[_0x05c1('0x8a')](_0x2c4b6e[_0x05c1('0x38')][_0x05c1('0x6e')])[_0x05c1('0x15')](function(){if(_[_0x05c1('0x90')](_0x2c4b6e[_0x05c1('0x38')][_0x05c1('0x6e')])){for(var _0x107b54=0x0;_0x107b54<_0x2c4b6e[_0x05c1('0x38')]['ids'][_0x05c1('0x3c')];_0x107b54+=0x1){socket['emit'](_0x05c1('0x8c'),{'UserId':Number(_0x2c4b6e[_0x05c1('0x38')][_0x05c1('0x6e')][_0x107b54]),'ChatQueueId':Number(_0x2c4b6e[_0x05c1('0x4e')]['id'])});}}else{socket[_0x05c1('0x76')](_0x05c1('0x8c'),{'UserId':Number(_0x2c4b6e[_0x05c1('0x38')][_0x05c1('0x6e')]),'ChatQueueId':Number(_0x2c4b6e[_0x05c1('0x4e')]['id'])});}});}})['then'](respondWithStatusCode(_0x48092f,null))[_0x05c1('0x4c')](handleError(_0x48092f,null));};exports[_0x05c1('0x91')]=function(_0x1778ba,_0x38bb2b,_0x3d6651){var _0x3fcf41={};var _0x1bcc87={};var _0xe70001;var _0x568a9d;return db[_0x05c1('0x32')]['findOne']({'where':{'id':_0x1778ba[_0x05c1('0x4e')]['id']}})[_0x05c1('0x15')](handleEntityNotFound(_0x38bb2b,null))[_0x05c1('0x15')](function(_0x2c06e9){if(_0x2c06e9){_0xe70001=_0x2c06e9;_0x1bcc87[_0x05c1('0x36')]=_['keys'](db[_0x05c1('0x61')][_0x05c1('0x4f')]);_0x1bcc87[_0x05c1('0x38')]=_['keys'](_0x1778ba['query']);_0x1bcc87['filters']=_['intersection'](_0x1bcc87[_0x05c1('0x36')],_0x1bcc87[_0x05c1('0x38')]);_0x3fcf41['attributes']=_[_0x05c1('0x39')](_0x1bcc87[_0x05c1('0x36')],qs[_0x05c1('0x3b')](_0x1778ba[_0x05c1('0x38')]['fields']));_0x3fcf41[_0x05c1('0x3a')]=_0x3fcf41[_0x05c1('0x3a')][_0x05c1('0x3c')]?_0x3fcf41[_0x05c1('0x3a')]:_0x1bcc87[_0x05c1('0x36')];_0x3fcf41[_0x05c1('0x3f')]=qs['sort'](_0x1778ba['query'][_0x05c1('0x40')]);_0x3fcf41[_0x05c1('0x41')]=qs[_0x05c1('0x42')](_[_0x05c1('0x43')](_0x1778ba['query'],_0x1bcc87[_0x05c1('0x42')]));if(_0x1778ba[_0x05c1('0x38')][_0x05c1('0x44')]){_0x3fcf41[_0x05c1('0x41')]=_[_0x05c1('0x45')](_0x3fcf41[_0x05c1('0x41')],{'$or':_[_0x05c1('0x31')](_0x3fcf41['attributes'],function(_0x3fe1ed){var _0x4344ff={};_0x4344ff[_0x3fe1ed]={'$like':'%'+_0x1778ba[_0x05c1('0x38')][_0x05c1('0x44')]+'%'};return _0x4344ff;})});}_0x3fcf41=_[_0x05c1('0x45')]({},_0x3fcf41,_0x1778ba[_0x05c1('0x47')]);return _0xe70001[_0x05c1('0x91')](_0x3fcf41);}})['then'](function(_0x4001c6){if(_0x4001c6){_0x568a9d=_0x4001c6[_0x05c1('0x3c')];if(!_0x1778ba[_0x05c1('0x38')]['hasOwnProperty'](_0x05c1('0x3e'))){_0x3fcf41[_0x05c1('0x23')]=qs[_0x05c1('0x23')](_0x1778ba['query']['limit']);_0x3fcf41['offset']=qs[_0x05c1('0x22')](_0x1778ba[_0x05c1('0x38')][_0x05c1('0x22')]);}return _0xe70001[_0x05c1('0x91')](_0x3fcf41);}})[_0x05c1('0x15')](function(_0x4a1c5a){if(_0x4a1c5a){return _0x4a1c5a?{'count':_0x568a9d,'rows':_0x4a1c5a}:null;}})['then'](respondWithResult(_0x38bb2b,null))[_0x05c1('0x4c')](handleError(_0x38bb2b,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 13d820e..4e85683 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 _0x0b64=['update','emit','hasOwnProperty','hook','exports','../../mysqldb','ChatQueue','save'];(function(_0x2160a9,_0x3cbd9e){var _0xa88cf7=function(_0x51ab6f){while(--_0x51ab6f){_0x2160a9['push'](_0x2160a9['shift']());}};_0xa88cf7(++_0x3cbd9e);}(_0x0b64,0x9d));var _0x40b6=function(_0x2c861b,_0x15b01c){_0x2c861b=_0x2c861b-0x0;var _0x2f57f4=_0x0b64[_0x2c861b];return _0x2f57f4;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0x40b6('0x0'))['db'][_0x40b6('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x40b6('0x2'),'afterUpdate':_0x40b6('0x3'),'afterDestroy':'remove'};function emitEvent(_0x950296){return function(_0xc1068a,_0x274cd4,_0xa7098a){ChatQueueEvents[_0x40b6('0x4')](_0x950296+':'+_0xc1068a['id'],_0xc1068a);ChatQueueEvents[_0x40b6('0x4')](_0x950296,_0xc1068a);_0xa7098a(null);};}for(var e in events){if(events[_0x40b6('0x5')](e)){var event=events[e];ChatQueue[_0x40b6('0x6')](e,emitEvent(event));}}module[_0x40b6('0x7')]=ChatQueueEvents; \ No newline at end of file +var _0x36b9=['ChatQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','events'];(function(_0x1cca56,_0x5e0aa0){var _0xe8ceed=function(_0x59a59c){while(--_0x59a59c){_0x1cca56['push'](_0x1cca56['shift']());}};_0xe8ceed(++_0x5e0aa0);}(_0x36b9,0xe7));var _0x936b=function(_0x338661,_0x9d526c){_0x338661=_0x338661-0x0;var _0x32ca43=_0x36b9[_0x338661];return _0x32ca43;};'use strict';var EventEmitter=require(_0x936b('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0x936b('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x936b('0x2')](0x0);var events={'afterCreate':_0x936b('0x3'),'afterUpdate':_0x936b('0x4'),'afterDestroy':_0x936b('0x5')};function emitEvent(_0x4b4226){return function(_0x23a549,_0x24f9d7,_0x17e2a4){ChatQueueEvents[_0x936b('0x6')](_0x4b4226+':'+_0x23a549['id'],_0x23a549);ChatQueueEvents[_0x936b('0x6')](_0x4b4226,_0x23a549);_0x17e2a4(null);};}for(var e in events){if(events[_0x936b('0x7')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module['exports']=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 92af8cd..e9180bc 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 _0x7a3d=['bluebird','request-promise','rimraf','../../config/environment','exports','util','api','moment'];(function(_0x2cf2e9,_0xd58ea1){var _0xd3670d=function(_0x272868){while(--_0x272868){_0x2cf2e9['push'](_0x2cf2e9['shift']());}};_0xd3670d(++_0xd58ea1);}(_0x7a3d,0x1bd));var _0xd7a3=function(_0x2eb066,_0x2cd4c4){_0x2eb066=_0x2eb066-0x0;var _0x5c87e6=_0x7a3d[_0x2eb066];return _0x5c87e6;};'use strict';var _=require('lodash');var util=require(_0xd7a3('0x0'));var logger=require('../../config/logger')(_0xd7a3('0x1'));var moment=require(_0xd7a3('0x2'));var BPromise=require(_0xd7a3('0x3'));var rp=require(_0xd7a3('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd7a3('0x5'));var config=require(_0xd7a3('0x6'));var attributes=require('./chatQueue.attributes');module[_0xd7a3('0x7')]=function(_0x2e8717,_0x1752fc){return _0x2e8717['define']('ChatQueue',attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1f9f=['define','ChatQueue','chat_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','exports'];(function(_0x48168a,_0xf9dfe5){var _0x346d98=function(_0x22e41f){while(--_0x22e41f){_0x48168a['push'](_0x48168a['shift']());}};_0x346d98(++_0xf9dfe5);}(_0x1f9f,0x102));var _0xf1f9=function(_0x40b43c,_0x269319){_0x40b43c=_0x40b43c-0x0;var _0x1d31b7=_0x1f9f[_0x40b43c];return _0x1d31b7;};'use strict';var _=require(_0xf1f9('0x0'));var util=require(_0xf1f9('0x1'));var logger=require(_0xf1f9('0x2'))(_0xf1f9('0x3'));var moment=require(_0xf1f9('0x4'));var BPromise=require(_0xf1f9('0x5'));var rp=require(_0xf1f9('0x6'));var fs=require('fs');var path=require(_0xf1f9('0x7'));var rimraf=require(_0xf1f9('0x8'));var config=require(_0xf1f9('0x9'));var attributes=require(_0xf1f9('0xa'));module[_0xf1f9('0xb')]=function(_0x3ca706,_0x2169c4){return _0x3ca706[_0xf1f9('0xc')](_0xf1f9('0xd'),attributes,{'tableName':_0xf1f9('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js index 2eb3372..1dbbbdb 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 _0xdc25=['code','ChatQueue,\x20%s,\x20%s','message','catch','GetChatQueue','ChatQueue','findAll','options','where','include','map','model','attributes','then','debug','ShowChatQueue','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','request','info','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x10c814,_0x2c5349){var _0x3620e8=function(_0x2da52a){while(--_0x2da52a){_0x10c814['push'](_0x10c814['shift']());}};_0x3620e8(++_0x2c5349);}(_0xdc25,0x128));var _0x5dc2=function(_0x3d8005,_0x2a097e){_0x3d8005=_0x3d8005-0x0;var _0x1f3563=_0xdc25[_0x3d8005];return _0x1f3563;};'use strict';var _=require(_0x5dc2('0x0'));var util=require(_0x5dc2('0x1'));var moment=require(_0x5dc2('0x2'));var BPromise=require(_0x5dc2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5dc2('0x4'));var db=require(_0x5dc2('0x5'))['db'];var utils=require(_0x5dc2('0x6'));var logger=require(_0x5dc2('0x7'))(_0x5dc2('0x8'));var config=require(_0x5dc2('0x9'));var jayson=require(_0x5dc2('0xa'));var client=jayson[_0x5dc2('0xb')][_0x5dc2('0xc')]({'port':0x232a});config[_0x5dc2('0xd')]=_[_0x5dc2('0xe')](config[_0x5dc2('0xd')],{'host':_0x5dc2('0xf'),'port':0x18eb});var socket=require(_0x5dc2('0x10'))(new Redis(config['redis']));require(_0x5dc2('0x11'))['register'](socket);function respondWithRpcPromise(_0x10133e,_0x3ef210,_0x280171){return new BPromise(function(_0x513d9d,_0x3724fd){return client[_0x5dc2('0x12')](_0x10133e,_0x280171)['then'](function(_0x2c7a15){logger[_0x5dc2('0x13')]('ChatQueue,\x20%s,\x20%s',_0x3ef210,'request\x20sent');logger['debug'](_0x5dc2('0x14'),_0x3ef210,_0x5dc2('0x15'),JSON[_0x5dc2('0x16')](_0x2c7a15));if(_0x2c7a15[_0x5dc2('0x17')]){if(_0x2c7a15[_0x5dc2('0x17')][_0x5dc2('0x18')]===0x1f4){logger['error'](_0x5dc2('0x19'),_0x3ef210,_0x2c7a15['error'][_0x5dc2('0x1a')]);return _0x3724fd(_0x2c7a15[_0x5dc2('0x17')][_0x5dc2('0x1a')]);}logger[_0x5dc2('0x17')](_0x5dc2('0x19'),_0x3ef210,_0x2c7a15[_0x5dc2('0x17')][_0x5dc2('0x1a')]);return _0x513d9d(_0x2c7a15[_0x5dc2('0x17')]['message']);}else{logger[_0x5dc2('0x13')](_0x5dc2('0x19'),_0x3ef210,_0x5dc2('0x15'));_0x513d9d(_0x2c7a15['result'][_0x5dc2('0x1a')]);}})[_0x5dc2('0x1b')](function(_0x42d9ae){logger['error'](_0x5dc2('0x19'),_0x3ef210,_0x42d9ae);_0x3724fd(_0x42d9ae);});});}exports[_0x5dc2('0x1c')]=function(_0x3b2a67){var _0xcea44a=this;return new Promise(function(_0x596a24,_0xa92a14){return db[_0x5dc2('0x1d')][_0x5dc2('0x1e')]({'raw':_0x3b2a67[_0x5dc2('0x1f')]?_0x3b2a67[_0x5dc2('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x3b2a67[_0x5dc2('0x1f')]?_0x3b2a67[_0x5dc2('0x1f')][_0x5dc2('0x20')]||null:null,'attributes':_0x3b2a67['options']?_0x3b2a67[_0x5dc2('0x1f')]['attributes']||null:null,'limit':_0x3b2a67[_0x5dc2('0x1f')]?_0x3b2a67[_0x5dc2('0x1f')]['limit']||null:null,'include':_0x3b2a67['options']?_0x3b2a67['options'][_0x5dc2('0x21')]?_[_0x5dc2('0x22')](_0x3b2a67[_0x5dc2('0x1f')]['include'],function(_0xa43df2){return{'model':db[_0xa43df2[_0x5dc2('0x23')]],'as':_0xa43df2['as'],'attributes':_0xa43df2['attributes'],'include':_0xa43df2[_0x5dc2('0x21')]?_[_0x5dc2('0x22')](_0xa43df2['include'],function(_0x100db4){return{'model':db[_0x100db4[_0x5dc2('0x23')]],'as':_0x100db4['as'],'attributes':_0x100db4[_0x5dc2('0x24')],'include':_0x100db4['include']?_[_0x5dc2('0x22')](_0x100db4[_0x5dc2('0x21')],function(_0x7e8a44){return{'model':db[_0x7e8a44[_0x5dc2('0x23')]],'as':_0x7e8a44['as'],'attributes':_0x7e8a44[_0x5dc2('0x24')]};}):[]};}):[]};}):[]:[]})[_0x5dc2('0x25')](function(_0xd641b3){logger[_0x5dc2('0x13')]('GetChatQueue',_0x3b2a67);logger[_0x5dc2('0x26')](_0x5dc2('0x1c'),_0x3b2a67,JSON[_0x5dc2('0x16')](_0xd641b3));_0x596a24(_0xd641b3);})[_0x5dc2('0x1b')](function(_0x3c7dbc){logger[_0x5dc2('0x17')](_0x5dc2('0x1c'),_0x3c7dbc[_0x5dc2('0x1a')],_0x3b2a67);_0xa92a14(_0xcea44a[_0x5dc2('0x17')](0x1f4,_0x3c7dbc['message']));});});};exports['ShowChatQueue']=function(_0x46de8f){var _0x599171=this;return new Promise(function(_0x22f6c6,_0x1470c8){return db[_0x5dc2('0x1d')]['find']({'raw':_0x46de8f[_0x5dc2('0x1f')]?_0x46de8f[_0x5dc2('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x46de8f['options']?_0x46de8f[_0x5dc2('0x1f')]['where']||null:null,'attributes':_0x46de8f['options']?_0x46de8f['options']['attributes']||null:null,'include':_0x46de8f[_0x5dc2('0x1f')]?_0x46de8f['options']['include']?_[_0x5dc2('0x22')](_0x46de8f['options'][_0x5dc2('0x21')],function(_0x2e16ed){return{'model':db[_0x2e16ed[_0x5dc2('0x23')]],'as':_0x2e16ed['as'],'attributes':_0x2e16ed['attributes'],'include':_0x2e16ed['include']?_['map'](_0x2e16ed[_0x5dc2('0x21')],function(_0x4ae354){return{'model':db[_0x4ae354[_0x5dc2('0x23')]],'as':_0x4ae354['as'],'attributes':_0x4ae354['attributes'],'include':_0x4ae354['include']?_[_0x5dc2('0x22')](_0x4ae354['include'],function(_0x1f1f8e){return{'model':db[_0x1f1f8e[_0x5dc2('0x23')]],'as':_0x1f1f8e['as'],'attributes':_0x1f1f8e['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x569889){logger[_0x5dc2('0x13')](_0x5dc2('0x27'),_0x46de8f);logger[_0x5dc2('0x26')]('ShowChatQueue',_0x46de8f,JSON[_0x5dc2('0x16')](_0x569889));_0x22f6c6(_0x569889);})['catch'](function(_0x75491c){logger[_0x5dc2('0x17')](_0x5dc2('0x27'),_0x75491c[_0x5dc2('0x1a')],_0x46de8f);_0x1470c8(_0x599171['error'](0x1f4,_0x75491c[_0x5dc2('0x1a')]));});});}; \ No newline at end of file +var _0x0d74=['jayson/promise','defaults','localhost','socket.io-emitter','./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','options','raw','where','attributes','limit','include','map','model','ShowChatQueue','ChatQueue','find','lodash','util','randomstring','ioredis','../../config/logger','rpc','../../config/environment'];(function(_0xb0ef6,_0x53cd27){var _0x30a8ff=function(_0x1df3c3){while(--_0x1df3c3){_0xb0ef6['push'](_0xb0ef6['shift']());}};_0x30a8ff(++_0x53cd27);}(_0x0d74,0x146));var _0x40d7=function(_0x291dc6,_0x1109ff){_0x291dc6=_0x291dc6-0x0;var _0x54d7cc=_0x0d74[_0x291dc6];return _0x54d7cc;};'use strict';var _=require(_0x40d7('0x0'));var util=require(_0x40d7('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x40d7('0x2'));var fs=require('fs');var Redis=require(_0x40d7('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x40d7('0x4'))(_0x40d7('0x5'));var config=require(_0x40d7('0x6'));var jayson=require(_0x40d7('0x7'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x40d7('0x8')](config['redis'],{'host':_0x40d7('0x9'),'port':0x18eb});var socket=require(_0x40d7('0xa'))(new Redis(config['redis']));require(_0x40d7('0xb'))[_0x40d7('0xc')](socket);function respondWithRpcPromise(_0x354f80,_0x2bae78,_0xcb37e3){return new BPromise(function(_0x517d88,_0x5208be){return client[_0x40d7('0xd')](_0x354f80,_0xcb37e3)[_0x40d7('0xe')](function(_0x229937){logger[_0x40d7('0xf')](_0x40d7('0x10'),_0x2bae78,'request\x20sent');logger[_0x40d7('0x11')](_0x40d7('0x12'),_0x2bae78,_0x40d7('0x13'),JSON[_0x40d7('0x14')](_0x229937));if(_0x229937['error']){if(_0x229937[_0x40d7('0x15')][_0x40d7('0x16')]===0x1f4){logger[_0x40d7('0x15')](_0x40d7('0x10'),_0x2bae78,_0x229937[_0x40d7('0x15')][_0x40d7('0x17')]);return _0x5208be(_0x229937[_0x40d7('0x15')][_0x40d7('0x17')]);}logger[_0x40d7('0x15')]('ChatQueue,\x20%s,\x20%s',_0x2bae78,_0x229937['error']['message']);return _0x517d88(_0x229937[_0x40d7('0x15')][_0x40d7('0x17')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x2bae78,_0x40d7('0x13'));_0x517d88(_0x229937['result']['message']);}})[_0x40d7('0x18')](function(_0x22de5a){logger[_0x40d7('0x15')](_0x40d7('0x10'),_0x2bae78,_0x22de5a);_0x5208be(_0x22de5a);});});}exports[_0x40d7('0x19')]=function(_0x28bbc0){var _0x3d2afa=this;return new Promise(function(_0x3ec437,_0x5eb3c1){return db['ChatQueue']['findAll']({'raw':_0x28bbc0[_0x40d7('0x1a')]?_0x28bbc0['options'][_0x40d7('0x1b')]===undefined?!![]:![]:!![],'where':_0x28bbc0[_0x40d7('0x1a')]?_0x28bbc0[_0x40d7('0x1a')][_0x40d7('0x1c')]||null:null,'attributes':_0x28bbc0[_0x40d7('0x1a')]?_0x28bbc0[_0x40d7('0x1a')][_0x40d7('0x1d')]||null:null,'limit':_0x28bbc0[_0x40d7('0x1a')]?_0x28bbc0[_0x40d7('0x1a')][_0x40d7('0x1e')]||null:null,'include':_0x28bbc0[_0x40d7('0x1a')]?_0x28bbc0['options'][_0x40d7('0x1f')]?_[_0x40d7('0x20')](_0x28bbc0[_0x40d7('0x1a')][_0x40d7('0x1f')],function(_0x528ab5){return{'model':db[_0x528ab5['model']],'as':_0x528ab5['as'],'attributes':_0x528ab5[_0x40d7('0x1d')],'include':_0x528ab5['include']?_['map'](_0x528ab5[_0x40d7('0x1f')],function(_0x1ef074){return{'model':db[_0x1ef074[_0x40d7('0x21')]],'as':_0x1ef074['as'],'attributes':_0x1ef074[_0x40d7('0x1d')],'include':_0x1ef074['include']?_['map'](_0x1ef074[_0x40d7('0x1f')],function(_0x2b5f11){return{'model':db[_0x2b5f11[_0x40d7('0x21')]],'as':_0x2b5f11['as'],'attributes':_0x2b5f11['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1102d3){logger[_0x40d7('0xf')]('GetChatQueue',_0x28bbc0);logger[_0x40d7('0x11')](_0x40d7('0x19'),_0x28bbc0,JSON[_0x40d7('0x14')](_0x1102d3));_0x3ec437(_0x1102d3);})[_0x40d7('0x18')](function(_0x555a3b){logger['error'](_0x40d7('0x19'),_0x555a3b[_0x40d7('0x17')],_0x28bbc0);_0x5eb3c1(_0x3d2afa[_0x40d7('0x15')](0x1f4,_0x555a3b[_0x40d7('0x17')]));});});};exports[_0x40d7('0x22')]=function(_0x4a2bc2){var _0x23e560=this;return new Promise(function(_0x5af456,_0x22edd1){return db[_0x40d7('0x23')][_0x40d7('0x24')]({'raw':_0x4a2bc2['options']?_0x4a2bc2[_0x40d7('0x1a')][_0x40d7('0x1b')]===undefined?!![]:![]:!![],'where':_0x4a2bc2[_0x40d7('0x1a')]?_0x4a2bc2[_0x40d7('0x1a')][_0x40d7('0x1c')]||null:null,'attributes':_0x4a2bc2[_0x40d7('0x1a')]?_0x4a2bc2[_0x40d7('0x1a')]['attributes']||null:null,'include':_0x4a2bc2[_0x40d7('0x1a')]?_0x4a2bc2[_0x40d7('0x1a')][_0x40d7('0x1f')]?_[_0x40d7('0x20')](_0x4a2bc2[_0x40d7('0x1a')][_0x40d7('0x1f')],function(_0x1e6f08){return{'model':db[_0x1e6f08[_0x40d7('0x21')]],'as':_0x1e6f08['as'],'attributes':_0x1e6f08['attributes'],'include':_0x1e6f08['include']?_[_0x40d7('0x20')](_0x1e6f08[_0x40d7('0x1f')],function(_0x4902a1){return{'model':db[_0x4902a1['model']],'as':_0x4902a1['as'],'attributes':_0x4902a1['attributes'],'include':_0x4902a1[_0x40d7('0x1f')]?_['map'](_0x4902a1[_0x40d7('0x1f')],function(_0x56b17c){return{'model':db[_0x56b17c[_0x40d7('0x21')]],'as':_0x56b17c['as'],'attributes':_0x56b17c[_0x40d7('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x40d7('0xe')](function(_0x2e4ccb){logger[_0x40d7('0xf')]('ShowChatQueue',_0x4a2bc2);logger[_0x40d7('0x11')](_0x40d7('0x22'),_0x4a2bc2,JSON[_0x40d7('0x14')](_0x2e4ccb));_0x5af456(_0x2e4ccb);})[_0x40d7('0x18')](function(_0x21a675){logger['error']('ShowChatQueue',_0x21a675['message'],_0x4a2bc2);_0x22edd1(_0x23e560[_0x40d7('0x15')](0x1f4,_0x21a675['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 51a9a1d..295b412 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 _0xb7c8=['chatQueue:','save','remove','update','emit','removeListener','register','length'];(function(_0x114590,_0x592c84){var _0x5d4db5=function(_0x48920d){while(--_0x48920d){_0x114590['push'](_0x114590['shift']());}};_0x5d4db5(++_0x592c84);}(_0xb7c8,0x119));var _0x8b7c=function(_0xb3b23f,_0x4afa3f){_0xb3b23f=_0xb3b23f-0x0;var _0x2404e6=_0xb7c8[_0xb3b23f];return _0x2404e6;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0x8b7c('0x0'),_0x8b7c('0x1'),_0x8b7c('0x2')];function createListener(_0x3a84fc,_0x1dceff){return function(_0x31ad24){_0x1dceff[_0x8b7c('0x3')](_0x3a84fc,_0x31ad24);};}function removeListener(_0x50113e,_0x38672b){return function(){ChatQueueEvents[_0x8b7c('0x4')](_0x50113e,_0x38672b);};}exports[_0x8b7c('0x5')]=function(_0x440900){for(var _0x107428=0x0,_0x12665c=events[_0x8b7c('0x6')];_0x107428<_0x12665c;_0x107428++){var _0x3c8fd6=events[_0x107428];var _0x6afb55=createListener(_0x8b7c('0x7')+_0x3c8fd6,_0x440900);ChatQueueEvents['on'](_0x3c8fd6,_0x6afb55);}}; \ No newline at end of file +var _0xadb8=['emit','removeListener','length','chatQueue:','remove'];(function(_0x4fe19c,_0x45d0fe){var _0x952ac7=function(_0x274a16){while(--_0x274a16){_0x4fe19c['push'](_0x4fe19c['shift']());}};_0x952ac7(++_0x45d0fe);}(_0xadb8,0x1d0));var _0x8adb=function(_0x20aae1,_0x51efd4){_0x20aae1=_0x20aae1-0x0;var _0x510601=_0xadb8[_0x20aae1];return _0x510601;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=['save',_0x8adb('0x0'),'update'];function createListener(_0x2b8a76,_0x2a0b30){return function(_0x24f912){_0x2a0b30[_0x8adb('0x1')](_0x2b8a76,_0x24f912);};}function removeListener(_0x44fdf7,_0x2baedb){return function(){ChatQueueEvents[_0x8adb('0x2')](_0x44fdf7,_0x2baedb);};}exports['register']=function(_0x15bc63){for(var _0x1a5f36=0x0,_0x9f435=events[_0x8adb('0x3')];_0x1a5f36<_0x9f435;_0x1a5f36++){var _0x271bed=events[_0x1a5f36];var _0x16b932=createListener(_0x8adb('0x4')+_0x271bed,_0x15bc63);ChatQueueEvents['on'](_0x271bed,_0x16b932);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 2ec4838..e0be9cc 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 _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','/:id/teams','removeTeams','multer','util','path'];(function(_0x58c044,_0x1e781d){var _0xf763ac=function(_0x8c0b97){while(--_0x8c0b97){_0x58c044['push'](_0x58c044['shift']());}};_0xf763ac(++_0x1e781d);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/teams',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x14')](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x17')]);router[_0x7995('0x18')](_0x7995('0x19'),auth[_0x7995('0xa')](),controller['update']);router[_0x7995('0x1a')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0x1b')]);router[_0x7995('0x1a')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router['delete']('/:id/users',auth[_0x7995('0xa')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0xe14b=['/describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','util','express','Router','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','index'];(function(_0x4237da,_0x48b1fd){var _0x343b83=function(_0x515574){while(--_0x515574){_0x4237da['push'](_0x4237da['shift']());}};_0x343b83(++_0x48b1fd);}(_0xe14b,0x93));var _0xbe14=function(_0x4269bc,_0x5a094c){_0x4269bc=_0x4269bc-0x0;var _0x53b296=_0xe14b[_0x4269bc];return _0x53b296;};'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['getMembers']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x10')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x10')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x12')]);router[_0xbe14('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x13')]);router[_0xbe14('0x14')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0x16')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x16')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeTeams']);router[_0xbe14('0x16')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);module[_0xbe14('0x19')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index c80de0b..c9b48f8 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 _0x27c0=['sequelize','STRING','DATE','moment'];(function(_0x3fe393,_0x234a3a){var _0x534d14=function(_0x277fab){while(--_0x277fab){_0x3fe393['push'](_0x3fe393['shift']());}};_0x534d14(++_0x234a3a);}(_0x27c0,0x1bb));var _0x027c=function(_0x22f082,_0x40fee4){_0x22f082=_0x22f082-0x0;var _0x66507b=_0x27c0[_0x22f082];return _0x66507b;};'use strict';var moment=require(_0x027c('0x0'));var Sequelize=require(_0x027c('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x027c('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x027c('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x027c('0x3')]},'exitAt':{'type':Sequelize[_0x027c('0x3')]},'reason':{'type':Sequelize[_0x027c('0x2')]}}; \ No newline at end of file +var _0xe1e4=['STRING','DATE','moment','sequelize'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0xe1e4,0x18e));var _0x4e1e=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0xe1e4[_0x599f41];return _0x2e4d58;};'use strict';var moment=require(_0x4e1e('0x0'));var Sequelize=require(_0x4e1e('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x4e1e('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x4e1e('0x2')]},'joinAt':{'type':Sequelize[_0x4e1e('0x3')]},'leaveAt':{'type':Sequelize[_0x4e1e('0x3')]},'acceptAt':{'type':Sequelize[_0x4e1e('0x3')]},'exitAt':{'type':Sequelize[_0x4e1e('0x3')]},'reason':{'type':Sequelize[_0x4e1e('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 392a32c..d2217b4 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 _0xac6a=['apply','reject','save','then','sendStatus','name','send','index','ChatQueueReport','rawAttributes','fieldName','type','map','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','filter','where','merge','options','findAll','rows','show','params','keys','includeAll','include','catch','create','body','update','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','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/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','limit','set','Content-Range'];(function(_0x21b359,_0x4dc80e){var _0x57b8e7=function(_0x135adb){while(--_0x135adb){_0x21b359['push'](_0x21b359['shift']());}};_0x57b8e7(++_0x4dc80e);}(_0xac6a,0xc2));var _0xaac6=function(_0x96012a,_0x557faa){_0x96012a=_0x96012a-0x0;var _0x22c728=_0xac6a[_0x96012a];return _0x22c728;};'use strict';var emlformat=require(_0xaac6('0x0'));var rimraf=require(_0xaac6('0x1'));var zipdir=require(_0xaac6('0x2'));var jsonpatch=require(_0xaac6('0x3'));var rp=require(_0xaac6('0x4'));var moment=require('moment');var BPromise=require(_0xaac6('0x5'));var Mustache=require('mustache');var util=require(_0xaac6('0x6'));var path=require(_0xaac6('0x7'));var sox=require(_0xaac6('0x8'));var csv=require(_0xaac6('0x9'));var ejs=require(_0xaac6('0xa'));var fs=require('fs');var fs_extra=require(_0xaac6('0xb'));var _=require(_0xaac6('0xc'));var squel=require(_0xaac6('0xd'));var crypto=require(_0xaac6('0xe'));var jsforce=require(_0xaac6('0xf'));var deskjs=require(_0xaac6('0x10'));var toCsv=require(_0xaac6('0x9'));var querystring=require('querystring');var Papa=require(_0xaac6('0x11'));var Redis=require(_0xaac6('0x12'));var authService=require(_0xaac6('0x13'));var qs=require(_0xaac6('0x14'));var as=require(_0xaac6('0x15'));var hardwareService=require(_0xaac6('0x16'));var logger=require('../../config/logger')(_0xaac6('0x17'));var utils=require(_0xaac6('0x18'));var config=require(_0xaac6('0x19'));var licenseUtil=require(_0xaac6('0x1a'));var db=require(_0xaac6('0x1b'))['db'];function respondWithStatusCode(_0x57869f,_0x551fea){_0x551fea=_0x551fea||0xcc;return function(_0x1efac6){if(_0x1efac6){return _0x57869f['sendStatus'](_0x551fea);}return _0x57869f['status'](_0x551fea)[_0xaac6('0x1c')]();};}function respondWithResult(_0xcdfe7c,_0x2a074a){_0x2a074a=_0x2a074a||0xc8;return function(_0x404d82){if(_0x404d82){return _0xcdfe7c[_0xaac6('0x1d')](_0x2a074a)[_0xaac6('0x1e')](_0x404d82);}};}function respondWithFilteredResult(_0x130152,_0xc873f9){return function(_0x1c42fe){if(_0x1c42fe){var _0x1ceeca=typeof _0xc873f9[_0xaac6('0x1f')]===_0xaac6('0x20')&&typeof _0xc873f9['limit']==='undefined';var _0x8d0c31=_0x1c42fe[_0xaac6('0x21')];var _0x3cce6f=_0x1ceeca?0x0:_0xc873f9[_0xaac6('0x1f')];var _0x3d234a=_0x1ceeca?_0x1c42fe['count']:_0xc873f9[_0xaac6('0x1f')]+_0xc873f9[_0xaac6('0x22')];var _0x26dd96;if(_0x3d234a>=_0x8d0c31){_0x3d234a=_0x8d0c31;_0x26dd96=0xc8;}else{_0x26dd96=0xce;}_0x130152[_0xaac6('0x1d')](_0x26dd96);return _0x130152[_0xaac6('0x23')](_0xaac6('0x24'),_0x3cce6f+'-'+_0x3d234a+'/'+_0x8d0c31)[_0xaac6('0x1e')](_0x1c42fe);}return null;};}function patchUpdates(_0x4a6064){return function(_0x3fcc7b){try{jsonpatch[_0xaac6('0x25')](_0x3fcc7b,_0x4a6064,!![]);}catch(_0x276123){return BPromise[_0xaac6('0x26')](_0x276123);}return _0x3fcc7b[_0xaac6('0x27')]();};}function saveUpdates(_0x12682c,_0x2afe80){return function(_0x4f7089){if(_0x4f7089){return _0x4f7089['update'](_0x12682c)[_0xaac6('0x28')](function(_0x54592c){return _0x54592c;});}return null;};}function removeEntity(_0x18c220,_0x12dfa5){return function(_0x326238){if(_0x326238){return _0x326238['destroy']()[_0xaac6('0x28')](function(){_0x18c220['status'](0xcc)[_0xaac6('0x1c')]();});}};}function handleEntityNotFound(_0x943dc9,_0x21ea41){return function(_0x335300){if(!_0x335300){_0x943dc9[_0xaac6('0x29')](0x194);}return _0x335300;};}function handleError(_0x58dfb3,_0xc4b235){_0xc4b235=_0xc4b235||0x1f4;return function(_0x321cbc){logger['error'](_0x321cbc['stack']);if(_0x321cbc[_0xaac6('0x2a')]){delete _0x321cbc['name'];}_0x58dfb3[_0xaac6('0x1d')](_0xc4b235)[_0xaac6('0x2b')](_0x321cbc);};}exports[_0xaac6('0x2c')]=function(_0x3b63f3,_0x19f0c0){var _0x5d6950={},_0x19ebcf={},_0xb02a9b={'count':0x0,'rows':[]};var _0x32f29b=_['map'](db[_0xaac6('0x2d')][_0xaac6('0x2e')],function(_0x43c46e){return{'name':_0x43c46e[_0xaac6('0x2f')],'type':_0x43c46e[_0xaac6('0x30')]['key']};});_0x19ebcf['model']=_[_0xaac6('0x31')](_0x32f29b,_0xaac6('0x2a'));_0x19ebcf[_0xaac6('0x32')]=_['keys'](_0x3b63f3[_0xaac6('0x32')]);_0x19ebcf[_0xaac6('0x33')]=_[_0xaac6('0x34')](_0x19ebcf['model'],_0x19ebcf[_0xaac6('0x32')]);_0x5d6950[_0xaac6('0x35')]=_[_0xaac6('0x34')](_0x19ebcf[_0xaac6('0x36')],qs[_0xaac6('0x37')](_0x3b63f3['query'][_0xaac6('0x37')]));_0x5d6950[_0xaac6('0x35')]=_0x5d6950['attributes'][_0xaac6('0x38')]?_0x5d6950[_0xaac6('0x35')]:_0x19ebcf['model'];if(!_0x3b63f3[_0xaac6('0x32')][_0xaac6('0x39')](_0xaac6('0x3a'))){_0x5d6950[_0xaac6('0x22')]=qs[_0xaac6('0x22')](_0x3b63f3['query'][_0xaac6('0x22')]);_0x5d6950[_0xaac6('0x1f')]=qs[_0xaac6('0x1f')](_0x3b63f3[_0xaac6('0x32')][_0xaac6('0x1f')]);}_0x5d6950['order']=qs['sort'](_0x3b63f3['query']['sort']);_0x5d6950['where']=qs[_0xaac6('0x33')](_['pick'](_0x3b63f3[_0xaac6('0x32')],_0x19ebcf[_0xaac6('0x33')]),_0x32f29b);if(_0x3b63f3[_0xaac6('0x32')][_0xaac6('0x3b')]){_0x5d6950[_0xaac6('0x3c')]=_[_0xaac6('0x3d')](_0x5d6950[_0xaac6('0x3c')],{'$or':_[_0xaac6('0x31')](_0x32f29b,function(_0x185659){if(_0x185659[_0xaac6('0x30')]!=='VIRTUAL'){var _0x55da98={};_0x55da98[_0x185659['name']]={'$like':'%'+_0x3b63f3[_0xaac6('0x32')][_0xaac6('0x3b')]+'%'};return _0x55da98;}})});}_0x5d6950=_['merge']({},_0x5d6950,_0x3b63f3[_0xaac6('0x3e')]);var _0x3d5807={'where':_0x5d6950[_0xaac6('0x3c')]};return db[_0xaac6('0x2d')][_0xaac6('0x21')](_0x3d5807)['then'](function(_0x296ce6){_0xb02a9b[_0xaac6('0x21')]=_0x296ce6;if(_0x3b63f3[_0xaac6('0x32')]['includeAll']){_0x5d6950['include']=[{'all':!![]}];}return db['ChatQueueReport'][_0xaac6('0x3f')](_0x5d6950);})[_0xaac6('0x28')](function(_0x1cdcca){_0xb02a9b[_0xaac6('0x40')]=_0x1cdcca;return _0xb02a9b;})['then'](respondWithFilteredResult(_0x19f0c0,_0x5d6950))['catch'](handleError(_0x19f0c0,null));};exports[_0xaac6('0x41')]=function(_0xfbab0c,_0x217e6e){var _0x365e0e={'raw':!![],'where':{'id':_0xfbab0c[_0xaac6('0x42')]['id']}},_0x40d21a={};_0x40d21a[_0xaac6('0x36')]=_[_0xaac6('0x43')](db['ChatQueueReport'][_0xaac6('0x2e')]);_0x40d21a[_0xaac6('0x32')]=_[_0xaac6('0x43')](_0xfbab0c[_0xaac6('0x32')]);_0x40d21a[_0xaac6('0x33')]=_[_0xaac6('0x34')](_0x40d21a[_0xaac6('0x36')],_0x40d21a[_0xaac6('0x32')]);_0x365e0e['attributes']=_[_0xaac6('0x34')](_0x40d21a['model'],qs[_0xaac6('0x37')](_0xfbab0c[_0xaac6('0x32')][_0xaac6('0x37')]));_0x365e0e[_0xaac6('0x35')]=_0x365e0e[_0xaac6('0x35')]['length']?_0x365e0e[_0xaac6('0x35')]:_0x40d21a[_0xaac6('0x36')];if(_0xfbab0c[_0xaac6('0x32')][_0xaac6('0x44')]){_0x365e0e[_0xaac6('0x45')]=[{'all':!![]}];}_0x365e0e=_[_0xaac6('0x3d')]({},_0x365e0e,_0xfbab0c[_0xaac6('0x3e')]);return db[_0xaac6('0x2d')]['find'](_0x365e0e)[_0xaac6('0x28')](handleEntityNotFound(_0x217e6e,null))[_0xaac6('0x28')](respondWithResult(_0x217e6e,null))[_0xaac6('0x46')](handleError(_0x217e6e,null));};exports['create']=function(_0x15d695,_0x1b53f5){return db[_0xaac6('0x2d')][_0xaac6('0x47')](_0x15d695[_0xaac6('0x48')],{})[_0xaac6('0x28')](respondWithResult(_0x1b53f5,0xc9))['catch'](handleError(_0x1b53f5,null));};exports[_0xaac6('0x49')]=function(_0x2af290,_0x644ec3){if(_0x2af290[_0xaac6('0x48')]['id']){delete _0x2af290['body']['id'];}return db['ChatQueueReport'][_0xaac6('0x4a')]({'where':{'id':_0x2af290[_0xaac6('0x42')]['id']}})['then'](handleEntityNotFound(_0x644ec3,null))[_0xaac6('0x28')](saveUpdates(_0x2af290[_0xaac6('0x48')],null))[_0xaac6('0x28')](respondWithResult(_0x644ec3,null))[_0xaac6('0x46')](handleError(_0x644ec3,null));};exports[_0xaac6('0x4b')]=function(_0x265850,_0x593179){return db[_0xaac6('0x2d')][_0xaac6('0x4a')]({'where':{'id':_0x265850['params']['id']}})[_0xaac6('0x28')](handleEntityNotFound(_0x593179,null))[_0xaac6('0x28')](removeEntity(_0x593179,null))['catch'](handleError(_0x593179,null));};exports['describe']=function(_0x101078,_0x16a6f0){return db['ChatQueueReport'][_0xaac6('0x4c')]()[_0xaac6('0x28')](respondWithResult(_0x16a6f0,null))[_0xaac6('0x46')](handleError(_0x16a6f0,null));}; \ No newline at end of file +var _0x8cad=['intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch','params','create','update','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','then','destroy','error','name','send','map','ChatQueueReport','rawAttributes','fieldName','type','key','query','keys','filters'];(function(_0x42deb9,_0xa48420){var _0x393e3f=function(_0x350e3b){while(--_0x350e3b){_0x42deb9['push'](_0x42deb9['shift']());}};_0x393e3f(++_0xa48420);}(_0x8cad,0xfe));var _0xd8ca=function(_0x3740fe,_0x6c543c){_0x3740fe=_0x3740fe-0x0;var _0x55492b=_0x8cad[_0x3740fe];return _0x55492b;};'use strict';var emlformat=require(_0xd8ca('0x0'));var rimraf=require(_0xd8ca('0x1'));var zipdir=require(_0xd8ca('0x2'));var jsonpatch=require(_0xd8ca('0x3'));var rp=require(_0xd8ca('0x4'));var moment=require(_0xd8ca('0x5'));var BPromise=require(_0xd8ca('0x6'));var Mustache=require(_0xd8ca('0x7'));var util=require(_0xd8ca('0x8'));var path=require(_0xd8ca('0x9'));var sox=require(_0xd8ca('0xa'));var csv=require(_0xd8ca('0xb'));var ejs=require(_0xd8ca('0xc'));var fs=require('fs');var fs_extra=require(_0xd8ca('0xd'));var _=require('lodash');var squel=require(_0xd8ca('0xe'));var crypto=require(_0xd8ca('0xf'));var jsforce=require(_0xd8ca('0x10'));var deskjs=require(_0xd8ca('0x11'));var toCsv=require(_0xd8ca('0xb'));var querystring=require('querystring');var Papa=require(_0xd8ca('0x12'));var Redis=require('ioredis');var authService=require(_0xd8ca('0x13'));var qs=require(_0xd8ca('0x14'));var as=require(_0xd8ca('0x15'));var hardwareService=require(_0xd8ca('0x16'));var logger=require(_0xd8ca('0x17'))(_0xd8ca('0x18'));var utils=require('../../config/utils');var config=require(_0xd8ca('0x19'));var licenseUtil=require(_0xd8ca('0x1a'));var db=require(_0xd8ca('0x1b'))['db'];function respondWithStatusCode(_0x102b16,_0x326272){_0x326272=_0x326272||0xcc;return function(_0x2bb191){if(_0x2bb191){return _0x102b16[_0xd8ca('0x1c')](_0x326272);}return _0x102b16[_0xd8ca('0x1d')](_0x326272)[_0xd8ca('0x1e')]();};}function respondWithResult(_0x52726a,_0x58969b){_0x58969b=_0x58969b||0xc8;return function(_0x12d3f8){if(_0x12d3f8){return _0x52726a[_0xd8ca('0x1d')](_0x58969b)[_0xd8ca('0x1f')](_0x12d3f8);}};}function respondWithFilteredResult(_0x647962,_0x177367){return function(_0x17330a){if(_0x17330a){var _0x3013f2=typeof _0x177367[_0xd8ca('0x20')]===_0xd8ca('0x21')&&typeof _0x177367['limit']===_0xd8ca('0x21');var _0x3c67fc=_0x17330a[_0xd8ca('0x22')];var _0x437ac5=_0x3013f2?0x0:_0x177367['offset'];var _0x47e368=_0x3013f2?_0x17330a[_0xd8ca('0x22')]:_0x177367['offset']+_0x177367[_0xd8ca('0x23')];var _0x35a3a1;if(_0x47e368>=_0x3c67fc){_0x47e368=_0x3c67fc;_0x35a3a1=0xc8;}else{_0x35a3a1=0xce;}_0x647962[_0xd8ca('0x1d')](_0x35a3a1);return _0x647962[_0xd8ca('0x24')](_0xd8ca('0x25'),_0x437ac5+'-'+_0x47e368+'/'+_0x3c67fc)[_0xd8ca('0x1f')](_0x17330a);}return null;};}function patchUpdates(_0x56ea7e){return function(_0xa18ac1){try{jsonpatch[_0xd8ca('0x26')](_0xa18ac1,_0x56ea7e,!![]);}catch(_0xd5e6c6){return BPromise[_0xd8ca('0x27')](_0xd5e6c6);}return _0xa18ac1['save']();};}function saveUpdates(_0x23854a,_0x3053f0){return function(_0x1d1367){if(_0x1d1367){return _0x1d1367['update'](_0x23854a)[_0xd8ca('0x28')](function(_0x341807){return _0x341807;});}return null;};}function removeEntity(_0xb42d0c,_0xbf3254){return function(_0x424d81){if(_0x424d81){return _0x424d81[_0xd8ca('0x29')]()[_0xd8ca('0x28')](function(){_0xb42d0c['status'](0xcc)[_0xd8ca('0x1e')]();});}};}function handleEntityNotFound(_0x3f8e42,_0x4eded9){return function(_0x3bd963){if(!_0x3bd963){_0x3f8e42[_0xd8ca('0x1c')](0x194);}return _0x3bd963;};}function handleError(_0x32ba25,_0xaeff64){_0xaeff64=_0xaeff64||0x1f4;return function(_0x15a71d){logger[_0xd8ca('0x2a')](_0x15a71d['stack']);if(_0x15a71d[_0xd8ca('0x2b')]){delete _0x15a71d['name'];}_0x32ba25[_0xd8ca('0x1d')](_0xaeff64)[_0xd8ca('0x2c')](_0x15a71d);};}exports['index']=function(_0x5260c3,_0x1ab436){var _0x4641af={},_0x3b1098={},_0x3bd4c4={'count':0x0,'rows':[]};var _0xab5ffe=_[_0xd8ca('0x2d')](db[_0xd8ca('0x2e')][_0xd8ca('0x2f')],function(_0x52369d){return{'name':_0x52369d[_0xd8ca('0x30')],'type':_0x52369d[_0xd8ca('0x31')][_0xd8ca('0x32')]};});_0x3b1098['model']=_['map'](_0xab5ffe,_0xd8ca('0x2b'));_0x3b1098[_0xd8ca('0x33')]=_[_0xd8ca('0x34')](_0x5260c3[_0xd8ca('0x33')]);_0x3b1098[_0xd8ca('0x35')]=_[_0xd8ca('0x36')](_0x3b1098[_0xd8ca('0x37')],_0x3b1098[_0xd8ca('0x33')]);_0x4641af['attributes']=_[_0xd8ca('0x36')](_0x3b1098[_0xd8ca('0x37')],qs[_0xd8ca('0x38')](_0x5260c3[_0xd8ca('0x33')][_0xd8ca('0x38')]));_0x4641af[_0xd8ca('0x39')]=_0x4641af[_0xd8ca('0x39')][_0xd8ca('0x3a')]?_0x4641af['attributes']:_0x3b1098[_0xd8ca('0x37')];if(!_0x5260c3[_0xd8ca('0x33')][_0xd8ca('0x3b')]('nolimit')){_0x4641af[_0xd8ca('0x23')]=qs[_0xd8ca('0x23')](_0x5260c3[_0xd8ca('0x33')]['limit']);_0x4641af[_0xd8ca('0x20')]=qs['offset'](_0x5260c3[_0xd8ca('0x33')]['offset']);}_0x4641af[_0xd8ca('0x3c')]=qs[_0xd8ca('0x3d')](_0x5260c3[_0xd8ca('0x33')]['sort']);_0x4641af[_0xd8ca('0x3e')]=qs[_0xd8ca('0x35')](_['pick'](_0x5260c3[_0xd8ca('0x33')],_0x3b1098[_0xd8ca('0x35')]),_0xab5ffe);if(_0x5260c3['query'][_0xd8ca('0x3f')]){_0x4641af[_0xd8ca('0x3e')]=_['merge'](_0x4641af[_0xd8ca('0x3e')],{'$or':_[_0xd8ca('0x2d')](_0xab5ffe,function(_0x225794){if(_0x225794['type']!=='VIRTUAL'){var _0x1779a5={};_0x1779a5[_0x225794['name']]={'$like':'%'+_0x5260c3[_0xd8ca('0x33')]['filter']+'%'};return _0x1779a5;}})});}_0x4641af=_[_0xd8ca('0x40')]({},_0x4641af,_0x5260c3[_0xd8ca('0x41')]);var _0x22f15b={'where':_0x4641af[_0xd8ca('0x3e')]};return db['ChatQueueReport'][_0xd8ca('0x22')](_0x22f15b)[_0xd8ca('0x28')](function(_0x2f971a){_0x3bd4c4['count']=_0x2f971a;if(_0x5260c3['query'][_0xd8ca('0x42')]){_0x4641af[_0xd8ca('0x43')]=[{'all':!![]}];}return db['ChatQueueReport'][_0xd8ca('0x44')](_0x4641af);})[_0xd8ca('0x28')](function(_0x43fcee){_0x3bd4c4[_0xd8ca('0x45')]=_0x43fcee;return _0x3bd4c4;})[_0xd8ca('0x28')](respondWithFilteredResult(_0x1ab436,_0x4641af))[_0xd8ca('0x46')](handleError(_0x1ab436,null));};exports['show']=function(_0x387309,_0x2d10b3){var _0x15d671={'raw':!![],'where':{'id':_0x387309[_0xd8ca('0x47')]['id']}},_0x2dffca={};_0x2dffca[_0xd8ca('0x37')]=_[_0xd8ca('0x34')](db[_0xd8ca('0x2e')]['rawAttributes']);_0x2dffca[_0xd8ca('0x33')]=_[_0xd8ca('0x34')](_0x387309['query']);_0x2dffca['filters']=_[_0xd8ca('0x36')](_0x2dffca[_0xd8ca('0x37')],_0x2dffca[_0xd8ca('0x33')]);_0x15d671[_0xd8ca('0x39')]=_[_0xd8ca('0x36')](_0x2dffca[_0xd8ca('0x37')],qs[_0xd8ca('0x38')](_0x387309[_0xd8ca('0x33')]['fields']));_0x15d671[_0xd8ca('0x39')]=_0x15d671[_0xd8ca('0x39')][_0xd8ca('0x3a')]?_0x15d671[_0xd8ca('0x39')]:_0x2dffca[_0xd8ca('0x37')];if(_0x387309[_0xd8ca('0x33')][_0xd8ca('0x42')]){_0x15d671[_0xd8ca('0x43')]=[{'all':!![]}];}_0x15d671=_['merge']({},_0x15d671,_0x387309[_0xd8ca('0x41')]);return db[_0xd8ca('0x2e')]['find'](_0x15d671)[_0xd8ca('0x28')](handleEntityNotFound(_0x2d10b3,null))[_0xd8ca('0x28')](respondWithResult(_0x2d10b3,null))[_0xd8ca('0x46')](handleError(_0x2d10b3,null));};exports[_0xd8ca('0x48')]=function(_0x449758,_0x31ca73){return db[_0xd8ca('0x2e')][_0xd8ca('0x48')](_0x449758['body'],{})[_0xd8ca('0x28')](respondWithResult(_0x31ca73,0xc9))[_0xd8ca('0x46')](handleError(_0x31ca73,null));};exports[_0xd8ca('0x49')]=function(_0x513b2e,_0x346497){if(_0x513b2e[_0xd8ca('0x4a')]['id']){delete _0x513b2e[_0xd8ca('0x4a')]['id'];}return db[_0xd8ca('0x2e')][_0xd8ca('0x4b')]({'where':{'id':_0x513b2e[_0xd8ca('0x47')]['id']}})[_0xd8ca('0x28')](handleEntityNotFound(_0x346497,null))[_0xd8ca('0x28')](saveUpdates(_0x513b2e[_0xd8ca('0x4a')],null))[_0xd8ca('0x28')](respondWithResult(_0x346497,null))[_0xd8ca('0x46')](handleError(_0x346497,null));};exports['destroy']=function(_0xfd8ad6,_0x3c1808){return db['ChatQueueReport'][_0xd8ca('0x4b')]({'where':{'id':_0xfd8ad6[_0xd8ca('0x47')]['id']}})[_0xd8ca('0x28')](handleEntityNotFound(_0x3c1808,null))[_0xd8ca('0x28')](removeEntity(_0x3c1808,null))[_0xd8ca('0x46')](handleError(_0x3c1808,null));};exports[_0xd8ca('0x4c')]=function(_0xd6d446,_0x43d3ef){return db[_0xd8ca('0x2e')]['describe']()['then'](respondWithResult(_0x43d3ef,null))[_0xd8ca('0x46')](handleError(_0x43d3ef,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index e9cb429..20e2157 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 _0xd8b0=['define','report_chat_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x539b22,_0x5541b6){var _0x5adc6e=function(_0x2bfff0){while(--_0x2bfff0){_0x539b22['push'](_0x539b22['shift']());}};_0x5adc6e(++_0x5541b6);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./chatQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('ChatQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util'];(function(_0x29210d,_0x45648b){var _0x4a66e6=function(_0x1ec623){while(--_0x1ec623){_0x29210d['push'](_0x29210d['shift']());}};_0x4a66e6(++_0x45648b);}(_0xe706,0xa3));var _0x6e70=function(_0xa1181c,_0x1724a4){_0xa1181c=_0xa1181c-0x0;var _0x1ef296=_0xe706[_0xa1181c];return _0x1ef296;};'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 3e4c2b4..1f2e1e7 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 _0xdc35=['request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','UpdateChatQueueReport','update','where','limit','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http'];(function(_0x28b018,_0x4fbe0d){var _0x9c8f15=function(_0x1fb613){while(--_0x1fb613){_0x28b018['push'](_0x28b018['shift']());}};_0x9c8f15(++_0x4fbe0d);}(_0xdc35,0xd6));var _0x5dc3=function(_0x57aed8,_0x6fb70b){_0x57aed8=_0x57aed8-0x0;var _0x4a9c3b=_0xdc35[_0x57aed8];return _0x4a9c3b;};'use strict';var _=require(_0x5dc3('0x0'));var util=require('util');var moment=require(_0x5dc3('0x1'));var BPromise=require(_0x5dc3('0x2'));var rs=require(_0x5dc3('0x3'));var fs=require('fs');var Redis=require(_0x5dc3('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5dc3('0x5'));var logger=require(_0x5dc3('0x6'))('rpc');var config=require(_0x5dc3('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5dc3('0x8')][_0x5dc3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x44f0f1,_0x452fe4,_0x162980){return new BPromise(function(_0x1146dc,_0x472506){return client[_0x5dc3('0xa')](_0x44f0f1,_0x162980)[_0x5dc3('0xb')](function(_0x24f17e){logger[_0x5dc3('0xc')](_0x5dc3('0xd'),_0x452fe4,_0x5dc3('0xe'));logger[_0x5dc3('0xf')](_0x5dc3('0x10'),_0x452fe4,_0x5dc3('0xe'),JSON[_0x5dc3('0x11')](_0x24f17e));if(_0x24f17e[_0x5dc3('0x12')]){if(_0x24f17e[_0x5dc3('0x12')][_0x5dc3('0x13')]===0x1f4){logger[_0x5dc3('0x12')]('ChatQueueReport,\x20%s,\x20%s',_0x452fe4,_0x24f17e[_0x5dc3('0x12')][_0x5dc3('0x14')]);return _0x472506(_0x24f17e[_0x5dc3('0x12')][_0x5dc3('0x14')]);}logger['error'](_0x5dc3('0xd'),_0x452fe4,_0x24f17e[_0x5dc3('0x12')]['message']);return _0x1146dc(_0x24f17e[_0x5dc3('0x12')][_0x5dc3('0x14')]);}else{logger[_0x5dc3('0xc')](_0x5dc3('0xd'),_0x452fe4,_0x5dc3('0xe'));_0x1146dc(_0x24f17e['result'][_0x5dc3('0x14')]);}})[_0x5dc3('0x15')](function(_0x2aab46){logger['error'](_0x5dc3('0xd'),_0x452fe4,_0x2aab46);_0x472506(_0x2aab46);});});}exports[_0x5dc3('0x16')]=function(_0x1218ad){var _0x4b5107=this;return new Promise(function(_0x3da36e,_0x582442){return db[_0x5dc3('0x17')][_0x5dc3('0x18')](_0x1218ad[_0x5dc3('0x19')],{'raw':_0x1218ad['options']?_0x1218ad[_0x5dc3('0x1a')][_0x5dc3('0x1b')]===undefined?!![]:![]:!![]})[_0x5dc3('0xb')](function(_0x3e51b4){logger[_0x5dc3('0xc')](_0x5dc3('0x16'),_0x1218ad);logger['debug'](_0x5dc3('0x16'),_0x1218ad,JSON['stringify'](_0x3e51b4));_0x3da36e(_0x3e51b4);})['catch'](function(_0x5d11bb){logger[_0x5dc3('0x12')](_0x5dc3('0x16'),_0x5d11bb[_0x5dc3('0x14')],_0x1218ad);_0x582442(_0x4b5107[_0x5dc3('0x12')](0x1f4,_0x5d11bb[_0x5dc3('0x14')]));});});};exports[_0x5dc3('0x1c')]=function(_0x3927ee){var _0x47a0c3=this;return new Promise(function(_0xcbe2f2,_0x14dc54){return db[_0x5dc3('0x17')][_0x5dc3('0x1d')](_0x3927ee[_0x5dc3('0x19')],{'raw':_0x3927ee['options']?_0x3927ee[_0x5dc3('0x1a')][_0x5dc3('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3927ee[_0x5dc3('0x1a')]?_0x3927ee[_0x5dc3('0x1a')][_0x5dc3('0x1e')]||null:null,'attributes':_0x3927ee[_0x5dc3('0x1a')]?_0x3927ee[_0x5dc3('0x1a')]['attributes']||null:null,'limit':_0x3927ee[_0x5dc3('0x1a')]?_0x3927ee[_0x5dc3('0x1a')][_0x5dc3('0x1f')]||null:null})[_0x5dc3('0xb')](function(_0x15091d){logger['info']('UpdateChatQueueReport',_0x3927ee);logger[_0x5dc3('0xf')](_0x5dc3('0x1c'),_0x3927ee,JSON[_0x5dc3('0x11')](_0x15091d));_0xcbe2f2(_0x15091d);})[_0x5dc3('0x15')](function(_0x1d44f3){logger[_0x5dc3('0x12')](_0x5dc3('0x1c'),_0x1d44f3[_0x5dc3('0x14')],_0x3927ee);_0x14dc54(_0x47a0c3[_0x5dc3('0x12')](0x1f4,_0x1d44f3['message']));});});}; \ No newline at end of file +var _0x5780=['UpdateChatQueueReport','update','raw','where','attributes','limit','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','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','ChatQueueReport','body','options','CreateChatQueueReport','catch'];(function(_0x514167,_0xfc1d16){var _0x3a88e2=function(_0x5fb554){while(--_0x5fb554){_0x514167['push'](_0x514167['shift']());}};_0x3a88e2(++_0xfc1d16);}(_0x5780,0xed));var _0x0578=function(_0x189978,_0x48d117){_0x189978=_0x189978-0x0;var _0x1a7dc8=_0x5780[_0x189978];return _0x1a7dc8;};'use strict';var _=require('lodash');var util=require(_0x0578('0x0'));var moment=require(_0x0578('0x1'));var BPromise=require(_0x0578('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0578('0x3'));var db=require(_0x0578('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0578('0x5'))(_0x0578('0x6'));var config=require('../../config/environment');var jayson=require(_0x0578('0x7'));var client=jayson[_0x0578('0x8')][_0x0578('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4de26f,_0x35bbdc,_0x23d3c5){return new BPromise(function(_0x2d8c67,_0x4ef661){return client[_0x0578('0xa')](_0x4de26f,_0x23d3c5)[_0x0578('0xb')](function(_0x3152ec){logger['info'](_0x0578('0xc'),_0x35bbdc,_0x0578('0xd'));logger[_0x0578('0xe')](_0x0578('0xf'),_0x35bbdc,_0x0578('0xd'),JSON[_0x0578('0x10')](_0x3152ec));if(_0x3152ec[_0x0578('0x11')]){if(_0x3152ec[_0x0578('0x11')][_0x0578('0x12')]===0x1f4){logger[_0x0578('0x11')](_0x0578('0xc'),_0x35bbdc,_0x3152ec[_0x0578('0x11')][_0x0578('0x13')]);return _0x4ef661(_0x3152ec[_0x0578('0x11')][_0x0578('0x13')]);}logger[_0x0578('0x11')](_0x0578('0xc'),_0x35bbdc,_0x3152ec[_0x0578('0x11')][_0x0578('0x13')]);return _0x2d8c67(_0x3152ec[_0x0578('0x11')][_0x0578('0x13')]);}else{logger[_0x0578('0x14')](_0x0578('0xc'),_0x35bbdc,_0x0578('0xd'));_0x2d8c67(_0x3152ec[_0x0578('0x15')]['message']);}})['catch'](function(_0x2965f6){logger[_0x0578('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0x35bbdc,_0x2965f6);_0x4ef661(_0x2965f6);});});}exports['CreateChatQueueReport']=function(_0x10afba){var _0x3eebd0=this;return new Promise(function(_0x4ece78,_0x2615d0){return db[_0x0578('0x16')]['create'](_0x10afba[_0x0578('0x17')],{'raw':_0x10afba[_0x0578('0x18')]?_0x10afba[_0x0578('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x0578('0xb')](function(_0x3d8d62){logger[_0x0578('0x14')](_0x0578('0x19'),_0x10afba);logger[_0x0578('0xe')](_0x0578('0x19'),_0x10afba,JSON[_0x0578('0x10')](_0x3d8d62));_0x4ece78(_0x3d8d62);})[_0x0578('0x1a')](function(_0x3298ad){logger[_0x0578('0x11')]('CreateChatQueueReport',_0x3298ad[_0x0578('0x13')],_0x10afba);_0x2615d0(_0x3eebd0[_0x0578('0x11')](0x1f4,_0x3298ad['message']));});});};exports[_0x0578('0x1b')]=function(_0x400135){var _0x1d540b=this;return new Promise(function(_0x5774f6,_0x5277a4){return db['ChatQueueReport'][_0x0578('0x1c')](_0x400135[_0x0578('0x17')],{'raw':_0x400135['options']?_0x400135['options'][_0x0578('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x400135[_0x0578('0x18')]?_0x400135[_0x0578('0x18')][_0x0578('0x1e')]||null:null,'attributes':_0x400135[_0x0578('0x18')]?_0x400135['options'][_0x0578('0x1f')]||null:null,'limit':_0x400135[_0x0578('0x18')]?_0x400135[_0x0578('0x18')][_0x0578('0x20')]||null:null})[_0x0578('0xb')](function(_0x3dbbc3){logger[_0x0578('0x14')](_0x0578('0x1b'),_0x400135);logger[_0x0578('0xe')]('UpdateChatQueueReport',_0x400135,JSON[_0x0578('0x10')](_0x3dbbc3));_0x5774f6(_0x3dbbc3);})['catch'](function(_0x40f014){logger[_0x0578('0x11')](_0x0578('0x1b'),_0x40f014[_0x0578('0x13')],_0x400135);_0x5277a4(_0x1d540b[_0x0578('0x11')](0x1f4,_0x40f014[_0x0578('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 66ecd58..0c6b8d2 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 _0xb220=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueueReport.controller','get','index','/describe','isAuthenticated','/:id','post','create','put','destroy','exports','multer','path','connect-timeout'];(function(_0x333714,_0x3370ac){var _0x4c211e=function(_0x34219b){while(--_0x34219b){_0x333714['push'](_0x333714['shift']());}};_0x4c211e(++_0x3370ac);}(_0xb220,0x153));var _0x0b22=function(_0x486d6f,_0x101ab0){_0x486d6f=_0x486d6f-0x0;var _0x413481=_0xb220[_0x486d6f];return _0x413481;};'use strict';var multer=require(_0x0b22('0x0'));var util=require('util');var path=require(_0x0b22('0x1'));var timeout=require(_0x0b22('0x2'));var express=require(_0x0b22('0x3'));var router=express[_0x0b22('0x4')]();var fs_extra=require(_0x0b22('0x5'));var auth=require(_0x0b22('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x0b22('0x7'));var controller=require(_0x0b22('0x8'));router[_0x0b22('0x9')]('/',auth['isAuthenticated'](),controller[_0x0b22('0xa')]);router[_0x0b22('0x9')](_0x0b22('0xb'),auth[_0x0b22('0xc')](),controller['describe']);router['get'](_0x0b22('0xd'),auth[_0x0b22('0xc')](),controller['show']);router[_0x0b22('0xe')]('/',auth[_0x0b22('0xc')](),controller[_0x0b22('0xf')]);router[_0x0b22('0x10')](_0x0b22('0xd'),auth[_0x0b22('0xc')](),controller['update']);router['delete']('/:id',auth[_0x0b22('0xc')](),controller[_0x0b22('0x11')]);module[_0x0b22('0x12')]=router; \ No newline at end of file +var _0x1c8e=['update','destroy','exports','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put'];(function(_0xa1422,_0x4a7809){var _0x3b87fb=function(_0x1a921d){while(--_0x1a921d){_0xa1422['push'](_0xa1422['shift']());}};_0x3b87fb(++_0x4a7809);}(_0x1c8e,0x159));var _0xe1c8=function(_0x5b6670,_0x10fa2c){_0x5b6670=_0x5b6670-0x0;var _0x11714c=_0x1c8e[_0x5b6670];return _0x11714c;};'use strict';var multer=require('multer');var util=require(_0xe1c8('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe1c8('0x1'));var router=express[_0xe1c8('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xe1c8('0x3'));var interaction=require(_0xe1c8('0x4'));var config=require(_0xe1c8('0x5'));var controller=require(_0xe1c8('0x6'));router[_0xe1c8('0x7')]('/',auth[_0xe1c8('0x8')](),controller[_0xe1c8('0x9')]);router[_0xe1c8('0x7')](_0xe1c8('0xa'),auth[_0xe1c8('0x8')](),controller['describe']);router['get'](_0xe1c8('0xb'),auth['isAuthenticated'](),controller[_0xe1c8('0xc')]);router[_0xe1c8('0xd')]('/',auth['isAuthenticated'](),controller[_0xe1c8('0xe')]);router[_0xe1c8('0xf')](_0xe1c8('0xb'),auth[_0xe1c8('0x8')](),controller[_0xe1c8('0x10')]);router['delete'](_0xe1c8('0xb'),auth[_0xe1c8('0x8')](),controller[_0xe1c8('0x11')]);module[_0xe1c8('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 653e674..988487b 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 _0xe706=['NOW','moment','sequelize','exports','ENUM','account','agent','queue','DATE'];(function(_0x41d938,_0x107a5b){var _0x38e26b=function(_0x5b4caf){while(--_0x5b4caf){_0x41d938['push'](_0x41d938['shift']());}};_0x38e26b(++_0x107a5b);}(_0xe706,0xa3));var _0x6e70=function(_0x3645e5,_0x1e9457){_0x3645e5=_0x3645e5-0x0;var _0x25f856=_0xe706[_0x3645e5];return _0x25f856;};'use strict';var moment=require(_0x6e70('0x0'));var Sequelize=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x6e70('0x3')](_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6')),'allowNull':![],'defaultValue':_0x6e70('0x6')},'transferredAt':{'type':Sequelize[_0x6e70('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x6e70('0x8')]}}; \ No newline at end of file +var _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x1d383c,_0x3e832f){var _0x31f35e=function(_0x1f7b1c){while(--_0x1f7b1c){_0x1d383c['push'](_0x1d383c['shift']());}};_0x31f35e(++_0x3e832f);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3fe6df,_0x5a04d4){_0x3fe6df=_0x3fe6df-0x0;var _0x372a0e=_0xcb91[_0x3fe6df];return _0x372a0e;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index f8d9638..d187704 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 _0x3e7a=['apply','reject','save','then','destroy','error','name','index','map','ChatTransferReport','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','include','find','create','body','update','describe','eml-format','zip-dir','fast-json-patch','mustache','util','sox','ejs','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range'];(function(_0x2f1a92,_0x2eff28){var _0x279dd1=function(_0x254ec8){while(--_0x254ec8){_0x2f1a92['push'](_0x2f1a92['shift']());}};_0x279dd1(++_0x2eff28);}(_0x3e7a,0xb1));var _0xa3e7=function(_0x41c996,_0xa79e16){_0x41c996=_0x41c996-0x0;var _0x10cd4d=_0x3e7a[_0x41c996];return _0x10cd4d;};'use strict';var emlformat=require(_0xa3e7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa3e7('0x1'));var jsonpatch=require(_0xa3e7('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa3e7('0x3'));var util=require(_0xa3e7('0x4'));var path=require('path');var sox=require(_0xa3e7('0x5'));var csv=require('to-csv');var ejs=require(_0xa3e7('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xa3e7('0x7'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa3e7('0x8'));var Papa=require(_0xa3e7('0x9'));var Redis=require(_0xa3e7('0xa'));var authService=require(_0xa3e7('0xb'));var qs=require('../../components/parsers/qs');var as=require(_0xa3e7('0xc'));var hardwareService=require(_0xa3e7('0xd'));var logger=require(_0xa3e7('0xe'))(_0xa3e7('0xf'));var utils=require(_0xa3e7('0x10'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa3e7('0x11'))['db'];function respondWithStatusCode(_0x759c77,_0x47b29e){_0x47b29e=_0x47b29e||0xcc;return function(_0x2c8bde){if(_0x2c8bde){return _0x759c77[_0xa3e7('0x12')](_0x47b29e);}return _0x759c77[_0xa3e7('0x13')](_0x47b29e)[_0xa3e7('0x14')]();};}function respondWithResult(_0x3d5783,_0x65b366){_0x65b366=_0x65b366||0xc8;return function(_0x48a0cf){if(_0x48a0cf){return _0x3d5783[_0xa3e7('0x13')](_0x65b366)[_0xa3e7('0x15')](_0x48a0cf);}};}function respondWithFilteredResult(_0x2578bb,_0x58f08c){return function(_0x304719){if(_0x304719){var _0x29ec40=typeof _0x58f08c[_0xa3e7('0x16')]==='undefined'&&typeof _0x58f08c['limit']===_0xa3e7('0x17');var _0x338308=_0x304719[_0xa3e7('0x18')];var _0xa7f81f=_0x29ec40?0x0:_0x58f08c[_0xa3e7('0x16')];var _0x192258=_0x29ec40?_0x304719['count']:_0x58f08c[_0xa3e7('0x16')]+_0x58f08c[_0xa3e7('0x19')];var _0x577a25;if(_0x192258>=_0x338308){_0x192258=_0x338308;_0x577a25=0xc8;}else{_0x577a25=0xce;}_0x2578bb['status'](_0x577a25);return _0x2578bb['set'](_0xa3e7('0x1a'),_0xa7f81f+'-'+_0x192258+'/'+_0x338308)[_0xa3e7('0x15')](_0x304719);}return null;};}function patchUpdates(_0x47fd87){return function(_0x2f1635){try{jsonpatch[_0xa3e7('0x1b')](_0x2f1635,_0x47fd87,!![]);}catch(_0x2a14c5){return BPromise[_0xa3e7('0x1c')](_0x2a14c5);}return _0x2f1635[_0xa3e7('0x1d')]();};}function saveUpdates(_0x5471a0,_0x279077){return function(_0x29e15c){if(_0x29e15c){return _0x29e15c['update'](_0x5471a0)[_0xa3e7('0x1e')](function(_0xd3e144){return _0xd3e144;});}return null;};}function removeEntity(_0x245a47,_0x44a802){return function(_0x801b00){if(_0x801b00){return _0x801b00[_0xa3e7('0x1f')]()[_0xa3e7('0x1e')](function(){_0x245a47[_0xa3e7('0x13')](0xcc)[_0xa3e7('0x14')]();});}};}function handleEntityNotFound(_0xb8a2c2,_0x4d9313){return function(_0x43b115){if(!_0x43b115){_0xb8a2c2[_0xa3e7('0x12')](0x194);}return _0x43b115;};}function handleError(_0x4646b0,_0x15702e){_0x15702e=_0x15702e||0x1f4;return function(_0x17cbd9){logger[_0xa3e7('0x20')](_0x17cbd9['stack']);if(_0x17cbd9[_0xa3e7('0x21')]){delete _0x17cbd9[_0xa3e7('0x21')];}_0x4646b0['status'](_0x15702e)['send'](_0x17cbd9);};}exports[_0xa3e7('0x22')]=function(_0x579c11,_0x414b40){var _0x32e16a={},_0x3e7d91={},_0x4106ef={'count':0x0,'rows':[]};var _0x55303d=_[_0xa3e7('0x23')](db[_0xa3e7('0x24')][_0xa3e7('0x25')],function(_0x2210d5){return{'name':_0x2210d5[_0xa3e7('0x26')],'type':_0x2210d5['type'][_0xa3e7('0x27')]};});_0x3e7d91[_0xa3e7('0x28')]=_['map'](_0x55303d,_0xa3e7('0x21'));_0x3e7d91[_0xa3e7('0x29')]=_['keys'](_0x579c11['query']);_0x3e7d91[_0xa3e7('0x2a')]=_['intersection'](_0x3e7d91['model'],_0x3e7d91['query']);_0x32e16a['attributes']=_[_0xa3e7('0x2b')](_0x3e7d91[_0xa3e7('0x28')],qs[_0xa3e7('0x2c')](_0x579c11['query']['fields']));_0x32e16a['attributes']=_0x32e16a[_0xa3e7('0x2d')][_0xa3e7('0x2e')]?_0x32e16a[_0xa3e7('0x2d')]:_0x3e7d91[_0xa3e7('0x28')];if(!_0x579c11[_0xa3e7('0x29')][_0xa3e7('0x2f')]('nolimit')){_0x32e16a[_0xa3e7('0x19')]=qs[_0xa3e7('0x19')](_0x579c11[_0xa3e7('0x29')][_0xa3e7('0x19')]);_0x32e16a['offset']=qs['offset'](_0x579c11[_0xa3e7('0x29')][_0xa3e7('0x16')]);}_0x32e16a['order']=qs['sort'](_0x579c11[_0xa3e7('0x29')]['sort']);_0x32e16a[_0xa3e7('0x30')]=qs[_0xa3e7('0x2a')](_[_0xa3e7('0x31')](_0x579c11[_0xa3e7('0x29')],_0x3e7d91[_0xa3e7('0x2a')]),_0x55303d);if(_0x579c11[_0xa3e7('0x29')][_0xa3e7('0x32')]){_0x32e16a[_0xa3e7('0x30')]=_[_0xa3e7('0x33')](_0x32e16a[_0xa3e7('0x30')],{'$or':_['map'](_0x55303d,function(_0x5ac925){if(_0x5ac925[_0xa3e7('0x34')]!==_0xa3e7('0x35')){var _0x25e848={};_0x25e848[_0x5ac925['name']]={'$like':'%'+_0x579c11[_0xa3e7('0x29')][_0xa3e7('0x32')]+'%'};return _0x25e848;}})});}_0x32e16a=_[_0xa3e7('0x33')]({},_0x32e16a,_0x579c11[_0xa3e7('0x36')]);var _0x59e48b={'where':_0x32e16a[_0xa3e7('0x30')]};return db[_0xa3e7('0x24')][_0xa3e7('0x18')](_0x59e48b)[_0xa3e7('0x1e')](function(_0x523c29){_0x4106ef[_0xa3e7('0x18')]=_0x523c29;if(_0x579c11[_0xa3e7('0x29')][_0xa3e7('0x37')]){_0x32e16a['include']=[{'all':!![]}];}return db[_0xa3e7('0x24')][_0xa3e7('0x38')](_0x32e16a);})['then'](function(_0x1d041d){_0x4106ef[_0xa3e7('0x39')]=_0x1d041d;return _0x4106ef;})['then'](respondWithFilteredResult(_0x414b40,_0x32e16a))[_0xa3e7('0x3a')](handleError(_0x414b40,null));};exports[_0xa3e7('0x3b')]=function(_0x59989c,_0x12631e){var _0x3ef93f={'raw':!![],'where':{'id':_0x59989c[_0xa3e7('0x3c')]['id']}},_0x3529ea={};_0x3529ea[_0xa3e7('0x28')]=_[_0xa3e7('0x3d')](db[_0xa3e7('0x24')][_0xa3e7('0x25')]);_0x3529ea['query']=_[_0xa3e7('0x3d')](_0x59989c[_0xa3e7('0x29')]);_0x3529ea[_0xa3e7('0x2a')]=_[_0xa3e7('0x2b')](_0x3529ea[_0xa3e7('0x28')],_0x3529ea[_0xa3e7('0x29')]);_0x3ef93f[_0xa3e7('0x2d')]=_['intersection'](_0x3529ea[_0xa3e7('0x28')],qs[_0xa3e7('0x2c')](_0x59989c[_0xa3e7('0x29')][_0xa3e7('0x2c')]));_0x3ef93f[_0xa3e7('0x2d')]=_0x3ef93f['attributes'][_0xa3e7('0x2e')]?_0x3ef93f[_0xa3e7('0x2d')]:_0x3529ea[_0xa3e7('0x28')];if(_0x59989c[_0xa3e7('0x29')][_0xa3e7('0x37')]){_0x3ef93f[_0xa3e7('0x3e')]=[{'all':!![]}];}_0x3ef93f=_['merge']({},_0x3ef93f,_0x59989c[_0xa3e7('0x36')]);return db['ChatTransferReport'][_0xa3e7('0x3f')](_0x3ef93f)[_0xa3e7('0x1e')](handleEntityNotFound(_0x12631e,null))[_0xa3e7('0x1e')](respondWithResult(_0x12631e,null))['catch'](handleError(_0x12631e,null));};exports['create']=function(_0x1598da,_0x53cd45){return db[_0xa3e7('0x24')][_0xa3e7('0x40')](_0x1598da[_0xa3e7('0x41')],{})['then'](respondWithResult(_0x53cd45,0xc9))[_0xa3e7('0x3a')](handleError(_0x53cd45,null));};exports[_0xa3e7('0x42')]=function(_0x691281,_0x4a0e71){if(_0x691281[_0xa3e7('0x41')]['id']){delete _0x691281['body']['id'];}return db[_0xa3e7('0x24')][_0xa3e7('0x3f')]({'where':{'id':_0x691281['params']['id']}})[_0xa3e7('0x1e')](handleEntityNotFound(_0x4a0e71,null))[_0xa3e7('0x1e')](saveUpdates(_0x691281[_0xa3e7('0x41')],null))[_0xa3e7('0x1e')](respondWithResult(_0x4a0e71,null))[_0xa3e7('0x3a')](handleError(_0x4a0e71,null));};exports[_0xa3e7('0x1f')]=function(_0x55589e,_0x325087){return db[_0xa3e7('0x24')][_0xa3e7('0x3f')]({'where':{'id':_0x55589e['params']['id']}})['then'](handleEntityNotFound(_0x325087,null))[_0xa3e7('0x1e')](removeEntity(_0x325087,null))[_0xa3e7('0x3a')](handleError(_0x325087,null));};exports['describe']=function(_0x762158,_0x371532){return db[_0xa3e7('0x24')][_0xa3e7('0x43')]()[_0xa3e7('0x1e')](respondWithResult(_0x371532,null))['catch'](handleError(_0x371532,null));}; \ No newline at end of file +var _0x3af0=['count','set','Content-Range','json','apply','then','destroy','sendStatus','error','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','options','include','findAll','catch','show','params','keys','includeAll','merge','find','create','body','update','describe','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','status','end','offset','undefined','limit'];(function(_0x4d3bcb,_0x5af0fe){var _0x594212=function(_0x3cd28d){while(--_0x3cd28d){_0x4d3bcb['push'](_0x4d3bcb['shift']());}};_0x594212(++_0x5af0fe);}(_0x3af0,0x7a));var _0x03af=function(_0x38ba95,_0x2771ae){_0x38ba95=_0x38ba95-0x0;var _0x1f1d33=_0x3af0[_0x38ba95];return _0x1f1d33;};'use strict';var emlformat=require(_0x03af('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x03af('0x1'));var moment=require(_0x03af('0x2'));var BPromise=require(_0x03af('0x3'));var Mustache=require(_0x03af('0x4'));var util=require(_0x03af('0x5'));var path=require(_0x03af('0x6'));var sox=require(_0x03af('0x7'));var csv=require(_0x03af('0x8'));var ejs=require(_0x03af('0x9'));var fs=require('fs');var fs_extra=require(_0x03af('0xa'));var _=require(_0x03af('0xb'));var squel=require('squel');var crypto=require(_0x03af('0xc'));var jsforce=require(_0x03af('0xd'));var deskjs=require(_0x03af('0xe'));var toCsv=require(_0x03af('0x8'));var querystring=require(_0x03af('0xf'));var Papa=require(_0x03af('0x10'));var Redis=require(_0x03af('0x11'));var authService=require(_0x03af('0x12'));var qs=require(_0x03af('0x13'));var as=require(_0x03af('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x03af('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x03af('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xdd0da,_0x2f2ee0){_0x2f2ee0=_0x2f2ee0||0xcc;return function(_0x211204){if(_0x211204){return _0xdd0da['sendStatus'](_0x2f2ee0);}return _0xdd0da[_0x03af('0x17')](_0x2f2ee0)[_0x03af('0x18')]();};}function respondWithResult(_0x4ae4af,_0x242b38){_0x242b38=_0x242b38||0xc8;return function(_0x29faa6){if(_0x29faa6){return _0x4ae4af[_0x03af('0x17')](_0x242b38)['json'](_0x29faa6);}};}function respondWithFilteredResult(_0x1ec51a,_0x3b09ba){return function(_0x505ffc){if(_0x505ffc){var _0x5acac4=typeof _0x3b09ba[_0x03af('0x19')]===_0x03af('0x1a')&&typeof _0x3b09ba[_0x03af('0x1b')]===_0x03af('0x1a');var _0x2ff018=_0x505ffc[_0x03af('0x1c')];var _0x2764c6=_0x5acac4?0x0:_0x3b09ba[_0x03af('0x19')];var _0x3403d9=_0x5acac4?_0x505ffc[_0x03af('0x1c')]:_0x3b09ba[_0x03af('0x19')]+_0x3b09ba[_0x03af('0x1b')];var _0x406c72;if(_0x3403d9>=_0x2ff018){_0x3403d9=_0x2ff018;_0x406c72=0xc8;}else{_0x406c72=0xce;}_0x1ec51a[_0x03af('0x17')](_0x406c72);return _0x1ec51a[_0x03af('0x1d')](_0x03af('0x1e'),_0x2764c6+'-'+_0x3403d9+'/'+_0x2ff018)[_0x03af('0x1f')](_0x505ffc);}return null;};}function patchUpdates(_0x14ec3f){return function(_0x5409c9){try{jsonpatch[_0x03af('0x20')](_0x5409c9,_0x14ec3f,!![]);}catch(_0x2a9402){return BPromise['reject'](_0x2a9402);}return _0x5409c9['save']();};}function saveUpdates(_0x1002ec,_0xa5a2be){return function(_0x4f30a7){if(_0x4f30a7){return _0x4f30a7['update'](_0x1002ec)[_0x03af('0x21')](function(_0x175e16){return _0x175e16;});}return null;};}function removeEntity(_0x11ba0f,_0x11ef06){return function(_0x514d46){if(_0x514d46){return _0x514d46[_0x03af('0x22')]()[_0x03af('0x21')](function(){_0x11ba0f[_0x03af('0x17')](0xcc)[_0x03af('0x18')]();});}};}function handleEntityNotFound(_0x1a8690,_0x1fc081){return function(_0x47fd73){if(!_0x47fd73){_0x1a8690[_0x03af('0x23')](0x194);}return _0x47fd73;};}function handleError(_0x65c145,_0x34274a){_0x34274a=_0x34274a||0x1f4;return function(_0x1205aa){logger[_0x03af('0x24')](_0x1205aa[_0x03af('0x25')]);if(_0x1205aa['name']){delete _0x1205aa[_0x03af('0x26')];}_0x65c145[_0x03af('0x17')](_0x34274a)[_0x03af('0x27')](_0x1205aa);};}exports[_0x03af('0x28')]=function(_0x1ba3c1,_0x33b6b9){var _0x5b4049={},_0x3e4a3b={},_0x54813e={'count':0x0,'rows':[]};var _0x91fa85=_[_0x03af('0x29')](db[_0x03af('0x2a')][_0x03af('0x2b')],function(_0xe8f5d){return{'name':_0xe8f5d[_0x03af('0x2c')],'type':_0xe8f5d[_0x03af('0x2d')][_0x03af('0x2e')]};});_0x3e4a3b[_0x03af('0x2f')]=_[_0x03af('0x29')](_0x91fa85,_0x03af('0x26'));_0x3e4a3b['query']=_['keys'](_0x1ba3c1['query']);_0x3e4a3b[_0x03af('0x30')]=_[_0x03af('0x31')](_0x3e4a3b['model'],_0x3e4a3b[_0x03af('0x32')]);_0x5b4049[_0x03af('0x33')]=_['intersection'](_0x3e4a3b['model'],qs[_0x03af('0x34')](_0x1ba3c1['query']['fields']));_0x5b4049[_0x03af('0x33')]=_0x5b4049[_0x03af('0x33')][_0x03af('0x35')]?_0x5b4049['attributes']:_0x3e4a3b[_0x03af('0x2f')];if(!_0x1ba3c1[_0x03af('0x32')][_0x03af('0x36')](_0x03af('0x37'))){_0x5b4049[_0x03af('0x1b')]=qs[_0x03af('0x1b')](_0x1ba3c1[_0x03af('0x32')][_0x03af('0x1b')]);_0x5b4049[_0x03af('0x19')]=qs[_0x03af('0x19')](_0x1ba3c1['query'][_0x03af('0x19')]);}_0x5b4049[_0x03af('0x38')]=qs[_0x03af('0x39')](_0x1ba3c1['query'][_0x03af('0x39')]);_0x5b4049['where']=qs[_0x03af('0x30')](_[_0x03af('0x3a')](_0x1ba3c1['query'],_0x3e4a3b['filters']),_0x91fa85);if(_0x1ba3c1[_0x03af('0x32')][_0x03af('0x3b')]){_0x5b4049[_0x03af('0x3c')]=_['merge'](_0x5b4049[_0x03af('0x3c')],{'$or':_[_0x03af('0x29')](_0x91fa85,function(_0xefba7){if(_0xefba7[_0x03af('0x2d')]!=='VIRTUAL'){var _0x30351f={};_0x30351f[_0xefba7[_0x03af('0x26')]]={'$like':'%'+_0x1ba3c1[_0x03af('0x32')][_0x03af('0x3b')]+'%'};return _0x30351f;}})});}_0x5b4049=_['merge']({},_0x5b4049,_0x1ba3c1[_0x03af('0x3d')]);var _0x5f23cf={'where':_0x5b4049['where']};return db['ChatTransferReport'][_0x03af('0x1c')](_0x5f23cf)[_0x03af('0x21')](function(_0x3bcb89){_0x54813e[_0x03af('0x1c')]=_0x3bcb89;if(_0x1ba3c1['query']['includeAll']){_0x5b4049[_0x03af('0x3e')]=[{'all':!![]}];}return db['ChatTransferReport'][_0x03af('0x3f')](_0x5b4049);})[_0x03af('0x21')](function(_0x2226e7){_0x54813e['rows']=_0x2226e7;return _0x54813e;})['then'](respondWithFilteredResult(_0x33b6b9,_0x5b4049))[_0x03af('0x40')](handleError(_0x33b6b9,null));};exports[_0x03af('0x41')]=function(_0x51196c,_0x4f0b0f){var _0x5485c3={'raw':!![],'where':{'id':_0x51196c[_0x03af('0x42')]['id']}},_0x554363={};_0x554363[_0x03af('0x2f')]=_[_0x03af('0x43')](db['ChatTransferReport']['rawAttributes']);_0x554363[_0x03af('0x32')]=_[_0x03af('0x43')](_0x51196c[_0x03af('0x32')]);_0x554363[_0x03af('0x30')]=_[_0x03af('0x31')](_0x554363['model'],_0x554363[_0x03af('0x32')]);_0x5485c3[_0x03af('0x33')]=_[_0x03af('0x31')](_0x554363['model'],qs[_0x03af('0x34')](_0x51196c[_0x03af('0x32')]['fields']));_0x5485c3[_0x03af('0x33')]=_0x5485c3[_0x03af('0x33')]['length']?_0x5485c3['attributes']:_0x554363['model'];if(_0x51196c['query'][_0x03af('0x44')]){_0x5485c3[_0x03af('0x3e')]=[{'all':!![]}];}_0x5485c3=_[_0x03af('0x45')]({},_0x5485c3,_0x51196c[_0x03af('0x3d')]);return db[_0x03af('0x2a')][_0x03af('0x46')](_0x5485c3)[_0x03af('0x21')](handleEntityNotFound(_0x4f0b0f,null))['then'](respondWithResult(_0x4f0b0f,null))['catch'](handleError(_0x4f0b0f,null));};exports[_0x03af('0x47')]=function(_0x428834,_0x2af36){return db[_0x03af('0x2a')][_0x03af('0x47')](_0x428834[_0x03af('0x48')],{})[_0x03af('0x21')](respondWithResult(_0x2af36,0xc9))[_0x03af('0x40')](handleError(_0x2af36,null));};exports[_0x03af('0x49')]=function(_0x161394,_0x582141){if(_0x161394['body']['id']){delete _0x161394[_0x03af('0x48')]['id'];}return db[_0x03af('0x2a')]['find']({'where':{'id':_0x161394[_0x03af('0x42')]['id']}})[_0x03af('0x21')](handleEntityNotFound(_0x582141,null))[_0x03af('0x21')](saveUpdates(_0x161394[_0x03af('0x48')],null))[_0x03af('0x21')](respondWithResult(_0x582141,null))[_0x03af('0x40')](handleError(_0x582141,null));};exports[_0x03af('0x22')]=function(_0x4a706a,_0x520247){return db[_0x03af('0x2a')][_0x03af('0x46')]({'where':{'id':_0x4a706a[_0x03af('0x42')]['id']}})[_0x03af('0x21')](handleEntityNotFound(_0x520247,null))['then'](removeEntity(_0x520247,null))[_0x03af('0x40')](handleError(_0x520247,null));};exports['describe']=function(_0x282a5f,_0x58585d){return db[_0x03af('0x2a')][_0x03af('0x4a')]()[_0x03af('0x21')](respondWithResult(_0x58585d,null))['catch'](handleError(_0x58585d,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 1186da4..9c787fa 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 _0x10dc=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','ChatTransferReport','report_chat_transfer','uniqueid','util','../../config/logger'];(function(_0x3e2d67,_0x3b781a){var _0x429d2a=function(_0x53879f){while(--_0x53879f){_0x3e2d67['push'](_0x3e2d67['shift']());}};_0x429d2a(++_0x3b781a);}(_0x10dc,0x1cc));var _0xc10d=function(_0x15af2f,_0x3c0a01){_0x15af2f=_0x15af2f-0x0;var _0x359239=_0x10dc[_0x15af2f];return _0x359239;};'use strict';var _=require('lodash');var util=require(_0xc10d('0x0'));var logger=require(_0xc10d('0x1'))(_0xc10d('0x2'));var moment=require(_0xc10d('0x3'));var BPromise=require(_0xc10d('0x4'));var rp=require(_0xc10d('0x5'));var fs=require('fs');var path=require(_0xc10d('0x6'));var rimraf=require(_0xc10d('0x7'));var config=require(_0xc10d('0x8'));var attributes=require(_0xc10d('0x9'));module[_0xc10d('0xa')]=function(_0x415277,_0x34785d){return _0x415277['define'](_0xc10d('0xb'),attributes,{'tableName':_0xc10d('0xc'),'paranoid':![],'indexes':[{'name':_0xc10d('0xd'),'fields':[_0xc10d('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x883b=['../../config/environment','./chatTransferReport.attributes','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x1cb1a0,_0x538a27){var _0x23d48e=function(_0x101f74){while(--_0x101f74){_0x1cb1a0['push'](_0x1cb1a0['shift']());}};_0x23d48e(++_0x538a27);}(_0x883b,0x12b));var _0xb883=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x883b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb883('0x0'));var util=require(_0xb883('0x1'));var logger=require(_0xb883('0x2'))(_0xb883('0x3'));var moment=require(_0xb883('0x4'));var BPromise=require(_0xb883('0x5'));var rp=require(_0xb883('0x6'));var fs=require('fs');var path=require(_0xb883('0x7'));var rimraf=require(_0xb883('0x8'));var config=require(_0xb883('0x9'));var attributes=require(_0xb883('0xa'));module['exports']=function(_0x5d4493,_0x43871e){return _0x5d4493['define'](_0xb883('0xb'),attributes,{'tableName':_0xb883('0xc'),'paranoid':![],'indexes':[{'name':_0xb883('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index b2dd787..ad5623f 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 _0x0f8e=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','util','bluebird','randomstring'];(function(_0x203387,_0x25ee77){var _0x358e6b=function(_0xf5b2ff){while(--_0xf5b2ff){_0x203387['push'](_0x203387['shift']());}};_0x358e6b(++_0x25ee77);}(_0x0f8e,0x1d8));var _0xe0f8=function(_0x121336,_0x3370ea){_0x121336=_0x121336-0x0;var _0x53ff9f=_0x0f8e[_0x121336];return _0x53ff9f;};'use strict';var _=require('lodash');var util=require(_0xe0f8('0x0'));var moment=require('moment');var BPromise=require(_0xe0f8('0x1'));var rs=require(_0xe0f8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe0f8('0x3'));var logger=require(_0xe0f8('0x4'))(_0xe0f8('0x5'));var config=require(_0xe0f8('0x6'));var jayson=require(_0xe0f8('0x7'));var client=jayson[_0xe0f8('0x8')][_0xe0f8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3f6fa2,_0x4e5c06,_0x2d09f4){return new BPromise(function(_0x3bf20,_0x2eab67){return client[_0xe0f8('0xa')](_0x3f6fa2,_0x2d09f4)['then'](function(_0x54642d){logger[_0xe0f8('0xb')](_0xe0f8('0xc'),_0x4e5c06,_0xe0f8('0xd'));logger['debug']('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x4e5c06,_0xe0f8('0xd'),JSON[_0xe0f8('0xe')](_0x54642d));if(_0x54642d[_0xe0f8('0xf')]){if(_0x54642d['error'][_0xe0f8('0x10')]===0x1f4){logger[_0xe0f8('0xf')](_0xe0f8('0xc'),_0x4e5c06,_0x54642d[_0xe0f8('0xf')]['message']);return _0x2eab67(_0x54642d['error'][_0xe0f8('0x11')]);}logger[_0xe0f8('0xf')](_0xe0f8('0xc'),_0x4e5c06,_0x54642d['error'][_0xe0f8('0x11')]);return _0x3bf20(_0x54642d['error'][_0xe0f8('0x11')]);}else{logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x4e5c06,_0xe0f8('0xd'));_0x3bf20(_0x54642d[_0xe0f8('0x12')][_0xe0f8('0x11')]);}})['catch'](function(_0x1deacb){logger[_0xe0f8('0xf')](_0xe0f8('0xc'),_0x4e5c06,_0x1deacb);_0x2eab67(_0x1deacb);});});} \ No newline at end of file +var _0xca00=['stringify','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x481f56,_0x3bf561){var _0x573804=function(_0x4d85f7){while(--_0x4d85f7){_0x481f56['push'](_0x481f56['shift']());}};_0x573804(++_0x3bf561);}(_0xca00,0xa0));var _0x0ca0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xca00[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0ca0('0x0'));var util=require(_0x0ca0('0x1'));var moment=require('moment');var BPromise=require(_0x0ca0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0ca0('0x3'));var db=require(_0x0ca0('0x4'))['db'];var utils=require(_0x0ca0('0x5'));var logger=require('../../config/logger')(_0x0ca0('0x6'));var config=require('../../config/environment');var jayson=require(_0x0ca0('0x7'));var client=jayson[_0x0ca0('0x8')][_0x0ca0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x453331,_0x36e26e,_0x24c2eb){return new BPromise(function(_0x237e8a,_0x69d38c){return client[_0x0ca0('0xa')](_0x453331,_0x24c2eb)['then'](function(_0x26c848){logger[_0x0ca0('0xb')](_0x0ca0('0xc'),_0x36e26e,_0x0ca0('0xd'));logger[_0x0ca0('0xe')](_0x0ca0('0xf'),_0x36e26e,'request\x20sent',JSON[_0x0ca0('0x10')](_0x26c848));if(_0x26c848[_0x0ca0('0x11')]){if(_0x26c848[_0x0ca0('0x11')][_0x0ca0('0x12')]===0x1f4){logger[_0x0ca0('0x11')](_0x0ca0('0xc'),_0x36e26e,_0x26c848[_0x0ca0('0x11')][_0x0ca0('0x13')]);return _0x69d38c(_0x26c848[_0x0ca0('0x11')][_0x0ca0('0x13')]);}logger[_0x0ca0('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x36e26e,_0x26c848['error']['message']);return _0x237e8a(_0x26c848[_0x0ca0('0x11')][_0x0ca0('0x13')]);}else{logger[_0x0ca0('0xb')](_0x0ca0('0xc'),_0x36e26e,'request\x20sent');_0x237e8a(_0x26c848[_0x0ca0('0x14')][_0x0ca0('0x13')]);}})[_0x0ca0('0x15')](function(_0x5c3de4){logger[_0x0ca0('0x11')](_0x0ca0('0xc'),_0x36e26e,_0x5c3de4);_0x69d38c(_0x5c3de4);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 3c52ca0..5579c00 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 _0x671f=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','post','create','put','/:id','update','delete','destroy','multer','util'];(function(_0x28422e,_0xc26e22){var _0x40eb0c=function(_0x2e6798){while(--_0x2e6798){_0x28422e['push'](_0x28422e['shift']());}};_0x40eb0c(++_0xc26e22);}(_0x671f,0x139));var _0xf671=function(_0x2f9d5e,_0x32c2c2){_0x2f9d5e=_0x2f9d5e-0x0;var _0x1ed863=_0x671f[_0x2f9d5e];return _0x1ed863;};'use strict';var multer=require(_0xf671('0x0'));var util=require(_0xf671('0x1'));var path=require('path');var timeout=require(_0xf671('0x2'));var express=require(_0xf671('0x3'));var router=express[_0xf671('0x4')]();var fs_extra=require(_0xf671('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf671('0x6'));var config=require(_0xf671('0x7'));var controller=require(_0xf671('0x8'));router[_0xf671('0x9')]('/',auth[_0xf671('0xa')](),controller[_0xf671('0xb')]);router[_0xf671('0x9')](_0xf671('0xc'),auth['isAuthenticated'](),controller[_0xf671('0xd')]);router[_0xf671('0x9')]('/:id',auth[_0xf671('0xa')](),controller['show']);router[_0xf671('0xe')]('/',auth[_0xf671('0xa')](),controller[_0xf671('0xf')]);router[_0xf671('0x10')](_0xf671('0x11'),auth[_0xf671('0xa')](),controller[_0xf671('0x12')]);router[_0xf671('0x13')](_0xf671('0x11'),auth[_0xf671('0xa')](),controller[_0xf671('0x14')]);module['exports']=router; \ No newline at end of file +var _0x5700=['update','delete','/:id','destroy','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','isAuthenticated','index','get','/describe','describe','show','post','create','put'];(function(_0x58eed6,_0x49a046){var _0x381fa7=function(_0x1ebf98){while(--_0x1ebf98){_0x58eed6['push'](_0x58eed6['shift']());}};_0x381fa7(++_0x49a046);}(_0x5700,0x191));var _0x0570=function(_0xce8629,_0x530a76){_0xce8629=_0xce8629-0x0;var _0x649762=_0x5700[_0xce8629];return _0x649762;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0570('0x0'));var timeout=require(_0x0570('0x1'));var express=require('express');var router=express[_0x0570('0x2')]();var fs_extra=require(_0x0570('0x3'));var auth=require(_0x0570('0x4'));var interaction=require(_0x0570('0x5'));var config=require(_0x0570('0x6'));var controller=require(_0x0570('0x7'));router['get']('/',auth[_0x0570('0x8')](),controller[_0x0570('0x9')]);router[_0x0570('0xa')](_0x0570('0xb'),auth[_0x0570('0x8')](),controller[_0x0570('0xc')]);router[_0x0570('0xa')]('/:id',auth[_0x0570('0x8')](),controller[_0x0570('0xd')]);router[_0x0570('0xe')]('/',auth[_0x0570('0x8')](),controller[_0x0570('0xf')]);router[_0x0570('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x0570('0x11')]);router[_0x0570('0x12')](_0x0570('0x13'),auth[_0x0570('0x8')](),controller[_0x0570('0x14')]);module[_0x0570('0x15')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 7e6b880..f59dd4b 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 _0x86d1=['alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','sequelize','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Skip','star','thumb','input','name','onlineForm','parse','getDataValue','setDataValue','stringify','Comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','website_alias','bottom_right'];(function(_0xcdc75,_0x4990c6){var _0x51d75c=function(_0xa56b12){while(--_0xa56b12){_0xcdc75['push'](_0xcdc75['shift']());}};_0x51d75c(++_0x4990c6);}(_0x86d1,0x149));var _0x186d=function(_0x2db265,_0x3ecc75){_0x2db265=_0x2db265-0x0;var _0x4dbb5e=_0x86d1[_0x2db265];return _0x4dbb5e;};'use strict';var Sequelize=require(_0x186d('0x0'));var rs=require('randomstring');module[_0x186d('0x1')]={'name':{'type':Sequelize[_0x186d('0x2')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x186d('0x3')},'description':{'type':Sequelize[_0x186d('0x2')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize[_0x186d('0x2')],'defaultValue':_0x186d('0x4')},'key':{'type':Sequelize[_0x186d('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x186d('0x2')],'defaultValue':_0x186d('0x5')},'customerAlias':{'type':Sequelize[_0x186d('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x186d('0x2')],'allowNull':![],'defaultValue':_0x186d('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x186d('0x2')],'allowNull':![],'defaultValue':_0x186d('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x186d('0x2')],'allowNull':![],'defaultValue':_0x186d('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x186d('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x186d('0x2')]},'animation':{'type':Sequelize[_0x186d('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x186d('0xa')](_0x186d('0xb'),_0x186d('0xc')),'defaultValue':_0x186d('0xb')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x186d('0xd')},'start_chat_button':{'type':Sequelize[_0x186d('0x2')],'defaultValue':_0x186d('0xe')},'offline_chat_button':{'type':Sequelize[_0x186d('0x2')],'defaultValue':_0x186d('0xf')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0x186d('0x10')},'download_transcript':{'type':Sequelize[_0x186d('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x186d('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x186d('0x2')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0x186d('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x186d('0x11')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x186d('0x2')],'defaultValue':_0x186d('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0x186d('0x2')],'defaultValue':_0x186d('0x13')},'noteTitle':{'type':Sequelize[_0x186d('0x2')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0x186d('0x2')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x186d('0x2')],'defaultValue':_0x186d('0xf')},'skipMessageButton':{'type':Sequelize[_0x186d('0x2')],'defaultValue':_0x186d('0x14')},'conditionAgreement':{'type':Sequelize[_0x186d('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x186d('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x186d('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x186d('0x2')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0x186d('0xa')](_0x186d('0x15'),_0x186d('0x16')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x186d('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x186d('0x17'),'variable':null,'config':{'placeholder':_0x186d('0x18'),'type':'text','required':!![]},'props':{'title':_0x186d('0x18'),'helpText':''}},{'type':_0x186d('0x17'),'props':{'title':_0x186d('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x186d('0x4'),'type':_0x186d('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x186d('0x19'))?JSON[_0x186d('0x1a')](this[_0x186d('0x1b')](_0x186d('0x19'))):{};},'set':function(_0x422898){return this[_0x186d('0x1c')](_0x186d('0x19'),JSON[_0x186d('0x1d')](_0x422898));}},'offlineForm':{'type':Sequelize[_0x186d('0x11')],'defaultValue':function(){return JSON[_0x186d('0x1d')]({'items':[{'type':_0x186d('0x17'),'props':{'title':_0x186d('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x186d('0x4'),'type':_0x186d('0x4')},'variable':null},{'type':'textarea','config':{'placeholder':'Comments'},'props':{'title':_0x186d('0x1e'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0x186d('0x1b')](_0x186d('0x1f'))?JSON[_0x186d('0x1a')](this[_0x186d('0x1b')](_0x186d('0x1f'))):{};},'set':function(_0x11092c){return this[_0x186d('0x1c')](_0x186d('0x1f'),JSON[_0x186d('0x1d')](_0x11092c));}},'token':{'type':Sequelize[_0x186d('0x2')],'defaultValue':function(){return rs[_0x186d('0x20')]();}},'autoclose':{'type':Sequelize[_0x186d('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x186d('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x186d('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x186d('0x2')]},'forwardOffline':{'type':Sequelize[_0x186d('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x186d('0x2')],'defaultValue':_0x186d('0x21')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x186d('0x22')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0x186d('0x23')},'offlineMessageBody':{'type':Sequelize[_0x186d('0x2')],'defaultValue':_0x186d('0x24')},'enableUnmanagedNote':{'type':Sequelize[_0x186d('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x186d('0x2')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0x186d('0x2')],'defaultValue':_0x186d('0x14')},'sendUnmanaged':{'type':Sequelize[_0x186d('0x2')],'defaultValue':_0x186d('0xf')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x186d('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x186d('0x11')]},'showAgentAvatar':{'type':Sequelize[_0x186d('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x186d('0x2')]},'notificationTemplate':{'type':Sequelize[_0x186d('0x11')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x186d('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x186d('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x186d('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x186d('0x25')},'waitForTheAssignedAgent':{'type':Sequelize[_0x186d('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x186d('0x26')},'verticalAlignment':{'type':Sequelize[_0x186d('0x8')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x186d('0x2')],'defaultValue':_0x186d('0x27')},'defaultTitle':{'type':Sequelize[_0x186d('0x2')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x186d('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x186d('0x2')],'allowNull':![],'defaultValue':_0x186d('0x28'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x186d('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x186d('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x186d('0x2')],'defaultValue':_0x186d('0x29')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x186d('0x8')],'comment':_0x186d('0x2a')},'mandatoryDisposition':{'type':Sequelize[_0x186d('0x9')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x63327f){if(!_0x63327f)this[_0x186d('0x1c')](_0x186d('0x2b'),null);this[_0x186d('0x1c')](_0x186d('0x2c'),_0x63327f);}},'vidaooEscalation':{'type':Sequelize[_0x186d('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x186d('0x2')]},'vidaooTopic':{'type':Sequelize[_0x186d('0x2')],'allowNull':![],'defaultValue':_0x186d('0x2d')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x186d('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x186d('0x11')]}}; \ No newline at end of file +var _0xfcb7=['We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Feedback','star','thumb','stringify','input','name','getDataValue','onlineForm','parse','setDataValue','textarea','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.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared'];(function(_0x11e6d6,_0x93cb1){var _0x4df6bb=function(_0x3866c9){while(--_0x3866c9){_0x11e6d6['push'](_0x11e6d6['shift']());}};_0x4df6bb(++_0x93cb1);}(_0xfcb7,0x1c7));var _0x7fcb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfcb7[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x7fcb('0x0'));var rs=require('randomstring');module[_0x7fcb('0x1')]={'name':{'type':Sequelize[_0x7fcb('0x2')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x7fcb('0x3')},'description':{'type':Sequelize[_0x7fcb('0x2')]},'mapKey':{'type':Sequelize[_0x7fcb('0x2')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x7fcb('0x4')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x7fcb('0x2')],'defaultValue':_0x7fcb('0x5')},'customerAlias':{'type':Sequelize[_0x7fcb('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x7fcb('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x7fcb('0x2')],'allowNull':![],'defaultValue':_0x7fcb('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x7fcb('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x7fcb('0x2')]},'animation':{'type':Sequelize[_0x7fcb('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x7fcb('0xa')](_0x7fcb('0xb'),_0x7fcb('0xc')),'defaultValue':_0x7fcb('0xb')},'header_online':{'type':Sequelize[_0x7fcb('0x2')],'defaultValue':_0x7fcb('0xd')},'start_chat_button':{'type':Sequelize[_0x7fcb('0x2')],'defaultValue':_0x7fcb('0xe')},'offline_chat_button':{'type':Sequelize[_0x7fcb('0x2')],'defaultValue':_0x7fcb('0xf')},'header_offline':{'type':Sequelize[_0x7fcb('0x2')],'defaultValue':_0x7fcb('0x10')},'download_transcript':{'type':Sequelize[_0x7fcb('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x7fcb('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x7fcb('0x2')],'defaultValue':_0x7fcb('0x11')},'defaultWhiteLabel':{'type':Sequelize[_0x7fcb('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x7fcb('0x12')]},'closingQuestion':{'type':Sequelize[_0x7fcb('0x2')],'defaultValue':_0x7fcb('0x13')},'formSubmitSuccessMessage':{'type':Sequelize[_0x7fcb('0x2')],'defaultValue':_0x7fcb('0x14')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0x7fcb('0x2')],'defaultValue':_0x7fcb('0x15')},'placeholderMessage':{'type':Sequelize[_0x7fcb('0x2')],'defaultValue':_0x7fcb('0x16')},'closingMessage':{'type':Sequelize[_0x7fcb('0x2')],'defaultValue':_0x7fcb('0x17')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0x7fcb('0x2')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x7fcb('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x7fcb('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x7fcb('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x7fcb('0x2')],'defaultValue':_0x7fcb('0x18')},'ratingType':{'type':Sequelize['ENUM'](_0x7fcb('0x19'),_0x7fcb('0x1a')),'defaultValue':_0x7fcb('0x19')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x7fcb('0x12')],'defaultValue':function(){return JSON[_0x7fcb('0x1b')]({'items':[{'type':_0x7fcb('0x1c'),'variable':null,'config':{'placeholder':_0x7fcb('0x1d'),'type':'text','required':!![]},'props':{'title':_0x7fcb('0x1d'),'helpText':''}},{'type':_0x7fcb('0x1c'),'props':{'title':_0x7fcb('0x4'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x7fcb('0x1e')](_0x7fcb('0x1f'))?JSON[_0x7fcb('0x20')](this[_0x7fcb('0x1e')](_0x7fcb('0x1f'))):{};},'set':function(_0x4aeaff){return this[_0x7fcb('0x21')](_0x7fcb('0x1f'),JSON[_0x7fcb('0x1b')](_0x4aeaff));}},'offlineForm':{'type':Sequelize[_0x7fcb('0x12')],'defaultValue':function(){return JSON[_0x7fcb('0x1b')]({'items':[{'type':_0x7fcb('0x1c'),'props':{'title':_0x7fcb('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x7fcb('0x4'),'type':_0x7fcb('0x4')},'variable':null},{'type':_0x7fcb('0x22'),'config':{'placeholder':_0x7fcb('0x23')},'props':{'title':_0x7fcb('0x23'),'helpText':_0x7fcb('0x24')}}],'fromKey':0x0});},'get':function(){return this[_0x7fcb('0x1e')](_0x7fcb('0x25'))?JSON[_0x7fcb('0x20')](this['getDataValue'](_0x7fcb('0x25'))):{};},'set':function(_0x359aee){return this[_0x7fcb('0x21')](_0x7fcb('0x25'),JSON[_0x7fcb('0x1b')](_0x359aee));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x7fcb('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x7fcb('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x7fcb('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x7fcb('0x2')]},'forwardOffline':{'type':Sequelize[_0x7fcb('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x7fcb('0x2')]},'waitingTitle':{'type':Sequelize[_0x7fcb('0x2')],'defaultValue':_0x7fcb('0x26')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x7fcb('0x27')},'offlineMessageSubject':{'type':Sequelize[_0x7fcb('0x2')],'defaultValue':_0x7fcb('0x28')},'offlineMessageBody':{'type':Sequelize[_0x7fcb('0x2')],'defaultValue':_0x7fcb('0x29')},'enableUnmanagedNote':{'type':Sequelize[_0x7fcb('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x7fcb('0x2a')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x7fcb('0xf')},'enableCustomerAttachment':{'type':Sequelize[_0x7fcb('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x7fcb('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x7fcb('0x12')]},'showAgentAvatar':{'type':Sequelize[_0x7fcb('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x7fcb('0x2')]},'notificationTemplate':{'type':Sequelize[_0x7fcb('0x12')],'defaultValue':function(){return _0x7fcb('0x2b');}},'notificationSound':{'type':Sequelize[_0x7fcb('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x7fcb('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x7fcb('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x7fcb('0x2')],'defaultValue':_0x7fcb('0x2c')},'waitForTheAssignedAgent':{'type':Sequelize[_0x7fcb('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x7fcb('0x2')],'defaultValue':_0x7fcb('0x2d')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x7fcb('0x2')],'defaultValue':_0x7fcb('0x2e')},'defaultTitle':{'type':Sequelize[_0x7fcb('0x2')]},'customerAvatar':{'type':Sequelize[_0x7fcb('0x12')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x7fcb('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x7fcb('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x7fcb('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x7fcb('0x2')],'defaultValue':_0x7fcb('0x2f')},'systemAvatar':{'type':Sequelize[_0x7fcb('0x12')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x7fcb('0x8')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x7fcb('0x9')],'defaultValue':![],'comment':_0x7fcb('0x30'),'set':function(_0x4ec051){if(!_0x4ec051)this[_0x7fcb('0x21')](_0x7fcb('0x31'),null);this['setDataValue']('mandatoryDisposition',_0x4ec051);}},'vidaooEscalation':{'type':Sequelize[_0x7fcb('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x7fcb('0x2')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x7fcb('0x32')},'vidaooNote':{'type':Sequelize[_0x7fcb('0x2')],'defaultValue':function(){return _0x7fcb('0x33');}},'vidaooMetadata':{'type':Sequelize[_0x7fcb('0x12')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x7fcb('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x7fcb('0x12')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 6bfb6e0..ef48c90 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 _0xaa04=['device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','interaction','messageId','created','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','notify','offline','files','includes','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','ListId','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','render','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','mimetype','server','offline-chat','basename','sequelize','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','host','port','secure','auth','SendMail','sendMail','\x22%s\x22\x20<%s>','email','openNewInteraction','MailAccountId','mapValues','subjectOffline','offlineMessageSubject','Chat','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','Tag','Tags','color','tag','Command','getSnippet','iftime\x20%s,%s','interval','timezone','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','Interval','getProactiveActions','virtual','custom','increment','chatLicenseExceeded','Intervals','push','all','some','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','referer','replace','alignment','verticalAlignment','textColor','color_button','backgroundColor','addApplications','transaction','ChatApplication','getApplications','addProactiveActions','ChatProactiveAction','online','false','offlineForm','items','fromKey','Attachment','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','User','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','squel','crypto','desk.js','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./chatWebsite.socket','register','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','destroy','get','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','ChatWebsite','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','include','rows','show','includeAll','merge','find','create','body','user','role','ChatWebsites','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findAll','removeDispositions','ids','addAnswer','CannedAnswer','findOne','removeAnswers','addLogo','sitepic','file','filename','addAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','getLogo','join','server/files/images/logos/default_logo.svg','../../config/license/util','isNil','existsSync','root','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','agentAvatar','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','user-agent-parser','setUA','headers','user-agent','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','Applications','account','applications','list','orderBy','contact','customerIp','cf-connecting-ip','first','x-forwarded-for','split','firstName','lastName','x-real-port','browser','version','unknown','format','%s\x20%s'];(function(_0x1393cc,_0x3d0294){var _0x4fd93f=function(_0xe8c979){while(--_0xe8c979){_0x1393cc['push'](_0x1393cc['shift']());}};_0x4fd93f(++_0x3d0294);}(_0xaa04,0x81));var _0x4aa0=function(_0x3fbce4,_0xbef8bb){_0x3fbce4=_0x3fbce4-0x0;var _0x9ba40f=_0xaa04[_0x3fbce4];return _0x9ba40f;};'use strict';var emlformat=require(_0x4aa0('0x0'));var rimraf=require(_0x4aa0('0x1'));var zipdir=require(_0x4aa0('0x2'));var jsonpatch=require(_0x4aa0('0x3'));var rp=require(_0x4aa0('0x4'));var moment=require(_0x4aa0('0x5'));var BPromise=require(_0x4aa0('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4aa0('0x7'));var sox=require('sox');var csv=require(_0x4aa0('0x8'));var ejs=require(_0x4aa0('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4aa0('0xa'));var crypto=require(_0x4aa0('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x4aa0('0xc'));var toCsv=require(_0x4aa0('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4aa0('0xd'));var qs=require(_0x4aa0('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4aa0('0xf'));var logger=require('../../config/logger')(_0x4aa0('0x10'));var utils=require(_0x4aa0('0x11'));var config=require(_0x4aa0('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x4aa0('0x13'))['db'];config[_0x4aa0('0x14')]=_[_0x4aa0('0x15')](config[_0x4aa0('0x14')],{'host':_0x4aa0('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x4aa0('0x17'))[_0x4aa0('0x18')](socket);var jayson=require(_0x4aa0('0x19'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x4aa0('0x1a')][_0x4aa0('0x1b')]({'port':0x232a});var client9003=jayson[_0x4aa0('0x1a')][_0x4aa0('0x1b')]({'port':0x232b});var client9001=jayson[_0x4aa0('0x1a')][_0x4aa0('0x1b')]({'port':0x2329});function respondWithRpcPromise(_0x3633e1,_0x37f871,_0x374437,_0x1bb649){return new BPromise(function(_0x44eba1,_0xe2494){var _0x53927a=_0x1bb649||client;return _0x53927a[_0x4aa0('0x1c')](_0x3633e1,_0x374437)[_0x4aa0('0x1d')](function(_0x59888b){logger[_0x4aa0('0x1e')](_0x4aa0('0x1f'),_0x37f871,_0x4aa0('0x20'));logger[_0x4aa0('0x21')](_0x4aa0('0x22'),_0x37f871,_0x4aa0('0x20'),JSON[_0x4aa0('0x23')](_0x59888b));if(_0x59888b[_0x4aa0('0x24')]){if(_0x59888b[_0x4aa0('0x24')][_0x4aa0('0x25')]===0x1f4){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x37f871,_0x59888b[_0x4aa0('0x24')][_0x4aa0('0x26')]);return _0xe2494(_0x59888b[_0x4aa0('0x24')][_0x4aa0('0x26')]);}logger[_0x4aa0('0x24')](_0x4aa0('0x1f'),_0x37f871,_0x59888b[_0x4aa0('0x24')][_0x4aa0('0x26')]);return _0x44eba1(_0x59888b[_0x4aa0('0x24')][_0x4aa0('0x26')]);}else{logger[_0x4aa0('0x1e')](_0x4aa0('0x1f'),_0x37f871,_0x4aa0('0x20'));_0x44eba1(_0x59888b[_0x4aa0('0x27')][_0x4aa0('0x26')]);}})[_0x4aa0('0x28')](function(_0x281973){logger[_0x4aa0('0x24')](_0x4aa0('0x1f'),_0x37f871,_0x281973);_0xe2494(_0x281973);});});}function respondWithStatusCode(_0x3b1289,_0x26498b){_0x26498b=_0x26498b||0xcc;return function(_0x1ca7f4){if(_0x1ca7f4){return _0x3b1289[_0x4aa0('0x29')](_0x26498b);}return _0x3b1289[_0x4aa0('0x2a')](_0x26498b)[_0x4aa0('0x2b')]();};}function respondWithResult(_0x19e11d,_0x4844cd){_0x4844cd=_0x4844cd||0xc8;return function(_0x3b59a8){if(_0x3b59a8){return _0x19e11d[_0x4aa0('0x2a')](_0x4844cd)['json'](_0x3b59a8);}};}function respondWithFilteredResult(_0x7eece4,_0x33fcd3){return function(_0x164f2c){if(_0x164f2c){var _0x422acc=typeof _0x33fcd3[_0x4aa0('0x2c')]==='undefined'&&typeof _0x33fcd3[_0x4aa0('0x2d')]===_0x4aa0('0x2e');var _0x81c22b=_0x164f2c['count'];var _0x2fee9b=_0x422acc?0x0:_0x33fcd3[_0x4aa0('0x2c')];var _0x2761de=_0x422acc?_0x164f2c[_0x4aa0('0x2f')]:_0x33fcd3[_0x4aa0('0x2c')]+_0x33fcd3[_0x4aa0('0x2d')];var _0x416608;if(_0x2761de>=_0x81c22b){_0x2761de=_0x81c22b;_0x416608=0xc8;}else{_0x416608=0xce;}_0x7eece4[_0x4aa0('0x2a')](_0x416608);return _0x7eece4[_0x4aa0('0x30')](_0x4aa0('0x31'),_0x2fee9b+'-'+_0x2761de+'/'+_0x81c22b)[_0x4aa0('0x32')](_0x164f2c);}return null;};}function patchUpdates(_0x248c09){return function(_0x1b6ce6){try{jsonpatch[_0x4aa0('0x33')](_0x1b6ce6,_0x248c09,!![]);}catch(_0x41b566){return BPromise[_0x4aa0('0x34')](_0x41b566);}return _0x1b6ce6[_0x4aa0('0x35')]();};}function saveUpdates(_0x3e2b45,_0x25dd80){return function(_0x140b6d){if(_0x140b6d){return _0x140b6d[_0x4aa0('0x36')](_0x3e2b45)['then'](function(_0xd871ff){return _0xd871ff;});}return null;};}function removeEntity(_0x1123de,_0x5177e5){return function(_0x1bcc3d){if(_0x1bcc3d){return _0x1bcc3d[_0x4aa0('0x37')]()[_0x4aa0('0x1d')](function(){var _0x210196=_0x1bcc3d[_0x4aa0('0x38')]({'plain':!![]});var _0x1f96a8='ChatWebsites';return db[_0x4aa0('0x39')][_0x4aa0('0x37')]({'where':{'type':_0x1f96a8,'resourceId':_0x210196['id']}})[_0x4aa0('0x1d')](function(){return _0x1bcc3d;});})['then'](function(){_0x1123de['status'](0xcc)[_0x4aa0('0x2b')]();});}};}function handleEntityNotFound(_0x4e738d,_0x3ffb21){return function(_0x48113e){if(!_0x48113e){_0x4e738d['sendStatus'](0x194);}return _0x48113e;};}function handleError(_0x2b095e,_0x1d342d){_0x1d342d=_0x1d342d||0x1f4;return function(_0x219762){logger[_0x4aa0('0x24')](_0x219762[_0x4aa0('0x3a')]);if(_0x219762[_0x4aa0('0x3b')]){delete _0x219762[_0x4aa0('0x3b')];}_0x2b095e[_0x4aa0('0x2a')](_0x1d342d)[_0x4aa0('0x3c')](_0x219762);};}exports[_0x4aa0('0x3d')]=function(_0x5cc43e,_0x566105){var _0x35bdb6={'include':[{'model':db[_0x4aa0('0x3e')],'as':_0x4aa0('0x3f')}]},_0x3acfc9={},_0x375a09={'count':0x0,'rows':[]};var _0x2708f8=_['map'](db[_0x4aa0('0x40')][_0x4aa0('0x41')],function(_0x1886c6){return{'name':_0x1886c6[_0x4aa0('0x42')],'type':_0x1886c6[_0x4aa0('0x43')][_0x4aa0('0x44')]};});_0x3acfc9[_0x4aa0('0x45')]=_[_0x4aa0('0x46')](_0x2708f8,_0x4aa0('0x3b'));_0x3acfc9[_0x4aa0('0x47')]=_[_0x4aa0('0x48')](_0x5cc43e[_0x4aa0('0x47')]);_0x3acfc9[_0x4aa0('0x49')]=_[_0x4aa0('0x4a')](_0x3acfc9[_0x4aa0('0x45')],_0x3acfc9[_0x4aa0('0x47')]);_0x35bdb6[_0x4aa0('0x4b')]=_[_0x4aa0('0x4a')](_0x3acfc9[_0x4aa0('0x45')],qs[_0x4aa0('0x4c')](_0x5cc43e[_0x4aa0('0x47')][_0x4aa0('0x4c')]));_0x35bdb6[_0x4aa0('0x4b')]=_0x35bdb6[_0x4aa0('0x4b')][_0x4aa0('0x4d')]?_0x35bdb6['attributes']:_0x3acfc9[_0x4aa0('0x45')];if(!_0x5cc43e[_0x4aa0('0x47')][_0x4aa0('0x4e')](_0x4aa0('0x4f'))){_0x35bdb6['limit']=qs['limit'](_0x5cc43e[_0x4aa0('0x47')]['limit']);_0x35bdb6[_0x4aa0('0x2c')]=qs[_0x4aa0('0x2c')](_0x5cc43e[_0x4aa0('0x47')][_0x4aa0('0x2c')]);}_0x35bdb6[_0x4aa0('0x50')]=qs['sort'](_0x5cc43e[_0x4aa0('0x47')][_0x4aa0('0x51')]);_0x35bdb6[_0x4aa0('0x52')]=qs[_0x4aa0('0x49')](_[_0x4aa0('0x53')](_0x5cc43e[_0x4aa0('0x47')],_0x3acfc9[_0x4aa0('0x49')]),_0x2708f8);if(_0x5cc43e['query'][_0x4aa0('0x54')]){_0x35bdb6[_0x4aa0('0x52')]=_['merge'](_0x35bdb6['where'],{'$or':_[_0x4aa0('0x46')](_0x2708f8,function(_0x51c71c){if(_0x51c71c[_0x4aa0('0x43')]!==_0x4aa0('0x55')){var _0x3e5d79={};_0x3e5d79[_0x51c71c[_0x4aa0('0x3b')]]={'$like':'%'+_0x5cc43e['query']['filter']+'%'};return _0x3e5d79;}})});}_0x35bdb6=_['merge']({},_0x35bdb6,_0x5cc43e[_0x4aa0('0x56')]);var _0x30ee67={'where':_0x35bdb6[_0x4aa0('0x52')]};return db['ChatWebsite']['count'](_0x30ee67)[_0x4aa0('0x1d')](function(_0x1fc47f){_0x375a09[_0x4aa0('0x2f')]=_0x1fc47f;if(_0x5cc43e['query']['includeAll']){_0x35bdb6[_0x4aa0('0x57')]=[{'all':!![]}];}return db['ChatWebsite']['findAll'](_0x35bdb6);})['then'](function(_0x7be635){_0x375a09[_0x4aa0('0x58')]=_0x7be635;return _0x375a09;})[_0x4aa0('0x1d')](respondWithFilteredResult(_0x566105,_0x35bdb6))['catch'](handleError(_0x566105,null));};exports[_0x4aa0('0x59')]=function(_0x144af8,_0x752c52){var _0x79d32c={'raw':![],'where':{'id':_0x144af8['params']['id']},'include':[{'model':db[_0x4aa0('0x3e')],'as':_0x4aa0('0x3f')}]},_0x441cca={};_0x441cca[_0x4aa0('0x45')]=_[_0x4aa0('0x48')](db[_0x4aa0('0x40')][_0x4aa0('0x41')]);_0x441cca[_0x4aa0('0x47')]=_[_0x4aa0('0x48')](_0x144af8[_0x4aa0('0x47')]);_0x441cca['filters']=_[_0x4aa0('0x4a')](_0x441cca[_0x4aa0('0x45')],_0x441cca['query']);_0x79d32c[_0x4aa0('0x4b')]=_[_0x4aa0('0x4a')](_0x441cca[_0x4aa0('0x45')],qs[_0x4aa0('0x4c')](_0x144af8[_0x4aa0('0x47')][_0x4aa0('0x4c')]));_0x79d32c[_0x4aa0('0x4b')]=_0x79d32c[_0x4aa0('0x4b')][_0x4aa0('0x4d')]?_0x79d32c[_0x4aa0('0x4b')]:_0x441cca['model'];if(_0x144af8[_0x4aa0('0x47')][_0x4aa0('0x5a')]){_0x79d32c[_0x4aa0('0x57')]=[{'all':!![]}];}_0x79d32c=_[_0x4aa0('0x5b')]({},_0x79d32c,_0x144af8[_0x4aa0('0x56')]);return db[_0x4aa0('0x40')][_0x4aa0('0x5c')](_0x79d32c)[_0x4aa0('0x1d')](handleEntityNotFound(_0x752c52,null))[_0x4aa0('0x1d')](respondWithResult(_0x752c52,null))[_0x4aa0('0x28')](handleError(_0x752c52,null));};exports[_0x4aa0('0x5d')]=function(_0x6557e4,_0x884673){return db[_0x4aa0('0x40')][_0x4aa0('0x5d')](_0x6557e4[_0x4aa0('0x5e')],{})[_0x4aa0('0x1d')](function(_0x4dd5cd){var _0x82c3ee=_0x6557e4[_0x4aa0('0x5f')][_0x4aa0('0x38')]({'plain':!![]});if(!_0x82c3ee)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x82c3ee[_0x4aa0('0x60')]==='user'){var _0x1c4620=_0x4dd5cd[_0x4aa0('0x38')]({'plain':!![]});var _0x312025=_0x4aa0('0x61');return db[_0x4aa0('0x62')]['find']({'where':{'name':_0x312025,'userProfileId':_0x82c3ee[_0x4aa0('0x63')]},'raw':!![]})[_0x4aa0('0x1d')](function(_0x4cb7fc){if(_0x4cb7fc&&_0x4cb7fc[_0x4aa0('0x64')]===0x0){return db[_0x4aa0('0x39')]['create']({'name':_0x1c4620['name'],'resourceId':_0x1c4620['id'],'type':_0x4cb7fc[_0x4aa0('0x3b')],'sectionId':_0x4cb7fc['id']},{})[_0x4aa0('0x1d')](function(){return _0x4dd5cd;});}else{return _0x4dd5cd;}})[_0x4aa0('0x28')](function(_0x57cb73){logger[_0x4aa0('0x24')](_0x4aa0('0x65'),_0x57cb73);throw _0x57cb73;});}return _0x4dd5cd;})[_0x4aa0('0x1d')](respondWithResult(_0x884673,0xc9))[_0x4aa0('0x28')](handleError(_0x884673,null));};exports[_0x4aa0('0x36')]=function(_0x5aede6,_0x4dce37){if(_0x5aede6[_0x4aa0('0x5e')]['id']){delete _0x5aede6[_0x4aa0('0x5e')]['id'];}return db[_0x4aa0('0x40')][_0x4aa0('0x5c')]({'where':{'id':_0x5aede6[_0x4aa0('0x66')]['id']},'include':[{'model':db[_0x4aa0('0x3e')],'as':'mandatoryDispositionPause'}]})[_0x4aa0('0x1d')](handleEntityNotFound(_0x4dce37,null))[_0x4aa0('0x1d')](saveUpdates(_0x5aede6['body'],null))[_0x4aa0('0x1d')](respondWithResult(_0x4dce37,null))['catch'](handleError(_0x4dce37,null));};exports[_0x4aa0('0x37')]=function(_0x4aa441,_0x557be1){return db[_0x4aa0('0x40')][_0x4aa0('0x5c')]({'where':{'id':_0x4aa441['params']['id']}})[_0x4aa0('0x1d')](handleEntityNotFound(_0x557be1,null))[_0x4aa0('0x1d')](removeEntity(_0x557be1,null))[_0x4aa0('0x28')](handleError(_0x557be1,null));};exports[_0x4aa0('0x67')]=function(_0x3c2b3f,_0x313bb3){return db[_0x4aa0('0x40')][_0x4aa0('0x67')]()[_0x4aa0('0x1d')](respondWithResult(_0x313bb3,null))[_0x4aa0('0x28')](handleError(_0x313bb3,null));};exports[_0x4aa0('0x68')]=function(_0x5039bd,_0x376d3c,_0xd9b30){if(_0x5039bd[_0x4aa0('0x5e')]['id']){delete _0x5039bd['body']['id'];}return db[_0x4aa0('0x40')][_0x4aa0('0x5c')]({'where':{'id':_0x5039bd['params']['id']}})['then'](handleEntityNotFound(_0x376d3c,null))['then'](function(_0x4a73c5){if(_0x4a73c5){_0x5039bd['body'][_0x4aa0('0x69')]=_0x4a73c5['id'];return db[_0x4aa0('0x6a')]['create'](_0x5039bd[_0x4aa0('0x5e')]);}})['then'](respondWithResult(_0x376d3c,null))[_0x4aa0('0x28')](handleError(_0x376d3c,null));};exports[_0x4aa0('0x6b')]=function(_0x32b25a,_0x123964,_0xe44d4c){var _0x1b5386={'raw':![],'where':{}};var _0x1ac92c={};var _0x51b86b={'count':0x0,'rows':[]};return db[_0x4aa0('0x40')]['findOne']({'where':{'id':_0x32b25a[_0x4aa0('0x66')]['id']}})[_0x4aa0('0x1d')](handleEntityNotFound(_0x123964,null))[_0x4aa0('0x1d')](function(_0x1758c4){if(_0x1758c4){_0x1ac92c[_0x4aa0('0x45')]=_[_0x4aa0('0x48')](db[_0x4aa0('0x6a')][_0x4aa0('0x41')]);_0x1ac92c['query']=_[_0x4aa0('0x48')](_0x32b25a['query']);_0x1ac92c[_0x4aa0('0x49')]=_['intersection'](_0x1ac92c[_0x4aa0('0x45')],_0x1ac92c['query']);_0x1b5386[_0x4aa0('0x4b')]=_[_0x4aa0('0x4a')](_0x1ac92c[_0x4aa0('0x45')],qs[_0x4aa0('0x4c')](_0x32b25a[_0x4aa0('0x47')]['fields']));_0x1b5386['attributes']=_0x1b5386[_0x4aa0('0x4b')][_0x4aa0('0x4d')]?_0x1b5386[_0x4aa0('0x4b')]:_0x1ac92c[_0x4aa0('0x45')];if(!_0x32b25a[_0x4aa0('0x47')]['hasOwnProperty']('nolimit')){_0x1b5386[_0x4aa0('0x2d')]=qs['limit'](_0x32b25a[_0x4aa0('0x47')][_0x4aa0('0x2d')]);_0x1b5386[_0x4aa0('0x2c')]=qs[_0x4aa0('0x2c')](_0x32b25a[_0x4aa0('0x47')][_0x4aa0('0x2c')]);}_0x1b5386[_0x4aa0('0x50')]=qs[_0x4aa0('0x51')](_0x32b25a[_0x4aa0('0x47')][_0x4aa0('0x51')]);_0x1b5386[_0x4aa0('0x52')]=qs[_0x4aa0('0x49')](_[_0x4aa0('0x53')](_0x32b25a[_0x4aa0('0x47')],_0x1ac92c[_0x4aa0('0x49')]));_0x1b5386[_0x4aa0('0x52')][_0x4aa0('0x69')]=_0x1758c4['id'];if(_0x32b25a[_0x4aa0('0x47')]['filter']){_0x1b5386['where']=_[_0x4aa0('0x5b')](_0x1b5386[_0x4aa0('0x52')],{'$or':_[_0x4aa0('0x46')](_0x1b5386[_0x4aa0('0x4b')],function(_0x255a9c){var _0x6f6122={};_0x6f6122[_0x255a9c]={'$like':'%'+_0x32b25a[_0x4aa0('0x47')][_0x4aa0('0x54')]+'%'};return _0x6f6122;})});}_0x1b5386=_[_0x4aa0('0x5b')]({},_0x1b5386,_0x32b25a[_0x4aa0('0x56')]);return db[_0x4aa0('0x6a')]['count']({'where':_0x1b5386[_0x4aa0('0x52')]})[_0x4aa0('0x1d')](function(_0x9f9297){_0x51b86b[_0x4aa0('0x2f')]=_0x9f9297;if(_0x32b25a['query'][_0x4aa0('0x5a')]){_0x1b5386[_0x4aa0('0x57')]=[{'all':!![]}];}return db[_0x4aa0('0x6a')][_0x4aa0('0x6c')](_0x1b5386);})[_0x4aa0('0x1d')](function(_0x17ed78){_0x51b86b[_0x4aa0('0x58')]=_0x17ed78;return _0x51b86b;});}})[_0x4aa0('0x1d')](respondWithFilteredResult(_0x123964,_0x1b5386))['catch'](handleError(_0x123964,null));};exports[_0x4aa0('0x6d')]=function(_0x6f864,_0x1d0038,_0x5754ba){return db['ChatWebsite'][_0x4aa0('0x5c')]({'where':{'id':_0x6f864['params']['id']}})[_0x4aa0('0x1d')](handleEntityNotFound(_0x1d0038,null))[_0x4aa0('0x1d')](function(_0x2eaba5){if(_0x2eaba5){return _0x2eaba5['removeDispositions'](_0x6f864[_0x4aa0('0x47')][_0x4aa0('0x6e')]);}})[_0x4aa0('0x1d')](respondWithStatusCode(_0x1d0038,null))['catch'](handleError(_0x1d0038,null));};exports[_0x4aa0('0x6f')]=function(_0x3d60ff,_0x54d4c7,_0x3c4d74){if(_0x3d60ff[_0x4aa0('0x5e')]['id']){delete _0x3d60ff[_0x4aa0('0x5e')]['id'];}return db[_0x4aa0('0x40')][_0x4aa0('0x5c')]({'where':{'id':_0x3d60ff[_0x4aa0('0x66')]['id']}})['then'](handleEntityNotFound(_0x54d4c7,null))['then'](function(_0x5fb62d){if(_0x5fb62d){_0x3d60ff[_0x4aa0('0x5e')][_0x4aa0('0x69')]=_0x5fb62d['id'];return db[_0x4aa0('0x70')][_0x4aa0('0x5d')](_0x3d60ff['body']);}})[_0x4aa0('0x1d')](respondWithResult(_0x54d4c7,null))['catch'](handleError(_0x54d4c7,null));};exports['getAnswers']=function(_0x209d98,_0x12b55c,_0x29941b){var _0x521540={'raw':![],'where':{}};var _0xcff7d9={};var _0x4a1b3b={'count':0x0,'rows':[]};return db[_0x4aa0('0x40')][_0x4aa0('0x71')]({'where':{'id':_0x209d98['params']['id']}})[_0x4aa0('0x1d')](handleEntityNotFound(_0x12b55c,null))[_0x4aa0('0x1d')](function(_0x2c516b){if(_0x2c516b){_0xcff7d9[_0x4aa0('0x45')]=_[_0x4aa0('0x48')](db['CannedAnswer'][_0x4aa0('0x41')]);_0xcff7d9[_0x4aa0('0x47')]=_[_0x4aa0('0x48')](_0x209d98['query']);_0xcff7d9[_0x4aa0('0x49')]=_[_0x4aa0('0x4a')](_0xcff7d9['model'],_0xcff7d9[_0x4aa0('0x47')]);_0x521540['attributes']=_[_0x4aa0('0x4a')](_0xcff7d9[_0x4aa0('0x45')],qs[_0x4aa0('0x4c')](_0x209d98[_0x4aa0('0x47')][_0x4aa0('0x4c')]));_0x521540[_0x4aa0('0x4b')]=_0x521540[_0x4aa0('0x4b')][_0x4aa0('0x4d')]?_0x521540[_0x4aa0('0x4b')]:_0xcff7d9[_0x4aa0('0x45')];if(!_0x209d98['query'][_0x4aa0('0x4e')](_0x4aa0('0x4f'))){_0x521540[_0x4aa0('0x2d')]=qs[_0x4aa0('0x2d')](_0x209d98[_0x4aa0('0x47')][_0x4aa0('0x2d')]);_0x521540[_0x4aa0('0x2c')]=qs[_0x4aa0('0x2c')](_0x209d98[_0x4aa0('0x47')][_0x4aa0('0x2c')]);}_0x521540[_0x4aa0('0x50')]=qs['sort'](_0x209d98['query'][_0x4aa0('0x51')]);_0x521540[_0x4aa0('0x52')]=qs[_0x4aa0('0x49')](_[_0x4aa0('0x53')](_0x209d98['query'],_0xcff7d9['filters']));_0x521540[_0x4aa0('0x52')]['ChatWebsiteId']=_0x2c516b['id'];if(_0x209d98[_0x4aa0('0x47')][_0x4aa0('0x54')]){_0x521540[_0x4aa0('0x52')]=_[_0x4aa0('0x5b')](_0x521540[_0x4aa0('0x52')],{'$or':_[_0x4aa0('0x46')](_0x521540[_0x4aa0('0x4b')],function(_0x5a614b){var _0x542e90={};_0x542e90[_0x5a614b]={'$like':'%'+_0x209d98['query'][_0x4aa0('0x54')]+'%'};return _0x542e90;})});}_0x521540=_[_0x4aa0('0x5b')]({},_0x521540,_0x209d98['options']);return db[_0x4aa0('0x70')][_0x4aa0('0x2f')]({'where':_0x521540[_0x4aa0('0x52')]})['then'](function(_0x13569b){_0x4a1b3b[_0x4aa0('0x2f')]=_0x13569b;if(_0x209d98[_0x4aa0('0x47')][_0x4aa0('0x5a')]){_0x521540[_0x4aa0('0x57')]=[{'all':!![]}];}return db[_0x4aa0('0x70')][_0x4aa0('0x6c')](_0x521540);})[_0x4aa0('0x1d')](function(_0x58cf70){_0x4a1b3b[_0x4aa0('0x58')]=_0x58cf70;return _0x4a1b3b;});}})['then'](respondWithFilteredResult(_0x12b55c,_0x521540))[_0x4aa0('0x28')](handleError(_0x12b55c,null));};exports['removeAnswers']=function(_0x5b8345,_0xe07622,_0xaac065){return db[_0x4aa0('0x40')]['find']({'where':{'id':_0x5b8345[_0x4aa0('0x66')]['id']}})['then'](handleEntityNotFound(_0xe07622,null))[_0x4aa0('0x1d')](function(_0x300b8b){if(_0x300b8b){return _0x300b8b[_0x4aa0('0x72')](_0x5b8345[_0x4aa0('0x47')]['ids']);}})[_0x4aa0('0x1d')](respondWithStatusCode(_0xe07622,null))['catch'](handleError(_0xe07622,null));};exports[_0x4aa0('0x73')]=function(_0xa2f2c,_0x587440,_0x40093a){_0xa2f2c[_0x4aa0('0x5e')][_0x4aa0('0x74')]=_0xa2f2c[_0x4aa0('0x75')][_0x4aa0('0x76')];return db[_0x4aa0('0x40')][_0x4aa0('0x5c')]({'where':{'id':_0xa2f2c[_0x4aa0('0x66')]['id']}})['then'](handleEntityNotFound(_0x587440,null))[_0x4aa0('0x1d')](saveUpdates(_0xa2f2c['body'],null))['then'](respondWithResult(_0x587440,null))[_0x4aa0('0x28')](handleError(_0x587440,null));};exports[_0x4aa0('0x77')]=function(_0x5bbedd,_0x4df569,_0x48f041){_0x5bbedd[_0x4aa0('0x5e')]['agentAvatar']=_0x5bbedd[_0x4aa0('0x75')]['filename'];return db['ChatWebsite'][_0x4aa0('0x5c')]({'where':{'id':_0x5bbedd['params']['id']}})[_0x4aa0('0x1d')](handleEntityNotFound(_0x4df569,null))['then'](saveUpdates(_0x5bbedd['body'],null))[_0x4aa0('0x1d')](respondWithResult(_0x4df569,null))[_0x4aa0('0x28')](handleError(_0x4df569,null));};exports[_0x4aa0('0x78')]=function(_0x5665ca,_0x26e058,_0x2915b0){_0x5665ca['body'][_0x4aa0('0x79')]=_0x5665ca[_0x4aa0('0x75')][_0x4aa0('0x76')];return db[_0x4aa0('0x40')][_0x4aa0('0x5c')]({'where':{'id':_0x5665ca['params']['id']}})[_0x4aa0('0x1d')](handleEntityNotFound(_0x26e058,null))[_0x4aa0('0x1d')](saveUpdates(_0x5665ca[_0x4aa0('0x5e')],null))[_0x4aa0('0x1d')](respondWithResult(_0x26e058,null))[_0x4aa0('0x28')](handleError(_0x26e058,null));};exports[_0x4aa0('0x7a')]=function(_0x5d83a4,_0x1885c7,_0xc9c45c){_0x5d83a4['body']['systemAvatar']=_0x5d83a4[_0x4aa0('0x75')][_0x4aa0('0x76')];return db[_0x4aa0('0x40')]['find']({'where':{'id':_0x5d83a4[_0x4aa0('0x66')]['id']}})['then'](handleEntityNotFound(_0x1885c7,null))[_0x4aa0('0x1d')](saveUpdates(_0x5d83a4[_0x4aa0('0x5e')],null))[_0x4aa0('0x1d')](respondWithResult(_0x1885c7,null))[_0x4aa0('0x28')](handleError(_0x1885c7,null));};exports[_0x4aa0('0x7b')]=function(_0x5b2798,_0x12adc9,_0x4a9ecb){var _0x2e9dc7=path[_0x4aa0('0x7c')](config['root'],_0x4aa0('0x7d'));var _0x35027b={'where':{'id':_0x5b2798[_0x4aa0('0x66')]['id']},'attributes':['id',_0x4aa0('0x74')],'raw':!![]};var _0x4496d2=![];return require(_0x4aa0('0x7e'))['getLicense']()[_0x4aa0('0x1d')](function(_0x5e38a1){if(_0x5e38a1){_0x4496d2=_0x5e38a1['custom'];}})[_0x4aa0('0x1d')](function(){return db[_0x4aa0('0x40')][_0x4aa0('0x5c')](_0x35027b);})['then'](handleEntityNotFound(_0x12adc9,null))[_0x4aa0('0x1d')](function(_0x349701){if(_0x349701){if(!_[_0x4aa0('0x7f')](_0x349701[_0x4aa0('0x74')])){if(fs[_0x4aa0('0x80')](path[_0x4aa0('0x7c')](config[_0x4aa0('0x81')],_0x4aa0('0x82'),_0x349701[_0x4aa0('0x74')]))&&_0x4496d2){_0x2e9dc7=path[_0x4aa0('0x7c')](config['root'],_0x4aa0('0x82'),_0x349701[_0x4aa0('0x74')]);}}return _0x12adc9[_0x4aa0('0x83')](_0x2e9dc7);}})[_0x4aa0('0x28')](handleError(_0x12adc9,null));};exports[_0x4aa0('0x84')]=function(_0x1d990c,_0x11cac3,_0x1d49db){var _0x5ed8f8=path['join'](config['root'],_0x4aa0('0x85'));var _0x3bb803={'where':{'id':_0x1d990c[_0x4aa0('0x66')]['id']},'attributes':['id',_0x4aa0('0x86')],'raw':!![]};return db['ChatWebsite'][_0x4aa0('0x5c')](_0x3bb803)[_0x4aa0('0x1d')](handleEntityNotFound(_0x11cac3,null))['then'](function(_0x8a1b8){if(_0x8a1b8){if(!_[_0x4aa0('0x7f')](_0x8a1b8['agentAvatar'])){if(fs[_0x4aa0('0x80')](path[_0x4aa0('0x7c')](config['root'],_0x4aa0('0x87'),_0x8a1b8[_0x4aa0('0x86')]))){_0x5ed8f8=path[_0x4aa0('0x7c')](config[_0x4aa0('0x81')],_0x4aa0('0x87'),_0x8a1b8[_0x4aa0('0x86')]);}}return _0x11cac3['download'](_0x5ed8f8);}})[_0x4aa0('0x28')](handleError(_0x11cac3,null));};exports[_0x4aa0('0x88')]=function(_0x6fd01c,_0x395b39,_0x24f88d){var _0x540786=path[_0x4aa0('0x7c')](config['root'],_0x4aa0('0x89'));var _0x57a379={'where':{'id':_0x6fd01c[_0x4aa0('0x66')]['id']},'attributes':['id',_0x4aa0('0x79'),_0x4aa0('0x8a')],'raw':!![]};return db[_0x4aa0('0x40')][_0x4aa0('0x5c')](_0x57a379)['then'](handleEntityNotFound(_0x395b39,null))[_0x4aa0('0x1d')](function(_0x11149b){if(_0x11149b){if(!_[_0x4aa0('0x7f')](_0x11149b[_0x4aa0('0x79')])){if(fs['existsSync'](path['join'](config[_0x4aa0('0x81')],'server/files/images/avatars/',_0x11149b[_0x4aa0('0x79')]))&&_0x11149b[_0x4aa0('0x8a')]){_0x540786=path['join'](config[_0x4aa0('0x81')],_0x4aa0('0x87'),_0x11149b[_0x4aa0('0x79')]);}}return _0x395b39[_0x4aa0('0x83')](_0x540786);}})[_0x4aa0('0x28')](handleError(_0x395b39,null));};exports[_0x4aa0('0x8b')]=function(_0x592a04,_0x420d46,_0x2e4efa){var _0x14b485=path[_0x4aa0('0x7c')](config[_0x4aa0('0x81')],_0x4aa0('0x8c'));var _0x4472b1={'where':{'id':_0x592a04[_0x4aa0('0x66')]['id']},'attributes':['id',_0x4aa0('0x8d')],'raw':!![]};return db['ChatWebsite'][_0x4aa0('0x5c')](_0x4472b1)[_0x4aa0('0x1d')](handleEntityNotFound(_0x420d46,null))[_0x4aa0('0x1d')](function(_0x5702b9){if(_0x5702b9){if(!_[_0x4aa0('0x7f')](_0x5702b9[_0x4aa0('0x8d')])){if(fs[_0x4aa0('0x80')](path['join'](config['root'],'server/files/images/avatars/',_0x5702b9[_0x4aa0('0x8d')]))){_0x14b485=path[_0x4aa0('0x7c')](config[_0x4aa0('0x81')],'server/files/images/avatars/',_0x5702b9['systemAvatar']);}}return _0x420d46[_0x4aa0('0x83')](_0x14b485);}})[_0x4aa0('0x28')](handleError(_0x420d46,null));};exports['notify']=function(_0x3c0573,_0x488336,_0x290a1e){var _0x45709c=require(_0x4aa0('0x8e'));var _0x87eb9d=new _0x45709c();var _0x5235cb=_0x87eb9d[_0x4aa0('0x8f')](_0x3c0573[_0x4aa0('0x90')][_0x4aa0('0x91')])['getResult']();var _0x19474a={'body':_0x3c0573['body'],'channel':_0x4aa0('0x92')};var _0x582ead=[];var _0x28623c=[];var _0xce6cbe={};var _0x907b4c=![];return db[_0x4aa0('0x93')][_0x4aa0('0x67')]()[_0x4aa0('0x1d')](function(_0x4010b8){if(!_0x4010b8){throw new db[(_0x4aa0('0x94'))][(_0x4aa0('0x95'))](_0x4aa0('0x96'));}_0x582ead=_[_0x4aa0('0x97')](_[_0x4aa0('0x48')](_0x4010b8),[_0x4aa0('0x98'),_0x4aa0('0x99')]);_0x28623c=_['difference'](_[_0x4aa0('0x48')](_0x4010b8),['createdAt','updatedAt','CompanyId','ListId']);if(_0x3c0573[_0x4aa0('0x5e')]['id']){delete _0x3c0573[_0x4aa0('0x5e')]['id'];}if(_['isNil'](_0x3c0573[_0x4aa0('0x5e')][_0x4aa0('0x9a')])){throw new db['Sequelize'][(_0x4aa0('0x95'))](_0x4aa0('0x9b'));}if(_[_0x4aa0('0x7f')](_0x3c0573[_0x4aa0('0x5e')]['body'])||_0x3c0573[_0x4aa0('0x5e')]['body']===''){throw new db[(_0x4aa0('0x94'))][(_0x4aa0('0x95'))](_0x4aa0('0x9c'));}if(_['isNil'](_0x3c0573[_0x4aa0('0x5e')][_0x4aa0('0x9d')])){throw new db[(_0x4aa0('0x94'))]['ValidationError'](_0x4aa0('0x9e')+_0x28623c);}if(!_['includes'](_0x28623c,_0x3c0573[_0x4aa0('0x5e')][_0x4aa0('0x9d')])){throw new db[(_0x4aa0('0x94'))][(_0x4aa0('0x95'))](_0x4aa0('0x9f')+_0x28623c);}_0xce6cbe[_0x3c0573[_0x4aa0('0x5e')]['mapKey']]=_0x3c0573['body']['from'];})[_0x4aa0('0x1d')](function(){return db[_0x4aa0('0x40')][_0x4aa0('0x5c')]({'where':{'id':_0x3c0573[_0x4aa0('0x66')]['id']},'include':[{'model':db[_0x4aa0('0xa0')],'as':_0x4aa0('0xa1'),'include':[{'model':db['CmContact'],'as':_0x4aa0('0xa2'),'where':_0xce6cbe,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db['ChatApplication'],'as':_0x4aa0('0xa3')}]});})[_0x4aa0('0x1d')](handleEntityNotFound(_0x488336,null))[_0x4aa0('0x1d')](function(_0x40a20f){if(_0x40a20f&&_0x40a20f[_0x4aa0('0xa1')]){_0x19474a[_0x4aa0('0xa4')]=_0x40a20f;_0x19474a[_0x4aa0('0xa5')]=_0x40a20f[_0x4aa0('0xa3')];_0x19474a[_0x4aa0('0xa6')]=_0x40a20f['List'];_0x19474a['applications']=_[_0x4aa0('0xa7')](_0x19474a[_0x4aa0('0xa5')],['priority'],['asc']);if(_0x19474a[_0x4aa0('0xa4')][_0x4aa0('0xa3')]){delete _0x19474a[_0x4aa0('0xa4')][_0x4aa0('0xa3')];}if(_0x19474a[_0x4aa0('0xa4')]['List']&&_0x19474a[_0x4aa0('0xa4')][_0x4aa0('0xa1')][_0x4aa0('0xa2')][_0x4aa0('0x4d')]){return _0x19474a[_0x4aa0('0xa4')]['List'][_0x4aa0('0xa2')][0x0];}var _0x15dcdf=_['defaults'](_0x3c0573[_0x4aa0('0x5e')],{'firstName':_0x3c0573[_0x4aa0('0x5e')]['from'],'ListId':_0x40a20f['ListId']});_0x15dcdf[_0x3c0573['body']['mapKey']]=_0x3c0573[_0x4aa0('0x5e')][_0x4aa0('0x9a')];return db['CmContact'][_0x4aa0('0x5d')](_0x15dcdf,{'fields':_0x582ead,'raw':!![]});}})[_0x4aa0('0x1d')](handleEntityNotFound(_0x488336,null))[_0x4aa0('0x1d')](function(_0x2d2242){_0x19474a[_0x4aa0('0xa8')]=_0x2d2242;var _0x21f76e=_0x3c0573[_0x4aa0('0x5e')][_0x4aa0('0xa9')];if(_0x3c0573[_0x4aa0('0x90')][_0x4aa0('0xaa')]){_0x21f76e=_0x3c0573[_0x4aa0('0x90')][_0x4aa0('0xaa')];}else if(_0x3c0573[_0x4aa0('0x90')]['x-forwarded-for']){_0x21f76e=_[_0x4aa0('0xab')](_0x3c0573[_0x4aa0('0x90')][_0x4aa0('0xac')][_0x4aa0('0xad')](','));}if(_0x2d2242){var _0x22f3d2={'ContactId':_0x2d2242['id'],'ChatWebsiteId':_0x3c0573[_0x4aa0('0x66')]['id'],'from':(_0x2d2242[_0x4aa0('0xae')]||'')+'\x20'+(_0x2d2242[_0x4aa0('0xaf')]||''),'customerIp':_0x21f76e,'customerPort':_0x3c0573[_0x4aa0('0x90')][_0x4aa0('0xb0')]?_0x3c0573[_0x4aa0('0x90')][_0x4aa0('0xb0')]:null,'referer':_0x3c0573[_0x4aa0('0x5e')]['referer'],'browserName':_0x5235cb[_0x4aa0('0xb1')][_0x4aa0('0x3b')]&&_0x5235cb[_0x4aa0('0xb1')]['version']?util['format']('%s\x20%s',_0x5235cb[_0x4aa0('0xb1')]['name'],_0x5235cb[_0x4aa0('0xb1')]['version']):'unknown','browserVersion':_0x5235cb[_0x4aa0('0xb1')][_0x4aa0('0xb2')]||_0x4aa0('0xb3'),'osName':util[_0x4aa0('0xb4')](_0x4aa0('0xb5'),_0x5235cb['os'][_0x4aa0('0x3b')],_0x5235cb['os'][_0x4aa0('0xb2')]),'osVersion':_0x5235cb['os'][_0x4aa0('0xb2')],'deviceModel':_0x5235cb['device'][_0x4aa0('0x45')]&&_0x5235cb[_0x4aa0('0xb6')][_0x4aa0('0xb7')]?util[_0x4aa0('0xb4')](_0x4aa0('0xb8'),_0x5235cb['device'][_0x4aa0('0x45')],_0x5235cb['device'][_0x4aa0('0xb7')],_0x5235cb['device']['type']):null,'deviceVendor':_0x5235cb[_0x4aa0('0xb6')][_0x4aa0('0xb7')],'deviceType':_0x5235cb[_0x4aa0('0xb6')]['type'],'formData':JSON[_0x4aa0('0x23')](_0x3c0573[_0x4aa0('0x5e')])};var _0x5ab0d2={'ChatWebsiteId':_0x3c0573[_0x4aa0('0x66')]['id'],'closed':![]};if(_0x3c0573[_0x4aa0('0x5e')][_0x4aa0('0xb9')]){_0x5ab0d2[_0x4aa0('0xb9')]=_0x3c0573[_0x4aa0('0x5e')][_0x4aa0('0xb9')];return db[_0x4aa0('0xba')][_0x4aa0('0x5c')]({'where':_0x5ab0d2})[_0x4aa0('0x1d')](function(_0x1ca1ea){if(_0x1ca1ea){return[_0x1ca1ea,![]];}_0x22f3d2['threadId']=_0x3c0573[_0x4aa0('0x5e')][_0x4aa0('0xb9')];_0x22f3d2[_0x4aa0('0xbb')]=_0x3c0573[_0x4aa0('0x5e')]['externalUrl'];return db[_0x4aa0('0xba')][_0x4aa0('0x5d')](_0x22f3d2)[_0x4aa0('0x1d')](function(_0x211908){return[_0x211908,!![]];});});}_0x5ab0d2['ContactId']=_0x2d2242['id'];if(_0x3c0573[_0x4aa0('0x5e')][_0x4aa0('0xbc')]&&_0x3c0573[_0x4aa0('0x5e')][_0x4aa0('0xbc')]['id']){_0x5ab0d2['id']=_0x3c0573['body']['interaction']['id'];return db['ChatInteraction']['find']({'where':_0x5ab0d2})['then'](function(_0x3ab77e){if(_0x3ab77e){return[_0x3ab77e,![]];}return db[_0x4aa0('0xba')][_0x4aa0('0x5d')](_0x22f3d2)[_0x4aa0('0x1d')](function(_0x3f4008){return[_0x3f4008,!![]];});});}return db[_0x4aa0('0xba')][_0x4aa0('0x5d')](_0x22f3d2)['then'](function(_0x57bf89){return[_0x57bf89,!![]];});}})['spread'](function(_0xef2882,_0x4083ff){if(_0xef2882){_0x907b4c=_0x4083ff;if(!_0x4083ff){var _0x191a45={'from':(_0x19474a[_0x4aa0('0xa8')][_0x4aa0('0xae')]||'')+'\x20'+(_0x19474a[_0x4aa0('0xa8')][_0x4aa0('0xaf')]||'')};if(_0x3c0573[_0x4aa0('0x5e')][_0x4aa0('0xb9')]&&_0x3c0573[_0x4aa0('0x5e')][_0x4aa0('0xbd')]&&_0x3c0573['body']['threadId']!=_0x3c0573[_0x4aa0('0x5e')][_0x4aa0('0xbd')]){_0x191a45[_0x4aa0('0xb9')]=_0x3c0573[_0x4aa0('0x5e')][_0x4aa0('0xbd')];}return _0xef2882[_0x4aa0('0x36')](_0x191a45);}else{return _0xef2882;}}})[_0x4aa0('0x1d')](function(_0x37f876){_0x19474a['interaction']=_0x37f876[_0x4aa0('0x38')]({'plain':!![]});_0x19474a[_0x4aa0('0xbc')][_0x4aa0('0xbe')]=_0x907b4c;if(_0x19474a['interaction'][_0x4aa0('0xbe')]){if(_0x19474a[_0x4aa0('0xa4')]['autoclose']){_0x19474a[_0x4aa0('0xa5')]['push']({'id':0x0,'priority':_0x19474a[_0x4aa0('0xa5')][_0x4aa0('0x4d')]+0x1,'app':'close','appdata':_0x4aa0('0xbf'),'interval':_0x4aa0('0xc0')});}}return db[_0x4aa0('0xc1')][_0x4aa0('0x5d')]({'body':_0x3c0573[_0x4aa0('0x5e')][_0x4aa0('0x5e')],'ChatWebsiteId':_0x3c0573[_0x4aa0('0x66')]['id'],'ChatInteractionId':_0x37f876['id'],'direction':'in','ContactId':_0x19474a[_0x4aa0('0xa8')]['id'],'AttachmentId':_0x3c0573[_0x4aa0('0x5e')][_0x4aa0('0xc2')]});})[_0x4aa0('0x1d')](function(_0x5a2e0b){_0x19474a[_0x4aa0('0x26')]=_0x5a2e0b;if(_0x19474a[_0x4aa0('0xbc')][_0x4aa0('0xc3')]){return db['User'][_0x4aa0('0x5c')]({'attributes':['id',_0x4aa0('0x3b')],'where':{'id':_0x19474a[_0x4aa0('0xbc')][_0x4aa0('0xc3')]}})['then'](function(_0x27d7d8){if(_0x27d7d8){_0x19474a[_0x4aa0('0xa5')][_0x4aa0('0xc4')]({'id':0x0,'priority':0x0,'app':_0x4aa0('0xc5'),'appdata':_0x27d7d8[_0x4aa0('0x3b')]+','+(_0x19474a['account'][_0x4aa0('0xc6')]||0xa),'interval':_0x4aa0('0xc0')});_0x19474a[_0x4aa0('0xc7')]=!![];}return respondWithRpcPromise('Start','startRouting',_0x19474a);});}return respondWithRpcPromise(_0x4aa0('0xc8'),_0x4aa0('0xc9'),_0x19474a);})['then'](function(_0x3a3546){respondWithRpcPromise(_0x4aa0('0xca'),'EventManager',{'event':_0x4aa0('0xcb'),'message':_0x3a3546},client9002);return _0x3a3546;})['then'](respondWithResult(_0x488336,null))[_0x4aa0('0x28')](handleError(_0x488336,null));};exports[_0x4aa0('0xcc')]=function(_0x4f69c3,_0x452a99,_0x5b8276){var _0xa84bcb,_0x47c316,_0x4ee32e;var _0x4db1ee=[];var _0x1e5b95=[];var _0x3baebe={};var _0x3b2138=_0x4f69c3[_0x4aa0('0xcd')]||[];var _0xa14da7=[];var _0xf705da;return db[_0x4aa0('0x93')][_0x4aa0('0x67')]()[_0x4aa0('0x1d')](function(_0x1a32c0){if(!_0x1a32c0){throw new db[(_0x4aa0('0x94'))][(_0x4aa0('0x95'))]('no\x20available\x20attributes');}_0x1e5b95=_[_0x4aa0('0x97')](_[_0x4aa0('0x48')](_0x1a32c0),[_0x4aa0('0x98'),_0x4aa0('0x99')]);_0x4db1ee=_[_0x4aa0('0x97')](_[_0x4aa0('0x48')](_0x1a32c0),[_0x4aa0('0x98'),_0x4aa0('0x99'),'CompanyId','ListId']);if(_0x4f69c3['body']['id']){delete _0x4f69c3['body']['id'];}if(_['isNil'](_0x4f69c3['body'][_0x4aa0('0x9a')])){throw _0x452a99[_0x4aa0('0x2a')](0x1f4)[_0x4aa0('0x3c')](new db[(_0x4aa0('0x94'))][(_0x4aa0('0x95'))](_0x4aa0('0x9b')));}if(_[_0x4aa0('0x7f')](_0x4f69c3[_0x4aa0('0x5e')][_0x4aa0('0x5e')])||_0x4f69c3['body'][_0x4aa0('0x5e')]===''){throw _0x452a99[_0x4aa0('0x2a')](0x1f4)[_0x4aa0('0x3c')](new db[(_0x4aa0('0x94'))][(_0x4aa0('0x95'))](_0x4aa0('0x9c')));}if(_[_0x4aa0('0x7f')](_0x4f69c3[_0x4aa0('0x5e')]['mapKeyOffline'])){throw _0x452a99[_0x4aa0('0x2a')](0x1f4)[_0x4aa0('0x3c')](new db[(_0x4aa0('0x94'))][(_0x4aa0('0x95'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4db1ee));}if(!_[_0x4aa0('0xce')](_0x4db1ee,_0x4f69c3['body'][_0x4aa0('0xcf')])){throw _0x452a99[_0x4aa0('0x2a')](0x1f4)[_0x4aa0('0x3c')](new db[(_0x4aa0('0x94'))][(_0x4aa0('0x95'))](_0x4aa0('0xd0')+_0x4db1ee));}_0x3baebe[_0x4f69c3[_0x4aa0('0x5e')]['mapKeyOffline']]=_0x4f69c3[_0x4aa0('0x5e')][_0x4aa0('0x9a')];})[_0x4aa0('0x1d')](function(){return db[_0x4aa0('0x40')][_0x4aa0('0x5c')]({'where':{'id':_0x4f69c3[_0x4aa0('0x66')]['id']},'include':[{'model':db['CmList'],'as':_0x4aa0('0xa1')},{'model':db[_0x4aa0('0xd1')],'as':_0x4aa0('0xd1')}]});})[_0x4aa0('0x1d')](handleEntityNotFound(_0x452a99,null))[_0x4aa0('0x1d')](function(_0x45bc7a){if(_0x45bc7a&&_0x45bc7a[_0x4aa0('0xa1')]){_0x47c316=_0x45bc7a;var _0x2c4985=_[_0x4aa0('0x15')](_0x4f69c3[_0x4aa0('0x5e')],{'firstName':_0x4f69c3[_0x4aa0('0x5e')][_0x4aa0('0x9a')],'phone':_0x4f69c3[_0x4aa0('0x5e')][_0x4aa0('0x9a')],'ListId':_0x45bc7a[_0x4aa0('0xd2')]});_0x2c4985[_0x4f69c3[_0x4aa0('0x5e')][_0x4aa0('0xcf')]]=_0x4f69c3[_0x4aa0('0x5e')][_0x4aa0('0x9a')];return db[_0x4aa0('0x93')][_0x4aa0('0xd3')]({'where':_0x3baebe,'defaults':_0x2c4985});}})['spread'](function(_0xd89ee7){if(_0xd89ee7){_0x4ee32e=_0xd89ee7;var _0x32dbe5=fs[_0x4aa0('0xd4')](path[_0x4aa0('0x7c')](config[_0x4aa0('0x81')],_0x4aa0('0xd5')),'utf8');var _0x124d68=ejs[_0x4aa0('0xd6')](_0x32dbe5,{'body':_[_0x4aa0('0xd7')](_0x4f69c3[_0x4aa0('0x5e')][_0x4aa0('0x5e')]),'bodyTitle':_0x47c316[_0x4aa0('0xd8')]});return db[_0x4aa0('0xd9')][_0x4aa0('0x5d')]({'body':_0x124d68,'ContactId':_0xd89ee7['id'],'ChatWebsiteId':_0x47c316['id']});}})['then'](function(_0x1cf361){_0xf705da=_0x1cf361;if(_0x3b2138['length']){var _0x1f45cc=_0x3b2138[_0x4aa0('0x46')](function(_0x4ed590){return{'name':_0x4ed590[_0x4aa0('0xda')],'basename':_0x4ed590[_0x4aa0('0x76')],'type':_0x4ed590[_0x4aa0('0xdb')],'ChatOfflineMessageId':_0x1cf361['id']};});_0xa14da7=_0x1f45cc[_0x4aa0('0x46')](_0x2bc653=>{var _0x40f291={'filename':_0x2bc653[_0x4aa0('0x3b')],'path':path['join'](config[_0x4aa0('0x81')],_0x4aa0('0xdc'),'files','attachments',_0x4aa0('0xdd'),_0x2bc653[_0x4aa0('0xde')])};return _0x40f291;});if(!_0x47c316['openNewInteraction']){return db[_0x4aa0('0xdf')]['transaction'](function(_0x17075c){return db['Attachment']['bulkCreate'](_0x1f45cc,{'transaction':_0x17075c});});}}})['then'](function(){if(_0xf705da){_0xa84bcb=_0xf705da;return db['MailAccount']['findOne']({'where':{'active':!![]},'include':[{'model':db[_0x4aa0('0xe0')],'as':_0x4aa0('0xe1'),'raw':!![]}]});}})[_0x4aa0('0x1d')](function(_0xfd9b56){if(_0xfd9b56&&_0xfd9b56[_0x4aa0('0xe1')]&&_0x47c316[_0x4aa0('0xe2')]&&_0x47c316[_0x4aa0('0xe3')]){var _0x4e946c={'tls':{'rejectUnauthorized':![]}};if(_0xfd9b56['Smtp']['service']){_0x4e946c['service']=_0xfd9b56[_0x4aa0('0xe1')]['service'];}else{_0x4e946c[_0x4aa0('0xe4')]=_0xfd9b56[_0x4aa0('0xe1')][_0x4aa0('0xe4')];_0x4e946c[_0x4aa0('0xe5')]=_0xfd9b56[_0x4aa0('0xe1')]['port'];_0x4e946c[_0x4aa0('0xe6')]=_0xfd9b56['Smtp'][_0x4aa0('0xe6')];}if(_0xfd9b56[_0x4aa0('0xe1')]['authentication']){_0x4e946c[_0x4aa0('0xe7')]={'user':_0xfd9b56['Smtp'][_0x4aa0('0x5f')],'pass':_0xfd9b56[_0x4aa0('0xe1')]['pass']};}return respondWithRpcPromise(_0x4aa0('0xe8'),_0x4aa0('0xe9'),{'account':_0x4e946c,'message':{'from':util['format'](_0x4aa0('0xea'),_0xfd9b56['name'],_0xfd9b56[_0x4aa0('0xeb')]||_0xfd9b56[_0x4aa0('0xe1')][_0x4aa0('0x5f')]),'to':_0x47c316['forwardOfflineAddress'],'subject':_0x47c316['offlineMessageSubject'],'html':_0xa84bcb[_0x4aa0('0x5e')],'attachments':_0xa14da7}},client9003)[_0x4aa0('0x1d')](function(){return _0xa84bcb;})['catch'](function(_0x227ce1){console['error'](_0x227ce1);});}})[_0x4aa0('0x1d')](function(){if(_0x47c316&&_0x47c316[_0x4aa0('0xec')]&&_0x47c316[_0x4aa0('0xed')]){var _0x274538=[];if(_0x3b2138[_0x4aa0('0x4d')]){_0x274538=_0x3b2138['map'](function(_0x201256){return{'name':_0x201256[_0x4aa0('0xda')],'basename':_0x201256['filename'],'type':_0x201256[_0x4aa0('0xdb')],'ChatOfflineMessageId':_0xf705da['id']};});}var _0x42d815;if(!_[_0x4aa0('0x7f')](_0x47c316['subjectOffline'])){var _0x47bd70=_[_0x4aa0('0x46')](_0x4f69c3[_0x4aa0('0x5e')],function(_0x467e6f){return _0x467e6f;});var _0x36c419=_['toPairsIn'](_0x47bd70)[0x0];var _0x4f5560=_[_0x4aa0('0xee')](_0x36c419,function(_0x2317bb){return _0x2317bb;});_0x42d815=_0x4f5560[0x1][_0x47c316[_0x4aa0('0xef')]];}var _0x3d9d6a={'from':_0x4ee32e['email'],'firstName':_0x4ee32e[_0x4aa0('0xae')],'lastName':_0x4ee32e[_0x4aa0('0xaf')],'mapKey':_0x4aa0('0xeb'),'message':{'from':_0x4ee32e[_0x4aa0('0xeb')],'to':_0x47c316[_0x4aa0('0xd1')]['email'],'cc':'','subject':_[_0x4aa0('0x7f')](_0x42d815)?_0x47c316[_0x4aa0('0xf0')]:_0x42d815,'messageId':'','sentAt':new Date(),'attach':_0x274538[_0x4aa0('0x4d')],'attachments':_0x274538,'originChannel':_0x4aa0('0xf1'),'ChatWebsiteId':_0x47c316['id'],'ChatOfflineMessageId':_0xa84bcb['id'],'originTo':_0x47c316[_0x4aa0('0xd1')][_0x4aa0('0xeb')]},'body':_0xa84bcb[_0x4aa0('0x5e')]};var _0x16ed1e={'account':{'id':_0x47c316[_0x4aa0('0xed')]},'body':_0x3d9d6a,'log':_0x4aa0('0xf2')};return respondWithRpcPromise('NotifyMailAccount',_0x4aa0('0xf3'),_0x16ed1e,client9001)['then'](function(){return _0xa84bcb;})['catch'](function(_0xb477f0){console['error'](_0xb477f0);});}return;})[_0x4aa0('0x1d')](function(){if(_0xa84bcb){return _0xa84bcb;}})['then'](respondWithResult(_0x452a99,null))['catch'](function(_0x4e3599){console[_0x4aa0('0x24')](_0x4aa0('0x28'),_0x4e3599);for(var _0x216083 of _0x3b2138){var _0x2b5e81=path[_0x4aa0('0x7c')](config[_0x4aa0('0x81')],_0x4aa0('0xdc'),_0x4aa0('0xcd'),'attachments',_0x4aa0('0xdd'),_0x216083[_0x4aa0('0x76')]);fs_extra[_0x4aa0('0xf4')](_0x2b5e81)['catch'](function(_0x35d64d){console[_0x4aa0('0x24')](_0x4aa0('0xf5'),_0x2b5e81,_0x35d64d);});}});};exports[_0x4aa0('0xf6')]=function(_0x480814,_0x4cb595,_0x1b05be){return db[_0x4aa0('0xba')][_0x4aa0('0x5c')]({'where':{'id':_0x480814[_0x4aa0('0x66')]['id']}})[_0x4aa0('0x1d')](handleEntityNotFound(_0x4cb595,null))[_0x4aa0('0x1d')](function(_0x2aa96b){if(_0x2aa96b){return _0x2aa96b[_0x4aa0('0xf6')](_0x480814[_0x4aa0('0x5e')]['ids'],_[_0x4aa0('0xf7')](_0x480814[_0x4aa0('0x5e')],[_0x4aa0('0x6e'),'id'])||{});}})['then'](respondWithResult(_0x4cb595,null))[_0x4aa0('0x28')](handleError(_0x4cb595,null));};exports[_0x4aa0('0xf8')]=function(_0x27e6a1,_0x56f6de,_0x187b35){var _0x4152a1={'raw':![],'where':{}};var _0x25d4f6={};var _0x511468={'count':0x0,'rows':[]};return db[_0x4aa0('0x40')][_0x4aa0('0x71')]({'where':{'id':_0x27e6a1[_0x4aa0('0x66')]['id']}})[_0x4aa0('0x1d')](handleEntityNotFound(_0x56f6de,null))[_0x4aa0('0x1d')](function(_0x116379){if(_0x116379){_0x25d4f6[_0x4aa0('0x45')]=_[_0x4aa0('0x48')](db[_0x4aa0('0xba')]['rawAttributes']);_0x25d4f6[_0x4aa0('0x47')]=_[_0x4aa0('0x48')](_0x27e6a1[_0x4aa0('0x47')]);_0x25d4f6[_0x4aa0('0x49')]=_[_0x4aa0('0x4a')](_0x25d4f6[_0x4aa0('0x45')],_0x25d4f6[_0x4aa0('0x47')]);_0x4152a1['attributes']=_[_0x4aa0('0x4a')](_0x25d4f6[_0x4aa0('0x45')],qs['fields'](_0x27e6a1['query'][_0x4aa0('0x4c')]));_0x4152a1[_0x4aa0('0x4b')]=_0x4152a1[_0x4aa0('0x4b')][_0x4aa0('0x4d')]?_0x4152a1[_0x4aa0('0x4b')]:_0x25d4f6['model'];if(!_0x27e6a1[_0x4aa0('0x47')][_0x4aa0('0x4e')](_0x4aa0('0x4f'))){_0x4152a1[_0x4aa0('0x2d')]=qs[_0x4aa0('0x2d')](_0x27e6a1['query']['limit']);_0x4152a1['offset']=qs[_0x4aa0('0x2c')](_0x27e6a1[_0x4aa0('0x47')]['offset']);}_0x4152a1[_0x4aa0('0x50')]=qs[_0x4aa0('0x51')](_0x27e6a1[_0x4aa0('0x47')]['sort']);_0x4152a1[_0x4aa0('0x52')]=qs[_0x4aa0('0x49')](_[_0x4aa0('0x53')](_0x27e6a1[_0x4aa0('0x47')],_0x25d4f6[_0x4aa0('0x49')]));_0x4152a1[_0x4aa0('0x52')][_0x4aa0('0x69')]=_0x116379['id'];if(_0x27e6a1[_0x4aa0('0x47')][_0x4aa0('0x54')]){_0x4152a1['where']=_[_0x4aa0('0x5b')](_0x4152a1[_0x4aa0('0x52')],{'$or':_[_0x4aa0('0x46')](_0x4152a1[_0x4aa0('0x4b')],function(_0x22005e){var _0x2c6a05={};_0x2c6a05[_0x22005e]={'$like':'%'+_0x27e6a1[_0x4aa0('0x47')][_0x4aa0('0x54')]+'%'};return _0x2c6a05;})});}_0x4152a1=_[_0x4aa0('0x5b')]({},_0x4152a1,_0x27e6a1[_0x4aa0('0x56')]);return db[_0x4aa0('0xba')][_0x4aa0('0x2f')]({'where':_0x4152a1[_0x4aa0('0x52')]})['then'](function(_0x1f67b5){_0x511468[_0x4aa0('0x2f')]=_0x1f67b5;if(_0x27e6a1[_0x4aa0('0x47')]['includeAll']){_0x4152a1['include']=[{'model':db[_0x4aa0('0x93')],'as':_0x4aa0('0xf9'),'required':![]},{'model':db['User'],'as':_0x4aa0('0xfa'),'attributes':[_0x4aa0('0x3b'),_0x4aa0('0xfb'),'internal'],'required':![]},{'model':db[_0x4aa0('0xfc')],'as':_0x4aa0('0xfd'),'attributes':['id',_0x4aa0('0x3b'),_0x4aa0('0xfe')],'where':_0x27e6a1[_0x4aa0('0x47')][_0x4aa0('0xff')]?{'id':_0x27e6a1['query'][_0x4aa0('0xff')]}:undefined,'required':_0x27e6a1[_0x4aa0('0x47')]['tag']?!![]:![]}];}return db[_0x4aa0('0xba')][_0x4aa0('0x6c')](_0x4152a1);})[_0x4aa0('0x1d')](function(_0x56c5db){_0x511468[_0x4aa0('0x58')]=_0x56c5db;return _0x511468;});}})[_0x4aa0('0x1d')](respondWithFilteredResult(_0x56f6de,_0x4152a1))['catch'](handleError(_0x56f6de,null));};function iftimePromise(_0x55b3f5,_0xf7953c){return respondWithRpcPromise(_0x4aa0('0x100'),_0x4aa0('0x101'),{'command':_0xf7953c['timezone']?util['format'](_0x4aa0('0x102'),_0x55b3f5[_0x4aa0('0x103')],_0xf7953c[_0x4aa0('0x104')]):util['format'](_0x4aa0('0x105'),_0x55b3f5[_0x4aa0('0x103')])},client9002)['then'](function(_0x41a576){var _0x83c8e0=_0x41a576&&_0x41a576[_0x4aa0('0x106')](_0x4aa0('0x107'))>=0x0?!![]:![];logger[_0x4aa0('0x1e')](_0x4aa0('0x108'),_0xf7953c['id'],_0x55b3f5['id'],_0x55b3f5['interval'],_0x83c8e0?_0x4aa0('0x109'):_0x4aa0('0x10a'),_0xf7953c[_0x4aa0('0x104')]?_0xf7953c[_0x4aa0('0x104')]:_0x4aa0('0x10b'));return _0x83c8e0;})[_0x4aa0('0x28')](function(_0x192a48){logger[_0x4aa0('0x24')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0xf7953c['id'],_0x55b3f5['id'],_0x55b3f5[_0x4aa0('0x103')],util['inspect'](_0x192a48,{'showHidden':![],'depth':null}),_0xf7953c[_0x4aa0('0x104')]?_0xf7953c[_0x4aa0('0x104')]:_0x4aa0('0x10b'));return![];});}exports[_0x4aa0('0x101')]=function(_0x513dff,_0x33b196,_0x89b64d){var _0x27516c=0x0;var _0x4ae21b=0x0;var _0x3a121a=![];var _0x50090a;var _0x4b1a1e;return db['ChatWebsite'][_0x4aa0('0x5c')]({'where':{'id':_0x513dff[_0x4aa0('0x66')]['id']},'include':[{'model':db['Interval'],'as':_0x4aa0('0x10c'),'include':[{'model':db[_0x4aa0('0x10c')],'as':'Intervals','attributes':['id',_0x4aa0('0x103')],'raw':!![]}]}]})[_0x4aa0('0x1d')](handleEntityNotFound(_0x33b196,null))[_0x4aa0('0x1d')](function(_0x4beab9){if(_0x4beab9){_0x50090a=_0x4beab9;return _0x4beab9[_0x4aa0('0x10d')]({'raw':!![]});}})[_0x4aa0('0x1d')](function(_0x1fef3d){if(_0x50090a){if(_0x1fef3d){_0x4b1a1e=_0x1fef3d;}}return require(_0x4aa0('0x7e'))['getLicense']();})[_0x4aa0('0x1d')](function(_0x303d42){if(_0x303d42){_0x4ae21b=_0x303d42[_0x4aa0('0x10e')];_0x3a121a=_0x303d42[_0x4aa0('0x10f')];}})[_0x4aa0('0x1d')](function(){return db[_0x4aa0('0xba')][_0x4aa0('0x2f')]({'where':{'closed':![]}});})['then'](function(_0x4837b2){_0x27516c=_0x4837b2;if(_0x4ae21b&&_0x4837b2>_0x4ae21b){return db['License']['findOne']({'where':{'id':0x1}})[_0x4aa0('0x1d')](function(_0x3c134f){if(_0x3c134f){_0x3c134f[_0x4aa0('0x110')](_0x4aa0('0x111'));}});}})[_0x4aa0('0x1d')](function(){if(_0x50090a[_0x4aa0('0x10c')]&&_0x50090a['Interval'][_0x4aa0('0x112')]){var _0x5173f3=[];for(var _0x59f21e=0x0;_0x59f21e<_0x50090a[_0x4aa0('0x10c')][_0x4aa0('0x112')][_0x4aa0('0x4d')];_0x59f21e++){var _0x5e1f71=_0x50090a[_0x4aa0('0x10c')][_0x4aa0('0x112')][_0x59f21e]['get']({'plain':!![]});_0x5173f3[_0x4aa0('0x113')](iftimePromise(_0x5e1f71,_0x50090a));}return BPromise[_0x4aa0('0x114')](_0x5173f3)[_0x4aa0('0x1d')](function(_0x68a497){return _[_0x4aa0('0x115')](_0x68a497);});}else{return!![];}})['then'](function(_0x2592a4){var _0x200989=fs['readFileSync'](path[_0x4aa0('0x7c')](config[_0x4aa0('0x81')],_0x4aa0('0x116')),'utf8');var _0x1b2e4f={'remote':_0x50090a[_0x4aa0('0x117')],'query':querystring[_0x4aa0('0x23')](_[_0x4aa0('0x5b')](_0x50090a[_0x4aa0('0x38')]({'plain':!![]}),{'customerIp':_0x513dff[_0x4aa0('0x90')][_0x4aa0('0xac')]||_0x513dff['headers'][_0x4aa0('0x118')]||_0x513dff[_0x4aa0('0x119')][_0x4aa0('0x11a')]||_0x513dff['ip'],'referer':_0x513dff[_0x4aa0('0x90')][_0x4aa0('0x11b')],'openedInteractions':_0x27516c,'maxInteractions':_0x4ae21b,'virtual':_0x3a121a['virtual'],'online':_0x2592a4,'custom':_0x3a121a}))[_0x4aa0('0x11c')](/'/g,'\x5c\x27')};_0x33b196['send'](ejs[_0x4aa0('0xd6')](Mustache['render'](_0x200989,_0x1b2e4f),{'proactiveActions':_0x4b1a1e,'alignment':_0x50090a[_0x4aa0('0x11d')],'verticalAlignment':_0x50090a[_0x4aa0('0x11e')],'div_color':_0x50090a[_0x4aa0('0xfe')],'text_color':_0x50090a[_0x4aa0('0x11f')],'button_color':_0x50090a[_0x4aa0('0x120')],'background_color':_0x50090a[_0x4aa0('0x121')]}));})['catch'](handleError(_0x33b196,null));};exports[_0x4aa0('0x122')]=function(_0x4491e3,_0x4cb784,_0x37b43d){return db[_0x4aa0('0x40')][_0x4aa0('0x71')]({'where':{'id':_0x4491e3[_0x4aa0('0x66')]['id']}})[_0x4aa0('0x1d')](handleEntityNotFound(_0x4cb784,null))[_0x4aa0('0x1d')](function(_0x4effa9){if(_0x4effa9){return db[_0x4aa0('0xdf')][_0x4aa0('0x123')](function(_0x8c292a){return db[_0x4aa0('0x124')][_0x4aa0('0x37')]({'where':{'ChatWebsiteId':_0x4491e3['params']['id']},'transaction':_0x8c292a})[_0x4aa0('0x1d')](function(_0x165199){var _0x2f1166=_[_0x4aa0('0x46')](_0x4491e3['body'],function(_0x2f2ebd){_0x2f2ebd[_0x4aa0('0x69')]=_0x4491e3[_0x4aa0('0x66')]['id'];return _0x2f2ebd;});return db[_0x4aa0('0x124')]['bulkCreate'](_0x2f1166,{'transaction':_0x8c292a});});})['then'](function(){return db[_0x4aa0('0x124')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x4491e3[_0x4aa0('0x66')]['id']},'order':'priority'});});}})[_0x4aa0('0x1d')](respondWithResult(_0x4cb784,null))[_0x4aa0('0x28')](handleError(_0x4cb784,null));};exports['getApplications']=function(_0x2eebb8,_0x49ccbd,_0x129ee3){var _0x3acc0a={};var _0x57233a={};var _0x38ee26;var _0x2a773b;return db[_0x4aa0('0x40')][_0x4aa0('0x71')]({'where':{'id':_0x2eebb8[_0x4aa0('0x66')]['id']}})[_0x4aa0('0x1d')](handleEntityNotFound(_0x49ccbd,null))['then'](function(_0x5c1ddb){if(_0x5c1ddb){_0x38ee26=_0x5c1ddb;_0x57233a['model']=_[_0x4aa0('0x48')](db['ChatApplication']['rawAttributes']);_0x57233a[_0x4aa0('0x47')]=_['keys'](_0x2eebb8[_0x4aa0('0x47')]);_0x57233a[_0x4aa0('0x49')]=_['intersection'](_0x57233a[_0x4aa0('0x45')],_0x57233a[_0x4aa0('0x47')]);_0x3acc0a[_0x4aa0('0x4b')]=_[_0x4aa0('0x4a')](_0x57233a[_0x4aa0('0x45')],qs[_0x4aa0('0x4c')](_0x2eebb8[_0x4aa0('0x47')][_0x4aa0('0x4c')]));_0x3acc0a['attributes']=_0x3acc0a[_0x4aa0('0x4b')][_0x4aa0('0x4d')]?_0x3acc0a[_0x4aa0('0x4b')]:_0x57233a[_0x4aa0('0x45')];_0x3acc0a[_0x4aa0('0x50')]=qs['sort'](_0x2eebb8[_0x4aa0('0x47')][_0x4aa0('0x51')]);_0x3acc0a[_0x4aa0('0x52')]=qs[_0x4aa0('0x49')](_[_0x4aa0('0x53')](_0x2eebb8['query'],_0x57233a[_0x4aa0('0x49')]));if(_0x2eebb8['query'][_0x4aa0('0x54')]){_0x3acc0a[_0x4aa0('0x52')]=_['merge'](_0x3acc0a[_0x4aa0('0x52')],{'$or':_['map'](_0x3acc0a[_0x4aa0('0x4b')],function(_0x422d39){var _0x58f76c={};_0x58f76c[_0x422d39]={'$like':'%'+_0x2eebb8[_0x4aa0('0x47')]['filter']+'%'};return _0x58f76c;})});}_0x3acc0a=_[_0x4aa0('0x5b')]({},_0x3acc0a,_0x2eebb8['options']);return _0x38ee26[_0x4aa0('0x125')](_0x3acc0a);}})[_0x4aa0('0x1d')](function(_0x4ace94){if(_0x4ace94){_0x2a773b=_0x4ace94[_0x4aa0('0x4d')];if(!_0x2eebb8[_0x4aa0('0x47')][_0x4aa0('0x4e')]('nolimit')){_0x3acc0a[_0x4aa0('0x2d')]=qs[_0x4aa0('0x2d')](_0x2eebb8[_0x4aa0('0x47')][_0x4aa0('0x2d')]);_0x3acc0a[_0x4aa0('0x2c')]=qs['offset'](_0x2eebb8['query'][_0x4aa0('0x2c')]);}return _0x38ee26['getApplications'](_0x3acc0a);}})[_0x4aa0('0x1d')](function(_0x100d03){if(_0x100d03){return _0x100d03?{'count':_0x2a773b,'rows':_0x100d03}:null;}})['then'](respondWithResult(_0x49ccbd,null))[_0x4aa0('0x28')](handleError(_0x49ccbd,null));};exports[_0x4aa0('0x126')]=function(_0x4d34fd,_0x5a618a,_0x3d0444){return db['chatProactiveAction']['find']({'where':{'id':_0x4d34fd[_0x4aa0('0x66')]['id']}})[_0x4aa0('0x1d')](handleEntityNotFound(_0x5a618a,null))[_0x4aa0('0x1d')](function(_0x968761){if(_0x968761){return _0x968761[_0x4aa0('0x126')](_0x4d34fd['body'][_0x4aa0('0x6e')],_[_0x4aa0('0xf7')](_0x4d34fd['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x5a618a,null))[_0x4aa0('0x28')](handleError(_0x5a618a,null));};exports[_0x4aa0('0x10d')]=function(_0x371685,_0x29cf9a,_0x161916){var _0x23bead={};var _0x111dcc={};var _0x1e180b;var _0x40f21b;return db[_0x4aa0('0x40')]['findOne']({'where':{'id':_0x371685[_0x4aa0('0x66')]['id']}})[_0x4aa0('0x1d')](handleEntityNotFound(_0x29cf9a,null))[_0x4aa0('0x1d')](function(_0x971177){if(_0x971177){_0x1e180b=_0x971177;_0x111dcc[_0x4aa0('0x45')]=_[_0x4aa0('0x48')](db[_0x4aa0('0x127')][_0x4aa0('0x41')]);_0x111dcc[_0x4aa0('0x47')]=_[_0x4aa0('0x48')](_0x371685[_0x4aa0('0x47')]);_0x111dcc['filters']=_[_0x4aa0('0x4a')](_0x111dcc['model'],_0x111dcc[_0x4aa0('0x47')]);_0x23bead[_0x4aa0('0x4b')]=_[_0x4aa0('0x4a')](_0x111dcc[_0x4aa0('0x45')],qs[_0x4aa0('0x4c')](_0x371685['query'][_0x4aa0('0x4c')]));_0x23bead['attributes']=_0x23bead[_0x4aa0('0x4b')][_0x4aa0('0x4d')]?_0x23bead[_0x4aa0('0x4b')]:_0x111dcc[_0x4aa0('0x45')];_0x23bead[_0x4aa0('0x50')]=qs[_0x4aa0('0x51')](_0x371685[_0x4aa0('0x47')][_0x4aa0('0x51')]);_0x23bead[_0x4aa0('0x52')]=qs['filters'](_[_0x4aa0('0x53')](_0x371685[_0x4aa0('0x47')],_0x111dcc[_0x4aa0('0x49')]));if(_0x371685[_0x4aa0('0x47')][_0x4aa0('0x54')]){_0x23bead[_0x4aa0('0x52')]=_['merge'](_0x23bead['where'],{'$or':_[_0x4aa0('0x46')](_0x23bead[_0x4aa0('0x4b')],function(_0x1d0dc1){var _0x144c2e={};_0x144c2e[_0x1d0dc1]={'$like':'%'+_0x371685[_0x4aa0('0x47')]['filter']+'%'};return _0x144c2e;})});}_0x23bead=_[_0x4aa0('0x5b')]({},_0x23bead,_0x371685[_0x4aa0('0x56')]);return _0x1e180b[_0x4aa0('0x10d')](_0x23bead);}})['then'](function(_0x29c834){if(_0x29c834){_0x40f21b=_0x29c834['length'];if(!_0x371685[_0x4aa0('0x47')][_0x4aa0('0x4e')]('nolimit')){_0x23bead['limit']=qs[_0x4aa0('0x2d')](_0x371685['query']['limit']);_0x23bead[_0x4aa0('0x2c')]=qs[_0x4aa0('0x2c')](_0x371685[_0x4aa0('0x47')]['offset']);}return _0x1e180b[_0x4aa0('0x10d')](_0x23bead);}})[_0x4aa0('0x1d')](function(_0x431d4b){if(_0x431d4b){return _0x431d4b?{'count':_0x40f21b,'rows':_0x431d4b}:null;}})[_0x4aa0('0x1d')](respondWithResult(_0x29cf9a,null))[_0x4aa0('0x28')](handleError(_0x29cf9a,null));};exports['getFields']=function(_0x4097c6,_0x328744,_0x58b2e2){var _0x12db7b=_0x4097c6[_0x4aa0('0x47')][_0x4aa0('0x128')]===_0x4aa0('0x129')?_0x4aa0('0x12a'):'onlineForm';return db['ChatWebsite']['find']({'attributes':['id',_0x12db7b],'where':{'id':_0x4097c6[_0x4aa0('0x66')]['id']}})[_0x4aa0('0x1d')](handleEntityNotFound(_0x328744,null))[_0x4aa0('0x1d')](function(_0x1cbead){if(_0x1cbead){var _0x366d2f=_0x1cbead[_0x12db7b];var _0x3d7cc5=_0x366d2f&&_0x366d2f[_0x4aa0('0x12b')]?_0x366d2f['items']:[];_0x328744[_0x4aa0('0x3c')]({'fromKey':_[_0x4aa0('0x7f')](_0x366d2f[_0x4aa0('0x12c')])?undefined:_0x366d2f[_0x4aa0('0x12c')],'count':_0x3d7cc5[_0x4aa0('0x4d')],'rows':_0x3d7cc5});}})[_0x4aa0('0x28')](handleError(_0x328744,null));};exports['getOfflineMessages']=function(_0x57027a,_0x43a0c7,_0x55bf10){var _0x2497e5={'raw':![],'where':{}};var _0x616ad5={};var _0x2b9cdf={'count':0x0,'rows':[]};return db[_0x4aa0('0x40')][_0x4aa0('0x71')]({'where':{'id':_0x57027a[_0x4aa0('0x66')]['id']}})[_0x4aa0('0x1d')](handleEntityNotFound(_0x43a0c7,null))[_0x4aa0('0x1d')](function(_0x44e4ec){if(_0x44e4ec){_0x616ad5[_0x4aa0('0x45')]=_[_0x4aa0('0x48')](db['ChatOfflineMessage'][_0x4aa0('0x41')]);_0x616ad5['query']=_[_0x4aa0('0x48')](_0x57027a[_0x4aa0('0x47')]);_0x616ad5[_0x4aa0('0x49')]=_[_0x4aa0('0x4a')](_0x616ad5[_0x4aa0('0x45')],_0x616ad5[_0x4aa0('0x47')]);_0x2497e5[_0x4aa0('0x4b')]=_[_0x4aa0('0x4a')](_0x616ad5['model'],qs[_0x4aa0('0x4c')](_0x57027a[_0x4aa0('0x47')][_0x4aa0('0x4c')]));_0x2497e5[_0x4aa0('0x4b')]=_0x2497e5[_0x4aa0('0x4b')]['length']?_0x2497e5['attributes']:_0x616ad5['model'];if(!_0x57027a[_0x4aa0('0x47')][_0x4aa0('0x4e')](_0x4aa0('0x4f'))){_0x2497e5[_0x4aa0('0x2d')]=qs[_0x4aa0('0x2d')](_0x57027a[_0x4aa0('0x47')][_0x4aa0('0x2d')]);_0x2497e5[_0x4aa0('0x2c')]=qs[_0x4aa0('0x2c')](_0x57027a[_0x4aa0('0x47')][_0x4aa0('0x2c')]);}_0x2497e5[_0x4aa0('0x50')]=qs['sort'](_0x57027a[_0x4aa0('0x47')][_0x4aa0('0x51')]);_0x2497e5[_0x4aa0('0x52')]=qs[_0x4aa0('0x49')](_[_0x4aa0('0x53')](_0x57027a[_0x4aa0('0x47')],_0x616ad5['filters']));_0x2497e5[_0x4aa0('0x52')]['ChatWebsiteId']=_0x44e4ec['id'];if(_0x57027a[_0x4aa0('0x47')][_0x4aa0('0x54')]){_0x2497e5[_0x4aa0('0x52')]=_[_0x4aa0('0x5b')](_0x2497e5[_0x4aa0('0x52')],{'$or':_[_0x4aa0('0x46')](_0x2497e5[_0x4aa0('0x4b')],function(_0x59f3a3){var _0x3bd7ee={};_0x3bd7ee[_0x59f3a3]={'$like':'%'+_0x57027a['query'][_0x4aa0('0x54')]+'%'};return _0x3bd7ee;})});}_0x2497e5=_[_0x4aa0('0x5b')]({},_0x2497e5,_0x57027a[_0x4aa0('0x56')]);return db[_0x4aa0('0xd9')][_0x4aa0('0x2f')]({'where':_0x2497e5[_0x4aa0('0x52')]})[_0x4aa0('0x1d')](function(_0x31fda9){_0x2b9cdf[_0x4aa0('0x2f')]=_0x31fda9;if(_0x57027a['query'][_0x4aa0('0x5a')]){_0x2497e5['include']=[{'all':!![]}];}else{_0x2497e5['include']=[{'model':db[_0x4aa0('0x93')],'as':_0x4aa0('0xf9'),'required':![]},{'model':db[_0x4aa0('0x12d')],'as':_0x4aa0('0x12e'),'required':![]}];}return db[_0x4aa0('0xd9')]['findAll'](_0x2497e5);})[_0x4aa0('0x1d')](function(_0x1d5fd2){_0x2b9cdf[_0x4aa0('0x58')]=_0x1d5fd2;return _0x2b9cdf;});}})['then'](respondWithFilteredResult(_0x43a0c7,_0x2497e5))[_0x4aa0('0x28')](handleError(_0x43a0c7,null));};exports[_0x4aa0('0x12f')]=function(_0x12152c,_0x30bcb2,_0x3443c2){return db['ChatWebsite'][_0x4aa0('0x5c')]({'where':{'id':_0x12152c[_0x4aa0('0x66')]['id']}})[_0x4aa0('0x1d')](handleEntityNotFound(_0x30bcb2,null))[_0x4aa0('0x1d')](function(_0x892b51){if(_0x892b51){return _0x892b51[_0x4aa0('0x12f')](_0x12152c['body']['ids'],_['omit'](_0x12152c[_0x4aa0('0x5e')],[_0x4aa0('0x6e'),'id'])||{})['spread'](function(_0x218c4a){for(var _0x16cd20=0x0;_0x16cd20<_0x12152c[_0x4aa0('0x5e')][_0x4aa0('0x6e')][_0x4aa0('0x4d')];_0x16cd20+=0x1){socket[_0x4aa0('0x130')](_0x4aa0('0x131'),{'UserId':Number(_0x12152c[_0x4aa0('0x5e')][_0x4aa0('0x6e')][_0x16cd20]),'ChatWebsiteId':Number(_0x12152c[_0x4aa0('0x66')]['id'])});}return _0x218c4a;});}})['then'](respondWithResult(_0x30bcb2,null))['catch'](handleError(_0x30bcb2,null));};exports[_0x4aa0('0x132')]=function(_0x53a688,_0x1f98b1,_0x44f1a6){return db[_0x4aa0('0x40')][_0x4aa0('0x5c')]({'where':{'id':_0x53a688[_0x4aa0('0x66')]['id']}})[_0x4aa0('0x1d')](handleEntityNotFound(_0x1f98b1,null))['then'](function(_0x19143a){if(_0x19143a){return _0x19143a['removeAgents'](_0x53a688['query'][_0x4aa0('0x6e')])[_0x4aa0('0x1d')](function(){if(_[_0x4aa0('0x133')](_0x53a688[_0x4aa0('0x47')][_0x4aa0('0x6e')])){for(var _0x1b0097=0x0;_0x1b0097<_0x53a688['query']['ids']['length'];_0x1b0097+=0x1){socket[_0x4aa0('0x130')](_0x4aa0('0x134'),{'UserId':Number(_0x53a688['query'][_0x4aa0('0x6e')][_0x1b0097]),'ChatWebsiteId':Number(_0x53a688['params']['id'])});}}else{socket[_0x4aa0('0x130')]('userChatWebsite:remove',{'UserId':Number(_0x53a688[_0x4aa0('0x47')][_0x4aa0('0x6e')]),'ChatWebsiteId':Number(_0x53a688['params']['id'])});}});}})['then'](respondWithStatusCode(_0x1f98b1,null))[_0x4aa0('0x28')](handleError(_0x1f98b1,null));};exports[_0x4aa0('0x135')]=function(_0x1017b2,_0x2677a6,_0x2b4d14){var _0x4585a3={};var _0x40565b={};var _0x305844;var _0x21b263;return db[_0x4aa0('0x40')][_0x4aa0('0x71')]({'where':{'id':_0x1017b2['params']['id']}})[_0x4aa0('0x1d')](handleEntityNotFound(_0x2677a6,null))[_0x4aa0('0x1d')](function(_0xabcac6){if(_0xabcac6){_0x305844=_0xabcac6;_0x40565b[_0x4aa0('0x45')]=_[_0x4aa0('0x48')](db[_0x4aa0('0x136')][_0x4aa0('0x41')]);_0x40565b[_0x4aa0('0x47')]=_[_0x4aa0('0x48')](_0x1017b2['query']);_0x40565b['filters']=_['intersection'](_0x40565b[_0x4aa0('0x45')],_0x40565b['query']);_0x4585a3[_0x4aa0('0x4b')]=_[_0x4aa0('0x4a')](_0x40565b[_0x4aa0('0x45')],qs[_0x4aa0('0x4c')](_0x1017b2[_0x4aa0('0x47')]['fields']));_0x4585a3['attributes']=_0x4585a3['attributes'][_0x4aa0('0x4d')]?_0x4585a3[_0x4aa0('0x4b')]:_0x40565b['model'];_0x4585a3[_0x4aa0('0x50')]=qs[_0x4aa0('0x51')](_0x1017b2[_0x4aa0('0x47')]['sort']);_0x4585a3[_0x4aa0('0x52')]=qs[_0x4aa0('0x49')](_[_0x4aa0('0x53')](_0x1017b2[_0x4aa0('0x47')],_0x40565b[_0x4aa0('0x49')]));if(_0x1017b2[_0x4aa0('0x47')][_0x4aa0('0x54')]){_0x4585a3['where']=_[_0x4aa0('0x5b')](_0x4585a3[_0x4aa0('0x52')],{'$or':_[_0x4aa0('0x46')](_0x4585a3[_0x4aa0('0x4b')],function(_0x508e24){var _0x981117={};_0x981117[_0x508e24]={'$like':'%'+_0x1017b2[_0x4aa0('0x47')][_0x4aa0('0x54')]+'%'};return _0x981117;})});}_0x4585a3=_[_0x4aa0('0x5b')]({},_0x4585a3,_0x1017b2[_0x4aa0('0x56')]);return _0x305844[_0x4aa0('0x135')](_0x4585a3);}})[_0x4aa0('0x1d')](function(_0x749aa0){if(_0x749aa0){_0x21b263=_0x749aa0[_0x4aa0('0x4d')];if(!_0x1017b2['query'][_0x4aa0('0x4e')]('nolimit')){_0x4585a3[_0x4aa0('0x2d')]=qs[_0x4aa0('0x2d')](_0x1017b2['query']['limit']);_0x4585a3[_0x4aa0('0x2c')]=qs[_0x4aa0('0x2c')](_0x1017b2[_0x4aa0('0x47')][_0x4aa0('0x2c')]);}return _0x305844['getAgents'](_0x4585a3);}})[_0x4aa0('0x1d')](function(_0x586771){if(_0x586771){return _0x586771?{'count':_0x21b263,'rows':_0x586771}:null;}})[_0x4aa0('0x1d')](respondWithResult(_0x2677a6,null))['catch'](handleError(_0x2677a6,null));}; \ No newline at end of file +var _0xd020=['ids','addLogo','sitepic','file','filename','addAvatar','agentAvatar','customerAvatar','addSystemAvatar','systemAvatar','join','root','server/files/images/logos/default_logo.svg','custom','isNil','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','existsSync','server/files/images/avatars/','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','server/files/images/avatars/system_avatar.png','user-agent-parser','setUA','headers','user-agent','getResult','chat','CmContact','no\x20available\x20attributes','updatedAt','difference','createdAt','CompanyId','ListId','from','Sequelize','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','ChatApplication','List','account','applications','Applications','orderBy','priority','asc','contact','customerIp','cf-connecting-ip','x-forwarded-for','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','stringify','threadId','externalUrl','ChatInteraction','ContactId','interaction','spread','messageId','created','autoclose','push','unmanaged','ChatMessage','UserId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','Start','startRouting','notify','offline','from\x20is\x20mandatory','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','toPairs','ChatOfflineMessage','originalname','server','files','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','forwardOffline','service','host','port','secure','authentication','auth','SendMail','sendMail','\x22%s\x22\x20<%s>','email','forwardOfflineAddress','offlineMessageSubject','MailAccountId','mimetype','subjectOffline','toPairsIn','mapValues','Chat','NotifyMailAccount','remove','addInteraction','getInteractions','Owner','fullname','internal','Tag','color','tag','Command','getSnippet','timezone','iftime\x20%s','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','interval','OFFLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','getLicense','virtual','chatLicenseExceeded','all','some','utf8','remote','connection','remoteAddress','render','alignment','verticalAlignment','textColor','backgroundColor','addApplications','findAndCountAll','getApplications','chatProactiveAction','addProactiveActions','omit','ChatProactiveAction','getFields','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Contact','addAgents','userChatWebsite:save','removeAgents','isArray','emit','userChatWebsite:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','jayson/promise','http','client','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','sendStatus','end','status','json','offset','limit','count','set','apply','reject','update','destroy','get','UserProfileResource','stack','name','send','index','Pause','map','ChatWebsite','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','show','params','mandatoryDispositionPause','rawAttributes','find','create','body','user','ChatWebsites','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','getDispositions','findOne','options','rows','removeDispositions','addAnswer','ChatWebsiteId','CannedAnswer','getAnswers','removeAnswers'];(function(_0xf442cb,_0x48c503){var _0x1d6c69=function(_0xeb6bd1){while(--_0xeb6bd1){_0xf442cb['push'](_0xf442cb['shift']());}};_0x1d6c69(++_0x48c503);}(_0xd020,0xc1));var _0x0d02=function(_0x3d8f92,_0x14017a){_0x3d8f92=_0x3d8f92-0x0;var _0x1e7b44=_0xd020[_0x3d8f92];return _0x1e7b44;};'use strict';var emlformat=require(_0x0d02('0x0'));var rimraf=require(_0x0d02('0x1'));var zipdir=require(_0x0d02('0x2'));var jsonpatch=require(_0x0d02('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0d02('0x4'));var Mustache=require(_0x0d02('0x5'));var util=require(_0x0d02('0x6'));var path=require(_0x0d02('0x7'));var sox=require(_0x0d02('0x8'));var csv=require(_0x0d02('0x9'));var ejs=require(_0x0d02('0xa'));var fs=require('fs');var fs_extra=require(_0x0d02('0xb'));var _=require('lodash');var squel=require(_0x0d02('0xc'));var crypto=require(_0x0d02('0xd'));var jsforce=require(_0x0d02('0xe'));var deskjs=require(_0x0d02('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0d02('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0d02('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x0d02('0x12'));var hardwareService=require(_0x0d02('0x13'));var logger=require(_0x0d02('0x14'))(_0x0d02('0x15'));var utils=require(_0x0d02('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x0d02('0x17'));var db=require('../../mysqldb')['db'];config[_0x0d02('0x18')]=_[_0x0d02('0x19')](config['redis'],{'host':_0x0d02('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0d02('0x18')]));require('./chatWebsite.socket')['register'](socket);var jayson=require(_0x0d02('0x1b'));var client=jayson['client'][_0x0d02('0x1c')]({'port':0x232c});var client9002=jayson[_0x0d02('0x1d')][_0x0d02('0x1c')]({'port':0x232a});var client9003=jayson[_0x0d02('0x1d')][_0x0d02('0x1c')]({'port':0x232b});var client9001=jayson[_0x0d02('0x1d')]['http']({'port':0x2329});function respondWithRpcPromise(_0x5a8151,_0x3dba0e,_0x1abef1,_0x30a106){return new BPromise(function(_0xac97a4,_0x27d49f){var _0x1067ad=_0x30a106||client;return _0x1067ad[_0x0d02('0x1e')](_0x5a8151,_0x1abef1)[_0x0d02('0x1f')](function(_0x56fbb9){logger[_0x0d02('0x20')](_0x0d02('0x21'),_0x3dba0e,_0x0d02('0x22'));logger[_0x0d02('0x23')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x3dba0e,_0x0d02('0x22'),JSON['stringify'](_0x56fbb9));if(_0x56fbb9[_0x0d02('0x24')]){if(_0x56fbb9[_0x0d02('0x24')][_0x0d02('0x25')]===0x1f4){logger['error'](_0x0d02('0x21'),_0x3dba0e,_0x56fbb9['error']['message']);return _0x27d49f(_0x56fbb9[_0x0d02('0x24')]['message']);}logger[_0x0d02('0x24')]('ChatWebsite,\x20%s,\x20%s',_0x3dba0e,_0x56fbb9[_0x0d02('0x24')][_0x0d02('0x26')]);return _0xac97a4(_0x56fbb9[_0x0d02('0x24')]['message']);}else{logger[_0x0d02('0x20')](_0x0d02('0x21'),_0x3dba0e,_0x0d02('0x22'));_0xac97a4(_0x56fbb9[_0x0d02('0x27')]['message']);}})[_0x0d02('0x28')](function(_0x4188bb){logger[_0x0d02('0x24')](_0x0d02('0x21'),_0x3dba0e,_0x4188bb);_0x27d49f(_0x4188bb);});});}function respondWithStatusCode(_0x5d1e86,_0x39e4aa){_0x39e4aa=_0x39e4aa||0xcc;return function(_0x16ee6a){if(_0x16ee6a){return _0x5d1e86[_0x0d02('0x29')](_0x39e4aa);}return _0x5d1e86['status'](_0x39e4aa)[_0x0d02('0x2a')]();};}function respondWithResult(_0x27d0aa,_0x49dc1){_0x49dc1=_0x49dc1||0xc8;return function(_0x314d6f){if(_0x314d6f){return _0x27d0aa[_0x0d02('0x2b')](_0x49dc1)[_0x0d02('0x2c')](_0x314d6f);}};}function respondWithFilteredResult(_0x50c068,_0xab0add){return function(_0x195dc4){if(_0x195dc4){var _0x835714=typeof _0xab0add[_0x0d02('0x2d')]==='undefined'&&typeof _0xab0add[_0x0d02('0x2e')]==='undefined';var _0x9121b4=_0x195dc4['count'];var _0x2fef79=_0x835714?0x0:_0xab0add['offset'];var _0x242220=_0x835714?_0x195dc4[_0x0d02('0x2f')]:_0xab0add[_0x0d02('0x2d')]+_0xab0add['limit'];var _0x3ee0a2;if(_0x242220>=_0x9121b4){_0x242220=_0x9121b4;_0x3ee0a2=0xc8;}else{_0x3ee0a2=0xce;}_0x50c068[_0x0d02('0x2b')](_0x3ee0a2);return _0x50c068[_0x0d02('0x30')]('Content-Range',_0x2fef79+'-'+_0x242220+'/'+_0x9121b4)[_0x0d02('0x2c')](_0x195dc4);}return null;};}function patchUpdates(_0x2b095f){return function(_0x57d6c3){try{jsonpatch[_0x0d02('0x31')](_0x57d6c3,_0x2b095f,!![]);}catch(_0x4b1ac1){return BPromise[_0x0d02('0x32')](_0x4b1ac1);}return _0x57d6c3['save']();};}function saveUpdates(_0x5cb65c,_0x35c9d0){return function(_0x4e4469){if(_0x4e4469){return _0x4e4469[_0x0d02('0x33')](_0x5cb65c)[_0x0d02('0x1f')](function(_0x9a0076){return _0x9a0076;});}return null;};}function removeEntity(_0x58c671,_0x2867ba){return function(_0x12ec02){if(_0x12ec02){return _0x12ec02[_0x0d02('0x34')]()[_0x0d02('0x1f')](function(){var _0x3acd7d=_0x12ec02[_0x0d02('0x35')]({'plain':!![]});var _0x5c2670='ChatWebsites';return db[_0x0d02('0x36')]['destroy']({'where':{'type':_0x5c2670,'resourceId':_0x3acd7d['id']}})[_0x0d02('0x1f')](function(){return _0x12ec02;});})[_0x0d02('0x1f')](function(){_0x58c671[_0x0d02('0x2b')](0xcc)[_0x0d02('0x2a')]();});}};}function handleEntityNotFound(_0x5895e3,_0x1f98e0){return function(_0x219282){if(!_0x219282){_0x5895e3['sendStatus'](0x194);}return _0x219282;};}function handleError(_0x257c64,_0x18593d){_0x18593d=_0x18593d||0x1f4;return function(_0x44bffb){logger['error'](_0x44bffb[_0x0d02('0x37')]);if(_0x44bffb[_0x0d02('0x38')]){delete _0x44bffb['name'];}_0x257c64[_0x0d02('0x2b')](_0x18593d)[_0x0d02('0x39')](_0x44bffb);};}exports[_0x0d02('0x3a')]=function(_0x36dba8,_0x9001bf){var _0x3a55c1={'include':[{'model':db[_0x0d02('0x3b')],'as':'mandatoryDispositionPause'}]},_0x3f21e8={},_0x229fa4={'count':0x0,'rows':[]};var _0x2adb31=_[_0x0d02('0x3c')](db[_0x0d02('0x3d')]['rawAttributes'],function(_0x16eff3){return{'name':_0x16eff3['fieldName'],'type':_0x16eff3[_0x0d02('0x3e')][_0x0d02('0x3f')]};});_0x3f21e8[_0x0d02('0x40')]=_[_0x0d02('0x3c')](_0x2adb31,_0x0d02('0x38'));_0x3f21e8[_0x0d02('0x41')]=_[_0x0d02('0x42')](_0x36dba8[_0x0d02('0x41')]);_0x3f21e8[_0x0d02('0x43')]=_[_0x0d02('0x44')](_0x3f21e8[_0x0d02('0x40')],_0x3f21e8['query']);_0x3a55c1[_0x0d02('0x45')]=_['intersection'](_0x3f21e8[_0x0d02('0x40')],qs[_0x0d02('0x46')](_0x36dba8[_0x0d02('0x41')][_0x0d02('0x46')]));_0x3a55c1[_0x0d02('0x45')]=_0x3a55c1[_0x0d02('0x45')][_0x0d02('0x47')]?_0x3a55c1[_0x0d02('0x45')]:_0x3f21e8['model'];if(!_0x36dba8[_0x0d02('0x41')][_0x0d02('0x48')](_0x0d02('0x49'))){_0x3a55c1[_0x0d02('0x2e')]=qs['limit'](_0x36dba8[_0x0d02('0x41')][_0x0d02('0x2e')]);_0x3a55c1[_0x0d02('0x2d')]=qs[_0x0d02('0x2d')](_0x36dba8['query'][_0x0d02('0x2d')]);}_0x3a55c1[_0x0d02('0x4a')]=qs[_0x0d02('0x4b')](_0x36dba8[_0x0d02('0x41')][_0x0d02('0x4b')]);_0x3a55c1[_0x0d02('0x4c')]=qs[_0x0d02('0x43')](_[_0x0d02('0x4d')](_0x36dba8[_0x0d02('0x41')],_0x3f21e8[_0x0d02('0x43')]),_0x2adb31);if(_0x36dba8[_0x0d02('0x41')][_0x0d02('0x4e')]){_0x3a55c1['where']=_['merge'](_0x3a55c1[_0x0d02('0x4c')],{'$or':_[_0x0d02('0x3c')](_0x2adb31,function(_0x460756){if(_0x460756[_0x0d02('0x3e')]!==_0x0d02('0x4f')){var _0x5ded71={};_0x5ded71[_0x460756[_0x0d02('0x38')]]={'$like':'%'+_0x36dba8['query'][_0x0d02('0x4e')]+'%'};return _0x5ded71;}})});}_0x3a55c1=_[_0x0d02('0x50')]({},_0x3a55c1,_0x36dba8['options']);var _0x4f14a3={'where':_0x3a55c1['where']};return db[_0x0d02('0x3d')]['count'](_0x4f14a3)['then'](function(_0x587237){_0x229fa4[_0x0d02('0x2f')]=_0x587237;if(_0x36dba8[_0x0d02('0x41')][_0x0d02('0x51')]){_0x3a55c1[_0x0d02('0x52')]=[{'all':!![]}];}return db['ChatWebsite'][_0x0d02('0x53')](_0x3a55c1);})[_0x0d02('0x1f')](function(_0x1a52da){_0x229fa4['rows']=_0x1a52da;return _0x229fa4;})[_0x0d02('0x1f')](respondWithFilteredResult(_0x9001bf,_0x3a55c1))[_0x0d02('0x28')](handleError(_0x9001bf,null));};exports[_0x0d02('0x54')]=function(_0x4ba734,_0x44c5bf){var _0xfc3caf={'raw':![],'where':{'id':_0x4ba734[_0x0d02('0x55')]['id']},'include':[{'model':db[_0x0d02('0x3b')],'as':_0x0d02('0x56')}]},_0x291c25={};_0x291c25[_0x0d02('0x40')]=_['keys'](db[_0x0d02('0x3d')][_0x0d02('0x57')]);_0x291c25['query']=_[_0x0d02('0x42')](_0x4ba734[_0x0d02('0x41')]);_0x291c25['filters']=_['intersection'](_0x291c25[_0x0d02('0x40')],_0x291c25[_0x0d02('0x41')]);_0xfc3caf['attributes']=_[_0x0d02('0x44')](_0x291c25[_0x0d02('0x40')],qs['fields'](_0x4ba734['query'][_0x0d02('0x46')]));_0xfc3caf[_0x0d02('0x45')]=_0xfc3caf[_0x0d02('0x45')][_0x0d02('0x47')]?_0xfc3caf[_0x0d02('0x45')]:_0x291c25[_0x0d02('0x40')];if(_0x4ba734[_0x0d02('0x41')][_0x0d02('0x51')]){_0xfc3caf[_0x0d02('0x52')]=[{'all':!![]}];}_0xfc3caf=_[_0x0d02('0x50')]({},_0xfc3caf,_0x4ba734['options']);return db['ChatWebsite'][_0x0d02('0x58')](_0xfc3caf)['then'](handleEntityNotFound(_0x44c5bf,null))[_0x0d02('0x1f')](respondWithResult(_0x44c5bf,null))['catch'](handleError(_0x44c5bf,null));};exports[_0x0d02('0x59')]=function(_0x431ff1,_0x2acd08){return db[_0x0d02('0x3d')][_0x0d02('0x59')](_0x431ff1[_0x0d02('0x5a')],{})['then'](function(_0x3ee9c6){var _0x2b82fc=_0x431ff1[_0x0d02('0x5b')][_0x0d02('0x35')]({'plain':!![]});if(!_0x2b82fc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2b82fc['role']===_0x0d02('0x5b')){var _0x6da06b=_0x3ee9c6[_0x0d02('0x35')]({'plain':!![]});var _0x408ccf=_0x0d02('0x5c');return db[_0x0d02('0x5d')][_0x0d02('0x58')]({'where':{'name':_0x408ccf,'userProfileId':_0x2b82fc[_0x0d02('0x5e')]},'raw':!![]})['then'](function(_0x5256ae){if(_0x5256ae&&_0x5256ae['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x6da06b[_0x0d02('0x38')],'resourceId':_0x6da06b['id'],'type':_0x5256ae['name'],'sectionId':_0x5256ae['id']},{})[_0x0d02('0x1f')](function(){return _0x3ee9c6;});}else{return _0x3ee9c6;}})[_0x0d02('0x28')](function(_0x23903d){logger[_0x0d02('0x24')](_0x0d02('0x5f'),_0x23903d);throw _0x23903d;});}return _0x3ee9c6;})[_0x0d02('0x1f')](respondWithResult(_0x2acd08,0xc9))[_0x0d02('0x28')](handleError(_0x2acd08,null));};exports['update']=function(_0x448fec,_0x126ab2){if(_0x448fec[_0x0d02('0x5a')]['id']){delete _0x448fec['body']['id'];}return db['ChatWebsite'][_0x0d02('0x58')]({'where':{'id':_0x448fec[_0x0d02('0x55')]['id']},'include':[{'model':db['Pause'],'as':_0x0d02('0x56')}]})[_0x0d02('0x1f')](handleEntityNotFound(_0x126ab2,null))[_0x0d02('0x1f')](saveUpdates(_0x448fec[_0x0d02('0x5a')],null))[_0x0d02('0x1f')](respondWithResult(_0x126ab2,null))[_0x0d02('0x28')](handleError(_0x126ab2,null));};exports[_0x0d02('0x34')]=function(_0x245c84,_0x598cf7){return db['ChatWebsite'][_0x0d02('0x58')]({'where':{'id':_0x245c84['params']['id']}})[_0x0d02('0x1f')](handleEntityNotFound(_0x598cf7,null))[_0x0d02('0x1f')](removeEntity(_0x598cf7,null))[_0x0d02('0x28')](handleError(_0x598cf7,null));};exports[_0x0d02('0x60')]=function(_0xb267c3,_0x460b79){return db['ChatWebsite']['describe']()[_0x0d02('0x1f')](respondWithResult(_0x460b79,null))[_0x0d02('0x28')](handleError(_0x460b79,null));};exports[_0x0d02('0x61')]=function(_0x5e14da,_0x446a97,_0xa79c6b){if(_0x5e14da[_0x0d02('0x5a')]['id']){delete _0x5e14da[_0x0d02('0x5a')]['id'];}return db[_0x0d02('0x3d')][_0x0d02('0x58')]({'where':{'id':_0x5e14da['params']['id']}})[_0x0d02('0x1f')](handleEntityNotFound(_0x446a97,null))[_0x0d02('0x1f')](function(_0x3e0450){if(_0x3e0450){_0x5e14da[_0x0d02('0x5a')]['ChatWebsiteId']=_0x3e0450['id'];return db[_0x0d02('0x62')]['create'](_0x5e14da[_0x0d02('0x5a')]);}})[_0x0d02('0x1f')](respondWithResult(_0x446a97,null))[_0x0d02('0x28')](handleError(_0x446a97,null));};exports[_0x0d02('0x63')]=function(_0x1d59b0,_0x510099,_0x11fb0e){var _0x177151={'raw':![],'where':{}};var _0x57a16a={};var _0x2a93e3={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x0d02('0x64')]({'where':{'id':_0x1d59b0[_0x0d02('0x55')]['id']}})[_0x0d02('0x1f')](handleEntityNotFound(_0x510099,null))[_0x0d02('0x1f')](function(_0x3dbe3e){if(_0x3dbe3e){_0x57a16a[_0x0d02('0x40')]=_[_0x0d02('0x42')](db[_0x0d02('0x62')]['rawAttributes']);_0x57a16a['query']=_[_0x0d02('0x42')](_0x1d59b0['query']);_0x57a16a[_0x0d02('0x43')]=_[_0x0d02('0x44')](_0x57a16a[_0x0d02('0x40')],_0x57a16a[_0x0d02('0x41')]);_0x177151[_0x0d02('0x45')]=_[_0x0d02('0x44')](_0x57a16a[_0x0d02('0x40')],qs['fields'](_0x1d59b0[_0x0d02('0x41')][_0x0d02('0x46')]));_0x177151['attributes']=_0x177151[_0x0d02('0x45')]['length']?_0x177151[_0x0d02('0x45')]:_0x57a16a[_0x0d02('0x40')];if(!_0x1d59b0['query'][_0x0d02('0x48')](_0x0d02('0x49'))){_0x177151[_0x0d02('0x2e')]=qs[_0x0d02('0x2e')](_0x1d59b0[_0x0d02('0x41')][_0x0d02('0x2e')]);_0x177151[_0x0d02('0x2d')]=qs[_0x0d02('0x2d')](_0x1d59b0[_0x0d02('0x41')][_0x0d02('0x2d')]);}_0x177151[_0x0d02('0x4a')]=qs[_0x0d02('0x4b')](_0x1d59b0['query'][_0x0d02('0x4b')]);_0x177151[_0x0d02('0x4c')]=qs[_0x0d02('0x43')](_[_0x0d02('0x4d')](_0x1d59b0[_0x0d02('0x41')],_0x57a16a[_0x0d02('0x43')]));_0x177151['where']['ChatWebsiteId']=_0x3dbe3e['id'];if(_0x1d59b0[_0x0d02('0x41')][_0x0d02('0x4e')]){_0x177151[_0x0d02('0x4c')]=_[_0x0d02('0x50')](_0x177151[_0x0d02('0x4c')],{'$or':_['map'](_0x177151[_0x0d02('0x45')],function(_0x5c0268){var _0xe1f4e8={};_0xe1f4e8[_0x5c0268]={'$like':'%'+_0x1d59b0[_0x0d02('0x41')][_0x0d02('0x4e')]+'%'};return _0xe1f4e8;})});}_0x177151=_[_0x0d02('0x50')]({},_0x177151,_0x1d59b0[_0x0d02('0x65')]);return db['Disposition']['count']({'where':_0x177151['where']})[_0x0d02('0x1f')](function(_0x1de735){_0x2a93e3[_0x0d02('0x2f')]=_0x1de735;if(_0x1d59b0[_0x0d02('0x41')]['includeAll']){_0x177151['include']=[{'all':!![]}];}return db[_0x0d02('0x62')][_0x0d02('0x53')](_0x177151);})[_0x0d02('0x1f')](function(_0x2d699a){_0x2a93e3[_0x0d02('0x66')]=_0x2d699a;return _0x2a93e3;});}})[_0x0d02('0x1f')](respondWithFilteredResult(_0x510099,_0x177151))['catch'](handleError(_0x510099,null));};exports[_0x0d02('0x67')]=function(_0x1736be,_0x49e068,_0x30b046){return db[_0x0d02('0x3d')][_0x0d02('0x58')]({'where':{'id':_0x1736be['params']['id']}})[_0x0d02('0x1f')](handleEntityNotFound(_0x49e068,null))[_0x0d02('0x1f')](function(_0x19a47e){if(_0x19a47e){return _0x19a47e[_0x0d02('0x67')](_0x1736be['query']['ids']);}})[_0x0d02('0x1f')](respondWithStatusCode(_0x49e068,null))[_0x0d02('0x28')](handleError(_0x49e068,null));};exports[_0x0d02('0x68')]=function(_0xe4644,_0x161b21,_0x381868){if(_0xe4644['body']['id']){delete _0xe4644[_0x0d02('0x5a')]['id'];}return db[_0x0d02('0x3d')]['find']({'where':{'id':_0xe4644['params']['id']}})[_0x0d02('0x1f')](handleEntityNotFound(_0x161b21,null))[_0x0d02('0x1f')](function(_0x34a89e){if(_0x34a89e){_0xe4644[_0x0d02('0x5a')][_0x0d02('0x69')]=_0x34a89e['id'];return db[_0x0d02('0x6a')][_0x0d02('0x59')](_0xe4644['body']);}})[_0x0d02('0x1f')](respondWithResult(_0x161b21,null))[_0x0d02('0x28')](handleError(_0x161b21,null));};exports[_0x0d02('0x6b')]=function(_0x3bd06e,_0x49a8f1,_0x15773a){var _0x92182b={'raw':![],'where':{}};var _0x3297f6={};var _0x3e288a={'count':0x0,'rows':[]};return db[_0x0d02('0x3d')][_0x0d02('0x64')]({'where':{'id':_0x3bd06e['params']['id']}})[_0x0d02('0x1f')](handleEntityNotFound(_0x49a8f1,null))[_0x0d02('0x1f')](function(_0x47600a){if(_0x47600a){_0x3297f6[_0x0d02('0x40')]=_[_0x0d02('0x42')](db['CannedAnswer'][_0x0d02('0x57')]);_0x3297f6['query']=_[_0x0d02('0x42')](_0x3bd06e['query']);_0x3297f6[_0x0d02('0x43')]=_[_0x0d02('0x44')](_0x3297f6[_0x0d02('0x40')],_0x3297f6[_0x0d02('0x41')]);_0x92182b[_0x0d02('0x45')]=_[_0x0d02('0x44')](_0x3297f6[_0x0d02('0x40')],qs[_0x0d02('0x46')](_0x3bd06e['query']['fields']));_0x92182b[_0x0d02('0x45')]=_0x92182b[_0x0d02('0x45')][_0x0d02('0x47')]?_0x92182b[_0x0d02('0x45')]:_0x3297f6['model'];if(!_0x3bd06e[_0x0d02('0x41')][_0x0d02('0x48')](_0x0d02('0x49'))){_0x92182b[_0x0d02('0x2e')]=qs[_0x0d02('0x2e')](_0x3bd06e[_0x0d02('0x41')]['limit']);_0x92182b[_0x0d02('0x2d')]=qs['offset'](_0x3bd06e[_0x0d02('0x41')]['offset']);}_0x92182b[_0x0d02('0x4a')]=qs[_0x0d02('0x4b')](_0x3bd06e[_0x0d02('0x41')][_0x0d02('0x4b')]);_0x92182b[_0x0d02('0x4c')]=qs[_0x0d02('0x43')](_[_0x0d02('0x4d')](_0x3bd06e['query'],_0x3297f6[_0x0d02('0x43')]));_0x92182b[_0x0d02('0x4c')][_0x0d02('0x69')]=_0x47600a['id'];if(_0x3bd06e['query']['filter']){_0x92182b[_0x0d02('0x4c')]=_[_0x0d02('0x50')](_0x92182b[_0x0d02('0x4c')],{'$or':_[_0x0d02('0x3c')](_0x92182b['attributes'],function(_0x2e188a){var _0x43c2f8={};_0x43c2f8[_0x2e188a]={'$like':'%'+_0x3bd06e[_0x0d02('0x41')][_0x0d02('0x4e')]+'%'};return _0x43c2f8;})});}_0x92182b=_[_0x0d02('0x50')]({},_0x92182b,_0x3bd06e['options']);return db[_0x0d02('0x6a')][_0x0d02('0x2f')]({'where':_0x92182b[_0x0d02('0x4c')]})[_0x0d02('0x1f')](function(_0x47b716){_0x3e288a['count']=_0x47b716;if(_0x3bd06e[_0x0d02('0x41')][_0x0d02('0x51')]){_0x92182b[_0x0d02('0x52')]=[{'all':!![]}];}return db[_0x0d02('0x6a')][_0x0d02('0x53')](_0x92182b);})[_0x0d02('0x1f')](function(_0x12c85e){_0x3e288a[_0x0d02('0x66')]=_0x12c85e;return _0x3e288a;});}})[_0x0d02('0x1f')](respondWithFilteredResult(_0x49a8f1,_0x92182b))[_0x0d02('0x28')](handleError(_0x49a8f1,null));};exports['removeAnswers']=function(_0x2fa6c4,_0x1201e3,_0x33db06){return db['ChatWebsite']['find']({'where':{'id':_0x2fa6c4[_0x0d02('0x55')]['id']}})[_0x0d02('0x1f')](handleEntityNotFound(_0x1201e3,null))[_0x0d02('0x1f')](function(_0x157de7){if(_0x157de7){return _0x157de7[_0x0d02('0x6c')](_0x2fa6c4[_0x0d02('0x41')][_0x0d02('0x6d')]);}})['then'](respondWithStatusCode(_0x1201e3,null))['catch'](handleError(_0x1201e3,null));};exports[_0x0d02('0x6e')]=function(_0x2b3e9d,_0x1cd490,_0x4d7055){_0x2b3e9d[_0x0d02('0x5a')][_0x0d02('0x6f')]=_0x2b3e9d[_0x0d02('0x70')][_0x0d02('0x71')];return db[_0x0d02('0x3d')][_0x0d02('0x58')]({'where':{'id':_0x2b3e9d[_0x0d02('0x55')]['id']}})[_0x0d02('0x1f')](handleEntityNotFound(_0x1cd490,null))[_0x0d02('0x1f')](saveUpdates(_0x2b3e9d[_0x0d02('0x5a')],null))[_0x0d02('0x1f')](respondWithResult(_0x1cd490,null))[_0x0d02('0x28')](handleError(_0x1cd490,null));};exports[_0x0d02('0x72')]=function(_0x35abc1,_0x5bd245,_0x27cc0a){_0x35abc1[_0x0d02('0x5a')][_0x0d02('0x73')]=_0x35abc1[_0x0d02('0x70')][_0x0d02('0x71')];return db[_0x0d02('0x3d')]['find']({'where':{'id':_0x35abc1[_0x0d02('0x55')]['id']}})[_0x0d02('0x1f')](handleEntityNotFound(_0x5bd245,null))['then'](saveUpdates(_0x35abc1[_0x0d02('0x5a')],null))['then'](respondWithResult(_0x5bd245,null))[_0x0d02('0x28')](handleError(_0x5bd245,null));};exports['addCustomerAvatar']=function(_0x5c352d,_0x476362,_0x4fe81e){_0x5c352d['body'][_0x0d02('0x74')]=_0x5c352d[_0x0d02('0x70')][_0x0d02('0x71')];return db[_0x0d02('0x3d')][_0x0d02('0x58')]({'where':{'id':_0x5c352d[_0x0d02('0x55')]['id']}})[_0x0d02('0x1f')](handleEntityNotFound(_0x476362,null))['then'](saveUpdates(_0x5c352d[_0x0d02('0x5a')],null))[_0x0d02('0x1f')](respondWithResult(_0x476362,null))[_0x0d02('0x28')](handleError(_0x476362,null));};exports[_0x0d02('0x75')]=function(_0x5de6d6,_0x12970e,_0x197382){_0x5de6d6[_0x0d02('0x5a')][_0x0d02('0x76')]=_0x5de6d6[_0x0d02('0x70')][_0x0d02('0x71')];return db['ChatWebsite'][_0x0d02('0x58')]({'where':{'id':_0x5de6d6[_0x0d02('0x55')]['id']}})[_0x0d02('0x1f')](handleEntityNotFound(_0x12970e,null))[_0x0d02('0x1f')](saveUpdates(_0x5de6d6[_0x0d02('0x5a')],null))[_0x0d02('0x1f')](respondWithResult(_0x12970e,null))[_0x0d02('0x28')](handleError(_0x12970e,null));};exports['getLogo']=function(_0x1b9678,_0x5c2f17,_0xbd3f1){var _0x42fbb6=path[_0x0d02('0x77')](config[_0x0d02('0x78')],_0x0d02('0x79'));var _0x3273dd={'where':{'id':_0x1b9678['params']['id']},'attributes':['id',_0x0d02('0x6f')],'raw':!![]};var _0x2fc6a0=![];return require(_0x0d02('0x17'))['getLicense']()[_0x0d02('0x1f')](function(_0x50a2cf){if(_0x50a2cf){_0x2fc6a0=_0x50a2cf[_0x0d02('0x7a')];}})[_0x0d02('0x1f')](function(){return db[_0x0d02('0x3d')][_0x0d02('0x58')](_0x3273dd);})['then'](handleEntityNotFound(_0x5c2f17,null))[_0x0d02('0x1f')](function(_0x29c9cd){if(_0x29c9cd){if(!_[_0x0d02('0x7b')](_0x29c9cd[_0x0d02('0x6f')])){if(fs['existsSync'](path['join'](config['root'],_0x0d02('0x7c'),_0x29c9cd[_0x0d02('0x6f')]))&&_0x2fc6a0){_0x42fbb6=path[_0x0d02('0x77')](config[_0x0d02('0x78')],'server/files/images/logos/',_0x29c9cd[_0x0d02('0x6f')]);}}return _0x5c2f17[_0x0d02('0x7d')](_0x42fbb6);}})[_0x0d02('0x28')](handleError(_0x5c2f17,null));};exports[_0x0d02('0x7e')]=function(_0x2e649f,_0x2fdb7c,_0x2c52e8){var _0x34b614=path[_0x0d02('0x77')](config[_0x0d02('0x78')],_0x0d02('0x7f'));var _0x59dc6b={'where':{'id':_0x2e649f[_0x0d02('0x55')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x0d02('0x3d')][_0x0d02('0x58')](_0x59dc6b)['then'](handleEntityNotFound(_0x2fdb7c,null))[_0x0d02('0x1f')](function(_0x4c183e){if(_0x4c183e){if(!_[_0x0d02('0x7b')](_0x4c183e[_0x0d02('0x73')])){if(fs[_0x0d02('0x80')](path[_0x0d02('0x77')](config[_0x0d02('0x78')],'server/files/images/avatars/',_0x4c183e[_0x0d02('0x73')]))){_0x34b614=path[_0x0d02('0x77')](config['root'],_0x0d02('0x81'),_0x4c183e[_0x0d02('0x73')]);}}return _0x2fdb7c[_0x0d02('0x7d')](_0x34b614);}})['catch'](handleError(_0x2fdb7c,null));};exports['getCustomerAvatar']=function(_0x16ba30,_0x489bc0,_0x7f88d1){var _0x2f38c1=path[_0x0d02('0x77')](config[_0x0d02('0x78')],_0x0d02('0x82'));var _0x97e73c={'where':{'id':_0x16ba30[_0x0d02('0x55')]['id']},'attributes':['id',_0x0d02('0x74'),_0x0d02('0x83')],'raw':!![]};return db[_0x0d02('0x3d')][_0x0d02('0x58')](_0x97e73c)[_0x0d02('0x1f')](handleEntityNotFound(_0x489bc0,null))[_0x0d02('0x1f')](function(_0x3087e4){if(_0x3087e4){if(!_[_0x0d02('0x7b')](_0x3087e4[_0x0d02('0x74')])){if(fs['existsSync'](path['join'](config[_0x0d02('0x78')],_0x0d02('0x81'),_0x3087e4['customerAvatar']))&&_0x3087e4[_0x0d02('0x83')]){_0x2f38c1=path[_0x0d02('0x77')](config['root'],_0x0d02('0x81'),_0x3087e4[_0x0d02('0x74')]);}}return _0x489bc0[_0x0d02('0x7d')](_0x2f38c1);}})[_0x0d02('0x28')](handleError(_0x489bc0,null));};exports['getSystemAvatar']=function(_0x1895a6,_0x1d16ce,_0x341c79){var _0x517d83=path[_0x0d02('0x77')](config['root'],_0x0d02('0x84'));var _0x1e6722={'where':{'id':_0x1895a6['params']['id']},'attributes':['id',_0x0d02('0x76')],'raw':!![]};return db[_0x0d02('0x3d')][_0x0d02('0x58')](_0x1e6722)[_0x0d02('0x1f')](handleEntityNotFound(_0x1d16ce,null))[_0x0d02('0x1f')](function(_0x48f2fd){if(_0x48f2fd){if(!_[_0x0d02('0x7b')](_0x48f2fd[_0x0d02('0x76')])){if(fs['existsSync'](path[_0x0d02('0x77')](config[_0x0d02('0x78')],_0x0d02('0x81'),_0x48f2fd[_0x0d02('0x76')]))){_0x517d83=path[_0x0d02('0x77')](config[_0x0d02('0x78')],_0x0d02('0x81'),_0x48f2fd[_0x0d02('0x76')]);}}return _0x1d16ce['download'](_0x517d83);}})[_0x0d02('0x28')](handleError(_0x1d16ce,null));};exports['notify']=function(_0x32a6a6,_0x550442,_0x324f70){var _0x5870c2=require(_0x0d02('0x85'));var _0xbf3318=new _0x5870c2();var _0x24ee28=_0xbf3318[_0x0d02('0x86')](_0x32a6a6[_0x0d02('0x87')][_0x0d02('0x88')])[_0x0d02('0x89')]();var _0x58d0a5={'body':_0x32a6a6['body'],'channel':_0x0d02('0x8a')};var _0x354127=[];var _0xdcbe12=[];var _0x4fe7d6={};var _0x522a51=![];return db[_0x0d02('0x8b')][_0x0d02('0x60')]()[_0x0d02('0x1f')](function(_0x4c4c64){if(!_0x4c4c64){throw new db['Sequelize']['ValidationError'](_0x0d02('0x8c'));}_0x354127=_['difference'](_[_0x0d02('0x42')](_0x4c4c64),['createdAt',_0x0d02('0x8d')]);_0xdcbe12=_[_0x0d02('0x8e')](_[_0x0d02('0x42')](_0x4c4c64),[_0x0d02('0x8f'),'updatedAt',_0x0d02('0x90'),_0x0d02('0x91')]);if(_0x32a6a6[_0x0d02('0x5a')]['id']){delete _0x32a6a6['body']['id'];}if(_['isNil'](_0x32a6a6['body'][_0x0d02('0x92')])){throw new db[(_0x0d02('0x93'))][(_0x0d02('0x94'))]('from\x20is\x20mandatory');}if(_[_0x0d02('0x7b')](_0x32a6a6[_0x0d02('0x5a')]['body'])||_0x32a6a6[_0x0d02('0x5a')][_0x0d02('0x5a')]===''){throw new db[(_0x0d02('0x93'))]['ValidationError'](_0x0d02('0x95'));}if(_[_0x0d02('0x7b')](_0x32a6a6[_0x0d02('0x5a')][_0x0d02('0x96')])){throw new db[(_0x0d02('0x93'))][(_0x0d02('0x94'))](_0x0d02('0x97')+_0xdcbe12);}if(!_[_0x0d02('0x98')](_0xdcbe12,_0x32a6a6[_0x0d02('0x5a')][_0x0d02('0x96')])){throw new db[(_0x0d02('0x93'))][(_0x0d02('0x94'))](_0x0d02('0x99')+_0xdcbe12);}_0x4fe7d6[_0x32a6a6['body'][_0x0d02('0x96')]]=_0x32a6a6[_0x0d02('0x5a')][_0x0d02('0x92')];})[_0x0d02('0x1f')](function(){return db[_0x0d02('0x3d')][_0x0d02('0x58')]({'where':{'id':_0x32a6a6[_0x0d02('0x55')]['id']},'include':[{'model':db[_0x0d02('0x9a')],'as':'List','include':[{'model':db['CmContact'],'as':_0x0d02('0x9b'),'where':_0x4fe7d6,'limit':0x1,'order':[[_0x0d02('0x8d'),_0x0d02('0x9c')]]}]},{'model':db[_0x0d02('0x9d')],'as':'Applications'}]});})[_0x0d02('0x1f')](handleEntityNotFound(_0x550442,null))[_0x0d02('0x1f')](function(_0x262030){if(_0x262030&&_0x262030[_0x0d02('0x9e')]){_0x58d0a5[_0x0d02('0x9f')]=_0x262030;_0x58d0a5[_0x0d02('0xa0')]=_0x262030[_0x0d02('0xa1')];_0x58d0a5['list']=_0x262030[_0x0d02('0x9e')];_0x58d0a5['applications']=_[_0x0d02('0xa2')](_0x58d0a5['applications'],[_0x0d02('0xa3')],[_0x0d02('0xa4')]);if(_0x58d0a5[_0x0d02('0x9f')]['Applications']){delete _0x58d0a5['account'][_0x0d02('0xa1')];}if(_0x58d0a5[_0x0d02('0x9f')]['List']&&_0x58d0a5[_0x0d02('0x9f')][_0x0d02('0x9e')][_0x0d02('0x9b')][_0x0d02('0x47')]){return _0x58d0a5[_0x0d02('0x9f')][_0x0d02('0x9e')][_0x0d02('0x9b')][0x0];}var _0x34cad7=_['defaults'](_0x32a6a6['body'],{'firstName':_0x32a6a6[_0x0d02('0x5a')][_0x0d02('0x92')],'ListId':_0x262030[_0x0d02('0x91')]});_0x34cad7[_0x32a6a6['body']['mapKey']]=_0x32a6a6[_0x0d02('0x5a')]['from'];return db[_0x0d02('0x8b')][_0x0d02('0x59')](_0x34cad7,{'fields':_0x354127,'raw':!![]});}})[_0x0d02('0x1f')](handleEntityNotFound(_0x550442,null))[_0x0d02('0x1f')](function(_0x1e3675){_0x58d0a5[_0x0d02('0xa5')]=_0x1e3675;var _0x5b9bfb=_0x32a6a6[_0x0d02('0x5a')][_0x0d02('0xa6')];if(_0x32a6a6['headers'][_0x0d02('0xa7')]){_0x5b9bfb=_0x32a6a6[_0x0d02('0x87')][_0x0d02('0xa7')];}else if(_0x32a6a6[_0x0d02('0x87')][_0x0d02('0xa8')]){_0x5b9bfb=_['first'](_0x32a6a6['headers'][_0x0d02('0xa8')]['split'](','));}if(_0x1e3675){var _0x22ee8e={'ContactId':_0x1e3675['id'],'ChatWebsiteId':_0x32a6a6['params']['id'],'from':(_0x1e3675[_0x0d02('0xa9')]||'')+'\x20'+(_0x1e3675[_0x0d02('0xaa')]||''),'customerIp':_0x5b9bfb,'customerPort':_0x32a6a6[_0x0d02('0x87')][_0x0d02('0xab')]?_0x32a6a6[_0x0d02('0x87')]['x-real-port']:null,'referer':_0x32a6a6[_0x0d02('0x5a')][_0x0d02('0xac')],'browserName':_0x24ee28[_0x0d02('0xad')][_0x0d02('0x38')]&&_0x24ee28[_0x0d02('0xad')][_0x0d02('0xae')]?util[_0x0d02('0xaf')](_0x0d02('0xb0'),_0x24ee28['browser'][_0x0d02('0x38')],_0x24ee28['browser']['version']):_0x0d02('0xb1'),'browserVersion':_0x24ee28['browser'][_0x0d02('0xae')]||_0x0d02('0xb1'),'osName':util['format'](_0x0d02('0xb0'),_0x24ee28['os'][_0x0d02('0x38')],_0x24ee28['os'][_0x0d02('0xae')]),'osVersion':_0x24ee28['os']['version'],'deviceModel':_0x24ee28[_0x0d02('0xb2')][_0x0d02('0x40')]&&_0x24ee28[_0x0d02('0xb2')][_0x0d02('0xb3')]?util[_0x0d02('0xaf')](_0x0d02('0xb4'),_0x24ee28[_0x0d02('0xb2')][_0x0d02('0x40')],_0x24ee28['device']['vendor'],_0x24ee28[_0x0d02('0xb2')][_0x0d02('0x3e')]):null,'deviceVendor':_0x24ee28['device'][_0x0d02('0xb3')],'deviceType':_0x24ee28[_0x0d02('0xb2')][_0x0d02('0x3e')],'formData':JSON[_0x0d02('0xb5')](_0x32a6a6[_0x0d02('0x5a')])};var _0x44f004={'ChatWebsiteId':_0x32a6a6['params']['id'],'closed':![]};if(_0x32a6a6[_0x0d02('0x5a')][_0x0d02('0xb6')]){_0x44f004['threadId']=_0x32a6a6[_0x0d02('0x5a')][_0x0d02('0xb6')];return db['ChatInteraction']['find']({'where':_0x44f004})['then'](function(_0x350454){if(_0x350454){return[_0x350454,![]];}_0x22ee8e[_0x0d02('0xb6')]=_0x32a6a6['body'][_0x0d02('0xb6')];_0x22ee8e[_0x0d02('0xb7')]=_0x32a6a6['body'][_0x0d02('0xb7')];return db[_0x0d02('0xb8')][_0x0d02('0x59')](_0x22ee8e)[_0x0d02('0x1f')](function(_0x46fc69){return[_0x46fc69,!![]];});});}_0x44f004[_0x0d02('0xb9')]=_0x1e3675['id'];if(_0x32a6a6[_0x0d02('0x5a')][_0x0d02('0xba')]&&_0x32a6a6[_0x0d02('0x5a')][_0x0d02('0xba')]['id']){_0x44f004['id']=_0x32a6a6['body'][_0x0d02('0xba')]['id'];return db[_0x0d02('0xb8')][_0x0d02('0x58')]({'where':_0x44f004})['then'](function(_0x54d701){if(_0x54d701){return[_0x54d701,![]];}return db['ChatInteraction'][_0x0d02('0x59')](_0x22ee8e)[_0x0d02('0x1f')](function(_0x273966){return[_0x273966,!![]];});});}return db['ChatInteraction'][_0x0d02('0x59')](_0x22ee8e)[_0x0d02('0x1f')](function(_0x34f9e4){return[_0x34f9e4,!![]];});}})[_0x0d02('0xbb')](function(_0x3cb0b8,_0x7041c1){if(_0x3cb0b8){_0x522a51=_0x7041c1;if(!_0x7041c1){var _0x3003b1={'from':(_0x58d0a5[_0x0d02('0xa5')]['firstName']||'')+'\x20'+(_0x58d0a5[_0x0d02('0xa5')][_0x0d02('0xaa')]||'')};if(_0x32a6a6[_0x0d02('0x5a')]['threadId']&&_0x32a6a6['body'][_0x0d02('0xbc')]&&_0x32a6a6[_0x0d02('0x5a')][_0x0d02('0xb6')]!=_0x32a6a6[_0x0d02('0x5a')]['messageId']){_0x3003b1[_0x0d02('0xb6')]=_0x32a6a6['body']['messageId'];}return _0x3cb0b8[_0x0d02('0x33')](_0x3003b1);}else{return _0x3cb0b8;}}})[_0x0d02('0x1f')](function(_0x10bd7e){_0x58d0a5[_0x0d02('0xba')]=_0x10bd7e[_0x0d02('0x35')]({'plain':!![]});_0x58d0a5['interaction'][_0x0d02('0xbd')]=_0x522a51;if(_0x58d0a5[_0x0d02('0xba')][_0x0d02('0xbd')]){if(_0x58d0a5[_0x0d02('0x9f')][_0x0d02('0xbe')]){_0x58d0a5['applications'][_0x0d02('0xbf')]({'id':0x0,'priority':_0x58d0a5[_0x0d02('0xa0')]['length']+0x1,'app':'close','appdata':_0x0d02('0xc0'),'interval':'*,*,*,*'});}}return db[_0x0d02('0xc1')][_0x0d02('0x59')]({'body':_0x32a6a6[_0x0d02('0x5a')]['body'],'ChatWebsiteId':_0x32a6a6['params']['id'],'ChatInteractionId':_0x10bd7e['id'],'direction':'in','ContactId':_0x58d0a5['contact']['id'],'AttachmentId':_0x32a6a6['body']['AttachmentId']});})[_0x0d02('0x1f')](function(_0x33a8f7){_0x58d0a5[_0x0d02('0x26')]=_0x33a8f7;if(_0x58d0a5['interaction'][_0x0d02('0xc2')]){return db[_0x0d02('0xc3')]['find']({'attributes':['id',_0x0d02('0x38')],'where':{'id':_0x58d0a5[_0x0d02('0xba')]['UserId']}})[_0x0d02('0x1f')](function(_0x312b41){if(_0x312b41){_0x58d0a5[_0x0d02('0xa0')][_0x0d02('0xc4')]({'id':0x0,'priority':0x0,'app':_0x0d02('0xc5'),'appdata':_0x312b41[_0x0d02('0x38')]+','+(_0x58d0a5['account'][_0x0d02('0xc6')]||0xa),'interval':_0x0d02('0xc7')});_0x58d0a5[_0x0d02('0xc8')]=!![];}return respondWithRpcPromise(_0x0d02('0xc9'),_0x0d02('0xca'),_0x58d0a5);});}return respondWithRpcPromise(_0x0d02('0xc9'),_0x0d02('0xca'),_0x58d0a5);})[_0x0d02('0x1f')](function(_0x23b96c){respondWithRpcPromise('EventManager','EventManager',{'event':_0x0d02('0xcb'),'message':_0x23b96c},client9002);return _0x23b96c;})['then'](respondWithResult(_0x550442,null))[_0x0d02('0x28')](handleError(_0x550442,null));};exports[_0x0d02('0xcc')]=function(_0x5d00b9,_0x385c75,_0x51310c){var _0x5cd080,_0x294474,_0x10f3e2;var _0x6385a9=[];var _0xb7e130=[];var _0x351c36={};var _0x1b58f0=_0x5d00b9['files']||[];var _0x356bb4=[];var _0x2dc9aa;return db['CmContact'][_0x0d02('0x60')]()[_0x0d02('0x1f')](function(_0x2a3616){if(!_0x2a3616){throw new db[(_0x0d02('0x93'))][(_0x0d02('0x94'))](_0x0d02('0x8c'));}_0xb7e130=_['difference'](_[_0x0d02('0x42')](_0x2a3616),['createdAt',_0x0d02('0x8d')]);_0x6385a9=_[_0x0d02('0x8e')](_[_0x0d02('0x42')](_0x2a3616),[_0x0d02('0x8f'),_0x0d02('0x8d'),_0x0d02('0x90'),_0x0d02('0x91')]);if(_0x5d00b9['body']['id']){delete _0x5d00b9['body']['id'];}if(_[_0x0d02('0x7b')](_0x5d00b9[_0x0d02('0x5a')]['from'])){throw _0x385c75[_0x0d02('0x2b')](0x1f4)[_0x0d02('0x39')](new db[(_0x0d02('0x93'))][(_0x0d02('0x94'))](_0x0d02('0xcd')));}if(_[_0x0d02('0x7b')](_0x5d00b9['body'][_0x0d02('0x5a')])||_0x5d00b9[_0x0d02('0x5a')][_0x0d02('0x5a')]===''){throw _0x385c75[_0x0d02('0x2b')](0x1f4)[_0x0d02('0x39')](new db[(_0x0d02('0x93'))][(_0x0d02('0x94'))](_0x0d02('0x95')));}if(_[_0x0d02('0x7b')](_0x5d00b9['body'][_0x0d02('0xce')])){throw _0x385c75[_0x0d02('0x2b')](0x1f4)[_0x0d02('0x39')](new db[(_0x0d02('0x93'))][(_0x0d02('0x94'))](_0x0d02('0xcf')+_0x6385a9));}if(!_[_0x0d02('0x98')](_0x6385a9,_0x5d00b9[_0x0d02('0x5a')][_0x0d02('0xce')])){throw _0x385c75[_0x0d02('0x2b')](0x1f4)[_0x0d02('0x39')](new db[(_0x0d02('0x93'))]['ValidationError'](_0x0d02('0xd0')+_0x6385a9));}_0x351c36[_0x5d00b9['body'][_0x0d02('0xce')]]=_0x5d00b9['body'][_0x0d02('0x92')];})[_0x0d02('0x1f')](function(){return db[_0x0d02('0x3d')][_0x0d02('0x58')]({'where':{'id':_0x5d00b9[_0x0d02('0x55')]['id']},'include':[{'model':db['CmList'],'as':_0x0d02('0x9e')},{'model':db[_0x0d02('0xd1')],'as':_0x0d02('0xd1')}]});})[_0x0d02('0x1f')](handleEntityNotFound(_0x385c75,null))['then'](function(_0x5327dd){if(_0x5327dd&&_0x5327dd[_0x0d02('0x9e')]){_0x294474=_0x5327dd;var _0x1d9b71=_['defaults'](_0x5d00b9[_0x0d02('0x5a')],{'firstName':_0x5d00b9['body'][_0x0d02('0x92')],'phone':_0x5d00b9[_0x0d02('0x5a')][_0x0d02('0x92')],'ListId':_0x5327dd['ListId']});_0x1d9b71[_0x5d00b9['body'][_0x0d02('0xce')]]=_0x5d00b9[_0x0d02('0x5a')]['from'];return db[_0x0d02('0x8b')][_0x0d02('0xd2')]({'where':_0x351c36,'defaults':_0x1d9b71});}})[_0x0d02('0xbb')](function(_0x269389){if(_0x269389){_0x10f3e2=_0x269389;var _0x48055d=fs[_0x0d02('0xd3')](path[_0x0d02('0x77')](config['root'],'server/files/templates/chatOfflineMessage.ejs'),'utf8');var _0x49c4d6=ejs['render'](_0x48055d,{'body':_[_0x0d02('0xd4')](_0x5d00b9[_0x0d02('0x5a')][_0x0d02('0x5a')]),'bodyTitle':_0x294474['offlineMessageBody']});return db[_0x0d02('0xd5')][_0x0d02('0x59')]({'body':_0x49c4d6,'ContactId':_0x269389['id'],'ChatWebsiteId':_0x294474['id']});}})[_0x0d02('0x1f')](function(_0x253437){_0x2dc9aa=_0x253437;if(_0x1b58f0[_0x0d02('0x47')]){var _0x57b039=_0x1b58f0[_0x0d02('0x3c')](function(_0x59cb39){return{'name':_0x59cb39[_0x0d02('0xd6')],'basename':_0x59cb39['filename'],'type':_0x59cb39['mimetype'],'ChatOfflineMessageId':_0x253437['id']};});_0x356bb4=_0x57b039[_0x0d02('0x3c')](_0x451830=>{var _0x149d4e={'filename':_0x451830[_0x0d02('0x38')],'path':path['join'](config[_0x0d02('0x78')],_0x0d02('0xd7'),_0x0d02('0xd8'),'attachments',_0x0d02('0xd9'),_0x451830[_0x0d02('0xda')])};return _0x149d4e;});if(!_0x294474[_0x0d02('0xdb')]){return db[_0x0d02('0xdc')][_0x0d02('0xdd')](function(_0xe17b4a){return db[_0x0d02('0xde')][_0x0d02('0xdf')](_0x57b039,{'transaction':_0xe17b4a});});}}})['then'](function(){if(_0x2dc9aa){_0x5cd080=_0x2dc9aa;return db['MailAccount'][_0x0d02('0x64')]({'where':{'active':!![]},'include':[{'model':db[_0x0d02('0xe0')],'as':_0x0d02('0xe1'),'raw':!![]}]});}})[_0x0d02('0x1f')](function(_0x512cfd){if(_0x512cfd&&_0x512cfd['Smtp']&&_0x294474[_0x0d02('0xe2')]&&_0x294474['forwardOfflineAddress']){var _0x44ed90={'tls':{'rejectUnauthorized':![]}};if(_0x512cfd[_0x0d02('0xe1')][_0x0d02('0xe3')]){_0x44ed90[_0x0d02('0xe3')]=_0x512cfd[_0x0d02('0xe1')][_0x0d02('0xe3')];}else{_0x44ed90[_0x0d02('0xe4')]=_0x512cfd[_0x0d02('0xe1')][_0x0d02('0xe4')];_0x44ed90[_0x0d02('0xe5')]=_0x512cfd['Smtp'][_0x0d02('0xe5')];_0x44ed90[_0x0d02('0xe6')]=_0x512cfd[_0x0d02('0xe1')][_0x0d02('0xe6')];}if(_0x512cfd[_0x0d02('0xe1')][_0x0d02('0xe7')]){_0x44ed90[_0x0d02('0xe8')]={'user':_0x512cfd[_0x0d02('0xe1')][_0x0d02('0x5b')],'pass':_0x512cfd[_0x0d02('0xe1')]['pass']};}return respondWithRpcPromise(_0x0d02('0xe9'),_0x0d02('0xea'),{'account':_0x44ed90,'message':{'from':util[_0x0d02('0xaf')](_0x0d02('0xeb'),_0x512cfd[_0x0d02('0x38')],_0x512cfd[_0x0d02('0xec')]||_0x512cfd[_0x0d02('0xe1')][_0x0d02('0x5b')]),'to':_0x294474[_0x0d02('0xed')],'subject':_0x294474[_0x0d02('0xee')],'html':_0x5cd080[_0x0d02('0x5a')],'attachments':_0x356bb4}},client9003)[_0x0d02('0x1f')](function(){return _0x5cd080;})['catch'](function(_0x5dec39){console['error'](_0x5dec39);});}})[_0x0d02('0x1f')](function(){if(_0x294474&&_0x294474['openNewInteraction']&&_0x294474[_0x0d02('0xef')]){var _0x195bb6=[];if(_0x1b58f0[_0x0d02('0x47')]){_0x195bb6=_0x1b58f0[_0x0d02('0x3c')](function(_0x2876ab){return{'name':_0x2876ab[_0x0d02('0xd6')],'basename':_0x2876ab[_0x0d02('0x71')],'type':_0x2876ab[_0x0d02('0xf0')],'ChatOfflineMessageId':_0x2dc9aa['id']};});}var _0x3eefc4;if(!_[_0x0d02('0x7b')](_0x294474[_0x0d02('0xf1')])){var _0x19a4c0=_[_0x0d02('0x3c')](_0x5d00b9['body'],function(_0x3824db){return _0x3824db;});var _0x399643=_[_0x0d02('0xf2')](_0x19a4c0)[0x0];var _0x2ef4c3=_[_0x0d02('0xf3')](_0x399643,function(_0x1c85c0){return _0x1c85c0;});_0x3eefc4=_0x2ef4c3[0x1][_0x294474[_0x0d02('0xf1')]];}var _0x3e4319={'from':_0x10f3e2[_0x0d02('0xec')],'firstName':_0x10f3e2[_0x0d02('0xa9')],'lastName':_0x10f3e2['lastName'],'mapKey':_0x0d02('0xec'),'message':{'from':_0x10f3e2[_0x0d02('0xec')],'to':_0x294474[_0x0d02('0xd1')][_0x0d02('0xec')],'cc':'','subject':_[_0x0d02('0x7b')](_0x3eefc4)?_0x294474[_0x0d02('0xee')]:_0x3eefc4,'messageId':'','sentAt':new Date(),'attach':_0x195bb6['length'],'attachments':_0x195bb6,'originChannel':_0x0d02('0xf4'),'ChatWebsiteId':_0x294474['id'],'ChatOfflineMessageId':_0x5cd080['id'],'originTo':_0x294474[_0x0d02('0xd1')][_0x0d02('0xec')]},'body':_0x5cd080[_0x0d02('0x5a')]};var _0x44c720={'account':{'id':_0x294474[_0x0d02('0xef')]},'body':_0x3e4319,'log':_0x0d02('0xf5')};return respondWithRpcPromise(_0x0d02('0xf5'),'notifyMail',_0x44c720,client9001)[_0x0d02('0x1f')](function(){return _0x5cd080;})[_0x0d02('0x28')](function(_0x90c989){console['error'](_0x90c989);});}return;})[_0x0d02('0x1f')](function(){if(_0x5cd080){return _0x5cd080;}})[_0x0d02('0x1f')](respondWithResult(_0x385c75,null))[_0x0d02('0x28')](function(_0x513e59){console[_0x0d02('0x24')]('catch',_0x513e59);for(var _0x1a4d4b of _0x1b58f0){var _0x1d315d=path['join'](config[_0x0d02('0x78')],_0x0d02('0xd7'),_0x0d02('0xd8'),'attachments','offline-chat',_0x1a4d4b[_0x0d02('0x71')]);fs_extra[_0x0d02('0xf6')](_0x1d315d)[_0x0d02('0x28')](function(_0x1b3d30){console[_0x0d02('0x24')]('Could\x20not\x20remove\x20attachment\x20file',_0x1d315d,_0x1b3d30);});}});};exports[_0x0d02('0xf7')]=function(_0x4d96e3,_0x4a4a0f,_0x85f4a0){return db[_0x0d02('0xb8')][_0x0d02('0x58')]({'where':{'id':_0x4d96e3[_0x0d02('0x55')]['id']}})[_0x0d02('0x1f')](handleEntityNotFound(_0x4a4a0f,null))['then'](function(_0x2a076a){if(_0x2a076a){return _0x2a076a[_0x0d02('0xf7')](_0x4d96e3['body'][_0x0d02('0x6d')],_['omit'](_0x4d96e3[_0x0d02('0x5a')],[_0x0d02('0x6d'),'id'])||{});}})['then'](respondWithResult(_0x4a4a0f,null))[_0x0d02('0x28')](handleError(_0x4a4a0f,null));};exports[_0x0d02('0xf8')]=function(_0x36615a,_0x450cf7,_0x41b1e2){var _0x4caf23={'raw':![],'where':{}};var _0x531983={};var _0x2376b1={'count':0x0,'rows':[]};return db[_0x0d02('0x3d')]['findOne']({'where':{'id':_0x36615a[_0x0d02('0x55')]['id']}})[_0x0d02('0x1f')](handleEntityNotFound(_0x450cf7,null))['then'](function(_0x252f50){if(_0x252f50){_0x531983['model']=_[_0x0d02('0x42')](db[_0x0d02('0xb8')][_0x0d02('0x57')]);_0x531983[_0x0d02('0x41')]=_['keys'](_0x36615a[_0x0d02('0x41')]);_0x531983[_0x0d02('0x43')]=_[_0x0d02('0x44')](_0x531983[_0x0d02('0x40')],_0x531983[_0x0d02('0x41')]);_0x4caf23['attributes']=_['intersection'](_0x531983[_0x0d02('0x40')],qs[_0x0d02('0x46')](_0x36615a[_0x0d02('0x41')][_0x0d02('0x46')]));_0x4caf23['attributes']=_0x4caf23[_0x0d02('0x45')][_0x0d02('0x47')]?_0x4caf23[_0x0d02('0x45')]:_0x531983[_0x0d02('0x40')];if(!_0x36615a[_0x0d02('0x41')][_0x0d02('0x48')](_0x0d02('0x49'))){_0x4caf23[_0x0d02('0x2e')]=qs[_0x0d02('0x2e')](_0x36615a[_0x0d02('0x41')][_0x0d02('0x2e')]);_0x4caf23[_0x0d02('0x2d')]=qs[_0x0d02('0x2d')](_0x36615a[_0x0d02('0x41')]['offset']);}_0x4caf23[_0x0d02('0x4a')]=qs['sort'](_0x36615a['query'][_0x0d02('0x4b')]);_0x4caf23[_0x0d02('0x4c')]=qs[_0x0d02('0x43')](_[_0x0d02('0x4d')](_0x36615a[_0x0d02('0x41')],_0x531983[_0x0d02('0x43')]));_0x4caf23['where'][_0x0d02('0x69')]=_0x252f50['id'];if(_0x36615a[_0x0d02('0x41')][_0x0d02('0x4e')]){_0x4caf23[_0x0d02('0x4c')]=_[_0x0d02('0x50')](_0x4caf23[_0x0d02('0x4c')],{'$or':_[_0x0d02('0x3c')](_0x4caf23[_0x0d02('0x45')],function(_0x9949af){var _0x54e144={};_0x54e144[_0x9949af]={'$like':'%'+_0x36615a[_0x0d02('0x41')][_0x0d02('0x4e')]+'%'};return _0x54e144;})});}_0x4caf23=_[_0x0d02('0x50')]({},_0x4caf23,_0x36615a[_0x0d02('0x65')]);return db[_0x0d02('0xb8')][_0x0d02('0x2f')]({'where':_0x4caf23['where']})['then'](function(_0x5aba8c){_0x2376b1[_0x0d02('0x2f')]=_0x5aba8c;if(_0x36615a[_0x0d02('0x41')]['includeAll']){_0x4caf23[_0x0d02('0x52')]=[{'model':db[_0x0d02('0x8b')],'as':'Contact','required':![]},{'model':db[_0x0d02('0xc3')],'as':_0x0d02('0xf9'),'attributes':[_0x0d02('0x38'),_0x0d02('0xfa'),_0x0d02('0xfb')],'required':![]},{'model':db[_0x0d02('0xfc')],'as':'Tags','attributes':['id',_0x0d02('0x38'),_0x0d02('0xfd')],'where':_0x36615a[_0x0d02('0x41')][_0x0d02('0xfe')]?{'id':_0x36615a[_0x0d02('0x41')]['tag']}:undefined,'required':_0x36615a[_0x0d02('0x41')]['tag']?!![]:![]}];}return db['ChatInteraction'][_0x0d02('0x53')](_0x4caf23);})['then'](function(_0x2fb159){_0x2376b1['rows']=_0x2fb159;return _0x2376b1;});}})['then'](respondWithFilteredResult(_0x450cf7,_0x4caf23))[_0x0d02('0x28')](handleError(_0x450cf7,null));};function iftimePromise(_0x2426da,_0x4ab61f){return respondWithRpcPromise(_0x0d02('0xff'),_0x0d02('0x100'),{'command':_0x4ab61f[_0x0d02('0x101')]?util[_0x0d02('0xaf')]('iftime\x20%s,%s',_0x2426da['interval'],_0x4ab61f[_0x0d02('0x101')]):util[_0x0d02('0xaf')](_0x0d02('0x102'),_0x2426da['interval'])},client9002)['then'](function(_0x37199e){var _0x118f75=_0x37199e&&_0x37199e['indexOf']('true')>=0x0?!![]:![];logger[_0x0d02('0x20')](_0x0d02('0x103'),_0x4ab61f['id'],_0x2426da['id'],_0x2426da[_0x0d02('0x104')],_0x118f75?'ONLINE':_0x0d02('0x105'),_0x4ab61f[_0x0d02('0x101')]?_0x4ab61f[_0x0d02('0x101')]:_0x0d02('0x106'));return _0x118f75;})[_0x0d02('0x28')](function(_0x35a4ae){logger['error'](_0x0d02('0x103'),_0x4ab61f['id'],_0x2426da['id'],_0x2426da['interval'],util[_0x0d02('0x107')](_0x35a4ae,{'showHidden':![],'depth':null}),_0x4ab61f[_0x0d02('0x101')]?_0x4ab61f[_0x0d02('0x101')]:_0x0d02('0x106'));return![];});}exports['getSnippet']=function(_0x467877,_0xb53a7c,_0x58c54c){var _0x45db58=0x0;var _0x25ba1e=0x0;var _0x58bd70=![];var _0x310f97;var _0x2d3952;return db[_0x0d02('0x3d')][_0x0d02('0x58')]({'where':{'id':_0x467877[_0x0d02('0x55')]['id']},'include':[{'model':db[_0x0d02('0x108')],'as':_0x0d02('0x108'),'include':[{'model':db['Interval'],'as':_0x0d02('0x109'),'attributes':['id','interval'],'raw':!![]}]}]})['then'](handleEntityNotFound(_0xb53a7c,null))['then'](function(_0x2bf036){if(_0x2bf036){_0x310f97=_0x2bf036;return _0x2bf036[_0x0d02('0x10a')]({'raw':!![]});}})[_0x0d02('0x1f')](function(_0x1b798f){if(_0x310f97){if(_0x1b798f){_0x2d3952=_0x1b798f;}}return require(_0x0d02('0x17'))[_0x0d02('0x10b')]();})[_0x0d02('0x1f')](function(_0x27ce12){if(_0x27ce12){_0x25ba1e=_0x27ce12[_0x0d02('0x10c')];_0x58bd70=_0x27ce12['custom'];}})[_0x0d02('0x1f')](function(){return db[_0x0d02('0xb8')][_0x0d02('0x2f')]({'where':{'closed':![]}});})[_0x0d02('0x1f')](function(_0x4513c1){_0x45db58=_0x4513c1;if(_0x25ba1e&&_0x4513c1>_0x25ba1e){return db['License'][_0x0d02('0x64')]({'where':{'id':0x1}})[_0x0d02('0x1f')](function(_0x4eff2a){if(_0x4eff2a){_0x4eff2a['increment'](_0x0d02('0x10d'));}});}})[_0x0d02('0x1f')](function(){if(_0x310f97[_0x0d02('0x108')]&&_0x310f97[_0x0d02('0x108')][_0x0d02('0x109')]){var _0x1a877e=[];for(var _0x283a8c=0x0;_0x283a8c<_0x310f97[_0x0d02('0x108')][_0x0d02('0x109')][_0x0d02('0x47')];_0x283a8c++){var _0x18d709=_0x310f97[_0x0d02('0x108')][_0x0d02('0x109')][_0x283a8c][_0x0d02('0x35')]({'plain':!![]});_0x1a877e['push'](iftimePromise(_0x18d709,_0x310f97));}return BPromise[_0x0d02('0x10e')](_0x1a877e)['then'](function(_0x4c171a){return _[_0x0d02('0x10f')](_0x4c171a);});}else{return!![];}})[_0x0d02('0x1f')](function(_0x56a135){var _0x47e832=fs['readFileSync'](path[_0x0d02('0x77')](config['root'],'server/files/chat/iframe.ejs'),_0x0d02('0x110'));var _0x5533cd={'remote':_0x310f97[_0x0d02('0x111')],'query':querystring[_0x0d02('0xb5')](_[_0x0d02('0x50')](_0x310f97[_0x0d02('0x35')]({'plain':!![]}),{'customerIp':_0x467877[_0x0d02('0x87')]['x-forwarded-for']||_0x467877[_0x0d02('0x87')]['x-real-ip']||_0x467877[_0x0d02('0x112')][_0x0d02('0x113')]||_0x467877['ip'],'referer':_0x467877['headers']['referer'],'openedInteractions':_0x45db58,'maxInteractions':_0x25ba1e,'virtual':_0x58bd70[_0x0d02('0x10c')],'online':_0x56a135,'custom':_0x58bd70}))['replace'](/'/g,'\x5c\x27')};_0xb53a7c[_0x0d02('0x39')](ejs[_0x0d02('0x114')](Mustache['render'](_0x47e832,_0x5533cd),{'proactiveActions':_0x2d3952,'alignment':_0x310f97[_0x0d02('0x115')],'verticalAlignment':_0x310f97[_0x0d02('0x116')],'div_color':_0x310f97[_0x0d02('0xfd')],'text_color':_0x310f97[_0x0d02('0x117')],'button_color':_0x310f97['color_button'],'background_color':_0x310f97[_0x0d02('0x118')]}));})[_0x0d02('0x28')](handleError(_0xb53a7c,null));};exports[_0x0d02('0x119')]=function(_0x5f3aad,_0x4ac90c,_0x53ab7c){return db['ChatWebsite'][_0x0d02('0x64')]({'where':{'id':_0x5f3aad['params']['id']}})[_0x0d02('0x1f')](handleEntityNotFound(_0x4ac90c,null))[_0x0d02('0x1f')](function(_0x297743){if(_0x297743){return db[_0x0d02('0xdc')][_0x0d02('0xdd')](function(_0x42260b){return db[_0x0d02('0x9d')][_0x0d02('0x34')]({'where':{'ChatWebsiteId':_0x5f3aad[_0x0d02('0x55')]['id']},'transaction':_0x42260b})[_0x0d02('0x1f')](function(_0x41d3b3){var _0x4612f3=_[_0x0d02('0x3c')](_0x5f3aad[_0x0d02('0x5a')],function(_0x10ccc1){_0x10ccc1[_0x0d02('0x69')]=_0x5f3aad[_0x0d02('0x55')]['id'];return _0x10ccc1;});return db['ChatApplication'][_0x0d02('0xdf')](_0x4612f3,{'transaction':_0x42260b});});})['then'](function(){return db[_0x0d02('0x9d')][_0x0d02('0x11a')]({'where':{'ChatWebsiteId':_0x5f3aad[_0x0d02('0x55')]['id']},'order':'priority'});});}})[_0x0d02('0x1f')](respondWithResult(_0x4ac90c,null))[_0x0d02('0x28')](handleError(_0x4ac90c,null));};exports[_0x0d02('0x11b')]=function(_0x4f5fe0,_0x259767,_0x37b697){var _0x13c480={};var _0x5dd7fc={};var _0x48432b;var _0x38ee05;return db[_0x0d02('0x3d')][_0x0d02('0x64')]({'where':{'id':_0x4f5fe0['params']['id']}})['then'](handleEntityNotFound(_0x259767,null))[_0x0d02('0x1f')](function(_0x12ab2d){if(_0x12ab2d){_0x48432b=_0x12ab2d;_0x5dd7fc[_0x0d02('0x40')]=_[_0x0d02('0x42')](db[_0x0d02('0x9d')][_0x0d02('0x57')]);_0x5dd7fc[_0x0d02('0x41')]=_[_0x0d02('0x42')](_0x4f5fe0[_0x0d02('0x41')]);_0x5dd7fc[_0x0d02('0x43')]=_[_0x0d02('0x44')](_0x5dd7fc[_0x0d02('0x40')],_0x5dd7fc[_0x0d02('0x41')]);_0x13c480[_0x0d02('0x45')]=_[_0x0d02('0x44')](_0x5dd7fc[_0x0d02('0x40')],qs[_0x0d02('0x46')](_0x4f5fe0[_0x0d02('0x41')]['fields']));_0x13c480['attributes']=_0x13c480[_0x0d02('0x45')][_0x0d02('0x47')]?_0x13c480[_0x0d02('0x45')]:_0x5dd7fc['model'];_0x13c480[_0x0d02('0x4a')]=qs[_0x0d02('0x4b')](_0x4f5fe0[_0x0d02('0x41')][_0x0d02('0x4b')]);_0x13c480['where']=qs[_0x0d02('0x43')](_[_0x0d02('0x4d')](_0x4f5fe0[_0x0d02('0x41')],_0x5dd7fc[_0x0d02('0x43')]));if(_0x4f5fe0['query'][_0x0d02('0x4e')]){_0x13c480[_0x0d02('0x4c')]=_[_0x0d02('0x50')](_0x13c480[_0x0d02('0x4c')],{'$or':_[_0x0d02('0x3c')](_0x13c480[_0x0d02('0x45')],function(_0x5f4fbf){var _0x4c456a={};_0x4c456a[_0x5f4fbf]={'$like':'%'+_0x4f5fe0[_0x0d02('0x41')][_0x0d02('0x4e')]+'%'};return _0x4c456a;})});}_0x13c480=_['merge']({},_0x13c480,_0x4f5fe0[_0x0d02('0x65')]);return _0x48432b[_0x0d02('0x11b')](_0x13c480);}})[_0x0d02('0x1f')](function(_0x49129c){if(_0x49129c){_0x38ee05=_0x49129c['length'];if(!_0x4f5fe0[_0x0d02('0x41')][_0x0d02('0x48')](_0x0d02('0x49'))){_0x13c480[_0x0d02('0x2e')]=qs['limit'](_0x4f5fe0[_0x0d02('0x41')][_0x0d02('0x2e')]);_0x13c480[_0x0d02('0x2d')]=qs[_0x0d02('0x2d')](_0x4f5fe0[_0x0d02('0x41')][_0x0d02('0x2d')]);}return _0x48432b[_0x0d02('0x11b')](_0x13c480);}})[_0x0d02('0x1f')](function(_0x130dae){if(_0x130dae){return _0x130dae?{'count':_0x38ee05,'rows':_0x130dae}:null;}})[_0x0d02('0x1f')](respondWithResult(_0x259767,null))['catch'](handleError(_0x259767,null));};exports['addProactiveActions']=function(_0x212863,_0x18f5fb,_0x3442d9){return db[_0x0d02('0x11c')][_0x0d02('0x58')]({'where':{'id':_0x212863[_0x0d02('0x55')]['id']}})['then'](handleEntityNotFound(_0x18f5fb,null))['then'](function(_0x12ce55){if(_0x12ce55){return _0x12ce55[_0x0d02('0x11d')](_0x212863[_0x0d02('0x5a')][_0x0d02('0x6d')],_[_0x0d02('0x11e')](_0x212863[_0x0d02('0x5a')],[_0x0d02('0x6d'),'id'])||{});}})[_0x0d02('0x1f')](respondWithResult(_0x18f5fb,null))[_0x0d02('0x28')](handleError(_0x18f5fb,null));};exports['getProactiveActions']=function(_0x2faa0b,_0x2d7ef0,_0x1ad508){var _0xc215b8={};var _0x9917b8={};var _0xe8b061;var _0x3627ea;return db[_0x0d02('0x3d')][_0x0d02('0x64')]({'where':{'id':_0x2faa0b['params']['id']}})[_0x0d02('0x1f')](handleEntityNotFound(_0x2d7ef0,null))[_0x0d02('0x1f')](function(_0x1df536){if(_0x1df536){_0xe8b061=_0x1df536;_0x9917b8[_0x0d02('0x40')]=_[_0x0d02('0x42')](db[_0x0d02('0x11f')][_0x0d02('0x57')]);_0x9917b8[_0x0d02('0x41')]=_[_0x0d02('0x42')](_0x2faa0b[_0x0d02('0x41')]);_0x9917b8['filters']=_[_0x0d02('0x44')](_0x9917b8['model'],_0x9917b8[_0x0d02('0x41')]);_0xc215b8[_0x0d02('0x45')]=_[_0x0d02('0x44')](_0x9917b8[_0x0d02('0x40')],qs['fields'](_0x2faa0b[_0x0d02('0x41')][_0x0d02('0x46')]));_0xc215b8[_0x0d02('0x45')]=_0xc215b8['attributes'][_0x0d02('0x47')]?_0xc215b8[_0x0d02('0x45')]:_0x9917b8['model'];_0xc215b8[_0x0d02('0x4a')]=qs[_0x0d02('0x4b')](_0x2faa0b[_0x0d02('0x41')][_0x0d02('0x4b')]);_0xc215b8[_0x0d02('0x4c')]=qs[_0x0d02('0x43')](_['pick'](_0x2faa0b[_0x0d02('0x41')],_0x9917b8[_0x0d02('0x43')]));if(_0x2faa0b[_0x0d02('0x41')][_0x0d02('0x4e')]){_0xc215b8[_0x0d02('0x4c')]=_[_0x0d02('0x50')](_0xc215b8[_0x0d02('0x4c')],{'$or':_[_0x0d02('0x3c')](_0xc215b8[_0x0d02('0x45')],function(_0x999e7a){var _0x313827={};_0x313827[_0x999e7a]={'$like':'%'+_0x2faa0b['query']['filter']+'%'};return _0x313827;})});}_0xc215b8=_[_0x0d02('0x50')]({},_0xc215b8,_0x2faa0b[_0x0d02('0x65')]);return _0xe8b061[_0x0d02('0x10a')](_0xc215b8);}})[_0x0d02('0x1f')](function(_0x560e65){if(_0x560e65){_0x3627ea=_0x560e65[_0x0d02('0x47')];if(!_0x2faa0b['query'][_0x0d02('0x48')](_0x0d02('0x49'))){_0xc215b8[_0x0d02('0x2e')]=qs[_0x0d02('0x2e')](_0x2faa0b[_0x0d02('0x41')]['limit']);_0xc215b8[_0x0d02('0x2d')]=qs[_0x0d02('0x2d')](_0x2faa0b['query'][_0x0d02('0x2d')]);}return _0xe8b061[_0x0d02('0x10a')](_0xc215b8);}})[_0x0d02('0x1f')](function(_0x2b86c5){if(_0x2b86c5){return _0x2b86c5?{'count':_0x3627ea,'rows':_0x2b86c5}:null;}})[_0x0d02('0x1f')](respondWithResult(_0x2d7ef0,null))[_0x0d02('0x28')](handleError(_0x2d7ef0,null));};exports[_0x0d02('0x120')]=function(_0x4ce7a7,_0x5b9839,_0x5768f5){var _0x44f9ef=_0x4ce7a7[_0x0d02('0x41')]['online']==='false'?_0x0d02('0x121'):_0x0d02('0x122');return db[_0x0d02('0x3d')][_0x0d02('0x58')]({'attributes':['id',_0x44f9ef],'where':{'id':_0x4ce7a7[_0x0d02('0x55')]['id']}})[_0x0d02('0x1f')](handleEntityNotFound(_0x5b9839,null))[_0x0d02('0x1f')](function(_0x14ea53){if(_0x14ea53){var _0x22a1be=_0x14ea53[_0x44f9ef];var _0x251b9a=_0x22a1be&&_0x22a1be[_0x0d02('0x123')]?_0x22a1be[_0x0d02('0x123')]:[];_0x5b9839[_0x0d02('0x39')]({'fromKey':_[_0x0d02('0x7b')](_0x22a1be[_0x0d02('0x124')])?undefined:_0x22a1be[_0x0d02('0x124')],'count':_0x251b9a[_0x0d02('0x47')],'rows':_0x251b9a});}})['catch'](handleError(_0x5b9839,null));};exports[_0x0d02('0x125')]=function(_0x2678ee,_0x4e090e,_0x298859){var _0x4e4732={'raw':![],'where':{}};var _0x2c6f93={};var _0x51d48c={'count':0x0,'rows':[]};return db[_0x0d02('0x3d')]['findOne']({'where':{'id':_0x2678ee[_0x0d02('0x55')]['id']}})[_0x0d02('0x1f')](handleEntityNotFound(_0x4e090e,null))[_0x0d02('0x1f')](function(_0x808cd3){if(_0x808cd3){_0x2c6f93[_0x0d02('0x40')]=_[_0x0d02('0x42')](db[_0x0d02('0xd5')][_0x0d02('0x57')]);_0x2c6f93[_0x0d02('0x41')]=_[_0x0d02('0x42')](_0x2678ee[_0x0d02('0x41')]);_0x2c6f93[_0x0d02('0x43')]=_[_0x0d02('0x44')](_0x2c6f93[_0x0d02('0x40')],_0x2c6f93[_0x0d02('0x41')]);_0x4e4732[_0x0d02('0x45')]=_['intersection'](_0x2c6f93[_0x0d02('0x40')],qs[_0x0d02('0x46')](_0x2678ee[_0x0d02('0x41')][_0x0d02('0x46')]));_0x4e4732[_0x0d02('0x45')]=_0x4e4732[_0x0d02('0x45')][_0x0d02('0x47')]?_0x4e4732[_0x0d02('0x45')]:_0x2c6f93[_0x0d02('0x40')];if(!_0x2678ee[_0x0d02('0x41')][_0x0d02('0x48')]('nolimit')){_0x4e4732[_0x0d02('0x2e')]=qs[_0x0d02('0x2e')](_0x2678ee['query'][_0x0d02('0x2e')]);_0x4e4732[_0x0d02('0x2d')]=qs[_0x0d02('0x2d')](_0x2678ee[_0x0d02('0x41')][_0x0d02('0x2d')]);}_0x4e4732[_0x0d02('0x4a')]=qs['sort'](_0x2678ee['query'][_0x0d02('0x4b')]);_0x4e4732['where']=qs[_0x0d02('0x43')](_[_0x0d02('0x4d')](_0x2678ee[_0x0d02('0x41')],_0x2c6f93[_0x0d02('0x43')]));_0x4e4732['where']['ChatWebsiteId']=_0x808cd3['id'];if(_0x2678ee['query'][_0x0d02('0x4e')]){_0x4e4732[_0x0d02('0x4c')]=_[_0x0d02('0x50')](_0x4e4732[_0x0d02('0x4c')],{'$or':_[_0x0d02('0x3c')](_0x4e4732[_0x0d02('0x45')],function(_0x54ba11){var _0x511763={};_0x511763[_0x54ba11]={'$like':'%'+_0x2678ee[_0x0d02('0x41')][_0x0d02('0x4e')]+'%'};return _0x511763;})});}_0x4e4732=_[_0x0d02('0x50')]({},_0x4e4732,_0x2678ee[_0x0d02('0x65')]);return db[_0x0d02('0xd5')]['count']({'where':_0x4e4732['where']})['then'](function(_0x4bb8a5){_0x51d48c[_0x0d02('0x2f')]=_0x4bb8a5;if(_0x2678ee[_0x0d02('0x41')][_0x0d02('0x51')]){_0x4e4732['include']=[{'all':!![]}];}else{_0x4e4732['include']=[{'model':db[_0x0d02('0x8b')],'as':_0x0d02('0x126'),'required':![]},{'model':db[_0x0d02('0xde')],'as':'Attachments','required':![]}];}return db['ChatOfflineMessage'][_0x0d02('0x53')](_0x4e4732);})['then'](function(_0x2a6cb0){_0x51d48c[_0x0d02('0x66')]=_0x2a6cb0;return _0x51d48c;});}})[_0x0d02('0x1f')](respondWithFilteredResult(_0x4e090e,_0x4e4732))['catch'](handleError(_0x4e090e,null));};exports[_0x0d02('0x127')]=function(_0x31d24f,_0xc410b5,_0x5c837f){return db[_0x0d02('0x3d')][_0x0d02('0x58')]({'where':{'id':_0x31d24f[_0x0d02('0x55')]['id']}})['then'](handleEntityNotFound(_0xc410b5,null))[_0x0d02('0x1f')](function(_0x4232c9){if(_0x4232c9){return _0x4232c9[_0x0d02('0x127')](_0x31d24f[_0x0d02('0x5a')][_0x0d02('0x6d')],_[_0x0d02('0x11e')](_0x31d24f[_0x0d02('0x5a')],[_0x0d02('0x6d'),'id'])||{})[_0x0d02('0xbb')](function(_0x4e6c58){for(var _0x417316=0x0;_0x417316<_0x31d24f[_0x0d02('0x5a')][_0x0d02('0x6d')][_0x0d02('0x47')];_0x417316+=0x1){socket['emit'](_0x0d02('0x128'),{'UserId':Number(_0x31d24f['body'][_0x0d02('0x6d')][_0x417316]),'ChatWebsiteId':Number(_0x31d24f[_0x0d02('0x55')]['id'])});}return _0x4e6c58;});}})[_0x0d02('0x1f')](respondWithResult(_0xc410b5,null))[_0x0d02('0x28')](handleError(_0xc410b5,null));};exports[_0x0d02('0x129')]=function(_0x2363d5,_0x550ebf,_0xc6f8c3){return db['ChatWebsite'][_0x0d02('0x58')]({'where':{'id':_0x2363d5[_0x0d02('0x55')]['id']}})[_0x0d02('0x1f')](handleEntityNotFound(_0x550ebf,null))[_0x0d02('0x1f')](function(_0x20103a){if(_0x20103a){return _0x20103a[_0x0d02('0x129')](_0x2363d5[_0x0d02('0x41')]['ids'])['then'](function(){if(_[_0x0d02('0x12a')](_0x2363d5[_0x0d02('0x41')][_0x0d02('0x6d')])){for(var _0x2039ca=0x0;_0x2039ca<_0x2363d5[_0x0d02('0x41')][_0x0d02('0x6d')][_0x0d02('0x47')];_0x2039ca+=0x1){socket[_0x0d02('0x12b')](_0x0d02('0x12c'),{'UserId':Number(_0x2363d5['query'][_0x0d02('0x6d')][_0x2039ca]),'ChatWebsiteId':Number(_0x2363d5[_0x0d02('0x55')]['id'])});}}else{socket[_0x0d02('0x12b')](_0x0d02('0x12c'),{'UserId':Number(_0x2363d5['query'][_0x0d02('0x6d')]),'ChatWebsiteId':Number(_0x2363d5[_0x0d02('0x55')]['id'])});}});}})['then'](respondWithStatusCode(_0x550ebf,null))[_0x0d02('0x28')](handleError(_0x550ebf,null));};exports[_0x0d02('0x12d')]=function(_0x11066f,_0xd76976,_0x82c20){var _0x2ebeec={};var _0x5299f9={};var _0x36f1e3;var _0x59cfc1;return db[_0x0d02('0x3d')]['findOne']({'where':{'id':_0x11066f[_0x0d02('0x55')]['id']}})[_0x0d02('0x1f')](handleEntityNotFound(_0xd76976,null))[_0x0d02('0x1f')](function(_0x17c08d){if(_0x17c08d){_0x36f1e3=_0x17c08d;_0x5299f9[_0x0d02('0x40')]=_[_0x0d02('0x42')](db[_0x0d02('0xc3')]['rawAttributes']);_0x5299f9['query']=_[_0x0d02('0x42')](_0x11066f[_0x0d02('0x41')]);_0x5299f9[_0x0d02('0x43')]=_[_0x0d02('0x44')](_0x5299f9['model'],_0x5299f9[_0x0d02('0x41')]);_0x2ebeec[_0x0d02('0x45')]=_[_0x0d02('0x44')](_0x5299f9[_0x0d02('0x40')],qs['fields'](_0x11066f[_0x0d02('0x41')]['fields']));_0x2ebeec[_0x0d02('0x45')]=_0x2ebeec[_0x0d02('0x45')][_0x0d02('0x47')]?_0x2ebeec[_0x0d02('0x45')]:_0x5299f9['model'];_0x2ebeec[_0x0d02('0x4a')]=qs[_0x0d02('0x4b')](_0x11066f[_0x0d02('0x41')][_0x0d02('0x4b')]);_0x2ebeec[_0x0d02('0x4c')]=qs[_0x0d02('0x43')](_['pick'](_0x11066f[_0x0d02('0x41')],_0x5299f9[_0x0d02('0x43')]));if(_0x11066f[_0x0d02('0x41')][_0x0d02('0x4e')]){_0x2ebeec[_0x0d02('0x4c')]=_['merge'](_0x2ebeec[_0x0d02('0x4c')],{'$or':_[_0x0d02('0x3c')](_0x2ebeec[_0x0d02('0x45')],function(_0x5c1900){var _0x41742c={};_0x41742c[_0x5c1900]={'$like':'%'+_0x11066f['query']['filter']+'%'};return _0x41742c;})});}_0x2ebeec=_[_0x0d02('0x50')]({},_0x2ebeec,_0x11066f['options']);return _0x36f1e3['getAgents'](_0x2ebeec);}})[_0x0d02('0x1f')](function(_0x1a1451){if(_0x1a1451){_0x59cfc1=_0x1a1451[_0x0d02('0x47')];if(!_0x11066f['query'][_0x0d02('0x48')]('nolimit')){_0x2ebeec[_0x0d02('0x2e')]=qs['limit'](_0x11066f[_0x0d02('0x41')][_0x0d02('0x2e')]);_0x2ebeec['offset']=qs[_0x0d02('0x2d')](_0x11066f[_0x0d02('0x41')][_0x0d02('0x2d')]);}return _0x36f1e3[_0x0d02('0x12d')](_0x2ebeec);}})[_0x0d02('0x1f')](function(_0x47ed31){if(_0x47ed31){return _0x47ed31?{'count':_0x59cfc1,'rows':_0x47ed31}:null;}})['then'](respondWithResult(_0xd76976,null))[_0x0d02('0x28')](handleError(_0xd76976,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 85a929c..8dcaf14 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 _0xaefc=['events','../../mysqldb','ChatWebsite','save','update','emit','hasOwnProperty','exports'];(function(_0x40bc9c,_0x3f50d7){var _0x3e78c9=function(_0x1372c7){while(--_0x1372c7){_0x40bc9c['push'](_0x40bc9c['shift']());}};_0x3e78c9(++_0x3f50d7);}(_0xaefc,0xc8));var _0xcaef=function(_0x332d7b,_0x12ac04){_0x332d7b=_0x332d7b-0x0;var _0x3fc593=_0xaefc[_0x332d7b];return _0x3fc593;};'use strict';var EventEmitter=require(_0xcaef('0x0'));var ChatWebsite=require(_0xcaef('0x1'))['db'][_0xcaef('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xcaef('0x3'),'afterUpdate':_0xcaef('0x4'),'afterDestroy':'remove'};function emitEvent(_0x575523){return function(_0x37a134,_0x46a35e,_0x5f160f){ChatWebsiteEvents['emit'](_0x575523+':'+_0x37a134['id'],_0x37a134);ChatWebsiteEvents[_0xcaef('0x5')](_0x575523,_0x37a134);_0x5f160f(null);};}for(var e in events){if(events[_0xcaef('0x6')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0xcaef('0x7')]=ChatWebsiteEvents; \ No newline at end of file +var _0xe8f7=['update','remove','emit','hook','exports','events','ChatWebsite','setMaxListeners','save'];(function(_0x2b8ff7,_0xe6be23){var _0x3e4d44=function(_0x334256){while(--_0x334256){_0x2b8ff7['push'](_0x2b8ff7['shift']());}};_0x3e4d44(++_0xe6be23);}(_0xe8f7,0x137));var _0x7e8f=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xe8f7[_0x2641f9];return _0x585741;};'use strict';var EventEmitter=require(_0x7e8f('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0x7e8f('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x7e8f('0x2')](0x0);var events={'afterCreate':_0x7e8f('0x3'),'afterUpdate':_0x7e8f('0x4'),'afterDestroy':_0x7e8f('0x5')};function emitEvent(_0xa9b6b5){return function(_0x4249af,_0x47c258,_0x4dcc25){ChatWebsiteEvents[_0x7e8f('0x6')](_0xa9b6b5+':'+_0x4249af['id'],_0x4249af);ChatWebsiteEvents[_0x7e8f('0x6')](_0xa9b6b5,_0x4249af);_0x4dcc25(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0x7e8f('0x7')](e,emitEvent(event));}}module[_0x7e8f('0x8')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index af66c46..75587e0 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 _0xd676=['path','rimraf','../../config/environment','./chatWebsite.attributes','exports','ChatWebsite','chat_websites','lodash','util','../../config/logger','api'];(function(_0x13a08a,_0x52da1c){var _0x152014=function(_0x18d227){while(--_0x18d227){_0x13a08a['push'](_0x13a08a['shift']());}};_0x152014(++_0x52da1c);}(_0xd676,0x151));var _0x6d67=function(_0x585234,_0x3ae470){_0x585234=_0x585234-0x0;var _0x28b8a7=_0xd676[_0x585234];return _0x28b8a7;};'use strict';var _=require(_0x6d67('0x0'));var util=require(_0x6d67('0x1'));var logger=require(_0x6d67('0x2'))(_0x6d67('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6d67('0x4'));var rimraf=require(_0x6d67('0x5'));var config=require(_0x6d67('0x6'));var attributes=require(_0x6d67('0x7'));module[_0x6d67('0x8')]=function(_0x1b1861,_0x12ae1d){return _0x1b1861['define'](_0x6d67('0x9'),attributes,{'tableName':_0x6d67('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x298d=['path','rimraf','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','../../config/logger','api','bluebird','request-promise'];(function(_0x9ef580,_0xebf6ec){var _0xd72525=function(_0x4b9267){while(--_0x4b9267){_0x9ef580['push'](_0x9ef580['shift']());}};_0xd72525(++_0xebf6ec);}(_0x298d,0x134));var _0xd298=function(_0x23f5cc,_0x2171fb){_0x23f5cc=_0x23f5cc-0x0;var _0x5a7c76=_0x298d[_0x23f5cc];return _0x5a7c76;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd298('0x0'))(_0xd298('0x1'));var moment=require('moment');var BPromise=require(_0xd298('0x2'));var rp=require(_0xd298('0x3'));var fs=require('fs');var path=require(_0xd298('0x4'));var rimraf=require(_0xd298('0x5'));var config=require(_0xd298('0x6'));var attributes=require(_0xd298('0x7'));module[_0xd298('0x8')]=function(_0x2ab842,_0x3143ae){return _0x2ab842[_0xd298('0x9')](_0xd298('0xa'),attributes,{'tableName':_0xd298('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js index 77f701e..d9ba8db 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 _0x6b5d=['defaults','localhost','socket.io-emitter','register','request','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','ChatWebsite,\x20%s,\x20%s','message','catch','lodash','util','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0x6b5d,0x116));var _0xd6b5=function(_0x19b98c,_0x4cc35d){_0x19b98c=_0x19b98c-0x0;var _0x361c7e=_0x6b5d[_0x19b98c];return _0x361c7e;};'use strict';var _=require(_0xd6b5('0x0'));var util=require(_0xd6b5('0x1'));var moment=require('moment');var BPromise=require(_0xd6b5('0x2'));var rs=require(_0xd6b5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xd6b5('0x4'));var logger=require('../../config/logger')(_0xd6b5('0x5'));var config=require(_0xd6b5('0x6'));var jayson=require(_0xd6b5('0x7'));var client=jayson['client'][_0xd6b5('0x8')]({'port':0x232a});config[_0xd6b5('0x9')]=_[_0xd6b5('0xa')](config['redis'],{'host':_0xd6b5('0xb'),'port':0x18eb});var socket=require(_0xd6b5('0xc'))(new Redis(config['redis']));require('./chatWebsite.socket')[_0xd6b5('0xd')](socket);function respondWithRpcPromise(_0x582f63,_0x25245d,_0x4c280e){return new BPromise(function(_0x2e8583,_0x77d9f){return client[_0xd6b5('0xe')](_0x582f63,_0x4c280e)['then'](function(_0x305864){logger[_0xd6b5('0xf')]('ChatWebsite,\x20%s,\x20%s',_0x25245d,_0xd6b5('0x10'));logger[_0xd6b5('0x11')](_0xd6b5('0x12'),_0x25245d,_0xd6b5('0x10'),JSON[_0xd6b5('0x13')](_0x305864));if(_0x305864['error']){if(_0x305864['error']['code']===0x1f4){logger[_0xd6b5('0x14')](_0xd6b5('0x15'),_0x25245d,_0x305864['error'][_0xd6b5('0x16')]);return _0x77d9f(_0x305864[_0xd6b5('0x14')][_0xd6b5('0x16')]);}logger['error'](_0xd6b5('0x15'),_0x25245d,_0x305864['error'][_0xd6b5('0x16')]);return _0x2e8583(_0x305864['error']['message']);}else{logger['info'](_0xd6b5('0x15'),_0x25245d,_0xd6b5('0x10'));_0x2e8583(_0x305864['result'][_0xd6b5('0x16')]);}})[_0xd6b5('0x17')](function(_0x1cbfc8){logger[_0xd6b5('0x14')](_0xd6b5('0x15'),_0x25245d,_0x1cbfc8);_0x77d9f(_0x1cbfc8);});});} \ No newline at end of file +var _0xbbd2=['request\x20sent','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatWebsite.socket','request','then','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x40ebff,_0x1dd15e){var _0x40122a=function(_0xae6174){while(--_0xae6174){_0x40ebff['push'](_0x40ebff['shift']());}};_0x40122a(++_0x1dd15e);}(_0xbbd2,0x1e9));var _0x2bbd=function(_0x504df1,_0x289598){_0x504df1=_0x504df1-0x0;var _0x1063b5=_0xbbd2[_0x504df1];return _0x1063b5;};'use strict';var _=require(_0x2bbd('0x0'));var util=require(_0x2bbd('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2bbd('0x2'));var fs=require('fs');var Redis=require(_0x2bbd('0x3'));var db=require(_0x2bbd('0x4'))['db'];var utils=require(_0x2bbd('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x2bbd('0x6'));var jayson=require(_0x2bbd('0x7'));var client=jayson[_0x2bbd('0x8')][_0x2bbd('0x9')]({'port':0x232a});config[_0x2bbd('0xa')]=_['defaults'](config[_0x2bbd('0xa')],{'host':_0x2bbd('0xb'),'port':0x18eb});var socket=require(_0x2bbd('0xc'))(new Redis(config[_0x2bbd('0xa')]));require(_0x2bbd('0xd'))['register'](socket);function respondWithRpcPromise(_0x5ac1d4,_0x5db9ac,_0x2ab0d0){return new BPromise(function(_0x3b2b4b,_0x1231e4){return client[_0x2bbd('0xe')](_0x5ac1d4,_0x2ab0d0)[_0x2bbd('0xf')](function(_0x49bd9c){logger[_0x2bbd('0x10')](_0x2bbd('0x11'),_0x5db9ac,'request\x20sent');logger[_0x2bbd('0x12')](_0x2bbd('0x13'),_0x5db9ac,'request\x20sent',JSON[_0x2bbd('0x14')](_0x49bd9c));if(_0x49bd9c[_0x2bbd('0x15')]){if(_0x49bd9c[_0x2bbd('0x15')][_0x2bbd('0x16')]===0x1f4){logger[_0x2bbd('0x15')](_0x2bbd('0x11'),_0x5db9ac,_0x49bd9c[_0x2bbd('0x15')][_0x2bbd('0x17')]);return _0x1231e4(_0x49bd9c[_0x2bbd('0x15')]['message']);}logger['error']('ChatWebsite,\x20%s,\x20%s',_0x5db9ac,_0x49bd9c[_0x2bbd('0x15')][_0x2bbd('0x17')]);return _0x3b2b4b(_0x49bd9c['error'][_0x2bbd('0x17')]);}else{logger[_0x2bbd('0x10')](_0x2bbd('0x11'),_0x5db9ac,_0x2bbd('0x18'));_0x3b2b4b(_0x49bd9c[_0x2bbd('0x19')][_0x2bbd('0x17')]);}})[_0x2bbd('0x1a')](function(_0x3e02d4){logger['error'](_0x2bbd('0x11'),_0x5db9ac,_0x3e02d4);_0x1231e4(_0x3e02d4);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index bbd5d8d..44f7974 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 _0x1eb5=['./chatWebsite.events','save','remove','update','emit','removeListener','register','length','chatWebsite:'];(function(_0x3def3c,_0x1d66d2){var _0x9cc736=function(_0x304f9b){while(--_0x304f9b){_0x3def3c['push'](_0x3def3c['shift']());}};_0x9cc736(++_0x1d66d2);}(_0x1eb5,0xea));var _0x51eb=function(_0x3fe227,_0x52d34f){_0x3fe227=_0x3fe227-0x0;var _0x34e8dc=_0x1eb5[_0x3fe227];return _0x34e8dc;};'use strict';var ChatWebsiteEvents=require(_0x51eb('0x0'));var events=[_0x51eb('0x1'),_0x51eb('0x2'),_0x51eb('0x3')];function createListener(_0x3815ed,_0x3c0af9){return function(_0x1aa631){_0x3c0af9[_0x51eb('0x4')](_0x3815ed,_0x1aa631);};}function removeListener(_0xf077a8,_0x4d6d2f){return function(){ChatWebsiteEvents[_0x51eb('0x5')](_0xf077a8,_0x4d6d2f);};}exports[_0x51eb('0x6')]=function(_0x5ef655){for(var _0x118991=0x0,_0x3db9d6=events[_0x51eb('0x7')];_0x118991<_0x3db9d6;_0x118991++){var _0x36a109=events[_0x118991];var _0x4c6d06=createListener(_0x51eb('0x8')+_0x36a109,_0x5ef655);ChatWebsiteEvents['on'](_0x36a109,_0x4c6d06);}}; \ No newline at end of file +var _0xe3af=['./chatWebsite.events','remove','update','removeListener','register','length'];(function(_0x21134e,_0x148b0e){var _0x791b59=function(_0x195ef3){while(--_0x195ef3){_0x21134e['push'](_0x21134e['shift']());}};_0x791b59(++_0x148b0e);}(_0xe3af,0x19e));var _0xfe3a=function(_0xd2cd94,_0x3bf735){_0xd2cd94=_0xd2cd94-0x0;var _0x844eaa=_0xe3af[_0xd2cd94];return _0x844eaa;};'use strict';var ChatWebsiteEvents=require(_0xfe3a('0x0'));var events=['save',_0xfe3a('0x1'),_0xfe3a('0x2')];function createListener(_0x348cc4,_0xfee7a9){return function(_0x237fe0){_0xfee7a9['emit'](_0x348cc4,_0x237fe0);};}function removeListener(_0x24633d,_0x3de65b){return function(){ChatWebsiteEvents[_0xfe3a('0x3')](_0x24633d,_0x3de65b);};}exports[_0xfe3a('0x4')]=function(_0x556619){for(var _0x586c74=0x0,_0x3e388e=events[_0xfe3a('0x5')];_0x586c74<_0x3e388e;_0x586c74++){var _0x2bf7be=events[_0x586c74];var _0x17cf5e=createListener('chatWebsite:'+_0x2bf7be,_0x556619);ChatWebsiteEvents['on'](_0x2bf7be,_0x17cf5e);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 4a7e2cb..f894a98 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 _0x6bac=['post','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','originalname','single','file','server/files/images/avatars/','addAvatar','/:id/customer_avatar','addCustomerAvatar','/:id/system_avatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','replace','/:id/offline','any','addInteraction','addApplications','addProactiveActions','addAgents','put','update','delete','destroy','removeAnswers','/:id/users','removeAgents','multer','util','connect-timeout','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','getCustomerAvatar','getSystemAvatar','/:id/interactions','getInteractions','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getFields','getAgents'];(function(_0x50ee83,_0x106751){var _0x3099ea=function(_0x1d38a4){while(--_0x1d38a4){_0x50ee83['push'](_0x50ee83['shift']());}};_0x3099ea(++_0x106751);}(_0x6bac,0xf2));var _0xc6ba=function(_0x1aaed2,_0x559e12){_0x1aaed2=_0x1aaed2-0x0;var _0x346822=_0x6bac[_0x1aaed2];return _0x346822;};'use strict';var multer=require(_0xc6ba('0x0'));var util=require(_0xc6ba('0x1'));var path=require('path');var timeout=require(_0xc6ba('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc6ba('0x3'));var config=require(_0xc6ba('0x4'));var controller=require('./chatWebsite.controller');router[_0xc6ba('0x5')]('/',auth['isAuthenticated'](),controller[_0xc6ba('0x6')]);router['get'](_0xc6ba('0x7'),auth[_0xc6ba('0x8')](),controller[_0xc6ba('0x9')]);router[_0xc6ba('0x5')](_0xc6ba('0xa'),auth[_0xc6ba('0x8')](),controller[_0xc6ba('0xb')]);router[_0xc6ba('0x5')](_0xc6ba('0xc'),auth[_0xc6ba('0x8')](),controller[_0xc6ba('0xd')]);router[_0xc6ba('0x5')](_0xc6ba('0xe'),auth['isAuthenticated'](),controller[_0xc6ba('0xf')]);router[_0xc6ba('0x5')](_0xc6ba('0x10'),controller[_0xc6ba('0x11')]);router[_0xc6ba('0x5')](_0xc6ba('0x12'),controller[_0xc6ba('0x13')]);router[_0xc6ba('0x5')]('/:id/customer_avatar',controller[_0xc6ba('0x14')]);router[_0xc6ba('0x5')]('/:id/system_avatar',controller[_0xc6ba('0x15')]);router['get'](_0xc6ba('0x16'),auth[_0xc6ba('0x8')](),controller[_0xc6ba('0x17')]);router[_0xc6ba('0x5')]('/:id/snippet',controller[_0xc6ba('0x18')]);router[_0xc6ba('0x5')](_0xc6ba('0x19'),auth[_0xc6ba('0x8')](),controller[_0xc6ba('0x1a')]);router[_0xc6ba('0x5')](_0xc6ba('0x1b'),auth[_0xc6ba('0x8')](),controller['getProactiveActions']);router[_0xc6ba('0x5')]('/:id/fields',controller[_0xc6ba('0x1c')]);router[_0xc6ba('0x5')]('/:id/offline_messages',auth[_0xc6ba('0x8')](),controller['getOfflineMessages']);router[_0xc6ba('0x5')]('/:id/users',auth[_0xc6ba('0x8')](),controller[_0xc6ba('0x1d')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xc6ba('0xc'),auth[_0xc6ba('0x8')](),controller['addDisposition']);router[_0xc6ba('0x1e')](_0xc6ba('0xe'),auth[_0xc6ba('0x8')](),controller[_0xc6ba('0x1f')]);var upload=multer({'storage':multer[_0xc6ba('0x20')]({'destination':function(_0x429e50,_0x179f5e,_0xf2001d){_0xf2001d(null,path[_0xc6ba('0x21')](config[_0xc6ba('0x22')],_0xc6ba('0x23')));},'filename':function(_0x9226c2,_0x13b47b,_0x546082){_0x546082(null,util[_0xc6ba('0x24')](_0xc6ba('0x25'),Date[_0xc6ba('0x26')](),_0x13b47b[_0xc6ba('0x27')]));}})});router[_0xc6ba('0x1e')](_0xc6ba('0x10'),upload[_0xc6ba('0x28')](_0xc6ba('0x29')),controller['addLogo']);var upload=multer({'storage':multer[_0xc6ba('0x20')]({'destination':function(_0x420410,_0x568fd4,_0x30a9c2){_0x30a9c2(null,path[_0xc6ba('0x21')](config[_0xc6ba('0x22')],_0xc6ba('0x2a')));},'filename':function(_0xe83e55,_0x2b24ce,_0x2913b5){_0x2913b5(null,util[_0xc6ba('0x24')]('%s-%s',Date[_0xc6ba('0x26')](),_0x2b24ce[_0xc6ba('0x27')]));}})});router['post'](_0xc6ba('0x12'),upload[_0xc6ba('0x28')](_0xc6ba('0x29')),controller[_0xc6ba('0x2b')]);var upload=multer({'storage':multer[_0xc6ba('0x20')]({'destination':function(_0x23195c,_0x2cdb14,_0x580e80){_0x580e80(null,path[_0xc6ba('0x21')](config['root'],_0xc6ba('0x2a')));},'filename':function(_0xcf3342,_0x463a16,_0x2deff4){_0x2deff4(null,util[_0xc6ba('0x24')](_0xc6ba('0x25'),Date[_0xc6ba('0x26')](),_0x463a16['originalname']));}})});router['post'](_0xc6ba('0x2c'),upload[_0xc6ba('0x28')](_0xc6ba('0x29')),controller[_0xc6ba('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4d4e66,_0x2be187,_0x1a0d3d){_0x1a0d3d(null,path['join'](config[_0xc6ba('0x22')],_0xc6ba('0x2a')));},'filename':function(_0x2ea2da,_0x450696,_0xebfc5){_0xebfc5(null,util[_0xc6ba('0x24')](_0xc6ba('0x25'),Date[_0xc6ba('0x26')](),_0x450696[_0xc6ba('0x27')]));}})});router['post'](_0xc6ba('0x2e'),upload['single'](_0xc6ba('0x29')),controller[_0xc6ba('0x2f')]);router[_0xc6ba('0x1e')](_0xc6ba('0x30'),controller[_0xc6ba('0x31')]);const offlineUploadMulter=multer({'storage':multer[_0xc6ba('0x20')]({'destination':function(_0x3bc5f3,_0x32575f,_0x5c5046){const _0x28bde7=path['join'](config[_0xc6ba('0x22')],_0xc6ba('0x32'),_0xc6ba('0x33'),_0xc6ba('0x34'));fs_extra[_0xc6ba('0x35')](_0x28bde7,function(){_0x5c5046(null,_0x28bde7);});},'filename':function(_0x4c36b1,_0x2cd4b9,_0x3792a9){const _0xf33d66=_0x2cd4b9[_0xc6ba('0x27')][_0xc6ba('0x36')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x3a91ea=path['extname'](_0xf33d66);const _0x51a865=Date[_0xc6ba('0x26')]()+'-'+_0xf33d66[_0xc6ba('0x36')](_0x3a91ea,'')+_0x3a91ea;_0x3792a9(null,_0x51a865);}})});router['post'](_0xc6ba('0x37'),offlineUploadMulter[_0xc6ba('0x38')](),controller['offline']);router[_0xc6ba('0x1e')](_0xc6ba('0x16'),auth[_0xc6ba('0x8')](),controller[_0xc6ba('0x39')]);router[_0xc6ba('0x1e')](_0xc6ba('0x19'),auth[_0xc6ba('0x8')](),controller[_0xc6ba('0x3a')]);router[_0xc6ba('0x1e')](_0xc6ba('0x1b'),auth[_0xc6ba('0x8')](),controller[_0xc6ba('0x3b')]);router[_0xc6ba('0x1e')]('/:id/users',auth[_0xc6ba('0x8')](),controller[_0xc6ba('0x3c')]);router[_0xc6ba('0x3d')](_0xc6ba('0xa'),auth['isAuthenticated'](),controller[_0xc6ba('0x3e')]);router[_0xc6ba('0x3f')](_0xc6ba('0xa'),auth['isAuthenticated'](),controller[_0xc6ba('0x40')]);router['delete'](_0xc6ba('0xc'),auth['isAuthenticated'](),controller['removeDispositions']);router[_0xc6ba('0x3f')]('/:id/canned_answers',auth[_0xc6ba('0x8')](),controller[_0xc6ba('0x41')]);router['delete'](_0xc6ba('0x42'),auth[_0xc6ba('0x8')](),controller[_0xc6ba('0x43')]);module['exports']=router; \ No newline at end of file +var _0xf821=['replace','extname','/:id/offline','offline','addInteraction','addApplications','addProactiveActions','put','/:id','delete','removeAnswers','removeAgents','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','index','isAuthenticated','describe','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/logo','/:id/avatar','getAvatar','/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','getApplications','/:id/proactive_actions','getProactiveActions','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','addDisposition','addAnswer','join','root','server/files/images/logos/','format','%s-%s','now','originalname','single','file','addLogo','diskStorage','server/files/images/avatars/','/:id/notify','notify','server/files','ensureDir'];(function(_0x3a93fc,_0x18d256){var _0x67898f=function(_0x99946b){while(--_0x99946b){_0x3a93fc['push'](_0x3a93fc['shift']());}};_0x67898f(++_0x18d256);}(_0xf821,0xd0));var _0x1f82=function(_0x20a573,_0x3328b4){_0x20a573=_0x20a573-0x0;var _0x399adf=_0xf821[_0x20a573];return _0x399adf;};'use strict';var multer=require(_0x1f82('0x0'));var util=require('util');var path=require(_0x1f82('0x1'));var timeout=require(_0x1f82('0x2'));var express=require(_0x1f82('0x3'));var router=express[_0x1f82('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1f82('0x5'));var interaction=require(_0x1f82('0x6'));var config=require(_0x1f82('0x7'));var controller=require(_0x1f82('0x8'));router[_0x1f82('0x9')]('/',auth['isAuthenticated'](),controller[_0x1f82('0xa')]);router['get']('/describe',auth[_0x1f82('0xb')](),controller[_0x1f82('0xc')]);router[_0x1f82('0x9')]('/:id',auth[_0x1f82('0xb')](),controller['show']);router[_0x1f82('0x9')](_0x1f82('0xd'),auth[_0x1f82('0xb')](),controller[_0x1f82('0xe')]);router[_0x1f82('0x9')](_0x1f82('0xf'),auth[_0x1f82('0xb')](),controller['getAnswers']);router[_0x1f82('0x9')](_0x1f82('0x10'),controller['getLogo']);router[_0x1f82('0x9')](_0x1f82('0x11'),controller[_0x1f82('0x12')]);router[_0x1f82('0x9')](_0x1f82('0x13'),controller['getCustomerAvatar']);router[_0x1f82('0x9')](_0x1f82('0x14'),controller[_0x1f82('0x15')]);router[_0x1f82('0x9')](_0x1f82('0x16'),auth['isAuthenticated'](),controller[_0x1f82('0x17')]);router[_0x1f82('0x9')](_0x1f82('0x18'),controller[_0x1f82('0x19')]);router['get']('/:id/applications',auth['isAuthenticated'](),controller[_0x1f82('0x1a')]);router[_0x1f82('0x9')](_0x1f82('0x1b'),auth[_0x1f82('0xb')](),controller[_0x1f82('0x1c')]);router[_0x1f82('0x9')]('/:id/fields',controller['getFields']);router['get'](_0x1f82('0x1d'),auth[_0x1f82('0xb')](),controller[_0x1f82('0x1e')]);router['get'](_0x1f82('0x1f'),auth[_0x1f82('0xb')](),controller[_0x1f82('0x20')]);router[_0x1f82('0x21')]('/',auth[_0x1f82('0xb')](),controller['create']);router[_0x1f82('0x21')](_0x1f82('0xd'),auth[_0x1f82('0xb')](),controller[_0x1f82('0x22')]);router[_0x1f82('0x21')]('/:id/canned_answers',auth[_0x1f82('0xb')](),controller[_0x1f82('0x23')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x42bdfc,_0x16ec12,_0x47f89e){_0x47f89e(null,path[_0x1f82('0x24')](config[_0x1f82('0x25')],_0x1f82('0x26')));},'filename':function(_0x120cf1,_0x3e2fc6,_0x31f292){_0x31f292(null,util[_0x1f82('0x27')](_0x1f82('0x28'),Date[_0x1f82('0x29')](),_0x3e2fc6[_0x1f82('0x2a')]));}})});router['post']('/:id/logo',upload[_0x1f82('0x2b')](_0x1f82('0x2c')),controller[_0x1f82('0x2d')]);var upload=multer({'storage':multer[_0x1f82('0x2e')]({'destination':function(_0x50a730,_0x31cf3a,_0x52c943){_0x52c943(null,path[_0x1f82('0x24')](config[_0x1f82('0x25')],_0x1f82('0x2f')));},'filename':function(_0x254e70,_0x5b9554,_0x45e20d){_0x45e20d(null,util[_0x1f82('0x27')]('%s-%s',Date[_0x1f82('0x29')](),_0x5b9554[_0x1f82('0x2a')]));}})});router[_0x1f82('0x21')](_0x1f82('0x11'),upload['single'](_0x1f82('0x2c')),controller['addAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x152baf,_0xf7d6b3,_0x1bf0db){_0x1bf0db(null,path['join'](config[_0x1f82('0x25')],_0x1f82('0x2f')));},'filename':function(_0x4b8c61,_0x4a4c54,_0x54e6e0){_0x54e6e0(null,util[_0x1f82('0x27')](_0x1f82('0x28'),Date[_0x1f82('0x29')](),_0x4a4c54['originalname']));}})});router[_0x1f82('0x21')]('/:id/customer_avatar',upload[_0x1f82('0x2b')]('file'),controller['addCustomerAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4b3876,_0x46e4d5,_0x3ff8ca){_0x3ff8ca(null,path['join'](config['root'],_0x1f82('0x2f')));},'filename':function(_0x10d4eb,_0x5b40d4,_0x19e9ed){_0x19e9ed(null,util['format'](_0x1f82('0x28'),Date[_0x1f82('0x29')](),_0x5b40d4[_0x1f82('0x2a')]));}})});router['post'](_0x1f82('0x14'),upload[_0x1f82('0x2b')](_0x1f82('0x2c')),controller['addSystemAvatar']);router[_0x1f82('0x21')](_0x1f82('0x30'),controller[_0x1f82('0x31')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x1c1e00,_0x48661e,_0x520cfc){const _0x132eb7=path[_0x1f82('0x24')](config[_0x1f82('0x25')],_0x1f82('0x32'),'attachments','offline-chat');fs_extra[_0x1f82('0x33')](_0x132eb7,function(){_0x520cfc(null,_0x132eb7);});},'filename':function(_0x3310ff,_0x157497,_0x4c07e0){const _0x479bf9=_0x157497[_0x1f82('0x2a')][_0x1f82('0x34')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x39bac3=path[_0x1f82('0x35')](_0x479bf9);const _0x23002e=Date[_0x1f82('0x29')]()+'-'+_0x479bf9[_0x1f82('0x34')](_0x39bac3,'')+_0x39bac3;_0x4c07e0(null,_0x23002e);}})});router[_0x1f82('0x21')](_0x1f82('0x36'),offlineUploadMulter['any'](),controller[_0x1f82('0x37')]);router['post'](_0x1f82('0x16'),auth[_0x1f82('0xb')](),controller[_0x1f82('0x38')]);router['post']('/:id/applications',auth[_0x1f82('0xb')](),controller[_0x1f82('0x39')]);router[_0x1f82('0x21')]('/:id/proactive_actions',auth['isAuthenticated'](),controller[_0x1f82('0x3a')]);router[_0x1f82('0x21')](_0x1f82('0x1f'),auth['isAuthenticated'](),controller['addAgents']);router[_0x1f82('0x3b')](_0x1f82('0x3c'),auth[_0x1f82('0xb')](),controller['update']);router[_0x1f82('0x3d')](_0x1f82('0x3c'),auth[_0x1f82('0xb')](),controller['destroy']);router['delete']('/:id/dispositions',auth[_0x1f82('0xb')](),controller['removeDispositions']);router[_0x1f82('0x3d')](_0x1f82('0xf'),auth[_0x1f82('0xb')](),controller[_0x1f82('0x3e')]);router['delete']('/:id/users',auth[_0x1f82('0xb')](),controller[_0x1f82('0x3f')]);module[_0x1f82('0x40')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index 742774f..2b6d5c5 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 _0x5db2=['STRING','AmazonAWS','Google','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5db2,0xf3));var _0x25db=function(_0x3adc99,_0x20689e){_0x3adc99=_0x3adc99-0x0;var _0x26fa68=_0x5db2[_0x3adc99];return _0x26fa68;};'use strict';var Sequelize=require(_0x25db('0x0'));module[_0x25db('0x1')]={'name':{'type':Sequelize[_0x25db('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0x25db('0x3'),_0x25db('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x25db('0x2')]},'data2':{'type':Sequelize[_0x25db('0x2')]}}; \ No newline at end of file +var _0x7c1f=['exports','STRING','ENUM','AmazonAWS','sequelize'];(function(_0x373e2d,_0x5053c6){var _0x5dc7be=function(_0x3ccfd8){while(--_0x3ccfd8){_0x373e2d['push'](_0x373e2d['shift']());}};_0x5dc7be(++_0x5053c6);}(_0x7c1f,0x194));var _0xf7c1=function(_0x5e69be,_0x298d40){_0x5e69be=_0x5e69be-0x0;var _0xf6bc5e=_0x7c1f[_0x5e69be];return _0xf6bc5e;};'use strict';var Sequelize=require(_0xf7c1('0x0'));module[_0xf7c1('0x1')]={'name':{'type':Sequelize[_0xf7c1('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xf7c1('0x3')](_0xf7c1('0x4'),'Google'),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0xf7c1('0x2')]},'data2':{'type':Sequelize[_0xf7c1('0x2')]}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index f144f8a..8bcf00d 100644 --- a/server/api/cloudProvider/cloudProvider.controller.js +++ b/server/api/cloudProvider/cloudProvider.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2032=['body','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','send','index','map','CloudProvider','fieldName','type','key','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filters','filter','merge','where','options','rows','show','params','keys','rawAttributes','includeAll','find','catch'];(function(_0x2ba5db,_0x4d9a5f){var _0x4cd936=function(_0x33f7e4){while(--_0x33f7e4){_0x2ba5db['push'](_0x2ba5db['shift']());}};_0x4cd936(++_0x4d9a5f);}(_0x2032,0xd9));var _0x2203=function(_0x30e4e8,_0x27dfdb){_0x30e4e8=_0x30e4e8-0x0;var _0x15b632=_0x2032[_0x30e4e8];return _0x15b632;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2203('0x0'));var zipdir=require(_0x2203('0x1'));var jsonpatch=require(_0x2203('0x2'));var rp=require('request-promise');var moment=require(_0x2203('0x3'));var BPromise=require(_0x2203('0x4'));var Mustache=require('mustache');var util=require(_0x2203('0x5'));var path=require(_0x2203('0x6'));var sox=require(_0x2203('0x7'));var csv=require(_0x2203('0x8'));var ejs=require(_0x2203('0x9'));var fs=require('fs');var fs_extra=require(_0x2203('0xa'));var _=require(_0x2203('0xb'));var squel=require(_0x2203('0xc'));var crypto=require(_0x2203('0xd'));var jsforce=require(_0x2203('0xe'));var deskjs=require(_0x2203('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2203('0x10'));var Redis=require('ioredis');var authService=require(_0x2203('0x11'));var qs=require(_0x2203('0x12'));var as=require(_0x2203('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2203('0x14'))('api');var utils=require(_0x2203('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2203('0x16'));var db=require(_0x2203('0x17'))['db'];function respondWithStatusCode(_0x4b9376,_0x583bc7){_0x583bc7=_0x583bc7||0xcc;return function(_0x585c76){if(_0x585c76){return _0x4b9376['sendStatus'](_0x583bc7);}return _0x4b9376['status'](_0x583bc7)[_0x2203('0x18')]();};}function respondWithResult(_0x538b30,_0x592e47){_0x592e47=_0x592e47||0xc8;return function(_0x21a3af){if(_0x21a3af){return _0x538b30[_0x2203('0x19')](_0x592e47)[_0x2203('0x1a')](_0x21a3af);}};}function respondWithFilteredResult(_0x41af85,_0x226209){return function(_0x3fe0a8){if(_0x3fe0a8){var _0x2c36e6=typeof _0x226209[_0x2203('0x1b')]===_0x2203('0x1c')&&typeof _0x226209[_0x2203('0x1d')]==='undefined';var _0x280eda=_0x3fe0a8[_0x2203('0x1e')];var _0x4893ff=_0x2c36e6?0x0:_0x226209[_0x2203('0x1b')];var _0x8906e1=_0x2c36e6?_0x3fe0a8['count']:_0x226209[_0x2203('0x1b')]+_0x226209['limit'];var _0x2904ba;if(_0x8906e1>=_0x280eda){_0x8906e1=_0x280eda;_0x2904ba=0xc8;}else{_0x2904ba=0xce;}_0x41af85[_0x2203('0x19')](_0x2904ba);return _0x41af85[_0x2203('0x1f')](_0x2203('0x20'),_0x4893ff+'-'+_0x8906e1+'/'+_0x280eda)[_0x2203('0x1a')](_0x3fe0a8);}return null;};}function patchUpdates(_0x449039){return function(_0x538c23){try{jsonpatch[_0x2203('0x21')](_0x538c23,_0x449039,!![]);}catch(_0x50822b){return BPromise['reject'](_0x50822b);}return _0x538c23[_0x2203('0x22')]();};}function saveUpdates(_0x496d82,_0x3b8ef9){return function(_0x5bfe61){if(_0x5bfe61){return _0x5bfe61['update'](_0x496d82)[_0x2203('0x23')](function(_0x5e29cd){return _0x5e29cd;});}return null;};}function removeEntity(_0x5c8da9,_0x226374){return function(_0x2718f5){if(_0x2718f5){return _0x2718f5[_0x2203('0x24')]()[_0x2203('0x23')](function(){_0x5c8da9[_0x2203('0x19')](0xcc)[_0x2203('0x18')]();});}};}function handleEntityNotFound(_0x49c12,_0x250349){return function(_0x576378){if(!_0x576378){_0x49c12[_0x2203('0x25')](0x194);}return _0x576378;};}function handleError(_0x36b958,_0x39a11a){_0x39a11a=_0x39a11a||0x1f4;return function(_0x5f11bf){logger[_0x2203('0x26')](_0x5f11bf[_0x2203('0x27')]);if(_0x5f11bf['name']){delete _0x5f11bf[_0x2203('0x28')];}_0x36b958[_0x2203('0x19')](_0x39a11a)[_0x2203('0x29')](_0x5f11bf);};}exports[_0x2203('0x2a')]=function(_0x28ae02,_0x1df508){var _0x9c53f={},_0x5a95c1={},_0x34b8ba={'count':0x0,'rows':[]};var _0x616ed8=_[_0x2203('0x2b')](db[_0x2203('0x2c')]['rawAttributes'],function(_0x3a8e23){return{'name':_0x3a8e23[_0x2203('0x2d')],'type':_0x3a8e23[_0x2203('0x2e')][_0x2203('0x2f')]};});_0x5a95c1['model']=_[_0x2203('0x2b')](_0x616ed8,_0x2203('0x28'));_0x5a95c1['query']=_['keys'](_0x28ae02[_0x2203('0x30')]);_0x5a95c1['filters']=_['intersection'](_0x5a95c1[_0x2203('0x31')],_0x5a95c1[_0x2203('0x30')]);_0x9c53f[_0x2203('0x32')]=_[_0x2203('0x33')](_0x5a95c1[_0x2203('0x31')],qs['fields'](_0x28ae02[_0x2203('0x30')][_0x2203('0x34')]));_0x9c53f['attributes']=_0x9c53f[_0x2203('0x32')][_0x2203('0x35')]?_0x9c53f[_0x2203('0x32')]:_0x5a95c1[_0x2203('0x31')];if(!_0x28ae02[_0x2203('0x30')][_0x2203('0x36')](_0x2203('0x37'))){_0x9c53f[_0x2203('0x1d')]=qs[_0x2203('0x1d')](_0x28ae02['query'][_0x2203('0x1d')]);_0x9c53f[_0x2203('0x1b')]=qs['offset'](_0x28ae02['query'][_0x2203('0x1b')]);}_0x9c53f['order']=qs[_0x2203('0x38')](_0x28ae02[_0x2203('0x30')][_0x2203('0x38')]);_0x9c53f['where']=qs['filters'](_[_0x2203('0x39')](_0x28ae02['query'],_0x5a95c1[_0x2203('0x3a')]),_0x616ed8);if(_0x28ae02['query'][_0x2203('0x3b')]){_0x9c53f['where']=_[_0x2203('0x3c')](_0x9c53f[_0x2203('0x3d')],{'$or':_[_0x2203('0x2b')](_0x616ed8,function(_0x40a793){if(_0x40a793[_0x2203('0x2e')]!=='VIRTUAL'){var _0x5f1561={};_0x5f1561[_0x40a793['name']]={'$like':'%'+_0x28ae02[_0x2203('0x30')][_0x2203('0x3b')]+'%'};return _0x5f1561;}})});}_0x9c53f=_[_0x2203('0x3c')]({},_0x9c53f,_0x28ae02[_0x2203('0x3e')]);var _0x3283fb={'where':_0x9c53f[_0x2203('0x3d')]};return db[_0x2203('0x2c')]['count'](_0x3283fb)[_0x2203('0x23')](function(_0x1b12c3){_0x34b8ba[_0x2203('0x1e')]=_0x1b12c3;if(_0x28ae02[_0x2203('0x30')]['includeAll']){_0x9c53f['include']=[{'all':!![]}];}return db[_0x2203('0x2c')]['findAll'](_0x9c53f);})[_0x2203('0x23')](function(_0x446209){_0x34b8ba[_0x2203('0x3f')]=_0x446209;return _0x34b8ba;})['then'](respondWithFilteredResult(_0x1df508,_0x9c53f))['catch'](handleError(_0x1df508,null));};exports[_0x2203('0x40')]=function(_0x3739f6,_0x368444){var _0x1e09f3={'raw':!![],'where':{'id':_0x3739f6[_0x2203('0x41')]['id']}},_0x372709={};_0x372709['model']=_[_0x2203('0x42')](db[_0x2203('0x2c')][_0x2203('0x43')]);_0x372709[_0x2203('0x30')]=_[_0x2203('0x42')](_0x3739f6[_0x2203('0x30')]);_0x372709[_0x2203('0x3a')]=_[_0x2203('0x33')](_0x372709[_0x2203('0x31')],_0x372709[_0x2203('0x30')]);_0x1e09f3['attributes']=_[_0x2203('0x33')](_0x372709[_0x2203('0x31')],qs[_0x2203('0x34')](_0x3739f6[_0x2203('0x30')]['fields']));_0x1e09f3['attributes']=_0x1e09f3[_0x2203('0x32')]['length']?_0x1e09f3[_0x2203('0x32')]:_0x372709[_0x2203('0x31')];if(_0x3739f6[_0x2203('0x30')][_0x2203('0x44')]){_0x1e09f3['include']=[{'all':!![]}];}_0x1e09f3=_[_0x2203('0x3c')]({},_0x1e09f3,_0x3739f6[_0x2203('0x3e')]);return db['CloudProvider'][_0x2203('0x45')](_0x1e09f3)[_0x2203('0x23')](handleEntityNotFound(_0x368444,null))[_0x2203('0x23')](respondWithResult(_0x368444,null))[_0x2203('0x46')](handleError(_0x368444,null));};exports['create']=function(_0x4c1a29,_0x21b8ab){return db['CloudProvider']['create'](_0x4c1a29[_0x2203('0x47')],{})[_0x2203('0x23')](respondWithResult(_0x21b8ab,0xc9))[_0x2203('0x46')](handleError(_0x21b8ab,null));};exports['update']=function(_0x4c1496,_0x131aec){if(_0x4c1496[_0x2203('0x47')]['id']){delete _0x4c1496[_0x2203('0x47')]['id'];}return db[_0x2203('0x2c')][_0x2203('0x45')]({'where':{'id':_0x4c1496[_0x2203('0x41')]['id']}})['then'](handleEntityNotFound(_0x131aec,null))[_0x2203('0x23')](saveUpdates(_0x4c1496['body'],null))[_0x2203('0x23')](respondWithResult(_0x131aec,null))[_0x2203('0x46')](handleError(_0x131aec,null));};exports[_0x2203('0x24')]=function(_0x1e49dd,_0x58b9bb){return db['CloudProvider'][_0x2203('0x45')]({'where':{'id':_0x1e49dd[_0x2203('0x41')]['id']}})[_0x2203('0x23')](handleEntityNotFound(_0x58b9bb,null))[_0x2203('0x23')](removeEntity(_0x58b9bb,null))['catch'](handleError(_0x58b9bb,null));}; \ No newline at end of file +var _0x2ef3=['update','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','CloudProvider','then','includeAll','include','findAll','catch','show','params','keys','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0xd8ab28,_0x5ed6f6){var _0x84a78c=function(_0x34c505){while(--_0x34c505){_0xd8ab28['push'](_0xd8ab28['shift']());}};_0x84a78c(++_0x5ed6f6);}(_0x2ef3,0xba));var _0x32ef=function(_0x33c441,_0x4942e3){_0x33c441=_0x33c441-0x0;var _0xb535ef=_0x2ef3[_0x33c441];return _0xb535ef;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a5106,_0x49d590){_0x49d590=_0x49d590||0xcc;return function(_0x3e98df){if(_0x3e98df){return _0x1a5106[_0x32ef('0x18')](_0x49d590);}return _0x1a5106['status'](_0x49d590)['end']();};}function respondWithResult(_0x19ce1,_0x4d8009){_0x4d8009=_0x4d8009||0xc8;return function(_0x326fce){if(_0x326fce){return _0x19ce1[_0x32ef('0x19')](_0x4d8009)[_0x32ef('0x1a')](_0x326fce);}};}function respondWithFilteredResult(_0x54c7f5,_0x57aff1){return function(_0x55bf0b){if(_0x55bf0b){var _0x531e30=typeof _0x57aff1[_0x32ef('0x1b')]===_0x32ef('0x1c')&&typeof _0x57aff1[_0x32ef('0x1d')]==='undefined';var _0x5d559b=_0x55bf0b[_0x32ef('0x1e')];var _0x1a9476=_0x531e30?0x0:_0x57aff1[_0x32ef('0x1b')];var _0x57863c=_0x531e30?_0x55bf0b[_0x32ef('0x1e')]:_0x57aff1[_0x32ef('0x1b')]+_0x57aff1['limit'];var _0x304505;if(_0x57863c>=_0x5d559b){_0x57863c=_0x5d559b;_0x304505=0xc8;}else{_0x304505=0xce;}_0x54c7f5[_0x32ef('0x19')](_0x304505);return _0x54c7f5[_0x32ef('0x1f')](_0x32ef('0x20'),_0x1a9476+'-'+_0x57863c+'/'+_0x5d559b)[_0x32ef('0x1a')](_0x55bf0b);}return null;};}function patchUpdates(_0x3aec05){return function(_0x4de441){try{jsonpatch[_0x32ef('0x21')](_0x4de441,_0x3aec05,!![]);}catch(_0x5cc3ef){return BPromise[_0x32ef('0x22')](_0x5cc3ef);}return _0x4de441[_0x32ef('0x23')]();};}function saveUpdates(_0x49f2d8,_0x1af371){return function(_0x97780){if(_0x97780){return _0x97780[_0x32ef('0x24')](_0x49f2d8)['then'](function(_0x57f5e5){return _0x57f5e5;});}return null;};}function removeEntity(_0x22f2d7,_0xb30fab){return function(_0x225feb){if(_0x225feb){return _0x225feb['destroy']()['then'](function(){_0x22f2d7[_0x32ef('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a412,_0x278495){return function(_0x14d4b3){if(!_0x14d4b3){_0x51a412[_0x32ef('0x18')](0x194);}return _0x14d4b3;};}function handleError(_0x1dbe98,_0x15ce54){_0x15ce54=_0x15ce54||0x1f4;return function(_0x234175){logger[_0x32ef('0x25')](_0x234175[_0x32ef('0x26')]);if(_0x234175[_0x32ef('0x27')]){delete _0x234175[_0x32ef('0x27')];}_0x1dbe98[_0x32ef('0x19')](_0x15ce54)[_0x32ef('0x28')](_0x234175);};}exports['index']=function(_0xd65fde,_0x2f5d06){var _0x5a04cd={},_0x12de1a={},_0x3c569d={'count':0x0,'rows':[]};var _0x30b250=_[_0x32ef('0x29')](db['CloudProvider'][_0x32ef('0x2a')],function(_0x22bf86){return{'name':_0x22bf86[_0x32ef('0x2b')],'type':_0x22bf86[_0x32ef('0x2c')][_0x32ef('0x2d')]};});_0x12de1a[_0x32ef('0x2e')]=_[_0x32ef('0x29')](_0x30b250,'name');_0x12de1a[_0x32ef('0x2f')]=_['keys'](_0xd65fde[_0x32ef('0x2f')]);_0x12de1a[_0x32ef('0x30')]=_['intersection'](_0x12de1a[_0x32ef('0x2e')],_0x12de1a[_0x32ef('0x2f')]);_0x5a04cd[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x12de1a[_0x32ef('0x2e')],qs['fields'](_0xd65fde['query'][_0x32ef('0x33')]));_0x5a04cd['attributes']=_0x5a04cd[_0x32ef('0x31')][_0x32ef('0x34')]?_0x5a04cd[_0x32ef('0x31')]:_0x12de1a[_0x32ef('0x2e')];if(!_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x35')]('nolimit')){_0x5a04cd['limit']=qs['limit'](_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x1d')]);_0x5a04cd[_0x32ef('0x1b')]=qs['offset'](_0xd65fde['query'][_0x32ef('0x1b')]);}_0x5a04cd[_0x32ef('0x36')]=qs[_0x32ef('0x37')](_0xd65fde['query']['sort']);_0x5a04cd[_0x32ef('0x38')]=qs[_0x32ef('0x30')](_[_0x32ef('0x39')](_0xd65fde[_0x32ef('0x2f')],_0x12de1a[_0x32ef('0x30')]),_0x30b250);if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]){_0x5a04cd[_0x32ef('0x38')]=_[_0x32ef('0x3b')](_0x5a04cd['where'],{'$or':_[_0x32ef('0x29')](_0x30b250,function(_0x36e374){if(_0x36e374[_0x32ef('0x2c')]!=='VIRTUAL'){var _0x365125={};_0x365125[_0x36e374[_0x32ef('0x27')]]={'$like':'%'+_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]+'%'};return _0x365125;}})});}_0x5a04cd=_[_0x32ef('0x3b')]({},_0x5a04cd,_0xd65fde[_0x32ef('0x3c')]);var _0x256c40={'where':_0x5a04cd[_0x32ef('0x38')]};return db[_0x32ef('0x3d')][_0x32ef('0x1e')](_0x256c40)[_0x32ef('0x3e')](function(_0x4615b4){_0x3c569d['count']=_0x4615b4;if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5a04cd[_0x32ef('0x40')]=[{'all':!![]}];}return db[_0x32ef('0x3d')][_0x32ef('0x41')](_0x5a04cd);})[_0x32ef('0x3e')](function(_0x3c0e44){_0x3c569d['rows']=_0x3c0e44;return _0x3c569d;})['then'](respondWithFilteredResult(_0x2f5d06,_0x5a04cd))[_0x32ef('0x42')](handleError(_0x2f5d06,null));};exports[_0x32ef('0x43')]=function(_0x2a33dd,_0x765c63){var _0x5dca14={'raw':!![],'where':{'id':_0x2a33dd[_0x32ef('0x44')]['id']}},_0x2901a1={};_0x2901a1['model']=_[_0x32ef('0x45')](db['CloudProvider'][_0x32ef('0x2a')]);_0x2901a1[_0x32ef('0x2f')]=_[_0x32ef('0x45')](_0x2a33dd[_0x32ef('0x2f')]);_0x2901a1[_0x32ef('0x30')]=_[_0x32ef('0x32')](_0x2901a1[_0x32ef('0x2e')],_0x2901a1[_0x32ef('0x2f')]);_0x5dca14[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x2901a1['model'],qs[_0x32ef('0x33')](_0x2a33dd['query'][_0x32ef('0x33')]));_0x5dca14[_0x32ef('0x31')]=_0x5dca14[_0x32ef('0x31')]['length']?_0x5dca14[_0x32ef('0x31')]:_0x2901a1[_0x32ef('0x2e')];if(_0x2a33dd[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5dca14[_0x32ef('0x40')]=[{'all':!![]}];}_0x5dca14=_[_0x32ef('0x3b')]({},_0x5dca14,_0x2a33dd[_0x32ef('0x3c')]);return db['CloudProvider']['find'](_0x5dca14)[_0x32ef('0x3e')](handleEntityNotFound(_0x765c63,null))[_0x32ef('0x3e')](respondWithResult(_0x765c63,null))[_0x32ef('0x42')](handleError(_0x765c63,null));};exports[_0x32ef('0x46')]=function(_0x209361,_0xd67dc9){return db[_0x32ef('0x3d')][_0x32ef('0x46')](_0x209361[_0x32ef('0x47')],{})[_0x32ef('0x3e')](respondWithResult(_0xd67dc9,0xc9))[_0x32ef('0x42')](handleError(_0xd67dc9,null));};exports[_0x32ef('0x24')]=function(_0x36a65c,_0x4c2534){if(_0x36a65c[_0x32ef('0x47')]['id']){delete _0x36a65c[_0x32ef('0x47')]['id'];}return db[_0x32ef('0x3d')][_0x32ef('0x48')]({'where':{'id':_0x36a65c[_0x32ef('0x44')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x4c2534,null))[_0x32ef('0x3e')](saveUpdates(_0x36a65c[_0x32ef('0x47')],null))[_0x32ef('0x3e')](respondWithResult(_0x4c2534,null))[_0x32ef('0x42')](handleError(_0x4c2534,null));};exports[_0x32ef('0x49')]=function(_0x29d456,_0x272377){return db[_0x32ef('0x3d')][_0x32ef('0x48')]({'where':{'id':_0x29d456[_0x32ef('0x44')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x272377,null))[_0x32ef('0x3e')](removeEntity(_0x272377,null))['catch'](handleError(_0x272377,null));}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 7ee3adc..cefd8e7 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 _0x4d8a=['rimraf','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','lodash','util','api','moment','request-promise','path'];(function(_0x2a9202,_0x5e68cb){var _0x316625=function(_0x4ae297){while(--_0x4ae297){_0x2a9202['push'](_0x2a9202['shift']());}};_0x316625(++_0x5e68cb);}(_0x4d8a,0x1e8));var _0xa4d8=function(_0x4ea576,_0x46e67a){_0x4ea576=_0x4ea576-0x0;var _0xc48ceb=_0x4d8a[_0x4ea576];return _0xc48ceb;};'use strict';var _=require(_0xa4d8('0x0'));var util=require(_0xa4d8('0x1'));var logger=require('../../config/logger')(_0xa4d8('0x2'));var moment=require(_0xa4d8('0x3'));var BPromise=require('bluebird');var rp=require(_0xa4d8('0x4'));var fs=require('fs');var path=require(_0xa4d8('0x5'));var rimraf=require(_0xa4d8('0x6'));var config=require(_0xa4d8('0x7'));var attributes=require(_0xa4d8('0x8'));module[_0xa4d8('0x9')]=function(_0x60cd93,_0x59d88e){return _0x60cd93[_0xa4d8('0xa')](_0xa4d8('0xb'),attributes,{'tableName':_0xa4d8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd9e4=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','define','CloudProvider','cloud_providers','lodash'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xd9e4,0x77));var _0x4d9e=function(_0xa76f70,_0x115a75){_0xa76f70=_0xa76f70-0x0;var _0x24459b=_0xd9e4[_0xa76f70];return _0x24459b;};'use strict';var _=require(_0x4d9e('0x0'));var util=require(_0x4d9e('0x1'));var logger=require(_0x4d9e('0x2'))(_0x4d9e('0x3'));var moment=require(_0x4d9e('0x4'));var BPromise=require(_0x4d9e('0x5'));var rp=require(_0x4d9e('0x6'));var fs=require('fs');var path=require(_0x4d9e('0x7'));var rimraf=require(_0x4d9e('0x8'));var config=require('../../config/environment');var attributes=require('./cloudProvider.attributes');module['exports']=function(_0x4808d8,_0x246601){return _0x4808d8[_0x4d9e('0x9')](_0x4d9e('0xa'),attributes,{'tableName':_0x4d9e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js index aa326d1..a4eb5ad 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 _0xa5c1=['../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','CloudProvider,\x20%s,\x20%s','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','ioredis','../../config/utils'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0xa5c1,0x19f));var _0x1a5c=function(_0x10e9e7,_0x199cbd){_0x10e9e7=_0x10e9e7-0x0;var _0x4e187a=_0xa5c1[_0x10e9e7];return _0x4e187a;};'use strict';var _=require(_0x1a5c('0x0'));var util=require(_0x1a5c('0x1'));var moment=require(_0x1a5c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1a5c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1a5c('0x4'));var logger=require(_0x1a5c('0x5'))(_0x1a5c('0x6'));var config=require(_0x1a5c('0x7'));var jayson=require(_0x1a5c('0x8'));var client=jayson[_0x1a5c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x9853,_0x580a2e,_0x438f8f){return new BPromise(function(_0x43a2ed,_0x1702ce){return client['request'](_0x9853,_0x438f8f)[_0x1a5c('0xa')](function(_0x4c0bd2){logger[_0x1a5c('0xb')](_0x1a5c('0xc'),_0x580a2e,'request\x20sent');logger[_0x1a5c('0xd')](_0x1a5c('0xe'),_0x580a2e,'request\x20sent',JSON[_0x1a5c('0xf')](_0x4c0bd2));if(_0x4c0bd2[_0x1a5c('0x10')]){if(_0x4c0bd2[_0x1a5c('0x10')][_0x1a5c('0x11')]===0x1f4){logger[_0x1a5c('0x10')](_0x1a5c('0xc'),_0x580a2e,_0x4c0bd2[_0x1a5c('0x10')]['message']);return _0x1702ce(_0x4c0bd2[_0x1a5c('0x10')][_0x1a5c('0x12')]);}logger['error'](_0x1a5c('0xc'),_0x580a2e,_0x4c0bd2[_0x1a5c('0x10')]['message']);return _0x43a2ed(_0x4c0bd2[_0x1a5c('0x10')][_0x1a5c('0x12')]);}else{logger[_0x1a5c('0xb')](_0x1a5c('0xc'),_0x580a2e,'request\x20sent');_0x43a2ed(_0x4c0bd2[_0x1a5c('0x13')]['message']);}})[_0x1a5c('0x14')](function(_0x44648a){logger[_0x1a5c('0x10')]('CloudProvider,\x20%s,\x20%s',_0x580a2e,_0x44648a);_0x1702ce(_0x44648a);});});} \ No newline at end of file +var _0x42f4=['jayson/promise','http','then','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','CloudProvider,\x20%s,\x20%s','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment'];(function(_0x33a017,_0xfa348c){var _0x147e22=function(_0x42f8b9){while(--_0x42f8b9){_0x33a017['push'](_0x33a017['shift']());}};_0x147e22(++_0xfa348c);}(_0x42f4,0x19d));var _0x442f=function(_0x3ae2b2,_0x2d936f){_0x3ae2b2=_0x3ae2b2-0x0;var _0x1dbf00=_0x42f4[_0x3ae2b2];return _0x1dbf00;};'use strict';var _=require(_0x442f('0x0'));var util=require('util');var moment=require(_0x442f('0x1'));var BPromise=require(_0x442f('0x2'));var rs=require(_0x442f('0x3'));var fs=require('fs');var Redis=require(_0x442f('0x4'));var db=require(_0x442f('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x442f('0x6'));var jayson=require(_0x442f('0x7'));var client=jayson['client'][_0x442f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x11b450,_0x23c5ba,_0x37dfe7){return new BPromise(function(_0x6c0b4b,_0x476480){return client['request'](_0x11b450,_0x37dfe7)[_0x442f('0x9')](function(_0x4e32af){logger['info']('CloudProvider,\x20%s,\x20%s',_0x23c5ba,_0x442f('0xa'));logger[_0x442f('0xb')](_0x442f('0xc'),_0x23c5ba,_0x442f('0xa'),JSON[_0x442f('0xd')](_0x4e32af));if(_0x4e32af[_0x442f('0xe')]){if(_0x4e32af[_0x442f('0xe')][_0x442f('0xf')]===0x1f4){logger[_0x442f('0xe')](_0x442f('0x10'),_0x23c5ba,_0x4e32af['error'][_0x442f('0x11')]);return _0x476480(_0x4e32af[_0x442f('0xe')][_0x442f('0x11')]);}logger[_0x442f('0xe')](_0x442f('0x10'),_0x23c5ba,_0x4e32af[_0x442f('0xe')][_0x442f('0x11')]);return _0x6c0b4b(_0x4e32af[_0x442f('0xe')][_0x442f('0x11')]);}else{logger[_0x442f('0x12')](_0x442f('0x10'),_0x23c5ba,_0x442f('0xa'));_0x6c0b4b(_0x4e32af[_0x442f('0x13')][_0x442f('0x11')]);}})[_0x442f('0x14')](function(_0x3ff2b1){logger['error'](_0x442f('0x10'),_0x23c5ba,_0x3ff2b1);_0x476480(_0x3ff2b1);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 998e6c6..9e3906b 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 _0xf811=['show','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cloudProvider.controller','get','isAuthenticated','index','/:id'];(function(_0x21b99d,_0x46fbc9){var _0x31335a=function(_0x3985a8){while(--_0x3985a8){_0x21b99d['push'](_0x21b99d['shift']());}};_0x31335a(++_0x46fbc9);}(_0xf811,0x6f));var _0x1f81=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0xf811[_0x42245d];return _0x4b211a;};'use strict';var multer=require(_0x1f81('0x0'));var util=require(_0x1f81('0x1'));var path=require(_0x1f81('0x2'));var timeout=require(_0x1f81('0x3'));var express=require(_0x1f81('0x4'));var router=express[_0x1f81('0x5')]();var fs_extra=require(_0x1f81('0x6'));var auth=require(_0x1f81('0x7'));var interaction=require(_0x1f81('0x8'));var config=require(_0x1f81('0x9'));var controller=require(_0x1f81('0xa'));router[_0x1f81('0xb')]('/',auth[_0x1f81('0xc')](),controller[_0x1f81('0xd')]);router['get'](_0x1f81('0xe'),auth[_0x1f81('0xc')](),controller[_0x1f81('0xf')]);router['post']('/',auth[_0x1f81('0xc')](),controller[_0x1f81('0x10')]);router['put'](_0x1f81('0xe'),auth['isAuthenticated'](),controller[_0x1f81('0x11')]);router[_0x1f81('0x12')](_0x1f81('0xe'),auth[_0x1f81('0xc')](),controller[_0x1f81('0x13')]);module[_0x1f81('0x14')]=router; \ No newline at end of file +var _0x62fd=['show','post','create','put','update','delete','destroy','multer','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x2338ae,_0x1896f8){var _0x4adad9=function(_0x1f6ed1){while(--_0x1f6ed1){_0x2338ae['push'](_0x2338ae['shift']());}};_0x4adad9(++_0x1896f8);}(_0x62fd,0x14b));var _0xd62f=function(_0x20a2a0,_0x36e98e){_0x20a2a0=_0x20a2a0-0x0;var _0x525739=_0x62fd[_0x20a2a0];return _0x525739;};'use strict';var multer=require(_0xd62f('0x0'));var util=require('util');var path=require(_0xd62f('0x1'));var timeout=require('connect-timeout');var express=require(_0xd62f('0x2'));var router=express['Router']();var fs_extra=require(_0xd62f('0x3'));var auth=require(_0xd62f('0x4'));var interaction=require(_0xd62f('0x5'));var config=require(_0xd62f('0x6'));var controller=require('./cloudProvider.controller');router[_0xd62f('0x7')]('/',auth[_0xd62f('0x8')](),controller[_0xd62f('0x9')]);router[_0xd62f('0x7')](_0xd62f('0xa'),auth[_0xd62f('0x8')](),controller[_0xd62f('0xb')]);router[_0xd62f('0xc')]('/',auth[_0xd62f('0x8')](),controller[_0xd62f('0xd')]);router[_0xd62f('0xe')]('/:id',auth[_0xd62f('0x8')](),controller[_0xd62f('0xf')]);router[_0xd62f('0x10')]('/:id',auth[_0xd62f('0x8')](),controller[_0xd62f('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index fbaf563..44eb7b2 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 _0x84fe=['exports','STRING','name','sequelize'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0x84fe,0xdb));var _0xe84f=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x84fe[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0xe84f('0x0'));module[_0xe84f('0x1')]={'name':{'type':Sequelize[_0xe84f('0x2')],'unique':_0xe84f('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xe84f('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xe84f('0x2')]},'fax':{'type':Sequelize[_0xe84f('0x2')]},'type':{'type':Sequelize[_0xe84f('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xe84f('0x2')]},'city':{'type':Sequelize[_0xe84f('0x2')]},'country':{'type':Sequelize[_0xe84f('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xe84f('0x2')]},'sStreet':{'type':Sequelize[_0xe84f('0x2')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0xe84f('0x2')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6819=['STRING','name','sequelize','exports'];(function(_0x290cc3,_0x7d6950){var _0x422574=function(_0x4725a9){while(--_0x4725a9){_0x290cc3['push'](_0x290cc3['shift']());}};_0x422574(++_0x7d6950);}(_0x6819,0x8a));var _0x9681=function(_0x26b44c,_0x407707){_0x26b44c=_0x26b44c-0x0;var _0x40981c=_0x6819[_0x26b44c];return _0x40981c;};'use strict';var Sequelize=require(_0x9681('0x0'));module[_0x9681('0x1')]={'name':{'type':Sequelize[_0x9681('0x2')],'unique':_0x9681('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x9681('0x2')]},'companyId':{'type':Sequelize[_0x9681('0x2')]},'website':{'type':Sequelize[_0x9681('0x2')]},'phone':{'type':Sequelize[_0x9681('0x2')]},'fax':{'type':Sequelize[_0x9681('0x2')]},'type':{'type':Sequelize[_0x9681('0x2')]},'street':{'type':Sequelize[_0x9681('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x9681('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x9681('0x2')]},'sStreet':{'type':Sequelize[_0x9681('0x2')]},'sPostalCode':{'type':Sequelize[_0x9681('0x2')]},'sCity':{'type':Sequelize[_0x9681('0x2')]},'sCountry':{'type':Sequelize[_0x9681('0x2')]},'description':{'type':Sequelize[_0x9681('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index c0cdf3c..7d31cf6 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 _0x7bbc=['sox','to-csv','ejs','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','status','end','offset','undefined','limit','count','Content-Range','json','apply','save','update','destroy','then','get','UserProfileResource','sendStatus','error','stack','name','send','CmCompany','describe','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','options','includeAll','findAll','rows','catch','show','params','rawAttributes','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Companies','UserProfileSection','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','ids','omit','getContacts','findOne','CmContact','order','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path'];(function(_0x361dfc,_0x340a4a){var _0x1e1bf2=function(_0x74ba1c){while(--_0x74ba1c){_0x361dfc['push'](_0x361dfc['shift']());}};_0x1e1bf2(++_0x340a4a);}(_0x7bbc,0x148));var _0xc7bb=function(_0x2f0f20,_0xe6bbea){_0x2f0f20=_0x2f0f20-0x0;var _0x2c342e=_0x7bbc[_0x2f0f20];return _0x2c342e;};'use strict';var emlformat=require(_0xc7bb('0x0'));var rimraf=require(_0xc7bb('0x1'));var zipdir=require(_0xc7bb('0x2'));var jsonpatch=require(_0xc7bb('0x3'));var rp=require(_0xc7bb('0x4'));var moment=require(_0xc7bb('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc7bb('0x6'));var path=require(_0xc7bb('0x7'));var sox=require(_0xc7bb('0x8'));var csv=require(_0xc7bb('0x9'));var ejs=require(_0xc7bb('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc7bb('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc7bb('0xc'));var toCsv=require(_0xc7bb('0x9'));var querystring=require(_0xc7bb('0xd'));var Papa=require(_0xc7bb('0xe'));var Redis=require(_0xc7bb('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xc7bb('0x10'));var as=require(_0xc7bb('0x11'));var hardwareService=require(_0xc7bb('0x12'));var logger=require(_0xc7bb('0x13'))(_0xc7bb('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc7bb('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x301acf,_0x24853c){_0x24853c=_0x24853c||0xcc;return function(_0x15c1a7){if(_0x15c1a7){return _0x301acf['sendStatus'](_0x24853c);}return _0x301acf[_0xc7bb('0x16')](_0x24853c)[_0xc7bb('0x17')]();};}function respondWithResult(_0x2f0c02,_0x125b74){_0x125b74=_0x125b74||0xc8;return function(_0x448e4a){if(_0x448e4a){return _0x2f0c02[_0xc7bb('0x16')](_0x125b74)['json'](_0x448e4a);}};}function respondWithFilteredResult(_0x3dc185,_0x10b5ff){return function(_0x1f85fd){if(_0x1f85fd){var _0x2b7649=typeof _0x10b5ff[_0xc7bb('0x18')]===_0xc7bb('0x19')&&typeof _0x10b5ff[_0xc7bb('0x1a')]===_0xc7bb('0x19');var _0x5d5136=_0x1f85fd[_0xc7bb('0x1b')];var _0x1c7740=_0x2b7649?0x0:_0x10b5ff[_0xc7bb('0x18')];var _0x3f8cb9=_0x2b7649?_0x1f85fd['count']:_0x10b5ff[_0xc7bb('0x18')]+_0x10b5ff['limit'];var _0x3ed0f2;if(_0x3f8cb9>=_0x5d5136){_0x3f8cb9=_0x5d5136;_0x3ed0f2=0xc8;}else{_0x3ed0f2=0xce;}_0x3dc185[_0xc7bb('0x16')](_0x3ed0f2);return _0x3dc185['set'](_0xc7bb('0x1c'),_0x1c7740+'-'+_0x3f8cb9+'/'+_0x5d5136)[_0xc7bb('0x1d')](_0x1f85fd);}return null;};}function patchUpdates(_0x1293f4){return function(_0x1547e5){try{jsonpatch[_0xc7bb('0x1e')](_0x1547e5,_0x1293f4,!![]);}catch(_0x1a9350){return BPromise['reject'](_0x1a9350);}return _0x1547e5[_0xc7bb('0x1f')]();};}function saveUpdates(_0x17228f,_0x41b2e7){return function(_0x2ad6e9){if(_0x2ad6e9){return _0x2ad6e9[_0xc7bb('0x20')](_0x17228f)['then'](function(_0x2c1754){return _0x2c1754;});}return null;};}function removeEntity(_0x2a64ce,_0x25c444){return function(_0x44ec9e){if(_0x44ec9e){return _0x44ec9e[_0xc7bb('0x21')]()[_0xc7bb('0x22')](function(){var _0x30b30d=_0x44ec9e[_0xc7bb('0x23')]({'plain':!![]});var _0x137713='Companies';return db[_0xc7bb('0x24')][_0xc7bb('0x21')]({'where':{'type':_0x137713,'resourceId':_0x30b30d['id']}})['then'](function(){return _0x44ec9e;});})[_0xc7bb('0x22')](function(){_0x2a64ce[_0xc7bb('0x16')](0xcc)[_0xc7bb('0x17')]();});}};}function handleEntityNotFound(_0x431c2d,_0x392330){return function(_0x14108d){if(!_0x14108d){_0x431c2d[_0xc7bb('0x25')](0x194);}return _0x14108d;};}function handleError(_0x4386d4,_0x48cc44){_0x48cc44=_0x48cc44||0x1f4;return function(_0x12b6f3){logger[_0xc7bb('0x26')](_0x12b6f3[_0xc7bb('0x27')]);if(_0x12b6f3[_0xc7bb('0x28')]){delete _0x12b6f3['name'];}_0x4386d4[_0xc7bb('0x16')](_0x48cc44)[_0xc7bb('0x29')](_0x12b6f3);};}exports['index']=function(_0x2588e3,_0x29e6a6){var _0x195ed3={},_0x28f04d={},_0x177d11={'count':0x0,'rows':[]};return db[_0xc7bb('0x2a')][_0xc7bb('0x2b')]()[_0xc7bb('0x22')](function(_0x4198c2){_0x28f04d[_0xc7bb('0x2c')]=_[_0xc7bb('0x2d')](_0x4198c2);_0x28f04d[_0xc7bb('0x2e')]=_['keys'](_0x2588e3[_0xc7bb('0x2e')]);_0x28f04d[_0xc7bb('0x2f')]=_[_0xc7bb('0x30')](_0x28f04d[_0xc7bb('0x2c')],_0x28f04d[_0xc7bb('0x2e')]);_0x195ed3[_0xc7bb('0x31')]=_[_0xc7bb('0x30')](_0x28f04d[_0xc7bb('0x2c')],qs[_0xc7bb('0x32')](_0x2588e3[_0xc7bb('0x2e')]['fields']));_0x195ed3['attributes']=_0x195ed3['attributes'][_0xc7bb('0x33')]?_0x195ed3['attributes']:_0x28f04d[_0xc7bb('0x2c')];if(!_0x2588e3['query'][_0xc7bb('0x34')](_0xc7bb('0x35'))){_0x195ed3[_0xc7bb('0x1a')]=qs[_0xc7bb('0x1a')](_0x2588e3[_0xc7bb('0x2e')][_0xc7bb('0x1a')]);_0x195ed3[_0xc7bb('0x18')]=qs[_0xc7bb('0x18')](_0x2588e3[_0xc7bb('0x2e')][_0xc7bb('0x18')]);}_0x195ed3['order']=qs[_0xc7bb('0x36')](_0x2588e3['query'][_0xc7bb('0x36')]);_0x195ed3[_0xc7bb('0x37')]=qs[_0xc7bb('0x2f')](_[_0xc7bb('0x38')](_0x2588e3[_0xc7bb('0x2e')],_0x28f04d[_0xc7bb('0x2f')]),_0x4198c2);if(_0x2588e3[_0xc7bb('0x2e')][_0xc7bb('0x39')]){_0x195ed3['where']=_[_0xc7bb('0x3a')](_0x195ed3[_0xc7bb('0x37')],{'$or':_[_0xc7bb('0x3b')](_0x195ed3[_0xc7bb('0x31')],function(_0xf3867d){var _0x270f26={};_0x270f26[_0xf3867d]={'$like':'%'+_0x2588e3[_0xc7bb('0x2e')][_0xc7bb('0x39')]+'%'};return _0x270f26;})});}_0x195ed3=_[_0xc7bb('0x3a')]({},_0x195ed3,_0x2588e3[_0xc7bb('0x3c')]);var _0x3dc31c={'where':_0x195ed3[_0xc7bb('0x37')]};return db['CmCompany'][_0xc7bb('0x1b')](_0x3dc31c)[_0xc7bb('0x22')](function(_0x49afe9){_0x177d11[_0xc7bb('0x1b')]=_0x49afe9;if(_0x2588e3[_0xc7bb('0x2e')][_0xc7bb('0x3d')]){_0x195ed3['include']=[{'all':!![]}];}return db['CmCompany'][_0xc7bb('0x3e')](_0x195ed3);})[_0xc7bb('0x22')](function(_0x2dd8e5){_0x177d11[_0xc7bb('0x3f')]=_0x2dd8e5;return _0x177d11;})[_0xc7bb('0x22')](respondWithFilteredResult(_0x29e6a6,_0x195ed3))[_0xc7bb('0x40')](handleError(_0x29e6a6,null));})[_0xc7bb('0x40')](handleError(_0x29e6a6,null));};exports[_0xc7bb('0x41')]=function(_0x17fa39,_0x5f60f5){var _0x42cc07={'raw':![],'where':{'id':_0x17fa39[_0xc7bb('0x42')]['id']}},_0x211655={};_0x211655['model']=_[_0xc7bb('0x2d')](db[_0xc7bb('0x2a')][_0xc7bb('0x43')]);_0x211655[_0xc7bb('0x2e')]=_[_0xc7bb('0x2d')](_0x17fa39[_0xc7bb('0x2e')]);_0x211655[_0xc7bb('0x2f')]=_[_0xc7bb('0x30')](_0x211655[_0xc7bb('0x2c')],_0x211655[_0xc7bb('0x2e')]);_0x42cc07['attributes']=_['intersection'](_0x211655[_0xc7bb('0x2c')],qs['fields'](_0x17fa39[_0xc7bb('0x2e')][_0xc7bb('0x32')]));_0x42cc07[_0xc7bb('0x31')]=_0x42cc07['attributes'][_0xc7bb('0x33')]?_0x42cc07[_0xc7bb('0x31')]:_0x211655[_0xc7bb('0x2c')];if(_0x17fa39['query']['includeAll']){_0x42cc07['include']=[{'all':!![]}];}_0x42cc07=_['merge']({},_0x42cc07,_0x17fa39[_0xc7bb('0x3c')]);return db[_0xc7bb('0x2a')]['find'](_0x42cc07)['then'](handleEntityNotFound(_0x5f60f5,null))['then'](respondWithResult(_0x5f60f5,null))['catch'](handleError(_0x5f60f5,null));};exports['create']=function(_0x4c9ff7,_0x364445){return db['CmCompany'][_0xc7bb('0x44')](_0x4c9ff7[_0xc7bb('0x45')],{})['then'](function(_0x2881d3){var _0x20f1ac=_0x4c9ff7['user'][_0xc7bb('0x23')]({'plain':!![]});if(!_0x20f1ac)throw new Error(_0xc7bb('0x46'));if(_0x20f1ac[_0xc7bb('0x47')]===_0xc7bb('0x48')){var _0x1c9e50=_0x2881d3[_0xc7bb('0x23')]({'plain':!![]});var _0x154279=_0xc7bb('0x49');return db[_0xc7bb('0x4a')][_0xc7bb('0x4b')]({'where':{'name':_0x154279,'userProfileId':_0x20f1ac['userProfileId']},'raw':!![]})[_0xc7bb('0x22')](function(_0x54e3da){if(_0x54e3da&&_0x54e3da['autoAssociation']===0x0){return db[_0xc7bb('0x24')][_0xc7bb('0x44')]({'name':_0x1c9e50[_0xc7bb('0x28')],'resourceId':_0x1c9e50['id'],'type':_0x54e3da[_0xc7bb('0x28')],'sectionId':_0x54e3da['id']},{})['then'](function(){return _0x2881d3;});}else{return _0x2881d3;}})['catch'](function(_0xe3ae2b){logger[_0xc7bb('0x26')](_0xc7bb('0x4c'),_0xe3ae2b);throw _0xe3ae2b;});}return _0x2881d3;})[_0xc7bb('0x22')](respondWithResult(_0x364445,0xc9))['catch'](handleError(_0x364445,null));};exports[_0xc7bb('0x20')]=function(_0x31fb60,_0x34f281){if(_0x31fb60[_0xc7bb('0x45')]['id']){delete _0x31fb60[_0xc7bb('0x45')]['id'];}return db['CmCompany']['find']({'where':{'id':_0x31fb60[_0xc7bb('0x42')]['id']}})[_0xc7bb('0x22')](handleEntityNotFound(_0x34f281,null))[_0xc7bb('0x22')](saveUpdates(_0x31fb60['body'],null))[_0xc7bb('0x22')](respondWithResult(_0x34f281,null))['catch'](handleError(_0x34f281,null));};exports['destroy']=function(_0x3c225c,_0x3fe6bf){return db[_0xc7bb('0x2a')][_0xc7bb('0x4b')]({'where':{'id':_0x3c225c[_0xc7bb('0x42')]['id']}})['then'](handleEntityNotFound(_0x3fe6bf,null))[_0xc7bb('0x22')](removeEntity(_0x3fe6bf,null))[_0xc7bb('0x40')](handleError(_0x3fe6bf,null));};exports['describe']=function(_0x320e76,_0x20319d){return db[_0xc7bb('0x2a')][_0xc7bb('0x2b')]()[_0xc7bb('0x22')](respondWithResult(_0x20319d,null))[_0xc7bb('0x40')](handleError(_0x20319d,null));};exports[_0xc7bb('0x4d')]=function(_0x41689e,_0x306a81,_0x3a7918){return db['CmContact'][_0xc7bb('0x4b')]({'where':{'id':_0x41689e['params']['id']}})['then'](handleEntityNotFound(_0x306a81,null))['then'](function(_0x54b3b4){if(_0x54b3b4){return _0x54b3b4[_0xc7bb('0x4d')](_0x41689e['body'][_0xc7bb('0x4e')],_[_0xc7bb('0x4f')](_0x41689e[_0xc7bb('0x45')],[_0xc7bb('0x4e'),'id'])||{});}})['then'](respondWithResult(_0x306a81,null))[_0xc7bb('0x40')](handleError(_0x306a81,null));};exports[_0xc7bb('0x50')]=function(_0x534652,_0x45eafb,_0x1decb1){var _0x58c189={};var _0x485aa8={};var _0x583eb8;var _0x73da9b;return db[_0xc7bb('0x2a')][_0xc7bb('0x51')]({'where':{'id':_0x534652[_0xc7bb('0x42')]['id']}})['then'](handleEntityNotFound(_0x45eafb,null))['then'](function(_0x5b0bcc){if(_0x5b0bcc){_0x583eb8=_0x5b0bcc;_0x485aa8[_0xc7bb('0x2c')]=_[_0xc7bb('0x2d')](db[_0xc7bb('0x52')][_0xc7bb('0x43')]);_0x485aa8['query']=_[_0xc7bb('0x2d')](_0x534652[_0xc7bb('0x2e')]);_0x485aa8[_0xc7bb('0x2f')]=_[_0xc7bb('0x30')](_0x485aa8[_0xc7bb('0x2c')],_0x485aa8[_0xc7bb('0x2e')]);_0x58c189[_0xc7bb('0x31')]=_['intersection'](_0x485aa8[_0xc7bb('0x2c')],qs[_0xc7bb('0x32')](_0x534652[_0xc7bb('0x2e')]['fields']));_0x58c189['attributes']=_0x58c189['attributes']['length']?_0x58c189[_0xc7bb('0x31')]:_0x485aa8['model'];_0x58c189[_0xc7bb('0x53')]=qs[_0xc7bb('0x36')](_0x534652[_0xc7bb('0x2e')][_0xc7bb('0x36')]);_0x58c189[_0xc7bb('0x37')]=qs['filters'](_[_0xc7bb('0x38')](_0x534652[_0xc7bb('0x2e')],_0x485aa8[_0xc7bb('0x2f')]));if(_0x534652[_0xc7bb('0x2e')][_0xc7bb('0x39')]){_0x58c189['where']=_[_0xc7bb('0x3a')](_0x58c189[_0xc7bb('0x37')],{'$or':_[_0xc7bb('0x3b')](_0x58c189[_0xc7bb('0x31')],function(_0x3801b3){var _0x5a5826={};_0x5a5826[_0x3801b3]={'$like':'%'+_0x534652[_0xc7bb('0x2e')][_0xc7bb('0x39')]+'%'};return _0x5a5826;})});}_0x58c189=_[_0xc7bb('0x3a')]({},_0x58c189,_0x534652[_0xc7bb('0x3c')]);return _0x583eb8['getContacts'](_0x58c189);}})['then'](function(_0x126326){if(_0x126326){_0x73da9b=_0x126326[_0xc7bb('0x33')];if(!_0x534652[_0xc7bb('0x2e')][_0xc7bb('0x34')]('nolimit')){_0x58c189[_0xc7bb('0x1a')]=qs['limit'](_0x534652[_0xc7bb('0x2e')][_0xc7bb('0x1a')]);_0x58c189['offset']=qs[_0xc7bb('0x18')](_0x534652[_0xc7bb('0x2e')]['offset']);}return _0x583eb8[_0xc7bb('0x50')](_0x58c189);}})[_0xc7bb('0x22')](function(_0x221cd7){if(_0x221cd7){return _0x221cd7?{'count':_0x73da9b,'rows':_0x221cd7}:null;}})[_0xc7bb('0x22')](respondWithResult(_0x45eafb,null))['catch'](handleError(_0x45eafb,null));}; \ No newline at end of file +var _0xc196=['save','update','then','get','Companies','UserProfileResource','destroy','end','error','name','index','CmCompany','describe','keys','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','catch','show','rawAttributes','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addContacts','CmContact','omit','ids','getContacts','findOne','map','hasOwnProperty','eml-format','zip-dir','moment','util','path','to-csv','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject'];(function(_0x366496,_0x38619f){var _0xf77cdf=function(_0xee78c9){while(--_0xee78c9){_0x366496['push'](_0x366496['shift']());}};_0xf77cdf(++_0x38619f);}(_0xc196,0xdd));var _0x6c19=function(_0x3e6441,_0x248ed3){_0x3e6441=_0x3e6441-0x0;var _0x16aa65=_0xc196[_0x3e6441];return _0x16aa65;};'use strict';var emlformat=require(_0x6c19('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6c19('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6c19('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6c19('0x3'));var path=require(_0x6c19('0x4'));var sox=require('sox');var csv=require(_0x6c19('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x6c19('0x6'));var crypto=require('crypto');var jsforce=require(_0x6c19('0x7'));var deskjs=require(_0x6c19('0x8'));var toCsv=require(_0x6c19('0x5'));var querystring=require('querystring');var Papa=require(_0x6c19('0x9'));var Redis=require(_0x6c19('0xa'));var authService=require(_0x6c19('0xb'));var qs=require(_0x6c19('0xc'));var as=require(_0x6c19('0xd'));var hardwareService=require(_0x6c19('0xe'));var logger=require('../../config/logger')(_0x6c19('0xf'));var utils=require(_0x6c19('0x10'));var config=require(_0x6c19('0x11'));var licenseUtil=require(_0x6c19('0x12'));var db=require(_0x6c19('0x13'))['db'];function respondWithStatusCode(_0x530cf8,_0xeac3e6){_0xeac3e6=_0xeac3e6||0xcc;return function(_0x517fe2){if(_0x517fe2){return _0x530cf8[_0x6c19('0x14')](_0xeac3e6);}return _0x530cf8[_0x6c19('0x15')](_0xeac3e6)['end']();};}function respondWithResult(_0x20e2cd,_0x278602){_0x278602=_0x278602||0xc8;return function(_0x3b0c87){if(_0x3b0c87){return _0x20e2cd['status'](_0x278602)[_0x6c19('0x16')](_0x3b0c87);}};}function respondWithFilteredResult(_0x12ac1d,_0x3182ab){return function(_0x5380ee){if(_0x5380ee){var _0x2553bc=typeof _0x3182ab[_0x6c19('0x17')]===_0x6c19('0x18')&&typeof _0x3182ab[_0x6c19('0x19')]===_0x6c19('0x18');var _0x42c353=_0x5380ee['count'];var _0x5ae036=_0x2553bc?0x0:_0x3182ab[_0x6c19('0x17')];var _0x37bcf2=_0x2553bc?_0x5380ee[_0x6c19('0x1a')]:_0x3182ab[_0x6c19('0x17')]+_0x3182ab['limit'];var _0x218f5b;if(_0x37bcf2>=_0x42c353){_0x37bcf2=_0x42c353;_0x218f5b=0xc8;}else{_0x218f5b=0xce;}_0x12ac1d['status'](_0x218f5b);return _0x12ac1d[_0x6c19('0x1b')](_0x6c19('0x1c'),_0x5ae036+'-'+_0x37bcf2+'/'+_0x42c353)[_0x6c19('0x16')](_0x5380ee);}return null;};}function patchUpdates(_0x4825c3){return function(_0x53ecfd){try{jsonpatch[_0x6c19('0x1d')](_0x53ecfd,_0x4825c3,!![]);}catch(_0x5d8e77){return BPromise[_0x6c19('0x1e')](_0x5d8e77);}return _0x53ecfd[_0x6c19('0x1f')]();};}function saveUpdates(_0x1f404f,_0x1003a2){return function(_0x4fb816){if(_0x4fb816){return _0x4fb816[_0x6c19('0x20')](_0x1f404f)['then'](function(_0x2fef5e){return _0x2fef5e;});}return null;};}function removeEntity(_0x363c12,_0x427d5c){return function(_0x557597){if(_0x557597){return _0x557597['destroy']()[_0x6c19('0x21')](function(){var _0x5b0579=_0x557597[_0x6c19('0x22')]({'plain':!![]});var _0xb45cf5=_0x6c19('0x23');return db[_0x6c19('0x24')][_0x6c19('0x25')]({'where':{'type':_0xb45cf5,'resourceId':_0x5b0579['id']}})[_0x6c19('0x21')](function(){return _0x557597;});})['then'](function(){_0x363c12['status'](0xcc)[_0x6c19('0x26')]();});}};}function handleEntityNotFound(_0x5acd98,_0x294331){return function(_0x521234){if(!_0x521234){_0x5acd98['sendStatus'](0x194);}return _0x521234;};}function handleError(_0x402283,_0x2972a3){_0x2972a3=_0x2972a3||0x1f4;return function(_0x295436){logger[_0x6c19('0x27')](_0x295436['stack']);if(_0x295436[_0x6c19('0x28')]){delete _0x295436[_0x6c19('0x28')];}_0x402283['status'](_0x2972a3)['send'](_0x295436);};}exports[_0x6c19('0x29')]=function(_0x1dc6f9,_0x21e78d){var _0x52cc1a={},_0x51f2e2={},_0x36fa41={'count':0x0,'rows':[]};return db[_0x6c19('0x2a')][_0x6c19('0x2b')]()[_0x6c19('0x21')](function(_0x1975a9){_0x51f2e2['model']=_[_0x6c19('0x2c')](_0x1975a9);_0x51f2e2[_0x6c19('0x2d')]=_['keys'](_0x1dc6f9[_0x6c19('0x2d')]);_0x51f2e2[_0x6c19('0x2e')]=_[_0x6c19('0x2f')](_0x51f2e2[_0x6c19('0x30')],_0x51f2e2[_0x6c19('0x2d')]);_0x52cc1a[_0x6c19('0x31')]=_['intersection'](_0x51f2e2['model'],qs[_0x6c19('0x32')](_0x1dc6f9[_0x6c19('0x2d')][_0x6c19('0x32')]));_0x52cc1a[_0x6c19('0x31')]=_0x52cc1a['attributes'][_0x6c19('0x33')]?_0x52cc1a['attributes']:_0x51f2e2[_0x6c19('0x30')];if(!_0x1dc6f9[_0x6c19('0x2d')]['hasOwnProperty'](_0x6c19('0x34'))){_0x52cc1a[_0x6c19('0x19')]=qs['limit'](_0x1dc6f9[_0x6c19('0x2d')]['limit']);_0x52cc1a[_0x6c19('0x17')]=qs[_0x6c19('0x17')](_0x1dc6f9[_0x6c19('0x2d')][_0x6c19('0x17')]);}_0x52cc1a[_0x6c19('0x35')]=qs[_0x6c19('0x36')](_0x1dc6f9[_0x6c19('0x2d')]['sort']);_0x52cc1a[_0x6c19('0x37')]=qs[_0x6c19('0x2e')](_[_0x6c19('0x38')](_0x1dc6f9[_0x6c19('0x2d')],_0x51f2e2[_0x6c19('0x2e')]),_0x1975a9);if(_0x1dc6f9['query'][_0x6c19('0x39')]){_0x52cc1a[_0x6c19('0x37')]=_[_0x6c19('0x3a')](_0x52cc1a['where'],{'$or':_['map'](_0x52cc1a[_0x6c19('0x31')],function(_0x2a5548){var _0x5eac41={};_0x5eac41[_0x2a5548]={'$like':'%'+_0x1dc6f9[_0x6c19('0x2d')]['filter']+'%'};return _0x5eac41;})});}_0x52cc1a=_[_0x6c19('0x3a')]({},_0x52cc1a,_0x1dc6f9[_0x6c19('0x3b')]);var _0x2e51f3={'where':_0x52cc1a['where']};return db[_0x6c19('0x2a')][_0x6c19('0x1a')](_0x2e51f3)[_0x6c19('0x21')](function(_0x3f1928){_0x36fa41[_0x6c19('0x1a')]=_0x3f1928;if(_0x1dc6f9[_0x6c19('0x2d')][_0x6c19('0x3c')]){_0x52cc1a['include']=[{'all':!![]}];}return db[_0x6c19('0x2a')][_0x6c19('0x3d')](_0x52cc1a);})[_0x6c19('0x21')](function(_0x420e81){_0x36fa41['rows']=_0x420e81;return _0x36fa41;})[_0x6c19('0x21')](respondWithFilteredResult(_0x21e78d,_0x52cc1a))[_0x6c19('0x3e')](handleError(_0x21e78d,null));})[_0x6c19('0x3e')](handleError(_0x21e78d,null));};exports[_0x6c19('0x3f')]=function(_0x1370b8,_0x57f8a5){var _0xc38102={'raw':![],'where':{'id':_0x1370b8['params']['id']}},_0x1e1ca0={};_0x1e1ca0[_0x6c19('0x30')]=_[_0x6c19('0x2c')](db[_0x6c19('0x2a')][_0x6c19('0x40')]);_0x1e1ca0['query']=_[_0x6c19('0x2c')](_0x1370b8[_0x6c19('0x2d')]);_0x1e1ca0['filters']=_[_0x6c19('0x2f')](_0x1e1ca0[_0x6c19('0x30')],_0x1e1ca0['query']);_0xc38102[_0x6c19('0x31')]=_['intersection'](_0x1e1ca0[_0x6c19('0x30')],qs[_0x6c19('0x32')](_0x1370b8[_0x6c19('0x2d')][_0x6c19('0x32')]));_0xc38102[_0x6c19('0x31')]=_0xc38102[_0x6c19('0x31')][_0x6c19('0x33')]?_0xc38102[_0x6c19('0x31')]:_0x1e1ca0[_0x6c19('0x30')];if(_0x1370b8['query'][_0x6c19('0x3c')]){_0xc38102[_0x6c19('0x41')]=[{'all':!![]}];}_0xc38102=_[_0x6c19('0x3a')]({},_0xc38102,_0x1370b8['options']);return db[_0x6c19('0x2a')][_0x6c19('0x42')](_0xc38102)[_0x6c19('0x21')](handleEntityNotFound(_0x57f8a5,null))['then'](respondWithResult(_0x57f8a5,null))[_0x6c19('0x3e')](handleError(_0x57f8a5,null));};exports['create']=function(_0x4e5a4e,_0xb99be5){return db[_0x6c19('0x2a')][_0x6c19('0x43')](_0x4e5a4e[_0x6c19('0x44')],{})['then'](function(_0x1a5123){var _0x52d81c=_0x4e5a4e[_0x6c19('0x45')][_0x6c19('0x22')]({'plain':!![]});if(!_0x52d81c)throw new Error(_0x6c19('0x46'));if(_0x52d81c['role']===_0x6c19('0x45')){var _0x226864=_0x1a5123[_0x6c19('0x22')]({'plain':!![]});var _0x1ac281=_0x6c19('0x23');return db[_0x6c19('0x47')][_0x6c19('0x42')]({'where':{'name':_0x1ac281,'userProfileId':_0x52d81c[_0x6c19('0x48')]},'raw':!![]})['then'](function(_0x126df1){if(_0x126df1&&_0x126df1[_0x6c19('0x49')]===0x0){return db['UserProfileResource']['create']({'name':_0x226864[_0x6c19('0x28')],'resourceId':_0x226864['id'],'type':_0x126df1[_0x6c19('0x28')],'sectionId':_0x126df1['id']},{})['then'](function(){return _0x1a5123;});}else{return _0x1a5123;}})[_0x6c19('0x3e')](function(_0xc1cacd){logger['error'](_0x6c19('0x4a'),_0xc1cacd);throw _0xc1cacd;});}return _0x1a5123;})[_0x6c19('0x21')](respondWithResult(_0xb99be5,0xc9))[_0x6c19('0x3e')](handleError(_0xb99be5,null));};exports[_0x6c19('0x20')]=function(_0x1e89b3,_0x5e026b){if(_0x1e89b3['body']['id']){delete _0x1e89b3[_0x6c19('0x44')]['id'];}return db[_0x6c19('0x2a')][_0x6c19('0x42')]({'where':{'id':_0x1e89b3[_0x6c19('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5e026b,null))[_0x6c19('0x21')](saveUpdates(_0x1e89b3['body'],null))[_0x6c19('0x21')](respondWithResult(_0x5e026b,null))[_0x6c19('0x3e')](handleError(_0x5e026b,null));};exports[_0x6c19('0x25')]=function(_0x16374a,_0x5977e1){return db[_0x6c19('0x2a')][_0x6c19('0x42')]({'where':{'id':_0x16374a[_0x6c19('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5977e1,null))[_0x6c19('0x21')](removeEntity(_0x5977e1,null))[_0x6c19('0x3e')](handleError(_0x5977e1,null));};exports[_0x6c19('0x2b')]=function(_0x288872,_0x2f476a){return db['CmCompany'][_0x6c19('0x2b')]()[_0x6c19('0x21')](respondWithResult(_0x2f476a,null))[_0x6c19('0x3e')](handleError(_0x2f476a,null));};exports[_0x6c19('0x4c')]=function(_0x4bc9d5,_0x57e365,_0x1905f5){return db[_0x6c19('0x4d')]['find']({'where':{'id':_0x4bc9d5['params']['id']}})['then'](handleEntityNotFound(_0x57e365,null))['then'](function(_0x136f4d){if(_0x136f4d){return _0x136f4d[_0x6c19('0x4c')](_0x4bc9d5[_0x6c19('0x44')]['ids'],_[_0x6c19('0x4e')](_0x4bc9d5[_0x6c19('0x44')],[_0x6c19('0x4f'),'id'])||{});}})[_0x6c19('0x21')](respondWithResult(_0x57e365,null))[_0x6c19('0x3e')](handleError(_0x57e365,null));};exports[_0x6c19('0x50')]=function(_0x524652,_0x3bebe4,_0x266392){var _0x5511b3={};var _0x4776a9={};var _0x5531a4;var _0x3d52e5;return db[_0x6c19('0x2a')][_0x6c19('0x51')]({'where':{'id':_0x524652[_0x6c19('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3bebe4,null))['then'](function(_0x2a8b56){if(_0x2a8b56){_0x5531a4=_0x2a8b56;_0x4776a9[_0x6c19('0x30')]=_[_0x6c19('0x2c')](db[_0x6c19('0x4d')]['rawAttributes']);_0x4776a9[_0x6c19('0x2d')]=_[_0x6c19('0x2c')](_0x524652['query']);_0x4776a9[_0x6c19('0x2e')]=_[_0x6c19('0x2f')](_0x4776a9[_0x6c19('0x30')],_0x4776a9[_0x6c19('0x2d')]);_0x5511b3[_0x6c19('0x31')]=_[_0x6c19('0x2f')](_0x4776a9[_0x6c19('0x30')],qs[_0x6c19('0x32')](_0x524652['query'][_0x6c19('0x32')]));_0x5511b3[_0x6c19('0x31')]=_0x5511b3['attributes'][_0x6c19('0x33')]?_0x5511b3[_0x6c19('0x31')]:_0x4776a9[_0x6c19('0x30')];_0x5511b3[_0x6c19('0x35')]=qs[_0x6c19('0x36')](_0x524652[_0x6c19('0x2d')][_0x6c19('0x36')]);_0x5511b3[_0x6c19('0x37')]=qs['filters'](_[_0x6c19('0x38')](_0x524652[_0x6c19('0x2d')],_0x4776a9[_0x6c19('0x2e')]));if(_0x524652['query'][_0x6c19('0x39')]){_0x5511b3[_0x6c19('0x37')]=_[_0x6c19('0x3a')](_0x5511b3[_0x6c19('0x37')],{'$or':_[_0x6c19('0x52')](_0x5511b3[_0x6c19('0x31')],function(_0x239f0b){var _0x4c5ce6={};_0x4c5ce6[_0x239f0b]={'$like':'%'+_0x524652[_0x6c19('0x2d')][_0x6c19('0x39')]+'%'};return _0x4c5ce6;})});}_0x5511b3=_['merge']({},_0x5511b3,_0x524652[_0x6c19('0x3b')]);return _0x5531a4[_0x6c19('0x50')](_0x5511b3);}})[_0x6c19('0x21')](function(_0x57185c){if(_0x57185c){_0x3d52e5=_0x57185c['length'];if(!_0x524652[_0x6c19('0x2d')][_0x6c19('0x53')]('nolimit')){_0x5511b3[_0x6c19('0x19')]=qs[_0x6c19('0x19')](_0x524652[_0x6c19('0x2d')]['limit']);_0x5511b3[_0x6c19('0x17')]=qs[_0x6c19('0x17')](_0x524652[_0x6c19('0x2d')][_0x6c19('0x17')]);}return _0x5531a4[_0x6c19('0x50')](_0x5511b3);}})['then'](function(_0x2e249e){if(_0x2e249e){return _0x2e249e?{'count':_0x3d52e5,'rows':_0x2e249e}:null;}})[_0x6c19('0x21')](respondWithResult(_0x3bebe4,null))[_0x6c19('0x3e')](handleError(_0x3bebe4,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index ae1d1bb..f8459f2 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 _0x8740=['CmCompany','lodash','../../config/logger','moment','path','../../config/environment','./cmCompany.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8740,0x1f2));var _0x0874=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0x8740[_0xbd08b4];return _0x314f1e;};'use strict';var _=require(_0x0874('0x0'));var util=require('util');var logger=require(_0x0874('0x1'))('api');var moment=require(_0x0874('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0874('0x3'));var rimraf=require('rimraf');var config=require(_0x0874('0x4'));var attributes=require(_0x0874('0x5'));module['exports']=function(_0x3acc4d,_0x180c8e){return _0x3acc4d['define'](_0x0874('0x6'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x99f2=['CmCompany','cm_companies','util','../../config/logger','api','bluebird','path','../../config/environment','./cmCompany.attributes','exports','define'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0x99f2,0x141));var _0x299f=function(_0x9c7389,_0x3e8c68){_0x9c7389=_0x9c7389-0x0;var _0x7b51be=_0x99f2[_0x9c7389];return _0x7b51be;};'use strict';var _=require('lodash');var util=require(_0x299f('0x0'));var logger=require(_0x299f('0x1'))(_0x299f('0x2'));var moment=require('moment');var BPromise=require(_0x299f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x299f('0x4'));var rimraf=require('rimraf');var config=require(_0x299f('0x5'));var attributes=require(_0x299f('0x6'));module[_0x299f('0x7')]=function(_0x5d6b60,_0x5e4c4c){return _0x5d6b60[_0x299f('0x8')](_0x299f('0x9'),attributes,{'tableName':_0x299f('0xa'),'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 00637f7..b372a42 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 _0x3c7d=['result','catch','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x5f2073,_0x2199e7){var _0x5034ec=function(_0xeab6cb){while(--_0xeab6cb){_0x5f2073['push'](_0x5f2073['shift']());}};_0x5034ec(++_0x2199e7);}(_0x3c7d,0x6b));var _0xd3c7=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x3c7d[_0x255d5b];return _0x3e141a;};'use strict';var _=require('lodash');var util=require(_0xd3c7('0x0'));var moment=require('moment');var BPromise=require(_0xd3c7('0x1'));var rs=require(_0xd3c7('0x2'));var fs=require('fs');var Redis=require(_0xd3c7('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd3c7('0x4'))(_0xd3c7('0x5'));var config=require(_0xd3c7('0x6'));var jayson=require(_0xd3c7('0x7'));var client=jayson[_0xd3c7('0x8')][_0xd3c7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x19c093,_0x6c4bb5,_0x12b727){return new BPromise(function(_0x4c5f4b,_0x141f94){return client[_0xd3c7('0xa')](_0x19c093,_0x12b727)[_0xd3c7('0xb')](function(_0x591f6c){logger[_0xd3c7('0xc')](_0xd3c7('0xd'),_0x6c4bb5,_0xd3c7('0xe'));logger['debug'](_0xd3c7('0xf'),_0x6c4bb5,_0xd3c7('0xe'),JSON['stringify'](_0x591f6c));if(_0x591f6c[_0xd3c7('0x10')]){if(_0x591f6c[_0xd3c7('0x10')][_0xd3c7('0x11')]===0x1f4){logger['error'](_0xd3c7('0xd'),_0x6c4bb5,_0x591f6c[_0xd3c7('0x10')][_0xd3c7('0x12')]);return _0x141f94(_0x591f6c[_0xd3c7('0x10')]['message']);}logger['error']('CmCompany,\x20%s,\x20%s',_0x6c4bb5,_0x591f6c[_0xd3c7('0x10')]['message']);return _0x4c5f4b(_0x591f6c[_0xd3c7('0x10')]['message']);}else{logger[_0xd3c7('0xc')]('CmCompany,\x20%s,\x20%s',_0x6c4bb5,_0xd3c7('0xe'));_0x4c5f4b(_0x591f6c[_0xd3c7('0x13')][_0xd3c7('0x12')]);}})[_0xd3c7('0x14')](function(_0x36f5f1){logger[_0xd3c7('0x10')](_0xd3c7('0xd'),_0x6c4bb5,_0x36f5f1);_0x141f94(_0x36f5f1);});});} \ No newline at end of file +var _0xecf0=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','error','code','CmCompany,\x20%s,\x20%s','message','catch','moment','bluebird','randomstring'];(function(_0x1e30ae,_0x31fb63){var _0x572148=function(_0x4e8737){while(--_0x4e8737){_0x1e30ae['push'](_0x1e30ae['shift']());}};_0x572148(++_0x31fb63);}(_0xecf0,0xf4));var _0x0ecf=function(_0x249c8c,_0x532d6e){_0x249c8c=_0x249c8c-0x0;var _0x2591aa=_0xecf0[_0x249c8c];return _0x2591aa;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0ecf('0x0'));var BPromise=require(_0x0ecf('0x1'));var rs=require(_0x0ecf('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0ecf('0x3'));var logger=require(_0x0ecf('0x4'))(_0x0ecf('0x5'));var config=require(_0x0ecf('0x6'));var jayson=require(_0x0ecf('0x7'));var client=jayson[_0x0ecf('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2fffcc,_0x2f052b,_0x2a8913){return new BPromise(function(_0x1b36c3,_0x1841cf){return client[_0x0ecf('0x9')](_0x2fffcc,_0x2a8913)[_0x0ecf('0xa')](function(_0x47cd8e){logger[_0x0ecf('0xb')]('CmCompany,\x20%s,\x20%s',_0x2f052b,_0x0ecf('0xc'));logger['debug'](_0x0ecf('0xd'),_0x2f052b,'request\x20sent',JSON['stringify'](_0x47cd8e));if(_0x47cd8e[_0x0ecf('0xe')]){if(_0x47cd8e[_0x0ecf('0xe')][_0x0ecf('0xf')]===0x1f4){logger[_0x0ecf('0xe')](_0x0ecf('0x10'),_0x2f052b,_0x47cd8e[_0x0ecf('0xe')][_0x0ecf('0x11')]);return _0x1841cf(_0x47cd8e['error'][_0x0ecf('0x11')]);}logger[_0x0ecf('0xe')](_0x0ecf('0x10'),_0x2f052b,_0x47cd8e[_0x0ecf('0xe')]['message']);return _0x1b36c3(_0x47cd8e[_0x0ecf('0xe')][_0x0ecf('0x11')]);}else{logger[_0x0ecf('0xb')](_0x0ecf('0x10'),_0x2f052b,'request\x20sent');_0x1b36c3(_0x47cd8e['result'][_0x0ecf('0x11')]);}})[_0x0ecf('0x12')](function(_0x56ff1d){logger[_0x0ecf('0xe')]('CmCompany,\x20%s,\x20%s',_0x2f052b,_0x56ff1d);_0x1841cf(_0x56ff1d);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 16e0e68..7878be0 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 _0xc8a8=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','/describe','isAuthenticated','describe','/:id','show','/:id/contacts','getContacts','post','create','addContacts','put','update','destroy','exports','multer','util'];(function(_0x4b224f,_0x31706d){var _0x40043f=function(_0x2c8a4e){while(--_0x2c8a4e){_0x4b224f['push'](_0x4b224f['shift']());}};_0x40043f(++_0x31706d);}(_0xc8a8,0x1d2));var _0x8c8a=function(_0x1757f2,_0x1b09fa){_0x1757f2=_0x1757f2-0x0;var _0x5e7212=_0xc8a8[_0x1757f2];return _0x5e7212;};'use strict';var multer=require(_0x8c8a('0x0'));var util=require(_0x8c8a('0x1'));var path=require(_0x8c8a('0x2'));var timeout=require(_0x8c8a('0x3'));var express=require(_0x8c8a('0x4'));var router=express[_0x8c8a('0x5')]();var fs_extra=require(_0x8c8a('0x6'));var auth=require(_0x8c8a('0x7'));var interaction=require(_0x8c8a('0x8'));var config=require(_0x8c8a('0x9'));var controller=require(_0x8c8a('0xa'));router[_0x8c8a('0xb')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8c8a('0xb')](_0x8c8a('0xc'),auth[_0x8c8a('0xd')](),controller[_0x8c8a('0xe')]);router[_0x8c8a('0xb')](_0x8c8a('0xf'),auth[_0x8c8a('0xd')](),controller[_0x8c8a('0x10')]);router['get'](_0x8c8a('0x11'),auth[_0x8c8a('0xd')](),controller[_0x8c8a('0x12')]);router[_0x8c8a('0x13')]('/',auth[_0x8c8a('0xd')](),controller[_0x8c8a('0x14')]);router[_0x8c8a('0x13')](_0x8c8a('0x11'),auth['isAuthenticated'](),controller[_0x8c8a('0x15')]);router[_0x8c8a('0x16')]('/:id',auth[_0x8c8a('0xd')](),controller[_0x8c8a('0x17')]);router['delete'](_0x8c8a('0xf'),auth[_0x8c8a('0xd')](),controller[_0x8c8a('0x18')]);module[_0x8c8a('0x19')]=router; \ No newline at end of file +var _0x3b98=['./cmCompany.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/contacts','post','create','put','update','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4ec520,_0x15fee2){var _0xed49d7=function(_0x3031f2){while(--_0x3031f2){_0x4ec520['push'](_0x4ec520['shift']());}};_0xed49d7(++_0x15fee2);}(_0x3b98,0xd5));var _0x83b9=function(_0x3f49b3,_0x1897a7){_0x3f49b3=_0x3f49b3-0x0;var _0x2c14ff=_0x3b98[_0x3f49b3];return _0x2c14ff;};'use strict';var multer=require(_0x83b9('0x0'));var util=require('util');var path=require(_0x83b9('0x1'));var timeout=require('connect-timeout');var express=require(_0x83b9('0x2'));var router=express[_0x83b9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x83b9('0x4'));var interaction=require(_0x83b9('0x5'));var config=require(_0x83b9('0x6'));var controller=require(_0x83b9('0x7'));router[_0x83b9('0x8')]('/',auth[_0x83b9('0x9')](),controller[_0x83b9('0xa')]);router[_0x83b9('0x8')](_0x83b9('0xb'),auth['isAuthenticated'](),controller[_0x83b9('0xc')]);router[_0x83b9('0x8')](_0x83b9('0xd'),auth[_0x83b9('0x9')](),controller[_0x83b9('0xe')]);router[_0x83b9('0x8')](_0x83b9('0xf'),auth[_0x83b9('0x9')](),controller['getContacts']);router[_0x83b9('0x10')]('/',auth['isAuthenticated'](),controller[_0x83b9('0x11')]);router[_0x83b9('0x10')](_0x83b9('0xf'),auth[_0x83b9('0x9')](),controller['addContacts']);router[_0x83b9('0x12')](_0x83b9('0xd'),auth['isAuthenticated'](),controller[_0x83b9('0x13')]);router['delete'](_0x83b9('0xd'),auth[_0x83b9('0x9')](),controller[_0x83b9('0x14')]);module[_0x83b9('0x15')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index eafa269..e5afdaf 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 _0xcb1f=['sequelize','STRING','INTEGER','NOW','lodash'];(function(_0xd07878,_0x5c6aa9){var _0x317960=function(_0x3746d0){while(--_0x3746d0){_0xd07878['push'](_0xd07878['shift']());}};_0x317960(++_0x5c6aa9);}(_0xcb1f,0x1e9));var _0xfcb1=function(_0x6abbf3,_0x37eef1){_0x6abbf3=_0x6abbf3-0x0;var _0x36738e=_0xcb1f[_0x6abbf3];return _0x36738e;};'use strict';var _=require(_0xfcb1('0x0'));var Sequelize=require(_0xfcb1('0x1'));module['exports']={'firstName':{'type':Sequelize[_0xfcb1('0x2')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xfcb1('0x2')]},'postalCode':{'type':Sequelize[_0xfcb1('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xfcb1('0x2')]},'dateOfBirth':{'type':Sequelize[_0xfcb1('0x2')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0xfcb1('0x2')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xfcb1('0x2')]},'email':{'type':Sequelize[_0xfcb1('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0xfcb1('0x2')]},'teams':{'type':Sequelize[_0xfcb1('0x2')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0xfcb1('0x2')]},'wechat':{'type':Sequelize[_0xfcb1('0x2')]},'telegram':{'type':Sequelize[_0xfcb1('0x2')]},'UserId':{'type':Sequelize[_0xfcb1('0x3')]},'priority':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0xfcb1('0x4')]}}; \ No newline at end of file +var _0x08f4=['lodash','sequelize','exports','STRING','TEXT','INTEGER','DATE','NOW'];(function(_0x1fd3c9,_0x111a41){var _0xfd8683=function(_0x2b0528){while(--_0x2b0528){_0x1fd3c9['push'](_0x1fd3c9['shift']());}};_0xfd8683(++_0x111a41);}(_0x08f4,0x120));var _0x408f=function(_0x42f208,_0x5d07c9){_0x42f208=_0x42f208-0x0;var _0x3ffa5e=_0x08f4[_0x42f208];return _0x3ffa5e;};'use strict';var _=require(_0x408f('0x0'));var Sequelize=require(_0x408f('0x1'));module[_0x408f('0x2')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0x408f('0x3')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x408f('0x3')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x408f('0x3')]},'dateOfBirth':{'type':Sequelize[_0x408f('0x3')]},'description':{'type':Sequelize[_0x408f('0x4')]},'phone':{'type':Sequelize[_0x408f('0x3')]},'mobile':{'type':Sequelize[_0x408f('0x3')]},'fax':{'type':Sequelize[_0x408f('0x3')]},'email':{'type':Sequelize[_0x408f('0x3')]},'url':{'type':Sequelize[_0x408f('0x3')]},'facebook':{'type':Sequelize[_0x408f('0x3')]},'fb_data':{'type':Sequelize[_0x408f('0x3')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0x408f('0x3')]},'teams':{'type':Sequelize[_0x408f('0x3')]},'viber':{'type':Sequelize[_0x408f('0x3')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x408f('0x3')]},'UserId':{'type':Sequelize[_0x408f('0x5')]},'priority':{'type':Sequelize[_0x408f('0x5')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x408f('0x6')],'defaultValue':Sequelize[_0x408f('0x7')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index f2d4eb5..837433b 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 _0xb37c=['ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','error','stack','name','send','index','CmContact','describe','keys','length','push','CmCustomField','findOne','cf_','model','query','filters','intersection','attributes','fields','nolimit','sort','where','pick','select','field','color','from','tools_tags','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','parseSearch','search','sqlOperator','conditions','find','Tag','split','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','and','uc.UserId\x20=\x20?','value','castTo','DATE','buildExpression','type','text','start','isNil','Contact','isEmpty','ListId','c.ListId\x20IN\x20?','concat','\x20=\x20?','tag','isArray','filter','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.phone\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','c.id','Sequelize','QueryTypes','SELECT','clone','order','DESC','having','t.id\x20IN\x20?','resolve','user','role','some','getLists','c.ListId\x20IS\x20NULL','agent','sequelize','toString','keyBy','merge','c.firstName','c.phone','c.mobile','c.fax','c.createdAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','catch','params','tags','startsWith','columnName','findAll','values','hasOwnProperty','body','get','mergeWith','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','destroy','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatOfflineMessage','MailMessage','MailInteraction','FaxInteraction','FaxMessage','OpenchannelInteraction','CmHopperFinal','CmHopperHistory','VoiceCallReport','MailQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','duplicates','$or','findOrCreate','spread','$and','omit','format','pickBy','cf_%d','table','cm_contacts','setFields','id\x20=\x20?','toParam','phone','getTags','rawAttributes','options','setTags','getHoppers','ContactId','includeAll','include','getHopperHistories','getHopperFinals','getJscriptySessions','No\x20ListId\x20specified','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','binding_keys','zipObject','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','chmodSync','0777','../../components/import/cm/csv','CompanyId','socket_timestamp','File\x20uploaded\x20correctly!','pid','parse','meta','binding','No\x20phone\x20column\x20specified','child_process','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','getJourney','mail','fax','whatsapp','voice','-createdAt','includes','channel','toLowerCase','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','starttime','endtime','duration','note','createdAt','userDisposition','userThirdDisposition','UserId','alias','findAndCountAll','fullname','chat','Website','Account','closed','disposition','thirdDisposition','key','Owner','customerIp','customerPort','deviceModel','ratingMessage','ratingType','ratingValue','referer','subject','substatus','openchannel','externalUrl','threadId','startCase','Interaction','flatten','sortBy','reverse','slice','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse'];(function(_0x551611,_0x5c0b14){var _0x258a91=function(_0x4c3fc3){while(--_0x4c3fc3){_0x551611['push'](_0x551611['shift']());}};_0x258a91(++_0x5c0b14);}(_0xb37c,0x110));var _0xcb37=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xb37c[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcb37('0x0'));var zipdir=require(_0xcb37('0x1'));var jsonpatch=require(_0xcb37('0x2'));var rp=require(_0xcb37('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xcb37('0x4'));var util=require(_0xcb37('0x5'));var path=require(_0xcb37('0x6'));var sox=require(_0xcb37('0x7'));var csv=require(_0xcb37('0x8'));var ejs=require(_0xcb37('0x9'));var fs=require('fs');var fs_extra=require(_0xcb37('0xa'));var _=require(_0xcb37('0xb'));var squel=require('squel');var crypto=require(_0xcb37('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xcb37('0x8'));var querystring=require(_0xcb37('0xd'));var Papa=require(_0xcb37('0xe'));var Redis=require(_0xcb37('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xcb37('0x10'));var hardwareService=require(_0xcb37('0x11'));var logger=require(_0xcb37('0x12'))(_0xcb37('0x13'));var utils=require(_0xcb37('0x14'));var config=require(_0xcb37('0x15'));var licenseUtil=require(_0xcb37('0x16'));var db=require('../../mysqldb')['db'];config[_0xcb37('0x17')]=_['defaults'](config['redis'],{'host':_0xcb37('0x18'),'port':0x18eb});var socket=require(_0xcb37('0x19'))(new Redis(config[_0xcb37('0x17')]));require('./cmContact.socket')[_0xcb37('0x1a')](socket);function respondWithStatusCode(_0x53bd52,_0x4fd66f){_0x4fd66f=_0x4fd66f||0xcc;return function(_0x2e498e){if(_0x2e498e){return _0x53bd52[_0xcb37('0x1b')](_0x4fd66f);}return _0x53bd52[_0xcb37('0x1c')](_0x4fd66f)[_0xcb37('0x1d')]();};}function respondWithResult(_0x42f1cf,_0x52dbd4){_0x52dbd4=_0x52dbd4||0xc8;return function(_0x34597d){if(_0x34597d){return _0x42f1cf[_0xcb37('0x1c')](_0x52dbd4)[_0xcb37('0x1e')](_0x34597d);}};}function respondWithFilteredResult(_0x277afd,_0x46c925){return function(_0x846e03){if(_0x846e03){var _0x237c76=typeof _0x46c925[_0xcb37('0x1f')]===_0xcb37('0x20')&&typeof _0x46c925['limit']==='undefined';var _0x17280c=_0x846e03[_0xcb37('0x21')];var _0x27cfd4=_0x237c76?0x0:_0x46c925[_0xcb37('0x1f')];var _0x32e2da=_0x237c76?_0x846e03['count']:_0x46c925[_0xcb37('0x1f')]+_0x46c925[_0xcb37('0x22')];var _0x2505a8;if(_0x32e2da>=_0x17280c){_0x32e2da=_0x17280c;_0x2505a8=0xc8;}else{_0x2505a8=0xce;}_0x277afd[_0xcb37('0x1c')](_0x2505a8);return _0x277afd[_0xcb37('0x23')](_0xcb37('0x24'),_0x27cfd4+'-'+_0x32e2da+'/'+_0x17280c)[_0xcb37('0x1e')](_0x846e03);}return null;};}function patchUpdates(_0x1a4b7d){return function(_0x280a78){try{jsonpatch[_0xcb37('0x25')](_0x280a78,_0x1a4b7d,!![]);}catch(_0x49be21){return BPromise['reject'](_0x49be21);}return _0x280a78[_0xcb37('0x26')]();};}function saveUpdates(_0x9a4b04,_0x143aed){return function(_0x42b933){if(_0x42b933){return _0x42b933[_0xcb37('0x27')](_0x9a4b04)[_0xcb37('0x28')](function(_0x13411e){return _0x13411e;});}return null;};}function removeEntity(_0x261b4c,_0x3274c6){return function(_0x38eec0){if(_0x38eec0){return _0x38eec0['destroy']()[_0xcb37('0x28')](function(){_0x261b4c[_0xcb37('0x1c')](0xcc)[_0xcb37('0x1d')]();});}};}function handleEntityNotFound(_0x304b28,_0x3fc045){return function(_0x9f5e18){if(!_0x9f5e18){_0x304b28['sendStatus'](0x194);}return _0x9f5e18;};}function handleError(_0x267b14,_0x35f533){_0x35f533=_0x35f533||0x1f4;return function(_0x3a48e4){logger[_0xcb37('0x29')](_0x3a48e4[_0xcb37('0x2a')]);if(_0x3a48e4[_0xcb37('0x2b')]){delete _0x3a48e4[_0xcb37('0x2b')];}_0x267b14['status'](_0x35f533)[_0xcb37('0x2c')](_0x3a48e4);};}exports[_0xcb37('0x2d')]=function(_0x394863,_0x3823ef){var _0xeacf82={},_0x3f6cca={},_0x57417b={'count':0x0,'rows':[]};return db[_0xcb37('0x2e')][_0xcb37('0x2f')]()[_0xcb37('0x28')](function(_0x59dc52){var _0xa4e5ab=[];for(var _0x2f749a=0x0;_0x2f749a0x1){_0x2c5084['or'](_0xcb37('0x6c'),qs[_0xcb37('0x6d')](_0x484d30),null);}else{if(qs[_0xcb37('0x6e')](_0x484d30)){_0x2c5084['or']('c.id\x20LIKE\x20?',_0x484d30+'%');_0x2c5084['or'](_0xcb37('0x6f'),_0x484d30+'%');_0x2c5084['or']('c.mobile\x20LIKE\x20?',_0x484d30+'%');_0x2c5084['or']('c.fax\x20LIKE\x20?',_0x484d30+'%');}else if(qs[_0xcb37('0x70')](_0x484d30)){_0x2c5084['or'](_0xcb37('0x71'),_0x484d30+'%');}else{_0x2c5084['or'](_0xcb37('0x72'),'%'+_0x484d30+'%');_0x2c5084['or'](_0xcb37('0x73'),'%'+_0x484d30+'%');_0x2c5084['or']('c.email\x20LIKE\x20?','%'+_0x484d30+'%');}}}}_0x2904d1['where'](_0x2c5084);_0x2904d1['group'](_0xcb37('0x74'));var _0x4b0322={'type':db[_0xcb37('0x75')][_0xcb37('0x76')][_0xcb37('0x77')],'raw':!![]};var _0x4dd777=_0x2904d1[_0xcb37('0x78')]()[_0xcb37('0x41')](_0xcb37('0x74'));if(_0xeacf82[_0xcb37('0x79')]){_0xeacf82[_0xcb37('0x79')][_0xcb37('0x55')](function(_0x22891b){_0x2904d1['order']('c.'+_0x22891b[0x0],_0x22891b[0x1]===_0xcb37('0x7a')?![]:!![]);});}if(!_[_0xcb37('0x63')](_0x23f164)){_0x2904d1[_0xcb37('0x7b')](_0x48ef58);_0x4dd777[_0xcb37('0x3e')](_0xcb37('0x7c'),_0x23f164);}BPromise[_0xcb37('0x7d')]()[_0xcb37('0x28')](function(){if(!_0x49c24f)return;if(_0x394863[_0xcb37('0x7e')][_0xcb37('0x7f')]!=='agent')return;if(!_[_0xcb37('0x80')](_0x49c24f[_0xcb37('0x50')],[_0xcb37('0x41'),_0xcb37('0x57')])){return _0x394863[_0xcb37('0x7e')][_0xcb37('0x81')]({'attributes':['id'],'raw':!![]})[_0xcb37('0x28')](function(_0x5837f){if(_[_0xcb37('0x63')](_0x5837f)){_0x4dd777[_0xcb37('0x3e')](_0xcb37('0x82'));_0x2904d1[_0xcb37('0x3e')](_0xcb37('0x82'));}else{_0x4dd777['where']('c.ListId\x20IN\x20?',_[_0xcb37('0x54')](_0x5837f,'id'));_0x2904d1[_0xcb37('0x3e')](_0xcb37('0x65'),_[_0xcb37('0x54')](_0x5837f,'id'));}});}})['then'](function(){if(_0x394863[_0xcb37('0x7e')][_0xcb37('0x7f')]===_0xcb37('0x83')&&!_0x49c24f&&!_0x394863[_0xcb37('0x37')][_0xcb37('0x64')])return[];return db[_0xcb37('0x84')][_0xcb37('0x37')](_0x4dd777[_0xcb37('0x85')](),_0x4b0322);})[_0xcb37('0x28')](function(_0x5daf7a){_0x57417b['count']=_0x5daf7a[_0xcb37('0x31')];if(_0x57417b[_0xcb37('0x21')]===0x0)return[];return db[_0xcb37('0x84')][_0xcb37('0x37')](_0x3ddfb7[_0xcb37('0x85')](),_0x4b0322)[_0xcb37('0x28')](function(_0x499908){_0x1e6ffb=_[_0xcb37('0x86')](_0x499908,'id');_0x4b0322=_[_0xcb37('0x87')](_0x4b0322,{'model':db[_0xcb37('0x2e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x394863['query'][_0xcb37('0x3b')]){_0xeacf82[_0xcb37('0x3a')]['forEach'](function(_0x27323a){_0x2904d1['field']('c.'+_0x27323a);});}else{_0x2904d1[_0xcb37('0x41')](_0xcb37('0x74'));_0x2904d1[_0xcb37('0x41')](_0xcb37('0x88'));_0x2904d1['field']('c.lastName');_0x2904d1[_0xcb37('0x41')](_0xcb37('0x89'));_0x2904d1[_0xcb37('0x41')](_0xcb37('0x8a'));_0x2904d1[_0xcb37('0x41')](_0xcb37('0x8b'));_0x2904d1['field']('c.email');_0x2904d1[_0xcb37('0x41')]('c.ListId');_0x2904d1[_0xcb37('0x41')](_0xcb37('0x8c'));_0x2904d1['field']('c.deletedAt');_0x2904d1[_0xcb37('0x41')](_0xcb37('0x8d'));_0x2904d1[_0xcb37('0x41')](_0xcb37('0x8e'),'TagIds');}if(_0xeacf82[_0xcb37('0x22')])_0x2904d1['limit'](_0xeacf82['limit']);if(_0xeacf82[_0xcb37('0x1f')])_0x2904d1[_0xcb37('0x1f')](_0xeacf82[_0xcb37('0x1f')]);return db['sequelize'][_0xcb37('0x37')](_0x2904d1['toString'](),_0x4b0322);});})[_0xcb37('0x28')](function(_0x306fc0){_0x306fc0[_0xcb37('0x55')](function(_0xbfa934){if(_0xbfa934['TagIds']){_0xbfa934['Tags']=[];_0xbfa934[_0xcb37('0x8f')]['split'](',')[_0xcb37('0x55')](function(_0x4f2819){_0xbfa934[_0xcb37('0x90')][_0xcb37('0x32')](_0x1e6ffb[_0x4f2819]);});}delete _0xbfa934[_0xcb37('0x8f')];});_0x57417b[_0xcb37('0x91')]=_0x306fc0;return _0x57417b;})['then'](respondWithFilteredResult(_0x3823ef,_0xeacf82));})[_0xcb37('0x92')](handleError(_0x3823ef,null));};exports['destroy']=function(_0x3ec46e,_0x4d5d2a){return db[_0xcb37('0x2e')][_0xcb37('0x51')]({'where':{'id':_0x3ec46e[_0xcb37('0x93')]['id']}})[_0xcb37('0x28')](handleEntityNotFound(_0x4d5d2a,null))[_0xcb37('0x28')](removeEntity(_0x4d5d2a,null))['catch'](handleError(_0x4d5d2a,null));};exports[_0xcb37('0x2f')]=function(_0x2f4f4b,_0x3b9bb8){return db[_0xcb37('0x2e')][_0xcb37('0x2f')]()[_0xcb37('0x28')](function(_0x1b9f12){delete _0x1b9f12[_0xcb37('0x94')];for(var _0x3dbff4=0x0;_0x3dbff4=_0x2bfd3b){_0xad7537=_0x2bfd3b;_0x490551=0xc8;}else{_0x490551=0xce;}_0x1f2ec1[_0xefef('0x1c')](_0x490551);return _0x1f2ec1[_0xefef('0x21')](_0xefef('0x22'),_0x199c1a+'-'+_0xad7537+'/'+_0x2bfd3b)['json'](_0x2aeff8);}return null;};}function patchUpdates(_0x4f7269){return function(_0x516314){try{jsonpatch[_0xefef('0x23')](_0x516314,_0x4f7269,!![]);}catch(_0x4bdc30){return BPromise[_0xefef('0x24')](_0x4bdc30);}return _0x516314['save']();};}function saveUpdates(_0x4773b1,_0x59163d){return function(_0x4502a6){if(_0x4502a6){return _0x4502a6[_0xefef('0x25')](_0x4773b1)[_0xefef('0x26')](function(_0x44edda){return _0x44edda;});}return null;};}function removeEntity(_0xf11af,_0x5197e5){return function(_0xe79f1f){if(_0xe79f1f){return _0xe79f1f[_0xefef('0x27')]()[_0xefef('0x26')](function(){_0xf11af[_0xefef('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x455f2c,_0x3fce15){return function(_0x28c572){if(!_0x28c572){_0x455f2c[_0xefef('0x1a')](0x194);}return _0x28c572;};}function handleError(_0x1f5b14,_0x41b97a){_0x41b97a=_0x41b97a||0x1f4;return function(_0x4e1add){logger['error'](_0x4e1add[_0xefef('0x28')]);if(_0x4e1add[_0xefef('0x29')]){delete _0x4e1add[_0xefef('0x29')];}_0x1f5b14[_0xefef('0x1c')](_0x41b97a)[_0xefef('0x2a')](_0x4e1add);};}exports[_0xefef('0x2b')]=function(_0x481086,_0x3f7a8a){var _0x5da108={},_0x3f8082={},_0x531123={'count':0x0,'rows':[]};return db[_0xefef('0x2c')][_0xefef('0x2d')]()['then'](function(_0x47bc2c){var _0x4aca55=[];for(var _0x38fef9=0x0;_0x38fef90x1){_0x4f00d0['or'](_0xefef('0x6c'),qs[_0xefef('0x6d')](_0x426e13),null);}else{if(qs[_0xefef('0x6e')](_0x426e13)){_0x4f00d0['or'](_0xefef('0x6f'),_0x426e13+'%');_0x4f00d0['or'](_0xefef('0x70'),_0x426e13+'%');_0x4f00d0['or'](_0xefef('0x71'),_0x426e13+'%');_0x4f00d0['or'](_0xefef('0x72'),_0x426e13+'%');}else if(qs['isEmail'](_0x426e13)){_0x4f00d0['or'](_0xefef('0x73'),_0x426e13+'%');}else{_0x4f00d0['or'](_0xefef('0x74'),'%'+_0x426e13+'%');_0x4f00d0['or'](_0xefef('0x75'),'%'+_0x426e13+'%');_0x4f00d0['or']('c.email\x20LIKE\x20?','%'+_0x426e13+'%');}}}}_0x32bf92['where'](_0x4f00d0);_0x32bf92[_0xefef('0x76')](_0xefef('0x77'));var _0x2a518e={'type':db['Sequelize'][_0xefef('0x78')][_0xefef('0x79')],'raw':!![]};var _0x51c2fc=_0x32bf92['clone']()[_0xefef('0x43')](_0xefef('0x77'));if(_0x5da108[_0xefef('0x3f')]){_0x5da108['order'][_0xefef('0x69')](function(_0x5ce8d5){_0x32bf92[_0xefef('0x3f')]('c.'+_0x5ce8d5[0x0],_0x5ce8d5[0x1]===_0xefef('0x7a')?![]:!![]);});}if(!_[_0xefef('0x61')](_0x1f32df)){_0x32bf92['having'](_0x13c17a);_0x51c2fc[_0xefef('0x41')](_0xefef('0x7b'),_0x1f32df);}BPromise['resolve']()[_0xefef('0x26')](function(){if(!_0x1c0c69)return;if(_0x481086['user'][_0xefef('0x7c')]!==_0xefef('0x7d'))return;if(!_[_0xefef('0x7e')](_0x1c0c69['conditions'],['field',_0xefef('0x56')])){return _0x481086[_0xefef('0x7f')][_0xefef('0x80')]({'attributes':['id'],'raw':!![]})['then'](function(_0x5bc647){if(_[_0xefef('0x61')](_0x5bc647)){_0x51c2fc[_0xefef('0x41')](_0xefef('0x81'));_0x32bf92[_0xefef('0x41')](_0xefef('0x81'));}else{_0x51c2fc[_0xefef('0x41')]('c.ListId\x20IN\x20?',_['map'](_0x5bc647,'id'));_0x32bf92[_0xefef('0x41')](_0xefef('0x63'),_[_0xefef('0x54')](_0x5bc647,'id'));}});}})['then'](function(){if(_0x481086['user'][_0xefef('0x7c')]==='agent'&&!_0x1c0c69&&!_0x481086[_0xefef('0x38')][_0xefef('0x62')])return[];return db[_0xefef('0x82')]['query'](_0x51c2fc[_0xefef('0x83')](),_0x2a518e);})[_0xefef('0x26')](function(_0x472a1b){_0x531123[_0xefef('0x20')]=_0x472a1b[_0xefef('0x2f')];if(_0x531123[_0xefef('0x20')]===0x0)return[];return db[_0xefef('0x82')][_0xefef('0x38')](_0xbc2e3e[_0xefef('0x83')](),_0x2a518e)[_0xefef('0x26')](function(_0x5d5acb){_0x27fb4c=_[_0xefef('0x84')](_0x5d5acb,'id');_0x2a518e=_[_0xefef('0x85')](_0x2a518e,{'model':db[_0xefef('0x2c')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x481086['query']['fields']){_0x5da108[_0xefef('0x3c')][_0xefef('0x69')](function(_0x1cefb6){_0x32bf92['field']('c.'+_0x1cefb6);});}else{_0x32bf92['field'](_0xefef('0x77'));_0x32bf92[_0xefef('0x43')](_0xefef('0x86'));_0x32bf92[_0xefef('0x43')](_0xefef('0x87'));_0x32bf92['field'](_0xefef('0x88'));_0x32bf92[_0xefef('0x43')]('c.mobile');_0x32bf92[_0xefef('0x43')](_0xefef('0x89'));_0x32bf92[_0xefef('0x43')]('c.email');_0x32bf92[_0xefef('0x43')]('c.ListId');_0x32bf92[_0xefef('0x43')](_0xefef('0x8a'));_0x32bf92[_0xefef('0x43')]('c.deletedAt');_0x32bf92[_0xefef('0x43')](_0xefef('0x8b'));_0x32bf92[_0xefef('0x43')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xefef('0x8c'));}if(_0x5da108['limit'])_0x32bf92[_0xefef('0x1f')](_0x5da108['limit']);if(_0x5da108[_0xefef('0x1e')])_0x32bf92[_0xefef('0x1e')](_0x5da108[_0xefef('0x1e')]);return db[_0xefef('0x82')][_0xefef('0x38')](_0x32bf92[_0xefef('0x83')](),_0x2a518e);});})[_0xefef('0x26')](function(_0x53ad1c){_0x53ad1c['forEach'](function(_0x5066f7){if(_0x5066f7[_0xefef('0x8c')]){_0x5066f7[_0xefef('0x8d')]=[];_0x5066f7['TagIds'][_0xefef('0x53')](',')[_0xefef('0x69')](function(_0x42a1ce){_0x5066f7[_0xefef('0x8d')]['push'](_0x27fb4c[_0x42a1ce]);});}delete _0x5066f7[_0xefef('0x8c')];});_0x531123[_0xefef('0x8e')]=_0x53ad1c;return _0x531123;})[_0xefef('0x26')](respondWithFilteredResult(_0x3f7a8a,_0x5da108));})[_0xefef('0x8f')](handleError(_0x3f7a8a,null));};exports[_0xefef('0x27')]=function(_0x458930,_0xadc87c){return db['CmContact']['find']({'where':{'id':_0x458930[_0xefef('0x90')]['id']}})['then'](handleEntityNotFound(_0xadc87c,null))[_0xefef('0x26')](removeEntity(_0xadc87c,null))['catch'](handleError(_0xadc87c,null));};exports[_0xefef('0x2d')]=function(_0x3958cb,_0x3f7cea){return db[_0xefef('0x2c')][_0xefef('0x2d')]()[_0xefef('0x26')](function(_0x1a75af){delete _0x1a75af[_0xefef('0x91')];for(var _0x3883b6=0x0;_0x3883b6{}\s\\|]/g,'-');_0x281bce(null,util['format'](_0xef12('0x25'),path['basename'](_0x520505[_0xef12('0x23')],path[_0xef12('0x26')](_0x520505['originalname'])),Date[_0xef12('0x27')](),path[_0xef12('0x26')](_0x520505['originalname'])));}})});router['post']('/csv',upload[_0xef12('0x28')](_0xef12('0x29')),controller[_0xef12('0x2a')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x17eaf5,_0x4566fa,_0x3c22ee){_0x3c22ee(null,path[_0xef12('0x20')](config[_0xef12('0x21')],_0xef12('0x22')));},'filename':function(_0x367dbd,_0xbb98b7,_0x2d3434){_0xbb98b7[_0xef12('0x23')]=_0xbb98b7['originalname'][_0xef12('0x24')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2d3434(null,util[_0xef12('0x2b')]('%s-%s%s',path[_0xef12('0x2c')](_0xbb98b7[_0xef12('0x23')],path[_0xef12('0x26')](_0xbb98b7[_0xef12('0x23')])),Date[_0xef12('0x27')](),path[_0xef12('0x26')](_0xbb98b7[_0xef12('0x23')])));}})});router['post']('/upload',upload[_0xef12('0x28')](_0xef12('0x29')),controller[_0xef12('0x2d')]);router['post'](_0xef12('0x2e'),auth[_0xef12('0xb')](),controller[_0xef12('0x2f')]);router['put'](_0xef12('0x30'),auth[_0xef12('0xb')](),controller[_0xef12('0x31')]);router[_0xef12('0x32')](_0xef12('0x30'),auth[_0xef12('0xb')](),controller[_0xef12('0x33')]);module[_0xef12('0x34')]=router; \ No newline at end of file +var _0x6ff5=['file','uploadCsv','/upload','single','upload','/upload/:id','put','update','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','merge','post','/create_many','bulkCreate','/:id/tags','diskStorage','join','root','server/files/tmp','originalname','replace','format','%s-%s%s','basename','now','extname','/csv'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6ff5,0x12e));var _0x56ff=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0x6ff5[_0x36eaaa];return _0x461349;};'use strict';var multer=require('multer');var util=require(_0x56ff('0x0'));var path=require(_0x56ff('0x1'));var timeout=require(_0x56ff('0x2'));var express=require(_0x56ff('0x3'));var router=express[_0x56ff('0x4')]();var fs_extra=require(_0x56ff('0x5'));var auth=require(_0x56ff('0x6'));var interaction=require(_0x56ff('0x7'));var config=require(_0x56ff('0x8'));var controller=require(_0x56ff('0x9'));router[_0x56ff('0xa')]('/',auth[_0x56ff('0xb')](),controller['index']);router[_0x56ff('0xa')](_0x56ff('0xc'),auth[_0x56ff('0xb')](),controller[_0x56ff('0xd')]);router[_0x56ff('0xa')](_0x56ff('0xe'),auth[_0x56ff('0xb')](),controller[_0x56ff('0xf')]);router[_0x56ff('0xa')]('/:id/tags',auth[_0x56ff('0xb')](),controller['getTags']);router[_0x56ff('0xa')](_0x56ff('0x10'),auth[_0x56ff('0xb')](),controller[_0x56ff('0x11')]);router['get'](_0x56ff('0x12'),auth[_0x56ff('0xb')](),controller[_0x56ff('0x13')]);router[_0x56ff('0xa')](_0x56ff('0x14'),auth[_0x56ff('0xb')](),controller[_0x56ff('0x15')]);router[_0x56ff('0xa')](_0x56ff('0x16'),auth[_0x56ff('0xb')](),controller[_0x56ff('0x17')]);router[_0x56ff('0xa')]('/:id/journey',auth[_0x56ff('0xb')](),controller['getJourney']);router['post']('/merge',auth[_0x56ff('0xb')](),controller[_0x56ff('0x18')]);router[_0x56ff('0x19')]('/',auth[_0x56ff('0xb')](),controller['create']);router[_0x56ff('0x19')](_0x56ff('0x1a'),auth['isAuthenticated'](),controller[_0x56ff('0x1b')]);router['post'](_0x56ff('0x1c'),auth[_0x56ff('0xb')](),controller['setTags']);var upload=multer({'storage':multer[_0x56ff('0x1d')]({'destination':function(_0xf436e9,_0x1c0c09,_0x1e7e76){_0x1e7e76(null,path[_0x56ff('0x1e')](config[_0x56ff('0x1f')],_0x56ff('0x20')));},'filename':function(_0x3d5b49,_0x40a3f6,_0x4f0162){_0x40a3f6[_0x56ff('0x21')]=_0x40a3f6['originalname'][_0x56ff('0x22')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4f0162(null,util[_0x56ff('0x23')](_0x56ff('0x24'),path[_0x56ff('0x25')](_0x40a3f6['originalname'],path['extname'](_0x40a3f6['originalname'])),Date[_0x56ff('0x26')](),path[_0x56ff('0x27')](_0x40a3f6[_0x56ff('0x21')])));}})});router[_0x56ff('0x19')](_0x56ff('0x28'),upload['single'](_0x56ff('0x29')),controller[_0x56ff('0x2a')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x443d7a,_0x548fd1,_0x2e597d){_0x2e597d(null,path['join'](config[_0x56ff('0x1f')],_0x56ff('0x20')));},'filename':function(_0x1012bc,_0x26dcd6,_0xb99ead){_0x26dcd6[_0x56ff('0x21')]=_0x26dcd6['originalname'][_0x56ff('0x22')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xb99ead(null,util[_0x56ff('0x23')]('%s-%s%s',path[_0x56ff('0x25')](_0x26dcd6[_0x56ff('0x21')],path[_0x56ff('0x27')](_0x26dcd6[_0x56ff('0x21')])),Date[_0x56ff('0x26')](),path['extname'](_0x26dcd6[_0x56ff('0x21')])));}})});router[_0x56ff('0x19')](_0x56ff('0x2b'),upload[_0x56ff('0x2c')]('file'),controller[_0x56ff('0x2d')]);router[_0x56ff('0x19')](_0x56ff('0x2e'),auth[_0x56ff('0xb')](),controller['import']);router[_0x56ff('0x2f')](_0x56ff('0xe'),auth[_0x56ff('0xb')](),controller[_0x56ff('0x30')]);router['delete'](_0x56ff('0xe'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 377b8f4..f774564 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 _0x3382=['lodash','exports','getDataValue','alias','setDataValue','name','STRING','TEXT','long','type','select','values','isArray','stringify','BOOLEAN','ENUM','voice'];(function(_0x148028,_0x8f4e9){var _0xb0ec6=function(_0x502efd){while(--_0x502efd){_0x148028['push'](_0x148028['shift']());}};_0xb0ec6(++_0x8f4e9);}(_0x3382,0x77));var _0x2338=function(_0x5c0314,_0x2ff39c){_0x5c0314=_0x5c0314-0x0;var _0x3ffa8f=_0x3382[_0x5c0314];return _0x3ffa8f;};'use strict';var Sequelize=require('sequelize');var _=require(_0x2338('0x0'));module[_0x2338('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x67388b){return this[_0x2338('0x2')](_0x2338('0x3'));}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x24a058){this[_0x2338('0x4')](_0x2338('0x3'),_0x24a058?_0x24a058:this[_0x2338('0x2')](_0x2338('0x5')));}},'type':{'type':Sequelize[_0x2338('0x6')],'allowNull':![]},'values':{'type':Sequelize[_0x2338('0x7')](_0x2338('0x8')),'get':function(){if(this[_0x2338('0x2')](_0x2338('0x9'))===_0x2338('0xa')){return JSON['parse'](this[_0x2338('0x2')](_0x2338('0xb')));}else{return this[_0x2338('0x2')](_0x2338('0xb'));}},'set':function(_0x420a60){if(Array[_0x2338('0xc')](_0x420a60)){this[_0x2338('0x4')](_0x2338('0xb'),JSON[_0x2338('0xd')](_0x420a60));}else{this[_0x2338('0x4')](_0x2338('0xb'),_0x420a60);}}},'required':{'type':Sequelize[_0x2338('0xe')],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize[_0x2338('0xf')](_0x2338('0x10'))}}; \ No newline at end of file +var _0x7e10=['long','parse','values','isArray','stringify','BOOLEAN','voice','sequelize','exports','VIRTUAL','getDataValue','alias','STRING','setDataValue','name'];(function(_0x21a8ba,_0x2b09e1){var _0x1da12a=function(_0xb9a7f0){while(--_0xb9a7f0){_0x21a8ba['push'](_0x21a8ba['shift']());}};_0x1da12a(++_0x2b09e1);}(_0x7e10,0x1ab));var _0x07e1=function(_0x34413a,_0x1a20be){_0x34413a=_0x34413a-0x0;var _0x31074c=_0x7e10[_0x34413a];return _0x31074c;};'use strict';var Sequelize=require(_0x07e1('0x0'));var _=require('lodash');module[_0x07e1('0x1')]={'name':{'type':Sequelize[_0x07e1('0x2')],'get':function(_0x35f653){return this[_0x07e1('0x3')](_0x07e1('0x4'));}},'alias':{'type':Sequelize[_0x07e1('0x5')],'allowNull':![],'set':function(_0x419f7c){this[_0x07e1('0x6')]('alias',_0x419f7c?_0x419f7c:this['getDataValue'](_0x07e1('0x7')));}},'type':{'type':Sequelize[_0x07e1('0x5')],'allowNull':![]},'values':{'type':Sequelize['TEXT'](_0x07e1('0x8')),'get':function(){if(this[_0x07e1('0x3')]('type')==='select'){return JSON[_0x07e1('0x9')](this[_0x07e1('0x3')](_0x07e1('0xa')));}else{return this[_0x07e1('0x3')](_0x07e1('0xa'));}},'set':function(_0x5eb160){if(Array[_0x07e1('0xb')](_0x5eb160)){this[_0x07e1('0x6')](_0x07e1('0xa'),JSON[_0x07e1('0xc')](_0x5eb160));}else{this[_0x07e1('0x6')](_0x07e1('0xa'),_0x5eb160);}}},'required':{'type':Sequelize[_0x07e1('0xd')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x07e1('0xd')],'defaultValue':![]},'actionType':{'type':Sequelize['ENUM'](_0x07e1('0xe'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index d6c67ad..0f2df9a 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 _0x076c=['BOOLEAN','defaultValue','queryInterface','cm_contacts','format','cf_%d','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','send','index','CmCustomField','rawAttributes','fieldName','type','key','model','map','name','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','include','rows','catch','params','length','includeAll','find','body','sequelize','transaction','create','TEXT','text','Sequelize','switch'];(function(_0x2809e9,_0x464119){var _0x4204ba=function(_0x3f27ac){while(--_0x3f27ac){_0x2809e9['push'](_0x2809e9['shift']());}};_0x4204ba(++_0x464119);}(_0x076c,0x1be));var _0xc076=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0x076c[_0xbe200f];return _0x192597;};'use strict';var emlformat=require(_0xc076('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc076('0x1'));var jsonpatch=require(_0xc076('0x2'));var rp=require(_0xc076('0x3'));var moment=require(_0xc076('0x4'));var BPromise=require(_0xc076('0x5'));var Mustache=require(_0xc076('0x6'));var util=require('util');var path=require(_0xc076('0x7'));var sox=require(_0xc076('0x8'));var csv=require(_0xc076('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc076('0xa'));var _=require('lodash');var squel=require(_0xc076('0xb'));var crypto=require(_0xc076('0xc'));var jsforce=require(_0xc076('0xd'));var deskjs=require(_0xc076('0xe'));var toCsv=require('to-csv');var querystring=require(_0xc076('0xf'));var Papa=require(_0xc076('0x10'));var Redis=require(_0xc076('0x11'));var authService=require(_0xc076('0x12'));var qs=require(_0xc076('0x13'));var as=require(_0xc076('0x14'));var hardwareService=require(_0xc076('0x15'));var logger=require(_0xc076('0x16'))('api');var utils=require(_0xc076('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xc076('0x18'));var db=require(_0xc076('0x19'))['db'];function respondWithStatusCode(_0x40d069,_0xa7366e){_0xa7366e=_0xa7366e||0xcc;return function(_0x33cad5){if(_0x33cad5){return _0x40d069['sendStatus'](_0xa7366e);}return _0x40d069[_0xc076('0x1a')](_0xa7366e)[_0xc076('0x1b')]();};}function respondWithResult(_0x1ba038,_0x15e206){_0x15e206=_0x15e206||0xc8;return function(_0x1d5b0f){if(_0x1d5b0f){return _0x1ba038[_0xc076('0x1a')](_0x15e206)[_0xc076('0x1c')](_0x1d5b0f);}};}function respondWithFilteredResult(_0x233940,_0x4f3b47){return function(_0xccc6f4){if(_0xccc6f4){var _0x289c54=typeof _0x4f3b47[_0xc076('0x1d')]===_0xc076('0x1e')&&typeof _0x4f3b47[_0xc076('0x1f')]==='undefined';var _0x5adb75=_0xccc6f4[_0xc076('0x20')];var _0x52f0f8=_0x289c54?0x0:_0x4f3b47['offset'];var _0xc8c41=_0x289c54?_0xccc6f4[_0xc076('0x20')]:_0x4f3b47[_0xc076('0x1d')]+_0x4f3b47['limit'];var _0x4b006c;if(_0xc8c41>=_0x5adb75){_0xc8c41=_0x5adb75;_0x4b006c=0xc8;}else{_0x4b006c=0xce;}_0x233940['status'](_0x4b006c);return _0x233940[_0xc076('0x21')](_0xc076('0x22'),_0x52f0f8+'-'+_0xc8c41+'/'+_0x5adb75)[_0xc076('0x1c')](_0xccc6f4);}return null;};}function patchUpdates(_0xa3e024){return function(_0x47472c){try{jsonpatch[_0xc076('0x23')](_0x47472c,_0xa3e024,!![]);}catch(_0x200644){return BPromise[_0xc076('0x24')](_0x200644);}return _0x47472c[_0xc076('0x25')]();};}function saveUpdates(_0x489173,_0x53ae35){return function(_0x58ae02){if(_0x58ae02){return _0x58ae02[_0xc076('0x26')](_0x489173)[_0xc076('0x27')](function(_0xf0cf20){return _0xf0cf20;});}return null;};}function removeEntity(_0x63db3,_0x2d21f5){return function(_0x88c2f6){if(_0x88c2f6){return _0x88c2f6[_0xc076('0x28')]()[_0xc076('0x27')](function(){_0x63db3[_0xc076('0x1a')](0xcc)[_0xc076('0x1b')]();});}};}function handleEntityNotFound(_0x128af6,_0x317792){return function(_0x58c263){if(!_0x58c263){_0x128af6[_0xc076('0x29')](0x194);}return _0x58c263;};}function handleError(_0x290c4f,_0x222e3d){_0x222e3d=_0x222e3d||0x1f4;return function(_0x31d757){logger['error'](_0x31d757['stack']);if(_0x31d757['name']){delete _0x31d757['name'];}_0x290c4f[_0xc076('0x1a')](_0x222e3d)[_0xc076('0x2a')](_0x31d757);};}exports[_0xc076('0x2b')]=function(_0x4194be,_0x23430e){var _0x53d4e0={},_0x4478e7={},_0x391eb3={'count':0x0,'rows':[]};var _0xaa5491=_['map'](db[_0xc076('0x2c')][_0xc076('0x2d')],function(_0x1092a2){return{'name':_0x1092a2[_0xc076('0x2e')],'type':_0x1092a2[_0xc076('0x2f')][_0xc076('0x30')]};});_0x4478e7[_0xc076('0x31')]=_['differenceBy'](_[_0xc076('0x32')](_0xaa5491,_0xc076('0x33')),[_0xc076('0x33')]);_0x4478e7['query']=_[_0xc076('0x34')](_0x4194be[_0xc076('0x35')]);_0x4478e7[_0xc076('0x36')]=_['intersection'](_0x4478e7[_0xc076('0x31')],_0x4478e7[_0xc076('0x35')]);_0x53d4e0[_0xc076('0x37')]=_[_0xc076('0x38')](_0x4478e7[_0xc076('0x31')],qs['fields'](_0x4194be[_0xc076('0x35')][_0xc076('0x39')]));_0x53d4e0[_0xc076('0x37')]=_0x53d4e0['attributes']['length']?_0x53d4e0[_0xc076('0x37')]:_0x4478e7['model'];if(!_0x4194be[_0xc076('0x35')][_0xc076('0x3a')](_0xc076('0x3b'))){_0x53d4e0['limit']=qs[_0xc076('0x1f')](_0x4194be[_0xc076('0x35')][_0xc076('0x1f')]);_0x53d4e0[_0xc076('0x1d')]=qs[_0xc076('0x1d')](_0x4194be[_0xc076('0x35')][_0xc076('0x1d')]);}_0x53d4e0[_0xc076('0x3c')]=qs['sort'](_0x4194be[_0xc076('0x35')][_0xc076('0x3d')]);_0x53d4e0[_0xc076('0x3e')]=qs[_0xc076('0x36')](_['pick'](_0x4194be[_0xc076('0x35')],_0x4478e7['filters']),_0xaa5491);if(_0x4194be['query'][_0xc076('0x3f')]){_0x53d4e0['where']=_['merge'](_0x53d4e0['where'],{'$or':_[_0xc076('0x32')](_0xaa5491,function(_0x44f148){if(_0x44f148[_0xc076('0x2f')]!==_0xc076('0x40')){var _0x4c5b6a={};_0x4c5b6a[_0x44f148[_0xc076('0x33')]]={'$like':'%'+_0x4194be[_0xc076('0x35')][_0xc076('0x3f')]+'%'};return _0x4c5b6a;}})});}_0x53d4e0=_[_0xc076('0x41')]({},_0x53d4e0,_0x4194be[_0xc076('0x42')]);var _0x6d2122={'where':_0x53d4e0[_0xc076('0x3e')]};return db[_0xc076('0x2c')]['count'](_0x6d2122)[_0xc076('0x27')](function(_0x236033){_0x391eb3['count']=_0x236033;if(_0x4194be[_0xc076('0x35')]['includeAll']){_0x53d4e0[_0xc076('0x43')]=[{'all':!![]}];}return db[_0xc076('0x2c')]['findAll'](_0x53d4e0);})[_0xc076('0x27')](function(_0x9c9e4c){_0x391eb3[_0xc076('0x44')]=_0x9c9e4c;return _0x391eb3;})[_0xc076('0x27')](respondWithFilteredResult(_0x23430e,_0x53d4e0))[_0xc076('0x45')](handleError(_0x23430e,null));};exports['show']=function(_0x302568,_0x20e6bb){var _0x4afb5b={'raw':!![],'where':{'id':_0x302568[_0xc076('0x46')]['id']}},_0x1e2e33={};_0x1e2e33['model']=_[_0xc076('0x34')](db[_0xc076('0x2c')][_0xc076('0x2d')]);_0x1e2e33[_0xc076('0x35')]=_[_0xc076('0x34')](_0x302568[_0xc076('0x35')]);_0x1e2e33[_0xc076('0x36')]=_[_0xc076('0x38')](_0x1e2e33[_0xc076('0x31')],_0x1e2e33[_0xc076('0x35')]);_0x4afb5b[_0xc076('0x37')]=_['intersection'](_0x1e2e33[_0xc076('0x31')],qs[_0xc076('0x39')](_0x302568[_0xc076('0x35')][_0xc076('0x39')]));_0x4afb5b[_0xc076('0x37')]=_0x4afb5b[_0xc076('0x37')][_0xc076('0x47')]?_0x4afb5b['attributes']:_0x1e2e33[_0xc076('0x31')];if(_0x302568['query'][_0xc076('0x48')]){_0x4afb5b[_0xc076('0x43')]=[{'all':!![]}];}_0x4afb5b=_[_0xc076('0x41')]({},_0x4afb5b,_0x302568[_0xc076('0x42')]);return db['CmCustomField'][_0xc076('0x49')](_0x4afb5b)[_0xc076('0x27')](handleEntityNotFound(_0x20e6bb,null))[_0xc076('0x27')](respondWithResult(_0x20e6bb,null))[_0xc076('0x45')](handleError(_0x20e6bb,null));};exports['update']=function(_0x45042e,_0xe77e5c){if(_0x45042e[_0xc076('0x4a')]['id']){delete _0x45042e['body']['id'];}return db['CmCustomField']['find']({'where':{'id':_0x45042e['params']['id']}})[_0xc076('0x27')](handleEntityNotFound(_0xe77e5c,null))[_0xc076('0x27')](saveUpdates(_0x45042e[_0xc076('0x4a')],null))[_0xc076('0x27')](respondWithResult(_0xe77e5c,null))[_0xc076('0x45')](handleError(_0xe77e5c,null));};exports[_0xc076('0x28')]=function(_0x29ee42,_0x5a417c){return db[_0xc076('0x2c')][_0xc076('0x49')]({'where':{'id':_0x29ee42[_0xc076('0x46')]['id']}})[_0xc076('0x27')](handleEntityNotFound(_0x5a417c,null))[_0xc076('0x27')](removeEntity(_0x5a417c,null))[_0xc076('0x45')](handleError(_0x5a417c,null));};exports['create']=function(_0x3b79ef,_0x2960bc){var _0x50666e;return db[_0xc076('0x4b')][_0xc076('0x4c')](function(_0x3e9858){return db['CmCustomField'][_0xc076('0x4d')](_0x3b79ef['body'],{'transaction':_0x3e9858})[_0xc076('0x27')](function(_0x5c099b){_0x50666e=_0x5c099b;var _0x30c4f3={'type':db['Sequelize'][_0xc076('0x4e')],'transaction':_0x3e9858};switch(_0x3b79ef['body'][_0xc076('0x2f')]){case _0xc076('0x4f'):_0x30c4f3[_0xc076('0x2f')]=db[_0xc076('0x50')]['TEXT'];break;case'number':_0x30c4f3['type']=db[_0xc076('0x50')]['INTEGER'];break;case _0xc076('0x51'):_0x30c4f3[_0xc076('0x2f')]=db[_0xc076('0x50')][_0xc076('0x52')];_0x30c4f3[_0xc076('0x53')]=![];break;default:}return db['sequelize'][_0xc076('0x54')]['addColumn'](_0xc076('0x55'),util[_0xc076('0x56')](_0xc076('0x57'),_0x50666e['id']),_0x30c4f3);})[_0xc076('0x27')](function(){return _0x50666e;});})[_0xc076('0x27')](respondWithResult(_0x2960bc,0xc9))[_0xc076('0x45')](handleError(_0x2960bc,null));}; \ No newline at end of file +var _0xfb6f=['number','INTEGER','switch','BOOLEAN','defaultValue','sequelize','queryInterface','addColumn','cm_contacts','format','cf_%d','eml-format','fast-json-patch','request-promise','moment','util','path','sox','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','CmCustomField','type','key','model','differenceBy','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','show','params','rawAttributes','includeAll','include','catch','body','find','transaction','create','TEXT','text','Sequelize'];(function(_0x2650e9,_0xb91cc){var _0x3511c8=function(_0x5069cf){while(--_0x5069cf){_0x2650e9['push'](_0x2650e9['shift']());}};_0x3511c8(++_0xb91cc);}(_0xfb6f,0x122));var _0xffb6=function(_0x470dd6,_0x4c29f2){_0x470dd6=_0x470dd6-0x0;var _0x4cd923=_0xfb6f[_0x470dd6];return _0x4cd923;};'use strict';var emlformat=require(_0xffb6('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xffb6('0x1'));var rp=require(_0xffb6('0x2'));var moment=require(_0xffb6('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xffb6('0x4'));var path=require(_0xffb6('0x5'));var sox=require(_0xffb6('0x6'));var csv=require('to-csv');var ejs=require(_0xffb6('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xffb6('0x8'));var crypto=require(_0xffb6('0x9'));var jsforce=require(_0xffb6('0xa'));var deskjs=require(_0xffb6('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xffb6('0xc'));var Redis=require(_0xffb6('0xd'));var authService=require(_0xffb6('0xe'));var qs=require(_0xffb6('0xf'));var as=require(_0xffb6('0x10'));var hardwareService=require(_0xffb6('0x11'));var logger=require(_0xffb6('0x12'))(_0xffb6('0x13'));var utils=require(_0xffb6('0x14'));var config=require(_0xffb6('0x15'));var licenseUtil=require(_0xffb6('0x16'));var db=require(_0xffb6('0x17'))['db'];function respondWithStatusCode(_0x56e278,_0x55c248){_0x55c248=_0x55c248||0xcc;return function(_0x2605e5){if(_0x2605e5){return _0x56e278[_0xffb6('0x18')](_0x55c248);}return _0x56e278[_0xffb6('0x19')](_0x55c248)[_0xffb6('0x1a')]();};}function respondWithResult(_0xa59c2f,_0x35d75f){_0x35d75f=_0x35d75f||0xc8;return function(_0x47063e){if(_0x47063e){return _0xa59c2f[_0xffb6('0x19')](_0x35d75f)[_0xffb6('0x1b')](_0x47063e);}};}function respondWithFilteredResult(_0x9f04a9,_0x5d71eb){return function(_0x53d4d2){if(_0x53d4d2){var _0x230ca5=typeof _0x5d71eb[_0xffb6('0x1c')]===_0xffb6('0x1d')&&typeof _0x5d71eb[_0xffb6('0x1e')]===_0xffb6('0x1d');var _0x314599=_0x53d4d2[_0xffb6('0x1f')];var _0x5ef9dd=_0x230ca5?0x0:_0x5d71eb[_0xffb6('0x1c')];var _0x4e07be=_0x230ca5?_0x53d4d2[_0xffb6('0x1f')]:_0x5d71eb[_0xffb6('0x1c')]+_0x5d71eb[_0xffb6('0x1e')];var _0x1a6d55;if(_0x4e07be>=_0x314599){_0x4e07be=_0x314599;_0x1a6d55=0xc8;}else{_0x1a6d55=0xce;}_0x9f04a9['status'](_0x1a6d55);return _0x9f04a9[_0xffb6('0x20')](_0xffb6('0x21'),_0x5ef9dd+'-'+_0x4e07be+'/'+_0x314599)[_0xffb6('0x1b')](_0x53d4d2);}return null;};}function patchUpdates(_0x225b09){return function(_0x1945a3){try{jsonpatch[_0xffb6('0x22')](_0x1945a3,_0x225b09,!![]);}catch(_0x52bc79){return BPromise[_0xffb6('0x23')](_0x52bc79);}return _0x1945a3[_0xffb6('0x24')]();};}function saveUpdates(_0x5d9d0e,_0x43c0c6){return function(_0x13399b){if(_0x13399b){return _0x13399b[_0xffb6('0x25')](_0x5d9d0e)[_0xffb6('0x26')](function(_0x510b98){return _0x510b98;});}return null;};}function removeEntity(_0x59cd6c,_0x276073){return function(_0x471918){if(_0x471918){return _0x471918[_0xffb6('0x27')]()[_0xffb6('0x26')](function(){_0x59cd6c[_0xffb6('0x19')](0xcc)[_0xffb6('0x1a')]();});}};}function handleEntityNotFound(_0x295f8f,_0x49c353){return function(_0x311372){if(!_0x311372){_0x295f8f['sendStatus'](0x194);}return _0x311372;};}function handleError(_0x2a4a90,_0x4acf94){_0x4acf94=_0x4acf94||0x1f4;return function(_0x472ee8){logger[_0xffb6('0x28')](_0x472ee8[_0xffb6('0x29')]);if(_0x472ee8[_0xffb6('0x2a')]){delete _0x472ee8[_0xffb6('0x2a')];}_0x2a4a90[_0xffb6('0x19')](_0x4acf94)[_0xffb6('0x2b')](_0x472ee8);};}exports[_0xffb6('0x2c')]=function(_0x26bbe3,_0xfc6ac8){var _0x3161db={},_0x11bf86={},_0x39dc2c={'count':0x0,'rows':[]};var _0x248ff8=_[_0xffb6('0x2d')](db[_0xffb6('0x2e')]['rawAttributes'],function(_0x329ca7){return{'name':_0x329ca7['fieldName'],'type':_0x329ca7[_0xffb6('0x2f')][_0xffb6('0x30')]};});_0x11bf86[_0xffb6('0x31')]=_[_0xffb6('0x32')](_[_0xffb6('0x2d')](_0x248ff8,_0xffb6('0x2a')),[_0xffb6('0x2a')]);_0x11bf86[_0xffb6('0x33')]=_[_0xffb6('0x34')](_0x26bbe3[_0xffb6('0x33')]);_0x11bf86[_0xffb6('0x35')]=_[_0xffb6('0x36')](_0x11bf86[_0xffb6('0x31')],_0x11bf86['query']);_0x3161db['attributes']=_[_0xffb6('0x36')](_0x11bf86[_0xffb6('0x31')],qs[_0xffb6('0x37')](_0x26bbe3[_0xffb6('0x33')]['fields']));_0x3161db[_0xffb6('0x38')]=_0x3161db[_0xffb6('0x38')][_0xffb6('0x39')]?_0x3161db[_0xffb6('0x38')]:_0x11bf86['model'];if(!_0x26bbe3[_0xffb6('0x33')]['hasOwnProperty'](_0xffb6('0x3a'))){_0x3161db[_0xffb6('0x1e')]=qs[_0xffb6('0x1e')](_0x26bbe3[_0xffb6('0x33')]['limit']);_0x3161db[_0xffb6('0x1c')]=qs['offset'](_0x26bbe3[_0xffb6('0x33')][_0xffb6('0x1c')]);}_0x3161db[_0xffb6('0x3b')]=qs[_0xffb6('0x3c')](_0x26bbe3[_0xffb6('0x33')][_0xffb6('0x3c')]);_0x3161db[_0xffb6('0x3d')]=qs[_0xffb6('0x35')](_[_0xffb6('0x3e')](_0x26bbe3[_0xffb6('0x33')],_0x11bf86['filters']),_0x248ff8);if(_0x26bbe3[_0xffb6('0x33')][_0xffb6('0x3f')]){_0x3161db[_0xffb6('0x3d')]=_[_0xffb6('0x40')](_0x3161db[_0xffb6('0x3d')],{'$or':_[_0xffb6('0x2d')](_0x248ff8,function(_0x525588){if(_0x525588['type']!==_0xffb6('0x41')){var _0x43e673={};_0x43e673[_0x525588[_0xffb6('0x2a')]]={'$like':'%'+_0x26bbe3[_0xffb6('0x33')][_0xffb6('0x3f')]+'%'};return _0x43e673;}})});}_0x3161db=_[_0xffb6('0x40')]({},_0x3161db,_0x26bbe3[_0xffb6('0x42')]);var _0xfca806={'where':_0x3161db[_0xffb6('0x3d')]};return db[_0xffb6('0x2e')]['count'](_0xfca806)[_0xffb6('0x26')](function(_0x3964bf){_0x39dc2c[_0xffb6('0x1f')]=_0x3964bf;if(_0x26bbe3[_0xffb6('0x33')]['includeAll']){_0x3161db['include']=[{'all':!![]}];}return db[_0xffb6('0x2e')][_0xffb6('0x43')](_0x3161db);})[_0xffb6('0x26')](function(_0x239dfe){_0x39dc2c[_0xffb6('0x44')]=_0x239dfe;return _0x39dc2c;})[_0xffb6('0x26')](respondWithFilteredResult(_0xfc6ac8,_0x3161db))['catch'](handleError(_0xfc6ac8,null));};exports[_0xffb6('0x45')]=function(_0x58539a,_0xac63f){var _0x1550de={'raw':!![],'where':{'id':_0x58539a[_0xffb6('0x46')]['id']}},_0x585271={};_0x585271[_0xffb6('0x31')]=_[_0xffb6('0x34')](db[_0xffb6('0x2e')][_0xffb6('0x47')]);_0x585271[_0xffb6('0x33')]=_[_0xffb6('0x34')](_0x58539a[_0xffb6('0x33')]);_0x585271['filters']=_[_0xffb6('0x36')](_0x585271['model'],_0x585271[_0xffb6('0x33')]);_0x1550de[_0xffb6('0x38')]=_[_0xffb6('0x36')](_0x585271[_0xffb6('0x31')],qs[_0xffb6('0x37')](_0x58539a['query'][_0xffb6('0x37')]));_0x1550de[_0xffb6('0x38')]=_0x1550de[_0xffb6('0x38')][_0xffb6('0x39')]?_0x1550de[_0xffb6('0x38')]:_0x585271['model'];if(_0x58539a[_0xffb6('0x33')][_0xffb6('0x48')]){_0x1550de[_0xffb6('0x49')]=[{'all':!![]}];}_0x1550de=_[_0xffb6('0x40')]({},_0x1550de,_0x58539a['options']);return db[_0xffb6('0x2e')]['find'](_0x1550de)[_0xffb6('0x26')](handleEntityNotFound(_0xac63f,null))[_0xffb6('0x26')](respondWithResult(_0xac63f,null))[_0xffb6('0x4a')](handleError(_0xac63f,null));};exports[_0xffb6('0x25')]=function(_0x4ee620,_0x56834d){if(_0x4ee620[_0xffb6('0x4b')]['id']){delete _0x4ee620['body']['id'];}return db[_0xffb6('0x2e')][_0xffb6('0x4c')]({'where':{'id':_0x4ee620[_0xffb6('0x46')]['id']}})[_0xffb6('0x26')](handleEntityNotFound(_0x56834d,null))[_0xffb6('0x26')](saveUpdates(_0x4ee620['body'],null))[_0xffb6('0x26')](respondWithResult(_0x56834d,null))[_0xffb6('0x4a')](handleError(_0x56834d,null));};exports[_0xffb6('0x27')]=function(_0x463b6b,_0x8ae564){return db[_0xffb6('0x2e')]['find']({'where':{'id':_0x463b6b['params']['id']}})[_0xffb6('0x26')](handleEntityNotFound(_0x8ae564,null))[_0xffb6('0x26')](removeEntity(_0x8ae564,null))[_0xffb6('0x4a')](handleError(_0x8ae564,null));};exports['create']=function(_0x413087,_0xa89178){var _0x2270dd;return db['sequelize'][_0xffb6('0x4d')](function(_0x31524a){return db[_0xffb6('0x2e')][_0xffb6('0x4e')](_0x413087[_0xffb6('0x4b')],{'transaction':_0x31524a})[_0xffb6('0x26')](function(_0x2de258){_0x2270dd=_0x2de258;var _0x1606e3={'type':db['Sequelize'][_0xffb6('0x4f')],'transaction':_0x31524a};switch(_0x413087[_0xffb6('0x4b')][_0xffb6('0x2f')]){case _0xffb6('0x50'):_0x1606e3[_0xffb6('0x2f')]=db[_0xffb6('0x51')][_0xffb6('0x4f')];break;case _0xffb6('0x52'):_0x1606e3[_0xffb6('0x2f')]=db[_0xffb6('0x51')][_0xffb6('0x53')];break;case _0xffb6('0x54'):_0x1606e3[_0xffb6('0x2f')]=db[_0xffb6('0x51')][_0xffb6('0x55')];_0x1606e3[_0xffb6('0x56')]=![];break;default:}return db[_0xffb6('0x57')][_0xffb6('0x58')][_0xffb6('0x59')](_0xffb6('0x5a'),util[_0xffb6('0x5b')](_0xffb6('0x5c'),_0x2270dd['id']),_0x1606e3);})['then'](function(){return _0x2270dd;});})[_0xffb6('0x26')](respondWithResult(_0xa89178,0xc9))[_0xffb6('0x4a')](handleError(_0xa89178,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 3a29fcd..2e9f83f 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 _0x6114=['util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./cmCustomField.attributes','exports','define','CmCustomField','cm_custom_fields','lodash'];(function(_0x403caf,_0x5b31e4){var _0x4d6784=function(_0x21db98){while(--_0x21db98){_0x403caf['push'](_0x403caf['shift']());}};_0x4d6784(++_0x5b31e4);}(_0x6114,0x74));var _0x4611=function(_0x22afd5,_0x488d9f){_0x22afd5=_0x22afd5-0x0;var _0x336ebc=_0x6114[_0x22afd5];return _0x336ebc;};'use strict';var _=require(_0x4611('0x0'));var util=require(_0x4611('0x1'));var logger=require(_0x4611('0x2'))(_0x4611('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4611('0x4'));var fs=require('fs');var path=require(_0x4611('0x5'));var rimraf=require(_0x4611('0x6'));var config=require(_0x4611('0x7'));var attributes=require(_0x4611('0x8'));module[_0x4611('0x9')]=function(_0x418464,_0x4b4c71){return _0x418464[_0x4611('0xa')](_0x4611('0xb'),attributes,{'tableName':_0x4611('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xda06=['path','rimraf','../../config/environment','./cmCustomField.attributes','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x418657,_0x2544ef){var _0x232042=function(_0x24d727){while(--_0x24d727){_0x418657['push'](_0x418657['shift']());}};_0x232042(++_0x2544ef);}(_0xda06,0x194));var _0x6da0=function(_0x2c73fa,_0x41b660){_0x2c73fa=_0x2c73fa-0x0;var _0x201374=_0xda06[_0x2c73fa];return _0x201374;};'use strict';var _=require(_0x6da0('0x0'));var util=require(_0x6da0('0x1'));var logger=require(_0x6da0('0x2'))('api');var moment=require(_0x6da0('0x3'));var BPromise=require(_0x6da0('0x4'));var rp=require(_0x6da0('0x5'));var fs=require('fs');var path=require(_0x6da0('0x6'));var rimraf=require(_0x6da0('0x7'));var config=require(_0x6da0('0x8'));var attributes=require(_0x6da0('0x9'));module['exports']=function(_0xa85113,_0x360675){return _0xa85113['define']('CmCustomField',attributes,{'tableName':'cm_custom_fields','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index 2d6226f..b4e9dd1 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 _0x7cd1=['debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmCustomField,\x20%s,\x20%s'];(function(_0x10d4e5,_0x44f80c){var _0x62a513=function(_0x5f94a7){while(--_0x5f94a7){_0x10d4e5['push'](_0x10d4e5['shift']());}};_0x62a513(++_0x44f80c);}(_0x7cd1,0xf9));var _0x17cd=function(_0x1fa381,_0x758c2a){_0x1fa381=_0x1fa381-0x0;var _0x47eefe=_0x7cd1[_0x1fa381];return _0x47eefe;};'use strict';var _=require(_0x17cd('0x0'));var util=require(_0x17cd('0x1'));var moment=require('moment');var BPromise=require(_0x17cd('0x2'));var rs=require(_0x17cd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x17cd('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x17cd('0x5'))(_0x17cd('0x6'));var config=require(_0x17cd('0x7'));var jayson=require(_0x17cd('0x8'));var client=jayson[_0x17cd('0x9')][_0x17cd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x26ce38,_0x4836ba,_0x1d7a62){return new BPromise(function(_0x37efd1,_0xb4748c){return client[_0x17cd('0xb')](_0x26ce38,_0x1d7a62)[_0x17cd('0xc')](function(_0x598d2e){logger[_0x17cd('0xd')](_0x17cd('0xe'),_0x4836ba,'request\x20sent');logger[_0x17cd('0xf')](_0x17cd('0x10'),_0x4836ba,'request\x20sent',JSON[_0x17cd('0x11')](_0x598d2e));if(_0x598d2e[_0x17cd('0x12')]){if(_0x598d2e[_0x17cd('0x12')][_0x17cd('0x13')]===0x1f4){logger[_0x17cd('0x12')](_0x17cd('0xe'),_0x4836ba,_0x598d2e[_0x17cd('0x12')][_0x17cd('0x14')]);return _0xb4748c(_0x598d2e[_0x17cd('0x12')][_0x17cd('0x14')]);}logger['error']('CmCustomField,\x20%s,\x20%s',_0x4836ba,_0x598d2e[_0x17cd('0x12')][_0x17cd('0x14')]);return _0x37efd1(_0x598d2e[_0x17cd('0x12')][_0x17cd('0x14')]);}else{logger[_0x17cd('0xd')](_0x17cd('0xe'),_0x4836ba,_0x17cd('0x15'));_0x37efd1(_0x598d2e[_0x17cd('0x16')]['message']);}})[_0x17cd('0x17')](function(_0x494086){logger['error']('CmCustomField,\x20%s,\x20%s',_0x4836ba,_0x494086);_0xb4748c(_0x494086);});});} \ No newline at end of file +var _0x1f20=['util','bluebird','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','info','CmCustomField,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','lodash'];(function(_0x1da3e6,_0x3bed70){var _0x8e2410=function(_0x45e40c){while(--_0x45e40c){_0x1da3e6['push'](_0x1da3e6['shift']());}};_0x8e2410(++_0x3bed70);}(_0x1f20,0x11c));var _0x01f2=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x1f20[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x01f2('0x0'));var util=require(_0x01f2('0x1'));var moment=require('moment');var BPromise=require(_0x01f2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x01f2('0x3'));var db=require(_0x01f2('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x01f2('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x01f2('0x6'));var client=jayson[_0x01f2('0x7')][_0x01f2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x34fe69,_0x321fae,_0x1d6822){return new BPromise(function(_0x9f158b,_0xf13bec){return client[_0x01f2('0x9')](_0x34fe69,_0x1d6822)[_0x01f2('0xa')](function(_0x37622b){logger[_0x01f2('0xb')](_0x01f2('0xc'),_0x321fae,'request\x20sent');logger[_0x01f2('0xd')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0x321fae,'request\x20sent',JSON[_0x01f2('0xe')](_0x37622b));if(_0x37622b[_0x01f2('0xf')]){if(_0x37622b[_0x01f2('0xf')][_0x01f2('0x10')]===0x1f4){logger['error'](_0x01f2('0xc'),_0x321fae,_0x37622b[_0x01f2('0xf')][_0x01f2('0x11')]);return _0xf13bec(_0x37622b[_0x01f2('0xf')]['message']);}logger[_0x01f2('0xf')](_0x01f2('0xc'),_0x321fae,_0x37622b[_0x01f2('0xf')]['message']);return _0x9f158b(_0x37622b[_0x01f2('0xf')]['message']);}else{logger[_0x01f2('0xb')](_0x01f2('0xc'),_0x321fae,_0x01f2('0x12'));_0x9f158b(_0x37622b['result'][_0x01f2('0x11')]);}})['catch'](function(_0x5ae726){logger[_0x01f2('0xf')](_0x01f2('0xc'),_0x321fae,_0x5ae726);_0xf13bec(_0x5ae726);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index f795326..e0b396f 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 _0xf0db=['get','isAuthenticated','index','show','post','create','put','/:id','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0xca3d2d,_0x1314e2){var _0x405435=function(_0x34ba7c){while(--_0x34ba7c){_0xca3d2d['push'](_0xca3d2d['shift']());}};_0x405435(++_0x1314e2);}(_0xf0db,0x12b));var _0xbf0d=function(_0x14c9c4,_0x437b92){_0x14c9c4=_0x14c9c4-0x0;var _0x1fffb9=_0xf0db[_0x14c9c4];return _0x1fffb9;};'use strict';var multer=require(_0xbf0d('0x0'));var util=require(_0xbf0d('0x1'));var path=require('path');var timeout=require(_0xbf0d('0x2'));var express=require(_0xbf0d('0x3'));var router=express[_0xbf0d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xbf0d('0x5'));var interaction=require(_0xbf0d('0x6'));var config=require('../../config/environment');var controller=require('./cmCustomField.controller');router[_0xbf0d('0x7')]('/',auth[_0xbf0d('0x8')](),controller[_0xbf0d('0x9')]);router[_0xbf0d('0x7')]('/:id',auth[_0xbf0d('0x8')](),controller[_0xbf0d('0xa')]);router[_0xbf0d('0xb')]('/',auth[_0xbf0d('0x8')](),controller[_0xbf0d('0xc')]);router[_0xbf0d('0xd')](_0xbf0d('0xe'),auth[_0xbf0d('0x8')](),controller['update']);router['delete'](_0xbf0d('0xe'),auth[_0xbf0d('0x8')](),controller[_0xbf0d('0xf')]);module[_0xbf0d('0x10')]=router; \ No newline at end of file +var _0x0960=['put','/:id','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','show','post','create'];(function(_0x2de1ca,_0x5360d7){var _0x34f9f5=function(_0x155a49){while(--_0x155a49){_0x2de1ca['push'](_0x2de1ca['shift']());}};_0x34f9f5(++_0x5360d7);}(_0x0960,0xc2));var _0x0096=function(_0x4e3420,_0x2cf852){_0x4e3420=_0x4e3420-0x0;var _0xe6df4b=_0x0960[_0x4e3420];return _0xe6df4b;};'use strict';var multer=require(_0x0096('0x0'));var util=require(_0x0096('0x1'));var path=require('path');var timeout=require(_0x0096('0x2'));var express=require(_0x0096('0x3'));var router=express[_0x0096('0x4')]();var fs_extra=require(_0x0096('0x5'));var auth=require(_0x0096('0x6'));var interaction=require(_0x0096('0x7'));var config=require(_0x0096('0x8'));var controller=require(_0x0096('0x9'));router[_0x0096('0xa')]('/',auth[_0x0096('0xb')](),controller['index']);router[_0x0096('0xa')]('/:id',auth[_0x0096('0xb')](),controller[_0x0096('0xc')]);router[_0x0096('0xd')]('/',auth['isAuthenticated'](),controller[_0x0096('0xe')]);router[_0x0096('0xf')](_0x0096('0x10'),auth[_0x0096('0xb')](),controller['update']);router[_0x0096('0x11')](_0x0096('0x10'),auth['isAuthenticated'](),controller[_0x0096('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 40f7043..d67405b 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 _0x880f=['sequelize','exports','STRING','BOOLEAN','DATE','YYYY-MM-DD\x20HH:mm:ss','INTEGER','contactListQueue','moment'];(function(_0x12708a,_0x3c542a){var _0x6033f7=function(_0x5d3f0e){while(--_0x5d3f0e){_0x12708a['push'](_0x12708a['shift']());}};_0x6033f7(++_0x3c542a);}(_0x880f,0x7d));var _0xf880=function(_0x1f473b,_0x19d9a2){_0x1f473b=_0x1f473b-0x0;var _0x1cedc2=_0x880f[_0x1f473b];return _0x1cedc2;};'use strict';var moment=require(_0xf880('0x0'));var Sequelize=require(_0xf880('0x1'));module[_0xf880('0x2')]={'phone':{'type':Sequelize[_0xf880('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0xf880('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xf880('0x5')],'defaultValue':moment()['format'](_0xf880('0x6'))},'countbusyretry':{'type':Sequelize[_0xf880('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xf880('0x7')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xf880('0x7')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xf880('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xf880('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize[_0xf880('0x7')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xf880('0x4')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xf880('0x7')],'unique':_0xf880('0x8')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0xf880('0x8')},'UserId':{'type':Sequelize[_0xf880('0x7')]},'VoiceQueueId':{'type':Sequelize[_0xf880('0x7')],'unique':_0xf880('0x8')},'CampaignId':{'type':Sequelize[_0xf880('0x7')]},'countnosuchnumberretry':{'type':Sequelize[_0xf880('0x7')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xf880('0x7')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xf880('0x7')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xf880('0x7')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xde14=['exports','STRING','BOOLEAN','format','INTEGER','DATE','UNSIGNED','moment','sequelize'];(function(_0x17d114,_0x5a9988){var _0x95997b=function(_0x5e01e8){while(--_0x5e01e8){_0x17d114['push'](_0x17d114['shift']());}};_0x95997b(++_0x5a9988);}(_0xde14,0x127));var _0x4de1=function(_0x2e17c7,_0x4c05c5){_0x2e17c7=_0x2e17c7-0x0;var _0x29692a=_0xde14[_0x2e17c7];return _0x29692a;};'use strict';var moment=require(_0x4de1('0x0'));var Sequelize=require(_0x4de1('0x1'));module[_0x4de1('0x2')]={'phone':{'type':Sequelize[_0x4de1('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0x4de1('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x4de1('0x5')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x4de1('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x4de1('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x4de1('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x4de1('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x4de1('0x7')]},'priority':{'type':Sequelize[_0x4de1('0x6')](0x2)[_0x4de1('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x4de1('0x4')],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x4de1('0x6')],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0x4de1('0x6')]},'VoiceQueueId':{'type':Sequelize[_0x4de1('0x6')],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize[_0x4de1('0x6')]},'countnosuchnumberretry':{'type':Sequelize[_0x4de1('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x4de1('0x6')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x4de1('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x4de1('0x6')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index e6d033e..9f1cf51 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 _0x2947=['CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','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','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','error','stack','name','send','index','CmHopper','fieldName','type','model','map','query','keys','filters','intersection','concat','$and','$gt','$gte','$eq','$not','$notBetween','$notIn','$notLike','$iLike','$like','$contains','$contained','$any','attributes','fields','length','nolimit','sort','where','pick','filter','merge','options','includeAll','findAll','params','include','find','create','body','catch','describe','CampaignId','VoiceQueueId','Campaign','omit','dataValues','createdAt','updatedAt','state','statedesc','campaign','membername','user','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','CmContact','ContactId','firstName','isNil','lastName','calleridname','getPreview','preview','dialOrderByScheduledAt','transaction','direction','prev','isEmpty','hopperIds','priority','ASC','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','sequelize','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','LOCK','CmCompany','Company','CmList','List','VoiceQueue','Queue','dialActive','getOpenContacts','outbound'];(function(_0x277a87,_0x47a708){var _0xf75fd=function(_0x5e4b7e){while(--_0x5e4b7e){_0x277a87['push'](_0x277a87['shift']());}};_0xf75fd(++_0x47a708);}(_0x2947,0x1a9));var _0x7294=function(_0x47cefd,_0x31e500){_0x47cefd=_0x47cefd-0x0;var _0xe6bd21=_0x2947[_0x47cefd];return _0xe6bd21;};'use strict';var emlformat=require(_0x7294('0x0'));var rimraf=require(_0x7294('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7294('0x2'));var rp=require(_0x7294('0x3'));var moment=require(_0x7294('0x4'));var BPromise=require(_0x7294('0x5'));var Mustache=require(_0x7294('0x6'));var util=require(_0x7294('0x7'));var path=require(_0x7294('0x8'));var sox=require(_0x7294('0x9'));var csv=require(_0x7294('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7294('0xb'));var _=require(_0x7294('0xc'));var squel=require(_0x7294('0xd'));var crypto=require(_0x7294('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x7294('0xf'));var toCsv=require(_0x7294('0xa'));var querystring=require(_0x7294('0x10'));var Papa=require('papaparse');var Redis=require(_0x7294('0x11'));var authService=require(_0x7294('0x12'));var qs=require(_0x7294('0x13'));var as=require(_0x7294('0x14'));var hardwareService=require(_0x7294('0x15'));var logger=require(_0x7294('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x7294('0x17'));var licenseUtil=require(_0x7294('0x18'));var db=require(_0x7294('0x19'))['db'];function respondWithStatusCode(_0x3f31d2,_0x21d0dc){_0x21d0dc=_0x21d0dc||0xcc;return function(_0x25d865){if(_0x25d865){return _0x3f31d2[_0x7294('0x1a')](_0x21d0dc);}return _0x3f31d2[_0x7294('0x1b')](_0x21d0dc)[_0x7294('0x1c')]();};}function respondWithResult(_0x1a260a,_0x19fc54){_0x19fc54=_0x19fc54||0xc8;return function(_0x3efe31){if(_0x3efe31){return _0x1a260a[_0x7294('0x1b')](_0x19fc54)[_0x7294('0x1d')](_0x3efe31);}};}function respondWithFilteredResult(_0x1ab6ed,_0x3a21dd){return function(_0x5ed41d){if(_0x5ed41d){var _0x42ac67=typeof _0x3a21dd[_0x7294('0x1e')]===_0x7294('0x1f')&&typeof _0x3a21dd[_0x7294('0x20')]===_0x7294('0x1f');var _0x2bf8c1=_0x5ed41d['count'];var _0x2b3c36=_0x42ac67?0x0:_0x3a21dd['offset'];var _0x444e94=_0x42ac67?_0x5ed41d[_0x7294('0x21')]:_0x3a21dd[_0x7294('0x1e')]+_0x3a21dd[_0x7294('0x20')];var _0x102ecf;if(_0x444e94>=_0x2bf8c1){_0x444e94=_0x2bf8c1;_0x102ecf=0xc8;}else{_0x102ecf=0xce;}_0x1ab6ed[_0x7294('0x1b')](_0x102ecf);return _0x1ab6ed['set'](_0x7294('0x22'),_0x2b3c36+'-'+_0x444e94+'/'+_0x2bf8c1)[_0x7294('0x1d')](_0x5ed41d);}return null;};}function patchUpdates(_0x59d45c){return function(_0xc7634c){try{jsonpatch['apply'](_0xc7634c,_0x59d45c,!![]);}catch(_0x562304){return BPromise[_0x7294('0x23')](_0x562304);}return _0xc7634c[_0x7294('0x24')]();};}function saveUpdates(_0x100c09,_0x546eb7){return function(_0x3786aa){if(_0x3786aa){return _0x3786aa[_0x7294('0x25')](_0x100c09)[_0x7294('0x26')](function(_0x5b8d52){return _0x5b8d52;});}return null;};}function removeEntity(_0x315747,_0x58690f){return function(_0x44aceb){if(_0x44aceb){return _0x44aceb['destroy']()[_0x7294('0x26')](function(){_0x315747[_0x7294('0x1b')](0xcc)[_0x7294('0x1c')]();});}};}function handleEntityNotFound(_0x5551d0,_0x379ed3){return function(_0x1a5fdd){if(!_0x1a5fdd){_0x5551d0['sendStatus'](0x194);}return _0x1a5fdd;};}function handleError(_0xc6a63c,_0x4fcfa8){_0x4fcfa8=_0x4fcfa8||0x1f4;return function(_0x2d9065){logger[_0x7294('0x27')](_0x2d9065[_0x7294('0x28')]);if(_0x2d9065[_0x7294('0x29')]){delete _0x2d9065[_0x7294('0x29')];}_0xc6a63c[_0x7294('0x1b')](_0x4fcfa8)[_0x7294('0x2a')](_0x2d9065);};}exports[_0x7294('0x2b')]=function(_0x11e210,_0xe19b7b){var _0x1fe0e0={},_0x485b0d={},_0x30ee28={'count':0x0,'rows':[]};var _0x44a209=_['map'](db[_0x7294('0x2c')]['rawAttributes'],function(_0x4dd28e){return{'name':_0x4dd28e[_0x7294('0x2d')],'type':_0x4dd28e[_0x7294('0x2e')]['key']};});_0x485b0d[_0x7294('0x2f')]=_[_0x7294('0x30')](_0x44a209,_0x7294('0x29'));_0x485b0d[_0x7294('0x31')]=_[_0x7294('0x32')](_0x11e210['query']);_0x485b0d[_0x7294('0x33')]=_[_0x7294('0x34')](_0x485b0d[_0x7294('0x2f')],_0x485b0d['query']);_0x485b0d[_0x7294('0x33')]=_[_0x7294('0x35')](_0x485b0d[_0x7294('0x33')],[_0x7294('0x36'),'$or',_0x7294('0x37'),_0x7294('0x38'),'$lt','$lte','$ne',_0x7294('0x39'),_0x7294('0x3a'),'$between',_0x7294('0x3b'),'$in',_0x7294('0x3c'),'$like',_0x7294('0x3d'),_0x7294('0x3e'),'$notILike',_0x7294('0x3f'),'$overlap',_0x7294('0x40'),_0x7294('0x41'),_0x7294('0x42')]);_0x1fe0e0[_0x7294('0x43')]=_[_0x7294('0x34')](_0x485b0d[_0x7294('0x2f')],qs[_0x7294('0x44')](_0x11e210[_0x7294('0x31')][_0x7294('0x44')]));_0x1fe0e0[_0x7294('0x43')]=_0x1fe0e0[_0x7294('0x43')][_0x7294('0x45')]?_0x1fe0e0[_0x7294('0x43')]:_0x485b0d[_0x7294('0x2f')];if(!_0x11e210['query']['hasOwnProperty'](_0x7294('0x46'))){_0x1fe0e0['limit']=qs[_0x7294('0x20')](_0x11e210[_0x7294('0x31')][_0x7294('0x20')]);_0x1fe0e0['offset']=qs[_0x7294('0x1e')](_0x11e210[_0x7294('0x31')]['offset']);}_0x1fe0e0['order']=qs[_0x7294('0x47')](_0x11e210[_0x7294('0x31')][_0x7294('0x47')]);_0x1fe0e0[_0x7294('0x48')]=qs[_0x7294('0x33')](_[_0x7294('0x49')](_0x11e210[_0x7294('0x31')],_0x485b0d[_0x7294('0x33')]),_0x44a209);if(_0x11e210[_0x7294('0x31')][_0x7294('0x4a')]){_0x1fe0e0[_0x7294('0x48')]=_[_0x7294('0x4b')](_0x1fe0e0[_0x7294('0x48')],{'$or':_[_0x7294('0x30')](_0x44a209,function(_0x15e650){if(_0x15e650[_0x7294('0x2e')]!=='VIRTUAL'){var _0x24cff2={};_0x24cff2[_0x15e650[_0x7294('0x29')]]={'$like':'%'+_0x11e210['query'][_0x7294('0x4a')]+'%'};return _0x24cff2;}})});}_0x1fe0e0=_['merge']({},_0x1fe0e0,_0x11e210[_0x7294('0x4c')]);var _0x127b95={'where':_0x1fe0e0['where']};return db[_0x7294('0x2c')][_0x7294('0x21')](_0x127b95)['then'](function(_0x4db24d){_0x30ee28[_0x7294('0x21')]=_0x4db24d;if(_0x11e210[_0x7294('0x31')][_0x7294('0x4d')]){_0x1fe0e0['include']=[{'all':!![]}];}return db[_0x7294('0x2c')][_0x7294('0x4e')](_0x1fe0e0);})[_0x7294('0x26')](function(_0x86f311){_0x30ee28['rows']=_0x86f311;return _0x30ee28;})[_0x7294('0x26')](respondWithFilteredResult(_0xe19b7b,_0x1fe0e0))['catch'](handleError(_0xe19b7b,null));};exports['show']=function(_0x41d443,_0x41c061){var _0x4384ba={'raw':!![],'where':{'id':_0x41d443[_0x7294('0x4f')]['id']}},_0x157c65={};_0x157c65[_0x7294('0x2f')]=_[_0x7294('0x32')](db[_0x7294('0x2c')]['rawAttributes']);_0x157c65[_0x7294('0x31')]=_['keys'](_0x41d443[_0x7294('0x31')]);_0x157c65[_0x7294('0x33')]=_[_0x7294('0x34')](_0x157c65[_0x7294('0x2f')],_0x157c65['query']);_0x4384ba['attributes']=_['intersection'](_0x157c65[_0x7294('0x2f')],qs['fields'](_0x41d443['query'][_0x7294('0x44')]));_0x4384ba[_0x7294('0x43')]=_0x4384ba[_0x7294('0x43')][_0x7294('0x45')]?_0x4384ba[_0x7294('0x43')]:_0x157c65['model'];if(_0x41d443[_0x7294('0x31')]['includeAll']){_0x4384ba[_0x7294('0x50')]=[{'all':!![]}];}_0x4384ba=_[_0x7294('0x4b')]({},_0x4384ba,_0x41d443['options']);return db[_0x7294('0x2c')][_0x7294('0x51')](_0x4384ba)[_0x7294('0x26')](handleEntityNotFound(_0x41c061,null))[_0x7294('0x26')](respondWithResult(_0x41c061,null))['catch'](handleError(_0x41c061,null));};exports[_0x7294('0x52')]=function(_0x4883ca,_0x4b80fb){return db[_0x7294('0x2c')]['create'](_0x4883ca[_0x7294('0x53')],{})[_0x7294('0x26')](respondWithResult(_0x4b80fb,0xc9))[_0x7294('0x54')](handleError(_0x4b80fb,null));};exports['update']=function(_0x53b543,_0x218056){if(_0x53b543[_0x7294('0x53')]['id']){delete _0x53b543[_0x7294('0x53')]['id'];}return db['CmHopper'][_0x7294('0x51')]({'where':{'id':_0x53b543[_0x7294('0x4f')]['id']}})[_0x7294('0x26')](handleEntityNotFound(_0x218056,null))[_0x7294('0x26')](saveUpdates(_0x53b543['body'],null))[_0x7294('0x26')](respondWithResult(_0x218056,null))[_0x7294('0x54')](handleError(_0x218056,null));};exports[_0x7294('0x55')]=function(_0x3b1edb,_0x5987a6){return db[_0x7294('0x2c')][_0x7294('0x55')]()[_0x7294('0x26')](respondWithResult(_0x5987a6,null))[_0x7294('0x54')](handleError(_0x5987a6,null));};exports['destroy']=function(_0x2a31d7,_0x481f0f){var _0x6e59fe;return db[_0x7294('0x2c')][_0x7294('0x51')]({'where':{'id':_0x2a31d7[_0x7294('0x4f')]['id']}})[_0x7294('0x26')](handleEntityNotFound(_0x481f0f,null))[_0x7294('0x26')](function(_0x59db74){if(_0x59db74){return _0x59db74['destroy']()[_0x7294('0x26')](function(_0x5b2cbb){return _0x5b2cbb;});}})[_0x7294('0x26')](function(_0x2a5243){_0x6e59fe=_0x2a5243;if(_0x2a5243){if(_0x2a5243['VoiceQueueId']||_0x2a5243[_0x7294('0x56')]){return db[_0x2a5243[_0x7294('0x57')]?'VoiceQueue':_0x7294('0x58')][_0x7294('0x51')]({'where':{'id':_0x2a5243['VoiceQueueId']?_0x2a5243[_0x7294('0x57')]:_0x2a5243[_0x7294('0x56')]},'attributes':['id',_0x7294('0x29')],'raw':!![]});}}})[_0x7294('0x26')](function(_0x3647aa){var _0x54c8d7={};if(_0x3647aa){_[_0x7294('0x4b')](_0x54c8d7,_[_0x7294('0x59')](_0x6e59fe[_0x7294('0x5a')],[_0x7294('0x5b'),_0x7294('0x5c'),'id']));_0x54c8d7[_0x7294('0x5d')]=0x15;_0x54c8d7[_0x7294('0x5e')]='deleted';_0x54c8d7[_0x7294('0x5f')]=_0x3647aa[_0x7294('0x29')];_0x54c8d7[_0x7294('0x60')]=_0x2a31d7[_0x7294('0x61')]['name'];_0x54c8d7[_0x7294('0x62')]=_0x2a31d7[_0x7294('0x61')]['id'];_0x54c8d7['deleted']=!![];_0x54c8d7[_0x7294('0x63')]=moment()[_0x7294('0x64')](_0x7294('0x65'));_0x54c8d7[_0x7294('0x66')]=_0x6e59fe[_0x7294('0x67')];_0x54c8d7[_0x7294('0x68')]=_0x6e59fe[_0x7294('0x57')]?_0x7294('0x69'):'ivr';return db[_0x7294('0x6a')][_0x7294('0x51')]({'where':{'id':_0x54c8d7[_0x7294('0x6b')]},'attributes':[_0x7294('0x6c'),'lastName']})['then'](function(_0x32044f){if(!_[_0x7294('0x6d')](_0x481f0f)&&!_['isNil'](_0x32044f[_0x7294('0x6c')])){_0x54c8d7['calleridname']=_0x32044f[_0x7294('0x6c')];if(!_['isNil'](_0x32044f[_0x7294('0x6e')])){_0x54c8d7[_0x7294('0x6f')]+='\x20'+_0x32044f[_0x7294('0x6e')];}}})['finally'](function(){return db['CmHopperFinal'][_0x7294('0x52')](_0x54c8d7);});}})[_0x7294('0x26')](function(){return _0x481f0f['status'](0xcc)[_0x7294('0x1c')]();})[_0x7294('0x54')](handleError(_0x481f0f,null));};exports[_0x7294('0x70')]=function(_0x4c931d,_0x30b81f,_0x28e391){var _0x3ad3da=[];return db[_0x7294('0x6a')][_0x7294('0x55')]()[_0x7294('0x26')](function(_0x553793){_0x3ad3da=_[_0x7294('0x32')](_0x553793);return _0x4c931d['user']['getVoiceQueues']({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x7294('0x71')},'attributes':['id',_0x7294('0x72')],'raw':!![]});})[_0x7294('0x26')](function(_0x22ba0e){if(_0x22ba0e&&_0x22ba0e[_0x7294('0x45')]){return db['sequelize'][_0x7294('0x73')](function(_0x7861a6){var _0x2de801={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x7294('0x64')](_0x7294('0x65'))},'VoiceQueueId':{'$in':_[_0x7294('0x30')](_0x22ba0e,'id')},'$or':[{'UserId':null},{'UserId':_0x4c931d[_0x7294('0x61')]['id']}]};var _0x3f83b8=[];if(_0x4c931d['body'][_0x7294('0x74')]&&_0x4c931d[_0x7294('0x53')]['direction']===_0x7294('0x75')){if(!_[_0x7294('0x76')](_0x4c931d[_0x7294('0x53')][_0x7294('0x77')])){_0x2de801['id']={'$in':_0x4c931d[_0x7294('0x53')]['hopperIds']};}_0x3f83b8=[[_0x7294('0x78'),_0x7294('0x79')],['scheduledAt',_0x22ba0e[0x0][_0x7294('0x72')]===_0x7294('0x79')?_0x7294('0x7a'):_0x7294('0x79')],db['sequelize'][_0x7294('0x7b')](_0x7294('0x7c')),['id','DESC']];}else{if(!_[_0x7294('0x76')](_0x4c931d[_0x7294('0x53')][_0x7294('0x77')])){_0x2de801['id']={'$notIn':_0x4c931d[_0x7294('0x53')][_0x7294('0x77')]};}_0x3f83b8=[[_0x7294('0x78'),_0x7294('0x7a')],['scheduledAt',_0x22ba0e[0x0]['dialOrderByScheduledAt']],db[_0x7294('0x7d')]['literal'](_0x7294('0x7e')),['id',_0x7294('0x79')]];}return db[_0x7294('0x2c')][_0x7294('0x7f')]({'attributes':['id',_0x7294('0x80')],'where':_0x2de801,'order':_0x3f83b8,'transaction':_0x7861a6,'lock':_0x7861a6[_0x7294('0x81')]['UPDATE'],'include':[{'model':db[_0x7294('0x6a')],'as':'Contact','attributes':_0x3ad3da,'include':[{'model':db[_0x7294('0x82')],'as':_0x7294('0x83'),'attributes':['id',_0x7294('0x29')]}]},{'model':db[_0x7294('0x84')],'as':_0x7294('0x85'),'attributes':['id',_0x7294('0x29')]},{'model':db[_0x7294('0x86')],'as':_0x7294('0x87'),'attributes':['id','name',_0x7294('0x88')]}]})[_0x7294('0x26')](function(_0x399f3b){if(_0x399f3b){return _0x399f3b['update']({'UserId':_0x4c931d['user']['id']},{'transaction':_0x7861a6});}});});}})[_0x7294('0x26')](handleEntityNotFound(_0x30b81f,null))[_0x7294('0x26')](respondWithResult(_0x30b81f,null))[_0x7294('0x54')](handleError(_0x30b81f,null));};exports[_0x7294('0x89')]=function(_0x226f61,_0x5c1fd3,_0x33a0db){return _0x226f61[_0x7294('0x61')]['getVoiceQueues']({'where':{'type':_0x7294('0x8a'),'dialActive':!![],'dialMethod':_0x7294('0x71')},'attributes':['id'],'raw':!![]})[_0x7294('0x26')](function(_0xcc4a09){if(_0xcc4a09&&_0xcc4a09['length']){return db['CmHopper']['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x7294('0x65'))},'VoiceQueueId':{'$in':_['map'](_0xcc4a09,'id')},'$or':[{'UserId':null},{'UserId':_0x226f61[_0x7294('0x61')]['id']}]}});}return 0x0;})[_0x7294('0x26')](function(_0x3a3135){if(!_['isNil'](_0x3a3135)&&_['isNumber'](_0x3a3135)){return _0x5c1fd3[_0x7294('0x1b')](0xc8)[_0x7294('0x1d')]({'contacts':_0x3a3135});}else{logger['error'](_0x7294('0x8b'),_0x7294('0x89'),0x194,_0x7294('0x8c'));_0x5c1fd3['sendStatus'](0x194);}})[_0x7294('0x54')](handleError(_0x5c1fd3,null));}; \ No newline at end of file +var _0xc442=['show','params','find','create','body','describe','VoiceQueueId','Campaign','CampaignId','omit','dataValues','createdAt','updatedAt','deleted','membername','user','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','ivr','CmContact','ContactId','lastName','isNil','calleridname','firstName','getPreview','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','length','sequelize','direction','prev','isEmpty','hopperIds','priority','ASC','COALESCE(CmHopper.UserId,\x200)\x20ASC','DESC','scheduledAt','literal','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','LOCK','UPDATE','Contact','CmCompany','Company','CmList','List','VoiceQueue','getOpenContacts','isNumber','error','entity\x20not\x20found','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','reject','update','then','destroy','stack','name','send','index','map','CmHopper','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','concat','$or','$gt','$lt','$ne','$eq','$not','$notBetween','$in','$notIn','$like','$notLike','$iLike','$overlap','$contains','$contained','$any','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','catch'];(function(_0x934425,_0x5af72f){var _0x31d596=function(_0x219869){while(--_0x219869){_0x934425['push'](_0x934425['shift']());}};_0x31d596(++_0x5af72f);}(_0xc442,0x164));var _0x2c44=function(_0x2c5076,_0x9ce4e){_0x2c5076=_0x2c5076-0x0;var _0xeaa5d6=_0xc442[_0x2c5076];return _0xeaa5d6;};'use strict';var emlformat=require(_0x2c44('0x0'));var rimraf=require(_0x2c44('0x1'));var zipdir=require(_0x2c44('0x2'));var jsonpatch=require(_0x2c44('0x3'));var rp=require(_0x2c44('0x4'));var moment=require(_0x2c44('0x5'));var BPromise=require(_0x2c44('0x6'));var Mustache=require('mustache');var util=require(_0x2c44('0x7'));var path=require('path');var sox=require(_0x2c44('0x8'));var csv=require(_0x2c44('0x9'));var ejs=require(_0x2c44('0xa'));var fs=require('fs');var fs_extra=require(_0x2c44('0xb'));var _=require(_0x2c44('0xc'));var squel=require(_0x2c44('0xd'));var crypto=require(_0x2c44('0xe'));var jsforce=require(_0x2c44('0xf'));var deskjs=require(_0x2c44('0x10'));var toCsv=require(_0x2c44('0x9'));var querystring=require(_0x2c44('0x11'));var Papa=require('papaparse');var Redis=require(_0x2c44('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x2c44('0x13'));var as=require(_0x2c44('0x14'));var hardwareService=require(_0x2c44('0x15'));var logger=require(_0x2c44('0x16'))(_0x2c44('0x17'));var utils=require(_0x2c44('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x2c44('0x19'));var db=require(_0x2c44('0x1a'))['db'];function respondWithStatusCode(_0x2a410d,_0x231218){_0x231218=_0x231218||0xcc;return function(_0x31602a){if(_0x31602a){return _0x2a410d[_0x2c44('0x1b')](_0x231218);}return _0x2a410d[_0x2c44('0x1c')](_0x231218)[_0x2c44('0x1d')]();};}function respondWithResult(_0x285e2a,_0x261db6){_0x261db6=_0x261db6||0xc8;return function(_0x1ce7ee){if(_0x1ce7ee){return _0x285e2a[_0x2c44('0x1c')](_0x261db6)[_0x2c44('0x1e')](_0x1ce7ee);}};}function respondWithFilteredResult(_0x2ab8f6,_0x769a60){return function(_0x4198e6){if(_0x4198e6){var _0x26f51f=typeof _0x769a60[_0x2c44('0x1f')]===_0x2c44('0x20')&&typeof _0x769a60[_0x2c44('0x21')]===_0x2c44('0x20');var _0xd948cb=_0x4198e6['count'];var _0x19d40e=_0x26f51f?0x0:_0x769a60[_0x2c44('0x1f')];var _0x40beb2=_0x26f51f?_0x4198e6[_0x2c44('0x22')]:_0x769a60[_0x2c44('0x1f')]+_0x769a60['limit'];var _0x55f706;if(_0x40beb2>=_0xd948cb){_0x40beb2=_0xd948cb;_0x55f706=0xc8;}else{_0x55f706=0xce;}_0x2ab8f6[_0x2c44('0x1c')](_0x55f706);return _0x2ab8f6['set']('Content-Range',_0x19d40e+'-'+_0x40beb2+'/'+_0xd948cb)[_0x2c44('0x1e')](_0x4198e6);}return null;};}function patchUpdates(_0x390ac4){return function(_0x51d913){try{jsonpatch['apply'](_0x51d913,_0x390ac4,!![]);}catch(_0xc13e3c){return BPromise[_0x2c44('0x23')](_0xc13e3c);}return _0x51d913['save']();};}function saveUpdates(_0x22ea62,_0x76651a){return function(_0x6cb2be){if(_0x6cb2be){return _0x6cb2be[_0x2c44('0x24')](_0x22ea62)[_0x2c44('0x25')](function(_0xa63ecc){return _0xa63ecc;});}return null;};}function removeEntity(_0x613718,_0x1b2f1a){return function(_0x24e7dd){if(_0x24e7dd){return _0x24e7dd[_0x2c44('0x26')]()['then'](function(){_0x613718[_0x2c44('0x1c')](0xcc)[_0x2c44('0x1d')]();});}};}function handleEntityNotFound(_0x1ec671,_0x10c8de){return function(_0x1ec68a){if(!_0x1ec68a){_0x1ec671['sendStatus'](0x194);}return _0x1ec68a;};}function handleError(_0x40ada5,_0x505bca){_0x505bca=_0x505bca||0x1f4;return function(_0x3f42af){logger['error'](_0x3f42af[_0x2c44('0x27')]);if(_0x3f42af[_0x2c44('0x28')]){delete _0x3f42af['name'];}_0x40ada5[_0x2c44('0x1c')](_0x505bca)[_0x2c44('0x29')](_0x3f42af);};}exports[_0x2c44('0x2a')]=function(_0x258da7,_0x87d87d){var _0x470f41={},_0x26b0bd={},_0x3f8e4c={'count':0x0,'rows':[]};var _0x3d10f4=_[_0x2c44('0x2b')](db[_0x2c44('0x2c')][_0x2c44('0x2d')],function(_0x12f89a){return{'name':_0x12f89a[_0x2c44('0x2e')],'type':_0x12f89a[_0x2c44('0x2f')][_0x2c44('0x30')]};});_0x26b0bd[_0x2c44('0x31')]=_[_0x2c44('0x2b')](_0x3d10f4,_0x2c44('0x28'));_0x26b0bd[_0x2c44('0x32')]=_[_0x2c44('0x33')](_0x258da7[_0x2c44('0x32')]);_0x26b0bd[_0x2c44('0x34')]=_[_0x2c44('0x35')](_0x26b0bd['model'],_0x26b0bd[_0x2c44('0x32')]);_0x26b0bd['filters']=_[_0x2c44('0x36')](_0x26b0bd[_0x2c44('0x34')],['$and',_0x2c44('0x37'),_0x2c44('0x38'),'$gte',_0x2c44('0x39'),'$lte',_0x2c44('0x3a'),_0x2c44('0x3b'),_0x2c44('0x3c'),'$between',_0x2c44('0x3d'),_0x2c44('0x3e'),_0x2c44('0x3f'),_0x2c44('0x40'),_0x2c44('0x41'),_0x2c44('0x42'),'$notILike',_0x2c44('0x40'),_0x2c44('0x43'),_0x2c44('0x44'),_0x2c44('0x45'),_0x2c44('0x46')]);_0x470f41[_0x2c44('0x47')]=_['intersection'](_0x26b0bd['model'],qs[_0x2c44('0x48')](_0x258da7['query'][_0x2c44('0x48')]));_0x470f41['attributes']=_0x470f41[_0x2c44('0x47')]['length']?_0x470f41['attributes']:_0x26b0bd['model'];if(!_0x258da7[_0x2c44('0x32')][_0x2c44('0x49')](_0x2c44('0x4a'))){_0x470f41[_0x2c44('0x21')]=qs[_0x2c44('0x21')](_0x258da7[_0x2c44('0x32')]['limit']);_0x470f41[_0x2c44('0x1f')]=qs[_0x2c44('0x1f')](_0x258da7['query'][_0x2c44('0x1f')]);}_0x470f41['order']=qs['sort'](_0x258da7['query'][_0x2c44('0x4b')]);_0x470f41[_0x2c44('0x4c')]=qs['filters'](_[_0x2c44('0x4d')](_0x258da7[_0x2c44('0x32')],_0x26b0bd[_0x2c44('0x34')]),_0x3d10f4);if(_0x258da7[_0x2c44('0x32')][_0x2c44('0x4e')]){_0x470f41['where']=_[_0x2c44('0x4f')](_0x470f41['where'],{'$or':_['map'](_0x3d10f4,function(_0x53f264){if(_0x53f264['type']!==_0x2c44('0x50')){var _0x1f7f30={};_0x1f7f30[_0x53f264[_0x2c44('0x28')]]={'$like':'%'+_0x258da7[_0x2c44('0x32')][_0x2c44('0x4e')]+'%'};return _0x1f7f30;}})});}_0x470f41=_[_0x2c44('0x4f')]({},_0x470f41,_0x258da7[_0x2c44('0x51')]);var _0x2e05a7={'where':_0x470f41['where']};return db[_0x2c44('0x2c')][_0x2c44('0x22')](_0x2e05a7)['then'](function(_0x3dd939){_0x3f8e4c['count']=_0x3dd939;if(_0x258da7['query'][_0x2c44('0x52')]){_0x470f41[_0x2c44('0x53')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x470f41);})['then'](function(_0xf05118){_0x3f8e4c['rows']=_0xf05118;return _0x3f8e4c;})[_0x2c44('0x25')](respondWithFilteredResult(_0x87d87d,_0x470f41))[_0x2c44('0x54')](handleError(_0x87d87d,null));};exports[_0x2c44('0x55')]=function(_0x1485c4,_0x2cfbc1){var _0x14eed8={'raw':!![],'where':{'id':_0x1485c4[_0x2c44('0x56')]['id']}},_0x568501={};_0x568501[_0x2c44('0x31')]=_[_0x2c44('0x33')](db['CmHopper']['rawAttributes']);_0x568501[_0x2c44('0x32')]=_[_0x2c44('0x33')](_0x1485c4[_0x2c44('0x32')]);_0x568501[_0x2c44('0x34')]=_[_0x2c44('0x35')](_0x568501[_0x2c44('0x31')],_0x568501[_0x2c44('0x32')]);_0x14eed8['attributes']=_['intersection'](_0x568501['model'],qs[_0x2c44('0x48')](_0x1485c4[_0x2c44('0x32')][_0x2c44('0x48')]));_0x14eed8[_0x2c44('0x47')]=_0x14eed8[_0x2c44('0x47')]['length']?_0x14eed8[_0x2c44('0x47')]:_0x568501['model'];if(_0x1485c4['query'][_0x2c44('0x52')]){_0x14eed8['include']=[{'all':!![]}];}_0x14eed8=_[_0x2c44('0x4f')]({},_0x14eed8,_0x1485c4[_0x2c44('0x51')]);return db['CmHopper'][_0x2c44('0x57')](_0x14eed8)[_0x2c44('0x25')](handleEntityNotFound(_0x2cfbc1,null))[_0x2c44('0x25')](respondWithResult(_0x2cfbc1,null))[_0x2c44('0x54')](handleError(_0x2cfbc1,null));};exports[_0x2c44('0x58')]=function(_0x21281f,_0x1c8169){return db[_0x2c44('0x2c')][_0x2c44('0x58')](_0x21281f[_0x2c44('0x59')],{})['then'](respondWithResult(_0x1c8169,0xc9))[_0x2c44('0x54')](handleError(_0x1c8169,null));};exports[_0x2c44('0x24')]=function(_0x32d00d,_0x331b55){if(_0x32d00d[_0x2c44('0x59')]['id']){delete _0x32d00d[_0x2c44('0x59')]['id'];}return db[_0x2c44('0x2c')][_0x2c44('0x57')]({'where':{'id':_0x32d00d[_0x2c44('0x56')]['id']}})['then'](handleEntityNotFound(_0x331b55,null))[_0x2c44('0x25')](saveUpdates(_0x32d00d[_0x2c44('0x59')],null))[_0x2c44('0x25')](respondWithResult(_0x331b55,null))[_0x2c44('0x54')](handleError(_0x331b55,null));};exports[_0x2c44('0x5a')]=function(_0x17fa04,_0x56b82f){return db[_0x2c44('0x2c')]['describe']()[_0x2c44('0x25')](respondWithResult(_0x56b82f,null))[_0x2c44('0x54')](handleError(_0x56b82f,null));};exports[_0x2c44('0x26')]=function(_0x6e0e34,_0x31d37c){var _0x376de1;return db[_0x2c44('0x2c')][_0x2c44('0x57')]({'where':{'id':_0x6e0e34['params']['id']}})[_0x2c44('0x25')](handleEntityNotFound(_0x31d37c,null))[_0x2c44('0x25')](function(_0x1e5ff5){if(_0x1e5ff5){return _0x1e5ff5[_0x2c44('0x26')]()[_0x2c44('0x25')](function(_0x39b032){return _0x39b032;});}})['then'](function(_0x3333a2){_0x376de1=_0x3333a2;if(_0x3333a2){if(_0x3333a2[_0x2c44('0x5b')]||_0x3333a2['CampaignId']){return db[_0x3333a2['VoiceQueueId']?'VoiceQueue':_0x2c44('0x5c')][_0x2c44('0x57')]({'where':{'id':_0x3333a2['VoiceQueueId']?_0x3333a2['VoiceQueueId']:_0x3333a2[_0x2c44('0x5d')]},'attributes':['id',_0x2c44('0x28')],'raw':!![]});}}})[_0x2c44('0x25')](function(_0xa80de1){var _0x4b0148={};if(_0xa80de1){_[_0x2c44('0x4f')](_0x4b0148,_[_0x2c44('0x5e')](_0x376de1[_0x2c44('0x5f')],[_0x2c44('0x60'),_0x2c44('0x61'),'id']));_0x4b0148['state']=0x15;_0x4b0148['statedesc']=_0x2c44('0x62');_0x4b0148['campaign']=_0xa80de1[_0x2c44('0x28')];_0x4b0148[_0x2c44('0x63')]=_0x6e0e34[_0x2c44('0x64')][_0x2c44('0x28')];_0x4b0148[_0x2c44('0x65')]=_0x6e0e34[_0x2c44('0x64')]['id'];_0x4b0148[_0x2c44('0x62')]=!![];_0x4b0148[_0x2c44('0x66')]=moment()[_0x2c44('0x67')](_0x2c44('0x68'));_0x4b0148[_0x2c44('0x69')]=_0x376de1[_0x2c44('0x6a')];_0x4b0148[_0x2c44('0x6b')]=_0x376de1[_0x2c44('0x5b')]?_0x2c44('0x6c'):_0x2c44('0x6d');return db[_0x2c44('0x6e')][_0x2c44('0x57')]({'where':{'id':_0x4b0148[_0x2c44('0x6f')]},'attributes':['firstName',_0x2c44('0x70')]})[_0x2c44('0x25')](function(_0x1bb5f3){if(!_['isNil'](_0x31d37c)&&!_[_0x2c44('0x71')](_0x1bb5f3['firstName'])){_0x4b0148[_0x2c44('0x72')]=_0x1bb5f3[_0x2c44('0x73')];if(!_[_0x2c44('0x71')](_0x1bb5f3[_0x2c44('0x70')])){_0x4b0148['calleridname']+='\x20'+_0x1bb5f3[_0x2c44('0x70')];}}})['finally'](function(){return db['CmHopperFinal'][_0x2c44('0x58')](_0x4b0148);});}})[_0x2c44('0x25')](function(){return _0x31d37c[_0x2c44('0x1c')](0xcc)[_0x2c44('0x1d')]();})[_0x2c44('0x54')](handleError(_0x31d37c,null));};exports[_0x2c44('0x74')]=function(_0xe2bb57,_0x4cd168,_0x14c154){var _0x58336c=[];return db[_0x2c44('0x6e')]['describe']()[_0x2c44('0x25')](function(_0x4f9ce5){_0x58336c=_[_0x2c44('0x33')](_0x4f9ce5);return _0xe2bb57['user'][_0x2c44('0x75')]({'where':{'type':_0x2c44('0x76'),'dialActive':!![],'dialMethod':_0x2c44('0x77')},'attributes':['id',_0x2c44('0x78')],'raw':!![]});})['then'](function(_0x4fb989){if(_0x4fb989&&_0x4fb989[_0x2c44('0x79')]){return db[_0x2c44('0x7a')]['transaction'](function(_0x262402){var _0x1b14ac={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x2c44('0x67')](_0x2c44('0x68'))},'VoiceQueueId':{'$in':_[_0x2c44('0x2b')](_0x4fb989,'id')},'$or':[{'UserId':null},{'UserId':_0xe2bb57[_0x2c44('0x64')]['id']}]};var _0x418d4d=[];if(_0xe2bb57[_0x2c44('0x59')][_0x2c44('0x7b')]&&_0xe2bb57[_0x2c44('0x59')][_0x2c44('0x7b')]===_0x2c44('0x7c')){if(!_[_0x2c44('0x7d')](_0xe2bb57[_0x2c44('0x59')][_0x2c44('0x7e')])){_0x1b14ac['id']={'$in':_0xe2bb57[_0x2c44('0x59')][_0x2c44('0x7e')]};}_0x418d4d=[[_0x2c44('0x7f'),'ASC'],['scheduledAt',_0x4fb989[0x0]['dialOrderByScheduledAt']==='ASC'?'DESC':_0x2c44('0x80')],db['sequelize']['literal'](_0x2c44('0x81')),['id',_0x2c44('0x82')]];}else{if(!_['isEmpty'](_0xe2bb57[_0x2c44('0x59')]['hopperIds'])){_0x1b14ac['id']={'$notIn':_0xe2bb57[_0x2c44('0x59')][_0x2c44('0x7e')]};}_0x418d4d=[[_0x2c44('0x7f'),_0x2c44('0x82')],[_0x2c44('0x83'),_0x4fb989[0x0][_0x2c44('0x78')]],db[_0x2c44('0x7a')][_0x2c44('0x84')](_0x2c44('0x85')),['id',_0x2c44('0x80')]];}return db[_0x2c44('0x2c')][_0x2c44('0x86')]({'attributes':['id','scheduledat'],'where':_0x1b14ac,'order':_0x418d4d,'transaction':_0x262402,'lock':_0x262402[_0x2c44('0x87')][_0x2c44('0x88')],'include':[{'model':db['CmContact'],'as':_0x2c44('0x89'),'attributes':_0x58336c,'include':[{'model':db[_0x2c44('0x8a')],'as':_0x2c44('0x8b'),'attributes':['id',_0x2c44('0x28')]}]},{'model':db[_0x2c44('0x8c')],'as':_0x2c44('0x8d'),'attributes':['id','name']},{'model':db[_0x2c44('0x8e')],'as':'Queue','attributes':['id','name','dialActive']}]})['then'](function(_0x349f88){if(_0x349f88){return _0x349f88[_0x2c44('0x24')]({'UserId':_0xe2bb57[_0x2c44('0x64')]['id']},{'transaction':_0x262402});}});});}})['then'](handleEntityNotFound(_0x4cd168,null))[_0x2c44('0x25')](respondWithResult(_0x4cd168,null))['catch'](handleError(_0x4cd168,null));};exports[_0x2c44('0x8f')]=function(_0x99be0c,_0x4da9cf,_0x290551){return _0x99be0c[_0x2c44('0x64')][_0x2c44('0x75')]({'where':{'type':_0x2c44('0x76'),'dialActive':!![],'dialMethod':_0x2c44('0x77')},'attributes':['id'],'raw':!![]})['then'](function(_0x335c3d){if(_0x335c3d&&_0x335c3d[_0x2c44('0x79')]){return db[_0x2c44('0x2c')][_0x2c44('0x22')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x2c44('0x67')](_0x2c44('0x68'))},'VoiceQueueId':{'$in':_[_0x2c44('0x2b')](_0x335c3d,'id')},'$or':[{'UserId':null},{'UserId':_0x99be0c[_0x2c44('0x64')]['id']}]}});}return 0x0;})[_0x2c44('0x25')](function(_0xb16fcb){if(!_[_0x2c44('0x71')](_0xb16fcb)&&_[_0x2c44('0x90')](_0xb16fcb)){return _0x4da9cf[_0x2c44('0x1c')](0xc8)[_0x2c44('0x1e')]({'contacts':_0xb16fcb});}else{logger[_0x2c44('0x91')]('CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts',0x194,_0x2c44('0x92'));_0x4da9cf[_0x2c44('0x1b')](0x194);}})[_0x2c44('0x54')](handleError(_0x4da9cf,null));}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 93c214e..7bebe12 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 _0x2eb2=['request-promise','rimraf','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority','util','../../config/logger','api','moment','bluebird'];(function(_0xe1dc2a,_0x4946fe){var _0x361050=function(_0x4e16ba){while(--_0x4e16ba){_0xe1dc2a['push'](_0xe1dc2a['shift']());}};_0x361050(++_0x4946fe);}(_0x2eb2,0x19f));var _0x22eb=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0x2eb2[_0x24237f];return _0x48298e;};'use strict';var _=require('lodash');var util=require(_0x22eb('0x0'));var logger=require(_0x22eb('0x1'))(_0x22eb('0x2'));var moment=require(_0x22eb('0x3'));var BPromise=require(_0x22eb('0x4'));var rp=require(_0x22eb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x22eb('0x6'));var config=require('../../config/environment');var attributes=require('./cmHopper.attributes');module[_0x22eb('0x7')]=function(_0x10e116,_0x35dd5b){return _0x10e116[_0x22eb('0x8')](_0x22eb('0x9'),attributes,{'tableName':_0x22eb('0xa'),'paranoid':![],'indexes':[{'name':_0x22eb('0xb'),'fields':[_0x22eb('0xb')]},{'name':_0x22eb('0xc'),'fields':[_0x22eb('0xc')]},{'name':_0x22eb('0xd'),'fields':[_0x22eb('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xda19=['define','CmHopper','cm_hopper','scheduledat','priority','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./cmHopper.attributes','exports'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0xda19,0xd5));var _0x9da1=function(_0xb6531d,_0x2dbff7){_0xb6531d=_0xb6531d-0x0;var _0x261e02=_0xda19[_0xb6531d];return _0x261e02;};'use strict';var _=require('lodash');var util=require(_0x9da1('0x0'));var logger=require(_0x9da1('0x1'))('api');var moment=require(_0x9da1('0x2'));var BPromise=require('bluebird');var rp=require(_0x9da1('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9da1('0x4'));var config=require(_0x9da1('0x5'));var attributes=require(_0x9da1('0x6'));module[_0x9da1('0x7')]=function(_0x156faf,_0x2dcbc6){return _0x156faf[_0x9da1('0x8')](_0x9da1('0x9'),attributes,{'tableName':_0x9da1('0xa'),'paranoid':![],'indexes':[{'name':_0x9da1('0xb'),'fields':['scheduledat']},{'name':'phone','fields':['phone']},{'name':_0x9da1('0xc'),'fields':['priority']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index b63eb13..a668c08 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 _0x28ec=['message','info','catch','GetCmHopper','CmHopper','findAll','options','raw','where','map','model','attributes','include','stringify','ShowCmHopper','find','CreateCmHopper','create','body','UpdateCmHopper','DestroyCmHopper','destroy','CmContact','sequelize','transaction','LOCK','UPDATE','Contact','User','Agent','name','UserId','push','update','includes','all','GetContactDialer','MoveContactManagedDialer','CountReScheduled','COUNT','literal','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','GetContactRecallMe','describe','order','GetCmHopperPreview','limit','keys','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','then','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','error','code'];(function(_0xbd0d43,_0x8492c3){var _0x2c45e6=function(_0x4a42c1){while(--_0x4a42c1){_0xbd0d43['push'](_0xbd0d43['shift']());}};_0x2c45e6(++_0x8492c3);}(_0x28ec,0x73));var _0xc28e=function(_0x257c85,_0x5bb1cd){_0x257c85=_0x257c85-0x0;var _0xac1ef3=_0x28ec[_0x257c85];return _0xac1ef3;};'use strict';var _=require('lodash');var util=require(_0xc28e('0x0'));var moment=require(_0xc28e('0x1'));var BPromise=require('bluebird');var rs=require(_0xc28e('0x2'));var fs=require('fs');var Redis=require(_0xc28e('0x3'));var db=require(_0xc28e('0x4'))['db'];var utils=require(_0xc28e('0x5'));var logger=require('../../config/logger')(_0xc28e('0x6'));var config=require(_0xc28e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc28e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x18cd02,_0x3e4393,_0x4552e3){return new BPromise(function(_0x243b3f,_0x115c79){return client[_0xc28e('0x9')](_0x18cd02,_0x4552e3)[_0xc28e('0xa')](function(_0x5d8c25){logger['info'](_0xc28e('0xb'),_0x3e4393,_0xc28e('0xc'));logger[_0xc28e('0xd')](_0xc28e('0xe'),_0x3e4393,_0xc28e('0xc'),JSON['stringify'](_0x5d8c25));if(_0x5d8c25[_0xc28e('0xf')]){if(_0x5d8c25[_0xc28e('0xf')][_0xc28e('0x10')]===0x1f4){logger[_0xc28e('0xf')](_0xc28e('0xb'),_0x3e4393,_0x5d8c25[_0xc28e('0xf')]['message']);return _0x115c79(_0x5d8c25[_0xc28e('0xf')]['message']);}logger['error'](_0xc28e('0xb'),_0x3e4393,_0x5d8c25['error']['message']);return _0x243b3f(_0x5d8c25[_0xc28e('0xf')][_0xc28e('0x11')]);}else{logger[_0xc28e('0x12')](_0xc28e('0xb'),_0x3e4393,'request\x20sent');_0x243b3f(_0x5d8c25['result'][_0xc28e('0x11')]);}})[_0xc28e('0x13')](function(_0x33f44a){logger['error'](_0xc28e('0xb'),_0x3e4393,_0x33f44a);_0x115c79(_0x33f44a);});});}exports[_0xc28e('0x14')]=function(_0x4fb487){var _0x3d9ffa=this;return new Promise(function(_0x1680d5,_0x3fbedc){return db[_0xc28e('0x15')][_0xc28e('0x16')]({'raw':_0x4fb487[_0xc28e('0x17')]?_0x4fb487['options'][_0xc28e('0x18')]===undefined?!![]:![]:!![],'where':_0x4fb487[_0xc28e('0x17')]?_0x4fb487[_0xc28e('0x17')][_0xc28e('0x19')]||null:null,'attributes':_0x4fb487[_0xc28e('0x17')]?_0x4fb487['options']['attributes']||null:null,'limit':_0x4fb487[_0xc28e('0x17')]?_0x4fb487[_0xc28e('0x17')]['limit']||null:null,'include':_0x4fb487['options']?_0x4fb487[_0xc28e('0x17')]['include']?_[_0xc28e('0x1a')](_0x4fb487['options']['include'],function(_0x17fa0a){return{'model':db[_0x17fa0a[_0xc28e('0x1b')]],'as':_0x17fa0a['as'],'attributes':_0x17fa0a[_0xc28e('0x1c')],'include':_0x17fa0a[_0xc28e('0x1d')]?_[_0xc28e('0x1a')](_0x17fa0a['include'],function(_0x49a35b){return{'model':db[_0x49a35b['model']],'as':_0x49a35b['as'],'attributes':_0x49a35b[_0xc28e('0x1c')],'include':_0x49a35b[_0xc28e('0x1d')]?_[_0xc28e('0x1a')](_0x49a35b[_0xc28e('0x1d')],function(_0x8a2ee8){return{'model':db[_0x8a2ee8[_0xc28e('0x1b')]],'as':_0x8a2ee8['as'],'attributes':_0x8a2ee8[_0xc28e('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1531a8){logger[_0xc28e('0x12')](_0xc28e('0x14'),_0x4fb487);logger[_0xc28e('0xd')](_0xc28e('0x14'),_0x4fb487,JSON[_0xc28e('0x1e')](_0x1531a8));_0x1680d5(_0x1531a8);})[_0xc28e('0x13')](function(_0x27230c){logger[_0xc28e('0xf')](_0xc28e('0x14'),_0x27230c[_0xc28e('0x11')],_0x4fb487);_0x3fbedc(_0x3d9ffa[_0xc28e('0xf')](0x1f4,_0x27230c['message']));});});};exports[_0xc28e('0x1f')]=function(_0x584942){var _0x93ac89=this;return new Promise(function(_0x366547,_0x536773){return db['CmHopper'][_0xc28e('0x20')]({'raw':_0x584942[_0xc28e('0x17')]?_0x584942[_0xc28e('0x17')][_0xc28e('0x18')]===undefined?!![]:![]:!![],'where':_0x584942['options']?_0x584942[_0xc28e('0x17')][_0xc28e('0x19')]||null:null,'attributes':_0x584942['options']?_0x584942[_0xc28e('0x17')][_0xc28e('0x1c')]||null:null,'include':_0x584942[_0xc28e('0x17')]?_0x584942[_0xc28e('0x17')][_0xc28e('0x1d')]?_['map'](_0x584942[_0xc28e('0x17')]['include'],function(_0x34c28a){return{'model':db[_0x34c28a['model']],'as':_0x34c28a['as'],'attributes':_0x34c28a[_0xc28e('0x1c')],'include':_0x34c28a[_0xc28e('0x1d')]?_[_0xc28e('0x1a')](_0x34c28a[_0xc28e('0x1d')],function(_0x33d314){return{'model':db[_0x33d314['model']],'as':_0x33d314['as'],'attributes':_0x33d314['attributes'],'include':_0x33d314[_0xc28e('0x1d')]?_[_0xc28e('0x1a')](_0x33d314['include'],function(_0x289d38){return{'model':db[_0x289d38['model']],'as':_0x289d38['as'],'attributes':_0x289d38['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3fe05c){logger[_0xc28e('0x12')](_0xc28e('0x1f'),_0x584942);logger[_0xc28e('0xd')]('ShowCmHopper',_0x584942,JSON['stringify'](_0x3fe05c));_0x366547(_0x3fe05c);})[_0xc28e('0x13')](function(_0x2f3e2a){logger[_0xc28e('0xf')](_0xc28e('0x1f'),_0x2f3e2a[_0xc28e('0x11')],_0x584942);_0x536773(_0x93ac89[_0xc28e('0xf')](0x1f4,_0x2f3e2a[_0xc28e('0x11')]));});});};exports[_0xc28e('0x21')]=function(_0x31f5fd){var _0x55c8e8=this;return new Promise(function(_0xfc1ba4,_0x5ca88a){return db[_0xc28e('0x15')][_0xc28e('0x22')](_0x31f5fd[_0xc28e('0x23')],{'raw':_0x31f5fd[_0xc28e('0x17')]?_0x31f5fd['options'][_0xc28e('0x18')]===undefined?!![]:![]:!![]})[_0xc28e('0xa')](function(_0x4bd579){logger[_0xc28e('0x12')](_0xc28e('0x21'),_0x31f5fd);logger[_0xc28e('0xd')]('CreateCmHopper',_0x31f5fd,JSON[_0xc28e('0x1e')](_0x4bd579));_0xfc1ba4(_0x4bd579);})[_0xc28e('0x13')](function(_0x387547){logger[_0xc28e('0xf')](_0xc28e('0x21'),_0x387547[_0xc28e('0x11')],_0x31f5fd);_0x5ca88a(_0x55c8e8['error'](0x1f4,_0x387547['message']));});});};exports[_0xc28e('0x24')]=function(_0x5e1e09){var _0x347c2b=this;return new Promise(function(_0x229f19,_0x51f9f6){return db['CmHopper']['update'](_0x5e1e09[_0xc28e('0x23')],{'raw':_0x5e1e09[_0xc28e('0x17')]?_0x5e1e09[_0xc28e('0x17')][_0xc28e('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5e1e09[_0xc28e('0x17')]?_0x5e1e09['options'][_0xc28e('0x19')]||null:null,'attributes':_0x5e1e09[_0xc28e('0x17')]?_0x5e1e09[_0xc28e('0x17')]['attributes']||null:null,'limit':_0x5e1e09['options']?_0x5e1e09[_0xc28e('0x17')]['limit']||null:null})['then'](function(_0x32d82a){logger[_0xc28e('0x12')](_0xc28e('0x24'),_0x5e1e09);logger[_0xc28e('0xd')](_0xc28e('0x24'),_0x5e1e09,JSON[_0xc28e('0x1e')](_0x32d82a));_0x229f19(_0x32d82a);})[_0xc28e('0x13')](function(_0x268946){logger[_0xc28e('0xf')]('UpdateCmHopper',_0x268946[_0xc28e('0x11')],_0x5e1e09);_0x51f9f6(_0x347c2b['error'](0x1f4,_0x268946[_0xc28e('0x11')]));});});};exports[_0xc28e('0x25')]=function(_0x2fb4fb){var _0x5d8d51=this;return new Promise(function(_0x3ad073,_0x3b0e64){return db['CmHopper'][_0xc28e('0x26')]({'where':_0x2fb4fb[_0xc28e('0x17')]?_0x2fb4fb[_0xc28e('0x17')][_0xc28e('0x19')]||null:null})[_0xc28e('0xa')](function(_0x46a46d){logger['info']('DestroyCmHopper',_0x2fb4fb);logger[_0xc28e('0xd')]('DestroyCmHopper',_0x2fb4fb,JSON[_0xc28e('0x1e')](_0x46a46d));_0x3ad073(_0x46a46d);})[_0xc28e('0x13')](function(_0x1a1b46){logger['error'](_0xc28e('0x25'),_0x1a1b46[_0xc28e('0x11')],_0x2fb4fb);_0x3b0e64(_0x5d8d51['error'](0x1f4,_0x1a1b46[_0xc28e('0x11')]));});});};exports['GetContactDialer']=function(_0x1ea59d){var _0x3d3895=this;return new Promise(function(_0x1e36d5,_0x2c1f69){return db[_0xc28e('0x27')]['describe']()[_0xc28e('0xa')](function(_0x3a57c8){return db[_0xc28e('0x28')][_0xc28e('0x29')](function(_0x47e991){return db[_0xc28e('0x15')][_0xc28e('0x16')]({'where':_0x1ea59d['options']?_0x1ea59d[_0xc28e('0x17')]['where']||null:null,'attributes':_0x1ea59d[_0xc28e('0x17')]?_0x1ea59d[_0xc28e('0x17')][_0xc28e('0x1c')]||null:null,'limit':_0x1ea59d[_0xc28e('0x17')]?_0x1ea59d[_0xc28e('0x17')]['limit']||null:null,'order':_0x1ea59d[_0xc28e('0x17')]?_0x1ea59d[_0xc28e('0x17')]['order']||null:null,'transaction':_0x47e991,'lock':_0x47e991[_0xc28e('0x2a')][_0xc28e('0x2b')],'include':[{'model':db[_0xc28e('0x27')],'as':_0xc28e('0x2c'),'attributes':_['keys'](_0x3a57c8)},{'model':db[_0xc28e('0x2d')],'as':_0xc28e('0x2e'),'attributes':['id',_0xc28e('0x2f'),'voicePause']}]})[_0xc28e('0xa')](function(_0x27a52c){var _0xd77f9b=[];var _0x245645=[];for(var _0x2e358d=0x0;_0x2e358d<_0x27a52c['length'];_0x2e358d+=0x1){var _0x29ac7e=_0x27a52c[_0x2e358d][_0xc28e('0x30')];if(_0x29ac7e===null){_0xd77f9b[_0xc28e('0x31')](_0x27a52c[_0x2e358d][_0xc28e('0x32')](_0x1ea59d[_0xc28e('0x23')],{'transaction':_0x47e991}));}else if(!_0x245645[_0xc28e('0x33')](_0x29ac7e)){_0x245645[_0xc28e('0x31')](_0x29ac7e);_0xd77f9b[_0xc28e('0x31')](_0x27a52c[_0x2e358d][_0xc28e('0x32')](_0x1ea59d[_0xc28e('0x23')],{'transaction':_0x47e991}));}}return BPromise[_0xc28e('0x34')](_0xd77f9b);});})[_0xc28e('0xa')](function(_0x295e49){logger['info'](_0xc28e('0x35'),_0x1ea59d);logger[_0xc28e('0xd')](_0xc28e('0x35'),_0x1ea59d,JSON[_0xc28e('0x1e')](_0x295e49));_0x1e36d5(_0x295e49);})['catch'](function(_0x40ccce){logger[_0xc28e('0xf')](_0xc28e('0x35'),_0x40ccce[_0xc28e('0x11')],_0x1ea59d);_0x2c1f69(_0x3d3895[_0xc28e('0xf')](0x1f4,_0x40ccce[_0xc28e('0x11')]));});});});};exports['MoveContactManagedDialer']=function(_0x3f07df){var _0x3d84f7=this;return new Promise(function(_0x3bac48,_0x2a28b1){return db[_0xc28e('0x28')][_0xc28e('0x29')](function(_0x1b6dcb){return db['CmHopperFinal'][_0xc28e('0x22')](_0x3f07df[_0xc28e('0x23')],{'raw':_0x3f07df['options']?_0x3f07df[_0xc28e('0x17')][_0xc28e('0x18')]===undefined?!![]:![]:!![],'transaction':_0x1b6dcb})[_0xc28e('0xa')](function(){return db[_0xc28e('0x15')][_0xc28e('0x26')]({'where':_0x3f07df['options']?_0x3f07df[_0xc28e('0x17')][_0xc28e('0x19')]||null:null,'transaction':_0x1b6dcb});});})[_0xc28e('0xa')](function(_0x46b5d2){logger[_0xc28e('0x12')](_0xc28e('0x36'),_0x3f07df);logger[_0xc28e('0xd')]('MoveContactManagedDialer',_0x3f07df,JSON['stringify'](_0x46b5d2));_0x3bac48(_0x46b5d2);})[_0xc28e('0x13')](function(_0x3fbc45){logger[_0xc28e('0xf')](_0xc28e('0x36'),_0x3fbc45['message'],_0x3f07df);_0x2a28b1(_0x3d84f7[_0xc28e('0xf')](0x1f4,_0x3fbc45[_0xc28e('0x11')]));});});};exports[_0xc28e('0x37')]=function(_0x480fbd){var _0x3faa67=this;return new Promise(function(_0x1ebc95,_0x13ecfa){return db[_0xc28e('0x15')]['findAll']({'raw':_0x480fbd['options']?_0x480fbd[_0xc28e('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x480fbd['options']?_0x480fbd[_0xc28e('0x17')][_0xc28e('0x19')]||null:null,'attributes':[[db['sequelize']['fn'](_0xc28e('0x38'),db[_0xc28e('0x28')]['fn']('IF',db[_0xc28e('0x28')][_0xc28e('0x39')]('`scheduledat`\x20>=\x20'+util['format'](_0xc28e('0x3a'),moment()['format'](_0xc28e('0x3b')))+'\x20,\x201,\x20null'))),'contactsRescheduled']]})[_0xc28e('0xa')](function(_0x3a919a){logger['info']('CountReScheduled',_0x480fbd);logger[_0xc28e('0xd')](_0xc28e('0x37'),_0x480fbd,JSON[_0xc28e('0x1e')](_0x3a919a));_0x1ebc95(_0x3a919a);})[_0xc28e('0x13')](function(_0x1fbe10){logger[_0xc28e('0xf')]('CountReScheduled',_0x1fbe10[_0xc28e('0x11')],_0x480fbd);_0x13ecfa(_0x3faa67['error'](0x1f4,_0x1fbe10[_0xc28e('0x11')]));});});};exports[_0xc28e('0x3c')]=function(_0x2204af){var _0x719ca2=this;return new Promise(function(_0x330191,_0x26aada){return db['CmContact'][_0xc28e('0x3d')]()['then'](function(_0x227fcd){return db[_0xc28e('0x28')]['transaction'](function(_0xc70d0c){return db[_0xc28e('0x15')][_0xc28e('0x16')]({'where':_0x2204af[_0xc28e('0x17')]?_0x2204af[_0xc28e('0x17')][_0xc28e('0x19')]||null:null,'attributes':_0x2204af[_0xc28e('0x17')]?_0x2204af[_0xc28e('0x17')][_0xc28e('0x1c')]||null:null,'limit':0x1,'order':_0x2204af[_0xc28e('0x17')]?_0x2204af[_0xc28e('0x17')][_0xc28e('0x3e')]||null:null,'group':db[_0xc28e('0x15')][_0xc28e('0x30')],'transaction':_0xc70d0c,'lock':_0xc70d0c['LOCK']['UPDATE'],'include':_0x2204af[_0xc28e('0x17')]?_0x2204af[_0xc28e('0x17')][_0xc28e('0x1d')]?_['map'](_0x2204af[_0xc28e('0x17')][_0xc28e('0x1d')],function(_0x905ee6){return{'model':db[_0x905ee6['model']],'as':_0x905ee6['as'],'attributes':_0x905ee6[_0xc28e('0x1c')],'include':_0x905ee6[_0xc28e('0x1d')]?_[_0xc28e('0x1a')](_0x905ee6[_0xc28e('0x1d')],function(_0xb909b0){return{'model':db[_0xb909b0[_0xc28e('0x1b')]],'as':_0xb909b0['as'],'attributes':_0xb909b0['attributes'],'include':_0xb909b0[_0xc28e('0x1d')]?_[_0xc28e('0x1a')](_0xb909b0[_0xc28e('0x1d')],function(_0x4c9029){return{'model':db[_0x4c9029[_0xc28e('0x1b')]],'as':_0x4c9029['as'],'attributes':_0x4c9029['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x25a8f7){var _0x48f233=[];for(var _0x1f80bf=0x0;_0x1f80bf<_0x25a8f7['length'];_0x1f80bf+=0x1){_0x48f233[_0xc28e('0x31')](_0x25a8f7[_0x1f80bf][_0xc28e('0x32')](_0x2204af['body'],{'transaction':_0xc70d0c}));}return BPromise[_0xc28e('0x34')](_0x48f233);});})[_0xc28e('0xa')](function(_0x503be5){logger[_0xc28e('0x12')](_0xc28e('0x3c'),_0x2204af);logger[_0xc28e('0xd')](_0xc28e('0x3c'),_0x2204af,JSON[_0xc28e('0x1e')](_0x503be5));_0x330191(_0x503be5);})[_0xc28e('0x13')](function(_0x58aefc){logger[_0xc28e('0xf')](_0xc28e('0x3c'),_0x58aefc['message'],_0x2204af);_0x26aada(_0x719ca2[_0xc28e('0xf')](0x1f4,_0x58aefc[_0xc28e('0x11')]));});});});};exports[_0xc28e('0x3f')]=function(_0xccea64){var _0x400382=this;return new Promise(function(_0x5da545,_0x375cc7){db[_0xc28e('0x27')][_0xc28e('0x3d')]()[_0xc28e('0xa')](function(_0x546810){return db[_0xc28e('0x15')][_0xc28e('0x16')]({'raw':_0xccea64[_0xc28e('0x17')]?_0xccea64[_0xc28e('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0xccea64[_0xc28e('0x17')]?_0xccea64[_0xc28e('0x17')][_0xc28e('0x19')]||null:null,'attributes':_0xccea64[_0xc28e('0x17')]?_0xccea64[_0xc28e('0x17')][_0xc28e('0x1c')]||null:null,'limit':_0xccea64[_0xc28e('0x17')]?_0xccea64[_0xc28e('0x17')][_0xc28e('0x40')]||null:null,'include':_0xccea64[_0xc28e('0x17')]?_0xccea64[_0xc28e('0x17')]['include']?_[_0xc28e('0x1a')](_0xccea64['options'][_0xc28e('0x1d')],function(_0x4cd5f5){return{'model':db[_0x4cd5f5[_0xc28e('0x1b')]],'as':_0x4cd5f5['as'],'attributes':_0x4cd5f5['as']===_0xc28e('0x2c')?_[_0xc28e('0x41')](_0x546810):_0x4cd5f5[_0xc28e('0x1c')],'include':_0x4cd5f5[_0xc28e('0x1d')]?_[_0xc28e('0x1a')](_0x4cd5f5[_0xc28e('0x1d')],function(_0x5942f9){return{'model':db[_0x5942f9[_0xc28e('0x1b')]],'as':_0x5942f9['as'],'attributes':_0x5942f9[_0xc28e('0x1c')],'include':_0x5942f9[_0xc28e('0x1d')]?_[_0xc28e('0x1a')](_0x5942f9[_0xc28e('0x1d')],function(_0x444f5b){return{'model':db[_0x444f5b[_0xc28e('0x1b')]],'as':_0x444f5b['as'],'attributes':_0x444f5b[_0xc28e('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x12a07b){logger[_0xc28e('0x12')](_0xc28e('0x14'),_0xccea64);logger[_0xc28e('0xd')](_0xc28e('0x14'),_0xccea64,JSON[_0xc28e('0x1e')](_0x12a07b));_0x5da545(_0x12a07b);})['catch'](function(_0x274e2a){logger[_0xc28e('0xf')](_0xc28e('0x14'),_0x274e2a[_0xc28e('0x11')],_0xccea64);_0x375cc7(_0x400382['error'](0x1f4,_0x274e2a[_0xc28e('0x11')]));});});});}; \ No newline at end of file +var _0x0ab2=['../../config/environment','jayson/promise','client','request','info','CmHopper,\x20%s,\x20%s','request\x20sent','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetCmHopper','CmHopper','options','raw','where','attributes','limit','include','map','model','then','debug','find','ShowCmHopper','CreateCmHopper','create','body','update','UpdateCmHopper','DestroyCmHopper','destroy','GetContactDialer','CmContact','sequelize','transaction','findAll','keys','Agent','length','UserId','push','all','MoveContactManagedDialer','CmHopperFinal','CountReScheduled','COUNT','`scheduledat`\x20>=\x20','format','\x22%s\x22','\x20,\x201,\x20null','GetContactRecallMe','order','LOCK','describe','Contact','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x0ab2,0x17f));var _0x20ab=function(_0x84a159,_0x1d2a62){_0x84a159=_0x84a159-0x0;var _0x596baa=_0x0ab2[_0x84a159];return _0x596baa;};'use strict';var _=require(_0x20ab('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x20ab('0x1'));var rs=require(_0x20ab('0x2'));var fs=require('fs');var Redis=require(_0x20ab('0x3'));var db=require(_0x20ab('0x4'))['db'];var utils=require(_0x20ab('0x5'));var logger=require(_0x20ab('0x6'))('rpc');var config=require(_0x20ab('0x7'));var jayson=require(_0x20ab('0x8'));var client=jayson[_0x20ab('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1957cc,_0x1b53f0,_0x302ffb){return new BPromise(function(_0x10eb27,_0x3afd5d){return client[_0x20ab('0xa')](_0x1957cc,_0x302ffb)['then'](function(_0x1793c2){logger[_0x20ab('0xb')](_0x20ab('0xc'),_0x1b53f0,_0x20ab('0xd'));logger['debug'](_0x20ab('0xe'),_0x1b53f0,'request\x20sent',JSON[_0x20ab('0xf')](_0x1793c2));if(_0x1793c2[_0x20ab('0x10')]){if(_0x1793c2['error']['code']===0x1f4){logger[_0x20ab('0x10')](_0x20ab('0xc'),_0x1b53f0,_0x1793c2['error'][_0x20ab('0x11')]);return _0x3afd5d(_0x1793c2[_0x20ab('0x10')][_0x20ab('0x11')]);}logger['error']('CmHopper,\x20%s,\x20%s',_0x1b53f0,_0x1793c2['error'][_0x20ab('0x11')]);return _0x10eb27(_0x1793c2[_0x20ab('0x10')][_0x20ab('0x11')]);}else{logger[_0x20ab('0xb')](_0x20ab('0xc'),_0x1b53f0,_0x20ab('0xd'));_0x10eb27(_0x1793c2[_0x20ab('0x12')]['message']);}})[_0x20ab('0x13')](function(_0x2d1869){logger[_0x20ab('0x10')]('CmHopper,\x20%s,\x20%s',_0x1b53f0,_0x2d1869);_0x3afd5d(_0x2d1869);});});}exports[_0x20ab('0x14')]=function(_0x4409de){var _0x3494dc=this;return new Promise(function(_0x5123c9,_0x3d22d0){return db[_0x20ab('0x15')]['findAll']({'raw':_0x4409de[_0x20ab('0x16')]?_0x4409de[_0x20ab('0x16')][_0x20ab('0x17')]===undefined?!![]:![]:!![],'where':_0x4409de['options']?_0x4409de[_0x20ab('0x16')][_0x20ab('0x18')]||null:null,'attributes':_0x4409de[_0x20ab('0x16')]?_0x4409de[_0x20ab('0x16')][_0x20ab('0x19')]||null:null,'limit':_0x4409de[_0x20ab('0x16')]?_0x4409de[_0x20ab('0x16')][_0x20ab('0x1a')]||null:null,'include':_0x4409de[_0x20ab('0x16')]?_0x4409de[_0x20ab('0x16')][_0x20ab('0x1b')]?_[_0x20ab('0x1c')](_0x4409de[_0x20ab('0x16')][_0x20ab('0x1b')],function(_0x4a3662){return{'model':db[_0x4a3662[_0x20ab('0x1d')]],'as':_0x4a3662['as'],'attributes':_0x4a3662['attributes'],'include':_0x4a3662[_0x20ab('0x1b')]?_[_0x20ab('0x1c')](_0x4a3662['include'],function(_0x2fa3f0){return{'model':db[_0x2fa3f0['model']],'as':_0x2fa3f0['as'],'attributes':_0x2fa3f0['attributes'],'include':_0x2fa3f0['include']?_[_0x20ab('0x1c')](_0x2fa3f0[_0x20ab('0x1b')],function(_0x43d2ca){return{'model':db[_0x43d2ca[_0x20ab('0x1d')]],'as':_0x43d2ca['as'],'attributes':_0x43d2ca[_0x20ab('0x19')]};}):[]};}):[]};}):[]:[]})[_0x20ab('0x1e')](function(_0x4c1708){logger['info'](_0x20ab('0x14'),_0x4409de);logger[_0x20ab('0x1f')](_0x20ab('0x14'),_0x4409de,JSON[_0x20ab('0xf')](_0x4c1708));_0x5123c9(_0x4c1708);})[_0x20ab('0x13')](function(_0x570efd){logger['error']('GetCmHopper',_0x570efd[_0x20ab('0x11')],_0x4409de);_0x3d22d0(_0x3494dc[_0x20ab('0x10')](0x1f4,_0x570efd[_0x20ab('0x11')]));});});};exports['ShowCmHopper']=function(_0x3cdd0a){var _0x1befe8=this;return new Promise(function(_0x444c62,_0x3f4ec9){return db[_0x20ab('0x15')][_0x20ab('0x20')]({'raw':_0x3cdd0a[_0x20ab('0x16')]?_0x3cdd0a['options'][_0x20ab('0x17')]===undefined?!![]:![]:!![],'where':_0x3cdd0a[_0x20ab('0x16')]?_0x3cdd0a['options']['where']||null:null,'attributes':_0x3cdd0a['options']?_0x3cdd0a[_0x20ab('0x16')][_0x20ab('0x19')]||null:null,'include':_0x3cdd0a[_0x20ab('0x16')]?_0x3cdd0a['options'][_0x20ab('0x1b')]?_[_0x20ab('0x1c')](_0x3cdd0a[_0x20ab('0x16')][_0x20ab('0x1b')],function(_0x52dbd1){return{'model':db[_0x52dbd1[_0x20ab('0x1d')]],'as':_0x52dbd1['as'],'attributes':_0x52dbd1['attributes'],'include':_0x52dbd1[_0x20ab('0x1b')]?_[_0x20ab('0x1c')](_0x52dbd1[_0x20ab('0x1b')],function(_0xcb95d7){return{'model':db[_0xcb95d7['model']],'as':_0xcb95d7['as'],'attributes':_0xcb95d7[_0x20ab('0x19')],'include':_0xcb95d7['include']?_[_0x20ab('0x1c')](_0xcb95d7['include'],function(_0x1c7e67){return{'model':db[_0x1c7e67['model']],'as':_0x1c7e67['as'],'attributes':_0x1c7e67['attributes']};}):[]};}):[]};}):[]:[]})[_0x20ab('0x1e')](function(_0x27b48f){logger[_0x20ab('0xb')]('ShowCmHopper',_0x3cdd0a);logger[_0x20ab('0x1f')]('ShowCmHopper',_0x3cdd0a,JSON['stringify'](_0x27b48f));_0x444c62(_0x27b48f);})[_0x20ab('0x13')](function(_0x36d950){logger['error'](_0x20ab('0x21'),_0x36d950['message'],_0x3cdd0a);_0x3f4ec9(_0x1befe8[_0x20ab('0x10')](0x1f4,_0x36d950[_0x20ab('0x11')]));});});};exports[_0x20ab('0x22')]=function(_0x545b4a){var _0xfdf399=this;return new Promise(function(_0xcd853f,_0xf9c3a4){return db[_0x20ab('0x15')][_0x20ab('0x23')](_0x545b4a[_0x20ab('0x24')],{'raw':_0x545b4a['options']?_0x545b4a[_0x20ab('0x16')][_0x20ab('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x2b6531){logger[_0x20ab('0xb')](_0x20ab('0x22'),_0x545b4a);logger['debug'](_0x20ab('0x22'),_0x545b4a,JSON[_0x20ab('0xf')](_0x2b6531));_0xcd853f(_0x2b6531);})[_0x20ab('0x13')](function(_0x24dae9){logger[_0x20ab('0x10')](_0x20ab('0x22'),_0x24dae9[_0x20ab('0x11')],_0x545b4a);_0xf9c3a4(_0xfdf399[_0x20ab('0x10')](0x1f4,_0x24dae9[_0x20ab('0x11')]));});});};exports['UpdateCmHopper']=function(_0xbe75d1){var _0x133774=this;return new Promise(function(_0x43f3aa,_0x57b83b){return db['CmHopper'][_0x20ab('0x25')](_0xbe75d1['body'],{'raw':_0xbe75d1['options']?_0xbe75d1[_0x20ab('0x16')][_0x20ab('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xbe75d1[_0x20ab('0x16')]?_0xbe75d1[_0x20ab('0x16')][_0x20ab('0x18')]||null:null,'attributes':_0xbe75d1['options']?_0xbe75d1[_0x20ab('0x16')][_0x20ab('0x19')]||null:null,'limit':_0xbe75d1['options']?_0xbe75d1['options']['limit']||null:null})[_0x20ab('0x1e')](function(_0x4d3fd1){logger[_0x20ab('0xb')]('UpdateCmHopper',_0xbe75d1);logger['debug']('UpdateCmHopper',_0xbe75d1,JSON[_0x20ab('0xf')](_0x4d3fd1));_0x43f3aa(_0x4d3fd1);})[_0x20ab('0x13')](function(_0x1b879e){logger[_0x20ab('0x10')](_0x20ab('0x26'),_0x1b879e['message'],_0xbe75d1);_0x57b83b(_0x133774['error'](0x1f4,_0x1b879e[_0x20ab('0x11')]));});});};exports[_0x20ab('0x27')]=function(_0x47fd1d){var _0x53073a=this;return new Promise(function(_0x2517dd,_0x3ba589){return db[_0x20ab('0x15')][_0x20ab('0x28')]({'where':_0x47fd1d[_0x20ab('0x16')]?_0x47fd1d['options']['where']||null:null})[_0x20ab('0x1e')](function(_0x52effb){logger[_0x20ab('0xb')](_0x20ab('0x27'),_0x47fd1d);logger[_0x20ab('0x1f')](_0x20ab('0x27'),_0x47fd1d,JSON['stringify'](_0x52effb));_0x2517dd(_0x52effb);})[_0x20ab('0x13')](function(_0x1027ec){logger[_0x20ab('0x10')](_0x20ab('0x27'),_0x1027ec['message'],_0x47fd1d);_0x3ba589(_0x53073a['error'](0x1f4,_0x1027ec['message']));});});};exports[_0x20ab('0x29')]=function(_0x17c044){var _0x197b1e=this;return new Promise(function(_0x5c4fcf,_0x5b2c79){return db[_0x20ab('0x2a')]['describe']()['then'](function(_0x1537fb){return db[_0x20ab('0x2b')][_0x20ab('0x2c')](function(_0x506d28){return db[_0x20ab('0x15')][_0x20ab('0x2d')]({'where':_0x17c044[_0x20ab('0x16')]?_0x17c044[_0x20ab('0x16')]['where']||null:null,'attributes':_0x17c044[_0x20ab('0x16')]?_0x17c044['options'][_0x20ab('0x19')]||null:null,'limit':_0x17c044[_0x20ab('0x16')]?_0x17c044['options'][_0x20ab('0x1a')]||null:null,'order':_0x17c044[_0x20ab('0x16')]?_0x17c044[_0x20ab('0x16')]['order']||null:null,'transaction':_0x506d28,'lock':_0x506d28['LOCK']['UPDATE'],'include':[{'model':db[_0x20ab('0x2a')],'as':'Contact','attributes':_[_0x20ab('0x2e')](_0x1537fb)},{'model':db['User'],'as':_0x20ab('0x2f'),'attributes':['id','name','voicePause']}]})['then'](function(_0x160a99){var _0x2c2e44=[];var _0x449971=[];for(var _0x251ea8=0x0;_0x251ea8<_0x160a99[_0x20ab('0x30')];_0x251ea8+=0x1){var _0x2a010d=_0x160a99[_0x251ea8][_0x20ab('0x31')];if(_0x2a010d===null){_0x2c2e44['push'](_0x160a99[_0x251ea8]['update'](_0x17c044[_0x20ab('0x24')],{'transaction':_0x506d28}));}else if(!_0x449971['includes'](_0x2a010d)){_0x449971[_0x20ab('0x32')](_0x2a010d);_0x2c2e44[_0x20ab('0x32')](_0x160a99[_0x251ea8][_0x20ab('0x25')](_0x17c044['body'],{'transaction':_0x506d28}));}}return BPromise[_0x20ab('0x33')](_0x2c2e44);});})[_0x20ab('0x1e')](function(_0x582c09){logger['info'](_0x20ab('0x29'),_0x17c044);logger[_0x20ab('0x1f')](_0x20ab('0x29'),_0x17c044,JSON[_0x20ab('0xf')](_0x582c09));_0x5c4fcf(_0x582c09);})[_0x20ab('0x13')](function(_0x236d28){logger[_0x20ab('0x10')]('GetContactDialer',_0x236d28['message'],_0x17c044);_0x5b2c79(_0x197b1e['error'](0x1f4,_0x236d28[_0x20ab('0x11')]));});});});};exports[_0x20ab('0x34')]=function(_0x3543e3){var _0x5cb996=this;return new Promise(function(_0x2c2c1b,_0x4cf1f6){return db[_0x20ab('0x2b')][_0x20ab('0x2c')](function(_0x5e49c2){return db[_0x20ab('0x35')][_0x20ab('0x23')](_0x3543e3[_0x20ab('0x24')],{'raw':_0x3543e3[_0x20ab('0x16')]?_0x3543e3['options']['raw']===undefined?!![]:![]:!![],'transaction':_0x5e49c2})[_0x20ab('0x1e')](function(){return db['CmHopper'][_0x20ab('0x28')]({'where':_0x3543e3['options']?_0x3543e3['options'][_0x20ab('0x18')]||null:null,'transaction':_0x5e49c2});});})[_0x20ab('0x1e')](function(_0xabb39b){logger[_0x20ab('0xb')](_0x20ab('0x34'),_0x3543e3);logger[_0x20ab('0x1f')](_0x20ab('0x34'),_0x3543e3,JSON[_0x20ab('0xf')](_0xabb39b));_0x2c2c1b(_0xabb39b);})[_0x20ab('0x13')](function(_0x16c2ff){logger['error'](_0x20ab('0x34'),_0x16c2ff[_0x20ab('0x11')],_0x3543e3);_0x4cf1f6(_0x5cb996['error'](0x1f4,_0x16c2ff[_0x20ab('0x11')]));});});};exports[_0x20ab('0x36')]=function(_0x33eb2c){var _0x38b00e=this;return new Promise(function(_0x4c6480,_0x29b9d5){return db[_0x20ab('0x15')][_0x20ab('0x2d')]({'raw':_0x33eb2c['options']?_0x33eb2c[_0x20ab('0x16')][_0x20ab('0x17')]===undefined?!![]:![]:!![],'where':_0x33eb2c[_0x20ab('0x16')]?_0x33eb2c[_0x20ab('0x16')][_0x20ab('0x18')]||null:null,'attributes':[[db[_0x20ab('0x2b')]['fn'](_0x20ab('0x37'),db[_0x20ab('0x2b')]['fn']('IF',db[_0x20ab('0x2b')]['literal'](_0x20ab('0x38')+util[_0x20ab('0x39')](_0x20ab('0x3a'),moment()[_0x20ab('0x39')]('YYYY-MM-DD\x20HH:mm:ss'))+_0x20ab('0x3b')))),'contactsRescheduled']]})[_0x20ab('0x1e')](function(_0x1ca6b0){logger['info']('CountReScheduled',_0x33eb2c);logger[_0x20ab('0x1f')](_0x20ab('0x36'),_0x33eb2c,JSON['stringify'](_0x1ca6b0));_0x4c6480(_0x1ca6b0);})[_0x20ab('0x13')](function(_0x40fe07){logger[_0x20ab('0x10')](_0x20ab('0x36'),_0x40fe07[_0x20ab('0x11')],_0x33eb2c);_0x29b9d5(_0x38b00e[_0x20ab('0x10')](0x1f4,_0x40fe07[_0x20ab('0x11')]));});});};exports[_0x20ab('0x3c')]=function(_0x43825e){var _0x43b3ce=this;return new Promise(function(_0x21b323,_0x2c57a2){return db['CmContact']['describe']()[_0x20ab('0x1e')](function(_0x13913f){return db[_0x20ab('0x2b')][_0x20ab('0x2c')](function(_0x375367){return db[_0x20ab('0x15')][_0x20ab('0x2d')]({'where':_0x43825e[_0x20ab('0x16')]?_0x43825e[_0x20ab('0x16')]['where']||null:null,'attributes':_0x43825e[_0x20ab('0x16')]?_0x43825e[_0x20ab('0x16')]['attributes']||null:null,'limit':0x1,'order':_0x43825e[_0x20ab('0x16')]?_0x43825e[_0x20ab('0x16')][_0x20ab('0x3d')]||null:null,'group':db['CmHopper'][_0x20ab('0x31')],'transaction':_0x375367,'lock':_0x375367[_0x20ab('0x3e')]['UPDATE'],'include':_0x43825e['options']?_0x43825e[_0x20ab('0x16')][_0x20ab('0x1b')]?_['map'](_0x43825e['options']['include'],function(_0x45ea00){return{'model':db[_0x45ea00[_0x20ab('0x1d')]],'as':_0x45ea00['as'],'attributes':_0x45ea00[_0x20ab('0x19')],'include':_0x45ea00['include']?_['map'](_0x45ea00['include'],function(_0x48d732){return{'model':db[_0x48d732[_0x20ab('0x1d')]],'as':_0x48d732['as'],'attributes':_0x48d732[_0x20ab('0x19')],'include':_0x48d732[_0x20ab('0x1b')]?_['map'](_0x48d732[_0x20ab('0x1b')],function(_0x3dc653){return{'model':db[_0x3dc653['model']],'as':_0x3dc653['as'],'attributes':_0x3dc653[_0x20ab('0x19')]};}):[]};}):[]};}):[]:[]})[_0x20ab('0x1e')](function(_0x339f2e){var _0x15efa4=[];for(var _0x361107=0x0;_0x361107<_0x339f2e[_0x20ab('0x30')];_0x361107+=0x1){_0x15efa4[_0x20ab('0x32')](_0x339f2e[_0x361107]['update'](_0x43825e[_0x20ab('0x24')],{'transaction':_0x375367}));}return BPromise[_0x20ab('0x33')](_0x15efa4);});})[_0x20ab('0x1e')](function(_0x4cdf59){logger['info'](_0x20ab('0x3c'),_0x43825e);logger[_0x20ab('0x1f')](_0x20ab('0x3c'),_0x43825e,JSON[_0x20ab('0xf')](_0x4cdf59));_0x21b323(_0x4cdf59);})[_0x20ab('0x13')](function(_0x57d5e7){logger[_0x20ab('0x10')]('GetContactRecallMe',_0x57d5e7[_0x20ab('0x11')],_0x43825e);_0x2c57a2(_0x43b3ce[_0x20ab('0x10')](0x1f4,_0x57d5e7['message']));});});});};exports['GetCmHopperPreview']=function(_0x1336dd){var _0x4e5373=this;return new Promise(function(_0x211314,_0x3ef3ea){db[_0x20ab('0x2a')][_0x20ab('0x3f')]()[_0x20ab('0x1e')](function(_0x200d60){return db[_0x20ab('0x15')]['findAll']({'raw':_0x1336dd['options']?_0x1336dd['options'][_0x20ab('0x17')]===undefined?!![]:![]:!![],'where':_0x1336dd[_0x20ab('0x16')]?_0x1336dd[_0x20ab('0x16')][_0x20ab('0x18')]||null:null,'attributes':_0x1336dd['options']?_0x1336dd[_0x20ab('0x16')][_0x20ab('0x19')]||null:null,'limit':_0x1336dd[_0x20ab('0x16')]?_0x1336dd[_0x20ab('0x16')][_0x20ab('0x1a')]||null:null,'include':_0x1336dd[_0x20ab('0x16')]?_0x1336dd[_0x20ab('0x16')][_0x20ab('0x1b')]?_[_0x20ab('0x1c')](_0x1336dd[_0x20ab('0x16')][_0x20ab('0x1b')],function(_0x42e3d2){return{'model':db[_0x42e3d2[_0x20ab('0x1d')]],'as':_0x42e3d2['as'],'attributes':_0x42e3d2['as']===_0x20ab('0x40')?_[_0x20ab('0x2e')](_0x200d60):_0x42e3d2[_0x20ab('0x19')],'include':_0x42e3d2['include']?_[_0x20ab('0x1c')](_0x42e3d2[_0x20ab('0x1b')],function(_0xa2f225){return{'model':db[_0xa2f225[_0x20ab('0x1d')]],'as':_0xa2f225['as'],'attributes':_0xa2f225[_0x20ab('0x19')],'include':_0xa2f225[_0x20ab('0x1b')]?_[_0x20ab('0x1c')](_0xa2f225[_0x20ab('0x1b')],function(_0x1359b8){return{'model':db[_0x1359b8[_0x20ab('0x1d')]],'as':_0x1359b8['as'],'attributes':_0x1359b8[_0x20ab('0x19')]};}):[]};}):[]};}):[]:[]})[_0x20ab('0x1e')](function(_0x4f068a){logger[_0x20ab('0xb')]('GetCmHopper',_0x1336dd);logger[_0x20ab('0x1f')]('GetCmHopper',_0x1336dd,JSON[_0x20ab('0xf')](_0x4f068a));_0x211314(_0x4f068a);})[_0x20ab('0x13')](function(_0xf7434f){logger[_0x20ab('0x10')](_0x20ab('0x14'),_0xf7434f[_0x20ab('0x11')],_0x1336dd);_0x3ef3ea(_0x4e5373[_0x20ab('0x10')](0x1f4,_0xf7434f[_0x20ab('0x11')]));});});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index cc5c272..88b9774 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 _0xa5c1=['../../components/interaction/service','../../config/environment','./cmHopper.controller','get','isAuthenticated','describe','/:id','show','post','create','/preview','getPreview','put','update','delete','destroy','multer','util','path','Router','../../components/auth/service'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xa5c1,0x19f));var _0x1a5c=function(_0x4b2cf1,_0x5b81f5){_0x4b2cf1=_0x4b2cf1-0x0;var _0x388345=_0xa5c1[_0x4b2cf1];return _0x388345;};'use strict';var multer=require(_0x1a5c('0x0'));var util=require(_0x1a5c('0x1'));var path=require(_0x1a5c('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1a5c('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1a5c('0x4'));var interaction=require(_0x1a5c('0x5'));var config=require(_0x1a5c('0x6'));var controller=require(_0x1a5c('0x7'));router[_0x1a5c('0x8')]('/',auth[_0x1a5c('0x9')](),controller['index']);router[_0x1a5c('0x8')]('/describe',auth[_0x1a5c('0x9')](),controller[_0x1a5c('0xa')]);router[_0x1a5c('0x8')]('/opencontacts',auth[_0x1a5c('0x9')](),controller['getOpenContacts']);router[_0x1a5c('0x8')](_0x1a5c('0xb'),auth['isAuthenticated'](),controller[_0x1a5c('0xc')]);router[_0x1a5c('0xd')]('/',auth['isAuthenticated'](),controller[_0x1a5c('0xe')]);router[_0x1a5c('0xd')](_0x1a5c('0xf'),auth[_0x1a5c('0x9')](),controller[_0x1a5c('0x10')]);router[_0x1a5c('0x11')](_0x1a5c('0xb'),auth['isAuthenticated'](),controller[_0x1a5c('0x12')]);router[_0x1a5c('0x13')]('/:id',auth[_0x1a5c('0x9')](),controller[_0x1a5c('0x14')]);module['exports']=router; \ No newline at end of file +var _0x32da=['update','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopper.controller','get','isAuthenticated','index','/describe','/opencontacts','getOpenContacts','show','post','create','getPreview','/:id'];(function(_0x42d232,_0x5611e9){var _0x5a2e14=function(_0x3d1703){while(--_0x3d1703){_0x42d232['push'](_0x42d232['shift']());}};_0x5a2e14(++_0x5611e9);}(_0x32da,0x10a));var _0xa32d=function(_0x3db136,_0x477db0){_0x3db136=_0x3db136-0x0;var _0x33b047=_0x32da[_0x3db136];return _0x33b047;};'use strict';var multer=require(_0xa32d('0x0'));var util=require(_0xa32d('0x1'));var path=require(_0xa32d('0x2'));var timeout=require('connect-timeout');var express=require(_0xa32d('0x3'));var router=express[_0xa32d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa32d('0x5'));var interaction=require(_0xa32d('0x6'));var config=require(_0xa32d('0x7'));var controller=require(_0xa32d('0x8'));router[_0xa32d('0x9')]('/',auth[_0xa32d('0xa')](),controller[_0xa32d('0xb')]);router[_0xa32d('0x9')](_0xa32d('0xc'),auth[_0xa32d('0xa')](),controller['describe']);router[_0xa32d('0x9')](_0xa32d('0xd'),auth[_0xa32d('0xa')](),controller[_0xa32d('0xe')]);router[_0xa32d('0x9')]('/:id',auth[_0xa32d('0xa')](),controller[_0xa32d('0xf')]);router[_0xa32d('0x10')]('/',auth['isAuthenticated'](),controller[_0xa32d('0x11')]);router[_0xa32d('0x10')]('/preview',auth[_0xa32d('0xa')](),controller[_0xa32d('0x12')]);router['put'](_0xa32d('0x13'),auth['isAuthenticated'](),controller[_0xa32d('0x14')]);router['delete'](_0xa32d('0x13'),auth['isAuthenticated'](),controller[_0xa32d('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index fd6d696..c9453f5 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 _0x2dc3=['sequelize','exports','STRING','INTEGER','contactListQueue'];(function(_0x288b3e,_0x3b1599){var _0x18d8f4=function(_0x496882){while(--_0x496882){_0x288b3e['push'](_0x288b3e['shift']());}};_0x18d8f4(++_0x3b1599);}(_0x2dc3,0x127));var _0x32dc=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x2dc3[_0x4cf98e];return _0x1623ac;};'use strict';var moment=require('moment');var Sequelize=require(_0x32dc('0x0'));module[_0x32dc('0x1')]={'phone':{'type':Sequelize[_0x32dc('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x32dc('0x3')],'unique':_0x32dc('0x4')},'ListId':{'type':Sequelize[_0x32dc('0x3')],'unique':_0x32dc('0x4')},'VoiceQueueId':{'type':Sequelize[_0x32dc('0x3')],'unique':'contactListQueue'}}; \ No newline at end of file +var _0x1ba8=['STRING','contactListQueue','moment'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x1ba8,0x10d));var _0x81ba=function(_0x1a6015,_0x148901){_0x1a6015=_0x1a6015-0x0;var _0x3e5890=_0x1ba8[_0x1a6015];return _0x3e5890;};'use strict';var moment=require(_0x81ba('0x0'));var Sequelize=require('sequelize');module['exports']={'phone':{'type':Sequelize[_0x81ba('0x1')],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x81ba('0x2')},'ListId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x81ba('0x2')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 9313413..c5735c7 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 _0x30f9=['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/environment','sendStatus','status','end','undefined','count','offset','limit','apply','save','update','destroy','then','name','map','rawAttributes','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','VIRTUAL','merge','options','CmHopperBlack','findAll','rows','catch','includeAll','include','body','params','find','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra'];(function(_0x3a833e,_0x5a1878){var _0xdff445=function(_0x1715a3){while(--_0x1715a3){_0x3a833e['push'](_0x3a833e['shift']());}};_0xdff445(++_0x5a1878);}(_0x30f9,0xc5));var _0x930f=function(_0x3e3221,_0x392851){_0x3e3221=_0x3e3221-0x0;var _0x190da4=_0x30f9[_0x3e3221];return _0x190da4;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x930f('0x0'));var jsonpatch=require(_0x930f('0x1'));var rp=require(_0x930f('0x2'));var moment=require(_0x930f('0x3'));var BPromise=require(_0x930f('0x4'));var Mustache=require(_0x930f('0x5'));var util=require(_0x930f('0x6'));var path=require(_0x930f('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x930f('0x8'));var fs=require('fs');var fs_extra=require(_0x930f('0x9'));var _=require(_0x930f('0xa'));var squel=require('squel');var crypto=require(_0x930f('0xb'));var jsforce=require(_0x930f('0xc'));var deskjs=require(_0x930f('0xd'));var toCsv=require(_0x930f('0xe'));var querystring=require(_0x930f('0xf'));var Papa=require(_0x930f('0x10'));var Redis=require(_0x930f('0x11'));var authService=require(_0x930f('0x12'));var qs=require(_0x930f('0x13'));var as=require(_0x930f('0x14'));var hardwareService=require(_0x930f('0x15'));var logger=require(_0x930f('0x16'))(_0x930f('0x17'));var utils=require('../../config/utils');var config=require(_0x930f('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2aae22,_0x509ad1){_0x509ad1=_0x509ad1||0xcc;return function(_0x726ed6){if(_0x726ed6){return _0x2aae22[_0x930f('0x19')](_0x509ad1);}return _0x2aae22[_0x930f('0x1a')](_0x509ad1)[_0x930f('0x1b')]();};}function respondWithResult(_0x3760a9,_0x41c747){_0x41c747=_0x41c747||0xc8;return function(_0x3ae186){if(_0x3ae186){return _0x3760a9['status'](_0x41c747)['json'](_0x3ae186);}};}function respondWithFilteredResult(_0x35f2a9,_0x137134){return function(_0x348bcb){if(_0x348bcb){var _0x1c22ac=typeof _0x137134['offset']===_0x930f('0x1c')&&typeof _0x137134['limit']===_0x930f('0x1c');var _0x525d4b=_0x348bcb[_0x930f('0x1d')];var _0x5aac0c=_0x1c22ac?0x0:_0x137134[_0x930f('0x1e')];var _0x175ad5=_0x1c22ac?_0x348bcb[_0x930f('0x1d')]:_0x137134['offset']+_0x137134[_0x930f('0x1f')];var _0x4a4cac;if(_0x175ad5>=_0x525d4b){_0x175ad5=_0x525d4b;_0x4a4cac=0xc8;}else{_0x4a4cac=0xce;}_0x35f2a9[_0x930f('0x1a')](_0x4a4cac);return _0x35f2a9['set']('Content-Range',_0x5aac0c+'-'+_0x175ad5+'/'+_0x525d4b)['json'](_0x348bcb);}return null;};}function patchUpdates(_0x5ee21e){return function(_0x3944a6){try{jsonpatch[_0x930f('0x20')](_0x3944a6,_0x5ee21e,!![]);}catch(_0x3f8567){return BPromise['reject'](_0x3f8567);}return _0x3944a6[_0x930f('0x21')]();};}function saveUpdates(_0x376ee7,_0x9a181f){return function(_0x1b57ab){if(_0x1b57ab){return _0x1b57ab[_0x930f('0x22')](_0x376ee7)['then'](function(_0x33f507){return _0x33f507;});}return null;};}function removeEntity(_0x591f6b,_0x3eeb63){return function(_0x1759cd){if(_0x1759cd){return _0x1759cd[_0x930f('0x23')]()[_0x930f('0x24')](function(){_0x591f6b[_0x930f('0x1a')](0xcc)[_0x930f('0x1b')]();});}};}function handleEntityNotFound(_0x4a6058,_0x245d35){return function(_0x54f127){if(!_0x54f127){_0x4a6058['sendStatus'](0x194);}return _0x54f127;};}function handleError(_0x12a7d9,_0x860a2d){_0x860a2d=_0x860a2d||0x1f4;return function(_0x47029f){logger['error'](_0x47029f['stack']);if(_0x47029f[_0x930f('0x25')]){delete _0x47029f[_0x930f('0x25')];}_0x12a7d9[_0x930f('0x1a')](_0x860a2d)['send'](_0x47029f);};}exports['index']=function(_0x569885,_0x2af6ad){var _0x58583f={},_0x5a7f8a={},_0x33c8ac={'count':0x0,'rows':[]};var _0x323731=_[_0x930f('0x26')](db['CmHopperBlack'][_0x930f('0x27')],function(_0x7e9e01){return{'name':_0x7e9e01['fieldName'],'type':_0x7e9e01[_0x930f('0x28')][_0x930f('0x29')]};});_0x5a7f8a[_0x930f('0x2a')]=_['map'](_0x323731,'name');_0x5a7f8a['query']=_[_0x930f('0x2b')](_0x569885[_0x930f('0x2c')]);_0x5a7f8a['filters']=_[_0x930f('0x2d')](_0x5a7f8a[_0x930f('0x2a')],_0x5a7f8a[_0x930f('0x2c')]);_0x58583f[_0x930f('0x2e')]=_['intersection'](_0x5a7f8a['model'],qs[_0x930f('0x2f')](_0x569885[_0x930f('0x2c')][_0x930f('0x2f')]));_0x58583f['attributes']=_0x58583f[_0x930f('0x2e')][_0x930f('0x30')]?_0x58583f[_0x930f('0x2e')]:_0x5a7f8a[_0x930f('0x2a')];if(!_0x569885[_0x930f('0x2c')][_0x930f('0x31')](_0x930f('0x32'))){_0x58583f[_0x930f('0x1f')]=qs[_0x930f('0x1f')](_0x569885[_0x930f('0x2c')][_0x930f('0x1f')]);_0x58583f[_0x930f('0x1e')]=qs['offset'](_0x569885[_0x930f('0x2c')][_0x930f('0x1e')]);}_0x58583f[_0x930f('0x33')]=qs[_0x930f('0x34')](_0x569885[_0x930f('0x2c')][_0x930f('0x34')]);_0x58583f[_0x930f('0x35')]=qs[_0x930f('0x36')](_[_0x930f('0x37')](_0x569885[_0x930f('0x2c')],_0x5a7f8a[_0x930f('0x36')]),_0x323731);if(_0x569885[_0x930f('0x2c')]['filter']){_0x58583f[_0x930f('0x35')]=_['merge'](_0x58583f['where'],{'$or':_['map'](_0x323731,function(_0x2078e5){if(_0x2078e5[_0x930f('0x28')]!==_0x930f('0x38')){var _0x397b93={};_0x397b93[_0x2078e5[_0x930f('0x25')]]={'$like':'%'+_0x569885[_0x930f('0x2c')]['filter']+'%'};return _0x397b93;}})});}_0x58583f=_[_0x930f('0x39')]({},_0x58583f,_0x569885[_0x930f('0x3a')]);var _0x1be782={'where':_0x58583f['where']};return db[_0x930f('0x3b')][_0x930f('0x1d')](_0x1be782)[_0x930f('0x24')](function(_0x5cf811){_0x33c8ac['count']=_0x5cf811;if(_0x569885[_0x930f('0x2c')]['includeAll']){_0x58583f['include']=[{'all':!![]}];}return db[_0x930f('0x3b')][_0x930f('0x3c')](_0x58583f);})[_0x930f('0x24')](function(_0x1c34d0){_0x33c8ac[_0x930f('0x3d')]=_0x1c34d0;return _0x33c8ac;})['then'](respondWithFilteredResult(_0x2af6ad,_0x58583f))[_0x930f('0x3e')](handleError(_0x2af6ad,null));};exports['show']=function(_0x5dd338,_0x352089){var _0x3ae0d3={'raw':!![],'where':{'id':_0x5dd338['params']['id']}},_0x5233f6={};_0x5233f6[_0x930f('0x2a')]=_[_0x930f('0x2b')](db[_0x930f('0x3b')]['rawAttributes']);_0x5233f6['query']=_[_0x930f('0x2b')](_0x5dd338[_0x930f('0x2c')]);_0x5233f6['filters']=_[_0x930f('0x2d')](_0x5233f6['model'],_0x5233f6['query']);_0x3ae0d3['attributes']=_[_0x930f('0x2d')](_0x5233f6[_0x930f('0x2a')],qs[_0x930f('0x2f')](_0x5dd338[_0x930f('0x2c')][_0x930f('0x2f')]));_0x3ae0d3[_0x930f('0x2e')]=_0x3ae0d3[_0x930f('0x2e')][_0x930f('0x30')]?_0x3ae0d3['attributes']:_0x5233f6[_0x930f('0x2a')];if(_0x5dd338[_0x930f('0x2c')][_0x930f('0x3f')]){_0x3ae0d3[_0x930f('0x40')]=[{'all':!![]}];}_0x3ae0d3=_[_0x930f('0x39')]({},_0x3ae0d3,_0x5dd338[_0x930f('0x3a')]);return db[_0x930f('0x3b')]['find'](_0x3ae0d3)['then'](handleEntityNotFound(_0x352089,null))[_0x930f('0x24')](respondWithResult(_0x352089,null))['catch'](handleError(_0x352089,null));};exports['update']=function(_0x3b3d83,_0x2a3642){if(_0x3b3d83[_0x930f('0x41')]['id']){delete _0x3b3d83['body']['id'];}return db['CmHopperBlack']['find']({'where':{'id':_0x3b3d83[_0x930f('0x42')]['id']}})[_0x930f('0x24')](handleEntityNotFound(_0x2a3642,null))['then'](saveUpdates(_0x3b3d83[_0x930f('0x41')],null))['then'](respondWithResult(_0x2a3642,null))['catch'](handleError(_0x2a3642,null));};exports[_0x930f('0x23')]=function(_0x3a0fbb,_0x3420c4){return db[_0x930f('0x3b')][_0x930f('0x43')]({'where':{'id':_0x3a0fbb[_0x930f('0x42')]['id']}})[_0x930f('0x24')](handleEntityNotFound(_0x3420c4,null))[_0x930f('0x24')](removeEntity(_0x3420c4,null))[_0x930f('0x3e')](handleError(_0x3420c4,null));};exports[_0x930f('0x44')]=function(_0x289738,_0x1d5c23){return db['CmHopperBlack'][_0x930f('0x44')]()[_0x930f('0x24')](respondWithResult(_0x1d5c23,null))[_0x930f('0x3e')](handleError(_0x1d5c23,null));}; \ No newline at end of file +var _0xe941=['undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','name','index','map','CmHopperBlack','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','includeAll','include','findAll','rows','show','params','find','body','catch','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','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','../../config/license/util','../../mysqldb','sendStatus','status','offset'];(function(_0x3ad2e5,_0x94d414){var _0xc4e565=function(_0x2c96e3){while(--_0x2c96e3){_0x3ad2e5['push'](_0x3ad2e5['shift']());}};_0xc4e565(++_0x94d414);}(_0xe941,0xc4));var _0x1e94=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0xe941[_0x278e3c];return _0x3e2d9b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1e94('0x0'));var zipdir=require(_0x1e94('0x1'));var jsonpatch=require(_0x1e94('0x2'));var rp=require(_0x1e94('0x3'));var moment=require(_0x1e94('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1e94('0x5'));var util=require(_0x1e94('0x6'));var path=require(_0x1e94('0x7'));var sox=require(_0x1e94('0x8'));var csv=require(_0x1e94('0x9'));var ejs=require(_0x1e94('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1e94('0xb'));var squel=require(_0x1e94('0xc'));var crypto=require('crypto');var jsforce=require(_0x1e94('0xd'));var deskjs=require(_0x1e94('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1e94('0xf'));var Papa=require('papaparse');var Redis=require(_0x1e94('0x10'));var authService=require(_0x1e94('0x11'));var qs=require(_0x1e94('0x12'));var as=require(_0x1e94('0x13'));var hardwareService=require(_0x1e94('0x14'));var logger=require(_0x1e94('0x15'))('api');var utils=require(_0x1e94('0x16'));var config=require(_0x1e94('0x17'));var licenseUtil=require(_0x1e94('0x18'));var db=require(_0x1e94('0x19'))['db'];function respondWithStatusCode(_0x13838d,_0x5ebe81){_0x5ebe81=_0x5ebe81||0xcc;return function(_0x519150){if(_0x519150){return _0x13838d[_0x1e94('0x1a')](_0x5ebe81);}return _0x13838d[_0x1e94('0x1b')](_0x5ebe81)['end']();};}function respondWithResult(_0x2025a3,_0x308081){_0x308081=_0x308081||0xc8;return function(_0x4eeaed){if(_0x4eeaed){return _0x2025a3[_0x1e94('0x1b')](_0x308081)['json'](_0x4eeaed);}};}function respondWithFilteredResult(_0x15b972,_0x4e2d35){return function(_0x5a9032){if(_0x5a9032){var _0xffe984=typeof _0x4e2d35[_0x1e94('0x1c')]===_0x1e94('0x1d')&&typeof _0x4e2d35[_0x1e94('0x1e')]===_0x1e94('0x1d');var _0x57b7e8=_0x5a9032[_0x1e94('0x1f')];var _0x428e34=_0xffe984?0x0:_0x4e2d35[_0x1e94('0x1c')];var _0x45fa5b=_0xffe984?_0x5a9032[_0x1e94('0x1f')]:_0x4e2d35[_0x1e94('0x1c')]+_0x4e2d35[_0x1e94('0x1e')];var _0x1b64bf;if(_0x45fa5b>=_0x57b7e8){_0x45fa5b=_0x57b7e8;_0x1b64bf=0xc8;}else{_0x1b64bf=0xce;}_0x15b972[_0x1e94('0x1b')](_0x1b64bf);return _0x15b972[_0x1e94('0x20')](_0x1e94('0x21'),_0x428e34+'-'+_0x45fa5b+'/'+_0x57b7e8)['json'](_0x5a9032);}return null;};}function patchUpdates(_0x15ab4){return function(_0x42848e){try{jsonpatch[_0x1e94('0x22')](_0x42848e,_0x15ab4,!![]);}catch(_0xe5826){return BPromise[_0x1e94('0x23')](_0xe5826);}return _0x42848e[_0x1e94('0x24')]();};}function saveUpdates(_0x5b8329,_0x30cf98){return function(_0x9c2206){if(_0x9c2206){return _0x9c2206[_0x1e94('0x25')](_0x5b8329)[_0x1e94('0x26')](function(_0x4fd5ab){return _0x4fd5ab;});}return null;};}function removeEntity(_0x338cd8,_0x741ff2){return function(_0x1790ec){if(_0x1790ec){return _0x1790ec['destroy']()[_0x1e94('0x26')](function(){_0x338cd8[_0x1e94('0x1b')](0xcc)[_0x1e94('0x27')]();});}};}function handleEntityNotFound(_0x2cb1e6,_0x58c364){return function(_0x92652f){if(!_0x92652f){_0x2cb1e6['sendStatus'](0x194);}return _0x92652f;};}function handleError(_0x5834b9,_0xeff195){_0xeff195=_0xeff195||0x1f4;return function(_0x3c1c7f){logger['error'](_0x3c1c7f['stack']);if(_0x3c1c7f[_0x1e94('0x28')]){delete _0x3c1c7f[_0x1e94('0x28')];}_0x5834b9['status'](_0xeff195)['send'](_0x3c1c7f);};}exports[_0x1e94('0x29')]=function(_0x20bce1,_0x351e3b){var _0x2ca82c={},_0x26d32a={},_0x2f9eb1={'count':0x0,'rows':[]};var _0x3906fd=_[_0x1e94('0x2a')](db[_0x1e94('0x2b')][_0x1e94('0x2c')],function(_0x4b0989){return{'name':_0x4b0989[_0x1e94('0x2d')],'type':_0x4b0989[_0x1e94('0x2e')][_0x1e94('0x2f')]};});_0x26d32a[_0x1e94('0x30')]=_[_0x1e94('0x2a')](_0x3906fd,_0x1e94('0x28'));_0x26d32a[_0x1e94('0x31')]=_[_0x1e94('0x32')](_0x20bce1['query']);_0x26d32a[_0x1e94('0x33')]=_[_0x1e94('0x34')](_0x26d32a[_0x1e94('0x30')],_0x26d32a[_0x1e94('0x31')]);_0x2ca82c['attributes']=_['intersection'](_0x26d32a[_0x1e94('0x30')],qs[_0x1e94('0x35')](_0x20bce1['query'][_0x1e94('0x35')]));_0x2ca82c[_0x1e94('0x36')]=_0x2ca82c[_0x1e94('0x36')][_0x1e94('0x37')]?_0x2ca82c[_0x1e94('0x36')]:_0x26d32a[_0x1e94('0x30')];if(!_0x20bce1[_0x1e94('0x31')][_0x1e94('0x38')](_0x1e94('0x39'))){_0x2ca82c[_0x1e94('0x1e')]=qs[_0x1e94('0x1e')](_0x20bce1[_0x1e94('0x31')][_0x1e94('0x1e')]);_0x2ca82c[_0x1e94('0x1c')]=qs['offset'](_0x20bce1[_0x1e94('0x31')][_0x1e94('0x1c')]);}_0x2ca82c[_0x1e94('0x3a')]=qs[_0x1e94('0x3b')](_0x20bce1['query'][_0x1e94('0x3b')]);_0x2ca82c[_0x1e94('0x3c')]=qs['filters'](_[_0x1e94('0x3d')](_0x20bce1['query'],_0x26d32a[_0x1e94('0x33')]),_0x3906fd);if(_0x20bce1['query']['filter']){_0x2ca82c[_0x1e94('0x3c')]=_[_0x1e94('0x3e')](_0x2ca82c[_0x1e94('0x3c')],{'$or':_['map'](_0x3906fd,function(_0x30d0e4){if(_0x30d0e4[_0x1e94('0x2e')]!=='VIRTUAL'){var _0x2c9f68={};_0x2c9f68[_0x30d0e4['name']]={'$like':'%'+_0x20bce1[_0x1e94('0x31')]['filter']+'%'};return _0x2c9f68;}})});}_0x2ca82c=_[_0x1e94('0x3e')]({},_0x2ca82c,_0x20bce1[_0x1e94('0x3f')]);var _0x225c64={'where':_0x2ca82c['where']};return db[_0x1e94('0x2b')][_0x1e94('0x1f')](_0x225c64)[_0x1e94('0x26')](function(_0x3e0212){_0x2f9eb1[_0x1e94('0x1f')]=_0x3e0212;if(_0x20bce1[_0x1e94('0x31')][_0x1e94('0x40')]){_0x2ca82c[_0x1e94('0x41')]=[{'all':!![]}];}return db[_0x1e94('0x2b')][_0x1e94('0x42')](_0x2ca82c);})[_0x1e94('0x26')](function(_0x1b19c1){_0x2f9eb1[_0x1e94('0x43')]=_0x1b19c1;return _0x2f9eb1;})[_0x1e94('0x26')](respondWithFilteredResult(_0x351e3b,_0x2ca82c))['catch'](handleError(_0x351e3b,null));};exports[_0x1e94('0x44')]=function(_0x4fd674,_0x3a6797){var _0x363236={'raw':!![],'where':{'id':_0x4fd674[_0x1e94('0x45')]['id']}},_0x47bc0f={};_0x47bc0f[_0x1e94('0x30')]=_[_0x1e94('0x32')](db[_0x1e94('0x2b')][_0x1e94('0x2c')]);_0x47bc0f['query']=_[_0x1e94('0x32')](_0x4fd674[_0x1e94('0x31')]);_0x47bc0f['filters']=_[_0x1e94('0x34')](_0x47bc0f[_0x1e94('0x30')],_0x47bc0f[_0x1e94('0x31')]);_0x363236['attributes']=_[_0x1e94('0x34')](_0x47bc0f[_0x1e94('0x30')],qs[_0x1e94('0x35')](_0x4fd674['query']['fields']));_0x363236['attributes']=_0x363236[_0x1e94('0x36')][_0x1e94('0x37')]?_0x363236[_0x1e94('0x36')]:_0x47bc0f[_0x1e94('0x30')];if(_0x4fd674['query']['includeAll']){_0x363236[_0x1e94('0x41')]=[{'all':!![]}];}_0x363236=_[_0x1e94('0x3e')]({},_0x363236,_0x4fd674[_0x1e94('0x3f')]);return db[_0x1e94('0x2b')][_0x1e94('0x46')](_0x363236)[_0x1e94('0x26')](handleEntityNotFound(_0x3a6797,null))[_0x1e94('0x26')](respondWithResult(_0x3a6797,null))['catch'](handleError(_0x3a6797,null));};exports[_0x1e94('0x25')]=function(_0x8e2e7f,_0x223730){if(_0x8e2e7f[_0x1e94('0x47')]['id']){delete _0x8e2e7f[_0x1e94('0x47')]['id'];}return db[_0x1e94('0x2b')][_0x1e94('0x46')]({'where':{'id':_0x8e2e7f['params']['id']}})[_0x1e94('0x26')](handleEntityNotFound(_0x223730,null))[_0x1e94('0x26')](saveUpdates(_0x8e2e7f[_0x1e94('0x47')],null))['then'](respondWithResult(_0x223730,null))[_0x1e94('0x48')](handleError(_0x223730,null));};exports[_0x1e94('0x49')]=function(_0x4c99e3,_0x48035b){return db[_0x1e94('0x2b')][_0x1e94('0x46')]({'where':{'id':_0x4c99e3[_0x1e94('0x45')]['id']}})['then'](handleEntityNotFound(_0x48035b,null))[_0x1e94('0x26')](removeEntity(_0x48035b,null))[_0x1e94('0x48')](handleError(_0x48035b,null));};exports[_0x1e94('0x4a')]=function(_0x564961,_0x77f93e){return db[_0x1e94('0x2b')]['describe']()[_0x1e94('0x26')](respondWithResult(_0x77f93e,null))[_0x1e94('0x48')](handleError(_0x77f93e,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index dea4d2c..092db90 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 _0x1e3a=['../../config/environment','./cmHopperBlack.attributes','exports','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1e3a,0x1f2));var _0xa1e3=function(_0x4c2f17,_0x5c6821){_0x4c2f17=_0x4c2f17-0x0;var _0x20919e=_0x1e3a[_0x4c2f17];return _0x20919e;};'use strict';var _=require(_0xa1e3('0x0'));var util=require(_0xa1e3('0x1'));var logger=require(_0xa1e3('0x2'))(_0xa1e3('0x3'));var moment=require('moment');var BPromise=require(_0xa1e3('0x4'));var rp=require(_0xa1e3('0x5'));var fs=require('fs');var path=require(_0xa1e3('0x6'));var rimraf=require(_0xa1e3('0x7'));var config=require(_0xa1e3('0x8'));var attributes=require(_0xa1e3('0x9'));module[_0xa1e3('0xa')]=function(_0x565bea,_0x281b81){return _0x565bea['define']('CmHopperBlack',attributes,{'tableName':'cm_hopper_black','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6ff6=['CmHopperBlack','cm_hopper_black','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./cmHopperBlack.attributes','exports','define'];(function(_0x5c9595,_0x4b1b42){var _0x1eb7f7=function(_0x49fb6f){while(--_0x49fb6f){_0x5c9595['push'](_0x5c9595['shift']());}};_0x1eb7f7(++_0x4b1b42);}(_0x6ff6,0x9e));var _0x66ff=function(_0x3102d7,_0x543bde){_0x3102d7=_0x3102d7-0x0;var _0x1ec39c=_0x6ff6[_0x3102d7];return _0x1ec39c;};'use strict';var _=require('lodash');var util=require(_0x66ff('0x0'));var logger=require(_0x66ff('0x1'))(_0x66ff('0x2'));var moment=require(_0x66ff('0x3'));var BPromise=require(_0x66ff('0x4'));var rp=require(_0x66ff('0x5'));var fs=require('fs');var path=require(_0x66ff('0x6'));var rimraf=require('rimraf');var config=require(_0x66ff('0x7'));var attributes=require(_0x66ff('0x8'));module[_0x66ff('0x9')]=function(_0x97ea96,_0x1cc8bb){return _0x97ea96[_0x66ff('0xa')](_0x66ff('0xb'),attributes,{'tableName':_0x66ff('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js index 304513a..759996e 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 _0x5a27=['CmHopperBlack,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','catch','GetCmHopperBlack','findAll','options','raw','where','limit','include','map','model','attributes','CmHopperBlack','update','body','UpdateCmHopperBlack','DestroyCmHopperBlack','destroy','lodash','util','moment','bluebird','../../mysqldb','rpc','../../config/environment','client','request','then','info'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0x5a27,0xc7));var _0x75a2=function(_0x28688d,_0x190a6c){_0x28688d=_0x28688d-0x0;var _0x2c043e=_0x5a27[_0x28688d];return _0x2c043e;};'use strict';var _=require(_0x75a2('0x0'));var util=require(_0x75a2('0x1'));var moment=require(_0x75a2('0x2'));var BPromise=require(_0x75a2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x75a2('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x75a2('0x5'));var config=require(_0x75a2('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x75a2('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3115fa,_0x4b12c3,_0x4f4e45){return new BPromise(function(_0x1d8578,_0x5cd2b0){return client[_0x75a2('0x8')](_0x3115fa,_0x4f4e45)[_0x75a2('0x9')](function(_0x271bcc){logger[_0x75a2('0xa')](_0x75a2('0xb'),_0x4b12c3,'request\x20sent');logger[_0x75a2('0xc')]('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x4b12c3,_0x75a2('0xd'),JSON[_0x75a2('0xe')](_0x271bcc));if(_0x271bcc['error']){if(_0x271bcc['error'][_0x75a2('0xf')]===0x1f4){logger['error'](_0x75a2('0xb'),_0x4b12c3,_0x271bcc[_0x75a2('0x10')][_0x75a2('0x11')]);return _0x5cd2b0(_0x271bcc['error'][_0x75a2('0x11')]);}logger[_0x75a2('0x10')](_0x75a2('0xb'),_0x4b12c3,_0x271bcc['error'][_0x75a2('0x11')]);return _0x1d8578(_0x271bcc['error'][_0x75a2('0x11')]);}else{logger['info'](_0x75a2('0xb'),_0x4b12c3,_0x75a2('0xd'));_0x1d8578(_0x271bcc['result'][_0x75a2('0x11')]);}})[_0x75a2('0x12')](function(_0x1a4361){logger[_0x75a2('0x10')](_0x75a2('0xb'),_0x4b12c3,_0x1a4361);_0x5cd2b0(_0x1a4361);});});}exports[_0x75a2('0x13')]=function(_0x97a136){var _0x5cb681=this;return new Promise(function(_0x3abf48,_0x412bf8){return db['CmHopperBlack'][_0x75a2('0x14')]({'raw':_0x97a136[_0x75a2('0x15')]?_0x97a136[_0x75a2('0x15')][_0x75a2('0x16')]===undefined?!![]:![]:!![],'where':_0x97a136[_0x75a2('0x15')]?_0x97a136[_0x75a2('0x15')][_0x75a2('0x17')]||null:null,'attributes':_0x97a136[_0x75a2('0x15')]?_0x97a136[_0x75a2('0x15')]['attributes']||null:null,'limit':_0x97a136[_0x75a2('0x15')]?_0x97a136[_0x75a2('0x15')][_0x75a2('0x18')]||null:null,'include':_0x97a136[_0x75a2('0x15')]?_0x97a136[_0x75a2('0x15')][_0x75a2('0x19')]?_[_0x75a2('0x1a')](_0x97a136[_0x75a2('0x15')][_0x75a2('0x19')],function(_0x5c379b){return{'model':db[_0x5c379b[_0x75a2('0x1b')]],'as':_0x5c379b['as'],'attributes':_0x5c379b['attributes'],'include':_0x5c379b[_0x75a2('0x19')]?_[_0x75a2('0x1a')](_0x5c379b[_0x75a2('0x19')],function(_0x5de28b){return{'model':db[_0x5de28b[_0x75a2('0x1b')]],'as':_0x5de28b['as'],'attributes':_0x5de28b[_0x75a2('0x1c')],'include':_0x5de28b[_0x75a2('0x19')]?_[_0x75a2('0x1a')](_0x5de28b[_0x75a2('0x19')],function(_0x36bcf9){return{'model':db[_0x36bcf9['model']],'as':_0x36bcf9['as'],'attributes':_0x36bcf9[_0x75a2('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x399963){logger['info'](_0x75a2('0x13'),_0x97a136);logger['debug']('GetCmHopperBlack',_0x97a136,JSON[_0x75a2('0xe')](_0x399963));_0x3abf48(_0x399963);})[_0x75a2('0x12')](function(_0x42d743){logger['error'](_0x75a2('0x13'),_0x42d743[_0x75a2('0x11')],_0x97a136);_0x412bf8(_0x5cb681[_0x75a2('0x10')](0x1f4,_0x42d743[_0x75a2('0x11')]));});});};exports['UpdateCmHopperBlack']=function(_0x332fa3){var _0x5e6e17=this;return new Promise(function(_0x3acdc0,_0x116b4f){return db[_0x75a2('0x1d')][_0x75a2('0x1e')](_0x332fa3[_0x75a2('0x1f')],{'raw':_0x332fa3[_0x75a2('0x15')]?_0x332fa3[_0x75a2('0x15')][_0x75a2('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x332fa3[_0x75a2('0x15')]?_0x332fa3[_0x75a2('0x15')][_0x75a2('0x17')]||null:null,'attributes':_0x332fa3[_0x75a2('0x15')]?_0x332fa3['options'][_0x75a2('0x1c')]||null:null,'limit':_0x332fa3[_0x75a2('0x15')]?_0x332fa3[_0x75a2('0x15')][_0x75a2('0x18')]||null:null})[_0x75a2('0x9')](function(_0x44f16e){logger[_0x75a2('0xa')]('UpdateCmHopperBlack',_0x332fa3);logger[_0x75a2('0xc')](_0x75a2('0x20'),_0x332fa3,JSON[_0x75a2('0xe')](_0x44f16e));_0x3acdc0(_0x44f16e);})['catch'](function(_0x8c3cb0){logger[_0x75a2('0x10')](_0x75a2('0x20'),_0x8c3cb0['message'],_0x332fa3);_0x116b4f(_0x5e6e17[_0x75a2('0x10')](0x1f4,_0x8c3cb0['message']));});});};exports[_0x75a2('0x21')]=function(_0x17b1f1){var _0x43f26a=this;return new Promise(function(_0x1fb391,_0x8fb274){return db['CmHopperBlack'][_0x75a2('0x22')]({'where':_0x17b1f1[_0x75a2('0x15')]?_0x17b1f1[_0x75a2('0x15')][_0x75a2('0x17')]||null:null})[_0x75a2('0x9')](function(_0x241fe2){logger['info'](_0x75a2('0x21'),_0x17b1f1);logger[_0x75a2('0xc')](_0x75a2('0x21'),_0x17b1f1,JSON[_0x75a2('0xe')](_0x241fe2));_0x1fb391(_0x241fe2);})['catch'](function(_0x18bb0b){logger['error'](_0x75a2('0x21'),_0x18bb0b[_0x75a2('0x11')],_0x17b1f1);_0x8fb274(_0x43f26a['error'](0x1f4,_0x18bb0b['message']));});});}; \ No newline at end of file +var _0xb045=['findAll','options','raw','where','attributes','limit','include','map','model','debug','GetCmHopperBlack','UpdateCmHopperBlack','update','body','DestroyCmHopperBlack','destroy','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','CmHopperBlack,\x20%s,\x20%s','request\x20sent','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CmHopperBlack'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0xb045,0x166));var _0x5b04=function(_0x57a53b,_0x11494e){_0x57a53b=_0x57a53b-0x0;var _0x29e81c=_0xb045[_0x57a53b];return _0x29e81c;};'use strict';var _=require(_0x5b04('0x0'));var util=require(_0x5b04('0x1'));var moment=require(_0x5b04('0x2'));var BPromise=require('bluebird');var rs=require(_0x5b04('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5b04('0x4'))['db'];var utils=require(_0x5b04('0x5'));var logger=require(_0x5b04('0x6'))(_0x5b04('0x7'));var config=require('../../config/environment');var jayson=require(_0x5b04('0x8'));var client=jayson['client'][_0x5b04('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x484bc5,_0x98b479,_0x6ff99f){return new BPromise(function(_0x5ef4b4,_0x12cbd8){return client['request'](_0x484bc5,_0x6ff99f)[_0x5b04('0xa')](function(_0x345236){logger['info'](_0x5b04('0xb'),_0x98b479,_0x5b04('0xc'));logger['debug'](_0x5b04('0xd'),_0x98b479,'request\x20sent',JSON[_0x5b04('0xe')](_0x345236));if(_0x345236[_0x5b04('0xf')]){if(_0x345236[_0x5b04('0xf')][_0x5b04('0x10')]===0x1f4){logger[_0x5b04('0xf')](_0x5b04('0xb'),_0x98b479,_0x345236[_0x5b04('0xf')][_0x5b04('0x11')]);return _0x12cbd8(_0x345236[_0x5b04('0xf')][_0x5b04('0x11')]);}logger[_0x5b04('0xf')](_0x5b04('0xb'),_0x98b479,_0x345236[_0x5b04('0xf')][_0x5b04('0x11')]);return _0x5ef4b4(_0x345236[_0x5b04('0xf')][_0x5b04('0x11')]);}else{logger[_0x5b04('0x12')]('CmHopperBlack,\x20%s,\x20%s',_0x98b479,_0x5b04('0xc'));_0x5ef4b4(_0x345236[_0x5b04('0x13')]['message']);}})[_0x5b04('0x14')](function(_0x2f6f2a){logger[_0x5b04('0xf')](_0x5b04('0xb'),_0x98b479,_0x2f6f2a);_0x12cbd8(_0x2f6f2a);});});}exports['GetCmHopperBlack']=function(_0x4da91a){var _0x5081c3=this;return new Promise(function(_0x3d7a93,_0x43c401){return db[_0x5b04('0x15')][_0x5b04('0x16')]({'raw':_0x4da91a[_0x5b04('0x17')]?_0x4da91a[_0x5b04('0x17')][_0x5b04('0x18')]===undefined?!![]:![]:!![],'where':_0x4da91a[_0x5b04('0x17')]?_0x4da91a[_0x5b04('0x17')][_0x5b04('0x19')]||null:null,'attributes':_0x4da91a[_0x5b04('0x17')]?_0x4da91a[_0x5b04('0x17')][_0x5b04('0x1a')]||null:null,'limit':_0x4da91a['options']?_0x4da91a[_0x5b04('0x17')][_0x5b04('0x1b')]||null:null,'include':_0x4da91a[_0x5b04('0x17')]?_0x4da91a[_0x5b04('0x17')][_0x5b04('0x1c')]?_[_0x5b04('0x1d')](_0x4da91a[_0x5b04('0x17')]['include'],function(_0x414c40){return{'model':db[_0x414c40[_0x5b04('0x1e')]],'as':_0x414c40['as'],'attributes':_0x414c40[_0x5b04('0x1a')],'include':_0x414c40[_0x5b04('0x1c')]?_['map'](_0x414c40[_0x5b04('0x1c')],function(_0x1001cb){return{'model':db[_0x1001cb[_0x5b04('0x1e')]],'as':_0x1001cb['as'],'attributes':_0x1001cb[_0x5b04('0x1a')],'include':_0x1001cb['include']?_['map'](_0x1001cb['include'],function(_0x1c1437){return{'model':db[_0x1c1437[_0x5b04('0x1e')]],'as':_0x1c1437['as'],'attributes':_0x1c1437['attributes']};}):[]};}):[]};}):[]:[]})[_0x5b04('0xa')](function(_0xc351ef){logger[_0x5b04('0x12')]('GetCmHopperBlack',_0x4da91a);logger[_0x5b04('0x1f')](_0x5b04('0x20'),_0x4da91a,JSON[_0x5b04('0xe')](_0xc351ef));_0x3d7a93(_0xc351ef);})[_0x5b04('0x14')](function(_0x2b6f16){logger[_0x5b04('0xf')](_0x5b04('0x20'),_0x2b6f16[_0x5b04('0x11')],_0x4da91a);_0x43c401(_0x5081c3[_0x5b04('0xf')](0x1f4,_0x2b6f16[_0x5b04('0x11')]));});});};exports[_0x5b04('0x21')]=function(_0x2422a5){var _0x702277=this;return new Promise(function(_0x5533bf,_0x433c64){return db['CmHopperBlack'][_0x5b04('0x22')](_0x2422a5[_0x5b04('0x23')],{'raw':_0x2422a5[_0x5b04('0x17')]?_0x2422a5[_0x5b04('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2422a5['options']?_0x2422a5[_0x5b04('0x17')]['where']||null:null,'attributes':_0x2422a5[_0x5b04('0x17')]?_0x2422a5[_0x5b04('0x17')][_0x5b04('0x1a')]||null:null,'limit':_0x2422a5[_0x5b04('0x17')]?_0x2422a5['options'][_0x5b04('0x1b')]||null:null})[_0x5b04('0xa')](function(_0x19c09b){logger[_0x5b04('0x12')]('UpdateCmHopperBlack',_0x2422a5);logger[_0x5b04('0x1f')]('UpdateCmHopperBlack',_0x2422a5,JSON['stringify'](_0x19c09b));_0x5533bf(_0x19c09b);})[_0x5b04('0x14')](function(_0x3650fe){logger[_0x5b04('0xf')](_0x5b04('0x21'),_0x3650fe['message'],_0x2422a5);_0x433c64(_0x702277[_0x5b04('0xf')](0x1f4,_0x3650fe['message']));});});};exports[_0x5b04('0x24')]=function(_0x39b31b){var _0x230a1b=this;return new Promise(function(_0x3bf3ec,_0x3be353){return db[_0x5b04('0x15')][_0x5b04('0x25')]({'where':_0x39b31b['options']?_0x39b31b[_0x5b04('0x17')][_0x5b04('0x19')]||null:null})['then'](function(_0x5c5f11){logger[_0x5b04('0x12')]('DestroyCmHopperBlack',_0x39b31b);logger[_0x5b04('0x1f')](_0x5b04('0x24'),_0x39b31b,JSON[_0x5b04('0xe')](_0x5c5f11));_0x3bf3ec(_0x5c5f11);})[_0x5b04('0x14')](function(_0x325be0){logger[_0x5b04('0xf')](_0x5b04('0x24'),_0x325be0['message'],_0x39b31b);_0x3be353(_0x230a1b[_0x5b04('0xf')](0x1f4,_0x325be0[_0x5b04('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 8759ad7..763abdc 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 _0x9a5a=['put','/:id','update','delete','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','index','/describe','isAuthenticated','describe','show'];(function(_0x1c62ce,_0x3c20ff){var _0x346c75=function(_0x374fd5){while(--_0x374fd5){_0x1c62ce['push'](_0x1c62ce['shift']());}};_0x346c75(++_0x3c20ff);}(_0x9a5a,0x194));var _0xa9a5=function(_0x1922c1,_0x835260){_0x1922c1=_0x1922c1-0x0;var _0x3d744c=_0x9a5a[_0x1922c1];return _0x3d744c;};'use strict';var multer=require(_0xa9a5('0x0'));var util=require(_0xa9a5('0x1'));var path=require(_0xa9a5('0x2'));var timeout=require(_0xa9a5('0x3'));var express=require(_0xa9a5('0x4'));var router=express['Router']();var fs_extra=require(_0xa9a5('0x5'));var auth=require(_0xa9a5('0x6'));var interaction=require(_0xa9a5('0x7'));var config=require(_0xa9a5('0x8'));var controller=require(_0xa9a5('0x9'));router[_0xa9a5('0xa')]('/',auth['isAuthenticated'](),controller[_0xa9a5('0xb')]);router[_0xa9a5('0xa')](_0xa9a5('0xc'),auth[_0xa9a5('0xd')](),controller[_0xa9a5('0xe')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xa9a5('0xf')]);router[_0xa9a5('0x10')](_0xa9a5('0x11'),auth[_0xa9a5('0xd')](),controller[_0xa9a5('0x12')]);router[_0xa9a5('0x13')](_0xa9a5('0x11'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x71ab=['get','isAuthenticated','index','/describe','describe','/:id','show','put','delete','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller'];(function(_0x2bcddb,_0x3eaf37){var _0x12a9e8=function(_0xeeb678){while(--_0xeeb678){_0x2bcddb['push'](_0x2bcddb['shift']());}};_0x12a9e8(++_0x3eaf37);}(_0x71ab,0x64));var _0xb71a=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x71ab[_0x3e5086];return _0xfeb102;};'use strict';var multer=require('multer');var util=require(_0xb71a('0x0'));var path=require('path');var timeout=require(_0xb71a('0x1'));var express=require('express');var router=express[_0xb71a('0x2')]();var fs_extra=require(_0xb71a('0x3'));var auth=require(_0xb71a('0x4'));var interaction=require(_0xb71a('0x5'));var config=require(_0xb71a('0x6'));var controller=require(_0xb71a('0x7'));router[_0xb71a('0x8')]('/',auth[_0xb71a('0x9')](),controller[_0xb71a('0xa')]);router[_0xb71a('0x8')](_0xb71a('0xb'),auth[_0xb71a('0x9')](),controller[_0xb71a('0xc')]);router[_0xb71a('0x8')](_0xb71a('0xd'),auth[_0xb71a('0x9')](),controller[_0xb71a('0xe')]);router[_0xb71a('0xf')]('/:id',auth[_0xb71a('0x9')](),controller['update']);router[_0xb71a('0x10')](_0xb71a('0xd'),auth[_0xb71a('0x9')](),controller['destroy']);module[_0xb71a('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 5b60199..92b7ae6 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 _0x5165=['followuptime','diff','dispositionat','BOOLEAN','sequelize','moment','INTEGER','STRING','DATE','getDataValue','setDataValue'];(function(_0x595b02,_0x4d7c97){var _0x50d5ec=function(_0x6c2bc8){while(--_0x6c2bc8){_0x595b02['push'](_0x595b02['shift']());}};_0x50d5ec(++_0x4d7c97);}(_0x5165,0x1bc));var _0x5516=function(_0x5264a7,_0x44a706){_0x5264a7=_0x5264a7-0x0;var _0x44f401=_0x5165[_0x5264a7];return _0x44f401;};'use strict';var Sequelize=require(_0x5516('0x0'));var moment=require(_0x5516('0x1'));module['exports']={'state':{'type':Sequelize[_0x5516('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x5516('0x3')]},'scheduledat':{'type':Sequelize[_0x5516('0x4')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x5516('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x5516('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x5516('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x5516('0x3')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x5516('0x3')]},'starttime':{'type':Sequelize[_0x5516('0x4')]},'responsetime':{'type':Sequelize[_0x5516('0x4')]},'answertime':{'type':Sequelize[_0x5516('0x4')]},'droptime':{'type':Sequelize[_0x5516('0x4')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x5516('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x5516('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x5516('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x5516('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x5516('0x3')]},'campaign':{'type':Sequelize[_0x5516('0x3')]},'campaigntype':{'type':Sequelize[_0x5516('0x3')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x5516('0x3')]},'disposition':{'type':Sequelize[_0x5516('0x3')]},'secondDisposition':{'type':Sequelize[_0x5516('0x3')]},'thirdDisposition':{'type':Sequelize[_0x5516('0x3')]},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0x59fe9a){var _0x31688f=this[_0x5516('0x5')]('endtime');if(_0x31688f&&_0x59fe9a){this[_0x5516('0x6')](_0x5516('0x7'),moment(_0x59fe9a)[_0x5516('0x8')](moment(_0x31688f),'seconds'));}return this[_0x5516('0x6')](_0x5516('0x9'),_0x59fe9a);}},'amd':{'type':Sequelize[_0x5516('0xa')],'defaultValue':![]},'fax':{'type':Sequelize[_0x5516('0xa')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x5516('0xa')],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize[_0x5516('0xa')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x5516('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x5516('0x4')]},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x5516('0xa')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x5516('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0x5516('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x5516('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x5669=['endtime','setDataValue','followuptime','diff','dispositionat','BOOLEAN','moment','exports','INTEGER','DATE','STRING','getDataValue'];(function(_0x1e3417,_0x405bc6){var _0x40f048=function(_0x4293df){while(--_0x4293df){_0x1e3417['push'](_0x1e3417['shift']());}};_0x40f048(++_0x405bc6);}(_0x5669,0xc6));var _0x9566=function(_0x4490a4,_0x2d4239){_0x4490a4=_0x4490a4-0x0;var _0x8747=_0x5669[_0x4490a4];return _0x8747;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x9566('0x0'));module[_0x9566('0x1')]={'state':{'type':Sequelize[_0x9566('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x9566('0x3')]},'countbusyretry':{'type':Sequelize[_0x9566('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x9566('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x9566('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0x9566('0x4')]},'originatecalleridname':{'type':Sequelize[_0x9566('0x4')]},'calleridnum':{'type':Sequelize[_0x9566('0x4')]},'calleridname':{'type':Sequelize[_0x9566('0x4')]},'starttime':{'type':Sequelize[_0x9566('0x3')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x9566('0x3')]},'droptime':{'type':Sequelize[_0x9566('0x3')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x9566('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x9566('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x9566('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x9566('0x4')]},'campaign':{'type':Sequelize[_0x9566('0x4')]},'campaigntype':{'type':Sequelize[_0x9566('0x4')]},'membername':{'type':Sequelize[_0x9566('0x4')]},'reason':{'type':Sequelize[_0x9566('0x4')]},'disposition':{'type':Sequelize[_0x9566('0x4')]},'secondDisposition':{'type':Sequelize[_0x9566('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0x9566('0x3')],'set':function(_0xa2fefc){var _0x1acef7=this[_0x9566('0x5')](_0x9566('0x6'));if(_0x1acef7&&_0xa2fefc){this[_0x9566('0x7')](_0x9566('0x8'),moment(_0xa2fefc)[_0x9566('0x9')](moment(_0x1acef7),'seconds'));}return this[_0x9566('0x7')](_0x9566('0xa'),_0xa2fefc);}},'amd':{'type':Sequelize[_0x9566('0xb')],'defaultValue':![]},'fax':{'type':Sequelize[_0x9566('0xb')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x9566('0xb')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x9566('0xb')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x9566('0x3')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x9566('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x9566('0x3')]},'deleted':{'type':Sequelize[_0x9566('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x9566('0x3')]},'recallme':{'type':Sequelize[_0x9566('0xb')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x9566('0x3')]},'countnosuchnumberretry':{'type':Sequelize[_0x9566('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x9566('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x9566('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x9566('0x2')],'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 1f19107..1b9faba 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 _0x2a07=['jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','Content-Range','apply','reject','save','update','then','error','name','send','index','map','CmHopperFinal','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','include','catch','show','params','fields','includeAll','describe','body','uniqueid','find','findAll','sequelize','COUNT','literal','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','busyContacts','`state`\x20=\x2010\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','congestionContacts','moveContactsQueueCampaignHopperFinal','insert','into','cm_hopper','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','select','ANY_VALUE(calleridnum)','phone','field','NOW()','scheduledAt','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','state\x20=\x204','toString','Campaign','CampaignId','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','group','checkContactHopper','CmHopper','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x28cdfb,_0x208cec){var _0x312003=function(_0x24eebe){while(--_0x24eebe){_0x28cdfb['push'](_0x28cdfb['shift']());}};_0x312003(++_0x208cec);}(_0x2a07,0x74));var _0x72a0=function(_0x30c2ae,_0x4c98a2){_0x30c2ae=_0x30c2ae-0x0;var _0x1ee1cc=_0x2a07[_0x30c2ae];return _0x1ee1cc;};'use strict';var emlformat=require(_0x72a0('0x0'));var rimraf=require(_0x72a0('0x1'));var zipdir=require(_0x72a0('0x2'));var jsonpatch=require(_0x72a0('0x3'));var rp=require(_0x72a0('0x4'));var moment=require('moment');var BPromise=require(_0x72a0('0x5'));var Mustache=require(_0x72a0('0x6'));var util=require(_0x72a0('0x7'));var path=require(_0x72a0('0x8'));var sox=require(_0x72a0('0x9'));var csv=require(_0x72a0('0xa'));var ejs=require(_0x72a0('0xb'));var fs=require('fs');var fs_extra=require(_0x72a0('0xc'));var _=require(_0x72a0('0xd'));var squel=require(_0x72a0('0xe'));var crypto=require(_0x72a0('0xf'));var jsforce=require(_0x72a0('0x10'));var deskjs=require(_0x72a0('0x11'));var toCsv=require(_0x72a0('0xa'));var querystring=require(_0x72a0('0x12'));var Papa=require(_0x72a0('0x13'));var Redis=require('ioredis');var authService=require(_0x72a0('0x14'));var qs=require(_0x72a0('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x72a0('0x16'));var logger=require(_0x72a0('0x17'))(_0x72a0('0x18'));var utils=require(_0x72a0('0x19'));var config=require(_0x72a0('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x72a0('0x1b'))['db'];function respondWithStatusCode(_0x335b9f,_0x123ca4){_0x123ca4=_0x123ca4||0xcc;return function(_0xf91a82){if(_0xf91a82){return _0x335b9f[_0x72a0('0x1c')](_0x123ca4);}return _0x335b9f[_0x72a0('0x1d')](_0x123ca4)[_0x72a0('0x1e')]();};}function respondWithResult(_0x5e0b5f,_0x4930c5){_0x4930c5=_0x4930c5||0xc8;return function(_0xe103dc){if(_0xe103dc){return _0x5e0b5f[_0x72a0('0x1d')](_0x4930c5)[_0x72a0('0x1f')](_0xe103dc);}};}function respondWithFilteredResult(_0x1d1133,_0x23b001){return function(_0x3f3d62){if(_0x3f3d62){var _0x4ab55e=typeof _0x23b001[_0x72a0('0x20')]===_0x72a0('0x21')&&typeof _0x23b001[_0x72a0('0x22')]===_0x72a0('0x21');var _0x2d1e95=_0x3f3d62['count'];var _0x100d8f=_0x4ab55e?0x0:_0x23b001[_0x72a0('0x20')];var _0x131b73=_0x4ab55e?_0x3f3d62['count']:_0x23b001[_0x72a0('0x20')]+_0x23b001[_0x72a0('0x22')];var _0x30899b;if(_0x131b73>=_0x2d1e95){_0x131b73=_0x2d1e95;_0x30899b=0xc8;}else{_0x30899b=0xce;}_0x1d1133[_0x72a0('0x1d')](_0x30899b);return _0x1d1133['set'](_0x72a0('0x23'),_0x100d8f+'-'+_0x131b73+'/'+_0x2d1e95)['json'](_0x3f3d62);}return null;};}function patchUpdates(_0x3d0607){return function(_0x315413){try{jsonpatch[_0x72a0('0x24')](_0x315413,_0x3d0607,!![]);}catch(_0x5c7479){return BPromise[_0x72a0('0x25')](_0x5c7479);}return _0x315413[_0x72a0('0x26')]();};}function saveUpdates(_0x1d22d8,_0x3d1965){return function(_0x5d6145){if(_0x5d6145){return _0x5d6145[_0x72a0('0x27')](_0x1d22d8)[_0x72a0('0x28')](function(_0x1ddd54){return _0x1ddd54;});}return null;};}function removeEntity(_0x23b918,_0x3022b0){return function(_0x174b1b){if(_0x174b1b){return _0x174b1b['destroy']()['then'](function(){_0x23b918[_0x72a0('0x1d')](0xcc)[_0x72a0('0x1e')]();});}};}function handleEntityNotFound(_0x123df4,_0x1504ed){return function(_0xf5cb49){if(!_0xf5cb49){_0x123df4[_0x72a0('0x1c')](0x194);}return _0xf5cb49;};}function handleError(_0xa5bda0,_0x15922a){_0x15922a=_0x15922a||0x1f4;return function(_0xee99e2){logger[_0x72a0('0x29')](_0xee99e2['stack']);if(_0xee99e2[_0x72a0('0x2a')]){delete _0xee99e2[_0x72a0('0x2a')];}_0xa5bda0[_0x72a0('0x1d')](_0x15922a)[_0x72a0('0x2b')](_0xee99e2);};}exports[_0x72a0('0x2c')]=function(_0x177a3a,_0x432179){var _0x12eda2={},_0x23c96a={},_0x916733={'count':0x0,'rows':[]};var _0x4ba037=_[_0x72a0('0x2d')](db[_0x72a0('0x2e')][_0x72a0('0x2f')],function(_0xfbe9b3){return{'name':_0xfbe9b3[_0x72a0('0x30')],'type':_0xfbe9b3[_0x72a0('0x31')][_0x72a0('0x32')]};});_0x23c96a['model']=_[_0x72a0('0x2d')](_0x4ba037,_0x72a0('0x2a'));_0x23c96a[_0x72a0('0x33')]=_[_0x72a0('0x34')](_0x177a3a[_0x72a0('0x33')]);_0x23c96a[_0x72a0('0x35')]=_[_0x72a0('0x36')](_0x23c96a[_0x72a0('0x37')],_0x23c96a['query']);_0x12eda2[_0x72a0('0x38')]=_[_0x72a0('0x36')](_0x23c96a[_0x72a0('0x37')],qs['fields'](_0x177a3a[_0x72a0('0x33')]['fields']));_0x12eda2[_0x72a0('0x38')]=_0x12eda2[_0x72a0('0x38')][_0x72a0('0x39')]?_0x12eda2[_0x72a0('0x38')]:_0x23c96a[_0x72a0('0x37')];if(!_0x177a3a[_0x72a0('0x33')][_0x72a0('0x3a')](_0x72a0('0x3b'))){_0x12eda2[_0x72a0('0x22')]=qs[_0x72a0('0x22')](_0x177a3a[_0x72a0('0x33')][_0x72a0('0x22')]);_0x12eda2['offset']=qs[_0x72a0('0x20')](_0x177a3a['query'][_0x72a0('0x20')]);}_0x12eda2[_0x72a0('0x3c')]=qs[_0x72a0('0x3d')](_0x177a3a[_0x72a0('0x33')][_0x72a0('0x3d')]);_0x12eda2[_0x72a0('0x3e')]=qs[_0x72a0('0x35')](_[_0x72a0('0x3f')](_0x177a3a[_0x72a0('0x33')],_0x23c96a['filters']),_0x4ba037);if(_0x177a3a['query'][_0x72a0('0x40')]){_0x12eda2[_0x72a0('0x3e')]=_[_0x72a0('0x41')](_0x12eda2[_0x72a0('0x3e')],{'$or':_[_0x72a0('0x2d')](_0x4ba037,function(_0x512a06){if(_0x512a06[_0x72a0('0x31')]!==_0x72a0('0x42')){var _0x582c90={};_0x582c90[_0x512a06[_0x72a0('0x2a')]]={'$like':'%'+_0x177a3a['query']['filter']+'%'};return _0x582c90;}})});}_0x12eda2=_['merge']({},_0x12eda2,_0x177a3a[_0x72a0('0x43')]);var _0x49633b={'where':_0x12eda2[_0x72a0('0x3e')]};return db[_0x72a0('0x2e')][_0x72a0('0x44')](_0x49633b)[_0x72a0('0x28')](function(_0x4bf56e){_0x916733['count']=_0x4bf56e;if(_0x177a3a['query']['includeAll']){_0x12eda2[_0x72a0('0x45')]=[{'all':!![]}];}return db[_0x72a0('0x2e')]['findAll'](_0x12eda2);})[_0x72a0('0x28')](function(_0x35d790){_0x916733['rows']=_0x35d790;return _0x916733;})[_0x72a0('0x28')](respondWithFilteredResult(_0x432179,_0x12eda2))[_0x72a0('0x46')](handleError(_0x432179,null));};exports[_0x72a0('0x47')]=function(_0xe4abe1,_0x340153){var _0x341451={'raw':!![],'where':{'id':_0xe4abe1[_0x72a0('0x48')]['id']}},_0x50eb7f={};_0x50eb7f['model']=_[_0x72a0('0x34')](db['CmHopperFinal'][_0x72a0('0x2f')]);_0x50eb7f[_0x72a0('0x33')]=_['keys'](_0xe4abe1[_0x72a0('0x33')]);_0x50eb7f['filters']=_[_0x72a0('0x36')](_0x50eb7f[_0x72a0('0x37')],_0x50eb7f[_0x72a0('0x33')]);_0x341451['attributes']=_[_0x72a0('0x36')](_0x50eb7f[_0x72a0('0x37')],qs[_0x72a0('0x49')](_0xe4abe1['query']['fields']));_0x341451[_0x72a0('0x38')]=_0x341451['attributes'][_0x72a0('0x39')]?_0x341451[_0x72a0('0x38')]:_0x50eb7f[_0x72a0('0x37')];if(_0xe4abe1[_0x72a0('0x33')][_0x72a0('0x4a')]){_0x341451[_0x72a0('0x45')]=[{'all':!![]}];}_0x341451=_[_0x72a0('0x41')]({},_0x341451,_0xe4abe1[_0x72a0('0x43')]);return db[_0x72a0('0x2e')]['find'](_0x341451)[_0x72a0('0x28')](handleEntityNotFound(_0x340153,null))[_0x72a0('0x28')](respondWithResult(_0x340153,null))[_0x72a0('0x46')](handleError(_0x340153,null));};exports[_0x72a0('0x4b')]=function(_0x3a669d,_0x304400){return db[_0x72a0('0x2e')]['describe']()['then'](respondWithResult(_0x304400,null))[_0x72a0('0x46')](handleError(_0x304400,null));};exports[_0x72a0('0x27')]=function(_0xe38fb3,_0x3cab6a){if(_0xe38fb3[_0x72a0('0x4c')][_0x72a0('0x4d')]){delete _0xe38fb3[_0x72a0('0x4c')][_0x72a0('0x4d')];}return db[_0x72a0('0x2e')][_0x72a0('0x4e')]({'where':{'uniqueid':_0xe38fb3['params']['id']}})[_0x72a0('0x28')](handleEntityNotFound(_0x3cab6a,null))[_0x72a0('0x28')](saveUpdates(_0xe38fb3[_0x72a0('0x4c')],null))[_0x72a0('0x28')](respondWithResult(_0x3cab6a,null))[_0x72a0('0x46')](handleError(_0x3cab6a,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x143410,_0x595243,_0x4d712b){return db[_0x72a0('0x2e')][_0x72a0('0x4f')]({'raw':![],'where':{'VoiceQueueId':_0x143410[_0x72a0('0x48')]['id']},'attributes':[[db[_0x72a0('0x50')]['fn'](_0x72a0('0x51'),db['sequelize']['fn']('IF',db[_0x72a0('0x50')][_0x72a0('0x52')]('`state`\x20=\x200,\x201,\x20null'))),'noSuchContacts'],[db[_0x72a0('0x50')]['fn'](_0x72a0('0x51'),db[_0x72a0('0x50')]['fn']('IF',db[_0x72a0('0x50')][_0x72a0('0x52')](_0x72a0('0x53')))),_0x72a0('0x54')],[db[_0x72a0('0x50')]['fn']('COUNT',db[_0x72a0('0x50')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x205,\x201,\x20null'))),_0x72a0('0x55')],[db[_0x72a0('0x50')]['fn']('COUNT',db[_0x72a0('0x50')]['fn']('IF',db['sequelize'][_0x72a0('0x52')]('`state`\x20=\x208,\x201,\x20null'))),'congestionContacts'],[db[_0x72a0('0x50')]['fn'](_0x72a0('0x51'),db['sequelize']['fn']('IF',db[_0x72a0('0x50')]['literal'](_0x72a0('0x56')))),'dropContacts'],[db['sequelize']['fn'](_0x72a0('0x51'),db[_0x72a0('0x50')]['fn']('IF',db[_0x72a0('0x50')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x72a0('0x57')],[db['sequelize']['fn'](_0x72a0('0x51'),db[_0x72a0('0x50')]['fn']('IF',db[_0x72a0('0x50')][_0x72a0('0x52')](_0x72a0('0x58')))),_0x72a0('0x59')],[db[_0x72a0('0x50')]['fn'](_0x72a0('0x51'),db[_0x72a0('0x50')]['fn']('IF',db[_0x72a0('0x50')][_0x72a0('0x52')](_0x72a0('0x5a')))),'answeringMachine']]})[_0x72a0('0x28')](handleEntityNotFound(_0x595243,null))['then'](respondWithResult(_0x595243,null))['catch'](handleError(_0x595243,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0x522ee2,_0x237025,_0x4e5d05){return db[_0x72a0('0x2e')]['findAll']({'raw':![],'where':{'CampaignId':_0x522ee2[_0x72a0('0x48')]['id']},'attributes':[[db['sequelize']['fn'](_0x72a0('0x51'),db[_0x72a0('0x50')]['fn']('IF',db['sequelize'][_0x72a0('0x52')](_0x72a0('0x5b')))),_0x72a0('0x5c')],[db[_0x72a0('0x50')]['fn']('COUNT',db[_0x72a0('0x50')]['fn']('IF',db['sequelize'][_0x72a0('0x52')](_0x72a0('0x53')))),_0x72a0('0x54')],[db['sequelize']['fn'](_0x72a0('0x51'),db[_0x72a0('0x50')]['fn']('IF',db[_0x72a0('0x50')][_0x72a0('0x52')](_0x72a0('0x5d')))),'busyContacts'],[db['sequelize']['fn'](_0x72a0('0x51'),db['sequelize']['fn']('IF',db[_0x72a0('0x50')]['literal'](_0x72a0('0x5e')))),_0x72a0('0x5f')],[db['sequelize']['fn'](_0x72a0('0x51'),db[_0x72a0('0x50')]['fn']('IF',db[_0x72a0('0x50')]['literal'](_0x72a0('0x56')))),'dropContacts'],[db[_0x72a0('0x50')]['fn'](_0x72a0('0x51'),db['sequelize']['fn']('IF',db[_0x72a0('0x50')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),'abandonedContacts'],[db[_0x72a0('0x50')]['fn']('COUNT',db[_0x72a0('0x50')]['fn']('IF',db['sequelize'][_0x72a0('0x52')](_0x72a0('0x58')))),_0x72a0('0x59')],[db['sequelize']['fn'](_0x72a0('0x51'),db[_0x72a0('0x50')]['fn']('IF',db[_0x72a0('0x50')][_0x72a0('0x52')](_0x72a0('0x5a')))),'answeringMachine']]})[_0x72a0('0x28')](handleEntityNotFound(_0x237025,null))[_0x72a0('0x28')](respondWithResult(_0x237025,null))[_0x72a0('0x46')](handleError(_0x237025,null));};exports[_0x72a0('0x60')]=function(_0x4f0944,_0x3dd25d,_0x647e75){return db['VoiceQueue'][_0x72a0('0x4e')]({'where':{'id':_0x4f0944['params']['id']}})[_0x72a0('0x28')](handleEntityNotFound(_0x3dd25d,null))[_0x72a0('0x28')](function(_0xb17e09){var _0x1238a3;if(_0xb17e09){_0x1238a3=squel[_0x72a0('0x61')]()[_0x72a0('0x62')](_0x72a0('0x63'))['fromQuery'](['phone','scheduledAt',_0x72a0('0x64'),_0x72a0('0x65'),_0x72a0('0x66'),_0x72a0('0x67'),_0x72a0('0x68')],squel[_0x72a0('0x69')]()['field'](_0x72a0('0x6a'),_0x72a0('0x6b'))[_0x72a0('0x6c')](_0x72a0('0x6d'),_0x72a0('0x6e'))[_0x72a0('0x6c')](_0x72a0('0x6f'),'ContactId')[_0x72a0('0x6c')](_0x72a0('0x70'),_0x72a0('0x65'))[_0x72a0('0x6c')](_0x72a0('0x71'),_0x72a0('0x66'))['field'](_0x72a0('0x6d'),'createdAt')[_0x72a0('0x6c')](_0x72a0('0x6d'),_0x72a0('0x68'))[_0x72a0('0x72')](_0x72a0('0x73'))['where'](_0x72a0('0x74'),_0x4f0944[_0x72a0('0x48')]['id']['toString']())[_0x72a0('0x3e')](_0x72a0('0x75'),_0x4f0944[_0x72a0('0x4c')][_0x72a0('0x76')]['toString']())[_0x72a0('0x3e')](_0x72a0('0x77'))[_0x72a0('0x3e')](_0x72a0('0x78'),squel[_0x72a0('0x69')]()[_0x72a0('0x6c')](_0x72a0('0x6b'))[_0x72a0('0x72')](_0x72a0('0x63'))[_0x72a0('0x3e')](_0x72a0('0x74'),_0x4f0944[_0x72a0('0x48')]['id']['toString']()))[_0x72a0('0x3e')](_0x72a0('0x78'),squel[_0x72a0('0x69')]()[_0x72a0('0x6c')](_0x72a0('0x79'))[_0x72a0('0x72')](_0x72a0('0x73'))[_0x72a0('0x3e')]('VoiceQueueId\x20=\x20?',_0x4f0944[_0x72a0('0x48')]['id']['toString']())['where'](_0x72a0('0x7a')))['group']('ContactId'))[_0x72a0('0x7b')]();return db['sequelize'][_0x72a0('0x33')](_0x1238a3);}return[];})[_0x72a0('0x28')](respondWithResult(_0x3dd25d,null))[_0x72a0('0x46')](handleError(_0x3dd25d,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x344a69,_0x179ca2,_0x3832d7){return db[_0x72a0('0x7c')][_0x72a0('0x4e')]({'where':{'id':_0x344a69['params']['id']}})[_0x72a0('0x28')](handleEntityNotFound(_0x179ca2,null))[_0x72a0('0x28')](function(_0x38736e){var _0x4f421f;if(_0x38736e){_0x4f421f=squel[_0x72a0('0x61')]()[_0x72a0('0x62')](_0x72a0('0x63'))['fromQuery']([_0x72a0('0x6b'),_0x72a0('0x6e'),_0x72a0('0x64'),_0x72a0('0x65'),_0x72a0('0x7d'),_0x72a0('0x67'),_0x72a0('0x68')],squel[_0x72a0('0x69')]()[_0x72a0('0x6c')]('ANY_VALUE(calleridnum)',_0x72a0('0x6b'))[_0x72a0('0x6c')](_0x72a0('0x6d'),_0x72a0('0x6e'))[_0x72a0('0x6c')]('ANY_VALUE(ContactId)',_0x72a0('0x64'))[_0x72a0('0x6c')](_0x72a0('0x70'),_0x72a0('0x65'))['field'](_0x72a0('0x7e'),_0x72a0('0x7d'))[_0x72a0('0x6c')]('NOW()','createdAt')[_0x72a0('0x6c')](_0x72a0('0x6d'),_0x72a0('0x68'))[_0x72a0('0x72')](_0x72a0('0x73'))['where']('CampaignId\x20=\x20?',_0x344a69['params']['id'][_0x72a0('0x7b')]())['where'](_0x72a0('0x75'),_0x344a69['body']['state']['toString']())['where'](_0x72a0('0x77'))[_0x72a0('0x3e')](_0x72a0('0x78'),squel[_0x72a0('0x69')]()['field'](_0x72a0('0x6b'))[_0x72a0('0x72')]('cm_hopper')[_0x72a0('0x3e')](_0x72a0('0x7f'),_0x344a69['params']['id'][_0x72a0('0x7b')]()))[_0x72a0('0x3e')](_0x72a0('0x78'),squel[_0x72a0('0x69')]()['field']('calleridnum')[_0x72a0('0x72')](_0x72a0('0x73'))[_0x72a0('0x3e')](_0x72a0('0x7f'),_0x344a69[_0x72a0('0x48')]['id'][_0x72a0('0x7b')]())['where']('state\x20=\x204'))[_0x72a0('0x80')](_0x72a0('0x64')))['toString']();return db[_0x72a0('0x50')][_0x72a0('0x33')](_0x4f421f);}return[];})[_0x72a0('0x28')](respondWithResult(_0x179ca2,null))[_0x72a0('0x46')](handleError(_0x179ca2,null));};exports[_0x72a0('0x81')]=function(_0x167a80,_0x7533ea,_0x56bdf5){return db[_0x72a0('0x82')][_0x72a0('0x83')]({'where':{'VoiceQueueId':_0x167a80[_0x72a0('0x4c')]['VoiceQueueId'],'CampaignId':_0x167a80[_0x72a0('0x4c')][_0x72a0('0x7d')],'ContactId':_0x167a80[_0x72a0('0x4c')][_0x72a0('0x64')]}})[_0x72a0('0x28')](handleEntityNotFound(_0x7533ea,null))['then'](function(_0xc16765){if(_0xc16765){return _0xc16765;}return null;})[_0x72a0('0x28')](respondWithResult(_0x7533ea,null))[_0x72a0('0x46')](handleError(_0x7533ea,null));}; \ No newline at end of file +var _0xc2c7=['`state`\x20=\x205,\x201,\x20null','congestionContacts','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2019,\x201,\x20null','answeringMachine','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','VoiceQueueId','createdAt','select','field','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ListId','ANY_VALUE(VoiceQueueId)','updatedAt','from','cm_hopper_final','VoiceQueueId\x20=\x20?','state\x20=\x20?','state','toString','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','group','moveContactsIvrCampaignHopperFinal','Campaign','ANY_VALUE(calleridnum)','CampaignId','CampaignId\x20=\x20?','calleridnum','state\x20=\x204','checkContactHopper','CmHopper','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','reject','save','update','destroy','then','error','name','send','index','map','CmHopperFinal','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','keys','find','uniqueid','params','body','countContactsQueueCampaignHopperFinal','sequelize','`state`\x20=\x200,\x201,\x20null','noSuchContacts','COUNT','literal','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','busyContacts','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','countContactsIvrCampaignHopperFinal'];(function(_0x471cf5,_0x2f4f22){var _0x251576=function(_0x133d88){while(--_0x133d88){_0x471cf5['push'](_0x471cf5['shift']());}};_0x251576(++_0x2f4f22);}(_0xc2c7,0x134));var _0x7c2c=function(_0x3a8ead,_0x4276f3){_0x3a8ead=_0x3a8ead-0x0;var _0x53fa89=_0xc2c7[_0x3a8ead];return _0x53fa89;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7c2c('0x0'));var zipdir=require(_0x7c2c('0x1'));var jsonpatch=require(_0x7c2c('0x2'));var rp=require(_0x7c2c('0x3'));var moment=require(_0x7c2c('0x4'));var BPromise=require(_0x7c2c('0x5'));var Mustache=require(_0x7c2c('0x6'));var util=require(_0x7c2c('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x7c2c('0x8'));var ejs=require(_0x7c2c('0x9'));var fs=require('fs');var fs_extra=require(_0x7c2c('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7c2c('0xb'));var deskjs=require(_0x7c2c('0xc'));var toCsv=require(_0x7c2c('0x8'));var querystring=require(_0x7c2c('0xd'));var Papa=require(_0x7c2c('0xe'));var Redis=require('ioredis');var authService=require(_0x7c2c('0xf'));var qs=require(_0x7c2c('0x10'));var as=require(_0x7c2c('0x11'));var hardwareService=require(_0x7c2c('0x12'));var logger=require(_0x7c2c('0x13'))(_0x7c2c('0x14'));var utils=require(_0x7c2c('0x15'));var config=require(_0x7c2c('0x16'));var licenseUtil=require(_0x7c2c('0x17'));var db=require(_0x7c2c('0x18'))['db'];function respondWithStatusCode(_0xae8441,_0x45847d){_0x45847d=_0x45847d||0xcc;return function(_0x68398a){if(_0x68398a){return _0xae8441[_0x7c2c('0x19')](_0x45847d);}return _0xae8441[_0x7c2c('0x1a')](_0x45847d)[_0x7c2c('0x1b')]();};}function respondWithResult(_0x4c4aaf,_0x5b5729){_0x5b5729=_0x5b5729||0xc8;return function(_0x102778){if(_0x102778){return _0x4c4aaf[_0x7c2c('0x1a')](_0x5b5729)[_0x7c2c('0x1c')](_0x102778);}};}function respondWithFilteredResult(_0x5ae94f,_0x11424c){return function(_0x206ecd){if(_0x206ecd){var _0x5e55e0=typeof _0x11424c[_0x7c2c('0x1d')]==='undefined'&&typeof _0x11424c[_0x7c2c('0x1e')]==='undefined';var _0x342ea2=_0x206ecd[_0x7c2c('0x1f')];var _0x14453f=_0x5e55e0?0x0:_0x11424c[_0x7c2c('0x1d')];var _0x17df4a=_0x5e55e0?_0x206ecd[_0x7c2c('0x1f')]:_0x11424c[_0x7c2c('0x1d')]+_0x11424c[_0x7c2c('0x1e')];var _0x2d356e;if(_0x17df4a>=_0x342ea2){_0x17df4a=_0x342ea2;_0x2d356e=0xc8;}else{_0x2d356e=0xce;}_0x5ae94f[_0x7c2c('0x1a')](_0x2d356e);return _0x5ae94f[_0x7c2c('0x20')](_0x7c2c('0x21'),_0x14453f+'-'+_0x17df4a+'/'+_0x342ea2)['json'](_0x206ecd);}return null;};}function patchUpdates(_0x1c5491){return function(_0x4adb62){try{jsonpatch['apply'](_0x4adb62,_0x1c5491,!![]);}catch(_0x15ae33){return BPromise[_0x7c2c('0x22')](_0x15ae33);}return _0x4adb62[_0x7c2c('0x23')]();};}function saveUpdates(_0x38ae30,_0x41552f){return function(_0x1883b5){if(_0x1883b5){return _0x1883b5[_0x7c2c('0x24')](_0x38ae30)['then'](function(_0x10c356){return _0x10c356;});}return null;};}function removeEntity(_0x4dedd8,_0x302c93){return function(_0x57f510){if(_0x57f510){return _0x57f510[_0x7c2c('0x25')]()[_0x7c2c('0x26')](function(){_0x4dedd8[_0x7c2c('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d6ec7,_0x31a50c){return function(_0x30c53e){if(!_0x30c53e){_0x4d6ec7[_0x7c2c('0x19')](0x194);}return _0x30c53e;};}function handleError(_0x150690,_0x31d8f3){_0x31d8f3=_0x31d8f3||0x1f4;return function(_0xa8e145){logger[_0x7c2c('0x27')](_0xa8e145['stack']);if(_0xa8e145[_0x7c2c('0x28')]){delete _0xa8e145[_0x7c2c('0x28')];}_0x150690[_0x7c2c('0x1a')](_0x31d8f3)[_0x7c2c('0x29')](_0xa8e145);};}exports[_0x7c2c('0x2a')]=function(_0x1f8846,_0xf2bfd1){var _0x26f472={},_0xa040ff={},_0x5769ec={'count':0x0,'rows':[]};var _0x465ad6=_[_0x7c2c('0x2b')](db[_0x7c2c('0x2c')][_0x7c2c('0x2d')],function(_0x53ad23){return{'name':_0x53ad23[_0x7c2c('0x2e')],'type':_0x53ad23[_0x7c2c('0x2f')][_0x7c2c('0x30')]};});_0xa040ff[_0x7c2c('0x31')]=_[_0x7c2c('0x2b')](_0x465ad6,_0x7c2c('0x28'));_0xa040ff[_0x7c2c('0x32')]=_['keys'](_0x1f8846[_0x7c2c('0x32')]);_0xa040ff[_0x7c2c('0x33')]=_[_0x7c2c('0x34')](_0xa040ff[_0x7c2c('0x31')],_0xa040ff[_0x7c2c('0x32')]);_0x26f472['attributes']=_['intersection'](_0xa040ff[_0x7c2c('0x31')],qs['fields'](_0x1f8846['query'][_0x7c2c('0x35')]));_0x26f472[_0x7c2c('0x36')]=_0x26f472[_0x7c2c('0x36')][_0x7c2c('0x37')]?_0x26f472['attributes']:_0xa040ff[_0x7c2c('0x31')];if(!_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x38')](_0x7c2c('0x39'))){_0x26f472[_0x7c2c('0x1e')]=qs[_0x7c2c('0x1e')](_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x1e')]);_0x26f472[_0x7c2c('0x1d')]=qs[_0x7c2c('0x1d')](_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x1d')]);}_0x26f472[_0x7c2c('0x3a')]=qs['sort'](_0x1f8846['query'][_0x7c2c('0x3b')]);_0x26f472['where']=qs['filters'](_['pick'](_0x1f8846[_0x7c2c('0x32')],_0xa040ff[_0x7c2c('0x33')]),_0x465ad6);if(_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x3c')]){_0x26f472[_0x7c2c('0x3d')]=_[_0x7c2c('0x3e')](_0x26f472[_0x7c2c('0x3d')],{'$or':_[_0x7c2c('0x2b')](_0x465ad6,function(_0x2b6520){if(_0x2b6520[_0x7c2c('0x2f')]!==_0x7c2c('0x3f')){var _0x58696a={};_0x58696a[_0x2b6520['name']]={'$like':'%'+_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x3c')]+'%'};return _0x58696a;}})});}_0x26f472=_[_0x7c2c('0x3e')]({},_0x26f472,_0x1f8846[_0x7c2c('0x40')]);var _0x5e8c96={'where':_0x26f472[_0x7c2c('0x3d')]};return db[_0x7c2c('0x2c')][_0x7c2c('0x1f')](_0x5e8c96)[_0x7c2c('0x26')](function(_0x18e288){_0x5769ec[_0x7c2c('0x1f')]=_0x18e288;if(_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x41')]){_0x26f472[_0x7c2c('0x42')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x7c2c('0x43')](_0x26f472);})['then'](function(_0x2c3f40){_0x5769ec[_0x7c2c('0x44')]=_0x2c3f40;return _0x5769ec;})['then'](respondWithFilteredResult(_0xf2bfd1,_0x26f472))[_0x7c2c('0x45')](handleError(_0xf2bfd1,null));};exports['show']=function(_0x3014fb,_0x33b2be){var _0x9b9813={'raw':!![],'where':{'id':_0x3014fb['params']['id']}},_0x26351e={};_0x26351e[_0x7c2c('0x31')]=_['keys'](db['CmHopperFinal'][_0x7c2c('0x2d')]);_0x26351e[_0x7c2c('0x32')]=_[_0x7c2c('0x46')](_0x3014fb['query']);_0x26351e[_0x7c2c('0x33')]=_[_0x7c2c('0x34')](_0x26351e['model'],_0x26351e[_0x7c2c('0x32')]);_0x9b9813['attributes']=_[_0x7c2c('0x34')](_0x26351e[_0x7c2c('0x31')],qs['fields'](_0x3014fb['query'][_0x7c2c('0x35')]));_0x9b9813[_0x7c2c('0x36')]=_0x9b9813['attributes'][_0x7c2c('0x37')]?_0x9b9813['attributes']:_0x26351e['model'];if(_0x3014fb[_0x7c2c('0x32')][_0x7c2c('0x41')]){_0x9b9813[_0x7c2c('0x42')]=[{'all':!![]}];}_0x9b9813=_[_0x7c2c('0x3e')]({},_0x9b9813,_0x3014fb[_0x7c2c('0x40')]);return db[_0x7c2c('0x2c')][_0x7c2c('0x47')](_0x9b9813)[_0x7c2c('0x26')](handleEntityNotFound(_0x33b2be,null))[_0x7c2c('0x26')](respondWithResult(_0x33b2be,null))['catch'](handleError(_0x33b2be,null));};exports['describe']=function(_0xeb067b,_0x3091bd){return db[_0x7c2c('0x2c')]['describe']()['then'](respondWithResult(_0x3091bd,null))[_0x7c2c('0x45')](handleError(_0x3091bd,null));};exports[_0x7c2c('0x24')]=function(_0x39d5af,_0x2b79d5){if(_0x39d5af['body']['uniqueid']){delete _0x39d5af['body'][_0x7c2c('0x48')];}return db[_0x7c2c('0x2c')][_0x7c2c('0x47')]({'where':{'uniqueid':_0x39d5af[_0x7c2c('0x49')]['id']}})[_0x7c2c('0x26')](handleEntityNotFound(_0x2b79d5,null))['then'](saveUpdates(_0x39d5af[_0x7c2c('0x4a')],null))[_0x7c2c('0x26')](respondWithResult(_0x2b79d5,null))['catch'](handleError(_0x2b79d5,null));};exports[_0x7c2c('0x4b')]=function(_0x56e09d,_0xfba6a7,_0x3806f4){return db[_0x7c2c('0x2c')]['findAll']({'raw':![],'where':{'VoiceQueueId':_0x56e09d['params']['id']},'attributes':[[db[_0x7c2c('0x4c')]['fn']('COUNT',db[_0x7c2c('0x4c')]['fn']('IF',db[_0x7c2c('0x4c')]['literal'](_0x7c2c('0x4d')))),_0x7c2c('0x4e')],[db['sequelize']['fn'](_0x7c2c('0x4f'),db[_0x7c2c('0x4c')]['fn']('IF',db['sequelize'][_0x7c2c('0x50')](_0x7c2c('0x51')))),_0x7c2c('0x52')],[db['sequelize']['fn'](_0x7c2c('0x4f'),db['sequelize']['fn']('IF',db[_0x7c2c('0x4c')][_0x7c2c('0x50')]('`state`\x20=\x205,\x201,\x20null'))),_0x7c2c('0x53')],[db[_0x7c2c('0x4c')]['fn'](_0x7c2c('0x4f'),db[_0x7c2c('0x4c')]['fn']('IF',db['sequelize'][_0x7c2c('0x50')](_0x7c2c('0x54')))),'congestionContacts'],[db[_0x7c2c('0x4c')]['fn']('COUNT',db[_0x7c2c('0x4c')]['fn']('IF',db[_0x7c2c('0x4c')][_0x7c2c('0x50')](_0x7c2c('0x55')))),_0x7c2c('0x56')],[db['sequelize']['fn'](_0x7c2c('0x4f'),db[_0x7c2c('0x4c')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x7c2c('0x57')],[db['sequelize']['fn'](_0x7c2c('0x4f'),db['sequelize']['fn']('IF',db[_0x7c2c('0x4c')][_0x7c2c('0x50')](_0x7c2c('0x58')))),_0x7c2c('0x59')],[db[_0x7c2c('0x4c')]['fn'](_0x7c2c('0x4f'),db[_0x7c2c('0x4c')]['fn']('IF',db[_0x7c2c('0x4c')]['literal']('`state`\x20=\x2019,\x201,\x20null'))),'answeringMachine']]})[_0x7c2c('0x26')](handleEntityNotFound(_0xfba6a7,null))[_0x7c2c('0x26')](respondWithResult(_0xfba6a7,null))[_0x7c2c('0x45')](handleError(_0xfba6a7,null));};exports[_0x7c2c('0x5a')]=function(_0x44602a,_0x1ad537,_0x2d04da){return db[_0x7c2c('0x2c')]['findAll']({'raw':![],'where':{'CampaignId':_0x44602a['params']['id']},'attributes':[[db[_0x7c2c('0x4c')]['fn'](_0x7c2c('0x4f'),db['sequelize']['fn']('IF',db[_0x7c2c('0x4c')]['literal']('`state`\x20=\x200,\x201,\x20null'))),_0x7c2c('0x4e')],[db[_0x7c2c('0x4c')]['fn'](_0x7c2c('0x4f'),db[_0x7c2c('0x4c')]['fn']('IF',db[_0x7c2c('0x4c')][_0x7c2c('0x50')](_0x7c2c('0x51')))),_0x7c2c('0x52')],[db[_0x7c2c('0x4c')]['fn'](_0x7c2c('0x4f'),db[_0x7c2c('0x4c')]['fn']('IF',db[_0x7c2c('0x4c')][_0x7c2c('0x50')](_0x7c2c('0x5b')))),'busyContacts'],[db[_0x7c2c('0x4c')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x7c2c('0x54')))),_0x7c2c('0x5c')],[db[_0x7c2c('0x4c')]['fn'](_0x7c2c('0x4f'),db[_0x7c2c('0x4c')]['fn']('IF',db[_0x7c2c('0x4c')]['literal'](_0x7c2c('0x55')))),_0x7c2c('0x56')],[db[_0x7c2c('0x4c')]['fn'](_0x7c2c('0x4f'),db[_0x7c2c('0x4c')]['fn']('IF',db[_0x7c2c('0x4c')]['literal'](_0x7c2c('0x5d')))),_0x7c2c('0x57')],[db['sequelize']['fn'](_0x7c2c('0x4f'),db[_0x7c2c('0x4c')]['fn']('IF',db['sequelize'][_0x7c2c('0x50')](_0x7c2c('0x58')))),'reCallContacts'],[db['sequelize']['fn'](_0x7c2c('0x4f'),db['sequelize']['fn']('IF',db[_0x7c2c('0x4c')]['literal'](_0x7c2c('0x5e')))),_0x7c2c('0x5f')]]})['then'](handleEntityNotFound(_0x1ad537,null))[_0x7c2c('0x26')](respondWithResult(_0x1ad537,null))['catch'](handleError(_0x1ad537,null));};exports[_0x7c2c('0x60')]=function(_0x2b597d,_0x20eb63,_0x56f737){return db[_0x7c2c('0x61')][_0x7c2c('0x47')]({'where':{'id':_0x2b597d[_0x7c2c('0x49')]['id']}})[_0x7c2c('0x26')](handleEntityNotFound(_0x20eb63,null))['then'](function(_0x158352){var _0x1e711e;if(_0x158352){_0x1e711e=squel[_0x7c2c('0x62')]()[_0x7c2c('0x63')](_0x7c2c('0x64'))[_0x7c2c('0x65')]([_0x7c2c('0x66'),_0x7c2c('0x67'),_0x7c2c('0x68'),'ListId',_0x7c2c('0x69'),_0x7c2c('0x6a'),'updatedAt'],squel[_0x7c2c('0x6b')]()['field']('ANY_VALUE(calleridnum)',_0x7c2c('0x66'))[_0x7c2c('0x6c')](_0x7c2c('0x6d'),'scheduledAt')[_0x7c2c('0x6c')](_0x7c2c('0x6e'),_0x7c2c('0x68'))['field'](_0x7c2c('0x6f'),_0x7c2c('0x70'))[_0x7c2c('0x6c')](_0x7c2c('0x71'),'VoiceQueueId')[_0x7c2c('0x6c')]('NOW()',_0x7c2c('0x6a'))['field'](_0x7c2c('0x6d'),_0x7c2c('0x72'))[_0x7c2c('0x73')](_0x7c2c('0x74'))[_0x7c2c('0x3d')](_0x7c2c('0x75'),_0x2b597d[_0x7c2c('0x49')]['id']['toString']())[_0x7c2c('0x3d')](_0x7c2c('0x76'),_0x2b597d[_0x7c2c('0x4a')][_0x7c2c('0x77')][_0x7c2c('0x78')]())[_0x7c2c('0x3d')](_0x7c2c('0x79'))[_0x7c2c('0x3d')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x7c2c('0x6b')]()[_0x7c2c('0x6c')](_0x7c2c('0x66'))[_0x7c2c('0x73')](_0x7c2c('0x64'))['where'](_0x7c2c('0x75'),_0x2b597d[_0x7c2c('0x49')]['id']['toString']()))[_0x7c2c('0x3d')](_0x7c2c('0x7a'),squel['select']()[_0x7c2c('0x6c')]('calleridnum')[_0x7c2c('0x73')](_0x7c2c('0x74'))[_0x7c2c('0x3d')](_0x7c2c('0x75'),_0x2b597d[_0x7c2c('0x49')]['id'][_0x7c2c('0x78')]())[_0x7c2c('0x3d')]('state\x20=\x204'))[_0x7c2c('0x7b')](_0x7c2c('0x68')))['toString']();return db[_0x7c2c('0x4c')][_0x7c2c('0x32')](_0x1e711e);}return[];})[_0x7c2c('0x26')](respondWithResult(_0x20eb63,null))[_0x7c2c('0x45')](handleError(_0x20eb63,null));};exports[_0x7c2c('0x7c')]=function(_0x2f249d,_0x136226,_0x354236){return db[_0x7c2c('0x7d')][_0x7c2c('0x47')]({'where':{'id':_0x2f249d[_0x7c2c('0x49')]['id']}})[_0x7c2c('0x26')](handleEntityNotFound(_0x136226,null))[_0x7c2c('0x26')](function(_0xb47bf0){var _0x4d0922;if(_0xb47bf0){_0x4d0922=squel[_0x7c2c('0x62')]()[_0x7c2c('0x63')]('cm_hopper')[_0x7c2c('0x65')]([_0x7c2c('0x66'),_0x7c2c('0x67'),_0x7c2c('0x68'),_0x7c2c('0x70'),'CampaignId',_0x7c2c('0x6a'),_0x7c2c('0x72')],squel[_0x7c2c('0x6b')]()['field'](_0x7c2c('0x7e'),_0x7c2c('0x66'))[_0x7c2c('0x6c')]('NOW()',_0x7c2c('0x67'))['field'](_0x7c2c('0x6e'),'ContactId')['field'](_0x7c2c('0x6f'),_0x7c2c('0x70'))[_0x7c2c('0x6c')]('ANY_VALUE(CampaignId)',_0x7c2c('0x7f'))[_0x7c2c('0x6c')](_0x7c2c('0x6d'),_0x7c2c('0x6a'))['field'](_0x7c2c('0x6d'),'updatedAt')['from']('cm_hopper_final')['where']('CampaignId\x20=\x20?',_0x2f249d[_0x7c2c('0x49')]['id'][_0x7c2c('0x78')]())[_0x7c2c('0x3d')](_0x7c2c('0x76'),_0x2f249d[_0x7c2c('0x4a')]['state'][_0x7c2c('0x78')]())[_0x7c2c('0x3d')](_0x7c2c('0x79'))[_0x7c2c('0x3d')](_0x7c2c('0x7a'),squel[_0x7c2c('0x6b')]()['field']('phone')[_0x7c2c('0x73')](_0x7c2c('0x64'))[_0x7c2c('0x3d')](_0x7c2c('0x80'),_0x2f249d['params']['id'][_0x7c2c('0x78')]()))[_0x7c2c('0x3d')](_0x7c2c('0x7a'),squel[_0x7c2c('0x6b')]()[_0x7c2c('0x6c')](_0x7c2c('0x81'))[_0x7c2c('0x73')](_0x7c2c('0x74'))[_0x7c2c('0x3d')]('CampaignId\x20=\x20?',_0x2f249d[_0x7c2c('0x49')]['id'][_0x7c2c('0x78')]())['where'](_0x7c2c('0x82')))['group'](_0x7c2c('0x68')))['toString']();return db[_0x7c2c('0x4c')][_0x7c2c('0x32')](_0x4d0922);}return[];})[_0x7c2c('0x26')](respondWithResult(_0x136226,null))[_0x7c2c('0x45')](handleError(_0x136226,null));};exports[_0x7c2c('0x83')]=function(_0x309051,_0x3f8683,_0x1eeb00){return db[_0x7c2c('0x84')]['findOne']({'where':{'VoiceQueueId':_0x309051[_0x7c2c('0x4a')][_0x7c2c('0x69')],'CampaignId':_0x309051[_0x7c2c('0x4a')]['CampaignId'],'ContactId':_0x309051[_0x7c2c('0x4a')][_0x7c2c('0x68')]}})['then'](handleEntityNotFound(_0x3f8683,null))[_0x7c2c('0x26')](function(_0x511158){if(_0x511158){return _0x511158;}return null;})[_0x7c2c('0x26')](respondWithResult(_0x3f8683,null))['catch'](handleError(_0x3f8683,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 9eb7c32..1af3b7f 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 _0x0211=['lodash','util','../../config/logger','api','bluebird','request-promise','../../config/environment','exports','define','CmHopperFinal','calleridnum','uniqueid'];(function(_0x5b4deb,_0x11a5eb){var _0xf26cfe=function(_0xc4e86d){while(--_0xc4e86d){_0x5b4deb['push'](_0x5b4deb['shift']());}};_0xf26cfe(++_0x11a5eb);}(_0x0211,0x144));var _0x1021=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x0211[_0x4c12ec];return _0x3ae42c;};'use strict';var _=require(_0x1021('0x0'));var util=require(_0x1021('0x1'));var logger=require(_0x1021('0x2'))(_0x1021('0x3'));var moment=require('moment');var BPromise=require(_0x1021('0x4'));var rp=require(_0x1021('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1021('0x6'));var attributes=require('./cmHopperFinal.attributes');module[_0x1021('0x7')]=function(_0x50c530,_0x546a63){return _0x50c530[_0x1021('0x8')](_0x1021('0x9'),attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':_0x1021('0xa'),'fields':[_0x1021('0xa')]},{'name':'uniqueid','fields':[_0x1021('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe673=['cm_hopper_final','uniqueid','lodash','../../config/logger','api','bluebird','request-promise','path','../../config/environment','CmHopperFinal'];(function(_0x2c40bf,_0x5ce37a){var _0x31ab19=function(_0x56303){while(--_0x56303){_0x2c40bf['push'](_0x2c40bf['shift']());}};_0x31ab19(++_0x5ce37a);}(_0xe673,0xde));var _0x3e67=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xe673[_0x465a0c];return _0x1e202e;};'use strict';var _=require(_0x3e67('0x0'));var util=require('util');var logger=require(_0x3e67('0x1'))(_0x3e67('0x2'));var moment=require('moment');var BPromise=require(_0x3e67('0x3'));var rp=require(_0x3e67('0x4'));var fs=require('fs');var path=require(_0x3e67('0x5'));var rimraf=require('rimraf');var config=require(_0x3e67('0x6'));var attributes=require('./cmHopperFinal.attributes');module['exports']=function(_0x19eaaa,_0x451b56){return _0x19eaaa['define'](_0x3e67('0x7'),attributes,{'tableName':_0x3e67('0x8'),'paranoid':![],'indexes':[{'name':'calleridnum','fields':['calleridnum']},{'name':_0x3e67('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index a6d6e2f..66682d0 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.rpc.js +++ b/server/api/cmHopperFinal/cmHopperFinal.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x4f062d,_0x1b05e2){var _0x4b42ee=function(_0x4da45b){while(--_0x4da45b){_0x4f062d['push'](_0x4f062d['shift']());}};_0x4b42ee(++_0x1b05e2);}(_0xb10b,0x12a));var _0xbb10=function(_0x3db750,_0x5d66c2){_0x3db750=_0x3db750-0x0;var _0x5427a=_0xb10b[_0x3db750];return _0x5427a;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x1949d8,_0x5d0b7b){var _0xc074a3=function(_0x7de84d){while(--_0x7de84d){_0x1949d8['push'](_0x1949d8['shift']());}};_0xc074a3(++_0x5d0b7b);}(_0x7a54,0x106));var _0x47a5=function(_0x2629ea,_0x5659a2){_0x2629ea=_0x2629ea-0x0;var _0x1943bc=_0x7a54[_0x2629ea];return _0x1943bc;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index 5bb918c..2c7ac2c 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 _0xffaf=['/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','update','exports','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','get','/describe','describe','/:id','isAuthenticated','show'];(function(_0x31815d,_0x2ddaab){var _0x5c1f8d=function(_0x4701ce){while(--_0x4701ce){_0x31815d['push'](_0x31815d['shift']());}};_0x5c1f8d(++_0x2ddaab);}(_0xffaf,0x1c3));var _0xfffa=function(_0x53f0db,_0x35c67c){_0x53f0db=_0x53f0db-0x0;var _0xae0a5c=_0xffaf[_0x53f0db];return _0xae0a5c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xfffa('0x0'));var timeout=require(_0xfffa('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xfffa('0x2'));var auth=require(_0xfffa('0x3'));var interaction=require(_0xfffa('0x4'));var config=require('../../config/environment');var controller=require('./cmHopperFinal.controller');router[_0xfffa('0x5')]('/',auth['isAuthenticated'](),controller['index']);router[_0xfffa('0x5')](_0xfffa('0x6'),auth['isAuthenticated'](),controller[_0xfffa('0x7')]);router[_0xfffa('0x5')](_0xfffa('0x8'),auth[_0xfffa('0x9')](),controller[_0xfffa('0xa')]);router[_0xfffa('0x5')](_0xfffa('0xb'),auth[_0xfffa('0x9')](),controller[_0xfffa('0xc')]);router[_0xfffa('0x5')](_0xfffa('0xd'),auth[_0xfffa('0x9')](),controller['countContactsIvrCampaignHopperFinal']);router[_0xfffa('0xe')](_0xfffa('0xf'),auth[_0xfffa('0x9')](),controller[_0xfffa('0x10')]);router[_0xfffa('0xe')]('/voice/campaign/moveContacts/:id',auth[_0xfffa('0x9')](),controller[_0xfffa('0x11')]);router[_0xfffa('0xe')](_0xfffa('0x12'),auth[_0xfffa('0x9')](),controller[_0xfffa('0x13')]);router['put'](_0xfffa('0x8'),auth[_0xfffa('0x9')](),controller[_0xfffa('0x14')]);module[_0xfffa('0x15')]=router; \ No newline at end of file +var _0xb6bd=['update','exports','multer','express','Router','fs-extra','../../components/interaction/service','./cmHopperFinal.controller','get','/:id','isAuthenticated','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','put'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xb6bd,0xd4));var _0xdb6b=function(_0x330d37,_0x211eb1){_0x330d37=_0x330d37-0x0;var _0x5d672a=_0xb6bd[_0x330d37];return _0x5d672a;};'use strict';var multer=require(_0xdb6b('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xdb6b('0x1'));var router=express[_0xdb6b('0x2')]();var fs_extra=require(_0xdb6b('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xdb6b('0x4'));var config=require('../../config/environment');var controller=require(_0xdb6b('0x5'));router[_0xdb6b('0x6')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xdb6b('0x6')](_0xdb6b('0x7'),auth[_0xdb6b('0x8')](),controller['show']);router[_0xdb6b('0x6')](_0xdb6b('0x9'),auth[_0xdb6b('0x8')](),controller[_0xdb6b('0xa')]);router['get'](_0xdb6b('0xb'),auth[_0xdb6b('0x8')](),controller[_0xdb6b('0xc')]);router[_0xdb6b('0xd')](_0xdb6b('0xe'),auth[_0xdb6b('0x8')](),controller['moveContactsQueueCampaignHopperFinal']);router[_0xdb6b('0xd')](_0xdb6b('0xf'),auth[_0xdb6b('0x8')](),controller[_0xdb6b('0x10')]);router[_0xdb6b('0xd')](_0xdb6b('0x11'),auth[_0xdb6b('0x8')](),controller['checkContactHopper']);router[_0xdb6b('0x12')](_0xdb6b('0x7'),auth[_0xdb6b('0x8')](),controller[_0xdb6b('0x13')]);module[_0xdb6b('0x14')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 6bcd7f0..45b7fdf 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 _0xa23e=['INTEGER','STRING','DATE','BOOLEAN','sequelize','exports'];(function(_0x5c47ef,_0x29ccf8){var _0x29ffc1=function(_0x470370){while(--_0x470370){_0x5c47ef['push'](_0x5c47ef['shift']());}};_0x29ffc1(++_0x29ccf8);}(_0xa23e,0x1f0));var _0xea23=function(_0x3f1417,_0x1d389d){_0x3f1417=_0x3f1417-0x0;var _0x11eb77=_0xa23e[_0x3f1417];return _0x11eb77;};'use strict';var Sequelize=require(_0xea23('0x0'));module[_0xea23('0x1')]={'state':{'type':Sequelize[_0xea23('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xea23('0x3')]},'scheduledat':{'type':Sequelize[_0xea23('0x4')]},'countbusyretry':{'type':Sequelize[_0xea23('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xea23('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xea23('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xea23('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0xea23('0x3')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xea23('0x3')]},'calleridname':{'type':Sequelize[_0xea23('0x3')]},'starttime':{'type':Sequelize[_0xea23('0x4')]},'responsetime':{'type':Sequelize[_0xea23('0x4')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0xea23('0x4')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xea23('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xea23('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xea23('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0xea23('0x3')]},'campaigntype':{'type':Sequelize[_0xea23('0x3')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0xea23('0x3')]},'amd':{'type':Sequelize[_0xea23('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0xea23('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0xea23('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xea23('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xea23('0x4')]},'recallme':{'type':Sequelize[_0xea23('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xea23('0x4')]},'edited':{'type':Sequelize[_0xea23('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xea23('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xea23('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xea23('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xea23('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xea23('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xb176=['DATE','BOOLEAN','sequelize','INTEGER','STRING'];(function(_0xb1ae1c,_0x255b19){var _0x14642f=function(_0x181569){while(--_0x181569){_0xb1ae1c['push'](_0xb1ae1c['shift']());}};_0x14642f(++_0x255b19);}(_0xb176,0x66));var _0x6b17=function(_0x3645cc,_0x25ba47){_0x3645cc=_0x3645cc-0x0;var _0x351979=_0xb176[_0x3645cc];return _0x351979;};'use strict';var Sequelize=require(_0x6b17('0x0'));module['exports']={'state':{'type':Sequelize[_0x6b17('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x6b17('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x6b17('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x6b17('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x6b17('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0x6b17('0x2')]},'originatecalleridname':{'type':Sequelize[_0x6b17('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x6b17('0x2')]},'starttime':{'type':Sequelize[_0x6b17('0x3')]},'responsetime':{'type':Sequelize[_0x6b17('0x3')]},'answertime':{'type':Sequelize[_0x6b17('0x3')]},'droptime':{'type':Sequelize[_0x6b17('0x3')]},'endtime':{'type':Sequelize[_0x6b17('0x3')]},'ringtime':{'type':Sequelize[_0x6b17('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x6b17('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x6b17('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x6b17('0x2')]},'campaign':{'type':Sequelize[_0x6b17('0x2')]},'campaigntype':{'type':Sequelize[_0x6b17('0x2')]},'membername':{'type':Sequelize[_0x6b17('0x2')]},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize[_0x6b17('0x4')],'defaultValue':![]},'fax':{'type':Sequelize[_0x6b17('0x4')],'defaultValue':![]},'callback':{'type':Sequelize[_0x6b17('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x6b17('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x6b17('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize[_0x6b17('0x4')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x6b17('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x6b17('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 8fd6d9a..9c4c47a 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 _0x8f96=['intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','params','rawAttributes','find','catch','create','describe','body','uniqueid','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','error','stack','name','send','index','map','CmHopperHistory','key','query'];(function(_0x1313ef,_0x41cea1){var _0x42a5a7=function(_0x592793){while(--_0x592793){_0x1313ef['push'](_0x1313ef['shift']());}};_0x42a5a7(++_0x41cea1);}(_0x8f96,0x1e4));var _0x68f9=function(_0x32216e,_0x50b867){_0x32216e=_0x32216e-0x0;var _0x4e7d71=_0x8f96[_0x32216e];return _0x4e7d71;};'use strict';var emlformat=require(_0x68f9('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x68f9('0x1'));var rp=require(_0x68f9('0x2'));var moment=require(_0x68f9('0x3'));var BPromise=require(_0x68f9('0x4'));var Mustache=require('mustache');var util=require(_0x68f9('0x5'));var path=require(_0x68f9('0x6'));var sox=require(_0x68f9('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x68f9('0x8'));var _=require(_0x68f9('0x9'));var squel=require(_0x68f9('0xa'));var crypto=require(_0x68f9('0xb'));var jsforce=require(_0x68f9('0xc'));var deskjs=require(_0x68f9('0xd'));var toCsv=require(_0x68f9('0xe'));var querystring=require('querystring');var Papa=require(_0x68f9('0xf'));var Redis=require(_0x68f9('0x10'));var authService=require(_0x68f9('0x11'));var qs=require(_0x68f9('0x12'));var as=require(_0x68f9('0x13'));var hardwareService=require(_0x68f9('0x14'));var logger=require(_0x68f9('0x15'))('api');var utils=require(_0x68f9('0x16'));var config=require(_0x68f9('0x17'));var licenseUtil=require(_0x68f9('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d2703,_0x31ed78){_0x31ed78=_0x31ed78||0xcc;return function(_0x2716ed){if(_0x2716ed){return _0x3d2703[_0x68f9('0x19')](_0x31ed78);}return _0x3d2703[_0x68f9('0x1a')](_0x31ed78)[_0x68f9('0x1b')]();};}function respondWithResult(_0x29f97a,_0x1c48da){_0x1c48da=_0x1c48da||0xc8;return function(_0x52a958){if(_0x52a958){return _0x29f97a[_0x68f9('0x1a')](_0x1c48da)[_0x68f9('0x1c')](_0x52a958);}};}function respondWithFilteredResult(_0x4d50a0,_0x3f9fd9){return function(_0x385a21){if(_0x385a21){var _0x10f903=typeof _0x3f9fd9['offset']===_0x68f9('0x1d')&&typeof _0x3f9fd9[_0x68f9('0x1e')]===_0x68f9('0x1d');var _0x423466=_0x385a21[_0x68f9('0x1f')];var _0x3b650c=_0x10f903?0x0:_0x3f9fd9[_0x68f9('0x20')];var _0x5c5254=_0x10f903?_0x385a21[_0x68f9('0x1f')]:_0x3f9fd9[_0x68f9('0x20')]+_0x3f9fd9[_0x68f9('0x1e')];var _0x1eebbb;if(_0x5c5254>=_0x423466){_0x5c5254=_0x423466;_0x1eebbb=0xc8;}else{_0x1eebbb=0xce;}_0x4d50a0[_0x68f9('0x1a')](_0x1eebbb);return _0x4d50a0[_0x68f9('0x21')](_0x68f9('0x22'),_0x3b650c+'-'+_0x5c5254+'/'+_0x423466)[_0x68f9('0x1c')](_0x385a21);}return null;};}function patchUpdates(_0x16779a){return function(_0x33a82e){try{jsonpatch[_0x68f9('0x23')](_0x33a82e,_0x16779a,!![]);}catch(_0x1f423c){return BPromise[_0x68f9('0x24')](_0x1f423c);}return _0x33a82e['save']();};}function saveUpdates(_0x2460a4,_0x2a1ca0){return function(_0x3a3dd0){if(_0x3a3dd0){return _0x3a3dd0[_0x68f9('0x25')](_0x2460a4)[_0x68f9('0x26')](function(_0x3f6b4c){return _0x3f6b4c;});}return null;};}function removeEntity(_0x1357bd,_0x3fdb8d){return function(_0x10400c){if(_0x10400c){return _0x10400c['destroy']()[_0x68f9('0x26')](function(){_0x1357bd[_0x68f9('0x1a')](0xcc)[_0x68f9('0x1b')]();});}};}function handleEntityNotFound(_0x5f08c3,_0x43cd67){return function(_0x5bea35){if(!_0x5bea35){_0x5f08c3[_0x68f9('0x19')](0x194);}return _0x5bea35;};}function handleError(_0x1efc0c,_0x17e104){_0x17e104=_0x17e104||0x1f4;return function(_0x1391c4){logger[_0x68f9('0x27')](_0x1391c4[_0x68f9('0x28')]);if(_0x1391c4[_0x68f9('0x29')]){delete _0x1391c4[_0x68f9('0x29')];}_0x1efc0c[_0x68f9('0x1a')](_0x17e104)[_0x68f9('0x2a')](_0x1391c4);};}exports[_0x68f9('0x2b')]=function(_0x3f041f,_0x5582ea){var _0x226dc7={},_0x47d660={},_0x19d5f7={'count':0x0,'rows':[]};var _0x45d469=_[_0x68f9('0x2c')](db[_0x68f9('0x2d')]['rawAttributes'],function(_0x2d3a00){return{'name':_0x2d3a00['fieldName'],'type':_0x2d3a00['type'][_0x68f9('0x2e')]};});_0x47d660['model']=_[_0x68f9('0x2c')](_0x45d469,_0x68f9('0x29'));_0x47d660[_0x68f9('0x2f')]=_['keys'](_0x3f041f[_0x68f9('0x2f')]);_0x47d660['filters']=_[_0x68f9('0x30')](_0x47d660[_0x68f9('0x31')],_0x47d660[_0x68f9('0x2f')]);_0x226dc7[_0x68f9('0x32')]=_[_0x68f9('0x30')](_0x47d660[_0x68f9('0x31')],qs[_0x68f9('0x33')](_0x3f041f['query'][_0x68f9('0x33')]));_0x226dc7[_0x68f9('0x32')]=_0x226dc7[_0x68f9('0x32')][_0x68f9('0x34')]?_0x226dc7[_0x68f9('0x32')]:_0x47d660[_0x68f9('0x31')];if(!_0x3f041f['query'][_0x68f9('0x35')](_0x68f9('0x36'))){_0x226dc7[_0x68f9('0x1e')]=qs[_0x68f9('0x1e')](_0x3f041f[_0x68f9('0x2f')]['limit']);_0x226dc7[_0x68f9('0x20')]=qs[_0x68f9('0x20')](_0x3f041f[_0x68f9('0x2f')][_0x68f9('0x20')]);}_0x226dc7[_0x68f9('0x37')]=qs[_0x68f9('0x38')](_0x3f041f['query']['sort']);_0x226dc7[_0x68f9('0x39')]=qs[_0x68f9('0x3a')](_['pick'](_0x3f041f['query'],_0x47d660[_0x68f9('0x3a')]),_0x45d469);if(_0x3f041f['query'][_0x68f9('0x3b')]){_0x226dc7['where']=_['merge'](_0x226dc7[_0x68f9('0x39')],{'$or':_[_0x68f9('0x2c')](_0x45d469,function(_0x2f50c9){if(_0x2f50c9[_0x68f9('0x3c')]!==_0x68f9('0x3d')){var _0x468078={};_0x468078[_0x2f50c9[_0x68f9('0x29')]]={'$like':'%'+_0x3f041f[_0x68f9('0x2f')]['filter']+'%'};return _0x468078;}})});}_0x226dc7=_[_0x68f9('0x3e')]({},_0x226dc7,_0x3f041f[_0x68f9('0x3f')]);var _0x22b1ee={'where':_0x226dc7[_0x68f9('0x39')]};return db['CmHopperHistory'][_0x68f9('0x1f')](_0x22b1ee)[_0x68f9('0x26')](function(_0x2a0898){_0x19d5f7['count']=_0x2a0898;if(_0x3f041f['query'][_0x68f9('0x40')]){_0x226dc7[_0x68f9('0x41')]=[{'all':!![]}];}return db[_0x68f9('0x2d')][_0x68f9('0x42')](_0x226dc7);})[_0x68f9('0x26')](function(_0x1a4c8b){_0x19d5f7[_0x68f9('0x43')]=_0x1a4c8b;return _0x19d5f7;})[_0x68f9('0x26')](respondWithFilteredResult(_0x5582ea,_0x226dc7))['catch'](handleError(_0x5582ea,null));};exports['show']=function(_0x1253ba,_0xb93db9){var _0x3665fb={'raw':!![],'where':{'id':_0x1253ba[_0x68f9('0x44')]['id']}},_0x58e21b={};_0x58e21b[_0x68f9('0x31')]=_['keys'](db[_0x68f9('0x2d')][_0x68f9('0x45')]);_0x58e21b[_0x68f9('0x2f')]=_['keys'](_0x1253ba[_0x68f9('0x2f')]);_0x58e21b[_0x68f9('0x3a')]=_['intersection'](_0x58e21b[_0x68f9('0x31')],_0x58e21b['query']);_0x3665fb[_0x68f9('0x32')]=_[_0x68f9('0x30')](_0x58e21b[_0x68f9('0x31')],qs[_0x68f9('0x33')](_0x1253ba[_0x68f9('0x2f')][_0x68f9('0x33')]));_0x3665fb[_0x68f9('0x32')]=_0x3665fb['attributes'][_0x68f9('0x34')]?_0x3665fb['attributes']:_0x58e21b['model'];if(_0x1253ba[_0x68f9('0x2f')][_0x68f9('0x40')]){_0x3665fb['include']=[{'all':!![]}];}_0x3665fb=_['merge']({},_0x3665fb,_0x1253ba[_0x68f9('0x3f')]);return db[_0x68f9('0x2d')][_0x68f9('0x46')](_0x3665fb)[_0x68f9('0x26')](handleEntityNotFound(_0xb93db9,null))['then'](respondWithResult(_0xb93db9,null))[_0x68f9('0x47')](handleError(_0xb93db9,null));};exports[_0x68f9('0x48')]=function(_0xefd309,_0x1941ee){return db['CmHopperHistory']['create'](_0xefd309['body'],{})['then'](respondWithResult(_0x1941ee,0xc9))[_0x68f9('0x47')](handleError(_0x1941ee,null));};exports['describe']=function(_0x1e299e,_0x37ba5f){return db[_0x68f9('0x2d')][_0x68f9('0x49')]()['then'](respondWithResult(_0x37ba5f,null))[_0x68f9('0x47')](handleError(_0x37ba5f,null));};exports['update']=function(_0x3fafc7,_0x1472d1){if(_0x3fafc7[_0x68f9('0x4a')][_0x68f9('0x4b')]){delete _0x3fafc7['body'][_0x68f9('0x4b')];}return db['CmHopperHistory']['find']({'where':{'uniqueid':_0x3fafc7[_0x68f9('0x44')]['id']}})[_0x68f9('0x26')](handleEntityNotFound(_0x1472d1,null))[_0x68f9('0x26')](saveUpdates(_0x3fafc7['body'],null))[_0x68f9('0x26')](respondWithResult(_0x1472d1,null))[_0x68f9('0x47')](handleError(_0x1472d1,null));}; \ No newline at end of file +var _0xb984=['order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','describe','update','uniqueid','find','eml-format','rimraf','zip-dir','bluebird','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','save','then','destroy','error','stack','name','send','index','map','CmHopperHistory','fieldName','model','query','filters','intersection','attributes','fields','nolimit'];(function(_0x2234e3,_0x56811a){var _0x5cc0dc=function(_0x454a32){while(--_0x454a32){_0x2234e3['push'](_0x2234e3['shift']());}};_0x5cc0dc(++_0x56811a);}(_0xb984,0x1c1));var _0x4b98=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xb984[_0xf50820];return _0x2a9b10;};'use strict';var emlformat=require(_0x4b98('0x0'));var rimraf=require(_0x4b98('0x1'));var zipdir=require(_0x4b98('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4b98('0x3'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x4b98('0x4'));var ejs=require(_0x4b98('0x5'));var fs=require('fs');var fs_extra=require(_0x4b98('0x6'));var _=require(_0x4b98('0x7'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4b98('0x8'));var deskjs=require(_0x4b98('0x9'));var toCsv=require(_0x4b98('0x4'));var querystring=require(_0x4b98('0xa'));var Papa=require(_0x4b98('0xb'));var Redis=require(_0x4b98('0xc'));var authService=require(_0x4b98('0xd'));var qs=require(_0x4b98('0xe'));var as=require(_0x4b98('0xf'));var hardwareService=require(_0x4b98('0x10'));var logger=require(_0x4b98('0x11'))(_0x4b98('0x12'));var utils=require(_0x4b98('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x4b98('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x9274f0,_0x38b987){_0x38b987=_0x38b987||0xcc;return function(_0x50ac44){if(_0x50ac44){return _0x9274f0[_0x4b98('0x15')](_0x38b987);}return _0x9274f0[_0x4b98('0x16')](_0x38b987)[_0x4b98('0x17')]();};}function respondWithResult(_0x538ca5,_0x5e0a0d){_0x5e0a0d=_0x5e0a0d||0xc8;return function(_0x470aae){if(_0x470aae){return _0x538ca5[_0x4b98('0x16')](_0x5e0a0d)[_0x4b98('0x18')](_0x470aae);}};}function respondWithFilteredResult(_0xcbd54f,_0xbd3566){return function(_0x26f1d3){if(_0x26f1d3){var _0x55403f=typeof _0xbd3566[_0x4b98('0x19')]===_0x4b98('0x1a')&&typeof _0xbd3566[_0x4b98('0x1b')]==='undefined';var _0x1e3398=_0x26f1d3[_0x4b98('0x1c')];var _0x236d30=_0x55403f?0x0:_0xbd3566['offset'];var _0x40cd8b=_0x55403f?_0x26f1d3[_0x4b98('0x1c')]:_0xbd3566[_0x4b98('0x19')]+_0xbd3566[_0x4b98('0x1b')];var _0x258f53;if(_0x40cd8b>=_0x1e3398){_0x40cd8b=_0x1e3398;_0x258f53=0xc8;}else{_0x258f53=0xce;}_0xcbd54f[_0x4b98('0x16')](_0x258f53);return _0xcbd54f['set'](_0x4b98('0x1d'),_0x236d30+'-'+_0x40cd8b+'/'+_0x1e3398)['json'](_0x26f1d3);}return null;};}function patchUpdates(_0x63f3a3){return function(_0x3bc38e){try{jsonpatch['apply'](_0x3bc38e,_0x63f3a3,!![]);}catch(_0x3d6277){return BPromise['reject'](_0x3d6277);}return _0x3bc38e[_0x4b98('0x1e')]();};}function saveUpdates(_0x4d43d6,_0x2f6e76){return function(_0x100126){if(_0x100126){return _0x100126['update'](_0x4d43d6)[_0x4b98('0x1f')](function(_0x3cf6a3){return _0x3cf6a3;});}return null;};}function removeEntity(_0x1d0c8f,_0x270f01){return function(_0x1a6dfa){if(_0x1a6dfa){return _0x1a6dfa[_0x4b98('0x20')]()[_0x4b98('0x1f')](function(){_0x1d0c8f['status'](0xcc)[_0x4b98('0x17')]();});}};}function handleEntityNotFound(_0x3931fd,_0x49110b){return function(_0x4af37d){if(!_0x4af37d){_0x3931fd[_0x4b98('0x15')](0x194);}return _0x4af37d;};}function handleError(_0x36cba5,_0x3adbb5){_0x3adbb5=_0x3adbb5||0x1f4;return function(_0x4fcd0a){logger[_0x4b98('0x21')](_0x4fcd0a[_0x4b98('0x22')]);if(_0x4fcd0a[_0x4b98('0x23')]){delete _0x4fcd0a['name'];}_0x36cba5['status'](_0x3adbb5)[_0x4b98('0x24')](_0x4fcd0a);};}exports[_0x4b98('0x25')]=function(_0x494d3f,_0x3b96c5){var _0x231862={},_0x64852e={},_0x54cc05={'count':0x0,'rows':[]};var _0x5d2330=_[_0x4b98('0x26')](db[_0x4b98('0x27')]['rawAttributes'],function(_0x28070c){return{'name':_0x28070c[_0x4b98('0x28')],'type':_0x28070c['type']['key']};});_0x64852e[_0x4b98('0x29')]=_[_0x4b98('0x26')](_0x5d2330,_0x4b98('0x23'));_0x64852e[_0x4b98('0x2a')]=_['keys'](_0x494d3f['query']);_0x64852e[_0x4b98('0x2b')]=_[_0x4b98('0x2c')](_0x64852e[_0x4b98('0x29')],_0x64852e['query']);_0x231862[_0x4b98('0x2d')]=_[_0x4b98('0x2c')](_0x64852e[_0x4b98('0x29')],qs[_0x4b98('0x2e')](_0x494d3f[_0x4b98('0x2a')][_0x4b98('0x2e')]));_0x231862[_0x4b98('0x2d')]=_0x231862['attributes']['length']?_0x231862[_0x4b98('0x2d')]:_0x64852e[_0x4b98('0x29')];if(!_0x494d3f[_0x4b98('0x2a')]['hasOwnProperty'](_0x4b98('0x2f'))){_0x231862[_0x4b98('0x1b')]=qs[_0x4b98('0x1b')](_0x494d3f[_0x4b98('0x2a')]['limit']);_0x231862[_0x4b98('0x19')]=qs[_0x4b98('0x19')](_0x494d3f[_0x4b98('0x2a')]['offset']);}_0x231862[_0x4b98('0x30')]=qs[_0x4b98('0x31')](_0x494d3f[_0x4b98('0x2a')][_0x4b98('0x31')]);_0x231862[_0x4b98('0x32')]=qs[_0x4b98('0x2b')](_[_0x4b98('0x33')](_0x494d3f[_0x4b98('0x2a')],_0x64852e['filters']),_0x5d2330);if(_0x494d3f[_0x4b98('0x2a')][_0x4b98('0x34')]){_0x231862[_0x4b98('0x32')]=_['merge'](_0x231862[_0x4b98('0x32')],{'$or':_[_0x4b98('0x26')](_0x5d2330,function(_0x59c765){if(_0x59c765[_0x4b98('0x35')]!==_0x4b98('0x36')){var _0x52bd34={};_0x52bd34[_0x59c765[_0x4b98('0x23')]]={'$like':'%'+_0x494d3f['query'][_0x4b98('0x34')]+'%'};return _0x52bd34;}})});}_0x231862=_[_0x4b98('0x37')]({},_0x231862,_0x494d3f[_0x4b98('0x38')]);var _0xd78a47={'where':_0x231862['where']};return db[_0x4b98('0x27')]['count'](_0xd78a47)[_0x4b98('0x1f')](function(_0x12415f){_0x54cc05['count']=_0x12415f;if(_0x494d3f[_0x4b98('0x2a')][_0x4b98('0x39')]){_0x231862[_0x4b98('0x3a')]=[{'all':!![]}];}return db[_0x4b98('0x27')][_0x4b98('0x3b')](_0x231862);})[_0x4b98('0x1f')](function(_0x2be62d){_0x54cc05[_0x4b98('0x3c')]=_0x2be62d;return _0x54cc05;})[_0x4b98('0x1f')](respondWithFilteredResult(_0x3b96c5,_0x231862))[_0x4b98('0x3d')](handleError(_0x3b96c5,null));};exports[_0x4b98('0x3e')]=function(_0x5ca9fb,_0x224985){var _0x5971aa={'raw':!![],'where':{'id':_0x5ca9fb[_0x4b98('0x3f')]['id']}},_0x9a7d03={};_0x9a7d03[_0x4b98('0x29')]=_['keys'](db[_0x4b98('0x27')][_0x4b98('0x40')]);_0x9a7d03['query']=_['keys'](_0x5ca9fb[_0x4b98('0x2a')]);_0x9a7d03[_0x4b98('0x2b')]=_[_0x4b98('0x2c')](_0x9a7d03[_0x4b98('0x29')],_0x9a7d03[_0x4b98('0x2a')]);_0x5971aa['attributes']=_['intersection'](_0x9a7d03[_0x4b98('0x29')],qs[_0x4b98('0x2e')](_0x5ca9fb[_0x4b98('0x2a')][_0x4b98('0x2e')]));_0x5971aa[_0x4b98('0x2d')]=_0x5971aa['attributes']['length']?_0x5971aa['attributes']:_0x9a7d03[_0x4b98('0x29')];if(_0x5ca9fb['query'][_0x4b98('0x39')]){_0x5971aa[_0x4b98('0x3a')]=[{'all':!![]}];}_0x5971aa=_[_0x4b98('0x37')]({},_0x5971aa,_0x5ca9fb['options']);return db['CmHopperHistory']['find'](_0x5971aa)[_0x4b98('0x1f')](handleEntityNotFound(_0x224985,null))[_0x4b98('0x1f')](respondWithResult(_0x224985,null))['catch'](handleError(_0x224985,null));};exports['create']=function(_0x59db8c,_0x4199b4){return db['CmHopperHistory'][_0x4b98('0x41')](_0x59db8c[_0x4b98('0x42')],{})[_0x4b98('0x1f')](respondWithResult(_0x4199b4,0xc9))[_0x4b98('0x3d')](handleError(_0x4199b4,null));};exports['describe']=function(_0x6ef8f8,_0xfd4a0a){return db[_0x4b98('0x27')][_0x4b98('0x43')]()[_0x4b98('0x1f')](respondWithResult(_0xfd4a0a,null))[_0x4b98('0x3d')](handleError(_0xfd4a0a,null));};exports[_0x4b98('0x44')]=function(_0xa2b3e1,_0x2e6ca9){if(_0xa2b3e1['body'][_0x4b98('0x45')]){delete _0xa2b3e1[_0x4b98('0x42')][_0x4b98('0x45')];}return db['CmHopperHistory'][_0x4b98('0x46')]({'where':{'uniqueid':_0xa2b3e1[_0x4b98('0x3f')]['id']}})[_0x4b98('0x1f')](handleEntityNotFound(_0x2e6ca9,null))['then'](saveUpdates(_0xa2b3e1[_0x4b98('0x42')],null))[_0x4b98('0x1f')](respondWithResult(_0x2e6ca9,null))['catch'](handleError(_0x2e6ca9,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 816cf6f..2ab3afc 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 _0x42c3=['bluebird','request-promise','rimraf','./cmHopperHistory.attributes','exports','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util','../../config/logger','moment'];(function(_0x227b0b,_0x32c8aa){var _0x12ed33=function(_0x3ea21f){while(--_0x3ea21f){_0x227b0b['push'](_0x227b0b['shift']());}};_0x12ed33(++_0x32c8aa);}(_0x42c3,0x1bc));var _0x342c=function(_0x4b320d,_0x5b6957){_0x4b320d=_0x4b320d-0x0;var _0x3a15c6=_0x42c3[_0x4b320d];return _0x3a15c6;};'use strict';var _=require(_0x342c('0x0'));var util=require(_0x342c('0x1'));var logger=require(_0x342c('0x2'))('api');var moment=require(_0x342c('0x3'));var BPromise=require(_0x342c('0x4'));var rp=require(_0x342c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x342c('0x6'));var config=require('../../config/environment');var attributes=require(_0x342c('0x7'));module[_0x342c('0x8')]=function(_0x4c7ba3,_0x4edcfe){return _0x4c7ba3[_0x342c('0x9')](_0x342c('0xa'),attributes,{'tableName':_0x342c('0xb'),'paranoid':![],'indexes':[{'name':_0x342c('0xc'),'fields':['endtime']},{'name':_0x342c('0xd'),'fields':[_0x342c('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xffc0=['request-promise','path','rimraf','../../config/environment','exports','cm_hopper_history','endtime','uniqueid','util','api','moment','bluebird'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xffc0,0x1a0));var _0x0ffc=function(_0x5a2e0a,_0x2abcdd){_0x5a2e0a=_0x5a2e0a-0x0;var _0xe7d7eb=_0xffc0[_0x5a2e0a];return _0xe7d7eb;};'use strict';var _=require('lodash');var util=require(_0x0ffc('0x0'));var logger=require('../../config/logger')(_0x0ffc('0x1'));var moment=require(_0x0ffc('0x2'));var BPromise=require(_0x0ffc('0x3'));var rp=require(_0x0ffc('0x4'));var fs=require('fs');var path=require(_0x0ffc('0x5'));var rimraf=require(_0x0ffc('0x6'));var config=require(_0x0ffc('0x7'));var attributes=require('./cmHopperHistory.attributes');module[_0x0ffc('0x8')]=function(_0x23d3e0,_0x426ce2){return _0x23d3e0['define']('CmHopperHistory',attributes,{'tableName':_0x0ffc('0x9'),'paranoid':![],'indexes':[{'name':_0x0ffc('0xa'),'fields':[_0x0ffc('0xa')]},{'name':_0x0ffc('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 3019240..f20360c 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 _0x33a1=['jayson/promise','client','request','then','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','CmHopperHistory,\x20%s,\x20%s','info','CreateCmHopperHistory','create','options','raw','catch','AvgHandleTime','CmHopperHistory','where','sequelize','COUNT','col','predictiveIntervalTotalCalls','literal','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','findAll','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','outboundNoAnswerCallsDay','`state`\x20=\x204,\x201,\x20null','outboundAnswerCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','outboundAnswerAgiCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','campaign','GetCampaignHopperHistory','ivrAnswerCallsDay','lodash','util','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x1f698a,_0x484dec){var _0x50ae17=function(_0x2a1fcb){while(--_0x2a1fcb){_0x1f698a['push'](_0x1f698a['shift']());}};_0x50ae17(++_0x484dec);}(_0x33a1,0x7c));var _0x133a=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x33a1[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x133a('0x0'));var util=require(_0x133a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x133a('0x2'))['db'];var utils=require(_0x133a('0x3'));var logger=require(_0x133a('0x4'))('rpc');var config=require(_0x133a('0x5'));var jayson=require(_0x133a('0x6'));var client=jayson[_0x133a('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x13fe1d,_0x1a6b64,_0x31409d){return new BPromise(function(_0x5f3a8f,_0x37e7cc){return client[_0x133a('0x8')](_0x13fe1d,_0x31409d)[_0x133a('0x9')](function(_0x43974a){logger['info']('CmHopperHistory,\x20%s,\x20%s',_0x1a6b64,'request\x20sent');logger[_0x133a('0xa')](_0x133a('0xb'),_0x1a6b64,_0x133a('0xc'),JSON[_0x133a('0xd')](_0x43974a));if(_0x43974a[_0x133a('0xe')]){if(_0x43974a['error']['code']===0x1f4){logger[_0x133a('0xe')]('CmHopperHistory,\x20%s,\x20%s',_0x1a6b64,_0x43974a['error'][_0x133a('0xf')]);return _0x37e7cc(_0x43974a[_0x133a('0xe')]['message']);}logger[_0x133a('0xe')](_0x133a('0x10'),_0x1a6b64,_0x43974a[_0x133a('0xe')]['message']);return _0x5f3a8f(_0x43974a['error'][_0x133a('0xf')]);}else{logger[_0x133a('0x11')](_0x133a('0x10'),_0x1a6b64,_0x133a('0xc'));_0x5f3a8f(_0x43974a['result']['message']);}})['catch'](function(_0x2f85f1){logger['error'](_0x133a('0x10'),_0x1a6b64,_0x2f85f1);_0x37e7cc(_0x2f85f1);});});}exports[_0x133a('0x12')]=function(_0x4fb80f){var _0xb91a9e=this;return new Promise(function(_0x1489c9,_0x5483dc){return db['CmHopperHistory'][_0x133a('0x13')](_0x4fb80f['body'],{'raw':_0x4fb80f[_0x133a('0x14')]?_0x4fb80f[_0x133a('0x14')][_0x133a('0x15')]===undefined?!![]:![]:!![]})[_0x133a('0x9')](function(_0x86ba96){logger[_0x133a('0x11')]('CreateCmHopperHistory',_0x4fb80f);logger[_0x133a('0xa')](_0x133a('0x12'),_0x4fb80f,JSON[_0x133a('0xd')](_0x86ba96));_0x1489c9(_0x86ba96);})[_0x133a('0x16')](function(_0x122405){logger[_0x133a('0xe')]('CreateCmHopperHistory',_0x122405['message'],_0x4fb80f);_0x5483dc(_0xb91a9e['error'](0x1f4,_0x122405['message']));});});};exports[_0x133a('0x17')]=function(_0x63f401){var _0x1d4035=this;return new Promise(function(_0x49097d,_0x33c486){return db[_0x133a('0x18')]['findAll']({'raw':_0x63f401[_0x133a('0x14')]?_0x63f401[_0x133a('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x63f401[_0x133a('0x14')]?_0x63f401[_0x133a('0x14')][_0x133a('0x19')]||null:null,'attributes':[[db[_0x133a('0x1a')]['fn'](_0x133a('0x1b'),db[_0x133a('0x1a')][_0x133a('0x1c')]('id')),_0x133a('0x1d')],[db[_0x133a('0x1a')]['fn'](_0x133a('0x1b'),db[_0x133a('0x1a')]['fn']('IF',db['sequelize'][_0x133a('0x1e')]('`state`\x20=\x204,\x201,\x20null'))),_0x133a('0x1f')],[db['sequelize']['fn'](_0x133a('0x1b'),db['sequelize']['fn']('IF',db[_0x133a('0x1a')][_0x133a('0x1e')](_0x133a('0x20')))),_0x133a('0x21')],[db[_0x133a('0x1a')]['fn'](_0x133a('0x1b'),db[_0x133a('0x1a')]['fn']('IF',db[_0x133a('0x1a')][_0x133a('0x1e')](_0x133a('0x22')))),_0x133a('0x23')],[db[_0x133a('0x1a')]['fn'](_0x133a('0x24'),db[_0x133a('0x1a')]['fn']('IF',db[_0x133a('0x1a')][_0x133a('0x1e')](_0x133a('0x25')))),_0x133a('0x26')],[db[_0x133a('0x1a')]['fn'](_0x133a('0x24'),db['sequelize']['fn']('IF',db[_0x133a('0x1a')][_0x133a('0x1e')](_0x133a('0x27')))),_0x133a('0x28')]]})['then'](function(_0x7fdbe2){logger[_0x133a('0x11')](_0x133a('0x17'),_0x63f401);logger['debug'](_0x133a('0x17'),_0x63f401,JSON[_0x133a('0xd')](_0x7fdbe2));_0x49097d(_0x7fdbe2);})[_0x133a('0x16')](function(_0x2cb442){logger[_0x133a('0xe')](_0x133a('0x17'),_0x2cb442[_0x133a('0xf')],_0x63f401);_0x33c486(_0x1d4035[_0x133a('0xe')](0x1f4,_0x2cb442[_0x133a('0xf')]));});});};exports[_0x133a('0x29')]=function(_0x4dc487){var _0x48b7f=this;return new Promise(function(_0x2acdee,_0x144f72){return db[_0x133a('0x18')][_0x133a('0x2a')]({'raw':_0x4dc487['options']?_0x4dc487[_0x133a('0x14')][_0x133a('0x15')]===undefined?!![]:![]:!![],'where':_0x4dc487['options']?_0x4dc487[_0x133a('0x14')][_0x133a('0x19')]||null:null,'attributes':[['campaign',_0x133a('0x2b')],[db[_0x133a('0x1a')]['fn'](_0x133a('0x1b'),db['sequelize']['fn']('IF',db[_0x133a('0x1a')][_0x133a('0x1e')](_0x133a('0x2c')))),_0x133a('0x2d')],[db['sequelize']['fn']('COUNT',db[_0x133a('0x1a')]['fn']('IF',db[_0x133a('0x1a')][_0x133a('0x1e')]('`state`\x20=\x203,\x201,\x20null'))),_0x133a('0x2e')],[db['sequelize']['fn']('COUNT',db[_0x133a('0x1a')]['fn']('IF',db[_0x133a('0x1a')][_0x133a('0x1e')](_0x133a('0x2f')))),_0x133a('0x30')],[db[_0x133a('0x1a')]['fn'](_0x133a('0x1b'),db[_0x133a('0x1a')]['fn']('IF',db[_0x133a('0x1a')]['literal']('`state`\x20=\x205,\x201,\x20null'))),'outboundBusyCallsDay'],[db[_0x133a('0x1a')]['fn'](_0x133a('0x1b'),db[_0x133a('0x1a')]['fn']('IF',db[_0x133a('0x1a')][_0x133a('0x1e')](_0x133a('0x31')))),_0x133a('0x32')],[db['sequelize']['fn'](_0x133a('0x1b'),db[_0x133a('0x1a')]['fn']('IF',db[_0x133a('0x1a')]['literal']('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x133a('0x33')],[db['sequelize']['fn'](_0x133a('0x1b'),db[_0x133a('0x1a')]['fn']('IF',db[_0x133a('0x1a')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x133a('0x34')],[db[_0x133a('0x1a')]['fn']('COUNT',db[_0x133a('0x1a')]['fn']('IF',db[_0x133a('0x1a')]['literal']('`state`\x20=\x2012,\x201,\x20null'))),'outboundUnknownCallsDay'],[db[_0x133a('0x1a')]['fn'](_0x133a('0x1b'),db[_0x133a('0x1a')]['fn']('IF',db[_0x133a('0x1a')][_0x133a('0x1e')](_0x133a('0x35')))),_0x133a('0x36')],[db['sequelize']['fn'](_0x133a('0x1b'),db[_0x133a('0x1a')]['fn']('IF',db['sequelize'][_0x133a('0x1e')](_0x133a('0x37')))),_0x133a('0x38')],[db['sequelize']['fn']('COUNT',db[_0x133a('0x1a')]['fn']('IF',db[_0x133a('0x1a')]['literal'](_0x133a('0x39')))),_0x133a('0x3a')],[db[_0x133a('0x1a')]['fn'](_0x133a('0x1b'),db[_0x133a('0x1a')]['fn']('IF',db[_0x133a('0x1a')][_0x133a('0x1e')]('`state`\x20=\x2016,\x201,\x20null'))),_0x133a('0x3b')],[db[_0x133a('0x1a')]['fn'](_0x133a('0x1b'),db[_0x133a('0x1a')]['fn']('IF',db['sequelize'][_0x133a('0x1e')]('`state`\x20=\x2020,\x201,\x20null'))),_0x133a('0x3a')],[db[_0x133a('0x1a')]['fn'](_0x133a('0x1b'),db[_0x133a('0x1a')]['fn']('IF',db[_0x133a('0x1a')][_0x133a('0x1e')](_0x133a('0x3c')))),_0x133a('0x3d')]],'group':[_0x133a('0x3e')]})[_0x133a('0x9')](function(_0x216aad){logger[_0x133a('0x11')](_0x133a('0x29'),_0x4dc487);logger[_0x133a('0xa')](_0x133a('0x29'),_0x4dc487,JSON['stringify'](_0x216aad));_0x2acdee(_0x216aad);})[_0x133a('0x16')](function(_0x5b41ca){logger[_0x133a('0xe')](_0x133a('0x29'),_0x5b41ca[_0x133a('0xf')],_0x4dc487);_0x144f72(_0x48b7f['error'](0x1f4,_0x5b41ca[_0x133a('0xf')]));});});};exports[_0x133a('0x3f')]=function(_0x543fc2){var _0x511128=this;return new Promise(function(_0x2ec856,_0x8d3f01){return db['CmHopperHistory']['findAll']({'raw':_0x543fc2[_0x133a('0x14')]?_0x543fc2[_0x133a('0x14')][_0x133a('0x15')]===undefined?!![]:![]:!![],'where':_0x543fc2['options']?_0x543fc2[_0x133a('0x14')][_0x133a('0x19')]||null:null,'attributes':[['campaign',_0x133a('0x2b')],[db['sequelize']['fn'](_0x133a('0x1b'),db[_0x133a('0x1a')][_0x133a('0x1c')]('id')),'ivrTotalCallsDays'],[db[_0x133a('0x1a')]['fn']('COUNT',db[_0x133a('0x1a')]['fn']('IF',db[_0x133a('0x1a')][_0x133a('0x1e')](_0x133a('0x2f')))),_0x133a('0x40')]],'group':['campaign']})[_0x133a('0x9')](function(_0xec69a1){logger['info'](_0x133a('0x3f'),_0x543fc2);logger[_0x133a('0xa')](_0x133a('0x3f'),_0x543fc2,JSON['stringify'](_0xec69a1));_0x2ec856(_0xec69a1);})[_0x133a('0x16')](function(_0x4ed930){logger[_0x133a('0xe')](_0x133a('0x3f'),_0x4ed930['message'],_0x543fc2);_0x8d3f01(_0x511128[_0x133a('0xe')](0x1f4,_0x4ed930[_0x133a('0xf')]));});});}; \ No newline at end of file +var _0x93e7=['`state`\x20=\x2010,\x201,\x20null','`state`\x20=\x2011,\x201,\x20null','AVG','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','CmHopperHistory','findAll','name','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','`state`\x20=\x2014,\x201,\x20null','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','campaign','GetCampaignHopperHistory','ivrAnswerCallsDay','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','create','body','options','raw','CreateCmHopperHistory','debug','AvgHandleTime','where','sequelize','COUNT','col','predictiveIntervalTotalCalls','`state`\x20=\x204,\x201,\x20null','literal'];(function(_0x26aec8,_0x2d3d48){var _0x5c100e=function(_0x3238ff){while(--_0x3238ff){_0x26aec8['push'](_0x26aec8['shift']());}};_0x5c100e(++_0x2d3d48);}(_0x93e7,0x9e));var _0x793e=function(_0x874cf1,_0x2a4954){_0x874cf1=_0x874cf1-0x0;var _0x233579=_0x93e7[_0x874cf1];return _0x233579;};'use strict';var _=require(_0x793e('0x0'));var util=require('util');var moment=require(_0x793e('0x1'));var BPromise=require(_0x793e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x793e('0x3'));var db=require(_0x793e('0x4'))['db'];var utils=require(_0x793e('0x5'));var logger=require(_0x793e('0x6'))('rpc');var config=require(_0x793e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x793e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x17c1e7,_0x4ca5ad,_0x427280){return new BPromise(function(_0x584492,_0x20d5c1){return client[_0x793e('0x9')](_0x17c1e7,_0x427280)[_0x793e('0xa')](function(_0x3af84f){logger[_0x793e('0xb')](_0x793e('0xc'),_0x4ca5ad,_0x793e('0xd'));logger['debug']('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x4ca5ad,'request\x20sent',JSON[_0x793e('0xe')](_0x3af84f));if(_0x3af84f['error']){if(_0x3af84f['error'][_0x793e('0xf')]===0x1f4){logger[_0x793e('0x10')]('CmHopperHistory,\x20%s,\x20%s',_0x4ca5ad,_0x3af84f[_0x793e('0x10')][_0x793e('0x11')]);return _0x20d5c1(_0x3af84f[_0x793e('0x10')][_0x793e('0x11')]);}logger[_0x793e('0x10')](_0x793e('0xc'),_0x4ca5ad,_0x3af84f[_0x793e('0x10')][_0x793e('0x11')]);return _0x584492(_0x3af84f[_0x793e('0x10')][_0x793e('0x11')]);}else{logger[_0x793e('0xb')](_0x793e('0xc'),_0x4ca5ad,_0x793e('0xd'));_0x584492(_0x3af84f[_0x793e('0x12')][_0x793e('0x11')]);}})[_0x793e('0x13')](function(_0x163dbc){logger[_0x793e('0x10')](_0x793e('0xc'),_0x4ca5ad,_0x163dbc);_0x20d5c1(_0x163dbc);});});}exports['CreateCmHopperHistory']=function(_0x3b38ef){var _0x3c6163=this;return new Promise(function(_0x4ba056,_0x4d55d4){return db['CmHopperHistory'][_0x793e('0x14')](_0x3b38ef[_0x793e('0x15')],{'raw':_0x3b38ef[_0x793e('0x16')]?_0x3b38ef[_0x793e('0x16')][_0x793e('0x17')]===undefined?!![]:![]:!![]})[_0x793e('0xa')](function(_0x1af167){logger[_0x793e('0xb')](_0x793e('0x18'),_0x3b38ef);logger[_0x793e('0x19')](_0x793e('0x18'),_0x3b38ef,JSON[_0x793e('0xe')](_0x1af167));_0x4ba056(_0x1af167);})[_0x793e('0x13')](function(_0xed37e){logger[_0x793e('0x10')](_0x793e('0x18'),_0xed37e[_0x793e('0x11')],_0x3b38ef);_0x4d55d4(_0x3c6163['error'](0x1f4,_0xed37e['message']));});});};exports[_0x793e('0x1a')]=function(_0x36840f){var _0x54eec3=this;return new Promise(function(_0x373e7a,_0x491d2a){return db['CmHopperHistory']['findAll']({'raw':_0x36840f['options']?_0x36840f['options'][_0x793e('0x17')]===undefined?!![]:![]:!![],'where':_0x36840f[_0x793e('0x16')]?_0x36840f[_0x793e('0x16')][_0x793e('0x1b')]||null:null,'attributes':[[db[_0x793e('0x1c')]['fn'](_0x793e('0x1d'),db[_0x793e('0x1c')][_0x793e('0x1e')]('id')),_0x793e('0x1f')],[db[_0x793e('0x1c')]['fn'](_0x793e('0x1d'),db['sequelize']['fn']('IF',db[_0x793e('0x1c')]['literal'](_0x793e('0x20')))),'predictiveIntervalAnsweredCalls'],[db[_0x793e('0x1c')]['fn']('COUNT',db[_0x793e('0x1c')]['fn']('IF',db['sequelize'][_0x793e('0x21')](_0x793e('0x22')))),'predictiveIntervalDroppedCallsTimeout'],[db['sequelize']['fn'](_0x793e('0x1d'),db['sequelize']['fn']('IF',db[_0x793e('0x1c')][_0x793e('0x21')](_0x793e('0x23')))),'predictiveIntervalDroppedCallsCallersExit'],[db[_0x793e('0x1c')]['fn'](_0x793e('0x24'),db[_0x793e('0x1c')]['fn']('IF',db[_0x793e('0x1c')][_0x793e('0x21')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),_0x793e('0x25')],[db[_0x793e('0x1c')]['fn'](_0x793e('0x24'),db[_0x793e('0x1c')]['fn']('IF',db['sequelize'][_0x793e('0x21')](_0x793e('0x26')))),_0x793e('0x27')]]})[_0x793e('0xa')](function(_0x4089dd){logger['info'](_0x793e('0x1a'),_0x36840f);logger[_0x793e('0x19')](_0x793e('0x1a'),_0x36840f,JSON[_0x793e('0xe')](_0x4089dd));_0x373e7a(_0x4089dd);})[_0x793e('0x13')](function(_0x3bde9a){logger[_0x793e('0x10')](_0x793e('0x1a'),_0x3bde9a['message'],_0x36840f);_0x491d2a(_0x54eec3[_0x793e('0x10')](0x1f4,_0x3bde9a[_0x793e('0x11')]));});});};exports[_0x793e('0x28')]=function(_0x43e037){var _0x137cd4=this;return new Promise(function(_0x1a247a,_0x48453b){return db[_0x793e('0x29')][_0x793e('0x2a')]({'raw':_0x43e037[_0x793e('0x16')]?_0x43e037[_0x793e('0x16')][_0x793e('0x17')]===undefined?!![]:![]:!![],'where':_0x43e037[_0x793e('0x16')]?_0x43e037[_0x793e('0x16')][_0x793e('0x1b')]||null:null,'attributes':[['campaign',_0x793e('0x2b')],[db[_0x793e('0x1c')]['fn'](_0x793e('0x1d'),db[_0x793e('0x1c')]['fn']('IF',db[_0x793e('0x1c')][_0x793e('0x21')]('`state`\x20=\x200,\x201,\x20null'))),'outboundNoSuchCallsDay'],[db[_0x793e('0x1c')]['fn'](_0x793e('0x1d'),db[_0x793e('0x1c')]['fn']('IF',db[_0x793e('0x1c')][_0x793e('0x21')](_0x793e('0x2c')))),_0x793e('0x2d')],[db[_0x793e('0x1c')]['fn'](_0x793e('0x1d'),db[_0x793e('0x1c')]['fn']('IF',db[_0x793e('0x1c')][_0x793e('0x21')](_0x793e('0x20')))),_0x793e('0x2e')],[db[_0x793e('0x1c')]['fn'](_0x793e('0x1d'),db[_0x793e('0x1c')]['fn']('IF',db[_0x793e('0x1c')][_0x793e('0x21')](_0x793e('0x2f')))),_0x793e('0x30')],[db[_0x793e('0x1c')]['fn'](_0x793e('0x1d'),db[_0x793e('0x1c')]['fn']('IF',db['sequelize'][_0x793e('0x21')]('`state`\x20=\x208,\x201,\x20null'))),'outboundCongestionCallsDay'],[db[_0x793e('0x1c')]['fn'](_0x793e('0x1d'),db[_0x793e('0x1c')]['fn']('IF',db[_0x793e('0x1c')][_0x793e('0x21')](_0x793e('0x31')))),_0x793e('0x32')],[db[_0x793e('0x1c')]['fn'](_0x793e('0x1d'),db['sequelize']['fn']('IF',db['sequelize'][_0x793e('0x21')](_0x793e('0x33')))),_0x793e('0x34')],[db[_0x793e('0x1c')]['fn']('COUNT',db[_0x793e('0x1c')]['fn']('IF',db[_0x793e('0x1c')][_0x793e('0x21')](_0x793e('0x35')))),'outboundUnknownCallsDay'],[db[_0x793e('0x1c')]['fn'](_0x793e('0x1d'),db[_0x793e('0x1c')]['fn']('IF',db[_0x793e('0x1c')][_0x793e('0x21')]('`state`\x20=\x2013,\x201,\x20null'))),'outboundBlacklistCallsDay'],[db['sequelize']['fn']('COUNT',db[_0x793e('0x1c')]['fn']('IF',db[_0x793e('0x1c')][_0x793e('0x21')](_0x793e('0x36')))),'outboundOriginateFailureCallsDay'],[db[_0x793e('0x1c')]['fn'](_0x793e('0x1d'),db[_0x793e('0x1c')]['fn']('IF',db['sequelize'][_0x793e('0x21')]('`state`\x20=\x2018,\x201,\x20null'))),'outboundRejectCallsDay'],[db[_0x793e('0x1c')]['fn'](_0x793e('0x1d'),db[_0x793e('0x1c')]['fn']('IF',db[_0x793e('0x1c')]['literal'](_0x793e('0x37')))),_0x793e('0x38')],[db[_0x793e('0x1c')]['fn'](_0x793e('0x1d'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x793e('0x39')))),_0x793e('0x3a')],[db[_0x793e('0x1c')]['fn']('COUNT',db[_0x793e('0x1c')]['fn']('IF',db['sequelize']['literal'](_0x793e('0x3b')))),_0x793e('0x3c')]],'group':[_0x793e('0x3d')]})['then'](function(_0x250eb8){logger['info'](_0x793e('0x28'),_0x43e037);logger['debug']('GetVoiceQueueHopperHistory',_0x43e037,JSON[_0x793e('0xe')](_0x250eb8));_0x1a247a(_0x250eb8);})['catch'](function(_0x431c07){logger['error'](_0x793e('0x28'),_0x431c07['message'],_0x43e037);_0x48453b(_0x137cd4['error'](0x1f4,_0x431c07[_0x793e('0x11')]));});});};exports[_0x793e('0x3e')]=function(_0x1fe506){var _0x3881cc=this;return new Promise(function(_0x11c4f6,_0x4ee4f7){return db['CmHopperHistory'][_0x793e('0x2a')]({'raw':_0x1fe506[_0x793e('0x16')]?_0x1fe506['options'][_0x793e('0x17')]===undefined?!![]:![]:!![],'where':_0x1fe506[_0x793e('0x16')]?_0x1fe506[_0x793e('0x16')][_0x793e('0x1b')]||null:null,'attributes':[[_0x793e('0x3d'),_0x793e('0x2b')],[db[_0x793e('0x1c')]['fn']('COUNT',db[_0x793e('0x1c')][_0x793e('0x1e')]('id')),'ivrTotalCallsDays'],[db[_0x793e('0x1c')]['fn'](_0x793e('0x1d'),db[_0x793e('0x1c')]['fn']('IF',db[_0x793e('0x1c')][_0x793e('0x21')](_0x793e('0x20')))),_0x793e('0x3f')]],'group':[_0x793e('0x3d')]})[_0x793e('0xa')](function(_0x4b5bd4){logger[_0x793e('0xb')]('GetCampaignHopperHistory',_0x1fe506);logger[_0x793e('0x19')](_0x793e('0x3e'),_0x1fe506,JSON[_0x793e('0xe')](_0x4b5bd4));_0x11c4f6(_0x4b5bd4);})[_0x793e('0x13')](function(_0x50cc39){logger[_0x793e('0x10')]('GetCampaignHopperHistory',_0x50cc39[_0x793e('0x11')],_0x1fe506);_0x4ee4f7(_0x3881cc[_0x793e('0x10')](0x1f4,_0x50cc39[_0x793e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index b20e263..8c9e35c 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 _0x783a=['put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','index','describe','/:id','show','post'];(function(_0x559858,_0x184073){var _0x297b10=function(_0x1e3a05){while(--_0x1e3a05){_0x559858['push'](_0x559858['shift']());}};_0x297b10(++_0x184073);}(_0x783a,0xcb));var _0xa783=function(_0x124b40,_0x23e289){_0x124b40=_0x124b40-0x0;var _0x2c3255=_0x783a[_0x124b40];return _0x2c3255;};'use strict';var multer=require(_0xa783('0x0'));var util=require(_0xa783('0x1'));var path=require(_0xa783('0x2'));var timeout=require(_0xa783('0x3'));var express=require(_0xa783('0x4'));var router=express[_0xa783('0x5')]();var fs_extra=require(_0xa783('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xa783('0x7'));var config=require(_0xa783('0x8'));var controller=require(_0xa783('0x9'));router[_0xa783('0xa')]('/',auth[_0xa783('0xb')](),controller[_0xa783('0xc')]);router[_0xa783('0xa')]('/describe',auth[_0xa783('0xb')](),controller[_0xa783('0xd')]);router[_0xa783('0xa')](_0xa783('0xe'),auth[_0xa783('0xb')](),controller[_0xa783('0xf')]);router[_0xa783('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0xa783('0x11')](_0xa783('0xe'),auth[_0xa783('0xb')](),controller[_0xa783('0x12')]);module[_0xa783('0x13')]=router; \ No newline at end of file +var _0x11af=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','index','/describe','isAuthenticated','/:id','show','create','put','update','exports','multer'];(function(_0x5be906,_0x6726ef){var _0x11bfa4=function(_0x39821b){while(--_0x39821b){_0x5be906['push'](_0x5be906['shift']());}};_0x11bfa4(++_0x6726ef);}(_0x11af,0x68));var _0xf11a=function(_0xd3a47a,_0x573438){_0xd3a47a=_0xd3a47a-0x0;var _0x3d4cfd=_0x11af[_0xd3a47a];return _0x3d4cfd;};'use strict';var multer=require(_0xf11a('0x0'));var util=require(_0xf11a('0x1'));var path=require(_0xf11a('0x2'));var timeout=require(_0xf11a('0x3'));var express=require(_0xf11a('0x4'));var router=express[_0xf11a('0x5')]();var fs_extra=require(_0xf11a('0x6'));var auth=require(_0xf11a('0x7'));var interaction=require(_0xf11a('0x8'));var config=require(_0xf11a('0x9'));var controller=require(_0xf11a('0xa'));router[_0xf11a('0xb')]('/',auth['isAuthenticated'](),controller[_0xf11a('0xc')]);router[_0xf11a('0xb')](_0xf11a('0xd'),auth[_0xf11a('0xe')](),controller['describe']);router['get'](_0xf11a('0xf'),auth[_0xf11a('0xe')](),controller[_0xf11a('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0xf11a('0x11')]);router[_0xf11a('0x12')](_0xf11a('0xf'),auth[_0xf11a('0xe')](),controller[_0xf11a('0x13')]);module[_0xf11a('0x14')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index 8939fae..4f8211a 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 _0x4bc3=['name','STRING','sequelize','exports'];(function(_0x47bb90,_0x446b50){var _0x5a2309=function(_0x1f4158){while(--_0x1f4158){_0x47bb90['push'](_0x47bb90['shift']());}};_0x5a2309(++_0x446b50);}(_0x4bc3,0x16e));var _0x34bc=function(_0x4b73a2,_0x40b5fe){_0x4b73a2=_0x4b73a2-0x0;var _0x383c66=_0x4bc3[_0x4b73a2];return _0x383c66;};'use strict';var Sequelize=require(_0x34bc('0x0'));module[_0x34bc('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x34bc('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x34bc('0x3')]},'dialPrefix':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x55d2=['name','STRING'];(function(_0xc2db81,_0x37a097){var _0x4e8a5d=function(_0x584ee7){while(--_0x584ee7){_0xc2db81['push'](_0xc2db81['shift']());}};_0x4e8a5d(++_0x37a097);}(_0x55d2,0x9f));var _0x255d=function(_0x107f87,_0x2fc1b3){_0x107f87=_0x107f87-0x0;var _0x1a18fe=_0x55d2[_0x107f87];return _0x1a18fe;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x255d('0x0')],'unique':_0x255d('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x255d('0x0')]},'dialPrefix':{'type':Sequelize[_0x255d('0x0')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index d449728..ff9cfa5 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 _0x461f=['download','addCustomField','sequelize','transaction','addCustomFields','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','getCustomFields','findAndCountAll','addAgents','ids','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','status','json','offset','undefined','count','apply','reject','save','update','then','destroy','get','Lists','UserProfileResource','end','error','stack','name','send','CmList','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','catch','show','params','options','find','create','body','user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ListId','getDispositions','findOne','Disposition','map','rows','removeDispositions','addContacts','CmContact','tags','join','push','omit','success','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','concat','CustomFields','format','cf_%d','raw','getContactsCsv','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','Content-disposition','attachment;\x20filename=','Content-type'];(function(_0x5cf1a1,_0x1ab924){var _0x52cbcc=function(_0xdc1230){while(--_0xdc1230){_0x5cf1a1['push'](_0x5cf1a1['shift']());}};_0x52cbcc(++_0x1ab924);}(_0x461f,0x142));var _0xf461=function(_0x4aea3a,_0x3839f9){_0x4aea3a=_0x4aea3a-0x0;var _0x5a349e=_0x461f[_0x4aea3a];return _0x5a349e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf461('0x0'));var zipdir=require(_0xf461('0x1'));var jsonpatch=require(_0xf461('0x2'));var rp=require(_0xf461('0x3'));var moment=require('moment');var BPromise=require(_0xf461('0x4'));var Mustache=require(_0xf461('0x5'));var util=require(_0xf461('0x6'));var path=require(_0xf461('0x7'));var sox=require(_0xf461('0x8'));var csv=require('to-csv');var ejs=require(_0xf461('0x9'));var fs=require('fs');var fs_extra=require(_0xf461('0xa'));var _=require(_0xf461('0xb'));var squel=require(_0xf461('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf461('0xd'));var toCsv=require('to-csv');var querystring=require(_0xf461('0xe'));var Papa=require('papaparse');var Redis=require(_0xf461('0xf'));var authService=require(_0xf461('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf461('0x11'));var logger=require(_0xf461('0x12'))(_0xf461('0x13'));var utils=require(_0xf461('0x14'));var config=require(_0xf461('0x15'));var licenseUtil=require(_0xf461('0x16'));var db=require(_0xf461('0x17'))['db'];config[_0xf461('0x18')]=_['defaults'](config[_0xf461('0x18')],{'host':_0xf461('0x19'),'port':0x18eb});var socket=require(_0xf461('0x1a'))(new Redis(config[_0xf461('0x18')]));require(_0xf461('0x1b'))[_0xf461('0x1c')](socket);function respondWithStatusCode(_0x1079d7,_0x2eee66){_0x2eee66=_0x2eee66||0xcc;return function(_0x1b3bd6){if(_0x1b3bd6){return _0x1079d7[_0xf461('0x1d')](_0x2eee66);}return _0x1079d7[_0xf461('0x1e')](_0x2eee66)['end']();};}function respondWithResult(_0x409c50,_0x49fb67){_0x49fb67=_0x49fb67||0xc8;return function(_0x5da71f){if(_0x5da71f){return _0x409c50[_0xf461('0x1e')](_0x49fb67)[_0xf461('0x1f')](_0x5da71f);}};}function respondWithFilteredResult(_0x416dfe,_0x1106f0){return function(_0x4ffe70){if(_0x4ffe70){var _0x3a57a7=typeof _0x1106f0[_0xf461('0x20')]==='undefined'&&typeof _0x1106f0['limit']===_0xf461('0x21');var _0x5ad875=_0x4ffe70[_0xf461('0x22')];var _0x4ed4ac=_0x3a57a7?0x0:_0x1106f0[_0xf461('0x20')];var _0x315d8a=_0x3a57a7?_0x4ffe70[_0xf461('0x22')]:_0x1106f0[_0xf461('0x20')]+_0x1106f0['limit'];var _0x4e7503;if(_0x315d8a>=_0x5ad875){_0x315d8a=_0x5ad875;_0x4e7503=0xc8;}else{_0x4e7503=0xce;}_0x416dfe[_0xf461('0x1e')](_0x4e7503);return _0x416dfe['set']('Content-Range',_0x4ed4ac+'-'+_0x315d8a+'/'+_0x5ad875)[_0xf461('0x1f')](_0x4ffe70);}return null;};}function patchUpdates(_0x15cdac){return function(_0x2ee168){try{jsonpatch[_0xf461('0x23')](_0x2ee168,_0x15cdac,!![]);}catch(_0x310a2d){return BPromise[_0xf461('0x24')](_0x310a2d);}return _0x2ee168[_0xf461('0x25')]();};}function saveUpdates(_0x417677,_0x1282f8){return function(_0x4348cf){if(_0x4348cf){return _0x4348cf[_0xf461('0x26')](_0x417677)[_0xf461('0x27')](function(_0x908ad5){return _0x908ad5;});}return null;};}function removeEntity(_0x5ce5c1,_0x522420){return function(_0x5abe99){if(_0x5abe99){return _0x5abe99[_0xf461('0x28')]()[_0xf461('0x27')](function(){var _0x30fadb=_0x5abe99[_0xf461('0x29')]({'plain':!![]});var _0x1eb42f=_0xf461('0x2a');return db[_0xf461('0x2b')][_0xf461('0x28')]({'where':{'type':_0x1eb42f,'resourceId':_0x30fadb['id']}})[_0xf461('0x27')](function(){return _0x5abe99;});})[_0xf461('0x27')](function(){_0x5ce5c1['status'](0xcc)[_0xf461('0x2c')]();});}};}function handleEntityNotFound(_0x2dcf8e,_0x4645d0){return function(_0x11c2b2){if(!_0x11c2b2){_0x2dcf8e['sendStatus'](0x194);}return _0x11c2b2;};}function handleError(_0x4e3613,_0x44a4a8){_0x44a4a8=_0x44a4a8||0x1f4;return function(_0x58bc58){logger[_0xf461('0x2d')](_0x58bc58[_0xf461('0x2e')]);if(_0x58bc58[_0xf461('0x2f')]){delete _0x58bc58[_0xf461('0x2f')];}_0x4e3613[_0xf461('0x1e')](_0x44a4a8)[_0xf461('0x30')](_0x58bc58);};}exports['index']=function(_0x876ffc,_0xee6575){var _0x26a2b5={},_0x3917e0={},_0x5bb70e={'count':0x0,'rows':[]};var _0x4b0a01=_['map'](db[_0xf461('0x31')][_0xf461('0x32')],function(_0x58bd0a){return{'name':_0x58bd0a[_0xf461('0x33')],'type':_0x58bd0a[_0xf461('0x34')][_0xf461('0x35')]};});_0x3917e0[_0xf461('0x36')]=_['map'](_0x4b0a01,_0xf461('0x2f'));_0x3917e0[_0xf461('0x37')]=_[_0xf461('0x38')](_0x876ffc[_0xf461('0x37')]);_0x3917e0[_0xf461('0x39')]=_[_0xf461('0x3a')](_0x3917e0[_0xf461('0x36')],_0x3917e0[_0xf461('0x37')]);_0x26a2b5[_0xf461('0x3b')]=_[_0xf461('0x3a')](_0x3917e0[_0xf461('0x36')],qs[_0xf461('0x3c')](_0x876ffc[_0xf461('0x37')]['fields']));_0x26a2b5[_0xf461('0x3b')]=_0x26a2b5['attributes'][_0xf461('0x3d')]?_0x26a2b5[_0xf461('0x3b')]:_0x3917e0[_0xf461('0x36')];if(!_0x876ffc[_0xf461('0x37')][_0xf461('0x3e')](_0xf461('0x3f'))){_0x26a2b5[_0xf461('0x40')]=qs[_0xf461('0x40')](_0x876ffc[_0xf461('0x37')][_0xf461('0x40')]);_0x26a2b5[_0xf461('0x20')]=qs[_0xf461('0x20')](_0x876ffc[_0xf461('0x37')][_0xf461('0x20')]);}_0x26a2b5[_0xf461('0x41')]=qs['sort'](_0x876ffc['query'][_0xf461('0x42')]);_0x26a2b5[_0xf461('0x43')]=qs['filters'](_[_0xf461('0x44')](_0x876ffc[_0xf461('0x37')],_0x3917e0[_0xf461('0x39')]),_0x4b0a01);if(_0x876ffc[_0xf461('0x37')]['filter']){_0x26a2b5['where']=_[_0xf461('0x45')](_0x26a2b5[_0xf461('0x43')],{'$or':_['map'](_0x4b0a01,function(_0x2614b8){if(_0x2614b8['type']!==_0xf461('0x46')){var _0x36339e={};_0x36339e[_0x2614b8['name']]={'$like':'%'+_0x876ffc[_0xf461('0x37')][_0xf461('0x47')]+'%'};return _0x36339e;}})});}_0x26a2b5=_[_0xf461('0x45')]({},_0x26a2b5,_0x876ffc['options']);var _0x5250b4={'where':_0x26a2b5[_0xf461('0x43')]};return db['CmList'][_0xf461('0x22')](_0x5250b4)[_0xf461('0x27')](function(_0x10f180){_0x5bb70e[_0xf461('0x22')]=_0x10f180;if(_0x876ffc[_0xf461('0x37')][_0xf461('0x48')]){_0x26a2b5[_0xf461('0x49')]=[{'all':!![]}];}return db['CmList'][_0xf461('0x4a')](_0x26a2b5);})[_0xf461('0x27')](function(_0x2d0bda){_0x5bb70e['rows']=_0x2d0bda;return _0x5bb70e;})[_0xf461('0x27')](respondWithFilteredResult(_0xee6575,_0x26a2b5))[_0xf461('0x4b')](handleError(_0xee6575,null));};exports[_0xf461('0x4c')]=function(_0x19880c,_0x3735c7){var _0x4a20a8={'raw':![],'where':{'id':_0x19880c[_0xf461('0x4d')]['id']}},_0x129f97={};_0x129f97[_0xf461('0x36')]=_[_0xf461('0x38')](db[_0xf461('0x31')][_0xf461('0x32')]);_0x129f97['query']=_[_0xf461('0x38')](_0x19880c[_0xf461('0x37')]);_0x129f97[_0xf461('0x39')]=_[_0xf461('0x3a')](_0x129f97[_0xf461('0x36')],_0x129f97['query']);_0x4a20a8[_0xf461('0x3b')]=_[_0xf461('0x3a')](_0x129f97[_0xf461('0x36')],qs['fields'](_0x19880c[_0xf461('0x37')][_0xf461('0x3c')]));_0x4a20a8[_0xf461('0x3b')]=_0x4a20a8[_0xf461('0x3b')][_0xf461('0x3d')]?_0x4a20a8['attributes']:_0x129f97['model'];if(_0x19880c[_0xf461('0x37')][_0xf461('0x48')]){_0x4a20a8['include']=[{'all':!![]}];}_0x4a20a8=_['merge']({},_0x4a20a8,_0x19880c[_0xf461('0x4e')]);return db[_0xf461('0x31')][_0xf461('0x4f')](_0x4a20a8)['then'](handleEntityNotFound(_0x3735c7,null))[_0xf461('0x27')](respondWithResult(_0x3735c7,null))[_0xf461('0x4b')](handleError(_0x3735c7,null));};exports[_0xf461('0x50')]=function(_0x381f0a,_0x248b6b){return db['CmList']['create'](_0x381f0a[_0xf461('0x51')],{})['then'](function(_0x440127){var _0x4b71ce=_0x381f0a[_0xf461('0x52')][_0xf461('0x29')]({'plain':!![]});if(!_0x4b71ce)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4b71ce[_0xf461('0x53')]===_0xf461('0x52')){var _0x556cbd=_0x440127[_0xf461('0x29')]({'plain':!![]});var _0x4221b5=_0xf461('0x2a');return db[_0xf461('0x54')][_0xf461('0x4f')]({'where':{'name':_0x4221b5,'userProfileId':_0x4b71ce['userProfileId']},'raw':!![]})[_0xf461('0x27')](function(_0x4ffe94){if(_0x4ffe94&&_0x4ffe94[_0xf461('0x55')]===0x0){return db['UserProfileResource'][_0xf461('0x50')]({'name':_0x556cbd[_0xf461('0x2f')],'resourceId':_0x556cbd['id'],'type':_0x4ffe94[_0xf461('0x2f')],'sectionId':_0x4ffe94['id']},{})['then'](function(){return _0x440127;});}else{return _0x440127;}})[_0xf461('0x4b')](function(_0x5d670a){logger[_0xf461('0x2d')](_0xf461('0x56'),_0x5d670a);throw _0x5d670a;});}return _0x440127;})[_0xf461('0x27')](respondWithResult(_0x248b6b,0xc9))['catch'](handleError(_0x248b6b,null));};exports[_0xf461('0x26')]=function(_0x5085fa,_0x20bc3c){if(_0x5085fa[_0xf461('0x51')]['id']){delete _0x5085fa[_0xf461('0x51')]['id'];}return db['CmList'][_0xf461('0x4f')]({'where':{'id':_0x5085fa[_0xf461('0x4d')]['id']}})[_0xf461('0x27')](handleEntityNotFound(_0x20bc3c,null))['then'](saveUpdates(_0x5085fa[_0xf461('0x51')],null))['then'](respondWithResult(_0x20bc3c,null))[_0xf461('0x4b')](handleError(_0x20bc3c,null));};exports['destroy']=function(_0x493d06,_0x21139e){return db[_0xf461('0x31')][_0xf461('0x4f')]({'where':{'id':_0x493d06[_0xf461('0x4d')]['id']}})[_0xf461('0x27')](handleEntityNotFound(_0x21139e,null))[_0xf461('0x27')](removeEntity(_0x21139e,null))[_0xf461('0x4b')](handleError(_0x21139e,null));};exports[_0xf461('0x57')]=function(_0x34e91d,_0x34bde9){return db[_0xf461('0x31')]['describe']()[_0xf461('0x27')](respondWithResult(_0x34bde9,null))['catch'](handleError(_0x34bde9,null));};exports[_0xf461('0x58')]=function(_0x57afa0,_0x4819f9,_0x5a84fb){if(_0x57afa0[_0xf461('0x51')]['id']){delete _0x57afa0[_0xf461('0x51')]['id'];}return db[_0xf461('0x31')][_0xf461('0x4f')]({'where':{'id':_0x57afa0[_0xf461('0x4d')]['id']}})[_0xf461('0x27')](handleEntityNotFound(_0x4819f9,null))[_0xf461('0x27')](function(_0xe4cfc){if(_0xe4cfc){_0x57afa0[_0xf461('0x51')][_0xf461('0x59')]=_0xe4cfc['id'];return db['Disposition'][_0xf461('0x50')](_0x57afa0['body']);}})[_0xf461('0x27')](respondWithResult(_0x4819f9,null))[_0xf461('0x4b')](handleError(_0x4819f9,null));};exports[_0xf461('0x5a')]=function(_0x49033d,_0x107f1c,_0x49bef0){var _0x10c444={'raw':![],'where':{}};var _0x50bf05={};var _0x1b5e9b={'count':0x0,'rows':[]};return db[_0xf461('0x31')][_0xf461('0x5b')]({'where':{'id':_0x49033d[_0xf461('0x4d')]['id']}})[_0xf461('0x27')](handleEntityNotFound(_0x107f1c,null))['then'](function(_0x5d7ead){if(_0x5d7ead){_0x50bf05[_0xf461('0x36')]=_[_0xf461('0x38')](db[_0xf461('0x5c')]['rawAttributes']);_0x50bf05[_0xf461('0x37')]=_[_0xf461('0x38')](_0x49033d[_0xf461('0x37')]);_0x50bf05[_0xf461('0x39')]=_['intersection'](_0x50bf05['model'],_0x50bf05[_0xf461('0x37')]);_0x10c444[_0xf461('0x3b')]=_[_0xf461('0x3a')](_0x50bf05[_0xf461('0x36')],qs[_0xf461('0x3c')](_0x49033d[_0xf461('0x37')][_0xf461('0x3c')]));_0x10c444[_0xf461('0x3b')]=_0x10c444[_0xf461('0x3b')][_0xf461('0x3d')]?_0x10c444[_0xf461('0x3b')]:_0x50bf05[_0xf461('0x36')];if(!_0x49033d[_0xf461('0x37')][_0xf461('0x3e')](_0xf461('0x3f'))){_0x10c444[_0xf461('0x40')]=qs[_0xf461('0x40')](_0x49033d['query'][_0xf461('0x40')]);_0x10c444[_0xf461('0x20')]=qs[_0xf461('0x20')](_0x49033d[_0xf461('0x37')][_0xf461('0x20')]);}_0x10c444['order']=qs['sort'](_0x49033d[_0xf461('0x37')][_0xf461('0x42')]);_0x10c444['where']=qs['filters'](_[_0xf461('0x44')](_0x49033d[_0xf461('0x37')],_0x50bf05[_0xf461('0x39')]));_0x10c444[_0xf461('0x43')][_0xf461('0x59')]=_0x5d7ead['id'];if(_0x49033d['query'][_0xf461('0x47')]){_0x10c444[_0xf461('0x43')]=_[_0xf461('0x45')](_0x10c444[_0xf461('0x43')],{'$or':_[_0xf461('0x5d')](_0x10c444[_0xf461('0x3b')],function(_0x1cc76d){var _0x3b8c5f={};_0x3b8c5f[_0x1cc76d]={'$like':'%'+_0x49033d['query'][_0xf461('0x47')]+'%'};return _0x3b8c5f;})});}_0x10c444=_[_0xf461('0x45')]({},_0x10c444,_0x49033d[_0xf461('0x4e')]);return db['Disposition']['count']({'where':_0x10c444[_0xf461('0x43')]})[_0xf461('0x27')](function(_0x2069c9){_0x1b5e9b['count']=_0x2069c9;if(_0x49033d['query'][_0xf461('0x48')]){_0x10c444['include']=[{'all':!![]}];}return db[_0xf461('0x5c')][_0xf461('0x4a')](_0x10c444);})['then'](function(_0x21d28f){_0x1b5e9b[_0xf461('0x5e')]=_0x21d28f;return _0x1b5e9b;});}})[_0xf461('0x27')](respondWithFilteredResult(_0x107f1c,_0x10c444))[_0xf461('0x4b')](handleError(_0x107f1c,null));};exports[_0xf461('0x5f')]=function(_0x4c6074,_0x1e2152,_0xb8fccb){return db[_0xf461('0x31')][_0xf461('0x4f')]({'where':{'id':_0x4c6074[_0xf461('0x4d')]['id']}})[_0xf461('0x27')](handleEntityNotFound(_0x1e2152,null))[_0xf461('0x27')](function(_0x3a41f3){if(_0x3a41f3){return _0x3a41f3['removeDispositions'](_0x4c6074['query']['ids']);}})[_0xf461('0x27')](respondWithStatusCode(_0x1e2152,null))[_0xf461('0x4b')](handleError(_0x1e2152,null));};exports[_0xf461('0x60')]=function(_0x134698,_0x1de6ef,_0x375677){return db[_0xf461('0x31')]['find']({'where':{'id':_0x134698[_0xf461('0x4d')]['id']}})[_0xf461('0x27')](handleEntityNotFound(_0x1de6ef,null))[_0xf461('0x27')](function(_0x17a7ae){if(_0x17a7ae){var _0xa3b625=[];var _0x5d9517={'success':[],'errors':[]};return db[_0xf461('0x61')][_0xf461('0x57')]()[_0xf461('0x27')](function(_0x410286){if(_0x134698['body'][_0xf461('0x62')]&&_['isArray'](_0x134698['body'][_0xf461('0x62')])){if(_0x134698[_0xf461('0x51')]['tags'][_0xf461('0x3d')]){_0x134698[_0xf461('0x51')][_0xf461('0x62')]=_0x134698[_0xf461('0x51')][_0xf461('0x62')][_0xf461('0x63')](';')+';';}else{_0x134698[_0xf461('0x51')][_0xf461('0x62')]=null;}}else{_0x134698[_0xf461('0x51')][_0xf461('0x62')]=null;}if(_0x134698[_0xf461('0x51')]&&_['isArray'](_0x134698[_0xf461('0x51')])){for(var _0x27370b=0x0;_0x27370b<_0x134698[_0xf461('0x51')][_0xf461('0x3d')];_0x27370b+=0x1){_0x134698[_0xf461('0x51')][_0x27370b][_0xf461('0x59')]=_0x134698['params']['id'];_0xa3b625[_0xf461('0x64')](_0x134698[_0xf461('0x51')][_0x27370b]);}return BPromise['each'](_0xa3b625,function(_0x59c2e2){return db[_0xf461('0x61')][_0xf461('0x50')](_[_0xf461('0x65')](_0x59c2e2,['ids','id'])||{},{'fields':_[_0xf461('0x38')](_0x410286),'raw':!![]})['then'](function(_0x517fe5){_0x5d9517[_0xf461('0x66')]['push'](_0x517fe5[_0xf461('0x67')]);})[_0xf461('0x4b')](function(_0x14af31){_0x5d9517[_0xf461('0x68')][_0xf461('0x64')]({'data':_0x59c2e2,'error':_0x14af31[_0xf461('0x69')]});});})[_0xf461('0x27')](function(_0x412d1d){return _0x5d9517;})['catch'](function(_0x1b5cda){return _0x1b5cda;});}else{_0x1de6ef['status'](0x190)[_0xf461('0x1f')]({'message':_0xf461('0x6a')});}});}})[_0xf461('0x27')](respondWithResult(_0x1de6ef,null))['catch'](handleError(_0x1de6ef,null));};exports[_0xf461('0x6b')]=function(_0x4cdfea,_0x3175e4,_0x301a30){var _0x356014;return db[_0xf461('0x31')][_0xf461('0x4f')]({'where':{'id':_0x4cdfea[_0xf461('0x4d')]['id']},'include':[{'model':db[_0xf461('0x6c')],'as':'CustomFields'}]})[_0xf461('0x27')](handleEntityNotFound(_0x3175e4,null))[_0xf461('0x27')](function(_0x841a17){if(_0x841a17){_0x356014=_0x841a17;return db[_0xf461('0x61')][_0xf461('0x32')];}})[_0xf461('0x27')](function(_0x397cf5){if(_0x397cf5){var _0x23431f={};var _0x369372={};_0x369372[_0xf461('0x36')]=_[_0xf461('0x6d')](_['keys'](_0x397cf5),_[_0xf461('0x5d')](_0x356014[_0xf461('0x6e')],function(_0xf014e6){return util[_0xf461('0x6f')](_0xf461('0x70'),_0xf014e6['id']);}));_0x369372['query']=_[_0xf461('0x38')](_0x4cdfea[_0xf461('0x37')]);_0x369372['filters']=_[_0xf461('0x3a')](_0x369372[_0xf461('0x36')],_0x369372[_0xf461('0x37')]);_0x23431f[_0xf461('0x3b')]=_[_0xf461('0x3a')](_0x369372[_0xf461('0x36')],qs[_0xf461('0x3c')](_0x4cdfea[_0xf461('0x37')][_0xf461('0x3c')]));_0x23431f['attributes']=_0x23431f[_0xf461('0x3b')][_0xf461('0x3d')]?_0x23431f['attributes']:_0x369372[_0xf461('0x36')];if(!_0x4cdfea[_0xf461('0x37')]['hasOwnProperty'](_0xf461('0x3f'))){_0x23431f[_0xf461('0x40')]=qs[_0xf461('0x40')](_0x4cdfea[_0xf461('0x37')][_0xf461('0x40')]);_0x23431f[_0xf461('0x20')]=qs['offset'](_0x4cdfea[_0xf461('0x37')][_0xf461('0x20')]);}_0x23431f[_0xf461('0x41')]=qs[_0xf461('0x42')](_0x4cdfea['query'][_0xf461('0x42')]);_0x23431f[_0xf461('0x43')]=qs['filters'](_['pick'](_0x4cdfea['query'],_0x369372[_0xf461('0x39')]));_0x23431f[_0xf461('0x71')]=!![];if(_0x4cdfea[_0xf461('0x37')][_0xf461('0x47')]){_0x23431f['where']=_[_0xf461('0x45')](_0x23431f[_0xf461('0x43')],{'$or':_['map'](_0x23431f[_0xf461('0x3b')],function(_0x5e4e89){var _0x4138c1={};_0x4138c1[_0x5e4e89]={'$like':'%'+_0x4cdfea[_0xf461('0x37')][_0xf461('0x47')]+'%'};return _0x4138c1;})});}_0x23431f=_[_0xf461('0x45')]({},_0x23431f,_0x4cdfea['options']);return _0x356014[_0xf461('0x6b')](_0x23431f);}})[_0xf461('0x27')](respondWithResult(_0x3175e4,null))[_0xf461('0x4b')](handleError(_0x3175e4,null));};exports[_0xf461('0x72')]=function(_0x532cde,_0x13ff68,_0x5849a5){var _0x6052fc;return db[_0xf461('0x31')][_0xf461('0x4f')]({'where':{'id':_0x532cde[_0xf461('0x4d')]['id']},'include':[{'model':db['CmCustomField'],'as':_0xf461('0x6e')}]})[_0xf461('0x27')](handleEntityNotFound(_0x13ff68,null))[_0xf461('0x27')](function(_0x279b59){if(_0x279b59){_0x6052fc=_0x279b59;return db[_0xf461('0x61')]['rawAttributes'];}})[_0xf461('0x27')](function(_0x1b7965){if(_0x1b7965){var _0x6a4816={};var _0x538280={};_0x538280['model']=_[_0xf461('0x6d')](_[_0xf461('0x38')](_0x1b7965),_[_0xf461('0x5d')](_0x6052fc['CustomFields'],function(_0x14c7e8){return util[_0xf461('0x6f')](_0xf461('0x70'),_0x14c7e8['id']);}));_0x538280[_0xf461('0x37')]=_[_0xf461('0x38')](_0x532cde[_0xf461('0x37')]);_0x538280[_0xf461('0x39')]=_[_0xf461('0x3a')](_0x538280[_0xf461('0x36')],_0x538280['query']);_0x6a4816[_0xf461('0x3b')]=_['intersection'](_0x538280[_0xf461('0x36')],qs[_0xf461('0x3c')](_0x532cde[_0xf461('0x37')][_0xf461('0x3c')]));_0x6a4816[_0xf461('0x3b')]=_0x6a4816['attributes'][_0xf461('0x3d')]?_0x6a4816['attributes']:_0x538280[_0xf461('0x36')];if(!_0x532cde[_0xf461('0x37')][_0xf461('0x3e')](_0xf461('0x3f'))){_0x6a4816[_0xf461('0x40')]=qs['limit'](_0x532cde[_0xf461('0x37')][_0xf461('0x40')]);_0x6a4816[_0xf461('0x20')]=qs[_0xf461('0x20')](_0x532cde[_0xf461('0x37')][_0xf461('0x20')]);}_0x6a4816['order']=qs[_0xf461('0x42')](_0x532cde[_0xf461('0x37')]['sort']);_0x6a4816['where']=qs[_0xf461('0x39')](_[_0xf461('0x44')](_0x532cde[_0xf461('0x37')],_0x538280['filters']));_0x6a4816[_0xf461('0x71')]=!![];if(_0x532cde[_0xf461('0x37')]['filter']){_0x6a4816['where']=_[_0xf461('0x45')](_0x6a4816['where'],{'$or':_[_0xf461('0x5d')](_0x6a4816['attributes'],function(_0x25e8ac){var _0x35bf16={};_0x35bf16[_0x25e8ac]={'$like':'%'+_0x532cde['query'][_0xf461('0x47')]+'%'};return _0x35bf16;})});}_0x6a4816=_['merge']({},_0x6a4816,_0x532cde[_0xf461('0x4e')]);return _0x6052fc['getContacts'](_0x6a4816);}})[_0xf461('0x27')](function(_0x5a57f5){if(!_[_0xf461('0x73')](_0x5a57f5)){var _0xdbc79c=toCsv(_0x5a57f5);var _0x2c9518=Date[_0xf461('0x74')]();fs[_0xf461('0x75')](util[_0xf461('0x6f')](_0xf461('0x76'),_0x6052fc['id'],_0x2c9518),_0xdbc79c);_0x13ff68['setHeader'](_0xf461('0x77'),_0xf461('0x78')+util[_0xf461('0x6f')]('list_%d_%s.csv',_0x6052fc['id'],_0x2c9518));_0x13ff68['setHeader'](_0xf461('0x79'),'text/csv');return _0x13ff68[_0xf461('0x7a')](util[_0xf461('0x6f')]('/tmp/list_%d_%s.csv',_0x6052fc['id'],_0x2c9518));}else{return _0x13ff68[_0xf461('0x1d')](0xcc);}})[_0xf461('0x4b')](handleError(_0x13ff68,null));};exports[_0xf461('0x7b')]=function(_0x3697e2,_0xc62cd7,_0x29afea){var _0xa0315a;delete _0x3697e2['body']['id'];return db[_0xf461('0x31')][_0xf461('0x5b')]({'where':{'id':_0x3697e2['params']['id']}})[_0xf461('0x27')](handleEntityNotFound(_0xc62cd7,null))[_0xf461('0x27')](function(_0x4372d4){if(_0x4372d4){return db[_0xf461('0x7c')][_0xf461('0x7d')](function(_0x4852e8){return db[_0xf461('0x6c')][_0xf461('0x50')](_0x3697e2[_0xf461('0x51')],{'transaction':_0x4852e8})[_0xf461('0x27')](function(_0x36dc96){_0xa0315a=_0x36dc96;return _0x4372d4[_0xf461('0x7e')](_0x36dc96,{'transaction':_0x4852e8});})[_0xf461('0x27')](function(){var _0x1b83dc={'type':db[_0xf461('0x7f')][_0xf461('0x80')],'transaction':_0x4852e8};switch(_0x3697e2[_0xf461('0x51')][_0xf461('0x34')]){case _0xf461('0x81'):_0x1b83dc[_0xf461('0x34')]=db[_0xf461('0x7f')][_0xf461('0x80')];break;case _0xf461('0x82'):_0x1b83dc[_0xf461('0x34')]=db[_0xf461('0x7f')][_0xf461('0x83')];break;case _0xf461('0x84'):_0x1b83dc[_0xf461('0x34')]=db[_0xf461('0x7f')][_0xf461('0x85')];_0x1b83dc[_0xf461('0x86')]=![];break;default:}return db[_0xf461('0x7c')][_0xf461('0x87')][_0xf461('0x88')](_0xf461('0x89'),util[_0xf461('0x6f')]('cf_%s',_0xa0315a['id']),_0x1b83dc);})[_0xf461('0x27')](function(){return _0xa0315a;});});}})[_0xf461('0x27')](respondWithResult(_0xc62cd7,null))[_0xf461('0x4b')](handleError(_0xc62cd7,null));};exports[_0xf461('0x8a')]=function(_0x3ce06a,_0xf67ac,_0x3dac63){var _0x332f60={};var _0x55be73={};var _0x1319a8;var _0x1ce129;return db[_0xf461('0x31')][_0xf461('0x5b')]({'where':{'id':_0x3ce06a[_0xf461('0x4d')]['id']}})[_0xf461('0x27')](handleEntityNotFound(_0xf67ac,null))[_0xf461('0x27')](function(_0x2a02ba){if(_0x2a02ba){_0x1319a8=_0x2a02ba;_0x55be73[_0xf461('0x36')]=_['keys'](db[_0xf461('0x6c')][_0xf461('0x32')]);_0x55be73[_0xf461('0x37')]=_[_0xf461('0x38')](_0x3ce06a[_0xf461('0x37')]);_0x55be73[_0xf461('0x39')]=_[_0xf461('0x3a')](_0x55be73[_0xf461('0x36')],_0x55be73[_0xf461('0x37')]);_0x332f60[_0xf461('0x3b')]=_[_0xf461('0x3a')](_0x55be73[_0xf461('0x36')],qs[_0xf461('0x3c')](_0x3ce06a['query']['fields']));_0x332f60[_0xf461('0x3b')]=_0x332f60[_0xf461('0x3b')][_0xf461('0x3d')]?_0x332f60[_0xf461('0x3b')]:_0x55be73['model'];_0x332f60['order']=qs[_0xf461('0x42')](_0x3ce06a[_0xf461('0x37')][_0xf461('0x42')]);_0x332f60[_0xf461('0x43')]=qs[_0xf461('0x39')](_[_0xf461('0x44')](_0x3ce06a[_0xf461('0x37')],_0x55be73[_0xf461('0x39')]));_0x332f60[_0xf461('0x43')]=_['merge'](_0x332f60[_0xf461('0x43')],{'$or':[{'ListId':_0x2a02ba['id']},{'ListId':null}]});if(_0x3ce06a['query'][_0xf461('0x47')]){_0x332f60['where']=_['merge'](_0x332f60[_0xf461('0x43')],{'$or':_[_0xf461('0x5d')](_0x332f60[_0xf461('0x3b')],function(_0x33e164){var _0x3cbef7={};_0x3cbef7[_0x33e164]={'$like':'%'+_0x3ce06a['query']['filter']+'%'};return _0x3cbef7;})});}_0x332f60=_[_0xf461('0x45')]({},_0x332f60,_0x3ce06a['options']);return db['CmCustomField'][_0xf461('0x8b')](_0x332f60);}})[_0xf461('0x27')](respondWithResult(_0xf67ac,null))[_0xf461('0x4b')](handleError(_0xf67ac,null));};exports[_0xf461('0x8c')]=function(_0x350174,_0x2b3ae3,_0x1c2755){return db[_0xf461('0x31')]['find']({'where':{'id':_0x350174[_0xf461('0x4d')]['id']}})[_0xf461('0x27')](handleEntityNotFound(_0x2b3ae3,null))[_0xf461('0x27')](function(_0x3f34e1){if(_0x3f34e1){return _0x3f34e1[_0xf461('0x8c')](_0x350174['body']['ids'],_[_0xf461('0x65')](_0x350174[_0xf461('0x51')],[_0xf461('0x8d'),'id'])||{})['spread'](function(_0x3034bc){for(var _0x172f62=0x0;_0x172f62<_0x350174[_0xf461('0x51')][_0xf461('0x8d')][_0xf461('0x3d')];_0x172f62+=0x1){socket[_0xf461('0x8e')](_0xf461('0x8f'),{'UserId':Number(_0x350174['body']['ids'][_0x172f62]),'CmListId':Number(_0x350174['params']['id'])});}return _0x3034bc;});}})['then'](respondWithResult(_0x2b3ae3,null))[_0xf461('0x4b')](handleError(_0x2b3ae3,null));};exports[_0xf461('0x90')]=function(_0x54987b,_0x5c0c30,_0x4d983c){return db[_0xf461('0x31')]['find']({'where':{'id':_0x54987b[_0xf461('0x4d')]['id']}})[_0xf461('0x27')](handleEntityNotFound(_0x5c0c30,null))[_0xf461('0x27')](function(_0x144486){if(_0x144486){return _0x144486['removeAgents'](_0x54987b[_0xf461('0x37')][_0xf461('0x8d')])[_0xf461('0x27')](function(){if(_['isArray'](_0x54987b[_0xf461('0x37')]['ids'])){for(var _0x5ec185=0x0;_0x5ec185<_0x54987b['query'][_0xf461('0x8d')][_0xf461('0x3d')];_0x5ec185+=0x1){socket[_0xf461('0x8e')](_0xf461('0x91'),{'UserId':Number(_0x54987b[_0xf461('0x37')][_0xf461('0x8d')][_0x5ec185]),'CmListId':Number(_0x54987b[_0xf461('0x4d')]['id'])});}}else{socket[_0xf461('0x8e')](_0xf461('0x91'),{'UserId':Number(_0x54987b[_0xf461('0x37')][_0xf461('0x8d')]),'CmListId':Number(_0x54987b['params']['id'])});}});}})['then'](respondWithStatusCode(_0x5c0c30,null))[_0xf461('0x4b')](handleError(_0x5c0c30,null));};exports[_0xf461('0x92')]=function(_0x390855,_0x3ebd3d,_0x3b33b8){var _0x5704a6={};var _0x1132a4={};var _0x393cb0;var _0x498e84;return db['CmList'][_0xf461('0x5b')]({'where':{'id':_0x390855[_0xf461('0x4d')]['id']}})[_0xf461('0x27')](handleEntityNotFound(_0x3ebd3d,null))[_0xf461('0x27')](function(_0x3e4515){if(_0x3e4515){_0x393cb0=_0x3e4515;_0x1132a4[_0xf461('0x36')]=_[_0xf461('0x38')](db[_0xf461('0x93')][_0xf461('0x32')]);_0x1132a4[_0xf461('0x37')]=_[_0xf461('0x38')](_0x390855[_0xf461('0x37')]);_0x1132a4[_0xf461('0x39')]=_[_0xf461('0x3a')](_0x1132a4['model'],_0x1132a4['query']);_0x5704a6[_0xf461('0x3b')]=_['intersection'](_0x1132a4['model'],qs[_0xf461('0x3c')](_0x390855[_0xf461('0x37')]['fields']));_0x5704a6[_0xf461('0x3b')]=_0x5704a6[_0xf461('0x3b')][_0xf461('0x3d')]?_0x5704a6[_0xf461('0x3b')]:_0x1132a4[_0xf461('0x36')];_0x5704a6[_0xf461('0x41')]=qs[_0xf461('0x42')](_0x390855[_0xf461('0x37')][_0xf461('0x42')]);_0x5704a6[_0xf461('0x43')]=qs[_0xf461('0x39')](_['pick'](_0x390855[_0xf461('0x37')],_0x1132a4[_0xf461('0x39')]));if(_0x390855[_0xf461('0x37')]['filter']){_0x5704a6[_0xf461('0x43')]=_[_0xf461('0x45')](_0x5704a6[_0xf461('0x43')],{'$or':_[_0xf461('0x5d')](_0x5704a6['attributes'],function(_0x38c123){var _0x44a25a={};_0x44a25a[_0x38c123]={'$like':'%'+_0x390855[_0xf461('0x37')][_0xf461('0x47')]+'%'};return _0x44a25a;})});}_0x5704a6=_[_0xf461('0x45')]({},_0x5704a6,_0x390855['options']);return _0x393cb0[_0xf461('0x92')](_0x5704a6);}})[_0xf461('0x27')](function(_0x2ea4b1){if(_0x2ea4b1){_0x498e84=_0x2ea4b1[_0xf461('0x3d')];if(!_0x390855[_0xf461('0x37')][_0xf461('0x3e')]('nolimit')){_0x5704a6[_0xf461('0x40')]=qs['limit'](_0x390855[_0xf461('0x37')][_0xf461('0x40')]);_0x5704a6[_0xf461('0x20')]=qs['offset'](_0x390855['query'][_0xf461('0x20')]);}return _0x393cb0[_0xf461('0x92')](_0x5704a6);}})['then'](function(_0x264820){if(_0x264820){return _0x264820?{'count':_0x498e84,'rows':_0x264820}:null;}})['then'](respondWithResult(_0x3ebd3d,null))[_0xf461('0x4b')](handleError(_0x3ebd3d,null));}; \ No newline at end of file +var _0x4f48=['request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','get','Lists','UserProfileResource','destroy','name','send','index','map','rawAttributes','type','key','model','filters','query','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','CmList','includeAll','findAll','catch','show','params','keys','attributes','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','ListId','Disposition','nolimit','include','rows','removeDispositions','ids','addContacts','tags','isArray','join','each','CmContact','omit','success','push','dataValues','errors','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','format','cf_%d','getContactsCsv','raw','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','text/csv','download','sequelize','transaction','addCustomFields','text','Sequelize','TEXT','number','INTEGER','switch','BOOLEAN','queryInterface','cm_contacts','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','findOne','User','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x13373a,_0x28b7c8){var _0x4ccfc7=function(_0xc0243c){while(--_0xc0243c){_0x13373a['push'](_0x13373a['shift']());}};_0x4ccfc7(++_0x28b7c8);}(_0x4f48,0x124));var _0x84f4=function(_0x26b3e7,_0x53bcea){_0x26b3e7=_0x26b3e7-0x0;var _0x149ed8=_0x4f48[_0x26b3e7];return _0x149ed8;};'use strict';var emlformat=require(_0x84f4('0x0'));var rimraf=require(_0x84f4('0x1'));var zipdir=require(_0x84f4('0x2'));var jsonpatch=require(_0x84f4('0x3'));var rp=require(_0x84f4('0x4'));var moment=require(_0x84f4('0x5'));var BPromise=require(_0x84f4('0x6'));var Mustache=require(_0x84f4('0x7'));var util=require('util');var path=require('path');var sox=require(_0x84f4('0x8'));var csv=require('to-csv');var ejs=require(_0x84f4('0x9'));var fs=require('fs');var fs_extra=require(_0x84f4('0xa'));var _=require('lodash');var squel=require(_0x84f4('0xb'));var crypto=require(_0x84f4('0xc'));var jsforce=require(_0x84f4('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x84f4('0xe'));var Papa=require(_0x84f4('0xf'));var Redis=require('ioredis');var authService=require(_0x84f4('0x10'));var qs=require(_0x84f4('0x11'));var as=require(_0x84f4('0x12'));var hardwareService=require(_0x84f4('0x13'));var logger=require(_0x84f4('0x14'))(_0x84f4('0x15'));var utils=require(_0x84f4('0x16'));var config=require(_0x84f4('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x84f4('0x18'))['db'];config[_0x84f4('0x19')]=_[_0x84f4('0x1a')](config[_0x84f4('0x19')],{'host':_0x84f4('0x1b'),'port':0x18eb});var socket=require(_0x84f4('0x1c'))(new Redis(config[_0x84f4('0x19')]));require(_0x84f4('0x1d'))[_0x84f4('0x1e')](socket);function respondWithStatusCode(_0x59b046,_0x9a9444){_0x9a9444=_0x9a9444||0xcc;return function(_0x17e119){if(_0x17e119){return _0x59b046[_0x84f4('0x1f')](_0x9a9444);}return _0x59b046[_0x84f4('0x20')](_0x9a9444)[_0x84f4('0x21')]();};}function respondWithResult(_0x1a1e60,_0x5bf72f){_0x5bf72f=_0x5bf72f||0xc8;return function(_0x4c0af0){if(_0x4c0af0){return _0x1a1e60['status'](_0x5bf72f)[_0x84f4('0x22')](_0x4c0af0);}};}function respondWithFilteredResult(_0x17d43e,_0x5a9626){return function(_0x2d6247){if(_0x2d6247){var _0x21c4ed=typeof _0x5a9626[_0x84f4('0x23')]===_0x84f4('0x24')&&typeof _0x5a9626[_0x84f4('0x25')]===_0x84f4('0x24');var _0x4610ed=_0x2d6247[_0x84f4('0x26')];var _0x213fe7=_0x21c4ed?0x0:_0x5a9626[_0x84f4('0x23')];var _0x536dc5=_0x21c4ed?_0x2d6247['count']:_0x5a9626[_0x84f4('0x23')]+_0x5a9626[_0x84f4('0x25')];var _0x51f99b;if(_0x536dc5>=_0x4610ed){_0x536dc5=_0x4610ed;_0x51f99b=0xc8;}else{_0x51f99b=0xce;}_0x17d43e[_0x84f4('0x20')](_0x51f99b);return _0x17d43e['set'](_0x84f4('0x27'),_0x213fe7+'-'+_0x536dc5+'/'+_0x4610ed)[_0x84f4('0x22')](_0x2d6247);}return null;};}function patchUpdates(_0x188210){return function(_0x2c308e){try{jsonpatch[_0x84f4('0x28')](_0x2c308e,_0x188210,!![]);}catch(_0x1af3f3){return BPromise[_0x84f4('0x29')](_0x1af3f3);}return _0x2c308e[_0x84f4('0x2a')]();};}function saveUpdates(_0x3239a2,_0x16c1f2){return function(_0x7c5aeb){if(_0x7c5aeb){return _0x7c5aeb[_0x84f4('0x2b')](_0x3239a2)[_0x84f4('0x2c')](function(_0x44a570){return _0x44a570;});}return null;};}function removeEntity(_0x79a7a2,_0x451e62){return function(_0x483d29){if(_0x483d29){return _0x483d29['destroy']()[_0x84f4('0x2c')](function(){var _0x49572a=_0x483d29[_0x84f4('0x2d')]({'plain':!![]});var _0x5bf9f9=_0x84f4('0x2e');return db[_0x84f4('0x2f')][_0x84f4('0x30')]({'where':{'type':_0x5bf9f9,'resourceId':_0x49572a['id']}})[_0x84f4('0x2c')](function(){return _0x483d29;});})['then'](function(){_0x79a7a2[_0x84f4('0x20')](0xcc)[_0x84f4('0x21')]();});}};}function handleEntityNotFound(_0x2bda5f,_0xf423ae){return function(_0x7ca61f){if(!_0x7ca61f){_0x2bda5f[_0x84f4('0x1f')](0x194);}return _0x7ca61f;};}function handleError(_0x5d9854,_0x7ca72a){_0x7ca72a=_0x7ca72a||0x1f4;return function(_0x40577e){logger['error'](_0x40577e['stack']);if(_0x40577e[_0x84f4('0x31')]){delete _0x40577e[_0x84f4('0x31')];}_0x5d9854[_0x84f4('0x20')](_0x7ca72a)[_0x84f4('0x32')](_0x40577e);};}exports[_0x84f4('0x33')]=function(_0x3e2937,_0x79bf3c){var _0x3a4eca={},_0x398016={},_0x122c4f={'count':0x0,'rows':[]};var _0x4e6ea5=_[_0x84f4('0x34')](db['CmList'][_0x84f4('0x35')],function(_0xf83f09){return{'name':_0xf83f09['fieldName'],'type':_0xf83f09[_0x84f4('0x36')][_0x84f4('0x37')]};});_0x398016[_0x84f4('0x38')]=_[_0x84f4('0x34')](_0x4e6ea5,_0x84f4('0x31'));_0x398016['query']=_['keys'](_0x3e2937['query']);_0x398016[_0x84f4('0x39')]=_['intersection'](_0x398016[_0x84f4('0x38')],_0x398016[_0x84f4('0x3a')]);_0x3a4eca['attributes']=_[_0x84f4('0x3b')](_0x398016[_0x84f4('0x38')],qs[_0x84f4('0x3c')](_0x3e2937[_0x84f4('0x3a')]['fields']));_0x3a4eca['attributes']=_0x3a4eca['attributes'][_0x84f4('0x3d')]?_0x3a4eca['attributes']:_0x398016['model'];if(!_0x3e2937[_0x84f4('0x3a')][_0x84f4('0x3e')]('nolimit')){_0x3a4eca[_0x84f4('0x25')]=qs['limit'](_0x3e2937['query']['limit']);_0x3a4eca['offset']=qs[_0x84f4('0x23')](_0x3e2937[_0x84f4('0x3a')][_0x84f4('0x23')]);}_0x3a4eca[_0x84f4('0x3f')]=qs[_0x84f4('0x40')](_0x3e2937['query'][_0x84f4('0x40')]);_0x3a4eca[_0x84f4('0x41')]=qs[_0x84f4('0x39')](_[_0x84f4('0x42')](_0x3e2937[_0x84f4('0x3a')],_0x398016['filters']),_0x4e6ea5);if(_0x3e2937['query'][_0x84f4('0x43')]){_0x3a4eca[_0x84f4('0x41')]=_['merge'](_0x3a4eca[_0x84f4('0x41')],{'$or':_[_0x84f4('0x34')](_0x4e6ea5,function(_0x1c27bf){if(_0x1c27bf['type']!==_0x84f4('0x44')){var _0x55fd46={};_0x55fd46[_0x1c27bf[_0x84f4('0x31')]]={'$like':'%'+_0x3e2937[_0x84f4('0x3a')][_0x84f4('0x43')]+'%'};return _0x55fd46;}})});}_0x3a4eca=_[_0x84f4('0x45')]({},_0x3a4eca,_0x3e2937[_0x84f4('0x46')]);var _0xb11f23={'where':_0x3a4eca['where']};return db[_0x84f4('0x47')][_0x84f4('0x26')](_0xb11f23)['then'](function(_0xead98d){_0x122c4f[_0x84f4('0x26')]=_0xead98d;if(_0x3e2937[_0x84f4('0x3a')][_0x84f4('0x48')]){_0x3a4eca['include']=[{'all':!![]}];}return db['CmList'][_0x84f4('0x49')](_0x3a4eca);})['then'](function(_0x571ca3){_0x122c4f['rows']=_0x571ca3;return _0x122c4f;})[_0x84f4('0x2c')](respondWithFilteredResult(_0x79bf3c,_0x3a4eca))[_0x84f4('0x4a')](handleError(_0x79bf3c,null));};exports[_0x84f4('0x4b')]=function(_0xd6678a,_0x537f9a){var _0x1259c4={'raw':![],'where':{'id':_0xd6678a[_0x84f4('0x4c')]['id']}},_0x4916da={};_0x4916da[_0x84f4('0x38')]=_[_0x84f4('0x4d')](db[_0x84f4('0x47')]['rawAttributes']);_0x4916da[_0x84f4('0x3a')]=_['keys'](_0xd6678a[_0x84f4('0x3a')]);_0x4916da[_0x84f4('0x39')]=_['intersection'](_0x4916da[_0x84f4('0x38')],_0x4916da['query']);_0x1259c4[_0x84f4('0x4e')]=_[_0x84f4('0x3b')](_0x4916da[_0x84f4('0x38')],qs[_0x84f4('0x3c')](_0xd6678a[_0x84f4('0x3a')][_0x84f4('0x3c')]));_0x1259c4[_0x84f4('0x4e')]=_0x1259c4[_0x84f4('0x4e')][_0x84f4('0x3d')]?_0x1259c4[_0x84f4('0x4e')]:_0x4916da[_0x84f4('0x38')];if(_0xd6678a[_0x84f4('0x3a')]['includeAll']){_0x1259c4['include']=[{'all':!![]}];}_0x1259c4=_[_0x84f4('0x45')]({},_0x1259c4,_0xd6678a['options']);return db[_0x84f4('0x47')][_0x84f4('0x4f')](_0x1259c4)[_0x84f4('0x2c')](handleEntityNotFound(_0x537f9a,null))[_0x84f4('0x2c')](respondWithResult(_0x537f9a,null))[_0x84f4('0x4a')](handleError(_0x537f9a,null));};exports[_0x84f4('0x50')]=function(_0x427cae,_0x52a2cf){return db[_0x84f4('0x47')][_0x84f4('0x50')](_0x427cae['body'],{})[_0x84f4('0x2c')](function(_0x16e1b7){var _0x560188=_0x427cae[_0x84f4('0x51')][_0x84f4('0x2d')]({'plain':!![]});if(!_0x560188)throw new Error(_0x84f4('0x52'));if(_0x560188[_0x84f4('0x53')]===_0x84f4('0x51')){var _0x425da7=_0x16e1b7[_0x84f4('0x2d')]({'plain':!![]});var _0x362e1b='Lists';return db[_0x84f4('0x54')][_0x84f4('0x4f')]({'where':{'name':_0x362e1b,'userProfileId':_0x560188[_0x84f4('0x55')]},'raw':!![]})[_0x84f4('0x2c')](function(_0x19f400){if(_0x19f400&&_0x19f400[_0x84f4('0x56')]===0x0){return db[_0x84f4('0x2f')][_0x84f4('0x50')]({'name':_0x425da7[_0x84f4('0x31')],'resourceId':_0x425da7['id'],'type':_0x19f400[_0x84f4('0x31')],'sectionId':_0x19f400['id']},{})[_0x84f4('0x2c')](function(){return _0x16e1b7;});}else{return _0x16e1b7;}})[_0x84f4('0x4a')](function(_0x859c50){logger[_0x84f4('0x57')](_0x84f4('0x58'),_0x859c50);throw _0x859c50;});}return _0x16e1b7;})[_0x84f4('0x2c')](respondWithResult(_0x52a2cf,0xc9))[_0x84f4('0x4a')](handleError(_0x52a2cf,null));};exports[_0x84f4('0x2b')]=function(_0x5f02e0,_0x5aa5fb){if(_0x5f02e0['body']['id']){delete _0x5f02e0[_0x84f4('0x59')]['id'];}return db['CmList'][_0x84f4('0x4f')]({'where':{'id':_0x5f02e0[_0x84f4('0x4c')]['id']}})[_0x84f4('0x2c')](handleEntityNotFound(_0x5aa5fb,null))[_0x84f4('0x2c')](saveUpdates(_0x5f02e0[_0x84f4('0x59')],null))[_0x84f4('0x2c')](respondWithResult(_0x5aa5fb,null))[_0x84f4('0x4a')](handleError(_0x5aa5fb,null));};exports['destroy']=function(_0x13a6d2,_0x280de3){return db[_0x84f4('0x47')][_0x84f4('0x4f')]({'where':{'id':_0x13a6d2['params']['id']}})[_0x84f4('0x2c')](handleEntityNotFound(_0x280de3,null))[_0x84f4('0x2c')](removeEntity(_0x280de3,null))['catch'](handleError(_0x280de3,null));};exports[_0x84f4('0x5a')]=function(_0x2fac91,_0x52745b){return db[_0x84f4('0x47')]['describe']()[_0x84f4('0x2c')](respondWithResult(_0x52745b,null))['catch'](handleError(_0x52745b,null));};exports[_0x84f4('0x5b')]=function(_0x21a2c2,_0x42e1ad,_0x4ba29e){if(_0x21a2c2[_0x84f4('0x59')]['id']){delete _0x21a2c2['body']['id'];}return db[_0x84f4('0x47')][_0x84f4('0x4f')]({'where':{'id':_0x21a2c2[_0x84f4('0x4c')]['id']}})[_0x84f4('0x2c')](handleEntityNotFound(_0x42e1ad,null))[_0x84f4('0x2c')](function(_0x13929d){if(_0x13929d){_0x21a2c2[_0x84f4('0x59')][_0x84f4('0x5c')]=_0x13929d['id'];return db[_0x84f4('0x5d')]['create'](_0x21a2c2['body']);}})[_0x84f4('0x2c')](respondWithResult(_0x42e1ad,null))[_0x84f4('0x4a')](handleError(_0x42e1ad,null));};exports['getDispositions']=function(_0x133f78,_0x506ae1,_0x11e2da){var _0xe04308={'raw':![],'where':{}};var _0x9d2ede={};var _0x201fc2={'count':0x0,'rows':[]};return db['CmList']['findOne']({'where':{'id':_0x133f78['params']['id']}})[_0x84f4('0x2c')](handleEntityNotFound(_0x506ae1,null))[_0x84f4('0x2c')](function(_0x4d109f){if(_0x4d109f){_0x9d2ede['model']=_['keys'](db[_0x84f4('0x5d')][_0x84f4('0x35')]);_0x9d2ede['query']=_[_0x84f4('0x4d')](_0x133f78[_0x84f4('0x3a')]);_0x9d2ede[_0x84f4('0x39')]=_[_0x84f4('0x3b')](_0x9d2ede['model'],_0x9d2ede[_0x84f4('0x3a')]);_0xe04308['attributes']=_[_0x84f4('0x3b')](_0x9d2ede[_0x84f4('0x38')],qs[_0x84f4('0x3c')](_0x133f78['query'][_0x84f4('0x3c')]));_0xe04308[_0x84f4('0x4e')]=_0xe04308[_0x84f4('0x4e')][_0x84f4('0x3d')]?_0xe04308[_0x84f4('0x4e')]:_0x9d2ede[_0x84f4('0x38')];if(!_0x133f78['query'][_0x84f4('0x3e')](_0x84f4('0x5e'))){_0xe04308[_0x84f4('0x25')]=qs[_0x84f4('0x25')](_0x133f78[_0x84f4('0x3a')][_0x84f4('0x25')]);_0xe04308[_0x84f4('0x23')]=qs[_0x84f4('0x23')](_0x133f78[_0x84f4('0x3a')][_0x84f4('0x23')]);}_0xe04308['order']=qs[_0x84f4('0x40')](_0x133f78[_0x84f4('0x3a')][_0x84f4('0x40')]);_0xe04308[_0x84f4('0x41')]=qs[_0x84f4('0x39')](_['pick'](_0x133f78[_0x84f4('0x3a')],_0x9d2ede[_0x84f4('0x39')]));_0xe04308['where']['ListId']=_0x4d109f['id'];if(_0x133f78['query'][_0x84f4('0x43')]){_0xe04308[_0x84f4('0x41')]=_['merge'](_0xe04308[_0x84f4('0x41')],{'$or':_[_0x84f4('0x34')](_0xe04308[_0x84f4('0x4e')],function(_0x2327eb){var _0x5f2630={};_0x5f2630[_0x2327eb]={'$like':'%'+_0x133f78[_0x84f4('0x3a')][_0x84f4('0x43')]+'%'};return _0x5f2630;})});}_0xe04308=_[_0x84f4('0x45')]({},_0xe04308,_0x133f78[_0x84f4('0x46')]);return db[_0x84f4('0x5d')][_0x84f4('0x26')]({'where':_0xe04308[_0x84f4('0x41')]})['then'](function(_0x687f65){_0x201fc2[_0x84f4('0x26')]=_0x687f65;if(_0x133f78[_0x84f4('0x3a')][_0x84f4('0x48')]){_0xe04308[_0x84f4('0x5f')]=[{'all':!![]}];}return db[_0x84f4('0x5d')][_0x84f4('0x49')](_0xe04308);})[_0x84f4('0x2c')](function(_0x2ce783){_0x201fc2[_0x84f4('0x60')]=_0x2ce783;return _0x201fc2;});}})[_0x84f4('0x2c')](respondWithFilteredResult(_0x506ae1,_0xe04308))['catch'](handleError(_0x506ae1,null));};exports['removeDispositions']=function(_0x2c9d38,_0x58ea1e,_0x570bb6){return db[_0x84f4('0x47')][_0x84f4('0x4f')]({'where':{'id':_0x2c9d38[_0x84f4('0x4c')]['id']}})[_0x84f4('0x2c')](handleEntityNotFound(_0x58ea1e,null))[_0x84f4('0x2c')](function(_0x3c94fc){if(_0x3c94fc){return _0x3c94fc[_0x84f4('0x61')](_0x2c9d38['query'][_0x84f4('0x62')]);}})[_0x84f4('0x2c')](respondWithStatusCode(_0x58ea1e,null))[_0x84f4('0x4a')](handleError(_0x58ea1e,null));};exports[_0x84f4('0x63')]=function(_0x59786a,_0x46e2de,_0x19161c){return db[_0x84f4('0x47')][_0x84f4('0x4f')]({'where':{'id':_0x59786a[_0x84f4('0x4c')]['id']}})[_0x84f4('0x2c')](handleEntityNotFound(_0x46e2de,null))['then'](function(_0x1b7b8a){if(_0x1b7b8a){var _0x2a865d=[];var _0x4bbfe3={'success':[],'errors':[]};return db['CmContact']['describe']()['then'](function(_0x5f6488){if(_0x59786a[_0x84f4('0x59')][_0x84f4('0x64')]&&_[_0x84f4('0x65')](_0x59786a[_0x84f4('0x59')]['tags'])){if(_0x59786a[_0x84f4('0x59')][_0x84f4('0x64')]['length']){_0x59786a[_0x84f4('0x59')][_0x84f4('0x64')]=_0x59786a['body'][_0x84f4('0x64')][_0x84f4('0x66')](';')+';';}else{_0x59786a['body'][_0x84f4('0x64')]=null;}}else{_0x59786a[_0x84f4('0x59')][_0x84f4('0x64')]=null;}if(_0x59786a[_0x84f4('0x59')]&&_[_0x84f4('0x65')](_0x59786a[_0x84f4('0x59')])){for(var _0x4cab81=0x0;_0x4cab81<_0x59786a['body']['length'];_0x4cab81+=0x1){_0x59786a[_0x84f4('0x59')][_0x4cab81][_0x84f4('0x5c')]=_0x59786a['params']['id'];_0x2a865d['push'](_0x59786a[_0x84f4('0x59')][_0x4cab81]);}return BPromise[_0x84f4('0x67')](_0x2a865d,function(_0x2dac69){return db[_0x84f4('0x68')][_0x84f4('0x50')](_[_0x84f4('0x69')](_0x2dac69,['ids','id'])||{},{'fields':_['keys'](_0x5f6488),'raw':!![]})['then'](function(_0x52d313){_0x4bbfe3[_0x84f4('0x6a')][_0x84f4('0x6b')](_0x52d313[_0x84f4('0x6c')]);})[_0x84f4('0x4a')](function(_0x22d1f0){_0x4bbfe3[_0x84f4('0x6d')][_0x84f4('0x6b')]({'data':_0x2dac69,'error':_0x22d1f0['message']});});})[_0x84f4('0x2c')](function(_0x5e9f73){return _0x4bbfe3;})[_0x84f4('0x4a')](function(_0x2aa3b2){return _0x2aa3b2;});}else{_0x46e2de[_0x84f4('0x20')](0x190)[_0x84f4('0x22')]({'message':_0x84f4('0x6e')});}});}})['then'](respondWithResult(_0x46e2de,null))['catch'](handleError(_0x46e2de,null));};exports[_0x84f4('0x6f')]=function(_0x474d4e,_0x1084e5,_0xfc89c){var _0x56172b;return db[_0x84f4('0x47')][_0x84f4('0x4f')]({'where':{'id':_0x474d4e[_0x84f4('0x4c')]['id']},'include':[{'model':db[_0x84f4('0x70')],'as':_0x84f4('0x71')}]})['then'](handleEntityNotFound(_0x1084e5,null))[_0x84f4('0x2c')](function(_0xf402e4){if(_0xf402e4){_0x56172b=_0xf402e4;return db[_0x84f4('0x68')]['rawAttributes'];}})[_0x84f4('0x2c')](function(_0x144214){if(_0x144214){var _0x4caa9e={};var _0x50912a={};_0x50912a[_0x84f4('0x38')]=_[_0x84f4('0x72')](_[_0x84f4('0x4d')](_0x144214),_[_0x84f4('0x34')](_0x56172b[_0x84f4('0x71')],function(_0x2428b){return util[_0x84f4('0x73')](_0x84f4('0x74'),_0x2428b['id']);}));_0x50912a['query']=_[_0x84f4('0x4d')](_0x474d4e['query']);_0x50912a[_0x84f4('0x39')]=_[_0x84f4('0x3b')](_0x50912a[_0x84f4('0x38')],_0x50912a[_0x84f4('0x3a')]);_0x4caa9e[_0x84f4('0x4e')]=_[_0x84f4('0x3b')](_0x50912a['model'],qs[_0x84f4('0x3c')](_0x474d4e[_0x84f4('0x3a')][_0x84f4('0x3c')]));_0x4caa9e[_0x84f4('0x4e')]=_0x4caa9e['attributes'][_0x84f4('0x3d')]?_0x4caa9e[_0x84f4('0x4e')]:_0x50912a[_0x84f4('0x38')];if(!_0x474d4e[_0x84f4('0x3a')][_0x84f4('0x3e')]('nolimit')){_0x4caa9e['limit']=qs['limit'](_0x474d4e[_0x84f4('0x3a')][_0x84f4('0x25')]);_0x4caa9e['offset']=qs[_0x84f4('0x23')](_0x474d4e[_0x84f4('0x3a')][_0x84f4('0x23')]);}_0x4caa9e[_0x84f4('0x3f')]=qs['sort'](_0x474d4e[_0x84f4('0x3a')]['sort']);_0x4caa9e[_0x84f4('0x41')]=qs[_0x84f4('0x39')](_[_0x84f4('0x42')](_0x474d4e[_0x84f4('0x3a')],_0x50912a['filters']));_0x4caa9e['raw']=!![];if(_0x474d4e[_0x84f4('0x3a')][_0x84f4('0x43')]){_0x4caa9e[_0x84f4('0x41')]=_[_0x84f4('0x45')](_0x4caa9e[_0x84f4('0x41')],{'$or':_[_0x84f4('0x34')](_0x4caa9e['attributes'],function(_0x41692e){var _0x47bd37={};_0x47bd37[_0x41692e]={'$like':'%'+_0x474d4e[_0x84f4('0x3a')]['filter']+'%'};return _0x47bd37;})});}_0x4caa9e=_[_0x84f4('0x45')]({},_0x4caa9e,_0x474d4e[_0x84f4('0x46')]);return _0x56172b['getContacts'](_0x4caa9e);}})[_0x84f4('0x2c')](respondWithResult(_0x1084e5,null))[_0x84f4('0x4a')](handleError(_0x1084e5,null));};exports[_0x84f4('0x75')]=function(_0x1cd273,_0x23a4d8,_0x4ef29a){var _0x1be101;return db['CmList'][_0x84f4('0x4f')]({'where':{'id':_0x1cd273[_0x84f4('0x4c')]['id']},'include':[{'model':db[_0x84f4('0x70')],'as':_0x84f4('0x71')}]})[_0x84f4('0x2c')](handleEntityNotFound(_0x23a4d8,null))['then'](function(_0x4dd2a4){if(_0x4dd2a4){_0x1be101=_0x4dd2a4;return db[_0x84f4('0x68')][_0x84f4('0x35')];}})[_0x84f4('0x2c')](function(_0x388c9c){if(_0x388c9c){var _0x66f27a={};var _0x46133a={};_0x46133a[_0x84f4('0x38')]=_[_0x84f4('0x72')](_['keys'](_0x388c9c),_[_0x84f4('0x34')](_0x1be101[_0x84f4('0x71')],function(_0x21b385){return util[_0x84f4('0x73')](_0x84f4('0x74'),_0x21b385['id']);}));_0x46133a['query']=_[_0x84f4('0x4d')](_0x1cd273[_0x84f4('0x3a')]);_0x46133a['filters']=_[_0x84f4('0x3b')](_0x46133a[_0x84f4('0x38')],_0x46133a[_0x84f4('0x3a')]);_0x66f27a[_0x84f4('0x4e')]=_[_0x84f4('0x3b')](_0x46133a[_0x84f4('0x38')],qs[_0x84f4('0x3c')](_0x1cd273[_0x84f4('0x3a')]['fields']));_0x66f27a[_0x84f4('0x4e')]=_0x66f27a[_0x84f4('0x4e')]['length']?_0x66f27a[_0x84f4('0x4e')]:_0x46133a[_0x84f4('0x38')];if(!_0x1cd273[_0x84f4('0x3a')][_0x84f4('0x3e')](_0x84f4('0x5e'))){_0x66f27a[_0x84f4('0x25')]=qs[_0x84f4('0x25')](_0x1cd273[_0x84f4('0x3a')][_0x84f4('0x25')]);_0x66f27a[_0x84f4('0x23')]=qs[_0x84f4('0x23')](_0x1cd273[_0x84f4('0x3a')][_0x84f4('0x23')]);}_0x66f27a['order']=qs['sort'](_0x1cd273['query'][_0x84f4('0x40')]);_0x66f27a['where']=qs['filters'](_[_0x84f4('0x42')](_0x1cd273[_0x84f4('0x3a')],_0x46133a['filters']));_0x66f27a[_0x84f4('0x76')]=!![];if(_0x1cd273[_0x84f4('0x3a')][_0x84f4('0x43')]){_0x66f27a[_0x84f4('0x41')]=_['merge'](_0x66f27a[_0x84f4('0x41')],{'$or':_[_0x84f4('0x34')](_0x66f27a[_0x84f4('0x4e')],function(_0x576b85){var _0xb68857={};_0xb68857[_0x576b85]={'$like':'%'+_0x1cd273[_0x84f4('0x3a')][_0x84f4('0x43')]+'%'};return _0xb68857;})});}_0x66f27a=_[_0x84f4('0x45')]({},_0x66f27a,_0x1cd273[_0x84f4('0x46')]);return _0x1be101[_0x84f4('0x6f')](_0x66f27a);}})[_0x84f4('0x2c')](function(_0x9efdba){if(!_['isEmpty'](_0x9efdba)){var _0x15faa4=toCsv(_0x9efdba);var _0x15a989=Date['now']();fs[_0x84f4('0x77')](util[_0x84f4('0x73')](_0x84f4('0x78'),_0x1be101['id'],_0x15a989),_0x15faa4);_0x23a4d8[_0x84f4('0x79')](_0x84f4('0x7a'),_0x84f4('0x7b')+util[_0x84f4('0x73')](_0x84f4('0x7c'),_0x1be101['id'],_0x15a989));_0x23a4d8[_0x84f4('0x79')]('Content-type',_0x84f4('0x7d'));return _0x23a4d8[_0x84f4('0x7e')](util[_0x84f4('0x73')](_0x84f4('0x78'),_0x1be101['id'],_0x15a989));}else{return _0x23a4d8['sendStatus'](0xcc);}})['catch'](handleError(_0x23a4d8,null));};exports['addCustomField']=function(_0x5a333d,_0x25642b,_0x5c1de7){var _0x1d2084;delete _0x5a333d[_0x84f4('0x59')]['id'];return db[_0x84f4('0x47')]['findOne']({'where':{'id':_0x5a333d[_0x84f4('0x4c')]['id']}})[_0x84f4('0x2c')](handleEntityNotFound(_0x25642b,null))[_0x84f4('0x2c')](function(_0x42de39){if(_0x42de39){return db[_0x84f4('0x7f')][_0x84f4('0x80')](function(_0x5044b4){return db['CmCustomField'][_0x84f4('0x50')](_0x5a333d[_0x84f4('0x59')],{'transaction':_0x5044b4})[_0x84f4('0x2c')](function(_0x268feb){_0x1d2084=_0x268feb;return _0x42de39[_0x84f4('0x81')](_0x268feb,{'transaction':_0x5044b4});})[_0x84f4('0x2c')](function(){var _0x632e17={'type':db['Sequelize']['TEXT'],'transaction':_0x5044b4};switch(_0x5a333d[_0x84f4('0x59')][_0x84f4('0x36')]){case _0x84f4('0x82'):_0x632e17[_0x84f4('0x36')]=db[_0x84f4('0x83')][_0x84f4('0x84')];break;case _0x84f4('0x85'):_0x632e17['type']=db['Sequelize'][_0x84f4('0x86')];break;case _0x84f4('0x87'):_0x632e17[_0x84f4('0x36')]=db[_0x84f4('0x83')][_0x84f4('0x88')];_0x632e17['defaultValue']=![];break;default:}return db[_0x84f4('0x7f')][_0x84f4('0x89')]['addColumn'](_0x84f4('0x8a'),util[_0x84f4('0x73')]('cf_%s',_0x1d2084['id']),_0x632e17);})[_0x84f4('0x2c')](function(){return _0x1d2084;});});}})[_0x84f4('0x2c')](respondWithResult(_0x25642b,null))[_0x84f4('0x4a')](handleError(_0x25642b,null));};exports['getCustomFields']=function(_0x4ab6ae,_0x24a204,_0x38add8){var _0x4a6315={};var _0xe8abaa={};var _0x28f5ac;var _0x46e1fd;return db[_0x84f4('0x47')]['findOne']({'where':{'id':_0x4ab6ae[_0x84f4('0x4c')]['id']}})[_0x84f4('0x2c')](handleEntityNotFound(_0x24a204,null))['then'](function(_0xcdae75){if(_0xcdae75){_0x28f5ac=_0xcdae75;_0xe8abaa[_0x84f4('0x38')]=_[_0x84f4('0x4d')](db['CmCustomField'][_0x84f4('0x35')]);_0xe8abaa['query']=_[_0x84f4('0x4d')](_0x4ab6ae[_0x84f4('0x3a')]);_0xe8abaa[_0x84f4('0x39')]=_[_0x84f4('0x3b')](_0xe8abaa[_0x84f4('0x38')],_0xe8abaa[_0x84f4('0x3a')]);_0x4a6315['attributes']=_[_0x84f4('0x3b')](_0xe8abaa['model'],qs[_0x84f4('0x3c')](_0x4ab6ae['query'][_0x84f4('0x3c')]));_0x4a6315[_0x84f4('0x4e')]=_0x4a6315[_0x84f4('0x4e')][_0x84f4('0x3d')]?_0x4a6315[_0x84f4('0x4e')]:_0xe8abaa[_0x84f4('0x38')];_0x4a6315['order']=qs[_0x84f4('0x40')](_0x4ab6ae[_0x84f4('0x3a')][_0x84f4('0x40')]);_0x4a6315[_0x84f4('0x41')]=qs['filters'](_[_0x84f4('0x42')](_0x4ab6ae['query'],_0xe8abaa['filters']));_0x4a6315[_0x84f4('0x41')]=_[_0x84f4('0x45')](_0x4a6315[_0x84f4('0x41')],{'$or':[{'ListId':_0xcdae75['id']},{'ListId':null}]});if(_0x4ab6ae[_0x84f4('0x3a')][_0x84f4('0x43')]){_0x4a6315[_0x84f4('0x41')]=_[_0x84f4('0x45')](_0x4a6315[_0x84f4('0x41')],{'$or':_[_0x84f4('0x34')](_0x4a6315[_0x84f4('0x4e')],function(_0x166ea0){var _0x41eac3={};_0x41eac3[_0x166ea0]={'$like':'%'+_0x4ab6ae['query'][_0x84f4('0x43')]+'%'};return _0x41eac3;})});}_0x4a6315=_['merge']({},_0x4a6315,_0x4ab6ae[_0x84f4('0x46')]);return db[_0x84f4('0x70')]['findAndCountAll'](_0x4a6315);}})[_0x84f4('0x2c')](respondWithResult(_0x24a204,null))['catch'](handleError(_0x24a204,null));};exports[_0x84f4('0x8b')]=function(_0x5be56a,_0x1ef228,_0x5ae2f1){return db['CmList']['find']({'where':{'id':_0x5be56a[_0x84f4('0x4c')]['id']}})[_0x84f4('0x2c')](handleEntityNotFound(_0x1ef228,null))['then'](function(_0x20353e){if(_0x20353e){return _0x20353e[_0x84f4('0x8b')](_0x5be56a[_0x84f4('0x59')][_0x84f4('0x62')],_[_0x84f4('0x69')](_0x5be56a[_0x84f4('0x59')],[_0x84f4('0x62'),'id'])||{})[_0x84f4('0x8c')](function(_0x5ed49b){for(var _0x4ba883=0x0;_0x4ba883<_0x5be56a[_0x84f4('0x59')][_0x84f4('0x62')][_0x84f4('0x3d')];_0x4ba883+=0x1){socket[_0x84f4('0x8d')](_0x84f4('0x8e'),{'UserId':Number(_0x5be56a[_0x84f4('0x59')][_0x84f4('0x62')][_0x4ba883]),'CmListId':Number(_0x5be56a[_0x84f4('0x4c')]['id'])});}return _0x5ed49b;});}})[_0x84f4('0x2c')](respondWithResult(_0x1ef228,null))[_0x84f4('0x4a')](handleError(_0x1ef228,null));};exports[_0x84f4('0x8f')]=function(_0x1cbebb,_0x51e25f,_0x548332){return db[_0x84f4('0x47')][_0x84f4('0x4f')]({'where':{'id':_0x1cbebb['params']['id']}})[_0x84f4('0x2c')](handleEntityNotFound(_0x51e25f,null))[_0x84f4('0x2c')](function(_0x34d291){if(_0x34d291){return _0x34d291['removeAgents'](_0x1cbebb['query'][_0x84f4('0x62')])[_0x84f4('0x2c')](function(){if(_['isArray'](_0x1cbebb['query'][_0x84f4('0x62')])){for(var _0x47b8ab=0x0;_0x47b8ab<_0x1cbebb[_0x84f4('0x3a')]['ids'][_0x84f4('0x3d')];_0x47b8ab+=0x1){socket['emit']('userCmList:remove',{'UserId':Number(_0x1cbebb[_0x84f4('0x3a')][_0x84f4('0x62')][_0x47b8ab]),'CmListId':Number(_0x1cbebb[_0x84f4('0x4c')]['id'])});}}else{socket[_0x84f4('0x8d')](_0x84f4('0x90'),{'UserId':Number(_0x1cbebb['query'][_0x84f4('0x62')]),'CmListId':Number(_0x1cbebb['params']['id'])});}});}})[_0x84f4('0x2c')](respondWithStatusCode(_0x51e25f,null))[_0x84f4('0x4a')](handleError(_0x51e25f,null));};exports[_0x84f4('0x91')]=function(_0x2754ca,_0x52a5cf,_0x32a0ba){var _0x24e3c0={};var _0x5ba190={};var _0x3b0e75;var _0x1170bd;return db[_0x84f4('0x47')][_0x84f4('0x92')]({'where':{'id':_0x2754ca['params']['id']}})[_0x84f4('0x2c')](handleEntityNotFound(_0x52a5cf,null))[_0x84f4('0x2c')](function(_0xaf43c0){if(_0xaf43c0){_0x3b0e75=_0xaf43c0;_0x5ba190[_0x84f4('0x38')]=_[_0x84f4('0x4d')](db[_0x84f4('0x93')][_0x84f4('0x35')]);_0x5ba190['query']=_[_0x84f4('0x4d')](_0x2754ca['query']);_0x5ba190[_0x84f4('0x39')]=_[_0x84f4('0x3b')](_0x5ba190[_0x84f4('0x38')],_0x5ba190[_0x84f4('0x3a')]);_0x24e3c0[_0x84f4('0x4e')]=_['intersection'](_0x5ba190[_0x84f4('0x38')],qs[_0x84f4('0x3c')](_0x2754ca[_0x84f4('0x3a')][_0x84f4('0x3c')]));_0x24e3c0[_0x84f4('0x4e')]=_0x24e3c0[_0x84f4('0x4e')][_0x84f4('0x3d')]?_0x24e3c0[_0x84f4('0x4e')]:_0x5ba190[_0x84f4('0x38')];_0x24e3c0[_0x84f4('0x3f')]=qs['sort'](_0x2754ca[_0x84f4('0x3a')][_0x84f4('0x40')]);_0x24e3c0[_0x84f4('0x41')]=qs[_0x84f4('0x39')](_[_0x84f4('0x42')](_0x2754ca[_0x84f4('0x3a')],_0x5ba190[_0x84f4('0x39')]));if(_0x2754ca[_0x84f4('0x3a')][_0x84f4('0x43')]){_0x24e3c0[_0x84f4('0x41')]=_[_0x84f4('0x45')](_0x24e3c0[_0x84f4('0x41')],{'$or':_[_0x84f4('0x34')](_0x24e3c0[_0x84f4('0x4e')],function(_0x3bf1e7){var _0x5542b9={};_0x5542b9[_0x3bf1e7]={'$like':'%'+_0x2754ca[_0x84f4('0x3a')][_0x84f4('0x43')]+'%'};return _0x5542b9;})});}_0x24e3c0=_['merge']({},_0x24e3c0,_0x2754ca['options']);return _0x3b0e75[_0x84f4('0x91')](_0x24e3c0);}})[_0x84f4('0x2c')](function(_0x241d14){if(_0x241d14){_0x1170bd=_0x241d14[_0x84f4('0x3d')];if(!_0x2754ca['query'][_0x84f4('0x3e')](_0x84f4('0x5e'))){_0x24e3c0[_0x84f4('0x25')]=qs[_0x84f4('0x25')](_0x2754ca[_0x84f4('0x3a')][_0x84f4('0x25')]);_0x24e3c0['offset']=qs[_0x84f4('0x23')](_0x2754ca['query'][_0x84f4('0x23')]);}return _0x3b0e75[_0x84f4('0x91')](_0x24e3c0);}})[_0x84f4('0x2c')](function(_0x18695b){if(_0x18695b){return _0x18695b?{'count':_0x1170bd,'rows':_0x18695b}:null;}})[_0x84f4('0x2c')](respondWithResult(_0x52a5cf,null))[_0x84f4('0x4a')](handleError(_0x52a5cf,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 61a3e34..c5e1cc2 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 _0x5fc3=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hook'];(function(_0x24fa1a,_0x16d9c2){var _0xc5621f=function(_0x5616ac){while(--_0x5616ac){_0x24fa1a['push'](_0x24fa1a['shift']());}};_0xc5621f(++_0x16d9c2);}(_0x5fc3,0xa8));var _0x35fc=function(_0x4b9978,_0x58eb71){_0x4b9978=_0x4b9978-0x0;var _0x42f0e5=_0x5fc3[_0x4b9978];return _0x42f0e5;};'use strict';var EventEmitter=require(_0x35fc('0x0'));var CmList=require(_0x35fc('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents[_0x35fc('0x2')](0x0);var events={'afterCreate':_0x35fc('0x3'),'afterUpdate':_0x35fc('0x4'),'afterDestroy':_0x35fc('0x5')};function emitEvent(_0xb4f9ce){return function(_0x5e75e6,_0x2d1404,_0x1d5fec){CmListEvents[_0x35fc('0x6')](_0xb4f9ce+':'+_0x5e75e6['id'],_0x5e75e6);CmListEvents['emit'](_0xb4f9ce,_0x5e75e6);_0x1d5fec(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0x35fc('0x7')](e,emitEvent(event));}}module['exports']=CmListEvents; \ No newline at end of file +var _0x9957=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','CmList'];(function(_0x4a6d48,_0x5f4687){var _0x537824=function(_0x5a327a){while(--_0x5a327a){_0x4a6d48['push'](_0x4a6d48['shift']());}};_0x537824(++_0x5f4687);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var EventEmitter=require(_0x7995('0x0'));var CmList=require(_0x7995('0x1'))['db'][_0x7995('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0x7995('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7995('0x4'),'afterDestroy':_0x7995('0x5')};function emitEvent(_0x1902b4){return function(_0x462a03,_0x576d89,_0x744bea){CmListEvents[_0x7995('0x6')](_0x1902b4+':'+_0x462a03['id'],_0x462a03);CmListEvents[_0x7995('0x6')](_0x1902b4,_0x462a03);_0x744bea(null);};}for(var e in events){if(events[_0x7995('0x7')](e)){var event=events[e];CmList[_0x7995('0x8')](e,emitEvent(event));}}module[_0x7995('0x9')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 4b85654..ee63805 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 _0xb903=['rimraf','../../config/environment','./cmList.attributes','exports','cm_lists','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x1390a0,_0x499668){var _0x359f67=function(_0x3daff4){while(--_0x3daff4){_0x1390a0['push'](_0x1390a0['shift']());}};_0x359f67(++_0x499668);}(_0xb903,0x185));var _0x3b90=function(_0x183c05,_0xdef747){_0x183c05=_0x183c05-0x0;var _0x1a9844=_0xb903[_0x183c05];return _0x1a9844;};'use strict';var _=require(_0x3b90('0x0'));var util=require(_0x3b90('0x1'));var logger=require(_0x3b90('0x2'))(_0x3b90('0x3'));var moment=require('moment');var BPromise=require(_0x3b90('0x4'));var rp=require(_0x3b90('0x5'));var fs=require('fs');var path=require(_0x3b90('0x6'));var rimraf=require(_0x3b90('0x7'));var config=require(_0x3b90('0x8'));var attributes=require(_0x3b90('0x9'));module[_0x3b90('0xa')]=function(_0x5acd76,_0x15b68f){return _0x5acd76['define']('CmList',attributes,{'tableName':_0x3b90('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x22fb=['define','CmList','../../config/logger','moment','bluebird','request-promise','path','rimraf','./cmList.attributes','exports'];(function(_0x34ea74,_0x406409){var _0x550e05=function(_0x2f1cdc){while(--_0x2f1cdc){_0x34ea74['push'](_0x34ea74['shift']());}};_0x550e05(++_0x406409);}(_0x22fb,0x192));var _0xb22f=function(_0x5e194c,_0x580f2b){_0x5e194c=_0x5e194c-0x0;var _0x2e9108=_0x22fb[_0x5e194c];return _0x2e9108;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb22f('0x0'))('api');var moment=require(_0xb22f('0x1'));var BPromise=require(_0xb22f('0x2'));var rp=require(_0xb22f('0x3'));var fs=require('fs');var path=require(_0xb22f('0x4'));var rimraf=require(_0xb22f('0x5'));var config=require('../../config/environment');var attributes=require(_0xb22f('0x6'));module[_0xb22f('0x7')]=function(_0x2d1fb3,_0xc3ffcc){return _0x2d1fb3[_0xb22f('0x8')](_0xb22f('0x9'),attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index 20370a3..ea77ef3 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 _0xc8be=['error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','./cmList.socket','register','request','info','CmList,\x20%s,\x20%s','request\x20sent','CmList,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x300756,_0x1ba019){var _0x55d2c6=function(_0x34d18d){while(--_0x34d18d){_0x300756['push'](_0x300756['shift']());}};_0x55d2c6(++_0x1ba019);}(_0xc8be,0x163));var _0xec8b=function(_0x7b0396,_0x3427eb){_0x7b0396=_0x7b0396-0x0;var _0xdce43b=_0xc8be[_0x7b0396];return _0xdce43b;};'use strict';var _=require(_0xec8b('0x0'));var util=require(_0xec8b('0x1'));var moment=require(_0xec8b('0x2'));var BPromise=require(_0xec8b('0x3'));var rs=require(_0xec8b('0x4'));var fs=require('fs');var Redis=require(_0xec8b('0x5'));var db=require(_0xec8b('0x6'))['db'];var utils=require(_0xec8b('0x7'));var logger=require(_0xec8b('0x8'))('rpc');var config=require(_0xec8b('0x9'));var jayson=require(_0xec8b('0xa'));var client=jayson[_0xec8b('0xb')]['http']({'port':0x232a});config[_0xec8b('0xc')]=_[_0xec8b('0xd')](config[_0xec8b('0xc')],{'host':_0xec8b('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xec8b('0xc')]));require(_0xec8b('0xf'))[_0xec8b('0x10')](socket);function respondWithRpcPromise(_0x1a5f98,_0x58e3ca,_0x3cab9b){return new BPromise(function(_0x55976f,_0x78359f){return client[_0xec8b('0x11')](_0x1a5f98,_0x3cab9b)['then'](function(_0x30f40e){logger[_0xec8b('0x12')](_0xec8b('0x13'),_0x58e3ca,_0xec8b('0x14'));logger['debug'](_0xec8b('0x15'),_0x58e3ca,_0xec8b('0x14'),JSON[_0xec8b('0x16')](_0x30f40e));if(_0x30f40e[_0xec8b('0x17')]){if(_0x30f40e['error'][_0xec8b('0x18')]===0x1f4){logger[_0xec8b('0x17')]('CmList,\x20%s,\x20%s',_0x58e3ca,_0x30f40e['error'][_0xec8b('0x19')]);return _0x78359f(_0x30f40e[_0xec8b('0x17')][_0xec8b('0x19')]);}logger[_0xec8b('0x17')](_0xec8b('0x13'),_0x58e3ca,_0x30f40e[_0xec8b('0x17')]['message']);return _0x55976f(_0x30f40e[_0xec8b('0x17')][_0xec8b('0x19')]);}else{logger[_0xec8b('0x12')](_0xec8b('0x13'),_0x58e3ca,_0xec8b('0x14'));_0x55976f(_0x30f40e['result']['message']);}})[_0xec8b('0x1a')](function(_0x3e9608){logger[_0xec8b('0x17')](_0xec8b('0x13'),_0x58e3ca,_0x3e9608);_0x78359f(_0x3e9608);});});} \ No newline at end of file +var _0xbb5a=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./cmList.socket','register','request','then','info','CmList,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash'];(function(_0x43f881,_0xd6e5a2){var _0x365c14=function(_0x50d386){while(--_0x50d386){_0x43f881['push'](_0x43f881['shift']());}};_0x365c14(++_0xd6e5a2);}(_0xbb5a,0xca));var _0xabb5=function(_0x30c846,_0x2f78b3){_0x30c846=_0x30c846-0x0;var _0x47d29a=_0xbb5a[_0x30c846];return _0x47d29a;};'use strict';var _=require(_0xabb5('0x0'));var util=require(_0xabb5('0x1'));var moment=require('moment');var BPromise=require(_0xabb5('0x2'));var rs=require(_0xabb5('0x3'));var fs=require('fs');var Redis=require(_0xabb5('0x4'));var db=require(_0xabb5('0x5'))['db'];var utils=require(_0xabb5('0x6'));var logger=require(_0xabb5('0x7'))(_0xabb5('0x8'));var config=require(_0xabb5('0x9'));var jayson=require(_0xabb5('0xa'));var client=jayson[_0xabb5('0xb')][_0xabb5('0xc')]({'port':0x232a});config[_0xabb5('0xd')]=_[_0xabb5('0xe')](config[_0xabb5('0xd')],{'host':_0xabb5('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xabb5('0x10'))[_0xabb5('0x11')](socket);function respondWithRpcPromise(_0x3d859a,_0x15af92,_0x27df23){return new BPromise(function(_0xf23b33,_0xf0d27b){return client[_0xabb5('0x12')](_0x3d859a,_0x27df23)[_0xabb5('0x13')](function(_0x1bff3b){logger[_0xabb5('0x14')](_0xabb5('0x15'),_0x15af92,_0xabb5('0x16'));logger[_0xabb5('0x17')]('CmList,\x20%s,\x20%s,\x20%s',_0x15af92,_0xabb5('0x16'),JSON[_0xabb5('0x18')](_0x1bff3b));if(_0x1bff3b[_0xabb5('0x19')]){if(_0x1bff3b[_0xabb5('0x19')][_0xabb5('0x1a')]===0x1f4){logger['error'](_0xabb5('0x15'),_0x15af92,_0x1bff3b[_0xabb5('0x19')][_0xabb5('0x1b')]);return _0xf0d27b(_0x1bff3b['error'][_0xabb5('0x1b')]);}logger[_0xabb5('0x19')]('CmList,\x20%s,\x20%s',_0x15af92,_0x1bff3b[_0xabb5('0x19')][_0xabb5('0x1b')]);return _0xf23b33(_0x1bff3b[_0xabb5('0x19')][_0xabb5('0x1b')]);}else{logger[_0xabb5('0x14')](_0xabb5('0x15'),_0x15af92,_0xabb5('0x16'));_0xf23b33(_0x1bff3b['result'][_0xabb5('0x1b')]);}})[_0xabb5('0x1c')](function(_0x53d0f7){logger[_0xabb5('0x19')](_0xabb5('0x15'),_0x15af92,_0x53d0f7);_0xf0d27b(_0x53d0f7);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 74624db..9ac13ca 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 _0x1e38=['register','length','cmList:','./cmList.events','save','remove','update','emit'];(function(_0x519c67,_0x586a23){var _0xd645ca=function(_0x2ebea9){while(--_0x2ebea9){_0x519c67['push'](_0x519c67['shift']());}};_0xd645ca(++_0x586a23);}(_0x1e38,0x143));var _0x81e3=function(_0x4a7843,_0x24f6d1){_0x4a7843=_0x4a7843-0x0;var _0x2c57fe=_0x1e38[_0x4a7843];return _0x2c57fe;};'use strict';var CmListEvents=require(_0x81e3('0x0'));var events=[_0x81e3('0x1'),_0x81e3('0x2'),_0x81e3('0x3')];function createListener(_0x1f2358,_0x18d5f8){return function(_0x7d0232){_0x18d5f8[_0x81e3('0x4')](_0x1f2358,_0x7d0232);};}function removeListener(_0x5e2cee,_0x391861){return function(){CmListEvents['removeListener'](_0x5e2cee,_0x391861);};}exports[_0x81e3('0x5')]=function(_0xde6ab7){for(var _0x1c4cbb=0x0,_0x4f4951=events[_0x81e3('0x6')];_0x1c4cbb<_0x4f4951;_0x1c4cbb++){var _0xfbbbcc=events[_0x1c4cbb];var _0x30a16b=createListener(_0x81e3('0x7')+_0xfbbbcc,_0xde6ab7);CmListEvents['on'](_0xfbbbcc,_0x30a16b);}}; \ No newline at end of file +var _0x8e21=['length','cmList:','./cmList.events','remove','emit','removeListener','register'];(function(_0x4f41ec,_0x5a0cba){var _0xcca245=function(_0x228ffe){while(--_0x228ffe){_0x4f41ec['push'](_0x4f41ec['shift']());}};_0xcca245(++_0x5a0cba);}(_0x8e21,0x1de));var _0x18e2=function(_0x19a49f,_0x444d74){_0x19a49f=_0x19a49f-0x0;var _0x5351ae=_0x8e21[_0x19a49f];return _0x5351ae;};'use strict';var CmListEvents=require(_0x18e2('0x0'));var events=['save',_0x18e2('0x1'),'update'];function createListener(_0x2732c6,_0x5c93f3){return function(_0xc31198){_0x5c93f3[_0x18e2('0x2')](_0x2732c6,_0xc31198);};}function removeListener(_0x3915b3,_0x3fec66){return function(){CmListEvents[_0x18e2('0x3')](_0x3915b3,_0x3fec66);};}exports[_0x18e2('0x4')]=function(_0x5c995c){for(var _0x5a3880=0x0,_0x1fb6ae=events[_0x18e2('0x5')];_0x5a3880<_0x1fb6ae;_0x5a3880++){var _0x305e75=events[_0x5a3880];var _0x4d6337=createListener(_0x18e2('0x6')+_0x305e75,_0x5c995c);CmListEvents['on'](_0x305e75,_0x4d6337);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 3610fda..a87a670 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 _0x9385=['put','delete','destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated','describe','/:id','show','/:id/dispositions','getContacts','/:id/contacts/csv','getContactsCsv','/:id/users','getAgents','post','create','/:id/contacts','addCustomField','addAgents'];(function(_0x54514c,_0xf1c84a){var _0x5cd80e=function(_0x186444){while(--_0x186444){_0x54514c['push'](_0x54514c['shift']());}};_0x5cd80e(++_0xf1c84a);}(_0x9385,0x170));var _0x5938=function(_0x2ca4d1,_0x148124){_0x2ca4d1=_0x2ca4d1-0x0;var _0x45589a=_0x9385[_0x2ca4d1];return _0x45589a;};'use strict';var multer=require(_0x5938('0x0'));var util=require(_0x5938('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5938('0x2')]();var fs_extra=require(_0x5938('0x3'));var auth=require(_0x5938('0x4'));var interaction=require(_0x5938('0x5'));var config=require(_0x5938('0x6'));var controller=require(_0x5938('0x7'));router[_0x5938('0x8')]('/',auth[_0x5938('0x9')](),controller['index']);router[_0x5938('0x8')]('/describe',auth[_0x5938('0x9')](),controller[_0x5938('0xa')]);router['get'](_0x5938('0xb'),auth[_0x5938('0x9')](),controller[_0x5938('0xc')]);router[_0x5938('0x8')](_0x5938('0xd'),auth[_0x5938('0x9')](),controller['getDispositions']);router['get']('/:id/contacts',auth[_0x5938('0x9')](),controller[_0x5938('0xe')]);router[_0x5938('0x8')](_0x5938('0xf'),auth['isAuthenticated'](),controller[_0x5938('0x10')]);router[_0x5938('0x8')]('/:id/fields',auth[_0x5938('0x9')](),controller['getCustomFields']);router[_0x5938('0x8')](_0x5938('0x11'),auth[_0x5938('0x9')](),controller[_0x5938('0x12')]);router[_0x5938('0x13')]('/',auth[_0x5938('0x9')](),controller[_0x5938('0x14')]);router[_0x5938('0x13')]('/:id/dispositions',auth['isAuthenticated'](),controller['addDisposition']);router[_0x5938('0x13')](_0x5938('0x15'),auth[_0x5938('0x9')](),controller['addContacts']);router[_0x5938('0x13')]('/:id/fields',auth[_0x5938('0x9')](),controller[_0x5938('0x16')]);router['post'](_0x5938('0x11'),auth[_0x5938('0x9')](),controller[_0x5938('0x17')]);router[_0x5938('0x18')](_0x5938('0xb'),auth[_0x5938('0x9')](),controller['update']);router[_0x5938('0x19')](_0x5938('0xb'),auth[_0x5938('0x9')](),controller[_0x5938('0x1a')]);router[_0x5938('0x19')]('/:id/dispositions',auth[_0x5938('0x9')](),controller['removeDispositions']);router[_0x5938('0x19')]('/:id/users',auth[_0x5938('0x9')](),controller['removeAgents']);module[_0x5938('0x1b')]=router; \ No newline at end of file +var _0x59db=['getCustomFields','/:id/users','getAgents','post','addCustomField','addAgents','put','update','delete','destroy','/:id/dispositions','removeDispositions','removeAgents','exports','connect-timeout','express','../../components/auth/service','../../config/environment','./cmList.controller','isAuthenticated','get','/:id','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields'];(function(_0x8abd64,_0x539570){var _0xd2511e=function(_0x9fef7d){while(--_0x9fef7d){_0x8abd64['push'](_0x8abd64['shift']());}};_0xd2511e(++_0x539570);}(_0x59db,0x1a3));var _0xb59d=function(_0x4b8a65,_0x1cf2db){_0x4b8a65=_0x4b8a65-0x0;var _0x312793=_0x59db[_0x4b8a65];return _0x312793;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xb59d('0x0'));var express=require(_0xb59d('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb59d('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0xb59d('0x3'));var controller=require(_0xb59d('0x4'));router['get']('/',auth[_0xb59d('0x5')](),controller['index']);router[_0xb59d('0x6')]('/describe',auth[_0xb59d('0x5')](),controller['describe']);router[_0xb59d('0x6')](_0xb59d('0x7'),auth[_0xb59d('0x5')](),controller['show']);router[_0xb59d('0x6')]('/:id/dispositions',auth[_0xb59d('0x5')](),controller['getDispositions']);router[_0xb59d('0x6')](_0xb59d('0x8'),auth['isAuthenticated'](),controller[_0xb59d('0x9')]);router[_0xb59d('0x6')](_0xb59d('0xa'),auth[_0xb59d('0x5')](),controller[_0xb59d('0xb')]);router[_0xb59d('0x6')](_0xb59d('0xc'),auth[_0xb59d('0x5')](),controller[_0xb59d('0xd')]);router[_0xb59d('0x6')](_0xb59d('0xe'),auth[_0xb59d('0x5')](),controller[_0xb59d('0xf')]);router[_0xb59d('0x10')]('/',auth[_0xb59d('0x5')](),controller['create']);router[_0xb59d('0x10')]('/:id/dispositions',auth[_0xb59d('0x5')](),controller['addDisposition']);router['post'](_0xb59d('0x8'),auth[_0xb59d('0x5')](),controller['addContacts']);router[_0xb59d('0x10')](_0xb59d('0xc'),auth[_0xb59d('0x5')](),controller[_0xb59d('0x11')]);router['post'](_0xb59d('0xe'),auth[_0xb59d('0x5')](),controller[_0xb59d('0x12')]);router[_0xb59d('0x13')](_0xb59d('0x7'),auth['isAuthenticated'](),controller[_0xb59d('0x14')]);router[_0xb59d('0x15')]('/:id',auth[_0xb59d('0x5')](),controller[_0xb59d('0x16')]);router[_0xb59d('0x15')](_0xb59d('0x17'),auth[_0xb59d('0x5')](),controller[_0xb59d('0x18')]);router['delete'](_0xb59d('0xe'),auth['isAuthenticated'](),controller[_0xb59d('0x19')]);module[_0xb59d('0x1a')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 73f3b1c..a1c1a4e 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 _0xc62a=['getDataValue','field','STRING','sequelize','VIRTUAL'];(function(_0x84dbc9,_0x804160){var _0x365eea=function(_0x5c11c6){while(--_0x5c11c6){_0x84dbc9['push'](_0x84dbc9['shift']());}};_0x365eea(++_0x804160);}(_0xc62a,0x111));var _0xac62=function(_0x217b74,_0x25cb41){_0x217b74=_0x217b74-0x0;var _0x3a4234=_0xc62a[_0x217b74];return _0x3a4234;};'use strict';var Sequelize=require(_0xac62('0x0'));module['exports']={'name':{'type':Sequelize[_0xac62('0x1')],'get':function(_0x41ff8a){return this[_0xac62('0x2')](_0xac62('0x3'));}},'field':{'type':Sequelize[_0xac62('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0xac62('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0xac62('0x4')],'allowNull':![]}}; \ No newline at end of file +var _0xb72d=['exports','VIRTUAL','getDataValue','field','STRING','sequelize'];(function(_0x52704a,_0x161958){var _0x5f04fd=function(_0x4e7727){while(--_0x4e7727){_0x52704a['push'](_0x52704a['shift']());}};_0x5f04fd(++_0x161958);}(_0xb72d,0x12b));var _0xdb72=function(_0x38e4c3,_0xd960a0){_0x38e4c3=_0x38e4c3-0x0;var _0x5717b0=_0xb72d[_0x38e4c3];return _0x5717b0;};'use strict';var Sequelize=require(_0xdb72('0x0'));module[_0xdb72('0x1')]={'name':{'type':Sequelize[_0xdb72('0x2')],'get':function(_0x4985e4){return this[_0xdb72('0x3')](_0xdb72('0x4'));}},'field':{'type':Sequelize[_0xdb72('0x5')],'allowNull':![]},'operator':{'type':Sequelize[_0xdb72('0x5')],'allowNull':![]},'value':{'type':Sequelize[_0xdb72('0x5')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index ccbac59..f1dd226 100644 --- a/server/api/condition/condition.controller.js +++ b/server/api/condition/condition.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x42a7f5,_0x1628ec){var _0x3d541a=function(_0xba390c){while(--_0xba390c){_0x42a7f5['push'](_0x42a7f5['shift']());}};_0x3d541a(++_0x1628ec);}(_0x7a54,0x106));var _0x47a5=function(_0x4651cb,_0x3873d3){_0x4651cb=_0x4651cb-0x0;var _0x461af1=_0x7a54[_0x4651cb];return _0x461af1;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file +var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x102053,_0x777f32){var _0x331a9d=function(_0x55e7ae){while(--_0x55e7ae){_0x102053['push'](_0x102053['shift']());}};_0x331a9d(++_0x777f32);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index 46ef912..0bf84da 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 _0xf0ae=['tools_conditions','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./condition.attributes','exports','define','Condition'];(function(_0x2e93d0,_0x5d6526){var _0x2a88a6=function(_0x9bcb0f){while(--_0x9bcb0f){_0x2e93d0['push'](_0x2e93d0['shift']());}};_0x2a88a6(++_0x5d6526);}(_0xf0ae,0x12c));var _0xef0a=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0xf0ae[_0x5d4607];return _0x5e4a86;};'use strict';var _=require(_0xef0a('0x0'));var util=require(_0xef0a('0x1'));var logger=require(_0xef0a('0x2'))(_0xef0a('0x3'));var moment=require('moment');var BPromise=require(_0xef0a('0x4'));var rp=require(_0xef0a('0x5'));var fs=require('fs');var path=require(_0xef0a('0x6'));var rimraf=require('rimraf');var config=require(_0xef0a('0x7'));var attributes=require(_0xef0a('0x8'));module[_0xef0a('0x9')]=function(_0xb4157d,_0x4afc22){return _0xb4157d[_0xef0a('0xa')](_0xef0a('0xb'),attributes,{'tableName':_0xef0a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x70e8=['util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./condition.attributes','exports','tools_conditions','lodash'];(function(_0x184a9c,_0x345efe){var _0x5548c5=function(_0xa3ef9b){while(--_0xa3ef9b){_0x184a9c['push'](_0x184a9c['shift']());}};_0x5548c5(++_0x345efe);}(_0x70e8,0x15f));var _0x870e=function(_0x324caa,_0x2d60df){_0x324caa=_0x324caa-0x0;var _0x40c86a=_0x70e8[_0x324caa];return _0x40c86a;};'use strict';var _=require(_0x870e('0x0'));var util=require(_0x870e('0x1'));var logger=require(_0x870e('0x2'))('api');var moment=require(_0x870e('0x3'));var BPromise=require(_0x870e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x870e('0x5'));var rimraf=require(_0x870e('0x6'));var config=require(_0x870e('0x7'));var attributes=require(_0x870e('0x8'));module[_0x870e('0x9')]=function(_0x4d9b50,_0x5df017){return _0x4d9b50['define']('Condition',attributes,{'tableName':_0x870e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/condition/condition.rpc.js b/server/api/condition/condition.rpc.js index f2a65a7..bd8d25c 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 _0x633c=['info','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','Condition,\x20%s,\x20%s','message','result','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then'];(function(_0x195a3b,_0x6e9cf1){var _0x3b915f=function(_0x89f215){while(--_0x89f215){_0x195a3b['push'](_0x195a3b['shift']());}};_0x3b915f(++_0x6e9cf1);}(_0x633c,0x16a));var _0xc633=function(_0x98d8c6,_0x477c92){_0x98d8c6=_0x98d8c6-0x0;var _0x296459=_0x633c[_0x98d8c6];return _0x296459;};'use strict';var _=require(_0xc633('0x0'));var util=require(_0xc633('0x1'));var moment=require(_0xc633('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc633('0x3'));var db=require(_0xc633('0x4'))['db'];var utils=require(_0xc633('0x5'));var logger=require(_0xc633('0x6'))(_0xc633('0x7'));var config=require(_0xc633('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc633('0x9')][_0xc633('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xfcd71b,_0x466e12,_0x462ade){return new BPromise(function(_0x45cf66,_0x5007f5){return client['request'](_0xfcd71b,_0x462ade)[_0xc633('0xb')](function(_0x48bce0){logger[_0xc633('0xc')]('Condition,\x20%s,\x20%s',_0x466e12,_0xc633('0xd'));logger[_0xc633('0xe')](_0xc633('0xf'),_0x466e12,_0xc633('0xd'),JSON[_0xc633('0x10')](_0x48bce0));if(_0x48bce0[_0xc633('0x11')]){if(_0x48bce0[_0xc633('0x11')][_0xc633('0x12')]===0x1f4){logger[_0xc633('0x11')](_0xc633('0x13'),_0x466e12,_0x48bce0[_0xc633('0x11')][_0xc633('0x14')]);return _0x5007f5(_0x48bce0[_0xc633('0x11')][_0xc633('0x14')]);}logger[_0xc633('0x11')](_0xc633('0x13'),_0x466e12,_0x48bce0['error'][_0xc633('0x14')]);return _0x45cf66(_0x48bce0['error'][_0xc633('0x14')]);}else{logger[_0xc633('0xc')]('Condition,\x20%s,\x20%s',_0x466e12,_0xc633('0xd'));_0x45cf66(_0x48bce0[_0xc633('0x15')][_0xc633('0x14')]);}})['catch'](function(_0x28ed1f){logger[_0xc633('0x11')](_0xc633('0x13'),_0x466e12,_0x28ed1f);_0x5007f5(_0x28ed1f);});});} \ No newline at end of file +var _0xd704=['../../config/logger','rpc','../../config/environment','client','http','request','request\x20sent','debug','stringify','code','error','message','Condition,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x416cdc,_0x213b87){var _0x1931ce=function(_0x1dc762){while(--_0x1dc762){_0x416cdc['push'](_0x416cdc['shift']());}};_0x1931ce(++_0x213b87);}(_0xd704,0x12d));var _0x4d70=function(_0x3b5b38,_0x430e11){_0x3b5b38=_0x3b5b38-0x0;var _0x50ac5e=_0xd704[_0x3b5b38];return _0x50ac5e;};'use strict';var _=require(_0x4d70('0x0'));var util=require(_0x4d70('0x1'));var moment=require('moment');var BPromise=require(_0x4d70('0x2'));var rs=require(_0x4d70('0x3'));var fs=require('fs');var Redis=require(_0x4d70('0x4'));var db=require(_0x4d70('0x5'))['db'];var utils=require(_0x4d70('0x6'));var logger=require(_0x4d70('0x7'))(_0x4d70('0x8'));var config=require(_0x4d70('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x4d70('0xa')][_0x4d70('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3732b5,_0x1b4737,_0x268623){return new BPromise(function(_0xa13998,_0x3c2f2b){return client[_0x4d70('0xc')](_0x3732b5,_0x268623)['then'](function(_0x415d2d){logger['info']('Condition,\x20%s,\x20%s',_0x1b4737,_0x4d70('0xd'));logger[_0x4d70('0xe')]('Condition,\x20%s,\x20%s,\x20%s',_0x1b4737,'request\x20sent',JSON[_0x4d70('0xf')](_0x415d2d));if(_0x415d2d['error']){if(_0x415d2d['error'][_0x4d70('0x10')]===0x1f4){logger[_0x4d70('0x11')]('Condition,\x20%s,\x20%s',_0x1b4737,_0x415d2d['error'][_0x4d70('0x12')]);return _0x3c2f2b(_0x415d2d[_0x4d70('0x11')][_0x4d70('0x12')]);}logger[_0x4d70('0x11')]('Condition,\x20%s,\x20%s',_0x1b4737,_0x415d2d['error'][_0x4d70('0x12')]);return _0xa13998(_0x415d2d[_0x4d70('0x11')]['message']);}else{logger['info'](_0x4d70('0x13'),_0x1b4737,_0x4d70('0xd'));_0xa13998(_0x415d2d[_0x4d70('0x14')][_0x4d70('0x12')]);}})[_0x4d70('0x15')](function(_0x2fd06c){logger[_0x4d70('0x11')](_0x4d70('0x13'),_0x1b4737,_0x2fd06c);_0x3c2f2b(_0x2fd06c);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 5ab66f4..d6740a6 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 _0xa451=['exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','put','isAuthenticated','update','delete','/:id','destroy'];(function(_0x59accf,_0x1d4650){var _0x47ade1=function(_0x2e1f94){while(--_0x2e1f94){_0x59accf['push'](_0x59accf['shift']());}};_0x47ade1(++_0x1d4650);}(_0xa451,0x187));var _0x1a45=function(_0x37f606,_0x4a4861){_0x37f606=_0x37f606-0x0;var _0x56452d=_0xa451[_0x37f606];return _0x56452d;};'use strict';var multer=require('multer');var util=require(_0x1a45('0x0'));var path=require(_0x1a45('0x1'));var timeout=require(_0x1a45('0x2'));var express=require(_0x1a45('0x3'));var router=express['Router']();var fs_extra=require(_0x1a45('0x4'));var auth=require(_0x1a45('0x5'));var interaction=require(_0x1a45('0x6'));var config=require(_0x1a45('0x7'));var controller=require('./condition.controller');router[_0x1a45('0x8')]('/:id',auth[_0x1a45('0x9')](),controller[_0x1a45('0xa')]);router[_0x1a45('0xb')](_0x1a45('0xc'),auth[_0x1a45('0x9')](),controller[_0x1a45('0xd')]);module[_0x1a45('0xe')]=router; \ No newline at end of file +var _0xf627=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','put','/:id','isAuthenticated','update','destroy','exports','multer','util'];(function(_0x4a5182,_0x135866){var _0x5c1ae5=function(_0x59eb7c){while(--_0x59eb7c){_0x4a5182['push'](_0x4a5182['shift']());}};_0x5c1ae5(++_0x135866);}(_0xf627,0x1a2));var _0x7f62=function(_0x4165a6,_0x26b88c){_0x4165a6=_0x4165a6-0x0;var _0x1a1054=_0xf627[_0x4165a6];return _0x1a1054;};'use strict';var multer=require(_0x7f62('0x0'));var util=require(_0x7f62('0x1'));var path=require('path');var timeout=require(_0x7f62('0x2'));var express=require(_0x7f62('0x3'));var router=express[_0x7f62('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7f62('0x5'));var interaction=require(_0x7f62('0x6'));var config=require(_0x7f62('0x7'));var controller=require(_0x7f62('0x8'));router[_0x7f62('0x9')](_0x7f62('0xa'),auth[_0x7f62('0xb')](),controller[_0x7f62('0xc')]);router['delete']('/:id',auth[_0x7f62('0xb')](),controller[_0x7f62('0xd')]);module[_0x7f62('0xe')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 1aee783..d45028f 100644 --- a/server/api/dashboard/dashboard.attributes.js +++ b/server/api/dashboard/dashboard.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x757a=['exports','STRING'];(function(_0x2094e5,_0x236265){var _0x21af38=function(_0x5a3751){while(--_0x5a3751){_0x2094e5['push'](_0x2094e5['shift']());}};_0x21af38(++_0x236265);}(_0x757a,0xde));var _0xa757=function(_0x582e42,_0x33e9ae){_0x582e42=_0x582e42-0x0;var _0x1e22b0=_0x757a[_0x582e42];return _0x1e22b0;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'name':{'type':Sequelize[_0xa757('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xbaf0=['name','exports','STRING'];(function(_0x152fe3,_0x12b0c8){var _0xc5bb39=function(_0x1fde42){while(--_0x1fde42){_0x152fe3['push'](_0x152fe3['shift']());}};_0xc5bb39(++_0x12b0c8);}(_0xbaf0,0x12a));var _0x0baf=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbaf0[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'name':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![],'unique':_0x0baf('0x2')},'description':{'type':Sequelize[_0x0baf('0x1')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 270edf4..bc808c1 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 _0xbe71=['attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','getItems','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','register','sendStatus','status','end','json','offset','undefined','count','Content-Range','apply','save','then','destroy','get','CustomDashboards','UserProfileResource','name','send','Dashboard','fieldName','type','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','userProfileId','iframe','attrUrl','attrs','https://','custom','value','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report'];(function(_0xf3782c,_0x324d78){var _0x58668d=function(_0x59f369){while(--_0x59f369){_0xf3782c['push'](_0xf3782c['shift']());}};_0x58668d(++_0x324d78);}(_0xbe71,0xfa));var _0x1be7=function(_0x412e7d,_0x3e72e6){_0x412e7d=_0x412e7d-0x0;var _0x2be1f5=_0xbe71[_0x412e7d];return _0x2be1f5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1be7('0x0'));var zipdir=require(_0x1be7('0x1'));var jsonpatch=require(_0x1be7('0x2'));var rp=require(_0x1be7('0x3'));var moment=require(_0x1be7('0x4'));var BPromise=require(_0x1be7('0x5'));var Mustache=require(_0x1be7('0x6'));var util=require(_0x1be7('0x7'));var path=require('path');var sox=require(_0x1be7('0x8'));var csv=require('to-csv');var ejs=require(_0x1be7('0x9'));var fs=require('fs');var fs_extra=require(_0x1be7('0xa'));var _=require('lodash');var squel=require(_0x1be7('0xb'));var crypto=require(_0x1be7('0xc'));var jsforce=require(_0x1be7('0xd'));var deskjs=require(_0x1be7('0xe'));var toCsv=require(_0x1be7('0xf'));var querystring=require(_0x1be7('0x10'));var Papa=require(_0x1be7('0x11'));var Redis=require(_0x1be7('0x12'));var authService=require(_0x1be7('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x1be7('0x14'));var hardwareService=require(_0x1be7('0x15'));var logger=require(_0x1be7('0x16'))(_0x1be7('0x17'));var utils=require(_0x1be7('0x18'));var config=require(_0x1be7('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x1be7('0x1a'))['db'];config[_0x1be7('0x1b')]=_[_0x1be7('0x1c')](config['redis'],{'host':_0x1be7('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1be7('0x1b')]));require('./dashboard.socket')[_0x1be7('0x1e')](socket);function respondWithStatusCode(_0x121fbb,_0xcd1504){_0xcd1504=_0xcd1504||0xcc;return function(_0x1f7ea3){if(_0x1f7ea3){return _0x121fbb[_0x1be7('0x1f')](_0xcd1504);}return _0x121fbb[_0x1be7('0x20')](_0xcd1504)[_0x1be7('0x21')]();};}function respondWithResult(_0x21a73e,_0x1facfd){_0x1facfd=_0x1facfd||0xc8;return function(_0x305869){if(_0x305869){return _0x21a73e[_0x1be7('0x20')](_0x1facfd)[_0x1be7('0x22')](_0x305869);}};}function respondWithFilteredResult(_0x442a02,_0x3837f2){return function(_0x2dceb7){if(_0x2dceb7){var _0x593cdf=typeof _0x3837f2[_0x1be7('0x23')]===_0x1be7('0x24')&&typeof _0x3837f2['limit']===_0x1be7('0x24');var _0x18a7d4=_0x2dceb7[_0x1be7('0x25')];var _0x1a1b9f=_0x593cdf?0x0:_0x3837f2[_0x1be7('0x23')];var _0xc1958a=_0x593cdf?_0x2dceb7[_0x1be7('0x25')]:_0x3837f2['offset']+_0x3837f2['limit'];var _0x2e49f3;if(_0xc1958a>=_0x18a7d4){_0xc1958a=_0x18a7d4;_0x2e49f3=0xc8;}else{_0x2e49f3=0xce;}_0x442a02[_0x1be7('0x20')](_0x2e49f3);return _0x442a02['set'](_0x1be7('0x26'),_0x1a1b9f+'-'+_0xc1958a+'/'+_0x18a7d4)['json'](_0x2dceb7);}return null;};}function patchUpdates(_0xb9368a){return function(_0x15394d){try{jsonpatch[_0x1be7('0x27')](_0x15394d,_0xb9368a,!![]);}catch(_0x2a97f7){return BPromise['reject'](_0x2a97f7);}return _0x15394d[_0x1be7('0x28')]();};}function saveUpdates(_0xc0522b,_0x10570e){return function(_0x289607){if(_0x289607){return _0x289607['update'](_0xc0522b)[_0x1be7('0x29')](function(_0xedc638){return _0xedc638;});}return null;};}function removeEntity(_0x57f47d,_0x38ec55){return function(_0x278652){if(_0x278652){return _0x278652[_0x1be7('0x2a')]()[_0x1be7('0x29')](function(){var _0x3a28bb=_0x278652[_0x1be7('0x2b')]({'plain':!![]});var _0x465b7e=_0x1be7('0x2c');return db[_0x1be7('0x2d')][_0x1be7('0x2a')]({'where':{'type':_0x465b7e,'resourceId':_0x3a28bb['id']}})[_0x1be7('0x29')](function(){return _0x278652;});})[_0x1be7('0x29')](function(){_0x57f47d['status'](0xcc)[_0x1be7('0x21')]();});}};}function handleEntityNotFound(_0x301848,_0x368e31){return function(_0x4f36db){if(!_0x4f36db){_0x301848[_0x1be7('0x1f')](0x194);}return _0x4f36db;};}function handleError(_0x5a5867,_0x310ad0){_0x310ad0=_0x310ad0||0x1f4;return function(_0x3175ff){logger['error'](_0x3175ff['stack']);if(_0x3175ff[_0x1be7('0x2e')]){delete _0x3175ff[_0x1be7('0x2e')];}_0x5a5867[_0x1be7('0x20')](_0x310ad0)[_0x1be7('0x2f')](_0x3175ff);};}exports['index']=function(_0x566a20,_0x4bdda6){var _0x4333ea={},_0x5ddb36={},_0x11ef59={'count':0x0,'rows':[]};var _0xe471a2=_['map'](db[_0x1be7('0x30')]['rawAttributes'],function(_0x405e6a){return{'name':_0x405e6a[_0x1be7('0x31')],'type':_0x405e6a[_0x1be7('0x32')]['key']};});_0x5ddb36['model']=_[_0x1be7('0x33')](_0xe471a2,_0x1be7('0x2e'));_0x5ddb36[_0x1be7('0x34')]=_[_0x1be7('0x35')](_0x566a20[_0x1be7('0x34')]);_0x5ddb36[_0x1be7('0x36')]=_[_0x1be7('0x37')](_0x5ddb36[_0x1be7('0x38')],_0x5ddb36[_0x1be7('0x34')]);_0x4333ea[_0x1be7('0x39')]=_[_0x1be7('0x37')](_0x5ddb36[_0x1be7('0x38')],qs[_0x1be7('0x3a')](_0x566a20[_0x1be7('0x34')]['fields']));_0x4333ea[_0x1be7('0x39')]=_0x4333ea[_0x1be7('0x39')][_0x1be7('0x3b')]?_0x4333ea['attributes']:_0x5ddb36[_0x1be7('0x38')];if(!_0x566a20['query'][_0x1be7('0x3c')](_0x1be7('0x3d'))){_0x4333ea[_0x1be7('0x3e')]=qs[_0x1be7('0x3e')](_0x566a20[_0x1be7('0x34')][_0x1be7('0x3e')]);_0x4333ea[_0x1be7('0x23')]=qs['offset'](_0x566a20[_0x1be7('0x34')][_0x1be7('0x23')]);}_0x4333ea[_0x1be7('0x3f')]=qs[_0x1be7('0x40')](_0x566a20[_0x1be7('0x34')]['sort']);_0x4333ea[_0x1be7('0x41')]=qs[_0x1be7('0x36')](_[_0x1be7('0x42')](_0x566a20[_0x1be7('0x34')],_0x5ddb36[_0x1be7('0x36')]),_0xe471a2);if(_0x566a20[_0x1be7('0x34')][_0x1be7('0x43')]){_0x4333ea[_0x1be7('0x41')]=_['merge'](_0x4333ea[_0x1be7('0x41')],{'$or':_[_0x1be7('0x33')](_0xe471a2,function(_0x4e87e1){if(_0x4e87e1[_0x1be7('0x32')]!=='VIRTUAL'){var _0x152d7b={};_0x152d7b[_0x4e87e1[_0x1be7('0x2e')]]={'$like':'%'+_0x566a20[_0x1be7('0x34')][_0x1be7('0x43')]+'%'};return _0x152d7b;}})});}_0x4333ea=_[_0x1be7('0x44')]({},_0x4333ea,_0x566a20[_0x1be7('0x45')]);var _0x383d30={'where':_0x4333ea[_0x1be7('0x41')]};return db[_0x1be7('0x30')][_0x1be7('0x25')](_0x383d30)['then'](function(_0x3a781d){_0x11ef59['count']=_0x3a781d;if(_0x566a20['query'][_0x1be7('0x46')]){_0x4333ea[_0x1be7('0x47')]=[{'all':!![]}];}return db[_0x1be7('0x30')][_0x1be7('0x48')](_0x4333ea);})[_0x1be7('0x29')](function(_0x43fd59){_0x11ef59[_0x1be7('0x49')]=_0x43fd59;return _0x11ef59;})[_0x1be7('0x29')](respondWithFilteredResult(_0x4bdda6,_0x4333ea))['catch'](handleError(_0x4bdda6,null));};exports[_0x1be7('0x4a')]=function(_0x1e5ae5,_0x59e2ae){var _0x163c74={'raw':![],'where':{'id':_0x1e5ae5[_0x1be7('0x4b')]['id']}},_0x13de0f={};_0x13de0f[_0x1be7('0x38')]=_[_0x1be7('0x35')](db[_0x1be7('0x30')][_0x1be7('0x4c')]);_0x13de0f[_0x1be7('0x34')]=_[_0x1be7('0x35')](_0x1e5ae5[_0x1be7('0x34')]);_0x13de0f[_0x1be7('0x36')]=_[_0x1be7('0x37')](_0x13de0f[_0x1be7('0x38')],_0x13de0f[_0x1be7('0x34')]);_0x163c74[_0x1be7('0x39')]=_[_0x1be7('0x37')](_0x13de0f[_0x1be7('0x38')],qs[_0x1be7('0x3a')](_0x1e5ae5[_0x1be7('0x34')][_0x1be7('0x3a')]));_0x163c74[_0x1be7('0x39')]=_0x163c74[_0x1be7('0x39')][_0x1be7('0x3b')]?_0x163c74[_0x1be7('0x39')]:_0x13de0f[_0x1be7('0x38')];if(_0x1e5ae5[_0x1be7('0x34')]['includeAll']){_0x163c74[_0x1be7('0x47')]=[{'all':!![]}];}_0x163c74=_[_0x1be7('0x44')]({},_0x163c74,_0x1e5ae5[_0x1be7('0x45')]);return db['Dashboard'][_0x1be7('0x4d')](_0x163c74)[_0x1be7('0x29')](handleEntityNotFound(_0x59e2ae,null))[_0x1be7('0x29')](respondWithResult(_0x59e2ae,null))[_0x1be7('0x4e')](handleError(_0x59e2ae,null));};exports[_0x1be7('0x4f')]=function(_0x235063,_0x5d1da6){return db[_0x1be7('0x30')]['create'](_0x235063[_0x1be7('0x50')],{})[_0x1be7('0x29')](function(_0x18a363){var _0x4417d7=_0x235063[_0x1be7('0x51')][_0x1be7('0x2b')]({'plain':!![]});if(!_0x4417d7)throw new Error(_0x1be7('0x52'));if(_0x4417d7[_0x1be7('0x53')]===_0x1be7('0x51')){var _0xaad3a6=_0x18a363['get']({'plain':!![]});var _0x39cd18=_0x1be7('0x2c');return db[_0x1be7('0x54')][_0x1be7('0x4d')]({'where':{'name':_0x39cd18,'userProfileId':_0x4417d7['userProfileId']},'raw':!![]})[_0x1be7('0x29')](function(_0x1a3d71){if(_0x1a3d71&&_0x1a3d71[_0x1be7('0x55')]===0x0){return db[_0x1be7('0x2d')][_0x1be7('0x4f')]({'name':_0xaad3a6[_0x1be7('0x2e')],'resourceId':_0xaad3a6['id'],'type':_0x1a3d71[_0x1be7('0x2e')],'sectionId':_0x1a3d71['id']},{})[_0x1be7('0x29')](function(){return _0x18a363;});}else{return _0x18a363;}})['catch'](function(_0x3050e9){logger[_0x1be7('0x56')](_0x1be7('0x57'),_0x3050e9);throw _0x3050e9;});}return _0x18a363;})['then'](respondWithResult(_0x5d1da6,0xc9))[_0x1be7('0x4e')](handleError(_0x5d1da6,null));};exports['clone']=function(_0xc75350,_0x333f4e){var _0x24b0a1={'where':{'id':_0xc75350['params']['id']}},_0x3ab5e1={};_0x3ab5e1[_0x1be7('0x38')]=_[_0x1be7('0x35')](db[_0x1be7('0x30')][_0x1be7('0x4c')]);_0x24b0a1['attributes']=_[_0x1be7('0x37')](_0x3ab5e1[_0x1be7('0x38')],qs['fields'](_0xc75350[_0x1be7('0x34')][_0x1be7('0x3a')]));_0x24b0a1[_0x1be7('0x39')]=_0x24b0a1[_0x1be7('0x39')][_0x1be7('0x3b')]?_0x24b0a1[_0x1be7('0x39')]:_0x3ab5e1[_0x1be7('0x38')];if(_0xc75350[_0x1be7('0x34')][_0x1be7('0x46')]){_0x24b0a1[_0x1be7('0x47')]=[{'all':!![]}];}_0x24b0a1=_['merge']({},_0x24b0a1,_0xc75350[_0x1be7('0x45')]);return db['Dashboard'][_0x1be7('0x4d')](_0x24b0a1)[_0x1be7('0x29')](handleEntityNotFound(_0x333f4e,null))['then'](function(_0x151cdd){if(_0x151cdd){var _0x11990e=_0x151cdd[_0x1be7('0x2b')]({'plain':!![]});_0x11990e=qs[_0x1be7('0x58')](_0x11990e,['id',_0x1be7('0x59'),_0x1be7('0x5a')]);_0xc75350['body']=_[_0x1be7('0x58')](_0xc75350[_0x1be7('0x50')],['id',_0x1be7('0x59'),_0x1be7('0x5a')]);return db[_0x1be7('0x30')]['create'](_[_0x1be7('0x44')](_0x11990e,_0xc75350[_0x1be7('0x50')]),{'include':_0xc75350[_0x1be7('0x34')][_0x1be7('0x46')]?[{'all':!![]}]:undefined})[_0x1be7('0x29')](function(_0x551a56){var _0x2e756c=_0xc75350[_0x1be7('0x51')][_0x1be7('0x2b')]({'plain':!![]});if(!_0x2e756c)throw new Error(_0x1be7('0x52'));if(_0x2e756c[_0x1be7('0x53')]==='user'){var _0x1902f5=_0x551a56[_0x1be7('0x2b')]({'plain':!![]});var _0x15975d=_0x1be7('0x2c');return db[_0x1be7('0x54')][_0x1be7('0x4d')]({'where':{'name':_0x15975d,'userProfileId':_0x2e756c[_0x1be7('0x5b')]},'raw':!![]})[_0x1be7('0x29')](function(_0x58ff72){if(_0x58ff72&&_0x58ff72[_0x1be7('0x55')]===0x0){return db[_0x1be7('0x2d')][_0x1be7('0x4f')]({'name':_0x1902f5[_0x1be7('0x2e')],'resourceId':_0x1902f5['id'],'type':_0x58ff72[_0x1be7('0x2e')],'sectionId':_0x58ff72['id']},{})[_0x1be7('0x29')](function(){return _0x551a56;});}else{return _0x551a56;}})[_0x1be7('0x4e')](function(_0x5a8478){logger[_0x1be7('0x56')](_0x1be7('0x57'),_0x5a8478);throw _0x5a8478;});}return _0x551a56;});}})[_0x1be7('0x29')](respondWithResult(_0x333f4e,0xc9))[_0x1be7('0x4e')](handleError(_0x333f4e,null));};exports['update']=function(_0x44bb63,_0x23922a){if(_0x44bb63[_0x1be7('0x50')]['id']){delete _0x44bb63[_0x1be7('0x50')]['id'];}return db[_0x1be7('0x30')][_0x1be7('0x4d')]({'where':{'id':_0x44bb63[_0x1be7('0x4b')]['id']}})[_0x1be7('0x29')](handleEntityNotFound(_0x23922a,null))[_0x1be7('0x29')](saveUpdates(_0x44bb63[_0x1be7('0x50')],null))[_0x1be7('0x29')](respondWithResult(_0x23922a,null))[_0x1be7('0x4e')](handleError(_0x23922a,null));};exports[_0x1be7('0x2a')]=function(_0x587d7f,_0x46f8b7){return db[_0x1be7('0x30')][_0x1be7('0x4d')]({'where':{'id':_0x587d7f[_0x1be7('0x4b')]['id']}})[_0x1be7('0x29')](handleEntityNotFound(_0x46f8b7,null))[_0x1be7('0x29')](removeEntity(_0x46f8b7,null))[_0x1be7('0x4e')](handleError(_0x46f8b7,null));};function widgetAttributes(_0xda50){try{switch(_0xda50[_0x1be7('0x32')]){case _0x1be7('0x5c'):return[{'name':_0x1be7('0x5d'),'value':_0xda50['attrUrl']||(_0xda50['attrs']&&_0xda50[_0x1be7('0x5e')][0x0]?_0xda50['attrs'][0x0]['value']:undefined)||_0x1be7('0x5f')}];case _0x1be7('0x60'):return[{'name':'attrPath','value':_0xda50['attrPath']||(_0xda50[_0x1be7('0x5e')]&&_0xda50[_0x1be7('0x5e')][0x0]?_0xda50[_0x1be7('0x5e')][0x0][_0x1be7('0x61')]:undefined)||''}];case _0x1be7('0x62'):return[{'name':_0x1be7('0x63'),'value':_0xda50['attrHourFormat']||(_0xda50[_0x1be7('0x5e')]&&_0xda50[_0x1be7('0x5e')][0x0]?_0xda50[_0x1be7('0x5e')][0x0][_0x1be7('0x61')]:undefined)||'HH:mm:ss'},{'name':_0x1be7('0x64'),'value':_0xda50[_0x1be7('0x64')]||(_0xda50[_0x1be7('0x5e')]&&_0xda50['attrs'][0x1]?_0xda50['attrs'][0x1][_0x1be7('0x61')]:undefined)||_0x1be7('0x65')},{'name':'attrFontSize','value':_0xda50[_0x1be7('0x66')]||(_0xda50[_0x1be7('0x5e')]&&_0xda50[_0x1be7('0x5e')][0x2]?_0xda50['attrs'][0x2][_0x1be7('0x61')]:undefined)||0xc}];case _0x1be7('0x67'):return[{'name':_0x1be7('0x68'),'value':_0xda50[_0x1be7('0x68')]||(_0xda50['attrs']&&_0xda50['attrs'][0x0]?_0xda50[_0x1be7('0x5e')][0x0][_0x1be7('0x61')]:undefined)||_0x1be7('0x69')},{'name':_0x1be7('0x6a'),'value':_0xda50[_0x1be7('0x6a')]||(_0xda50[_0x1be7('0x5e')]&&_0xda50[_0x1be7('0x5e')][0x1]?_0xda50['attrs'][0x1][_0x1be7('0x61')]:undefined)||[]},{'name':'attrFontSize','value':_0xda50[_0x1be7('0x66')]||(_0xda50[_0x1be7('0x5e')]&&_0xda50[_0x1be7('0x5e')][0x2]?_0xda50[_0x1be7('0x5e')][0x2]['value']:undefined)||0x14}];case _0x1be7('0x6b'):case _0x1be7('0x6c'):return[{'name':_0x1be7('0x6d'),'value':_0xda50['attrSerie1']||(_0xda50['attrs']&&_0xda50[_0x1be7('0x5e')][0x0]?_0xda50['attrs'][0x0][_0x1be7('0x61')]:undefined)||_0x1be7('0x69')},{'name':_0x1be7('0x6e'),'value':_0xda50[_0x1be7('0x6e')]||(_0xda50[_0x1be7('0x5e')]&&_0xda50[_0x1be7('0x5e')][0x1]?_0xda50[_0x1be7('0x5e')][0x1][_0x1be7('0x61')]:undefined)||null},{'name':'attrSerie3','value':_0xda50[_0x1be7('0x6f')]||(_0xda50[_0x1be7('0x5e')]&&_0xda50['attrs'][0x2]?_0xda50[_0x1be7('0x5e')][0x2]['value']:undefined)||null},{'name':_0x1be7('0x6a'),'value':_0xda50['attrVoiceQueues']||(_0xda50['attrs']&&_0xda50[_0x1be7('0x5e')][0x3]?_0xda50[_0x1be7('0x5e')][0x3][_0x1be7('0x61')]:undefined)||[]}];case _0x1be7('0x70'):return[{'name':'attrReport','type':_0xda50['reportType']||(_0xda50[_0x1be7('0x5e')]&&_0xda50['attrs'][0x0]?_0xda50[_0x1be7('0x5e')][0x0][_0x1be7('0x32')]:undefined)||null,'value':_0xda50[_0x1be7('0x71')]||(_0xda50['attrs']&&_0xda50[_0x1be7('0x5e')][0x0]?_0xda50[_0x1be7('0x5e')][0x0][_0x1be7('0x61')]:undefined)||null},{'name':_0x1be7('0x72'),'value':_0xda50[_0x1be7('0x72')]||(_0xda50[_0x1be7('0x5e')]&&_0xda50[_0x1be7('0x5e')][0x1]?_0xda50['attrs'][0x1][_0x1be7('0x61')]:undefined)||0x0}];default:return[];}}catch(_0x16a512){logger[_0x1be7('0x56')](_0x1be7('0x73'),JSON[_0x1be7('0x74')](_0x16a512));return[];}}exports[_0x1be7('0x75')]=function(_0x5d0915,_0x3798d9,_0x20bd07){if(_0x5d0915[_0x1be7('0x50')]['id']){delete _0x5d0915[_0x1be7('0x50')]['id'];}return db[_0x1be7('0x30')][_0x1be7('0x4d')]({'where':{'id':_0x5d0915[_0x1be7('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3798d9,null))[_0x1be7('0x29')](function(_0x12d8a3){if(_0x12d8a3){_0x5d0915[_0x1be7('0x50')][_0x1be7('0x76')]=_0x12d8a3['id'];_0x5d0915['body'][_0x1be7('0x5e')]=widgetAttributes(_0x5d0915['body']);return db[_0x1be7('0x77')][_0x1be7('0x4f')](_0x5d0915['body']);}})[_0x1be7('0x29')](respondWithResult(_0x3798d9,null))[_0x1be7('0x4e')](handleError(_0x3798d9,null));};exports[_0x1be7('0x78')]=function(_0x35ebb9,_0x1e83ea,_0xca2373){var _0x4e0b5a={};var _0x907282={};var _0x2f4829;var _0x5f1c3a;return db[_0x1be7('0x30')]['findOne']({'where':{'id':_0x35ebb9[_0x1be7('0x4b')]['id']}})[_0x1be7('0x29')](handleEntityNotFound(_0x1e83ea,null))['then'](function(_0x39f300){if(_0x39f300){_0x2f4829=_0x39f300;_0x907282[_0x1be7('0x38')]=_[_0x1be7('0x35')](db[_0x1be7('0x77')][_0x1be7('0x4c')]);_0x907282[_0x1be7('0x34')]=_['keys'](_0x35ebb9[_0x1be7('0x34')]);_0x907282[_0x1be7('0x36')]=_[_0x1be7('0x37')](_0x907282['model'],_0x907282[_0x1be7('0x34')]);_0x4e0b5a[_0x1be7('0x39')]=_[_0x1be7('0x37')](_0x907282['model'],qs[_0x1be7('0x3a')](_0x35ebb9[_0x1be7('0x34')][_0x1be7('0x3a')]));_0x4e0b5a[_0x1be7('0x39')]=_0x4e0b5a['attributes'][_0x1be7('0x3b')]?_0x4e0b5a[_0x1be7('0x39')]:_0x907282[_0x1be7('0x38')];_0x4e0b5a[_0x1be7('0x3f')]=qs[_0x1be7('0x40')](_0x35ebb9['query'][_0x1be7('0x40')]);_0x4e0b5a['where']=qs[_0x1be7('0x36')](_[_0x1be7('0x42')](_0x35ebb9[_0x1be7('0x34')],_0x907282[_0x1be7('0x36')]));if(_0x35ebb9[_0x1be7('0x34')][_0x1be7('0x43')]){_0x4e0b5a['where']=_[_0x1be7('0x44')](_0x4e0b5a[_0x1be7('0x41')],{'$or':_[_0x1be7('0x33')](_0x4e0b5a[_0x1be7('0x39')],function(_0x2598c7){var _0x50c7ca={};_0x50c7ca[_0x2598c7]={'$like':'%'+_0x35ebb9[_0x1be7('0x34')][_0x1be7('0x43')]+'%'};return _0x50c7ca;})});}_0x4e0b5a=_['merge']({},_0x4e0b5a,_0x35ebb9[_0x1be7('0x45')]);return _0x2f4829[_0x1be7('0x78')](_0x4e0b5a);}})[_0x1be7('0x29')](function(_0x3c5dfd){if(_0x3c5dfd){_0x5f1c3a=_0x3c5dfd[_0x1be7('0x3b')];if(!_0x35ebb9[_0x1be7('0x34')]['hasOwnProperty'](_0x1be7('0x3d'))){_0x4e0b5a[_0x1be7('0x3e')]=qs[_0x1be7('0x3e')](_0x35ebb9['query'][_0x1be7('0x3e')]);_0x4e0b5a[_0x1be7('0x23')]=qs[_0x1be7('0x23')](_0x35ebb9[_0x1be7('0x34')][_0x1be7('0x23')]);}return _0x2f4829[_0x1be7('0x78')](_0x4e0b5a);}})['then'](function(_0x25b6e7){if(_0x25b6e7){return _0x25b6e7?{'count':_0x5f1c3a,'rows':_0x25b6e7}:null;}})[_0x1be7('0x29')](respondWithResult(_0x1e83ea,null))[_0x1be7('0x4e')](handleError(_0x1e83ea,null));}; \ No newline at end of file +var _0x33a7=['pie-chart','attrSerie1','total','attrSerie3','web-report','attrReport','reportType','attrRefresh','error','widgetAttributes:\x20%s','addItem','DashboardId','getItems','DashboardItem','order','hasOwnProperty','nolimit','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','./dashboard.socket','register','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','CustomDashboards','UserProfileResource','destroy','stack','name','map','Dashboard','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','sort','pick','filter','merge','where','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','iframe','attrUrl','value','https://','attrPath','attrs','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','attrMetric','attrVoiceQueues','multibar-chart'];(function(_0x7801d3,_0x2c0334){var _0x3496f2=function(_0x306a9c){while(--_0x306a9c){_0x7801d3['push'](_0x7801d3['shift']());}};_0x3496f2(++_0x2c0334);}(_0x33a7,0xfd));var _0x733a=function(_0x131fe7,_0x21fcdb){_0x131fe7=_0x131fe7-0x0;var _0x2eddf3=_0x33a7[_0x131fe7];return _0x2eddf3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x733a('0x0'));var zipdir=require(_0x733a('0x1'));var jsonpatch=require(_0x733a('0x2'));var rp=require(_0x733a('0x3'));var moment=require(_0x733a('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x733a('0x5'));var sox=require(_0x733a('0x6'));var csv=require('to-csv');var ejs=require(_0x733a('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x733a('0x8'));var squel=require(_0x733a('0x9'));var crypto=require('crypto');var jsforce=require(_0x733a('0xa'));var deskjs=require(_0x733a('0xb'));var toCsv=require(_0x733a('0xc'));var querystring=require(_0x733a('0xd'));var Papa=require('papaparse');var Redis=require(_0x733a('0xe'));var authService=require(_0x733a('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x733a('0x10'));var logger=require(_0x733a('0x11'))(_0x733a('0x12'));var utils=require(_0x733a('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x733a('0x14'))['db'];config[_0x733a('0x15')]=_[_0x733a('0x16')](config[_0x733a('0x15')],{'host':_0x733a('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x733a('0x15')]));require(_0x733a('0x18'))[_0x733a('0x19')](socket);function respondWithStatusCode(_0x4acecb,_0x529c4a){_0x529c4a=_0x529c4a||0xcc;return function(_0x56d778){if(_0x56d778){return _0x4acecb[_0x733a('0x1a')](_0x529c4a);}return _0x4acecb['status'](_0x529c4a)[_0x733a('0x1b')]();};}function respondWithResult(_0x130565,_0xef1724){_0xef1724=_0xef1724||0xc8;return function(_0x4ac60e){if(_0x4ac60e){return _0x130565[_0x733a('0x1c')](_0xef1724)[_0x733a('0x1d')](_0x4ac60e);}};}function respondWithFilteredResult(_0x25d696,_0x12f692){return function(_0x3a96fb){if(_0x3a96fb){var _0x5031b2=typeof _0x12f692[_0x733a('0x1e')]===_0x733a('0x1f')&&typeof _0x12f692['limit']===_0x733a('0x1f');var _0x32b365=_0x3a96fb[_0x733a('0x20')];var _0x3309ef=_0x5031b2?0x0:_0x12f692[_0x733a('0x1e')];var _0x341dc8=_0x5031b2?_0x3a96fb['count']:_0x12f692[_0x733a('0x1e')]+_0x12f692[_0x733a('0x21')];var _0x3a2db0;if(_0x341dc8>=_0x32b365){_0x341dc8=_0x32b365;_0x3a2db0=0xc8;}else{_0x3a2db0=0xce;}_0x25d696[_0x733a('0x1c')](_0x3a2db0);return _0x25d696[_0x733a('0x22')](_0x733a('0x23'),_0x3309ef+'-'+_0x341dc8+'/'+_0x32b365)[_0x733a('0x1d')](_0x3a96fb);}return null;};}function patchUpdates(_0x2672ef){return function(_0x2f43bc){try{jsonpatch[_0x733a('0x24')](_0x2f43bc,_0x2672ef,!![]);}catch(_0x162c82){return BPromise[_0x733a('0x25')](_0x162c82);}return _0x2f43bc[_0x733a('0x26')]();};}function saveUpdates(_0x3ed25a,_0x890452){return function(_0x2cfe6c){if(_0x2cfe6c){return _0x2cfe6c[_0x733a('0x27')](_0x3ed25a)[_0x733a('0x28')](function(_0x3a0637){return _0x3a0637;});}return null;};}function removeEntity(_0x12d95e,_0x39f15c){return function(_0x21c1be){if(_0x21c1be){return _0x21c1be['destroy']()['then'](function(){var _0x48744f=_0x21c1be['get']({'plain':!![]});var _0x13a574=_0x733a('0x29');return db[_0x733a('0x2a')][_0x733a('0x2b')]({'where':{'type':_0x13a574,'resourceId':_0x48744f['id']}})[_0x733a('0x28')](function(){return _0x21c1be;});})['then'](function(){_0x12d95e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3cfc19,_0x5159d5){return function(_0x44e7b9){if(!_0x44e7b9){_0x3cfc19[_0x733a('0x1a')](0x194);}return _0x44e7b9;};}function handleError(_0x35ba71,_0x36e72d){_0x36e72d=_0x36e72d||0x1f4;return function(_0x153b0e){logger['error'](_0x153b0e[_0x733a('0x2c')]);if(_0x153b0e[_0x733a('0x2d')]){delete _0x153b0e[_0x733a('0x2d')];}_0x35ba71['status'](_0x36e72d)['send'](_0x153b0e);};}exports['index']=function(_0x9eb744,_0x148eb8){var _0x269e7d={},_0x487d66={},_0x54c6a5={'count':0x0,'rows':[]};var _0xaf612d=_[_0x733a('0x2e')](db[_0x733a('0x2f')][_0x733a('0x30')],function(_0x21fe45){return{'name':_0x21fe45[_0x733a('0x31')],'type':_0x21fe45['type']['key']};});_0x487d66[_0x733a('0x32')]=_[_0x733a('0x2e')](_0xaf612d,'name');_0x487d66[_0x733a('0x33')]=_[_0x733a('0x34')](_0x9eb744[_0x733a('0x33')]);_0x487d66[_0x733a('0x35')]=_[_0x733a('0x36')](_0x487d66[_0x733a('0x32')],_0x487d66[_0x733a('0x33')]);_0x269e7d[_0x733a('0x37')]=_[_0x733a('0x36')](_0x487d66[_0x733a('0x32')],qs[_0x733a('0x38')](_0x9eb744['query'][_0x733a('0x38')]));_0x269e7d['attributes']=_0x269e7d[_0x733a('0x37')][_0x733a('0x39')]?_0x269e7d['attributes']:_0x487d66[_0x733a('0x32')];if(!_0x9eb744['query']['hasOwnProperty']('nolimit')){_0x269e7d['limit']=qs[_0x733a('0x21')](_0x9eb744[_0x733a('0x33')][_0x733a('0x21')]);_0x269e7d[_0x733a('0x1e')]=qs['offset'](_0x9eb744[_0x733a('0x33')][_0x733a('0x1e')]);}_0x269e7d['order']=qs['sort'](_0x9eb744[_0x733a('0x33')][_0x733a('0x3a')]);_0x269e7d['where']=qs[_0x733a('0x35')](_[_0x733a('0x3b')](_0x9eb744['query'],_0x487d66[_0x733a('0x35')]),_0xaf612d);if(_0x9eb744[_0x733a('0x33')][_0x733a('0x3c')]){_0x269e7d['where']=_[_0x733a('0x3d')](_0x269e7d[_0x733a('0x3e')],{'$or':_[_0x733a('0x2e')](_0xaf612d,function(_0x5eac59){if(_0x5eac59[_0x733a('0x3f')]!==_0x733a('0x40')){var _0x4e2596={};_0x4e2596[_0x5eac59[_0x733a('0x2d')]]={'$like':'%'+_0x9eb744[_0x733a('0x33')][_0x733a('0x3c')]+'%'};return _0x4e2596;}})});}_0x269e7d=_['merge']({},_0x269e7d,_0x9eb744[_0x733a('0x41')]);var _0x2b4882={'where':_0x269e7d[_0x733a('0x3e')]};return db[_0x733a('0x2f')][_0x733a('0x20')](_0x2b4882)[_0x733a('0x28')](function(_0x2bb7f6){_0x54c6a5[_0x733a('0x20')]=_0x2bb7f6;if(_0x9eb744[_0x733a('0x33')][_0x733a('0x42')]){_0x269e7d['include']=[{'all':!![]}];}return db[_0x733a('0x2f')][_0x733a('0x43')](_0x269e7d);})[_0x733a('0x28')](function(_0x557876){_0x54c6a5[_0x733a('0x44')]=_0x557876;return _0x54c6a5;})[_0x733a('0x28')](respondWithFilteredResult(_0x148eb8,_0x269e7d))[_0x733a('0x45')](handleError(_0x148eb8,null));};exports[_0x733a('0x46')]=function(_0x5a788b,_0x267706){var _0x988be5={'raw':![],'where':{'id':_0x5a788b[_0x733a('0x47')]['id']}},_0x54c815={};_0x54c815[_0x733a('0x32')]=_['keys'](db[_0x733a('0x2f')][_0x733a('0x30')]);_0x54c815[_0x733a('0x33')]=_[_0x733a('0x34')](_0x5a788b[_0x733a('0x33')]);_0x54c815['filters']=_[_0x733a('0x36')](_0x54c815[_0x733a('0x32')],_0x54c815[_0x733a('0x33')]);_0x988be5[_0x733a('0x37')]=_[_0x733a('0x36')](_0x54c815[_0x733a('0x32')],qs['fields'](_0x5a788b[_0x733a('0x33')][_0x733a('0x38')]));_0x988be5[_0x733a('0x37')]=_0x988be5['attributes'][_0x733a('0x39')]?_0x988be5[_0x733a('0x37')]:_0x54c815[_0x733a('0x32')];if(_0x5a788b[_0x733a('0x33')][_0x733a('0x42')]){_0x988be5[_0x733a('0x48')]=[{'all':!![]}];}_0x988be5=_[_0x733a('0x3d')]({},_0x988be5,_0x5a788b['options']);return db['Dashboard'][_0x733a('0x49')](_0x988be5)['then'](handleEntityNotFound(_0x267706,null))[_0x733a('0x28')](respondWithResult(_0x267706,null))['catch'](handleError(_0x267706,null));};exports[_0x733a('0x4a')]=function(_0x336183,_0x22398f){return db[_0x733a('0x2f')][_0x733a('0x4a')](_0x336183[_0x733a('0x4b')],{})[_0x733a('0x28')](function(_0x1a4fa7){var _0xcbbe2d=_0x336183[_0x733a('0x4c')][_0x733a('0x4d')]({'plain':!![]});if(!_0xcbbe2d)throw new Error(_0x733a('0x4e'));if(_0xcbbe2d[_0x733a('0x4f')]===_0x733a('0x4c')){var _0x5d3f66=_0x1a4fa7[_0x733a('0x4d')]({'plain':!![]});var _0xc22e50=_0x733a('0x29');return db[_0x733a('0x50')][_0x733a('0x49')]({'where':{'name':_0xc22e50,'userProfileId':_0xcbbe2d[_0x733a('0x51')]},'raw':!![]})['then'](function(_0x451b9e){if(_0x451b9e&&_0x451b9e[_0x733a('0x52')]===0x0){return db['UserProfileResource'][_0x733a('0x4a')]({'name':_0x5d3f66[_0x733a('0x2d')],'resourceId':_0x5d3f66['id'],'type':_0x451b9e[_0x733a('0x2d')],'sectionId':_0x451b9e['id']},{})[_0x733a('0x28')](function(){return _0x1a4fa7;});}else{return _0x1a4fa7;}})[_0x733a('0x45')](function(_0x20eda1){logger['error'](_0x733a('0x53'),_0x20eda1);throw _0x20eda1;});}return _0x1a4fa7;})['then'](respondWithResult(_0x22398f,0xc9))[_0x733a('0x45')](handleError(_0x22398f,null));};exports['clone']=function(_0x55ac19,_0x30cf8c){var _0x5b9740={'where':{'id':_0x55ac19[_0x733a('0x47')]['id']}},_0x3c7fe5={};_0x3c7fe5['model']=_[_0x733a('0x34')](db['Dashboard']['rawAttributes']);_0x5b9740[_0x733a('0x37')]=_[_0x733a('0x36')](_0x3c7fe5[_0x733a('0x32')],qs[_0x733a('0x38')](_0x55ac19['query'][_0x733a('0x38')]));_0x5b9740[_0x733a('0x37')]=_0x5b9740[_0x733a('0x37')][_0x733a('0x39')]?_0x5b9740[_0x733a('0x37')]:_0x3c7fe5[_0x733a('0x32')];if(_0x55ac19[_0x733a('0x33')]['includeAll']){_0x5b9740[_0x733a('0x48')]=[{'all':!![]}];}_0x5b9740=_[_0x733a('0x3d')]({},_0x5b9740,_0x55ac19[_0x733a('0x41')]);return db['Dashboard'][_0x733a('0x49')](_0x5b9740)[_0x733a('0x28')](handleEntityNotFound(_0x30cf8c,null))['then'](function(_0x43f7d0){if(_0x43f7d0){var _0x5a2dfe=_0x43f7d0['get']({'plain':!![]});_0x5a2dfe=qs[_0x733a('0x54')](_0x5a2dfe,['id',_0x733a('0x55'),_0x733a('0x56')]);_0x55ac19[_0x733a('0x4b')]=_[_0x733a('0x54')](_0x55ac19[_0x733a('0x4b')],['id',_0x733a('0x55'),_0x733a('0x56')]);return db[_0x733a('0x2f')]['create'](_[_0x733a('0x3d')](_0x5a2dfe,_0x55ac19[_0x733a('0x4b')]),{'include':_0x55ac19[_0x733a('0x33')][_0x733a('0x42')]?[{'all':!![]}]:undefined})[_0x733a('0x28')](function(_0x19eed8){var _0x4003d8=_0x55ac19['user']['get']({'plain':!![]});if(!_0x4003d8)throw new Error(_0x733a('0x4e'));if(_0x4003d8[_0x733a('0x4f')]==='user'){var _0x4df83d=_0x19eed8['get']({'plain':!![]});var _0x496d17=_0x733a('0x29');return db[_0x733a('0x50')][_0x733a('0x49')]({'where':{'name':_0x496d17,'userProfileId':_0x4003d8[_0x733a('0x51')]},'raw':!![]})[_0x733a('0x28')](function(_0x374be2){if(_0x374be2&&_0x374be2[_0x733a('0x52')]===0x0){return db[_0x733a('0x2a')]['create']({'name':_0x4df83d['name'],'resourceId':_0x4df83d['id'],'type':_0x374be2['name'],'sectionId':_0x374be2['id']},{})[_0x733a('0x28')](function(){return _0x19eed8;});}else{return _0x19eed8;}})[_0x733a('0x45')](function(_0xddf4b1){logger['error'](_0x733a('0x53'),_0xddf4b1);throw _0xddf4b1;});}return _0x19eed8;});}})[_0x733a('0x28')](respondWithResult(_0x30cf8c,0xc9))[_0x733a('0x45')](handleError(_0x30cf8c,null));};exports[_0x733a('0x27')]=function(_0x3fd236,_0x44c67c){if(_0x3fd236[_0x733a('0x4b')]['id']){delete _0x3fd236['body']['id'];}return db[_0x733a('0x2f')]['find']({'where':{'id':_0x3fd236[_0x733a('0x47')]['id']}})['then'](handleEntityNotFound(_0x44c67c,null))['then'](saveUpdates(_0x3fd236[_0x733a('0x4b')],null))['then'](respondWithResult(_0x44c67c,null))[_0x733a('0x45')](handleError(_0x44c67c,null));};exports['destroy']=function(_0x25612e,_0x47bec6){return db['Dashboard'][_0x733a('0x49')]({'where':{'id':_0x25612e[_0x733a('0x47')]['id']}})[_0x733a('0x28')](handleEntityNotFound(_0x47bec6,null))['then'](removeEntity(_0x47bec6,null))[_0x733a('0x45')](handleError(_0x47bec6,null));};function widgetAttributes(_0x31714b){try{switch(_0x31714b[_0x733a('0x3f')]){case _0x733a('0x57'):return[{'name':'attrUrl','value':_0x31714b[_0x733a('0x58')]||(_0x31714b['attrs']&&_0x31714b['attrs'][0x0]?_0x31714b['attrs'][0x0][_0x733a('0x59')]:undefined)||_0x733a('0x5a')}];case'custom':return[{'name':'attrPath','value':_0x31714b[_0x733a('0x5b')]||(_0x31714b[_0x733a('0x5c')]&&_0x31714b['attrs'][0x0]?_0x31714b[_0x733a('0x5c')][0x0][_0x733a('0x59')]:undefined)||''}];case _0x733a('0x5d'):return[{'name':'attrHourFormat','value':_0x31714b[_0x733a('0x5e')]||(_0x31714b['attrs']&&_0x31714b['attrs'][0x0]?_0x31714b['attrs'][0x0][_0x733a('0x59')]:undefined)||'HH:mm:ss'},{'name':_0x733a('0x5f'),'value':_0x31714b[_0x733a('0x5f')]||(_0x31714b[_0x733a('0x5c')]&&_0x31714b['attrs'][0x1]?_0x31714b[_0x733a('0x5c')][0x1][_0x733a('0x59')]:undefined)||_0x733a('0x60')},{'name':_0x733a('0x61'),'value':_0x31714b['attrFontSize']||(_0x31714b[_0x733a('0x5c')]&&_0x31714b[_0x733a('0x5c')][0x2]?_0x31714b[_0x733a('0x5c')][0x2][_0x733a('0x59')]:undefined)||0xc}];case'counter':return[{'name':'attrMetric','value':_0x31714b[_0x733a('0x62')]||(_0x31714b[_0x733a('0x5c')]&&_0x31714b[_0x733a('0x5c')][0x0]?_0x31714b[_0x733a('0x5c')][0x0][_0x733a('0x59')]:undefined)||'total'},{'name':_0x733a('0x63'),'value':_0x31714b[_0x733a('0x63')]||(_0x31714b[_0x733a('0x5c')]&&_0x31714b[_0x733a('0x5c')][0x1]?_0x31714b[_0x733a('0x5c')][0x1][_0x733a('0x59')]:undefined)||[]},{'name':_0x733a('0x61'),'value':_0x31714b['attrFontSize']||(_0x31714b[_0x733a('0x5c')]&&_0x31714b['attrs'][0x2]?_0x31714b['attrs'][0x2][_0x733a('0x59')]:undefined)||0x14}];case _0x733a('0x64'):case _0x733a('0x65'):return[{'name':_0x733a('0x66'),'value':_0x31714b[_0x733a('0x66')]||(_0x31714b[_0x733a('0x5c')]&&_0x31714b['attrs'][0x0]?_0x31714b[_0x733a('0x5c')][0x0][_0x733a('0x59')]:undefined)||_0x733a('0x67')},{'name':'attrSerie2','value':_0x31714b['attrSerie2']||(_0x31714b[_0x733a('0x5c')]&&_0x31714b['attrs'][0x1]?_0x31714b[_0x733a('0x5c')][0x1]['value']:undefined)||null},{'name':_0x733a('0x68'),'value':_0x31714b['attrSerie3']||(_0x31714b['attrs']&&_0x31714b[_0x733a('0x5c')][0x2]?_0x31714b['attrs'][0x2][_0x733a('0x59')]:undefined)||null},{'name':_0x733a('0x63'),'value':_0x31714b['attrVoiceQueues']||(_0x31714b[_0x733a('0x5c')]&&_0x31714b[_0x733a('0x5c')][0x3]?_0x31714b['attrs'][0x3][_0x733a('0x59')]:undefined)||[]}];case _0x733a('0x69'):return[{'name':_0x733a('0x6a'),'type':_0x31714b[_0x733a('0x6b')]||(_0x31714b[_0x733a('0x5c')]&&_0x31714b[_0x733a('0x5c')][0x0]?_0x31714b['attrs'][0x0][_0x733a('0x3f')]:undefined)||null,'value':_0x31714b[_0x733a('0x6a')]||(_0x31714b[_0x733a('0x5c')]&&_0x31714b[_0x733a('0x5c')][0x0]?_0x31714b[_0x733a('0x5c')][0x0]['value']:undefined)||null},{'name':_0x733a('0x6c'),'value':_0x31714b[_0x733a('0x6c')]||(_0x31714b[_0x733a('0x5c')]&&_0x31714b[_0x733a('0x5c')][0x1]?_0x31714b[_0x733a('0x5c')][0x1][_0x733a('0x59')]:undefined)||0x0}];default:return[];}}catch(_0x220bd4){logger[_0x733a('0x6d')](_0x733a('0x6e'),JSON['stringify'](_0x220bd4));return[];}}exports[_0x733a('0x6f')]=function(_0x262c91,_0xc9de91,_0x24cdfb){if(_0x262c91[_0x733a('0x4b')]['id']){delete _0x262c91[_0x733a('0x4b')]['id'];}return db['Dashboard'][_0x733a('0x49')]({'where':{'id':_0x262c91[_0x733a('0x47')]['id']}})[_0x733a('0x28')](handleEntityNotFound(_0xc9de91,null))[_0x733a('0x28')](function(_0x2e5ba6){if(_0x2e5ba6){_0x262c91['body'][_0x733a('0x70')]=_0x2e5ba6['id'];_0x262c91[_0x733a('0x4b')][_0x733a('0x5c')]=widgetAttributes(_0x262c91[_0x733a('0x4b')]);return db['DashboardItem'][_0x733a('0x4a')](_0x262c91[_0x733a('0x4b')]);}})[_0x733a('0x28')](respondWithResult(_0xc9de91,null))[_0x733a('0x45')](handleError(_0xc9de91,null));};exports[_0x733a('0x71')]=function(_0x54ffc1,_0x4955ef,_0x298128){var _0x2513ca={};var _0x29a525={};var _0x2c56f7;var _0x2f7d17;return db[_0x733a('0x2f')]['findOne']({'where':{'id':_0x54ffc1['params']['id']}})['then'](handleEntityNotFound(_0x4955ef,null))[_0x733a('0x28')](function(_0x5b4e24){if(_0x5b4e24){_0x2c56f7=_0x5b4e24;_0x29a525[_0x733a('0x32')]=_[_0x733a('0x34')](db[_0x733a('0x72')][_0x733a('0x30')]);_0x29a525[_0x733a('0x33')]=_[_0x733a('0x34')](_0x54ffc1['query']);_0x29a525[_0x733a('0x35')]=_['intersection'](_0x29a525['model'],_0x29a525[_0x733a('0x33')]);_0x2513ca['attributes']=_[_0x733a('0x36')](_0x29a525[_0x733a('0x32')],qs['fields'](_0x54ffc1[_0x733a('0x33')][_0x733a('0x38')]));_0x2513ca[_0x733a('0x37')]=_0x2513ca[_0x733a('0x37')]['length']?_0x2513ca['attributes']:_0x29a525[_0x733a('0x32')];_0x2513ca[_0x733a('0x73')]=qs[_0x733a('0x3a')](_0x54ffc1[_0x733a('0x33')]['sort']);_0x2513ca['where']=qs[_0x733a('0x35')](_[_0x733a('0x3b')](_0x54ffc1[_0x733a('0x33')],_0x29a525[_0x733a('0x35')]));if(_0x54ffc1[_0x733a('0x33')][_0x733a('0x3c')]){_0x2513ca[_0x733a('0x3e')]=_[_0x733a('0x3d')](_0x2513ca[_0x733a('0x3e')],{'$or':_[_0x733a('0x2e')](_0x2513ca[_0x733a('0x37')],function(_0x3031d2){var _0x529f72={};_0x529f72[_0x3031d2]={'$like':'%'+_0x54ffc1[_0x733a('0x33')][_0x733a('0x3c')]+'%'};return _0x529f72;})});}_0x2513ca=_[_0x733a('0x3d')]({},_0x2513ca,_0x54ffc1[_0x733a('0x41')]);return _0x2c56f7[_0x733a('0x71')](_0x2513ca);}})[_0x733a('0x28')](function(_0x40722d){if(_0x40722d){_0x2f7d17=_0x40722d[_0x733a('0x39')];if(!_0x54ffc1['query'][_0x733a('0x74')](_0x733a('0x75'))){_0x2513ca['limit']=qs[_0x733a('0x21')](_0x54ffc1[_0x733a('0x33')][_0x733a('0x21')]);_0x2513ca[_0x733a('0x1e')]=qs[_0x733a('0x1e')](_0x54ffc1['query'][_0x733a('0x1e')]);}return _0x2c56f7[_0x733a('0x71')](_0x2513ca);}})[_0x733a('0x28')](function(_0x231366){if(_0x231366){return _0x231366?{'count':_0x2f7d17,'rows':_0x231366}:null;}})[_0x733a('0x28')](respondWithResult(_0x4955ef,null))[_0x733a('0x45')](handleError(_0x4955ef,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 4248a01..84186e9 100644 --- a/server/api/dashboard/dashboard.events.js +++ b/server/api/dashboard/dashboard.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5790=['exports','events','Dashboard','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x4179e2,_0xf2dbb){var _0x24cb50=function(_0x3b7899){while(--_0x3b7899){_0x4179e2['push'](_0x4179e2['shift']());}};_0x24cb50(++_0xf2dbb);}(_0x5790,0xa1));var _0x0579=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x5790[_0x3ab51d];return _0x29a04e;};'use strict';var EventEmitter=require(_0x0579('0x0'));var Dashboard=require('../../mysqldb')['db'][_0x0579('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x0579('0x2')](0x0);var events={'afterCreate':_0x0579('0x3'),'afterUpdate':_0x0579('0x4'),'afterDestroy':_0x0579('0x5')};function emitEvent(_0x3f8736){return function(_0x464651,_0x42ea59,_0x3f3019){DashboardEvents[_0x0579('0x6')](_0x3f8736+':'+_0x464651['id'],_0x464651);DashboardEvents[_0x0579('0x6')](_0x3f8736,_0x464651);_0x3f3019(null);};}for(var e in events){if(events[_0x0579('0x7')](e)){var event=events[e];Dashboard[_0x0579('0x8')](e,emitEvent(event));}}module[_0x0579('0x9')]=DashboardEvents; \ No newline at end of file +var _0x0eda=['setMaxListeners','remove','emit','hook','exports','events','../../mysqldb','Dashboard'];(function(_0x54e143,_0x4a0a3f){var _0xe3d1c3=function(_0x456728){while(--_0x456728){_0x54e143['push'](_0x54e143['shift']());}};_0xe3d1c3(++_0x4a0a3f);}(_0x0eda,0x85));var _0xa0ed=function(_0x2e0439,_0x4206d7){_0x2e0439=_0x2e0439-0x0;var _0x164d25=_0x0eda[_0x2e0439];return _0x164d25;};'use strict';var EventEmitter=require(_0xa0ed('0x0'));var Dashboard=require(_0xa0ed('0x1'))['db'][_0xa0ed('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xa0ed('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xa0ed('0x4')};function emitEvent(_0xb3c849){return function(_0x2e5cb4,_0x45ecd6,_0x35f9b8){DashboardEvents[_0xa0ed('0x5')](_0xb3c849+':'+_0x2e5cb4['id'],_0x2e5cb4);DashboardEvents[_0xa0ed('0x5')](_0xb3c849,_0x2e5cb4);_0x35f9b8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0xa0ed('0x6')](e,emitEvent(event));}}module[_0xa0ed('0x7')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 527d75e..30db8a6 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 _0xe96f=['util','moment','bluebird','request-promise','rimraf','../../config/environment','./dashboard.attributes','exports','define','lodash'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0xe96f,0x199));var _0xfe96=function(_0x5967e2,_0x3661d4){_0x5967e2=_0x5967e2-0x0;var _0x56078d=_0xe96f[_0x5967e2];return _0x56078d;};'use strict';var _=require(_0xfe96('0x0'));var util=require(_0xfe96('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xfe96('0x2'));var BPromise=require(_0xfe96('0x3'));var rp=require(_0xfe96('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfe96('0x5'));var config=require(_0xfe96('0x6'));var attributes=require(_0xfe96('0x7'));module[_0xfe96('0x8')]=function(_0x1c300f,_0x35947d){return _0x1c300f[_0xfe96('0x9')]('Dashboard',attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5cba=['./dashboard.attributes','exports','define','Dashboard','dashboards','lodash','util','../../config/logger','moment','bluebird','request-promise','../../config/environment'];(function(_0x9d1040,_0x47cf09){var _0x506702=function(_0x32bc4d){while(--_0x32bc4d){_0x9d1040['push'](_0x9d1040['shift']());}};_0x506702(++_0x47cf09);}(_0x5cba,0x1cd));var _0xa5cb=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x5cba[_0x465a0c];return _0x1e202e;};'use strict';var _=require(_0xa5cb('0x0'));var util=require(_0xa5cb('0x1'));var logger=require(_0xa5cb('0x2'))('api');var moment=require(_0xa5cb('0x3'));var BPromise=require(_0xa5cb('0x4'));var rp=require(_0xa5cb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa5cb('0x6'));var attributes=require(_0xa5cb('0x7'));module[_0xa5cb('0x8')]=function(_0x50d450,_0x162446){return _0x50d450[_0xa5cb('0x9')](_0xa5cb('0xa'),attributes,{'tableName':_0xa5cb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.rpc.js b/server/api/dashboard/dashboard.rpc.js index 225ae1a..0f24d50 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 _0x9f17=['debug','Dashboard,\x20%s,\x20%s,\x20%s','error','code','message','catch','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','register','then','info','Dashboard,\x20%s,\x20%s','request\x20sent'];(function(_0x55394,_0x4c6273){var _0x4d7942=function(_0x311bfa){while(--_0x311bfa){_0x55394['push'](_0x55394['shift']());}};_0x4d7942(++_0x4c6273);}(_0x9f17,0x11a));var _0x79f1=function(_0x550eb1,_0x26d9eb){_0x550eb1=_0x550eb1-0x0;var _0x353471=_0x9f17[_0x550eb1];return _0x353471;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x79f1('0x0'));var rs=require(_0x79f1('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x79f1('0x2'))['db'];var utils=require(_0x79f1('0x3'));var logger=require(_0x79f1('0x4'))(_0x79f1('0x5'));var config=require(_0x79f1('0x6'));var jayson=require(_0x79f1('0x7'));var client=jayson[_0x79f1('0x8')][_0x79f1('0x9')]({'port':0x232a});config[_0x79f1('0xa')]=_['defaults'](config[_0x79f1('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x79f1('0xb'))(new Redis(config[_0x79f1('0xa')]));require('./dashboard.socket')[_0x79f1('0xc')](socket);function respondWithRpcPromise(_0xf074af,_0x59da0b,_0x5e26ec){return new BPromise(function(_0x4c0c8e,_0x1ede3f){return client['request'](_0xf074af,_0x5e26ec)[_0x79f1('0xd')](function(_0x46ff9d){logger[_0x79f1('0xe')](_0x79f1('0xf'),_0x59da0b,_0x79f1('0x10'));logger[_0x79f1('0x11')](_0x79f1('0x12'),_0x59da0b,_0x79f1('0x10'),JSON['stringify'](_0x46ff9d));if(_0x46ff9d['error']){if(_0x46ff9d[_0x79f1('0x13')][_0x79f1('0x14')]===0x1f4){logger[_0x79f1('0x13')](_0x79f1('0xf'),_0x59da0b,_0x46ff9d[_0x79f1('0x13')][_0x79f1('0x15')]);return _0x1ede3f(_0x46ff9d[_0x79f1('0x13')][_0x79f1('0x15')]);}logger['error'](_0x79f1('0xf'),_0x59da0b,_0x46ff9d[_0x79f1('0x13')]['message']);return _0x4c0c8e(_0x46ff9d['error'][_0x79f1('0x15')]);}else{logger[_0x79f1('0xe')](_0x79f1('0xf'),_0x59da0b,_0x79f1('0x10'));_0x4c0c8e(_0x46ff9d['result'][_0x79f1('0x15')]);}})[_0x79f1('0x16')](function(_0x398263){logger[_0x79f1('0x13')](_0x79f1('0xf'),_0x59da0b,_0x398263);_0x1ede3f(_0x398263);});});} \ No newline at end of file +var _0x0327=['../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','./dashboard.socket','request','then','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0327,0x18f));var _0x7032=function(_0x5f0f2c,_0x9817bf){_0x5f0f2c=_0x5f0f2c-0x0;var _0x104e69=_0x0327[_0x5f0f2c];return _0x104e69;};'use strict';var _=require(_0x7032('0x0'));var util=require(_0x7032('0x1'));var moment=require(_0x7032('0x2'));var BPromise=require(_0x7032('0x3'));var rs=require(_0x7032('0x4'));var fs=require('fs');var Redis=require(_0x7032('0x5'));var db=require(_0x7032('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x7032('0x7'))('rpc');var config=require(_0x7032('0x8'));var jayson=require(_0x7032('0x9'));var client=jayson[_0x7032('0xa')]['http']({'port':0x232a});config[_0x7032('0xb')]=_[_0x7032('0xc')](config[_0x7032('0xb')],{'host':_0x7032('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7032('0xb')]));require(_0x7032('0xe'))['register'](socket);function respondWithRpcPromise(_0x226aa1,_0x5e4cf3,_0x35b113){return new BPromise(function(_0x3d8863,_0x172781){return client[_0x7032('0xf')](_0x226aa1,_0x35b113)[_0x7032('0x10')](function(_0x456dc6){logger['info'](_0x7032('0x11'),_0x5e4cf3,_0x7032('0x12'));logger[_0x7032('0x13')](_0x7032('0x14'),_0x5e4cf3,'request\x20sent',JSON['stringify'](_0x456dc6));if(_0x456dc6[_0x7032('0x15')]){if(_0x456dc6['error'][_0x7032('0x16')]===0x1f4){logger[_0x7032('0x15')](_0x7032('0x11'),_0x5e4cf3,_0x456dc6['error'][_0x7032('0x17')]);return _0x172781(_0x456dc6['error'][_0x7032('0x17')]);}logger[_0x7032('0x15')]('Dashboard,\x20%s,\x20%s',_0x5e4cf3,_0x456dc6[_0x7032('0x15')]['message']);return _0x3d8863(_0x456dc6[_0x7032('0x15')][_0x7032('0x17')]);}else{logger[_0x7032('0x18')](_0x7032('0x11'),_0x5e4cf3,'request\x20sent');_0x3d8863(_0x456dc6[_0x7032('0x19')][_0x7032('0x17')]);}})[_0x7032('0x1a')](function(_0x179419){logger[_0x7032('0x15')]('Dashboard,\x20%s,\x20%s',_0x5e4cf3,_0x179419);_0x172781(_0x179419);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 2b5e256..36fce85 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 _0x11ef=['dashboard:','./dashboard.events','remove','emit','removeListener','register','length'];(function(_0x43a37c,_0x25a567){var _0x5d1d40=function(_0x3ec673){while(--_0x3ec673){_0x43a37c['push'](_0x43a37c['shift']());}};_0x5d1d40(++_0x25a567);}(_0x11ef,0x94));var _0xf11e=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0x11ef[_0x45d3f0];return _0x314b79;};'use strict';var DashboardEvents=require(_0xf11e('0x0'));var events=['save',_0xf11e('0x1'),'update'];function createListener(_0x4f19d6,_0x5207b2){return function(_0xa0ada6){_0x5207b2[_0xf11e('0x2')](_0x4f19d6,_0xa0ada6);};}function removeListener(_0x268eb8,_0x4f5b9e){return function(){DashboardEvents[_0xf11e('0x3')](_0x268eb8,_0x4f5b9e);};}exports[_0xf11e('0x4')]=function(_0x3d3ddc){for(var _0xcc4e4b=0x0,_0x20bf13=events[_0xf11e('0x5')];_0xcc4e4b<_0x20bf13;_0xcc4e4b++){var _0x21b432=events[_0xcc4e4b];var _0x406150=createListener(_0xf11e('0x6')+_0x21b432,_0x3d3ddc);DashboardEvents['on'](_0x21b432,_0x406150);}}; \ No newline at end of file +var _0x6873=['dashboard:','save','remove','update','emit','removeListener','register'];(function(_0x2b3aee,_0x483575){var _0x1c62ee=function(_0x207b1f){while(--_0x207b1f){_0x2b3aee['push'](_0x2b3aee['shift']());}};_0x1c62ee(++_0x483575);}(_0x6873,0x19e));var _0x3687=function(_0x8abd64,_0x539570){_0x8abd64=_0x8abd64-0x0;var _0xd2511e=_0x6873[_0x8abd64];return _0xd2511e;};'use strict';var DashboardEvents=require('./dashboard.events');var events=[_0x3687('0x0'),_0x3687('0x1'),_0x3687('0x2')];function createListener(_0x1b098e,_0x3339eb){return function(_0x1cb8a3){_0x3339eb[_0x3687('0x3')](_0x1b098e,_0x1cb8a3);};}function removeListener(_0x520e9b,_0x22b559){return function(){DashboardEvents[_0x3687('0x4')](_0x520e9b,_0x22b559);};}exports[_0x3687('0x5')]=function(_0xe91f50){for(var _0x3ade96=0x0,_0x3a087e=events['length'];_0x3ade96<_0x3a087e;_0x3ade96++){var _0x2a8107=events[_0x3ade96];var _0x27417c=createListener(_0x3687('0x6')+_0x2a8107,_0xe91f50);DashboardEvents['on'](_0x2a8107,_0x27417c);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index f98eddf..e93aa28 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 _0x1194=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id/items','getItems','post','/:id/clone','clone','addItem','put','/:id','update','delete','destroy','exports','util','connect-timeout'];(function(_0x1b3b91,_0x434e67){var _0x5d64a6=function(_0x4bcc66){while(--_0x4bcc66){_0x1b3b91['push'](_0x1b3b91['shift']());}};_0x5d64a6(++_0x434e67);}(_0x1194,0x82));var _0x4119=function(_0x281a3b,_0x1df435){_0x281a3b=_0x281a3b-0x0;var _0x387721=_0x1194[_0x281a3b];return _0x387721;};'use strict';var multer=require('multer');var util=require(_0x4119('0x0'));var path=require('path');var timeout=require(_0x4119('0x1'));var express=require('express');var router=express[_0x4119('0x2')]();var fs_extra=require(_0x4119('0x3'));var auth=require(_0x4119('0x4'));var interaction=require(_0x4119('0x5'));var config=require(_0x4119('0x6'));var controller=require('./dashboard.controller');router[_0x4119('0x7')]('/',auth[_0x4119('0x8')](),controller[_0x4119('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x4119('0x7')](_0x4119('0xa'),auth[_0x4119('0x8')](),controller[_0x4119('0xb')]);router['post']('/',auth[_0x4119('0x8')](),controller['create']);router[_0x4119('0xc')](_0x4119('0xd'),auth[_0x4119('0x8')](),controller[_0x4119('0xe')]);router[_0x4119('0xc')](_0x4119('0xa'),auth[_0x4119('0x8')](),controller[_0x4119('0xf')]);router[_0x4119('0x10')](_0x4119('0x11'),auth[_0x4119('0x8')](),controller[_0x4119('0x12')]);router[_0x4119('0x13')](_0x4119('0x11'),auth[_0x4119('0x8')](),controller[_0x4119('0x14')]);module[_0x4119('0x15')]=router; \ No newline at end of file +var _0x2f6b=['index','show','getItems','create','post','/:id/clone','addItem','put','delete','destroy','exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated'];(function(_0x553fe0,_0xc8495f){var _0x4952ae=function(_0x270b34){while(--_0x270b34){_0x553fe0['push'](_0x553fe0['shift']());}};_0x4952ae(++_0xc8495f);}(_0x2f6b,0xf2));var _0xb2f6=function(_0x1a72f3,_0x217011){_0x1a72f3=_0x1a72f3-0x0;var _0x57ef47=_0x2f6b[_0x1a72f3];return _0x57ef47;};'use strict';var multer=require(_0xb2f6('0x0'));var util=require(_0xb2f6('0x1'));var path=require('path');var timeout=require(_0xb2f6('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xb2f6('0x3'));var auth=require(_0xb2f6('0x4'));var interaction=require(_0xb2f6('0x5'));var config=require(_0xb2f6('0x6'));var controller=require(_0xb2f6('0x7'));router[_0xb2f6('0x8')]('/',auth[_0xb2f6('0x9')](),controller[_0xb2f6('0xa')]);router[_0xb2f6('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xb2f6('0xb')]);router[_0xb2f6('0x8')]('/:id/items',auth['isAuthenticated'](),controller[_0xb2f6('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb2f6('0xd')]);router[_0xb2f6('0xe')](_0xb2f6('0xf'),auth[_0xb2f6('0x9')](),controller['clone']);router[_0xb2f6('0xe')]('/:id/items',auth[_0xb2f6('0x9')](),controller[_0xb2f6('0x10')]);router[_0xb2f6('0x11')]('/:id',auth[_0xb2f6('0x9')](),controller['update']);router[_0xb2f6('0x12')]('/:id',auth[_0xb2f6('0x9')](),controller[_0xb2f6('0x13')]);module[_0xb2f6('0x14')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 5dec588..35b2b78 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 _0xf61e=['TEXT','long','parse','getDataValue','attrs','setDataValue','INTEGER','#ffffff','#2196f3','sequelize','squel','lodash','exports','STRING'];(function(_0x4aca2e,_0x4ab321){var _0x2d60d3=function(_0x30cbc5){while(--_0x30cbc5){_0x4aca2e['push'](_0x4aca2e['shift']());}};_0x2d60d3(++_0x4ab321);}(_0xf61e,0x191));var _0xef61=function(_0x6f85e0,_0x3acdd1){_0x6f85e0=_0x6f85e0-0x0;var _0x2c6dd0=_0xf61e[_0x6f85e0];return _0x2c6dd0;};'use strict';var Sequelize=require(_0xef61('0x0'));var squel=require(_0xef61('0x1'));var _=require(_0xef61('0x2'));module[_0xef61('0x3')]={'title':{'type':Sequelize[_0xef61('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0xef61('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xef61('0x5')](_0xef61('0x6')),'get':function(){try{return JSON[_0xef61('0x7')](this[_0xef61('0x8')](_0xef61('0x9')));}catch(_0x45a18d){return[];}},'set':function(_0x5b00b2){try{this[_0xef61('0xa')](_0xef61('0x9'),JSON['stringify'](_0x5b00b2));}catch(_0x2242a7){this[_0xef61('0xa')](_0xef61('0x9'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xef61('0xb')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xef61('0xb')]},'col':{'type':Sequelize[_0xef61('0xb')]},'background':{'type':Sequelize[_0xef61('0x4')],'allowNull':![],'defaultValue':_0xef61('0xc'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xef61('0x4')],'allowNull':![],'defaultValue':_0xef61('0xd'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xef61('0x4')]},'titleFontSize':{'type':Sequelize[_0xef61('0xb')],'defaultValue':0xc}}; \ No newline at end of file +var _0x1883=['stringify','INTEGER','#ffffff','sequelize','squel','lodash','exports','STRING','TEXT','long','parse','getDataValue','attrs','setDataValue'];(function(_0x44afa4,_0x5be27b){var _0xcad289=function(_0x206272){while(--_0x206272){_0x44afa4['push'](_0x44afa4['shift']());}};_0xcad289(++_0x5be27b);}(_0x1883,0xab));var _0x3188=function(_0x5e5a8a,_0x2ddd14){_0x5e5a8a=_0x5e5a8a-0x0;var _0x47599a=_0x1883[_0x5e5a8a];return _0x47599a;};'use strict';var Sequelize=require(_0x3188('0x0'));var squel=require(_0x3188('0x1'));var _=require(_0x3188('0x2'));module[_0x3188('0x3')]={'title':{'type':Sequelize[_0x3188('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0x3188('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x3188('0x5')](_0x3188('0x6')),'get':function(){try{return JSON[_0x3188('0x7')](this[_0x3188('0x8')](_0x3188('0x9')));}catch(_0x345612){return[];}},'set':function(_0x408ae0){try{this[_0x3188('0xa')](_0x3188('0x9'),JSON[_0x3188('0xb')](_0x408ae0));}catch(_0x3e3afb){this['setDataValue'](_0x3188('0x9'),JSON[_0x3188('0xb')]([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x3188('0xc')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0x3188('0xc')]},'background':{'type':Sequelize[_0x3188('0x4')],'allowNull':![],'defaultValue':_0x3188('0xd'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x3188('0x4')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x3188('0x4')]},'titleFontSize':{'type':Sequelize[_0x3188('0xc')],'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 2cfc487..2630646 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 _0xf28f=['0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','web-report','attrReport','widgetAttributes:\x20%s','stringify','create','body','catch','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','destroy','error','stack','name','send','params','query','filters','model','attributes','intersection','fields','includeAll','include','options','DashboardItem','find','type','iframe','attrUrl','attrs','value','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone'];(function(_0x57d41c,_0x4a16e8){var _0x5d9d9e=function(_0x4f416f){while(--_0x4f416f){_0x57d41c['push'](_0x57d41c['shift']());}};_0x5d9d9e(++_0x4a16e8);}(_0xf28f,0x11a));var _0xff28=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0xf28f[_0x2ec461];return _0x28603d;};'use strict';var emlformat=require(_0xff28('0x0'));var rimraf=require(_0xff28('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xff28('0x2'));var rp=require(_0xff28('0x3'));var moment=require(_0xff28('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xff28('0x5'));var util=require(_0xff28('0x6'));var path=require(_0xff28('0x7'));var sox=require(_0xff28('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xff28('0x9'));var _=require('lodash');var squel=require(_0xff28('0xa'));var crypto=require(_0xff28('0xb'));var jsforce=require(_0xff28('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xff28('0xd'));var querystring=require(_0xff28('0xe'));var Papa=require(_0xff28('0xf'));var Redis=require(_0xff28('0x10'));var authService=require(_0xff28('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xff28('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xff28('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xff28('0x14'));var licenseUtil=require(_0xff28('0x15'));var db=require(_0xff28('0x16'))['db'];config[_0xff28('0x17')]=_[_0xff28('0x18')](config['redis'],{'host':_0xff28('0x19'),'port':0x18eb});var socket=require(_0xff28('0x1a'))(new Redis(config[_0xff28('0x17')]));require(_0xff28('0x1b'))[_0xff28('0x1c')](socket);function respondWithStatusCode(_0x2335cb,_0xf341fb){_0xf341fb=_0xf341fb||0xcc;return function(_0x54cef5){if(_0x54cef5){return _0x2335cb[_0xff28('0x1d')](_0xf341fb);}return _0x2335cb[_0xff28('0x1e')](_0xf341fb)[_0xff28('0x1f')]();};}function respondWithResult(_0x264ea8,_0x2cbcc1){_0x2cbcc1=_0x2cbcc1||0xc8;return function(_0x2bae65){if(_0x2bae65){return _0x264ea8[_0xff28('0x1e')](_0x2cbcc1)[_0xff28('0x20')](_0x2bae65);}};}function respondWithFilteredResult(_0x465635,_0x36d991){return function(_0x3188da){if(_0x3188da){var _0x25ec4e=typeof _0x36d991[_0xff28('0x21')]===_0xff28('0x22')&&typeof _0x36d991[_0xff28('0x23')]==='undefined';var _0x297169=_0x3188da[_0xff28('0x24')];var _0xa80c93=_0x25ec4e?0x0:_0x36d991[_0xff28('0x21')];var _0xdcf5c3=_0x25ec4e?_0x3188da[_0xff28('0x24')]:_0x36d991[_0xff28('0x21')]+_0x36d991['limit'];var _0xf38eb9;if(_0xdcf5c3>=_0x297169){_0xdcf5c3=_0x297169;_0xf38eb9=0xc8;}else{_0xf38eb9=0xce;}_0x465635['status'](_0xf38eb9);return _0x465635[_0xff28('0x25')]('Content-Range',_0xa80c93+'-'+_0xdcf5c3+'/'+_0x297169)[_0xff28('0x20')](_0x3188da);}return null;};}function patchUpdates(_0x1a790d){return function(_0x59d4ed){try{jsonpatch[_0xff28('0x26')](_0x59d4ed,_0x1a790d,!![]);}catch(_0x546a92){return BPromise[_0xff28('0x27')](_0x546a92);}return _0x59d4ed[_0xff28('0x28')]();};}function saveUpdates(_0x3a7a65,_0x42aa65){return function(_0x25f05b){if(_0x25f05b){return _0x25f05b['update'](_0x3a7a65)[_0xff28('0x29')](function(_0x5ba78d){return _0x5ba78d;});}return null;};}function removeEntity(_0x5ae639,_0x2c1000){return function(_0x306785){if(_0x306785){return _0x306785[_0xff28('0x2a')]()[_0xff28('0x29')](function(){_0x5ae639[_0xff28('0x1e')](0xcc)[_0xff28('0x1f')]();});}};}function handleEntityNotFound(_0x5bba21,_0x455f31){return function(_0x132e71){if(!_0x132e71){_0x5bba21[_0xff28('0x1d')](0x194);}return _0x132e71;};}function handleError(_0x1e41a3,_0x1c4484){_0x1c4484=_0x1c4484||0x1f4;return function(_0x59cfc8){logger[_0xff28('0x2b')](_0x59cfc8[_0xff28('0x2c')]);if(_0x59cfc8[_0xff28('0x2d')]){delete _0x59cfc8[_0xff28('0x2d')];}_0x1e41a3['status'](_0x1c4484)[_0xff28('0x2e')](_0x59cfc8);};}exports['show']=function(_0xd6313,_0x39c137){var _0x519257={'raw':![],'where':{'id':_0xd6313[_0xff28('0x2f')]['id']}},_0x472301={};_0x472301['model']=_['keys'](db['DashboardItem']['rawAttributes']);_0x472301[_0xff28('0x30')]=_['keys'](_0xd6313[_0xff28('0x30')]);_0x472301[_0xff28('0x31')]=_['intersection'](_0x472301[_0xff28('0x32')],_0x472301[_0xff28('0x30')]);_0x519257[_0xff28('0x33')]=_[_0xff28('0x34')](_0x472301['model'],qs[_0xff28('0x35')](_0xd6313[_0xff28('0x30')][_0xff28('0x35')]));_0x519257[_0xff28('0x33')]=_0x519257[_0xff28('0x33')]['length']?_0x519257['attributes']:_0x472301[_0xff28('0x32')];if(_0xd6313['query'][_0xff28('0x36')]){_0x519257[_0xff28('0x37')]=[{'all':!![]}];}_0x519257=_['merge']({},_0x519257,_0xd6313[_0xff28('0x38')]);return db[_0xff28('0x39')][_0xff28('0x3a')](_0x519257)[_0xff28('0x29')](handleEntityNotFound(_0x39c137,null))[_0xff28('0x29')](respondWithResult(_0x39c137,null))['catch'](handleError(_0x39c137,null));};exports[_0xff28('0x2a')]=function(_0x11f4fd,_0x445903){return db['DashboardItem']['find']({'where':{'id':_0x11f4fd[_0xff28('0x2f')]['id']}})['then'](handleEntityNotFound(_0x445903,null))[_0xff28('0x29')](removeEntity(_0x445903,null))['catch'](handleError(_0x445903,null));};function widgetAttributes(_0x3507d3){try{switch(_0x3507d3[_0xff28('0x3b')]){case _0xff28('0x3c'):return[{'name':_0xff28('0x3d'),'value':_0x3507d3[_0xff28('0x3d')]||(_0x3507d3[_0xff28('0x3e')]&&_0x3507d3['attrs'][0x0]?_0x3507d3[_0xff28('0x3e')][0x0][_0xff28('0x3f')]:undefined)||'https://'}];case _0xff28('0x40'):return[{'name':_0xff28('0x41'),'value':_0x3507d3[_0xff28('0x41')]||(_0x3507d3[_0xff28('0x3e')]&&_0x3507d3[_0xff28('0x3e')][0x0]?_0x3507d3[_0xff28('0x3e')][0x0][_0xff28('0x3f')]:undefined)||''}];case _0xff28('0x42'):return[{'name':'attrHourFormat','value':_0x3507d3[_0xff28('0x43')]||(_0x3507d3[_0xff28('0x3e')]&&_0x3507d3[_0xff28('0x3e')][0x0]?_0x3507d3[_0xff28('0x3e')][0x0][_0xff28('0x3f')]:undefined)||_0xff28('0x44')},{'name':_0xff28('0x45'),'value':_0x3507d3[_0xff28('0x45')]||(_0x3507d3[_0xff28('0x3e')]&&_0x3507d3[_0xff28('0x3e')][0x1]?_0x3507d3['attrs'][0x1][_0xff28('0x3f')]:undefined)||_0xff28('0x46')},{'name':_0xff28('0x47'),'value':_0x3507d3[_0xff28('0x47')]||(_0x3507d3['attrs']&&_0x3507d3[_0xff28('0x3e')][0x2]?_0x3507d3[_0xff28('0x3e')][0x2]['value']:undefined)||0xc}];case _0xff28('0x48'):return[{'name':'attrMetric','value':_0x3507d3[_0xff28('0x49')]||(_0x3507d3[_0xff28('0x3e')]&&_0x3507d3[_0xff28('0x3e')][0x0]?_0x3507d3[_0xff28('0x3e')][0x0][_0xff28('0x3f')]:undefined)||'total'},{'name':_0xff28('0x4a'),'value':_0x3507d3[_0xff28('0x4a')]||(_0x3507d3[_0xff28('0x3e')]&&_0x3507d3[_0xff28('0x3e')][0x1]?_0x3507d3[_0xff28('0x3e')][0x1]['value']:undefined)||[]},{'name':_0xff28('0x47'),'value':_0x3507d3[_0xff28('0x47')]||(_0x3507d3[_0xff28('0x3e')]&&_0x3507d3[_0xff28('0x3e')][0x2]?_0x3507d3[_0xff28('0x3e')][0x2]['value']:undefined)||0x14}];case _0xff28('0x4b'):case _0xff28('0x4c'):return[{'name':'attrSerie1','value':_0x3507d3[_0xff28('0x4d')]||(_0x3507d3[_0xff28('0x3e')]&&_0x3507d3['attrs'][0x0]?_0x3507d3[_0xff28('0x3e')][0x0][_0xff28('0x3f')]:undefined)||_0xff28('0x4e')},{'name':_0xff28('0x4f'),'value':_0x3507d3['attrSerie2']||(_0x3507d3['attrs']&&_0x3507d3[_0xff28('0x3e')][0x1]?_0x3507d3[_0xff28('0x3e')][0x1]['value']:undefined)||null},{'name':_0xff28('0x50'),'value':_0x3507d3[_0xff28('0x50')]||(_0x3507d3[_0xff28('0x3e')]&&_0x3507d3[_0xff28('0x3e')][0x2]?_0x3507d3[_0xff28('0x3e')][0x2][_0xff28('0x3f')]:undefined)||null},{'name':_0xff28('0x4a'),'value':_0x3507d3['attrVoiceQueues']||(_0x3507d3[_0xff28('0x3e')]&&_0x3507d3[_0xff28('0x3e')][0x3]?_0x3507d3[_0xff28('0x3e')][0x3][_0xff28('0x3f')]:undefined)||[]}];case _0xff28('0x51'):return[{'name':_0xff28('0x52'),'type':_0x3507d3['reportType']||(_0x3507d3[_0xff28('0x3e')]&&_0x3507d3['attrs'][0x0]?_0x3507d3[_0xff28('0x3e')][0x0][_0xff28('0x3b')]:undefined)||null,'value':_0x3507d3[_0xff28('0x52')]||(_0x3507d3[_0xff28('0x3e')]&&_0x3507d3[_0xff28('0x3e')][0x0]?_0x3507d3[_0xff28('0x3e')][0x0][_0xff28('0x3f')]:undefined)||null},{'name':'attrRefresh','value':_0x3507d3['attrRefresh']||(_0x3507d3['attrs']&&_0x3507d3[_0xff28('0x3e')][0x1]?_0x3507d3['attrs'][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x68f965){logger['error'](_0xff28('0x53'),JSON[_0xff28('0x54')](_0x68f965));return[];}}exports[_0xff28('0x55')]=function(_0x2ff2c0,_0x5e3fa5){if(_0x2ff2c0[_0xff28('0x56')]){_0x2ff2c0[_0xff28('0x56')][_0xff28('0x3e')]=widgetAttributes(_0x2ff2c0[_0xff28('0x56')]);}return db['DashboardItem'][_0xff28('0x55')](_0x2ff2c0['body'],{})[_0xff28('0x29')](respondWithResult(_0x5e3fa5,0xc9))[_0xff28('0x57')](handleError(_0x5e3fa5,null));};exports['update']=function(_0x2d5008,_0x32fdbc){if(_0x2d5008[_0xff28('0x56')]['id']){delete _0x2d5008[_0xff28('0x56')]['id'];}_0x2d5008[_0xff28('0x56')]['attrs']=widgetAttributes(_0x2d5008[_0xff28('0x56')]);return db[_0xff28('0x39')][_0xff28('0x3a')]({'where':{'id':_0x2d5008[_0xff28('0x2f')]['id']}})['then'](handleEntityNotFound(_0x32fdbc,null))[_0xff28('0x29')](saveUpdates(_0x2d5008[_0xff28('0x56')],null))[_0xff28('0x29')](respondWithResult(_0x32fdbc,null))[_0xff28('0x57')](handleError(_0x32fdbc,null));}; \ No newline at end of file +var _0xfc30=['intersection','attributes','fields','query','includeAll','merge','options','find','catch','iframe','attrUrl','attrs','https://','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','sox','to-csv','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','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','show','params','model','DashboardItem','keys'];(function(_0x32f057,_0x1a441a){var _0x5303c2=function(_0x2efd49){while(--_0x2efd49){_0x32f057['push'](_0x32f057['shift']());}};_0x5303c2(++_0x1a441a);}(_0xfc30,0xd8));var _0x0fc3=function(_0x456f79,_0x303e8b){_0x456f79=_0x456f79-0x0;var _0x57c261=_0xfc30[_0x456f79];return _0x57c261;};'use strict';var emlformat=require(_0x0fc3('0x0'));var rimraf=require(_0x0fc3('0x1'));var zipdir=require(_0x0fc3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0fc3('0x3'));var BPromise=require(_0x0fc3('0x4'));var Mustache=require(_0x0fc3('0x5'));var util=require('util');var path=require(_0x0fc3('0x6'));var sox=require(_0x0fc3('0x7'));var csv=require(_0x0fc3('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0fc3('0x9'));var squel=require(_0x0fc3('0xa'));var crypto=require(_0x0fc3('0xb'));var jsforce=require(_0x0fc3('0xc'));var deskjs=require(_0x0fc3('0xd'));var toCsv=require(_0x0fc3('0x8'));var querystring=require(_0x0fc3('0xe'));var Papa=require(_0x0fc3('0xf'));var Redis=require(_0x0fc3('0x10'));var authService=require(_0x0fc3('0x11'));var qs=require(_0x0fc3('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0fc3('0x13'));var logger=require(_0x0fc3('0x14'))('api');var utils=require(_0x0fc3('0x15'));var config=require(_0x0fc3('0x16'));var licenseUtil=require(_0x0fc3('0x17'));var db=require(_0x0fc3('0x18'))['db'];config[_0x0fc3('0x19')]=_[_0x0fc3('0x1a')](config[_0x0fc3('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x0fc3('0x1b'))(new Redis(config[_0x0fc3('0x19')]));require('./dashboardItem.socket')[_0x0fc3('0x1c')](socket);function respondWithStatusCode(_0x1e4bae,_0x5e49e4){_0x5e49e4=_0x5e49e4||0xcc;return function(_0x2d6d0d){if(_0x2d6d0d){return _0x1e4bae[_0x0fc3('0x1d')](_0x5e49e4);}return _0x1e4bae[_0x0fc3('0x1e')](_0x5e49e4)[_0x0fc3('0x1f')]();};}function respondWithResult(_0x1b1c14,_0x153044){_0x153044=_0x153044||0xc8;return function(_0x31ad6b){if(_0x31ad6b){return _0x1b1c14[_0x0fc3('0x1e')](_0x153044)[_0x0fc3('0x20')](_0x31ad6b);}};}function respondWithFilteredResult(_0x1d8d69,_0x48e997){return function(_0x117e36){if(_0x117e36){var _0x5342db=typeof _0x48e997[_0x0fc3('0x21')]==='undefined'&&typeof _0x48e997['limit']===_0x0fc3('0x22');var _0x33db03=_0x117e36[_0x0fc3('0x23')];var _0x21a075=_0x5342db?0x0:_0x48e997['offset'];var _0x705c46=_0x5342db?_0x117e36['count']:_0x48e997[_0x0fc3('0x21')]+_0x48e997[_0x0fc3('0x24')];var _0xd16e6e;if(_0x705c46>=_0x33db03){_0x705c46=_0x33db03;_0xd16e6e=0xc8;}else{_0xd16e6e=0xce;}_0x1d8d69[_0x0fc3('0x1e')](_0xd16e6e);return _0x1d8d69[_0x0fc3('0x25')](_0x0fc3('0x26'),_0x21a075+'-'+_0x705c46+'/'+_0x33db03)['json'](_0x117e36);}return null;};}function patchUpdates(_0x307dc4){return function(_0x30efad){try{jsonpatch[_0x0fc3('0x27')](_0x30efad,_0x307dc4,!![]);}catch(_0x1a09f7){return BPromise[_0x0fc3('0x28')](_0x1a09f7);}return _0x30efad[_0x0fc3('0x29')]();};}function saveUpdates(_0x2f9dea,_0x50a7b2){return function(_0x3bf2c9){if(_0x3bf2c9){return _0x3bf2c9[_0x0fc3('0x2a')](_0x2f9dea)[_0x0fc3('0x2b')](function(_0x2a1567){return _0x2a1567;});}return null;};}function removeEntity(_0x40010c,_0xf56354){return function(_0x3be557){if(_0x3be557){return _0x3be557[_0x0fc3('0x2c')]()[_0x0fc3('0x2b')](function(){_0x40010c[_0x0fc3('0x1e')](0xcc)[_0x0fc3('0x1f')]();});}};}function handleEntityNotFound(_0x2d7d66,_0x10d9a2){return function(_0x3eee55){if(!_0x3eee55){_0x2d7d66[_0x0fc3('0x1d')](0x194);}return _0x3eee55;};}function handleError(_0x1a474e,_0x4f51b1){_0x4f51b1=_0x4f51b1||0x1f4;return function(_0xfc1069){logger[_0x0fc3('0x2d')](_0xfc1069[_0x0fc3('0x2e')]);if(_0xfc1069[_0x0fc3('0x2f')]){delete _0xfc1069[_0x0fc3('0x2f')];}_0x1a474e[_0x0fc3('0x1e')](_0x4f51b1)[_0x0fc3('0x30')](_0xfc1069);};}exports[_0x0fc3('0x31')]=function(_0x4c247f,_0x2cdb8f){var _0x49c617={'raw':![],'where':{'id':_0x4c247f[_0x0fc3('0x32')]['id']}},_0x14732f={};_0x14732f[_0x0fc3('0x33')]=_['keys'](db[_0x0fc3('0x34')]['rawAttributes']);_0x14732f['query']=_[_0x0fc3('0x35')](_0x4c247f['query']);_0x14732f['filters']=_[_0x0fc3('0x36')](_0x14732f[_0x0fc3('0x33')],_0x14732f['query']);_0x49c617[_0x0fc3('0x37')]=_[_0x0fc3('0x36')](_0x14732f['model'],qs[_0x0fc3('0x38')](_0x4c247f['query']['fields']));_0x49c617[_0x0fc3('0x37')]=_0x49c617[_0x0fc3('0x37')]['length']?_0x49c617[_0x0fc3('0x37')]:_0x14732f[_0x0fc3('0x33')];if(_0x4c247f[_0x0fc3('0x39')][_0x0fc3('0x3a')]){_0x49c617['include']=[{'all':!![]}];}_0x49c617=_[_0x0fc3('0x3b')]({},_0x49c617,_0x4c247f[_0x0fc3('0x3c')]);return db[_0x0fc3('0x34')][_0x0fc3('0x3d')](_0x49c617)[_0x0fc3('0x2b')](handleEntityNotFound(_0x2cdb8f,null))[_0x0fc3('0x2b')](respondWithResult(_0x2cdb8f,null))[_0x0fc3('0x3e')](handleError(_0x2cdb8f,null));};exports[_0x0fc3('0x2c')]=function(_0x1d7b8e,_0x785a47){return db[_0x0fc3('0x34')]['find']({'where':{'id':_0x1d7b8e[_0x0fc3('0x32')]['id']}})[_0x0fc3('0x2b')](handleEntityNotFound(_0x785a47,null))[_0x0fc3('0x2b')](removeEntity(_0x785a47,null))['catch'](handleError(_0x785a47,null));};function widgetAttributes(_0x39b88b){try{switch(_0x39b88b['type']){case _0x0fc3('0x3f'):return[{'name':_0x0fc3('0x40'),'value':_0x39b88b[_0x0fc3('0x40')]||(_0x39b88b[_0x0fc3('0x41')]&&_0x39b88b[_0x0fc3('0x41')][0x0]?_0x39b88b['attrs'][0x0]['value']:undefined)||_0x0fc3('0x42')}];case'custom':return[{'name':_0x0fc3('0x43'),'value':_0x39b88b['attrPath']||(_0x39b88b[_0x0fc3('0x41')]&&_0x39b88b['attrs'][0x0]?_0x39b88b[_0x0fc3('0x41')][0x0][_0x0fc3('0x44')]:undefined)||''}];case _0x0fc3('0x45'):return[{'name':_0x0fc3('0x46'),'value':_0x39b88b[_0x0fc3('0x46')]||(_0x39b88b[_0x0fc3('0x41')]&&_0x39b88b[_0x0fc3('0x41')][0x0]?_0x39b88b[_0x0fc3('0x41')][0x0][_0x0fc3('0x44')]:undefined)||_0x0fc3('0x47')},{'name':_0x0fc3('0x48'),'value':_0x39b88b[_0x0fc3('0x48')]||(_0x39b88b[_0x0fc3('0x41')]&&_0x39b88b[_0x0fc3('0x41')][0x1]?_0x39b88b[_0x0fc3('0x41')][0x1][_0x0fc3('0x44')]:undefined)||_0x0fc3('0x49')},{'name':_0x0fc3('0x4a'),'value':_0x39b88b[_0x0fc3('0x4a')]||(_0x39b88b[_0x0fc3('0x41')]&&_0x39b88b['attrs'][0x2]?_0x39b88b[_0x0fc3('0x41')][0x2][_0x0fc3('0x44')]:undefined)||0xc}];case'counter':return[{'name':'attrMetric','value':_0x39b88b[_0x0fc3('0x4b')]||(_0x39b88b['attrs']&&_0x39b88b[_0x0fc3('0x41')][0x0]?_0x39b88b[_0x0fc3('0x41')][0x0][_0x0fc3('0x44')]:undefined)||_0x0fc3('0x4c')},{'name':_0x0fc3('0x4d'),'value':_0x39b88b[_0x0fc3('0x4d')]||(_0x39b88b[_0x0fc3('0x41')]&&_0x39b88b[_0x0fc3('0x41')][0x1]?_0x39b88b['attrs'][0x1][_0x0fc3('0x44')]:undefined)||[]},{'name':'attrFontSize','value':_0x39b88b[_0x0fc3('0x4a')]||(_0x39b88b[_0x0fc3('0x41')]&&_0x39b88b[_0x0fc3('0x41')][0x2]?_0x39b88b[_0x0fc3('0x41')][0x2][_0x0fc3('0x44')]:undefined)||0x14}];case'multibar-chart':case _0x0fc3('0x4e'):return[{'name':_0x0fc3('0x4f'),'value':_0x39b88b[_0x0fc3('0x4f')]||(_0x39b88b['attrs']&&_0x39b88b[_0x0fc3('0x41')][0x0]?_0x39b88b[_0x0fc3('0x41')][0x0]['value']:undefined)||_0x0fc3('0x4c')},{'name':_0x0fc3('0x50'),'value':_0x39b88b[_0x0fc3('0x50')]||(_0x39b88b['attrs']&&_0x39b88b[_0x0fc3('0x41')][0x1]?_0x39b88b[_0x0fc3('0x41')][0x1][_0x0fc3('0x44')]:undefined)||null},{'name':_0x0fc3('0x51'),'value':_0x39b88b[_0x0fc3('0x51')]||(_0x39b88b[_0x0fc3('0x41')]&&_0x39b88b[_0x0fc3('0x41')][0x2]?_0x39b88b[_0x0fc3('0x41')][0x2][_0x0fc3('0x44')]:undefined)||null},{'name':_0x0fc3('0x4d'),'value':_0x39b88b[_0x0fc3('0x4d')]||(_0x39b88b['attrs']&&_0x39b88b[_0x0fc3('0x41')][0x3]?_0x39b88b[_0x0fc3('0x41')][0x3][_0x0fc3('0x44')]:undefined)||[]}];case _0x0fc3('0x52'):return[{'name':_0x0fc3('0x53'),'type':_0x39b88b[_0x0fc3('0x54')]||(_0x39b88b[_0x0fc3('0x41')]&&_0x39b88b[_0x0fc3('0x41')][0x0]?_0x39b88b[_0x0fc3('0x41')][0x0]['type']:undefined)||null,'value':_0x39b88b['attrReport']||(_0x39b88b['attrs']&&_0x39b88b[_0x0fc3('0x41')][0x0]?_0x39b88b[_0x0fc3('0x41')][0x0][_0x0fc3('0x44')]:undefined)||null},{'name':'attrRefresh','value':_0x39b88b[_0x0fc3('0x55')]||(_0x39b88b['attrs']&&_0x39b88b[_0x0fc3('0x41')][0x1]?_0x39b88b['attrs'][0x1][_0x0fc3('0x44')]:undefined)||0x0}];default:return[];}}catch(_0x3adb4f){logger['error'](_0x0fc3('0x56'),JSON[_0x0fc3('0x57')](_0x3adb4f));return[];}}exports[_0x0fc3('0x58')]=function(_0x5f0da8,_0xe6e6ee){if(_0x5f0da8[_0x0fc3('0x59')]){_0x5f0da8[_0x0fc3('0x59')][_0x0fc3('0x41')]=widgetAttributes(_0x5f0da8[_0x0fc3('0x59')]);}return db[_0x0fc3('0x34')][_0x0fc3('0x58')](_0x5f0da8['body'],{})[_0x0fc3('0x2b')](respondWithResult(_0xe6e6ee,0xc9))[_0x0fc3('0x3e')](handleError(_0xe6e6ee,null));};exports[_0x0fc3('0x2a')]=function(_0x467670,_0x301ff9){if(_0x467670['body']['id']){delete _0x467670[_0x0fc3('0x59')]['id'];}_0x467670['body'][_0x0fc3('0x41')]=widgetAttributes(_0x467670[_0x0fc3('0x59')]);return db['DashboardItem'][_0x0fc3('0x3d')]({'where':{'id':_0x467670[_0x0fc3('0x32')]['id']}})[_0x0fc3('0x2b')](handleEntityNotFound(_0x301ff9,null))[_0x0fc3('0x2b')](saveUpdates(_0x467670['body'],null))[_0x0fc3('0x2b')](respondWithResult(_0x301ff9,null))[_0x0fc3('0x3e')](handleError(_0x301ff9,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 9ec1f90..ed23ecd 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 _0x79df=['setMaxListeners','save','update','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x79df,0xee));var _0xf79d=function(_0x399483,_0x14a697){_0x399483=_0x399483-0x0;var _0x5da8b4=_0x79df[_0x399483];return _0x5da8b4;};'use strict';var EventEmitter=require(_0xf79d('0x0'));var DashboardItem=require(_0xf79d('0x1'))['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xf79d('0x2')](0x0);var events={'afterCreate':_0xf79d('0x3'),'afterUpdate':_0xf79d('0x4'),'afterDestroy':'remove'};function emitEvent(_0xed2f6e){return function(_0xe34d08,_0x3f4ed4,_0x2e1d34){DashboardItemEvents[_0xf79d('0x5')](_0xed2f6e+':'+_0xe34d08['id'],_0xe34d08);DashboardItemEvents[_0xf79d('0x5')](_0xed2f6e,_0xe34d08);_0x2e1d34(null);};}for(var e in events){if(events[_0xf79d('0x6')](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0xf79d('0x7')]=DashboardItemEvents; \ No newline at end of file +var _0x8946=['hasOwnProperty','hook','exports','events','../../mysqldb','DashboardItem','setMaxListeners','emit'];(function(_0x15fab0,_0x416c7d){var _0x1b41a8=function(_0x30d165){while(--_0x30d165){_0x15fab0['push'](_0x15fab0['shift']());}};_0x1b41a8(++_0x416c7d);}(_0x8946,0x193));var _0x6894=function(_0x34843e,_0x4c4224){_0x34843e=_0x34843e-0x0;var _0x598f7f=_0x8946[_0x34843e];return _0x598f7f;};'use strict';var EventEmitter=require(_0x6894('0x0'));var DashboardItem=require(_0x6894('0x1'))['db'][_0x6894('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x6894('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x434bfa){return function(_0x55c9bb,_0x220744,_0x448350){DashboardItemEvents[_0x6894('0x4')](_0x434bfa+':'+_0x55c9bb['id'],_0x55c9bb);DashboardItemEvents[_0x6894('0x4')](_0x434bfa,_0x55c9bb);_0x448350(null);};}for(var e in events){if(events[_0x6894('0x5')](e)){var event=events[e];DashboardItem[_0x6894('0x6')](e,emitEvent(event));}}module[_0x6894('0x7')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 297a557..d585533 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 _0x4200=['../../config/logger','api','moment','bluebird','./dashboardItem.attributes','exports','define','DashboardItem','dashboard_items','util'];(function(_0x23f0bd,_0x4beb7e){var _0x44756a=function(_0x35b924){while(--_0x35b924){_0x23f0bd['push'](_0x23f0bd['shift']());}};_0x44756a(++_0x4beb7e);}(_0x4200,0x199));var _0x0420=function(_0x1d0be5,_0x4d7d8f){_0x1d0be5=_0x1d0be5-0x0;var _0x91c519=_0x4200[_0x1d0be5];return _0x91c519;};'use strict';var _=require('lodash');var util=require(_0x0420('0x0'));var logger=require(_0x0420('0x1'))(_0x0420('0x2'));var moment=require(_0x0420('0x3'));var BPromise=require(_0x0420('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(_0x0420('0x5'));module[_0x0420('0x6')]=function(_0x4d7002,_0x4670d6){return _0x4d7002[_0x0420('0x7')](_0x0420('0x8'),attributes,{'tableName':_0x0420('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa329=['../../config/logger','moment','bluebird','request-promise','path','../../config/environment','exports','DashboardItem','dashboard_items','lodash','util'];(function(_0x112077,_0x46b57f){var _0x3ead41=function(_0x4e5347){while(--_0x4e5347){_0x112077['push'](_0x112077['shift']());}};_0x3ead41(++_0x46b57f);}(_0xa329,0x1cc));var _0x9a32=function(_0x436cb5,_0x2cb52a){_0x436cb5=_0x436cb5-0x0;var _0x57bb18=_0xa329[_0x436cb5];return _0x57bb18;};'use strict';var _=require(_0x9a32('0x0'));var util=require(_0x9a32('0x1'));var logger=require(_0x9a32('0x2'))('api');var moment=require(_0x9a32('0x3'));var BPromise=require(_0x9a32('0x4'));var rp=require(_0x9a32('0x5'));var fs=require('fs');var path=require(_0x9a32('0x6'));var rimraf=require('rimraf');var config=require(_0x9a32('0x7'));var attributes=require('./dashboardItem.attributes');module[_0x9a32('0x8')]=function(_0x34e3c6,_0x3ac937){return _0x34e3c6['define'](_0x9a32('0x9'),attributes,{'tableName':_0x9a32('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.rpc.js b/server/api/dashboardItem/dashboardItem.rpc.js index ae44deb..4ed8cbd 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 _0xc03f=['socket.io-emitter','./dashboardItem.socket','register','then','info','DashboardItem,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis'];(function(_0x3c5735,_0x1f4f53){var _0x2cd61d=function(_0x183e55){while(--_0x183e55){_0x3c5735['push'](_0x3c5735['shift']());}};_0x2cd61d(++_0x1f4f53);}(_0xc03f,0x115));var _0xfc03=function(_0x4a6c4d,_0x455768){_0x4a6c4d=_0x4a6c4d-0x0;var _0x31800b=_0xc03f[_0x4a6c4d];return _0x31800b;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xfc03('0x0'));var rs=require(_0xfc03('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfc03('0x2'))['db'];var utils=require(_0xfc03('0x3'));var logger=require('../../config/logger')(_0xfc03('0x4'));var config=require(_0xfc03('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xfc03('0x6')][_0xfc03('0x7')]({'port':0x232a});config[_0xfc03('0x8')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xfc03('0x9'))(new Redis(config[_0xfc03('0x8')]));require(_0xfc03('0xa'))[_0xfc03('0xb')](socket);function respondWithRpcPromise(_0x4b7ce7,_0x2dfa43,_0x411b9f){return new BPromise(function(_0x2152c,_0xb40c53){return client['request'](_0x4b7ce7,_0x411b9f)[_0xfc03('0xc')](function(_0x1ecd8d){logger[_0xfc03('0xd')](_0xfc03('0xe'),_0x2dfa43,'request\x20sent');logger[_0xfc03('0xf')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0x2dfa43,'request\x20sent',JSON[_0xfc03('0x10')](_0x1ecd8d));if(_0x1ecd8d[_0xfc03('0x11')]){if(_0x1ecd8d[_0xfc03('0x11')][_0xfc03('0x12')]===0x1f4){logger['error'](_0xfc03('0xe'),_0x2dfa43,_0x1ecd8d[_0xfc03('0x11')][_0xfc03('0x13')]);return _0xb40c53(_0x1ecd8d[_0xfc03('0x11')][_0xfc03('0x13')]);}logger[_0xfc03('0x11')]('DashboardItem,\x20%s,\x20%s',_0x2dfa43,_0x1ecd8d['error']['message']);return _0x2152c(_0x1ecd8d['error'][_0xfc03('0x13')]);}else{logger[_0xfc03('0xd')](_0xfc03('0xe'),_0x2dfa43,_0xfc03('0x14'));_0x2152c(_0x1ecd8d[_0xfc03('0x15')][_0xfc03('0x13')]);}})['catch'](function(_0x117d1f){logger[_0xfc03('0x11')]('DashboardItem,\x20%s,\x20%s',_0x2dfa43,_0x117d1f);_0xb40c53(_0x117d1f);});});} \ No newline at end of file +var _0x8233=['request\x20sent','result','catch','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','request','then','DashboardItem,\x20%s,\x20%s,\x20%s','error','code','DashboardItem,\x20%s,\x20%s','message','info'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0x8233,0x198));var _0x3823=function(_0x594508,_0x4e384d){_0x594508=_0x594508-0x0;var _0x37d50d=_0x8233[_0x594508];return _0x37d50d;};'use strict';var _=require('lodash');var util=require(_0x3823('0x0'));var moment=require(_0x3823('0x1'));var BPromise=require('bluebird');var rs=require(_0x3823('0x2'));var fs=require('fs');var Redis=require(_0x3823('0x3'));var db=require(_0x3823('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3823('0x5'));var config=require(_0x3823('0x6'));var jayson=require(_0x3823('0x7'));var client=jayson[_0x3823('0x8')][_0x3823('0x9')]({'port':0x232a});config[_0x3823('0xa')]=_[_0x3823('0xb')](config[_0x3823('0xa')],{'host':_0x3823('0xc'),'port':0x18eb});var socket=require(_0x3823('0xd'))(new Redis(config[_0x3823('0xa')]));require(_0x3823('0xe'))[_0x3823('0xf')](socket);function respondWithRpcPromise(_0x5177f2,_0x38e37e,_0x1d7fe1){return new BPromise(function(_0x15b429,_0x49ebd7){return client[_0x3823('0x10')](_0x5177f2,_0x1d7fe1)[_0x3823('0x11')](function(_0x136f5e){logger['info']('DashboardItem,\x20%s,\x20%s',_0x38e37e,'request\x20sent');logger['debug'](_0x3823('0x12'),_0x38e37e,'request\x20sent',JSON['stringify'](_0x136f5e));if(_0x136f5e[_0x3823('0x13')]){if(_0x136f5e[_0x3823('0x13')][_0x3823('0x14')]===0x1f4){logger['error'](_0x3823('0x15'),_0x38e37e,_0x136f5e[_0x3823('0x13')][_0x3823('0x16')]);return _0x49ebd7(_0x136f5e[_0x3823('0x13')][_0x3823('0x16')]);}logger['error'](_0x3823('0x15'),_0x38e37e,_0x136f5e[_0x3823('0x13')][_0x3823('0x16')]);return _0x15b429(_0x136f5e[_0x3823('0x13')][_0x3823('0x16')]);}else{logger[_0x3823('0x17')]('DashboardItem,\x20%s,\x20%s',_0x38e37e,_0x3823('0x18'));_0x15b429(_0x136f5e[_0x3823('0x19')][_0x3823('0x16')]);}})[_0x3823('0x1a')](function(_0x40fa74){logger[_0x3823('0x13')](_0x3823('0x15'),_0x38e37e,_0x40fa74);_0x49ebd7(_0x40fa74);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 3ea0639..12a6838 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 _0xdfed=['update','removeListener','register','dashboardItem:','./dashboardItem.events','save','remove'];(function(_0x14128a,_0x3762b6){var _0x2b0968=function(_0x293c7e){while(--_0x293c7e){_0x14128a['push'](_0x14128a['shift']());}};_0x2b0968(++_0x3762b6);}(_0xdfed,0x146));var _0xddfe=function(_0x15de11,_0x3cd20d){_0x15de11=_0x15de11-0x0;var _0x4f1c07=_0xdfed[_0x15de11];return _0x4f1c07;};'use strict';var DashboardItemEvents=require(_0xddfe('0x0'));var events=[_0xddfe('0x1'),_0xddfe('0x2'),_0xddfe('0x3')];function createListener(_0xc84d86,_0x5367f3){return function(_0x432e15){_0x5367f3['emit'](_0xc84d86,_0x432e15);};}function removeListener(_0xa25f8d,_0x34df63){return function(){DashboardItemEvents[_0xddfe('0x4')](_0xa25f8d,_0x34df63);};}exports[_0xddfe('0x5')]=function(_0x295904){for(var _0x3c81e4=0x0,_0x5c82b1=events['length'];_0x3c81e4<_0x5c82b1;_0x3c81e4++){var _0x3d80e6=events[_0x3c81e4];var _0x3de6f8=createListener(_0xddfe('0x6')+_0x3d80e6,_0x295904);DashboardItemEvents['on'](_0x3d80e6,_0x3de6f8);}}; \ No newline at end of file +var _0x6ee3=['register','length','dashboardItem:','./dashboardItem.events','save','remove','update','emit'];(function(_0x3d00db,_0x3692b3){var _0x41f115=function(_0x3c94fd){while(--_0x3c94fd){_0x3d00db['push'](_0x3d00db['shift']());}};_0x41f115(++_0x3692b3);}(_0x6ee3,0xcb));var _0x36ee=function(_0x4cc0ec,_0x5da39f){_0x4cc0ec=_0x4cc0ec-0x0;var _0x1d2004=_0x6ee3[_0x4cc0ec];return _0x1d2004;};'use strict';var DashboardItemEvents=require(_0x36ee('0x0'));var events=[_0x36ee('0x1'),_0x36ee('0x2'),_0x36ee('0x3')];function createListener(_0x4a1864,_0x564481){return function(_0x56253b){_0x564481[_0x36ee('0x4')](_0x4a1864,_0x56253b);};}function removeListener(_0x2e3110,_0x3c6233){return function(){DashboardItemEvents['removeListener'](_0x2e3110,_0x3c6233);};}exports[_0x36ee('0x5')]=function(_0x33fd17){for(var _0x2feabb=0x0,_0x5c967a=events[_0x36ee('0x6')];_0x2feabb<_0x5c967a;_0x2feabb++){var _0x54ef21=events[_0x2feabb];var _0x5e9671=createListener(_0x36ee('0x7')+_0x54ef21,_0x33fd17);DashboardItemEvents['on'](_0x54ef21,_0x5e9671);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index f336e97..2b5d560 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 _0x53e6=['../../components/interaction/service','../../config/environment','./dashboardItem.controller','isAuthenticated','show','post','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x53e6,0x66));var _0x653e=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x53e6[_0x42cae2];return _0x5f256f;};'use strict';var multer=require(_0x653e('0x0'));var util=require('util');var path=require(_0x653e('0x1'));var timeout=require(_0x653e('0x2'));var express=require('express');var router=express[_0x653e('0x3')]();var fs_extra=require(_0x653e('0x4'));var auth=require(_0x653e('0x5'));var interaction=require(_0x653e('0x6'));var config=require(_0x653e('0x7'));var controller=require(_0x653e('0x8'));router['get']('/:id',auth[_0x653e('0x9')](),controller[_0x653e('0xa')]);router[_0x653e('0xb')]('/',auth[_0x653e('0x9')](),controller['create']);router[_0x653e('0xc')](_0x653e('0xd'),auth[_0x653e('0x9')](),controller[_0x653e('0xe')]);router[_0x653e('0xf')]('/:id',auth[_0x653e('0x9')](),controller[_0x653e('0x10')]);module[_0x653e('0x11')]=router; \ No newline at end of file +var _0x99ad=['update','exports','path','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','show','post','create','put','/:id'];(function(_0x344b9e,_0x5f2d46){var _0x2b7d14=function(_0x35dfa7){while(--_0x35dfa7){_0x344b9e['push'](_0x344b9e['shift']());}};_0x2b7d14(++_0x5f2d46);}(_0x99ad,0x136));var _0xd99a=function(_0x177ce7,_0x47b859){_0x177ce7=_0x177ce7-0x0;var _0x19b2b9=_0x99ad[_0x177ce7];return _0x19b2b9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd99a('0x0'));var timeout=require('connect-timeout');var express=require(_0xd99a('0x1'));var router=express[_0xd99a('0x2')]();var fs_extra=require(_0xd99a('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xd99a('0x4'));var config=require('../../config/environment');var controller=require('./dashboardItem.controller');router[_0xd99a('0x5')]('/:id',auth[_0xd99a('0x6')](),controller[_0xd99a('0x7')]);router[_0xd99a('0x8')]('/',auth[_0xd99a('0x6')](),controller[_0xd99a('0x9')]);router[_0xd99a('0xa')](_0xd99a('0xb'),auth['isAuthenticated'](),controller[_0xd99a('0xc')]);router['delete'](_0xd99a('0xb'),auth[_0xd99a('0x6')](),controller['destroy']);module[_0xd99a('0xd')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 1cda343..59bb17d 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 _0xc441=['exports','STRING','ENUM','second','third','first'];(function(_0x591d95,_0x3df684){var _0x472982=function(_0x20942b){while(--_0x20942b){_0x591d95['push'](_0x591d95['shift']());}};_0x472982(++_0x3df684);}(_0xc441,0x7e));var _0x1c44=function(_0x43c3b,_0x70b26c){_0x43c3b=_0x43c3b-0x0;var _0xba99e1=_0xc441[_0x43c3b];return _0xba99e1;};'use strict';var Sequelize=require('sequelize');module[_0x1c44('0x0')]={'name':{'type':Sequelize[_0x1c44('0x1')],'allowNull':![]},'level':{'type':Sequelize[_0x1c44('0x2')]('first',_0x1c44('0x3'),_0x1c44('0x4')),'allowNull':![],'defaultValue':_0x1c44('0x5')},'description':{'type':Sequelize[_0x1c44('0x1')]}}; \ No newline at end of file +var _0x8823=['STRING','ENUM','first','second','third','sequelize'];(function(_0x51c2cb,_0x19e4d5){var _0x2433fa=function(_0x100587){while(--_0x100587){_0x51c2cb['push'](_0x51c2cb['shift']());}};_0x2433fa(++_0x19e4d5);}(_0x8823,0xf5));var _0x3882=function(_0x468e9e,_0x5aa325){_0x468e9e=_0x468e9e-0x0;var _0x2d0d1b=_0x8823[_0x468e9e];return _0x2d0d1b;};'use strict';var Sequelize=require(_0x3882('0x0'));module['exports']={'name':{'type':Sequelize[_0x3882('0x1')],'allowNull':![]},'level':{'type':Sequelize[_0x3882('0x2')](_0x3882('0x3'),_0x3882('0x4'),_0x3882('0x5')),'allowNull':![],'defaultValue':_0x3882('0x3')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index d24090e..680e507 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 _0x4330=['../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','Dispositions','UserProfileResource','stack','name','send','index','map','Disposition','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','length','attributes','sort','where','pick','filter','merge','include','findAll','rows','catch','show','params','includeAll','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0x4330,0x13d));var _0x0433=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0x4330[_0x2b7764];return _0x848dcb;};'use strict';var emlformat=require(_0x0433('0x0'));var rimraf=require(_0x0433('0x1'));var zipdir=require(_0x0433('0x2'));var jsonpatch=require(_0x0433('0x3'));var rp=require(_0x0433('0x4'));var moment=require(_0x0433('0x5'));var BPromise=require(_0x0433('0x6'));var Mustache=require(_0x0433('0x7'));var util=require(_0x0433('0x8'));var path=require(_0x0433('0x9'));var sox=require(_0x0433('0xa'));var csv=require(_0x0433('0xb'));var ejs=require(_0x0433('0xc'));var fs=require('fs');var fs_extra=require(_0x0433('0xd'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x0433('0xe'));var jsforce=require(_0x0433('0xf'));var deskjs=require(_0x0433('0x10'));var toCsv=require(_0x0433('0xb'));var querystring=require(_0x0433('0x11'));var Papa=require('papaparse');var Redis=require(_0x0433('0x12'));var authService=require(_0x0433('0x13'));var qs=require(_0x0433('0x14'));var as=require(_0x0433('0x15'));var hardwareService=require(_0x0433('0x16'));var logger=require(_0x0433('0x17'))('api');var utils=require(_0x0433('0x18'));var config=require(_0x0433('0x19'));var licenseUtil=require(_0x0433('0x1a'));var db=require(_0x0433('0x1b'))['db'];function respondWithStatusCode(_0x49a14e,_0x5a1edc){_0x5a1edc=_0x5a1edc||0xcc;return function(_0x5b629e){if(_0x5b629e){return _0x49a14e[_0x0433('0x1c')](_0x5a1edc);}return _0x49a14e[_0x0433('0x1d')](_0x5a1edc)[_0x0433('0x1e')]();};}function respondWithResult(_0x562a4e,_0x2203f4){_0x2203f4=_0x2203f4||0xc8;return function(_0x219cde){if(_0x219cde){return _0x562a4e[_0x0433('0x1d')](_0x2203f4)[_0x0433('0x1f')](_0x219cde);}};}function respondWithFilteredResult(_0x3cb569,_0x343c5a){return function(_0x10ab77){if(_0x10ab77){var _0x3cf0e8=typeof _0x343c5a[_0x0433('0x20')]===_0x0433('0x21')&&typeof _0x343c5a[_0x0433('0x22')]===_0x0433('0x21');var _0x4ab561=_0x10ab77[_0x0433('0x23')];var _0x5accf5=_0x3cf0e8?0x0:_0x343c5a['offset'];var _0x2dccbc=_0x3cf0e8?_0x10ab77[_0x0433('0x23')]:_0x343c5a[_0x0433('0x20')]+_0x343c5a['limit'];var _0x11002e;if(_0x2dccbc>=_0x4ab561){_0x2dccbc=_0x4ab561;_0x11002e=0xc8;}else{_0x11002e=0xce;}_0x3cb569[_0x0433('0x1d')](_0x11002e);return _0x3cb569[_0x0433('0x24')](_0x0433('0x25'),_0x5accf5+'-'+_0x2dccbc+'/'+_0x4ab561)['json'](_0x10ab77);}return null;};}function patchUpdates(_0x3e09cd){return function(_0x30bca5){try{jsonpatch[_0x0433('0x26')](_0x30bca5,_0x3e09cd,!![]);}catch(_0x38d1d4){return BPromise[_0x0433('0x27')](_0x38d1d4);}return _0x30bca5['save']();};}function saveUpdates(_0x5048a1,_0x55bdba){return function(_0x7577b0){if(_0x7577b0){return _0x7577b0[_0x0433('0x28')](_0x5048a1)[_0x0433('0x29')](function(_0x272b91){return _0x272b91;});}return null;};}function removeEntity(_0x956d,_0x32e035){return function(_0x36bd8b){if(_0x36bd8b){return _0x36bd8b[_0x0433('0x2a')]()[_0x0433('0x29')](function(){var _0x24f1e2=_0x36bd8b[_0x0433('0x2b')]({'plain':!![]});var _0x5007a9=_0x0433('0x2c');return db[_0x0433('0x2d')]['destroy']({'where':{'type':_0x5007a9,'resourceId':_0x24f1e2['id']}})['then'](function(){return _0x36bd8b;});})[_0x0433('0x29')](function(){_0x956d[_0x0433('0x1d')](0xcc)[_0x0433('0x1e')]();});}};}function handleEntityNotFound(_0x2237da,_0x14cf16){return function(_0x18b840){if(!_0x18b840){_0x2237da[_0x0433('0x1c')](0x194);}return _0x18b840;};}function handleError(_0x2d08cf,_0x3b6f39){_0x3b6f39=_0x3b6f39||0x1f4;return function(_0x3ae499){logger['error'](_0x3ae499[_0x0433('0x2e')]);if(_0x3ae499[_0x0433('0x2f')]){delete _0x3ae499[_0x0433('0x2f')];}_0x2d08cf['status'](_0x3b6f39)[_0x0433('0x30')](_0x3ae499);};}exports[_0x0433('0x31')]=function(_0x3df239,_0x2d47b8){var _0x338c4e={},_0xc2aa92={},_0x115c72={'count':0x0,'rows':[]};var _0x18dc44=_[_0x0433('0x32')](db[_0x0433('0x33')][_0x0433('0x34')],function(_0x21da5d){return{'name':_0x21da5d[_0x0433('0x35')],'type':_0x21da5d[_0x0433('0x36')][_0x0433('0x37')]};});_0xc2aa92[_0x0433('0x38')]=_['map'](_0x18dc44,_0x0433('0x2f'));_0xc2aa92['query']=_[_0x0433('0x39')](_0x3df239[_0x0433('0x3a')]);_0xc2aa92[_0x0433('0x3b')]=_['intersection'](_0xc2aa92[_0x0433('0x38')],_0xc2aa92[_0x0433('0x3a')]);_0x338c4e['attributes']=_[_0x0433('0x3c')](_0xc2aa92['model'],qs['fields'](_0x3df239[_0x0433('0x3a')][_0x0433('0x3d')]));_0x338c4e['attributes']=_0x338c4e['attributes'][_0x0433('0x3e')]?_0x338c4e[_0x0433('0x3f')]:_0xc2aa92[_0x0433('0x38')];if(!_0x3df239[_0x0433('0x3a')]['hasOwnProperty']('nolimit')){_0x338c4e[_0x0433('0x22')]=qs[_0x0433('0x22')](_0x3df239[_0x0433('0x3a')][_0x0433('0x22')]);_0x338c4e['offset']=qs[_0x0433('0x20')](_0x3df239[_0x0433('0x3a')][_0x0433('0x20')]);}_0x338c4e['order']=qs[_0x0433('0x40')](_0x3df239[_0x0433('0x3a')][_0x0433('0x40')]);_0x338c4e[_0x0433('0x41')]=qs[_0x0433('0x3b')](_[_0x0433('0x42')](_0x3df239[_0x0433('0x3a')],_0xc2aa92['filters']),_0x18dc44);if(_0x3df239[_0x0433('0x3a')][_0x0433('0x43')]){_0x338c4e[_0x0433('0x41')]=_['merge'](_0x338c4e[_0x0433('0x41')],{'$or':_[_0x0433('0x32')](_0x18dc44,function(_0x30851b){if(_0x30851b['type']!=='VIRTUAL'){var _0x192f5c={};_0x192f5c[_0x30851b['name']]={'$like':'%'+_0x3df239[_0x0433('0x3a')][_0x0433('0x43')]+'%'};return _0x192f5c;}})});}_0x338c4e=_[_0x0433('0x44')]({},_0x338c4e,_0x3df239['options']);var _0x4f45e5={'where':_0x338c4e[_0x0433('0x41')]};return db[_0x0433('0x33')][_0x0433('0x23')](_0x4f45e5)[_0x0433('0x29')](function(_0xd628b7){_0x115c72[_0x0433('0x23')]=_0xd628b7;if(_0x3df239[_0x0433('0x3a')]['includeAll']){_0x338c4e[_0x0433('0x45')]=[{'all':!![]}];}return db['Disposition'][_0x0433('0x46')](_0x338c4e);})[_0x0433('0x29')](function(_0x582187){_0x115c72[_0x0433('0x47')]=_0x582187;return _0x115c72;})[_0x0433('0x29')](respondWithFilteredResult(_0x2d47b8,_0x338c4e))[_0x0433('0x48')](handleError(_0x2d47b8,null));};exports[_0x0433('0x49')]=function(_0x4ac64b,_0x5c0a49){var _0x232f28={'raw':!![],'where':{'id':_0x4ac64b[_0x0433('0x4a')]['id']}},_0x1ac739={};_0x1ac739[_0x0433('0x38')]=_[_0x0433('0x39')](db[_0x0433('0x33')][_0x0433('0x34')]);_0x1ac739['query']=_['keys'](_0x4ac64b[_0x0433('0x3a')]);_0x1ac739[_0x0433('0x3b')]=_[_0x0433('0x3c')](_0x1ac739['model'],_0x1ac739[_0x0433('0x3a')]);_0x232f28[_0x0433('0x3f')]=_[_0x0433('0x3c')](_0x1ac739[_0x0433('0x38')],qs['fields'](_0x4ac64b['query'][_0x0433('0x3d')]));_0x232f28[_0x0433('0x3f')]=_0x232f28[_0x0433('0x3f')][_0x0433('0x3e')]?_0x232f28[_0x0433('0x3f')]:_0x1ac739[_0x0433('0x38')];if(_0x4ac64b[_0x0433('0x3a')][_0x0433('0x4b')]){_0x232f28[_0x0433('0x45')]=[{'all':!![]}];}_0x232f28=_[_0x0433('0x44')]({},_0x232f28,_0x4ac64b[_0x0433('0x4c')]);return db['Disposition']['find'](_0x232f28)[_0x0433('0x29')](handleEntityNotFound(_0x5c0a49,null))[_0x0433('0x29')](respondWithResult(_0x5c0a49,null))[_0x0433('0x48')](handleError(_0x5c0a49,null));};exports['create']=function(_0x3df294,_0x58fbc4){return db[_0x0433('0x33')][_0x0433('0x4d')](_0x3df294[_0x0433('0x4e')],{})[_0x0433('0x29')](function(_0xcb250d){var _0x464248=_0x3df294[_0x0433('0x4f')]['get']({'plain':!![]});if(!_0x464248)throw new Error(_0x0433('0x50'));if(_0x464248[_0x0433('0x51')]===_0x0433('0x4f')){var _0x1c82cc=_0xcb250d[_0x0433('0x2b')]({'plain':!![]});var _0x7d7b66=_0x0433('0x2c');return db[_0x0433('0x52')][_0x0433('0x53')]({'where':{'name':_0x7d7b66,'userProfileId':_0x464248['userProfileId']},'raw':!![]})[_0x0433('0x29')](function(_0x1f5a70){if(_0x1f5a70&&_0x1f5a70['autoAssociation']===0x0){return db[_0x0433('0x2d')][_0x0433('0x4d')]({'name':_0x1c82cc['name'],'resourceId':_0x1c82cc['id'],'type':_0x1f5a70['name'],'sectionId':_0x1f5a70['id']},{})[_0x0433('0x29')](function(){return _0xcb250d;});}else{return _0xcb250d;}})['catch'](function(_0x5afb79){logger[_0x0433('0x54')](_0x0433('0x55'),_0x5afb79);throw _0x5afb79;});}return _0xcb250d;})[_0x0433('0x29')](respondWithResult(_0x58fbc4,0xc9))[_0x0433('0x48')](handleError(_0x58fbc4,null));};exports[_0x0433('0x28')]=function(_0x137960,_0x131a48){if(_0x137960['body']['id']){delete _0x137960[_0x0433('0x4e')]['id'];}return db[_0x0433('0x33')][_0x0433('0x53')]({'where':{'id':_0x137960[_0x0433('0x4a')]['id']}})[_0x0433('0x29')](handleEntityNotFound(_0x131a48,null))[_0x0433('0x29')](saveUpdates(_0x137960[_0x0433('0x4e')],null))['then'](respondWithResult(_0x131a48,null))[_0x0433('0x48')](handleError(_0x131a48,null));};exports[_0x0433('0x2a')]=function(_0x113c13,_0xb31d86){return db[_0x0433('0x33')]['find']({'where':{'id':_0x113c13[_0x0433('0x4a')]['id']}})['then'](handleEntityNotFound(_0xb31d86,null))['then'](removeEntity(_0xb31d86,null))[_0x0433('0x48')](handleError(_0xb31d86,null));}; \ No newline at end of file +var _0x7e69=['update','then','get','Dispositions','UserProfileResource','destroy','stack','name','send','index','Disposition','type','key','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','catch','show','params','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0xe6616d,_0x1e7814){var _0x187a52=function(_0x3c7572){while(--_0x3c7572){_0xe6616d['push'](_0xe6616d['shift']());}};_0x187a52(++_0x1e7814);}(_0x7e69,0x1b8));var _0x97e6=function(_0x57d4b2,_0x43236a){_0x57d4b2=_0x57d4b2-0x0;var _0x57fc1c=_0x7e69[_0x57d4b2];return _0x57fc1c;};'use strict';var emlformat=require(_0x97e6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x97e6('0x1'));var jsonpatch=require(_0x97e6('0x2'));var rp=require(_0x97e6('0x3'));var moment=require(_0x97e6('0x4'));var BPromise=require(_0x97e6('0x5'));var Mustache=require('mustache');var util=require(_0x97e6('0x6'));var path=require(_0x97e6('0x7'));var sox=require(_0x97e6('0x8'));var csv=require(_0x97e6('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x97e6('0xa'));var _=require(_0x97e6('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x97e6('0xc'));var toCsv=require('to-csv');var querystring=require(_0x97e6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x97e6('0xe'));var qs=require(_0x97e6('0xf'));var as=require(_0x97e6('0x10'));var hardwareService=require(_0x97e6('0x11'));var logger=require('../../config/logger')(_0x97e6('0x12'));var utils=require('../../config/utils');var config=require(_0x97e6('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x97e6('0x14'))['db'];function respondWithStatusCode(_0x222ad4,_0x38506e){_0x38506e=_0x38506e||0xcc;return function(_0x292993){if(_0x292993){return _0x222ad4[_0x97e6('0x15')](_0x38506e);}return _0x222ad4['status'](_0x38506e)[_0x97e6('0x16')]();};}function respondWithResult(_0x237f5b,_0x48ac1b){_0x48ac1b=_0x48ac1b||0xc8;return function(_0x250ea7){if(_0x250ea7){return _0x237f5b[_0x97e6('0x17')](_0x48ac1b)[_0x97e6('0x18')](_0x250ea7);}};}function respondWithFilteredResult(_0x47c738,_0x1679f9){return function(_0x1a1a51){if(_0x1a1a51){var _0x423da1=typeof _0x1679f9[_0x97e6('0x19')]===_0x97e6('0x1a')&&typeof _0x1679f9[_0x97e6('0x1b')]===_0x97e6('0x1a');var _0x261e79=_0x1a1a51[_0x97e6('0x1c')];var _0x5a94ed=_0x423da1?0x0:_0x1679f9['offset'];var _0x22b8b7=_0x423da1?_0x1a1a51[_0x97e6('0x1c')]:_0x1679f9[_0x97e6('0x19')]+_0x1679f9[_0x97e6('0x1b')];var _0x4218eb;if(_0x22b8b7>=_0x261e79){_0x22b8b7=_0x261e79;_0x4218eb=0xc8;}else{_0x4218eb=0xce;}_0x47c738[_0x97e6('0x17')](_0x4218eb);return _0x47c738[_0x97e6('0x1d')](_0x97e6('0x1e'),_0x5a94ed+'-'+_0x22b8b7+'/'+_0x261e79)[_0x97e6('0x18')](_0x1a1a51);}return null;};}function patchUpdates(_0x199058){return function(_0x524737){try{jsonpatch[_0x97e6('0x1f')](_0x524737,_0x199058,!![]);}catch(_0x689513){return BPromise[_0x97e6('0x20')](_0x689513);}return _0x524737[_0x97e6('0x21')]();};}function saveUpdates(_0x4eb806,_0x3a3179){return function(_0x33246e){if(_0x33246e){return _0x33246e[_0x97e6('0x22')](_0x4eb806)[_0x97e6('0x23')](function(_0x269bc6){return _0x269bc6;});}return null;};}function removeEntity(_0x565851,_0x43e5b5){return function(_0x255dbf){if(_0x255dbf){return _0x255dbf['destroy']()[_0x97e6('0x23')](function(){var _0x9364fd=_0x255dbf[_0x97e6('0x24')]({'plain':!![]});var _0x522b24=_0x97e6('0x25');return db[_0x97e6('0x26')][_0x97e6('0x27')]({'where':{'type':_0x522b24,'resourceId':_0x9364fd['id']}})['then'](function(){return _0x255dbf;});})[_0x97e6('0x23')](function(){_0x565851[_0x97e6('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5209b3,_0x9a9a2d){return function(_0x2546e1){if(!_0x2546e1){_0x5209b3[_0x97e6('0x15')](0x194);}return _0x2546e1;};}function handleError(_0x2a8e90,_0x78379c){_0x78379c=_0x78379c||0x1f4;return function(_0x124c7b){logger['error'](_0x124c7b[_0x97e6('0x28')]);if(_0x124c7b['name']){delete _0x124c7b[_0x97e6('0x29')];}_0x2a8e90[_0x97e6('0x17')](_0x78379c)[_0x97e6('0x2a')](_0x124c7b);};}exports[_0x97e6('0x2b')]=function(_0x3f29ef,_0x4d7760){var _0x398fc4={},_0x40e2f9={},_0x41cb94={'count':0x0,'rows':[]};var _0x17c262=_['map'](db[_0x97e6('0x2c')]['rawAttributes'],function(_0x281faf){return{'name':_0x281faf['fieldName'],'type':_0x281faf[_0x97e6('0x2d')][_0x97e6('0x2e')]};});_0x40e2f9[_0x97e6('0x2f')]=_[_0x97e6('0x30')](_0x17c262,'name');_0x40e2f9['query']=_[_0x97e6('0x31')](_0x3f29ef[_0x97e6('0x32')]);_0x40e2f9[_0x97e6('0x33')]=_[_0x97e6('0x34')](_0x40e2f9[_0x97e6('0x2f')],_0x40e2f9[_0x97e6('0x32')]);_0x398fc4['attributes']=_['intersection'](_0x40e2f9[_0x97e6('0x2f')],qs[_0x97e6('0x35')](_0x3f29ef['query']['fields']));_0x398fc4[_0x97e6('0x36')]=_0x398fc4[_0x97e6('0x36')][_0x97e6('0x37')]?_0x398fc4[_0x97e6('0x36')]:_0x40e2f9[_0x97e6('0x2f')];if(!_0x3f29ef[_0x97e6('0x32')][_0x97e6('0x38')]('nolimit')){_0x398fc4[_0x97e6('0x1b')]=qs[_0x97e6('0x1b')](_0x3f29ef['query'][_0x97e6('0x1b')]);_0x398fc4[_0x97e6('0x19')]=qs[_0x97e6('0x19')](_0x3f29ef['query'][_0x97e6('0x19')]);}_0x398fc4['order']=qs[_0x97e6('0x39')](_0x3f29ef['query'][_0x97e6('0x39')]);_0x398fc4[_0x97e6('0x3a')]=qs['filters'](_[_0x97e6('0x3b')](_0x3f29ef[_0x97e6('0x32')],_0x40e2f9[_0x97e6('0x33')]),_0x17c262);if(_0x3f29ef[_0x97e6('0x32')][_0x97e6('0x3c')]){_0x398fc4[_0x97e6('0x3a')]=_['merge'](_0x398fc4['where'],{'$or':_['map'](_0x17c262,function(_0x934a4e){if(_0x934a4e[_0x97e6('0x2d')]!==_0x97e6('0x3d')){var _0x261f73={};_0x261f73[_0x934a4e[_0x97e6('0x29')]]={'$like':'%'+_0x3f29ef[_0x97e6('0x32')][_0x97e6('0x3c')]+'%'};return _0x261f73;}})});}_0x398fc4=_[_0x97e6('0x3e')]({},_0x398fc4,_0x3f29ef[_0x97e6('0x3f')]);var _0x20b372={'where':_0x398fc4['where']};return db[_0x97e6('0x2c')][_0x97e6('0x1c')](_0x20b372)['then'](function(_0x512eb2){_0x41cb94[_0x97e6('0x1c')]=_0x512eb2;if(_0x3f29ef[_0x97e6('0x32')]['includeAll']){_0x398fc4[_0x97e6('0x40')]=[{'all':!![]}];}return db['Disposition'][_0x97e6('0x41')](_0x398fc4);})['then'](function(_0x561438){_0x41cb94['rows']=_0x561438;return _0x41cb94;})[_0x97e6('0x23')](respondWithFilteredResult(_0x4d7760,_0x398fc4))[_0x97e6('0x42')](handleError(_0x4d7760,null));};exports[_0x97e6('0x43')]=function(_0x123a52,_0x3fe254){var _0x53f738={'raw':!![],'where':{'id':_0x123a52[_0x97e6('0x44')]['id']}},_0x7964f4={};_0x7964f4[_0x97e6('0x2f')]=_[_0x97e6('0x31')](db[_0x97e6('0x2c')]['rawAttributes']);_0x7964f4['query']=_[_0x97e6('0x31')](_0x123a52['query']);_0x7964f4[_0x97e6('0x33')]=_[_0x97e6('0x34')](_0x7964f4['model'],_0x7964f4[_0x97e6('0x32')]);_0x53f738[_0x97e6('0x36')]=_[_0x97e6('0x34')](_0x7964f4[_0x97e6('0x2f')],qs[_0x97e6('0x35')](_0x123a52['query'][_0x97e6('0x35')]));_0x53f738['attributes']=_0x53f738[_0x97e6('0x36')][_0x97e6('0x37')]?_0x53f738['attributes']:_0x7964f4['model'];if(_0x123a52[_0x97e6('0x32')]['includeAll']){_0x53f738[_0x97e6('0x40')]=[{'all':!![]}];}_0x53f738=_[_0x97e6('0x3e')]({},_0x53f738,_0x123a52[_0x97e6('0x3f')]);return db['Disposition']['find'](_0x53f738)[_0x97e6('0x23')](handleEntityNotFound(_0x3fe254,null))[_0x97e6('0x23')](respondWithResult(_0x3fe254,null))[_0x97e6('0x42')](handleError(_0x3fe254,null));};exports['create']=function(_0x1564b1,_0x364832){return db['Disposition']['create'](_0x1564b1['body'],{})['then'](function(_0x58b6d4){var _0x5b3fef=_0x1564b1['user'][_0x97e6('0x24')]({'plain':!![]});if(!_0x5b3fef)throw new Error(_0x97e6('0x45'));if(_0x5b3fef[_0x97e6('0x46')]===_0x97e6('0x47')){var _0x2a989e=_0x58b6d4[_0x97e6('0x24')]({'plain':!![]});var _0x42fcea=_0x97e6('0x25');return db[_0x97e6('0x48')][_0x97e6('0x49')]({'where':{'name':_0x42fcea,'userProfileId':_0x5b3fef[_0x97e6('0x4a')]},'raw':!![]})[_0x97e6('0x23')](function(_0x11fb6b){if(_0x11fb6b&&_0x11fb6b['autoAssociation']===0x0){return db[_0x97e6('0x26')][_0x97e6('0x4b')]({'name':_0x2a989e[_0x97e6('0x29')],'resourceId':_0x2a989e['id'],'type':_0x11fb6b[_0x97e6('0x29')],'sectionId':_0x11fb6b['id']},{})[_0x97e6('0x23')](function(){return _0x58b6d4;});}else{return _0x58b6d4;}})[_0x97e6('0x42')](function(_0x24d785){logger[_0x97e6('0x4c')](_0x97e6('0x4d'),_0x24d785);throw _0x24d785;});}return _0x58b6d4;})[_0x97e6('0x23')](respondWithResult(_0x364832,0xc9))['catch'](handleError(_0x364832,null));};exports[_0x97e6('0x22')]=function(_0x3273e5,_0x555fe4){if(_0x3273e5[_0x97e6('0x4e')]['id']){delete _0x3273e5[_0x97e6('0x4e')]['id'];}return db['Disposition'][_0x97e6('0x49')]({'where':{'id':_0x3273e5[_0x97e6('0x44')]['id']}})['then'](handleEntityNotFound(_0x555fe4,null))[_0x97e6('0x23')](saveUpdates(_0x3273e5['body'],null))[_0x97e6('0x23')](respondWithResult(_0x555fe4,null))[_0x97e6('0x42')](handleError(_0x555fe4,null));};exports['destroy']=function(_0x3f3971,_0x5f49db){return db[_0x97e6('0x2c')][_0x97e6('0x49')]({'where':{'id':_0x3f3971[_0x97e6('0x44')]['id']}})[_0x97e6('0x23')](handleEntityNotFound(_0x5f49db,null))[_0x97e6('0x23')](removeEntity(_0x5f49db,null))[_0x97e6('0x42')](handleError(_0x5f49db,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index a1f7d58..342445f 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 _0x62ff=['FaxAccountId','name_openchannel','WhatsappAccountId','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./disposition.attributes','exports','Disposition','name_voice','name','name_chat','ChatWebsiteId','MailAccountId','SmsAccountId','name_fax'];(function(_0x4da5cc,_0x8e2c43){var _0x312ab0=function(_0x2ebe04){while(--_0x2ebe04){_0x4da5cc['push'](_0x4da5cc['shift']());}};_0x312ab0(++_0x8e2c43);}(_0x62ff,0x168));var _0xf62f=function(_0x51c819,_0xd812db){_0x51c819=_0x51c819-0x0;var _0x15c5d2=_0x62ff[_0x51c819];return _0x15c5d2;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf62f('0x0'))(_0xf62f('0x1'));var moment=require(_0xf62f('0x2'));var BPromise=require(_0xf62f('0x3'));var rp=require(_0xf62f('0x4'));var fs=require('fs');var path=require(_0xf62f('0x5'));var rimraf=require(_0xf62f('0x6'));var config=require(_0xf62f('0x7'));var attributes=require(_0xf62f('0x8'));module[_0xf62f('0x9')]=function(_0xf72377,_0xdd7068){return _0xf72377['define'](_0xf62f('0xa'),attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':_0xf62f('0xb'),'fields':[_0xf62f('0xc'),'ListId']},{'unique':!![],'name':_0xf62f('0xd'),'fields':['name',_0xf62f('0xe')]},{'unique':!![],'name':'name_mail','fields':[_0xf62f('0xc'),_0xf62f('0xf')]},{'unique':!![],'name':'name_sms','fields':[_0xf62f('0xc'),_0xf62f('0x10')]},{'unique':!![],'name':_0xf62f('0x11'),'fields':[_0xf62f('0xc'),_0xf62f('0x12')]},{'unique':!![],'name':_0xf62f('0x13'),'fields':[_0xf62f('0xc'),'OpenchannelAccountId']},{'unique':!![],'name':'name_whatsapp','fields':[_0xf62f('0xc'),_0xf62f('0x14')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcf43=['../../config/logger','api','bluebird','request-promise','rimraf','exports','define','Disposition','tools_dispositions','name_voice','name','ListId','name_chat','ChatWebsiteId','name_mail','name_sms','FaxAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash','util'];(function(_0x16268a,_0x10ce1b){var _0x419a09=function(_0x2026c9){while(--_0x2026c9){_0x16268a['push'](_0x16268a['shift']());}};_0x419a09(++_0x10ce1b);}(_0xcf43,0x129));var _0x3cf4=function(_0x527781,_0x3e1e4d){_0x527781=_0x527781-0x0;var _0x27282b=_0xcf43[_0x527781];return _0x27282b;};'use strict';var _=require(_0x3cf4('0x0'));var util=require(_0x3cf4('0x1'));var logger=require(_0x3cf4('0x2'))(_0x3cf4('0x3'));var moment=require('moment');var BPromise=require(_0x3cf4('0x4'));var rp=require(_0x3cf4('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3cf4('0x6'));var config=require('../../config/environment');var attributes=require('./disposition.attributes');module[_0x3cf4('0x7')]=function(_0x5e2a43,_0x21ec3c){return _0x5e2a43[_0x3cf4('0x8')](_0x3cf4('0x9'),attributes,{'tableName':_0x3cf4('0xa'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x3cf4('0xb'),'fields':[_0x3cf4('0xc'),_0x3cf4('0xd')]},{'unique':!![],'name':_0x3cf4('0xe'),'fields':[_0x3cf4('0xc'),_0x3cf4('0xf')]},{'unique':!![],'name':_0x3cf4('0x10'),'fields':[_0x3cf4('0xc'),'MailAccountId']},{'unique':!![],'name':_0x3cf4('0x11'),'fields':[_0x3cf4('0xc'),'SmsAccountId']},{'unique':!![],'name':'name_fax','fields':[_0x3cf4('0xc'),_0x3cf4('0x12')]},{'unique':!![],'name':_0x3cf4('0x13'),'fields':[_0x3cf4('0xc'),_0x3cf4('0x14')]},{'unique':!![],'name':_0x3cf4('0x15'),'fields':[_0x3cf4('0xc'),_0x3cf4('0x16')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index ef30ffc..c185e57 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(_0x577822,_0x5b3c71){var _0x51a44b=function(_0xb11fab){while(--_0xb11fab){_0x577822['push'](_0x577822['shift']());}};_0x51a44b(++_0x5b3c71);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa9e0[_0x2bf141];return _0x48277b;};'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(_0x4911a7,_0x3abc55){var _0x49bdd2=function(_0x196537){while(--_0x196537){_0x4911a7['push'](_0x4911a7['shift']());}};_0x49bdd2(++_0x3abc55);}(_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 diff --git a/server/api/disposition/index.js b/server/api/disposition/index.js index 56f2a7c..8a36d30 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 _0x0876=['util','Router','fs-extra','../../components/auth/service','../../config/environment','get','/:id','isAuthenticated','create','put','update','delete','destroy','multer'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x0876,0xb5));var _0x6087=function(_0x506b34,_0x1ab9ca){_0x506b34=_0x506b34-0x0;var _0x4b0465=_0x0876[_0x506b34];return _0x4b0465;};'use strict';var multer=require(_0x6087('0x0'));var util=require(_0x6087('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6087('0x2')]();var fs_extra=require(_0x6087('0x3'));var auth=require(_0x6087('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6087('0x5'));var controller=require('./disposition.controller');router[_0x6087('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x6087('0x6')](_0x6087('0x7'),auth[_0x6087('0x8')](),controller['show']);router['post']('/',auth[_0x6087('0x8')](),controller[_0x6087('0x9')]);router[_0x6087('0xa')]('/:id',auth[_0x6087('0x8')](),controller[_0x6087('0xb')]);router[_0x6087('0xc')](_0x6087('0x7'),auth[_0x6087('0x8')](),controller[_0x6087('0xd')]);module['exports']=router; \ No newline at end of file +var _0xe0ca=['index','/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xe0ca,0x1d5));var _0xae0c=function(_0x180632,_0x3a229e){_0x180632=_0x180632-0x0;var _0x151961=_0xe0ca[_0x180632];return _0x151961;};'use strict';var multer=require(_0xae0c('0x0'));var util=require(_0xae0c('0x1'));var path=require(_0xae0c('0x2'));var timeout=require(_0xae0c('0x3'));var express=require(_0xae0c('0x4'));var router=express['Router']();var fs_extra=require(_0xae0c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xae0c('0x6'));var config=require(_0xae0c('0x7'));var controller=require(_0xae0c('0x8'));router[_0xae0c('0x9')]('/',auth[_0xae0c('0xa')](),controller[_0xae0c('0xb')]);router[_0xae0c('0x9')](_0xae0c('0xc'),auth[_0xae0c('0xa')](),controller[_0xae0c('0xd')]);router[_0xae0c('0xe')]('/',auth[_0xae0c('0xa')](),controller[_0xae0c('0xf')]);router[_0xae0c('0x10')](_0xae0c('0xc'),auth[_0xae0c('0xa')](),controller[_0xae0c('0x11')]);router[_0xae0c('0x12')](_0xae0c('0xc'),auth[_0xae0c('0xa')](),controller['destroy']);module[_0xae0c('0x13')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index b0a0cd0..cc1863f 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 _0xe44b=['KHOMP','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','setDataValue','mandatoryDispositionPauseId','exports','STRING','ENUM','yes','localstationid','4800','7200','2400','12000','14400','INTEGER','SIP','IAX','DADHI'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe44b,0xc3));var _0xbe44=function(_0x3b7714,_0x488818){_0x3b7714=_0x3b7714-0x0;var _0xee5952=_0xe44b[_0x3b7714];return _0xee5952;};'use strict';var Sequelize=require('sequelize');module[_0xbe44('0x0')]={'name':{'type':Sequelize[_0xbe44('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xbe44('0x1')]},'ecm':{'type':Sequelize[_0xbe44('0x2')](_0xbe44('0x3'),'no'),'defaultValue':_0xbe44('0x3')},'headerinfo':{'type':Sequelize[_0xbe44('0x1')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0xbe44('0x1')],'unique':_0xbe44('0x4')},'minrate':{'type':Sequelize[_0xbe44('0x2')]('2400',_0xbe44('0x5'),_0xbe44('0x6'),'9600','12000','14400'),'defaultValue':'4800'},'maxrate':{'type':Sequelize['ENUM'](_0xbe44('0x7'),_0xbe44('0x5'),_0xbe44('0x6'),'9600',_0xbe44('0x8'),_0xbe44('0x9')),'defaultValue':'14400'},'modem':{'type':Sequelize[_0xbe44('0x1')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0xbe44('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xbe44('0xa')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0xbe44('0xb'),_0xbe44('0xc'),_0xbe44('0xd'),_0xbe44('0xe')),'defaultValue':'SIP'},'key':{'type':Sequelize[_0xbe44('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xbe44('0xf');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xbe44('0x10')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xbe44('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xbe44('0x10')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xbe44('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xbe44('0x10')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x2d0a6f){if(!_0x2d0a6f)this[_0xbe44('0x11')](_0xbe44('0x12'),null);this[_0xbe44('0x11')]('mandatoryDisposition',_0x2d0a6f);}}}; \ No newline at end of file +var _0x7a34=['TEXT','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','xCALLY\x20Motion\x20Fax','ENUM','4800','7200','9600','12000','14400','INTEGER','IAX','DADHI','SIP'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7a34,0x146));var _0x47a3=function(_0x3e7ae6,_0x2e14d9){_0x3e7ae6=_0x3e7ae6-0x0;var _0xdfaa19=_0x7a34[_0x3e7ae6];return _0xdfaa19;};'use strict';var Sequelize=require(_0x47a3('0x0'));module[_0x47a3('0x1')]={'name':{'type':Sequelize[_0x47a3('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x47a3('0x2')]},'ecm':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0x47a3('0x2')],'defaultValue':_0x47a3('0x3')},'localstationid':{'type':Sequelize['STRING'],'unique':'localstationid'},'minrate':{'type':Sequelize[_0x47a3('0x4')]('2400',_0x47a3('0x5'),_0x47a3('0x6'),_0x47a3('0x7'),_0x47a3('0x8'),_0x47a3('0x9')),'defaultValue':_0x47a3('0x5')},'maxrate':{'type':Sequelize[_0x47a3('0x4')]('2400',_0x47a3('0x5'),_0x47a3('0x6'),_0x47a3('0x7'),_0x47a3('0x8'),'14400'),'defaultValue':_0x47a3('0x9')},'modem':{'type':Sequelize[_0x47a3('0x2')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x47a3('0xa')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x47a3('0x4')]('SIP',_0x47a3('0xb'),_0x47a3('0xc'),'KHOMP'),'defaultValue':_0x47a3('0xd')},'key':{'type':Sequelize[_0x47a3('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x47a3('0xe')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x47a3('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x47a3('0xf')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x47a3('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x47a3('0xf')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x47a3('0xf')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x47a3('0xa')],'allowNull':!![],'defaultValue':null,'comment':_0x47a3('0x10')},'mandatoryDisposition':{'type':Sequelize[_0x47a3('0xf')],'defaultValue':![],'comment':_0x47a3('0x11'),'set':function(_0x17efa1){if(!_0x17efa1)this['setDataValue'](_0x47a3('0x12'),null);this['setDataValue'](_0x47a3('0x13'),_0x17efa1);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 7cabb99..6730b6f 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 _0x03ae=['Pause','rawAttributes','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','FaxAccountId','Disposition','findOne','nolimit','findAll','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','FaxInteraction','addInteraction','omit','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','FaxApplication','bulkCreate','findAndCountAll','priority','getApplications','from-voip-provider','exten','localstationid','app','description','appdata','Answer','push','CDR(type)=inbound-fax','Set','gateway','faxdetect','headerinfo','maxrate','minrate','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','tech','key','createdAt','updatedAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','send','CmList','List','Contacts','DESC','attachments','join','root','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','out','filename','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./faxAccount.socket','register','jayson/promise','client','http','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','get','FaxAccounts','UserProfileResource','stack','name','index','mandatoryDispositionPause','map','FaxAccount','type','query','keys','attributes','intersection','model','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','options','includeAll','include','rows','show','params'];(function(_0x562f3b,_0x4c65ae){var _0x1edd55=function(_0xe67e06){while(--_0xe67e06){_0x562f3b['push'](_0x562f3b['shift']());}};_0x1edd55(++_0x4c65ae);}(_0x03ae,0x12d));var _0xe03a=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x03ae[_0x138adb];return _0x1b27f2;};'use strict';var emlformat=require(_0xe03a('0x0'));var rimraf=require(_0xe03a('0x1'));var zipdir=require(_0xe03a('0x2'));var jsonpatch=require(_0xe03a('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe03a('0x4'));var Mustache=require(_0xe03a('0x5'));var util=require(_0xe03a('0x6'));var path=require(_0xe03a('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe03a('0x8'));var fs=require('fs');var fs_extra=require(_0xe03a('0x9'));var _=require(_0xe03a('0xa'));var squel=require(_0xe03a('0xb'));var crypto=require(_0xe03a('0xc'));var jsforce=require(_0xe03a('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe03a('0xe'));var Papa=require('papaparse');var Redis=require(_0xe03a('0xf'));var authService=require(_0xe03a('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xe03a('0x11'));var hardwareService=require(_0xe03a('0x12'));var logger=require(_0xe03a('0x13'))('api');var utils=require(_0xe03a('0x14'));var config=require(_0xe03a('0x15'));var licenseUtil=require(_0xe03a('0x16'));var db=require(_0xe03a('0x17'))['db'];config['redis']=_[_0xe03a('0x18')](config[_0xe03a('0x19')],{'host':_0xe03a('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe03a('0x19')]));require(_0xe03a('0x1b'))[_0xe03a('0x1c')](socket);var jayson=require(_0xe03a('0x1d'));var client=jayson[_0xe03a('0x1e')][_0xe03a('0x1f')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3222f2,_0x59031d,_0x55b31b,_0x47315d){return new BPromise(function(_0x3176dc,_0x30b271){var _0x235348=_0x47315d||client;return _0x235348['request'](_0x3222f2,_0x55b31b)['then'](function(_0x5cf321){logger[_0xe03a('0x20')](_0xe03a('0x21'),_0x59031d,_0xe03a('0x22'));logger[_0xe03a('0x23')](_0xe03a('0x24'),_0x59031d,'request\x20sent',JSON[_0xe03a('0x25')](_0x5cf321));if(_0x5cf321[_0xe03a('0x26')]){if(_0x5cf321[_0xe03a('0x26')][_0xe03a('0x27')]===0x1f4){logger[_0xe03a('0x26')](_0xe03a('0x21'),_0x59031d,_0x5cf321[_0xe03a('0x26')][_0xe03a('0x28')]);return _0x30b271(_0x5cf321[_0xe03a('0x26')]['message']);}logger['error']('FaxAccount,\x20%s,\x20%s',_0x59031d,_0x5cf321[_0xe03a('0x26')][_0xe03a('0x28')]);return _0x3176dc(_0x5cf321[_0xe03a('0x26')][_0xe03a('0x28')]);}else{logger['info'](_0xe03a('0x21'),_0x59031d,_0xe03a('0x22'));_0x3176dc(_0x5cf321[_0xe03a('0x29')][_0xe03a('0x28')]);}})[_0xe03a('0x2a')](function(_0x4f3b38){logger['error']('FaxAccount,\x20%s,\x20%s',_0x59031d,_0x4f3b38);_0x30b271(_0x4f3b38);});});}function respondWithStatusCode(_0x5a4cc6,_0x5e2667){_0x5e2667=_0x5e2667||0xcc;return function(_0xa39697){if(_0xa39697){return _0x5a4cc6[_0xe03a('0x2b')](_0x5e2667);}return _0x5a4cc6[_0xe03a('0x2c')](_0x5e2667)[_0xe03a('0x2d')]();};}function respondWithResult(_0x32e302,_0xe5ab01){_0xe5ab01=_0xe5ab01||0xc8;return function(_0x1fd9e4){if(_0x1fd9e4){return _0x32e302[_0xe03a('0x2c')](_0xe5ab01)[_0xe03a('0x2e')](_0x1fd9e4);}};}function respondWithFilteredResult(_0x2f7e86,_0x1af574){return function(_0xd40a5f){if(_0xd40a5f){var _0x4c997f=typeof _0x1af574[_0xe03a('0x2f')]===_0xe03a('0x30')&&typeof _0x1af574[_0xe03a('0x31')]===_0xe03a('0x30');var _0x59fd00=_0xd40a5f['count'];var _0xdbf725=_0x4c997f?0x0:_0x1af574[_0xe03a('0x2f')];var _0x245f86=_0x4c997f?_0xd40a5f[_0xe03a('0x32')]:_0x1af574['offset']+_0x1af574[_0xe03a('0x31')];var _0x3f8e27;if(_0x245f86>=_0x59fd00){_0x245f86=_0x59fd00;_0x3f8e27=0xc8;}else{_0x3f8e27=0xce;}_0x2f7e86[_0xe03a('0x2c')](_0x3f8e27);return _0x2f7e86[_0xe03a('0x33')]('Content-Range',_0xdbf725+'-'+_0x245f86+'/'+_0x59fd00)[_0xe03a('0x2e')](_0xd40a5f);}return null;};}function patchUpdates(_0xc3f5a5){return function(_0x5deb7d){try{jsonpatch[_0xe03a('0x34')](_0x5deb7d,_0xc3f5a5,!![]);}catch(_0x4b5a10){return BPromise[_0xe03a('0x35')](_0x4b5a10);}return _0x5deb7d[_0xe03a('0x36')]();};}function saveUpdates(_0x3e6505,_0x5ebdf2){return function(_0xdf9068){if(_0xdf9068){return _0xdf9068[_0xe03a('0x37')](_0x3e6505)[_0xe03a('0x38')](function(_0x4b89eb){return _0x4b89eb;});}return null;};}function removeEntity(_0x562f16,_0x4d58a7){return function(_0x5d95db){if(_0x5d95db){return _0x5d95db[_0xe03a('0x39')]()[_0xe03a('0x38')](function(){var _0x23dc73=_0x5d95db[_0xe03a('0x3a')]({'plain':!![]});var _0x1514d4=_0xe03a('0x3b');return db[_0xe03a('0x3c')][_0xe03a('0x39')]({'where':{'type':_0x1514d4,'resourceId':_0x23dc73['id']}})[_0xe03a('0x38')](function(){return _0x5d95db;});})[_0xe03a('0x38')](function(){_0x562f16[_0xe03a('0x2c')](0xcc)[_0xe03a('0x2d')]();});}};}function handleEntityNotFound(_0x1f1598,_0xd04c01){return function(_0x3f9552){if(!_0x3f9552){_0x1f1598[_0xe03a('0x2b')](0x194);}return _0x3f9552;};}function handleError(_0x5b9f7a,_0xd827d9){_0xd827d9=_0xd827d9||0x1f4;return function(_0x141ee5){logger[_0xe03a('0x26')](_0x141ee5[_0xe03a('0x3d')]);if(_0x141ee5[_0xe03a('0x3e')]){delete _0x141ee5['name'];}_0x5b9f7a[_0xe03a('0x2c')](_0xd827d9)['send'](_0x141ee5);};}exports[_0xe03a('0x3f')]=function(_0x1ea878,_0x4b0f1f){var _0x1d0b09={'include':[{'model':db['Pause'],'as':_0xe03a('0x40')}]},_0x41030c={},_0x4910d1={'count':0x0,'rows':[]};var _0x4476de=_[_0xe03a('0x41')](db[_0xe03a('0x42')]['rawAttributes'],function(_0x5065f2){return{'name':_0x5065f2['fieldName'],'type':_0x5065f2[_0xe03a('0x43')]['key']};});_0x41030c['model']=_[_0xe03a('0x41')](_0x4476de,_0xe03a('0x3e'));_0x41030c[_0xe03a('0x44')]=_[_0xe03a('0x45')](_0x1ea878['query']);_0x41030c['filters']=_['intersection'](_0x41030c['model'],_0x41030c[_0xe03a('0x44')]);_0x1d0b09[_0xe03a('0x46')]=_[_0xe03a('0x47')](_0x41030c[_0xe03a('0x48')],qs[_0xe03a('0x49')](_0x1ea878['query'][_0xe03a('0x49')]));_0x1d0b09[_0xe03a('0x46')]=_0x1d0b09['attributes'][_0xe03a('0x4a')]?_0x1d0b09['attributes']:_0x41030c[_0xe03a('0x48')];if(!_0x1ea878['query'][_0xe03a('0x4b')]('nolimit')){_0x1d0b09[_0xe03a('0x31')]=qs[_0xe03a('0x31')](_0x1ea878['query']['limit']);_0x1d0b09[_0xe03a('0x2f')]=qs[_0xe03a('0x2f')](_0x1ea878[_0xe03a('0x44')][_0xe03a('0x2f')]);}_0x1d0b09[_0xe03a('0x4c')]=qs[_0xe03a('0x4d')](_0x1ea878[_0xe03a('0x44')][_0xe03a('0x4d')]);_0x1d0b09[_0xe03a('0x4e')]=qs[_0xe03a('0x4f')](_[_0xe03a('0x50')](_0x1ea878[_0xe03a('0x44')],_0x41030c[_0xe03a('0x4f')]),_0x4476de);if(_0x1ea878['query'][_0xe03a('0x51')]){_0x1d0b09[_0xe03a('0x4e')]=_['merge'](_0x1d0b09[_0xe03a('0x4e')],{'$or':_['map'](_0x4476de,function(_0x258364){if(_0x258364['type']!=='VIRTUAL'){var _0x3d772b={};_0x3d772b[_0x258364[_0xe03a('0x3e')]]={'$like':'%'+_0x1ea878['query']['filter']+'%'};return _0x3d772b;}})});}_0x1d0b09=_[_0xe03a('0x52')]({},_0x1d0b09,_0x1ea878[_0xe03a('0x53')]);var _0xcc5985={'where':_0x1d0b09[_0xe03a('0x4e')]};return db[_0xe03a('0x42')][_0xe03a('0x32')](_0xcc5985)[_0xe03a('0x38')](function(_0x537830){_0x4910d1['count']=_0x537830;if(_0x1ea878['query'][_0xe03a('0x54')]){_0x1d0b09[_0xe03a('0x55')]=[{'all':!![]}];}return db[_0xe03a('0x42')]['findAll'](_0x1d0b09);})['then'](function(_0x39258f){_0x4910d1[_0xe03a('0x56')]=_0x39258f;return _0x4910d1;})[_0xe03a('0x38')](respondWithFilteredResult(_0x4b0f1f,_0x1d0b09))[_0xe03a('0x2a')](handleError(_0x4b0f1f,null));};exports[_0xe03a('0x57')]=function(_0x58c505,_0x3bfea1){var _0x39b4de={'raw':![],'where':{'id':_0x58c505[_0xe03a('0x58')]['id']},'include':[{'model':db[_0xe03a('0x59')],'as':_0xe03a('0x40')}]},_0x3a824d={};_0x3a824d[_0xe03a('0x48')]=_[_0xe03a('0x45')](db['FaxAccount'][_0xe03a('0x5a')]);_0x3a824d[_0xe03a('0x44')]=_['keys'](_0x58c505[_0xe03a('0x44')]);_0x3a824d[_0xe03a('0x4f')]=_[_0xe03a('0x47')](_0x3a824d['model'],_0x3a824d['query']);_0x39b4de[_0xe03a('0x46')]=_[_0xe03a('0x47')](_0x3a824d[_0xe03a('0x48')],qs[_0xe03a('0x49')](_0x58c505[_0xe03a('0x44')][_0xe03a('0x49')]));_0x39b4de[_0xe03a('0x46')]=_0x39b4de[_0xe03a('0x46')][_0xe03a('0x4a')]?_0x39b4de[_0xe03a('0x46')]:_0x3a824d[_0xe03a('0x48')];if(_0x58c505[_0xe03a('0x44')][_0xe03a('0x54')]){_0x39b4de[_0xe03a('0x55')]=[{'all':!![]}];}_0x39b4de=_['merge']({},_0x39b4de,_0x58c505[_0xe03a('0x53')]);return db[_0xe03a('0x42')]['find'](_0x39b4de)[_0xe03a('0x38')](handleEntityNotFound(_0x3bfea1,null))[_0xe03a('0x38')](respondWithResult(_0x3bfea1,null))[_0xe03a('0x2a')](handleError(_0x3bfea1,null));};exports[_0xe03a('0x5b')]=function(_0x2f7a8f,_0x413de2){return db[_0xe03a('0x42')][_0xe03a('0x5b')](_0x2f7a8f[_0xe03a('0x5c')],{})[_0xe03a('0x38')](function(_0x4a3427){var _0x21d6c5=_0x2f7a8f['user'][_0xe03a('0x3a')]({'plain':!![]});if(!_0x21d6c5)throw new Error(_0xe03a('0x5d'));if(_0x21d6c5[_0xe03a('0x5e')]===_0xe03a('0x5f')){var _0x364995=_0x4a3427[_0xe03a('0x3a')]({'plain':!![]});var _0x1c5b89=_0xe03a('0x3b');return db['UserProfileSection'][_0xe03a('0x60')]({'where':{'name':_0x1c5b89,'userProfileId':_0x21d6c5['userProfileId']},'raw':!![]})[_0xe03a('0x38')](function(_0x551ef5){if(_0x551ef5&&_0x551ef5[_0xe03a('0x61')]===0x0){return db[_0xe03a('0x3c')][_0xe03a('0x5b')]({'name':_0x364995[_0xe03a('0x3e')],'resourceId':_0x364995['id'],'type':_0x551ef5[_0xe03a('0x3e')],'sectionId':_0x551ef5['id']},{})[_0xe03a('0x38')](function(){return _0x4a3427;});}else{return _0x4a3427;}})[_0xe03a('0x2a')](function(_0x3a46d3){logger[_0xe03a('0x26')](_0xe03a('0x62'),_0x3a46d3);throw _0x3a46d3;});}return _0x4a3427;})['then'](respondWithResult(_0x413de2,0xc9))[_0xe03a('0x2a')](handleError(_0x413de2,null));};exports[_0xe03a('0x37')]=function(_0x1ea1f4,_0x413902){if(_0x1ea1f4['body']['id']){delete _0x1ea1f4[_0xe03a('0x5c')]['id'];}return db['FaxAccount']['find']({'where':{'id':_0x1ea1f4[_0xe03a('0x58')]['id']},'include':[{'model':db[_0xe03a('0x59')],'as':_0xe03a('0x40')}]})[_0xe03a('0x38')](handleEntityNotFound(_0x413902,null))[_0xe03a('0x38')](saveUpdates(_0x1ea1f4[_0xe03a('0x5c')],null))['then'](respondWithResult(_0x413902,null))[_0xe03a('0x2a')](handleError(_0x413902,null));};exports[_0xe03a('0x39')]=function(_0x4937e9,_0x40099f){return db[_0xe03a('0x42')][_0xe03a('0x60')]({'where':{'id':_0x4937e9['params']['id']}})[_0xe03a('0x38')](handleEntityNotFound(_0x40099f,null))[_0xe03a('0x38')](removeEntity(_0x40099f,null))['catch'](handleError(_0x40099f,null));};exports[_0xe03a('0x63')]=function(_0x541690,_0x29cb00){return db[_0xe03a('0x42')][_0xe03a('0x63')]()[_0xe03a('0x38')](respondWithResult(_0x29cb00,null))['catch'](handleError(_0x29cb00,null));};exports[_0xe03a('0x64')]=function(_0x23a1d6,_0x353118,_0x3d0da4){if(_0x23a1d6[_0xe03a('0x5c')]['id']){delete _0x23a1d6[_0xe03a('0x5c')]['id'];}return db[_0xe03a('0x42')][_0xe03a('0x60')]({'where':{'id':_0x23a1d6[_0xe03a('0x58')]['id']}})[_0xe03a('0x38')](handleEntityNotFound(_0x353118,null))[_0xe03a('0x38')](function(_0x497dd3){if(_0x497dd3){_0x23a1d6[_0xe03a('0x5c')][_0xe03a('0x65')]=_0x497dd3['id'];return db[_0xe03a('0x66')]['create'](_0x23a1d6[_0xe03a('0x5c')]);}})[_0xe03a('0x38')](respondWithResult(_0x353118,null))[_0xe03a('0x2a')](handleError(_0x353118,null));};exports['getDispositions']=function(_0x1b0772,_0x57ce4c,_0x2e9a16){var _0x67c756={'raw':![],'where':{}};var _0x2a2f4e={};var _0x29d842={'count':0x0,'rows':[]};return db[_0xe03a('0x42')][_0xe03a('0x67')]({'where':{'id':_0x1b0772[_0xe03a('0x58')]['id']}})[_0xe03a('0x38')](handleEntityNotFound(_0x57ce4c,null))[_0xe03a('0x38')](function(_0x4f628c){if(_0x4f628c){_0x2a2f4e['model']=_['keys'](db[_0xe03a('0x66')][_0xe03a('0x5a')]);_0x2a2f4e[_0xe03a('0x44')]=_[_0xe03a('0x45')](_0x1b0772['query']);_0x2a2f4e[_0xe03a('0x4f')]=_[_0xe03a('0x47')](_0x2a2f4e[_0xe03a('0x48')],_0x2a2f4e['query']);_0x67c756['attributes']=_[_0xe03a('0x47')](_0x2a2f4e[_0xe03a('0x48')],qs[_0xe03a('0x49')](_0x1b0772[_0xe03a('0x44')]['fields']));_0x67c756[_0xe03a('0x46')]=_0x67c756[_0xe03a('0x46')][_0xe03a('0x4a')]?_0x67c756[_0xe03a('0x46')]:_0x2a2f4e['model'];if(!_0x1b0772[_0xe03a('0x44')]['hasOwnProperty'](_0xe03a('0x68'))){_0x67c756['limit']=qs[_0xe03a('0x31')](_0x1b0772[_0xe03a('0x44')]['limit']);_0x67c756[_0xe03a('0x2f')]=qs[_0xe03a('0x2f')](_0x1b0772['query'][_0xe03a('0x2f')]);}_0x67c756[_0xe03a('0x4c')]=qs['sort'](_0x1b0772[_0xe03a('0x44')][_0xe03a('0x4d')]);_0x67c756[_0xe03a('0x4e')]=qs[_0xe03a('0x4f')](_[_0xe03a('0x50')](_0x1b0772[_0xe03a('0x44')],_0x2a2f4e[_0xe03a('0x4f')]));_0x67c756[_0xe03a('0x4e')]['FaxAccountId']=_0x4f628c['id'];if(_0x1b0772[_0xe03a('0x44')][_0xe03a('0x51')]){_0x67c756[_0xe03a('0x4e')]=_['merge'](_0x67c756[_0xe03a('0x4e')],{'$or':_['map'](_0x67c756['attributes'],function(_0x40eaeb){var _0x3ba2af={};_0x3ba2af[_0x40eaeb]={'$like':'%'+_0x1b0772['query']['filter']+'%'};return _0x3ba2af;})});}_0x67c756=_[_0xe03a('0x52')]({},_0x67c756,_0x1b0772[_0xe03a('0x53')]);return db[_0xe03a('0x66')][_0xe03a('0x32')]({'where':_0x67c756[_0xe03a('0x4e')]})['then'](function(_0x2a9ec2){_0x29d842['count']=_0x2a9ec2;if(_0x1b0772[_0xe03a('0x44')][_0xe03a('0x54')]){_0x67c756['include']=[{'all':!![]}];}return db[_0xe03a('0x66')][_0xe03a('0x69')](_0x67c756);})[_0xe03a('0x38')](function(_0x657e57){_0x29d842['rows']=_0x657e57;return _0x29d842;});}})['then'](respondWithFilteredResult(_0x57ce4c,_0x67c756))[_0xe03a('0x2a')](handleError(_0x57ce4c,null));};exports[_0xe03a('0x6a')]=function(_0x5a1068,_0xa7c5e5,_0x5cc57c){return db[_0xe03a('0x42')]['find']({'where':{'id':_0x5a1068[_0xe03a('0x58')]['id']}})[_0xe03a('0x38')](handleEntityNotFound(_0xa7c5e5,null))[_0xe03a('0x38')](function(_0x25c219){if(_0x25c219){return _0x25c219[_0xe03a('0x6a')](_0x5a1068['query'][_0xe03a('0x6b')]);}})[_0xe03a('0x38')](respondWithStatusCode(_0xa7c5e5,null))[_0xe03a('0x2a')](handleError(_0xa7c5e5,null));};exports[_0xe03a('0x6c')]=function(_0x363908,_0x5267e0,_0x2bf811){if(_0x363908['body']['id']){delete _0x363908[_0xe03a('0x5c')]['id'];}return db[_0xe03a('0x42')][_0xe03a('0x60')]({'where':{'id':_0x363908['params']['id']}})['then'](handleEntityNotFound(_0x5267e0,null))[_0xe03a('0x38')](function(_0x1bade4){if(_0x1bade4){_0x363908[_0xe03a('0x5c')][_0xe03a('0x65')]=_0x1bade4['id'];return db['CannedAnswer'][_0xe03a('0x5b')](_0x363908[_0xe03a('0x5c')]);}})['then'](respondWithResult(_0x5267e0,null))[_0xe03a('0x2a')](handleError(_0x5267e0,null));};exports['getAnswers']=function(_0x4a9a28,_0x1c4c1b,_0x23c709){var _0x2a76a8={'raw':![],'where':{}};var _0x3b5d32={};var _0x25d38f={'count':0x0,'rows':[]};return db[_0xe03a('0x42')][_0xe03a('0x67')]({'where':{'id':_0x4a9a28[_0xe03a('0x58')]['id']}})[_0xe03a('0x38')](handleEntityNotFound(_0x1c4c1b,null))['then'](function(_0x5289ca){if(_0x5289ca){_0x3b5d32[_0xe03a('0x48')]=_[_0xe03a('0x45')](db['CannedAnswer']['rawAttributes']);_0x3b5d32[_0xe03a('0x44')]=_[_0xe03a('0x45')](_0x4a9a28[_0xe03a('0x44')]);_0x3b5d32[_0xe03a('0x4f')]=_[_0xe03a('0x47')](_0x3b5d32[_0xe03a('0x48')],_0x3b5d32[_0xe03a('0x44')]);_0x2a76a8[_0xe03a('0x46')]=_[_0xe03a('0x47')](_0x3b5d32[_0xe03a('0x48')],qs[_0xe03a('0x49')](_0x4a9a28['query'][_0xe03a('0x49')]));_0x2a76a8[_0xe03a('0x46')]=_0x2a76a8[_0xe03a('0x46')][_0xe03a('0x4a')]?_0x2a76a8[_0xe03a('0x46')]:_0x3b5d32[_0xe03a('0x48')];if(!_0x4a9a28[_0xe03a('0x44')][_0xe03a('0x4b')](_0xe03a('0x68'))){_0x2a76a8[_0xe03a('0x31')]=qs['limit'](_0x4a9a28[_0xe03a('0x44')]['limit']);_0x2a76a8[_0xe03a('0x2f')]=qs[_0xe03a('0x2f')](_0x4a9a28[_0xe03a('0x44')]['offset']);}_0x2a76a8[_0xe03a('0x4c')]=qs[_0xe03a('0x4d')](_0x4a9a28[_0xe03a('0x44')][_0xe03a('0x4d')]);_0x2a76a8[_0xe03a('0x4e')]=qs[_0xe03a('0x4f')](_[_0xe03a('0x50')](_0x4a9a28[_0xe03a('0x44')],_0x3b5d32[_0xe03a('0x4f')]));_0x2a76a8['where'][_0xe03a('0x65')]=_0x5289ca['id'];if(_0x4a9a28['query']['filter']){_0x2a76a8[_0xe03a('0x4e')]=_[_0xe03a('0x52')](_0x2a76a8[_0xe03a('0x4e')],{'$or':_['map'](_0x2a76a8[_0xe03a('0x46')],function(_0x18114e){var _0xf2bdab={};_0xf2bdab[_0x18114e]={'$like':'%'+_0x4a9a28[_0xe03a('0x44')][_0xe03a('0x51')]+'%'};return _0xf2bdab;})});}_0x2a76a8=_[_0xe03a('0x52')]({},_0x2a76a8,_0x4a9a28[_0xe03a('0x53')]);return db[_0xe03a('0x6d')]['count']({'where':_0x2a76a8[_0xe03a('0x4e')]})[_0xe03a('0x38')](function(_0x2baa36){_0x25d38f['count']=_0x2baa36;if(_0x4a9a28[_0xe03a('0x44')]['includeAll']){_0x2a76a8[_0xe03a('0x55')]=[{'all':!![]}];}return db[_0xe03a('0x6d')][_0xe03a('0x69')](_0x2a76a8);})[_0xe03a('0x38')](function(_0x9eb970){_0x25d38f[_0xe03a('0x56')]=_0x9eb970;return _0x25d38f;});}})[_0xe03a('0x38')](respondWithFilteredResult(_0x1c4c1b,_0x2a76a8))['catch'](handleError(_0x1c4c1b,null));};exports[_0xe03a('0x6e')]=function(_0x3fbb37,_0x50787b,_0x3f4244){return db[_0xe03a('0x42')]['find']({'where':{'id':_0x3fbb37[_0xe03a('0x58')]['id']}})[_0xe03a('0x38')](handleEntityNotFound(_0x50787b,null))[_0xe03a('0x38')](function(_0x58d9ee){if(_0x58d9ee){return _0x58d9ee['removeAnswers'](_0x3fbb37[_0xe03a('0x44')][_0xe03a('0x6b')]);}})[_0xe03a('0x38')](respondWithStatusCode(_0x50787b,null))[_0xe03a('0x2a')](handleError(_0x50787b,null));};exports['addInteraction']=function(_0x30a599,_0x54e100,_0xa96422){return db[_0xe03a('0x6f')][_0xe03a('0x60')]({'where':{'id':_0x30a599[_0xe03a('0x58')]['id']}})['then'](handleEntityNotFound(_0x54e100,null))[_0xe03a('0x38')](function(_0x562c14){if(_0x562c14){return _0x562c14[_0xe03a('0x70')](_0x30a599[_0xe03a('0x5c')][_0xe03a('0x6b')],_[_0xe03a('0x71')](_0x30a599[_0xe03a('0x5c')],['ids','id'])||{});}})['then'](respondWithResult(_0x54e100,null))[_0xe03a('0x2a')](handleError(_0x54e100,null));};exports['getInteractions']=function(_0x27ca8f,_0x1abcd1,_0x44762d){var _0x57cacb={'raw':![],'where':{}};var _0xbcf643={};var _0x28287c={'count':0x0,'rows':[]};return db[_0xe03a('0x42')][_0xe03a('0x67')]({'where':{'id':_0x27ca8f[_0xe03a('0x58')]['id']}})[_0xe03a('0x38')](handleEntityNotFound(_0x1abcd1,null))[_0xe03a('0x38')](function(_0x2b0d9a){if(_0x2b0d9a){_0xbcf643['model']=_[_0xe03a('0x45')](db[_0xe03a('0x6f')][_0xe03a('0x5a')]);_0xbcf643[_0xe03a('0x44')]=_['keys'](_0x27ca8f[_0xe03a('0x44')]);_0xbcf643[_0xe03a('0x4f')]=_[_0xe03a('0x47')](_0xbcf643['model'],_0xbcf643['query']);_0x57cacb[_0xe03a('0x46')]=_[_0xe03a('0x47')](_0xbcf643['model'],qs[_0xe03a('0x49')](_0x27ca8f[_0xe03a('0x44')][_0xe03a('0x49')]));_0x57cacb['attributes']=_0x57cacb[_0xe03a('0x46')][_0xe03a('0x4a')]?_0x57cacb[_0xe03a('0x46')]:_0xbcf643['model'];if(!_0x27ca8f[_0xe03a('0x44')][_0xe03a('0x4b')](_0xe03a('0x68'))){_0x57cacb[_0xe03a('0x31')]=qs[_0xe03a('0x31')](_0x27ca8f[_0xe03a('0x44')][_0xe03a('0x31')]);_0x57cacb[_0xe03a('0x2f')]=qs[_0xe03a('0x2f')](_0x27ca8f[_0xe03a('0x44')]['offset']);}_0x57cacb[_0xe03a('0x4c')]=qs['sort'](_0x27ca8f[_0xe03a('0x44')][_0xe03a('0x4d')]);_0x57cacb['where']=qs[_0xe03a('0x4f')](_[_0xe03a('0x50')](_0x27ca8f[_0xe03a('0x44')],_0xbcf643['filters']));_0x57cacb[_0xe03a('0x4e')][_0xe03a('0x65')]=_0x2b0d9a['id'];if(_0x27ca8f[_0xe03a('0x44')][_0xe03a('0x51')]){_0x57cacb[_0xe03a('0x4e')]=_[_0xe03a('0x52')](_0x57cacb[_0xe03a('0x4e')],{'$or':_[_0xe03a('0x41')](_0x57cacb[_0xe03a('0x46')],function(_0x4576fe){var _0x2d0d9b={};_0x2d0d9b[_0x4576fe]={'$like':'%'+_0x27ca8f[_0xe03a('0x44')][_0xe03a('0x51')]+'%'};return _0x2d0d9b;})});}_0x57cacb=_['merge']({},_0x57cacb,_0x27ca8f[_0xe03a('0x53')]);return db[_0xe03a('0x6f')]['count']({'where':_0x57cacb['where']})[_0xe03a('0x38')](function(_0x8fb8e5){_0x28287c[_0xe03a('0x32')]=_0x8fb8e5;if(_0x27ca8f[_0xe03a('0x44')]['includeAll']){_0x57cacb[_0xe03a('0x55')]=[{'model':db[_0xe03a('0x72')],'as':_0xe03a('0x73'),'required':![]},{'model':db[_0xe03a('0x74')],'as':_0xe03a('0x75'),'attributes':['name',_0xe03a('0x76'),_0xe03a('0x77')],'required':![]},{'model':db[_0xe03a('0x78')],'as':_0xe03a('0x79'),'attributes':['id','name',_0xe03a('0x7a')],'where':_0x27ca8f['query'][_0xe03a('0x7b')]?{'id':_0x27ca8f[_0xe03a('0x44')]['tag']}:undefined,'required':_0x27ca8f[_0xe03a('0x44')][_0xe03a('0x7b')]?!![]:![]}];}return db[_0xe03a('0x6f')][_0xe03a('0x69')](_0x57cacb);})[_0xe03a('0x38')](function(_0x3e2810){_0x28287c[_0xe03a('0x56')]=_0x3e2810;return _0x28287c;});}})[_0xe03a('0x38')](respondWithFilteredResult(_0x1abcd1,_0x57cacb))[_0xe03a('0x2a')](handleError(_0x1abcd1,null));};exports[_0xe03a('0x7c')]=function(_0x58c939,_0x452d6d,_0x40be76){return db[_0xe03a('0x42')][_0xe03a('0x67')]({'where':{'id':_0x58c939[_0xe03a('0x58')]['id']}})[_0xe03a('0x38')](handleEntityNotFound(_0x452d6d,null))['then'](function(_0x292f38){if(_0x292f38){return db[_0xe03a('0x7d')][_0xe03a('0x7e')](function(_0x34e5cd){return db['FaxApplication'][_0xe03a('0x39')]({'where':{'FaxAccountId':_0x58c939[_0xe03a('0x58')]['id']},'transaction':_0x34e5cd})[_0xe03a('0x38')](function(_0x268ac7){var _0x4c9d29=_[_0xe03a('0x41')](_0x58c939[_0xe03a('0x5c')],function(_0x510476){_0x510476[_0xe03a('0x65')]=_0x58c939[_0xe03a('0x58')]['id'];return _0x510476;});return db[_0xe03a('0x7f')][_0xe03a('0x80')](_0x4c9d29,{'transaction':_0x34e5cd});});})[_0xe03a('0x38')](function(){return db['FaxApplication'][_0xe03a('0x81')]({'where':{'FaxAccountId':_0x58c939[_0xe03a('0x58')]['id']},'order':_0xe03a('0x82')});});}})['then'](respondWithResult(_0x452d6d,null))[_0xe03a('0x2a')](handleError(_0x452d6d,null));};exports[_0xe03a('0x83')]=function(_0x3f04b7,_0x11426c,_0x2ff724){var _0xe43560={};var _0x3e4165={};var _0xe1de9f;var _0x2b4e3c;return db['FaxAccount']['findOne']({'where':{'id':_0x3f04b7[_0xe03a('0x58')]['id']}})[_0xe03a('0x38')](handleEntityNotFound(_0x11426c,null))[_0xe03a('0x38')](function(_0x196077){if(_0x196077){_0xe1de9f=_0x196077;_0x3e4165[_0xe03a('0x48')]=_['keys'](db[_0xe03a('0x7f')][_0xe03a('0x5a')]);_0x3e4165[_0xe03a('0x44')]=_[_0xe03a('0x45')](_0x3f04b7['query']);_0x3e4165[_0xe03a('0x4f')]=_['intersection'](_0x3e4165[_0xe03a('0x48')],_0x3e4165[_0xe03a('0x44')]);_0xe43560[_0xe03a('0x46')]=_[_0xe03a('0x47')](_0x3e4165[_0xe03a('0x48')],qs[_0xe03a('0x49')](_0x3f04b7[_0xe03a('0x44')][_0xe03a('0x49')]));_0xe43560[_0xe03a('0x46')]=_0xe43560[_0xe03a('0x46')][_0xe03a('0x4a')]?_0xe43560['attributes']:_0x3e4165[_0xe03a('0x48')];_0xe43560['order']=qs[_0xe03a('0x4d')](_0x3f04b7[_0xe03a('0x44')]['sort']);_0xe43560[_0xe03a('0x4e')]=qs['filters'](_[_0xe03a('0x50')](_0x3f04b7[_0xe03a('0x44')],_0x3e4165[_0xe03a('0x4f')]));if(_0x3f04b7[_0xe03a('0x44')][_0xe03a('0x51')]){_0xe43560['where']=_[_0xe03a('0x52')](_0xe43560[_0xe03a('0x4e')],{'$or':_[_0xe03a('0x41')](_0xe43560['attributes'],function(_0x171a66){var _0x517154={};_0x517154[_0x171a66]={'$like':'%'+_0x3f04b7[_0xe03a('0x44')][_0xe03a('0x51')]+'%'};return _0x517154;})});}_0xe43560=_[_0xe03a('0x52')]({},_0xe43560,_0x3f04b7[_0xe03a('0x53')]);return _0xe1de9f[_0xe03a('0x83')](_0xe43560);}})[_0xe03a('0x38')](function(_0x2a1500){if(_0x2a1500){_0x2b4e3c=_0x2a1500[_0xe03a('0x4a')];if(!_0x3f04b7['query'][_0xe03a('0x4b')]('nolimit')){_0xe43560['limit']=qs[_0xe03a('0x31')](_0x3f04b7[_0xe03a('0x44')]['limit']);_0xe43560[_0xe03a('0x2f')]=qs[_0xe03a('0x2f')](_0x3f04b7[_0xe03a('0x44')][_0xe03a('0x2f')]);}return _0xe1de9f[_0xe03a('0x83')](_0xe43560);}})[_0xe03a('0x38')](function(_0x23f7a4){if(_0x23f7a4){return _0x23f7a4?{'count':_0x2b4e3c,'rows':_0x23f7a4}:null;}})[_0xe03a('0x38')](respondWithResult(_0x11426c,null))['catch'](handleError(_0x11426c,null));};function Extension(_0x439811,_0x5d7afa,_0x45d4b6,_0x4b7031){this['context']=_0xe03a('0x84');this[_0xe03a('0x85')]=_0x439811[_0xe03a('0x86')];this[_0xe03a('0x87')]=_0x4b7031;this[_0xe03a('0x43')]='system';this[_0xe03a('0x88')]='Fax\x20Extension';this[_0xe03a('0x65')]=_0x439811['id'];this[_0xe03a('0x82')]=_0x5d7afa;this[_0xe03a('0x89')]=_0x45d4b6;}function createExtensionsReciveFax(_0x4521ef){var _0x442587=0x1;var _0x276c4e=[];_0x276c4e['push'](new Extension(_0x4521ef,_0x442587,'',_0xe03a('0x8a')));_0x442587+=0x1;_0x276c4e[_0xe03a('0x8b')](new Extension(_0x4521ef,_0x442587,_0xe03a('0x8c'),_0xe03a('0x8d')));_0x442587+=0x1;for(var _0x235961 in _0x4521ef){if(_0x4521ef[_0xe03a('0x4b')](_0x235961)&&(_0x235961==='ecm'||_0x235961==='localstationid'||_0x235961===_0xe03a('0x8e')||_0x235961===_0xe03a('0x8f')||_0x235961===_0xe03a('0x90')||_0x235961===_0xe03a('0x91')||_0x235961===_0xe03a('0x92')||_0x235961==='modem'||_0x235961===_0xe03a('0x93'))){_0x276c4e[_0xe03a('0x8b')](new Extension(_0x4521ef,_0x442587,_0xe03a('0x94')+_0x235961+')='+_0x4521ef[_0x235961],_0xe03a('0x8d')));_0x442587+=0x1;}}_0x276c4e[_0xe03a('0x8b')](new Extension(_0x4521ef,_0x442587,'6',_0xe03a('0x95')));_0x442587+=0x1;_0x276c4e[_0xe03a('0x8b')](new Extension(_0x4521ef,_0x442587,_0xe03a('0x96'),_0xe03a('0x97')));_0x442587=0x0;return _0x276c4e;}exports[_0xe03a('0x98')]=function(_0x290195,_0x5c742f,_0x4df3a3){var _0x18c70c;return db[_0xe03a('0x7d')][_0xe03a('0x7e')](function(_0x4ca903){return db[_0xe03a('0x42')][_0xe03a('0x5b')](_0x290195[_0xe03a('0x5c')],{'transaction':_0x4ca903})[_0xe03a('0x38')](function(_0x29f86b){_0x18c70c=_0x29f86b[_0xe03a('0x3a')]({'plain':!![]});return db[_0xe03a('0x99')][_0xe03a('0x80')](createExtensionsReciveFax(_0x18c70c),{'transaction':_0x4ca903});});})[_0xe03a('0x38')](function(){return _0x18c70c;})[_0xe03a('0x38')](respondWithResult(_0x5c742f,null))[_0xe03a('0x2a')](handleError(_0x5c742f,null));};exports['updateAccountApplications']=function(_0x3838bc,_0x569e4d,_0x3c895d){var _0x29d4e9;return db[_0xe03a('0x7d')][_0xe03a('0x7e')](function(_0x20c0fa){return db[_0xe03a('0x42')][_0xe03a('0x37')](_0x3838bc[_0xe03a('0x5c')],{'where':{'id':_0x3838bc[_0xe03a('0x5c')]['id']},'transaction':_0x20c0fa})[_0xe03a('0x38')](function(_0x18c18c){return db[_0xe03a('0x99')][_0xe03a('0x39')]({'where':{'FaxAccountId':_0x3838bc['body']['id']},'transaction':_0x20c0fa})[_0xe03a('0x38')](function(_0x47f998){return db['VoiceExtension']['bulkCreate'](createExtensionsReciveFax(_['omit'](_0x3838bc[_0xe03a('0x5c')],[_0xe03a('0x9a'),_0xe03a('0x9b'),_0xe03a('0x9c'),_0xe03a('0x9d'),_0xe03a('0x9e'),_0xe03a('0x9f')])),{'transaction':_0x20c0fa});});});})[_0xe03a('0x38')](function(){return db[_0xe03a('0x42')][_0xe03a('0xa0')](_0x3838bc[_0xe03a('0x5c')]['id']);})[_0xe03a('0x38')](respondWithResult(_0x569e4d,null))['catch'](handleError(_0x569e4d,null));};exports[_0xe03a('0xa1')]=function(_0x14448c,_0x3a1da4,_0x285ec1){var _0xffd4d={'raw':!![],'where':{}};var _0x347354={};var _0x22f48d={'count':0x0,'rows':[]};return db[_0xe03a('0x42')][_0xe03a('0x67')]({'where':{'id':_0x14448c[_0xe03a('0x58')]['id']}})[_0xe03a('0x38')](handleEntityNotFound(_0x3a1da4,null))[_0xe03a('0x38')](function(_0x1cc846){if(_0x1cc846){_0x347354[_0xe03a('0x48')]=_[_0xe03a('0x45')](db[_0xe03a('0xa2')][_0xe03a('0x5a')]);_0x347354[_0xe03a('0x44')]=_[_0xe03a('0x45')](_0x14448c[_0xe03a('0x44')]);_0x347354[_0xe03a('0x4f')]=_[_0xe03a('0x47')](_0x347354['model'],_0x347354['query']);_0xffd4d[_0xe03a('0x46')]=_['intersection'](_0x347354[_0xe03a('0x48')],qs[_0xe03a('0x49')](_0x14448c[_0xe03a('0x44')][_0xe03a('0x49')]));_0xffd4d[_0xe03a('0x46')]=_0xffd4d[_0xe03a('0x46')][_0xe03a('0x4a')]?_0xffd4d['attributes']:_0x347354[_0xe03a('0x48')];if(!_0x14448c[_0xe03a('0x44')]['hasOwnProperty'](_0xe03a('0x68'))){_0xffd4d[_0xe03a('0x31')]=qs[_0xe03a('0x31')](_0x14448c[_0xe03a('0x44')][_0xe03a('0x31')]);_0xffd4d[_0xe03a('0x2f')]=qs['offset'](_0x14448c['query'][_0xe03a('0x2f')]);}_0xffd4d[_0xe03a('0x4c')]=qs[_0xe03a('0x4d')](_0x14448c[_0xe03a('0x44')][_0xe03a('0x4d')]);_0xffd4d[_0xe03a('0x4e')]=qs[_0xe03a('0x4f')](_[_0xe03a('0x50')](_0x14448c[_0xe03a('0x44')],_0x347354[_0xe03a('0x4f')]));_0xffd4d['where']['FaxAccountId']=_0x1cc846['id'];if(_0x14448c[_0xe03a('0x44')][_0xe03a('0x51')]){_0xffd4d[_0xe03a('0x4e')]=_[_0xe03a('0x52')](_0xffd4d[_0xe03a('0x4e')],{'$or':_[_0xe03a('0x41')](_0xffd4d[_0xe03a('0x46')],function(_0x3c48cc){var _0x1d7450={};_0x1d7450[_0x3c48cc]={'$like':'%'+_0x14448c[_0xe03a('0x44')]['filter']+'%'};return _0x1d7450;})});}if(_0x14448c[_0xe03a('0x44')]['$gte']){var _0x5b28b9=_0x14448c[_0xe03a('0x44')][_0xe03a('0xa3')][_0xe03a('0xa4')](',');var _0x12adeb={};_0x12adeb[_0x5b28b9[0x0]]={'$gte':moment(_0x5b28b9[0x1])[_0xe03a('0xa5')](_0xe03a('0xa6'))};_0xffd4d[_0xe03a('0x4e')]=_[_0xe03a('0x52')](_0xffd4d[_0xe03a('0x4e')],_0x12adeb);}_0xffd4d=_[_0xe03a('0x52')]({},_0xffd4d,_0x14448c[_0xe03a('0x53')]);return db['FaxMessage'][_0xe03a('0x32')]({'where':_0xffd4d[_0xe03a('0x4e')]})[_0xe03a('0x38')](function(_0x5d40cd){_0x22f48d[_0xe03a('0x32')]=_0x5d40cd;if(_0x14448c['query'][_0xe03a('0x54')]){_0xffd4d[_0xe03a('0x55')]=[{'all':!![]}];}return db['FaxMessage']['findAll'](_0xffd4d);})['then'](function(_0x445c4a){_0x22f48d[_0xe03a('0x56')]=_0x445c4a;return _0x22f48d;});}})[_0xe03a('0x38')](respondWithFilteredResult(_0x3a1da4,_0xffd4d))[_0xe03a('0x2a')](handleError(_0x3a1da4,null));};exports[_0xe03a('0xa7')]=function(_0x2c61a0,_0x241d1a,_0x5e3667){var _0x128038,_0x284c08={},_0xb01a9a;if(_0x2c61a0['body']['to']){_0xb01a9a=_0x2c61a0[_0xe03a('0x5c')]['to'][0x0];}return db['FaxAccount'][_0xe03a('0x60')]({'where':{'id':_0x2c61a0[_0xe03a('0x58')]['id']},'include':[{'model':db[_0xe03a('0xa8')],'as':_0xe03a('0xa9'),'include':[{'model':db['CmContact'],'as':_0xe03a('0xaa'),'where':{'fax':_0xb01a9a},'limit':0x1,'order':[[_0xe03a('0x9d'),_0xe03a('0xab')]]}]}]})[_0xe03a('0x38')](handleEntityNotFound(_0x241d1a,null))[_0xe03a('0x38')](function(_0x5245eb){_0x128038=_0x5245eb;if(_0x2c61a0[_0xe03a('0x5c')][_0xe03a('0xac')]&&_0x2c61a0[_0xe03a('0x5c')][_0xe03a('0xac')]['length']){for(var _0x3cc479=0x0;_0x3cc479<_0x2c61a0['body'][_0xe03a('0xac')][_0xe03a('0x4a')];_0x3cc479+=0x1){_0x2c61a0[_0xe03a('0x5c')][_0xe03a('0xac')][_0x3cc479]={'filename':_0x2c61a0[_0xe03a('0x5c')][_0xe03a('0xac')][_0x3cc479]['name'],'id':_0x2c61a0[_0xe03a('0x5c')][_0xe03a('0xac')][_0x3cc479]['id'],'path':path[_0xe03a('0xad')](config[_0xe03a('0xae')],'server/files/attachments',_0x2c61a0[_0xe03a('0x5c')][_0xe03a('0xac')][_0x3cc479][_0xe03a('0xaf')])};}}return respondWithRpcPromise(_0xe03a('0xb0'),'CheckAfterSend',{'FaxAccountId':_[_0xe03a('0xb1')](_0x2c61a0[_0xe03a('0x58')]['id'])?undefined:_0x2c61a0[_0xe03a('0x58')]['id'],'path':_[_0xe03a('0xb1')](_0x2c61a0[_0xe03a('0x5c')][_0xe03a('0xac')][0x0][_0xe03a('0x7')])?undefined:_0x2c61a0[_0xe03a('0x5c')][_0xe03a('0xac')][0x0][_0xe03a('0x7')],'fax':_['isNil'](_0x2c61a0['body']['to'][0x0])?undefined:_0x2c61a0[_0xe03a('0x5c')]['to'][0x0]},client9002);})[_0xe03a('0x38')](function(){if(_0x128038){if(_[_0xe03a('0xb1')](_0x2c61a0[_0xe03a('0x5c')][_0xe03a('0xb2')])){_0x2c61a0['body'][_0xe03a('0xb2')]=util['format'](_0xe03a('0xb3'),_0x128038[_0xe03a('0x3e')],_0x128038['fax']);}if(_0x128038['List']){if(_0x128038[_0xe03a('0xa9')][_0xe03a('0xaa')][_0xe03a('0x4a')]){return _0x128038['List'][_0xe03a('0xaa')][0x0];}else{return db[_0xe03a('0x72')][_0xe03a('0x5b')](_[_0xe03a('0x18')](_0x2c61a0[_0xe03a('0x5c')],{'firstName':_0x2c61a0[_0xe03a('0x5c')]['to'][0x0],'phone':_0x2c61a0[_0xe03a('0x5c')]['to'][0x0],'fax':_0x2c61a0[_0xe03a('0x5c')]['to'][0x0],'ListId':_0x128038[_0xe03a('0x9f')]}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error('Send\x20Fax\x20failed');}})[_0xe03a('0x38')](function(_0x218856){if(_0x218856){return db['FaxInteraction'][_0xe03a('0x60')]({'where':{'ContactId':_0x218856['id'],'closed':![],'FaxAccountId':_0x128038['id']}})[_0xe03a('0x38')](function(_0xd0e263){if(_0xd0e263){return[_0xd0e263,![]];}return db[_0xe03a('0x6f')]['create']({'UserId':_0x2c61a0['user']['id'],'ContactId':_0x218856['id'],'FaxAccountId':_0x128038['id'],'fax':_0x2c61a0[_0xe03a('0x5c')]['to'][0x0],'firstMsgDirection':_0xe03a('0xb4'),'Messages':[_['merge'](_0x2c61a0[_0xe03a('0x5c')],{'read':![],'body':_0x2c61a0[_0xe03a('0x5c')][_0xe03a('0xac')][0x0][_0xe03a('0xb5')],'FaxAccountId':_0x128038['id'],'UserId':_0x2c61a0[_0xe03a('0x5f')]['id'],'ContactId':_0x218856['id'],'AttachmentId':_0x2c61a0[_0xe03a('0x5c')][_0xe03a('0xac')][0x0]['id']})]},{'include':[{'model':db[_0xe03a('0xa2')],'as':_0xe03a('0xb6')}]})['then'](function(_0x3a53b5){return[_0x3a53b5,!![]];});});}else{throw new Error(_0xe03a('0xb7'));}})[_0xe03a('0xb8')](function(_0x2ea3f1,_0x540d52){if(_0x540d52){return _0x2ea3f1;}return db[_0xe03a('0xa2')][_0xe03a('0x5b')]({'direction':_0xe03a('0xb4'),'read':![],'body':_0x2c61a0[_0xe03a('0x5c')][_0xe03a('0xac')][0x0][_0xe03a('0xb5')],'FaxAccountId':_0x128038['id'],'FaxInteractionId':_0x2ea3f1['id'],'UserId':_0x2c61a0['user']['id'],'ContactId':_0x2ea3f1[_0xe03a('0xb9')],'AttachmentId':_0x2c61a0[_0xe03a('0x5c')][_0xe03a('0xac')][0x0]['id']})['then'](function(_0x12a92a){_0x2ea3f1[_0xe03a('0xba')][_0xe03a('0xb6')]=[];_0x2ea3f1[_0xe03a('0xba')][_0xe03a('0xb6')][_0xe03a('0x8b')](_0x12a92a[_0xe03a('0xba')]);return _0x2ea3f1;});})[_0xe03a('0x38')](function(_0x5b1c){respondWithRpcPromise(_0xe03a('0xbb'),_0xe03a('0xbb'),{'FaxAccountId':_[_0xe03a('0xb1')](_0x2c61a0[_0xe03a('0x58')]['id'])?undefined:_0x2c61a0[_0xe03a('0x58')]['id'],'path':_[_0xe03a('0xb1')](_0x2c61a0[_0xe03a('0x5c')][_0xe03a('0xac')][0x0][_0xe03a('0x7')])?undefined:_0x2c61a0[_0xe03a('0x5c')]['attachments'][0x0][_0xe03a('0x7')],'fax':_[_0xe03a('0xb1')](_0x2c61a0['body']['to'][0x0])?undefined:_0x2c61a0['body']['to'][0x0],'AttachmentId':_0x2c61a0[_0xe03a('0x5c')][_0xe03a('0xac')][0x0]['id']},client9002)[_0xe03a('0x38')](function(_0x3136de){logger['info'](_0xe03a('0xbc'),_0x3136de);})[_0xe03a('0x2a')](function(_0x8d4c1){logger[_0xe03a('0x20')]('SendFaxRpc,\x20%s',_0x8d4c1);});return _0x5b1c;})['then'](respondWithResult(_0x241d1a,null))[_0xe03a('0x2a')](handleError(_0x241d1a,null));};exports[_0xe03a('0xbd')]=function(_0x3243a0,_0x2e4a82,_0x48a5af){return db[_0xe03a('0x42')][_0xe03a('0x60')]({'where':{'id':_0x3243a0['params']['id']}})[_0xe03a('0x38')](handleEntityNotFound(_0x2e4a82,null))[_0xe03a('0x38')](function(_0x2e7907){if(_0x2e7907){return _0x2e7907[_0xe03a('0xbd')](_0x3243a0[_0xe03a('0x5c')]['ids'],_[_0xe03a('0x71')](_0x3243a0[_0xe03a('0x5c')],[_0xe03a('0x6b'),'id'])||{})[_0xe03a('0xb8')](function(_0x3ff76d){for(var _0x31e0ac=0x0;_0x31e0ac<_0x3243a0[_0xe03a('0x5c')][_0xe03a('0x6b')][_0xe03a('0x4a')];_0x31e0ac+=0x1){socket[_0xe03a('0xbe')]('userFaxAccount:save',{'UserId':Number(_0x3243a0[_0xe03a('0x5c')]['ids'][_0x31e0ac]),'FaxAccountId':Number(_0x3243a0['params']['id'])});}return _0x3ff76d;});}})[_0xe03a('0x38')](respondWithResult(_0x2e4a82,null))[_0xe03a('0x2a')](handleError(_0x2e4a82,null));};exports['removeAgents']=function(_0x553067,_0x4f5a25,_0x582d94){return db[_0xe03a('0x42')]['find']({'where':{'id':_0x553067['params']['id']}})['then'](handleEntityNotFound(_0x4f5a25,null))[_0xe03a('0x38')](function(_0x5d99c0){if(_0x5d99c0){return _0x5d99c0[_0xe03a('0xbf')](_0x553067[_0xe03a('0x44')][_0xe03a('0x6b')])[_0xe03a('0x38')](function(){if(_[_0xe03a('0xc0')](_0x553067['query'][_0xe03a('0x6b')])){for(var _0x52fe70=0x0;_0x52fe70<_0x553067['query'][_0xe03a('0x6b')][_0xe03a('0x4a')];_0x52fe70+=0x1){socket[_0xe03a('0xbe')](_0xe03a('0xc1'),{'UserId':Number(_0x553067[_0xe03a('0x44')]['ids'][_0x52fe70]),'FaxAccountId':Number(_0x553067[_0xe03a('0x58')]['id'])});}}else{socket[_0xe03a('0xbe')](_0xe03a('0xc1'),{'UserId':Number(_0x553067[_0xe03a('0x44')][_0xe03a('0x6b')]),'FaxAccountId':Number(_0x553067[_0xe03a('0x58')]['id'])});}});}})[_0xe03a('0x38')](respondWithStatusCode(_0x4f5a25,null))[_0xe03a('0x2a')](handleError(_0x4f5a25,null));};exports[_0xe03a('0xc2')]=function(_0x53aca5,_0x55a1f9,_0x220e3e){var _0x49b75c={};var _0x3dd441={};var _0x4438b4;var _0x162ebd;return db['FaxAccount']['findOne']({'where':{'id':_0x53aca5['params']['id']}})['then'](handleEntityNotFound(_0x55a1f9,null))[_0xe03a('0x38')](function(_0x33402c){if(_0x33402c){_0x4438b4=_0x33402c;_0x3dd441[_0xe03a('0x48')]=_[_0xe03a('0x45')](db[_0xe03a('0x74')][_0xe03a('0x5a')]);_0x3dd441[_0xe03a('0x44')]=_[_0xe03a('0x45')](_0x53aca5['query']);_0x3dd441[_0xe03a('0x4f')]=_['intersection'](_0x3dd441['model'],_0x3dd441['query']);_0x49b75c['attributes']=_['intersection'](_0x3dd441[_0xe03a('0x48')],qs[_0xe03a('0x49')](_0x53aca5[_0xe03a('0x44')][_0xe03a('0x49')]));_0x49b75c['attributes']=_0x49b75c[_0xe03a('0x46')][_0xe03a('0x4a')]?_0x49b75c['attributes']:_0x3dd441[_0xe03a('0x48')];_0x49b75c[_0xe03a('0x4c')]=qs[_0xe03a('0x4d')](_0x53aca5[_0xe03a('0x44')][_0xe03a('0x4d')]);_0x49b75c[_0xe03a('0x4e')]=qs[_0xe03a('0x4f')](_['pick'](_0x53aca5[_0xe03a('0x44')],_0x3dd441['filters']));if(_0x53aca5['query'][_0xe03a('0x51')]){_0x49b75c['where']=_['merge'](_0x49b75c[_0xe03a('0x4e')],{'$or':_[_0xe03a('0x41')](_0x49b75c[_0xe03a('0x46')],function(_0x9ca88f){var _0x537566={};_0x537566[_0x9ca88f]={'$like':'%'+_0x53aca5['query'][_0xe03a('0x51')]+'%'};return _0x537566;})});}_0x49b75c=_[_0xe03a('0x52')]({},_0x49b75c,_0x53aca5[_0xe03a('0x53')]);return _0x4438b4[_0xe03a('0xc2')](_0x49b75c);}})[_0xe03a('0x38')](function(_0x56e0a8){if(_0x56e0a8){_0x162ebd=_0x56e0a8[_0xe03a('0x4a')];if(!_0x53aca5['query'][_0xe03a('0x4b')]('nolimit')){_0x49b75c[_0xe03a('0x31')]=qs[_0xe03a('0x31')](_0x53aca5[_0xe03a('0x44')][_0xe03a('0x31')]);_0x49b75c[_0xe03a('0x2f')]=qs[_0xe03a('0x2f')](_0x53aca5[_0xe03a('0x44')][_0xe03a('0x2f')]);}return _0x4438b4[_0xe03a('0xc2')](_0x49b75c);}})[_0xe03a('0x38')](function(_0x391a27){if(_0x391a27){return _0x391a27?{'count':_0x162ebd,'rows':_0x391a27}:null;}})[_0xe03a('0x38')](respondWithResult(_0x55a1f9,null))['catch'](handleError(_0x55a1f9,null));}; \ No newline at end of file +var _0x966c=['includeAll','include','findAll','rows','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','FaxAccounts','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','destroy','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','hasOwnProperty','removeDispositions','ids','CannedAnswer','getAnswers','addInteraction','omit','FaxInteraction','nolimit','pick','CmContact','User','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','FaxApplication','bulkCreate','findAndCountAll','priority','getApplications','context','exten','localstationid','app','description','appdata','push','Answer','CDR(type)=inbound-fax','Set','ecm','gateway','faxdetect','headerinfo','maxrate','minrate','t38timeout','VoiceExtension','createdAt','updatedAt','TrunkId','findById','getMessages','FaxMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','DESC','attachments','root','server/files/attachments','basename','CheckAfterSend','isNil','from','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Contact\x20not\x20found','spread','ContactId','dataValues','Messages','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','redis','register','jayson/promise','client','http','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','sendStatus','status','json','offset','limit','undefined','count','set','apply','save','then','get','end','name','send','index','Pause','mandatoryDispositionPause','map','FaxAccount','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','order','sort','where','filters','filter','merge','options'];(function(_0x37b529,_0x6724e7){var _0x116152=function(_0x36d367){while(--_0x36d367){_0x37b529['push'](_0x37b529['shift']());}};_0x116152(++_0x6724e7);}(_0x966c,0x1d6));var _0xc966=function(_0x553c61,_0x590cd5){_0x553c61=_0x553c61-0x0;var _0x414b1e=_0x966c[_0x553c61];return _0x414b1e;};'use strict';var emlformat=require(_0xc966('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc966('0x1'));var jsonpatch=require(_0xc966('0x2'));var rp=require('request-promise');var moment=require(_0xc966('0x3'));var BPromise=require(_0xc966('0x4'));var Mustache=require('mustache');var util=require(_0xc966('0x5'));var path=require(_0xc966('0x6'));var sox=require('sox');var csv=require(_0xc966('0x7'));var ejs=require(_0xc966('0x8'));var fs=require('fs');var fs_extra=require(_0xc966('0x9'));var _=require(_0xc966('0xa'));var squel=require(_0xc966('0xb'));var crypto=require(_0xc966('0xc'));var jsforce=require(_0xc966('0xd'));var deskjs=require(_0xc966('0xe'));var toCsv=require(_0xc966('0x7'));var querystring=require(_0xc966('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc966('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xc966('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc966('0x12'))(_0xc966('0x13'));var utils=require(_0xc966('0x14'));var config=require(_0xc966('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xc966('0x16')]=_['defaults'](config[_0xc966('0x16')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc966('0x16')]));require('./faxAccount.socket')[_0xc966('0x17')](socket);var jayson=require(_0xc966('0x18'));var client=jayson[_0xc966('0x19')][_0xc966('0x1a')]({'port':0x232c});var client9002=jayson[_0xc966('0x19')][_0xc966('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x268a16,_0x32670d,_0x3fc5fb,_0x4c2f2c){return new BPromise(function(_0x5e8ecc,_0x26fa4a){var _0x266b92=_0x4c2f2c||client;return _0x266b92['request'](_0x268a16,_0x3fc5fb)['then'](function(_0x3989db){logger['info'](_0xc966('0x1b'),_0x32670d,_0xc966('0x1c'));logger[_0xc966('0x1d')](_0xc966('0x1e'),_0x32670d,_0xc966('0x1c'),JSON['stringify'](_0x3989db));if(_0x3989db['error']){if(_0x3989db[_0xc966('0x1f')][_0xc966('0x20')]===0x1f4){logger[_0xc966('0x1f')](_0xc966('0x1b'),_0x32670d,_0x3989db['error'][_0xc966('0x21')]);return _0x26fa4a(_0x3989db[_0xc966('0x1f')][_0xc966('0x21')]);}logger['error']('FaxAccount,\x20%s,\x20%s',_0x32670d,_0x3989db[_0xc966('0x1f')][_0xc966('0x21')]);return _0x5e8ecc(_0x3989db[_0xc966('0x1f')][_0xc966('0x21')]);}else{logger['info'](_0xc966('0x1b'),_0x32670d,_0xc966('0x1c'));_0x5e8ecc(_0x3989db['result']['message']);}})[_0xc966('0x22')](function(_0x1ce272){logger['error'](_0xc966('0x1b'),_0x32670d,_0x1ce272);_0x26fa4a(_0x1ce272);});});}function respondWithStatusCode(_0x26846c,_0x3bd33d){_0x3bd33d=_0x3bd33d||0xcc;return function(_0x24b4b2){if(_0x24b4b2){return _0x26846c[_0xc966('0x23')](_0x3bd33d);}return _0x26846c['status'](_0x3bd33d)['end']();};}function respondWithResult(_0x4de874,_0xab26d1){_0xab26d1=_0xab26d1||0xc8;return function(_0x15966e){if(_0x15966e){return _0x4de874[_0xc966('0x24')](_0xab26d1)[_0xc966('0x25')](_0x15966e);}};}function respondWithFilteredResult(_0x444309,_0x23b3c4){return function(_0x1ec292){if(_0x1ec292){var _0x49be9b=typeof _0x23b3c4[_0xc966('0x26')]==='undefined'&&typeof _0x23b3c4[_0xc966('0x27')]===_0xc966('0x28');var _0x3ab2dc=_0x1ec292[_0xc966('0x29')];var _0x1ba680=_0x49be9b?0x0:_0x23b3c4[_0xc966('0x26')];var _0x20597f=_0x49be9b?_0x1ec292['count']:_0x23b3c4[_0xc966('0x26')]+_0x23b3c4[_0xc966('0x27')];var _0x2778b9;if(_0x20597f>=_0x3ab2dc){_0x20597f=_0x3ab2dc;_0x2778b9=0xc8;}else{_0x2778b9=0xce;}_0x444309[_0xc966('0x24')](_0x2778b9);return _0x444309[_0xc966('0x2a')]('Content-Range',_0x1ba680+'-'+_0x20597f+'/'+_0x3ab2dc)[_0xc966('0x25')](_0x1ec292);}return null;};}function patchUpdates(_0x62aafb){return function(_0x137f95){try{jsonpatch[_0xc966('0x2b')](_0x137f95,_0x62aafb,!![]);}catch(_0x588fe6){return BPromise['reject'](_0x588fe6);}return _0x137f95[_0xc966('0x2c')]();};}function saveUpdates(_0x173265,_0x27abc9){return function(_0x455eac){if(_0x455eac){return _0x455eac['update'](_0x173265)[_0xc966('0x2d')](function(_0x9a8ecf){return _0x9a8ecf;});}return null;};}function removeEntity(_0xbb017f,_0x20bdd5){return function(_0x4bc457){if(_0x4bc457){return _0x4bc457['destroy']()[_0xc966('0x2d')](function(){var _0x1bb163=_0x4bc457[_0xc966('0x2e')]({'plain':!![]});var _0x246857='FaxAccounts';return db['UserProfileResource']['destroy']({'where':{'type':_0x246857,'resourceId':_0x1bb163['id']}})[_0xc966('0x2d')](function(){return _0x4bc457;});})[_0xc966('0x2d')](function(){_0xbb017f[_0xc966('0x24')](0xcc)[_0xc966('0x2f')]();});}};}function handleEntityNotFound(_0x4d9898,_0x24d84){return function(_0x47f7ec){if(!_0x47f7ec){_0x4d9898[_0xc966('0x23')](0x194);}return _0x47f7ec;};}function handleError(_0x363aab,_0x3c41c2){_0x3c41c2=_0x3c41c2||0x1f4;return function(_0x3a4381){logger[_0xc966('0x1f')](_0x3a4381['stack']);if(_0x3a4381['name']){delete _0x3a4381[_0xc966('0x30')];}_0x363aab[_0xc966('0x24')](_0x3c41c2)[_0xc966('0x31')](_0x3a4381);};}exports[_0xc966('0x32')]=function(_0x1def3f,_0x34c7a2){var _0x26650b={'include':[{'model':db[_0xc966('0x33')],'as':_0xc966('0x34')}]},_0x36b4c3={},_0x57a0a0={'count':0x0,'rows':[]};var _0x38cb27=_[_0xc966('0x35')](db[_0xc966('0x36')][_0xc966('0x37')],function(_0x36e484){return{'name':_0x36e484[_0xc966('0x38')],'type':_0x36e484[_0xc966('0x39')][_0xc966('0x3a')]};});_0x36b4c3[_0xc966('0x3b')]=_[_0xc966('0x35')](_0x38cb27,_0xc966('0x30'));_0x36b4c3[_0xc966('0x3c')]=_[_0xc966('0x3d')](_0x1def3f['query']);_0x36b4c3['filters']=_[_0xc966('0x3e')](_0x36b4c3[_0xc966('0x3b')],_0x36b4c3[_0xc966('0x3c')]);_0x26650b[_0xc966('0x3f')]=_[_0xc966('0x3e')](_0x36b4c3[_0xc966('0x3b')],qs[_0xc966('0x40')](_0x1def3f[_0xc966('0x3c')]['fields']));_0x26650b[_0xc966('0x3f')]=_0x26650b['attributes'][_0xc966('0x41')]?_0x26650b['attributes']:_0x36b4c3[_0xc966('0x3b')];if(!_0x1def3f[_0xc966('0x3c')]['hasOwnProperty']('nolimit')){_0x26650b[_0xc966('0x27')]=qs[_0xc966('0x27')](_0x1def3f[_0xc966('0x3c')][_0xc966('0x27')]);_0x26650b[_0xc966('0x26')]=qs[_0xc966('0x26')](_0x1def3f['query'][_0xc966('0x26')]);}_0x26650b[_0xc966('0x42')]=qs[_0xc966('0x43')](_0x1def3f['query'][_0xc966('0x43')]);_0x26650b[_0xc966('0x44')]=qs[_0xc966('0x45')](_['pick'](_0x1def3f[_0xc966('0x3c')],_0x36b4c3[_0xc966('0x45')]),_0x38cb27);if(_0x1def3f[_0xc966('0x3c')][_0xc966('0x46')]){_0x26650b[_0xc966('0x44')]=_[_0xc966('0x47')](_0x26650b[_0xc966('0x44')],{'$or':_[_0xc966('0x35')](_0x38cb27,function(_0x4523e7){if(_0x4523e7['type']!=='VIRTUAL'){var _0x35e0f6={};_0x35e0f6[_0x4523e7[_0xc966('0x30')]]={'$like':'%'+_0x1def3f[_0xc966('0x3c')][_0xc966('0x46')]+'%'};return _0x35e0f6;}})});}_0x26650b=_[_0xc966('0x47')]({},_0x26650b,_0x1def3f[_0xc966('0x48')]);var _0xaf3d3f={'where':_0x26650b[_0xc966('0x44')]};return db[_0xc966('0x36')]['count'](_0xaf3d3f)[_0xc966('0x2d')](function(_0x4d39d6){_0x57a0a0[_0xc966('0x29')]=_0x4d39d6;if(_0x1def3f[_0xc966('0x3c')][_0xc966('0x49')]){_0x26650b[_0xc966('0x4a')]=[{'all':!![]}];}return db['FaxAccount'][_0xc966('0x4b')](_0x26650b);})[_0xc966('0x2d')](function(_0x5ce1cf){_0x57a0a0[_0xc966('0x4c')]=_0x5ce1cf;return _0x57a0a0;})['then'](respondWithFilteredResult(_0x34c7a2,_0x26650b))[_0xc966('0x22')](handleError(_0x34c7a2,null));};exports['show']=function(_0x49a192,_0x2e034a){var _0x368cd9={'raw':![],'where':{'id':_0x49a192[_0xc966('0x4d')]['id']},'include':[{'model':db[_0xc966('0x33')],'as':_0xc966('0x34')}]},_0x4d2209={};_0x4d2209[_0xc966('0x3b')]=_[_0xc966('0x3d')](db[_0xc966('0x36')][_0xc966('0x37')]);_0x4d2209[_0xc966('0x3c')]=_[_0xc966('0x3d')](_0x49a192[_0xc966('0x3c')]);_0x4d2209[_0xc966('0x45')]=_[_0xc966('0x3e')](_0x4d2209[_0xc966('0x3b')],_0x4d2209[_0xc966('0x3c')]);_0x368cd9['attributes']=_[_0xc966('0x3e')](_0x4d2209[_0xc966('0x3b')],qs['fields'](_0x49a192[_0xc966('0x3c')][_0xc966('0x40')]));_0x368cd9[_0xc966('0x3f')]=_0x368cd9[_0xc966('0x3f')]['length']?_0x368cd9['attributes']:_0x4d2209['model'];if(_0x49a192[_0xc966('0x3c')][_0xc966('0x49')]){_0x368cd9[_0xc966('0x4a')]=[{'all':!![]}];}_0x368cd9=_[_0xc966('0x47')]({},_0x368cd9,_0x49a192[_0xc966('0x48')]);return db[_0xc966('0x36')][_0xc966('0x4e')](_0x368cd9)[_0xc966('0x2d')](handleEntityNotFound(_0x2e034a,null))[_0xc966('0x2d')](respondWithResult(_0x2e034a,null))['catch'](handleError(_0x2e034a,null));};exports[_0xc966('0x4f')]=function(_0x3a2f1f,_0x3cf7e9){return db[_0xc966('0x36')][_0xc966('0x4f')](_0x3a2f1f[_0xc966('0x50')],{})[_0xc966('0x2d')](function(_0xcb914e){var _0x320f2f=_0x3a2f1f[_0xc966('0x51')][_0xc966('0x2e')]({'plain':!![]});if(!_0x320f2f)throw new Error(_0xc966('0x52'));if(_0x320f2f[_0xc966('0x53')]===_0xc966('0x51')){var _0x452214=_0xcb914e['get']({'plain':!![]});var _0x5373e9=_0xc966('0x54');return db[_0xc966('0x55')][_0xc966('0x4e')]({'where':{'name':_0x5373e9,'userProfileId':_0x320f2f[_0xc966('0x56')]},'raw':!![]})[_0xc966('0x2d')](function(_0x2d2b35){if(_0x2d2b35&&_0x2d2b35[_0xc966('0x57')]===0x0){return db[_0xc966('0x58')][_0xc966('0x4f')]({'name':_0x452214['name'],'resourceId':_0x452214['id'],'type':_0x2d2b35[_0xc966('0x30')],'sectionId':_0x2d2b35['id']},{})[_0xc966('0x2d')](function(){return _0xcb914e;});}else{return _0xcb914e;}})['catch'](function(_0x30e26f){logger[_0xc966('0x1f')](_0xc966('0x59'),_0x30e26f);throw _0x30e26f;});}return _0xcb914e;})[_0xc966('0x2d')](respondWithResult(_0x3cf7e9,0xc9))['catch'](handleError(_0x3cf7e9,null));};exports[_0xc966('0x5a')]=function(_0xd8c404,_0x43b45a){if(_0xd8c404[_0xc966('0x50')]['id']){delete _0xd8c404[_0xc966('0x50')]['id'];}return db[_0xc966('0x36')][_0xc966('0x4e')]({'where':{'id':_0xd8c404[_0xc966('0x4d')]['id']},'include':[{'model':db[_0xc966('0x33')],'as':_0xc966('0x34')}]})[_0xc966('0x2d')](handleEntityNotFound(_0x43b45a,null))[_0xc966('0x2d')](saveUpdates(_0xd8c404[_0xc966('0x50')],null))[_0xc966('0x2d')](respondWithResult(_0x43b45a,null))['catch'](handleError(_0x43b45a,null));};exports[_0xc966('0x5b')]=function(_0x543583,_0x154dee){return db[_0xc966('0x36')][_0xc966('0x4e')]({'where':{'id':_0x543583[_0xc966('0x4d')]['id']}})[_0xc966('0x2d')](handleEntityNotFound(_0x154dee,null))[_0xc966('0x2d')](removeEntity(_0x154dee,null))[_0xc966('0x22')](handleError(_0x154dee,null));};exports[_0xc966('0x5c')]=function(_0x2edd24,_0x3f6d05){return db[_0xc966('0x36')][_0xc966('0x5c')]()['then'](respondWithResult(_0x3f6d05,null))[_0xc966('0x22')](handleError(_0x3f6d05,null));};exports[_0xc966('0x5d')]=function(_0x380a14,_0x159c4a,_0x48fba1){if(_0x380a14[_0xc966('0x50')]['id']){delete _0x380a14[_0xc966('0x50')]['id'];}return db[_0xc966('0x36')][_0xc966('0x4e')]({'where':{'id':_0x380a14[_0xc966('0x4d')]['id']}})[_0xc966('0x2d')](handleEntityNotFound(_0x159c4a,null))[_0xc966('0x2d')](function(_0x29b869){if(_0x29b869){_0x380a14[_0xc966('0x50')][_0xc966('0x5e')]=_0x29b869['id'];return db[_0xc966('0x5f')]['create'](_0x380a14['body']);}})['then'](respondWithResult(_0x159c4a,null))[_0xc966('0x22')](handleError(_0x159c4a,null));};exports[_0xc966('0x60')]=function(_0x49b7b9,_0x4ca560,_0x4512d3){var _0x21b5ec={'raw':![],'where':{}};var _0x547461={};var _0x2ec34a={'count':0x0,'rows':[]};return db[_0xc966('0x36')][_0xc966('0x61')]({'where':{'id':_0x49b7b9[_0xc966('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4ca560,null))[_0xc966('0x2d')](function(_0x30f69a){if(_0x30f69a){_0x547461[_0xc966('0x3b')]=_[_0xc966('0x3d')](db['Disposition'][_0xc966('0x37')]);_0x547461[_0xc966('0x3c')]=_['keys'](_0x49b7b9['query']);_0x547461[_0xc966('0x45')]=_[_0xc966('0x3e')](_0x547461['model'],_0x547461[_0xc966('0x3c')]);_0x21b5ec[_0xc966('0x3f')]=_[_0xc966('0x3e')](_0x547461['model'],qs[_0xc966('0x40')](_0x49b7b9[_0xc966('0x3c')]['fields']));_0x21b5ec[_0xc966('0x3f')]=_0x21b5ec['attributes'][_0xc966('0x41')]?_0x21b5ec[_0xc966('0x3f')]:_0x547461[_0xc966('0x3b')];if(!_0x49b7b9['query'][_0xc966('0x62')]('nolimit')){_0x21b5ec[_0xc966('0x27')]=qs['limit'](_0x49b7b9[_0xc966('0x3c')][_0xc966('0x27')]);_0x21b5ec[_0xc966('0x26')]=qs[_0xc966('0x26')](_0x49b7b9[_0xc966('0x3c')][_0xc966('0x26')]);}_0x21b5ec[_0xc966('0x42')]=qs[_0xc966('0x43')](_0x49b7b9['query'][_0xc966('0x43')]);_0x21b5ec[_0xc966('0x44')]=qs[_0xc966('0x45')](_['pick'](_0x49b7b9[_0xc966('0x3c')],_0x547461['filters']));_0x21b5ec[_0xc966('0x44')][_0xc966('0x5e')]=_0x30f69a['id'];if(_0x49b7b9[_0xc966('0x3c')][_0xc966('0x46')]){_0x21b5ec[_0xc966('0x44')]=_[_0xc966('0x47')](_0x21b5ec['where'],{'$or':_['map'](_0x21b5ec['attributes'],function(_0x3682c7){var _0x514b59={};_0x514b59[_0x3682c7]={'$like':'%'+_0x49b7b9['query'][_0xc966('0x46')]+'%'};return _0x514b59;})});}_0x21b5ec=_['merge']({},_0x21b5ec,_0x49b7b9[_0xc966('0x48')]);return db[_0xc966('0x5f')]['count']({'where':_0x21b5ec[_0xc966('0x44')]})['then'](function(_0x1652a1){_0x2ec34a[_0xc966('0x29')]=_0x1652a1;if(_0x49b7b9['query'][_0xc966('0x49')]){_0x21b5ec['include']=[{'all':!![]}];}return db[_0xc966('0x5f')][_0xc966('0x4b')](_0x21b5ec);})[_0xc966('0x2d')](function(_0x1c5a10){_0x2ec34a['rows']=_0x1c5a10;return _0x2ec34a;});}})[_0xc966('0x2d')](respondWithFilteredResult(_0x4ca560,_0x21b5ec))[_0xc966('0x22')](handleError(_0x4ca560,null));};exports[_0xc966('0x63')]=function(_0x62db26,_0x274c52,_0x4e5d93){return db[_0xc966('0x36')][_0xc966('0x4e')]({'where':{'id':_0x62db26[_0xc966('0x4d')]['id']}})[_0xc966('0x2d')](handleEntityNotFound(_0x274c52,null))[_0xc966('0x2d')](function(_0x455219){if(_0x455219){return _0x455219[_0xc966('0x63')](_0x62db26[_0xc966('0x3c')][_0xc966('0x64')]);}})[_0xc966('0x2d')](respondWithStatusCode(_0x274c52,null))[_0xc966('0x22')](handleError(_0x274c52,null));};exports['addAnswer']=function(_0x178abe,_0x5bb062,_0x28df07){if(_0x178abe[_0xc966('0x50')]['id']){delete _0x178abe[_0xc966('0x50')]['id'];}return db['FaxAccount'][_0xc966('0x4e')]({'where':{'id':_0x178abe[_0xc966('0x4d')]['id']}})[_0xc966('0x2d')](handleEntityNotFound(_0x5bb062,null))[_0xc966('0x2d')](function(_0x2f7ad4){if(_0x2f7ad4){_0x178abe[_0xc966('0x50')][_0xc966('0x5e')]=_0x2f7ad4['id'];return db[_0xc966('0x65')][_0xc966('0x4f')](_0x178abe[_0xc966('0x50')]);}})[_0xc966('0x2d')](respondWithResult(_0x5bb062,null))[_0xc966('0x22')](handleError(_0x5bb062,null));};exports[_0xc966('0x66')]=function(_0x11b791,_0x2dc115,_0x198720){var _0x4cb081={'raw':![],'where':{}};var _0x1a4d66={};var _0x2dc016={'count':0x0,'rows':[]};return db['FaxAccount'][_0xc966('0x61')]({'where':{'id':_0x11b791[_0xc966('0x4d')]['id']}})[_0xc966('0x2d')](handleEntityNotFound(_0x2dc115,null))[_0xc966('0x2d')](function(_0x4a7678){if(_0x4a7678){_0x1a4d66[_0xc966('0x3b')]=_['keys'](db['CannedAnswer'][_0xc966('0x37')]);_0x1a4d66['query']=_['keys'](_0x11b791[_0xc966('0x3c')]);_0x1a4d66['filters']=_['intersection'](_0x1a4d66[_0xc966('0x3b')],_0x1a4d66[_0xc966('0x3c')]);_0x4cb081['attributes']=_[_0xc966('0x3e')](_0x1a4d66[_0xc966('0x3b')],qs['fields'](_0x11b791['query']['fields']));_0x4cb081['attributes']=_0x4cb081[_0xc966('0x3f')][_0xc966('0x41')]?_0x4cb081['attributes']:_0x1a4d66[_0xc966('0x3b')];if(!_0x11b791[_0xc966('0x3c')][_0xc966('0x62')]('nolimit')){_0x4cb081[_0xc966('0x27')]=qs[_0xc966('0x27')](_0x11b791[_0xc966('0x3c')][_0xc966('0x27')]);_0x4cb081[_0xc966('0x26')]=qs[_0xc966('0x26')](_0x11b791[_0xc966('0x3c')][_0xc966('0x26')]);}_0x4cb081['order']=qs[_0xc966('0x43')](_0x11b791[_0xc966('0x3c')]['sort']);_0x4cb081[_0xc966('0x44')]=qs[_0xc966('0x45')](_['pick'](_0x11b791[_0xc966('0x3c')],_0x1a4d66[_0xc966('0x45')]));_0x4cb081[_0xc966('0x44')][_0xc966('0x5e')]=_0x4a7678['id'];if(_0x11b791[_0xc966('0x3c')][_0xc966('0x46')]){_0x4cb081[_0xc966('0x44')]=_['merge'](_0x4cb081['where'],{'$or':_[_0xc966('0x35')](_0x4cb081[_0xc966('0x3f')],function(_0x2dca94){var _0x5700c4={};_0x5700c4[_0x2dca94]={'$like':'%'+_0x11b791[_0xc966('0x3c')][_0xc966('0x46')]+'%'};return _0x5700c4;})});}_0x4cb081=_[_0xc966('0x47')]({},_0x4cb081,_0x11b791[_0xc966('0x48')]);return db[_0xc966('0x65')]['count']({'where':_0x4cb081[_0xc966('0x44')]})['then'](function(_0x49701c){_0x2dc016[_0xc966('0x29')]=_0x49701c;if(_0x11b791[_0xc966('0x3c')]['includeAll']){_0x4cb081[_0xc966('0x4a')]=[{'all':!![]}];}return db['CannedAnswer'][_0xc966('0x4b')](_0x4cb081);})['then'](function(_0x5f093c){_0x2dc016[_0xc966('0x4c')]=_0x5f093c;return _0x2dc016;});}})[_0xc966('0x2d')](respondWithFilteredResult(_0x2dc115,_0x4cb081))[_0xc966('0x22')](handleError(_0x2dc115,null));};exports['removeAnswers']=function(_0x60fffc,_0xfa62c0,_0x5b570f){return db[_0xc966('0x36')][_0xc966('0x4e')]({'where':{'id':_0x60fffc['params']['id']}})[_0xc966('0x2d')](handleEntityNotFound(_0xfa62c0,null))[_0xc966('0x2d')](function(_0x2ff294){if(_0x2ff294){return _0x2ff294['removeAnswers'](_0x60fffc[_0xc966('0x3c')][_0xc966('0x64')]);}})[_0xc966('0x2d')](respondWithStatusCode(_0xfa62c0,null))['catch'](handleError(_0xfa62c0,null));};exports[_0xc966('0x67')]=function(_0x21a120,_0x33e0b0,_0x25b47f){return db['FaxInteraction'][_0xc966('0x4e')]({'where':{'id':_0x21a120['params']['id']}})['then'](handleEntityNotFound(_0x33e0b0,null))['then'](function(_0x51aa56){if(_0x51aa56){return _0x51aa56[_0xc966('0x67')](_0x21a120[_0xc966('0x50')]['ids'],_[_0xc966('0x68')](_0x21a120[_0xc966('0x50')],[_0xc966('0x64'),'id'])||{});}})[_0xc966('0x2d')](respondWithResult(_0x33e0b0,null))[_0xc966('0x22')](handleError(_0x33e0b0,null));};exports['getInteractions']=function(_0x26c1a2,_0x1db1df,_0x3f7b66){var _0x569086={'raw':![],'where':{}};var _0x11e313={};var _0x468424={'count':0x0,'rows':[]};return db[_0xc966('0x36')][_0xc966('0x61')]({'where':{'id':_0x26c1a2[_0xc966('0x4d')]['id']}})[_0xc966('0x2d')](handleEntityNotFound(_0x1db1df,null))[_0xc966('0x2d')](function(_0x14f30){if(_0x14f30){_0x11e313[_0xc966('0x3b')]=_[_0xc966('0x3d')](db[_0xc966('0x69')][_0xc966('0x37')]);_0x11e313[_0xc966('0x3c')]=_[_0xc966('0x3d')](_0x26c1a2['query']);_0x11e313[_0xc966('0x45')]=_[_0xc966('0x3e')](_0x11e313['model'],_0x11e313[_0xc966('0x3c')]);_0x569086[_0xc966('0x3f')]=_[_0xc966('0x3e')](_0x11e313[_0xc966('0x3b')],qs[_0xc966('0x40')](_0x26c1a2[_0xc966('0x3c')][_0xc966('0x40')]));_0x569086[_0xc966('0x3f')]=_0x569086['attributes'][_0xc966('0x41')]?_0x569086['attributes']:_0x11e313[_0xc966('0x3b')];if(!_0x26c1a2[_0xc966('0x3c')][_0xc966('0x62')](_0xc966('0x6a'))){_0x569086[_0xc966('0x27')]=qs[_0xc966('0x27')](_0x26c1a2[_0xc966('0x3c')]['limit']);_0x569086[_0xc966('0x26')]=qs[_0xc966('0x26')](_0x26c1a2['query'][_0xc966('0x26')]);}_0x569086[_0xc966('0x42')]=qs[_0xc966('0x43')](_0x26c1a2[_0xc966('0x3c')]['sort']);_0x569086[_0xc966('0x44')]=qs[_0xc966('0x45')](_[_0xc966('0x6b')](_0x26c1a2['query'],_0x11e313[_0xc966('0x45')]));_0x569086[_0xc966('0x44')]['FaxAccountId']=_0x14f30['id'];if(_0x26c1a2[_0xc966('0x3c')][_0xc966('0x46')]){_0x569086[_0xc966('0x44')]=_[_0xc966('0x47')](_0x569086[_0xc966('0x44')],{'$or':_['map'](_0x569086[_0xc966('0x3f')],function(_0x5c0685){var _0xa26810={};_0xa26810[_0x5c0685]={'$like':'%'+_0x26c1a2[_0xc966('0x3c')]['filter']+'%'};return _0xa26810;})});}_0x569086=_[_0xc966('0x47')]({},_0x569086,_0x26c1a2[_0xc966('0x48')]);return db[_0xc966('0x69')][_0xc966('0x29')]({'where':_0x569086[_0xc966('0x44')]})['then'](function(_0x46ae2e){_0x468424['count']=_0x46ae2e;if(_0x26c1a2['query'][_0xc966('0x49')]){_0x569086[_0xc966('0x4a')]=[{'model':db[_0xc966('0x6c')],'as':'Contact','required':![]},{'model':db[_0xc966('0x6d')],'as':_0xc966('0x6e'),'attributes':[_0xc966('0x30'),_0xc966('0x6f'),_0xc966('0x70')],'required':![]},{'model':db[_0xc966('0x71')],'as':_0xc966('0x72'),'attributes':['id',_0xc966('0x30'),_0xc966('0x73')],'where':_0x26c1a2[_0xc966('0x3c')][_0xc966('0x74')]?{'id':_0x26c1a2[_0xc966('0x3c')][_0xc966('0x74')]}:undefined,'required':_0x26c1a2[_0xc966('0x3c')][_0xc966('0x74')]?!![]:![]}];}return db[_0xc966('0x69')][_0xc966('0x4b')](_0x569086);})['then'](function(_0x51a112){_0x468424[_0xc966('0x4c')]=_0x51a112;return _0x468424;});}})[_0xc966('0x2d')](respondWithFilteredResult(_0x1db1df,_0x569086))[_0xc966('0x22')](handleError(_0x1db1df,null));};exports[_0xc966('0x75')]=function(_0x3847d1,_0x5158da,_0x2a1e61){return db[_0xc966('0x36')][_0xc966('0x61')]({'where':{'id':_0x3847d1[_0xc966('0x4d')]['id']}})['then'](handleEntityNotFound(_0x5158da,null))[_0xc966('0x2d')](function(_0x336bc2){if(_0x336bc2){return db[_0xc966('0x76')][_0xc966('0x77')](function(_0x28347e){return db[_0xc966('0x78')][_0xc966('0x5b')]({'where':{'FaxAccountId':_0x3847d1[_0xc966('0x4d')]['id']},'transaction':_0x28347e})[_0xc966('0x2d')](function(_0x5377c2){var _0x3c1a48=_[_0xc966('0x35')](_0x3847d1[_0xc966('0x50')],function(_0x52aa1a){_0x52aa1a[_0xc966('0x5e')]=_0x3847d1[_0xc966('0x4d')]['id'];return _0x52aa1a;});return db['FaxApplication'][_0xc966('0x79')](_0x3c1a48,{'transaction':_0x28347e});});})[_0xc966('0x2d')](function(){return db[_0xc966('0x78')][_0xc966('0x7a')]({'where':{'FaxAccountId':_0x3847d1['params']['id']},'order':_0xc966('0x7b')});});}})[_0xc966('0x2d')](respondWithResult(_0x5158da,null))[_0xc966('0x22')](handleError(_0x5158da,null));};exports[_0xc966('0x7c')]=function(_0x3a5678,_0x2414ec,_0x409a86){var _0x102152={};var _0xc56727={};var _0x627b38;var _0x48f863;return db[_0xc966('0x36')][_0xc966('0x61')]({'where':{'id':_0x3a5678[_0xc966('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2414ec,null))[_0xc966('0x2d')](function(_0x1b7c66){if(_0x1b7c66){_0x627b38=_0x1b7c66;_0xc56727['model']=_[_0xc966('0x3d')](db[_0xc966('0x78')][_0xc966('0x37')]);_0xc56727['query']=_[_0xc966('0x3d')](_0x3a5678[_0xc966('0x3c')]);_0xc56727[_0xc966('0x45')]=_[_0xc966('0x3e')](_0xc56727['model'],_0xc56727[_0xc966('0x3c')]);_0x102152[_0xc966('0x3f')]=_[_0xc966('0x3e')](_0xc56727[_0xc966('0x3b')],qs[_0xc966('0x40')](_0x3a5678[_0xc966('0x3c')][_0xc966('0x40')]));_0x102152[_0xc966('0x3f')]=_0x102152['attributes'][_0xc966('0x41')]?_0x102152[_0xc966('0x3f')]:_0xc56727['model'];_0x102152[_0xc966('0x42')]=qs['sort'](_0x3a5678[_0xc966('0x3c')][_0xc966('0x43')]);_0x102152['where']=qs['filters'](_[_0xc966('0x6b')](_0x3a5678[_0xc966('0x3c')],_0xc56727['filters']));if(_0x3a5678[_0xc966('0x3c')]['filter']){_0x102152[_0xc966('0x44')]=_[_0xc966('0x47')](_0x102152['where'],{'$or':_[_0xc966('0x35')](_0x102152['attributes'],function(_0x23aabe){var _0x2bced2={};_0x2bced2[_0x23aabe]={'$like':'%'+_0x3a5678[_0xc966('0x3c')][_0xc966('0x46')]+'%'};return _0x2bced2;})});}_0x102152=_[_0xc966('0x47')]({},_0x102152,_0x3a5678[_0xc966('0x48')]);return _0x627b38[_0xc966('0x7c')](_0x102152);}})[_0xc966('0x2d')](function(_0x2ea1ec){if(_0x2ea1ec){_0x48f863=_0x2ea1ec['length'];if(!_0x3a5678[_0xc966('0x3c')][_0xc966('0x62')](_0xc966('0x6a'))){_0x102152[_0xc966('0x27')]=qs[_0xc966('0x27')](_0x3a5678['query'][_0xc966('0x27')]);_0x102152[_0xc966('0x26')]=qs[_0xc966('0x26')](_0x3a5678[_0xc966('0x3c')]['offset']);}return _0x627b38[_0xc966('0x7c')](_0x102152);}})[_0xc966('0x2d')](function(_0x25b975){if(_0x25b975){return _0x25b975?{'count':_0x48f863,'rows':_0x25b975}:null;}})[_0xc966('0x2d')](respondWithResult(_0x2414ec,null))['catch'](handleError(_0x2414ec,null));};function Extension(_0x2fef00,_0x24e22d,_0x11a1e6,_0x4ad1dd){this[_0xc966('0x7d')]='from-voip-provider';this[_0xc966('0x7e')]=_0x2fef00[_0xc966('0x7f')];this[_0xc966('0x80')]=_0x4ad1dd;this[_0xc966('0x39')]='system';this[_0xc966('0x81')]='Fax\x20Extension';this[_0xc966('0x5e')]=_0x2fef00['id'];this[_0xc966('0x7b')]=_0x24e22d;this[_0xc966('0x82')]=_0x11a1e6;}function createExtensionsReciveFax(_0x64b6f7){var _0x3b62d5=0x1;var _0x1701a8=[];_0x1701a8[_0xc966('0x83')](new Extension(_0x64b6f7,_0x3b62d5,'',_0xc966('0x84')));_0x3b62d5+=0x1;_0x1701a8['push'](new Extension(_0x64b6f7,_0x3b62d5,_0xc966('0x85'),_0xc966('0x86')));_0x3b62d5+=0x1;for(var _0x5b7342 in _0x64b6f7){if(_0x64b6f7[_0xc966('0x62')](_0x5b7342)&&(_0x5b7342===_0xc966('0x87')||_0x5b7342===_0xc966('0x7f')||_0x5b7342===_0xc966('0x88')||_0x5b7342===_0xc966('0x89')||_0x5b7342===_0xc966('0x8a')||_0x5b7342===_0xc966('0x8b')||_0x5b7342===_0xc966('0x8c')||_0x5b7342==='modem'||_0x5b7342===_0xc966('0x8d'))){_0x1701a8[_0xc966('0x83')](new Extension(_0x64b6f7,_0x3b62d5,'FAXOPT('+_0x5b7342+')='+_0x64b6f7[_0x5b7342],_0xc966('0x86')));_0x3b62d5+=0x1;}}_0x1701a8[_0xc966('0x83')](new Extension(_0x64b6f7,_0x3b62d5,'6','Wait'));_0x3b62d5+=0x1;_0x1701a8[_0xc966('0x83')](new Extension(_0x64b6f7,_0x3b62d5,'/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'));_0x3b62d5=0x0;return _0x1701a8;}exports['addAccountApplications']=function(_0xa82d60,_0x520abf,_0x44cd2e){var _0x1ab6bf;return db[_0xc966('0x76')]['transaction'](function(_0x5d6f1c){return db[_0xc966('0x36')][_0xc966('0x4f')](_0xa82d60[_0xc966('0x50')],{'transaction':_0x5d6f1c})[_0xc966('0x2d')](function(_0x318bb8){_0x1ab6bf=_0x318bb8[_0xc966('0x2e')]({'plain':!![]});return db[_0xc966('0x8e')]['bulkCreate'](createExtensionsReciveFax(_0x1ab6bf),{'transaction':_0x5d6f1c});});})[_0xc966('0x2d')](function(){return _0x1ab6bf;})['then'](respondWithResult(_0x520abf,null))['catch'](handleError(_0x520abf,null));};exports['updateAccountApplications']=function(_0x5e7eab,_0x350b73,_0x5648db){var _0x33ccdf;return db['sequelize'][_0xc966('0x77')](function(_0xe7bd9a){return db[_0xc966('0x36')][_0xc966('0x5a')](_0x5e7eab[_0xc966('0x50')],{'where':{'id':_0x5e7eab['body']['id']},'transaction':_0xe7bd9a})[_0xc966('0x2d')](function(_0x32b1ba){return db[_0xc966('0x8e')][_0xc966('0x5b')]({'where':{'FaxAccountId':_0x5e7eab[_0xc966('0x50')]['id']},'transaction':_0xe7bd9a})['then'](function(_0x3d79c2){return db['VoiceExtension']['bulkCreate'](createExtensionsReciveFax(_[_0xc966('0x68')](_0x5e7eab[_0xc966('0x50')],['tech',_0xc966('0x3a'),_0xc966('0x8f'),_0xc966('0x90'),_0xc966('0x91'),'ListId'])),{'transaction':_0xe7bd9a});});});})[_0xc966('0x2d')](function(){return db['FaxAccount'][_0xc966('0x92')](_0x5e7eab[_0xc966('0x50')]['id']);})[_0xc966('0x2d')](respondWithResult(_0x350b73,null))[_0xc966('0x22')](handleError(_0x350b73,null));};exports[_0xc966('0x93')]=function(_0x359380,_0xa66477,_0x20c2db){var _0x5b4cbe={'raw':!![],'where':{}};var _0x26c84c={};var _0x1c4007={'count':0x0,'rows':[]};return db[_0xc966('0x36')]['findOne']({'where':{'id':_0x359380['params']['id']}})[_0xc966('0x2d')](handleEntityNotFound(_0xa66477,null))[_0xc966('0x2d')](function(_0x1cbdf6){if(_0x1cbdf6){_0x26c84c['model']=_[_0xc966('0x3d')](db[_0xc966('0x94')]['rawAttributes']);_0x26c84c[_0xc966('0x3c')]=_[_0xc966('0x3d')](_0x359380[_0xc966('0x3c')]);_0x26c84c[_0xc966('0x45')]=_['intersection'](_0x26c84c[_0xc966('0x3b')],_0x26c84c[_0xc966('0x3c')]);_0x5b4cbe['attributes']=_[_0xc966('0x3e')](_0x26c84c[_0xc966('0x3b')],qs[_0xc966('0x40')](_0x359380['query'][_0xc966('0x40')]));_0x5b4cbe[_0xc966('0x3f')]=_0x5b4cbe[_0xc966('0x3f')][_0xc966('0x41')]?_0x5b4cbe['attributes']:_0x26c84c['model'];if(!_0x359380[_0xc966('0x3c')]['hasOwnProperty'](_0xc966('0x6a'))){_0x5b4cbe['limit']=qs[_0xc966('0x27')](_0x359380[_0xc966('0x3c')][_0xc966('0x27')]);_0x5b4cbe[_0xc966('0x26')]=qs[_0xc966('0x26')](_0x359380[_0xc966('0x3c')][_0xc966('0x26')]);}_0x5b4cbe[_0xc966('0x42')]=qs['sort'](_0x359380[_0xc966('0x3c')]['sort']);_0x5b4cbe[_0xc966('0x44')]=qs[_0xc966('0x45')](_[_0xc966('0x6b')](_0x359380[_0xc966('0x3c')],_0x26c84c[_0xc966('0x45')]));_0x5b4cbe[_0xc966('0x44')]['FaxAccountId']=_0x1cbdf6['id'];if(_0x359380['query'][_0xc966('0x46')]){_0x5b4cbe[_0xc966('0x44')]=_[_0xc966('0x47')](_0x5b4cbe[_0xc966('0x44')],{'$or':_['map'](_0x5b4cbe[_0xc966('0x3f')],function(_0x157989){var _0x31ff64={};_0x31ff64[_0x157989]={'$like':'%'+_0x359380[_0xc966('0x3c')][_0xc966('0x46')]+'%'};return _0x31ff64;})});}if(_0x359380[_0xc966('0x3c')][_0xc966('0x95')]){var _0x4948f2=_0x359380[_0xc966('0x3c')]['$gte']['split'](',');var _0xe68add={};_0xe68add[_0x4948f2[0x0]]={'$gte':moment(_0x4948f2[0x1])[_0xc966('0x96')](_0xc966('0x97'))};_0x5b4cbe[_0xc966('0x44')]=_[_0xc966('0x47')](_0x5b4cbe[_0xc966('0x44')],_0xe68add);}_0x5b4cbe=_[_0xc966('0x47')]({},_0x5b4cbe,_0x359380[_0xc966('0x48')]);return db['FaxMessage'][_0xc966('0x29')]({'where':_0x5b4cbe[_0xc966('0x44')]})[_0xc966('0x2d')](function(_0x531c64){_0x1c4007[_0xc966('0x29')]=_0x531c64;if(_0x359380[_0xc966('0x3c')][_0xc966('0x49')]){_0x5b4cbe['include']=[{'all':!![]}];}return db[_0xc966('0x94')][_0xc966('0x4b')](_0x5b4cbe);})['then'](function(_0x1e03a1){_0x1c4007['rows']=_0x1e03a1;return _0x1c4007;});}})[_0xc966('0x2d')](respondWithFilteredResult(_0xa66477,_0x5b4cbe))[_0xc966('0x22')](handleError(_0xa66477,null));};exports[_0xc966('0x31')]=function(_0x29dc3a,_0x14a311,_0x24197c){var _0x1d1681,_0xce403f={},_0x19a357;if(_0x29dc3a[_0xc966('0x50')]['to']){_0x19a357=_0x29dc3a[_0xc966('0x50')]['to'][0x0];}return db['FaxAccount'][_0xc966('0x4e')]({'where':{'id':_0x29dc3a[_0xc966('0x4d')]['id']},'include':[{'model':db[_0xc966('0x98')],'as':_0xc966('0x99'),'include':[{'model':db[_0xc966('0x6c')],'as':_0xc966('0x9a'),'where':{'fax':_0x19a357},'limit':0x1,'order':[[_0xc966('0x90'),_0xc966('0x9b')]]}]}]})[_0xc966('0x2d')](handleEntityNotFound(_0x14a311,null))[_0xc966('0x2d')](function(_0x5e1208){_0x1d1681=_0x5e1208;if(_0x29dc3a[_0xc966('0x50')][_0xc966('0x9c')]&&_0x29dc3a['body'][_0xc966('0x9c')]['length']){for(var _0x2e3978=0x0;_0x2e3978<_0x29dc3a[_0xc966('0x50')][_0xc966('0x9c')]['length'];_0x2e3978+=0x1){_0x29dc3a[_0xc966('0x50')]['attachments'][_0x2e3978]={'filename':_0x29dc3a['body'][_0xc966('0x9c')][_0x2e3978][_0xc966('0x30')],'id':_0x29dc3a['body'][_0xc966('0x9c')][_0x2e3978]['id'],'path':path['join'](config[_0xc966('0x9d')],_0xc966('0x9e'),_0x29dc3a['body'][_0xc966('0x9c')][_0x2e3978][_0xc966('0x9f')])};}}return respondWithRpcPromise(_0xc966('0xa0'),_0xc966('0xa0'),{'FaxAccountId':_[_0xc966('0xa1')](_0x29dc3a[_0xc966('0x4d')]['id'])?undefined:_0x29dc3a['params']['id'],'path':_[_0xc966('0xa1')](_0x29dc3a[_0xc966('0x50')]['attachments'][0x0][_0xc966('0x6')])?undefined:_0x29dc3a[_0xc966('0x50')]['attachments'][0x0][_0xc966('0x6')],'fax':_[_0xc966('0xa1')](_0x29dc3a[_0xc966('0x50')]['to'][0x0])?undefined:_0x29dc3a[_0xc966('0x50')]['to'][0x0]},client9002);})[_0xc966('0x2d')](function(){if(_0x1d1681){if(_[_0xc966('0xa1')](_0x29dc3a[_0xc966('0x50')][_0xc966('0xa2')])){_0x29dc3a[_0xc966('0x50')][_0xc966('0xa2')]=util[_0xc966('0x96')]('\x22%s\x22\x20<%s>',_0x1d1681[_0xc966('0x30')],_0x1d1681['fax']);}if(_0x1d1681['List']){if(_0x1d1681['List'][_0xc966('0x9a')][_0xc966('0x41')]){return _0x1d1681[_0xc966('0x99')][_0xc966('0x9a')][0x0];}else{return db[_0xc966('0x6c')][_0xc966('0x4f')](_['defaults'](_0x29dc3a[_0xc966('0x50')],{'firstName':_0x29dc3a[_0xc966('0x50')]['to'][0x0],'phone':_0x29dc3a[_0xc966('0x50')]['to'][0x0],'fax':_0x29dc3a[_0xc966('0x50')]['to'][0x0],'ListId':_0x1d1681['ListId']}));}}else{throw new Error(_0xc966('0xa3'));}}else{throw new Error(_0xc966('0xa4'));}})['then'](function(_0x2f4b5b){if(_0x2f4b5b){return db[_0xc966('0x69')]['find']({'where':{'ContactId':_0x2f4b5b['id'],'closed':![],'FaxAccountId':_0x1d1681['id']}})[_0xc966('0x2d')](function(_0x1d9dbd){if(_0x1d9dbd){return[_0x1d9dbd,![]];}return db[_0xc966('0x69')][_0xc966('0x4f')]({'UserId':_0x29dc3a[_0xc966('0x51')]['id'],'ContactId':_0x2f4b5b['id'],'FaxAccountId':_0x1d1681['id'],'fax':_0x29dc3a[_0xc966('0x50')]['to'][0x0],'firstMsgDirection':_0xc966('0xa5'),'Messages':[_['merge'](_0x29dc3a['body'],{'read':![],'body':_0x29dc3a[_0xc966('0x50')][_0xc966('0x9c')][0x0][_0xc966('0xa6')],'FaxAccountId':_0x1d1681['id'],'UserId':_0x29dc3a['user']['id'],'ContactId':_0x2f4b5b['id'],'AttachmentId':_0x29dc3a[_0xc966('0x50')]['attachments'][0x0]['id']})]},{'include':[{'model':db[_0xc966('0x94')],'as':'Messages'}]})[_0xc966('0x2d')](function(_0x1a66aa){return[_0x1a66aa,!![]];});});}else{throw new Error(_0xc966('0xa7'));}})[_0xc966('0xa8')](function(_0x1c4ebf,_0xad4f7e){if(_0xad4f7e){return _0x1c4ebf;}return db[_0xc966('0x94')][_0xc966('0x4f')]({'direction':_0xc966('0xa5'),'read':![],'body':_0x29dc3a[_0xc966('0x50')]['attachments'][0x0][_0xc966('0xa6')],'FaxAccountId':_0x1d1681['id'],'FaxInteractionId':_0x1c4ebf['id'],'UserId':_0x29dc3a[_0xc966('0x51')]['id'],'ContactId':_0x1c4ebf[_0xc966('0xa9')],'AttachmentId':_0x29dc3a['body'][_0xc966('0x9c')][0x0]['id']})[_0xc966('0x2d')](function(_0x29bc97){_0x1c4ebf[_0xc966('0xaa')][_0xc966('0xab')]=[];_0x1c4ebf[_0xc966('0xaa')][_0xc966('0xab')][_0xc966('0x83')](_0x29bc97[_0xc966('0xaa')]);return _0x1c4ebf;});})[_0xc966('0x2d')](function(_0x479d02){respondWithRpcPromise(_0xc966('0xac'),_0xc966('0xac'),{'FaxAccountId':_[_0xc966('0xa1')](_0x29dc3a['params']['id'])?undefined:_0x29dc3a[_0xc966('0x4d')]['id'],'path':_[_0xc966('0xa1')](_0x29dc3a[_0xc966('0x50')][_0xc966('0x9c')][0x0]['path'])?undefined:_0x29dc3a['body'][_0xc966('0x9c')][0x0][_0xc966('0x6')],'fax':_[_0xc966('0xa1')](_0x29dc3a[_0xc966('0x50')]['to'][0x0])?undefined:_0x29dc3a['body']['to'][0x0],'AttachmentId':_0x29dc3a[_0xc966('0x50')][_0xc966('0x9c')][0x0]['id']},client9002)[_0xc966('0x2d')](function(_0xd3d670){logger['info']('SendFaxRpc,\x20%s',_0xd3d670);})['catch'](function(_0x29c055){logger['info'](_0xc966('0xad'),_0x29c055);});return _0x479d02;})['then'](respondWithResult(_0x14a311,null))[_0xc966('0x22')](handleError(_0x14a311,null));};exports[_0xc966('0xae')]=function(_0x2df0a2,_0x3e3e4a,_0x10b70f){return db['FaxAccount'][_0xc966('0x4e')]({'where':{'id':_0x2df0a2[_0xc966('0x4d')]['id']}})[_0xc966('0x2d')](handleEntityNotFound(_0x3e3e4a,null))[_0xc966('0x2d')](function(_0x3d8d99){if(_0x3d8d99){return _0x3d8d99[_0xc966('0xae')](_0x2df0a2['body'][_0xc966('0x64')],_[_0xc966('0x68')](_0x2df0a2[_0xc966('0x50')],[_0xc966('0x64'),'id'])||{})['spread'](function(_0x583e27){for(var _0x2e6940=0x0;_0x2e6940<_0x2df0a2['body'][_0xc966('0x64')]['length'];_0x2e6940+=0x1){socket[_0xc966('0xaf')](_0xc966('0xb0'),{'UserId':Number(_0x2df0a2[_0xc966('0x50')][_0xc966('0x64')][_0x2e6940]),'FaxAccountId':Number(_0x2df0a2[_0xc966('0x4d')]['id'])});}return _0x583e27;});}})[_0xc966('0x2d')](respondWithResult(_0x3e3e4a,null))[_0xc966('0x22')](handleError(_0x3e3e4a,null));};exports[_0xc966('0xb1')]=function(_0x29b570,_0x377c77,_0x476a79){return db[_0xc966('0x36')][_0xc966('0x4e')]({'where':{'id':_0x29b570[_0xc966('0x4d')]['id']}})['then'](handleEntityNotFound(_0x377c77,null))[_0xc966('0x2d')](function(_0x4d4e92){if(_0x4d4e92){return _0x4d4e92['removeAgents'](_0x29b570[_0xc966('0x3c')]['ids'])[_0xc966('0x2d')](function(){if(_[_0xc966('0xb2')](_0x29b570[_0xc966('0x3c')][_0xc966('0x64')])){for(var _0x34713b=0x0;_0x34713b<_0x29b570[_0xc966('0x3c')][_0xc966('0x64')][_0xc966('0x41')];_0x34713b+=0x1){socket[_0xc966('0xaf')]('userFaxAccount:remove',{'UserId':Number(_0x29b570[_0xc966('0x3c')][_0xc966('0x64')][_0x34713b]),'FaxAccountId':Number(_0x29b570[_0xc966('0x4d')]['id'])});}}else{socket[_0xc966('0xaf')](_0xc966('0xb3'),{'UserId':Number(_0x29b570[_0xc966('0x3c')]['ids']),'FaxAccountId':Number(_0x29b570[_0xc966('0x4d')]['id'])});}});}})[_0xc966('0x2d')](respondWithStatusCode(_0x377c77,null))[_0xc966('0x22')](handleError(_0x377c77,null));};exports[_0xc966('0xb4')]=function(_0x2de4fd,_0x36b91b,_0x42e3b1){var _0xb8af9a={};var _0x47d87a={};var _0x44912e;var _0x44e35b;return db[_0xc966('0x36')][_0xc966('0x61')]({'where':{'id':_0x2de4fd['params']['id']}})[_0xc966('0x2d')](handleEntityNotFound(_0x36b91b,null))[_0xc966('0x2d')](function(_0x465fbc){if(_0x465fbc){_0x44912e=_0x465fbc;_0x47d87a[_0xc966('0x3b')]=_['keys'](db[_0xc966('0x6d')][_0xc966('0x37')]);_0x47d87a['query']=_[_0xc966('0x3d')](_0x2de4fd[_0xc966('0x3c')]);_0x47d87a[_0xc966('0x45')]=_['intersection'](_0x47d87a[_0xc966('0x3b')],_0x47d87a[_0xc966('0x3c')]);_0xb8af9a[_0xc966('0x3f')]=_['intersection'](_0x47d87a[_0xc966('0x3b')],qs[_0xc966('0x40')](_0x2de4fd[_0xc966('0x3c')][_0xc966('0x40')]));_0xb8af9a[_0xc966('0x3f')]=_0xb8af9a[_0xc966('0x3f')]['length']?_0xb8af9a[_0xc966('0x3f')]:_0x47d87a['model'];_0xb8af9a[_0xc966('0x42')]=qs['sort'](_0x2de4fd[_0xc966('0x3c')][_0xc966('0x43')]);_0xb8af9a['where']=qs[_0xc966('0x45')](_[_0xc966('0x6b')](_0x2de4fd[_0xc966('0x3c')],_0x47d87a[_0xc966('0x45')]));if(_0x2de4fd[_0xc966('0x3c')]['filter']){_0xb8af9a[_0xc966('0x44')]=_['merge'](_0xb8af9a[_0xc966('0x44')],{'$or':_[_0xc966('0x35')](_0xb8af9a['attributes'],function(_0x3e34d9){var _0x599605={};_0x599605[_0x3e34d9]={'$like':'%'+_0x2de4fd[_0xc966('0x3c')][_0xc966('0x46')]+'%'};return _0x599605;})});}_0xb8af9a=_['merge']({},_0xb8af9a,_0x2de4fd[_0xc966('0x48')]);return _0x44912e[_0xc966('0xb4')](_0xb8af9a);}})[_0xc966('0x2d')](function(_0x17c068){if(_0x17c068){_0x44e35b=_0x17c068[_0xc966('0x41')];if(!_0x2de4fd[_0xc966('0x3c')][_0xc966('0x62')](_0xc966('0x6a'))){_0xb8af9a[_0xc966('0x27')]=qs['limit'](_0x2de4fd['query'][_0xc966('0x27')]);_0xb8af9a[_0xc966('0x26')]=qs[_0xc966('0x26')](_0x2de4fd['query']['offset']);}return _0x44912e['getAgents'](_0xb8af9a);}})['then'](function(_0x320fd7){if(_0x320fd7){return _0x320fd7?{'count':_0x44e35b,'rows':_0x320fd7}:null;}})[_0xc966('0x2d')](respondWithResult(_0x36b91b,null))[_0xc966('0x22')](handleError(_0x36b91b,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 6fdfea2..04a451e 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 _0x6e5a=['../../mysqldb','FaxAccount','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x191b2d,_0x15f3d9){var _0x364d36=function(_0x4f1f26){while(--_0x4f1f26){_0x191b2d['push'](_0x191b2d['shift']());}};_0x364d36(++_0x15f3d9);}(_0x6e5a,0x13a));var _0xa6e5=function(_0x28d8fc,_0x3c0cea){_0x28d8fc=_0x28d8fc-0x0;var _0x572be6=_0x6e5a[_0x28d8fc];return _0x572be6;};'use strict';var EventEmitter=require(_0xa6e5('0x0'));var FaxAccount=require(_0xa6e5('0x1'))['db'][_0xa6e5('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa6e5('0x3'),'afterUpdate':_0xa6e5('0x4'),'afterDestroy':_0xa6e5('0x5')};function emitEvent(_0x2b9f01){return function(_0x28a2d3,_0x5e8d5b,_0x1b173f){FaxAccountEvents[_0xa6e5('0x6')](_0x2b9f01+':'+_0x28a2d3['id'],_0x28a2d3);FaxAccountEvents[_0xa6e5('0x6')](_0x2b9f01,_0x28a2d3);_0x1b173f(null);};}for(var e in events){if(events[_0xa6e5('0x7')](e)){var event=events[e];FaxAccount[_0xa6e5('0x8')](e,emitEvent(event));}}module['exports']=FaxAccountEvents; \ No newline at end of file +var _0x9209=['exports','events','../../mysqldb','FaxAccount','setMaxListeners','save','emit','hasOwnProperty','hook'];(function(_0x10413d,_0x39ceb2){var _0x26c937=function(_0x3fb540){while(--_0x3fb540){_0x10413d['push'](_0x10413d['shift']());}};_0x26c937(++_0x39ceb2);}(_0x9209,0x1ba));var _0x9920=function(_0x413395,_0x2ca093){_0x413395=_0x413395-0x0;var _0x79a324=_0x9209[_0x413395];return _0x79a324;};'use strict';var EventEmitter=require(_0x9920('0x0'));var FaxAccount=require(_0x9920('0x1'))['db'][_0x9920('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x9920('0x3')](0x0);var events={'afterCreate':_0x9920('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x226362){return function(_0x21e6d4,_0x168140,_0x1987d8){FaxAccountEvents['emit'](_0x226362+':'+_0x21e6d4['id'],_0x21e6d4);FaxAccountEvents[_0x9920('0x5')](_0x226362,_0x21e6d4);_0x1987d8(null);};}for(var e in events){if(events[_0x9920('0x6')](e)){var event=events[e];FaxAccount[_0x9920('0x7')](e,emitEvent(event));}}module[_0x9920('0x8')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index bdf83f1..8287462 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 _0x49b5=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','FaxAccount','fax_accounts','lodash','../../config/logger','api'];(function(_0x31e719,_0x43c524){var _0x29f6e1=function(_0x34134f){while(--_0x34134f){_0x31e719['push'](_0x31e719['shift']());}};_0x29f6e1(++_0x43c524);}(_0x49b5,0xd5));var _0x549b=function(_0x1ed9b5,_0x200061){_0x1ed9b5=_0x1ed9b5-0x0;var _0x5cf9fc=_0x49b5[_0x1ed9b5];return _0x5cf9fc;};'use strict';var _=require(_0x549b('0x0'));var util=require('util');var logger=require(_0x549b('0x1'))(_0x549b('0x2'));var moment=require(_0x549b('0x3'));var BPromise=require(_0x549b('0x4'));var rp=require(_0x549b('0x5'));var fs=require('fs');var path=require(_0x549b('0x6'));var rimraf=require(_0x549b('0x7'));var config=require(_0x549b('0x8'));var attributes=require('./faxAccount.attributes');module[_0x549b('0x9')]=function(_0x2da9a5,_0x1a7ea1){return _0x2da9a5['define'](_0x549b('0xa'),attributes,{'tableName':_0x549b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x396d=['fax_accounts','lodash','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./faxAccount.attributes','exports','define','FaxAccount'];(function(_0x40bffc,_0x3a45d7){var _0x3007e9=function(_0x4c8fda){while(--_0x4c8fda){_0x40bffc['push'](_0x40bffc['shift']());}};_0x3007e9(++_0x3a45d7);}(_0x396d,0x139));var _0xd396=function(_0x1d2326,_0x23b1d3){_0x1d2326=_0x1d2326-0x0;var _0x28bb03=_0x396d[_0x1d2326];return _0x28bb03;};'use strict';var _=require(_0xd396('0x0'));var util=require('util');var logger=require(_0xd396('0x1'))('api');var moment=require('moment');var BPromise=require(_0xd396('0x2'));var rp=require(_0xd396('0x3'));var fs=require('fs');var path=require(_0xd396('0x4'));var rimraf=require(_0xd396('0x5'));var config=require(_0xd396('0x6'));var attributes=require(_0xd396('0x7'));module[_0xd396('0x8')]=function(_0x36a037,_0x41e3b6){return _0x36a037[_0xd396('0x9')](_0xd396('0xa'),attributes,{'tableName':_0xd396('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.rpc.js b/server/api/faxAccount/faxAccount.rpc.js index c90716b..d247a2f 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 _0xaefa=['asc','Contacts','length','contact','find','FaxInteraction','create','Contact\x20not\x20found','spread','autoclose','push','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','UserId','User','name','unshift','agent','waitForTheAssignedAgent','Start','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','result','catch','FaxAccount','findAll','options','raw','where','attributes','include','map','model','GetFaxAccount','NotifyFaxAccount','fax','CmContact','describe','Sequelize','no\x20available\x20attributes','keys','updatedAt','difference','createdAt','CompanyId','ListId','body','isNil','from','from\x20is\x20mandatory','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','List','FaxApplication','Applications','get','applications','orderBy'];(function(_0x43635b,_0x1686f3){var _0x210fb8=function(_0x757dbc){while(--_0x757dbc){_0x43635b['push'](_0x43635b['shift']());}};_0x210fb8(++_0x1686f3);}(_0xaefa,0xd4));var _0xaaef=function(_0x131273,_0x27983a){_0x131273=_0x131273-0x0;var _0x537e6b=_0xaefa[_0x131273];return _0x537e6b;};'use strict';var _=require(_0xaaef('0x0'));var util=require(_0xaaef('0x1'));var moment=require(_0xaaef('0x2'));var BPromise=require(_0xaaef('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaaef('0x4'));var db=require(_0xaaef('0x5'))['db'];var utils=require(_0xaaef('0x6'));var logger=require(_0xaaef('0x7'))(_0xaaef('0x8'));var config=require(_0xaaef('0x9'));var jayson=require(_0xaaef('0xa'));var client=jayson['client'][_0xaaef('0xb')]({'port':0x232c});config[_0xaaef('0xc')]=_[_0xaaef('0xd')](config[_0xaaef('0xc')],{'host':_0xaaef('0xe'),'port':0x18eb});var socket=require(_0xaaef('0xf'))(new Redis(config[_0xaaef('0xc')]));require('./faxAccount.socket')[_0xaaef('0x10')](socket);function respondWithRpcPromise(_0x609515,_0x542e6e,_0x103c24){return new BPromise(function(_0x5a5feb,_0xe9da2b){return client[_0xaaef('0x11')](_0x609515,_0x103c24)[_0xaaef('0x12')](function(_0x18c817){logger[_0xaaef('0x13')]('FaxAccount,\x20%s,\x20%s',_0x542e6e,_0xaaef('0x14'));logger[_0xaaef('0x15')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x542e6e,_0xaaef('0x14'),JSON[_0xaaef('0x16')](_0x18c817));if(_0x18c817['error']){if(_0x18c817[_0xaaef('0x17')][_0xaaef('0x18')]===0x1f4){logger[_0xaaef('0x17')](_0xaaef('0x19'),_0x542e6e,_0x18c817[_0xaaef('0x17')][_0xaaef('0x1a')]);return _0xe9da2b(_0x18c817[_0xaaef('0x17')][_0xaaef('0x1a')]);}logger[_0xaaef('0x17')]('FaxAccount,\x20%s,\x20%s',_0x542e6e,_0x18c817[_0xaaef('0x17')]['message']);return _0x5a5feb(_0x18c817['error'][_0xaaef('0x1a')]);}else{logger[_0xaaef('0x13')](_0xaaef('0x19'),_0x542e6e,'request\x20sent');_0x5a5feb(_0x18c817[_0xaaef('0x1b')][_0xaaef('0x1a')]);}})[_0xaaef('0x1c')](function(_0x33bedd){logger[_0xaaef('0x17')]('FaxAccount,\x20%s,\x20%s',_0x542e6e,_0x33bedd);_0xe9da2b(_0x33bedd);});});}exports['GetFaxAccount']=function(_0x1249e2){var _0x36f8e4=this;return new Promise(function(_0x1c8585,_0x350094){return db[_0xaaef('0x1d')][_0xaaef('0x1e')]({'raw':_0x1249e2['options']?_0x1249e2[_0xaaef('0x1f')][_0xaaef('0x20')]===undefined?!![]:![]:!![],'where':_0x1249e2[_0xaaef('0x1f')]?_0x1249e2[_0xaaef('0x1f')][_0xaaef('0x21')]||null:null,'attributes':_0x1249e2['options']?_0x1249e2['options'][_0xaaef('0x22')]||null:null,'limit':_0x1249e2['options']?_0x1249e2[_0xaaef('0x1f')]['limit']||null:null,'include':_0x1249e2['options']?_0x1249e2[_0xaaef('0x1f')][_0xaaef('0x23')]?_[_0xaaef('0x24')](_0x1249e2['options']['include'],function(_0x289dd2){return{'model':db[_0x289dd2['model']],'as':_0x289dd2['as'],'attributes':_0x289dd2[_0xaaef('0x22')],'include':_0x289dd2[_0xaaef('0x23')]?_['map'](_0x289dd2[_0xaaef('0x23')],function(_0x206df1){return{'model':db[_0x206df1[_0xaaef('0x25')]],'as':_0x206df1['as'],'attributes':_0x206df1[_0xaaef('0x22')],'include':_0x206df1[_0xaaef('0x23')]?_[_0xaaef('0x24')](_0x206df1[_0xaaef('0x23')],function(_0x5ef3b5){return{'model':db[_0x5ef3b5[_0xaaef('0x25')]],'as':_0x5ef3b5['as'],'attributes':_0x5ef3b5[_0xaaef('0x22')]};}):[]};}):[]};}):[]:[]})[_0xaaef('0x12')](function(_0x44115e){logger[_0xaaef('0x13')](_0xaaef('0x26'),_0x1249e2);logger[_0xaaef('0x15')](_0xaaef('0x26'),_0x1249e2,JSON[_0xaaef('0x16')](_0x44115e));_0x1c8585(_0x44115e);})[_0xaaef('0x1c')](function(_0x280707){logger['error'](_0xaaef('0x26'),_0x280707[_0xaaef('0x1a')],_0x1249e2);_0x350094(_0x36f8e4[_0xaaef('0x17')](0x1f4,_0x280707[_0xaaef('0x1a')]));});});};exports[_0xaaef('0x27')]=function(_0x36c32f,_0x2ea032,_0x3fee40){var _0x208966=this;return new Promise(function(_0x4ad0ff,_0x129187){var _0x50d1d0={'body':_0x36c32f['body'],'channel':_0xaaef('0x28')};var _0xecbdfc=[];var _0xe87ffe=[];var _0x16768b={};return db[_0xaaef('0x29')][_0xaaef('0x2a')]()[_0xaaef('0x12')](function(_0x2253de){if(!_0x2253de){throw new db[(_0xaaef('0x2b'))]['ValidationError'](_0xaaef('0x2c'));}_0xecbdfc=_['difference'](_[_0xaaef('0x2d')](_0x2253de),['createdAt',_0xaaef('0x2e')]);_0xe87ffe=_[_0xaaef('0x2f')](_['keys'](_0x2253de),[_0xaaef('0x30'),_0xaaef('0x2e'),_0xaaef('0x31'),_0xaaef('0x32')]);if(_0x36c32f[_0xaaef('0x33')]['id']){delete _0x36c32f[_0xaaef('0x33')]['id'];}if(_[_0xaaef('0x34')](_0x36c32f[_0xaaef('0x33')][_0xaaef('0x35')])){throw new db['Sequelize']['ValidationError'](_0xaaef('0x36'));}if(_[_0xaaef('0x34')](_0x36c32f[_0xaaef('0x33')][_0xaaef('0x33')])||_0x36c32f[_0xaaef('0x33')]['body']===''){throw new db['Sequelize'][(_0xaaef('0x37'))](_0xaaef('0x38'));}if(_['isNil'](_0x36c32f[_0xaaef('0x33')]['mapKey'])){throw new db[(_0xaaef('0x2b'))][(_0xaaef('0x37'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xe87ffe);}if(!_[_0xaaef('0x39')](_0xe87ffe,_0x36c32f[_0xaaef('0x33')][_0xaaef('0x3a')])){throw new db[(_0xaaef('0x2b'))][(_0xaaef('0x37'))](_0xaaef('0x3b')+_0xe87ffe);}_0x16768b[_0x36c32f[_0xaaef('0x33')]['mapKey']]=_0x36c32f[_0xaaef('0x33')][_0xaaef('0x35')];})[_0xaaef('0x12')](function(){return db[_0xaaef('0x1d')]['find']({'where':{'id':_0x36c32f[_0xaaef('0x3c')]['id']},'include':[{'model':db['CmList'],'as':_0xaaef('0x3d'),'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x16768b,'limit':0x1,'order':[[_0xaaef('0x2e'),'DESC']]}]},{'model':db[_0xaaef('0x3e')],'as':_0xaaef('0x3f')}]});})['then'](function(_0x2ddfee){if(_0x2ddfee&&_0x2ddfee[_0xaaef('0x3d')]){var _0x5bf986=_0x2ddfee[_0xaaef('0x40')]({'plain':!![]});_0x50d1d0[_0xaaef('0x3c')]=_0x5bf986;_0x50d1d0['applications']=_0x5bf986[_0xaaef('0x3f')];_0x50d1d0['list']=_0x5bf986[_0xaaef('0x3d')];_0x50d1d0[_0xaaef('0x41')]=_[_0xaaef('0x42')](_0x50d1d0[_0xaaef('0x41')],['priority'],[_0xaaef('0x43')]);if(_0x50d1d0['account'][_0xaaef('0x3f')]){delete _0x50d1d0['account'][_0xaaef('0x3f')];}if(_0x50d1d0[_0xaaef('0x3c')]['List']&&_0x50d1d0[_0xaaef('0x3c')][_0xaaef('0x3d')][_0xaaef('0x44')][_0xaaef('0x45')]){return _0x50d1d0[_0xaaef('0x3c')][_0xaaef('0x3d')]['Contacts'][0x0];}var _0x4ff64f=_[_0xaaef('0xd')](_0x36c32f[_0xaaef('0x33')],{'firstName':_0x36c32f[_0xaaef('0x33')][_0xaaef('0x35')],'ListId':_0x5bf986[_0xaaef('0x32')]});_0x4ff64f[_0x36c32f['body']['mapKey']]=_0x36c32f['body'][_0xaaef('0x35')];return db[_0xaaef('0x29')]['create'](_0x4ff64f,{'fields':_0xecbdfc,'raw':!![]});}})[_0xaaef('0x12')](function(_0x15e6f6){_0x50d1d0[_0xaaef('0x46')]=_0x15e6f6;if(_0x15e6f6){var _0x2187fe={'ContactId':_0x15e6f6['id'],'FaxAccountId':_0x36c32f[_0xaaef('0x3c')]['id'],'fax':_0x15e6f6['fax']};return db['FaxInteraction'][_0xaaef('0x47')]({'where':{'ContactId':_0x15e6f6['id'],'closed':![],'FaxAccountId':_0x36c32f[_0xaaef('0x3c')]['id']}})['then'](function(_0x269ee7){if(_0x269ee7){return[_0x269ee7,![]];}return db[_0xaaef('0x48')][_0xaaef('0x49')](_0x2187fe)[_0xaaef('0x12')](function(_0xd0f216){return[_0xd0f216,!![]];});});}else{throw new Error(_0xaaef('0x4a'));}})[_0xaaef('0x4b')](function(_0x368f27,_0x3cdad5){var _0x347473=_0x368f27[_0xaaef('0x40')]({'plain':!![]});if(_0x3cdad5){if(_0x50d1d0[_0xaaef('0x3c')][_0xaaef('0x4c')]){_0x50d1d0[_0xaaef('0x41')][_0xaaef('0x4d')]({'id':0x0,'priority':_0x50d1d0['applications'][_0xaaef('0x45')]+0x1,'app':_0xaaef('0x4e'),'appdata':_0xaaef('0x4f'),'interval':_0xaaef('0x50')});}_0x347473[_0xaaef('0x51')]=!![];}else{_0x347473['created']=![];}_0x50d1d0[_0xaaef('0x52')]=_0x347473;return db[_0xaaef('0x53')][_0xaaef('0x49')]({'body':_0x36c32f['body'][_0xaaef('0x33')],'FaxAccountId':_0x36c32f['account']['id'],'FaxInteractionId':_0x368f27['id'],'direction':'in','ContactId':_0x368f27[_0xaaef('0x54')],'AttachmentId':_0x36c32f[_0xaaef('0x33')][_0xaaef('0x55')]});})[_0xaaef('0x12')](function(_0x30e5bb){_0x50d1d0[_0xaaef('0x1a')]=_0x30e5bb;if(_0x50d1d0[_0xaaef('0x52')][_0xaaef('0x56')]){return db[_0xaaef('0x57')][_0xaaef('0x47')]({'attributes':['id',_0xaaef('0x58')],'where':{'id':_0x50d1d0[_0xaaef('0x52')][_0xaaef('0x56')]}})['then'](function(_0x50a560){if(_0x50a560){_0x50d1d0['applications'][_0xaaef('0x59')]({'id':0x0,'priority':0x0,'app':_0xaaef('0x5a'),'appdata':_0x50a560[_0xaaef('0x58')]+','+(_0x50d1d0['account'][_0xaaef('0x5b')]||0xa),'interval':_0xaaef('0x50')});}return respondWithRpcPromise(_0xaaef('0x5c'),'startRouting',_0x50d1d0);});}return respondWithRpcPromise(_0xaaef('0x5c'),'startRouting',_0x50d1d0);})[_0xaaef('0x12')](function(_0x2b580c){_0x4ad0ff(_0x2b580c);})[_0xaaef('0x1c')](function(_0x4e4c99){_0x129187(_0x208966[_0xaaef('0x17')](0x1f4,_0x4e4c99[_0xaaef('0x1a')]));});});}; \ No newline at end of file +var _0x3a60=['push','close','created','interaction','FaxMessage','ContactId','UserId','User','name','unshift','agent','*,*,*,*','Start','startRouting','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetFaxAccount','FaxAccount','options','where','attributes','limit','include','model','map','debug','stringify','NotifyFaxAccount','body','fax','CmContact','describe','ValidationError','keys','createdAt','difference','updatedAt','CompanyId','ListId','isNil','from','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','account','CmList','List','DESC','FaxApplication','Applications','applications','orderBy','priority','asc','Contacts','length','create','FaxInteraction','spread','get'];(function(_0x1d3791,_0x51c613){var _0x40fbf5=function(_0xe5d147){while(--_0xe5d147){_0x1d3791['push'](_0x1d3791['shift']());}};_0x40fbf5(++_0x51c613);}(_0x3a60,0x16a));var _0x03a6=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3a60[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x03a6('0x0'));var util=require(_0x03a6('0x1'));var moment=require('moment');var BPromise=require(_0x03a6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x03a6('0x3'));var db=require(_0x03a6('0x4'))['db'];var utils=require(_0x03a6('0x5'));var logger=require(_0x03a6('0x6'))(_0x03a6('0x7'));var config=require('../../config/environment');var jayson=require(_0x03a6('0x8'));var client=jayson[_0x03a6('0x9')][_0x03a6('0xa')]({'port':0x232c});config[_0x03a6('0xb')]=_[_0x03a6('0xc')](config[_0x03a6('0xb')],{'host':_0x03a6('0xd'),'port':0x18eb});var socket=require(_0x03a6('0xe'))(new Redis(config[_0x03a6('0xb')]));require('./faxAccount.socket')[_0x03a6('0xf')](socket);function respondWithRpcPromise(_0x30c9aa,_0x365f48,_0x5d1652){return new BPromise(function(_0x4cb111,_0x4d0df0){return client[_0x03a6('0x10')](_0x30c9aa,_0x5d1652)[_0x03a6('0x11')](function(_0x17dc0b){logger[_0x03a6('0x12')](_0x03a6('0x13'),_0x365f48,_0x03a6('0x14'));logger['debug'](_0x03a6('0x15'),_0x365f48,_0x03a6('0x14'),JSON['stringify'](_0x17dc0b));if(_0x17dc0b[_0x03a6('0x16')]){if(_0x17dc0b[_0x03a6('0x16')][_0x03a6('0x17')]===0x1f4){logger['error']('FaxAccount,\x20%s,\x20%s',_0x365f48,_0x17dc0b['error'][_0x03a6('0x18')]);return _0x4d0df0(_0x17dc0b[_0x03a6('0x16')][_0x03a6('0x18')]);}logger['error'](_0x03a6('0x13'),_0x365f48,_0x17dc0b[_0x03a6('0x16')][_0x03a6('0x18')]);return _0x4cb111(_0x17dc0b['error'][_0x03a6('0x18')]);}else{logger['info'](_0x03a6('0x13'),_0x365f48,'request\x20sent');_0x4cb111(_0x17dc0b['result'][_0x03a6('0x18')]);}})[_0x03a6('0x19')](function(_0x424bba){logger[_0x03a6('0x16')]('FaxAccount,\x20%s,\x20%s',_0x365f48,_0x424bba);_0x4d0df0(_0x424bba);});});}exports[_0x03a6('0x1a')]=function(_0x3a2470){var _0x44b404=this;return new Promise(function(_0x1683bf,_0x1261b8){return db[_0x03a6('0x1b')]['findAll']({'raw':_0x3a2470[_0x03a6('0x1c')]?_0x3a2470['options']['raw']===undefined?!![]:![]:!![],'where':_0x3a2470[_0x03a6('0x1c')]?_0x3a2470[_0x03a6('0x1c')][_0x03a6('0x1d')]||null:null,'attributes':_0x3a2470[_0x03a6('0x1c')]?_0x3a2470[_0x03a6('0x1c')][_0x03a6('0x1e')]||null:null,'limit':_0x3a2470[_0x03a6('0x1c')]?_0x3a2470[_0x03a6('0x1c')][_0x03a6('0x1f')]||null:null,'include':_0x3a2470['options']?_0x3a2470[_0x03a6('0x1c')][_0x03a6('0x20')]?_['map'](_0x3a2470[_0x03a6('0x1c')]['include'],function(_0x2b8dc8){return{'model':db[_0x2b8dc8[_0x03a6('0x21')]],'as':_0x2b8dc8['as'],'attributes':_0x2b8dc8[_0x03a6('0x1e')],'include':_0x2b8dc8[_0x03a6('0x20')]?_[_0x03a6('0x22')](_0x2b8dc8[_0x03a6('0x20')],function(_0x17f863){return{'model':db[_0x17f863['model']],'as':_0x17f863['as'],'attributes':_0x17f863[_0x03a6('0x1e')],'include':_0x17f863[_0x03a6('0x20')]?_[_0x03a6('0x22')](_0x17f863['include'],function(_0x37157d){return{'model':db[_0x37157d[_0x03a6('0x21')]],'as':_0x37157d['as'],'attributes':_0x37157d[_0x03a6('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x03a6('0x11')](function(_0xef4e47){logger[_0x03a6('0x12')](_0x03a6('0x1a'),_0x3a2470);logger[_0x03a6('0x23')]('GetFaxAccount',_0x3a2470,JSON[_0x03a6('0x24')](_0xef4e47));_0x1683bf(_0xef4e47);})[_0x03a6('0x19')](function(_0x4aef6f){logger[_0x03a6('0x16')]('GetFaxAccount',_0x4aef6f['message'],_0x3a2470);_0x1261b8(_0x44b404[_0x03a6('0x16')](0x1f4,_0x4aef6f[_0x03a6('0x18')]));});});};exports[_0x03a6('0x25')]=function(_0x39715a,_0x3ee54c,_0x60c754){var _0x26b1da=this;return new Promise(function(_0x447c67,_0x45eeb7){var _0x511144={'body':_0x39715a[_0x03a6('0x26')],'channel':_0x03a6('0x27')};var _0x4c24fc=[];var _0x5e4965=[];var _0x2139bb={};return db[_0x03a6('0x28')][_0x03a6('0x29')]()[_0x03a6('0x11')](function(_0x539811){if(!_0x539811){throw new db['Sequelize'][(_0x03a6('0x2a'))]('no\x20available\x20attributes');}_0x4c24fc=_['difference'](_[_0x03a6('0x2b')](_0x539811),[_0x03a6('0x2c'),'updatedAt']);_0x5e4965=_[_0x03a6('0x2d')](_[_0x03a6('0x2b')](_0x539811),[_0x03a6('0x2c'),_0x03a6('0x2e'),_0x03a6('0x2f'),_0x03a6('0x30')]);if(_0x39715a[_0x03a6('0x26')]['id']){delete _0x39715a['body']['id'];}if(_[_0x03a6('0x31')](_0x39715a['body'][_0x03a6('0x32')])){throw new db[(_0x03a6('0x33'))][(_0x03a6('0x2a'))](_0x03a6('0x34'));}if(_[_0x03a6('0x31')](_0x39715a[_0x03a6('0x26')][_0x03a6('0x26')])||_0x39715a[_0x03a6('0x26')][_0x03a6('0x26')]===''){throw new db[(_0x03a6('0x33'))][(_0x03a6('0x2a'))](_0x03a6('0x35'));}if(_[_0x03a6('0x31')](_0x39715a['body'][_0x03a6('0x36')])){throw new db[(_0x03a6('0x33'))][(_0x03a6('0x2a'))](_0x03a6('0x37')+_0x5e4965);}if(!_[_0x03a6('0x38')](_0x5e4965,_0x39715a[_0x03a6('0x26')][_0x03a6('0x36')])){throw new db[(_0x03a6('0x33'))][(_0x03a6('0x2a'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5e4965);}_0x2139bb[_0x39715a[_0x03a6('0x26')][_0x03a6('0x36')]]=_0x39715a[_0x03a6('0x26')][_0x03a6('0x32')];})['then'](function(){return db[_0x03a6('0x1b')]['find']({'where':{'id':_0x39715a[_0x03a6('0x39')]['id']},'include':[{'model':db[_0x03a6('0x3a')],'as':_0x03a6('0x3b'),'include':[{'model':db[_0x03a6('0x28')],'as':'Contacts','where':_0x2139bb,'limit':0x1,'order':[[_0x03a6('0x2e'),_0x03a6('0x3c')]]}]},{'model':db[_0x03a6('0x3d')],'as':_0x03a6('0x3e')}]});})[_0x03a6('0x11')](function(_0x24c2ac){if(_0x24c2ac&&_0x24c2ac[_0x03a6('0x3b')]){var _0x2bf478=_0x24c2ac['get']({'plain':!![]});_0x511144['account']=_0x2bf478;_0x511144[_0x03a6('0x3f')]=_0x2bf478[_0x03a6('0x3e')];_0x511144['list']=_0x2bf478[_0x03a6('0x3b')];_0x511144['applications']=_[_0x03a6('0x40')](_0x511144['applications'],[_0x03a6('0x41')],[_0x03a6('0x42')]);if(_0x511144[_0x03a6('0x39')][_0x03a6('0x3e')]){delete _0x511144[_0x03a6('0x39')][_0x03a6('0x3e')];}if(_0x511144[_0x03a6('0x39')][_0x03a6('0x3b')]&&_0x511144['account']['List'][_0x03a6('0x43')][_0x03a6('0x44')]){return _0x511144['account'][_0x03a6('0x3b')][_0x03a6('0x43')][0x0];}var _0x356801=_[_0x03a6('0xc')](_0x39715a[_0x03a6('0x26')],{'firstName':_0x39715a[_0x03a6('0x26')][_0x03a6('0x32')],'ListId':_0x2bf478[_0x03a6('0x30')]});_0x356801[_0x39715a[_0x03a6('0x26')][_0x03a6('0x36')]]=_0x39715a[_0x03a6('0x26')][_0x03a6('0x32')];return db[_0x03a6('0x28')][_0x03a6('0x45')](_0x356801,{'fields':_0x4c24fc,'raw':!![]});}})[_0x03a6('0x11')](function(_0xcbf9cc){_0x511144['contact']=_0xcbf9cc;if(_0xcbf9cc){var _0xb69bc7={'ContactId':_0xcbf9cc['id'],'FaxAccountId':_0x39715a[_0x03a6('0x39')]['id'],'fax':_0xcbf9cc[_0x03a6('0x27')]};return db['FaxInteraction']['find']({'where':{'ContactId':_0xcbf9cc['id'],'closed':![],'FaxAccountId':_0x39715a[_0x03a6('0x39')]['id']}})[_0x03a6('0x11')](function(_0x8e7b2){if(_0x8e7b2){return[_0x8e7b2,![]];}return db[_0x03a6('0x46')]['create'](_0xb69bc7)[_0x03a6('0x11')](function(_0x411a12){return[_0x411a12,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x03a6('0x47')](function(_0x3db690,_0xba1065){var _0x50ed36=_0x3db690[_0x03a6('0x48')]({'plain':!![]});if(_0xba1065){if(_0x511144[_0x03a6('0x39')]['autoclose']){_0x511144[_0x03a6('0x3f')][_0x03a6('0x49')]({'id':0x0,'priority':_0x511144[_0x03a6('0x3f')]['length']+0x1,'app':_0x03a6('0x4a'),'appdata':'unmanaged','interval':'*,*,*,*'});}_0x50ed36[_0x03a6('0x4b')]=!![];}else{_0x50ed36['created']=![];}_0x511144[_0x03a6('0x4c')]=_0x50ed36;return db[_0x03a6('0x4d')][_0x03a6('0x45')]({'body':_0x39715a['body'][_0x03a6('0x26')],'FaxAccountId':_0x39715a[_0x03a6('0x39')]['id'],'FaxInteractionId':_0x3db690['id'],'direction':'in','ContactId':_0x3db690[_0x03a6('0x4e')],'AttachmentId':_0x39715a[_0x03a6('0x26')]['AttachmentId']});})[_0x03a6('0x11')](function(_0x4bbdc9){_0x511144[_0x03a6('0x18')]=_0x4bbdc9;if(_0x511144[_0x03a6('0x4c')][_0x03a6('0x4f')]){return db[_0x03a6('0x50')]['find']({'attributes':['id',_0x03a6('0x51')],'where':{'id':_0x511144[_0x03a6('0x4c')][_0x03a6('0x4f')]}})[_0x03a6('0x11')](function(_0x81e8ad){if(_0x81e8ad){_0x511144[_0x03a6('0x3f')][_0x03a6('0x52')]({'id':0x0,'priority':0x0,'app':_0x03a6('0x53'),'appdata':_0x81e8ad[_0x03a6('0x51')]+','+(_0x511144[_0x03a6('0x39')]['waitForTheAssignedAgent']||0xa),'interval':_0x03a6('0x54')});}return respondWithRpcPromise(_0x03a6('0x55'),_0x03a6('0x56'),_0x511144);});}return respondWithRpcPromise(_0x03a6('0x55'),_0x03a6('0x56'),_0x511144);})[_0x03a6('0x11')](function(_0x2bb3bd){_0x447c67(_0x2bb3bd);})[_0x03a6('0x19')](function(_0x36d049){_0x45eeb7(_0x26b1da[_0x03a6('0x16')](0x1f4,_0x36d049[_0x03a6('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 6db142a..3748ed5 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 _0x8732=['emit','removeListener','register','length','faxAccount:','./faxAccount.events','save','remove','update'];(function(_0x12a06b,_0x417b51){var _0x5d0bb8=function(_0x41d3d0){while(--_0x41d3d0){_0x12a06b['push'](_0x12a06b['shift']());}};_0x5d0bb8(++_0x417b51);}(_0x8732,0x1b5));var _0x2873=function(_0x1f62c3,_0x1ff95b){_0x1f62c3=_0x1f62c3-0x0;var _0x385c1c=_0x8732[_0x1f62c3];return _0x385c1c;};'use strict';var FaxAccountEvents=require(_0x2873('0x0'));var events=[_0x2873('0x1'),_0x2873('0x2'),_0x2873('0x3')];function createListener(_0x3cc40f,_0x4aa58e){return function(_0xb8ec7a){_0x4aa58e[_0x2873('0x4')](_0x3cc40f,_0xb8ec7a);};}function removeListener(_0x362fab,_0x259d75){return function(){FaxAccountEvents[_0x2873('0x5')](_0x362fab,_0x259d75);};}exports[_0x2873('0x6')]=function(_0x443310){for(var _0xce873=0x0,_0x269cc6=events[_0x2873('0x7')];_0xce873<_0x269cc6;_0xce873++){var _0x197602=events[_0xce873];var _0x518093=createListener(_0x2873('0x8')+_0x197602,_0x443310);FaxAccountEvents['on'](_0x197602,_0x518093);}}; \ No newline at end of file +var _0x46e5=['removeListener','./faxAccount.events','remove','update','emit'];(function(_0x15bd8c,_0x930227){var _0x24e162=function(_0x5e9451){while(--_0x5e9451){_0x15bd8c['push'](_0x15bd8c['shift']());}};_0x24e162(++_0x930227);}(_0x46e5,0x65));var _0x546e=function(_0x77b730,_0x8fd044){_0x77b730=_0x77b730-0x0;var _0x4e7ac7=_0x46e5[_0x77b730];return _0x4e7ac7;};'use strict';var FaxAccountEvents=require(_0x546e('0x0'));var events=['save',_0x546e('0x1'),_0x546e('0x2')];function createListener(_0x493ba7,_0x50e2c9){return function(_0x5106be){_0x50e2c9[_0x546e('0x3')](_0x493ba7,_0x5106be);};}function removeListener(_0x5103f6,_0x172744){return function(){FaxAccountEvents[_0x546e('0x4')](_0x5103f6,_0x172744);};}exports['register']=function(_0x1de90f){for(var _0x3071ca=0x0,_0x4aae31=events['length'];_0x3071ca<_0x4aae31;_0x3071ca++){var _0x35e5cc=events[_0x3071ca];var _0x21aef8=createListener('faxAccount:'+_0x35e5cc,_0x1de90f);FaxAccountEvents['on'](_0x35e5cc,_0x21aef8);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 80fc6e6..96f4205 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(_0xeea013,_0x3332c8){var _0x555d2e=function(_0x3b3797){while(--_0x3b3797){_0xeea013['push'](_0xeea013['shift']());}};_0x555d2e(++_0x3332c8);}(_0xa9e0,0x123));var _0x0a9e=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'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(_0x448116,_0xe6e7ef){var _0x22eb0d=function(_0x5e1c22){while(--_0x5e1c22){_0x448116['push'](_0x448116['shift']());}};_0x22eb0d(++_0xe6e7ef);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xa9e0[_0x47b58b];return _0x46bebe;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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 0d3a8f2..908f12a 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 _0x1bcd=['noop','*,*,*,*','exports','INTEGER','STRING'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x1bcd,0xa7));var _0xd1bc=function(_0x3e089f,_0x4571cb){_0x3e089f=_0x3e089f-0x0;var _0x3edef1=_0x1bcd[_0x3e089f];return _0x3edef1;};'use strict';var Sequelize=require('sequelize');module[_0xd1bc('0x0')]={'priority':{'type':Sequelize[_0xd1bc('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xd1bc('0x2')],'allowNull':![],'defaultValue':_0xd1bc('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xd1bc('0x2')]},'interval':{'type':Sequelize[_0xd1bc('0x2')],'defaultValue':_0xd1bc('0x4')}}; \ No newline at end of file +var _0x540c=['*,*,*,*','sequelize','exports','INTEGER','noop','STRING'];(function(_0x4f5fdd,_0x5bcbb7){var _0x30e008=function(_0x19e725){while(--_0x19e725){_0x4f5fdd['push'](_0x4f5fdd['shift']());}};_0x30e008(++_0x5bcbb7);}(_0x540c,0x73));var _0xc540=function(_0xa46c0,_0x74e5d3){_0xa46c0=_0xa46c0-0x0;var _0x9e6bbe=_0x540c[_0xa46c0];return _0x9e6bbe;};'use strict';var Sequelize=require(_0xc540('0x0'));module[_0xc540('0x1')]={'priority':{'type':Sequelize[_0xc540('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xc540('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xc540('0x4')]},'interval':{'type':Sequelize[_0xc540('0x4')],'defaultValue':_0xc540('0x5')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index d26a143..e45fbfa 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 _0x1106=['order','sort','where','filter','VIRTUAL','merge','FaxApplication','include','findAll','catch','show','params','includeAll','options','find','create','body','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','apply','reject','destroy','then','error','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit'];(function(_0x4ddcac,_0x26bf3c){var _0x46d87b=function(_0x49bf8c){while(--_0x49bf8c){_0x4ddcac['push'](_0x4ddcac['shift']());}};_0x46d87b(++_0x26bf3c);}(_0x1106,0x1f4));var _0x6110=function(_0x515fd0,_0x543a29){_0x515fd0=_0x515fd0-0x0;var _0x40dc53=_0x1106[_0x515fd0];return _0x40dc53;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6110('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6110('0x1'));var rp=require(_0x6110('0x2'));var moment=require(_0x6110('0x3'));var BPromise=require(_0x6110('0x4'));var Mustache=require(_0x6110('0x5'));var util=require(_0x6110('0x6'));var path=require(_0x6110('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6110('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x6110('0x9'));var crypto=require(_0x6110('0xa'));var jsforce=require(_0x6110('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6110('0xc'));var Papa=require(_0x6110('0xd'));var Redis=require(_0x6110('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x6110('0xf'));var as=require(_0x6110('0x10'));var hardwareService=require(_0x6110('0x11'));var logger=require(_0x6110('0x12'))('api');var utils=require(_0x6110('0x13'));var config=require(_0x6110('0x14'));var licenseUtil=require(_0x6110('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x50bc64,_0x5ccc1a){_0x5ccc1a=_0x5ccc1a||0xcc;return function(_0x456790){if(_0x456790){return _0x50bc64[_0x6110('0x16')](_0x5ccc1a);}return _0x50bc64[_0x6110('0x17')](_0x5ccc1a)[_0x6110('0x18')]();};}function respondWithResult(_0x3e875d,_0x421d94){_0x421d94=_0x421d94||0xc8;return function(_0x18e2cb){if(_0x18e2cb){return _0x3e875d[_0x6110('0x17')](_0x421d94)[_0x6110('0x19')](_0x18e2cb);}};}function respondWithFilteredResult(_0x2f5fc1,_0x544181){return function(_0x20f134){if(_0x20f134){var _0x38d934=typeof _0x544181['offset']===_0x6110('0x1a')&&typeof _0x544181['limit']==='undefined';var _0x1cc945=_0x20f134[_0x6110('0x1b')];var _0x1cc1de=_0x38d934?0x0:_0x544181['offset'];var _0x157900=_0x38d934?_0x20f134[_0x6110('0x1b')]:_0x544181[_0x6110('0x1c')]+_0x544181['limit'];var _0x2b13fc;if(_0x157900>=_0x1cc945){_0x157900=_0x1cc945;_0x2b13fc=0xc8;}else{_0x2b13fc=0xce;}_0x2f5fc1[_0x6110('0x17')](_0x2b13fc);return _0x2f5fc1['set']('Content-Range',_0x1cc1de+'-'+_0x157900+'/'+_0x1cc945)[_0x6110('0x19')](_0x20f134);}return null;};}function patchUpdates(_0x2e9ae5){return function(_0x2172fa){try{jsonpatch[_0x6110('0x1d')](_0x2172fa,_0x2e9ae5,!![]);}catch(_0xa2c90a){return BPromise[_0x6110('0x1e')](_0xa2c90a);}return _0x2172fa['save']();};}function saveUpdates(_0x408ca8,_0x1bca56){return function(_0x3d1ad5){if(_0x3d1ad5){return _0x3d1ad5['update'](_0x408ca8)['then'](function(_0x4b77d3){return _0x4b77d3;});}return null;};}function removeEntity(_0x1fd124,_0x2258b5){return function(_0x572853){if(_0x572853){return _0x572853[_0x6110('0x1f')]()[_0x6110('0x20')](function(){_0x1fd124[_0x6110('0x17')](0xcc)[_0x6110('0x18')]();});}};}function handleEntityNotFound(_0x570ab0,_0x2109dd){return function(_0x3ff9e5){if(!_0x3ff9e5){_0x570ab0[_0x6110('0x16')](0x194);}return _0x3ff9e5;};}function handleError(_0x361876,_0x2f2524){_0x2f2524=_0x2f2524||0x1f4;return function(_0x30f6b1){logger[_0x6110('0x21')](_0x30f6b1['stack']);if(_0x30f6b1[_0x6110('0x22')]){delete _0x30f6b1[_0x6110('0x22')];}_0x361876[_0x6110('0x17')](_0x2f2524)['send'](_0x30f6b1);};}exports[_0x6110('0x23')]=function(_0x404df1,_0x26b2ee){var _0x3e8ab3={},_0x1432f4={},_0x31d2c0={'count':0x0,'rows':[]};var _0x1e70e7=_[_0x6110('0x24')](db['FaxApplication'][_0x6110('0x25')],function(_0x1f40a4){return{'name':_0x1f40a4[_0x6110('0x26')],'type':_0x1f40a4[_0x6110('0x27')][_0x6110('0x28')]};});_0x1432f4[_0x6110('0x29')]=_['map'](_0x1e70e7,_0x6110('0x22'));_0x1432f4[_0x6110('0x2a')]=_[_0x6110('0x2b')](_0x404df1[_0x6110('0x2a')]);_0x1432f4[_0x6110('0x2c')]=_[_0x6110('0x2d')](_0x1432f4[_0x6110('0x29')],_0x1432f4[_0x6110('0x2a')]);_0x3e8ab3[_0x6110('0x2e')]=_[_0x6110('0x2d')](_0x1432f4[_0x6110('0x29')],qs['fields'](_0x404df1[_0x6110('0x2a')][_0x6110('0x2f')]));_0x3e8ab3['attributes']=_0x3e8ab3['attributes'][_0x6110('0x30')]?_0x3e8ab3[_0x6110('0x2e')]:_0x1432f4[_0x6110('0x29')];if(!_0x404df1[_0x6110('0x2a')][_0x6110('0x31')](_0x6110('0x32'))){_0x3e8ab3[_0x6110('0x33')]=qs['limit'](_0x404df1[_0x6110('0x2a')][_0x6110('0x33')]);_0x3e8ab3['offset']=qs[_0x6110('0x1c')](_0x404df1[_0x6110('0x2a')][_0x6110('0x1c')]);}_0x3e8ab3[_0x6110('0x34')]=qs[_0x6110('0x35')](_0x404df1[_0x6110('0x2a')][_0x6110('0x35')]);_0x3e8ab3[_0x6110('0x36')]=qs[_0x6110('0x2c')](_['pick'](_0x404df1[_0x6110('0x2a')],_0x1432f4['filters']),_0x1e70e7);if(_0x404df1[_0x6110('0x2a')][_0x6110('0x37')]){_0x3e8ab3['where']=_['merge'](_0x3e8ab3['where'],{'$or':_[_0x6110('0x24')](_0x1e70e7,function(_0x34daf4){if(_0x34daf4[_0x6110('0x27')]!==_0x6110('0x38')){var _0x3f8fdb={};_0x3f8fdb[_0x34daf4[_0x6110('0x22')]]={'$like':'%'+_0x404df1['query']['filter']+'%'};return _0x3f8fdb;}})});}_0x3e8ab3=_[_0x6110('0x39')]({},_0x3e8ab3,_0x404df1['options']);var _0x577b29={'where':_0x3e8ab3['where']};return db[_0x6110('0x3a')][_0x6110('0x1b')](_0x577b29)[_0x6110('0x20')](function(_0x41ec27){_0x31d2c0[_0x6110('0x1b')]=_0x41ec27;if(_0x404df1[_0x6110('0x2a')]['includeAll']){_0x3e8ab3[_0x6110('0x3b')]=[{'all':!![]}];}return db[_0x6110('0x3a')][_0x6110('0x3c')](_0x3e8ab3);})[_0x6110('0x20')](function(_0xb33c25){_0x31d2c0['rows']=_0xb33c25;return _0x31d2c0;})[_0x6110('0x20')](respondWithFilteredResult(_0x26b2ee,_0x3e8ab3))[_0x6110('0x3d')](handleError(_0x26b2ee,null));};exports[_0x6110('0x3e')]=function(_0xd6e984,_0xe75406){var _0x5a7a9d={'raw':!![],'where':{'id':_0xd6e984[_0x6110('0x3f')]['id']}},_0x2dd175={};_0x2dd175[_0x6110('0x29')]=_[_0x6110('0x2b')](db[_0x6110('0x3a')][_0x6110('0x25')]);_0x2dd175['query']=_[_0x6110('0x2b')](_0xd6e984[_0x6110('0x2a')]);_0x2dd175['filters']=_[_0x6110('0x2d')](_0x2dd175['model'],_0x2dd175[_0x6110('0x2a')]);_0x5a7a9d[_0x6110('0x2e')]=_[_0x6110('0x2d')](_0x2dd175[_0x6110('0x29')],qs[_0x6110('0x2f')](_0xd6e984[_0x6110('0x2a')][_0x6110('0x2f')]));_0x5a7a9d[_0x6110('0x2e')]=_0x5a7a9d[_0x6110('0x2e')][_0x6110('0x30')]?_0x5a7a9d[_0x6110('0x2e')]:_0x2dd175[_0x6110('0x29')];if(_0xd6e984['query'][_0x6110('0x40')]){_0x5a7a9d[_0x6110('0x3b')]=[{'all':!![]}];}_0x5a7a9d=_['merge']({},_0x5a7a9d,_0xd6e984[_0x6110('0x41')]);return db[_0x6110('0x3a')][_0x6110('0x42')](_0x5a7a9d)[_0x6110('0x20')](handleEntityNotFound(_0xe75406,null))[_0x6110('0x20')](respondWithResult(_0xe75406,null))[_0x6110('0x3d')](handleError(_0xe75406,null));};exports[_0x6110('0x43')]=function(_0x442776,_0xababe8){return db['FaxApplication'][_0x6110('0x43')](_0x442776['body'],{})[_0x6110('0x20')](respondWithResult(_0xababe8,0xc9))[_0x6110('0x3d')](handleError(_0xababe8,null));};exports['update']=function(_0x4e37a9,_0x3f2910){if(_0x4e37a9[_0x6110('0x44')]['id']){delete _0x4e37a9[_0x6110('0x44')]['id'];}return db[_0x6110('0x3a')]['find']({'where':{'id':_0x4e37a9[_0x6110('0x3f')]['id']}})[_0x6110('0x20')](handleEntityNotFound(_0x3f2910,null))[_0x6110('0x20')](saveUpdates(_0x4e37a9[_0x6110('0x44')],null))[_0x6110('0x20')](respondWithResult(_0x3f2910,null))['catch'](handleError(_0x3f2910,null));};exports[_0x6110('0x1f')]=function(_0x332c6f,_0x4e4932){return db['FaxApplication'][_0x6110('0x42')]({'where':{'id':_0x332c6f['params']['id']}})[_0x6110('0x20')](handleEntityNotFound(_0x4e4932,null))[_0x6110('0x20')](removeEntity(_0x4e4932,null))[_0x6110('0x3d')](handleError(_0x4e4932,null));}; \ No newline at end of file +var _0x8247=['key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','type','VIRTUAL','merge','includeAll','include','findAll','rows','show','params','options','find','catch','create','body','eml-format','rimraf','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../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','set','apply','save','update','then','destroy','error','stack','name','send','index','map','FaxApplication','rawAttributes','fieldName'];(function(_0x2c9ff7,_0x1640f6){var _0x9295dc=function(_0x1f9f9e){while(--_0x1f9f9e){_0x2c9ff7['push'](_0x2c9ff7['shift']());}};_0x9295dc(++_0x1640f6);}(_0x8247,0x14e));var _0x7824=function(_0x37a7c6,_0x3a84b6){_0x37a7c6=_0x37a7c6-0x0;var _0x539905=_0x8247[_0x37a7c6];return _0x539905;};'use strict';var emlformat=require(_0x7824('0x0'));var rimraf=require(_0x7824('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7824('0x2'));var BPromise=require(_0x7824('0x3'));var Mustache=require(_0x7824('0x4'));var util=require(_0x7824('0x5'));var path=require(_0x7824('0x6'));var sox=require(_0x7824('0x7'));var csv=require(_0x7824('0x8'));var ejs=require(_0x7824('0x9'));var fs=require('fs');var fs_extra=require(_0x7824('0xa'));var _=require('lodash');var squel=require(_0x7824('0xb'));var crypto=require(_0x7824('0xc'));var jsforce=require(_0x7824('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x7824('0x8'));var querystring=require(_0x7824('0xe'));var Papa=require('papaparse');var Redis=require(_0x7824('0xf'));var authService=require(_0x7824('0x10'));var qs=require(_0x7824('0x11'));var as=require(_0x7824('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7824('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x7824('0x14'));var licenseUtil=require(_0x7824('0x15'));var db=require(_0x7824('0x16'))['db'];function respondWithStatusCode(_0x65456f,_0x7cd06a){_0x7cd06a=_0x7cd06a||0xcc;return function(_0x4522c1){if(_0x4522c1){return _0x65456f[_0x7824('0x17')](_0x7cd06a);}return _0x65456f[_0x7824('0x18')](_0x7cd06a)[_0x7824('0x19')]();};}function respondWithResult(_0x3d6133,_0x83b6d1){_0x83b6d1=_0x83b6d1||0xc8;return function(_0x1970ea){if(_0x1970ea){return _0x3d6133['status'](_0x83b6d1)[_0x7824('0x1a')](_0x1970ea);}};}function respondWithFilteredResult(_0x2d61fa,_0x41899a){return function(_0x17ee27){if(_0x17ee27){var _0x4803ea=typeof _0x41899a[_0x7824('0x1b')]===_0x7824('0x1c')&&typeof _0x41899a[_0x7824('0x1d')]===_0x7824('0x1c');var _0x4d0fac=_0x17ee27[_0x7824('0x1e')];var _0x473ef5=_0x4803ea?0x0:_0x41899a[_0x7824('0x1b')];var _0x1093ff=_0x4803ea?_0x17ee27['count']:_0x41899a[_0x7824('0x1b')]+_0x41899a[_0x7824('0x1d')];var _0x4ed783;if(_0x1093ff>=_0x4d0fac){_0x1093ff=_0x4d0fac;_0x4ed783=0xc8;}else{_0x4ed783=0xce;}_0x2d61fa[_0x7824('0x18')](_0x4ed783);return _0x2d61fa[_0x7824('0x1f')]('Content-Range',_0x473ef5+'-'+_0x1093ff+'/'+_0x4d0fac)[_0x7824('0x1a')](_0x17ee27);}return null;};}function patchUpdates(_0x2e12f0){return function(_0x556362){try{jsonpatch[_0x7824('0x20')](_0x556362,_0x2e12f0,!![]);}catch(_0xe51e90){return BPromise['reject'](_0xe51e90);}return _0x556362[_0x7824('0x21')]();};}function saveUpdates(_0x3d865a,_0x2baece){return function(_0x877715){if(_0x877715){return _0x877715[_0x7824('0x22')](_0x3d865a)[_0x7824('0x23')](function(_0x3a5326){return _0x3a5326;});}return null;};}function removeEntity(_0x1b93c4,_0x1a75a8){return function(_0x217eed){if(_0x217eed){return _0x217eed[_0x7824('0x24')]()['then'](function(){_0x1b93c4[_0x7824('0x18')](0xcc)[_0x7824('0x19')]();});}};}function handleEntityNotFound(_0x12d417,_0x34f829){return function(_0x52e1ab){if(!_0x52e1ab){_0x12d417[_0x7824('0x17')](0x194);}return _0x52e1ab;};}function handleError(_0x28f5c5,_0x21aba4){_0x21aba4=_0x21aba4||0x1f4;return function(_0x4fe074){logger[_0x7824('0x25')](_0x4fe074[_0x7824('0x26')]);if(_0x4fe074[_0x7824('0x27')]){delete _0x4fe074[_0x7824('0x27')];}_0x28f5c5[_0x7824('0x18')](_0x21aba4)[_0x7824('0x28')](_0x4fe074);};}exports[_0x7824('0x29')]=function(_0x1db4ee,_0x179ef3){var _0x56005b={},_0x5f01e7={},_0x165346={'count':0x0,'rows':[]};var _0x5d542c=_[_0x7824('0x2a')](db[_0x7824('0x2b')][_0x7824('0x2c')],function(_0x22a587){return{'name':_0x22a587[_0x7824('0x2d')],'type':_0x22a587['type'][_0x7824('0x2e')]};});_0x5f01e7[_0x7824('0x2f')]=_['map'](_0x5d542c,_0x7824('0x27'));_0x5f01e7[_0x7824('0x30')]=_[_0x7824('0x31')](_0x1db4ee['query']);_0x5f01e7['filters']=_['intersection'](_0x5f01e7[_0x7824('0x2f')],_0x5f01e7[_0x7824('0x30')]);_0x56005b[_0x7824('0x32')]=_[_0x7824('0x33')](_0x5f01e7[_0x7824('0x2f')],qs['fields'](_0x1db4ee[_0x7824('0x30')][_0x7824('0x34')]));_0x56005b[_0x7824('0x32')]=_0x56005b[_0x7824('0x32')][_0x7824('0x35')]?_0x56005b[_0x7824('0x32')]:_0x5f01e7[_0x7824('0x2f')];if(!_0x1db4ee[_0x7824('0x30')][_0x7824('0x36')](_0x7824('0x37'))){_0x56005b[_0x7824('0x1d')]=qs[_0x7824('0x1d')](_0x1db4ee['query']['limit']);_0x56005b[_0x7824('0x1b')]=qs['offset'](_0x1db4ee[_0x7824('0x30')][_0x7824('0x1b')]);}_0x56005b[_0x7824('0x38')]=qs['sort'](_0x1db4ee[_0x7824('0x30')][_0x7824('0x39')]);_0x56005b['where']=qs[_0x7824('0x3a')](_[_0x7824('0x3b')](_0x1db4ee['query'],_0x5f01e7[_0x7824('0x3a')]),_0x5d542c);if(_0x1db4ee['query'][_0x7824('0x3c')]){_0x56005b['where']=_['merge'](_0x56005b[_0x7824('0x3d')],{'$or':_[_0x7824('0x2a')](_0x5d542c,function(_0xd59e7d){if(_0xd59e7d[_0x7824('0x3e')]!==_0x7824('0x3f')){var _0x16fe08={};_0x16fe08[_0xd59e7d[_0x7824('0x27')]]={'$like':'%'+_0x1db4ee[_0x7824('0x30')][_0x7824('0x3c')]+'%'};return _0x16fe08;}})});}_0x56005b=_[_0x7824('0x40')]({},_0x56005b,_0x1db4ee['options']);var _0x2102c9={'where':_0x56005b['where']};return db[_0x7824('0x2b')][_0x7824('0x1e')](_0x2102c9)[_0x7824('0x23')](function(_0xa20bcd){_0x165346[_0x7824('0x1e')]=_0xa20bcd;if(_0x1db4ee['query'][_0x7824('0x41')]){_0x56005b[_0x7824('0x42')]=[{'all':!![]}];}return db[_0x7824('0x2b')][_0x7824('0x43')](_0x56005b);})[_0x7824('0x23')](function(_0x3de99e){_0x165346[_0x7824('0x44')]=_0x3de99e;return _0x165346;})[_0x7824('0x23')](respondWithFilteredResult(_0x179ef3,_0x56005b))['catch'](handleError(_0x179ef3,null));};exports[_0x7824('0x45')]=function(_0x5192b3,_0x7df3fc){var _0x53d8f4={'raw':!![],'where':{'id':_0x5192b3[_0x7824('0x46')]['id']}},_0xe75d9a={};_0xe75d9a[_0x7824('0x2f')]=_[_0x7824('0x31')](db[_0x7824('0x2b')][_0x7824('0x2c')]);_0xe75d9a[_0x7824('0x30')]=_[_0x7824('0x31')](_0x5192b3[_0x7824('0x30')]);_0xe75d9a['filters']=_[_0x7824('0x33')](_0xe75d9a['model'],_0xe75d9a[_0x7824('0x30')]);_0x53d8f4[_0x7824('0x32')]=_[_0x7824('0x33')](_0xe75d9a[_0x7824('0x2f')],qs[_0x7824('0x34')](_0x5192b3[_0x7824('0x30')][_0x7824('0x34')]));_0x53d8f4[_0x7824('0x32')]=_0x53d8f4['attributes'][_0x7824('0x35')]?_0x53d8f4[_0x7824('0x32')]:_0xe75d9a[_0x7824('0x2f')];if(_0x5192b3[_0x7824('0x30')][_0x7824('0x41')]){_0x53d8f4[_0x7824('0x42')]=[{'all':!![]}];}_0x53d8f4=_['merge']({},_0x53d8f4,_0x5192b3[_0x7824('0x47')]);return db[_0x7824('0x2b')][_0x7824('0x48')](_0x53d8f4)[_0x7824('0x23')](handleEntityNotFound(_0x7df3fc,null))[_0x7824('0x23')](respondWithResult(_0x7df3fc,null))[_0x7824('0x49')](handleError(_0x7df3fc,null));};exports[_0x7824('0x4a')]=function(_0x5f1301,_0x5ab878){return db[_0x7824('0x2b')]['create'](_0x5f1301['body'],{})[_0x7824('0x23')](respondWithResult(_0x5ab878,0xc9))['catch'](handleError(_0x5ab878,null));};exports['update']=function(_0x34ec49,_0x4c6bcb){if(_0x34ec49[_0x7824('0x4b')]['id']){delete _0x34ec49[_0x7824('0x4b')]['id'];}return db[_0x7824('0x2b')][_0x7824('0x48')]({'where':{'id':_0x34ec49['params']['id']}})[_0x7824('0x23')](handleEntityNotFound(_0x4c6bcb,null))[_0x7824('0x23')](saveUpdates(_0x34ec49[_0x7824('0x4b')],null))['then'](respondWithResult(_0x4c6bcb,null))[_0x7824('0x49')](handleError(_0x4c6bcb,null));};exports[_0x7824('0x24')]=function(_0x1ca218,_0x20e617){return db[_0x7824('0x2b')][_0x7824('0x48')]({'where':{'id':_0x1ca218[_0x7824('0x46')]['id']}})['then'](handleEntityNotFound(_0x20e617,null))[_0x7824('0x23')](removeEntity(_0x20e617,null))[_0x7824('0x49')](handleError(_0x20e617,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 35aa18a..8a78115 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 _0xb03a=['lodash','util','moment','request-promise','rimraf','../../config/environment','./faxApplication.attributes','define','FaxApplication','fax_applications','utf8mb4'];(function(_0x725a4c,_0x102507){var _0x37b2cc=function(_0x505fc9){while(--_0x505fc9){_0x725a4c['push'](_0x725a4c['shift']());}};_0x37b2cc(++_0x102507);}(_0xb03a,0x9a));var _0xab03=function(_0x1ad548,_0x55e605){_0x1ad548=_0x1ad548-0x0;var _0x2511f6=_0xb03a[_0x1ad548];return _0x2511f6;};'use strict';var _=require(_0xab03('0x0'));var util=require(_0xab03('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xab03('0x2'));var BPromise=require('bluebird');var rp=require(_0xab03('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xab03('0x4'));var config=require(_0xab03('0x5'));var attributes=require(_0xab03('0x6'));module['exports']=function(_0x1ceebf,_0x1341e4){return _0x1ceebf[_0xab03('0x7')](_0xab03('0x8'),attributes,{'tableName':_0xab03('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xab03('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xfb2a=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','utf8mb4_unicode_ci','lodash'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xfb2a,0x154));var _0xafb2=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xfb2a[_0x138adb];return _0x1b27f2;};'use strict';var _=require(_0xafb2('0x0'));var util=require(_0xafb2('0x1'));var logger=require(_0xafb2('0x2'))(_0xafb2('0x3'));var moment=require('moment');var BPromise=require(_0xafb2('0x4'));var rp=require(_0xafb2('0x5'));var fs=require('fs');var path=require(_0xafb2('0x6'));var rimraf=require(_0xafb2('0x7'));var config=require(_0xafb2('0x8'));var attributes=require('./faxApplication.attributes');module[_0xafb2('0x9')]=function(_0x3700fc,_0x2c961c){return _0x3700fc['define']('FaxApplication',attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xafb2('0xa')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 3990a18..51a1a76 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 _0x276b=['client','http','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','options','raw','attributes','limit','then','info','UpdateFaxApplication','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x4e0788,_0x21e3f6){var _0x2f4903=function(_0x222070){while(--_0x222070){_0x4e0788['push'](_0x4e0788['shift']());}};_0x2f4903(++_0x21e3f6);}(_0x276b,0xd6));var _0xb276=function(_0x5a5980,_0x6b44c4){_0x5a5980=_0x5a5980-0x0;var _0x12c3a3=_0x276b[_0x5a5980];return _0x12c3a3;};'use strict';var _=require(_0xb276('0x0'));var util=require(_0xb276('0x1'));var moment=require(_0xb276('0x2'));var BPromise=require(_0xb276('0x3'));var rs=require(_0xb276('0x4'));var fs=require('fs');var Redis=require(_0xb276('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb276('0x6'));var logger=require(_0xb276('0x7'))(_0xb276('0x8'));var config=require('../../config/environment');var jayson=require(_0xb276('0x9'));var client=jayson[_0xb276('0xa')][_0xb276('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x545204,_0x1c8414,_0x39c19){return new BPromise(function(_0x4f1556,_0x113af8){return client['request'](_0x545204,_0x39c19)['then'](function(_0x2f44fe){logger['info'](_0xb276('0xc'),_0x1c8414,_0xb276('0xd'));logger[_0xb276('0xe')](_0xb276('0xf'),_0x1c8414,_0xb276('0xd'),JSON[_0xb276('0x10')](_0x2f44fe));if(_0x2f44fe[_0xb276('0x11')]){if(_0x2f44fe['error']['code']===0x1f4){logger[_0xb276('0x11')](_0xb276('0xc'),_0x1c8414,_0x2f44fe[_0xb276('0x11')]['message']);return _0x113af8(_0x2f44fe[_0xb276('0x11')][_0xb276('0x12')]);}logger['error'](_0xb276('0xc'),_0x1c8414,_0x2f44fe[_0xb276('0x11')][_0xb276('0x12')]);return _0x4f1556(_0x2f44fe[_0xb276('0x11')][_0xb276('0x12')]);}else{logger['info'](_0xb276('0xc'),_0x1c8414,_0xb276('0xd'));_0x4f1556(_0x2f44fe[_0xb276('0x13')][_0xb276('0x12')]);}})[_0xb276('0x14')](function(_0x16dadf){logger[_0xb276('0x11')](_0xb276('0xc'),_0x1c8414,_0x16dadf);_0x113af8(_0x16dadf);});});}exports['UpdateFaxApplication']=function(_0x283528){var _0xc43851=this;return new Promise(function(_0x255b42,_0x3d9cbd){return db['FaxApplication']['update'](_0x283528['body'],{'raw':_0x283528['options']?_0x283528[_0xb276('0x15')][_0xb276('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x283528['options']?_0x283528[_0xb276('0x15')]['where']||null:null,'attributes':_0x283528[_0xb276('0x15')]?_0x283528['options'][_0xb276('0x17')]||null:null,'limit':_0x283528[_0xb276('0x15')]?_0x283528[_0xb276('0x15')][_0xb276('0x18')]||null:null})[_0xb276('0x19')](function(_0x4fa607){logger[_0xb276('0x1a')](_0xb276('0x1b'),_0x283528);logger[_0xb276('0xe')](_0xb276('0x1b'),_0x283528,JSON[_0xb276('0x10')](_0x4fa607));_0x255b42(_0x4fa607);})[_0xb276('0x14')](function(_0x186923){logger[_0xb276('0x11')](_0xb276('0x1b'),_0x186923[_0xb276('0x12')],_0x283528);_0x3d9cbd(_0xc43851[_0xb276('0x11')](0x1f4,_0x186923[_0xb276('0x12')]));});});}; \ No newline at end of file +var _0x0565=['where','limit','then','UpdateFaxApplication','debug','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','FaxApplication,\x20%s,\x20%s','request\x20sent','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','FaxApplication','update','body','options','raw'];(function(_0x302b5e,_0x564a8e){var _0x523ab7=function(_0x6aec8f){while(--_0x6aec8f){_0x302b5e['push'](_0x302b5e['shift']());}};_0x523ab7(++_0x564a8e);}(_0x0565,0x1e6));var _0x5056=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0x0565[_0x45d3f0];return _0x314b79;};'use strict';var _=require('lodash');var util=require(_0x5056('0x0'));var moment=require(_0x5056('0x1'));var BPromise=require(_0x5056('0x2'));var rs=require(_0x5056('0x3'));var fs=require('fs');var Redis=require(_0x5056('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5056('0x5'));var logger=require(_0x5056('0x6'))(_0x5056('0x7'));var config=require(_0x5056('0x8'));var jayson=require(_0x5056('0x9'));var client=jayson[_0x5056('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x9e8541,_0x409329,_0x2031ee){return new BPromise(function(_0x42668d,_0x30c735){return client[_0x5056('0xb')](_0x9e8541,_0x2031ee)['then'](function(_0x5003f3){logger['info'](_0x5056('0xc'),_0x409329,_0x5056('0xd'));logger['debug'](_0x5056('0xe'),_0x409329,_0x5056('0xd'),JSON[_0x5056('0xf')](_0x5003f3));if(_0x5003f3[_0x5056('0x10')]){if(_0x5003f3[_0x5056('0x10')][_0x5056('0x11')]===0x1f4){logger[_0x5056('0x10')](_0x5056('0xc'),_0x409329,_0x5003f3['error'][_0x5056('0x12')]);return _0x30c735(_0x5003f3[_0x5056('0x10')]['message']);}logger[_0x5056('0x10')](_0x5056('0xc'),_0x409329,_0x5003f3['error'][_0x5056('0x12')]);return _0x42668d(_0x5003f3[_0x5056('0x10')][_0x5056('0x12')]);}else{logger[_0x5056('0x13')](_0x5056('0xc'),_0x409329,'request\x20sent');_0x42668d(_0x5003f3[_0x5056('0x14')][_0x5056('0x12')]);}})['catch'](function(_0x2ecb25){logger[_0x5056('0x10')](_0x5056('0xc'),_0x409329,_0x2ecb25);_0x30c735(_0x2ecb25);});});}exports['UpdateFaxApplication']=function(_0xb2e6e7){var _0x250310=this;return new Promise(function(_0x413219,_0x8662b4){return db[_0x5056('0x15')][_0x5056('0x16')](_0xb2e6e7[_0x5056('0x17')],{'raw':_0xb2e6e7[_0x5056('0x18')]?_0xb2e6e7[_0x5056('0x18')][_0x5056('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb2e6e7[_0x5056('0x18')]?_0xb2e6e7[_0x5056('0x18')][_0x5056('0x1a')]||null:null,'attributes':_0xb2e6e7[_0x5056('0x18')]?_0xb2e6e7['options']['attributes']||null:null,'limit':_0xb2e6e7[_0x5056('0x18')]?_0xb2e6e7[_0x5056('0x18')][_0x5056('0x1b')]||null:null})[_0x5056('0x1c')](function(_0x36fac2){logger[_0x5056('0x13')](_0x5056('0x1d'),_0xb2e6e7);logger[_0x5056('0x1e')]('UpdateFaxApplication',_0xb2e6e7,JSON[_0x5056('0xf')](_0x36fac2));_0x413219(_0x36fac2);})[_0x5056('0x1f')](function(_0x348229){logger[_0x5056('0x10')]('UpdateFaxApplication',_0x348229[_0x5056('0x12')],_0xb2e6e7);_0x8662b4(_0x250310[_0x5056('0x10')](0x1f4,_0x348229[_0x5056('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index abfd803..ca3c5a5 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 _0x6e6c=['delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','post','create','update'];(function(_0x30cd7e,_0x4db10a){var _0x462a02=function(_0x157d81){while(--_0x157d81){_0x30cd7e['push'](_0x30cd7e['shift']());}};_0x462a02(++_0x4db10a);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x6e6c[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0xc6e6('0x0'));var util=require(_0xc6e6('0x1'));var path=require('path');var timeout=require(_0xc6e6('0x2'));var express=require(_0xc6e6('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc6e6('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xc6e6('0x5'));var controller=require('./faxApplication.controller');router[_0xc6e6('0x6')]('/',auth[_0xc6e6('0x7')](),controller['index']);router[_0xc6e6('0x6')](_0xc6e6('0x8'),auth['isAuthenticated'](),controller[_0xc6e6('0x9')]);router[_0xc6e6('0xa')]('/',auth['isAuthenticated'](),controller[_0xc6e6('0xb')]);router['put'](_0xc6e6('0x8'),auth[_0xc6e6('0x7')](),controller[_0xc6e6('0xc')]);router[_0xc6e6('0xd')](_0xc6e6('0x8'),auth[_0xc6e6('0x7')](),controller[_0xc6e6('0xe')]);module[_0xc6e6('0xf')]=router; \ No newline at end of file +var _0x5c00=['delete','destroy','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','create','put','/:id','update'];(function(_0x3c9e1f,_0x1035d7){var _0x1c5236=function(_0x17fcf8){while(--_0x17fcf8){_0x3c9e1f['push'](_0x3c9e1f['shift']());}};_0x1c5236(++_0x1035d7);}(_0x5c00,0x17e));var _0x05c0=function(_0xf67f45,_0x36e087){_0xf67f45=_0xf67f45-0x0;var _0xd9ab5=_0x5c00[_0xf67f45];return _0xd9ab5;};'use strict';var multer=require(_0x05c0('0x0'));var util=require(_0x05c0('0x1'));var path=require(_0x05c0('0x2'));var timeout=require('connect-timeout');var express=require(_0x05c0('0x3'));var router=express['Router']();var fs_extra=require(_0x05c0('0x4'));var auth=require(_0x05c0('0x5'));var interaction=require(_0x05c0('0x6'));var config=require(_0x05c0('0x7'));var controller=require('./faxApplication.controller');router[_0x05c0('0x8')]('/',auth[_0x05c0('0x9')](),controller[_0x05c0('0xa')]);router[_0x05c0('0x8')]('/:id',auth[_0x05c0('0x9')](),controller[_0x05c0('0xb')]);router[_0x05c0('0xc')]('/',auth['isAuthenticated'](),controller[_0x05c0('0xd')]);router[_0x05c0('0xe')](_0x05c0('0xf'),auth[_0x05c0('0x9')](),controller[_0x05c0('0x10')]);router[_0x05c0('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x05c0('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 163e8d1..ace5b04 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 _0x9708=['out','ENUM','sequelize','exports','DATE','STRING'];(function(_0xa51824,_0x4bbe6e){var _0x346f05=function(_0x505541){while(--_0x505541){_0xa51824['push'](_0xa51824['shift']());}};_0x346f05(++_0x4bbe6e);}(_0x9708,0xe6));var _0x8970=function(_0x318840,_0x561b1e){_0x318840=_0x318840-0x0;var _0x223da4=_0x9708[_0x318840];return _0x223da4;};'use strict';var Sequelize=require(_0x8970('0x0'));module[_0x8970('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x8970('0x2')]},'disposition':{'type':Sequelize[_0x8970('0x3')]},'secondDisposition':{'type':Sequelize[_0x8970('0x3')]},'thirdDisposition':{'type':Sequelize[_0x8970('0x3')]},'note':{'type':Sequelize[_0x8970('0x3')]},'read1stAt':{'type':Sequelize[_0x8970('0x2')]},'fax':{'type':Sequelize[_0x8970('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x8970('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x8970('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x8970('0x5')]('in','out'),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x703c=['sequelize','BOOLEAN','DATE','STRING','ENUM','out'];(function(_0x253804,_0x4101e2){var _0x26cb31=function(_0xfdc5b0){while(--_0xfdc5b0){_0x253804['push'](_0x253804['shift']());}};_0x26cb31(++_0x4101e2);}(_0x703c,0x19e));var _0xc703=function(_0xd0e201,_0x30d2a9){_0xd0e201=_0xd0e201-0x0;var _0x6e9022=_0x703c[_0xd0e201];return _0x6e9022;};'use strict';var Sequelize=require(_0xc703('0x0'));module['exports']={'closed':{'type':Sequelize[_0xc703('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xc703('0x2')]},'disposition':{'type':Sequelize[_0xc703('0x3')]},'secondDisposition':{'type':Sequelize[_0xc703('0x3')]},'thirdDisposition':{'type':Sequelize[_0xc703('0x3')]},'note':{'type':Sequelize[_0xc703('0x3')]},'read1stAt':{'type':Sequelize[_0xc703('0x2')]},'fax':{'type':Sequelize[_0xc703('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xc703('0x4')]('in',_0xc703('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xc703('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xc703('0x4')]('in',_0xc703('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 0efcfbf..58a27a7 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 _0x4376=['fullname','TagIds','Tags','split','forEach','push','catch','index','FaxInteraction','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','field','color','tools_tags','select','u.fullname','ui.FaxInteractionId','from','u.id\x20=\x20ui.UserId','fax_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','a.id\x20=\x20i.FaxAccountId','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','conditions','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)','find','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','some','compact','isEmpty','where','i.FaxAccountId\x20IN\x20?','createdAt','parse','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','replace','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','group','i.id','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','FaxAccountId','i.FaxAccountId\x20IS\x20NOT\x20NULL','role','agent','user','getFaxAccounts','toString','sequelize','merge','a.key','a.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','FaxInteractionId','all','rows','show','params','includeAll','options','describe','addMessage','ids','omit','getMessages','findOne','nolimit','filter','$gte','format','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','include','findAll','addTags','spread','emit','faxInteractionTags:save','removeTags','unix','join','root','server','files','tmp','attachments','Attachment','Messages','get','pipe','createWriteStream','basename','resolve','log','err','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','./faxInteraction.socket','register','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','save','destroy','then','error','stack','name','send','Users','map'];(function(_0x4dc7e3,_0x420204){var _0x122f29=function(_0x4d47c0){while(--_0x4d47c0){_0x4dc7e3['push'](_0x4dc7e3['shift']());}};_0x122f29(++_0x420204);}(_0x4376,0x176));var _0x6437=function(_0xdb44b1,_0x38fae0){_0xdb44b1=_0xdb44b1-0x0;var _0x351bd0=_0x4376[_0xdb44b1];return _0x351bd0;};'use strict';var emlformat=require(_0x6437('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6437('0x1'));var jsonpatch=require(_0x6437('0x2'));var rp=require(_0x6437('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x6437('0x4'));var sox=require('sox');var csv=require(_0x6437('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6437('0x6'));var _=require('lodash');var squel=require(_0x6437('0x7'));var crypto=require(_0x6437('0x8'));var jsforce=require(_0x6437('0x9'));var deskjs=require(_0x6437('0xa'));var toCsv=require(_0x6437('0x5'));var querystring=require('querystring');var Papa=require(_0x6437('0xb'));var Redis=require(_0x6437('0xc'));var authService=require(_0x6437('0xd'));var qs=require(_0x6437('0xe'));var as=require(_0x6437('0xf'));var hardwareService=require(_0x6437('0x10'));var logger=require(_0x6437('0x11'))(_0x6437('0x12'));var utils=require(_0x6437('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x6437('0x14'));var db=require(_0x6437('0x15'))['db'];config[_0x6437('0x16')]=_['defaults'](config['redis'],{'host':_0x6437('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x6437('0x18'))[_0x6437('0x19')](socket);function respondWithStatusCode(_0x13176a,_0x47fd78){_0x47fd78=_0x47fd78||0xcc;return function(_0x360cfe){if(_0x360cfe){return _0x13176a[_0x6437('0x1a')](_0x47fd78);}return _0x13176a[_0x6437('0x1b')](_0x47fd78)[_0x6437('0x1c')]();};}function respondWithResult(_0x57b8ba,_0x569f03){_0x569f03=_0x569f03||0xc8;return function(_0x3e31ca){if(_0x3e31ca){return _0x57b8ba[_0x6437('0x1b')](_0x569f03)[_0x6437('0x1d')](_0x3e31ca);}};}function respondWithFilteredResult(_0x59509e,_0x177742){return function(_0x1ebffc){if(_0x1ebffc){var _0x495af7=typeof _0x177742['offset']==='undefined'&&typeof _0x177742[_0x6437('0x1e')]===_0x6437('0x1f');var _0x45b031=_0x1ebffc[_0x6437('0x20')];var _0x45cf5e=_0x495af7?0x0:_0x177742[_0x6437('0x21')];var _0x6c3f59=_0x495af7?_0x1ebffc[_0x6437('0x20')]:_0x177742[_0x6437('0x21')]+_0x177742[_0x6437('0x1e')];var _0x5b22fa;if(_0x6c3f59>=_0x45b031){_0x6c3f59=_0x45b031;_0x5b22fa=0xc8;}else{_0x5b22fa=0xce;}_0x59509e[_0x6437('0x1b')](_0x5b22fa);return _0x59509e[_0x6437('0x22')](_0x6437('0x23'),_0x45cf5e+'-'+_0x6c3f59+'/'+_0x45b031)[_0x6437('0x1d')](_0x1ebffc);}return null;};}function patchUpdates(_0x29f6b4){return function(_0x4862ad){try{jsonpatch[_0x6437('0x24')](_0x4862ad,_0x29f6b4,!![]);}catch(_0x39a7ad){return BPromise['reject'](_0x39a7ad);}return _0x4862ad[_0x6437('0x25')]();};}function saveUpdates(_0x4dc39c,_0x119be3){return function(_0x176c6c){if(_0x176c6c){return _0x176c6c['update'](_0x4dc39c)['then'](function(_0xc0cfe8){return _0xc0cfe8;});}return null;};}function removeEntity(_0x36003c,_0x582efe){return function(_0x4b6cc6){if(_0x4b6cc6){return _0x4b6cc6[_0x6437('0x26')]()[_0x6437('0x27')](function(){_0x36003c[_0x6437('0x1b')](0xcc)[_0x6437('0x1c')]();});}};}function handleEntityNotFound(_0x54967b,_0x16b0bb){return function(_0x514f2a){if(!_0x514f2a){_0x54967b[_0x6437('0x1a')](0x194);}return _0x514f2a;};}function handleError(_0xd496f2,_0x392074){_0x392074=_0x392074||0x1f4;return function(_0x26d099){logger[_0x6437('0x28')](_0x26d099[_0x6437('0x29')]);if(_0x26d099[_0x6437('0x2a')]){delete _0x26d099[_0x6437('0x2a')];}_0xd496f2[_0x6437('0x1b')](_0x392074)[_0x6437('0x2b')](_0x26d099);};}function getInteractionUsers(_0xde3da5,_0x34f119){return new BPromise(function(_0x3e49dc,_0x2bc863){try{if(_0x34f119[_0xde3da5['id']]){_0xde3da5[_0x6437('0x2c')]=_[_0x6437('0x2d')](_0x34f119[_0xde3da5['id']],function(_0x39c61a){return{'id':_0x39c61a['id'],'fullname':_0x39c61a[_0x6437('0x2e')]};});}}catch(_0x404004){_0x2bc863(_0x404004);}_0x3e49dc(_0xde3da5);});}function getInteractionTags(_0x456b3a,_0x30012b){return new BPromise(function(_0x3ce308,_0x1f9a57){try{if(_0x456b3a[_0x6437('0x2f')]){_0x456b3a[_0x6437('0x30')]=[];_0x456b3a[_0x6437('0x2f')][_0x6437('0x31')](',')[_0x6437('0x32')](function(_0x3d33d9){_0x456b3a[_0x6437('0x30')][_0x6437('0x33')](_0x30012b[_0x3d33d9]);});}delete _0x456b3a[_0x6437('0x2f')];}catch(_0x5174f4){_0x1f9a57(_0x5174f4);}_0x3ce308(_0x456b3a);});}function updateFaxInteraction(_0x414cd5,_0x24013b,_0x4ff0b6){return new BPromise(function(_0x55a68c,_0x3eba68){return getInteractionUsers(_0x414cd5,_0x4ff0b6)[_0x6437('0x27')](function(_0x301709){return getInteractionTags(_0x301709,_0x24013b);})[_0x6437('0x27')](function(_0x3e433a){_0x55a68c(_0x3e433a);})[_0x6437('0x34')](function(_0x2feaf4){_0x3eba68(_0x2feaf4);});});}exports[_0x6437('0x35')]=function(_0xf54461,_0x460397){var _0x451811={},_0x575ed9={},_0x47b82b={'count':0x0,'rows':[]};var _0x11caf3=_[_0x6437('0x2d')](db[_0x6437('0x36')][_0x6437('0x37')],function(_0x3a3c88){return{'name':_0x3a3c88['fieldName'],'type':_0x3a3c88[_0x6437('0x38')][_0x6437('0x39')]};});_0x575ed9[_0x6437('0x3a')]=_[_0x6437('0x2d')](_0x11caf3,_0x6437('0x2a'));_0x575ed9['query']=_[_0x6437('0x3b')](_0xf54461[_0x6437('0x3c')]);_0x575ed9[_0x6437('0x3d')]=_[_0x6437('0x3e')](_0x575ed9[_0x6437('0x3a')],_0x575ed9[_0x6437('0x3c')]);_0x451811[_0x6437('0x3f')]=_['intersection'](_0x575ed9['model'],qs[_0x6437('0x40')](_0xf54461[_0x6437('0x3c')][_0x6437('0x40')]));_0x451811[_0x6437('0x3f')]=_0x451811[_0x6437('0x3f')][_0x6437('0x41')]?_0x451811['attributes']:_0x575ed9[_0x6437('0x3a')];if(!_0xf54461[_0x6437('0x3c')][_0x6437('0x42')]('nolimit')){_0x451811[_0x6437('0x1e')]=qs[_0x6437('0x1e')](_0xf54461[_0x6437('0x3c')][_0x6437('0x1e')]);_0x451811['offset']=qs[_0x6437('0x21')](_0xf54461[_0x6437('0x3c')][_0x6437('0x21')]);}_0x451811[_0x6437('0x43')]=qs[_0x6437('0x44')](_0xf54461['query'][_0x6437('0x44')]);_0x451811['where']=qs[_0x6437('0x3d')](_['pick'](_0xf54461[_0x6437('0x3c')],_0x575ed9[_0x6437('0x3d')]),_0x11caf3);var _0x326382=[];var _0x97ad8=squel['select']()[_0x6437('0x45')]('id')['field']('name')[_0x6437('0x45')](_0x6437('0x46'))['from'](_0x6437('0x47'));var _0xa240f4=squel[_0x6437('0x48')]()[_0x6437('0x45')]('u.id')['field'](_0x6437('0x49'))[_0x6437('0x45')](_0x6437('0x4a'))[_0x6437('0x4b')]('user_has_fax_interactions','ui')['left_join']('users','u',_0x6437('0x4c'));var _0x529449=squel['select']()['from'](_0x6437('0x4d'),'i')[_0x6437('0x4e')](_0x6437('0x4f'),'c',_0x6437('0x50'))[_0x6437('0x4e')](_0x6437('0x51'),'o',_0x6437('0x52'))[_0x6437('0x4e')]('fax_accounts','a',_0x6437('0x53'))[_0x6437('0x4e')]('fax_messages','me','me.FaxInteractionId\x20=\x20i.id')['left_join'](_0x6437('0x54'),'it',_0x6437('0x55'))['left_join'](_0x6437('0x47'),'t',_0x6437('0x56'));var _0x567e50=squel[_0x6437('0x57')]();var _0x198e55=[];var _0x55e408=squel[_0x6437('0x57')]();var _0x3629a8;if(_0xf54461[_0x6437('0x3c')]['search']){_0x3629a8=as[_0x6437('0x58')](_0xf54461[_0x6437('0x3c')][_0x6437('0x59')]);var _0x1e8f08=_0x3629a8[_0x6437('0x5a')];for(var _0x519c07=0x0;_0x519c07<_0x3629a8[_0x6437('0x5b')][_0x6437('0x41')];_0x519c07++){var _0x4f6296=_0x3629a8[_0x6437('0x5b')][_0x519c07];var _0x15b78e='i';var _0x4c53c3=_['find'](_0x11caf3,[_0x6437('0x2a'),_0x4f6296['field']]);if(!_0x4c53c3){switch(_0x4f6296[_0x6437('0x45')]){case _0x6437('0x5c'):if(_0x4f6296[_0x6437('0x5d')]==0x1){_0x529449[_0x6437('0x5e')]('`'+_0x4f6296['field']+'`\x20=\x200');}else{_0x529449[_0x6437('0x5e')]('`'+_0x4f6296[_0x6437('0x45')]+_0x6437('0x5f'));}break;case _0x6437('0x60'):if(_0x4f6296[_0x6437('0x61')]===_0x6437('0x62')){if(_0x4f6296['value'][_0x6437('0x31')]('\x20')[_0x6437('0x41')]>0x1){_0x567e50[_0x1e8f08](_0x6437('0x63'),qs['getFullTextValue'](_0x4f6296[_0x6437('0x5d')]),null);}else{var _0x534a96='%'+_0x4f6296[_0x6437('0x5d')]+'%';_0x567e50[_0x1e8f08]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x534a96,_0x534a96,_0x534a96);}}else{_0x4c53c3=_[_0x6437('0x64')](_0x11caf3,['name',_0x6437('0x65')]);_0x4f6296[_0x6437('0x45')]=_0x6437('0x65');_0x42f84f=as[_0x6437('0x66')](_0x15b78e,_0x4c53c3[_0x6437('0x38')],_0x4f6296);_0x567e50[_0x1e8f08](_0x42f84f[_0x6437('0x67')],_0x42f84f[_0x6437('0x5d')][_0x6437('0x68')],_0x42f84f[_0x6437('0x5d')][_0x6437('0x1c')]);}break;case _0x6437('0x69'):var _0x3b5f8e=_0x4f6296[_0x6437('0x5d')]['split'](',')[_0x6437('0x2d')](function(_0x48d659){return Number(_0x48d659);});_0x3b5f8e['forEach'](function(_0x563b5f){_0x55e408['or'](_0x6437('0x6a'),'%,'+_0x563b5f+',%');});_0x198e55=_[_0x6437('0x6b')](_0x198e55,_0x3b5f8e);break;case _0x6437('0x6c'):if(_0x4f6296[_0x6437('0x61')]===_0x6437('0x62')){_0x567e50[_0x1e8f08](_0x6437('0x6d'),'%'+_0x4f6296[_0x6437('0x5d')]+'%',null);}else{_0x4c53c3=_['find'](_0x11caf3,['name',_0x6437('0x6e')]);_0x4f6296[_0x6437('0x45')]=_0x6437('0x6e');_0x42f84f=as[_0x6437('0x66')](_0x15b78e,_0x4c53c3[_0x6437('0x38')],_0x4f6296);_0x567e50[_0x1e8f08](_0x42f84f['text'],_0x42f84f['value'][_0x6437('0x68')],_0x42f84f[_0x6437('0x5d')][_0x6437('0x1c')]);}break;case _0x6437('0x6f'):_0x42f84f=as[_0x6437('0x66')]('me',null,_0x4f6296);_0x567e50[_0x1e8f08](_0x42f84f[_0x6437('0x67')],_0x42f84f[_0x6437('0x5d')][_0x6437('0x68')],_0x42f84f['value']['end']);break;}}else{var _0x42f84f=as[_0x6437('0x66')](_0x15b78e,_0x4c53c3['type'],_0x4f6296);_0x567e50[_0x1e8f08](_0x42f84f[_0x6437('0x67')],_0x42f84f[_0x6437('0x5d')]['start'],_0x42f84f['value'][_0x6437('0x1c')]);}}}else{var _0x59a9cc=_(_0xf54461[_0x6437('0x3c')])[_0x6437('0x3b')]()[_0x6437('0x2d')](function(_0x3ebb58){return _[_0x6437('0x70')](_0x11caf3,[_0x6437('0x2a'),_0x3ebb58])?_0x3ebb58:undefined;})[_0x6437('0x71')]()[_0x6437('0x5d')]();if(!_[_0x6437('0x72')](_0x59a9cc)){_0x59a9cc[_0x6437('0x32')](function(_0x5c0c41){if(_0x5c0c41==='FaxAccountId'){_0x529449[_0x6437('0x73')](_0x6437('0x74'),[]['concat'](_0xf54461[_0x6437('0x3c')][_0x5c0c41]));}else if(_0x5c0c41===_0x6437('0x75')){var _0x3d92af=JSON[_0x6437('0x76')](_0xf54461[_0x6437('0x3c')][_0x5c0c41])['$gte'];var _0x16db89=JSON[_0x6437('0x76')](_0xf54461[_0x6437('0x3c')][_0x5c0c41])[_0x6437('0x77')];_0x529449[_0x6437('0x73')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x3d92af,_0x16db89);}else{if(_0xf54461[_0x6437('0x3c')][_0x5c0c41]===_0x6437('0x78')){_0x529449[_0x6437('0x73')]('i.'+_0x5c0c41+_0x6437('0x79'));}else{_0x529449[_0x6437('0x73')]('i.'+_0x5c0c41+_0x6437('0x7a'),_0xf54461[_0x6437('0x3c')][_0x5c0c41]);}}});}if(_0xf54461[_0x6437('0x3c')][_0x6437('0x7b')]){if(_0xf54461[_0x6437('0x3c')][_0x6437('0x7b')]==0x1){_0x529449[_0x6437('0x5e')](_0x6437('0x7c'));}else{_0x529449['having'](_0x6437('0x7d'));}}if(_0xf54461['query'][_0x6437('0x7e')]){_0x198e55=_[_0x6437('0x7f')](_0xf54461[_0x6437('0x3c')][_0x6437('0x7e')])?_0xf54461[_0x6437('0x3c')][_0x6437('0x7e')]:new Array(_0xf54461['query'][_0x6437('0x7e')]);_0x198e55[_0x6437('0x32')](function(_0x5ebef7){_0x55e408['or'](_0x6437('0x6a'),'%,'+_0x5ebef7+',%');});}if(_0xf54461[_0x6437('0x3c')]['filter']){var _0x33f8f2=_0xf54461['query']['filter']['replace']('\x5c','\x5c\x5c')[_0x6437('0x80')](/'/g,'\x27\x27');if(qs[_0x6437('0x81')](_0x33f8f2)){_0x567e50['or'](_0x6437('0x82'),_0x33f8f2+'%')['or'](_0x6437('0x83'),_0x33f8f2+'%');}_0x567e50['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x33f8f2+'%');}}_0x529449['where'](_0x567e50);_0x529449[_0x6437('0x84')](_0x6437('0x85'));var _0x1af227={'type':db['Sequelize'][_0x6437('0x86')]['SELECT'],'raw':!![]};var _0x365638=_0x529449[_0x6437('0x87')]();_0x365638[_0x6437('0x45')](_0x6437('0x85'));_0x365638[_0x6437('0x45')](_0x6437('0x88'),_0x6437('0x5c'));if(_0x451811[_0x6437('0x43')]){_0x451811['order'][_0x6437('0x32')](function(_0x3a0aa3){var _0x5863ad=_0x3a0aa3[0x0]===_0x6437('0x89')?_0x3a0aa3[0x0]:'i.'+_0x3a0aa3[0x0];_0x529449[_0x6437('0x43')](_0x5863ad,_0x3a0aa3[0x1]==='DESC'?![]:!![]);});}if(!_[_0x6437('0x72')](_0x198e55)){_0x529449[_0x6437('0x5e')](_0x55e408);_0x365638[_0x6437('0x73')]('t.id\x20IN\x20?',_0x198e55);}BPromise['resolve']()[_0x6437('0x27')](function(){if(!_0x3629a8){if(_0xf54461[_0x6437('0x3c')][_0x6437('0x8a')])return;_0x365638['where'](_0x6437('0x8b'));_0x529449[_0x6437('0x73')]('i.FaxAccountId\x20IS\x20NOT\x20NULL');return;}if(_0xf54461['user'][_0x6437('0x8c')]!==_0x6437('0x8d'))return;return _0xf54461[_0x6437('0x8e')][_0x6437('0x8f')]({'attributes':['id'],'raw':!![]})['then'](function(_0x41fdce){if(_[_0x6437('0x72')](_0x41fdce)){_0x365638['where']('i.FaxAccountId\x20IS\x20NULL');_0x529449['where']('i.FaxAccountId\x20IS\x20NULL');}else{_0x365638[_0x6437('0x73')](_0x6437('0x74'),_[_0x6437('0x2d')](_0x41fdce,'id'));_0x529449['where'](_0x6437('0x74'),_[_0x6437('0x2d')](_0x41fdce,'id'));}});})['then'](function(){if(_0xf54461[_0x6437('0x8e')][_0x6437('0x8c')]===_0x6437('0x8d')&&!_0x3629a8&&!_0xf54461[_0x6437('0x3c')][_0x6437('0x8a')])return[];return db['sequelize'][_0x6437('0x3c')](_0x365638[_0x6437('0x90')](),_0x1af227);})[_0x6437('0x27')](function(_0x3a4f74){_0x47b82b[_0x6437('0x20')]=_0x3a4f74[_0x6437('0x41')];if(_0x47b82b[_0x6437('0x20')]===0x0)return[];return db[_0x6437('0x91')][_0x6437('0x3c')](_0x97ad8[_0x6437('0x90')](),_0x1af227)[_0x6437('0x27')](function(_0x5afcee){_0x326382=_['keyBy'](_0x5afcee,'id');_0x1af227=_[_0x6437('0x92')](_0x1af227,{'model':db[_0x6437('0x36')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xf54461[_0x6437('0x3c')][_0x6437('0x40')]){_0x451811[_0x6437('0x3f')][_0x6437('0x32')](function(_0x50f360){_0x529449[_0x6437('0x45')]('i.'+_0x50f360);});}else{_0x529449[_0x6437('0x45')](_0x6437('0x88'),_0x6437('0x5c'));_0x529449[_0x6437('0x45')](_0x6437('0x93'),'Account.key');_0x529449['field'](_0x6437('0x94'),'Account.mandatoryDisposition');_0x529449[_0x6437('0x45')]('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName');_0x529449['field'](_0x6437('0x95'));_0x529449[_0x6437('0x45')](_0x6437('0x96'),_0x6437('0x97'));_0x529449['field'](_0x6437('0x98'),_0x6437('0x99'));_0x529449[_0x6437('0x45')](_0x6437('0x9a'),_0x6437('0x9b'));_0x529449[_0x6437('0x45')](_0x6437('0x9c'),_0x6437('0x9d'));_0x529449['field'](_0x6437('0x9e'),_0x6437('0x9f'));_0x529449['field'](_0x6437('0xa0'),_0x6437('0xa1'));_0x529449['field']('o.fullname',_0x6437('0xa2'));_0x529449[_0x6437('0x45')](_0x6437('0xa3'),_0x6437('0xa4'));_0x529449['field'](_0x6437('0xa5'),_0x6437('0x2f'));}if(_0x451811[_0x6437('0x1e')])_0x529449['limit'](_0x451811[_0x6437('0x1e')]);if(_0x451811[_0x6437('0x21')])_0x529449['offset'](_0x451811['offset']);return db[_0x6437('0x91')][_0x6437('0x3c')](_0x529449[_0x6437('0x90')](),_0x1af227);})[_0x6437('0x27')](function(_0x17c307){if(_0x17c307[_0x6437('0x41')]>0x0)_0xa240f4['where'](_0x6437('0xa6'),_[_0x6437('0x2d')](_0x17c307,'id'));return db['sequelize'][_0x6437('0x3c')](_0xa240f4[_0x6437('0x90')](),_0x1af227)[_0x6437('0x27')](function(_0x7d94a8){var _0x52e68a=_['groupBy'](_0x7d94a8,_0x6437('0xa7'));var _0x5d774c=[];_0x17c307[_0x6437('0x32')](function(_0x3c07fe){_0x5d774c[_0x6437('0x33')](updateFaxInteraction(_0x3c07fe,_0x326382,_0x52e68a));});return BPromise[_0x6437('0xa8')](_0x5d774c);});});})[_0x6437('0x27')](function(_0x3b7915){_0x47b82b[_0x6437('0xa9')]=_0x3b7915;return _0x47b82b;})[_0x6437('0x27')](respondWithFilteredResult(_0x460397,_0x451811))[_0x6437('0x34')](handleError(_0x460397,null));};exports[_0x6437('0xaa')]=function(_0x3ce9c6,_0xe3b16a){var _0x216114={'raw':![],'where':{'id':_0x3ce9c6[_0x6437('0xab')]['id']}},_0xb40c84={};_0xb40c84[_0x6437('0x3a')]=_[_0x6437('0x3b')](db['FaxInteraction']['rawAttributes']);_0xb40c84[_0x6437('0x3c')]=_['keys'](_0x3ce9c6[_0x6437('0x3c')]);_0xb40c84[_0x6437('0x3d')]=_['intersection'](_0xb40c84[_0x6437('0x3a')],_0xb40c84[_0x6437('0x3c')]);_0x216114[_0x6437('0x3f')]=_[_0x6437('0x3e')](_0xb40c84[_0x6437('0x3a')],qs['fields'](_0x3ce9c6[_0x6437('0x3c')][_0x6437('0x40')]));_0x216114[_0x6437('0x3f')]=_0x216114[_0x6437('0x3f')]['length']?_0x216114[_0x6437('0x3f')]:_0xb40c84[_0x6437('0x3a')];if(_0x3ce9c6['query'][_0x6437('0xac')]){_0x216114['include']=[{'all':!![]}];}_0x216114=_[_0x6437('0x92')]({},_0x216114,_0x3ce9c6[_0x6437('0xad')]);return db['FaxInteraction']['find'](_0x216114)['then'](handleEntityNotFound(_0xe3b16a,null))[_0x6437('0x27')](respondWithResult(_0xe3b16a,null))[_0x6437('0x34')](handleError(_0xe3b16a,null));};exports['create']=function(_0x16783d,_0x493212){return db[_0x6437('0x36')]['create'](_0x16783d[_0x6437('0x6f')],{})[_0x6437('0x27')](respondWithResult(_0x493212,0xc9))['catch'](handleError(_0x493212,null));};exports['update']=function(_0xf59581,_0x2f3dd5){if(_0xf59581['body']['id']){delete _0xf59581[_0x6437('0x6f')]['id'];}return db[_0x6437('0x36')][_0x6437('0x64')]({'where':{'id':_0xf59581[_0x6437('0xab')]['id']}})[_0x6437('0x27')](handleEntityNotFound(_0x2f3dd5,null))['then'](saveUpdates(_0xf59581['body'],null))[_0x6437('0x27')](respondWithResult(_0x2f3dd5,null))[_0x6437('0x34')](handleError(_0x2f3dd5,null));};exports[_0x6437('0x26')]=function(_0x4a8dba,_0x1fe619){return db[_0x6437('0x36')][_0x6437('0x64')]({'where':{'id':_0x4a8dba[_0x6437('0xab')]['id']}})[_0x6437('0x27')](handleEntityNotFound(_0x1fe619,null))[_0x6437('0x27')](removeEntity(_0x1fe619,null))['catch'](handleError(_0x1fe619,null));};exports[_0x6437('0xae')]=function(_0x25070c,_0x59790c){return db[_0x6437('0x36')][_0x6437('0xae')]()[_0x6437('0x27')](respondWithResult(_0x59790c,null))[_0x6437('0x34')](handleError(_0x59790c,null));};exports[_0x6437('0xaf')]=function(_0x28cea1,_0x1396a4,_0x309dc4){return db['FaxMessage'][_0x6437('0x64')]({'where':{'id':_0x28cea1[_0x6437('0xab')]['id']}})['then'](handleEntityNotFound(_0x1396a4,null))[_0x6437('0x27')](function(_0xb4ccf6){if(_0xb4ccf6){return _0xb4ccf6['addMessage'](_0x28cea1['body'][_0x6437('0xb0')],_[_0x6437('0xb1')](_0x28cea1[_0x6437('0x6f')],['ids','id'])||{});}})[_0x6437('0x27')](respondWithResult(_0x1396a4,null))[_0x6437('0x34')](handleError(_0x1396a4,null));};exports[_0x6437('0xb2')]=function(_0x43493e,_0xf52bd0,_0x2a35c0){var _0x186004={'raw':![],'where':{}};var _0x284ff4={};var _0x2356a1={'count':0x0,'rows':[]};return db[_0x6437('0x36')][_0x6437('0xb3')]({'where':{'id':_0x43493e[_0x6437('0xab')]['id']}})[_0x6437('0x27')](handleEntityNotFound(_0xf52bd0,null))[_0x6437('0x27')](function(_0x3d38cd){if(_0x3d38cd){_0x284ff4['model']=_[_0x6437('0x3b')](db['FaxMessage'][_0x6437('0x37')]);_0x284ff4['query']=_[_0x6437('0x3b')](_0x43493e['query']);_0x284ff4['filters']=_[_0x6437('0x3e')](_0x284ff4[_0x6437('0x3a')],_0x284ff4['query']);_0x186004[_0x6437('0x3f')]=_[_0x6437('0x3e')](_0x284ff4[_0x6437('0x3a')],qs['fields'](_0x43493e['query'][_0x6437('0x40')]));_0x186004[_0x6437('0x3f')]=_0x186004[_0x6437('0x3f')][_0x6437('0x41')]?_0x186004['attributes']:_0x284ff4['model'];if(!_0x43493e['query'][_0x6437('0x42')](_0x6437('0xb4'))){_0x186004[_0x6437('0x1e')]=qs[_0x6437('0x1e')](_0x43493e['query']['limit']);_0x186004[_0x6437('0x21')]=qs[_0x6437('0x21')](_0x43493e[_0x6437('0x3c')]['offset']);}_0x186004['order']=qs[_0x6437('0x44')](_0x43493e[_0x6437('0x3c')]['sort']);_0x186004[_0x6437('0x73')]=qs[_0x6437('0x3d')](_['pick'](_0x43493e['query'],_0x284ff4[_0x6437('0x3d')]));_0x186004[_0x6437('0x73')][_0x6437('0xa7')]=_0x3d38cd['id'];if(_0x43493e[_0x6437('0x3c')][_0x6437('0xb5')]){_0x186004['where']=_[_0x6437('0x92')](_0x186004['where'],{'$or':_[_0x6437('0x2d')](_0x186004[_0x6437('0x3f')],function(_0x4b9c08){var _0xe72b01={};_0xe72b01[_0x4b9c08]={'$like':'%'+_0x43493e[_0x6437('0x3c')][_0x6437('0xb5')]+'%'};return _0xe72b01;})});}if(_0x43493e[_0x6437('0x3c')][_0x6437('0xb6')]){var _0x22916f=_0x43493e['query'][_0x6437('0xb6')][_0x6437('0x31')](',');var _0x10036f={};_0x10036f[_0x22916f[0x0]]={'$gte':moment(_0x22916f[0x1])[_0x6437('0xb7')](_0x6437('0xb8'))};_0x186004[_0x6437('0x73')]=_['merge'](_0x186004[_0x6437('0x73')],_0x10036f);}_0x186004=_[_0x6437('0x92')]({},_0x186004,_0x43493e[_0x6437('0xad')]);return db[_0x6437('0xb9')][_0x6437('0x20')]({'where':_0x186004['where']})[_0x6437('0x27')](function(_0x3c6ebe){_0x2356a1[_0x6437('0x20')]=_0x3c6ebe;if(_0x43493e[_0x6437('0x3c')][_0x6437('0xac')]){_0x186004[_0x6437('0xba')]=[{'all':!![]}];}return db[_0x6437('0xb9')][_0x6437('0xbb')](_0x186004);})['then'](function(_0x201eb9){_0x2356a1[_0x6437('0xa9')]=_0x201eb9;return _0x2356a1;});}})[_0x6437('0x27')](respondWithFilteredResult(_0xf52bd0,_0x186004))[_0x6437('0x34')](handleError(_0xf52bd0,null));};exports[_0x6437('0xbc')]=function(_0xd2d7d3,_0x1a9e48,_0xa6f3e1){return db[_0x6437('0x36')]['find']({'where':{'id':_0xd2d7d3[_0x6437('0xab')]['id']}})[_0x6437('0x27')](handleEntityNotFound(_0x1a9e48,null))[_0x6437('0x27')](function(_0x49dfcb){if(_0x49dfcb){return _0x49dfcb['setTags'](_0xd2d7d3[_0x6437('0x6f')]['ids'],_['omit'](_0xd2d7d3['body'],['ids','id'])||{})[_0x6437('0xbd')](function(){return db[_0x6437('0x69')][_0x6437('0xbb')]({'attributes':['id',_0x6437('0x2a'),_0x6437('0x46')],'where':{'id':_0xd2d7d3[_0x6437('0x6f')][_0x6437('0xb0')]}});})[_0x6437('0x27')](function(_0x54dc05){socket[_0x6437('0xbe')](_0x6437('0xbf'),{'id':Number(_0xd2d7d3[_0x6437('0xab')]['id']),'tags':_0x54dc05||[]});return{'id':Number(_0xd2d7d3['params']['id']),'tags':_0x54dc05||[]};});}})[_0x6437('0x27')](respondWithResult(_0x1a9e48,null))[_0x6437('0x34')](handleError(_0x1a9e48,null));};exports[_0x6437('0xc0')]=function(_0x1ceb9f,_0x4a7ad7,_0x3cd41b){return db[_0x6437('0x36')][_0x6437('0x64')]({'where':{'id':_0x1ceb9f[_0x6437('0xab')]['id']}})['then'](handleEntityNotFound(_0x4a7ad7,null))[_0x6437('0x27')](function(_0x56fc8f){if(_0x56fc8f){return _0x56fc8f['removeTags'](_0x1ceb9f[_0x6437('0x3c')][_0x6437('0xb0')]);}})[_0x6437('0x27')](respondWithStatusCode(_0x4a7ad7,null))[_0x6437('0x34')](handleError(_0x4a7ad7,null));};exports['download']=function(_0x98d0c6,_0xef2c01){var _0x13498c=moment()[_0x6437('0xc1')]()['toString']();var _0x5494e2=path[_0x6437('0xc2')](config[_0x6437('0xc3')],_0x6437('0xc4'),_0x6437('0xc5'),_0x6437('0xc6'));var _0x16155c=path[_0x6437('0xc2')](config['root'],'server',_0x6437('0xc5'),_0x6437('0xc7'));var _0x2b2df8=path['join'](_0x5494e2,_0x13498c);var _0x52360b=util['format']('transcript-%d-%s.zip',_0x98d0c6[_0x6437('0xab')]['id'],_0x13498c);var _0x52c0fa=path[_0x6437('0xc2')](_0x5494e2,_0x52360b);var _0x3a4330=[];_0x3a4330[_0x6437('0x33')]({'model':db[_0x6437('0xc8')],'as':'Attachment','raw':!![]});var _0x20e3cf=[{'model':db[_0x6437('0xb9')],'as':_0x6437('0xc9'),'attributes':['id',_0x6437('0x6f'),_0x6437('0x75')],'include':_0x3a4330}];return db[_0x6437('0x36')]['find']({'where':{'id':_0x98d0c6[_0x6437('0xab')]['id']},'include':_0x20e3cf})[_0x6437('0x27')](handleEntityNotFound(_0xef2c01,null))[_0x6437('0x27')](function(_0x127410){if(_0x127410&&_0x127410[_0x6437('0xc9')]){var _0x1d6ad9=_0x127410[_0x6437('0xca')]({'plain':!![]});fs['mkdirSync'](_0x2b2df8);for(var _0x1c367f=0x0;_0x1c367f<_0x1d6ad9[_0x6437('0xc9')]['length'];_0x1c367f++){var _0x4b4d2c=_0x1d6ad9[_0x6437('0xc9')][_0x1c367f][_0x6437('0xc8')];if(_0x4b4d2c){var _0x5c6ba0=path[_0x6437('0xc2')](_0x16155c,_0x4b4d2c['basename']);if(fs['existsSync'](_0x5c6ba0)){fs['createReadStream'](_0x5c6ba0)[_0x6437('0xcb')](fs[_0x6437('0xcc')](path['join'](_0x2b2df8,_0x4b4d2c[_0x6437('0xcd')])));}}}return BPromise[_0x6437('0xce')]()[_0x6437('0x27')](function(){return new BPromise(function(_0x184f97,_0x239f7d){zipdir(_0x2b2df8,{'saveTo':_0x52c0fa},function(_0x366857,_0x24c3ab){if(_0x366857)return _0x239f7d(_0x366857);return _0x184f97(_0x24c3ab);});})[_0x6437('0x27')](function(){return new BPromise(function(_0x47ffde,_0x55b4bf){rimraf(_0x2b2df8,function(_0x31082f){if(_0x31082f)_0x55b4bf(_0x31082f);return _0x47ffde();});});})[_0x6437('0x27')](function(){return _0xef2c01['download'](_0x52c0fa,_0x52360b,function(_0x5d3683){if(_0x5d3683){console[_0x6437('0xcf')](_0x6437('0xd0'),_0x5d3683);}else{fs[_0x6437('0xd1')](_0x52c0fa);}});});});}else{return _0xef2c01['sendStatus'](0xc8);}})[_0x6437('0x34')](handleError(_0xef2c01,null));}; \ No newline at end of file +var _0xa3cf=['u.id','ui.FaxInteractionId','user_has_fax_interactions','left_join','users','fax_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','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','find','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','buildExpression','text','start','Tag','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','some','compact','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','`unreadMessages`\x20>\x200','isArray','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','i.id','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','role','agent','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','all','rows','show','params','include','options','create','describe','FaxMessage','addMessage','ids','omit','getMessages','findOne','pick','$gte','YYYY-MM-DD\x20HH:mm:ss','includeAll','addTags','setTags','spread','emit','faxInteractionTags:save','removeTags','download','join','server','files','tmp','root','attachments','format','transcript-%d-%s.zip','Attachment','Messages','createdAt','get','mkdirSync','basename','existsSync','createReadStream','pipe','createWriteStream','resolve','log','unlinkSync','eml-format','rimraf','fast-json-patch','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','localhost','socket.io-emitter','./faxInteraction.socket','sendStatus','status','offset','undefined','limit','count','Content-Range','json','apply','reject','update','destroy','then','end','name','send','Users','map','fullname','Tags','forEach','push','TagIds','catch','FaxInteraction','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','select','field','color','from','tools_tags'];(function(_0x52e141,_0x1d1d9b){var _0x285dd4=function(_0x57fe1b){while(--_0x57fe1b){_0x52e141['push'](_0x52e141['shift']());}};_0x285dd4(++_0x1d1d9b);}(_0xa3cf,0x166));var _0xfa3c=function(_0xff4b64,_0x2b7a56){_0xff4b64=_0xff4b64-0x0;var _0xd0459f=_0xa3cf[_0xff4b64];return _0xd0459f;};'use strict';var emlformat=require(_0xfa3c('0x0'));var rimraf=require(_0xfa3c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfa3c('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xfa3c('0x3'));var Mustache=require('mustache');var util=require(_0xfa3c('0x4'));var path=require('path');var sox=require(_0xfa3c('0x5'));var csv=require(_0xfa3c('0x6'));var ejs=require(_0xfa3c('0x7'));var fs=require('fs');var fs_extra=require(_0xfa3c('0x8'));var _=require(_0xfa3c('0x9'));var squel=require(_0xfa3c('0xa'));var crypto=require(_0xfa3c('0xb'));var jsforce=require(_0xfa3c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xfa3c('0x6'));var querystring=require(_0xfa3c('0xd'));var Papa=require(_0xfa3c('0xe'));var Redis=require(_0xfa3c('0xf'));var authService=require(_0xfa3c('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfa3c('0x11'));var logger=require(_0xfa3c('0x12'))(_0xfa3c('0x13'));var utils=require(_0xfa3c('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xfa3c('0x15'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xfa3c('0x16'),'port':0x18eb});var socket=require(_0xfa3c('0x17'))(new Redis(config['redis']));require(_0xfa3c('0x18'))['register'](socket);function respondWithStatusCode(_0x2136f4,_0x2afe29){_0x2afe29=_0x2afe29||0xcc;return function(_0x70cef1){if(_0x70cef1){return _0x2136f4[_0xfa3c('0x19')](_0x2afe29);}return _0x2136f4[_0xfa3c('0x1a')](_0x2afe29)['end']();};}function respondWithResult(_0x33b1b3,_0x45d993){_0x45d993=_0x45d993||0xc8;return function(_0x112d14){if(_0x112d14){return _0x33b1b3[_0xfa3c('0x1a')](_0x45d993)['json'](_0x112d14);}};}function respondWithFilteredResult(_0xd54aa2,_0x105c3f){return function(_0x57ccc7){if(_0x57ccc7){var _0x4432fc=typeof _0x105c3f[_0xfa3c('0x1b')]===_0xfa3c('0x1c')&&typeof _0x105c3f[_0xfa3c('0x1d')]===_0xfa3c('0x1c');var _0x40101d=_0x57ccc7[_0xfa3c('0x1e')];var _0x42e706=_0x4432fc?0x0:_0x105c3f[_0xfa3c('0x1b')];var _0x131586=_0x4432fc?_0x57ccc7[_0xfa3c('0x1e')]:_0x105c3f[_0xfa3c('0x1b')]+_0x105c3f[_0xfa3c('0x1d')];var _0x182dae;if(_0x131586>=_0x40101d){_0x131586=_0x40101d;_0x182dae=0xc8;}else{_0x182dae=0xce;}_0xd54aa2[_0xfa3c('0x1a')](_0x182dae);return _0xd54aa2['set'](_0xfa3c('0x1f'),_0x42e706+'-'+_0x131586+'/'+_0x40101d)[_0xfa3c('0x20')](_0x57ccc7);}return null;};}function patchUpdates(_0x5b1cad){return function(_0x431302){try{jsonpatch[_0xfa3c('0x21')](_0x431302,_0x5b1cad,!![]);}catch(_0x2b14ec){return BPromise[_0xfa3c('0x22')](_0x2b14ec);}return _0x431302['save']();};}function saveUpdates(_0x11b81b,_0x481855){return function(_0x351699){if(_0x351699){return _0x351699[_0xfa3c('0x23')](_0x11b81b)['then'](function(_0x16cfd3){return _0x16cfd3;});}return null;};}function removeEntity(_0x5f481a,_0x355b4c){return function(_0x64b43d){if(_0x64b43d){return _0x64b43d[_0xfa3c('0x24')]()[_0xfa3c('0x25')](function(){_0x5f481a[_0xfa3c('0x1a')](0xcc)[_0xfa3c('0x26')]();});}};}function handleEntityNotFound(_0x4254b7,_0x5e284c){return function(_0x3e91da){if(!_0x3e91da){_0x4254b7['sendStatus'](0x194);}return _0x3e91da;};}function handleError(_0x55f673,_0x5e667a){_0x5e667a=_0x5e667a||0x1f4;return function(_0x323d7c){logger['error'](_0x323d7c['stack']);if(_0x323d7c[_0xfa3c('0x27')]){delete _0x323d7c[_0xfa3c('0x27')];}_0x55f673[_0xfa3c('0x1a')](_0x5e667a)[_0xfa3c('0x28')](_0x323d7c);};}function getInteractionUsers(_0x4e894f,_0x2edc1f){return new BPromise(function(_0x4d0f87,_0xd631b6){try{if(_0x2edc1f[_0x4e894f['id']]){_0x4e894f[_0xfa3c('0x29')]=_[_0xfa3c('0x2a')](_0x2edc1f[_0x4e894f['id']],function(_0x239f2a){return{'id':_0x239f2a['id'],'fullname':_0x239f2a[_0xfa3c('0x2b')]};});}}catch(_0x372da0){_0xd631b6(_0x372da0);}_0x4d0f87(_0x4e894f);});}function getInteractionTags(_0x56d1fb,_0x7617c){return new BPromise(function(_0x34a4f9,_0x4534a0){try{if(_0x56d1fb['TagIds']){_0x56d1fb[_0xfa3c('0x2c')]=[];_0x56d1fb['TagIds']['split'](',')[_0xfa3c('0x2d')](function(_0x1fce0f){_0x56d1fb['Tags'][_0xfa3c('0x2e')](_0x7617c[_0x1fce0f]);});}delete _0x56d1fb[_0xfa3c('0x2f')];}catch(_0x48edfe){_0x4534a0(_0x48edfe);}_0x34a4f9(_0x56d1fb);});}function updateFaxInteraction(_0x31d6c1,_0x3e4383,_0x4a96f6){return new BPromise(function(_0x4bbe1e,_0x25d5e7){return getInteractionUsers(_0x31d6c1,_0x4a96f6)[_0xfa3c('0x25')](function(_0x5bc554){return getInteractionTags(_0x5bc554,_0x3e4383);})[_0xfa3c('0x25')](function(_0x1e3b60){_0x4bbe1e(_0x1e3b60);})[_0xfa3c('0x30')](function(_0x494a5f){_0x25d5e7(_0x494a5f);});});}exports['index']=function(_0x54351e,_0x43c8bc){var _0x4f1bad={},_0x482ec5={},_0x502a45={'count':0x0,'rows':[]};var _0x14e333=_['map'](db[_0xfa3c('0x31')][_0xfa3c('0x32')],function(_0x12921a){return{'name':_0x12921a[_0xfa3c('0x33')],'type':_0x12921a[_0xfa3c('0x34')][_0xfa3c('0x35')]};});_0x482ec5['model']=_['map'](_0x14e333,'name');_0x482ec5[_0xfa3c('0x36')]=_[_0xfa3c('0x37')](_0x54351e['query']);_0x482ec5[_0xfa3c('0x38')]=_[_0xfa3c('0x39')](_0x482ec5[_0xfa3c('0x3a')],_0x482ec5[_0xfa3c('0x36')]);_0x4f1bad[_0xfa3c('0x3b')]=_['intersection'](_0x482ec5['model'],qs[_0xfa3c('0x3c')](_0x54351e[_0xfa3c('0x36')][_0xfa3c('0x3c')]));_0x4f1bad[_0xfa3c('0x3b')]=_0x4f1bad[_0xfa3c('0x3b')][_0xfa3c('0x3d')]?_0x4f1bad['attributes']:_0x482ec5[_0xfa3c('0x3a')];if(!_0x54351e['query'][_0xfa3c('0x3e')](_0xfa3c('0x3f'))){_0x4f1bad[_0xfa3c('0x1d')]=qs[_0xfa3c('0x1d')](_0x54351e['query'][_0xfa3c('0x1d')]);_0x4f1bad[_0xfa3c('0x1b')]=qs['offset'](_0x54351e[_0xfa3c('0x36')][_0xfa3c('0x1b')]);}_0x4f1bad[_0xfa3c('0x40')]=qs[_0xfa3c('0x41')](_0x54351e[_0xfa3c('0x36')]['sort']);_0x4f1bad[_0xfa3c('0x42')]=qs['filters'](_['pick'](_0x54351e[_0xfa3c('0x36')],_0x482ec5[_0xfa3c('0x38')]),_0x14e333);var _0x659681=[];var _0x36fe15=squel[_0xfa3c('0x43')]()[_0xfa3c('0x44')]('id')[_0xfa3c('0x44')](_0xfa3c('0x27'))[_0xfa3c('0x44')](_0xfa3c('0x45'))[_0xfa3c('0x46')](_0xfa3c('0x47'));var _0x347242=squel[_0xfa3c('0x43')]()[_0xfa3c('0x44')](_0xfa3c('0x48'))['field']('u.fullname')[_0xfa3c('0x44')](_0xfa3c('0x49'))[_0xfa3c('0x46')](_0xfa3c('0x4a'),'ui')[_0xfa3c('0x4b')](_0xfa3c('0x4c'),'u','u.id\x20=\x20ui.UserId');var _0x38c5fa=squel[_0xfa3c('0x43')]()[_0xfa3c('0x46')](_0xfa3c('0x4d'),'i')[_0xfa3c('0x4b')](_0xfa3c('0x4e'),'c',_0xfa3c('0x4f'))[_0xfa3c('0x4b')](_0xfa3c('0x4c'),'o',_0xfa3c('0x50'))[_0xfa3c('0x4b')]('fax_accounts','a',_0xfa3c('0x51'))['left_join'](_0xfa3c('0x52'),'me',_0xfa3c('0x53'))[_0xfa3c('0x4b')](_0xfa3c('0x54'),'it','it.FaxInteractionId\x20=\x20i.id')[_0xfa3c('0x4b')]('tools_tags','t',_0xfa3c('0x55'));var _0x5b81e5=squel[_0xfa3c('0x56')]();var _0x52342e=[];var _0x412326=squel['expr']();var _0x349b31;if(_0x54351e[_0xfa3c('0x36')][_0xfa3c('0x57')]){_0x349b31=as[_0xfa3c('0x58')](_0x54351e[_0xfa3c('0x36')][_0xfa3c('0x57')]);var _0x303d24=_0x349b31[_0xfa3c('0x59')];for(var _0x146814=0x0;_0x146814<_0x349b31[_0xfa3c('0x5a')][_0xfa3c('0x3d')];_0x146814++){var _0x28f0a7=_0x349b31[_0xfa3c('0x5a')][_0x146814];var _0x190711='i';var _0x38e7e6=_[_0xfa3c('0x5b')](_0x14e333,[_0xfa3c('0x27'),_0x28f0a7[_0xfa3c('0x44')]]);if(!_0x38e7e6){switch(_0x28f0a7[_0xfa3c('0x44')]){case'unreadMessages':if(_0x28f0a7[_0xfa3c('0x5c')]==0x1){_0x38c5fa[_0xfa3c('0x5d')]('`'+_0x28f0a7[_0xfa3c('0x44')]+_0xfa3c('0x5e'));}else{_0x38c5fa[_0xfa3c('0x5d')]('`'+_0x28f0a7['field']+_0xfa3c('0x5f'));}break;case _0xfa3c('0x60'):if(_0x28f0a7[_0xfa3c('0x61')]==='$substring'){if(_0x28f0a7[_0xfa3c('0x5c')][_0xfa3c('0x62')]('\x20')[_0xfa3c('0x3d')]>0x1){_0x5b81e5[_0x303d24](_0xfa3c('0x63'),qs[_0xfa3c('0x64')](_0x28f0a7['value']),null);}else{var _0x4739ac='%'+_0x28f0a7['value']+'%';_0x5b81e5[_0x303d24]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x4739ac,_0x4739ac,_0x4739ac);}}else{_0x38e7e6=_[_0xfa3c('0x5b')](_0x14e333,[_0xfa3c('0x27'),_0xfa3c('0x65')]);_0x28f0a7[_0xfa3c('0x44')]='ContactId';_0xd07cf5=as[_0xfa3c('0x66')](_0x190711,_0x38e7e6[_0xfa3c('0x34')],_0x28f0a7);_0x5b81e5[_0x303d24](_0xd07cf5[_0xfa3c('0x67')],_0xd07cf5[_0xfa3c('0x5c')][_0xfa3c('0x68')],_0xd07cf5[_0xfa3c('0x5c')][_0xfa3c('0x26')]);}break;case _0xfa3c('0x69'):var _0x38fd57=_0x28f0a7[_0xfa3c('0x5c')][_0xfa3c('0x62')](',')[_0xfa3c('0x2a')](function(_0x485e2c){return Number(_0x485e2c);});_0x38fd57[_0xfa3c('0x2d')](function(_0x2c00d7){_0x412326['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2c00d7+',%');});_0x52342e=_['union'](_0x52342e,_0x38fd57);break;case _0xfa3c('0x6a'):if(_0x28f0a7[_0xfa3c('0x61')]===_0xfa3c('0x6b')){_0x5b81e5[_0x303d24](_0xfa3c('0x6c'),'%'+_0x28f0a7[_0xfa3c('0x5c')]+'%',null);}else{_0x38e7e6=_[_0xfa3c('0x5b')](_0x14e333,[_0xfa3c('0x27'),_0xfa3c('0x6d')]);_0x28f0a7[_0xfa3c('0x44')]=_0xfa3c('0x6d');_0xd07cf5=as[_0xfa3c('0x66')](_0x190711,_0x38e7e6['type'],_0x28f0a7);_0x5b81e5[_0x303d24](_0xd07cf5['text'],_0xd07cf5['value'][_0xfa3c('0x68')],_0xd07cf5['value'][_0xfa3c('0x26')]);}break;case _0xfa3c('0x6e'):_0xd07cf5=as['buildExpression']('me',null,_0x28f0a7);_0x5b81e5[_0x303d24](_0xd07cf5[_0xfa3c('0x67')],_0xd07cf5['value'][_0xfa3c('0x68')],_0xd07cf5[_0xfa3c('0x5c')][_0xfa3c('0x26')]);break;}}else{var _0xd07cf5=as[_0xfa3c('0x66')](_0x190711,_0x38e7e6[_0xfa3c('0x34')],_0x28f0a7);_0x5b81e5[_0x303d24](_0xd07cf5[_0xfa3c('0x67')],_0xd07cf5[_0xfa3c('0x5c')][_0xfa3c('0x68')],_0xd07cf5['value']['end']);}}}else{var _0x231555=_(_0x54351e[_0xfa3c('0x36')])[_0xfa3c('0x37')]()[_0xfa3c('0x2a')](function(_0x1c930f){return _[_0xfa3c('0x6f')](_0x14e333,[_0xfa3c('0x27'),_0x1c930f])?_0x1c930f:undefined;})[_0xfa3c('0x70')]()[_0xfa3c('0x5c')]();if(!_[_0xfa3c('0x71')](_0x231555)){_0x231555[_0xfa3c('0x2d')](function(_0x31a9b8){if(_0x31a9b8===_0xfa3c('0x72')){_0x38c5fa[_0xfa3c('0x42')](_0xfa3c('0x73'),[][_0xfa3c('0x74')](_0x54351e[_0xfa3c('0x36')][_0x31a9b8]));}else if(_0x31a9b8==='createdAt'){var _0x2227cc=JSON[_0xfa3c('0x75')](_0x54351e[_0xfa3c('0x36')][_0x31a9b8])['$gte'];var _0x1f3b5f=JSON['parse'](_0x54351e[_0xfa3c('0x36')][_0x31a9b8])[_0xfa3c('0x76')];_0x38c5fa[_0xfa3c('0x42')](_0xfa3c('0x77'),_0x2227cc,_0x1f3b5f);}else{if(_0x54351e[_0xfa3c('0x36')][_0x31a9b8]===_0xfa3c('0x78')){_0x38c5fa[_0xfa3c('0x42')]('i.'+_0x31a9b8+_0xfa3c('0x79'));}else{_0x38c5fa[_0xfa3c('0x42')]('i.'+_0x31a9b8+'\x20=\x20?',_0x54351e[_0xfa3c('0x36')][_0x31a9b8]);}}});}if(_0x54351e[_0xfa3c('0x36')]['read']){if(_0x54351e[_0xfa3c('0x36')]['read']==0x1){_0x38c5fa[_0xfa3c('0x5d')]('`unreadMessages`\x20=\x200');}else{_0x38c5fa[_0xfa3c('0x5d')](_0xfa3c('0x7a'));}}if(_0x54351e[_0xfa3c('0x36')]['tag']){_0x52342e=_[_0xfa3c('0x7b')](_0x54351e[_0xfa3c('0x36')][_0xfa3c('0x7c')])?_0x54351e[_0xfa3c('0x36')][_0xfa3c('0x7c')]:new Array(_0x54351e['query'][_0xfa3c('0x7c')]);_0x52342e[_0xfa3c('0x2d')](function(_0x5e38f7){_0x412326['or'](_0xfa3c('0x7d'),'%,'+_0x5e38f7+',%');});}if(_0x54351e[_0xfa3c('0x36')][_0xfa3c('0x7e')]){var _0x42f4b8=_0x54351e['query']['filter'][_0xfa3c('0x7f')]('\x5c','\x5c\x5c')[_0xfa3c('0x7f')](/'/g,'\x27\x27');if(qs[_0xfa3c('0x80')](_0x42f4b8)){_0x5b81e5['or'](_0xfa3c('0x81'),_0x42f4b8+'%')['or'](_0xfa3c('0x82'),_0x42f4b8+'%');}_0x5b81e5['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x42f4b8+'%');}}_0x38c5fa[_0xfa3c('0x42')](_0x5b81e5);_0x38c5fa['group'](_0xfa3c('0x83'));var _0x2b291f={'type':db['Sequelize'][_0xfa3c('0x84')][_0xfa3c('0x85')],'raw':!![]};var _0x1ecf18=_0x38c5fa[_0xfa3c('0x86')]();_0x1ecf18['field']('i.id');_0x1ecf18[_0xfa3c('0x44')](_0xfa3c('0x87'),'unreadMessages');if(_0x4f1bad[_0xfa3c('0x40')]){_0x4f1bad[_0xfa3c('0x40')][_0xfa3c('0x2d')](function(_0x4e1137){var _0x58997a=_0x4e1137[0x0]===_0xfa3c('0x88')?_0x4e1137[0x0]:'i.'+_0x4e1137[0x0];_0x38c5fa[_0xfa3c('0x40')](_0x58997a,_0x4e1137[0x1]===_0xfa3c('0x89')?![]:!![]);});}if(!_['isEmpty'](_0x52342e)){_0x38c5fa['having'](_0x412326);_0x1ecf18[_0xfa3c('0x42')](_0xfa3c('0x8a'),_0x52342e);}BPromise['resolve']()[_0xfa3c('0x25')](function(){if(!_0x349b31){if(_0x54351e[_0xfa3c('0x36')][_0xfa3c('0x72')])return;_0x1ecf18['where'](_0xfa3c('0x8b'));_0x38c5fa[_0xfa3c('0x42')](_0xfa3c('0x8b'));return;}if(_0x54351e[_0xfa3c('0x8c')]['role']!=='agent')return;return _0x54351e[_0xfa3c('0x8c')][_0xfa3c('0x8d')]({'attributes':['id'],'raw':!![]})[_0xfa3c('0x25')](function(_0x469908){if(_[_0xfa3c('0x71')](_0x469908)){_0x1ecf18['where'](_0xfa3c('0x8e'));_0x38c5fa[_0xfa3c('0x42')]('i.FaxAccountId\x20IS\x20NULL');}else{_0x1ecf18[_0xfa3c('0x42')](_0xfa3c('0x73'),_[_0xfa3c('0x2a')](_0x469908,'id'));_0x38c5fa[_0xfa3c('0x42')]('i.FaxAccountId\x20IN\x20?',_[_0xfa3c('0x2a')](_0x469908,'id'));}});})[_0xfa3c('0x25')](function(){if(_0x54351e[_0xfa3c('0x8c')][_0xfa3c('0x8f')]===_0xfa3c('0x90')&&!_0x349b31&&!_0x54351e[_0xfa3c('0x36')]['FaxAccountId'])return[];return db[_0xfa3c('0x91')]['query'](_0x1ecf18['toString'](),_0x2b291f);})['then'](function(_0x40e5c9){_0x502a45['count']=_0x40e5c9['length'];if(_0x502a45['count']===0x0)return[];return db[_0xfa3c('0x91')][_0xfa3c('0x36')](_0x36fe15[_0xfa3c('0x92')](),_0x2b291f)['then'](function(_0x8c80c8){_0x659681=_[_0xfa3c('0x93')](_0x8c80c8,'id');_0x2b291f=_[_0xfa3c('0x94')](_0x2b291f,{'model':db[_0xfa3c('0x31')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x54351e['query']['fields']){_0x4f1bad[_0xfa3c('0x3b')]['forEach'](function(_0x5e8347){_0x38c5fa[_0xfa3c('0x44')]('i.'+_0x5e8347);});}else{_0x38c5fa[_0xfa3c('0x44')](_0xfa3c('0x87'),'unreadMessages');_0x38c5fa['field'](_0xfa3c('0x95'),_0xfa3c('0x96'));_0x38c5fa['field'](_0xfa3c('0x97'),_0xfa3c('0x98'));_0x38c5fa[_0xfa3c('0x44')](_0xfa3c('0x99'),_0xfa3c('0x88'));_0x38c5fa[_0xfa3c('0x44')](_0xfa3c('0x9a'));_0x38c5fa[_0xfa3c('0x44')]('c.firstName',_0xfa3c('0x9b'));_0x38c5fa['field'](_0xfa3c('0x9c'),_0xfa3c('0x9d'));_0x38c5fa[_0xfa3c('0x44')](_0xfa3c('0x9e'),'Contact.email');_0x38c5fa[_0xfa3c('0x44')](_0xfa3c('0x9f'),_0xfa3c('0xa0'));_0x38c5fa[_0xfa3c('0x44')](_0xfa3c('0xa1'),_0xfa3c('0xa2'));_0x38c5fa[_0xfa3c('0x44')](_0xfa3c('0xa3'),_0xfa3c('0xa4'));_0x38c5fa[_0xfa3c('0x44')](_0xfa3c('0xa5'),'Owner.fullname');_0x38c5fa[_0xfa3c('0x44')]('o.internal',_0xfa3c('0xa6'));_0x38c5fa['field'](_0xfa3c('0xa7'),_0xfa3c('0x2f'));}if(_0x4f1bad[_0xfa3c('0x1d')])_0x38c5fa[_0xfa3c('0x1d')](_0x4f1bad[_0xfa3c('0x1d')]);if(_0x4f1bad['offset'])_0x38c5fa['offset'](_0x4f1bad[_0xfa3c('0x1b')]);return db[_0xfa3c('0x91')][_0xfa3c('0x36')](_0x38c5fa[_0xfa3c('0x92')](),_0x2b291f);})[_0xfa3c('0x25')](function(_0x23cff6){if(_0x23cff6[_0xfa3c('0x3d')]>0x0)_0x347242['where']('ui.FaxInteractionId\x20IN\x20?',_[_0xfa3c('0x2a')](_0x23cff6,'id'));return db[_0xfa3c('0x91')]['query'](_0x347242['toString'](),_0x2b291f)[_0xfa3c('0x25')](function(_0x46dd17){var _0x4e6547=_[_0xfa3c('0xa8')](_0x46dd17,'FaxInteractionId');var _0x469afa=[];_0x23cff6[_0xfa3c('0x2d')](function(_0x38fea7){_0x469afa['push'](updateFaxInteraction(_0x38fea7,_0x659681,_0x4e6547));});return BPromise[_0xfa3c('0xa9')](_0x469afa);});});})[_0xfa3c('0x25')](function(_0x3a3995){_0x502a45[_0xfa3c('0xaa')]=_0x3a3995;return _0x502a45;})['then'](respondWithFilteredResult(_0x43c8bc,_0x4f1bad))['catch'](handleError(_0x43c8bc,null));};exports[_0xfa3c('0xab')]=function(_0xb6c6e8,_0x3c541c){var _0x2b0452={'raw':![],'where':{'id':_0xb6c6e8[_0xfa3c('0xac')]['id']}},_0x63ac50={};_0x63ac50['model']=_[_0xfa3c('0x37')](db['FaxInteraction']['rawAttributes']);_0x63ac50[_0xfa3c('0x36')]=_[_0xfa3c('0x37')](_0xb6c6e8[_0xfa3c('0x36')]);_0x63ac50['filters']=_['intersection'](_0x63ac50[_0xfa3c('0x3a')],_0x63ac50[_0xfa3c('0x36')]);_0x2b0452[_0xfa3c('0x3b')]=_[_0xfa3c('0x39')](_0x63ac50[_0xfa3c('0x3a')],qs[_0xfa3c('0x3c')](_0xb6c6e8[_0xfa3c('0x36')][_0xfa3c('0x3c')]));_0x2b0452[_0xfa3c('0x3b')]=_0x2b0452[_0xfa3c('0x3b')]['length']?_0x2b0452[_0xfa3c('0x3b')]:_0x63ac50[_0xfa3c('0x3a')];if(_0xb6c6e8[_0xfa3c('0x36')]['includeAll']){_0x2b0452[_0xfa3c('0xad')]=[{'all':!![]}];}_0x2b0452=_[_0xfa3c('0x94')]({},_0x2b0452,_0xb6c6e8[_0xfa3c('0xae')]);return db[_0xfa3c('0x31')][_0xfa3c('0x5b')](_0x2b0452)['then'](handleEntityNotFound(_0x3c541c,null))[_0xfa3c('0x25')](respondWithResult(_0x3c541c,null))[_0xfa3c('0x30')](handleError(_0x3c541c,null));};exports[_0xfa3c('0xaf')]=function(_0x156d34,_0x5537d5){return db[_0xfa3c('0x31')][_0xfa3c('0xaf')](_0x156d34[_0xfa3c('0x6e')],{})[_0xfa3c('0x25')](respondWithResult(_0x5537d5,0xc9))[_0xfa3c('0x30')](handleError(_0x5537d5,null));};exports[_0xfa3c('0x23')]=function(_0x41de79,_0x3811fa){if(_0x41de79[_0xfa3c('0x6e')]['id']){delete _0x41de79[_0xfa3c('0x6e')]['id'];}return db[_0xfa3c('0x31')]['find']({'where':{'id':_0x41de79[_0xfa3c('0xac')]['id']}})['then'](handleEntityNotFound(_0x3811fa,null))[_0xfa3c('0x25')](saveUpdates(_0x41de79[_0xfa3c('0x6e')],null))[_0xfa3c('0x25')](respondWithResult(_0x3811fa,null))[_0xfa3c('0x30')](handleError(_0x3811fa,null));};exports[_0xfa3c('0x24')]=function(_0x396f4d,_0x11a48e){return db[_0xfa3c('0x31')][_0xfa3c('0x5b')]({'where':{'id':_0x396f4d[_0xfa3c('0xac')]['id']}})[_0xfa3c('0x25')](handleEntityNotFound(_0x11a48e,null))[_0xfa3c('0x25')](removeEntity(_0x11a48e,null))[_0xfa3c('0x30')](handleError(_0x11a48e,null));};exports[_0xfa3c('0xb0')]=function(_0x2c5d5c,_0x522390){return db[_0xfa3c('0x31')]['describe']()[_0xfa3c('0x25')](respondWithResult(_0x522390,null))['catch'](handleError(_0x522390,null));};exports['addMessage']=function(_0xc6470e,_0x2dd31b,_0x20de1d){return db[_0xfa3c('0xb1')][_0xfa3c('0x5b')]({'where':{'id':_0xc6470e['params']['id']}})['then'](handleEntityNotFound(_0x2dd31b,null))[_0xfa3c('0x25')](function(_0x3529fb){if(_0x3529fb){return _0x3529fb[_0xfa3c('0xb2')](_0xc6470e[_0xfa3c('0x6e')][_0xfa3c('0xb3')],_[_0xfa3c('0xb4')](_0xc6470e['body'],[_0xfa3c('0xb3'),'id'])||{});}})[_0xfa3c('0x25')](respondWithResult(_0x2dd31b,null))[_0xfa3c('0x30')](handleError(_0x2dd31b,null));};exports[_0xfa3c('0xb5')]=function(_0xc7001e,_0x58f672,_0x2ebe2d){var _0x2c1938={'raw':![],'where':{}};var _0x1a40a5={};var _0x45ab22={'count':0x0,'rows':[]};return db[_0xfa3c('0x31')][_0xfa3c('0xb6')]({'where':{'id':_0xc7001e['params']['id']}})[_0xfa3c('0x25')](handleEntityNotFound(_0x58f672,null))[_0xfa3c('0x25')](function(_0x226d7a){if(_0x226d7a){_0x1a40a5[_0xfa3c('0x3a')]=_[_0xfa3c('0x37')](db[_0xfa3c('0xb1')][_0xfa3c('0x32')]);_0x1a40a5['query']=_[_0xfa3c('0x37')](_0xc7001e['query']);_0x1a40a5[_0xfa3c('0x38')]=_[_0xfa3c('0x39')](_0x1a40a5['model'],_0x1a40a5[_0xfa3c('0x36')]);_0x2c1938[_0xfa3c('0x3b')]=_['intersection'](_0x1a40a5[_0xfa3c('0x3a')],qs[_0xfa3c('0x3c')](_0xc7001e[_0xfa3c('0x36')][_0xfa3c('0x3c')]));_0x2c1938[_0xfa3c('0x3b')]=_0x2c1938['attributes'][_0xfa3c('0x3d')]?_0x2c1938[_0xfa3c('0x3b')]:_0x1a40a5[_0xfa3c('0x3a')];if(!_0xc7001e[_0xfa3c('0x36')][_0xfa3c('0x3e')]('nolimit')){_0x2c1938[_0xfa3c('0x1d')]=qs[_0xfa3c('0x1d')](_0xc7001e[_0xfa3c('0x36')][_0xfa3c('0x1d')]);_0x2c1938[_0xfa3c('0x1b')]=qs[_0xfa3c('0x1b')](_0xc7001e[_0xfa3c('0x36')][_0xfa3c('0x1b')]);}_0x2c1938['order']=qs[_0xfa3c('0x41')](_0xc7001e[_0xfa3c('0x36')]['sort']);_0x2c1938[_0xfa3c('0x42')]=qs[_0xfa3c('0x38')](_[_0xfa3c('0xb7')](_0xc7001e[_0xfa3c('0x36')],_0x1a40a5[_0xfa3c('0x38')]));_0x2c1938[_0xfa3c('0x42')]['FaxInteractionId']=_0x226d7a['id'];if(_0xc7001e[_0xfa3c('0x36')][_0xfa3c('0x7e')]){_0x2c1938[_0xfa3c('0x42')]=_[_0xfa3c('0x94')](_0x2c1938[_0xfa3c('0x42')],{'$or':_[_0xfa3c('0x2a')](_0x2c1938[_0xfa3c('0x3b')],function(_0x1c225d){var _0x382e77={};_0x382e77[_0x1c225d]={'$like':'%'+_0xc7001e['query'][_0xfa3c('0x7e')]+'%'};return _0x382e77;})});}if(_0xc7001e[_0xfa3c('0x36')][_0xfa3c('0xb8')]){var _0x359a9b=_0xc7001e[_0xfa3c('0x36')][_0xfa3c('0xb8')]['split'](',');var _0x503ab1={};_0x503ab1[_0x359a9b[0x0]]={'$gte':moment(_0x359a9b[0x1])['format'](_0xfa3c('0xb9'))};_0x2c1938['where']=_[_0xfa3c('0x94')](_0x2c1938[_0xfa3c('0x42')],_0x503ab1);}_0x2c1938=_[_0xfa3c('0x94')]({},_0x2c1938,_0xc7001e[_0xfa3c('0xae')]);return db[_0xfa3c('0xb1')][_0xfa3c('0x1e')]({'where':_0x2c1938['where']})[_0xfa3c('0x25')](function(_0x57d6f9){_0x45ab22['count']=_0x57d6f9;if(_0xc7001e[_0xfa3c('0x36')][_0xfa3c('0xba')]){_0x2c1938[_0xfa3c('0xad')]=[{'all':!![]}];}return db[_0xfa3c('0xb1')]['findAll'](_0x2c1938);})[_0xfa3c('0x25')](function(_0x4b908f){_0x45ab22[_0xfa3c('0xaa')]=_0x4b908f;return _0x45ab22;});}})[_0xfa3c('0x25')](respondWithFilteredResult(_0x58f672,_0x2c1938))[_0xfa3c('0x30')](handleError(_0x58f672,null));};exports[_0xfa3c('0xbb')]=function(_0xb37807,_0x30e0d5,_0x483a4f){return db[_0xfa3c('0x31')][_0xfa3c('0x5b')]({'where':{'id':_0xb37807[_0xfa3c('0xac')]['id']}})[_0xfa3c('0x25')](handleEntityNotFound(_0x30e0d5,null))['then'](function(_0x207d45){if(_0x207d45){return _0x207d45[_0xfa3c('0xbc')](_0xb37807[_0xfa3c('0x6e')][_0xfa3c('0xb3')],_[_0xfa3c('0xb4')](_0xb37807[_0xfa3c('0x6e')],[_0xfa3c('0xb3'),'id'])||{})[_0xfa3c('0xbd')](function(){return db['Tag']['findAll']({'attributes':['id',_0xfa3c('0x27'),_0xfa3c('0x45')],'where':{'id':_0xb37807[_0xfa3c('0x6e')][_0xfa3c('0xb3')]}});})['then'](function(_0x1b8b60){socket[_0xfa3c('0xbe')](_0xfa3c('0xbf'),{'id':Number(_0xb37807[_0xfa3c('0xac')]['id']),'tags':_0x1b8b60||[]});return{'id':Number(_0xb37807[_0xfa3c('0xac')]['id']),'tags':_0x1b8b60||[]};});}})[_0xfa3c('0x25')](respondWithResult(_0x30e0d5,null))[_0xfa3c('0x30')](handleError(_0x30e0d5,null));};exports[_0xfa3c('0xc0')]=function(_0x5a4a84,_0xfe153,_0x2e3828){return db[_0xfa3c('0x31')]['find']({'where':{'id':_0x5a4a84[_0xfa3c('0xac')]['id']}})[_0xfa3c('0x25')](handleEntityNotFound(_0xfe153,null))['then'](function(_0x11bf39){if(_0x11bf39){return _0x11bf39['removeTags'](_0x5a4a84['query'][_0xfa3c('0xb3')]);}})['then'](respondWithStatusCode(_0xfe153,null))[_0xfa3c('0x30')](handleError(_0xfe153,null));};exports[_0xfa3c('0xc1')]=function(_0x35dfee,_0x2057ba){var _0x5106aa=moment()['unix']()[_0xfa3c('0x92')]();var _0x69a894=path[_0xfa3c('0xc2')](config['root'],_0xfa3c('0xc3'),_0xfa3c('0xc4'),_0xfa3c('0xc5'));var _0x3fae24=path[_0xfa3c('0xc2')](config[_0xfa3c('0xc6')],_0xfa3c('0xc3'),_0xfa3c('0xc4'),_0xfa3c('0xc7'));var _0x683559=path[_0xfa3c('0xc2')](_0x69a894,_0x5106aa);var _0x4566a4=util[_0xfa3c('0xc8')](_0xfa3c('0xc9'),_0x35dfee[_0xfa3c('0xac')]['id'],_0x5106aa);var _0x12dae2=path[_0xfa3c('0xc2')](_0x69a894,_0x4566a4);var _0x1d8d7a=[];_0x1d8d7a[_0xfa3c('0x2e')]({'model':db[_0xfa3c('0xca')],'as':_0xfa3c('0xca'),'raw':!![]});var _0x39dc97=[{'model':db['FaxMessage'],'as':_0xfa3c('0xcb'),'attributes':['id',_0xfa3c('0x6e'),_0xfa3c('0xcc')],'include':_0x1d8d7a}];return db[_0xfa3c('0x31')][_0xfa3c('0x5b')]({'where':{'id':_0x35dfee[_0xfa3c('0xac')]['id']},'include':_0x39dc97})[_0xfa3c('0x25')](handleEntityNotFound(_0x2057ba,null))[_0xfa3c('0x25')](function(_0x2551ee){if(_0x2551ee&&_0x2551ee[_0xfa3c('0xcb')]){var _0x1aeb74=_0x2551ee[_0xfa3c('0xcd')]({'plain':!![]});fs[_0xfa3c('0xce')](_0x683559);for(var _0xf70131=0x0;_0xf70131<_0x1aeb74[_0xfa3c('0xcb')]['length'];_0xf70131++){var _0x101325=_0x1aeb74[_0xfa3c('0xcb')][_0xf70131][_0xfa3c('0xca')];if(_0x101325){var _0x18b9a9=path[_0xfa3c('0xc2')](_0x3fae24,_0x101325[_0xfa3c('0xcf')]);if(fs[_0xfa3c('0xd0')](_0x18b9a9)){fs[_0xfa3c('0xd1')](_0x18b9a9)[_0xfa3c('0xd2')](fs[_0xfa3c('0xd3')](path[_0xfa3c('0xc2')](_0x683559,_0x101325[_0xfa3c('0xcf')])));}}}return BPromise[_0xfa3c('0xd4')]()[_0xfa3c('0x25')](function(){return new BPromise(function(_0x5cb638,_0x491775){zipdir(_0x683559,{'saveTo':_0x12dae2},function(_0x51310a,_0x56b5fa){if(_0x51310a)return _0x491775(_0x51310a);return _0x5cb638(_0x56b5fa);});})[_0xfa3c('0x25')](function(){return new BPromise(function(_0x1c8065,_0x186f3e){rimraf(_0x683559,function(_0x1a12a2){if(_0x1a12a2)_0x186f3e(_0x1a12a2);return _0x1c8065();});});})['then'](function(){return _0x2057ba[_0xfa3c('0xc1')](_0x12dae2,_0x4566a4,function(_0x473ed0){if(_0x473ed0){console[_0xfa3c('0xd5')]('err',_0x473ed0);}else{fs[_0xfa3c('0xd6')](_0x12dae2);}});});});}else{return _0x2057ba[_0xfa3c('0x19')](0xc8);}})[_0xfa3c('0x30')](handleError(_0x2057ba,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index f328db1..4ae8325 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 _0x145c=['remove','getUsers','then','setDataValue','Users','map','unreadMessages','length','emit','hook','exports','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','save'];(function(_0x2c1607,_0x65f591){var _0x30826b=function(_0x480b8c){while(--_0x480b8c){_0x2c1607['push'](_0x2c1607['shift']());}};_0x30826b(++_0x65f591);}(_0x145c,0x13b));var _0xc145=function(_0x47c500,_0x108b42){_0x47c500=_0x47c500-0x0;var _0x2b7656=_0x145c[_0x47c500];return _0x2b7656;};'use strict';var EventEmitter=require('events');var FaxInteraction=require(_0xc145('0x0'))['db'][_0xc145('0x1')];var FaxMessage=require(_0xc145('0x0'))['db'][_0xc145('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xc145('0x3')](0x0);var events={'afterCreate':_0xc145('0x4'),'afterUpdate':'update','afterDestroy':_0xc145('0x5')};function emitEvent(_0x142e76){return function(_0x46cbd3,_0x4ada88,_0x326585){_0x46cbd3[_0xc145('0x6')]({'attributes':['id'],'raw':!![]})[_0xc145('0x7')](function(_0x409f10){_0x46cbd3[_0xc145('0x8')](_0xc145('0x9'),_0x409f10[_0xc145('0xa')](function(_0x5a745a){return{'id':_0x5a745a['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x46cbd3['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x361ea3){_0x46cbd3[_0xc145('0x8')](_0xc145('0xb'),_0x361ea3[_0xc145('0xc')]);FaxInteractionEvents[_0xc145('0xd')](_0x142e76+':'+_0x46cbd3['id'],_0x46cbd3);FaxInteractionEvents[_0xc145('0xd')](_0x142e76,_0x46cbd3);_0x326585(null);})['catch'](_0x326585(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction[_0xc145('0xe')](e,emitEvent(event));}}module[_0xc145('0xf')]=FaxInteractionEvents; \ No newline at end of file +var _0xd109=['hasOwnProperty','exports','../../mysqldb','FaxInteraction','setMaxListeners','save','update','remove','then','setDataValue','Users','length','emit'];(function(_0x56f6c9,_0x341c49){var _0x36d779=function(_0x59e3b8){while(--_0x59e3b8){_0x56f6c9['push'](_0x56f6c9['shift']());}};_0x36d779(++_0x341c49);}(_0xd109,0xab));var _0x9d10=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0xd109[_0x7e2eb0];return _0xd92de4;};'use strict';var EventEmitter=require('events');var FaxInteraction=require(_0x9d10('0x0'))['db'][_0x9d10('0x1')];var FaxMessage=require('../../mysqldb')['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x9d10('0x2')](0x0);var events={'afterCreate':_0x9d10('0x3'),'afterUpdate':_0x9d10('0x4'),'afterDestroy':_0x9d10('0x5')};function emitEvent(_0x5cbd11){return function(_0x1c500c,_0x27bc18,_0x12ef20){_0x1c500c['getUsers']({'attributes':['id'],'raw':!![]})[_0x9d10('0x6')](function(_0x3ea777){_0x1c500c[_0x9d10('0x7')](_0x9d10('0x8'),_0x3ea777['map'](function(_0x1b6963){return{'id':_0x1b6963['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x1c500c['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x4ebb8b){_0x1c500c[_0x9d10('0x7')]('unreadMessages',_0x4ebb8b[_0x9d10('0x9')]);FaxInteractionEvents[_0x9d10('0xa')](_0x5cbd11+':'+_0x1c500c['id'],_0x1c500c);FaxInteractionEvents[_0x9d10('0xa')](_0x5cbd11,_0x1c500c);_0x12ef20(null);})['catch'](_0x12ef20(null));};}for(var e in events){if(events[_0x9d10('0xb')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0x9d10('0xc')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 2d100d0..d8e580d 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 _0xd530=['closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','FaxInteraction','fax_interactions','changed','closed'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0xd530,0x7a));var _0x0d53=function(_0x582e2b,_0x26d132){_0x582e2b=_0x582e2b-0x0;var _0x3cc735=_0xd530[_0x582e2b];return _0x3cc735;};'use strict';var _=require(_0x0d53('0x0'));var util=require('util');var logger=require(_0x0d53('0x1'))(_0x0d53('0x2'));var moment=require(_0x0d53('0x3'));var BPromise=require(_0x0d53('0x4'));var rp=require(_0x0d53('0x5'));var fs=require('fs');var path=require(_0x0d53('0x6'));var rimraf=require(_0x0d53('0x7'));var config=require(_0x0d53('0x8'));var attributes=require('./faxInteraction.attributes');module[_0x0d53('0x9')]=function(_0x6a30d4,_0x495ab1){return _0x6a30d4['define'](_0x0d53('0xa'),attributes,{'tableName':_0x0d53('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1edc3b,_0x2fece9,_0xbc90ec){if(_0x1edc3b[_0x0d53('0xc')](_0x0d53('0xd'))){_0x1edc3b[_0x0d53('0xe')]=moment()[_0x0d53('0xf')](_0x0d53('0x10'));}_0xbc90ec(null,_0x1edc3b);}}});}; \ No newline at end of file +var _0x8d41=['YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./faxInteraction.attributes','define','FaxInteraction','changed','closed','closedAt','format'];(function(_0x5cead4,_0x95c854){var _0x25c561=function(_0x564dec){while(--_0x564dec){_0x5cead4['push'](_0x5cead4['shift']());}};_0x25c561(++_0x95c854);}(_0x8d41,0x1aa));var _0x18d4=function(_0x2eebfa,_0x2b23fd){_0x2eebfa=_0x2eebfa-0x0;var _0xdb8044=_0x8d41[_0x2eebfa];return _0xdb8044;};'use strict';var _=require(_0x18d4('0x0'));var util=require(_0x18d4('0x1'));var logger=require(_0x18d4('0x2'))(_0x18d4('0x3'));var moment=require(_0x18d4('0x4'));var BPromise=require('bluebird');var rp=require(_0x18d4('0x5'));var fs=require('fs');var path=require(_0x18d4('0x6'));var rimraf=require(_0x18d4('0x7'));var config=require(_0x18d4('0x8'));var attributes=require(_0x18d4('0x9'));module['exports']=function(_0xa68ffd,_0x25b129){return _0xa68ffd[_0x18d4('0xa')](_0x18d4('0xb'),attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3948b5,_0x4fc094,_0xdeb406){if(_0x3948b5[_0x18d4('0xc')](_0x18d4('0xd'))){_0x3948b5[_0x18d4('0xe')]=moment()[_0x18d4('0xf')](_0x18d4('0x10'));}_0xdeb406(null,_0x3948b5);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 23a9866..3e13415 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 _0x02a1=['FaxInteraction,\x20%s,\x20%s,\x20%s','error','code','FaxInteraction,\x20%s,\x20%s','message','result','UpdateFaxInteraction','FaxInteraction','update','body','options','raw','where','attributes','limit','stringify','catch','find','addTags','ids','omit','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug'];(function(_0x355041,_0x951ec9){var _0x16b089=function(_0x494192){while(--_0x494192){_0x355041['push'](_0x355041['shift']());}};_0x16b089(++_0x951ec9);}(_0x02a1,0x1a3));var _0x102a=function(_0x1064af,_0x54126f){_0x1064af=_0x1064af-0x0;var _0x1ad5cc=_0x02a1[_0x1064af];return _0x1ad5cc;};'use strict';var _=require('lodash');var util=require(_0x102a('0x0'));var moment=require(_0x102a('0x1'));var BPromise=require(_0x102a('0x2'));var rs=require(_0x102a('0x3'));var fs=require('fs');var Redis=require(_0x102a('0x4'));var db=require(_0x102a('0x5'))['db'];var utils=require(_0x102a('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x102a('0x7'));var jayson=require(_0x102a('0x8'));var client=jayson[_0x102a('0x9')][_0x102a('0xa')]({'port':0x232a});config[_0x102a('0xb')]=_[_0x102a('0xc')](config['redis'],{'host':_0x102a('0xd'),'port':0x18eb});var socket=require(_0x102a('0xe'))(new Redis(config[_0x102a('0xb')]));require('./faxInteraction.socket')[_0x102a('0xf')](socket);function respondWithRpcPromise(_0x533584,_0x4f8cf9,_0x5b57f3){return new BPromise(function(_0x48318c,_0x16c746){return client[_0x102a('0x10')](_0x533584,_0x5b57f3)[_0x102a('0x11')](function(_0x1c0a02){logger[_0x102a('0x12')]('FaxInteraction,\x20%s,\x20%s',_0x4f8cf9,_0x102a('0x13'));logger[_0x102a('0x14')](_0x102a('0x15'),_0x4f8cf9,_0x102a('0x13'),JSON['stringify'](_0x1c0a02));if(_0x1c0a02[_0x102a('0x16')]){if(_0x1c0a02[_0x102a('0x16')][_0x102a('0x17')]===0x1f4){logger[_0x102a('0x16')](_0x102a('0x18'),_0x4f8cf9,_0x1c0a02[_0x102a('0x16')][_0x102a('0x19')]);return _0x16c746(_0x1c0a02[_0x102a('0x16')][_0x102a('0x19')]);}logger[_0x102a('0x16')](_0x102a('0x18'),_0x4f8cf9,_0x1c0a02['error'][_0x102a('0x19')]);return _0x48318c(_0x1c0a02[_0x102a('0x16')][_0x102a('0x19')]);}else{logger[_0x102a('0x12')](_0x102a('0x18'),_0x4f8cf9,_0x102a('0x13'));_0x48318c(_0x1c0a02[_0x102a('0x1a')][_0x102a('0x19')]);}})['catch'](function(_0x26e33a){logger[_0x102a('0x16')]('FaxInteraction,\x20%s,\x20%s',_0x4f8cf9,_0x26e33a);_0x16c746(_0x26e33a);});});}exports[_0x102a('0x1b')]=function(_0x1d8480){var _0x226bc7=this;return new Promise(function(_0x44271e,_0x36e160){return db[_0x102a('0x1c')][_0x102a('0x1d')](_0x1d8480[_0x102a('0x1e')],{'raw':_0x1d8480[_0x102a('0x1f')]?_0x1d8480['options'][_0x102a('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d8480[_0x102a('0x1f')]?_0x1d8480[_0x102a('0x1f')][_0x102a('0x21')]||null:null,'attributes':_0x1d8480[_0x102a('0x1f')]?_0x1d8480[_0x102a('0x1f')][_0x102a('0x22')]||null:null,'limit':_0x1d8480['options']?_0x1d8480[_0x102a('0x1f')][_0x102a('0x23')]||null:null})['then'](function(_0x5addbc){logger['info']('UpdateFaxInteraction',_0x1d8480);logger[_0x102a('0x14')]('UpdateFaxInteraction',_0x1d8480,JSON[_0x102a('0x24')](_0x5addbc));_0x44271e(_0x5addbc);})[_0x102a('0x25')](function(_0x191792){logger[_0x102a('0x16')](_0x102a('0x1b'),_0x191792[_0x102a('0x19')],_0x1d8480);_0x36e160(_0x226bc7[_0x102a('0x16')](0x1f4,_0x191792[_0x102a('0x19')]));});});};exports['AddTagsToFaxInteraction']=function(_0x356af9){return new Promise(function(_0x37bf17,_0x297e5a){return db[_0x102a('0x1c')][_0x102a('0x26')]({'where':_0x356af9['options']?_0x356af9['options'][_0x102a('0x21')]||null:null})['then'](function(_0xc13b14){if(_0xc13b14){return _0xc13b14[_0x102a('0x27')](_0x356af9['body'][_0x102a('0x28')],_[_0x102a('0x29')](_0x356af9['body'],['ids','id'])||{});}})[_0x102a('0x2a')](function(_0x56fa63){logger[_0x102a('0x12')](_0x102a('0x2b'),_0x356af9);logger[_0x102a('0x14')](_0x102a('0x2b'),_0x356af9,JSON['stringify'](_0x56fa63));_0x37bf17(_0x56fa63);})[_0x102a('0x25')](function(_0x5454d1){logger['error'](_0x102a('0x2b'),_0x5454d1['message'],_0x356af9);_0x297e5a(_this[_0x102a('0x16')](0x1f4,_0x5454d1[_0x102a('0x19')]));});});}; \ No newline at end of file +var _0x7934=['http','defaults','redis','localhost','socket.io-emitter','register','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UpdateFaxInteraction','FaxInteraction','body','options','raw','attributes','catch','AddTagsToFaxInteraction','find','where','addTags','ids','omit','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x420cb6,_0x116133){var _0x2a48b2=function(_0x422e72){while(--_0x422e72){_0x420cb6['push'](_0x420cb6['shift']());}};_0x2a48b2(++_0x116133);}(_0x7934,0x1ec));var _0x4793=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7934[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4793('0x0'));var util=require('util');var moment=require(_0x4793('0x1'));var BPromise=require(_0x4793('0x2'));var rs=require(_0x4793('0x3'));var fs=require('fs');var Redis=require(_0x4793('0x4'));var db=require(_0x4793('0x5'))['db'];var utils=require(_0x4793('0x6'));var logger=require(_0x4793('0x7'))(_0x4793('0x8'));var config=require(_0x4793('0x9'));var jayson=require(_0x4793('0xa'));var client=jayson[_0x4793('0xb')][_0x4793('0xc')]({'port':0x232a});config['redis']=_[_0x4793('0xd')](config[_0x4793('0xe')],{'host':_0x4793('0xf'),'port':0x18eb});var socket=require(_0x4793('0x10'))(new Redis(config[_0x4793('0xe')]));require('./faxInteraction.socket')[_0x4793('0x11')](socket);function respondWithRpcPromise(_0x46eacd,_0x2e7fe4,_0xd39901){return new BPromise(function(_0x467523,_0x2a8c3a){return client['request'](_0x46eacd,_0xd39901)[_0x4793('0x12')](function(_0x48f3c1){logger[_0x4793('0x13')](_0x4793('0x14'),_0x2e7fe4,_0x4793('0x15'));logger[_0x4793('0x16')](_0x4793('0x17'),_0x2e7fe4,'request\x20sent',JSON[_0x4793('0x18')](_0x48f3c1));if(_0x48f3c1[_0x4793('0x19')]){if(_0x48f3c1[_0x4793('0x19')][_0x4793('0x1a')]===0x1f4){logger[_0x4793('0x19')](_0x4793('0x14'),_0x2e7fe4,_0x48f3c1[_0x4793('0x19')][_0x4793('0x1b')]);return _0x2a8c3a(_0x48f3c1[_0x4793('0x19')][_0x4793('0x1b')]);}logger['error'](_0x4793('0x14'),_0x2e7fe4,_0x48f3c1[_0x4793('0x19')][_0x4793('0x1b')]);return _0x467523(_0x48f3c1[_0x4793('0x19')][_0x4793('0x1b')]);}else{logger[_0x4793('0x13')](_0x4793('0x14'),_0x2e7fe4,_0x4793('0x15'));_0x467523(_0x48f3c1['result']['message']);}})['catch'](function(_0x4ef84e){logger[_0x4793('0x19')](_0x4793('0x14'),_0x2e7fe4,_0x4ef84e);_0x2a8c3a(_0x4ef84e);});});}exports[_0x4793('0x1c')]=function(_0x1d5a07){var _0x21012d=this;return new Promise(function(_0x46773d,_0x110bdc){return db[_0x4793('0x1d')]['update'](_0x1d5a07[_0x4793('0x1e')],{'raw':_0x1d5a07[_0x4793('0x1f')]?_0x1d5a07[_0x4793('0x1f')][_0x4793('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d5a07['options']?_0x1d5a07[_0x4793('0x1f')]['where']||null:null,'attributes':_0x1d5a07[_0x4793('0x1f')]?_0x1d5a07['options'][_0x4793('0x21')]||null:null,'limit':_0x1d5a07[_0x4793('0x1f')]?_0x1d5a07[_0x4793('0x1f')]['limit']||null:null})[_0x4793('0x12')](function(_0x1fcc21){logger[_0x4793('0x13')](_0x4793('0x1c'),_0x1d5a07);logger[_0x4793('0x16')](_0x4793('0x1c'),_0x1d5a07,JSON['stringify'](_0x1fcc21));_0x46773d(_0x1fcc21);})[_0x4793('0x22')](function(_0x41717d){logger[_0x4793('0x19')]('UpdateFaxInteraction',_0x41717d['message'],_0x1d5a07);_0x110bdc(_0x21012d[_0x4793('0x19')](0x1f4,_0x41717d[_0x4793('0x1b')]));});});};exports[_0x4793('0x23')]=function(_0x127d20){return new Promise(function(_0x2895a9,_0x4e26c5){return db[_0x4793('0x1d')][_0x4793('0x24')]({'where':_0x127d20[_0x4793('0x1f')]?_0x127d20[_0x4793('0x1f')][_0x4793('0x25')]||null:null})['then'](function(_0x706e6a){if(_0x706e6a){return _0x706e6a[_0x4793('0x26')](_0x127d20[_0x4793('0x1e')][_0x4793('0x27')],_[_0x4793('0x28')](_0x127d20[_0x4793('0x1e')],[_0x4793('0x27'),'id'])||{});}})['spread'](function(_0x46438d){logger['info'](_0x4793('0x29'),_0x127d20);logger['debug'](_0x4793('0x29'),_0x127d20,JSON[_0x4793('0x18')](_0x46438d));_0x2895a9(_0x46438d);})[_0x4793('0x22')](function(_0x3d0348){logger[_0x4793('0x19')](_0x4793('0x29'),_0x3d0348[_0x4793('0x1b')],_0x127d20);_0x4e26c5(_this[_0x4793('0x19')](0x1f4,_0x3d0348['message']));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index f0cf0e2..a91cb3c 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 _0xc286=['remove','emit','removeListener','register','faxInteraction:','save'];(function(_0x349449,_0x407a2f){var _0x4025ff=function(_0x47731d){while(--_0x47731d){_0x349449['push'](_0x349449['shift']());}};_0x4025ff(++_0x407a2f);}(_0xc286,0xfb));var _0x6c28=function(_0x588d7f,_0x129444){_0x588d7f=_0x588d7f-0x0;var _0x447659=_0xc286[_0x588d7f];return _0x447659;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0x6c28('0x0'),_0x6c28('0x1'),'update'];function createListener(_0x3fdb82,_0x4770f3){return function(_0x4f74cc){_0x4770f3[_0x6c28('0x2')](_0x3fdb82,_0x4f74cc);};}function removeListener(_0x2ca5d8,_0x32c7b9){return function(){FaxInteractionEvents[_0x6c28('0x3')](_0x2ca5d8,_0x32c7b9);};}exports[_0x6c28('0x4')]=function(_0x1969df){for(var _0x10f20a=0x0,_0x184f5b=events['length'];_0x10f20a<_0x184f5b;_0x10f20a++){var _0x4c292d=events[_0x10f20a];var _0x49766f=createListener(_0x6c28('0x5')+_0x4c292d,_0x1969df);FaxInteractionEvents['on'](_0x4c292d,_0x49766f);}}; \ No newline at end of file +var _0x5129=['./faxInteraction.events','remove','update','register','length','faxInteraction:'];(function(_0x186376,_0x5d988a){var _0x2dbdd9=function(_0x96908e){while(--_0x96908e){_0x186376['push'](_0x186376['shift']());}};_0x2dbdd9(++_0x5d988a);}(_0x5129,0x11a));var _0x9512=function(_0x26b450,_0x376bd4){_0x26b450=_0x26b450-0x0;var _0x31f267=_0x5129[_0x26b450];return _0x31f267;};'use strict';var FaxInteractionEvents=require(_0x9512('0x0'));var events=['save',_0x9512('0x1'),_0x9512('0x2')];function createListener(_0x57f75b,_0x27a848){return function(_0x2789c5){_0x27a848['emit'](_0x57f75b,_0x2789c5);};}function removeListener(_0x37925b,_0x59a6cc){return function(){FaxInteractionEvents['removeListener'](_0x37925b,_0x59a6cc);};}exports[_0x9512('0x3')]=function(_0x54e0dd){for(var _0x2e8a4e=0x0,_0x1374a3=events[_0x9512('0x4')];_0x2e8a4e<_0x1374a3;_0x2e8a4e++){var _0x23a18c=events[_0x2e8a4e];var _0x5dc145=createListener(_0x9512('0x5')+_0x23a18c,_0x54e0dd);FaxInteractionEvents['on'](_0x23a18c,_0x5dc145);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 57a6bd5..96d50a5 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 _0xb0b7=['addTags','put','faxinteraction:update','update','delete','faxinteraction:destroy','destroy','/:id/tags','removeTags','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','addMessage','tracked','fax','faxinteraction:addtags'];(function(_0x63dcd1,_0x3703d5){var _0x1bc9a9=function(_0x3db511){while(--_0x3db511){_0x63dcd1['push'](_0x63dcd1['shift']());}};_0x1bc9a9(++_0x3703d5);}(_0xb0b7,0x196));var _0x7b0b=function(_0x3c8073,_0x23a0b6){_0x3c8073=_0x3c8073-0x0;var _0xc7e0b8=_0xb0b7[_0x3c8073];return _0xc7e0b8;};'use strict';var multer=require(_0x7b0b('0x0'));var util=require('util');var path=require(_0x7b0b('0x1'));var timeout=require('connect-timeout');var express=require(_0x7b0b('0x2'));var router=express[_0x7b0b('0x3')]();var fs_extra=require(_0x7b0b('0x4'));var auth=require(_0x7b0b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7b0b('0x6'));var controller=require(_0x7b0b('0x7'));router[_0x7b0b('0x8')]('/',auth[_0x7b0b('0x9')](),controller[_0x7b0b('0xa')]);router[_0x7b0b('0x8')]('/describe',auth[_0x7b0b('0x9')](),controller[_0x7b0b('0xb')]);router[_0x7b0b('0x8')](_0x7b0b('0xc'),auth[_0x7b0b('0x9')](),controller[_0x7b0b('0xd')]);router['get'](_0x7b0b('0xe'),auth['isAuthenticated'](),controller[_0x7b0b('0xf')]);router[_0x7b0b('0x8')](_0x7b0b('0x10'),auth['isAuthenticated'](),controller[_0x7b0b('0x11')]);router[_0x7b0b('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0x7b0b('0x12')](_0x7b0b('0xe'),auth['isAuthenticated'](),controller[_0x7b0b('0x13')]);router[_0x7b0b('0x12')]('/:id/tags',auth[_0x7b0b('0x9')](),interaction[_0x7b0b('0x14')](_0x7b0b('0x15'),_0x7b0b('0x16')),controller[_0x7b0b('0x17')]);router[_0x7b0b('0x18')](_0x7b0b('0xc'),auth[_0x7b0b('0x9')](),interaction['tracked']('fax',_0x7b0b('0x19')),controller[_0x7b0b('0x1a')]);router[_0x7b0b('0x1b')](_0x7b0b('0xc'),auth['isAuthenticated'](),interaction[_0x7b0b('0x14')](_0x7b0b('0x15'),_0x7b0b('0x1c')),controller[_0x7b0b('0x1d')]);router[_0x7b0b('0x1b')](_0x7b0b('0x1e'),auth[_0x7b0b('0x9')](),controller[_0x7b0b('0x1f')]);module[_0x7b0b('0x20')]=router; \ No newline at end of file +var _0x6f93=['tracked','fax','faxinteraction:addtags','addTags','put','faxinteraction:update','update','delete','destroy','removeTags','exports','multer','util','path','connect-timeout','fs-extra','../../config/environment','./faxInteraction.controller','get','isAuthenticated','/describe','describe','/:id','/:id/messages','getMessages','post','addMessage','/:id/tags'];(function(_0x42f009,_0x5e27b1){var _0x22a1e0=function(_0x297993){while(--_0x297993){_0x42f009['push'](_0x42f009['shift']());}};_0x22a1e0(++_0x5e27b1);}(_0x6f93,0xb3));var _0x36f9=function(_0x281950,_0x1e11b0){_0x281950=_0x281950-0x0;var _0x3bb4ef=_0x6f93[_0x281950];return _0x3bb4ef;};'use strict';var multer=require(_0x36f9('0x0'));var util=require(_0x36f9('0x1'));var path=require(_0x36f9('0x2'));var timeout=require(_0x36f9('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x36f9('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x36f9('0x5'));var controller=require(_0x36f9('0x6'));router[_0x36f9('0x7')]('/',auth[_0x36f9('0x8')](),controller['index']);router['get'](_0x36f9('0x9'),auth['isAuthenticated'](),controller[_0x36f9('0xa')]);router[_0x36f9('0x7')](_0x36f9('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x36f9('0x7')](_0x36f9('0xc'),auth[_0x36f9('0x8')](),controller[_0x36f9('0xd')]);router[_0x36f9('0x7')]('/:id/download',auth['isAuthenticated'](),controller['download']);router[_0x36f9('0xe')]('/',auth[_0x36f9('0x8')](),controller['create']);router[_0x36f9('0xe')](_0x36f9('0xc'),auth[_0x36f9('0x8')](),controller[_0x36f9('0xf')]);router[_0x36f9('0xe')](_0x36f9('0x10'),auth[_0x36f9('0x8')](),interaction[_0x36f9('0x11')](_0x36f9('0x12'),_0x36f9('0x13')),controller[_0x36f9('0x14')]);router[_0x36f9('0x15')]('/:id',auth[_0x36f9('0x8')](),interaction['tracked'](_0x36f9('0x12'),_0x36f9('0x16')),controller[_0x36f9('0x17')]);router[_0x36f9('0x18')]('/:id',auth[_0x36f9('0x8')](),interaction[_0x36f9('0x11')](_0x36f9('0x12'),'faxinteraction:destroy'),controller[_0x36f9('0x19')]);router['delete'](_0x36f9('0x10'),auth['isAuthenticated'](),controller[_0x36f9('0x1a')]);module[_0x36f9('0x1b')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index cc57ee5..98557f5 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 _0x9221=['BOOLEAN','ENUM','out','DATE','exports','TEXT'];(function(_0x564324,_0x218522){var _0x102d59=function(_0x2b97ce){while(--_0x2b97ce){_0x564324['push'](_0x564324['shift']());}};_0x102d59(++_0x218522);}(_0x9221,0x64));var _0x1922=function(_0x35201e,_0x34341b){_0x35201e=_0x35201e-0x0;var _0x4bc5b7=_0x9221[_0x35201e];return _0x4bc5b7;};'use strict';var Sequelize=require('sequelize');module[_0x1922('0x0')]={'body':{'type':Sequelize[_0x1922('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x1922('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x1922('0x3')]('in','out'),'defaultValue':_0x1922('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x1922('0x1')],'defaultValue':null},'readAt':{'type':Sequelize[_0x1922('0x5')]}}; \ No newline at end of file +var _0x8bdf=['BOOLEAN','out','DATE','sequelize','exports','TEXT','medium'];(function(_0x3f4ab8,_0x5f1d14){var _0x4c7577=function(_0x3e02cd){while(--_0x3e02cd){_0x3f4ab8['push'](_0x3f4ab8['shift']());}};_0x4c7577(++_0x5f1d14);}(_0x8bdf,0x1a7));var _0xf8bd=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x8bdf[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0xf8bd('0x0'));module[_0xf8bd('0x1')]={'body':{'type':Sequelize[_0xf8bd('0x2')](_0xf8bd('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xf8bd('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xf8bd('0x5')),'defaultValue':_0xf8bd('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xf8bd('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0xf8bd('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 508bb02..6ae195b 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 _0x1c81=['util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','http','request','then','info','FaxMessage,\x20%s,\x20%s','debug','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','FaxMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','intersection','length','include','find','body','fax-interactions','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','FaxInteractionId','isNil','read1stAt','format','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','User','agent','fullname','email','SIP/%s','channel','motionChannel','event','EventManager','fax','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','contact','internal','interface','rejectmessage','create','findOne','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','join','root','files','attachments','eml-format','fast-json-patch','request-promise'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x1c81,0x8b));var _0x11c8=function(_0xbc59be,_0xcee41a){_0xbc59be=_0xbc59be-0x0;var _0x5a64a8=_0x1c81[_0xbc59be];return _0x5a64a8;};'use strict';var emlformat=require(_0x11c8('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x11c8('0x1'));var rp=require(_0x11c8('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x11c8('0x3'));var path=require(_0x11c8('0x4'));var sox=require('sox');var csv=require(_0x11c8('0x5'));var ejs=require(_0x11c8('0x6'));var fs=require('fs');var fs_extra=require(_0x11c8('0x7'));var _=require(_0x11c8('0x8'));var squel=require(_0x11c8('0x9'));var crypto=require(_0x11c8('0xa'));var jsforce=require(_0x11c8('0xb'));var deskjs=require(_0x11c8('0xc'));var toCsv=require(_0x11c8('0x5'));var querystring=require(_0x11c8('0xd'));var Papa=require(_0x11c8('0xe'));var Redis=require(_0x11c8('0xf'));var authService=require(_0x11c8('0x10'));var qs=require(_0x11c8('0x11'));var as=require(_0x11c8('0x12'));var hardwareService=require(_0x11c8('0x13'));var logger=require(_0x11c8('0x14'))(_0x11c8('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x11c8('0x16'));var db=require(_0x11c8('0x17'))['db'];config[_0x11c8('0x18')]=_[_0x11c8('0x19')](config[_0x11c8('0x18')],{'host':_0x11c8('0x1a'),'port':0x18eb});var socket=require(_0x11c8('0x1b'))(new Redis(config[_0x11c8('0x18')]));require('./faxMessage.socket')[_0x11c8('0x1c')](socket);var jayson=require(_0x11c8('0x1d'));var client=jayson['client'][_0x11c8('0x1e')]({'port':0x232c});var client9002=jayson['client'][_0x11c8('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x41e482,_0x20743c,_0x1b4be4,_0x54a414){return new BPromise(function(_0x5425df,_0x2a90ae){var _0x3e0459=_0x54a414||client;return _0x3e0459[_0x11c8('0x1f')](_0x41e482,_0x1b4be4)[_0x11c8('0x20')](function(_0x516467){logger[_0x11c8('0x21')](_0x11c8('0x22'),_0x20743c,'request\x20sent');logger[_0x11c8('0x23')](_0x11c8('0x24'),_0x20743c,_0x11c8('0x25'),JSON['stringify'](_0x516467));if(_0x516467[_0x11c8('0x26')]){if(_0x516467['error']['code']===0x1f4){logger[_0x11c8('0x26')](_0x11c8('0x22'),_0x20743c,_0x516467['error'][_0x11c8('0x27')]);return _0x2a90ae(_0x516467['error']['message']);}logger['error']('FaxMessage,\x20%s,\x20%s',_0x20743c,_0x516467['error'][_0x11c8('0x27')]);return _0x5425df(_0x516467[_0x11c8('0x26')][_0x11c8('0x27')]);}else{logger[_0x11c8('0x21')](_0x11c8('0x22'),_0x20743c,'request\x20sent');_0x5425df(_0x516467['result'][_0x11c8('0x27')]);}})[_0x11c8('0x28')](function(_0x14ba43){logger[_0x11c8('0x26')](_0x11c8('0x22'),_0x20743c,_0x14ba43);_0x2a90ae(_0x14ba43);});});}function respondWithStatusCode(_0xdfb8b3,_0x5ccbfb){_0x5ccbfb=_0x5ccbfb||0xcc;return function(_0x19d493){if(_0x19d493){return _0xdfb8b3[_0x11c8('0x29')](_0x5ccbfb);}return _0xdfb8b3[_0x11c8('0x2a')](_0x5ccbfb)[_0x11c8('0x2b')]();};}function respondWithResult(_0x5c61e5,_0x2a8108){_0x2a8108=_0x2a8108||0xc8;return function(_0x18b038){if(_0x18b038){return _0x5c61e5[_0x11c8('0x2a')](_0x2a8108)[_0x11c8('0x2c')](_0x18b038);}};}function respondWithFilteredResult(_0x554636,_0x487faa){return function(_0x5c1e39){if(_0x5c1e39){var _0xb8a9c5=typeof _0x487faa[_0x11c8('0x2d')]===_0x11c8('0x2e')&&typeof _0x487faa[_0x11c8('0x2f')]==='undefined';var _0x4d0f84=_0x5c1e39[_0x11c8('0x30')];var _0x552b90=_0xb8a9c5?0x0:_0x487faa[_0x11c8('0x2d')];var _0x568371=_0xb8a9c5?_0x5c1e39[_0x11c8('0x30')]:_0x487faa['offset']+_0x487faa['limit'];var _0x280fae;if(_0x568371>=_0x4d0f84){_0x568371=_0x4d0f84;_0x280fae=0xc8;}else{_0x280fae=0xce;}_0x554636[_0x11c8('0x2a')](_0x280fae);return _0x554636[_0x11c8('0x31')](_0x11c8('0x32'),_0x552b90+'-'+_0x568371+'/'+_0x4d0f84)[_0x11c8('0x2c')](_0x5c1e39);}return null;};}function patchUpdates(_0x7400fb){return function(_0x331489){try{jsonpatch[_0x11c8('0x33')](_0x331489,_0x7400fb,!![]);}catch(_0x3fec45){return BPromise[_0x11c8('0x34')](_0x3fec45);}return _0x331489[_0x11c8('0x35')]();};}function saveUpdates(_0x32c40c,_0xfa6e4f){return function(_0x2957db){if(_0x2957db){return _0x2957db[_0x11c8('0x36')](_0x32c40c)[_0x11c8('0x20')](function(_0x433cd7){return _0x433cd7;});}return null;};}function removeEntity(_0x33311e,_0x42eaa2){return function(_0x342909){if(_0x342909){return _0x342909[_0x11c8('0x37')]()['then'](function(){_0x33311e[_0x11c8('0x2a')](0xcc)[_0x11c8('0x2b')]();});}};}function handleEntityNotFound(_0x5ca398,_0x2ded09){return function(_0x125f30){if(!_0x125f30){_0x5ca398['sendStatus'](0x194);}return _0x125f30;};}function handleError(_0x1fb4b8,_0x3dd1c2){_0x3dd1c2=_0x3dd1c2||0x1f4;return function(_0x50943a){logger[_0x11c8('0x26')](_0x50943a[_0x11c8('0x38')]);if(_0x50943a[_0x11c8('0x39')]){delete _0x50943a[_0x11c8('0x39')];}_0x1fb4b8[_0x11c8('0x2a')](_0x3dd1c2)[_0x11c8('0x3a')](_0x50943a);};}exports[_0x11c8('0x3b')]=function(_0x23bfc5,_0x49958d){var _0x265f1d={},_0x180529={},_0x39f12b={'count':0x0,'rows':[]};var _0x456dba=_[_0x11c8('0x3c')](db[_0x11c8('0x3d')][_0x11c8('0x3e')],function(_0x19d976){return{'name':_0x19d976[_0x11c8('0x3f')],'type':_0x19d976[_0x11c8('0x40')][_0x11c8('0x41')]};});_0x180529[_0x11c8('0x42')]=_[_0x11c8('0x3c')](_0x456dba,_0x11c8('0x39'));_0x180529[_0x11c8('0x43')]=_[_0x11c8('0x44')](_0x23bfc5['query']);_0x180529[_0x11c8('0x45')]=_['intersection'](_0x180529[_0x11c8('0x42')],_0x180529['query']);_0x265f1d[_0x11c8('0x46')]=_['intersection'](_0x180529[_0x11c8('0x42')],qs[_0x11c8('0x47')](_0x23bfc5[_0x11c8('0x43')][_0x11c8('0x47')]));_0x265f1d[_0x11c8('0x46')]=_0x265f1d[_0x11c8('0x46')]['length']?_0x265f1d[_0x11c8('0x46')]:_0x180529[_0x11c8('0x42')];if(!_0x23bfc5[_0x11c8('0x43')]['hasOwnProperty'](_0x11c8('0x48'))){_0x265f1d[_0x11c8('0x2f')]=qs[_0x11c8('0x2f')](_0x23bfc5[_0x11c8('0x43')][_0x11c8('0x2f')]);_0x265f1d['offset']=qs[_0x11c8('0x2d')](_0x23bfc5[_0x11c8('0x43')][_0x11c8('0x2d')]);}_0x265f1d['order']=qs['sort'](_0x23bfc5[_0x11c8('0x43')][_0x11c8('0x49')]);_0x265f1d[_0x11c8('0x4a')]=qs['filters'](_[_0x11c8('0x4b')](_0x23bfc5['query'],_0x180529[_0x11c8('0x45')]),_0x456dba);if(_0x23bfc5[_0x11c8('0x43')][_0x11c8('0x4c')]){_0x265f1d[_0x11c8('0x4a')]=_[_0x11c8('0x4d')](_0x265f1d[_0x11c8('0x4a')],{'$or':_[_0x11c8('0x3c')](_0x456dba,function(_0x2a03a2){if(_0x2a03a2[_0x11c8('0x40')]!==_0x11c8('0x4e')){var _0x150daa={};_0x150daa[_0x2a03a2[_0x11c8('0x39')]]={'$like':'%'+_0x23bfc5[_0x11c8('0x43')][_0x11c8('0x4c')]+'%'};return _0x150daa;}})});}_0x265f1d=_['merge']({},_0x265f1d,_0x23bfc5[_0x11c8('0x4f')]);var _0x1143e1={'where':_0x265f1d[_0x11c8('0x4a')]};return db['FaxMessage']['count'](_0x1143e1)['then'](function(_0x52c7f6){_0x39f12b[_0x11c8('0x30')]=_0x52c7f6;if(_0x23bfc5[_0x11c8('0x43')][_0x11c8('0x50')]){_0x265f1d['include']=[{'all':!![]}];}return db[_0x11c8('0x3d')][_0x11c8('0x51')](_0x265f1d);})[_0x11c8('0x20')](function(_0x226c53){_0x39f12b[_0x11c8('0x52')]=_0x226c53;return _0x39f12b;})[_0x11c8('0x20')](respondWithFilteredResult(_0x49958d,_0x265f1d))['catch'](handleError(_0x49958d,null));};exports[_0x11c8('0x53')]=function(_0x4072fb,_0x184f00){var _0x3b10fb={'raw':!![],'where':{'id':_0x4072fb[_0x11c8('0x54')]['id']}},_0x6c34a4={};_0x6c34a4[_0x11c8('0x42')]=_[_0x11c8('0x44')](db[_0x11c8('0x3d')]['rawAttributes']);_0x6c34a4[_0x11c8('0x43')]=_[_0x11c8('0x44')](_0x4072fb['query']);_0x6c34a4[_0x11c8('0x45')]=_[_0x11c8('0x55')](_0x6c34a4[_0x11c8('0x42')],_0x6c34a4['query']);_0x3b10fb['attributes']=_[_0x11c8('0x55')](_0x6c34a4['model'],qs[_0x11c8('0x47')](_0x4072fb['query']['fields']));_0x3b10fb[_0x11c8('0x46')]=_0x3b10fb[_0x11c8('0x46')][_0x11c8('0x56')]?_0x3b10fb['attributes']:_0x6c34a4[_0x11c8('0x42')];if(_0x4072fb[_0x11c8('0x43')][_0x11c8('0x50')]){_0x3b10fb[_0x11c8('0x57')]=[{'all':!![]}];}_0x3b10fb=_['merge']({},_0x3b10fb,_0x4072fb[_0x11c8('0x4f')]);return db[_0x11c8('0x3d')][_0x11c8('0x58')](_0x3b10fb)[_0x11c8('0x20')](handleEntityNotFound(_0x184f00,null))['then'](respondWithResult(_0x184f00,null))['catch'](handleError(_0x184f00,null));};exports[_0x11c8('0x36')]=function(_0x2acd83,_0x293ee7){if(_0x2acd83[_0x11c8('0x59')]['id']){delete _0x2acd83['body']['id'];}return db[_0x11c8('0x3d')]['find']({'where':{'id':_0x2acd83[_0x11c8('0x54')]['id']}})[_0x11c8('0x20')](handleEntityNotFound(_0x293ee7,null))[_0x11c8('0x20')](saveUpdates(_0x2acd83['body'],null))[_0x11c8('0x20')](respondWithResult(_0x293ee7,null))['catch'](handleError(_0x293ee7,null));};exports['destroy']=function(_0x1971c1,_0x272d0b){return db[_0x11c8('0x3d')][_0x11c8('0x58')]({'where':{'id':_0x1971c1['params']['id']}})['then'](handleEntityNotFound(_0x272d0b,null))[_0x11c8('0x20')](removeEntity(_0x272d0b,null))[_0x11c8('0x28')](handleError(_0x272d0b,null));};exports['describe']=function(_0x295aac,_0x2f3101){return db[_0x11c8('0x3d')]['describe']()[_0x11c8('0x20')](respondWithResult(_0x2f3101,null))[_0x11c8('0x28')](handleError(_0x2f3101,null));};var interaction_log=require(_0x11c8('0x14'))(_0x11c8('0x5a'));exports['accept']=function(_0x37c343,_0x402132,_0x176cf3){var _0x4acc98={'agent':{},'channel':'fax'};if(_0x37c343[_0x11c8('0x59')]['id']){delete _0x37c343[_0x11c8('0x59')]['id'];}_0x37c343[_0x11c8('0x59')][_0x11c8('0x5b')]=!![];_0x37c343[_0x11c8('0x59')][_0x11c8('0x5c')]=moment()['format'](_0x11c8('0x5d'));_0x37c343[_0x11c8('0x59')][_0x11c8('0x5e')]=_0x37c343['body']['UserId']||_0x37c343[_0x11c8('0x5f')]['id'];_0x4acc98['agent']['id']=_0x37c343[_0x11c8('0x59')][_0x11c8('0x5e')];return db[_0x11c8('0x3d')][_0x11c8('0x58')]({'where':{'id':_0x37c343[_0x11c8('0x54')]['id'],'UserId':null}})[_0x11c8('0x20')](handleEntityNotFound(_0x402132,null))[_0x11c8('0x20')](saveUpdates(_0x37c343[_0x11c8('0x59')],null))['then'](function(_0x1be498){if(_0x1be498){_0x4acc98[_0x11c8('0x27')]=_0x1be498[_0x11c8('0x60')]({'plain':!![]});return db['FaxInteraction']['find']({'where':{'id':_0x1be498[_0x11c8('0x61')]}});}return null;})['then'](handleEntityNotFound(_0x402132,null))[_0x11c8('0x20')](function(_0x5178b6){if(_0x5178b6){return _0x5178b6[_0x11c8('0x36')]({'UserId':_0x37c343['body'][_0x11c8('0x5e')],'read1stAt':_[_0x11c8('0x62')](_0x5178b6[_0x11c8('0x63')])?moment()[_0x11c8('0x64')](_0x11c8('0x5d')):undefined});}return null;})[_0x11c8('0x20')](function(_0x3dbb2c){if(_0x3dbb2c){_0x4acc98[_0x11c8('0x65')]=_0x3dbb2c[_0x11c8('0x60')]({'plain':!![]});interaction_log[_0x11c8('0x21')](_0x11c8('0x66'),_0x37c343[_0x11c8('0x5f')]['id'],_0x37c343['user']['name'],_0x37c343[_0x11c8('0x5f')]['role'],_0x4acc98[_0x11c8('0x65')]['id'],_0x37c343[_0x11c8('0x59')]?JSON[_0x11c8('0x67')](_0x37c343[_0x11c8('0x59')]):_0x11c8('0x68'));return respondWithRpcPromise(_0x11c8('0x69'),_0x11c8('0x6a'),_0x4acc98);}return null;})[_0x11c8('0x20')](function(_0x329308){var _0x4cc67f=_0x11c8('0x6b')+_0x329308[_0x11c8('0x27')][_0x11c8('0x6c')];return db[_0x11c8('0x6d')][_0x11c8('0x43')](_0x4cc67f,{'type':db[_0x11c8('0x6e')][_0x11c8('0x6f')][_0x11c8('0x70')],'raw':!![]})[_0x11c8('0x20')](function(_0x1dcd08){return _0x1dcd08;});})[_0x11c8('0x20')](function(_0x58e9fe){if(_0x58e9fe){_0x4acc98[_0x11c8('0x27')]['contact']=_0x58e9fe[0x0];if(!_0x37c343[_0x11c8('0x59')][_0x11c8('0x5e')])return;return db[_0x11c8('0x71')]['find']({'where':{'id':_0x37c343[_0x11c8('0x59')][_0x11c8('0x5e')],'role':_0x11c8('0x72')},'attributes':['id',_0x11c8('0x39'),_0x11c8('0x73'),_0x11c8('0x74'),'internal'],'raw':!![]});}return null;})[_0x11c8('0x20')](function(_0x409f7f){if(!_0x409f7f)return null;_0x4acc98[_0x11c8('0x27')][_0x11c8('0x72')]=_0x409f7f;return _0x4acc98;})[_0x11c8('0x20')](function(_0x136e01){if(_0x136e01){if(_0x37c343[_0x11c8('0x59')]['manual']){_0x4acc98[_0x11c8('0x27')]['interface']=util[_0x11c8('0x64')](_0x11c8('0x75'),_0x37c343[_0x11c8('0x5f')][_0x11c8('0x39')]);_0x4acc98[_0x11c8('0x27')][_0x11c8('0x76')]=_0x4acc98[_0x11c8('0x76')];_0x4acc98[_0x11c8('0x27')][_0x11c8('0x77')]=_0x4acc98[_0x11c8('0x76')];_0x4acc98[_0x11c8('0x27')][_0x11c8('0x78')]='accept';return respondWithRpcPromise(_0x11c8('0x79'),_0x11c8('0x79'),{'event':'acceptmessage','message':_0x4acc98[_0x11c8('0x27')]},client9002)[_0x11c8('0x20')](function(){return _0x4acc98;});}return _0x4acc98;}return null;})[_0x11c8('0x20')](respondWithResult(_0x402132,null))['catch'](handleError(_0x402132,null));};var interaction_log=require('../../config/logger')(_0x11c8('0x5a'));exports[_0x11c8('0x34')]=function(_0x1c509d,_0x72e2a1,_0x39e665){var _0x4a6bc5={'agent':{},'channel':_0x11c8('0x7a')};if(_0x1c509d[_0x11c8('0x59')]['id']){delete _0x1c509d[_0x11c8('0x59')]['id'];}_0x1c509d[_0x11c8('0x59')][_0x11c8('0x5e')]=_0x1c509d[_0x11c8('0x59')][_0x11c8('0x5e')]||_0x1c509d['user']['id'];_0x4a6bc5[_0x11c8('0x72')]['id']=_0x1c509d[_0x11c8('0x59')][_0x11c8('0x5e')];return db[_0x11c8('0x3d')]['find']({'where':{'id':_0x1c509d['params']['id'],'UserId':null}})[_0x11c8('0x20')](handleEntityNotFound(_0x72e2a1,null))[_0x11c8('0x20')](function(_0x42ffad){if(_0x42ffad){_0x4a6bc5[_0x11c8('0x27')]=_0x42ffad[_0x11c8('0x60')]({'plain':!![]});return db['FaxInteraction'][_0x11c8('0x58')]({'where':{'id':_0x42ffad[_0x11c8('0x61')]}});}return null;})[_0x11c8('0x20')](handleEntityNotFound(_0x72e2a1,null))['then'](function(_0x121459){if(_0x121459){_0x4a6bc5['interaction']=_0x121459[_0x11c8('0x60')]({'plain':!![]});interaction_log[_0x11c8('0x21')](_0x11c8('0x7b'),_0x1c509d[_0x11c8('0x5f')]['id'],_0x1c509d['user'][_0x11c8('0x39')],_0x1c509d[_0x11c8('0x5f')]['role'],_0x4a6bc5[_0x11c8('0x65')]['id'],_0x1c509d[_0x11c8('0x59')]?JSON['stringify'](_0x1c509d[_0x11c8('0x59')]):_0x11c8('0x68'));return respondWithRpcPromise('RejectMessage',_0x11c8('0x7c'),_0x4a6bc5);}return null;})[_0x11c8('0x20')](function(_0x5cd644){var _0x5b18d1=_0x11c8('0x6b')+_0x5cd644[_0x11c8('0x27')]['ContactId'];return db['sequelize'][_0x11c8('0x43')](_0x5b18d1,{'type':db['Sequelize']['QueryTypes'][_0x11c8('0x70')],'raw':!![]})[_0x11c8('0x20')](function(_0x26ff8c){return _0x26ff8c;});})['then'](function(_0xccc576){if(_0xccc576){_0x4a6bc5[_0x11c8('0x27')][_0x11c8('0x7d')]=_0xccc576[0x0];if(!_0x1c509d[_0x11c8('0x59')][_0x11c8('0x5e')])return;return db['User'][_0x11c8('0x58')]({'where':{'id':_0x1c509d[_0x11c8('0x59')][_0x11c8('0x5e')],'role':'agent'},'attributes':['id',_0x11c8('0x39'),_0x11c8('0x73'),_0x11c8('0x74'),_0x11c8('0x7e')],'raw':!![]});}return null;})[_0x11c8('0x20')](function(_0x3ecf83){if(!_0x3ecf83)return null;_0x4a6bc5[_0x11c8('0x27')]['agent']=_0x3ecf83;return _0x4a6bc5;})['then'](function(_0x220efe){if(_0x220efe){_0x220efe[_0x11c8('0x27')][_0x11c8('0x7f')]=util['format'](_0x11c8('0x75'),_0x1c509d[_0x11c8('0x5f')][_0x11c8('0x39')]);_0x220efe[_0x11c8('0x27')][_0x11c8('0x76')]=_0x4a6bc5[_0x11c8('0x76')];_0x220efe[_0x11c8('0x27')][_0x11c8('0x77')]=_0x4a6bc5[_0x11c8('0x76')];_0x220efe[_0x11c8('0x27')]['event']=_0x11c8('0x34');respondWithRpcPromise('EventManager','EventManager',{'event':_0x11c8('0x80'),'message':_0x220efe[_0x11c8('0x27')]},client9002);return _0x4a6bc5;}return null;})['then'](respondWithResult(_0x72e2a1,null))['catch'](handleError(_0x72e2a1,null));};exports[_0x11c8('0x81')]=function(_0x369a44,_0x5d7df9){var _0x138793;return db[_0x11c8('0x3d')][_0x11c8('0x81')](_0x369a44[_0x11c8('0x59')],{})[_0x11c8('0x20')](function(_0x3f895e){_0x138793=_0x3f895e;return db['CmContact'][_0x11c8('0x82')]({'where':{'id':_0x138793[_0x11c8('0x6c')]}});})[_0x11c8('0x20')](function(_0x4866d6){if(_[_0x11c8('0x62')](_0x4866d6)){return;}else{_0x138793[_0x11c8('0x7a')]=_0x4866d6[_0x11c8('0x7a')];return db[_0x11c8('0x83')][_0x11c8('0x82')]({'where':{'id':_0x138793[_0x11c8('0x84')]}});}})[_0x11c8('0x20')](function(_0x2449b6){return respondWithRpcPromise(_0x11c8('0x85'),_0x11c8('0x85'),{'FaxAccountId':_['isNil'](_0x369a44[_0x11c8('0x59')])?undefined:_0x369a44['body'][_0x11c8('0x86')],'path':_['isNil'](_0x2449b6)?undefined:util[_0x11c8('0x64')](_0x11c8('0x87'),_0x2449b6[_0x11c8('0x88')]),'fax':_[_0x11c8('0x62')](_0x138793[_0x11c8('0x7a')])?undefined:_0x138793['fax'],'AttachmentId':_0x138793['AttachmentId']},client9002);})[_0x11c8('0x20')](respondWithResult(_0x5d7df9,0xc9))['catch'](handleError(_0x5d7df9,null));};exports[_0x11c8('0x89')]=function(_0x5449d2,_0x9363b2){var _0x4c4b17=path[_0x11c8('0x8a')](config[_0x11c8('0x8b')],'server',_0x11c8('0x8c'),_0x11c8('0x8d'));return db['FaxMessage'][_0x11c8('0x58')]({'where':{'id':_0x5449d2[_0x11c8('0x54')]['id']},'include':[{'model':db[_0x11c8('0x83')],'as':_0x11c8('0x83')}]})[_0x11c8('0x20')](handleEntityNotFound(_0x9363b2,null))['then'](function(_0x280d54){if(_0x280d54){return _0x9363b2[_0x11c8('0x89')](path[_0x11c8('0x8a')](_0x4c4b17,_0x280d54['Attachment']['basename']));}})[_0x11c8('0x28')](handleError(_0x9363b2,null));}; \ No newline at end of file +var _0x7bf6=['debug','error','message','info','result','sendStatus','status','offset','undefined','limit','count','set','apply','reject','update','destroy','end','stack','name','send','index','map','FaxMessage','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','body','find','describe','../../config/logger','fax-interactions','accept','fax','user','agent','UserId','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','format','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','contact','fullname','email','internal','manual','interface','channel','motionChannel','event','EventManager','acceptmessage','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','rejectmessage','create','findOne','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','join','root','server','files','attachments','Attachment','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','redis','defaults','socket.io-emitter','./faxMessage.socket','register','jayson/promise','http','client','then','FaxMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x1b1396,_0x5139e6){var _0x19149f=function(_0x4b22bb){while(--_0x4b22bb){_0x1b1396['push'](_0x1b1396['shift']());}};_0x19149f(++_0x5139e6);}(_0x7bf6,0x17e));var _0x67bf=function(_0x3564b0,_0x5b6f87){_0x3564b0=_0x3564b0-0x0;var _0x5e7185=_0x7bf6[_0x3564b0];return _0x5e7185;};'use strict';var emlformat=require(_0x67bf('0x0'));var rimraf=require(_0x67bf('0x1'));var zipdir=require(_0x67bf('0x2'));var jsonpatch=require(_0x67bf('0x3'));var rp=require(_0x67bf('0x4'));var moment=require(_0x67bf('0x5'));var BPromise=require(_0x67bf('0x6'));var Mustache=require('mustache');var util=require(_0x67bf('0x7'));var path=require(_0x67bf('0x8'));var sox=require('sox');var csv=require(_0x67bf('0x9'));var ejs=require(_0x67bf('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x67bf('0xb'));var squel=require(_0x67bf('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x67bf('0xd'));var toCsv=require(_0x67bf('0x9'));var querystring=require(_0x67bf('0xe'));var Papa=require('papaparse');var Redis=require(_0x67bf('0xf'));var authService=require(_0x67bf('0x10'));var qs=require(_0x67bf('0x11'));var as=require(_0x67bf('0x12'));var hardwareService=require(_0x67bf('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x67bf('0x14'))['db'];config[_0x67bf('0x15')]=_[_0x67bf('0x16')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x67bf('0x17'))(new Redis(config['redis']));require(_0x67bf('0x18'))[_0x67bf('0x19')](socket);var jayson=require(_0x67bf('0x1a'));var client=jayson['client'][_0x67bf('0x1b')]({'port':0x232c});var client9002=jayson[_0x67bf('0x1c')][_0x67bf('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x33fbe3,_0x2d147a,_0x2bbec1,_0x1a47c2){return new BPromise(function(_0x1a0e62,_0x2ac61f){var _0x28c152=_0x1a47c2||client;return _0x28c152['request'](_0x33fbe3,_0x2bbec1)[_0x67bf('0x1d')](function(_0x30460e){logger['info'](_0x67bf('0x1e'),_0x2d147a,_0x67bf('0x1f'));logger[_0x67bf('0x20')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x2d147a,_0x67bf('0x1f'),JSON['stringify'](_0x30460e));if(_0x30460e[_0x67bf('0x21')]){if(_0x30460e['error']['code']===0x1f4){logger[_0x67bf('0x21')](_0x67bf('0x1e'),_0x2d147a,_0x30460e[_0x67bf('0x21')][_0x67bf('0x22')]);return _0x2ac61f(_0x30460e[_0x67bf('0x21')][_0x67bf('0x22')]);}logger['error']('FaxMessage,\x20%s,\x20%s',_0x2d147a,_0x30460e['error'][_0x67bf('0x22')]);return _0x1a0e62(_0x30460e[_0x67bf('0x21')][_0x67bf('0x22')]);}else{logger[_0x67bf('0x23')](_0x67bf('0x1e'),_0x2d147a,_0x67bf('0x1f'));_0x1a0e62(_0x30460e[_0x67bf('0x24')][_0x67bf('0x22')]);}})['catch'](function(_0x4f9773){logger[_0x67bf('0x21')](_0x67bf('0x1e'),_0x2d147a,_0x4f9773);_0x2ac61f(_0x4f9773);});});}function respondWithStatusCode(_0x13c2ce,_0x447d3b){_0x447d3b=_0x447d3b||0xcc;return function(_0x2ec617){if(_0x2ec617){return _0x13c2ce[_0x67bf('0x25')](_0x447d3b);}return _0x13c2ce['status'](_0x447d3b)['end']();};}function respondWithResult(_0x3fb7f7,_0x3f04e1){_0x3f04e1=_0x3f04e1||0xc8;return function(_0x395f78){if(_0x395f78){return _0x3fb7f7[_0x67bf('0x26')](_0x3f04e1)['json'](_0x395f78);}};}function respondWithFilteredResult(_0xa84dd0,_0x59ebaa){return function(_0x899399){if(_0x899399){var _0x1d9804=typeof _0x59ebaa[_0x67bf('0x27')]===_0x67bf('0x28')&&typeof _0x59ebaa[_0x67bf('0x29')]===_0x67bf('0x28');var _0x34252d=_0x899399[_0x67bf('0x2a')];var _0x5f42c5=_0x1d9804?0x0:_0x59ebaa[_0x67bf('0x27')];var _0x11f130=_0x1d9804?_0x899399[_0x67bf('0x2a')]:_0x59ebaa[_0x67bf('0x27')]+_0x59ebaa[_0x67bf('0x29')];var _0x2c2d59;if(_0x11f130>=_0x34252d){_0x11f130=_0x34252d;_0x2c2d59=0xc8;}else{_0x2c2d59=0xce;}_0xa84dd0[_0x67bf('0x26')](_0x2c2d59);return _0xa84dd0[_0x67bf('0x2b')]('Content-Range',_0x5f42c5+'-'+_0x11f130+'/'+_0x34252d)['json'](_0x899399);}return null;};}function patchUpdates(_0x1b905e){return function(_0x19737e){try{jsonpatch[_0x67bf('0x2c')](_0x19737e,_0x1b905e,!![]);}catch(_0x4efc4){return BPromise[_0x67bf('0x2d')](_0x4efc4);}return _0x19737e['save']();};}function saveUpdates(_0x416869,_0xdca8d5){return function(_0x3ba674){if(_0x3ba674){return _0x3ba674[_0x67bf('0x2e')](_0x416869)[_0x67bf('0x1d')](function(_0x326d1b){return _0x326d1b;});}return null;};}function removeEntity(_0x12ec0e,_0x29f717){return function(_0x464317){if(_0x464317){return _0x464317[_0x67bf('0x2f')]()[_0x67bf('0x1d')](function(){_0x12ec0e[_0x67bf('0x26')](0xcc)[_0x67bf('0x30')]();});}};}function handleEntityNotFound(_0x567645,_0x5978eb){return function(_0x54459a){if(!_0x54459a){_0x567645[_0x67bf('0x25')](0x194);}return _0x54459a;};}function handleError(_0x5d0221,_0x3e59a0){_0x3e59a0=_0x3e59a0||0x1f4;return function(_0x31c6fb){logger[_0x67bf('0x21')](_0x31c6fb[_0x67bf('0x31')]);if(_0x31c6fb[_0x67bf('0x32')]){delete _0x31c6fb['name'];}_0x5d0221[_0x67bf('0x26')](_0x3e59a0)[_0x67bf('0x33')](_0x31c6fb);};}exports[_0x67bf('0x34')]=function(_0x2c6580,_0x289081){var _0x47bbcd={},_0x4cf60d={},_0x5d69ca={'count':0x0,'rows':[]};var _0xc04798=_[_0x67bf('0x35')](db[_0x67bf('0x36')]['rawAttributes'],function(_0x17efc9){return{'name':_0x17efc9[_0x67bf('0x37')],'type':_0x17efc9[_0x67bf('0x38')][_0x67bf('0x39')]};});_0x4cf60d['model']=_[_0x67bf('0x35')](_0xc04798,_0x67bf('0x32'));_0x4cf60d[_0x67bf('0x3a')]=_[_0x67bf('0x3b')](_0x2c6580[_0x67bf('0x3a')]);_0x4cf60d[_0x67bf('0x3c')]=_[_0x67bf('0x3d')](_0x4cf60d[_0x67bf('0x3e')],_0x4cf60d['query']);_0x47bbcd[_0x67bf('0x3f')]=_[_0x67bf('0x3d')](_0x4cf60d[_0x67bf('0x3e')],qs[_0x67bf('0x40')](_0x2c6580[_0x67bf('0x3a')][_0x67bf('0x40')]));_0x47bbcd[_0x67bf('0x3f')]=_0x47bbcd['attributes'][_0x67bf('0x41')]?_0x47bbcd[_0x67bf('0x3f')]:_0x4cf60d[_0x67bf('0x3e')];if(!_0x2c6580[_0x67bf('0x3a')][_0x67bf('0x42')](_0x67bf('0x43'))){_0x47bbcd[_0x67bf('0x29')]=qs[_0x67bf('0x29')](_0x2c6580[_0x67bf('0x3a')][_0x67bf('0x29')]);_0x47bbcd['offset']=qs[_0x67bf('0x27')](_0x2c6580[_0x67bf('0x3a')][_0x67bf('0x27')]);}_0x47bbcd[_0x67bf('0x44')]=qs[_0x67bf('0x45')](_0x2c6580[_0x67bf('0x3a')][_0x67bf('0x45')]);_0x47bbcd['where']=qs[_0x67bf('0x3c')](_['pick'](_0x2c6580['query'],_0x4cf60d[_0x67bf('0x3c')]),_0xc04798);if(_0x2c6580[_0x67bf('0x3a')][_0x67bf('0x46')]){_0x47bbcd[_0x67bf('0x47')]=_[_0x67bf('0x48')](_0x47bbcd[_0x67bf('0x47')],{'$or':_[_0x67bf('0x35')](_0xc04798,function(_0x271f85){if(_0x271f85['type']!=='VIRTUAL'){var _0x272835={};_0x272835[_0x271f85[_0x67bf('0x32')]]={'$like':'%'+_0x2c6580['query'][_0x67bf('0x46')]+'%'};return _0x272835;}})});}_0x47bbcd=_[_0x67bf('0x48')]({},_0x47bbcd,_0x2c6580[_0x67bf('0x49')]);var _0x17b9a9={'where':_0x47bbcd[_0x67bf('0x47')]};return db[_0x67bf('0x36')]['count'](_0x17b9a9)[_0x67bf('0x1d')](function(_0x171c71){_0x5d69ca[_0x67bf('0x2a')]=_0x171c71;if(_0x2c6580[_0x67bf('0x3a')][_0x67bf('0x4a')]){_0x47bbcd[_0x67bf('0x4b')]=[{'all':!![]}];}return db['FaxMessage'][_0x67bf('0x4c')](_0x47bbcd);})[_0x67bf('0x1d')](function(_0x2c8c6d){_0x5d69ca[_0x67bf('0x4d')]=_0x2c8c6d;return _0x5d69ca;})[_0x67bf('0x1d')](respondWithFilteredResult(_0x289081,_0x47bbcd))[_0x67bf('0x4e')](handleError(_0x289081,null));};exports[_0x67bf('0x4f')]=function(_0xe4fb74,_0x4f2d22){var _0x25e35f={'raw':!![],'where':{'id':_0xe4fb74[_0x67bf('0x50')]['id']}},_0x5b3b7b={};_0x5b3b7b[_0x67bf('0x3e')]=_['keys'](db[_0x67bf('0x36')][_0x67bf('0x51')]);_0x5b3b7b['query']=_['keys'](_0xe4fb74[_0x67bf('0x3a')]);_0x5b3b7b[_0x67bf('0x3c')]=_[_0x67bf('0x3d')](_0x5b3b7b['model'],_0x5b3b7b[_0x67bf('0x3a')]);_0x25e35f['attributes']=_['intersection'](_0x5b3b7b[_0x67bf('0x3e')],qs[_0x67bf('0x40')](_0xe4fb74[_0x67bf('0x3a')][_0x67bf('0x40')]));_0x25e35f[_0x67bf('0x3f')]=_0x25e35f['attributes'][_0x67bf('0x41')]?_0x25e35f['attributes']:_0x5b3b7b[_0x67bf('0x3e')];if(_0xe4fb74[_0x67bf('0x3a')][_0x67bf('0x4a')]){_0x25e35f['include']=[{'all':!![]}];}_0x25e35f=_['merge']({},_0x25e35f,_0xe4fb74[_0x67bf('0x49')]);return db[_0x67bf('0x36')]['find'](_0x25e35f)[_0x67bf('0x1d')](handleEntityNotFound(_0x4f2d22,null))[_0x67bf('0x1d')](respondWithResult(_0x4f2d22,null))[_0x67bf('0x4e')](handleError(_0x4f2d22,null));};exports[_0x67bf('0x2e')]=function(_0x44154e,_0x4b0955){if(_0x44154e['body']['id']){delete _0x44154e[_0x67bf('0x52')]['id'];}return db['FaxMessage'][_0x67bf('0x53')]({'where':{'id':_0x44154e[_0x67bf('0x50')]['id']}})[_0x67bf('0x1d')](handleEntityNotFound(_0x4b0955,null))[_0x67bf('0x1d')](saveUpdates(_0x44154e[_0x67bf('0x52')],null))['then'](respondWithResult(_0x4b0955,null))[_0x67bf('0x4e')](handleError(_0x4b0955,null));};exports[_0x67bf('0x2f')]=function(_0xf4da70,_0x5cb73d){return db[_0x67bf('0x36')][_0x67bf('0x53')]({'where':{'id':_0xf4da70[_0x67bf('0x50')]['id']}})[_0x67bf('0x1d')](handleEntityNotFound(_0x5cb73d,null))[_0x67bf('0x1d')](removeEntity(_0x5cb73d,null))['catch'](handleError(_0x5cb73d,null));};exports[_0x67bf('0x54')]=function(_0x525cd2,_0x2b0823){return db[_0x67bf('0x36')]['describe']()[_0x67bf('0x1d')](respondWithResult(_0x2b0823,null))['catch'](handleError(_0x2b0823,null));};var interaction_log=require(_0x67bf('0x55'))(_0x67bf('0x56'));exports[_0x67bf('0x57')]=function(_0xfbb63e,_0x582838,_0x4c1d13){var _0x4418b2={'agent':{},'channel':_0x67bf('0x58')};if(_0xfbb63e[_0x67bf('0x52')]['id']){delete _0xfbb63e[_0x67bf('0x52')]['id'];}_0xfbb63e[_0x67bf('0x52')]['read']=!![];_0xfbb63e[_0x67bf('0x52')]['readAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0xfbb63e[_0x67bf('0x52')]['UserId']=_0xfbb63e[_0x67bf('0x52')]['UserId']||_0xfbb63e[_0x67bf('0x59')]['id'];_0x4418b2[_0x67bf('0x5a')]['id']=_0xfbb63e['body'][_0x67bf('0x5b')];return db[_0x67bf('0x36')][_0x67bf('0x53')]({'where':{'id':_0xfbb63e[_0x67bf('0x50')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x582838,null))[_0x67bf('0x1d')](saveUpdates(_0xfbb63e[_0x67bf('0x52')],null))[_0x67bf('0x1d')](function(_0x426a17){if(_0x426a17){_0x4418b2[_0x67bf('0x22')]=_0x426a17[_0x67bf('0x5c')]({'plain':!![]});return db[_0x67bf('0x5d')]['find']({'where':{'id':_0x426a17[_0x67bf('0x5e')]}});}return null;})[_0x67bf('0x1d')](handleEntityNotFound(_0x582838,null))['then'](function(_0x2ea59b){if(_0x2ea59b){return _0x2ea59b[_0x67bf('0x2e')]({'UserId':_0xfbb63e[_0x67bf('0x52')]['UserId'],'read1stAt':_[_0x67bf('0x5f')](_0x2ea59b[_0x67bf('0x60')])?moment()[_0x67bf('0x61')](_0x67bf('0x62')):undefined});}return null;})['then'](function(_0x23de9c){if(_0x23de9c){_0x4418b2[_0x67bf('0x63')]=_0x23de9c[_0x67bf('0x5c')]({'plain':!![]});interaction_log['info'](_0x67bf('0x64'),_0xfbb63e['user']['id'],_0xfbb63e['user'][_0x67bf('0x32')],_0xfbb63e[_0x67bf('0x59')][_0x67bf('0x65')],_0x4418b2[_0x67bf('0x63')]['id'],_0xfbb63e[_0x67bf('0x52')]?JSON[_0x67bf('0x66')](_0xfbb63e[_0x67bf('0x52')]):_0x67bf('0x67'));return respondWithRpcPromise(_0x67bf('0x68'),'acceptMessage',_0x4418b2);}return null;})['then'](function(_0x1bd3d0){var _0x4243cf=_0x67bf('0x69')+_0x1bd3d0[_0x67bf('0x22')][_0x67bf('0x6a')];return db[_0x67bf('0x6b')][_0x67bf('0x3a')](_0x4243cf,{'type':db['Sequelize'][_0x67bf('0x6c')][_0x67bf('0x6d')],'raw':!![]})['then'](function(_0xffeb4f){return _0xffeb4f;});})['then'](function(_0x2985cd){if(_0x2985cd){_0x4418b2[_0x67bf('0x22')][_0x67bf('0x6e')]=_0x2985cd[0x0];if(!_0xfbb63e[_0x67bf('0x52')][_0x67bf('0x5b')])return;return db['User'][_0x67bf('0x53')]({'where':{'id':_0xfbb63e[_0x67bf('0x52')][_0x67bf('0x5b')],'role':_0x67bf('0x5a')},'attributes':['id','name',_0x67bf('0x6f'),_0x67bf('0x70'),_0x67bf('0x71')],'raw':!![]});}return null;})[_0x67bf('0x1d')](function(_0x5d4a5c){if(!_0x5d4a5c)return null;_0x4418b2[_0x67bf('0x22')][_0x67bf('0x5a')]=_0x5d4a5c;return _0x4418b2;})[_0x67bf('0x1d')](function(_0x52dbf5){if(_0x52dbf5){if(_0xfbb63e['body'][_0x67bf('0x72')]){_0x4418b2[_0x67bf('0x22')][_0x67bf('0x73')]=util['format']('SIP/%s',_0xfbb63e['user'][_0x67bf('0x32')]);_0x4418b2[_0x67bf('0x22')]['channel']=_0x4418b2[_0x67bf('0x74')];_0x4418b2[_0x67bf('0x22')][_0x67bf('0x75')]=_0x4418b2[_0x67bf('0x74')];_0x4418b2['message'][_0x67bf('0x76')]=_0x67bf('0x57');return respondWithRpcPromise(_0x67bf('0x77'),_0x67bf('0x77'),{'event':_0x67bf('0x78'),'message':_0x4418b2['message']},client9002)['then'](function(){return _0x4418b2;});}return _0x4418b2;}return null;})[_0x67bf('0x1d')](respondWithResult(_0x582838,null))['catch'](handleError(_0x582838,null));};var interaction_log=require(_0x67bf('0x55'))('fax-interactions');exports[_0x67bf('0x2d')]=function(_0x69ed37,_0x3fbdbe,_0x2c5571){var _0x3615b1={'agent':{},'channel':_0x67bf('0x58')};if(_0x69ed37[_0x67bf('0x52')]['id']){delete _0x69ed37[_0x67bf('0x52')]['id'];}_0x69ed37[_0x67bf('0x52')][_0x67bf('0x5b')]=_0x69ed37[_0x67bf('0x52')][_0x67bf('0x5b')]||_0x69ed37[_0x67bf('0x59')]['id'];_0x3615b1['agent']['id']=_0x69ed37[_0x67bf('0x52')][_0x67bf('0x5b')];return db[_0x67bf('0x36')][_0x67bf('0x53')]({'where':{'id':_0x69ed37[_0x67bf('0x50')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3fbdbe,null))['then'](function(_0x21dd8d){if(_0x21dd8d){_0x3615b1[_0x67bf('0x22')]=_0x21dd8d['get']({'plain':!![]});return db[_0x67bf('0x5d')][_0x67bf('0x53')]({'where':{'id':_0x21dd8d[_0x67bf('0x5e')]}});}return null;})[_0x67bf('0x1d')](handleEntityNotFound(_0x3fbdbe,null))[_0x67bf('0x1d')](function(_0x1d33c0){if(_0x1d33c0){_0x3615b1[_0x67bf('0x63')]=_0x1d33c0[_0x67bf('0x5c')]({'plain':!![]});interaction_log[_0x67bf('0x23')](_0x67bf('0x79'),_0x69ed37['user']['id'],_0x69ed37['user']['name'],_0x69ed37['user'][_0x67bf('0x65')],_0x3615b1[_0x67bf('0x63')]['id'],_0x69ed37[_0x67bf('0x52')]?JSON[_0x67bf('0x66')](_0x69ed37[_0x67bf('0x52')]):'null');return respondWithRpcPromise(_0x67bf('0x7a'),_0x67bf('0x7b'),_0x3615b1);}return null;})['then'](function(_0x573673){var _0x3a65fb=_0x67bf('0x69')+_0x573673[_0x67bf('0x22')]['ContactId'];return db[_0x67bf('0x6b')][_0x67bf('0x3a')](_0x3a65fb,{'type':db['Sequelize'][_0x67bf('0x6c')][_0x67bf('0x6d')],'raw':!![]})[_0x67bf('0x1d')](function(_0xb2697b){return _0xb2697b;});})[_0x67bf('0x1d')](function(_0x15747a){if(_0x15747a){_0x3615b1[_0x67bf('0x22')]['contact']=_0x15747a[0x0];if(!_0x69ed37[_0x67bf('0x52')][_0x67bf('0x5b')])return;return db['User'][_0x67bf('0x53')]({'where':{'id':_0x69ed37[_0x67bf('0x52')][_0x67bf('0x5b')],'role':_0x67bf('0x5a')},'attributes':['id',_0x67bf('0x32'),_0x67bf('0x6f'),_0x67bf('0x70'),_0x67bf('0x71')],'raw':!![]});}return null;})[_0x67bf('0x1d')](function(_0x24c54a){if(!_0x24c54a)return null;_0x3615b1[_0x67bf('0x22')][_0x67bf('0x5a')]=_0x24c54a;return _0x3615b1;})[_0x67bf('0x1d')](function(_0x3649bb){if(_0x3649bb){_0x3649bb[_0x67bf('0x22')][_0x67bf('0x73')]=util['format']('SIP/%s',_0x69ed37[_0x67bf('0x59')][_0x67bf('0x32')]);_0x3649bb[_0x67bf('0x22')][_0x67bf('0x74')]=_0x3615b1[_0x67bf('0x74')];_0x3649bb[_0x67bf('0x22')][_0x67bf('0x75')]=_0x3615b1['channel'];_0x3649bb['message']['event']=_0x67bf('0x2d');respondWithRpcPromise(_0x67bf('0x77'),_0x67bf('0x77'),{'event':_0x67bf('0x7c'),'message':_0x3649bb['message']},client9002);return _0x3615b1;}return null;})['then'](respondWithResult(_0x3fbdbe,null))['catch'](handleError(_0x3fbdbe,null));};exports[_0x67bf('0x7d')]=function(_0xdaf05b,_0x13a441){var _0x4d81f4;return db[_0x67bf('0x36')][_0x67bf('0x7d')](_0xdaf05b[_0x67bf('0x52')],{})[_0x67bf('0x1d')](function(_0x55018b){_0x4d81f4=_0x55018b;return db['CmContact'][_0x67bf('0x7e')]({'where':{'id':_0x4d81f4['ContactId']}});})['then'](function(_0x37b48a){if(_[_0x67bf('0x5f')](_0x37b48a)){return;}else{_0x4d81f4[_0x67bf('0x58')]=_0x37b48a[_0x67bf('0x58')];return db['Attachment'][_0x67bf('0x7e')]({'where':{'id':_0x4d81f4[_0x67bf('0x7f')]}});}})[_0x67bf('0x1d')](function(_0x275f54){return respondWithRpcPromise(_0x67bf('0x80'),_0x67bf('0x80'),{'FaxAccountId':_[_0x67bf('0x5f')](_0xdaf05b[_0x67bf('0x52')])?undefined:_0xdaf05b[_0x67bf('0x52')][_0x67bf('0x81')],'path':_['isNil'](_0x275f54)?undefined:util[_0x67bf('0x61')](_0x67bf('0x82'),_0x275f54[_0x67bf('0x83')]),'fax':_['isNil'](_0x4d81f4[_0x67bf('0x58')])?undefined:_0x4d81f4['fax'],'AttachmentId':_0x4d81f4[_0x67bf('0x7f')]},client9002);})[_0x67bf('0x1d')](respondWithResult(_0x13a441,0xc9))[_0x67bf('0x4e')](handleError(_0x13a441,null));};exports['download']=function(_0x444660,_0x25e3d7){var _0x50b123=path[_0x67bf('0x84')](config[_0x67bf('0x85')],_0x67bf('0x86'),_0x67bf('0x87'),_0x67bf('0x88'));return db[_0x67bf('0x36')]['find']({'where':{'id':_0x444660['params']['id']},'include':[{'model':db[_0x67bf('0x89')],'as':_0x67bf('0x89')}]})[_0x67bf('0x1d')](handleEntityNotFound(_0x25e3d7,null))[_0x67bf('0x1d')](function(_0x18a021){if(_0x18a021){return _0x25e3d7['download'](path['join'](_0x50b123,_0x18a021[_0x67bf('0x89')][_0x67bf('0x83')]));}})[_0x67bf('0x4e')](handleError(_0x25e3d7,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 470ca9b..1080559 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 _0xc1db=['hasOwnProperty','events','FaxMessage','setMaxListeners','save','update','remove'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0xc1db,0x120));var _0xbc1d=function(_0x1919c4,_0x593467){_0x1919c4=_0x1919c4-0x0;var _0xab99f8=_0xc1db[_0x1919c4];return _0xab99f8;};'use strict';var EventEmitter=require(_0xbc1d('0x0'));var FaxMessage=require('../../mysqldb')['db'][_0xbc1d('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xbc1d('0x2')](0x0);var events={'afterCreate':_0xbc1d('0x3'),'afterUpdate':_0xbc1d('0x4'),'afterDestroy':_0xbc1d('0x5')};function emitEvent(_0x4b69f6){return function(_0x3d0b27,_0x329960,_0x23a61e){FaxMessageEvents['emit'](_0x4b69f6+':'+_0x3d0b27['id'],_0x3d0b27);FaxMessageEvents['emit'](_0x4b69f6,_0x3d0b27);_0x23a61e(null);};}for(var e in events){if(events[_0xbc1d('0x6')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module['exports']=FaxMessageEvents; \ No newline at end of file +var _0x2c16=['save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','FaxMessage'];(function(_0x517d70,_0x1ff967){var _0x419864=function(_0x341c47){while(--_0x341c47){_0x517d70['push'](_0x517d70['shift']());}};_0x419864(++_0x1ff967);}(_0x2c16,0xf0));var _0x62c1=function(_0x882139,_0x442697){_0x882139=_0x882139-0x0;var _0x4dd411=_0x2c16[_0x882139];return _0x4dd411;};'use strict';var EventEmitter=require(_0x62c1('0x0'));var FaxMessage=require(_0x62c1('0x1'))['db'][_0x62c1('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x62c1('0x3'),'afterUpdate':_0x62c1('0x4'),'afterDestroy':_0x62c1('0x5')};function emitEvent(_0x1b49a4){return function(_0x8b3478,_0x4521ed,_0x10d47b){FaxMessageEvents[_0x62c1('0x6')](_0x1b49a4+':'+_0x8b3478['id'],_0x8b3478);FaxMessageEvents[_0x62c1('0x6')](_0x1b49a4,_0x8b3478);_0x10d47b(null);};}for(var e in events){if(events[_0x62c1('0x7')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0x62c1('0x8')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 168667d..7989853 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 _0x86f6=['rimraf','../../config/environment','./faxMessage.attributes','exports','fti_fax_messages','body','get','direction','toLowerCase','out','secret','isNil','FaxInteraction','findOne','FaxInteractionId','then','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise'];(function(_0x571453,_0x3f6bd6){var _0x5a2404=function(_0x3d1f83){while(--_0x3d1f83){_0x571453['push'](_0x571453['shift']());}};_0x5a2404(++_0x3f6bd6);}(_0x86f6,0x19a));var _0x686f=function(_0x243a60,_0x376dcf){_0x243a60=_0x243a60-0x0;var _0xb3a4de=_0x86f6[_0x243a60];return _0xb3a4de;};'use strict';var _=require(_0x686f('0x0'));var util=require(_0x686f('0x1'));var logger=require('../../config/logger')(_0x686f('0x2'));var moment=require(_0x686f('0x3'));var BPromise=require(_0x686f('0x4'));var rp=require(_0x686f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x686f('0x6'));var config=require(_0x686f('0x7'));var attributes=require(_0x686f('0x8'));module[_0x686f('0x9')]=function(_0x5b3f91,_0x22f118){return _0x5b3f91['define']('FaxMessage',attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':_0x686f('0xa'),'fields':[_0x686f('0xb')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x59dcd9,_0x167ada,_0x21d247){var _0x510933=_0x5b3f91['models'];var _0x5d9d31=_0x59dcd9[_0x686f('0xc')]({'plain':!![]});if(_0x5d9d31[_0x686f('0xd')][_0x686f('0xe')]()==='in'||_0x5d9d31[_0x686f('0xd')][_0x686f('0xe')]()===_0x686f('0xf')&&!_0x5d9d31[_0x686f('0x10')]&&!_[_0x686f('0x11')](_0x5d9d31['UserId'])){_0x510933[_0x686f('0x12')][_0x686f('0x13')]({'where':{'id':_0x5d9d31[_0x686f('0x14')]}})[_0x686f('0x15')](function(_0x1f60fd){if(_0x1f60fd){_0x1f60fd['update']({'lastMsgAt':_0x5d9d31[_0x686f('0x16')],'lastMsgDirection':_0x5d9d31[_0x686f('0xd')][_0x686f('0xe')]()});}})[_0x686f('0x17')](function(_0x5a5925){console['error'](_0x5a5925);});}_0x21d247();}},'charset':_0x686f('0x18'),'collate':_0x686f('0x19')});}; \ No newline at end of file +var _0x787b=['body','FULLTEXT','models','get','direction','toLowerCase','out','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','then','update','createdAt','catch','error','utf8mb4','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./faxMessage.attributes','exports','FaxMessage'];(function(_0x1365ae,_0x25be8e){var _0x525a9e=function(_0x4110a7){while(--_0x4110a7){_0x1365ae['push'](_0x1365ae['shift']());}};_0x525a9e(++_0x25be8e);}(_0x787b,0x17e));var _0xb787=function(_0x46a671,_0x758e9a){_0x46a671=_0x46a671-0x0;var _0x526d75=_0x787b[_0x46a671];return _0x526d75;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb787('0x0'))(_0xb787('0x1'));var moment=require('moment');var BPromise=require(_0xb787('0x2'));var rp=require(_0xb787('0x3'));var fs=require('fs');var path=require(_0xb787('0x4'));var rimraf=require(_0xb787('0x5'));var config=require(_0xb787('0x6'));var attributes=require(_0xb787('0x7'));module[_0xb787('0x8')]=function(_0x20af50,_0x3924ca){return _0x20af50['define'](_0xb787('0x9'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0xb787('0xa')],'type':_0xb787('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4e4118,_0x1a028c,_0x27e076){var _0x3f4cf0=_0x20af50[_0xb787('0xc')];var _0x494ef7=_0x4e4118[_0xb787('0xd')]({'plain':!![]});if(_0x494ef7[_0xb787('0xe')]['toLowerCase']()==='in'||_0x494ef7[_0xb787('0xe')][_0xb787('0xf')]()===_0xb787('0x10')&&!_0x494ef7['secret']&&!_[_0xb787('0x11')](_0x494ef7[_0xb787('0x12')])){_0x3f4cf0[_0xb787('0x13')][_0xb787('0x14')]({'where':{'id':_0x494ef7[_0xb787('0x15')]}})[_0xb787('0x16')](function(_0x160d54){if(_0x160d54){_0x160d54[_0xb787('0x17')]({'lastMsgAt':_0x494ef7[_0xb787('0x18')],'lastMsgDirection':_0x494ef7[_0xb787('0xe')][_0xb787('0xf')]()});}})[_0xb787('0x19')](function(_0x2f8175){console[_0xb787('0x1a')](_0x2f8175);});}_0x27e076();}},'charset':_0xb787('0x1b'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index bf9be9b..0687674 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 _0xdace=['FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','FaxMessage','create','body','options','raw','CreateFaxMessage','UpdateFaxMessage','update','attributes','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','./faxMessage.socket','register','then','FaxMessage,\x20%s,\x20%s','debug'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xdace,0xc5));var _0xedac=function(_0x51674a,_0x77ccff){_0x51674a=_0x51674a-0x0;var _0x13fca6=_0xdace[_0x51674a];return _0x13fca6;};'use strict';var _=require(_0xedac('0x0'));var util=require('util');var moment=require(_0xedac('0x1'));var BPromise=require(_0xedac('0x2'));var rs=require(_0xedac('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xedac('0x4'))['db'];var utils=require(_0xedac('0x5'));var logger=require(_0xedac('0x6'))(_0xedac('0x7'));var config=require('../../config/environment');var jayson=require(_0xedac('0x8'));var client=jayson[_0xedac('0x9')][_0xedac('0xa')]({'port':0x232a});config['redis']=_[_0xedac('0xb')](config[_0xedac('0xc')],{'host':_0xedac('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xedac('0xc')]));require(_0xedac('0xe'))[_0xedac('0xf')](socket);function respondWithRpcPromise(_0x4af030,_0x5e188c,_0x144368){return new BPromise(function(_0x2ea11d,_0x57e1bf){return client['request'](_0x4af030,_0x144368)[_0xedac('0x10')](function(_0x25395d){logger['info'](_0xedac('0x11'),_0x5e188c,'request\x20sent');logger[_0xedac('0x12')](_0xedac('0x13'),_0x5e188c,_0xedac('0x14'),JSON[_0xedac('0x15')](_0x25395d));if(_0x25395d[_0xedac('0x16')]){if(_0x25395d[_0xedac('0x16')][_0xedac('0x17')]===0x1f4){logger[_0xedac('0x16')]('FaxMessage,\x20%s,\x20%s',_0x5e188c,_0x25395d[_0xedac('0x16')][_0xedac('0x18')]);return _0x57e1bf(_0x25395d[_0xedac('0x16')][_0xedac('0x18')]);}logger[_0xedac('0x16')]('FaxMessage,\x20%s,\x20%s',_0x5e188c,_0x25395d[_0xedac('0x16')]['message']);return _0x2ea11d(_0x25395d[_0xedac('0x16')][_0xedac('0x18')]);}else{logger[_0xedac('0x19')](_0xedac('0x11'),_0x5e188c,'request\x20sent');_0x2ea11d(_0x25395d['result'][_0xedac('0x18')]);}})[_0xedac('0x1a')](function(_0x25fe64){logger[_0xedac('0x16')]('FaxMessage,\x20%s,\x20%s',_0x5e188c,_0x25fe64);_0x57e1bf(_0x25fe64);});});}exports['CreateFaxMessage']=function(_0x2b2ae9){var _0x17766c=this;return new Promise(function(_0x23c609,_0xcc1605){return db[_0xedac('0x1b')][_0xedac('0x1c')](_0x2b2ae9[_0xedac('0x1d')],{'raw':_0x2b2ae9[_0xedac('0x1e')]?_0x2b2ae9['options'][_0xedac('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0x29cd40){logger[_0xedac('0x19')]('CreateFaxMessage',_0x2b2ae9);logger[_0xedac('0x12')](_0xedac('0x20'),_0x2b2ae9,JSON[_0xedac('0x15')](_0x29cd40));_0x23c609(_0x29cd40);})[_0xedac('0x1a')](function(_0x6b13ca){logger[_0xedac('0x16')]('CreateFaxMessage',_0x6b13ca[_0xedac('0x18')],_0x2b2ae9);_0xcc1605(_0x17766c[_0xedac('0x16')](0x1f4,_0x6b13ca[_0xedac('0x18')]));});});};exports[_0xedac('0x21')]=function(_0x1ff33e){var _0x453a3c=this;return new Promise(function(_0x40ba53,_0x26c6f7){return db[_0xedac('0x1b')][_0xedac('0x22')](_0x1ff33e['body'],{'raw':_0x1ff33e[_0xedac('0x1e')]?_0x1ff33e[_0xedac('0x1e')][_0xedac('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ff33e['options']?_0x1ff33e[_0xedac('0x1e')]['where']||null:null,'attributes':_0x1ff33e['options']?_0x1ff33e[_0xedac('0x1e')][_0xedac('0x23')]||null:null,'limit':_0x1ff33e[_0xedac('0x1e')]?_0x1ff33e[_0xedac('0x1e')]['limit']||null:null})['then'](function(_0xe813e6){logger[_0xedac('0x19')](_0xedac('0x21'),_0x1ff33e);logger[_0xedac('0x12')](_0xedac('0x21'),_0x1ff33e,JSON[_0xedac('0x15')](_0xe813e6));_0x40ba53(_0xe813e6);})[_0xedac('0x1a')](function(_0x483233){logger[_0xedac('0x16')](_0xedac('0x21'),_0x483233[_0xedac('0x18')],_0x1ff33e);_0x26c6f7(_0x453a3c['error'](0x1f4,_0x483233[_0xedac('0x18')]));});});}; \ No newline at end of file +var _0x0e85=['catch','FaxMessage','create','body','options','raw','info','CreateFaxMessage','UpdateFaxMessage','update','where','attributes','limit','lodash','util','bluebird','randomstring','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./faxMessage.socket','request','then','request\x20sent','debug','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','result'];(function(_0x33dbe7,_0x2baac5){var _0x6a957f=function(_0x1d1135){while(--_0x1d1135){_0x33dbe7['push'](_0x33dbe7['shift']());}};_0x6a957f(++_0x2baac5);}(_0x0e85,0x7c));var _0x50e8=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0x0e85[_0x243b59];return _0x3e1676;};'use strict';var _=require(_0x50e8('0x0'));var util=require(_0x50e8('0x1'));var moment=require('moment');var BPromise=require(_0x50e8('0x2'));var rs=require(_0x50e8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x50e8('0x4'))('rpc');var config=require(_0x50e8('0x5'));var jayson=require(_0x50e8('0x6'));var client=jayson[_0x50e8('0x7')][_0x50e8('0x8')]({'port':0x232a});config['redis']=_[_0x50e8('0x9')](config[_0x50e8('0xa')],{'host':_0x50e8('0xb'),'port':0x18eb});var socket=require(_0x50e8('0xc'))(new Redis(config[_0x50e8('0xa')]));require(_0x50e8('0xd'))['register'](socket);function respondWithRpcPromise(_0x11717c,_0x228ed1,_0x19d1bc){return new BPromise(function(_0x2d4750,_0x154b9e){return client[_0x50e8('0xe')](_0x11717c,_0x19d1bc)[_0x50e8('0xf')](function(_0x3d25ea){logger['info']('FaxMessage,\x20%s,\x20%s',_0x228ed1,_0x50e8('0x10'));logger[_0x50e8('0x11')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x228ed1,'request\x20sent',JSON[_0x50e8('0x12')](_0x3d25ea));if(_0x3d25ea[_0x50e8('0x13')]){if(_0x3d25ea[_0x50e8('0x13')][_0x50e8('0x14')]===0x1f4){logger['error'](_0x50e8('0x15'),_0x228ed1,_0x3d25ea[_0x50e8('0x13')][_0x50e8('0x16')]);return _0x154b9e(_0x3d25ea['error']['message']);}logger[_0x50e8('0x13')](_0x50e8('0x15'),_0x228ed1,_0x3d25ea[_0x50e8('0x13')][_0x50e8('0x16')]);return _0x2d4750(_0x3d25ea[_0x50e8('0x13')][_0x50e8('0x16')]);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x228ed1,_0x50e8('0x10'));_0x2d4750(_0x3d25ea[_0x50e8('0x17')][_0x50e8('0x16')]);}})[_0x50e8('0x18')](function(_0x5dae4e){logger[_0x50e8('0x13')](_0x50e8('0x15'),_0x228ed1,_0x5dae4e);_0x154b9e(_0x5dae4e);});});}exports['CreateFaxMessage']=function(_0x415596){var _0x55997c=this;return new Promise(function(_0x4d2318,_0xe04a5c){return db[_0x50e8('0x19')][_0x50e8('0x1a')](_0x415596[_0x50e8('0x1b')],{'raw':_0x415596['options']?_0x415596[_0x50e8('0x1c')][_0x50e8('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x31d23c){logger[_0x50e8('0x1e')]('CreateFaxMessage',_0x415596);logger[_0x50e8('0x11')](_0x50e8('0x1f'),_0x415596,JSON['stringify'](_0x31d23c));_0x4d2318(_0x31d23c);})['catch'](function(_0x59582d){logger[_0x50e8('0x13')](_0x50e8('0x1f'),_0x59582d[_0x50e8('0x16')],_0x415596);_0xe04a5c(_0x55997c[_0x50e8('0x13')](0x1f4,_0x59582d[_0x50e8('0x16')]));});});};exports[_0x50e8('0x20')]=function(_0x53d848){var _0x3a6442=this;return new Promise(function(_0x396611,_0x4b3a09){return db[_0x50e8('0x19')][_0x50e8('0x21')](_0x53d848[_0x50e8('0x1b')],{'raw':_0x53d848[_0x50e8('0x1c')]?_0x53d848['options'][_0x50e8('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x53d848['options']?_0x53d848[_0x50e8('0x1c')][_0x50e8('0x22')]||null:null,'attributes':_0x53d848[_0x50e8('0x1c')]?_0x53d848['options'][_0x50e8('0x23')]||null:null,'limit':_0x53d848[_0x50e8('0x1c')]?_0x53d848[_0x50e8('0x1c')][_0x50e8('0x24')]||null:null})[_0x50e8('0xf')](function(_0x18aa31){logger[_0x50e8('0x1e')]('UpdateFaxMessage',_0x53d848);logger[_0x50e8('0x11')](_0x50e8('0x20'),_0x53d848,JSON['stringify'](_0x18aa31));_0x396611(_0x18aa31);})['catch'](function(_0x329b9c){logger[_0x50e8('0x13')](_0x50e8('0x20'),_0x329b9c['message'],_0x53d848);_0x4b3a09(_0x3a6442['error'](0x1f4,_0x329b9c[_0x50e8('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index d5c88c8..9ac3c6d 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 _0xc0d6=['faxMessage:','remove','update','emit','removeListener','register','length'];(function(_0x545f19,_0x291a17){var _0x1b0731=function(_0x5710e4){while(--_0x5710e4){_0x545f19['push'](_0x545f19['shift']());}};_0x1b0731(++_0x291a17);}(_0xc0d6,0x197));var _0x6c0d=function(_0x167c01,_0x8fd3e9){_0x167c01=_0x167c01-0x0;var _0x5eeaa9=_0xc0d6[_0x167c01];return _0x5eeaa9;};'use strict';var FaxMessageEvents=require('./faxMessage.events');var events=['save',_0x6c0d('0x0'),_0x6c0d('0x1')];function createListener(_0x56d7fd,_0x5b7924){return function(_0x215892){_0x5b7924[_0x6c0d('0x2')](_0x56d7fd,_0x215892);};}function removeListener(_0x599454,_0x43b87e){return function(){FaxMessageEvents[_0x6c0d('0x3')](_0x599454,_0x43b87e);};}exports[_0x6c0d('0x4')]=function(_0x5b99c5){for(var _0x396f47=0x0,_0x274ed2=events[_0x6c0d('0x5')];_0x396f47<_0x274ed2;_0x396f47++){var _0x416d44=events[_0x396f47];var _0x169e8c=createListener(_0x6c0d('0x6')+_0x416d44,_0x5b99c5);FaxMessageEvents['on'](_0x416d44,_0x169e8c);}}; \ No newline at end of file +var _0x1caf=['removeListener','register','length','faxMessage:','save','remove','update'];(function(_0x58d07b,_0x4e5991){var _0x1dc1fb=function(_0x4459bc){while(--_0x4459bc){_0x58d07b['push'](_0x58d07b['shift']());}};_0x1dc1fb(++_0x4e5991);}(_0x1caf,0x1d9));var _0xf1ca=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0x1caf[_0x24237f];return _0x48298e;};'use strict';var FaxMessageEvents=require('./faxMessage.events');var events=[_0xf1ca('0x0'),_0xf1ca('0x1'),_0xf1ca('0x2')];function createListener(_0x3f0003,_0x16340f){return function(_0x5bc1e5){_0x16340f['emit'](_0x3f0003,_0x5bc1e5);};}function removeListener(_0x301809,_0xd0b178){return function(){FaxMessageEvents[_0xf1ca('0x3')](_0x301809,_0xd0b178);};}exports[_0xf1ca('0x4')]=function(_0x3b9c8c){for(var _0x5732e3=0x0,_0x5458da=events[_0xf1ca('0x5')];_0x5732e3<_0x5458da;_0x5732e3++){var _0x24f2d9=events[_0x5732e3];var _0x3f1bef=createListener(_0xf1ca('0x6')+_0x24f2d9,_0x3b9c8c);FaxMessageEvents['on'](_0x24f2d9,_0x3f1bef);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index d2e1efe..3e4c6b1 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 _0x39cb=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','index','/describe','isAuthenticated','/:id','show','post','tracked','fax','faxmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','util','path','express'];(function(_0x43d16c,_0x2b5447){var _0x208cce=function(_0x371720){while(--_0x371720){_0x43d16c['push'](_0x43d16c['shift']());}};_0x208cce(++_0x2b5447);}(_0x39cb,0x1bd));var _0xb39c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x39cb[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xb39c('0x0'));var path=require(_0xb39c('0x1'));var timeout=require('connect-timeout');var express=require(_0xb39c('0x2'));var router=express[_0xb39c('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xb39c('0x4'));var interaction=require(_0xb39c('0x5'));var config=require(_0xb39c('0x6'));var controller=require(_0xb39c('0x7'));router[_0xb39c('0x8')]('/',auth['isAuthenticated'](),controller[_0xb39c('0x9')]);router[_0xb39c('0x8')](_0xb39c('0xa'),auth[_0xb39c('0xb')](),controller['describe']);router['get'](_0xb39c('0xc'),auth[_0xb39c('0xb')](),controller[_0xb39c('0xd')]);router[_0xb39c('0x8')]('/:id/download',auth['isAuthenticated'](),controller['download']);router[_0xb39c('0xe')]('/',auth[_0xb39c('0xb')](),interaction[_0xb39c('0xf')](_0xb39c('0x10'),_0xb39c('0x11')),controller[_0xb39c('0x12')]);router[_0xb39c('0x13')](_0xb39c('0xc'),auth['isAuthenticated'](),controller[_0xb39c('0x14')]);router[_0xb39c('0x13')](_0xb39c('0x15'),auth['isAuthenticated'](),controller[_0xb39c('0x16')]);router[_0xb39c('0x13')](_0xb39c('0x17'),auth[_0xb39c('0xb')](),controller[_0xb39c('0x18')]);router[_0xb39c('0x19')](_0xb39c('0xc'),auth['isAuthenticated'](),controller[_0xb39c('0x1a')]);module[_0xb39c('0x1b')]=router; \ No newline at end of file +var _0xd3d1=['put','update','accept','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/download','download','post','tracked','fax','faxmessage:create','create'];(function(_0x1a48c9,_0x4f06aa){var _0x2fb5c1=function(_0x5cd25b){while(--_0x5cd25b){_0x1a48c9['push'](_0x1a48c9['shift']());}};_0x2fb5c1(++_0x4f06aa);}(_0xd3d1,0x172));var _0x1d3d=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0xd3d1[_0x5f0089];return _0x193892;};'use strict';var multer=require(_0x1d3d('0x0'));var util=require(_0x1d3d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1d3d('0x2'));var router=express[_0x1d3d('0x3')]();var fs_extra=require(_0x1d3d('0x4'));var auth=require(_0x1d3d('0x5'));var interaction=require(_0x1d3d('0x6'));var config=require(_0x1d3d('0x7'));var controller=require(_0x1d3d('0x8'));router[_0x1d3d('0x9')]('/',auth[_0x1d3d('0xa')](),controller[_0x1d3d('0xb')]);router[_0x1d3d('0x9')](_0x1d3d('0xc'),auth[_0x1d3d('0xa')](),controller[_0x1d3d('0xd')]);router[_0x1d3d('0x9')](_0x1d3d('0xe'),auth[_0x1d3d('0xa')](),controller['show']);router[_0x1d3d('0x9')](_0x1d3d('0xf'),auth[_0x1d3d('0xa')](),controller[_0x1d3d('0x10')]);router[_0x1d3d('0x11')]('/',auth[_0x1d3d('0xa')](),interaction[_0x1d3d('0x12')](_0x1d3d('0x13'),_0x1d3d('0x14')),controller[_0x1d3d('0x15')]);router[_0x1d3d('0x16')]('/:id',auth[_0x1d3d('0xa')](),controller[_0x1d3d('0x17')]);router['put']('/:id/accept',auth[_0x1d3d('0xa')](),controller[_0x1d3d('0x18')]);router[_0x1d3d('0x16')]('/:id/reject',auth[_0x1d3d('0xa')](),controller['reject']);router[_0x1d3d('0x19')](_0x1d3d('0xe'),auth[_0x1d3d('0xa')](),controller[_0x1d3d('0x1a')]);module[_0x1d3d('0x1b')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 75f023e..f5b36ea 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 _0x2f61=['STRING','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports','name'];(function(_0x1469b5,_0x454875){var _0x543a97=function(_0x2ffd1c){while(--_0x2ffd1c){_0x1469b5['push'](_0x1469b5['shift']());}};_0x543a97(++_0x454875);}(_0x2f61,0x15c));var _0x12f6=function(_0x3778f4,_0x286d4c){_0x3778f4=_0x3778f4-0x0;var _0x332da1=_0x2f61[_0x3778f4];return _0x332da1;};'use strict';var Sequelize=require(_0x12f6('0x0'));module[_0x12f6('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x12f6('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x12f6('0x3')]},'timeout':{'type':Sequelize[_0x12f6('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x12f6('0x5')](_0x12f6('0x6'),_0x12f6('0x7'),_0x12f6('0x8')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x12f6('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x30e0=['STRING','ENUM','rrmemory','roundrobin','exports','name'];(function(_0x281316,_0xd583f){var _0x2dbc1=function(_0x1b19de){while(--_0x1b19de){_0x281316['push'](_0x281316['shift']());}};_0x2dbc1(++_0xd583f);}(_0x30e0,0x130));var _0x030e=function(_0x1af1e1,_0x37bc24){_0x1af1e1=_0x1af1e1-0x0;var _0x5f3450=_0x30e0[_0x1af1e1];return _0x5f3450;};'use strict';var Sequelize=require('sequelize');module[_0x030e('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x030e('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x030e('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x030e('0x3')](_0x030e('0x4'),'beepall',_0x030e('0x5')),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.controller.js b/server/api/faxQueue/faxQueue.controller.js index e3d34bf..332044f 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 _0xca91=['hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','rawAttributes','length','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','getMembers','UserFaxQueue','order','FaxQueueId','findAndCountAll','UserId','faxPause','updatedAt','createdAt','%s/%s','getTeams','addTeams','ids','Team','User','Agents','online','voicePause','interface','flatMap','sequelize','each','findOrCreate','userFaxQueue:save','removeTeams','select','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','every','value','transaction','isEmpty','forEach','emit','userFaxQueue:remove','addAgents','spread','removeAgents','getAgents','findOne','rimraf','request-promise','bluebird','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','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','./faxQueue.socket','register','sendStatus','status','json','offset','limit','undefined','set','Content-Range','apply','reject','save','update','destroy','then','FaxQueues','UserProfileResource','end','error','name','index','map','FaxQueue','fieldName','type','key','model','query','keys','intersection','attributes','fields'];(function(_0x4b969d,_0x5b6e52){var _0x10354d=function(_0x9a6ffb){while(--_0x9a6ffb){_0x4b969d['push'](_0x4b969d['shift']());}};_0x10354d(++_0x5b6e52);}(_0xca91,0x1e2));var _0x1ca9=function(_0x3f7598,_0x212e37){_0x3f7598=_0x3f7598-0x0;var _0x51fb16=_0xca91[_0x3f7598];return _0x51fb16;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1ca9('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1ca9('0x1'));var moment=require('moment');var BPromise=require(_0x1ca9('0x2'));var Mustache=require('mustache');var util=require(_0x1ca9('0x3'));var path=require(_0x1ca9('0x4'));var sox=require('sox');var csv=require(_0x1ca9('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1ca9('0x6'));var _=require(_0x1ca9('0x7'));var squel=require(_0x1ca9('0x8'));var crypto=require(_0x1ca9('0x9'));var jsforce=require(_0x1ca9('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1ca9('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x1ca9('0xc'));var as=require(_0x1ca9('0xd'));var hardwareService=require(_0x1ca9('0xe'));var logger=require(_0x1ca9('0xf'))(_0x1ca9('0x10'));var utils=require(_0x1ca9('0x11'));var config=require(_0x1ca9('0x12'));var licenseUtil=require(_0x1ca9('0x13'));var db=require(_0x1ca9('0x14'))['db'];config[_0x1ca9('0x15')]=_[_0x1ca9('0x16')](config[_0x1ca9('0x15')],{'host':_0x1ca9('0x17'),'port':0x18eb});var socket=require(_0x1ca9('0x18'))(new Redis(config['redis']));require(_0x1ca9('0x19'))[_0x1ca9('0x1a')](socket);function respondWithStatusCode(_0x34eaf7,_0x50878f){_0x50878f=_0x50878f||0xcc;return function(_0x69499d){if(_0x69499d){return _0x34eaf7[_0x1ca9('0x1b')](_0x50878f);}return _0x34eaf7['status'](_0x50878f)['end']();};}function respondWithResult(_0x202539,_0x35c14f){_0x35c14f=_0x35c14f||0xc8;return function(_0x45d302){if(_0x45d302){return _0x202539[_0x1ca9('0x1c')](_0x35c14f)[_0x1ca9('0x1d')](_0x45d302);}};}function respondWithFilteredResult(_0x3621d2,_0xc5aee4){return function(_0x4805d1){if(_0x4805d1){var _0x5d19b7=typeof _0xc5aee4[_0x1ca9('0x1e')]==='undefined'&&typeof _0xc5aee4[_0x1ca9('0x1f')]===_0x1ca9('0x20');var _0x44c7b5=_0x4805d1['count'];var _0x2a0a25=_0x5d19b7?0x0:_0xc5aee4[_0x1ca9('0x1e')];var _0x871405=_0x5d19b7?_0x4805d1['count']:_0xc5aee4['offset']+_0xc5aee4[_0x1ca9('0x1f')];var _0x5d5833;if(_0x871405>=_0x44c7b5){_0x871405=_0x44c7b5;_0x5d5833=0xc8;}else{_0x5d5833=0xce;}_0x3621d2[_0x1ca9('0x1c')](_0x5d5833);return _0x3621d2[_0x1ca9('0x21')](_0x1ca9('0x22'),_0x2a0a25+'-'+_0x871405+'/'+_0x44c7b5)['json'](_0x4805d1);}return null;};}function patchUpdates(_0x59212a){return function(_0xd47bad){try{jsonpatch[_0x1ca9('0x23')](_0xd47bad,_0x59212a,!![]);}catch(_0x39ee3d){return BPromise[_0x1ca9('0x24')](_0x39ee3d);}return _0xd47bad[_0x1ca9('0x25')]();};}function saveUpdates(_0x364192,_0x359031){return function(_0x24be1a){if(_0x24be1a){return _0x24be1a[_0x1ca9('0x26')](_0x364192)['then'](function(_0x55fe01){return _0x55fe01;});}return null;};}function removeEntity(_0x491b1c,_0x1ea73d){return function(_0x3da440){if(_0x3da440){return _0x3da440[_0x1ca9('0x27')]()[_0x1ca9('0x28')](function(){var _0x4a24ec=_0x3da440['get']({'plain':!![]});var _0x383f1f=_0x1ca9('0x29');return db[_0x1ca9('0x2a')][_0x1ca9('0x27')]({'where':{'type':_0x383f1f,'resourceId':_0x4a24ec['id']}})[_0x1ca9('0x28')](function(){return _0x3da440;});})[_0x1ca9('0x28')](function(){_0x491b1c[_0x1ca9('0x1c')](0xcc)[_0x1ca9('0x2b')]();});}};}function handleEntityNotFound(_0x57fbff,_0x3a6614){return function(_0x5155a8){if(!_0x5155a8){_0x57fbff[_0x1ca9('0x1b')](0x194);}return _0x5155a8;};}function handleError(_0x58202c,_0x14b6f4){_0x14b6f4=_0x14b6f4||0x1f4;return function(_0x189c96){logger[_0x1ca9('0x2c')](_0x189c96['stack']);if(_0x189c96[_0x1ca9('0x2d')]){delete _0x189c96['name'];}_0x58202c[_0x1ca9('0x1c')](_0x14b6f4)['send'](_0x189c96);};}exports[_0x1ca9('0x2e')]=function(_0x5dd686,_0x5ea756){var _0x12e019={},_0x5aae01={},_0x8aa1a={'count':0x0,'rows':[]};var _0x210ce2=_[_0x1ca9('0x2f')](db[_0x1ca9('0x30')]['rawAttributes'],function(_0x17c493){return{'name':_0x17c493[_0x1ca9('0x31')],'type':_0x17c493[_0x1ca9('0x32')][_0x1ca9('0x33')]};});_0x5aae01[_0x1ca9('0x34')]=_[_0x1ca9('0x2f')](_0x210ce2,_0x1ca9('0x2d'));_0x5aae01[_0x1ca9('0x35')]=_[_0x1ca9('0x36')](_0x5dd686['query']);_0x5aae01['filters']=_[_0x1ca9('0x37')](_0x5aae01[_0x1ca9('0x34')],_0x5aae01[_0x1ca9('0x35')]);_0x12e019[_0x1ca9('0x38')]=_['intersection'](_0x5aae01[_0x1ca9('0x34')],qs[_0x1ca9('0x39')](_0x5dd686['query']['fields']));_0x12e019[_0x1ca9('0x38')]=_0x12e019['attributes']['length']?_0x12e019[_0x1ca9('0x38')]:_0x5aae01[_0x1ca9('0x34')];if(!_0x5dd686[_0x1ca9('0x35')][_0x1ca9('0x3a')](_0x1ca9('0x3b'))){_0x12e019['limit']=qs[_0x1ca9('0x1f')](_0x5dd686[_0x1ca9('0x35')][_0x1ca9('0x1f')]);_0x12e019[_0x1ca9('0x1e')]=qs[_0x1ca9('0x1e')](_0x5dd686[_0x1ca9('0x35')][_0x1ca9('0x1e')]);}_0x12e019['order']=qs['sort'](_0x5dd686[_0x1ca9('0x35')][_0x1ca9('0x3c')]);_0x12e019[_0x1ca9('0x3d')]=qs[_0x1ca9('0x3e')](_[_0x1ca9('0x3f')](_0x5dd686['query'],_0x5aae01['filters']),_0x210ce2);if(_0x5dd686['query'][_0x1ca9('0x40')]){_0x12e019[_0x1ca9('0x3d')]=_[_0x1ca9('0x41')](_0x12e019[_0x1ca9('0x3d')],{'$or':_['map'](_0x210ce2,function(_0x17c4b9){if(_0x17c4b9[_0x1ca9('0x32')]!==_0x1ca9('0x42')){var _0x26be9b={};_0x26be9b[_0x17c4b9[_0x1ca9('0x2d')]]={'$like':'%'+_0x5dd686['query'][_0x1ca9('0x40')]+'%'};return _0x26be9b;}})});}_0x12e019=_[_0x1ca9('0x41')]({},_0x12e019,_0x5dd686[_0x1ca9('0x43')]);var _0x476ca0={'where':_0x12e019[_0x1ca9('0x3d')]};return db['FaxQueue'][_0x1ca9('0x44')](_0x476ca0)[_0x1ca9('0x28')](function(_0x451884){_0x8aa1a[_0x1ca9('0x44')]=_0x451884;if(_0x5dd686[_0x1ca9('0x35')][_0x1ca9('0x45')]){_0x12e019[_0x1ca9('0x46')]=[{'all':!![]}];}return db[_0x1ca9('0x30')][_0x1ca9('0x47')](_0x12e019);})[_0x1ca9('0x28')](function(_0x1060a5){_0x8aa1a[_0x1ca9('0x48')]=_0x1060a5;return _0x8aa1a;})[_0x1ca9('0x28')](respondWithFilteredResult(_0x5ea756,_0x12e019))[_0x1ca9('0x49')](handleError(_0x5ea756,null));};exports['show']=function(_0x24cff2,_0x18c3a0){var _0x232507={'raw':!![],'where':{'id':_0x24cff2['params']['id']}},_0x59fafc={};_0x59fafc[_0x1ca9('0x34')]=_['keys'](db[_0x1ca9('0x30')][_0x1ca9('0x4a')]);_0x59fafc[_0x1ca9('0x35')]=_[_0x1ca9('0x36')](_0x24cff2[_0x1ca9('0x35')]);_0x59fafc[_0x1ca9('0x3e')]=_[_0x1ca9('0x37')](_0x59fafc[_0x1ca9('0x34')],_0x59fafc[_0x1ca9('0x35')]);_0x232507[_0x1ca9('0x38')]=_[_0x1ca9('0x37')](_0x59fafc[_0x1ca9('0x34')],qs['fields'](_0x24cff2[_0x1ca9('0x35')][_0x1ca9('0x39')]));_0x232507['attributes']=_0x232507['attributes'][_0x1ca9('0x4b')]?_0x232507[_0x1ca9('0x38')]:_0x59fafc[_0x1ca9('0x34')];if(_0x24cff2[_0x1ca9('0x35')][_0x1ca9('0x45')]){_0x232507[_0x1ca9('0x46')]=[{'all':!![]}];}_0x232507=_['merge']({},_0x232507,_0x24cff2[_0x1ca9('0x43')]);return db[_0x1ca9('0x30')]['find'](_0x232507)[_0x1ca9('0x28')](handleEntityNotFound(_0x18c3a0,null))[_0x1ca9('0x28')](respondWithResult(_0x18c3a0,null))[_0x1ca9('0x49')](handleError(_0x18c3a0,null));};exports[_0x1ca9('0x4c')]=function(_0x122d1c,_0x1d18d7){return db[_0x1ca9('0x30')]['create'](_0x122d1c['body'],{})[_0x1ca9('0x28')](function(_0x186c66){var _0x404e0d=_0x122d1c[_0x1ca9('0x4d')]['get']({'plain':!![]});if(!_0x404e0d)throw new Error(_0x1ca9('0x4e'));if(_0x404e0d[_0x1ca9('0x4f')]==='user'){var _0x53d29b=_0x186c66[_0x1ca9('0x50')]({'plain':!![]});var _0x2d104e=_0x1ca9('0x29');return db['UserProfileSection'][_0x1ca9('0x51')]({'where':{'name':_0x2d104e,'userProfileId':_0x404e0d[_0x1ca9('0x52')]},'raw':!![]})['then'](function(_0x46c615){if(_0x46c615&&_0x46c615[_0x1ca9('0x53')]===0x0){return db[_0x1ca9('0x2a')]['create']({'name':_0x53d29b[_0x1ca9('0x2d')],'resourceId':_0x53d29b['id'],'type':_0x46c615['name'],'sectionId':_0x46c615['id']},{})['then'](function(){return _0x186c66;});}else{return _0x186c66;}})[_0x1ca9('0x49')](function(_0x5df7c5){logger['error'](_0x1ca9('0x54'),_0x5df7c5);throw _0x5df7c5;});}return _0x186c66;})[_0x1ca9('0x28')](respondWithResult(_0x1d18d7,0xc9))[_0x1ca9('0x49')](handleError(_0x1d18d7,null));};exports[_0x1ca9('0x26')]=function(_0x1f4918,_0x169376){if(_0x1f4918['body']['id']){delete _0x1f4918[_0x1ca9('0x55')]['id'];}return db[_0x1ca9('0x30')][_0x1ca9('0x51')]({'where':{'id':_0x1f4918['params']['id']}})[_0x1ca9('0x28')](handleEntityNotFound(_0x169376,null))[_0x1ca9('0x28')](saveUpdates(_0x1f4918[_0x1ca9('0x55')],null))[_0x1ca9('0x28')](respondWithResult(_0x169376,null))[_0x1ca9('0x49')](handleError(_0x169376,null));};exports[_0x1ca9('0x27')]=function(_0xf7e666,_0x295375){return db[_0x1ca9('0x30')]['find']({'where':{'id':_0xf7e666[_0x1ca9('0x56')]['id']}})['then'](handleEntityNotFound(_0x295375,null))[_0x1ca9('0x28')](removeEntity(_0x295375,null))['catch'](handleError(_0x295375,null));};exports[_0x1ca9('0x57')]=function(_0x54a9ec,_0x200e88){return db[_0x1ca9('0x30')][_0x1ca9('0x57')]()[_0x1ca9('0x28')](respondWithResult(_0x200e88,null))[_0x1ca9('0x49')](handleError(_0x200e88,null));};exports[_0x1ca9('0x58')]=function(_0xc4d03c,_0x339186,_0x3c64a7){var _0x9eee02={'raw':!![],'where':{}},_0x326fdb={},_0x5f1956;return db['FaxQueue']['findOne']({'where':{'id':_0xc4d03c['params']['id']}})[_0x1ca9('0x28')](handleEntityNotFound(_0x339186,null))['then'](function(_0x5b28dd){if(_0x5b28dd){_0x5f1956=_0x5b28dd[_0x1ca9('0x50')]({'plain':!![]});_0x326fdb[_0x1ca9('0x34')]=_['keys'](db[_0x1ca9('0x59')]['rawAttributes']);_0x326fdb['query']=_[_0x1ca9('0x36')](_0xc4d03c['query']);_0x326fdb[_0x1ca9('0x3e')]=_[_0x1ca9('0x37')](_0x326fdb[_0x1ca9('0x34')],_0x326fdb[_0x1ca9('0x35')]);_0x9eee02[_0x1ca9('0x38')]=_[_0x1ca9('0x37')](_0x326fdb[_0x1ca9('0x34')],qs[_0x1ca9('0x39')](_0xc4d03c[_0x1ca9('0x35')][_0x1ca9('0x39')]));_0x9eee02[_0x1ca9('0x38')]=_0x9eee02[_0x1ca9('0x38')][_0x1ca9('0x4b')]?_0x9eee02['attributes']:_0x326fdb[_0x1ca9('0x34')];if(!_0xc4d03c['query'][_0x1ca9('0x3a')]('nolimit')){_0x9eee02[_0x1ca9('0x1f')]=qs[_0x1ca9('0x1f')](_0xc4d03c[_0x1ca9('0x35')]['limit']);_0x9eee02[_0x1ca9('0x1e')]=qs[_0x1ca9('0x1e')](_0xc4d03c[_0x1ca9('0x35')][_0x1ca9('0x1e')]);}_0x9eee02[_0x1ca9('0x5a')]=qs[_0x1ca9('0x3c')](_0xc4d03c[_0x1ca9('0x35')][_0x1ca9('0x3c')]);_0x9eee02[_0x1ca9('0x3d')]=qs[_0x1ca9('0x3e')](_[_0x1ca9('0x3f')](_0xc4d03c['query'],_0x326fdb[_0x1ca9('0x3e')]));_0x9eee02[_0x1ca9('0x3d')][_0x1ca9('0x5b')]=_0x5b28dd['id'];if(_0xc4d03c[_0x1ca9('0x35')][_0x1ca9('0x40')]){_0x9eee02['where']=_[_0x1ca9('0x41')](_0x9eee02['where'],{'$or':_[_0x1ca9('0x2f')](_0x9eee02[_0x1ca9('0x38')],function(_0x265e68){var _0xc5ea7={};_0xc5ea7[_0x265e68]={'$like':'%'+_0xc4d03c[_0x1ca9('0x35')][_0x1ca9('0x40')]+'%'};return _0xc5ea7;})});}_0x9eee02=_['merge']({},_0x9eee02,_0xc4d03c['options']);return db[_0x1ca9('0x59')][_0x1ca9('0x47')](_0x9eee02);}})[_0x1ca9('0x28')](function(_0x5cdab4){if(_0x5cdab4){return db['User'][_0x1ca9('0x5c')]({'where':{'id':_[_0x1ca9('0x2f')](_0x5cdab4,_0x1ca9('0x5d')),'role':'agent'},'attributes':['id','name',_0x1ca9('0x5e'),_0x1ca9('0x5f'),_0x1ca9('0x60')]});}})[_0x1ca9('0x28')](function(_0x82f1f9){if(_0x82f1f9){return{'count':_0x82f1f9[_0x1ca9('0x44')],'rows':_['map'](_0x82f1f9['rows'],function(_0x53b48b){return{'membername':_0x53b48b[_0x1ca9('0x2d')],'UserId':_0x53b48b['id'],'queue_name':_0x5f1956[_0x1ca9('0x2d')],'FaxQueueId':_0x5f1956['id'],'interface':util['format'](_0x1ca9('0x61'),'SIP',_0x53b48b['name']),'penalty':0x0,'paused':_0x53b48b[_0x1ca9('0x5e')],'createdAt':_0x53b48b[_0x1ca9('0x60')],'updatedAt':_0x53b48b[_0x1ca9('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x1ca9('0x28')](respondWithFilteredResult(_0x339186,_0x9eee02))[_0x1ca9('0x49')](handleError(_0x339186,null));};exports[_0x1ca9('0x62')]=function(_0x236095,_0xacdbf3,_0xfb716b){var _0x99435f={};var _0x1def33={};var _0x442ad2;var _0x4d5313;return db[_0x1ca9('0x30')]['findOne']({'where':{'id':_0x236095[_0x1ca9('0x56')]['id']}})[_0x1ca9('0x28')](handleEntityNotFound(_0xacdbf3,null))[_0x1ca9('0x28')](function(_0x27b0c1){if(_0x27b0c1){_0x442ad2=_0x27b0c1;_0x1def33['model']=_[_0x1ca9('0x36')](db['Team']['rawAttributes']);_0x1def33[_0x1ca9('0x35')]=_[_0x1ca9('0x36')](_0x236095[_0x1ca9('0x35')]);_0x1def33[_0x1ca9('0x3e')]=_['intersection'](_0x1def33[_0x1ca9('0x34')],_0x1def33['query']);_0x99435f[_0x1ca9('0x38')]=_[_0x1ca9('0x37')](_0x1def33[_0x1ca9('0x34')],qs[_0x1ca9('0x39')](_0x236095[_0x1ca9('0x35')]['fields']));_0x99435f[_0x1ca9('0x38')]=_0x99435f[_0x1ca9('0x38')][_0x1ca9('0x4b')]?_0x99435f[_0x1ca9('0x38')]:_0x1def33['model'];_0x99435f[_0x1ca9('0x5a')]=qs[_0x1ca9('0x3c')](_0x236095[_0x1ca9('0x35')][_0x1ca9('0x3c')]);_0x99435f[_0x1ca9('0x3d')]=qs[_0x1ca9('0x3e')](_['pick'](_0x236095['query'],_0x1def33['filters']));if(_0x236095[_0x1ca9('0x35')][_0x1ca9('0x40')]){_0x99435f[_0x1ca9('0x3d')]=_['merge'](_0x99435f[_0x1ca9('0x3d')],{'$or':_[_0x1ca9('0x2f')](_0x99435f[_0x1ca9('0x38')],function(_0x536621){var _0x1e276a={};_0x1e276a[_0x536621]={'$like':'%'+_0x236095[_0x1ca9('0x35')]['filter']+'%'};return _0x1e276a;})});}_0x99435f=_['merge']({},_0x99435f,_0x236095['options']);return _0x442ad2['getTeams'](_0x99435f);}})[_0x1ca9('0x28')](function(_0x51c6b4){if(_0x51c6b4){_0x4d5313=_0x51c6b4['length'];if(!_0x236095[_0x1ca9('0x35')][_0x1ca9('0x3a')](_0x1ca9('0x3b'))){_0x99435f[_0x1ca9('0x1f')]=qs[_0x1ca9('0x1f')](_0x236095[_0x1ca9('0x35')][_0x1ca9('0x1f')]);_0x99435f['offset']=qs[_0x1ca9('0x1e')](_0x236095[_0x1ca9('0x35')][_0x1ca9('0x1e')]);}return _0x442ad2['getTeams'](_0x99435f);}})['then'](function(_0x261194){if(_0x261194){return _0x261194?{'count':_0x4d5313,'rows':_0x261194}:null;}})['then'](respondWithResult(_0xacdbf3,null))[_0x1ca9('0x49')](handleError(_0xacdbf3,null));};exports[_0x1ca9('0x63')]=function(_0xdacad9,_0x5eaa13,_0x40cdfd){var _0x5c0500=_0xdacad9[_0x1ca9('0x55')][_0x1ca9('0x64')];return db[_0x1ca9('0x65')][_0x1ca9('0x47')]({'where':{'id':_0x5c0500},'attributes':['id'],'include':[{'model':db[_0x1ca9('0x66')],'as':_0x1ca9('0x67'),'attributes':['id',_0x1ca9('0x2d'),_0x1ca9('0x68'),_0x1ca9('0x69'),_0x1ca9('0x6a')],'raw':!![]}]})[_0x1ca9('0x28')](function(_0x6f4dbb){if(_0x6f4dbb){var _0x1040d3=_[_0x1ca9('0x6b')](_0x6f4dbb,function(_0x353e2a){var _0x1313f0=_0x353e2a[_0x1ca9('0x50')]({'plain':!![]});return _0x1313f0['Agents'];});return db[_0x1ca9('0x30')][_0x1ca9('0x51')]({'where':{'id':_0xdacad9[_0x1ca9('0x56')]['id']}})[_0x1ca9('0x28')](function(_0x17ffb1){return db[_0x1ca9('0x6c')]['transaction'](function(_0x57b879){return _0x17ffb1[_0x1ca9('0x63')](_0x5c0500,{'transaction':_0x57b879})[_0x1ca9('0x28')](function(){return BPromise[_0x1ca9('0x6d')](_0x1040d3,function(_0x394643){return db[_0x1ca9('0x59')][_0x1ca9('0x6e')]({'where':{'UserId':_0x394643['id'],'FaxQueueId':_0xdacad9[_0x1ca9('0x56')]['id']},'transaction':_0x57b879});});})[_0x1ca9('0x28')](function(){_0x1040d3['forEach'](function(_0x59b0c2){socket['emit'](_0x1ca9('0x6f'),{'UserId':_0x59b0c2['id'],'FaxQueueId':_0x17ffb1['id']});});});});});}})[_0x1ca9('0x28')](respondWithStatusCode(_0x5eaa13,null))[_0x1ca9('0x49')](handleError(_0x5eaa13,null));};exports[_0x1ca9('0x70')]=function(_0x1a4f8b,_0x46390a,_0x4fa0e7){return db['Team'][_0x1ca9('0x47')]({'where':{'id':_0x1a4f8b['query'][_0x1ca9('0x64')]},'attributes':['id'],'include':[{'model':db[_0x1ca9('0x66')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x1ca9('0x28')](handleEntityNotFound(_0x46390a,null))[_0x1ca9('0x28')](function(_0x5da55b){var _0x5b271b=_['map'](_0x5da55b,'id');var _0x26b90e=[];var _0x1e5d04=[];var _0x5cdf2c=squel[_0x1ca9('0x71')]();_0x5cdf2c['field']('tq.TeamId')[_0x1ca9('0x72')]('team_has_fax_queues','tq')[_0x1ca9('0x73')](_0x1ca9('0x74'),'ut',_0x1ca9('0x75'))[_0x1ca9('0x3d')](_0x1ca9('0x76'),_0x1a4f8b[_0x1ca9('0x56')]['id']);for(var _0x2a2e67=0x0;_0x2a2e67<_0x5da55b[_0x1ca9('0x4b')];_0x2a2e67+=0x1){let _0x4ae65e=_0x5da55b[_0x2a2e67];for(var _0x23c994=0x0;_0x23c994<_0x4ae65e[_0x1ca9('0x67')][_0x1ca9('0x4b')];_0x23c994+=0x1){let _0x1f3a2e=_0x4ae65e['Agents'][_0x23c994];var _0x5af634=_0x5cdf2c[_0x1ca9('0x77')]();_0x5af634['where'](_0x1ca9('0x78'),_0x1f3a2e['id']);_0x1e5d04['push'](db['sequelize'][_0x1ca9('0x35')](_0x5af634[_0x1ca9('0x79')](),{'type':db[_0x1ca9('0x6c')][_0x1ca9('0x7a')]['SELECT']})[_0x1ca9('0x28')](function(_0x5bb0b3){if(_0x5bb0b3['length']===0x1){return _0x1f3a2e['id'];}else{var _0x598d2f=_[_0x1ca9('0x7b')](_[_0x1ca9('0x2f')](_0x5bb0b3,'TeamId'),function(_0x1d1d9a){return _['includes'](_0x5b271b,_0x1d1d9a);});if(_0x598d2f){return _0x1f3a2e['id'];}}}));}}return BPromise['all'](_0x1e5d04)['then'](function(_0x29911a){_0x26b90e=_(_0x26b90e)['union'](_0x29911a)['compact']()[_0x1ca9('0x7c')]();return db[_0x1ca9('0x30')][_0x1ca9('0x51')]({'where':{'id':_0x1a4f8b[_0x1ca9('0x56')]['id']}})[_0x1ca9('0x28')](function(_0x4c81f0){return db['sequelize'][_0x1ca9('0x7d')](function(_0x32ce34){return _0x4c81f0[_0x1ca9('0x70')](_0x1a4f8b[_0x1ca9('0x35')][_0x1ca9('0x64')],{'transaction':_0x32ce34})[_0x1ca9('0x28')](function(){if(!_[_0x1ca9('0x7e')](_0x26b90e)){return _0x4c81f0['removeAgents'](_0x26b90e,{'transaction':_0x32ce34});}})[_0x1ca9('0x28')](function(){_0x26b90e[_0x1ca9('0x7f')](function(_0xf42bd0){socket[_0x1ca9('0x80')](_0x1ca9('0x81'),{'UserId':_0xf42bd0,'FaxQueueId':_0x4c81f0['id']});});});});});});})[_0x1ca9('0x28')](respondWithStatusCode(_0x46390a,null))[_0x1ca9('0x49')](handleError(_0x46390a,null));};exports[_0x1ca9('0x82')]=function(_0x1a7a6b,_0x17cbe9,_0x4801ef){return db[_0x1ca9('0x30')][_0x1ca9('0x51')]({'where':{'id':_0x1a7a6b[_0x1ca9('0x56')]['id']}})[_0x1ca9('0x28')](handleEntityNotFound(_0x17cbe9,null))['then'](function(_0x4181fd){if(_0x4181fd){return _0x4181fd[_0x1ca9('0x82')](_0x1a7a6b[_0x1ca9('0x55')][_0x1ca9('0x64')],_['omit'](_0x1a7a6b[_0x1ca9('0x55')],[_0x1ca9('0x64'),'id'])||{})[_0x1ca9('0x83')](function(_0x197501){for(var _0x3d1ecf=0x0;_0x3d1ecf<_0x1a7a6b['body']['ids']['length'];_0x3d1ecf+=0x1){socket[_0x1ca9('0x80')](_0x1ca9('0x6f'),{'UserId':Number(_0x1a7a6b[_0x1ca9('0x55')]['ids'][_0x3d1ecf]),'FaxQueueId':Number(_0x1a7a6b['params']['id'])});}return _0x197501;});}})[_0x1ca9('0x28')](respondWithResult(_0x17cbe9,null))['catch'](handleError(_0x17cbe9,null));};exports[_0x1ca9('0x84')]=function(_0x4726c8,_0xcc9769,_0x154bfc){return db[_0x1ca9('0x30')][_0x1ca9('0x51')]({'where':{'id':_0x4726c8[_0x1ca9('0x56')]['id']}})['then'](handleEntityNotFound(_0xcc9769,null))[_0x1ca9('0x28')](function(_0x1b6166){if(_0x1b6166){return _0x1b6166[_0x1ca9('0x84')](_0x4726c8[_0x1ca9('0x35')][_0x1ca9('0x64')])[_0x1ca9('0x28')](function(){if(_['isArray'](_0x4726c8[_0x1ca9('0x35')][_0x1ca9('0x64')])){for(var _0x1a9919=0x0;_0x1a9919<_0x4726c8[_0x1ca9('0x35')][_0x1ca9('0x64')]['length'];_0x1a9919+=0x1){socket[_0x1ca9('0x80')](_0x1ca9('0x81'),{'UserId':Number(_0x4726c8['query']['ids'][_0x1a9919]),'FaxQueueId':Number(_0x4726c8[_0x1ca9('0x56')]['id'])});}}else{socket['emit']('userFaxQueue:remove',{'UserId':Number(_0x4726c8[_0x1ca9('0x35')][_0x1ca9('0x64')]),'FaxQueueId':Number(_0x4726c8[_0x1ca9('0x56')]['id'])});}});}})[_0x1ca9('0x28')](respondWithStatusCode(_0xcc9769,null))[_0x1ca9('0x49')](handleError(_0xcc9769,null));};exports[_0x1ca9('0x85')]=function(_0xef30b8,_0x4bae4e,_0x266a5c){var _0x188286={};var _0x27276d={};var _0x54ef72;var _0xee48c9;return db[_0x1ca9('0x30')][_0x1ca9('0x86')]({'where':{'id':_0xef30b8[_0x1ca9('0x56')]['id']}})[_0x1ca9('0x28')](handleEntityNotFound(_0x4bae4e,null))[_0x1ca9('0x28')](function(_0x39aa5e){if(_0x39aa5e){_0x54ef72=_0x39aa5e;_0x27276d['model']=_[_0x1ca9('0x36')](db[_0x1ca9('0x66')][_0x1ca9('0x4a')]);_0x27276d[_0x1ca9('0x35')]=_['keys'](_0xef30b8[_0x1ca9('0x35')]);_0x27276d[_0x1ca9('0x3e')]=_[_0x1ca9('0x37')](_0x27276d[_0x1ca9('0x34')],_0x27276d[_0x1ca9('0x35')]);_0x188286[_0x1ca9('0x38')]=_['intersection'](_0x27276d[_0x1ca9('0x34')],qs['fields'](_0xef30b8[_0x1ca9('0x35')]['fields']));_0x188286['attributes']=_0x188286['attributes']['length']?_0x188286['attributes']:_0x27276d[_0x1ca9('0x34')];_0x188286[_0x1ca9('0x5a')]=qs[_0x1ca9('0x3c')](_0xef30b8[_0x1ca9('0x35')][_0x1ca9('0x3c')]);_0x188286[_0x1ca9('0x3d')]=qs[_0x1ca9('0x3e')](_[_0x1ca9('0x3f')](_0xef30b8[_0x1ca9('0x35')],_0x27276d[_0x1ca9('0x3e')]));if(_0xef30b8[_0x1ca9('0x35')][_0x1ca9('0x40')]){_0x188286[_0x1ca9('0x3d')]=_[_0x1ca9('0x41')](_0x188286[_0x1ca9('0x3d')],{'$or':_[_0x1ca9('0x2f')](_0x188286[_0x1ca9('0x38')],function(_0x3fea03){var _0x22d33b={};_0x22d33b[_0x3fea03]={'$like':'%'+_0xef30b8['query']['filter']+'%'};return _0x22d33b;})});}_0x188286=_['merge']({},_0x188286,_0xef30b8[_0x1ca9('0x43')]);return _0x54ef72['getAgents'](_0x188286);}})[_0x1ca9('0x28')](function(_0x137df2){if(_0x137df2){_0xee48c9=_0x137df2[_0x1ca9('0x4b')];if(!_0xef30b8[_0x1ca9('0x35')][_0x1ca9('0x3a')](_0x1ca9('0x3b'))){_0x188286[_0x1ca9('0x1f')]=qs['limit'](_0xef30b8[_0x1ca9('0x35')][_0x1ca9('0x1f')]);_0x188286['offset']=qs[_0x1ca9('0x1e')](_0xef30b8[_0x1ca9('0x35')]['offset']);}return _0x54ef72[_0x1ca9('0x85')](_0x188286);}})[_0x1ca9('0x28')](function(_0x1ccaed){if(_0x1ccaed){return _0x1ccaed?{'count':_0xee48c9,'rows':_0x1ccaed}:null;}})[_0x1ca9('0x28')](respondWithResult(_0x4bae4e,null))[_0x1ca9('0x49')](handleError(_0x4bae4e,null));}; \ No newline at end of file +var _0x26f7=['SELECT','every','TeamId','includes','all','union','value','removeTeams','isEmpty','removeAgents','emit','userFaxQueue:remove','omit','spread','isArray','getAgents','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/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','save','update','destroy','then','get','FaxQueues','name','send','index','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','FaxQueue','includeAll','include','findAll','catch','show','fields','create','body','user','role','UserProfileSection','userProfileId','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','params','describe','getMembers','findOne','FaxQueueId','filter','UserFaxQueue','findAndCountAll','UserId','agent','faxPause','updatedAt','rows','format','%s/%s','createdAt','getTeams','Team','addTeams','ids','User','online','voicePause','interface','Agents','transaction','each','findOrCreate','forEach','userFaxQueue:save','field','team_has_fax_queues','FaxQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','sequelize','QueryTypes'];(function(_0x27756e,_0x4bb95d){var _0x5f5839=function(_0x2ece7b){while(--_0x2ece7b){_0x27756e['push'](_0x27756e['shift']());}};_0x5f5839(++_0x4bb95d);}(_0x26f7,0x12e));var _0x726f=function(_0x442981,_0x564dab){_0x442981=_0x442981-0x0;var _0x6da797=_0x26f7[_0x442981];return _0x6da797;};'use strict';var emlformat=require(_0x726f('0x0'));var rimraf=require(_0x726f('0x1'));var zipdir=require(_0x726f('0x2'));var jsonpatch=require(_0x726f('0x3'));var rp=require(_0x726f('0x4'));var moment=require(_0x726f('0x5'));var BPromise=require(_0x726f('0x6'));var Mustache=require(_0x726f('0x7'));var util=require('util');var path=require(_0x726f('0x8'));var sox=require(_0x726f('0x9'));var csv=require(_0x726f('0xa'));var ejs=require(_0x726f('0xb'));var fs=require('fs');var fs_extra=require(_0x726f('0xc'));var _=require(_0x726f('0xd'));var squel=require(_0x726f('0xe'));var crypto=require(_0x726f('0xf'));var jsforce=require(_0x726f('0x10'));var deskjs=require(_0x726f('0x11'));var toCsv=require(_0x726f('0xa'));var querystring=require(_0x726f('0x12'));var Papa=require(_0x726f('0x13'));var Redis=require(_0x726f('0x14'));var authService=require(_0x726f('0x15'));var qs=require(_0x726f('0x16'));var as=require(_0x726f('0x17'));var hardwareService=require(_0x726f('0x18'));var logger=require(_0x726f('0x19'))(_0x726f('0x1a'));var utils=require(_0x726f('0x1b'));var config=require(_0x726f('0x1c'));var licenseUtil=require(_0x726f('0x1d'));var db=require(_0x726f('0x1e'))['db'];config[_0x726f('0x1f')]=_['defaults'](config[_0x726f('0x1f')],{'host':_0x726f('0x20'),'port':0x18eb});var socket=require(_0x726f('0x21'))(new Redis(config[_0x726f('0x1f')]));require('./faxQueue.socket')[_0x726f('0x22')](socket);function respondWithStatusCode(_0x2611be,_0x235975){_0x235975=_0x235975||0xcc;return function(_0x19db52){if(_0x19db52){return _0x2611be[_0x726f('0x23')](_0x235975);}return _0x2611be[_0x726f('0x24')](_0x235975)[_0x726f('0x25')]();};}function respondWithResult(_0x5483e0,_0x3aa9aa){_0x3aa9aa=_0x3aa9aa||0xc8;return function(_0x5d69a2){if(_0x5d69a2){return _0x5483e0[_0x726f('0x24')](_0x3aa9aa)[_0x726f('0x26')](_0x5d69a2);}};}function respondWithFilteredResult(_0x58a918,_0x4677d0){return function(_0x4bf7d9){if(_0x4bf7d9){var _0x2e8e89=typeof _0x4677d0[_0x726f('0x27')]===_0x726f('0x28')&&typeof _0x4677d0[_0x726f('0x29')]==='undefined';var _0x1375bd=_0x4bf7d9[_0x726f('0x2a')];var _0x19860e=_0x2e8e89?0x0:_0x4677d0[_0x726f('0x27')];var _0x24d196=_0x2e8e89?_0x4bf7d9[_0x726f('0x2a')]:_0x4677d0[_0x726f('0x27')]+_0x4677d0[_0x726f('0x29')];var _0x59f461;if(_0x24d196>=_0x1375bd){_0x24d196=_0x1375bd;_0x59f461=0xc8;}else{_0x59f461=0xce;}_0x58a918[_0x726f('0x24')](_0x59f461);return _0x58a918['set'](_0x726f('0x2b'),_0x19860e+'-'+_0x24d196+'/'+_0x1375bd)['json'](_0x4bf7d9);}return null;};}function patchUpdates(_0x1e5603){return function(_0x49ece1){try{jsonpatch['apply'](_0x49ece1,_0x1e5603,!![]);}catch(_0x386cb4){return BPromise['reject'](_0x386cb4);}return _0x49ece1[_0x726f('0x2c')]();};}function saveUpdates(_0x17edbb,_0x313f04){return function(_0x391d81){if(_0x391d81){return _0x391d81[_0x726f('0x2d')](_0x17edbb)['then'](function(_0x406d33){return _0x406d33;});}return null;};}function removeEntity(_0x4c1e0e,_0x46a020){return function(_0x236513){if(_0x236513){return _0x236513[_0x726f('0x2e')]()[_0x726f('0x2f')](function(){var _0x18b256=_0x236513[_0x726f('0x30')]({'plain':!![]});var _0x4dd536=_0x726f('0x31');return db['UserProfileResource'][_0x726f('0x2e')]({'where':{'type':_0x4dd536,'resourceId':_0x18b256['id']}})[_0x726f('0x2f')](function(){return _0x236513;});})['then'](function(){_0x4c1e0e[_0x726f('0x24')](0xcc)[_0x726f('0x25')]();});}};}function handleEntityNotFound(_0x1aeaa9,_0x297022){return function(_0x1f83c9){if(!_0x1f83c9){_0x1aeaa9[_0x726f('0x23')](0x194);}return _0x1f83c9;};}function handleError(_0x489372,_0x26f6a0){_0x26f6a0=_0x26f6a0||0x1f4;return function(_0x3c418b){logger['error'](_0x3c418b['stack']);if(_0x3c418b['name']){delete _0x3c418b[_0x726f('0x32')];}_0x489372[_0x726f('0x24')](_0x26f6a0)[_0x726f('0x33')](_0x3c418b);};}exports[_0x726f('0x34')]=function(_0x26a157,_0x5f21ea){var _0x171113={},_0x2caedd={},_0xbc4f7a={'count':0x0,'rows':[]};var _0xf314c0=_['map'](db['FaxQueue'][_0x726f('0x35')],function(_0x2952f4){return{'name':_0x2952f4[_0x726f('0x36')],'type':_0x2952f4[_0x726f('0x37')][_0x726f('0x38')]};});_0x2caedd['model']=_[_0x726f('0x39')](_0xf314c0,_0x726f('0x32'));_0x2caedd[_0x726f('0x3a')]=_[_0x726f('0x3b')](_0x26a157[_0x726f('0x3a')]);_0x2caedd[_0x726f('0x3c')]=_[_0x726f('0x3d')](_0x2caedd[_0x726f('0x3e')],_0x2caedd[_0x726f('0x3a')]);_0x171113['attributes']=_[_0x726f('0x3d')](_0x2caedd[_0x726f('0x3e')],qs['fields'](_0x26a157[_0x726f('0x3a')]['fields']));_0x171113[_0x726f('0x3f')]=_0x171113[_0x726f('0x3f')][_0x726f('0x40')]?_0x171113[_0x726f('0x3f')]:_0x2caedd[_0x726f('0x3e')];if(!_0x26a157[_0x726f('0x3a')][_0x726f('0x41')](_0x726f('0x42'))){_0x171113[_0x726f('0x29')]=qs[_0x726f('0x29')](_0x26a157[_0x726f('0x3a')][_0x726f('0x29')]);_0x171113[_0x726f('0x27')]=qs[_0x726f('0x27')](_0x26a157['query'][_0x726f('0x27')]);}_0x171113[_0x726f('0x43')]=qs[_0x726f('0x44')](_0x26a157[_0x726f('0x3a')][_0x726f('0x44')]);_0x171113[_0x726f('0x45')]=qs[_0x726f('0x3c')](_[_0x726f('0x46')](_0x26a157[_0x726f('0x3a')],_0x2caedd[_0x726f('0x3c')]),_0xf314c0);if(_0x26a157[_0x726f('0x3a')]['filter']){_0x171113['where']=_[_0x726f('0x47')](_0x171113[_0x726f('0x45')],{'$or':_['map'](_0xf314c0,function(_0xa8a77a){if(_0xa8a77a[_0x726f('0x37')]!=='VIRTUAL'){var _0x117c12={};_0x117c12[_0xa8a77a[_0x726f('0x32')]]={'$like':'%'+_0x26a157[_0x726f('0x3a')]['filter']+'%'};return _0x117c12;}})});}_0x171113=_['merge']({},_0x171113,_0x26a157[_0x726f('0x48')]);var _0x43bf24={'where':_0x171113[_0x726f('0x45')]};return db[_0x726f('0x49')]['count'](_0x43bf24)['then'](function(_0x2d1293){_0xbc4f7a[_0x726f('0x2a')]=_0x2d1293;if(_0x26a157[_0x726f('0x3a')][_0x726f('0x4a')]){_0x171113[_0x726f('0x4b')]=[{'all':!![]}];}return db['FaxQueue'][_0x726f('0x4c')](_0x171113);})[_0x726f('0x2f')](function(_0x2981d8){_0xbc4f7a['rows']=_0x2981d8;return _0xbc4f7a;})[_0x726f('0x2f')](respondWithFilteredResult(_0x5f21ea,_0x171113))[_0x726f('0x4d')](handleError(_0x5f21ea,null));};exports[_0x726f('0x4e')]=function(_0x179560,_0x2cc849){var _0x3d1131={'raw':!![],'where':{'id':_0x179560['params']['id']}},_0x3f1cf7={};_0x3f1cf7[_0x726f('0x3e')]=_['keys'](db[_0x726f('0x49')][_0x726f('0x35')]);_0x3f1cf7['query']=_['keys'](_0x179560['query']);_0x3f1cf7[_0x726f('0x3c')]=_['intersection'](_0x3f1cf7[_0x726f('0x3e')],_0x3f1cf7['query']);_0x3d1131[_0x726f('0x3f')]=_['intersection'](_0x3f1cf7[_0x726f('0x3e')],qs[_0x726f('0x4f')](_0x179560[_0x726f('0x3a')][_0x726f('0x4f')]));_0x3d1131[_0x726f('0x3f')]=_0x3d1131[_0x726f('0x3f')][_0x726f('0x40')]?_0x3d1131[_0x726f('0x3f')]:_0x3f1cf7[_0x726f('0x3e')];if(_0x179560[_0x726f('0x3a')][_0x726f('0x4a')]){_0x3d1131[_0x726f('0x4b')]=[{'all':!![]}];}_0x3d1131=_[_0x726f('0x47')]({},_0x3d1131,_0x179560[_0x726f('0x48')]);return db[_0x726f('0x49')]['find'](_0x3d1131)[_0x726f('0x2f')](handleEntityNotFound(_0x2cc849,null))[_0x726f('0x2f')](respondWithResult(_0x2cc849,null))[_0x726f('0x4d')](handleError(_0x2cc849,null));};exports[_0x726f('0x50')]=function(_0x3ee303,_0x33e241){return db[_0x726f('0x49')][_0x726f('0x50')](_0x3ee303[_0x726f('0x51')],{})[_0x726f('0x2f')](function(_0x364369){var _0x352c0d=_0x3ee303[_0x726f('0x52')]['get']({'plain':!![]});if(!_0x352c0d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x352c0d[_0x726f('0x53')]==='user'){var _0x5a6247=_0x364369[_0x726f('0x30')]({'plain':!![]});var _0x535329='FaxQueues';return db[_0x726f('0x54')]['find']({'where':{'name':_0x535329,'userProfileId':_0x352c0d[_0x726f('0x55')]},'raw':!![]})[_0x726f('0x2f')](function(_0x24b705){if(_0x24b705&&_0x24b705['autoAssociation']===0x0){return db[_0x726f('0x56')][_0x726f('0x50')]({'name':_0x5a6247[_0x726f('0x32')],'resourceId':_0x5a6247['id'],'type':_0x24b705[_0x726f('0x32')],'sectionId':_0x24b705['id']},{})[_0x726f('0x2f')](function(){return _0x364369;});}else{return _0x364369;}})['catch'](function(_0x3ffbcd){logger[_0x726f('0x57')](_0x726f('0x58'),_0x3ffbcd);throw _0x3ffbcd;});}return _0x364369;})[_0x726f('0x2f')](respondWithResult(_0x33e241,0xc9))[_0x726f('0x4d')](handleError(_0x33e241,null));};exports[_0x726f('0x2d')]=function(_0x1da3ac,_0x54a48b){if(_0x1da3ac[_0x726f('0x51')]['id']){delete _0x1da3ac['body']['id'];}return db[_0x726f('0x49')][_0x726f('0x59')]({'where':{'id':_0x1da3ac[_0x726f('0x5a')]['id']}})['then'](handleEntityNotFound(_0x54a48b,null))['then'](saveUpdates(_0x1da3ac[_0x726f('0x51')],null))['then'](respondWithResult(_0x54a48b,null))['catch'](handleError(_0x54a48b,null));};exports['destroy']=function(_0x592740,_0x1cf2b8){return db[_0x726f('0x49')][_0x726f('0x59')]({'where':{'id':_0x592740[_0x726f('0x5a')]['id']}})[_0x726f('0x2f')](handleEntityNotFound(_0x1cf2b8,null))[_0x726f('0x2f')](removeEntity(_0x1cf2b8,null))['catch'](handleError(_0x1cf2b8,null));};exports[_0x726f('0x5b')]=function(_0x65e136,_0x29f6b0){return db[_0x726f('0x49')][_0x726f('0x5b')]()[_0x726f('0x2f')](respondWithResult(_0x29f6b0,null))[_0x726f('0x4d')](handleError(_0x29f6b0,null));};exports[_0x726f('0x5c')]=function(_0x181d81,_0x2e09da,_0x86aac1){var _0x53a88f={'raw':!![],'where':{}},_0x26dd4a={},_0x1c1c77;return db['FaxQueue'][_0x726f('0x5d')]({'where':{'id':_0x181d81[_0x726f('0x5a')]['id']}})[_0x726f('0x2f')](handleEntityNotFound(_0x2e09da,null))[_0x726f('0x2f')](function(_0x59bcf5){if(_0x59bcf5){_0x1c1c77=_0x59bcf5[_0x726f('0x30')]({'plain':!![]});_0x26dd4a[_0x726f('0x3e')]=_[_0x726f('0x3b')](db['UserFaxQueue'][_0x726f('0x35')]);_0x26dd4a[_0x726f('0x3a')]=_[_0x726f('0x3b')](_0x181d81[_0x726f('0x3a')]);_0x26dd4a['filters']=_[_0x726f('0x3d')](_0x26dd4a['model'],_0x26dd4a['query']);_0x53a88f[_0x726f('0x3f')]=_[_0x726f('0x3d')](_0x26dd4a[_0x726f('0x3e')],qs[_0x726f('0x4f')](_0x181d81['query'][_0x726f('0x4f')]));_0x53a88f[_0x726f('0x3f')]=_0x53a88f[_0x726f('0x3f')]['length']?_0x53a88f[_0x726f('0x3f')]:_0x26dd4a[_0x726f('0x3e')];if(!_0x181d81[_0x726f('0x3a')][_0x726f('0x41')](_0x726f('0x42'))){_0x53a88f[_0x726f('0x29')]=qs[_0x726f('0x29')](_0x181d81[_0x726f('0x3a')][_0x726f('0x29')]);_0x53a88f['offset']=qs['offset'](_0x181d81[_0x726f('0x3a')][_0x726f('0x27')]);}_0x53a88f[_0x726f('0x43')]=qs[_0x726f('0x44')](_0x181d81[_0x726f('0x3a')]['sort']);_0x53a88f[_0x726f('0x45')]=qs[_0x726f('0x3c')](_['pick'](_0x181d81[_0x726f('0x3a')],_0x26dd4a[_0x726f('0x3c')]));_0x53a88f['where'][_0x726f('0x5e')]=_0x59bcf5['id'];if(_0x181d81[_0x726f('0x3a')][_0x726f('0x5f')]){_0x53a88f['where']=_[_0x726f('0x47')](_0x53a88f[_0x726f('0x45')],{'$or':_[_0x726f('0x39')](_0x53a88f[_0x726f('0x3f')],function(_0x4bace6){var _0xb9e9af={};_0xb9e9af[_0x4bace6]={'$like':'%'+_0x181d81[_0x726f('0x3a')][_0x726f('0x5f')]+'%'};return _0xb9e9af;})});}_0x53a88f=_[_0x726f('0x47')]({},_0x53a88f,_0x181d81[_0x726f('0x48')]);return db[_0x726f('0x60')][_0x726f('0x4c')](_0x53a88f);}})[_0x726f('0x2f')](function(_0x34da10){if(_0x34da10){return db['User'][_0x726f('0x61')]({'where':{'id':_[_0x726f('0x39')](_0x34da10,_0x726f('0x62')),'role':_0x726f('0x63')},'attributes':['id',_0x726f('0x32'),_0x726f('0x64'),_0x726f('0x65'),'createdAt']});}})[_0x726f('0x2f')](function(_0x1d34c5){if(_0x1d34c5){return{'count':_0x1d34c5['count'],'rows':_[_0x726f('0x39')](_0x1d34c5[_0x726f('0x66')],function(_0x5c44e1){return{'membername':_0x5c44e1[_0x726f('0x32')],'UserId':_0x5c44e1['id'],'queue_name':_0x1c1c77['name'],'FaxQueueId':_0x1c1c77['id'],'interface':util[_0x726f('0x67')](_0x726f('0x68'),'SIP',_0x5c44e1['name']),'penalty':0x0,'paused':_0x5c44e1[_0x726f('0x64')],'createdAt':_0x5c44e1[_0x726f('0x69')],'updatedAt':_0x5c44e1[_0x726f('0x65')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x726f('0x2f')](respondWithFilteredResult(_0x2e09da,_0x53a88f))[_0x726f('0x4d')](handleError(_0x2e09da,null));};exports[_0x726f('0x6a')]=function(_0x16cb36,_0x2c1d0b,_0x28c4a2){var _0x49f83f={};var _0x22f9b2={};var _0x4766a9;var _0x42a6d6;return db[_0x726f('0x49')][_0x726f('0x5d')]({'where':{'id':_0x16cb36[_0x726f('0x5a')]['id']}})[_0x726f('0x2f')](handleEntityNotFound(_0x2c1d0b,null))[_0x726f('0x2f')](function(_0x28310f){if(_0x28310f){_0x4766a9=_0x28310f;_0x22f9b2['model']=_[_0x726f('0x3b')](db[_0x726f('0x6b')][_0x726f('0x35')]);_0x22f9b2[_0x726f('0x3a')]=_[_0x726f('0x3b')](_0x16cb36['query']);_0x22f9b2[_0x726f('0x3c')]=_[_0x726f('0x3d')](_0x22f9b2[_0x726f('0x3e')],_0x22f9b2[_0x726f('0x3a')]);_0x49f83f[_0x726f('0x3f')]=_[_0x726f('0x3d')](_0x22f9b2[_0x726f('0x3e')],qs[_0x726f('0x4f')](_0x16cb36['query'][_0x726f('0x4f')]));_0x49f83f['attributes']=_0x49f83f[_0x726f('0x3f')][_0x726f('0x40')]?_0x49f83f[_0x726f('0x3f')]:_0x22f9b2[_0x726f('0x3e')];_0x49f83f['order']=qs[_0x726f('0x44')](_0x16cb36[_0x726f('0x3a')]['sort']);_0x49f83f['where']=qs['filters'](_['pick'](_0x16cb36[_0x726f('0x3a')],_0x22f9b2[_0x726f('0x3c')]));if(_0x16cb36['query']['filter']){_0x49f83f['where']=_['merge'](_0x49f83f[_0x726f('0x45')],{'$or':_[_0x726f('0x39')](_0x49f83f[_0x726f('0x3f')],function(_0x4d5358){var _0x3b2b91={};_0x3b2b91[_0x4d5358]={'$like':'%'+_0x16cb36['query']['filter']+'%'};return _0x3b2b91;})});}_0x49f83f=_[_0x726f('0x47')]({},_0x49f83f,_0x16cb36[_0x726f('0x48')]);return _0x4766a9[_0x726f('0x6a')](_0x49f83f);}})[_0x726f('0x2f')](function(_0x4169a8){if(_0x4169a8){_0x42a6d6=_0x4169a8['length'];if(!_0x16cb36['query'][_0x726f('0x41')](_0x726f('0x42'))){_0x49f83f[_0x726f('0x29')]=qs['limit'](_0x16cb36['query'][_0x726f('0x29')]);_0x49f83f[_0x726f('0x27')]=qs[_0x726f('0x27')](_0x16cb36['query']['offset']);}return _0x4766a9[_0x726f('0x6a')](_0x49f83f);}})['then'](function(_0x4a9425){if(_0x4a9425){return _0x4a9425?{'count':_0x42a6d6,'rows':_0x4a9425}:null;}})[_0x726f('0x2f')](respondWithResult(_0x2c1d0b,null))[_0x726f('0x4d')](handleError(_0x2c1d0b,null));};exports[_0x726f('0x6c')]=function(_0x11eba4,_0x391452,_0xbadf0e){var _0x2fb4db=_0x11eba4[_0x726f('0x51')][_0x726f('0x6d')];return db['Team'][_0x726f('0x4c')]({'where':{'id':_0x2fb4db},'attributes':['id'],'include':[{'model':db[_0x726f('0x6e')],'as':'Agents','attributes':['id',_0x726f('0x32'),_0x726f('0x6f'),_0x726f('0x70'),_0x726f('0x71')],'raw':!![]}]})['then'](function(_0x3959dd){if(_0x3959dd){var _0x44b62d=_['flatMap'](_0x3959dd,function(_0x1f41fe){var _0x612f12=_0x1f41fe[_0x726f('0x30')]({'plain':!![]});return _0x612f12[_0x726f('0x72')];});return db[_0x726f('0x49')][_0x726f('0x59')]({'where':{'id':_0x11eba4[_0x726f('0x5a')]['id']}})['then'](function(_0x48781d){return db['sequelize'][_0x726f('0x73')](function(_0x34c02b){return _0x48781d[_0x726f('0x6c')](_0x2fb4db,{'transaction':_0x34c02b})['then'](function(){return BPromise[_0x726f('0x74')](_0x44b62d,function(_0x1e9fbd){return db[_0x726f('0x60')][_0x726f('0x75')]({'where':{'UserId':_0x1e9fbd['id'],'FaxQueueId':_0x11eba4[_0x726f('0x5a')]['id']},'transaction':_0x34c02b});});})[_0x726f('0x2f')](function(){_0x44b62d[_0x726f('0x76')](function(_0x2fe33d){socket['emit'](_0x726f('0x77'),{'UserId':_0x2fe33d['id'],'FaxQueueId':_0x48781d['id']});});});});});}})[_0x726f('0x2f')](respondWithStatusCode(_0x391452,null))[_0x726f('0x4d')](handleError(_0x391452,null));};exports['removeTeams']=function(_0x388b1e,_0x5498f0,_0x3763ca){return db[_0x726f('0x6b')][_0x726f('0x4c')]({'where':{'id':_0x388b1e['query'][_0x726f('0x6d')]},'attributes':['id'],'include':[{'model':db[_0x726f('0x6e')],'as':_0x726f('0x72'),'attributes':['id'],'raw':!![]}]})[_0x726f('0x2f')](handleEntityNotFound(_0x5498f0,null))['then'](function(_0x2c5700){var _0x4cddce=_[_0x726f('0x39')](_0x2c5700,'id');var _0x514772=[];var _0x2c217e=[];var _0x366930=squel['select']();_0x366930[_0x726f('0x78')]('tq.TeamId')['from'](_0x726f('0x79'),'tq')['join']('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x726f('0x45')](_0x726f('0x7a'),_0x388b1e[_0x726f('0x5a')]['id']);for(var _0x22c727=0x0;_0x22c727<_0x2c5700[_0x726f('0x40')];_0x22c727+=0x1){let _0x6b43d9=_0x2c5700[_0x22c727];for(var _0x4d78a2=0x0;_0x4d78a2<_0x6b43d9['Agents'][_0x726f('0x40')];_0x4d78a2+=0x1){let _0x33dcff=_0x6b43d9['Agents'][_0x4d78a2];var _0x244ed2=_0x366930['clone']();_0x244ed2[_0x726f('0x45')](_0x726f('0x7b'),_0x33dcff['id']);_0x2c217e[_0x726f('0x7c')](db[_0x726f('0x7d')][_0x726f('0x3a')](_0x244ed2['toString'](),{'type':db[_0x726f('0x7d')][_0x726f('0x7e')][_0x726f('0x7f')]})['then'](function(_0x12963d){if(_0x12963d[_0x726f('0x40')]===0x1){return _0x33dcff['id'];}else{var _0x4ce0ac=_[_0x726f('0x80')](_[_0x726f('0x39')](_0x12963d,_0x726f('0x81')),function(_0xed3fe3){return _[_0x726f('0x82')](_0x4cddce,_0xed3fe3);});if(_0x4ce0ac){return _0x33dcff['id'];}}}));}}return BPromise[_0x726f('0x83')](_0x2c217e)[_0x726f('0x2f')](function(_0x19c27e){_0x514772=_(_0x514772)[_0x726f('0x84')](_0x19c27e)['compact']()[_0x726f('0x85')]();return db[_0x726f('0x49')]['find']({'where':{'id':_0x388b1e[_0x726f('0x5a')]['id']}})[_0x726f('0x2f')](function(_0x22ac24){return db[_0x726f('0x7d')][_0x726f('0x73')](function(_0x344034){return _0x22ac24[_0x726f('0x86')](_0x388b1e[_0x726f('0x3a')][_0x726f('0x6d')],{'transaction':_0x344034})[_0x726f('0x2f')](function(){if(!_[_0x726f('0x87')](_0x514772)){return _0x22ac24[_0x726f('0x88')](_0x514772,{'transaction':_0x344034});}})[_0x726f('0x2f')](function(){_0x514772[_0x726f('0x76')](function(_0x1aae9e){socket[_0x726f('0x89')](_0x726f('0x8a'),{'UserId':_0x1aae9e,'FaxQueueId':_0x22ac24['id']});});});});});});})[_0x726f('0x2f')](respondWithStatusCode(_0x5498f0,null))['catch'](handleError(_0x5498f0,null));};exports['addAgents']=function(_0x274492,_0x3287b5,_0x487c82){return db[_0x726f('0x49')]['find']({'where':{'id':_0x274492[_0x726f('0x5a')]['id']}})[_0x726f('0x2f')](handleEntityNotFound(_0x3287b5,null))[_0x726f('0x2f')](function(_0x13d939){if(_0x13d939){return _0x13d939['addAgents'](_0x274492['body'][_0x726f('0x6d')],_[_0x726f('0x8b')](_0x274492['body'],['ids','id'])||{})[_0x726f('0x8c')](function(_0x5aba41){for(var _0x5aa9f1=0x0;_0x5aa9f1<_0x274492['body'][_0x726f('0x6d')]['length'];_0x5aa9f1+=0x1){socket['emit'](_0x726f('0x77'),{'UserId':Number(_0x274492[_0x726f('0x51')][_0x726f('0x6d')][_0x5aa9f1]),'FaxQueueId':Number(_0x274492['params']['id'])});}return _0x5aba41;});}})['then'](respondWithResult(_0x3287b5,null))[_0x726f('0x4d')](handleError(_0x3287b5,null));};exports['removeAgents']=function(_0x4914a2,_0x338ded,_0x2717f4){return db[_0x726f('0x49')][_0x726f('0x59')]({'where':{'id':_0x4914a2[_0x726f('0x5a')]['id']}})[_0x726f('0x2f')](handleEntityNotFound(_0x338ded,null))[_0x726f('0x2f')](function(_0x1da9f0){if(_0x1da9f0){return _0x1da9f0[_0x726f('0x88')](_0x4914a2['query']['ids'])['then'](function(){if(_[_0x726f('0x8d')](_0x4914a2[_0x726f('0x3a')][_0x726f('0x6d')])){for(var _0x846dfc=0x0;_0x846dfc<_0x4914a2[_0x726f('0x3a')]['ids'][_0x726f('0x40')];_0x846dfc+=0x1){socket['emit']('userFaxQueue:remove',{'UserId':Number(_0x4914a2['query'][_0x726f('0x6d')][_0x846dfc]),'FaxQueueId':Number(_0x4914a2[_0x726f('0x5a')]['id'])});}}else{socket[_0x726f('0x89')](_0x726f('0x8a'),{'UserId':Number(_0x4914a2[_0x726f('0x3a')][_0x726f('0x6d')]),'FaxQueueId':Number(_0x4914a2['params']['id'])});}});}})['then'](respondWithStatusCode(_0x338ded,null))['catch'](handleError(_0x338ded,null));};exports['getAgents']=function(_0x419b58,_0x37e4da,_0x220899){var _0x7824e7={};var _0x28a2c2={};var _0x2efb63;var _0x3345fe;return db[_0x726f('0x49')]['findOne']({'where':{'id':_0x419b58[_0x726f('0x5a')]['id']}})[_0x726f('0x2f')](handleEntityNotFound(_0x37e4da,null))[_0x726f('0x2f')](function(_0x2316d5){if(_0x2316d5){_0x2efb63=_0x2316d5;_0x28a2c2[_0x726f('0x3e')]=_['keys'](db[_0x726f('0x6e')][_0x726f('0x35')]);_0x28a2c2[_0x726f('0x3a')]=_[_0x726f('0x3b')](_0x419b58[_0x726f('0x3a')]);_0x28a2c2['filters']=_[_0x726f('0x3d')](_0x28a2c2['model'],_0x28a2c2['query']);_0x7824e7['attributes']=_[_0x726f('0x3d')](_0x28a2c2[_0x726f('0x3e')],qs[_0x726f('0x4f')](_0x419b58[_0x726f('0x3a')]['fields']));_0x7824e7[_0x726f('0x3f')]=_0x7824e7[_0x726f('0x3f')]['length']?_0x7824e7['attributes']:_0x28a2c2['model'];_0x7824e7[_0x726f('0x43')]=qs[_0x726f('0x44')](_0x419b58[_0x726f('0x3a')]['sort']);_0x7824e7[_0x726f('0x45')]=qs[_0x726f('0x3c')](_[_0x726f('0x46')](_0x419b58[_0x726f('0x3a')],_0x28a2c2[_0x726f('0x3c')]));if(_0x419b58['query'][_0x726f('0x5f')]){_0x7824e7[_0x726f('0x45')]=_['merge'](_0x7824e7[_0x726f('0x45')],{'$or':_[_0x726f('0x39')](_0x7824e7[_0x726f('0x3f')],function(_0xb7d1af){var _0x40c69d={};_0x40c69d[_0xb7d1af]={'$like':'%'+_0x419b58[_0x726f('0x3a')][_0x726f('0x5f')]+'%'};return _0x40c69d;})});}_0x7824e7=_[_0x726f('0x47')]({},_0x7824e7,_0x419b58[_0x726f('0x48')]);return _0x2efb63[_0x726f('0x8e')](_0x7824e7);}})[_0x726f('0x2f')](function(_0x456112){if(_0x456112){_0x3345fe=_0x456112[_0x726f('0x40')];if(!_0x419b58[_0x726f('0x3a')][_0x726f('0x41')](_0x726f('0x42'))){_0x7824e7['limit']=qs[_0x726f('0x29')](_0x419b58[_0x726f('0x3a')][_0x726f('0x29')]);_0x7824e7['offset']=qs['offset'](_0x419b58[_0x726f('0x3a')][_0x726f('0x27')]);}return _0x2efb63[_0x726f('0x8e')](_0x7824e7);}})[_0x726f('0x2f')](function(_0x8c0dc8){if(_0x8c0dc8){return _0x8c0dc8?{'count':_0x3345fe,'rows':_0x8c0dc8}:null;}})['then'](respondWithResult(_0x37e4da,null))[_0x726f('0x4d')](handleError(_0x37e4da,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 66209f7..7517a96 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 _0xb88d=['emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0xabfec4,_0x35076e){var _0x7bafa2=function(_0x52d551){while(--_0x52d551){_0xabfec4['push'](_0xabfec4['shift']());}};_0x7bafa2(++_0x35076e);}(_0xb88d,0xd2));var _0xdb88=function(_0x2b390d,_0x29450c){_0x2b390d=_0x2b390d-0x0;var _0x35ae52=_0xb88d[_0x2b390d];return _0x35ae52;};'use strict';var EventEmitter=require(_0xdb88('0x0'));var FaxQueue=require(_0xdb88('0x1'))['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xdb88('0x2')](0x0);var events={'afterCreate':_0xdb88('0x3'),'afterUpdate':_0xdb88('0x4'),'afterDestroy':_0xdb88('0x5')};function emitEvent(_0x3d4982){return function(_0x413c2c,_0x24eb92,_0x3a4006){FaxQueueEvents['emit'](_0x3d4982+':'+_0x413c2c['id'],_0x413c2c);FaxQueueEvents[_0xdb88('0x6')](_0x3d4982,_0x413c2c);_0x3a4006(null);};}for(var e in events){if(events[_0xdb88('0x7')](e)){var event=events[e];FaxQueue[_0xdb88('0x8')](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file +var _0xfc3e=['save','remove','emit','hasOwnProperty','hook','../../mysqldb','FaxQueue'];(function(_0x7b23ce,_0x21da3f){var _0x153de9=function(_0x549b24){while(--_0x549b24){_0x7b23ce['push'](_0x7b23ce['shift']());}};_0x153de9(++_0x21da3f);}(_0xfc3e,0x12b));var _0xefc3=function(_0x316fac,_0x2d0131){_0x316fac=_0x316fac-0x0;var _0x5dee8f=_0xfc3e[_0x316fac];return _0x5dee8f;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0xefc3('0x0'))['db'][_0xefc3('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xefc3('0x2'),'afterUpdate':'update','afterDestroy':_0xefc3('0x3')};function emitEvent(_0x387a5a){return function(_0x2fd3c9,_0x2286c0,_0x27261d){FaxQueueEvents['emit'](_0x387a5a+':'+_0x2fd3c9['id'],_0x2fd3c9);FaxQueueEvents[_0xefc3('0x4')](_0x387a5a,_0x2fd3c9);_0x27261d(null);};}for(var e in events){if(events[_0xefc3('0x5')](e)){var event=events[e];FaxQueue[_0xefc3('0x6')](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 42f13c9..8f8ad33 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 _0x2e4d=['request-promise','path','rimraf','../../config/environment','./faxQueue.attributes','exports','define','FaxQueue','fax_queues','lodash','util','../../config/logger','api','bluebird'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x2e4d,0x1e5));var _0xd2e4=function(_0x485261,_0x551505){_0x485261=_0x485261-0x0;var _0x1bfa98=_0x2e4d[_0x485261];return _0x1bfa98;};'use strict';var _=require(_0xd2e4('0x0'));var util=require(_0xd2e4('0x1'));var logger=require(_0xd2e4('0x2'))(_0xd2e4('0x3'));var moment=require('moment');var BPromise=require(_0xd2e4('0x4'));var rp=require(_0xd2e4('0x5'));var fs=require('fs');var path=require(_0xd2e4('0x6'));var rimraf=require(_0xd2e4('0x7'));var config=require(_0xd2e4('0x8'));var attributes=require(_0xd2e4('0x9'));module[_0xd2e4('0xa')]=function(_0x5a52bb,_0x1910d2){return _0x5a52bb[_0xd2e4('0xb')](_0xd2e4('0xc'),attributes,{'tableName':_0xd2e4('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x37b2=['define','FaxQueue','fax_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueue.attributes','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x37b2,0x13e));var _0x237b=function(_0x59328b,_0x3e1186){_0x59328b=_0x59328b-0x0;var _0x2593ea=_0x37b2[_0x59328b];return _0x2593ea;};'use strict';var _=require(_0x237b('0x0'));var util=require(_0x237b('0x1'));var logger=require(_0x237b('0x2'))(_0x237b('0x3'));var moment=require(_0x237b('0x4'));var BPromise=require(_0x237b('0x5'));var rp=require(_0x237b('0x6'));var fs=require('fs');var path=require(_0x237b('0x7'));var rimraf=require(_0x237b('0x8'));var config=require(_0x237b('0x9'));var attributes=require(_0x237b('0xa'));module[_0x237b('0xb')]=function(_0x186f28,_0x426507){return _0x186f28[_0x237b('0xc')](_0x237b('0xd'),attributes,{'tableName':_0x237b('0xe'),'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 c819b00..cf54957 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 _0xb85b=['client','defaults','localhost','redis','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','GetFaxQueue','FaxQueue','findAll','options','raw','where','attributes','limit','include','map','stringify','ShowFaxQueue','find','model','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0xb85b,0x67));var _0xbb85=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xb85b[_0x413feb];return _0x40ee88;};'use strict';var _=require('lodash');var util=require(_0xbb85('0x0'));var moment=require(_0xbb85('0x1'));var BPromise=require(_0xbb85('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbb85('0x3'));var db=require(_0xbb85('0x4'))['db'];var utils=require(_0xbb85('0x5'));var logger=require('../../config/logger')(_0xbb85('0x6'));var config=require('../../config/environment');var jayson=require(_0xbb85('0x7'));var client=jayson[_0xbb85('0x8')]['http']({'port':0x232a});config['redis']=_[_0xbb85('0x9')](config['redis'],{'host':_0xbb85('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbb85('0xb')]));require('./faxQueue.socket')['register'](socket);function respondWithRpcPromise(_0x426987,_0x263e77,_0x8d0ba8){return new BPromise(function(_0x32c032,_0x56c31c){return client[_0xbb85('0xc')](_0x426987,_0x8d0ba8)[_0xbb85('0xd')](function(_0x383859){logger[_0xbb85('0xe')](_0xbb85('0xf'),_0x263e77,_0xbb85('0x10'));logger[_0xbb85('0x11')]('FaxQueue,\x20%s,\x20%s,\x20%s',_0x263e77,'request\x20sent',JSON['stringify'](_0x383859));if(_0x383859[_0xbb85('0x12')]){if(_0x383859[_0xbb85('0x12')][_0xbb85('0x13')]===0x1f4){logger[_0xbb85('0x12')](_0xbb85('0xf'),_0x263e77,_0x383859[_0xbb85('0x12')][_0xbb85('0x14')]);return _0x56c31c(_0x383859['error'][_0xbb85('0x14')]);}logger[_0xbb85('0x12')]('FaxQueue,\x20%s,\x20%s',_0x263e77,_0x383859[_0xbb85('0x12')]['message']);return _0x32c032(_0x383859[_0xbb85('0x12')][_0xbb85('0x14')]);}else{logger[_0xbb85('0xe')](_0xbb85('0xf'),_0x263e77,_0xbb85('0x10'));_0x32c032(_0x383859[_0xbb85('0x15')][_0xbb85('0x14')]);}})[_0xbb85('0x16')](function(_0x5a7e88){logger[_0xbb85('0x12')](_0xbb85('0xf'),_0x263e77,_0x5a7e88);_0x56c31c(_0x5a7e88);});});}exports[_0xbb85('0x17')]=function(_0x10afa7){var _0x7c03fb=this;return new Promise(function(_0x75187e,_0x352cbf){return db[_0xbb85('0x18')][_0xbb85('0x19')]({'raw':_0x10afa7[_0xbb85('0x1a')]?_0x10afa7[_0xbb85('0x1a')][_0xbb85('0x1b')]===undefined?!![]:![]:!![],'where':_0x10afa7[_0xbb85('0x1a')]?_0x10afa7[_0xbb85('0x1a')][_0xbb85('0x1c')]||null:null,'attributes':_0x10afa7[_0xbb85('0x1a')]?_0x10afa7[_0xbb85('0x1a')][_0xbb85('0x1d')]||null:null,'limit':_0x10afa7[_0xbb85('0x1a')]?_0x10afa7['options'][_0xbb85('0x1e')]||null:null,'include':_0x10afa7[_0xbb85('0x1a')]?_0x10afa7[_0xbb85('0x1a')][_0xbb85('0x1f')]?_['map'](_0x10afa7['options'][_0xbb85('0x1f')],function(_0x5f1cbd){return{'model':db[_0x5f1cbd['model']],'as':_0x5f1cbd['as'],'attributes':_0x5f1cbd[_0xbb85('0x1d')],'include':_0x5f1cbd[_0xbb85('0x1f')]?_['map'](_0x5f1cbd[_0xbb85('0x1f')],function(_0x44963c){return{'model':db[_0x44963c['model']],'as':_0x44963c['as'],'attributes':_0x44963c[_0xbb85('0x1d')],'include':_0x44963c[_0xbb85('0x1f')]?_[_0xbb85('0x20')](_0x44963c[_0xbb85('0x1f')],function(_0x2f7d2f){return{'model':db[_0x2f7d2f['model']],'as':_0x2f7d2f['as'],'attributes':_0x2f7d2f[_0xbb85('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xbb85('0xd')](function(_0xbc347b){logger[_0xbb85('0xe')]('GetFaxQueue',_0x10afa7);logger[_0xbb85('0x11')](_0xbb85('0x17'),_0x10afa7,JSON[_0xbb85('0x21')](_0xbc347b));_0x75187e(_0xbc347b);})[_0xbb85('0x16')](function(_0x11f676){logger[_0xbb85('0x12')](_0xbb85('0x17'),_0x11f676[_0xbb85('0x14')],_0x10afa7);_0x352cbf(_0x7c03fb[_0xbb85('0x12')](0x1f4,_0x11f676[_0xbb85('0x14')]));});});};exports[_0xbb85('0x22')]=function(_0x41167c){var _0x1624cd=this;return new Promise(function(_0x5df4d7,_0x2eedd3){return db['FaxQueue'][_0xbb85('0x23')]({'raw':_0x41167c[_0xbb85('0x1a')]?_0x41167c['options']['raw']===undefined?!![]:![]:!![],'where':_0x41167c[_0xbb85('0x1a')]?_0x41167c[_0xbb85('0x1a')][_0xbb85('0x1c')]||null:null,'attributes':_0x41167c[_0xbb85('0x1a')]?_0x41167c['options']['attributes']||null:null,'include':_0x41167c[_0xbb85('0x1a')]?_0x41167c[_0xbb85('0x1a')][_0xbb85('0x1f')]?_[_0xbb85('0x20')](_0x41167c['options']['include'],function(_0x2f6387){return{'model':db[_0x2f6387[_0xbb85('0x24')]],'as':_0x2f6387['as'],'attributes':_0x2f6387[_0xbb85('0x1d')],'include':_0x2f6387[_0xbb85('0x1f')]?_[_0xbb85('0x20')](_0x2f6387[_0xbb85('0x1f')],function(_0x2e298b){return{'model':db[_0x2e298b['model']],'as':_0x2e298b['as'],'attributes':_0x2e298b[_0xbb85('0x1d')],'include':_0x2e298b[_0xbb85('0x1f')]?_[_0xbb85('0x20')](_0x2e298b[_0xbb85('0x1f')],function(_0x2e04f5){return{'model':db[_0x2e04f5[_0xbb85('0x24')]],'as':_0x2e04f5['as'],'attributes':_0x2e04f5['attributes']};}):[]};}):[]};}):[]:[]})[_0xbb85('0xd')](function(_0x1914cc){logger[_0xbb85('0xe')](_0xbb85('0x22'),_0x41167c);logger[_0xbb85('0x11')](_0xbb85('0x22'),_0x41167c,JSON[_0xbb85('0x21')](_0x1914cc));_0x5df4d7(_0x1914cc);})['catch'](function(_0x26bb29){logger[_0xbb85('0x12')](_0xbb85('0x22'),_0x26bb29[_0xbb85('0x14')],_0x41167c);_0x2eedd3(_0x1624cd['error'](0x1f4,_0x26bb29[_0xbb85('0x14')]));});});}; \ No newline at end of file +var _0xc5c7=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','FaxQueue,\x20%s,\x20%s','message','FaxQueue','findAll','options','raw','where','attributes','include','map','model','GetFaxQueue','catch','ShowFaxQueue','util','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x673e94,_0x359dc1){var _0x5a003d=function(_0x4a2ee1){while(--_0x4a2ee1){_0x673e94['push'](_0x673e94['shift']());}};_0x5a003d(++_0x359dc1);}(_0xc5c7,0x1e9));var _0x7c5c=function(_0x4ad83e,_0x33aefc){_0x4ad83e=_0x4ad83e-0x0;var _0x5c4de9=_0xc5c7[_0x4ad83e];return _0x5c4de9;};'use strict';var _=require('lodash');var util=require(_0x7c5c('0x0'));var moment=require('moment');var BPromise=require(_0x7c5c('0x1'));var rs=require(_0x7c5c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7c5c('0x3'))['db'];var utils=require(_0x7c5c('0x4'));var logger=require(_0x7c5c('0x5'))(_0x7c5c('0x6'));var config=require(_0x7c5c('0x7'));var jayson=require(_0x7c5c('0x8'));var client=jayson[_0x7c5c('0x9')][_0x7c5c('0xa')]({'port':0x232a});config[_0x7c5c('0xb')]=_[_0x7c5c('0xc')](config[_0x7c5c('0xb')],{'host':_0x7c5c('0xd'),'port':0x18eb});var socket=require(_0x7c5c('0xe'))(new Redis(config[_0x7c5c('0xb')]));require('./faxQueue.socket')[_0x7c5c('0xf')](socket);function respondWithRpcPromise(_0x240a77,_0x567046,_0x8a3c59){return new BPromise(function(_0x120760,_0x1067c8){return client[_0x7c5c('0x10')](_0x240a77,_0x8a3c59)[_0x7c5c('0x11')](function(_0x167981){logger[_0x7c5c('0x12')]('FaxQueue,\x20%s,\x20%s',_0x567046,_0x7c5c('0x13'));logger[_0x7c5c('0x14')](_0x7c5c('0x15'),_0x567046,_0x7c5c('0x13'),JSON[_0x7c5c('0x16')](_0x167981));if(_0x167981[_0x7c5c('0x17')]){if(_0x167981[_0x7c5c('0x17')]['code']===0x1f4){logger[_0x7c5c('0x17')](_0x7c5c('0x18'),_0x567046,_0x167981[_0x7c5c('0x17')][_0x7c5c('0x19')]);return _0x1067c8(_0x167981[_0x7c5c('0x17')][_0x7c5c('0x19')]);}logger[_0x7c5c('0x17')](_0x7c5c('0x18'),_0x567046,_0x167981[_0x7c5c('0x17')][_0x7c5c('0x19')]);return _0x120760(_0x167981[_0x7c5c('0x17')][_0x7c5c('0x19')]);}else{logger[_0x7c5c('0x12')](_0x7c5c('0x18'),_0x567046,_0x7c5c('0x13'));_0x120760(_0x167981['result'][_0x7c5c('0x19')]);}})['catch'](function(_0x40009b){logger[_0x7c5c('0x17')](_0x7c5c('0x18'),_0x567046,_0x40009b);_0x1067c8(_0x40009b);});});}exports['GetFaxQueue']=function(_0x22bfaa){var _0x268b07=this;return new Promise(function(_0x3c1f9f,_0x41121f){return db[_0x7c5c('0x1a')][_0x7c5c('0x1b')]({'raw':_0x22bfaa[_0x7c5c('0x1c')]?_0x22bfaa[_0x7c5c('0x1c')][_0x7c5c('0x1d')]===undefined?!![]:![]:!![],'where':_0x22bfaa[_0x7c5c('0x1c')]?_0x22bfaa[_0x7c5c('0x1c')][_0x7c5c('0x1e')]||null:null,'attributes':_0x22bfaa[_0x7c5c('0x1c')]?_0x22bfaa[_0x7c5c('0x1c')][_0x7c5c('0x1f')]||null:null,'limit':_0x22bfaa[_0x7c5c('0x1c')]?_0x22bfaa[_0x7c5c('0x1c')]['limit']||null:null,'include':_0x22bfaa[_0x7c5c('0x1c')]?_0x22bfaa[_0x7c5c('0x1c')][_0x7c5c('0x20')]?_[_0x7c5c('0x21')](_0x22bfaa[_0x7c5c('0x1c')]['include'],function(_0x56c485){return{'model':db[_0x56c485[_0x7c5c('0x22')]],'as':_0x56c485['as'],'attributes':_0x56c485[_0x7c5c('0x1f')],'include':_0x56c485[_0x7c5c('0x20')]?_[_0x7c5c('0x21')](_0x56c485[_0x7c5c('0x20')],function(_0x336919){return{'model':db[_0x336919['model']],'as':_0x336919['as'],'attributes':_0x336919[_0x7c5c('0x1f')],'include':_0x336919[_0x7c5c('0x20')]?_[_0x7c5c('0x21')](_0x336919[_0x7c5c('0x20')],function(_0x254720){return{'model':db[_0x254720[_0x7c5c('0x22')]],'as':_0x254720['as'],'attributes':_0x254720[_0x7c5c('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x7c5c('0x11')](function(_0x4e6c59){logger['info'](_0x7c5c('0x23'),_0x22bfaa);logger[_0x7c5c('0x14')](_0x7c5c('0x23'),_0x22bfaa,JSON[_0x7c5c('0x16')](_0x4e6c59));_0x3c1f9f(_0x4e6c59);})[_0x7c5c('0x24')](function(_0x1e48e9){logger['error']('GetFaxQueue',_0x1e48e9[_0x7c5c('0x19')],_0x22bfaa);_0x41121f(_0x268b07[_0x7c5c('0x17')](0x1f4,_0x1e48e9[_0x7c5c('0x19')]));});});};exports[_0x7c5c('0x25')]=function(_0x542233){var _0x30f13f=this;return new Promise(function(_0x26b26a,_0x18a98e){return db[_0x7c5c('0x1a')]['find']({'raw':_0x542233[_0x7c5c('0x1c')]?_0x542233['options'][_0x7c5c('0x1d')]===undefined?!![]:![]:!![],'where':_0x542233[_0x7c5c('0x1c')]?_0x542233[_0x7c5c('0x1c')][_0x7c5c('0x1e')]||null:null,'attributes':_0x542233['options']?_0x542233[_0x7c5c('0x1c')][_0x7c5c('0x1f')]||null:null,'include':_0x542233['options']?_0x542233[_0x7c5c('0x1c')]['include']?_[_0x7c5c('0x21')](_0x542233[_0x7c5c('0x1c')][_0x7c5c('0x20')],function(_0x357bc6){return{'model':db[_0x357bc6['model']],'as':_0x357bc6['as'],'attributes':_0x357bc6[_0x7c5c('0x1f')],'include':_0x357bc6['include']?_['map'](_0x357bc6[_0x7c5c('0x20')],function(_0x30efca){return{'model':db[_0x30efca[_0x7c5c('0x22')]],'as':_0x30efca['as'],'attributes':_0x30efca['attributes'],'include':_0x30efca[_0x7c5c('0x20')]?_[_0x7c5c('0x21')](_0x30efca[_0x7c5c('0x20')],function(_0x3fbd32){return{'model':db[_0x3fbd32[_0x7c5c('0x22')]],'as':_0x3fbd32['as'],'attributes':_0x3fbd32['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x116ad8){logger[_0x7c5c('0x12')](_0x7c5c('0x25'),_0x542233);logger[_0x7c5c('0x14')](_0x7c5c('0x25'),_0x542233,JSON[_0x7c5c('0x16')](_0x116ad8));_0x26b26a(_0x116ad8);})[_0x7c5c('0x24')](function(_0x48d6b9){logger['error'](_0x7c5c('0x25'),_0x48d6b9[_0x7c5c('0x19')],_0x542233);_0x18a98e(_0x30f13f['error'](0x1f4,_0x48d6b9[_0x7c5c('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index a4df972..e0cf855 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 _0x808f=['save','remove','emit','register','length'];(function(_0xdd50a9,_0xe452c4){var _0x51d71e=function(_0x4322ff){while(--_0x4322ff){_0xdd50a9['push'](_0xdd50a9['shift']());}};_0x51d71e(++_0xe452c4);}(_0x808f,0x1ea));var _0xf808=function(_0xa5e821,_0x4dd2f6){_0xa5e821=_0xa5e821-0x0;var _0x62d0cd=_0x808f[_0xa5e821];return _0x62d0cd;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=[_0xf808('0x0'),_0xf808('0x1'),'update'];function createListener(_0x526ef8,_0x19ba9c){return function(_0x59d101){_0x19ba9c[_0xf808('0x2')](_0x526ef8,_0x59d101);};}function removeListener(_0xdbfe2f,_0x49b073){return function(){FaxQueueEvents['removeListener'](_0xdbfe2f,_0x49b073);};}exports[_0xf808('0x3')]=function(_0x3b7d50){for(var _0xbaabac=0x0,_0x479cf1=events[_0xf808('0x4')];_0xbaabac<_0x479cf1;_0xbaabac++){var _0x1e4b11=events[_0xbaabac];var _0x5c9dbb=createListener('faxQueue:'+_0x1e4b11,_0x3b7d50);FaxQueueEvents['on'](_0x1e4b11,_0x5c9dbb);}}; \ No newline at end of file +var _0x3074=['register','length','faxQueue:','./faxQueue.events','remove','update'];(function(_0x38cd5d,_0x2452c9){var _0x4d33ec=function(_0x21ee12){while(--_0x21ee12){_0x38cd5d['push'](_0x38cd5d['shift']());}};_0x4d33ec(++_0x2452c9);}(_0x3074,0x1dd));var _0x4307=function(_0x423f6f,_0x3378e7){_0x423f6f=_0x423f6f-0x0;var _0x39ebc0=_0x3074[_0x423f6f];return _0x39ebc0;};'use strict';var FaxQueueEvents=require(_0x4307('0x0'));var events=['save',_0x4307('0x1'),_0x4307('0x2')];function createListener(_0x3dd976,_0x59f091){return function(_0x1fd56f){_0x59f091['emit'](_0x3dd976,_0x1fd56f);};}function removeListener(_0x256692,_0x31bf86){return function(){FaxQueueEvents['removeListener'](_0x256692,_0x31bf86);};}exports[_0x4307('0x3')]=function(_0x2c94ac){for(var _0xf59e6f=0x0,_0x590bda=events[_0x4307('0x4')];_0xf59e6f<_0x590bda;_0xf59e6f++){var _0x14e01d=events[_0xf59e6f];var _0x11663f=createListener(_0x4307('0x5')+_0x14e01d,_0x2c94ac);FaxQueueEvents['on'](_0x14e01d,_0x11663f);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index e940a3d..a73da20 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 _0x0a6b=['update','destroy','delete','removeTeams','removeAgents','exports','multer','express','fs-extra','../../components/auth/service','../../components/interaction/service','./faxQueue.controller','isAuthenticated','index','/describe','describe','show','get','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','/:id'];(function(_0x4849f6,_0x104836){var _0x1a3dcd=function(_0x494d3c){while(--_0x494d3c){_0x4849f6['push'](_0x4849f6['shift']());}};_0x1a3dcd(++_0x104836);}(_0x0a6b,0x18e));var _0xb0a6=function(_0x77fcad,_0xeebb41){_0x77fcad=_0x77fcad-0x0;var _0x3d032e=_0x0a6b[_0x77fcad];return _0x3d032e;};'use strict';var multer=require(_0xb0a6('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb0a6('0x1'));var router=express['Router']();var fs_extra=require(_0xb0a6('0x2'));var auth=require(_0xb0a6('0x3'));var interaction=require(_0xb0a6('0x4'));var config=require('../../config/environment');var controller=require(_0xb0a6('0x5'));router['get']('/',auth[_0xb0a6('0x6')](),controller[_0xb0a6('0x7')]);router['get'](_0xb0a6('0x8'),auth[_0xb0a6('0x6')](),controller[_0xb0a6('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xb0a6('0xa')]);router[_0xb0a6('0xb')](_0xb0a6('0xc'),auth[_0xb0a6('0x6')](),controller['getMembers']);router[_0xb0a6('0xb')](_0xb0a6('0xd'),auth['isAuthenticated'](),controller[_0xb0a6('0xe')]);router[_0xb0a6('0xb')](_0xb0a6('0xf'),auth[_0xb0a6('0x6')](),controller[_0xb0a6('0x10')]);router[_0xb0a6('0x11')]('/',auth[_0xb0a6('0x6')](),controller[_0xb0a6('0x12')]);router[_0xb0a6('0x11')](_0xb0a6('0xd'),auth['isAuthenticated'](),controller[_0xb0a6('0x13')]);router['post'](_0xb0a6('0xf'),auth['isAuthenticated'](),controller[_0xb0a6('0x14')]);router['put'](_0xb0a6('0x15'),auth[_0xb0a6('0x6')](),controller[_0xb0a6('0x16')]);router['delete']('/:id',auth[_0xb0a6('0x6')](),controller[_0xb0a6('0x17')]);router[_0xb0a6('0x18')](_0xb0a6('0xd'),auth[_0xb0a6('0x6')](),controller[_0xb0a6('0x19')]);router['delete'](_0xb0a6('0xf'),auth[_0xb0a6('0x6')](),controller[_0xb0a6('0x1a')]);module[_0xb0a6('0x1b')]=router; \ No newline at end of file +var _0x8085=['Router','fs-extra','../../config/environment','./faxQueue.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','/:id/teams','addTeams','addAgents','put','update','destroy','delete','removeTeams','removeAgents','multer','connect-timeout','express'];(function(_0x3b37ba,_0x3dc349){var _0x3e6483=function(_0x5b51d7){while(--_0x5b51d7){_0x3b37ba['push'](_0x3b37ba['shift']());}};_0x3e6483(++_0x3dc349);}(_0x8085,0x71));var _0x5808=function(_0x504df1,_0x289598){_0x504df1=_0x504df1-0x0;var _0x1063b5=_0x8085[_0x504df1];return _0x1063b5;};'use strict';var multer=require(_0x5808('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5808('0x1'));var express=require(_0x5808('0x2'));var router=express[_0x5808('0x3')]();var fs_extra=require(_0x5808('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5808('0x5'));var controller=require(_0x5808('0x6'));router['get']('/',auth[_0x5808('0x7')](),controller[_0x5808('0x8')]);router[_0x5808('0x9')](_0x5808('0xa'),auth[_0x5808('0x7')](),controller[_0x5808('0xb')]);router[_0x5808('0x9')](_0x5808('0xc'),auth[_0x5808('0x7')](),controller[_0x5808('0xd')]);router[_0x5808('0x9')](_0x5808('0xe'),auth[_0x5808('0x7')](),controller[_0x5808('0xf')]);router[_0x5808('0x9')]('/:id/teams',auth['isAuthenticated'](),controller[_0x5808('0x10')]);router[_0x5808('0x9')](_0x5808('0x11'),auth[_0x5808('0x7')](),controller[_0x5808('0x12')]);router[_0x5808('0x13')]('/',auth[_0x5808('0x7')](),controller['create']);router['post'](_0x5808('0x14'),auth[_0x5808('0x7')](),controller[_0x5808('0x15')]);router[_0x5808('0x13')](_0x5808('0x11'),auth[_0x5808('0x7')](),controller[_0x5808('0x16')]);router[_0x5808('0x17')](_0x5808('0xc'),auth[_0x5808('0x7')](),controller[_0x5808('0x18')]);router['delete'](_0x5808('0xc'),auth['isAuthenticated'](),controller[_0x5808('0x19')]);router[_0x5808('0x1a')](_0x5808('0x14'),auth['isAuthenticated'](),controller[_0x5808('0x1b')]);router[_0x5808('0x1a')]('/:id/users',auth['isAuthenticated'](),controller[_0x5808('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 66423bb..8f2e076 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 _0x6ff9=['STRING','DATE','sequelize'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x6ff9,0x167));var _0x96ff=function(_0x260183,_0x4294f2){_0x260183=_0x260183-0x0;var _0x30ce38=_0x6ff9[_0x260183];return _0x30ce38;};'use strict';var moment=require('moment');var Sequelize=require(_0x96ff('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x96ff('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x96ff('0x1')]},'joinAt':{'type':Sequelize[_0x96ff('0x2')]},'leaveAt':{'type':Sequelize[_0x96ff('0x2')]},'acceptAt':{'type':Sequelize[_0x96ff('0x2')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x28e0=['sequelize','exports','STRING','DATE','moment'];(function(_0x8784e0,_0x788af2){var _0x48ca74=function(_0x2542f9){while(--_0x2542f9){_0x8784e0['push'](_0x8784e0['shift']());}};_0x48ca74(++_0x788af2);}(_0x28e0,0x126));var _0x028e=function(_0x45cf24,_0x38f928){_0x45cf24=_0x45cf24-0x0;var _0x4c9bc5=_0x28e0[_0x45cf24];return _0x4c9bc5;};'use strict';var moment=require(_0x028e('0x0'));var Sequelize=require(_0x028e('0x1'));module[_0x028e('0x2')]={'uniqueid':{'type':Sequelize[_0x028e('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x028e('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x028e('0x4')]},'acceptAt':{'type':Sequelize[_0x028e('0x4')]},'exitAt':{'type':Sequelize[_0x028e('0x4')]},'reason':{'type':Sequelize[_0x028e('0x3')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 46e4c34..512c638 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 _0xc9c3=['path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','then','error','stack','name','send','index','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','FaxQueueReport','includeAll','include','findAll','catch','show','keys','find','create','body','params','destroy','describe','rimraf','zip-dir','fast-json-patch','bluebird','mustache'];(function(_0x2e4de6,_0x14e66f){var _0x25a586=function(_0x49dc7f){while(--_0x49dc7f){_0x2e4de6['push'](_0x2e4de6['shift']());}};_0x25a586(++_0x14e66f);}(_0xc9c3,0xd0));var _0x3c9c=function(_0x7435a5,_0x445685){_0x7435a5=_0x7435a5-0x0;var _0x28f290=_0xc9c3[_0x7435a5];return _0x28f290;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3c9c('0x0'));var zipdir=require(_0x3c9c('0x1'));var jsonpatch=require(_0x3c9c('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3c9c('0x3'));var Mustache=require(_0x3c9c('0x4'));var util=require('util');var path=require(_0x3c9c('0x5'));var sox=require(_0x3c9c('0x6'));var csv=require(_0x3c9c('0x7'));var ejs=require(_0x3c9c('0x8'));var fs=require('fs');var fs_extra=require(_0x3c9c('0x9'));var _=require(_0x3c9c('0xa'));var squel=require(_0x3c9c('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3c9c('0xc'));var toCsv=require(_0x3c9c('0x7'));var querystring=require('querystring');var Papa=require(_0x3c9c('0xd'));var Redis=require(_0x3c9c('0xe'));var authService=require(_0x3c9c('0xf'));var qs=require(_0x3c9c('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3c9c('0x11'))(_0x3c9c('0x12'));var utils=require(_0x3c9c('0x13'));var config=require(_0x3c9c('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x53bd31,_0x4a092d){_0x4a092d=_0x4a092d||0xcc;return function(_0x6d0a1a){if(_0x6d0a1a){return _0x53bd31[_0x3c9c('0x15')](_0x4a092d);}return _0x53bd31['status'](_0x4a092d)[_0x3c9c('0x16')]();};}function respondWithResult(_0x50a62d,_0x2de024){_0x2de024=_0x2de024||0xc8;return function(_0x12dd2d){if(_0x12dd2d){return _0x50a62d[_0x3c9c('0x17')](_0x2de024)['json'](_0x12dd2d);}};}function respondWithFilteredResult(_0x1940fa,_0x59fb0f){return function(_0x3b9fef){if(_0x3b9fef){var _0x4b9b7f=typeof _0x59fb0f[_0x3c9c('0x18')]===_0x3c9c('0x19')&&typeof _0x59fb0f[_0x3c9c('0x1a')]==='undefined';var _0x16841a=_0x3b9fef['count'];var _0x39da0d=_0x4b9b7f?0x0:_0x59fb0f[_0x3c9c('0x18')];var _0x1d8e47=_0x4b9b7f?_0x3b9fef[_0x3c9c('0x1b')]:_0x59fb0f[_0x3c9c('0x18')]+_0x59fb0f[_0x3c9c('0x1a')];var _0x445d1f;if(_0x1d8e47>=_0x16841a){_0x1d8e47=_0x16841a;_0x445d1f=0xc8;}else{_0x445d1f=0xce;}_0x1940fa[_0x3c9c('0x17')](_0x445d1f);return _0x1940fa[_0x3c9c('0x1c')](_0x3c9c('0x1d'),_0x39da0d+'-'+_0x1d8e47+'/'+_0x16841a)[_0x3c9c('0x1e')](_0x3b9fef);}return null;};}function patchUpdates(_0x398479){return function(_0x4ec5b3){try{jsonpatch[_0x3c9c('0x1f')](_0x4ec5b3,_0x398479,!![]);}catch(_0x5a393d){return BPromise['reject'](_0x5a393d);}return _0x4ec5b3[_0x3c9c('0x20')]();};}function saveUpdates(_0x17e73d,_0x281757){return function(_0x564139){if(_0x564139){return _0x564139['update'](_0x17e73d)[_0x3c9c('0x21')](function(_0x52534c){return _0x52534c;});}return null;};}function removeEntity(_0x5a9ed3,_0x219076){return function(_0x32161b){if(_0x32161b){return _0x32161b['destroy']()[_0x3c9c('0x21')](function(){_0x5a9ed3[_0x3c9c('0x17')](0xcc)[_0x3c9c('0x16')]();});}};}function handleEntityNotFound(_0x169ba4,_0x43c18b){return function(_0x335bb4){if(!_0x335bb4){_0x169ba4['sendStatus'](0x194);}return _0x335bb4;};}function handleError(_0x643593,_0x599d1b){_0x599d1b=_0x599d1b||0x1f4;return function(_0x52924e){logger[_0x3c9c('0x22')](_0x52924e[_0x3c9c('0x23')]);if(_0x52924e[_0x3c9c('0x24')]){delete _0x52924e[_0x3c9c('0x24')];}_0x643593[_0x3c9c('0x17')](_0x599d1b)[_0x3c9c('0x25')](_0x52924e);};}exports[_0x3c9c('0x26')]=function(_0x43046d,_0x24e8d6){var _0x52c9bb={},_0x10511f={},_0x2d2e90={'count':0x0,'rows':[]};var _0xf04bab=_['map'](db['FaxQueueReport'][_0x3c9c('0x27')],function(_0x3bdccc){return{'name':_0x3bdccc[_0x3c9c('0x28')],'type':_0x3bdccc['type'][_0x3c9c('0x29')]};});_0x10511f[_0x3c9c('0x2a')]=_['map'](_0xf04bab,_0x3c9c('0x24'));_0x10511f[_0x3c9c('0x2b')]=_['keys'](_0x43046d[_0x3c9c('0x2b')]);_0x10511f[_0x3c9c('0x2c')]=_[_0x3c9c('0x2d')](_0x10511f[_0x3c9c('0x2a')],_0x10511f[_0x3c9c('0x2b')]);_0x52c9bb[_0x3c9c('0x2e')]=_[_0x3c9c('0x2d')](_0x10511f[_0x3c9c('0x2a')],qs[_0x3c9c('0x2f')](_0x43046d[_0x3c9c('0x2b')][_0x3c9c('0x2f')]));_0x52c9bb[_0x3c9c('0x2e')]=_0x52c9bb[_0x3c9c('0x2e')][_0x3c9c('0x30')]?_0x52c9bb[_0x3c9c('0x2e')]:_0x10511f[_0x3c9c('0x2a')];if(!_0x43046d[_0x3c9c('0x2b')]['hasOwnProperty'](_0x3c9c('0x31'))){_0x52c9bb[_0x3c9c('0x1a')]=qs[_0x3c9c('0x1a')](_0x43046d[_0x3c9c('0x2b')]['limit']);_0x52c9bb[_0x3c9c('0x18')]=qs[_0x3c9c('0x18')](_0x43046d[_0x3c9c('0x2b')][_0x3c9c('0x18')]);}_0x52c9bb[_0x3c9c('0x32')]=qs['sort'](_0x43046d[_0x3c9c('0x2b')][_0x3c9c('0x33')]);_0x52c9bb[_0x3c9c('0x34')]=qs[_0x3c9c('0x2c')](_[_0x3c9c('0x35')](_0x43046d[_0x3c9c('0x2b')],_0x10511f[_0x3c9c('0x2c')]),_0xf04bab);if(_0x43046d['query'][_0x3c9c('0x36')]){_0x52c9bb[_0x3c9c('0x34')]=_[_0x3c9c('0x37')](_0x52c9bb[_0x3c9c('0x34')],{'$or':_['map'](_0xf04bab,function(_0x40b744){if(_0x40b744['type']!==_0x3c9c('0x38')){var _0x58aa4f={};_0x58aa4f[_0x40b744[_0x3c9c('0x24')]]={'$like':'%'+_0x43046d['query'][_0x3c9c('0x36')]+'%'};return _0x58aa4f;}})});}_0x52c9bb=_['merge']({},_0x52c9bb,_0x43046d[_0x3c9c('0x39')]);var _0x2dcc58={'where':_0x52c9bb[_0x3c9c('0x34')]};return db[_0x3c9c('0x3a')]['count'](_0x2dcc58)[_0x3c9c('0x21')](function(_0xd2d3e7){_0x2d2e90['count']=_0xd2d3e7;if(_0x43046d[_0x3c9c('0x2b')][_0x3c9c('0x3b')]){_0x52c9bb[_0x3c9c('0x3c')]=[{'all':!![]}];}return db[_0x3c9c('0x3a')][_0x3c9c('0x3d')](_0x52c9bb);})['then'](function(_0x489b6e){_0x2d2e90['rows']=_0x489b6e;return _0x2d2e90;})['then'](respondWithFilteredResult(_0x24e8d6,_0x52c9bb))[_0x3c9c('0x3e')](handleError(_0x24e8d6,null));};exports[_0x3c9c('0x3f')]=function(_0x371c13,_0x289c12){var _0x511a1f={'raw':!![],'where':{'id':_0x371c13['params']['id']}},_0x2a47c6={};_0x2a47c6[_0x3c9c('0x2a')]=_[_0x3c9c('0x40')](db[_0x3c9c('0x3a')][_0x3c9c('0x27')]);_0x2a47c6[_0x3c9c('0x2b')]=_[_0x3c9c('0x40')](_0x371c13['query']);_0x2a47c6[_0x3c9c('0x2c')]=_[_0x3c9c('0x2d')](_0x2a47c6[_0x3c9c('0x2a')],_0x2a47c6[_0x3c9c('0x2b')]);_0x511a1f[_0x3c9c('0x2e')]=_[_0x3c9c('0x2d')](_0x2a47c6[_0x3c9c('0x2a')],qs[_0x3c9c('0x2f')](_0x371c13[_0x3c9c('0x2b')]['fields']));_0x511a1f['attributes']=_0x511a1f[_0x3c9c('0x2e')][_0x3c9c('0x30')]?_0x511a1f[_0x3c9c('0x2e')]:_0x2a47c6[_0x3c9c('0x2a')];if(_0x371c13['query'][_0x3c9c('0x3b')]){_0x511a1f[_0x3c9c('0x3c')]=[{'all':!![]}];}_0x511a1f=_[_0x3c9c('0x37')]({},_0x511a1f,_0x371c13[_0x3c9c('0x39')]);return db[_0x3c9c('0x3a')][_0x3c9c('0x41')](_0x511a1f)[_0x3c9c('0x21')](handleEntityNotFound(_0x289c12,null))[_0x3c9c('0x21')](respondWithResult(_0x289c12,null))[_0x3c9c('0x3e')](handleError(_0x289c12,null));};exports[_0x3c9c('0x42')]=function(_0xe866e0,_0xe5b0c7){return db[_0x3c9c('0x3a')]['create'](_0xe866e0[_0x3c9c('0x43')],{})['then'](respondWithResult(_0xe5b0c7,0xc9))[_0x3c9c('0x3e')](handleError(_0xe5b0c7,null));};exports['update']=function(_0x59f4cf,_0x3d3f67){if(_0x59f4cf['body']['id']){delete _0x59f4cf[_0x3c9c('0x43')]['id'];}return db[_0x3c9c('0x3a')][_0x3c9c('0x41')]({'where':{'id':_0x59f4cf[_0x3c9c('0x44')]['id']}})[_0x3c9c('0x21')](handleEntityNotFound(_0x3d3f67,null))[_0x3c9c('0x21')](saveUpdates(_0x59f4cf[_0x3c9c('0x43')],null))[_0x3c9c('0x21')](respondWithResult(_0x3d3f67,null))[_0x3c9c('0x3e')](handleError(_0x3d3f67,null));};exports[_0x3c9c('0x45')]=function(_0x4bb1d9,_0x2cd997){return db[_0x3c9c('0x3a')]['find']({'where':{'id':_0x4bb1d9[_0x3c9c('0x44')]['id']}})[_0x3c9c('0x21')](handleEntityNotFound(_0x2cd997,null))[_0x3c9c('0x21')](removeEntity(_0x2cd997,null))[_0x3c9c('0x3e')](handleError(_0x2cd997,null));};exports[_0x3c9c('0x46')]=function(_0x54ecd0,_0x45d1eb){return db[_0x3c9c('0x3a')][_0x3c9c('0x46')]()[_0x3c9c('0x21')](respondWithResult(_0x45d1eb,null))[_0x3c9c('0x3e')](handleError(_0x45d1eb,null));}; \ No newline at end of file +var _0xea70=['body','destroy','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','undefined','limit','count','offset','set','Content-Range','json','reject','save','update','then','stack','name','send','index','map','FaxQueueReport','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','filter','type','VIRTUAL','merge','options','include','findAll','show','params','find','catch','create'];(function(_0x40db1b,_0x47fedf){var _0x372617=function(_0x3b6912){while(--_0x3b6912){_0x40db1b['push'](_0x40db1b['shift']());}};_0x372617(++_0x47fedf);}(_0xea70,0x175));var _0x0ea7=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xea70[_0x432682];return _0x463d05;};'use strict';var emlformat=require(_0x0ea7('0x0'));var rimraf=require(_0x0ea7('0x1'));var zipdir=require(_0x0ea7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0ea7('0x3'));var moment=require('moment');var BPromise=require(_0x0ea7('0x4'));var Mustache=require('mustache');var util=require(_0x0ea7('0x5'));var path=require(_0x0ea7('0x6'));var sox=require(_0x0ea7('0x7'));var csv=require(_0x0ea7('0x8'));var ejs=require(_0x0ea7('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0ea7('0xa'));var squel=require(_0x0ea7('0xb'));var crypto=require('crypto');var jsforce=require(_0x0ea7('0xc'));var deskjs=require(_0x0ea7('0xd'));var toCsv=require('to-csv');var querystring=require(_0x0ea7('0xe'));var Papa=require(_0x0ea7('0xf'));var Redis=require(_0x0ea7('0x10'));var authService=require(_0x0ea7('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x0ea7('0x12'));var hardwareService=require(_0x0ea7('0x13'));var logger=require(_0x0ea7('0x14'))(_0x0ea7('0x15'));var utils=require(_0x0ea7('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x0ea7('0x17'));var db=require(_0x0ea7('0x18'))['db'];function respondWithStatusCode(_0x349753,_0x56d68f){_0x56d68f=_0x56d68f||0xcc;return function(_0x5addc6){if(_0x5addc6){return _0x349753['sendStatus'](_0x56d68f);}return _0x349753[_0x0ea7('0x19')](_0x56d68f)[_0x0ea7('0x1a')]();};}function respondWithResult(_0x3312b3,_0x2cd543){_0x2cd543=_0x2cd543||0xc8;return function(_0x4e1cd9){if(_0x4e1cd9){return _0x3312b3['status'](_0x2cd543)['json'](_0x4e1cd9);}};}function respondWithFilteredResult(_0x44e922,_0x1e52e1){return function(_0xa6b67f){if(_0xa6b67f){var _0x548dad=typeof _0x1e52e1['offset']===_0x0ea7('0x1b')&&typeof _0x1e52e1[_0x0ea7('0x1c')]===_0x0ea7('0x1b');var _0x22fae2=_0xa6b67f[_0x0ea7('0x1d')];var _0x987032=_0x548dad?0x0:_0x1e52e1[_0x0ea7('0x1e')];var _0x48f10a=_0x548dad?_0xa6b67f['count']:_0x1e52e1[_0x0ea7('0x1e')]+_0x1e52e1[_0x0ea7('0x1c')];var _0x4f526b;if(_0x48f10a>=_0x22fae2){_0x48f10a=_0x22fae2;_0x4f526b=0xc8;}else{_0x4f526b=0xce;}_0x44e922[_0x0ea7('0x19')](_0x4f526b);return _0x44e922[_0x0ea7('0x1f')](_0x0ea7('0x20'),_0x987032+'-'+_0x48f10a+'/'+_0x22fae2)[_0x0ea7('0x21')](_0xa6b67f);}return null;};}function patchUpdates(_0x306ace){return function(_0x38494d){try{jsonpatch['apply'](_0x38494d,_0x306ace,!![]);}catch(_0x1f3bce){return BPromise[_0x0ea7('0x22')](_0x1f3bce);}return _0x38494d[_0x0ea7('0x23')]();};}function saveUpdates(_0x61c70e,_0x411603){return function(_0x82bb8){if(_0x82bb8){return _0x82bb8[_0x0ea7('0x24')](_0x61c70e)[_0x0ea7('0x25')](function(_0x47b53b){return _0x47b53b;});}return null;};}function removeEntity(_0x25b6c9,_0x2a0f71){return function(_0x76d6a9){if(_0x76d6a9){return _0x76d6a9['destroy']()[_0x0ea7('0x25')](function(){_0x25b6c9[_0x0ea7('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ba808,_0x5870b2){return function(_0x5adf93){if(!_0x5adf93){_0x3ba808['sendStatus'](0x194);}return _0x5adf93;};}function handleError(_0x32b956,_0x36ff0a){_0x36ff0a=_0x36ff0a||0x1f4;return function(_0x462715){logger['error'](_0x462715[_0x0ea7('0x26')]);if(_0x462715[_0x0ea7('0x27')]){delete _0x462715[_0x0ea7('0x27')];}_0x32b956[_0x0ea7('0x19')](_0x36ff0a)[_0x0ea7('0x28')](_0x462715);};}exports[_0x0ea7('0x29')]=function(_0x247c8c,_0x3fe1e3){var _0x4b6c47={},_0x27e9fd={},_0x3d07c3={'count':0x0,'rows':[]};var _0x51f18a=_[_0x0ea7('0x2a')](db[_0x0ea7('0x2b')][_0x0ea7('0x2c')],function(_0x465da4){return{'name':_0x465da4[_0x0ea7('0x2d')],'type':_0x465da4['type'][_0x0ea7('0x2e')]};});_0x27e9fd[_0x0ea7('0x2f')]=_[_0x0ea7('0x2a')](_0x51f18a,_0x0ea7('0x27'));_0x27e9fd[_0x0ea7('0x30')]=_[_0x0ea7('0x31')](_0x247c8c['query']);_0x27e9fd['filters']=_[_0x0ea7('0x32')](_0x27e9fd[_0x0ea7('0x2f')],_0x27e9fd[_0x0ea7('0x30')]);_0x4b6c47['attributes']=_['intersection'](_0x27e9fd[_0x0ea7('0x2f')],qs[_0x0ea7('0x33')](_0x247c8c[_0x0ea7('0x30')]['fields']));_0x4b6c47['attributes']=_0x4b6c47[_0x0ea7('0x34')][_0x0ea7('0x35')]?_0x4b6c47[_0x0ea7('0x34')]:_0x27e9fd[_0x0ea7('0x2f')];if(!_0x247c8c['query'][_0x0ea7('0x36')](_0x0ea7('0x37'))){_0x4b6c47['limit']=qs[_0x0ea7('0x1c')](_0x247c8c[_0x0ea7('0x30')][_0x0ea7('0x1c')]);_0x4b6c47[_0x0ea7('0x1e')]=qs['offset'](_0x247c8c[_0x0ea7('0x30')][_0x0ea7('0x1e')]);}_0x4b6c47['order']=qs[_0x0ea7('0x38')](_0x247c8c[_0x0ea7('0x30')][_0x0ea7('0x38')]);_0x4b6c47[_0x0ea7('0x39')]=qs[_0x0ea7('0x3a')](_['pick'](_0x247c8c[_0x0ea7('0x30')],_0x27e9fd[_0x0ea7('0x3a')]),_0x51f18a);if(_0x247c8c[_0x0ea7('0x30')][_0x0ea7('0x3b')]){_0x4b6c47['where']=_['merge'](_0x4b6c47[_0x0ea7('0x39')],{'$or':_[_0x0ea7('0x2a')](_0x51f18a,function(_0x521c1e){if(_0x521c1e[_0x0ea7('0x3c')]!==_0x0ea7('0x3d')){var _0x295708={};_0x295708[_0x521c1e[_0x0ea7('0x27')]]={'$like':'%'+_0x247c8c[_0x0ea7('0x30')][_0x0ea7('0x3b')]+'%'};return _0x295708;}})});}_0x4b6c47=_[_0x0ea7('0x3e')]({},_0x4b6c47,_0x247c8c[_0x0ea7('0x3f')]);var _0x11310a={'where':_0x4b6c47[_0x0ea7('0x39')]};return db['FaxQueueReport'][_0x0ea7('0x1d')](_0x11310a)[_0x0ea7('0x25')](function(_0x4fc3fb){_0x3d07c3[_0x0ea7('0x1d')]=_0x4fc3fb;if(_0x247c8c[_0x0ea7('0x30')]['includeAll']){_0x4b6c47[_0x0ea7('0x40')]=[{'all':!![]}];}return db['FaxQueueReport'][_0x0ea7('0x41')](_0x4b6c47);})[_0x0ea7('0x25')](function(_0x4f4bc3){_0x3d07c3['rows']=_0x4f4bc3;return _0x3d07c3;})[_0x0ea7('0x25')](respondWithFilteredResult(_0x3fe1e3,_0x4b6c47))['catch'](handleError(_0x3fe1e3,null));};exports[_0x0ea7('0x42')]=function(_0x8d2f37,_0x1eab95){var _0x461946={'raw':!![],'where':{'id':_0x8d2f37[_0x0ea7('0x43')]['id']}},_0x251f26={};_0x251f26[_0x0ea7('0x2f')]=_[_0x0ea7('0x31')](db[_0x0ea7('0x2b')][_0x0ea7('0x2c')]);_0x251f26['query']=_[_0x0ea7('0x31')](_0x8d2f37[_0x0ea7('0x30')]);_0x251f26[_0x0ea7('0x3a')]=_[_0x0ea7('0x32')](_0x251f26[_0x0ea7('0x2f')],_0x251f26[_0x0ea7('0x30')]);_0x461946[_0x0ea7('0x34')]=_[_0x0ea7('0x32')](_0x251f26['model'],qs[_0x0ea7('0x33')](_0x8d2f37['query'][_0x0ea7('0x33')]));_0x461946[_0x0ea7('0x34')]=_0x461946[_0x0ea7('0x34')]['length']?_0x461946[_0x0ea7('0x34')]:_0x251f26['model'];if(_0x8d2f37[_0x0ea7('0x30')]['includeAll']){_0x461946[_0x0ea7('0x40')]=[{'all':!![]}];}_0x461946=_[_0x0ea7('0x3e')]({},_0x461946,_0x8d2f37['options']);return db[_0x0ea7('0x2b')][_0x0ea7('0x44')](_0x461946)[_0x0ea7('0x25')](handleEntityNotFound(_0x1eab95,null))['then'](respondWithResult(_0x1eab95,null))[_0x0ea7('0x45')](handleError(_0x1eab95,null));};exports[_0x0ea7('0x46')]=function(_0x426388,_0xdedde2){return db[_0x0ea7('0x2b')][_0x0ea7('0x46')](_0x426388['body'],{})['then'](respondWithResult(_0xdedde2,0xc9))[_0x0ea7('0x45')](handleError(_0xdedde2,null));};exports[_0x0ea7('0x24')]=function(_0x2d6b25,_0x34d84e){if(_0x2d6b25['body']['id']){delete _0x2d6b25[_0x0ea7('0x47')]['id'];}return db[_0x0ea7('0x2b')][_0x0ea7('0x44')]({'where':{'id':_0x2d6b25[_0x0ea7('0x43')]['id']}})[_0x0ea7('0x25')](handleEntityNotFound(_0x34d84e,null))[_0x0ea7('0x25')](saveUpdates(_0x2d6b25[_0x0ea7('0x47')],null))[_0x0ea7('0x25')](respondWithResult(_0x34d84e,null))['catch'](handleError(_0x34d84e,null));};exports[_0x0ea7('0x48')]=function(_0x3a9e4c,_0x819d67){return db[_0x0ea7('0x2b')][_0x0ea7('0x44')]({'where':{'id':_0x3a9e4c[_0x0ea7('0x43')]['id']}})[_0x0ea7('0x25')](handleEntityNotFound(_0x819d67,null))[_0x0ea7('0x25')](removeEntity(_0x819d67,null))[_0x0ea7('0x45')](handleError(_0x819d67,null));};exports['describe']=function(_0x355bc3,_0x5bd597){return db[_0x0ea7('0x2b')][_0x0ea7('0x49')]()[_0x0ea7('0x25')](respondWithResult(_0x5bd597,null))[_0x0ea7('0x45')](handleError(_0x5bd597,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 682501c..0d7b635 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 _0x4975=['path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','FaxQueueReport','report_fax_queue','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x229d1f,_0x56de56){var _0x5e04e0=function(_0x9a1f4b){while(--_0x9a1f4b){_0x229d1f['push'](_0x229d1f['shift']());}};_0x5e04e0(++_0x56de56);}(_0x4975,0x86));var _0x5497=function(_0x10d161,_0xf5b101){_0x10d161=_0x10d161-0x0;var _0x5ba9e5=_0x4975[_0x10d161];return _0x5ba9e5;};'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 +var _0x326f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','uniqueid','lodash'];(function(_0x455940,_0x1a3179){var _0x10032e=function(_0x3704b5){while(--_0x3704b5){_0x455940['push'](_0x455940['shift']());}};_0x10032e(++_0x1a3179);}(_0x326f,0xd1));var _0xf326=function(_0x335e6b,_0x3a14d9){_0x335e6b=_0x335e6b-0x0;var _0x1b808f=_0x326f[_0x335e6b];return _0x1b808f;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf326('0x1'));var moment=require(_0xf326('0x2'));var BPromise=require(_0xf326('0x3'));var rp=require(_0xf326('0x4'));var fs=require('fs');var path=require(_0xf326('0x5'));var rimraf=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var attributes=require(_0xf326('0x8'));module[_0xf326('0x9')]=function(_0x3ace29,_0x4c2249){return _0x3ace29[_0xf326('0xa')](_0xf326('0xb'),attributes,{'tableName':_0xf326('0xc'),'paranoid':![],'indexes':[{'name':_0xf326('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 191b214..7fe5b21 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 _0xe17b=['jayson/promise','http','info','request\x20sent','debug','stringify','error','code','FaxQueueReport,\x20%s,\x20%s','message','result','CreateFaxQueueReport','FaxQueueReport','create','options','raw','then','UpdateFaxQueueReport','update','body','attributes','limit','catch','util','moment','../../mysqldb','../../config/environment'];(function(_0x1141ca,_0x3c7c0d){var _0x11eae5=function(_0x5034e7){while(--_0x5034e7){_0x1141ca['push'](_0x1141ca['shift']());}};_0x11eae5(++_0x3c7c0d);}(_0xe17b,0xb9));var _0xbe17=function(_0x11e03f,_0x20b967){_0x11e03f=_0x11e03f-0x0;var _0x5666fe=_0xe17b[_0x11e03f];return _0x5666fe;};'use strict';var _=require('lodash');var util=require(_0xbe17('0x0'));var moment=require(_0xbe17('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbe17('0x2'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xbe17('0x3'));var jayson=require(_0xbe17('0x4'));var client=jayson['client'][_0xbe17('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x1e5fc9,_0x2953f6,_0x48bf88){return new BPromise(function(_0x876e,_0x3dd8ea){return client['request'](_0x1e5fc9,_0x48bf88)['then'](function(_0x42897d){logger[_0xbe17('0x6')]('FaxQueueReport,\x20%s,\x20%s',_0x2953f6,_0xbe17('0x7'));logger[_0xbe17('0x8')]('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x2953f6,_0xbe17('0x7'),JSON[_0xbe17('0x9')](_0x42897d));if(_0x42897d[_0xbe17('0xa')]){if(_0x42897d[_0xbe17('0xa')][_0xbe17('0xb')]===0x1f4){logger[_0xbe17('0xa')](_0xbe17('0xc'),_0x2953f6,_0x42897d['error'][_0xbe17('0xd')]);return _0x3dd8ea(_0x42897d['error'][_0xbe17('0xd')]);}logger[_0xbe17('0xa')](_0xbe17('0xc'),_0x2953f6,_0x42897d[_0xbe17('0xa')][_0xbe17('0xd')]);return _0x876e(_0x42897d['error'][_0xbe17('0xd')]);}else{logger[_0xbe17('0x6')]('FaxQueueReport,\x20%s,\x20%s',_0x2953f6,'request\x20sent');_0x876e(_0x42897d[_0xbe17('0xe')][_0xbe17('0xd')]);}})['catch'](function(_0xa8493c){logger['error'](_0xbe17('0xc'),_0x2953f6,_0xa8493c);_0x3dd8ea(_0xa8493c);});});}exports[_0xbe17('0xf')]=function(_0xea464c){var _0x34448e=this;return new Promise(function(_0x4816ef,_0x536cef){return db[_0xbe17('0x10')][_0xbe17('0x11')](_0xea464c['body'],{'raw':_0xea464c[_0xbe17('0x12')]?_0xea464c[_0xbe17('0x12')][_0xbe17('0x13')]===undefined?!![]:![]:!![]})[_0xbe17('0x14')](function(_0x2fe62f){logger[_0xbe17('0x6')](_0xbe17('0xf'),_0xea464c);logger[_0xbe17('0x8')](_0xbe17('0xf'),_0xea464c,JSON['stringify'](_0x2fe62f));_0x4816ef(_0x2fe62f);})['catch'](function(_0x3410d5){logger[_0xbe17('0xa')]('CreateFaxQueueReport',_0x3410d5[_0xbe17('0xd')],_0xea464c);_0x536cef(_0x34448e[_0xbe17('0xa')](0x1f4,_0x3410d5[_0xbe17('0xd')]));});});};exports[_0xbe17('0x15')]=function(_0x3a499c){var _0x5f073d=this;return new Promise(function(_0x2870d0,_0x4e92a8){return db[_0xbe17('0x10')][_0xbe17('0x16')](_0x3a499c[_0xbe17('0x17')],{'raw':_0x3a499c[_0xbe17('0x12')]?_0x3a499c[_0xbe17('0x12')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3a499c[_0xbe17('0x12')]?_0x3a499c[_0xbe17('0x12')]['where']||null:null,'attributes':_0x3a499c[_0xbe17('0x12')]?_0x3a499c[_0xbe17('0x12')][_0xbe17('0x18')]||null:null,'limit':_0x3a499c[_0xbe17('0x12')]?_0x3a499c[_0xbe17('0x12')][_0xbe17('0x19')]||null:null})[_0xbe17('0x14')](function(_0x387eec){logger[_0xbe17('0x6')](_0xbe17('0x15'),_0x3a499c);logger['debug'](_0xbe17('0x15'),_0x3a499c,JSON[_0xbe17('0x9')](_0x387eec));_0x2870d0(_0x387eec);})[_0xbe17('0x1a')](function(_0x14f188){logger['error'](_0xbe17('0x15'),_0x14f188[_0xbe17('0xd')],_0x3a499c);_0x4e92a8(_0x5f073d[_0xbe17('0xa')](0x1f4,_0x14f188[_0xbe17('0xd')]));});});}; \ No newline at end of file +var _0x333f=['message','info','result','catch','FaxQueueReport','create','options','CreateFaxQueueReport','debug','UpdateFaxQueueReport','update','body','raw','where','limit','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','request\x20sent','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxQueueReport,\x20%s,\x20%s'];(function(_0x581162,_0x2f98ec){var _0x575db7=function(_0x2ba01f){while(--_0x2ba01f){_0x581162['push'](_0x581162['shift']());}};_0x575db7(++_0x2f98ec);}(_0x333f,0x93));var _0xf333=function(_0x212ad8,_0x6cd3e2){_0x212ad8=_0x212ad8-0x0;var _0x3d4a3a=_0x333f[_0x212ad8];return _0x3d4a3a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf333('0x0'));var BPromise=require(_0xf333('0x1'));var rs=require(_0xf333('0x2'));var fs=require('fs');var Redis=require(_0xf333('0x3'));var db=require(_0xf333('0x4'))['db'];var utils=require(_0xf333('0x5'));var logger=require(_0xf333('0x6'))(_0xf333('0x7'));var config=require(_0xf333('0x8'));var jayson=require(_0xf333('0x9'));var client=jayson['client'][_0xf333('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4bd663,_0x4c6687,_0x19dfcf){return new BPromise(function(_0x5db1d2,_0x3a0521){return client['request'](_0x4bd663,_0x19dfcf)[_0xf333('0xb')](function(_0x581091){logger['info']('FaxQueueReport,\x20%s,\x20%s',_0x4c6687,_0xf333('0xc'));logger['debug'](_0xf333('0xd'),_0x4c6687,_0xf333('0xc'),JSON[_0xf333('0xe')](_0x581091));if(_0x581091[_0xf333('0xf')]){if(_0x581091['error'][_0xf333('0x10')]===0x1f4){logger[_0xf333('0xf')](_0xf333('0x11'),_0x4c6687,_0x581091[_0xf333('0xf')][_0xf333('0x12')]);return _0x3a0521(_0x581091[_0xf333('0xf')][_0xf333('0x12')]);}logger['error'](_0xf333('0x11'),_0x4c6687,_0x581091[_0xf333('0xf')]['message']);return _0x5db1d2(_0x581091[_0xf333('0xf')][_0xf333('0x12')]);}else{logger[_0xf333('0x13')](_0xf333('0x11'),_0x4c6687,'request\x20sent');_0x5db1d2(_0x581091[_0xf333('0x14')][_0xf333('0x12')]);}})[_0xf333('0x15')](function(_0x577f6f){logger[_0xf333('0xf')]('FaxQueueReport,\x20%s,\x20%s',_0x4c6687,_0x577f6f);_0x3a0521(_0x577f6f);});});}exports['CreateFaxQueueReport']=function(_0x45f1ee){var _0x7e6101=this;return new Promise(function(_0x5d6101,_0x24edcc){return db[_0xf333('0x16')][_0xf333('0x17')](_0x45f1ee['body'],{'raw':_0x45f1ee[_0xf333('0x18')]?_0x45f1ee[_0xf333('0x18')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1db6c9){logger[_0xf333('0x13')](_0xf333('0x19'),_0x45f1ee);logger[_0xf333('0x1a')](_0xf333('0x19'),_0x45f1ee,JSON[_0xf333('0xe')](_0x1db6c9));_0x5d6101(_0x1db6c9);})[_0xf333('0x15')](function(_0x3803f3){logger[_0xf333('0xf')](_0xf333('0x19'),_0x3803f3['message'],_0x45f1ee);_0x24edcc(_0x7e6101[_0xf333('0xf')](0x1f4,_0x3803f3[_0xf333('0x12')]));});});};exports[_0xf333('0x1b')]=function(_0x25853c){var _0x496527=this;return new Promise(function(_0x638668,_0x249450){return db['FaxQueueReport'][_0xf333('0x1c')](_0x25853c[_0xf333('0x1d')],{'raw':_0x25853c[_0xf333('0x18')]?_0x25853c[_0xf333('0x18')][_0xf333('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x25853c[_0xf333('0x18')]?_0x25853c['options'][_0xf333('0x1f')]||null:null,'attributes':_0x25853c[_0xf333('0x18')]?_0x25853c['options']['attributes']||null:null,'limit':_0x25853c[_0xf333('0x18')]?_0x25853c[_0xf333('0x18')][_0xf333('0x20')]||null:null})[_0xf333('0xb')](function(_0x2d77db){logger['info']('UpdateFaxQueueReport',_0x25853c);logger[_0xf333('0x1a')](_0xf333('0x1b'),_0x25853c,JSON[_0xf333('0xe')](_0x2d77db));_0x638668(_0x2d77db);})['catch'](function(_0x5c6741){logger['error'](_0xf333('0x1b'),_0x5c6741[_0xf333('0x12')],_0x25853c);_0x249450(_0x496527['error'](0x1f4,_0x5c6741[_0xf333('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index ce2d398..556e277 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 _0x9532=['multer','express','fs-extra','../../components/interaction/service','../../config/environment','index','/describe','isAuthenticated','describe','get','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9532,0x130));var _0x2953=function(_0x4ad89c,_0x290f55){_0x4ad89c=_0x4ad89c-0x0;var _0x53e5fd=_0x9532[_0x4ad89c];return _0x53e5fd;};'use strict';var multer=require(_0x2953('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2953('0x1'));var router=express['Router']();var fs_extra=require(_0x2953('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x2953('0x3'));var config=require(_0x2953('0x4'));var controller=require('./faxQueueReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x2953('0x5')]);router['get'](_0x2953('0x6'),auth[_0x2953('0x7')](),controller[_0x2953('0x8')]);router[_0x2953('0x9')](_0x2953('0xa'),auth[_0x2953('0x7')](),controller[_0x2953('0xb')]);router[_0x2953('0xc')]('/',auth['isAuthenticated'](),controller[_0x2953('0xd')]);router[_0x2953('0xe')](_0x2953('0xa'),auth['isAuthenticated'](),controller[_0x2953('0xf')]);router[_0x2953('0x10')](_0x2953('0xa'),auth[_0x2953('0x7')](),controller[_0x2953('0x11')]);module[_0x2953('0x12')]=router; \ No newline at end of file +var _0x46e4=['../../components/auth/service','../../components/interaction/service','./faxQueueReport.controller','index','/describe','isAuthenticated','describe','get','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express'];(function(_0x3e6f26,_0x155dae){var _0x2bc2e8=function(_0x1525b6){while(--_0x1525b6){_0x3e6f26['push'](_0x3e6f26['shift']());}};_0x2bc2e8(++_0x155dae);}(_0x46e4,0x161));var _0x446e=function(_0x44fdd9,_0x1f9b98){_0x44fdd9=_0x44fdd9-0x0;var _0x2b1482=_0x46e4[_0x44fdd9];return _0x2b1482;};'use strict';var multer=require('multer');var util=require(_0x446e('0x0'));var path=require(_0x446e('0x1'));var timeout=require(_0x446e('0x2'));var express=require(_0x446e('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x446e('0x4'));var interaction=require(_0x446e('0x5'));var config=require('../../config/environment');var controller=require(_0x446e('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x446e('0x7')]);router['get'](_0x446e('0x8'),auth[_0x446e('0x9')](),controller[_0x446e('0xa')]);router[_0x446e('0xb')](_0x446e('0xc'),auth[_0x446e('0x9')](),controller[_0x446e('0xd')]);router[_0x446e('0xe')]('/',auth[_0x446e('0x9')](),controller[_0x446e('0xf')]);router[_0x446e('0x10')]('/:id',auth[_0x446e('0x9')](),controller[_0x446e('0x11')]);router[_0x446e('0x12')](_0x446e('0xc'),auth[_0x446e('0x9')](),controller[_0x446e('0x13')]);module[_0x446e('0x14')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 87cb28f..f6f6861 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 _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x354279,_0x1573a9){var _0x55db41=function(_0x159f95){while(--_0x159f95){_0x354279['push'](_0x354279['shift']());}};_0x55db41(++_0x1573a9);}(_0x008c,0x188));var _0xc008=function(_0x17791f,_0x1d16d8){_0x17791f=_0x17791f-0x0;var _0x332dc4=_0x008c[_0x17791f];return _0x332dc4;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}}; \ No newline at end of file +var _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x248a43,_0x59e52a){var _0x451379=function(_0x2c5209){while(--_0x2c5209){_0x248a43['push'](_0x248a43['shift']());}};_0x451379(++_0x59e52a);}(_0x34e8,0x12c));var _0x834e=function(_0x189d90,_0x3ed7cb){_0x189d90=_0x189d90-0x0;var _0x4dd3b4=_0x34e8[_0x189d90];return _0x4dd3b4;};'use strict';var moment=require(_0x834e('0x0'));var Sequelize=require(_0x834e('0x1'));module[_0x834e('0x2')]={'uniqueid':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6')),'allowNull':![],'defaultValue':_0x834e('0x6')},'transferredAt':{'type':Sequelize[_0x834e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x834e('0x8')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 099e8fc..30435da 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 _0xc556=['create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','error','stack','name','send','map','FaxTransferReport','rawAttributes','fieldName','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find'];(function(_0xae3fe2,_0x59fd02){var _0x2e4d8e=function(_0x424c0b){while(--_0x424c0b){_0xae3fe2['push'](_0xae3fe2['shift']());}};_0x2e4d8e(++_0x59fd02);}(_0xc556,0x95));var _0x6c55=function(_0x105367,_0x2d2d4d){_0x105367=_0x105367-0x0;var _0x294beb=_0xc556[_0x105367];return _0x294beb;};'use strict';var emlformat=require(_0x6c55('0x0'));var rimraf=require(_0x6c55('0x1'));var zipdir=require(_0x6c55('0x2'));var jsonpatch=require(_0x6c55('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6c55('0x4'));var path=require(_0x6c55('0x5'));var sox=require('sox');var csv=require(_0x6c55('0x6'));var ejs=require(_0x6c55('0x7'));var fs=require('fs');var fs_extra=require(_0x6c55('0x8'));var _=require(_0x6c55('0x9'));var squel=require(_0x6c55('0xa'));var crypto=require(_0x6c55('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6c55('0xc'));var Papa=require(_0x6c55('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6c55('0xe'));var as=require(_0x6c55('0xf'));var hardwareService=require(_0x6c55('0x10'));var logger=require(_0x6c55('0x11'))(_0x6c55('0x12'));var utils=require(_0x6c55('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x299e43,_0x332cb6){_0x332cb6=_0x332cb6||0xcc;return function(_0x2039e8){if(_0x2039e8){return _0x299e43[_0x6c55('0x14')](_0x332cb6);}return _0x299e43[_0x6c55('0x15')](_0x332cb6)[_0x6c55('0x16')]();};}function respondWithResult(_0x580970,_0x46407){_0x46407=_0x46407||0xc8;return function(_0x433b7a){if(_0x433b7a){return _0x580970[_0x6c55('0x15')](_0x46407)[_0x6c55('0x17')](_0x433b7a);}};}function respondWithFilteredResult(_0x19a7ce,_0x238a1f){return function(_0x2ec301){if(_0x2ec301){var _0x1a3555=typeof _0x238a1f[_0x6c55('0x18')]===_0x6c55('0x19')&&typeof _0x238a1f[_0x6c55('0x1a')]===_0x6c55('0x19');var _0x1b235c=_0x2ec301['count'];var _0x4514e4=_0x1a3555?0x0:_0x238a1f[_0x6c55('0x18')];var _0x46ec5e=_0x1a3555?_0x2ec301[_0x6c55('0x1b')]:_0x238a1f['offset']+_0x238a1f[_0x6c55('0x1a')];var _0x5114eb;if(_0x46ec5e>=_0x1b235c){_0x46ec5e=_0x1b235c;_0x5114eb=0xc8;}else{_0x5114eb=0xce;}_0x19a7ce[_0x6c55('0x15')](_0x5114eb);return _0x19a7ce[_0x6c55('0x1c')](_0x6c55('0x1d'),_0x4514e4+'-'+_0x46ec5e+'/'+_0x1b235c)[_0x6c55('0x17')](_0x2ec301);}return null;};}function patchUpdates(_0x24fd66){return function(_0xeeb843){try{jsonpatch['apply'](_0xeeb843,_0x24fd66,!![]);}catch(_0x2413f6){return BPromise[_0x6c55('0x1e')](_0x2413f6);}return _0xeeb843[_0x6c55('0x1f')]();};}function saveUpdates(_0x3eb66b,_0x372f67){return function(_0x4f2022){if(_0x4f2022){return _0x4f2022[_0x6c55('0x20')](_0x3eb66b)['then'](function(_0x13b690){return _0x13b690;});}return null;};}function removeEntity(_0x4d63e4,_0x1f4613){return function(_0x463b14){if(_0x463b14){return _0x463b14[_0x6c55('0x21')]()[_0x6c55('0x22')](function(){_0x4d63e4[_0x6c55('0x15')](0xcc)[_0x6c55('0x16')]();});}};}function handleEntityNotFound(_0x20b6ed,_0x3b615e){return function(_0x14dde5){if(!_0x14dde5){_0x20b6ed[_0x6c55('0x14')](0x194);}return _0x14dde5;};}function handleError(_0x3604d5,_0x3fee58){_0x3fee58=_0x3fee58||0x1f4;return function(_0x363306){logger[_0x6c55('0x23')](_0x363306[_0x6c55('0x24')]);if(_0x363306[_0x6c55('0x25')]){delete _0x363306[_0x6c55('0x25')];}_0x3604d5[_0x6c55('0x15')](_0x3fee58)[_0x6c55('0x26')](_0x363306);};}exports['index']=function(_0x57bb9c,_0x364144){var _0x24b78e={},_0x30fc94={},_0x1e7051={'count':0x0,'rows':[]};var _0x26cdc1=_[_0x6c55('0x27')](db[_0x6c55('0x28')][_0x6c55('0x29')],function(_0x580189){return{'name':_0x580189[_0x6c55('0x2a')],'type':_0x580189['type']['key']};});_0x30fc94[_0x6c55('0x2b')]=_[_0x6c55('0x27')](_0x26cdc1,_0x6c55('0x25'));_0x30fc94[_0x6c55('0x2c')]=_[_0x6c55('0x2d')](_0x57bb9c['query']);_0x30fc94[_0x6c55('0x2e')]=_[_0x6c55('0x2f')](_0x30fc94['model'],_0x30fc94[_0x6c55('0x2c')]);_0x24b78e['attributes']=_[_0x6c55('0x2f')](_0x30fc94[_0x6c55('0x2b')],qs[_0x6c55('0x30')](_0x57bb9c[_0x6c55('0x2c')][_0x6c55('0x30')]));_0x24b78e[_0x6c55('0x31')]=_0x24b78e['attributes'][_0x6c55('0x32')]?_0x24b78e['attributes']:_0x30fc94[_0x6c55('0x2b')];if(!_0x57bb9c[_0x6c55('0x2c')][_0x6c55('0x33')](_0x6c55('0x34'))){_0x24b78e[_0x6c55('0x1a')]=qs[_0x6c55('0x1a')](_0x57bb9c[_0x6c55('0x2c')][_0x6c55('0x1a')]);_0x24b78e['offset']=qs[_0x6c55('0x18')](_0x57bb9c[_0x6c55('0x2c')][_0x6c55('0x18')]);}_0x24b78e[_0x6c55('0x35')]=qs[_0x6c55('0x36')](_0x57bb9c['query'][_0x6c55('0x36')]);_0x24b78e[_0x6c55('0x37')]=qs['filters'](_[_0x6c55('0x38')](_0x57bb9c['query'],_0x30fc94[_0x6c55('0x2e')]),_0x26cdc1);if(_0x57bb9c[_0x6c55('0x2c')][_0x6c55('0x39')]){_0x24b78e[_0x6c55('0x37')]=_[_0x6c55('0x3a')](_0x24b78e[_0x6c55('0x37')],{'$or':_[_0x6c55('0x27')](_0x26cdc1,function(_0x4d877d){if(_0x4d877d[_0x6c55('0x3b')]!==_0x6c55('0x3c')){var _0x339c9c={};_0x339c9c[_0x4d877d[_0x6c55('0x25')]]={'$like':'%'+_0x57bb9c[_0x6c55('0x2c')][_0x6c55('0x39')]+'%'};return _0x339c9c;}})});}_0x24b78e=_[_0x6c55('0x3a')]({},_0x24b78e,_0x57bb9c[_0x6c55('0x3d')]);var _0x5a29c8={'where':_0x24b78e[_0x6c55('0x37')]};return db[_0x6c55('0x28')][_0x6c55('0x1b')](_0x5a29c8)['then'](function(_0x4c930a){_0x1e7051[_0x6c55('0x1b')]=_0x4c930a;if(_0x57bb9c[_0x6c55('0x2c')]['includeAll']){_0x24b78e[_0x6c55('0x3e')]=[{'all':!![]}];}return db[_0x6c55('0x28')][_0x6c55('0x3f')](_0x24b78e);})[_0x6c55('0x22')](function(_0x10774f){_0x1e7051[_0x6c55('0x40')]=_0x10774f;return _0x1e7051;})[_0x6c55('0x22')](respondWithFilteredResult(_0x364144,_0x24b78e))[_0x6c55('0x41')](handleError(_0x364144,null));};exports[_0x6c55('0x42')]=function(_0xd9472,_0x1613e0){var _0x4f5ba3={'raw':!![],'where':{'id':_0xd9472[_0x6c55('0x43')]['id']}},_0x4d9153={};_0x4d9153[_0x6c55('0x2b')]=_[_0x6c55('0x2d')](db[_0x6c55('0x28')][_0x6c55('0x29')]);_0x4d9153[_0x6c55('0x2c')]=_['keys'](_0xd9472['query']);_0x4d9153[_0x6c55('0x2e')]=_[_0x6c55('0x2f')](_0x4d9153['model'],_0x4d9153['query']);_0x4f5ba3['attributes']=_['intersection'](_0x4d9153[_0x6c55('0x2b')],qs[_0x6c55('0x30')](_0xd9472[_0x6c55('0x2c')][_0x6c55('0x30')]));_0x4f5ba3[_0x6c55('0x31')]=_0x4f5ba3[_0x6c55('0x31')][_0x6c55('0x32')]?_0x4f5ba3[_0x6c55('0x31')]:_0x4d9153['model'];if(_0xd9472[_0x6c55('0x2c')][_0x6c55('0x44')]){_0x4f5ba3['include']=[{'all':!![]}];}_0x4f5ba3=_[_0x6c55('0x3a')]({},_0x4f5ba3,_0xd9472[_0x6c55('0x3d')]);return db['FaxTransferReport'][_0x6c55('0x45')](_0x4f5ba3)[_0x6c55('0x22')](handleEntityNotFound(_0x1613e0,null))[_0x6c55('0x22')](respondWithResult(_0x1613e0,null))[_0x6c55('0x41')](handleError(_0x1613e0,null));};exports[_0x6c55('0x46')]=function(_0x3b29c6,_0x213374){return db[_0x6c55('0x28')][_0x6c55('0x46')](_0x3b29c6[_0x6c55('0x47')],{})['then'](respondWithResult(_0x213374,0xc9))['catch'](handleError(_0x213374,null));};exports[_0x6c55('0x20')]=function(_0x7dc729,_0x2bc332){if(_0x7dc729[_0x6c55('0x47')]['id']){delete _0x7dc729[_0x6c55('0x47')]['id'];}return db[_0x6c55('0x28')]['find']({'where':{'id':_0x7dc729['params']['id']}})['then'](handleEntityNotFound(_0x2bc332,null))[_0x6c55('0x22')](saveUpdates(_0x7dc729[_0x6c55('0x47')],null))['then'](respondWithResult(_0x2bc332,null))[_0x6c55('0x41')](handleError(_0x2bc332,null));};exports[_0x6c55('0x21')]=function(_0x5248b5,_0x4fff85){return db[_0x6c55('0x28')][_0x6c55('0x45')]({'where':{'id':_0x5248b5[_0x6c55('0x43')]['id']}})[_0x6c55('0x22')](handleEntityNotFound(_0x4fff85,null))[_0x6c55('0x22')](removeEntity(_0x4fff85,null))['catch'](handleError(_0x4fff85,null));};exports['describe']=function(_0x520e04,_0x354057){return db[_0x6c55('0x28')][_0x6c55('0x48')]()[_0x6c55('0x22')](respondWithResult(_0x354057,null))[_0x6c55('0x41')](handleError(_0x354057,null));}; \ No newline at end of file +var _0x338a=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','stack','name','index','map','rawAttributes','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','FaxTransferReport','includeAll','include','findAll','rows','params','find','create','body','catch','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x14eeee,_0x3b35f6){var _0x3aff97=function(_0x29df16){while(--_0x29df16){_0x14eeee['push'](_0x14eeee['shift']());}};_0x3aff97(++_0x3b35f6);}(_0x338a,0xc5));var _0xa338=function(_0x22c320,_0xca0595){_0x22c320=_0x22c320-0x0;var _0x2a25e4=_0x338a[_0x22c320];return _0x2a25e4;};'use strict';var emlformat=require(_0xa338('0x0'));var rimraf=require(_0xa338('0x1'));var zipdir=require(_0xa338('0x2'));var jsonpatch=require(_0xa338('0x3'));var rp=require('request-promise');var moment=require(_0xa338('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa338('0x5'));var util=require(_0xa338('0x6'));var path=require('path');var sox=require(_0xa338('0x7'));var csv=require(_0xa338('0x8'));var ejs=require(_0xa338('0x9'));var fs=require('fs');var fs_extra=require(_0xa338('0xa'));var _=require(_0xa338('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa338('0xc'));var deskjs=require(_0xa338('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa338('0xe'));var Redis=require(_0xa338('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xa338('0x10'));var as=require(_0xa338('0x11'));var hardwareService=require(_0xa338('0x12'));var logger=require(_0xa338('0x13'))(_0xa338('0x14'));var utils=require(_0xa338('0x15'));var config=require(_0xa338('0x16'));var licenseUtil=require(_0xa338('0x17'));var db=require(_0xa338('0x18'))['db'];function respondWithStatusCode(_0x587771,_0x77149c){_0x77149c=_0x77149c||0xcc;return function(_0x8789d){if(_0x8789d){return _0x587771[_0xa338('0x19')](_0x77149c);}return _0x587771[_0xa338('0x1a')](_0x77149c)[_0xa338('0x1b')]();};}function respondWithResult(_0x5063ed,_0x35d599){_0x35d599=_0x35d599||0xc8;return function(_0x2b536e){if(_0x2b536e){return _0x5063ed['status'](_0x35d599)['json'](_0x2b536e);}};}function respondWithFilteredResult(_0x52182a,_0x54c71e){return function(_0x3d0785){if(_0x3d0785){var _0x100400=typeof _0x54c71e[_0xa338('0x1c')]===_0xa338('0x1d')&&typeof _0x54c71e[_0xa338('0x1e')]===_0xa338('0x1d');var _0xbabf1a=_0x3d0785[_0xa338('0x1f')];var _0x22fc0f=_0x100400?0x0:_0x54c71e[_0xa338('0x1c')];var _0x345342=_0x100400?_0x3d0785[_0xa338('0x1f')]:_0x54c71e['offset']+_0x54c71e[_0xa338('0x1e')];var _0x239825;if(_0x345342>=_0xbabf1a){_0x345342=_0xbabf1a;_0x239825=0xc8;}else{_0x239825=0xce;}_0x52182a[_0xa338('0x1a')](_0x239825);return _0x52182a[_0xa338('0x20')](_0xa338('0x21'),_0x22fc0f+'-'+_0x345342+'/'+_0xbabf1a)[_0xa338('0x22')](_0x3d0785);}return null;};}function patchUpdates(_0x1bd3e4){return function(_0x545b97){try{jsonpatch[_0xa338('0x23')](_0x545b97,_0x1bd3e4,!![]);}catch(_0xf0daa7){return BPromise['reject'](_0xf0daa7);}return _0x545b97[_0xa338('0x24')]();};}function saveUpdates(_0x26f497,_0x3d4055){return function(_0xfafc8b){if(_0xfafc8b){return _0xfafc8b[_0xa338('0x25')](_0x26f497)[_0xa338('0x26')](function(_0x3803b0){return _0x3803b0;});}return null;};}function removeEntity(_0x23a405,_0x293b21){return function(_0x39b840){if(_0x39b840){return _0x39b840['destroy']()[_0xa338('0x26')](function(){_0x23a405[_0xa338('0x1a')](0xcc)[_0xa338('0x1b')]();});}};}function handleEntityNotFound(_0xa46bb8,_0x6d6105){return function(_0x485171){if(!_0x485171){_0xa46bb8[_0xa338('0x19')](0x194);}return _0x485171;};}function handleError(_0x29eb05,_0xc94d88){_0xc94d88=_0xc94d88||0x1f4;return function(_0x1d0fa4){logger['error'](_0x1d0fa4[_0xa338('0x27')]);if(_0x1d0fa4[_0xa338('0x28')]){delete _0x1d0fa4[_0xa338('0x28')];}_0x29eb05[_0xa338('0x1a')](_0xc94d88)['send'](_0x1d0fa4);};}exports[_0xa338('0x29')]=function(_0x170e26,_0x411bec){var _0x1a7cfc={},_0x4a5e83={},_0x406231={'count':0x0,'rows':[]};var _0xf98e7f=_[_0xa338('0x2a')](db['FaxTransferReport'][_0xa338('0x2b')],function(_0x399025){return{'name':_0x399025['fieldName'],'type':_0x399025[_0xa338('0x2c')]['key']};});_0x4a5e83[_0xa338('0x2d')]=_['map'](_0xf98e7f,'name');_0x4a5e83[_0xa338('0x2e')]=_[_0xa338('0x2f')](_0x170e26[_0xa338('0x2e')]);_0x4a5e83[_0xa338('0x30')]=_['intersection'](_0x4a5e83['model'],_0x4a5e83[_0xa338('0x2e')]);_0x1a7cfc[_0xa338('0x31')]=_[_0xa338('0x32')](_0x4a5e83[_0xa338('0x2d')],qs[_0xa338('0x33')](_0x170e26[_0xa338('0x2e')][_0xa338('0x33')]));_0x1a7cfc[_0xa338('0x31')]=_0x1a7cfc[_0xa338('0x31')][_0xa338('0x34')]?_0x1a7cfc[_0xa338('0x31')]:_0x4a5e83['model'];if(!_0x170e26[_0xa338('0x2e')][_0xa338('0x35')](_0xa338('0x36'))){_0x1a7cfc[_0xa338('0x1e')]=qs[_0xa338('0x1e')](_0x170e26[_0xa338('0x2e')][_0xa338('0x1e')]);_0x1a7cfc[_0xa338('0x1c')]=qs[_0xa338('0x1c')](_0x170e26[_0xa338('0x2e')][_0xa338('0x1c')]);}_0x1a7cfc['order']=qs[_0xa338('0x37')](_0x170e26[_0xa338('0x2e')][_0xa338('0x37')]);_0x1a7cfc[_0xa338('0x38')]=qs[_0xa338('0x30')](_['pick'](_0x170e26['query'],_0x4a5e83[_0xa338('0x30')]),_0xf98e7f);if(_0x170e26[_0xa338('0x2e')][_0xa338('0x39')]){_0x1a7cfc[_0xa338('0x38')]=_[_0xa338('0x3a')](_0x1a7cfc[_0xa338('0x38')],{'$or':_[_0xa338('0x2a')](_0xf98e7f,function(_0x39a12a){if(_0x39a12a[_0xa338('0x2c')]!==_0xa338('0x3b')){var _0x5dc022={};_0x5dc022[_0x39a12a[_0xa338('0x28')]]={'$like':'%'+_0x170e26[_0xa338('0x2e')][_0xa338('0x39')]+'%'};return _0x5dc022;}})});}_0x1a7cfc=_[_0xa338('0x3a')]({},_0x1a7cfc,_0x170e26[_0xa338('0x3c')]);var _0x3d0559={'where':_0x1a7cfc[_0xa338('0x38')]};return db[_0xa338('0x3d')][_0xa338('0x1f')](_0x3d0559)[_0xa338('0x26')](function(_0x5914d5){_0x406231[_0xa338('0x1f')]=_0x5914d5;if(_0x170e26['query'][_0xa338('0x3e')]){_0x1a7cfc[_0xa338('0x3f')]=[{'all':!![]}];}return db[_0xa338('0x3d')][_0xa338('0x40')](_0x1a7cfc);})['then'](function(_0xa3ac06){_0x406231[_0xa338('0x41')]=_0xa3ac06;return _0x406231;})['then'](respondWithFilteredResult(_0x411bec,_0x1a7cfc))['catch'](handleError(_0x411bec,null));};exports['show']=function(_0x35c3d6,_0xcb157e){var _0x406d0a={'raw':!![],'where':{'id':_0x35c3d6[_0xa338('0x42')]['id']}},_0x1084b7={};_0x1084b7[_0xa338('0x2d')]=_[_0xa338('0x2f')](db[_0xa338('0x3d')][_0xa338('0x2b')]);_0x1084b7['query']=_[_0xa338('0x2f')](_0x35c3d6['query']);_0x1084b7[_0xa338('0x30')]=_['intersection'](_0x1084b7['model'],_0x1084b7['query']);_0x406d0a[_0xa338('0x31')]=_[_0xa338('0x32')](_0x1084b7[_0xa338('0x2d')],qs[_0xa338('0x33')](_0x35c3d6['query']['fields']));_0x406d0a[_0xa338('0x31')]=_0x406d0a[_0xa338('0x31')]['length']?_0x406d0a[_0xa338('0x31')]:_0x1084b7[_0xa338('0x2d')];if(_0x35c3d6[_0xa338('0x2e')][_0xa338('0x3e')]){_0x406d0a[_0xa338('0x3f')]=[{'all':!![]}];}_0x406d0a=_[_0xa338('0x3a')]({},_0x406d0a,_0x35c3d6[_0xa338('0x3c')]);return db['FaxTransferReport'][_0xa338('0x43')](_0x406d0a)[_0xa338('0x26')](handleEntityNotFound(_0xcb157e,null))[_0xa338('0x26')](respondWithResult(_0xcb157e,null))['catch'](handleError(_0xcb157e,null));};exports[_0xa338('0x44')]=function(_0x4297cc,_0x15b085){return db['FaxTransferReport'][_0xa338('0x44')](_0x4297cc[_0xa338('0x45')],{})[_0xa338('0x26')](respondWithResult(_0x15b085,0xc9))[_0xa338('0x46')](handleError(_0x15b085,null));};exports[_0xa338('0x25')]=function(_0x3b89f0,_0x199216){if(_0x3b89f0[_0xa338('0x45')]['id']){delete _0x3b89f0['body']['id'];}return db[_0xa338('0x3d')][_0xa338('0x43')]({'where':{'id':_0x3b89f0[_0xa338('0x42')]['id']}})[_0xa338('0x26')](handleEntityNotFound(_0x199216,null))[_0xa338('0x26')](saveUpdates(_0x3b89f0[_0xa338('0x45')],null))['then'](respondWithResult(_0x199216,null))['catch'](handleError(_0x199216,null));};exports['destroy']=function(_0x2ba69b,_0x2f49cb){return db[_0xa338('0x3d')][_0xa338('0x43')]({'where':{'id':_0x2ba69b['params']['id']}})[_0xa338('0x26')](handleEntityNotFound(_0x2f49cb,null))['then'](removeEntity(_0x2f49cb,null))[_0xa338('0x46')](handleError(_0x2f49cb,null));};exports[_0xa338('0x47')]=function(_0x5a9068,_0x2068bb){return db[_0xa338('0x3d')][_0xa338('0x47')]()[_0xa338('0x26')](respondWithResult(_0x2068bb,null))[_0xa338('0x46')](handleError(_0x2068bb,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 4467d71..184b364 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 _0xbdd4=['request-promise','path','../../config/environment','./faxTransferReport.attributes','exports','uniqueid','../../config/logger','api'];(function(_0x1b60c1,_0x37078a){var _0x1e2e89=function(_0x15bf51){while(--_0x15bf51){_0x1b60c1['push'](_0x1b60c1['shift']());}};_0x1e2e89(++_0x37078a);}(_0xbdd4,0x14e));var _0x4bdd=function(_0x18cd5b,_0x10240b){_0x18cd5b=_0x18cd5b-0x0;var _0x5eaa52=_0xbdd4[_0x18cd5b];return _0x5eaa52;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4bdd('0x0'))(_0x4bdd('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4bdd('0x2'));var fs=require('fs');var path=require(_0x4bdd('0x3'));var rimraf=require('rimraf');var config=require(_0x4bdd('0x4'));var attributes=require(_0x4bdd('0x5'));module[_0x4bdd('0x6')]=function(_0x494b9d,_0x19a31a){return _0x494b9d['define']('FaxTransferReport',attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':_0x4bdd('0x7'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x4d96=['./faxTransferReport.attributes','exports','define','report_fax_transfer','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x4d96,0x89));var _0x64d9=function(_0x2f8484,_0x52cca5){_0x2f8484=_0x2f8484-0x0;var _0x46fc7e=_0x4d96[_0x2f8484];return _0x46fc7e;};'use strict';var _=require('lodash');var util=require(_0x64d9('0x0'));var logger=require(_0x64d9('0x1'))(_0x64d9('0x2'));var moment=require(_0x64d9('0x3'));var BPromise=require(_0x64d9('0x4'));var rp=require(_0x64d9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x64d9('0x6'));var attributes=require(_0x64d9('0x7'));module[_0x64d9('0x8')]=function(_0x3c360b,_0x2aeefc){return _0x3c360b[_0x64d9('0x9')]('FaxTransferReport',attributes,{'tableName':_0x64d9('0xa'),'paranoid':![],'indexes':[{'name':_0x64d9('0xb'),'fields':[_0x64d9('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index db2fb49..43f9d9d 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 _0x86d6=['debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x4e64c1,_0x304558){var _0x896ee9=function(_0x5c6f64){while(--_0x5c6f64){_0x4e64c1['push'](_0x4e64c1['shift']());}};_0x896ee9(++_0x304558);}(_0x86d6,0x18f));var _0x686d=function(_0x32d82f,_0x3ccfe6){_0x32d82f=_0x32d82f-0x0;var _0x534d45=_0x86d6[_0x32d82f];return _0x534d45;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x686d('0x0'));var BPromise=require(_0x686d('0x1'));var rs=require(_0x686d('0x2'));var fs=require('fs');var Redis=require(_0x686d('0x3'));var db=require(_0x686d('0x4'))['db'];var utils=require(_0x686d('0x5'));var logger=require(_0x686d('0x6'))(_0x686d('0x7'));var config=require(_0x686d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x686d('0x9')][_0x686d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x158a3b,_0x33cacb,_0x2a845f){return new BPromise(function(_0xc2001a,_0x180306){return client['request'](_0x158a3b,_0x2a845f)[_0x686d('0xb')](function(_0x21cd5e){logger[_0x686d('0xc')](_0x686d('0xd'),_0x33cacb,_0x686d('0xe'));logger[_0x686d('0xf')](_0x686d('0x10'),_0x33cacb,'request\x20sent',JSON[_0x686d('0x11')](_0x21cd5e));if(_0x21cd5e[_0x686d('0x12')]){if(_0x21cd5e['error'][_0x686d('0x13')]===0x1f4){logger[_0x686d('0x12')](_0x686d('0xd'),_0x33cacb,_0x21cd5e[_0x686d('0x12')]['message']);return _0x180306(_0x21cd5e['error'][_0x686d('0x14')]);}logger['error'](_0x686d('0xd'),_0x33cacb,_0x21cd5e[_0x686d('0x12')][_0x686d('0x14')]);return _0xc2001a(_0x21cd5e[_0x686d('0x12')][_0x686d('0x14')]);}else{logger[_0x686d('0xc')](_0x686d('0xd'),_0x33cacb,'request\x20sent');_0xc2001a(_0x21cd5e[_0x686d('0x15')]['message']);}})[_0x686d('0x16')](function(_0x2f5d42){logger[_0x686d('0x12')](_0x686d('0xd'),_0x33cacb,_0x2f5d42);_0x180306(_0x2f5d42);});});} \ No newline at end of file +var _0x28f4=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','FaxTransferReport,\x20%s,\x20%s','debug','request\x20sent','error','message','catch','lodash','util','ioredis','../../mysqldb'];(function(_0x583e98,_0x5534f5){var _0x84cc30=function(_0x4201ed){while(--_0x4201ed){_0x583e98['push'](_0x583e98['shift']());}};_0x84cc30(++_0x5534f5);}(_0x28f4,0x6e));var _0x428f=function(_0x576251,_0x41bd96){_0x576251=_0x576251-0x0;var _0x5d5c59=_0x28f4[_0x576251];return _0x5d5c59;};'use strict';var _=require(_0x428f('0x0'));var util=require(_0x428f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x428f('0x2'));var db=require(_0x428f('0x3'))['db'];var utils=require(_0x428f('0x4'));var logger=require(_0x428f('0x5'))(_0x428f('0x6'));var config=require(_0x428f('0x7'));var jayson=require(_0x428f('0x8'));var client=jayson[_0x428f('0x9')][_0x428f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x210762,_0x26b976,_0x2e97d1){return new BPromise(function(_0x2c0ee0,_0x4d84f8){return client[_0x428f('0xb')](_0x210762,_0x2e97d1)['then'](function(_0x366fe8){logger[_0x428f('0xc')](_0x428f('0xd'),_0x26b976,'request\x20sent');logger[_0x428f('0xe')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x26b976,_0x428f('0xf'),JSON['stringify'](_0x366fe8));if(_0x366fe8[_0x428f('0x10')]){if(_0x366fe8[_0x428f('0x10')]['code']===0x1f4){logger[_0x428f('0x10')](_0x428f('0xd'),_0x26b976,_0x366fe8[_0x428f('0x10')][_0x428f('0x11')]);return _0x4d84f8(_0x366fe8[_0x428f('0x10')][_0x428f('0x11')]);}logger[_0x428f('0x10')]('FaxTransferReport,\x20%s,\x20%s',_0x26b976,_0x366fe8[_0x428f('0x10')][_0x428f('0x11')]);return _0x2c0ee0(_0x366fe8['error']['message']);}else{logger['info'](_0x428f('0xd'),_0x26b976,_0x428f('0xf'));_0x2c0ee0(_0x366fe8['result'][_0x428f('0x11')]);}})[_0x428f('0x12')](function(_0x529f33){logger['error'](_0x428f('0xd'),_0x26b976,_0x529f33);_0x4d84f8(_0x529f33);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 2f16ac3..15f1c45 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 _0x38a1=['post','create','update','destroy','path','connect-timeout','Router','../../components/auth/service','./faxTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x5b3820,_0x51889c){var _0x442af8=function(_0x597ee1){while(--_0x597ee1){_0x5b3820['push'](_0x5b3820['shift']());}};_0x442af8(++_0x51889c);}(_0x38a1,0xd6));var _0x138a=function(_0x30bebd,_0x4986e5){_0x30bebd=_0x30bebd-0x0;var _0x532cbd=_0x38a1[_0x30bebd];return _0x532cbd;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x138a('0x0'));var timeout=require(_0x138a('0x1'));var express=require('express');var router=express[_0x138a('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x138a('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x138a('0x4'));router[_0x138a('0x5')]('/',auth[_0x138a('0x6')](),controller[_0x138a('0x7')]);router[_0x138a('0x5')](_0x138a('0x8'),auth[_0x138a('0x6')](),controller[_0x138a('0x9')]);router[_0x138a('0x5')](_0x138a('0xa'),auth[_0x138a('0x6')](),controller['show']);router[_0x138a('0xb')]('/',auth['isAuthenticated'](),controller[_0x138a('0xc')]);router['put']('/:id',auth[_0x138a('0x6')](),controller[_0x138a('0xd')]);router['delete'](_0x138a('0xa'),auth[_0x138a('0x6')](),controller[_0x138a('0xe')]);module['exports']=router; \ No newline at end of file +var _0x225d=['./faxTransferReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put','delete','exports','multer','util','express','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x225d,0x11a));var _0xd225=function(_0x3f114d,_0x59a0d0){_0x3f114d=_0x3f114d-0x0;var _0x202870=_0x225d[_0x3f114d];return _0x202870;};'use strict';var multer=require(_0xd225('0x0'));var util=require(_0xd225('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd225('0x2'));var router=express['Router']();var fs_extra=require(_0xd225('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xd225('0x4'));var config=require(_0xd225('0x5'));var controller=require(_0xd225('0x6'));router[_0xd225('0x7')]('/',auth[_0xd225('0x8')](),controller[_0xd225('0x9')]);router[_0xd225('0x7')]('/describe',auth['isAuthenticated'](),controller[_0xd225('0xa')]);router[_0xd225('0x7')](_0xd225('0xb'),auth[_0xd225('0x8')](),controller[_0xd225('0xc')]);router[_0xd225('0xd')]('/',auth['isAuthenticated'](),controller[_0xd225('0xe')]);router[_0xd225('0xf')](_0xd225('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xd225('0x10')](_0xd225('0xb'),auth[_0xd225('0x8')](),controller['destroy']);module[_0xd225('0x11')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 07f22fc..e90edef 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 _0x0195=['show','/:id/configurations','getConfigurations','get','/:id/fields','getFields','post','put','/:id','update','destroy','exports','multer','util','express','fs-extra','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0195,0x1c4));var _0x5019=function(_0x2fc738,_0x55724f){_0x2fc738=_0x2fc738-0x0;var _0x49ad46=_0x0195[_0x2fc738];return _0x49ad46;};'use strict';var multer=require(_0x5019('0x0'));var util=require(_0x5019('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5019('0x2'));var router=express['Router']();var fs_extra=require(_0x5019('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x5019('0x4'));var config=require(_0x5019('0x5'));var controller=require(_0x5019('0x6'));router['get']('/',auth[_0x5019('0x7')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x5019('0x8')]);router['get'](_0x5019('0x9'),auth[_0x5019('0x7')](),controller[_0x5019('0xa')]);router[_0x5019('0xb')](_0x5019('0xc'),auth[_0x5019('0x7')](),controller[_0x5019('0xd')]);router[_0x5019('0xe')]('/',auth[_0x5019('0x7')](),controller['create']);router['post'](_0x5019('0x9'),auth[_0x5019('0x7')](),controller['addConfiguration']);router[_0x5019('0xf')](_0x5019('0x10'),auth[_0x5019('0x7')](),controller[_0x5019('0x11')]);router['delete'](_0x5019('0x10'),auth[_0x5019('0x7')](),controller[_0x5019('0x12')]);module[_0x5019('0x13')]=router; \ No newline at end of file +var _0xb510=['util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','create','post','put','update','delete','destroy','exports','multer'];(function(_0x25b439,_0xb20872){var _0xbf2210=function(_0x518b01){while(--_0x518b01){_0x25b439['push'](_0x25b439['shift']());}};_0xbf2210(++_0xb20872);}(_0xb510,0x13a));var _0x0b51=function(_0x4cece5,_0x2c85ca){_0x4cece5=_0x4cece5-0x0;var _0x264271=_0xb510[_0x4cece5];return _0x264271;};'use strict';var multer=require(_0x0b51('0x0'));var util=require(_0x0b51('0x1'));var path=require('path');var timeout=require(_0x0b51('0x2'));var express=require(_0x0b51('0x3'));var router=express['Router']();var fs_extra=require(_0x0b51('0x4'));var auth=require(_0x0b51('0x5'));var interaction=require(_0x0b51('0x6'));var config=require('../../config/environment');var controller=require(_0x0b51('0x7'));router[_0x0b51('0x8')]('/',auth[_0x0b51('0x9')](),controller[_0x0b51('0xa')]);router['get'](_0x0b51('0xb'),auth[_0x0b51('0x9')](),controller['show']);router[_0x0b51('0x8')](_0x0b51('0xc'),auth[_0x0b51('0x9')](),controller[_0x0b51('0xd')]);router['get']('/:id/fields',auth[_0x0b51('0x9')](),controller['getFields']);router['post']('/',auth[_0x0b51('0x9')](),controller[_0x0b51('0xe')]);router[_0x0b51('0xf')](_0x0b51('0xc'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0x0b51('0x10')]('/:id',auth[_0x0b51('0x9')](),controller[_0x0b51('0x11')]);router[_0x0b51('0x12')](_0x0b51('0xb'),auth[_0x0b51('0x9')](),controller[_0x0b51('0x13')]);module[_0x0b51('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 058a06a..d3edc96 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 _0x75af=['integrationTab','sequelize','STRING','ENUM','basic','newTab'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x75af,0x1cf));var _0xf75a=function(_0x1974a5,_0x2779a9){_0x1974a5=_0x1974a5-0x0;var _0x7a90ed=_0x75af[_0x1974a5];return _0x7a90ed;};'use strict';var Sequelize=require(_0xf75a('0x0'));module['exports']={'name':{'type':Sequelize[_0xf75a('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xf75a('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize[_0xf75a('0x2')](_0xf75a('0x3')),'defaultValue':_0xf75a('0x3')},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize[_0xf75a('0x1')]},'consumerSecret':{'type':Sequelize[_0xf75a('0x1')]},'token':{'type':Sequelize[_0xf75a('0x1')]},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xf75a('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xf75a('0x2')]('integrationTab',_0xf75a('0x4')),'defaultValue':_0xf75a('0x5')}}; \ No newline at end of file +var _0x8353=['ENUM','basic','integrationTab','sequelize','exports','STRING'];(function(_0x710815,_0x520da8){var _0x5b3b89=function(_0x2e1a8e){while(--_0x2e1a8e){_0x710815['push'](_0x710815['shift']());}};_0x5b3b89(++_0x520da8);}(_0x8353,0x117));var _0x3835=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x8353[_0x21a9d9];return _0x46adce;};'use strict';var Sequelize=require(_0x3835('0x0'));module[_0x3835('0x1')]={'name':{'type':Sequelize[_0x3835('0x2')]},'description':{'type':Sequelize[_0x3835('0x2')]},'username':{'type':Sequelize[_0x3835('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize[_0x3835('0x3')](_0x3835('0x4')),'defaultValue':_0x3835('0x4')},'password':{'type':Sequelize[_0x3835('0x2')]},'consumerKey':{'type':Sequelize[_0x3835('0x2')]},'consumerSecret':{'type':Sequelize[_0x3835('0x2')]},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize[_0x3835('0x2')]},'serverUrl':{'type':Sequelize[_0x3835('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x3835('0x5'),'newTab'),'defaultValue':_0x3835('0x5')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index f5e8e53..238b952 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 _0x9633=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','status','end','json','undefined','offset','limit','set','reject','save','update','destroy','then','sendStatus','error','send','index','DeskAccount','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','name','options','count','includeAll','include','findAll','rows','show','find','catch','create','body','params','getConfigurations','findOne','keys','DeskConfiguration','length','addConfiguration','getSubjects','Descriptions','getDescriptions','channel','DeskField','getFields','priority','remoteUri','authType','username','password','consumerKey','consumerSecret','token','tokenSecret','slice','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','Authorization','Basic\x20%s','%s:%s','toString','concat','_embedded','entries','active','label','statusCode','test','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','ioredis'];(function(_0x571763,_0x209644){var _0x64b856=function(_0x1a6ea3){while(--_0x1a6ea3){_0x571763['push'](_0x571763['shift']());}};_0x64b856(++_0x209644);}(_0x9633,0x1b8));var _0x3963=function(_0x1649c9,_0x28f848){_0x1649c9=_0x1649c9-0x0;var _0x280cbb=_0x9633[_0x1649c9];return _0x280cbb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3963('0x0'));var zipdir=require(_0x3963('0x1'));var jsonpatch=require(_0x3963('0x2'));var rp=require(_0x3963('0x3'));var moment=require(_0x3963('0x4'));var BPromise=require(_0x3963('0x5'));var Mustache=require('mustache');var util=require(_0x3963('0x6'));var path=require(_0x3963('0x7'));var sox=require(_0x3963('0x8'));var csv=require(_0x3963('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3963('0xa'));var squel=require(_0x3963('0xb'));var crypto=require(_0x3963('0xc'));var jsforce=require(_0x3963('0xd'));var deskjs=require(_0x3963('0xe'));var toCsv=require(_0x3963('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3963('0xf'));var authService=require(_0x3963('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x3963('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3963('0x12'))(_0x3963('0x13'));var utils=require(_0x3963('0x14'));var config=require(_0x3963('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x3963('0x16'))['db'];var integrations=require(_0x3963('0x17'));function respondWithStatusCode(_0x4144c3,_0xa1cc56){_0xa1cc56=_0xa1cc56||0xcc;return function(_0x32d7e6){if(_0x32d7e6){return _0x4144c3['sendStatus'](_0xa1cc56);}return _0x4144c3[_0x3963('0x18')](_0xa1cc56)[_0x3963('0x19')]();};}function respondWithResult(_0x501e7d,_0x398e5e){_0x398e5e=_0x398e5e||0xc8;return function(_0xbe7167){if(_0xbe7167){return _0x501e7d[_0x3963('0x18')](_0x398e5e)[_0x3963('0x1a')](_0xbe7167);}};}function respondWithFilteredResult(_0x141c33,_0x16d4b6){return function(_0x23c4da){if(_0x23c4da){var _0x4d565a=typeof _0x16d4b6['offset']===_0x3963('0x1b')&&typeof _0x16d4b6['limit']==='undefined';var _0x497a1c=_0x23c4da['count'];var _0x6e9086=_0x4d565a?0x0:_0x16d4b6[_0x3963('0x1c')];var _0x38748b=_0x4d565a?_0x23c4da['count']:_0x16d4b6[_0x3963('0x1c')]+_0x16d4b6[_0x3963('0x1d')];var _0x378c61;if(_0x38748b>=_0x497a1c){_0x38748b=_0x497a1c;_0x378c61=0xc8;}else{_0x378c61=0xce;}_0x141c33[_0x3963('0x18')](_0x378c61);return _0x141c33[_0x3963('0x1e')]('Content-Range',_0x6e9086+'-'+_0x38748b+'/'+_0x497a1c)['json'](_0x23c4da);}return null;};}function patchUpdates(_0x26f60a){return function(_0x479d21){try{jsonpatch['apply'](_0x479d21,_0x26f60a,!![]);}catch(_0x2fc8a8){return BPromise[_0x3963('0x1f')](_0x2fc8a8);}return _0x479d21[_0x3963('0x20')]();};}function saveUpdates(_0x5235a2,_0x2d0da5){return function(_0x191774){if(_0x191774){return _0x191774[_0x3963('0x21')](_0x5235a2)['then'](function(_0x3ee50b){return _0x3ee50b;});}return null;};}function removeEntity(_0x33380e,_0x5cc37a){return function(_0x110a2e){if(_0x110a2e){return _0x110a2e[_0x3963('0x22')]()[_0x3963('0x23')](function(){_0x33380e[_0x3963('0x18')](0xcc)[_0x3963('0x19')]();});}};}function handleEntityNotFound(_0x39bf7b,_0x39e33b){return function(_0x1e7be4){if(!_0x1e7be4){_0x39bf7b[_0x3963('0x24')](0x194);}return _0x1e7be4;};}function handleError(_0x5ae363,_0x26e014){_0x26e014=_0x26e014||0x1f4;return function(_0x4d27af){logger[_0x3963('0x25')](_0x4d27af['stack']);if(_0x4d27af['name']){delete _0x4d27af['name'];}_0x5ae363[_0x3963('0x18')](_0x26e014)[_0x3963('0x26')](_0x4d27af);};}exports[_0x3963('0x27')]=function(_0x40816c,_0x216b53){var _0xe85dc3={},_0x675712={},_0x44a131={'count':0x0,'rows':[]};var _0x42ee6e=_['map'](db[_0x3963('0x28')][_0x3963('0x29')],function(_0x324c3a){return{'name':_0x324c3a[_0x3963('0x2a')],'type':_0x324c3a[_0x3963('0x2b')][_0x3963('0x2c')]};});_0x675712[_0x3963('0x2d')]=_[_0x3963('0x2e')](_0x42ee6e,'name');_0x675712['query']=_['keys'](_0x40816c[_0x3963('0x2f')]);_0x675712[_0x3963('0x30')]=_['intersection'](_0x675712[_0x3963('0x2d')],_0x675712[_0x3963('0x2f')]);_0xe85dc3[_0x3963('0x31')]=_[_0x3963('0x32')](_0x675712[_0x3963('0x2d')],qs[_0x3963('0x33')](_0x40816c[_0x3963('0x2f')][_0x3963('0x33')]));_0xe85dc3[_0x3963('0x31')]=_0xe85dc3['attributes']['length']?_0xe85dc3[_0x3963('0x31')]:_0x675712[_0x3963('0x2d')];if(!_0x40816c['query'][_0x3963('0x34')](_0x3963('0x35'))){_0xe85dc3[_0x3963('0x1d')]=qs[_0x3963('0x1d')](_0x40816c['query'][_0x3963('0x1d')]);_0xe85dc3[_0x3963('0x1c')]=qs[_0x3963('0x1c')](_0x40816c[_0x3963('0x2f')]['offset']);}_0xe85dc3[_0x3963('0x36')]=qs['sort'](_0x40816c[_0x3963('0x2f')][_0x3963('0x37')]);_0xe85dc3['where']=qs['filters'](_[_0x3963('0x38')](_0x40816c['query'],_0x675712[_0x3963('0x30')]),_0x42ee6e);if(_0x40816c['query'][_0x3963('0x39')]){_0xe85dc3[_0x3963('0x3a')]=_[_0x3963('0x3b')](_0xe85dc3[_0x3963('0x3a')],{'$or':_['map'](_0x42ee6e,function(_0x166a6f){if(_0x166a6f['type']!==_0x3963('0x3c')){var _0x4f4225={};_0x4f4225[_0x166a6f[_0x3963('0x3d')]]={'$like':'%'+_0x40816c[_0x3963('0x2f')][_0x3963('0x39')]+'%'};return _0x4f4225;}})});}_0xe85dc3=_[_0x3963('0x3b')]({},_0xe85dc3,_0x40816c[_0x3963('0x3e')]);var _0x169257={'where':_0xe85dc3[_0x3963('0x3a')]};return db[_0x3963('0x28')][_0x3963('0x3f')](_0x169257)['then'](function(_0x1ee5b0){_0x44a131['count']=_0x1ee5b0;if(_0x40816c[_0x3963('0x2f')][_0x3963('0x40')]){_0xe85dc3[_0x3963('0x41')]=[{'all':!![]}];}return db[_0x3963('0x28')][_0x3963('0x42')](_0xe85dc3);})[_0x3963('0x23')](function(_0x1f7d62){_0x44a131[_0x3963('0x43')]=_0x1f7d62;return _0x44a131;})['then'](respondWithFilteredResult(_0x216b53,_0xe85dc3))['catch'](handleError(_0x216b53,null));};exports[_0x3963('0x44')]=function(_0xe94ffd,_0x2688d5){var _0x13a8e7={'raw':![],'where':{'id':_0xe94ffd['params']['id']}},_0x47de3c={};_0x47de3c['model']=_['keys'](db[_0x3963('0x28')][_0x3963('0x29')]);_0x47de3c[_0x3963('0x2f')]=_['keys'](_0xe94ffd[_0x3963('0x2f')]);_0x47de3c[_0x3963('0x30')]=_[_0x3963('0x32')](_0x47de3c['model'],_0x47de3c[_0x3963('0x2f')]);_0x13a8e7[_0x3963('0x31')]=_[_0x3963('0x32')](_0x47de3c[_0x3963('0x2d')],qs[_0x3963('0x33')](_0xe94ffd[_0x3963('0x2f')]['fields']));_0x13a8e7[_0x3963('0x31')]=_0x13a8e7[_0x3963('0x31')]['length']?_0x13a8e7[_0x3963('0x31')]:_0x47de3c[_0x3963('0x2d')];if(_0xe94ffd[_0x3963('0x2f')][_0x3963('0x40')]){_0x13a8e7[_0x3963('0x41')]=[{'all':!![]}];}_0x13a8e7=_['merge']({},_0x13a8e7,_0xe94ffd['options']);return db[_0x3963('0x28')][_0x3963('0x45')](_0x13a8e7)[_0x3963('0x23')](handleEntityNotFound(_0x2688d5,null))[_0x3963('0x23')](respondWithResult(_0x2688d5,null))[_0x3963('0x46')](handleError(_0x2688d5,null));};exports[_0x3963('0x47')]=function(_0x18afd6,_0x1133e0){return db[_0x3963('0x28')][_0x3963('0x47')](_0x18afd6['body'],{})[_0x3963('0x23')](respondWithResult(_0x1133e0,0xc9))[_0x3963('0x46')](handleError(_0x1133e0,null));};exports[_0x3963('0x21')]=function(_0x310687,_0x53353a){if(_0x310687[_0x3963('0x48')]['id']){delete _0x310687[_0x3963('0x48')]['id'];}return db['DeskAccount'][_0x3963('0x45')]({'where':{'id':_0x310687[_0x3963('0x49')]['id']}})['then'](handleEntityNotFound(_0x53353a,null))[_0x3963('0x23')](saveUpdates(_0x310687[_0x3963('0x48')],null))[_0x3963('0x23')](respondWithResult(_0x53353a,null))[_0x3963('0x46')](handleError(_0x53353a,null));};exports[_0x3963('0x22')]=function(_0x3524c0,_0x539dc3){return db[_0x3963('0x28')][_0x3963('0x45')]({'where':{'id':_0x3524c0[_0x3963('0x49')]['id']}})[_0x3963('0x23')](handleEntityNotFound(_0x539dc3,null))[_0x3963('0x23')](removeEntity(_0x539dc3,null))['catch'](handleError(_0x539dc3,null));};exports[_0x3963('0x4a')]=function(_0xcf9f7,_0x506e9f,_0x2b6682){var _0xbd3aba={};var _0x1c5cc2={};var _0x462cb2;var _0x515871;return db[_0x3963('0x28')][_0x3963('0x4b')]({'where':{'id':_0xcf9f7['params']['id']}})[_0x3963('0x23')](handleEntityNotFound(_0x506e9f,null))[_0x3963('0x23')](function(_0x51cc8b){if(_0x51cc8b){_0x462cb2=_0x51cc8b;_0x1c5cc2[_0x3963('0x2d')]=_[_0x3963('0x4c')](db[_0x3963('0x4d')][_0x3963('0x29')]);_0x1c5cc2['query']=_[_0x3963('0x4c')](_0xcf9f7[_0x3963('0x2f')]);_0x1c5cc2[_0x3963('0x30')]=_['intersection'](_0x1c5cc2[_0x3963('0x2d')],_0x1c5cc2[_0x3963('0x2f')]);_0xbd3aba[_0x3963('0x31')]=_[_0x3963('0x32')](_0x1c5cc2[_0x3963('0x2d')],qs[_0x3963('0x33')](_0xcf9f7['query'][_0x3963('0x33')]));_0xbd3aba[_0x3963('0x31')]=_0xbd3aba[_0x3963('0x31')][_0x3963('0x4e')]?_0xbd3aba['attributes']:_0x1c5cc2['model'];_0xbd3aba[_0x3963('0x36')]=qs[_0x3963('0x37')](_0xcf9f7[_0x3963('0x2f')][_0x3963('0x37')]);_0xbd3aba[_0x3963('0x3a')]=qs[_0x3963('0x30')](_['pick'](_0xcf9f7[_0x3963('0x2f')],_0x1c5cc2[_0x3963('0x30')]));if(_0xcf9f7[_0x3963('0x2f')][_0x3963('0x39')]){_0xbd3aba['where']=_[_0x3963('0x3b')](_0xbd3aba[_0x3963('0x3a')],{'$or':_[_0x3963('0x2e')](_0xbd3aba[_0x3963('0x31')],function(_0x476b32){var _0x44dc35={};_0x44dc35[_0x476b32]={'$like':'%'+_0xcf9f7['query'][_0x3963('0x39')]+'%'};return _0x44dc35;})});}_0xbd3aba=_[_0x3963('0x3b')]({},_0xbd3aba,_0xcf9f7['options']);return _0x462cb2[_0x3963('0x4a')](_0xbd3aba);}})['then'](function(_0x4e2eda){if(_0x4e2eda){_0x515871=_0x4e2eda[_0x3963('0x4e')];if(!_0xcf9f7[_0x3963('0x2f')][_0x3963('0x34')]('nolimit')){_0xbd3aba['limit']=qs['limit'](_0xcf9f7['query'][_0x3963('0x1d')]);_0xbd3aba['offset']=qs[_0x3963('0x1c')](_0xcf9f7[_0x3963('0x2f')][_0x3963('0x1c')]);}return _0x462cb2[_0x3963('0x4a')](_0xbd3aba);}})['then'](function(_0x45445e){if(_0x45445e){return _0x45445e?{'count':_0x515871,'rows':_0x45445e}:null;}})[_0x3963('0x23')](respondWithResult(_0x506e9f,null))[_0x3963('0x46')](handleError(_0x506e9f,null));};exports[_0x3963('0x4f')]=function(_0x181c55,_0x52957e,_0x11b2c6){if(_0x181c55[_0x3963('0x48')]['id']){delete _0x181c55[_0x3963('0x48')]['id'];}return db['DeskAccount'][_0x3963('0x4b')]({'where':{'id':_0x181c55[_0x3963('0x49')]['id']}})[_0x3963('0x23')](handleEntityNotFound(_0x52957e,null))['then'](function(_0x53812b){if(_0x53812b){_0x181c55[_0x3963('0x48')]['AccountId']=_0x53812b['id'];_0x181c55[_0x3963('0x48')]['Subjects']=integrations[_0x3963('0x50')](_0x181c55[_0x3963('0x48')]['channel'],_0x181c55[_0x3963('0x48')][_0x3963('0x2b')]);_0x181c55['body'][_0x3963('0x51')]=integrations[_0x3963('0x52')](_0x181c55[_0x3963('0x48')][_0x3963('0x53')],_0x181c55[_0x3963('0x48')][_0x3963('0x2b')]);return db[_0x3963('0x4d')][_0x3963('0x47')](_0x181c55[_0x3963('0x48')],{'include':[{'model':db['DeskField'],'as':'Subjects'},{'model':db[_0x3963('0x54')],'as':_0x3963('0x51')}]});}return null;})[_0x3963('0x23')](respondWithResult(_0x52957e,null))[_0x3963('0x46')](handleError(_0x52957e,null));};exports[_0x3963('0x55')]=function(_0x457811,_0x4e4b76,_0x471010){var _0x37c29e=[{'name':_0x3963('0x56'),'label':_0x3963('0x56'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x2bc254='';return db[_0x3963('0x28')][_0x3963('0x4b')]({'where':{'id':_0x457811[_0x3963('0x49')]['id']},'attributes':['id',_0x3963('0x57'),_0x3963('0x58'),_0x3963('0x59'),_0x3963('0x5a'),_0x3963('0x5b'),_0x3963('0x5c'),_0x3963('0x5d'),_0x3963('0x5e')]})['then'](handleEntityNotFound(_0x4e4b76,null))[_0x3963('0x23')](function(_0x5a78e5){if(_0x5a78e5){_0x2bc254=_0x5a78e5[_0x3963('0x57')];var _0x24e045=_0x2bc254[_0x3963('0x5f')](-0x1);if(_0x24e045==='/'){_0x2bc254=_0x2bc254[_0x3963('0x60')](0x0,_0x2bc254[_0x3963('0x61')](_0x24e045));}var _0x5efa32={'method':_0x3963('0x62'),'uri':util[_0x3963('0x63')](_0x3963('0x64'),_0x2bc254),'headers':{'Content-Type':_0x3963('0x65'),'Accept':_0x3963('0x65')},'json':!![]};if(_0x5a78e5['authType']===_0x3963('0x66')){_0x5efa32['headers'][_0x3963('0x67')]=util[_0x3963('0x63')](_0x3963('0x68'),new Buffer(util[_0x3963('0x63')](_0x3963('0x69'),_0x5a78e5[_0x3963('0x59')],_0x5a78e5['password']))[_0x3963('0x6a')]('base64'));}return rp(_0x5efa32)['then'](function(_0x7c7762){return _0x37c29e[_0x3963('0x6b')](_[_0x3963('0x2e')](_0x7c7762[_0x3963('0x6c')][_0x3963('0x6d')],function(_0x1d1154){return{'id':_0x1d1154['name'],'name':_0x1d1154[_0x3963('0x3d')],'type':_0x1d1154[_0x3963('0x2b')],'active':_0x1d1154[_0x3963('0x6e')],'label':_0x1d1154[_0x3963('0x6f')],'custom':!![]};}));});}})[_0x3963('0x23')](function(_0x42b960){return{'count':_0x42b960['length'],'rows':_0x42b960};})[_0x3963('0x23')](respondWithResult(_0x4e4b76,null))[_0x3963('0x46')](function(_0x542c6b){var _0x56ca95=_0x457811[_0x3963('0x2f')]['test']?0x1f4:_0x542c6b[_0x3963('0x70')]||0x1f4;logger[_0x3963('0x25')]('getFields,\x20%s,\x20%s,\x20%s',_0x3963('0x55'),_0x56ca95,JSON['stringify'](_0x542c6b));delete _0x542c6b[_0x3963('0x3d')];if(_0x56ca95===0x191){_0x56ca95=0x190;}_0x4e4b76['status'](_0x56ca95)[_0x3963('0x26')](_0x457811[_0x3963('0x2f')][_0x3963('0x71')]?{'message':'Wrong\x20credentials','statusCode':_0x542c6b[_0x3963('0x70')]}:_0x542c6b);});}; \ No newline at end of file +var _0x9e52=['type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','getConfigurations','findOne','DeskConfiguration','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','DeskField','Descriptions','getFields','priority','remoteUri','authType','password','consumerSecret','token','tokenSecret','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','headers','Authorization','Basic\x20%s','%s:%s','username','toString','base64','concat','_embedded','entries','label','test','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','undefined','offset','set','apply','reject','save','update','then','error','stack','name','map','DeskAccount','rawAttributes','fieldName'];(function(_0x20a558,_0x160e0e){var _0x53d3f7=function(_0x259bd8){while(--_0x259bd8){_0x20a558['push'](_0x20a558['shift']());}};_0x53d3f7(++_0x160e0e);}(_0x9e52,0xc1));var _0x29e5=function(_0x38e2b8,_0xd2968e){_0x38e2b8=_0x38e2b8-0x0;var _0x227ef0=_0x9e52[_0x38e2b8];return _0x227ef0;};'use strict';var emlformat=require(_0x29e5('0x0'));var rimraf=require(_0x29e5('0x1'));var zipdir=require(_0x29e5('0x2'));var jsonpatch=require(_0x29e5('0x3'));var rp=require(_0x29e5('0x4'));var moment=require(_0x29e5('0x5'));var BPromise=require(_0x29e5('0x6'));var Mustache=require(_0x29e5('0x7'));var util=require('util');var path=require('path');var sox=require(_0x29e5('0x8'));var csv=require(_0x29e5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x29e5('0xa'));var _=require(_0x29e5('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x29e5('0xc'));var deskjs=require(_0x29e5('0xd'));var toCsv=require('to-csv');var querystring=require(_0x29e5('0xe'));var Papa=require('papaparse');var Redis=require(_0x29e5('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x29e5('0x10'));var hardwareService=require(_0x29e5('0x11'));var logger=require(_0x29e5('0x12'))(_0x29e5('0x13'));var utils=require(_0x29e5('0x14'));var config=require(_0x29e5('0x15'));var licenseUtil=require(_0x29e5('0x16'));var db=require(_0x29e5('0x17'))['db'];var integrations=require(_0x29e5('0x18'));function respondWithStatusCode(_0x22059c,_0x313e42){_0x313e42=_0x313e42||0xcc;return function(_0x499ca9){if(_0x499ca9){return _0x22059c[_0x29e5('0x19')](_0x313e42);}return _0x22059c[_0x29e5('0x1a')](_0x313e42)['end']();};}function respondWithResult(_0x43ea2e,_0x5abd68){_0x5abd68=_0x5abd68||0xc8;return function(_0x53c374){if(_0x53c374){return _0x43ea2e['status'](_0x5abd68)[_0x29e5('0x1b')](_0x53c374);}};}function respondWithFilteredResult(_0x581243,_0x2fabfe){return function(_0xe63d16){if(_0xe63d16){var _0x4c67fb=typeof _0x2fabfe['offset']===_0x29e5('0x1c')&&typeof _0x2fabfe['limit']===_0x29e5('0x1c');var _0x4e3208=_0xe63d16['count'];var _0x5b7687=_0x4c67fb?0x0:_0x2fabfe['offset'];var _0x514e0f=_0x4c67fb?_0xe63d16['count']:_0x2fabfe[_0x29e5('0x1d')]+_0x2fabfe['limit'];var _0x4e965b;if(_0x514e0f>=_0x4e3208){_0x514e0f=_0x4e3208;_0x4e965b=0xc8;}else{_0x4e965b=0xce;}_0x581243['status'](_0x4e965b);return _0x581243[_0x29e5('0x1e')]('Content-Range',_0x5b7687+'-'+_0x514e0f+'/'+_0x4e3208)[_0x29e5('0x1b')](_0xe63d16);}return null;};}function patchUpdates(_0x2c8341){return function(_0x2272ec){try{jsonpatch[_0x29e5('0x1f')](_0x2272ec,_0x2c8341,!![]);}catch(_0x532d07){return BPromise[_0x29e5('0x20')](_0x532d07);}return _0x2272ec[_0x29e5('0x21')]();};}function saveUpdates(_0x5b058c,_0x1b13e4){return function(_0x53a902){if(_0x53a902){return _0x53a902[_0x29e5('0x22')](_0x5b058c)[_0x29e5('0x23')](function(_0xd4032b){return _0xd4032b;});}return null;};}function removeEntity(_0x175eff,_0x5375e9){return function(_0x369308){if(_0x369308){return _0x369308['destroy']()['then'](function(){_0x175eff[_0x29e5('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b74cc,_0x320150){return function(_0x14f9e2){if(!_0x14f9e2){_0x5b74cc['sendStatus'](0x194);}return _0x14f9e2;};}function handleError(_0x1a87bc,_0x25c8fe){_0x25c8fe=_0x25c8fe||0x1f4;return function(_0x4ac8a5){logger[_0x29e5('0x24')](_0x4ac8a5[_0x29e5('0x25')]);if(_0x4ac8a5[_0x29e5('0x26')]){delete _0x4ac8a5[_0x29e5('0x26')];}_0x1a87bc[_0x29e5('0x1a')](_0x25c8fe)['send'](_0x4ac8a5);};}exports['index']=function(_0x4748c3,_0xec605){var _0xdf608a={},_0x7119b4={},_0x580c95={'count':0x0,'rows':[]};var _0x29b2e8=_[_0x29e5('0x27')](db[_0x29e5('0x28')][_0x29e5('0x29')],function(_0x202861){return{'name':_0x202861[_0x29e5('0x2a')],'type':_0x202861[_0x29e5('0x2b')][_0x29e5('0x2c')]};});_0x7119b4[_0x29e5('0x2d')]=_[_0x29e5('0x27')](_0x29b2e8,_0x29e5('0x26'));_0x7119b4[_0x29e5('0x2e')]=_[_0x29e5('0x2f')](_0x4748c3[_0x29e5('0x2e')]);_0x7119b4[_0x29e5('0x30')]=_['intersection'](_0x7119b4[_0x29e5('0x2d')],_0x7119b4['query']);_0xdf608a['attributes']=_[_0x29e5('0x31')](_0x7119b4[_0x29e5('0x2d')],qs[_0x29e5('0x32')](_0x4748c3['query']['fields']));_0xdf608a[_0x29e5('0x33')]=_0xdf608a['attributes'][_0x29e5('0x34')]?_0xdf608a[_0x29e5('0x33')]:_0x7119b4['model'];if(!_0x4748c3['query'][_0x29e5('0x35')](_0x29e5('0x36'))){_0xdf608a[_0x29e5('0x37')]=qs[_0x29e5('0x37')](_0x4748c3[_0x29e5('0x2e')][_0x29e5('0x37')]);_0xdf608a['offset']=qs[_0x29e5('0x1d')](_0x4748c3[_0x29e5('0x2e')][_0x29e5('0x1d')]);}_0xdf608a[_0x29e5('0x38')]=qs[_0x29e5('0x39')](_0x4748c3[_0x29e5('0x2e')]['sort']);_0xdf608a[_0x29e5('0x3a')]=qs[_0x29e5('0x30')](_['pick'](_0x4748c3[_0x29e5('0x2e')],_0x7119b4[_0x29e5('0x30')]),_0x29b2e8);if(_0x4748c3[_0x29e5('0x2e')][_0x29e5('0x3b')]){_0xdf608a['where']=_[_0x29e5('0x3c')](_0xdf608a[_0x29e5('0x3a')],{'$or':_[_0x29e5('0x27')](_0x29b2e8,function(_0x4e4daa){if(_0x4e4daa[_0x29e5('0x2b')]!==_0x29e5('0x3d')){var _0x2b30c2={};_0x2b30c2[_0x4e4daa[_0x29e5('0x26')]]={'$like':'%'+_0x4748c3[_0x29e5('0x2e')][_0x29e5('0x3b')]+'%'};return _0x2b30c2;}})});}_0xdf608a=_[_0x29e5('0x3c')]({},_0xdf608a,_0x4748c3[_0x29e5('0x3e')]);var _0x9b29e5={'where':_0xdf608a[_0x29e5('0x3a')]};return db[_0x29e5('0x28')][_0x29e5('0x3f')](_0x9b29e5)[_0x29e5('0x23')](function(_0x157979){_0x580c95[_0x29e5('0x3f')]=_0x157979;if(_0x4748c3[_0x29e5('0x2e')][_0x29e5('0x40')]){_0xdf608a[_0x29e5('0x41')]=[{'all':!![]}];}return db[_0x29e5('0x28')][_0x29e5('0x42')](_0xdf608a);})[_0x29e5('0x23')](function(_0x4d5e8b){_0x580c95[_0x29e5('0x43')]=_0x4d5e8b;return _0x580c95;})[_0x29e5('0x23')](respondWithFilteredResult(_0xec605,_0xdf608a))[_0x29e5('0x44')](handleError(_0xec605,null));};exports[_0x29e5('0x45')]=function(_0x14e40a,_0x59f60c){var _0x15a1ac={'raw':![],'where':{'id':_0x14e40a[_0x29e5('0x46')]['id']}},_0x14a0d3={};_0x14a0d3['model']=_[_0x29e5('0x2f')](db[_0x29e5('0x28')][_0x29e5('0x29')]);_0x14a0d3['query']=_[_0x29e5('0x2f')](_0x14e40a[_0x29e5('0x2e')]);_0x14a0d3['filters']=_[_0x29e5('0x31')](_0x14a0d3[_0x29e5('0x2d')],_0x14a0d3['query']);_0x15a1ac[_0x29e5('0x33')]=_[_0x29e5('0x31')](_0x14a0d3[_0x29e5('0x2d')],qs['fields'](_0x14e40a['query'][_0x29e5('0x32')]));_0x15a1ac[_0x29e5('0x33')]=_0x15a1ac[_0x29e5('0x33')][_0x29e5('0x34')]?_0x15a1ac['attributes']:_0x14a0d3[_0x29e5('0x2d')];if(_0x14e40a[_0x29e5('0x2e')][_0x29e5('0x40')]){_0x15a1ac['include']=[{'all':!![]}];}_0x15a1ac=_['merge']({},_0x15a1ac,_0x14e40a[_0x29e5('0x3e')]);return db['DeskAccount'][_0x29e5('0x47')](_0x15a1ac)[_0x29e5('0x23')](handleEntityNotFound(_0x59f60c,null))[_0x29e5('0x23')](respondWithResult(_0x59f60c,null))[_0x29e5('0x44')](handleError(_0x59f60c,null));};exports[_0x29e5('0x48')]=function(_0x4fa050,_0x5d8b63){return db[_0x29e5('0x28')][_0x29e5('0x48')](_0x4fa050[_0x29e5('0x49')],{})[_0x29e5('0x23')](respondWithResult(_0x5d8b63,0xc9))[_0x29e5('0x44')](handleError(_0x5d8b63,null));};exports[_0x29e5('0x22')]=function(_0x1c4856,_0x5763a4){if(_0x1c4856[_0x29e5('0x49')]['id']){delete _0x1c4856[_0x29e5('0x49')]['id'];}return db[_0x29e5('0x28')]['find']({'where':{'id':_0x1c4856[_0x29e5('0x46')]['id']}})[_0x29e5('0x23')](handleEntityNotFound(_0x5763a4,null))['then'](saveUpdates(_0x1c4856[_0x29e5('0x49')],null))[_0x29e5('0x23')](respondWithResult(_0x5763a4,null))[_0x29e5('0x44')](handleError(_0x5763a4,null));};exports[_0x29e5('0x4a')]=function(_0x3544ef,_0x59025d){return db['DeskAccount'][_0x29e5('0x47')]({'where':{'id':_0x3544ef[_0x29e5('0x46')]['id']}})[_0x29e5('0x23')](handleEntityNotFound(_0x59025d,null))[_0x29e5('0x23')](removeEntity(_0x59025d,null))['catch'](handleError(_0x59025d,null));};exports[_0x29e5('0x4b')]=function(_0x5b10a8,_0x50da80,_0x434dad){var _0x35e03d={};var _0x24aec3={};var _0x4fe8ca;var _0x3aa978;return db['DeskAccount'][_0x29e5('0x4c')]({'where':{'id':_0x5b10a8['params']['id']}})[_0x29e5('0x23')](handleEntityNotFound(_0x50da80,null))[_0x29e5('0x23')](function(_0x2f0bb5){if(_0x2f0bb5){_0x4fe8ca=_0x2f0bb5;_0x24aec3[_0x29e5('0x2d')]=_['keys'](db[_0x29e5('0x4d')]['rawAttributes']);_0x24aec3['query']=_['keys'](_0x5b10a8[_0x29e5('0x2e')]);_0x24aec3[_0x29e5('0x30')]=_[_0x29e5('0x31')](_0x24aec3[_0x29e5('0x2d')],_0x24aec3[_0x29e5('0x2e')]);_0x35e03d[_0x29e5('0x33')]=_[_0x29e5('0x31')](_0x24aec3['model'],qs[_0x29e5('0x32')](_0x5b10a8[_0x29e5('0x2e')]['fields']));_0x35e03d[_0x29e5('0x33')]=_0x35e03d['attributes'][_0x29e5('0x34')]?_0x35e03d['attributes']:_0x24aec3[_0x29e5('0x2d')];_0x35e03d[_0x29e5('0x38')]=qs[_0x29e5('0x39')](_0x5b10a8[_0x29e5('0x2e')][_0x29e5('0x39')]);_0x35e03d[_0x29e5('0x3a')]=qs[_0x29e5('0x30')](_[_0x29e5('0x4e')](_0x5b10a8['query'],_0x24aec3[_0x29e5('0x30')]));if(_0x5b10a8['query'][_0x29e5('0x3b')]){_0x35e03d['where']=_[_0x29e5('0x3c')](_0x35e03d[_0x29e5('0x3a')],{'$or':_[_0x29e5('0x27')](_0x35e03d[_0x29e5('0x33')],function(_0x41b5ab){var _0xc02598={};_0xc02598[_0x41b5ab]={'$like':'%'+_0x5b10a8['query'][_0x29e5('0x3b')]+'%'};return _0xc02598;})});}_0x35e03d=_[_0x29e5('0x3c')]({},_0x35e03d,_0x5b10a8['options']);return _0x4fe8ca[_0x29e5('0x4b')](_0x35e03d);}})['then'](function(_0x2069d8){if(_0x2069d8){_0x3aa978=_0x2069d8[_0x29e5('0x34')];if(!_0x5b10a8['query']['hasOwnProperty'](_0x29e5('0x36'))){_0x35e03d[_0x29e5('0x37')]=qs[_0x29e5('0x37')](_0x5b10a8['query'][_0x29e5('0x37')]);_0x35e03d[_0x29e5('0x1d')]=qs[_0x29e5('0x1d')](_0x5b10a8[_0x29e5('0x2e')][_0x29e5('0x1d')]);}return _0x4fe8ca[_0x29e5('0x4b')](_0x35e03d);}})['then'](function(_0x3a60ce){if(_0x3a60ce){return _0x3a60ce?{'count':_0x3aa978,'rows':_0x3a60ce}:null;}})[_0x29e5('0x23')](respondWithResult(_0x50da80,null))[_0x29e5('0x44')](handleError(_0x50da80,null));};exports[_0x29e5('0x4f')]=function(_0x432065,_0x2cda40,_0xc676a4){if(_0x432065[_0x29e5('0x49')]['id']){delete _0x432065[_0x29e5('0x49')]['id'];}return db[_0x29e5('0x28')]['findOne']({'where':{'id':_0x432065[_0x29e5('0x46')]['id']}})[_0x29e5('0x23')](handleEntityNotFound(_0x2cda40,null))[_0x29e5('0x23')](function(_0x40b471){if(_0x40b471){_0x432065[_0x29e5('0x49')][_0x29e5('0x50')]=_0x40b471['id'];_0x432065[_0x29e5('0x49')][_0x29e5('0x51')]=integrations[_0x29e5('0x52')](_0x432065[_0x29e5('0x49')][_0x29e5('0x53')],_0x432065['body']['type']);_0x432065[_0x29e5('0x49')]['Descriptions']=integrations[_0x29e5('0x54')](_0x432065['body'][_0x29e5('0x53')],_0x432065['body'][_0x29e5('0x2b')]);return db[_0x29e5('0x4d')]['create'](_0x432065[_0x29e5('0x49')],{'include':[{'model':db[_0x29e5('0x55')],'as':_0x29e5('0x51')},{'model':db[_0x29e5('0x55')],'as':_0x29e5('0x56')}]});}return null;})['then'](respondWithResult(_0x2cda40,null))['catch'](handleError(_0x2cda40,null));};exports[_0x29e5('0x57')]=function(_0x760e1a,_0x38c879,_0x376aa1){var _0x1f3ac1=[{'name':_0x29e5('0x58'),'label':_0x29e5('0x58'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0xb6f6a8='';return db['DeskAccount'][_0x29e5('0x4c')]({'where':{'id':_0x760e1a[_0x29e5('0x46')]['id']},'attributes':['id',_0x29e5('0x59'),_0x29e5('0x5a'),'username',_0x29e5('0x5b'),'consumerKey',_0x29e5('0x5c'),_0x29e5('0x5d'),_0x29e5('0x5e')]})[_0x29e5('0x23')](handleEntityNotFound(_0x38c879,null))['then'](function(_0x419981){if(_0x419981){_0xb6f6a8=_0x419981[_0x29e5('0x59')];var _0x1ffea7=_0xb6f6a8['slice'](-0x1);if(_0x1ffea7==='/'){_0xb6f6a8=_0xb6f6a8[_0x29e5('0x5f')](0x0,_0xb6f6a8[_0x29e5('0x60')](_0x1ffea7));}var _0x51fe13={'method':_0x29e5('0x61'),'uri':util[_0x29e5('0x62')](_0x29e5('0x63'),_0xb6f6a8),'headers':{'Content-Type':'application/json','Accept':_0x29e5('0x64')},'json':!![]};if(_0x419981['authType']==='basic'){_0x51fe13[_0x29e5('0x65')][_0x29e5('0x66')]=util[_0x29e5('0x62')](_0x29e5('0x67'),new Buffer(util[_0x29e5('0x62')](_0x29e5('0x68'),_0x419981[_0x29e5('0x69')],_0x419981[_0x29e5('0x5b')]))[_0x29e5('0x6a')](_0x29e5('0x6b')));}return rp(_0x51fe13)[_0x29e5('0x23')](function(_0x159d16){return _0x1f3ac1[_0x29e5('0x6c')](_[_0x29e5('0x27')](_0x159d16[_0x29e5('0x6d')][_0x29e5('0x6e')],function(_0x23da60){return{'id':_0x23da60[_0x29e5('0x26')],'name':_0x23da60[_0x29e5('0x26')],'type':_0x23da60['type'],'active':_0x23da60['active'],'label':_0x23da60[_0x29e5('0x6f')],'custom':!![]};}));});}})[_0x29e5('0x23')](function(_0x3c12c6){return{'count':_0x3c12c6[_0x29e5('0x34')],'rows':_0x3c12c6};})[_0x29e5('0x23')](respondWithResult(_0x38c879,null))[_0x29e5('0x44')](function(_0x224c1c){var _0xb6d152=_0x760e1a[_0x29e5('0x2e')][_0x29e5('0x70')]?0x1f4:_0x224c1c['statusCode']||0x1f4;logger[_0x29e5('0x24')](_0x29e5('0x71'),_0x29e5('0x57'),_0xb6d152,JSON[_0x29e5('0x72')](_0x224c1c));delete _0x224c1c[_0x29e5('0x26')];if(_0xb6d152===0x191){_0xb6d152=0x190;}_0x38c879[_0x29e5('0x1a')](_0xb6d152)[_0x29e5('0x73')](_0x760e1a[_0x29e5('0x2e')][_0x29e5('0x70')]?{'message':_0x29e5('0x74'),'statusCode':_0x224c1c[_0x29e5('0x75')]}:_0x224c1c);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 07259ad..6c929e3 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 _0x9c9f=['../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','define','DeskAccount','int_desk_accounts','lodash','util','../../config/logger','moment','bluebird','path','rimraf'];(function(_0x3692c9,_0x1e1ca9){var _0x311c74=function(_0x5b0834){while(--_0x5b0834){_0x3692c9['push'](_0x3692c9['shift']());}};_0x311c74(++_0x1e1ca9);}(_0x9c9f,0xbc));var _0xf9c9=function(_0x3d203e,_0x2c2a26){_0x3d203e=_0x3d203e-0x0;var _0x154e60=_0x9c9f[_0x3d203e];return _0x154e60;};'use strict';var _=require(_0xf9c9('0x0'));var util=require(_0xf9c9('0x1'));var logger=require(_0xf9c9('0x2'))('api');var moment=require(_0xf9c9('0x3'));var BPromise=require(_0xf9c9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf9c9('0x5'));var rimraf=require(_0xf9c9('0x6'));var config=require(_0xf9c9('0x7'));var attributes=require(_0xf9c9('0x8'));var integrations=require(_0xf9c9('0x9'));module['exports']=function(_0x39bdd1,_0x57f9f9){return _0x39bdd1[_0xf9c9('0xa')](_0xf9c9('0xb'),attributes,{'tableName':_0xf9c9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2465=['./intDeskAccount.attributes','exports','DeskAccount','int_desk_accounts','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x51b87e,_0x50a6e6){var _0x3f030c=function(_0x305609){while(--_0x305609){_0x51b87e['push'](_0x51b87e['shift']());}};_0x3f030c(++_0x50a6e6);}(_0x2465,0xdc));var _0x5246=function(_0xe9fe84,_0x98db76){_0xe9fe84=_0xe9fe84-0x0;var _0x23ccf4=_0x2465[_0xe9fe84];return _0x23ccf4;};'use strict';var _=require(_0x5246('0x0'));var util=require('util');var logger=require(_0x5246('0x1'))(_0x5246('0x2'));var moment=require(_0x5246('0x3'));var BPromise=require(_0x5246('0x4'));var rp=require(_0x5246('0x5'));var fs=require('fs');var path=require(_0x5246('0x6'));var rimraf=require('rimraf');var config=require(_0x5246('0x7'));var attributes=require(_0x5246('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x5246('0x9')]=function(_0x3ba7aa,_0x31e06c){return _0x3ba7aa['define'](_0x5246('0xa'),attributes,{'tableName':_0x5246('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 4d07321..ce7b3c4 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 _0xcc3b=['DeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','GetDeskAccount','DeskAccount','options','raw','where','include','map','model','attributes','catch','ShowDeskAccount','find','util','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','DeskAccount,\x20%s,\x20%s','debug'];(function(_0x1aee46,_0x35a25f){var _0xf2be12=function(_0x37f364){while(--_0x37f364){_0x1aee46['push'](_0x1aee46['shift']());}};_0xf2be12(++_0x35a25f);}(_0xcc3b,0xd3));var _0xbcc3=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xcc3b[_0x465a0c];return _0x1e202e;};'use strict';var _=require('lodash');var util=require(_0xbcc3('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbcc3('0x1'));var fs=require('fs');var Redis=require(_0xbcc3('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbcc3('0x3'))(_0xbcc3('0x4'));var config=require(_0xbcc3('0x5'));var jayson=require(_0xbcc3('0x6'));var client=jayson[_0xbcc3('0x7')][_0xbcc3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x121591,_0x122fa7,_0x4e5e12){return new BPromise(function(_0x15104c,_0x2bd207){return client[_0xbcc3('0x9')](_0x121591,_0x4e5e12)[_0xbcc3('0xa')](function(_0x509618){logger['info'](_0xbcc3('0xb'),_0x122fa7,'request\x20sent');logger[_0xbcc3('0xc')](_0xbcc3('0xd'),_0x122fa7,_0xbcc3('0xe'),JSON[_0xbcc3('0xf')](_0x509618));if(_0x509618[_0xbcc3('0x10')]){if(_0x509618[_0xbcc3('0x10')][_0xbcc3('0x11')]===0x1f4){logger[_0xbcc3('0x10')](_0xbcc3('0xb'),_0x122fa7,_0x509618['error']['message']);return _0x2bd207(_0x509618[_0xbcc3('0x10')][_0xbcc3('0x12')]);}logger[_0xbcc3('0x10')](_0xbcc3('0xb'),_0x122fa7,_0x509618[_0xbcc3('0x10')][_0xbcc3('0x12')]);return _0x15104c(_0x509618['error'][_0xbcc3('0x12')]);}else{logger[_0xbcc3('0x13')]('DeskAccount,\x20%s,\x20%s',_0x122fa7,'request\x20sent');_0x15104c(_0x509618['result'][_0xbcc3('0x12')]);}})['catch'](function(_0x48147f){logger[_0xbcc3('0x10')]('DeskAccount,\x20%s,\x20%s',_0x122fa7,_0x48147f);_0x2bd207(_0x48147f);});});}exports[_0xbcc3('0x14')]=function(_0x4b900d){var _0xce01a9=this;return new Promise(function(_0x3aac35,_0x1fcf70){return db[_0xbcc3('0x15')]['findAll']({'raw':_0x4b900d[_0xbcc3('0x16')]?_0x4b900d[_0xbcc3('0x16')][_0xbcc3('0x17')]===undefined?!![]:![]:!![],'where':_0x4b900d[_0xbcc3('0x16')]?_0x4b900d[_0xbcc3('0x16')][_0xbcc3('0x18')]||null:null,'attributes':_0x4b900d[_0xbcc3('0x16')]?_0x4b900d[_0xbcc3('0x16')]['attributes']||null:null,'limit':_0x4b900d[_0xbcc3('0x16')]?_0x4b900d[_0xbcc3('0x16')]['limit']||null:null,'include':_0x4b900d[_0xbcc3('0x16')]?_0x4b900d[_0xbcc3('0x16')][_0xbcc3('0x19')]?_[_0xbcc3('0x1a')](_0x4b900d[_0xbcc3('0x16')][_0xbcc3('0x19')],function(_0x5d86ee){return{'model':db[_0x5d86ee[_0xbcc3('0x1b')]],'as':_0x5d86ee['as'],'attributes':_0x5d86ee[_0xbcc3('0x1c')],'include':_0x5d86ee[_0xbcc3('0x19')]?_[_0xbcc3('0x1a')](_0x5d86ee[_0xbcc3('0x19')],function(_0x16f10e){return{'model':db[_0x16f10e[_0xbcc3('0x1b')]],'as':_0x16f10e['as'],'attributes':_0x16f10e[_0xbcc3('0x1c')],'include':_0x16f10e[_0xbcc3('0x19')]?_[_0xbcc3('0x1a')](_0x16f10e[_0xbcc3('0x19')],function(_0x857e48){return{'model':db[_0x857e48['model']],'as':_0x857e48['as'],'attributes':_0x857e48[_0xbcc3('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x523173){logger[_0xbcc3('0x13')]('GetDeskAccount',_0x4b900d);logger[_0xbcc3('0xc')](_0xbcc3('0x14'),_0x4b900d,JSON[_0xbcc3('0xf')](_0x523173));_0x3aac35(_0x523173);})[_0xbcc3('0x1d')](function(_0x2138b6){logger[_0xbcc3('0x10')](_0xbcc3('0x14'),_0x2138b6['message'],_0x4b900d);_0x1fcf70(_0xce01a9[_0xbcc3('0x10')](0x1f4,_0x2138b6[_0xbcc3('0x12')]));});});};exports[_0xbcc3('0x1e')]=function(_0x24c56d){var _0x172463=this;return new Promise(function(_0x5ee7f7,_0x29d0e1){return db[_0xbcc3('0x15')][_0xbcc3('0x1f')]({'raw':_0x24c56d[_0xbcc3('0x16')]?_0x24c56d[_0xbcc3('0x16')][_0xbcc3('0x17')]===undefined?!![]:![]:!![],'where':_0x24c56d[_0xbcc3('0x16')]?_0x24c56d[_0xbcc3('0x16')][_0xbcc3('0x18')]||null:null,'attributes':_0x24c56d[_0xbcc3('0x16')]?_0x24c56d['options'][_0xbcc3('0x1c')]||null:null,'include':_0x24c56d[_0xbcc3('0x16')]?_0x24c56d[_0xbcc3('0x16')][_0xbcc3('0x19')]?_[_0xbcc3('0x1a')](_0x24c56d[_0xbcc3('0x16')][_0xbcc3('0x19')],function(_0x5f4724){return{'model':db[_0x5f4724[_0xbcc3('0x1b')]],'as':_0x5f4724['as'],'attributes':_0x5f4724[_0xbcc3('0x1c')],'include':_0x5f4724[_0xbcc3('0x19')]?_['map'](_0x5f4724[_0xbcc3('0x19')],function(_0x1e1fea){return{'model':db[_0x1e1fea['model']],'as':_0x1e1fea['as'],'attributes':_0x1e1fea[_0xbcc3('0x1c')],'include':_0x1e1fea[_0xbcc3('0x19')]?_['map'](_0x1e1fea[_0xbcc3('0x19')],function(_0x56ce54){return{'model':db[_0x56ce54[_0xbcc3('0x1b')]],'as':_0x56ce54['as'],'attributes':_0x56ce54[_0xbcc3('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x42ebfa){logger[_0xbcc3('0x13')](_0xbcc3('0x1e'),_0x24c56d);logger[_0xbcc3('0xc')]('ShowDeskAccount',_0x24c56d,JSON[_0xbcc3('0xf')](_0x42ebfa));_0x5ee7f7(_0x42ebfa);})[_0xbcc3('0x1d')](function(_0x312553){logger['error'](_0xbcc3('0x1e'),_0x312553['message'],_0x24c56d);_0x29d0e1(_0x172463[_0xbcc3('0x10')](0x1f4,_0x312553[_0xbcc3('0x12')]));});});}; \ No newline at end of file +var _0xf224=['map','debug','catch','ShowDeskAccount','DeskAccount','then','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','request\x20sent','stringify','error','code','DeskAccount,\x20%s,\x20%s','message','result','GetDeskAccount','findAll','options','raw','where','attributes','include','model'];(function(_0x275855,_0x45bbab){var _0x395d15=function(_0xca1c0b){while(--_0xca1c0b){_0x275855['push'](_0x275855['shift']());}};_0x395d15(++_0x45bbab);}(_0xf224,0x138));var _0x4f22=function(_0x59bea3,_0x5a914){_0x59bea3=_0x59bea3-0x0;var _0x1e0952=_0xf224[_0x59bea3];return _0x1e0952;};'use strict';var _=require('lodash');var util=require(_0x4f22('0x0'));var moment=require(_0x4f22('0x1'));var BPromise=require(_0x4f22('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4f22('0x3'));var db=require(_0x4f22('0x4'))['db'];var utils=require(_0x4f22('0x5'));var logger=require(_0x4f22('0x6'))(_0x4f22('0x7'));var config=require('../../config/environment');var jayson=require(_0x4f22('0x8'));var client=jayson[_0x4f22('0x9')][_0x4f22('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x7fd942,_0x2aef2c,_0x2555fa){return new BPromise(function(_0x32ac62,_0x254750){return client[_0x4f22('0xb')](_0x7fd942,_0x2555fa)['then'](function(_0x5c806f){logger[_0x4f22('0xc')]('DeskAccount,\x20%s,\x20%s',_0x2aef2c,'request\x20sent');logger['debug']('DeskAccount,\x20%s,\x20%s,\x20%s',_0x2aef2c,_0x4f22('0xd'),JSON[_0x4f22('0xe')](_0x5c806f));if(_0x5c806f[_0x4f22('0xf')]){if(_0x5c806f[_0x4f22('0xf')][_0x4f22('0x10')]===0x1f4){logger['error'](_0x4f22('0x11'),_0x2aef2c,_0x5c806f['error'][_0x4f22('0x12')]);return _0x254750(_0x5c806f[_0x4f22('0xf')][_0x4f22('0x12')]);}logger[_0x4f22('0xf')](_0x4f22('0x11'),_0x2aef2c,_0x5c806f['error']['message']);return _0x32ac62(_0x5c806f[_0x4f22('0xf')]['message']);}else{logger['info'](_0x4f22('0x11'),_0x2aef2c,_0x4f22('0xd'));_0x32ac62(_0x5c806f[_0x4f22('0x13')][_0x4f22('0x12')]);}})['catch'](function(_0x27168c){logger[_0x4f22('0xf')](_0x4f22('0x11'),_0x2aef2c,_0x27168c);_0x254750(_0x27168c);});});}exports[_0x4f22('0x14')]=function(_0x527034){var _0x52003d=this;return new Promise(function(_0x9148bd,_0x2ab477){return db['DeskAccount'][_0x4f22('0x15')]({'raw':_0x527034[_0x4f22('0x16')]?_0x527034[_0x4f22('0x16')][_0x4f22('0x17')]===undefined?!![]:![]:!![],'where':_0x527034[_0x4f22('0x16')]?_0x527034[_0x4f22('0x16')][_0x4f22('0x18')]||null:null,'attributes':_0x527034[_0x4f22('0x16')]?_0x527034[_0x4f22('0x16')][_0x4f22('0x19')]||null:null,'limit':_0x527034[_0x4f22('0x16')]?_0x527034['options']['limit']||null:null,'include':_0x527034[_0x4f22('0x16')]?_0x527034[_0x4f22('0x16')][_0x4f22('0x1a')]?_['map'](_0x527034[_0x4f22('0x16')]['include'],function(_0x154667){return{'model':db[_0x154667[_0x4f22('0x1b')]],'as':_0x154667['as'],'attributes':_0x154667[_0x4f22('0x19')],'include':_0x154667[_0x4f22('0x1a')]?_[_0x4f22('0x1c')](_0x154667[_0x4f22('0x1a')],function(_0x4ed129){return{'model':db[_0x4ed129[_0x4f22('0x1b')]],'as':_0x4ed129['as'],'attributes':_0x4ed129[_0x4f22('0x19')],'include':_0x4ed129[_0x4f22('0x1a')]?_['map'](_0x4ed129[_0x4f22('0x1a')],function(_0x50ddfe){return{'model':db[_0x50ddfe[_0x4f22('0x1b')]],'as':_0x50ddfe['as'],'attributes':_0x50ddfe[_0x4f22('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x40e20c){logger[_0x4f22('0xc')](_0x4f22('0x14'),_0x527034);logger[_0x4f22('0x1d')](_0x4f22('0x14'),_0x527034,JSON[_0x4f22('0xe')](_0x40e20c));_0x9148bd(_0x40e20c);})[_0x4f22('0x1e')](function(_0x373b8e){logger[_0x4f22('0xf')](_0x4f22('0x14'),_0x373b8e[_0x4f22('0x12')],_0x527034);_0x2ab477(_0x52003d[_0x4f22('0xf')](0x1f4,_0x373b8e[_0x4f22('0x12')]));});});};exports[_0x4f22('0x1f')]=function(_0x5307dc){var _0x47cf9e=this;return new Promise(function(_0x3ecf5d,_0x3ac918){return db[_0x4f22('0x20')]['find']({'raw':_0x5307dc[_0x4f22('0x16')]?_0x5307dc[_0x4f22('0x16')][_0x4f22('0x17')]===undefined?!![]:![]:!![],'where':_0x5307dc['options']?_0x5307dc[_0x4f22('0x16')][_0x4f22('0x18')]||null:null,'attributes':_0x5307dc[_0x4f22('0x16')]?_0x5307dc[_0x4f22('0x16')][_0x4f22('0x19')]||null:null,'include':_0x5307dc[_0x4f22('0x16')]?_0x5307dc[_0x4f22('0x16')][_0x4f22('0x1a')]?_[_0x4f22('0x1c')](_0x5307dc[_0x4f22('0x16')][_0x4f22('0x1a')],function(_0x90929a){return{'model':db[_0x90929a['model']],'as':_0x90929a['as'],'attributes':_0x90929a[_0x4f22('0x19')],'include':_0x90929a[_0x4f22('0x1a')]?_[_0x4f22('0x1c')](_0x90929a[_0x4f22('0x1a')],function(_0x6172e1){return{'model':db[_0x6172e1['model']],'as':_0x6172e1['as'],'attributes':_0x6172e1[_0x4f22('0x19')],'include':_0x6172e1['include']?_[_0x4f22('0x1c')](_0x6172e1[_0x4f22('0x1a')],function(_0x34de3f){return{'model':db[_0x34de3f['model']],'as':_0x34de3f['as'],'attributes':_0x34de3f[_0x4f22('0x19')]};}):[]};}):[]};}):[]:[]})[_0x4f22('0x21')](function(_0x3c7015){logger[_0x4f22('0xc')](_0x4f22('0x1f'),_0x5307dc);logger[_0x4f22('0x1d')]('ShowDeskAccount',_0x5307dc,JSON[_0x4f22('0xe')](_0x3c7015));_0x3ecf5d(_0x3c7015);})[_0x4f22('0x1e')](function(_0x19df0f){logger[_0x4f22('0xf')](_0x4f22('0x1f'),_0x19df0f[_0x4f22('0x12')],_0x5307dc);_0x3ac918(_0x47cf9e[_0x4f22('0xf')](0x1f4,_0x19df0f[_0x4f22('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 840a2d3..fe2b319 100644 --- a/server/api/intDeskConfiguration/index.js +++ b/server/api/intDeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intDeskConfiguration.controller','isAuthenticated','index','get','/:id','/:id/fields','getFields','getSubjects','/:id/descriptions','/:id/tags','post','setTags','put','update'];(function(_0x376489,_0x8e4fba){var _0x24f6ee=function(_0x40800f){while(--_0x40800f){_0x376489['push'](_0x376489['shift']());}};_0x24f6ee(++_0x8e4fba);}(_0x9c44,0x178));var _0x49c4=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x9c44[_0x2d7f0e];return _0x110b07;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x49c4('0x6'));router['get']('/',auth[_0x49c4('0x7')](),controller[_0x49c4('0x8')]);router[_0x49c4('0x9')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller['show']);router[_0x49c4('0x9')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0xc')]);router['get']('/:id/subjects',auth[_0x49c4('0x7')](),controller[_0x49c4('0xd')]);router['get'](_0x49c4('0xe'),auth[_0x49c4('0x7')](),controller['getDescriptions']);router['get'](_0x49c4('0xf'),auth[_0x49c4('0x7')](),controller['getTags']);router[_0x49c4('0x10')]('/',auth[_0x49c4('0x7')](),controller['create']);router[_0x49c4('0x10')](_0x49c4('0xf'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x11')]);router[_0x49c4('0x12')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x13')]);router['delete'](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x14')]);module[_0x49c4('0x15')]=router; \ No newline at end of file +var _0x55ca=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','setTags','put','/:id','update','destroy','exports','multer','util','Router','fs-extra','../../components/interaction/service'];(function(_0x1bb58c,_0x2c8a4d){var _0x277586=function(_0x11fd4c){while(--_0x11fd4c){_0x1bb58c['push'](_0x1bb58c['shift']());}};_0x277586(++_0x2c8a4d);}(_0x55ca,0x126));var _0xa55c=function(_0x117713,_0x1b3f0c){_0x117713=_0x117713-0x0;var _0x310d68=_0x55ca[_0x117713];return _0x310d68;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['getFields']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getTags']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/tags',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x13'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router['delete'](_0xa55c('0x13'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x15')]);module[_0xa55c('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index b8a731a..c5d3394 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 _0xc094=['exports','STRING','sequelize'];(function(_0x524662,_0x1efb51){var _0x758d2e=function(_0x2d5c18){while(--_0x2d5c18){_0x524662['push'](_0x524662['shift']());}};_0x758d2e(++_0x1efb51);}(_0xc094,0xa1));var _0x4c09=function(_0x3ab5b5,_0x51ac49){_0x3ab5b5=_0x3ab5b5-0x0;var _0xec5463=_0xc094[_0x3ab5b5];return _0xec5463;};'use strict';var Sequelize=require(_0x4c09('0x0'));module[_0x4c09('0x1')]={'name':{'type':Sequelize[_0x4c09('0x2')]},'description':{'type':Sequelize[_0x4c09('0x2')]}}; \ No newline at end of file +var _0x0065=['STRING','sequelize','exports'];(function(_0x3f26a8,_0x444c20){var _0x5c1568=function(_0x11b078){while(--_0x11b078){_0x3f26a8['push'](_0x3f26a8['shift']());}};_0x5c1568(++_0x444c20);}(_0x0065,0x19c));var _0x5006=function(_0x3951e0,_0x2fa78){_0x3951e0=_0x3951e0-0x0;var _0x2da38e=_0x0065[_0x3951e0];return _0x2da38e;};'use strict';var Sequelize=require(_0x5006('0x0'));module[_0x5006('0x1')]={'name':{'type':Sequelize[_0x5006('0x2')]},'description':{'type':Sequelize[_0x5006('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index f58a5b3..ad97bbd 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 _0x6eb4=['filter','DeskConfiguration','includeAll','include','rows','params','keys','length','options','find','catch','create','body','getFields','DeskField','hasOwnProperty','order','getSubjects','getDescriptions','findOne','getTags','Tag','setTags','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','sendStatus','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','nolimit','sort','where','pick','merge'];(function(_0x27f5e1,_0x9503bf){var _0x428cdd=function(_0xd90cec){while(--_0xd90cec){_0x27f5e1['push'](_0x27f5e1['shift']());}};_0x428cdd(++_0x9503bf);}(_0x6eb4,0xbb));var _0x46eb=function(_0x24c392,_0xe1a064){_0x24c392=_0x24c392-0x0;var _0xf921fe=_0x6eb4[_0x24c392];return _0xf921fe;};'use strict';var emlformat=require(_0x46eb('0x0'));var rimraf=require(_0x46eb('0x1'));var zipdir=require(_0x46eb('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x46eb('0x3'));var moment=require(_0x46eb('0x4'));var BPromise=require(_0x46eb('0x5'));var Mustache=require(_0x46eb('0x6'));var util=require(_0x46eb('0x7'));var path=require(_0x46eb('0x8'));var sox=require(_0x46eb('0x9'));var csv=require(_0x46eb('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x46eb('0xb'));var _=require(_0x46eb('0xc'));var squel=require('squel');var crypto=require(_0x46eb('0xd'));var jsforce=require(_0x46eb('0xe'));var deskjs=require(_0x46eb('0xf'));var toCsv=require(_0x46eb('0xa'));var querystring=require(_0x46eb('0x10'));var Papa=require(_0x46eb('0x11'));var Redis=require('ioredis');var authService=require(_0x46eb('0x12'));var qs=require(_0x46eb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x46eb('0x14'))(_0x46eb('0x15'));var utils=require(_0x46eb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x46eb('0x17'));var db=require(_0x46eb('0x18'))['db'];function respondWithStatusCode(_0x222fdb,_0x4ca7b2){_0x4ca7b2=_0x4ca7b2||0xcc;return function(_0x5cc14d){if(_0x5cc14d){return _0x222fdb['sendStatus'](_0x4ca7b2);}return _0x222fdb[_0x46eb('0x19')](_0x4ca7b2)[_0x46eb('0x1a')]();};}function respondWithResult(_0x507020,_0x445d2f){_0x445d2f=_0x445d2f||0xc8;return function(_0x331422){if(_0x331422){return _0x507020[_0x46eb('0x19')](_0x445d2f)[_0x46eb('0x1b')](_0x331422);}};}function respondWithFilteredResult(_0x5731ec,_0xec9402){return function(_0x1febf1){if(_0x1febf1){var _0x47d1a0=typeof _0xec9402[_0x46eb('0x1c')]===_0x46eb('0x1d')&&typeof _0xec9402[_0x46eb('0x1e')]===_0x46eb('0x1d');var _0x2683bb=_0x1febf1[_0x46eb('0x1f')];var _0x2cf5a9=_0x47d1a0?0x0:_0xec9402[_0x46eb('0x1c')];var _0x1ae641=_0x47d1a0?_0x1febf1[_0x46eb('0x1f')]:_0xec9402[_0x46eb('0x1c')]+_0xec9402[_0x46eb('0x1e')];var _0x491fae;if(_0x1ae641>=_0x2683bb){_0x1ae641=_0x2683bb;_0x491fae=0xc8;}else{_0x491fae=0xce;}_0x5731ec['status'](_0x491fae);return _0x5731ec[_0x46eb('0x20')](_0x46eb('0x21'),_0x2cf5a9+'-'+_0x1ae641+'/'+_0x2683bb)[_0x46eb('0x1b')](_0x1febf1);}return null;};}function patchUpdates(_0x351d05){return function(_0x46dd33){try{jsonpatch['apply'](_0x46dd33,_0x351d05,!![]);}catch(_0x586aa3){return BPromise[_0x46eb('0x22')](_0x586aa3);}return _0x46dd33['save']();};}function saveUpdates(_0x4ac8e5,_0x5bbc7f){return function(_0x443105){if(_0x443105){return _0x443105[_0x46eb('0x23')](_0x4ac8e5)[_0x46eb('0x24')](function(_0x4e20cf){return _0x4e20cf;});}return null;};}function removeEntity(_0x2abbea,_0x7e1892){return function(_0x1e59c3){if(_0x1e59c3){return _0x1e59c3[_0x46eb('0x25')]()[_0x46eb('0x24')](function(){_0x2abbea['status'](0xcc)[_0x46eb('0x1a')]();});}};}function handleEntityNotFound(_0x3ae300,_0x474bb1){return function(_0x355ea){if(!_0x355ea){_0x3ae300[_0x46eb('0x26')](0x194);}return _0x355ea;};}function handleError(_0x745e64,_0xabb331){_0xabb331=_0xabb331||0x1f4;return function(_0x48e745){logger[_0x46eb('0x27')](_0x48e745[_0x46eb('0x28')]);if(_0x48e745['name']){delete _0x48e745[_0x46eb('0x29')];}_0x745e64['status'](_0xabb331)[_0x46eb('0x2a')](_0x48e745);};}exports['index']=function(_0x2cde69,_0x79fb24){var _0x5d0bb3={},_0x5daee4={},_0x41e883={'count':0x0,'rows':[]};var _0x4c3dff=_[_0x46eb('0x2b')](db['DeskConfiguration'][_0x46eb('0x2c')],function(_0x471820){return{'name':_0x471820[_0x46eb('0x2d')],'type':_0x471820[_0x46eb('0x2e')][_0x46eb('0x2f')]};});_0x5daee4[_0x46eb('0x30')]=_[_0x46eb('0x2b')](_0x4c3dff,'name');_0x5daee4['query']=_['keys'](_0x2cde69[_0x46eb('0x31')]);_0x5daee4[_0x46eb('0x32')]=_[_0x46eb('0x33')](_0x5daee4['model'],_0x5daee4[_0x46eb('0x31')]);_0x5d0bb3['attributes']=_['intersection'](_0x5daee4['model'],qs[_0x46eb('0x34')](_0x2cde69[_0x46eb('0x31')]['fields']));_0x5d0bb3[_0x46eb('0x35')]=_0x5d0bb3[_0x46eb('0x35')]['length']?_0x5d0bb3[_0x46eb('0x35')]:_0x5daee4[_0x46eb('0x30')];if(!_0x2cde69[_0x46eb('0x31')]['hasOwnProperty'](_0x46eb('0x36'))){_0x5d0bb3[_0x46eb('0x1e')]=qs[_0x46eb('0x1e')](_0x2cde69[_0x46eb('0x31')][_0x46eb('0x1e')]);_0x5d0bb3['offset']=qs[_0x46eb('0x1c')](_0x2cde69[_0x46eb('0x31')]['offset']);}_0x5d0bb3['order']=qs['sort'](_0x2cde69[_0x46eb('0x31')][_0x46eb('0x37')]);_0x5d0bb3[_0x46eb('0x38')]=qs[_0x46eb('0x32')](_[_0x46eb('0x39')](_0x2cde69['query'],_0x5daee4[_0x46eb('0x32')]),_0x4c3dff);if(_0x2cde69[_0x46eb('0x31')]['filter']){_0x5d0bb3[_0x46eb('0x38')]=_[_0x46eb('0x3a')](_0x5d0bb3[_0x46eb('0x38')],{'$or':_[_0x46eb('0x2b')](_0x4c3dff,function(_0x1fc773){if(_0x1fc773['type']!=='VIRTUAL'){var _0x417aa2={};_0x417aa2[_0x1fc773['name']]={'$like':'%'+_0x2cde69[_0x46eb('0x31')][_0x46eb('0x3b')]+'%'};return _0x417aa2;}})});}_0x5d0bb3=_['merge']({},_0x5d0bb3,_0x2cde69['options']);var _0x5818fa={'where':_0x5d0bb3[_0x46eb('0x38')]};return db[_0x46eb('0x3c')][_0x46eb('0x1f')](_0x5818fa)[_0x46eb('0x24')](function(_0x10e3c9){_0x41e883['count']=_0x10e3c9;if(_0x2cde69[_0x46eb('0x31')][_0x46eb('0x3d')]){_0x5d0bb3[_0x46eb('0x3e')]=[{'all':!![]}];}return db[_0x46eb('0x3c')]['findAll'](_0x5d0bb3);})[_0x46eb('0x24')](function(_0x52465a){_0x41e883[_0x46eb('0x3f')]=_0x52465a;return _0x41e883;})['then'](respondWithFilteredResult(_0x79fb24,_0x5d0bb3))['catch'](handleError(_0x79fb24,null));};exports['show']=function(_0x1c2e04,_0x3c04a8){var _0xd71370={'raw':![],'where':{'id':_0x1c2e04[_0x46eb('0x40')]['id']}},_0x1b36ea={};_0x1b36ea['model']=_[_0x46eb('0x41')](db['DeskConfiguration'][_0x46eb('0x2c')]);_0x1b36ea[_0x46eb('0x31')]=_[_0x46eb('0x41')](_0x1c2e04[_0x46eb('0x31')]);_0x1b36ea[_0x46eb('0x32')]=_[_0x46eb('0x33')](_0x1b36ea['model'],_0x1b36ea[_0x46eb('0x31')]);_0xd71370['attributes']=_[_0x46eb('0x33')](_0x1b36ea[_0x46eb('0x30')],qs['fields'](_0x1c2e04['query'][_0x46eb('0x34')]));_0xd71370['attributes']=_0xd71370[_0x46eb('0x35')][_0x46eb('0x42')]?_0xd71370['attributes']:_0x1b36ea[_0x46eb('0x30')];if(_0x1c2e04[_0x46eb('0x31')][_0x46eb('0x3d')]){_0xd71370[_0x46eb('0x3e')]=[{'all':!![]}];}_0xd71370=_[_0x46eb('0x3a')]({},_0xd71370,_0x1c2e04[_0x46eb('0x43')]);return db[_0x46eb('0x3c')][_0x46eb('0x44')](_0xd71370)[_0x46eb('0x24')](handleEntityNotFound(_0x3c04a8,null))[_0x46eb('0x24')](respondWithResult(_0x3c04a8,null))[_0x46eb('0x45')](handleError(_0x3c04a8,null));};exports['create']=function(_0x13259a,_0x39c91e){return db[_0x46eb('0x3c')][_0x46eb('0x46')](_0x13259a[_0x46eb('0x47')],{})[_0x46eb('0x24')](respondWithResult(_0x39c91e,0xc9))['catch'](handleError(_0x39c91e,null));};exports[_0x46eb('0x23')]=function(_0x523ac7,_0x583b4c){if(_0x523ac7[_0x46eb('0x47')]['id']){delete _0x523ac7[_0x46eb('0x47')]['id'];}return db[_0x46eb('0x3c')][_0x46eb('0x44')]({'where':{'id':_0x523ac7[_0x46eb('0x40')]['id']}})[_0x46eb('0x24')](handleEntityNotFound(_0x583b4c,null))[_0x46eb('0x24')](saveUpdates(_0x523ac7[_0x46eb('0x47')],null))[_0x46eb('0x24')](respondWithResult(_0x583b4c,null))['catch'](handleError(_0x583b4c,null));};exports[_0x46eb('0x25')]=function(_0x26d992,_0x369a3b){return db[_0x46eb('0x3c')][_0x46eb('0x44')]({'where':{'id':_0x26d992[_0x46eb('0x40')]['id']}})['then'](handleEntityNotFound(_0x369a3b,null))['then'](removeEntity(_0x369a3b,null))[_0x46eb('0x45')](handleError(_0x369a3b,null));};exports[_0x46eb('0x48')]=function(_0x1b87b4,_0x5d93c2,_0x21f3c2){var _0x43dfb8={};var _0x285d62={};var _0x1af462;var _0x428159;return db[_0x46eb('0x3c')]['findOne']({'where':{'id':_0x1b87b4['params']['id']}})[_0x46eb('0x24')](handleEntityNotFound(_0x5d93c2,null))['then'](function(_0x28c020){if(_0x28c020){_0x1af462=_0x28c020;_0x285d62[_0x46eb('0x30')]=_[_0x46eb('0x41')](db[_0x46eb('0x49')][_0x46eb('0x2c')]);_0x285d62[_0x46eb('0x31')]=_[_0x46eb('0x41')](_0x1b87b4[_0x46eb('0x31')]);_0x285d62['filters']=_[_0x46eb('0x33')](_0x285d62['model'],_0x285d62['query']);_0x43dfb8['attributes']=_[_0x46eb('0x33')](_0x285d62[_0x46eb('0x30')],qs[_0x46eb('0x34')](_0x1b87b4[_0x46eb('0x31')][_0x46eb('0x34')]));_0x43dfb8[_0x46eb('0x35')]=_0x43dfb8[_0x46eb('0x35')]['length']?_0x43dfb8['attributes']:_0x285d62['model'];_0x43dfb8['order']=qs[_0x46eb('0x37')](_0x1b87b4[_0x46eb('0x31')][_0x46eb('0x37')]);_0x43dfb8[_0x46eb('0x38')]=qs[_0x46eb('0x32')](_[_0x46eb('0x39')](_0x1b87b4[_0x46eb('0x31')],_0x285d62[_0x46eb('0x32')]));if(_0x1b87b4[_0x46eb('0x31')][_0x46eb('0x3b')]){_0x43dfb8['where']=_[_0x46eb('0x3a')](_0x43dfb8['where'],{'$or':_[_0x46eb('0x2b')](_0x43dfb8[_0x46eb('0x35')],function(_0x1b79fa){var _0x2d6fd0={};_0x2d6fd0[_0x1b79fa]={'$like':'%'+_0x1b87b4['query']['filter']+'%'};return _0x2d6fd0;})});}_0x43dfb8=_['merge']({},_0x43dfb8,_0x1b87b4[_0x46eb('0x43')]);return _0x1af462['getFields'](_0x43dfb8);}})['then'](function(_0x2b1ea7){if(_0x2b1ea7){_0x428159=_0x2b1ea7[_0x46eb('0x42')];if(!_0x1b87b4[_0x46eb('0x31')][_0x46eb('0x4a')](_0x46eb('0x36'))){_0x43dfb8[_0x46eb('0x1e')]=qs[_0x46eb('0x1e')](_0x1b87b4['query'][_0x46eb('0x1e')]);_0x43dfb8[_0x46eb('0x1c')]=qs[_0x46eb('0x1c')](_0x1b87b4[_0x46eb('0x31')][_0x46eb('0x1c')]);}return _0x1af462['getFields'](_0x43dfb8);}})[_0x46eb('0x24')](function(_0x53700b){if(_0x53700b){return _0x53700b?{'count':_0x428159,'rows':_0x53700b}:null;}})[_0x46eb('0x24')](respondWithResult(_0x5d93c2,null))[_0x46eb('0x45')](handleError(_0x5d93c2,null));};exports['getSubjects']=function(_0x3a630a,_0x512498,_0x1a53e4){var _0xa83bda={};var _0x4ed0ec={};var _0x54c93d;var _0x5a5f2c;return db[_0x46eb('0x3c')]['findOne']({'where':{'id':_0x3a630a[_0x46eb('0x40')]['id']}})[_0x46eb('0x24')](handleEntityNotFound(_0x512498,null))[_0x46eb('0x24')](function(_0x190b06){if(_0x190b06){_0x54c93d=_0x190b06;_0x4ed0ec[_0x46eb('0x30')]=_['keys'](db['DeskField']['rawAttributes']);_0x4ed0ec['query']=_['keys'](_0x3a630a[_0x46eb('0x31')]);_0x4ed0ec[_0x46eb('0x32')]=_[_0x46eb('0x33')](_0x4ed0ec[_0x46eb('0x30')],_0x4ed0ec[_0x46eb('0x31')]);_0xa83bda[_0x46eb('0x35')]=_[_0x46eb('0x33')](_0x4ed0ec['model'],qs[_0x46eb('0x34')](_0x3a630a[_0x46eb('0x31')]['fields']));_0xa83bda[_0x46eb('0x35')]=_0xa83bda[_0x46eb('0x35')][_0x46eb('0x42')]?_0xa83bda[_0x46eb('0x35')]:_0x4ed0ec[_0x46eb('0x30')];_0xa83bda[_0x46eb('0x4b')]=qs[_0x46eb('0x37')](_0x3a630a[_0x46eb('0x31')][_0x46eb('0x37')]);_0xa83bda[_0x46eb('0x38')]=qs[_0x46eb('0x32')](_[_0x46eb('0x39')](_0x3a630a[_0x46eb('0x31')],_0x4ed0ec[_0x46eb('0x32')]));if(_0x3a630a[_0x46eb('0x31')]['filter']){_0xa83bda[_0x46eb('0x38')]=_['merge'](_0xa83bda[_0x46eb('0x38')],{'$or':_[_0x46eb('0x2b')](_0xa83bda['attributes'],function(_0x16b4f3){var _0x29d494={};_0x29d494[_0x16b4f3]={'$like':'%'+_0x3a630a[_0x46eb('0x31')][_0x46eb('0x3b')]+'%'};return _0x29d494;})});}_0xa83bda=_['merge']({},_0xa83bda,_0x3a630a[_0x46eb('0x43')]);return _0x54c93d[_0x46eb('0x4c')](_0xa83bda);}})['then'](function(_0x54a01a){if(_0x54a01a){_0x5a5f2c=_0x54a01a[_0x46eb('0x42')];if(!_0x3a630a[_0x46eb('0x31')][_0x46eb('0x4a')](_0x46eb('0x36'))){_0xa83bda[_0x46eb('0x1e')]=qs[_0x46eb('0x1e')](_0x3a630a['query'][_0x46eb('0x1e')]);_0xa83bda[_0x46eb('0x1c')]=qs['offset'](_0x3a630a[_0x46eb('0x31')][_0x46eb('0x1c')]);}return _0x54c93d[_0x46eb('0x4c')](_0xa83bda);}})[_0x46eb('0x24')](function(_0x32c641){if(_0x32c641){return _0x32c641?{'count':_0x5a5f2c,'rows':_0x32c641}:null;}})[_0x46eb('0x24')](respondWithResult(_0x512498,null))['catch'](handleError(_0x512498,null));};exports[_0x46eb('0x4d')]=function(_0x23f66a,_0x10f286,_0x1dce69){var _0x409ee0={};var _0x2c56df={};var _0x4f612f;var _0x237864;return db[_0x46eb('0x3c')][_0x46eb('0x4e')]({'where':{'id':_0x23f66a['params']['id']}})[_0x46eb('0x24')](handleEntityNotFound(_0x10f286,null))['then'](function(_0x493050){if(_0x493050){_0x4f612f=_0x493050;_0x2c56df['model']=_[_0x46eb('0x41')](db[_0x46eb('0x49')][_0x46eb('0x2c')]);_0x2c56df[_0x46eb('0x31')]=_[_0x46eb('0x41')](_0x23f66a['query']);_0x2c56df[_0x46eb('0x32')]=_[_0x46eb('0x33')](_0x2c56df[_0x46eb('0x30')],_0x2c56df[_0x46eb('0x31')]);_0x409ee0[_0x46eb('0x35')]=_[_0x46eb('0x33')](_0x2c56df[_0x46eb('0x30')],qs['fields'](_0x23f66a['query'][_0x46eb('0x34')]));_0x409ee0[_0x46eb('0x35')]=_0x409ee0[_0x46eb('0x35')][_0x46eb('0x42')]?_0x409ee0['attributes']:_0x2c56df[_0x46eb('0x30')];_0x409ee0[_0x46eb('0x4b')]=qs['sort'](_0x23f66a['query']['sort']);_0x409ee0[_0x46eb('0x38')]=qs[_0x46eb('0x32')](_['pick'](_0x23f66a[_0x46eb('0x31')],_0x2c56df[_0x46eb('0x32')]));if(_0x23f66a['query'][_0x46eb('0x3b')]){_0x409ee0[_0x46eb('0x38')]=_['merge'](_0x409ee0[_0x46eb('0x38')],{'$or':_[_0x46eb('0x2b')](_0x409ee0[_0x46eb('0x35')],function(_0x2d2b2d){var _0x31effe={};_0x31effe[_0x2d2b2d]={'$like':'%'+_0x23f66a[_0x46eb('0x31')][_0x46eb('0x3b')]+'%'};return _0x31effe;})});}_0x409ee0=_[_0x46eb('0x3a')]({},_0x409ee0,_0x23f66a[_0x46eb('0x43')]);return _0x4f612f[_0x46eb('0x4d')](_0x409ee0);}})[_0x46eb('0x24')](function(_0x311fff){if(_0x311fff){_0x237864=_0x311fff[_0x46eb('0x42')];if(!_0x23f66a['query'][_0x46eb('0x4a')](_0x46eb('0x36'))){_0x409ee0[_0x46eb('0x1e')]=qs[_0x46eb('0x1e')](_0x23f66a[_0x46eb('0x31')][_0x46eb('0x1e')]);_0x409ee0[_0x46eb('0x1c')]=qs['offset'](_0x23f66a[_0x46eb('0x31')][_0x46eb('0x1c')]);}return _0x4f612f[_0x46eb('0x4d')](_0x409ee0);}})[_0x46eb('0x24')](function(_0x35832e){if(_0x35832e){return _0x35832e?{'count':_0x237864,'rows':_0x35832e}:null;}})[_0x46eb('0x24')](respondWithResult(_0x10f286,null))[_0x46eb('0x45')](handleError(_0x10f286,null));};exports[_0x46eb('0x4f')]=function(_0x181721,_0x40dee0,_0xedaee9){var _0x30aa58={};var _0x519970={};var _0x208c0d;var _0x423c89;return db[_0x46eb('0x3c')][_0x46eb('0x4e')]({'where':{'id':_0x181721[_0x46eb('0x40')]['id']}})[_0x46eb('0x24')](handleEntityNotFound(_0x40dee0,null))[_0x46eb('0x24')](function(_0x239bbf){if(_0x239bbf){_0x208c0d=_0x239bbf;_0x519970[_0x46eb('0x30')]=_[_0x46eb('0x41')](db[_0x46eb('0x50')][_0x46eb('0x2c')]);_0x519970[_0x46eb('0x31')]=_['keys'](_0x181721['query']);_0x519970[_0x46eb('0x32')]=_['intersection'](_0x519970[_0x46eb('0x30')],_0x519970[_0x46eb('0x31')]);_0x30aa58[_0x46eb('0x35')]=_[_0x46eb('0x33')](_0x519970[_0x46eb('0x30')],qs[_0x46eb('0x34')](_0x181721[_0x46eb('0x31')][_0x46eb('0x34')]));_0x30aa58[_0x46eb('0x35')]=_0x30aa58[_0x46eb('0x35')][_0x46eb('0x42')]?_0x30aa58[_0x46eb('0x35')]:_0x519970[_0x46eb('0x30')];_0x30aa58[_0x46eb('0x4b')]=qs[_0x46eb('0x37')](_0x181721['query']['sort']);_0x30aa58[_0x46eb('0x38')]=qs['filters'](_[_0x46eb('0x39')](_0x181721[_0x46eb('0x31')],_0x519970[_0x46eb('0x32')]));if(_0x181721[_0x46eb('0x31')][_0x46eb('0x3b')]){_0x30aa58['where']=_['merge'](_0x30aa58[_0x46eb('0x38')],{'$or':_['map'](_0x30aa58[_0x46eb('0x35')],function(_0xee7845){var _0x56813e={};_0x56813e[_0xee7845]={'$like':'%'+_0x181721[_0x46eb('0x31')][_0x46eb('0x3b')]+'%'};return _0x56813e;})});}_0x30aa58=_[_0x46eb('0x3a')]({},_0x30aa58,_0x181721[_0x46eb('0x43')]);return _0x208c0d['getTags'](_0x30aa58);}})['then'](function(_0x40c367){if(_0x40c367){_0x423c89=_0x40c367['length'];if(!_0x181721[_0x46eb('0x31')][_0x46eb('0x4a')](_0x46eb('0x36'))){_0x30aa58[_0x46eb('0x1e')]=qs[_0x46eb('0x1e')](_0x181721[_0x46eb('0x31')][_0x46eb('0x1e')]);_0x30aa58['offset']=qs[_0x46eb('0x1c')](_0x181721[_0x46eb('0x31')][_0x46eb('0x1c')]);}return _0x208c0d[_0x46eb('0x4f')](_0x30aa58);}})[_0x46eb('0x24')](function(_0x257ec7){if(_0x257ec7){return _0x257ec7?{'count':_0x423c89,'rows':_0x257ec7}:null;}})[_0x46eb('0x24')](respondWithResult(_0x40dee0,null))[_0x46eb('0x45')](handleError(_0x40dee0,null));};exports[_0x46eb('0x51')]=function(_0xc1f8ff,_0x12e504,_0x41bd58){if(_0xc1f8ff[_0x46eb('0x47')]['id']){delete _0xc1f8ff[_0x46eb('0x47')]['id'];}return db[_0x46eb('0x3c')][_0x46eb('0x4e')]({'where':{'id':_0xc1f8ff[_0x46eb('0x40')]['id']}})['then'](handleEntityNotFound(_0x12e504,null))[_0x46eb('0x24')](function(_0x5013d0){if(_0x5013d0){return _0x5013d0[_0x46eb('0x51')](_0xc1f8ff[_0x46eb('0x47')]['ids']||[]);}return null;})[_0x46eb('0x24')](respondWithResult(_0x12e504,null))[_0x46eb('0x45')](handleError(_0x12e504,null));}; \ No newline at end of file +var _0x6a34=['ejs','lodash','squel','crypto','desk.js','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','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','end','error','stack','name','map','DeskConfiguration','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','getFields','findOne','DeskField','nolimit','getSubjects','getDescriptions','getTags','setTags','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x6a34,0x9f));var _0x46a3=function(_0x2c9af0,_0x5a6f07){_0x2c9af0=_0x2c9af0-0x0;var _0x380d91=_0x6a34[_0x2c9af0];return _0x380d91;};'use strict';var emlformat=require(_0x46a3('0x0'));var rimraf=require(_0x46a3('0x1'));var zipdir=require(_0x46a3('0x2'));var jsonpatch=require(_0x46a3('0x3'));var rp=require(_0x46a3('0x4'));var moment=require(_0x46a3('0x5'));var BPromise=require(_0x46a3('0x6'));var Mustache=require(_0x46a3('0x7'));var util=require('util');var path=require(_0x46a3('0x8'));var sox=require(_0x46a3('0x9'));var csv=require(_0x46a3('0xa'));var ejs=require(_0x46a3('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x46a3('0xc'));var squel=require(_0x46a3('0xd'));var crypto=require(_0x46a3('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x46a3('0xf'));var toCsv=require(_0x46a3('0xa'));var querystring=require(_0x46a3('0x10'));var Papa=require('papaparse');var Redis=require(_0x46a3('0x11'));var authService=require(_0x46a3('0x12'));var qs=require(_0x46a3('0x13'));var as=require(_0x46a3('0x14'));var hardwareService=require(_0x46a3('0x15'));var logger=require(_0x46a3('0x16'))('api');var utils=require(_0x46a3('0x17'));var config=require(_0x46a3('0x18'));var licenseUtil=require(_0x46a3('0x19'));var db=require(_0x46a3('0x1a'))['db'];function respondWithStatusCode(_0x53bce4,_0x37d47c){_0x37d47c=_0x37d47c||0xcc;return function(_0x18052d){if(_0x18052d){return _0x53bce4[_0x46a3('0x1b')](_0x37d47c);}return _0x53bce4[_0x46a3('0x1c')](_0x37d47c)['end']();};}function respondWithResult(_0x567213,_0xde26fb){_0xde26fb=_0xde26fb||0xc8;return function(_0x2692e7){if(_0x2692e7){return _0x567213[_0x46a3('0x1c')](_0xde26fb)[_0x46a3('0x1d')](_0x2692e7);}};}function respondWithFilteredResult(_0xb777ae,_0x138d89){return function(_0x40278c){if(_0x40278c){var _0x5e12cf=typeof _0x138d89[_0x46a3('0x1e')]==='undefined'&&typeof _0x138d89[_0x46a3('0x1f')]===_0x46a3('0x20');var _0x396a3d=_0x40278c[_0x46a3('0x21')];var _0x1e68c8=_0x5e12cf?0x0:_0x138d89[_0x46a3('0x1e')];var _0x134017=_0x5e12cf?_0x40278c[_0x46a3('0x21')]:_0x138d89[_0x46a3('0x1e')]+_0x138d89['limit'];var _0x182338;if(_0x134017>=_0x396a3d){_0x134017=_0x396a3d;_0x182338=0xc8;}else{_0x182338=0xce;}_0xb777ae[_0x46a3('0x1c')](_0x182338);return _0xb777ae[_0x46a3('0x22')](_0x46a3('0x23'),_0x1e68c8+'-'+_0x134017+'/'+_0x396a3d)['json'](_0x40278c);}return null;};}function patchUpdates(_0x29a9f7){return function(_0x2063aa){try{jsonpatch['apply'](_0x2063aa,_0x29a9f7,!![]);}catch(_0x442e1a){return BPromise[_0x46a3('0x24')](_0x442e1a);}return _0x2063aa[_0x46a3('0x25')]();};}function saveUpdates(_0x2505bc,_0x3f6d59){return function(_0x23fc1b){if(_0x23fc1b){return _0x23fc1b[_0x46a3('0x26')](_0x2505bc)[_0x46a3('0x27')](function(_0x86edcf){return _0x86edcf;});}return null;};}function removeEntity(_0x28992f,_0x1541e9){return function(_0x2205ac){if(_0x2205ac){return _0x2205ac[_0x46a3('0x28')]()[_0x46a3('0x27')](function(){_0x28992f[_0x46a3('0x1c')](0xcc)[_0x46a3('0x29')]();});}};}function handleEntityNotFound(_0x1289fa,_0x2633fc){return function(_0x16bad3){if(!_0x16bad3){_0x1289fa[_0x46a3('0x1b')](0x194);}return _0x16bad3;};}function handleError(_0x373bf9,_0x197993){_0x197993=_0x197993||0x1f4;return function(_0x466e5a){logger[_0x46a3('0x2a')](_0x466e5a[_0x46a3('0x2b')]);if(_0x466e5a[_0x46a3('0x2c')]){delete _0x466e5a[_0x46a3('0x2c')];}_0x373bf9['status'](_0x197993)['send'](_0x466e5a);};}exports['index']=function(_0xfc67,_0x406046){var _0x442969={},_0x2f8d94={},_0xa0ab53={'count':0x0,'rows':[]};var _0x369963=_[_0x46a3('0x2d')](db[_0x46a3('0x2e')][_0x46a3('0x2f')],function(_0x43f618){return{'name':_0x43f618[_0x46a3('0x30')],'type':_0x43f618[_0x46a3('0x31')][_0x46a3('0x32')]};});_0x2f8d94[_0x46a3('0x33')]=_[_0x46a3('0x2d')](_0x369963,_0x46a3('0x2c'));_0x2f8d94[_0x46a3('0x34')]=_[_0x46a3('0x35')](_0xfc67[_0x46a3('0x34')]);_0x2f8d94['filters']=_[_0x46a3('0x36')](_0x2f8d94[_0x46a3('0x33')],_0x2f8d94[_0x46a3('0x34')]);_0x442969[_0x46a3('0x37')]=_[_0x46a3('0x36')](_0x2f8d94[_0x46a3('0x33')],qs[_0x46a3('0x38')](_0xfc67[_0x46a3('0x34')][_0x46a3('0x38')]));_0x442969[_0x46a3('0x37')]=_0x442969['attributes'][_0x46a3('0x39')]?_0x442969[_0x46a3('0x37')]:_0x2f8d94[_0x46a3('0x33')];if(!_0xfc67[_0x46a3('0x34')][_0x46a3('0x3a')]('nolimit')){_0x442969[_0x46a3('0x1f')]=qs['limit'](_0xfc67[_0x46a3('0x34')][_0x46a3('0x1f')]);_0x442969['offset']=qs[_0x46a3('0x1e')](_0xfc67[_0x46a3('0x34')][_0x46a3('0x1e')]);}_0x442969[_0x46a3('0x3b')]=qs[_0x46a3('0x3c')](_0xfc67['query'][_0x46a3('0x3c')]);_0x442969[_0x46a3('0x3d')]=qs[_0x46a3('0x3e')](_[_0x46a3('0x3f')](_0xfc67['query'],_0x2f8d94['filters']),_0x369963);if(_0xfc67[_0x46a3('0x34')][_0x46a3('0x40')]){_0x442969['where']=_['merge'](_0x442969[_0x46a3('0x3d')],{'$or':_[_0x46a3('0x2d')](_0x369963,function(_0x57a5b6){if(_0x57a5b6[_0x46a3('0x31')]!=='VIRTUAL'){var _0x501b5b={};_0x501b5b[_0x57a5b6[_0x46a3('0x2c')]]={'$like':'%'+_0xfc67['query'][_0x46a3('0x40')]+'%'};return _0x501b5b;}})});}_0x442969=_[_0x46a3('0x41')]({},_0x442969,_0xfc67['options']);var _0x42bfee={'where':_0x442969[_0x46a3('0x3d')]};return db[_0x46a3('0x2e')][_0x46a3('0x21')](_0x42bfee)[_0x46a3('0x27')](function(_0x360e7c){_0xa0ab53['count']=_0x360e7c;if(_0xfc67[_0x46a3('0x34')][_0x46a3('0x42')]){_0x442969[_0x46a3('0x43')]=[{'all':!![]}];}return db[_0x46a3('0x2e')][_0x46a3('0x44')](_0x442969);})[_0x46a3('0x27')](function(_0x35a7fd){_0xa0ab53[_0x46a3('0x45')]=_0x35a7fd;return _0xa0ab53;})['then'](respondWithFilteredResult(_0x406046,_0x442969))[_0x46a3('0x46')](handleError(_0x406046,null));};exports[_0x46a3('0x47')]=function(_0x1c7902,_0x5b0047){var _0x2d9efe={'raw':![],'where':{'id':_0x1c7902[_0x46a3('0x48')]['id']}},_0x482fec={};_0x482fec['model']=_[_0x46a3('0x35')](db['DeskConfiguration'][_0x46a3('0x2f')]);_0x482fec[_0x46a3('0x34')]=_[_0x46a3('0x35')](_0x1c7902[_0x46a3('0x34')]);_0x482fec['filters']=_['intersection'](_0x482fec[_0x46a3('0x33')],_0x482fec['query']);_0x2d9efe[_0x46a3('0x37')]=_[_0x46a3('0x36')](_0x482fec[_0x46a3('0x33')],qs['fields'](_0x1c7902[_0x46a3('0x34')]['fields']));_0x2d9efe[_0x46a3('0x37')]=_0x2d9efe[_0x46a3('0x37')][_0x46a3('0x39')]?_0x2d9efe[_0x46a3('0x37')]:_0x482fec[_0x46a3('0x33')];if(_0x1c7902[_0x46a3('0x34')][_0x46a3('0x42')]){_0x2d9efe[_0x46a3('0x43')]=[{'all':!![]}];}_0x2d9efe=_[_0x46a3('0x41')]({},_0x2d9efe,_0x1c7902[_0x46a3('0x49')]);return db[_0x46a3('0x2e')][_0x46a3('0x4a')](_0x2d9efe)['then'](handleEntityNotFound(_0x5b0047,null))[_0x46a3('0x27')](respondWithResult(_0x5b0047,null))[_0x46a3('0x46')](handleError(_0x5b0047,null));};exports[_0x46a3('0x4b')]=function(_0x1bf9c2,_0x3d5d84){return db[_0x46a3('0x2e')][_0x46a3('0x4b')](_0x1bf9c2[_0x46a3('0x4c')],{})[_0x46a3('0x27')](respondWithResult(_0x3d5d84,0xc9))[_0x46a3('0x46')](handleError(_0x3d5d84,null));};exports['update']=function(_0x1bffd2,_0x102f38){if(_0x1bffd2[_0x46a3('0x4c')]['id']){delete _0x1bffd2['body']['id'];}return db['DeskConfiguration'][_0x46a3('0x4a')]({'where':{'id':_0x1bffd2[_0x46a3('0x48')]['id']}})['then'](handleEntityNotFound(_0x102f38,null))[_0x46a3('0x27')](saveUpdates(_0x1bffd2['body'],null))['then'](respondWithResult(_0x102f38,null))['catch'](handleError(_0x102f38,null));};exports[_0x46a3('0x28')]=function(_0x57b218,_0x5a3b5f){return db[_0x46a3('0x2e')]['find']({'where':{'id':_0x57b218['params']['id']}})[_0x46a3('0x27')](handleEntityNotFound(_0x5a3b5f,null))[_0x46a3('0x27')](removeEntity(_0x5a3b5f,null))[_0x46a3('0x46')](handleError(_0x5a3b5f,null));};exports[_0x46a3('0x4d')]=function(_0x25ad40,_0x218614,_0x1ea3d2){var _0x3d209f={};var _0x355425={};var _0x4a11c5;var _0x5b06d0;return db[_0x46a3('0x2e')][_0x46a3('0x4e')]({'where':{'id':_0x25ad40[_0x46a3('0x48')]['id']}})[_0x46a3('0x27')](handleEntityNotFound(_0x218614,null))['then'](function(_0x510f90){if(_0x510f90){_0x4a11c5=_0x510f90;_0x355425[_0x46a3('0x33')]=_['keys'](db[_0x46a3('0x4f')][_0x46a3('0x2f')]);_0x355425[_0x46a3('0x34')]=_[_0x46a3('0x35')](_0x25ad40[_0x46a3('0x34')]);_0x355425[_0x46a3('0x3e')]=_[_0x46a3('0x36')](_0x355425[_0x46a3('0x33')],_0x355425['query']);_0x3d209f[_0x46a3('0x37')]=_[_0x46a3('0x36')](_0x355425[_0x46a3('0x33')],qs[_0x46a3('0x38')](_0x25ad40[_0x46a3('0x34')][_0x46a3('0x38')]));_0x3d209f[_0x46a3('0x37')]=_0x3d209f['attributes'][_0x46a3('0x39')]?_0x3d209f[_0x46a3('0x37')]:_0x355425[_0x46a3('0x33')];_0x3d209f['order']=qs[_0x46a3('0x3c')](_0x25ad40[_0x46a3('0x34')][_0x46a3('0x3c')]);_0x3d209f[_0x46a3('0x3d')]=qs['filters'](_[_0x46a3('0x3f')](_0x25ad40[_0x46a3('0x34')],_0x355425[_0x46a3('0x3e')]));if(_0x25ad40[_0x46a3('0x34')][_0x46a3('0x40')]){_0x3d209f[_0x46a3('0x3d')]=_[_0x46a3('0x41')](_0x3d209f[_0x46a3('0x3d')],{'$or':_[_0x46a3('0x2d')](_0x3d209f[_0x46a3('0x37')],function(_0x938993){var _0x30d34e={};_0x30d34e[_0x938993]={'$like':'%'+_0x25ad40[_0x46a3('0x34')][_0x46a3('0x40')]+'%'};return _0x30d34e;})});}_0x3d209f=_[_0x46a3('0x41')]({},_0x3d209f,_0x25ad40[_0x46a3('0x49')]);return _0x4a11c5[_0x46a3('0x4d')](_0x3d209f);}})['then'](function(_0x2ce79f){if(_0x2ce79f){_0x5b06d0=_0x2ce79f[_0x46a3('0x39')];if(!_0x25ad40[_0x46a3('0x34')][_0x46a3('0x3a')](_0x46a3('0x50'))){_0x3d209f[_0x46a3('0x1f')]=qs[_0x46a3('0x1f')](_0x25ad40[_0x46a3('0x34')][_0x46a3('0x1f')]);_0x3d209f[_0x46a3('0x1e')]=qs[_0x46a3('0x1e')](_0x25ad40[_0x46a3('0x34')][_0x46a3('0x1e')]);}return _0x4a11c5[_0x46a3('0x4d')](_0x3d209f);}})[_0x46a3('0x27')](function(_0x1ce0f8){if(_0x1ce0f8){return _0x1ce0f8?{'count':_0x5b06d0,'rows':_0x1ce0f8}:null;}})[_0x46a3('0x27')](respondWithResult(_0x218614,null))['catch'](handleError(_0x218614,null));};exports[_0x46a3('0x51')]=function(_0x42fbad,_0x476b6d,_0x3057b4){var _0x1ff2aa={};var _0x1f4b36={};var _0x4cb0a1;var _0x2f3338;return db[_0x46a3('0x2e')][_0x46a3('0x4e')]({'where':{'id':_0x42fbad['params']['id']}})['then'](handleEntityNotFound(_0x476b6d,null))[_0x46a3('0x27')](function(_0xdd64ce){if(_0xdd64ce){_0x4cb0a1=_0xdd64ce;_0x1f4b36[_0x46a3('0x33')]=_[_0x46a3('0x35')](db['DeskField']['rawAttributes']);_0x1f4b36[_0x46a3('0x34')]=_[_0x46a3('0x35')](_0x42fbad[_0x46a3('0x34')]);_0x1f4b36['filters']=_['intersection'](_0x1f4b36['model'],_0x1f4b36[_0x46a3('0x34')]);_0x1ff2aa[_0x46a3('0x37')]=_['intersection'](_0x1f4b36[_0x46a3('0x33')],qs['fields'](_0x42fbad[_0x46a3('0x34')][_0x46a3('0x38')]));_0x1ff2aa[_0x46a3('0x37')]=_0x1ff2aa[_0x46a3('0x37')][_0x46a3('0x39')]?_0x1ff2aa['attributes']:_0x1f4b36[_0x46a3('0x33')];_0x1ff2aa[_0x46a3('0x3b')]=qs[_0x46a3('0x3c')](_0x42fbad['query'][_0x46a3('0x3c')]);_0x1ff2aa['where']=qs['filters'](_[_0x46a3('0x3f')](_0x42fbad[_0x46a3('0x34')],_0x1f4b36[_0x46a3('0x3e')]));if(_0x42fbad[_0x46a3('0x34')]['filter']){_0x1ff2aa[_0x46a3('0x3d')]=_[_0x46a3('0x41')](_0x1ff2aa[_0x46a3('0x3d')],{'$or':_[_0x46a3('0x2d')](_0x1ff2aa['attributes'],function(_0x40eda2){var _0x2c7cdb={};_0x2c7cdb[_0x40eda2]={'$like':'%'+_0x42fbad[_0x46a3('0x34')][_0x46a3('0x40')]+'%'};return _0x2c7cdb;})});}_0x1ff2aa=_[_0x46a3('0x41')]({},_0x1ff2aa,_0x42fbad[_0x46a3('0x49')]);return _0x4cb0a1[_0x46a3('0x51')](_0x1ff2aa);}})[_0x46a3('0x27')](function(_0xaca353){if(_0xaca353){_0x2f3338=_0xaca353[_0x46a3('0x39')];if(!_0x42fbad['query']['hasOwnProperty'](_0x46a3('0x50'))){_0x1ff2aa[_0x46a3('0x1f')]=qs['limit'](_0x42fbad[_0x46a3('0x34')]['limit']);_0x1ff2aa[_0x46a3('0x1e')]=qs[_0x46a3('0x1e')](_0x42fbad[_0x46a3('0x34')][_0x46a3('0x1e')]);}return _0x4cb0a1[_0x46a3('0x51')](_0x1ff2aa);}})[_0x46a3('0x27')](function(_0x59cf58){if(_0x59cf58){return _0x59cf58?{'count':_0x2f3338,'rows':_0x59cf58}:null;}})[_0x46a3('0x27')](respondWithResult(_0x476b6d,null))[_0x46a3('0x46')](handleError(_0x476b6d,null));};exports[_0x46a3('0x52')]=function(_0x2974bf,_0x5a21f4,_0x297dcd){var _0xe113c4={};var _0x13f5d1={};var _0x284f46;var _0x41236d;return db[_0x46a3('0x2e')]['findOne']({'where':{'id':_0x2974bf[_0x46a3('0x48')]['id']}})[_0x46a3('0x27')](handleEntityNotFound(_0x5a21f4,null))[_0x46a3('0x27')](function(_0x51bd77){if(_0x51bd77){_0x284f46=_0x51bd77;_0x13f5d1[_0x46a3('0x33')]=_[_0x46a3('0x35')](db[_0x46a3('0x4f')][_0x46a3('0x2f')]);_0x13f5d1[_0x46a3('0x34')]=_[_0x46a3('0x35')](_0x2974bf[_0x46a3('0x34')]);_0x13f5d1[_0x46a3('0x3e')]=_[_0x46a3('0x36')](_0x13f5d1[_0x46a3('0x33')],_0x13f5d1[_0x46a3('0x34')]);_0xe113c4[_0x46a3('0x37')]=_[_0x46a3('0x36')](_0x13f5d1[_0x46a3('0x33')],qs[_0x46a3('0x38')](_0x2974bf['query']['fields']));_0xe113c4[_0x46a3('0x37')]=_0xe113c4[_0x46a3('0x37')][_0x46a3('0x39')]?_0xe113c4['attributes']:_0x13f5d1['model'];_0xe113c4[_0x46a3('0x3b')]=qs[_0x46a3('0x3c')](_0x2974bf[_0x46a3('0x34')]['sort']);_0xe113c4['where']=qs[_0x46a3('0x3e')](_[_0x46a3('0x3f')](_0x2974bf['query'],_0x13f5d1[_0x46a3('0x3e')]));if(_0x2974bf[_0x46a3('0x34')][_0x46a3('0x40')]){_0xe113c4[_0x46a3('0x3d')]=_[_0x46a3('0x41')](_0xe113c4[_0x46a3('0x3d')],{'$or':_[_0x46a3('0x2d')](_0xe113c4[_0x46a3('0x37')],function(_0x563943){var _0x224f64={};_0x224f64[_0x563943]={'$like':'%'+_0x2974bf['query']['filter']+'%'};return _0x224f64;})});}_0xe113c4=_[_0x46a3('0x41')]({},_0xe113c4,_0x2974bf['options']);return _0x284f46[_0x46a3('0x52')](_0xe113c4);}})[_0x46a3('0x27')](function(_0x4111dd){if(_0x4111dd){_0x41236d=_0x4111dd[_0x46a3('0x39')];if(!_0x2974bf[_0x46a3('0x34')][_0x46a3('0x3a')]('nolimit')){_0xe113c4[_0x46a3('0x1f')]=qs['limit'](_0x2974bf[_0x46a3('0x34')][_0x46a3('0x1f')]);_0xe113c4['offset']=qs[_0x46a3('0x1e')](_0x2974bf['query']['offset']);}return _0x284f46[_0x46a3('0x52')](_0xe113c4);}})[_0x46a3('0x27')](function(_0x381e49){if(_0x381e49){return _0x381e49?{'count':_0x41236d,'rows':_0x381e49}:null;}})[_0x46a3('0x27')](respondWithResult(_0x5a21f4,null))['catch'](handleError(_0x5a21f4,null));};exports[_0x46a3('0x53')]=function(_0x27a634,_0x4da299,_0x27103d){var _0xd6753a={};var _0xd0385={};var _0x3e23e9;var _0x39e45e;return db['DeskConfiguration'][_0x46a3('0x4e')]({'where':{'id':_0x27a634[_0x46a3('0x48')]['id']}})[_0x46a3('0x27')](handleEntityNotFound(_0x4da299,null))['then'](function(_0x1b8e8f){if(_0x1b8e8f){_0x3e23e9=_0x1b8e8f;_0xd0385['model']=_[_0x46a3('0x35')](db['Tag'][_0x46a3('0x2f')]);_0xd0385[_0x46a3('0x34')]=_[_0x46a3('0x35')](_0x27a634[_0x46a3('0x34')]);_0xd0385[_0x46a3('0x3e')]=_[_0x46a3('0x36')](_0xd0385[_0x46a3('0x33')],_0xd0385[_0x46a3('0x34')]);_0xd6753a[_0x46a3('0x37')]=_[_0x46a3('0x36')](_0xd0385[_0x46a3('0x33')],qs[_0x46a3('0x38')](_0x27a634[_0x46a3('0x34')][_0x46a3('0x38')]));_0xd6753a[_0x46a3('0x37')]=_0xd6753a[_0x46a3('0x37')][_0x46a3('0x39')]?_0xd6753a[_0x46a3('0x37')]:_0xd0385[_0x46a3('0x33')];_0xd6753a['order']=qs[_0x46a3('0x3c')](_0x27a634[_0x46a3('0x34')][_0x46a3('0x3c')]);_0xd6753a[_0x46a3('0x3d')]=qs[_0x46a3('0x3e')](_[_0x46a3('0x3f')](_0x27a634['query'],_0xd0385[_0x46a3('0x3e')]));if(_0x27a634[_0x46a3('0x34')]['filter']){_0xd6753a[_0x46a3('0x3d')]=_['merge'](_0xd6753a[_0x46a3('0x3d')],{'$or':_['map'](_0xd6753a[_0x46a3('0x37')],function(_0x13e678){var _0x4a06e6={};_0x4a06e6[_0x13e678]={'$like':'%'+_0x27a634[_0x46a3('0x34')][_0x46a3('0x40')]+'%'};return _0x4a06e6;})});}_0xd6753a=_[_0x46a3('0x41')]({},_0xd6753a,_0x27a634[_0x46a3('0x49')]);return _0x3e23e9[_0x46a3('0x53')](_0xd6753a);}})[_0x46a3('0x27')](function(_0x5bb03f){if(_0x5bb03f){_0x39e45e=_0x5bb03f[_0x46a3('0x39')];if(!_0x27a634[_0x46a3('0x34')][_0x46a3('0x3a')](_0x46a3('0x50'))){_0xd6753a[_0x46a3('0x1f')]=qs[_0x46a3('0x1f')](_0x27a634['query'][_0x46a3('0x1f')]);_0xd6753a['offset']=qs['offset'](_0x27a634[_0x46a3('0x34')][_0x46a3('0x1e')]);}return _0x3e23e9[_0x46a3('0x53')](_0xd6753a);}})[_0x46a3('0x27')](function(_0x337893){if(_0x337893){return _0x337893?{'count':_0x39e45e,'rows':_0x337893}:null;}})[_0x46a3('0x27')](respondWithResult(_0x4da299,null))[_0x46a3('0x46')](handleError(_0x4da299,null));};exports['setTags']=function(_0x225dbe,_0x2212ad,_0x598283){if(_0x225dbe['body']['id']){delete _0x225dbe[_0x46a3('0x4c')]['id'];}return db[_0x46a3('0x2e')][_0x46a3('0x4e')]({'where':{'id':_0x225dbe[_0x46a3('0x48')]['id']}})[_0x46a3('0x27')](handleEntityNotFound(_0x2212ad,null))[_0x46a3('0x27')](function(_0x8129ff){if(_0x8129ff){return _0x8129ff[_0x46a3('0x54')](_0x225dbe[_0x46a3('0x4c')]['ids']||[]);}return null;})[_0x46a3('0x27')](respondWithResult(_0x2212ad,null))[_0x46a3('0x46')](handleError(_0x2212ad,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index b4daffa..799732a 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 _0x6de9=['util','../../config/logger','api','moment','request-promise','path','../../config/environment','./intDeskConfiguration.attributes','define','DeskConfiguration','lodash'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x6de9,0xe6));var _0x96de=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x6de9[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x96de('0x0'));var util=require(_0x96de('0x1'));var logger=require(_0x96de('0x2'))(_0x96de('0x3'));var moment=require(_0x96de('0x4'));var BPromise=require('bluebird');var rp=require(_0x96de('0x5'));var fs=require('fs');var path=require(_0x96de('0x6'));var rimraf=require('rimraf');var config=require(_0x96de('0x7'));var attributes=require(_0x96de('0x8'));module['exports']=function(_0x84f9b0,_0x24da4e){return _0x84f9b0[_0x96de('0x9')](_0x96de('0xa'),attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8a4e=['request-promise','path','rimraf','../../config/environment','./intDeskConfiguration.attributes','define','DeskConfiguration','int_desk_configurations','util','api','moment','bluebird'];(function(_0x5daea3,_0x37dfce){var _0x47e381=function(_0x4da5b3){while(--_0x4da5b3){_0x5daea3['push'](_0x5daea3['shift']());}};_0x47e381(++_0x37dfce);}(_0x8a4e,0xbc));var _0xe8a4=function(_0x8cb592,_0x1d250d){_0x8cb592=_0x8cb592-0x0;var _0x108d23=_0x8a4e[_0x8cb592];return _0x108d23;};'use strict';var _=require('lodash');var util=require(_0xe8a4('0x0'));var logger=require('../../config/logger')(_0xe8a4('0x1'));var moment=require(_0xe8a4('0x2'));var BPromise=require(_0xe8a4('0x3'));var rp=require(_0xe8a4('0x4'));var fs=require('fs');var path=require(_0xe8a4('0x5'));var rimraf=require(_0xe8a4('0x6'));var config=require(_0xe8a4('0x7'));var attributes=require(_0xe8a4('0x8'));module['exports']=function(_0x458ce5,_0x4582f1){return _0x458ce5[_0xe8a4('0x9')](_0xe8a4('0xa'),attributes,{'tableName':_0xe8a4('0xb'),'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 467f132..5ab67a6 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 _0xaf97=['request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','DeskConfiguration,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0x367e5b,_0x5721e4){var _0x4b909e=function(_0x22c6a4){while(--_0x22c6a4){_0x367e5b['push'](_0x367e5b['shift']());}};_0x4b909e(++_0x5721e4);}(_0xaf97,0x15a));var _0x7af9=function(_0x410d5e,_0x5e9946){_0x410d5e=_0x410d5e-0x0;var _0xac4e89=_0xaf97[_0x410d5e];return _0xac4e89;};'use strict';var _=require(_0x7af9('0x0'));var util=require(_0x7af9('0x1'));var moment=require(_0x7af9('0x2'));var BPromise=require(_0x7af9('0x3'));var rs=require(_0x7af9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7af9('0x5'))['db'];var utils=require(_0x7af9('0x6'));var logger=require(_0x7af9('0x7'))(_0x7af9('0x8'));var config=require('../../config/environment');var jayson=require(_0x7af9('0x9'));var client=jayson[_0x7af9('0xa')][_0x7af9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x369746,_0x5c98b8,_0x1e9ccc){return new BPromise(function(_0x2055c2,_0x2963b7){return client[_0x7af9('0xc')](_0x369746,_0x1e9ccc)[_0x7af9('0xd')](function(_0x44867d){logger['info']('DeskConfiguration,\x20%s,\x20%s',_0x5c98b8,_0x7af9('0xe'));logger[_0x7af9('0xf')](_0x7af9('0x10'),_0x5c98b8,'request\x20sent',JSON[_0x7af9('0x11')](_0x44867d));if(_0x44867d[_0x7af9('0x12')]){if(_0x44867d[_0x7af9('0x12')]['code']===0x1f4){logger[_0x7af9('0x12')](_0x7af9('0x13'),_0x5c98b8,_0x44867d[_0x7af9('0x12')][_0x7af9('0x14')]);return _0x2963b7(_0x44867d[_0x7af9('0x12')]['message']);}logger[_0x7af9('0x12')](_0x7af9('0x13'),_0x5c98b8,_0x44867d[_0x7af9('0x12')][_0x7af9('0x14')]);return _0x2055c2(_0x44867d['error'][_0x7af9('0x14')]);}else{logger[_0x7af9('0x15')](_0x7af9('0x13'),_0x5c98b8,_0x7af9('0xe'));_0x2055c2(_0x44867d[_0x7af9('0x16')][_0x7af9('0x14')]);}})[_0x7af9('0x17')](function(_0x238814){logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x5c98b8,_0x238814);_0x2963b7(_0x238814);});});} \ No newline at end of file +var _0xabf9=['request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','DeskConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0xabf9,0x1e4));var _0x9abf=function(_0x2adf93,_0x1b1baa){_0x2adf93=_0x2adf93-0x0;var _0x4a8be9=_0xabf9[_0x2adf93];return _0x4a8be9;};'use strict';var _=require(_0x9abf('0x0'));var util=require(_0x9abf('0x1'));var moment=require(_0x9abf('0x2'));var BPromise=require(_0x9abf('0x3'));var rs=require(_0x9abf('0x4'));var fs=require('fs');var Redis=require(_0x9abf('0x5'));var db=require(_0x9abf('0x6'))['db'];var utils=require(_0x9abf('0x7'));var logger=require(_0x9abf('0x8'))(_0x9abf('0x9'));var config=require(_0x9abf('0xa'));var jayson=require(_0x9abf('0xb'));var client=jayson[_0x9abf('0xc')][_0x9abf('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x309081,_0x239186,_0x2f6730){return new BPromise(function(_0x5b9dc8,_0x21d73f){return client['request'](_0x309081,_0x2f6730)[_0x9abf('0xe')](function(_0x59ccd0){logger[_0x9abf('0xf')]('DeskConfiguration,\x20%s,\x20%s',_0x239186,_0x9abf('0x10'));logger[_0x9abf('0x11')](_0x9abf('0x12'),_0x239186,_0x9abf('0x10'),JSON[_0x9abf('0x13')](_0x59ccd0));if(_0x59ccd0[_0x9abf('0x14')]){if(_0x59ccd0[_0x9abf('0x14')]['code']===0x1f4){logger[_0x9abf('0x14')](_0x9abf('0x15'),_0x239186,_0x59ccd0[_0x9abf('0x14')]['message']);return _0x21d73f(_0x59ccd0[_0x9abf('0x14')][_0x9abf('0x16')]);}logger[_0x9abf('0x14')](_0x9abf('0x15'),_0x239186,_0x59ccd0[_0x9abf('0x14')][_0x9abf('0x16')]);return _0x5b9dc8(_0x59ccd0['error'][_0x9abf('0x16')]);}else{logger[_0x9abf('0xf')]('DeskConfiguration,\x20%s,\x20%s',_0x239186,_0x9abf('0x10'));_0x5b9dc8(_0x59ccd0[_0x9abf('0x17')]['message']);}})[_0x9abf('0x18')](function(_0x3268ae){logger[_0x9abf('0x14')](_0x9abf('0x15'),_0x239186,_0x3268ae);_0x21d73f(_0x3268ae);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 70f8761..fc5bf85 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 _0x6333=['get','isAuthenticated','/:id','show','create','put','update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller'];(function(_0x3ae96c,_0x5f1e7e){var _0x1b0c90=function(_0x1ecc83){while(--_0x1ecc83){_0x3ae96c['push'](_0x3ae96c['shift']());}};_0x1b0c90(++_0x5f1e7e);}(_0x6333,0x185));var _0x3633=function(_0x5de3ed,_0x3ae98f){_0x5de3ed=_0x5de3ed-0x0;var _0x5d2a2c=_0x6333[_0x5de3ed];return _0x5d2a2c;};'use strict';var multer=require(_0x3633('0x0'));var util=require(_0x3633('0x1'));var path=require(_0x3633('0x2'));var timeout=require('connect-timeout');var express=require(_0x3633('0x3'));var router=express[_0x3633('0x4')]();var fs_extra=require(_0x3633('0x5'));var auth=require(_0x3633('0x6'));var interaction=require(_0x3633('0x7'));var config=require(_0x3633('0x8'));var controller=require(_0x3633('0x9'));router[_0x3633('0xa')]('/',auth[_0x3633('0xb')](),controller['index']);router[_0x3633('0xa')](_0x3633('0xc'),auth['isAuthenticated'](),controller[_0x3633('0xd')]);router['post']('/',auth[_0x3633('0xb')](),controller[_0x3633('0xe')]);router[_0x3633('0xf')](_0x3633('0xc'),auth['isAuthenticated'](),controller[_0x3633('0x10')]);router[_0x3633('0x11')](_0x3633('0xc'),auth['isAuthenticated'](),controller[_0x3633('0x12')]);module['exports']=router; \ No newline at end of file +var _0xd755=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskField.controller','get','isAuthenticated','index','/:id','show','create'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0xd755,0x109));var _0x5d75=function(_0xe22435,_0x27157f){_0xe22435=_0xe22435-0x0;var _0x4fa237=_0xd755[_0xe22435];return _0x4fa237;};'use strict';var multer=require(_0x5d75('0x0'));var util=require(_0x5d75('0x1'));var path=require(_0x5d75('0x2'));var timeout=require(_0x5d75('0x3'));var express=require('express');var router=express[_0x5d75('0x4')]();var fs_extra=require(_0x5d75('0x5'));var auth=require(_0x5d75('0x6'));var interaction=require(_0x5d75('0x7'));var config=require('../../config/environment');var controller=require(_0x5d75('0x8'));router[_0x5d75('0x9')]('/',auth[_0x5d75('0xa')](),controller[_0x5d75('0xb')]);router[_0x5d75('0x9')](_0x5d75('0xc'),auth['isAuthenticated'](),controller[_0x5d75('0xd')]);router['post']('/',auth[_0x5d75('0xa')](),controller[_0x5d75('0xe')]);router[_0x5d75('0xf')](_0x5d75('0xc'),auth['isAuthenticated'](),controller[_0x5d75('0x10')]);router[_0x5d75('0x11')](_0x5d75('0xc'),auth[_0x5d75('0xa')](),controller[_0x5d75('0x12')]);module[_0x5d75('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 5cb7b00..29b9565 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 _0x5dcc=['exports','string','variable','keyValue','STRING','BOOLEAN'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x5dcc,0x1b0));var _0xc5dc=function(_0x2bb53e,_0x535eff){_0x2bb53e=_0x2bb53e-0x0;var _0x57f74b=_0x5dcc[_0x2bb53e];return _0x57f74b;};'use strict';var Sequelize=require('sequelize');module[_0xc5dc('0x0')]={'type':{'type':Sequelize['ENUM'](_0xc5dc('0x1'),_0xc5dc('0x2'),'customVariable',_0xc5dc('0x3'),'picklist'),'defaultValue':_0xc5dc('0x1')},'content':{'type':Sequelize[_0xc5dc('0x4')]},'key':{'type':Sequelize[_0xc5dc('0x4')]},'keyType':{'type':Sequelize['ENUM'](_0xc5dc('0x1'),'variable','customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xc5dc('0x4')]},'customField':{'type':Sequelize[_0xc5dc('0x5')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc5dc('0x4')]}}; \ No newline at end of file +var _0x008b=['customVariable','keyValue','picklist','string','STRING','BOOLEAN','sequelize','exports','ENUM','variable'];(function(_0x545614,_0x8eb091){var _0x3d21a8=function(_0x2a90ff){while(--_0x2a90ff){_0x545614['push'](_0x545614['shift']());}};_0x3d21a8(++_0x8eb091);}(_0x008b,0x11e));var _0xb008=function(_0x5cf82,_0x9bc857){_0x5cf82=_0x5cf82-0x0;var _0x48f983=_0x008b[_0x5cf82];return _0x48f983;};'use strict';var Sequelize=require(_0xb008('0x0'));module[_0xb008('0x1')]={'type':{'type':Sequelize[_0xb008('0x2')]('string',_0xb008('0x3'),_0xb008('0x4'),_0xb008('0x5'),_0xb008('0x6')),'defaultValue':_0xb008('0x7')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xb008('0x2')](_0xb008('0x7'),_0xb008('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0xb008('0x8')]},'idField':{'type':Sequelize[_0xb008('0x8')]},'nameField':{'type':Sequelize[_0xb008('0x8')]},'customField':{'type':Sequelize[_0xb008('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb008('0x8')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index bbb793e..394e435 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 _0x83d0=['sendStatus','stack','name','send','index','map','DeskField','rawAttributes','fieldName','key','model','query','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','show','keys','filters','fields','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','undefined','count','offset','limit','set','apply','reject','update','then','destroy'];(function(_0x1bdf2a,_0x27dd26){var _0x1703ae=function(_0x4f06f8){while(--_0x4f06f8){_0x1bdf2a['push'](_0x1bdf2a['shift']());}};_0x1703ae(++_0x27dd26);}(_0x83d0,0xb7));var _0x083d=function(_0x253b3c,_0x159c39){_0x253b3c=_0x253b3c-0x0;var _0x56c104=_0x83d0[_0x253b3c];return _0x56c104;};'use strict';var emlformat=require(_0x083d('0x0'));var rimraf=require(_0x083d('0x1'));var zipdir=require(_0x083d('0x2'));var jsonpatch=require(_0x083d('0x3'));var rp=require(_0x083d('0x4'));var moment=require(_0x083d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x083d('0x6'));var util=require('util');var path=require('path');var sox=require(_0x083d('0x7'));var csv=require(_0x083d('0x8'));var ejs=require(_0x083d('0x9'));var fs=require('fs');var fs_extra=require(_0x083d('0xa'));var _=require(_0x083d('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x083d('0xc'));var deskjs=require(_0x083d('0xd'));var toCsv=require(_0x083d('0x8'));var querystring=require('querystring');var Papa=require(_0x083d('0xe'));var Redis=require(_0x083d('0xf'));var authService=require(_0x083d('0x10'));var qs=require(_0x083d('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x083d('0x12'));var logger=require('../../config/logger')(_0x083d('0x13'));var utils=require(_0x083d('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x083d('0x15'));var db=require(_0x083d('0x16'))['db'];function respondWithStatusCode(_0x23ccf2,_0x3e5be5){_0x3e5be5=_0x3e5be5||0xcc;return function(_0x3dfe4a){if(_0x3dfe4a){return _0x23ccf2['sendStatus'](_0x3e5be5);}return _0x23ccf2[_0x083d('0x17')](_0x3e5be5)[_0x083d('0x18')]();};}function respondWithResult(_0x4ee93c,_0x11c03f){_0x11c03f=_0x11c03f||0xc8;return function(_0x525a36){if(_0x525a36){return _0x4ee93c['status'](_0x11c03f)[_0x083d('0x19')](_0x525a36);}};}function respondWithFilteredResult(_0x3c95fe,_0x356d8e){return function(_0x20ca5f){if(_0x20ca5f){var _0x381455=typeof _0x356d8e['offset']===_0x083d('0x1a')&&typeof _0x356d8e['limit']===_0x083d('0x1a');var _0x28893f=_0x20ca5f[_0x083d('0x1b')];var _0xb34759=_0x381455?0x0:_0x356d8e[_0x083d('0x1c')];var _0x63c0b6=_0x381455?_0x20ca5f[_0x083d('0x1b')]:_0x356d8e[_0x083d('0x1c')]+_0x356d8e[_0x083d('0x1d')];var _0x2cb79c;if(_0x63c0b6>=_0x28893f){_0x63c0b6=_0x28893f;_0x2cb79c=0xc8;}else{_0x2cb79c=0xce;}_0x3c95fe[_0x083d('0x17')](_0x2cb79c);return _0x3c95fe[_0x083d('0x1e')]('Content-Range',_0xb34759+'-'+_0x63c0b6+'/'+_0x28893f)[_0x083d('0x19')](_0x20ca5f);}return null;};}function patchUpdates(_0x56d7f2){return function(_0x21ac51){try{jsonpatch[_0x083d('0x1f')](_0x21ac51,_0x56d7f2,!![]);}catch(_0x48bf68){return BPromise[_0x083d('0x20')](_0x48bf68);}return _0x21ac51['save']();};}function saveUpdates(_0x4efbea,_0x59828a){return function(_0xcde93c){if(_0xcde93c){return _0xcde93c[_0x083d('0x21')](_0x4efbea)[_0x083d('0x22')](function(_0x2669b6){return _0x2669b6;});}return null;};}function removeEntity(_0x1045c5,_0x1b2e65){return function(_0x5d8397){if(_0x5d8397){return _0x5d8397[_0x083d('0x23')]()[_0x083d('0x22')](function(){_0x1045c5['status'](0xcc)[_0x083d('0x18')]();});}};}function handleEntityNotFound(_0x38ca23,_0x33d32a){return function(_0x3117af){if(!_0x3117af){_0x38ca23[_0x083d('0x24')](0x194);}return _0x3117af;};}function handleError(_0x2ff697,_0x9bc640){_0x9bc640=_0x9bc640||0x1f4;return function(_0x3923ff){logger['error'](_0x3923ff[_0x083d('0x25')]);if(_0x3923ff['name']){delete _0x3923ff[_0x083d('0x26')];}_0x2ff697[_0x083d('0x17')](_0x9bc640)[_0x083d('0x27')](_0x3923ff);};}exports[_0x083d('0x28')]=function(_0x3e59d0,_0x13c376){var _0x2b4825={},_0xfbe79b={},_0x205e0c={'count':0x0,'rows':[]};var _0x3f41a4=_[_0x083d('0x29')](db[_0x083d('0x2a')][_0x083d('0x2b')],function(_0x2c7223){return{'name':_0x2c7223[_0x083d('0x2c')],'type':_0x2c7223['type'][_0x083d('0x2d')]};});_0xfbe79b[_0x083d('0x2e')]=_['map'](_0x3f41a4,'name');_0xfbe79b[_0x083d('0x2f')]=_['keys'](_0x3e59d0[_0x083d('0x2f')]);_0xfbe79b['filters']=_[_0x083d('0x30')](_0xfbe79b['model'],_0xfbe79b[_0x083d('0x2f')]);_0x2b4825[_0x083d('0x31')]=_[_0x083d('0x30')](_0xfbe79b['model'],qs['fields'](_0x3e59d0[_0x083d('0x2f')]['fields']));_0x2b4825[_0x083d('0x31')]=_0x2b4825[_0x083d('0x31')][_0x083d('0x32')]?_0x2b4825[_0x083d('0x31')]:_0xfbe79b['model'];if(!_0x3e59d0[_0x083d('0x2f')][_0x083d('0x33')](_0x083d('0x34'))){_0x2b4825[_0x083d('0x1d')]=qs['limit'](_0x3e59d0[_0x083d('0x2f')][_0x083d('0x1d')]);_0x2b4825[_0x083d('0x1c')]=qs[_0x083d('0x1c')](_0x3e59d0['query']['offset']);}_0x2b4825[_0x083d('0x35')]=qs[_0x083d('0x36')](_0x3e59d0[_0x083d('0x2f')][_0x083d('0x36')]);_0x2b4825[_0x083d('0x37')]=qs['filters'](_[_0x083d('0x38')](_0x3e59d0[_0x083d('0x2f')],_0xfbe79b['filters']),_0x3f41a4);if(_0x3e59d0[_0x083d('0x2f')]['filter']){_0x2b4825['where']=_[_0x083d('0x39')](_0x2b4825[_0x083d('0x37')],{'$or':_['map'](_0x3f41a4,function(_0x32e179){if(_0x32e179[_0x083d('0x3a')]!==_0x083d('0x3b')){var _0x594327={};_0x594327[_0x32e179['name']]={'$like':'%'+_0x3e59d0['query']['filter']+'%'};return _0x594327;}})});}_0x2b4825=_[_0x083d('0x39')]({},_0x2b4825,_0x3e59d0[_0x083d('0x3c')]);var _0x2c8196={'where':_0x2b4825[_0x083d('0x37')]};return db['DeskField'][_0x083d('0x1b')](_0x2c8196)[_0x083d('0x22')](function(_0x5706d1){_0x205e0c[_0x083d('0x1b')]=_0x5706d1;if(_0x3e59d0[_0x083d('0x2f')][_0x083d('0x3d')]){_0x2b4825[_0x083d('0x3e')]=[{'all':!![]}];}return db[_0x083d('0x2a')][_0x083d('0x3f')](_0x2b4825);})[_0x083d('0x22')](function(_0x30b913){_0x205e0c['rows']=_0x30b913;return _0x205e0c;})[_0x083d('0x22')](respondWithFilteredResult(_0x13c376,_0x2b4825))[_0x083d('0x40')](handleError(_0x13c376,null));};exports[_0x083d('0x41')]=function(_0x19302d,_0x2fd7cb){var _0x3cf0fb={'raw':!![],'where':{'id':_0x19302d['params']['id']}},_0x11b872={};_0x11b872[_0x083d('0x2e')]=_[_0x083d('0x42')](db['DeskField'][_0x083d('0x2b')]);_0x11b872[_0x083d('0x2f')]=_[_0x083d('0x42')](_0x19302d[_0x083d('0x2f')]);_0x11b872[_0x083d('0x43')]=_['intersection'](_0x11b872[_0x083d('0x2e')],_0x11b872[_0x083d('0x2f')]);_0x3cf0fb[_0x083d('0x31')]=_[_0x083d('0x30')](_0x11b872[_0x083d('0x2e')],qs['fields'](_0x19302d[_0x083d('0x2f')][_0x083d('0x44')]));_0x3cf0fb[_0x083d('0x31')]=_0x3cf0fb[_0x083d('0x31')][_0x083d('0x32')]?_0x3cf0fb[_0x083d('0x31')]:_0x11b872['model'];if(_0x19302d[_0x083d('0x2f')][_0x083d('0x3d')]){_0x3cf0fb[_0x083d('0x3e')]=[{'all':!![]}];}_0x3cf0fb=_[_0x083d('0x39')]({},_0x3cf0fb,_0x19302d[_0x083d('0x3c')]);return db[_0x083d('0x2a')][_0x083d('0x45')](_0x3cf0fb)['then'](handleEntityNotFound(_0x2fd7cb,null))['then'](respondWithResult(_0x2fd7cb,null))['catch'](handleError(_0x2fd7cb,null));};exports[_0x083d('0x46')]=function(_0x509b72,_0x4268bc){return db[_0x083d('0x2a')][_0x083d('0x46')](_0x509b72[_0x083d('0x47')],{})['then'](respondWithResult(_0x4268bc,0xc9))[_0x083d('0x40')](handleError(_0x4268bc,null));};exports[_0x083d('0x21')]=function(_0x2b0f33,_0x235998){if(_0x2b0f33[_0x083d('0x47')]['id']){delete _0x2b0f33['body']['id'];}return db['DeskField']['find']({'where':{'id':_0x2b0f33[_0x083d('0x48')]['id']}})[_0x083d('0x22')](handleEntityNotFound(_0x235998,null))[_0x083d('0x22')](saveUpdates(_0x2b0f33[_0x083d('0x47')],null))[_0x083d('0x22')](respondWithResult(_0x235998,null))[_0x083d('0x40')](handleError(_0x235998,null));};exports[_0x083d('0x23')]=function(_0x6c2794,_0x35252d){return db['DeskField']['find']({'where':{'id':_0x6c2794[_0x083d('0x48')]['id']}})['then'](handleEntityNotFound(_0x35252d,null))[_0x083d('0x22')](removeEntity(_0x35252d,null))[_0x083d('0x40')](handleError(_0x35252d,null));}; \ No newline at end of file +var _0xd185=['request-promise','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','fieldName','type','key','query','keys','filters','model','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','DeskField','includeAll','include','rows','catch','params','rawAttributes','length','options','find','create','body','eml-format','fast-json-patch'];(function(_0x2b1ebd,_0x147df3){var _0x1c56d4=function(_0x35c548){while(--_0x35c548){_0x2b1ebd['push'](_0x2b1ebd['shift']());}};_0x1c56d4(++_0x147df3);}(_0xd185,0x92));var _0x5d18=function(_0x4a22d5,_0x5b4987){_0x4a22d5=_0x4a22d5-0x0;var _0x1d0792=_0xd185[_0x4a22d5];return _0x1d0792;};'use strict';var emlformat=require(_0x5d18('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5d18('0x1'));var rp=require(_0x5d18('0x2'));var moment=require('moment');var BPromise=require(_0x5d18('0x3'));var Mustache=require(_0x5d18('0x4'));var util=require(_0x5d18('0x5'));var path=require(_0x5d18('0x6'));var sox=require(_0x5d18('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5d18('0x8'));var _=require(_0x5d18('0x9'));var squel=require(_0x5d18('0xa'));var crypto=require(_0x5d18('0xb'));var jsforce=require(_0x5d18('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5d18('0xd'));var Papa=require('papaparse');var Redis=require(_0x5d18('0xe'));var authService=require(_0x5d18('0xf'));var qs=require(_0x5d18('0x10'));var as=require(_0x5d18('0x11'));var hardwareService=require(_0x5d18('0x12'));var logger=require(_0x5d18('0x13'))(_0x5d18('0x14'));var utils=require(_0x5d18('0x15'));var config=require(_0x5d18('0x16'));var licenseUtil=require(_0x5d18('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x58a1fe,_0x4a73d1){_0x4a73d1=_0x4a73d1||0xcc;return function(_0x21c913){if(_0x21c913){return _0x58a1fe[_0x5d18('0x18')](_0x4a73d1);}return _0x58a1fe[_0x5d18('0x19')](_0x4a73d1)[_0x5d18('0x1a')]();};}function respondWithResult(_0x1fe54a,_0x37216c){_0x37216c=_0x37216c||0xc8;return function(_0x35a869){if(_0x35a869){return _0x1fe54a['status'](_0x37216c)[_0x5d18('0x1b')](_0x35a869);}};}function respondWithFilteredResult(_0x7f6e05,_0x535b9f){return function(_0x1fcc3b){if(_0x1fcc3b){var _0x380c86=typeof _0x535b9f[_0x5d18('0x1c')]==='undefined'&&typeof _0x535b9f[_0x5d18('0x1d')]===_0x5d18('0x1e');var _0x23770=_0x1fcc3b[_0x5d18('0x1f')];var _0x5de643=_0x380c86?0x0:_0x535b9f[_0x5d18('0x1c')];var _0x4e01f2=_0x380c86?_0x1fcc3b[_0x5d18('0x1f')]:_0x535b9f[_0x5d18('0x1c')]+_0x535b9f[_0x5d18('0x1d')];var _0x51fbd2;if(_0x4e01f2>=_0x23770){_0x4e01f2=_0x23770;_0x51fbd2=0xc8;}else{_0x51fbd2=0xce;}_0x7f6e05['status'](_0x51fbd2);return _0x7f6e05[_0x5d18('0x20')](_0x5d18('0x21'),_0x5de643+'-'+_0x4e01f2+'/'+_0x23770)[_0x5d18('0x1b')](_0x1fcc3b);}return null;};}function patchUpdates(_0xd7513d){return function(_0x1e5a26){try{jsonpatch[_0x5d18('0x22')](_0x1e5a26,_0xd7513d,!![]);}catch(_0x2a6354){return BPromise[_0x5d18('0x23')](_0x2a6354);}return _0x1e5a26[_0x5d18('0x24')]();};}function saveUpdates(_0x4f5692,_0x192e49){return function(_0x1dada0){if(_0x1dada0){return _0x1dada0[_0x5d18('0x25')](_0x4f5692)[_0x5d18('0x26')](function(_0x152a33){return _0x152a33;});}return null;};}function removeEntity(_0x2cc9a8,_0x2e612b){return function(_0xe417c9){if(_0xe417c9){return _0xe417c9[_0x5d18('0x27')]()['then'](function(){_0x2cc9a8[_0x5d18('0x19')](0xcc)[_0x5d18('0x1a')]();});}};}function handleEntityNotFound(_0x49b85e,_0x290c05){return function(_0x252792){if(!_0x252792){_0x49b85e[_0x5d18('0x18')](0x194);}return _0x252792;};}function handleError(_0x20e151,_0x1746aa){_0x1746aa=_0x1746aa||0x1f4;return function(_0x4b3634){logger['error'](_0x4b3634[_0x5d18('0x28')]);if(_0x4b3634[_0x5d18('0x29')]){delete _0x4b3634['name'];}_0x20e151[_0x5d18('0x19')](_0x1746aa)[_0x5d18('0x2a')](_0x4b3634);};}exports[_0x5d18('0x2b')]=function(_0x2b6c30,_0x16e00b){var _0x15bd0c={},_0x3a9301={},_0x1f4a53={'count':0x0,'rows':[]};var _0x144a44=_[_0x5d18('0x2c')](db['DeskField']['rawAttributes'],function(_0xaf348){return{'name':_0xaf348[_0x5d18('0x2d')],'type':_0xaf348[_0x5d18('0x2e')][_0x5d18('0x2f')]};});_0x3a9301['model']=_[_0x5d18('0x2c')](_0x144a44,_0x5d18('0x29'));_0x3a9301[_0x5d18('0x30')]=_[_0x5d18('0x31')](_0x2b6c30[_0x5d18('0x30')]);_0x3a9301[_0x5d18('0x32')]=_['intersection'](_0x3a9301[_0x5d18('0x33')],_0x3a9301[_0x5d18('0x30')]);_0x15bd0c['attributes']=_[_0x5d18('0x34')](_0x3a9301['model'],qs[_0x5d18('0x35')](_0x2b6c30[_0x5d18('0x30')][_0x5d18('0x35')]));_0x15bd0c['attributes']=_0x15bd0c[_0x5d18('0x36')]['length']?_0x15bd0c['attributes']:_0x3a9301[_0x5d18('0x33')];if(!_0x2b6c30[_0x5d18('0x30')][_0x5d18('0x37')]('nolimit')){_0x15bd0c[_0x5d18('0x1d')]=qs[_0x5d18('0x1d')](_0x2b6c30[_0x5d18('0x30')][_0x5d18('0x1d')]);_0x15bd0c[_0x5d18('0x1c')]=qs['offset'](_0x2b6c30[_0x5d18('0x30')]['offset']);}_0x15bd0c[_0x5d18('0x38')]=qs[_0x5d18('0x39')](_0x2b6c30[_0x5d18('0x30')][_0x5d18('0x39')]);_0x15bd0c[_0x5d18('0x3a')]=qs[_0x5d18('0x32')](_[_0x5d18('0x3b')](_0x2b6c30[_0x5d18('0x30')],_0x3a9301[_0x5d18('0x32')]),_0x144a44);if(_0x2b6c30[_0x5d18('0x30')][_0x5d18('0x3c')]){_0x15bd0c[_0x5d18('0x3a')]=_[_0x5d18('0x3d')](_0x15bd0c[_0x5d18('0x3a')],{'$or':_[_0x5d18('0x2c')](_0x144a44,function(_0x247a44){if(_0x247a44[_0x5d18('0x2e')]!=='VIRTUAL'){var _0x52842b={};_0x52842b[_0x247a44['name']]={'$like':'%'+_0x2b6c30[_0x5d18('0x30')][_0x5d18('0x3c')]+'%'};return _0x52842b;}})});}_0x15bd0c=_[_0x5d18('0x3d')]({},_0x15bd0c,_0x2b6c30['options']);var _0x59624f={'where':_0x15bd0c[_0x5d18('0x3a')]};return db[_0x5d18('0x3e')][_0x5d18('0x1f')](_0x59624f)[_0x5d18('0x26')](function(_0x2664fb){_0x1f4a53[_0x5d18('0x1f')]=_0x2664fb;if(_0x2b6c30[_0x5d18('0x30')][_0x5d18('0x3f')]){_0x15bd0c[_0x5d18('0x40')]=[{'all':!![]}];}return db[_0x5d18('0x3e')]['findAll'](_0x15bd0c);})[_0x5d18('0x26')](function(_0x35f4f3){_0x1f4a53[_0x5d18('0x41')]=_0x35f4f3;return _0x1f4a53;})[_0x5d18('0x26')](respondWithFilteredResult(_0x16e00b,_0x15bd0c))[_0x5d18('0x42')](handleError(_0x16e00b,null));};exports['show']=function(_0x13ccaa,_0x10ae56){var _0x552dcd={'raw':!![],'where':{'id':_0x13ccaa[_0x5d18('0x43')]['id']}},_0x31f1dc={};_0x31f1dc[_0x5d18('0x33')]=_[_0x5d18('0x31')](db['DeskField'][_0x5d18('0x44')]);_0x31f1dc['query']=_[_0x5d18('0x31')](_0x13ccaa['query']);_0x31f1dc[_0x5d18('0x32')]=_[_0x5d18('0x34')](_0x31f1dc[_0x5d18('0x33')],_0x31f1dc['query']);_0x552dcd[_0x5d18('0x36')]=_[_0x5d18('0x34')](_0x31f1dc[_0x5d18('0x33')],qs[_0x5d18('0x35')](_0x13ccaa['query'][_0x5d18('0x35')]));_0x552dcd[_0x5d18('0x36')]=_0x552dcd['attributes'][_0x5d18('0x45')]?_0x552dcd['attributes']:_0x31f1dc['model'];if(_0x13ccaa[_0x5d18('0x30')][_0x5d18('0x3f')]){_0x552dcd[_0x5d18('0x40')]=[{'all':!![]}];}_0x552dcd=_[_0x5d18('0x3d')]({},_0x552dcd,_0x13ccaa[_0x5d18('0x46')]);return db[_0x5d18('0x3e')][_0x5d18('0x47')](_0x552dcd)[_0x5d18('0x26')](handleEntityNotFound(_0x10ae56,null))['then'](respondWithResult(_0x10ae56,null))[_0x5d18('0x42')](handleError(_0x10ae56,null));};exports['create']=function(_0xcc5571,_0x1f191d){return db['DeskField'][_0x5d18('0x48')](_0xcc5571['body'],{})[_0x5d18('0x26')](respondWithResult(_0x1f191d,0xc9))[_0x5d18('0x42')](handleError(_0x1f191d,null));};exports[_0x5d18('0x25')]=function(_0x40444c,_0x494411){if(_0x40444c[_0x5d18('0x49')]['id']){delete _0x40444c['body']['id'];}return db['DeskField'][_0x5d18('0x47')]({'where':{'id':_0x40444c[_0x5d18('0x43')]['id']}})['then'](handleEntityNotFound(_0x494411,null))['then'](saveUpdates(_0x40444c[_0x5d18('0x49')],null))['then'](respondWithResult(_0x494411,null))[_0x5d18('0x42')](handleError(_0x494411,null));};exports['destroy']=function(_0x23ec5d,_0x5461a9){return db[_0x5d18('0x3e')][_0x5d18('0x47')]({'where':{'id':_0x23ec5d[_0x5d18('0x43')]['id']}})[_0x5d18('0x26')](handleEntityNotFound(_0x5461a9,null))[_0x5d18('0x26')](removeEntity(_0x5461a9,null))['catch'](handleError(_0x5461a9,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index e72aa40..1a7da7f 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 _0x05d6=['lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskField.attributes','define','DeskField','int_desk_fields','desk_unique_index','FieldId'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0x05d6,0x134));var _0x605d=function(_0x3e38fc,_0x3a0824){_0x3e38fc=_0x3e38fc-0x0;var _0x807561=_0x05d6[_0x3e38fc];return _0x807561;};'use strict';var _=require(_0x605d('0x0'));var util=require(_0x605d('0x1'));var logger=require(_0x605d('0x2'))('api');var moment=require('moment');var BPromise=require(_0x605d('0x3'));var rp=require(_0x605d('0x4'));var fs=require('fs');var path=require(_0x605d('0x5'));var rimraf=require(_0x605d('0x6'));var config=require(_0x605d('0x7'));var attributes=require(_0x605d('0x8'));module['exports']=function(_0x45d45e,_0x439ab7){return _0x45d45e[_0x605d('0x9')](_0x605d('0xa'),attributes,{'tableName':_0x605d('0xb'),'paranoid':![],'indexes':[{'name':_0x605d('0xc'),'fields':['idField',_0x605d('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1f84=['bluebird','path','../../config/environment','./intDeskField.attributes','exports','define','int_desk_fields','desk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment'];(function(_0x51c56d,_0x19d157){var _0x468de0=function(_0x1b37df){while(--_0x1b37df){_0x51c56d['push'](_0x51c56d['shift']());}};_0x468de0(++_0x19d157);}(_0x1f84,0xcd));var _0x41f8=function(_0x253946,_0x1c8d56){_0x253946=_0x253946-0x0;var _0x198cd6=_0x1f84[_0x253946];return _0x198cd6;};'use strict';var _=require(_0x41f8('0x0'));var util=require(_0x41f8('0x1'));var logger=require(_0x41f8('0x2'))(_0x41f8('0x3'));var moment=require(_0x41f8('0x4'));var BPromise=require(_0x41f8('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x41f8('0x6'));var rimraf=require('rimraf');var config=require(_0x41f8('0x7'));var attributes=require(_0x41f8('0x8'));module[_0x41f8('0x9')]=function(_0x362cd3,_0x232558){return _0x362cd3[_0x41f8('0xa')]('DeskField',attributes,{'tableName':_0x41f8('0xb'),'paranoid':![],'indexes':[{'name':_0x41f8('0xc'),'fields':[_0x41f8('0xd'),_0x41f8('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.rpc.js b/server/api/intDeskField/intDeskField.rpc.js index b8d097f..d821d7c 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 _0xdf2d=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','ioredis','../../mysqldb'];(function(_0x512359,_0x3b03d6){var _0x5ae120=function(_0x14f255){while(--_0x14f255){_0x512359['push'](_0x512359['shift']());}};_0x5ae120(++_0x3b03d6);}(_0xdf2d,0x19f));var _0xddf2=function(_0x2165f8,_0x140863){_0x2165f8=_0x2165f8-0x0;var _0x53f7f9=_0xdf2d[_0x2165f8];return _0x53f7f9;};'use strict';var _=require(_0xddf2('0x0'));var util=require('util');var moment=require(_0xddf2('0x1'));var BPromise=require(_0xddf2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xddf2('0x3'));var db=require(_0xddf2('0x4'))['db'];var utils=require(_0xddf2('0x5'));var logger=require(_0xddf2('0x6'))(_0xddf2('0x7'));var config=require(_0xddf2('0x8'));var jayson=require(_0xddf2('0x9'));var client=jayson['client'][_0xddf2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1eb02d,_0x490141,_0x33a624){return new BPromise(function(_0x5989ae,_0xbff84c){return client['request'](_0x1eb02d,_0x33a624)['then'](function(_0x21f585){logger[_0xddf2('0xb')](_0xddf2('0xc'),_0x490141,_0xddf2('0xd'));logger[_0xddf2('0xe')](_0xddf2('0xf'),_0x490141,_0xddf2('0xd'),JSON[_0xddf2('0x10')](_0x21f585));if(_0x21f585['error']){if(_0x21f585[_0xddf2('0x11')][_0xddf2('0x12')]===0x1f4){logger[_0xddf2('0x11')](_0xddf2('0xc'),_0x490141,_0x21f585[_0xddf2('0x11')][_0xddf2('0x13')]);return _0xbff84c(_0x21f585[_0xddf2('0x11')]['message']);}logger[_0xddf2('0x11')](_0xddf2('0xc'),_0x490141,_0x21f585[_0xddf2('0x11')][_0xddf2('0x13')]);return _0x5989ae(_0x21f585[_0xddf2('0x11')][_0xddf2('0x13')]);}else{logger[_0xddf2('0xb')](_0xddf2('0xc'),_0x490141,_0xddf2('0xd'));_0x5989ae(_0x21f585[_0xddf2('0x14')]['message']);}})['catch'](function(_0x339e7e){logger[_0xddf2('0x11')](_0xddf2('0xc'),_0x490141,_0x339e7e);_0xbff84c(_0x339e7e);});});} \ No newline at end of file +var _0xd9cf=['moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','debug','DeskField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','DeskField,\x20%s,\x20%s','message','catch','lodash','util'];(function(_0x5a8893,_0x1d4c67){var _0x5d0c5d=function(_0x451ee){while(--_0x451ee){_0x5a8893['push'](_0x5a8893['shift']());}};_0x5d0c5d(++_0x1d4c67);}(_0xd9cf,0x11c));var _0xfd9c=function(_0x485c20,_0x53bf88){_0x485c20=_0x485c20-0x0;var _0x3e2a82=_0xd9cf[_0x485c20];return _0x3e2a82;};'use strict';var _=require(_0xfd9c('0x0'));var util=require(_0xfd9c('0x1'));var moment=require(_0xfd9c('0x2'));var BPromise=require(_0xfd9c('0x3'));var rs=require(_0xfd9c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfd9c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xfd9c('0x6'))(_0xfd9c('0x7'));var config=require(_0xfd9c('0x8'));var jayson=require(_0xfd9c('0x9'));var client=jayson[_0xfd9c('0xa')][_0xfd9c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x6da6a2,_0x3b6d6f,_0x28f39e){return new BPromise(function(_0x1d876f,_0x3050c5){return client[_0xfd9c('0xc')](_0x6da6a2,_0x28f39e)['then'](function(_0x3e8bba){logger[_0xfd9c('0xd')]('DeskField,\x20%s,\x20%s',_0x3b6d6f,'request\x20sent');logger[_0xfd9c('0xe')](_0xfd9c('0xf'),_0x3b6d6f,_0xfd9c('0x10'),JSON['stringify'](_0x3e8bba));if(_0x3e8bba[_0xfd9c('0x11')]){if(_0x3e8bba[_0xfd9c('0x11')][_0xfd9c('0x12')]===0x1f4){logger[_0xfd9c('0x11')](_0xfd9c('0x13'),_0x3b6d6f,_0x3e8bba[_0xfd9c('0x11')]['message']);return _0x3050c5(_0x3e8bba[_0xfd9c('0x11')][_0xfd9c('0x14')]);}logger[_0xfd9c('0x11')](_0xfd9c('0x13'),_0x3b6d6f,_0x3e8bba[_0xfd9c('0x11')][_0xfd9c('0x14')]);return _0x1d876f(_0x3e8bba[_0xfd9c('0x11')]['message']);}else{logger[_0xfd9c('0xd')]('DeskField,\x20%s,\x20%s',_0x3b6d6f,_0xfd9c('0x10'));_0x1d876f(_0x3e8bba['result'][_0xfd9c('0x14')]);}})[_0xfd9c('0x15')](function(_0x53d057){logger['error'](_0xfd9c('0x13'),_0x3b6d6f,_0x53d057);_0x3050c5(_0x53d057);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 8aff69d..d3be44b 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 _0xa870=['get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','update','delete','destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../config/environment'];(function(_0x13f6bb,_0x1d625f){var _0x413673=function(_0x6dacf6){while(--_0x6dacf6){_0x13f6bb['push'](_0x13f6bb['shift']());}};_0x413673(++_0x1d625f);}(_0xa870,0x117));var _0x0a87=function(_0x5cb52a,_0x519f64){_0x5cb52a=_0x5cb52a-0x0;var _0x68af63=_0xa870[_0x5cb52a];return _0x68af63;};'use strict';var multer=require('multer');var util=require(_0x0a87('0x0'));var path=require(_0x0a87('0x1'));var timeout=require(_0x0a87('0x2'));var express=require(_0x0a87('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x0a87('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x0a87('0x5'));var controller=require('./intDynamics365Account.controller');router[_0x0a87('0x6')]('/',auth[_0x0a87('0x7')](),controller['index']);router['get'](_0x0a87('0x8'),auth[_0x0a87('0x7')](),controller[_0x0a87('0x9')]);router[_0x0a87('0x6')](_0x0a87('0xa'),auth[_0x0a87('0x7')](),controller[_0x0a87('0xb')]);router['get'](_0x0a87('0xc'),auth[_0x0a87('0x7')](),controller[_0x0a87('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x0a87('0xe')](_0x0a87('0xa'),auth[_0x0a87('0x7')](),controller['addConfiguration']);router['put'](_0x0a87('0x8'),auth['isAuthenticated'](),controller[_0x0a87('0xf')]);router[_0x0a87('0x10')](_0x0a87('0x8'),auth[_0x0a87('0x7')](),controller[_0x0a87('0x11')]);module[_0x0a87('0x12')]=router; \ No newline at end of file +var _0x4f94=['put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0x4f94,0x122));var _0x44f9=function(_0x4772ee,_0x15811b){_0x4772ee=_0x4772ee-0x0;var _0x582930=_0x4f94[_0x4772ee];return _0x582930;};'use strict';var multer=require(_0x44f9('0x0'));var util=require(_0x44f9('0x1'));var path=require(_0x44f9('0x2'));var timeout=require(_0x44f9('0x3'));var express=require(_0x44f9('0x4'));var router=express[_0x44f9('0x5')]();var fs_extra=require(_0x44f9('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x44f9('0x7'));var config=require(_0x44f9('0x8'));var controller=require(_0x44f9('0x9'));router[_0x44f9('0xa')]('/',auth['isAuthenticated'](),controller[_0x44f9('0xb')]);router[_0x44f9('0xa')](_0x44f9('0xc'),auth[_0x44f9('0xd')](),controller[_0x44f9('0xe')]);router['get'](_0x44f9('0xf'),auth[_0x44f9('0xd')](),controller[_0x44f9('0x10')]);router[_0x44f9('0xa')](_0x44f9('0x11'),auth['isAuthenticated'](),controller[_0x44f9('0x12')]);router[_0x44f9('0x13')]('/',auth[_0x44f9('0xd')](),controller[_0x44f9('0x14')]);router[_0x44f9('0x13')](_0x44f9('0xf'),auth[_0x44f9('0xd')](),controller[_0x44f9('0x15')]);router[_0x44f9('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x44f9('0x17')]);router[_0x44f9('0x18')](_0x44f9('0xc'),auth[_0x44f9('0xd')](),controller['destroy']);module[_0x44f9('0x19')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index c489059..a0eee13 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 _0x1945=['sequelize','exports','STRING'];(function(_0x359104,_0x3627ce){var _0x1eda0c=function(_0x1e5f01){while(--_0x1e5f01){_0x359104['push'](_0x359104['shift']());}};_0x1eda0c(++_0x3627ce);}(_0x1945,0xfc));var _0x5194=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x1945[_0xc6be3a];return _0x56a310;};'use strict';var Sequelize=require(_0x5194('0x0'));module[_0x5194('0x1')]={'name':{'type':Sequelize[_0x5194('0x2')]},'username':{'type':Sequelize[_0x5194('0x2')]},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x5194('0x2')]},'tenantId':{'type':Sequelize[_0x5194('0x2')]},'clientId':{'type':Sequelize[_0x5194('0x2')]},'clientSecret':{'type':Sequelize[_0x5194('0x2')]},'serverUrl':{'type':Sequelize[_0x5194('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x5194('0x2')]}}; \ No newline at end of file +var _0xffc8=['STRING'];(function(_0x55d0ab,_0x3d06c2){var _0x1f146c=function(_0x1e96c0){while(--_0x1e96c0){_0x55d0ab['push'](_0x55d0ab['shift']());}};_0x1f146c(++_0x3d06c2);}(_0xffc8,0x111));var _0x8ffc=function(_0x6eaeb0,_0xa6cec7){_0x6eaeb0=_0x6eaeb0-0x0;var _0x176a7e=_0xffc8[_0x6eaeb0];return _0x176a7e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x8ffc('0x0')]},'username':{'type':Sequelize[_0x8ffc('0x0')]},'password':{'type':Sequelize[_0x8ffc('0x0')]},'remoteUri':{'type':Sequelize[_0x8ffc('0x0')]},'tenantId':{'type':Sequelize[_0x8ffc('0x0')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x8ffc('0x0')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 8217bbc..2791f6c 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 _0xf725=['AccountId','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Field','Subjects','ticketType','incident','Incident','PhoneCall','title','description','customerid','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','contactidname','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyyominame','createdon','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','resolveby','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','password','clientSecret','remoteUri','substring','%s/api/data/v9.0/','POST','clientId','access_token','Bearer\x20','4.0','value','GET',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','remove','@odata.type','PicklistAttributeMetadata','push','MetadataId','all','forEach','isNil','lastIndexOf','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','DecimalAttributeMetadata','test','statusCode','Wrong\x20credentials',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','UserLocalizedLabel','Value','LogicalName','DisplayName','EntityDefinitions(',')/Attributes(','TrueOption','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','map','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','Dynamics365Account','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','getConfigurations','Dynamics365Configuration','pick','addConfiguration'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xf725,0x7e));var _0x5f72=function(_0x2c322e,_0x19b4d0){_0x2c322e=_0x2c322e-0x0;var _0x134577=_0xf725[_0x2c322e];return _0x134577;};'use strict';var emlformat=require(_0x5f72('0x0'));var rimraf=require(_0x5f72('0x1'));var zipdir=require(_0x5f72('0x2'));var jsonpatch=require(_0x5f72('0x3'));var rp=require(_0x5f72('0x4'));var moment=require(_0x5f72('0x5'));var BPromise=require(_0x5f72('0x6'));var Mustache=require(_0x5f72('0x7'));var util=require(_0x5f72('0x8'));var path=require(_0x5f72('0x9'));var sox=require('sox');var csv=require(_0x5f72('0xa'));var ejs=require(_0x5f72('0xb'));var fs=require('fs');var fs_extra=require(_0x5f72('0xc'));var _=require(_0x5f72('0xd'));var squel=require(_0x5f72('0xe'));var crypto=require(_0x5f72('0xf'));var jsforce=require(_0x5f72('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5f72('0x11'));var Papa=require(_0x5f72('0x12'));var Redis=require('ioredis');var authService=require(_0x5f72('0x13'));var qs=require(_0x5f72('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5f72('0x15'));var logger=require(_0x5f72('0x16'))(_0x5f72('0x17'));var utils=require(_0x5f72('0x18'));var config=require(_0x5f72('0x19'));var licenseUtil=require(_0x5f72('0x1a'));var db=require(_0x5f72('0x1b'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x1ac591,_0x3307ed){_0x3307ed=_0x3307ed||0xcc;return function(_0x8a9487){if(_0x8a9487){return _0x1ac591[_0x5f72('0x1c')](_0x3307ed);}return _0x1ac591[_0x5f72('0x1d')](_0x3307ed)['end']();};}function respondWithResult(_0x43d1fd,_0x4f81e9){_0x4f81e9=_0x4f81e9||0xc8;return function(_0x50f8c8){if(_0x50f8c8){return _0x43d1fd[_0x5f72('0x1d')](_0x4f81e9)['json'](_0x50f8c8);}};}function respondWithFilteredResult(_0x3267a,_0x4adc76){return function(_0x317eed){if(_0x317eed){var _0x4e0c32=typeof _0x4adc76[_0x5f72('0x1e')]===_0x5f72('0x1f')&&typeof _0x4adc76['limit']===_0x5f72('0x1f');var _0x276323=_0x317eed[_0x5f72('0x20')];var _0x4af7d3=_0x4e0c32?0x0:_0x4adc76['offset'];var _0x4b62e1=_0x4e0c32?_0x317eed[_0x5f72('0x20')]:_0x4adc76[_0x5f72('0x1e')]+_0x4adc76[_0x5f72('0x21')];var _0x32f487;if(_0x4b62e1>=_0x276323){_0x4b62e1=_0x276323;_0x32f487=0xc8;}else{_0x32f487=0xce;}_0x3267a[_0x5f72('0x1d')](_0x32f487);return _0x3267a[_0x5f72('0x22')](_0x5f72('0x23'),_0x4af7d3+'-'+_0x4b62e1+'/'+_0x276323)['json'](_0x317eed);}return null;};}function patchUpdates(_0x151a67){return function(_0x315b71){try{jsonpatch[_0x5f72('0x24')](_0x315b71,_0x151a67,!![]);}catch(_0xd5a0c5){return BPromise[_0x5f72('0x25')](_0xd5a0c5);}return _0x315b71[_0x5f72('0x26')]();};}function saveUpdates(_0x30235e,_0x367716){return function(_0x27b1f6){if(_0x27b1f6){return _0x27b1f6[_0x5f72('0x27')](_0x30235e)[_0x5f72('0x28')](function(_0x530009){return _0x530009;});}return null;};}function removeEntity(_0x433935,_0x21f4a3){return function(_0x258b8c){if(_0x258b8c){return _0x258b8c[_0x5f72('0x29')]()['then'](function(){_0x433935[_0x5f72('0x1d')](0xcc)[_0x5f72('0x2a')]();});}};}function handleEntityNotFound(_0x5c3325,_0x447019){return function(_0x3bb0a6){if(!_0x3bb0a6){_0x5c3325[_0x5f72('0x1c')](0x194);}return _0x3bb0a6;};}function handleError(_0x521174,_0x58ff77){_0x58ff77=_0x58ff77||0x1f4;return function(_0x3d4cfe){logger[_0x5f72('0x2b')](_0x3d4cfe[_0x5f72('0x2c')]);if(_0x3d4cfe[_0x5f72('0x2d')]){delete _0x3d4cfe[_0x5f72('0x2d')];}_0x521174[_0x5f72('0x1d')](_0x58ff77)[_0x5f72('0x2e')](_0x3d4cfe);};}exports['index']=function(_0x1b12cd,_0x49eea5){var _0xc8ca5a={},_0x35fa31={},_0x7cce31={'count':0x0,'rows':[]};var _0x3c5dbb=_[_0x5f72('0x2f')](db['Dynamics365Account']['rawAttributes'],function(_0x27822b){return{'name':_0x27822b[_0x5f72('0x30')],'type':_0x27822b[_0x5f72('0x31')][_0x5f72('0x32')]};});_0x35fa31[_0x5f72('0x33')]=_[_0x5f72('0x2f')](_0x3c5dbb,_0x5f72('0x2d'));_0x35fa31['query']=_[_0x5f72('0x34')](_0x1b12cd[_0x5f72('0x35')]);_0x35fa31[_0x5f72('0x36')]=_[_0x5f72('0x37')](_0x35fa31[_0x5f72('0x33')],_0x35fa31['query']);_0xc8ca5a[_0x5f72('0x38')]=_[_0x5f72('0x37')](_0x35fa31[_0x5f72('0x33')],qs[_0x5f72('0x39')](_0x1b12cd[_0x5f72('0x35')][_0x5f72('0x39')]));_0xc8ca5a['attributes']=_0xc8ca5a['attributes'][_0x5f72('0x3a')]?_0xc8ca5a[_0x5f72('0x38')]:_0x35fa31['model'];if(!_0x1b12cd[_0x5f72('0x35')][_0x5f72('0x3b')](_0x5f72('0x3c'))){_0xc8ca5a[_0x5f72('0x21')]=qs[_0x5f72('0x21')](_0x1b12cd[_0x5f72('0x35')][_0x5f72('0x21')]);_0xc8ca5a[_0x5f72('0x1e')]=qs[_0x5f72('0x1e')](_0x1b12cd[_0x5f72('0x35')][_0x5f72('0x1e')]);}_0xc8ca5a[_0x5f72('0x3d')]=qs[_0x5f72('0x3e')](_0x1b12cd[_0x5f72('0x35')]['sort']);_0xc8ca5a[_0x5f72('0x3f')]=qs['filters'](_['pick'](_0x1b12cd[_0x5f72('0x35')],_0x35fa31[_0x5f72('0x36')]),_0x3c5dbb);if(_0x1b12cd[_0x5f72('0x35')][_0x5f72('0x40')]){_0xc8ca5a[_0x5f72('0x3f')]=_[_0x5f72('0x41')](_0xc8ca5a['where'],{'$or':_[_0x5f72('0x2f')](_0x3c5dbb,function(_0x1b6949){if(_0x1b6949[_0x5f72('0x31')]!==_0x5f72('0x42')){var _0x148cd6={};_0x148cd6[_0x1b6949[_0x5f72('0x2d')]]={'$like':'%'+_0x1b12cd[_0x5f72('0x35')][_0x5f72('0x40')]+'%'};return _0x148cd6;}})});}_0xc8ca5a=_[_0x5f72('0x41')]({},_0xc8ca5a,_0x1b12cd[_0x5f72('0x43')]);var _0x39c2af={'where':_0xc8ca5a[_0x5f72('0x3f')]};return db[_0x5f72('0x44')][_0x5f72('0x20')](_0x39c2af)[_0x5f72('0x28')](function(_0x56d2f0){_0x7cce31['count']=_0x56d2f0;if(_0x1b12cd[_0x5f72('0x35')]['includeAll']){_0xc8ca5a['include']=[{'all':!![]}];}return db[_0x5f72('0x44')][_0x5f72('0x45')](_0xc8ca5a);})['then'](function(_0x3f0f8d){_0x7cce31[_0x5f72('0x46')]=_0x3f0f8d;return _0x7cce31;})['then'](respondWithFilteredResult(_0x49eea5,_0xc8ca5a))[_0x5f72('0x47')](handleError(_0x49eea5,null));};exports[_0x5f72('0x48')]=function(_0x4f2d4a,_0xcfefc5){var _0x4f57a6={'raw':![],'where':{'id':_0x4f2d4a[_0x5f72('0x49')]['id']}},_0x5720d4={};_0x5720d4[_0x5f72('0x33')]=_[_0x5f72('0x34')](db[_0x5f72('0x44')][_0x5f72('0x4a')]);_0x5720d4[_0x5f72('0x35')]=_[_0x5f72('0x34')](_0x4f2d4a['query']);_0x5720d4[_0x5f72('0x36')]=_[_0x5f72('0x37')](_0x5720d4[_0x5f72('0x33')],_0x5720d4[_0x5f72('0x35')]);_0x4f57a6['attributes']=_[_0x5f72('0x37')](_0x5720d4[_0x5f72('0x33')],qs[_0x5f72('0x39')](_0x4f2d4a[_0x5f72('0x35')]['fields']));_0x4f57a6[_0x5f72('0x38')]=_0x4f57a6[_0x5f72('0x38')][_0x5f72('0x3a')]?_0x4f57a6[_0x5f72('0x38')]:_0x5720d4['model'];if(_0x4f2d4a[_0x5f72('0x35')][_0x5f72('0x4b')]){_0x4f57a6['include']=[{'all':!![]}];}_0x4f57a6=_[_0x5f72('0x41')]({},_0x4f57a6,_0x4f2d4a[_0x5f72('0x43')]);return db['Dynamics365Account'][_0x5f72('0x4c')](_0x4f57a6)[_0x5f72('0x28')](handleEntityNotFound(_0xcfefc5,null))[_0x5f72('0x28')](respondWithResult(_0xcfefc5,null))['catch'](handleError(_0xcfefc5,null));};exports[_0x5f72('0x4d')]=function(_0x5efa48,_0x30a9b6){return db[_0x5f72('0x44')]['create'](_0x5efa48[_0x5f72('0x4e')],{})[_0x5f72('0x28')](respondWithResult(_0x30a9b6,0xc9))[_0x5f72('0x47')](handleError(_0x30a9b6,null));};exports[_0x5f72('0x27')]=function(_0x506774,_0x41319a){if(_0x506774[_0x5f72('0x4e')]['id']){delete _0x506774[_0x5f72('0x4e')]['id'];}return db[_0x5f72('0x44')]['find']({'where':{'id':_0x506774[_0x5f72('0x49')]['id']}})['then'](handleEntityNotFound(_0x41319a,null))[_0x5f72('0x28')](saveUpdates(_0x506774[_0x5f72('0x4e')],null))[_0x5f72('0x28')](respondWithResult(_0x41319a,null))[_0x5f72('0x47')](handleError(_0x41319a,null));};exports[_0x5f72('0x29')]=function(_0x3f071c,_0x28008c){return db[_0x5f72('0x44')][_0x5f72('0x4c')]({'where':{'id':_0x3f071c[_0x5f72('0x49')]['id']}})['then'](handleEntityNotFound(_0x28008c,null))[_0x5f72('0x28')](removeEntity(_0x28008c,null))[_0x5f72('0x47')](handleError(_0x28008c,null));};exports[_0x5f72('0x4f')]=function(_0x30e03,_0x2195c7,_0x5426f1){var _0x2fa280={};var _0x6f9638={};var _0x198609;var _0x37443b;return db[_0x5f72('0x44')]['findOne']({'where':{'id':_0x30e03['params']['id']}})[_0x5f72('0x28')](handleEntityNotFound(_0x2195c7,null))[_0x5f72('0x28')](function(_0xae3be1){if(_0xae3be1){_0x198609=_0xae3be1;_0x6f9638['model']=_[_0x5f72('0x34')](db[_0x5f72('0x50')][_0x5f72('0x4a')]);_0x6f9638['query']=_[_0x5f72('0x34')](_0x30e03[_0x5f72('0x35')]);_0x6f9638['filters']=_['intersection'](_0x6f9638[_0x5f72('0x33')],_0x6f9638['query']);_0x2fa280['attributes']=_[_0x5f72('0x37')](_0x6f9638[_0x5f72('0x33')],qs[_0x5f72('0x39')](_0x30e03[_0x5f72('0x35')][_0x5f72('0x39')]));_0x2fa280[_0x5f72('0x38')]=_0x2fa280[_0x5f72('0x38')]['length']?_0x2fa280[_0x5f72('0x38')]:_0x6f9638['model'];_0x2fa280[_0x5f72('0x3d')]=qs[_0x5f72('0x3e')](_0x30e03['query'][_0x5f72('0x3e')]);_0x2fa280[_0x5f72('0x3f')]=qs[_0x5f72('0x36')](_[_0x5f72('0x51')](_0x30e03[_0x5f72('0x35')],_0x6f9638['filters']));if(_0x30e03[_0x5f72('0x35')][_0x5f72('0x40')]){_0x2fa280[_0x5f72('0x3f')]=_['merge'](_0x2fa280[_0x5f72('0x3f')],{'$or':_[_0x5f72('0x2f')](_0x2fa280[_0x5f72('0x38')],function(_0xb1e925){var _0x80639={};_0x80639[_0xb1e925]={'$like':'%'+_0x30e03[_0x5f72('0x35')][_0x5f72('0x40')]+'%'};return _0x80639;})});}_0x2fa280=_[_0x5f72('0x41')]({},_0x2fa280,_0x30e03[_0x5f72('0x43')]);return _0x198609[_0x5f72('0x4f')](_0x2fa280);}})[_0x5f72('0x28')](function(_0x554dcf){if(_0x554dcf){_0x37443b=_0x554dcf['length'];if(!_0x30e03[_0x5f72('0x35')][_0x5f72('0x3b')](_0x5f72('0x3c'))){_0x2fa280[_0x5f72('0x21')]=qs[_0x5f72('0x21')](_0x30e03[_0x5f72('0x35')]['limit']);_0x2fa280[_0x5f72('0x1e')]=qs[_0x5f72('0x1e')](_0x30e03[_0x5f72('0x35')][_0x5f72('0x1e')]);}return _0x198609['getConfigurations'](_0x2fa280);}})[_0x5f72('0x28')](function(_0x5b119c){if(_0x5b119c){return _0x5b119c?{'count':_0x37443b,'rows':_0x5b119c}:null;}})[_0x5f72('0x28')](respondWithResult(_0x2195c7,null))[_0x5f72('0x47')](handleError(_0x2195c7,null));};exports[_0x5f72('0x52')]=function(_0x6b865d,_0x58b330,_0x4013bf){if(_0x6b865d[_0x5f72('0x4e')]['id']){delete _0x6b865d[_0x5f72('0x4e')]['id'];}return db[_0x5f72('0x44')]['findOne']({'where':{'id':_0x6b865d['params']['id']}})[_0x5f72('0x28')](handleEntityNotFound(_0x58b330,null))['then'](function(_0x4b6a90){if(_0x4b6a90){_0x6b865d[_0x5f72('0x4e')][_0x5f72('0x53')]=_0x4b6a90['id'];_0x6b865d[_0x5f72('0x4e')]['Subjects']=integrations[_0x5f72('0x54')](_0x6b865d[_0x5f72('0x4e')][_0x5f72('0x55')],_0x6b865d[_0x5f72('0x4e')][_0x5f72('0x31')]);_0x6b865d[_0x5f72('0x4e')][_0x5f72('0x56')]=integrations[_0x5f72('0x57')](_0x6b865d[_0x5f72('0x4e')][_0x5f72('0x55')],_0x6b865d[_0x5f72('0x4e')][_0x5f72('0x31')]);return db[_0x5f72('0x50')]['create'](_0x6b865d[_0x5f72('0x4e')],{'include':[{'model':db[_0x5f72('0x58')],'as':_0x5f72('0x59')},{'model':db['Dynamics365Field'],'as':_0x5f72('0x56')}]});}return null;})['then'](respondWithResult(_0x58b330,null))['catch'](handleError(_0x58b330,null));};exports['getFields']=function(_0x5ca842,_0x49d3d7,_0x1cd273){var _0x4cc70c=_0x5ca842['query'][_0x5f72('0x5a')];var _0x2404fd=_0x4cc70c===_0x5f72('0x5b')?_0x5f72('0x5c'):_0x5f72('0x5d');var _0x3352c5='';var _0x25ed96='';var _0x23ebb4='';var _0x59e2a7='';var _0x28646b='';var _0x1f8370='';var _0x1c9cc4='';var _0x40674f='';var _0x2c2dc2=[_0x5f72('0x5e'),_0x5f72('0x5f'),_0x5f72('0x60'),_0x5f72('0x61'),_0x5f72('0x62'),_0x5f72('0x63'),_0x5f72('0x64'),_0x5f72('0x65'),_0x5f72('0x66'),_0x5f72('0x67')];var _0x5d3dd5=[_0x5f72('0x68'),_0x5f72('0x69'),_0x5f72('0x6a'),'billedserviceunits',_0x5f72('0x6b'),'contactidyominame',_0x5f72('0x6c'),_0x5f72('0x6d'),_0x5f72('0x6e'),_0x5f72('0x6f'),'createdbyname',_0x5f72('0x70'),_0x5f72('0x71'),'createdonbehalfbyname',_0x5f72('0x72'),_0x5f72('0x73'),_0x5f72('0x74'),_0x5f72('0x75'),_0x5f72('0x76'),_0x5f72('0x77'),_0x5f72('0x78'),_0x5f72('0x79'),'escalatedon',_0x5f72('0x7a'),_0x5f72('0x7b'),_0x5f72('0x7c'),_0x5f72('0x7d'),_0x5f72('0x7e'),_0x5f72('0x7f'),_0x5f72('0x80'),_0x5f72('0x81'),'modifiedbyexternalpartyname',_0x5f72('0x82'),_0x5f72('0x83'),_0x5f72('0x84'),'modifiedon',_0x5f72('0x85'),_0x5f72('0x86'),_0x5f72('0x87'),'msdyn_iotalertname',_0x5f72('0x88'),_0x5f72('0x89'),_0x5f72('0x8a'),_0x5f72('0x8b'),_0x5f72('0x8c'),_0x5f72('0x8d'),_0x5f72('0x8e'),'primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber',_0x5f72('0x8f'),'resolvebykpiidname',_0x5f72('0x90'),_0x5f72('0x91'),_0x5f72('0x92'),_0x5f72('0x93'),_0x5f72('0x94'),_0x5f72('0x95'),_0x5f72('0x96'),_0x5f72('0x97'),_0x5f72('0x98'),_0x5f72('0x99'),_0x5f72('0x9a'),'timezoneruleversionnumber',_0x5f72('0x9b'),_0x5f72('0x9c'),_0x5f72('0x9d'),_0x5f72('0x9e')];var _0x4b8748=_0x2c2dc2[_0x5f72('0x9f')](_0x5d3dd5);return db[_0x5f72('0x44')]['findOne']({'where':{'id':_0x5ca842['params']['id']},'attributes':['id','username',_0x5f72('0xa0'),'remoteUri','tenantId','clientId',_0x5f72('0xa1')]})['then'](handleEntityNotFound(_0x49d3d7,null))[_0x5f72('0x28')](function(_0x5096cb){if(_0x5096cb){_0x40674f=_0x5096cb[_0x5f72('0xa2')];var _0x15baa4=_0x40674f['slice'](-0x1);if(_0x15baa4==='/'){_0x40674f=_0x40674f[_0x5f72('0xa3')](0x0,_0x40674f['lastIndexOf'](_0x15baa4));}_0x1c9cc4=util['format'](_0x5f72('0xa4'),_0x40674f);var _0x5009c6={'method':_0x5f72('0xa5'),'uri':'https://login.microsoftonline.com/'+_0x5096cb['tenantId']+'/oauth2/token','form':{'client_id':_0x5096cb[_0x5f72('0xa6')],'resource':_0x40674f,'username':_0x5096cb['username'],'password':_0x5096cb['password'],'grant_type':'password','client_secret':_0x5096cb['clientSecret']},'json':!![]};return rp(_0x5009c6);}})[_0x5f72('0x28')](function(_0x424422){_0x1f8370=_0x424422[_0x5f72('0xa7')];var _0x2722e0={'method':'GET','uri':encodeURI(_0x1c9cc4+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x2404fd+'\x27'),'headers':{'Authorization':_0x5f72('0xa8')+_0x1f8370,'If-None-Match':null,'OData-Version':_0x5f72('0xa9')},'json':!![]};return rp(_0x2722e0);})[_0x5f72('0x28')](function(_0x1bf453){var _0x49f890=_0x1bf453[_0x5f72('0xaa')][0x0];var _0xc13ee7=_0x49f890['MetadataId'];var _0x466f89={'method':_0x5f72('0xab'),'uri':_0x1c9cc4+'EntityDefinitions('+_0xc13ee7+_0x5f72('0xac'),'headers':{'Authorization':_0x5f72('0xa8')+_0x1f8370,'If-None-Match':null,'OData-Version':_0x5f72('0xa9')},'json':!![]};return rp(_0x466f89);})[_0x5f72('0x28')](function(_0x579869){_0x3352c5=_0x579869;_0x25ed96=_0x3352c5['Attributes'];_0x25ed96=_[_0x5f72('0xad')](_0x25ed96,function(_0xfc665b){return!_0x4b8748['includes'](_0xfc665b['LogicalName']);});var _0x3ee9be=[];var _0x20fe5d=[];_0x25ed96['forEach'](function(_0x51ff27){if(_0x51ff27['@odata.type']){var _0x2fd743=_0x51ff27[_0x5f72('0xae')][_0x5f72('0xa3')](_0x51ff27[_0x5f72('0xae')]['lastIndexOf']('.')+0x1);if(_0x2fd743===_0x5f72('0xaf')){_0x3ee9be[_0x5f72('0xb0')](getSelectList(_0x1c9cc4,_0x4cc70c,_0x20fe5d,_0x3352c5[_0x5f72('0xb1')],_0x51ff27[_0x5f72('0xb1')],_0x1f8370));}}});return Promise[_0x5f72('0xb2')](_0x3ee9be);})[_0x5f72('0x28')](function(_0x6e945a){_0x23ebb4=_0x6e945a[0x0];var _0x5688b9=[];var _0x2697e0=[];_0x25ed96[_0x5f72('0xb3')](function(_0x137510){if(!_[_0x5f72('0xb4')](_0x137510['@odata.type'])){var _0x372611=_0x137510[_0x5f72('0xae')][_0x5f72('0xa3')](_0x137510[_0x5f72('0xae')][_0x5f72('0xb5')]('.')+0x1);if(_0x372611===_0x5f72('0xb6')){_0x5688b9[_0x5f72('0xb0')](getBooleanList(_0x1c9cc4,_0x4cc70c,_0x2697e0,_0x3352c5['MetadataId'],_0x137510[_0x5f72('0xb1')],_0x1f8370));}}});return Promise[_0x5f72('0xb2')](_0x5688b9);})[_0x5f72('0x28')](function(_0x1b38c3){_0x59e2a7=_0x1b38c3[0x0];var _0x80d5bd=[];var _0xeaf63b=[];_0x25ed96[_0x5f72('0xb3')](function(_0x4aad69){if(_0x4aad69[_0x5f72('0xae')]){var _0x38c365=_0x4aad69['@odata.type'][_0x5f72('0xa3')](_0x4aad69['@odata.type'][_0x5f72('0xb5')]('.')+0x1);if(_0x38c365===_0x5f72('0xb7')||_0x38c365===_0x5f72('0xb8')||_0x38c365===_0x5f72('0xb9')||_0x38c365===_0x5f72('0xba')||_0x38c365===_0x5f72('0xbb')||_0x38c365===_0x5f72('0xbc')||_0x38c365==='StatusAttributeMetadata'||_0x38c365==='EntityNameAttributeMetadata'||_0x38c365==='StateAttributeMetadata'||_0x38c365===_0x5f72('0xbd')){_0x80d5bd[_0x5f72('0xb0')](getInputList(_0x1c9cc4,_0x4cc70c,_0x38c365,_0xeaf63b,_0x3352c5[_0x5f72('0xb1')],_0x4aad69['MetadataId'],_0x1f8370));}}});return Promise[_0x5f72('0xb2')](_0x80d5bd);})[_0x5f72('0x28')](function(_0x4acdaa){_0x28646b=_0x4acdaa[0x0];var _0x571b29=_0x23ebb4[_0x5f72('0x9f')](_0x59e2a7)['concat'](_0x28646b);var _0x52de22={'count':_0x571b29[_0x5f72('0x3a')],'rows':_0x571b29};return _0x52de22;})['then'](respondWithResult(_0x49d3d7,null))[_0x5f72('0x47')](function(_0x42ba29){var _0x12fc33=_0x5ca842['query'][_0x5f72('0xbe')]?0x1f4:_0x42ba29[_0x5f72('0xbf')]||0x1f4;logger[_0x5f72('0x2b')](_0x42ba29[_0x5f72('0x2c')]);delete _0x42ba29['name'];if(_0x12fc33===0x191){_0x12fc33=0x190;}_0x49d3d7['status'](_0x12fc33)['send'](_0x5ca842['query']['test']?{'message':_0x5f72('0xc0'),'statusCode':_0x42ba29[_0x5f72('0xbf')]}:_0x42ba29);});};function getSelectList(_0x5f9aa5,_0xaab7d4,_0x41c239,_0x20b398,_0x3bba6c,_0xcde4){var _0xee39f4={'method':_0x5f72('0xab'),'uri':_0x5f9aa5+'EntityDefinitions('+_0x20b398+')/Attributes('+_0x3bba6c+_0x5f72('0xc1')+_0x5f72('0xc2'),'headers':{'Authorization':'Bearer\x20'+_0xcde4,'If-None-Match':null,'OData-Version':_0x5f72('0xa9')},'json':!![]};return rp(_0xee39f4)[_0x5f72('0x28')](function(_0x283bd4){var _0x5c1c1a=[];var _0x2bfc8d=_0x283bd4[_0x5f72('0xc3')][_0x5f72('0xc4')];_0x2bfc8d[_0x5f72('0xb3')](function(_0x299530){_0x5c1c1a['push']({'name':_0x299530[_0x5f72('0xc5')][_0x5f72('0xc6')][_0x5f72('0xc5')],'value':String(_0x299530[_0x5f72('0xc7')])});});var _0x53c338={'id':_0xaab7d4+'_'+_0x283bd4[_0x5f72('0xc8')],'name':_0x283bd4[_0x5f72('0xc9')][_0x5f72('0xc6')]['Label'],'custom':![],'options':_0x5c1c1a};_0x41c239['push'](_0x53c338);return _0x41c239;});}function getBooleanList(_0x4a2755,_0x1a23b3,_0xf8d005,_0x5763cc,_0x5c680f,_0x309d44){var _0x38ce28={'method':_0x5f72('0xab'),'uri':_0x4a2755+_0x5f72('0xca')+_0x5763cc+_0x5f72('0xcb')+_0x5c680f+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':_0x5f72('0xa8')+_0x309d44,'If-None-Match':null,'OData-Version':_0x5f72('0xa9')},'json':!![]};return rp(_0x38ce28)[_0x5f72('0x28')](function(_0x59633c){var _0x17e9d2=[];_0x17e9d2['push']({'name':_0x59633c[_0x5f72('0xc3')][_0x5f72('0xcc')][_0x5f72('0xc5')][_0x5f72('0xc6')][_0x5f72('0xc5')],'value':_0x5f72('0xcd')},{'name':_0x59633c[_0x5f72('0xc3')][_0x5f72('0xce')]['Label'][_0x5f72('0xc6')]['Label'],'value':_0x5f72('0xcf')});var _0x78dd71={'id':_0x1a23b3+'_'+_0x59633c[_0x5f72('0xc8')],'name':_0x59633c['DisplayName']['UserLocalizedLabel'][_0x5f72('0xc5')],'custom':![],'options':_0x17e9d2};_0xf8d005['push'](_0x78dd71);return _0xf8d005;});}function getInputList(_0x1718d2,_0x3abbb8,_0x5c15e7,_0x5d7dbe,_0x9d0259,_0x266204,_0x5587a3){var _0x196021={'method':_0x5f72('0xab'),'uri':_0x1718d2+'EntityDefinitions('+_0x9d0259+_0x5f72('0xcb')+_0x266204+_0x5f72('0xd0')+_0x5c15e7+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0x5f72('0xa8')+_0x5587a3,'If-None-Match':null,'OData-Version':_0x5f72('0xa9')},'json':!![]};return rp(_0x196021)[_0x5f72('0x28')](function(_0x1bc7ff){var _0x52dfe6={'id':_0x3abbb8+'_'+_0x1bc7ff[_0x5f72('0xc8')],'name':_0x1bc7ff[_0x5f72('0xc9')][_0x5f72('0xc6')]?_0x1bc7ff[_0x5f72('0xc9')][_0x5f72('0xc6')]['Label']:_0x1bc7ff[_0x5f72('0xc8')],'custom':![],'options':[]};_0x5d7dbe[_0x5f72('0xb0')](_0x52dfe6);return _0x5d7dbe;});} \ No newline at end of file +var _0xee39=['modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','prioritycodename','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slaname','socialprofileidname','subjectidname','ticketnumber','transactioncurrencyidname','utcconversiontimezonecode','concat','password','remoteUri','tenantId','clientId','clientSecret','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','https://login.microsoftonline.com/','/oauth2/token','username','GET','Bearer\x20','4.0','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','includes','LogicalName','forEach','@odata.type','all','isNil','BooleanAttributeMetadata','push','StringAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','error','Wrong\x20credentials','statusCode',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Options','Label','UserLocalizedLabel','Value','OptionSet','TrueOption','true','DisplayName',')/Attributes(',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','Dynamics365Account','fieldName','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','include','rows','catch','show','params','keys','find','create','body','getConfigurations','findOne','Dynamics365Configuration','rawAttributes','hasOwnProperty','AccountId','Subjects','getSubjects','getDescriptions','channel','Dynamics365Field','incident','PhoneCall','title','customerid','ownerid','subject','phonenumber','directioncode','phonecall_activity_parties','accountidyominame','actualserviceunits','contactidname','contactidyominame','contractdetailidname','createdbyexternalpartyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon'];(function(_0x348f2e,_0x415a3f){var _0x23f653=function(_0x5c6c5d){while(--_0x5c6c5d){_0x348f2e['push'](_0x348f2e['shift']());}};_0x23f653(++_0x415a3f);}(_0xee39,0x1e6));var _0x9ee3=function(_0x15cf36,_0x2326be){_0x15cf36=_0x15cf36-0x0;var _0x1ba2b9=_0xee39[_0x15cf36];return _0x1ba2b9;};'use strict';var emlformat=require(_0x9ee3('0x0'));var rimraf=require(_0x9ee3('0x1'));var zipdir=require(_0x9ee3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9ee3('0x3'));var moment=require(_0x9ee3('0x4'));var BPromise=require(_0x9ee3('0x5'));var Mustache=require(_0x9ee3('0x6'));var util=require(_0x9ee3('0x7'));var path=require(_0x9ee3('0x8'));var sox=require(_0x9ee3('0x9'));var csv=require(_0x9ee3('0xa'));var ejs=require(_0x9ee3('0xb'));var fs=require('fs');var fs_extra=require(_0x9ee3('0xc'));var _=require('lodash');var squel=require(_0x9ee3('0xd'));var crypto=require(_0x9ee3('0xe'));var jsforce=require(_0x9ee3('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x9ee3('0xa'));var querystring=require('querystring');var Papa=require(_0x9ee3('0x10'));var Redis=require('ioredis');var authService=require(_0x9ee3('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9ee3('0x12'));var logger=require('../../config/logger')(_0x9ee3('0x13'));var utils=require('../../config/utils');var config=require(_0x9ee3('0x14'));var licenseUtil=require(_0x9ee3('0x15'));var db=require(_0x9ee3('0x16'))['db'];var integrations=require(_0x9ee3('0x17'));function respondWithStatusCode(_0x262724,_0x46eb9c){_0x46eb9c=_0x46eb9c||0xcc;return function(_0x64e211){if(_0x64e211){return _0x262724['sendStatus'](_0x46eb9c);}return _0x262724[_0x9ee3('0x18')](_0x46eb9c)[_0x9ee3('0x19')]();};}function respondWithResult(_0x7fa8c,_0x579438){_0x579438=_0x579438||0xc8;return function(_0x2cd693){if(_0x2cd693){return _0x7fa8c[_0x9ee3('0x18')](_0x579438)[_0x9ee3('0x1a')](_0x2cd693);}};}function respondWithFilteredResult(_0x4240e5,_0x53f4a0){return function(_0x47ce82){if(_0x47ce82){var _0xa60602=typeof _0x53f4a0[_0x9ee3('0x1b')]===_0x9ee3('0x1c')&&typeof _0x53f4a0[_0x9ee3('0x1d')]===_0x9ee3('0x1c');var _0x407a52=_0x47ce82['count'];var _0x4a987a=_0xa60602?0x0:_0x53f4a0[_0x9ee3('0x1b')];var _0x1342e2=_0xa60602?_0x47ce82[_0x9ee3('0x1e')]:_0x53f4a0[_0x9ee3('0x1b')]+_0x53f4a0[_0x9ee3('0x1d')];var _0x25fad6;if(_0x1342e2>=_0x407a52){_0x1342e2=_0x407a52;_0x25fad6=0xc8;}else{_0x25fad6=0xce;}_0x4240e5[_0x9ee3('0x18')](_0x25fad6);return _0x4240e5[_0x9ee3('0x1f')](_0x9ee3('0x20'),_0x4a987a+'-'+_0x1342e2+'/'+_0x407a52)[_0x9ee3('0x1a')](_0x47ce82);}return null;};}function patchUpdates(_0x506040){return function(_0x40f553){try{jsonpatch[_0x9ee3('0x21')](_0x40f553,_0x506040,!![]);}catch(_0x136706){return BPromise[_0x9ee3('0x22')](_0x136706);}return _0x40f553[_0x9ee3('0x23')]();};}function saveUpdates(_0x44bc5a,_0x5f1c6a){return function(_0xa34734){if(_0xa34734){return _0xa34734[_0x9ee3('0x24')](_0x44bc5a)[_0x9ee3('0x25')](function(_0x2533c6){return _0x2533c6;});}return null;};}function removeEntity(_0x54f404,_0x511a84){return function(_0x4142fc){if(_0x4142fc){return _0x4142fc[_0x9ee3('0x26')]()[_0x9ee3('0x25')](function(){_0x54f404[_0x9ee3('0x18')](0xcc)[_0x9ee3('0x19')]();});}};}function handleEntityNotFound(_0x123fc7,_0x353e55){return function(_0x144c79){if(!_0x144c79){_0x123fc7[_0x9ee3('0x27')](0x194);}return _0x144c79;};}function handleError(_0x3bfe3e,_0x3b17d8){_0x3b17d8=_0x3b17d8||0x1f4;return function(_0x598276){logger['error'](_0x598276[_0x9ee3('0x28')]);if(_0x598276[_0x9ee3('0x29')]){delete _0x598276[_0x9ee3('0x29')];}_0x3bfe3e[_0x9ee3('0x18')](_0x3b17d8)[_0x9ee3('0x2a')](_0x598276);};}exports[_0x9ee3('0x2b')]=function(_0x24f68f,_0x454f96){var _0xe64e6c={},_0x5633a3={},_0x41037f={'count':0x0,'rows':[]};var _0x182f21=_[_0x9ee3('0x2c')](db[_0x9ee3('0x2d')]['rawAttributes'],function(_0xb5987a){return{'name':_0xb5987a[_0x9ee3('0x2e')],'type':_0xb5987a['type'][_0x9ee3('0x2f')]};});_0x5633a3[_0x9ee3('0x30')]=_[_0x9ee3('0x2c')](_0x182f21,'name');_0x5633a3[_0x9ee3('0x31')]=_['keys'](_0x24f68f['query']);_0x5633a3[_0x9ee3('0x32')]=_[_0x9ee3('0x33')](_0x5633a3[_0x9ee3('0x30')],_0x5633a3[_0x9ee3('0x31')]);_0xe64e6c['attributes']=_[_0x9ee3('0x33')](_0x5633a3[_0x9ee3('0x30')],qs[_0x9ee3('0x34')](_0x24f68f[_0x9ee3('0x31')]['fields']));_0xe64e6c['attributes']=_0xe64e6c[_0x9ee3('0x35')][_0x9ee3('0x36')]?_0xe64e6c['attributes']:_0x5633a3[_0x9ee3('0x30')];if(!_0x24f68f[_0x9ee3('0x31')]['hasOwnProperty'](_0x9ee3('0x37'))){_0xe64e6c[_0x9ee3('0x1d')]=qs[_0x9ee3('0x1d')](_0x24f68f[_0x9ee3('0x31')]['limit']);_0xe64e6c[_0x9ee3('0x1b')]=qs[_0x9ee3('0x1b')](_0x24f68f[_0x9ee3('0x31')][_0x9ee3('0x1b')]);}_0xe64e6c[_0x9ee3('0x38')]=qs[_0x9ee3('0x39')](_0x24f68f[_0x9ee3('0x31')][_0x9ee3('0x39')]);_0xe64e6c[_0x9ee3('0x3a')]=qs[_0x9ee3('0x32')](_[_0x9ee3('0x3b')](_0x24f68f[_0x9ee3('0x31')],_0x5633a3[_0x9ee3('0x32')]),_0x182f21);if(_0x24f68f[_0x9ee3('0x31')][_0x9ee3('0x3c')]){_0xe64e6c[_0x9ee3('0x3a')]=_[_0x9ee3('0x3d')](_0xe64e6c[_0x9ee3('0x3a')],{'$or':_['map'](_0x182f21,function(_0xc2c10a){if(_0xc2c10a[_0x9ee3('0x3e')]!=='VIRTUAL'){var _0x1068fe={};_0x1068fe[_0xc2c10a[_0x9ee3('0x29')]]={'$like':'%'+_0x24f68f['query'][_0x9ee3('0x3c')]+'%'};return _0x1068fe;}})});}_0xe64e6c=_[_0x9ee3('0x3d')]({},_0xe64e6c,_0x24f68f[_0x9ee3('0x3f')]);var _0x5a3acb={'where':_0xe64e6c[_0x9ee3('0x3a')]};return db[_0x9ee3('0x2d')][_0x9ee3('0x1e')](_0x5a3acb)[_0x9ee3('0x25')](function(_0x31cf6d){_0x41037f[_0x9ee3('0x1e')]=_0x31cf6d;if(_0x24f68f[_0x9ee3('0x31')][_0x9ee3('0x40')]){_0xe64e6c[_0x9ee3('0x41')]=[{'all':!![]}];}return db[_0x9ee3('0x2d')]['findAll'](_0xe64e6c);})[_0x9ee3('0x25')](function(_0x39ef8c){_0x41037f[_0x9ee3('0x42')]=_0x39ef8c;return _0x41037f;})[_0x9ee3('0x25')](respondWithFilteredResult(_0x454f96,_0xe64e6c))[_0x9ee3('0x43')](handleError(_0x454f96,null));};exports[_0x9ee3('0x44')]=function(_0x44be20,_0x3f1ded){var _0x301976={'raw':![],'where':{'id':_0x44be20[_0x9ee3('0x45')]['id']}},_0x7b854d={};_0x7b854d[_0x9ee3('0x30')]=_[_0x9ee3('0x46')](db[_0x9ee3('0x2d')]['rawAttributes']);_0x7b854d[_0x9ee3('0x31')]=_['keys'](_0x44be20[_0x9ee3('0x31')]);_0x7b854d[_0x9ee3('0x32')]=_[_0x9ee3('0x33')](_0x7b854d[_0x9ee3('0x30')],_0x7b854d['query']);_0x301976[_0x9ee3('0x35')]=_['intersection'](_0x7b854d['model'],qs[_0x9ee3('0x34')](_0x44be20[_0x9ee3('0x31')]['fields']));_0x301976[_0x9ee3('0x35')]=_0x301976['attributes'][_0x9ee3('0x36')]?_0x301976['attributes']:_0x7b854d[_0x9ee3('0x30')];if(_0x44be20['query']['includeAll']){_0x301976[_0x9ee3('0x41')]=[{'all':!![]}];}_0x301976=_[_0x9ee3('0x3d')]({},_0x301976,_0x44be20[_0x9ee3('0x3f')]);return db['Dynamics365Account'][_0x9ee3('0x47')](_0x301976)[_0x9ee3('0x25')](handleEntityNotFound(_0x3f1ded,null))[_0x9ee3('0x25')](respondWithResult(_0x3f1ded,null))[_0x9ee3('0x43')](handleError(_0x3f1ded,null));};exports[_0x9ee3('0x48')]=function(_0x320cd6,_0x38d43f){return db['Dynamics365Account'][_0x9ee3('0x48')](_0x320cd6[_0x9ee3('0x49')],{})[_0x9ee3('0x25')](respondWithResult(_0x38d43f,0xc9))[_0x9ee3('0x43')](handleError(_0x38d43f,null));};exports['update']=function(_0x4005b5,_0xaa10be){if(_0x4005b5[_0x9ee3('0x49')]['id']){delete _0x4005b5['body']['id'];}return db[_0x9ee3('0x2d')][_0x9ee3('0x47')]({'where':{'id':_0x4005b5['params']['id']}})[_0x9ee3('0x25')](handleEntityNotFound(_0xaa10be,null))[_0x9ee3('0x25')](saveUpdates(_0x4005b5[_0x9ee3('0x49')],null))[_0x9ee3('0x25')](respondWithResult(_0xaa10be,null))[_0x9ee3('0x43')](handleError(_0xaa10be,null));};exports[_0x9ee3('0x26')]=function(_0x4ce44f,_0x5676a7){return db[_0x9ee3('0x2d')]['find']({'where':{'id':_0x4ce44f[_0x9ee3('0x45')]['id']}})[_0x9ee3('0x25')](handleEntityNotFound(_0x5676a7,null))['then'](removeEntity(_0x5676a7,null))['catch'](handleError(_0x5676a7,null));};exports[_0x9ee3('0x4a')]=function(_0x4e2aac,_0xeb05c1,_0x27def9){var _0x1116c0={};var _0x2643bc={};var _0x5bae59;var _0x4f8999;return db[_0x9ee3('0x2d')][_0x9ee3('0x4b')]({'where':{'id':_0x4e2aac[_0x9ee3('0x45')]['id']}})[_0x9ee3('0x25')](handleEntityNotFound(_0xeb05c1,null))[_0x9ee3('0x25')](function(_0x358720){if(_0x358720){_0x5bae59=_0x358720;_0x2643bc[_0x9ee3('0x30')]=_['keys'](db[_0x9ee3('0x4c')][_0x9ee3('0x4d')]);_0x2643bc[_0x9ee3('0x31')]=_[_0x9ee3('0x46')](_0x4e2aac[_0x9ee3('0x31')]);_0x2643bc[_0x9ee3('0x32')]=_['intersection'](_0x2643bc[_0x9ee3('0x30')],_0x2643bc['query']);_0x1116c0[_0x9ee3('0x35')]=_[_0x9ee3('0x33')](_0x2643bc[_0x9ee3('0x30')],qs[_0x9ee3('0x34')](_0x4e2aac[_0x9ee3('0x31')]['fields']));_0x1116c0[_0x9ee3('0x35')]=_0x1116c0[_0x9ee3('0x35')][_0x9ee3('0x36')]?_0x1116c0['attributes']:_0x2643bc[_0x9ee3('0x30')];_0x1116c0[_0x9ee3('0x38')]=qs['sort'](_0x4e2aac[_0x9ee3('0x31')][_0x9ee3('0x39')]);_0x1116c0['where']=qs[_0x9ee3('0x32')](_[_0x9ee3('0x3b')](_0x4e2aac['query'],_0x2643bc[_0x9ee3('0x32')]));if(_0x4e2aac[_0x9ee3('0x31')]['filter']){_0x1116c0[_0x9ee3('0x3a')]=_[_0x9ee3('0x3d')](_0x1116c0['where'],{'$or':_[_0x9ee3('0x2c')](_0x1116c0[_0x9ee3('0x35')],function(_0x34c070){var _0x25806a={};_0x25806a[_0x34c070]={'$like':'%'+_0x4e2aac[_0x9ee3('0x31')][_0x9ee3('0x3c')]+'%'};return _0x25806a;})});}_0x1116c0=_[_0x9ee3('0x3d')]({},_0x1116c0,_0x4e2aac[_0x9ee3('0x3f')]);return _0x5bae59[_0x9ee3('0x4a')](_0x1116c0);}})[_0x9ee3('0x25')](function(_0x36503){if(_0x36503){_0x4f8999=_0x36503[_0x9ee3('0x36')];if(!_0x4e2aac[_0x9ee3('0x31')][_0x9ee3('0x4e')](_0x9ee3('0x37'))){_0x1116c0['limit']=qs[_0x9ee3('0x1d')](_0x4e2aac[_0x9ee3('0x31')][_0x9ee3('0x1d')]);_0x1116c0[_0x9ee3('0x1b')]=qs[_0x9ee3('0x1b')](_0x4e2aac['query'][_0x9ee3('0x1b')]);}return _0x5bae59['getConfigurations'](_0x1116c0);}})[_0x9ee3('0x25')](function(_0x274dc8){if(_0x274dc8){return _0x274dc8?{'count':_0x4f8999,'rows':_0x274dc8}:null;}})[_0x9ee3('0x25')](respondWithResult(_0xeb05c1,null))[_0x9ee3('0x43')](handleError(_0xeb05c1,null));};exports['addConfiguration']=function(_0x4f2b80,_0x4284a3,_0x16ed27){if(_0x4f2b80[_0x9ee3('0x49')]['id']){delete _0x4f2b80[_0x9ee3('0x49')]['id'];}return db['Dynamics365Account'][_0x9ee3('0x4b')]({'where':{'id':_0x4f2b80[_0x9ee3('0x45')]['id']}})['then'](handleEntityNotFound(_0x4284a3,null))['then'](function(_0xd6e80f){if(_0xd6e80f){_0x4f2b80[_0x9ee3('0x49')][_0x9ee3('0x4f')]=_0xd6e80f['id'];_0x4f2b80[_0x9ee3('0x49')][_0x9ee3('0x50')]=integrations[_0x9ee3('0x51')](_0x4f2b80[_0x9ee3('0x49')]['channel'],_0x4f2b80['body']['type']);_0x4f2b80[_0x9ee3('0x49')]['Descriptions']=integrations[_0x9ee3('0x52')](_0x4f2b80[_0x9ee3('0x49')][_0x9ee3('0x53')],_0x4f2b80['body'][_0x9ee3('0x3e')]);return db[_0x9ee3('0x4c')][_0x9ee3('0x48')](_0x4f2b80[_0x9ee3('0x49')],{'include':[{'model':db[_0x9ee3('0x54')],'as':_0x9ee3('0x50')},{'model':db[_0x9ee3('0x54')],'as':'Descriptions'}]});}return null;})[_0x9ee3('0x25')](respondWithResult(_0x4284a3,null))[_0x9ee3('0x43')](handleError(_0x4284a3,null));};exports['getFields']=function(_0x1592eb,_0x326927,_0x36da32){var _0x3650bd=_0x1592eb[_0x9ee3('0x31')]['ticketType'];var _0x3cd92d=_0x3650bd===_0x9ee3('0x55')?'Incident':_0x9ee3('0x56');var _0x1fd079='';var _0x5ae68d='';var _0x281719='';var _0x29efd6='';var _0x938cc7='';var _0x5c7852='';var _0x1fec98='';var _0x26e860='';var _0x1c2223=[_0x9ee3('0x57'),'description',_0x9ee3('0x58'),_0x9ee3('0x59'),'caseorigincode',_0x9ee3('0x5a'),_0x9ee3('0x5b'),'regardingobjectid',_0x9ee3('0x5c'),_0x9ee3('0x5d')];var _0xa3db9e=['accountidname',_0x9ee3('0x5e'),_0x9ee3('0x5f'),'billedserviceunits',_0x9ee3('0x60'),_0x9ee3('0x61'),_0x9ee3('0x62'),'contractidname',_0x9ee3('0x63'),'createdbyexternalpartyyominame','createdbyname',_0x9ee3('0x64'),_0x9ee3('0x65'),_0x9ee3('0x66'),_0x9ee3('0x67'),_0x9ee3('0x68'),_0x9ee3('0x69'),_0x9ee3('0x6a'),_0x9ee3('0x6b'),_0x9ee3('0x6c'),_0x9ee3('0x6d'),_0x9ee3('0x6e'),_0x9ee3('0x6f'),'exchangerate',_0x9ee3('0x70'),_0x9ee3('0x71'),_0x9ee3('0x72'),_0x9ee3('0x73'),_0x9ee3('0x74'),_0x9ee3('0x75'),_0x9ee3('0x76'),'modifiedbyexternalpartyname',_0x9ee3('0x77'),_0x9ee3('0x78'),_0x9ee3('0x79'),_0x9ee3('0x7a'),_0x9ee3('0x7b'),_0x9ee3('0x7c'),_0x9ee3('0x7d'),_0x9ee3('0x7e'),_0x9ee3('0x7f'),'onholdtime','overriddencreatedon',_0x9ee3('0x80'),_0x9ee3('0x81'),_0x9ee3('0x82'),_0x9ee3('0x83'),_0x9ee3('0x84'),'primarycontactidyominame',_0x9ee3('0x85'),'productidname',_0x9ee3('0x86'),_0x9ee3('0x87'),_0x9ee3('0x88'),_0x9ee3('0x89'),_0x9ee3('0x8a'),_0x9ee3('0x8b'),_0x9ee3('0x8c'),'slainvokedidname',_0x9ee3('0x8d'),_0x9ee3('0x8e'),'statecode','statuscode',_0x9ee3('0x8f'),_0x9ee3('0x90'),'timezoneruleversionnumber',_0x9ee3('0x91'),'traversedpath',_0x9ee3('0x92'),'versionnumber'];var _0x2177ac=_0x1c2223[_0x9ee3('0x93')](_0xa3db9e);return db[_0x9ee3('0x2d')][_0x9ee3('0x4b')]({'where':{'id':_0x1592eb[_0x9ee3('0x45')]['id']},'attributes':['id','username',_0x9ee3('0x94'),_0x9ee3('0x95'),_0x9ee3('0x96'),_0x9ee3('0x97'),_0x9ee3('0x98')]})[_0x9ee3('0x25')](handleEntityNotFound(_0x326927,null))[_0x9ee3('0x25')](function(_0x413c6e){if(_0x413c6e){_0x26e860=_0x413c6e['remoteUri'];var _0x41026e=_0x26e860[_0x9ee3('0x99')](-0x1);if(_0x41026e==='/'){_0x26e860=_0x26e860[_0x9ee3('0x9a')](0x0,_0x26e860[_0x9ee3('0x9b')](_0x41026e));}_0x1fec98=util[_0x9ee3('0x9c')](_0x9ee3('0x9d'),_0x26e860);var _0x583f7e={'method':'POST','uri':_0x9ee3('0x9e')+_0x413c6e[_0x9ee3('0x96')]+_0x9ee3('0x9f'),'form':{'client_id':_0x413c6e[_0x9ee3('0x97')],'resource':_0x26e860,'username':_0x413c6e[_0x9ee3('0xa0')],'password':_0x413c6e['password'],'grant_type':_0x9ee3('0x94'),'client_secret':_0x413c6e[_0x9ee3('0x98')]},'json':!![]};return rp(_0x583f7e);}})[_0x9ee3('0x25')](function(_0x5ef0f8){_0x5c7852=_0x5ef0f8['access_token'];var _0x2ad6cb={'method':_0x9ee3('0xa1'),'uri':encodeURI(_0x1fec98+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x3cd92d+'\x27'),'headers':{'Authorization':_0x9ee3('0xa2')+_0x5c7852,'If-None-Match':null,'OData-Version':_0x9ee3('0xa3')},'json':!![]};return rp(_0x2ad6cb);})[_0x9ee3('0x25')](function(_0x5535fa){var _0x3e4ec3=_0x5535fa['value'][0x0];var _0x44c9a1=_0x3e4ec3[_0x9ee3('0xa4')];var _0x45a05d={'method':_0x9ee3('0xa1'),'uri':_0x1fec98+_0x9ee3('0xa5')+_0x44c9a1+_0x9ee3('0xa6'),'headers':{'Authorization':_0x9ee3('0xa2')+_0x5c7852,'If-None-Match':null,'OData-Version':_0x9ee3('0xa3')},'json':!![]};return rp(_0x45a05d);})['then'](function(_0x15fb31){_0x1fd079=_0x15fb31;_0x5ae68d=_0x1fd079[_0x9ee3('0xa7')];_0x5ae68d=_[_0x9ee3('0xa8')](_0x5ae68d,function(_0x4bf3ef){return!_0x2177ac[_0x9ee3('0xa9')](_0x4bf3ef[_0x9ee3('0xaa')]);});var _0x2ac72c=[];var _0x33efe2=[];_0x5ae68d[_0x9ee3('0xab')](function(_0x1bc93a){if(_0x1bc93a[_0x9ee3('0xac')]){var _0x1c76cf=_0x1bc93a[_0x9ee3('0xac')]['substring'](_0x1bc93a['@odata.type'][_0x9ee3('0x9b')]('.')+0x1);if(_0x1c76cf==='PicklistAttributeMetadata'){_0x2ac72c['push'](getSelectList(_0x1fec98,_0x3650bd,_0x33efe2,_0x1fd079[_0x9ee3('0xa4')],_0x1bc93a[_0x9ee3('0xa4')],_0x5c7852));}}});return Promise[_0x9ee3('0xad')](_0x2ac72c);})[_0x9ee3('0x25')](function(_0x537588){_0x281719=_0x537588[0x0];var _0x1aceff=[];var _0x1e846c=[];_0x5ae68d[_0x9ee3('0xab')](function(_0x164763){if(!_[_0x9ee3('0xae')](_0x164763[_0x9ee3('0xac')])){var _0x10abed=_0x164763[_0x9ee3('0xac')][_0x9ee3('0x9a')](_0x164763[_0x9ee3('0xac')][_0x9ee3('0x9b')]('.')+0x1);if(_0x10abed===_0x9ee3('0xaf')){_0x1aceff[_0x9ee3('0xb0')](getBooleanList(_0x1fec98,_0x3650bd,_0x1e846c,_0x1fd079[_0x9ee3('0xa4')],_0x164763['MetadataId'],_0x5c7852));}}});return Promise[_0x9ee3('0xad')](_0x1aceff);})[_0x9ee3('0x25')](function(_0x410b3e){_0x29efd6=_0x410b3e[0x0];var _0x5c7f14=[];var _0x441527=[];_0x5ae68d[_0x9ee3('0xab')](function(_0x501de8){if(_0x501de8[_0x9ee3('0xac')]){var _0x811ec=_0x501de8[_0x9ee3('0xac')][_0x9ee3('0x9a')](_0x501de8[_0x9ee3('0xac')][_0x9ee3('0x9b')]('.')+0x1);if(_0x811ec===_0x9ee3('0xb1')||_0x811ec==='DoubleAttributeMetadata'||_0x811ec===_0x9ee3('0xb2')||_0x811ec===_0x9ee3('0xb3')||_0x811ec===_0x9ee3('0xb4')||_0x811ec===_0x9ee3('0xb5')||_0x811ec===_0x9ee3('0xb6')||_0x811ec===_0x9ee3('0xb7')||_0x811ec===_0x9ee3('0xb8')||_0x811ec===_0x9ee3('0xb9')){_0x5c7f14[_0x9ee3('0xb0')](getInputList(_0x1fec98,_0x3650bd,_0x811ec,_0x441527,_0x1fd079[_0x9ee3('0xa4')],_0x501de8[_0x9ee3('0xa4')],_0x5c7852));}}});return Promise[_0x9ee3('0xad')](_0x5c7f14);})[_0x9ee3('0x25')](function(_0x5cd6c9){_0x938cc7=_0x5cd6c9[0x0];var _0x5738bf=_0x281719[_0x9ee3('0x93')](_0x29efd6)[_0x9ee3('0x93')](_0x938cc7);var _0x21b3f3={'count':_0x5738bf[_0x9ee3('0x36')],'rows':_0x5738bf};return _0x21b3f3;})['then'](respondWithResult(_0x326927,null))[_0x9ee3('0x43')](function(_0xe009c5){var _0x15926d=_0x1592eb[_0x9ee3('0x31')][_0x9ee3('0xba')]?0x1f4:_0xe009c5['statusCode']||0x1f4;logger[_0x9ee3('0xbb')](_0xe009c5['stack']);delete _0xe009c5[_0x9ee3('0x29')];if(_0x15926d===0x191){_0x15926d=0x190;}_0x326927['status'](_0x15926d)[_0x9ee3('0x2a')](_0x1592eb['query'][_0x9ee3('0xba')]?{'message':_0x9ee3('0xbc'),'statusCode':_0xe009c5[_0x9ee3('0xbd')]}:_0xe009c5);});};function getSelectList(_0x596cea,_0xcd483b,_0x4751df,_0x18a5e2,_0x16d8a2,_0x40d7f1){var _0x3ae1ab={'method':_0x9ee3('0xa1'),'uri':_0x596cea+_0x9ee3('0xa5')+_0x18a5e2+')/Attributes('+_0x16d8a2+_0x9ee3('0xbe')+_0x9ee3('0xbf'),'headers':{'Authorization':_0x9ee3('0xa2')+_0x40d7f1,'If-None-Match':null,'OData-Version':_0x9ee3('0xa3')},'json':!![]};return rp(_0x3ae1ab)[_0x9ee3('0x25')](function(_0x14c99a){var _0x30cbf1=[];var _0x3f7f6c=_0x14c99a['OptionSet'][_0x9ee3('0xc0')];_0x3f7f6c[_0x9ee3('0xab')](function(_0x4f1fbd){_0x30cbf1[_0x9ee3('0xb0')]({'name':_0x4f1fbd[_0x9ee3('0xc1')][_0x9ee3('0xc2')][_0x9ee3('0xc1')],'value':String(_0x4f1fbd[_0x9ee3('0xc3')])});});var _0x5b8b93={'id':_0xcd483b+'_'+_0x14c99a[_0x9ee3('0xaa')],'name':_0x14c99a['DisplayName'][_0x9ee3('0xc2')][_0x9ee3('0xc1')],'custom':![],'options':_0x30cbf1};_0x4751df[_0x9ee3('0xb0')](_0x5b8b93);return _0x4751df;});}function getBooleanList(_0x7995c4,_0x20f16b,_0x1defcd,_0x1bb273,_0x27923a,_0x521828){var _0xe25c4d={'method':_0x9ee3('0xa1'),'uri':_0x7995c4+_0x9ee3('0xa5')+_0x1bb273+')/Attributes('+_0x27923a+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':_0x9ee3('0xa2')+_0x521828,'If-None-Match':null,'OData-Version':_0x9ee3('0xa3')},'json':!![]};return rp(_0xe25c4d)['then'](function(_0x3ab1ae){var _0x39da5a=[];_0x39da5a['push']({'name':_0x3ab1ae[_0x9ee3('0xc4')][_0x9ee3('0xc5')][_0x9ee3('0xc1')][_0x9ee3('0xc2')][_0x9ee3('0xc1')],'value':_0x9ee3('0xc6')},{'name':_0x3ab1ae[_0x9ee3('0xc4')]['FalseOption'][_0x9ee3('0xc1')][_0x9ee3('0xc2')][_0x9ee3('0xc1')],'value':'false'});var _0x4683ef={'id':_0x20f16b+'_'+_0x3ab1ae[_0x9ee3('0xaa')],'name':_0x3ab1ae[_0x9ee3('0xc7')][_0x9ee3('0xc2')][_0x9ee3('0xc1')],'custom':![],'options':_0x39da5a};_0x1defcd[_0x9ee3('0xb0')](_0x4683ef);return _0x1defcd;});}function getInputList(_0x1d859b,_0x3a39d9,_0x5e0388,_0x55917f,_0x23695a,_0x58eca8,_0x2a89a5){var _0x165e00={'method':_0x9ee3('0xa1'),'uri':_0x1d859b+_0x9ee3('0xa5')+_0x23695a+_0x9ee3('0xc8')+_0x58eca8+_0x9ee3('0xc9')+_0x5e0388+_0x9ee3('0xca'),'headers':{'Authorization':_0x9ee3('0xa2')+_0x2a89a5,'If-None-Match':null,'OData-Version':_0x9ee3('0xa3')},'json':!![]};return rp(_0x165e00)[_0x9ee3('0x25')](function(_0x50dcbc){var _0x4c2787={'id':_0x3a39d9+'_'+_0x50dcbc[_0x9ee3('0xaa')],'name':_0x50dcbc[_0x9ee3('0xc7')][_0x9ee3('0xc2')]?_0x50dcbc[_0x9ee3('0xc7')][_0x9ee3('0xc2')][_0x9ee3('0xc1')]:_0x50dcbc['LogicalName'],'custom':![],'options':[]};_0x55917f[_0x9ee3('0xb0')](_0x4c2787);return _0x55917f;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 059ff6f..029cc19 100644 --- a/server/api/intDynamics365Account/intDynamics365Account.model.js +++ b/server/api/intDynamics365Account/intDynamics365Account.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb7e7=['int_dynamics365_accounts','lodash','../../config/logger','moment','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','define'];(function(_0x113563,_0x178f66){var _0x12738e=function(_0x50bfd9){while(--_0x50bfd9){_0x113563['push'](_0x113563['shift']());}};_0x12738e(++_0x178f66);}(_0xb7e7,0x121));var _0x7b7e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xb7e7[_0x2f3848];return _0x102668;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x333fa4,_0x372bde){return _0x333fa4[_0x7b7e('0x7')]('Dynamics365Account',attributes,{'tableName':_0x7b7e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcb91=['rimraf','./intDynamics365Account.attributes','../../components/integrations/configuration','Dynamics365Account','int_dynamics365_accounts','../../config/logger','api','moment','bluebird','path'];(function(_0x16f05b,_0x70d41b){var _0x27f065=function(_0x41c3bf){while(--_0x41c3bf){_0x16f05b['push'](_0x16f05b['shift']());}};_0x27f065(++_0x70d41b);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4480b9,_0x5c2949){_0x4480b9=_0x4480b9-0x0;var _0x3f0f02=_0xcb91[_0x4480b9];return _0x3f0f02;};'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 159a08e..730b90b 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 _0xce35=['attributes','model','info','debug','GetDynamics365Account','ShowDynamics365Account','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','Dynamics365Account,\x20%s,\x20%s','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','Dynamics365Account','options','where','limit','include','map'];(function(_0x18914a,_0x1878cd){var _0x1adffb=function(_0x13d1ca){while(--_0x13d1ca){_0x18914a['push'](_0x18914a['shift']());}};_0x1adffb(++_0x1878cd);}(_0xce35,0xb0));var _0x5ce3=function(_0x33b74a,_0x58253e){_0x33b74a=_0x33b74a-0x0;var _0x52dfc2=_0xce35[_0x33b74a];return _0x52dfc2;};'use strict';var _=require('lodash');var util=require(_0x5ce3('0x0'));var moment=require(_0x5ce3('0x1'));var BPromise=require(_0x5ce3('0x2'));var rs=require(_0x5ce3('0x3'));var fs=require('fs');var Redis=require(_0x5ce3('0x4'));var db=require(_0x5ce3('0x5'))['db'];var utils=require(_0x5ce3('0x6'));var logger=require(_0x5ce3('0x7'))(_0x5ce3('0x8'));var config=require(_0x5ce3('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x5ce3('0xa')][_0x5ce3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3494ba,_0x3cb4c3,_0x2a1607){return new BPromise(function(_0x26df59,_0x121bc7){return client[_0x5ce3('0xc')](_0x3494ba,_0x2a1607)[_0x5ce3('0xd')](function(_0x2541e8){logger['info'](_0x5ce3('0xe'),_0x3cb4c3,_0x5ce3('0xf'));logger['debug'](_0x5ce3('0x10'),_0x3cb4c3,_0x5ce3('0xf'),JSON[_0x5ce3('0x11')](_0x2541e8));if(_0x2541e8[_0x5ce3('0x12')]){if(_0x2541e8[_0x5ce3('0x12')]['code']===0x1f4){logger[_0x5ce3('0x12')](_0x5ce3('0xe'),_0x3cb4c3,_0x2541e8[_0x5ce3('0x12')][_0x5ce3('0x13')]);return _0x121bc7(_0x2541e8[_0x5ce3('0x12')][_0x5ce3('0x13')]);}logger[_0x5ce3('0x12')](_0x5ce3('0xe'),_0x3cb4c3,_0x2541e8[_0x5ce3('0x12')]['message']);return _0x26df59(_0x2541e8[_0x5ce3('0x12')][_0x5ce3('0x13')]);}else{logger['info']('Dynamics365Account,\x20%s,\x20%s',_0x3cb4c3,_0x5ce3('0xf'));_0x26df59(_0x2541e8[_0x5ce3('0x14')][_0x5ce3('0x13')]);}})[_0x5ce3('0x15')](function(_0x53717e){logger[_0x5ce3('0x12')](_0x5ce3('0xe'),_0x3cb4c3,_0x53717e);_0x121bc7(_0x53717e);});});}exports['GetDynamics365Account']=function(_0x4bcdd0){var _0x5e1b20=this;return new Promise(function(_0x3c92e1,_0x5d194b){return db[_0x5ce3('0x16')]['findAll']({'raw':_0x4bcdd0[_0x5ce3('0x17')]?_0x4bcdd0[_0x5ce3('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x4bcdd0['options']?_0x4bcdd0['options'][_0x5ce3('0x18')]||null:null,'attributes':_0x4bcdd0[_0x5ce3('0x17')]?_0x4bcdd0['options']['attributes']||null:null,'limit':_0x4bcdd0[_0x5ce3('0x17')]?_0x4bcdd0[_0x5ce3('0x17')][_0x5ce3('0x19')]||null:null,'include':_0x4bcdd0[_0x5ce3('0x17')]?_0x4bcdd0[_0x5ce3('0x17')][_0x5ce3('0x1a')]?_[_0x5ce3('0x1b')](_0x4bcdd0[_0x5ce3('0x17')][_0x5ce3('0x1a')],function(_0xa2abe){return{'model':db[_0xa2abe['model']],'as':_0xa2abe['as'],'attributes':_0xa2abe[_0x5ce3('0x1c')],'include':_0xa2abe[_0x5ce3('0x1a')]?_[_0x5ce3('0x1b')](_0xa2abe[_0x5ce3('0x1a')],function(_0x433444){return{'model':db[_0x433444[_0x5ce3('0x1d')]],'as':_0x433444['as'],'attributes':_0x433444[_0x5ce3('0x1c')],'include':_0x433444[_0x5ce3('0x1a')]?_[_0x5ce3('0x1b')](_0x433444[_0x5ce3('0x1a')],function(_0x577d1a){return{'model':db[_0x577d1a['model']],'as':_0x577d1a['as'],'attributes':_0x577d1a[_0x5ce3('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x5ce3('0xd')](function(_0x6e8e6c){logger[_0x5ce3('0x1e')]('GetDynamics365Account',_0x4bcdd0);logger[_0x5ce3('0x1f')](_0x5ce3('0x20'),_0x4bcdd0,JSON[_0x5ce3('0x11')](_0x6e8e6c));_0x3c92e1(_0x6e8e6c);})[_0x5ce3('0x15')](function(_0x1ea684){logger['error']('GetDynamics365Account',_0x1ea684[_0x5ce3('0x13')],_0x4bcdd0);_0x5d194b(_0x5e1b20[_0x5ce3('0x12')](0x1f4,_0x1ea684['message']));});});};exports['ShowDynamics365Account']=function(_0x2afb95){var _0x211d0c=this;return new Promise(function(_0x1892dc,_0x5aaf38){return db[_0x5ce3('0x16')]['find']({'raw':_0x2afb95[_0x5ce3('0x17')]?_0x2afb95[_0x5ce3('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x2afb95[_0x5ce3('0x17')]?_0x2afb95[_0x5ce3('0x17')][_0x5ce3('0x18')]||null:null,'attributes':_0x2afb95[_0x5ce3('0x17')]?_0x2afb95[_0x5ce3('0x17')]['attributes']||null:null,'include':_0x2afb95[_0x5ce3('0x17')]?_0x2afb95[_0x5ce3('0x17')][_0x5ce3('0x1a')]?_['map'](_0x2afb95[_0x5ce3('0x17')][_0x5ce3('0x1a')],function(_0x5aba62){return{'model':db[_0x5aba62[_0x5ce3('0x1d')]],'as':_0x5aba62['as'],'attributes':_0x5aba62[_0x5ce3('0x1c')],'include':_0x5aba62[_0x5ce3('0x1a')]?_[_0x5ce3('0x1b')](_0x5aba62['include'],function(_0x350e3d){return{'model':db[_0x350e3d['model']],'as':_0x350e3d['as'],'attributes':_0x350e3d[_0x5ce3('0x1c')],'include':_0x350e3d['include']?_[_0x5ce3('0x1b')](_0x350e3d[_0x5ce3('0x1a')],function(_0x259271){return{'model':db[_0x259271['model']],'as':_0x259271['as'],'attributes':_0x259271[_0x5ce3('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x5ce3('0xd')](function(_0x648b5d){logger[_0x5ce3('0x1e')](_0x5ce3('0x21'),_0x2afb95);logger[_0x5ce3('0x1f')](_0x5ce3('0x21'),_0x2afb95,JSON[_0x5ce3('0x11')](_0x648b5d));_0x1892dc(_0x648b5d);})[_0x5ce3('0x15')](function(_0x5ac385){logger[_0x5ce3('0x12')](_0x5ce3('0x21'),_0x5ac385[_0x5ce3('0x13')],_0x2afb95);_0x5aaf38(_0x211d0c['error'](0x1f4,_0x5ac385[_0x5ce3('0x13')]));});});}; \ No newline at end of file +var _0x0a89=['result','catch','Dynamics365Account','findAll','options','limit','include','map','model','attributes','GetDynamics365Account','ShowDynamics365Account','find','raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','Dynamics365Account,\x20%s,\x20%s','message'];(function(_0x4e4625,_0x4c177c){var _0x4b9832=function(_0x3d4c9d){while(--_0x3d4c9d){_0x4e4625['push'](_0x4e4625['shift']());}};_0x4b9832(++_0x4c177c);}(_0x0a89,0xc2));var _0x90a8=function(_0x30b711,_0x1c3992){_0x30b711=_0x30b711-0x0;var _0x2551db=_0x0a89[_0x30b711];return _0x2551db;};'use strict';var _=require(_0x90a8('0x0'));var util=require(_0x90a8('0x1'));var moment=require(_0x90a8('0x2'));var BPromise=require(_0x90a8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x90a8('0x4'));var db=require(_0x90a8('0x5'))['db'];var utils=require(_0x90a8('0x6'));var logger=require(_0x90a8('0x7'))(_0x90a8('0x8'));var config=require(_0x90a8('0x9'));var jayson=require(_0x90a8('0xa'));var client=jayson[_0x90a8('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x18efda,_0x372670,_0x2ae979){return new BPromise(function(_0x194111,_0x1293c4){return client[_0x90a8('0xc')](_0x18efda,_0x2ae979)[_0x90a8('0xd')](function(_0x2dd5a8){logger[_0x90a8('0xe')]('Dynamics365Account,\x20%s,\x20%s',_0x372670,_0x90a8('0xf'));logger[_0x90a8('0x10')](_0x90a8('0x11'),_0x372670,_0x90a8('0xf'),JSON[_0x90a8('0x12')](_0x2dd5a8));if(_0x2dd5a8['error']){if(_0x2dd5a8['error']['code']===0x1f4){logger[_0x90a8('0x13')](_0x90a8('0x14'),_0x372670,_0x2dd5a8['error'][_0x90a8('0x15')]);return _0x1293c4(_0x2dd5a8['error'][_0x90a8('0x15')]);}logger[_0x90a8('0x13')](_0x90a8('0x14'),_0x372670,_0x2dd5a8[_0x90a8('0x13')][_0x90a8('0x15')]);return _0x194111(_0x2dd5a8[_0x90a8('0x13')][_0x90a8('0x15')]);}else{logger[_0x90a8('0xe')](_0x90a8('0x14'),_0x372670,'request\x20sent');_0x194111(_0x2dd5a8[_0x90a8('0x16')]['message']);}})[_0x90a8('0x17')](function(_0x3709cd){logger['error'](_0x90a8('0x14'),_0x372670,_0x3709cd);_0x1293c4(_0x3709cd);});});}exports['GetDynamics365Account']=function(_0x2220cc){var _0x31aa00=this;return new Promise(function(_0x2c3193,_0x555fce){return db[_0x90a8('0x18')][_0x90a8('0x19')]({'raw':_0x2220cc[_0x90a8('0x1a')]?_0x2220cc[_0x90a8('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x2220cc[_0x90a8('0x1a')]?_0x2220cc[_0x90a8('0x1a')]['where']||null:null,'attributes':_0x2220cc['options']?_0x2220cc[_0x90a8('0x1a')]['attributes']||null:null,'limit':_0x2220cc[_0x90a8('0x1a')]?_0x2220cc[_0x90a8('0x1a')][_0x90a8('0x1b')]||null:null,'include':_0x2220cc[_0x90a8('0x1a')]?_0x2220cc[_0x90a8('0x1a')][_0x90a8('0x1c')]?_[_0x90a8('0x1d')](_0x2220cc[_0x90a8('0x1a')][_0x90a8('0x1c')],function(_0x3f201b){return{'model':db[_0x3f201b[_0x90a8('0x1e')]],'as':_0x3f201b['as'],'attributes':_0x3f201b[_0x90a8('0x1f')],'include':_0x3f201b[_0x90a8('0x1c')]?_[_0x90a8('0x1d')](_0x3f201b[_0x90a8('0x1c')],function(_0x412b89){return{'model':db[_0x412b89[_0x90a8('0x1e')]],'as':_0x412b89['as'],'attributes':_0x412b89[_0x90a8('0x1f')],'include':_0x412b89['include']?_[_0x90a8('0x1d')](_0x412b89[_0x90a8('0x1c')],function(_0x5aaf22){return{'model':db[_0x5aaf22['model']],'as':_0x5aaf22['as'],'attributes':_0x5aaf22[_0x90a8('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x90a8('0xd')](function(_0x5c8903){logger['info'](_0x90a8('0x20'),_0x2220cc);logger[_0x90a8('0x10')](_0x90a8('0x20'),_0x2220cc,JSON['stringify'](_0x5c8903));_0x2c3193(_0x5c8903);})['catch'](function(_0x29245e){logger[_0x90a8('0x13')](_0x90a8('0x20'),_0x29245e[_0x90a8('0x15')],_0x2220cc);_0x555fce(_0x31aa00[_0x90a8('0x13')](0x1f4,_0x29245e[_0x90a8('0x15')]));});});};exports[_0x90a8('0x21')]=function(_0x165ffd){var _0x5202fa=this;return new Promise(function(_0x2870d6,_0x25186b){return db['Dynamics365Account'][_0x90a8('0x22')]({'raw':_0x165ffd['options']?_0x165ffd['options'][_0x90a8('0x23')]===undefined?!![]:![]:!![],'where':_0x165ffd[_0x90a8('0x1a')]?_0x165ffd[_0x90a8('0x1a')]['where']||null:null,'attributes':_0x165ffd[_0x90a8('0x1a')]?_0x165ffd['options'][_0x90a8('0x1f')]||null:null,'include':_0x165ffd[_0x90a8('0x1a')]?_0x165ffd[_0x90a8('0x1a')][_0x90a8('0x1c')]?_[_0x90a8('0x1d')](_0x165ffd[_0x90a8('0x1a')][_0x90a8('0x1c')],function(_0xc9e71d){return{'model':db[_0xc9e71d['model']],'as':_0xc9e71d['as'],'attributes':_0xc9e71d['attributes'],'include':_0xc9e71d['include']?_[_0x90a8('0x1d')](_0xc9e71d[_0x90a8('0x1c')],function(_0x122fb5){return{'model':db[_0x122fb5[_0x90a8('0x1e')]],'as':_0x122fb5['as'],'attributes':_0x122fb5[_0x90a8('0x1f')],'include':_0x122fb5[_0x90a8('0x1c')]?_[_0x90a8('0x1d')](_0x122fb5[_0x90a8('0x1c')],function(_0x128b89){return{'model':db[_0x128b89[_0x90a8('0x1e')]],'as':_0x128b89['as'],'attributes':_0x128b89[_0x90a8('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x15a50a){logger[_0x90a8('0xe')]('ShowDynamics365Account',_0x165ffd);logger['debug'](_0x90a8('0x21'),_0x165ffd,JSON[_0x90a8('0x12')](_0x15a50a));_0x2870d6(_0x15a50a);})[_0x90a8('0x17')](function(_0x2a0d3b){logger[_0x90a8('0x13')](_0x90a8('0x21'),_0x2a0d3b[_0x90a8('0x15')],_0x165ffd);_0x25186b(_0x5202fa[_0x90a8('0x13')](0x1f4,_0x2a0d3b['message']));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 94cc7d3..f5834d6 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 _0x18af=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','put','/:id','update','delete','destroy','multer'];(function(_0x2a5021,_0xf5bcd2){var _0x363f1f=function(_0x5a2fe2){while(--_0x5a2fe2){_0x2a5021['push'](_0x2a5021['shift']());}};_0x363f1f(++_0xf5bcd2);}(_0x18af,0x19d));var _0xf18a=function(_0x1ef269,_0x1c92f5){_0x1ef269=_0x1ef269-0x0;var _0x674f0e=_0x18af[_0x1ef269];return _0x674f0e;};'use strict';var multer=require(_0xf18a('0x0'));var util=require('util');var path=require(_0xf18a('0x1'));var timeout=require(_0xf18a('0x2'));var express=require(_0xf18a('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xf18a('0x4'));var interaction=require(_0xf18a('0x5'));var config=require(_0xf18a('0x6'));var controller=require('./intDynamics365Configuration.controller');router[_0xf18a('0x7')]('/',auth[_0xf18a('0x8')](),controller[_0xf18a('0x9')]);router['get']('/:id',auth[_0xf18a('0x8')](),controller[_0xf18a('0xa')]);router['get'](_0xf18a('0xb'),auth[_0xf18a('0x8')](),controller[_0xf18a('0xc')]);router[_0xf18a('0x7')](_0xf18a('0xd'),auth[_0xf18a('0x8')](),controller['getSubjects']);router[_0xf18a('0x7')](_0xf18a('0xe'),auth[_0xf18a('0x8')](),controller[_0xf18a('0xf')]);router[_0xf18a('0x10')]('/',auth[_0xf18a('0x8')](),controller[_0xf18a('0x11')]);router[_0xf18a('0x12')](_0xf18a('0x13'),auth['isAuthenticated'](),controller[_0xf18a('0x14')]);router[_0xf18a('0x15')](_0xf18a('0x13'),auth[_0xf18a('0x8')](),controller[_0xf18a('0x16')]);module['exports']=router; \ No newline at end of file +var _0xe8ae=['./intDynamics365Configuration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','put','update','delete','exports','path','connect-timeout','express','Router','fs-extra'];(function(_0x12823,_0x495ae3){var _0x4367a9=function(_0x2472f1){while(--_0x2472f1){_0x12823['push'](_0x12823['shift']());}};_0x4367a9(++_0x495ae3);}(_0xe8ae,0x163));var _0xee8a=function(_0x5546a9,_0x7666ee){_0x5546a9=_0x5546a9-0x0;var _0x13aed8=_0xe8ae[_0x5546a9];return _0x13aed8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xee8a('0x0'));var timeout=require(_0xee8a('0x1'));var express=require(_0xee8a('0x2'));var router=express[_0xee8a('0x3')]();var fs_extra=require(_0xee8a('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xee8a('0x5'));router[_0xee8a('0x6')]('/',auth[_0xee8a('0x7')](),controller[_0xee8a('0x8')]);router[_0xee8a('0x6')](_0xee8a('0x9'),auth['isAuthenticated'](),controller[_0xee8a('0xa')]);router[_0xee8a('0x6')]('/:id/fields',auth[_0xee8a('0x7')](),controller[_0xee8a('0xb')]);router['get'](_0xee8a('0xc'),auth[_0xee8a('0x7')](),controller[_0xee8a('0xd')]);router['get'](_0xee8a('0xe'),auth[_0xee8a('0x7')](),controller[_0xee8a('0xf')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xee8a('0x10')](_0xee8a('0x9'),auth[_0xee8a('0x7')](),controller[_0xee8a('0x11')]);router[_0xee8a('0x12')](_0xee8a('0x9'),auth[_0xee8a('0x7')](),controller['destroy']);module[_0xee8a('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 88fb7e7..b87aed4 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 _0xb550=['ENUM','incident','phonecall','exports','STRING'];(function(_0x4dcc2d,_0x422839){var _0x1bbd79=function(_0x173341){while(--_0x173341){_0x4dcc2d['push'](_0x4dcc2d['shift']());}};_0x1bbd79(++_0x422839);}(_0xb550,0x17a));var _0x0b55=function(_0x103e64,_0x8344cc){_0x103e64=_0x103e64-0x0;var _0xae5a66=_0xb550[_0x103e64];return _0xae5a66;};'use strict';var Sequelize=require('sequelize');module[_0x0b55('0x0')]={'name':{'type':Sequelize[_0x0b55('0x1')]},'description':{'type':Sequelize[_0x0b55('0x1')]},'ticketType':{'type':Sequelize[_0x0b55('0x2')](_0x0b55('0x3'),_0x0b55('0x4')),'defaultValue':_0x0b55('0x3')}}; \ No newline at end of file +var _0xe039=['STRING','incident','phonecall','sequelize'];(function(_0xc60a0c,_0x2f8922){var _0x236e24=function(_0x314ac6){while(--_0x314ac6){_0xc60a0c['push'](_0xc60a0c['shift']());}};_0x236e24(++_0x2f8922);}(_0xe039,0x13f));var _0x9e03=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xe039[_0x2763f2];return _0x3ef471;};'use strict';var Sequelize=require(_0x9e03('0x0'));module['exports']={'name':{'type':Sequelize[_0x9e03('0x1')]},'description':{'type':Sequelize[_0x9e03('0x1')]},'ticketType':{'type':Sequelize['ENUM'](_0x9e03('0x2'),_0x9e03('0x3')),'defaultValue':_0x9e03('0x2')}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 5824512..015e366 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 _0xb929=['papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','count','offset','limit','set','save','then','destroy','error','stack','name','send','map','Dynamics365Configuration','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','sort','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','keys','find','create','body','update','getFields','order','pick','filter','hasOwnProperty','nolimit','getSubjects','findOne','Dynamics365Field','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','crypto','desk.js'];(function(_0x2a16f4,_0x781a14){var _0x56defb=function(_0x34c4ce){while(--_0x34c4ce){_0x2a16f4['push'](_0x2a16f4['shift']());}};_0x56defb(++_0x781a14);}(_0xb929,0x182));var _0x9b92=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb929[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x9b92('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9b92('0x1'));var jsonpatch=require(_0x9b92('0x2'));var rp=require(_0x9b92('0x3'));var moment=require(_0x9b92('0x4'));var BPromise=require(_0x9b92('0x5'));var Mustache=require(_0x9b92('0x6'));var util=require(_0x9b92('0x7'));var path=require(_0x9b92('0x8'));var sox=require('sox');var csv=require(_0x9b92('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9b92('0xa'));var _=require(_0x9b92('0xb'));var squel=require('squel');var crypto=require(_0x9b92('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x9b92('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9b92('0xe'));var Redis=require(_0x9b92('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x9b92('0x10'));var as=require(_0x9b92('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9b92('0x12'))(_0x9b92('0x13'));var utils=require(_0x9b92('0x14'));var config=require(_0x9b92('0x15'));var licenseUtil=require(_0x9b92('0x16'));var db=require(_0x9b92('0x17'))['db'];function respondWithStatusCode(_0x2a881a,_0x187797){_0x187797=_0x187797||0xcc;return function(_0x46c862){if(_0x46c862){return _0x2a881a[_0x9b92('0x18')](_0x187797);}return _0x2a881a['status'](_0x187797)[_0x9b92('0x19')]();};}function respondWithResult(_0x339d63,_0x2df129){_0x2df129=_0x2df129||0xc8;return function(_0x3420a8){if(_0x3420a8){return _0x339d63[_0x9b92('0x1a')](_0x2df129)[_0x9b92('0x1b')](_0x3420a8);}};}function respondWithFilteredResult(_0x142c4f,_0x4e6f51){return function(_0x714e63){if(_0x714e63){var _0x2f93d1=typeof _0x4e6f51['offset']===_0x9b92('0x1c')&&typeof _0x4e6f51['limit']==='undefined';var _0x54ba0b=_0x714e63[_0x9b92('0x1d')];var _0x4b940c=_0x2f93d1?0x0:_0x4e6f51[_0x9b92('0x1e')];var _0x2f048a=_0x2f93d1?_0x714e63[_0x9b92('0x1d')]:_0x4e6f51['offset']+_0x4e6f51[_0x9b92('0x1f')];var _0x227569;if(_0x2f048a>=_0x54ba0b){_0x2f048a=_0x54ba0b;_0x227569=0xc8;}else{_0x227569=0xce;}_0x142c4f['status'](_0x227569);return _0x142c4f[_0x9b92('0x20')]('Content-Range',_0x4b940c+'-'+_0x2f048a+'/'+_0x54ba0b)[_0x9b92('0x1b')](_0x714e63);}return null;};}function patchUpdates(_0x433829){return function(_0x39cc2d){try{jsonpatch['apply'](_0x39cc2d,_0x433829,!![]);}catch(_0x4ecdf6){return BPromise['reject'](_0x4ecdf6);}return _0x39cc2d[_0x9b92('0x21')]();};}function saveUpdates(_0x5e7be1,_0xf805a3){return function(_0x1eebd1){if(_0x1eebd1){return _0x1eebd1['update'](_0x5e7be1)[_0x9b92('0x22')](function(_0x26d5e8){return _0x26d5e8;});}return null;};}function removeEntity(_0x4bb49b,_0x5310fb){return function(_0x176854){if(_0x176854){return _0x176854[_0x9b92('0x23')]()[_0x9b92('0x22')](function(){_0x4bb49b[_0x9b92('0x1a')](0xcc)[_0x9b92('0x19')]();});}};}function handleEntityNotFound(_0x1aaab9,_0x26f603){return function(_0x2464c7){if(!_0x2464c7){_0x1aaab9[_0x9b92('0x18')](0x194);}return _0x2464c7;};}function handleError(_0x13c203,_0x3f865f){_0x3f865f=_0x3f865f||0x1f4;return function(_0x3f30f6){logger[_0x9b92('0x24')](_0x3f30f6[_0x9b92('0x25')]);if(_0x3f30f6['name']){delete _0x3f30f6[_0x9b92('0x26')];}_0x13c203[_0x9b92('0x1a')](_0x3f865f)[_0x9b92('0x27')](_0x3f30f6);};}exports['index']=function(_0x2b9e63,_0x2ec3bf){var _0x353b3c={},_0x137e72={},_0x40233c={'count':0x0,'rows':[]};var _0x3b6c1=_[_0x9b92('0x28')](db[_0x9b92('0x29')]['rawAttributes'],function(_0x4056d3){return{'name':_0x4056d3[_0x9b92('0x2a')],'type':_0x4056d3[_0x9b92('0x2b')][_0x9b92('0x2c')]};});_0x137e72[_0x9b92('0x2d')]=_['map'](_0x3b6c1,_0x9b92('0x26'));_0x137e72['query']=_['keys'](_0x2b9e63[_0x9b92('0x2e')]);_0x137e72[_0x9b92('0x2f')]=_[_0x9b92('0x30')](_0x137e72['model'],_0x137e72[_0x9b92('0x2e')]);_0x353b3c[_0x9b92('0x31')]=_[_0x9b92('0x30')](_0x137e72[_0x9b92('0x2d')],qs['fields'](_0x2b9e63['query'][_0x9b92('0x32')]));_0x353b3c['attributes']=_0x353b3c[_0x9b92('0x31')][_0x9b92('0x33')]?_0x353b3c[_0x9b92('0x31')]:_0x137e72[_0x9b92('0x2d')];if(!_0x2b9e63[_0x9b92('0x2e')]['hasOwnProperty']('nolimit')){_0x353b3c[_0x9b92('0x1f')]=qs[_0x9b92('0x1f')](_0x2b9e63[_0x9b92('0x2e')]['limit']);_0x353b3c[_0x9b92('0x1e')]=qs[_0x9b92('0x1e')](_0x2b9e63[_0x9b92('0x2e')]['offset']);}_0x353b3c['order']=qs[_0x9b92('0x34')](_0x2b9e63[_0x9b92('0x2e')][_0x9b92('0x34')]);_0x353b3c[_0x9b92('0x35')]=qs[_0x9b92('0x2f')](_['pick'](_0x2b9e63['query'],_0x137e72[_0x9b92('0x2f')]),_0x3b6c1);if(_0x2b9e63[_0x9b92('0x2e')]['filter']){_0x353b3c[_0x9b92('0x35')]=_['merge'](_0x353b3c['where'],{'$or':_[_0x9b92('0x28')](_0x3b6c1,function(_0x5eaaa1){if(_0x5eaaa1[_0x9b92('0x2b')]!==_0x9b92('0x36')){var _0xd7859c={};_0xd7859c[_0x5eaaa1['name']]={'$like':'%'+_0x2b9e63[_0x9b92('0x2e')]['filter']+'%'};return _0xd7859c;}})});}_0x353b3c=_[_0x9b92('0x37')]({},_0x353b3c,_0x2b9e63[_0x9b92('0x38')]);var _0x274b1={'where':_0x353b3c['where']};return db[_0x9b92('0x29')]['count'](_0x274b1)[_0x9b92('0x22')](function(_0x334b5e){_0x40233c[_0x9b92('0x1d')]=_0x334b5e;if(_0x2b9e63[_0x9b92('0x2e')][_0x9b92('0x39')]){_0x353b3c[_0x9b92('0x3a')]=[{'all':!![]}];}return db[_0x9b92('0x29')][_0x9b92('0x3b')](_0x353b3c);})['then'](function(_0x1ebbc9){_0x40233c[_0x9b92('0x3c')]=_0x1ebbc9;return _0x40233c;})[_0x9b92('0x22')](respondWithFilteredResult(_0x2ec3bf,_0x353b3c))[_0x9b92('0x3d')](handleError(_0x2ec3bf,null));};exports[_0x9b92('0x3e')]=function(_0x20a5f1,_0x174b59){var _0x498199={'raw':![],'where':{'id':_0x20a5f1[_0x9b92('0x3f')]['id']}},_0x2137c5={};_0x2137c5[_0x9b92('0x2d')]=_['keys'](db[_0x9b92('0x29')][_0x9b92('0x40')]);_0x2137c5['query']=_[_0x9b92('0x41')](_0x20a5f1[_0x9b92('0x2e')]);_0x2137c5[_0x9b92('0x2f')]=_[_0x9b92('0x30')](_0x2137c5[_0x9b92('0x2d')],_0x2137c5['query']);_0x498199[_0x9b92('0x31')]=_[_0x9b92('0x30')](_0x2137c5[_0x9b92('0x2d')],qs[_0x9b92('0x32')](_0x20a5f1[_0x9b92('0x2e')][_0x9b92('0x32')]));_0x498199[_0x9b92('0x31')]=_0x498199[_0x9b92('0x31')][_0x9b92('0x33')]?_0x498199['attributes']:_0x2137c5['model'];if(_0x20a5f1['query'][_0x9b92('0x39')]){_0x498199['include']=[{'all':!![]}];}_0x498199=_[_0x9b92('0x37')]({},_0x498199,_0x20a5f1[_0x9b92('0x38')]);return db[_0x9b92('0x29')][_0x9b92('0x42')](_0x498199)[_0x9b92('0x22')](handleEntityNotFound(_0x174b59,null))['then'](respondWithResult(_0x174b59,null))[_0x9b92('0x3d')](handleError(_0x174b59,null));};exports[_0x9b92('0x43')]=function(_0x5281ae,_0x12f1b6){return db[_0x9b92('0x29')][_0x9b92('0x43')](_0x5281ae[_0x9b92('0x44')],{})['then'](respondWithResult(_0x12f1b6,0xc9))['catch'](handleError(_0x12f1b6,null));};exports[_0x9b92('0x45')]=function(_0x233ef2,_0x1fb16e){if(_0x233ef2['body']['id']){delete _0x233ef2[_0x9b92('0x44')]['id'];}return db[_0x9b92('0x29')]['find']({'where':{'id':_0x233ef2[_0x9b92('0x3f')]['id']}})[_0x9b92('0x22')](handleEntityNotFound(_0x1fb16e,null))[_0x9b92('0x22')](saveUpdates(_0x233ef2[_0x9b92('0x44')],null))[_0x9b92('0x22')](respondWithResult(_0x1fb16e,null))[_0x9b92('0x3d')](handleError(_0x1fb16e,null));};exports[_0x9b92('0x23')]=function(_0x247b18,_0x53da91){return db['Dynamics365Configuration'][_0x9b92('0x42')]({'where':{'id':_0x247b18['params']['id']}})[_0x9b92('0x22')](handleEntityNotFound(_0x53da91,null))[_0x9b92('0x22')](removeEntity(_0x53da91,null))['catch'](handleError(_0x53da91,null));};exports[_0x9b92('0x46')]=function(_0x394e24,_0x24de96,_0x735f9d){var _0x3adb32={};var _0x9c786f={};var _0x4cd4c6;var _0x492e5d;return db[_0x9b92('0x29')]['findOne']({'where':{'id':_0x394e24[_0x9b92('0x3f')]['id']}})[_0x9b92('0x22')](handleEntityNotFound(_0x24de96,null))['then'](function(_0x30120f){if(_0x30120f){_0x4cd4c6=_0x30120f;_0x9c786f['model']=_['keys'](db['Dynamics365Field']['rawAttributes']);_0x9c786f['query']=_[_0x9b92('0x41')](_0x394e24['query']);_0x9c786f[_0x9b92('0x2f')]=_[_0x9b92('0x30')](_0x9c786f[_0x9b92('0x2d')],_0x9c786f[_0x9b92('0x2e')]);_0x3adb32['attributes']=_[_0x9b92('0x30')](_0x9c786f[_0x9b92('0x2d')],qs[_0x9b92('0x32')](_0x394e24[_0x9b92('0x2e')][_0x9b92('0x32')]));_0x3adb32[_0x9b92('0x31')]=_0x3adb32[_0x9b92('0x31')][_0x9b92('0x33')]?_0x3adb32[_0x9b92('0x31')]:_0x9c786f['model'];_0x3adb32[_0x9b92('0x47')]=qs[_0x9b92('0x34')](_0x394e24[_0x9b92('0x2e')][_0x9b92('0x34')]);_0x3adb32[_0x9b92('0x35')]=qs[_0x9b92('0x2f')](_[_0x9b92('0x48')](_0x394e24['query'],_0x9c786f[_0x9b92('0x2f')]));if(_0x394e24[_0x9b92('0x2e')][_0x9b92('0x49')]){_0x3adb32['where']=_[_0x9b92('0x37')](_0x3adb32[_0x9b92('0x35')],{'$or':_[_0x9b92('0x28')](_0x3adb32[_0x9b92('0x31')],function(_0xa391a8){var _0x5ac88e={};_0x5ac88e[_0xa391a8]={'$like':'%'+_0x394e24[_0x9b92('0x2e')][_0x9b92('0x49')]+'%'};return _0x5ac88e;})});}_0x3adb32=_[_0x9b92('0x37')]({},_0x3adb32,_0x394e24[_0x9b92('0x38')]);return _0x4cd4c6[_0x9b92('0x46')](_0x3adb32);}})[_0x9b92('0x22')](function(_0x39d96d){if(_0x39d96d){_0x492e5d=_0x39d96d[_0x9b92('0x33')];if(!_0x394e24[_0x9b92('0x2e')][_0x9b92('0x4a')](_0x9b92('0x4b'))){_0x3adb32['limit']=qs[_0x9b92('0x1f')](_0x394e24[_0x9b92('0x2e')][_0x9b92('0x1f')]);_0x3adb32[_0x9b92('0x1e')]=qs['offset'](_0x394e24[_0x9b92('0x2e')][_0x9b92('0x1e')]);}return _0x4cd4c6['getFields'](_0x3adb32);}})[_0x9b92('0x22')](function(_0x37817d){if(_0x37817d){return _0x37817d?{'count':_0x492e5d,'rows':_0x37817d}:null;}})[_0x9b92('0x22')](respondWithResult(_0x24de96,null))[_0x9b92('0x3d')](handleError(_0x24de96,null));};exports[_0x9b92('0x4c')]=function(_0x388015,_0x1e8a3a,_0x3f0f72){var _0x2fdbab={};var _0x4fdd2e={};var _0x4557b;var _0x2e74ff;return db['Dynamics365Configuration'][_0x9b92('0x4d')]({'where':{'id':_0x388015[_0x9b92('0x3f')]['id']}})[_0x9b92('0x22')](handleEntityNotFound(_0x1e8a3a,null))[_0x9b92('0x22')](function(_0x523cff){if(_0x523cff){_0x4557b=_0x523cff;_0x4fdd2e[_0x9b92('0x2d')]=_[_0x9b92('0x41')](db[_0x9b92('0x4e')]['rawAttributes']);_0x4fdd2e[_0x9b92('0x2e')]=_[_0x9b92('0x41')](_0x388015['query']);_0x4fdd2e[_0x9b92('0x2f')]=_['intersection'](_0x4fdd2e['model'],_0x4fdd2e['query']);_0x2fdbab[_0x9b92('0x31')]=_['intersection'](_0x4fdd2e[_0x9b92('0x2d')],qs[_0x9b92('0x32')](_0x388015['query']['fields']));_0x2fdbab[_0x9b92('0x31')]=_0x2fdbab[_0x9b92('0x31')][_0x9b92('0x33')]?_0x2fdbab[_0x9b92('0x31')]:_0x4fdd2e[_0x9b92('0x2d')];_0x2fdbab[_0x9b92('0x47')]=qs[_0x9b92('0x34')](_0x388015[_0x9b92('0x2e')][_0x9b92('0x34')]);_0x2fdbab[_0x9b92('0x35')]=qs[_0x9b92('0x2f')](_[_0x9b92('0x48')](_0x388015[_0x9b92('0x2e')],_0x4fdd2e['filters']));if(_0x388015[_0x9b92('0x2e')][_0x9b92('0x49')]){_0x2fdbab['where']=_['merge'](_0x2fdbab[_0x9b92('0x35')],{'$or':_[_0x9b92('0x28')](_0x2fdbab['attributes'],function(_0x431fde){var _0x103617={};_0x103617[_0x431fde]={'$like':'%'+_0x388015[_0x9b92('0x2e')][_0x9b92('0x49')]+'%'};return _0x103617;})});}_0x2fdbab=_[_0x9b92('0x37')]({},_0x2fdbab,_0x388015[_0x9b92('0x38')]);return _0x4557b[_0x9b92('0x4c')](_0x2fdbab);}})[_0x9b92('0x22')](function(_0x218a14){if(_0x218a14){_0x2e74ff=_0x218a14[_0x9b92('0x33')];if(!_0x388015['query']['hasOwnProperty'](_0x9b92('0x4b'))){_0x2fdbab[_0x9b92('0x1f')]=qs[_0x9b92('0x1f')](_0x388015[_0x9b92('0x2e')]['limit']);_0x2fdbab['offset']=qs[_0x9b92('0x1e')](_0x388015[_0x9b92('0x2e')][_0x9b92('0x1e')]);}return _0x4557b[_0x9b92('0x4c')](_0x2fdbab);}})[_0x9b92('0x22')](function(_0x3b0137){if(_0x3b0137){return _0x3b0137?{'count':_0x2e74ff,'rows':_0x3b0137}:null;}})[_0x9b92('0x22')](respondWithResult(_0x1e8a3a,null))[_0x9b92('0x3d')](handleError(_0x1e8a3a,null));};exports[_0x9b92('0x4f')]=function(_0x36b524,_0x2af820,_0x4367fa){var _0x19f87e={};var _0x3e581c={};var _0x21f743;var _0x5ae0c2;return db[_0x9b92('0x29')][_0x9b92('0x4d')]({'where':{'id':_0x36b524[_0x9b92('0x3f')]['id']}})[_0x9b92('0x22')](handleEntityNotFound(_0x2af820,null))[_0x9b92('0x22')](function(_0x263bc4){if(_0x263bc4){_0x21f743=_0x263bc4;_0x3e581c[_0x9b92('0x2d')]=_['keys'](db['Dynamics365Field'][_0x9b92('0x40')]);_0x3e581c[_0x9b92('0x2e')]=_['keys'](_0x36b524['query']);_0x3e581c[_0x9b92('0x2f')]=_[_0x9b92('0x30')](_0x3e581c[_0x9b92('0x2d')],_0x3e581c[_0x9b92('0x2e')]);_0x19f87e['attributes']=_[_0x9b92('0x30')](_0x3e581c[_0x9b92('0x2d')],qs['fields'](_0x36b524[_0x9b92('0x2e')][_0x9b92('0x32')]));_0x19f87e[_0x9b92('0x31')]=_0x19f87e[_0x9b92('0x31')][_0x9b92('0x33')]?_0x19f87e[_0x9b92('0x31')]:_0x3e581c[_0x9b92('0x2d')];_0x19f87e[_0x9b92('0x47')]=qs[_0x9b92('0x34')](_0x36b524[_0x9b92('0x2e')][_0x9b92('0x34')]);_0x19f87e[_0x9b92('0x35')]=qs[_0x9b92('0x2f')](_[_0x9b92('0x48')](_0x36b524[_0x9b92('0x2e')],_0x3e581c[_0x9b92('0x2f')]));if(_0x36b524[_0x9b92('0x2e')][_0x9b92('0x49')]){_0x19f87e[_0x9b92('0x35')]=_['merge'](_0x19f87e['where'],{'$or':_[_0x9b92('0x28')](_0x19f87e[_0x9b92('0x31')],function(_0x3e30d5){var _0x42ff23={};_0x42ff23[_0x3e30d5]={'$like':'%'+_0x36b524[_0x9b92('0x2e')][_0x9b92('0x49')]+'%'};return _0x42ff23;})});}_0x19f87e=_[_0x9b92('0x37')]({},_0x19f87e,_0x36b524[_0x9b92('0x38')]);return _0x21f743[_0x9b92('0x4f')](_0x19f87e);}})['then'](function(_0xef5005){if(_0xef5005){_0x5ae0c2=_0xef5005['length'];if(!_0x36b524['query'][_0x9b92('0x4a')](_0x9b92('0x4b'))){_0x19f87e[_0x9b92('0x1f')]=qs['limit'](_0x36b524[_0x9b92('0x2e')][_0x9b92('0x1f')]);_0x19f87e[_0x9b92('0x1e')]=qs[_0x9b92('0x1e')](_0x36b524[_0x9b92('0x2e')][_0x9b92('0x1e')]);}return _0x21f743[_0x9b92('0x4f')](_0x19f87e);}})['then'](function(_0x2a1c90){if(_0x2a1c90){return _0x2a1c90?{'count':_0x5ae0c2,'rows':_0x2a1c90}:null;}})[_0x9b92('0x22')](respondWithResult(_0x2af820,null))[_0x9b92('0x3d')](handleError(_0x2af820,null));}; \ No newline at end of file +var _0x63a6=['rawAttributes','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','update','getFields','findOne','Dynamics365Field','order','filter','getSubjects','getDescriptions','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../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','reject','save','then','destroy','sendStatus','name','send','map','Dynamics365Configuration'];(function(_0x5f45d6,_0x9dc90e){var _0x798711=function(_0x5a32a0){while(--_0x5a32a0){_0x5f45d6['push'](_0x5f45d6['shift']());}};_0x798711(++_0x9dc90e);}(_0x63a6,0x1ae));var _0x663a=function(_0x546125,_0xfa3bf){_0x546125=_0x546125-0x0;var _0x77b546=_0x63a6[_0x546125];return _0x77b546;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x663a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x663a('0x1'));var rp=require(_0x663a('0x2'));var moment=require('moment');var BPromise=require(_0x663a('0x3'));var Mustache=require(_0x663a('0x4'));var util=require(_0x663a('0x5'));var path=require(_0x663a('0x6'));var sox=require(_0x663a('0x7'));var csv=require(_0x663a('0x8'));var ejs=require(_0x663a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x663a('0xa'));var squel=require(_0x663a('0xb'));var crypto=require(_0x663a('0xc'));var jsforce=require(_0x663a('0xd'));var deskjs=require(_0x663a('0xe'));var toCsv=require(_0x663a('0x8'));var querystring=require(_0x663a('0xf'));var Papa=require(_0x663a('0x10'));var Redis=require('ioredis');var authService=require(_0x663a('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x663a('0x12'));var hardwareService=require(_0x663a('0x13'));var logger=require(_0x663a('0x14'))(_0x663a('0x15'));var utils=require(_0x663a('0x16'));var config=require(_0x663a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x663a('0x18'))['db'];function respondWithStatusCode(_0xe5abb0,_0x16cd46){_0x16cd46=_0x16cd46||0xcc;return function(_0x71ccab){if(_0x71ccab){return _0xe5abb0['sendStatus'](_0x16cd46);}return _0xe5abb0[_0x663a('0x19')](_0x16cd46)[_0x663a('0x1a')]();};}function respondWithResult(_0x34bc7e,_0x2128af){_0x2128af=_0x2128af||0xc8;return function(_0x3a8722){if(_0x3a8722){return _0x34bc7e[_0x663a('0x19')](_0x2128af)[_0x663a('0x1b')](_0x3a8722);}};}function respondWithFilteredResult(_0x3b8178,_0x4630c3){return function(_0x1f78dd){if(_0x1f78dd){var _0x1cc3df=typeof _0x4630c3['offset']===_0x663a('0x1c')&&typeof _0x4630c3[_0x663a('0x1d')]===_0x663a('0x1c');var _0xe11865=_0x1f78dd[_0x663a('0x1e')];var _0x28f199=_0x1cc3df?0x0:_0x4630c3[_0x663a('0x1f')];var _0xa832fe=_0x1cc3df?_0x1f78dd[_0x663a('0x1e')]:_0x4630c3[_0x663a('0x1f')]+_0x4630c3[_0x663a('0x1d')];var _0x1539c9;if(_0xa832fe>=_0xe11865){_0xa832fe=_0xe11865;_0x1539c9=0xc8;}else{_0x1539c9=0xce;}_0x3b8178[_0x663a('0x19')](_0x1539c9);return _0x3b8178[_0x663a('0x20')](_0x663a('0x21'),_0x28f199+'-'+_0xa832fe+'/'+_0xe11865)[_0x663a('0x1b')](_0x1f78dd);}return null;};}function patchUpdates(_0x4e8514){return function(_0x53ec2a){try{jsonpatch[_0x663a('0x22')](_0x53ec2a,_0x4e8514,!![]);}catch(_0x1a185b){return BPromise[_0x663a('0x23')](_0x1a185b);}return _0x53ec2a[_0x663a('0x24')]();};}function saveUpdates(_0xbec807,_0x4d60a8){return function(_0x123a87){if(_0x123a87){return _0x123a87['update'](_0xbec807)[_0x663a('0x25')](function(_0x5ca99c){return _0x5ca99c;});}return null;};}function removeEntity(_0x19fb03,_0x2e3060){return function(_0x23518e){if(_0x23518e){return _0x23518e[_0x663a('0x26')]()[_0x663a('0x25')](function(){_0x19fb03[_0x663a('0x19')](0xcc)[_0x663a('0x1a')]();});}};}function handleEntityNotFound(_0x2e4a5c,_0x287f38){return function(_0x4ed0e7){if(!_0x4ed0e7){_0x2e4a5c[_0x663a('0x27')](0x194);}return _0x4ed0e7;};}function handleError(_0xdcb55,_0x3eae5f){_0x3eae5f=_0x3eae5f||0x1f4;return function(_0x3d9c34){logger['error'](_0x3d9c34['stack']);if(_0x3d9c34[_0x663a('0x28')]){delete _0x3d9c34[_0x663a('0x28')];}_0xdcb55['status'](_0x3eae5f)[_0x663a('0x29')](_0x3d9c34);};}exports['index']=function(_0x1931e6,_0x2b061a){var _0xc5cdb9={},_0x74eddb={},_0x34fc90={'count':0x0,'rows':[]};var _0x66f60a=_[_0x663a('0x2a')](db[_0x663a('0x2b')][_0x663a('0x2c')],function(_0x113c65){return{'name':_0x113c65['fieldName'],'type':_0x113c65[_0x663a('0x2d')]['key']};});_0x74eddb[_0x663a('0x2e')]=_[_0x663a('0x2a')](_0x66f60a,_0x663a('0x28'));_0x74eddb[_0x663a('0x2f')]=_[_0x663a('0x30')](_0x1931e6['query']);_0x74eddb[_0x663a('0x31')]=_['intersection'](_0x74eddb[_0x663a('0x2e')],_0x74eddb[_0x663a('0x2f')]);_0xc5cdb9[_0x663a('0x32')]=_[_0x663a('0x33')](_0x74eddb[_0x663a('0x2e')],qs['fields'](_0x1931e6[_0x663a('0x2f')][_0x663a('0x34')]));_0xc5cdb9[_0x663a('0x32')]=_0xc5cdb9[_0x663a('0x32')][_0x663a('0x35')]?_0xc5cdb9[_0x663a('0x32')]:_0x74eddb[_0x663a('0x2e')];if(!_0x1931e6[_0x663a('0x2f')][_0x663a('0x36')](_0x663a('0x37'))){_0xc5cdb9[_0x663a('0x1d')]=qs['limit'](_0x1931e6[_0x663a('0x2f')][_0x663a('0x1d')]);_0xc5cdb9['offset']=qs[_0x663a('0x1f')](_0x1931e6[_0x663a('0x2f')][_0x663a('0x1f')]);}_0xc5cdb9['order']=qs[_0x663a('0x38')](_0x1931e6['query'][_0x663a('0x38')]);_0xc5cdb9[_0x663a('0x39')]=qs[_0x663a('0x31')](_[_0x663a('0x3a')](_0x1931e6[_0x663a('0x2f')],_0x74eddb[_0x663a('0x31')]),_0x66f60a);if(_0x1931e6[_0x663a('0x2f')]['filter']){_0xc5cdb9[_0x663a('0x39')]=_[_0x663a('0x3b')](_0xc5cdb9[_0x663a('0x39')],{'$or':_[_0x663a('0x2a')](_0x66f60a,function(_0x5d996c){if(_0x5d996c[_0x663a('0x2d')]!=='VIRTUAL'){var _0x31a2bb={};_0x31a2bb[_0x5d996c[_0x663a('0x28')]]={'$like':'%'+_0x1931e6[_0x663a('0x2f')]['filter']+'%'};return _0x31a2bb;}})});}_0xc5cdb9=_[_0x663a('0x3b')]({},_0xc5cdb9,_0x1931e6['options']);var _0xaf841f={'where':_0xc5cdb9[_0x663a('0x39')]};return db[_0x663a('0x2b')][_0x663a('0x1e')](_0xaf841f)[_0x663a('0x25')](function(_0x4934f7){_0x34fc90[_0x663a('0x1e')]=_0x4934f7;if(_0x1931e6[_0x663a('0x2f')][_0x663a('0x3c')]){_0xc5cdb9[_0x663a('0x3d')]=[{'all':!![]}];}return db['Dynamics365Configuration'][_0x663a('0x3e')](_0xc5cdb9);})[_0x663a('0x25')](function(_0x13b1c6){_0x34fc90[_0x663a('0x3f')]=_0x13b1c6;return _0x34fc90;})[_0x663a('0x25')](respondWithFilteredResult(_0x2b061a,_0xc5cdb9))[_0x663a('0x40')](handleError(_0x2b061a,null));};exports[_0x663a('0x41')]=function(_0x2193eb,_0x2630cf){var _0x39f7c1={'raw':![],'where':{'id':_0x2193eb[_0x663a('0x42')]['id']}},_0x2bf81a={};_0x2bf81a['model']=_[_0x663a('0x30')](db[_0x663a('0x2b')][_0x663a('0x2c')]);_0x2bf81a[_0x663a('0x2f')]=_[_0x663a('0x30')](_0x2193eb[_0x663a('0x2f')]);_0x2bf81a[_0x663a('0x31')]=_[_0x663a('0x33')](_0x2bf81a['model'],_0x2bf81a[_0x663a('0x2f')]);_0x39f7c1[_0x663a('0x32')]=_[_0x663a('0x33')](_0x2bf81a[_0x663a('0x2e')],qs[_0x663a('0x34')](_0x2193eb['query'][_0x663a('0x34')]));_0x39f7c1[_0x663a('0x32')]=_0x39f7c1[_0x663a('0x32')][_0x663a('0x35')]?_0x39f7c1['attributes']:_0x2bf81a['model'];if(_0x2193eb[_0x663a('0x2f')][_0x663a('0x3c')]){_0x39f7c1['include']=[{'all':!![]}];}_0x39f7c1=_['merge']({},_0x39f7c1,_0x2193eb[_0x663a('0x43')]);return db[_0x663a('0x2b')][_0x663a('0x44')](_0x39f7c1)[_0x663a('0x25')](handleEntityNotFound(_0x2630cf,null))['then'](respondWithResult(_0x2630cf,null))[_0x663a('0x40')](handleError(_0x2630cf,null));};exports[_0x663a('0x45')]=function(_0x5a2c06,_0x453e98){return db[_0x663a('0x2b')]['create'](_0x5a2c06[_0x663a('0x46')],{})[_0x663a('0x25')](respondWithResult(_0x453e98,0xc9))[_0x663a('0x40')](handleError(_0x453e98,null));};exports[_0x663a('0x47')]=function(_0x183f3e,_0x386ffc){if(_0x183f3e[_0x663a('0x46')]['id']){delete _0x183f3e[_0x663a('0x46')]['id'];}return db[_0x663a('0x2b')][_0x663a('0x44')]({'where':{'id':_0x183f3e[_0x663a('0x42')]['id']}})[_0x663a('0x25')](handleEntityNotFound(_0x386ffc,null))[_0x663a('0x25')](saveUpdates(_0x183f3e['body'],null))[_0x663a('0x25')](respondWithResult(_0x386ffc,null))[_0x663a('0x40')](handleError(_0x386ffc,null));};exports[_0x663a('0x26')]=function(_0x9d2edf,_0x312948){return db['Dynamics365Configuration'][_0x663a('0x44')]({'where':{'id':_0x9d2edf[_0x663a('0x42')]['id']}})[_0x663a('0x25')](handleEntityNotFound(_0x312948,null))[_0x663a('0x25')](removeEntity(_0x312948,null))['catch'](handleError(_0x312948,null));};exports[_0x663a('0x48')]=function(_0x38267b,_0xa9b6dc,_0x2bf997){var _0x232004={};var _0x245125={};var _0x2aee32;var _0x564671;return db[_0x663a('0x2b')][_0x663a('0x49')]({'where':{'id':_0x38267b[_0x663a('0x42')]['id']}})[_0x663a('0x25')](handleEntityNotFound(_0xa9b6dc,null))[_0x663a('0x25')](function(_0x39f46e){if(_0x39f46e){_0x2aee32=_0x39f46e;_0x245125[_0x663a('0x2e')]=_['keys'](db[_0x663a('0x4a')][_0x663a('0x2c')]);_0x245125[_0x663a('0x2f')]=_[_0x663a('0x30')](_0x38267b[_0x663a('0x2f')]);_0x245125[_0x663a('0x31')]=_[_0x663a('0x33')](_0x245125[_0x663a('0x2e')],_0x245125[_0x663a('0x2f')]);_0x232004[_0x663a('0x32')]=_[_0x663a('0x33')](_0x245125[_0x663a('0x2e')],qs[_0x663a('0x34')](_0x38267b[_0x663a('0x2f')][_0x663a('0x34')]));_0x232004[_0x663a('0x32')]=_0x232004['attributes'][_0x663a('0x35')]?_0x232004[_0x663a('0x32')]:_0x245125[_0x663a('0x2e')];_0x232004[_0x663a('0x4b')]=qs['sort'](_0x38267b[_0x663a('0x2f')][_0x663a('0x38')]);_0x232004['where']=qs[_0x663a('0x31')](_[_0x663a('0x3a')](_0x38267b[_0x663a('0x2f')],_0x245125['filters']));if(_0x38267b[_0x663a('0x2f')][_0x663a('0x4c')]){_0x232004[_0x663a('0x39')]=_[_0x663a('0x3b')](_0x232004[_0x663a('0x39')],{'$or':_['map'](_0x232004['attributes'],function(_0x2a56ec){var _0x1535f5={};_0x1535f5[_0x2a56ec]={'$like':'%'+_0x38267b['query'][_0x663a('0x4c')]+'%'};return _0x1535f5;})});}_0x232004=_['merge']({},_0x232004,_0x38267b['options']);return _0x2aee32[_0x663a('0x48')](_0x232004);}})[_0x663a('0x25')](function(_0x1ca38c){if(_0x1ca38c){_0x564671=_0x1ca38c[_0x663a('0x35')];if(!_0x38267b[_0x663a('0x2f')][_0x663a('0x36')](_0x663a('0x37'))){_0x232004['limit']=qs[_0x663a('0x1d')](_0x38267b[_0x663a('0x2f')][_0x663a('0x1d')]);_0x232004[_0x663a('0x1f')]=qs[_0x663a('0x1f')](_0x38267b[_0x663a('0x2f')][_0x663a('0x1f')]);}return _0x2aee32[_0x663a('0x48')](_0x232004);}})[_0x663a('0x25')](function(_0x30a879){if(_0x30a879){return _0x30a879?{'count':_0x564671,'rows':_0x30a879}:null;}})[_0x663a('0x25')](respondWithResult(_0xa9b6dc,null))[_0x663a('0x40')](handleError(_0xa9b6dc,null));};exports[_0x663a('0x4d')]=function(_0x13c551,_0x1dd12a,_0x55529a){var _0x1be252={};var _0x403f7c={};var _0x141836;var _0x25afd7;return db['Dynamics365Configuration'][_0x663a('0x49')]({'where':{'id':_0x13c551[_0x663a('0x42')]['id']}})[_0x663a('0x25')](handleEntityNotFound(_0x1dd12a,null))[_0x663a('0x25')](function(_0xb2af34){if(_0xb2af34){_0x141836=_0xb2af34;_0x403f7c[_0x663a('0x2e')]=_[_0x663a('0x30')](db['Dynamics365Field'][_0x663a('0x2c')]);_0x403f7c['query']=_[_0x663a('0x30')](_0x13c551[_0x663a('0x2f')]);_0x403f7c[_0x663a('0x31')]=_[_0x663a('0x33')](_0x403f7c[_0x663a('0x2e')],_0x403f7c[_0x663a('0x2f')]);_0x1be252['attributes']=_[_0x663a('0x33')](_0x403f7c[_0x663a('0x2e')],qs[_0x663a('0x34')](_0x13c551['query'][_0x663a('0x34')]));_0x1be252[_0x663a('0x32')]=_0x1be252[_0x663a('0x32')]['length']?_0x1be252[_0x663a('0x32')]:_0x403f7c[_0x663a('0x2e')];_0x1be252['order']=qs['sort'](_0x13c551[_0x663a('0x2f')]['sort']);_0x1be252['where']=qs['filters'](_[_0x663a('0x3a')](_0x13c551['query'],_0x403f7c[_0x663a('0x31')]));if(_0x13c551[_0x663a('0x2f')]['filter']){_0x1be252[_0x663a('0x39')]=_['merge'](_0x1be252[_0x663a('0x39')],{'$or':_[_0x663a('0x2a')](_0x1be252[_0x663a('0x32')],function(_0x1ad7e4){var _0x472cb7={};_0x472cb7[_0x1ad7e4]={'$like':'%'+_0x13c551[_0x663a('0x2f')][_0x663a('0x4c')]+'%'};return _0x472cb7;})});}_0x1be252=_['merge']({},_0x1be252,_0x13c551[_0x663a('0x43')]);return _0x141836[_0x663a('0x4d')](_0x1be252);}})[_0x663a('0x25')](function(_0x4009c5){if(_0x4009c5){_0x25afd7=_0x4009c5['length'];if(!_0x13c551['query']['hasOwnProperty'](_0x663a('0x37'))){_0x1be252[_0x663a('0x1d')]=qs[_0x663a('0x1d')](_0x13c551[_0x663a('0x2f')][_0x663a('0x1d')]);_0x1be252[_0x663a('0x1f')]=qs[_0x663a('0x1f')](_0x13c551['query'][_0x663a('0x1f')]);}return _0x141836['getSubjects'](_0x1be252);}})['then'](function(_0x59bb9c){if(_0x59bb9c){return _0x59bb9c?{'count':_0x25afd7,'rows':_0x59bb9c}:null;}})['then'](respondWithResult(_0x1dd12a,null))['catch'](handleError(_0x1dd12a,null));};exports[_0x663a('0x4e')]=function(_0x2b7406,_0x2e4b3e,_0x2d5918){var _0x35a85b={};var _0x459619={};var _0x44b955;var _0x471980;return db[_0x663a('0x2b')][_0x663a('0x49')]({'where':{'id':_0x2b7406[_0x663a('0x42')]['id']}})['then'](handleEntityNotFound(_0x2e4b3e,null))[_0x663a('0x25')](function(_0x1917f6){if(_0x1917f6){_0x44b955=_0x1917f6;_0x459619[_0x663a('0x2e')]=_['keys'](db[_0x663a('0x4a')]['rawAttributes']);_0x459619[_0x663a('0x2f')]=_[_0x663a('0x30')](_0x2b7406[_0x663a('0x2f')]);_0x459619[_0x663a('0x31')]=_[_0x663a('0x33')](_0x459619[_0x663a('0x2e')],_0x459619[_0x663a('0x2f')]);_0x35a85b[_0x663a('0x32')]=_['intersection'](_0x459619[_0x663a('0x2e')],qs['fields'](_0x2b7406[_0x663a('0x2f')][_0x663a('0x34')]));_0x35a85b['attributes']=_0x35a85b[_0x663a('0x32')][_0x663a('0x35')]?_0x35a85b['attributes']:_0x459619[_0x663a('0x2e')];_0x35a85b[_0x663a('0x4b')]=qs[_0x663a('0x38')](_0x2b7406[_0x663a('0x2f')][_0x663a('0x38')]);_0x35a85b[_0x663a('0x39')]=qs['filters'](_['pick'](_0x2b7406[_0x663a('0x2f')],_0x459619['filters']));if(_0x2b7406[_0x663a('0x2f')][_0x663a('0x4c')]){_0x35a85b[_0x663a('0x39')]=_[_0x663a('0x3b')](_0x35a85b[_0x663a('0x39')],{'$or':_[_0x663a('0x2a')](_0x35a85b[_0x663a('0x32')],function(_0x52f73f){var _0x4496b7={};_0x4496b7[_0x52f73f]={'$like':'%'+_0x2b7406['query']['filter']+'%'};return _0x4496b7;})});}_0x35a85b=_[_0x663a('0x3b')]({},_0x35a85b,_0x2b7406['options']);return _0x44b955[_0x663a('0x4e')](_0x35a85b);}})[_0x663a('0x25')](function(_0xe64264){if(_0xe64264){_0x471980=_0xe64264[_0x663a('0x35')];if(!_0x2b7406[_0x663a('0x2f')][_0x663a('0x36')]('nolimit')){_0x35a85b[_0x663a('0x1d')]=qs['limit'](_0x2b7406[_0x663a('0x2f')][_0x663a('0x1d')]);_0x35a85b[_0x663a('0x1f')]=qs['offset'](_0x2b7406[_0x663a('0x2f')]['offset']);}return _0x44b955[_0x663a('0x4e')](_0x35a85b);}})[_0x663a('0x25')](function(_0x19f8f5){if(_0x19f8f5){return _0x19f8f5?{'count':_0x471980,'rows':_0x19f8f5}:null;}})[_0x663a('0x25')](respondWithResult(_0x2e4b3e,null))['catch'](handleError(_0x2e4b3e,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 3ed469b..9fbc04c 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 _0x34e8=['int_dynamics365_configurations','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','Dynamics365Configuration'];(function(_0x59c30a,_0x3f9fc5){var _0x1355bf=function(_0x3e79c6){while(--_0x3e79c6){_0x59c30a['push'](_0x59c30a['shift']());}};_0x1355bf(++_0x3f9fc5);}(_0x34e8,0x12c));var _0x834e=function(_0x76ec5,_0x2b097e){_0x76ec5=_0x76ec5-0x0;var _0x282076=_0x34e8[_0x76ec5];return _0x282076;};'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 _0xbec5=['request-promise','path','../../config/environment','./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','int_dynamics365_configurations','lodash','util','api','moment','bluebird'];(function(_0x2f37be,_0x3eacbb){var _0x1574f4=function(_0x2ca2b0){while(--_0x2ca2b0){_0x2f37be['push'](_0x2f37be['shift']());}};_0x1574f4(++_0x3eacbb);}(_0xbec5,0xe5));var _0x5bec=function(_0x2aa0e7,_0x4e5145){_0x2aa0e7=_0x2aa0e7-0x0;var _0x1472c0=_0xbec5[_0x2aa0e7];return _0x1472c0;};'use strict';var _=require(_0x5bec('0x0'));var util=require(_0x5bec('0x1'));var logger=require('../../config/logger')(_0x5bec('0x2'));var moment=require(_0x5bec('0x3'));var BPromise=require(_0x5bec('0x4'));var rp=require(_0x5bec('0x5'));var fs=require('fs');var path=require(_0x5bec('0x6'));var rimraf=require('rimraf');var config=require(_0x5bec('0x7'));var attributes=require(_0x5bec('0x8'));module[_0x5bec('0x9')]=function(_0x4aaac6,_0x3ed67a){return _0x4aaac6[_0x5bec('0xa')](_0x5bec('0xb'),attributes,{'tableName':_0x5bec('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index b016352..7c49b64 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 _0x5a38=['result','catch','util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','request','then','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info'];(function(_0x4f8ac5,_0x1f81b7){var _0x23b66c=function(_0x44d376){while(--_0x44d376){_0x4f8ac5['push'](_0x4f8ac5['shift']());}};_0x23b66c(++_0x1f81b7);}(_0x5a38,0x13d));var _0x85a3=function(_0x42508b,_0x693bd2){_0x42508b=_0x42508b-0x0;var _0x4739b6=_0x5a38[_0x42508b];return _0x4739b6;};'use strict';var _=require('lodash');var util=require(_0x85a3('0x0'));var moment=require(_0x85a3('0x1'));var BPromise=require('bluebird');var rs=require(_0x85a3('0x2'));var fs=require('fs');var Redis=require(_0x85a3('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x85a3('0x4'));var logger=require('../../config/logger')(_0x85a3('0x5'));var config=require(_0x85a3('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x85a3('0x7')][_0x85a3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x520777,_0x1a7c91,_0x29bf55){return new BPromise(function(_0x1c6f67,_0x4f70d3){return client[_0x85a3('0x9')](_0x520777,_0x29bf55)[_0x85a3('0xa')](function(_0x4b9367){logger['info'](_0x85a3('0xb'),_0x1a7c91,_0x85a3('0xc'));logger[_0x85a3('0xd')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x1a7c91,'request\x20sent',JSON[_0x85a3('0xe')](_0x4b9367));if(_0x4b9367[_0x85a3('0xf')]){if(_0x4b9367[_0x85a3('0xf')][_0x85a3('0x10')]===0x1f4){logger[_0x85a3('0xf')](_0x85a3('0xb'),_0x1a7c91,_0x4b9367['error'][_0x85a3('0x11')]);return _0x4f70d3(_0x4b9367[_0x85a3('0xf')][_0x85a3('0x11')]);}logger[_0x85a3('0xf')](_0x85a3('0xb'),_0x1a7c91,_0x4b9367[_0x85a3('0xf')]['message']);return _0x1c6f67(_0x4b9367['error'][_0x85a3('0x11')]);}else{logger[_0x85a3('0x12')]('Dynamics365Configuration,\x20%s,\x20%s',_0x1a7c91,'request\x20sent');_0x1c6f67(_0x4b9367[_0x85a3('0x13')][_0x85a3('0x11')]);}})[_0x85a3('0x14')](function(_0x5c7686){logger[_0x85a3('0xf')](_0x85a3('0xb'),_0x1a7c91,_0x5c7686);_0x4f70d3(_0x5c7686);});});} \ No newline at end of file +var _0xde0b=['request\x20sent','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','message','error','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Dynamics365Configuration,\x20%s,\x20%s'];(function(_0x4278ba,_0xb2ef35){var _0xcaba8f=function(_0x4ac2c9){while(--_0x4ac2c9){_0x4278ba['push'](_0x4278ba['shift']());}};_0xcaba8f(++_0xb2ef35);}(_0xde0b,0x1d1));var _0xbde0=function(_0x34025a,_0x333f5c){_0x34025a=_0x34025a-0x0;var _0x23d00c=_0xde0b[_0x34025a];return _0x23d00c;};'use strict';var _=require(_0xbde0('0x0'));var util=require(_0xbde0('0x1'));var moment=require(_0xbde0('0x2'));var BPromise=require(_0xbde0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbde0('0x4'));var db=require(_0xbde0('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xbde0('0x6'))(_0xbde0('0x7'));var config=require(_0xbde0('0x8'));var jayson=require(_0xbde0('0x9'));var client=jayson[_0xbde0('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x34a20a,_0x3e998f,_0xaca2ef){return new BPromise(function(_0x14570b,_0x21e8c9){return client[_0xbde0('0xb')](_0x34a20a,_0xaca2ef)[_0xbde0('0xc')](function(_0x24a2c2){logger[_0xbde0('0xd')](_0xbde0('0xe'),_0x3e998f,_0xbde0('0xf'));logger['debug'](_0xbde0('0x10'),_0x3e998f,_0xbde0('0xf'),JSON[_0xbde0('0x11')](_0x24a2c2));if(_0x24a2c2['error']){if(_0x24a2c2['error']['code']===0x1f4){logger['error'](_0xbde0('0xe'),_0x3e998f,_0x24a2c2['error'][_0xbde0('0x12')]);return _0x21e8c9(_0x24a2c2[_0xbde0('0x13')][_0xbde0('0x12')]);}logger[_0xbde0('0x13')](_0xbde0('0xe'),_0x3e998f,_0x24a2c2[_0xbde0('0x13')][_0xbde0('0x12')]);return _0x14570b(_0x24a2c2[_0xbde0('0x13')][_0xbde0('0x12')]);}else{logger[_0xbde0('0xd')]('Dynamics365Configuration,\x20%s,\x20%s',_0x3e998f,'request\x20sent');_0x14570b(_0x24a2c2['result']['message']);}})['catch'](function(_0x30c280){logger[_0xbde0('0x13')](_0xbde0('0xe'),_0x3e998f,_0x30c280);_0x21e8c9(_0x30c280);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index ebbb774..45c6295 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 _0x8265=['exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy'];(function(_0x3ab3ce,_0x5e3960){var _0x2021e1=function(_0x375b64){while(--_0x375b64){_0x3ab3ce['push'](_0x3ab3ce['shift']());}};_0x2021e1(++_0x5e3960);}(_0x8265,0x12d));var _0x5826=function(_0x26ac0f,_0x52fee1){_0x26ac0f=_0x26ac0f-0x0;var _0x5ab067=_0x8265[_0x26ac0f];return _0x5ab067;};'use strict';var multer=require(_0x5826('0x0'));var util=require(_0x5826('0x1'));var path=require(_0x5826('0x2'));var timeout=require(_0x5826('0x3'));var express=require(_0x5826('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x5826('0x5'));var interaction=require(_0x5826('0x6'));var config=require(_0x5826('0x7'));var controller=require(_0x5826('0x8'));router[_0x5826('0x9')]('/',auth[_0x5826('0xa')](),controller['index']);router['get'](_0x5826('0xb'),auth['isAuthenticated'](),controller[_0x5826('0xc')]);router[_0x5826('0xd')]('/',auth[_0x5826('0xa')](),controller[_0x5826('0xe')]);router[_0x5826('0xf')]('/:id',auth[_0x5826('0xa')](),controller[_0x5826('0x10')]);router[_0x5826('0x11')](_0x5826('0xb'),auth['isAuthenticated'](),controller[_0x5826('0x12')]);module[_0x5826('0x13')]=router; \ No newline at end of file +var _0xc96a=['./intDynamics365Field.controller','isAuthenticated','index','get','show','create','/:id','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x234755,_0x554741){var _0x3e60ee=function(_0x46a9b){while(--_0x46a9b){_0x234755['push'](_0x234755['shift']());}};_0x3e60ee(++_0x554741);}(_0xc96a,0x191));var _0xac96=function(_0x2d2ca2,_0x51873f){_0x2d2ca2=_0x2d2ca2-0x0;var _0x48489d=_0xc96a[_0x2d2ca2];return _0x48489d;};'use strict';var multer=require(_0xac96('0x0'));var util=require('util');var path=require(_0xac96('0x1'));var timeout=require(_0xac96('0x2'));var express=require(_0xac96('0x3'));var router=express[_0xac96('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xac96('0x5'));var interaction=require(_0xac96('0x6'));var config=require('../../config/environment');var controller=require(_0xac96('0x7'));router['get']('/',auth[_0xac96('0x8')](),controller[_0xac96('0x9')]);router[_0xac96('0xa')]('/:id',auth[_0xac96('0x8')](),controller[_0xac96('0xb')]);router['post']('/',auth[_0xac96('0x8')](),controller[_0xac96('0xc')]);router['put'](_0xac96('0xd'),auth[_0xac96('0x8')](),controller['update']);router[_0xac96('0xe')]('/:id',auth[_0xac96('0x8')](),controller[_0xac96('0xf')]);module[_0xac96('0x10')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 9e6c22a..2381894 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 _0xebb4=['STRING','variable','BOOLEAN','sequelize','exports','ENUM','customVariable','picklist','string'];(function(_0x36c321,_0x13fcbe){var _0x2de6fb=function(_0x577be7){while(--_0x577be7){_0x36c321['push'](_0x36c321['shift']());}};_0x2de6fb(++_0x13fcbe);}(_0xebb4,0x186));var _0x4ebb=function(_0x178574,_0x3e6621){_0x178574=_0x178574-0x0;var _0x310389=_0xebb4[_0x178574];return _0x310389;};'use strict';var Sequelize=require(_0x4ebb('0x0'));module[_0x4ebb('0x1')]={'type':{'type':Sequelize[_0x4ebb('0x2')]('string','variable',_0x4ebb('0x3'),'keyValue',_0x4ebb('0x4')),'defaultValue':_0x4ebb('0x5')},'content':{'type':Sequelize[_0x4ebb('0x6')]},'key':{'type':Sequelize[_0x4ebb('0x6')]},'keyType':{'type':Sequelize[_0x4ebb('0x2')]('string',_0x4ebb('0x7'),'customVariable')},'keyContent':{'type':Sequelize[_0x4ebb('0x6')]},'idField':{'type':Sequelize[_0x4ebb('0x6')]},'nameField':{'type':Sequelize[_0x4ebb('0x6')]},'customField':{'type':Sequelize[_0x4ebb('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x8b2b=['ENUM','STRING','sequelize','exports','variable','customVariable','keyValue','picklist','string'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x8b2b,0x107));var _0xb8b2=function(_0x46fb49,_0x208b5f){_0x46fb49=_0x46fb49-0x0;var _0x1e53f5=_0x8b2b[_0x46fb49];return _0x1e53f5;};'use strict';var Sequelize=require(_0xb8b2('0x0'));module[_0xb8b2('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0xb8b2('0x2'),_0xb8b2('0x3'),_0xb8b2('0x4'),_0xb8b2('0x5')),'defaultValue':_0xb8b2('0x6')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xb8b2('0x7')](_0xb8b2('0x6'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0xb8b2('0x8')]},'idField':{'type':Sequelize[_0xb8b2('0x8')]},'nameField':{'type':Sequelize[_0xb8b2('0x8')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb8b2('0x8')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 3e98780..7ec7260 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 _0xa24f=['create','body','eml-format','zip-dir','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','error','stack','name','map','Dynamics365Field','rawAttributes','fieldName','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','includeAll','include','show','params','options','find','catch'];(function(_0x3e2768,_0x5ac211){var _0x593a9e=function(_0x3e10aa){while(--_0x3e10aa){_0x3e2768['push'](_0x3e2768['shift']());}};_0x593a9e(++_0x5ac211);}(_0xa24f,0xd1));var _0xfa24=function(_0x4d3187,_0x267c51){_0x4d3187=_0x4d3187-0x0;var _0x107906=_0xa24f[_0x4d3187];return _0x107906;};'use strict';var emlformat=require(_0xfa24('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfa24('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfa24('0x2'));var moment=require(_0xfa24('0x3'));var BPromise=require(_0xfa24('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xfa24('0x5'));var sox=require('sox');var csv=require(_0xfa24('0x6'));var ejs=require(_0xfa24('0x7'));var fs=require('fs');var fs_extra=require(_0xfa24('0x8'));var _=require(_0xfa24('0x9'));var squel=require(_0xfa24('0xa'));var crypto=require(_0xfa24('0xb'));var jsforce=require(_0xfa24('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xfa24('0x6'));var querystring=require(_0xfa24('0xd'));var Papa=require(_0xfa24('0xe'));var Redis=require(_0xfa24('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xfa24('0x10'));var hardwareService=require(_0xfa24('0x11'));var logger=require('../../config/logger')(_0xfa24('0x12'));var utils=require('../../config/utils');var config=require(_0xfa24('0x13'));var licenseUtil=require(_0xfa24('0x14'));var db=require(_0xfa24('0x15'))['db'];function respondWithStatusCode(_0x2dcb85,_0x465127){_0x465127=_0x465127||0xcc;return function(_0x57983f){if(_0x57983f){return _0x2dcb85[_0xfa24('0x16')](_0x465127);}return _0x2dcb85[_0xfa24('0x17')](_0x465127)[_0xfa24('0x18')]();};}function respondWithResult(_0x1319d1,_0x3b3b10){_0x3b3b10=_0x3b3b10||0xc8;return function(_0x4868d1){if(_0x4868d1){return _0x1319d1['status'](_0x3b3b10)[_0xfa24('0x19')](_0x4868d1);}};}function respondWithFilteredResult(_0x1b1975,_0x5067e3){return function(_0x1e4f24){if(_0x1e4f24){var _0x39ac95=typeof _0x5067e3[_0xfa24('0x1a')]==='undefined'&&typeof _0x5067e3[_0xfa24('0x1b')]===_0xfa24('0x1c');var _0x529ee2=_0x1e4f24[_0xfa24('0x1d')];var _0x4b13ac=_0x39ac95?0x0:_0x5067e3[_0xfa24('0x1a')];var _0x475afd=_0x39ac95?_0x1e4f24[_0xfa24('0x1d')]:_0x5067e3['offset']+_0x5067e3[_0xfa24('0x1b')];var _0x5a04db;if(_0x475afd>=_0x529ee2){_0x475afd=_0x529ee2;_0x5a04db=0xc8;}else{_0x5a04db=0xce;}_0x1b1975[_0xfa24('0x17')](_0x5a04db);return _0x1b1975[_0xfa24('0x1e')]('Content-Range',_0x4b13ac+'-'+_0x475afd+'/'+_0x529ee2)[_0xfa24('0x19')](_0x1e4f24);}return null;};}function patchUpdates(_0x4a6cf3){return function(_0x40b281){try{jsonpatch[_0xfa24('0x1f')](_0x40b281,_0x4a6cf3,!![]);}catch(_0x4afca2){return BPromise[_0xfa24('0x20')](_0x4afca2);}return _0x40b281[_0xfa24('0x21')]();};}function saveUpdates(_0x2eab06,_0x4653dc){return function(_0x542360){if(_0x542360){return _0x542360[_0xfa24('0x22')](_0x2eab06)[_0xfa24('0x23')](function(_0x2aa8c7){return _0x2aa8c7;});}return null;};}function removeEntity(_0x214e1a,_0x375dd0){return function(_0x12e536){if(_0x12e536){return _0x12e536[_0xfa24('0x24')]()[_0xfa24('0x23')](function(){_0x214e1a['status'](0xcc)[_0xfa24('0x18')]();});}};}function handleEntityNotFound(_0x573118,_0x2e3cf2){return function(_0x1f2cfd){if(!_0x1f2cfd){_0x573118[_0xfa24('0x16')](0x194);}return _0x1f2cfd;};}function handleError(_0x146228,_0x12a08c){_0x12a08c=_0x12a08c||0x1f4;return function(_0xcc8e85){logger[_0xfa24('0x25')](_0xcc8e85[_0xfa24('0x26')]);if(_0xcc8e85[_0xfa24('0x27')]){delete _0xcc8e85[_0xfa24('0x27')];}_0x146228[_0xfa24('0x17')](_0x12a08c)['send'](_0xcc8e85);};}exports['index']=function(_0x94b8f7,_0x24baed){var _0x424275={},_0x45bcc3={},_0x4d56b1={'count':0x0,'rows':[]};var _0x3ea610=_[_0xfa24('0x28')](db[_0xfa24('0x29')][_0xfa24('0x2a')],function(_0x5930e2){return{'name':_0x5930e2[_0xfa24('0x2b')],'type':_0x5930e2['type']['key']};});_0x45bcc3[_0xfa24('0x2c')]=_[_0xfa24('0x28')](_0x3ea610,_0xfa24('0x27'));_0x45bcc3['query']=_[_0xfa24('0x2d')](_0x94b8f7[_0xfa24('0x2e')]);_0x45bcc3['filters']=_[_0xfa24('0x2f')](_0x45bcc3[_0xfa24('0x2c')],_0x45bcc3[_0xfa24('0x2e')]);_0x424275[_0xfa24('0x30')]=_[_0xfa24('0x2f')](_0x45bcc3['model'],qs[_0xfa24('0x31')](_0x94b8f7[_0xfa24('0x2e')][_0xfa24('0x31')]));_0x424275['attributes']=_0x424275[_0xfa24('0x30')][_0xfa24('0x32')]?_0x424275[_0xfa24('0x30')]:_0x45bcc3[_0xfa24('0x2c')];if(!_0x94b8f7[_0xfa24('0x2e')][_0xfa24('0x33')](_0xfa24('0x34'))){_0x424275[_0xfa24('0x1b')]=qs['limit'](_0x94b8f7['query'][_0xfa24('0x1b')]);_0x424275[_0xfa24('0x1a')]=qs[_0xfa24('0x1a')](_0x94b8f7['query']['offset']);}_0x424275[_0xfa24('0x35')]=qs[_0xfa24('0x36')](_0x94b8f7[_0xfa24('0x2e')][_0xfa24('0x36')]);_0x424275['where']=qs[_0xfa24('0x37')](_[_0xfa24('0x38')](_0x94b8f7[_0xfa24('0x2e')],_0x45bcc3[_0xfa24('0x37')]),_0x3ea610);if(_0x94b8f7[_0xfa24('0x2e')][_0xfa24('0x39')]){_0x424275[_0xfa24('0x3a')]=_['merge'](_0x424275[_0xfa24('0x3a')],{'$or':_[_0xfa24('0x28')](_0x3ea610,function(_0x52cbe0){if(_0x52cbe0['type']!=='VIRTUAL'){var _0x813183={};_0x813183[_0x52cbe0[_0xfa24('0x27')]]={'$like':'%'+_0x94b8f7[_0xfa24('0x2e')][_0xfa24('0x39')]+'%'};return _0x813183;}})});}_0x424275=_[_0xfa24('0x3b')]({},_0x424275,_0x94b8f7['options']);var _0x505d5f={'where':_0x424275[_0xfa24('0x3a')]};return db[_0xfa24('0x29')][_0xfa24('0x1d')](_0x505d5f)[_0xfa24('0x23')](function(_0x47c8d4){_0x4d56b1[_0xfa24('0x1d')]=_0x47c8d4;if(_0x94b8f7['query'][_0xfa24('0x3c')]){_0x424275[_0xfa24('0x3d')]=[{'all':!![]}];}return db[_0xfa24('0x29')]['findAll'](_0x424275);})['then'](function(_0x4b76e5){_0x4d56b1['rows']=_0x4b76e5;return _0x4d56b1;})[_0xfa24('0x23')](respondWithFilteredResult(_0x24baed,_0x424275))['catch'](handleError(_0x24baed,null));};exports[_0xfa24('0x3e')]=function(_0x32da0b,_0x3182f1){var _0x6c4912={'raw':!![],'where':{'id':_0x32da0b[_0xfa24('0x3f')]['id']}},_0x2f6bb1={};_0x2f6bb1[_0xfa24('0x2c')]=_[_0xfa24('0x2d')](db[_0xfa24('0x29')]['rawAttributes']);_0x2f6bb1[_0xfa24('0x2e')]=_['keys'](_0x32da0b[_0xfa24('0x2e')]);_0x2f6bb1[_0xfa24('0x37')]=_[_0xfa24('0x2f')](_0x2f6bb1[_0xfa24('0x2c')],_0x2f6bb1[_0xfa24('0x2e')]);_0x6c4912[_0xfa24('0x30')]=_['intersection'](_0x2f6bb1[_0xfa24('0x2c')],qs[_0xfa24('0x31')](_0x32da0b['query'][_0xfa24('0x31')]));_0x6c4912[_0xfa24('0x30')]=_0x6c4912[_0xfa24('0x30')][_0xfa24('0x32')]?_0x6c4912[_0xfa24('0x30')]:_0x2f6bb1[_0xfa24('0x2c')];if(_0x32da0b[_0xfa24('0x2e')]['includeAll']){_0x6c4912[_0xfa24('0x3d')]=[{'all':!![]}];}_0x6c4912=_['merge']({},_0x6c4912,_0x32da0b[_0xfa24('0x40')]);return db[_0xfa24('0x29')][_0xfa24('0x41')](_0x6c4912)[_0xfa24('0x23')](handleEntityNotFound(_0x3182f1,null))[_0xfa24('0x23')](respondWithResult(_0x3182f1,null))[_0xfa24('0x42')](handleError(_0x3182f1,null));};exports[_0xfa24('0x43')]=function(_0x5c02a9,_0x3af97d){return db[_0xfa24('0x29')][_0xfa24('0x43')](_0x5c02a9[_0xfa24('0x44')],{})['then'](respondWithResult(_0x3af97d,0xc9))[_0xfa24('0x42')](handleError(_0x3af97d,null));};exports['update']=function(_0xfbcdd,_0x4f58d1){if(_0xfbcdd[_0xfa24('0x44')]['id']){delete _0xfbcdd[_0xfa24('0x44')]['id'];}return db[_0xfa24('0x29')][_0xfa24('0x41')]({'where':{'id':_0xfbcdd[_0xfa24('0x3f')]['id']}})['then'](handleEntityNotFound(_0x4f58d1,null))[_0xfa24('0x23')](saveUpdates(_0xfbcdd['body'],null))[_0xfa24('0x23')](respondWithResult(_0x4f58d1,null))[_0xfa24('0x42')](handleError(_0x4f58d1,null));};exports['destroy']=function(_0x56f47b,_0xd445e9){return db[_0xfa24('0x29')]['find']({'where':{'id':_0x56f47b[_0xfa24('0x3f')]['id']}})['then'](handleEntityNotFound(_0xd445e9,null))[_0xfa24('0x23')](removeEntity(_0xd445e9,null))[_0xfa24('0x42')](handleError(_0xd445e9,null));}; \ No newline at end of file +var _0xd038=['includeAll','findAll','rows','show','params','include','find','create','body','catch','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','index','map','Dynamics365Field','rawAttributes','type','key','model','filters','intersection','query','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge'];(function(_0x17698c,_0x45e0d1){var _0x1a29a1=function(_0x47e880){while(--_0x47e880){_0x17698c['push'](_0x17698c['shift']());}};_0x1a29a1(++_0x45e0d1);}(_0xd038,0x1cc));var _0x8d03=function(_0x1460f6,_0x59051a){_0x1460f6=_0x1460f6-0x0;var _0x46ce94=_0xd038[_0x1460f6];return _0x46ce94;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8d03('0x0'));var zipdir=require(_0x8d03('0x1'));var jsonpatch=require(_0x8d03('0x2'));var rp=require(_0x8d03('0x3'));var moment=require('moment');var BPromise=require(_0x8d03('0x4'));var Mustache=require(_0x8d03('0x5'));var util=require(_0x8d03('0x6'));var path=require('path');var sox=require(_0x8d03('0x7'));var csv=require(_0x8d03('0x8'));var ejs=require(_0x8d03('0x9'));var fs=require('fs');var fs_extra=require(_0x8d03('0xa'));var _=require(_0x8d03('0xb'));var squel=require(_0x8d03('0xc'));var crypto=require(_0x8d03('0xd'));var jsforce=require(_0x8d03('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x8d03('0x8'));var querystring=require(_0x8d03('0xf'));var Papa=require(_0x8d03('0x10'));var Redis=require(_0x8d03('0x11'));var authService=require(_0x8d03('0x12'));var qs=require(_0x8d03('0x13'));var as=require(_0x8d03('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8d03('0x15'))(_0x8d03('0x16'));var utils=require(_0x8d03('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x8d03('0x18'));var db=require(_0x8d03('0x19'))['db'];function respondWithStatusCode(_0x34827a,_0x7fbf5e){_0x7fbf5e=_0x7fbf5e||0xcc;return function(_0x59c219){if(_0x59c219){return _0x34827a[_0x8d03('0x1a')](_0x7fbf5e);}return _0x34827a[_0x8d03('0x1b')](_0x7fbf5e)['end']();};}function respondWithResult(_0x11e5cd,_0x75be75){_0x75be75=_0x75be75||0xc8;return function(_0x59fd15){if(_0x59fd15){return _0x11e5cd[_0x8d03('0x1b')](_0x75be75)[_0x8d03('0x1c')](_0x59fd15);}};}function respondWithFilteredResult(_0x3d25c4,_0x481386){return function(_0x3fc76e){if(_0x3fc76e){var _0x31a4cf=typeof _0x481386[_0x8d03('0x1d')]===_0x8d03('0x1e')&&typeof _0x481386['limit']===_0x8d03('0x1e');var _0x444ab5=_0x3fc76e[_0x8d03('0x1f')];var _0xd68b91=_0x31a4cf?0x0:_0x481386[_0x8d03('0x1d')];var _0x49bc4a=_0x31a4cf?_0x3fc76e[_0x8d03('0x1f')]:_0x481386[_0x8d03('0x1d')]+_0x481386[_0x8d03('0x20')];var _0x30cdac;if(_0x49bc4a>=_0x444ab5){_0x49bc4a=_0x444ab5;_0x30cdac=0xc8;}else{_0x30cdac=0xce;}_0x3d25c4[_0x8d03('0x1b')](_0x30cdac);return _0x3d25c4[_0x8d03('0x21')](_0x8d03('0x22'),_0xd68b91+'-'+_0x49bc4a+'/'+_0x444ab5)[_0x8d03('0x1c')](_0x3fc76e);}return null;};}function patchUpdates(_0x58c61d){return function(_0x27dc4d){try{jsonpatch[_0x8d03('0x23')](_0x27dc4d,_0x58c61d,!![]);}catch(_0x29a39a){return BPromise[_0x8d03('0x24')](_0x29a39a);}return _0x27dc4d[_0x8d03('0x25')]();};}function saveUpdates(_0x1b9270,_0x1ea3d2){return function(_0x2b4033){if(_0x2b4033){return _0x2b4033[_0x8d03('0x26')](_0x1b9270)[_0x8d03('0x27')](function(_0x228261){return _0x228261;});}return null;};}function removeEntity(_0x4a637d,_0xc2695){return function(_0x3f4bfd){if(_0x3f4bfd){return _0x3f4bfd[_0x8d03('0x28')]()[_0x8d03('0x27')](function(){_0x4a637d['status'](0xcc)[_0x8d03('0x29')]();});}};}function handleEntityNotFound(_0x58397f,_0x2b0edc){return function(_0x2e3c95){if(!_0x2e3c95){_0x58397f[_0x8d03('0x1a')](0x194);}return _0x2e3c95;};}function handleError(_0x24cdb2,_0x1c12f9){_0x1c12f9=_0x1c12f9||0x1f4;return function(_0x38a23d){logger[_0x8d03('0x2a')](_0x38a23d[_0x8d03('0x2b')]);if(_0x38a23d[_0x8d03('0x2c')]){delete _0x38a23d[_0x8d03('0x2c')];}_0x24cdb2['status'](_0x1c12f9)['send'](_0x38a23d);};}exports[_0x8d03('0x2d')]=function(_0x562bcf,_0x160c36){var _0x4c96c1={},_0x960b7={},_0x3bb6f6={'count':0x0,'rows':[]};var _0x17e099=_[_0x8d03('0x2e')](db[_0x8d03('0x2f')][_0x8d03('0x30')],function(_0x30085e){return{'name':_0x30085e['fieldName'],'type':_0x30085e[_0x8d03('0x31')][_0x8d03('0x32')]};});_0x960b7[_0x8d03('0x33')]=_['map'](_0x17e099,_0x8d03('0x2c'));_0x960b7['query']=_['keys'](_0x562bcf['query']);_0x960b7[_0x8d03('0x34')]=_[_0x8d03('0x35')](_0x960b7[_0x8d03('0x33')],_0x960b7[_0x8d03('0x36')]);_0x4c96c1['attributes']=_['intersection'](_0x960b7[_0x8d03('0x33')],qs[_0x8d03('0x37')](_0x562bcf[_0x8d03('0x36')][_0x8d03('0x37')]));_0x4c96c1['attributes']=_0x4c96c1[_0x8d03('0x38')][_0x8d03('0x39')]?_0x4c96c1[_0x8d03('0x38')]:_0x960b7['model'];if(!_0x562bcf[_0x8d03('0x36')][_0x8d03('0x3a')]('nolimit')){_0x4c96c1[_0x8d03('0x20')]=qs[_0x8d03('0x20')](_0x562bcf[_0x8d03('0x36')][_0x8d03('0x20')]);_0x4c96c1[_0x8d03('0x1d')]=qs[_0x8d03('0x1d')](_0x562bcf['query']['offset']);}_0x4c96c1[_0x8d03('0x3b')]=qs[_0x8d03('0x3c')](_0x562bcf[_0x8d03('0x36')][_0x8d03('0x3c')]);_0x4c96c1[_0x8d03('0x3d')]=qs[_0x8d03('0x34')](_[_0x8d03('0x3e')](_0x562bcf[_0x8d03('0x36')],_0x960b7[_0x8d03('0x34')]),_0x17e099);if(_0x562bcf[_0x8d03('0x36')][_0x8d03('0x3f')]){_0x4c96c1['where']=_[_0x8d03('0x40')](_0x4c96c1[_0x8d03('0x3d')],{'$or':_[_0x8d03('0x2e')](_0x17e099,function(_0x5d7eb9){if(_0x5d7eb9[_0x8d03('0x31')]!=='VIRTUAL'){var _0x4c7bd0={};_0x4c7bd0[_0x5d7eb9[_0x8d03('0x2c')]]={'$like':'%'+_0x562bcf[_0x8d03('0x36')][_0x8d03('0x3f')]+'%'};return _0x4c7bd0;}})});}_0x4c96c1=_['merge']({},_0x4c96c1,_0x562bcf['options']);var _0x119482={'where':_0x4c96c1[_0x8d03('0x3d')]};return db['Dynamics365Field'][_0x8d03('0x1f')](_0x119482)['then'](function(_0x71a3c6){_0x3bb6f6[_0x8d03('0x1f')]=_0x71a3c6;if(_0x562bcf['query'][_0x8d03('0x41')]){_0x4c96c1['include']=[{'all':!![]}];}return db[_0x8d03('0x2f')][_0x8d03('0x42')](_0x4c96c1);})[_0x8d03('0x27')](function(_0x4652f2){_0x3bb6f6[_0x8d03('0x43')]=_0x4652f2;return _0x3bb6f6;})[_0x8d03('0x27')](respondWithFilteredResult(_0x160c36,_0x4c96c1))['catch'](handleError(_0x160c36,null));};exports[_0x8d03('0x44')]=function(_0x54d71f,_0x145c4a){var _0xa1e582={'raw':!![],'where':{'id':_0x54d71f[_0x8d03('0x45')]['id']}},_0x1d8dc1={};_0x1d8dc1[_0x8d03('0x33')]=_['keys'](db['Dynamics365Field'][_0x8d03('0x30')]);_0x1d8dc1[_0x8d03('0x36')]=_['keys'](_0x54d71f['query']);_0x1d8dc1[_0x8d03('0x34')]=_[_0x8d03('0x35')](_0x1d8dc1[_0x8d03('0x33')],_0x1d8dc1[_0x8d03('0x36')]);_0xa1e582[_0x8d03('0x38')]=_['intersection'](_0x1d8dc1[_0x8d03('0x33')],qs[_0x8d03('0x37')](_0x54d71f[_0x8d03('0x36')][_0x8d03('0x37')]));_0xa1e582['attributes']=_0xa1e582['attributes']['length']?_0xa1e582[_0x8d03('0x38')]:_0x1d8dc1[_0x8d03('0x33')];if(_0x54d71f[_0x8d03('0x36')]['includeAll']){_0xa1e582[_0x8d03('0x46')]=[{'all':!![]}];}_0xa1e582=_[_0x8d03('0x40')]({},_0xa1e582,_0x54d71f['options']);return db['Dynamics365Field'][_0x8d03('0x47')](_0xa1e582)[_0x8d03('0x27')](handleEntityNotFound(_0x145c4a,null))['then'](respondWithResult(_0x145c4a,null))['catch'](handleError(_0x145c4a,null));};exports[_0x8d03('0x48')]=function(_0x3daca2,_0x436e8f){return db[_0x8d03('0x2f')]['create'](_0x3daca2[_0x8d03('0x49')],{})[_0x8d03('0x27')](respondWithResult(_0x436e8f,0xc9))['catch'](handleError(_0x436e8f,null));};exports[_0x8d03('0x26')]=function(_0x53c41e,_0x2bb2ef){if(_0x53c41e[_0x8d03('0x49')]['id']){delete _0x53c41e['body']['id'];}return db['Dynamics365Field'][_0x8d03('0x47')]({'where':{'id':_0x53c41e[_0x8d03('0x45')]['id']}})[_0x8d03('0x27')](handleEntityNotFound(_0x2bb2ef,null))['then'](saveUpdates(_0x53c41e['body'],null))['then'](respondWithResult(_0x2bb2ef,null))[_0x8d03('0x4a')](handleError(_0x2bb2ef,null));};exports[_0x8d03('0x28')]=function(_0x1cb079,_0x1d80c5){return db['Dynamics365Field'][_0x8d03('0x47')]({'where':{'id':_0x1cb079['params']['id']}})[_0x8d03('0x27')](handleEntityNotFound(_0x1d80c5,null))[_0x8d03('0x27')](removeEntity(_0x1d80c5,null))['catch'](handleError(_0x1d80c5,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 8756b45..39d4b84 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 _0xb423=['lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField'];(function(_0x4a3138,_0x41d5a5){var _0x1b189=function(_0x2b6cd1){while(--_0x2b6cd1){_0x4a3138['push'](_0x4a3138['shift']());}};_0x1b189(++_0x41d5a5);}(_0xb423,0xa8));var _0x3b42=function(_0x3379e5,_0x20a093){_0x3379e5=_0x3379e5-0x0;var _0x21164a=_0xb423[_0x3379e5];return _0x21164a;};'use strict';var _=require(_0x3b42('0x0'));var util=require(_0x3b42('0x1'));var logger=require(_0x3b42('0x2'))(_0x3b42('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3b42('0x4'));var fs=require('fs');var path=require(_0x3b42('0x5'));var rimraf=require(_0x3b42('0x6'));var config=require(_0x3b42('0x7'));var attributes=require(_0x3b42('0x8'));module['exports']=function(_0x5ba3f9,_0x20eee4){return _0x5ba3f9[_0x3b42('0x9')](_0x3b42('0xa'),attributes,{'tableName':_0x3b42('0xb'),'paranoid':![],'indexes':[{'name':_0x3b42('0xc'),'fields':[_0x3b42('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x477c=['int_dynamics365_fields','dynamics365_unique_index','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','Dynamics365Field'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x477c,0x13d));var _0xc477=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x477c[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xc477('0x0'));var util=require(_0xc477('0x1'));var logger=require(_0xc477('0x2'))(_0xc477('0x3'));var moment=require(_0xc477('0x4'));var BPromise=require(_0xc477('0x5'));var rp=require(_0xc477('0x6'));var fs=require('fs');var path=require(_0xc477('0x7'));var rimraf=require(_0xc477('0x8'));var config=require(_0xc477('0x9'));var attributes=require(_0xc477('0xa'));module[_0xc477('0xb')]=function(_0x56ef6a,_0x1f7ca8){return _0x56ef6a['define'](_0xc477('0xc'),attributes,{'tableName':_0xc477('0xd'),'paranoid':![],'indexes':[{'name':_0xc477('0xe'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.rpc.js b/server/api/intDynamics365Field/intDynamics365Field.rpc.js index 11073ba..769d94b 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 _0xc330=['http','request','info','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','Dynamics365Field,\x20%s,\x20%s','message','result','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x4001ad,_0x1e22dd){var _0x4c7ec2=function(_0x24cb8a){while(--_0x24cb8a){_0x4001ad['push'](_0x4001ad['shift']());}};_0x4c7ec2(++_0x1e22dd);}(_0xc330,0xae));var _0x0c33=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xc330[_0x5b644e];return _0x49c6bf;};'use strict';var _=require('lodash');var util=require(_0x0c33('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0c33('0x1'));var fs=require('fs');var Redis=require(_0x0c33('0x2'));var db=require(_0x0c33('0x3'))['db'];var utils=require(_0x0c33('0x4'));var logger=require(_0x0c33('0x5'))(_0x0c33('0x6'));var config=require(_0x0c33('0x7'));var jayson=require(_0x0c33('0x8'));var client=jayson[_0x0c33('0x9')][_0x0c33('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1a19be,_0x420bfc,_0x20f06b){return new BPromise(function(_0x58c935,_0x324857){return client[_0x0c33('0xb')](_0x1a19be,_0x20f06b)['then'](function(_0x20fade){logger[_0x0c33('0xc')]('Dynamics365Field,\x20%s,\x20%s',_0x420bfc,_0x0c33('0xd'));logger[_0x0c33('0xe')](_0x0c33('0xf'),_0x420bfc,_0x0c33('0xd'),JSON[_0x0c33('0x10')](_0x20fade));if(_0x20fade[_0x0c33('0x11')]){if(_0x20fade[_0x0c33('0x11')][_0x0c33('0x12')]===0x1f4){logger[_0x0c33('0x11')](_0x0c33('0x13'),_0x420bfc,_0x20fade[_0x0c33('0x11')][_0x0c33('0x14')]);return _0x324857(_0x20fade[_0x0c33('0x11')][_0x0c33('0x14')]);}logger['error'](_0x0c33('0x13'),_0x420bfc,_0x20fade[_0x0c33('0x11')][_0x0c33('0x14')]);return _0x58c935(_0x20fade[_0x0c33('0x11')][_0x0c33('0x14')]);}else{logger[_0x0c33('0xc')]('Dynamics365Field,\x20%s,\x20%s',_0x420bfc,_0x0c33('0xd'));_0x58c935(_0x20fade[_0x0c33('0x15')]['message']);}})[_0x0c33('0x16')](function(_0x1f1d57){logger['error'](_0x0c33('0x13'),_0x420bfc,_0x1f1d57);_0x324857(_0x1f1d57);});});} \ No newline at end of file +var _0x78d2=['catch','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x54ba16,_0x4cc831){var _0x4f8cce=function(_0x4f4d54){while(--_0x4f4d54){_0x54ba16['push'](_0x54ba16['shift']());}};_0x4f8cce(++_0x4cc831);}(_0x78d2,0x119));var _0x278d=function(_0x3fb37a,_0x4fa12b){_0x3fb37a=_0x3fb37a-0x0;var _0x3e8cf0=_0x78d2[_0x3fb37a];return _0x3e8cf0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x278d('0x0'));var BPromise=require('bluebird');var rs=require(_0x278d('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x278d('0x2'))['db'];var utils=require(_0x278d('0x3'));var logger=require(_0x278d('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x278d('0x5'));var client=jayson[_0x278d('0x6')][_0x278d('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xcc8433,_0x223b4d,_0x1033cd){return new BPromise(function(_0x162823,_0x53d1b6){return client[_0x278d('0x8')](_0xcc8433,_0x1033cd)['then'](function(_0x58955a){logger[_0x278d('0x9')](_0x278d('0xa'),_0x223b4d,_0x278d('0xb'));logger[_0x278d('0xc')](_0x278d('0xd'),_0x223b4d,_0x278d('0xb'),JSON[_0x278d('0xe')](_0x58955a));if(_0x58955a[_0x278d('0xf')]){if(_0x58955a[_0x278d('0xf')][_0x278d('0x10')]===0x1f4){logger[_0x278d('0xf')](_0x278d('0xa'),_0x223b4d,_0x58955a[_0x278d('0xf')]['message']);return _0x53d1b6(_0x58955a[_0x278d('0xf')][_0x278d('0x11')]);}logger[_0x278d('0xf')](_0x278d('0xa'),_0x223b4d,_0x58955a[_0x278d('0xf')]['message']);return _0x162823(_0x58955a[_0x278d('0xf')][_0x278d('0x11')]);}else{logger[_0x278d('0x9')]('Dynamics365Field,\x20%s,\x20%s',_0x223b4d,_0x278d('0xb'));_0x162823(_0x58955a[_0x278d('0x12')]['message']);}})[_0x278d('0x13')](function(_0x22d8da){logger['error'](_0x278d('0xa'),_0x223b4d,_0x22d8da);_0x53d1b6(_0x22d8da);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index da13fae..6a5a73b 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 _0x0d0d=['./intFreshdeskAccount.controller','get','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','isAuthenticated','getFields','create','post','addConfiguration','put','update','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xabc49d,_0xef5bef){var _0x154be2=function(_0x382b94){while(--_0x382b94){_0xabc49d['push'](_0xabc49d['shift']());}};_0x154be2(++_0xef5bef);}(_0x0d0d,0x1d2));var _0xd0d0=function(_0x4c4311,_0xf75821){_0x4c4311=_0x4c4311-0x0;var _0x5bba6e=_0x0d0d[_0x4c4311];return _0x5bba6e;};'use strict';var multer=require(_0xd0d0('0x0'));var util=require('util');var path=require(_0xd0d0('0x1'));var timeout=require(_0xd0d0('0x2'));var express=require(_0xd0d0('0x3'));var router=express[_0xd0d0('0x4')]();var fs_extra=require(_0xd0d0('0x5'));var auth=require(_0xd0d0('0x6'));var interaction=require(_0xd0d0('0x7'));var config=require(_0xd0d0('0x8'));var controller=require(_0xd0d0('0x9'));router[_0xd0d0('0xa')]('/',auth['isAuthenticated'](),controller[_0xd0d0('0xb')]);router[_0xd0d0('0xa')](_0xd0d0('0xc'),auth['isAuthenticated'](),controller[_0xd0d0('0xd')]);router[_0xd0d0('0xa')](_0xd0d0('0xe'),auth['isAuthenticated'](),controller[_0xd0d0('0xf')]);router[_0xd0d0('0xa')](_0xd0d0('0x10'),auth[_0xd0d0('0x11')](),controller[_0xd0d0('0x12')]);router['post']('/',auth[_0xd0d0('0x11')](),controller[_0xd0d0('0x13')]);router[_0xd0d0('0x14')]('/:id/configurations',auth[_0xd0d0('0x11')](),controller[_0xd0d0('0x15')]);router[_0xd0d0('0x16')]('/:id',auth[_0xd0d0('0x11')](),controller[_0xd0d0('0x17')]);router['delete'](_0xd0d0('0xc'),auth[_0xd0d0('0x11')](),controller['destroy']);module[_0xd0d0('0x18')]=router; \ No newline at end of file +var _0x1579=['exports','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','put','/:id','update','destroy'];(function(_0x100504,_0x1423c2){var _0xe2d3f8=function(_0x47edca){while(--_0x47edca){_0x100504['push'](_0x100504['shift']());}};_0xe2d3f8(++_0x1423c2);}(_0x1579,0x143));var _0x9157=function(_0x5d1c45,_0x1f139f){_0x5d1c45=_0x5d1c45-0x0;var _0x29e5aa=_0x1579[_0x5d1c45];return _0x29e5aa;};'use strict';var multer=require(_0x9157('0x0'));var util=require(_0x9157('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9157('0x2'));var router=express['Router']();var fs_extra=require(_0x9157('0x3'));var auth=require(_0x9157('0x4'));var interaction=require(_0x9157('0x5'));var config=require(_0x9157('0x6'));var controller=require(_0x9157('0x7'));router[_0x9157('0x8')]('/',auth[_0x9157('0x9')](),controller[_0x9157('0xa')]);router[_0x9157('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x9157('0xb')]);router[_0x9157('0x8')](_0x9157('0xc'),auth[_0x9157('0x9')](),controller[_0x9157('0xd')]);router[_0x9157('0x8')](_0x9157('0xe'),auth[_0x9157('0x9')](),controller[_0x9157('0xf')]);router[_0x9157('0x10')]('/',auth[_0x9157('0x9')](),controller[_0x9157('0x11')]);router[_0x9157('0x10')]('/:id/configurations',auth[_0x9157('0x9')](),controller['addConfiguration']);router[_0x9157('0x12')](_0x9157('0x13'),auth[_0x9157('0x9')](),controller[_0x9157('0x14')]);router['delete'](_0x9157('0x13'),auth['isAuthenticated'](),controller[_0x9157('0x15')]);module[_0x9157('0x16')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 03f0338..9987f02 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 _0x4b17=['username','sequelize','STRING'];(function(_0x3e98c3,_0x598349){var _0x5d750c=function(_0x56610e){while(--_0x56610e){_0x3e98c3['push'](_0x3e98c3['shift']());}};_0x5d750c(++_0x598349);}(_0x4b17,0x10f));var _0x74b1=function(_0x3c2b2e,_0x3e6e53){_0x3c2b2e=_0x3c2b2e-0x0;var _0x27a338=_0x4b17[_0x3c2b2e];return _0x27a338;};'use strict';var Sequelize=require(_0x74b1('0x0'));module['exports']={'name':{'type':Sequelize[_0x74b1('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x74b1('0x1')],'unique':_0x74b1('0x2')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x74b1('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x3a6d=['exports','STRING','username','sequelize'];(function(_0x424065,_0x572f82){var _0x2b6c16=function(_0xb39972){while(--_0xb39972){_0x424065['push'](_0x424065['shift']());}};_0x2b6c16(++_0x572f82);}(_0x3a6d,0x143));var _0xd3a6=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x3a6d[_0x53ccf2];return _0x5a2964;};'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/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index e416993..ea7734c 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 _0xbefe=['remoteUri','slice','lastIndexOf','GET','format','api/v2/ticket_fields','apiKey','base64','requester','subject','agent','description','priority','group','ticket_type','company','remove','includes','default','custom_text','custom_dropdown','capitalize','statusCode','stringify','send','test','Wrong\x20credentials','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','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','../../components/integrations/configuration','status','end','offset','undefined','limit','count','set','Content-Range','json','save','update','then','destroy','sendStatus','map','rawAttributes','type','model','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','options','FreshdeskAccount','include','findAll','rows','catch','show','filters','merge','find','create','body','params','getConfigurations','findOne','FreshdeskConfiguration','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','FreshdeskField','getFields'];(function(_0x26b45c,_0x53d6a6){var _0x2a0bca=function(_0x3723e3){while(--_0x3723e3){_0x26b45c['push'](_0x26b45c['shift']());}};_0x2a0bca(++_0x53d6a6);}(_0xbefe,0x168));var _0xebef=function(_0x3396cd,_0x4047f0){_0x3396cd=_0x3396cd-0x0;var _0x2d6b4a=_0xbefe[_0x3396cd];return _0x2d6b4a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xebef('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xebef('0x1'));var rp=require(_0xebef('0x2'));var moment=require(_0xebef('0x3'));var BPromise=require(_0xebef('0x4'));var Mustache=require(_0xebef('0x5'));var util=require(_0xebef('0x6'));var path=require(_0xebef('0x7'));var sox=require(_0xebef('0x8'));var csv=require('to-csv');var ejs=require(_0xebef('0x9'));var fs=require('fs');var fs_extra=require(_0xebef('0xa'));var _=require(_0xebef('0xb'));var squel=require('squel');var crypto=require(_0xebef('0xc'));var jsforce=require(_0xebef('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xebef('0xe'));var Papa=require(_0xebef('0xf'));var Redis=require(_0xebef('0x10'));var authService=require(_0xebef('0x11'));var qs=require(_0xebef('0x12'));var as=require(_0xebef('0x13'));var hardwareService=require(_0xebef('0x14'));var logger=require(_0xebef('0x15'))('api');var utils=require(_0xebef('0x16'));var config=require(_0xebef('0x17'));var licenseUtil=require(_0xebef('0x18'));var db=require(_0xebef('0x19'))['db'];var integrations=require(_0xebef('0x1a'));function respondWithStatusCode(_0x566dbe,_0x584ac2){_0x584ac2=_0x584ac2||0xcc;return function(_0x5dd833){if(_0x5dd833){return _0x566dbe['sendStatus'](_0x584ac2);}return _0x566dbe[_0xebef('0x1b')](_0x584ac2)[_0xebef('0x1c')]();};}function respondWithResult(_0x31772a,_0x35cd7a){_0x35cd7a=_0x35cd7a||0xc8;return function(_0x2f53e5){if(_0x2f53e5){return _0x31772a[_0xebef('0x1b')](_0x35cd7a)['json'](_0x2f53e5);}};}function respondWithFilteredResult(_0x32ec37,_0x9411d4){return function(_0x1921aa){if(_0x1921aa){var _0x46849f=typeof _0x9411d4[_0xebef('0x1d')]===_0xebef('0x1e')&&typeof _0x9411d4[_0xebef('0x1f')]===_0xebef('0x1e');var _0x2e5efa=_0x1921aa[_0xebef('0x20')];var _0x458e83=_0x46849f?0x0:_0x9411d4['offset'];var _0x1a99ba=_0x46849f?_0x1921aa[_0xebef('0x20')]:_0x9411d4[_0xebef('0x1d')]+_0x9411d4['limit'];var _0xc3518f;if(_0x1a99ba>=_0x2e5efa){_0x1a99ba=_0x2e5efa;_0xc3518f=0xc8;}else{_0xc3518f=0xce;}_0x32ec37[_0xebef('0x1b')](_0xc3518f);return _0x32ec37[_0xebef('0x21')](_0xebef('0x22'),_0x458e83+'-'+_0x1a99ba+'/'+_0x2e5efa)[_0xebef('0x23')](_0x1921aa);}return null;};}function patchUpdates(_0x138760){return function(_0x2f72e3){try{jsonpatch['apply'](_0x2f72e3,_0x138760,!![]);}catch(_0x4dcc76){return BPromise['reject'](_0x4dcc76);}return _0x2f72e3[_0xebef('0x24')]();};}function saveUpdates(_0x2f1193,_0x38f0b8){return function(_0x221a7e){if(_0x221a7e){return _0x221a7e[_0xebef('0x25')](_0x2f1193)[_0xebef('0x26')](function(_0xe8dcbf){return _0xe8dcbf;});}return null;};}function removeEntity(_0x5c5091,_0x460104){return function(_0x449767){if(_0x449767){return _0x449767[_0xebef('0x27')]()[_0xebef('0x26')](function(){_0x5c5091[_0xebef('0x1b')](0xcc)[_0xebef('0x1c')]();});}};}function handleEntityNotFound(_0x36ca6b,_0x42d2af){return function(_0x45bb67){if(!_0x45bb67){_0x36ca6b[_0xebef('0x28')](0x194);}return _0x45bb67;};}function handleError(_0x456a81,_0x4fb77f){_0x4fb77f=_0x4fb77f||0x1f4;return function(_0xc068de){logger['error'](_0xc068de['stack']);if(_0xc068de['name']){delete _0xc068de['name'];}_0x456a81['status'](_0x4fb77f)['send'](_0xc068de);};}exports['index']=function(_0x5703fc,_0x506e64){var _0x5a9249={},_0x54001c={},_0x136ac3={'count':0x0,'rows':[]};var _0x49a6fb=_[_0xebef('0x29')](db['FreshdeskAccount'][_0xebef('0x2a')],function(_0xa0a713){return{'name':_0xa0a713['fieldName'],'type':_0xa0a713[_0xebef('0x2b')]['key']};});_0x54001c[_0xebef('0x2c')]=_[_0xebef('0x29')](_0x49a6fb,_0xebef('0x2d'));_0x54001c[_0xebef('0x2e')]=_[_0xebef('0x2f')](_0x5703fc[_0xebef('0x2e')]);_0x54001c['filters']=_[_0xebef('0x30')](_0x54001c['model'],_0x54001c[_0xebef('0x2e')]);_0x5a9249[_0xebef('0x31')]=_[_0xebef('0x30')](_0x54001c[_0xebef('0x2c')],qs[_0xebef('0x32')](_0x5703fc[_0xebef('0x2e')][_0xebef('0x32')]));_0x5a9249['attributes']=_0x5a9249[_0xebef('0x31')][_0xebef('0x33')]?_0x5a9249[_0xebef('0x31')]:_0x54001c[_0xebef('0x2c')];if(!_0x5703fc[_0xebef('0x2e')][_0xebef('0x34')](_0xebef('0x35'))){_0x5a9249['limit']=qs[_0xebef('0x1f')](_0x5703fc[_0xebef('0x2e')]['limit']);_0x5a9249[_0xebef('0x1d')]=qs[_0xebef('0x1d')](_0x5703fc[_0xebef('0x2e')][_0xebef('0x1d')]);}_0x5a9249[_0xebef('0x36')]=qs['sort'](_0x5703fc[_0xebef('0x2e')][_0xebef('0x37')]);_0x5a9249['where']=qs['filters'](_[_0xebef('0x38')](_0x5703fc['query'],_0x54001c['filters']),_0x49a6fb);if(_0x5703fc['query'][_0xebef('0x39')]){_0x5a9249['where']=_['merge'](_0x5a9249[_0xebef('0x3a')],{'$or':_[_0xebef('0x29')](_0x49a6fb,function(_0x1348a4){if(_0x1348a4['type']!==_0xebef('0x3b')){var _0x4d61c1={};_0x4d61c1[_0x1348a4['name']]={'$like':'%'+_0x5703fc['query'][_0xebef('0x39')]+'%'};return _0x4d61c1;}})});}_0x5a9249=_['merge']({},_0x5a9249,_0x5703fc[_0xebef('0x3c')]);var _0x5078ec={'where':_0x5a9249['where']};return db[_0xebef('0x3d')][_0xebef('0x20')](_0x5078ec)[_0xebef('0x26')](function(_0x297ee0){_0x136ac3[_0xebef('0x20')]=_0x297ee0;if(_0x5703fc[_0xebef('0x2e')]['includeAll']){_0x5a9249[_0xebef('0x3e')]=[{'all':!![]}];}return db[_0xebef('0x3d')][_0xebef('0x3f')](_0x5a9249);})[_0xebef('0x26')](function(_0x32b93c){_0x136ac3[_0xebef('0x40')]=_0x32b93c;return _0x136ac3;})[_0xebef('0x26')](respondWithFilteredResult(_0x506e64,_0x5a9249))[_0xebef('0x41')](handleError(_0x506e64,null));};exports[_0xebef('0x42')]=function(_0xa69151,_0x56fe84){var _0x5cf908={'raw':![],'where':{'id':_0xa69151['params']['id']}},_0x4e3f60={};_0x4e3f60[_0xebef('0x2c')]=_[_0xebef('0x2f')](db[_0xebef('0x3d')][_0xebef('0x2a')]);_0x4e3f60[_0xebef('0x2e')]=_['keys'](_0xa69151['query']);_0x4e3f60[_0xebef('0x43')]=_['intersection'](_0x4e3f60['model'],_0x4e3f60[_0xebef('0x2e')]);_0x5cf908[_0xebef('0x31')]=_[_0xebef('0x30')](_0x4e3f60[_0xebef('0x2c')],qs[_0xebef('0x32')](_0xa69151[_0xebef('0x2e')][_0xebef('0x32')]));_0x5cf908[_0xebef('0x31')]=_0x5cf908[_0xebef('0x31')][_0xebef('0x33')]?_0x5cf908[_0xebef('0x31')]:_0x4e3f60[_0xebef('0x2c')];if(_0xa69151[_0xebef('0x2e')]['includeAll']){_0x5cf908[_0xebef('0x3e')]=[{'all':!![]}];}_0x5cf908=_[_0xebef('0x44')]({},_0x5cf908,_0xa69151[_0xebef('0x3c')]);return db[_0xebef('0x3d')][_0xebef('0x45')](_0x5cf908)[_0xebef('0x26')](handleEntityNotFound(_0x56fe84,null))['then'](respondWithResult(_0x56fe84,null))[_0xebef('0x41')](handleError(_0x56fe84,null));};exports[_0xebef('0x46')]=function(_0x1c7c81,_0x4ce35e){return db['FreshdeskAccount'][_0xebef('0x46')](_0x1c7c81['body'],{})[_0xebef('0x26')](respondWithResult(_0x4ce35e,0xc9))[_0xebef('0x41')](handleError(_0x4ce35e,null));};exports[_0xebef('0x25')]=function(_0x1d70e8,_0x297550){if(_0x1d70e8[_0xebef('0x47')]['id']){delete _0x1d70e8[_0xebef('0x47')]['id'];}return db['FreshdeskAccount'][_0xebef('0x45')]({'where':{'id':_0x1d70e8['params']['id']}})[_0xebef('0x26')](handleEntityNotFound(_0x297550,null))[_0xebef('0x26')](saveUpdates(_0x1d70e8[_0xebef('0x47')],null))[_0xebef('0x26')](respondWithResult(_0x297550,null))['catch'](handleError(_0x297550,null));};exports[_0xebef('0x27')]=function(_0x52f067,_0x5f1ce5){return db[_0xebef('0x3d')][_0xebef('0x45')]({'where':{'id':_0x52f067[_0xebef('0x48')]['id']}})[_0xebef('0x26')](handleEntityNotFound(_0x5f1ce5,null))[_0xebef('0x26')](removeEntity(_0x5f1ce5,null))[_0xebef('0x41')](handleError(_0x5f1ce5,null));};exports[_0xebef('0x49')]=function(_0x35a755,_0x25bd2,_0x1189ff){var _0x255b01={};var _0xb1d606={};var _0x4321d4;var _0x766610;return db[_0xebef('0x3d')][_0xebef('0x4a')]({'where':{'id':_0x35a755[_0xebef('0x48')]['id']}})[_0xebef('0x26')](handleEntityNotFound(_0x25bd2,null))[_0xebef('0x26')](function(_0x59db6d){if(_0x59db6d){_0x4321d4=_0x59db6d;_0xb1d606['model']=_['keys'](db[_0xebef('0x4b')]['rawAttributes']);_0xb1d606['query']=_[_0xebef('0x2f')](_0x35a755[_0xebef('0x2e')]);_0xb1d606[_0xebef('0x43')]=_['intersection'](_0xb1d606[_0xebef('0x2c')],_0xb1d606[_0xebef('0x2e')]);_0x255b01[_0xebef('0x31')]=_[_0xebef('0x30')](_0xb1d606[_0xebef('0x2c')],qs[_0xebef('0x32')](_0x35a755['query'][_0xebef('0x32')]));_0x255b01[_0xebef('0x31')]=_0x255b01['attributes']['length']?_0x255b01['attributes']:_0xb1d606[_0xebef('0x2c')];_0x255b01[_0xebef('0x36')]=qs[_0xebef('0x37')](_0x35a755[_0xebef('0x2e')][_0xebef('0x37')]);_0x255b01[_0xebef('0x3a')]=qs['filters'](_[_0xebef('0x38')](_0x35a755[_0xebef('0x2e')],_0xb1d606[_0xebef('0x43')]));if(_0x35a755['query'][_0xebef('0x39')]){_0x255b01['where']=_['merge'](_0x255b01[_0xebef('0x3a')],{'$or':_[_0xebef('0x29')](_0x255b01[_0xebef('0x31')],function(_0x380206){var _0x353fe2={};_0x353fe2[_0x380206]={'$like':'%'+_0x35a755[_0xebef('0x2e')][_0xebef('0x39')]+'%'};return _0x353fe2;})});}_0x255b01=_['merge']({},_0x255b01,_0x35a755[_0xebef('0x3c')]);return _0x4321d4[_0xebef('0x49')](_0x255b01);}})[_0xebef('0x26')](function(_0x2f390a){if(_0x2f390a){_0x766610=_0x2f390a['length'];if(!_0x35a755[_0xebef('0x2e')][_0xebef('0x34')](_0xebef('0x35'))){_0x255b01[_0xebef('0x1f')]=qs['limit'](_0x35a755[_0xebef('0x2e')]['limit']);_0x255b01[_0xebef('0x1d')]=qs['offset'](_0x35a755[_0xebef('0x2e')][_0xebef('0x1d')]);}return _0x4321d4[_0xebef('0x49')](_0x255b01);}})['then'](function(_0x46d421){if(_0x46d421){return _0x46d421?{'count':_0x766610,'rows':_0x46d421}:null;}})['then'](respondWithResult(_0x25bd2,null))[_0xebef('0x41')](handleError(_0x25bd2,null));};exports[_0xebef('0x4c')]=function(_0xb117cf,_0x40ee9d,_0x424fc1){if(_0xb117cf['body']['id']){delete _0xb117cf[_0xebef('0x47')]['id'];}return db[_0xebef('0x3d')][_0xebef('0x4a')]({'where':{'id':_0xb117cf['params']['id']}})['then'](handleEntityNotFound(_0x40ee9d,null))[_0xebef('0x26')](function(_0xb0a7d6){if(_0xb0a7d6){_0xb117cf[_0xebef('0x47')][_0xebef('0x4d')]=_0xb0a7d6['id'];_0xb117cf[_0xebef('0x47')][_0xebef('0x4e')]=integrations[_0xebef('0x4f')](_0xb117cf[_0xebef('0x47')]['channel'],_0xb117cf[_0xebef('0x47')][_0xebef('0x2b')]);_0xb117cf[_0xebef('0x47')][_0xebef('0x50')]=integrations[_0xebef('0x51')](_0xb117cf['body']['channel'],_0xb117cf[_0xebef('0x47')][_0xebef('0x2b')]);return db[_0xebef('0x4b')]['create'](_0xb117cf[_0xebef('0x47')],{'include':[{'model':db[_0xebef('0x52')],'as':_0xebef('0x4e')},{'model':db[_0xebef('0x52')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x40ee9d,null))[_0xebef('0x41')](handleError(_0x40ee9d,null));};exports[_0xebef('0x53')]=function(_0x214bea,_0x41958a,_0x109a21){var _0x2c91c5='';return db[_0xebef('0x3d')][_0xebef('0x4a')]({'where':{'id':_0x214bea[_0xebef('0x48')]['id']},'attributes':['id',_0xebef('0x54'),'apiKey']})[_0xebef('0x26')](handleEntityNotFound(_0x41958a,null))[_0xebef('0x26')](function(_0x1f7bc4){if(_0x1f7bc4){_0x2c91c5=_0x1f7bc4[_0xebef('0x54')];var _0x1c0eb6=_0x2c91c5[_0xebef('0x55')](-0x1);if(_0x1c0eb6==='/'){_0x2c91c5=_0x2c91c5['substring'](0x0,_0x2c91c5[_0xebef('0x56')](_0x1c0eb6));}return rp({'method':_0xebef('0x57'),'uri':util[_0xebef('0x58')]('%s/%s',_0x2c91c5,_0xebef('0x59')),'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0xebef('0x58')]('%s:X',_0x1f7bc4[_0xebef('0x5a')]))['toString'](_0xebef('0x5b')))},'json':!![]});}})[_0xebef('0x26')](function(_0x2e4ca8){if(_0x2e4ca8){var _0x225aa1=[_0xebef('0x5c'),_0xebef('0x5d'),_0xebef('0x5e'),_0xebef('0x5f'),_0xebef('0x1b'),_0xebef('0x60'),_0xebef('0x61'),'source',_0xebef('0x62'),_0xebef('0x61'),_0xebef('0x63')];_[_0xebef('0x64')](_0x2e4ca8,function(_0x575591){return _0x225aa1[_0xebef('0x65')](_0x575591['name'])||!_0x575591[_0xebef('0x66')]&&_0x575591[_0xebef('0x2b')]!==_0xebef('0x67')&&_0x575591[_0xebef('0x2b')]!==_0xebef('0x68');});return{'count':_0x2e4ca8[_0xebef('0x33')],'rows':_[_0xebef('0x29')](_0x2e4ca8,function(_0x25d845){return{'id':_0x25d845[_0xebef('0x2d')],'name':_0x25d845['label'],'custom':!_0x25d845[_0xebef('0x66')],'options':_0x25d845['choices']?_[_0xebef('0x29')](_0x25d845['choices'],function(_0x110e23){return{'name':_[_0xebef('0x69')](_0x110e23),'value':_0x110e23};}):[]};})};}})['then'](respondWithResult(_0x41958a,null))[_0xebef('0x41')](function(_0x54a0b3){var _0x1209fc=_0x214bea[_0xebef('0x2e')]['test']?0x1f4:_0x54a0b3[_0xebef('0x6a')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0xebef('0x53'),_0x1209fc,JSON[_0xebef('0x6b')](_0x54a0b3));delete _0x54a0b3[_0xebef('0x2d')];if(_0x1209fc===0x191){_0x1209fc=0x190;}_0x41958a[_0xebef('0x1b')](_0x1209fc)[_0xebef('0x6c')](_0x214bea[_0xebef('0x2e')][_0xebef('0x6d')]?{'message':_0xebef('0x6e'),'statusCode':_0x54a0b3[_0xebef('0x6a')]}:_0x54a0b3);});}; \ No newline at end of file +var _0xfb3f=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','destroy','then','error','stack','name','FreshdeskAccount','rawAttributes','fieldName','type','key','map','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','filter','where','merge','VIRTUAL','include','rows','catch','show','params','keys','options','create','body','update','find','getConfigurations','findOne','pick','nolimit','addConfiguration','AccountId','Subjects','channel','Descriptions','FreshdeskConfiguration','FreshdeskField','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','toString','base64','requester','subject','agent','description','priority','group','company','includes','custom_text','custom_dropdown','label','default','choices','capitalize','test','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','send','statusCode','eml-format','rimraf','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x21f3ff,_0x37f2ad){var _0x1187b3=function(_0x204436){while(--_0x204436){_0x21f3ff['push'](_0x21f3ff['shift']());}};_0x1187b3(++_0x37f2ad);}(_0xfb3f,0xd9));var _0xffb3=function(_0x299822,_0x43baaf){_0x299822=_0x299822-0x0;var _0x3ba0ab=_0xfb3f[_0x299822];return _0x3ba0ab;};'use strict';var emlformat=require(_0xffb3('0x0'));var rimraf=require(_0xffb3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xffb3('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xffb3('0x3'));var Mustache=require('mustache');var util=require(_0xffb3('0x4'));var path=require(_0xffb3('0x5'));var sox=require(_0xffb3('0x6'));var csv=require(_0xffb3('0x7'));var ejs=require(_0xffb3('0x8'));var fs=require('fs');var fs_extra=require(_0xffb3('0x9'));var _=require(_0xffb3('0xa'));var squel=require(_0xffb3('0xb'));var crypto=require('crypto');var jsforce=require(_0xffb3('0xc'));var deskjs=require(_0xffb3('0xd'));var toCsv=require(_0xffb3('0x7'));var querystring=require(_0xffb3('0xe'));var Papa=require(_0xffb3('0xf'));var Redis=require('ioredis');var authService=require(_0xffb3('0x10'));var qs=require(_0xffb3('0x11'));var as=require(_0xffb3('0x12'));var hardwareService=require(_0xffb3('0x13'));var logger=require(_0xffb3('0x14'))(_0xffb3('0x15'));var utils=require(_0xffb3('0x16'));var config=require(_0xffb3('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xffb3('0x18'))['db'];var integrations=require(_0xffb3('0x19'));function respondWithStatusCode(_0x55192c,_0x21924a){_0x21924a=_0x21924a||0xcc;return function(_0x356e10){if(_0x356e10){return _0x55192c[_0xffb3('0x1a')](_0x21924a);}return _0x55192c[_0xffb3('0x1b')](_0x21924a)[_0xffb3('0x1c')]();};}function respondWithResult(_0x420156,_0x19ce6e){_0x19ce6e=_0x19ce6e||0xc8;return function(_0x2338f1){if(_0x2338f1){return _0x420156[_0xffb3('0x1b')](_0x19ce6e)[_0xffb3('0x1d')](_0x2338f1);}};}function respondWithFilteredResult(_0x38daab,_0x2c3ef7){return function(_0x4d3c48){if(_0x4d3c48){var _0x46ae17=typeof _0x2c3ef7[_0xffb3('0x1e')]===_0xffb3('0x1f')&&typeof _0x2c3ef7['limit']==='undefined';var _0x1f3d9a=_0x4d3c48[_0xffb3('0x20')];var _0x57d096=_0x46ae17?0x0:_0x2c3ef7[_0xffb3('0x1e')];var _0x30f403=_0x46ae17?_0x4d3c48[_0xffb3('0x20')]:_0x2c3ef7['offset']+_0x2c3ef7[_0xffb3('0x21')];var _0x45fdd6;if(_0x30f403>=_0x1f3d9a){_0x30f403=_0x1f3d9a;_0x45fdd6=0xc8;}else{_0x45fdd6=0xce;}_0x38daab['status'](_0x45fdd6);return _0x38daab[_0xffb3('0x22')](_0xffb3('0x23'),_0x57d096+'-'+_0x30f403+'/'+_0x1f3d9a)[_0xffb3('0x1d')](_0x4d3c48);}return null;};}function patchUpdates(_0x21c9ad){return function(_0x1e75a0){try{jsonpatch[_0xffb3('0x24')](_0x1e75a0,_0x21c9ad,!![]);}catch(_0x40dc49){return BPromise['reject'](_0x40dc49);}return _0x1e75a0[_0xffb3('0x25')]();};}function saveUpdates(_0xe4c60e,_0x5e0f48){return function(_0x38330a){if(_0x38330a){return _0x38330a['update'](_0xe4c60e)['then'](function(_0x24c502){return _0x24c502;});}return null;};}function removeEntity(_0x3d55e6,_0x22bbea){return function(_0x3bc410){if(_0x3bc410){return _0x3bc410[_0xffb3('0x26')]()[_0xffb3('0x27')](function(){_0x3d55e6['status'](0xcc)[_0xffb3('0x1c')]();});}};}function handleEntityNotFound(_0x588608,_0x1390c6){return function(_0x2f01ff){if(!_0x2f01ff){_0x588608['sendStatus'](0x194);}return _0x2f01ff;};}function handleError(_0x32e047,_0x5e0474){_0x5e0474=_0x5e0474||0x1f4;return function(_0x1eee6b){logger[_0xffb3('0x28')](_0x1eee6b[_0xffb3('0x29')]);if(_0x1eee6b[_0xffb3('0x2a')]){delete _0x1eee6b['name'];}_0x32e047['status'](_0x5e0474)['send'](_0x1eee6b);};}exports['index']=function(_0xe3d338,_0x5d1630){var _0x17f601={},_0x3e64bb={},_0x17462d={'count':0x0,'rows':[]};var _0x28f65d=_['map'](db[_0xffb3('0x2b')][_0xffb3('0x2c')],function(_0x4d544d){return{'name':_0x4d544d[_0xffb3('0x2d')],'type':_0x4d544d[_0xffb3('0x2e')][_0xffb3('0x2f')]};});_0x3e64bb['model']=_[_0xffb3('0x30')](_0x28f65d,_0xffb3('0x2a'));_0x3e64bb[_0xffb3('0x31')]=_['keys'](_0xe3d338[_0xffb3('0x31')]);_0x3e64bb[_0xffb3('0x32')]=_['intersection'](_0x3e64bb[_0xffb3('0x33')],_0x3e64bb[_0xffb3('0x31')]);_0x17f601[_0xffb3('0x34')]=_[_0xffb3('0x35')](_0x3e64bb[_0xffb3('0x33')],qs['fields'](_0xe3d338[_0xffb3('0x31')][_0xffb3('0x36')]));_0x17f601[_0xffb3('0x34')]=_0x17f601['attributes'][_0xffb3('0x37')]?_0x17f601[_0xffb3('0x34')]:_0x3e64bb['model'];if(!_0xe3d338[_0xffb3('0x31')][_0xffb3('0x38')]('nolimit')){_0x17f601[_0xffb3('0x21')]=qs[_0xffb3('0x21')](_0xe3d338['query']['limit']);_0x17f601['offset']=qs[_0xffb3('0x1e')](_0xe3d338[_0xffb3('0x31')]['offset']);}_0x17f601[_0xffb3('0x39')]=qs['sort'](_0xe3d338[_0xffb3('0x31')][_0xffb3('0x3a')]);_0x17f601['where']=qs[_0xffb3('0x32')](_['pick'](_0xe3d338[_0xffb3('0x31')],_0x3e64bb[_0xffb3('0x32')]),_0x28f65d);if(_0xe3d338['query'][_0xffb3('0x3b')]){_0x17f601[_0xffb3('0x3c')]=_[_0xffb3('0x3d')](_0x17f601[_0xffb3('0x3c')],{'$or':_[_0xffb3('0x30')](_0x28f65d,function(_0x748cef){if(_0x748cef[_0xffb3('0x2e')]!==_0xffb3('0x3e')){var _0x183968={};_0x183968[_0x748cef[_0xffb3('0x2a')]]={'$like':'%'+_0xe3d338[_0xffb3('0x31')][_0xffb3('0x3b')]+'%'};return _0x183968;}})});}_0x17f601=_[_0xffb3('0x3d')]({},_0x17f601,_0xe3d338['options']);var _0x2f6a9a={'where':_0x17f601[_0xffb3('0x3c')]};return db[_0xffb3('0x2b')]['count'](_0x2f6a9a)[_0xffb3('0x27')](function(_0x5bd952){_0x17462d[_0xffb3('0x20')]=_0x5bd952;if(_0xe3d338[_0xffb3('0x31')]['includeAll']){_0x17f601[_0xffb3('0x3f')]=[{'all':!![]}];}return db[_0xffb3('0x2b')]['findAll'](_0x17f601);})['then'](function(_0x354088){_0x17462d[_0xffb3('0x40')]=_0x354088;return _0x17462d;})['then'](respondWithFilteredResult(_0x5d1630,_0x17f601))[_0xffb3('0x41')](handleError(_0x5d1630,null));};exports[_0xffb3('0x42')]=function(_0x3f2b13,_0x1bfa03){var _0x2e8564={'raw':![],'where':{'id':_0x3f2b13[_0xffb3('0x43')]['id']}},_0x4c2d24={};_0x4c2d24[_0xffb3('0x33')]=_[_0xffb3('0x44')](db[_0xffb3('0x2b')][_0xffb3('0x2c')]);_0x4c2d24['query']=_['keys'](_0x3f2b13[_0xffb3('0x31')]);_0x4c2d24[_0xffb3('0x32')]=_['intersection'](_0x4c2d24[_0xffb3('0x33')],_0x4c2d24[_0xffb3('0x31')]);_0x2e8564[_0xffb3('0x34')]=_[_0xffb3('0x35')](_0x4c2d24['model'],qs['fields'](_0x3f2b13[_0xffb3('0x31')][_0xffb3('0x36')]));_0x2e8564[_0xffb3('0x34')]=_0x2e8564[_0xffb3('0x34')][_0xffb3('0x37')]?_0x2e8564[_0xffb3('0x34')]:_0x4c2d24['model'];if(_0x3f2b13[_0xffb3('0x31')]['includeAll']){_0x2e8564[_0xffb3('0x3f')]=[{'all':!![]}];}_0x2e8564=_[_0xffb3('0x3d')]({},_0x2e8564,_0x3f2b13[_0xffb3('0x45')]);return db[_0xffb3('0x2b')]['find'](_0x2e8564)['then'](handleEntityNotFound(_0x1bfa03,null))[_0xffb3('0x27')](respondWithResult(_0x1bfa03,null))['catch'](handleError(_0x1bfa03,null));};exports[_0xffb3('0x46')]=function(_0x30a92a,_0x1d542e){return db['FreshdeskAccount'][_0xffb3('0x46')](_0x30a92a[_0xffb3('0x47')],{})[_0xffb3('0x27')](respondWithResult(_0x1d542e,0xc9))[_0xffb3('0x41')](handleError(_0x1d542e,null));};exports[_0xffb3('0x48')]=function(_0x4b0fd3,_0x2dd1d7){if(_0x4b0fd3[_0xffb3('0x47')]['id']){delete _0x4b0fd3[_0xffb3('0x47')]['id'];}return db['FreshdeskAccount'][_0xffb3('0x49')]({'where':{'id':_0x4b0fd3[_0xffb3('0x43')]['id']}})[_0xffb3('0x27')](handleEntityNotFound(_0x2dd1d7,null))['then'](saveUpdates(_0x4b0fd3[_0xffb3('0x47')],null))[_0xffb3('0x27')](respondWithResult(_0x2dd1d7,null))[_0xffb3('0x41')](handleError(_0x2dd1d7,null));};exports[_0xffb3('0x26')]=function(_0x51a66e,_0x525ecf){return db['FreshdeskAccount']['find']({'where':{'id':_0x51a66e[_0xffb3('0x43')]['id']}})['then'](handleEntityNotFound(_0x525ecf,null))['then'](removeEntity(_0x525ecf,null))[_0xffb3('0x41')](handleError(_0x525ecf,null));};exports[_0xffb3('0x4a')]=function(_0x2edbce,_0xf72b36,_0x9030ae){var _0x6b0b72={};var _0x23e2b1={};var _0x5b50fe;var _0x29ba96;return db[_0xffb3('0x2b')][_0xffb3('0x4b')]({'where':{'id':_0x2edbce[_0xffb3('0x43')]['id']}})[_0xffb3('0x27')](handleEntityNotFound(_0xf72b36,null))[_0xffb3('0x27')](function(_0x4cf832){if(_0x4cf832){_0x5b50fe=_0x4cf832;_0x23e2b1[_0xffb3('0x33')]=_[_0xffb3('0x44')](db['FreshdeskConfiguration']['rawAttributes']);_0x23e2b1[_0xffb3('0x31')]=_['keys'](_0x2edbce[_0xffb3('0x31')]);_0x23e2b1[_0xffb3('0x32')]=_[_0xffb3('0x35')](_0x23e2b1['model'],_0x23e2b1['query']);_0x6b0b72['attributes']=_[_0xffb3('0x35')](_0x23e2b1['model'],qs['fields'](_0x2edbce['query'][_0xffb3('0x36')]));_0x6b0b72[_0xffb3('0x34')]=_0x6b0b72[_0xffb3('0x34')]['length']?_0x6b0b72[_0xffb3('0x34')]:_0x23e2b1['model'];_0x6b0b72[_0xffb3('0x39')]=qs[_0xffb3('0x3a')](_0x2edbce['query'][_0xffb3('0x3a')]);_0x6b0b72[_0xffb3('0x3c')]=qs[_0xffb3('0x32')](_[_0xffb3('0x4c')](_0x2edbce['query'],_0x23e2b1[_0xffb3('0x32')]));if(_0x2edbce[_0xffb3('0x31')][_0xffb3('0x3b')]){_0x6b0b72['where']=_['merge'](_0x6b0b72['where'],{'$or':_[_0xffb3('0x30')](_0x6b0b72[_0xffb3('0x34')],function(_0x4ee0e0){var _0x220bc4={};_0x220bc4[_0x4ee0e0]={'$like':'%'+_0x2edbce[_0xffb3('0x31')]['filter']+'%'};return _0x220bc4;})});}_0x6b0b72=_[_0xffb3('0x3d')]({},_0x6b0b72,_0x2edbce[_0xffb3('0x45')]);return _0x5b50fe[_0xffb3('0x4a')](_0x6b0b72);}})[_0xffb3('0x27')](function(_0x3bf20a){if(_0x3bf20a){_0x29ba96=_0x3bf20a['length'];if(!_0x2edbce[_0xffb3('0x31')][_0xffb3('0x38')](_0xffb3('0x4d'))){_0x6b0b72['limit']=qs[_0xffb3('0x21')](_0x2edbce[_0xffb3('0x31')]['limit']);_0x6b0b72[_0xffb3('0x1e')]=qs[_0xffb3('0x1e')](_0x2edbce['query']['offset']);}return _0x5b50fe[_0xffb3('0x4a')](_0x6b0b72);}})['then'](function(_0x2307a0){if(_0x2307a0){return _0x2307a0?{'count':_0x29ba96,'rows':_0x2307a0}:null;}})[_0xffb3('0x27')](respondWithResult(_0xf72b36,null))[_0xffb3('0x41')](handleError(_0xf72b36,null));};exports[_0xffb3('0x4e')]=function(_0x4595ac,_0x469a62,_0x28addf){if(_0x4595ac[_0xffb3('0x47')]['id']){delete _0x4595ac['body']['id'];}return db[_0xffb3('0x2b')][_0xffb3('0x4b')]({'where':{'id':_0x4595ac['params']['id']}})['then'](handleEntityNotFound(_0x469a62,null))[_0xffb3('0x27')](function(_0x44be9d){if(_0x44be9d){_0x4595ac[_0xffb3('0x47')][_0xffb3('0x4f')]=_0x44be9d['id'];_0x4595ac['body'][_0xffb3('0x50')]=integrations['getSubjects'](_0x4595ac['body'][_0xffb3('0x51')],_0x4595ac['body'][_0xffb3('0x2e')]);_0x4595ac[_0xffb3('0x47')][_0xffb3('0x52')]=integrations['getDescriptions'](_0x4595ac[_0xffb3('0x47')]['channel'],_0x4595ac[_0xffb3('0x47')][_0xffb3('0x2e')]);return db[_0xffb3('0x53')][_0xffb3('0x46')](_0x4595ac[_0xffb3('0x47')],{'include':[{'model':db[_0xffb3('0x54')],'as':_0xffb3('0x50')},{'model':db[_0xffb3('0x54')],'as':_0xffb3('0x52')}]});}return null;})[_0xffb3('0x27')](respondWithResult(_0x469a62,null))[_0xffb3('0x41')](handleError(_0x469a62,null));};exports['getFields']=function(_0x158491,_0x17a45c,_0xccd731){var _0x5435c9='';return db[_0xffb3('0x2b')][_0xffb3('0x4b')]({'where':{'id':_0x158491[_0xffb3('0x43')]['id']},'attributes':['id',_0xffb3('0x55'),_0xffb3('0x56')]})[_0xffb3('0x27')](handleEntityNotFound(_0x17a45c,null))['then'](function(_0x518077){if(_0x518077){_0x5435c9=_0x518077[_0xffb3('0x55')];var _0x194ce1=_0x5435c9[_0xffb3('0x57')](-0x1);if(_0x194ce1==='/'){_0x5435c9=_0x5435c9[_0xffb3('0x58')](0x0,_0x5435c9[_0xffb3('0x59')](_0x194ce1));}return rp({'method':_0xffb3('0x5a'),'uri':util[_0xffb3('0x5b')](_0xffb3('0x5c'),_0x5435c9,_0xffb3('0x5d')),'headers':{'Authorization':util[_0xffb3('0x5b')](_0xffb3('0x5e'),new Buffer(util[_0xffb3('0x5b')](_0xffb3('0x5f'),_0x518077[_0xffb3('0x56')]))[_0xffb3('0x60')](_0xffb3('0x61')))},'json':!![]});}})[_0xffb3('0x27')](function(_0x3d28de){if(_0x3d28de){var _0x12ff08=[_0xffb3('0x62'),_0xffb3('0x63'),_0xffb3('0x64'),_0xffb3('0x65'),_0xffb3('0x1b'),_0xffb3('0x66'),_0xffb3('0x67'),'source','ticket_type',_0xffb3('0x67'),_0xffb3('0x68')];_['remove'](_0x3d28de,function(_0x55b68e){return _0x12ff08[_0xffb3('0x69')](_0x55b68e[_0xffb3('0x2a')])||!_0x55b68e['default']&&_0x55b68e[_0xffb3('0x2e')]!==_0xffb3('0x6a')&&_0x55b68e['type']!==_0xffb3('0x6b');});return{'count':_0x3d28de[_0xffb3('0x37')],'rows':_[_0xffb3('0x30')](_0x3d28de,function(_0x29b846){return{'id':_0x29b846[_0xffb3('0x2a')],'name':_0x29b846[_0xffb3('0x6c')],'custom':!_0x29b846[_0xffb3('0x6d')],'options':_0x29b846['choices']?_['map'](_0x29b846[_0xffb3('0x6e')],function(_0x14b3b1){return{'name':_[_0xffb3('0x6f')](_0x14b3b1),'value':_0x14b3b1};}):[]};})};}})[_0xffb3('0x27')](respondWithResult(_0x17a45c,null))['catch'](function(_0x36e58e){var _0x4676e0=_0x158491[_0xffb3('0x31')][_0xffb3('0x70')]?0x1f4:_0x36e58e['statusCode']||0x1f4;logger[_0xffb3('0x28')](_0xffb3('0x71'),_0xffb3('0x72'),_0x4676e0,JSON[_0xffb3('0x73')](_0x36e58e));delete _0x36e58e['name'];if(_0x4676e0===0x191){_0x4676e0=0x190;}_0x17a45c[_0xffb3('0x1b')](_0x4676e0)[_0xffb3('0x74')](_0x158491[_0xffb3('0x31')][_0xffb3('0x70')]?{'message':'Wrong\x20credentials','statusCode':_0x36e58e[_0xffb3('0x75')]}:_0x36e58e);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index d8df979..0e35c4d 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 _0xfaab=['FreshdeskAccount','int_freshdesk_accounts','lodash','util','moment','bluebird','path','rimraf','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define'];(function(_0x59b15d,_0x104fcf){var _0x3a49fc=function(_0x1a1073){while(--_0x1a1073){_0x59b15d['push'](_0x59b15d['shift']());}};_0x3a49fc(++_0x104fcf);}(_0xfaab,0x1b2));var _0xbfaa=function(_0x22ff19,_0x659de5){_0x22ff19=_0x22ff19-0x0;var _0x271ead=_0xfaab[_0x22ff19];return _0x271ead;};'use strict';var _=require(_0xbfaa('0x0'));var util=require(_0xbfaa('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbfaa('0x2'));var BPromise=require(_0xbfaa('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbfaa('0x4'));var rimraf=require(_0xbfaa('0x5'));var config=require('../../config/environment');var attributes=require(_0xbfaa('0x6'));var integrations=require(_0xbfaa('0x7'));module[_0xbfaa('0x8')]=function(_0x2e7d5c,_0x4fb743){return _0x2e7d5c[_0xbfaa('0x9')](_0xbfaa('0xa'),attributes,{'tableName':_0xbfaa('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4b4d=['FreshdeskAccount','int_freshdesk_accounts','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define'];(function(_0x3f993e,_0x2d5757){var _0x39c135=function(_0x39e00b){while(--_0x39e00b){_0x3f993e['push'](_0x3f993e['shift']());}};_0x39c135(++_0x2d5757);}(_0x4b4d,0xab));var _0xd4b4=function(_0x1266c9,_0x23a2db){_0x1266c9=_0x1266c9-0x0;var _0x5ebcde=_0x4b4d[_0x1266c9];return _0x5ebcde;};'use strict';var _=require(_0xd4b4('0x0'));var util=require('util');var logger=require(_0xd4b4('0x1'))(_0xd4b4('0x2'));var moment=require(_0xd4b4('0x3'));var BPromise=require('bluebird');var rp=require(_0xd4b4('0x4'));var fs=require('fs');var path=require(_0xd4b4('0x5'));var rimraf=require(_0xd4b4('0x6'));var config=require(_0xd4b4('0x7'));var attributes=require('./intFreshdeskAccount.attributes');var integrations=require(_0xd4b4('0x8'));module[_0xd4b4('0x9')]=function(_0x133f35,_0x40cdec){return _0x133f35[_0xd4b4('0xa')](_0xd4b4('0xb'),attributes,{'tableName':_0xd4b4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js index 3883224..cfe9d31 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 _0x4318=['jayson/promise','client','http','request','then','info','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','FreshdeskAccount','options','where','attributes','limit','map','include','model','GetFreshdeskAccount','catch','find','raw','ShowFreshdeskAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x464ac9,_0xe7533a){var _0x1bec0a=function(_0x22419b){while(--_0x22419b){_0x464ac9['push'](_0x464ac9['shift']());}};_0x1bec0a(++_0xe7533a);}(_0x4318,0x1a7));var _0x8431=function(_0x191823,_0xb81250){_0x191823=_0x191823-0x0;var _0x73a245=_0x4318[_0x191823];return _0x73a245;};'use strict';var _=require(_0x8431('0x0'));var util=require(_0x8431('0x1'));var moment=require(_0x8431('0x2'));var BPromise=require(_0x8431('0x3'));var rs=require(_0x8431('0x4'));var fs=require('fs');var Redis=require(_0x8431('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8431('0x6'));var logger=require(_0x8431('0x7'))(_0x8431('0x8'));var config=require('../../config/environment');var jayson=require(_0x8431('0x9'));var client=jayson[_0x8431('0xa')][_0x8431('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1d53b1,_0x450ac0,_0x186aa4){return new BPromise(function(_0x3a0d2e,_0x5aeb32){return client[_0x8431('0xc')](_0x1d53b1,_0x186aa4)[_0x8431('0xd')](function(_0x14d241){logger[_0x8431('0xe')]('FreshdeskAccount,\x20%s,\x20%s',_0x450ac0,_0x8431('0xf'));logger[_0x8431('0x10')](_0x8431('0x11'),_0x450ac0,_0x8431('0xf'),JSON[_0x8431('0x12')](_0x14d241));if(_0x14d241[_0x8431('0x13')]){if(_0x14d241[_0x8431('0x13')][_0x8431('0x14')]===0x1f4){logger[_0x8431('0x13')]('FreshdeskAccount,\x20%s,\x20%s',_0x450ac0,_0x14d241[_0x8431('0x13')][_0x8431('0x15')]);return _0x5aeb32(_0x14d241[_0x8431('0x13')][_0x8431('0x15')]);}logger[_0x8431('0x13')]('FreshdeskAccount,\x20%s,\x20%s',_0x450ac0,_0x14d241[_0x8431('0x13')][_0x8431('0x15')]);return _0x3a0d2e(_0x14d241[_0x8431('0x13')]['message']);}else{logger[_0x8431('0xe')]('FreshdeskAccount,\x20%s,\x20%s',_0x450ac0,_0x8431('0xf'));_0x3a0d2e(_0x14d241[_0x8431('0x16')][_0x8431('0x15')]);}})['catch'](function(_0x1fa3c4){logger[_0x8431('0x13')]('FreshdeskAccount,\x20%s,\x20%s',_0x450ac0,_0x1fa3c4);_0x5aeb32(_0x1fa3c4);});});}exports['GetFreshdeskAccount']=function(_0x32eda1){var _0x41cbf5=this;return new Promise(function(_0x59d23e,_0x35a21d){return db[_0x8431('0x17')]['findAll']({'raw':_0x32eda1['options']?_0x32eda1[_0x8431('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x32eda1[_0x8431('0x18')]?_0x32eda1[_0x8431('0x18')][_0x8431('0x19')]||null:null,'attributes':_0x32eda1['options']?_0x32eda1[_0x8431('0x18')][_0x8431('0x1a')]||null:null,'limit':_0x32eda1[_0x8431('0x18')]?_0x32eda1[_0x8431('0x18')][_0x8431('0x1b')]||null:null,'include':_0x32eda1[_0x8431('0x18')]?_0x32eda1[_0x8431('0x18')]['include']?_[_0x8431('0x1c')](_0x32eda1['options']['include'],function(_0x3add85){return{'model':db[_0x3add85['model']],'as':_0x3add85['as'],'attributes':_0x3add85[_0x8431('0x1a')],'include':_0x3add85[_0x8431('0x1d')]?_['map'](_0x3add85[_0x8431('0x1d')],function(_0x5e5d41){return{'model':db[_0x5e5d41[_0x8431('0x1e')]],'as':_0x5e5d41['as'],'attributes':_0x5e5d41[_0x8431('0x1a')],'include':_0x5e5d41[_0x8431('0x1d')]?_[_0x8431('0x1c')](_0x5e5d41[_0x8431('0x1d')],function(_0x4b6a33){return{'model':db[_0x4b6a33['model']],'as':_0x4b6a33['as'],'attributes':_0x4b6a33[_0x8431('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x8431('0xd')](function(_0x4c6c15){logger['info'](_0x8431('0x1f'),_0x32eda1);logger['debug']('GetFreshdeskAccount',_0x32eda1,JSON[_0x8431('0x12')](_0x4c6c15));_0x59d23e(_0x4c6c15);})[_0x8431('0x20')](function(_0x381d71){logger[_0x8431('0x13')](_0x8431('0x1f'),_0x381d71['message'],_0x32eda1);_0x35a21d(_0x41cbf5[_0x8431('0x13')](0x1f4,_0x381d71[_0x8431('0x15')]));});});};exports['ShowFreshdeskAccount']=function(_0x5acff9){var _0x30b2af=this;return new Promise(function(_0x492a95,_0x32fb1c){return db[_0x8431('0x17')][_0x8431('0x21')]({'raw':_0x5acff9['options']?_0x5acff9['options'][_0x8431('0x22')]===undefined?!![]:![]:!![],'where':_0x5acff9[_0x8431('0x18')]?_0x5acff9[_0x8431('0x18')][_0x8431('0x19')]||null:null,'attributes':_0x5acff9[_0x8431('0x18')]?_0x5acff9[_0x8431('0x18')]['attributes']||null:null,'include':_0x5acff9['options']?_0x5acff9[_0x8431('0x18')][_0x8431('0x1d')]?_['map'](_0x5acff9[_0x8431('0x18')][_0x8431('0x1d')],function(_0x454eef){return{'model':db[_0x454eef[_0x8431('0x1e')]],'as':_0x454eef['as'],'attributes':_0x454eef[_0x8431('0x1a')],'include':_0x454eef[_0x8431('0x1d')]?_[_0x8431('0x1c')](_0x454eef[_0x8431('0x1d')],function(_0x54f05e){return{'model':db[_0x54f05e[_0x8431('0x1e')]],'as':_0x54f05e['as'],'attributes':_0x54f05e[_0x8431('0x1a')],'include':_0x54f05e[_0x8431('0x1d')]?_[_0x8431('0x1c')](_0x54f05e[_0x8431('0x1d')],function(_0x4c8749){return{'model':db[_0x4c8749['model']],'as':_0x4c8749['as'],'attributes':_0x4c8749[_0x8431('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x8431('0xd')](function(_0x3f486a){logger[_0x8431('0xe')](_0x8431('0x23'),_0x5acff9);logger[_0x8431('0x10')]('ShowFreshdeskAccount',_0x5acff9,JSON[_0x8431('0x12')](_0x3f486a));_0x492a95(_0x3f486a);})[_0x8431('0x20')](function(_0x544b43){logger['error'](_0x8431('0x23'),_0x544b43[_0x8431('0x15')],_0x5acff9);_0x32fb1c(_0x30b2af[_0x8431('0x13')](0x1f4,_0x544b43[_0x8431('0x15')]));});});}; \ No newline at end of file +var _0x481b=['../../config/utils','rpc','../../config/environment','jayson/promise','client','then','info','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskAccount,\x20%s,\x20%s','message','result','GetFreshdeskAccount','findAll','options','raw','attributes','map','include','model','catch','ShowFreshdeskAccount','FreshdeskAccount','find','where','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x4c4609,_0x3c515a){var _0x48ea99=function(_0x5d6df2){while(--_0x5d6df2){_0x4c4609['push'](_0x4c4609['shift']());}};_0x48ea99(++_0x3c515a);}(_0x481b,0x86));var _0xb481=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x481b[_0x5f1391];return _0x50ebe3;};'use strict';var _=require(_0xb481('0x0'));var util=require(_0xb481('0x1'));var moment=require('moment');var BPromise=require(_0xb481('0x2'));var rs=require(_0xb481('0x3'));var fs=require('fs');var Redis=require(_0xb481('0x4'));var db=require(_0xb481('0x5'))['db'];var utils=require(_0xb481('0x6'));var logger=require('../../config/logger')(_0xb481('0x7'));var config=require(_0xb481('0x8'));var jayson=require(_0xb481('0x9'));var client=jayson[_0xb481('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b635c,_0x3ddb14,_0x5db4fc){return new BPromise(function(_0x4453d8,_0xe7e125){return client['request'](_0x1b635c,_0x5db4fc)[_0xb481('0xb')](function(_0xbf2859){logger[_0xb481('0xc')]('FreshdeskAccount,\x20%s,\x20%s',_0x3ddb14,_0xb481('0xd'));logger[_0xb481('0xe')](_0xb481('0xf'),_0x3ddb14,_0xb481('0xd'),JSON[_0xb481('0x10')](_0xbf2859));if(_0xbf2859[_0xb481('0x11')]){if(_0xbf2859[_0xb481('0x11')][_0xb481('0x12')]===0x1f4){logger[_0xb481('0x11')](_0xb481('0x13'),_0x3ddb14,_0xbf2859[_0xb481('0x11')][_0xb481('0x14')]);return _0xe7e125(_0xbf2859[_0xb481('0x11')][_0xb481('0x14')]);}logger['error']('FreshdeskAccount,\x20%s,\x20%s',_0x3ddb14,_0xbf2859[_0xb481('0x11')][_0xb481('0x14')]);return _0x4453d8(_0xbf2859[_0xb481('0x11')][_0xb481('0x14')]);}else{logger[_0xb481('0xc')]('FreshdeskAccount,\x20%s,\x20%s',_0x3ddb14,_0xb481('0xd'));_0x4453d8(_0xbf2859[_0xb481('0x15')][_0xb481('0x14')]);}})['catch'](function(_0x292383){logger[_0xb481('0x11')]('FreshdeskAccount,\x20%s,\x20%s',_0x3ddb14,_0x292383);_0xe7e125(_0x292383);});});}exports[_0xb481('0x16')]=function(_0x29f9ba){var _0x4b1c39=this;return new Promise(function(_0xbae32a,_0x36f3d7){return db['FreshdeskAccount'][_0xb481('0x17')]({'raw':_0x29f9ba[_0xb481('0x18')]?_0x29f9ba[_0xb481('0x18')][_0xb481('0x19')]===undefined?!![]:![]:!![],'where':_0x29f9ba[_0xb481('0x18')]?_0x29f9ba[_0xb481('0x18')]['where']||null:null,'attributes':_0x29f9ba['options']?_0x29f9ba[_0xb481('0x18')][_0xb481('0x1a')]||null:null,'limit':_0x29f9ba[_0xb481('0x18')]?_0x29f9ba['options']['limit']||null:null,'include':_0x29f9ba[_0xb481('0x18')]?_0x29f9ba[_0xb481('0x18')]['include']?_[_0xb481('0x1b')](_0x29f9ba[_0xb481('0x18')][_0xb481('0x1c')],function(_0x337a6e){return{'model':db[_0x337a6e[_0xb481('0x1d')]],'as':_0x337a6e['as'],'attributes':_0x337a6e[_0xb481('0x1a')],'include':_0x337a6e[_0xb481('0x1c')]?_[_0xb481('0x1b')](_0x337a6e['include'],function(_0x534211){return{'model':db[_0x534211[_0xb481('0x1d')]],'as':_0x534211['as'],'attributes':_0x534211[_0xb481('0x1a')],'include':_0x534211[_0xb481('0x1c')]?_[_0xb481('0x1b')](_0x534211[_0xb481('0x1c')],function(_0x52ae45){return{'model':db[_0x52ae45[_0xb481('0x1d')]],'as':_0x52ae45['as'],'attributes':_0x52ae45['attributes']};}):[]};}):[]};}):[]:[]})[_0xb481('0xb')](function(_0x580821){logger['info'](_0xb481('0x16'),_0x29f9ba);logger[_0xb481('0xe')](_0xb481('0x16'),_0x29f9ba,JSON[_0xb481('0x10')](_0x580821));_0xbae32a(_0x580821);})[_0xb481('0x1e')](function(_0x55327){logger[_0xb481('0x11')](_0xb481('0x16'),_0x55327[_0xb481('0x14')],_0x29f9ba);_0x36f3d7(_0x4b1c39[_0xb481('0x11')](0x1f4,_0x55327[_0xb481('0x14')]));});});};exports[_0xb481('0x1f')]=function(_0x4b23d0){var _0x12db19=this;return new Promise(function(_0x1a2c05,_0x1f3801){return db[_0xb481('0x20')][_0xb481('0x21')]({'raw':_0x4b23d0['options']?_0x4b23d0['options']['raw']===undefined?!![]:![]:!![],'where':_0x4b23d0['options']?_0x4b23d0['options'][_0xb481('0x22')]||null:null,'attributes':_0x4b23d0[_0xb481('0x18')]?_0x4b23d0[_0xb481('0x18')]['attributes']||null:null,'include':_0x4b23d0[_0xb481('0x18')]?_0x4b23d0['options'][_0xb481('0x1c')]?_['map'](_0x4b23d0[_0xb481('0x18')]['include'],function(_0x4590d9){return{'model':db[_0x4590d9[_0xb481('0x1d')]],'as':_0x4590d9['as'],'attributes':_0x4590d9[_0xb481('0x1a')],'include':_0x4590d9[_0xb481('0x1c')]?_['map'](_0x4590d9['include'],function(_0x28ac74){return{'model':db[_0x28ac74[_0xb481('0x1d')]],'as':_0x28ac74['as'],'attributes':_0x28ac74[_0xb481('0x1a')],'include':_0x28ac74['include']?_[_0xb481('0x1b')](_0x28ac74['include'],function(_0x2a8536){return{'model':db[_0x2a8536[_0xb481('0x1d')]],'as':_0x2a8536['as'],'attributes':_0x2a8536[_0xb481('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xb481('0xb')](function(_0x5657c9){logger['info'](_0xb481('0x1f'),_0x4b23d0);logger[_0xb481('0xe')]('ShowFreshdeskAccount',_0x4b23d0,JSON[_0xb481('0x10')](_0x5657c9));_0x1a2c05(_0x5657c9);})[_0xb481('0x1e')](function(_0x214c4d){logger[_0xb481('0x11')](_0xb481('0x1f'),_0x214c4d[_0xb481('0x14')],_0x4b23d0);_0x1f3801(_0x12db19[_0xb481('0x11')](0x1f4,_0x214c4d['message']));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index d7ab35f..dfbcbdd 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 _0xafca=['/:id/tags','getTags','post','setTags','update','delete','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./intFreshdeskConfiguration.controller','isAuthenticated','index','get','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects'];(function(_0x459180,_0xca2366){var _0x463dbe=function(_0x3597e8){while(--_0x3597e8){_0x459180['push'](_0x459180['shift']());}};_0x463dbe(++_0xca2366);}(_0xafca,0x16f));var _0xaafc=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xafca[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xaafc('0x0'));var util=require('util');var path=require(_0xaafc('0x1'));var timeout=require(_0xaafc('0x2'));var express=require(_0xaafc('0x3'));var router=express['Router']();var fs_extra=require(_0xaafc('0x4'));var auth=require(_0xaafc('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xaafc('0x6'));var controller=require(_0xaafc('0x7'));router['get']('/',auth[_0xaafc('0x8')](),controller[_0xaafc('0x9')]);router[_0xaafc('0xa')](_0xaafc('0xb'),auth[_0xaafc('0x8')](),controller[_0xaafc('0xc')]);router['get'](_0xaafc('0xd'),auth[_0xaafc('0x8')](),controller[_0xaafc('0xe')]);router[_0xaafc('0xa')](_0xaafc('0xf'),auth[_0xaafc('0x8')](),controller[_0xaafc('0x10')]);router[_0xaafc('0xa')]('/:id/descriptions',auth['isAuthenticated'](),controller['getDescriptions']);router[_0xaafc('0xa')](_0xaafc('0x11'),auth[_0xaafc('0x8')](),controller[_0xaafc('0x12')]);router[_0xaafc('0x13')]('/',auth[_0xaafc('0x8')](),controller['create']);router[_0xaafc('0x13')]('/:id/tags',auth[_0xaafc('0x8')](),controller[_0xaafc('0x14')]);router['put'](_0xaafc('0xb'),auth['isAuthenticated'](),controller[_0xaafc('0x15')]);router[_0xaafc('0x16')]('/:id',auth[_0xaafc('0x8')](),controller['destroy']);module[_0xaafc('0x17')]=router; \ No newline at end of file +var _0xb174=['delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshdeskConfiguration.controller','get','/:id','/:id/fields','isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','create','setTags','put','update'];(function(_0x354aa7,_0x4c6615){var _0x4c12e8=function(_0x59bd74){while(--_0x59bd74){_0x354aa7['push'](_0x354aa7['shift']());}};_0x4c12e8(++_0x4c6615);}(_0xb174,0x106));var _0x4b17=function(_0x28ea80,_0x5ee173){_0x28ea80=_0x28ea80-0x0;var _0x676866=_0xb174[_0x28ea80];return _0x676866;};'use strict';var multer=require(_0x4b17('0x0'));var util=require('util');var path=require(_0x4b17('0x1'));var timeout=require(_0x4b17('0x2'));var express=require(_0x4b17('0x3'));var router=express[_0x4b17('0x4')]();var fs_extra=require(_0x4b17('0x5'));var auth=require(_0x4b17('0x6'));var interaction=require(_0x4b17('0x7'));var config=require('../../config/environment');var controller=require(_0x4b17('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x4b17('0x9')](_0x4b17('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x4b17('0x9')](_0x4b17('0xb'),auth[_0x4b17('0xc')](),controller[_0x4b17('0xd')]);router[_0x4b17('0x9')](_0x4b17('0xe'),auth['isAuthenticated'](),controller[_0x4b17('0xf')]);router[_0x4b17('0x9')](_0x4b17('0x10'),auth[_0x4b17('0xc')](),controller[_0x4b17('0x11')]);router[_0x4b17('0x9')](_0x4b17('0x12'),auth['isAuthenticated'](),controller[_0x4b17('0x13')]);router['post']('/',auth[_0x4b17('0xc')](),controller[_0x4b17('0x14')]);router['post'](_0x4b17('0x12'),auth[_0x4b17('0xc')](),controller[_0x4b17('0x15')]);router[_0x4b17('0x16')](_0x4b17('0xa'),auth[_0x4b17('0xc')](),controller[_0x4b17('0x17')]);router[_0x4b17('0x18')](_0x4b17('0xa'),auth[_0x4b17('0xc')](),controller['destroy']);module[_0x4b17('0x19')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index d63ab2c..102490d 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 _0x3b6b=['STRING','sequelize'];(function(_0x468ae4,_0x58d17d){var _0x53bb10=function(_0x70308d){while(--_0x70308d){_0x468ae4['push'](_0x468ae4['shift']());}};_0x53bb10(++_0x58d17d);}(_0x3b6b,0x1b1));var _0xb3b6=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3b6b[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xb3b6('0x0'));module['exports']={'name':{'type':Sequelize[_0xb3b6('0x1')]},'description':{'type':Sequelize[_0xb3b6('0x1')]}}; \ No newline at end of file +var _0x6226=['exports','STRING','sequelize'];(function(_0xc0a3d3,_0x2c8d00){var _0x3386e8=function(_0x3f9df4){while(--_0x3f9df4){_0xc0a3d3['push'](_0xc0a3d3['shift']());}};_0x3386e8(++_0x2c8d00);}(_0x6226,0xc2));var _0x6622=function(_0x5207a2,_0x316913){_0x5207a2=_0x5207a2-0x0;var _0x314716=_0x6226[_0x5207a2];return _0x314716;};'use strict';var Sequelize=require(_0x6622('0x0'));module[_0x6622('0x1')]={'name':{'type':Sequelize[_0x6622('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 70aeed3..a3106fb 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 _0xd2b8=['fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','FreshdeskConfiguration','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','merge','find','body','update','getFields','findOne','getSubjects','FreshdeskField','getDescriptions','getTags','setTags','ids','eml-format','rimraf'];(function(_0x1c6570,_0x1ec401){var _0x331bbe=function(_0x18cd85){while(--_0x18cd85){_0x1c6570['push'](_0x1c6570['shift']());}};_0x331bbe(++_0x1ec401);}(_0xd2b8,0xf7));var _0x8d2b=function(_0x4f7468,_0x2225e7){_0x4f7468=_0x4f7468-0x0;var _0x44e6b3=_0xd2b8[_0x4f7468];return _0x44e6b3;};'use strict';var emlformat=require(_0x8d2b('0x0'));var rimraf=require(_0x8d2b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8d2b('0x2'));var rp=require(_0x8d2b('0x3'));var moment=require(_0x8d2b('0x4'));var BPromise=require(_0x8d2b('0x5'));var Mustache=require(_0x8d2b('0x6'));var util=require('util');var path=require(_0x8d2b('0x7'));var sox=require('sox');var csv=require(_0x8d2b('0x8'));var ejs=require(_0x8d2b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8d2b('0xa'));var squel=require(_0x8d2b('0xb'));var crypto=require(_0x8d2b('0xc'));var jsforce=require(_0x8d2b('0xd'));var deskjs=require(_0x8d2b('0xe'));var toCsv=require(_0x8d2b('0x8'));var querystring=require('querystring');var Papa=require(_0x8d2b('0xf'));var Redis=require('ioredis');var authService=require(_0x8d2b('0x10'));var qs=require(_0x8d2b('0x11'));var as=require(_0x8d2b('0x12'));var hardwareService=require(_0x8d2b('0x13'));var logger=require(_0x8d2b('0x14'))(_0x8d2b('0x15'));var utils=require('../../config/utils');var config=require(_0x8d2b('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5f5594,_0x417812){_0x417812=_0x417812||0xcc;return function(_0x26d4df){if(_0x26d4df){return _0x5f5594[_0x8d2b('0x17')](_0x417812);}return _0x5f5594['status'](_0x417812)['end']();};}function respondWithResult(_0xfb3286,_0x56c5ac){_0x56c5ac=_0x56c5ac||0xc8;return function(_0x1aa50){if(_0x1aa50){return _0xfb3286[_0x8d2b('0x18')](_0x56c5ac)[_0x8d2b('0x19')](_0x1aa50);}};}function respondWithFilteredResult(_0x102410,_0x3b7407){return function(_0x133202){if(_0x133202){var _0xd00505=typeof _0x3b7407[_0x8d2b('0x1a')]===_0x8d2b('0x1b')&&typeof _0x3b7407[_0x8d2b('0x1c')]==='undefined';var _0xd95887=_0x133202[_0x8d2b('0x1d')];var _0x1105d7=_0xd00505?0x0:_0x3b7407[_0x8d2b('0x1a')];var _0x4e6d1f=_0xd00505?_0x133202[_0x8d2b('0x1d')]:_0x3b7407[_0x8d2b('0x1a')]+_0x3b7407[_0x8d2b('0x1c')];var _0x324e70;if(_0x4e6d1f>=_0xd95887){_0x4e6d1f=_0xd95887;_0x324e70=0xc8;}else{_0x324e70=0xce;}_0x102410[_0x8d2b('0x18')](_0x324e70);return _0x102410['set'](_0x8d2b('0x1e'),_0x1105d7+'-'+_0x4e6d1f+'/'+_0xd95887)[_0x8d2b('0x19')](_0x133202);}return null;};}function patchUpdates(_0x524c80){return function(_0x4c1f7d){try{jsonpatch[_0x8d2b('0x1f')](_0x4c1f7d,_0x524c80,!![]);}catch(_0x33c371){return BPromise[_0x8d2b('0x20')](_0x33c371);}return _0x4c1f7d[_0x8d2b('0x21')]();};}function saveUpdates(_0x20760d,_0x132435){return function(_0x51afac){if(_0x51afac){return _0x51afac['update'](_0x20760d)[_0x8d2b('0x22')](function(_0x1092a8){return _0x1092a8;});}return null;};}function removeEntity(_0x520293,_0x2e04f5){return function(_0x15e9b9){if(_0x15e9b9){return _0x15e9b9[_0x8d2b('0x23')]()['then'](function(){_0x520293['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x566135,_0xdf7b64){return function(_0x5428fa){if(!_0x5428fa){_0x566135[_0x8d2b('0x17')](0x194);}return _0x5428fa;};}function handleError(_0x1c00e6,_0xb8976){_0xb8976=_0xb8976||0x1f4;return function(_0x513018){logger[_0x8d2b('0x24')](_0x513018[_0x8d2b('0x25')]);if(_0x513018[_0x8d2b('0x26')]){delete _0x513018[_0x8d2b('0x26')];}_0x1c00e6['status'](_0xb8976)[_0x8d2b('0x27')](_0x513018);};}exports[_0x8d2b('0x28')]=function(_0x392690,_0x494689){var _0x218920={},_0x182e2e={},_0x519a67={'count':0x0,'rows':[]};var _0x244c33=_[_0x8d2b('0x29')](db[_0x8d2b('0x2a')]['rawAttributes'],function(_0x37a9fa){return{'name':_0x37a9fa[_0x8d2b('0x2b')],'type':_0x37a9fa['type'][_0x8d2b('0x2c')]};});_0x182e2e[_0x8d2b('0x2d')]=_[_0x8d2b('0x29')](_0x244c33,'name');_0x182e2e[_0x8d2b('0x2e')]=_[_0x8d2b('0x2f')](_0x392690[_0x8d2b('0x2e')]);_0x182e2e[_0x8d2b('0x30')]=_[_0x8d2b('0x31')](_0x182e2e['model'],_0x182e2e[_0x8d2b('0x2e')]);_0x218920[_0x8d2b('0x32')]=_[_0x8d2b('0x31')](_0x182e2e[_0x8d2b('0x2d')],qs['fields'](_0x392690[_0x8d2b('0x2e')][_0x8d2b('0x33')]));_0x218920['attributes']=_0x218920['attributes'][_0x8d2b('0x34')]?_0x218920[_0x8d2b('0x32')]:_0x182e2e[_0x8d2b('0x2d')];if(!_0x392690[_0x8d2b('0x2e')][_0x8d2b('0x35')](_0x8d2b('0x36'))){_0x218920[_0x8d2b('0x1c')]=qs[_0x8d2b('0x1c')](_0x392690[_0x8d2b('0x2e')][_0x8d2b('0x1c')]);_0x218920[_0x8d2b('0x1a')]=qs['offset'](_0x392690[_0x8d2b('0x2e')][_0x8d2b('0x1a')]);}_0x218920[_0x8d2b('0x37')]=qs[_0x8d2b('0x38')](_0x392690[_0x8d2b('0x2e')]['sort']);_0x218920[_0x8d2b('0x39')]=qs[_0x8d2b('0x30')](_[_0x8d2b('0x3a')](_0x392690[_0x8d2b('0x2e')],_0x182e2e[_0x8d2b('0x30')]),_0x244c33);if(_0x392690[_0x8d2b('0x2e')][_0x8d2b('0x3b')]){_0x218920[_0x8d2b('0x39')]=_['merge'](_0x218920['where'],{'$or':_['map'](_0x244c33,function(_0xbbbcb2){if(_0xbbbcb2[_0x8d2b('0x3c')]!==_0x8d2b('0x3d')){var _0x334a06={};_0x334a06[_0xbbbcb2[_0x8d2b('0x26')]]={'$like':'%'+_0x392690[_0x8d2b('0x2e')][_0x8d2b('0x3b')]+'%'};return _0x334a06;}})});}_0x218920=_['merge']({},_0x218920,_0x392690[_0x8d2b('0x3e')]);var _0x34b43d={'where':_0x218920[_0x8d2b('0x39')]};return db[_0x8d2b('0x2a')][_0x8d2b('0x1d')](_0x34b43d)[_0x8d2b('0x22')](function(_0x1358e5){_0x519a67[_0x8d2b('0x1d')]=_0x1358e5;if(_0x392690['query'][_0x8d2b('0x3f')]){_0x218920[_0x8d2b('0x40')]=[{'all':!![]}];}return db[_0x8d2b('0x2a')][_0x8d2b('0x41')](_0x218920);})[_0x8d2b('0x22')](function(_0x149cb6){_0x519a67[_0x8d2b('0x42')]=_0x149cb6;return _0x519a67;})[_0x8d2b('0x22')](respondWithFilteredResult(_0x494689,_0x218920))[_0x8d2b('0x43')](handleError(_0x494689,null));};exports[_0x8d2b('0x44')]=function(_0x3ab563,_0x207313){var _0x28f0dc={'raw':![],'where':{'id':_0x3ab563[_0x8d2b('0x45')]['id']}},_0x2e23d9={};_0x2e23d9[_0x8d2b('0x2d')]=_[_0x8d2b('0x2f')](db[_0x8d2b('0x2a')][_0x8d2b('0x46')]);_0x2e23d9[_0x8d2b('0x2e')]=_['keys'](_0x3ab563[_0x8d2b('0x2e')]);_0x2e23d9[_0x8d2b('0x30')]=_[_0x8d2b('0x31')](_0x2e23d9[_0x8d2b('0x2d')],_0x2e23d9[_0x8d2b('0x2e')]);_0x28f0dc[_0x8d2b('0x32')]=_[_0x8d2b('0x31')](_0x2e23d9[_0x8d2b('0x2d')],qs['fields'](_0x3ab563[_0x8d2b('0x2e')][_0x8d2b('0x33')]));_0x28f0dc[_0x8d2b('0x32')]=_0x28f0dc[_0x8d2b('0x32')]['length']?_0x28f0dc[_0x8d2b('0x32')]:_0x2e23d9[_0x8d2b('0x2d')];if(_0x3ab563['query'][_0x8d2b('0x3f')]){_0x28f0dc[_0x8d2b('0x40')]=[{'all':!![]}];}_0x28f0dc=_[_0x8d2b('0x47')]({},_0x28f0dc,_0x3ab563[_0x8d2b('0x3e')]);return db[_0x8d2b('0x2a')][_0x8d2b('0x48')](_0x28f0dc)['then'](handleEntityNotFound(_0x207313,null))[_0x8d2b('0x22')](respondWithResult(_0x207313,null))[_0x8d2b('0x43')](handleError(_0x207313,null));};exports['create']=function(_0x20d0d8,_0x4d57df){return db[_0x8d2b('0x2a')]['create'](_0x20d0d8[_0x8d2b('0x49')],{})[_0x8d2b('0x22')](respondWithResult(_0x4d57df,0xc9))[_0x8d2b('0x43')](handleError(_0x4d57df,null));};exports[_0x8d2b('0x4a')]=function(_0x38223b,_0x5002ba){if(_0x38223b[_0x8d2b('0x49')]['id']){delete _0x38223b[_0x8d2b('0x49')]['id'];}return db[_0x8d2b('0x2a')]['find']({'where':{'id':_0x38223b['params']['id']}})['then'](handleEntityNotFound(_0x5002ba,null))[_0x8d2b('0x22')](saveUpdates(_0x38223b['body'],null))[_0x8d2b('0x22')](respondWithResult(_0x5002ba,null))['catch'](handleError(_0x5002ba,null));};exports['destroy']=function(_0x5334cb,_0x433e21){return db[_0x8d2b('0x2a')][_0x8d2b('0x48')]({'where':{'id':_0x5334cb[_0x8d2b('0x45')]['id']}})[_0x8d2b('0x22')](handleEntityNotFound(_0x433e21,null))[_0x8d2b('0x22')](removeEntity(_0x433e21,null))[_0x8d2b('0x43')](handleError(_0x433e21,null));};exports[_0x8d2b('0x4b')]=function(_0x535a5b,_0x129230,_0xcc4fcb){var _0x49677e={};var _0x233332={};var _0x1b6106;var _0x4e6e99;return db[_0x8d2b('0x2a')][_0x8d2b('0x4c')]({'where':{'id':_0x535a5b[_0x8d2b('0x45')]['id']}})[_0x8d2b('0x22')](handleEntityNotFound(_0x129230,null))[_0x8d2b('0x22')](function(_0x4aba6d){if(_0x4aba6d){_0x1b6106=_0x4aba6d;_0x233332[_0x8d2b('0x2d')]=_[_0x8d2b('0x2f')](db['FreshdeskField'][_0x8d2b('0x46')]);_0x233332[_0x8d2b('0x2e')]=_[_0x8d2b('0x2f')](_0x535a5b[_0x8d2b('0x2e')]);_0x233332[_0x8d2b('0x30')]=_[_0x8d2b('0x31')](_0x233332[_0x8d2b('0x2d')],_0x233332['query']);_0x49677e[_0x8d2b('0x32')]=_[_0x8d2b('0x31')](_0x233332[_0x8d2b('0x2d')],qs[_0x8d2b('0x33')](_0x535a5b[_0x8d2b('0x2e')][_0x8d2b('0x33')]));_0x49677e['attributes']=_0x49677e[_0x8d2b('0x32')][_0x8d2b('0x34')]?_0x49677e[_0x8d2b('0x32')]:_0x233332[_0x8d2b('0x2d')];_0x49677e['order']=qs[_0x8d2b('0x38')](_0x535a5b[_0x8d2b('0x2e')]['sort']);_0x49677e[_0x8d2b('0x39')]=qs[_0x8d2b('0x30')](_['pick'](_0x535a5b[_0x8d2b('0x2e')],_0x233332[_0x8d2b('0x30')]));if(_0x535a5b[_0x8d2b('0x2e')][_0x8d2b('0x3b')]){_0x49677e[_0x8d2b('0x39')]=_[_0x8d2b('0x47')](_0x49677e['where'],{'$or':_['map'](_0x49677e[_0x8d2b('0x32')],function(_0x503da6){var _0x55397a={};_0x55397a[_0x503da6]={'$like':'%'+_0x535a5b[_0x8d2b('0x2e')]['filter']+'%'};return _0x55397a;})});}_0x49677e=_[_0x8d2b('0x47')]({},_0x49677e,_0x535a5b[_0x8d2b('0x3e')]);return _0x1b6106[_0x8d2b('0x4b')](_0x49677e);}})['then'](function(_0xbe90e9){if(_0xbe90e9){_0x4e6e99=_0xbe90e9[_0x8d2b('0x34')];if(!_0x535a5b[_0x8d2b('0x2e')][_0x8d2b('0x35')](_0x8d2b('0x36'))){_0x49677e['limit']=qs[_0x8d2b('0x1c')](_0x535a5b[_0x8d2b('0x2e')][_0x8d2b('0x1c')]);_0x49677e['offset']=qs[_0x8d2b('0x1a')](_0x535a5b[_0x8d2b('0x2e')]['offset']);}return _0x1b6106[_0x8d2b('0x4b')](_0x49677e);}})['then'](function(_0x1c167b){if(_0x1c167b){return _0x1c167b?{'count':_0x4e6e99,'rows':_0x1c167b}:null;}})[_0x8d2b('0x22')](respondWithResult(_0x129230,null))[_0x8d2b('0x43')](handleError(_0x129230,null));};exports[_0x8d2b('0x4d')]=function(_0x545782,_0x55800f,_0x18464f){var _0x31a4fb={};var _0x58c18a={};var _0x6fb3d;var _0x194ede;return db[_0x8d2b('0x2a')][_0x8d2b('0x4c')]({'where':{'id':_0x545782[_0x8d2b('0x45')]['id']}})[_0x8d2b('0x22')](handleEntityNotFound(_0x55800f,null))[_0x8d2b('0x22')](function(_0x6b0413){if(_0x6b0413){_0x6fb3d=_0x6b0413;_0x58c18a[_0x8d2b('0x2d')]=_[_0x8d2b('0x2f')](db[_0x8d2b('0x4e')]['rawAttributes']);_0x58c18a['query']=_[_0x8d2b('0x2f')](_0x545782['query']);_0x58c18a[_0x8d2b('0x30')]=_[_0x8d2b('0x31')](_0x58c18a[_0x8d2b('0x2d')],_0x58c18a[_0x8d2b('0x2e')]);_0x31a4fb[_0x8d2b('0x32')]=_[_0x8d2b('0x31')](_0x58c18a[_0x8d2b('0x2d')],qs['fields'](_0x545782[_0x8d2b('0x2e')][_0x8d2b('0x33')]));_0x31a4fb[_0x8d2b('0x32')]=_0x31a4fb['attributes'][_0x8d2b('0x34')]?_0x31a4fb[_0x8d2b('0x32')]:_0x58c18a['model'];_0x31a4fb[_0x8d2b('0x37')]=qs['sort'](_0x545782[_0x8d2b('0x2e')][_0x8d2b('0x38')]);_0x31a4fb[_0x8d2b('0x39')]=qs[_0x8d2b('0x30')](_[_0x8d2b('0x3a')](_0x545782['query'],_0x58c18a[_0x8d2b('0x30')]));if(_0x545782[_0x8d2b('0x2e')][_0x8d2b('0x3b')]){_0x31a4fb[_0x8d2b('0x39')]=_[_0x8d2b('0x47')](_0x31a4fb[_0x8d2b('0x39')],{'$or':_['map'](_0x31a4fb[_0x8d2b('0x32')],function(_0x2979b4){var _0x527c7f={};_0x527c7f[_0x2979b4]={'$like':'%'+_0x545782[_0x8d2b('0x2e')][_0x8d2b('0x3b')]+'%'};return _0x527c7f;})});}_0x31a4fb=_[_0x8d2b('0x47')]({},_0x31a4fb,_0x545782[_0x8d2b('0x3e')]);return _0x6fb3d[_0x8d2b('0x4d')](_0x31a4fb);}})[_0x8d2b('0x22')](function(_0x1cf6cc){if(_0x1cf6cc){_0x194ede=_0x1cf6cc[_0x8d2b('0x34')];if(!_0x545782['query'][_0x8d2b('0x35')](_0x8d2b('0x36'))){_0x31a4fb['limit']=qs['limit'](_0x545782['query'][_0x8d2b('0x1c')]);_0x31a4fb[_0x8d2b('0x1a')]=qs['offset'](_0x545782[_0x8d2b('0x2e')][_0x8d2b('0x1a')]);}return _0x6fb3d[_0x8d2b('0x4d')](_0x31a4fb);}})[_0x8d2b('0x22')](function(_0xf3429d){if(_0xf3429d){return _0xf3429d?{'count':_0x194ede,'rows':_0xf3429d}:null;}})[_0x8d2b('0x22')](respondWithResult(_0x55800f,null))[_0x8d2b('0x43')](handleError(_0x55800f,null));};exports['getDescriptions']=function(_0x3c1bc1,_0x1b4368,_0x1388e9){var _0x192e7e={};var _0x17d057={};var _0x41ebeb;var _0xba753a;return db['FreshdeskConfiguration'][_0x8d2b('0x4c')]({'where':{'id':_0x3c1bc1[_0x8d2b('0x45')]['id']}})['then'](handleEntityNotFound(_0x1b4368,null))[_0x8d2b('0x22')](function(_0x58b246){if(_0x58b246){_0x41ebeb=_0x58b246;_0x17d057[_0x8d2b('0x2d')]=_[_0x8d2b('0x2f')](db[_0x8d2b('0x4e')][_0x8d2b('0x46')]);_0x17d057[_0x8d2b('0x2e')]=_[_0x8d2b('0x2f')](_0x3c1bc1[_0x8d2b('0x2e')]);_0x17d057[_0x8d2b('0x30')]=_['intersection'](_0x17d057[_0x8d2b('0x2d')],_0x17d057[_0x8d2b('0x2e')]);_0x192e7e[_0x8d2b('0x32')]=_[_0x8d2b('0x31')](_0x17d057[_0x8d2b('0x2d')],qs[_0x8d2b('0x33')](_0x3c1bc1[_0x8d2b('0x2e')][_0x8d2b('0x33')]));_0x192e7e[_0x8d2b('0x32')]=_0x192e7e[_0x8d2b('0x32')][_0x8d2b('0x34')]?_0x192e7e[_0x8d2b('0x32')]:_0x17d057['model'];_0x192e7e[_0x8d2b('0x37')]=qs['sort'](_0x3c1bc1['query'][_0x8d2b('0x38')]);_0x192e7e['where']=qs[_0x8d2b('0x30')](_[_0x8d2b('0x3a')](_0x3c1bc1['query'],_0x17d057[_0x8d2b('0x30')]));if(_0x3c1bc1['query']['filter']){_0x192e7e[_0x8d2b('0x39')]=_[_0x8d2b('0x47')](_0x192e7e[_0x8d2b('0x39')],{'$or':_[_0x8d2b('0x29')](_0x192e7e[_0x8d2b('0x32')],function(_0x2788c4){var _0x3281a8={};_0x3281a8[_0x2788c4]={'$like':'%'+_0x3c1bc1[_0x8d2b('0x2e')][_0x8d2b('0x3b')]+'%'};return _0x3281a8;})});}_0x192e7e=_[_0x8d2b('0x47')]({},_0x192e7e,_0x3c1bc1[_0x8d2b('0x3e')]);return _0x41ebeb[_0x8d2b('0x4f')](_0x192e7e);}})[_0x8d2b('0x22')](function(_0x4c8258){if(_0x4c8258){_0xba753a=_0x4c8258['length'];if(!_0x3c1bc1[_0x8d2b('0x2e')]['hasOwnProperty'](_0x8d2b('0x36'))){_0x192e7e[_0x8d2b('0x1c')]=qs['limit'](_0x3c1bc1[_0x8d2b('0x2e')][_0x8d2b('0x1c')]);_0x192e7e[_0x8d2b('0x1a')]=qs['offset'](_0x3c1bc1['query']['offset']);}return _0x41ebeb['getDescriptions'](_0x192e7e);}})['then'](function(_0x6d04a5){if(_0x6d04a5){return _0x6d04a5?{'count':_0xba753a,'rows':_0x6d04a5}:null;}})['then'](respondWithResult(_0x1b4368,null))[_0x8d2b('0x43')](handleError(_0x1b4368,null));};exports[_0x8d2b('0x50')]=function(_0x4f2b1d,_0x4e1af4,_0x5120c2){var _0x42726d={};var _0x59ed7e={};var _0x290c4b;var _0x5c44e2;return db[_0x8d2b('0x2a')][_0x8d2b('0x4c')]({'where':{'id':_0x4f2b1d[_0x8d2b('0x45')]['id']}})['then'](handleEntityNotFound(_0x4e1af4,null))[_0x8d2b('0x22')](function(_0x589817){if(_0x589817){_0x290c4b=_0x589817;_0x59ed7e[_0x8d2b('0x2d')]=_[_0x8d2b('0x2f')](db['Tag'][_0x8d2b('0x46')]);_0x59ed7e[_0x8d2b('0x2e')]=_[_0x8d2b('0x2f')](_0x4f2b1d[_0x8d2b('0x2e')]);_0x59ed7e[_0x8d2b('0x30')]=_['intersection'](_0x59ed7e[_0x8d2b('0x2d')],_0x59ed7e['query']);_0x42726d['attributes']=_[_0x8d2b('0x31')](_0x59ed7e[_0x8d2b('0x2d')],qs[_0x8d2b('0x33')](_0x4f2b1d[_0x8d2b('0x2e')][_0x8d2b('0x33')]));_0x42726d[_0x8d2b('0x32')]=_0x42726d[_0x8d2b('0x32')]['length']?_0x42726d['attributes']:_0x59ed7e[_0x8d2b('0x2d')];_0x42726d[_0x8d2b('0x37')]=qs[_0x8d2b('0x38')](_0x4f2b1d[_0x8d2b('0x2e')]['sort']);_0x42726d['where']=qs[_0x8d2b('0x30')](_[_0x8d2b('0x3a')](_0x4f2b1d[_0x8d2b('0x2e')],_0x59ed7e[_0x8d2b('0x30')]));if(_0x4f2b1d[_0x8d2b('0x2e')][_0x8d2b('0x3b')]){_0x42726d[_0x8d2b('0x39')]=_[_0x8d2b('0x47')](_0x42726d[_0x8d2b('0x39')],{'$or':_['map'](_0x42726d[_0x8d2b('0x32')],function(_0x31d46d){var _0x53e834={};_0x53e834[_0x31d46d]={'$like':'%'+_0x4f2b1d[_0x8d2b('0x2e')][_0x8d2b('0x3b')]+'%'};return _0x53e834;})});}_0x42726d=_[_0x8d2b('0x47')]({},_0x42726d,_0x4f2b1d[_0x8d2b('0x3e')]);return _0x290c4b['getTags'](_0x42726d);}})['then'](function(_0x2e02ea){if(_0x2e02ea){_0x5c44e2=_0x2e02ea[_0x8d2b('0x34')];if(!_0x4f2b1d[_0x8d2b('0x2e')][_0x8d2b('0x35')](_0x8d2b('0x36'))){_0x42726d[_0x8d2b('0x1c')]=qs['limit'](_0x4f2b1d['query'][_0x8d2b('0x1c')]);_0x42726d[_0x8d2b('0x1a')]=qs[_0x8d2b('0x1a')](_0x4f2b1d[_0x8d2b('0x2e')][_0x8d2b('0x1a')]);}return _0x290c4b[_0x8d2b('0x50')](_0x42726d);}})[_0x8d2b('0x22')](function(_0x486cbd){if(_0x486cbd){return _0x486cbd?{'count':_0x5c44e2,'rows':_0x486cbd}:null;}})[_0x8d2b('0x22')](respondWithResult(_0x4e1af4,null))[_0x8d2b('0x43')](handleError(_0x4e1af4,null));};exports[_0x8d2b('0x51')]=function(_0xedeb,_0x3c32f4,_0x43a14c){if(_0xedeb['body']['id']){delete _0xedeb['body']['id'];}return db['FreshdeskConfiguration'][_0x8d2b('0x4c')]({'where':{'id':_0xedeb[_0x8d2b('0x45')]['id']}})[_0x8d2b('0x22')](handleEntityNotFound(_0x3c32f4,null))[_0x8d2b('0x22')](function(_0x5eaeb9){if(_0x5eaeb9){return _0x5eaeb9[_0x8d2b('0x51')](_0xedeb[_0x8d2b('0x49')][_0x8d2b('0x52')]||[]);}return null;})[_0x8d2b('0x22')](respondWithResult(_0x3c32f4,null))['catch'](handleError(_0x3c32f4,null));}; \ No newline at end of file +var _0xf48b=['filter','where','merge','includeAll','include','findAll','catch','show','params','length','options','find','create','body','getFields','findOne','FreshdeskField','order','pick','getSubjects','getDescriptions','getTags','Tag','setTags','rimraf','request-promise','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','apply','save','update','then','destroy','end','error','stack','name','index','map','FreshdeskConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort'];(function(_0x5d5a99,_0x59ed48){var _0x3e7963=function(_0xa813c4){while(--_0xa813c4){_0x5d5a99['push'](_0x5d5a99['shift']());}};_0x3e7963(++_0x59ed48);}(_0xf48b,0x1a8));var _0xbf48=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf48b[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbf48('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbf48('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xbf48('0x2'));var sox=require(_0xbf48('0x3'));var csv=require('to-csv');var ejs=require(_0xbf48('0x4'));var fs=require('fs');var fs_extra=require(_0xbf48('0x5'));var _=require(_0xbf48('0x6'));var squel=require(_0xbf48('0x7'));var crypto=require('crypto');var jsforce=require(_0xbf48('0x8'));var deskjs=require(_0xbf48('0x9'));var toCsv=require('to-csv');var querystring=require(_0xbf48('0xa'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xbf48('0xb'));var qs=require(_0xbf48('0xc'));var as=require(_0xbf48('0xd'));var hardwareService=require(_0xbf48('0xe'));var logger=require(_0xbf48('0xf'))(_0xbf48('0x10'));var utils=require(_0xbf48('0x11'));var config=require(_0xbf48('0x12'));var licenseUtil=require(_0xbf48('0x13'));var db=require(_0xbf48('0x14'))['db'];function respondWithStatusCode(_0x2410d4,_0x8972f7){_0x8972f7=_0x8972f7||0xcc;return function(_0x11fcd5){if(_0x11fcd5){return _0x2410d4[_0xbf48('0x15')](_0x8972f7);}return _0x2410d4[_0xbf48('0x16')](_0x8972f7)['end']();};}function respondWithResult(_0x597d18,_0x2190d2){_0x2190d2=_0x2190d2||0xc8;return function(_0x1bdafa){if(_0x1bdafa){return _0x597d18[_0xbf48('0x16')](_0x2190d2)['json'](_0x1bdafa);}};}function respondWithFilteredResult(_0x2d1747,_0x4296a6){return function(_0xbb5b79){if(_0xbb5b79){var _0x5cbc2e=typeof _0x4296a6['offset']===_0xbf48('0x17')&&typeof _0x4296a6[_0xbf48('0x18')]==='undefined';var _0x25ede1=_0xbb5b79[_0xbf48('0x19')];var _0xf03f46=_0x5cbc2e?0x0:_0x4296a6[_0xbf48('0x1a')];var _0x357032=_0x5cbc2e?_0xbb5b79[_0xbf48('0x19')]:_0x4296a6[_0xbf48('0x1a')]+_0x4296a6[_0xbf48('0x18')];var _0x22f06b;if(_0x357032>=_0x25ede1){_0x357032=_0x25ede1;_0x22f06b=0xc8;}else{_0x22f06b=0xce;}_0x2d1747['status'](_0x22f06b);return _0x2d1747[_0xbf48('0x1b')](_0xbf48('0x1c'),_0xf03f46+'-'+_0x357032+'/'+_0x25ede1)[_0xbf48('0x1d')](_0xbb5b79);}return null;};}function patchUpdates(_0xcc1d17){return function(_0x1f922d){try{jsonpatch[_0xbf48('0x1e')](_0x1f922d,_0xcc1d17,!![]);}catch(_0x2750f3){return BPromise['reject'](_0x2750f3);}return _0x1f922d[_0xbf48('0x1f')]();};}function saveUpdates(_0x34cc06,_0x29cd1f){return function(_0x1ecbf9){if(_0x1ecbf9){return _0x1ecbf9[_0xbf48('0x20')](_0x34cc06)[_0xbf48('0x21')](function(_0x4b5111){return _0x4b5111;});}return null;};}function removeEntity(_0x5ac323,_0x3a4f94){return function(_0x5bcb25){if(_0x5bcb25){return _0x5bcb25[_0xbf48('0x22')]()[_0xbf48('0x21')](function(){_0x5ac323[_0xbf48('0x16')](0xcc)[_0xbf48('0x23')]();});}};}function handleEntityNotFound(_0x70670e,_0x5e6019){return function(_0x2d95d8){if(!_0x2d95d8){_0x70670e['sendStatus'](0x194);}return _0x2d95d8;};}function handleError(_0x911de4,_0x4eda41){_0x4eda41=_0x4eda41||0x1f4;return function(_0x50f6ff){logger[_0xbf48('0x24')](_0x50f6ff[_0xbf48('0x25')]);if(_0x50f6ff['name']){delete _0x50f6ff[_0xbf48('0x26')];}_0x911de4[_0xbf48('0x16')](_0x4eda41)['send'](_0x50f6ff);};}exports[_0xbf48('0x27')]=function(_0x54f350,_0x4364aa){var _0x93c4df={},_0x48fdd2={},_0x388df0={'count':0x0,'rows':[]};var _0x14e703=_[_0xbf48('0x28')](db[_0xbf48('0x29')][_0xbf48('0x2a')],function(_0x2a18d7){return{'name':_0x2a18d7[_0xbf48('0x2b')],'type':_0x2a18d7[_0xbf48('0x2c')][_0xbf48('0x2d')]};});_0x48fdd2[_0xbf48('0x2e')]=_[_0xbf48('0x28')](_0x14e703,_0xbf48('0x26'));_0x48fdd2[_0xbf48('0x2f')]=_[_0xbf48('0x30')](_0x54f350['query']);_0x48fdd2[_0xbf48('0x31')]=_[_0xbf48('0x32')](_0x48fdd2[_0xbf48('0x2e')],_0x48fdd2[_0xbf48('0x2f')]);_0x93c4df[_0xbf48('0x33')]=_['intersection'](_0x48fdd2[_0xbf48('0x2e')],qs[_0xbf48('0x34')](_0x54f350[_0xbf48('0x2f')][_0xbf48('0x34')]));_0x93c4df['attributes']=_0x93c4df[_0xbf48('0x33')]['length']?_0x93c4df[_0xbf48('0x33')]:_0x48fdd2[_0xbf48('0x2e')];if(!_0x54f350[_0xbf48('0x2f')][_0xbf48('0x35')](_0xbf48('0x36'))){_0x93c4df[_0xbf48('0x18')]=qs['limit'](_0x54f350[_0xbf48('0x2f')][_0xbf48('0x18')]);_0x93c4df[_0xbf48('0x1a')]=qs[_0xbf48('0x1a')](_0x54f350[_0xbf48('0x2f')][_0xbf48('0x1a')]);}_0x93c4df['order']=qs[_0xbf48('0x37')](_0x54f350[_0xbf48('0x2f')]['sort']);_0x93c4df['where']=qs[_0xbf48('0x31')](_['pick'](_0x54f350[_0xbf48('0x2f')],_0x48fdd2['filters']),_0x14e703);if(_0x54f350[_0xbf48('0x2f')][_0xbf48('0x38')]){_0x93c4df[_0xbf48('0x39')]=_[_0xbf48('0x3a')](_0x93c4df[_0xbf48('0x39')],{'$or':_[_0xbf48('0x28')](_0x14e703,function(_0x460d3b){if(_0x460d3b['type']!=='VIRTUAL'){var _0x1fa1ae={};_0x1fa1ae[_0x460d3b[_0xbf48('0x26')]]={'$like':'%'+_0x54f350[_0xbf48('0x2f')][_0xbf48('0x38')]+'%'};return _0x1fa1ae;}})});}_0x93c4df=_[_0xbf48('0x3a')]({},_0x93c4df,_0x54f350['options']);var _0x23b2ed={'where':_0x93c4df[_0xbf48('0x39')]};return db[_0xbf48('0x29')][_0xbf48('0x19')](_0x23b2ed)['then'](function(_0x1863bf){_0x388df0[_0xbf48('0x19')]=_0x1863bf;if(_0x54f350[_0xbf48('0x2f')][_0xbf48('0x3b')]){_0x93c4df[_0xbf48('0x3c')]=[{'all':!![]}];}return db['FreshdeskConfiguration'][_0xbf48('0x3d')](_0x93c4df);})[_0xbf48('0x21')](function(_0x5246d0){_0x388df0['rows']=_0x5246d0;return _0x388df0;})[_0xbf48('0x21')](respondWithFilteredResult(_0x4364aa,_0x93c4df))[_0xbf48('0x3e')](handleError(_0x4364aa,null));};exports[_0xbf48('0x3f')]=function(_0x4b532b,_0x239a75){var _0x2331fa={'raw':![],'where':{'id':_0x4b532b[_0xbf48('0x40')]['id']}},_0x4a2f71={};_0x4a2f71[_0xbf48('0x2e')]=_[_0xbf48('0x30')](db[_0xbf48('0x29')][_0xbf48('0x2a')]);_0x4a2f71[_0xbf48('0x2f')]=_['keys'](_0x4b532b['query']);_0x4a2f71[_0xbf48('0x31')]=_[_0xbf48('0x32')](_0x4a2f71['model'],_0x4a2f71[_0xbf48('0x2f')]);_0x2331fa[_0xbf48('0x33')]=_['intersection'](_0x4a2f71[_0xbf48('0x2e')],qs[_0xbf48('0x34')](_0x4b532b[_0xbf48('0x2f')][_0xbf48('0x34')]));_0x2331fa[_0xbf48('0x33')]=_0x2331fa[_0xbf48('0x33')][_0xbf48('0x41')]?_0x2331fa[_0xbf48('0x33')]:_0x4a2f71[_0xbf48('0x2e')];if(_0x4b532b['query']['includeAll']){_0x2331fa[_0xbf48('0x3c')]=[{'all':!![]}];}_0x2331fa=_[_0xbf48('0x3a')]({},_0x2331fa,_0x4b532b[_0xbf48('0x42')]);return db[_0xbf48('0x29')][_0xbf48('0x43')](_0x2331fa)[_0xbf48('0x21')](handleEntityNotFound(_0x239a75,null))['then'](respondWithResult(_0x239a75,null))[_0xbf48('0x3e')](handleError(_0x239a75,null));};exports['create']=function(_0x7467af,_0x5a48ad){return db['FreshdeskConfiguration'][_0xbf48('0x44')](_0x7467af[_0xbf48('0x45')],{})['then'](respondWithResult(_0x5a48ad,0xc9))[_0xbf48('0x3e')](handleError(_0x5a48ad,null));};exports[_0xbf48('0x20')]=function(_0x450253,_0x2089cc){if(_0x450253[_0xbf48('0x45')]['id']){delete _0x450253[_0xbf48('0x45')]['id'];}return db['FreshdeskConfiguration'][_0xbf48('0x43')]({'where':{'id':_0x450253[_0xbf48('0x40')]['id']}})[_0xbf48('0x21')](handleEntityNotFound(_0x2089cc,null))[_0xbf48('0x21')](saveUpdates(_0x450253['body'],null))[_0xbf48('0x21')](respondWithResult(_0x2089cc,null))[_0xbf48('0x3e')](handleError(_0x2089cc,null));};exports[_0xbf48('0x22')]=function(_0x26b850,_0x111972){return db['FreshdeskConfiguration'][_0xbf48('0x43')]({'where':{'id':_0x26b850['params']['id']}})[_0xbf48('0x21')](handleEntityNotFound(_0x111972,null))['then'](removeEntity(_0x111972,null))['catch'](handleError(_0x111972,null));};exports[_0xbf48('0x46')]=function(_0x9e7da3,_0x1d588c,_0x357007){var _0x469435={};var _0x4c8c12={};var _0x7f949f;var _0x4ec801;return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x9e7da3[_0xbf48('0x40')]['id']}})[_0xbf48('0x21')](handleEntityNotFound(_0x1d588c,null))[_0xbf48('0x21')](function(_0x383c99){if(_0x383c99){_0x7f949f=_0x383c99;_0x4c8c12[_0xbf48('0x2e')]=_['keys'](db['FreshdeskField'][_0xbf48('0x2a')]);_0x4c8c12['query']=_['keys'](_0x9e7da3[_0xbf48('0x2f')]);_0x4c8c12['filters']=_[_0xbf48('0x32')](_0x4c8c12[_0xbf48('0x2e')],_0x4c8c12[_0xbf48('0x2f')]);_0x469435[_0xbf48('0x33')]=_[_0xbf48('0x32')](_0x4c8c12[_0xbf48('0x2e')],qs[_0xbf48('0x34')](_0x9e7da3[_0xbf48('0x2f')]['fields']));_0x469435[_0xbf48('0x33')]=_0x469435['attributes'][_0xbf48('0x41')]?_0x469435['attributes']:_0x4c8c12[_0xbf48('0x2e')];_0x469435['order']=qs[_0xbf48('0x37')](_0x9e7da3['query']['sort']);_0x469435[_0xbf48('0x39')]=qs[_0xbf48('0x31')](_['pick'](_0x9e7da3[_0xbf48('0x2f')],_0x4c8c12[_0xbf48('0x31')]));if(_0x9e7da3[_0xbf48('0x2f')][_0xbf48('0x38')]){_0x469435[_0xbf48('0x39')]=_[_0xbf48('0x3a')](_0x469435[_0xbf48('0x39')],{'$or':_[_0xbf48('0x28')](_0x469435[_0xbf48('0x33')],function(_0xf9bfdf){var _0xca6513={};_0xca6513[_0xf9bfdf]={'$like':'%'+_0x9e7da3[_0xbf48('0x2f')][_0xbf48('0x38')]+'%'};return _0xca6513;})});}_0x469435=_[_0xbf48('0x3a')]({},_0x469435,_0x9e7da3[_0xbf48('0x42')]);return _0x7f949f[_0xbf48('0x46')](_0x469435);}})[_0xbf48('0x21')](function(_0x2eb0ce){if(_0x2eb0ce){_0x4ec801=_0x2eb0ce[_0xbf48('0x41')];if(!_0x9e7da3[_0xbf48('0x2f')][_0xbf48('0x35')](_0xbf48('0x36'))){_0x469435[_0xbf48('0x18')]=qs['limit'](_0x9e7da3[_0xbf48('0x2f')]['limit']);_0x469435[_0xbf48('0x1a')]=qs[_0xbf48('0x1a')](_0x9e7da3[_0xbf48('0x2f')]['offset']);}return _0x7f949f[_0xbf48('0x46')](_0x469435);}})[_0xbf48('0x21')](function(_0x1a3b0f){if(_0x1a3b0f){return _0x1a3b0f?{'count':_0x4ec801,'rows':_0x1a3b0f}:null;}})[_0xbf48('0x21')](respondWithResult(_0x1d588c,null))[_0xbf48('0x3e')](handleError(_0x1d588c,null));};exports['getSubjects']=function(_0x5d957f,_0xdca149,_0x3dbd4c){var _0x508e78={};var _0x5782fd={};var _0x55dac2;var _0x3d5912;return db[_0xbf48('0x29')][_0xbf48('0x47')]({'where':{'id':_0x5d957f[_0xbf48('0x40')]['id']}})[_0xbf48('0x21')](handleEntityNotFound(_0xdca149,null))[_0xbf48('0x21')](function(_0x5518dd){if(_0x5518dd){_0x55dac2=_0x5518dd;_0x5782fd['model']=_[_0xbf48('0x30')](db[_0xbf48('0x48')][_0xbf48('0x2a')]);_0x5782fd[_0xbf48('0x2f')]=_['keys'](_0x5d957f[_0xbf48('0x2f')]);_0x5782fd[_0xbf48('0x31')]=_[_0xbf48('0x32')](_0x5782fd[_0xbf48('0x2e')],_0x5782fd[_0xbf48('0x2f')]);_0x508e78[_0xbf48('0x33')]=_['intersection'](_0x5782fd[_0xbf48('0x2e')],qs[_0xbf48('0x34')](_0x5d957f[_0xbf48('0x2f')][_0xbf48('0x34')]));_0x508e78['attributes']=_0x508e78['attributes'][_0xbf48('0x41')]?_0x508e78[_0xbf48('0x33')]:_0x5782fd[_0xbf48('0x2e')];_0x508e78[_0xbf48('0x49')]=qs[_0xbf48('0x37')](_0x5d957f[_0xbf48('0x2f')][_0xbf48('0x37')]);_0x508e78['where']=qs[_0xbf48('0x31')](_[_0xbf48('0x4a')](_0x5d957f['query'],_0x5782fd[_0xbf48('0x31')]));if(_0x5d957f['query'][_0xbf48('0x38')]){_0x508e78['where']=_[_0xbf48('0x3a')](_0x508e78[_0xbf48('0x39')],{'$or':_[_0xbf48('0x28')](_0x508e78[_0xbf48('0x33')],function(_0x516cb8){var _0x5688dc={};_0x5688dc[_0x516cb8]={'$like':'%'+_0x5d957f[_0xbf48('0x2f')][_0xbf48('0x38')]+'%'};return _0x5688dc;})});}_0x508e78=_[_0xbf48('0x3a')]({},_0x508e78,_0x5d957f['options']);return _0x55dac2[_0xbf48('0x4b')](_0x508e78);}})[_0xbf48('0x21')](function(_0x394b75){if(_0x394b75){_0x3d5912=_0x394b75[_0xbf48('0x41')];if(!_0x5d957f[_0xbf48('0x2f')][_0xbf48('0x35')](_0xbf48('0x36'))){_0x508e78['limit']=qs[_0xbf48('0x18')](_0x5d957f[_0xbf48('0x2f')][_0xbf48('0x18')]);_0x508e78['offset']=qs['offset'](_0x5d957f['query']['offset']);}return _0x55dac2[_0xbf48('0x4b')](_0x508e78);}})['then'](function(_0x3749b4){if(_0x3749b4){return _0x3749b4?{'count':_0x3d5912,'rows':_0x3749b4}:null;}})['then'](respondWithResult(_0xdca149,null))[_0xbf48('0x3e')](handleError(_0xdca149,null));};exports[_0xbf48('0x4c')]=function(_0x229b2a,_0x1d06d8,_0x3513a4){var _0x1e9413={};var _0x456c52={};var _0x4bc7d3;var _0x214acc;return db[_0xbf48('0x29')][_0xbf48('0x47')]({'where':{'id':_0x229b2a[_0xbf48('0x40')]['id']}})[_0xbf48('0x21')](handleEntityNotFound(_0x1d06d8,null))[_0xbf48('0x21')](function(_0x399cf0){if(_0x399cf0){_0x4bc7d3=_0x399cf0;_0x456c52[_0xbf48('0x2e')]=_[_0xbf48('0x30')](db[_0xbf48('0x48')][_0xbf48('0x2a')]);_0x456c52[_0xbf48('0x2f')]=_['keys'](_0x229b2a['query']);_0x456c52[_0xbf48('0x31')]=_[_0xbf48('0x32')](_0x456c52[_0xbf48('0x2e')],_0x456c52['query']);_0x1e9413[_0xbf48('0x33')]=_[_0xbf48('0x32')](_0x456c52[_0xbf48('0x2e')],qs[_0xbf48('0x34')](_0x229b2a[_0xbf48('0x2f')][_0xbf48('0x34')]));_0x1e9413[_0xbf48('0x33')]=_0x1e9413['attributes']['length']?_0x1e9413[_0xbf48('0x33')]:_0x456c52[_0xbf48('0x2e')];_0x1e9413[_0xbf48('0x49')]=qs['sort'](_0x229b2a[_0xbf48('0x2f')][_0xbf48('0x37')]);_0x1e9413[_0xbf48('0x39')]=qs[_0xbf48('0x31')](_[_0xbf48('0x4a')](_0x229b2a['query'],_0x456c52['filters']));if(_0x229b2a[_0xbf48('0x2f')][_0xbf48('0x38')]){_0x1e9413[_0xbf48('0x39')]=_[_0xbf48('0x3a')](_0x1e9413[_0xbf48('0x39')],{'$or':_[_0xbf48('0x28')](_0x1e9413[_0xbf48('0x33')],function(_0x2c592d){var _0x10935f={};_0x10935f[_0x2c592d]={'$like':'%'+_0x229b2a[_0xbf48('0x2f')][_0xbf48('0x38')]+'%'};return _0x10935f;})});}_0x1e9413=_[_0xbf48('0x3a')]({},_0x1e9413,_0x229b2a['options']);return _0x4bc7d3[_0xbf48('0x4c')](_0x1e9413);}})['then'](function(_0x2d5942){if(_0x2d5942){_0x214acc=_0x2d5942[_0xbf48('0x41')];if(!_0x229b2a[_0xbf48('0x2f')]['hasOwnProperty'](_0xbf48('0x36'))){_0x1e9413[_0xbf48('0x18')]=qs[_0xbf48('0x18')](_0x229b2a[_0xbf48('0x2f')]['limit']);_0x1e9413['offset']=qs[_0xbf48('0x1a')](_0x229b2a['query']['offset']);}return _0x4bc7d3[_0xbf48('0x4c')](_0x1e9413);}})['then'](function(_0x1864ad){if(_0x1864ad){return _0x1864ad?{'count':_0x214acc,'rows':_0x1864ad}:null;}})[_0xbf48('0x21')](respondWithResult(_0x1d06d8,null))[_0xbf48('0x3e')](handleError(_0x1d06d8,null));};exports[_0xbf48('0x4d')]=function(_0x3ac1de,_0x51f9ec,_0x13bca5){var _0x5b4b36={};var _0x2e8454={};var _0x4462f3;var _0x442dd5;return db[_0xbf48('0x29')][_0xbf48('0x47')]({'where':{'id':_0x3ac1de['params']['id']}})['then'](handleEntityNotFound(_0x51f9ec,null))[_0xbf48('0x21')](function(_0x546408){if(_0x546408){_0x4462f3=_0x546408;_0x2e8454[_0xbf48('0x2e')]=_[_0xbf48('0x30')](db[_0xbf48('0x4e')]['rawAttributes']);_0x2e8454[_0xbf48('0x2f')]=_[_0xbf48('0x30')](_0x3ac1de['query']);_0x2e8454[_0xbf48('0x31')]=_[_0xbf48('0x32')](_0x2e8454[_0xbf48('0x2e')],_0x2e8454[_0xbf48('0x2f')]);_0x5b4b36[_0xbf48('0x33')]=_[_0xbf48('0x32')](_0x2e8454[_0xbf48('0x2e')],qs[_0xbf48('0x34')](_0x3ac1de['query'][_0xbf48('0x34')]));_0x5b4b36[_0xbf48('0x33')]=_0x5b4b36[_0xbf48('0x33')]['length']?_0x5b4b36[_0xbf48('0x33')]:_0x2e8454[_0xbf48('0x2e')];_0x5b4b36[_0xbf48('0x49')]=qs['sort'](_0x3ac1de['query']['sort']);_0x5b4b36[_0xbf48('0x39')]=qs['filters'](_['pick'](_0x3ac1de['query'],_0x2e8454['filters']));if(_0x3ac1de[_0xbf48('0x2f')][_0xbf48('0x38')]){_0x5b4b36[_0xbf48('0x39')]=_[_0xbf48('0x3a')](_0x5b4b36[_0xbf48('0x39')],{'$or':_['map'](_0x5b4b36['attributes'],function(_0x50f92c){var _0x84c709={};_0x84c709[_0x50f92c]={'$like':'%'+_0x3ac1de[_0xbf48('0x2f')][_0xbf48('0x38')]+'%'};return _0x84c709;})});}_0x5b4b36=_['merge']({},_0x5b4b36,_0x3ac1de[_0xbf48('0x42')]);return _0x4462f3[_0xbf48('0x4d')](_0x5b4b36);}})['then'](function(_0x4eef52){if(_0x4eef52){_0x442dd5=_0x4eef52[_0xbf48('0x41')];if(!_0x3ac1de[_0xbf48('0x2f')][_0xbf48('0x35')](_0xbf48('0x36'))){_0x5b4b36[_0xbf48('0x18')]=qs[_0xbf48('0x18')](_0x3ac1de[_0xbf48('0x2f')][_0xbf48('0x18')]);_0x5b4b36[_0xbf48('0x1a')]=qs[_0xbf48('0x1a')](_0x3ac1de[_0xbf48('0x2f')][_0xbf48('0x1a')]);}return _0x4462f3['getTags'](_0x5b4b36);}})[_0xbf48('0x21')](function(_0x141065){if(_0x141065){return _0x141065?{'count':_0x442dd5,'rows':_0x141065}:null;}})[_0xbf48('0x21')](respondWithResult(_0x51f9ec,null))[_0xbf48('0x3e')](handleError(_0x51f9ec,null));};exports[_0xbf48('0x4f')]=function(_0x52e15e,_0x526c0b,_0x23afa8){if(_0x52e15e[_0xbf48('0x45')]['id']){delete _0x52e15e[_0xbf48('0x45')]['id'];}return db['FreshdeskConfiguration'][_0xbf48('0x47')]({'where':{'id':_0x52e15e['params']['id']}})[_0xbf48('0x21')](handleEntityNotFound(_0x526c0b,null))[_0xbf48('0x21')](function(_0xe67fc4){if(_0xe67fc4){return _0xe67fc4[_0xbf48('0x4f')](_0x52e15e['body']['ids']||[]);}return null;})['then'](respondWithResult(_0x526c0b,null))[_0xbf48('0x3e')](handleError(_0x526c0b,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 9d5280b..27a104d 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 _0xe6c6=['path','rimraf','../../config/environment','exports','int_freshdesk_configurations','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x36e8bc,_0x35a0b4){var _0x4071ef=function(_0x404637){while(--_0x404637){_0x36e8bc['push'](_0x36e8bc['shift']());}};_0x4071ef(++_0x35a0b4);}(_0xe6c6,0x18b));var _0x6e6c=function(_0x458fc0,_0x3e7a67){_0x458fc0=_0x458fc0-0x0;var _0x3cc021=_0xe6c6[_0x458fc0];return _0x3cc021;};'use strict';var _=require(_0x6e6c('0x0'));var util=require('util');var logger=require(_0x6e6c('0x1'))(_0x6e6c('0x2'));var moment=require('moment');var BPromise=require(_0x6e6c('0x3'));var rp=require(_0x6e6c('0x4'));var fs=require('fs');var path=require(_0x6e6c('0x5'));var rimraf=require(_0x6e6c('0x6'));var config=require(_0x6e6c('0x7'));var attributes=require('./intFreshdeskConfiguration.attributes');module[_0x6e6c('0x8')]=function(_0x1b4280,_0x42884f){return _0x1b4280['define']('FreshdeskConfiguration',attributes,{'tableName':_0x6e6c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x717d=['rimraf','../../config/environment','exports','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x1b8e60,_0x21b885){var _0x363363=function(_0x5987c7){while(--_0x5987c7){_0x1b8e60['push'](_0x1b8e60['shift']());}};_0x363363(++_0x21b885);}(_0x717d,0x1ce));var _0xd717=function(_0x4b4b0e,_0x6c674){_0x4b4b0e=_0x4b4b0e-0x0;var _0x4c2d91=_0x717d[_0x4b4b0e];return _0x4c2d91;};'use strict';var _=require(_0xd717('0x0'));var util=require(_0xd717('0x1'));var logger=require(_0xd717('0x2'))(_0xd717('0x3'));var moment=require('moment');var BPromise=require(_0xd717('0x4'));var rp=require(_0xd717('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd717('0x6'));var config=require(_0xd717('0x7'));var attributes=require('./intFreshdeskConfiguration.attributes');module[_0xd717('0x8')]=function(_0x144b57,_0x20483f){return _0x144b57['define']('FreshdeskConfiguration',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 0644947..785ba27 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 _0x61af=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','../../config/utils'];(function(_0xfc2ee,_0x4882f8){var _0x493371=function(_0x14e72b){while(--_0x14e72b){_0xfc2ee['push'](_0xfc2ee['shift']());}};_0x493371(++_0x4882f8);}(_0x61af,0x80));var _0xf61a=function(_0x295a3d,_0x56d487){_0x295a3d=_0x295a3d-0x0;var _0x23a732=_0x61af[_0x295a3d];return _0x23a732;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf61a('0x0'));var BPromise=require(_0xf61a('0x1'));var rs=require(_0xf61a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf61a('0x3'));var logger=require(_0xf61a('0x4'))(_0xf61a('0x5'));var config=require(_0xf61a('0x6'));var jayson=require(_0xf61a('0x7'));var client=jayson[_0xf61a('0x8')][_0xf61a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x13ed2a,_0x225dd5,_0x57cadb){return new BPromise(function(_0x204433,_0x3e83f8){return client[_0xf61a('0xa')](_0x13ed2a,_0x57cadb)['then'](function(_0x4e8737){logger[_0xf61a('0xb')](_0xf61a('0xc'),_0x225dd5,_0xf61a('0xd'));logger[_0xf61a('0xe')](_0xf61a('0xf'),_0x225dd5,_0xf61a('0xd'),JSON[_0xf61a('0x10')](_0x4e8737));if(_0x4e8737[_0xf61a('0x11')]){if(_0x4e8737['error'][_0xf61a('0x12')]===0x1f4){logger[_0xf61a('0x11')](_0xf61a('0xc'),_0x225dd5,_0x4e8737[_0xf61a('0x11')][_0xf61a('0x13')]);return _0x3e83f8(_0x4e8737[_0xf61a('0x11')][_0xf61a('0x13')]);}logger[_0xf61a('0x11')](_0xf61a('0xc'),_0x225dd5,_0x4e8737[_0xf61a('0x11')][_0xf61a('0x13')]);return _0x204433(_0x4e8737['error'][_0xf61a('0x13')]);}else{logger[_0xf61a('0xb')](_0xf61a('0xc'),_0x225dd5,_0xf61a('0xd'));_0x204433(_0x4e8737[_0xf61a('0x14')][_0xf61a('0x13')]);}})[_0xf61a('0x15')](function(_0x2c7ae6){logger[_0xf61a('0x11')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x225dd5,_0x2c7ae6);_0x3e83f8(_0x2c7ae6);});});} \ No newline at end of file +var _0xf85a=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring'];(function(_0x2f64f3,_0x378ea8){var _0x56cc2e=function(_0x40c52a){while(--_0x40c52a){_0x2f64f3['push'](_0x2f64f3['shift']());}};_0x56cc2e(++_0x378ea8);}(_0xf85a,0x164));var _0xaf85=function(_0x3fcbd9,_0xc664d3){_0x3fcbd9=_0x3fcbd9-0x0;var _0x5e5a24=_0xf85a[_0x3fcbd9];return _0x5e5a24;};'use strict';var _=require(_0xaf85('0x0'));var util=require(_0xaf85('0x1'));var moment=require('moment');var BPromise=require(_0xaf85('0x2'));var rs=require(_0xaf85('0x3'));var fs=require('fs');var Redis=require(_0xaf85('0x4'));var db=require(_0xaf85('0x5'))['db'];var utils=require(_0xaf85('0x6'));var logger=require('../../config/logger')(_0xaf85('0x7'));var config=require(_0xaf85('0x8'));var jayson=require(_0xaf85('0x9'));var client=jayson[_0xaf85('0xa')][_0xaf85('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x49bd33,_0x5989c9,_0x2a1d2f){return new BPromise(function(_0x447ed4,_0x22cba4){return client[_0xaf85('0xc')](_0x49bd33,_0x2a1d2f)[_0xaf85('0xd')](function(_0x1a84ba){logger[_0xaf85('0xe')](_0xaf85('0xf'),_0x5989c9,_0xaf85('0x10'));logger[_0xaf85('0x11')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x5989c9,_0xaf85('0x10'),JSON[_0xaf85('0x12')](_0x1a84ba));if(_0x1a84ba[_0xaf85('0x13')]){if(_0x1a84ba[_0xaf85('0x13')][_0xaf85('0x14')]===0x1f4){logger[_0xaf85('0x13')](_0xaf85('0xf'),_0x5989c9,_0x1a84ba['error'][_0xaf85('0x15')]);return _0x22cba4(_0x1a84ba[_0xaf85('0x13')]['message']);}logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x5989c9,_0x1a84ba[_0xaf85('0x13')]['message']);return _0x447ed4(_0x1a84ba['error'][_0xaf85('0x15')]);}else{logger['info']('FreshdeskConfiguration,\x20%s,\x20%s',_0x5989c9,'request\x20sent');_0x447ed4(_0x1a84ba[_0xaf85('0x16')]['message']);}})[_0xaf85('0x17')](function(_0x35da43){logger[_0xaf85('0x13')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x5989c9,_0x35da43);_0x22cba4(_0x35da43);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 85fcf0b..b1f923c 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 _0xebee=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshdeskField.controller','get','isAuthenticated','index','/:id','show','create','update','delete','destroy','exports','multer','path','connect-timeout','express'];(function(_0x308213,_0x224541){var _0x2e1619=function(_0x972b51){while(--_0x972b51){_0x308213['push'](_0x308213['shift']());}};_0x2e1619(++_0x224541);}(_0xebee,0x1d7));var _0xeebe=function(_0xd8c450,_0x1a43a6){_0xd8c450=_0xd8c450-0x0;var _0x160797=_0xebee[_0xd8c450];return _0x160797;};'use strict';var multer=require(_0xeebe('0x0'));var util=require('util');var path=require(_0xeebe('0x1'));var timeout=require(_0xeebe('0x2'));var express=require(_0xeebe('0x3'));var router=express[_0xeebe('0x4')]();var fs_extra=require(_0xeebe('0x5'));var auth=require(_0xeebe('0x6'));var interaction=require(_0xeebe('0x7'));var config=require('../../config/environment');var controller=require(_0xeebe('0x8'));router[_0xeebe('0x9')]('/',auth[_0xeebe('0xa')](),controller[_0xeebe('0xb')]);router[_0xeebe('0x9')](_0xeebe('0xc'),auth['isAuthenticated'](),controller[_0xeebe('0xd')]);router['post']('/',auth[_0xeebe('0xa')](),controller[_0xeebe('0xe')]);router['put'](_0xeebe('0xc'),auth['isAuthenticated'](),controller[_0xeebe('0xf')]);router[_0xeebe('0x10')](_0xeebe('0xc'),auth[_0xeebe('0xa')](),controller[_0xeebe('0x11')]);module[_0xeebe('0x12')]=router; \ No newline at end of file +var _0xdcce=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','create','put','/:id','update','delete','exports','Router'];(function(_0x126767,_0x2cf58e){var _0x2dcc66=function(_0x3f16a3){while(--_0x3f16a3){_0x126767['push'](_0x126767['shift']());}};_0x2dcc66(++_0x2cf58e);}(_0xdcce,0x1a3));var _0xedcc=function(_0x56e559,_0x468f6b){_0x56e559=_0x56e559-0x0;var _0x598841=_0xdcce[_0x56e559];return _0x598841;};'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[_0xedcc('0x0')]();var fs_extra=require(_0xedcc('0x1'));var auth=require(_0xedcc('0x2'));var interaction=require(_0xedcc('0x3'));var config=require(_0xedcc('0x4'));var controller=require('./intFreshdeskField.controller');router[_0xedcc('0x5')]('/',auth[_0xedcc('0x6')](),controller[_0xedcc('0x7')]);router[_0xedcc('0x5')]('/:id',auth[_0xedcc('0x6')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xedcc('0x8')]);router[_0xedcc('0x9')](_0xedcc('0xa'),auth[_0xedcc('0x6')](),controller[_0xedcc('0xb')]);router[_0xedcc('0xc')](_0xedcc('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0xedcc('0xd')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 337115c..2bf2a8a 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 _0x4d4a=['sequelize','exports','string','variable','customVariable','keyValue','STRING','BOOLEAN'];(function(_0x5b98b6,_0xfd2b69){var _0x2d4242=function(_0x4d7947){while(--_0x4d7947){_0x5b98b6['push'](_0x5b98b6['shift']());}};_0x2d4242(++_0xfd2b69);}(_0x4d4a,0x1b0));var _0xa4d4=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4d4a[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xa4d4('0x0'));module[_0xa4d4('0x1')]={'type':{'type':Sequelize['ENUM'](_0xa4d4('0x2'),_0xa4d4('0x3'),_0xa4d4('0x4'),_0xa4d4('0x5'),'picklist'),'defaultValue':_0xa4d4('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xa4d4('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0xa4d4('0x2'),_0xa4d4('0x3'),_0xa4d4('0x4'))},'keyContent':{'type':Sequelize[_0xa4d4('0x6')]},'idField':{'type':Sequelize[_0xa4d4('0x6')]},'nameField':{'type':Sequelize[_0xa4d4('0x6')]},'customField':{'type':Sequelize[_0xa4d4('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x3983=['exports','ENUM','variable','customVariable','keyValue','picklist','STRING','string','sequelize'];(function(_0x368fb9,_0x1a9895){var _0x4892fb=function(_0x28d735){while(--_0x28d735){_0x368fb9['push'](_0x368fb9['shift']());}};_0x4892fb(++_0x1a9895);}(_0x3983,0x170));var _0x3398=function(_0x53892b,_0x36b6b1){_0x53892b=_0x53892b-0x0;var _0x216eb1=_0x3983[_0x53892b];return _0x216eb1;};'use strict';var Sequelize=require(_0x3398('0x0'));module[_0x3398('0x1')]={'type':{'type':Sequelize[_0x3398('0x2')]('string',_0x3398('0x3'),_0x3398('0x4'),_0x3398('0x5'),_0x3398('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x3398('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x3398('0x2')](_0x3398('0x8'),_0x3398('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x3398('0x7')]},'idField':{'type':Sequelize[_0x3398('0x7')]},'nameField':{'type':Sequelize[_0x3398('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3398('0x7')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 5a97c8d..0cdd257 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 _0x1339=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','json','undefined','limit','offset','Content-Range','then','destroy','end','sendStatus','error','name','send','index','map','FreshdeskField','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','keys','rawAttributes','create','body','update','params','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x47e549,_0x2e53d6){var _0x251374=function(_0x400458){while(--_0x400458){_0x47e549['push'](_0x47e549['shift']());}};_0x251374(++_0x2e53d6);}(_0x1339,0x1ed));var _0x9133=function(_0x584ba1,_0x3093e4){_0x584ba1=_0x584ba1-0x0;var _0x1fc384=_0x1339[_0x584ba1];return _0x1fc384;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9133('0x0'));var jsonpatch=require(_0x9133('0x1'));var rp=require(_0x9133('0x2'));var moment=require(_0x9133('0x3'));var BPromise=require(_0x9133('0x4'));var Mustache=require(_0x9133('0x5'));var util=require(_0x9133('0x6'));var path=require(_0x9133('0x7'));var sox=require('sox');var csv=require(_0x9133('0x8'));var ejs=require(_0x9133('0x9'));var fs=require('fs');var fs_extra=require(_0x9133('0xa'));var _=require('lodash');var squel=require(_0x9133('0xb'));var crypto=require(_0x9133('0xc'));var jsforce=require(_0x9133('0xd'));var deskjs=require(_0x9133('0xe'));var toCsv=require(_0x9133('0x8'));var querystring=require(_0x9133('0xf'));var Papa=require(_0x9133('0x10'));var Redis=require(_0x9133('0x11'));var authService=require(_0x9133('0x12'));var qs=require(_0x9133('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9133('0x14'));var logger=require(_0x9133('0x15'))(_0x9133('0x16'));var utils=require(_0x9133('0x17'));var config=require(_0x9133('0x18'));var licenseUtil=require(_0x9133('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb64550,_0x7cc59e){_0x7cc59e=_0x7cc59e||0xcc;return function(_0x4bbfdc){if(_0x4bbfdc){return _0xb64550['sendStatus'](_0x7cc59e);}return _0xb64550[_0x9133('0x1a')](_0x7cc59e)['end']();};}function respondWithResult(_0x22132a,_0x439e1a){_0x439e1a=_0x439e1a||0xc8;return function(_0x17dfd1){if(_0x17dfd1){return _0x22132a[_0x9133('0x1a')](_0x439e1a)[_0x9133('0x1b')](_0x17dfd1);}};}function respondWithFilteredResult(_0x4327b3,_0x49cc5d){return function(_0x13f8fc){if(_0x13f8fc){var _0x1e23ce=typeof _0x49cc5d['offset']===_0x9133('0x1c')&&typeof _0x49cc5d[_0x9133('0x1d')]===_0x9133('0x1c');var _0x427663=_0x13f8fc['count'];var _0x1f3484=_0x1e23ce?0x0:_0x49cc5d['offset'];var _0x3c48ef=_0x1e23ce?_0x13f8fc['count']:_0x49cc5d[_0x9133('0x1e')]+_0x49cc5d[_0x9133('0x1d')];var _0x5e8620;if(_0x3c48ef>=_0x427663){_0x3c48ef=_0x427663;_0x5e8620=0xc8;}else{_0x5e8620=0xce;}_0x4327b3[_0x9133('0x1a')](_0x5e8620);return _0x4327b3['set'](_0x9133('0x1f'),_0x1f3484+'-'+_0x3c48ef+'/'+_0x427663)['json'](_0x13f8fc);}return null;};}function patchUpdates(_0x5e4f0c){return function(_0x2f7354){try{jsonpatch['apply'](_0x2f7354,_0x5e4f0c,!![]);}catch(_0x12c2d4){return BPromise['reject'](_0x12c2d4);}return _0x2f7354['save']();};}function saveUpdates(_0x4c846e,_0x2e99a1){return function(_0x2dcfb8){if(_0x2dcfb8){return _0x2dcfb8['update'](_0x4c846e)[_0x9133('0x20')](function(_0x3f5d0e){return _0x3f5d0e;});}return null;};}function removeEntity(_0xff08d5,_0x26190c){return function(_0x4f26e8){if(_0x4f26e8){return _0x4f26e8[_0x9133('0x21')]()['then'](function(){_0xff08d5[_0x9133('0x1a')](0xcc)[_0x9133('0x22')]();});}};}function handleEntityNotFound(_0x3f278d,_0x14c1cb){return function(_0x4483ef){if(!_0x4483ef){_0x3f278d[_0x9133('0x23')](0x194);}return _0x4483ef;};}function handleError(_0x294332,_0x313d43){_0x313d43=_0x313d43||0x1f4;return function(_0x1b6b3e){logger[_0x9133('0x24')](_0x1b6b3e['stack']);if(_0x1b6b3e['name']){delete _0x1b6b3e[_0x9133('0x25')];}_0x294332[_0x9133('0x1a')](_0x313d43)[_0x9133('0x26')](_0x1b6b3e);};}exports[_0x9133('0x27')]=function(_0x4de894,_0x4ecd9e){var _0x3e2404={},_0x45966d={},_0x188c49={'count':0x0,'rows':[]};var _0x26d351=_[_0x9133('0x28')](db[_0x9133('0x29')]['rawAttributes'],function(_0x58afe0){return{'name':_0x58afe0['fieldName'],'type':_0x58afe0[_0x9133('0x2a')]['key']};});_0x45966d[_0x9133('0x2b')]=_[_0x9133('0x28')](_0x26d351,'name');_0x45966d[_0x9133('0x2c')]=_['keys'](_0x4de894[_0x9133('0x2c')]);_0x45966d[_0x9133('0x2d')]=_[_0x9133('0x2e')](_0x45966d['model'],_0x45966d[_0x9133('0x2c')]);_0x3e2404[_0x9133('0x2f')]=_[_0x9133('0x2e')](_0x45966d['model'],qs[_0x9133('0x30')](_0x4de894[_0x9133('0x2c')][_0x9133('0x30')]));_0x3e2404['attributes']=_0x3e2404[_0x9133('0x2f')][_0x9133('0x31')]?_0x3e2404[_0x9133('0x2f')]:_0x45966d[_0x9133('0x2b')];if(!_0x4de894['query'][_0x9133('0x32')](_0x9133('0x33'))){_0x3e2404['limit']=qs[_0x9133('0x1d')](_0x4de894[_0x9133('0x2c')][_0x9133('0x1d')]);_0x3e2404[_0x9133('0x1e')]=qs[_0x9133('0x1e')](_0x4de894[_0x9133('0x2c')][_0x9133('0x1e')]);}_0x3e2404[_0x9133('0x34')]=qs[_0x9133('0x35')](_0x4de894[_0x9133('0x2c')][_0x9133('0x35')]);_0x3e2404['where']=qs[_0x9133('0x2d')](_[_0x9133('0x36')](_0x4de894['query'],_0x45966d[_0x9133('0x2d')]),_0x26d351);if(_0x4de894[_0x9133('0x2c')][_0x9133('0x37')]){_0x3e2404[_0x9133('0x38')]=_[_0x9133('0x39')](_0x3e2404[_0x9133('0x38')],{'$or':_['map'](_0x26d351,function(_0x4e16d2){if(_0x4e16d2[_0x9133('0x2a')]!==_0x9133('0x3a')){var _0x156905={};_0x156905[_0x4e16d2[_0x9133('0x25')]]={'$like':'%'+_0x4de894[_0x9133('0x2c')][_0x9133('0x37')]+'%'};return _0x156905;}})});}_0x3e2404=_[_0x9133('0x39')]({},_0x3e2404,_0x4de894[_0x9133('0x3b')]);var _0x720048={'where':_0x3e2404['where']};return db[_0x9133('0x29')][_0x9133('0x3c')](_0x720048)[_0x9133('0x20')](function(_0x199ae9){_0x188c49[_0x9133('0x3c')]=_0x199ae9;if(_0x4de894['query'][_0x9133('0x3d')]){_0x3e2404[_0x9133('0x3e')]=[{'all':!![]}];}return db[_0x9133('0x29')][_0x9133('0x3f')](_0x3e2404);})['then'](function(_0x146734){_0x188c49[_0x9133('0x40')]=_0x146734;return _0x188c49;})[_0x9133('0x20')](respondWithFilteredResult(_0x4ecd9e,_0x3e2404))[_0x9133('0x41')](handleError(_0x4ecd9e,null));};exports[_0x9133('0x42')]=function(_0x338049,_0x3b2287){var _0x4ca1a3={'raw':!![],'where':{'id':_0x338049['params']['id']}},_0x7f6cd9={};_0x7f6cd9['model']=_[_0x9133('0x43')](db[_0x9133('0x29')][_0x9133('0x44')]);_0x7f6cd9[_0x9133('0x2c')]=_[_0x9133('0x43')](_0x338049[_0x9133('0x2c')]);_0x7f6cd9[_0x9133('0x2d')]=_[_0x9133('0x2e')](_0x7f6cd9[_0x9133('0x2b')],_0x7f6cd9['query']);_0x4ca1a3[_0x9133('0x2f')]=_[_0x9133('0x2e')](_0x7f6cd9[_0x9133('0x2b')],qs['fields'](_0x338049['query'][_0x9133('0x30')]));_0x4ca1a3[_0x9133('0x2f')]=_0x4ca1a3['attributes'][_0x9133('0x31')]?_0x4ca1a3[_0x9133('0x2f')]:_0x7f6cd9[_0x9133('0x2b')];if(_0x338049[_0x9133('0x2c')][_0x9133('0x3d')]){_0x4ca1a3['include']=[{'all':!![]}];}_0x4ca1a3=_[_0x9133('0x39')]({},_0x4ca1a3,_0x338049[_0x9133('0x3b')]);return db[_0x9133('0x29')]['find'](_0x4ca1a3)[_0x9133('0x20')](handleEntityNotFound(_0x3b2287,null))[_0x9133('0x20')](respondWithResult(_0x3b2287,null))['catch'](handleError(_0x3b2287,null));};exports['create']=function(_0x42c188,_0x2cd935){return db[_0x9133('0x29')][_0x9133('0x45')](_0x42c188[_0x9133('0x46')],{})[_0x9133('0x20')](respondWithResult(_0x2cd935,0xc9))[_0x9133('0x41')](handleError(_0x2cd935,null));};exports[_0x9133('0x47')]=function(_0x23f134,_0xf07fbb){if(_0x23f134[_0x9133('0x46')]['id']){delete _0x23f134[_0x9133('0x46')]['id'];}return db['FreshdeskField']['find']({'where':{'id':_0x23f134[_0x9133('0x48')]['id']}})['then'](handleEntityNotFound(_0xf07fbb,null))[_0x9133('0x20')](saveUpdates(_0x23f134[_0x9133('0x46')],null))[_0x9133('0x20')](respondWithResult(_0xf07fbb,null))[_0x9133('0x41')](handleError(_0xf07fbb,null));};exports['destroy']=function(_0x2a3848,_0x25750f){return db[_0x9133('0x29')]['find']({'where':{'id':_0x2a3848[_0x9133('0x48')]['id']}})[_0x9133('0x20')](handleEntityNotFound(_0x25750f,null))[_0x9133('0x20')](removeEntity(_0x25750f,null))['catch'](handleError(_0x25750f,null));}; \ No newline at end of file +var _0xe130=['includeAll','include','findAll','show','params','keys','length','find','catch','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','destroy','then','error','stack','name','send','map','FreshdeskField','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options'];(function(_0x132d12,_0x2c9799){var _0x1c3163=function(_0x7d9136){while(--_0x7d9136){_0x132d12['push'](_0x132d12['shift']());}};_0x1c3163(++_0x2c9799);}(_0xe130,0x127));var _0x0e13=function(_0x39e832,_0x1c18b5){_0x39e832=_0x39e832-0x0;var _0xe7b968=_0xe130[_0x39e832];return _0xe7b968;};'use strict';var emlformat=require(_0x0e13('0x0'));var rimraf=require(_0x0e13('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0e13('0x2'));var rp=require(_0x0e13('0x3'));var moment=require(_0x0e13('0x4'));var BPromise=require(_0x0e13('0x5'));var Mustache=require(_0x0e13('0x6'));var util=require('util');var path=require(_0x0e13('0x7'));var sox=require(_0x0e13('0x8'));var csv=require(_0x0e13('0x9'));var ejs=require(_0x0e13('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0e13('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0e13('0xc'));var toCsv=require(_0x0e13('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0e13('0xd'));var authService=require(_0x0e13('0xe'));var qs=require(_0x0e13('0xf'));var as=require(_0x0e13('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0e13('0x11'));var utils=require(_0x0e13('0x12'));var config=require(_0x0e13('0x13'));var licenseUtil=require(_0x0e13('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1b4391,_0x4d9ea0){_0x4d9ea0=_0x4d9ea0||0xcc;return function(_0x2ef77e){if(_0x2ef77e){return _0x1b4391[_0x0e13('0x15')](_0x4d9ea0);}return _0x1b4391[_0x0e13('0x16')](_0x4d9ea0)[_0x0e13('0x17')]();};}function respondWithResult(_0x2f0d82,_0x1ec6ad){_0x1ec6ad=_0x1ec6ad||0xc8;return function(_0x27c3cf){if(_0x27c3cf){return _0x2f0d82[_0x0e13('0x16')](_0x1ec6ad)[_0x0e13('0x18')](_0x27c3cf);}};}function respondWithFilteredResult(_0x530f82,_0x302763){return function(_0xbc1617){if(_0xbc1617){var _0x2057fe=typeof _0x302763[_0x0e13('0x19')]===_0x0e13('0x1a')&&typeof _0x302763[_0x0e13('0x1b')]==='undefined';var _0x11ec50=_0xbc1617[_0x0e13('0x1c')];var _0x510a2b=_0x2057fe?0x0:_0x302763['offset'];var _0x3b85fd=_0x2057fe?_0xbc1617['count']:_0x302763[_0x0e13('0x19')]+_0x302763['limit'];var _0x294aea;if(_0x3b85fd>=_0x11ec50){_0x3b85fd=_0x11ec50;_0x294aea=0xc8;}else{_0x294aea=0xce;}_0x530f82[_0x0e13('0x16')](_0x294aea);return _0x530f82[_0x0e13('0x1d')](_0x0e13('0x1e'),_0x510a2b+'-'+_0x3b85fd+'/'+_0x11ec50)[_0x0e13('0x18')](_0xbc1617);}return null;};}function patchUpdates(_0x5ef062){return function(_0x5cfba8){try{jsonpatch['apply'](_0x5cfba8,_0x5ef062,!![]);}catch(_0x2dddef){return BPromise[_0x0e13('0x1f')](_0x2dddef);}return _0x5cfba8['save']();};}function saveUpdates(_0x515222,_0x295eb0){return function(_0x296ed3){if(_0x296ed3){return _0x296ed3[_0x0e13('0x20')](_0x515222)['then'](function(_0x400e87){return _0x400e87;});}return null;};}function removeEntity(_0x70c3db,_0x22cc15){return function(_0x20303b){if(_0x20303b){return _0x20303b[_0x0e13('0x21')]()[_0x0e13('0x22')](function(){_0x70c3db[_0x0e13('0x16')](0xcc)[_0x0e13('0x17')]();});}};}function handleEntityNotFound(_0x3d6abf,_0x260bf7){return function(_0x9621e2){if(!_0x9621e2){_0x3d6abf[_0x0e13('0x15')](0x194);}return _0x9621e2;};}function handleError(_0x230684,_0x45edf7){_0x45edf7=_0x45edf7||0x1f4;return function(_0xfd19ed){logger[_0x0e13('0x23')](_0xfd19ed[_0x0e13('0x24')]);if(_0xfd19ed['name']){delete _0xfd19ed[_0x0e13('0x25')];}_0x230684[_0x0e13('0x16')](_0x45edf7)[_0x0e13('0x26')](_0xfd19ed);};}exports['index']=function(_0x2182ae,_0x1deb3b){var _0xa38940={},_0x4606de={},_0x5d41c3={'count':0x0,'rows':[]};var _0xe9151f=_[_0x0e13('0x27')](db[_0x0e13('0x28')][_0x0e13('0x29')],function(_0x2e65e2){return{'name':_0x2e65e2[_0x0e13('0x2a')],'type':_0x2e65e2[_0x0e13('0x2b')][_0x0e13('0x2c')]};});_0x4606de['model']=_[_0x0e13('0x27')](_0xe9151f,_0x0e13('0x25'));_0x4606de[_0x0e13('0x2d')]=_['keys'](_0x2182ae[_0x0e13('0x2d')]);_0x4606de[_0x0e13('0x2e')]=_[_0x0e13('0x2f')](_0x4606de[_0x0e13('0x30')],_0x4606de[_0x0e13('0x2d')]);_0xa38940[_0x0e13('0x31')]=_[_0x0e13('0x2f')](_0x4606de[_0x0e13('0x30')],qs[_0x0e13('0x32')](_0x2182ae['query'][_0x0e13('0x32')]));_0xa38940[_0x0e13('0x31')]=_0xa38940[_0x0e13('0x31')]['length']?_0xa38940[_0x0e13('0x31')]:_0x4606de['model'];if(!_0x2182ae[_0x0e13('0x2d')][_0x0e13('0x33')](_0x0e13('0x34'))){_0xa38940[_0x0e13('0x1b')]=qs[_0x0e13('0x1b')](_0x2182ae[_0x0e13('0x2d')][_0x0e13('0x1b')]);_0xa38940['offset']=qs['offset'](_0x2182ae[_0x0e13('0x2d')][_0x0e13('0x19')]);}_0xa38940[_0x0e13('0x35')]=qs[_0x0e13('0x36')](_0x2182ae[_0x0e13('0x2d')][_0x0e13('0x36')]);_0xa38940[_0x0e13('0x37')]=qs['filters'](_[_0x0e13('0x38')](_0x2182ae[_0x0e13('0x2d')],_0x4606de[_0x0e13('0x2e')]),_0xe9151f);if(_0x2182ae[_0x0e13('0x2d')][_0x0e13('0x39')]){_0xa38940['where']=_[_0x0e13('0x3a')](_0xa38940[_0x0e13('0x37')],{'$or':_[_0x0e13('0x27')](_0xe9151f,function(_0x4b17f2){if(_0x4b17f2[_0x0e13('0x2b')]!=='VIRTUAL'){var _0x33af9a={};_0x33af9a[_0x4b17f2['name']]={'$like':'%'+_0x2182ae[_0x0e13('0x2d')]['filter']+'%'};return _0x33af9a;}})});}_0xa38940=_[_0x0e13('0x3a')]({},_0xa38940,_0x2182ae[_0x0e13('0x3b')]);var _0x3cdc25={'where':_0xa38940[_0x0e13('0x37')]};return db[_0x0e13('0x28')][_0x0e13('0x1c')](_0x3cdc25)['then'](function(_0x445949){_0x5d41c3[_0x0e13('0x1c')]=_0x445949;if(_0x2182ae[_0x0e13('0x2d')][_0x0e13('0x3c')]){_0xa38940[_0x0e13('0x3d')]=[{'all':!![]}];}return db[_0x0e13('0x28')][_0x0e13('0x3e')](_0xa38940);})['then'](function(_0x164720){_0x5d41c3['rows']=_0x164720;return _0x5d41c3;})['then'](respondWithFilteredResult(_0x1deb3b,_0xa38940))['catch'](handleError(_0x1deb3b,null));};exports[_0x0e13('0x3f')]=function(_0xe6bb04,_0x3060e1){var _0x14ab2a={'raw':!![],'where':{'id':_0xe6bb04[_0x0e13('0x40')]['id']}},_0x3ee751={};_0x3ee751[_0x0e13('0x30')]=_['keys'](db[_0x0e13('0x28')]['rawAttributes']);_0x3ee751['query']=_[_0x0e13('0x41')](_0xe6bb04[_0x0e13('0x2d')]);_0x3ee751[_0x0e13('0x2e')]=_[_0x0e13('0x2f')](_0x3ee751['model'],_0x3ee751[_0x0e13('0x2d')]);_0x14ab2a[_0x0e13('0x31')]=_['intersection'](_0x3ee751[_0x0e13('0x30')],qs[_0x0e13('0x32')](_0xe6bb04[_0x0e13('0x2d')][_0x0e13('0x32')]));_0x14ab2a[_0x0e13('0x31')]=_0x14ab2a[_0x0e13('0x31')][_0x0e13('0x42')]?_0x14ab2a[_0x0e13('0x31')]:_0x3ee751[_0x0e13('0x30')];if(_0xe6bb04[_0x0e13('0x2d')]['includeAll']){_0x14ab2a['include']=[{'all':!![]}];}_0x14ab2a=_[_0x0e13('0x3a')]({},_0x14ab2a,_0xe6bb04[_0x0e13('0x3b')]);return db[_0x0e13('0x28')][_0x0e13('0x43')](_0x14ab2a)[_0x0e13('0x22')](handleEntityNotFound(_0x3060e1,null))['then'](respondWithResult(_0x3060e1,null))[_0x0e13('0x44')](handleError(_0x3060e1,null));};exports[_0x0e13('0x45')]=function(_0x30b637,_0x548259){return db[_0x0e13('0x28')]['create'](_0x30b637[_0x0e13('0x46')],{})[_0x0e13('0x22')](respondWithResult(_0x548259,0xc9))[_0x0e13('0x44')](handleError(_0x548259,null));};exports[_0x0e13('0x20')]=function(_0x35249c,_0x47e5b8){if(_0x35249c[_0x0e13('0x46')]['id']){delete _0x35249c['body']['id'];}return db[_0x0e13('0x28')][_0x0e13('0x43')]({'where':{'id':_0x35249c['params']['id']}})[_0x0e13('0x22')](handleEntityNotFound(_0x47e5b8,null))[_0x0e13('0x22')](saveUpdates(_0x35249c[_0x0e13('0x46')],null))[_0x0e13('0x22')](respondWithResult(_0x47e5b8,null))['catch'](handleError(_0x47e5b8,null));};exports[_0x0e13('0x21')]=function(_0x359de5,_0x4d9afd){return db[_0x0e13('0x28')]['find']({'where':{'id':_0x359de5['params']['id']}})['then'](handleEntityNotFound(_0x4d9afd,null))[_0x0e13('0x22')](removeEntity(_0x4d9afd,null))['catch'](handleError(_0x4d9afd,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 634c61d..53b2a79 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 _0x500a=['define','FreshdeskField','int_freshdesk_fields','FieldId','util','api','request-promise','path','rimraf','../../config/environment'];(function(_0x5642bd,_0x5dbcc2){var _0x366ca1=function(_0x15bfdb){while(--_0x15bfdb){_0x5642bd['push'](_0x5642bd['shift']());}};_0x366ca1(++_0x5dbcc2);}(_0x500a,0xd6));var _0xa500=function(_0x4f8045,_0x2b908a){_0x4f8045=_0x4f8045-0x0;var _0x52721a=_0x500a[_0x4f8045];return _0x52721a;};'use strict';var _=require('lodash');var util=require(_0xa500('0x0'));var logger=require('../../config/logger')(_0xa500('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa500('0x2'));var fs=require('fs');var path=require(_0xa500('0x3'));var rimraf=require(_0xa500('0x4'));var config=require(_0xa500('0x5'));var attributes=require('./intFreshdeskField.attributes');module['exports']=function(_0x340329,_0x4333a3){return _0x340329[_0xa500('0x6')](_0xa500('0x7'),attributes,{'tableName':_0xa500('0x8'),'paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':['idField',_0xa500('0x9')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7ee1=['FreshdeskField','freshdesk_unique_index','FieldId','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','exports','define'];(function(_0x14ac9e,_0x443c98){var _0x455527=function(_0x43c0bc){while(--_0x43c0bc){_0x14ac9e['push'](_0x14ac9e['shift']());}};_0x455527(++_0x443c98);}(_0x7ee1,0xab));var _0x17ee=function(_0x57046e,_0x146098){_0x57046e=_0x57046e-0x0;var _0xef13ef=_0x7ee1[_0x57046e];return _0xef13ef;};'use strict';var _=require(_0x17ee('0x0'));var util=require('util');var logger=require(_0x17ee('0x1'))(_0x17ee('0x2'));var moment=require(_0x17ee('0x3'));var BPromise=require(_0x17ee('0x4'));var rp=require(_0x17ee('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x17ee('0x6'));var config=require('../../config/environment');var attributes=require('./intFreshdeskField.attributes');module[_0x17ee('0x7')]=function(_0x2e4db0,_0x2efefb){return _0x2e4db0[_0x17ee('0x8')](_0x17ee('0x9'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0x17ee('0xa'),'fields':['idField',_0x17ee('0xb')],'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 b7239d0..095c471 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 _0x7672=['../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','FreshdeskField,\x20%s,\x20%s','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','moment','bluebird','../../mysqldb'];(function(_0xc5a1a2,_0x49df81){var _0x5d3fe6=function(_0x3d443d){while(--_0x3d443d){_0xc5a1a2['push'](_0xc5a1a2['shift']());}};_0x5d3fe6(++_0x49df81);}(_0x7672,0x89));var _0x2767=function(_0x3876eb,_0x36715a){_0x3876eb=_0x3876eb-0x0;var _0x1e901b=_0x7672[_0x3876eb];return _0x1e901b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2767('0x0'));var BPromise=require(_0x2767('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2767('0x2'))['db'];var utils=require(_0x2767('0x3'));var logger=require(_0x2767('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2767('0x5'));var client=jayson[_0x2767('0x6')][_0x2767('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x31e6b9,_0x23fbd3,_0x23aeb7){return new BPromise(function(_0x3d9e6e,_0x5b4aba){return client[_0x2767('0x8')](_0x31e6b9,_0x23aeb7)[_0x2767('0x9')](function(_0x16c69d){logger[_0x2767('0xa')](_0x2767('0xb'),_0x23fbd3,'request\x20sent');logger[_0x2767('0xc')](_0x2767('0xd'),_0x23fbd3,_0x2767('0xe'),JSON[_0x2767('0xf')](_0x16c69d));if(_0x16c69d[_0x2767('0x10')]){if(_0x16c69d['error'][_0x2767('0x11')]===0x1f4){logger[_0x2767('0x10')](_0x2767('0xb'),_0x23fbd3,_0x16c69d[_0x2767('0x10')][_0x2767('0x12')]);return _0x5b4aba(_0x16c69d['error'][_0x2767('0x12')]);}logger[_0x2767('0x10')]('FreshdeskField,\x20%s,\x20%s',_0x23fbd3,_0x16c69d['error'][_0x2767('0x12')]);return _0x3d9e6e(_0x16c69d[_0x2767('0x10')][_0x2767('0x12')]);}else{logger[_0x2767('0xa')](_0x2767('0xb'),_0x23fbd3,_0x2767('0xe'));_0x3d9e6e(_0x16c69d[_0x2767('0x13')][_0x2767('0x12')]);}})['catch'](function(_0x2a098c){logger[_0x2767('0x10')](_0x2767('0xb'),_0x23fbd3,_0x2a098c);_0x5b4aba(_0x2a098c);});});} \ No newline at end of file +var _0xc719=['message','FreshdeskField,\x20%s,\x20%s','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','request\x20sent','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x426b1b,_0x3f07fd){var _0x329fc7=function(_0x237cb1){while(--_0x237cb1){_0x426b1b['push'](_0x426b1b['shift']());}};_0x329fc7(++_0x3f07fd);}(_0xc719,0x180));var _0x9c71=function(_0x349915,_0x124261){_0x349915=_0x349915-0x0;var _0x8be4f3=_0xc719[_0x349915];return _0x8be4f3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9c71('0x0'));var BPromise=require(_0x9c71('0x1'));var rs=require(_0x9c71('0x2'));var fs=require('fs');var Redis=require(_0x9c71('0x3'));var db=require(_0x9c71('0x4'))['db'];var utils=require(_0x9c71('0x5'));var logger=require(_0x9c71('0x6'))(_0x9c71('0x7'));var config=require('../../config/environment');var jayson=require(_0x9c71('0x8'));var client=jayson['client'][_0x9c71('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3686c9,_0x5ad214,_0x29a633){return new BPromise(function(_0x142eb8,_0x1aebc9){return client['request'](_0x3686c9,_0x29a633)[_0x9c71('0xa')](function(_0x59a08e){logger['info']('FreshdeskField,\x20%s,\x20%s',_0x5ad214,_0x9c71('0xb'));logger['debug'](_0x9c71('0xc'),_0x5ad214,_0x9c71('0xb'),JSON[_0x9c71('0xd')](_0x59a08e));if(_0x59a08e[_0x9c71('0xe')]){if(_0x59a08e[_0x9c71('0xe')][_0x9c71('0xf')]===0x1f4){logger[_0x9c71('0xe')]('FreshdeskField,\x20%s,\x20%s',_0x5ad214,_0x59a08e['error']['message']);return _0x1aebc9(_0x59a08e[_0x9c71('0xe')][_0x9c71('0x10')]);}logger[_0x9c71('0xe')](_0x9c71('0x11'),_0x5ad214,_0x59a08e[_0x9c71('0xe')]['message']);return _0x142eb8(_0x59a08e[_0x9c71('0xe')][_0x9c71('0x10')]);}else{logger['info'](_0x9c71('0x11'),_0x5ad214,_0x9c71('0xb'));_0x142eb8(_0x59a08e[_0x9c71('0x12')][_0x9c71('0x10')]);}})[_0x9c71('0x13')](function(_0x1ce309){logger[_0x9c71('0xe')]('FreshdeskField,\x20%s,\x20%s',_0x5ad214,_0x1ce309);_0x1aebc9(_0x1ce309);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index f335697..fb9bbd9 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 _0x96cc=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','/:id/fields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','path','express','Router'];(function(_0x4cebcc,_0x56253e){var _0x4d1669=function(_0x89e326){while(--_0x89e326){_0x4cebcc['push'](_0x4cebcc['shift']());}};_0x4d1669(++_0x56253e);}(_0x96cc,0x16c));var _0xc96c=function(_0x32e8f2,_0x33cff3){_0x32e8f2=_0x32e8f2-0x0;var _0xefd2e6=_0x96cc[_0x32e8f2];return _0xefd2e6;};'use strict';var multer=require(_0xc96c('0x0'));var util=require('util');var path=require(_0xc96c('0x1'));var timeout=require('connect-timeout');var express=require(_0xc96c('0x2'));var router=express[_0xc96c('0x3')]();var fs_extra=require(_0xc96c('0x4'));var auth=require(_0xc96c('0x5'));var interaction=require(_0xc96c('0x6'));var config=require(_0xc96c('0x7'));var controller=require(_0xc96c('0x8'));router[_0xc96c('0x9')]('/',auth[_0xc96c('0xa')](),controller['index']);router[_0xc96c('0x9')](_0xc96c('0xb'),auth[_0xc96c('0xa')](),controller[_0xc96c('0xc')]);router[_0xc96c('0x9')](_0xc96c('0xd'),auth[_0xc96c('0xa')](),controller['getConfigurations']);router[_0xc96c('0x9')](_0xc96c('0xe'),auth[_0xc96c('0xa')](),controller['getFields']);router[_0xc96c('0xf')]('/',auth['isAuthenticated'](),controller[_0xc96c('0x10')]);router['post'](_0xc96c('0xd'),auth[_0xc96c('0xa')](),controller[_0xc96c('0x11')]);router[_0xc96c('0x12')]('/:id',auth[_0xc96c('0xa')](),controller[_0xc96c('0x13')]);router[_0xc96c('0x14')](_0xc96c('0xb'),auth['isAuthenticated'](),controller[_0xc96c('0x15')]);module[_0xc96c('0x16')]=router; \ No newline at end of file +var _0xe1e3=['get','isAuthenticated','index','/:id','show','/:id/configurations','post','create','update','destroy','exports','multer','util','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xe1e3,0x1bb));var _0x3e1e=function(_0x546ac1,_0x299ca0){_0x546ac1=_0x546ac1-0x0;var _0x598e74=_0xe1e3[_0x546ac1];return _0x598e74;};'use strict';var multer=require(_0x3e1e('0x0'));var util=require(_0x3e1e('0x1'));var path=require('path');var timeout=require(_0x3e1e('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3e1e('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x3e1e('0x4'));var config=require(_0x3e1e('0x5'));var controller=require(_0x3e1e('0x6'));router[_0x3e1e('0x7')]('/',auth[_0x3e1e('0x8')](),controller[_0x3e1e('0x9')]);router['get'](_0x3e1e('0xa'),auth[_0x3e1e('0x8')](),controller[_0x3e1e('0xb')]);router[_0x3e1e('0x7')](_0x3e1e('0xc'),auth[_0x3e1e('0x8')](),controller['getConfigurations']);router['get']('/:id/fields',auth[_0x3e1e('0x8')](),controller['getFields']);router[_0x3e1e('0xd')]('/',auth[_0x3e1e('0x8')](),controller[_0x3e1e('0xe')]);router['post'](_0x3e1e('0xc'),auth['isAuthenticated'](),controller['addConfiguration']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x3e1e('0xf')]);router['delete']('/:id',auth[_0x3e1e('0x8')](),controller[_0x3e1e('0x10')]);module[_0x3e1e('0x11')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index ae9c65d..d2fd4b9 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 _0x93e9=['sequelize','exports','STRING','username'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x93e9,0xcc));var _0x993e=function(_0x4c8700,_0x25e672){_0x4c8700=_0x4c8700-0x0;var _0x16dcaa=_0x93e9[_0x4c8700];return _0x16dcaa;};'use strict';var Sequelize=require(_0x993e('0x0'));module[_0x993e('0x1')]={'name':{'type':Sequelize[_0x993e('0x2')]},'description':{'type':Sequelize[_0x993e('0x2')]},'username':{'type':Sequelize[_0x993e('0x2')],'unique':_0x993e('0x3')},'apiKey':{'type':Sequelize[_0x993e('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x993e('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xdf55=['exports','STRING','remoteUri','sequelize'];(function(_0x3f5fb2,_0x43a56a){var _0x23f52d=function(_0x1530ee){while(--_0x1530ee){_0x3f5fb2['push'](_0x3f5fb2['shift']());}};_0x23f52d(++_0x43a56a);}(_0xdf55,0x83));var _0x5df5=function(_0xb93836,_0x2e7941){_0xb93836=_0xb93836-0x0;var _0x2b3e5b=_0xdf55[_0xb93836];return _0x2b3e5b;};'use strict';var Sequelize=require(_0x5df5('0x0'));module[_0x5df5('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5df5('0x2')]},'username':{'type':Sequelize[_0x5df5('0x2')],'unique':'username'},'apiKey':{'type':Sequelize[_0x5df5('0x2')]},'remoteUri':{'type':Sequelize[_0x5df5('0x2')],'unique':_0x5df5('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index 98820dc..c463abd 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 _0x4fce=['model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','getConfigurations','FreshsalesConfiguration','findOne','Subjects','getSubjects','channel','Descriptions','FreshsalesField','getFields','username','apiKey','remoteUri','slice','lastIndexOf','format','%s%s','/api/selector/owners','Token\x20token=','Requested\x20Resource\x20not\x20Found','statusCode','getFields,\x20%s,\x20%s,\x20%s','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','map','FreshsalesAccount','rawAttributes','fieldName','type'];(function(_0x465bb1,_0x34f0cc){var _0xfdc1c8=function(_0x15e36a){while(--_0x15e36a){_0x465bb1['push'](_0x465bb1['shift']());}};_0xfdc1c8(++_0x34f0cc);}(_0x4fce,0xf6));var _0xe4fc=function(_0x3eb9d6,_0x1995b8){_0x3eb9d6=_0x3eb9d6-0x0;var _0x1329eb=_0x4fce[_0x3eb9d6];return _0x1329eb;};'use strict';var emlformat=require(_0xe4fc('0x0'));var rimraf=require(_0xe4fc('0x1'));var zipdir=require(_0xe4fc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe4fc('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe4fc('0x4'));var util=require('util');var path=require(_0xe4fc('0x5'));var sox=require(_0xe4fc('0x6'));var csv=require(_0xe4fc('0x7'));var ejs=require(_0xe4fc('0x8'));var fs=require('fs');var fs_extra=require(_0xe4fc('0x9'));var _=require(_0xe4fc('0xa'));var squel=require(_0xe4fc('0xb'));var crypto=require(_0xe4fc('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe4fc('0xd'));var toCsv=require(_0xe4fc('0x7'));var querystring=require(_0xe4fc('0xe'));var Papa=require('papaparse');var Redis=require(_0xe4fc('0xf'));var authService=require(_0xe4fc('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe4fc('0x11'));var logger=require(_0xe4fc('0x12'))(_0xe4fc('0x13'));var utils=require('../../config/utils');var config=require(_0xe4fc('0x14'));var licenseUtil=require(_0xe4fc('0x15'));var db=require(_0xe4fc('0x16'))['db'];var integrations=require(_0xe4fc('0x17'));function respondWithStatusCode(_0x430f4f,_0x433b7d){_0x433b7d=_0x433b7d||0xcc;return function(_0x27fde0){if(_0x27fde0){return _0x430f4f[_0xe4fc('0x18')](_0x433b7d);}return _0x430f4f['status'](_0x433b7d)['end']();};}function respondWithResult(_0x1b49c3,_0x4865be){_0x4865be=_0x4865be||0xc8;return function(_0x3abe08){if(_0x3abe08){return _0x1b49c3[_0xe4fc('0x19')](_0x4865be)[_0xe4fc('0x1a')](_0x3abe08);}};}function respondWithFilteredResult(_0x1960ec,_0x420d01){return function(_0x2b4a89){if(_0x2b4a89){var _0x308d10=typeof _0x420d01[_0xe4fc('0x1b')]===_0xe4fc('0x1c')&&typeof _0x420d01[_0xe4fc('0x1d')]===_0xe4fc('0x1c');var _0x1c276b=_0x2b4a89[_0xe4fc('0x1e')];var _0x5ac053=_0x308d10?0x0:_0x420d01[_0xe4fc('0x1b')];var _0x342abb=_0x308d10?_0x2b4a89[_0xe4fc('0x1e')]:_0x420d01[_0xe4fc('0x1b')]+_0x420d01['limit'];var _0x28edfd;if(_0x342abb>=_0x1c276b){_0x342abb=_0x1c276b;_0x28edfd=0xc8;}else{_0x28edfd=0xce;}_0x1960ec['status'](_0x28edfd);return _0x1960ec['set'](_0xe4fc('0x1f'),_0x5ac053+'-'+_0x342abb+'/'+_0x1c276b)[_0xe4fc('0x1a')](_0x2b4a89);}return null;};}function patchUpdates(_0x493f84){return function(_0x3755de){try{jsonpatch[_0xe4fc('0x20')](_0x3755de,_0x493f84,!![]);}catch(_0x2d7cea){return BPromise[_0xe4fc('0x21')](_0x2d7cea);}return _0x3755de[_0xe4fc('0x22')]();};}function saveUpdates(_0x35f6cb,_0x2eee3a){return function(_0x308bc1){if(_0x308bc1){return _0x308bc1[_0xe4fc('0x23')](_0x35f6cb)[_0xe4fc('0x24')](function(_0x578d59){return _0x578d59;});}return null;};}function removeEntity(_0x299dae,_0x285053){return function(_0x5a43b4){if(_0x5a43b4){return _0x5a43b4[_0xe4fc('0x25')]()[_0xe4fc('0x24')](function(){_0x299dae[_0xe4fc('0x19')](0xcc)[_0xe4fc('0x26')]();});}};}function handleEntityNotFound(_0x304bd1,_0x19f253){return function(_0x54ba60){if(!_0x54ba60){_0x304bd1[_0xe4fc('0x18')](0x194);}return _0x54ba60;};}function handleError(_0x116e65,_0x1db60e){_0x1db60e=_0x1db60e||0x1f4;return function(_0x19c53c){logger[_0xe4fc('0x27')](_0x19c53c[_0xe4fc('0x28')]);if(_0x19c53c[_0xe4fc('0x29')]){delete _0x19c53c[_0xe4fc('0x29')];}_0x116e65[_0xe4fc('0x19')](_0x1db60e)[_0xe4fc('0x2a')](_0x19c53c);};}exports['index']=function(_0x3336de,_0x3eac22){var _0x56aa9a={},_0x2bed01={},_0x13e4cb={'count':0x0,'rows':[]};var _0x3a3d1f=_[_0xe4fc('0x2b')](db[_0xe4fc('0x2c')][_0xe4fc('0x2d')],function(_0x2d5f0a){return{'name':_0x2d5f0a[_0xe4fc('0x2e')],'type':_0x2d5f0a[_0xe4fc('0x2f')]['key']};});_0x2bed01[_0xe4fc('0x30')]=_[_0xe4fc('0x2b')](_0x3a3d1f,_0xe4fc('0x29'));_0x2bed01[_0xe4fc('0x31')]=_[_0xe4fc('0x32')](_0x3336de['query']);_0x2bed01[_0xe4fc('0x33')]=_[_0xe4fc('0x34')](_0x2bed01[_0xe4fc('0x30')],_0x2bed01[_0xe4fc('0x31')]);_0x56aa9a[_0xe4fc('0x35')]=_[_0xe4fc('0x34')](_0x2bed01['model'],qs[_0xe4fc('0x36')](_0x3336de[_0xe4fc('0x31')][_0xe4fc('0x36')]));_0x56aa9a[_0xe4fc('0x35')]=_0x56aa9a[_0xe4fc('0x35')][_0xe4fc('0x37')]?_0x56aa9a[_0xe4fc('0x35')]:_0x2bed01['model'];if(!_0x3336de[_0xe4fc('0x31')][_0xe4fc('0x38')](_0xe4fc('0x39'))){_0x56aa9a[_0xe4fc('0x1d')]=qs[_0xe4fc('0x1d')](_0x3336de[_0xe4fc('0x31')]['limit']);_0x56aa9a[_0xe4fc('0x1b')]=qs[_0xe4fc('0x1b')](_0x3336de[_0xe4fc('0x31')][_0xe4fc('0x1b')]);}_0x56aa9a[_0xe4fc('0x3a')]=qs[_0xe4fc('0x3b')](_0x3336de[_0xe4fc('0x31')][_0xe4fc('0x3b')]);_0x56aa9a[_0xe4fc('0x3c')]=qs[_0xe4fc('0x33')](_[_0xe4fc('0x3d')](_0x3336de[_0xe4fc('0x31')],_0x2bed01[_0xe4fc('0x33')]),_0x3a3d1f);if(_0x3336de[_0xe4fc('0x31')][_0xe4fc('0x3e')]){_0x56aa9a[_0xe4fc('0x3c')]=_[_0xe4fc('0x3f')](_0x56aa9a[_0xe4fc('0x3c')],{'$or':_[_0xe4fc('0x2b')](_0x3a3d1f,function(_0x21f846){if(_0x21f846[_0xe4fc('0x2f')]!==_0xe4fc('0x40')){var _0x566860={};_0x566860[_0x21f846[_0xe4fc('0x29')]]={'$like':'%'+_0x3336de['query']['filter']+'%'};return _0x566860;}})});}_0x56aa9a=_[_0xe4fc('0x3f')]({},_0x56aa9a,_0x3336de[_0xe4fc('0x41')]);var _0x4ed7b3={'where':_0x56aa9a[_0xe4fc('0x3c')]};return db[_0xe4fc('0x2c')][_0xe4fc('0x1e')](_0x4ed7b3)['then'](function(_0x3ecc98){_0x13e4cb[_0xe4fc('0x1e')]=_0x3ecc98;if(_0x3336de['query'][_0xe4fc('0x42')]){_0x56aa9a[_0xe4fc('0x43')]=[{'all':!![]}];}return db[_0xe4fc('0x2c')][_0xe4fc('0x44')](_0x56aa9a);})[_0xe4fc('0x24')](function(_0x546f1b){_0x13e4cb['rows']=_0x546f1b;return _0x13e4cb;})['then'](respondWithFilteredResult(_0x3eac22,_0x56aa9a))[_0xe4fc('0x45')](handleError(_0x3eac22,null));};exports[_0xe4fc('0x46')]=function(_0x26ddd9,_0x436906){var _0x2997a3={'raw':![],'where':{'id':_0x26ddd9[_0xe4fc('0x47')]['id']}},_0x1a3d1b={};_0x1a3d1b['model']=_[_0xe4fc('0x32')](db['FreshsalesAccount']['rawAttributes']);_0x1a3d1b[_0xe4fc('0x31')]=_[_0xe4fc('0x32')](_0x26ddd9['query']);_0x1a3d1b[_0xe4fc('0x33')]=_[_0xe4fc('0x34')](_0x1a3d1b[_0xe4fc('0x30')],_0x1a3d1b[_0xe4fc('0x31')]);_0x2997a3['attributes']=_['intersection'](_0x1a3d1b[_0xe4fc('0x30')],qs[_0xe4fc('0x36')](_0x26ddd9[_0xe4fc('0x31')][_0xe4fc('0x36')]));_0x2997a3['attributes']=_0x2997a3[_0xe4fc('0x35')]['length']?_0x2997a3[_0xe4fc('0x35')]:_0x1a3d1b[_0xe4fc('0x30')];if(_0x26ddd9[_0xe4fc('0x31')][_0xe4fc('0x42')]){_0x2997a3['include']=[{'all':!![]}];}_0x2997a3=_[_0xe4fc('0x3f')]({},_0x2997a3,_0x26ddd9[_0xe4fc('0x41')]);return db[_0xe4fc('0x2c')][_0xe4fc('0x48')](_0x2997a3)[_0xe4fc('0x24')](handleEntityNotFound(_0x436906,null))['then'](respondWithResult(_0x436906,null))[_0xe4fc('0x45')](handleError(_0x436906,null));};exports['create']=function(_0x2f907e,_0x3aadc7){return db['FreshsalesAccount'][_0xe4fc('0x49')](_0x2f907e[_0xe4fc('0x4a')],{})[_0xe4fc('0x24')](respondWithResult(_0x3aadc7,0xc9))['catch'](handleError(_0x3aadc7,null));};exports[_0xe4fc('0x23')]=function(_0x34da66,_0x70270d){if(_0x34da66[_0xe4fc('0x4a')]['id']){delete _0x34da66[_0xe4fc('0x4a')]['id'];}return db[_0xe4fc('0x2c')][_0xe4fc('0x48')]({'where':{'id':_0x34da66['params']['id']}})[_0xe4fc('0x24')](handleEntityNotFound(_0x70270d,null))[_0xe4fc('0x24')](saveUpdates(_0x34da66[_0xe4fc('0x4a')],null))[_0xe4fc('0x24')](respondWithResult(_0x70270d,null))['catch'](handleError(_0x70270d,null));};exports[_0xe4fc('0x25')]=function(_0x42ac10,_0x3a280f){return db['FreshsalesAccount']['find']({'where':{'id':_0x42ac10[_0xe4fc('0x47')]['id']}})['then'](handleEntityNotFound(_0x3a280f,null))[_0xe4fc('0x24')](removeEntity(_0x3a280f,null))[_0xe4fc('0x45')](handleError(_0x3a280f,null));};exports[_0xe4fc('0x4b')]=function(_0x128fc6,_0x3c7422,_0x40e1e4){var _0x5c7691={};var _0x1be8be={};var _0xe783;var _0x3e57ab;return db['FreshsalesAccount']['findOne']({'where':{'id':_0x128fc6['params']['id']}})[_0xe4fc('0x24')](handleEntityNotFound(_0x3c7422,null))[_0xe4fc('0x24')](function(_0x4a414f){if(_0x4a414f){_0xe783=_0x4a414f;_0x1be8be[_0xe4fc('0x30')]=_[_0xe4fc('0x32')](db[_0xe4fc('0x4c')][_0xe4fc('0x2d')]);_0x1be8be[_0xe4fc('0x31')]=_[_0xe4fc('0x32')](_0x128fc6[_0xe4fc('0x31')]);_0x1be8be[_0xe4fc('0x33')]=_[_0xe4fc('0x34')](_0x1be8be[_0xe4fc('0x30')],_0x1be8be[_0xe4fc('0x31')]);_0x5c7691[_0xe4fc('0x35')]=_[_0xe4fc('0x34')](_0x1be8be[_0xe4fc('0x30')],qs[_0xe4fc('0x36')](_0x128fc6['query'][_0xe4fc('0x36')]));_0x5c7691['attributes']=_0x5c7691[_0xe4fc('0x35')][_0xe4fc('0x37')]?_0x5c7691[_0xe4fc('0x35')]:_0x1be8be[_0xe4fc('0x30')];_0x5c7691[_0xe4fc('0x3a')]=qs[_0xe4fc('0x3b')](_0x128fc6[_0xe4fc('0x31')][_0xe4fc('0x3b')]);_0x5c7691['where']=qs[_0xe4fc('0x33')](_['pick'](_0x128fc6[_0xe4fc('0x31')],_0x1be8be[_0xe4fc('0x33')]));if(_0x128fc6[_0xe4fc('0x31')][_0xe4fc('0x3e')]){_0x5c7691[_0xe4fc('0x3c')]=_[_0xe4fc('0x3f')](_0x5c7691[_0xe4fc('0x3c')],{'$or':_['map'](_0x5c7691[_0xe4fc('0x35')],function(_0x34f712){var _0x4cc397={};_0x4cc397[_0x34f712]={'$like':'%'+_0x128fc6[_0xe4fc('0x31')]['filter']+'%'};return _0x4cc397;})});}_0x5c7691=_[_0xe4fc('0x3f')]({},_0x5c7691,_0x128fc6[_0xe4fc('0x41')]);return _0xe783[_0xe4fc('0x4b')](_0x5c7691);}})[_0xe4fc('0x24')](function(_0x2f5323){if(_0x2f5323){_0x3e57ab=_0x2f5323[_0xe4fc('0x37')];if(!_0x128fc6[_0xe4fc('0x31')][_0xe4fc('0x38')](_0xe4fc('0x39'))){_0x5c7691[_0xe4fc('0x1d')]=qs['limit'](_0x128fc6['query'][_0xe4fc('0x1d')]);_0x5c7691[_0xe4fc('0x1b')]=qs['offset'](_0x128fc6[_0xe4fc('0x31')][_0xe4fc('0x1b')]);}return _0xe783[_0xe4fc('0x4b')](_0x5c7691);}})['then'](function(_0x25472d){if(_0x25472d){return _0x25472d?{'count':_0x3e57ab,'rows':_0x25472d}:null;}})[_0xe4fc('0x24')](respondWithResult(_0x3c7422,null))[_0xe4fc('0x45')](handleError(_0x3c7422,null));};exports['addConfiguration']=function(_0x3e69e7,_0x6681f2,_0x52e5b2){if(_0x3e69e7[_0xe4fc('0x4a')]['id']){delete _0x3e69e7[_0xe4fc('0x4a')]['id'];}return db[_0xe4fc('0x2c')][_0xe4fc('0x4d')]({'where':{'id':_0x3e69e7[_0xe4fc('0x47')]['id']}})[_0xe4fc('0x24')](handleEntityNotFound(_0x6681f2,null))['then'](function(_0x2c2c8d){if(_0x2c2c8d){_0x3e69e7['body']['AccountId']=_0x2c2c8d['id'];_0x3e69e7['body'][_0xe4fc('0x4e')]=integrations[_0xe4fc('0x4f')](_0x3e69e7[_0xe4fc('0x4a')][_0xe4fc('0x50')],_0x3e69e7[_0xe4fc('0x4a')]['type']);_0x3e69e7[_0xe4fc('0x4a')][_0xe4fc('0x51')]=integrations['getDescriptions'](_0x3e69e7[_0xe4fc('0x4a')]['channel'],_0x3e69e7['body'][_0xe4fc('0x2f')]);return db[_0xe4fc('0x4c')][_0xe4fc('0x49')](_0x3e69e7[_0xe4fc('0x4a')],{'include':[{'model':db[_0xe4fc('0x52')],'as':_0xe4fc('0x4e')},{'model':db['FreshsalesField'],'as':_0xe4fc('0x51')}]});}return null;})[_0xe4fc('0x24')](respondWithResult(_0x6681f2,null))[_0xe4fc('0x45')](handleError(_0x6681f2,null));};exports[_0xe4fc('0x53')]=function(_0x4e5490,_0x5de41c,_0x5c2faa){var _0x42343b='';var _0x59cbd4='';return db[_0xe4fc('0x2c')][_0xe4fc('0x4d')]({'where':{'id':_0x4e5490[_0xe4fc('0x47')]['id']},'attributes':['id',_0xe4fc('0x54'),'remoteUri',_0xe4fc('0x55')]})[_0xe4fc('0x24')](handleEntityNotFound(_0x5de41c,null))[_0xe4fc('0x24')](function(_0xa8f1a8){if(_0xa8f1a8){_0x59cbd4=_0xa8f1a8['username'];_0x42343b=_0xa8f1a8[_0xe4fc('0x56')];var _0xbf65f=_0xa8f1a8[_0xe4fc('0x56')][_0xe4fc('0x57')](-0x1);if(_0xbf65f==='/'){_0x42343b=_0x42343b['substring'](0x0,_0x42343b[_0xe4fc('0x58')](_0xbf65f));}return rp({'method':'GET','uri':util[_0xe4fc('0x59')](_0xe4fc('0x5a'),_0x42343b,_0xe4fc('0x5b')),'headers':{'Authorization':_0xe4fc('0x5c')+_0xa8f1a8[_0xe4fc('0x55')]},'json':!![]});}})['then'](function(_0x3ee22d){if(_0x3ee22d){var _0x1357ed=_0x3ee22d['users'];var _0x14ea3e=![];var _0x28a1e3=null;for(_0x28a1e3=0x0;_0x28a1e3<_0x1357ed[_0xe4fc('0x37')];_0x28a1e3++){if(_0x1357ed[_0x28a1e3]['email']===_0x59cbd4){_0x14ea3e=!![];}}if(_0x14ea3e){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xe4fc('0x5d')});}}})[_0xe4fc('0x24')](respondWithResult(_0x5de41c,null))[_0xe4fc('0x45')](function(_0x1fafd8){var _0x489c50=_0x4e5490['query']['test']?0x1f4:_0x1fafd8[_0xe4fc('0x5e')]||0x1f4;logger[_0xe4fc('0x27')](_0xe4fc('0x5f'),_0xe4fc('0x53'),_0x489c50,JSON['stringify'](_0x1fafd8));delete _0x1fafd8[_0xe4fc('0x29')];if(_0x489c50===0x191){_0x489c50=0x190;}_0x5de41c[_0xe4fc('0x19')](_0x489c50)['send'](_0x4e5490[_0xe4fc('0x31')][_0xe4fc('0x60')]?{'message':_0xe4fc('0x61'),'statusCode':_0x1fafd8[_0xe4fc('0x5e')]}:_0x1fafd8);});}; \ No newline at end of file +var _0xbf38=['../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','attributes','length','hasOwnProperty','sort','where','pick','merge','filter','options','FreshsalesAccount','includeAll','include','findAll','rows','show','params','intersection','find','catch','create','body','findOne','fields','order','getConfigurations','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshsalesConfiguration','FreshsalesField','getFields','username','remoteUri','slice','substring','lastIndexOf','GET','format','%s%s','apiKey','Requested\x20Resource\x20not\x20Found','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils'];(function(_0x56df8a,_0xae1416){var _0x44625d=function(_0x3511f4){while(--_0x3511f4){_0x56df8a['push'](_0x56df8a['shift']());}};_0x44625d(++_0xae1416);}(_0xbf38,0xb6));var _0x8bf3=function(_0x5a2162,_0x5a90a3){_0x5a2162=_0x5a2162-0x0;var _0x4561a7=_0xbf38[_0x5a2162];return _0x4561a7;};'use strict';var emlformat=require(_0x8bf3('0x0'));var rimraf=require(_0x8bf3('0x1'));var zipdir=require(_0x8bf3('0x2'));var jsonpatch=require(_0x8bf3('0x3'));var rp=require(_0x8bf3('0x4'));var moment=require(_0x8bf3('0x5'));var BPromise=require(_0x8bf3('0x6'));var Mustache=require('mustache');var util=require(_0x8bf3('0x7'));var path=require('path');var sox=require(_0x8bf3('0x8'));var csv=require(_0x8bf3('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8bf3('0xa'));var _=require('lodash');var squel=require(_0x8bf3('0xb'));var crypto=require('crypto');var jsforce=require(_0x8bf3('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x8bf3('0x9'));var querystring=require(_0x8bf3('0xd'));var Papa=require(_0x8bf3('0xe'));var Redis=require(_0x8bf3('0xf'));var authService=require(_0x8bf3('0x10'));var qs=require(_0x8bf3('0x11'));var as=require(_0x8bf3('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8bf3('0x13'))(_0x8bf3('0x14'));var utils=require(_0x8bf3('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x8bf3('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0x8bf3('0x17'));function respondWithStatusCode(_0x557502,_0x2eede8){_0x2eede8=_0x2eede8||0xcc;return function(_0x5755a6){if(_0x5755a6){return _0x557502[_0x8bf3('0x18')](_0x2eede8);}return _0x557502[_0x8bf3('0x19')](_0x2eede8)[_0x8bf3('0x1a')]();};}function respondWithResult(_0x3bae2e,_0x3bb1c2){_0x3bb1c2=_0x3bb1c2||0xc8;return function(_0xcb869e){if(_0xcb869e){return _0x3bae2e[_0x8bf3('0x19')](_0x3bb1c2)[_0x8bf3('0x1b')](_0xcb869e);}};}function respondWithFilteredResult(_0x265193,_0x17a971){return function(_0x6e1a76){if(_0x6e1a76){var _0x57c74b=typeof _0x17a971['offset']===_0x8bf3('0x1c')&&typeof _0x17a971[_0x8bf3('0x1d')]===_0x8bf3('0x1c');var _0x55b54d=_0x6e1a76[_0x8bf3('0x1e')];var _0x34fe12=_0x57c74b?0x0:_0x17a971['offset'];var _0x348e43=_0x57c74b?_0x6e1a76['count']:_0x17a971[_0x8bf3('0x1f')]+_0x17a971[_0x8bf3('0x1d')];var _0x27a666;if(_0x348e43>=_0x55b54d){_0x348e43=_0x55b54d;_0x27a666=0xc8;}else{_0x27a666=0xce;}_0x265193['status'](_0x27a666);return _0x265193[_0x8bf3('0x20')](_0x8bf3('0x21'),_0x34fe12+'-'+_0x348e43+'/'+_0x55b54d)['json'](_0x6e1a76);}return null;};}function patchUpdates(_0x515e4f){return function(_0x41e8f3){try{jsonpatch[_0x8bf3('0x22')](_0x41e8f3,_0x515e4f,!![]);}catch(_0x18e3c2){return BPromise[_0x8bf3('0x23')](_0x18e3c2);}return _0x41e8f3['save']();};}function saveUpdates(_0x532607,_0x343ddb){return function(_0x3f0bab){if(_0x3f0bab){return _0x3f0bab[_0x8bf3('0x24')](_0x532607)[_0x8bf3('0x25')](function(_0x5c8fe8){return _0x5c8fe8;});}return null;};}function removeEntity(_0x3b3002,_0x188153){return function(_0x41d206){if(_0x41d206){return _0x41d206[_0x8bf3('0x26')]()[_0x8bf3('0x25')](function(){_0x3b3002[_0x8bf3('0x19')](0xcc)[_0x8bf3('0x1a')]();});}};}function handleEntityNotFound(_0x43ea28,_0x237904){return function(_0x102ae8){if(!_0x102ae8){_0x43ea28[_0x8bf3('0x18')](0x194);}return _0x102ae8;};}function handleError(_0x266f61,_0x52441d){_0x52441d=_0x52441d||0x1f4;return function(_0x9ff0c6){logger['error'](_0x9ff0c6[_0x8bf3('0x27')]);if(_0x9ff0c6['name']){delete _0x9ff0c6[_0x8bf3('0x28')];}_0x266f61[_0x8bf3('0x19')](_0x52441d)[_0x8bf3('0x29')](_0x9ff0c6);};}exports[_0x8bf3('0x2a')]=function(_0x6478d9,_0x3e6b12){var _0x23bd2e={},_0xb0509e={},_0x2995e3={'count':0x0,'rows':[]};var _0x49bf91=_[_0x8bf3('0x2b')](db['FreshsalesAccount'][_0x8bf3('0x2c')],function(_0x696088){return{'name':_0x696088['fieldName'],'type':_0x696088[_0x8bf3('0x2d')][_0x8bf3('0x2e')]};});_0xb0509e[_0x8bf3('0x2f')]=_[_0x8bf3('0x2b')](_0x49bf91,_0x8bf3('0x28'));_0xb0509e[_0x8bf3('0x30')]=_[_0x8bf3('0x31')](_0x6478d9[_0x8bf3('0x30')]);_0xb0509e[_0x8bf3('0x32')]=_['intersection'](_0xb0509e[_0x8bf3('0x2f')],_0xb0509e[_0x8bf3('0x30')]);_0x23bd2e['attributes']=_['intersection'](_0xb0509e['model'],qs['fields'](_0x6478d9[_0x8bf3('0x30')]['fields']));_0x23bd2e[_0x8bf3('0x33')]=_0x23bd2e['attributes'][_0x8bf3('0x34')]?_0x23bd2e[_0x8bf3('0x33')]:_0xb0509e[_0x8bf3('0x2f')];if(!_0x6478d9['query'][_0x8bf3('0x35')]('nolimit')){_0x23bd2e[_0x8bf3('0x1d')]=qs[_0x8bf3('0x1d')](_0x6478d9[_0x8bf3('0x30')][_0x8bf3('0x1d')]);_0x23bd2e[_0x8bf3('0x1f')]=qs[_0x8bf3('0x1f')](_0x6478d9[_0x8bf3('0x30')]['offset']);}_0x23bd2e['order']=qs[_0x8bf3('0x36')](_0x6478d9[_0x8bf3('0x30')][_0x8bf3('0x36')]);_0x23bd2e[_0x8bf3('0x37')]=qs[_0x8bf3('0x32')](_[_0x8bf3('0x38')](_0x6478d9[_0x8bf3('0x30')],_0xb0509e[_0x8bf3('0x32')]),_0x49bf91);if(_0x6478d9['query']['filter']){_0x23bd2e[_0x8bf3('0x37')]=_[_0x8bf3('0x39')](_0x23bd2e[_0x8bf3('0x37')],{'$or':_[_0x8bf3('0x2b')](_0x49bf91,function(_0x17c262){if(_0x17c262[_0x8bf3('0x2d')]!=='VIRTUAL'){var _0x4cc84a={};_0x4cc84a[_0x17c262[_0x8bf3('0x28')]]={'$like':'%'+_0x6478d9[_0x8bf3('0x30')][_0x8bf3('0x3a')]+'%'};return _0x4cc84a;}})});}_0x23bd2e=_[_0x8bf3('0x39')]({},_0x23bd2e,_0x6478d9[_0x8bf3('0x3b')]);var _0xb3df6c={'where':_0x23bd2e['where']};return db[_0x8bf3('0x3c')][_0x8bf3('0x1e')](_0xb3df6c)[_0x8bf3('0x25')](function(_0x355f0c){_0x2995e3[_0x8bf3('0x1e')]=_0x355f0c;if(_0x6478d9[_0x8bf3('0x30')][_0x8bf3('0x3d')]){_0x23bd2e[_0x8bf3('0x3e')]=[{'all':!![]}];}return db[_0x8bf3('0x3c')][_0x8bf3('0x3f')](_0x23bd2e);})[_0x8bf3('0x25')](function(_0x22fc0f){_0x2995e3[_0x8bf3('0x40')]=_0x22fc0f;return _0x2995e3;})['then'](respondWithFilteredResult(_0x3e6b12,_0x23bd2e))['catch'](handleError(_0x3e6b12,null));};exports[_0x8bf3('0x41')]=function(_0x5518a1,_0x48595c){var _0x3e6e52={'raw':![],'where':{'id':_0x5518a1[_0x8bf3('0x42')]['id']}},_0x2b2a86={};_0x2b2a86['model']=_[_0x8bf3('0x31')](db[_0x8bf3('0x3c')][_0x8bf3('0x2c')]);_0x2b2a86[_0x8bf3('0x30')]=_[_0x8bf3('0x31')](_0x5518a1['query']);_0x2b2a86['filters']=_[_0x8bf3('0x43')](_0x2b2a86[_0x8bf3('0x2f')],_0x2b2a86[_0x8bf3('0x30')]);_0x3e6e52[_0x8bf3('0x33')]=_[_0x8bf3('0x43')](_0x2b2a86[_0x8bf3('0x2f')],qs['fields'](_0x5518a1['query']['fields']));_0x3e6e52['attributes']=_0x3e6e52[_0x8bf3('0x33')][_0x8bf3('0x34')]?_0x3e6e52[_0x8bf3('0x33')]:_0x2b2a86[_0x8bf3('0x2f')];if(_0x5518a1[_0x8bf3('0x30')][_0x8bf3('0x3d')]){_0x3e6e52['include']=[{'all':!![]}];}_0x3e6e52=_[_0x8bf3('0x39')]({},_0x3e6e52,_0x5518a1[_0x8bf3('0x3b')]);return db[_0x8bf3('0x3c')][_0x8bf3('0x44')](_0x3e6e52)['then'](handleEntityNotFound(_0x48595c,null))[_0x8bf3('0x25')](respondWithResult(_0x48595c,null))[_0x8bf3('0x45')](handleError(_0x48595c,null));};exports[_0x8bf3('0x46')]=function(_0x26e13f,_0x250960){return db[_0x8bf3('0x3c')][_0x8bf3('0x46')](_0x26e13f[_0x8bf3('0x47')],{})[_0x8bf3('0x25')](respondWithResult(_0x250960,0xc9))['catch'](handleError(_0x250960,null));};exports[_0x8bf3('0x24')]=function(_0x4ce5a2,_0x32ac0a){if(_0x4ce5a2[_0x8bf3('0x47')]['id']){delete _0x4ce5a2[_0x8bf3('0x47')]['id'];}return db['FreshsalesAccount'][_0x8bf3('0x44')]({'where':{'id':_0x4ce5a2[_0x8bf3('0x42')]['id']}})['then'](handleEntityNotFound(_0x32ac0a,null))['then'](saveUpdates(_0x4ce5a2[_0x8bf3('0x47')],null))['then'](respondWithResult(_0x32ac0a,null))[_0x8bf3('0x45')](handleError(_0x32ac0a,null));};exports[_0x8bf3('0x26')]=function(_0x291cf1,_0xe1f9d7){return db[_0x8bf3('0x3c')][_0x8bf3('0x44')]({'where':{'id':_0x291cf1[_0x8bf3('0x42')]['id']}})[_0x8bf3('0x25')](handleEntityNotFound(_0xe1f9d7,null))['then'](removeEntity(_0xe1f9d7,null))[_0x8bf3('0x45')](handleError(_0xe1f9d7,null));};exports['getConfigurations']=function(_0x1f96af,_0x4be038,_0x4950c3){var _0x293f13={};var _0x398220={};var _0x4cd3b1;var _0x427b73;return db[_0x8bf3('0x3c')][_0x8bf3('0x48')]({'where':{'id':_0x1f96af['params']['id']}})[_0x8bf3('0x25')](handleEntityNotFound(_0x4be038,null))[_0x8bf3('0x25')](function(_0xdc2057){if(_0xdc2057){_0x4cd3b1=_0xdc2057;_0x398220[_0x8bf3('0x2f')]=_[_0x8bf3('0x31')](db['FreshsalesConfiguration'][_0x8bf3('0x2c')]);_0x398220[_0x8bf3('0x30')]=_['keys'](_0x1f96af[_0x8bf3('0x30')]);_0x398220[_0x8bf3('0x32')]=_[_0x8bf3('0x43')](_0x398220[_0x8bf3('0x2f')],_0x398220[_0x8bf3('0x30')]);_0x293f13[_0x8bf3('0x33')]=_['intersection'](_0x398220['model'],qs['fields'](_0x1f96af[_0x8bf3('0x30')][_0x8bf3('0x49')]));_0x293f13[_0x8bf3('0x33')]=_0x293f13['attributes'][_0x8bf3('0x34')]?_0x293f13['attributes']:_0x398220[_0x8bf3('0x2f')];_0x293f13[_0x8bf3('0x4a')]=qs['sort'](_0x1f96af[_0x8bf3('0x30')][_0x8bf3('0x36')]);_0x293f13['where']=qs['filters'](_[_0x8bf3('0x38')](_0x1f96af[_0x8bf3('0x30')],_0x398220[_0x8bf3('0x32')]));if(_0x1f96af[_0x8bf3('0x30')]['filter']){_0x293f13[_0x8bf3('0x37')]=_[_0x8bf3('0x39')](_0x293f13[_0x8bf3('0x37')],{'$or':_[_0x8bf3('0x2b')](_0x293f13['attributes'],function(_0x2a535b){var _0x57d5a2={};_0x57d5a2[_0x2a535b]={'$like':'%'+_0x1f96af[_0x8bf3('0x30')]['filter']+'%'};return _0x57d5a2;})});}_0x293f13=_['merge']({},_0x293f13,_0x1f96af['options']);return _0x4cd3b1[_0x8bf3('0x4b')](_0x293f13);}})[_0x8bf3('0x25')](function(_0x49e0f5){if(_0x49e0f5){_0x427b73=_0x49e0f5[_0x8bf3('0x34')];if(!_0x1f96af[_0x8bf3('0x30')][_0x8bf3('0x35')](_0x8bf3('0x4c'))){_0x293f13[_0x8bf3('0x1d')]=qs[_0x8bf3('0x1d')](_0x1f96af[_0x8bf3('0x30')][_0x8bf3('0x1d')]);_0x293f13[_0x8bf3('0x1f')]=qs['offset'](_0x1f96af[_0x8bf3('0x30')][_0x8bf3('0x1f')]);}return _0x4cd3b1['getConfigurations'](_0x293f13);}})[_0x8bf3('0x25')](function(_0x525cfa){if(_0x525cfa){return _0x525cfa?{'count':_0x427b73,'rows':_0x525cfa}:null;}})[_0x8bf3('0x25')](respondWithResult(_0x4be038,null))[_0x8bf3('0x45')](handleError(_0x4be038,null));};exports[_0x8bf3('0x4d')]=function(_0x5dbfe5,_0x59e99c,_0x956f2f){if(_0x5dbfe5[_0x8bf3('0x47')]['id']){delete _0x5dbfe5[_0x8bf3('0x47')]['id'];}return db[_0x8bf3('0x3c')][_0x8bf3('0x48')]({'where':{'id':_0x5dbfe5[_0x8bf3('0x42')]['id']}})[_0x8bf3('0x25')](handleEntityNotFound(_0x59e99c,null))[_0x8bf3('0x25')](function(_0x2dc15b){if(_0x2dc15b){_0x5dbfe5[_0x8bf3('0x47')][_0x8bf3('0x4e')]=_0x2dc15b['id'];_0x5dbfe5[_0x8bf3('0x47')][_0x8bf3('0x4f')]=integrations[_0x8bf3('0x50')](_0x5dbfe5[_0x8bf3('0x47')][_0x8bf3('0x51')],_0x5dbfe5[_0x8bf3('0x47')][_0x8bf3('0x2d')]);_0x5dbfe5['body'][_0x8bf3('0x52')]=integrations[_0x8bf3('0x53')](_0x5dbfe5[_0x8bf3('0x47')][_0x8bf3('0x51')],_0x5dbfe5[_0x8bf3('0x47')][_0x8bf3('0x2d')]);return db[_0x8bf3('0x54')][_0x8bf3('0x46')](_0x5dbfe5['body'],{'include':[{'model':db[_0x8bf3('0x55')],'as':_0x8bf3('0x4f')},{'model':db['FreshsalesField'],'as':_0x8bf3('0x52')}]});}return null;})[_0x8bf3('0x25')](respondWithResult(_0x59e99c,null))[_0x8bf3('0x45')](handleError(_0x59e99c,null));};exports[_0x8bf3('0x56')]=function(_0x5c3ce3,_0x31d5f9,_0x5e9eb6){var _0x138403='';var _0x45055b='';return db[_0x8bf3('0x3c')][_0x8bf3('0x48')]({'where':{'id':_0x5c3ce3['params']['id']},'attributes':['id',_0x8bf3('0x57'),_0x8bf3('0x58'),'apiKey']})[_0x8bf3('0x25')](handleEntityNotFound(_0x31d5f9,null))[_0x8bf3('0x25')](function(_0x14e32e){if(_0x14e32e){_0x45055b=_0x14e32e['username'];_0x138403=_0x14e32e[_0x8bf3('0x58')];var _0x48ffe1=_0x14e32e[_0x8bf3('0x58')][_0x8bf3('0x59')](-0x1);if(_0x48ffe1==='/'){_0x138403=_0x138403[_0x8bf3('0x5a')](0x0,_0x138403[_0x8bf3('0x5b')](_0x48ffe1));}return rp({'method':_0x8bf3('0x5c'),'uri':util[_0x8bf3('0x5d')](_0x8bf3('0x5e'),_0x138403,'/api/selector/owners'),'headers':{'Authorization':'Token\x20token='+_0x14e32e[_0x8bf3('0x5f')]},'json':!![]});}})[_0x8bf3('0x25')](function(_0x366b30){if(_0x366b30){var _0x5ea3f3=_0x366b30['users'];var _0x2a7931=![];var _0x1c2de9=null;for(_0x1c2de9=0x0;_0x1c2de9<_0x5ea3f3['length'];_0x1c2de9++){if(_0x5ea3f3[_0x1c2de9]['email']===_0x45055b){_0x2a7931=!![];}}if(_0x2a7931){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x8bf3('0x60')});}}})[_0x8bf3('0x25')](respondWithResult(_0x31d5f9,null))[_0x8bf3('0x45')](function(_0xaa827d){var _0x12cc8d=_0x5c3ce3['query'][_0x8bf3('0x61')]?0x1f4:_0xaa827d[_0x8bf3('0x62')]||0x1f4;logger[_0x8bf3('0x63')](_0x8bf3('0x64'),'getFields',_0x12cc8d,JSON['stringify'](_0xaa827d));delete _0xaa827d[_0x8bf3('0x28')];if(_0x12cc8d===0x191){_0x12cc8d=0x190;}_0x31d5f9[_0x8bf3('0x19')](_0x12cc8d)[_0x8bf3('0x29')](_0x5c3ce3[_0x8bf3('0x30')][_0x8bf3('0x61')]?{'message':_0x8bf3('0x65'),'statusCode':_0xaa827d[_0x8bf3('0x62')]}:_0xaa827d);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index f85196f..f7c1b9c 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 _0xe3da=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','int_freshsales_accounts','lodash','util','../../config/logger','api'];(function(_0xc22df2,_0x16f608){var _0x4b1166=function(_0x3af9c3){while(--_0x3af9c3){_0xc22df2['push'](_0xc22df2['shift']());}};_0x4b1166(++_0x16f608);}(_0xe3da,0x1cd));var _0xae3d=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xe3da[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0xae3d('0x0'));var util=require(_0xae3d('0x1'));var logger=require(_0xae3d('0x2'))(_0xae3d('0x3'));var moment=require(_0xae3d('0x4'));var BPromise=require(_0xae3d('0x5'));var rp=require(_0xae3d('0x6'));var fs=require('fs');var path=require(_0xae3d('0x7'));var rimraf=require(_0xae3d('0x8'));var config=require(_0xae3d('0x9'));var attributes=require(_0xae3d('0xa'));var integrations=require(_0xae3d('0xb'));module[_0xae3d('0xc')]=function(_0xa54808,_0x476579){return _0xa54808[_0xae3d('0xd')]('FreshsalesAccount',attributes,{'tableName':_0xae3d('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5f2f=['../../config/logger','api','moment','bluebird','request-promise','path','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','int_freshsales_accounts','lodash','util'];(function(_0x82fe71,_0x5bef52){var _0xe6ce04=function(_0xea581e){while(--_0xea581e){_0x82fe71['push'](_0x82fe71['shift']());}};_0xe6ce04(++_0x5bef52);}(_0x5f2f,0x73));var _0xf5f2=function(_0x137926,_0x2e6f75){_0x137926=_0x137926-0x0;var _0x1b1b9d=_0x5f2f[_0x137926];return _0x1b1b9d;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var logger=require(_0xf5f2('0x2'))(_0xf5f2('0x3'));var moment=require(_0xf5f2('0x4'));var BPromise=require(_0xf5f2('0x5'));var rp=require(_0xf5f2('0x6'));var fs=require('fs');var path=require(_0xf5f2('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf5f2('0x8'));var integrations=require(_0xf5f2('0x9'));module[_0xf5f2('0xa')]=function(_0x3eebf6,_0x3133bc){return _0x3eebf6[_0xf5f2('0xb')]('FreshsalesAccount',attributes,{'tableName':_0xf5f2('0xc'),'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 880033a..8dd6d40 100644 --- a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js +++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb44a=['moment','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','FreshsalesAccount,\x20%s,\x20%s','debug','stringify','error','code','message','info','catch','GetFreshsalesAccount','FreshsalesAccount','options','raw','attributes','limit','include','map','model','ShowFreshsalesAccount','find','where'];(function(_0x2ecae3,_0x352773){var _0x45bc0b=function(_0x1c04b1){while(--_0x1c04b1){_0x2ecae3['push'](_0x2ecae3['shift']());}};_0x45bc0b(++_0x352773);}(_0xb44a,0x1c2));var _0xab44=function(_0x5f3905,_0x43a651){_0x5f3905=_0x5f3905-0x0;var _0x2923b1=_0xb44a[_0x5f3905];return _0x2923b1;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xab44('0x0'));var BPromise=require('bluebird');var rs=require(_0xab44('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xab44('0x2'));var logger=require('../../config/logger')(_0xab44('0x3'));var config=require(_0xab44('0x4'));var jayson=require(_0xab44('0x5'));var client=jayson[_0xab44('0x6')][_0xab44('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3303b1,_0x3ead8d,_0x495825){return new BPromise(function(_0x137a8c,_0x133a6d){return client[_0xab44('0x8')](_0x3303b1,_0x495825)[_0xab44('0x9')](function(_0xa14367){logger['info'](_0xab44('0xa'),_0x3ead8d,'request\x20sent');logger[_0xab44('0xb')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x3ead8d,'request\x20sent',JSON[_0xab44('0xc')](_0xa14367));if(_0xa14367[_0xab44('0xd')]){if(_0xa14367[_0xab44('0xd')][_0xab44('0xe')]===0x1f4){logger[_0xab44('0xd')](_0xab44('0xa'),_0x3ead8d,_0xa14367['error']['message']);return _0x133a6d(_0xa14367[_0xab44('0xd')]['message']);}logger[_0xab44('0xd')]('FreshsalesAccount,\x20%s,\x20%s',_0x3ead8d,_0xa14367[_0xab44('0xd')][_0xab44('0xf')]);return _0x137a8c(_0xa14367[_0xab44('0xd')][_0xab44('0xf')]);}else{logger[_0xab44('0x10')](_0xab44('0xa'),_0x3ead8d,'request\x20sent');_0x137a8c(_0xa14367['result'][_0xab44('0xf')]);}})[_0xab44('0x11')](function(_0x14fe36){logger[_0xab44('0xd')](_0xab44('0xa'),_0x3ead8d,_0x14fe36);_0x133a6d(_0x14fe36);});});}exports[_0xab44('0x12')]=function(_0x354b09){var _0x44fa43=this;return new Promise(function(_0x310b15,_0xc4b3dc){return db[_0xab44('0x13')]['findAll']({'raw':_0x354b09[_0xab44('0x14')]?_0x354b09[_0xab44('0x14')][_0xab44('0x15')]===undefined?!![]:![]:!![],'where':_0x354b09[_0xab44('0x14')]?_0x354b09[_0xab44('0x14')]['where']||null:null,'attributes':_0x354b09[_0xab44('0x14')]?_0x354b09['options'][_0xab44('0x16')]||null:null,'limit':_0x354b09[_0xab44('0x14')]?_0x354b09[_0xab44('0x14')][_0xab44('0x17')]||null:null,'include':_0x354b09['options']?_0x354b09[_0xab44('0x14')][_0xab44('0x18')]?_[_0xab44('0x19')](_0x354b09[_0xab44('0x14')][_0xab44('0x18')],function(_0x402950){return{'model':db[_0x402950[_0xab44('0x1a')]],'as':_0x402950['as'],'attributes':_0x402950['attributes'],'include':_0x402950['include']?_[_0xab44('0x19')](_0x402950['include'],function(_0x2439f3){return{'model':db[_0x2439f3['model']],'as':_0x2439f3['as'],'attributes':_0x2439f3[_0xab44('0x16')],'include':_0x2439f3['include']?_['map'](_0x2439f3[_0xab44('0x18')],function(_0x25287b){return{'model':db[_0x25287b[_0xab44('0x1a')]],'as':_0x25287b['as'],'attributes':_0x25287b[_0xab44('0x16')]};}):[]};}):[]};}):[]:[]})[_0xab44('0x9')](function(_0x4e820c){logger[_0xab44('0x10')](_0xab44('0x12'),_0x354b09);logger['debug'](_0xab44('0x12'),_0x354b09,JSON[_0xab44('0xc')](_0x4e820c));_0x310b15(_0x4e820c);})[_0xab44('0x11')](function(_0x1cd486){logger[_0xab44('0xd')](_0xab44('0x12'),_0x1cd486['message'],_0x354b09);_0xc4b3dc(_0x44fa43[_0xab44('0xd')](0x1f4,_0x1cd486[_0xab44('0xf')]));});});};exports[_0xab44('0x1b')]=function(_0x47e1be){var _0x54cac8=this;return new Promise(function(_0x106d3a,_0x5082e4){return db['FreshsalesAccount'][_0xab44('0x1c')]({'raw':_0x47e1be[_0xab44('0x14')]?_0x47e1be[_0xab44('0x14')][_0xab44('0x15')]===undefined?!![]:![]:!![],'where':_0x47e1be[_0xab44('0x14')]?_0x47e1be[_0xab44('0x14')][_0xab44('0x1d')]||null:null,'attributes':_0x47e1be[_0xab44('0x14')]?_0x47e1be[_0xab44('0x14')][_0xab44('0x16')]||null:null,'include':_0x47e1be[_0xab44('0x14')]?_0x47e1be[_0xab44('0x14')][_0xab44('0x18')]?_[_0xab44('0x19')](_0x47e1be['options']['include'],function(_0x27e318){return{'model':db[_0x27e318[_0xab44('0x1a')]],'as':_0x27e318['as'],'attributes':_0x27e318['attributes'],'include':_0x27e318[_0xab44('0x18')]?_[_0xab44('0x19')](_0x27e318[_0xab44('0x18')],function(_0x1e0be7){return{'model':db[_0x1e0be7[_0xab44('0x1a')]],'as':_0x1e0be7['as'],'attributes':_0x1e0be7[_0xab44('0x16')],'include':_0x1e0be7[_0xab44('0x18')]?_[_0xab44('0x19')](_0x1e0be7[_0xab44('0x18')],function(_0xe26f9f){return{'model':db[_0xe26f9f[_0xab44('0x1a')]],'as':_0xe26f9f['as'],'attributes':_0xe26f9f[_0xab44('0x16')]};}):[]};}):[]};}):[]:[]})[_0xab44('0x9')](function(_0x532aad){logger[_0xab44('0x10')](_0xab44('0x1b'),_0x47e1be);logger[_0xab44('0xb')](_0xab44('0x1b'),_0x47e1be,JSON['stringify'](_0x532aad));_0x106d3a(_0x532aad);})[_0xab44('0x11')](function(_0x31b599){logger[_0xab44('0xd')](_0xab44('0x1b'),_0x31b599['message'],_0x47e1be);_0x5082e4(_0x54cac8[_0xab44('0xd')](0x1f4,_0x31b599[_0xab44('0xf')]));});});}; \ No newline at end of file +var _0x0a6b=['find','map','lodash','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','FreshsalesAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','where','attributes','limit','include','model','then','debug','stringify','catch','ShowFreshsalesAccount'];(function(_0x13ce0c,_0x3f2a0d){var _0x4388fb=function(_0x27db4b){while(--_0x27db4b){_0x13ce0c['push'](_0x13ce0c['shift']());}};_0x4388fb(++_0x3f2a0d);}(_0x0a6b,0x18e));var _0xb0a6=function(_0x1630e0,_0x5d7ca4){_0x1630e0=_0x1630e0-0x0;var _0x236652=_0x0a6b[_0x1630e0];return _0x236652;};'use strict';var _=require(_0xb0a6('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb0a6('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb0a6('0x2'))['db'];var utils=require(_0xb0a6('0x3'));var logger=require(_0xb0a6('0x4'))('rpc');var config=require(_0xb0a6('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xb0a6('0x6')][_0xb0a6('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5e2d2d,_0x11cd5b,_0x24515c){return new BPromise(function(_0x2a8516,_0x530c05){return client['request'](_0x5e2d2d,_0x24515c)['then'](function(_0x2ded05){logger[_0xb0a6('0x8')](_0xb0a6('0x9'),_0x11cd5b,_0xb0a6('0xa'));logger['debug'](_0xb0a6('0xb'),_0x11cd5b,_0xb0a6('0xa'),JSON['stringify'](_0x2ded05));if(_0x2ded05[_0xb0a6('0xc')]){if(_0x2ded05[_0xb0a6('0xc')][_0xb0a6('0xd')]===0x1f4){logger[_0xb0a6('0xc')](_0xb0a6('0x9'),_0x11cd5b,_0x2ded05[_0xb0a6('0xc')][_0xb0a6('0xe')]);return _0x530c05(_0x2ded05[_0xb0a6('0xc')][_0xb0a6('0xe')]);}logger[_0xb0a6('0xc')]('FreshsalesAccount,\x20%s,\x20%s',_0x11cd5b,_0x2ded05[_0xb0a6('0xc')]['message']);return _0x2a8516(_0x2ded05[_0xb0a6('0xc')]['message']);}else{logger[_0xb0a6('0x8')]('FreshsalesAccount,\x20%s,\x20%s',_0x11cd5b,_0xb0a6('0xa'));_0x2a8516(_0x2ded05[_0xb0a6('0xf')][_0xb0a6('0xe')]);}})['catch'](function(_0x56b594){logger[_0xb0a6('0xc')](_0xb0a6('0x9'),_0x11cd5b,_0x56b594);_0x530c05(_0x56b594);});});}exports[_0xb0a6('0x10')]=function(_0x18f994){var _0x10f504=this;return new Promise(function(_0x13a1c8,_0x567dd5){return db[_0xb0a6('0x11')][_0xb0a6('0x12')]({'raw':_0x18f994[_0xb0a6('0x13')]?_0x18f994[_0xb0a6('0x13')][_0xb0a6('0x14')]===undefined?!![]:![]:!![],'where':_0x18f994[_0xb0a6('0x13')]?_0x18f994['options'][_0xb0a6('0x15')]||null:null,'attributes':_0x18f994[_0xb0a6('0x13')]?_0x18f994[_0xb0a6('0x13')][_0xb0a6('0x16')]||null:null,'limit':_0x18f994[_0xb0a6('0x13')]?_0x18f994[_0xb0a6('0x13')][_0xb0a6('0x17')]||null:null,'include':_0x18f994[_0xb0a6('0x13')]?_0x18f994['options'][_0xb0a6('0x18')]?_['map'](_0x18f994[_0xb0a6('0x13')][_0xb0a6('0x18')],function(_0x4997df){return{'model':db[_0x4997df['model']],'as':_0x4997df['as'],'attributes':_0x4997df[_0xb0a6('0x16')],'include':_0x4997df[_0xb0a6('0x18')]?_['map'](_0x4997df[_0xb0a6('0x18')],function(_0x24574a){return{'model':db[_0x24574a[_0xb0a6('0x19')]],'as':_0x24574a['as'],'attributes':_0x24574a[_0xb0a6('0x16')],'include':_0x24574a['include']?_['map'](_0x24574a[_0xb0a6('0x18')],function(_0x1e9947){return{'model':db[_0x1e9947[_0xb0a6('0x19')]],'as':_0x1e9947['as'],'attributes':_0x1e9947['attributes']};}):[]};}):[]};}):[]:[]})[_0xb0a6('0x1a')](function(_0x3347ac){logger[_0xb0a6('0x8')](_0xb0a6('0x10'),_0x18f994);logger[_0xb0a6('0x1b')](_0xb0a6('0x10'),_0x18f994,JSON[_0xb0a6('0x1c')](_0x3347ac));_0x13a1c8(_0x3347ac);})[_0xb0a6('0x1d')](function(_0x4255b9){logger['error'](_0xb0a6('0x10'),_0x4255b9[_0xb0a6('0xe')],_0x18f994);_0x567dd5(_0x10f504[_0xb0a6('0xc')](0x1f4,_0x4255b9['message']));});});};exports[_0xb0a6('0x1e')]=function(_0x582fc2){var _0x131e46=this;return new Promise(function(_0x309a91,_0x114f91){return db[_0xb0a6('0x11')][_0xb0a6('0x1f')]({'raw':_0x582fc2[_0xb0a6('0x13')]?_0x582fc2[_0xb0a6('0x13')][_0xb0a6('0x14')]===undefined?!![]:![]:!![],'where':_0x582fc2[_0xb0a6('0x13')]?_0x582fc2[_0xb0a6('0x13')]['where']||null:null,'attributes':_0x582fc2['options']?_0x582fc2[_0xb0a6('0x13')][_0xb0a6('0x16')]||null:null,'include':_0x582fc2[_0xb0a6('0x13')]?_0x582fc2[_0xb0a6('0x13')][_0xb0a6('0x18')]?_[_0xb0a6('0x20')](_0x582fc2[_0xb0a6('0x13')][_0xb0a6('0x18')],function(_0x4b0479){return{'model':db[_0x4b0479[_0xb0a6('0x19')]],'as':_0x4b0479['as'],'attributes':_0x4b0479[_0xb0a6('0x16')],'include':_0x4b0479['include']?_[_0xb0a6('0x20')](_0x4b0479[_0xb0a6('0x18')],function(_0x52e397){return{'model':db[_0x52e397['model']],'as':_0x52e397['as'],'attributes':_0x52e397[_0xb0a6('0x16')],'include':_0x52e397[_0xb0a6('0x18')]?_[_0xb0a6('0x20')](_0x52e397[_0xb0a6('0x18')],function(_0x4310ae){return{'model':db[_0x4310ae[_0xb0a6('0x19')]],'as':_0x4310ae['as'],'attributes':_0x4310ae['attributes']};}):[]};}):[]};}):[]:[]})[_0xb0a6('0x1a')](function(_0x5c280e){logger[_0xb0a6('0x8')](_0xb0a6('0x1e'),_0x582fc2);logger['debug']('ShowFreshsalesAccount',_0x582fc2,JSON['stringify'](_0x5c280e));_0x309a91(_0x5c280e);})[_0xb0a6('0x1d')](function(_0xd484f){logger[_0xb0a6('0xc')](_0xb0a6('0x1e'),_0xd484f[_0xb0a6('0xe')],_0x582fc2);_0x114f91(_0x131e46['error'](0x1f4,_0xd484f[_0xb0a6('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index c059b67..0a45151 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 _0x1250=['getFields','post','create','put','update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','getSubjects','/:id/descriptions','getDescriptions'];(function(_0x505238,_0x528195){var _0x5977fe=function(_0xb61e93){while(--_0xb61e93){_0x505238['push'](_0x505238['shift']());}};_0x5977fe(++_0x528195);}(_0x1250,0x11c));var _0x0125=function(_0x381cd5,_0x1f66dd){_0x381cd5=_0x381cd5-0x0;var _0x14b162=_0x1250[_0x381cd5];return _0x14b162;};'use strict';var multer=require(_0x0125('0x0'));var util=require(_0x0125('0x1'));var path=require(_0x0125('0x2'));var timeout=require('connect-timeout');var express=require(_0x0125('0x3'));var router=express['Router']();var fs_extra=require(_0x0125('0x4'));var auth=require(_0x0125('0x5'));var interaction=require(_0x0125('0x6'));var config=require(_0x0125('0x7'));var controller=require('./intFreshsalesConfiguration.controller');router[_0x0125('0x8')]('/',auth[_0x0125('0x9')](),controller[_0x0125('0xa')]);router[_0x0125('0x8')](_0x0125('0xb'),auth['isAuthenticated'](),controller['show']);router['get']('/:id/subjects',auth[_0x0125('0x9')](),controller[_0x0125('0xc')]);router[_0x0125('0x8')](_0x0125('0xd'),auth['isAuthenticated'](),controller[_0x0125('0xe')]);router[_0x0125('0x8')]('/:id/fields',auth[_0x0125('0x9')](),controller[_0x0125('0xf')]);router[_0x0125('0x10')]('/',auth['isAuthenticated'](),controller[_0x0125('0x11')]);router[_0x0125('0x12')]('/:id',auth[_0x0125('0x9')](),controller[_0x0125('0x13')]);router[_0x0125('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x0125('0x15')]);module[_0x0125('0x16')]=router; \ No newline at end of file +var _0x8d0d=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','show','getSubjects','/:id/descriptions','/:id/fields','getFields','create','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x3d2d6f,_0x368872){var _0x5c0022=function(_0x408819){while(--_0x408819){_0x3d2d6f['push'](_0x3d2d6f['shift']());}};_0x5c0022(++_0x368872);}(_0x8d0d,0x120));var _0xd8d0=function(_0xdf703e,_0x1d44ce){_0xdf703e=_0xdf703e-0x0;var _0x29d406=_0x8d0d[_0xdf703e];return _0x29d406;};'use strict';var multer=require(_0xd8d0('0x0'));var util=require('util');var path=require(_0xd8d0('0x1'));var timeout=require(_0xd8d0('0x2'));var express=require(_0xd8d0('0x3'));var router=express[_0xd8d0('0x4')]();var fs_extra=require(_0xd8d0('0x5'));var auth=require(_0xd8d0('0x6'));var interaction=require(_0xd8d0('0x7'));var config=require(_0xd8d0('0x8'));var controller=require(_0xd8d0('0x9'));router[_0xd8d0('0xa')]('/',auth[_0xd8d0('0xb')](),controller[_0xd8d0('0xc')]);router[_0xd8d0('0xa')](_0xd8d0('0xd'),auth[_0xd8d0('0xb')](),controller[_0xd8d0('0xe')]);router[_0xd8d0('0xa')]('/:id/subjects',auth['isAuthenticated'](),controller[_0xd8d0('0xf')]);router[_0xd8d0('0xa')](_0xd8d0('0x10'),auth[_0xd8d0('0xb')](),controller['getDescriptions']);router[_0xd8d0('0xa')](_0xd8d0('0x11'),auth['isAuthenticated'](),controller[_0xd8d0('0x12')]);router['post']('/',auth['isAuthenticated'](),controller[_0xd8d0('0x13')]);router['put'](_0xd8d0('0xd'),auth[_0xd8d0('0xb')](),controller['update']);router['delete']('/:id',auth[_0xd8d0('0xb')](),controller['destroy']);module[_0xd8d0('0x14')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index d7ea44b..6af02e9 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 _0x531c=['STRING','sequelize','exports'];(function(_0x2c37b2,_0x107055){var _0x559312=function(_0x53e3d3){while(--_0x53e3d3){_0x2c37b2['push'](_0x2c37b2['shift']());}};_0x559312(++_0x107055);}(_0x531c,0x14b));var _0xc531=function(_0x2a2ef3,_0x25cbea){_0x2a2ef3=_0x2a2ef3-0x0;var _0x50c9e4=_0x531c[_0x2a2ef3];return _0x50c9e4;};'use strict';var Sequelize=require(_0xc531('0x0'));module[_0xc531('0x1')]={'name':{'type':Sequelize[_0xc531('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xc98e=['sequelize','exports','STRING'];(function(_0x1e577b,_0x287ef2){var _0xd77add=function(_0x4c0963){while(--_0x4c0963){_0x1e577b['push'](_0x1e577b['shift']());}};_0xd77add(++_0x287ef2);}(_0xc98e,0xb7));var _0xec98=function(_0x109544,_0x3fc5ff){_0x109544=_0x109544-0x0;var _0x20b142=_0xc98e[_0x109544];return _0x20b142;};'use strict';var Sequelize=require(_0xec98('0x0'));module[_0xec98('0x1')]={'name':{'type':Sequelize[_0xec98('0x2')]},'description':{'type':Sequelize[_0xec98('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 0f67a37..01d96c1 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 _0x8591=['error','name','send','index','map','FreshsalesConfiguration','rawAttributes','fieldName','type','key','keys','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','sort','filter','where','VIRTUAL','merge','options','findAll','rows','catch','show','includeAll','include','find','create','body','params','getSubjects','findOne','FreshsalesField','order','getDescriptions','pick','getFields','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','json','apply','reject','save','update','then','destroy'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x8591,0xd3));var _0x1859=function(_0x3061a1,_0x119d80){_0x3061a1=_0x3061a1-0x0;var _0x4108b6=_0x8591[_0x3061a1];return _0x4108b6;};'use strict';var emlformat=require(_0x1859('0x0'));var rimraf=require(_0x1859('0x1'));var zipdir=require(_0x1859('0x2'));var jsonpatch=require(_0x1859('0x3'));var rp=require(_0x1859('0x4'));var moment=require(_0x1859('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x1859('0x6'));var util=require(_0x1859('0x7'));var path=require(_0x1859('0x8'));var sox=require(_0x1859('0x9'));var csv=require(_0x1859('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1859('0xb'));var squel=require(_0x1859('0xc'));var crypto=require(_0x1859('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1859('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1859('0xf'));var Papa=require(_0x1859('0x10'));var Redis=require(_0x1859('0x11'));var authService=require(_0x1859('0x12'));var qs=require(_0x1859('0x13'));var as=require(_0x1859('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1859('0x15'))('api');var utils=require(_0x1859('0x16'));var config=require(_0x1859('0x17'));var licenseUtil=require(_0x1859('0x18'));var db=require(_0x1859('0x19'))['db'];function respondWithStatusCode(_0x143578,_0x24bcb3){_0x24bcb3=_0x24bcb3||0xcc;return function(_0x262123){if(_0x262123){return _0x143578[_0x1859('0x1a')](_0x24bcb3);}return _0x143578[_0x1859('0x1b')](_0x24bcb3)[_0x1859('0x1c')]();};}function respondWithResult(_0x4e1536,_0x39d533){_0x39d533=_0x39d533||0xc8;return function(_0x12fcd6){if(_0x12fcd6){return _0x4e1536['status'](_0x39d533)['json'](_0x12fcd6);}};}function respondWithFilteredResult(_0x101980,_0x4b25a1){return function(_0x50fb18){if(_0x50fb18){var _0x567091=typeof _0x4b25a1['offset']===_0x1859('0x1d')&&typeof _0x4b25a1[_0x1859('0x1e')]===_0x1859('0x1d');var _0x24d620=_0x50fb18[_0x1859('0x1f')];var _0x51628f=_0x567091?0x0:_0x4b25a1[_0x1859('0x20')];var _0x4bf686=_0x567091?_0x50fb18['count']:_0x4b25a1['offset']+_0x4b25a1[_0x1859('0x1e')];var _0x596e57;if(_0x4bf686>=_0x24d620){_0x4bf686=_0x24d620;_0x596e57=0xc8;}else{_0x596e57=0xce;}_0x101980[_0x1859('0x1b')](_0x596e57);return _0x101980[_0x1859('0x21')]('Content-Range',_0x51628f+'-'+_0x4bf686+'/'+_0x24d620)[_0x1859('0x22')](_0x50fb18);}return null;};}function patchUpdates(_0x3d29aa){return function(_0x235c27){try{jsonpatch[_0x1859('0x23')](_0x235c27,_0x3d29aa,!![]);}catch(_0x2c6c16){return BPromise[_0x1859('0x24')](_0x2c6c16);}return _0x235c27[_0x1859('0x25')]();};}function saveUpdates(_0x3e3caa,_0x3ccdc5){return function(_0x8d1000){if(_0x8d1000){return _0x8d1000[_0x1859('0x26')](_0x3e3caa)[_0x1859('0x27')](function(_0xa8042f){return _0xa8042f;});}return null;};}function removeEntity(_0xcb7544,_0x571baa){return function(_0x439720){if(_0x439720){return _0x439720[_0x1859('0x28')]()[_0x1859('0x27')](function(){_0xcb7544['status'](0xcc)[_0x1859('0x1c')]();});}};}function handleEntityNotFound(_0x34508e,_0x24baf9){return function(_0x35fa4e){if(!_0x35fa4e){_0x34508e[_0x1859('0x1a')](0x194);}return _0x35fa4e;};}function handleError(_0x8caae8,_0x4807dc){_0x4807dc=_0x4807dc||0x1f4;return function(_0x25800c){logger[_0x1859('0x29')](_0x25800c['stack']);if(_0x25800c[_0x1859('0x2a')]){delete _0x25800c[_0x1859('0x2a')];}_0x8caae8[_0x1859('0x1b')](_0x4807dc)[_0x1859('0x2b')](_0x25800c);};}exports[_0x1859('0x2c')]=function(_0xbe04d4,_0x707b4){var _0x241058={},_0xa00d68={},_0x31ad9c={'count':0x0,'rows':[]};var _0x82233=_[_0x1859('0x2d')](db[_0x1859('0x2e')][_0x1859('0x2f')],function(_0x56f038){return{'name':_0x56f038[_0x1859('0x30')],'type':_0x56f038[_0x1859('0x31')][_0x1859('0x32')]};});_0xa00d68['model']=_[_0x1859('0x2d')](_0x82233,_0x1859('0x2a'));_0xa00d68['query']=_[_0x1859('0x33')](_0xbe04d4[_0x1859('0x34')]);_0xa00d68[_0x1859('0x35')]=_[_0x1859('0x36')](_0xa00d68['model'],_0xa00d68[_0x1859('0x34')]);_0x241058[_0x1859('0x37')]=_[_0x1859('0x36')](_0xa00d68['model'],qs[_0x1859('0x38')](_0xbe04d4['query']['fields']));_0x241058[_0x1859('0x37')]=_0x241058['attributes'][_0x1859('0x39')]?_0x241058[_0x1859('0x37')]:_0xa00d68[_0x1859('0x3a')];if(!_0xbe04d4[_0x1859('0x34')][_0x1859('0x3b')](_0x1859('0x3c'))){_0x241058[_0x1859('0x1e')]=qs[_0x1859('0x1e')](_0xbe04d4[_0x1859('0x34')][_0x1859('0x1e')]);_0x241058[_0x1859('0x20')]=qs[_0x1859('0x20')](_0xbe04d4[_0x1859('0x34')]['offset']);}_0x241058['order']=qs['sort'](_0xbe04d4['query'][_0x1859('0x3d')]);_0x241058['where']=qs[_0x1859('0x35')](_['pick'](_0xbe04d4[_0x1859('0x34')],_0xa00d68[_0x1859('0x35')]),_0x82233);if(_0xbe04d4[_0x1859('0x34')][_0x1859('0x3e')]){_0x241058[_0x1859('0x3f')]=_['merge'](_0x241058[_0x1859('0x3f')],{'$or':_[_0x1859('0x2d')](_0x82233,function(_0xacf483){if(_0xacf483['type']!==_0x1859('0x40')){var _0x25461f={};_0x25461f[_0xacf483[_0x1859('0x2a')]]={'$like':'%'+_0xbe04d4[_0x1859('0x34')][_0x1859('0x3e')]+'%'};return _0x25461f;}})});}_0x241058=_[_0x1859('0x41')]({},_0x241058,_0xbe04d4[_0x1859('0x42')]);var _0x3319ff={'where':_0x241058[_0x1859('0x3f')]};return db['FreshsalesConfiguration'][_0x1859('0x1f')](_0x3319ff)['then'](function(_0x56ba9a){_0x31ad9c['count']=_0x56ba9a;if(_0xbe04d4[_0x1859('0x34')]['includeAll']){_0x241058['include']=[{'all':!![]}];}return db[_0x1859('0x2e')][_0x1859('0x43')](_0x241058);})[_0x1859('0x27')](function(_0x260b52){_0x31ad9c[_0x1859('0x44')]=_0x260b52;return _0x31ad9c;})['then'](respondWithFilteredResult(_0x707b4,_0x241058))[_0x1859('0x45')](handleError(_0x707b4,null));};exports[_0x1859('0x46')]=function(_0x598de1,_0x4e7839){var _0x24bffd={'raw':![],'where':{'id':_0x598de1['params']['id']}},_0xa0e988={};_0xa0e988[_0x1859('0x3a')]=_[_0x1859('0x33')](db[_0x1859('0x2e')][_0x1859('0x2f')]);_0xa0e988['query']=_[_0x1859('0x33')](_0x598de1[_0x1859('0x34')]);_0xa0e988[_0x1859('0x35')]=_[_0x1859('0x36')](_0xa0e988[_0x1859('0x3a')],_0xa0e988['query']);_0x24bffd[_0x1859('0x37')]=_['intersection'](_0xa0e988[_0x1859('0x3a')],qs[_0x1859('0x38')](_0x598de1[_0x1859('0x34')][_0x1859('0x38')]));_0x24bffd[_0x1859('0x37')]=_0x24bffd[_0x1859('0x37')][_0x1859('0x39')]?_0x24bffd[_0x1859('0x37')]:_0xa0e988[_0x1859('0x3a')];if(_0x598de1[_0x1859('0x34')][_0x1859('0x47')]){_0x24bffd[_0x1859('0x48')]=[{'all':!![]}];}_0x24bffd=_[_0x1859('0x41')]({},_0x24bffd,_0x598de1[_0x1859('0x42')]);return db[_0x1859('0x2e')][_0x1859('0x49')](_0x24bffd)[_0x1859('0x27')](handleEntityNotFound(_0x4e7839,null))[_0x1859('0x27')](respondWithResult(_0x4e7839,null))[_0x1859('0x45')](handleError(_0x4e7839,null));};exports[_0x1859('0x4a')]=function(_0x58537,_0xdd5b7){return db[_0x1859('0x2e')][_0x1859('0x4a')](_0x58537[_0x1859('0x4b')],{})[_0x1859('0x27')](respondWithResult(_0xdd5b7,0xc9))['catch'](handleError(_0xdd5b7,null));};exports[_0x1859('0x26')]=function(_0x42d704,_0x4f0e9b){if(_0x42d704[_0x1859('0x4b')]['id']){delete _0x42d704[_0x1859('0x4b')]['id'];}return db['FreshsalesConfiguration'][_0x1859('0x49')]({'where':{'id':_0x42d704[_0x1859('0x4c')]['id']}})[_0x1859('0x27')](handleEntityNotFound(_0x4f0e9b,null))[_0x1859('0x27')](saveUpdates(_0x42d704[_0x1859('0x4b')],null))['then'](respondWithResult(_0x4f0e9b,null))[_0x1859('0x45')](handleError(_0x4f0e9b,null));};exports[_0x1859('0x28')]=function(_0x55be31,_0x1ba41b){return db[_0x1859('0x2e')][_0x1859('0x49')]({'where':{'id':_0x55be31['params']['id']}})[_0x1859('0x27')](handleEntityNotFound(_0x1ba41b,null))['then'](removeEntity(_0x1ba41b,null))['catch'](handleError(_0x1ba41b,null));};exports[_0x1859('0x4d')]=function(_0x529c65,_0x202a99,_0x4ab714){var _0xeb35b4={};var _0x2b614e={};var _0x82a61b;var _0x10cc42;return db[_0x1859('0x2e')][_0x1859('0x4e')]({'where':{'id':_0x529c65[_0x1859('0x4c')]['id']}})[_0x1859('0x27')](handleEntityNotFound(_0x202a99,null))['then'](function(_0x3d7209){if(_0x3d7209){_0x82a61b=_0x3d7209;_0x2b614e['model']=_[_0x1859('0x33')](db[_0x1859('0x4f')][_0x1859('0x2f')]);_0x2b614e[_0x1859('0x34')]=_['keys'](_0x529c65[_0x1859('0x34')]);_0x2b614e[_0x1859('0x35')]=_[_0x1859('0x36')](_0x2b614e[_0x1859('0x3a')],_0x2b614e[_0x1859('0x34')]);_0xeb35b4[_0x1859('0x37')]=_['intersection'](_0x2b614e[_0x1859('0x3a')],qs['fields'](_0x529c65[_0x1859('0x34')][_0x1859('0x38')]));_0xeb35b4['attributes']=_0xeb35b4[_0x1859('0x37')][_0x1859('0x39')]?_0xeb35b4[_0x1859('0x37')]:_0x2b614e['model'];_0xeb35b4[_0x1859('0x50')]=qs['sort'](_0x529c65['query']['sort']);_0xeb35b4['where']=qs[_0x1859('0x35')](_['pick'](_0x529c65[_0x1859('0x34')],_0x2b614e[_0x1859('0x35')]));if(_0x529c65['query'][_0x1859('0x3e')]){_0xeb35b4[_0x1859('0x3f')]=_[_0x1859('0x41')](_0xeb35b4[_0x1859('0x3f')],{'$or':_['map'](_0xeb35b4[_0x1859('0x37')],function(_0x58a5a4){var _0x2ae5f3={};_0x2ae5f3[_0x58a5a4]={'$like':'%'+_0x529c65['query']['filter']+'%'};return _0x2ae5f3;})});}_0xeb35b4=_[_0x1859('0x41')]({},_0xeb35b4,_0x529c65[_0x1859('0x42')]);return _0x82a61b['getSubjects'](_0xeb35b4);}})[_0x1859('0x27')](function(_0x2fea0d){if(_0x2fea0d){_0x10cc42=_0x2fea0d['length'];if(!_0x529c65[_0x1859('0x34')][_0x1859('0x3b')](_0x1859('0x3c'))){_0xeb35b4[_0x1859('0x1e')]=qs[_0x1859('0x1e')](_0x529c65[_0x1859('0x34')][_0x1859('0x1e')]);_0xeb35b4[_0x1859('0x20')]=qs['offset'](_0x529c65[_0x1859('0x34')][_0x1859('0x20')]);}return _0x82a61b[_0x1859('0x4d')](_0xeb35b4);}})['then'](function(_0x32544c){if(_0x32544c){return _0x32544c?{'count':_0x10cc42,'rows':_0x32544c}:null;}})[_0x1859('0x27')](respondWithResult(_0x202a99,null))[_0x1859('0x45')](handleError(_0x202a99,null));};exports[_0x1859('0x51')]=function(_0xf33ddd,_0x5bbd5d,_0x8f789d){var _0x1e4808={};var _0x3b6cee={};var _0x1a6c2d;var _0x5c3c15;return db[_0x1859('0x2e')]['findOne']({'where':{'id':_0xf33ddd[_0x1859('0x4c')]['id']}})[_0x1859('0x27')](handleEntityNotFound(_0x5bbd5d,null))['then'](function(_0x676450){if(_0x676450){_0x1a6c2d=_0x676450;_0x3b6cee[_0x1859('0x3a')]=_['keys'](db['FreshsalesField'][_0x1859('0x2f')]);_0x3b6cee[_0x1859('0x34')]=_[_0x1859('0x33')](_0xf33ddd[_0x1859('0x34')]);_0x3b6cee[_0x1859('0x35')]=_[_0x1859('0x36')](_0x3b6cee['model'],_0x3b6cee['query']);_0x1e4808['attributes']=_[_0x1859('0x36')](_0x3b6cee[_0x1859('0x3a')],qs[_0x1859('0x38')](_0xf33ddd[_0x1859('0x34')][_0x1859('0x38')]));_0x1e4808[_0x1859('0x37')]=_0x1e4808[_0x1859('0x37')][_0x1859('0x39')]?_0x1e4808[_0x1859('0x37')]:_0x3b6cee[_0x1859('0x3a')];_0x1e4808[_0x1859('0x50')]=qs[_0x1859('0x3d')](_0xf33ddd['query'][_0x1859('0x3d')]);_0x1e4808[_0x1859('0x3f')]=qs[_0x1859('0x35')](_[_0x1859('0x52')](_0xf33ddd[_0x1859('0x34')],_0x3b6cee[_0x1859('0x35')]));if(_0xf33ddd[_0x1859('0x34')]['filter']){_0x1e4808['where']=_[_0x1859('0x41')](_0x1e4808[_0x1859('0x3f')],{'$or':_[_0x1859('0x2d')](_0x1e4808[_0x1859('0x37')],function(_0x1b52c6){var _0x2892ba={};_0x2892ba[_0x1b52c6]={'$like':'%'+_0xf33ddd[_0x1859('0x34')][_0x1859('0x3e')]+'%'};return _0x2892ba;})});}_0x1e4808=_['merge']({},_0x1e4808,_0xf33ddd['options']);return _0x1a6c2d[_0x1859('0x51')](_0x1e4808);}})[_0x1859('0x27')](function(_0x149863){if(_0x149863){_0x5c3c15=_0x149863['length'];if(!_0xf33ddd[_0x1859('0x34')][_0x1859('0x3b')]('nolimit')){_0x1e4808[_0x1859('0x1e')]=qs[_0x1859('0x1e')](_0xf33ddd[_0x1859('0x34')][_0x1859('0x1e')]);_0x1e4808[_0x1859('0x20')]=qs[_0x1859('0x20')](_0xf33ddd[_0x1859('0x34')][_0x1859('0x20')]);}return _0x1a6c2d[_0x1859('0x51')](_0x1e4808);}})[_0x1859('0x27')](function(_0x1bccfa){if(_0x1bccfa){return _0x1bccfa?{'count':_0x5c3c15,'rows':_0x1bccfa}:null;}})['then'](respondWithResult(_0x5bbd5d,null))[_0x1859('0x45')](handleError(_0x5bbd5d,null));};exports['getFields']=function(_0x2acd7a,_0x16bd93,_0x131b67){var _0x1603da={};var _0x418606={};var _0x366253;var _0x2a4b82;return db[_0x1859('0x2e')][_0x1859('0x4e')]({'where':{'id':_0x2acd7a[_0x1859('0x4c')]['id']}})[_0x1859('0x27')](handleEntityNotFound(_0x16bd93,null))['then'](function(_0x9861d3){if(_0x9861d3){_0x366253=_0x9861d3;_0x418606[_0x1859('0x3a')]=_[_0x1859('0x33')](db['FreshsalesField'][_0x1859('0x2f')]);_0x418606[_0x1859('0x34')]=_[_0x1859('0x33')](_0x2acd7a[_0x1859('0x34')]);_0x418606[_0x1859('0x35')]=_[_0x1859('0x36')](_0x418606[_0x1859('0x3a')],_0x418606['query']);_0x1603da[_0x1859('0x37')]=_[_0x1859('0x36')](_0x418606[_0x1859('0x3a')],qs[_0x1859('0x38')](_0x2acd7a['query'][_0x1859('0x38')]));_0x1603da[_0x1859('0x37')]=_0x1603da[_0x1859('0x37')][_0x1859('0x39')]?_0x1603da['attributes']:_0x418606[_0x1859('0x3a')];_0x1603da[_0x1859('0x50')]=qs[_0x1859('0x3d')](_0x2acd7a['query'][_0x1859('0x3d')]);_0x1603da['where']=qs[_0x1859('0x35')](_[_0x1859('0x52')](_0x2acd7a['query'],_0x418606['filters']));if(_0x2acd7a['query'][_0x1859('0x3e')]){_0x1603da[_0x1859('0x3f')]=_[_0x1859('0x41')](_0x1603da[_0x1859('0x3f')],{'$or':_['map'](_0x1603da['attributes'],function(_0x4313f5){var _0xefd395={};_0xefd395[_0x4313f5]={'$like':'%'+_0x2acd7a[_0x1859('0x34')][_0x1859('0x3e')]+'%'};return _0xefd395;})});}_0x1603da=_[_0x1859('0x41')]({},_0x1603da,_0x2acd7a[_0x1859('0x42')]);return _0x366253[_0x1859('0x53')](_0x1603da);}})['then'](function(_0x1f4173){if(_0x1f4173){_0x2a4b82=_0x1f4173[_0x1859('0x39')];if(!_0x2acd7a['query'][_0x1859('0x3b')]('nolimit')){_0x1603da[_0x1859('0x1e')]=qs[_0x1859('0x1e')](_0x2acd7a[_0x1859('0x34')][_0x1859('0x1e')]);_0x1603da['offset']=qs[_0x1859('0x20')](_0x2acd7a[_0x1859('0x34')][_0x1859('0x20')]);}return _0x366253[_0x1859('0x53')](_0x1603da);}})[_0x1859('0x27')](function(_0x9273bd){if(_0x9273bd){return _0x9273bd?{'count':_0x2a4b82,'rows':_0x9273bd}:null;}})[_0x1859('0x27')](respondWithResult(_0x16bd93,null))[_0x1859('0x45')](handleError(_0x16bd93,null));}; \ No newline at end of file +var _0x0453=['FreshsalesConfiguration','includeAll','include','findAll','then','show','params','length','find','catch','create','body','getSubjects','map','FreshsalesField','getDescriptions','getFields','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','end','error','name','send','index','rawAttributes','fieldName','type','key','keys','query','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options'];(function(_0x4910ca,_0x298ecc){var _0x5f2e8a=function(_0x29d850){while(--_0x29d850){_0x4910ca['push'](_0x4910ca['shift']());}};_0x5f2e8a(++_0x298ecc);}(_0x0453,0x155));var _0x3045=function(_0xb40c65,_0x275f76){_0xb40c65=_0xb40c65-0x0;var _0x278eda=_0x0453[_0xb40c65];return _0x278eda;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3045('0x0'));var zipdir=require(_0x3045('0x1'));var jsonpatch=require(_0x3045('0x2'));var rp=require('request-promise');var moment=require(_0x3045('0x3'));var BPromise=require(_0x3045('0x4'));var Mustache=require(_0x3045('0x5'));var util=require(_0x3045('0x6'));var path=require(_0x3045('0x7'));var sox=require(_0x3045('0x8'));var csv=require(_0x3045('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3045('0xa'));var _=require(_0x3045('0xb'));var squel=require(_0x3045('0xc'));var crypto=require('crypto');var jsforce=require(_0x3045('0xd'));var deskjs=require(_0x3045('0xe'));var toCsv=require(_0x3045('0x9'));var querystring=require(_0x3045('0xf'));var Papa=require(_0x3045('0x10'));var Redis=require(_0x3045('0x11'));var authService=require(_0x3045('0x12'));var qs=require(_0x3045('0x13'));var as=require(_0x3045('0x14'));var hardwareService=require(_0x3045('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x3045('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x3045('0x17'));var db=require(_0x3045('0x18'))['db'];function respondWithStatusCode(_0xe6131f,_0x56c056){_0x56c056=_0x56c056||0xcc;return function(_0x47257d){if(_0x47257d){return _0xe6131f[_0x3045('0x19')](_0x56c056);}return _0xe6131f['status'](_0x56c056)['end']();};}function respondWithResult(_0x379023,_0x146665){_0x146665=_0x146665||0xc8;return function(_0x1025dd){if(_0x1025dd){return _0x379023['status'](_0x146665)[_0x3045('0x1a')](_0x1025dd);}};}function respondWithFilteredResult(_0xda1a97,_0x522a49){return function(_0x3ca5aa){if(_0x3ca5aa){var _0x3cc99e=typeof _0x522a49[_0x3045('0x1b')]===_0x3045('0x1c')&&typeof _0x522a49[_0x3045('0x1d')]===_0x3045('0x1c');var _0x1c67dc=_0x3ca5aa[_0x3045('0x1e')];var _0x53055a=_0x3cc99e?0x0:_0x522a49[_0x3045('0x1b')];var _0x164f8f=_0x3cc99e?_0x3ca5aa[_0x3045('0x1e')]:_0x522a49[_0x3045('0x1b')]+_0x522a49[_0x3045('0x1d')];var _0x3b0b6a;if(_0x164f8f>=_0x1c67dc){_0x164f8f=_0x1c67dc;_0x3b0b6a=0xc8;}else{_0x3b0b6a=0xce;}_0xda1a97[_0x3045('0x1f')](_0x3b0b6a);return _0xda1a97[_0x3045('0x20')](_0x3045('0x21'),_0x53055a+'-'+_0x164f8f+'/'+_0x1c67dc)['json'](_0x3ca5aa);}return null;};}function patchUpdates(_0x10b960){return function(_0x157dfa){try{jsonpatch[_0x3045('0x22')](_0x157dfa,_0x10b960,!![]);}catch(_0x432e0a){return BPromise[_0x3045('0x23')](_0x432e0a);}return _0x157dfa[_0x3045('0x24')]();};}function saveUpdates(_0xfcfcac,_0x19e11e){return function(_0x9dc8ae){if(_0x9dc8ae){return _0x9dc8ae[_0x3045('0x25')](_0xfcfcac)['then'](function(_0x2327ab){return _0x2327ab;});}return null;};}function removeEntity(_0x30c44f,_0x56799b){return function(_0x297093){if(_0x297093){return _0x297093['destroy']()['then'](function(){_0x30c44f[_0x3045('0x1f')](0xcc)[_0x3045('0x26')]();});}};}function handleEntityNotFound(_0x152e4e,_0x21e002){return function(_0x32c650){if(!_0x32c650){_0x152e4e['sendStatus'](0x194);}return _0x32c650;};}function handleError(_0x512c33,_0x5bada7){_0x5bada7=_0x5bada7||0x1f4;return function(_0x1582be){logger[_0x3045('0x27')](_0x1582be['stack']);if(_0x1582be[_0x3045('0x28')]){delete _0x1582be[_0x3045('0x28')];}_0x512c33[_0x3045('0x1f')](_0x5bada7)[_0x3045('0x29')](_0x1582be);};}exports[_0x3045('0x2a')]=function(_0x19c151,_0x4689e3){var _0x56fb89={},_0xd8ffee={},_0x119b2b={'count':0x0,'rows':[]};var _0x38dca2=_['map'](db['FreshsalesConfiguration'][_0x3045('0x2b')],function(_0x53b6be){return{'name':_0x53b6be[_0x3045('0x2c')],'type':_0x53b6be[_0x3045('0x2d')][_0x3045('0x2e')]};});_0xd8ffee['model']=_['map'](_0x38dca2,_0x3045('0x28'));_0xd8ffee['query']=_[_0x3045('0x2f')](_0x19c151[_0x3045('0x30')]);_0xd8ffee['filters']=_['intersection'](_0xd8ffee[_0x3045('0x31')],_0xd8ffee[_0x3045('0x30')]);_0x56fb89[_0x3045('0x32')]=_[_0x3045('0x33')](_0xd8ffee['model'],qs['fields'](_0x19c151[_0x3045('0x30')][_0x3045('0x34')]));_0x56fb89[_0x3045('0x32')]=_0x56fb89[_0x3045('0x32')]['length']?_0x56fb89[_0x3045('0x32')]:_0xd8ffee[_0x3045('0x31')];if(!_0x19c151[_0x3045('0x30')][_0x3045('0x35')](_0x3045('0x36'))){_0x56fb89[_0x3045('0x1d')]=qs[_0x3045('0x1d')](_0x19c151[_0x3045('0x30')][_0x3045('0x1d')]);_0x56fb89[_0x3045('0x1b')]=qs['offset'](_0x19c151[_0x3045('0x30')][_0x3045('0x1b')]);}_0x56fb89[_0x3045('0x37')]=qs[_0x3045('0x38')](_0x19c151['query'][_0x3045('0x38')]);_0x56fb89[_0x3045('0x39')]=qs['filters'](_[_0x3045('0x3a')](_0x19c151[_0x3045('0x30')],_0xd8ffee[_0x3045('0x3b')]),_0x38dca2);if(_0x19c151[_0x3045('0x30')][_0x3045('0x3c')]){_0x56fb89[_0x3045('0x39')]=_[_0x3045('0x3d')](_0x56fb89[_0x3045('0x39')],{'$or':_['map'](_0x38dca2,function(_0x231077){if(_0x231077[_0x3045('0x2d')]!==_0x3045('0x3e')){var _0x585b97={};_0x585b97[_0x231077['name']]={'$like':'%'+_0x19c151[_0x3045('0x30')]['filter']+'%'};return _0x585b97;}})});}_0x56fb89=_[_0x3045('0x3d')]({},_0x56fb89,_0x19c151[_0x3045('0x3f')]);var _0x32a5a5={'where':_0x56fb89[_0x3045('0x39')]};return db[_0x3045('0x40')][_0x3045('0x1e')](_0x32a5a5)['then'](function(_0x4f2380){_0x119b2b[_0x3045('0x1e')]=_0x4f2380;if(_0x19c151[_0x3045('0x30')][_0x3045('0x41')]){_0x56fb89[_0x3045('0x42')]=[{'all':!![]}];}return db[_0x3045('0x40')][_0x3045('0x43')](_0x56fb89);})[_0x3045('0x44')](function(_0x8707d7){_0x119b2b['rows']=_0x8707d7;return _0x119b2b;})['then'](respondWithFilteredResult(_0x4689e3,_0x56fb89))['catch'](handleError(_0x4689e3,null));};exports[_0x3045('0x45')]=function(_0x48681c,_0xae7fd1){var _0xde521a={'raw':![],'where':{'id':_0x48681c[_0x3045('0x46')]['id']}},_0x2ac9ef={};_0x2ac9ef[_0x3045('0x31')]=_[_0x3045('0x2f')](db[_0x3045('0x40')][_0x3045('0x2b')]);_0x2ac9ef[_0x3045('0x30')]=_['keys'](_0x48681c[_0x3045('0x30')]);_0x2ac9ef[_0x3045('0x3b')]=_[_0x3045('0x33')](_0x2ac9ef[_0x3045('0x31')],_0x2ac9ef[_0x3045('0x30')]);_0xde521a['attributes']=_[_0x3045('0x33')](_0x2ac9ef[_0x3045('0x31')],qs[_0x3045('0x34')](_0x48681c[_0x3045('0x30')][_0x3045('0x34')]));_0xde521a[_0x3045('0x32')]=_0xde521a[_0x3045('0x32')][_0x3045('0x47')]?_0xde521a[_0x3045('0x32')]:_0x2ac9ef[_0x3045('0x31')];if(_0x48681c[_0x3045('0x30')][_0x3045('0x41')]){_0xde521a['include']=[{'all':!![]}];}_0xde521a=_[_0x3045('0x3d')]({},_0xde521a,_0x48681c[_0x3045('0x3f')]);return db[_0x3045('0x40')][_0x3045('0x48')](_0xde521a)[_0x3045('0x44')](handleEntityNotFound(_0xae7fd1,null))[_0x3045('0x44')](respondWithResult(_0xae7fd1,null))[_0x3045('0x49')](handleError(_0xae7fd1,null));};exports[_0x3045('0x4a')]=function(_0x17162c,_0x4e4532){return db[_0x3045('0x40')]['create'](_0x17162c[_0x3045('0x4b')],{})[_0x3045('0x44')](respondWithResult(_0x4e4532,0xc9))[_0x3045('0x49')](handleError(_0x4e4532,null));};exports[_0x3045('0x25')]=function(_0x5ae9d4,_0x14360b){if(_0x5ae9d4['body']['id']){delete _0x5ae9d4[_0x3045('0x4b')]['id'];}return db['FreshsalesConfiguration'][_0x3045('0x48')]({'where':{'id':_0x5ae9d4[_0x3045('0x46')]['id']}})[_0x3045('0x44')](handleEntityNotFound(_0x14360b,null))[_0x3045('0x44')](saveUpdates(_0x5ae9d4[_0x3045('0x4b')],null))[_0x3045('0x44')](respondWithResult(_0x14360b,null))[_0x3045('0x49')](handleError(_0x14360b,null));};exports['destroy']=function(_0x261b1b,_0x1f6979){return db[_0x3045('0x40')]['find']({'where':{'id':_0x261b1b[_0x3045('0x46')]['id']}})[_0x3045('0x44')](handleEntityNotFound(_0x1f6979,null))[_0x3045('0x44')](removeEntity(_0x1f6979,null))[_0x3045('0x49')](handleError(_0x1f6979,null));};exports[_0x3045('0x4c')]=function(_0x2319ba,_0xaa37e8,_0x19568b){var _0x7b9c19={};var _0x273e52={};var _0x42491b;var _0x1ed09f;return db[_0x3045('0x40')]['findOne']({'where':{'id':_0x2319ba[_0x3045('0x46')]['id']}})['then'](handleEntityNotFound(_0xaa37e8,null))[_0x3045('0x44')](function(_0x248cf8){if(_0x248cf8){_0x42491b=_0x248cf8;_0x273e52[_0x3045('0x31')]=_[_0x3045('0x2f')](db['FreshsalesField'][_0x3045('0x2b')]);_0x273e52[_0x3045('0x30')]=_[_0x3045('0x2f')](_0x2319ba[_0x3045('0x30')]);_0x273e52[_0x3045('0x3b')]=_[_0x3045('0x33')](_0x273e52[_0x3045('0x31')],_0x273e52[_0x3045('0x30')]);_0x7b9c19['attributes']=_[_0x3045('0x33')](_0x273e52['model'],qs[_0x3045('0x34')](_0x2319ba[_0x3045('0x30')][_0x3045('0x34')]));_0x7b9c19[_0x3045('0x32')]=_0x7b9c19['attributes'][_0x3045('0x47')]?_0x7b9c19[_0x3045('0x32')]:_0x273e52[_0x3045('0x31')];_0x7b9c19[_0x3045('0x37')]=qs[_0x3045('0x38')](_0x2319ba[_0x3045('0x30')]['sort']);_0x7b9c19[_0x3045('0x39')]=qs['filters'](_[_0x3045('0x3a')](_0x2319ba[_0x3045('0x30')],_0x273e52[_0x3045('0x3b')]));if(_0x2319ba[_0x3045('0x30')][_0x3045('0x3c')]){_0x7b9c19['where']=_[_0x3045('0x3d')](_0x7b9c19[_0x3045('0x39')],{'$or':_[_0x3045('0x4d')](_0x7b9c19[_0x3045('0x32')],function(_0x230039){var _0xd0079b={};_0xd0079b[_0x230039]={'$like':'%'+_0x2319ba[_0x3045('0x30')][_0x3045('0x3c')]+'%'};return _0xd0079b;})});}_0x7b9c19=_['merge']({},_0x7b9c19,_0x2319ba[_0x3045('0x3f')]);return _0x42491b['getSubjects'](_0x7b9c19);}})[_0x3045('0x44')](function(_0x1a17d7){if(_0x1a17d7){_0x1ed09f=_0x1a17d7['length'];if(!_0x2319ba[_0x3045('0x30')][_0x3045('0x35')](_0x3045('0x36'))){_0x7b9c19['limit']=qs[_0x3045('0x1d')](_0x2319ba[_0x3045('0x30')]['limit']);_0x7b9c19[_0x3045('0x1b')]=qs['offset'](_0x2319ba[_0x3045('0x30')][_0x3045('0x1b')]);}return _0x42491b[_0x3045('0x4c')](_0x7b9c19);}})['then'](function(_0x531484){if(_0x531484){return _0x531484?{'count':_0x1ed09f,'rows':_0x531484}:null;}})[_0x3045('0x44')](respondWithResult(_0xaa37e8,null))['catch'](handleError(_0xaa37e8,null));};exports['getDescriptions']=function(_0x3e4715,_0x1cd8ce,_0x2e06f7){var _0x238f95={};var _0x5d8dbf={};var _0x59baa6;var _0x5c88ca;return db[_0x3045('0x40')]['findOne']({'where':{'id':_0x3e4715[_0x3045('0x46')]['id']}})[_0x3045('0x44')](handleEntityNotFound(_0x1cd8ce,null))[_0x3045('0x44')](function(_0x3c4e88){if(_0x3c4e88){_0x59baa6=_0x3c4e88;_0x5d8dbf[_0x3045('0x31')]=_['keys'](db[_0x3045('0x4e')][_0x3045('0x2b')]);_0x5d8dbf['query']=_[_0x3045('0x2f')](_0x3e4715[_0x3045('0x30')]);_0x5d8dbf['filters']=_['intersection'](_0x5d8dbf[_0x3045('0x31')],_0x5d8dbf[_0x3045('0x30')]);_0x238f95[_0x3045('0x32')]=_[_0x3045('0x33')](_0x5d8dbf['model'],qs[_0x3045('0x34')](_0x3e4715['query'][_0x3045('0x34')]));_0x238f95['attributes']=_0x238f95['attributes'][_0x3045('0x47')]?_0x238f95[_0x3045('0x32')]:_0x5d8dbf['model'];_0x238f95[_0x3045('0x37')]=qs[_0x3045('0x38')](_0x3e4715[_0x3045('0x30')]['sort']);_0x238f95[_0x3045('0x39')]=qs[_0x3045('0x3b')](_['pick'](_0x3e4715['query'],_0x5d8dbf[_0x3045('0x3b')]));if(_0x3e4715[_0x3045('0x30')][_0x3045('0x3c')]){_0x238f95[_0x3045('0x39')]=_[_0x3045('0x3d')](_0x238f95[_0x3045('0x39')],{'$or':_[_0x3045('0x4d')](_0x238f95[_0x3045('0x32')],function(_0x5b2977){var _0x426903={};_0x426903[_0x5b2977]={'$like':'%'+_0x3e4715[_0x3045('0x30')][_0x3045('0x3c')]+'%'};return _0x426903;})});}_0x238f95=_[_0x3045('0x3d')]({},_0x238f95,_0x3e4715[_0x3045('0x3f')]);return _0x59baa6[_0x3045('0x4f')](_0x238f95);}})['then'](function(_0x2c31b6){if(_0x2c31b6){_0x5c88ca=_0x2c31b6[_0x3045('0x47')];if(!_0x3e4715['query']['hasOwnProperty'](_0x3045('0x36'))){_0x238f95[_0x3045('0x1d')]=qs['limit'](_0x3e4715[_0x3045('0x30')][_0x3045('0x1d')]);_0x238f95[_0x3045('0x1b')]=qs[_0x3045('0x1b')](_0x3e4715[_0x3045('0x30')][_0x3045('0x1b')]);}return _0x59baa6[_0x3045('0x4f')](_0x238f95);}})[_0x3045('0x44')](function(_0x2dc598){if(_0x2dc598){return _0x2dc598?{'count':_0x5c88ca,'rows':_0x2dc598}:null;}})['then'](respondWithResult(_0x1cd8ce,null))['catch'](handleError(_0x1cd8ce,null));};exports[_0x3045('0x50')]=function(_0x539c75,_0x30a0d5,_0x49b732){var _0x49d76e={};var _0x5b5b08={};var _0x4c874f;var _0x5c1230;return db[_0x3045('0x40')]['findOne']({'where':{'id':_0x539c75[_0x3045('0x46')]['id']}})['then'](handleEntityNotFound(_0x30a0d5,null))[_0x3045('0x44')](function(_0x43e3f2){if(_0x43e3f2){_0x4c874f=_0x43e3f2;_0x5b5b08[_0x3045('0x31')]=_['keys'](db[_0x3045('0x4e')][_0x3045('0x2b')]);_0x5b5b08[_0x3045('0x30')]=_[_0x3045('0x2f')](_0x539c75['query']);_0x5b5b08[_0x3045('0x3b')]=_[_0x3045('0x33')](_0x5b5b08[_0x3045('0x31')],_0x5b5b08[_0x3045('0x30')]);_0x49d76e[_0x3045('0x32')]=_['intersection'](_0x5b5b08[_0x3045('0x31')],qs['fields'](_0x539c75[_0x3045('0x30')][_0x3045('0x34')]));_0x49d76e['attributes']=_0x49d76e['attributes'][_0x3045('0x47')]?_0x49d76e[_0x3045('0x32')]:_0x5b5b08['model'];_0x49d76e[_0x3045('0x37')]=qs['sort'](_0x539c75[_0x3045('0x30')]['sort']);_0x49d76e[_0x3045('0x39')]=qs['filters'](_[_0x3045('0x3a')](_0x539c75[_0x3045('0x30')],_0x5b5b08['filters']));if(_0x539c75[_0x3045('0x30')]['filter']){_0x49d76e[_0x3045('0x39')]=_[_0x3045('0x3d')](_0x49d76e['where'],{'$or':_[_0x3045('0x4d')](_0x49d76e[_0x3045('0x32')],function(_0x57163c){var _0x135d27={};_0x135d27[_0x57163c]={'$like':'%'+_0x539c75['query'][_0x3045('0x3c')]+'%'};return _0x135d27;})});}_0x49d76e=_[_0x3045('0x3d')]({},_0x49d76e,_0x539c75[_0x3045('0x3f')]);return _0x4c874f[_0x3045('0x50')](_0x49d76e);}})[_0x3045('0x44')](function(_0x160587){if(_0x160587){_0x5c1230=_0x160587[_0x3045('0x47')];if(!_0x539c75[_0x3045('0x30')][_0x3045('0x35')](_0x3045('0x36'))){_0x49d76e[_0x3045('0x1d')]=qs['limit'](_0x539c75[_0x3045('0x30')][_0x3045('0x1d')]);_0x49d76e[_0x3045('0x1b')]=qs[_0x3045('0x1b')](_0x539c75[_0x3045('0x30')][_0x3045('0x1b')]);}return _0x4c874f['getFields'](_0x49d76e);}})['then'](function(_0x2bd184){if(_0x2bd184){return _0x2bd184?{'count':_0x5c1230,'rows':_0x2bd184}:null;}})['then'](respondWithResult(_0x30a0d5,null))[_0x3045('0x49')](handleError(_0x30a0d5,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 4a5f2da..e375140 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 _0x24ad=['lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','./intFreshsalesConfiguration.attributes','exports','define','FreshsalesConfiguration'];(function(_0x1131d6,_0x11257a){var _0x3a4e6e=function(_0x21acf7){while(--_0x21acf7){_0x1131d6['push'](_0x1131d6['shift']());}};_0x3a4e6e(++_0x11257a);}(_0x24ad,0x1c3));var _0xd24a=function(_0x56bb68,_0x1eb891){_0x56bb68=_0x56bb68-0x0;var _0x317930=_0x24ad[_0x56bb68];return _0x317930;};'use strict';var _=require(_0xd24a('0x0'));var util=require('util');var logger=require(_0xd24a('0x1'))('api');var moment=require(_0xd24a('0x2'));var BPromise=require(_0xd24a('0x3'));var rp=require(_0xd24a('0x4'));var fs=require('fs');var path=require(_0xd24a('0x5'));var rimraf=require(_0xd24a('0x6'));var config=require('../../config/environment');var attributes=require(_0xd24a('0x7'));module[_0xd24a('0x8')]=function(_0x53cb95,_0x3062d0){return _0x53cb95[_0xd24a('0x9')](_0xd24a('0xa'),attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x50bc=['./intFreshsalesConfiguration.attributes','exports','FreshsalesConfiguration','int_freshsales_configurations','util','../../config/logger','api','moment','rimraf'];(function(_0x381589,_0x27a707){var _0x2a075d=function(_0x4ea19d){while(--_0x4ea19d){_0x381589['push'](_0x381589['shift']());}};_0x2a075d(++_0x27a707);}(_0x50bc,0xf7));var _0xc50b=function(_0x9c1927,_0x3a5543){_0x9c1927=_0x9c1927-0x0;var _0x5b064e=_0x50bc[_0x9c1927];return _0x5b064e;};'use strict';var _=require('lodash');var util=require(_0xc50b('0x0'));var logger=require(_0xc50b('0x1'))(_0xc50b('0x2'));var moment=require(_0xc50b('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc50b('0x4'));var config=require('../../config/environment');var attributes=require(_0xc50b('0x5'));module[_0xc50b('0x6')]=function(_0x235649,_0x13999b){return _0x235649['define'](_0xc50b('0x7'),attributes,{'tableName':_0xc50b('0x8'),'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 10fa7a5..bf33c56 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 _0x791a=['code','FreshsalesConfiguration,\x20%s,\x20%s','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x2fd61e,_0x408859){var _0x55ee6b=function(_0x175115){while(--_0x175115){_0x2fd61e['push'](_0x2fd61e['shift']());}};_0x55ee6b(++_0x408859);}(_0x791a,0x119));var _0xa791=function(_0xb239a5,_0x5e84c9){_0xb239a5=_0xb239a5-0x0;var _0x1756cf=_0x791a[_0xb239a5];return _0x1756cf;};'use strict';var _=require('lodash');var util=require(_0xa791('0x0'));var moment=require('moment');var BPromise=require(_0xa791('0x1'));var rs=require(_0xa791('0x2'));var fs=require('fs');var Redis=require(_0xa791('0x3'));var db=require(_0xa791('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa791('0x5'))(_0xa791('0x6'));var config=require(_0xa791('0x7'));var jayson=require(_0xa791('0x8'));var client=jayson[_0xa791('0x9')][_0xa791('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x446c99,_0x103a8d,_0x24dcfc){return new BPromise(function(_0x405c95,_0x2f6f10){return client[_0xa791('0xb')](_0x446c99,_0x24dcfc)[_0xa791('0xc')](function(_0x2091a0){logger[_0xa791('0xd')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x103a8d,'request\x20sent');logger['debug'](_0xa791('0xe'),_0x103a8d,_0xa791('0xf'),JSON[_0xa791('0x10')](_0x2091a0));if(_0x2091a0['error']){if(_0x2091a0[_0xa791('0x11')][_0xa791('0x12')]===0x1f4){logger[_0xa791('0x11')](_0xa791('0x13'),_0x103a8d,_0x2091a0[_0xa791('0x11')][_0xa791('0x14')]);return _0x2f6f10(_0x2091a0[_0xa791('0x11')][_0xa791('0x14')]);}logger[_0xa791('0x11')](_0xa791('0x13'),_0x103a8d,_0x2091a0[_0xa791('0x11')][_0xa791('0x14')]);return _0x405c95(_0x2091a0['error'][_0xa791('0x14')]);}else{logger[_0xa791('0xd')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x103a8d,_0xa791('0xf'));_0x405c95(_0x2091a0[_0xa791('0x15')][_0xa791('0x14')]);}})[_0xa791('0x16')](function(_0x5108f7){logger[_0xa791('0x11')](_0xa791('0x13'),_0x103a8d,_0x5108f7);_0x2f6f10(_0x5108f7);});});} \ No newline at end of file +var _0x8673=['../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshsalesConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x212cc9,_0x52b3f8){var _0x26053c=function(_0x5b3602){while(--_0x5b3602){_0x212cc9['push'](_0x212cc9['shift']());}};_0x26053c(++_0x52b3f8);}(_0x8673,0x151));var _0x3867=function(_0x298f8b,_0x100471){_0x298f8b=_0x298f8b-0x0;var _0x3a50e2=_0x8673[_0x298f8b];return _0x3a50e2;};'use strict';var _=require(_0x3867('0x0'));var util=require(_0x3867('0x1'));var moment=require(_0x3867('0x2'));var BPromise=require(_0x3867('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3867('0x4'));var db=require(_0x3867('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3867('0x6'))(_0x3867('0x7'));var config=require(_0x3867('0x8'));var jayson=require(_0x3867('0x9'));var client=jayson[_0x3867('0xa')][_0x3867('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5521ec,_0x406681,_0x54ba54){return new BPromise(function(_0x516508,_0x28fd21){return client[_0x3867('0xc')](_0x5521ec,_0x54ba54)['then'](function(_0xc1e82e){logger['info']('FreshsalesConfiguration,\x20%s,\x20%s',_0x406681,_0x3867('0xd'));logger[_0x3867('0xe')](_0x3867('0xf'),_0x406681,_0x3867('0xd'),JSON[_0x3867('0x10')](_0xc1e82e));if(_0xc1e82e[_0x3867('0x11')]){if(_0xc1e82e[_0x3867('0x11')][_0x3867('0x12')]===0x1f4){logger[_0x3867('0x11')](_0x3867('0x13'),_0x406681,_0xc1e82e[_0x3867('0x11')][_0x3867('0x14')]);return _0x28fd21(_0xc1e82e[_0x3867('0x11')][_0x3867('0x14')]);}logger[_0x3867('0x11')](_0x3867('0x13'),_0x406681,_0xc1e82e[_0x3867('0x11')]['message']);return _0x516508(_0xc1e82e[_0x3867('0x11')]['message']);}else{logger['info'](_0x3867('0x13'),_0x406681,_0x3867('0xd'));_0x516508(_0xc1e82e[_0x3867('0x15')]['message']);}})[_0x3867('0x16')](function(_0x27c6c3){logger['error'](_0x3867('0x13'),_0x406681,_0x27c6c3);_0x28fd21(_0x27c6c3);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 36b82f4..77ebe3a 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 _0xa1fd=['create','put','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post'];(function(_0x59ab3f,_0x25a848){var _0x1669eb=function(_0x5cf1d4){while(--_0x5cf1d4){_0x59ab3f['push'](_0x59ab3f['shift']());}};_0x1669eb(++_0x25a848);}(_0xa1fd,0x1b9));var _0xda1f=function(_0x1598e8,_0x5df7a7){_0x1598e8=_0x1598e8-0x0;var _0x1f71da=_0xa1fd[_0x1598e8];return _0x1f71da;};'use strict';var multer=require(_0xda1f('0x0'));var util=require(_0xda1f('0x1'));var path=require(_0xda1f('0x2'));var timeout=require(_0xda1f('0x3'));var express=require('express');var router=express[_0xda1f('0x4')]();var fs_extra=require(_0xda1f('0x5'));var auth=require(_0xda1f('0x6'));var interaction=require(_0xda1f('0x7'));var config=require(_0xda1f('0x8'));var controller=require('./intFreshsalesField.controller');router[_0xda1f('0x9')]('/',auth[_0xda1f('0xa')](),controller[_0xda1f('0xb')]);router['get'](_0xda1f('0xc'),auth[_0xda1f('0xa')](),controller[_0xda1f('0xd')]);router[_0xda1f('0xe')]('/',auth[_0xda1f('0xa')](),controller[_0xda1f('0xf')]);router[_0xda1f('0x10')](_0xda1f('0xc'),auth[_0xda1f('0xa')](),controller['update']);router[_0xda1f('0x11')](_0xda1f('0xc'),auth[_0xda1f('0xa')](),controller[_0xda1f('0x12')]);module['exports']=router; \ No newline at end of file +var _0xd0bb=['create','put','update','delete','destroy','multer','util','path','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','post'];(function(_0x2abbc7,_0x4e01f7){var _0x1f4801=function(_0x3aa686){while(--_0x3aa686){_0x2abbc7['push'](_0x2abbc7['shift']());}};_0x1f4801(++_0x4e01f7);}(_0xd0bb,0x1eb));var _0xbd0b=function(_0x3fa4bd,_0x14a72d){_0x3fa4bd=_0x3fa4bd-0x0;var _0x358c95=_0xd0bb[_0x3fa4bd];return _0x358c95;};'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('./intFreshsalesField.controller');router[_0xbd0b('0x7')]('/',auth[_0xbd0b('0x8')](),controller[_0xbd0b('0x9')]);router[_0xbd0b('0x7')](_0xbd0b('0xa'),auth['isAuthenticated'](),controller[_0xbd0b('0xb')]);router[_0xbd0b('0xc')]('/',auth[_0xbd0b('0x8')](),controller[_0xbd0b('0xd')]);router[_0xbd0b('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xbd0b('0xf')]);router[_0xbd0b('0x10')]('/:id',auth[_0xbd0b('0x8')](),controller[_0xbd0b('0x11')]);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 3332dec..9058edd 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 _0x28c4=['picklist','STRING','variable','BOOLEAN','ENUM','string','customVariable','keyValue'];(function(_0xb27827,_0x742a3c){var _0x28f6dc=function(_0x3a87d3){while(--_0x3a87d3){_0xb27827['push'](_0xb27827['shift']());}};_0x28f6dc(++_0x742a3c);}(_0x28c4,0x1c4));var _0x428c=function(_0x25d4ee,_0xc95872){_0x25d4ee=_0x25d4ee-0x0;var _0x214a35=_0x28c4[_0x25d4ee];return _0x214a35;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x428c('0x0')](_0x428c('0x1'),'variable',_0x428c('0x2'),_0x428c('0x3'),_0x428c('0x4')),'defaultValue':_0x428c('0x1')},'content':{'type':Sequelize[_0x428c('0x5')]},'key':{'type':Sequelize[_0x428c('0x5')]},'keyType':{'type':Sequelize[_0x428c('0x0')]('string',_0x428c('0x6'),_0x428c('0x2'))},'keyContent':{'type':Sequelize[_0x428c('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x428c('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x4793=['sequelize','exports','ENUM','string','customVariable','picklist','STRING','variable','BOOLEAN'];(function(_0x2d184f,_0x47ab54){var _0x282cad=function(_0x2f36bc){while(--_0x2f36bc){_0x2d184f['push'](_0x2d184f['shift']());}};_0x282cad(++_0x47ab54);}(_0x4793,0x129));var _0x3479=function(_0xfa86ad,_0x139d25){_0xfa86ad=_0xfa86ad-0x0;var _0x190e36=_0x4793[_0xfa86ad];return _0x190e36;};'use strict';var Sequelize=require(_0x3479('0x0'));module[_0x3479('0x1')]={'type':{'type':Sequelize[_0x3479('0x2')](_0x3479('0x3'),'variable',_0x3479('0x4'),'keyValue',_0x3479('0x5')),'defaultValue':_0x3479('0x3')},'content':{'type':Sequelize[_0x3479('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x3479('0x2')]('string',_0x3479('0x7'),'customVariable')},'keyContent':{'type':Sequelize[_0x3479('0x6')]},'idField':{'type':Sequelize[_0x3479('0x6')]},'nameField':{'type':Sequelize[_0x3479('0x6')]},'customField':{'type':Sequelize[_0x3479('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3479('0x6')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 59b6d5b..41cdd6b 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 _0x7dbd=['stack','name','send','index','map','FreshsalesField','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','merge','where','VIRTUAL','options','include','findAll','then','catch','keys','includeAll','find','create','body','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update'];(function(_0x51f703,_0x25e615){var _0x9b26ce=function(_0x2a2998){while(--_0x2a2998){_0x51f703['push'](_0x51f703['shift']());}};_0x9b26ce(++_0x25e615);}(_0x7dbd,0x191));var _0xd7db=function(_0x45cd59,_0x5be7c0){_0x45cd59=_0x45cd59-0x0;var _0x39541a=_0x7dbd[_0x45cd59];return _0x39541a;};'use strict';var emlformat=require(_0xd7db('0x0'));var rimraf=require(_0xd7db('0x1'));var zipdir=require(_0xd7db('0x2'));var jsonpatch=require(_0xd7db('0x3'));var rp=require(_0xd7db('0x4'));var moment=require(_0xd7db('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xd7db('0x6'));var util=require(_0xd7db('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xd7db('0x8'));var ejs=require(_0xd7db('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd7db('0xa'));var squel=require('squel');var crypto=require(_0xd7db('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xd7db('0xc'));var toCsv=require(_0xd7db('0x8'));var querystring=require(_0xd7db('0xd'));var Papa=require('papaparse');var Redis=require(_0xd7db('0xe'));var authService=require(_0xd7db('0xf'));var qs=require(_0xd7db('0x10'));var as=require(_0xd7db('0x11'));var hardwareService=require(_0xd7db('0x12'));var logger=require(_0xd7db('0x13'))(_0xd7db('0x14'));var utils=require(_0xd7db('0x15'));var config=require(_0xd7db('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xd7db('0x17'))['db'];function respondWithStatusCode(_0x53c0de,_0x5f102d){_0x5f102d=_0x5f102d||0xcc;return function(_0x1bc9fa){if(_0x1bc9fa){return _0x53c0de[_0xd7db('0x18')](_0x5f102d);}return _0x53c0de[_0xd7db('0x19')](_0x5f102d)[_0xd7db('0x1a')]();};}function respondWithResult(_0x2afd6d,_0x2d3903){_0x2d3903=_0x2d3903||0xc8;return function(_0x258ea0){if(_0x258ea0){return _0x2afd6d[_0xd7db('0x19')](_0x2d3903)[_0xd7db('0x1b')](_0x258ea0);}};}function respondWithFilteredResult(_0x2b66ad,_0xe29fb5){return function(_0x2cd161){if(_0x2cd161){var _0x399c47=typeof _0xe29fb5[_0xd7db('0x1c')]==='undefined'&&typeof _0xe29fb5[_0xd7db('0x1d')]===_0xd7db('0x1e');var _0x43227e=_0x2cd161[_0xd7db('0x1f')];var _0x3feb2b=_0x399c47?0x0:_0xe29fb5['offset'];var _0x4d8925=_0x399c47?_0x2cd161[_0xd7db('0x1f')]:_0xe29fb5['offset']+_0xe29fb5[_0xd7db('0x1d')];var _0x18cdc7;if(_0x4d8925>=_0x43227e){_0x4d8925=_0x43227e;_0x18cdc7=0xc8;}else{_0x18cdc7=0xce;}_0x2b66ad[_0xd7db('0x19')](_0x18cdc7);return _0x2b66ad[_0xd7db('0x20')](_0xd7db('0x21'),_0x3feb2b+'-'+_0x4d8925+'/'+_0x43227e)[_0xd7db('0x1b')](_0x2cd161);}return null;};}function patchUpdates(_0x531a42){return function(_0x5e83cc){try{jsonpatch[_0xd7db('0x22')](_0x5e83cc,_0x531a42,!![]);}catch(_0x638d1b){return BPromise[_0xd7db('0x23')](_0x638d1b);}return _0x5e83cc['save']();};}function saveUpdates(_0x2715a2,_0x1acdd9){return function(_0x2f2d15){if(_0x2f2d15){return _0x2f2d15[_0xd7db('0x24')](_0x2715a2)['then'](function(_0x1d5b0e){return _0x1d5b0e;});}return null;};}function removeEntity(_0x16606e,_0x3076a8){return function(_0x2d1736){if(_0x2d1736){return _0x2d1736['destroy']()['then'](function(){_0x16606e[_0xd7db('0x19')](0xcc)[_0xd7db('0x1a')]();});}};}function handleEntityNotFound(_0x374c7e,_0x4d288a){return function(_0x58631b){if(!_0x58631b){_0x374c7e[_0xd7db('0x18')](0x194);}return _0x58631b;};}function handleError(_0x357e5e,_0x469c88){_0x469c88=_0x469c88||0x1f4;return function(_0x4cdd3d){logger['error'](_0x4cdd3d[_0xd7db('0x25')]);if(_0x4cdd3d[_0xd7db('0x26')]){delete _0x4cdd3d[_0xd7db('0x26')];}_0x357e5e[_0xd7db('0x19')](_0x469c88)[_0xd7db('0x27')](_0x4cdd3d);};}exports[_0xd7db('0x28')]=function(_0x153859,_0x19b5c6){var _0x513bf={},_0x439eca={},_0x43e4a6={'count':0x0,'rows':[]};var _0x50b442=_[_0xd7db('0x29')](db[_0xd7db('0x2a')][_0xd7db('0x2b')],function(_0x4bcf26){return{'name':_0x4bcf26[_0xd7db('0x2c')],'type':_0x4bcf26[_0xd7db('0x2d')]['key']};});_0x439eca[_0xd7db('0x2e')]=_[_0xd7db('0x29')](_0x50b442,_0xd7db('0x26'));_0x439eca[_0xd7db('0x2f')]=_['keys'](_0x153859['query']);_0x439eca[_0xd7db('0x30')]=_[_0xd7db('0x31')](_0x439eca[_0xd7db('0x2e')],_0x439eca[_0xd7db('0x2f')]);_0x513bf['attributes']=_['intersection'](_0x439eca['model'],qs[_0xd7db('0x32')](_0x153859[_0xd7db('0x2f')][_0xd7db('0x32')]));_0x513bf[_0xd7db('0x33')]=_0x513bf[_0xd7db('0x33')][_0xd7db('0x34')]?_0x513bf[_0xd7db('0x33')]:_0x439eca['model'];if(!_0x153859['query'][_0xd7db('0x35')](_0xd7db('0x36'))){_0x513bf['limit']=qs[_0xd7db('0x1d')](_0x153859['query'][_0xd7db('0x1d')]);_0x513bf['offset']=qs['offset'](_0x153859[_0xd7db('0x2f')][_0xd7db('0x1c')]);}_0x513bf['order']=qs['sort'](_0x153859['query'][_0xd7db('0x37')]);_0x513bf['where']=qs[_0xd7db('0x30')](_[_0xd7db('0x38')](_0x153859[_0xd7db('0x2f')],_0x439eca[_0xd7db('0x30')]),_0x50b442);if(_0x153859[_0xd7db('0x2f')][_0xd7db('0x39')]){_0x513bf['where']=_[_0xd7db('0x3a')](_0x513bf[_0xd7db('0x3b')],{'$or':_['map'](_0x50b442,function(_0x55b76e){if(_0x55b76e[_0xd7db('0x2d')]!==_0xd7db('0x3c')){var _0x4ed66b={};_0x4ed66b[_0x55b76e[_0xd7db('0x26')]]={'$like':'%'+_0x153859[_0xd7db('0x2f')][_0xd7db('0x39')]+'%'};return _0x4ed66b;}})});}_0x513bf=_[_0xd7db('0x3a')]({},_0x513bf,_0x153859[_0xd7db('0x3d')]);var _0x225797={'where':_0x513bf[_0xd7db('0x3b')]};return db[_0xd7db('0x2a')][_0xd7db('0x1f')](_0x225797)['then'](function(_0x3f60ca){_0x43e4a6[_0xd7db('0x1f')]=_0x3f60ca;if(_0x153859['query']['includeAll']){_0x513bf[_0xd7db('0x3e')]=[{'all':!![]}];}return db['FreshsalesField'][_0xd7db('0x3f')](_0x513bf);})['then'](function(_0x137a0f){_0x43e4a6['rows']=_0x137a0f;return _0x43e4a6;})[_0xd7db('0x40')](respondWithFilteredResult(_0x19b5c6,_0x513bf))[_0xd7db('0x41')](handleError(_0x19b5c6,null));};exports['show']=function(_0x1b406f,_0x747dd4){var _0x31ff3e={'raw':!![],'where':{'id':_0x1b406f['params']['id']}},_0x2c8a80={};_0x2c8a80['model']=_[_0xd7db('0x42')](db[_0xd7db('0x2a')][_0xd7db('0x2b')]);_0x2c8a80[_0xd7db('0x2f')]=_[_0xd7db('0x42')](_0x1b406f[_0xd7db('0x2f')]);_0x2c8a80[_0xd7db('0x30')]=_[_0xd7db('0x31')](_0x2c8a80[_0xd7db('0x2e')],_0x2c8a80[_0xd7db('0x2f')]);_0x31ff3e[_0xd7db('0x33')]=_[_0xd7db('0x31')](_0x2c8a80[_0xd7db('0x2e')],qs[_0xd7db('0x32')](_0x1b406f['query'][_0xd7db('0x32')]));_0x31ff3e[_0xd7db('0x33')]=_0x31ff3e[_0xd7db('0x33')]['length']?_0x31ff3e[_0xd7db('0x33')]:_0x2c8a80[_0xd7db('0x2e')];if(_0x1b406f[_0xd7db('0x2f')][_0xd7db('0x43')]){_0x31ff3e['include']=[{'all':!![]}];}_0x31ff3e=_[_0xd7db('0x3a')]({},_0x31ff3e,_0x1b406f['options']);return db[_0xd7db('0x2a')][_0xd7db('0x44')](_0x31ff3e)['then'](handleEntityNotFound(_0x747dd4,null))[_0xd7db('0x40')](respondWithResult(_0x747dd4,null))[_0xd7db('0x41')](handleError(_0x747dd4,null));};exports[_0xd7db('0x45')]=function(_0x120443,_0x488284){return db[_0xd7db('0x2a')][_0xd7db('0x45')](_0x120443[_0xd7db('0x46')],{})[_0xd7db('0x40')](respondWithResult(_0x488284,0xc9))['catch'](handleError(_0x488284,null));};exports[_0xd7db('0x24')]=function(_0x1fdb6b,_0x2ed386){if(_0x1fdb6b[_0xd7db('0x46')]['id']){delete _0x1fdb6b[_0xd7db('0x46')]['id'];}return db[_0xd7db('0x2a')]['find']({'where':{'id':_0x1fdb6b[_0xd7db('0x47')]['id']}})[_0xd7db('0x40')](handleEntityNotFound(_0x2ed386,null))[_0xd7db('0x40')](saveUpdates(_0x1fdb6b[_0xd7db('0x46')],null))[_0xd7db('0x40')](respondWithResult(_0x2ed386,null))[_0xd7db('0x41')](handleError(_0x2ed386,null));};exports[_0xd7db('0x48')]=function(_0x571f13,_0x20c1c9){return db[_0xd7db('0x2a')]['find']({'where':{'id':_0x571f13[_0xd7db('0x47')]['id']}})[_0xd7db('0x40')](handleEntityNotFound(_0x20c1c9,null))['then'](removeEntity(_0x20c1c9,null))[_0xd7db('0x41')](handleError(_0x20c1c9,null));}; \ No newline at end of file +var _0xd1c2=['save','update','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','FreshsalesField','findAll','rows','catch','show','params','includeAll','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','ejs','lodash','squel','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','status','end','json','offset','undefined','limit','count','set','Content-Range','apply'];(function(_0x4a63fc,_0x167a02){var _0x30d4c3=function(_0x3eecb2){while(--_0x3eecb2){_0x4a63fc['push'](_0x4a63fc['shift']());}};_0x30d4c3(++_0x167a02);}(_0xd1c2,0x168));var _0x2d1c=function(_0x52ff30,_0x463647){_0x52ff30=_0x52ff30-0x0;var _0x5d9c42=_0xd1c2[_0x52ff30];return _0x5d9c42;};'use strict';var emlformat=require(_0x2d1c('0x0'));var rimraf=require(_0x2d1c('0x1'));var zipdir=require(_0x2d1c('0x2'));var jsonpatch=require(_0x2d1c('0x3'));var rp=require('request-promise');var moment=require(_0x2d1c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2d1c('0x5'));var util=require(_0x2d1c('0x6'));var path=require(_0x2d1c('0x7'));var sox=require(_0x2d1c('0x8'));var csv=require('to-csv');var ejs=require(_0x2d1c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2d1c('0xa'));var squel=require(_0x2d1c('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2d1c('0xc'));var toCsv=require('to-csv');var querystring=require(_0x2d1c('0xd'));var Papa=require('papaparse');var Redis=require(_0x2d1c('0xe'));var authService=require(_0x2d1c('0xf'));var qs=require(_0x2d1c('0x10'));var as=require(_0x2d1c('0x11'));var hardwareService=require(_0x2d1c('0x12'));var logger=require(_0x2d1c('0x13'))(_0x2d1c('0x14'));var utils=require(_0x2d1c('0x15'));var config=require(_0x2d1c('0x16'));var licenseUtil=require(_0x2d1c('0x17'));var db=require(_0x2d1c('0x18'))['db'];function respondWithStatusCode(_0x554731,_0x4f0241){_0x4f0241=_0x4f0241||0xcc;return function(_0x113a23){if(_0x113a23){return _0x554731['sendStatus'](_0x4f0241);}return _0x554731[_0x2d1c('0x19')](_0x4f0241)[_0x2d1c('0x1a')]();};}function respondWithResult(_0x1096b6,_0x4da083){_0x4da083=_0x4da083||0xc8;return function(_0x2dae9a){if(_0x2dae9a){return _0x1096b6[_0x2d1c('0x19')](_0x4da083)[_0x2d1c('0x1b')](_0x2dae9a);}};}function respondWithFilteredResult(_0x57b3f4,_0x5f210e){return function(_0x5617fa){if(_0x5617fa){var _0x535dbe=typeof _0x5f210e[_0x2d1c('0x1c')]===_0x2d1c('0x1d')&&typeof _0x5f210e[_0x2d1c('0x1e')]===_0x2d1c('0x1d');var _0x53494e=_0x5617fa[_0x2d1c('0x1f')];var _0x26a2fc=_0x535dbe?0x0:_0x5f210e['offset'];var _0x65457a=_0x535dbe?_0x5617fa[_0x2d1c('0x1f')]:_0x5f210e[_0x2d1c('0x1c')]+_0x5f210e[_0x2d1c('0x1e')];var _0xad0ec2;if(_0x65457a>=_0x53494e){_0x65457a=_0x53494e;_0xad0ec2=0xc8;}else{_0xad0ec2=0xce;}_0x57b3f4[_0x2d1c('0x19')](_0xad0ec2);return _0x57b3f4[_0x2d1c('0x20')](_0x2d1c('0x21'),_0x26a2fc+'-'+_0x65457a+'/'+_0x53494e)[_0x2d1c('0x1b')](_0x5617fa);}return null;};}function patchUpdates(_0x105212){return function(_0x5acd6){try{jsonpatch[_0x2d1c('0x22')](_0x5acd6,_0x105212,!![]);}catch(_0x1148d9){return BPromise['reject'](_0x1148d9);}return _0x5acd6[_0x2d1c('0x23')]();};}function saveUpdates(_0x16318c,_0x2a4296){return function(_0x3fc7b8){if(_0x3fc7b8){return _0x3fc7b8[_0x2d1c('0x24')](_0x16318c)[_0x2d1c('0x25')](function(_0x4b0b0f){return _0x4b0b0f;});}return null;};}function removeEntity(_0x9215e6,_0x1186de){return function(_0x15e185){if(_0x15e185){return _0x15e185[_0x2d1c('0x26')]()[_0x2d1c('0x25')](function(){_0x9215e6['status'](0xcc)[_0x2d1c('0x1a')]();});}};}function handleEntityNotFound(_0x2aeb01,_0x33a8ee){return function(_0x45cb2a){if(!_0x45cb2a){_0x2aeb01[_0x2d1c('0x27')](0x194);}return _0x45cb2a;};}function handleError(_0x494efe,_0x172f91){_0x172f91=_0x172f91||0x1f4;return function(_0x42139c){logger[_0x2d1c('0x28')](_0x42139c[_0x2d1c('0x29')]);if(_0x42139c[_0x2d1c('0x2a')]){delete _0x42139c[_0x2d1c('0x2a')];}_0x494efe[_0x2d1c('0x19')](_0x172f91)[_0x2d1c('0x2b')](_0x42139c);};}exports[_0x2d1c('0x2c')]=function(_0x17b084,_0x52e926){var _0x94d995={},_0x1b4c26={},_0x4a3f56={'count':0x0,'rows':[]};var _0x9efad1=_[_0x2d1c('0x2d')](db['FreshsalesField'][_0x2d1c('0x2e')],function(_0x50ec36){return{'name':_0x50ec36[_0x2d1c('0x2f')],'type':_0x50ec36[_0x2d1c('0x30')][_0x2d1c('0x31')]};});_0x1b4c26['model']=_[_0x2d1c('0x2d')](_0x9efad1,_0x2d1c('0x2a'));_0x1b4c26[_0x2d1c('0x32')]=_[_0x2d1c('0x33')](_0x17b084[_0x2d1c('0x32')]);_0x1b4c26[_0x2d1c('0x34')]=_[_0x2d1c('0x35')](_0x1b4c26[_0x2d1c('0x36')],_0x1b4c26[_0x2d1c('0x32')]);_0x94d995[_0x2d1c('0x37')]=_[_0x2d1c('0x35')](_0x1b4c26[_0x2d1c('0x36')],qs[_0x2d1c('0x38')](_0x17b084[_0x2d1c('0x32')]['fields']));_0x94d995['attributes']=_0x94d995['attributes'][_0x2d1c('0x39')]?_0x94d995['attributes']:_0x1b4c26[_0x2d1c('0x36')];if(!_0x17b084[_0x2d1c('0x32')][_0x2d1c('0x3a')](_0x2d1c('0x3b'))){_0x94d995[_0x2d1c('0x1e')]=qs[_0x2d1c('0x1e')](_0x17b084[_0x2d1c('0x32')]['limit']);_0x94d995[_0x2d1c('0x1c')]=qs[_0x2d1c('0x1c')](_0x17b084[_0x2d1c('0x32')]['offset']);}_0x94d995[_0x2d1c('0x3c')]=qs[_0x2d1c('0x3d')](_0x17b084[_0x2d1c('0x32')][_0x2d1c('0x3d')]);_0x94d995[_0x2d1c('0x3e')]=qs['filters'](_[_0x2d1c('0x3f')](_0x17b084[_0x2d1c('0x32')],_0x1b4c26[_0x2d1c('0x34')]),_0x9efad1);if(_0x17b084[_0x2d1c('0x32')][_0x2d1c('0x40')]){_0x94d995['where']=_[_0x2d1c('0x41')](_0x94d995['where'],{'$or':_['map'](_0x9efad1,function(_0x137ad5){if(_0x137ad5[_0x2d1c('0x30')]!==_0x2d1c('0x42')){var _0x36feed={};_0x36feed[_0x137ad5['name']]={'$like':'%'+_0x17b084['query'][_0x2d1c('0x40')]+'%'};return _0x36feed;}})});}_0x94d995=_['merge']({},_0x94d995,_0x17b084[_0x2d1c('0x43')]);var _0x1b5e62={'where':_0x94d995['where']};return db['FreshsalesField'][_0x2d1c('0x1f')](_0x1b5e62)[_0x2d1c('0x25')](function(_0x3afd77){_0x4a3f56[_0x2d1c('0x1f')]=_0x3afd77;if(_0x17b084[_0x2d1c('0x32')]['includeAll']){_0x94d995[_0x2d1c('0x44')]=[{'all':!![]}];}return db[_0x2d1c('0x45')][_0x2d1c('0x46')](_0x94d995);})[_0x2d1c('0x25')](function(_0x3394c3){_0x4a3f56[_0x2d1c('0x47')]=_0x3394c3;return _0x4a3f56;})[_0x2d1c('0x25')](respondWithFilteredResult(_0x52e926,_0x94d995))[_0x2d1c('0x48')](handleError(_0x52e926,null));};exports[_0x2d1c('0x49')]=function(_0x281623,_0x809280){var _0x3c7ca2={'raw':!![],'where':{'id':_0x281623[_0x2d1c('0x4a')]['id']}},_0x369b4a={};_0x369b4a[_0x2d1c('0x36')]=_[_0x2d1c('0x33')](db['FreshsalesField']['rawAttributes']);_0x369b4a[_0x2d1c('0x32')]=_['keys'](_0x281623['query']);_0x369b4a[_0x2d1c('0x34')]=_[_0x2d1c('0x35')](_0x369b4a[_0x2d1c('0x36')],_0x369b4a[_0x2d1c('0x32')]);_0x3c7ca2['attributes']=_[_0x2d1c('0x35')](_0x369b4a[_0x2d1c('0x36')],qs[_0x2d1c('0x38')](_0x281623[_0x2d1c('0x32')]['fields']));_0x3c7ca2[_0x2d1c('0x37')]=_0x3c7ca2[_0x2d1c('0x37')][_0x2d1c('0x39')]?_0x3c7ca2[_0x2d1c('0x37')]:_0x369b4a[_0x2d1c('0x36')];if(_0x281623[_0x2d1c('0x32')][_0x2d1c('0x4b')]){_0x3c7ca2[_0x2d1c('0x44')]=[{'all':!![]}];}_0x3c7ca2=_['merge']({},_0x3c7ca2,_0x281623[_0x2d1c('0x43')]);return db[_0x2d1c('0x45')][_0x2d1c('0x4c')](_0x3c7ca2)[_0x2d1c('0x25')](handleEntityNotFound(_0x809280,null))[_0x2d1c('0x25')](respondWithResult(_0x809280,null))[_0x2d1c('0x48')](handleError(_0x809280,null));};exports[_0x2d1c('0x4d')]=function(_0x46c64c,_0x14fe14){return db['FreshsalesField'][_0x2d1c('0x4d')](_0x46c64c[_0x2d1c('0x4e')],{})[_0x2d1c('0x25')](respondWithResult(_0x14fe14,0xc9))[_0x2d1c('0x48')](handleError(_0x14fe14,null));};exports['update']=function(_0x180644,_0x3ea8f8){if(_0x180644['body']['id']){delete _0x180644[_0x2d1c('0x4e')]['id'];}return db['FreshsalesField']['find']({'where':{'id':_0x180644[_0x2d1c('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3ea8f8,null))[_0x2d1c('0x25')](saveUpdates(_0x180644[_0x2d1c('0x4e')],null))[_0x2d1c('0x25')](respondWithResult(_0x3ea8f8,null))[_0x2d1c('0x48')](handleError(_0x3ea8f8,null));};exports[_0x2d1c('0x26')]=function(_0x30d246,_0x1c2f02){return db['FreshsalesField'][_0x2d1c('0x4c')]({'where':{'id':_0x30d246[_0x2d1c('0x4a')]['id']}})[_0x2d1c('0x25')](handleEntityNotFound(_0x1c2f02,null))[_0x2d1c('0x25')](removeEntity(_0x1c2f02,null))[_0x2d1c('0x48')](handleError(_0x1c2f02,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 02d2961..dfec839 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 _0xd1f8=['path','../../config/environment','exports','define','FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','lodash','util','../../config/logger','api','bluebird'];(function(_0x41cf16,_0x17ff65){var _0x54c205=function(_0x7136f){while(--_0x7136f){_0x41cf16['push'](_0x41cf16['shift']());}};_0x54c205(++_0x17ff65);}(_0xd1f8,0x18e));var _0x8d1f=function(_0x279368,_0x41c002){_0x279368=_0x279368-0x0;var _0x40b6d0=_0xd1f8[_0x279368];return _0x40b6d0;};'use strict';var _=require(_0x8d1f('0x0'));var util=require(_0x8d1f('0x1'));var logger=require(_0x8d1f('0x2'))(_0x8d1f('0x3'));var moment=require('moment');var BPromise=require(_0x8d1f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8d1f('0x5'));var rimraf=require('rimraf');var config=require(_0x8d1f('0x6'));var attributes=require('./intFreshsalesField.attributes');module[_0x8d1f('0x7')]=function(_0x26d2de,_0x5a17b0){return _0x26d2de[_0x8d1f('0x8')](_0x8d1f('0x9'),attributes,{'tableName':_0x8d1f('0xa'),'paranoid':![],'indexes':[{'name':_0x8d1f('0xb'),'fields':[_0x8d1f('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3c8b=['exports','define','int_freshsales_fields','idField','FieldId','util','api','moment','bluebird','path','rimraf','../../config/environment','./intFreshsalesField.attributes'];(function(_0x1d1eef,_0x5930b8){var _0x360c1a=function(_0x4a4dae){while(--_0x4a4dae){_0x1d1eef['push'](_0x1d1eef['shift']());}};_0x360c1a(++_0x5930b8);}(_0x3c8b,0x18b));var _0xb3c8=function(_0x19809e,_0x89e6ad){_0x19809e=_0x19809e-0x0;var _0x2dc2e3=_0x3c8b[_0x19809e];return _0x2dc2e3;};'use strict';var _=require('lodash');var util=require(_0xb3c8('0x0'));var logger=require('../../config/logger')(_0xb3c8('0x1'));var moment=require(_0xb3c8('0x2'));var BPromise=require(_0xb3c8('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb3c8('0x4'));var rimraf=require(_0xb3c8('0x5'));var config=require(_0xb3c8('0x6'));var attributes=require(_0xb3c8('0x7'));module[_0xb3c8('0x8')]=function(_0x1fa5f2,_0x46c864){return _0x1fa5f2[_0xb3c8('0x9')]('FreshsalesField',attributes,{'tableName':_0xb3c8('0xa'),'paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':[_0xb3c8('0xb'),_0xb3c8('0xc')],'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 70da9bc..ca5adec 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 _0x4c60=['client','http','request','then','debug','request\x20sent','stringify','error','code','FreshsalesField,\x20%s,\x20%s','message','info','catch','lodash','util','moment','bluebird','ioredis','../../config/environment','jayson/promise'];(function(_0x3dd003,_0x3cbd52){var _0x3fe6c5=function(_0x12b959){while(--_0x12b959){_0x3dd003['push'](_0x3dd003['shift']());}};_0x3fe6c5(++_0x3cbd52);}(_0x4c60,0xc1));var _0x04c6=function(_0xa07c46,_0x126e13){_0xa07c46=_0xa07c46-0x0;var _0x5ce901=_0x4c60[_0xa07c46];return _0x5ce901;};'use strict';var _=require(_0x04c6('0x0'));var util=require(_0x04c6('0x1'));var moment=require(_0x04c6('0x2'));var BPromise=require(_0x04c6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x04c6('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x04c6('0x5'));var jayson=require(_0x04c6('0x6'));var client=jayson[_0x04c6('0x7')][_0x04c6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2b9041,_0x39be2d,_0x8f9b13){return new BPromise(function(_0x530a48,_0x2a4b51){return client[_0x04c6('0x9')](_0x2b9041,_0x8f9b13)[_0x04c6('0xa')](function(_0x30b901){logger['info']('FreshsalesField,\x20%s,\x20%s',_0x39be2d,'request\x20sent');logger[_0x04c6('0xb')]('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x39be2d,_0x04c6('0xc'),JSON[_0x04c6('0xd')](_0x30b901));if(_0x30b901['error']){if(_0x30b901[_0x04c6('0xe')][_0x04c6('0xf')]===0x1f4){logger[_0x04c6('0xe')](_0x04c6('0x10'),_0x39be2d,_0x30b901['error'][_0x04c6('0x11')]);return _0x2a4b51(_0x30b901[_0x04c6('0xe')][_0x04c6('0x11')]);}logger['error'](_0x04c6('0x10'),_0x39be2d,_0x30b901[_0x04c6('0xe')][_0x04c6('0x11')]);return _0x530a48(_0x30b901[_0x04c6('0xe')][_0x04c6('0x11')]);}else{logger[_0x04c6('0x12')](_0x04c6('0x10'),_0x39be2d,_0x04c6('0xc'));_0x530a48(_0x30b901['result'][_0x04c6('0x11')]);}})[_0x04c6('0x13')](function(_0x382e58){logger[_0x04c6('0xe')](_0x04c6('0x10'),_0x39be2d,_0x382e58);_0x2a4b51(_0x382e58);});});} \ No newline at end of file +var _0xafc4=['error','code','message','request\x20sent','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','info','FreshsalesField,\x20%s,\x20%s','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4f34c6,_0x3249fa){var _0x338875=function(_0x4bf58b){while(--_0x4bf58b){_0x4f34c6['push'](_0x4f34c6['shift']());}};_0x338875(++_0x3249fa);}(_0xafc4,0x69));var _0x4afc=function(_0x5a9e00,_0x4db19d){_0x5a9e00=_0x5a9e00-0x0;var _0x3ea16e=_0xafc4[_0x5a9e00];return _0x3ea16e;};'use strict';var _=require(_0x4afc('0x0'));var util=require('util');var moment=require(_0x4afc('0x1'));var BPromise=require('bluebird');var rs=require(_0x4afc('0x2'));var fs=require('fs');var Redis=require(_0x4afc('0x3'));var db=require(_0x4afc('0x4'))['db'];var utils=require(_0x4afc('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x4afc('0x6'));var client=jayson[_0x4afc('0x7')][_0x4afc('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1bb281,_0xc828d9,_0xaf053d){return new BPromise(function(_0x5e1e29,_0x31e165){return client[_0x4afc('0x9')](_0x1bb281,_0xaf053d)[_0x4afc('0xa')](function(_0x1e6bf5){logger[_0x4afc('0xb')](_0x4afc('0xc'),_0xc828d9,'request\x20sent');logger['debug'](_0x4afc('0xd'),_0xc828d9,'request\x20sent',JSON[_0x4afc('0xe')](_0x1e6bf5));if(_0x1e6bf5[_0x4afc('0xf')]){if(_0x1e6bf5['error'][_0x4afc('0x10')]===0x1f4){logger[_0x4afc('0xf')](_0x4afc('0xc'),_0xc828d9,_0x1e6bf5[_0x4afc('0xf')][_0x4afc('0x11')]);return _0x31e165(_0x1e6bf5[_0x4afc('0xf')][_0x4afc('0x11')]);}logger[_0x4afc('0xf')]('FreshsalesField,\x20%s,\x20%s',_0xc828d9,_0x1e6bf5[_0x4afc('0xf')][_0x4afc('0x11')]);return _0x5e1e29(_0x1e6bf5[_0x4afc('0xf')][_0x4afc('0x11')]);}else{logger['info']('FreshsalesField,\x20%s,\x20%s',_0xc828d9,_0x4afc('0x12'));_0x5e1e29(_0x1e6bf5['result'][_0x4afc('0x11')]);}})[_0x4afc('0x13')](function(_0x2b928b){logger[_0x4afc('0xf')](_0x4afc('0xc'),_0xc828d9,_0x2b928b);_0x31e165(_0x2b928b);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index da31d6c..1660483 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(_0x404d3f,_0x3f73d1){var _0x79f8ba=function(_0x11a56e){while(--_0x11a56e){_0x404d3f['push'](_0x404d3f['shift']());}};_0x79f8ba(++_0x3f73d1);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'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(_0x5c328a,_0xfce25b){var _0x1be9dd=function(_0x34beb4){while(--_0x34beb4){_0x5c328a['push'](_0x5c328a['shift']());}};_0x1be9dd(++_0xfce25b);}(_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 diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index bb8a8c7..455ec8c 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 _0xcdd2=['exports','STRING','username','integrationTab','newTab','sequelize'];(function(_0x53cf8e,_0x3d290f){var _0x459197=function(_0x67073c){while(--_0x67073c){_0x53cf8e['push'](_0x53cf8e['shift']());}};_0x459197(++_0x3d290f);}(_0xcdd2,0x83));var _0x2cdd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcdd2[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x2cdd('0x0'));module[_0x2cdd('0x1')]={'name':{'type':Sequelize[_0x2cdd('0x2')]},'description':{'type':Sequelize[_0x2cdd('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x2cdd('0x3')},'remoteUri':{'type':Sequelize[_0x2cdd('0x2')]},'password':{'type':Sequelize[_0x2cdd('0x2')]},'clientId':{'type':Sequelize[_0x2cdd('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize[_0x2cdd('0x2')]},'serverUrl':{'type':Sequelize[_0x2cdd('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x2cdd('0x4'),_0x2cdd('0x5')),'defaultValue':_0x2cdd('0x4')}}; \ No newline at end of file +var _0x6a6e=['ENUM','integrationTab','newTab','sequelize','exports','STRING','username'];(function(_0x295811,_0x2825f4){var _0x147146=function(_0x939636){while(--_0x939636){_0x295811['push'](_0x295811['shift']());}};_0x147146(++_0x2825f4);}(_0x6a6e,0xe3));var _0xe6a6=function(_0x3be988,_0x5e92d8){_0x3be988=_0x3be988-0x0;var _0x4d194a=_0x6a6e[_0x3be988];return _0x4d194a;};'use strict';var Sequelize=require(_0xe6a6('0x0'));module[_0xe6a6('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe6a6('0x2')]},'username':{'type':Sequelize[_0xe6a6('0x2')],'unique':_0xe6a6('0x3')},'remoteUri':{'type':Sequelize[_0xe6a6('0x2')]},'password':{'type':Sequelize[_0xe6a6('0x2')]},'clientId':{'type':Sequelize[_0xe6a6('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xe6a6('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xe6a6('0x4')](_0xe6a6('0x5'),_0xe6a6('0x6')),'defaultValue':_0xe6a6('0x5')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 42608dd..c9b45d2 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 _0xc7a2=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','error','name','send','map','SalesforceAccount','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','rows','catch','params','find','create','body','update','getConfigurations','findOne','SalesforceConfiguration','pick','AccountId','getSubjects','channel','Descriptions','getDescriptions','SalesforceField','getFields','Task','remoteUri','clientId','clientSecret','username','password','slice','substring','lastIndexOf','Connection','login','concat','securityToken','isNil','ticketType','ActivityDate','IsRecurrence','Description','int','picklist','boolean','email','textarea','phone','includes','custom','picklistValues','value','true','False','false','test','statusCode','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xc7a2,0x64));var _0x2c7a=function(_0x232715,_0x4bd63e){_0x232715=_0x232715-0x0;var _0x1e6090=_0xc7a2[_0x232715];return _0x1e6090;};'use strict';var emlformat=require(_0x2c7a('0x0'));var rimraf=require(_0x2c7a('0x1'));var zipdir=require(_0x2c7a('0x2'));var jsonpatch=require(_0x2c7a('0x3'));var rp=require(_0x2c7a('0x4'));var moment=require(_0x2c7a('0x5'));var BPromise=require(_0x2c7a('0x6'));var Mustache=require(_0x2c7a('0x7'));var util=require(_0x2c7a('0x8'));var path=require(_0x2c7a('0x9'));var sox=require('sox');var csv=require(_0x2c7a('0xa'));var ejs=require(_0x2c7a('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2c7a('0xc'));var squel=require(_0x2c7a('0xd'));var crypto=require(_0x2c7a('0xe'));var jsforce=require(_0x2c7a('0xf'));var deskjs=require(_0x2c7a('0x10'));var toCsv=require(_0x2c7a('0xa'));var querystring=require(_0x2c7a('0x11'));var Papa=require(_0x2c7a('0x12'));var Redis=require(_0x2c7a('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2c7a('0x14'));var logger=require(_0x2c7a('0x15'))(_0x2c7a('0x16'));var utils=require(_0x2c7a('0x17'));var config=require(_0x2c7a('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x2c7a('0x19'));function respondWithStatusCode(_0x5c9a3d,_0x47aaeb){_0x47aaeb=_0x47aaeb||0xcc;return function(_0x314d69){if(_0x314d69){return _0x5c9a3d[_0x2c7a('0x1a')](_0x47aaeb);}return _0x5c9a3d[_0x2c7a('0x1b')](_0x47aaeb)[_0x2c7a('0x1c')]();};}function respondWithResult(_0x3f5acc,_0x4da1ec){_0x4da1ec=_0x4da1ec||0xc8;return function(_0x4d7e7){if(_0x4d7e7){return _0x3f5acc[_0x2c7a('0x1b')](_0x4da1ec)['json'](_0x4d7e7);}};}function respondWithFilteredResult(_0x3fe74a,_0x59c156){return function(_0x4e798e){if(_0x4e798e){var _0x4384ae=typeof _0x59c156[_0x2c7a('0x1d')]===_0x2c7a('0x1e')&&typeof _0x59c156[_0x2c7a('0x1f')]===_0x2c7a('0x1e');var _0x59450f=_0x4e798e[_0x2c7a('0x20')];var _0x25946e=_0x4384ae?0x0:_0x59c156[_0x2c7a('0x1d')];var _0x31ae0a=_0x4384ae?_0x4e798e['count']:_0x59c156[_0x2c7a('0x1d')]+_0x59c156[_0x2c7a('0x1f')];var _0x17bc98;if(_0x31ae0a>=_0x59450f){_0x31ae0a=_0x59450f;_0x17bc98=0xc8;}else{_0x17bc98=0xce;}_0x3fe74a[_0x2c7a('0x1b')](_0x17bc98);return _0x3fe74a[_0x2c7a('0x21')](_0x2c7a('0x22'),_0x25946e+'-'+_0x31ae0a+'/'+_0x59450f)[_0x2c7a('0x23')](_0x4e798e);}return null;};}function patchUpdates(_0x19dacd){return function(_0x111cae){try{jsonpatch[_0x2c7a('0x24')](_0x111cae,_0x19dacd,!![]);}catch(_0x8518fb){return BPromise[_0x2c7a('0x25')](_0x8518fb);}return _0x111cae[_0x2c7a('0x26')]();};}function saveUpdates(_0x45d813,_0x5a0c64){return function(_0x4344d2){if(_0x4344d2){return _0x4344d2['update'](_0x45d813)[_0x2c7a('0x27')](function(_0x2fe487){return _0x2fe487;});}return null;};}function removeEntity(_0x581ac3,_0x54af8a){return function(_0x3569ad){if(_0x3569ad){return _0x3569ad[_0x2c7a('0x28')]()[_0x2c7a('0x27')](function(){_0x581ac3[_0x2c7a('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5ab0b1,_0x3b37f){return function(_0x592923){if(!_0x592923){_0x5ab0b1[_0x2c7a('0x1a')](0x194);}return _0x592923;};}function handleError(_0x411b88,_0x26a118){_0x26a118=_0x26a118||0x1f4;return function(_0x14d9e6){logger[_0x2c7a('0x29')](_0x14d9e6['stack']);if(_0x14d9e6[_0x2c7a('0x2a')]){delete _0x14d9e6[_0x2c7a('0x2a')];}_0x411b88[_0x2c7a('0x1b')](_0x26a118)[_0x2c7a('0x2b')](_0x14d9e6);};}exports['index']=function(_0x55b565,_0x1ebd06){var _0x3d586d={},_0x1a2632={},_0x45dd11={'count':0x0,'rows':[]};var _0x1114f0=_[_0x2c7a('0x2c')](db[_0x2c7a('0x2d')][_0x2c7a('0x2e')],function(_0xbf261d){return{'name':_0xbf261d[_0x2c7a('0x2f')],'type':_0xbf261d['type']['key']};});_0x1a2632[_0x2c7a('0x30')]=_[_0x2c7a('0x2c')](_0x1114f0,'name');_0x1a2632[_0x2c7a('0x31')]=_[_0x2c7a('0x32')](_0x55b565[_0x2c7a('0x31')]);_0x1a2632[_0x2c7a('0x33')]=_[_0x2c7a('0x34')](_0x1a2632[_0x2c7a('0x30')],_0x1a2632['query']);_0x3d586d[_0x2c7a('0x35')]=_[_0x2c7a('0x34')](_0x1a2632[_0x2c7a('0x30')],qs[_0x2c7a('0x36')](_0x55b565['query'][_0x2c7a('0x36')]));_0x3d586d[_0x2c7a('0x35')]=_0x3d586d[_0x2c7a('0x35')][_0x2c7a('0x37')]?_0x3d586d[_0x2c7a('0x35')]:_0x1a2632['model'];if(!_0x55b565[_0x2c7a('0x31')][_0x2c7a('0x38')](_0x2c7a('0x39'))){_0x3d586d['limit']=qs[_0x2c7a('0x1f')](_0x55b565['query'][_0x2c7a('0x1f')]);_0x3d586d[_0x2c7a('0x1d')]=qs[_0x2c7a('0x1d')](_0x55b565[_0x2c7a('0x31')][_0x2c7a('0x1d')]);}_0x3d586d[_0x2c7a('0x3a')]=qs[_0x2c7a('0x3b')](_0x55b565[_0x2c7a('0x31')][_0x2c7a('0x3b')]);_0x3d586d[_0x2c7a('0x3c')]=qs[_0x2c7a('0x33')](_['pick'](_0x55b565['query'],_0x1a2632[_0x2c7a('0x33')]),_0x1114f0);if(_0x55b565['query'][_0x2c7a('0x3d')]){_0x3d586d[_0x2c7a('0x3c')]=_[_0x2c7a('0x3e')](_0x3d586d[_0x2c7a('0x3c')],{'$or':_[_0x2c7a('0x2c')](_0x1114f0,function(_0x44ca8c){if(_0x44ca8c[_0x2c7a('0x3f')]!==_0x2c7a('0x40')){var _0x4593dd={};_0x4593dd[_0x44ca8c['name']]={'$like':'%'+_0x55b565[_0x2c7a('0x31')]['filter']+'%'};return _0x4593dd;}})});}_0x3d586d=_[_0x2c7a('0x3e')]({},_0x3d586d,_0x55b565[_0x2c7a('0x41')]);var _0x522d80={'where':_0x3d586d['where']};return db[_0x2c7a('0x2d')][_0x2c7a('0x20')](_0x522d80)[_0x2c7a('0x27')](function(_0x2f17fd){_0x45dd11['count']=_0x2f17fd;if(_0x55b565[_0x2c7a('0x31')][_0x2c7a('0x42')]){_0x3d586d['include']=[{'all':!![]}];}return db[_0x2c7a('0x2d')]['findAll'](_0x3d586d);})[_0x2c7a('0x27')](function(_0x5d1da4){_0x45dd11[_0x2c7a('0x43')]=_0x5d1da4;return _0x45dd11;})[_0x2c7a('0x27')](respondWithFilteredResult(_0x1ebd06,_0x3d586d))[_0x2c7a('0x44')](handleError(_0x1ebd06,null));};exports['show']=function(_0x1b5b83,_0x5cf7d5){var _0x1cbb43={'raw':![],'where':{'id':_0x1b5b83[_0x2c7a('0x45')]['id']}},_0x5d7a17={};_0x5d7a17[_0x2c7a('0x30')]=_['keys'](db[_0x2c7a('0x2d')][_0x2c7a('0x2e')]);_0x5d7a17[_0x2c7a('0x31')]=_[_0x2c7a('0x32')](_0x1b5b83[_0x2c7a('0x31')]);_0x5d7a17[_0x2c7a('0x33')]=_['intersection'](_0x5d7a17[_0x2c7a('0x30')],_0x5d7a17[_0x2c7a('0x31')]);_0x1cbb43[_0x2c7a('0x35')]=_['intersection'](_0x5d7a17['model'],qs['fields'](_0x1b5b83[_0x2c7a('0x31')]['fields']));_0x1cbb43['attributes']=_0x1cbb43[_0x2c7a('0x35')][_0x2c7a('0x37')]?_0x1cbb43['attributes']:_0x5d7a17[_0x2c7a('0x30')];if(_0x1b5b83['query']['includeAll']){_0x1cbb43['include']=[{'all':!![]}];}_0x1cbb43=_[_0x2c7a('0x3e')]({},_0x1cbb43,_0x1b5b83[_0x2c7a('0x41')]);return db[_0x2c7a('0x2d')][_0x2c7a('0x46')](_0x1cbb43)[_0x2c7a('0x27')](handleEntityNotFound(_0x5cf7d5,null))[_0x2c7a('0x27')](respondWithResult(_0x5cf7d5,null))[_0x2c7a('0x44')](handleError(_0x5cf7d5,null));};exports['create']=function(_0x6371e5,_0x5b6a0d){return db[_0x2c7a('0x2d')][_0x2c7a('0x47')](_0x6371e5[_0x2c7a('0x48')],{})['then'](respondWithResult(_0x5b6a0d,0xc9))[_0x2c7a('0x44')](handleError(_0x5b6a0d,null));};exports[_0x2c7a('0x49')]=function(_0x306882,_0x5f8616){if(_0x306882['body']['id']){delete _0x306882[_0x2c7a('0x48')]['id'];}return db['SalesforceAccount']['find']({'where':{'id':_0x306882[_0x2c7a('0x45')]['id']}})[_0x2c7a('0x27')](handleEntityNotFound(_0x5f8616,null))['then'](saveUpdates(_0x306882[_0x2c7a('0x48')],null))[_0x2c7a('0x27')](respondWithResult(_0x5f8616,null))['catch'](handleError(_0x5f8616,null));};exports[_0x2c7a('0x28')]=function(_0x479c89,_0x73e32a){return db['SalesforceAccount']['find']({'where':{'id':_0x479c89[_0x2c7a('0x45')]['id']}})[_0x2c7a('0x27')](handleEntityNotFound(_0x73e32a,null))[_0x2c7a('0x27')](removeEntity(_0x73e32a,null))[_0x2c7a('0x44')](handleError(_0x73e32a,null));};exports[_0x2c7a('0x4a')]=function(_0x141a09,_0x5912fe,_0x411597){var _0x18a0b1={};var _0x5f4292={};var _0x1d0bb0;var _0x1664c2;return db[_0x2c7a('0x2d')][_0x2c7a('0x4b')]({'where':{'id':_0x141a09[_0x2c7a('0x45')]['id']}})[_0x2c7a('0x27')](handleEntityNotFound(_0x5912fe,null))[_0x2c7a('0x27')](function(_0x4adcd6){if(_0x4adcd6){_0x1d0bb0=_0x4adcd6;_0x5f4292['model']=_[_0x2c7a('0x32')](db[_0x2c7a('0x4c')][_0x2c7a('0x2e')]);_0x5f4292[_0x2c7a('0x31')]=_[_0x2c7a('0x32')](_0x141a09['query']);_0x5f4292['filters']=_['intersection'](_0x5f4292[_0x2c7a('0x30')],_0x5f4292[_0x2c7a('0x31')]);_0x18a0b1['attributes']=_[_0x2c7a('0x34')](_0x5f4292[_0x2c7a('0x30')],qs[_0x2c7a('0x36')](_0x141a09['query']['fields']));_0x18a0b1[_0x2c7a('0x35')]=_0x18a0b1[_0x2c7a('0x35')][_0x2c7a('0x37')]?_0x18a0b1[_0x2c7a('0x35')]:_0x5f4292[_0x2c7a('0x30')];_0x18a0b1[_0x2c7a('0x3a')]=qs[_0x2c7a('0x3b')](_0x141a09[_0x2c7a('0x31')][_0x2c7a('0x3b')]);_0x18a0b1[_0x2c7a('0x3c')]=qs['filters'](_[_0x2c7a('0x4d')](_0x141a09[_0x2c7a('0x31')],_0x5f4292[_0x2c7a('0x33')]));if(_0x141a09[_0x2c7a('0x31')][_0x2c7a('0x3d')]){_0x18a0b1[_0x2c7a('0x3c')]=_[_0x2c7a('0x3e')](_0x18a0b1[_0x2c7a('0x3c')],{'$or':_['map'](_0x18a0b1['attributes'],function(_0x462659){var _0x7357f7={};_0x7357f7[_0x462659]={'$like':'%'+_0x141a09[_0x2c7a('0x31')][_0x2c7a('0x3d')]+'%'};return _0x7357f7;})});}_0x18a0b1=_['merge']({},_0x18a0b1,_0x141a09[_0x2c7a('0x41')]);return _0x1d0bb0['getConfigurations'](_0x18a0b1);}})[_0x2c7a('0x27')](function(_0x3b09a8){if(_0x3b09a8){_0x1664c2=_0x3b09a8[_0x2c7a('0x37')];if(!_0x141a09[_0x2c7a('0x31')][_0x2c7a('0x38')](_0x2c7a('0x39'))){_0x18a0b1[_0x2c7a('0x1f')]=qs[_0x2c7a('0x1f')](_0x141a09[_0x2c7a('0x31')][_0x2c7a('0x1f')]);_0x18a0b1['offset']=qs[_0x2c7a('0x1d')](_0x141a09['query'][_0x2c7a('0x1d')]);}return _0x1d0bb0['getConfigurations'](_0x18a0b1);}})[_0x2c7a('0x27')](function(_0x5ca9c0){if(_0x5ca9c0){return _0x5ca9c0?{'count':_0x1664c2,'rows':_0x5ca9c0}:null;}})[_0x2c7a('0x27')](respondWithResult(_0x5912fe,null))[_0x2c7a('0x44')](handleError(_0x5912fe,null));};exports['addConfiguration']=function(_0x267a68,_0x45cd3b,_0x57a3b8){if(_0x267a68['body']['id']){delete _0x267a68[_0x2c7a('0x48')]['id'];}return db[_0x2c7a('0x2d')][_0x2c7a('0x4b')]({'where':{'id':_0x267a68[_0x2c7a('0x45')]['id']}})[_0x2c7a('0x27')](handleEntityNotFound(_0x45cd3b,null))[_0x2c7a('0x27')](function(_0x383fed){if(_0x383fed){_0x267a68[_0x2c7a('0x48')][_0x2c7a('0x4e')]=_0x383fed['id'];_0x267a68['body']['Subjects']=integrations[_0x2c7a('0x4f')](_0x267a68[_0x2c7a('0x48')][_0x2c7a('0x50')],_0x267a68['body']['type']);_0x267a68['body'][_0x2c7a('0x51')]=integrations[_0x2c7a('0x52')](_0x267a68[_0x2c7a('0x48')]['channel'],_0x267a68['body'][_0x2c7a('0x3f')]);return db[_0x2c7a('0x4c')]['create'](_0x267a68[_0x2c7a('0x48')],{'include':[{'model':db[_0x2c7a('0x53')],'as':'Subjects'},{'model':db['SalesforceField'],'as':_0x2c7a('0x51')}]});}return null;})['then'](respondWithResult(_0x45cd3b,null))['catch'](handleError(_0x45cd3b,null));};exports[_0x2c7a('0x54')]=function(_0xe5ba47,_0xe61518,_0xe20d4){var _0x594b28;var _0x552e30='';var _0x30e4fa=_0x2c7a('0x55');return db[_0x2c7a('0x2d')]['findOne']({'where':{'id':_0xe5ba47[_0x2c7a('0x45')]['id']},'attributes':['id',_0x2c7a('0x56'),_0x2c7a('0x57'),_0x2c7a('0x58'),_0x2c7a('0x59'),_0x2c7a('0x5a'),'securityToken']})[_0x2c7a('0x27')](handleEntityNotFound(_0xe61518,null))[_0x2c7a('0x27')](function(_0x1d57ea){if(_0x1d57ea){_0x552e30=_0x1d57ea[_0x2c7a('0x56')];var _0x30f611=_0x552e30[_0x2c7a('0x5b')](-0x1);if(_0x30f611==='/'){_0x552e30=_0x552e30[_0x2c7a('0x5c')](0x0,_0x552e30[_0x2c7a('0x5d')](_0x30f611));}_0x594b28=new jsforce[(_0x2c7a('0x5e'))]({'oauth2':{'loginUrl':_0x552e30,'clientId':_0x1d57ea[_0x2c7a('0x57')],'clientSecret':_0x1d57ea['clientSecret']}});return _0x594b28[_0x2c7a('0x5f')](_0x1d57ea[_0x2c7a('0x59')],_0x1d57ea[_0x2c7a('0x5a')][_0x2c7a('0x60')](_0x1d57ea[_0x2c7a('0x61')]));}})[_0x2c7a('0x27')](function(_0x5a1d44){if(_0x5a1d44){if(!_[_0x2c7a('0x62')](_0xe5ba47[_0x2c7a('0x31')][_0x2c7a('0x63')])){_0x30e4fa=_0xe5ba47['query'][_0x2c7a('0x63')];}return _0x594b28['sobject'](_0x30e4fa)['describe']();}})[_0x2c7a('0x27')](function(_0x53625e){var _0x5b259d=['OwnerId',_0x2c7a('0x64'),'IsReminderSet',_0x2c7a('0x65'),'Subject',_0x2c7a('0x66')];var _0x4dc474=['string',_0x2c7a('0x67'),_0x2c7a('0x68'),_0x2c7a('0x69'),_0x2c7a('0x6a'),_0x2c7a('0x6b'),_0x2c7a('0x6c')];if(_0x53625e){_['remove'](_0x53625e[_0x2c7a('0x36')],function(_0x4ca127){return _0x5b259d['includes'](_0x4ca127['name'])||!_0x4dc474[_0x2c7a('0x6d')](_0x4ca127['type']);});return{'count':_0x53625e[_0x2c7a('0x36')][_0x2c7a('0x37')],'rows':_[_0x2c7a('0x2c')](_0x53625e[_0x2c7a('0x36')],function(_0x2c12c8){return{'id':_0x2c12c8[_0x2c7a('0x2a')],'name':_0x2c12c8['label'],'custom':_0x2c12c8[_0x2c7a('0x6e')],'options':_0x2c12c8['picklistValues']['length']>0x0?_[_0x2c7a('0x2c')](_0x2c12c8[_0x2c7a('0x6f')],function(_0x4b4642){return{'name':_0x4b4642['label'],'value':_0x4b4642[_0x2c7a('0x70')]};}):_0x2c12c8[_0x2c7a('0x3f')]==_0x2c7a('0x69')?[{'name':'True','value':_0x2c7a('0x71')},{'name':_0x2c7a('0x72'),'value':_0x2c7a('0x73')}]:[]};})};}})[_0x2c7a('0x27')](respondWithResult(_0xe61518,null))['catch'](function(_0x1c1830){var _0x5db9ff=_0xe5ba47[_0x2c7a('0x31')][_0x2c7a('0x74')]?0x1f4:_0x1c1830[_0x2c7a('0x75')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x2c7a('0x54'),_0x5db9ff,JSON[_0x2c7a('0x76')](_0x1c1830));delete _0x1c1830[_0x2c7a('0x2a')];if(_0x5db9ff===0x191){_0x5db9ff=0x190;}_0xe61518['status'](_0x5db9ff)['send'](_0xe5ba47['query'][_0x2c7a('0x74')]?{'message':_0x2c7a('0x77'),'statusCode':_0x1c1830[_0x2c7a('0x75')]}:_0x1c1830);});}; \ No newline at end of file +var _0xa58d=['querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','update','then','error','send','map','SalesforceAccount','rawAttributes','fieldName','type','key','model','name','keys','query','filters','intersection','attributes','fields','nolimit','sort','where','pick','filter','merge','options','findAll','rows','catch','show','params','length','includeAll','find','create','body','destroy','getConfigurations','findOne','order','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SalesforceConfiguration','SalesforceField','Task','remoteUri','clientId','clientSecret','username','password','securityToken','slice','lastIndexOf','Connection','concat','isNil','ticketType','describe','ActivityDate','IsReminderSet','Subject','Description','string','int','picklist','textarea','phone','remove','includes','label','custom','picklistValues','value','True','true','False','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa58d,0x1d6));var _0xda58=function(_0x204abb,_0x5b9c5c){_0x204abb=_0x204abb-0x0;var _0x1c580b=_0xa58d[_0x204abb];return _0x1c580b;};'use strict';var emlformat=require(_0xda58('0x0'));var rimraf=require(_0xda58('0x1'));var zipdir=require(_0xda58('0x2'));var jsonpatch=require(_0xda58('0x3'));var rp=require(_0xda58('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xda58('0x5'));var sox=require(_0xda58('0x6'));var csv=require(_0xda58('0x7'));var ejs=require(_0xda58('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xda58('0x9'));var squel=require(_0xda58('0xa'));var crypto=require(_0xda58('0xb'));var jsforce=require(_0xda58('0xc'));var deskjs=require(_0xda58('0xd'));var toCsv=require(_0xda58('0x7'));var querystring=require(_0xda58('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xda58('0xf'));var qs=require(_0xda58('0x10'));var as=require(_0xda58('0x11'));var hardwareService=require(_0xda58('0x12'));var logger=require(_0xda58('0x13'))(_0xda58('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xda58('0x15'))['db'];var integrations=require(_0xda58('0x16'));function respondWithStatusCode(_0x43e1ff,_0xe52527){_0xe52527=_0xe52527||0xcc;return function(_0xe0fab1){if(_0xe0fab1){return _0x43e1ff[_0xda58('0x17')](_0xe52527);}return _0x43e1ff[_0xda58('0x18')](_0xe52527)[_0xda58('0x19')]();};}function respondWithResult(_0x5637ca,_0x32f05b){_0x32f05b=_0x32f05b||0xc8;return function(_0x48dbb4){if(_0x48dbb4){return _0x5637ca[_0xda58('0x18')](_0x32f05b)[_0xda58('0x1a')](_0x48dbb4);}};}function respondWithFilteredResult(_0x58ec7d,_0x5a453e){return function(_0x296fa8){if(_0x296fa8){var _0x3b5c9a=typeof _0x5a453e['offset']===_0xda58('0x1b')&&typeof _0x5a453e[_0xda58('0x1c')]===_0xda58('0x1b');var _0x246408=_0x296fa8[_0xda58('0x1d')];var _0x5a8ab5=_0x3b5c9a?0x0:_0x5a453e[_0xda58('0x1e')];var _0x51c6d1=_0x3b5c9a?_0x296fa8[_0xda58('0x1d')]:_0x5a453e[_0xda58('0x1e')]+_0x5a453e['limit'];var _0x1a62e2;if(_0x51c6d1>=_0x246408){_0x51c6d1=_0x246408;_0x1a62e2=0xc8;}else{_0x1a62e2=0xce;}_0x58ec7d[_0xda58('0x18')](_0x1a62e2);return _0x58ec7d[_0xda58('0x1f')](_0xda58('0x20'),_0x5a8ab5+'-'+_0x51c6d1+'/'+_0x246408)['json'](_0x296fa8);}return null;};}function patchUpdates(_0xbd6ffe){return function(_0x1c41da){try{jsonpatch[_0xda58('0x21')](_0x1c41da,_0xbd6ffe,!![]);}catch(_0x2d6cf2){return BPromise['reject'](_0x2d6cf2);}return _0x1c41da['save']();};}function saveUpdates(_0x3c4af4,_0xd6d441){return function(_0x21ca51){if(_0x21ca51){return _0x21ca51[_0xda58('0x22')](_0x3c4af4)['then'](function(_0x56f534){return _0x56f534;});}return null;};}function removeEntity(_0x5762ca,_0xbee6e7){return function(_0x4dbf8b){if(_0x4dbf8b){return _0x4dbf8b['destroy']()[_0xda58('0x23')](function(){_0x5762ca['status'](0xcc)[_0xda58('0x19')]();});}};}function handleEntityNotFound(_0x49d56a,_0x123e3a){return function(_0x575b56){if(!_0x575b56){_0x49d56a[_0xda58('0x17')](0x194);}return _0x575b56;};}function handleError(_0x239b80,_0x5d1f12){_0x5d1f12=_0x5d1f12||0x1f4;return function(_0x2f4608){logger[_0xda58('0x24')](_0x2f4608['stack']);if(_0x2f4608['name']){delete _0x2f4608['name'];}_0x239b80[_0xda58('0x18')](_0x5d1f12)[_0xda58('0x25')](_0x2f4608);};}exports['index']=function(_0x4ca69e,_0x103d1b){var _0x3672cc={},_0x4e2394={},_0x49e037={'count':0x0,'rows':[]};var _0x388081=_[_0xda58('0x26')](db[_0xda58('0x27')][_0xda58('0x28')],function(_0xfb098d){return{'name':_0xfb098d[_0xda58('0x29')],'type':_0xfb098d[_0xda58('0x2a')][_0xda58('0x2b')]};});_0x4e2394[_0xda58('0x2c')]=_[_0xda58('0x26')](_0x388081,_0xda58('0x2d'));_0x4e2394['query']=_[_0xda58('0x2e')](_0x4ca69e[_0xda58('0x2f')]);_0x4e2394[_0xda58('0x30')]=_[_0xda58('0x31')](_0x4e2394[_0xda58('0x2c')],_0x4e2394[_0xda58('0x2f')]);_0x3672cc[_0xda58('0x32')]=_[_0xda58('0x31')](_0x4e2394['model'],qs[_0xda58('0x33')](_0x4ca69e['query']['fields']));_0x3672cc['attributes']=_0x3672cc['attributes']['length']?_0x3672cc[_0xda58('0x32')]:_0x4e2394[_0xda58('0x2c')];if(!_0x4ca69e[_0xda58('0x2f')]['hasOwnProperty'](_0xda58('0x34'))){_0x3672cc[_0xda58('0x1c')]=qs[_0xda58('0x1c')](_0x4ca69e[_0xda58('0x2f')]['limit']);_0x3672cc['offset']=qs[_0xda58('0x1e')](_0x4ca69e[_0xda58('0x2f')]['offset']);}_0x3672cc['order']=qs['sort'](_0x4ca69e[_0xda58('0x2f')][_0xda58('0x35')]);_0x3672cc[_0xda58('0x36')]=qs['filters'](_[_0xda58('0x37')](_0x4ca69e['query'],_0x4e2394['filters']),_0x388081);if(_0x4ca69e['query'][_0xda58('0x38')]){_0x3672cc[_0xda58('0x36')]=_[_0xda58('0x39')](_0x3672cc['where'],{'$or':_[_0xda58('0x26')](_0x388081,function(_0x4e2206){if(_0x4e2206[_0xda58('0x2a')]!=='VIRTUAL'){var _0x564092={};_0x564092[_0x4e2206[_0xda58('0x2d')]]={'$like':'%'+_0x4ca69e['query'][_0xda58('0x38')]+'%'};return _0x564092;}})});}_0x3672cc=_[_0xda58('0x39')]({},_0x3672cc,_0x4ca69e[_0xda58('0x3a')]);var _0x46245d={'where':_0x3672cc[_0xda58('0x36')]};return db[_0xda58('0x27')][_0xda58('0x1d')](_0x46245d)['then'](function(_0x3b7b1f){_0x49e037['count']=_0x3b7b1f;if(_0x4ca69e[_0xda58('0x2f')]['includeAll']){_0x3672cc['include']=[{'all':!![]}];}return db[_0xda58('0x27')][_0xda58('0x3b')](_0x3672cc);})['then'](function(_0x331038){_0x49e037[_0xda58('0x3c')]=_0x331038;return _0x49e037;})[_0xda58('0x23')](respondWithFilteredResult(_0x103d1b,_0x3672cc))[_0xda58('0x3d')](handleError(_0x103d1b,null));};exports[_0xda58('0x3e')]=function(_0x4c9610,_0x449aaf){var _0x5b9a9c={'raw':![],'where':{'id':_0x4c9610[_0xda58('0x3f')]['id']}},_0x6301f7={};_0x6301f7[_0xda58('0x2c')]=_[_0xda58('0x2e')](db[_0xda58('0x27')][_0xda58('0x28')]);_0x6301f7['query']=_[_0xda58('0x2e')](_0x4c9610[_0xda58('0x2f')]);_0x6301f7[_0xda58('0x30')]=_[_0xda58('0x31')](_0x6301f7[_0xda58('0x2c')],_0x6301f7['query']);_0x5b9a9c[_0xda58('0x32')]=_[_0xda58('0x31')](_0x6301f7[_0xda58('0x2c')],qs[_0xda58('0x33')](_0x4c9610[_0xda58('0x2f')][_0xda58('0x33')]));_0x5b9a9c['attributes']=_0x5b9a9c['attributes'][_0xda58('0x40')]?_0x5b9a9c[_0xda58('0x32')]:_0x6301f7['model'];if(_0x4c9610[_0xda58('0x2f')][_0xda58('0x41')]){_0x5b9a9c['include']=[{'all':!![]}];}_0x5b9a9c=_[_0xda58('0x39')]({},_0x5b9a9c,_0x4c9610['options']);return db[_0xda58('0x27')][_0xda58('0x42')](_0x5b9a9c)[_0xda58('0x23')](handleEntityNotFound(_0x449aaf,null))[_0xda58('0x23')](respondWithResult(_0x449aaf,null))[_0xda58('0x3d')](handleError(_0x449aaf,null));};exports[_0xda58('0x43')]=function(_0x8eda8f,_0x450e3b){return db[_0xda58('0x27')][_0xda58('0x43')](_0x8eda8f['body'],{})[_0xda58('0x23')](respondWithResult(_0x450e3b,0xc9))[_0xda58('0x3d')](handleError(_0x450e3b,null));};exports['update']=function(_0x46c9ff,_0x46a4f1){if(_0x46c9ff[_0xda58('0x44')]['id']){delete _0x46c9ff[_0xda58('0x44')]['id'];}return db[_0xda58('0x27')][_0xda58('0x42')]({'where':{'id':_0x46c9ff['params']['id']}})[_0xda58('0x23')](handleEntityNotFound(_0x46a4f1,null))[_0xda58('0x23')](saveUpdates(_0x46c9ff[_0xda58('0x44')],null))[_0xda58('0x23')](respondWithResult(_0x46a4f1,null))['catch'](handleError(_0x46a4f1,null));};exports[_0xda58('0x45')]=function(_0x2a8aac,_0x43dbeb){return db[_0xda58('0x27')][_0xda58('0x42')]({'where':{'id':_0x2a8aac['params']['id']}})[_0xda58('0x23')](handleEntityNotFound(_0x43dbeb,null))[_0xda58('0x23')](removeEntity(_0x43dbeb,null))[_0xda58('0x3d')](handleError(_0x43dbeb,null));};exports[_0xda58('0x46')]=function(_0x2605e5,_0x40306e,_0x136043){var _0x468088={};var _0x376908={};var _0x21aab0;var _0x5b238e;return db[_0xda58('0x27')][_0xda58('0x47')]({'where':{'id':_0x2605e5['params']['id']}})['then'](handleEntityNotFound(_0x40306e,null))[_0xda58('0x23')](function(_0x4b9a9f){if(_0x4b9a9f){_0x21aab0=_0x4b9a9f;_0x376908[_0xda58('0x2c')]=_[_0xda58('0x2e')](db['SalesforceConfiguration'][_0xda58('0x28')]);_0x376908[_0xda58('0x2f')]=_[_0xda58('0x2e')](_0x2605e5[_0xda58('0x2f')]);_0x376908['filters']=_[_0xda58('0x31')](_0x376908[_0xda58('0x2c')],_0x376908[_0xda58('0x2f')]);_0x468088[_0xda58('0x32')]=_[_0xda58('0x31')](_0x376908[_0xda58('0x2c')],qs[_0xda58('0x33')](_0x2605e5[_0xda58('0x2f')][_0xda58('0x33')]));_0x468088[_0xda58('0x32')]=_0x468088['attributes'][_0xda58('0x40')]?_0x468088[_0xda58('0x32')]:_0x376908[_0xda58('0x2c')];_0x468088[_0xda58('0x48')]=qs['sort'](_0x2605e5[_0xda58('0x2f')]['sort']);_0x468088['where']=qs[_0xda58('0x30')](_[_0xda58('0x37')](_0x2605e5[_0xda58('0x2f')],_0x376908[_0xda58('0x30')]));if(_0x2605e5['query'][_0xda58('0x38')]){_0x468088[_0xda58('0x36')]=_[_0xda58('0x39')](_0x468088[_0xda58('0x36')],{'$or':_[_0xda58('0x26')](_0x468088[_0xda58('0x32')],function(_0x2d21aa){var _0x535e5d={};_0x535e5d[_0x2d21aa]={'$like':'%'+_0x2605e5[_0xda58('0x2f')]['filter']+'%'};return _0x535e5d;})});}_0x468088=_['merge']({},_0x468088,_0x2605e5[_0xda58('0x3a')]);return _0x21aab0[_0xda58('0x46')](_0x468088);}})['then'](function(_0xf52a52){if(_0xf52a52){_0x5b238e=_0xf52a52[_0xda58('0x40')];if(!_0x2605e5['query'][_0xda58('0x49')]('nolimit')){_0x468088[_0xda58('0x1c')]=qs[_0xda58('0x1c')](_0x2605e5[_0xda58('0x2f')][_0xda58('0x1c')]);_0x468088[_0xda58('0x1e')]=qs['offset'](_0x2605e5[_0xda58('0x2f')]['offset']);}return _0x21aab0['getConfigurations'](_0x468088);}})[_0xda58('0x23')](function(_0x581dd4){if(_0x581dd4){return _0x581dd4?{'count':_0x5b238e,'rows':_0x581dd4}:null;}})[_0xda58('0x23')](respondWithResult(_0x40306e,null))[_0xda58('0x3d')](handleError(_0x40306e,null));};exports[_0xda58('0x4a')]=function(_0x1cfe98,_0xb06ab2,_0x1a5734){if(_0x1cfe98['body']['id']){delete _0x1cfe98[_0xda58('0x44')]['id'];}return db[_0xda58('0x27')]['findOne']({'where':{'id':_0x1cfe98[_0xda58('0x3f')]['id']}})[_0xda58('0x23')](handleEntityNotFound(_0xb06ab2,null))[_0xda58('0x23')](function(_0x1c553a){if(_0x1c553a){_0x1cfe98[_0xda58('0x44')][_0xda58('0x4b')]=_0x1c553a['id'];_0x1cfe98['body'][_0xda58('0x4c')]=integrations[_0xda58('0x4d')](_0x1cfe98[_0xda58('0x44')][_0xda58('0x4e')],_0x1cfe98[_0xda58('0x44')]['type']);_0x1cfe98[_0xda58('0x44')][_0xda58('0x4f')]=integrations[_0xda58('0x50')](_0x1cfe98[_0xda58('0x44')][_0xda58('0x4e')],_0x1cfe98[_0xda58('0x44')]['type']);return db[_0xda58('0x51')][_0xda58('0x43')](_0x1cfe98[_0xda58('0x44')],{'include':[{'model':db[_0xda58('0x52')],'as':_0xda58('0x4c')},{'model':db[_0xda58('0x52')],'as':'Descriptions'}]});}return null;})[_0xda58('0x23')](respondWithResult(_0xb06ab2,null))['catch'](handleError(_0xb06ab2,null));};exports['getFields']=function(_0x21d9f3,_0x4e9ecf,_0x1ae8ba){var _0x2a9e8e;var _0x4ca65b='';var _0x578d1f=_0xda58('0x53');return db['SalesforceAccount'][_0xda58('0x47')]({'where':{'id':_0x21d9f3[_0xda58('0x3f')]['id']},'attributes':['id',_0xda58('0x54'),_0xda58('0x55'),_0xda58('0x56'),_0xda58('0x57'),_0xda58('0x58'),_0xda58('0x59')]})[_0xda58('0x23')](handleEntityNotFound(_0x4e9ecf,null))['then'](function(_0x2f76cc){if(_0x2f76cc){_0x4ca65b=_0x2f76cc[_0xda58('0x54')];var _0x13924a=_0x4ca65b[_0xda58('0x5a')](-0x1);if(_0x13924a==='/'){_0x4ca65b=_0x4ca65b['substring'](0x0,_0x4ca65b[_0xda58('0x5b')](_0x13924a));}_0x2a9e8e=new jsforce[(_0xda58('0x5c'))]({'oauth2':{'loginUrl':_0x4ca65b,'clientId':_0x2f76cc[_0xda58('0x55')],'clientSecret':_0x2f76cc[_0xda58('0x56')]}});return _0x2a9e8e['login'](_0x2f76cc[_0xda58('0x57')],_0x2f76cc[_0xda58('0x58')][_0xda58('0x5d')](_0x2f76cc[_0xda58('0x59')]));}})[_0xda58('0x23')](function(_0x3b342e){if(_0x3b342e){if(!_[_0xda58('0x5e')](_0x21d9f3['query']['ticketType'])){_0x578d1f=_0x21d9f3['query'][_0xda58('0x5f')];}return _0x2a9e8e['sobject'](_0x578d1f)[_0xda58('0x60')]();}})['then'](function(_0x42ad79){var _0x1ff307=['OwnerId',_0xda58('0x61'),_0xda58('0x62'),'IsRecurrence',_0xda58('0x63'),_0xda58('0x64')];var _0x311022=[_0xda58('0x65'),_0xda58('0x66'),_0xda58('0x67'),'boolean','email',_0xda58('0x68'),_0xda58('0x69')];if(_0x42ad79){_[_0xda58('0x6a')](_0x42ad79['fields'],function(_0x572009){return _0x1ff307[_0xda58('0x6b')](_0x572009[_0xda58('0x2d')])||!_0x311022[_0xda58('0x6b')](_0x572009[_0xda58('0x2a')]);});return{'count':_0x42ad79[_0xda58('0x33')][_0xda58('0x40')],'rows':_[_0xda58('0x26')](_0x42ad79[_0xda58('0x33')],function(_0x495016){return{'id':_0x495016[_0xda58('0x2d')],'name':_0x495016[_0xda58('0x6c')],'custom':_0x495016[_0xda58('0x6d')],'options':_0x495016[_0xda58('0x6e')]['length']>0x0?_[_0xda58('0x26')](_0x495016[_0xda58('0x6e')],function(_0x55dbc7){return{'name':_0x55dbc7['label'],'value':_0x55dbc7[_0xda58('0x6f')]};}):_0x495016[_0xda58('0x2a')]=='boolean'?[{'name':_0xda58('0x70'),'value':_0xda58('0x71')},{'name':_0xda58('0x72'),'value':_0xda58('0x73')}]:[]};})};}})[_0xda58('0x23')](respondWithResult(_0x4e9ecf,null))['catch'](function(_0x904b33){var _0x4c97b7=_0x21d9f3['query'][_0xda58('0x74')]?0x1f4:_0x904b33[_0xda58('0x75')]||0x1f4;logger[_0xda58('0x24')](_0xda58('0x76'),_0xda58('0x77'),_0x4c97b7,JSON[_0xda58('0x78')](_0x904b33));delete _0x904b33[_0xda58('0x2d')];if(_0x4c97b7===0x191){_0x4c97b7=0x190;}_0x4e9ecf[_0xda58('0x18')](_0x4c97b7)[_0xda58('0x25')](_0x21d9f3[_0xda58('0x2f')][_0xda58('0x74')]?{'message':'Wrong\x20credentials','statusCode':_0x904b33[_0xda58('0x75')]}:_0x904b33);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index d1d9e79..0c2bbe8 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 _0x2e3d=['request-promise','../../config/environment','../../components/integrations/configuration','exports','define','SalesforceAccount','lodash','api','moment','bluebird'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0x2e3d,0x1be));var _0xd2e3=function(_0x1958dc,_0x533f1a){_0x1958dc=_0x1958dc-0x0;var _0x141ff7=_0x2e3d[_0x1958dc];return _0x141ff7;};'use strict';var _=require(_0xd2e3('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xd2e3('0x1'));var moment=require(_0xd2e3('0x2'));var BPromise=require(_0xd2e3('0x3'));var rp=require(_0xd2e3('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd2e3('0x5'));var attributes=require('./intSalesforceAccount.attributes');var integrations=require(_0xd2e3('0x6'));module[_0xd2e3('0x7')]=function(_0x3beebf,_0x471fd0){return _0x3beebf[_0xd2e3('0x8')](_0xd2e3('0x9'),attributes,{'tableName':'int_salesforce_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9c64=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','int_salesforce_accounts','util','../../config/logger'];(function(_0xf59372,_0x151b72){var _0x4809c1=function(_0x957c7){while(--_0x957c7){_0xf59372['push'](_0xf59372['shift']());}};_0x4809c1(++_0x151b72);}(_0x9c64,0x16a));var _0x49c6=function(_0x583324,_0x2bacc6){_0x583324=_0x583324-0x0;var _0x45b2b8=_0x9c64[_0x583324];return _0x45b2b8;};'use strict';var _=require('lodash');var util=require(_0x49c6('0x0'));var logger=require(_0x49c6('0x1'))(_0x49c6('0x2'));var moment=require(_0x49c6('0x3'));var BPromise=require(_0x49c6('0x4'));var rp=require(_0x49c6('0x5'));var fs=require('fs');var path=require(_0x49c6('0x6'));var rimraf=require(_0x49c6('0x7'));var config=require(_0x49c6('0x8'));var attributes=require(_0x49c6('0x9'));var integrations=require(_0x49c6('0xa'));module[_0x49c6('0xb')]=function(_0x26881d,_0x194b7f){return _0x26881d['define']('SalesforceAccount',attributes,{'tableName':_0x49c6('0xc'),'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 f2295c2..6c7cc61 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 _0x7524=['limit','include','map','model','GetSalesforceAccount','ShowSalesforceAccount','SalesforceAccount','find','util','moment','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','SalesforceAccount,\x20%s,\x20%s','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','options','raw','where','attributes'];(function(_0x448a34,_0x2ea5f4){var _0x5e41d0=function(_0x4397ba){while(--_0x4397ba){_0x448a34['push'](_0x448a34['shift']());}};_0x5e41d0(++_0x2ea5f4);}(_0x7524,0xce));var _0x4752=function(_0x3a4d86,_0x2d0e84){_0x3a4d86=_0x3a4d86-0x0;var _0x44fd39=_0x7524[_0x3a4d86];return _0x44fd39;};'use strict';var _=require('lodash');var util=require(_0x4752('0x0'));var moment=require(_0x4752('0x1'));var BPromise=require('bluebird');var rs=require(_0x4752('0x2'));var fs=require('fs');var Redis=require(_0x4752('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4752('0x4'))('rpc');var config=require(_0x4752('0x5'));var jayson=require(_0x4752('0x6'));var client=jayson[_0x4752('0x7')][_0x4752('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x104962,_0x5b98c0,_0x1e76cf){return new BPromise(function(_0x1cbf34,_0x59477c){return client['request'](_0x104962,_0x1e76cf)[_0x4752('0x9')](function(_0x45e0ff){logger[_0x4752('0xa')](_0x4752('0xb'),_0x5b98c0,'request\x20sent');logger[_0x4752('0xc')](_0x4752('0xd'),_0x5b98c0,_0x4752('0xe'),JSON[_0x4752('0xf')](_0x45e0ff));if(_0x45e0ff[_0x4752('0x10')]){if(_0x45e0ff['error'][_0x4752('0x11')]===0x1f4){logger[_0x4752('0x10')](_0x4752('0xb'),_0x5b98c0,_0x45e0ff[_0x4752('0x10')][_0x4752('0x12')]);return _0x59477c(_0x45e0ff[_0x4752('0x10')][_0x4752('0x12')]);}logger['error'](_0x4752('0xb'),_0x5b98c0,_0x45e0ff['error'][_0x4752('0x12')]);return _0x1cbf34(_0x45e0ff[_0x4752('0x10')][_0x4752('0x12')]);}else{logger[_0x4752('0xa')](_0x4752('0xb'),_0x5b98c0,_0x4752('0xe'));_0x1cbf34(_0x45e0ff[_0x4752('0x13')]['message']);}})[_0x4752('0x14')](function(_0x1dad7c){logger['error'](_0x4752('0xb'),_0x5b98c0,_0x1dad7c);_0x59477c(_0x1dad7c);});});}exports['GetSalesforceAccount']=function(_0x1429f4){var _0x3c9ccc=this;return new Promise(function(_0x516f3e,_0x2d7ab6){return db['SalesforceAccount']['findAll']({'raw':_0x1429f4[_0x4752('0x15')]?_0x1429f4[_0x4752('0x15')][_0x4752('0x16')]===undefined?!![]:![]:!![],'where':_0x1429f4[_0x4752('0x15')]?_0x1429f4[_0x4752('0x15')][_0x4752('0x17')]||null:null,'attributes':_0x1429f4['options']?_0x1429f4[_0x4752('0x15')][_0x4752('0x18')]||null:null,'limit':_0x1429f4[_0x4752('0x15')]?_0x1429f4[_0x4752('0x15')][_0x4752('0x19')]||null:null,'include':_0x1429f4[_0x4752('0x15')]?_0x1429f4['options'][_0x4752('0x1a')]?_[_0x4752('0x1b')](_0x1429f4['options'][_0x4752('0x1a')],function(_0x403005){return{'model':db[_0x403005[_0x4752('0x1c')]],'as':_0x403005['as'],'attributes':_0x403005[_0x4752('0x18')],'include':_0x403005[_0x4752('0x1a')]?_[_0x4752('0x1b')](_0x403005[_0x4752('0x1a')],function(_0x45c557){return{'model':db[_0x45c557[_0x4752('0x1c')]],'as':_0x45c557['as'],'attributes':_0x45c557[_0x4752('0x18')],'include':_0x45c557['include']?_[_0x4752('0x1b')](_0x45c557['include'],function(_0x4b2635){return{'model':db[_0x4b2635['model']],'as':_0x4b2635['as'],'attributes':_0x4b2635[_0x4752('0x18')]};}):[]};}):[]};}):[]:[]})[_0x4752('0x9')](function(_0x1bc71b){logger[_0x4752('0xa')](_0x4752('0x1d'),_0x1429f4);logger[_0x4752('0xc')](_0x4752('0x1d'),_0x1429f4,JSON[_0x4752('0xf')](_0x1bc71b));_0x516f3e(_0x1bc71b);})['catch'](function(_0x5745c0){logger[_0x4752('0x10')](_0x4752('0x1d'),_0x5745c0[_0x4752('0x12')],_0x1429f4);_0x2d7ab6(_0x3c9ccc[_0x4752('0x10')](0x1f4,_0x5745c0[_0x4752('0x12')]));});});};exports[_0x4752('0x1e')]=function(_0x258795){var _0x3164d0=this;return new Promise(function(_0x3b2774,_0x1f54ab){return db[_0x4752('0x1f')][_0x4752('0x20')]({'raw':_0x258795[_0x4752('0x15')]?_0x258795[_0x4752('0x15')][_0x4752('0x16')]===undefined?!![]:![]:!![],'where':_0x258795[_0x4752('0x15')]?_0x258795['options']['where']||null:null,'attributes':_0x258795[_0x4752('0x15')]?_0x258795[_0x4752('0x15')][_0x4752('0x18')]||null:null,'include':_0x258795[_0x4752('0x15')]?_0x258795[_0x4752('0x15')][_0x4752('0x1a')]?_[_0x4752('0x1b')](_0x258795[_0x4752('0x15')][_0x4752('0x1a')],function(_0x3f2f44){return{'model':db[_0x3f2f44['model']],'as':_0x3f2f44['as'],'attributes':_0x3f2f44[_0x4752('0x18')],'include':_0x3f2f44['include']?_[_0x4752('0x1b')](_0x3f2f44[_0x4752('0x1a')],function(_0x4411d6){return{'model':db[_0x4411d6[_0x4752('0x1c')]],'as':_0x4411d6['as'],'attributes':_0x4411d6[_0x4752('0x18')],'include':_0x4411d6['include']?_[_0x4752('0x1b')](_0x4411d6['include'],function(_0x26d283){return{'model':db[_0x26d283[_0x4752('0x1c')]],'as':_0x26d283['as'],'attributes':_0x26d283[_0x4752('0x18')]};}):[]};}):[]};}):[]:[]})[_0x4752('0x9')](function(_0xa96174){logger[_0x4752('0xa')](_0x4752('0x1e'),_0x258795);logger[_0x4752('0xc')](_0x4752('0x1e'),_0x258795,JSON[_0x4752('0xf')](_0xa96174));_0x3b2774(_0xa96174);})['catch'](function(_0x1717ea){logger[_0x4752('0x10')](_0x4752('0x1e'),_0x1717ea[_0x4752('0x12')],_0x258795);_0x1f54ab(_0x3164d0[_0x4752('0x10')](0x1f4,_0x1717ea[_0x4752('0x12')]));});});}; \ No newline at end of file +var _0xbda7=['catch','ShowSalesforceAccount','SalesforceAccount','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetSalesforceAccount','findAll','options','raw','where','attributes','map','model','include'];(function(_0x1c8acb,_0x29f3dd){var _0x5bd397=function(_0x3024fa){while(--_0x3024fa){_0x1c8acb['push'](_0x1c8acb['shift']());}};_0x5bd397(++_0x29f3dd);}(_0xbda7,0x1ca));var _0x7bda=function(_0x9f15ae,_0x37d403){_0x9f15ae=_0x9f15ae-0x0;var _0x1c2e71=_0xbda7[_0x9f15ae];return _0x1c2e71;};'use strict';var _=require(_0x7bda('0x0'));var util=require(_0x7bda('0x1'));var moment=require(_0x7bda('0x2'));var BPromise=require(_0x7bda('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7bda('0x4'));var db=require(_0x7bda('0x5'))['db'];var utils=require(_0x7bda('0x6'));var logger=require(_0x7bda('0x7'))(_0x7bda('0x8'));var config=require(_0x7bda('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7bda('0xa')][_0x7bda('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x27f906,_0x3853cc,_0x51aa86){return new BPromise(function(_0x264ddf,_0x543c3e){return client['request'](_0x27f906,_0x51aa86)[_0x7bda('0xc')](function(_0x240965){logger[_0x7bda('0xd')](_0x7bda('0xe'),_0x3853cc,_0x7bda('0xf'));logger[_0x7bda('0x10')](_0x7bda('0x11'),_0x3853cc,_0x7bda('0xf'),JSON[_0x7bda('0x12')](_0x240965));if(_0x240965[_0x7bda('0x13')]){if(_0x240965[_0x7bda('0x13')][_0x7bda('0x14')]===0x1f4){logger[_0x7bda('0x13')]('SalesforceAccount,\x20%s,\x20%s',_0x3853cc,_0x240965[_0x7bda('0x13')]['message']);return _0x543c3e(_0x240965[_0x7bda('0x13')][_0x7bda('0x15')]);}logger[_0x7bda('0x13')](_0x7bda('0xe'),_0x3853cc,_0x240965[_0x7bda('0x13')][_0x7bda('0x15')]);return _0x264ddf(_0x240965['error'][_0x7bda('0x15')]);}else{logger[_0x7bda('0xd')](_0x7bda('0xe'),_0x3853cc,_0x7bda('0xf'));_0x264ddf(_0x240965[_0x7bda('0x16')][_0x7bda('0x15')]);}})['catch'](function(_0x9cbd67){logger[_0x7bda('0x13')](_0x7bda('0xe'),_0x3853cc,_0x9cbd67);_0x543c3e(_0x9cbd67);});});}exports[_0x7bda('0x17')]=function(_0x276bb7){var _0x52bbf6=this;return new Promise(function(_0x47b393,_0x46e3a4){return db['SalesforceAccount'][_0x7bda('0x18')]({'raw':_0x276bb7[_0x7bda('0x19')]?_0x276bb7[_0x7bda('0x19')][_0x7bda('0x1a')]===undefined?!![]:![]:!![],'where':_0x276bb7['options']?_0x276bb7['options'][_0x7bda('0x1b')]||null:null,'attributes':_0x276bb7[_0x7bda('0x19')]?_0x276bb7['options'][_0x7bda('0x1c')]||null:null,'limit':_0x276bb7['options']?_0x276bb7[_0x7bda('0x19')]['limit']||null:null,'include':_0x276bb7[_0x7bda('0x19')]?_0x276bb7[_0x7bda('0x19')]['include']?_[_0x7bda('0x1d')](_0x276bb7[_0x7bda('0x19')]['include'],function(_0x57d699){return{'model':db[_0x57d699[_0x7bda('0x1e')]],'as':_0x57d699['as'],'attributes':_0x57d699[_0x7bda('0x1c')],'include':_0x57d699['include']?_[_0x7bda('0x1d')](_0x57d699[_0x7bda('0x1f')],function(_0xdc3f0f){return{'model':db[_0xdc3f0f[_0x7bda('0x1e')]],'as':_0xdc3f0f['as'],'attributes':_0xdc3f0f[_0x7bda('0x1c')],'include':_0xdc3f0f['include']?_['map'](_0xdc3f0f[_0x7bda('0x1f')],function(_0x4a1b78){return{'model':db[_0x4a1b78[_0x7bda('0x1e')]],'as':_0x4a1b78['as'],'attributes':_0x4a1b78[_0x7bda('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x7bda('0xc')](function(_0x168da5){logger[_0x7bda('0xd')]('GetSalesforceAccount',_0x276bb7);logger[_0x7bda('0x10')](_0x7bda('0x17'),_0x276bb7,JSON[_0x7bda('0x12')](_0x168da5));_0x47b393(_0x168da5);})[_0x7bda('0x20')](function(_0x33d782){logger['error'](_0x7bda('0x17'),_0x33d782[_0x7bda('0x15')],_0x276bb7);_0x46e3a4(_0x52bbf6['error'](0x1f4,_0x33d782[_0x7bda('0x15')]));});});};exports[_0x7bda('0x21')]=function(_0x10237e){var _0x3dc1fa=this;return new Promise(function(_0x3e67f0,_0x25140a){return db[_0x7bda('0x22')]['find']({'raw':_0x10237e[_0x7bda('0x19')]?_0x10237e[_0x7bda('0x19')][_0x7bda('0x1a')]===undefined?!![]:![]:!![],'where':_0x10237e[_0x7bda('0x19')]?_0x10237e[_0x7bda('0x19')]['where']||null:null,'attributes':_0x10237e[_0x7bda('0x19')]?_0x10237e[_0x7bda('0x19')][_0x7bda('0x1c')]||null:null,'include':_0x10237e['options']?_0x10237e[_0x7bda('0x19')][_0x7bda('0x1f')]?_['map'](_0x10237e[_0x7bda('0x19')][_0x7bda('0x1f')],function(_0x5c080d){return{'model':db[_0x5c080d[_0x7bda('0x1e')]],'as':_0x5c080d['as'],'attributes':_0x5c080d['attributes'],'include':_0x5c080d['include']?_[_0x7bda('0x1d')](_0x5c080d[_0x7bda('0x1f')],function(_0x137e5c){return{'model':db[_0x137e5c[_0x7bda('0x1e')]],'as':_0x137e5c['as'],'attributes':_0x137e5c[_0x7bda('0x1c')],'include':_0x137e5c[_0x7bda('0x1f')]?_['map'](_0x137e5c[_0x7bda('0x1f')],function(_0x427948){return{'model':db[_0x427948[_0x7bda('0x1e')]],'as':_0x427948['as'],'attributes':_0x427948[_0x7bda('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x7bda('0xc')](function(_0x41cd19){logger[_0x7bda('0xd')](_0x7bda('0x21'),_0x10237e);logger[_0x7bda('0x10')]('ShowSalesforceAccount',_0x10237e,JSON['stringify'](_0x41cd19));_0x3e67f0(_0x41cd19);})[_0x7bda('0x20')](function(_0x589f4a){logger[_0x7bda('0x13')]('ShowSalesforceAccount',_0x589f4a[_0x7bda('0x15')],_0x10237e);_0x25140a(_0x3dc1fa['error'](0x1f4,_0x589f4a[_0x7bda('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index dbdb60f..00f8b9c 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 _0x2ef3=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intSalesforceConfiguration.controller','get','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','exports','multer','util','path'];(function(_0x170d4c,_0x4fc4f2){var _0x2ea811=function(_0x5acbb7){while(--_0x5acbb7){_0x170d4c['push'](_0x170d4c['shift']());}};_0x2ea811(++_0x4fc4f2);}(_0x2ef3,0xba));var _0x32ef=function(_0xb9f075,_0x407568){_0xb9f075=_0xb9f075-0x0;var _0x3c6e0c=_0x2ef3[_0xb9f075];return _0x3c6e0c;};'use strict';var multer=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var path=require(_0x32ef('0x2'));var timeout=require(_0x32ef('0x3'));var express=require(_0x32ef('0x4'));var router=express[_0x32ef('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x32ef('0x6'));var interaction=require(_0x32ef('0x7'));var config=require('../../config/environment');var controller=require(_0x32ef('0x8'));router[_0x32ef('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x32ef('0x9')](_0x32ef('0xa'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x9')](_0x32ef('0xd'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xe')]);router[_0x32ef('0x9')](_0x32ef('0xf'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x32ef('0x9')](_0x32ef('0x10'),auth[_0x32ef('0xb')](),controller[_0x32ef('0x11')]);router['post']('/',auth[_0x32ef('0xb')](),controller['create']);router[_0x32ef('0x12')]('/:id',auth[_0x32ef('0xb')](),controller[_0x32ef('0x13')]);router['delete']('/:id',auth[_0x32ef('0xb')](),controller['destroy']);module[_0x32ef('0x14')]=router; \ No newline at end of file +var _0x0b0e=['post','create','put','/:id','update','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','getDescriptions'];(function(_0x99868f,_0xbdb8e7){var _0x27a71b=function(_0x41feca){while(--_0x41feca){_0x99868f['push'](_0x99868f['shift']());}};_0x27a71b(++_0xbdb8e7);}(_0x0b0e,0x187));var _0xe0b0=function(_0x3f9ea9,_0x19840d){_0x3f9ea9=_0x3f9ea9-0x0;var _0x291e7f=_0x0b0e[_0x3f9ea9];return _0x291e7f;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['getFields']);router[_0xe0b0('0x9')](_0xe0b0('0xe'),auth['isAuthenticated'](),controller[_0xe0b0('0xf')]);router[_0xe0b0('0x9')]('/:id/descriptions',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x10')]);router[_0xe0b0('0x11')]('/',auth['isAuthenticated'](),controller[_0xe0b0('0x12')]);router[_0xe0b0('0x13')](_0xe0b0('0x14'),auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x15')]);router['delete'](_0xe0b0('0x14'),auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x16')]);module[_0xe0b0('0x17')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 854cf6f..18a0e96 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 _0x8da8=['nothing','sequelize','exports','STRING','ENUM','Task','contact_lead','contact','lead','account_contact_lead'];(function(_0x37c2cb,_0x18397b){var _0x5dda0c=function(_0x476bab){while(--_0x476bab){_0x37c2cb['push'](_0x37c2cb['shift']());}};_0x5dda0c(++_0x18397b);}(_0x8da8,0x187));var _0x88da=function(_0x23289e,_0x5085ad){_0x23289e=_0x23289e-0x0;var _0xf201bf=_0x8da8[_0x23289e];return _0xf201bf;};'use strict';var Sequelize=require(_0x88da('0x0'));module[_0x88da('0x1')]={'name':{'type':Sequelize[_0x88da('0x2')]},'description':{'type':Sequelize[_0x88da('0x2')]},'ticketType':{'type':Sequelize[_0x88da('0x3')](_0x88da('0x4'),'Case'),'defaultValue':_0x88da('0x4')},'moduleSearch':{'type':Sequelize[_0x88da('0x3')](_0x88da('0x5'),_0x88da('0x6'),_0x88da('0x7'),_0x88da('0x8'),'account'),'defaultValue':_0x88da('0x5')},'moduleCreate':{'type':Sequelize[_0x88da('0x3')](_0x88da('0x9'),_0x88da('0x6'),'lead','account'),'defaultValue':_0x88da('0x7')},'leadId':{'type':Sequelize[_0x88da('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0x88da('0x2')]},'additionalSearchContact':{'type':Sequelize[_0x88da('0x2')]},'additionalSearchLead':{'type':Sequelize[_0x88da('0x2')]}}; \ No newline at end of file +var _0x1058=['contact','lead','account','sequelize','STRING','ENUM','Task','contact_lead'];(function(_0x3f3f77,_0x42801b){var _0x229b23=function(_0x3af08a){while(--_0x3af08a){_0x3f3f77['push'](_0x3f3f77['shift']());}};_0x229b23(++_0x42801b);}(_0x1058,0xcb));var _0x8105=function(_0x2470a5,_0x3392ad){_0x2470a5=_0x2470a5-0x0;var _0x4d6c94=_0x1058[_0x2470a5];return _0x4d6c94;};'use strict';var Sequelize=require(_0x8105('0x0'));module['exports']={'name':{'type':Sequelize[_0x8105('0x1')]},'description':{'type':Sequelize[_0x8105('0x1')]},'ticketType':{'type':Sequelize[_0x8105('0x2')](_0x8105('0x3'),'Case'),'defaultValue':_0x8105('0x3')},'moduleSearch':{'type':Sequelize[_0x8105('0x2')](_0x8105('0x4'),_0x8105('0x5'),_0x8105('0x6'),'account_contact_lead','account'),'defaultValue':_0x8105('0x4')},'moduleCreate':{'type':Sequelize[_0x8105('0x2')]('nothing',_0x8105('0x5'),_0x8105('0x6'),_0x8105('0x7')),'defaultValue':_0x8105('0x6')},'leadId':{'type':Sequelize[_0x8105('0x1')]},'additionalSearchAccount':{'type':Sequelize[_0x8105('0x1')]},'additionalSearchContact':{'type':Sequelize[_0x8105('0x1')]},'additionalSearchLead':{'type':Sequelize[_0x8105('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 849a753..6c4d9fa 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 _0x18a6=['squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','name','index','map','SalesforceConfiguration','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','show','params','find','catch','create','body','findOne','SalesforceField','getFields','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash'];(function(_0x412215,_0x2fdb1e){var _0x1ff77f=function(_0x4bffa6){while(--_0x4bffa6){_0x412215['push'](_0x412215['shift']());}};_0x1ff77f(++_0x2fdb1e);}(_0x18a6,0x1d4));var _0x618a=function(_0x23a374,_0x6da169){_0x23a374=_0x23a374-0x0;var _0x5cba20=_0x18a6[_0x23a374];return _0x5cba20;};'use strict';var emlformat=require(_0x618a('0x0'));var rimraf=require(_0x618a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x618a('0x2'));var rp=require(_0x618a('0x3'));var moment=require(_0x618a('0x4'));var BPromise=require(_0x618a('0x5'));var Mustache=require(_0x618a('0x6'));var util=require(_0x618a('0x7'));var path=require(_0x618a('0x8'));var sox=require(_0x618a('0x9'));var csv=require('to-csv');var ejs=require(_0x618a('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x618a('0xb'));var squel=require(_0x618a('0xc'));var crypto=require(_0x618a('0xd'));var jsforce=require(_0x618a('0xe'));var deskjs=require(_0x618a('0xf'));var toCsv=require('to-csv');var querystring=require(_0x618a('0x10'));var Papa=require('papaparse');var Redis=require(_0x618a('0x11'));var authService=require(_0x618a('0x12'));var qs=require(_0x618a('0x13'));var as=require(_0x618a('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x618a('0x15'))(_0x618a('0x16'));var utils=require(_0x618a('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x618a('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d2f96,_0x4d79b4){_0x4d79b4=_0x4d79b4||0xcc;return function(_0x181f67){if(_0x181f67){return _0x1d2f96[_0x618a('0x19')](_0x4d79b4);}return _0x1d2f96[_0x618a('0x1a')](_0x4d79b4)[_0x618a('0x1b')]();};}function respondWithResult(_0x13f5e1,_0x4e5cf0){_0x4e5cf0=_0x4e5cf0||0xc8;return function(_0x26407d){if(_0x26407d){return _0x13f5e1[_0x618a('0x1a')](_0x4e5cf0)[_0x618a('0x1c')](_0x26407d);}};}function respondWithFilteredResult(_0x12656a,_0x5f1785){return function(_0x2cdbbe){if(_0x2cdbbe){var _0x349cbc=typeof _0x5f1785[_0x618a('0x1d')]===_0x618a('0x1e')&&typeof _0x5f1785[_0x618a('0x1f')]===_0x618a('0x1e');var _0x5a3c72=_0x2cdbbe[_0x618a('0x20')];var _0x249231=_0x349cbc?0x0:_0x5f1785[_0x618a('0x1d')];var _0x5d5a70=_0x349cbc?_0x2cdbbe[_0x618a('0x20')]:_0x5f1785[_0x618a('0x1d')]+_0x5f1785[_0x618a('0x1f')];var _0x921483;if(_0x5d5a70>=_0x5a3c72){_0x5d5a70=_0x5a3c72;_0x921483=0xc8;}else{_0x921483=0xce;}_0x12656a['status'](_0x921483);return _0x12656a['set'](_0x618a('0x21'),_0x249231+'-'+_0x5d5a70+'/'+_0x5a3c72)[_0x618a('0x1c')](_0x2cdbbe);}return null;};}function patchUpdates(_0x136293){return function(_0x2bb724){try{jsonpatch[_0x618a('0x22')](_0x2bb724,_0x136293,!![]);}catch(_0x3f0f7b){return BPromise[_0x618a('0x23')](_0x3f0f7b);}return _0x2bb724[_0x618a('0x24')]();};}function saveUpdates(_0x564900,_0x425915){return function(_0x572b80){if(_0x572b80){return _0x572b80[_0x618a('0x25')](_0x564900)[_0x618a('0x26')](function(_0x3106a7){return _0x3106a7;});}return null;};}function removeEntity(_0x4d87d6,_0x20f613){return function(_0x1f4e94){if(_0x1f4e94){return _0x1f4e94[_0x618a('0x27')]()[_0x618a('0x26')](function(){_0x4d87d6[_0x618a('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e84ff,_0x44d93b){return function(_0x1870a2){if(!_0x1870a2){_0x5e84ff[_0x618a('0x19')](0x194);}return _0x1870a2;};}function handleError(_0x3f08fc,_0x34b1a9){_0x34b1a9=_0x34b1a9||0x1f4;return function(_0x4d11d0){logger['error'](_0x4d11d0['stack']);if(_0x4d11d0[_0x618a('0x28')]){delete _0x4d11d0[_0x618a('0x28')];}_0x3f08fc[_0x618a('0x1a')](_0x34b1a9)['send'](_0x4d11d0);};}exports[_0x618a('0x29')]=function(_0x42636d,_0x538c9b){var _0x1cdd4f={},_0xfac4c9={},_0x27ff7c={'count':0x0,'rows':[]};var _0x215778=_[_0x618a('0x2a')](db[_0x618a('0x2b')][_0x618a('0x2c')],function(_0x225180){return{'name':_0x225180[_0x618a('0x2d')],'type':_0x225180[_0x618a('0x2e')][_0x618a('0x2f')]};});_0xfac4c9['model']=_[_0x618a('0x2a')](_0x215778,_0x618a('0x28'));_0xfac4c9[_0x618a('0x30')]=_[_0x618a('0x31')](_0x42636d['query']);_0xfac4c9[_0x618a('0x32')]=_[_0x618a('0x33')](_0xfac4c9[_0x618a('0x34')],_0xfac4c9['query']);_0x1cdd4f[_0x618a('0x35')]=_[_0x618a('0x33')](_0xfac4c9[_0x618a('0x34')],qs[_0x618a('0x36')](_0x42636d['query'][_0x618a('0x36')]));_0x1cdd4f[_0x618a('0x35')]=_0x1cdd4f[_0x618a('0x35')][_0x618a('0x37')]?_0x1cdd4f[_0x618a('0x35')]:_0xfac4c9['model'];if(!_0x42636d[_0x618a('0x30')][_0x618a('0x38')](_0x618a('0x39'))){_0x1cdd4f[_0x618a('0x1f')]=qs['limit'](_0x42636d['query'][_0x618a('0x1f')]);_0x1cdd4f['offset']=qs[_0x618a('0x1d')](_0x42636d[_0x618a('0x30')][_0x618a('0x1d')]);}_0x1cdd4f[_0x618a('0x3a')]=qs['sort'](_0x42636d[_0x618a('0x30')][_0x618a('0x3b')]);_0x1cdd4f[_0x618a('0x3c')]=qs['filters'](_[_0x618a('0x3d')](_0x42636d['query'],_0xfac4c9[_0x618a('0x32')]),_0x215778);if(_0x42636d[_0x618a('0x30')]['filter']){_0x1cdd4f['where']=_[_0x618a('0x3e')](_0x1cdd4f['where'],{'$or':_[_0x618a('0x2a')](_0x215778,function(_0x4604dc){if(_0x4604dc[_0x618a('0x2e')]!==_0x618a('0x3f')){var _0x1d1c4b={};_0x1d1c4b[_0x4604dc[_0x618a('0x28')]]={'$like':'%'+_0x42636d[_0x618a('0x30')][_0x618a('0x40')]+'%'};return _0x1d1c4b;}})});}_0x1cdd4f=_['merge']({},_0x1cdd4f,_0x42636d[_0x618a('0x41')]);var _0x9fa82b={'where':_0x1cdd4f[_0x618a('0x3c')]};return db[_0x618a('0x2b')]['count'](_0x9fa82b)[_0x618a('0x26')](function(_0x1e4b6c){_0x27ff7c[_0x618a('0x20')]=_0x1e4b6c;if(_0x42636d[_0x618a('0x30')][_0x618a('0x42')]){_0x1cdd4f[_0x618a('0x43')]=[{'all':!![]}];}return db[_0x618a('0x2b')][_0x618a('0x44')](_0x1cdd4f);})[_0x618a('0x26')](function(_0x29d684){_0x27ff7c['rows']=_0x29d684;return _0x27ff7c;})['then'](respondWithFilteredResult(_0x538c9b,_0x1cdd4f))['catch'](handleError(_0x538c9b,null));};exports[_0x618a('0x45')]=function(_0x37c57d,_0x428513){var _0x236be8={'raw':![],'where':{'id':_0x37c57d[_0x618a('0x46')]['id']}},_0x13602b={};_0x13602b[_0x618a('0x34')]=_[_0x618a('0x31')](db[_0x618a('0x2b')][_0x618a('0x2c')]);_0x13602b[_0x618a('0x30')]=_[_0x618a('0x31')](_0x37c57d[_0x618a('0x30')]);_0x13602b['filters']=_[_0x618a('0x33')](_0x13602b[_0x618a('0x34')],_0x13602b['query']);_0x236be8['attributes']=_['intersection'](_0x13602b[_0x618a('0x34')],qs[_0x618a('0x36')](_0x37c57d[_0x618a('0x30')][_0x618a('0x36')]));_0x236be8[_0x618a('0x35')]=_0x236be8[_0x618a('0x35')][_0x618a('0x37')]?_0x236be8[_0x618a('0x35')]:_0x13602b[_0x618a('0x34')];if(_0x37c57d[_0x618a('0x30')][_0x618a('0x42')]){_0x236be8['include']=[{'all':!![]}];}_0x236be8=_[_0x618a('0x3e')]({},_0x236be8,_0x37c57d[_0x618a('0x41')]);return db[_0x618a('0x2b')][_0x618a('0x47')](_0x236be8)['then'](handleEntityNotFound(_0x428513,null))[_0x618a('0x26')](respondWithResult(_0x428513,null))[_0x618a('0x48')](handleError(_0x428513,null));};exports[_0x618a('0x49')]=function(_0x2dfefa,_0x572cd9){return db[_0x618a('0x2b')]['create'](_0x2dfefa[_0x618a('0x4a')],{})['then'](respondWithResult(_0x572cd9,0xc9))[_0x618a('0x48')](handleError(_0x572cd9,null));};exports[_0x618a('0x25')]=function(_0x52325e,_0x523b2b){if(_0x52325e[_0x618a('0x4a')]['id']){delete _0x52325e[_0x618a('0x4a')]['id'];}return db[_0x618a('0x2b')][_0x618a('0x47')]({'where':{'id':_0x52325e['params']['id']}})['then'](handleEntityNotFound(_0x523b2b,null))[_0x618a('0x26')](saveUpdates(_0x52325e[_0x618a('0x4a')],null))[_0x618a('0x26')](respondWithResult(_0x523b2b,null))[_0x618a('0x48')](handleError(_0x523b2b,null));};exports[_0x618a('0x27')]=function(_0xcc37e7,_0x48a5fa){return db['SalesforceConfiguration']['find']({'where':{'id':_0xcc37e7[_0x618a('0x46')]['id']}})[_0x618a('0x26')](handleEntityNotFound(_0x48a5fa,null))[_0x618a('0x26')](removeEntity(_0x48a5fa,null))[_0x618a('0x48')](handleError(_0x48a5fa,null));};exports['getFields']=function(_0x66c0c4,_0x251bcd,_0x1ac6b2){var _0x1359e9={};var _0x573834={};var _0x1caed1;var _0x4d7dfe;return db[_0x618a('0x2b')][_0x618a('0x4b')]({'where':{'id':_0x66c0c4['params']['id']}})[_0x618a('0x26')](handleEntityNotFound(_0x251bcd,null))[_0x618a('0x26')](function(_0x4d2d85){if(_0x4d2d85){_0x1caed1=_0x4d2d85;_0x573834[_0x618a('0x34')]=_['keys'](db[_0x618a('0x4c')][_0x618a('0x2c')]);_0x573834['query']=_['keys'](_0x66c0c4[_0x618a('0x30')]);_0x573834[_0x618a('0x32')]=_[_0x618a('0x33')](_0x573834['model'],_0x573834[_0x618a('0x30')]);_0x1359e9[_0x618a('0x35')]=_[_0x618a('0x33')](_0x573834[_0x618a('0x34')],qs['fields'](_0x66c0c4[_0x618a('0x30')][_0x618a('0x36')]));_0x1359e9[_0x618a('0x35')]=_0x1359e9[_0x618a('0x35')]['length']?_0x1359e9[_0x618a('0x35')]:_0x573834['model'];_0x1359e9[_0x618a('0x3a')]=qs[_0x618a('0x3b')](_0x66c0c4[_0x618a('0x30')][_0x618a('0x3b')]);_0x1359e9[_0x618a('0x3c')]=qs[_0x618a('0x32')](_[_0x618a('0x3d')](_0x66c0c4[_0x618a('0x30')],_0x573834[_0x618a('0x32')]));if(_0x66c0c4['query'][_0x618a('0x40')]){_0x1359e9['where']=_['merge'](_0x1359e9[_0x618a('0x3c')],{'$or':_['map'](_0x1359e9['attributes'],function(_0x33c382){var _0x3f9561={};_0x3f9561[_0x33c382]={'$like':'%'+_0x66c0c4['query'][_0x618a('0x40')]+'%'};return _0x3f9561;})});}_0x1359e9=_[_0x618a('0x3e')]({},_0x1359e9,_0x66c0c4['options']);return _0x1caed1['getFields'](_0x1359e9);}})['then'](function(_0x6d3c3b){if(_0x6d3c3b){_0x4d7dfe=_0x6d3c3b[_0x618a('0x37')];if(!_0x66c0c4[_0x618a('0x30')][_0x618a('0x38')]('nolimit')){_0x1359e9['limit']=qs[_0x618a('0x1f')](_0x66c0c4['query']['limit']);_0x1359e9[_0x618a('0x1d')]=qs['offset'](_0x66c0c4[_0x618a('0x30')][_0x618a('0x1d')]);}return _0x1caed1[_0x618a('0x4d')](_0x1359e9);}})[_0x618a('0x26')](function(_0x39acc7){if(_0x39acc7){return _0x39acc7?{'count':_0x4d7dfe,'rows':_0x39acc7}:null;}})[_0x618a('0x26')](respondWithResult(_0x251bcd,null))['catch'](handleError(_0x251bcd,null));};exports[_0x618a('0x4e')]=function(_0x41813b,_0x509b13,_0x421dbf){var _0xbe0943={};var _0x23ac39={};var _0x43ae78;var _0x5aaf1a;return db[_0x618a('0x2b')][_0x618a('0x4b')]({'where':{'id':_0x41813b[_0x618a('0x46')]['id']}})[_0x618a('0x26')](handleEntityNotFound(_0x509b13,null))['then'](function(_0x1fc626){if(_0x1fc626){_0x43ae78=_0x1fc626;_0x23ac39[_0x618a('0x34')]=_[_0x618a('0x31')](db[_0x618a('0x4c')]['rawAttributes']);_0x23ac39[_0x618a('0x30')]=_[_0x618a('0x31')](_0x41813b[_0x618a('0x30')]);_0x23ac39[_0x618a('0x32')]=_[_0x618a('0x33')](_0x23ac39['model'],_0x23ac39[_0x618a('0x30')]);_0xbe0943[_0x618a('0x35')]=_[_0x618a('0x33')](_0x23ac39[_0x618a('0x34')],qs['fields'](_0x41813b[_0x618a('0x30')][_0x618a('0x36')]));_0xbe0943[_0x618a('0x35')]=_0xbe0943[_0x618a('0x35')][_0x618a('0x37')]?_0xbe0943['attributes']:_0x23ac39['model'];_0xbe0943[_0x618a('0x3a')]=qs['sort'](_0x41813b[_0x618a('0x30')][_0x618a('0x3b')]);_0xbe0943[_0x618a('0x3c')]=qs[_0x618a('0x32')](_[_0x618a('0x3d')](_0x41813b[_0x618a('0x30')],_0x23ac39[_0x618a('0x32')]));if(_0x41813b['query'][_0x618a('0x40')]){_0xbe0943[_0x618a('0x3c')]=_[_0x618a('0x3e')](_0xbe0943[_0x618a('0x3c')],{'$or':_[_0x618a('0x2a')](_0xbe0943[_0x618a('0x35')],function(_0x15e9b8){var _0xd1ed7a={};_0xd1ed7a[_0x15e9b8]={'$like':'%'+_0x41813b[_0x618a('0x30')][_0x618a('0x40')]+'%'};return _0xd1ed7a;})});}_0xbe0943=_[_0x618a('0x3e')]({},_0xbe0943,_0x41813b[_0x618a('0x41')]);return _0x43ae78[_0x618a('0x4e')](_0xbe0943);}})[_0x618a('0x26')](function(_0x289298){if(_0x289298){_0x5aaf1a=_0x289298[_0x618a('0x37')];if(!_0x41813b[_0x618a('0x30')][_0x618a('0x38')](_0x618a('0x39'))){_0xbe0943[_0x618a('0x1f')]=qs[_0x618a('0x1f')](_0x41813b[_0x618a('0x30')]['limit']);_0xbe0943['offset']=qs['offset'](_0x41813b[_0x618a('0x30')][_0x618a('0x1d')]);}return _0x43ae78[_0x618a('0x4e')](_0xbe0943);}})['then'](function(_0x283ccf){if(_0x283ccf){return _0x283ccf?{'count':_0x5aaf1a,'rows':_0x283ccf}:null;}})[_0x618a('0x26')](respondWithResult(_0x509b13,null))[_0x618a('0x48')](handleError(_0x509b13,null));};exports['getDescriptions']=function(_0x4e06d8,_0x1e5318,_0x5b937f){var _0x2d3b87={};var _0x45e479={};var _0x127bfd;var _0x5d9cdd;return db[_0x618a('0x2b')][_0x618a('0x4b')]({'where':{'id':_0x4e06d8[_0x618a('0x46')]['id']}})[_0x618a('0x26')](handleEntityNotFound(_0x1e5318,null))[_0x618a('0x26')](function(_0x1090dd){if(_0x1090dd){_0x127bfd=_0x1090dd;_0x45e479[_0x618a('0x34')]=_[_0x618a('0x31')](db['SalesforceField'][_0x618a('0x2c')]);_0x45e479[_0x618a('0x30')]=_[_0x618a('0x31')](_0x4e06d8[_0x618a('0x30')]);_0x45e479[_0x618a('0x32')]=_[_0x618a('0x33')](_0x45e479[_0x618a('0x34')],_0x45e479['query']);_0x2d3b87[_0x618a('0x35')]=_[_0x618a('0x33')](_0x45e479[_0x618a('0x34')],qs[_0x618a('0x36')](_0x4e06d8[_0x618a('0x30')][_0x618a('0x36')]));_0x2d3b87[_0x618a('0x35')]=_0x2d3b87['attributes'][_0x618a('0x37')]?_0x2d3b87[_0x618a('0x35')]:_0x45e479[_0x618a('0x34')];_0x2d3b87[_0x618a('0x3a')]=qs[_0x618a('0x3b')](_0x4e06d8[_0x618a('0x30')][_0x618a('0x3b')]);_0x2d3b87['where']=qs[_0x618a('0x32')](_['pick'](_0x4e06d8['query'],_0x45e479[_0x618a('0x32')]));if(_0x4e06d8[_0x618a('0x30')]['filter']){_0x2d3b87[_0x618a('0x3c')]=_[_0x618a('0x3e')](_0x2d3b87['where'],{'$or':_['map'](_0x2d3b87[_0x618a('0x35')],function(_0x2038c8){var _0x1f62d9={};_0x1f62d9[_0x2038c8]={'$like':'%'+_0x4e06d8[_0x618a('0x30')][_0x618a('0x40')]+'%'};return _0x1f62d9;})});}_0x2d3b87=_[_0x618a('0x3e')]({},_0x2d3b87,_0x4e06d8[_0x618a('0x41')]);return _0x127bfd['getDescriptions'](_0x2d3b87);}})['then'](function(_0x31d07a){if(_0x31d07a){_0x5d9cdd=_0x31d07a[_0x618a('0x37')];if(!_0x4e06d8[_0x618a('0x30')][_0x618a('0x38')](_0x618a('0x39'))){_0x2d3b87[_0x618a('0x1f')]=qs[_0x618a('0x1f')](_0x4e06d8[_0x618a('0x30')]['limit']);_0x2d3b87[_0x618a('0x1d')]=qs[_0x618a('0x1d')](_0x4e06d8[_0x618a('0x30')]['offset']);}return _0x127bfd[_0x618a('0x4f')](_0x2d3b87);}})[_0x618a('0x26')](function(_0x341ea6){if(_0x341ea6){return _0x341ea6?{'count':_0x5d9cdd,'rows':_0x341ea6}:null;}})['then'](respondWithResult(_0x1e5318,null))['catch'](handleError(_0x1e5318,null));}; \ No newline at end of file +var _0x714a=['../../config/license/hardware','api','../../config/license/util','sendStatus','end','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','send','index','map','SalesforceConfiguration','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','order','getFields','nolimit','getSubjects','getDescriptions','findOne','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x5d9eca,_0x516294){var _0x326510=function(_0x5edd76){while(--_0x5edd76){_0x5d9eca['push'](_0x5d9eca['shift']());}};_0x326510(++_0x516294);}(_0x714a,0xd8));var _0xa714=function(_0x27280b,_0x2a742){_0x27280b=_0x27280b-0x0;var _0x43eff8=_0x714a[_0x27280b];return _0x43eff8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa714('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa714('0x1'));var rp=require(_0xa714('0x2'));var moment=require(_0xa714('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa714('0x4'));var util=require('util');var path=require(_0xa714('0x5'));var sox=require(_0xa714('0x6'));var csv=require(_0xa714('0x7'));var ejs=require(_0xa714('0x8'));var fs=require('fs');var fs_extra=require(_0xa714('0x9'));var _=require(_0xa714('0xa'));var squel=require(_0xa714('0xb'));var crypto=require(_0xa714('0xc'));var jsforce=require(_0xa714('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa714('0xe'));var Papa=require('papaparse');var Redis=require(_0xa714('0xf'));var authService=require(_0xa714('0x10'));var qs=require(_0xa714('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa714('0x12'));var logger=require('../../config/logger')(_0xa714('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa714('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1095dc,_0x3000a2){_0x3000a2=_0x3000a2||0xcc;return function(_0x335b5b){if(_0x335b5b){return _0x1095dc[_0xa714('0x15')](_0x3000a2);}return _0x1095dc['status'](_0x3000a2)[_0xa714('0x16')]();};}function respondWithResult(_0x173405,_0x7e0324){_0x7e0324=_0x7e0324||0xc8;return function(_0x32003a){if(_0x32003a){return _0x173405[_0xa714('0x17')](_0x7e0324)['json'](_0x32003a);}};}function respondWithFilteredResult(_0x3dc041,_0x759b60){return function(_0x2b6606){if(_0x2b6606){var _0x239790=typeof _0x759b60['offset']===_0xa714('0x18')&&typeof _0x759b60[_0xa714('0x19')]==='undefined';var _0x235556=_0x2b6606[_0xa714('0x1a')];var _0x460966=_0x239790?0x0:_0x759b60['offset'];var _0x2cf4a9=_0x239790?_0x2b6606[_0xa714('0x1a')]:_0x759b60[_0xa714('0x1b')]+_0x759b60[_0xa714('0x19')];var _0x972ca2;if(_0x2cf4a9>=_0x235556){_0x2cf4a9=_0x235556;_0x972ca2=0xc8;}else{_0x972ca2=0xce;}_0x3dc041['status'](_0x972ca2);return _0x3dc041[_0xa714('0x1c')](_0xa714('0x1d'),_0x460966+'-'+_0x2cf4a9+'/'+_0x235556)[_0xa714('0x1e')](_0x2b6606);}return null;};}function patchUpdates(_0x38ae36){return function(_0x7b9f39){try{jsonpatch[_0xa714('0x1f')](_0x7b9f39,_0x38ae36,!![]);}catch(_0x3140a9){return BPromise[_0xa714('0x20')](_0x3140a9);}return _0x7b9f39[_0xa714('0x21')]();};}function saveUpdates(_0x2edc56,_0x22efaf){return function(_0x57f81e){if(_0x57f81e){return _0x57f81e[_0xa714('0x22')](_0x2edc56)[_0xa714('0x23')](function(_0x43ebfd){return _0x43ebfd;});}return null;};}function removeEntity(_0x4b78e7,_0x2870de){return function(_0x5bfd8b){if(_0x5bfd8b){return _0x5bfd8b[_0xa714('0x24')]()['then'](function(){_0x4b78e7[_0xa714('0x17')](0xcc)[_0xa714('0x16')]();});}};}function handleEntityNotFound(_0x75505e,_0x116642){return function(_0x1bffba){if(!_0x1bffba){_0x75505e[_0xa714('0x15')](0x194);}return _0x1bffba;};}function handleError(_0x2e4461,_0xa1498e){_0xa1498e=_0xa1498e||0x1f4;return function(_0x1cca99){logger[_0xa714('0x25')](_0x1cca99['stack']);if(_0x1cca99[_0xa714('0x26')]){delete _0x1cca99['name'];}_0x2e4461[_0xa714('0x17')](_0xa1498e)[_0xa714('0x27')](_0x1cca99);};}exports[_0xa714('0x28')]=function(_0x9a7c8f,_0x831c1){var _0x2ba8f7={},_0x15dc1f={},_0x1cf669={'count':0x0,'rows':[]};var _0x413b6f=_[_0xa714('0x29')](db[_0xa714('0x2a')][_0xa714('0x2b')],function(_0x4960dc){return{'name':_0x4960dc[_0xa714('0x2c')],'type':_0x4960dc[_0xa714('0x2d')][_0xa714('0x2e')]};});_0x15dc1f['model']=_[_0xa714('0x29')](_0x413b6f,_0xa714('0x26'));_0x15dc1f[_0xa714('0x2f')]=_[_0xa714('0x30')](_0x9a7c8f[_0xa714('0x2f')]);_0x15dc1f[_0xa714('0x31')]=_[_0xa714('0x32')](_0x15dc1f[_0xa714('0x33')],_0x15dc1f['query']);_0x2ba8f7['attributes']=_[_0xa714('0x32')](_0x15dc1f[_0xa714('0x33')],qs[_0xa714('0x34')](_0x9a7c8f['query'][_0xa714('0x34')]));_0x2ba8f7[_0xa714('0x35')]=_0x2ba8f7['attributes'][_0xa714('0x36')]?_0x2ba8f7['attributes']:_0x15dc1f['model'];if(!_0x9a7c8f[_0xa714('0x2f')][_0xa714('0x37')]('nolimit')){_0x2ba8f7[_0xa714('0x19')]=qs['limit'](_0x9a7c8f[_0xa714('0x2f')][_0xa714('0x19')]);_0x2ba8f7[_0xa714('0x1b')]=qs[_0xa714('0x1b')](_0x9a7c8f[_0xa714('0x2f')]['offset']);}_0x2ba8f7['order']=qs['sort'](_0x9a7c8f[_0xa714('0x2f')][_0xa714('0x38')]);_0x2ba8f7['where']=qs[_0xa714('0x31')](_[_0xa714('0x39')](_0x9a7c8f['query'],_0x15dc1f[_0xa714('0x31')]),_0x413b6f);if(_0x9a7c8f[_0xa714('0x2f')][_0xa714('0x3a')]){_0x2ba8f7[_0xa714('0x3b')]=_[_0xa714('0x3c')](_0x2ba8f7['where'],{'$or':_[_0xa714('0x29')](_0x413b6f,function(_0x468f9a){if(_0x468f9a['type']!=='VIRTUAL'){var _0x49a521={};_0x49a521[_0x468f9a[_0xa714('0x26')]]={'$like':'%'+_0x9a7c8f[_0xa714('0x2f')][_0xa714('0x3a')]+'%'};return _0x49a521;}})});}_0x2ba8f7=_[_0xa714('0x3c')]({},_0x2ba8f7,_0x9a7c8f[_0xa714('0x3d')]);var _0x4dae26={'where':_0x2ba8f7[_0xa714('0x3b')]};return db[_0xa714('0x2a')][_0xa714('0x1a')](_0x4dae26)[_0xa714('0x23')](function(_0xee4089){_0x1cf669['count']=_0xee4089;if(_0x9a7c8f[_0xa714('0x2f')][_0xa714('0x3e')]){_0x2ba8f7[_0xa714('0x3f')]=[{'all':!![]}];}return db['SalesforceConfiguration'][_0xa714('0x40')](_0x2ba8f7);})[_0xa714('0x23')](function(_0x32b9a7){_0x1cf669[_0xa714('0x41')]=_0x32b9a7;return _0x1cf669;})[_0xa714('0x23')](respondWithFilteredResult(_0x831c1,_0x2ba8f7))[_0xa714('0x42')](handleError(_0x831c1,null));};exports[_0xa714('0x43')]=function(_0x595f78,_0x20b696){var _0x2bd93e={'raw':![],'where':{'id':_0x595f78[_0xa714('0x44')]['id']}},_0xb77632={};_0xb77632[_0xa714('0x33')]=_['keys'](db[_0xa714('0x2a')]['rawAttributes']);_0xb77632['query']=_[_0xa714('0x30')](_0x595f78[_0xa714('0x2f')]);_0xb77632[_0xa714('0x31')]=_[_0xa714('0x32')](_0xb77632[_0xa714('0x33')],_0xb77632[_0xa714('0x2f')]);_0x2bd93e['attributes']=_['intersection'](_0xb77632[_0xa714('0x33')],qs[_0xa714('0x34')](_0x595f78[_0xa714('0x2f')][_0xa714('0x34')]));_0x2bd93e['attributes']=_0x2bd93e['attributes'][_0xa714('0x36')]?_0x2bd93e[_0xa714('0x35')]:_0xb77632[_0xa714('0x33')];if(_0x595f78[_0xa714('0x2f')][_0xa714('0x3e')]){_0x2bd93e['include']=[{'all':!![]}];}_0x2bd93e=_[_0xa714('0x3c')]({},_0x2bd93e,_0x595f78[_0xa714('0x3d')]);return db[_0xa714('0x2a')][_0xa714('0x45')](_0x2bd93e)[_0xa714('0x23')](handleEntityNotFound(_0x20b696,null))[_0xa714('0x23')](respondWithResult(_0x20b696,null))[_0xa714('0x42')](handleError(_0x20b696,null));};exports[_0xa714('0x46')]=function(_0x323ab9,_0x2e8673){return db[_0xa714('0x2a')][_0xa714('0x46')](_0x323ab9[_0xa714('0x47')],{})[_0xa714('0x23')](respondWithResult(_0x2e8673,0xc9))[_0xa714('0x42')](handleError(_0x2e8673,null));};exports[_0xa714('0x22')]=function(_0x481d31,_0x15ae84){if(_0x481d31[_0xa714('0x47')]['id']){delete _0x481d31[_0xa714('0x47')]['id'];}return db[_0xa714('0x2a')][_0xa714('0x45')]({'where':{'id':_0x481d31['params']['id']}})['then'](handleEntityNotFound(_0x15ae84,null))[_0xa714('0x23')](saveUpdates(_0x481d31[_0xa714('0x47')],null))[_0xa714('0x23')](respondWithResult(_0x15ae84,null))[_0xa714('0x42')](handleError(_0x15ae84,null));};exports[_0xa714('0x24')]=function(_0x26d8ce,_0x30fd5e){return db[_0xa714('0x2a')][_0xa714('0x45')]({'where':{'id':_0x26d8ce[_0xa714('0x44')]['id']}})[_0xa714('0x23')](handleEntityNotFound(_0x30fd5e,null))[_0xa714('0x23')](removeEntity(_0x30fd5e,null))[_0xa714('0x42')](handleError(_0x30fd5e,null));};exports['getFields']=function(_0x520159,_0x2c982a,_0x4645a3){var _0x5e4ab3={};var _0x570fb5={};var _0x21e7e3;var _0x50a1f3;return db[_0xa714('0x2a')]['findOne']({'where':{'id':_0x520159[_0xa714('0x44')]['id']}})[_0xa714('0x23')](handleEntityNotFound(_0x2c982a,null))[_0xa714('0x23')](function(_0x3b7f6f){if(_0x3b7f6f){_0x21e7e3=_0x3b7f6f;_0x570fb5[_0xa714('0x33')]=_[_0xa714('0x30')](db['SalesforceField'][_0xa714('0x2b')]);_0x570fb5['query']=_[_0xa714('0x30')](_0x520159['query']);_0x570fb5[_0xa714('0x31')]=_[_0xa714('0x32')](_0x570fb5['model'],_0x570fb5[_0xa714('0x2f')]);_0x5e4ab3[_0xa714('0x35')]=_[_0xa714('0x32')](_0x570fb5[_0xa714('0x33')],qs['fields'](_0x520159[_0xa714('0x2f')]['fields']));_0x5e4ab3[_0xa714('0x35')]=_0x5e4ab3[_0xa714('0x35')]['length']?_0x5e4ab3[_0xa714('0x35')]:_0x570fb5['model'];_0x5e4ab3[_0xa714('0x48')]=qs[_0xa714('0x38')](_0x520159['query'][_0xa714('0x38')]);_0x5e4ab3['where']=qs[_0xa714('0x31')](_['pick'](_0x520159[_0xa714('0x2f')],_0x570fb5[_0xa714('0x31')]));if(_0x520159[_0xa714('0x2f')][_0xa714('0x3a')]){_0x5e4ab3[_0xa714('0x3b')]=_[_0xa714('0x3c')](_0x5e4ab3[_0xa714('0x3b')],{'$or':_['map'](_0x5e4ab3[_0xa714('0x35')],function(_0x3fa1e0){var _0xbfb36={};_0xbfb36[_0x3fa1e0]={'$like':'%'+_0x520159[_0xa714('0x2f')][_0xa714('0x3a')]+'%'};return _0xbfb36;})});}_0x5e4ab3=_[_0xa714('0x3c')]({},_0x5e4ab3,_0x520159[_0xa714('0x3d')]);return _0x21e7e3[_0xa714('0x49')](_0x5e4ab3);}})['then'](function(_0x1e89ae){if(_0x1e89ae){_0x50a1f3=_0x1e89ae[_0xa714('0x36')];if(!_0x520159[_0xa714('0x2f')][_0xa714('0x37')](_0xa714('0x4a'))){_0x5e4ab3[_0xa714('0x19')]=qs[_0xa714('0x19')](_0x520159[_0xa714('0x2f')][_0xa714('0x19')]);_0x5e4ab3['offset']=qs[_0xa714('0x1b')](_0x520159['query'][_0xa714('0x1b')]);}return _0x21e7e3[_0xa714('0x49')](_0x5e4ab3);}})[_0xa714('0x23')](function(_0x497fe6){if(_0x497fe6){return _0x497fe6?{'count':_0x50a1f3,'rows':_0x497fe6}:null;}})[_0xa714('0x23')](respondWithResult(_0x2c982a,null))['catch'](handleError(_0x2c982a,null));};exports[_0xa714('0x4b')]=function(_0x5e5a76,_0x445f99,_0x5a9409){var _0x4aa6b8={};var _0x5d598d={};var _0x4c62c0;var _0x1e381f;return db[_0xa714('0x2a')]['findOne']({'where':{'id':_0x5e5a76[_0xa714('0x44')]['id']}})['then'](handleEntityNotFound(_0x445f99,null))[_0xa714('0x23')](function(_0x398609){if(_0x398609){_0x4c62c0=_0x398609;_0x5d598d['model']=_[_0xa714('0x30')](db['SalesforceField'][_0xa714('0x2b')]);_0x5d598d[_0xa714('0x2f')]=_['keys'](_0x5e5a76[_0xa714('0x2f')]);_0x5d598d[_0xa714('0x31')]=_['intersection'](_0x5d598d['model'],_0x5d598d['query']);_0x4aa6b8[_0xa714('0x35')]=_['intersection'](_0x5d598d[_0xa714('0x33')],qs[_0xa714('0x34')](_0x5e5a76[_0xa714('0x2f')]['fields']));_0x4aa6b8[_0xa714('0x35')]=_0x4aa6b8[_0xa714('0x35')][_0xa714('0x36')]?_0x4aa6b8[_0xa714('0x35')]:_0x5d598d[_0xa714('0x33')];_0x4aa6b8['order']=qs[_0xa714('0x38')](_0x5e5a76['query'][_0xa714('0x38')]);_0x4aa6b8[_0xa714('0x3b')]=qs[_0xa714('0x31')](_[_0xa714('0x39')](_0x5e5a76[_0xa714('0x2f')],_0x5d598d[_0xa714('0x31')]));if(_0x5e5a76['query'][_0xa714('0x3a')]){_0x4aa6b8[_0xa714('0x3b')]=_[_0xa714('0x3c')](_0x4aa6b8[_0xa714('0x3b')],{'$or':_['map'](_0x4aa6b8['attributes'],function(_0x16b561){var _0x22add6={};_0x22add6[_0x16b561]={'$like':'%'+_0x5e5a76[_0xa714('0x2f')][_0xa714('0x3a')]+'%'};return _0x22add6;})});}_0x4aa6b8=_[_0xa714('0x3c')]({},_0x4aa6b8,_0x5e5a76['options']);return _0x4c62c0[_0xa714('0x4b')](_0x4aa6b8);}})[_0xa714('0x23')](function(_0xc6d5f2){if(_0xc6d5f2){_0x1e381f=_0xc6d5f2[_0xa714('0x36')];if(!_0x5e5a76[_0xa714('0x2f')][_0xa714('0x37')](_0xa714('0x4a'))){_0x4aa6b8[_0xa714('0x19')]=qs[_0xa714('0x19')](_0x5e5a76[_0xa714('0x2f')][_0xa714('0x19')]);_0x4aa6b8['offset']=qs[_0xa714('0x1b')](_0x5e5a76[_0xa714('0x2f')][_0xa714('0x1b')]);}return _0x4c62c0[_0xa714('0x4b')](_0x4aa6b8);}})[_0xa714('0x23')](function(_0x58b475){if(_0x58b475){return _0x58b475?{'count':_0x1e381f,'rows':_0x58b475}:null;}})[_0xa714('0x23')](respondWithResult(_0x445f99,null))['catch'](handleError(_0x445f99,null));};exports[_0xa714('0x4c')]=function(_0x2dec11,_0x4b84d7,_0x3501d3){var _0x28f078={};var _0x591c86={};var _0x6c748f;var _0x582240;return db['SalesforceConfiguration'][_0xa714('0x4d')]({'where':{'id':_0x2dec11[_0xa714('0x44')]['id']}})[_0xa714('0x23')](handleEntityNotFound(_0x4b84d7,null))['then'](function(_0x4ba985){if(_0x4ba985){_0x6c748f=_0x4ba985;_0x591c86[_0xa714('0x33')]=_['keys'](db['SalesforceField']['rawAttributes']);_0x591c86[_0xa714('0x2f')]=_[_0xa714('0x30')](_0x2dec11[_0xa714('0x2f')]);_0x591c86[_0xa714('0x31')]=_[_0xa714('0x32')](_0x591c86[_0xa714('0x33')],_0x591c86[_0xa714('0x2f')]);_0x28f078['attributes']=_[_0xa714('0x32')](_0x591c86[_0xa714('0x33')],qs[_0xa714('0x34')](_0x2dec11[_0xa714('0x2f')]['fields']));_0x28f078[_0xa714('0x35')]=_0x28f078[_0xa714('0x35')][_0xa714('0x36')]?_0x28f078[_0xa714('0x35')]:_0x591c86[_0xa714('0x33')];_0x28f078[_0xa714('0x48')]=qs[_0xa714('0x38')](_0x2dec11[_0xa714('0x2f')][_0xa714('0x38')]);_0x28f078['where']=qs[_0xa714('0x31')](_[_0xa714('0x39')](_0x2dec11[_0xa714('0x2f')],_0x591c86['filters']));if(_0x2dec11[_0xa714('0x2f')][_0xa714('0x3a')]){_0x28f078[_0xa714('0x3b')]=_['merge'](_0x28f078['where'],{'$or':_[_0xa714('0x29')](_0x28f078[_0xa714('0x35')],function(_0x15afcb){var _0x426627={};_0x426627[_0x15afcb]={'$like':'%'+_0x2dec11[_0xa714('0x2f')][_0xa714('0x3a')]+'%'};return _0x426627;})});}_0x28f078=_['merge']({},_0x28f078,_0x2dec11[_0xa714('0x3d')]);return _0x6c748f[_0xa714('0x4c')](_0x28f078);}})[_0xa714('0x23')](function(_0x320ecb){if(_0x320ecb){_0x582240=_0x320ecb['length'];if(!_0x2dec11[_0xa714('0x2f')]['hasOwnProperty'](_0xa714('0x4a'))){_0x28f078[_0xa714('0x19')]=qs[_0xa714('0x19')](_0x2dec11['query'][_0xa714('0x19')]);_0x28f078[_0xa714('0x1b')]=qs['offset'](_0x2dec11[_0xa714('0x2f')][_0xa714('0x1b')]);}return _0x6c748f[_0xa714('0x4c')](_0x28f078);}})[_0xa714('0x23')](function(_0x2301e9){if(_0x2301e9){return _0x2301e9?{'count':_0x582240,'rows':_0x2301e9}:null;}})[_0xa714('0x23')](respondWithResult(_0x4b84d7,null))[_0xa714('0x42')](handleError(_0x4b84d7,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 1aae7c6..f3de83f 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 _0x8b62=['SalesforceConfiguration','lodash','util','../../config/logger','api','request-promise','path','rimraf'];(function(_0x31eb67,_0x9bc8c0){var _0x2a8cb8=function(_0xac1c5d){while(--_0xac1c5d){_0x31eb67['push'](_0x31eb67['shift']());}};_0x2a8cb8(++_0x9bc8c0);}(_0x8b62,0x1d1));var _0x28b6=function(_0x280ae7,_0x456fb1){_0x280ae7=_0x280ae7-0x0;var _0x418b9e=_0x8b62[_0x280ae7];return _0x418b9e;};'use strict';var _=require(_0x28b6('0x0'));var util=require(_0x28b6('0x1'));var logger=require(_0x28b6('0x2'))(_0x28b6('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x28b6('0x4'));var fs=require('fs');var path=require(_0x28b6('0x5'));var rimraf=require(_0x28b6('0x6'));var config=require('../../config/environment');var attributes=require('./intSalesforceConfiguration.attributes');module['exports']=function(_0x5c8e81,_0x1bca32){return _0x5c8e81['define'](_0x28b6('0x7'),attributes,{'tableName':'int_salesforce_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xffea=['./intSalesforceConfiguration.attributes','exports','define','SalesforceConfiguration','int_salesforce_configurations','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment'];(function(_0x1d80be,_0x3a60ff){var _0xf9a4f3=function(_0x5b8a08){while(--_0x5b8a08){_0x1d80be['push'](_0x1d80be['shift']());}};_0xf9a4f3(++_0x3a60ff);}(_0xffea,0x1e6));var _0xaffe=function(_0x7a2621,_0x23ae6b){_0x7a2621=_0x7a2621-0x0;var _0xdaced1=_0xffea[_0x7a2621];return _0xdaced1;};'use strict';var _=require(_0xaffe('0x0'));var util=require(_0xaffe('0x1'));var logger=require(_0xaffe('0x2'))(_0xaffe('0x3'));var moment=require('moment');var BPromise=require(_0xaffe('0x4'));var rp=require(_0xaffe('0x5'));var fs=require('fs');var path=require(_0xaffe('0x6'));var rimraf=require('rimraf');var config=require(_0xaffe('0x7'));var attributes=require(_0xaffe('0x8'));module[_0xaffe('0x9')]=function(_0x3c3ebe,_0x325881){return _0x3c3ebe[_0xaffe('0xa')](_0xaffe('0xb'),attributes,{'tableName':_0xaffe('0xc'),'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 e0e6e57..f73b9e3 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 _0xdfe0=['../../config/environment','jayson/promise','client','http','request','info','SalesforceConfiguration,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x1e10ac,_0x407d6b){var _0x26c953=function(_0x48f5c3){while(--_0x48f5c3){_0x1e10ac['push'](_0x1e10ac['shift']());}};_0x26c953(++_0x407d6b);}(_0xdfe0,0xcb));var _0x0dfe=function(_0x3a0124,_0x5be611){_0x3a0124=_0x3a0124-0x0;var _0x33aec3=_0xdfe0[_0x3a0124];return _0x33aec3;};'use strict';var _=require(_0x0dfe('0x0'));var util=require(_0x0dfe('0x1'));var moment=require('moment');var BPromise=require(_0x0dfe('0x2'));var rs=require(_0x0dfe('0x3'));var fs=require('fs');var Redis=require(_0x0dfe('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0dfe('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x0dfe('0x6'));var jayson=require(_0x0dfe('0x7'));var client=jayson[_0x0dfe('0x8')][_0x0dfe('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x38f476,_0x50fa6e,_0xc2d252){return new BPromise(function(_0x57d049,_0x222955){return client[_0x0dfe('0xa')](_0x38f476,_0xc2d252)['then'](function(_0x4feeb6){logger[_0x0dfe('0xb')](_0x0dfe('0xc'),_0x50fa6e,'request\x20sent');logger['debug']('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x50fa6e,'request\x20sent',JSON[_0x0dfe('0xd')](_0x4feeb6));if(_0x4feeb6['error']){if(_0x4feeb6[_0x0dfe('0xe')][_0x0dfe('0xf')]===0x1f4){logger[_0x0dfe('0xe')](_0x0dfe('0xc'),_0x50fa6e,_0x4feeb6[_0x0dfe('0xe')][_0x0dfe('0x10')]);return _0x222955(_0x4feeb6[_0x0dfe('0xe')][_0x0dfe('0x10')]);}logger[_0x0dfe('0xe')](_0x0dfe('0xc'),_0x50fa6e,_0x4feeb6[_0x0dfe('0xe')]['message']);return _0x57d049(_0x4feeb6[_0x0dfe('0xe')]['message']);}else{logger[_0x0dfe('0xb')](_0x0dfe('0xc'),_0x50fa6e,'request\x20sent');_0x57d049(_0x4feeb6[_0x0dfe('0x11')][_0x0dfe('0x10')]);}})[_0x0dfe('0x12')](function(_0x430c2f){logger[_0x0dfe('0xe')]('SalesforceConfiguration,\x20%s,\x20%s',_0x50fa6e,_0x430c2f);_0x222955(_0x430c2f);});});} \ No newline at end of file +var _0x0381=['SalesforceConfiguration,\x20%s,\x20%s','message','info','catch','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0381,0x100));var _0x1038=function(_0x246e23,_0x866eb4){_0x246e23=_0x246e23-0x0;var _0xf062b4=_0x0381[_0x246e23];return _0xf062b4;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1038('0x0'));var BPromise=require(_0x1038('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1038('0x2'));var db=require(_0x1038('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x1038('0x4'))(_0x1038('0x5'));var config=require(_0x1038('0x6'));var jayson=require(_0x1038('0x7'));var client=jayson[_0x1038('0x8')][_0x1038('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xd732ea,_0x54bc72,_0x98b0fc){return new BPromise(function(_0x3283d0,_0x597a76){return client['request'](_0xd732ea,_0x98b0fc)[_0x1038('0xa')](function(_0x43b9e8){logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0x54bc72,_0x1038('0xb'));logger[_0x1038('0xc')](_0x1038('0xd'),_0x54bc72,_0x1038('0xb'),JSON[_0x1038('0xe')](_0x43b9e8));if(_0x43b9e8[_0x1038('0xf')]){if(_0x43b9e8[_0x1038('0xf')][_0x1038('0x10')]===0x1f4){logger['error'](_0x1038('0x11'),_0x54bc72,_0x43b9e8['error'][_0x1038('0x12')]);return _0x597a76(_0x43b9e8[_0x1038('0xf')]['message']);}logger[_0x1038('0xf')](_0x1038('0x11'),_0x54bc72,_0x43b9e8[_0x1038('0xf')][_0x1038('0x12')]);return _0x3283d0(_0x43b9e8['error'][_0x1038('0x12')]);}else{logger[_0x1038('0x13')]('SalesforceConfiguration,\x20%s,\x20%s',_0x54bc72,_0x1038('0xb'));_0x3283d0(_0x43b9e8['result'][_0x1038('0x12')]);}})[_0x1038('0x14')](function(_0xd841b9){logger['error'](_0x1038('0x11'),_0x54bc72,_0xd841b9);_0x597a76(_0xd841b9);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index d5f3684..34832c2 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 _0x59de=['exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy'];(function(_0x3049a0,_0x4eb982){var _0x1bcefb=function(_0x5a2be4){while(--_0x5a2be4){_0x3049a0['push'](_0x3049a0['shift']());}};_0x1bcefb(++_0x4eb982);}(_0x59de,0xa9));var _0xe59d=function(_0x151002,_0x1c9af6){_0x151002=_0x151002-0x0;var _0x1a7a58=_0x59de[_0x151002];return _0x1a7a58;};'use strict';var multer=require(_0xe59d('0x0'));var util=require(_0xe59d('0x1'));var path=require(_0xe59d('0x2'));var timeout=require(_0xe59d('0x3'));var express=require('express');var router=express[_0xe59d('0x4')]();var fs_extra=require(_0xe59d('0x5'));var auth=require(_0xe59d('0x6'));var interaction=require(_0xe59d('0x7'));var config=require(_0xe59d('0x8'));var controller=require('./intSalesforceField.controller');router[_0xe59d('0x9')]('/',auth['isAuthenticated'](),controller[_0xe59d('0xa')]);router[_0xe59d('0x9')](_0xe59d('0xb'),auth[_0xe59d('0xc')](),controller[_0xe59d('0xd')]);router[_0xe59d('0xe')]('/',auth['isAuthenticated'](),controller[_0xe59d('0xf')]);router[_0xe59d('0x10')](_0xe59d('0xb'),auth[_0xe59d('0xc')](),controller[_0xe59d('0x11')]);router[_0xe59d('0x12')]('/:id',auth[_0xe59d('0xc')](),controller[_0xe59d('0x13')]);module[_0xe59d('0x14')]=router; \ No newline at end of file +var _0xa740=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intSalesforceField.controller','get','/:id','isAuthenticated','post','create','delete','destroy','exports','multer'];(function(_0x158a2a,_0x5e9252){var _0x57b463=function(_0x1f5ea6){while(--_0x1f5ea6){_0x158a2a['push'](_0x158a2a['shift']());}};_0x57b463(++_0x5e9252);}(_0xa740,0x167));var _0x0a74=function(_0x19fff4,_0x5bbd5a){_0x19fff4=_0x19fff4-0x0;var _0x5c83d3=_0xa740[_0x19fff4];return _0x5c83d3;};'use strict';var multer=require(_0x0a74('0x0'));var util=require(_0x0a74('0x1'));var path=require(_0x0a74('0x2'));var timeout=require(_0x0a74('0x3'));var express=require(_0x0a74('0x4'));var router=express[_0x0a74('0x5')]();var fs_extra=require(_0x0a74('0x6'));var auth=require(_0x0a74('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x0a74('0x8'));var controller=require(_0x0a74('0x9'));router[_0x0a74('0xa')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x0a74('0xb'),auth[_0x0a74('0xc')](),controller['show']);router[_0x0a74('0xd')]('/',auth[_0x0a74('0xc')](),controller[_0x0a74('0xe')]);router['put'](_0x0a74('0xb'),auth[_0x0a74('0xc')](),controller['update']);router[_0x0a74('0xf')](_0x0a74('0xb'),auth[_0x0a74('0xc')](),controller[_0x0a74('0x10')]);module[_0x0a74('0x11')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 9d7e92d..cec1472 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 _0xaa1a=['customVariable','keyValue','picklist','string','STRING','sequelize','exports','ENUM','variable'];(function(_0x3bd70b,_0x2c116c){var _0x326b67=function(_0x17e143){while(--_0x17e143){_0x3bd70b['push'](_0x3bd70b['shift']());}};_0x326b67(++_0x2c116c);}(_0xaa1a,0xe6));var _0xaaa1=function(_0x2842b4,_0x2b1b7b){_0x2842b4=_0x2842b4-0x0;var _0x2b9521=_0xaa1a[_0x2842b4];return _0x2b9521;};'use strict';var Sequelize=require(_0xaaa1('0x0'));module[_0xaaa1('0x1')]={'type':{'type':Sequelize[_0xaaa1('0x2')]('string',_0xaaa1('0x3'),_0xaaa1('0x4'),_0xaaa1('0x5'),_0xaaa1('0x6')),'defaultValue':_0xaaa1('0x7')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xaaa1('0x2')](_0xaaa1('0x7'),_0xaaa1('0x3'),_0xaaa1('0x4'))},'keyContent':{'type':Sequelize[_0xaaa1('0x8')]},'idField':{'type':Sequelize[_0xaaa1('0x8')]},'variableName':{'type':Sequelize[_0xaaa1('0x8')]}}; \ No newline at end of file +var _0xd607=['exports','ENUM','string','variable','customVariable','picklist','STRING','sequelize'];(function(_0x18067c,_0x597b1c){var _0x10d78e=function(_0x29acf9){while(--_0x29acf9){_0x18067c['push'](_0x18067c['shift']());}};_0x10d78e(++_0x597b1c);}(_0xd607,0x1e7));var _0x7d60=function(_0x39e375,_0x49649f){_0x39e375=_0x39e375-0x0;var _0x304c28=_0xd607[_0x39e375];return _0x304c28;};'use strict';var Sequelize=require(_0x7d60('0x0'));module[_0x7d60('0x1')]={'type':{'type':Sequelize[_0x7d60('0x2')](_0x7d60('0x3'),_0x7d60('0x4'),_0x7d60('0x5'),'keyValue',_0x7d60('0x6')),'defaultValue':_0x7d60('0x3')},'content':{'type':Sequelize[_0x7d60('0x7')]},'key':{'type':Sequelize[_0x7d60('0x7')]},'keyType':{'type':Sequelize[_0x7d60('0x2')](_0x7d60('0x3'),_0x7d60('0x4'),_0x7d60('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x7d60('0x7')]},'variableName':{'type':Sequelize[_0x7d60('0x7')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 0e167c4..825b7a9 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 _0xa8be=['hasOwnProperty','sort','filters','pick','filter','where','VIRTUAL','include','findAll','params','includeAll','merge','options','find','create','body','catch','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','reject','then','destroy','end','stack','name','send','index','map','SalesforceField','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length'];(function(_0x2e5540,_0x1fa16b){var _0x54fc5a=function(_0x3b3275){while(--_0x3b3275){_0x2e5540['push'](_0x2e5540['shift']());}};_0x54fc5a(++_0x1fa16b);}(_0xa8be,0x16a));var _0xea8b=function(_0x2c7d5b,_0x18b598){_0x2c7d5b=_0x2c7d5b-0x0;var _0x24227d=_0xa8be[_0x2c7d5b];return _0x24227d;};'use strict';var emlformat=require(_0xea8b('0x0'));var rimraf=require(_0xea8b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xea8b('0x2'));var rp=require(_0xea8b('0x3'));var moment=require(_0xea8b('0x4'));var BPromise=require(_0xea8b('0x5'));var Mustache=require('mustache');var util=require(_0xea8b('0x6'));var path=require(_0xea8b('0x7'));var sox=require(_0xea8b('0x8'));var csv=require(_0xea8b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xea8b('0xa'));var crypto=require(_0xea8b('0xb'));var jsforce=require(_0xea8b('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xea8b('0xd'));var Papa=require(_0xea8b('0xe'));var Redis=require('ioredis');var authService=require(_0xea8b('0xf'));var qs=require(_0xea8b('0x10'));var as=require(_0xea8b('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xea8b('0x12'))('api');var utils=require(_0xea8b('0x13'));var config=require(_0xea8b('0x14'));var licenseUtil=require(_0xea8b('0x15'));var db=require(_0xea8b('0x16'))['db'];function respondWithStatusCode(_0x9e4f6,_0x6c1f85){_0x6c1f85=_0x6c1f85||0xcc;return function(_0x598e21){if(_0x598e21){return _0x9e4f6[_0xea8b('0x17')](_0x6c1f85);}return _0x9e4f6[_0xea8b('0x18')](_0x6c1f85)['end']();};}function respondWithResult(_0x4ee043,_0x5e9be1){_0x5e9be1=_0x5e9be1||0xc8;return function(_0x2292e1){if(_0x2292e1){return _0x4ee043['status'](_0x5e9be1)[_0xea8b('0x19')](_0x2292e1);}};}function respondWithFilteredResult(_0x10d59f,_0x512264){return function(_0x515aee){if(_0x515aee){var _0x4872dd=typeof _0x512264[_0xea8b('0x1a')]==='undefined'&&typeof _0x512264['limit']===_0xea8b('0x1b');var _0xbe8519=_0x515aee[_0xea8b('0x1c')];var _0x5b2a3c=_0x4872dd?0x0:_0x512264[_0xea8b('0x1a')];var _0x2e12d0=_0x4872dd?_0x515aee[_0xea8b('0x1c')]:_0x512264[_0xea8b('0x1a')]+_0x512264[_0xea8b('0x1d')];var _0x3542b7;if(_0x2e12d0>=_0xbe8519){_0x2e12d0=_0xbe8519;_0x3542b7=0xc8;}else{_0x3542b7=0xce;}_0x10d59f[_0xea8b('0x18')](_0x3542b7);return _0x10d59f[_0xea8b('0x1e')](_0xea8b('0x1f'),_0x5b2a3c+'-'+_0x2e12d0+'/'+_0xbe8519)[_0xea8b('0x19')](_0x515aee);}return null;};}function patchUpdates(_0x57535d){return function(_0x166a78){try{jsonpatch['apply'](_0x166a78,_0x57535d,!![]);}catch(_0x5314c7){return BPromise[_0xea8b('0x20')](_0x5314c7);}return _0x166a78['save']();};}function saveUpdates(_0x36b6ba,_0x39e00f){return function(_0x138522){if(_0x138522){return _0x138522['update'](_0x36b6ba)[_0xea8b('0x21')](function(_0x5c79e1){return _0x5c79e1;});}return null;};}function removeEntity(_0x3426a7,_0x2b3b8c){return function(_0x178fc1){if(_0x178fc1){return _0x178fc1[_0xea8b('0x22')]()[_0xea8b('0x21')](function(){_0x3426a7['status'](0xcc)[_0xea8b('0x23')]();});}};}function handleEntityNotFound(_0x4a7f96,_0x404527){return function(_0x4a2004){if(!_0x4a2004){_0x4a7f96[_0xea8b('0x17')](0x194);}return _0x4a2004;};}function handleError(_0x1ccdd3,_0x35c5a2){_0x35c5a2=_0x35c5a2||0x1f4;return function(_0x3ad13e){logger['error'](_0x3ad13e[_0xea8b('0x24')]);if(_0x3ad13e[_0xea8b('0x25')]){delete _0x3ad13e[_0xea8b('0x25')];}_0x1ccdd3[_0xea8b('0x18')](_0x35c5a2)[_0xea8b('0x26')](_0x3ad13e);};}exports[_0xea8b('0x27')]=function(_0x8faf0e,_0x3bfc05){var _0x52e922={},_0x3a4d21={},_0x5afbc1={'count':0x0,'rows':[]};var _0x44b0bd=_[_0xea8b('0x28')](db[_0xea8b('0x29')][_0xea8b('0x2a')],function(_0x2966a4){return{'name':_0x2966a4['fieldName'],'type':_0x2966a4[_0xea8b('0x2b')][_0xea8b('0x2c')]};});_0x3a4d21[_0xea8b('0x2d')]=_[_0xea8b('0x28')](_0x44b0bd,'name');_0x3a4d21[_0xea8b('0x2e')]=_[_0xea8b('0x2f')](_0x8faf0e[_0xea8b('0x2e')]);_0x3a4d21['filters']=_[_0xea8b('0x30')](_0x3a4d21[_0xea8b('0x2d')],_0x3a4d21['query']);_0x52e922[_0xea8b('0x31')]=_['intersection'](_0x3a4d21[_0xea8b('0x2d')],qs[_0xea8b('0x32')](_0x8faf0e['query']['fields']));_0x52e922[_0xea8b('0x31')]=_0x52e922[_0xea8b('0x31')][_0xea8b('0x33')]?_0x52e922[_0xea8b('0x31')]:_0x3a4d21[_0xea8b('0x2d')];if(!_0x8faf0e[_0xea8b('0x2e')][_0xea8b('0x34')]('nolimit')){_0x52e922[_0xea8b('0x1d')]=qs['limit'](_0x8faf0e['query'][_0xea8b('0x1d')]);_0x52e922[_0xea8b('0x1a')]=qs[_0xea8b('0x1a')](_0x8faf0e[_0xea8b('0x2e')]['offset']);}_0x52e922['order']=qs[_0xea8b('0x35')](_0x8faf0e[_0xea8b('0x2e')]['sort']);_0x52e922['where']=qs[_0xea8b('0x36')](_[_0xea8b('0x37')](_0x8faf0e[_0xea8b('0x2e')],_0x3a4d21['filters']),_0x44b0bd);if(_0x8faf0e[_0xea8b('0x2e')][_0xea8b('0x38')]){_0x52e922[_0xea8b('0x39')]=_['merge'](_0x52e922[_0xea8b('0x39')],{'$or':_['map'](_0x44b0bd,function(_0x234e60){if(_0x234e60[_0xea8b('0x2b')]!==_0xea8b('0x3a')){var _0x217b23={};_0x217b23[_0x234e60[_0xea8b('0x25')]]={'$like':'%'+_0x8faf0e[_0xea8b('0x2e')][_0xea8b('0x38')]+'%'};return _0x217b23;}})});}_0x52e922=_['merge']({},_0x52e922,_0x8faf0e['options']);var _0x14324a={'where':_0x52e922[_0xea8b('0x39')]};return db[_0xea8b('0x29')][_0xea8b('0x1c')](_0x14324a)['then'](function(_0x434a0b){_0x5afbc1[_0xea8b('0x1c')]=_0x434a0b;if(_0x8faf0e[_0xea8b('0x2e')]['includeAll']){_0x52e922[_0xea8b('0x3b')]=[{'all':!![]}];}return db[_0xea8b('0x29')][_0xea8b('0x3c')](_0x52e922);})[_0xea8b('0x21')](function(_0x249e84){_0x5afbc1['rows']=_0x249e84;return _0x5afbc1;})[_0xea8b('0x21')](respondWithFilteredResult(_0x3bfc05,_0x52e922))['catch'](handleError(_0x3bfc05,null));};exports['show']=function(_0x3e8e8a,_0x542082){var _0x5a7afd={'raw':!![],'where':{'id':_0x3e8e8a[_0xea8b('0x3d')]['id']}},_0x31128a={};_0x31128a[_0xea8b('0x2d')]=_[_0xea8b('0x2f')](db[_0xea8b('0x29')]['rawAttributes']);_0x31128a[_0xea8b('0x2e')]=_[_0xea8b('0x2f')](_0x3e8e8a['query']);_0x31128a[_0xea8b('0x36')]=_['intersection'](_0x31128a[_0xea8b('0x2d')],_0x31128a[_0xea8b('0x2e')]);_0x5a7afd[_0xea8b('0x31')]=_['intersection'](_0x31128a[_0xea8b('0x2d')],qs[_0xea8b('0x32')](_0x3e8e8a[_0xea8b('0x2e')]['fields']));_0x5a7afd[_0xea8b('0x31')]=_0x5a7afd[_0xea8b('0x31')][_0xea8b('0x33')]?_0x5a7afd['attributes']:_0x31128a[_0xea8b('0x2d')];if(_0x3e8e8a[_0xea8b('0x2e')][_0xea8b('0x3e')]){_0x5a7afd['include']=[{'all':!![]}];}_0x5a7afd=_[_0xea8b('0x3f')]({},_0x5a7afd,_0x3e8e8a[_0xea8b('0x40')]);return db[_0xea8b('0x29')][_0xea8b('0x41')](_0x5a7afd)[_0xea8b('0x21')](handleEntityNotFound(_0x542082,null))[_0xea8b('0x21')](respondWithResult(_0x542082,null))['catch'](handleError(_0x542082,null));};exports[_0xea8b('0x42')]=function(_0x2b8c4f,_0x234030){return db[_0xea8b('0x29')]['create'](_0x2b8c4f[_0xea8b('0x43')],{})[_0xea8b('0x21')](respondWithResult(_0x234030,0xc9))['catch'](handleError(_0x234030,null));};exports['update']=function(_0x11ad63,_0x21242c){if(_0x11ad63[_0xea8b('0x43')]['id']){delete _0x11ad63[_0xea8b('0x43')]['id'];}return db['SalesforceField']['find']({'where':{'id':_0x11ad63[_0xea8b('0x3d')]['id']}})[_0xea8b('0x21')](handleEntityNotFound(_0x21242c,null))['then'](saveUpdates(_0x11ad63[_0xea8b('0x43')],null))[_0xea8b('0x21')](respondWithResult(_0x21242c,null))['catch'](handleError(_0x21242c,null));};exports['destroy']=function(_0x345566,_0x2d76c0){return db[_0xea8b('0x29')][_0xea8b('0x41')]({'where':{'id':_0x345566['params']['id']}})[_0xea8b('0x21')](handleEntityNotFound(_0x2d76c0,null))['then'](removeEntity(_0x2d76c0,null))[_0xea8b('0x44')](handleError(_0x2d76c0,null));}; \ No newline at end of file +var _0x71ff=['../../mysqldb','sendStatus','status','json','offset','undefined','count','set','apply','reject','then','destroy','end','error','stack','name','send','index','map','fieldName','type','key','query','keys','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','where','pick','filter','merge','VIRTUAL','options','SalesforceField','includeAll','include','rows','show','params','rawAttributes','find','catch','create','body','update','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils'];(function(_0x336082,_0x5c364b){var _0x2ea2eb=function(_0x4c6c53){while(--_0x4c6c53){_0x336082['push'](_0x336082['shift']());}};_0x2ea2eb(++_0x5c364b);}(_0x71ff,0x19c));var _0xf71f=function(_0x25ab75,_0x32b0f6){_0x25ab75=_0x25ab75-0x0;var _0x42873f=_0x71ff[_0x25ab75];return _0x42873f;};'use strict';var emlformat=require(_0xf71f('0x0'));var rimraf=require(_0xf71f('0x1'));var zipdir=require(_0xf71f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf71f('0x3'));var moment=require(_0xf71f('0x4'));var BPromise=require(_0xf71f('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf71f('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf71f('0x7'));var fs=require('fs');var fs_extra=require(_0xf71f('0x8'));var _=require(_0xf71f('0x9'));var squel=require(_0xf71f('0xa'));var crypto=require(_0xf71f('0xb'));var jsforce=require(_0xf71f('0xc'));var deskjs=require(_0xf71f('0xd'));var toCsv=require(_0xf71f('0xe'));var querystring=require('querystring');var Papa=require(_0xf71f('0xf'));var Redis=require(_0xf71f('0x10'));var authService=require(_0xf71f('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf71f('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xf71f('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xf71f('0x14'))['db'];function respondWithStatusCode(_0x30ae0c,_0x5bbb45){_0x5bbb45=_0x5bbb45||0xcc;return function(_0x12faa9){if(_0x12faa9){return _0x30ae0c[_0xf71f('0x15')](_0x5bbb45);}return _0x30ae0c[_0xf71f('0x16')](_0x5bbb45)['end']();};}function respondWithResult(_0x2d88e9,_0x293be4){_0x293be4=_0x293be4||0xc8;return function(_0x255435){if(_0x255435){return _0x2d88e9['status'](_0x293be4)[_0xf71f('0x17')](_0x255435);}};}function respondWithFilteredResult(_0x1d40ad,_0x5a08c3){return function(_0x2ca58e){if(_0x2ca58e){var _0x502ee3=typeof _0x5a08c3[_0xf71f('0x18')]===_0xf71f('0x19')&&typeof _0x5a08c3['limit']===_0xf71f('0x19');var _0x1849b9=_0x2ca58e[_0xf71f('0x1a')];var _0x25acb5=_0x502ee3?0x0:_0x5a08c3[_0xf71f('0x18')];var _0x20ebab=_0x502ee3?_0x2ca58e[_0xf71f('0x1a')]:_0x5a08c3[_0xf71f('0x18')]+_0x5a08c3['limit'];var _0x5ce4aa;if(_0x20ebab>=_0x1849b9){_0x20ebab=_0x1849b9;_0x5ce4aa=0xc8;}else{_0x5ce4aa=0xce;}_0x1d40ad[_0xf71f('0x16')](_0x5ce4aa);return _0x1d40ad[_0xf71f('0x1b')]('Content-Range',_0x25acb5+'-'+_0x20ebab+'/'+_0x1849b9)[_0xf71f('0x17')](_0x2ca58e);}return null;};}function patchUpdates(_0x1cf57f){return function(_0x1fe46a){try{jsonpatch[_0xf71f('0x1c')](_0x1fe46a,_0x1cf57f,!![]);}catch(_0xd1aac){return BPromise[_0xf71f('0x1d')](_0xd1aac);}return _0x1fe46a['save']();};}function saveUpdates(_0x45d1c8,_0x12bb23){return function(_0x255377){if(_0x255377){return _0x255377['update'](_0x45d1c8)[_0xf71f('0x1e')](function(_0x21c9ed){return _0x21c9ed;});}return null;};}function removeEntity(_0x29de56,_0x41016f){return function(_0x390832){if(_0x390832){return _0x390832[_0xf71f('0x1f')]()[_0xf71f('0x1e')](function(){_0x29de56[_0xf71f('0x16')](0xcc)[_0xf71f('0x20')]();});}};}function handleEntityNotFound(_0xe54de4,_0x2a856c){return function(_0xada079){if(!_0xada079){_0xe54de4[_0xf71f('0x15')](0x194);}return _0xada079;};}function handleError(_0x43c6e3,_0x4ee270){_0x4ee270=_0x4ee270||0x1f4;return function(_0x2c51e6){logger[_0xf71f('0x21')](_0x2c51e6[_0xf71f('0x22')]);if(_0x2c51e6[_0xf71f('0x23')]){delete _0x2c51e6[_0xf71f('0x23')];}_0x43c6e3[_0xf71f('0x16')](_0x4ee270)[_0xf71f('0x24')](_0x2c51e6);};}exports[_0xf71f('0x25')]=function(_0x47b32,_0x2f65e0){var _0x45888c={},_0x336ce1={},_0x5b52ce={'count':0x0,'rows':[]};var _0x14a597=_[_0xf71f('0x26')](db['SalesforceField']['rawAttributes'],function(_0x368c8f){return{'name':_0x368c8f[_0xf71f('0x27')],'type':_0x368c8f[_0xf71f('0x28')][_0xf71f('0x29')]};});_0x336ce1['model']=_[_0xf71f('0x26')](_0x14a597,'name');_0x336ce1[_0xf71f('0x2a')]=_[_0xf71f('0x2b')](_0x47b32[_0xf71f('0x2a')]);_0x336ce1[_0xf71f('0x2c')]=_['intersection'](_0x336ce1[_0xf71f('0x2d')],_0x336ce1[_0xf71f('0x2a')]);_0x45888c['attributes']=_[_0xf71f('0x2e')](_0x336ce1[_0xf71f('0x2d')],qs[_0xf71f('0x2f')](_0x47b32[_0xf71f('0x2a')][_0xf71f('0x2f')]));_0x45888c[_0xf71f('0x30')]=_0x45888c[_0xf71f('0x30')][_0xf71f('0x31')]?_0x45888c['attributes']:_0x336ce1['model'];if(!_0x47b32[_0xf71f('0x2a')][_0xf71f('0x32')](_0xf71f('0x33'))){_0x45888c[_0xf71f('0x34')]=qs[_0xf71f('0x34')](_0x47b32[_0xf71f('0x2a')][_0xf71f('0x34')]);_0x45888c['offset']=qs[_0xf71f('0x18')](_0x47b32[_0xf71f('0x2a')]['offset']);}_0x45888c[_0xf71f('0x35')]=qs['sort'](_0x47b32[_0xf71f('0x2a')]['sort']);_0x45888c[_0xf71f('0x36')]=qs[_0xf71f('0x2c')](_[_0xf71f('0x37')](_0x47b32[_0xf71f('0x2a')],_0x336ce1[_0xf71f('0x2c')]),_0x14a597);if(_0x47b32[_0xf71f('0x2a')][_0xf71f('0x38')]){_0x45888c[_0xf71f('0x36')]=_[_0xf71f('0x39')](_0x45888c[_0xf71f('0x36')],{'$or':_[_0xf71f('0x26')](_0x14a597,function(_0x11b977){if(_0x11b977[_0xf71f('0x28')]!==_0xf71f('0x3a')){var _0x483319={};_0x483319[_0x11b977['name']]={'$like':'%'+_0x47b32[_0xf71f('0x2a')][_0xf71f('0x38')]+'%'};return _0x483319;}})});}_0x45888c=_[_0xf71f('0x39')]({},_0x45888c,_0x47b32[_0xf71f('0x3b')]);var _0x470154={'where':_0x45888c[_0xf71f('0x36')]};return db[_0xf71f('0x3c')][_0xf71f('0x1a')](_0x470154)[_0xf71f('0x1e')](function(_0x468f5f){_0x5b52ce[_0xf71f('0x1a')]=_0x468f5f;if(_0x47b32[_0xf71f('0x2a')][_0xf71f('0x3d')]){_0x45888c[_0xf71f('0x3e')]=[{'all':!![]}];}return db[_0xf71f('0x3c')]['findAll'](_0x45888c);})[_0xf71f('0x1e')](function(_0x12ca9b){_0x5b52ce[_0xf71f('0x3f')]=_0x12ca9b;return _0x5b52ce;})['then'](respondWithFilteredResult(_0x2f65e0,_0x45888c))['catch'](handleError(_0x2f65e0,null));};exports[_0xf71f('0x40')]=function(_0x2c9657,_0x214aed){var _0x343ec0={'raw':!![],'where':{'id':_0x2c9657[_0xf71f('0x41')]['id']}},_0x46b6cf={};_0x46b6cf[_0xf71f('0x2d')]=_['keys'](db['SalesforceField'][_0xf71f('0x42')]);_0x46b6cf[_0xf71f('0x2a')]=_['keys'](_0x2c9657['query']);_0x46b6cf[_0xf71f('0x2c')]=_[_0xf71f('0x2e')](_0x46b6cf[_0xf71f('0x2d')],_0x46b6cf[_0xf71f('0x2a')]);_0x343ec0[_0xf71f('0x30')]=_['intersection'](_0x46b6cf[_0xf71f('0x2d')],qs[_0xf71f('0x2f')](_0x2c9657[_0xf71f('0x2a')][_0xf71f('0x2f')]));_0x343ec0[_0xf71f('0x30')]=_0x343ec0['attributes'][_0xf71f('0x31')]?_0x343ec0[_0xf71f('0x30')]:_0x46b6cf['model'];if(_0x2c9657[_0xf71f('0x2a')][_0xf71f('0x3d')]){_0x343ec0[_0xf71f('0x3e')]=[{'all':!![]}];}_0x343ec0=_['merge']({},_0x343ec0,_0x2c9657[_0xf71f('0x3b')]);return db[_0xf71f('0x3c')][_0xf71f('0x43')](_0x343ec0)[_0xf71f('0x1e')](handleEntityNotFound(_0x214aed,null))['then'](respondWithResult(_0x214aed,null))[_0xf71f('0x44')](handleError(_0x214aed,null));};exports['create']=function(_0x343dc0,_0x3d59f5){return db['SalesforceField'][_0xf71f('0x45')](_0x343dc0[_0xf71f('0x46')],{})[_0xf71f('0x1e')](respondWithResult(_0x3d59f5,0xc9))[_0xf71f('0x44')](handleError(_0x3d59f5,null));};exports[_0xf71f('0x47')]=function(_0x597cc4,_0x442696){if(_0x597cc4[_0xf71f('0x46')]['id']){delete _0x597cc4[_0xf71f('0x46')]['id'];}return db[_0xf71f('0x3c')][_0xf71f('0x43')]({'where':{'id':_0x597cc4['params']['id']}})['then'](handleEntityNotFound(_0x442696,null))[_0xf71f('0x1e')](saveUpdates(_0x597cc4[_0xf71f('0x46')],null))[_0xf71f('0x1e')](respondWithResult(_0x442696,null))[_0xf71f('0x44')](handleError(_0x442696,null));};exports[_0xf71f('0x1f')]=function(_0x44782d,_0xd8d77c){return db[_0xf71f('0x3c')][_0xf71f('0x43')]({'where':{'id':_0x44782d['params']['id']}})[_0xf71f('0x1e')](handleEntityNotFound(_0xd8d77c,null))[_0xf71f('0x1e')](removeEntity(_0xd8d77c,null))[_0xf71f('0x44')](handleError(_0xd8d77c,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 9b752a7..84fdf88 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 _0x9f95=['../../config/environment','./intSalesforceField.attributes','SalesforceField','int_salesforce_fields','idField','lodash','util','../../config/logger','bluebird','request-promise','rimraf'];(function(_0x236d24,_0x29e80a){var _0x1574cf=function(_0x5d1dad){while(--_0x5d1dad){_0x236d24['push'](_0x236d24['shift']());}};_0x1574cf(++_0x29e80a);}(_0x9f95,0x10d));var _0x59f9=function(_0x27ffd5,_0x8eb63f){_0x27ffd5=_0x27ffd5-0x0;var _0x4f07dc=_0x9f95[_0x27ffd5];return _0x4f07dc;};'use strict';var _=require(_0x59f9('0x0'));var util=require(_0x59f9('0x1'));var logger=require(_0x59f9('0x2'))('api');var moment=require('moment');var BPromise=require(_0x59f9('0x3'));var rp=require(_0x59f9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x59f9('0x5'));var config=require(_0x59f9('0x6'));var attributes=require(_0x59f9('0x7'));module['exports']=function(_0x1fc812,_0x2c68c5){return _0x1fc812['define'](_0x59f9('0x8'),attributes,{'tableName':_0x59f9('0x9'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':[_0x59f9('0xa'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x813a=['int_salesforce_fields','salesforce_unique_index','idField','FieldId','util','../../config/logger','api','request-promise','./intSalesforceField.attributes','exports','define','SalesforceField'];(function(_0x4508ee,_0x418bf8){var _0x1f238a=function(_0x580d4b){while(--_0x580d4b){_0x4508ee['push'](_0x4508ee['shift']());}};_0x1f238a(++_0x418bf8);}(_0x813a,0xc4));var _0xa813=function(_0x3c47f4,_0x11b97a){_0x3c47f4=_0x3c47f4-0x0;var _0x4ce115=_0x813a[_0x3c47f4];return _0x4ce115;};'use strict';var _=require('lodash');var util=require(_0xa813('0x0'));var logger=require(_0xa813('0x1'))(_0xa813('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa813('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa813('0x4'));module[_0xa813('0x5')]=function(_0x459732,_0x462ce2){return _0x459732[_0xa813('0x6')](_0xa813('0x7'),attributes,{'tableName':_0xa813('0x8'),'paranoid':![],'indexes':[{'name':_0xa813('0x9'),'fields':[_0xa813('0xa'),_0xa813('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 f71cd4e..b70370d 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 _0xb44f=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x571720,_0x344cea){var _0x55b384=function(_0x417491){while(--_0x417491){_0x571720['push'](_0x571720['shift']());}};_0x55b384(++_0x344cea);}(_0xb44f,0x1df));var _0xfb44=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xb44f[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0xfb44('0x0'));var util=require(_0xfb44('0x1'));var moment=require(_0xfb44('0x2'));var BPromise=require(_0xfb44('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfb44('0x4'));var db=require(_0xfb44('0x5'))['db'];var utils=require(_0xfb44('0x6'));var logger=require(_0xfb44('0x7'))(_0xfb44('0x8'));var config=require(_0xfb44('0x9'));var jayson=require(_0xfb44('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x580c6b,_0x3d565a,_0x1f127c){return new BPromise(function(_0x4b5bce,_0x4d63b7){return client[_0xfb44('0xb')](_0x580c6b,_0x1f127c)[_0xfb44('0xc')](function(_0x5982ce){logger[_0xfb44('0xd')](_0xfb44('0xe'),_0x3d565a,_0xfb44('0xf'));logger[_0xfb44('0x10')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x3d565a,'request\x20sent',JSON[_0xfb44('0x11')](_0x5982ce));if(_0x5982ce[_0xfb44('0x12')]){if(_0x5982ce[_0xfb44('0x12')][_0xfb44('0x13')]===0x1f4){logger[_0xfb44('0x12')]('SalesforceField,\x20%s,\x20%s',_0x3d565a,_0x5982ce['error'][_0xfb44('0x14')]);return _0x4d63b7(_0x5982ce[_0xfb44('0x12')][_0xfb44('0x14')]);}logger[_0xfb44('0x12')](_0xfb44('0xe'),_0x3d565a,_0x5982ce[_0xfb44('0x12')][_0xfb44('0x14')]);return _0x4b5bce(_0x5982ce[_0xfb44('0x12')][_0xfb44('0x14')]);}else{logger[_0xfb44('0xd')](_0xfb44('0xe'),_0x3d565a,'request\x20sent');_0x4b5bce(_0x5982ce[_0xfb44('0x15')]['message']);}})[_0xfb44('0x16')](function(_0x3cdf67){logger[_0xfb44('0x12')](_0xfb44('0xe'),_0x3d565a,_0x3cdf67);_0x4d63b7(_0x3cdf67);});});} \ No newline at end of file +var _0x04c7=['debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','SalesforceField,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','then','info','request\x20sent'];(function(_0x316373,_0x4e3893){var _0x3643a2=function(_0x2c4568){while(--_0x2c4568){_0x316373['push'](_0x316373['shift']());}};_0x3643a2(++_0x4e3893);}(_0x04c7,0x16e));var _0x704c=function(_0x48e921,_0x20cf98){_0x48e921=_0x48e921-0x0;var _0x4986fe=_0x04c7[_0x48e921];return _0x4986fe;};'use strict';var _=require('lodash');var util=require(_0x704c('0x0'));var moment=require(_0x704c('0x1'));var BPromise=require('bluebird');var rs=require(_0x704c('0x2'));var fs=require('fs');var Redis=require(_0x704c('0x3'));var db=require(_0x704c('0x4'))['db'];var utils=require(_0x704c('0x5'));var logger=require(_0x704c('0x6'))('rpc');var config=require(_0x704c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x704c('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1024bc,_0x47e227,_0x129868){return new BPromise(function(_0x3961a1,_0x16a6ed){return client['request'](_0x1024bc,_0x129868)[_0x704c('0x9')](function(_0x4bffdb){logger[_0x704c('0xa')]('SalesforceField,\x20%s,\x20%s',_0x47e227,_0x704c('0xb'));logger[_0x704c('0xc')](_0x704c('0xd'),_0x47e227,_0x704c('0xb'),JSON[_0x704c('0xe')](_0x4bffdb));if(_0x4bffdb['error']){if(_0x4bffdb[_0x704c('0xf')][_0x704c('0x10')]===0x1f4){logger['error'](_0x704c('0x11'),_0x47e227,_0x4bffdb['error']['message']);return _0x16a6ed(_0x4bffdb['error'][_0x704c('0x12')]);}logger['error'](_0x704c('0x11'),_0x47e227,_0x4bffdb[_0x704c('0xf')][_0x704c('0x12')]);return _0x3961a1(_0x4bffdb['error']['message']);}else{logger[_0x704c('0xa')](_0x704c('0x11'),_0x47e227,'request\x20sent');_0x3961a1(_0x4bffdb[_0x704c('0x13')][_0x704c('0x12')]);}})[_0x704c('0x14')](function(_0x2b2729){logger['error'](_0x704c('0x11'),_0x47e227,_0x2b2729);_0x16a6ed(_0x2b2729);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 4ff75c2..98d51c2 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 _0x3b1b=['express','Router','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','update','delete','destroy','util','path','connect-timeout'];(function(_0x23567f,_0x5d0b04){var _0x1c6fd1=function(_0x404caf){while(--_0x404caf){_0x23567f['push'](_0x23567f['shift']());}};_0x1c6fd1(++_0x5d0b04);}(_0x3b1b,0x75));var _0xb3b1=function(_0x4ca85f,_0x2fbeac){_0x4ca85f=_0x4ca85f-0x0;var _0x5f24db=_0x3b1b[_0x4ca85f];return _0x5f24db;};'use strict';var multer=require('multer');var util=require(_0xb3b1('0x0'));var path=require(_0xb3b1('0x1'));var timeout=require(_0xb3b1('0x2'));var express=require(_0xb3b1('0x3'));var router=express[_0xb3b1('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb3b1('0x5'));var controller=require('./intServicenowAccount.controller');router[_0xb3b1('0x6')]('/',auth[_0xb3b1('0x7')](),controller[_0xb3b1('0x8')]);router[_0xb3b1('0x6')](_0xb3b1('0x9'),auth[_0xb3b1('0x7')](),controller[_0xb3b1('0xa')]);router[_0xb3b1('0x6')](_0xb3b1('0xb'),auth['isAuthenticated'](),controller[_0xb3b1('0xc')]);router['get'](_0xb3b1('0xd'),auth[_0xb3b1('0x7')](),controller[_0xb3b1('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb3b1('0xf')]);router[_0xb3b1('0x10')](_0xb3b1('0xb'),auth['isAuthenticated'](),controller['addConfiguration']);router['put']('/:id',auth[_0xb3b1('0x7')](),controller[_0xb3b1('0x11')]);router[_0xb3b1('0x12')](_0xb3b1('0x9'),auth[_0xb3b1('0x7')](),controller[_0xb3b1('0x13')]);module['exports']=router; \ No newline at end of file +var _0x7e8e=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id','show','get','/:id/configurations','getConfigurations','/:id/fields','getFields','create','addConfiguration','put','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x30dee9,_0x2e1041){var _0x40d2c6=function(_0x323dcb){while(--_0x323dcb){_0x30dee9['push'](_0x30dee9['shift']());}};_0x40d2c6(++_0x2e1041);}(_0x7e8e,0x91));var _0xe7e8=function(_0x3aaf0a,_0x450970){_0x3aaf0a=_0x3aaf0a-0x0;var _0x33e6bc=_0x7e8e[_0x3aaf0a];return _0x33e6bc;};'use strict';var multer=require(_0xe7e8('0x0'));var util=require(_0xe7e8('0x1'));var path=require(_0xe7e8('0x2'));var timeout=require(_0xe7e8('0x3'));var express=require(_0xe7e8('0x4'));var router=express[_0xe7e8('0x5')]();var fs_extra=require(_0xe7e8('0x6'));var auth=require(_0xe7e8('0x7'));var interaction=require(_0xe7e8('0x8'));var config=require(_0xe7e8('0x9'));var controller=require('./intServicenowAccount.controller');router['get']('/',auth[_0xe7e8('0xa')](),controller[_0xe7e8('0xb')]);router['get'](_0xe7e8('0xc'),auth[_0xe7e8('0xa')](),controller[_0xe7e8('0xd')]);router[_0xe7e8('0xe')](_0xe7e8('0xf'),auth[_0xe7e8('0xa')](),controller[_0xe7e8('0x10')]);router[_0xe7e8('0xe')](_0xe7e8('0x11'),auth['isAuthenticated'](),controller[_0xe7e8('0x12')]);router['post']('/',auth[_0xe7e8('0xa')](),controller[_0xe7e8('0x13')]);router['post'](_0xe7e8('0xf'),auth['isAuthenticated'](),controller[_0xe7e8('0x14')]);router[_0xe7e8('0x15')](_0xe7e8('0xc'),auth[_0xe7e8('0xa')](),controller['update']);router[_0xe7e8('0x16')](_0xe7e8('0xc'),auth['isAuthenticated'](),controller[_0xe7e8('0x17')]);module[_0xe7e8('0x18')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index c76cf6e..d515dfc 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 _0x4568=['exports','STRING','remoteUri'];(function(_0x5f1617,_0x46277b){var _0x3af5da=function(_0x15b934){while(--_0x15b934){_0x5f1617['push'](_0x5f1617['shift']());}};_0x3af5da(++_0x46277b);}(_0x4568,0x126));var _0x8456=function(_0x2261ce,_0x9ed8b6){_0x2261ce=_0x2261ce-0x0;var _0x524640=_0x4568[_0x2261ce];return _0x524640;};'use strict';var Sequelize=require('sequelize');module[_0x8456('0x0')]={'name':{'type':Sequelize[_0x8456('0x1')]},'description':{'type':Sequelize[_0x8456('0x1')]},'username':{'type':Sequelize[_0x8456('0x1')],'unique':'username'},'password':{'type':Sequelize[_0x8456('0x1')]},'email':{'type':Sequelize[_0x8456('0x1')]},'remoteUri':{'type':Sequelize[_0x8456('0x1')],'unique':_0x8456('0x2')},'serverUrl':{'type':Sequelize[_0x8456('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xeb52=['remoteUri','sequelize','exports','STRING','username'];(function(_0x18d8e4,_0x1b580e){var _0x53c5da=function(_0x58d964){while(--_0x58d964){_0x18d8e4['push'](_0x18d8e4['shift']());}};_0x53c5da(++_0x1b580e);}(_0xeb52,0xce));var _0x2eb5=function(_0x1ab320,_0x1b6b75){_0x1ab320=_0x1ab320-0x0;var _0x3cc3f9=_0xeb52[_0x1ab320];return _0x3cc3f9;};'use strict';var Sequelize=require(_0x2eb5('0x0'));module[_0x2eb5('0x1')]={'name':{'type':Sequelize[_0x2eb5('0x2')]},'description':{'type':Sequelize[_0x2eb5('0x2')]},'username':{'type':Sequelize[_0x2eb5('0x2')],'unique':_0x2eb5('0x3')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x2eb5('0x2')],'unique':_0x2eb5('0x4')},'serverUrl':{'type':Sequelize[_0x2eb5('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 e9ff4bf..fe92b3c 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 _0x3a9a=['set','Content-Range','apply','reject','save','update','then','error','stack','name','index','map','fieldName','type','key','model','filters','intersection','fields','query','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','ServicenowAccount','includeAll','include','findAll','rows','catch','params','keys','rawAttributes','create','body','find','destroy','getConfigurations','findOne','ServicenowConfiguration','nolimit','Subjects','getSubjects','channel','getDescriptions','ServicenowField','Descriptions','getFields','made_sla','hold_reason','knowledge','subcategory','close_code','notify','incident_state','severity','category','parent','watch_list','sys_updated_on','child_incidents','approval_history','number','resolved_by','opened_by','sys_created_on','sys_domain','state','calendar_stc','cmdb_ci','impact','active','work_notes_list','business_service','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','group_list','work_end','reopened_time','caller_id','correlation_display','delivery_task','work_start','assignment_group','business_stc','description','calendar_duration','sys_class_name','follow_up','parent_incident','sys_id','reopened_by','urgency','problem_id','reassignment_count','activity_due','comments','sla_due','approval','comments_and_work_notes','sys_mod_count','reopen_count','escalation','upon_approval','location','username','remoteUri','slice','lastIndexOf','format','%s/api/now/doc/table/schema/','password','result','log','incident\x20table\x20objects','assign','remove','includes','internalType','label','push','all','TCL:\x20_object','forEach','concat','ServiceNow\x20error:\x20','test','statusCode','send','Wrong\x20credentials','True','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','eml-format','zip-dir','mustache','util','path','to-csv','ejs','lodash','squel','desk.js','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','limit','count','offset'];(function(_0x16b00d,_0x530d31){var _0x2fd052=function(_0x2923f0){while(--_0x2923f0){_0x16b00d['push'](_0x16b00d['shift']());}};_0x2fd052(++_0x530d31);}(_0x3a9a,0x1f0));var _0xa3a9=function(_0x1c8c28,_0x3ee093){_0x1c8c28=_0x1c8c28-0x0;var _0x1f59b4=_0x3a9a[_0x1c8c28];return _0x1f59b4;};'use strict';var emlformat=require(_0xa3a9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa3a9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa3a9('0x2'));var util=require(_0xa3a9('0x3'));var path=require(_0xa3a9('0x4'));var sox=require('sox');var csv=require(_0xa3a9('0x5'));var ejs=require(_0xa3a9('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa3a9('0x7'));var squel=require(_0xa3a9('0x8'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa3a9('0x9'));var toCsv=require(_0xa3a9('0x5'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa3a9('0xa'));var authService=require(_0xa3a9('0xb'));var qs=require(_0xa3a9('0xc'));var as=require(_0xa3a9('0xd'));var hardwareService=require(_0xa3a9('0xe'));var logger=require(_0xa3a9('0xf'))(_0xa3a9('0x10'));var utils=require(_0xa3a9('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0xa3a9('0x12'));var db=require(_0xa3a9('0x13'))['db'];var integrations=require(_0xa3a9('0x14'));function respondWithStatusCode(_0x137435,_0x4130f2){_0x4130f2=_0x4130f2||0xcc;return function(_0x53abb1){if(_0x53abb1){return _0x137435[_0xa3a9('0x15')](_0x4130f2);}return _0x137435[_0xa3a9('0x16')](_0x4130f2)[_0xa3a9('0x17')]();};}function respondWithResult(_0x3cbb77,_0x2ef55e){_0x2ef55e=_0x2ef55e||0xc8;return function(_0x46ed8f){if(_0x46ed8f){return _0x3cbb77['status'](_0x2ef55e)[_0xa3a9('0x18')](_0x46ed8f);}};}function respondWithFilteredResult(_0x126d4e,_0x16ba22){return function(_0x588f4c){if(_0x588f4c){var _0x416593=typeof _0x16ba22['offset']===_0xa3a9('0x19')&&typeof _0x16ba22[_0xa3a9('0x1a')]==='undefined';var _0x461268=_0x588f4c[_0xa3a9('0x1b')];var _0x5126ef=_0x416593?0x0:_0x16ba22[_0xa3a9('0x1c')];var _0x42c35a=_0x416593?_0x588f4c[_0xa3a9('0x1b')]:_0x16ba22[_0xa3a9('0x1c')]+_0x16ba22['limit'];var _0x4c0928;if(_0x42c35a>=_0x461268){_0x42c35a=_0x461268;_0x4c0928=0xc8;}else{_0x4c0928=0xce;}_0x126d4e[_0xa3a9('0x16')](_0x4c0928);return _0x126d4e[_0xa3a9('0x1d')](_0xa3a9('0x1e'),_0x5126ef+'-'+_0x42c35a+'/'+_0x461268)['json'](_0x588f4c);}return null;};}function patchUpdates(_0x403617){return function(_0x129e50){try{jsonpatch[_0xa3a9('0x1f')](_0x129e50,_0x403617,!![]);}catch(_0x2454f8){return BPromise[_0xa3a9('0x20')](_0x2454f8);}return _0x129e50[_0xa3a9('0x21')]();};}function saveUpdates(_0x55efad,_0x4ce231){return function(_0x3b0e7e){if(_0x3b0e7e){return _0x3b0e7e[_0xa3a9('0x22')](_0x55efad)[_0xa3a9('0x23')](function(_0x4140a8){return _0x4140a8;});}return null;};}function removeEntity(_0x100cd2,_0xa1e23d){return function(_0x49e62b){if(_0x49e62b){return _0x49e62b['destroy']()['then'](function(){_0x100cd2[_0xa3a9('0x16')](0xcc)[_0xa3a9('0x17')]();});}};}function handleEntityNotFound(_0x34c70e,_0x5b8e46){return function(_0x230e9e){if(!_0x230e9e){_0x34c70e['sendStatus'](0x194);}return _0x230e9e;};}function handleError(_0xf2e0b3,_0x3cb5c1){_0x3cb5c1=_0x3cb5c1||0x1f4;return function(_0x338789){logger[_0xa3a9('0x24')](_0x338789[_0xa3a9('0x25')]);if(_0x338789[_0xa3a9('0x26')]){delete _0x338789[_0xa3a9('0x26')];}_0xf2e0b3['status'](_0x3cb5c1)['send'](_0x338789);};}exports[_0xa3a9('0x27')]=function(_0x17a8b3,_0x5718da){var _0x3d9fa2={},_0x13ebf1={},_0x48a7dc={'count':0x0,'rows':[]};var _0x27ca74=_[_0xa3a9('0x28')](db['ServicenowAccount']['rawAttributes'],function(_0xf0a9dd){return{'name':_0xf0a9dd[_0xa3a9('0x29')],'type':_0xf0a9dd[_0xa3a9('0x2a')][_0xa3a9('0x2b')]};});_0x13ebf1[_0xa3a9('0x2c')]=_[_0xa3a9('0x28')](_0x27ca74,'name');_0x13ebf1['query']=_['keys'](_0x17a8b3['query']);_0x13ebf1[_0xa3a9('0x2d')]=_[_0xa3a9('0x2e')](_0x13ebf1[_0xa3a9('0x2c')],_0x13ebf1['query']);_0x3d9fa2['attributes']=_[_0xa3a9('0x2e')](_0x13ebf1['model'],qs[_0xa3a9('0x2f')](_0x17a8b3[_0xa3a9('0x30')][_0xa3a9('0x2f')]));_0x3d9fa2[_0xa3a9('0x31')]=_0x3d9fa2[_0xa3a9('0x31')][_0xa3a9('0x32')]?_0x3d9fa2['attributes']:_0x13ebf1[_0xa3a9('0x2c')];if(!_0x17a8b3[_0xa3a9('0x30')][_0xa3a9('0x33')]('nolimit')){_0x3d9fa2[_0xa3a9('0x1a')]=qs[_0xa3a9('0x1a')](_0x17a8b3[_0xa3a9('0x30')]['limit']);_0x3d9fa2['offset']=qs['offset'](_0x17a8b3[_0xa3a9('0x30')][_0xa3a9('0x1c')]);}_0x3d9fa2[_0xa3a9('0x34')]=qs[_0xa3a9('0x35')](_0x17a8b3[_0xa3a9('0x30')][_0xa3a9('0x35')]);_0x3d9fa2['where']=qs[_0xa3a9('0x2d')](_[_0xa3a9('0x36')](_0x17a8b3['query'],_0x13ebf1[_0xa3a9('0x2d')]),_0x27ca74);if(_0x17a8b3[_0xa3a9('0x30')][_0xa3a9('0x37')]){_0x3d9fa2[_0xa3a9('0x38')]=_[_0xa3a9('0x39')](_0x3d9fa2[_0xa3a9('0x38')],{'$or':_[_0xa3a9('0x28')](_0x27ca74,function(_0x407c59){if(_0x407c59[_0xa3a9('0x2a')]!==_0xa3a9('0x3a')){var _0x5c4571={};_0x5c4571[_0x407c59['name']]={'$like':'%'+_0x17a8b3[_0xa3a9('0x30')]['filter']+'%'};return _0x5c4571;}})});}_0x3d9fa2=_[_0xa3a9('0x39')]({},_0x3d9fa2,_0x17a8b3[_0xa3a9('0x3b')]);var _0x4451e9={'where':_0x3d9fa2[_0xa3a9('0x38')]};return db[_0xa3a9('0x3c')][_0xa3a9('0x1b')](_0x4451e9)[_0xa3a9('0x23')](function(_0x900814){_0x48a7dc[_0xa3a9('0x1b')]=_0x900814;if(_0x17a8b3['query'][_0xa3a9('0x3d')]){_0x3d9fa2[_0xa3a9('0x3e')]=[{'all':!![]}];}return db[_0xa3a9('0x3c')][_0xa3a9('0x3f')](_0x3d9fa2);})[_0xa3a9('0x23')](function(_0x1a41e8){_0x48a7dc[_0xa3a9('0x40')]=_0x1a41e8;return _0x48a7dc;})[_0xa3a9('0x23')](respondWithFilteredResult(_0x5718da,_0x3d9fa2))[_0xa3a9('0x41')](handleError(_0x5718da,null));};exports['show']=function(_0x381245,_0x5f4e6a){var _0x431b8c={'raw':![],'where':{'id':_0x381245[_0xa3a9('0x42')]['id']}},_0xd2ee6d={};_0xd2ee6d[_0xa3a9('0x2c')]=_[_0xa3a9('0x43')](db[_0xa3a9('0x3c')][_0xa3a9('0x44')]);_0xd2ee6d[_0xa3a9('0x30')]=_['keys'](_0x381245[_0xa3a9('0x30')]);_0xd2ee6d[_0xa3a9('0x2d')]=_[_0xa3a9('0x2e')](_0xd2ee6d[_0xa3a9('0x2c')],_0xd2ee6d[_0xa3a9('0x30')]);_0x431b8c['attributes']=_[_0xa3a9('0x2e')](_0xd2ee6d[_0xa3a9('0x2c')],qs['fields'](_0x381245[_0xa3a9('0x30')][_0xa3a9('0x2f')]));_0x431b8c[_0xa3a9('0x31')]=_0x431b8c['attributes']['length']?_0x431b8c[_0xa3a9('0x31')]:_0xd2ee6d[_0xa3a9('0x2c')];if(_0x381245[_0xa3a9('0x30')]['includeAll']){_0x431b8c[_0xa3a9('0x3e')]=[{'all':!![]}];}_0x431b8c=_[_0xa3a9('0x39')]({},_0x431b8c,_0x381245[_0xa3a9('0x3b')]);return db['ServicenowAccount']['find'](_0x431b8c)['then'](handleEntityNotFound(_0x5f4e6a,null))[_0xa3a9('0x23')](respondWithResult(_0x5f4e6a,null))[_0xa3a9('0x41')](handleError(_0x5f4e6a,null));};exports[_0xa3a9('0x45')]=function(_0x11240b,_0x554082){return db['ServicenowAccount'][_0xa3a9('0x45')](_0x11240b[_0xa3a9('0x46')],{})[_0xa3a9('0x23')](respondWithResult(_0x554082,0xc9))[_0xa3a9('0x41')](handleError(_0x554082,null));};exports['update']=function(_0x19d55c,_0x407b6a){if(_0x19d55c[_0xa3a9('0x46')]['id']){delete _0x19d55c[_0xa3a9('0x46')]['id'];}return db[_0xa3a9('0x3c')][_0xa3a9('0x47')]({'where':{'id':_0x19d55c['params']['id']}})['then'](handleEntityNotFound(_0x407b6a,null))[_0xa3a9('0x23')](saveUpdates(_0x19d55c[_0xa3a9('0x46')],null))[_0xa3a9('0x23')](respondWithResult(_0x407b6a,null))['catch'](handleError(_0x407b6a,null));};exports[_0xa3a9('0x48')]=function(_0x325e57,_0x25c43f){return db[_0xa3a9('0x3c')][_0xa3a9('0x47')]({'where':{'id':_0x325e57[_0xa3a9('0x42')]['id']}})[_0xa3a9('0x23')](handleEntityNotFound(_0x25c43f,null))[_0xa3a9('0x23')](removeEntity(_0x25c43f,null))[_0xa3a9('0x41')](handleError(_0x25c43f,null));};exports[_0xa3a9('0x49')]=function(_0x226398,_0x399210,_0x512131){var _0x18077a={};var _0x2303b3={};var _0x4de970;var _0x1a9bb7;return db[_0xa3a9('0x3c')][_0xa3a9('0x4a')]({'where':{'id':_0x226398[_0xa3a9('0x42')]['id']}})[_0xa3a9('0x23')](handleEntityNotFound(_0x399210,null))[_0xa3a9('0x23')](function(_0x35b090){if(_0x35b090){_0x4de970=_0x35b090;_0x2303b3[_0xa3a9('0x2c')]=_[_0xa3a9('0x43')](db[_0xa3a9('0x4b')]['rawAttributes']);_0x2303b3[_0xa3a9('0x30')]=_[_0xa3a9('0x43')](_0x226398[_0xa3a9('0x30')]);_0x2303b3['filters']=_['intersection'](_0x2303b3[_0xa3a9('0x2c')],_0x2303b3[_0xa3a9('0x30')]);_0x18077a[_0xa3a9('0x31')]=_[_0xa3a9('0x2e')](_0x2303b3[_0xa3a9('0x2c')],qs[_0xa3a9('0x2f')](_0x226398[_0xa3a9('0x30')][_0xa3a9('0x2f')]));_0x18077a[_0xa3a9('0x31')]=_0x18077a['attributes']['length']?_0x18077a[_0xa3a9('0x31')]:_0x2303b3[_0xa3a9('0x2c')];_0x18077a[_0xa3a9('0x34')]=qs[_0xa3a9('0x35')](_0x226398[_0xa3a9('0x30')][_0xa3a9('0x35')]);_0x18077a[_0xa3a9('0x38')]=qs[_0xa3a9('0x2d')](_[_0xa3a9('0x36')](_0x226398[_0xa3a9('0x30')],_0x2303b3[_0xa3a9('0x2d')]));if(_0x226398[_0xa3a9('0x30')][_0xa3a9('0x37')]){_0x18077a[_0xa3a9('0x38')]=_[_0xa3a9('0x39')](_0x18077a[_0xa3a9('0x38')],{'$or':_[_0xa3a9('0x28')](_0x18077a['attributes'],function(_0x412119){var _0x3330e6={};_0x3330e6[_0x412119]={'$like':'%'+_0x226398[_0xa3a9('0x30')][_0xa3a9('0x37')]+'%'};return _0x3330e6;})});}_0x18077a=_['merge']({},_0x18077a,_0x226398[_0xa3a9('0x3b')]);return _0x4de970[_0xa3a9('0x49')](_0x18077a);}})[_0xa3a9('0x23')](function(_0x23342f){if(_0x23342f){_0x1a9bb7=_0x23342f[_0xa3a9('0x32')];if(!_0x226398[_0xa3a9('0x30')][_0xa3a9('0x33')](_0xa3a9('0x4c'))){_0x18077a[_0xa3a9('0x1a')]=qs[_0xa3a9('0x1a')](_0x226398[_0xa3a9('0x30')][_0xa3a9('0x1a')]);_0x18077a[_0xa3a9('0x1c')]=qs['offset'](_0x226398[_0xa3a9('0x30')]['offset']);}return _0x4de970['getConfigurations'](_0x18077a);}})[_0xa3a9('0x23')](function(_0x10e19f){if(_0x10e19f){return _0x10e19f?{'count':_0x1a9bb7,'rows':_0x10e19f}:null;}})[_0xa3a9('0x23')](respondWithResult(_0x399210,null))['catch'](handleError(_0x399210,null));};exports['addConfiguration']=function(_0x2e2bd1,_0x2a76d1,_0x1a399a){if(_0x2e2bd1[_0xa3a9('0x46')]['id']){delete _0x2e2bd1[_0xa3a9('0x46')]['id'];}return db['ServicenowAccount'][_0xa3a9('0x4a')]({'where':{'id':_0x2e2bd1[_0xa3a9('0x42')]['id']}})[_0xa3a9('0x23')](handleEntityNotFound(_0x2a76d1,null))[_0xa3a9('0x23')](function(_0x21128d){if(_0x21128d){_0x2e2bd1[_0xa3a9('0x46')]['AccountId']=_0x21128d['id'];_0x2e2bd1[_0xa3a9('0x46')][_0xa3a9('0x4d')]=integrations[_0xa3a9('0x4e')](_0x2e2bd1[_0xa3a9('0x46')][_0xa3a9('0x4f')],_0x2e2bd1[_0xa3a9('0x46')][_0xa3a9('0x2a')]);_0x2e2bd1[_0xa3a9('0x46')]['Descriptions']=integrations[_0xa3a9('0x50')](_0x2e2bd1[_0xa3a9('0x46')][_0xa3a9('0x4f')],_0x2e2bd1[_0xa3a9('0x46')][_0xa3a9('0x2a')]);return db['ServicenowConfiguration'][_0xa3a9('0x45')](_0x2e2bd1[_0xa3a9('0x46')],{'include':[{'model':db[_0xa3a9('0x51')],'as':_0xa3a9('0x4d')},{'model':db[_0xa3a9('0x51')],'as':_0xa3a9('0x52')}]});}return null;})[_0xa3a9('0x23')](respondWithResult(_0x2a76d1,null))[_0xa3a9('0x41')](handleError(_0x2a76d1,null));};exports[_0xa3a9('0x53')]=function(_0x392e94,_0x248bb3,_0x53dacb){var _0x51220b=[_0xa3a9('0x54'),_0xa3a9('0x55'),_0xa3a9('0x56'),_0xa3a9('0x57'),_0xa3a9('0x58'),_0xa3a9('0x59'),_0xa3a9('0x5a'),_0xa3a9('0x5b'),_0xa3a9('0x5c')];var _0x1fb7dd=[_0xa3a9('0x5d'),_0xa3a9('0x54'),'caused_by',_0xa3a9('0x5e'),'upon_reject',_0xa3a9('0x5f'),_0xa3a9('0x60'),_0xa3a9('0x55'),_0xa3a9('0x61'),_0xa3a9('0x62'),_0xa3a9('0x63'),'sys_updated_by',_0xa3a9('0x64'),'user_input',_0xa3a9('0x65'),_0xa3a9('0x66'),_0xa3a9('0x67'),'sys_created_by',_0xa3a9('0x56'),'order',_0xa3a9('0x68'),'closed_at',_0xa3a9('0x69'),'delivery_plan',_0xa3a9('0x6a'),_0xa3a9('0x6b'),_0xa3a9('0x6c'),_0xa3a9('0x6d'),'priority',_0xa3a9('0x6e'),_0xa3a9('0x6f'),_0xa3a9('0x70'),_0xa3a9('0x71'),_0xa3a9('0x72'),_0xa3a9('0x73'),_0xa3a9('0x74'),_0xa3a9('0x75'),_0xa3a9('0x76'),'resolved_at',_0xa3a9('0x77'),'approval_set',_0xa3a9('0x57'),'work_notes','short_description',_0xa3a9('0x58'),_0xa3a9('0x78'),_0xa3a9('0x79'),_0xa3a9('0x7a'),_0xa3a9('0x7b'),_0xa3a9('0x7c'),'additional_assignee_list',_0xa3a9('0x7d'),_0xa3a9('0x7e'),_0xa3a9('0x59'),_0xa3a9('0x7f'),'close_notes','closed_by',_0xa3a9('0x80'),_0xa3a9('0x81'),_0xa3a9('0x82'),'contact_type',_0xa3a9('0x83'),'incident_state',_0xa3a9('0x84'),_0xa3a9('0x85'),'company',_0xa3a9('0x86'),_0xa3a9('0x87'),'assigned_to',_0xa3a9('0x5b'),_0xa3a9('0x88'),_0xa3a9('0x89'),_0xa3a9('0x8a'),_0xa3a9('0x8b'),'due_date',_0xa3a9('0x8c'),_0xa3a9('0x8d'),'sys_tags',_0xa3a9('0x8e'),_0xa3a9('0x8f'),'correlation_id',_0xa3a9('0x90'),_0xa3a9('0x5c')];var _0x26b84e='';var _0x4fa5d1='';var _0x143c3a=[];var _0x2203ef='';var _0x5f46ee='';var _0xb567cc=[];var _0x2c4beb='';var _0x5e6649='';var _0x584312={};var _0xcc04a9='';return db[_0xa3a9('0x3c')][_0xa3a9('0x4a')]({'where':{'id':_0x392e94[_0xa3a9('0x42')]['id']},'attributes':['id',_0xa3a9('0x91'),'password','email','remoteUri','serverUrl']})[_0xa3a9('0x23')](handleEntityNotFound(_0x248bb3,null))[_0xa3a9('0x23')](function(_0x1c2f1e){if(_0x1c2f1e){_0xcc04a9=_0x1c2f1e[_0xa3a9('0x92')];var _0x3e01b6=_0xcc04a9[_0xa3a9('0x93')](-0x1);if(_0x3e01b6==='/'){_0xcc04a9=_0xcc04a9['substring'](0x0,_0xcc04a9[_0xa3a9('0x94')](_0x3e01b6));}_0x5e6649=util[_0xa3a9('0x95')](_0xa3a9('0x96'),_0xcc04a9);_0x2c4beb=util[_0xa3a9('0x95')]('%s/api/now/table/',_0xcc04a9);_0x584312={'user':_0x1c2f1e[_0xa3a9('0x91')],'pass':_0x1c2f1e[_0xa3a9('0x97')]};var _0x493dae={'method':'GET','uri':_0x5e6649+'incident?sysparm_display_value=all','auth':_0x584312,'json':!![]};return rp(_0x493dae);}})[_0xa3a9('0x23')](function(_0x2f8b59){if(_0x2f8b59['result'][_0xa3a9('0x32')]>0x0){_0x26b84e=_0x2f8b59[_0xa3a9('0x98')];}console[_0xa3a9('0x99')](_0xa3a9('0x9a'),_0x26b84e);_0xb567cc=[];_0x4fa5d1=Object[_0xa3a9('0x9b')]([],_0x26b84e);_[_0xa3a9('0x9c')](_0x4fa5d1,function(_0x2a9b02){return!_0x51220b[_0xa3a9('0x9d')](_0x2a9b02[_0xa3a9('0x26')]);});_0x4fa5d1['forEach'](function(_0x5d198f){var _0x5c2950=createFieldObject(_0x2c4beb,_0x584312,_0x5d198f[_0xa3a9('0x9e')],_0x5d198f[_0xa3a9('0x26')],_0x5d198f[_0xa3a9('0x9f')],![]);_0xb567cc[_0xa3a9('0xa0')](_0x5c2950);});return Promise[_0xa3a9('0xa1')](_0xb567cc);})[_0xa3a9('0x23')](function(_0x369b46){_0x143c3a=_0x369b46;_0x2203ef=Object[_0xa3a9('0x9b')]([],_0x26b84e);console[_0xa3a9('0x99')](_0xa3a9('0xa2'),_0x26b84e);_[_0xa3a9('0x9c')](_0x2203ef,function(_0x24b2ed){return _0x1fb7dd[_0xa3a9('0x9d')](_0x24b2ed[_0xa3a9('0x26')]);});console['log']('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x2203ef);_0xb567cc=[];_0x2203ef[_0xa3a9('0xa3')](function(_0x597a03){var _0x48003a=createFieldObject(_0x2c4beb,_0x584312,_0x597a03[_0xa3a9('0x9e')],_0x597a03[_0xa3a9('0x26')],_0x597a03['label'],!![]);_0xb567cc[_0xa3a9('0xa0')](_0x48003a);});return Promise['all'](_0xb567cc);})[_0xa3a9('0x23')](function(_0x34fbc6){_0x5f46ee=_0x34fbc6;var _0x4ce0d4=_0x143c3a[_0xa3a9('0xa4')](_0x5f46ee);return{'count':_0x4ce0d4[_0xa3a9('0x32')],'rows':_0x4ce0d4};})['then'](respondWithResult(_0x248bb3,null))[_0xa3a9('0x41')](function(_0x2e9edb){console['log'](_0xa3a9('0xa5')+_0x2e9edb);var _0x295862=_0x392e94[_0xa3a9('0x30')][_0xa3a9('0xa6')]?0x1f4:_0x2e9edb[_0xa3a9('0xa7')]||0x1f4;logger[_0xa3a9('0x24')](_0x2e9edb['stack']);delete _0x2e9edb[_0xa3a9('0x26')];if(_0x295862===0x191){_0x295862=0x190;}_0x248bb3['status'](_0x295862)[_0xa3a9('0xa8')](_0x392e94[_0xa3a9('0x30')][_0xa3a9('0xa6')]?{'message':_0xa3a9('0xa9'),'statusCode':_0x2e9edb[_0xa3a9('0xa7')]}:_0x2e9edb);});};function createFieldObject(_0x48777d,_0x358471,_0x572b74,_0x1026a7,_0x37d9db,_0x1e5f6e){return new Promise(function(_0x3227cc,_0xae258b){var _0x15c62d={'id':_0x1026a7,'name':_0x37d9db,'custom':_0x1e5f6e};if(_0x572b74==='boolean'){_0x15c62d[_0xa3a9('0x3b')]=[{'name':_0xa3a9('0xaa'),'value':'true'},{'name':_0xa3a9('0xab'),'value':_0xa3a9('0xac')}];_0x3227cc(_0x15c62d);}else{var _0x5a48ac={'method':'GET','uri':_0x48777d+_0xa3a9('0xad')+_0x1026a7,'auth':_0x358471,'json':!![]};return rp(_0x5a48ac)['then'](function(_0x24c55f){var _0x31a773=[];if(_0x24c55f[_0xa3a9('0x98')]['length']>0x0){_0x24c55f[_0xa3a9('0x98')][_0xa3a9('0xa3')](function(_0x11ca3b){if(_0x11ca3b[_0xa3a9('0xae')]===_0xa3a9('0xac')){var _0x520494={'name':_0x11ca3b['label'],'value':_0x11ca3b['value']};_0x31a773[_0xa3a9('0xa0')](_0x520494);}});}_0x15c62d[_0xa3a9('0x3b')]=_0x31a773;if(_0x15c62d['options'][_0xa3a9('0x32')]>0x0){_0x3227cc(_0x15c62d);}else{if(_0x1e5f6e==![]){_0x3227cc();}else{_0x3227cc(_0x15c62d);}}});}});} \ No newline at end of file +var _0x7951=['due_date','reopen_count','sys_tags','correlation_id','location','username','password','email','remoteUri','serverUrl','substring','lastIndexOf','%s/api/now/doc/table/schema/','format','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','remove','includes','forEach','internalType','label','push','all','TCL:\x20_object','concat','ServiceNow\x20error:\x20','test','statusCode','Wrong\x20credentials','False','false','value','rimraf','zip-dir','request-promise','bluebird','mustache','util','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','../../components/integrations/configuration','sendStatus','status','end','offset','limit','undefined','count','json','apply','save','update','then','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','ServicenowAccount','include','findAll','rows','catch','show','params','rawAttributes','includeAll','options','find','create','body','destroy','getConfigurations','ServicenowConfiguration','pick','findOne','AccountId','getSubjects','Descriptions','getDescriptions','channel','ServicenowField','Subjects','getFields','made_sla','hold_reason','knowledge','subcategory','notify','incident_state','severity','category','caused_by','watch_list','sys_updated_on','child_incidents','approval_history','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','state','sys_created_by','order','cmdb_ci','impact','active','work_notes_list','priority','time_worked','expected_start','business_duration','work_end','reopened_time','approval_set','work_notes','short_description','close_code','correlation_display','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','sys_class_name','close_notes','follow_up','sys_id','contact_type','reopened_by','urgency','problem_id','reassignment_count','assigned_to','sla_due','comments_and_work_notes'];(function(_0x30d618,_0x590668){var _0x39731a=function(_0x53e0fe){while(--_0x53e0fe){_0x30d618['push'](_0x30d618['shift']());}};_0x39731a(++_0x590668);}(_0x7951,0x189));var _0x1795=function(_0x3f24f0,_0x4808ff){_0x3f24f0=_0x3f24f0-0x0;var _0x20b6b0=_0x7951[_0x3f24f0];return _0x20b6b0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1795('0x0'));var zipdir=require(_0x1795('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1795('0x2'));var moment=require('moment');var BPromise=require(_0x1795('0x3'));var Mustache=require(_0x1795('0x4'));var util=require(_0x1795('0x5'));var path=require('path');var sox=require(_0x1795('0x6'));var csv=require(_0x1795('0x7'));var ejs=require(_0x1795('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1795('0x9'));var squel=require(_0x1795('0xa'));var crypto=require(_0x1795('0xb'));var jsforce=require(_0x1795('0xc'));var deskjs=require(_0x1795('0xd'));var toCsv=require(_0x1795('0x7'));var querystring=require(_0x1795('0xe'));var Papa=require(_0x1795('0xf'));var Redis=require('ioredis');var authService=require(_0x1795('0x10'));var qs=require(_0x1795('0x11'));var as=require(_0x1795('0x12'));var hardwareService=require(_0x1795('0x13'));var logger=require(_0x1795('0x14'))(_0x1795('0x15'));var utils=require(_0x1795('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x1795('0x17'));var db=require(_0x1795('0x18'))['db'];var integrations=require(_0x1795('0x19'));function respondWithStatusCode(_0x1ec28e,_0x47c1fc){_0x47c1fc=_0x47c1fc||0xcc;return function(_0x8f38fa){if(_0x8f38fa){return _0x1ec28e[_0x1795('0x1a')](_0x47c1fc);}return _0x1ec28e[_0x1795('0x1b')](_0x47c1fc)[_0x1795('0x1c')]();};}function respondWithResult(_0x5e0223,_0x16e413){_0x16e413=_0x16e413||0xc8;return function(_0x1c707f){if(_0x1c707f){return _0x5e0223['status'](_0x16e413)['json'](_0x1c707f);}};}function respondWithFilteredResult(_0x2b44da,_0x5128ba){return function(_0x1a4be1){if(_0x1a4be1){var _0x4d98c9=typeof _0x5128ba[_0x1795('0x1d')]==='undefined'&&typeof _0x5128ba[_0x1795('0x1e')]===_0x1795('0x1f');var _0x4197a3=_0x1a4be1[_0x1795('0x20')];var _0x30104d=_0x4d98c9?0x0:_0x5128ba[_0x1795('0x1d')];var _0x3b67f7=_0x4d98c9?_0x1a4be1[_0x1795('0x20')]:_0x5128ba[_0x1795('0x1d')]+_0x5128ba[_0x1795('0x1e')];var _0x416600;if(_0x3b67f7>=_0x4197a3){_0x3b67f7=_0x4197a3;_0x416600=0xc8;}else{_0x416600=0xce;}_0x2b44da[_0x1795('0x1b')](_0x416600);return _0x2b44da['set']('Content-Range',_0x30104d+'-'+_0x3b67f7+'/'+_0x4197a3)[_0x1795('0x21')](_0x1a4be1);}return null;};}function patchUpdates(_0x52e425){return function(_0xef12d7){try{jsonpatch[_0x1795('0x22')](_0xef12d7,_0x52e425,!![]);}catch(_0x3b395d){return BPromise['reject'](_0x3b395d);}return _0xef12d7[_0x1795('0x23')]();};}function saveUpdates(_0x3d2963,_0x40e00b){return function(_0xdc68dc){if(_0xdc68dc){return _0xdc68dc[_0x1795('0x24')](_0x3d2963)[_0x1795('0x25')](function(_0x1db50b){return _0x1db50b;});}return null;};}function removeEntity(_0x3e26fe,_0x276d3a){return function(_0x111d3c){if(_0x111d3c){return _0x111d3c['destroy']()[_0x1795('0x25')](function(){_0x3e26fe[_0x1795('0x1b')](0xcc)[_0x1795('0x1c')]();});}};}function handleEntityNotFound(_0x56dffb,_0x19419c){return function(_0x29ccad){if(!_0x29ccad){_0x56dffb[_0x1795('0x1a')](0x194);}return _0x29ccad;};}function handleError(_0x4a5aa5,_0x517a8c){_0x517a8c=_0x517a8c||0x1f4;return function(_0xda24d8){logger[_0x1795('0x26')](_0xda24d8[_0x1795('0x27')]);if(_0xda24d8[_0x1795('0x28')]){delete _0xda24d8[_0x1795('0x28')];}_0x4a5aa5[_0x1795('0x1b')](_0x517a8c)[_0x1795('0x29')](_0xda24d8);};}exports[_0x1795('0x2a')]=function(_0x2377ad,_0x5729e4){var _0x4567e5={},_0x108f5b={},_0xd446b3={'count':0x0,'rows':[]};var _0x588309=_[_0x1795('0x2b')](db['ServicenowAccount']['rawAttributes'],function(_0x23f5d3){return{'name':_0x23f5d3[_0x1795('0x2c')],'type':_0x23f5d3[_0x1795('0x2d')][_0x1795('0x2e')]};});_0x108f5b[_0x1795('0x2f')]=_[_0x1795('0x2b')](_0x588309,_0x1795('0x28'));_0x108f5b[_0x1795('0x30')]=_[_0x1795('0x31')](_0x2377ad[_0x1795('0x30')]);_0x108f5b[_0x1795('0x32')]=_[_0x1795('0x33')](_0x108f5b[_0x1795('0x2f')],_0x108f5b['query']);_0x4567e5[_0x1795('0x34')]=_[_0x1795('0x33')](_0x108f5b['model'],qs[_0x1795('0x35')](_0x2377ad[_0x1795('0x30')]['fields']));_0x4567e5['attributes']=_0x4567e5['attributes'][_0x1795('0x36')]?_0x4567e5[_0x1795('0x34')]:_0x108f5b[_0x1795('0x2f')];if(!_0x2377ad['query'][_0x1795('0x37')](_0x1795('0x38'))){_0x4567e5['limit']=qs[_0x1795('0x1e')](_0x2377ad[_0x1795('0x30')][_0x1795('0x1e')]);_0x4567e5[_0x1795('0x1d')]=qs['offset'](_0x2377ad[_0x1795('0x30')][_0x1795('0x1d')]);}_0x4567e5['order']=qs['sort'](_0x2377ad['query'][_0x1795('0x39')]);_0x4567e5[_0x1795('0x3a')]=qs[_0x1795('0x32')](_['pick'](_0x2377ad[_0x1795('0x30')],_0x108f5b[_0x1795('0x32')]),_0x588309);if(_0x2377ad['query'][_0x1795('0x3b')]){_0x4567e5['where']=_[_0x1795('0x3c')](_0x4567e5[_0x1795('0x3a')],{'$or':_[_0x1795('0x2b')](_0x588309,function(_0x28b5de){if(_0x28b5de[_0x1795('0x2d')]!==_0x1795('0x3d')){var _0x3c0bab={};_0x3c0bab[_0x28b5de[_0x1795('0x28')]]={'$like':'%'+_0x2377ad['query'][_0x1795('0x3b')]+'%'};return _0x3c0bab;}})});}_0x4567e5=_['merge']({},_0x4567e5,_0x2377ad['options']);var _0x56adc4={'where':_0x4567e5[_0x1795('0x3a')]};return db[_0x1795('0x3e')]['count'](_0x56adc4)['then'](function(_0x1eb221){_0xd446b3[_0x1795('0x20')]=_0x1eb221;if(_0x2377ad[_0x1795('0x30')]['includeAll']){_0x4567e5[_0x1795('0x3f')]=[{'all':!![]}];}return db[_0x1795('0x3e')][_0x1795('0x40')](_0x4567e5);})['then'](function(_0x43d691){_0xd446b3[_0x1795('0x41')]=_0x43d691;return _0xd446b3;})[_0x1795('0x25')](respondWithFilteredResult(_0x5729e4,_0x4567e5))[_0x1795('0x42')](handleError(_0x5729e4,null));};exports[_0x1795('0x43')]=function(_0x45dcff,_0x3ea08c){var _0x37f2bf={'raw':![],'where':{'id':_0x45dcff[_0x1795('0x44')]['id']}},_0x91c6d6={};_0x91c6d6['model']=_[_0x1795('0x31')](db['ServicenowAccount'][_0x1795('0x45')]);_0x91c6d6[_0x1795('0x30')]=_[_0x1795('0x31')](_0x45dcff['query']);_0x91c6d6[_0x1795('0x32')]=_['intersection'](_0x91c6d6[_0x1795('0x2f')],_0x91c6d6['query']);_0x37f2bf[_0x1795('0x34')]=_[_0x1795('0x33')](_0x91c6d6['model'],qs[_0x1795('0x35')](_0x45dcff['query']['fields']));_0x37f2bf[_0x1795('0x34')]=_0x37f2bf[_0x1795('0x34')][_0x1795('0x36')]?_0x37f2bf[_0x1795('0x34')]:_0x91c6d6[_0x1795('0x2f')];if(_0x45dcff[_0x1795('0x30')][_0x1795('0x46')]){_0x37f2bf['include']=[{'all':!![]}];}_0x37f2bf=_[_0x1795('0x3c')]({},_0x37f2bf,_0x45dcff[_0x1795('0x47')]);return db[_0x1795('0x3e')][_0x1795('0x48')](_0x37f2bf)[_0x1795('0x25')](handleEntityNotFound(_0x3ea08c,null))[_0x1795('0x25')](respondWithResult(_0x3ea08c,null))[_0x1795('0x42')](handleError(_0x3ea08c,null));};exports[_0x1795('0x49')]=function(_0x364488,_0x3ef8d6){return db[_0x1795('0x3e')][_0x1795('0x49')](_0x364488[_0x1795('0x4a')],{})[_0x1795('0x25')](respondWithResult(_0x3ef8d6,0xc9))['catch'](handleError(_0x3ef8d6,null));};exports['update']=function(_0x299e78,_0x45c1db){if(_0x299e78['body']['id']){delete _0x299e78[_0x1795('0x4a')]['id'];}return db[_0x1795('0x3e')][_0x1795('0x48')]({'where':{'id':_0x299e78['params']['id']}})[_0x1795('0x25')](handleEntityNotFound(_0x45c1db,null))[_0x1795('0x25')](saveUpdates(_0x299e78['body'],null))[_0x1795('0x25')](respondWithResult(_0x45c1db,null))[_0x1795('0x42')](handleError(_0x45c1db,null));};exports[_0x1795('0x4b')]=function(_0x2d3d02,_0x59a2dd){return db[_0x1795('0x3e')]['find']({'where':{'id':_0x2d3d02[_0x1795('0x44')]['id']}})['then'](handleEntityNotFound(_0x59a2dd,null))[_0x1795('0x25')](removeEntity(_0x59a2dd,null))['catch'](handleError(_0x59a2dd,null));};exports[_0x1795('0x4c')]=function(_0x4e9bf7,_0x4eef98,_0x3e1c74){var _0x2d27eb={};var _0x4b4aac={};var _0x5478a7;var _0x59811c;return db[_0x1795('0x3e')]['findOne']({'where':{'id':_0x4e9bf7[_0x1795('0x44')]['id']}})[_0x1795('0x25')](handleEntityNotFound(_0x4eef98,null))[_0x1795('0x25')](function(_0x9588f9){if(_0x9588f9){_0x5478a7=_0x9588f9;_0x4b4aac[_0x1795('0x2f')]=_[_0x1795('0x31')](db[_0x1795('0x4d')][_0x1795('0x45')]);_0x4b4aac[_0x1795('0x30')]=_[_0x1795('0x31')](_0x4e9bf7[_0x1795('0x30')]);_0x4b4aac[_0x1795('0x32')]=_[_0x1795('0x33')](_0x4b4aac[_0x1795('0x2f')],_0x4b4aac[_0x1795('0x30')]);_0x2d27eb[_0x1795('0x34')]=_[_0x1795('0x33')](_0x4b4aac[_0x1795('0x2f')],qs[_0x1795('0x35')](_0x4e9bf7['query'][_0x1795('0x35')]));_0x2d27eb['attributes']=_0x2d27eb[_0x1795('0x34')][_0x1795('0x36')]?_0x2d27eb[_0x1795('0x34')]:_0x4b4aac[_0x1795('0x2f')];_0x2d27eb['order']=qs[_0x1795('0x39')](_0x4e9bf7[_0x1795('0x30')]['sort']);_0x2d27eb[_0x1795('0x3a')]=qs[_0x1795('0x32')](_[_0x1795('0x4e')](_0x4e9bf7[_0x1795('0x30')],_0x4b4aac[_0x1795('0x32')]));if(_0x4e9bf7[_0x1795('0x30')][_0x1795('0x3b')]){_0x2d27eb[_0x1795('0x3a')]=_[_0x1795('0x3c')](_0x2d27eb['where'],{'$or':_[_0x1795('0x2b')](_0x2d27eb[_0x1795('0x34')],function(_0x3f5f0d){var _0x2b8119={};_0x2b8119[_0x3f5f0d]={'$like':'%'+_0x4e9bf7[_0x1795('0x30')][_0x1795('0x3b')]+'%'};return _0x2b8119;})});}_0x2d27eb=_['merge']({},_0x2d27eb,_0x4e9bf7[_0x1795('0x47')]);return _0x5478a7[_0x1795('0x4c')](_0x2d27eb);}})['then'](function(_0x4c7650){if(_0x4c7650){_0x59811c=_0x4c7650[_0x1795('0x36')];if(!_0x4e9bf7['query'][_0x1795('0x37')](_0x1795('0x38'))){_0x2d27eb[_0x1795('0x1e')]=qs[_0x1795('0x1e')](_0x4e9bf7['query'][_0x1795('0x1e')]);_0x2d27eb[_0x1795('0x1d')]=qs[_0x1795('0x1d')](_0x4e9bf7[_0x1795('0x30')][_0x1795('0x1d')]);}return _0x5478a7[_0x1795('0x4c')](_0x2d27eb);}})[_0x1795('0x25')](function(_0x45ec66){if(_0x45ec66){return _0x45ec66?{'count':_0x59811c,'rows':_0x45ec66}:null;}})[_0x1795('0x25')](respondWithResult(_0x4eef98,null))[_0x1795('0x42')](handleError(_0x4eef98,null));};exports['addConfiguration']=function(_0x4ce911,_0x395493,_0x3707e0){if(_0x4ce911[_0x1795('0x4a')]['id']){delete _0x4ce911[_0x1795('0x4a')]['id'];}return db[_0x1795('0x3e')][_0x1795('0x4f')]({'where':{'id':_0x4ce911[_0x1795('0x44')]['id']}})['then'](handleEntityNotFound(_0x395493,null))[_0x1795('0x25')](function(_0xa482ef){if(_0xa482ef){_0x4ce911[_0x1795('0x4a')][_0x1795('0x50')]=_0xa482ef['id'];_0x4ce911[_0x1795('0x4a')]['Subjects']=integrations[_0x1795('0x51')](_0x4ce911['body']['channel'],_0x4ce911[_0x1795('0x4a')]['type']);_0x4ce911[_0x1795('0x4a')][_0x1795('0x52')]=integrations[_0x1795('0x53')](_0x4ce911[_0x1795('0x4a')][_0x1795('0x54')],_0x4ce911[_0x1795('0x4a')]['type']);return db[_0x1795('0x4d')][_0x1795('0x49')](_0x4ce911[_0x1795('0x4a')],{'include':[{'model':db[_0x1795('0x55')],'as':_0x1795('0x56')},{'model':db[_0x1795('0x55')],'as':_0x1795('0x52')}]});}return null;})['then'](respondWithResult(_0x395493,null))[_0x1795('0x42')](handleError(_0x395493,null));};exports[_0x1795('0x57')]=function(_0x5652a1,_0x3d9000,_0x3786e1){var _0x37e741=[_0x1795('0x58'),_0x1795('0x59'),_0x1795('0x5a'),_0x1795('0x5b'),'close_code',_0x1795('0x5c'),_0x1795('0x5d'),_0x1795('0x5e'),_0x1795('0x5f')];var _0x52b202=['parent',_0x1795('0x58'),_0x1795('0x60'),_0x1795('0x61'),'upon_reject',_0x1795('0x62'),_0x1795('0x63'),_0x1795('0x59'),_0x1795('0x64'),'number',_0x1795('0x65'),_0x1795('0x66'),_0x1795('0x67'),_0x1795('0x68'),_0x1795('0x69'),'sys_domain',_0x1795('0x6a'),_0x1795('0x6b'),_0x1795('0x5a'),_0x1795('0x6c'),'calendar_stc','closed_at',_0x1795('0x6d'),'delivery_plan',_0x1795('0x6e'),_0x1795('0x6f'),_0x1795('0x70'),'business_service',_0x1795('0x71'),'sys_domain_path','rfc',_0x1795('0x72'),_0x1795('0x73'),'opened_at',_0x1795('0x74'),'group_list',_0x1795('0x75'),_0x1795('0x76'),'resolved_at','caller_id',_0x1795('0x77'),'subcategory',_0x1795('0x78'),_0x1795('0x79'),_0x1795('0x7a'),_0x1795('0x7b'),'delivery_task','work_start',_0x1795('0x7c'),_0x1795('0x7d'),_0x1795('0x7e'),_0x1795('0x7f'),_0x1795('0x80'),_0x1795('0x5c'),_0x1795('0x81'),_0x1795('0x82'),'closed_by',_0x1795('0x83'),'parent_incident',_0x1795('0x84'),_0x1795('0x85'),_0x1795('0x86'),_0x1795('0x5d'),_0x1795('0x87'),_0x1795('0x88'),'company',_0x1795('0x89'),'activity_due',_0x1795('0x8a'),'severity','comments',_0x1795('0x8b'),'approval',_0x1795('0x8c'),_0x1795('0x8d'),'sys_mod_count',_0x1795('0x8e'),_0x1795('0x8f'),'escalation','upon_approval',_0x1795('0x90'),_0x1795('0x91'),_0x1795('0x5f')];var _0x30e278='';var _0x61d72d='';var _0x3a6038=[];var _0x1cb3a2='';var _0x30fa64='';var _0x9f36d3=[];var _0x1ea9fa='';var _0x8d3d87='';var _0x1671b9={};var _0x107374='';return db['ServicenowAccount'][_0x1795('0x4f')]({'where':{'id':_0x5652a1[_0x1795('0x44')]['id']},'attributes':['id',_0x1795('0x92'),_0x1795('0x93'),_0x1795('0x94'),_0x1795('0x95'),_0x1795('0x96')]})[_0x1795('0x25')](handleEntityNotFound(_0x3d9000,null))[_0x1795('0x25')](function(_0x3a3856){if(_0x3a3856){_0x107374=_0x3a3856['remoteUri'];var _0x574d85=_0x107374['slice'](-0x1);if(_0x574d85==='/'){_0x107374=_0x107374[_0x1795('0x97')](0x0,_0x107374[_0x1795('0x98')](_0x574d85));}_0x8d3d87=util['format'](_0x1795('0x99'),_0x107374);_0x1ea9fa=util[_0x1795('0x9a')](_0x1795('0x9b'),_0x107374);_0x1671b9={'user':_0x3a3856[_0x1795('0x92')],'pass':_0x3a3856[_0x1795('0x93')]};var _0x1a3d31={'method':_0x1795('0x9c'),'uri':_0x8d3d87+_0x1795('0x9d'),'auth':_0x1671b9,'json':!![]};return rp(_0x1a3d31);}})[_0x1795('0x25')](function(_0x3f1735){if(_0x3f1735[_0x1795('0x9e')][_0x1795('0x36')]>0x0){_0x30e278=_0x3f1735[_0x1795('0x9e')];}console[_0x1795('0x9f')](_0x1795('0xa0'),_0x30e278);_0x9f36d3=[];_0x61d72d=Object[_0x1795('0xa1')]([],_0x30e278);_[_0x1795('0xa2')](_0x61d72d,function(_0x5bc617){return!_0x37e741[_0x1795('0xa3')](_0x5bc617[_0x1795('0x28')]);});_0x61d72d[_0x1795('0xa4')](function(_0x25c2a1){var _0x2aeaf7=createFieldObject(_0x1ea9fa,_0x1671b9,_0x25c2a1[_0x1795('0xa5')],_0x25c2a1[_0x1795('0x28')],_0x25c2a1[_0x1795('0xa6')],![]);_0x9f36d3[_0x1795('0xa7')](_0x2aeaf7);});return Promise[_0x1795('0xa8')](_0x9f36d3);})[_0x1795('0x25')](function(_0x55d2b9){_0x3a6038=_0x55d2b9;_0x1cb3a2=Object[_0x1795('0xa1')]([],_0x30e278);console[_0x1795('0x9f')](_0x1795('0xa9'),_0x30e278);_[_0x1795('0xa2')](_0x1cb3a2,function(_0x4c8829){return _0x52b202[_0x1795('0xa3')](_0x4c8829['name']);});console[_0x1795('0x9f')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x1cb3a2);_0x9f36d3=[];_0x1cb3a2['forEach'](function(_0x225904){var _0x31163c=createFieldObject(_0x1ea9fa,_0x1671b9,_0x225904['internalType'],_0x225904['name'],_0x225904[_0x1795('0xa6')],!![]);_0x9f36d3[_0x1795('0xa7')](_0x31163c);});return Promise[_0x1795('0xa8')](_0x9f36d3);})[_0x1795('0x25')](function(_0x46b3f9){_0x30fa64=_0x46b3f9;var _0x199935=_0x3a6038[_0x1795('0xaa')](_0x30fa64);return{'count':_0x199935[_0x1795('0x36')],'rows':_0x199935};})[_0x1795('0x25')](respondWithResult(_0x3d9000,null))[_0x1795('0x42')](function(_0xa3c260){console[_0x1795('0x9f')](_0x1795('0xab')+_0xa3c260);var _0x1e6a8b=_0x5652a1['query'][_0x1795('0xac')]?0x1f4:_0xa3c260[_0x1795('0xad')]||0x1f4;logger[_0x1795('0x26')](_0xa3c260['stack']);delete _0xa3c260[_0x1795('0x28')];if(_0x1e6a8b===0x191){_0x1e6a8b=0x190;}_0x3d9000['status'](_0x1e6a8b)[_0x1795('0x29')](_0x5652a1[_0x1795('0x30')]['test']?{'message':_0x1795('0xae'),'statusCode':_0xa3c260[_0x1795('0xad')]}:_0xa3c260);});};function createFieldObject(_0x480696,_0x55f2aa,_0x387465,_0x40029b,_0x5a7f54,_0x33fdd4){return new Promise(function(_0x46354a,_0x2062f7){var _0xa9384c={'id':_0x40029b,'name':_0x5a7f54,'custom':_0x33fdd4};if(_0x387465==='boolean'){_0xa9384c[_0x1795('0x47')]=[{'name':'True','value':'true'},{'name':_0x1795('0xaf'),'value':_0x1795('0xb0')}];_0x46354a(_0xa9384c);}else{var _0x3b209f={'method':'GET','uri':_0x480696+'sys_choice?sysparm_query=name=incident^element='+_0x40029b,'auth':_0x55f2aa,'json':!![]};return rp(_0x3b209f)[_0x1795('0x25')](function(_0x5182eb){var _0x441475=[];if(_0x5182eb[_0x1795('0x9e')][_0x1795('0x36')]>0x0){_0x5182eb[_0x1795('0x9e')]['forEach'](function(_0x4369b6){if(_0x4369b6['inactive']==='false'){var _0x4a07be={'name':_0x4369b6[_0x1795('0xa6')],'value':_0x4369b6[_0x1795('0xb1')]};_0x441475[_0x1795('0xa7')](_0x4a07be);}});}_0xa9384c[_0x1795('0x47')]=_0x441475;if(_0xa9384c[_0x1795('0x47')][_0x1795('0x36')]>0x0){_0x46354a(_0xa9384c);}else{if(_0x33fdd4==![]){_0x46354a();}else{_0x46354a(_0xa9384c);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 51755fd..5177d27 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 _0xc1c6=['rimraf','../../components/integrations/configuration','define','ServicenowAccount','int_servicenow_accounts','lodash','util','../../config/logger','moment','request-promise','path'];(function(_0x4051bc,_0x23ee02){var _0x6f73ec=function(_0x40881f){while(--_0x40881f){_0x4051bc['push'](_0x4051bc['shift']());}};_0x6f73ec(++_0x23ee02);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x1b4100,_0xc867bd){_0x1b4100=_0x1b4100-0x0;var _0x131aa1=_0xc1c6[_0x1b4100];return _0x131aa1;};'use strict';var _=require(_0x6c1c('0x0'));var util=require(_0x6c1c('0x1'));var logger=require(_0x6c1c('0x2'))('api');var moment=require(_0x6c1c('0x3'));var BPromise=require('bluebird');var rp=require(_0x6c1c('0x4'));var fs=require('fs');var path=require(_0x6c1c('0x5'));var rimraf=require(_0x6c1c('0x6'));var config=require('../../config/environment');var attributes=require('./intServicenowAccount.attributes');var integrations=require(_0x6c1c('0x7'));module['exports']=function(_0x50c1bb,_0x582bec){return _0x50c1bb[_0x6c1c('0x8')](_0x6c1c('0x9'),attributes,{'tableName':_0x6c1c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x71ab=['path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount','int_servicenow_accounts','util','api','bluebird','request-promise'];(function(_0xe1650,_0x158a86){var _0x365799=function(_0x5dda62){while(--_0x5dda62){_0xe1650['push'](_0xe1650['shift']());}};_0x365799(++_0x158a86);}(_0x71ab,0x64));var _0xb71a=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x71ab[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require('lodash');var util=require(_0xb71a('0x0'));var logger=require('../../config/logger')(_0xb71a('0x1'));var moment=require('moment');var BPromise=require(_0xb71a('0x2'));var rp=require(_0xb71a('0x3'));var fs=require('fs');var path=require(_0xb71a('0x4'));var rimraf=require(_0xb71a('0x5'));var config=require(_0xb71a('0x6'));var attributes=require(_0xb71a('0x7'));var integrations=require(_0xb71a('0x8'));module[_0xb71a('0x9')]=function(_0x22c072,_0x35a84e){return _0x22c072[_0xb71a('0xa')](_0xb71a('0xb'),attributes,{'tableName':_0xb71a('0xc'),'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 1a6860c..b41bf2f 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 _0xfc27=['options','attributes','limit','include','map','model','GetServicenowAccount','ShowServicenowAccount','find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','then','info','ServicenowAccount,\x20%s,\x20%s','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','request\x20sent','result','catch','ServicenowAccount'];(function(_0x2ad248,_0x1330ed){var _0x425fb7=function(_0x3533eb){while(--_0x3533eb){_0x2ad248['push'](_0x2ad248['shift']());}};_0x425fb7(++_0x1330ed);}(_0xfc27,0xe9));var _0x7fc2=function(_0x2bc4ce,_0x175ef2){_0x2bc4ce=_0x2bc4ce-0x0;var _0x88a3f4=_0xfc27[_0x2bc4ce];return _0x88a3f4;};'use strict';var _=require(_0x7fc2('0x0'));var util=require(_0x7fc2('0x1'));var moment=require('moment');var BPromise=require(_0x7fc2('0x2'));var rs=require(_0x7fc2('0x3'));var fs=require('fs');var Redis=require(_0x7fc2('0x4'));var db=require(_0x7fc2('0x5'))['db'];var utils=require(_0x7fc2('0x6'));var logger=require(_0x7fc2('0x7'))('rpc');var config=require(_0x7fc2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7fc2('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x475491,_0x3e35dd,_0xa10e15){return new BPromise(function(_0x7e308a,_0x5c23f5){return client['request'](_0x475491,_0xa10e15)[_0x7fc2('0xa')](function(_0x40817a){logger[_0x7fc2('0xb')](_0x7fc2('0xc'),_0x3e35dd,'request\x20sent');logger[_0x7fc2('0xd')](_0x7fc2('0xe'),_0x3e35dd,'request\x20sent',JSON[_0x7fc2('0xf')](_0x40817a));if(_0x40817a['error']){if(_0x40817a['error'][_0x7fc2('0x10')]===0x1f4){logger[_0x7fc2('0x11')]('ServicenowAccount,\x20%s,\x20%s',_0x3e35dd,_0x40817a[_0x7fc2('0x11')][_0x7fc2('0x12')]);return _0x5c23f5(_0x40817a['error'][_0x7fc2('0x12')]);}logger[_0x7fc2('0x11')](_0x7fc2('0xc'),_0x3e35dd,_0x40817a['error']['message']);return _0x7e308a(_0x40817a['error']['message']);}else{logger[_0x7fc2('0xb')](_0x7fc2('0xc'),_0x3e35dd,_0x7fc2('0x13'));_0x7e308a(_0x40817a[_0x7fc2('0x14')][_0x7fc2('0x12')]);}})[_0x7fc2('0x15')](function(_0x4fabd9){logger['error'](_0x7fc2('0xc'),_0x3e35dd,_0x4fabd9);_0x5c23f5(_0x4fabd9);});});}exports['GetServicenowAccount']=function(_0x4dbbdc){var _0x3540d4=this;return new Promise(function(_0x467825,_0x4b0cf3){return db[_0x7fc2('0x16')]['findAll']({'raw':_0x4dbbdc[_0x7fc2('0x17')]?_0x4dbbdc[_0x7fc2('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x4dbbdc[_0x7fc2('0x17')]?_0x4dbbdc[_0x7fc2('0x17')]['where']||null:null,'attributes':_0x4dbbdc[_0x7fc2('0x17')]?_0x4dbbdc[_0x7fc2('0x17')][_0x7fc2('0x18')]||null:null,'limit':_0x4dbbdc[_0x7fc2('0x17')]?_0x4dbbdc[_0x7fc2('0x17')][_0x7fc2('0x19')]||null:null,'include':_0x4dbbdc[_0x7fc2('0x17')]?_0x4dbbdc['options'][_0x7fc2('0x1a')]?_['map'](_0x4dbbdc['options']['include'],function(_0x181785){return{'model':db[_0x181785['model']],'as':_0x181785['as'],'attributes':_0x181785[_0x7fc2('0x18')],'include':_0x181785['include']?_[_0x7fc2('0x1b')](_0x181785[_0x7fc2('0x1a')],function(_0x231054){return{'model':db[_0x231054['model']],'as':_0x231054['as'],'attributes':_0x231054[_0x7fc2('0x18')],'include':_0x231054['include']?_[_0x7fc2('0x1b')](_0x231054[_0x7fc2('0x1a')],function(_0x4bd6f0){return{'model':db[_0x4bd6f0[_0x7fc2('0x1c')]],'as':_0x4bd6f0['as'],'attributes':_0x4bd6f0['attributes']};}):[]};}):[]};}):[]:[]})[_0x7fc2('0xa')](function(_0x2582e9){logger['info'](_0x7fc2('0x1d'),_0x4dbbdc);logger['debug'](_0x7fc2('0x1d'),_0x4dbbdc,JSON[_0x7fc2('0xf')](_0x2582e9));_0x467825(_0x2582e9);})[_0x7fc2('0x15')](function(_0x5093d5){logger[_0x7fc2('0x11')]('GetServicenowAccount',_0x5093d5[_0x7fc2('0x12')],_0x4dbbdc);_0x4b0cf3(_0x3540d4[_0x7fc2('0x11')](0x1f4,_0x5093d5[_0x7fc2('0x12')]));});});};exports[_0x7fc2('0x1e')]=function(_0x48249a){var _0x4b5818=this;return new Promise(function(_0x1e3729,_0xcb855c){return db['ServicenowAccount'][_0x7fc2('0x1f')]({'raw':_0x48249a[_0x7fc2('0x17')]?_0x48249a[_0x7fc2('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x48249a[_0x7fc2('0x17')]?_0x48249a[_0x7fc2('0x17')]['where']||null:null,'attributes':_0x48249a[_0x7fc2('0x17')]?_0x48249a[_0x7fc2('0x17')][_0x7fc2('0x18')]||null:null,'include':_0x48249a[_0x7fc2('0x17')]?_0x48249a[_0x7fc2('0x17')][_0x7fc2('0x1a')]?_[_0x7fc2('0x1b')](_0x48249a['options'][_0x7fc2('0x1a')],function(_0x4bd463){return{'model':db[_0x4bd463[_0x7fc2('0x1c')]],'as':_0x4bd463['as'],'attributes':_0x4bd463['attributes'],'include':_0x4bd463[_0x7fc2('0x1a')]?_['map'](_0x4bd463[_0x7fc2('0x1a')],function(_0x27e441){return{'model':db[_0x27e441[_0x7fc2('0x1c')]],'as':_0x27e441['as'],'attributes':_0x27e441[_0x7fc2('0x18')],'include':_0x27e441['include']?_['map'](_0x27e441[_0x7fc2('0x1a')],function(_0xf9bb4){return{'model':db[_0xf9bb4[_0x7fc2('0x1c')]],'as':_0xf9bb4['as'],'attributes':_0xf9bb4[_0x7fc2('0x18')]};}):[]};}):[]};}):[]:[]})[_0x7fc2('0xa')](function(_0x37c7a6){logger[_0x7fc2('0xb')](_0x7fc2('0x1e'),_0x48249a);logger[_0x7fc2('0xd')](_0x7fc2('0x1e'),_0x48249a,JSON['stringify'](_0x37c7a6));_0x1e3729(_0x37c7a6);})['catch'](function(_0x14ad4c){logger[_0x7fc2('0x11')](_0x7fc2('0x1e'),_0x14ad4c[_0x7fc2('0x12')],_0x48249a);_0xcb855c(_0x4b5818[_0x7fc2('0x11')](0x1f4,_0x14ad4c[_0x7fc2('0x12')]));});});}; \ No newline at end of file +var _0x4520=['then','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','GetServicenowAccount','options','raw','where','attributes','limit','include','map','model','stringify','ShowServicenowAccount','find'];(function(_0x349d46,_0x224056){var _0x33456e=function(_0x53c027){while(--_0x53c027){_0x349d46['push'](_0x349d46['shift']());}};_0x33456e(++_0x224056);}(_0x4520,0x12a));var _0x0452=function(_0x3c9310,_0x58f0c7){_0x3c9310=_0x3c9310-0x0;var _0x24e56c=_0x4520[_0x3c9310];return _0x24e56c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0452('0x0'));var BPromise=require('bluebird');var rs=require(_0x0452('0x1'));var fs=require('fs');var Redis=require(_0x0452('0x2'));var db=require(_0x0452('0x3'))['db'];var utils=require(_0x0452('0x4'));var logger=require(_0x0452('0x5'))(_0x0452('0x6'));var config=require(_0x0452('0x7'));var jayson=require(_0x0452('0x8'));var client=jayson['client'][_0x0452('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xc314d8,_0xf13181,_0x3ce0de){return new BPromise(function(_0x40a7fb,_0x413e31){return client[_0x0452('0xa')](_0xc314d8,_0x3ce0de)['then'](function(_0x2253ab){logger['info'](_0x0452('0xb'),_0xf13181,_0x0452('0xc'));logger[_0x0452('0xd')](_0x0452('0xe'),_0xf13181,_0x0452('0xc'),JSON['stringify'](_0x2253ab));if(_0x2253ab[_0x0452('0xf')]){if(_0x2253ab[_0x0452('0xf')]['code']===0x1f4){logger['error'](_0x0452('0xb'),_0xf13181,_0x2253ab[_0x0452('0xf')][_0x0452('0x10')]);return _0x413e31(_0x2253ab[_0x0452('0xf')]['message']);}logger[_0x0452('0xf')]('ServicenowAccount,\x20%s,\x20%s',_0xf13181,_0x2253ab[_0x0452('0xf')][_0x0452('0x10')]);return _0x40a7fb(_0x2253ab[_0x0452('0xf')][_0x0452('0x10')]);}else{logger[_0x0452('0x11')]('ServicenowAccount,\x20%s,\x20%s',_0xf13181,'request\x20sent');_0x40a7fb(_0x2253ab[_0x0452('0x12')]['message']);}})[_0x0452('0x13')](function(_0x27cd43){logger['error'](_0x0452('0xb'),_0xf13181,_0x27cd43);_0x413e31(_0x27cd43);});});}exports[_0x0452('0x14')]=function(_0x3397e7){var _0x518c53=this;return new Promise(function(_0x2cff49,_0xe0bf7c){return db['ServicenowAccount']['findAll']({'raw':_0x3397e7[_0x0452('0x15')]?_0x3397e7[_0x0452('0x15')][_0x0452('0x16')]===undefined?!![]:![]:!![],'where':_0x3397e7[_0x0452('0x15')]?_0x3397e7['options'][_0x0452('0x17')]||null:null,'attributes':_0x3397e7[_0x0452('0x15')]?_0x3397e7[_0x0452('0x15')][_0x0452('0x18')]||null:null,'limit':_0x3397e7[_0x0452('0x15')]?_0x3397e7[_0x0452('0x15')][_0x0452('0x19')]||null:null,'include':_0x3397e7[_0x0452('0x15')]?_0x3397e7['options'][_0x0452('0x1a')]?_[_0x0452('0x1b')](_0x3397e7['options'][_0x0452('0x1a')],function(_0x238b56){return{'model':db[_0x238b56['model']],'as':_0x238b56['as'],'attributes':_0x238b56[_0x0452('0x18')],'include':_0x238b56[_0x0452('0x1a')]?_[_0x0452('0x1b')](_0x238b56[_0x0452('0x1a')],function(_0x4f2eae){return{'model':db[_0x4f2eae[_0x0452('0x1c')]],'as':_0x4f2eae['as'],'attributes':_0x4f2eae[_0x0452('0x18')],'include':_0x4f2eae[_0x0452('0x1a')]?_[_0x0452('0x1b')](_0x4f2eae['include'],function(_0x25e358){return{'model':db[_0x25e358[_0x0452('0x1c')]],'as':_0x25e358['as'],'attributes':_0x25e358[_0x0452('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x14e6ee){logger[_0x0452('0x11')](_0x0452('0x14'),_0x3397e7);logger[_0x0452('0xd')](_0x0452('0x14'),_0x3397e7,JSON[_0x0452('0x1d')](_0x14e6ee));_0x2cff49(_0x14e6ee);})[_0x0452('0x13')](function(_0x507cde){logger[_0x0452('0xf')](_0x0452('0x14'),_0x507cde[_0x0452('0x10')],_0x3397e7);_0xe0bf7c(_0x518c53[_0x0452('0xf')](0x1f4,_0x507cde[_0x0452('0x10')]));});});};exports[_0x0452('0x1e')]=function(_0x45b1b6){var _0x6020e3=this;return new Promise(function(_0x542be8,_0x267cf6){return db['ServicenowAccount'][_0x0452('0x1f')]({'raw':_0x45b1b6[_0x0452('0x15')]?_0x45b1b6[_0x0452('0x15')][_0x0452('0x16')]===undefined?!![]:![]:!![],'where':_0x45b1b6[_0x0452('0x15')]?_0x45b1b6[_0x0452('0x15')][_0x0452('0x17')]||null:null,'attributes':_0x45b1b6[_0x0452('0x15')]?_0x45b1b6[_0x0452('0x15')][_0x0452('0x18')]||null:null,'include':_0x45b1b6['options']?_0x45b1b6[_0x0452('0x15')][_0x0452('0x1a')]?_[_0x0452('0x1b')](_0x45b1b6[_0x0452('0x15')][_0x0452('0x1a')],function(_0x378366){return{'model':db[_0x378366['model']],'as':_0x378366['as'],'attributes':_0x378366[_0x0452('0x18')],'include':_0x378366[_0x0452('0x1a')]?_[_0x0452('0x1b')](_0x378366[_0x0452('0x1a')],function(_0xc927dc){return{'model':db[_0xc927dc[_0x0452('0x1c')]],'as':_0xc927dc['as'],'attributes':_0xc927dc[_0x0452('0x18')],'include':_0xc927dc['include']?_['map'](_0xc927dc[_0x0452('0x1a')],function(_0x981b36){return{'model':db[_0x981b36[_0x0452('0x1c')]],'as':_0x981b36['as'],'attributes':_0x981b36[_0x0452('0x18')]};}):[]};}):[]};}):[]:[]})[_0x0452('0x20')](function(_0x55a14b){logger['info']('ShowServicenowAccount',_0x45b1b6);logger[_0x0452('0xd')](_0x0452('0x1e'),_0x45b1b6,JSON[_0x0452('0x1d')](_0x55a14b));_0x542be8(_0x55a14b);})[_0x0452('0x13')](function(_0x416fea){logger['error']('ShowServicenowAccount',_0x416fea['message'],_0x45b1b6);_0x267cf6(_0x6020e3[_0x0452('0xf')](0x1f4,_0x416fea[_0x0452('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 09bb319..f845c02 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 _0x06dd=['express','fs-extra','../../components/auth/service','../../config/environment','./intServicenowConfiguration.controller','isAuthenticated','get','/:id','/:id/fields','getFields','/:id/subjects','getSubjects','create','put','update','delete','multer','util','connect-timeout'];(function(_0x15129,_0x1a8bb4){var _0x5b852a=function(_0x5dff3e){while(--_0x5dff3e){_0x15129['push'](_0x15129['shift']());}};_0x5b852a(++_0x1a8bb4);}(_0x06dd,0x107));var _0xd06d=function(_0x400294,_0x4317c6){_0x400294=_0x400294-0x0;var _0x5e7681=_0x06dd[_0x400294];return _0x5e7681;};'use strict';var multer=require(_0xd06d('0x0'));var util=require(_0xd06d('0x1'));var path=require('path');var timeout=require(_0xd06d('0x2'));var express=require(_0xd06d('0x3'));var router=express['Router']();var fs_extra=require(_0xd06d('0x4'));var auth=require(_0xd06d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd06d('0x6'));var controller=require(_0xd06d('0x7'));router['get']('/',auth[_0xd06d('0x8')](),controller['index']);router[_0xd06d('0x9')](_0xd06d('0xa'),auth[_0xd06d('0x8')](),controller['show']);router['get'](_0xd06d('0xb'),auth[_0xd06d('0x8')](),controller[_0xd06d('0xc')]);router[_0xd06d('0x9')](_0xd06d('0xd'),auth[_0xd06d('0x8')](),controller[_0xd06d('0xe')]);router[_0xd06d('0x9')]('/:id/descriptions',auth['isAuthenticated'](),controller['getDescriptions']);router['post']('/',auth['isAuthenticated'](),controller[_0xd06d('0xf')]);router[_0xd06d('0x10')]('/:id',auth[_0xd06d('0x8')](),controller[_0xd06d('0x11')]);router[_0xd06d('0x12')](_0xd06d('0xa'),auth[_0xd06d('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xbe76=['./intServicenowConfiguration.controller','index','get','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x38128e,_0x5ee4de){var _0x4abcf4=function(_0x2aea40){while(--_0x2aea40){_0x38128e['push'](_0x38128e['shift']());}};_0x4abcf4(++_0x5ee4de);}(_0xbe76,0x149));var _0x6be7=function(_0x21f9c2,_0x2b3d2a){_0x21f9c2=_0x21f9c2-0x0;var _0x3da17f=_0xbe76[_0x21f9c2];return _0x3da17f;};'use strict';var multer=require('multer');var util=require(_0x6be7('0x0'));var path=require(_0x6be7('0x1'));var timeout=require(_0x6be7('0x2'));var express=require(_0x6be7('0x3'));var router=express[_0x6be7('0x4')]();var fs_extra=require(_0x6be7('0x5'));var auth=require(_0x6be7('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6be7('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x6be7('0x8')]);router[_0x6be7('0x9')](_0x6be7('0xa'),auth[_0x6be7('0xb')](),controller[_0x6be7('0xc')]);router['get'](_0x6be7('0xd'),auth[_0x6be7('0xb')](),controller[_0x6be7('0xe')]);router[_0x6be7('0x9')](_0x6be7('0xf'),auth[_0x6be7('0xb')](),controller[_0x6be7('0x10')]);router['get'](_0x6be7('0x11'),auth[_0x6be7('0xb')](),controller[_0x6be7('0x12')]);router[_0x6be7('0x13')]('/',auth[_0x6be7('0xb')](),controller[_0x6be7('0x14')]);router['put'](_0x6be7('0xa'),auth[_0x6be7('0xb')](),controller[_0x6be7('0x15')]);router['delete'](_0x6be7('0xa'),auth[_0x6be7('0xb')](),controller[_0x6be7('0x16')]);module[_0x6be7('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 c402c1f..844e991 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 _0x7d96=['STRING','sequelize'];(function(_0x3149b8,_0x213f9f){var _0x216ca1=function(_0x3c39ef){while(--_0x3c39ef){_0x3149b8['push'](_0x3149b8['shift']());}};_0x216ca1(++_0x213f9f);}(_0x7d96,0x155));var _0x67d9=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7d96[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x67d9('0x0'));module['exports']={'name':{'type':Sequelize[_0x67d9('0x1')]},'description':{'type':Sequelize[_0x67d9('0x1')]}}; \ No newline at end of file +var _0x908d=['STRING','exports'];(function(_0x367abb,_0x30d4da){var _0x3e8d3b=function(_0xf07444){while(--_0xf07444){_0x367abb['push'](_0x367abb['shift']());}};_0x3e8d3b(++_0x30d4da);}(_0x908d,0x10f));var _0xd908=function(_0x51f8cd,_0x59bff3){_0x51f8cd=_0x51f8cd-0x0;var _0x5c1603=_0x908d[_0x51f8cd];return _0x5c1603;};'use strict';var Sequelize=require('sequelize');module[_0xd908('0x0')]={'name':{'type':Sequelize[_0xd908('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 6969187..c6b57a0 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 _0x81d1=['../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','error','stack','name','send','index','map','ServicenowConfiguration','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','params','length','includeAll','find','catch','body','destroy','getFields','findOne','ServicenowField','getSubjects','getDescriptions','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api'];(function(_0x35175a,_0x4c63d7){var _0x3c02ed=function(_0x261fe2){while(--_0x261fe2){_0x35175a['push'](_0x35175a['shift']());}};_0x3c02ed(++_0x4c63d7);}(_0x81d1,0x1bb));var _0x181d=function(_0xcf581b,_0x4359dd){_0xcf581b=_0xcf581b-0x0;var _0x4f454d=_0x81d1[_0xcf581b];return _0x4f454d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x181d('0x0'));var moment=require(_0x181d('0x1'));var BPromise=require(_0x181d('0x2'));var Mustache=require(_0x181d('0x3'));var util=require('util');var path=require(_0x181d('0x4'));var sox=require(_0x181d('0x5'));var csv=require(_0x181d('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x181d('0x7'));var squel=require(_0x181d('0x8'));var crypto=require(_0x181d('0x9'));var jsforce=require(_0x181d('0xa'));var deskjs=require(_0x181d('0xb'));var toCsv=require(_0x181d('0x6'));var querystring=require('querystring');var Papa=require(_0x181d('0xc'));var Redis=require(_0x181d('0xd'));var authService=require(_0x181d('0xe'));var qs=require(_0x181d('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x181d('0x10'));var logger=require(_0x181d('0x11'))(_0x181d('0x12'));var utils=require(_0x181d('0x13'));var config=require(_0x181d('0x14'));var licenseUtil=require(_0x181d('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x577227,_0x33633c){_0x33633c=_0x33633c||0xcc;return function(_0x584be9){if(_0x584be9){return _0x577227[_0x181d('0x16')](_0x33633c);}return _0x577227[_0x181d('0x17')](_0x33633c)[_0x181d('0x18')]();};}function respondWithResult(_0x12e8d6,_0x41bacd){_0x41bacd=_0x41bacd||0xc8;return function(_0x4ed547){if(_0x4ed547){return _0x12e8d6[_0x181d('0x17')](_0x41bacd)[_0x181d('0x19')](_0x4ed547);}};}function respondWithFilteredResult(_0x34e4b1,_0x31bb17){return function(_0xcf8e99){if(_0xcf8e99){var _0x4b74fb=typeof _0x31bb17[_0x181d('0x1a')]===_0x181d('0x1b')&&typeof _0x31bb17['limit']===_0x181d('0x1b');var _0x374012=_0xcf8e99[_0x181d('0x1c')];var _0x111308=_0x4b74fb?0x0:_0x31bb17[_0x181d('0x1a')];var _0xcd655f=_0x4b74fb?_0xcf8e99['count']:_0x31bb17[_0x181d('0x1a')]+_0x31bb17[_0x181d('0x1d')];var _0x2043bc;if(_0xcd655f>=_0x374012){_0xcd655f=_0x374012;_0x2043bc=0xc8;}else{_0x2043bc=0xce;}_0x34e4b1[_0x181d('0x17')](_0x2043bc);return _0x34e4b1[_0x181d('0x1e')](_0x181d('0x1f'),_0x111308+'-'+_0xcd655f+'/'+_0x374012)['json'](_0xcf8e99);}return null;};}function patchUpdates(_0x239bbd){return function(_0x81fd61){try{jsonpatch[_0x181d('0x20')](_0x81fd61,_0x239bbd,!![]);}catch(_0x8e454b){return BPromise['reject'](_0x8e454b);}return _0x81fd61[_0x181d('0x21')]();};}function saveUpdates(_0x56df31,_0x32e2a9){return function(_0x33e204){if(_0x33e204){return _0x33e204[_0x181d('0x22')](_0x56df31)[_0x181d('0x23')](function(_0x1251ca){return _0x1251ca;});}return null;};}function removeEntity(_0x2f457d,_0x4bb384){return function(_0x1a5216){if(_0x1a5216){return _0x1a5216['destroy']()[_0x181d('0x23')](function(){_0x2f457d[_0x181d('0x17')](0xcc)[_0x181d('0x18')]();});}};}function handleEntityNotFound(_0x5cf67a,_0x1b6d3b){return function(_0x56d7e5){if(!_0x56d7e5){_0x5cf67a[_0x181d('0x16')](0x194);}return _0x56d7e5;};}function handleError(_0x15e4fd,_0x162604){_0x162604=_0x162604||0x1f4;return function(_0x274039){logger[_0x181d('0x24')](_0x274039[_0x181d('0x25')]);if(_0x274039['name']){delete _0x274039[_0x181d('0x26')];}_0x15e4fd[_0x181d('0x17')](_0x162604)[_0x181d('0x27')](_0x274039);};}exports[_0x181d('0x28')]=function(_0x26e2da,_0x43b10d){var _0x48a3d5={},_0x3ac622={},_0x1439bf={'count':0x0,'rows':[]};var _0x1b1a01=_[_0x181d('0x29')](db[_0x181d('0x2a')][_0x181d('0x2b')],function(_0x1f15ce){return{'name':_0x1f15ce[_0x181d('0x2c')],'type':_0x1f15ce[_0x181d('0x2d')]['key']};});_0x3ac622[_0x181d('0x2e')]=_[_0x181d('0x29')](_0x1b1a01,_0x181d('0x26'));_0x3ac622[_0x181d('0x2f')]=_[_0x181d('0x30')](_0x26e2da[_0x181d('0x2f')]);_0x3ac622[_0x181d('0x31')]=_[_0x181d('0x32')](_0x3ac622[_0x181d('0x2e')],_0x3ac622[_0x181d('0x2f')]);_0x48a3d5['attributes']=_[_0x181d('0x32')](_0x3ac622[_0x181d('0x2e')],qs[_0x181d('0x33')](_0x26e2da[_0x181d('0x2f')][_0x181d('0x33')]));_0x48a3d5[_0x181d('0x34')]=_0x48a3d5[_0x181d('0x34')]['length']?_0x48a3d5[_0x181d('0x34')]:_0x3ac622[_0x181d('0x2e')];if(!_0x26e2da[_0x181d('0x2f')][_0x181d('0x35')](_0x181d('0x36'))){_0x48a3d5['limit']=qs[_0x181d('0x1d')](_0x26e2da[_0x181d('0x2f')][_0x181d('0x1d')]);_0x48a3d5[_0x181d('0x1a')]=qs[_0x181d('0x1a')](_0x26e2da[_0x181d('0x2f')][_0x181d('0x1a')]);}_0x48a3d5[_0x181d('0x37')]=qs[_0x181d('0x38')](_0x26e2da[_0x181d('0x2f')][_0x181d('0x38')]);_0x48a3d5[_0x181d('0x39')]=qs[_0x181d('0x31')](_[_0x181d('0x3a')](_0x26e2da[_0x181d('0x2f')],_0x3ac622[_0x181d('0x31')]),_0x1b1a01);if(_0x26e2da[_0x181d('0x2f')][_0x181d('0x3b')]){_0x48a3d5['where']=_[_0x181d('0x3c')](_0x48a3d5[_0x181d('0x39')],{'$or':_[_0x181d('0x29')](_0x1b1a01,function(_0x4b57f6){if(_0x4b57f6[_0x181d('0x2d')]!=='VIRTUAL'){var _0x2fcbd3={};_0x2fcbd3[_0x4b57f6[_0x181d('0x26')]]={'$like':'%'+_0x26e2da['query']['filter']+'%'};return _0x2fcbd3;}})});}_0x48a3d5=_['merge']({},_0x48a3d5,_0x26e2da[_0x181d('0x3d')]);var _0x2dbc79={'where':_0x48a3d5[_0x181d('0x39')]};return db[_0x181d('0x2a')][_0x181d('0x1c')](_0x2dbc79)[_0x181d('0x23')](function(_0x144eea){_0x1439bf[_0x181d('0x1c')]=_0x144eea;if(_0x26e2da['query']['includeAll']){_0x48a3d5[_0x181d('0x3e')]=[{'all':!![]}];}return db[_0x181d('0x2a')][_0x181d('0x3f')](_0x48a3d5);})[_0x181d('0x23')](function(_0x38ab77){_0x1439bf[_0x181d('0x40')]=_0x38ab77;return _0x1439bf;})[_0x181d('0x23')](respondWithFilteredResult(_0x43b10d,_0x48a3d5))['catch'](handleError(_0x43b10d,null));};exports['show']=function(_0x578c25,_0xe1fc2d){var _0xfed823={'raw':![],'where':{'id':_0x578c25[_0x181d('0x41')]['id']}},_0x12d076={};_0x12d076['model']=_[_0x181d('0x30')](db[_0x181d('0x2a')]['rawAttributes']);_0x12d076['query']=_[_0x181d('0x30')](_0x578c25[_0x181d('0x2f')]);_0x12d076[_0x181d('0x31')]=_['intersection'](_0x12d076[_0x181d('0x2e')],_0x12d076[_0x181d('0x2f')]);_0xfed823['attributes']=_[_0x181d('0x32')](_0x12d076[_0x181d('0x2e')],qs[_0x181d('0x33')](_0x578c25[_0x181d('0x2f')][_0x181d('0x33')]));_0xfed823[_0x181d('0x34')]=_0xfed823[_0x181d('0x34')][_0x181d('0x42')]?_0xfed823[_0x181d('0x34')]:_0x12d076[_0x181d('0x2e')];if(_0x578c25[_0x181d('0x2f')][_0x181d('0x43')]){_0xfed823[_0x181d('0x3e')]=[{'all':!![]}];}_0xfed823=_[_0x181d('0x3c')]({},_0xfed823,_0x578c25['options']);return db['ServicenowConfiguration'][_0x181d('0x44')](_0xfed823)[_0x181d('0x23')](handleEntityNotFound(_0xe1fc2d,null))[_0x181d('0x23')](respondWithResult(_0xe1fc2d,null))[_0x181d('0x45')](handleError(_0xe1fc2d,null));};exports['create']=function(_0x548ec8,_0x2befca){return db[_0x181d('0x2a')]['create'](_0x548ec8[_0x181d('0x46')],{})['then'](respondWithResult(_0x2befca,0xc9))[_0x181d('0x45')](handleError(_0x2befca,null));};exports[_0x181d('0x22')]=function(_0x145a29,_0x1d0ff8){if(_0x145a29[_0x181d('0x46')]['id']){delete _0x145a29['body']['id'];}return db[_0x181d('0x2a')][_0x181d('0x44')]({'where':{'id':_0x145a29[_0x181d('0x41')]['id']}})[_0x181d('0x23')](handleEntityNotFound(_0x1d0ff8,null))[_0x181d('0x23')](saveUpdates(_0x145a29[_0x181d('0x46')],null))[_0x181d('0x23')](respondWithResult(_0x1d0ff8,null))[_0x181d('0x45')](handleError(_0x1d0ff8,null));};exports[_0x181d('0x47')]=function(_0x2ac178,_0x5e63ea){return db[_0x181d('0x2a')][_0x181d('0x44')]({'where':{'id':_0x2ac178[_0x181d('0x41')]['id']}})['then'](handleEntityNotFound(_0x5e63ea,null))[_0x181d('0x23')](removeEntity(_0x5e63ea,null))[_0x181d('0x45')](handleError(_0x5e63ea,null));};exports[_0x181d('0x48')]=function(_0x4f8cc2,_0x2c809c,_0x3fd267){var _0x177e07={};var _0x1554db={};var _0x76b712;var _0x256e3e;return db[_0x181d('0x2a')][_0x181d('0x49')]({'where':{'id':_0x4f8cc2[_0x181d('0x41')]['id']}})['then'](handleEntityNotFound(_0x2c809c,null))[_0x181d('0x23')](function(_0x2174fa){if(_0x2174fa){_0x76b712=_0x2174fa;_0x1554db['model']=_[_0x181d('0x30')](db[_0x181d('0x4a')][_0x181d('0x2b')]);_0x1554db[_0x181d('0x2f')]=_[_0x181d('0x30')](_0x4f8cc2[_0x181d('0x2f')]);_0x1554db[_0x181d('0x31')]=_[_0x181d('0x32')](_0x1554db[_0x181d('0x2e')],_0x1554db[_0x181d('0x2f')]);_0x177e07[_0x181d('0x34')]=_['intersection'](_0x1554db[_0x181d('0x2e')],qs[_0x181d('0x33')](_0x4f8cc2['query'][_0x181d('0x33')]));_0x177e07[_0x181d('0x34')]=_0x177e07[_0x181d('0x34')][_0x181d('0x42')]?_0x177e07[_0x181d('0x34')]:_0x1554db[_0x181d('0x2e')];_0x177e07['order']=qs[_0x181d('0x38')](_0x4f8cc2[_0x181d('0x2f')]['sort']);_0x177e07[_0x181d('0x39')]=qs[_0x181d('0x31')](_[_0x181d('0x3a')](_0x4f8cc2[_0x181d('0x2f')],_0x1554db[_0x181d('0x31')]));if(_0x4f8cc2[_0x181d('0x2f')][_0x181d('0x3b')]){_0x177e07[_0x181d('0x39')]=_[_0x181d('0x3c')](_0x177e07[_0x181d('0x39')],{'$or':_[_0x181d('0x29')](_0x177e07[_0x181d('0x34')],function(_0x4b37af){var _0x1d94be={};_0x1d94be[_0x4b37af]={'$like':'%'+_0x4f8cc2['query'][_0x181d('0x3b')]+'%'};return _0x1d94be;})});}_0x177e07=_[_0x181d('0x3c')]({},_0x177e07,_0x4f8cc2[_0x181d('0x3d')]);return _0x76b712[_0x181d('0x48')](_0x177e07);}})[_0x181d('0x23')](function(_0x1c944e){if(_0x1c944e){_0x256e3e=_0x1c944e[_0x181d('0x42')];if(!_0x4f8cc2[_0x181d('0x2f')][_0x181d('0x35')](_0x181d('0x36'))){_0x177e07[_0x181d('0x1d')]=qs[_0x181d('0x1d')](_0x4f8cc2['query'][_0x181d('0x1d')]);_0x177e07['offset']=qs['offset'](_0x4f8cc2[_0x181d('0x2f')][_0x181d('0x1a')]);}return _0x76b712[_0x181d('0x48')](_0x177e07);}})[_0x181d('0x23')](function(_0x26be5f){if(_0x26be5f){return _0x26be5f?{'count':_0x256e3e,'rows':_0x26be5f}:null;}})[_0x181d('0x23')](respondWithResult(_0x2c809c,null))[_0x181d('0x45')](handleError(_0x2c809c,null));};exports['getSubjects']=function(_0xd4186e,_0xeaeda1,_0x4056d1){var _0x374e07={};var _0x56e978={};var _0x1e97b6;var _0x1077c3;return db['ServicenowConfiguration'][_0x181d('0x49')]({'where':{'id':_0xd4186e[_0x181d('0x41')]['id']}})[_0x181d('0x23')](handleEntityNotFound(_0xeaeda1,null))[_0x181d('0x23')](function(_0x5c3e56){if(_0x5c3e56){_0x1e97b6=_0x5c3e56;_0x56e978['model']=_[_0x181d('0x30')](db[_0x181d('0x4a')]['rawAttributes']);_0x56e978[_0x181d('0x2f')]=_[_0x181d('0x30')](_0xd4186e[_0x181d('0x2f')]);_0x56e978[_0x181d('0x31')]=_[_0x181d('0x32')](_0x56e978['model'],_0x56e978[_0x181d('0x2f')]);_0x374e07[_0x181d('0x34')]=_['intersection'](_0x56e978[_0x181d('0x2e')],qs[_0x181d('0x33')](_0xd4186e[_0x181d('0x2f')][_0x181d('0x33')]));_0x374e07[_0x181d('0x34')]=_0x374e07[_0x181d('0x34')][_0x181d('0x42')]?_0x374e07[_0x181d('0x34')]:_0x56e978[_0x181d('0x2e')];_0x374e07[_0x181d('0x37')]=qs['sort'](_0xd4186e[_0x181d('0x2f')]['sort']);_0x374e07[_0x181d('0x39')]=qs['filters'](_[_0x181d('0x3a')](_0xd4186e['query'],_0x56e978[_0x181d('0x31')]));if(_0xd4186e[_0x181d('0x2f')][_0x181d('0x3b')]){_0x374e07[_0x181d('0x39')]=_[_0x181d('0x3c')](_0x374e07[_0x181d('0x39')],{'$or':_['map'](_0x374e07['attributes'],function(_0x117efa){var _0x434639={};_0x434639[_0x117efa]={'$like':'%'+_0xd4186e[_0x181d('0x2f')][_0x181d('0x3b')]+'%'};return _0x434639;})});}_0x374e07=_[_0x181d('0x3c')]({},_0x374e07,_0xd4186e[_0x181d('0x3d')]);return _0x1e97b6[_0x181d('0x4b')](_0x374e07);}})[_0x181d('0x23')](function(_0x139a79){if(_0x139a79){_0x1077c3=_0x139a79['length'];if(!_0xd4186e['query'][_0x181d('0x35')]('nolimit')){_0x374e07['limit']=qs[_0x181d('0x1d')](_0xd4186e['query'][_0x181d('0x1d')]);_0x374e07[_0x181d('0x1a')]=qs[_0x181d('0x1a')](_0xd4186e[_0x181d('0x2f')][_0x181d('0x1a')]);}return _0x1e97b6[_0x181d('0x4b')](_0x374e07);}})[_0x181d('0x23')](function(_0x5482d1){if(_0x5482d1){return _0x5482d1?{'count':_0x1077c3,'rows':_0x5482d1}:null;}})['then'](respondWithResult(_0xeaeda1,null))[_0x181d('0x45')](handleError(_0xeaeda1,null));};exports[_0x181d('0x4c')]=function(_0x133587,_0x3b37dd,_0x114d70){var _0xf2313b={};var _0x5d39c0={};var _0x5a7af2;var _0x6804b9;return db[_0x181d('0x2a')][_0x181d('0x49')]({'where':{'id':_0x133587[_0x181d('0x41')]['id']}})['then'](handleEntityNotFound(_0x3b37dd,null))[_0x181d('0x23')](function(_0x5140ed){if(_0x5140ed){_0x5a7af2=_0x5140ed;_0x5d39c0[_0x181d('0x2e')]=_['keys'](db[_0x181d('0x4a')][_0x181d('0x2b')]);_0x5d39c0[_0x181d('0x2f')]=_[_0x181d('0x30')](_0x133587[_0x181d('0x2f')]);_0x5d39c0[_0x181d('0x31')]=_[_0x181d('0x32')](_0x5d39c0[_0x181d('0x2e')],_0x5d39c0[_0x181d('0x2f')]);_0xf2313b[_0x181d('0x34')]=_['intersection'](_0x5d39c0[_0x181d('0x2e')],qs['fields'](_0x133587['query'][_0x181d('0x33')]));_0xf2313b[_0x181d('0x34')]=_0xf2313b[_0x181d('0x34')][_0x181d('0x42')]?_0xf2313b[_0x181d('0x34')]:_0x5d39c0[_0x181d('0x2e')];_0xf2313b[_0x181d('0x37')]=qs[_0x181d('0x38')](_0x133587['query'][_0x181d('0x38')]);_0xf2313b['where']=qs['filters'](_[_0x181d('0x3a')](_0x133587[_0x181d('0x2f')],_0x5d39c0[_0x181d('0x31')]));if(_0x133587[_0x181d('0x2f')][_0x181d('0x3b')]){_0xf2313b['where']=_[_0x181d('0x3c')](_0xf2313b[_0x181d('0x39')],{'$or':_[_0x181d('0x29')](_0xf2313b['attributes'],function(_0x11371b){var _0x258229={};_0x258229[_0x11371b]={'$like':'%'+_0x133587[_0x181d('0x2f')]['filter']+'%'};return _0x258229;})});}_0xf2313b=_[_0x181d('0x3c')]({},_0xf2313b,_0x133587[_0x181d('0x3d')]);return _0x5a7af2[_0x181d('0x4c')](_0xf2313b);}})[_0x181d('0x23')](function(_0x32a03e){if(_0x32a03e){_0x6804b9=_0x32a03e[_0x181d('0x42')];if(!_0x133587['query'][_0x181d('0x35')](_0x181d('0x36'))){_0xf2313b[_0x181d('0x1d')]=qs[_0x181d('0x1d')](_0x133587[_0x181d('0x2f')][_0x181d('0x1d')]);_0xf2313b['offset']=qs['offset'](_0x133587[_0x181d('0x2f')]['offset']);}return _0x5a7af2[_0x181d('0x4c')](_0xf2313b);}})[_0x181d('0x23')](function(_0x3663a9){if(_0x3663a9){return _0x3663a9?{'count':_0x6804b9,'rows':_0x3663a9}:null;}})[_0x181d('0x23')](respondWithResult(_0x3b37dd,null))['catch'](handleError(_0x3b37dd,null));}; \ No newline at end of file +var _0x93cb=['rawAttributes','type','key','model','map','keys','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','options','ServicenowConfiguration','includeAll','include','findAll','catch','create','update','body','find','params','destroy','getFields','ServicenowField','hasOwnProperty','getSubjects','getDescriptions','findOne','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','offset','undefined','count','limit','status','Content-Range','apply','reject','save','then','error','stack','name','send','index'];(function(_0x2e10fd,_0x360b2c){var _0x512d8f=function(_0x3fb690){while(--_0x3fb690){_0x2e10fd['push'](_0x2e10fd['shift']());}};_0x512d8f(++_0x360b2c);}(_0x93cb,0xc3));var _0xb93c=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0x93cb[_0x122096];return _0x3d1966;};'use strict';var emlformat=require(_0xb93c('0x0'));var rimraf=require(_0xb93c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb93c('0x2'));var moment=require(_0xb93c('0x3'));var BPromise=require(_0xb93c('0x4'));var Mustache=require(_0xb93c('0x5'));var util=require('util');var path=require(_0xb93c('0x6'));var sox=require(_0xb93c('0x7'));var csv=require('to-csv');var ejs=require(_0xb93c('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb93c('0x9'));var crypto=require(_0xb93c('0xa'));var jsforce=require(_0xb93c('0xb'));var deskjs=require(_0xb93c('0xc'));var toCsv=require(_0xb93c('0xd'));var querystring=require(_0xb93c('0xe'));var Papa=require(_0xb93c('0xf'));var Redis=require(_0xb93c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xb93c('0x11'));var as=require(_0xb93c('0x12'));var hardwareService=require(_0xb93c('0x13'));var logger=require(_0xb93c('0x14'))('api');var utils=require(_0xb93c('0x15'));var config=require(_0xb93c('0x16'));var licenseUtil=require(_0xb93c('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3843ca,_0x3e154f){_0x3e154f=_0x3e154f||0xcc;return function(_0x3a4ff6){if(_0x3a4ff6){return _0x3843ca[_0xb93c('0x18')](_0x3e154f);}return _0x3843ca['status'](_0x3e154f)[_0xb93c('0x19')]();};}function respondWithResult(_0x1e7a5c,_0x3fd22a){_0x3fd22a=_0x3fd22a||0xc8;return function(_0x34882d){if(_0x34882d){return _0x1e7a5c['status'](_0x3fd22a)[_0xb93c('0x1a')](_0x34882d);}};}function respondWithFilteredResult(_0x52a032,_0x189011){return function(_0x17842a){if(_0x17842a){var _0x3608d4=typeof _0x189011[_0xb93c('0x1b')]===_0xb93c('0x1c')&&typeof _0x189011['limit']===_0xb93c('0x1c');var _0x3e7562=_0x17842a[_0xb93c('0x1d')];var _0x47f2bf=_0x3608d4?0x0:_0x189011[_0xb93c('0x1b')];var _0x517488=_0x3608d4?_0x17842a['count']:_0x189011[_0xb93c('0x1b')]+_0x189011[_0xb93c('0x1e')];var _0x4043c0;if(_0x517488>=_0x3e7562){_0x517488=_0x3e7562;_0x4043c0=0xc8;}else{_0x4043c0=0xce;}_0x52a032[_0xb93c('0x1f')](_0x4043c0);return _0x52a032['set'](_0xb93c('0x20'),_0x47f2bf+'-'+_0x517488+'/'+_0x3e7562)[_0xb93c('0x1a')](_0x17842a);}return null;};}function patchUpdates(_0x279f2e){return function(_0x2d3e49){try{jsonpatch[_0xb93c('0x21')](_0x2d3e49,_0x279f2e,!![]);}catch(_0xc873bc){return BPromise[_0xb93c('0x22')](_0xc873bc);}return _0x2d3e49[_0xb93c('0x23')]();};}function saveUpdates(_0x3e4f52,_0x39ca4f){return function(_0x591b54){if(_0x591b54){return _0x591b54['update'](_0x3e4f52)[_0xb93c('0x24')](function(_0x21bade){return _0x21bade;});}return null;};}function removeEntity(_0x2f1262,_0x150aa8){return function(_0x787986){if(_0x787986){return _0x787986['destroy']()[_0xb93c('0x24')](function(){_0x2f1262[_0xb93c('0x1f')](0xcc)[_0xb93c('0x19')]();});}};}function handleEntityNotFound(_0x304bd5,_0x1c8176){return function(_0x18231b){if(!_0x18231b){_0x304bd5[_0xb93c('0x18')](0x194);}return _0x18231b;};}function handleError(_0x1a73e2,_0x26d2f3){_0x26d2f3=_0x26d2f3||0x1f4;return function(_0x49f93a){logger[_0xb93c('0x25')](_0x49f93a[_0xb93c('0x26')]);if(_0x49f93a[_0xb93c('0x27')]){delete _0x49f93a[_0xb93c('0x27')];}_0x1a73e2[_0xb93c('0x1f')](_0x26d2f3)[_0xb93c('0x28')](_0x49f93a);};}exports[_0xb93c('0x29')]=function(_0x1cb9b9,_0x376b70){var _0xdca86c={},_0x2ecbe6={},_0x3888fd={'count':0x0,'rows':[]};var _0x42cd47=_['map'](db['ServicenowConfiguration'][_0xb93c('0x2a')],function(_0x53c3e0){return{'name':_0x53c3e0['fieldName'],'type':_0x53c3e0[_0xb93c('0x2b')][_0xb93c('0x2c')]};});_0x2ecbe6[_0xb93c('0x2d')]=_[_0xb93c('0x2e')](_0x42cd47,_0xb93c('0x27'));_0x2ecbe6['query']=_[_0xb93c('0x2f')](_0x1cb9b9[_0xb93c('0x30')]);_0x2ecbe6['filters']=_[_0xb93c('0x31')](_0x2ecbe6[_0xb93c('0x2d')],_0x2ecbe6[_0xb93c('0x30')]);_0xdca86c[_0xb93c('0x32')]=_[_0xb93c('0x31')](_0x2ecbe6[_0xb93c('0x2d')],qs[_0xb93c('0x33')](_0x1cb9b9[_0xb93c('0x30')][_0xb93c('0x33')]));_0xdca86c[_0xb93c('0x32')]=_0xdca86c[_0xb93c('0x32')][_0xb93c('0x34')]?_0xdca86c[_0xb93c('0x32')]:_0x2ecbe6[_0xb93c('0x2d')];if(!_0x1cb9b9[_0xb93c('0x30')]['hasOwnProperty'](_0xb93c('0x35'))){_0xdca86c['limit']=qs[_0xb93c('0x1e')](_0x1cb9b9[_0xb93c('0x30')]['limit']);_0xdca86c[_0xb93c('0x1b')]=qs[_0xb93c('0x1b')](_0x1cb9b9['query']['offset']);}_0xdca86c[_0xb93c('0x36')]=qs[_0xb93c('0x37')](_0x1cb9b9[_0xb93c('0x30')][_0xb93c('0x37')]);_0xdca86c[_0xb93c('0x38')]=qs[_0xb93c('0x39')](_[_0xb93c('0x3a')](_0x1cb9b9['query'],_0x2ecbe6[_0xb93c('0x39')]),_0x42cd47);if(_0x1cb9b9[_0xb93c('0x30')][_0xb93c('0x3b')]){_0xdca86c[_0xb93c('0x38')]=_[_0xb93c('0x3c')](_0xdca86c[_0xb93c('0x38')],{'$or':_[_0xb93c('0x2e')](_0x42cd47,function(_0x8fb961){if(_0x8fb961[_0xb93c('0x2b')]!=='VIRTUAL'){var _0x3de3f6={};_0x3de3f6[_0x8fb961['name']]={'$like':'%'+_0x1cb9b9[_0xb93c('0x30')][_0xb93c('0x3b')]+'%'};return _0x3de3f6;}})});}_0xdca86c=_['merge']({},_0xdca86c,_0x1cb9b9[_0xb93c('0x3d')]);var _0x53f12c={'where':_0xdca86c[_0xb93c('0x38')]};return db[_0xb93c('0x3e')]['count'](_0x53f12c)[_0xb93c('0x24')](function(_0x34a1d0){_0x3888fd[_0xb93c('0x1d')]=_0x34a1d0;if(_0x1cb9b9[_0xb93c('0x30')][_0xb93c('0x3f')]){_0xdca86c[_0xb93c('0x40')]=[{'all':!![]}];}return db[_0xb93c('0x3e')][_0xb93c('0x41')](_0xdca86c);})['then'](function(_0x5ead83){_0x3888fd['rows']=_0x5ead83;return _0x3888fd;})[_0xb93c('0x24')](respondWithFilteredResult(_0x376b70,_0xdca86c))[_0xb93c('0x42')](handleError(_0x376b70,null));};exports['show']=function(_0x150805,_0x22f2c8){var _0x196d1c={'raw':![],'where':{'id':_0x150805['params']['id']}},_0x8be6f3={};_0x8be6f3[_0xb93c('0x2d')]=_[_0xb93c('0x2f')](db[_0xb93c('0x3e')]['rawAttributes']);_0x8be6f3['query']=_['keys'](_0x150805[_0xb93c('0x30')]);_0x8be6f3[_0xb93c('0x39')]=_[_0xb93c('0x31')](_0x8be6f3[_0xb93c('0x2d')],_0x8be6f3[_0xb93c('0x30')]);_0x196d1c['attributes']=_['intersection'](_0x8be6f3['model'],qs[_0xb93c('0x33')](_0x150805[_0xb93c('0x30')][_0xb93c('0x33')]));_0x196d1c[_0xb93c('0x32')]=_0x196d1c[_0xb93c('0x32')][_0xb93c('0x34')]?_0x196d1c['attributes']:_0x8be6f3['model'];if(_0x150805[_0xb93c('0x30')][_0xb93c('0x3f')]){_0x196d1c[_0xb93c('0x40')]=[{'all':!![]}];}_0x196d1c=_['merge']({},_0x196d1c,_0x150805[_0xb93c('0x3d')]);return db['ServicenowConfiguration']['find'](_0x196d1c)[_0xb93c('0x24')](handleEntityNotFound(_0x22f2c8,null))[_0xb93c('0x24')](respondWithResult(_0x22f2c8,null))[_0xb93c('0x42')](handleError(_0x22f2c8,null));};exports[_0xb93c('0x43')]=function(_0x58e1b8,_0x28dfcd){return db['ServicenowConfiguration'][_0xb93c('0x43')](_0x58e1b8['body'],{})[_0xb93c('0x24')](respondWithResult(_0x28dfcd,0xc9))[_0xb93c('0x42')](handleError(_0x28dfcd,null));};exports[_0xb93c('0x44')]=function(_0x57a13f,_0x399a22){if(_0x57a13f[_0xb93c('0x45')]['id']){delete _0x57a13f[_0xb93c('0x45')]['id'];}return db[_0xb93c('0x3e')][_0xb93c('0x46')]({'where':{'id':_0x57a13f[_0xb93c('0x47')]['id']}})[_0xb93c('0x24')](handleEntityNotFound(_0x399a22,null))[_0xb93c('0x24')](saveUpdates(_0x57a13f[_0xb93c('0x45')],null))[_0xb93c('0x24')](respondWithResult(_0x399a22,null))['catch'](handleError(_0x399a22,null));};exports[_0xb93c('0x48')]=function(_0x4f9ed6,_0x42451e){return db['ServicenowConfiguration'][_0xb93c('0x46')]({'where':{'id':_0x4f9ed6[_0xb93c('0x47')]['id']}})[_0xb93c('0x24')](handleEntityNotFound(_0x42451e,null))[_0xb93c('0x24')](removeEntity(_0x42451e,null))[_0xb93c('0x42')](handleError(_0x42451e,null));};exports[_0xb93c('0x49')]=function(_0x1f49a3,_0x2b24c0,_0x3db9df){var _0xaca561={};var _0x36ff64={};var _0x200007;var _0x1e6155;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0x1f49a3[_0xb93c('0x47')]['id']}})[_0xb93c('0x24')](handleEntityNotFound(_0x2b24c0,null))[_0xb93c('0x24')](function(_0x2fa724){if(_0x2fa724){_0x200007=_0x2fa724;_0x36ff64['model']=_['keys'](db[_0xb93c('0x4a')][_0xb93c('0x2a')]);_0x36ff64[_0xb93c('0x30')]=_[_0xb93c('0x2f')](_0x1f49a3['query']);_0x36ff64[_0xb93c('0x39')]=_[_0xb93c('0x31')](_0x36ff64[_0xb93c('0x2d')],_0x36ff64[_0xb93c('0x30')]);_0xaca561['attributes']=_[_0xb93c('0x31')](_0x36ff64[_0xb93c('0x2d')],qs[_0xb93c('0x33')](_0x1f49a3[_0xb93c('0x30')][_0xb93c('0x33')]));_0xaca561[_0xb93c('0x32')]=_0xaca561[_0xb93c('0x32')][_0xb93c('0x34')]?_0xaca561[_0xb93c('0x32')]:_0x36ff64[_0xb93c('0x2d')];_0xaca561[_0xb93c('0x36')]=qs[_0xb93c('0x37')](_0x1f49a3[_0xb93c('0x30')][_0xb93c('0x37')]);_0xaca561[_0xb93c('0x38')]=qs[_0xb93c('0x39')](_[_0xb93c('0x3a')](_0x1f49a3[_0xb93c('0x30')],_0x36ff64[_0xb93c('0x39')]));if(_0x1f49a3[_0xb93c('0x30')][_0xb93c('0x3b')]){_0xaca561[_0xb93c('0x38')]=_[_0xb93c('0x3c')](_0xaca561[_0xb93c('0x38')],{'$or':_[_0xb93c('0x2e')](_0xaca561['attributes'],function(_0x5ae15f){var _0x115f28={};_0x115f28[_0x5ae15f]={'$like':'%'+_0x1f49a3[_0xb93c('0x30')][_0xb93c('0x3b')]+'%'};return _0x115f28;})});}_0xaca561=_[_0xb93c('0x3c')]({},_0xaca561,_0x1f49a3['options']);return _0x200007[_0xb93c('0x49')](_0xaca561);}})[_0xb93c('0x24')](function(_0x466807){if(_0x466807){_0x1e6155=_0x466807[_0xb93c('0x34')];if(!_0x1f49a3[_0xb93c('0x30')][_0xb93c('0x4b')](_0xb93c('0x35'))){_0xaca561['limit']=qs[_0xb93c('0x1e')](_0x1f49a3[_0xb93c('0x30')][_0xb93c('0x1e')]);_0xaca561[_0xb93c('0x1b')]=qs[_0xb93c('0x1b')](_0x1f49a3[_0xb93c('0x30')][_0xb93c('0x1b')]);}return _0x200007[_0xb93c('0x49')](_0xaca561);}})[_0xb93c('0x24')](function(_0x179247){if(_0x179247){return _0x179247?{'count':_0x1e6155,'rows':_0x179247}:null;}})[_0xb93c('0x24')](respondWithResult(_0x2b24c0,null))[_0xb93c('0x42')](handleError(_0x2b24c0,null));};exports[_0xb93c('0x4c')]=function(_0x3b9d1,_0x7c7cc9,_0x3fffe5){var _0x52df72={};var _0x36baa4={};var _0x3c0675;var _0x5d1a6a;return db[_0xb93c('0x3e')]['findOne']({'where':{'id':_0x3b9d1['params']['id']}})['then'](handleEntityNotFound(_0x7c7cc9,null))[_0xb93c('0x24')](function(_0x4cba7d){if(_0x4cba7d){_0x3c0675=_0x4cba7d;_0x36baa4[_0xb93c('0x2d')]=_['keys'](db['ServicenowField'][_0xb93c('0x2a')]);_0x36baa4[_0xb93c('0x30')]=_[_0xb93c('0x2f')](_0x3b9d1['query']);_0x36baa4[_0xb93c('0x39')]=_[_0xb93c('0x31')](_0x36baa4[_0xb93c('0x2d')],_0x36baa4['query']);_0x52df72[_0xb93c('0x32')]=_[_0xb93c('0x31')](_0x36baa4['model'],qs[_0xb93c('0x33')](_0x3b9d1[_0xb93c('0x30')][_0xb93c('0x33')]));_0x52df72[_0xb93c('0x32')]=_0x52df72[_0xb93c('0x32')][_0xb93c('0x34')]?_0x52df72[_0xb93c('0x32')]:_0x36baa4[_0xb93c('0x2d')];_0x52df72[_0xb93c('0x36')]=qs[_0xb93c('0x37')](_0x3b9d1[_0xb93c('0x30')][_0xb93c('0x37')]);_0x52df72[_0xb93c('0x38')]=qs['filters'](_[_0xb93c('0x3a')](_0x3b9d1[_0xb93c('0x30')],_0x36baa4['filters']));if(_0x3b9d1[_0xb93c('0x30')][_0xb93c('0x3b')]){_0x52df72[_0xb93c('0x38')]=_[_0xb93c('0x3c')](_0x52df72[_0xb93c('0x38')],{'$or':_['map'](_0x52df72['attributes'],function(_0x48aebe){var _0x346ef3={};_0x346ef3[_0x48aebe]={'$like':'%'+_0x3b9d1[_0xb93c('0x30')][_0xb93c('0x3b')]+'%'};return _0x346ef3;})});}_0x52df72=_[_0xb93c('0x3c')]({},_0x52df72,_0x3b9d1['options']);return _0x3c0675[_0xb93c('0x4c')](_0x52df72);}})['then'](function(_0x2a4f44){if(_0x2a4f44){_0x5d1a6a=_0x2a4f44[_0xb93c('0x34')];if(!_0x3b9d1[_0xb93c('0x30')]['hasOwnProperty'](_0xb93c('0x35'))){_0x52df72[_0xb93c('0x1e')]=qs[_0xb93c('0x1e')](_0x3b9d1[_0xb93c('0x30')]['limit']);_0x52df72[_0xb93c('0x1b')]=qs[_0xb93c('0x1b')](_0x3b9d1[_0xb93c('0x30')][_0xb93c('0x1b')]);}return _0x3c0675[_0xb93c('0x4c')](_0x52df72);}})[_0xb93c('0x24')](function(_0x378f9b){if(_0x378f9b){return _0x378f9b?{'count':_0x5d1a6a,'rows':_0x378f9b}:null;}})[_0xb93c('0x24')](respondWithResult(_0x7c7cc9,null))[_0xb93c('0x42')](handleError(_0x7c7cc9,null));};exports[_0xb93c('0x4d')]=function(_0x1ba429,_0x524cea,_0x557b06){var _0x21dd67={};var _0x47bff3={};var _0x1b669f;var _0x28d54d;return db[_0xb93c('0x3e')][_0xb93c('0x4e')]({'where':{'id':_0x1ba429['params']['id']}})[_0xb93c('0x24')](handleEntityNotFound(_0x524cea,null))[_0xb93c('0x24')](function(_0x6e1322){if(_0x6e1322){_0x1b669f=_0x6e1322;_0x47bff3[_0xb93c('0x2d')]=_[_0xb93c('0x2f')](db[_0xb93c('0x4a')]['rawAttributes']);_0x47bff3[_0xb93c('0x30')]=_['keys'](_0x1ba429['query']);_0x47bff3[_0xb93c('0x39')]=_[_0xb93c('0x31')](_0x47bff3[_0xb93c('0x2d')],_0x47bff3['query']);_0x21dd67['attributes']=_[_0xb93c('0x31')](_0x47bff3[_0xb93c('0x2d')],qs[_0xb93c('0x33')](_0x1ba429[_0xb93c('0x30')][_0xb93c('0x33')]));_0x21dd67[_0xb93c('0x32')]=_0x21dd67[_0xb93c('0x32')][_0xb93c('0x34')]?_0x21dd67[_0xb93c('0x32')]:_0x47bff3['model'];_0x21dd67['order']=qs[_0xb93c('0x37')](_0x1ba429['query'][_0xb93c('0x37')]);_0x21dd67['where']=qs[_0xb93c('0x39')](_[_0xb93c('0x3a')](_0x1ba429[_0xb93c('0x30')],_0x47bff3[_0xb93c('0x39')]));if(_0x1ba429[_0xb93c('0x30')]['filter']){_0x21dd67[_0xb93c('0x38')]=_[_0xb93c('0x3c')](_0x21dd67['where'],{'$or':_[_0xb93c('0x2e')](_0x21dd67['attributes'],function(_0x105cb0){var _0x58c7aa={};_0x58c7aa[_0x105cb0]={'$like':'%'+_0x1ba429[_0xb93c('0x30')][_0xb93c('0x3b')]+'%'};return _0x58c7aa;})});}_0x21dd67=_[_0xb93c('0x3c')]({},_0x21dd67,_0x1ba429[_0xb93c('0x3d')]);return _0x1b669f[_0xb93c('0x4d')](_0x21dd67);}})['then'](function(_0x41f098){if(_0x41f098){_0x28d54d=_0x41f098['length'];if(!_0x1ba429[_0xb93c('0x30')][_0xb93c('0x4b')]('nolimit')){_0x21dd67[_0xb93c('0x1e')]=qs[_0xb93c('0x1e')](_0x1ba429[_0xb93c('0x30')][_0xb93c('0x1e')]);_0x21dd67[_0xb93c('0x1b')]=qs['offset'](_0x1ba429[_0xb93c('0x30')][_0xb93c('0x1b')]);}return _0x1b669f['getDescriptions'](_0x21dd67);}})[_0xb93c('0x24')](function(_0x35a788){if(_0x35a788){return _0x35a788?{'count':_0x28d54d,'rows':_0x35a788}:null;}})[_0xb93c('0x24')](respondWithResult(_0x524cea,null))[_0xb93c('0x42')](handleError(_0x524cea,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index fe0505e..15691bb 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 _0xad9f=['ServicenowConfiguration','int_servicenow_configurations','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','exports','define'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xad9f,0x1be));var _0xfad9=function(_0x37a5f7,_0x55b45e){_0x37a5f7=_0x37a5f7-0x0;var _0x37c1d2=_0xad9f[_0x37a5f7];return _0x37c1d2;};'use strict';var _=require(_0xfad9('0x0'));var util=require(_0xfad9('0x1'));var logger=require(_0xfad9('0x2'))('api');var moment=require(_0xfad9('0x3'));var BPromise=require(_0xfad9('0x4'));var rp=require(_0xfad9('0x5'));var fs=require('fs');var path=require(_0xfad9('0x6'));var rimraf=require('rimraf');var config=require(_0xfad9('0x7'));var attributes=require('./intServicenowConfiguration.attributes');module[_0xfad9('0x8')]=function(_0x24d3fb,_0x19230a){return _0x24d3fb[_0xfad9('0x9')](_0xfad9('0xa'),attributes,{'tableName':_0xfad9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x51c5=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration'];(function(_0x5d3eb2,_0x170fc8){var _0x4dfd46=function(_0x375d6c){while(--_0x375d6c){_0x5d3eb2['push'](_0x5d3eb2['shift']());}};_0x4dfd46(++_0x170fc8);}(_0x51c5,0x8f));var _0x551c=function(_0x4c445a,_0x4ee80f){_0x4c445a=_0x4c445a-0x0;var _0x2f611c=_0x51c5[_0x4c445a];return _0x2f611c;};'use strict';var _=require(_0x551c('0x0'));var util=require(_0x551c('0x1'));var logger=require(_0x551c('0x2'))(_0x551c('0x3'));var moment=require(_0x551c('0x4'));var BPromise=require(_0x551c('0x5'));var rp=require(_0x551c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x551c('0x7'));var config=require(_0x551c('0x8'));var attributes=require(_0x551c('0x9'));module[_0x551c('0xa')]=function(_0xe0272c,_0x1aa8df){return _0xe0272c[_0x551c('0xb')](_0x551c('0xc'),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 4d4bd23..8283622 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 _0x5100=['ServicenowConfiguration,\x20%s,\x20%s','message','result','catch','util','moment','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x1ca29f,_0x318ac5){var _0x576c3b=function(_0x40caab){while(--_0x40caab){_0x1ca29f['push'](_0x1ca29f['shift']());}};_0x576c3b(++_0x318ac5);}(_0x5100,0xe8));var _0x0510=function(_0xd4b570,_0x57c71c){_0xd4b570=_0xd4b570-0x0;var _0x44d795=_0x5100[_0xd4b570];return _0x44d795;};'use strict';var _=require('lodash');var util=require(_0x0510('0x0'));var moment=require(_0x0510('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0510('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x0510('0x3'));var logger=require(_0x0510('0x4'))('rpc');var config=require(_0x0510('0x5'));var jayson=require(_0x0510('0x6'));var client=jayson['client'][_0x0510('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x32d5bf,_0x595a20,_0x46ee92){return new BPromise(function(_0x278a99,_0x29d902){return client[_0x0510('0x8')](_0x32d5bf,_0x46ee92)['then'](function(_0x37e9a5){logger[_0x0510('0x9')]('ServicenowConfiguration,\x20%s,\x20%s',_0x595a20,'request\x20sent');logger['debug'](_0x0510('0xa'),_0x595a20,_0x0510('0xb'),JSON[_0x0510('0xc')](_0x37e9a5));if(_0x37e9a5[_0x0510('0xd')]){if(_0x37e9a5[_0x0510('0xd')][_0x0510('0xe')]===0x1f4){logger[_0x0510('0xd')](_0x0510('0xf'),_0x595a20,_0x37e9a5[_0x0510('0xd')][_0x0510('0x10')]);return _0x29d902(_0x37e9a5[_0x0510('0xd')][_0x0510('0x10')]);}logger[_0x0510('0xd')](_0x0510('0xf'),_0x595a20,_0x37e9a5[_0x0510('0xd')][_0x0510('0x10')]);return _0x278a99(_0x37e9a5[_0x0510('0xd')]['message']);}else{logger[_0x0510('0x9')](_0x0510('0xf'),_0x595a20,_0x0510('0xb'));_0x278a99(_0x37e9a5[_0x0510('0x11')][_0x0510('0x10')]);}})[_0x0510('0x12')](function(_0x2af7d8){logger[_0x0510('0xd')]('ServicenowConfiguration,\x20%s,\x20%s',_0x595a20,_0x2af7d8);_0x29d902(_0x2af7d8);});});} \ No newline at end of file +var _0x06f2=['request','then','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x4f4216,_0x2d47a1){var _0xc0484b=function(_0x3fe889){while(--_0x3fe889){_0x4f4216['push'](_0x4f4216['shift']());}};_0xc0484b(++_0x2d47a1);}(_0x06f2,0x96));var _0x206f=function(_0x51cc8b,_0x1bf7d1){_0x51cc8b=_0x51cc8b-0x0;var _0x2ce6e4=_0x06f2[_0x51cc8b];return _0x2ce6e4;};'use strict';var _=require('lodash');var util=require(_0x206f('0x0'));var moment=require(_0x206f('0x1'));var BPromise=require(_0x206f('0x2'));var rs=require(_0x206f('0x3'));var fs=require('fs');var Redis=require(_0x206f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x206f('0x5'));var logger=require(_0x206f('0x6'))(_0x206f('0x7'));var config=require(_0x206f('0x8'));var jayson=require(_0x206f('0x9'));var client=jayson['client'][_0x206f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x518619,_0x2b336d,_0x16bbfd){return new BPromise(function(_0x3c23c0,_0x3c4b73){return client[_0x206f('0xb')](_0x518619,_0x16bbfd)[_0x206f('0xc')](function(_0x394ec6){logger['info'](_0x206f('0xd'),_0x2b336d,_0x206f('0xe'));logger[_0x206f('0xf')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x2b336d,_0x206f('0xe'),JSON[_0x206f('0x10')](_0x394ec6));if(_0x394ec6[_0x206f('0x11')]){if(_0x394ec6[_0x206f('0x11')][_0x206f('0x12')]===0x1f4){logger[_0x206f('0x11')](_0x206f('0xd'),_0x2b336d,_0x394ec6['error']['message']);return _0x3c4b73(_0x394ec6[_0x206f('0x11')]['message']);}logger[_0x206f('0x11')](_0x206f('0xd'),_0x2b336d,_0x394ec6[_0x206f('0x11')][_0x206f('0x13')]);return _0x3c23c0(_0x394ec6[_0x206f('0x11')]['message']);}else{logger[_0x206f('0x14')]('ServicenowConfiguration,\x20%s,\x20%s',_0x2b336d,'request\x20sent');_0x3c23c0(_0x394ec6[_0x206f('0x15')][_0x206f('0x13')]);}})[_0x206f('0x16')](function(_0x5af80f){logger[_0x206f('0x11')](_0x206f('0xd'),_0x2b336d,_0x5af80f);_0x3c4b73(_0x5af80f);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index e7d2961..a17c704 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 _0x9360=['show','create','put','delete','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','index'];(function(_0x5c749e,_0xc1935c){var _0x5ade0a=function(_0x1af038){while(--_0x1af038){_0x5c749e['push'](_0x5c749e['shift']());}};_0x5ade0a(++_0xc1935c);}(_0x9360,0x199));var _0x0936=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x9360[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0936('0x0'));var util=require('util');var path=require(_0x0936('0x1'));var timeout=require('connect-timeout');var express=require(_0x0936('0x2'));var router=express[_0x0936('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0936('0x4'));var interaction=require(_0x0936('0x5'));var config=require(_0x0936('0x6'));var controller=require(_0x0936('0x7'));router[_0x0936('0x8')]('/',auth[_0x0936('0x9')](),controller[_0x0936('0xa')]);router[_0x0936('0x8')]('/:id',auth[_0x0936('0x9')](),controller[_0x0936('0xb')]);router['post']('/',auth[_0x0936('0x9')](),controller[_0x0936('0xc')]);router[_0x0936('0xd')]('/:id',auth[_0x0936('0x9')](),controller['update']);router[_0x0936('0xe')]('/:id',auth[_0x0936('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xdb74=['delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intServicenowField.controller','get','index','/:id','isAuthenticated','show','post','create','put','update'];(function(_0x46d8b2,_0x3829c4){var _0x1a351f=function(_0x279ce5){while(--_0x279ce5){_0x46d8b2['push'](_0x46d8b2['shift']());}};_0x1a351f(++_0x3829c4);}(_0xdb74,0x107));var _0x4db7=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xdb74[_0x311c35];return _0x5cc50c;};'use strict';var multer=require('multer');var util=require(_0x4db7('0x0'));var path=require(_0x4db7('0x1'));var timeout=require(_0x4db7('0x2'));var express=require('express');var router=express[_0x4db7('0x3')]();var fs_extra=require(_0x4db7('0x4'));var auth=require(_0x4db7('0x5'));var interaction=require(_0x4db7('0x6'));var config=require('../../config/environment');var controller=require(_0x4db7('0x7'));router[_0x4db7('0x8')]('/',auth['isAuthenticated'](),controller[_0x4db7('0x9')]);router[_0x4db7('0x8')](_0x4db7('0xa'),auth[_0x4db7('0xb')](),controller[_0x4db7('0xc')]);router[_0x4db7('0xd')]('/',auth[_0x4db7('0xb')](),controller[_0x4db7('0xe')]);router[_0x4db7('0xf')](_0x4db7('0xa'),auth[_0x4db7('0xb')](),controller[_0x4db7('0x10')]);router[_0x4db7('0x11')](_0x4db7('0xa'),auth[_0x4db7('0xb')](),controller[_0x4db7('0x12')]);module[_0x4db7('0x13')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index dc56e48..d2d6b29 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 _0x2e86=['BOOLEAN','sequelize','ENUM','string','customVariable','picklist','STRING'];(function(_0x1dca40,_0x555000){var _0xaa9bab=function(_0x254de2){while(--_0x254de2){_0x1dca40['push'](_0x1dca40['shift']());}};_0xaa9bab(++_0x555000);}(_0x2e86,0x1cf));var _0x62e8=function(_0x370011,_0x36278c){_0x370011=_0x370011-0x0;var _0x3d76e8=_0x2e86[_0x370011];return _0x3d76e8;};'use strict';var Sequelize=require(_0x62e8('0x0'));module['exports']={'type':{'type':Sequelize[_0x62e8('0x1')](_0x62e8('0x2'),'variable',_0x62e8('0x3'),'keyValue',_0x62e8('0x4')),'defaultValue':_0x62e8('0x2')},'content':{'type':Sequelize[_0x62e8('0x5')]},'key':{'type':Sequelize[_0x62e8('0x5')]},'keyType':{'type':Sequelize[_0x62e8('0x1')](_0x62e8('0x2'),'variable',_0x62e8('0x3'))},'keyContent':{'type':Sequelize[_0x62e8('0x5')]},'idField':{'type':Sequelize[_0x62e8('0x5')]},'nameField':{'type':Sequelize[_0x62e8('0x5')]},'customField':{'type':Sequelize[_0x62e8('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x62e8('0x5')]}}; \ No newline at end of file +var _0x14d9=['keyValue','picklist','STRING','BOOLEAN','exports','ENUM','string','variable','customVariable'];(function(_0x3281cc,_0x1226a7){var _0x1bc18b=function(_0x3f8283){while(--_0x3f8283){_0x3281cc['push'](_0x3281cc['shift']());}};_0x1bc18b(++_0x1226a7);}(_0x14d9,0x13f));var _0x914d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x14d9[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x914d('0x0')]={'type':{'type':Sequelize[_0x914d('0x1')](_0x914d('0x2'),_0x914d('0x3'),_0x914d('0x4'),_0x914d('0x5'),_0x914d('0x6')),'defaultValue':_0x914d('0x2')},'content':{'type':Sequelize[_0x914d('0x7')]},'key':{'type':Sequelize[_0x914d('0x7')]},'keyType':{'type':Sequelize[_0x914d('0x1')](_0x914d('0x2'),_0x914d('0x3'),_0x914d('0x4'))},'keyContent':{'type':Sequelize[_0x914d('0x7')]},'idField':{'type':Sequelize[_0x914d('0x7')]},'nameField':{'type':Sequelize[_0x914d('0x7')]},'customField':{'type':Sequelize[_0x914d('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x914d('0x7')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 4f38076..c0a7d7c 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 _0x79ff=['rows','params','rawAttributes','options','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','count','offset','json','apply','reject','save','update','destroy','then','end','error','stack','name','send','index','ServicenowField','type','key','map','query','keys','filters','model','intersection','fields','attributes','length','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll'];(function(_0x59a927,_0x42de1c){var _0x4fecee=function(_0x1f2543){while(--_0x1f2543){_0x59a927['push'](_0x59a927['shift']());}};_0x4fecee(++_0x42de1c);}(_0x79ff,0xe9));var _0xf79f=function(_0x53b93b,_0x1bfab1){_0x53b93b=_0x53b93b-0x0;var _0x485761=_0x79ff[_0x53b93b];return _0x485761;};'use strict';var emlformat=require(_0xf79f('0x0'));var rimraf=require(_0xf79f('0x1'));var zipdir=require(_0xf79f('0x2'));var jsonpatch=require(_0xf79f('0x3'));var rp=require(_0xf79f('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf79f('0x5'));var util=require('util');var path=require('path');var sox=require(_0xf79f('0x6'));var csv=require(_0xf79f('0x7'));var ejs=require(_0xf79f('0x8'));var fs=require('fs');var fs_extra=require(_0xf79f('0x9'));var _=require(_0xf79f('0xa'));var squel=require(_0xf79f('0xb'));var crypto=require(_0xf79f('0xc'));var jsforce=require(_0xf79f('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf79f('0x7'));var querystring=require(_0xf79f('0xe'));var Papa=require(_0xf79f('0xf'));var Redis=require(_0xf79f('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xf79f('0x11'));var as=require(_0xf79f('0x12'));var hardwareService=require(_0xf79f('0x13'));var logger=require(_0xf79f('0x14'))(_0xf79f('0x15'));var utils=require(_0xf79f('0x16'));var config=require(_0xf79f('0x17'));var licenseUtil=require(_0xf79f('0x18'));var db=require(_0xf79f('0x19'))['db'];function respondWithStatusCode(_0x4a00f7,_0x1673c0){_0x1673c0=_0x1673c0||0xcc;return function(_0x1cbcb5){if(_0x1cbcb5){return _0x4a00f7[_0xf79f('0x1a')](_0x1673c0);}return _0x4a00f7['status'](_0x1673c0)['end']();};}function respondWithResult(_0x3580f5,_0x35e68c){_0x35e68c=_0x35e68c||0xc8;return function(_0x54f97b){if(_0x54f97b){return _0x3580f5[_0xf79f('0x1b')](_0x35e68c)['json'](_0x54f97b);}};}function respondWithFilteredResult(_0x565593,_0xbd94ac){return function(_0x459d30){if(_0x459d30){var _0x5ed4b9=typeof _0xbd94ac['offset']===_0xf79f('0x1c')&&typeof _0xbd94ac[_0xf79f('0x1d')]===_0xf79f('0x1c');var _0xa9e40=_0x459d30[_0xf79f('0x1e')];var _0x422e4d=_0x5ed4b9?0x0:_0xbd94ac[_0xf79f('0x1f')];var _0x21a4ab=_0x5ed4b9?_0x459d30[_0xf79f('0x1e')]:_0xbd94ac['offset']+_0xbd94ac['limit'];var _0x4fbca8;if(_0x21a4ab>=_0xa9e40){_0x21a4ab=_0xa9e40;_0x4fbca8=0xc8;}else{_0x4fbca8=0xce;}_0x565593['status'](_0x4fbca8);return _0x565593['set']('Content-Range',_0x422e4d+'-'+_0x21a4ab+'/'+_0xa9e40)[_0xf79f('0x20')](_0x459d30);}return null;};}function patchUpdates(_0x5d5c0d){return function(_0x3d17ec){try{jsonpatch[_0xf79f('0x21')](_0x3d17ec,_0x5d5c0d,!![]);}catch(_0x1c531e){return BPromise[_0xf79f('0x22')](_0x1c531e);}return _0x3d17ec[_0xf79f('0x23')]();};}function saveUpdates(_0x18a68e,_0xa00ab4){return function(_0x2335e1){if(_0x2335e1){return _0x2335e1[_0xf79f('0x24')](_0x18a68e)['then'](function(_0x39d902){return _0x39d902;});}return null;};}function removeEntity(_0x5a2ff1,_0x9f9cb9){return function(_0x48ddeb){if(_0x48ddeb){return _0x48ddeb[_0xf79f('0x25')]()[_0xf79f('0x26')](function(){_0x5a2ff1['status'](0xcc)[_0xf79f('0x27')]();});}};}function handleEntityNotFound(_0x4028c8,_0x441e7d){return function(_0x4b6caa){if(!_0x4b6caa){_0x4028c8[_0xf79f('0x1a')](0x194);}return _0x4b6caa;};}function handleError(_0x1d24fd,_0x1b3ab8){_0x1b3ab8=_0x1b3ab8||0x1f4;return function(_0x2ccd45){logger[_0xf79f('0x28')](_0x2ccd45[_0xf79f('0x29')]);if(_0x2ccd45[_0xf79f('0x2a')]){delete _0x2ccd45[_0xf79f('0x2a')];}_0x1d24fd['status'](_0x1b3ab8)[_0xf79f('0x2b')](_0x2ccd45);};}exports[_0xf79f('0x2c')]=function(_0xaad4aa,_0x396d1d){var _0x5e400e={},_0x4ad34b={},_0x3a8f9a={'count':0x0,'rows':[]};var _0x1bfb71=_['map'](db[_0xf79f('0x2d')]['rawAttributes'],function(_0x39f2fd){return{'name':_0x39f2fd['fieldName'],'type':_0x39f2fd[_0xf79f('0x2e')][_0xf79f('0x2f')]};});_0x4ad34b['model']=_[_0xf79f('0x30')](_0x1bfb71,_0xf79f('0x2a'));_0x4ad34b[_0xf79f('0x31')]=_[_0xf79f('0x32')](_0xaad4aa[_0xf79f('0x31')]);_0x4ad34b[_0xf79f('0x33')]=_['intersection'](_0x4ad34b[_0xf79f('0x34')],_0x4ad34b[_0xf79f('0x31')]);_0x5e400e['attributes']=_[_0xf79f('0x35')](_0x4ad34b[_0xf79f('0x34')],qs['fields'](_0xaad4aa[_0xf79f('0x31')][_0xf79f('0x36')]));_0x5e400e['attributes']=_0x5e400e[_0xf79f('0x37')][_0xf79f('0x38')]?_0x5e400e[_0xf79f('0x37')]:_0x4ad34b[_0xf79f('0x34')];if(!_0xaad4aa[_0xf79f('0x31')]['hasOwnProperty']('nolimit')){_0x5e400e['limit']=qs['limit'](_0xaad4aa['query']['limit']);_0x5e400e[_0xf79f('0x1f')]=qs[_0xf79f('0x1f')](_0xaad4aa[_0xf79f('0x31')]['offset']);}_0x5e400e[_0xf79f('0x39')]=qs[_0xf79f('0x3a')](_0xaad4aa[_0xf79f('0x31')][_0xf79f('0x3a')]);_0x5e400e[_0xf79f('0x3b')]=qs[_0xf79f('0x33')](_[_0xf79f('0x3c')](_0xaad4aa[_0xf79f('0x31')],_0x4ad34b[_0xf79f('0x33')]),_0x1bfb71);if(_0xaad4aa['query'][_0xf79f('0x3d')]){_0x5e400e[_0xf79f('0x3b')]=_[_0xf79f('0x3e')](_0x5e400e['where'],{'$or':_[_0xf79f('0x30')](_0x1bfb71,function(_0x53bbbf){if(_0x53bbbf[_0xf79f('0x2e')]!==_0xf79f('0x3f')){var _0x9d6c13={};_0x9d6c13[_0x53bbbf[_0xf79f('0x2a')]]={'$like':'%'+_0xaad4aa[_0xf79f('0x31')]['filter']+'%'};return _0x9d6c13;}})});}_0x5e400e=_[_0xf79f('0x3e')]({},_0x5e400e,_0xaad4aa['options']);var _0xf2ea86={'where':_0x5e400e[_0xf79f('0x3b')]};return db[_0xf79f('0x2d')][_0xf79f('0x1e')](_0xf2ea86)['then'](function(_0x541675){_0x3a8f9a[_0xf79f('0x1e')]=_0x541675;if(_0xaad4aa[_0xf79f('0x31')][_0xf79f('0x40')]){_0x5e400e[_0xf79f('0x41')]=[{'all':!![]}];}return db[_0xf79f('0x2d')][_0xf79f('0x42')](_0x5e400e);})[_0xf79f('0x26')](function(_0x20cbea){_0x3a8f9a[_0xf79f('0x43')]=_0x20cbea;return _0x3a8f9a;})[_0xf79f('0x26')](respondWithFilteredResult(_0x396d1d,_0x5e400e))['catch'](handleError(_0x396d1d,null));};exports['show']=function(_0x5ed5b3,_0x1cb7b5){var _0x115a5e={'raw':!![],'where':{'id':_0x5ed5b3[_0xf79f('0x44')]['id']}},_0xb666fc={};_0xb666fc[_0xf79f('0x34')]=_[_0xf79f('0x32')](db[_0xf79f('0x2d')][_0xf79f('0x45')]);_0xb666fc[_0xf79f('0x31')]=_[_0xf79f('0x32')](_0x5ed5b3[_0xf79f('0x31')]);_0xb666fc[_0xf79f('0x33')]=_['intersection'](_0xb666fc['model'],_0xb666fc[_0xf79f('0x31')]);_0x115a5e[_0xf79f('0x37')]=_[_0xf79f('0x35')](_0xb666fc[_0xf79f('0x34')],qs[_0xf79f('0x36')](_0x5ed5b3['query'][_0xf79f('0x36')]));_0x115a5e[_0xf79f('0x37')]=_0x115a5e[_0xf79f('0x37')]['length']?_0x115a5e[_0xf79f('0x37')]:_0xb666fc[_0xf79f('0x34')];if(_0x5ed5b3[_0xf79f('0x31')][_0xf79f('0x40')]){_0x115a5e[_0xf79f('0x41')]=[{'all':!![]}];}_0x115a5e=_[_0xf79f('0x3e')]({},_0x115a5e,_0x5ed5b3[_0xf79f('0x46')]);return db[_0xf79f('0x2d')][_0xf79f('0x47')](_0x115a5e)[_0xf79f('0x26')](handleEntityNotFound(_0x1cb7b5,null))[_0xf79f('0x26')](respondWithResult(_0x1cb7b5,null))[_0xf79f('0x48')](handleError(_0x1cb7b5,null));};exports[_0xf79f('0x49')]=function(_0x256717,_0x259e33){return db[_0xf79f('0x2d')][_0xf79f('0x49')](_0x256717[_0xf79f('0x4a')],{})[_0xf79f('0x26')](respondWithResult(_0x259e33,0xc9))['catch'](handleError(_0x259e33,null));};exports[_0xf79f('0x24')]=function(_0xd12b8b,_0x55bba8){if(_0xd12b8b['body']['id']){delete _0xd12b8b[_0xf79f('0x4a')]['id'];}return db[_0xf79f('0x2d')]['find']({'where':{'id':_0xd12b8b[_0xf79f('0x44')]['id']}})[_0xf79f('0x26')](handleEntityNotFound(_0x55bba8,null))[_0xf79f('0x26')](saveUpdates(_0xd12b8b[_0xf79f('0x4a')],null))[_0xf79f('0x26')](respondWithResult(_0x55bba8,null))[_0xf79f('0x48')](handleError(_0x55bba8,null));};exports[_0xf79f('0x25')]=function(_0x1f82c9,_0x3262fb){return db['ServicenowField'][_0xf79f('0x47')]({'where':{'id':_0x1f82c9[_0xf79f('0x44')]['id']}})[_0xf79f('0x26')](handleEntityNotFound(_0x3262fb,null))[_0xf79f('0x26')](removeEntity(_0x3262fb,null))[_0xf79f('0x48')](handleError(_0x3262fb,null));}; \ No newline at end of file +var _0x0e3b=['VIRTUAL','options','ServicenowField','includeAll','include','findAll','rows','catch','show','keys','find','create','body','params','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','end','error','name','send','index','map','rawAttributes','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge'];(function(_0x4ad9ff,_0xa8e5e8){var _0x1a8afc=function(_0x1195b5){while(--_0x1195b5){_0x4ad9ff['push'](_0x4ad9ff['shift']());}};_0x1a8afc(++_0xa8e5e8);}(_0x0e3b,0xfb));var _0xb0e3=function(_0x389da0,_0x136b50){_0x389da0=_0x389da0-0x0;var _0x5e8153=_0x0e3b[_0x389da0];return _0x5e8153;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb0e3('0x0'));var zipdir=require(_0xb0e3('0x1'));var jsonpatch=require(_0xb0e3('0x2'));var rp=require(_0xb0e3('0x3'));var moment=require('moment');var BPromise=require(_0xb0e3('0x4'));var Mustache=require(_0xb0e3('0x5'));var util=require(_0xb0e3('0x6'));var path=require('path');var sox=require(_0xb0e3('0x7'));var csv=require(_0xb0e3('0x8'));var ejs=require(_0xb0e3('0x9'));var fs=require('fs');var fs_extra=require(_0xb0e3('0xa'));var _=require(_0xb0e3('0xb'));var squel=require(_0xb0e3('0xc'));var crypto=require(_0xb0e3('0xd'));var jsforce=require(_0xb0e3('0xe'));var deskjs=require(_0xb0e3('0xf'));var toCsv=require('to-csv');var querystring=require(_0xb0e3('0x10'));var Papa=require(_0xb0e3('0x11'));var Redis=require(_0xb0e3('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xb0e3('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb0e3('0x14'));var logger=require(_0xb0e3('0x15'))(_0xb0e3('0x16'));var utils=require(_0xb0e3('0x17'));var config=require(_0xb0e3('0x18'));var licenseUtil=require(_0xb0e3('0x19'));var db=require(_0xb0e3('0x1a'))['db'];function respondWithStatusCode(_0x1fed77,_0x595456){_0x595456=_0x595456||0xcc;return function(_0x229f1f){if(_0x229f1f){return _0x1fed77[_0xb0e3('0x1b')](_0x595456);}return _0x1fed77[_0xb0e3('0x1c')](_0x595456)['end']();};}function respondWithResult(_0x155165,_0xa93cc){_0xa93cc=_0xa93cc||0xc8;return function(_0x36e63a){if(_0x36e63a){return _0x155165[_0xb0e3('0x1c')](_0xa93cc)[_0xb0e3('0x1d')](_0x36e63a);}};}function respondWithFilteredResult(_0x11eac1,_0x2f21ea){return function(_0x4046d5){if(_0x4046d5){var _0x120f6d=typeof _0x2f21ea[_0xb0e3('0x1e')]===_0xb0e3('0x1f')&&typeof _0x2f21ea[_0xb0e3('0x20')]===_0xb0e3('0x1f');var _0x23e15b=_0x4046d5['count'];var _0x3177d9=_0x120f6d?0x0:_0x2f21ea[_0xb0e3('0x1e')];var _0x19b0c8=_0x120f6d?_0x4046d5[_0xb0e3('0x21')]:_0x2f21ea[_0xb0e3('0x1e')]+_0x2f21ea[_0xb0e3('0x20')];var _0x383a63;if(_0x19b0c8>=_0x23e15b){_0x19b0c8=_0x23e15b;_0x383a63=0xc8;}else{_0x383a63=0xce;}_0x11eac1[_0xb0e3('0x1c')](_0x383a63);return _0x11eac1[_0xb0e3('0x22')](_0xb0e3('0x23'),_0x3177d9+'-'+_0x19b0c8+'/'+_0x23e15b)[_0xb0e3('0x1d')](_0x4046d5);}return null;};}function patchUpdates(_0x1884b6){return function(_0x493fd0){try{jsonpatch[_0xb0e3('0x24')](_0x493fd0,_0x1884b6,!![]);}catch(_0x25d585){return BPromise['reject'](_0x25d585);}return _0x493fd0[_0xb0e3('0x25')]();};}function saveUpdates(_0x25a7f1,_0x2bc560){return function(_0x245e2d){if(_0x245e2d){return _0x245e2d[_0xb0e3('0x26')](_0x25a7f1)[_0xb0e3('0x27')](function(_0x3a2dbf){return _0x3a2dbf;});}return null;};}function removeEntity(_0x341dfb,_0x5d78d4){return function(_0xbf1a7){if(_0xbf1a7){return _0xbf1a7[_0xb0e3('0x28')]()[_0xb0e3('0x27')](function(){_0x341dfb[_0xb0e3('0x1c')](0xcc)[_0xb0e3('0x29')]();});}};}function handleEntityNotFound(_0x436a3e,_0x411ff9){return function(_0x387d71){if(!_0x387d71){_0x436a3e[_0xb0e3('0x1b')](0x194);}return _0x387d71;};}function handleError(_0x26727f,_0x5b534c){_0x5b534c=_0x5b534c||0x1f4;return function(_0x380d39){logger[_0xb0e3('0x2a')](_0x380d39['stack']);if(_0x380d39[_0xb0e3('0x2b')]){delete _0x380d39['name'];}_0x26727f['status'](_0x5b534c)[_0xb0e3('0x2c')](_0x380d39);};}exports[_0xb0e3('0x2d')]=function(_0x52aa99,_0x461744){var _0x5ca2fd={},_0x18827e={},_0x24d72e={'count':0x0,'rows':[]};var _0xdcb4e8=_[_0xb0e3('0x2e')](db['ServicenowField'][_0xb0e3('0x2f')],function(_0x49fe45){return{'name':_0x49fe45['fieldName'],'type':_0x49fe45[_0xb0e3('0x30')][_0xb0e3('0x31')]};});_0x18827e['model']=_[_0xb0e3('0x2e')](_0xdcb4e8,_0xb0e3('0x2b'));_0x18827e['query']=_['keys'](_0x52aa99[_0xb0e3('0x32')]);_0x18827e[_0xb0e3('0x33')]=_[_0xb0e3('0x34')](_0x18827e[_0xb0e3('0x35')],_0x18827e['query']);_0x5ca2fd[_0xb0e3('0x36')]=_[_0xb0e3('0x34')](_0x18827e[_0xb0e3('0x35')],qs[_0xb0e3('0x37')](_0x52aa99[_0xb0e3('0x32')][_0xb0e3('0x37')]));_0x5ca2fd[_0xb0e3('0x36')]=_0x5ca2fd[_0xb0e3('0x36')][_0xb0e3('0x38')]?_0x5ca2fd[_0xb0e3('0x36')]:_0x18827e[_0xb0e3('0x35')];if(!_0x52aa99['query'][_0xb0e3('0x39')](_0xb0e3('0x3a'))){_0x5ca2fd[_0xb0e3('0x20')]=qs[_0xb0e3('0x20')](_0x52aa99['query'][_0xb0e3('0x20')]);_0x5ca2fd['offset']=qs[_0xb0e3('0x1e')](_0x52aa99[_0xb0e3('0x32')][_0xb0e3('0x1e')]);}_0x5ca2fd[_0xb0e3('0x3b')]=qs[_0xb0e3('0x3c')](_0x52aa99['query']['sort']);_0x5ca2fd[_0xb0e3('0x3d')]=qs[_0xb0e3('0x33')](_[_0xb0e3('0x3e')](_0x52aa99[_0xb0e3('0x32')],_0x18827e['filters']),_0xdcb4e8);if(_0x52aa99['query'][_0xb0e3('0x3f')]){_0x5ca2fd[_0xb0e3('0x3d')]=_[_0xb0e3('0x40')](_0x5ca2fd[_0xb0e3('0x3d')],{'$or':_[_0xb0e3('0x2e')](_0xdcb4e8,function(_0x58606d){if(_0x58606d['type']!==_0xb0e3('0x41')){var _0x1a9236={};_0x1a9236[_0x58606d[_0xb0e3('0x2b')]]={'$like':'%'+_0x52aa99['query'][_0xb0e3('0x3f')]+'%'};return _0x1a9236;}})});}_0x5ca2fd=_[_0xb0e3('0x40')]({},_0x5ca2fd,_0x52aa99[_0xb0e3('0x42')]);var _0x1bf4b3={'where':_0x5ca2fd[_0xb0e3('0x3d')]};return db[_0xb0e3('0x43')][_0xb0e3('0x21')](_0x1bf4b3)[_0xb0e3('0x27')](function(_0x5c5abd){_0x24d72e[_0xb0e3('0x21')]=_0x5c5abd;if(_0x52aa99[_0xb0e3('0x32')][_0xb0e3('0x44')]){_0x5ca2fd[_0xb0e3('0x45')]=[{'all':!![]}];}return db['ServicenowField'][_0xb0e3('0x46')](_0x5ca2fd);})[_0xb0e3('0x27')](function(_0x1f030d){_0x24d72e[_0xb0e3('0x47')]=_0x1f030d;return _0x24d72e;})[_0xb0e3('0x27')](respondWithFilteredResult(_0x461744,_0x5ca2fd))[_0xb0e3('0x48')](handleError(_0x461744,null));};exports[_0xb0e3('0x49')]=function(_0x57b8d2,_0x2ee774){var _0x2d8ccf={'raw':!![],'where':{'id':_0x57b8d2['params']['id']}},_0x4ff53c={};_0x4ff53c[_0xb0e3('0x35')]=_[_0xb0e3('0x4a')](db[_0xb0e3('0x43')][_0xb0e3('0x2f')]);_0x4ff53c[_0xb0e3('0x32')]=_['keys'](_0x57b8d2[_0xb0e3('0x32')]);_0x4ff53c[_0xb0e3('0x33')]=_['intersection'](_0x4ff53c[_0xb0e3('0x35')],_0x4ff53c[_0xb0e3('0x32')]);_0x2d8ccf[_0xb0e3('0x36')]=_['intersection'](_0x4ff53c[_0xb0e3('0x35')],qs['fields'](_0x57b8d2[_0xb0e3('0x32')]['fields']));_0x2d8ccf[_0xb0e3('0x36')]=_0x2d8ccf[_0xb0e3('0x36')][_0xb0e3('0x38')]?_0x2d8ccf['attributes']:_0x4ff53c['model'];if(_0x57b8d2[_0xb0e3('0x32')]['includeAll']){_0x2d8ccf['include']=[{'all':!![]}];}_0x2d8ccf=_[_0xb0e3('0x40')]({},_0x2d8ccf,_0x57b8d2['options']);return db[_0xb0e3('0x43')][_0xb0e3('0x4b')](_0x2d8ccf)[_0xb0e3('0x27')](handleEntityNotFound(_0x2ee774,null))[_0xb0e3('0x27')](respondWithResult(_0x2ee774,null))[_0xb0e3('0x48')](handleError(_0x2ee774,null));};exports[_0xb0e3('0x4c')]=function(_0x52c609,_0x174d96){return db[_0xb0e3('0x43')]['create'](_0x52c609[_0xb0e3('0x4d')],{})[_0xb0e3('0x27')](respondWithResult(_0x174d96,0xc9))['catch'](handleError(_0x174d96,null));};exports[_0xb0e3('0x26')]=function(_0x57ef53,_0x3239a1){if(_0x57ef53['body']['id']){delete _0x57ef53[_0xb0e3('0x4d')]['id'];}return db[_0xb0e3('0x43')][_0xb0e3('0x4b')]({'where':{'id':_0x57ef53[_0xb0e3('0x4e')]['id']}})[_0xb0e3('0x27')](handleEntityNotFound(_0x3239a1,null))['then'](saveUpdates(_0x57ef53[_0xb0e3('0x4d')],null))[_0xb0e3('0x27')](respondWithResult(_0x3239a1,null))[_0xb0e3('0x48')](handleError(_0x3239a1,null));};exports[_0xb0e3('0x28')]=function(_0x49a104,_0x2e981b){return db[_0xb0e3('0x43')]['find']({'where':{'id':_0x49a104[_0xb0e3('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2e981b,null))['then'](removeEntity(_0x2e981b,null))[_0xb0e3('0x48')](handleError(_0x2e981b,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index cbbbe79..4696be2 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 _0xc60d=['request-promise','path','rimraf','../../config/environment','./intServicenowField.attributes','exports','int_servicenow_fields','servicenow_unique_index','idField','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x24ce3f,_0xea9571){var _0x4b5aeb=function(_0x5d0b67){while(--_0x5d0b67){_0x24ce3f['push'](_0x24ce3f['shift']());}};_0x4b5aeb(++_0xea9571);}(_0xc60d,0x1da));var _0xdc60=function(_0x2b6482,_0x95e8a8){_0x2b6482=_0x2b6482-0x0;var _0x53e68f=_0xc60d[_0x2b6482];return _0x53e68f;};'use strict';var _=require(_0xdc60('0x0'));var util=require(_0xdc60('0x1'));var logger=require(_0xdc60('0x2'))(_0xdc60('0x3'));var moment=require(_0xdc60('0x4'));var BPromise=require(_0xdc60('0x5'));var rp=require(_0xdc60('0x6'));var fs=require('fs');var path=require(_0xdc60('0x7'));var rimraf=require(_0xdc60('0x8'));var config=require(_0xdc60('0x9'));var attributes=require(_0xdc60('0xa'));module[_0xdc60('0xb')]=function(_0x5cab52,_0x2be0ed){return _0x5cab52['define']('ServicenowField',attributes,{'tableName':_0xdc60('0xc'),'paranoid':![],'indexes':[{'name':_0xdc60('0xd'),'fields':[_0xdc60('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x034f=['FieldId','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','exports','define','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField'];(function(_0x36436d,_0x20292c){var _0x34615d=function(_0x5447af){while(--_0x5447af){_0x36436d['push'](_0x36436d['shift']());}};_0x34615d(++_0x20292c);}(_0x034f,0x7f));var _0xf034=function(_0x2cbc93,_0x728161){_0x2cbc93=_0x2cbc93-0x0;var _0x303598=_0x034f[_0x2cbc93];return _0x303598;};'use strict';var _=require('lodash');var util=require(_0xf034('0x0'));var logger=require(_0xf034('0x1'))(_0xf034('0x2'));var moment=require('moment');var BPromise=require(_0xf034('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf034('0x4'));var rimraf=require(_0xf034('0x5'));var config=require(_0xf034('0x6'));var attributes=require('./intServicenowField.attributes');module[_0xf034('0x7')]=function(_0x4da853,_0x5f35ab){return _0x4da853[_0xf034('0x8')](_0xf034('0x9'),attributes,{'tableName':_0xf034('0xa'),'paranoid':![],'indexes':[{'name':_0xf034('0xb'),'fields':[_0xf034('0xc'),_0xf034('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.rpc.js b/server/api/intServicenowField/intServicenowField.rpc.js index 9917d3f..b939371 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 _0x0713=['ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x3eefac,_0x2a8cbd){var _0x517b33=function(_0x270553){while(--_0x270553){_0x3eefac['push'](_0x3eefac['shift']());}};_0x517b33(++_0x2a8cbd);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('ServicenowField,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('ServicenowField,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('ServicenowField,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});} \ No newline at end of file +var _0x9bde=['code','message','ServicenowField,\x20%s,\x20%s','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x3427af,_0x558a08){var _0x24d5a7=function(_0x78c7ee){while(--_0x78c7ee){_0x3427af['push'](_0x3427af['shift']());}};_0x24d5a7(++_0x558a08);}(_0x9bde,0xe1));var _0xe9bd=function(_0x32fab6,_0x49bb58){_0x32fab6=_0x32fab6-0x0;var _0x5bc0ea=_0x9bde[_0x32fab6];return _0x5bc0ea;};'use strict';var _=require('lodash');var util=require(_0xe9bd('0x0'));var moment=require('moment');var BPromise=require(_0xe9bd('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe9bd('0x2'));var db=require(_0xe9bd('0x3'))['db'];var utils=require(_0xe9bd('0x4'));var logger=require(_0xe9bd('0x5'))(_0xe9bd('0x6'));var config=require(_0xe9bd('0x7'));var jayson=require(_0xe9bd('0x8'));var client=jayson['client'][_0xe9bd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5f18fe,_0x22a438,_0xa66ae2){return new BPromise(function(_0x2d5c75,_0x3ef9e3){return client[_0xe9bd('0xa')](_0x5f18fe,_0xa66ae2)[_0xe9bd('0xb')](function(_0x439abc){logger[_0xe9bd('0xc')]('ServicenowField,\x20%s,\x20%s',_0x22a438,'request\x20sent');logger[_0xe9bd('0xd')](_0xe9bd('0xe'),_0x22a438,_0xe9bd('0xf'),JSON['stringify'](_0x439abc));if(_0x439abc[_0xe9bd('0x10')]){if(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x11')]===0x1f4){logger[_0xe9bd('0x10')]('ServicenowField,\x20%s,\x20%s',_0x22a438,_0x439abc[_0xe9bd('0x10')]['message']);return _0x3ef9e3(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x12')]);}logger[_0xe9bd('0x10')]('ServicenowField,\x20%s,\x20%s',_0x22a438,_0x439abc['error'][_0xe9bd('0x12')]);return _0x2d5c75(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x12')]);}else{logger[_0xe9bd('0xc')](_0xe9bd('0x13'),_0x22a438,_0xe9bd('0xf'));_0x2d5c75(_0x439abc[_0xe9bd('0x14')]['message']);}})[_0xe9bd('0x15')](function(_0x464a1b){logger[_0xe9bd('0x10')]('ServicenowField,\x20%s,\x20%s',_0x22a438,_0x464a1b);_0x3ef9e3(_0x464a1b);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 6504683..fe5f535 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(_0x528ce7,_0x3d162d){var _0x361ce8=function(_0x51c5e9){while(--_0x51c5e9){_0x528ce7['push'](_0x528ce7['shift']());}};_0x361ce8(++_0x3d162d);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/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(_0x2313c0,_0x4a1d11){var _0x5c736f=function(_0x24481a){while(--_0x24481a){_0x2313c0['push'](_0x2313c0['shift']());}};_0x5c736f(++_0x4a1d11);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index 780138f..987732f 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(_0xab8e6f,_0x3bd054){var _0x146eb0=function(_0x3f7d21){while(--_0x3f7d21){_0xab8e6f['push'](_0xab8e6f['shift']());}};_0x146eb0(++_0x3bd054);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'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(_0x3f5406,_0x4a6ce7){var _0x2045d8=function(_0x1bc781){while(--_0x1bc781){_0x3f5406['push'](_0x3f5406['shift']());}};_0x2045d8(++_0x4a6ce7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'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 665882c..6e408fd 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 _0x6de8=['mustache','util','path','sox','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../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','apply','reject','save','update','then','stack','name','send','index','SugarcrmAccount','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','filter','where','options','include','findAll','rows','catch','show','params','includeAll','merge','create','body','find','destroy','getConfigurations','findOne','hasOwnProperty','AccountId','getSubjects','channel','Descriptions','getDescriptions','SugarcrmConfiguration','Subjects','SugarcrmField','getFields','assigned_user_id','created_by','description','date_start','duration_minutes','parent_id','direction','username','password','remoteUri','slice','substring','lastIndexOf','format','%s%s','/service/v4_1/rest.php','login','JSON','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','get_module_fields','stringify','Calls','values','module_fields','includes','label','endsWith','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','fast-json-patch','moment'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0x6de8,0x15f));var _0x86de=function(_0x43444b,_0x8cf95b){_0x43444b=_0x43444b-0x0;var _0x392fe5=_0x6de8[_0x43444b];return _0x392fe5;};'use strict';var emlformat=require(_0x86de('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x86de('0x1'));var rp=require('request-promise');var moment=require(_0x86de('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x86de('0x3'));var util=require(_0x86de('0x4'));var path=require(_0x86de('0x5'));var sox=require(_0x86de('0x6'));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('squel');var crypto=require('crypto');var jsforce=require(_0x86de('0x7'));var deskjs=require(_0x86de('0x8'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x86de('0x9'));var Redis=require(_0x86de('0xa'));var authService=require(_0x86de('0xb'));var qs=require('../../components/parsers/qs');var as=require(_0x86de('0xc'));var hardwareService=require(_0x86de('0xd'));var logger=require(_0x86de('0xe'))(_0x86de('0xf'));var utils=require('../../config/utils');var config=require(_0x86de('0x10'));var licenseUtil=require(_0x86de('0x11'));var db=require(_0x86de('0x12'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x5c56cb,_0x45f508){_0x45f508=_0x45f508||0xcc;return function(_0x59ab3a){if(_0x59ab3a){return _0x5c56cb[_0x86de('0x13')](_0x45f508);}return _0x5c56cb[_0x86de('0x14')](_0x45f508)[_0x86de('0x15')]();};}function respondWithResult(_0x4134bc,_0x178aab){_0x178aab=_0x178aab||0xc8;return function(_0x2d15c9){if(_0x2d15c9){return _0x4134bc['status'](_0x178aab)[_0x86de('0x16')](_0x2d15c9);}};}function respondWithFilteredResult(_0x44ee65,_0x468805){return function(_0x3ea09a){if(_0x3ea09a){var _0x1f0ef2=typeof _0x468805[_0x86de('0x17')]===_0x86de('0x18')&&typeof _0x468805[_0x86de('0x19')]==='undefined';var _0x90a3ac=_0x3ea09a[_0x86de('0x1a')];var _0x3064a7=_0x1f0ef2?0x0:_0x468805[_0x86de('0x17')];var _0x3453c7=_0x1f0ef2?_0x3ea09a[_0x86de('0x1a')]:_0x468805[_0x86de('0x17')]+_0x468805[_0x86de('0x19')];var _0x36c268;if(_0x3453c7>=_0x90a3ac){_0x3453c7=_0x90a3ac;_0x36c268=0xc8;}else{_0x36c268=0xce;}_0x44ee65[_0x86de('0x14')](_0x36c268);return _0x44ee65[_0x86de('0x1b')](_0x86de('0x1c'),_0x3064a7+'-'+_0x3453c7+'/'+_0x90a3ac)[_0x86de('0x16')](_0x3ea09a);}return null;};}function patchUpdates(_0x58146b){return function(_0x24729d){try{jsonpatch[_0x86de('0x1d')](_0x24729d,_0x58146b,!![]);}catch(_0x5e37ff){return BPromise[_0x86de('0x1e')](_0x5e37ff);}return _0x24729d[_0x86de('0x1f')]();};}function saveUpdates(_0x5904ab,_0x1b8dd0){return function(_0x8ee4d2){if(_0x8ee4d2){return _0x8ee4d2[_0x86de('0x20')](_0x5904ab)[_0x86de('0x21')](function(_0x425cb8){return _0x425cb8;});}return null;};}function removeEntity(_0x373d45,_0x2ef8fd){return function(_0x4bcd5d){if(_0x4bcd5d){return _0x4bcd5d['destroy']()[_0x86de('0x21')](function(){_0x373d45[_0x86de('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3bc5d5,_0xe7ad1b){return function(_0x17cf69){if(!_0x17cf69){_0x3bc5d5[_0x86de('0x13')](0x194);}return _0x17cf69;};}function handleError(_0x29143f,_0x194c08){_0x194c08=_0x194c08||0x1f4;return function(_0x4def12){logger['error'](_0x4def12[_0x86de('0x22')]);if(_0x4def12[_0x86de('0x23')]){delete _0x4def12[_0x86de('0x23')];}_0x29143f[_0x86de('0x14')](_0x194c08)[_0x86de('0x24')](_0x4def12);};}exports[_0x86de('0x25')]=function(_0x3f3827,_0x263a9d){var _0x297b04={},_0x291ce2={},_0x474df1={'count':0x0,'rows':[]};var _0x3ef1fd=_['map'](db[_0x86de('0x26')][_0x86de('0x27')],function(_0x45b427){return{'name':_0x45b427[_0x86de('0x28')],'type':_0x45b427[_0x86de('0x29')][_0x86de('0x2a')]};});_0x291ce2[_0x86de('0x2b')]=_[_0x86de('0x2c')](_0x3ef1fd,_0x86de('0x23'));_0x291ce2[_0x86de('0x2d')]=_[_0x86de('0x2e')](_0x3f3827['query']);_0x291ce2[_0x86de('0x2f')]=_[_0x86de('0x30')](_0x291ce2[_0x86de('0x2b')],_0x291ce2['query']);_0x297b04['attributes']=_[_0x86de('0x30')](_0x291ce2[_0x86de('0x2b')],qs[_0x86de('0x31')](_0x3f3827[_0x86de('0x2d')][_0x86de('0x31')]));_0x297b04[_0x86de('0x32')]=_0x297b04[_0x86de('0x32')][_0x86de('0x33')]?_0x297b04['attributes']:_0x291ce2[_0x86de('0x2b')];if(!_0x3f3827['query']['hasOwnProperty'](_0x86de('0x34'))){_0x297b04['limit']=qs[_0x86de('0x19')](_0x3f3827[_0x86de('0x2d')][_0x86de('0x19')]);_0x297b04[_0x86de('0x17')]=qs[_0x86de('0x17')](_0x3f3827[_0x86de('0x2d')][_0x86de('0x17')]);}_0x297b04[_0x86de('0x35')]=qs[_0x86de('0x36')](_0x3f3827[_0x86de('0x2d')][_0x86de('0x36')]);_0x297b04['where']=qs[_0x86de('0x2f')](_[_0x86de('0x37')](_0x3f3827[_0x86de('0x2d')],_0x291ce2[_0x86de('0x2f')]),_0x3ef1fd);if(_0x3f3827[_0x86de('0x2d')][_0x86de('0x38')]){_0x297b04[_0x86de('0x39')]=_['merge'](_0x297b04[_0x86de('0x39')],{'$or':_[_0x86de('0x2c')](_0x3ef1fd,function(_0x9fbf53){if(_0x9fbf53['type']!=='VIRTUAL'){var _0x127ec4={};_0x127ec4[_0x9fbf53[_0x86de('0x23')]]={'$like':'%'+_0x3f3827[_0x86de('0x2d')][_0x86de('0x38')]+'%'};return _0x127ec4;}})});}_0x297b04=_['merge']({},_0x297b04,_0x3f3827[_0x86de('0x3a')]);var _0x333d87={'where':_0x297b04['where']};return db[_0x86de('0x26')][_0x86de('0x1a')](_0x333d87)[_0x86de('0x21')](function(_0x495b6d){_0x474df1[_0x86de('0x1a')]=_0x495b6d;if(_0x3f3827[_0x86de('0x2d')]['includeAll']){_0x297b04[_0x86de('0x3b')]=[{'all':!![]}];}return db[_0x86de('0x26')][_0x86de('0x3c')](_0x297b04);})[_0x86de('0x21')](function(_0x4a1905){_0x474df1[_0x86de('0x3d')]=_0x4a1905;return _0x474df1;})[_0x86de('0x21')](respondWithFilteredResult(_0x263a9d,_0x297b04))[_0x86de('0x3e')](handleError(_0x263a9d,null));};exports[_0x86de('0x3f')]=function(_0x2bc855,_0x3fee5d){var _0x1e2d80={'raw':![],'where':{'id':_0x2bc855[_0x86de('0x40')]['id']}},_0x422c1c={};_0x422c1c[_0x86de('0x2b')]=_[_0x86de('0x2e')](db[_0x86de('0x26')]['rawAttributes']);_0x422c1c[_0x86de('0x2d')]=_[_0x86de('0x2e')](_0x2bc855[_0x86de('0x2d')]);_0x422c1c[_0x86de('0x2f')]=_['intersection'](_0x422c1c['model'],_0x422c1c[_0x86de('0x2d')]);_0x1e2d80[_0x86de('0x32')]=_['intersection'](_0x422c1c['model'],qs[_0x86de('0x31')](_0x2bc855[_0x86de('0x2d')][_0x86de('0x31')]));_0x1e2d80[_0x86de('0x32')]=_0x1e2d80[_0x86de('0x32')][_0x86de('0x33')]?_0x1e2d80[_0x86de('0x32')]:_0x422c1c['model'];if(_0x2bc855[_0x86de('0x2d')][_0x86de('0x41')]){_0x1e2d80[_0x86de('0x3b')]=[{'all':!![]}];}_0x1e2d80=_[_0x86de('0x42')]({},_0x1e2d80,_0x2bc855[_0x86de('0x3a')]);return db[_0x86de('0x26')]['find'](_0x1e2d80)[_0x86de('0x21')](handleEntityNotFound(_0x3fee5d,null))[_0x86de('0x21')](respondWithResult(_0x3fee5d,null))[_0x86de('0x3e')](handleError(_0x3fee5d,null));};exports['create']=function(_0x164d6d,_0x574a83){return db[_0x86de('0x26')][_0x86de('0x43')](_0x164d6d[_0x86de('0x44')],{})[_0x86de('0x21')](respondWithResult(_0x574a83,0xc9))[_0x86de('0x3e')](handleError(_0x574a83,null));};exports[_0x86de('0x20')]=function(_0x3132b5,_0x1e5cdd){if(_0x3132b5[_0x86de('0x44')]['id']){delete _0x3132b5[_0x86de('0x44')]['id'];}return db['SugarcrmAccount'][_0x86de('0x45')]({'where':{'id':_0x3132b5['params']['id']}})[_0x86de('0x21')](handleEntityNotFound(_0x1e5cdd,null))['then'](saveUpdates(_0x3132b5[_0x86de('0x44')],null))[_0x86de('0x21')](respondWithResult(_0x1e5cdd,null))[_0x86de('0x3e')](handleError(_0x1e5cdd,null));};exports[_0x86de('0x46')]=function(_0x12e121,_0x13bff3){return db[_0x86de('0x26')]['find']({'where':{'id':_0x12e121[_0x86de('0x40')]['id']}})[_0x86de('0x21')](handleEntityNotFound(_0x13bff3,null))['then'](removeEntity(_0x13bff3,null))[_0x86de('0x3e')](handleError(_0x13bff3,null));};exports[_0x86de('0x47')]=function(_0x44c89e,_0x41c99a,_0x395d0e){var _0x154b3a={};var _0x38f56f={};var _0x4aa73b;var _0x2fbc9c;return db[_0x86de('0x26')][_0x86de('0x48')]({'where':{'id':_0x44c89e[_0x86de('0x40')]['id']}})[_0x86de('0x21')](handleEntityNotFound(_0x41c99a,null))[_0x86de('0x21')](function(_0x312320){if(_0x312320){_0x4aa73b=_0x312320;_0x38f56f['model']=_[_0x86de('0x2e')](db['SugarcrmConfiguration'][_0x86de('0x27')]);_0x38f56f[_0x86de('0x2d')]=_['keys'](_0x44c89e[_0x86de('0x2d')]);_0x38f56f['filters']=_[_0x86de('0x30')](_0x38f56f[_0x86de('0x2b')],_0x38f56f[_0x86de('0x2d')]);_0x154b3a[_0x86de('0x32')]=_[_0x86de('0x30')](_0x38f56f['model'],qs[_0x86de('0x31')](_0x44c89e[_0x86de('0x2d')][_0x86de('0x31')]));_0x154b3a[_0x86de('0x32')]=_0x154b3a[_0x86de('0x32')][_0x86de('0x33')]?_0x154b3a['attributes']:_0x38f56f[_0x86de('0x2b')];_0x154b3a[_0x86de('0x35')]=qs['sort'](_0x44c89e[_0x86de('0x2d')][_0x86de('0x36')]);_0x154b3a[_0x86de('0x39')]=qs['filters'](_[_0x86de('0x37')](_0x44c89e[_0x86de('0x2d')],_0x38f56f[_0x86de('0x2f')]));if(_0x44c89e[_0x86de('0x2d')][_0x86de('0x38')]){_0x154b3a[_0x86de('0x39')]=_[_0x86de('0x42')](_0x154b3a[_0x86de('0x39')],{'$or':_[_0x86de('0x2c')](_0x154b3a['attributes'],function(_0x29843b){var _0x1cc1d5={};_0x1cc1d5[_0x29843b]={'$like':'%'+_0x44c89e[_0x86de('0x2d')]['filter']+'%'};return _0x1cc1d5;})});}_0x154b3a=_[_0x86de('0x42')]({},_0x154b3a,_0x44c89e[_0x86de('0x3a')]);return _0x4aa73b[_0x86de('0x47')](_0x154b3a);}})[_0x86de('0x21')](function(_0x37ffca){if(_0x37ffca){_0x2fbc9c=_0x37ffca[_0x86de('0x33')];if(!_0x44c89e[_0x86de('0x2d')][_0x86de('0x49')](_0x86de('0x34'))){_0x154b3a['limit']=qs[_0x86de('0x19')](_0x44c89e['query'][_0x86de('0x19')]);_0x154b3a[_0x86de('0x17')]=qs[_0x86de('0x17')](_0x44c89e[_0x86de('0x2d')]['offset']);}return _0x4aa73b[_0x86de('0x47')](_0x154b3a);}})[_0x86de('0x21')](function(_0x4084d6){if(_0x4084d6){return _0x4084d6?{'count':_0x2fbc9c,'rows':_0x4084d6}:null;}})['then'](respondWithResult(_0x41c99a,null))[_0x86de('0x3e')](handleError(_0x41c99a,null));};exports['addConfiguration']=function(_0x5e5d10,_0x5ba0eb,_0x25166a){if(_0x5e5d10[_0x86de('0x44')]['id']){delete _0x5e5d10[_0x86de('0x44')]['id'];}return db[_0x86de('0x26')]['findOne']({'where':{'id':_0x5e5d10[_0x86de('0x40')]['id']}})[_0x86de('0x21')](handleEntityNotFound(_0x5ba0eb,null))['then'](function(_0x4ade04){if(_0x4ade04){_0x5e5d10[_0x86de('0x44')][_0x86de('0x4a')]=_0x4ade04['id'];_0x5e5d10['body']['Subjects']=integrations[_0x86de('0x4b')](_0x5e5d10['body'][_0x86de('0x4c')],_0x5e5d10['body'][_0x86de('0x29')]);_0x5e5d10[_0x86de('0x44')][_0x86de('0x4d')]=integrations[_0x86de('0x4e')](_0x5e5d10['body'][_0x86de('0x4c')],_0x5e5d10['body'][_0x86de('0x29')]);return db[_0x86de('0x4f')]['create'](_0x5e5d10['body'],{'include':[{'model':db['SugarcrmField'],'as':_0x86de('0x50')},{'model':db[_0x86de('0x51')],'as':_0x86de('0x4d')}]});}return null;})[_0x86de('0x21')](respondWithResult(_0x5ba0eb,null))[_0x86de('0x3e')](handleError(_0x5ba0eb,null));};exports[_0x86de('0x52')]=function(_0x5e710f,_0xa9cfdf,_0x4853ec){var _0x127f4b='';var _0x3fcf94=['id','name',_0x86de('0x53'),_0x86de('0x54'),_0x86de('0x55'),_0x86de('0x56'),'duration_hours',_0x86de('0x57'),_0x86de('0x58'),'parent_type','parent_name',_0x86de('0x59')];return db['SugarcrmAccount'][_0x86de('0x48')]({'where':{'id':_0x5e710f[_0x86de('0x40')]['id']},'attributes':['id',_0x86de('0x5a'),_0x86de('0x5b'),'remoteUri']})[_0x86de('0x21')](handleEntityNotFound(_0xa9cfdf,null))[_0x86de('0x21')](function(_0x4a4454){if(_0x4a4454){_0x127f4b=_0x4a4454[_0x86de('0x5c')];var _0xd7a8ae=_0x127f4b[_0x86de('0x5d')](-0x1);if(_0xd7a8ae==='/'){_0x127f4b=_0x127f4b[_0x86de('0x5e')](0x0,_0x127f4b[_0x86de('0x5f')](_0xd7a8ae));}return rp({'method':'POST','uri':util[_0x86de('0x60')](_0x86de('0x61'),_0x127f4b,_0x86de('0x62')),'json':!![],'form':{'method':_0x86de('0x63'),'input_type':_0x86de('0x64'),'response_type':_0x86de('0x64'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x4a4454[_0x86de('0x5a')],'password':_0x4a4454['password'],'encryption':_0x86de('0x65')},'application':_0x86de('0x66')})}});}})[_0x86de('0x21')](function(_0x520877){if(_0x520877&&_0x520877[_0x86de('0x23')]!==_0x86de('0x67')&&_0x520877[_0x86de('0x23')]!==_0x86de('0x68')){return rp({'method':'POST','uri':util[_0x86de('0x60')](_0x86de('0x61'),_0x127f4b,_0x86de('0x62')),'json':!![],'form':{'method':_0x86de('0x69'),'input_type':_0x86de('0x64'),'response_type':'JSON','rest_data':JSON[_0x86de('0x6a')]({'session':_0x520877['id'],'module_name':_0x86de('0x6b')})}})[_0x86de('0x21')](function(_0x2f6046){if(_0x2f6046){var _0x124b2c=_[_0x86de('0x6c')](_0x2f6046[_0x86de('0x6d')]);_['remove'](_0x124b2c,function(_0x5af8b5){return _0x3fcf94[_0x86de('0x6e')](_0x5af8b5['name']);});return{'count':_0x124b2c[_0x86de('0x33')],'rows':_[_0x86de('0x2c')](_0x124b2c,function(_0x5a8d16){return{'id':_0x5a8d16[_0x86de('0x23')],'name':_0x5a8d16[_0x86de('0x6f')],'custom':_[_0x86de('0x70')](_0x5a8d16[_0x86de('0x23')],'_c')?!![]:![],'options':_0x5a8d16[_0x86de('0x3a')]?_['map'](_[_0x86de('0x6c')](_0x5a8d16['options']),function(_0x52e403){return{'name':_0x52e403['value'],'value':_0x52e403[_0x86de('0x23')]};}):[]};})};}})[_0x86de('0x21')](respondWithResult(_0xa9cfdf,null))['catch'](function(_0x12a0a6){var _0x287a41=_0x5e710f['query'][_0x86de('0x71')]?0x1f4:_0x12a0a6[_0x86de('0x72')]||0x1f4;logger[_0x86de('0x73')](_0x86de('0x74'),'getFields',_0x287a41,JSON['stringify'](_0x12a0a6));delete _0x12a0a6[_0x86de('0x23')];if(_0x287a41===0x191){_0x287a41=0x190;}_0xa9cfdf['status'](_0x287a41)[_0x86de('0x24')](_0x5e710f[_0x86de('0x2d')]['test']?{'message':_0x86de('0x75'),'statusCode':_0x12a0a6[_0x86de('0x72')]}:_0x12a0a6);});}else{var _0x228d5a=0x1f4;_0xa9cfdf[_0x86de('0x14')](_0x228d5a)[_0x86de('0x24')]({'message':'Wrong\x20credentials','statusCode':0x190});}});}; \ No newline at end of file +var _0xf56b=['end','error','send','index','map','SugarcrmAccount','rawAttributes','type','key','model','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','findAll','show','params','keys','includeAll','find','catch','create','body','getConfigurations','findOne','SugarcrmConfiguration','addConfiguration','AccountId','getSubjects','Descriptions','getDescriptions','channel','SugarcrmField','Subjects','getFields','name','created_by','description','duration_hours','duration_minutes','parent_id','parent_name','username','password','remoteUri','slice','substring','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','xCALLY\x20Motion\x20Integration','Password\x20Expired','stringify','Calls','values','module_fields','remove','includes','endsWith','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','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','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy'];(function(_0x1a151d,_0x4e9f33){var _0x53d471=function(_0x18ab51){while(--_0x18ab51){_0x1a151d['push'](_0x1a151d['shift']());}};_0x53d471(++_0x4e9f33);}(_0xf56b,0x13c));var _0xbf56=function(_0x7a7673,_0x53eb9b){_0x7a7673=_0x7a7673-0x0;var _0x20eda1=_0xf56b[_0x7a7673];return _0x20eda1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbf56('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbf56('0x1'));var rp=require(_0xbf56('0x2'));var moment=require(_0xbf56('0x3'));var BPromise=require(_0xbf56('0x4'));var Mustache=require(_0xbf56('0x5'));var util=require(_0xbf56('0x6'));var path=require(_0xbf56('0x7'));var sox=require(_0xbf56('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbf56('0x9'));var squel=require('squel');var crypto=require(_0xbf56('0xa'));var jsforce=require(_0xbf56('0xb'));var deskjs=require(_0xbf56('0xc'));var toCsv=require(_0xbf56('0xd'));var querystring=require(_0xbf56('0xe'));var Papa=require(_0xbf56('0xf'));var Redis=require(_0xbf56('0x10'));var authService=require(_0xbf56('0x11'));var qs=require(_0xbf56('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbf56('0x13'));var logger=require(_0xbf56('0x14'))(_0xbf56('0x15'));var utils=require(_0xbf56('0x16'));var config=require(_0xbf56('0x17'));var licenseUtil=require(_0xbf56('0x18'));var db=require(_0xbf56('0x19'))['db'];var integrations=require(_0xbf56('0x1a'));function respondWithStatusCode(_0x432383,_0x55bc0a){_0x55bc0a=_0x55bc0a||0xcc;return function(_0x397b7d){if(_0x397b7d){return _0x432383[_0xbf56('0x1b')](_0x55bc0a);}return _0x432383['status'](_0x55bc0a)['end']();};}function respondWithResult(_0x4baa92,_0x250570){_0x250570=_0x250570||0xc8;return function(_0x102c9c){if(_0x102c9c){return _0x4baa92[_0xbf56('0x1c')](_0x250570)[_0xbf56('0x1d')](_0x102c9c);}};}function respondWithFilteredResult(_0x455bbd,_0x3765d7){return function(_0x143c24){if(_0x143c24){var _0x2373a0=typeof _0x3765d7[_0xbf56('0x1e')]===_0xbf56('0x1f')&&typeof _0x3765d7[_0xbf56('0x20')]===_0xbf56('0x1f');var _0x1bd163=_0x143c24[_0xbf56('0x21')];var _0x332c25=_0x2373a0?0x0:_0x3765d7[_0xbf56('0x1e')];var _0x4fb36a=_0x2373a0?_0x143c24[_0xbf56('0x21')]:_0x3765d7[_0xbf56('0x1e')]+_0x3765d7[_0xbf56('0x20')];var _0x18eae3;if(_0x4fb36a>=_0x1bd163){_0x4fb36a=_0x1bd163;_0x18eae3=0xc8;}else{_0x18eae3=0xce;}_0x455bbd['status'](_0x18eae3);return _0x455bbd[_0xbf56('0x22')](_0xbf56('0x23'),_0x332c25+'-'+_0x4fb36a+'/'+_0x1bd163)['json'](_0x143c24);}return null;};}function patchUpdates(_0x3bb8ef){return function(_0x23cd35){try{jsonpatch['apply'](_0x23cd35,_0x3bb8ef,!![]);}catch(_0x78eb1d){return BPromise[_0xbf56('0x24')](_0x78eb1d);}return _0x23cd35[_0xbf56('0x25')]();};}function saveUpdates(_0xb489cc,_0x519691){return function(_0x8a3284){if(_0x8a3284){return _0x8a3284[_0xbf56('0x26')](_0xb489cc)[_0xbf56('0x27')](function(_0x1c9a3e){return _0x1c9a3e;});}return null;};}function removeEntity(_0x2fba65,_0x23b32a){return function(_0x577589){if(_0x577589){return _0x577589[_0xbf56('0x28')]()[_0xbf56('0x27')](function(){_0x2fba65[_0xbf56('0x1c')](0xcc)[_0xbf56('0x29')]();});}};}function handleEntityNotFound(_0x549298,_0x436026){return function(_0x290c2a){if(!_0x290c2a){_0x549298[_0xbf56('0x1b')](0x194);}return _0x290c2a;};}function handleError(_0x4c3309,_0x2addef){_0x2addef=_0x2addef||0x1f4;return function(_0x33ff02){logger[_0xbf56('0x2a')](_0x33ff02['stack']);if(_0x33ff02['name']){delete _0x33ff02['name'];}_0x4c3309['status'](_0x2addef)[_0xbf56('0x2b')](_0x33ff02);};}exports[_0xbf56('0x2c')]=function(_0x3b688b,_0x4e3c70){var _0x398f0f={},_0x46c4b5={},_0x432dc2={'count':0x0,'rows':[]};var _0x35f05c=_[_0xbf56('0x2d')](db[_0xbf56('0x2e')][_0xbf56('0x2f')],function(_0x27679e){return{'name':_0x27679e['fieldName'],'type':_0x27679e[_0xbf56('0x30')][_0xbf56('0x31')]};});_0x46c4b5[_0xbf56('0x32')]=_['map'](_0x35f05c,'name');_0x46c4b5[_0xbf56('0x33')]=_['keys'](_0x3b688b[_0xbf56('0x33')]);_0x46c4b5['filters']=_[_0xbf56('0x34')](_0x46c4b5[_0xbf56('0x32')],_0x46c4b5[_0xbf56('0x33')]);_0x398f0f[_0xbf56('0x35')]=_[_0xbf56('0x34')](_0x46c4b5[_0xbf56('0x32')],qs[_0xbf56('0x36')](_0x3b688b[_0xbf56('0x33')]['fields']));_0x398f0f[_0xbf56('0x35')]=_0x398f0f[_0xbf56('0x35')][_0xbf56('0x37')]?_0x398f0f['attributes']:_0x46c4b5[_0xbf56('0x32')];if(!_0x3b688b['query']['hasOwnProperty'](_0xbf56('0x38'))){_0x398f0f['limit']=qs[_0xbf56('0x20')](_0x3b688b[_0xbf56('0x33')][_0xbf56('0x20')]);_0x398f0f['offset']=qs[_0xbf56('0x1e')](_0x3b688b[_0xbf56('0x33')][_0xbf56('0x1e')]);}_0x398f0f[_0xbf56('0x39')]=qs[_0xbf56('0x3a')](_0x3b688b[_0xbf56('0x33')]['sort']);_0x398f0f[_0xbf56('0x3b')]=qs[_0xbf56('0x3c')](_[_0xbf56('0x3d')](_0x3b688b[_0xbf56('0x33')],_0x46c4b5['filters']),_0x35f05c);if(_0x3b688b['query'][_0xbf56('0x3e')]){_0x398f0f[_0xbf56('0x3b')]=_[_0xbf56('0x3f')](_0x398f0f[_0xbf56('0x3b')],{'$or':_['map'](_0x35f05c,function(_0xf9fdd3){if(_0xf9fdd3['type']!==_0xbf56('0x40')){var _0x38a3fb={};_0x38a3fb[_0xf9fdd3['name']]={'$like':'%'+_0x3b688b[_0xbf56('0x33')][_0xbf56('0x3e')]+'%'};return _0x38a3fb;}})});}_0x398f0f=_['merge']({},_0x398f0f,_0x3b688b[_0xbf56('0x41')]);var _0xcabf05={'where':_0x398f0f[_0xbf56('0x3b')]};return db[_0xbf56('0x2e')]['count'](_0xcabf05)[_0xbf56('0x27')](function(_0x428ac0){_0x432dc2[_0xbf56('0x21')]=_0x428ac0;if(_0x3b688b[_0xbf56('0x33')]['includeAll']){_0x398f0f['include']=[{'all':!![]}];}return db['SugarcrmAccount'][_0xbf56('0x42')](_0x398f0f);})[_0xbf56('0x27')](function(_0x4f889f){_0x432dc2['rows']=_0x4f889f;return _0x432dc2;})[_0xbf56('0x27')](respondWithFilteredResult(_0x4e3c70,_0x398f0f))['catch'](handleError(_0x4e3c70,null));};exports[_0xbf56('0x43')]=function(_0x577b02,_0x2c777b){var _0x3de4fc={'raw':![],'where':{'id':_0x577b02[_0xbf56('0x44')]['id']}},_0x39be0b={};_0x39be0b[_0xbf56('0x32')]=_[_0xbf56('0x45')](db[_0xbf56('0x2e')][_0xbf56('0x2f')]);_0x39be0b[_0xbf56('0x33')]=_[_0xbf56('0x45')](_0x577b02[_0xbf56('0x33')]);_0x39be0b[_0xbf56('0x3c')]=_['intersection'](_0x39be0b[_0xbf56('0x32')],_0x39be0b[_0xbf56('0x33')]);_0x3de4fc['attributes']=_[_0xbf56('0x34')](_0x39be0b[_0xbf56('0x32')],qs['fields'](_0x577b02[_0xbf56('0x33')][_0xbf56('0x36')]));_0x3de4fc[_0xbf56('0x35')]=_0x3de4fc[_0xbf56('0x35')][_0xbf56('0x37')]?_0x3de4fc[_0xbf56('0x35')]:_0x39be0b[_0xbf56('0x32')];if(_0x577b02[_0xbf56('0x33')][_0xbf56('0x46')]){_0x3de4fc['include']=[{'all':!![]}];}_0x3de4fc=_[_0xbf56('0x3f')]({},_0x3de4fc,_0x577b02[_0xbf56('0x41')]);return db[_0xbf56('0x2e')][_0xbf56('0x47')](_0x3de4fc)[_0xbf56('0x27')](handleEntityNotFound(_0x2c777b,null))['then'](respondWithResult(_0x2c777b,null))[_0xbf56('0x48')](handleError(_0x2c777b,null));};exports[_0xbf56('0x49')]=function(_0x47e473,_0x384175){return db[_0xbf56('0x2e')]['create'](_0x47e473['body'],{})['then'](respondWithResult(_0x384175,0xc9))[_0xbf56('0x48')](handleError(_0x384175,null));};exports[_0xbf56('0x26')]=function(_0x1e9042,_0x4b835a){if(_0x1e9042['body']['id']){delete _0x1e9042[_0xbf56('0x4a')]['id'];}return db[_0xbf56('0x2e')][_0xbf56('0x47')]({'where':{'id':_0x1e9042[_0xbf56('0x44')]['id']}})[_0xbf56('0x27')](handleEntityNotFound(_0x4b835a,null))[_0xbf56('0x27')](saveUpdates(_0x1e9042['body'],null))[_0xbf56('0x27')](respondWithResult(_0x4b835a,null))[_0xbf56('0x48')](handleError(_0x4b835a,null));};exports[_0xbf56('0x28')]=function(_0x22198d,_0x29a290){return db[_0xbf56('0x2e')][_0xbf56('0x47')]({'where':{'id':_0x22198d[_0xbf56('0x44')]['id']}})[_0xbf56('0x27')](handleEntityNotFound(_0x29a290,null))[_0xbf56('0x27')](removeEntity(_0x29a290,null))[_0xbf56('0x48')](handleError(_0x29a290,null));};exports[_0xbf56('0x4b')]=function(_0x3b8aa3,_0x49a653,_0x116627){var _0x2d694d={};var _0x1ea6df={};var _0x5bfaec;var _0x377625;return db[_0xbf56('0x2e')][_0xbf56('0x4c')]({'where':{'id':_0x3b8aa3[_0xbf56('0x44')]['id']}})['then'](handleEntityNotFound(_0x49a653,null))['then'](function(_0xe6d8f1){if(_0xe6d8f1){_0x5bfaec=_0xe6d8f1;_0x1ea6df['model']=_[_0xbf56('0x45')](db[_0xbf56('0x4d')][_0xbf56('0x2f')]);_0x1ea6df[_0xbf56('0x33')]=_[_0xbf56('0x45')](_0x3b8aa3[_0xbf56('0x33')]);_0x1ea6df[_0xbf56('0x3c')]=_[_0xbf56('0x34')](_0x1ea6df[_0xbf56('0x32')],_0x1ea6df[_0xbf56('0x33')]);_0x2d694d[_0xbf56('0x35')]=_[_0xbf56('0x34')](_0x1ea6df[_0xbf56('0x32')],qs[_0xbf56('0x36')](_0x3b8aa3['query'][_0xbf56('0x36')]));_0x2d694d[_0xbf56('0x35')]=_0x2d694d['attributes'][_0xbf56('0x37')]?_0x2d694d[_0xbf56('0x35')]:_0x1ea6df[_0xbf56('0x32')];_0x2d694d[_0xbf56('0x39')]=qs[_0xbf56('0x3a')](_0x3b8aa3['query'][_0xbf56('0x3a')]);_0x2d694d[_0xbf56('0x3b')]=qs[_0xbf56('0x3c')](_[_0xbf56('0x3d')](_0x3b8aa3[_0xbf56('0x33')],_0x1ea6df[_0xbf56('0x3c')]));if(_0x3b8aa3['query'][_0xbf56('0x3e')]){_0x2d694d[_0xbf56('0x3b')]=_[_0xbf56('0x3f')](_0x2d694d[_0xbf56('0x3b')],{'$or':_['map'](_0x2d694d[_0xbf56('0x35')],function(_0x3ec51e){var _0x18a781={};_0x18a781[_0x3ec51e]={'$like':'%'+_0x3b8aa3[_0xbf56('0x33')][_0xbf56('0x3e')]+'%'};return _0x18a781;})});}_0x2d694d=_['merge']({},_0x2d694d,_0x3b8aa3[_0xbf56('0x41')]);return _0x5bfaec[_0xbf56('0x4b')](_0x2d694d);}})[_0xbf56('0x27')](function(_0x5ccf90){if(_0x5ccf90){_0x377625=_0x5ccf90[_0xbf56('0x37')];if(!_0x3b8aa3[_0xbf56('0x33')]['hasOwnProperty'](_0xbf56('0x38'))){_0x2d694d[_0xbf56('0x20')]=qs[_0xbf56('0x20')](_0x3b8aa3[_0xbf56('0x33')][_0xbf56('0x20')]);_0x2d694d['offset']=qs['offset'](_0x3b8aa3['query'][_0xbf56('0x1e')]);}return _0x5bfaec[_0xbf56('0x4b')](_0x2d694d);}})[_0xbf56('0x27')](function(_0x2bf508){if(_0x2bf508){return _0x2bf508?{'count':_0x377625,'rows':_0x2bf508}:null;}})['then'](respondWithResult(_0x49a653,null))[_0xbf56('0x48')](handleError(_0x49a653,null));};exports[_0xbf56('0x4e')]=function(_0x368c15,_0x599e3e,_0x2a36a2){if(_0x368c15[_0xbf56('0x4a')]['id']){delete _0x368c15[_0xbf56('0x4a')]['id'];}return db[_0xbf56('0x2e')][_0xbf56('0x4c')]({'where':{'id':_0x368c15[_0xbf56('0x44')]['id']}})['then'](handleEntityNotFound(_0x599e3e,null))['then'](function(_0x46851c){if(_0x46851c){_0x368c15['body'][_0xbf56('0x4f')]=_0x46851c['id'];_0x368c15[_0xbf56('0x4a')]['Subjects']=integrations[_0xbf56('0x50')](_0x368c15[_0xbf56('0x4a')]['channel'],_0x368c15[_0xbf56('0x4a')][_0xbf56('0x30')]);_0x368c15[_0xbf56('0x4a')][_0xbf56('0x51')]=integrations[_0xbf56('0x52')](_0x368c15['body'][_0xbf56('0x53')],_0x368c15[_0xbf56('0x4a')][_0xbf56('0x30')]);return db[_0xbf56('0x4d')][_0xbf56('0x49')](_0x368c15[_0xbf56('0x4a')],{'include':[{'model':db[_0xbf56('0x54')],'as':_0xbf56('0x55')},{'model':db[_0xbf56('0x54')],'as':_0xbf56('0x51')}]});}return null;})[_0xbf56('0x27')](respondWithResult(_0x599e3e,null))[_0xbf56('0x48')](handleError(_0x599e3e,null));};exports[_0xbf56('0x56')]=function(_0xd89dec,_0x531fbb,_0x21f843){var _0xee3b05='';var _0x5182b4=['id',_0xbf56('0x57'),'assigned_user_id',_0xbf56('0x58'),_0xbf56('0x59'),'date_start',_0xbf56('0x5a'),_0xbf56('0x5b'),_0xbf56('0x5c'),'parent_type',_0xbf56('0x5d'),'direction'];return db[_0xbf56('0x2e')][_0xbf56('0x4c')]({'where':{'id':_0xd89dec[_0xbf56('0x44')]['id']},'attributes':['id',_0xbf56('0x5e'),_0xbf56('0x5f'),'remoteUri']})['then'](handleEntityNotFound(_0x531fbb,null))[_0xbf56('0x27')](function(_0x28ac0a){if(_0x28ac0a){_0xee3b05=_0x28ac0a[_0xbf56('0x60')];var _0x3a2fca=_0xee3b05[_0xbf56('0x61')](-0x1);if(_0x3a2fca==='/'){_0xee3b05=_0xee3b05[_0xbf56('0x62')](0x0,_0xee3b05[_0xbf56('0x63')](_0x3a2fca));}return rp({'method':_0xbf56('0x64'),'uri':util[_0xbf56('0x65')](_0xbf56('0x66'),_0xee3b05,_0xbf56('0x67')),'json':!![],'form':{'method':_0xbf56('0x68'),'input_type':_0xbf56('0x69'),'response_type':_0xbf56('0x69'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x28ac0a[_0xbf56('0x5e')],'password':_0x28ac0a[_0xbf56('0x5f')],'encryption':'PLAIN'},'application':_0xbf56('0x6a')})}});}})['then'](function(_0x195909){if(_0x195909&&_0x195909[_0xbf56('0x57')]!=='Invalid\x20Login'&&_0x195909[_0xbf56('0x57')]!==_0xbf56('0x6b')){return rp({'method':_0xbf56('0x64'),'uri':util[_0xbf56('0x65')](_0xbf56('0x66'),_0xee3b05,'/service/v4_1/rest.php'),'json':!![],'form':{'method':'get_module_fields','input_type':_0xbf56('0x69'),'response_type':'JSON','rest_data':JSON[_0xbf56('0x6c')]({'session':_0x195909['id'],'module_name':_0xbf56('0x6d')})}})['then'](function(_0x1ebafa){if(_0x1ebafa){var _0xa227f=_[_0xbf56('0x6e')](_0x1ebafa[_0xbf56('0x6f')]);_[_0xbf56('0x70')](_0xa227f,function(_0x45d5a1){return _0x5182b4[_0xbf56('0x71')](_0x45d5a1[_0xbf56('0x57')]);});return{'count':_0xa227f[_0xbf56('0x37')],'rows':_['map'](_0xa227f,function(_0x105a75){return{'id':_0x105a75['name'],'name':_0x105a75['label'],'custom':_[_0xbf56('0x72')](_0x105a75[_0xbf56('0x57')],'_c')?!![]:![],'options':_0x105a75[_0xbf56('0x41')]?_[_0xbf56('0x2d')](_[_0xbf56('0x6e')](_0x105a75['options']),function(_0x486669){return{'name':_0x486669['value'],'value':_0x486669['name']};}):[]};})};}})[_0xbf56('0x27')](respondWithResult(_0x531fbb,null))['catch'](function(_0x71450a){var _0x1b699f=_0xd89dec[_0xbf56('0x33')][_0xbf56('0x73')]?0x1f4:_0x71450a[_0xbf56('0x74')]||0x1f4;logger[_0xbf56('0x2a')](_0xbf56('0x75'),'getFields',_0x1b699f,JSON['stringify'](_0x71450a));delete _0x71450a[_0xbf56('0x57')];if(_0x1b699f===0x191){_0x1b699f=0x190;}_0x531fbb[_0xbf56('0x1c')](_0x1b699f)['send'](_0xd89dec[_0xbf56('0x33')][_0xbf56('0x73')]?{'message':_0xbf56('0x76'),'statusCode':_0x71450a[_0xbf56('0x74')]}:_0x71450a);});}else{var _0x46d642=0x1f4;_0x531fbb[_0xbf56('0x1c')](_0x46d642)[_0xbf56('0x2b')]({'message':_0xbf56('0x76'),'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 efc7de6..a194058 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 _0xe082=['rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define','SugarcrmAccount','int_sugarcrm_accounts','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x88f8ca,_0x1e419a){var _0x46f4b1=function(_0x5a21a1){while(--_0x5a21a1){_0x88f8ca['push'](_0x88f8ca['shift']());}};_0x46f4b1(++_0x1e419a);}(_0xe082,0x8f));var _0x2e08=function(_0x47afba,_0x290a9d){_0x47afba=_0x47afba-0x0;var _0x55d7b4=_0xe082[_0x47afba];return _0x55d7b4;};'use strict';var _=require(_0x2e08('0x0'));var util=require(_0x2e08('0x1'));var logger=require(_0x2e08('0x2'))('api');var moment=require(_0x2e08('0x3'));var BPromise=require(_0x2e08('0x4'));var rp=require(_0x2e08('0x5'));var fs=require('fs');var path=require(_0x2e08('0x6'));var rimraf=require(_0x2e08('0x7'));var config=require(_0x2e08('0x8'));var attributes=require(_0x2e08('0x9'));var integrations=require(_0x2e08('0xa'));module[_0x2e08('0xb')]=function(_0x3de149,_0x1036b1){return _0x3de149[_0x2e08('0xc')](_0x2e08('0xd'),attributes,{'tableName':_0x2e08('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1efe=['path','rimraf','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define','int_sugarcrm_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x301b78,_0x1742f3){var _0x2db9f9=function(_0x48a663){while(--_0x48a663){_0x301b78['push'](_0x301b78['shift']());}};_0x2db9f9(++_0x1742f3);}(_0x1efe,0x1d5));var _0xe1ef=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0x1efe[_0x279d37];return _0x530173;};'use strict';var _=require(_0xe1ef('0x0'));var util=require(_0xe1ef('0x1'));var logger=require(_0xe1ef('0x2'))(_0xe1ef('0x3'));var moment=require(_0xe1ef('0x4'));var BPromise=require(_0xe1ef('0x5'));var rp=require(_0xe1ef('0x6'));var fs=require('fs');var path=require(_0xe1ef('0x7'));var rimraf=require(_0xe1ef('0x8'));var config=require('../../config/environment');var attributes=require(_0xe1ef('0x9'));var integrations=require(_0xe1ef('0xa'));module[_0xe1ef('0xb')]=function(_0x5c35fd,_0xc413fb){return _0x5c35fd[_0xe1ef('0xc')]('SugarcrmAccount',attributes,{'tableName':_0xe1ef('0xd'),'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 75ddc2c..30b8427 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 _0xc99a=['info','SugarcrmAccount,\x20%s,\x20%s','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','GetSugarcrmAccount','SugarcrmAccount','options','where','attributes','limit','include','map','model','debug','ShowSugarcrmAccount','find','raw','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0xe5d511,_0x9d9cdf){var _0x142b83=function(_0x3d32df){while(--_0x3d32df){_0xe5d511['push'](_0xe5d511['shift']());}};_0x142b83(++_0x9d9cdf);}(_0xc99a,0x12e));var _0xac99=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc99a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xac99('0x0'));var moment=require('moment');var BPromise=require(_0xac99('0x1'));var rs=require(_0xac99('0x2'));var fs=require('fs');var Redis=require(_0xac99('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xac99('0x4'));var logger=require(_0xac99('0x5'))(_0xac99('0x6'));var config=require(_0xac99('0x7'));var jayson=require(_0xac99('0x8'));var client=jayson[_0xac99('0x9')][_0xac99('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5f2b15,_0x5f58de,_0x5822ff){return new BPromise(function(_0x32be79,_0x4fd313){return client[_0xac99('0xb')](_0x5f2b15,_0x5822ff)[_0xac99('0xc')](function(_0x69f56f){logger[_0xac99('0xd')](_0xac99('0xe'),_0x5f58de,'request\x20sent');logger['debug'](_0xac99('0xf'),_0x5f58de,'request\x20sent',JSON[_0xac99('0x10')](_0x69f56f));if(_0x69f56f[_0xac99('0x11')]){if(_0x69f56f[_0xac99('0x11')][_0xac99('0x12')]===0x1f4){logger[_0xac99('0x11')](_0xac99('0xe'),_0x5f58de,_0x69f56f[_0xac99('0x11')][_0xac99('0x13')]);return _0x4fd313(_0x69f56f[_0xac99('0x11')]['message']);}logger[_0xac99('0x11')](_0xac99('0xe'),_0x5f58de,_0x69f56f['error']['message']);return _0x32be79(_0x69f56f['error'][_0xac99('0x13')]);}else{logger[_0xac99('0xd')](_0xac99('0xe'),_0x5f58de,_0xac99('0x14'));_0x32be79(_0x69f56f['result'][_0xac99('0x13')]);}})[_0xac99('0x15')](function(_0x226a55){logger[_0xac99('0x11')](_0xac99('0xe'),_0x5f58de,_0x226a55);_0x4fd313(_0x226a55);});});}exports[_0xac99('0x16')]=function(_0x480a98){var _0x17a202=this;return new Promise(function(_0x3ccec2,_0x29c9e2){return db[_0xac99('0x17')]['findAll']({'raw':_0x480a98[_0xac99('0x18')]?_0x480a98[_0xac99('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x480a98['options']?_0x480a98[_0xac99('0x18')][_0xac99('0x19')]||null:null,'attributes':_0x480a98['options']?_0x480a98[_0xac99('0x18')][_0xac99('0x1a')]||null:null,'limit':_0x480a98[_0xac99('0x18')]?_0x480a98[_0xac99('0x18')][_0xac99('0x1b')]||null:null,'include':_0x480a98['options']?_0x480a98['options']['include']?_['map'](_0x480a98[_0xac99('0x18')][_0xac99('0x1c')],function(_0x2ea103){return{'model':db[_0x2ea103['model']],'as':_0x2ea103['as'],'attributes':_0x2ea103['attributes'],'include':_0x2ea103[_0xac99('0x1c')]?_[_0xac99('0x1d')](_0x2ea103['include'],function(_0x236184){return{'model':db[_0x236184['model']],'as':_0x236184['as'],'attributes':_0x236184[_0xac99('0x1a')],'include':_0x236184['include']?_[_0xac99('0x1d')](_0x236184[_0xac99('0x1c')],function(_0x2457df){return{'model':db[_0x2457df[_0xac99('0x1e')]],'as':_0x2457df['as'],'attributes':_0x2457df[_0xac99('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xac99('0xc')](function(_0x229ad3){logger['info'](_0xac99('0x16'),_0x480a98);logger[_0xac99('0x1f')](_0xac99('0x16'),_0x480a98,JSON[_0xac99('0x10')](_0x229ad3));_0x3ccec2(_0x229ad3);})['catch'](function(_0xa25bc5){logger[_0xac99('0x11')](_0xac99('0x16'),_0xa25bc5['message'],_0x480a98);_0x29c9e2(_0x17a202[_0xac99('0x11')](0x1f4,_0xa25bc5['message']));});});};exports[_0xac99('0x20')]=function(_0x3d35a7){var _0x8f996e=this;return new Promise(function(_0x5359d2,_0x1a897e){return db['SugarcrmAccount'][_0xac99('0x21')]({'raw':_0x3d35a7[_0xac99('0x18')]?_0x3d35a7[_0xac99('0x18')][_0xac99('0x22')]===undefined?!![]:![]:!![],'where':_0x3d35a7[_0xac99('0x18')]?_0x3d35a7['options'][_0xac99('0x19')]||null:null,'attributes':_0x3d35a7[_0xac99('0x18')]?_0x3d35a7[_0xac99('0x18')][_0xac99('0x1a')]||null:null,'include':_0x3d35a7['options']?_0x3d35a7[_0xac99('0x18')][_0xac99('0x1c')]?_[_0xac99('0x1d')](_0x3d35a7[_0xac99('0x18')][_0xac99('0x1c')],function(_0x2e173f){return{'model':db[_0x2e173f['model']],'as':_0x2e173f['as'],'attributes':_0x2e173f[_0xac99('0x1a')],'include':_0x2e173f[_0xac99('0x1c')]?_[_0xac99('0x1d')](_0x2e173f['include'],function(_0x53b9af){return{'model':db[_0x53b9af[_0xac99('0x1e')]],'as':_0x53b9af['as'],'attributes':_0x53b9af[_0xac99('0x1a')],'include':_0x53b9af['include']?_[_0xac99('0x1d')](_0x53b9af[_0xac99('0x1c')],function(_0xfbc078){return{'model':db[_0xfbc078[_0xac99('0x1e')]],'as':_0xfbc078['as'],'attributes':_0xfbc078[_0xac99('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xac99('0xc')](function(_0xb8699d){logger[_0xac99('0xd')](_0xac99('0x20'),_0x3d35a7);logger[_0xac99('0x1f')](_0xac99('0x20'),_0x3d35a7,JSON[_0xac99('0x10')](_0xb8699d));_0x5359d2(_0xb8699d);})['catch'](function(_0x516151){logger[_0xac99('0x11')](_0xac99('0x20'),_0x516151['message'],_0x3d35a7);_0x1a897e(_0x8f996e[_0xac99('0x11')](0x1f4,_0x516151[_0xac99('0x13')]));});});}; \ No newline at end of file +var _0x0ef7=['debug','stringify','error','code','message','info','catch','GetSugarcrmAccount','findAll','options','raw','where','attributes','limit','include','map','model','SugarcrmAccount','find','ShowSugarcrmAccount','util','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SugarcrmAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x5bf7bd,_0x52d967){var _0x4d3227=function(_0x15ed27){while(--_0x15ed27){_0x5bf7bd['push'](_0x5bf7bd['shift']());}};_0x4d3227(++_0x52d967);}(_0x0ef7,0x1a0));var _0x70ef=function(_0x439d59,_0x11ccdf){_0x439d59=_0x439d59-0x0;var _0x3670c7=_0x0ef7[_0x439d59];return _0x3670c7;};'use strict';var _=require('lodash');var util=require(_0x70ef('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x70ef('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x70ef('0x2'));var logger=require(_0x70ef('0x3'))(_0x70ef('0x4'));var config=require(_0x70ef('0x5'));var jayson=require(_0x70ef('0x6'));var client=jayson[_0x70ef('0x7')][_0x70ef('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3e8637,_0x42e7c3,_0x2a21ef){return new BPromise(function(_0xac3858,_0xa35d23){return client[_0x70ef('0x9')](_0x3e8637,_0x2a21ef)[_0x70ef('0xa')](function(_0x3014b5){logger['info'](_0x70ef('0xb'),_0x42e7c3,_0x70ef('0xc'));logger[_0x70ef('0xd')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x42e7c3,_0x70ef('0xc'),JSON[_0x70ef('0xe')](_0x3014b5));if(_0x3014b5[_0x70ef('0xf')]){if(_0x3014b5[_0x70ef('0xf')][_0x70ef('0x10')]===0x1f4){logger[_0x70ef('0xf')]('SugarcrmAccount,\x20%s,\x20%s',_0x42e7c3,_0x3014b5[_0x70ef('0xf')][_0x70ef('0x11')]);return _0xa35d23(_0x3014b5['error']['message']);}logger[_0x70ef('0xf')]('SugarcrmAccount,\x20%s,\x20%s',_0x42e7c3,_0x3014b5['error'][_0x70ef('0x11')]);return _0xac3858(_0x3014b5['error'][_0x70ef('0x11')]);}else{logger[_0x70ef('0x12')](_0x70ef('0xb'),_0x42e7c3,_0x70ef('0xc'));_0xac3858(_0x3014b5['result']['message']);}})[_0x70ef('0x13')](function(_0x1c23b4){logger[_0x70ef('0xf')](_0x70ef('0xb'),_0x42e7c3,_0x1c23b4);_0xa35d23(_0x1c23b4);});});}exports[_0x70ef('0x14')]=function(_0x9d9103){var _0x26a890=this;return new Promise(function(_0x1655f4,_0x4a6941){return db['SugarcrmAccount'][_0x70ef('0x15')]({'raw':_0x9d9103[_0x70ef('0x16')]?_0x9d9103[_0x70ef('0x16')][_0x70ef('0x17')]===undefined?!![]:![]:!![],'where':_0x9d9103['options']?_0x9d9103['options'][_0x70ef('0x18')]||null:null,'attributes':_0x9d9103[_0x70ef('0x16')]?_0x9d9103[_0x70ef('0x16')][_0x70ef('0x19')]||null:null,'limit':_0x9d9103[_0x70ef('0x16')]?_0x9d9103['options'][_0x70ef('0x1a')]||null:null,'include':_0x9d9103[_0x70ef('0x16')]?_0x9d9103[_0x70ef('0x16')][_0x70ef('0x1b')]?_[_0x70ef('0x1c')](_0x9d9103[_0x70ef('0x16')][_0x70ef('0x1b')],function(_0x3e4240){return{'model':db[_0x3e4240['model']],'as':_0x3e4240['as'],'attributes':_0x3e4240[_0x70ef('0x19')],'include':_0x3e4240[_0x70ef('0x1b')]?_[_0x70ef('0x1c')](_0x3e4240[_0x70ef('0x1b')],function(_0x2d2733){return{'model':db[_0x2d2733[_0x70ef('0x1d')]],'as':_0x2d2733['as'],'attributes':_0x2d2733[_0x70ef('0x19')],'include':_0x2d2733[_0x70ef('0x1b')]?_[_0x70ef('0x1c')](_0x2d2733[_0x70ef('0x1b')],function(_0x4d73d5){return{'model':db[_0x4d73d5[_0x70ef('0x1d')]],'as':_0x4d73d5['as'],'attributes':_0x4d73d5[_0x70ef('0x19')]};}):[]};}):[]};}):[]:[]})[_0x70ef('0xa')](function(_0x15120c){logger['info'](_0x70ef('0x14'),_0x9d9103);logger[_0x70ef('0xd')](_0x70ef('0x14'),_0x9d9103,JSON[_0x70ef('0xe')](_0x15120c));_0x1655f4(_0x15120c);})['catch'](function(_0x4b1ec0){logger['error'](_0x70ef('0x14'),_0x4b1ec0[_0x70ef('0x11')],_0x9d9103);_0x4a6941(_0x26a890['error'](0x1f4,_0x4b1ec0[_0x70ef('0x11')]));});});};exports['ShowSugarcrmAccount']=function(_0x524336){var _0x3816d6=this;return new Promise(function(_0x21b229,_0xc43773){return db[_0x70ef('0x1e')][_0x70ef('0x1f')]({'raw':_0x524336[_0x70ef('0x16')]?_0x524336[_0x70ef('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x524336['options']?_0x524336['options'][_0x70ef('0x18')]||null:null,'attributes':_0x524336['options']?_0x524336['options'][_0x70ef('0x19')]||null:null,'include':_0x524336[_0x70ef('0x16')]?_0x524336[_0x70ef('0x16')]['include']?_[_0x70ef('0x1c')](_0x524336[_0x70ef('0x16')][_0x70ef('0x1b')],function(_0x3d1409){return{'model':db[_0x3d1409['model']],'as':_0x3d1409['as'],'attributes':_0x3d1409[_0x70ef('0x19')],'include':_0x3d1409[_0x70ef('0x1b')]?_['map'](_0x3d1409['include'],function(_0x1908f0){return{'model':db[_0x1908f0[_0x70ef('0x1d')]],'as':_0x1908f0['as'],'attributes':_0x1908f0[_0x70ef('0x19')],'include':_0x1908f0[_0x70ef('0x1b')]?_[_0x70ef('0x1c')](_0x1908f0['include'],function(_0x2e9237){return{'model':db[_0x2e9237['model']],'as':_0x2e9237['as'],'attributes':_0x2e9237[_0x70ef('0x19')]};}):[]};}):[]};}):[]:[]})[_0x70ef('0xa')](function(_0x30d4ef){logger['info']('ShowSugarcrmAccount',_0x524336);logger[_0x70ef('0xd')](_0x70ef('0x20'),_0x524336,JSON[_0x70ef('0xe')](_0x30d4ef));_0x21b229(_0x30d4ef);})[_0x70ef('0x13')](function(_0x2fa52e){logger[_0x70ef('0xf')](_0x70ef('0x20'),_0x2fa52e[_0x70ef('0x11')],_0x524336);_0xc43773(_0x3816d6[_0x70ef('0xf')](0x1f4,_0x2fa52e[_0x70ef('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 4099bd2..c063c3a 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 _0x233b=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','isAuthenticated','index','get','/:id','show','/:id/fields','getFields','getSubjects','/:id/descriptions','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x3a2a3c,_0x37bd31){var _0x50ac9a=function(_0x494a7f){while(--_0x494a7f){_0x3a2a3c['push'](_0x3a2a3c['shift']());}};_0x50ac9a(++_0x37bd31);}(_0x233b,0xa9));var _0xb233=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x233b[_0x167cc1];return _0x10bc4b;};'use strict';var multer=require(_0xb233('0x0'));var util=require(_0xb233('0x1'));var path=require(_0xb233('0x2'));var timeout=require(_0xb233('0x3'));var express=require(_0xb233('0x4'));var router=express[_0xb233('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb233('0x6'));var interaction=require(_0xb233('0x7'));var config=require(_0xb233('0x8'));var controller=require(_0xb233('0x9'));router['get']('/',auth[_0xb233('0xa')](),controller[_0xb233('0xb')]);router[_0xb233('0xc')](_0xb233('0xd'),auth[_0xb233('0xa')](),controller[_0xb233('0xe')]);router['get'](_0xb233('0xf'),auth[_0xb233('0xa')](),controller[_0xb233('0x10')]);router[_0xb233('0xc')]('/:id/subjects',auth[_0xb233('0xa')](),controller[_0xb233('0x11')]);router['get'](_0xb233('0x12'),auth[_0xb233('0xa')](),controller['getDescriptions']);router[_0xb233('0x13')]('/',auth[_0xb233('0xa')](),controller[_0xb233('0x14')]);router[_0xb233('0x15')](_0xb233('0xd'),auth[_0xb233('0xa')](),controller[_0xb233('0x16')]);router[_0xb233('0x17')](_0xb233('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0xb233('0x18')]=router; \ No newline at end of file +var _0x5432=['get','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getDescriptions','post','create','update','delete','destroy','multer','util','connect-timeout','express','../../components/auth/service'];(function(_0x35d4e9,_0x298c61){var _0x5c2770=function(_0x2f326a){while(--_0x2f326a){_0x35d4e9['push'](_0x35d4e9['shift']());}};_0x5c2770(++_0x298c61);}(_0x5432,0x187));var _0x2543=function(_0x290877,_0x58359f){_0x290877=_0x290877-0x0;var _0x5c8e1e=_0x5432[_0x290877];return _0x5c8e1e;};'use strict';var multer=require(_0x2543('0x0'));var util=require(_0x2543('0x1'));var path=require('path');var timeout=require(_0x2543('0x2'));var express=require(_0x2543('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x2543('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intSugarcrmConfiguration.controller');router[_0x2543('0x5')]('/',auth['isAuthenticated'](),controller['index']);router[_0x2543('0x5')](_0x2543('0x6'),auth[_0x2543('0x7')](),controller[_0x2543('0x8')]);router[_0x2543('0x5')](_0x2543('0x9'),auth['isAuthenticated'](),controller[_0x2543('0xa')]);router[_0x2543('0x5')](_0x2543('0xb'),auth[_0x2543('0x7')](),controller['getSubjects']);router[_0x2543('0x5')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0x2543('0xc')]);router[_0x2543('0xd')]('/',auth['isAuthenticated'](),controller[_0x2543('0xe')]);router['put'](_0x2543('0x6'),auth[_0x2543('0x7')](),controller[_0x2543('0xf')]);router[_0x2543('0x10')](_0x2543('0x6'),auth[_0x2543('0x7')](),controller[_0x2543('0x11')]);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 a42f8f3..e17a64e 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 _0x1ef2=['STRING','sequelize','exports'];(function(_0xfbb805,_0x594b78){var _0x272f35=function(_0x2d4c02){while(--_0x2d4c02){_0xfbb805['push'](_0xfbb805['shift']());}};_0x272f35(++_0x594b78);}(_0x1ef2,0x1a8));var _0x21ef=function(_0xb292f9,_0x42a4bc){_0xb292f9=_0xb292f9-0x0;var _0x366dab=_0x1ef2[_0xb292f9];return _0x366dab;};'use strict';var Sequelize=require(_0x21ef('0x0'));module[_0x21ef('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x21ef('0x2')]}}; \ No newline at end of file +var _0xc4ab=['sequelize'];(function(_0x293f84,_0xfa7600){var _0x4dd3b1=function(_0x4e4d07){while(--_0x4e4d07){_0x293f84['push'](_0x293f84['shift']());}};_0x4dd3b1(++_0xfa7600);}(_0xc4ab,0x1a6));var _0xbc4a=function(_0x283660,_0x49b33a){_0x283660=_0x283660-0x0;var _0x5cb1d2=_0xc4ab[_0x283660];return _0x5cb1d2;};'use strict';var Sequelize=require(_0xbc4a('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 53b7dec..dc2772e 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 _0xe6f0=['zip-dir','moment','bluebird','path','sox','crypto','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','SugarcrmConfiguration','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','rows','rawAttributes','length','find','catch','create','body','params','getFields','findOne','getSubjects','SugarcrmField','hasOwnProperty','getDescriptions','eml-format'];(function(_0x4af9e7,_0x52b524){var _0x54e758=function(_0x496842){while(--_0x496842){_0x4af9e7['push'](_0x4af9e7['shift']());}};_0x54e758(++_0x52b524);}(_0xe6f0,0xda));var _0x0e6f=function(_0x1066a3,_0x4ae4b6){_0x1066a3=_0x1066a3-0x0;var _0x488ca3=_0xe6f0[_0x1066a3];return _0x488ca3;};'use strict';var emlformat=require(_0x0e6f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0e6f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0e6f('0x2'));var BPromise=require(_0x0e6f('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x0e6f('0x4'));var sox=require(_0x0e6f('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('squel');var crypto=require(_0x0e6f('0x6'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0e6f('0x7'));var querystring=require(_0x0e6f('0x8'));var Papa=require(_0x0e6f('0x9'));var Redis=require(_0x0e6f('0xa'));var authService=require('../../components/auth/service');var qs=require(_0x0e6f('0xb'));var as=require(_0x0e6f('0xc'));var hardwareService=require(_0x0e6f('0xd'));var logger=require(_0x0e6f('0xe'))(_0x0e6f('0xf'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0e6f('0x10'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x49b023,_0x2a23d4){_0x2a23d4=_0x2a23d4||0xcc;return function(_0x2c2a9f){if(_0x2c2a9f){return _0x49b023['sendStatus'](_0x2a23d4);}return _0x49b023[_0x0e6f('0x11')](_0x2a23d4)['end']();};}function respondWithResult(_0x143481,_0x5983f2){_0x5983f2=_0x5983f2||0xc8;return function(_0x507386){if(_0x507386){return _0x143481[_0x0e6f('0x11')](_0x5983f2)[_0x0e6f('0x12')](_0x507386);}};}function respondWithFilteredResult(_0x1e5f21,_0x264b9f){return function(_0xeeb385){if(_0xeeb385){var _0xb6996e=typeof _0x264b9f['offset']===_0x0e6f('0x13')&&typeof _0x264b9f[_0x0e6f('0x14')]===_0x0e6f('0x13');var _0x46c150=_0xeeb385[_0x0e6f('0x15')];var _0xa3bfa4=_0xb6996e?0x0:_0x264b9f[_0x0e6f('0x16')];var _0x335dea=_0xb6996e?_0xeeb385[_0x0e6f('0x15')]:_0x264b9f['offset']+_0x264b9f[_0x0e6f('0x14')];var _0x3b5600;if(_0x335dea>=_0x46c150){_0x335dea=_0x46c150;_0x3b5600=0xc8;}else{_0x3b5600=0xce;}_0x1e5f21[_0x0e6f('0x11')](_0x3b5600);return _0x1e5f21['set'](_0x0e6f('0x17'),_0xa3bfa4+'-'+_0x335dea+'/'+_0x46c150)[_0x0e6f('0x12')](_0xeeb385);}return null;};}function patchUpdates(_0x12f259){return function(_0x550b02){try{jsonpatch[_0x0e6f('0x18')](_0x550b02,_0x12f259,!![]);}catch(_0x4169eb){return BPromise[_0x0e6f('0x19')](_0x4169eb);}return _0x550b02[_0x0e6f('0x1a')]();};}function saveUpdates(_0x401252,_0x31b57f){return function(_0x4b0fab){if(_0x4b0fab){return _0x4b0fab[_0x0e6f('0x1b')](_0x401252)[_0x0e6f('0x1c')](function(_0x242e64){return _0x242e64;});}return null;};}function removeEntity(_0xb84cf0,_0x1490ea){return function(_0x31b55b){if(_0x31b55b){return _0x31b55b[_0x0e6f('0x1d')]()[_0x0e6f('0x1c')](function(){_0xb84cf0[_0x0e6f('0x11')](0xcc)[_0x0e6f('0x1e')]();});}};}function handleEntityNotFound(_0x187741,_0x12881b){return function(_0x193d6c){if(!_0x193d6c){_0x187741[_0x0e6f('0x1f')](0x194);}return _0x193d6c;};}function handleError(_0x4b4357,_0x36aa16){_0x36aa16=_0x36aa16||0x1f4;return function(_0x23ae14){logger[_0x0e6f('0x20')](_0x23ae14[_0x0e6f('0x21')]);if(_0x23ae14[_0x0e6f('0x22')]){delete _0x23ae14['name'];}_0x4b4357['status'](_0x36aa16)[_0x0e6f('0x23')](_0x23ae14);};}exports[_0x0e6f('0x24')]=function(_0xeaece,_0x35a41a){var _0x2825b2={},_0xff6756={},_0xf987e2={'count':0x0,'rows':[]};var _0x400605=_['map'](db[_0x0e6f('0x25')]['rawAttributes'],function(_0x3586b5){return{'name':_0x3586b5[_0x0e6f('0x26')],'type':_0x3586b5[_0x0e6f('0x27')][_0x0e6f('0x28')]};});_0xff6756[_0x0e6f('0x29')]=_['map'](_0x400605,_0x0e6f('0x22'));_0xff6756[_0x0e6f('0x2a')]=_[_0x0e6f('0x2b')](_0xeaece[_0x0e6f('0x2a')]);_0xff6756[_0x0e6f('0x2c')]=_[_0x0e6f('0x2d')](_0xff6756['model'],_0xff6756[_0x0e6f('0x2a')]);_0x2825b2[_0x0e6f('0x2e')]=_['intersection'](_0xff6756['model'],qs[_0x0e6f('0x2f')](_0xeaece[_0x0e6f('0x2a')][_0x0e6f('0x2f')]));_0x2825b2[_0x0e6f('0x2e')]=_0x2825b2[_0x0e6f('0x2e')]['length']?_0x2825b2[_0x0e6f('0x2e')]:_0xff6756[_0x0e6f('0x29')];if(!_0xeaece[_0x0e6f('0x2a')]['hasOwnProperty'](_0x0e6f('0x30'))){_0x2825b2[_0x0e6f('0x14')]=qs[_0x0e6f('0x14')](_0xeaece[_0x0e6f('0x2a')]['limit']);_0x2825b2[_0x0e6f('0x16')]=qs['offset'](_0xeaece[_0x0e6f('0x2a')][_0x0e6f('0x16')]);}_0x2825b2[_0x0e6f('0x31')]=qs[_0x0e6f('0x32')](_0xeaece[_0x0e6f('0x2a')][_0x0e6f('0x32')]);_0x2825b2[_0x0e6f('0x33')]=qs[_0x0e6f('0x2c')](_[_0x0e6f('0x34')](_0xeaece[_0x0e6f('0x2a')],_0xff6756[_0x0e6f('0x2c')]),_0x400605);if(_0xeaece['query'][_0x0e6f('0x35')]){_0x2825b2['where']=_[_0x0e6f('0x36')](_0x2825b2[_0x0e6f('0x33')],{'$or':_[_0x0e6f('0x37')](_0x400605,function(_0x336d4a){if(_0x336d4a[_0x0e6f('0x27')]!==_0x0e6f('0x38')){var _0x2340b6={};_0x2340b6[_0x336d4a[_0x0e6f('0x22')]]={'$like':'%'+_0xeaece[_0x0e6f('0x2a')]['filter']+'%'};return _0x2340b6;}})});}_0x2825b2=_[_0x0e6f('0x36')]({},_0x2825b2,_0xeaece[_0x0e6f('0x39')]);var _0x598e94={'where':_0x2825b2[_0x0e6f('0x33')]};return db['SugarcrmConfiguration'][_0x0e6f('0x15')](_0x598e94)[_0x0e6f('0x1c')](function(_0x2d1828){_0xf987e2['count']=_0x2d1828;if(_0xeaece[_0x0e6f('0x2a')][_0x0e6f('0x3a')]){_0x2825b2['include']=[{'all':!![]}];}return db['SugarcrmConfiguration']['findAll'](_0x2825b2);})[_0x0e6f('0x1c')](function(_0x3dcb72){_0xf987e2[_0x0e6f('0x3b')]=_0x3dcb72;return _0xf987e2;})[_0x0e6f('0x1c')](respondWithFilteredResult(_0x35a41a,_0x2825b2))['catch'](handleError(_0x35a41a,null));};exports['show']=function(_0x5cbe71,_0x152b62){var _0x577986={'raw':![],'where':{'id':_0x5cbe71['params']['id']}},_0x2da033={};_0x2da033[_0x0e6f('0x29')]=_[_0x0e6f('0x2b')](db[_0x0e6f('0x25')][_0x0e6f('0x3c')]);_0x2da033[_0x0e6f('0x2a')]=_['keys'](_0x5cbe71[_0x0e6f('0x2a')]);_0x2da033['filters']=_[_0x0e6f('0x2d')](_0x2da033[_0x0e6f('0x29')],_0x2da033['query']);_0x577986[_0x0e6f('0x2e')]=_[_0x0e6f('0x2d')](_0x2da033[_0x0e6f('0x29')],qs[_0x0e6f('0x2f')](_0x5cbe71[_0x0e6f('0x2a')][_0x0e6f('0x2f')]));_0x577986['attributes']=_0x577986[_0x0e6f('0x2e')][_0x0e6f('0x3d')]?_0x577986[_0x0e6f('0x2e')]:_0x2da033[_0x0e6f('0x29')];if(_0x5cbe71['query']['includeAll']){_0x577986['include']=[{'all':!![]}];}_0x577986=_['merge']({},_0x577986,_0x5cbe71[_0x0e6f('0x39')]);return db[_0x0e6f('0x25')][_0x0e6f('0x3e')](_0x577986)[_0x0e6f('0x1c')](handleEntityNotFound(_0x152b62,null))[_0x0e6f('0x1c')](respondWithResult(_0x152b62,null))[_0x0e6f('0x3f')](handleError(_0x152b62,null));};exports['create']=function(_0x34da12,_0x9cdb5){return db[_0x0e6f('0x25')][_0x0e6f('0x40')](_0x34da12['body'],{})[_0x0e6f('0x1c')](respondWithResult(_0x9cdb5,0xc9))[_0x0e6f('0x3f')](handleError(_0x9cdb5,null));};exports[_0x0e6f('0x1b')]=function(_0x59c2fe,_0x14192c){if(_0x59c2fe[_0x0e6f('0x41')]['id']){delete _0x59c2fe[_0x0e6f('0x41')]['id'];}return db[_0x0e6f('0x25')][_0x0e6f('0x3e')]({'where':{'id':_0x59c2fe[_0x0e6f('0x42')]['id']}})['then'](handleEntityNotFound(_0x14192c,null))[_0x0e6f('0x1c')](saveUpdates(_0x59c2fe[_0x0e6f('0x41')],null))['then'](respondWithResult(_0x14192c,null))[_0x0e6f('0x3f')](handleError(_0x14192c,null));};exports[_0x0e6f('0x1d')]=function(_0x5abd20,_0x244f67){return db[_0x0e6f('0x25')][_0x0e6f('0x3e')]({'where':{'id':_0x5abd20[_0x0e6f('0x42')]['id']}})[_0x0e6f('0x1c')](handleEntityNotFound(_0x244f67,null))['then'](removeEntity(_0x244f67,null))[_0x0e6f('0x3f')](handleError(_0x244f67,null));};exports[_0x0e6f('0x43')]=function(_0x2e4bf1,_0x4210d7,_0x1b9ad8){var _0x113c12={};var _0xe09bc5={};var _0x3ecf4b;var _0x5e9b31;return db[_0x0e6f('0x25')][_0x0e6f('0x44')]({'where':{'id':_0x2e4bf1[_0x0e6f('0x42')]['id']}})[_0x0e6f('0x1c')](handleEntityNotFound(_0x4210d7,null))[_0x0e6f('0x1c')](function(_0x565cf3){if(_0x565cf3){_0x3ecf4b=_0x565cf3;_0xe09bc5['model']=_[_0x0e6f('0x2b')](db['SugarcrmField']['rawAttributes']);_0xe09bc5[_0x0e6f('0x2a')]=_[_0x0e6f('0x2b')](_0x2e4bf1[_0x0e6f('0x2a')]);_0xe09bc5[_0x0e6f('0x2c')]=_[_0x0e6f('0x2d')](_0xe09bc5[_0x0e6f('0x29')],_0xe09bc5[_0x0e6f('0x2a')]);_0x113c12[_0x0e6f('0x2e')]=_[_0x0e6f('0x2d')](_0xe09bc5[_0x0e6f('0x29')],qs[_0x0e6f('0x2f')](_0x2e4bf1[_0x0e6f('0x2a')][_0x0e6f('0x2f')]));_0x113c12['attributes']=_0x113c12[_0x0e6f('0x2e')][_0x0e6f('0x3d')]?_0x113c12[_0x0e6f('0x2e')]:_0xe09bc5['model'];_0x113c12[_0x0e6f('0x31')]=qs[_0x0e6f('0x32')](_0x2e4bf1['query'][_0x0e6f('0x32')]);_0x113c12[_0x0e6f('0x33')]=qs['filters'](_[_0x0e6f('0x34')](_0x2e4bf1[_0x0e6f('0x2a')],_0xe09bc5[_0x0e6f('0x2c')]));if(_0x2e4bf1[_0x0e6f('0x2a')][_0x0e6f('0x35')]){_0x113c12[_0x0e6f('0x33')]=_[_0x0e6f('0x36')](_0x113c12[_0x0e6f('0x33')],{'$or':_[_0x0e6f('0x37')](_0x113c12[_0x0e6f('0x2e')],function(_0x273703){var _0xe1ac87={};_0xe1ac87[_0x273703]={'$like':'%'+_0x2e4bf1[_0x0e6f('0x2a')][_0x0e6f('0x35')]+'%'};return _0xe1ac87;})});}_0x113c12=_[_0x0e6f('0x36')]({},_0x113c12,_0x2e4bf1[_0x0e6f('0x39')]);return _0x3ecf4b[_0x0e6f('0x43')](_0x113c12);}})[_0x0e6f('0x1c')](function(_0x424e01){if(_0x424e01){_0x5e9b31=_0x424e01[_0x0e6f('0x3d')];if(!_0x2e4bf1['query']['hasOwnProperty'](_0x0e6f('0x30'))){_0x113c12['limit']=qs[_0x0e6f('0x14')](_0x2e4bf1[_0x0e6f('0x2a')]['limit']);_0x113c12[_0x0e6f('0x16')]=qs['offset'](_0x2e4bf1['query']['offset']);}return _0x3ecf4b['getFields'](_0x113c12);}})[_0x0e6f('0x1c')](function(_0x99cc6a){if(_0x99cc6a){return _0x99cc6a?{'count':_0x5e9b31,'rows':_0x99cc6a}:null;}})[_0x0e6f('0x1c')](respondWithResult(_0x4210d7,null))[_0x0e6f('0x3f')](handleError(_0x4210d7,null));};exports[_0x0e6f('0x45')]=function(_0x73e17f,_0xe2e84a,_0x5d9fc8){var _0x44ce94={};var _0x18eeb6={};var _0x561531;var _0x2c9cfc;return db[_0x0e6f('0x25')][_0x0e6f('0x44')]({'where':{'id':_0x73e17f[_0x0e6f('0x42')]['id']}})[_0x0e6f('0x1c')](handleEntityNotFound(_0xe2e84a,null))[_0x0e6f('0x1c')](function(_0x4fe050){if(_0x4fe050){_0x561531=_0x4fe050;_0x18eeb6[_0x0e6f('0x29')]=_[_0x0e6f('0x2b')](db[_0x0e6f('0x46')][_0x0e6f('0x3c')]);_0x18eeb6[_0x0e6f('0x2a')]=_[_0x0e6f('0x2b')](_0x73e17f[_0x0e6f('0x2a')]);_0x18eeb6[_0x0e6f('0x2c')]=_[_0x0e6f('0x2d')](_0x18eeb6['model'],_0x18eeb6[_0x0e6f('0x2a')]);_0x44ce94['attributes']=_[_0x0e6f('0x2d')](_0x18eeb6[_0x0e6f('0x29')],qs[_0x0e6f('0x2f')](_0x73e17f[_0x0e6f('0x2a')][_0x0e6f('0x2f')]));_0x44ce94[_0x0e6f('0x2e')]=_0x44ce94['attributes']['length']?_0x44ce94[_0x0e6f('0x2e')]:_0x18eeb6[_0x0e6f('0x29')];_0x44ce94[_0x0e6f('0x31')]=qs['sort'](_0x73e17f['query'][_0x0e6f('0x32')]);_0x44ce94[_0x0e6f('0x33')]=qs[_0x0e6f('0x2c')](_[_0x0e6f('0x34')](_0x73e17f['query'],_0x18eeb6[_0x0e6f('0x2c')]));if(_0x73e17f[_0x0e6f('0x2a')][_0x0e6f('0x35')]){_0x44ce94[_0x0e6f('0x33')]=_[_0x0e6f('0x36')](_0x44ce94[_0x0e6f('0x33')],{'$or':_['map'](_0x44ce94[_0x0e6f('0x2e')],function(_0x2d83ba){var _0x320f99={};_0x320f99[_0x2d83ba]={'$like':'%'+_0x73e17f[_0x0e6f('0x2a')]['filter']+'%'};return _0x320f99;})});}_0x44ce94=_[_0x0e6f('0x36')]({},_0x44ce94,_0x73e17f['options']);return _0x561531[_0x0e6f('0x45')](_0x44ce94);}})[_0x0e6f('0x1c')](function(_0x4a67af){if(_0x4a67af){_0x2c9cfc=_0x4a67af[_0x0e6f('0x3d')];if(!_0x73e17f[_0x0e6f('0x2a')][_0x0e6f('0x47')](_0x0e6f('0x30'))){_0x44ce94[_0x0e6f('0x14')]=qs['limit'](_0x73e17f[_0x0e6f('0x2a')][_0x0e6f('0x14')]);_0x44ce94[_0x0e6f('0x16')]=qs['offset'](_0x73e17f[_0x0e6f('0x2a')][_0x0e6f('0x16')]);}return _0x561531['getSubjects'](_0x44ce94);}})[_0x0e6f('0x1c')](function(_0x4a99fc){if(_0x4a99fc){return _0x4a99fc?{'count':_0x2c9cfc,'rows':_0x4a99fc}:null;}})[_0x0e6f('0x1c')](respondWithResult(_0xe2e84a,null))['catch'](handleError(_0xe2e84a,null));};exports[_0x0e6f('0x48')]=function(_0x3ba629,_0x4f4410,_0x4cc5e0){var _0x4a92bb={};var _0x2031df={};var _0x4dee3b;var _0x1b6679;return db['SugarcrmConfiguration'][_0x0e6f('0x44')]({'where':{'id':_0x3ba629['params']['id']}})['then'](handleEntityNotFound(_0x4f4410,null))[_0x0e6f('0x1c')](function(_0x378f99){if(_0x378f99){_0x4dee3b=_0x378f99;_0x2031df[_0x0e6f('0x29')]=_['keys'](db[_0x0e6f('0x46')][_0x0e6f('0x3c')]);_0x2031df[_0x0e6f('0x2a')]=_[_0x0e6f('0x2b')](_0x3ba629[_0x0e6f('0x2a')]);_0x2031df[_0x0e6f('0x2c')]=_[_0x0e6f('0x2d')](_0x2031df['model'],_0x2031df[_0x0e6f('0x2a')]);_0x4a92bb[_0x0e6f('0x2e')]=_['intersection'](_0x2031df['model'],qs[_0x0e6f('0x2f')](_0x3ba629[_0x0e6f('0x2a')]['fields']));_0x4a92bb[_0x0e6f('0x2e')]=_0x4a92bb['attributes'][_0x0e6f('0x3d')]?_0x4a92bb[_0x0e6f('0x2e')]:_0x2031df[_0x0e6f('0x29')];_0x4a92bb[_0x0e6f('0x31')]=qs['sort'](_0x3ba629[_0x0e6f('0x2a')][_0x0e6f('0x32')]);_0x4a92bb[_0x0e6f('0x33')]=qs['filters'](_['pick'](_0x3ba629[_0x0e6f('0x2a')],_0x2031df[_0x0e6f('0x2c')]));if(_0x3ba629['query'][_0x0e6f('0x35')]){_0x4a92bb[_0x0e6f('0x33')]=_['merge'](_0x4a92bb[_0x0e6f('0x33')],{'$or':_['map'](_0x4a92bb['attributes'],function(_0x2388a2){var _0x512bd4={};_0x512bd4[_0x2388a2]={'$like':'%'+_0x3ba629[_0x0e6f('0x2a')][_0x0e6f('0x35')]+'%'};return _0x512bd4;})});}_0x4a92bb=_[_0x0e6f('0x36')]({},_0x4a92bb,_0x3ba629[_0x0e6f('0x39')]);return _0x4dee3b[_0x0e6f('0x48')](_0x4a92bb);}})[_0x0e6f('0x1c')](function(_0x5ed0fe){if(_0x5ed0fe){_0x1b6679=_0x5ed0fe[_0x0e6f('0x3d')];if(!_0x3ba629[_0x0e6f('0x2a')][_0x0e6f('0x47')](_0x0e6f('0x30'))){_0x4a92bb[_0x0e6f('0x14')]=qs[_0x0e6f('0x14')](_0x3ba629[_0x0e6f('0x2a')]['limit']);_0x4a92bb[_0x0e6f('0x16')]=qs[_0x0e6f('0x16')](_0x3ba629[_0x0e6f('0x2a')]['offset']);}return _0x4dee3b['getDescriptions'](_0x4a92bb);}})[_0x0e6f('0x1c')](function(_0x2ed9ba){if(_0x2ed9ba){return _0x2ed9ba?{'count':_0x1b6679,'rows':_0x2ed9ba}:null;}})[_0x0e6f('0x1c')](respondWithResult(_0x4f4410,null))[_0x0e6f('0x3f')](handleError(_0x4f4410,null));}; \ No newline at end of file +var _0xd11a=['fieldName','type','key','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','options','include','rows','catch','show','params','includeAll','find','create','body','getFields','findOne','SugarcrmField','nolimit','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','count','set','Content-Range','json','apply','reject','update','destroy','then','end','error','stack','name','map','SugarcrmConfiguration','rawAttributes'];(function(_0x3c8ec8,_0x289d7f){var _0x3fe210=function(_0x4518be){while(--_0x4518be){_0x3c8ec8['push'](_0x3c8ec8['shift']());}};_0x3fe210(++_0x289d7f);}(_0xd11a,0x10c));var _0xad11=function(_0x486df6,_0x3389a7){_0x486df6=_0x486df6-0x0;var _0x2efb3b=_0xd11a[_0x486df6];return _0x2efb3b;};'use strict';var emlformat=require(_0xad11('0x0'));var rimraf=require(_0xad11('0x1'));var zipdir=require(_0xad11('0x2'));var jsonpatch=require(_0xad11('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xad11('0x4'));var Mustache=require(_0xad11('0x5'));var util=require('util');var path=require('path');var sox=require(_0xad11('0x6'));var csv=require(_0xad11('0x7'));var ejs=require(_0xad11('0x8'));var fs=require('fs');var fs_extra=require(_0xad11('0x9'));var _=require(_0xad11('0xa'));var squel=require(_0xad11('0xb'));var crypto=require(_0xad11('0xc'));var jsforce=require(_0xad11('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xad11('0x7'));var querystring=require(_0xad11('0xe'));var Papa=require(_0xad11('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xad11('0x10'));var as=require(_0xad11('0x11'));var hardwareService=require(_0xad11('0x12'));var logger=require(_0xad11('0x13'))(_0xad11('0x14'));var utils=require('../../config/utils');var config=require(_0xad11('0x15'));var licenseUtil=require(_0xad11('0x16'));var db=require(_0xad11('0x17'))['db'];function respondWithStatusCode(_0x2b577a,_0x742bb0){_0x742bb0=_0x742bb0||0xcc;return function(_0xb75f45){if(_0xb75f45){return _0x2b577a[_0xad11('0x18')](_0x742bb0);}return _0x2b577a['status'](_0x742bb0)['end']();};}function respondWithResult(_0x4e595b,_0x5eafb5){_0x5eafb5=_0x5eafb5||0xc8;return function(_0x3290a3){if(_0x3290a3){return _0x4e595b[_0xad11('0x19')](_0x5eafb5)['json'](_0x3290a3);}};}function respondWithFilteredResult(_0x382569,_0x3c0d3e){return function(_0xec37d4){if(_0xec37d4){var _0xf86999=typeof _0x3c0d3e[_0xad11('0x1a')]==='undefined'&&typeof _0x3c0d3e[_0xad11('0x1b')]==='undefined';var _0x3a60b1=_0xec37d4[_0xad11('0x1c')];var _0x3e22d2=_0xf86999?0x0:_0x3c0d3e['offset'];var _0x3fa2fd=_0xf86999?_0xec37d4[_0xad11('0x1c')]:_0x3c0d3e['offset']+_0x3c0d3e[_0xad11('0x1b')];var _0x562757;if(_0x3fa2fd>=_0x3a60b1){_0x3fa2fd=_0x3a60b1;_0x562757=0xc8;}else{_0x562757=0xce;}_0x382569[_0xad11('0x19')](_0x562757);return _0x382569[_0xad11('0x1d')](_0xad11('0x1e'),_0x3e22d2+'-'+_0x3fa2fd+'/'+_0x3a60b1)[_0xad11('0x1f')](_0xec37d4);}return null;};}function patchUpdates(_0x2cec91){return function(_0x533ad0){try{jsonpatch[_0xad11('0x20')](_0x533ad0,_0x2cec91,!![]);}catch(_0xccffeb){return BPromise[_0xad11('0x21')](_0xccffeb);}return _0x533ad0['save']();};}function saveUpdates(_0x100521,_0x22b062){return function(_0x1f0e19){if(_0x1f0e19){return _0x1f0e19[_0xad11('0x22')](_0x100521)['then'](function(_0x5da7ee){return _0x5da7ee;});}return null;};}function removeEntity(_0x35dc20,_0x4f314d){return function(_0x2c9e4b){if(_0x2c9e4b){return _0x2c9e4b[_0xad11('0x23')]()[_0xad11('0x24')](function(){_0x35dc20[_0xad11('0x19')](0xcc)[_0xad11('0x25')]();});}};}function handleEntityNotFound(_0x54760d,_0x584185){return function(_0x34f31f){if(!_0x34f31f){_0x54760d[_0xad11('0x18')](0x194);}return _0x34f31f;};}function handleError(_0x584eae,_0x1ea44f){_0x1ea44f=_0x1ea44f||0x1f4;return function(_0x4bc63b){logger[_0xad11('0x26')](_0x4bc63b[_0xad11('0x27')]);if(_0x4bc63b[_0xad11('0x28')]){delete _0x4bc63b['name'];}_0x584eae[_0xad11('0x19')](_0x1ea44f)['send'](_0x4bc63b);};}exports['index']=function(_0x1ee89d,_0x487f5b){var _0x1ff8ef={},_0x51fb65={},_0x1c0dd8={'count':0x0,'rows':[]};var _0x278d0d=_[_0xad11('0x29')](db[_0xad11('0x2a')][_0xad11('0x2b')],function(_0x335908){return{'name':_0x335908[_0xad11('0x2c')],'type':_0x335908[_0xad11('0x2d')][_0xad11('0x2e')]};});_0x51fb65['model']=_[_0xad11('0x29')](_0x278d0d,_0xad11('0x28'));_0x51fb65[_0xad11('0x2f')]=_[_0xad11('0x30')](_0x1ee89d[_0xad11('0x2f')]);_0x51fb65['filters']=_[_0xad11('0x31')](_0x51fb65['model'],_0x51fb65[_0xad11('0x2f')]);_0x1ff8ef[_0xad11('0x32')]=_[_0xad11('0x31')](_0x51fb65[_0xad11('0x33')],qs[_0xad11('0x34')](_0x1ee89d[_0xad11('0x2f')]['fields']));_0x1ff8ef[_0xad11('0x32')]=_0x1ff8ef[_0xad11('0x32')][_0xad11('0x35')]?_0x1ff8ef['attributes']:_0x51fb65['model'];if(!_0x1ee89d[_0xad11('0x2f')][_0xad11('0x36')]('nolimit')){_0x1ff8ef[_0xad11('0x1b')]=qs[_0xad11('0x1b')](_0x1ee89d[_0xad11('0x2f')][_0xad11('0x1b')]);_0x1ff8ef[_0xad11('0x1a')]=qs[_0xad11('0x1a')](_0x1ee89d[_0xad11('0x2f')][_0xad11('0x1a')]);}_0x1ff8ef[_0xad11('0x37')]=qs[_0xad11('0x38')](_0x1ee89d[_0xad11('0x2f')][_0xad11('0x38')]);_0x1ff8ef[_0xad11('0x39')]=qs[_0xad11('0x3a')](_[_0xad11('0x3b')](_0x1ee89d['query'],_0x51fb65[_0xad11('0x3a')]),_0x278d0d);if(_0x1ee89d[_0xad11('0x2f')][_0xad11('0x3c')]){_0x1ff8ef[_0xad11('0x39')]=_['merge'](_0x1ff8ef['where'],{'$or':_['map'](_0x278d0d,function(_0x189a55){if(_0x189a55[_0xad11('0x2d')]!=='VIRTUAL'){var _0x2614ad={};_0x2614ad[_0x189a55[_0xad11('0x28')]]={'$like':'%'+_0x1ee89d['query']['filter']+'%'};return _0x2614ad;}})});}_0x1ff8ef=_[_0xad11('0x3d')]({},_0x1ff8ef,_0x1ee89d[_0xad11('0x3e')]);var _0x478b64={'where':_0x1ff8ef[_0xad11('0x39')]};return db[_0xad11('0x2a')]['count'](_0x478b64)[_0xad11('0x24')](function(_0xcab3dd){_0x1c0dd8[_0xad11('0x1c')]=_0xcab3dd;if(_0x1ee89d[_0xad11('0x2f')]['includeAll']){_0x1ff8ef[_0xad11('0x3f')]=[{'all':!![]}];}return db[_0xad11('0x2a')]['findAll'](_0x1ff8ef);})[_0xad11('0x24')](function(_0x38ad60){_0x1c0dd8[_0xad11('0x40')]=_0x38ad60;return _0x1c0dd8;})[_0xad11('0x24')](respondWithFilteredResult(_0x487f5b,_0x1ff8ef))[_0xad11('0x41')](handleError(_0x487f5b,null));};exports[_0xad11('0x42')]=function(_0x108674,_0x257c97){var _0x8867fe={'raw':![],'where':{'id':_0x108674[_0xad11('0x43')]['id']}},_0xbee154={};_0xbee154[_0xad11('0x33')]=_[_0xad11('0x30')](db['SugarcrmConfiguration'][_0xad11('0x2b')]);_0xbee154[_0xad11('0x2f')]=_[_0xad11('0x30')](_0x108674[_0xad11('0x2f')]);_0xbee154['filters']=_[_0xad11('0x31')](_0xbee154[_0xad11('0x33')],_0xbee154[_0xad11('0x2f')]);_0x8867fe['attributes']=_[_0xad11('0x31')](_0xbee154[_0xad11('0x33')],qs[_0xad11('0x34')](_0x108674['query']['fields']));_0x8867fe[_0xad11('0x32')]=_0x8867fe[_0xad11('0x32')][_0xad11('0x35')]?_0x8867fe[_0xad11('0x32')]:_0xbee154[_0xad11('0x33')];if(_0x108674[_0xad11('0x2f')][_0xad11('0x44')]){_0x8867fe[_0xad11('0x3f')]=[{'all':!![]}];}_0x8867fe=_[_0xad11('0x3d')]({},_0x8867fe,_0x108674['options']);return db[_0xad11('0x2a')][_0xad11('0x45')](_0x8867fe)[_0xad11('0x24')](handleEntityNotFound(_0x257c97,null))[_0xad11('0x24')](respondWithResult(_0x257c97,null))['catch'](handleError(_0x257c97,null));};exports[_0xad11('0x46')]=function(_0x81a2aa,_0x54ddce){return db[_0xad11('0x2a')][_0xad11('0x46')](_0x81a2aa[_0xad11('0x47')],{})[_0xad11('0x24')](respondWithResult(_0x54ddce,0xc9))[_0xad11('0x41')](handleError(_0x54ddce,null));};exports[_0xad11('0x22')]=function(_0x1b2419,_0x4d89cc){if(_0x1b2419[_0xad11('0x47')]['id']){delete _0x1b2419[_0xad11('0x47')]['id'];}return db['SugarcrmConfiguration']['find']({'where':{'id':_0x1b2419[_0xad11('0x43')]['id']}})[_0xad11('0x24')](handleEntityNotFound(_0x4d89cc,null))[_0xad11('0x24')](saveUpdates(_0x1b2419['body'],null))[_0xad11('0x24')](respondWithResult(_0x4d89cc,null))[_0xad11('0x41')](handleError(_0x4d89cc,null));};exports[_0xad11('0x23')]=function(_0x46ace7,_0xcb4ae6){return db[_0xad11('0x2a')][_0xad11('0x45')]({'where':{'id':_0x46ace7[_0xad11('0x43')]['id']}})['then'](handleEntityNotFound(_0xcb4ae6,null))['then'](removeEntity(_0xcb4ae6,null))[_0xad11('0x41')](handleError(_0xcb4ae6,null));};exports[_0xad11('0x48')]=function(_0x16e3be,_0x5033a1,_0x3fc751){var _0x37c786={};var _0xe2660c={};var _0x5a88d1;var _0x3ade56;return db[_0xad11('0x2a')][_0xad11('0x49')]({'where':{'id':_0x16e3be[_0xad11('0x43')]['id']}})['then'](handleEntityNotFound(_0x5033a1,null))[_0xad11('0x24')](function(_0x16e945){if(_0x16e945){_0x5a88d1=_0x16e945;_0xe2660c[_0xad11('0x33')]=_[_0xad11('0x30')](db[_0xad11('0x4a')][_0xad11('0x2b')]);_0xe2660c['query']=_[_0xad11('0x30')](_0x16e3be['query']);_0xe2660c[_0xad11('0x3a')]=_[_0xad11('0x31')](_0xe2660c['model'],_0xe2660c[_0xad11('0x2f')]);_0x37c786['attributes']=_[_0xad11('0x31')](_0xe2660c[_0xad11('0x33')],qs[_0xad11('0x34')](_0x16e3be[_0xad11('0x2f')]['fields']));_0x37c786[_0xad11('0x32')]=_0x37c786[_0xad11('0x32')][_0xad11('0x35')]?_0x37c786['attributes']:_0xe2660c[_0xad11('0x33')];_0x37c786[_0xad11('0x37')]=qs[_0xad11('0x38')](_0x16e3be[_0xad11('0x2f')][_0xad11('0x38')]);_0x37c786[_0xad11('0x39')]=qs[_0xad11('0x3a')](_['pick'](_0x16e3be[_0xad11('0x2f')],_0xe2660c[_0xad11('0x3a')]));if(_0x16e3be['query'][_0xad11('0x3c')]){_0x37c786[_0xad11('0x39')]=_[_0xad11('0x3d')](_0x37c786['where'],{'$or':_[_0xad11('0x29')](_0x37c786[_0xad11('0x32')],function(_0x4c1875){var _0x45fb79={};_0x45fb79[_0x4c1875]={'$like':'%'+_0x16e3be['query'][_0xad11('0x3c')]+'%'};return _0x45fb79;})});}_0x37c786=_[_0xad11('0x3d')]({},_0x37c786,_0x16e3be[_0xad11('0x3e')]);return _0x5a88d1['getFields'](_0x37c786);}})['then'](function(_0x1712aa){if(_0x1712aa){_0x3ade56=_0x1712aa['length'];if(!_0x16e3be[_0xad11('0x2f')][_0xad11('0x36')](_0xad11('0x4b'))){_0x37c786[_0xad11('0x1b')]=qs[_0xad11('0x1b')](_0x16e3be[_0xad11('0x2f')]['limit']);_0x37c786['offset']=qs[_0xad11('0x1a')](_0x16e3be[_0xad11('0x2f')]['offset']);}return _0x5a88d1[_0xad11('0x48')](_0x37c786);}})['then'](function(_0x5b67a0){if(_0x5b67a0){return _0x5b67a0?{'count':_0x3ade56,'rows':_0x5b67a0}:null;}})[_0xad11('0x24')](respondWithResult(_0x5033a1,null))[_0xad11('0x41')](handleError(_0x5033a1,null));};exports[_0xad11('0x4c')]=function(_0x2d0c10,_0x2ebc33,_0x72eea1){var _0x21d86b={};var _0xcfdbc8={};var _0x4e73dc;var _0x2153a4;return db[_0xad11('0x2a')][_0xad11('0x49')]({'where':{'id':_0x2d0c10[_0xad11('0x43')]['id']}})[_0xad11('0x24')](handleEntityNotFound(_0x2ebc33,null))[_0xad11('0x24')](function(_0x5dafc9){if(_0x5dafc9){_0x4e73dc=_0x5dafc9;_0xcfdbc8[_0xad11('0x33')]=_[_0xad11('0x30')](db['SugarcrmField'][_0xad11('0x2b')]);_0xcfdbc8[_0xad11('0x2f')]=_['keys'](_0x2d0c10[_0xad11('0x2f')]);_0xcfdbc8[_0xad11('0x3a')]=_['intersection'](_0xcfdbc8[_0xad11('0x33')],_0xcfdbc8[_0xad11('0x2f')]);_0x21d86b['attributes']=_[_0xad11('0x31')](_0xcfdbc8['model'],qs['fields'](_0x2d0c10[_0xad11('0x2f')][_0xad11('0x34')]));_0x21d86b[_0xad11('0x32')]=_0x21d86b[_0xad11('0x32')][_0xad11('0x35')]?_0x21d86b[_0xad11('0x32')]:_0xcfdbc8['model'];_0x21d86b[_0xad11('0x37')]=qs['sort'](_0x2d0c10['query'][_0xad11('0x38')]);_0x21d86b[_0xad11('0x39')]=qs[_0xad11('0x3a')](_['pick'](_0x2d0c10['query'],_0xcfdbc8[_0xad11('0x3a')]));if(_0x2d0c10[_0xad11('0x2f')][_0xad11('0x3c')]){_0x21d86b['where']=_[_0xad11('0x3d')](_0x21d86b[_0xad11('0x39')],{'$or':_[_0xad11('0x29')](_0x21d86b[_0xad11('0x32')],function(_0x19dea1){var _0x3a99b0={};_0x3a99b0[_0x19dea1]={'$like':'%'+_0x2d0c10['query']['filter']+'%'};return _0x3a99b0;})});}_0x21d86b=_['merge']({},_0x21d86b,_0x2d0c10['options']);return _0x4e73dc[_0xad11('0x4c')](_0x21d86b);}})[_0xad11('0x24')](function(_0x1459c3){if(_0x1459c3){_0x2153a4=_0x1459c3[_0xad11('0x35')];if(!_0x2d0c10[_0xad11('0x2f')][_0xad11('0x36')]('nolimit')){_0x21d86b[_0xad11('0x1b')]=qs[_0xad11('0x1b')](_0x2d0c10[_0xad11('0x2f')][_0xad11('0x1b')]);_0x21d86b[_0xad11('0x1a')]=qs['offset'](_0x2d0c10[_0xad11('0x2f')][_0xad11('0x1a')]);}return _0x4e73dc[_0xad11('0x4c')](_0x21d86b);}})[_0xad11('0x24')](function(_0x4ae1ae){if(_0x4ae1ae){return _0x4ae1ae?{'count':_0x2153a4,'rows':_0x4ae1ae}:null;}})[_0xad11('0x24')](respondWithResult(_0x2ebc33,null))[_0xad11('0x41')](handleError(_0x2ebc33,null));};exports[_0xad11('0x4d')]=function(_0x3243d5,_0x220511,_0x413b45){var _0x194e26={};var _0x455c0b={};var _0x10b6bf;var _0x2bd31a;return db[_0xad11('0x2a')]['findOne']({'where':{'id':_0x3243d5['params']['id']}})['then'](handleEntityNotFound(_0x220511,null))[_0xad11('0x24')](function(_0x24d6c4){if(_0x24d6c4){_0x10b6bf=_0x24d6c4;_0x455c0b[_0xad11('0x33')]=_['keys'](db[_0xad11('0x4a')][_0xad11('0x2b')]);_0x455c0b[_0xad11('0x2f')]=_[_0xad11('0x30')](_0x3243d5[_0xad11('0x2f')]);_0x455c0b[_0xad11('0x3a')]=_[_0xad11('0x31')](_0x455c0b[_0xad11('0x33')],_0x455c0b[_0xad11('0x2f')]);_0x194e26[_0xad11('0x32')]=_['intersection'](_0x455c0b[_0xad11('0x33')],qs[_0xad11('0x34')](_0x3243d5['query']['fields']));_0x194e26['attributes']=_0x194e26[_0xad11('0x32')][_0xad11('0x35')]?_0x194e26[_0xad11('0x32')]:_0x455c0b[_0xad11('0x33')];_0x194e26[_0xad11('0x37')]=qs[_0xad11('0x38')](_0x3243d5[_0xad11('0x2f')][_0xad11('0x38')]);_0x194e26[_0xad11('0x39')]=qs['filters'](_[_0xad11('0x3b')](_0x3243d5[_0xad11('0x2f')],_0x455c0b['filters']));if(_0x3243d5[_0xad11('0x2f')][_0xad11('0x3c')]){_0x194e26[_0xad11('0x39')]=_[_0xad11('0x3d')](_0x194e26[_0xad11('0x39')],{'$or':_[_0xad11('0x29')](_0x194e26[_0xad11('0x32')],function(_0x5929b5){var _0x11adf3={};_0x11adf3[_0x5929b5]={'$like':'%'+_0x3243d5['query'][_0xad11('0x3c')]+'%'};return _0x11adf3;})});}_0x194e26=_[_0xad11('0x3d')]({},_0x194e26,_0x3243d5[_0xad11('0x3e')]);return _0x10b6bf[_0xad11('0x4d')](_0x194e26);}})['then'](function(_0x5ca52b){if(_0x5ca52b){_0x2bd31a=_0x5ca52b['length'];if(!_0x3243d5[_0xad11('0x2f')][_0xad11('0x36')](_0xad11('0x4b'))){_0x194e26[_0xad11('0x1b')]=qs[_0xad11('0x1b')](_0x3243d5[_0xad11('0x2f')][_0xad11('0x1b')]);_0x194e26['offset']=qs[_0xad11('0x1a')](_0x3243d5[_0xad11('0x2f')]['offset']);}return _0x10b6bf[_0xad11('0x4d')](_0x194e26);}})[_0xad11('0x24')](function(_0x343c73){if(_0x343c73){return _0x343c73?{'count':_0x2bd31a,'rows':_0x343c73}:null;}})['then'](respondWithResult(_0x220511,null))['catch'](handleError(_0x220511,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index a82f783..9493768 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 _0x67cc=['util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','int_sugarcrm_configurations','lodash'];(function(_0x110309,_0x36cd12){var _0x4c4030=function(_0x269e61){while(--_0x269e61){_0x110309['push'](_0x110309['shift']());}};_0x4c4030(++_0x36cd12);}(_0x67cc,0x1a3));var _0xc67c=function(_0x5a84d1,_0x4a330f){_0x5a84d1=_0x5a84d1-0x0;var _0x4b656c=_0x67cc[_0x5a84d1];return _0x4b656c;};'use strict';var _=require(_0xc67c('0x0'));var util=require(_0xc67c('0x1'));var logger=require(_0xc67c('0x2'))(_0xc67c('0x3'));var moment=require('moment');var BPromise=require(_0xc67c('0x4'));var rp=require(_0xc67c('0x5'));var fs=require('fs');var path=require(_0xc67c('0x6'));var rimraf=require('rimraf');var config=require(_0xc67c('0x7'));var attributes=require(_0xc67c('0x8'));module[_0xc67c('0x9')]=function(_0x5bd6bb,_0x49ec5e){return _0x5bd6bb[_0xc67c('0xa')]('SugarcrmConfiguration',attributes,{'tableName':_0xc67c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4e9b=['int_sugarcrm_configurations','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','define','SugarcrmConfiguration'];(function(_0x2bc375,_0x3085f9){var _0x3796c8=function(_0xa402c2){while(--_0xa402c2){_0x2bc375['push'](_0x2bc375['shift']());}};_0x3796c8(++_0x3085f9);}(_0x4e9b,0x1ed));var _0xb4e9=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x4e9b[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0xb4e9('0x0'));var util=require('util');var logger=require(_0xb4e9('0x1'))(_0xb4e9('0x2'));var moment=require('moment');var BPromise=require(_0xb4e9('0x3'));var rp=require(_0xb4e9('0x4'));var fs=require('fs');var path=require(_0xb4e9('0x5'));var rimraf=require(_0xb4e9('0x6'));var config=require(_0xb4e9('0x7'));var attributes=require(_0xb4e9('0x8'));module['exports']=function(_0x389d99,_0x38e189){return _0x389d99[_0xb4e9('0x9')](_0xb4e9('0xa'),attributes,{'tableName':_0xb4e9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index 52a60dd..d51083b 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 _0xf993=['request','then','info','request\x20sent','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','SugarcrmConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','client','http'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xf993,0x8a));var _0x3f99=function(_0x41dd31,_0x1df6a3){_0x41dd31=_0x41dd31-0x0;var _0xfb6772=_0xf993[_0x41dd31];return _0xfb6772;};'use strict';var _=require(_0x3f99('0x0'));var util=require(_0x3f99('0x1'));var moment=require(_0x3f99('0x2'));var BPromise=require(_0x3f99('0x3'));var rs=require(_0x3f99('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3f99('0x5'))['db'];var utils=require(_0x3f99('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3f99('0x7')][_0x3f99('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x35b327,_0x38fb21,_0xbb5354){return new BPromise(function(_0x1cb608,_0x1b00ac){return client[_0x3f99('0x9')](_0x35b327,_0xbb5354)[_0x3f99('0xa')](function(_0x204ab3){logger[_0x3f99('0xb')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x38fb21,_0x3f99('0xc'));logger['debug'](_0x3f99('0xd'),_0x38fb21,_0x3f99('0xc'),JSON[_0x3f99('0xe')](_0x204ab3));if(_0x204ab3[_0x3f99('0xf')]){if(_0x204ab3[_0x3f99('0xf')][_0x3f99('0x10')]===0x1f4){logger[_0x3f99('0xf')](_0x3f99('0x11'),_0x38fb21,_0x204ab3['error']['message']);return _0x1b00ac(_0x204ab3['error']['message']);}logger['error'](_0x3f99('0x11'),_0x38fb21,_0x204ab3['error'][_0x3f99('0x12')]);return _0x1cb608(_0x204ab3[_0x3f99('0xf')][_0x3f99('0x12')]);}else{logger[_0x3f99('0xb')](_0x3f99('0x11'),_0x38fb21,_0x3f99('0xc'));_0x1cb608(_0x204ab3[_0x3f99('0x13')][_0x3f99('0x12')]);}})[_0x3f99('0x14')](function(_0x477106){logger[_0x3f99('0xf')](_0x3f99('0x11'),_0x38fb21,_0x477106);_0x1b00ac(_0x477106);});});} \ No newline at end of file +var _0x950b=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird'];(function(_0x2ef345,_0x7edda2){var _0x3dbad6=function(_0x53cf70){while(--_0x53cf70){_0x2ef345['push'](_0x2ef345['shift']());}};_0x3dbad6(++_0x7edda2);}(_0x950b,0x146));var _0xb950=function(_0x5c4504,_0x43bd6d){_0x5c4504=_0x5c4504-0x0;var _0xa9e952=_0x950b[_0x5c4504];return _0xa9e952;};'use strict';var _=require(_0xb950('0x0'));var util=require(_0xb950('0x1'));var moment=require(_0xb950('0x2'));var BPromise=require(_0xb950('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb950('0x4'));var db=require(_0xb950('0x5'))['db'];var utils=require(_0xb950('0x6'));var logger=require(_0xb950('0x7'))(_0xb950('0x8'));var config=require(_0xb950('0x9'));var jayson=require(_0xb950('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c20b9,_0x5adcfc,_0x5a7784){return new BPromise(function(_0x44269e,_0x319149){return client[_0xb950('0xb')](_0x2c20b9,_0x5a7784)[_0xb950('0xc')](function(_0xa4419d){logger[_0xb950('0xd')](_0xb950('0xe'),_0x5adcfc,_0xb950('0xf'));logger['debug'](_0xb950('0x10'),_0x5adcfc,_0xb950('0xf'),JSON[_0xb950('0x11')](_0xa4419d));if(_0xa4419d[_0xb950('0x12')]){if(_0xa4419d[_0xb950('0x12')][_0xb950('0x13')]===0x1f4){logger[_0xb950('0x12')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x5adcfc,_0xa4419d[_0xb950('0x12')][_0xb950('0x14')]);return _0x319149(_0xa4419d['error'][_0xb950('0x14')]);}logger['error'](_0xb950('0xe'),_0x5adcfc,_0xa4419d['error'][_0xb950('0x14')]);return _0x44269e(_0xa4419d[_0xb950('0x12')][_0xb950('0x14')]);}else{logger['info']('SugarcrmConfiguration,\x20%s,\x20%s',_0x5adcfc,'request\x20sent');_0x44269e(_0xa4419d['result'][_0xb950('0x14')]);}})[_0xb950('0x15')](function(_0x59d866){logger[_0xb950('0x12')](_0xb950('0xe'),_0x5adcfc,_0x59d866);_0x319149(_0x59d866);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 5c510bb..9a566d1 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 _0x7246=['isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x433701,_0x585146){var _0x32a6b6=function(_0x3576f9){while(--_0x3576f9){_0x433701['push'](_0x433701['shift']());}};_0x32a6b6(++_0x585146);}(_0x7246,0x14a));var _0x6724=function(_0x169c5c,_0x2a0596){_0x169c5c=_0x169c5c-0x0;var _0x4a1bd5=_0x7246[_0x169c5c];return _0x4a1bd5;};'use strict';var multer=require(_0x6724('0x0'));var util=require(_0x6724('0x1'));var path=require('path');var timeout=require(_0x6724('0x2'));var express=require(_0x6724('0x3'));var router=express[_0x6724('0x4')]();var fs_extra=require(_0x6724('0x5'));var auth=require(_0x6724('0x6'));var interaction=require(_0x6724('0x7'));var config=require(_0x6724('0x8'));var controller=require('./intSugarcrmField.controller');router[_0x6724('0x9')]('/',auth[_0x6724('0xa')](),controller[_0x6724('0xb')]);router[_0x6724('0x9')](_0x6724('0xc'),auth[_0x6724('0xa')](),controller['show']);router[_0x6724('0xd')]('/',auth[_0x6724('0xa')](),controller[_0x6724('0xe')]);router[_0x6724('0xf')](_0x6724('0xc'),auth['isAuthenticated'](),controller[_0x6724('0x10')]);router[_0x6724('0x11')]('/:id',auth[_0x6724('0xa')](),controller[_0x6724('0x12')]);module[_0x6724('0x13')]=router; \ No newline at end of file +var _0x804a=['Router','fs-extra','../../components/interaction/service','./intSugarcrmField.controller','get','isAuthenticated','show','post','/:id','destroy','multer','connect-timeout'];(function(_0x395265,_0x3a5d76){var _0x2fb974=function(_0x42c08d){while(--_0x42c08d){_0x395265['push'](_0x395265['shift']());}};_0x2fb974(++_0x3a5d76);}(_0x804a,0xbe));var _0xa804=function(_0x57e964,_0x5516ed){_0x57e964=_0x57e964-0x0;var _0x121ae9=_0x804a[_0x57e964];return _0x121ae9;};'use strict';var multer=require(_0xa804('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa804('0x1'));var express=require('express');var router=express[_0xa804('0x2')]();var fs_extra=require(_0xa804('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa804('0x4'));var config=require('../../config/environment');var controller=require(_0xa804('0x5'));router[_0xa804('0x6')]('/',auth[_0xa804('0x7')](),controller['index']);router['get']('/:id',auth[_0xa804('0x7')](),controller[_0xa804('0x8')]);router[_0xa804('0x9')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xa804('0xa'),auth[_0xa804('0x7')](),controller['update']);router['delete'](_0xa804('0xa'),auth[_0xa804('0x7')](),controller[_0xa804('0xb')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index eba6b36..1adc532 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 _0xd363=['picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd363,0x147));var _0x3d36=function(_0x28678d,_0x54324f){_0x28678d=_0x28678d-0x0;var _0x1643e9=_0xd363[_0x28678d];return _0x1643e9;};'use strict';var Sequelize=require(_0x3d36('0x0'));module[_0x3d36('0x1')]={'type':{'type':Sequelize[_0x3d36('0x2')](_0x3d36('0x3'),_0x3d36('0x4'),_0x3d36('0x5'),'keyValue',_0x3d36('0x6')),'defaultValue':_0x3d36('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x3d36('0x7')]},'keyType':{'type':Sequelize[_0x3d36('0x2')](_0x3d36('0x3'),'variable',_0x3d36('0x5'))},'keyContent':{'type':Sequelize[_0x3d36('0x7')]},'idField':{'type':Sequelize[_0x3d36('0x7')]},'nameField':{'type':Sequelize[_0x3d36('0x7')]},'customField':{'type':Sequelize[_0x3d36('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x4600=['customVariable','picklist','STRING','variable','BOOLEAN','sequelize','ENUM','string'];(function(_0x24b791,_0x3a47c4){var _0x44f134=function(_0x2e89fc){while(--_0x2e89fc){_0x24b791['push'](_0x24b791['shift']());}};_0x44f134(++_0x3a47c4);}(_0x4600,0xdd));var _0x0460=function(_0x4584b7,_0x396a41){_0x4584b7=_0x4584b7-0x0;var _0x2bbf5c=_0x4600[_0x4584b7];return _0x2bbf5c;};'use strict';var Sequelize=require(_0x0460('0x0'));module['exports']={'type':{'type':Sequelize[_0x0460('0x1')](_0x0460('0x2'),'variable',_0x0460('0x3'),'keyValue',_0x0460('0x4')),'defaultValue':_0x0460('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x0460('0x5')]},'keyType':{'type':Sequelize[_0x0460('0x1')](_0x0460('0x2'),_0x0460('0x6'),_0x0460('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x0460('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x0460('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0460('0x5')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 908b1a2..5fd5cb8 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 _0x28b1=['request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','limit','undefined','count','json','apply','reject','save','update','then','destroy','stack','name','send','index','map','SugarcrmField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','where','merge','options','findAll','rows','catch','show','params','includeAll','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x4d1300,_0x398146){var _0x58a858=function(_0x5dbf93){while(--_0x5dbf93){_0x4d1300['push'](_0x4d1300['shift']());}};_0x58a858(++_0x398146);}(_0x28b1,0x17d));var _0x128b=function(_0x3e8ebf,_0xb683af){_0x3e8ebf=_0x3e8ebf-0x0;var _0x32c56d=_0x28b1[_0x3e8ebf];return _0x32c56d;};'use strict';var emlformat=require(_0x128b('0x0'));var rimraf=require(_0x128b('0x1'));var zipdir=require(_0x128b('0x2'));var jsonpatch=require(_0x128b('0x3'));var rp=require(_0x128b('0x4'));var moment=require(_0x128b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x128b('0x6'));var util=require(_0x128b('0x7'));var path=require(_0x128b('0x8'));var sox=require(_0x128b('0x9'));var csv=require(_0x128b('0xa'));var ejs=require(_0x128b('0xb'));var fs=require('fs');var fs_extra=require(_0x128b('0xc'));var _=require('lodash');var squel=require(_0x128b('0xd'));var crypto=require('crypto');var jsforce=require(_0x128b('0xe'));var deskjs=require(_0x128b('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x128b('0x10'));var Redis=require(_0x128b('0x11'));var authService=require(_0x128b('0x12'));var qs=require(_0x128b('0x13'));var as=require(_0x128b('0x14'));var hardwareService=require(_0x128b('0x15'));var logger=require(_0x128b('0x16'))(_0x128b('0x17'));var utils=require(_0x128b('0x18'));var config=require(_0x128b('0x19'));var licenseUtil=require(_0x128b('0x1a'));var db=require(_0x128b('0x1b'))['db'];function respondWithStatusCode(_0x4fd4af,_0x4dd21f){_0x4dd21f=_0x4dd21f||0xcc;return function(_0x1500a8){if(_0x1500a8){return _0x4fd4af[_0x128b('0x1c')](_0x4dd21f);}return _0x4fd4af['status'](_0x4dd21f)[_0x128b('0x1d')]();};}function respondWithResult(_0x49f67b,_0x2270fc){_0x2270fc=_0x2270fc||0xc8;return function(_0x52a7ae){if(_0x52a7ae){return _0x49f67b[_0x128b('0x1e')](_0x2270fc)['json'](_0x52a7ae);}};}function respondWithFilteredResult(_0x5ee226,_0x13d8fb){return function(_0x4d7c3c){if(_0x4d7c3c){var _0x434bc2=typeof _0x13d8fb[_0x128b('0x1f')]==='undefined'&&typeof _0x13d8fb[_0x128b('0x20')]===_0x128b('0x21');var _0x557967=_0x4d7c3c[_0x128b('0x22')];var _0x11f277=_0x434bc2?0x0:_0x13d8fb[_0x128b('0x1f')];var _0x1cdf50=_0x434bc2?_0x4d7c3c['count']:_0x13d8fb[_0x128b('0x1f')]+_0x13d8fb['limit'];var _0x930494;if(_0x1cdf50>=_0x557967){_0x1cdf50=_0x557967;_0x930494=0xc8;}else{_0x930494=0xce;}_0x5ee226[_0x128b('0x1e')](_0x930494);return _0x5ee226['set']('Content-Range',_0x11f277+'-'+_0x1cdf50+'/'+_0x557967)[_0x128b('0x23')](_0x4d7c3c);}return null;};}function patchUpdates(_0xec62b4){return function(_0x4b92f8){try{jsonpatch[_0x128b('0x24')](_0x4b92f8,_0xec62b4,!![]);}catch(_0x42c350){return BPromise[_0x128b('0x25')](_0x42c350);}return _0x4b92f8[_0x128b('0x26')]();};}function saveUpdates(_0x1f492e,_0x195b37){return function(_0x15a2e4){if(_0x15a2e4){return _0x15a2e4[_0x128b('0x27')](_0x1f492e)[_0x128b('0x28')](function(_0x3844a9){return _0x3844a9;});}return null;};}function removeEntity(_0x2de33f,_0x47e42f){return function(_0x5b2ac4){if(_0x5b2ac4){return _0x5b2ac4[_0x128b('0x29')]()[_0x128b('0x28')](function(){_0x2de33f[_0x128b('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x49f7b4,_0x329fab){return function(_0x1e7c87){if(!_0x1e7c87){_0x49f7b4[_0x128b('0x1c')](0x194);}return _0x1e7c87;};}function handleError(_0x32ab69,_0x511ca5){_0x511ca5=_0x511ca5||0x1f4;return function(_0x47a7df){logger['error'](_0x47a7df[_0x128b('0x2a')]);if(_0x47a7df[_0x128b('0x2b')]){delete _0x47a7df['name'];}_0x32ab69['status'](_0x511ca5)[_0x128b('0x2c')](_0x47a7df);};}exports[_0x128b('0x2d')]=function(_0x17325,_0x4c9640){var _0x55bcae={},_0x230168={},_0x35ab7e={'count':0x0,'rows':[]};var _0x17b360=_[_0x128b('0x2e')](db[_0x128b('0x2f')][_0x128b('0x30')],function(_0x14acc9){return{'name':_0x14acc9[_0x128b('0x31')],'type':_0x14acc9[_0x128b('0x32')][_0x128b('0x33')]};});_0x230168[_0x128b('0x34')]=_['map'](_0x17b360,_0x128b('0x2b'));_0x230168[_0x128b('0x35')]=_[_0x128b('0x36')](_0x17325[_0x128b('0x35')]);_0x230168[_0x128b('0x37')]=_[_0x128b('0x38')](_0x230168['model'],_0x230168[_0x128b('0x35')]);_0x55bcae['attributes']=_[_0x128b('0x38')](_0x230168['model'],qs[_0x128b('0x39')](_0x17325['query'][_0x128b('0x39')]));_0x55bcae[_0x128b('0x3a')]=_0x55bcae['attributes'][_0x128b('0x3b')]?_0x55bcae[_0x128b('0x3a')]:_0x230168[_0x128b('0x34')];if(!_0x17325[_0x128b('0x35')][_0x128b('0x3c')]('nolimit')){_0x55bcae[_0x128b('0x20')]=qs[_0x128b('0x20')](_0x17325[_0x128b('0x35')]['limit']);_0x55bcae['offset']=qs['offset'](_0x17325[_0x128b('0x35')]['offset']);}_0x55bcae[_0x128b('0x3d')]=qs[_0x128b('0x3e')](_0x17325[_0x128b('0x35')][_0x128b('0x3e')]);_0x55bcae['where']=qs['filters'](_[_0x128b('0x3f')](_0x17325[_0x128b('0x35')],_0x230168['filters']),_0x17b360);if(_0x17325[_0x128b('0x35')]['filter']){_0x55bcae[_0x128b('0x40')]=_[_0x128b('0x41')](_0x55bcae[_0x128b('0x40')],{'$or':_[_0x128b('0x2e')](_0x17b360,function(_0x28c3c9){if(_0x28c3c9[_0x128b('0x32')]!=='VIRTUAL'){var _0x3402b5={};_0x3402b5[_0x28c3c9[_0x128b('0x2b')]]={'$like':'%'+_0x17325['query']['filter']+'%'};return _0x3402b5;}})});}_0x55bcae=_['merge']({},_0x55bcae,_0x17325[_0x128b('0x42')]);var _0x477e36={'where':_0x55bcae[_0x128b('0x40')]};return db[_0x128b('0x2f')]['count'](_0x477e36)['then'](function(_0x32eacc){_0x35ab7e[_0x128b('0x22')]=_0x32eacc;if(_0x17325['query']['includeAll']){_0x55bcae['include']=[{'all':!![]}];}return db[_0x128b('0x2f')][_0x128b('0x43')](_0x55bcae);})[_0x128b('0x28')](function(_0x56f2de){_0x35ab7e[_0x128b('0x44')]=_0x56f2de;return _0x35ab7e;})[_0x128b('0x28')](respondWithFilteredResult(_0x4c9640,_0x55bcae))[_0x128b('0x45')](handleError(_0x4c9640,null));};exports[_0x128b('0x46')]=function(_0xe38871,_0x3e511d){var _0x13422c={'raw':!![],'where':{'id':_0xe38871[_0x128b('0x47')]['id']}},_0x1817e5={};_0x1817e5['model']=_[_0x128b('0x36')](db[_0x128b('0x2f')][_0x128b('0x30')]);_0x1817e5[_0x128b('0x35')]=_[_0x128b('0x36')](_0xe38871[_0x128b('0x35')]);_0x1817e5[_0x128b('0x37')]=_[_0x128b('0x38')](_0x1817e5[_0x128b('0x34')],_0x1817e5[_0x128b('0x35')]);_0x13422c['attributes']=_[_0x128b('0x38')](_0x1817e5[_0x128b('0x34')],qs[_0x128b('0x39')](_0xe38871[_0x128b('0x35')][_0x128b('0x39')]));_0x13422c[_0x128b('0x3a')]=_0x13422c['attributes'][_0x128b('0x3b')]?_0x13422c[_0x128b('0x3a')]:_0x1817e5[_0x128b('0x34')];if(_0xe38871[_0x128b('0x35')][_0x128b('0x48')]){_0x13422c[_0x128b('0x49')]=[{'all':!![]}];}_0x13422c=_['merge']({},_0x13422c,_0xe38871[_0x128b('0x42')]);return db[_0x128b('0x2f')][_0x128b('0x4a')](_0x13422c)[_0x128b('0x28')](handleEntityNotFound(_0x3e511d,null))[_0x128b('0x28')](respondWithResult(_0x3e511d,null))['catch'](handleError(_0x3e511d,null));};exports[_0x128b('0x4b')]=function(_0x1e42ef,_0x30d006){return db[_0x128b('0x2f')]['create'](_0x1e42ef['body'],{})[_0x128b('0x28')](respondWithResult(_0x30d006,0xc9))[_0x128b('0x45')](handleError(_0x30d006,null));};exports[_0x128b('0x27')]=function(_0x18dec7,_0x4c14da){if(_0x18dec7[_0x128b('0x4c')]['id']){delete _0x18dec7['body']['id'];}return db['SugarcrmField']['find']({'where':{'id':_0x18dec7[_0x128b('0x47')]['id']}})[_0x128b('0x28')](handleEntityNotFound(_0x4c14da,null))[_0x128b('0x28')](saveUpdates(_0x18dec7[_0x128b('0x4c')],null))['then'](respondWithResult(_0x4c14da,null))[_0x128b('0x45')](handleError(_0x4c14da,null));};exports[_0x128b('0x29')]=function(_0x49457a,_0x29987e){return db[_0x128b('0x2f')][_0x128b('0x4a')]({'where':{'id':_0x49457a[_0x128b('0x47')]['id']}})[_0x128b('0x28')](handleEntityNotFound(_0x29987e,null))[_0x128b('0x28')](removeEntity(_0x29987e,null))[_0x128b('0x45')](handleError(_0x29987e,null));}; \ No newline at end of file +var _0xd8f0=['pick','filters','filter','merge','type','VIRTUAL','includeAll','include','rows','catch','show','options','find','create','body','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','limit','undefined','count','offset','status','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','map','SugarcrmField','fieldName','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','order','where'];(function(_0xbf8ebe,_0x3b69a5){var _0x1e25e8=function(_0x40c390){while(--_0x40c390){_0xbf8ebe['push'](_0xbf8ebe['shift']());}};_0x1e25e8(++_0x3b69a5);}(_0xd8f0,0x1d3));var _0x0d8f=function(_0x24e91d,_0x5d6ffe){_0x24e91d=_0x24e91d-0x0;var _0x324d8d=_0xd8f0[_0x24e91d];return _0x324d8d;};'use strict';var emlformat=require(_0x0d8f('0x0'));var rimraf=require(_0x0d8f('0x1'));var zipdir=require(_0x0d8f('0x2'));var jsonpatch=require(_0x0d8f('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0d8f('0x4'));var util=require(_0x0d8f('0x5'));var path=require(_0x0d8f('0x6'));var sox=require(_0x0d8f('0x7'));var csv=require(_0x0d8f('0x8'));var ejs=require(_0x0d8f('0x9'));var fs=require('fs');var fs_extra=require(_0x0d8f('0xa'));var _=require(_0x0d8f('0xb'));var squel=require(_0x0d8f('0xc'));var crypto=require(_0x0d8f('0xd'));var jsforce=require(_0x0d8f('0xe'));var deskjs=require(_0x0d8f('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0d8f('0x10'));var Redis=require(_0x0d8f('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x0d8f('0x12'));var as=require(_0x0d8f('0x13'));var hardwareService=require(_0x0d8f('0x14'));var logger=require(_0x0d8f('0x15'))(_0x0d8f('0x16'));var utils=require(_0x0d8f('0x17'));var config=require(_0x0d8f('0x18'));var licenseUtil=require(_0x0d8f('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3dc6e4,_0x55f08f){_0x55f08f=_0x55f08f||0xcc;return function(_0x4a1e09){if(_0x4a1e09){return _0x3dc6e4[_0x0d8f('0x1a')](_0x55f08f);}return _0x3dc6e4['status'](_0x55f08f)[_0x0d8f('0x1b')]();};}function respondWithResult(_0x20289c,_0x4d104f){_0x4d104f=_0x4d104f||0xc8;return function(_0x16595e){if(_0x16595e){return _0x20289c['status'](_0x4d104f)[_0x0d8f('0x1c')](_0x16595e);}};}function respondWithFilteredResult(_0x3533c0,_0x2646f3){return function(_0x28e356){if(_0x28e356){var _0x39a7f9=typeof _0x2646f3['offset']==='undefined'&&typeof _0x2646f3[_0x0d8f('0x1d')]===_0x0d8f('0x1e');var _0x505cf9=_0x28e356[_0x0d8f('0x1f')];var _0x58a18c=_0x39a7f9?0x0:_0x2646f3['offset'];var _0x803af4=_0x39a7f9?_0x28e356[_0x0d8f('0x1f')]:_0x2646f3[_0x0d8f('0x20')]+_0x2646f3[_0x0d8f('0x1d')];var _0x3eba00;if(_0x803af4>=_0x505cf9){_0x803af4=_0x505cf9;_0x3eba00=0xc8;}else{_0x3eba00=0xce;}_0x3533c0[_0x0d8f('0x21')](_0x3eba00);return _0x3533c0[_0x0d8f('0x22')](_0x0d8f('0x23'),_0x58a18c+'-'+_0x803af4+'/'+_0x505cf9)[_0x0d8f('0x1c')](_0x28e356);}return null;};}function patchUpdates(_0x57c865){return function(_0x5f3d9b){try{jsonpatch[_0x0d8f('0x24')](_0x5f3d9b,_0x57c865,!![]);}catch(_0x2c5248){return BPromise[_0x0d8f('0x25')](_0x2c5248);}return _0x5f3d9b[_0x0d8f('0x26')]();};}function saveUpdates(_0x4d7305,_0x369931){return function(_0x26fbe1){if(_0x26fbe1){return _0x26fbe1[_0x0d8f('0x27')](_0x4d7305)[_0x0d8f('0x28')](function(_0x419e4a){return _0x419e4a;});}return null;};}function removeEntity(_0x3a985e,_0x521273){return function(_0x28049e){if(_0x28049e){return _0x28049e['destroy']()[_0x0d8f('0x28')](function(){_0x3a985e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x246162,_0x4b26b4){return function(_0x4fdc24){if(!_0x4fdc24){_0x246162[_0x0d8f('0x1a')](0x194);}return _0x4fdc24;};}function handleError(_0x3dd531,_0xe01b4c){_0xe01b4c=_0xe01b4c||0x1f4;return function(_0xf2dabe){logger[_0x0d8f('0x29')](_0xf2dabe[_0x0d8f('0x2a')]);if(_0xf2dabe[_0x0d8f('0x2b')]){delete _0xf2dabe[_0x0d8f('0x2b')];}_0x3dd531['status'](_0xe01b4c)[_0x0d8f('0x2c')](_0xf2dabe);};}exports['index']=function(_0x42ba46,_0x18c51e){var _0x6b704c={},_0xd0c9d6={},_0x3bd2c7={'count':0x0,'rows':[]};var _0x4d681a=_[_0x0d8f('0x2d')](db[_0x0d8f('0x2e')]['rawAttributes'],function(_0xc0fc2f){return{'name':_0xc0fc2f[_0x0d8f('0x2f')],'type':_0xc0fc2f['type']['key']};});_0xd0c9d6[_0x0d8f('0x30')]=_[_0x0d8f('0x2d')](_0x4d681a,'name');_0xd0c9d6[_0x0d8f('0x31')]=_[_0x0d8f('0x32')](_0x42ba46[_0x0d8f('0x31')]);_0xd0c9d6['filters']=_['intersection'](_0xd0c9d6['model'],_0xd0c9d6[_0x0d8f('0x31')]);_0x6b704c[_0x0d8f('0x33')]=_[_0x0d8f('0x34')](_0xd0c9d6['model'],qs[_0x0d8f('0x35')](_0x42ba46['query'][_0x0d8f('0x35')]));_0x6b704c[_0x0d8f('0x33')]=_0x6b704c[_0x0d8f('0x33')]['length']?_0x6b704c[_0x0d8f('0x33')]:_0xd0c9d6[_0x0d8f('0x30')];if(!_0x42ba46['query'][_0x0d8f('0x36')](_0x0d8f('0x37'))){_0x6b704c[_0x0d8f('0x1d')]=qs[_0x0d8f('0x1d')](_0x42ba46['query'][_0x0d8f('0x1d')]);_0x6b704c[_0x0d8f('0x20')]=qs['offset'](_0x42ba46[_0x0d8f('0x31')][_0x0d8f('0x20')]);}_0x6b704c[_0x0d8f('0x38')]=qs['sort'](_0x42ba46[_0x0d8f('0x31')]['sort']);_0x6b704c[_0x0d8f('0x39')]=qs['filters'](_[_0x0d8f('0x3a')](_0x42ba46[_0x0d8f('0x31')],_0xd0c9d6[_0x0d8f('0x3b')]),_0x4d681a);if(_0x42ba46['query'][_0x0d8f('0x3c')]){_0x6b704c[_0x0d8f('0x39')]=_[_0x0d8f('0x3d')](_0x6b704c[_0x0d8f('0x39')],{'$or':_[_0x0d8f('0x2d')](_0x4d681a,function(_0x4a9ba3){if(_0x4a9ba3[_0x0d8f('0x3e')]!==_0x0d8f('0x3f')){var _0x78ffa4={};_0x78ffa4[_0x4a9ba3[_0x0d8f('0x2b')]]={'$like':'%'+_0x42ba46['query'][_0x0d8f('0x3c')]+'%'};return _0x78ffa4;}})});}_0x6b704c=_[_0x0d8f('0x3d')]({},_0x6b704c,_0x42ba46['options']);var _0x49e14d={'where':_0x6b704c[_0x0d8f('0x39')]};return db[_0x0d8f('0x2e')]['count'](_0x49e14d)[_0x0d8f('0x28')](function(_0x55f5f7){_0x3bd2c7['count']=_0x55f5f7;if(_0x42ba46[_0x0d8f('0x31')][_0x0d8f('0x40')]){_0x6b704c[_0x0d8f('0x41')]=[{'all':!![]}];}return db[_0x0d8f('0x2e')]['findAll'](_0x6b704c);})[_0x0d8f('0x28')](function(_0x2f9453){_0x3bd2c7[_0x0d8f('0x42')]=_0x2f9453;return _0x3bd2c7;})[_0x0d8f('0x28')](respondWithFilteredResult(_0x18c51e,_0x6b704c))[_0x0d8f('0x43')](handleError(_0x18c51e,null));};exports[_0x0d8f('0x44')]=function(_0x211dd8,_0x41266e){var _0x10afcb={'raw':!![],'where':{'id':_0x211dd8['params']['id']}},_0x2e2a0b={};_0x2e2a0b[_0x0d8f('0x30')]=_[_0x0d8f('0x32')](db[_0x0d8f('0x2e')]['rawAttributes']);_0x2e2a0b['query']=_[_0x0d8f('0x32')](_0x211dd8[_0x0d8f('0x31')]);_0x2e2a0b[_0x0d8f('0x3b')]=_[_0x0d8f('0x34')](_0x2e2a0b[_0x0d8f('0x30')],_0x2e2a0b[_0x0d8f('0x31')]);_0x10afcb[_0x0d8f('0x33')]=_[_0x0d8f('0x34')](_0x2e2a0b[_0x0d8f('0x30')],qs[_0x0d8f('0x35')](_0x211dd8[_0x0d8f('0x31')]['fields']));_0x10afcb['attributes']=_0x10afcb['attributes']['length']?_0x10afcb[_0x0d8f('0x33')]:_0x2e2a0b['model'];if(_0x211dd8[_0x0d8f('0x31')][_0x0d8f('0x40')]){_0x10afcb['include']=[{'all':!![]}];}_0x10afcb=_[_0x0d8f('0x3d')]({},_0x10afcb,_0x211dd8[_0x0d8f('0x45')]);return db[_0x0d8f('0x2e')][_0x0d8f('0x46')](_0x10afcb)[_0x0d8f('0x28')](handleEntityNotFound(_0x41266e,null))['then'](respondWithResult(_0x41266e,null))[_0x0d8f('0x43')](handleError(_0x41266e,null));};exports[_0x0d8f('0x47')]=function(_0x234f9d,_0x20839e){return db[_0x0d8f('0x2e')][_0x0d8f('0x47')](_0x234f9d[_0x0d8f('0x48')],{})['then'](respondWithResult(_0x20839e,0xc9))[_0x0d8f('0x43')](handleError(_0x20839e,null));};exports['update']=function(_0xacbd50,_0x4aa5e2){if(_0xacbd50[_0x0d8f('0x48')]['id']){delete _0xacbd50[_0x0d8f('0x48')]['id'];}return db[_0x0d8f('0x2e')][_0x0d8f('0x46')]({'where':{'id':_0xacbd50[_0x0d8f('0x49')]['id']}})['then'](handleEntityNotFound(_0x4aa5e2,null))['then'](saveUpdates(_0xacbd50[_0x0d8f('0x48')],null))['then'](respondWithResult(_0x4aa5e2,null))[_0x0d8f('0x43')](handleError(_0x4aa5e2,null));};exports[_0x0d8f('0x4a')]=function(_0x20f0cf,_0x5dc685){return db['SugarcrmField']['find']({'where':{'id':_0x20f0cf[_0x0d8f('0x49')]['id']}})[_0x0d8f('0x28')](handleEntityNotFound(_0x5dc685,null))[_0x0d8f('0x28')](removeEntity(_0x5dc685,null))[_0x0d8f('0x43')](handleError(_0x5dc685,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 93df6c4..5915dd3 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 _0x95cb=['../../config/environment','./intSugarcrmField.attributes','exports','define','SugarcrmField','idField','FieldId','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0x95cb,0xf5));var _0xb95c=function(_0x1c4cf0,_0x421f07){_0x1c4cf0=_0x1c4cf0-0x0;var _0x32c086=_0x95cb[_0x1c4cf0];return _0x32c086;};'use strict';var _=require(_0xb95c('0x0'));var util=require(_0xb95c('0x1'));var logger=require(_0xb95c('0x2'))(_0xb95c('0x3'));var moment=require('moment');var BPromise=require(_0xb95c('0x4'));var rp=require(_0xb95c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb95c('0x6'));var config=require(_0xb95c('0x7'));var attributes=require(_0xb95c('0x8'));module[_0xb95c('0x9')]=function(_0x434995,_0x4f9cec){return _0x434995[_0xb95c('0xa')](_0xb95c('0xb'),attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0xb95c('0xc'),_0xb95c('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc61f=['int_sugarcrm_fields','idField','FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./intSugarcrmField.attributes','define','SugarcrmField'];(function(_0x530151,_0x27ab6d){var _0x129774=function(_0x57f945){while(--_0x57f945){_0x530151['push'](_0x530151['shift']());}};_0x129774(++_0x27ab6d);}(_0xc61f,0x17d));var _0xfc61=function(_0x1e9934,_0x4146e6){_0x1e9934=_0x1e9934-0x0;var _0x358df6=_0xc61f[_0x1e9934];return _0x358df6;};'use strict';var _=require(_0xfc61('0x0'));var util=require(_0xfc61('0x1'));var logger=require(_0xfc61('0x2'))('api');var moment=require(_0xfc61('0x3'));var BPromise=require(_0xfc61('0x4'));var rp=require(_0xfc61('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfc61('0x6'));var config=require(_0xfc61('0x7'));var attributes=require(_0xfc61('0x8'));module['exports']=function(_0x27ae6b,_0x3547b0){return _0x27ae6b[_0xfc61('0x9')](_0xfc61('0xa'),attributes,{'tableName':_0xfc61('0xb'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0xfc61('0xc'),_0xfc61('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.rpc.js b/server/api/intSugarcrmField/intSugarcrmField.rpc.js index ac3260e..84e6eee 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 _0x656c=['client','http','request','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x34bc30,_0x177cb0){var _0x5706de=function(_0x535a8c){while(--_0x535a8c){_0x34bc30['push'](_0x34bc30['shift']());}};_0x5706de(++_0x177cb0);}(_0x656c,0x1f1));var _0xc656=function(_0x46c4fe,_0x238145){_0x46c4fe=_0x46c4fe-0x0;var _0x521bfd=_0x656c[_0x46c4fe];return _0x521bfd;};'use strict';var _=require(_0xc656('0x0'));var util=require(_0xc656('0x1'));var moment=require(_0xc656('0x2'));var BPromise=require(_0xc656('0x3'));var rs=require(_0xc656('0x4'));var fs=require('fs');var Redis=require(_0xc656('0x5'));var db=require(_0xc656('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xc656('0x7'))(_0xc656('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc656('0x9')][_0xc656('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5a7e23,_0x1e28ba,_0x216edc){return new BPromise(function(_0x48d8b2,_0x329232){return client[_0xc656('0xb')](_0x5a7e23,_0x216edc)[_0xc656('0xc')](function(_0xc22863){logger[_0xc656('0xd')](_0xc656('0xe'),_0x1e28ba,_0xc656('0xf'));logger[_0xc656('0x10')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x1e28ba,'request\x20sent',JSON['stringify'](_0xc22863));if(_0xc22863['error']){if(_0xc22863[_0xc656('0x11')][_0xc656('0x12')]===0x1f4){logger[_0xc656('0x11')](_0xc656('0xe'),_0x1e28ba,_0xc22863['error'][_0xc656('0x13')]);return _0x329232(_0xc22863[_0xc656('0x11')][_0xc656('0x13')]);}logger[_0xc656('0x11')](_0xc656('0xe'),_0x1e28ba,_0xc22863['error'][_0xc656('0x13')]);return _0x48d8b2(_0xc22863[_0xc656('0x11')][_0xc656('0x13')]);}else{logger[_0xc656('0xd')](_0xc656('0xe'),_0x1e28ba,_0xc656('0xf'));_0x48d8b2(_0xc22863[_0xc656('0x14')][_0xc656('0x13')]);}})[_0xc656('0x15')](function(_0x1e139b){logger[_0xc656('0x11')](_0xc656('0xe'),_0x1e28ba,_0x1e139b);_0x329232(_0x1e139b);});});} \ No newline at end of file +var _0xbd1d=['ioredis','../../mysqldb','rpc','jayson/promise','client','http','request','then','SugarcrmField,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','info','result','lodash','bluebird','randomstring'];(function(_0xd09668,_0x1435b2){var _0x68726=function(_0x54a030){while(--_0x54a030){_0xd09668['push'](_0xd09668['shift']());}};_0x68726(++_0x1435b2);}(_0xbd1d,0x82));var _0xdbd1=function(_0x4a4760,_0x7ce6b4){_0x4a4760=_0x4a4760-0x0;var _0x3c2c17=_0xbd1d[_0x4a4760];return _0x3c2c17;};'use strict';var _=require(_0xdbd1('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xdbd1('0x1'));var rs=require(_0xdbd1('0x2'));var fs=require('fs');var Redis=require(_0xdbd1('0x3'));var db=require(_0xdbd1('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xdbd1('0x5'));var config=require('../../config/environment');var jayson=require(_0xdbd1('0x6'));var client=jayson[_0xdbd1('0x7')][_0xdbd1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x35f2d7,_0x576500,_0x5bd090){return new BPromise(function(_0x18a4c9,_0x6d5df3){return client[_0xdbd1('0x9')](_0x35f2d7,_0x5bd090)[_0xdbd1('0xa')](function(_0x173c31){logger['info'](_0xdbd1('0xb'),_0x576500,'request\x20sent');logger[_0xdbd1('0xc')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x576500,_0xdbd1('0xd'),JSON[_0xdbd1('0xe')](_0x173c31));if(_0x173c31['error']){if(_0x173c31[_0xdbd1('0xf')]['code']===0x1f4){logger['error'](_0xdbd1('0xb'),_0x576500,_0x173c31['error']['message']);return _0x6d5df3(_0x173c31['error'][_0xdbd1('0x10')]);}logger['error'](_0xdbd1('0xb'),_0x576500,_0x173c31[_0xdbd1('0xf')]['message']);return _0x18a4c9(_0x173c31[_0xdbd1('0xf')]['message']);}else{logger[_0xdbd1('0x11')](_0xdbd1('0xb'),_0x576500,'request\x20sent');_0x18a4c9(_0x173c31[_0xdbd1('0x12')][_0xdbd1('0x10')]);}})['catch'](function(_0x5ef751){logger[_0xdbd1('0xf')]('SugarcrmField,\x20%s,\x20%s',_0x576500,_0x5ef751);_0x6d5df3(_0x5ef751);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index c4a4724..47b03f4 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 _0x43f5=['index','show','/:id/configurations','getFields','create','post','put','/:id','delete','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated'];(function(_0x22a3f0,_0x513d0e){var _0x2d8a9c=function(_0xea3b42){while(--_0xea3b42){_0x22a3f0['push'](_0x22a3f0['shift']());}};_0x2d8a9c(++_0x513d0e);}(_0x43f5,0x9d));var _0x543f=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x43f5[_0x178e48];return _0x440d7e;};'use strict';var multer=require(_0x543f('0x0'));var util=require(_0x543f('0x1'));var path=require('path');var timeout=require(_0x543f('0x2'));var express=require(_0x543f('0x3'));var router=express[_0x543f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x543f('0x5'));var interaction=require(_0x543f('0x6'));var config=require(_0x543f('0x7'));var controller=require(_0x543f('0x8'));router[_0x543f('0x9')]('/',auth[_0x543f('0xa')](),controller[_0x543f('0xb')]);router[_0x543f('0x9')]('/:id',auth[_0x543f('0xa')](),controller[_0x543f('0xc')]);router[_0x543f('0x9')](_0x543f('0xd'),auth[_0x543f('0xa')](),controller['getConfigurations']);router[_0x543f('0x9')]('/:id/fields',auth['isAuthenticated'](),controller[_0x543f('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x543f('0xf')]);router[_0x543f('0x10')]('/:id/configurations',auth['isAuthenticated'](),controller['addConfiguration']);router[_0x543f('0x11')](_0x543f('0x12'),auth[_0x543f('0xa')](),controller['update']);router[_0x543f('0x13')](_0x543f('0x12'),auth[_0x543f('0xa')](),controller['destroy']);module[_0x543f('0x14')]=router; \ No newline at end of file +var _0x3e68=['isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller'];(function(_0x1e4150,_0x55b02a){var _0x1ce3ee=function(_0x59324e){while(--_0x59324e){_0x1e4150['push'](_0x1e4150['shift']());}};_0x1ce3ee(++_0x55b02a);}(_0x3e68,0x190));var _0x83e6=function(_0x355f57,_0x420977){_0x355f57=_0x355f57-0x0;var _0x3a16d8=_0x3e68[_0x355f57];return _0x3a16d8;};'use strict';var multer=require(_0x83e6('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x83e6('0x1'));var express=require('express');var router=express[_0x83e6('0x2')]();var fs_extra=require(_0x83e6('0x3'));var auth=require(_0x83e6('0x4'));var interaction=require(_0x83e6('0x5'));var config=require(_0x83e6('0x6'));var controller=require(_0x83e6('0x7'));router['get']('/',auth[_0x83e6('0x8')](),controller[_0x83e6('0x9')]);router[_0x83e6('0xa')](_0x83e6('0xb'),auth[_0x83e6('0x8')](),controller[_0x83e6('0xc')]);router['get'](_0x83e6('0xd'),auth[_0x83e6('0x8')](),controller[_0x83e6('0xe')]);router[_0x83e6('0xa')](_0x83e6('0xf'),auth[_0x83e6('0x8')](),controller[_0x83e6('0x10')]);router[_0x83e6('0x11')]('/',auth[_0x83e6('0x8')](),controller[_0x83e6('0x12')]);router['post']('/:id/configurations',auth['isAuthenticated'](),controller[_0x83e6('0x13')]);router[_0x83e6('0x14')](_0x83e6('0xb'),auth['isAuthenticated'](),controller[_0x83e6('0x15')]);router[_0x83e6('0x16')](_0x83e6('0xb'),auth['isAuthenticated'](),controller[_0x83e6('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index f787f04..7cdf128 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 _0xbda8=['sequelize','exports','STRING','HelpDesk'];(function(_0x100e0c,_0x5523b8){var _0x4db1aa=function(_0x29f480){while(--_0x29f480){_0x100e0c['push'](_0x100e0c['shift']());}};_0x4db1aa(++_0x5523b8);}(_0xbda8,0x1d4));var _0x8bda=function(_0x523ee5,_0xa760de){_0x523ee5=_0x523ee5-0x0;var _0x8f5a3a=_0xbda8[_0x523ee5];return _0x8f5a3a;};'use strict';var Sequelize=require(_0x8bda('0x0'));module[_0x8bda('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x8bda('0x2')]},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize[_0x8bda('0x2')],'allowNull':![],'defaultValue':_0x8bda('0x3')},'remoteUri':{'type':Sequelize[_0x8bda('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x8bda('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x8bda('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x25f3=['exports','STRING','HelpDesk'];(function(_0x26295e,_0x14332a){var _0x45ed90=function(_0x10e12a){while(--_0x10e12a){_0x26295e['push'](_0x26295e['shift']());}};_0x45ed90(++_0x14332a);}(_0x25f3,0x1c2));var _0x325f=function(_0x15b8d4,_0x5cfaab){_0x15b8d4=_0x15b8d4-0x0;var _0x37c2bc=_0x25f3[_0x15b8d4];return _0x37c2bc;};'use strict';var Sequelize=require('sequelize');module[_0x325f('0x0')]={'name':{'type':Sequelize[_0x325f('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x325f('0x1')]},'username':{'type':Sequelize[_0x325f('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x325f('0x1')],'allowNull':![],'defaultValue':_0x325f('0x2')},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'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 6be867e..9c98ca0 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 _0x978b=['fast-json-patch','request-promise','moment','bluebird','mustache','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','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','reject','save','update','then','end','error','name','send','index','map','VtigerAccount','fieldName','key','query','intersection','model','attributes','fields','hasOwnProperty','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','rawAttributes','length','find','create','body','getConfigurations','VtigerConfiguration','order','nolimit','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerField','md5','getFields','moduleName','remoteUri','serverUrl','username','accessKey','substring','lastIndexOf','%s/webservice.php','GET','getchallenge','success','POST','result','token','describe','sessionName','autogenerated','owner','remove','includes','editable','false','startsWith','picklistValues','label','value','log','vTiger\x20error:\x20','getFields,\x20%s,\x20%s,\x20%s','stringify','test','statusCode','eml-format','rimraf'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x978b,0x77));var _0xb978=function(_0x360533,_0x46e554){_0x360533=_0x360533-0x0;var _0x4fc78d=_0x978b[_0x360533];return _0x4fc78d;};'use strict';var emlformat=require(_0xb978('0x0'));var rimraf=require(_0xb978('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb978('0x2'));var rp=require(_0xb978('0x3'));var moment=require(_0xb978('0x4'));var BPromise=require(_0xb978('0x5'));var Mustache=require(_0xb978('0x6'));var util=require(_0xb978('0x7'));var path=require(_0xb978('0x8'));var sox=require(_0xb978('0x9'));var csv=require(_0xb978('0xa'));var ejs=require(_0xb978('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb978('0xc'));var squel=require(_0xb978('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb978('0xe'));var toCsv=require('to-csv');var querystring=require(_0xb978('0xf'));var Papa=require(_0xb978('0x10'));var Redis=require(_0xb978('0x11'));var authService=require(_0xb978('0x12'));var qs=require(_0xb978('0x13'));var as=require(_0xb978('0x14'));var hardwareService=require(_0xb978('0x15'));var logger=require(_0xb978('0x16'))(_0xb978('0x17'));var utils=require('../../config/utils');var config=require(_0xb978('0x18'));var licenseUtil=require(_0xb978('0x19'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x2ba2ec,_0x5e07f5){_0x5e07f5=_0x5e07f5||0xcc;return function(_0x445af0){if(_0x445af0){return _0x2ba2ec[_0xb978('0x1a')](_0x5e07f5);}return _0x2ba2ec[_0xb978('0x1b')](_0x5e07f5)['end']();};}function respondWithResult(_0x5efcde,_0x45e05c){_0x45e05c=_0x45e05c||0xc8;return function(_0x142fdd){if(_0x142fdd){return _0x5efcde[_0xb978('0x1b')](_0x45e05c)[_0xb978('0x1c')](_0x142fdd);}};}function respondWithFilteredResult(_0x3e456b,_0x4c7b44){return function(_0x5d926a){if(_0x5d926a){var _0x4897e9=typeof _0x4c7b44[_0xb978('0x1d')]===_0xb978('0x1e')&&typeof _0x4c7b44[_0xb978('0x1f')]===_0xb978('0x1e');var _0x381aaf=_0x5d926a['count'];var _0x5b01dc=_0x4897e9?0x0:_0x4c7b44[_0xb978('0x1d')];var _0x2ed722=_0x4897e9?_0x5d926a[_0xb978('0x20')]:_0x4c7b44['offset']+_0x4c7b44[_0xb978('0x1f')];var _0x4cd9ff;if(_0x2ed722>=_0x381aaf){_0x2ed722=_0x381aaf;_0x4cd9ff=0xc8;}else{_0x4cd9ff=0xce;}_0x3e456b[_0xb978('0x1b')](_0x4cd9ff);return _0x3e456b[_0xb978('0x21')]('Content-Range',_0x5b01dc+'-'+_0x2ed722+'/'+_0x381aaf)[_0xb978('0x1c')](_0x5d926a);}return null;};}function patchUpdates(_0x5a0b5d){return function(_0x24f9f1){try{jsonpatch['apply'](_0x24f9f1,_0x5a0b5d,!![]);}catch(_0x4b88b5){return BPromise[_0xb978('0x22')](_0x4b88b5);}return _0x24f9f1[_0xb978('0x23')]();};}function saveUpdates(_0x2bc7e6,_0x1c173c){return function(_0x5726d7){if(_0x5726d7){return _0x5726d7[_0xb978('0x24')](_0x2bc7e6)[_0xb978('0x25')](function(_0xc206f0){return _0xc206f0;});}return null;};}function removeEntity(_0x3e1b44,_0x1b993d){return function(_0x3b3dbd){if(_0x3b3dbd){return _0x3b3dbd['destroy']()[_0xb978('0x25')](function(){_0x3e1b44[_0xb978('0x1b')](0xcc)[_0xb978('0x26')]();});}};}function handleEntityNotFound(_0x2dfea6,_0x2b9bdc){return function(_0x9dcf36){if(!_0x9dcf36){_0x2dfea6[_0xb978('0x1a')](0x194);}return _0x9dcf36;};}function handleError(_0x1463f0,_0x2a5adb){_0x2a5adb=_0x2a5adb||0x1f4;return function(_0x137118){logger[_0xb978('0x27')](_0x137118['stack']);if(_0x137118[_0xb978('0x28')]){delete _0x137118['name'];}_0x1463f0[_0xb978('0x1b')](_0x2a5adb)[_0xb978('0x29')](_0x137118);};}exports[_0xb978('0x2a')]=function(_0x2c69c7,_0x3d47fc){var _0x4cbb47={},_0x596c35={},_0x5f36c4={'count':0x0,'rows':[]};var _0x25f800=_[_0xb978('0x2b')](db[_0xb978('0x2c')]['rawAttributes'],function(_0x228cf0){return{'name':_0x228cf0[_0xb978('0x2d')],'type':_0x228cf0['type'][_0xb978('0x2e')]};});_0x596c35['model']=_[_0xb978('0x2b')](_0x25f800,_0xb978('0x28'));_0x596c35[_0xb978('0x2f')]=_['keys'](_0x2c69c7[_0xb978('0x2f')]);_0x596c35['filters']=_[_0xb978('0x30')](_0x596c35[_0xb978('0x31')],_0x596c35[_0xb978('0x2f')]);_0x4cbb47[_0xb978('0x32')]=_[_0xb978('0x30')](_0x596c35[_0xb978('0x31')],qs[_0xb978('0x33')](_0x2c69c7[_0xb978('0x2f')]['fields']));_0x4cbb47[_0xb978('0x32')]=_0x4cbb47[_0xb978('0x32')]['length']?_0x4cbb47[_0xb978('0x32')]:_0x596c35[_0xb978('0x31')];if(!_0x2c69c7['query'][_0xb978('0x34')]('nolimit')){_0x4cbb47['limit']=qs[_0xb978('0x1f')](_0x2c69c7[_0xb978('0x2f')][_0xb978('0x1f')]);_0x4cbb47[_0xb978('0x1d')]=qs[_0xb978('0x1d')](_0x2c69c7[_0xb978('0x2f')][_0xb978('0x1d')]);}_0x4cbb47['order']=qs['sort'](_0x2c69c7[_0xb978('0x2f')][_0xb978('0x35')]);_0x4cbb47[_0xb978('0x36')]=qs[_0xb978('0x37')](_[_0xb978('0x38')](_0x2c69c7[_0xb978('0x2f')],_0x596c35[_0xb978('0x37')]),_0x25f800);if(_0x2c69c7['query'][_0xb978('0x39')]){_0x4cbb47[_0xb978('0x36')]=_[_0xb978('0x3a')](_0x4cbb47[_0xb978('0x36')],{'$or':_[_0xb978('0x2b')](_0x25f800,function(_0x2774c5){if(_0x2774c5[_0xb978('0x3b')]!==_0xb978('0x3c')){var _0x1b8329={};_0x1b8329[_0x2774c5[_0xb978('0x28')]]={'$like':'%'+_0x2c69c7[_0xb978('0x2f')]['filter']+'%'};return _0x1b8329;}})});}_0x4cbb47=_[_0xb978('0x3a')]({},_0x4cbb47,_0x2c69c7[_0xb978('0x3d')]);var _0x2d530e={'where':_0x4cbb47[_0xb978('0x36')]};return db[_0xb978('0x2c')][_0xb978('0x20')](_0x2d530e)[_0xb978('0x25')](function(_0x2a34a1){_0x5f36c4[_0xb978('0x20')]=_0x2a34a1;if(_0x2c69c7[_0xb978('0x2f')][_0xb978('0x3e')]){_0x4cbb47['include']=[{'all':!![]}];}return db[_0xb978('0x2c')][_0xb978('0x3f')](_0x4cbb47);})[_0xb978('0x25')](function(_0x2c3566){_0x5f36c4[_0xb978('0x40')]=_0x2c3566;return _0x5f36c4;})[_0xb978('0x25')](respondWithFilteredResult(_0x3d47fc,_0x4cbb47))[_0xb978('0x41')](handleError(_0x3d47fc,null));};exports[_0xb978('0x42')]=function(_0x865082,_0x3a7306){var _0x3f49f8={'raw':![],'where':{'id':_0x865082[_0xb978('0x43')]['id']}},_0x4ef1ff={};_0x4ef1ff[_0xb978('0x31')]=_[_0xb978('0x44')](db['VtigerAccount'][_0xb978('0x45')]);_0x4ef1ff['query']=_['keys'](_0x865082[_0xb978('0x2f')]);_0x4ef1ff[_0xb978('0x37')]=_[_0xb978('0x30')](_0x4ef1ff[_0xb978('0x31')],_0x4ef1ff[_0xb978('0x2f')]);_0x3f49f8[_0xb978('0x32')]=_[_0xb978('0x30')](_0x4ef1ff[_0xb978('0x31')],qs[_0xb978('0x33')](_0x865082[_0xb978('0x2f')][_0xb978('0x33')]));_0x3f49f8['attributes']=_0x3f49f8['attributes'][_0xb978('0x46')]?_0x3f49f8[_0xb978('0x32')]:_0x4ef1ff['model'];if(_0x865082['query'][_0xb978('0x3e')]){_0x3f49f8['include']=[{'all':!![]}];}_0x3f49f8=_[_0xb978('0x3a')]({},_0x3f49f8,_0x865082[_0xb978('0x3d')]);return db[_0xb978('0x2c')][_0xb978('0x47')](_0x3f49f8)['then'](handleEntityNotFound(_0x3a7306,null))[_0xb978('0x25')](respondWithResult(_0x3a7306,null))[_0xb978('0x41')](handleError(_0x3a7306,null));};exports['create']=function(_0x5172a7,_0x321a2d){return db[_0xb978('0x2c')][_0xb978('0x48')](_0x5172a7[_0xb978('0x49')],{})[_0xb978('0x25')](respondWithResult(_0x321a2d,0xc9))['catch'](handleError(_0x321a2d,null));};exports[_0xb978('0x24')]=function(_0x1b2462,_0x3527e1){if(_0x1b2462[_0xb978('0x49')]['id']){delete _0x1b2462[_0xb978('0x49')]['id'];}return db['VtigerAccount']['find']({'where':{'id':_0x1b2462[_0xb978('0x43')]['id']}})[_0xb978('0x25')](handleEntityNotFound(_0x3527e1,null))[_0xb978('0x25')](saveUpdates(_0x1b2462[_0xb978('0x49')],null))[_0xb978('0x25')](respondWithResult(_0x3527e1,null))['catch'](handleError(_0x3527e1,null));};exports['destroy']=function(_0x461bb1,_0x25227d){return db[_0xb978('0x2c')][_0xb978('0x47')]({'where':{'id':_0x461bb1[_0xb978('0x43')]['id']}})[_0xb978('0x25')](handleEntityNotFound(_0x25227d,null))['then'](removeEntity(_0x25227d,null))[_0xb978('0x41')](handleError(_0x25227d,null));};exports[_0xb978('0x4a')]=function(_0x314722,_0x83755a,_0x1aa32d){var _0x4b0b9e={};var _0x1af367={};var _0x54d64b;var _0x515a73;return db[_0xb978('0x2c')]['findOne']({'where':{'id':_0x314722[_0xb978('0x43')]['id']}})[_0xb978('0x25')](handleEntityNotFound(_0x83755a,null))[_0xb978('0x25')](function(_0xee39c9){if(_0xee39c9){_0x54d64b=_0xee39c9;_0x1af367['model']=_[_0xb978('0x44')](db[_0xb978('0x4b')][_0xb978('0x45')]);_0x1af367[_0xb978('0x2f')]=_[_0xb978('0x44')](_0x314722['query']);_0x1af367[_0xb978('0x37')]=_[_0xb978('0x30')](_0x1af367['model'],_0x1af367[_0xb978('0x2f')]);_0x4b0b9e[_0xb978('0x32')]=_[_0xb978('0x30')](_0x1af367[_0xb978('0x31')],qs['fields'](_0x314722[_0xb978('0x2f')][_0xb978('0x33')]));_0x4b0b9e[_0xb978('0x32')]=_0x4b0b9e[_0xb978('0x32')][_0xb978('0x46')]?_0x4b0b9e[_0xb978('0x32')]:_0x1af367[_0xb978('0x31')];_0x4b0b9e[_0xb978('0x4c')]=qs[_0xb978('0x35')](_0x314722[_0xb978('0x2f')][_0xb978('0x35')]);_0x4b0b9e[_0xb978('0x36')]=qs['filters'](_[_0xb978('0x38')](_0x314722[_0xb978('0x2f')],_0x1af367[_0xb978('0x37')]));if(_0x314722['query'][_0xb978('0x39')]){_0x4b0b9e[_0xb978('0x36')]=_['merge'](_0x4b0b9e[_0xb978('0x36')],{'$or':_[_0xb978('0x2b')](_0x4b0b9e[_0xb978('0x32')],function(_0x45334d){var _0x5dda2c={};_0x5dda2c[_0x45334d]={'$like':'%'+_0x314722[_0xb978('0x2f')][_0xb978('0x39')]+'%'};return _0x5dda2c;})});}_0x4b0b9e=_['merge']({},_0x4b0b9e,_0x314722[_0xb978('0x3d')]);return _0x54d64b[_0xb978('0x4a')](_0x4b0b9e);}})['then'](function(_0x2eadb8){if(_0x2eadb8){_0x515a73=_0x2eadb8[_0xb978('0x46')];if(!_0x314722[_0xb978('0x2f')][_0xb978('0x34')](_0xb978('0x4d'))){_0x4b0b9e[_0xb978('0x1f')]=qs['limit'](_0x314722[_0xb978('0x2f')][_0xb978('0x1f')]);_0x4b0b9e[_0xb978('0x1d')]=qs['offset'](_0x314722[_0xb978('0x2f')]['offset']);}return _0x54d64b[_0xb978('0x4a')](_0x4b0b9e);}})[_0xb978('0x25')](function(_0x3c415b){if(_0x3c415b){return _0x3c415b?{'count':_0x515a73,'rows':_0x3c415b}:null;}})[_0xb978('0x25')](respondWithResult(_0x83755a,null))[_0xb978('0x41')](handleError(_0x83755a,null));};exports[_0xb978('0x4e')]=function(_0xe824e1,_0x4496a8,_0x3b7ff2){if(_0xe824e1['body']['id']){delete _0xe824e1[_0xb978('0x49')]['id'];}return db[_0xb978('0x2c')][_0xb978('0x4f')]({'where':{'id':_0xe824e1[_0xb978('0x43')]['id']}})[_0xb978('0x25')](handleEntityNotFound(_0x4496a8,null))[_0xb978('0x25')](function(_0x311615){if(_0x311615){_0xe824e1['body'][_0xb978('0x50')]=_0x311615['id'];_0xe824e1[_0xb978('0x49')][_0xb978('0x51')]=integrations[_0xb978('0x52')](_0xe824e1[_0xb978('0x49')][_0xb978('0x53')],_0xe824e1[_0xb978('0x49')]['type']);_0xe824e1[_0xb978('0x49')][_0xb978('0x54')]=integrations[_0xb978('0x55')](_0xe824e1[_0xb978('0x49')][_0xb978('0x53')],_0xe824e1[_0xb978('0x49')][_0xb978('0x3b')]);return db['VtigerConfiguration']['create'](_0xe824e1[_0xb978('0x49')],{'include':[{'model':db[_0xb978('0x56')],'as':_0xb978('0x51')},{'model':db[_0xb978('0x56')],'as':_0xb978('0x54')}]});}return null;})[_0xb978('0x25')](respondWithResult(_0x4496a8,null))[_0xb978('0x41')](handleError(_0x4496a8,null));};var md5=require(_0xb978('0x57'));exports[_0xb978('0x58')]=function(_0x3d61b7,_0x2feb62,_0x1df2ba){var _0x3550d5=null;var _0x425259=null;var _0x48e469=null;var _0x461e8f=null;var _0x1f66a0='';return db[_0xb978('0x2c')][_0xb978('0x4f')]({'where':{'id':_0x3d61b7['params']['id']},'attributes':['id','name','username','description',_0xb978('0x59'),_0xb978('0x5a'),_0xb978('0x5b'),'accessKey']})[_0xb978('0x25')](handleEntityNotFound(_0x2feb62,null))[_0xb978('0x25')](function(_0x467235){if(_0x467235){_0x3550d5=_0x467235[_0xb978('0x5c')];_0x425259=_0x467235[_0xb978('0x5d')];_0x48e469=_0x467235[_0xb978('0x59')];_0x1f66a0=_0x467235['remoteUri'];var _0x2403a2=_0x1f66a0['slice'](-0x1);if(_0x2403a2==='/'){_0x1f66a0=_0x1f66a0[_0xb978('0x5e')](0x0,_0x1f66a0[_0xb978('0x5f')](_0x2403a2));}_0x461e8f=util['format'](_0xb978('0x60'),_0x1f66a0);var _0x3f3bd8={'method':_0xb978('0x61'),'uri':_0x461e8f,'qs':{'operation':_0xb978('0x62'),'username':_0x467235[_0xb978('0x5c')]},'json':!![]};return rp(_0x3f3bd8);}})[_0xb978('0x25')](function(_0x50bb30){if(_0x50bb30[_0xb978('0x63')]){var _0x43efbd={'method':_0xb978('0x64'),'uri':_0x461e8f,'form':{'operation':'login','username':_0x3550d5,'accessKey':md5(_0x50bb30[_0xb978('0x65')][_0xb978('0x66')]+_0x425259)},'json':!![]};return rp(_0x43efbd);}})[_0xb978('0x25')](function(_0x172e45){if(_0x172e45[_0xb978('0x63')]){var _0x3a4033={'method':_0xb978('0x61'),'uri':_0x461e8f,'qs':{'operation':_0xb978('0x67'),'username':_0x3550d5,'sessionName':_0x172e45[_0xb978('0x65')][_0xb978('0x68')],'elementType':_0x48e469},'json':!![]};return rp(_0x3a4033);}})[_0xb978('0x25')](function(_0x546faf){if(_0x546faf['success']){var _0x4a1b41=[_0xb978('0x69'),'reference',_0xb978('0x6a')];_[_0xb978('0x6b')](_0x546faf['result'][_0xb978('0x33')],function(_0x312ca0){return _0x4a1b41[_0xb978('0x6c')](_0x312ca0[_0xb978('0x3b')][_0xb978('0x28')]);});_[_0xb978('0x6b')](_0x546faf[_0xb978('0x65')][_0xb978('0x33')],function(_0x18d407){return _0x18d407[_0xb978('0x6d')]===_0xb978('0x6e');});return{'count':_0x546faf[_0xb978('0x65')][_0xb978('0x33')][_0xb978('0x46')],'rows':_[_0xb978('0x2b')](_0x546faf['result'][_0xb978('0x33')],function(_0x3fcd83){return{'id':_0x3fcd83[_0xb978('0x28')],'name':_0x3fcd83['label'],'custom':_[_0xb978('0x6f')](_0x3fcd83[_0xb978('0x28')],'cf_')?!![]:![],'options':_0x3fcd83['type'][_0xb978('0x28')]==='picklist'&&_0x3fcd83['type'][_0xb978('0x70')][_0xb978('0x46')]>0x0?_['map'](_0x3fcd83[_0xb978('0x3b')][_0xb978('0x70')],function(_0xc44131){return{'name':_0xc44131[_0xb978('0x71')],'value':_0xc44131[_0xb978('0x72')]};}):[]};})};}})[_0xb978('0x25')](respondWithResult(_0x2feb62,null))[_0xb978('0x41')](function(_0x12f517){console[_0xb978('0x73')](_0xb978('0x74')+_0x12f517);var _0x38e23f=_0x3d61b7['query']['test']?0x1f4:_0x12f517['statusCode']||0x1f4;logger[_0xb978('0x27')](_0xb978('0x75'),_0xb978('0x58'),_0x38e23f,JSON[_0xb978('0x76')](_0x12f517));delete _0x12f517[_0xb978('0x28')];if(_0x38e23f===0x191){_0x38e23f=0x190;}_0x2feb62[_0xb978('0x1b')](_0x38e23f)[_0xb978('0x29')](_0x3d61b7['query'][_0xb978('0x77')]?{'message':'Wrong\x20credentials','statusCode':_0x12f517[_0xb978('0x78')]}:_0x12f517);});}; \ No newline at end of file +var _0xdd5f=['json','offset','limit','undefined','count','Content-Range','reject','save','update','then','destroy','end','stack','name','send','index','map','VtigerAccount','rawAttributes','fieldName','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','merge','type','filter','options','includeAll','include','rows','catch','find','create','body','params','getConfigurations','VtigerConfiguration','order','pick','findOne','AccountId','Subjects','getSubjects','channel','getDescriptions','VtigerField','Descriptions','md5','getFields','username','description','moduleName','remoteUri','serverUrl','accessKey','slice','substring','lastIndexOf','format','%s/webservice.php','GET','getchallenge','POST','login','token','success','describe','result','sessionName','autogenerated','owner','remove','false','label','startsWith','cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status'];(function(_0x216586,_0x2e9346){var _0x2c0807=function(_0x3ade09){while(--_0x3ade09){_0x216586['push'](_0x216586['shift']());}};_0x2c0807(++_0x2e9346);}(_0xdd5f,0x156));var _0xfdd5=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0xdd5f[_0x487b0c];return _0x1adbdc;};'use strict';var emlformat=require(_0xfdd5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfdd5('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfdd5('0x2'));var moment=require(_0xfdd5('0x3'));var BPromise=require(_0xfdd5('0x4'));var Mustache=require('mustache');var util=require(_0xfdd5('0x5'));var path=require(_0xfdd5('0x6'));var sox=require(_0xfdd5('0x7'));var csv=require(_0xfdd5('0x8'));var ejs=require(_0xfdd5('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfdd5('0xa'));var squel=require(_0xfdd5('0xb'));var crypto=require(_0xfdd5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xfdd5('0xd'));var toCsv=require(_0xfdd5('0x8'));var querystring=require('querystring');var Papa=require(_0xfdd5('0xe'));var Redis=require(_0xfdd5('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xfdd5('0x10'));var as=require(_0xfdd5('0x11'));var hardwareService=require(_0xfdd5('0x12'));var logger=require('../../config/logger')(_0xfdd5('0x13'));var utils=require(_0xfdd5('0x14'));var config=require(_0xfdd5('0x15'));var licenseUtil=require(_0xfdd5('0x16'));var db=require(_0xfdd5('0x17'))['db'];var integrations=require(_0xfdd5('0x18'));function respondWithStatusCode(_0x311251,_0x219540){_0x219540=_0x219540||0xcc;return function(_0x435987){if(_0x435987){return _0x311251[_0xfdd5('0x19')](_0x219540);}return _0x311251[_0xfdd5('0x1a')](_0x219540)['end']();};}function respondWithResult(_0x250844,_0x1f5405){_0x1f5405=_0x1f5405||0xc8;return function(_0x133018){if(_0x133018){return _0x250844[_0xfdd5('0x1a')](_0x1f5405)[_0xfdd5('0x1b')](_0x133018);}};}function respondWithFilteredResult(_0xa12a74,_0x2a4159){return function(_0x22b3c2){if(_0x22b3c2){var _0x1c4f56=typeof _0x2a4159[_0xfdd5('0x1c')]==='undefined'&&typeof _0x2a4159[_0xfdd5('0x1d')]===_0xfdd5('0x1e');var _0x270574=_0x22b3c2[_0xfdd5('0x1f')];var _0x2f7e8d=_0x1c4f56?0x0:_0x2a4159[_0xfdd5('0x1c')];var _0x8e4cb=_0x1c4f56?_0x22b3c2[_0xfdd5('0x1f')]:_0x2a4159[_0xfdd5('0x1c')]+_0x2a4159[_0xfdd5('0x1d')];var _0x5a3d28;if(_0x8e4cb>=_0x270574){_0x8e4cb=_0x270574;_0x5a3d28=0xc8;}else{_0x5a3d28=0xce;}_0xa12a74['status'](_0x5a3d28);return _0xa12a74['set'](_0xfdd5('0x20'),_0x2f7e8d+'-'+_0x8e4cb+'/'+_0x270574)[_0xfdd5('0x1b')](_0x22b3c2);}return null;};}function patchUpdates(_0x27cce0){return function(_0x4d7203){try{jsonpatch['apply'](_0x4d7203,_0x27cce0,!![]);}catch(_0x14b059){return BPromise[_0xfdd5('0x21')](_0x14b059);}return _0x4d7203[_0xfdd5('0x22')]();};}function saveUpdates(_0x359349,_0x222dbf){return function(_0x2d1a94){if(_0x2d1a94){return _0x2d1a94[_0xfdd5('0x23')](_0x359349)[_0xfdd5('0x24')](function(_0x2e72d6){return _0x2e72d6;});}return null;};}function removeEntity(_0x2f35c1,_0x3f3dbd){return function(_0x271e54){if(_0x271e54){return _0x271e54[_0xfdd5('0x25')]()[_0xfdd5('0x24')](function(){_0x2f35c1[_0xfdd5('0x1a')](0xcc)[_0xfdd5('0x26')]();});}};}function handleEntityNotFound(_0x5f4a99,_0x4345a8){return function(_0x2ab7d6){if(!_0x2ab7d6){_0x5f4a99[_0xfdd5('0x19')](0x194);}return _0x2ab7d6;};}function handleError(_0x3ed242,_0x2f91dc){_0x2f91dc=_0x2f91dc||0x1f4;return function(_0x216ba3){logger['error'](_0x216ba3[_0xfdd5('0x27')]);if(_0x216ba3[_0xfdd5('0x28')]){delete _0x216ba3[_0xfdd5('0x28')];}_0x3ed242[_0xfdd5('0x1a')](_0x2f91dc)[_0xfdd5('0x29')](_0x216ba3);};}exports[_0xfdd5('0x2a')]=function(_0xbc15b2,_0x491178){var _0x355a20={},_0x369ab3={},_0x576c96={'count':0x0,'rows':[]};var _0x3b09a0=_[_0xfdd5('0x2b')](db[_0xfdd5('0x2c')][_0xfdd5('0x2d')],function(_0x2022c9){return{'name':_0x2022c9[_0xfdd5('0x2e')],'type':_0x2022c9['type'][_0xfdd5('0x2f')]};});_0x369ab3[_0xfdd5('0x30')]=_[_0xfdd5('0x2b')](_0x3b09a0,_0xfdd5('0x28'));_0x369ab3[_0xfdd5('0x31')]=_[_0xfdd5('0x32')](_0xbc15b2[_0xfdd5('0x31')]);_0x369ab3['filters']=_['intersection'](_0x369ab3[_0xfdd5('0x30')],_0x369ab3['query']);_0x355a20[_0xfdd5('0x33')]=_[_0xfdd5('0x34')](_0x369ab3[_0xfdd5('0x30')],qs[_0xfdd5('0x35')](_0xbc15b2[_0xfdd5('0x31')][_0xfdd5('0x35')]));_0x355a20[_0xfdd5('0x33')]=_0x355a20[_0xfdd5('0x33')][_0xfdd5('0x36')]?_0x355a20[_0xfdd5('0x33')]:_0x369ab3[_0xfdd5('0x30')];if(!_0xbc15b2[_0xfdd5('0x31')][_0xfdd5('0x37')](_0xfdd5('0x38'))){_0x355a20[_0xfdd5('0x1d')]=qs['limit'](_0xbc15b2[_0xfdd5('0x31')][_0xfdd5('0x1d')]);_0x355a20['offset']=qs[_0xfdd5('0x1c')](_0xbc15b2[_0xfdd5('0x31')][_0xfdd5('0x1c')]);}_0x355a20['order']=qs[_0xfdd5('0x39')](_0xbc15b2['query']['sort']);_0x355a20[_0xfdd5('0x3a')]=qs[_0xfdd5('0x3b')](_['pick'](_0xbc15b2[_0xfdd5('0x31')],_0x369ab3[_0xfdd5('0x3b')]),_0x3b09a0);if(_0xbc15b2[_0xfdd5('0x31')]['filter']){_0x355a20[_0xfdd5('0x3a')]=_[_0xfdd5('0x3c')](_0x355a20[_0xfdd5('0x3a')],{'$or':_['map'](_0x3b09a0,function(_0x18ae73){if(_0x18ae73[_0xfdd5('0x3d')]!=='VIRTUAL'){var _0x530d8c={};_0x530d8c[_0x18ae73[_0xfdd5('0x28')]]={'$like':'%'+_0xbc15b2[_0xfdd5('0x31')][_0xfdd5('0x3e')]+'%'};return _0x530d8c;}})});}_0x355a20=_[_0xfdd5('0x3c')]({},_0x355a20,_0xbc15b2[_0xfdd5('0x3f')]);var _0x293113={'where':_0x355a20[_0xfdd5('0x3a')]};return db[_0xfdd5('0x2c')][_0xfdd5('0x1f')](_0x293113)[_0xfdd5('0x24')](function(_0x4e2a3){_0x576c96['count']=_0x4e2a3;if(_0xbc15b2['query'][_0xfdd5('0x40')]){_0x355a20[_0xfdd5('0x41')]=[{'all':!![]}];}return db[_0xfdd5('0x2c')]['findAll'](_0x355a20);})[_0xfdd5('0x24')](function(_0x381cbf){_0x576c96[_0xfdd5('0x42')]=_0x381cbf;return _0x576c96;})[_0xfdd5('0x24')](respondWithFilteredResult(_0x491178,_0x355a20))[_0xfdd5('0x43')](handleError(_0x491178,null));};exports['show']=function(_0x578557,_0x28f467){var _0x5113c0={'raw':![],'where':{'id':_0x578557['params']['id']}},_0x30e7f4={};_0x30e7f4[_0xfdd5('0x30')]=_[_0xfdd5('0x32')](db['VtigerAccount']['rawAttributes']);_0x30e7f4[_0xfdd5('0x31')]=_[_0xfdd5('0x32')](_0x578557[_0xfdd5('0x31')]);_0x30e7f4[_0xfdd5('0x3b')]=_[_0xfdd5('0x34')](_0x30e7f4[_0xfdd5('0x30')],_0x30e7f4['query']);_0x5113c0['attributes']=_[_0xfdd5('0x34')](_0x30e7f4[_0xfdd5('0x30')],qs['fields'](_0x578557['query'][_0xfdd5('0x35')]));_0x5113c0[_0xfdd5('0x33')]=_0x5113c0[_0xfdd5('0x33')][_0xfdd5('0x36')]?_0x5113c0[_0xfdd5('0x33')]:_0x30e7f4[_0xfdd5('0x30')];if(_0x578557[_0xfdd5('0x31')][_0xfdd5('0x40')]){_0x5113c0[_0xfdd5('0x41')]=[{'all':!![]}];}_0x5113c0=_['merge']({},_0x5113c0,_0x578557['options']);return db[_0xfdd5('0x2c')][_0xfdd5('0x44')](_0x5113c0)[_0xfdd5('0x24')](handleEntityNotFound(_0x28f467,null))[_0xfdd5('0x24')](respondWithResult(_0x28f467,null))['catch'](handleError(_0x28f467,null));};exports[_0xfdd5('0x45')]=function(_0x52b587,_0x5194bd){return db[_0xfdd5('0x2c')][_0xfdd5('0x45')](_0x52b587[_0xfdd5('0x46')],{})[_0xfdd5('0x24')](respondWithResult(_0x5194bd,0xc9))['catch'](handleError(_0x5194bd,null));};exports['update']=function(_0x588d88,_0x484e95){if(_0x588d88[_0xfdd5('0x46')]['id']){delete _0x588d88[_0xfdd5('0x46')]['id'];}return db[_0xfdd5('0x2c')][_0xfdd5('0x44')]({'where':{'id':_0x588d88[_0xfdd5('0x47')]['id']}})['then'](handleEntityNotFound(_0x484e95,null))[_0xfdd5('0x24')](saveUpdates(_0x588d88[_0xfdd5('0x46')],null))[_0xfdd5('0x24')](respondWithResult(_0x484e95,null))['catch'](handleError(_0x484e95,null));};exports[_0xfdd5('0x25')]=function(_0x33751f,_0x248920){return db[_0xfdd5('0x2c')][_0xfdd5('0x44')]({'where':{'id':_0x33751f[_0xfdd5('0x47')]['id']}})[_0xfdd5('0x24')](handleEntityNotFound(_0x248920,null))[_0xfdd5('0x24')](removeEntity(_0x248920,null))['catch'](handleError(_0x248920,null));};exports[_0xfdd5('0x48')]=function(_0x2ac0cf,_0x5d4201,_0x1fc364){var _0x32a330={};var _0x4da4bd={};var _0x136a65;var _0x4164ba;return db['VtigerAccount']['findOne']({'where':{'id':_0x2ac0cf[_0xfdd5('0x47')]['id']}})[_0xfdd5('0x24')](handleEntityNotFound(_0x5d4201,null))[_0xfdd5('0x24')](function(_0x20d566){if(_0x20d566){_0x136a65=_0x20d566;_0x4da4bd[_0xfdd5('0x30')]=_[_0xfdd5('0x32')](db[_0xfdd5('0x49')][_0xfdd5('0x2d')]);_0x4da4bd[_0xfdd5('0x31')]=_[_0xfdd5('0x32')](_0x2ac0cf[_0xfdd5('0x31')]);_0x4da4bd['filters']=_[_0xfdd5('0x34')](_0x4da4bd[_0xfdd5('0x30')],_0x4da4bd[_0xfdd5('0x31')]);_0x32a330[_0xfdd5('0x33')]=_[_0xfdd5('0x34')](_0x4da4bd['model'],qs[_0xfdd5('0x35')](_0x2ac0cf[_0xfdd5('0x31')][_0xfdd5('0x35')]));_0x32a330[_0xfdd5('0x33')]=_0x32a330[_0xfdd5('0x33')]['length']?_0x32a330[_0xfdd5('0x33')]:_0x4da4bd[_0xfdd5('0x30')];_0x32a330[_0xfdd5('0x4a')]=qs[_0xfdd5('0x39')](_0x2ac0cf[_0xfdd5('0x31')][_0xfdd5('0x39')]);_0x32a330[_0xfdd5('0x3a')]=qs[_0xfdd5('0x3b')](_[_0xfdd5('0x4b')](_0x2ac0cf[_0xfdd5('0x31')],_0x4da4bd[_0xfdd5('0x3b')]));if(_0x2ac0cf[_0xfdd5('0x31')][_0xfdd5('0x3e')]){_0x32a330[_0xfdd5('0x3a')]=_[_0xfdd5('0x3c')](_0x32a330[_0xfdd5('0x3a')],{'$or':_['map'](_0x32a330[_0xfdd5('0x33')],function(_0x8b2532){var _0x3d6ef6={};_0x3d6ef6[_0x8b2532]={'$like':'%'+_0x2ac0cf['query']['filter']+'%'};return _0x3d6ef6;})});}_0x32a330=_[_0xfdd5('0x3c')]({},_0x32a330,_0x2ac0cf[_0xfdd5('0x3f')]);return _0x136a65[_0xfdd5('0x48')](_0x32a330);}})[_0xfdd5('0x24')](function(_0x4000b2){if(_0x4000b2){_0x4164ba=_0x4000b2[_0xfdd5('0x36')];if(!_0x2ac0cf[_0xfdd5('0x31')][_0xfdd5('0x37')](_0xfdd5('0x38'))){_0x32a330[_0xfdd5('0x1d')]=qs[_0xfdd5('0x1d')](_0x2ac0cf['query'][_0xfdd5('0x1d')]);_0x32a330[_0xfdd5('0x1c')]=qs[_0xfdd5('0x1c')](_0x2ac0cf[_0xfdd5('0x31')]['offset']);}return _0x136a65[_0xfdd5('0x48')](_0x32a330);}})['then'](function(_0x564fb6){if(_0x564fb6){return _0x564fb6?{'count':_0x4164ba,'rows':_0x564fb6}:null;}})[_0xfdd5('0x24')](respondWithResult(_0x5d4201,null))[_0xfdd5('0x43')](handleError(_0x5d4201,null));};exports['addConfiguration']=function(_0x115e5e,_0x4137c6,_0xc13f82){if(_0x115e5e[_0xfdd5('0x46')]['id']){delete _0x115e5e[_0xfdd5('0x46')]['id'];}return db['VtigerAccount'][_0xfdd5('0x4c')]({'where':{'id':_0x115e5e['params']['id']}})['then'](handleEntityNotFound(_0x4137c6,null))[_0xfdd5('0x24')](function(_0x1f774c){if(_0x1f774c){_0x115e5e['body'][_0xfdd5('0x4d')]=_0x1f774c['id'];_0x115e5e[_0xfdd5('0x46')][_0xfdd5('0x4e')]=integrations[_0xfdd5('0x4f')](_0x115e5e[_0xfdd5('0x46')][_0xfdd5('0x50')],_0x115e5e[_0xfdd5('0x46')][_0xfdd5('0x3d')]);_0x115e5e['body']['Descriptions']=integrations[_0xfdd5('0x51')](_0x115e5e[_0xfdd5('0x46')][_0xfdd5('0x50')],_0x115e5e[_0xfdd5('0x46')][_0xfdd5('0x3d')]);return db[_0xfdd5('0x49')]['create'](_0x115e5e[_0xfdd5('0x46')],{'include':[{'model':db[_0xfdd5('0x52')],'as':_0xfdd5('0x4e')},{'model':db['VtigerField'],'as':_0xfdd5('0x53')}]});}return null;})[_0xfdd5('0x24')](respondWithResult(_0x4137c6,null))[_0xfdd5('0x43')](handleError(_0x4137c6,null));};var md5=require(_0xfdd5('0x54'));exports[_0xfdd5('0x55')]=function(_0x33188c,_0x1a1f19,_0x5a288d){var _0x155216=null;var _0x550eda=null;var _0x295839=null;var _0x8df601=null;var _0x38b19c='';return db['VtigerAccount']['findOne']({'where':{'id':_0x33188c[_0xfdd5('0x47')]['id']},'attributes':['id',_0xfdd5('0x28'),_0xfdd5('0x56'),_0xfdd5('0x57'),_0xfdd5('0x58'),_0xfdd5('0x59'),_0xfdd5('0x5a'),_0xfdd5('0x5b')]})['then'](handleEntityNotFound(_0x1a1f19,null))[_0xfdd5('0x24')](function(_0x2f670d){if(_0x2f670d){_0x155216=_0x2f670d[_0xfdd5('0x56')];_0x550eda=_0x2f670d[_0xfdd5('0x5b')];_0x295839=_0x2f670d[_0xfdd5('0x58')];_0x38b19c=_0x2f670d[_0xfdd5('0x59')];var _0x3c108=_0x38b19c[_0xfdd5('0x5c')](-0x1);if(_0x3c108==='/'){_0x38b19c=_0x38b19c[_0xfdd5('0x5d')](0x0,_0x38b19c[_0xfdd5('0x5e')](_0x3c108));}_0x8df601=util[_0xfdd5('0x5f')](_0xfdd5('0x60'),_0x38b19c);var _0x3782f7={'method':_0xfdd5('0x61'),'uri':_0x8df601,'qs':{'operation':_0xfdd5('0x62'),'username':_0x2f670d[_0xfdd5('0x56')]},'json':!![]};return rp(_0x3782f7);}})[_0xfdd5('0x24')](function(_0x2d70c6){if(_0x2d70c6['success']){var _0x25dff8={'method':_0xfdd5('0x63'),'uri':_0x8df601,'form':{'operation':_0xfdd5('0x64'),'username':_0x155216,'accessKey':md5(_0x2d70c6['result'][_0xfdd5('0x65')]+_0x550eda)},'json':!![]};return rp(_0x25dff8);}})[_0xfdd5('0x24')](function(_0x3de0e0){if(_0x3de0e0[_0xfdd5('0x66')]){var _0xa9956={'method':_0xfdd5('0x61'),'uri':_0x8df601,'qs':{'operation':_0xfdd5('0x67'),'username':_0x155216,'sessionName':_0x3de0e0[_0xfdd5('0x68')][_0xfdd5('0x69')],'elementType':_0x295839},'json':!![]};return rp(_0xa9956);}})[_0xfdd5('0x24')](function(_0xe30977){if(_0xe30977['success']){var _0x128417=[_0xfdd5('0x6a'),'reference',_0xfdd5('0x6b')];_[_0xfdd5('0x6c')](_0xe30977[_0xfdd5('0x68')][_0xfdd5('0x35')],function(_0x1e1b8c){return _0x128417['includes'](_0x1e1b8c[_0xfdd5('0x3d')]['name']);});_['remove'](_0xe30977[_0xfdd5('0x68')][_0xfdd5('0x35')],function(_0x15a9b4){return _0x15a9b4['editable']===_0xfdd5('0x6d');});return{'count':_0xe30977['result'][_0xfdd5('0x35')]['length'],'rows':_[_0xfdd5('0x2b')](_0xe30977[_0xfdd5('0x68')][_0xfdd5('0x35')],function(_0x31db62){return{'id':_0x31db62[_0xfdd5('0x28')],'name':_0x31db62[_0xfdd5('0x6e')],'custom':_[_0xfdd5('0x6f')](_0x31db62['name'],_0xfdd5('0x70'))?!![]:![],'options':_0x31db62['type'][_0xfdd5('0x28')]===_0xfdd5('0x71')&&_0x31db62[_0xfdd5('0x3d')]['picklistValues'][_0xfdd5('0x36')]>0x0?_['map'](_0x31db62[_0xfdd5('0x3d')][_0xfdd5('0x72')],function(_0x272130){return{'name':_0x272130[_0xfdd5('0x6e')],'value':_0x272130[_0xfdd5('0x73')]};}):[]};})};}})['then'](respondWithResult(_0x1a1f19,null))['catch'](function(_0x312998){console[_0xfdd5('0x74')](_0xfdd5('0x75')+_0x312998);var _0x49dc3c=_0x33188c['query'][_0xfdd5('0x76')]?0x1f4:_0x312998[_0xfdd5('0x77')]||0x1f4;logger[_0xfdd5('0x78')](_0xfdd5('0x79'),_0xfdd5('0x55'),_0x49dc3c,JSON[_0xfdd5('0x7a')](_0x312998));delete _0x312998['name'];if(_0x49dc3c===0x191){_0x49dc3c=0x190;}_0x1a1f19[_0xfdd5('0x1a')](_0x49dc3c)[_0xfdd5('0x29')](_0x33188c[_0xfdd5('0x31')][_0xfdd5('0x76')]?{'message':'Wrong\x20credentials','statusCode':_0x312998[_0xfdd5('0x77')]}:_0x312998);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 7afbfdf..7523ab6 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 _0xa3c0=['request-promise','rimraf','../../config/environment','./intVtigerAccount.attributes','exports','define','VtigerAccount','api'];(function(_0x376b4d,_0x302856){var _0x24916b=function(_0x5cf20e){while(--_0x5cf20e){_0x376b4d['push'](_0x376b4d['shift']());}};_0x24916b(++_0x302856);}(_0xa3c0,0x11f));var _0x0a3c=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa3c0[_0x21aec3];return _0x288bbc;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x0a3c('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0a3c('0x1'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0a3c('0x2'));var config=require(_0x0a3c('0x3'));var attributes=require(_0x0a3c('0x4'));var integrations=require('../../components/integrations/configuration');module[_0x0a3c('0x5')]=function(_0x2af764,_0x2ae708){return _0x2af764[_0x0a3c('0x6')](_0x0a3c('0x7'),attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbdbb=['./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','VtigerAccount','lodash','../../config/logger','api','moment','rimraf','../../config/environment'];(function(_0x2806f6,_0x294105){var _0x32ebb1=function(_0x5e875d){while(--_0x5e875d){_0x2806f6['push'](_0x2806f6['shift']());}};_0x32ebb1(++_0x294105);}(_0xbdbb,0x1e9));var _0xbbdb=function(_0x59b341,_0x122518){_0x59b341=_0x59b341-0x0;var _0x5690b1=_0xbdbb[_0x59b341];return _0x5690b1;};'use strict';var _=require(_0xbbdb('0x0'));var util=require('util');var logger=require(_0xbbdb('0x1'))(_0xbbdb('0x2'));var moment=require(_0xbbdb('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xbbdb('0x4'));var config=require(_0xbbdb('0x5'));var attributes=require(_0xbbdb('0x6'));var integrations=require(_0xbbdb('0x7'));module[_0xbbdb('0x8')]=function(_0x44900d,_0x2dd8d2){return _0x44900d[_0xbbdb('0x9')](_0xbbdb('0xa'),attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.rpc.js b/server/api/intVtigerAccount/intVtigerAccount.rpc.js index a019c97..cfd1d5b 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 _0x84a0=['bluebird','ioredis','../../mysqldb','rpc','../../config/environment','client','http','request','then','info','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','VtigerAccount,\x20%s,\x20%s','message','result','catch','VtigerAccount','findAll','options','raw','where','attributes','limit','include','model','map','GetVtigerAccount','ShowVtigerAccount','find','lodash','util','moment'];(function(_0x16c6b5,_0x28f662){var _0x48ba7b=function(_0x3c2191){while(--_0x3c2191){_0x16c6b5['push'](_0x16c6b5['shift']());}};_0x48ba7b(++_0x28f662);}(_0x84a0,0x66));var _0x084a=function(_0x3f5f56,_0x5bde9e){_0x3f5f56=_0x3f5f56-0x0;var _0x1a27c7=_0x84a0[_0x3f5f56];return _0x1a27c7;};'use strict';var _=require(_0x084a('0x0'));var util=require(_0x084a('0x1'));var moment=require(_0x084a('0x2'));var BPromise=require(_0x084a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x084a('0x4'));var db=require(_0x084a('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x084a('0x6'));var config=require(_0x084a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x084a('0x8')][_0x084a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2e6810,_0x373d2,_0x2b30bc){return new BPromise(function(_0x58d419,_0x1051a9){return client[_0x084a('0xa')](_0x2e6810,_0x2b30bc)[_0x084a('0xb')](function(_0x2888e3){logger[_0x084a('0xc')]('VtigerAccount,\x20%s,\x20%s',_0x373d2,'request\x20sent');logger[_0x084a('0xd')](_0x084a('0xe'),_0x373d2,_0x084a('0xf'),JSON[_0x084a('0x10')](_0x2888e3));if(_0x2888e3[_0x084a('0x11')]){if(_0x2888e3['error']['code']===0x1f4){logger[_0x084a('0x11')](_0x084a('0x12'),_0x373d2,_0x2888e3[_0x084a('0x11')][_0x084a('0x13')]);return _0x1051a9(_0x2888e3[_0x084a('0x11')][_0x084a('0x13')]);}logger[_0x084a('0x11')](_0x084a('0x12'),_0x373d2,_0x2888e3['error'][_0x084a('0x13')]);return _0x58d419(_0x2888e3['error'][_0x084a('0x13')]);}else{logger[_0x084a('0xc')](_0x084a('0x12'),_0x373d2,_0x084a('0xf'));_0x58d419(_0x2888e3[_0x084a('0x14')]['message']);}})[_0x084a('0x15')](function(_0x4abd81){logger[_0x084a('0x11')](_0x084a('0x12'),_0x373d2,_0x4abd81);_0x1051a9(_0x4abd81);});});}exports['GetVtigerAccount']=function(_0xf2c333){var _0x32c729=this;return new Promise(function(_0x4134b9,_0x14bb19){return db[_0x084a('0x16')][_0x084a('0x17')]({'raw':_0xf2c333[_0x084a('0x18')]?_0xf2c333[_0x084a('0x18')][_0x084a('0x19')]===undefined?!![]:![]:!![],'where':_0xf2c333[_0x084a('0x18')]?_0xf2c333[_0x084a('0x18')][_0x084a('0x1a')]||null:null,'attributes':_0xf2c333[_0x084a('0x18')]?_0xf2c333[_0x084a('0x18')][_0x084a('0x1b')]||null:null,'limit':_0xf2c333['options']?_0xf2c333[_0x084a('0x18')][_0x084a('0x1c')]||null:null,'include':_0xf2c333[_0x084a('0x18')]?_0xf2c333[_0x084a('0x18')][_0x084a('0x1d')]?_['map'](_0xf2c333[_0x084a('0x18')][_0x084a('0x1d')],function(_0x6346a5){return{'model':db[_0x6346a5[_0x084a('0x1e')]],'as':_0x6346a5['as'],'attributes':_0x6346a5[_0x084a('0x1b')],'include':_0x6346a5[_0x084a('0x1d')]?_['map'](_0x6346a5[_0x084a('0x1d')],function(_0x2af138){return{'model':db[_0x2af138[_0x084a('0x1e')]],'as':_0x2af138['as'],'attributes':_0x2af138['attributes'],'include':_0x2af138[_0x084a('0x1d')]?_[_0x084a('0x1f')](_0x2af138[_0x084a('0x1d')],function(_0x4c5658){return{'model':db[_0x4c5658['model']],'as':_0x4c5658['as'],'attributes':_0x4c5658['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x33b88f){logger['info']('GetVtigerAccount',_0xf2c333);logger['debug'](_0x084a('0x20'),_0xf2c333,JSON[_0x084a('0x10')](_0x33b88f));_0x4134b9(_0x33b88f);})[_0x084a('0x15')](function(_0x2c4149){logger[_0x084a('0x11')](_0x084a('0x20'),_0x2c4149[_0x084a('0x13')],_0xf2c333);_0x14bb19(_0x32c729[_0x084a('0x11')](0x1f4,_0x2c4149['message']));});});};exports[_0x084a('0x21')]=function(_0x3b2b38){var _0x501a16=this;return new Promise(function(_0xe1980b,_0x24bcf5){return db[_0x084a('0x16')][_0x084a('0x22')]({'raw':_0x3b2b38[_0x084a('0x18')]?_0x3b2b38[_0x084a('0x18')][_0x084a('0x19')]===undefined?!![]:![]:!![],'where':_0x3b2b38[_0x084a('0x18')]?_0x3b2b38[_0x084a('0x18')][_0x084a('0x1a')]||null:null,'attributes':_0x3b2b38[_0x084a('0x18')]?_0x3b2b38[_0x084a('0x18')][_0x084a('0x1b')]||null:null,'include':_0x3b2b38['options']?_0x3b2b38['options'][_0x084a('0x1d')]?_[_0x084a('0x1f')](_0x3b2b38[_0x084a('0x18')][_0x084a('0x1d')],function(_0x83f94f){return{'model':db[_0x83f94f['model']],'as':_0x83f94f['as'],'attributes':_0x83f94f[_0x084a('0x1b')],'include':_0x83f94f[_0x084a('0x1d')]?_[_0x084a('0x1f')](_0x83f94f['include'],function(_0x109593){return{'model':db[_0x109593[_0x084a('0x1e')]],'as':_0x109593['as'],'attributes':_0x109593[_0x084a('0x1b')],'include':_0x109593['include']?_['map'](_0x109593['include'],function(_0xf97d1b){return{'model':db[_0xf97d1b[_0x084a('0x1e')]],'as':_0xf97d1b['as'],'attributes':_0xf97d1b[_0x084a('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3c09c3){logger[_0x084a('0xc')](_0x084a('0x21'),_0x3b2b38);logger[_0x084a('0xd')](_0x084a('0x21'),_0x3b2b38,JSON[_0x084a('0x10')](_0x3c09c3));_0xe1980b(_0x3c09c3);})[_0x084a('0x15')](function(_0x19354f){logger[_0x084a('0x11')](_0x084a('0x21'),_0x19354f[_0x084a('0x13')],_0x3b2b38);_0x24bcf5(_0x501a16[_0x084a('0x11')](0x1f4,_0x19354f[_0x084a('0x13')]));});});}; \ No newline at end of file +var _0x757a=['stringify','error','message','result','catch','GetVtigerAccount','VtigerAccount','findAll','options','where','attributes','limit','include','map','model','ShowVtigerAccount','find','raw','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s'];(function(_0x1f86e0,_0xc5852){var _0x281a1e=function(_0x3f5c04){while(--_0x3f5c04){_0x1f86e0['push'](_0x1f86e0['shift']());}};_0x281a1e(++_0xc5852);}(_0x757a,0xde));var _0xa757=function(_0x1c7b9f,_0x22d7f9){_0x1c7b9f=_0x1c7b9f-0x0;var _0x53fd2d=_0x757a[_0x1c7b9f];return _0x53fd2d;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var moment=require(_0xa757('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa757('0x2'))['db'];var utils=require(_0xa757('0x3'));var logger=require(_0xa757('0x4'))(_0xa757('0x5'));var config=require(_0xa757('0x6'));var jayson=require(_0xa757('0x7'));var client=jayson['client'][_0xa757('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4343b6,_0x53be0e,_0x2930fa){return new BPromise(function(_0x2f7793,_0x447344){return client[_0xa757('0x9')](_0x4343b6,_0x2930fa)[_0xa757('0xa')](function(_0x5aef8a){logger[_0xa757('0xb')](_0xa757('0xc'),_0x53be0e,_0xa757('0xd'));logger[_0xa757('0xe')](_0xa757('0xf'),_0x53be0e,_0xa757('0xd'),JSON[_0xa757('0x10')](_0x5aef8a));if(_0x5aef8a['error']){if(_0x5aef8a['error']['code']===0x1f4){logger['error']('VtigerAccount,\x20%s,\x20%s',_0x53be0e,_0x5aef8a[_0xa757('0x11')]['message']);return _0x447344(_0x5aef8a['error'][_0xa757('0x12')]);}logger['error']('VtigerAccount,\x20%s,\x20%s',_0x53be0e,_0x5aef8a[_0xa757('0x11')][_0xa757('0x12')]);return _0x2f7793(_0x5aef8a[_0xa757('0x11')][_0xa757('0x12')]);}else{logger[_0xa757('0xb')](_0xa757('0xc'),_0x53be0e,_0xa757('0xd'));_0x2f7793(_0x5aef8a[_0xa757('0x13')][_0xa757('0x12')]);}})[_0xa757('0x14')](function(_0x50aac1){logger[_0xa757('0x11')](_0xa757('0xc'),_0x53be0e,_0x50aac1);_0x447344(_0x50aac1);});});}exports[_0xa757('0x15')]=function(_0x4d9f58){var _0x54b305=this;return new Promise(function(_0x151c04,_0x468d45){return db[_0xa757('0x16')][_0xa757('0x17')]({'raw':_0x4d9f58[_0xa757('0x18')]?_0x4d9f58[_0xa757('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x4d9f58[_0xa757('0x18')]?_0x4d9f58['options'][_0xa757('0x19')]||null:null,'attributes':_0x4d9f58[_0xa757('0x18')]?_0x4d9f58[_0xa757('0x18')][_0xa757('0x1a')]||null:null,'limit':_0x4d9f58['options']?_0x4d9f58['options'][_0xa757('0x1b')]||null:null,'include':_0x4d9f58[_0xa757('0x18')]?_0x4d9f58[_0xa757('0x18')][_0xa757('0x1c')]?_[_0xa757('0x1d')](_0x4d9f58[_0xa757('0x18')][_0xa757('0x1c')],function(_0x21f1af){return{'model':db[_0x21f1af[_0xa757('0x1e')]],'as':_0x21f1af['as'],'attributes':_0x21f1af['attributes'],'include':_0x21f1af[_0xa757('0x1c')]?_['map'](_0x21f1af[_0xa757('0x1c')],function(_0x47903b){return{'model':db[_0x47903b[_0xa757('0x1e')]],'as':_0x47903b['as'],'attributes':_0x47903b[_0xa757('0x1a')],'include':_0x47903b[_0xa757('0x1c')]?_['map'](_0x47903b[_0xa757('0x1c')],function(_0xcd98bd){return{'model':db[_0xcd98bd[_0xa757('0x1e')]],'as':_0xcd98bd['as'],'attributes':_0xcd98bd[_0xa757('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x449a7d){logger['info']('GetVtigerAccount',_0x4d9f58);logger['debug']('GetVtigerAccount',_0x4d9f58,JSON[_0xa757('0x10')](_0x449a7d));_0x151c04(_0x449a7d);})['catch'](function(_0x2208f9){logger[_0xa757('0x11')]('GetVtigerAccount',_0x2208f9[_0xa757('0x12')],_0x4d9f58);_0x468d45(_0x54b305['error'](0x1f4,_0x2208f9[_0xa757('0x12')]));});});};exports[_0xa757('0x1f')]=function(_0x5307c3){var _0x235e54=this;return new Promise(function(_0x5ade7b,_0x3a4a66){return db[_0xa757('0x16')][_0xa757('0x20')]({'raw':_0x5307c3[_0xa757('0x18')]?_0x5307c3[_0xa757('0x18')][_0xa757('0x21')]===undefined?!![]:![]:!![],'where':_0x5307c3[_0xa757('0x18')]?_0x5307c3[_0xa757('0x18')][_0xa757('0x19')]||null:null,'attributes':_0x5307c3[_0xa757('0x18')]?_0x5307c3[_0xa757('0x18')][_0xa757('0x1a')]||null:null,'include':_0x5307c3[_0xa757('0x18')]?_0x5307c3[_0xa757('0x18')][_0xa757('0x1c')]?_[_0xa757('0x1d')](_0x5307c3[_0xa757('0x18')][_0xa757('0x1c')],function(_0x1eacde){return{'model':db[_0x1eacde[_0xa757('0x1e')]],'as':_0x1eacde['as'],'attributes':_0x1eacde[_0xa757('0x1a')],'include':_0x1eacde[_0xa757('0x1c')]?_[_0xa757('0x1d')](_0x1eacde[_0xa757('0x1c')],function(_0x59700d){return{'model':db[_0x59700d[_0xa757('0x1e')]],'as':_0x59700d['as'],'attributes':_0x59700d[_0xa757('0x1a')],'include':_0x59700d[_0xa757('0x1c')]?_[_0xa757('0x1d')](_0x59700d[_0xa757('0x1c')],function(_0x51e2aa){return{'model':db[_0x51e2aa[_0xa757('0x1e')]],'as':_0x51e2aa['as'],'attributes':_0x51e2aa[_0xa757('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xa757('0xa')](function(_0x2c34b1){logger[_0xa757('0xb')](_0xa757('0x1f'),_0x5307c3);logger['debug'](_0xa757('0x1f'),_0x5307c3,JSON[_0xa757('0x10')](_0x2c34b1));_0x5ade7b(_0x2c34b1);})[_0xa757('0x14')](function(_0xc34409){logger[_0xa757('0x11')](_0xa757('0x1f'),_0xc34409[_0xa757('0x12')],_0x5307c3);_0x3a4a66(_0x235e54[_0xa757('0x11')](0x1f4,_0xc34409[_0xa757('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 13f6d68..0638531 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 _0x044a=['Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','/:id','update','destroy','exports','util','express'];(function(_0x308493,_0x421ed6){var _0xcffb56=function(_0x643989){while(--_0x643989){_0x308493['push'](_0x308493['shift']());}};_0xcffb56(++_0x421ed6);}(_0x044a,0x82));var _0xa044=function(_0x58f711,_0x12b09e){_0x58f711=_0x58f711-0x0;var _0x2ec037=_0x044a[_0x58f711];return _0x2ec037;};'use strict';var multer=require('multer');var util=require(_0xa044('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa044('0x1'));var router=express[_0xa044('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xa044('0x3'));var interaction=require(_0xa044('0x4'));var config=require('../../config/environment');var controller=require('./intVtigerConfiguration.controller');router[_0xa044('0x5')]('/',auth[_0xa044('0x6')](),controller[_0xa044('0x7')]);router[_0xa044('0x5')]('/:id',auth[_0xa044('0x6')](),controller[_0xa044('0x8')]);router['get'](_0xa044('0x9'),auth['isAuthenticated'](),controller[_0xa044('0xa')]);router[_0xa044('0x5')](_0xa044('0xb'),auth[_0xa044('0x6')](),controller[_0xa044('0xc')]);router['get'](_0xa044('0xd'),auth[_0xa044('0x6')](),controller[_0xa044('0xe')]);router[_0xa044('0xf')]('/',auth['isAuthenticated'](),controller[_0xa044('0x10')]);router[_0xa044('0x11')](_0xa044('0x12'),auth[_0xa044('0x6')](),controller[_0xa044('0x13')]);router['delete'](_0xa044('0x12'),auth[_0xa044('0x6')](),controller[_0xa044('0x14')]);module[_0xa044('0x15')]=router; \ No newline at end of file +var _0x0656=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','create','update','delete','destroy','exports'];(function(_0x258b93,_0x188ccc){var _0x35484b=function(_0x2563ea){while(--_0x2563ea){_0x258b93['push'](_0x258b93['shift']());}};_0x35484b(++_0x188ccc);}(_0x0656,0x12c));var _0x6065=function(_0x11d459,_0x43eeea){_0x11d459=_0x11d459-0x0;var _0x21203c=_0x0656[_0x11d459];return _0x21203c;};'use strict';var multer=require(_0x6065('0x0'));var util=require('util');var path=require(_0x6065('0x1'));var timeout=require(_0x6065('0x2'));var express=require(_0x6065('0x3'));var router=express[_0x6065('0x4')]();var fs_extra=require(_0x6065('0x5'));var auth=require(_0x6065('0x6'));var interaction=require(_0x6065('0x7'));var config=require(_0x6065('0x8'));var controller=require(_0x6065('0x9'));router[_0x6065('0xa')]('/',auth[_0x6065('0xb')](),controller[_0x6065('0xc')]);router['get'](_0x6065('0xd'),auth[_0x6065('0xb')](),controller[_0x6065('0xe')]);router[_0x6065('0xa')](_0x6065('0xf'),auth[_0x6065('0xb')](),controller[_0x6065('0x10')]);router[_0x6065('0xa')]('/:id/subjects',auth[_0x6065('0xb')](),controller[_0x6065('0x11')]);router[_0x6065('0xa')](_0x6065('0x12'),auth['isAuthenticated'](),controller[_0x6065('0x13')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6065('0x14')]);router['put'](_0x6065('0xd'),auth['isAuthenticated'](),controller[_0x6065('0x15')]);router[_0x6065('0x16')](_0x6065('0xd'),auth[_0x6065('0xb')](),controller[_0x6065('0x17')]);module[_0x6065('0x18')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index c16ee0b..e656c60 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 _0x4b5c=['STRING','sequelize','exports'];(function(_0x185c8b,_0x4dd54a){var _0x5b4777=function(_0x295fbd){while(--_0x295fbd){_0x185c8b['push'](_0x185c8b['shift']());}};_0x5b4777(++_0x4dd54a);}(_0x4b5c,0x1cc));var _0xc4b5=function(_0x2a2d1f,_0x478e4b){_0x2a2d1f=_0x2a2d1f-0x0;var _0x57d7eb=_0x4b5c[_0x2a2d1f];return _0x57d7eb;};'use strict';var Sequelize=require(_0xc4b5('0x0'));module[_0xc4b5('0x1')]={'name':{'type':Sequelize[_0xc4b5('0x2')]},'description':{'type':Sequelize[_0xc4b5('0x2')]}}; \ No newline at end of file +var _0xddfd=['exports','STRING'];(function(_0xedb496,_0x538bd3){var _0x3f0949=function(_0x3bbafa){while(--_0x3bbafa){_0xedb496['push'](_0xedb496['shift']());}};_0x3f0949(++_0x538bd3);}(_0xddfd,0xee));var _0xdddf=function(_0x56504c,_0x1527a0){_0x56504c=_0x56504c-0x0;var _0x87bf25=_0xddfd[_0x56504c];return _0x87bf25;};'use strict';var Sequelize=require('sequelize');module[_0xdddf('0x0')]={'name':{'type':Sequelize[_0xdddf('0x1')]},'description':{'type':Sequelize[_0xdddf('0x1')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 2701e61..de5c4c7 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 _0x8f12=['name','send','index','map','VtigerConfiguration','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','length','hasOwnProperty','nolimit','offset','order','sort','pick','filter','where','merge','VIRTUAL','include','findAll','rows','catch','params','fields','find','create','body','findOne','VtigerField','getFields','getSubjects','getDescriptions','options','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','end','error'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x8f12,0x122));var _0x28f1=function(_0xd281e2,_0x5b9fc4){_0xd281e2=_0xd281e2-0x0;var _0xfbc4e1=_0x8f12[_0xd281e2];return _0xfbc4e1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x28f1('0x0'));var zipdir=require(_0x28f1('0x1'));var jsonpatch=require(_0x28f1('0x2'));var rp=require(_0x28f1('0x3'));var moment=require(_0x28f1('0x4'));var BPromise=require(_0x28f1('0x5'));var Mustache=require(_0x28f1('0x6'));var util=require(_0x28f1('0x7'));var path=require('path');var sox=require(_0x28f1('0x8'));var csv=require(_0x28f1('0x9'));var ejs=require(_0x28f1('0xa'));var fs=require('fs');var fs_extra=require(_0x28f1('0xb'));var _=require(_0x28f1('0xc'));var squel=require(_0x28f1('0xd'));var crypto=require(_0x28f1('0xe'));var jsforce=require(_0x28f1('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x28f1('0x9'));var querystring=require(_0x28f1('0x10'));var Papa=require(_0x28f1('0x11'));var Redis=require(_0x28f1('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x28f1('0x13'));var as=require(_0x28f1('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x28f1('0x15'))(_0x28f1('0x16'));var utils=require(_0x28f1('0x17'));var config=require(_0x28f1('0x18'));var licenseUtil=require(_0x28f1('0x19'));var db=require(_0x28f1('0x1a'))['db'];function respondWithStatusCode(_0x5b1803,_0x1cdc05){_0x1cdc05=_0x1cdc05||0xcc;return function(_0x53120f){if(_0x53120f){return _0x5b1803[_0x28f1('0x1b')](_0x1cdc05);}return _0x5b1803[_0x28f1('0x1c')](_0x1cdc05)['end']();};}function respondWithResult(_0x288e95,_0x2ef17f){_0x2ef17f=_0x2ef17f||0xc8;return function(_0x3760b3){if(_0x3760b3){return _0x288e95[_0x28f1('0x1c')](_0x2ef17f)[_0x28f1('0x1d')](_0x3760b3);}};}function respondWithFilteredResult(_0x259031,_0x4c8432){return function(_0x51bff4){if(_0x51bff4){var _0x28603f=typeof _0x4c8432['offset']===_0x28f1('0x1e')&&typeof _0x4c8432[_0x28f1('0x1f')]===_0x28f1('0x1e');var _0x431b62=_0x51bff4[_0x28f1('0x20')];var _0x4d2414=_0x28603f?0x0:_0x4c8432['offset'];var _0x235ae0=_0x28603f?_0x51bff4[_0x28f1('0x20')]:_0x4c8432['offset']+_0x4c8432[_0x28f1('0x1f')];var _0x390667;if(_0x235ae0>=_0x431b62){_0x235ae0=_0x431b62;_0x390667=0xc8;}else{_0x390667=0xce;}_0x259031[_0x28f1('0x1c')](_0x390667);return _0x259031[_0x28f1('0x21')](_0x28f1('0x22'),_0x4d2414+'-'+_0x235ae0+'/'+_0x431b62)[_0x28f1('0x1d')](_0x51bff4);}return null;};}function patchUpdates(_0x178c5d){return function(_0x5e8785){try{jsonpatch[_0x28f1('0x23')](_0x5e8785,_0x178c5d,!![]);}catch(_0x209a2d){return BPromise['reject'](_0x209a2d);}return _0x5e8785[_0x28f1('0x24')]();};}function saveUpdates(_0x407e3c,_0x35f1fb){return function(_0x58de7e){if(_0x58de7e){return _0x58de7e[_0x28f1('0x25')](_0x407e3c)[_0x28f1('0x26')](function(_0x4e3ca1){return _0x4e3ca1;});}return null;};}function removeEntity(_0x3cf594,_0x3e1762){return function(_0x1d5fc2){if(_0x1d5fc2){return _0x1d5fc2[_0x28f1('0x27')]()[_0x28f1('0x26')](function(){_0x3cf594[_0x28f1('0x1c')](0xcc)[_0x28f1('0x28')]();});}};}function handleEntityNotFound(_0x822756,_0x57301a){return function(_0x2de57b){if(!_0x2de57b){_0x822756[_0x28f1('0x1b')](0x194);}return _0x2de57b;};}function handleError(_0x29365e,_0x2b260a){_0x2b260a=_0x2b260a||0x1f4;return function(_0x11b7bc){logger[_0x28f1('0x29')](_0x11b7bc['stack']);if(_0x11b7bc[_0x28f1('0x2a')]){delete _0x11b7bc[_0x28f1('0x2a')];}_0x29365e[_0x28f1('0x1c')](_0x2b260a)[_0x28f1('0x2b')](_0x11b7bc);};}exports[_0x28f1('0x2c')]=function(_0x49e575,_0xa58b88){var _0x22542c={},_0x905327={},_0x599b9c={'count':0x0,'rows':[]};var _0x323c0c=_[_0x28f1('0x2d')](db[_0x28f1('0x2e')][_0x28f1('0x2f')],function(_0x551d4e){return{'name':_0x551d4e[_0x28f1('0x30')],'type':_0x551d4e[_0x28f1('0x31')][_0x28f1('0x32')]};});_0x905327[_0x28f1('0x33')]=_[_0x28f1('0x2d')](_0x323c0c,_0x28f1('0x2a'));_0x905327['query']=_[_0x28f1('0x34')](_0x49e575['query']);_0x905327[_0x28f1('0x35')]=_[_0x28f1('0x36')](_0x905327[_0x28f1('0x33')],_0x905327[_0x28f1('0x37')]);_0x22542c[_0x28f1('0x38')]=_[_0x28f1('0x36')](_0x905327[_0x28f1('0x33')],qs['fields'](_0x49e575['query']['fields']));_0x22542c[_0x28f1('0x38')]=_0x22542c[_0x28f1('0x38')][_0x28f1('0x39')]?_0x22542c[_0x28f1('0x38')]:_0x905327['model'];if(!_0x49e575[_0x28f1('0x37')][_0x28f1('0x3a')](_0x28f1('0x3b'))){_0x22542c[_0x28f1('0x1f')]=qs[_0x28f1('0x1f')](_0x49e575['query'][_0x28f1('0x1f')]);_0x22542c[_0x28f1('0x3c')]=qs[_0x28f1('0x3c')](_0x49e575['query'][_0x28f1('0x3c')]);}_0x22542c[_0x28f1('0x3d')]=qs[_0x28f1('0x3e')](_0x49e575[_0x28f1('0x37')][_0x28f1('0x3e')]);_0x22542c['where']=qs[_0x28f1('0x35')](_[_0x28f1('0x3f')](_0x49e575[_0x28f1('0x37')],_0x905327[_0x28f1('0x35')]),_0x323c0c);if(_0x49e575[_0x28f1('0x37')][_0x28f1('0x40')]){_0x22542c[_0x28f1('0x41')]=_[_0x28f1('0x42')](_0x22542c[_0x28f1('0x41')],{'$or':_[_0x28f1('0x2d')](_0x323c0c,function(_0x4c6448){if(_0x4c6448[_0x28f1('0x31')]!==_0x28f1('0x43')){var _0x189ac6={};_0x189ac6[_0x4c6448[_0x28f1('0x2a')]]={'$like':'%'+_0x49e575['query']['filter']+'%'};return _0x189ac6;}})});}_0x22542c=_[_0x28f1('0x42')]({},_0x22542c,_0x49e575['options']);var _0x236df0={'where':_0x22542c[_0x28f1('0x41')]};return db['VtigerConfiguration']['count'](_0x236df0)[_0x28f1('0x26')](function(_0x260d5c){_0x599b9c[_0x28f1('0x20')]=_0x260d5c;if(_0x49e575[_0x28f1('0x37')]['includeAll']){_0x22542c[_0x28f1('0x44')]=[{'all':!![]}];}return db[_0x28f1('0x2e')][_0x28f1('0x45')](_0x22542c);})['then'](function(_0x47267a){_0x599b9c[_0x28f1('0x46')]=_0x47267a;return _0x599b9c;})['then'](respondWithFilteredResult(_0xa58b88,_0x22542c))[_0x28f1('0x47')](handleError(_0xa58b88,null));};exports['show']=function(_0x593794,_0x1dd18b){var _0x142445={'raw':![],'where':{'id':_0x593794[_0x28f1('0x48')]['id']}},_0x36493b={};_0x36493b['model']=_[_0x28f1('0x34')](db[_0x28f1('0x2e')]['rawAttributes']);_0x36493b['query']=_[_0x28f1('0x34')](_0x593794[_0x28f1('0x37')]);_0x36493b[_0x28f1('0x35')]=_['intersection'](_0x36493b['model'],_0x36493b[_0x28f1('0x37')]);_0x142445['attributes']=_[_0x28f1('0x36')](_0x36493b[_0x28f1('0x33')],qs[_0x28f1('0x49')](_0x593794['query']['fields']));_0x142445['attributes']=_0x142445[_0x28f1('0x38')][_0x28f1('0x39')]?_0x142445[_0x28f1('0x38')]:_0x36493b[_0x28f1('0x33')];if(_0x593794['query']['includeAll']){_0x142445[_0x28f1('0x44')]=[{'all':!![]}];}_0x142445=_[_0x28f1('0x42')]({},_0x142445,_0x593794['options']);return db[_0x28f1('0x2e')][_0x28f1('0x4a')](_0x142445)[_0x28f1('0x26')](handleEntityNotFound(_0x1dd18b,null))[_0x28f1('0x26')](respondWithResult(_0x1dd18b,null))[_0x28f1('0x47')](handleError(_0x1dd18b,null));};exports['create']=function(_0x5e8425,_0x3768d1){return db[_0x28f1('0x2e')][_0x28f1('0x4b')](_0x5e8425['body'],{})[_0x28f1('0x26')](respondWithResult(_0x3768d1,0xc9))['catch'](handleError(_0x3768d1,null));};exports['update']=function(_0x32d3a9,_0x47dfb4){if(_0x32d3a9[_0x28f1('0x4c')]['id']){delete _0x32d3a9[_0x28f1('0x4c')]['id'];}return db['VtigerConfiguration'][_0x28f1('0x4a')]({'where':{'id':_0x32d3a9['params']['id']}})[_0x28f1('0x26')](handleEntityNotFound(_0x47dfb4,null))[_0x28f1('0x26')](saveUpdates(_0x32d3a9[_0x28f1('0x4c')],null))['then'](respondWithResult(_0x47dfb4,null))[_0x28f1('0x47')](handleError(_0x47dfb4,null));};exports[_0x28f1('0x27')]=function(_0x518f4d,_0x42b2b8){return db['VtigerConfiguration'][_0x28f1('0x4a')]({'where':{'id':_0x518f4d[_0x28f1('0x48')]['id']}})[_0x28f1('0x26')](handleEntityNotFound(_0x42b2b8,null))[_0x28f1('0x26')](removeEntity(_0x42b2b8,null))[_0x28f1('0x47')](handleError(_0x42b2b8,null));};exports['getFields']=function(_0x815c49,_0x217f37,_0x31e993){var _0x4a6873={};var _0x1c566e={};var _0x529e91;var _0x13cc2c;return db['VtigerConfiguration'][_0x28f1('0x4d')]({'where':{'id':_0x815c49[_0x28f1('0x48')]['id']}})[_0x28f1('0x26')](handleEntityNotFound(_0x217f37,null))['then'](function(_0x35a66f){if(_0x35a66f){_0x529e91=_0x35a66f;_0x1c566e[_0x28f1('0x33')]=_[_0x28f1('0x34')](db[_0x28f1('0x4e')][_0x28f1('0x2f')]);_0x1c566e[_0x28f1('0x37')]=_[_0x28f1('0x34')](_0x815c49[_0x28f1('0x37')]);_0x1c566e[_0x28f1('0x35')]=_[_0x28f1('0x36')](_0x1c566e['model'],_0x1c566e['query']);_0x4a6873[_0x28f1('0x38')]=_[_0x28f1('0x36')](_0x1c566e[_0x28f1('0x33')],qs[_0x28f1('0x49')](_0x815c49['query']['fields']));_0x4a6873['attributes']=_0x4a6873[_0x28f1('0x38')][_0x28f1('0x39')]?_0x4a6873[_0x28f1('0x38')]:_0x1c566e['model'];_0x4a6873[_0x28f1('0x3d')]=qs[_0x28f1('0x3e')](_0x815c49[_0x28f1('0x37')][_0x28f1('0x3e')]);_0x4a6873[_0x28f1('0x41')]=qs[_0x28f1('0x35')](_[_0x28f1('0x3f')](_0x815c49[_0x28f1('0x37')],_0x1c566e[_0x28f1('0x35')]));if(_0x815c49[_0x28f1('0x37')][_0x28f1('0x40')]){_0x4a6873[_0x28f1('0x41')]=_[_0x28f1('0x42')](_0x4a6873['where'],{'$or':_[_0x28f1('0x2d')](_0x4a6873[_0x28f1('0x38')],function(_0x524ed1){var _0x2c681e={};_0x2c681e[_0x524ed1]={'$like':'%'+_0x815c49[_0x28f1('0x37')]['filter']+'%'};return _0x2c681e;})});}_0x4a6873=_[_0x28f1('0x42')]({},_0x4a6873,_0x815c49['options']);return _0x529e91[_0x28f1('0x4f')](_0x4a6873);}})[_0x28f1('0x26')](function(_0x5c1812){if(_0x5c1812){_0x13cc2c=_0x5c1812[_0x28f1('0x39')];if(!_0x815c49[_0x28f1('0x37')][_0x28f1('0x3a')](_0x28f1('0x3b'))){_0x4a6873[_0x28f1('0x1f')]=qs[_0x28f1('0x1f')](_0x815c49[_0x28f1('0x37')][_0x28f1('0x1f')]);_0x4a6873[_0x28f1('0x3c')]=qs[_0x28f1('0x3c')](_0x815c49[_0x28f1('0x37')][_0x28f1('0x3c')]);}return _0x529e91['getFields'](_0x4a6873);}})[_0x28f1('0x26')](function(_0x52f875){if(_0x52f875){return _0x52f875?{'count':_0x13cc2c,'rows':_0x52f875}:null;}})[_0x28f1('0x26')](respondWithResult(_0x217f37,null))['catch'](handleError(_0x217f37,null));};exports['getSubjects']=function(_0x35ad47,_0xbf1e7f,_0xa6ce6f){var _0x5802b7={};var _0x24d24e={};var _0x22b068;var _0x2b57f5;return db[_0x28f1('0x2e')][_0x28f1('0x4d')]({'where':{'id':_0x35ad47[_0x28f1('0x48')]['id']}})[_0x28f1('0x26')](handleEntityNotFound(_0xbf1e7f,null))[_0x28f1('0x26')](function(_0x464e76){if(_0x464e76){_0x22b068=_0x464e76;_0x24d24e[_0x28f1('0x33')]=_[_0x28f1('0x34')](db[_0x28f1('0x4e')][_0x28f1('0x2f')]);_0x24d24e[_0x28f1('0x37')]=_['keys'](_0x35ad47[_0x28f1('0x37')]);_0x24d24e[_0x28f1('0x35')]=_['intersection'](_0x24d24e[_0x28f1('0x33')],_0x24d24e[_0x28f1('0x37')]);_0x5802b7[_0x28f1('0x38')]=_[_0x28f1('0x36')](_0x24d24e[_0x28f1('0x33')],qs[_0x28f1('0x49')](_0x35ad47['query'][_0x28f1('0x49')]));_0x5802b7[_0x28f1('0x38')]=_0x5802b7['attributes'][_0x28f1('0x39')]?_0x5802b7['attributes']:_0x24d24e['model'];_0x5802b7[_0x28f1('0x3d')]=qs['sort'](_0x35ad47[_0x28f1('0x37')][_0x28f1('0x3e')]);_0x5802b7[_0x28f1('0x41')]=qs[_0x28f1('0x35')](_[_0x28f1('0x3f')](_0x35ad47[_0x28f1('0x37')],_0x24d24e[_0x28f1('0x35')]));if(_0x35ad47[_0x28f1('0x37')]['filter']){_0x5802b7[_0x28f1('0x41')]=_['merge'](_0x5802b7[_0x28f1('0x41')],{'$or':_[_0x28f1('0x2d')](_0x5802b7[_0x28f1('0x38')],function(_0xe89a0e){var _0x2c8822={};_0x2c8822[_0xe89a0e]={'$like':'%'+_0x35ad47[_0x28f1('0x37')][_0x28f1('0x40')]+'%'};return _0x2c8822;})});}_0x5802b7=_[_0x28f1('0x42')]({},_0x5802b7,_0x35ad47['options']);return _0x22b068[_0x28f1('0x50')](_0x5802b7);}})[_0x28f1('0x26')](function(_0xff9782){if(_0xff9782){_0x2b57f5=_0xff9782[_0x28f1('0x39')];if(!_0x35ad47[_0x28f1('0x37')][_0x28f1('0x3a')](_0x28f1('0x3b'))){_0x5802b7[_0x28f1('0x1f')]=qs[_0x28f1('0x1f')](_0x35ad47[_0x28f1('0x37')][_0x28f1('0x1f')]);_0x5802b7[_0x28f1('0x3c')]=qs['offset'](_0x35ad47[_0x28f1('0x37')][_0x28f1('0x3c')]);}return _0x22b068[_0x28f1('0x50')](_0x5802b7);}})['then'](function(_0x2c0d56){if(_0x2c0d56){return _0x2c0d56?{'count':_0x2b57f5,'rows':_0x2c0d56}:null;}})[_0x28f1('0x26')](respondWithResult(_0xbf1e7f,null))[_0x28f1('0x47')](handleError(_0xbf1e7f,null));};exports[_0x28f1('0x51')]=function(_0x3b5595,_0xe8b5e2,_0x297b5d){var _0x148c40={};var _0x56f5c8={};var _0x555831;var _0x1c52c6;return db['VtigerConfiguration'][_0x28f1('0x4d')]({'where':{'id':_0x3b5595[_0x28f1('0x48')]['id']}})[_0x28f1('0x26')](handleEntityNotFound(_0xe8b5e2,null))['then'](function(_0x3f9fc0){if(_0x3f9fc0){_0x555831=_0x3f9fc0;_0x56f5c8[_0x28f1('0x33')]=_['keys'](db[_0x28f1('0x4e')][_0x28f1('0x2f')]);_0x56f5c8[_0x28f1('0x37')]=_[_0x28f1('0x34')](_0x3b5595[_0x28f1('0x37')]);_0x56f5c8['filters']=_[_0x28f1('0x36')](_0x56f5c8[_0x28f1('0x33')],_0x56f5c8[_0x28f1('0x37')]);_0x148c40[_0x28f1('0x38')]=_['intersection'](_0x56f5c8['model'],qs['fields'](_0x3b5595[_0x28f1('0x37')][_0x28f1('0x49')]));_0x148c40[_0x28f1('0x38')]=_0x148c40[_0x28f1('0x38')][_0x28f1('0x39')]?_0x148c40['attributes']:_0x56f5c8[_0x28f1('0x33')];_0x148c40['order']=qs[_0x28f1('0x3e')](_0x3b5595[_0x28f1('0x37')][_0x28f1('0x3e')]);_0x148c40[_0x28f1('0x41')]=qs[_0x28f1('0x35')](_[_0x28f1('0x3f')](_0x3b5595['query'],_0x56f5c8[_0x28f1('0x35')]));if(_0x3b5595[_0x28f1('0x37')][_0x28f1('0x40')]){_0x148c40[_0x28f1('0x41')]=_[_0x28f1('0x42')](_0x148c40['where'],{'$or':_[_0x28f1('0x2d')](_0x148c40['attributes'],function(_0x2b41e6){var _0x2bf6dc={};_0x2bf6dc[_0x2b41e6]={'$like':'%'+_0x3b5595[_0x28f1('0x37')][_0x28f1('0x40')]+'%'};return _0x2bf6dc;})});}_0x148c40=_[_0x28f1('0x42')]({},_0x148c40,_0x3b5595[_0x28f1('0x52')]);return _0x555831[_0x28f1('0x51')](_0x148c40);}})[_0x28f1('0x26')](function(_0x201e54){if(_0x201e54){_0x1c52c6=_0x201e54[_0x28f1('0x39')];if(!_0x3b5595[_0x28f1('0x37')][_0x28f1('0x3a')](_0x28f1('0x3b'))){_0x148c40[_0x28f1('0x1f')]=qs['limit'](_0x3b5595['query'][_0x28f1('0x1f')]);_0x148c40['offset']=qs[_0x28f1('0x3c')](_0x3b5595[_0x28f1('0x37')]['offset']);}return _0x555831[_0x28f1('0x51')](_0x148c40);}})[_0x28f1('0x26')](function(_0x58590c){if(_0x58590c){return _0x58590c?{'count':_0x1c52c6,'rows':_0x58590c}:null;}})[_0x28f1('0x26')](respondWithResult(_0xe8b5e2,null))[_0x28f1('0x47')](handleError(_0xe8b5e2,null));}; \ No newline at end of file +var _0x5ad0=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','rawAttributes','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','sort','where','filters','pick','filter','merge','map','options','VtigerConfiguration','includeAll','include','findAll','rows','show','params','fields','find','create','body','catch','getFields','findOne','order','nolimit','VtigerField','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch'];(function(_0x370cb2,_0x84cc77){var _0xcfe3d9=function(_0x118a5e){while(--_0x118a5e){_0x370cb2['push'](_0x370cb2['shift']());}};_0xcfe3d9(++_0x84cc77);}(_0x5ad0,0x137));var _0x05ad=function(_0x369633,_0x263fb9){_0x369633=_0x369633-0x0;var _0x1eda8c=_0x5ad0[_0x369633];return _0x1eda8c;};'use strict';var emlformat=require(_0x05ad('0x0'));var rimraf=require(_0x05ad('0x1'));var zipdir=require(_0x05ad('0x2'));var jsonpatch=require(_0x05ad('0x3'));var rp=require(_0x05ad('0x4'));var moment=require(_0x05ad('0x5'));var BPromise=require(_0x05ad('0x6'));var Mustache=require(_0x05ad('0x7'));var util=require(_0x05ad('0x8'));var path=require(_0x05ad('0x9'));var sox=require(_0x05ad('0xa'));var csv=require(_0x05ad('0xb'));var ejs=require(_0x05ad('0xc'));var fs=require('fs');var fs_extra=require(_0x05ad('0xd'));var _=require(_0x05ad('0xe'));var squel=require('squel');var crypto=require(_0x05ad('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x05ad('0xb'));var querystring=require(_0x05ad('0x10'));var Papa=require(_0x05ad('0x11'));var Redis=require(_0x05ad('0x12'));var authService=require(_0x05ad('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x05ad('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x05ad('0x15'));var utils=require(_0x05ad('0x16'));var config=require(_0x05ad('0x17'));var licenseUtil=require(_0x05ad('0x18'));var db=require(_0x05ad('0x19'))['db'];function respondWithStatusCode(_0x118a7d,_0x3b8e8b){_0x3b8e8b=_0x3b8e8b||0xcc;return function(_0x1c03c7){if(_0x1c03c7){return _0x118a7d[_0x05ad('0x1a')](_0x3b8e8b);}return _0x118a7d[_0x05ad('0x1b')](_0x3b8e8b)[_0x05ad('0x1c')]();};}function respondWithResult(_0x8e4c4a,_0x3a6338){_0x3a6338=_0x3a6338||0xc8;return function(_0x5eea4f){if(_0x5eea4f){return _0x8e4c4a['status'](_0x3a6338)[_0x05ad('0x1d')](_0x5eea4f);}};}function respondWithFilteredResult(_0x1e80be,_0x58f89e){return function(_0xcccd88){if(_0xcccd88){var _0x4054d8=typeof _0x58f89e['offset']===_0x05ad('0x1e')&&typeof _0x58f89e[_0x05ad('0x1f')]==='undefined';var _0x2a04d7=_0xcccd88[_0x05ad('0x20')];var _0x1b39c4=_0x4054d8?0x0:_0x58f89e[_0x05ad('0x21')];var _0x5a8686=_0x4054d8?_0xcccd88['count']:_0x58f89e[_0x05ad('0x21')]+_0x58f89e['limit'];var _0x7a51d8;if(_0x5a8686>=_0x2a04d7){_0x5a8686=_0x2a04d7;_0x7a51d8=0xc8;}else{_0x7a51d8=0xce;}_0x1e80be[_0x05ad('0x1b')](_0x7a51d8);return _0x1e80be[_0x05ad('0x22')](_0x05ad('0x23'),_0x1b39c4+'-'+_0x5a8686+'/'+_0x2a04d7)['json'](_0xcccd88);}return null;};}function patchUpdates(_0x23e69e){return function(_0x3c12b4){try{jsonpatch['apply'](_0x3c12b4,_0x23e69e,!![]);}catch(_0x1fbe97){return BPromise[_0x05ad('0x24')](_0x1fbe97);}return _0x3c12b4[_0x05ad('0x25')]();};}function saveUpdates(_0x12218c,_0x6ea257){return function(_0x5d3025){if(_0x5d3025){return _0x5d3025[_0x05ad('0x26')](_0x12218c)[_0x05ad('0x27')](function(_0x42974c){return _0x42974c;});}return null;};}function removeEntity(_0x5e9c64,_0x281b73){return function(_0x2af25b){if(_0x2af25b){return _0x2af25b[_0x05ad('0x28')]()[_0x05ad('0x27')](function(){_0x5e9c64[_0x05ad('0x1b')](0xcc)[_0x05ad('0x1c')]();});}};}function handleEntityNotFound(_0x1a30ed,_0x7fbe89){return function(_0x1c26e3){if(!_0x1c26e3){_0x1a30ed[_0x05ad('0x1a')](0x194);}return _0x1c26e3;};}function handleError(_0x5b9c89,_0x4616bd){_0x4616bd=_0x4616bd||0x1f4;return function(_0x71a83b){logger[_0x05ad('0x29')](_0x71a83b[_0x05ad('0x2a')]);if(_0x71a83b[_0x05ad('0x2b')]){delete _0x71a83b[_0x05ad('0x2b')];}_0x5b9c89[_0x05ad('0x1b')](_0x4616bd)[_0x05ad('0x2c')](_0x71a83b);};}exports[_0x05ad('0x2d')]=function(_0x276808,_0x580703){var _0x360c1b={},_0x2150e2={},_0x20b4c7={'count':0x0,'rows':[]};var _0x59f216=_['map'](db['VtigerConfiguration'][_0x05ad('0x2e')],function(_0x168906){return{'name':_0x168906['fieldName'],'type':_0x168906[_0x05ad('0x2f')][_0x05ad('0x30')]};});_0x2150e2[_0x05ad('0x31')]=_['map'](_0x59f216,_0x05ad('0x2b'));_0x2150e2[_0x05ad('0x32')]=_[_0x05ad('0x33')](_0x276808[_0x05ad('0x32')]);_0x2150e2['filters']=_['intersection'](_0x2150e2[_0x05ad('0x31')],_0x2150e2[_0x05ad('0x32')]);_0x360c1b['attributes']=_[_0x05ad('0x34')](_0x2150e2[_0x05ad('0x31')],qs['fields'](_0x276808[_0x05ad('0x32')]['fields']));_0x360c1b[_0x05ad('0x35')]=_0x360c1b['attributes'][_0x05ad('0x36')]?_0x360c1b[_0x05ad('0x35')]:_0x2150e2[_0x05ad('0x31')];if(!_0x276808[_0x05ad('0x32')][_0x05ad('0x37')]('nolimit')){_0x360c1b['limit']=qs['limit'](_0x276808[_0x05ad('0x32')][_0x05ad('0x1f')]);_0x360c1b[_0x05ad('0x21')]=qs[_0x05ad('0x21')](_0x276808[_0x05ad('0x32')]['offset']);}_0x360c1b['order']=qs['sort'](_0x276808[_0x05ad('0x32')][_0x05ad('0x38')]);_0x360c1b[_0x05ad('0x39')]=qs[_0x05ad('0x3a')](_[_0x05ad('0x3b')](_0x276808[_0x05ad('0x32')],_0x2150e2['filters']),_0x59f216);if(_0x276808[_0x05ad('0x32')][_0x05ad('0x3c')]){_0x360c1b[_0x05ad('0x39')]=_[_0x05ad('0x3d')](_0x360c1b[_0x05ad('0x39')],{'$or':_[_0x05ad('0x3e')](_0x59f216,function(_0x5ad009){if(_0x5ad009[_0x05ad('0x2f')]!=='VIRTUAL'){var _0x2d8e8f={};_0x2d8e8f[_0x5ad009[_0x05ad('0x2b')]]={'$like':'%'+_0x276808[_0x05ad('0x32')][_0x05ad('0x3c')]+'%'};return _0x2d8e8f;}})});}_0x360c1b=_[_0x05ad('0x3d')]({},_0x360c1b,_0x276808[_0x05ad('0x3f')]);var _0x5c1cb8={'where':_0x360c1b[_0x05ad('0x39')]};return db[_0x05ad('0x40')][_0x05ad('0x20')](_0x5c1cb8)['then'](function(_0x2048f0){_0x20b4c7[_0x05ad('0x20')]=_0x2048f0;if(_0x276808[_0x05ad('0x32')][_0x05ad('0x41')]){_0x360c1b[_0x05ad('0x42')]=[{'all':!![]}];}return db[_0x05ad('0x40')][_0x05ad('0x43')](_0x360c1b);})[_0x05ad('0x27')](function(_0x27e56f){_0x20b4c7[_0x05ad('0x44')]=_0x27e56f;return _0x20b4c7;})[_0x05ad('0x27')](respondWithFilteredResult(_0x580703,_0x360c1b))['catch'](handleError(_0x580703,null));};exports[_0x05ad('0x45')]=function(_0x372982,_0x53560d){var _0x472bf7={'raw':![],'where':{'id':_0x372982[_0x05ad('0x46')]['id']}},_0x2fc305={};_0x2fc305[_0x05ad('0x31')]=_['keys'](db[_0x05ad('0x40')][_0x05ad('0x2e')]);_0x2fc305['query']=_[_0x05ad('0x33')](_0x372982['query']);_0x2fc305[_0x05ad('0x3a')]=_[_0x05ad('0x34')](_0x2fc305[_0x05ad('0x31')],_0x2fc305[_0x05ad('0x32')]);_0x472bf7[_0x05ad('0x35')]=_[_0x05ad('0x34')](_0x2fc305['model'],qs[_0x05ad('0x47')](_0x372982[_0x05ad('0x32')]['fields']));_0x472bf7[_0x05ad('0x35')]=_0x472bf7[_0x05ad('0x35')]['length']?_0x472bf7[_0x05ad('0x35')]:_0x2fc305[_0x05ad('0x31')];if(_0x372982[_0x05ad('0x32')][_0x05ad('0x41')]){_0x472bf7['include']=[{'all':!![]}];}_0x472bf7=_[_0x05ad('0x3d')]({},_0x472bf7,_0x372982[_0x05ad('0x3f')]);return db[_0x05ad('0x40')][_0x05ad('0x48')](_0x472bf7)[_0x05ad('0x27')](handleEntityNotFound(_0x53560d,null))[_0x05ad('0x27')](respondWithResult(_0x53560d,null))['catch'](handleError(_0x53560d,null));};exports[_0x05ad('0x49')]=function(_0x5d5b82,_0x327fac){return db[_0x05ad('0x40')][_0x05ad('0x49')](_0x5d5b82[_0x05ad('0x4a')],{})['then'](respondWithResult(_0x327fac,0xc9))[_0x05ad('0x4b')](handleError(_0x327fac,null));};exports[_0x05ad('0x26')]=function(_0x1e4b7e,_0xead31){if(_0x1e4b7e[_0x05ad('0x4a')]['id']){delete _0x1e4b7e[_0x05ad('0x4a')]['id'];}return db['VtigerConfiguration'][_0x05ad('0x48')]({'where':{'id':_0x1e4b7e[_0x05ad('0x46')]['id']}})['then'](handleEntityNotFound(_0xead31,null))[_0x05ad('0x27')](saveUpdates(_0x1e4b7e[_0x05ad('0x4a')],null))['then'](respondWithResult(_0xead31,null))[_0x05ad('0x4b')](handleError(_0xead31,null));};exports['destroy']=function(_0x265345,_0x1759ef){return db['VtigerConfiguration']['find']({'where':{'id':_0x265345[_0x05ad('0x46')]['id']}})['then'](handleEntityNotFound(_0x1759ef,null))[_0x05ad('0x27')](removeEntity(_0x1759ef,null))['catch'](handleError(_0x1759ef,null));};exports[_0x05ad('0x4c')]=function(_0x17bcef,_0x497007,_0x16555c){var _0x297263={};var _0x12f178={};var _0x1989de;var _0x812da6;return db[_0x05ad('0x40')][_0x05ad('0x4d')]({'where':{'id':_0x17bcef[_0x05ad('0x46')]['id']}})[_0x05ad('0x27')](handleEntityNotFound(_0x497007,null))[_0x05ad('0x27')](function(_0x339003){if(_0x339003){_0x1989de=_0x339003;_0x12f178[_0x05ad('0x31')]=_[_0x05ad('0x33')](db['VtigerField'][_0x05ad('0x2e')]);_0x12f178[_0x05ad('0x32')]=_[_0x05ad('0x33')](_0x17bcef['query']);_0x12f178[_0x05ad('0x3a')]=_[_0x05ad('0x34')](_0x12f178['model'],_0x12f178[_0x05ad('0x32')]);_0x297263[_0x05ad('0x35')]=_[_0x05ad('0x34')](_0x12f178[_0x05ad('0x31')],qs['fields'](_0x17bcef[_0x05ad('0x32')][_0x05ad('0x47')]));_0x297263['attributes']=_0x297263[_0x05ad('0x35')][_0x05ad('0x36')]?_0x297263['attributes']:_0x12f178[_0x05ad('0x31')];_0x297263[_0x05ad('0x4e')]=qs['sort'](_0x17bcef[_0x05ad('0x32')][_0x05ad('0x38')]);_0x297263[_0x05ad('0x39')]=qs[_0x05ad('0x3a')](_[_0x05ad('0x3b')](_0x17bcef[_0x05ad('0x32')],_0x12f178['filters']));if(_0x17bcef['query'][_0x05ad('0x3c')]){_0x297263[_0x05ad('0x39')]=_[_0x05ad('0x3d')](_0x297263[_0x05ad('0x39')],{'$or':_[_0x05ad('0x3e')](_0x297263['attributes'],function(_0x504a87){var _0x4af922={};_0x4af922[_0x504a87]={'$like':'%'+_0x17bcef[_0x05ad('0x32')][_0x05ad('0x3c')]+'%'};return _0x4af922;})});}_0x297263=_[_0x05ad('0x3d')]({},_0x297263,_0x17bcef[_0x05ad('0x3f')]);return _0x1989de[_0x05ad('0x4c')](_0x297263);}})[_0x05ad('0x27')](function(_0xae06be){if(_0xae06be){_0x812da6=_0xae06be[_0x05ad('0x36')];if(!_0x17bcef[_0x05ad('0x32')][_0x05ad('0x37')](_0x05ad('0x4f'))){_0x297263[_0x05ad('0x1f')]=qs[_0x05ad('0x1f')](_0x17bcef['query'][_0x05ad('0x1f')]);_0x297263[_0x05ad('0x21')]=qs[_0x05ad('0x21')](_0x17bcef['query'][_0x05ad('0x21')]);}return _0x1989de[_0x05ad('0x4c')](_0x297263);}})[_0x05ad('0x27')](function(_0x17373a){if(_0x17373a){return _0x17373a?{'count':_0x812da6,'rows':_0x17373a}:null;}})['then'](respondWithResult(_0x497007,null))['catch'](handleError(_0x497007,null));};exports['getSubjects']=function(_0x507dd4,_0x4940ee,_0x57decf){var _0x1c0cab={};var _0x337144={};var _0x2af7c8;var _0x1a4811;return db[_0x05ad('0x40')][_0x05ad('0x4d')]({'where':{'id':_0x507dd4[_0x05ad('0x46')]['id']}})[_0x05ad('0x27')](handleEntityNotFound(_0x4940ee,null))['then'](function(_0x193bbf){if(_0x193bbf){_0x2af7c8=_0x193bbf;_0x337144[_0x05ad('0x31')]=_[_0x05ad('0x33')](db[_0x05ad('0x50')][_0x05ad('0x2e')]);_0x337144['query']=_[_0x05ad('0x33')](_0x507dd4['query']);_0x337144[_0x05ad('0x3a')]=_[_0x05ad('0x34')](_0x337144[_0x05ad('0x31')],_0x337144[_0x05ad('0x32')]);_0x1c0cab[_0x05ad('0x35')]=_['intersection'](_0x337144[_0x05ad('0x31')],qs[_0x05ad('0x47')](_0x507dd4[_0x05ad('0x32')][_0x05ad('0x47')]));_0x1c0cab[_0x05ad('0x35')]=_0x1c0cab[_0x05ad('0x35')]['length']?_0x1c0cab[_0x05ad('0x35')]:_0x337144[_0x05ad('0x31')];_0x1c0cab[_0x05ad('0x4e')]=qs[_0x05ad('0x38')](_0x507dd4[_0x05ad('0x32')]['sort']);_0x1c0cab[_0x05ad('0x39')]=qs[_0x05ad('0x3a')](_[_0x05ad('0x3b')](_0x507dd4[_0x05ad('0x32')],_0x337144[_0x05ad('0x3a')]));if(_0x507dd4[_0x05ad('0x32')][_0x05ad('0x3c')]){_0x1c0cab[_0x05ad('0x39')]=_[_0x05ad('0x3d')](_0x1c0cab[_0x05ad('0x39')],{'$or':_['map'](_0x1c0cab[_0x05ad('0x35')],function(_0x10881b){var _0x2938b8={};_0x2938b8[_0x10881b]={'$like':'%'+_0x507dd4[_0x05ad('0x32')][_0x05ad('0x3c')]+'%'};return _0x2938b8;})});}_0x1c0cab=_[_0x05ad('0x3d')]({},_0x1c0cab,_0x507dd4['options']);return _0x2af7c8[_0x05ad('0x51')](_0x1c0cab);}})[_0x05ad('0x27')](function(_0x49f7e8){if(_0x49f7e8){_0x1a4811=_0x49f7e8[_0x05ad('0x36')];if(!_0x507dd4['query'][_0x05ad('0x37')]('nolimit')){_0x1c0cab['limit']=qs['limit'](_0x507dd4['query'][_0x05ad('0x1f')]);_0x1c0cab['offset']=qs['offset'](_0x507dd4[_0x05ad('0x32')][_0x05ad('0x21')]);}return _0x2af7c8[_0x05ad('0x51')](_0x1c0cab);}})[_0x05ad('0x27')](function(_0x5dc368){if(_0x5dc368){return _0x5dc368?{'count':_0x1a4811,'rows':_0x5dc368}:null;}})[_0x05ad('0x27')](respondWithResult(_0x4940ee,null))[_0x05ad('0x4b')](handleError(_0x4940ee,null));};exports[_0x05ad('0x52')]=function(_0x2df1b9,_0x2304a7,_0x42e509){var _0x42ebce={};var _0x4c7c1c={};var _0x383aff;var _0x2f38f9;return db[_0x05ad('0x40')][_0x05ad('0x4d')]({'where':{'id':_0x2df1b9[_0x05ad('0x46')]['id']}})[_0x05ad('0x27')](handleEntityNotFound(_0x2304a7,null))[_0x05ad('0x27')](function(_0x228d5b){if(_0x228d5b){_0x383aff=_0x228d5b;_0x4c7c1c[_0x05ad('0x31')]=_[_0x05ad('0x33')](db[_0x05ad('0x50')]['rawAttributes']);_0x4c7c1c['query']=_[_0x05ad('0x33')](_0x2df1b9[_0x05ad('0x32')]);_0x4c7c1c[_0x05ad('0x3a')]=_[_0x05ad('0x34')](_0x4c7c1c[_0x05ad('0x31')],_0x4c7c1c[_0x05ad('0x32')]);_0x42ebce['attributes']=_[_0x05ad('0x34')](_0x4c7c1c['model'],qs[_0x05ad('0x47')](_0x2df1b9[_0x05ad('0x32')]['fields']));_0x42ebce[_0x05ad('0x35')]=_0x42ebce[_0x05ad('0x35')][_0x05ad('0x36')]?_0x42ebce[_0x05ad('0x35')]:_0x4c7c1c[_0x05ad('0x31')];_0x42ebce[_0x05ad('0x4e')]=qs[_0x05ad('0x38')](_0x2df1b9[_0x05ad('0x32')][_0x05ad('0x38')]);_0x42ebce[_0x05ad('0x39')]=qs[_0x05ad('0x3a')](_[_0x05ad('0x3b')](_0x2df1b9['query'],_0x4c7c1c[_0x05ad('0x3a')]));if(_0x2df1b9[_0x05ad('0x32')]['filter']){_0x42ebce['where']=_[_0x05ad('0x3d')](_0x42ebce['where'],{'$or':_[_0x05ad('0x3e')](_0x42ebce[_0x05ad('0x35')],function(_0x6d02fc){var _0x4d8155={};_0x4d8155[_0x6d02fc]={'$like':'%'+_0x2df1b9[_0x05ad('0x32')][_0x05ad('0x3c')]+'%'};return _0x4d8155;})});}_0x42ebce=_[_0x05ad('0x3d')]({},_0x42ebce,_0x2df1b9['options']);return _0x383aff['getDescriptions'](_0x42ebce);}})['then'](function(_0x5adf09){if(_0x5adf09){_0x2f38f9=_0x5adf09[_0x05ad('0x36')];if(!_0x2df1b9[_0x05ad('0x32')][_0x05ad('0x37')](_0x05ad('0x4f'))){_0x42ebce['limit']=qs['limit'](_0x2df1b9['query'][_0x05ad('0x1f')]);_0x42ebce['offset']=qs[_0x05ad('0x21')](_0x2df1b9[_0x05ad('0x32')][_0x05ad('0x21')]);}return _0x383aff[_0x05ad('0x52')](_0x42ebce);}})[_0x05ad('0x27')](function(_0x444050){if(_0x444050){return _0x444050?{'count':_0x2f38f9,'rows':_0x444050}:null;}})[_0x05ad('0x27')](respondWithResult(_0x2304a7,null))['catch'](handleError(_0x2304a7,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 5b7113a..3f8d688 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 _0xdc6c=['./intVtigerConfiguration.attributes','define','VtigerConfiguration','int_vtiger_configurations','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdc6c,0xfb));var _0xcdc6=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0xdc6c[_0x1e4360];return _0x31e6b4;};'use strict';var _=require(_0xcdc6('0x0'));var util=require(_0xcdc6('0x1'));var logger=require(_0xcdc6('0x2'))(_0xcdc6('0x3'));var moment=require(_0xcdc6('0x4'));var BPromise=require('bluebird');var rp=require(_0xcdc6('0x5'));var fs=require('fs');var path=require(_0xcdc6('0x6'));var rimraf=require(_0xcdc6('0x7'));var config=require(_0xcdc6('0x8'));var attributes=require(_0xcdc6('0x9'));module['exports']=function(_0x59f229,_0x47197f){return _0x59f229[_0xcdc6('0xa')](_0xcdc6('0xb'),attributes,{'tableName':_0xcdc6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x654b=['moment','request-promise','rimraf','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','util','../../config/logger','api'];(function(_0x2e2339,_0xd6f3b5){var _0x1e482b=function(_0x224373){while(--_0x224373){_0x2e2339['push'](_0x2e2339['shift']());}};_0x1e482b(++_0xd6f3b5);}(_0x654b,0x18d));var _0xb654=function(_0x2c1524,_0x311a60){_0x2c1524=_0x2c1524-0x0;var _0x4ddd51=_0x654b[_0x2c1524];return _0x4ddd51;};'use strict';var _=require('lodash');var util=require(_0xb654('0x0'));var logger=require(_0xb654('0x1'))(_0xb654('0x2'));var moment=require(_0xb654('0x3'));var BPromise=require('bluebird');var rp=require(_0xb654('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb654('0x5'));var config=require('../../config/environment');var attributes=require(_0xb654('0x6'));module[_0xb654('0x7')]=function(_0x1f9c2a,_0x994786){return _0x1f9c2a[_0xb654('0x8')](_0xb654('0x9'),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 2db437f..810972a 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 _0x29ae=['request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','error','code','VtigerConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info'];(function(_0x508081,_0x17364f){var _0x2f06fb=function(_0x247411){while(--_0x247411){_0x508081['push'](_0x508081['shift']());}};_0x2f06fb(++_0x17364f);}(_0x29ae,0x16e));var _0xe29a=function(_0x4467f7,_0x4c0b24){_0x4467f7=_0x4467f7-0x0;var _0x36a27b=_0x29ae[_0x4467f7];return _0x36a27b;};'use strict';var _=require(_0xe29a('0x0'));var util=require(_0xe29a('0x1'));var moment=require('moment');var BPromise=require(_0xe29a('0x2'));var rs=require(_0xe29a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe29a('0x4'))['db'];var utils=require(_0xe29a('0x5'));var logger=require(_0xe29a('0x6'))(_0xe29a('0x7'));var config=require(_0xe29a('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe29a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xa0335b,_0x2d8f49,_0x131926){return new BPromise(function(_0x50ca69,_0x1e5ad4){return client['request'](_0xa0335b,_0x131926)[_0xe29a('0xa')](function(_0x299cab){logger[_0xe29a('0xb')]('VtigerConfiguration,\x20%s,\x20%s',_0x2d8f49,_0xe29a('0xc'));logger[_0xe29a('0xd')](_0xe29a('0xe'),_0x2d8f49,_0xe29a('0xc'),JSON['stringify'](_0x299cab));if(_0x299cab['error']){if(_0x299cab[_0xe29a('0xf')][_0xe29a('0x10')]===0x1f4){logger[_0xe29a('0xf')](_0xe29a('0x11'),_0x2d8f49,_0x299cab[_0xe29a('0xf')]['message']);return _0x1e5ad4(_0x299cab[_0xe29a('0xf')][_0xe29a('0x12')]);}logger[_0xe29a('0xf')](_0xe29a('0x11'),_0x2d8f49,_0x299cab[_0xe29a('0xf')][_0xe29a('0x12')]);return _0x50ca69(_0x299cab[_0xe29a('0xf')][_0xe29a('0x12')]);}else{logger['info'](_0xe29a('0x11'),_0x2d8f49,_0xe29a('0xc'));_0x50ca69(_0x299cab[_0xe29a('0x13')][_0xe29a('0x12')]);}})[_0xe29a('0x14')](function(_0x23aaee){logger[_0xe29a('0xf')](_0xe29a('0x11'),_0x2d8f49,_0x23aaee);_0x1e5ad4(_0x23aaee);});});} \ No newline at end of file +var _0x3fe3=['../../config/environment','client','http','request','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x5cc72e,_0x591c0d){var _0x5d3192=function(_0x2a99d4){while(--_0x2a99d4){_0x5cc72e['push'](_0x5cc72e['shift']());}};_0x5d3192(++_0x591c0d);}(_0x3fe3,0x1c5));var _0x33fe=function(_0x3ea4ac,_0x9031ce){_0x3ea4ac=_0x3ea4ac-0x0;var _0x108b3d=_0x3fe3[_0x3ea4ac];return _0x108b3d;};'use strict';var _=require(_0x33fe('0x0'));var util=require(_0x33fe('0x1'));var moment=require(_0x33fe('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x33fe('0x3'))['db'];var utils=require(_0x33fe('0x4'));var logger=require(_0x33fe('0x5'))(_0x33fe('0x6'));var config=require(_0x33fe('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x33fe('0x8')][_0x33fe('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2719d3,_0x12a7b8,_0x162f85){return new BPromise(function(_0x13fd15,_0x177222){return client[_0x33fe('0xa')](_0x2719d3,_0x162f85)['then'](function(_0x39b19e){logger[_0x33fe('0xb')](_0x33fe('0xc'),_0x12a7b8,_0x33fe('0xd'));logger[_0x33fe('0xe')](_0x33fe('0xf'),_0x12a7b8,_0x33fe('0xd'),JSON['stringify'](_0x39b19e));if(_0x39b19e[_0x33fe('0x10')]){if(_0x39b19e[_0x33fe('0x10')]['code']===0x1f4){logger[_0x33fe('0x10')](_0x33fe('0xc'),_0x12a7b8,_0x39b19e[_0x33fe('0x10')][_0x33fe('0x11')]);return _0x177222(_0x39b19e['error'][_0x33fe('0x11')]);}logger[_0x33fe('0x10')](_0x33fe('0xc'),_0x12a7b8,_0x39b19e['error'][_0x33fe('0x11')]);return _0x13fd15(_0x39b19e[_0x33fe('0x10')]['message']);}else{logger['info'](_0x33fe('0xc'),_0x12a7b8,_0x33fe('0xd'));_0x13fd15(_0x39b19e[_0x33fe('0x12')][_0x33fe('0x11')]);}})[_0x33fe('0x13')](function(_0x5ba4b5){logger[_0x33fe('0x10')](_0x33fe('0xc'),_0x12a7b8,_0x5ba4b5);_0x177222(_0x5ba4b5);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 79cc07e..59a060c 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 _0x60dc=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intVtigerField.controller','get','index','/:id','isAuthenticated','show','create','put','delete','destroy','exports','multer','util','path'];(function(_0x59db98,_0x554650){var _0x95e9f2=function(_0xbd3dab){while(--_0xbd3dab){_0x59db98['push'](_0x59db98['shift']());}};_0x95e9f2(++_0x554650);}(_0x60dc,0x12d));var _0xc60d=function(_0x11916b,_0x43e325){_0x11916b=_0x11916b-0x0;var _0x13affd=_0x60dc[_0x11916b];return _0x13affd;};'use strict';var multer=require(_0xc60d('0x0'));var util=require(_0xc60d('0x1'));var path=require(_0xc60d('0x2'));var timeout=require('connect-timeout');var express=require(_0xc60d('0x3'));var router=express[_0xc60d('0x4')]();var fs_extra=require(_0xc60d('0x5'));var auth=require(_0xc60d('0x6'));var interaction=require(_0xc60d('0x7'));var config=require('../../config/environment');var controller=require(_0xc60d('0x8'));router[_0xc60d('0x9')]('/',auth['isAuthenticated'](),controller[_0xc60d('0xa')]);router[_0xc60d('0x9')](_0xc60d('0xb'),auth[_0xc60d('0xc')](),controller[_0xc60d('0xd')]);router['post']('/',auth[_0xc60d('0xc')](),controller[_0xc60d('0xe')]);router[_0xc60d('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xc60d('0x10')](_0xc60d('0xb'),auth[_0xc60d('0xc')](),controller[_0xc60d('0x11')]);module[_0xc60d('0x12')]=router; \ No newline at end of file +var _0xd642=['util','connect-timeout','express','Router','fs-extra','./intVtigerField.controller','index','get','/:id','isAuthenticated','create','put','destroy','multer'];(function(_0x514c25,_0x1eefc8){var _0x3344cf=function(_0x26c92d){while(--_0x26c92d){_0x514c25['push'](_0x514c25['shift']());}};_0x3344cf(++_0x1eefc8);}(_0xd642,0x1bf));var _0x2d64=function(_0x96f74c,_0xfc30a4){_0x96f74c=_0x96f74c-0x0;var _0x379222=_0xd642[_0x96f74c];return _0x379222;};'use strict';var multer=require(_0x2d64('0x0'));var util=require(_0x2d64('0x1'));var path=require('path');var timeout=require(_0x2d64('0x2'));var express=require(_0x2d64('0x3'));var router=express[_0x2d64('0x4')]();var fs_extra=require(_0x2d64('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2d64('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x2d64('0x7')]);router[_0x2d64('0x8')](_0x2d64('0x9'),auth[_0x2d64('0xa')](),controller['show']);router['post']('/',auth[_0x2d64('0xa')](),controller[_0x2d64('0xb')]);router[_0x2d64('0xc')](_0x2d64('0x9'),auth[_0x2d64('0xa')](),controller['update']);router['delete'](_0x2d64('0x9'),auth[_0x2d64('0xa')](),controller[_0x2d64('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 27ec494..8c2bfd5 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 _0x1de0=['ENUM','string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1de0,0xb2));var _0x01de=function(_0x7bc63a,_0x26422a){_0x7bc63a=_0x7bc63a-0x0;var _0xed898e=_0x1de0[_0x7bc63a];return _0xed898e;};'use strict';var Sequelize=require(_0x01de('0x0'));module[_0x01de('0x1')]={'type':{'type':Sequelize[_0x01de('0x2')](_0x01de('0x3'),_0x01de('0x4'),_0x01de('0x5'),_0x01de('0x6'),_0x01de('0x7')),'defaultValue':_0x01de('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x01de('0x8')]},'keyType':{'type':Sequelize['ENUM']('string','variable',_0x01de('0x5'))},'keyContent':{'type':Sequelize[_0x01de('0x8')]},'idField':{'type':Sequelize[_0x01de('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x01de('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xfeb3=['BOOLEAN','sequelize','exports','ENUM','string','variable','picklist','STRING','customVariable'];(function(_0x503a49,_0x20d4a1){var _0x1d2a1a=function(_0x259565){while(--_0x259565){_0x503a49['push'](_0x503a49['shift']());}};_0x1d2a1a(++_0x20d4a1);}(_0xfeb3,0xd0));var _0x3feb=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xfeb3[_0x502c7d];return _0x30b7ed;};'use strict';var Sequelize=require(_0x3feb('0x0'));module[_0x3feb('0x1')]={'type':{'type':Sequelize[_0x3feb('0x2')](_0x3feb('0x3'),_0x3feb('0x4'),'customVariable','keyValue',_0x3feb('0x5')),'defaultValue':_0x3feb('0x3')},'content':{'type':Sequelize[_0x3feb('0x6')]},'key':{'type':Sequelize[_0x3feb('0x6')]},'keyType':{'type':Sequelize[_0x3feb('0x2')](_0x3feb('0x3'),_0x3feb('0x4'),_0x3feb('0x7'))},'keyContent':{'type':Sequelize[_0x3feb('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x3feb('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3feb('0x6')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 1163dd2..e3c4adf 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 _0x6828=['fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','then','includeAll','findAll','catch','show','params','rawAttributes','include','find','create','body','update','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','error','name','send','index','map','VtigerField'];(function(_0x588cbd,_0x35d7a3){var _0x88e11b=function(_0x2fb23b){while(--_0x2fb23b){_0x588cbd['push'](_0x588cbd['shift']());}};_0x88e11b(++_0x35d7a3);}(_0x6828,0xf5));var _0x8682=function(_0x478301,_0x485c86){_0x478301=_0x478301-0x0;var _0x2f7778=_0x6828[_0x478301];return _0x2f7778;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8682('0x0'));var zipdir=require(_0x8682('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8682('0x2'));var moment=require(_0x8682('0x3'));var BPromise=require(_0x8682('0x4'));var Mustache=require(_0x8682('0x5'));var util=require('util');var path=require(_0x8682('0x6'));var sox=require(_0x8682('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8682('0x8'));var _=require(_0x8682('0x9'));var squel=require(_0x8682('0xa'));var crypto=require(_0x8682('0xb'));var jsforce=require(_0x8682('0xc'));var deskjs=require(_0x8682('0xd'));var toCsv=require(_0x8682('0xe'));var querystring=require(_0x8682('0xf'));var Papa=require(_0x8682('0x10'));var Redis=require('ioredis');var authService=require(_0x8682('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8682('0x12'));var logger=require('../../config/logger')(_0x8682('0x13'));var utils=require(_0x8682('0x14'));var config=require(_0x8682('0x15'));var licenseUtil=require(_0x8682('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3f0907,_0x1304c2){_0x1304c2=_0x1304c2||0xcc;return function(_0x296a65){if(_0x296a65){return _0x3f0907[_0x8682('0x17')](_0x1304c2);}return _0x3f0907['status'](_0x1304c2)[_0x8682('0x18')]();};}function respondWithResult(_0x1e3ac2,_0x1c118d){_0x1c118d=_0x1c118d||0xc8;return function(_0x518aad){if(_0x518aad){return _0x1e3ac2[_0x8682('0x19')](_0x1c118d)[_0x8682('0x1a')](_0x518aad);}};}function respondWithFilteredResult(_0x2d9657,_0x145e94){return function(_0x38b6a0){if(_0x38b6a0){var _0x3271ff=typeof _0x145e94[_0x8682('0x1b')]===_0x8682('0x1c')&&typeof _0x145e94[_0x8682('0x1d')]==='undefined';var _0xb200ed=_0x38b6a0[_0x8682('0x1e')];var _0xaa3754=_0x3271ff?0x0:_0x145e94['offset'];var _0x1e7ee8=_0x3271ff?_0x38b6a0['count']:_0x145e94[_0x8682('0x1b')]+_0x145e94['limit'];var _0x4054a8;if(_0x1e7ee8>=_0xb200ed){_0x1e7ee8=_0xb200ed;_0x4054a8=0xc8;}else{_0x4054a8=0xce;}_0x2d9657[_0x8682('0x19')](_0x4054a8);return _0x2d9657[_0x8682('0x1f')](_0x8682('0x20'),_0xaa3754+'-'+_0x1e7ee8+'/'+_0xb200ed)[_0x8682('0x1a')](_0x38b6a0);}return null;};}function patchUpdates(_0x2f9714){return function(_0x3dc958){try{jsonpatch[_0x8682('0x21')](_0x3dc958,_0x2f9714,!![]);}catch(_0x43e534){return BPromise[_0x8682('0x22')](_0x43e534);}return _0x3dc958[_0x8682('0x23')]();};}function saveUpdates(_0x3bf391,_0xa47715){return function(_0x49d33f){if(_0x49d33f){return _0x49d33f['update'](_0x3bf391)['then'](function(_0x46ec0a){return _0x46ec0a;});}return null;};}function removeEntity(_0x6aff79,_0x43981e){return function(_0x3737ae){if(_0x3737ae){return _0x3737ae[_0x8682('0x24')]()['then'](function(){_0x6aff79[_0x8682('0x19')](0xcc)[_0x8682('0x18')]();});}};}function handleEntityNotFound(_0x67f9f2,_0x2b84f){return function(_0x3e302c){if(!_0x3e302c){_0x67f9f2[_0x8682('0x17')](0x194);}return _0x3e302c;};}function handleError(_0x4d7cd3,_0x5d0a06){_0x5d0a06=_0x5d0a06||0x1f4;return function(_0x321427){logger[_0x8682('0x25')](_0x321427['stack']);if(_0x321427[_0x8682('0x26')]){delete _0x321427[_0x8682('0x26')];}_0x4d7cd3[_0x8682('0x19')](_0x5d0a06)[_0x8682('0x27')](_0x321427);};}exports[_0x8682('0x28')]=function(_0x41addc,_0x476e4b){var _0x871b11={},_0x33b48e={},_0x566742={'count':0x0,'rows':[]};var _0x510655=_[_0x8682('0x29')](db[_0x8682('0x2a')]['rawAttributes'],function(_0x11cd62){return{'name':_0x11cd62[_0x8682('0x2b')],'type':_0x11cd62[_0x8682('0x2c')][_0x8682('0x2d')]};});_0x33b48e[_0x8682('0x2e')]=_[_0x8682('0x29')](_0x510655,_0x8682('0x26'));_0x33b48e[_0x8682('0x2f')]=_[_0x8682('0x30')](_0x41addc[_0x8682('0x2f')]);_0x33b48e[_0x8682('0x31')]=_[_0x8682('0x32')](_0x33b48e['model'],_0x33b48e[_0x8682('0x2f')]);_0x871b11['attributes']=_[_0x8682('0x32')](_0x33b48e[_0x8682('0x2e')],qs[_0x8682('0x33')](_0x41addc[_0x8682('0x2f')][_0x8682('0x33')]));_0x871b11[_0x8682('0x34')]=_0x871b11[_0x8682('0x34')][_0x8682('0x35')]?_0x871b11[_0x8682('0x34')]:_0x33b48e[_0x8682('0x2e')];if(!_0x41addc[_0x8682('0x2f')][_0x8682('0x36')]('nolimit')){_0x871b11[_0x8682('0x1d')]=qs['limit'](_0x41addc[_0x8682('0x2f')]['limit']);_0x871b11['offset']=qs[_0x8682('0x1b')](_0x41addc[_0x8682('0x2f')]['offset']);}_0x871b11['order']=qs['sort'](_0x41addc[_0x8682('0x2f')][_0x8682('0x37')]);_0x871b11[_0x8682('0x38')]=qs[_0x8682('0x31')](_[_0x8682('0x39')](_0x41addc[_0x8682('0x2f')],_0x33b48e[_0x8682('0x31')]),_0x510655);if(_0x41addc['query'][_0x8682('0x3a')]){_0x871b11[_0x8682('0x38')]=_[_0x8682('0x3b')](_0x871b11['where'],{'$or':_[_0x8682('0x29')](_0x510655,function(_0x20b70b){if(_0x20b70b[_0x8682('0x2c')]!=='VIRTUAL'){var _0x1cd36e={};_0x1cd36e[_0x20b70b[_0x8682('0x26')]]={'$like':'%'+_0x41addc['query']['filter']+'%'};return _0x1cd36e;}})});}_0x871b11=_[_0x8682('0x3b')]({},_0x871b11,_0x41addc['options']);var _0x35933e={'where':_0x871b11[_0x8682('0x38')]};return db[_0x8682('0x2a')]['count'](_0x35933e)[_0x8682('0x3c')](function(_0x292579){_0x566742['count']=_0x292579;if(_0x41addc[_0x8682('0x2f')][_0x8682('0x3d')]){_0x871b11['include']=[{'all':!![]}];}return db['VtigerField'][_0x8682('0x3e')](_0x871b11);})[_0x8682('0x3c')](function(_0x1afaff){_0x566742['rows']=_0x1afaff;return _0x566742;})[_0x8682('0x3c')](respondWithFilteredResult(_0x476e4b,_0x871b11))[_0x8682('0x3f')](handleError(_0x476e4b,null));};exports[_0x8682('0x40')]=function(_0xabfe51,_0x4d732f){var _0x43e028={'raw':!![],'where':{'id':_0xabfe51[_0x8682('0x41')]['id']}},_0x2caa5e={};_0x2caa5e[_0x8682('0x2e')]=_[_0x8682('0x30')](db[_0x8682('0x2a')][_0x8682('0x42')]);_0x2caa5e[_0x8682('0x2f')]=_[_0x8682('0x30')](_0xabfe51[_0x8682('0x2f')]);_0x2caa5e[_0x8682('0x31')]=_[_0x8682('0x32')](_0x2caa5e['model'],_0x2caa5e[_0x8682('0x2f')]);_0x43e028[_0x8682('0x34')]=_[_0x8682('0x32')](_0x2caa5e[_0x8682('0x2e')],qs[_0x8682('0x33')](_0xabfe51['query'][_0x8682('0x33')]));_0x43e028['attributes']=_0x43e028[_0x8682('0x34')][_0x8682('0x35')]?_0x43e028[_0x8682('0x34')]:_0x2caa5e['model'];if(_0xabfe51['query'][_0x8682('0x3d')]){_0x43e028[_0x8682('0x43')]=[{'all':!![]}];}_0x43e028=_[_0x8682('0x3b')]({},_0x43e028,_0xabfe51['options']);return db[_0x8682('0x2a')][_0x8682('0x44')](_0x43e028)[_0x8682('0x3c')](handleEntityNotFound(_0x4d732f,null))['then'](respondWithResult(_0x4d732f,null))[_0x8682('0x3f')](handleError(_0x4d732f,null));};exports[_0x8682('0x45')]=function(_0x1e46c4,_0x4711bc){return db['VtigerField'][_0x8682('0x45')](_0x1e46c4[_0x8682('0x46')],{})[_0x8682('0x3c')](respondWithResult(_0x4711bc,0xc9))['catch'](handleError(_0x4711bc,null));};exports[_0x8682('0x47')]=function(_0xa183b7,_0x2972f0){if(_0xa183b7[_0x8682('0x46')]['id']){delete _0xa183b7['body']['id'];}return db[_0x8682('0x2a')][_0x8682('0x44')]({'where':{'id':_0xa183b7[_0x8682('0x41')]['id']}})[_0x8682('0x3c')](handleEntityNotFound(_0x2972f0,null))[_0x8682('0x3c')](saveUpdates(_0xa183b7[_0x8682('0x46')],null))['then'](respondWithResult(_0x2972f0,null))[_0x8682('0x3f')](handleError(_0x2972f0,null));};exports[_0x8682('0x24')]=function(_0x3ce4d7,_0x3327b2){return db[_0x8682('0x2a')]['find']({'where':{'id':_0x3ce4d7['params']['id']}})[_0x8682('0x3c')](handleEntityNotFound(_0x3327b2,null))[_0x8682('0x3c')](removeEntity(_0x3327b2,null))[_0x8682('0x3f')](handleError(_0x3327b2,null));}; \ No newline at end of file +var _0xd85c=['lodash','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','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','end','error','name','send','VtigerField','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','params','keys','rawAttributes','includeAll','create','body','update','find','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','ejs'];(function(_0x4c3008,_0x322084){var _0x438eb5=function(_0x1f92ad){while(--_0x1f92ad){_0x4c3008['push'](_0x4c3008['shift']());}};_0x438eb5(++_0x322084);}(_0xd85c,0x126));var _0xcd85=function(_0xe20fdf,_0x4790a3){_0xe20fdf=_0xe20fdf-0x0;var _0x5eab04=_0xd85c[_0xe20fdf];return _0x5eab04;};'use strict';var emlformat=require(_0xcd85('0x0'));var rimraf=require(_0xcd85('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xcd85('0x2'));var moment=require(_0xcd85('0x3'));var BPromise=require(_0xcd85('0x4'));var Mustache=require(_0xcd85('0x5'));var util=require(_0xcd85('0x6'));var path=require(_0xcd85('0x7'));var sox=require(_0xcd85('0x8'));var csv=require('to-csv');var ejs=require(_0xcd85('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcd85('0xa'));var squel=require('squel');var crypto=require(_0xcd85('0xb'));var jsforce=require(_0xcd85('0xc'));var deskjs=require(_0xcd85('0xd'));var toCsv=require('to-csv');var querystring=require(_0xcd85('0xe'));var Papa=require(_0xcd85('0xf'));var Redis=require(_0xcd85('0x10'));var authService=require(_0xcd85('0x11'));var qs=require(_0xcd85('0x12'));var as=require(_0xcd85('0x13'));var hardwareService=require(_0xcd85('0x14'));var logger=require(_0xcd85('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xcd85('0x16'));var licenseUtil=require(_0xcd85('0x17'));var db=require(_0xcd85('0x18'))['db'];function respondWithStatusCode(_0x187e89,_0x454a3d){_0x454a3d=_0x454a3d||0xcc;return function(_0x49e1f9){if(_0x49e1f9){return _0x187e89[_0xcd85('0x19')](_0x454a3d);}return _0x187e89['status'](_0x454a3d)['end']();};}function respondWithResult(_0x51a7cb,_0x25d07e){_0x25d07e=_0x25d07e||0xc8;return function(_0x41b835){if(_0x41b835){return _0x51a7cb[_0xcd85('0x1a')](_0x25d07e)[_0xcd85('0x1b')](_0x41b835);}};}function respondWithFilteredResult(_0x452f4d,_0x50fce2){return function(_0x232c04){if(_0x232c04){var _0x2a0a58=typeof _0x50fce2[_0xcd85('0x1c')]===_0xcd85('0x1d')&&typeof _0x50fce2['limit']==='undefined';var _0x48a8d9=_0x232c04[_0xcd85('0x1e')];var _0x58c324=_0x2a0a58?0x0:_0x50fce2[_0xcd85('0x1c')];var _0x1350d=_0x2a0a58?_0x232c04[_0xcd85('0x1e')]:_0x50fce2[_0xcd85('0x1c')]+_0x50fce2[_0xcd85('0x1f')];var _0x28fef7;if(_0x1350d>=_0x48a8d9){_0x1350d=_0x48a8d9;_0x28fef7=0xc8;}else{_0x28fef7=0xce;}_0x452f4d[_0xcd85('0x1a')](_0x28fef7);return _0x452f4d[_0xcd85('0x20')](_0xcd85('0x21'),_0x58c324+'-'+_0x1350d+'/'+_0x48a8d9)[_0xcd85('0x1b')](_0x232c04);}return null;};}function patchUpdates(_0x38f778){return function(_0x29f8f5){try{jsonpatch[_0xcd85('0x22')](_0x29f8f5,_0x38f778,!![]);}catch(_0x1574ed){return BPromise[_0xcd85('0x23')](_0x1574ed);}return _0x29f8f5[_0xcd85('0x24')]();};}function saveUpdates(_0x1c8b83,_0x142691){return function(_0x30ce72){if(_0x30ce72){return _0x30ce72['update'](_0x1c8b83)[_0xcd85('0x25')](function(_0x244f17){return _0x244f17;});}return null;};}function removeEntity(_0xc4d7a1,_0x3f65a0){return function(_0x4ec03e){if(_0x4ec03e){return _0x4ec03e[_0xcd85('0x26')]()[_0xcd85('0x25')](function(){_0xc4d7a1[_0xcd85('0x1a')](0xcc)[_0xcd85('0x27')]();});}};}function handleEntityNotFound(_0x574bc2,_0x131d48){return function(_0x57c364){if(!_0x57c364){_0x574bc2[_0xcd85('0x19')](0x194);}return _0x57c364;};}function handleError(_0x854672,_0x2f6d42){_0x2f6d42=_0x2f6d42||0x1f4;return function(_0x846403){logger[_0xcd85('0x28')](_0x846403['stack']);if(_0x846403[_0xcd85('0x29')]){delete _0x846403['name'];}_0x854672[_0xcd85('0x1a')](_0x2f6d42)[_0xcd85('0x2a')](_0x846403);};}exports['index']=function(_0x16c4a2,_0x3df787){var _0x54b37b={},_0x36c0a9={},_0x4109ed={'count':0x0,'rows':[]};var _0x5efe7e=_['map'](db[_0xcd85('0x2b')]['rawAttributes'],function(_0xab6b8b){return{'name':_0xab6b8b[_0xcd85('0x2c')],'type':_0xab6b8b[_0xcd85('0x2d')][_0xcd85('0x2e')]};});_0x36c0a9[_0xcd85('0x2f')]=_['map'](_0x5efe7e,_0xcd85('0x29'));_0x36c0a9['query']=_['keys'](_0x16c4a2[_0xcd85('0x30')]);_0x36c0a9[_0xcd85('0x31')]=_[_0xcd85('0x32')](_0x36c0a9[_0xcd85('0x2f')],_0x36c0a9[_0xcd85('0x30')]);_0x54b37b[_0xcd85('0x33')]=_[_0xcd85('0x32')](_0x36c0a9[_0xcd85('0x2f')],qs[_0xcd85('0x34')](_0x16c4a2[_0xcd85('0x30')][_0xcd85('0x34')]));_0x54b37b[_0xcd85('0x33')]=_0x54b37b['attributes'][_0xcd85('0x35')]?_0x54b37b[_0xcd85('0x33')]:_0x36c0a9['model'];if(!_0x16c4a2[_0xcd85('0x30')][_0xcd85('0x36')](_0xcd85('0x37'))){_0x54b37b[_0xcd85('0x1f')]=qs['limit'](_0x16c4a2[_0xcd85('0x30')][_0xcd85('0x1f')]);_0x54b37b['offset']=qs[_0xcd85('0x1c')](_0x16c4a2[_0xcd85('0x30')][_0xcd85('0x1c')]);}_0x54b37b[_0xcd85('0x38')]=qs[_0xcd85('0x39')](_0x16c4a2[_0xcd85('0x30')][_0xcd85('0x39')]);_0x54b37b[_0xcd85('0x3a')]=qs[_0xcd85('0x31')](_[_0xcd85('0x3b')](_0x16c4a2[_0xcd85('0x30')],_0x36c0a9['filters']),_0x5efe7e);if(_0x16c4a2[_0xcd85('0x30')][_0xcd85('0x3c')]){_0x54b37b[_0xcd85('0x3a')]=_[_0xcd85('0x3d')](_0x54b37b[_0xcd85('0x3a')],{'$or':_['map'](_0x5efe7e,function(_0x563a3b){if(_0x563a3b[_0xcd85('0x2d')]!==_0xcd85('0x3e')){var _0x3f1238={};_0x3f1238[_0x563a3b['name']]={'$like':'%'+_0x16c4a2[_0xcd85('0x30')][_0xcd85('0x3c')]+'%'};return _0x3f1238;}})});}_0x54b37b=_[_0xcd85('0x3d')]({},_0x54b37b,_0x16c4a2[_0xcd85('0x3f')]);var _0x3f639a={'where':_0x54b37b[_0xcd85('0x3a')]};return db['VtigerField'][_0xcd85('0x1e')](_0x3f639a)[_0xcd85('0x25')](function(_0x4c59ce){_0x4109ed[_0xcd85('0x1e')]=_0x4c59ce;if(_0x16c4a2['query']['includeAll']){_0x54b37b[_0xcd85('0x40')]=[{'all':!![]}];}return db['VtigerField'][_0xcd85('0x41')](_0x54b37b);})[_0xcd85('0x25')](function(_0x372ff1){_0x4109ed['rows']=_0x372ff1;return _0x4109ed;})[_0xcd85('0x25')](respondWithFilteredResult(_0x3df787,_0x54b37b))[_0xcd85('0x42')](handleError(_0x3df787,null));};exports[_0xcd85('0x43')]=function(_0x50a30e,_0x32303b){var _0x4b00ed={'raw':!![],'where':{'id':_0x50a30e[_0xcd85('0x44')]['id']}},_0x1b8012={};_0x1b8012[_0xcd85('0x2f')]=_[_0xcd85('0x45')](db[_0xcd85('0x2b')][_0xcd85('0x46')]);_0x1b8012[_0xcd85('0x30')]=_[_0xcd85('0x45')](_0x50a30e['query']);_0x1b8012['filters']=_[_0xcd85('0x32')](_0x1b8012[_0xcd85('0x2f')],_0x1b8012[_0xcd85('0x30')]);_0x4b00ed[_0xcd85('0x33')]=_[_0xcd85('0x32')](_0x1b8012[_0xcd85('0x2f')],qs[_0xcd85('0x34')](_0x50a30e[_0xcd85('0x30')][_0xcd85('0x34')]));_0x4b00ed['attributes']=_0x4b00ed['attributes'][_0xcd85('0x35')]?_0x4b00ed[_0xcd85('0x33')]:_0x1b8012[_0xcd85('0x2f')];if(_0x50a30e[_0xcd85('0x30')][_0xcd85('0x47')]){_0x4b00ed[_0xcd85('0x40')]=[{'all':!![]}];}_0x4b00ed=_[_0xcd85('0x3d')]({},_0x4b00ed,_0x50a30e[_0xcd85('0x3f')]);return db[_0xcd85('0x2b')]['find'](_0x4b00ed)[_0xcd85('0x25')](handleEntityNotFound(_0x32303b,null))[_0xcd85('0x25')](respondWithResult(_0x32303b,null))[_0xcd85('0x42')](handleError(_0x32303b,null));};exports[_0xcd85('0x48')]=function(_0x5e1ecd,_0x4b8a9b){return db[_0xcd85('0x2b')]['create'](_0x5e1ecd[_0xcd85('0x49')],{})[_0xcd85('0x25')](respondWithResult(_0x4b8a9b,0xc9))[_0xcd85('0x42')](handleError(_0x4b8a9b,null));};exports[_0xcd85('0x4a')]=function(_0x14e20f,_0x420acd){if(_0x14e20f['body']['id']){delete _0x14e20f[_0xcd85('0x49')]['id'];}return db[_0xcd85('0x2b')][_0xcd85('0x4b')]({'where':{'id':_0x14e20f[_0xcd85('0x44')]['id']}})[_0xcd85('0x25')](handleEntityNotFound(_0x420acd,null))[_0xcd85('0x25')](saveUpdates(_0x14e20f[_0xcd85('0x49')],null))[_0xcd85('0x25')](respondWithResult(_0x420acd,null))['catch'](handleError(_0x420acd,null));};exports[_0xcd85('0x26')]=function(_0x5948fe,_0x19ef34){return db[_0xcd85('0x2b')]['find']({'where':{'id':_0x5948fe[_0xcd85('0x44')]['id']}})[_0xcd85('0x25')](handleEntityNotFound(_0x19ef34,null))[_0xcd85('0x25')](removeEntity(_0x19ef34,null))[_0xcd85('0x42')](handleError(_0x19ef34,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 23f3b3d..ad91758 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 _0x2902=['exports','int_vtiger_fields','idField','FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./intVtigerField.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2902,0x1e5));var _0x2290=function(_0x2c0ded,_0x3de22c){_0x2c0ded=_0x2c0ded-0x0;var _0x4473e5=_0x2902[_0x2c0ded];return _0x4473e5;};'use strict';var _=require(_0x2290('0x0'));var util=require(_0x2290('0x1'));var logger=require(_0x2290('0x2'))('api');var moment=require(_0x2290('0x3'));var BPromise=require(_0x2290('0x4'));var rp=require(_0x2290('0x5'));var fs=require('fs');var path=require(_0x2290('0x6'));var rimraf=require('rimraf');var config=require(_0x2290('0x7'));var attributes=require(_0x2290('0x8'));module[_0x2290('0x9')]=function(_0x5abd65,_0x1f3177){return _0x5abd65['define']('VtigerField',attributes,{'tableName':_0x2290('0xa'),'paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':[_0x2290('0xb'),_0x2290('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0751=['rimraf','../../config/environment','exports','define','VtigerField','int_vtiger_fields','vtiger_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x5b28df,_0x5a42b8){var _0x3f1588=function(_0x5d1c8c){while(--_0x5d1c8c){_0x5b28df['push'](_0x5b28df['shift']());}};_0x3f1588(++_0x5a42b8);}(_0x0751,0x79));var _0x1075=function(_0x2629a2,_0xc206c9){_0x2629a2=_0x2629a2-0x0;var _0x199803=_0x0751[_0x2629a2];return _0x199803;};'use strict';var _=require(_0x1075('0x0'));var util=require(_0x1075('0x1'));var logger=require(_0x1075('0x2'))(_0x1075('0x3'));var moment=require(_0x1075('0x4'));var BPromise=require('bluebird');var rp=require(_0x1075('0x5'));var fs=require('fs');var path=require(_0x1075('0x6'));var rimraf=require(_0x1075('0x7'));var config=require(_0x1075('0x8'));var attributes=require('./intVtigerField.attributes');module[_0x1075('0x9')]=function(_0x429855,_0x500785){return _0x429855[_0x1075('0xa')](_0x1075('0xb'),attributes,{'tableName':_0x1075('0xc'),'paranoid':![],'indexes':[{'name':_0x1075('0xd'),'fields':[_0x1075('0xe'),_0x1075('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.rpc.js b/server/api/intVtigerField/intVtigerField.rpc.js index ab70e11..50a9816 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 _0x11c5=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','info','VtigerField,\x20%s,\x20%s','debug','VtigerField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','util','moment','bluebird'];(function(_0x271447,_0x40228d){var _0x1456ee=function(_0x58f3a8){while(--_0x58f3a8){_0x271447['push'](_0x271447['shift']());}};_0x1456ee(++_0x40228d);}(_0x11c5,0x9d));var _0x511c=function(_0x3e2237,_0x373b49){_0x3e2237=_0x3e2237-0x0;var _0xb495ac=_0x11c5[_0x3e2237];return _0xb495ac;};'use strict';var _=require('lodash');var util=require(_0x511c('0x0'));var moment=require(_0x511c('0x1'));var BPromise=require(_0x511c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x511c('0x3'));var db=require(_0x511c('0x4'))['db'];var utils=require(_0x511c('0x5'));var logger=require(_0x511c('0x6'))('rpc');var config=require(_0x511c('0x7'));var jayson=require(_0x511c('0x8'));var client=jayson['client'][_0x511c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x586494,_0x3e49fd,_0x4d41f5){return new BPromise(function(_0xa46919,_0x34b5d7){return client['request'](_0x586494,_0x4d41f5)['then'](function(_0x493cf3){logger[_0x511c('0xa')](_0x511c('0xb'),_0x3e49fd,'request\x20sent');logger[_0x511c('0xc')](_0x511c('0xd'),_0x3e49fd,_0x511c('0xe'),JSON['stringify'](_0x493cf3));if(_0x493cf3[_0x511c('0xf')]){if(_0x493cf3['error'][_0x511c('0x10')]===0x1f4){logger[_0x511c('0xf')]('VtigerField,\x20%s,\x20%s',_0x3e49fd,_0x493cf3[_0x511c('0xf')][_0x511c('0x11')]);return _0x34b5d7(_0x493cf3[_0x511c('0xf')][_0x511c('0x11')]);}logger[_0x511c('0xf')]('VtigerField,\x20%s,\x20%s',_0x3e49fd,_0x493cf3[_0x511c('0xf')][_0x511c('0x11')]);return _0xa46919(_0x493cf3[_0x511c('0xf')][_0x511c('0x11')]);}else{logger[_0x511c('0xa')]('VtigerField,\x20%s,\x20%s',_0x3e49fd,'request\x20sent');_0xa46919(_0x493cf3[_0x511c('0x12')][_0x511c('0x11')]);}})[_0x511c('0x13')](function(_0x39d3cf){logger[_0x511c('0xf')](_0x511c('0xb'),_0x3e49fd,_0x39d3cf);_0x34b5d7(_0x39d3cf);});});} \ No newline at end of file +var _0x5bbd=['../../config/environment','jayson/promise','info','VtigerField,\x20%s,\x20%s','debug','VtigerField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x48c937,_0x33ed99){var _0xc16e8f=function(_0x50daf6){while(--_0x50daf6){_0x48c937['push'](_0x48c937['shift']());}};_0xc16e8f(++_0x33ed99);}(_0x5bbd,0x12b));var _0xd5bb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5bbd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd5bb('0x0'));var util=require(_0xd5bb('0x1'));var moment=require(_0xd5bb('0x2'));var BPromise=require(_0xd5bb('0x3'));var rs=require(_0xd5bb('0x4'));var fs=require('fs');var Redis=require(_0xd5bb('0x5'));var db=require(_0xd5bb('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xd5bb('0x7'));var jayson=require(_0xd5bb('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x292873,_0x5093d3,_0x3878ba){return new BPromise(function(_0x17c08f,_0x1e7ad6){return client['request'](_0x292873,_0x3878ba)['then'](function(_0x44ffea){logger[_0xd5bb('0x9')](_0xd5bb('0xa'),_0x5093d3,'request\x20sent');logger[_0xd5bb('0xb')](_0xd5bb('0xc'),_0x5093d3,_0xd5bb('0xd'),JSON['stringify'](_0x44ffea));if(_0x44ffea['error']){if(_0x44ffea[_0xd5bb('0xe')][_0xd5bb('0xf')]===0x1f4){logger['error'](_0xd5bb('0xa'),_0x5093d3,_0x44ffea['error'][_0xd5bb('0x10')]);return _0x1e7ad6(_0x44ffea['error'][_0xd5bb('0x10')]);}logger[_0xd5bb('0xe')]('VtigerField,\x20%s,\x20%s',_0x5093d3,_0x44ffea[_0xd5bb('0xe')][_0xd5bb('0x10')]);return _0x17c08f(_0x44ffea[_0xd5bb('0xe')]['message']);}else{logger['info'](_0xd5bb('0xa'),_0x5093d3,_0xd5bb('0xd'));_0x17c08f(_0x44ffea['result'][_0xd5bb('0x10')]);}})[_0xd5bb('0x11')](function(_0x3b7021){logger[_0xd5bb('0xe')]('VtigerField,\x20%s,\x20%s',_0x5093d3,_0x3b7021);_0x1e7ad6(_0x3b7021);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 59e8111..dcbc837 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 _0xfe92=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','isAuthenticated','index','/:id/configurations','get','/:id/fields','getFields','post','addConfiguration','put','/:id','destroy','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x17ebd1,_0x5bc2e3){var _0x3fe498=function(_0x202150){while(--_0x202150){_0x17ebd1['push'](_0x17ebd1['shift']());}};_0x3fe498(++_0x5bc2e3);}(_0xfe92,0x174));var _0x2fe9=function(_0x2387c5,_0xfcc74c){_0x2387c5=_0x2387c5-0x0;var _0x2c414c=_0xfe92[_0x2387c5];return _0x2c414c;};'use strict';var multer=require(_0x2fe9('0x0'));var util=require(_0x2fe9('0x1'));var path=require('path');var timeout=require(_0x2fe9('0x2'));var express=require(_0x2fe9('0x3'));var router=express[_0x2fe9('0x4')]();var fs_extra=require(_0x2fe9('0x5'));var auth=require(_0x2fe9('0x6'));var interaction=require(_0x2fe9('0x7'));var config=require(_0x2fe9('0x8'));var controller=require(_0x2fe9('0x9'));router['get']('/',auth[_0x2fe9('0xa')](),controller[_0x2fe9('0xb')]);router['get']('/:id',auth[_0x2fe9('0xa')](),controller['show']);router['get'](_0x2fe9('0xc'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0x2fe9('0xd')](_0x2fe9('0xe'),auth['isAuthenticated'](),controller[_0x2fe9('0xf')]);router[_0x2fe9('0x10')]('/',auth[_0x2fe9('0xa')](),controller['create']);router['post']('/:id/configurations',auth[_0x2fe9('0xa')](),controller[_0x2fe9('0x11')]);router[_0x2fe9('0x12')](_0x2fe9('0x13'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x2fe9('0xa')](),controller[_0x2fe9('0x14')]);module['exports']=router; \ No newline at end of file +var _0x7c43=['exports','path','express','Router','../../components/auth/service','../../config/environment','./intZendeskAccount.controller','isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','put','update','delete','destroy'];(function(_0x4bf96c,_0x4d24fd){var _0x281d09=function(_0x56538e){while(--_0x56538e){_0x4bf96c['push'](_0x4bf96c['shift']());}};_0x281d09(++_0x4d24fd);}(_0x7c43,0xf3));var _0x37c4=function(_0x596c96,_0x3c2f5d){_0x596c96=_0x596c96-0x0;var _0x4c607f=_0x7c43[_0x596c96];return _0x4c607f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x37c4('0x0'));var timeout=require('connect-timeout');var express=require(_0x37c4('0x1'));var router=express[_0x37c4('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x37c4('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x37c4('0x4'));var controller=require(_0x37c4('0x5'));router['get']('/',auth[_0x37c4('0x6')](),controller[_0x37c4('0x7')]);router[_0x37c4('0x8')](_0x37c4('0x9'),auth[_0x37c4('0x6')](),controller[_0x37c4('0xa')]);router[_0x37c4('0x8')](_0x37c4('0xb'),auth['isAuthenticated'](),controller[_0x37c4('0xc')]);router['get'](_0x37c4('0xd'),auth[_0x37c4('0x6')](),controller[_0x37c4('0xe')]);router[_0x37c4('0xf')]('/',auth[_0x37c4('0x6')](),controller[_0x37c4('0x10')]);router[_0x37c4('0xf')](_0x37c4('0xb'),auth[_0x37c4('0x6')](),controller['addConfiguration']);router[_0x37c4('0x11')]('/:id',auth[_0x37c4('0x6')](),controller[_0x37c4('0x12')]);router[_0x37c4('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x37c4('0x14')]);module[_0x37c4('0x15')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 8b103a8..4f48745 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 _0xa423=['password','token','integrationTab','newTab','sequelize','exports','STRING','remoteUri','ENUM'];(function(_0x48b724,_0x5a8e26){var _0x4d38b3=function(_0xef820f){while(--_0xef820f){_0x48b724['push'](_0x48b724['shift']());}};_0x4d38b3(++_0x5a8e26);}(_0xa423,0x16c));var _0x3a42=function(_0xc18afe,_0x2e94a0){_0xc18afe=_0xc18afe-0x0;var _0x1b6c13=_0xa423[_0xc18afe];return _0x1b6c13;};'use strict';var Sequelize=require(_0x3a42('0x0'));module[_0x3a42('0x1')]={'name':{'type':Sequelize[_0x3a42('0x2')]},'description':{'type':Sequelize[_0x3a42('0x2')]},'username':{'type':Sequelize[_0x3a42('0x2')],'unique':'username'},'password':{'type':Sequelize[_0x3a42('0x2')]},'token':{'type':Sequelize[_0x3a42('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x3a42('0x3')},'authType':{'type':Sequelize[_0x3a42('0x4')](_0x3a42('0x5'),_0x3a42('0x6')),'defaultValue':_0x3a42('0x5')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x3a42('0x4')](_0x3a42('0x7'),_0x3a42('0x8')),'defaultValue':_0x3a42('0x7')}}; \ No newline at end of file +var _0x07e8=['exports','STRING','remoteUri','ENUM','password','integrationTab','newTab','sequelize'];(function(_0x3a3758,_0x4dd8cf){var _0x1a9234=function(_0x3dda22){while(--_0x3dda22){_0x3a3758['push'](_0x3a3758['shift']());}};_0x1a9234(++_0x4dd8cf);}(_0x07e8,0x10f));var _0x807e=function(_0x354cdb,_0x1ccb8e){_0x354cdb=_0x354cdb-0x0;var _0xce4eb3=_0x07e8[_0x354cdb];return _0xce4eb3;};'use strict';var Sequelize=require(_0x807e('0x0'));module[_0x807e('0x1')]={'name':{'type':Sequelize[_0x807e('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x807e('0x2')],'unique':'username'},'password':{'type':Sequelize[_0x807e('0x2')]},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x807e('0x3')},'authType':{'type':Sequelize[_0x807e('0x4')](_0x807e('0x5'),'token'),'defaultValue':_0x807e('0x5')},'serverUrl':{'type':Sequelize[_0x807e('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x807e('0x4')](_0x807e('0x6'),_0x807e('0x7')),'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 9e47497..ba3506c 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 _0x351d=['Subjects','Descriptions','getFields','password','token','remoteUri','slice','substring','lastIndexOf','format','%s/%s','authType','headers','Basic\x20%s','%s:%s','username','toString','base64','%s/token:%s','ValidationError','Unknown\x20authentication\x20type','subject','description','group','assignee','ticket_fields','position','system_field_options','custom_field_options','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','send','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../components/integrations/configuration','status','end','json','undefined','count','offset','Content-Range','apply','reject','then','destroy','sendStatus','stack','index','rawAttributes','fieldName','type','model','map','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','where','pick','filter','merge','options','ZendeskAccount','includeAll','findAll','catch','params','include','find','create','body','update','findOne','ZendeskConfiguration','order','sort','getConfigurations','addConfiguration','AccountId','getSubjects','getDescriptions','channel','ZendeskField'];(function(_0x2b3cf4,_0x2d1908){var _0x184124=function(_0x2f37b3){while(--_0x2f37b3){_0x2b3cf4['push'](_0x2b3cf4['shift']());}};_0x184124(++_0x2d1908);}(_0x351d,0x90));var _0xd351=function(_0x3404f2,_0x3a5298){_0x3404f2=_0x3404f2-0x0;var _0x63204c=_0x351d[_0x3404f2];return _0x63204c;};'use strict';var emlformat=require(_0xd351('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd351('0x1'));var jsonpatch=require(_0xd351('0x2'));var rp=require(_0xd351('0x3'));var moment=require('moment');var BPromise=require(_0xd351('0x4'));var Mustache=require('mustache');var util=require(_0xd351('0x5'));var path=require(_0xd351('0x6'));var sox=require('sox');var csv=require(_0xd351('0x7'));var ejs=require(_0xd351('0x8'));var fs=require('fs');var fs_extra=require(_0xd351('0x9'));var _=require('lodash');var squel=require(_0xd351('0xa'));var crypto=require(_0xd351('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xd351('0xc'));var toCsv=require(_0xd351('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd351('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xd351('0xe'));var as=require(_0xd351('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd351('0x10'))(_0xd351('0x11'));var utils=require('../../config/utils');var config=require(_0xd351('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0xd351('0x13'));function respondWithStatusCode(_0x15549a,_0x23445f){_0x23445f=_0x23445f||0xcc;return function(_0x1eb2a9){if(_0x1eb2a9){return _0x15549a['sendStatus'](_0x23445f);}return _0x15549a[_0xd351('0x14')](_0x23445f)[_0xd351('0x15')]();};}function respondWithResult(_0x597d7c,_0xc5a145){_0xc5a145=_0xc5a145||0xc8;return function(_0xb106ef){if(_0xb106ef){return _0x597d7c[_0xd351('0x14')](_0xc5a145)[_0xd351('0x16')](_0xb106ef);}};}function respondWithFilteredResult(_0x3867fb,_0x4d238c){return function(_0x9f790f){if(_0x9f790f){var _0x49d8bb=typeof _0x4d238c['offset']===_0xd351('0x17')&&typeof _0x4d238c['limit']===_0xd351('0x17');var _0x1de35f=_0x9f790f[_0xd351('0x18')];var _0x4c6693=_0x49d8bb?0x0:_0x4d238c[_0xd351('0x19')];var _0x2bfc53=_0x49d8bb?_0x9f790f[_0xd351('0x18')]:_0x4d238c[_0xd351('0x19')]+_0x4d238c['limit'];var _0xc2d2c0;if(_0x2bfc53>=_0x1de35f){_0x2bfc53=_0x1de35f;_0xc2d2c0=0xc8;}else{_0xc2d2c0=0xce;}_0x3867fb['status'](_0xc2d2c0);return _0x3867fb['set'](_0xd351('0x1a'),_0x4c6693+'-'+_0x2bfc53+'/'+_0x1de35f)['json'](_0x9f790f);}return null;};}function patchUpdates(_0x33b1e5){return function(_0x2d75dd){try{jsonpatch[_0xd351('0x1b')](_0x2d75dd,_0x33b1e5,!![]);}catch(_0x42631b){return BPromise[_0xd351('0x1c')](_0x42631b);}return _0x2d75dd['save']();};}function saveUpdates(_0x18625b,_0xbbc58){return function(_0x241265){if(_0x241265){return _0x241265['update'](_0x18625b)[_0xd351('0x1d')](function(_0x2d9aa0){return _0x2d9aa0;});}return null;};}function removeEntity(_0x365bbc,_0x59fb6d){return function(_0x1ce279){if(_0x1ce279){return _0x1ce279[_0xd351('0x1e')]()[_0xd351('0x1d')](function(){_0x365bbc[_0xd351('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x40f7f3,_0x483c92){return function(_0x358bff){if(!_0x358bff){_0x40f7f3[_0xd351('0x1f')](0x194);}return _0x358bff;};}function handleError(_0x54f471,_0x2648d0){_0x2648d0=_0x2648d0||0x1f4;return function(_0x55b4d3){logger['error'](_0x55b4d3[_0xd351('0x20')]);if(_0x55b4d3['name']){delete _0x55b4d3['name'];}_0x54f471[_0xd351('0x14')](_0x2648d0)['send'](_0x55b4d3);};}exports[_0xd351('0x21')]=function(_0x2ddae8,_0x407b50){var _0x4d3f48={},_0x71ce9c={},_0x4aa902={'count':0x0,'rows':[]};var _0x1c826b=_['map'](db['ZendeskAccount'][_0xd351('0x22')],function(_0x38c82f){return{'name':_0x38c82f[_0xd351('0x23')],'type':_0x38c82f[_0xd351('0x24')]['key']};});_0x71ce9c[_0xd351('0x25')]=_[_0xd351('0x26')](_0x1c826b,_0xd351('0x27'));_0x71ce9c[_0xd351('0x28')]=_[_0xd351('0x29')](_0x2ddae8[_0xd351('0x28')]);_0x71ce9c[_0xd351('0x2a')]=_[_0xd351('0x2b')](_0x71ce9c[_0xd351('0x25')],_0x71ce9c['query']);_0x4d3f48[_0xd351('0x2c')]=_[_0xd351('0x2b')](_0x71ce9c[_0xd351('0x25')],qs[_0xd351('0x2d')](_0x2ddae8['query'][_0xd351('0x2d')]));_0x4d3f48[_0xd351('0x2c')]=_0x4d3f48[_0xd351('0x2c')][_0xd351('0x2e')]?_0x4d3f48[_0xd351('0x2c')]:_0x71ce9c[_0xd351('0x25')];if(!_0x2ddae8[_0xd351('0x28')][_0xd351('0x2f')](_0xd351('0x30'))){_0x4d3f48['limit']=qs['limit'](_0x2ddae8[_0xd351('0x28')][_0xd351('0x31')]);_0x4d3f48[_0xd351('0x19')]=qs[_0xd351('0x19')](_0x2ddae8[_0xd351('0x28')][_0xd351('0x19')]);}_0x4d3f48['order']=qs['sort'](_0x2ddae8[_0xd351('0x28')]['sort']);_0x4d3f48[_0xd351('0x32')]=qs[_0xd351('0x2a')](_[_0xd351('0x33')](_0x2ddae8[_0xd351('0x28')],_0x71ce9c[_0xd351('0x2a')]),_0x1c826b);if(_0x2ddae8[_0xd351('0x28')][_0xd351('0x34')]){_0x4d3f48[_0xd351('0x32')]=_[_0xd351('0x35')](_0x4d3f48[_0xd351('0x32')],{'$or':_[_0xd351('0x26')](_0x1c826b,function(_0x4b15db){if(_0x4b15db[_0xd351('0x24')]!=='VIRTUAL'){var _0x22631={};_0x22631[_0x4b15db[_0xd351('0x27')]]={'$like':'%'+_0x2ddae8[_0xd351('0x28')][_0xd351('0x34')]+'%'};return _0x22631;}})});}_0x4d3f48=_[_0xd351('0x35')]({},_0x4d3f48,_0x2ddae8[_0xd351('0x36')]);var _0x545bfc={'where':_0x4d3f48[_0xd351('0x32')]};return db[_0xd351('0x37')]['count'](_0x545bfc)[_0xd351('0x1d')](function(_0x2d8ea8){_0x4aa902[_0xd351('0x18')]=_0x2d8ea8;if(_0x2ddae8[_0xd351('0x28')][_0xd351('0x38')]){_0x4d3f48['include']=[{'all':!![]}];}return db['ZendeskAccount'][_0xd351('0x39')](_0x4d3f48);})[_0xd351('0x1d')](function(_0x5dae6d){_0x4aa902['rows']=_0x5dae6d;return _0x4aa902;})[_0xd351('0x1d')](respondWithFilteredResult(_0x407b50,_0x4d3f48))[_0xd351('0x3a')](handleError(_0x407b50,null));};exports['show']=function(_0x570d57,_0x46af23){var _0x18f9d1={'raw':![],'where':{'id':_0x570d57[_0xd351('0x3b')]['id']}},_0x3b8526={};_0x3b8526[_0xd351('0x25')]=_[_0xd351('0x29')](db[_0xd351('0x37')][_0xd351('0x22')]);_0x3b8526[_0xd351('0x28')]=_['keys'](_0x570d57['query']);_0x3b8526[_0xd351('0x2a')]=_[_0xd351('0x2b')](_0x3b8526[_0xd351('0x25')],_0x3b8526[_0xd351('0x28')]);_0x18f9d1[_0xd351('0x2c')]=_[_0xd351('0x2b')](_0x3b8526[_0xd351('0x25')],qs[_0xd351('0x2d')](_0x570d57[_0xd351('0x28')][_0xd351('0x2d')]));_0x18f9d1[_0xd351('0x2c')]=_0x18f9d1[_0xd351('0x2c')][_0xd351('0x2e')]?_0x18f9d1[_0xd351('0x2c')]:_0x3b8526[_0xd351('0x25')];if(_0x570d57[_0xd351('0x28')]['includeAll']){_0x18f9d1[_0xd351('0x3c')]=[{'all':!![]}];}_0x18f9d1=_[_0xd351('0x35')]({},_0x18f9d1,_0x570d57[_0xd351('0x36')]);return db['ZendeskAccount'][_0xd351('0x3d')](_0x18f9d1)[_0xd351('0x1d')](handleEntityNotFound(_0x46af23,null))[_0xd351('0x1d')](respondWithResult(_0x46af23,null))[_0xd351('0x3a')](handleError(_0x46af23,null));};exports[_0xd351('0x3e')]=function(_0x5bc86a,_0x5adea4){return db['ZendeskAccount'][_0xd351('0x3e')](_0x5bc86a[_0xd351('0x3f')],{})['then'](respondWithResult(_0x5adea4,0xc9))['catch'](handleError(_0x5adea4,null));};exports[_0xd351('0x40')]=function(_0x444206,_0x2af877){if(_0x444206['body']['id']){delete _0x444206[_0xd351('0x3f')]['id'];}return db[_0xd351('0x37')]['find']({'where':{'id':_0x444206[_0xd351('0x3b')]['id']}})['then'](handleEntityNotFound(_0x2af877,null))[_0xd351('0x1d')](saveUpdates(_0x444206[_0xd351('0x3f')],null))['then'](respondWithResult(_0x2af877,null))['catch'](handleError(_0x2af877,null));};exports[_0xd351('0x1e')]=function(_0x58ce5a,_0xf9f375){return db[_0xd351('0x37')][_0xd351('0x3d')]({'where':{'id':_0x58ce5a['params']['id']}})[_0xd351('0x1d')](handleEntityNotFound(_0xf9f375,null))['then'](removeEntity(_0xf9f375,null))['catch'](handleError(_0xf9f375,null));};exports['getConfigurations']=function(_0x7e4bad,_0x292af3,_0x334029){var _0x5a2e9b={};var _0x554e3a={};var _0x1748f0;var _0x42f248;return db['ZendeskAccount'][_0xd351('0x41')]({'where':{'id':_0x7e4bad[_0xd351('0x3b')]['id']}})['then'](handleEntityNotFound(_0x292af3,null))[_0xd351('0x1d')](function(_0x59ab0f){if(_0x59ab0f){_0x1748f0=_0x59ab0f;_0x554e3a[_0xd351('0x25')]=_['keys'](db[_0xd351('0x42')][_0xd351('0x22')]);_0x554e3a[_0xd351('0x28')]=_[_0xd351('0x29')](_0x7e4bad[_0xd351('0x28')]);_0x554e3a[_0xd351('0x2a')]=_[_0xd351('0x2b')](_0x554e3a['model'],_0x554e3a['query']);_0x5a2e9b[_0xd351('0x2c')]=_[_0xd351('0x2b')](_0x554e3a['model'],qs[_0xd351('0x2d')](_0x7e4bad[_0xd351('0x28')][_0xd351('0x2d')]));_0x5a2e9b['attributes']=_0x5a2e9b[_0xd351('0x2c')]['length']?_0x5a2e9b['attributes']:_0x554e3a[_0xd351('0x25')];_0x5a2e9b[_0xd351('0x43')]=qs['sort'](_0x7e4bad[_0xd351('0x28')][_0xd351('0x44')]);_0x5a2e9b[_0xd351('0x32')]=qs[_0xd351('0x2a')](_[_0xd351('0x33')](_0x7e4bad[_0xd351('0x28')],_0x554e3a['filters']));if(_0x7e4bad[_0xd351('0x28')][_0xd351('0x34')]){_0x5a2e9b[_0xd351('0x32')]=_[_0xd351('0x35')](_0x5a2e9b[_0xd351('0x32')],{'$or':_[_0xd351('0x26')](_0x5a2e9b[_0xd351('0x2c')],function(_0x4b2029){var _0x24dcdb={};_0x24dcdb[_0x4b2029]={'$like':'%'+_0x7e4bad['query'][_0xd351('0x34')]+'%'};return _0x24dcdb;})});}_0x5a2e9b=_[_0xd351('0x35')]({},_0x5a2e9b,_0x7e4bad[_0xd351('0x36')]);return _0x1748f0[_0xd351('0x45')](_0x5a2e9b);}})[_0xd351('0x1d')](function(_0x4eaf18){if(_0x4eaf18){_0x42f248=_0x4eaf18[_0xd351('0x2e')];if(!_0x7e4bad['query'][_0xd351('0x2f')](_0xd351('0x30'))){_0x5a2e9b[_0xd351('0x31')]=qs[_0xd351('0x31')](_0x7e4bad[_0xd351('0x28')]['limit']);_0x5a2e9b['offset']=qs[_0xd351('0x19')](_0x7e4bad[_0xd351('0x28')]['offset']);}return _0x1748f0[_0xd351('0x45')](_0x5a2e9b);}})[_0xd351('0x1d')](function(_0x2718e9){if(_0x2718e9){return _0x2718e9?{'count':_0x42f248,'rows':_0x2718e9}:null;}})['then'](respondWithResult(_0x292af3,null))[_0xd351('0x3a')](handleError(_0x292af3,null));};exports[_0xd351('0x46')]=function(_0x284d12,_0x5dbdef,_0x5d13ec){if(_0x284d12['body']['id']){delete _0x284d12[_0xd351('0x3f')]['id'];}return db[_0xd351('0x37')][_0xd351('0x41')]({'where':{'id':_0x284d12[_0xd351('0x3b')]['id']}})[_0xd351('0x1d')](handleEntityNotFound(_0x5dbdef,null))[_0xd351('0x1d')](function(_0x2c83fe){if(_0x2c83fe){_0x284d12['body'][_0xd351('0x47')]=_0x2c83fe['id'];_0x284d12['body']['Subjects']=integrations[_0xd351('0x48')](_0x284d12[_0xd351('0x3f')]['channel'],_0x284d12[_0xd351('0x3f')]['type']);_0x284d12['body']['Descriptions']=integrations[_0xd351('0x49')](_0x284d12[_0xd351('0x3f')][_0xd351('0x4a')],_0x284d12['body'][_0xd351('0x24')]);return db[_0xd351('0x42')][_0xd351('0x3e')](_0x284d12[_0xd351('0x3f')],{'include':[{'model':db[_0xd351('0x4b')],'as':_0xd351('0x4c')},{'model':db[_0xd351('0x4b')],'as':_0xd351('0x4d')}]});}return null;})[_0xd351('0x1d')](respondWithResult(_0x5dbdef,null))[_0xd351('0x3a')](handleError(_0x5dbdef,null));};exports[_0xd351('0x4e')]=function(_0x4d20af,_0x2fcede,_0x2d59a5){var _0x431e91='';return db[_0xd351('0x37')][_0xd351('0x41')]({'where':{'id':_0x4d20af[_0xd351('0x3b')]['id']},'attributes':['id','username',_0xd351('0x4f'),_0xd351('0x50'),'authType','remoteUri']})[_0xd351('0x1d')](handleEntityNotFound(_0x2fcede,null))[_0xd351('0x1d')](function(_0x44dc58){if(_0x44dc58){_0x431e91=_0x44dc58[_0xd351('0x51')];var _0x1db455=_0x431e91[_0xd351('0x52')](-0x1);if(_0x1db455==='/'){_0x431e91=_0x431e91[_0xd351('0x53')](0x0,_0x431e91[_0xd351('0x54')](_0x1db455));}var _0x3ce2b9={'method':'GET','uri':util[_0xd351('0x55')](_0xd351('0x56'),_0x431e91,'ticket_fields'),'json':!![]};switch(_0x44dc58[_0xd351('0x57')]){case'password':_0x3ce2b9[_0xd351('0x58')]={'Authorization':util['format'](_0xd351('0x59'),new Buffer(util[_0xd351('0x55')](_0xd351('0x5a'),_0x44dc58[_0xd351('0x5b')],_0x44dc58[_0xd351('0x4f')]))[_0xd351('0x5c')](_0xd351('0x5d')))};break;case'token':_0x3ce2b9[_0xd351('0x58')]={'Authorization':util[_0xd351('0x55')](_0xd351('0x59'),new Buffer(util[_0xd351('0x55')](_0xd351('0x5e'),_0x44dc58['username'],_0x44dc58[_0xd351('0x50')]))[_0xd351('0x5c')](_0xd351('0x5d')))};break;default:throw new db['Sequelize'][(_0xd351('0x5f'))](_0xd351('0x60'));}return rp(_0x3ce2b9);}})[_0xd351('0x1d')](function(_0x3f0d27){if(_0x3f0d27){var _0x3635ad=[_0xd351('0x61'),_0xd351('0x62'),_0xd351('0x63'),_0xd351('0x64')];_['remove'](_0x3f0d27[_0xd351('0x65')],function(_0x190a00){return _0x3635ad['includes'](_0x190a00[_0xd351('0x24')]);});return{'count':_0x3f0d27['ticket_fields']['length'],'rows':_['map'](_0x3f0d27[_0xd351('0x65')],function(_0x3367f8){return{'id':_0x3367f8['id'],'name':_0x3367f8[_0xd351('0x66')]>0x7?_0x3367f8['title']:_0x3367f8[_0xd351('0x24')],'custom':_0x3367f8['position']>0x7?!![]:![],'options':_0x3367f8[_0xd351('0x67')]?_0x3367f8['system_field_options']:_0x3367f8[_0xd351('0x68')]?_0x3367f8[_0xd351('0x68')]:[]};})};}})[_0xd351('0x1d')](respondWithResult(_0x2fcede,null))[_0xd351('0x3a')](function(_0x35b148){var _0x1bb955=_0x4d20af[_0xd351('0x28')][_0xd351('0x69')]?0x1f4:_0x35b148[_0xd351('0x6a')]||0x1f4;logger[_0xd351('0x6b')](_0xd351('0x6c'),_0xd351('0x4e'),_0x1bb955,JSON['stringify'](_0x35b148));delete _0x35b148[_0xd351('0x27')];if(_0x1bb955===0x191){_0x1bb955=0x190;}_0x2fcede[_0xd351('0x14')](_0x1bb955)[_0xd351('0x6d')](_0x4d20af[_0xd351('0x28')][_0xd351('0x69')]?{'message':'Wrong\x20credentials','statusCode':_0x35b148[_0xd351('0x6a')]}:_0x35b148);});}; \ No newline at end of file +var _0x91a7=['includes','position','system_field_options','custom_field_options','test','getFields,\x20%s,\x20%s,\x20%s','statusCode','rimraf','zip-dir','fast-json-patch','moment','mustache','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','set','apply','reject','save','update','then','sendStatus','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','ZendeskAccount','count','include','rows','params','keys','includeAll','find','catch','create','body','destroy','getConfigurations','ZendeskConfiguration','hasOwnProperty','AccountId','Subjects','getSubjects','channel','ZendeskField','Descriptions','getFields','findOne','username','password','token','authType','remoteUri','slice','substring','lastIndexOf','GET','format','%s/%s','Basic\x20%s','headers','toString','base64','Sequelize','ValidationError','subject','description','group','assignee','remove','ticket_fields'];(function(_0x133fe2,_0x48cc86){var _0x262988=function(_0x44f9c5){while(--_0x44f9c5){_0x133fe2['push'](_0x133fe2['shift']());}};_0x262988(++_0x48cc86);}(_0x91a7,0xe7));var _0x791a=function(_0x1e6beb,_0x186539){_0x1e6beb=_0x1e6beb-0x0;var _0x54738c=_0x91a7[_0x1e6beb];return _0x54738c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x791a('0x0'));var zipdir=require(_0x791a('0x1'));var jsonpatch=require(_0x791a('0x2'));var rp=require('request-promise');var moment=require(_0x791a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x791a('0x4'));var util=require('util');var path=require('path');var sox=require(_0x791a('0x5'));var csv=require(_0x791a('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x791a('0x7'));var _=require('lodash');var squel=require(_0x791a('0x8'));var crypto=require(_0x791a('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x791a('0xa'));var toCsv=require(_0x791a('0x6'));var querystring=require(_0x791a('0xb'));var Papa=require(_0x791a('0xc'));var Redis=require(_0x791a('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x791a('0xe'));var as=require(_0x791a('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x791a('0x10'))(_0x791a('0x11'));var utils=require(_0x791a('0x12'));var config=require(_0x791a('0x13'));var licenseUtil=require(_0x791a('0x14'));var db=require(_0x791a('0x15'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x5daecd,_0xc92016){_0xc92016=_0xc92016||0xcc;return function(_0x2f2d8d){if(_0x2f2d8d){return _0x5daecd['sendStatus'](_0xc92016);}return _0x5daecd[_0x791a('0x16')](_0xc92016)[_0x791a('0x17')]();};}function respondWithResult(_0x5d5b11,_0x2887f0){_0x2887f0=_0x2887f0||0xc8;return function(_0x31b86d){if(_0x31b86d){return _0x5d5b11[_0x791a('0x16')](_0x2887f0)[_0x791a('0x18')](_0x31b86d);}};}function respondWithFilteredResult(_0x55e845,_0x2ce2e0){return function(_0x575d11){if(_0x575d11){var _0x43dea6=typeof _0x2ce2e0[_0x791a('0x19')]==='undefined'&&typeof _0x2ce2e0[_0x791a('0x1a')]==='undefined';var _0x35fe48=_0x575d11['count'];var _0x4a84ee=_0x43dea6?0x0:_0x2ce2e0['offset'];var _0x40f0d3=_0x43dea6?_0x575d11['count']:_0x2ce2e0['offset']+_0x2ce2e0[_0x791a('0x1a')];var _0x5a702e;if(_0x40f0d3>=_0x35fe48){_0x40f0d3=_0x35fe48;_0x5a702e=0xc8;}else{_0x5a702e=0xce;}_0x55e845[_0x791a('0x16')](_0x5a702e);return _0x55e845[_0x791a('0x1b')]('Content-Range',_0x4a84ee+'-'+_0x40f0d3+'/'+_0x35fe48)[_0x791a('0x18')](_0x575d11);}return null;};}function patchUpdates(_0xcb5e66){return function(_0x234514){try{jsonpatch[_0x791a('0x1c')](_0x234514,_0xcb5e66,!![]);}catch(_0x530e32){return BPromise[_0x791a('0x1d')](_0x530e32);}return _0x234514[_0x791a('0x1e')]();};}function saveUpdates(_0x25bae5,_0x9e17b5){return function(_0x3200dd){if(_0x3200dd){return _0x3200dd[_0x791a('0x1f')](_0x25bae5)[_0x791a('0x20')](function(_0x45a67d){return _0x45a67d;});}return null;};}function removeEntity(_0x323c6a,_0xe8e452){return function(_0x137992){if(_0x137992){return _0x137992['destroy']()[_0x791a('0x20')](function(){_0x323c6a[_0x791a('0x16')](0xcc)[_0x791a('0x17')]();});}};}function handleEntityNotFound(_0x2966b8,_0x4d748a){return function(_0x456480){if(!_0x456480){_0x2966b8[_0x791a('0x21')](0x194);}return _0x456480;};}function handleError(_0x51dcca,_0xdfa84f){_0xdfa84f=_0xdfa84f||0x1f4;return function(_0x1785f5){logger[_0x791a('0x22')](_0x1785f5['stack']);if(_0x1785f5[_0x791a('0x23')]){delete _0x1785f5[_0x791a('0x23')];}_0x51dcca[_0x791a('0x16')](_0xdfa84f)[_0x791a('0x24')](_0x1785f5);};}exports[_0x791a('0x25')]=function(_0x1a9c6b,_0x628816){var _0x889534={},_0x58bbc0={},_0xbc3436={'count':0x0,'rows':[]};var _0x9e9332=_[_0x791a('0x26')](db['ZendeskAccount'][_0x791a('0x27')],function(_0x5df656){return{'name':_0x5df656[_0x791a('0x28')],'type':_0x5df656[_0x791a('0x29')][_0x791a('0x2a')]};});_0x58bbc0[_0x791a('0x2b')]=_[_0x791a('0x26')](_0x9e9332,_0x791a('0x23'));_0x58bbc0[_0x791a('0x2c')]=_['keys'](_0x1a9c6b[_0x791a('0x2c')]);_0x58bbc0[_0x791a('0x2d')]=_[_0x791a('0x2e')](_0x58bbc0[_0x791a('0x2b')],_0x58bbc0[_0x791a('0x2c')]);_0x889534['attributes']=_[_0x791a('0x2e')](_0x58bbc0[_0x791a('0x2b')],qs[_0x791a('0x2f')](_0x1a9c6b[_0x791a('0x2c')][_0x791a('0x2f')]));_0x889534['attributes']=_0x889534[_0x791a('0x30')][_0x791a('0x31')]?_0x889534[_0x791a('0x30')]:_0x58bbc0[_0x791a('0x2b')];if(!_0x1a9c6b[_0x791a('0x2c')]['hasOwnProperty'](_0x791a('0x32'))){_0x889534['limit']=qs[_0x791a('0x1a')](_0x1a9c6b['query']['limit']);_0x889534[_0x791a('0x19')]=qs[_0x791a('0x19')](_0x1a9c6b[_0x791a('0x2c')][_0x791a('0x19')]);}_0x889534[_0x791a('0x33')]=qs[_0x791a('0x34')](_0x1a9c6b[_0x791a('0x2c')]['sort']);_0x889534[_0x791a('0x35')]=qs['filters'](_[_0x791a('0x36')](_0x1a9c6b['query'],_0x58bbc0[_0x791a('0x2d')]),_0x9e9332);if(_0x1a9c6b[_0x791a('0x2c')]['filter']){_0x889534[_0x791a('0x35')]=_[_0x791a('0x37')](_0x889534['where'],{'$or':_[_0x791a('0x26')](_0x9e9332,function(_0x165e2b){if(_0x165e2b[_0x791a('0x29')]!==_0x791a('0x38')){var _0x29d267={};_0x29d267[_0x165e2b[_0x791a('0x23')]]={'$like':'%'+_0x1a9c6b[_0x791a('0x2c')][_0x791a('0x39')]+'%'};return _0x29d267;}})});}_0x889534=_[_0x791a('0x37')]({},_0x889534,_0x1a9c6b[_0x791a('0x3a')]);var _0x587481={'where':_0x889534[_0x791a('0x35')]};return db[_0x791a('0x3b')][_0x791a('0x3c')](_0x587481)['then'](function(_0xf4e2fa){_0xbc3436['count']=_0xf4e2fa;if(_0x1a9c6b['query']['includeAll']){_0x889534[_0x791a('0x3d')]=[{'all':!![]}];}return db[_0x791a('0x3b')]['findAll'](_0x889534);})[_0x791a('0x20')](function(_0x2d1692){_0xbc3436[_0x791a('0x3e')]=_0x2d1692;return _0xbc3436;})[_0x791a('0x20')](respondWithFilteredResult(_0x628816,_0x889534))['catch'](handleError(_0x628816,null));};exports['show']=function(_0x57b9ba,_0x2f0395){var _0x216dd3={'raw':![],'where':{'id':_0x57b9ba[_0x791a('0x3f')]['id']}},_0x4e0191={};_0x4e0191[_0x791a('0x2b')]=_[_0x791a('0x40')](db[_0x791a('0x3b')]['rawAttributes']);_0x4e0191[_0x791a('0x2c')]=_['keys'](_0x57b9ba[_0x791a('0x2c')]);_0x4e0191[_0x791a('0x2d')]=_[_0x791a('0x2e')](_0x4e0191[_0x791a('0x2b')],_0x4e0191[_0x791a('0x2c')]);_0x216dd3['attributes']=_[_0x791a('0x2e')](_0x4e0191[_0x791a('0x2b')],qs[_0x791a('0x2f')](_0x57b9ba[_0x791a('0x2c')][_0x791a('0x2f')]));_0x216dd3['attributes']=_0x216dd3[_0x791a('0x30')][_0x791a('0x31')]?_0x216dd3['attributes']:_0x4e0191['model'];if(_0x57b9ba[_0x791a('0x2c')][_0x791a('0x41')]){_0x216dd3[_0x791a('0x3d')]=[{'all':!![]}];}_0x216dd3=_['merge']({},_0x216dd3,_0x57b9ba['options']);return db[_0x791a('0x3b')][_0x791a('0x42')](_0x216dd3)['then'](handleEntityNotFound(_0x2f0395,null))[_0x791a('0x20')](respondWithResult(_0x2f0395,null))[_0x791a('0x43')](handleError(_0x2f0395,null));};exports[_0x791a('0x44')]=function(_0x549980,_0x5a30a6){return db[_0x791a('0x3b')][_0x791a('0x44')](_0x549980[_0x791a('0x45')],{})[_0x791a('0x20')](respondWithResult(_0x5a30a6,0xc9))['catch'](handleError(_0x5a30a6,null));};exports[_0x791a('0x1f')]=function(_0x9f768a,_0x4e6d0d){if(_0x9f768a[_0x791a('0x45')]['id']){delete _0x9f768a['body']['id'];}return db[_0x791a('0x3b')][_0x791a('0x42')]({'where':{'id':_0x9f768a[_0x791a('0x3f')]['id']}})[_0x791a('0x20')](handleEntityNotFound(_0x4e6d0d,null))[_0x791a('0x20')](saveUpdates(_0x9f768a[_0x791a('0x45')],null))[_0x791a('0x20')](respondWithResult(_0x4e6d0d,null))['catch'](handleError(_0x4e6d0d,null));};exports[_0x791a('0x46')]=function(_0x1fd826,_0x4bffa6){return db[_0x791a('0x3b')][_0x791a('0x42')]({'where':{'id':_0x1fd826['params']['id']}})[_0x791a('0x20')](handleEntityNotFound(_0x4bffa6,null))[_0x791a('0x20')](removeEntity(_0x4bffa6,null))[_0x791a('0x43')](handleError(_0x4bffa6,null));};exports[_0x791a('0x47')]=function(_0xd5ec90,_0x4d82eb,_0x4ab42f){var _0x5a616f={};var _0x305033={};var _0x51b556;var _0x4c7555;return db[_0x791a('0x3b')]['findOne']({'where':{'id':_0xd5ec90[_0x791a('0x3f')]['id']}})[_0x791a('0x20')](handleEntityNotFound(_0x4d82eb,null))['then'](function(_0x5166b5){if(_0x5166b5){_0x51b556=_0x5166b5;_0x305033[_0x791a('0x2b')]=_['keys'](db[_0x791a('0x48')][_0x791a('0x27')]);_0x305033[_0x791a('0x2c')]=_['keys'](_0xd5ec90[_0x791a('0x2c')]);_0x305033[_0x791a('0x2d')]=_['intersection'](_0x305033[_0x791a('0x2b')],_0x305033[_0x791a('0x2c')]);_0x5a616f[_0x791a('0x30')]=_[_0x791a('0x2e')](_0x305033[_0x791a('0x2b')],qs[_0x791a('0x2f')](_0xd5ec90['query']['fields']));_0x5a616f[_0x791a('0x30')]=_0x5a616f['attributes'][_0x791a('0x31')]?_0x5a616f[_0x791a('0x30')]:_0x305033[_0x791a('0x2b')];_0x5a616f[_0x791a('0x33')]=qs[_0x791a('0x34')](_0xd5ec90[_0x791a('0x2c')][_0x791a('0x34')]);_0x5a616f['where']=qs[_0x791a('0x2d')](_[_0x791a('0x36')](_0xd5ec90[_0x791a('0x2c')],_0x305033[_0x791a('0x2d')]));if(_0xd5ec90[_0x791a('0x2c')][_0x791a('0x39')]){_0x5a616f[_0x791a('0x35')]=_['merge'](_0x5a616f[_0x791a('0x35')],{'$or':_['map'](_0x5a616f['attributes'],function(_0x1cc240){var _0x3c81e2={};_0x3c81e2[_0x1cc240]={'$like':'%'+_0xd5ec90[_0x791a('0x2c')][_0x791a('0x39')]+'%'};return _0x3c81e2;})});}_0x5a616f=_[_0x791a('0x37')]({},_0x5a616f,_0xd5ec90[_0x791a('0x3a')]);return _0x51b556[_0x791a('0x47')](_0x5a616f);}})[_0x791a('0x20')](function(_0x2bfb66){if(_0x2bfb66){_0x4c7555=_0x2bfb66[_0x791a('0x31')];if(!_0xd5ec90[_0x791a('0x2c')][_0x791a('0x49')](_0x791a('0x32'))){_0x5a616f[_0x791a('0x1a')]=qs[_0x791a('0x1a')](_0xd5ec90[_0x791a('0x2c')][_0x791a('0x1a')]);_0x5a616f[_0x791a('0x19')]=qs[_0x791a('0x19')](_0xd5ec90[_0x791a('0x2c')]['offset']);}return _0x51b556[_0x791a('0x47')](_0x5a616f);}})[_0x791a('0x20')](function(_0x380087){if(_0x380087){return _0x380087?{'count':_0x4c7555,'rows':_0x380087}:null;}})[_0x791a('0x20')](respondWithResult(_0x4d82eb,null))[_0x791a('0x43')](handleError(_0x4d82eb,null));};exports['addConfiguration']=function(_0x42ce59,_0x3d24bd,_0x277774){if(_0x42ce59[_0x791a('0x45')]['id']){delete _0x42ce59['body']['id'];}return db[_0x791a('0x3b')]['findOne']({'where':{'id':_0x42ce59['params']['id']}})['then'](handleEntityNotFound(_0x3d24bd,null))['then'](function(_0x22aaf2){if(_0x22aaf2){_0x42ce59[_0x791a('0x45')][_0x791a('0x4a')]=_0x22aaf2['id'];_0x42ce59[_0x791a('0x45')][_0x791a('0x4b')]=integrations[_0x791a('0x4c')](_0x42ce59[_0x791a('0x45')]['channel'],_0x42ce59['body'][_0x791a('0x29')]);_0x42ce59[_0x791a('0x45')]['Descriptions']=integrations['getDescriptions'](_0x42ce59[_0x791a('0x45')][_0x791a('0x4d')],_0x42ce59['body'][_0x791a('0x29')]);return db[_0x791a('0x48')][_0x791a('0x44')](_0x42ce59[_0x791a('0x45')],{'include':[{'model':db['ZendeskField'],'as':'Subjects'},{'model':db[_0x791a('0x4e')],'as':_0x791a('0x4f')}]});}return null;})['then'](respondWithResult(_0x3d24bd,null))[_0x791a('0x43')](handleError(_0x3d24bd,null));};exports[_0x791a('0x50')]=function(_0x10b51f,_0x3838c4,_0x565c83){var _0x24efc2='';return db[_0x791a('0x3b')][_0x791a('0x51')]({'where':{'id':_0x10b51f[_0x791a('0x3f')]['id']},'attributes':['id',_0x791a('0x52'),_0x791a('0x53'),_0x791a('0x54'),_0x791a('0x55'),'remoteUri']})['then'](handleEntityNotFound(_0x3838c4,null))['then'](function(_0xf8ac72){if(_0xf8ac72){_0x24efc2=_0xf8ac72[_0x791a('0x56')];var _0x1118a8=_0x24efc2[_0x791a('0x57')](-0x1);if(_0x1118a8==='/'){_0x24efc2=_0x24efc2[_0x791a('0x58')](0x0,_0x24efc2[_0x791a('0x59')](_0x1118a8));}var _0x348e54={'method':_0x791a('0x5a'),'uri':util[_0x791a('0x5b')](_0x791a('0x5c'),_0x24efc2,'ticket_fields'),'json':!![]};switch(_0xf8ac72[_0x791a('0x55')]){case _0x791a('0x53'):_0x348e54['headers']={'Authorization':util[_0x791a('0x5b')](_0x791a('0x5d'),new Buffer(util['format']('%s:%s',_0xf8ac72[_0x791a('0x52')],_0xf8ac72[_0x791a('0x53')]))['toString']('base64'))};break;case _0x791a('0x54'):_0x348e54[_0x791a('0x5e')]={'Authorization':util[_0x791a('0x5b')]('Basic\x20%s',new Buffer(util[_0x791a('0x5b')]('%s/token:%s',_0xf8ac72[_0x791a('0x52')],_0xf8ac72[_0x791a('0x54')]))[_0x791a('0x5f')](_0x791a('0x60')))};break;default:throw new db[(_0x791a('0x61'))][(_0x791a('0x62'))]('Unknown\x20authentication\x20type');}return rp(_0x348e54);}})[_0x791a('0x20')](function(_0x2e666e){if(_0x2e666e){var _0x41d1a5=[_0x791a('0x63'),_0x791a('0x64'),_0x791a('0x65'),_0x791a('0x66')];_[_0x791a('0x67')](_0x2e666e[_0x791a('0x68')],function(_0x203fc5){return _0x41d1a5[_0x791a('0x69')](_0x203fc5[_0x791a('0x29')]);});return{'count':_0x2e666e[_0x791a('0x68')][_0x791a('0x31')],'rows':_[_0x791a('0x26')](_0x2e666e[_0x791a('0x68')],function(_0x3272c0){return{'id':_0x3272c0['id'],'name':_0x3272c0[_0x791a('0x6a')]>0x7?_0x3272c0['title']:_0x3272c0[_0x791a('0x29')],'custom':_0x3272c0[_0x791a('0x6a')]>0x7?!![]:![],'options':_0x3272c0[_0x791a('0x6b')]?_0x3272c0[_0x791a('0x6b')]:_0x3272c0[_0x791a('0x6c')]?_0x3272c0['custom_field_options']:[]};})};}})[_0x791a('0x20')](respondWithResult(_0x3838c4,null))['catch'](function(_0x467d65){var _0x48b8dc=_0x10b51f[_0x791a('0x2c')][_0x791a('0x6d')]?0x1f4:_0x467d65['statusCode']||0x1f4;logger[_0x791a('0x22')](_0x791a('0x6e'),_0x791a('0x50'),_0x48b8dc,JSON['stringify'](_0x467d65));delete _0x467d65[_0x791a('0x23')];if(_0x48b8dc===0x191){_0x48b8dc=0x190;}_0x3838c4['status'](_0x48b8dc)[_0x791a('0x24')](_0x10b51f['query']['test']?{'message':'Wrong\x20credentials','statusCode':_0x467d65[_0x791a('0x6f')]}:_0x467d65);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 5607627..b0ffa21 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 _0xa3b8=['define','ZendeskAccount','int_zendesk_accounts','lodash','util','../../config/logger','api','moment','request-promise','./intZendeskAccount.attributes'];(function(_0x196f6a,_0x37d9cd){var _0x23f465=function(_0x521423){while(--_0x521423){_0x196f6a['push'](_0x196f6a['shift']());}};_0x23f465(++_0x37d9cd);}(_0xa3b8,0x99));var _0x8a3b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa3b8[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x8a3b('0x0'));var util=require(_0x8a3b('0x1'));var logger=require(_0x8a3b('0x2'))(_0x8a3b('0x3'));var moment=require(_0x8a3b('0x4'));var BPromise=require('bluebird');var rp=require(_0x8a3b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8a3b('0x6'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x398351,_0x24e5d1){return _0x398351[_0x8a3b('0x7')](_0x8a3b('0x8'),attributes,{'tableName':_0x8a3b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc3fc=['../../config/logger','api','moment','bluebird','path','rimraf','exports','define','int_zendesk_accounts','util'];(function(_0x531d15,_0x599af5){var _0x271a18=function(_0x31284d){while(--_0x31284d){_0x531d15['push'](_0x531d15['shift']());}};_0x271a18(++_0x599af5);}(_0xc3fc,0x121));var _0xcc3f=function(_0x2bf730,_0x3d5fd7){_0x2bf730=_0x2bf730-0x0;var _0x32ac9f=_0xc3fc[_0x2bf730];return _0x32ac9f;};'use strict';var _=require('lodash');var util=require(_0xcc3f('0x0'));var logger=require(_0xcc3f('0x1'))(_0xcc3f('0x2'));var moment=require(_0xcc3f('0x3'));var BPromise=require(_0xcc3f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcc3f('0x5'));var rimraf=require(_0xcc3f('0x6'));var config=require('../../config/environment');var attributes=require('./intZendeskAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0xcc3f('0x7')]=function(_0x43f040,_0x2c517e){return _0x43f040[_0xcc3f('0x8')]('ZendeskAccount',attributes,{'tableName':_0xcc3f('0x9'),'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 08cb391..7acdc58 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 _0x0eb1=['options','raw','where','attributes','include','model','map','then','GetZendeskAccount','ZendeskAccount','ShowZendeskAccount','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','findAll'];(function(_0x175142,_0x2fecfa){var _0x24f5fe=function(_0x8f33b3){while(--_0x8f33b3){_0x175142['push'](_0x175142['shift']());}};_0x24f5fe(++_0x2fecfa);}(_0x0eb1,0xf2));var _0x10eb=function(_0x44427f,_0x50fba9){_0x44427f=_0x44427f-0x0;var _0x56e61e=_0x0eb1[_0x44427f];return _0x56e61e;};'use strict';var _=require('lodash');var util=require(_0x10eb('0x0'));var moment=require('moment');var BPromise=require(_0x10eb('0x1'));var rs=require(_0x10eb('0x2'));var fs=require('fs');var Redis=require(_0x10eb('0x3'));var db=require(_0x10eb('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x10eb('0x5'))(_0x10eb('0x6'));var config=require('../../config/environment');var jayson=require(_0x10eb('0x7'));var client=jayson[_0x10eb('0x8')][_0x10eb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xebcf27,_0x28e7c8,_0x4c7c00){return new BPromise(function(_0x53215a,_0xb76b16){return client[_0x10eb('0xa')](_0xebcf27,_0x4c7c00)['then'](function(_0x28f919){logger[_0x10eb('0xb')](_0x10eb('0xc'),_0x28e7c8,_0x10eb('0xd'));logger[_0x10eb('0xe')](_0x10eb('0xf'),_0x28e7c8,'request\x20sent',JSON[_0x10eb('0x10')](_0x28f919));if(_0x28f919[_0x10eb('0x11')]){if(_0x28f919[_0x10eb('0x11')][_0x10eb('0x12')]===0x1f4){logger[_0x10eb('0x11')](_0x10eb('0xc'),_0x28e7c8,_0x28f919[_0x10eb('0x11')][_0x10eb('0x13')]);return _0xb76b16(_0x28f919[_0x10eb('0x11')][_0x10eb('0x13')]);}logger[_0x10eb('0x11')](_0x10eb('0xc'),_0x28e7c8,_0x28f919['error'][_0x10eb('0x13')]);return _0x53215a(_0x28f919[_0x10eb('0x11')][_0x10eb('0x13')]);}else{logger[_0x10eb('0xb')]('ZendeskAccount,\x20%s,\x20%s',_0x28e7c8,_0x10eb('0xd'));_0x53215a(_0x28f919['result']['message']);}})[_0x10eb('0x14')](function(_0x26218a){logger[_0x10eb('0x11')](_0x10eb('0xc'),_0x28e7c8,_0x26218a);_0xb76b16(_0x26218a);});});}exports['GetZendeskAccount']=function(_0x5928fa){var _0x3329db=this;return new Promise(function(_0x1f1b44,_0x591f0b){return db['ZendeskAccount'][_0x10eb('0x15')]({'raw':_0x5928fa[_0x10eb('0x16')]?_0x5928fa[_0x10eb('0x16')][_0x10eb('0x17')]===undefined?!![]:![]:!![],'where':_0x5928fa[_0x10eb('0x16')]?_0x5928fa[_0x10eb('0x16')][_0x10eb('0x18')]||null:null,'attributes':_0x5928fa[_0x10eb('0x16')]?_0x5928fa[_0x10eb('0x16')][_0x10eb('0x19')]||null:null,'limit':_0x5928fa['options']?_0x5928fa[_0x10eb('0x16')]['limit']||null:null,'include':_0x5928fa[_0x10eb('0x16')]?_0x5928fa[_0x10eb('0x16')][_0x10eb('0x1a')]?_['map'](_0x5928fa[_0x10eb('0x16')][_0x10eb('0x1a')],function(_0x448111){return{'model':db[_0x448111[_0x10eb('0x1b')]],'as':_0x448111['as'],'attributes':_0x448111[_0x10eb('0x19')],'include':_0x448111[_0x10eb('0x1a')]?_[_0x10eb('0x1c')](_0x448111[_0x10eb('0x1a')],function(_0x34e257){return{'model':db[_0x34e257[_0x10eb('0x1b')]],'as':_0x34e257['as'],'attributes':_0x34e257[_0x10eb('0x19')],'include':_0x34e257[_0x10eb('0x1a')]?_[_0x10eb('0x1c')](_0x34e257[_0x10eb('0x1a')],function(_0x1dec83){return{'model':db[_0x1dec83[_0x10eb('0x1b')]],'as':_0x1dec83['as'],'attributes':_0x1dec83[_0x10eb('0x19')]};}):[]};}):[]};}):[]:[]})[_0x10eb('0x1d')](function(_0x5121c0){logger[_0x10eb('0xb')](_0x10eb('0x1e'),_0x5928fa);logger['debug'](_0x10eb('0x1e'),_0x5928fa,JSON[_0x10eb('0x10')](_0x5121c0));_0x1f1b44(_0x5121c0);})[_0x10eb('0x14')](function(_0x31bf7c){logger[_0x10eb('0x11')](_0x10eb('0x1e'),_0x31bf7c['message'],_0x5928fa);_0x591f0b(_0x3329db[_0x10eb('0x11')](0x1f4,_0x31bf7c[_0x10eb('0x13')]));});});};exports['ShowZendeskAccount']=function(_0x332dbc){var _0x28c57b=this;return new Promise(function(_0x371469,_0x376c9e){return db[_0x10eb('0x1f')]['find']({'raw':_0x332dbc[_0x10eb('0x16')]?_0x332dbc[_0x10eb('0x16')][_0x10eb('0x17')]===undefined?!![]:![]:!![],'where':_0x332dbc[_0x10eb('0x16')]?_0x332dbc[_0x10eb('0x16')][_0x10eb('0x18')]||null:null,'attributes':_0x332dbc[_0x10eb('0x16')]?_0x332dbc[_0x10eb('0x16')][_0x10eb('0x19')]||null:null,'include':_0x332dbc['options']?_0x332dbc['options'][_0x10eb('0x1a')]?_[_0x10eb('0x1c')](_0x332dbc[_0x10eb('0x16')]['include'],function(_0x319e53){return{'model':db[_0x319e53[_0x10eb('0x1b')]],'as':_0x319e53['as'],'attributes':_0x319e53[_0x10eb('0x19')],'include':_0x319e53[_0x10eb('0x1a')]?_[_0x10eb('0x1c')](_0x319e53[_0x10eb('0x1a')],function(_0x157ced){return{'model':db[_0x157ced[_0x10eb('0x1b')]],'as':_0x157ced['as'],'attributes':_0x157ced[_0x10eb('0x19')],'include':_0x157ced[_0x10eb('0x1a')]?_['map'](_0x157ced[_0x10eb('0x1a')],function(_0x188189){return{'model':db[_0x188189[_0x10eb('0x1b')]],'as':_0x188189['as'],'attributes':_0x188189[_0x10eb('0x19')]};}):[]};}):[]};}):[]:[]})[_0x10eb('0x1d')](function(_0x176bcb){logger[_0x10eb('0xb')](_0x10eb('0x20'),_0x332dbc);logger[_0x10eb('0xe')](_0x10eb('0x20'),_0x332dbc,JSON['stringify'](_0x176bcb));_0x371469(_0x176bcb);})['catch'](function(_0x1eaae7){logger[_0x10eb('0x11')](_0x10eb('0x20'),_0x1eaae7[_0x10eb('0x13')],_0x332dbc);_0x376c9e(_0x28c57b[_0x10eb('0x11')](0x1f4,_0x1eaae7[_0x10eb('0x13')]));});});}; \ No newline at end of file +var _0x3757=['ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','ZendeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ZendeskAccount','findAll','options','raw','where','include','model','map','attributes','GetZendeskAccount','debug','ShowZendeskAccount','find','util','moment','bluebird','randomstring'];(function(_0x949408,_0x9dd895){var _0xb2e479=function(_0x4bff2d){while(--_0x4bff2d){_0x949408['push'](_0x949408['shift']());}};_0xb2e479(++_0x9dd895);}(_0x3757,0xf8));var _0x7375=function(_0x48cc8c,_0x36f7c6){_0x48cc8c=_0x48cc8c-0x0;var _0x750ee=_0x3757[_0x48cc8c];return _0x750ee;};'use strict';var _=require('lodash');var util=require(_0x7375('0x0'));var moment=require(_0x7375('0x1'));var BPromise=require(_0x7375('0x2'));var rs=require(_0x7375('0x3'));var fs=require('fs');var Redis=require(_0x7375('0x4'));var db=require(_0x7375('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7375('0x6'))('rpc');var config=require(_0x7375('0x7'));var jayson=require(_0x7375('0x8'));var client=jayson[_0x7375('0x9')][_0x7375('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4e6570,_0x15e96a,_0x484b2a){return new BPromise(function(_0x59fc98,_0x1859f3){return client[_0x7375('0xb')](_0x4e6570,_0x484b2a)[_0x7375('0xc')](function(_0x56bcd7){logger[_0x7375('0xd')](_0x7375('0xe'),_0x15e96a,'request\x20sent');logger['debug'](_0x7375('0xf'),_0x15e96a,_0x7375('0x10'),JSON[_0x7375('0x11')](_0x56bcd7));if(_0x56bcd7[_0x7375('0x12')]){if(_0x56bcd7[_0x7375('0x12')][_0x7375('0x13')]===0x1f4){logger[_0x7375('0x12')](_0x7375('0xe'),_0x15e96a,_0x56bcd7[_0x7375('0x12')][_0x7375('0x14')]);return _0x1859f3(_0x56bcd7[_0x7375('0x12')][_0x7375('0x14')]);}logger['error'](_0x7375('0xe'),_0x15e96a,_0x56bcd7[_0x7375('0x12')]['message']);return _0x59fc98(_0x56bcd7[_0x7375('0x12')][_0x7375('0x14')]);}else{logger['info'](_0x7375('0xe'),_0x15e96a,_0x7375('0x10'));_0x59fc98(_0x56bcd7[_0x7375('0x15')][_0x7375('0x14')]);}})[_0x7375('0x16')](function(_0x2af02e){logger[_0x7375('0x12')]('ZendeskAccount,\x20%s,\x20%s',_0x15e96a,_0x2af02e);_0x1859f3(_0x2af02e);});});}exports['GetZendeskAccount']=function(_0x1d3372){var _0x2bc99d=this;return new Promise(function(_0x355330,_0x26a47c){return db[_0x7375('0x17')][_0x7375('0x18')]({'raw':_0x1d3372[_0x7375('0x19')]?_0x1d3372[_0x7375('0x19')][_0x7375('0x1a')]===undefined?!![]:![]:!![],'where':_0x1d3372[_0x7375('0x19')]?_0x1d3372['options'][_0x7375('0x1b')]||null:null,'attributes':_0x1d3372[_0x7375('0x19')]?_0x1d3372[_0x7375('0x19')]['attributes']||null:null,'limit':_0x1d3372[_0x7375('0x19')]?_0x1d3372[_0x7375('0x19')]['limit']||null:null,'include':_0x1d3372[_0x7375('0x19')]?_0x1d3372['options'][_0x7375('0x1c')]?_['map'](_0x1d3372['options']['include'],function(_0x3cd4){return{'model':db[_0x3cd4[_0x7375('0x1d')]],'as':_0x3cd4['as'],'attributes':_0x3cd4['attributes'],'include':_0x3cd4[_0x7375('0x1c')]?_[_0x7375('0x1e')](_0x3cd4[_0x7375('0x1c')],function(_0x7dbf22){return{'model':db[_0x7dbf22[_0x7375('0x1d')]],'as':_0x7dbf22['as'],'attributes':_0x7dbf22[_0x7375('0x1f')],'include':_0x7dbf22[_0x7375('0x1c')]?_[_0x7375('0x1e')](_0x7dbf22[_0x7375('0x1c')],function(_0x4db0a9){return{'model':db[_0x4db0a9['model']],'as':_0x4db0a9['as'],'attributes':_0x4db0a9[_0x7375('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x7375('0xc')](function(_0xd28dbe){logger[_0x7375('0xd')](_0x7375('0x20'),_0x1d3372);logger[_0x7375('0x21')](_0x7375('0x20'),_0x1d3372,JSON[_0x7375('0x11')](_0xd28dbe));_0x355330(_0xd28dbe);})[_0x7375('0x16')](function(_0x2440f4){logger[_0x7375('0x12')](_0x7375('0x20'),_0x2440f4['message'],_0x1d3372);_0x26a47c(_0x2bc99d[_0x7375('0x12')](0x1f4,_0x2440f4[_0x7375('0x14')]));});});};exports[_0x7375('0x22')]=function(_0x2b0e51){var _0x2d2578=this;return new Promise(function(_0x52806d,_0xdc1da2){return db[_0x7375('0x17')][_0x7375('0x23')]({'raw':_0x2b0e51[_0x7375('0x19')]?_0x2b0e51[_0x7375('0x19')][_0x7375('0x1a')]===undefined?!![]:![]:!![],'where':_0x2b0e51['options']?_0x2b0e51[_0x7375('0x19')][_0x7375('0x1b')]||null:null,'attributes':_0x2b0e51[_0x7375('0x19')]?_0x2b0e51[_0x7375('0x19')][_0x7375('0x1f')]||null:null,'include':_0x2b0e51[_0x7375('0x19')]?_0x2b0e51[_0x7375('0x19')][_0x7375('0x1c')]?_['map'](_0x2b0e51[_0x7375('0x19')][_0x7375('0x1c')],function(_0x51088a){return{'model':db[_0x51088a['model']],'as':_0x51088a['as'],'attributes':_0x51088a['attributes'],'include':_0x51088a[_0x7375('0x1c')]?_[_0x7375('0x1e')](_0x51088a[_0x7375('0x1c')],function(_0x49b0fc){return{'model':db[_0x49b0fc['model']],'as':_0x49b0fc['as'],'attributes':_0x49b0fc['attributes'],'include':_0x49b0fc['include']?_['map'](_0x49b0fc['include'],function(_0x1fd934){return{'model':db[_0x1fd934[_0x7375('0x1d')]],'as':_0x1fd934['as'],'attributes':_0x1fd934['attributes']};}):[]};}):[]};}):[]:[]})[_0x7375('0xc')](function(_0x4cdf19){logger[_0x7375('0xd')](_0x7375('0x22'),_0x2b0e51);logger[_0x7375('0x21')](_0x7375('0x22'),_0x2b0e51,JSON[_0x7375('0x11')](_0x4cdf19));_0x52806d(_0x4cdf19);})[_0x7375('0x16')](function(_0x10a454){logger[_0x7375('0x12')]('ShowZendeskAccount',_0x10a454[_0x7375('0x14')],_0x2b0e51);_0xdc1da2(_0x2d2578[_0x7375('0x12')](0x1f4,_0x10a454['message']));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 6f6179b..cf51285 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 _0xea28=['Router','fs-extra','../../components/auth/service','../../config/environment','./intZendeskConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','setTags','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x3e9be1,_0x2fac9c){var _0x41518b=function(_0x5f19ed){while(--_0x5f19ed){_0x3e9be1['push'](_0x3e9be1['shift']());}};_0x41518b(++_0x2fac9c);}(_0xea28,0x13a));var _0x8ea2=function(_0x651262,_0x1b15d4){_0x651262=_0x651262-0x0;var _0x53fcb7=_0xea28[_0x651262];return _0x53fcb7;};'use strict';var multer=require(_0x8ea2('0x0'));var util=require(_0x8ea2('0x1'));var path=require(_0x8ea2('0x2'));var timeout=require(_0x8ea2('0x3'));var express=require(_0x8ea2('0x4'));var router=express[_0x8ea2('0x5')]();var fs_extra=require(_0x8ea2('0x6'));var auth=require(_0x8ea2('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x8ea2('0x8'));var controller=require(_0x8ea2('0x9'));router[_0x8ea2('0xa')]('/',auth['isAuthenticated'](),controller[_0x8ea2('0xb')]);router[_0x8ea2('0xa')](_0x8ea2('0xc'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0xe')]);router[_0x8ea2('0xa')](_0x8ea2('0xf'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x10')]);router[_0x8ea2('0xa')](_0x8ea2('0x11'),auth[_0x8ea2('0xd')](),controller['getSubjects']);router['get'](_0x8ea2('0x12'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x13')]);router['get'](_0x8ea2('0x14'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x15')]);router[_0x8ea2('0x16')]('/',auth[_0x8ea2('0xd')](),controller['create']);router[_0x8ea2('0x16')]('/:id/tags',auth['isAuthenticated'](),controller[_0x8ea2('0x17')]);router[_0x8ea2('0x18')](_0x8ea2('0xc'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x19')]);router[_0x8ea2('0x1a')](_0x8ea2('0xc'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x1b')]);module[_0x8ea2('0x1c')]=router; \ No newline at end of file +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(_0x15c2ac,_0xab0694){var _0x1d869b=function(_0x3eb635){while(--_0x3eb635){_0x15c2ac['push'](_0x15c2ac['shift']());}};_0x1d869b(++_0xab0694);}(_0x4fc2,0x111));var _0x24fc=function(_0x859a3a,_0x2864cd){_0x859a3a=_0x859a3a-0x0;var _0x48e4f0=_0x4fc2[_0x859a3a];return _0x48e4f0;};'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 diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 598d87e..6fdc0cd 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 _0xe496=['sequelize','STRING'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0xe496,0xba));var _0x6e49=function(_0x45f33b,_0x16ae3b){_0x45f33b=_0x45f33b-0x0;var _0x472849=_0xe496[_0x45f33b];return _0x472849;};'use strict';var Sequelize=require(_0x6e49('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6e49('0x1')]}}; \ No newline at end of file +var _0x7055=['STRING'];(function(_0x2faddb,_0xc18b78){var _0x273c05=function(_0x1a3785){while(--_0x1a3785){_0x2faddb['push'](_0x2faddb['shift']());}};_0x273c05(++_0xc18b78);}(_0x7055,0xa5));var _0x5705=function(_0x1057a3,_0x28d9b7){_0x1057a3=_0x1057a3-0x0;var _0x131cdb=_0x7055[_0x1057a3];return _0x131cdb;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5705('0x0')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 4f3a436..277cfb8 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 _0x3a72=['model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','ZendeskConfiguration','includeAll','findAll','rows','catch','show','params','keys','include','find','body','getFields','findOne','ZendeskField','order','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../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','rawAttributes','fieldName','key'];(function(_0x3b93ba,_0x55b0a5){var _0x5cd7cb=function(_0x1ec96a){while(--_0x1ec96a){_0x3b93ba['push'](_0x3b93ba['shift']());}};_0x5cd7cb(++_0x55b0a5);}(_0x3a72,0xd7));var _0x23a7=function(_0x3ee8da,_0xb416b3){_0x3ee8da=_0x3ee8da-0x0;var _0x29dd43=_0x3a72[_0x3ee8da];return _0x29dd43;};'use strict';var emlformat=require(_0x23a7('0x0'));var rimraf=require(_0x23a7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x23a7('0x2'));var rp=require('request-promise');var moment=require(_0x23a7('0x3'));var BPromise=require(_0x23a7('0x4'));var Mustache=require(_0x23a7('0x5'));var util=require(_0x23a7('0x6'));var path=require(_0x23a7('0x7'));var sox=require(_0x23a7('0x8'));var csv=require(_0x23a7('0x9'));var ejs=require(_0x23a7('0xa'));var fs=require('fs');var fs_extra=require(_0x23a7('0xb'));var _=require(_0x23a7('0xc'));var squel=require(_0x23a7('0xd'));var crypto=require('crypto');var jsforce=require(_0x23a7('0xe'));var deskjs=require(_0x23a7('0xf'));var toCsv=require('to-csv');var querystring=require(_0x23a7('0x10'));var Papa=require(_0x23a7('0x11'));var Redis=require(_0x23a7('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x23a7('0x13'));var as=require(_0x23a7('0x14'));var hardwareService=require(_0x23a7('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x23a7('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x23a7('0x17'));var db=require(_0x23a7('0x18'))['db'];function respondWithStatusCode(_0x2ca4ec,_0x15b8a8){_0x15b8a8=_0x15b8a8||0xcc;return function(_0x584693){if(_0x584693){return _0x2ca4ec[_0x23a7('0x19')](_0x15b8a8);}return _0x2ca4ec[_0x23a7('0x1a')](_0x15b8a8)[_0x23a7('0x1b')]();};}function respondWithResult(_0xb42a98,_0xeed311){_0xeed311=_0xeed311||0xc8;return function(_0x619f67){if(_0x619f67){return _0xb42a98['status'](_0xeed311)[_0x23a7('0x1c')](_0x619f67);}};}function respondWithFilteredResult(_0x5240bc,_0x391b58){return function(_0x1ab5b4){if(_0x1ab5b4){var _0x12ebb0=typeof _0x391b58[_0x23a7('0x1d')]==='undefined'&&typeof _0x391b58[_0x23a7('0x1e')]===_0x23a7('0x1f');var _0x2723a2=_0x1ab5b4[_0x23a7('0x20')];var _0x39871c=_0x12ebb0?0x0:_0x391b58[_0x23a7('0x1d')];var _0x1b0ae3=_0x12ebb0?_0x1ab5b4[_0x23a7('0x20')]:_0x391b58[_0x23a7('0x1d')]+_0x391b58[_0x23a7('0x1e')];var _0x489ab1;if(_0x1b0ae3>=_0x2723a2){_0x1b0ae3=_0x2723a2;_0x489ab1=0xc8;}else{_0x489ab1=0xce;}_0x5240bc[_0x23a7('0x1a')](_0x489ab1);return _0x5240bc[_0x23a7('0x21')](_0x23a7('0x22'),_0x39871c+'-'+_0x1b0ae3+'/'+_0x2723a2)[_0x23a7('0x1c')](_0x1ab5b4);}return null;};}function patchUpdates(_0xa155ed){return function(_0x2124b2){try{jsonpatch[_0x23a7('0x23')](_0x2124b2,_0xa155ed,!![]);}catch(_0xa7af24){return BPromise[_0x23a7('0x24')](_0xa7af24);}return _0x2124b2[_0x23a7('0x25')]();};}function saveUpdates(_0x24354,_0x11a1e7){return function(_0x5c7eec){if(_0x5c7eec){return _0x5c7eec[_0x23a7('0x26')](_0x24354)[_0x23a7('0x27')](function(_0x259236){return _0x259236;});}return null;};}function removeEntity(_0x427de3,_0x1e3be2){return function(_0x196604){if(_0x196604){return _0x196604[_0x23a7('0x28')]()[_0x23a7('0x27')](function(){_0x427de3[_0x23a7('0x1a')](0xcc)[_0x23a7('0x1b')]();});}};}function handleEntityNotFound(_0x47ecfe,_0x4326e6){return function(_0x53234f){if(!_0x53234f){_0x47ecfe[_0x23a7('0x19')](0x194);}return _0x53234f;};}function handleError(_0x1d3ae8,_0x17b55b){_0x17b55b=_0x17b55b||0x1f4;return function(_0x4bba76){logger[_0x23a7('0x29')](_0x4bba76[_0x23a7('0x2a')]);if(_0x4bba76[_0x23a7('0x2b')]){delete _0x4bba76[_0x23a7('0x2b')];}_0x1d3ae8[_0x23a7('0x1a')](_0x17b55b)[_0x23a7('0x2c')](_0x4bba76);};}exports[_0x23a7('0x2d')]=function(_0x99fe37,_0x27b00c){var _0x390206={},_0x13014c={},_0x545f29={'count':0x0,'rows':[]};var _0x7c2adc=_['map'](db['ZendeskConfiguration'][_0x23a7('0x2e')],function(_0x38b5a9){return{'name':_0x38b5a9[_0x23a7('0x2f')],'type':_0x38b5a9['type'][_0x23a7('0x30')]};});_0x13014c[_0x23a7('0x31')]=_[_0x23a7('0x32')](_0x7c2adc,'name');_0x13014c['query']=_['keys'](_0x99fe37[_0x23a7('0x33')]);_0x13014c[_0x23a7('0x34')]=_[_0x23a7('0x35')](_0x13014c[_0x23a7('0x31')],_0x13014c['query']);_0x390206[_0x23a7('0x36')]=_[_0x23a7('0x35')](_0x13014c[_0x23a7('0x31')],qs['fields'](_0x99fe37[_0x23a7('0x33')][_0x23a7('0x37')]));_0x390206[_0x23a7('0x36')]=_0x390206['attributes'][_0x23a7('0x38')]?_0x390206[_0x23a7('0x36')]:_0x13014c[_0x23a7('0x31')];if(!_0x99fe37[_0x23a7('0x33')][_0x23a7('0x39')](_0x23a7('0x3a'))){_0x390206[_0x23a7('0x1e')]=qs[_0x23a7('0x1e')](_0x99fe37[_0x23a7('0x33')][_0x23a7('0x1e')]);_0x390206[_0x23a7('0x1d')]=qs[_0x23a7('0x1d')](_0x99fe37[_0x23a7('0x33')]['offset']);}_0x390206['order']=qs[_0x23a7('0x3b')](_0x99fe37[_0x23a7('0x33')][_0x23a7('0x3b')]);_0x390206[_0x23a7('0x3c')]=qs[_0x23a7('0x34')](_[_0x23a7('0x3d')](_0x99fe37[_0x23a7('0x33')],_0x13014c[_0x23a7('0x34')]),_0x7c2adc);if(_0x99fe37[_0x23a7('0x33')][_0x23a7('0x3e')]){_0x390206['where']=_[_0x23a7('0x3f')](_0x390206[_0x23a7('0x3c')],{'$or':_[_0x23a7('0x32')](_0x7c2adc,function(_0x297ab1){if(_0x297ab1[_0x23a7('0x40')]!==_0x23a7('0x41')){var _0x373e8c={};_0x373e8c[_0x297ab1[_0x23a7('0x2b')]]={'$like':'%'+_0x99fe37['query'][_0x23a7('0x3e')]+'%'};return _0x373e8c;}})});}_0x390206=_[_0x23a7('0x3f')]({},_0x390206,_0x99fe37[_0x23a7('0x42')]);var _0xce56dc={'where':_0x390206['where']};return db[_0x23a7('0x43')][_0x23a7('0x20')](_0xce56dc)[_0x23a7('0x27')](function(_0x333b20){_0x545f29['count']=_0x333b20;if(_0x99fe37[_0x23a7('0x33')][_0x23a7('0x44')]){_0x390206['include']=[{'all':!![]}];}return db[_0x23a7('0x43')][_0x23a7('0x45')](_0x390206);})['then'](function(_0x2defa5){_0x545f29[_0x23a7('0x46')]=_0x2defa5;return _0x545f29;})[_0x23a7('0x27')](respondWithFilteredResult(_0x27b00c,_0x390206))[_0x23a7('0x47')](handleError(_0x27b00c,null));};exports[_0x23a7('0x48')]=function(_0x596ddc,_0x3f6343){var _0x216758={'raw':![],'where':{'id':_0x596ddc[_0x23a7('0x49')]['id']}},_0x3ad37a={};_0x3ad37a[_0x23a7('0x31')]=_[_0x23a7('0x4a')](db['ZendeskConfiguration']['rawAttributes']);_0x3ad37a[_0x23a7('0x33')]=_[_0x23a7('0x4a')](_0x596ddc[_0x23a7('0x33')]);_0x3ad37a[_0x23a7('0x34')]=_[_0x23a7('0x35')](_0x3ad37a[_0x23a7('0x31')],_0x3ad37a['query']);_0x216758[_0x23a7('0x36')]=_[_0x23a7('0x35')](_0x3ad37a[_0x23a7('0x31')],qs[_0x23a7('0x37')](_0x596ddc[_0x23a7('0x33')]['fields']));_0x216758[_0x23a7('0x36')]=_0x216758['attributes'][_0x23a7('0x38')]?_0x216758[_0x23a7('0x36')]:_0x3ad37a[_0x23a7('0x31')];if(_0x596ddc[_0x23a7('0x33')][_0x23a7('0x44')]){_0x216758[_0x23a7('0x4b')]=[{'all':!![]}];}_0x216758=_['merge']({},_0x216758,_0x596ddc[_0x23a7('0x42')]);return db['ZendeskConfiguration'][_0x23a7('0x4c')](_0x216758)[_0x23a7('0x27')](handleEntityNotFound(_0x3f6343,null))['then'](respondWithResult(_0x3f6343,null))[_0x23a7('0x47')](handleError(_0x3f6343,null));};exports['create']=function(_0x67bf40,_0x447e63){return db[_0x23a7('0x43')]['create'](_0x67bf40[_0x23a7('0x4d')],{})['then'](respondWithResult(_0x447e63,0xc9))['catch'](handleError(_0x447e63,null));};exports[_0x23a7('0x26')]=function(_0xebc66d,_0x405377){if(_0xebc66d['body']['id']){delete _0xebc66d[_0x23a7('0x4d')]['id'];}return db[_0x23a7('0x43')][_0x23a7('0x4c')]({'where':{'id':_0xebc66d[_0x23a7('0x49')]['id']}})[_0x23a7('0x27')](handleEntityNotFound(_0x405377,null))['then'](saveUpdates(_0xebc66d[_0x23a7('0x4d')],null))[_0x23a7('0x27')](respondWithResult(_0x405377,null))[_0x23a7('0x47')](handleError(_0x405377,null));};exports[_0x23a7('0x28')]=function(_0x4375c1,_0x3946ab){return db[_0x23a7('0x43')][_0x23a7('0x4c')]({'where':{'id':_0x4375c1[_0x23a7('0x49')]['id']}})[_0x23a7('0x27')](handleEntityNotFound(_0x3946ab,null))['then'](removeEntity(_0x3946ab,null))[_0x23a7('0x47')](handleError(_0x3946ab,null));};exports[_0x23a7('0x4e')]=function(_0x12122d,_0x1eb592,_0x4907cb){var _0x8fcb3={};var _0x582a18={};var _0x16e7e0;var _0x3c42f9;return db[_0x23a7('0x43')][_0x23a7('0x4f')]({'where':{'id':_0x12122d[_0x23a7('0x49')]['id']}})[_0x23a7('0x27')](handleEntityNotFound(_0x1eb592,null))[_0x23a7('0x27')](function(_0x2a8754){if(_0x2a8754){_0x16e7e0=_0x2a8754;_0x582a18[_0x23a7('0x31')]=_['keys'](db[_0x23a7('0x50')]['rawAttributes']);_0x582a18[_0x23a7('0x33')]=_[_0x23a7('0x4a')](_0x12122d['query']);_0x582a18[_0x23a7('0x34')]=_[_0x23a7('0x35')](_0x582a18[_0x23a7('0x31')],_0x582a18[_0x23a7('0x33')]);_0x8fcb3[_0x23a7('0x36')]=_[_0x23a7('0x35')](_0x582a18['model'],qs[_0x23a7('0x37')](_0x12122d[_0x23a7('0x33')][_0x23a7('0x37')]));_0x8fcb3[_0x23a7('0x36')]=_0x8fcb3[_0x23a7('0x36')][_0x23a7('0x38')]?_0x8fcb3[_0x23a7('0x36')]:_0x582a18['model'];_0x8fcb3[_0x23a7('0x51')]=qs[_0x23a7('0x3b')](_0x12122d[_0x23a7('0x33')]['sort']);_0x8fcb3[_0x23a7('0x3c')]=qs['filters'](_[_0x23a7('0x3d')](_0x12122d[_0x23a7('0x33')],_0x582a18['filters']));if(_0x12122d[_0x23a7('0x33')]['filter']){_0x8fcb3[_0x23a7('0x3c')]=_[_0x23a7('0x3f')](_0x8fcb3[_0x23a7('0x3c')],{'$or':_[_0x23a7('0x32')](_0x8fcb3[_0x23a7('0x36')],function(_0x343c9e){var _0x2eaf1d={};_0x2eaf1d[_0x343c9e]={'$like':'%'+_0x12122d[_0x23a7('0x33')][_0x23a7('0x3e')]+'%'};return _0x2eaf1d;})});}_0x8fcb3=_[_0x23a7('0x3f')]({},_0x8fcb3,_0x12122d[_0x23a7('0x42')]);return _0x16e7e0[_0x23a7('0x4e')](_0x8fcb3);}})['then'](function(_0x463638){if(_0x463638){_0x3c42f9=_0x463638[_0x23a7('0x38')];if(!_0x12122d[_0x23a7('0x33')]['hasOwnProperty'](_0x23a7('0x3a'))){_0x8fcb3[_0x23a7('0x1e')]=qs[_0x23a7('0x1e')](_0x12122d['query']['limit']);_0x8fcb3[_0x23a7('0x1d')]=qs[_0x23a7('0x1d')](_0x12122d[_0x23a7('0x33')][_0x23a7('0x1d')]);}return _0x16e7e0[_0x23a7('0x4e')](_0x8fcb3);}})[_0x23a7('0x27')](function(_0x3285b9){if(_0x3285b9){return _0x3285b9?{'count':_0x3c42f9,'rows':_0x3285b9}:null;}})[_0x23a7('0x27')](respondWithResult(_0x1eb592,null))[_0x23a7('0x47')](handleError(_0x1eb592,null));};exports[_0x23a7('0x52')]=function(_0x33cda2,_0x1d7e2d,_0x2600d2){var _0x65f7db={};var _0x1c83d3={};var _0x5b8107;var _0x509aff;return db[_0x23a7('0x43')][_0x23a7('0x4f')]({'where':{'id':_0x33cda2[_0x23a7('0x49')]['id']}})[_0x23a7('0x27')](handleEntityNotFound(_0x1d7e2d,null))[_0x23a7('0x27')](function(_0x121d8a){if(_0x121d8a){_0x5b8107=_0x121d8a;_0x1c83d3[_0x23a7('0x31')]=_['keys'](db[_0x23a7('0x50')]['rawAttributes']);_0x1c83d3[_0x23a7('0x33')]=_['keys'](_0x33cda2['query']);_0x1c83d3[_0x23a7('0x34')]=_['intersection'](_0x1c83d3[_0x23a7('0x31')],_0x1c83d3[_0x23a7('0x33')]);_0x65f7db['attributes']=_[_0x23a7('0x35')](_0x1c83d3[_0x23a7('0x31')],qs[_0x23a7('0x37')](_0x33cda2[_0x23a7('0x33')][_0x23a7('0x37')]));_0x65f7db['attributes']=_0x65f7db['attributes'][_0x23a7('0x38')]?_0x65f7db['attributes']:_0x1c83d3[_0x23a7('0x31')];_0x65f7db[_0x23a7('0x51')]=qs[_0x23a7('0x3b')](_0x33cda2[_0x23a7('0x33')][_0x23a7('0x3b')]);_0x65f7db[_0x23a7('0x3c')]=qs['filters'](_[_0x23a7('0x3d')](_0x33cda2['query'],_0x1c83d3[_0x23a7('0x34')]));if(_0x33cda2[_0x23a7('0x33')][_0x23a7('0x3e')]){_0x65f7db['where']=_[_0x23a7('0x3f')](_0x65f7db[_0x23a7('0x3c')],{'$or':_[_0x23a7('0x32')](_0x65f7db['attributes'],function(_0x3421ca){var _0x57e58d={};_0x57e58d[_0x3421ca]={'$like':'%'+_0x33cda2[_0x23a7('0x33')][_0x23a7('0x3e')]+'%'};return _0x57e58d;})});}_0x65f7db=_[_0x23a7('0x3f')]({},_0x65f7db,_0x33cda2[_0x23a7('0x42')]);return _0x5b8107[_0x23a7('0x52')](_0x65f7db);}})['then'](function(_0x5b3920){if(_0x5b3920){_0x509aff=_0x5b3920[_0x23a7('0x38')];if(!_0x33cda2[_0x23a7('0x33')][_0x23a7('0x39')](_0x23a7('0x3a'))){_0x65f7db[_0x23a7('0x1e')]=qs[_0x23a7('0x1e')](_0x33cda2[_0x23a7('0x33')][_0x23a7('0x1e')]);_0x65f7db['offset']=qs[_0x23a7('0x1d')](_0x33cda2[_0x23a7('0x33')][_0x23a7('0x1d')]);}return _0x5b8107['getSubjects'](_0x65f7db);}})['then'](function(_0x4f7743){if(_0x4f7743){return _0x4f7743?{'count':_0x509aff,'rows':_0x4f7743}:null;}})[_0x23a7('0x27')](respondWithResult(_0x1d7e2d,null))['catch'](handleError(_0x1d7e2d,null));};exports[_0x23a7('0x53')]=function(_0x5a2323,_0x274792,_0x396313){var _0x468502={};var _0x236021={};var _0x3c1e67;var _0x138794;return db['ZendeskConfiguration'][_0x23a7('0x4f')]({'where':{'id':_0x5a2323[_0x23a7('0x49')]['id']}})['then'](handleEntityNotFound(_0x274792,null))[_0x23a7('0x27')](function(_0x5b4c5b){if(_0x5b4c5b){_0x3c1e67=_0x5b4c5b;_0x236021[_0x23a7('0x31')]=_[_0x23a7('0x4a')](db[_0x23a7('0x50')][_0x23a7('0x2e')]);_0x236021['query']=_['keys'](_0x5a2323[_0x23a7('0x33')]);_0x236021[_0x23a7('0x34')]=_[_0x23a7('0x35')](_0x236021[_0x23a7('0x31')],_0x236021['query']);_0x468502['attributes']=_[_0x23a7('0x35')](_0x236021[_0x23a7('0x31')],qs[_0x23a7('0x37')](_0x5a2323[_0x23a7('0x33')]['fields']));_0x468502['attributes']=_0x468502[_0x23a7('0x36')][_0x23a7('0x38')]?_0x468502[_0x23a7('0x36')]:_0x236021['model'];_0x468502['order']=qs[_0x23a7('0x3b')](_0x5a2323[_0x23a7('0x33')][_0x23a7('0x3b')]);_0x468502['where']=qs[_0x23a7('0x34')](_[_0x23a7('0x3d')](_0x5a2323['query'],_0x236021[_0x23a7('0x34')]));if(_0x5a2323[_0x23a7('0x33')][_0x23a7('0x3e')]){_0x468502[_0x23a7('0x3c')]=_['merge'](_0x468502[_0x23a7('0x3c')],{'$or':_['map'](_0x468502['attributes'],function(_0x2eb94b){var _0x6953e={};_0x6953e[_0x2eb94b]={'$like':'%'+_0x5a2323[_0x23a7('0x33')][_0x23a7('0x3e')]+'%'};return _0x6953e;})});}_0x468502=_[_0x23a7('0x3f')]({},_0x468502,_0x5a2323[_0x23a7('0x42')]);return _0x3c1e67['getDescriptions'](_0x468502);}})[_0x23a7('0x27')](function(_0xe3c8c8){if(_0xe3c8c8){_0x138794=_0xe3c8c8[_0x23a7('0x38')];if(!_0x5a2323[_0x23a7('0x33')][_0x23a7('0x39')]('nolimit')){_0x468502[_0x23a7('0x1e')]=qs['limit'](_0x5a2323[_0x23a7('0x33')][_0x23a7('0x1e')]);_0x468502[_0x23a7('0x1d')]=qs['offset'](_0x5a2323[_0x23a7('0x33')][_0x23a7('0x1d')]);}return _0x3c1e67[_0x23a7('0x53')](_0x468502);}})['then'](function(_0x1b2dc6){if(_0x1b2dc6){return _0x1b2dc6?{'count':_0x138794,'rows':_0x1b2dc6}:null;}})[_0x23a7('0x27')](respondWithResult(_0x274792,null))[_0x23a7('0x47')](handleError(_0x274792,null));};exports[_0x23a7('0x54')]=function(_0x5a1981,_0x203460,_0x40a4c0){var _0x49d9d9={};var _0x1fbfe4={};var _0x163d1c;var _0x46960c;return db[_0x23a7('0x43')][_0x23a7('0x4f')]({'where':{'id':_0x5a1981[_0x23a7('0x49')]['id']}})[_0x23a7('0x27')](handleEntityNotFound(_0x203460,null))[_0x23a7('0x27')](function(_0x4bf28b){if(_0x4bf28b){_0x163d1c=_0x4bf28b;_0x1fbfe4[_0x23a7('0x31')]=_[_0x23a7('0x4a')](db[_0x23a7('0x55')][_0x23a7('0x2e')]);_0x1fbfe4[_0x23a7('0x33')]=_['keys'](_0x5a1981[_0x23a7('0x33')]);_0x1fbfe4[_0x23a7('0x34')]=_['intersection'](_0x1fbfe4[_0x23a7('0x31')],_0x1fbfe4[_0x23a7('0x33')]);_0x49d9d9[_0x23a7('0x36')]=_[_0x23a7('0x35')](_0x1fbfe4[_0x23a7('0x31')],qs[_0x23a7('0x37')](_0x5a1981['query'][_0x23a7('0x37')]));_0x49d9d9[_0x23a7('0x36')]=_0x49d9d9[_0x23a7('0x36')][_0x23a7('0x38')]?_0x49d9d9['attributes']:_0x1fbfe4[_0x23a7('0x31')];_0x49d9d9['order']=qs[_0x23a7('0x3b')](_0x5a1981['query'][_0x23a7('0x3b')]);_0x49d9d9[_0x23a7('0x3c')]=qs[_0x23a7('0x34')](_[_0x23a7('0x3d')](_0x5a1981[_0x23a7('0x33')],_0x1fbfe4[_0x23a7('0x34')]));if(_0x5a1981[_0x23a7('0x33')][_0x23a7('0x3e')]){_0x49d9d9['where']=_['merge'](_0x49d9d9[_0x23a7('0x3c')],{'$or':_[_0x23a7('0x32')](_0x49d9d9[_0x23a7('0x36')],function(_0x1c216f){var _0x591087={};_0x591087[_0x1c216f]={'$like':'%'+_0x5a1981[_0x23a7('0x33')]['filter']+'%'};return _0x591087;})});}_0x49d9d9=_[_0x23a7('0x3f')]({},_0x49d9d9,_0x5a1981[_0x23a7('0x42')]);return _0x163d1c['getTags'](_0x49d9d9);}})[_0x23a7('0x27')](function(_0x229f83){if(_0x229f83){_0x46960c=_0x229f83[_0x23a7('0x38')];if(!_0x5a1981[_0x23a7('0x33')][_0x23a7('0x39')](_0x23a7('0x3a'))){_0x49d9d9[_0x23a7('0x1e')]=qs[_0x23a7('0x1e')](_0x5a1981[_0x23a7('0x33')]['limit']);_0x49d9d9[_0x23a7('0x1d')]=qs[_0x23a7('0x1d')](_0x5a1981['query'][_0x23a7('0x1d')]);}return _0x163d1c[_0x23a7('0x54')](_0x49d9d9);}})[_0x23a7('0x27')](function(_0x5542a2){if(_0x5542a2){return _0x5542a2?{'count':_0x46960c,'rows':_0x5542a2}:null;}})[_0x23a7('0x27')](respondWithResult(_0x203460,null))['catch'](handleError(_0x203460,null));};exports[_0x23a7('0x56')]=function(_0x364fb7,_0x5024e5,_0x35acae){if(_0x364fb7[_0x23a7('0x4d')]['id']){delete _0x364fb7['body']['id'];}return db[_0x23a7('0x43')][_0x23a7('0x4f')]({'where':{'id':_0x364fb7['params']['id']}})[_0x23a7('0x27')](handleEntityNotFound(_0x5024e5,null))[_0x23a7('0x27')](function(_0x178e46){if(_0x178e46){return _0x178e46[_0x23a7('0x56')](_0x364fb7[_0x23a7('0x4d')][_0x23a7('0x57')]||[]);}return null;})[_0x23a7('0x27')](respondWithResult(_0x5024e5,null))[_0x23a7('0x47')](handleError(_0x5024e5,null));}; \ No newline at end of file +var _0x73f8=['util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','save','update','then','stack','name','send','index','rawAttributes','fieldName','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','ZendeskConfiguration','findAll','rows','catch','find','create','body','params','destroy','getFields','ZendeskField','order','getSubjects','getDescriptions','getTags','findOne','Tag','setTags','ids','eml-format','rimraf','fast-json-patch','bluebird','mustache'];(function(_0x2909b4,_0x1ad87f){var _0x47e4fa=function(_0x200acf){while(--_0x200acf){_0x2909b4['push'](_0x2909b4['shift']());}};_0x47e4fa(++_0x1ad87f);}(_0x73f8,0xa1));var _0x873f=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0x73f8[_0x4e9628];return _0x27bc8c;};'use strict';var emlformat=require(_0x873f('0x0'));var rimraf=require(_0x873f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x873f('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x873f('0x3'));var Mustache=require(_0x873f('0x4'));var util=require(_0x873f('0x5'));var path=require(_0x873f('0x6'));var sox=require(_0x873f('0x7'));var csv=require(_0x873f('0x8'));var ejs=require(_0x873f('0x9'));var fs=require('fs');var fs_extra=require(_0x873f('0xa'));var _=require(_0x873f('0xb'));var squel=require(_0x873f('0xc'));var crypto=require(_0x873f('0xd'));var jsforce=require(_0x873f('0xe'));var deskjs=require(_0x873f('0xf'));var toCsv=require(_0x873f('0x8'));var querystring=require(_0x873f('0x10'));var Papa=require(_0x873f('0x11'));var Redis=require('ioredis');var authService=require(_0x873f('0x12'));var qs=require(_0x873f('0x13'));var as=require(_0x873f('0x14'));var hardwareService=require(_0x873f('0x15'));var logger=require(_0x873f('0x16'))(_0x873f('0x17'));var utils=require('../../config/utils');var config=require(_0x873f('0x18'));var licenseUtil=require(_0x873f('0x19'));var db=require(_0x873f('0x1a'))['db'];function respondWithStatusCode(_0x490918,_0x2036bb){_0x2036bb=_0x2036bb||0xcc;return function(_0x3e26bc){if(_0x3e26bc){return _0x490918['sendStatus'](_0x2036bb);}return _0x490918['status'](_0x2036bb)[_0x873f('0x1b')]();};}function respondWithResult(_0x2d76a2,_0x109bed){_0x109bed=_0x109bed||0xc8;return function(_0x2ab140){if(_0x2ab140){return _0x2d76a2[_0x873f('0x1c')](_0x109bed)[_0x873f('0x1d')](_0x2ab140);}};}function respondWithFilteredResult(_0x4c4c64,_0x1dfa8f){return function(_0x17a4df){if(_0x17a4df){var _0x3729c3=typeof _0x1dfa8f[_0x873f('0x1e')]===_0x873f('0x1f')&&typeof _0x1dfa8f[_0x873f('0x20')]===_0x873f('0x1f');var _0x26a312=_0x17a4df[_0x873f('0x21')];var _0xedcf56=_0x3729c3?0x0:_0x1dfa8f[_0x873f('0x1e')];var _0x2d8876=_0x3729c3?_0x17a4df[_0x873f('0x21')]:_0x1dfa8f[_0x873f('0x1e')]+_0x1dfa8f[_0x873f('0x20')];var _0x24b571;if(_0x2d8876>=_0x26a312){_0x2d8876=_0x26a312;_0x24b571=0xc8;}else{_0x24b571=0xce;}_0x4c4c64[_0x873f('0x1c')](_0x24b571);return _0x4c4c64[_0x873f('0x22')]('Content-Range',_0xedcf56+'-'+_0x2d8876+'/'+_0x26a312)['json'](_0x17a4df);}return null;};}function patchUpdates(_0x4f7329){return function(_0x49d528){try{jsonpatch['apply'](_0x49d528,_0x4f7329,!![]);}catch(_0x33a4ce){return BPromise['reject'](_0x33a4ce);}return _0x49d528[_0x873f('0x23')]();};}function saveUpdates(_0x50e86d,_0x580703){return function(_0x1a5b04){if(_0x1a5b04){return _0x1a5b04[_0x873f('0x24')](_0x50e86d)[_0x873f('0x25')](function(_0xf35962){return _0xf35962;});}return null;};}function removeEntity(_0x3dcb71,_0x3aa1b6){return function(_0xa47401){if(_0xa47401){return _0xa47401['destroy']()[_0x873f('0x25')](function(){_0x3dcb71[_0x873f('0x1c')](0xcc)[_0x873f('0x1b')]();});}};}function handleEntityNotFound(_0xb01271,_0x406412){return function(_0x545cec){if(!_0x545cec){_0xb01271['sendStatus'](0x194);}return _0x545cec;};}function handleError(_0x2f1871,_0x3ed159){_0x3ed159=_0x3ed159||0x1f4;return function(_0x523f95){logger['error'](_0x523f95[_0x873f('0x26')]);if(_0x523f95[_0x873f('0x27')]){delete _0x523f95[_0x873f('0x27')];}_0x2f1871[_0x873f('0x1c')](_0x3ed159)[_0x873f('0x28')](_0x523f95);};}exports[_0x873f('0x29')]=function(_0x33848f,_0x3e6f6e){var _0x2d3292={},_0xd1cabc={},_0x42e288={'count':0x0,'rows':[]};var _0x38bb92=_['map'](db['ZendeskConfiguration'][_0x873f('0x2a')],function(_0x5ca9b8){return{'name':_0x5ca9b8[_0x873f('0x2b')],'type':_0x5ca9b8['type'][_0x873f('0x2c')]};});_0xd1cabc[_0x873f('0x2d')]=_[_0x873f('0x2e')](_0x38bb92,'name');_0xd1cabc['query']=_[_0x873f('0x2f')](_0x33848f['query']);_0xd1cabc[_0x873f('0x30')]=_[_0x873f('0x31')](_0xd1cabc['model'],_0xd1cabc[_0x873f('0x32')]);_0x2d3292[_0x873f('0x33')]=_['intersection'](_0xd1cabc[_0x873f('0x2d')],qs[_0x873f('0x34')](_0x33848f[_0x873f('0x32')]['fields']));_0x2d3292[_0x873f('0x33')]=_0x2d3292[_0x873f('0x33')][_0x873f('0x35')]?_0x2d3292['attributes']:_0xd1cabc['model'];if(!_0x33848f[_0x873f('0x32')][_0x873f('0x36')](_0x873f('0x37'))){_0x2d3292[_0x873f('0x20')]=qs[_0x873f('0x20')](_0x33848f[_0x873f('0x32')]['limit']);_0x2d3292[_0x873f('0x1e')]=qs[_0x873f('0x1e')](_0x33848f[_0x873f('0x32')]['offset']);}_0x2d3292['order']=qs[_0x873f('0x38')](_0x33848f[_0x873f('0x32')]['sort']);_0x2d3292[_0x873f('0x39')]=qs[_0x873f('0x30')](_[_0x873f('0x3a')](_0x33848f['query'],_0xd1cabc[_0x873f('0x30')]),_0x38bb92);if(_0x33848f[_0x873f('0x32')][_0x873f('0x3b')]){_0x2d3292[_0x873f('0x39')]=_[_0x873f('0x3c')](_0x2d3292[_0x873f('0x39')],{'$or':_['map'](_0x38bb92,function(_0x4eae93){if(_0x4eae93['type']!=='VIRTUAL'){var _0x264267={};_0x264267[_0x4eae93[_0x873f('0x27')]]={'$like':'%'+_0x33848f[_0x873f('0x32')][_0x873f('0x3b')]+'%'};return _0x264267;}})});}_0x2d3292=_[_0x873f('0x3c')]({},_0x2d3292,_0x33848f[_0x873f('0x3d')]);var _0x519e92={'where':_0x2d3292[_0x873f('0x39')]};return db['ZendeskConfiguration'][_0x873f('0x21')](_0x519e92)['then'](function(_0x2fd006){_0x42e288[_0x873f('0x21')]=_0x2fd006;if(_0x33848f[_0x873f('0x32')][_0x873f('0x3e')]){_0x2d3292[_0x873f('0x3f')]=[{'all':!![]}];}return db[_0x873f('0x40')][_0x873f('0x41')](_0x2d3292);})[_0x873f('0x25')](function(_0x2376ec){_0x42e288[_0x873f('0x42')]=_0x2376ec;return _0x42e288;})[_0x873f('0x25')](respondWithFilteredResult(_0x3e6f6e,_0x2d3292))[_0x873f('0x43')](handleError(_0x3e6f6e,null));};exports['show']=function(_0x4f4621,_0x36a416){var _0x3fadc4={'raw':![],'where':{'id':_0x4f4621['params']['id']}},_0x424335={};_0x424335[_0x873f('0x2d')]=_[_0x873f('0x2f')](db[_0x873f('0x40')]['rawAttributes']);_0x424335[_0x873f('0x32')]=_['keys'](_0x4f4621['query']);_0x424335['filters']=_[_0x873f('0x31')](_0x424335[_0x873f('0x2d')],_0x424335[_0x873f('0x32')]);_0x3fadc4[_0x873f('0x33')]=_[_0x873f('0x31')](_0x424335['model'],qs[_0x873f('0x34')](_0x4f4621['query']['fields']));_0x3fadc4[_0x873f('0x33')]=_0x3fadc4[_0x873f('0x33')]['length']?_0x3fadc4[_0x873f('0x33')]:_0x424335[_0x873f('0x2d')];if(_0x4f4621[_0x873f('0x32')]['includeAll']){_0x3fadc4[_0x873f('0x3f')]=[{'all':!![]}];}_0x3fadc4=_[_0x873f('0x3c')]({},_0x3fadc4,_0x4f4621['options']);return db[_0x873f('0x40')][_0x873f('0x44')](_0x3fadc4)['then'](handleEntityNotFound(_0x36a416,null))[_0x873f('0x25')](respondWithResult(_0x36a416,null))[_0x873f('0x43')](handleError(_0x36a416,null));};exports[_0x873f('0x45')]=function(_0x9c1447,_0x10a6a6){return db[_0x873f('0x40')][_0x873f('0x45')](_0x9c1447[_0x873f('0x46')],{})['then'](respondWithResult(_0x10a6a6,0xc9))[_0x873f('0x43')](handleError(_0x10a6a6,null));};exports[_0x873f('0x24')]=function(_0x4c33fb,_0x203a59){if(_0x4c33fb[_0x873f('0x46')]['id']){delete _0x4c33fb[_0x873f('0x46')]['id'];}return db[_0x873f('0x40')]['find']({'where':{'id':_0x4c33fb[_0x873f('0x47')]['id']}})[_0x873f('0x25')](handleEntityNotFound(_0x203a59,null))[_0x873f('0x25')](saveUpdates(_0x4c33fb[_0x873f('0x46')],null))[_0x873f('0x25')](respondWithResult(_0x203a59,null))[_0x873f('0x43')](handleError(_0x203a59,null));};exports[_0x873f('0x48')]=function(_0x589e65,_0x272311){return db[_0x873f('0x40')][_0x873f('0x44')]({'where':{'id':_0x589e65['params']['id']}})[_0x873f('0x25')](handleEntityNotFound(_0x272311,null))[_0x873f('0x25')](removeEntity(_0x272311,null))['catch'](handleError(_0x272311,null));};exports[_0x873f('0x49')]=function(_0x12a024,_0x5586e4,_0x73a587){var _0x1f9b86={};var _0x1126da={};var _0x26e3ed;var _0x584e1b;return db[_0x873f('0x40')]['findOne']({'where':{'id':_0x12a024[_0x873f('0x47')]['id']}})[_0x873f('0x25')](handleEntityNotFound(_0x5586e4,null))[_0x873f('0x25')](function(_0x3fa122){if(_0x3fa122){_0x26e3ed=_0x3fa122;_0x1126da[_0x873f('0x2d')]=_['keys'](db[_0x873f('0x4a')][_0x873f('0x2a')]);_0x1126da[_0x873f('0x32')]=_[_0x873f('0x2f')](_0x12a024[_0x873f('0x32')]);_0x1126da[_0x873f('0x30')]=_[_0x873f('0x31')](_0x1126da[_0x873f('0x2d')],_0x1126da[_0x873f('0x32')]);_0x1f9b86[_0x873f('0x33')]=_[_0x873f('0x31')](_0x1126da[_0x873f('0x2d')],qs[_0x873f('0x34')](_0x12a024[_0x873f('0x32')][_0x873f('0x34')]));_0x1f9b86[_0x873f('0x33')]=_0x1f9b86['attributes'][_0x873f('0x35')]?_0x1f9b86['attributes']:_0x1126da['model'];_0x1f9b86[_0x873f('0x4b')]=qs[_0x873f('0x38')](_0x12a024[_0x873f('0x32')][_0x873f('0x38')]);_0x1f9b86[_0x873f('0x39')]=qs[_0x873f('0x30')](_[_0x873f('0x3a')](_0x12a024['query'],_0x1126da['filters']));if(_0x12a024[_0x873f('0x32')][_0x873f('0x3b')]){_0x1f9b86[_0x873f('0x39')]=_[_0x873f('0x3c')](_0x1f9b86[_0x873f('0x39')],{'$or':_['map'](_0x1f9b86[_0x873f('0x33')],function(_0x3634ca){var _0x1746dd={};_0x1746dd[_0x3634ca]={'$like':'%'+_0x12a024['query'][_0x873f('0x3b')]+'%'};return _0x1746dd;})});}_0x1f9b86=_[_0x873f('0x3c')]({},_0x1f9b86,_0x12a024[_0x873f('0x3d')]);return _0x26e3ed[_0x873f('0x49')](_0x1f9b86);}})[_0x873f('0x25')](function(_0x203e7a){if(_0x203e7a){_0x584e1b=_0x203e7a[_0x873f('0x35')];if(!_0x12a024['query'][_0x873f('0x36')](_0x873f('0x37'))){_0x1f9b86['limit']=qs['limit'](_0x12a024[_0x873f('0x32')][_0x873f('0x20')]);_0x1f9b86[_0x873f('0x1e')]=qs['offset'](_0x12a024[_0x873f('0x32')][_0x873f('0x1e')]);}return _0x26e3ed[_0x873f('0x49')](_0x1f9b86);}})['then'](function(_0x160210){if(_0x160210){return _0x160210?{'count':_0x584e1b,'rows':_0x160210}:null;}})[_0x873f('0x25')](respondWithResult(_0x5586e4,null))['catch'](handleError(_0x5586e4,null));};exports[_0x873f('0x4c')]=function(_0x236988,_0x31e938,_0x1354cf){var _0x2609e7={};var _0x5a88b8={};var _0x354442;var _0x13c6c4;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x236988[_0x873f('0x47')]['id']}})['then'](handleEntityNotFound(_0x31e938,null))[_0x873f('0x25')](function(_0x480cc1){if(_0x480cc1){_0x354442=_0x480cc1;_0x5a88b8['model']=_[_0x873f('0x2f')](db[_0x873f('0x4a')]['rawAttributes']);_0x5a88b8[_0x873f('0x32')]=_[_0x873f('0x2f')](_0x236988[_0x873f('0x32')]);_0x5a88b8['filters']=_[_0x873f('0x31')](_0x5a88b8['model'],_0x5a88b8['query']);_0x2609e7['attributes']=_[_0x873f('0x31')](_0x5a88b8['model'],qs[_0x873f('0x34')](_0x236988['query'][_0x873f('0x34')]));_0x2609e7[_0x873f('0x33')]=_0x2609e7[_0x873f('0x33')][_0x873f('0x35')]?_0x2609e7[_0x873f('0x33')]:_0x5a88b8[_0x873f('0x2d')];_0x2609e7['order']=qs[_0x873f('0x38')](_0x236988['query']['sort']);_0x2609e7[_0x873f('0x39')]=qs[_0x873f('0x30')](_[_0x873f('0x3a')](_0x236988[_0x873f('0x32')],_0x5a88b8[_0x873f('0x30')]));if(_0x236988['query'][_0x873f('0x3b')]){_0x2609e7['where']=_[_0x873f('0x3c')](_0x2609e7[_0x873f('0x39')],{'$or':_[_0x873f('0x2e')](_0x2609e7[_0x873f('0x33')],function(_0xc46e6e){var _0x4745d2={};_0x4745d2[_0xc46e6e]={'$like':'%'+_0x236988['query'][_0x873f('0x3b')]+'%'};return _0x4745d2;})});}_0x2609e7=_['merge']({},_0x2609e7,_0x236988[_0x873f('0x3d')]);return _0x354442[_0x873f('0x4c')](_0x2609e7);}})[_0x873f('0x25')](function(_0x3a9c9a){if(_0x3a9c9a){_0x13c6c4=_0x3a9c9a[_0x873f('0x35')];if(!_0x236988[_0x873f('0x32')][_0x873f('0x36')](_0x873f('0x37'))){_0x2609e7[_0x873f('0x20')]=qs[_0x873f('0x20')](_0x236988['query'][_0x873f('0x20')]);_0x2609e7['offset']=qs[_0x873f('0x1e')](_0x236988[_0x873f('0x32')][_0x873f('0x1e')]);}return _0x354442[_0x873f('0x4c')](_0x2609e7);}})[_0x873f('0x25')](function(_0x3db732){if(_0x3db732){return _0x3db732?{'count':_0x13c6c4,'rows':_0x3db732}:null;}})[_0x873f('0x25')](respondWithResult(_0x31e938,null))[_0x873f('0x43')](handleError(_0x31e938,null));};exports[_0x873f('0x4d')]=function(_0x4c9bbd,_0x32c922,_0x2971e4){var _0x52bec6={};var _0x4807f6={};var _0x454aea;var _0x32fcd3;return db[_0x873f('0x40')]['findOne']({'where':{'id':_0x4c9bbd[_0x873f('0x47')]['id']}})[_0x873f('0x25')](handleEntityNotFound(_0x32c922,null))['then'](function(_0x5d89c5){if(_0x5d89c5){_0x454aea=_0x5d89c5;_0x4807f6[_0x873f('0x2d')]=_[_0x873f('0x2f')](db[_0x873f('0x4a')]['rawAttributes']);_0x4807f6[_0x873f('0x32')]=_[_0x873f('0x2f')](_0x4c9bbd[_0x873f('0x32')]);_0x4807f6[_0x873f('0x30')]=_['intersection'](_0x4807f6['model'],_0x4807f6[_0x873f('0x32')]);_0x52bec6[_0x873f('0x33')]=_[_0x873f('0x31')](_0x4807f6[_0x873f('0x2d')],qs[_0x873f('0x34')](_0x4c9bbd[_0x873f('0x32')][_0x873f('0x34')]));_0x52bec6[_0x873f('0x33')]=_0x52bec6['attributes'][_0x873f('0x35')]?_0x52bec6[_0x873f('0x33')]:_0x4807f6['model'];_0x52bec6[_0x873f('0x4b')]=qs['sort'](_0x4c9bbd[_0x873f('0x32')][_0x873f('0x38')]);_0x52bec6['where']=qs['filters'](_['pick'](_0x4c9bbd[_0x873f('0x32')],_0x4807f6[_0x873f('0x30')]));if(_0x4c9bbd[_0x873f('0x32')][_0x873f('0x3b')]){_0x52bec6[_0x873f('0x39')]=_[_0x873f('0x3c')](_0x52bec6['where'],{'$or':_[_0x873f('0x2e')](_0x52bec6['attributes'],function(_0x4a6abe){var _0x58f08f={};_0x58f08f[_0x4a6abe]={'$like':'%'+_0x4c9bbd[_0x873f('0x32')][_0x873f('0x3b')]+'%'};return _0x58f08f;})});}_0x52bec6=_[_0x873f('0x3c')]({},_0x52bec6,_0x4c9bbd[_0x873f('0x3d')]);return _0x454aea[_0x873f('0x4d')](_0x52bec6);}})[_0x873f('0x25')](function(_0xa84148){if(_0xa84148){_0x32fcd3=_0xa84148[_0x873f('0x35')];if(!_0x4c9bbd[_0x873f('0x32')][_0x873f('0x36')](_0x873f('0x37'))){_0x52bec6['limit']=qs['limit'](_0x4c9bbd['query'][_0x873f('0x20')]);_0x52bec6[_0x873f('0x1e')]=qs['offset'](_0x4c9bbd[_0x873f('0x32')][_0x873f('0x1e')]);}return _0x454aea[_0x873f('0x4d')](_0x52bec6);}})['then'](function(_0x1222f7){if(_0x1222f7){return _0x1222f7?{'count':_0x32fcd3,'rows':_0x1222f7}:null;}})[_0x873f('0x25')](respondWithResult(_0x32c922,null))[_0x873f('0x43')](handleError(_0x32c922,null));};exports[_0x873f('0x4e')]=function(_0x3e1c1a,_0x5a25df,_0x58ecc0){var _0x202979={};var _0x3f2498={};var _0x47114b;var _0x4f5cf5;return db[_0x873f('0x40')][_0x873f('0x4f')]({'where':{'id':_0x3e1c1a[_0x873f('0x47')]['id']}})[_0x873f('0x25')](handleEntityNotFound(_0x5a25df,null))[_0x873f('0x25')](function(_0x59b9c4){if(_0x59b9c4){_0x47114b=_0x59b9c4;_0x3f2498[_0x873f('0x2d')]=_[_0x873f('0x2f')](db[_0x873f('0x50')][_0x873f('0x2a')]);_0x3f2498[_0x873f('0x32')]=_[_0x873f('0x2f')](_0x3e1c1a['query']);_0x3f2498['filters']=_[_0x873f('0x31')](_0x3f2498[_0x873f('0x2d')],_0x3f2498[_0x873f('0x32')]);_0x202979['attributes']=_[_0x873f('0x31')](_0x3f2498[_0x873f('0x2d')],qs[_0x873f('0x34')](_0x3e1c1a['query'][_0x873f('0x34')]));_0x202979['attributes']=_0x202979[_0x873f('0x33')][_0x873f('0x35')]?_0x202979['attributes']:_0x3f2498['model'];_0x202979[_0x873f('0x4b')]=qs[_0x873f('0x38')](_0x3e1c1a[_0x873f('0x32')][_0x873f('0x38')]);_0x202979['where']=qs['filters'](_['pick'](_0x3e1c1a[_0x873f('0x32')],_0x3f2498[_0x873f('0x30')]));if(_0x3e1c1a[_0x873f('0x32')][_0x873f('0x3b')]){_0x202979[_0x873f('0x39')]=_[_0x873f('0x3c')](_0x202979[_0x873f('0x39')],{'$or':_[_0x873f('0x2e')](_0x202979[_0x873f('0x33')],function(_0x513a54){var _0x5119a0={};_0x5119a0[_0x513a54]={'$like':'%'+_0x3e1c1a[_0x873f('0x32')][_0x873f('0x3b')]+'%'};return _0x5119a0;})});}_0x202979=_[_0x873f('0x3c')]({},_0x202979,_0x3e1c1a[_0x873f('0x3d')]);return _0x47114b[_0x873f('0x4e')](_0x202979);}})[_0x873f('0x25')](function(_0x939999){if(_0x939999){_0x4f5cf5=_0x939999[_0x873f('0x35')];if(!_0x3e1c1a[_0x873f('0x32')]['hasOwnProperty'](_0x873f('0x37'))){_0x202979[_0x873f('0x20')]=qs[_0x873f('0x20')](_0x3e1c1a['query'][_0x873f('0x20')]);_0x202979[_0x873f('0x1e')]=qs[_0x873f('0x1e')](_0x3e1c1a[_0x873f('0x32')]['offset']);}return _0x47114b['getTags'](_0x202979);}})['then'](function(_0x51361c){if(_0x51361c){return _0x51361c?{'count':_0x4f5cf5,'rows':_0x51361c}:null;}})[_0x873f('0x25')](respondWithResult(_0x5a25df,null))[_0x873f('0x43')](handleError(_0x5a25df,null));};exports[_0x873f('0x51')]=function(_0x343aab,_0x1e2412,_0x55f59f){if(_0x343aab['body']['id']){delete _0x343aab[_0x873f('0x46')]['id'];}return db[_0x873f('0x40')][_0x873f('0x4f')]({'where':{'id':_0x343aab[_0x873f('0x47')]['id']}})['then'](handleEntityNotFound(_0x1e2412,null))[_0x873f('0x25')](function(_0x2375d6){if(_0x2375d6){return _0x2375d6[_0x873f('0x51')](_0x343aab[_0x873f('0x46')][_0x873f('0x52')]||[]);}return null;})[_0x873f('0x25')](respondWithResult(_0x1e2412,null))[_0x873f('0x43')](handleError(_0x1e2412,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 53be7da..2e88340 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 _0xb78e=['ZendeskConfiguration','int_zendesk_configurations','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','define'];(function(_0x40784a,_0x561c1b){var _0x4bbea1=function(_0x13ad7b){while(--_0x13ad7b){_0x40784a['push'](_0x40784a['shift']());}};_0x4bbea1(++_0x561c1b);}(_0xb78e,0x1c9));var _0xeb78=function(_0x1be076,_0x1f7be3){_0x1be076=_0x1be076-0x0;var _0x544859=_0xb78e[_0x1be076];return _0x544859;};'use strict';var _=require(_0xeb78('0x0'));var util=require(_0xeb78('0x1'));var logger=require('../../config/logger')(_0xeb78('0x2'));var moment=require(_0xeb78('0x3'));var BPromise=require(_0xeb78('0x4'));var rp=require(_0xeb78('0x5'));var fs=require('fs');var path=require(_0xeb78('0x6'));var rimraf=require(_0xeb78('0x7'));var config=require(_0xeb78('0x8'));var attributes=require(_0xeb78('0x9'));module['exports']=function(_0x3c35e7,_0x17a736){return _0x3c35e7[_0xeb78('0xa')](_0xeb78('0xb'),attributes,{'tableName':_0xeb78('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x757a=['define','int_zendesk_configurations','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports'];(function(_0x44ace6,_0x448496){var _0x1b5359=function(_0x149c04){while(--_0x149c04){_0x44ace6['push'](_0x44ace6['shift']());}};_0x1b5359(++_0x448496);}(_0x757a,0xde));var _0xa757=function(_0x277153,_0x21d626){_0x277153=_0x277153-0x0;var _0x9e67fd=_0x757a[_0x277153];return _0x9e67fd;};'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')]('ZendeskConfiguration',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js index 7eb519f..d935088 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 _0x43f0=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash'];(function(_0xbb76d2,_0x5c290b){var _0x4ce6cd=function(_0x157c8c){while(--_0x157c8c){_0xbb76d2['push'](_0xbb76d2['shift']());}};_0x4ce6cd(++_0x5c290b);}(_0x43f0,0x131));var _0x043f=function(_0x13cc34,_0x28bb2c){_0x13cc34=_0x13cc34-0x0;var _0xb3d0ee=_0x43f0[_0x13cc34];return _0xb3d0ee;};'use strict';var _=require(_0x043f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x043f('0x1'));var rs=require(_0x043f('0x2'));var fs=require('fs');var Redis=require(_0x043f('0x3'));var db=require(_0x043f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x043f('0x5'))('rpc');var config=require(_0x043f('0x6'));var jayson=require(_0x043f('0x7'));var client=jayson['client'][_0x043f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x55432e,_0x4e05a3,_0x58820d){return new BPromise(function(_0x1b69f6,_0x38d867){return client[_0x043f('0x9')](_0x55432e,_0x58820d)['then'](function(_0xf5e2b4){logger[_0x043f('0xa')](_0x043f('0xb'),_0x4e05a3,'request\x20sent');logger['debug']('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x4e05a3,_0x043f('0xc'),JSON['stringify'](_0xf5e2b4));if(_0xf5e2b4[_0x043f('0xd')]){if(_0xf5e2b4['error'][_0x043f('0xe')]===0x1f4){logger[_0x043f('0xd')](_0x043f('0xb'),_0x4e05a3,_0xf5e2b4[_0x043f('0xd')]['message']);return _0x38d867(_0xf5e2b4[_0x043f('0xd')][_0x043f('0xf')]);}logger[_0x043f('0xd')]('ZendeskConfiguration,\x20%s,\x20%s',_0x4e05a3,_0xf5e2b4['error'][_0x043f('0xf')]);return _0x1b69f6(_0xf5e2b4['error'][_0x043f('0xf')]);}else{logger['info'](_0x043f('0xb'),_0x4e05a3,'request\x20sent');_0x1b69f6(_0xf5e2b4[_0x043f('0x10')][_0x043f('0xf')]);}})[_0x043f('0x11')](function(_0x27ce66){logger['error'](_0x043f('0xb'),_0x4e05a3,_0x27ce66);_0x38d867(_0x27ce66);});});} \ No newline at end of file +var _0xd64c=['code','ZendeskConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','then','info','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x28958d,_0xfa5f9f){var _0x439c72=function(_0x280df5){while(--_0x280df5){_0x28958d['push'](_0x28958d['shift']());}};_0x439c72(++_0xfa5f9f);}(_0xd64c,0xe1));var _0xcd64=function(_0x2d4bc4,_0x31f604){_0x2d4bc4=_0x2d4bc4-0x0;var _0x313536=_0xd64c[_0x2d4bc4];return _0x313536;};'use strict';var _=require(_0xcd64('0x0'));var util=require(_0xcd64('0x1'));var moment=require(_0xcd64('0x2'));var BPromise=require(_0xcd64('0x3'));var rs=require(_0xcd64('0x4'));var fs=require('fs');var Redis=require(_0xcd64('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xcd64('0x6'));var logger=require(_0xcd64('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xcd64('0x8'));var client=jayson[_0xcd64('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x124bd5,_0x1552a0,_0x23b1f8){return new BPromise(function(_0x5ec7c4,_0x4724f9){return client['request'](_0x124bd5,_0x23b1f8)[_0xcd64('0xa')](function(_0xa0e811){logger[_0xcd64('0xb')]('ZendeskConfiguration,\x20%s,\x20%s',_0x1552a0,_0xcd64('0xc'));logger[_0xcd64('0xd')](_0xcd64('0xe'),_0x1552a0,_0xcd64('0xc'),JSON[_0xcd64('0xf')](_0xa0e811));if(_0xa0e811[_0xcd64('0x10')]){if(_0xa0e811[_0xcd64('0x10')][_0xcd64('0x11')]===0x1f4){logger[_0xcd64('0x10')](_0xcd64('0x12'),_0x1552a0,_0xa0e811[_0xcd64('0x10')][_0xcd64('0x13')]);return _0x4724f9(_0xa0e811['error']['message']);}logger[_0xcd64('0x10')](_0xcd64('0x12'),_0x1552a0,_0xa0e811[_0xcd64('0x10')][_0xcd64('0x13')]);return _0x5ec7c4(_0xa0e811[_0xcd64('0x10')][_0xcd64('0x13')]);}else{logger[_0xcd64('0xb')]('ZendeskConfiguration,\x20%s,\x20%s',_0x1552a0,'request\x20sent');_0x5ec7c4(_0xa0e811[_0xcd64('0x14')][_0xcd64('0x13')]);}})[_0xcd64('0x15')](function(_0x31036a){logger['error'](_0xcd64('0x12'),_0x1552a0,_0x31036a);_0x4724f9(_0x31036a);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index cb51b40..498c10a 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 _0xbd97=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','isAuthenticated','index','get','show','create','put','/:id','update','exports','multer','util','path','connect-timeout','express'];(function(_0x912d27,_0x28e0e3){var _0x31b918=function(_0x1882f7){while(--_0x1882f7){_0x912d27['push'](_0x912d27['shift']());}};_0x31b918(++_0x28e0e3);}(_0xbd97,0x1c7));var _0x7bd9=function(_0x1e7696,_0x5e4a6d){_0x1e7696=_0x1e7696-0x0;var _0x36343e=_0xbd97[_0x1e7696];return _0x36343e;};'use strict';var multer=require(_0x7bd9('0x0'));var util=require(_0x7bd9('0x1'));var path=require(_0x7bd9('0x2'));var timeout=require(_0x7bd9('0x3'));var express=require(_0x7bd9('0x4'));var router=express[_0x7bd9('0x5')]();var fs_extra=require(_0x7bd9('0x6'));var auth=require(_0x7bd9('0x7'));var interaction=require(_0x7bd9('0x8'));var config=require(_0x7bd9('0x9'));var controller=require(_0x7bd9('0xa'));router['get']('/',auth[_0x7bd9('0xb')](),controller[_0x7bd9('0xc')]);router[_0x7bd9('0xd')]('/:id',auth[_0x7bd9('0xb')](),controller[_0x7bd9('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x7bd9('0xf')]);router[_0x7bd9('0x10')](_0x7bd9('0x11'),auth['isAuthenticated'](),controller[_0x7bd9('0x12')]);router['delete']('/:id',auth[_0x7bd9('0xb')](),controller['destroy']);module[_0x7bd9('0x13')]=router; \ No newline at end of file +var _0x6725=['put','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x2f5d30,_0x502f29){var _0x18e5f9=function(_0x270d76){while(--_0x270d76){_0x2f5d30['push'](_0x2f5d30['shift']());}};_0x18e5f9(++_0x502f29);}(_0x6725,0x116));var _0x5672=function(_0x602a0a,_0x4beae6){_0x602a0a=_0x602a0a-0x0;var _0x2b132c=_0x6725[_0x602a0a];return _0x2b132c;};'use strict';var multer=require(_0x5672('0x0'));var util=require('util');var path=require(_0x5672('0x1'));var timeout=require('connect-timeout');var express=require(_0x5672('0x2'));var router=express[_0x5672('0x3')]();var fs_extra=require(_0x5672('0x4'));var auth=require(_0x5672('0x5'));var interaction=require(_0x5672('0x6'));var config=require(_0x5672('0x7'));var controller=require(_0x5672('0x8'));router[_0x5672('0x9')]('/',auth[_0x5672('0xa')](),controller[_0x5672('0xb')]);router[_0x5672('0x9')](_0x5672('0xc'),auth['isAuthenticated'](),controller[_0x5672('0xd')]);router[_0x5672('0xe')]('/',auth[_0x5672('0xa')](),controller[_0x5672('0xf')]);router[_0x5672('0x10')](_0x5672('0xc'),auth[_0x5672('0xa')](),controller[_0x5672('0x11')]);router[_0x5672('0x12')](_0x5672('0xc'),auth[_0x5672('0xa')](),controller[_0x5672('0x13')]);module[_0x5672('0x14')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 041b8ef..b926dca 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 _0xa846=['customVariable','keyValue','picklist','STRING','ENUM','BOOLEAN','sequelize','exports','variable'];(function(_0x28d6ae,_0x53ae37){var _0x3d7180=function(_0x3cd7c0){while(--_0x3cd7c0){_0x28d6ae['push'](_0x28d6ae['shift']());}};_0x3d7180(++_0x53ae37);}(_0xa846,0x1c8));var _0x6a84=function(_0x1da42f,_0x23dc53){_0x1da42f=_0x1da42f-0x0;var _0x458c83=_0xa846[_0x1da42f];return _0x458c83;};'use strict';var Sequelize=require(_0x6a84('0x0'));module[_0x6a84('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0x6a84('0x2'),_0x6a84('0x3'),_0x6a84('0x4'),_0x6a84('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x6a84('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x6a84('0x7')]('string','variable',_0x6a84('0x3'))},'keyContent':{'type':Sequelize[_0x6a84('0x6')]},'idField':{'type':Sequelize[_0x6a84('0x6')]},'nameField':{'type':Sequelize[_0x6a84('0x6')]},'customField':{'type':Sequelize[_0x6a84('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6a84('0x6')]}}; \ No newline at end of file +var _0xdb4b=['STRING','sequelize','exports','ENUM','string','variable','customVariable','keyValue','picklist'];(function(_0x4cbe30,_0x218e5c){var _0x59ba9a=function(_0x5ed0b2){while(--_0x5ed0b2){_0x4cbe30['push'](_0x4cbe30['shift']());}};_0x59ba9a(++_0x218e5c);}(_0xdb4b,0xfd));var _0xbdb4=function(_0x568ae7,_0x2b5fa3){_0x568ae7=_0x568ae7-0x0;var _0x257050=_0xdb4b[_0x568ae7];return _0x257050;};'use strict';var Sequelize=require(_0xbdb4('0x0'));module[_0xbdb4('0x1')]={'type':{'type':Sequelize[_0xbdb4('0x2')](_0xbdb4('0x3'),_0xbdb4('0x4'),_0xbdb4('0x5'),_0xbdb4('0x6'),_0xbdb4('0x7')),'defaultValue':_0xbdb4('0x3')},'content':{'type':Sequelize[_0xbdb4('0x8')]},'key':{'type':Sequelize[_0xbdb4('0x8')]},'keyType':{'type':Sequelize[_0xbdb4('0x2')]('string',_0xbdb4('0x4'),_0xbdb4('0x5'))},'keyContent':{'type':Sequelize[_0xbdb4('0x8')]},'idField':{'type':Sequelize[_0xbdb4('0x8')]},'nameField':{'type':Sequelize[_0xbdb4('0x8')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xbdb4('0x8')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index ca6ccb2..c37bf8f 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 _0xdb76=['to-csv','fs-extra','lodash','squel','crypto','jsforce','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','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','ZendeskField','rawAttributes','key','model','map','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','merge','VIRTUAL','options','include','findAll','catch','params','length','includeAll','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox'];(function(_0x4a1902,_0x498455){var _0x1185cf=function(_0x57f01a){while(--_0x57f01a){_0x4a1902['push'](_0x4a1902['shift']());}};_0x1185cf(++_0x498455);}(_0xdb76,0x8c));var _0x6db7=function(_0xefb84a,_0x217c3e){_0xefb84a=_0xefb84a-0x0;var _0x1ecff9=_0xdb76[_0xefb84a];return _0x1ecff9;};'use strict';var emlformat=require(_0x6db7('0x0'));var rimraf=require(_0x6db7('0x1'));var zipdir=require(_0x6db7('0x2'));var jsonpatch=require(_0x6db7('0x3'));var rp=require(_0x6db7('0x4'));var moment=require(_0x6db7('0x5'));var BPromise=require(_0x6db7('0x6'));var Mustache=require(_0x6db7('0x7'));var util=require('util');var path=require(_0x6db7('0x8'));var sox=require(_0x6db7('0x9'));var csv=require(_0x6db7('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6db7('0xb'));var _=require(_0x6db7('0xc'));var squel=require(_0x6db7('0xd'));var crypto=require(_0x6db7('0xe'));var jsforce=require(_0x6db7('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x6db7('0xa'));var querystring=require('querystring');var Papa=require(_0x6db7('0x10'));var Redis=require(_0x6db7('0x11'));var authService=require(_0x6db7('0x12'));var qs=require(_0x6db7('0x13'));var as=require(_0x6db7('0x14'));var hardwareService=require(_0x6db7('0x15'));var logger=require(_0x6db7('0x16'))(_0x6db7('0x17'));var utils=require(_0x6db7('0x18'));var config=require(_0x6db7('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4ec515,_0x2cbba1){_0x2cbba1=_0x2cbba1||0xcc;return function(_0x44bc8f){if(_0x44bc8f){return _0x4ec515[_0x6db7('0x1a')](_0x2cbba1);}return _0x4ec515[_0x6db7('0x1b')](_0x2cbba1)[_0x6db7('0x1c')]();};}function respondWithResult(_0x3b16a8,_0x35ec4f){_0x35ec4f=_0x35ec4f||0xc8;return function(_0x1f9e8c){if(_0x1f9e8c){return _0x3b16a8[_0x6db7('0x1b')](_0x35ec4f)[_0x6db7('0x1d')](_0x1f9e8c);}};}function respondWithFilteredResult(_0xe437ca,_0x3617d8){return function(_0x4abfb4){if(_0x4abfb4){var _0x4d9965=typeof _0x3617d8[_0x6db7('0x1e')]==='undefined'&&typeof _0x3617d8[_0x6db7('0x1f')]==='undefined';var _0xaef975=_0x4abfb4[_0x6db7('0x20')];var _0x16c3bf=_0x4d9965?0x0:_0x3617d8[_0x6db7('0x1e')];var _0x381b08=_0x4d9965?_0x4abfb4[_0x6db7('0x20')]:_0x3617d8[_0x6db7('0x1e')]+_0x3617d8[_0x6db7('0x1f')];var _0x3a76f5;if(_0x381b08>=_0xaef975){_0x381b08=_0xaef975;_0x3a76f5=0xc8;}else{_0x3a76f5=0xce;}_0xe437ca[_0x6db7('0x1b')](_0x3a76f5);return _0xe437ca[_0x6db7('0x21')](_0x6db7('0x22'),_0x16c3bf+'-'+_0x381b08+'/'+_0xaef975)[_0x6db7('0x1d')](_0x4abfb4);}return null;};}function patchUpdates(_0x5c8a7c){return function(_0x44a65f){try{jsonpatch[_0x6db7('0x23')](_0x44a65f,_0x5c8a7c,!![]);}catch(_0x2a3f0b){return BPromise[_0x6db7('0x24')](_0x2a3f0b);}return _0x44a65f[_0x6db7('0x25')]();};}function saveUpdates(_0x3453e2,_0x1c31fd){return function(_0x3d26a5){if(_0x3d26a5){return _0x3d26a5[_0x6db7('0x26')](_0x3453e2)[_0x6db7('0x27')](function(_0x766ee8){return _0x766ee8;});}return null;};}function removeEntity(_0x5f2a14,_0x304269){return function(_0x428429){if(_0x428429){return _0x428429[_0x6db7('0x28')]()[_0x6db7('0x27')](function(){_0x5f2a14[_0x6db7('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2571f4,_0xd1ffe8){return function(_0x5bba99){if(!_0x5bba99){_0x2571f4[_0x6db7('0x1a')](0x194);}return _0x5bba99;};}function handleError(_0x5235a7,_0x2be4a8){_0x2be4a8=_0x2be4a8||0x1f4;return function(_0x59a150){logger[_0x6db7('0x29')](_0x59a150['stack']);if(_0x59a150[_0x6db7('0x2a')]){delete _0x59a150[_0x6db7('0x2a')];}_0x5235a7[_0x6db7('0x1b')](_0x2be4a8)[_0x6db7('0x2b')](_0x59a150);};}exports[_0x6db7('0x2c')]=function(_0x4a15fd,_0x2833d9){var _0x234f3c={},_0x4c0810={},_0x4766e7={'count':0x0,'rows':[]};var _0x22de42=_['map'](db[_0x6db7('0x2d')][_0x6db7('0x2e')],function(_0xe766fd){return{'name':_0xe766fd['fieldName'],'type':_0xe766fd['type'][_0x6db7('0x2f')]};});_0x4c0810[_0x6db7('0x30')]=_[_0x6db7('0x31')](_0x22de42,'name');_0x4c0810[_0x6db7('0x32')]=_[_0x6db7('0x33')](_0x4a15fd['query']);_0x4c0810['filters']=_['intersection'](_0x4c0810[_0x6db7('0x30')],_0x4c0810[_0x6db7('0x32')]);_0x234f3c[_0x6db7('0x34')]=_[_0x6db7('0x35')](_0x4c0810[_0x6db7('0x30')],qs[_0x6db7('0x36')](_0x4a15fd['query']['fields']));_0x234f3c[_0x6db7('0x34')]=_0x234f3c[_0x6db7('0x34')]['length']?_0x234f3c['attributes']:_0x4c0810[_0x6db7('0x30')];if(!_0x4a15fd[_0x6db7('0x32')][_0x6db7('0x37')](_0x6db7('0x38'))){_0x234f3c['limit']=qs[_0x6db7('0x1f')](_0x4a15fd['query'][_0x6db7('0x1f')]);_0x234f3c[_0x6db7('0x1e')]=qs[_0x6db7('0x1e')](_0x4a15fd[_0x6db7('0x32')]['offset']);}_0x234f3c[_0x6db7('0x39')]=qs[_0x6db7('0x3a')](_0x4a15fd[_0x6db7('0x32')]['sort']);_0x234f3c['where']=qs['filters'](_[_0x6db7('0x3b')](_0x4a15fd[_0x6db7('0x32')],_0x4c0810[_0x6db7('0x3c')]),_0x22de42);if(_0x4a15fd[_0x6db7('0x32')][_0x6db7('0x3d')]){_0x234f3c[_0x6db7('0x3e')]=_[_0x6db7('0x3f')](_0x234f3c['where'],{'$or':_[_0x6db7('0x31')](_0x22de42,function(_0x97e8ae){if(_0x97e8ae['type']!==_0x6db7('0x40')){var _0x54aa8a={};_0x54aa8a[_0x97e8ae[_0x6db7('0x2a')]]={'$like':'%'+_0x4a15fd['query'][_0x6db7('0x3d')]+'%'};return _0x54aa8a;}})});}_0x234f3c=_[_0x6db7('0x3f')]({},_0x234f3c,_0x4a15fd[_0x6db7('0x41')]);var _0x1707c8={'where':_0x234f3c[_0x6db7('0x3e')]};return db[_0x6db7('0x2d')][_0x6db7('0x20')](_0x1707c8)[_0x6db7('0x27')](function(_0x51b3c9){_0x4766e7[_0x6db7('0x20')]=_0x51b3c9;if(_0x4a15fd[_0x6db7('0x32')]['includeAll']){_0x234f3c[_0x6db7('0x42')]=[{'all':!![]}];}return db['ZendeskField'][_0x6db7('0x43')](_0x234f3c);})[_0x6db7('0x27')](function(_0x5d2935){_0x4766e7['rows']=_0x5d2935;return _0x4766e7;})[_0x6db7('0x27')](respondWithFilteredResult(_0x2833d9,_0x234f3c))[_0x6db7('0x44')](handleError(_0x2833d9,null));};exports['show']=function(_0x746ec6,_0x55781c){var _0xfcd3b4={'raw':!![],'where':{'id':_0x746ec6[_0x6db7('0x45')]['id']}},_0x3254e9={};_0x3254e9[_0x6db7('0x30')]=_[_0x6db7('0x33')](db['ZendeskField'][_0x6db7('0x2e')]);_0x3254e9[_0x6db7('0x32')]=_[_0x6db7('0x33')](_0x746ec6[_0x6db7('0x32')]);_0x3254e9[_0x6db7('0x3c')]=_['intersection'](_0x3254e9[_0x6db7('0x30')],_0x3254e9[_0x6db7('0x32')]);_0xfcd3b4[_0x6db7('0x34')]=_[_0x6db7('0x35')](_0x3254e9[_0x6db7('0x30')],qs[_0x6db7('0x36')](_0x746ec6['query']['fields']));_0xfcd3b4['attributes']=_0xfcd3b4['attributes'][_0x6db7('0x46')]?_0xfcd3b4[_0x6db7('0x34')]:_0x3254e9[_0x6db7('0x30')];if(_0x746ec6[_0x6db7('0x32')][_0x6db7('0x47')]){_0xfcd3b4[_0x6db7('0x42')]=[{'all':!![]}];}_0xfcd3b4=_[_0x6db7('0x3f')]({},_0xfcd3b4,_0x746ec6[_0x6db7('0x41')]);return db[_0x6db7('0x2d')][_0x6db7('0x48')](_0xfcd3b4)['then'](handleEntityNotFound(_0x55781c,null))[_0x6db7('0x27')](respondWithResult(_0x55781c,null))['catch'](handleError(_0x55781c,null));};exports[_0x6db7('0x49')]=function(_0x541453,_0x4f7a45){return db[_0x6db7('0x2d')][_0x6db7('0x49')](_0x541453[_0x6db7('0x4a')],{})['then'](respondWithResult(_0x4f7a45,0xc9))[_0x6db7('0x44')](handleError(_0x4f7a45,null));};exports[_0x6db7('0x26')]=function(_0x42f484,_0x4e4a02){if(_0x42f484[_0x6db7('0x4a')]['id']){delete _0x42f484[_0x6db7('0x4a')]['id'];}return db[_0x6db7('0x2d')][_0x6db7('0x48')]({'where':{'id':_0x42f484[_0x6db7('0x45')]['id']}})[_0x6db7('0x27')](handleEntityNotFound(_0x4e4a02,null))['then'](saveUpdates(_0x42f484[_0x6db7('0x4a')],null))[_0x6db7('0x27')](respondWithResult(_0x4e4a02,null))[_0x6db7('0x44')](handleError(_0x4e4a02,null));};exports[_0x6db7('0x28')]=function(_0x24894b,_0x18900c){return db[_0x6db7('0x2d')]['find']({'where':{'id':_0x24894b[_0x6db7('0x45')]['id']}})[_0x6db7('0x27')](handleEntityNotFound(_0x18900c,null))[_0x6db7('0x27')](removeEntity(_0x18900c,null))[_0x6db7('0x44')](handleError(_0x18900c,null));}; \ No newline at end of file +var _0xd66c=['error','stack','name','send','index','map','ZendeskField','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','fields','create','body','params','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','end','json','offset','limit','count','status','set','Content-Range','reject','save','update','then','destroy','sendStatus'];(function(_0xdbe2de,_0x3bdc5a){var _0x2facd7=function(_0x50df58){while(--_0x50df58){_0xdbe2de['push'](_0xdbe2de['shift']());}};_0x2facd7(++_0x3bdc5a);}(_0xd66c,0x106));var _0xcd66=function(_0x276a59,_0x7927ec){_0x276a59=_0x276a59-0x0;var _0x968168=_0xd66c[_0x276a59];return _0x968168;};'use strict';var emlformat=require(_0xcd66('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcd66('0x1'));var jsonpatch=require(_0xcd66('0x2'));var rp=require(_0xcd66('0x3'));var moment=require(_0xcd66('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xcd66('0x5'));var util=require(_0xcd66('0x6'));var path=require(_0xcd66('0x7'));var sox=require(_0xcd66('0x8'));var csv=require(_0xcd66('0x9'));var ejs=require(_0xcd66('0xa'));var fs=require('fs');var fs_extra=require(_0xcd66('0xb'));var _=require(_0xcd66('0xc'));var squel=require('squel');var crypto=require(_0xcd66('0xd'));var jsforce=require(_0xcd66('0xe'));var deskjs=require(_0xcd66('0xf'));var toCsv=require(_0xcd66('0x9'));var querystring=require(_0xcd66('0x10'));var Papa=require(_0xcd66('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xcd66('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcd66('0x13'));var logger=require(_0xcd66('0x14'))('api');var utils=require(_0xcd66('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xcd66('0x16'));var db=require(_0xcd66('0x17'))['db'];function respondWithStatusCode(_0x1cb4a9,_0x3e4e92){_0x3e4e92=_0x3e4e92||0xcc;return function(_0x35479d){if(_0x35479d){return _0x1cb4a9['sendStatus'](_0x3e4e92);}return _0x1cb4a9['status'](_0x3e4e92)[_0xcd66('0x18')]();};}function respondWithResult(_0x5d9bb4,_0x28ae0c){_0x28ae0c=_0x28ae0c||0xc8;return function(_0x588b46){if(_0x588b46){return _0x5d9bb4['status'](_0x28ae0c)[_0xcd66('0x19')](_0x588b46);}};}function respondWithFilteredResult(_0x1fafad,_0x4df4df){return function(_0x3178a7){if(_0x3178a7){var _0x3ed659=typeof _0x4df4df[_0xcd66('0x1a')]==='undefined'&&typeof _0x4df4df[_0xcd66('0x1b')]==='undefined';var _0x1268db=_0x3178a7[_0xcd66('0x1c')];var _0x191f8e=_0x3ed659?0x0:_0x4df4df[_0xcd66('0x1a')];var _0x35d431=_0x3ed659?_0x3178a7[_0xcd66('0x1c')]:_0x4df4df[_0xcd66('0x1a')]+_0x4df4df[_0xcd66('0x1b')];var _0x417907;if(_0x35d431>=_0x1268db){_0x35d431=_0x1268db;_0x417907=0xc8;}else{_0x417907=0xce;}_0x1fafad[_0xcd66('0x1d')](_0x417907);return _0x1fafad[_0xcd66('0x1e')](_0xcd66('0x1f'),_0x191f8e+'-'+_0x35d431+'/'+_0x1268db)[_0xcd66('0x19')](_0x3178a7);}return null;};}function patchUpdates(_0x2d3819){return function(_0x842033){try{jsonpatch['apply'](_0x842033,_0x2d3819,!![]);}catch(_0x3e3bea){return BPromise[_0xcd66('0x20')](_0x3e3bea);}return _0x842033[_0xcd66('0x21')]();};}function saveUpdates(_0x11c75c,_0x1cc184){return function(_0x1f8a04){if(_0x1f8a04){return _0x1f8a04[_0xcd66('0x22')](_0x11c75c)[_0xcd66('0x23')](function(_0x64424a){return _0x64424a;});}return null;};}function removeEntity(_0x35e19e,_0x5ec2d5){return function(_0x2ab69e){if(_0x2ab69e){return _0x2ab69e[_0xcd66('0x24')]()['then'](function(){_0x35e19e[_0xcd66('0x1d')](0xcc)[_0xcd66('0x18')]();});}};}function handleEntityNotFound(_0xb37e77,_0x526e13){return function(_0x141a64){if(!_0x141a64){_0xb37e77[_0xcd66('0x25')](0x194);}return _0x141a64;};}function handleError(_0x3de898,_0x54ac81){_0x54ac81=_0x54ac81||0x1f4;return function(_0x12891d){logger[_0xcd66('0x26')](_0x12891d[_0xcd66('0x27')]);if(_0x12891d[_0xcd66('0x28')]){delete _0x12891d[_0xcd66('0x28')];}_0x3de898[_0xcd66('0x1d')](_0x54ac81)[_0xcd66('0x29')](_0x12891d);};}exports[_0xcd66('0x2a')]=function(_0x51201f,_0xb6d828){var _0x51a7f6={},_0x2506d3={},_0x851a5c={'count':0x0,'rows':[]};var _0x2dfa40=_[_0xcd66('0x2b')](db[_0xcd66('0x2c')][_0xcd66('0x2d')],function(_0x54597e){return{'name':_0x54597e[_0xcd66('0x2e')],'type':_0x54597e[_0xcd66('0x2f')][_0xcd66('0x30')]};});_0x2506d3[_0xcd66('0x31')]=_['map'](_0x2dfa40,_0xcd66('0x28'));_0x2506d3[_0xcd66('0x32')]=_[_0xcd66('0x33')](_0x51201f[_0xcd66('0x32')]);_0x2506d3[_0xcd66('0x34')]=_['intersection'](_0x2506d3[_0xcd66('0x31')],_0x2506d3[_0xcd66('0x32')]);_0x51a7f6[_0xcd66('0x35')]=_[_0xcd66('0x36')](_0x2506d3['model'],qs['fields'](_0x51201f[_0xcd66('0x32')]['fields']));_0x51a7f6[_0xcd66('0x35')]=_0x51a7f6[_0xcd66('0x35')][_0xcd66('0x37')]?_0x51a7f6[_0xcd66('0x35')]:_0x2506d3[_0xcd66('0x31')];if(!_0x51201f[_0xcd66('0x32')][_0xcd66('0x38')]('nolimit')){_0x51a7f6[_0xcd66('0x1b')]=qs[_0xcd66('0x1b')](_0x51201f[_0xcd66('0x32')][_0xcd66('0x1b')]);_0x51a7f6['offset']=qs[_0xcd66('0x1a')](_0x51201f[_0xcd66('0x32')][_0xcd66('0x1a')]);}_0x51a7f6[_0xcd66('0x39')]=qs[_0xcd66('0x3a')](_0x51201f[_0xcd66('0x32')][_0xcd66('0x3a')]);_0x51a7f6[_0xcd66('0x3b')]=qs[_0xcd66('0x34')](_[_0xcd66('0x3c')](_0x51201f[_0xcd66('0x32')],_0x2506d3[_0xcd66('0x34')]),_0x2dfa40);if(_0x51201f[_0xcd66('0x32')][_0xcd66('0x3d')]){_0x51a7f6[_0xcd66('0x3b')]=_[_0xcd66('0x3e')](_0x51a7f6[_0xcd66('0x3b')],{'$or':_[_0xcd66('0x2b')](_0x2dfa40,function(_0x17a327){if(_0x17a327['type']!=='VIRTUAL'){var _0x8e55c6={};_0x8e55c6[_0x17a327['name']]={'$like':'%'+_0x51201f[_0xcd66('0x32')][_0xcd66('0x3d')]+'%'};return _0x8e55c6;}})});}_0x51a7f6=_[_0xcd66('0x3e')]({},_0x51a7f6,_0x51201f[_0xcd66('0x3f')]);var _0x2bfb26={'where':_0x51a7f6['where']};return db[_0xcd66('0x2c')][_0xcd66('0x1c')](_0x2bfb26)['then'](function(_0xd6bd6f){_0x851a5c[_0xcd66('0x1c')]=_0xd6bd6f;if(_0x51201f['query'][_0xcd66('0x40')]){_0x51a7f6[_0xcd66('0x41')]=[{'all':!![]}];}return db[_0xcd66('0x2c')][_0xcd66('0x42')](_0x51a7f6);})[_0xcd66('0x23')](function(_0x285ef4){_0x851a5c[_0xcd66('0x43')]=_0x285ef4;return _0x851a5c;})['then'](respondWithFilteredResult(_0xb6d828,_0x51a7f6))[_0xcd66('0x44')](handleError(_0xb6d828,null));};exports[_0xcd66('0x45')]=function(_0x2bb778,_0x333ee1){var _0x62802e={'raw':!![],'where':{'id':_0x2bb778['params']['id']}},_0x7e904d={};_0x7e904d[_0xcd66('0x31')]=_[_0xcd66('0x33')](db[_0xcd66('0x2c')][_0xcd66('0x2d')]);_0x7e904d['query']=_[_0xcd66('0x33')](_0x2bb778[_0xcd66('0x32')]);_0x7e904d[_0xcd66('0x34')]=_[_0xcd66('0x36')](_0x7e904d[_0xcd66('0x31')],_0x7e904d[_0xcd66('0x32')]);_0x62802e[_0xcd66('0x35')]=_[_0xcd66('0x36')](_0x7e904d[_0xcd66('0x31')],qs[_0xcd66('0x46')](_0x2bb778[_0xcd66('0x32')][_0xcd66('0x46')]));_0x62802e[_0xcd66('0x35')]=_0x62802e[_0xcd66('0x35')][_0xcd66('0x37')]?_0x62802e[_0xcd66('0x35')]:_0x7e904d[_0xcd66('0x31')];if(_0x2bb778['query'][_0xcd66('0x40')]){_0x62802e[_0xcd66('0x41')]=[{'all':!![]}];}_0x62802e=_[_0xcd66('0x3e')]({},_0x62802e,_0x2bb778[_0xcd66('0x3f')]);return db[_0xcd66('0x2c')]['find'](_0x62802e)[_0xcd66('0x23')](handleEntityNotFound(_0x333ee1,null))[_0xcd66('0x23')](respondWithResult(_0x333ee1,null))['catch'](handleError(_0x333ee1,null));};exports['create']=function(_0x533289,_0x11079c){return db[_0xcd66('0x2c')][_0xcd66('0x47')](_0x533289[_0xcd66('0x48')],{})[_0xcd66('0x23')](respondWithResult(_0x11079c,0xc9))[_0xcd66('0x44')](handleError(_0x11079c,null));};exports['update']=function(_0x2efa27,_0x558f09){if(_0x2efa27[_0xcd66('0x48')]['id']){delete _0x2efa27[_0xcd66('0x48')]['id'];}return db['ZendeskField']['find']({'where':{'id':_0x2efa27[_0xcd66('0x49')]['id']}})[_0xcd66('0x23')](handleEntityNotFound(_0x558f09,null))['then'](saveUpdates(_0x2efa27[_0xcd66('0x48')],null))['then'](respondWithResult(_0x558f09,null))[_0xcd66('0x44')](handleError(_0x558f09,null));};exports[_0xcd66('0x24')]=function(_0xb9051d,_0x52496f){return db[_0xcd66('0x2c')][_0xcd66('0x4a')]({'where':{'id':_0xb9051d[_0xcd66('0x49')]['id']}})[_0xcd66('0x23')](handleEntityNotFound(_0x52496f,null))[_0xcd66('0x23')](removeEntity(_0x52496f,null))['catch'](handleError(_0x52496f,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index e53048b..77f6bb2 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 _0x6674=['../../config/environment','./intZendeskField.attributes','exports','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','FieldId','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x497fc4,_0x5c4397){var _0x4aa448=function(_0x716950){while(--_0x716950){_0x497fc4['push'](_0x497fc4['shift']());}};_0x4aa448(++_0x5c4397);}(_0x6674,0xb9));var _0x4667=function(_0x448d37,_0x2c4c1a){_0x448d37=_0x448d37-0x0;var _0x79c922=_0x6674[_0x448d37];return _0x79c922;};'use strict';var _=require(_0x4667('0x0'));var util=require(_0x4667('0x1'));var logger=require('../../config/logger')(_0x4667('0x2'));var moment=require(_0x4667('0x3'));var BPromise=require(_0x4667('0x4'));var rp=require(_0x4667('0x5'));var fs=require('fs');var path=require(_0x4667('0x6'));var rimraf=require('rimraf');var config=require(_0x4667('0x7'));var attributes=require(_0x4667('0x8'));module[_0x4667('0x9')]=function(_0xbad3c0,_0x5a77a4){return _0xbad3c0[_0x4667('0xa')](_0x4667('0xb'),attributes,{'tableName':_0x4667('0xc'),'paranoid':![],'indexes':[{'name':_0x4667('0xd'),'fields':[_0x4667('0xe'),_0x4667('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x694a=['bluebird','request-promise','rimraf','./intZendeskField.attributes','exports','define','idField','FieldId','lodash','util','../../config/logger','api','moment'];(function(_0x1b7e2b,_0x1e8717){var _0x121830=function(_0x2aba6d){while(--_0x2aba6d){_0x1b7e2b['push'](_0x1b7e2b['shift']());}};_0x121830(++_0x1e8717);}(_0x694a,0x1c2));var _0xa694=function(_0x311909,_0x414bf7){_0x311909=_0x311909-0x0;var _0x8d3163=_0x694a[_0x311909];return _0x8d3163;};'use strict';var _=require(_0xa694('0x0'));var util=require(_0xa694('0x1'));var logger=require(_0xa694('0x2'))(_0xa694('0x3'));var moment=require(_0xa694('0x4'));var BPromise=require(_0xa694('0x5'));var rp=require(_0xa694('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa694('0x7'));var config=require('../../config/environment');var attributes=require(_0xa694('0x8'));module[_0xa694('0x9')]=function(_0x17f7d4,_0x170c22){return _0x17f7d4[_0xa694('0xa')]('ZendeskField',attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':[_0xa694('0xb'),_0xa694('0xc')],'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 317e347..ff7e4ce 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 _0x20c0=['debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','info','ZendeskField,\x20%s,\x20%s','request\x20sent'];(function(_0x493376,_0x49d7f7){var _0x29520c=function(_0x4f8c06){while(--_0x4f8c06){_0x493376['push'](_0x493376['shift']());}};_0x29520c(++_0x49d7f7);}(_0x20c0,0x142));var _0x020c=function(_0x55acbb,_0x459a49){_0x55acbb=_0x55acbb-0x0;var _0x5c8e7a=_0x20c0[_0x55acbb];return _0x5c8e7a;};'use strict';var _=require(_0x020c('0x0'));var util=require(_0x020c('0x1'));var moment=require('moment');var BPromise=require(_0x020c('0x2'));var rs=require(_0x020c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x020c('0x4'))['db'];var utils=require(_0x020c('0x5'));var logger=require('../../config/logger')(_0x020c('0x6'));var config=require(_0x020c('0x7'));var jayson=require(_0x020c('0x8'));var client=jayson[_0x020c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b9206,_0x21798e,_0x56b597){return new BPromise(function(_0x49e780,_0x2d51e5){return client[_0x020c('0xa')](_0x1b9206,_0x56b597)['then'](function(_0x1d8f94){logger[_0x020c('0xb')](_0x020c('0xc'),_0x21798e,_0x020c('0xd'));logger[_0x020c('0xe')](_0x020c('0xf'),_0x21798e,'request\x20sent',JSON[_0x020c('0x10')](_0x1d8f94));if(_0x1d8f94[_0x020c('0x11')]){if(_0x1d8f94[_0x020c('0x11')][_0x020c('0x12')]===0x1f4){logger[_0x020c('0x11')]('ZendeskField,\x20%s,\x20%s',_0x21798e,_0x1d8f94[_0x020c('0x11')][_0x020c('0x13')]);return _0x2d51e5(_0x1d8f94[_0x020c('0x11')]['message']);}logger[_0x020c('0x11')]('ZendeskField,\x20%s,\x20%s',_0x21798e,_0x1d8f94['error'][_0x020c('0x13')]);return _0x49e780(_0x1d8f94['error'][_0x020c('0x13')]);}else{logger[_0x020c('0xb')](_0x020c('0xc'),_0x21798e,_0x020c('0xd'));_0x49e780(_0x1d8f94['result'][_0x020c('0x13')]);}})[_0x020c('0x14')](function(_0x772902){logger[_0x020c('0x11')](_0x020c('0xc'),_0x21798e,_0x772902);_0x2d51e5(_0x772902);});});} \ No newline at end of file +var _0xfb08=['moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','ZendeskField,\x20%s,\x20%s','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','catch'];(function(_0x533990,_0x21fe8d){var _0x5a5e2a=function(_0x2539c3){while(--_0x2539c3){_0x533990['push'](_0x533990['shift']());}};_0x5a5e2a(++_0x21fe8d);}(_0xfb08,0x190));var _0x8fb0=function(_0x40b133,_0x24a5a7){_0x40b133=_0x40b133-0x0;var _0x38d315=_0xfb08[_0x40b133];return _0x38d315;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8fb0('0x0'));var BPromise=require(_0x8fb0('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8fb0('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x8fb0('0x3'));var logger=require('../../config/logger')(_0x8fb0('0x4'));var config=require(_0x8fb0('0x5'));var jayson=require(_0x8fb0('0x6'));var client=jayson[_0x8fb0('0x7')][_0x8fb0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x36cb4e,_0x563c0b,_0x5d41d4){return new BPromise(function(_0x51ed63,_0x4fb3e8){return client[_0x8fb0('0x9')](_0x36cb4e,_0x5d41d4)[_0x8fb0('0xa')](function(_0x1bb152){logger['info'](_0x8fb0('0xb'),_0x563c0b,'request\x20sent');logger['debug'](_0x8fb0('0xc'),_0x563c0b,'request\x20sent',JSON[_0x8fb0('0xd')](_0x1bb152));if(_0x1bb152['error']){if(_0x1bb152[_0x8fb0('0xe')][_0x8fb0('0xf')]===0x1f4){logger['error'](_0x8fb0('0xb'),_0x563c0b,_0x1bb152[_0x8fb0('0xe')][_0x8fb0('0x10')]);return _0x4fb3e8(_0x1bb152[_0x8fb0('0xe')][_0x8fb0('0x10')]);}logger[_0x8fb0('0xe')](_0x8fb0('0xb'),_0x563c0b,_0x1bb152[_0x8fb0('0xe')][_0x8fb0('0x10')]);return _0x51ed63(_0x1bb152[_0x8fb0('0xe')][_0x8fb0('0x10')]);}else{logger[_0x8fb0('0x11')](_0x8fb0('0xb'),_0x563c0b,_0x8fb0('0x12'));_0x51ed63(_0x1bb152['result'][_0x8fb0('0x10')]);}})[_0x8fb0('0x13')](function(_0x2f7d8f){logger[_0x8fb0('0xe')](_0x8fb0('0xb'),_0x563c0b,_0x2f7d8f);_0x4fb3e8(_0x2f7d8f);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 96c9bd2..15c7923 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 _0x8251=['index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated'];(function(_0x554507,_0x3617ef){var _0x2a6b61=function(_0xbde1c1){while(--_0xbde1c1){_0x554507['push'](_0x554507['shift']());}};_0x2a6b61(++_0x3617ef);}(_0x8251,0x19e));var _0x1825=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x8251[_0x53ccf2];return _0x5a2964;};'use strict';var multer=require(_0x1825('0x0'));var util=require('util');var path=require(_0x1825('0x1'));var timeout=require(_0x1825('0x2'));var express=require(_0x1825('0x3'));var router=express['Router']();var fs_extra=require(_0x1825('0x4'));var auth=require(_0x1825('0x5'));var interaction=require(_0x1825('0x6'));var config=require(_0x1825('0x7'));var controller=require(_0x1825('0x8'));router[_0x1825('0x9')]('/',auth[_0x1825('0xa')](),controller[_0x1825('0xb')]);router[_0x1825('0x9')](_0x1825('0xc'),auth['isAuthenticated'](),controller[_0x1825('0xd')]);router[_0x1825('0x9')](_0x1825('0xe'),auth[_0x1825('0xa')](),controller[_0x1825('0xf')]);router[_0x1825('0x9')](_0x1825('0x10'),auth[_0x1825('0xa')](),controller['getFields']);router[_0x1825('0x11')]('/',auth[_0x1825('0xa')](),controller[_0x1825('0x12')]);router[_0x1825('0x11')]('/:id/configurations',auth[_0x1825('0xa')](),controller[_0x1825('0x13')]);router[_0x1825('0x14')](_0x1825('0xc'),auth[_0x1825('0xa')](),controller[_0x1825('0x15')]);router[_0x1825('0x16')](_0x1825('0xc'),auth[_0x1825('0xa')](),controller[_0x1825('0x17')]);module[_0x1825('0x18')]=router; \ No newline at end of file +var _0x7fd4=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZohoAccount.controller','isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','create','put','update','destroy','util','connect-timeout','express'];(function(_0x32b62e,_0x422213){var _0x967254=function(_0x25dfaa){while(--_0x25dfaa){_0x32b62e['push'](_0x32b62e['shift']());}};_0x967254(++_0x422213);}(_0x7fd4,0x177));var _0x47fd=function(_0x21f9c2,_0x2b3d2a){_0x21f9c2=_0x21f9c2-0x0;var _0x3da17f=_0x7fd4[_0x21f9c2];return _0x3da17f;};'use strict';var multer=require('multer');var util=require(_0x47fd('0x0'));var path=require('path');var timeout=require(_0x47fd('0x1'));var express=require(_0x47fd('0x2'));var router=express[_0x47fd('0x3')]();var fs_extra=require(_0x47fd('0x4'));var auth=require(_0x47fd('0x5'));var interaction=require(_0x47fd('0x6'));var config=require('../../config/environment');var controller=require(_0x47fd('0x7'));router['get']('/',auth[_0x47fd('0x8')](),controller[_0x47fd('0x9')]);router[_0x47fd('0xa')](_0x47fd('0xb'),auth[_0x47fd('0x8')](),controller[_0x47fd('0xc')]);router['get'](_0x47fd('0xd'),auth[_0x47fd('0x8')](),controller[_0x47fd('0xe')]);router[_0x47fd('0xa')](_0x47fd('0xf'),auth['isAuthenticated'](),controller['getFields']);router[_0x47fd('0x10')]('/',auth[_0x47fd('0x8')](),controller[_0x47fd('0x11')]);router[_0x47fd('0x10')](_0x47fd('0xd'),auth[_0x47fd('0x8')](),controller['addConfiguration']);router[_0x47fd('0x12')]('/:id',auth[_0x47fd('0x8')](),controller[_0x47fd('0x13')]);router['delete']('/:id',auth[_0x47fd('0x8')](),controller[_0x47fd('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index d3a2096..62c15c1 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 _0xee5b=['sequelize','STRING'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xee5b,0x1f4));var _0xbee5=function(_0x32a0d1,_0x2f915c){_0x32a0d1=_0x32a0d1-0x0;var _0x4b2f3c=_0xee5b[_0x32a0d1];return _0x4b2f3c;};'use strict';var Sequelize=require(_0xbee5('0x0'));module['exports']={'name':{'type':Sequelize[_0xbee5('0x1')]},'description':{'type':Sequelize[_0xbee5('0x1')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0xbee5('0x1')]},'clientId':{'type':Sequelize[_0xbee5('0x1')]},'clientSecret':{'type':Sequelize[_0xbee5('0x1')]},'serverUrl':{'type':Sequelize[_0xbee5('0x1')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xda55=['STRING','sequelize','exports'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0xda55,0x6d));var _0x5da5=function(_0x38f5fe,_0x53da89){_0x38f5fe=_0x38f5fe-0x0;var _0x54ab60=_0xda55[_0x38f5fe];return _0x54ab60;};'use strict';var Sequelize=require(_0x5da5('0x0'));module[_0x5da5('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x5da5('0x2')]},'zone':{'type':Sequelize[_0x5da5('0x2')]},'clientId':{'type':Sequelize[_0x5da5('0x2')]},'clientSecret':{'type':Sequelize[_0x5da5('0x2')]},'serverUrl':{'type':Sequelize[_0x5da5('0x2')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0x5da5('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index f1fa83e..1ac4b9d 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 _0xac1a=['filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','length','find','catch','create','body','params','getConfigurations','ZohoConfiguration','order','findOne','AccountId','Subjects','channel','Descriptions','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','/oauth/v2/token','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','refreshToken','zoho.eu','com','serverUrl','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','Description','WhoId','Call_Duration','Call_Result','Call_Type','remove','includes','api_name','system_mandatory','display_label','custom_field','data_type','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','index','map','ZohoAccount','rawAttributes','type','key','query','keys','filters','model','intersection','fields','attributes','hasOwnProperty','nolimit','sort','pick'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0xac1a,0x156));var _0xaac1=function(_0x4f841b,_0x487982){_0x4f841b=_0x4f841b-0x0;var _0x226bac=_0xac1a[_0x4f841b];return _0x226bac;};'use strict';var emlformat=require(_0xaac1('0x0'));var rimraf=require(_0xaac1('0x1'));var zipdir=require(_0xaac1('0x2'));var jsonpatch=require(_0xaac1('0x3'));var rp=require(_0xaac1('0x4'));var moment=require(_0xaac1('0x5'));var BPromise=require(_0xaac1('0x6'));var Mustache=require('mustache');var util=require(_0xaac1('0x7'));var path=require(_0xaac1('0x8'));var sox=require('sox');var csv=require(_0xaac1('0x9'));var ejs=require(_0xaac1('0xa'));var fs=require('fs');var fs_extra=require(_0xaac1('0xb'));var _=require(_0xaac1('0xc'));var squel=require(_0xaac1('0xd'));var crypto=require('crypto');var jsforce=require(_0xaac1('0xe'));var deskjs=require(_0xaac1('0xf'));var toCsv=require('to-csv');var querystring=require(_0xaac1('0x10'));var Papa=require(_0xaac1('0x11'));var Redis=require(_0xaac1('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xaac1('0x13'));var hardwareService=require(_0xaac1('0x14'));var logger=require(_0xaac1('0x15'))(_0xaac1('0x16'));var utils=require('../../config/utils');var config=require(_0xaac1('0x17'));var licenseUtil=require(_0xaac1('0x18'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0xeba9d6,_0x5293b0){_0x5293b0=_0x5293b0||0xcc;return function(_0x587e63){if(_0x587e63){return _0xeba9d6[_0xaac1('0x19')](_0x5293b0);}return _0xeba9d6[_0xaac1('0x1a')](_0x5293b0)['end']();};}function respondWithResult(_0x262fcc,_0x57e6b5){_0x57e6b5=_0x57e6b5||0xc8;return function(_0x21b1fd){if(_0x21b1fd){return _0x262fcc[_0xaac1('0x1a')](_0x57e6b5)['json'](_0x21b1fd);}};}function respondWithFilteredResult(_0x3b1169,_0x27bb90){return function(_0x52930b){if(_0x52930b){var _0x294c7e=typeof _0x27bb90[_0xaac1('0x1b')]===_0xaac1('0x1c')&&typeof _0x27bb90[_0xaac1('0x1d')]==='undefined';var _0x5ee773=_0x52930b[_0xaac1('0x1e')];var _0x5d8f33=_0x294c7e?0x0:_0x27bb90[_0xaac1('0x1b')];var _0x158b10=_0x294c7e?_0x52930b[_0xaac1('0x1e')]:_0x27bb90[_0xaac1('0x1b')]+_0x27bb90['limit'];var _0x2cbc2f;if(_0x158b10>=_0x5ee773){_0x158b10=_0x5ee773;_0x2cbc2f=0xc8;}else{_0x2cbc2f=0xce;}_0x3b1169[_0xaac1('0x1a')](_0x2cbc2f);return _0x3b1169[_0xaac1('0x1f')](_0xaac1('0x20'),_0x5d8f33+'-'+_0x158b10+'/'+_0x5ee773)['json'](_0x52930b);}return null;};}function patchUpdates(_0x661b09){return function(_0x2391cc){try{jsonpatch[_0xaac1('0x21')](_0x2391cc,_0x661b09,!![]);}catch(_0x12fb7f){return BPromise[_0xaac1('0x22')](_0x12fb7f);}return _0x2391cc[_0xaac1('0x23')]();};}function saveUpdates(_0x23caf1,_0x2ff5af){return function(_0x30e121){if(_0x30e121){return _0x30e121[_0xaac1('0x24')](_0x23caf1)[_0xaac1('0x25')](function(_0x27a769){return _0x27a769;});}return null;};}function removeEntity(_0x27178b,_0x46d9a2){return function(_0x233906){if(_0x233906){return _0x233906[_0xaac1('0x26')]()[_0xaac1('0x25')](function(){_0x27178b[_0xaac1('0x1a')](0xcc)[_0xaac1('0x27')]();});}};}function handleEntityNotFound(_0x4ccde0,_0x251ffb){return function(_0x24d033){if(!_0x24d033){_0x4ccde0[_0xaac1('0x19')](0x194);}return _0x24d033;};}function handleError(_0x24d141,_0x42f342){_0x42f342=_0x42f342||0x1f4;return function(_0x52ece6){logger[_0xaac1('0x28')](_0x52ece6[_0xaac1('0x29')]);if(_0x52ece6[_0xaac1('0x2a')]){delete _0x52ece6[_0xaac1('0x2a')];}_0x24d141[_0xaac1('0x1a')](_0x42f342)['send'](_0x52ece6);};}exports[_0xaac1('0x2b')]=function(_0x4a021d,_0x1885e4){var _0xa6fdc0={},_0x1cccb8={},_0x2f3e52={'count':0x0,'rows':[]};var _0x394207=_[_0xaac1('0x2c')](db[_0xaac1('0x2d')][_0xaac1('0x2e')],function(_0x2a0f96){return{'name':_0x2a0f96['fieldName'],'type':_0x2a0f96[_0xaac1('0x2f')][_0xaac1('0x30')]};});_0x1cccb8['model']=_['map'](_0x394207,_0xaac1('0x2a'));_0x1cccb8[_0xaac1('0x31')]=_[_0xaac1('0x32')](_0x4a021d[_0xaac1('0x31')]);_0x1cccb8[_0xaac1('0x33')]=_['intersection'](_0x1cccb8[_0xaac1('0x34')],_0x1cccb8[_0xaac1('0x31')]);_0xa6fdc0['attributes']=_[_0xaac1('0x35')](_0x1cccb8[_0xaac1('0x34')],qs['fields'](_0x4a021d[_0xaac1('0x31')][_0xaac1('0x36')]));_0xa6fdc0[_0xaac1('0x37')]=_0xa6fdc0['attributes']['length']?_0xa6fdc0['attributes']:_0x1cccb8[_0xaac1('0x34')];if(!_0x4a021d[_0xaac1('0x31')][_0xaac1('0x38')](_0xaac1('0x39'))){_0xa6fdc0[_0xaac1('0x1d')]=qs[_0xaac1('0x1d')](_0x4a021d['query'][_0xaac1('0x1d')]);_0xa6fdc0[_0xaac1('0x1b')]=qs['offset'](_0x4a021d['query']['offset']);}_0xa6fdc0['order']=qs['sort'](_0x4a021d[_0xaac1('0x31')][_0xaac1('0x3a')]);_0xa6fdc0['where']=qs['filters'](_[_0xaac1('0x3b')](_0x4a021d['query'],_0x1cccb8[_0xaac1('0x33')]),_0x394207);if(_0x4a021d[_0xaac1('0x31')][_0xaac1('0x3c')]){_0xa6fdc0[_0xaac1('0x3d')]=_[_0xaac1('0x3e')](_0xa6fdc0[_0xaac1('0x3d')],{'$or':_['map'](_0x394207,function(_0x5b0656){if(_0x5b0656[_0xaac1('0x2f')]!==_0xaac1('0x3f')){var _0x869335={};_0x869335[_0x5b0656[_0xaac1('0x2a')]]={'$like':'%'+_0x4a021d['query'][_0xaac1('0x3c')]+'%'};return _0x869335;}})});}_0xa6fdc0=_[_0xaac1('0x3e')]({},_0xa6fdc0,_0x4a021d[_0xaac1('0x40')]);var _0x2bd1e4={'where':_0xa6fdc0[_0xaac1('0x3d')]};return db[_0xaac1('0x2d')][_0xaac1('0x1e')](_0x2bd1e4)[_0xaac1('0x25')](function(_0x1ba0d9){_0x2f3e52[_0xaac1('0x1e')]=_0x1ba0d9;if(_0x4a021d[_0xaac1('0x31')][_0xaac1('0x41')]){_0xa6fdc0[_0xaac1('0x42')]=[{'all':!![]}];}return db['ZohoAccount'][_0xaac1('0x43')](_0xa6fdc0);})['then'](function(_0x1b73c2){_0x2f3e52[_0xaac1('0x44')]=_0x1b73c2;return _0x2f3e52;})['then'](respondWithFilteredResult(_0x1885e4,_0xa6fdc0))['catch'](handleError(_0x1885e4,null));};exports[_0xaac1('0x45')]=function(_0x405b85,_0x2942c6){var _0x389a37={'raw':![],'where':{'id':_0x405b85['params']['id']}},_0x3e73f8={};_0x3e73f8[_0xaac1('0x34')]=_['keys'](db['ZohoAccount'][_0xaac1('0x2e')]);_0x3e73f8[_0xaac1('0x31')]=_[_0xaac1('0x32')](_0x405b85[_0xaac1('0x31')]);_0x3e73f8[_0xaac1('0x33')]=_[_0xaac1('0x35')](_0x3e73f8[_0xaac1('0x34')],_0x3e73f8[_0xaac1('0x31')]);_0x389a37[_0xaac1('0x37')]=_[_0xaac1('0x35')](_0x3e73f8[_0xaac1('0x34')],qs[_0xaac1('0x36')](_0x405b85['query'][_0xaac1('0x36')]));_0x389a37[_0xaac1('0x37')]=_0x389a37[_0xaac1('0x37')][_0xaac1('0x46')]?_0x389a37[_0xaac1('0x37')]:_0x3e73f8[_0xaac1('0x34')];if(_0x405b85[_0xaac1('0x31')]['includeAll']){_0x389a37['include']=[{'all':!![]}];}_0x389a37=_[_0xaac1('0x3e')]({},_0x389a37,_0x405b85[_0xaac1('0x40')]);return db[_0xaac1('0x2d')][_0xaac1('0x47')](_0x389a37)[_0xaac1('0x25')](handleEntityNotFound(_0x2942c6,null))[_0xaac1('0x25')](respondWithResult(_0x2942c6,null))[_0xaac1('0x48')](handleError(_0x2942c6,null));};exports['create']=function(_0x55ad3d,_0x39cf28){return db[_0xaac1('0x2d')][_0xaac1('0x49')](_0x55ad3d[_0xaac1('0x4a')],{})[_0xaac1('0x25')](respondWithResult(_0x39cf28,0xc9))[_0xaac1('0x48')](handleError(_0x39cf28,null));};exports[_0xaac1('0x24')]=function(_0x43bb9a,_0x3730bf){if(_0x43bb9a[_0xaac1('0x4a')]['id']){delete _0x43bb9a['body']['id'];}return db[_0xaac1('0x2d')]['find']({'where':{'id':_0x43bb9a[_0xaac1('0x4b')]['id']}})[_0xaac1('0x25')](handleEntityNotFound(_0x3730bf,null))['then'](saveUpdates(_0x43bb9a[_0xaac1('0x4a')],null))[_0xaac1('0x25')](respondWithResult(_0x3730bf,null))[_0xaac1('0x48')](handleError(_0x3730bf,null));};exports[_0xaac1('0x26')]=function(_0x1b2de2,_0xc8ec23){return db[_0xaac1('0x2d')][_0xaac1('0x47')]({'where':{'id':_0x1b2de2[_0xaac1('0x4b')]['id']}})['then'](handleEntityNotFound(_0xc8ec23,null))[_0xaac1('0x25')](removeEntity(_0xc8ec23,null))[_0xaac1('0x48')](handleError(_0xc8ec23,null));};exports[_0xaac1('0x4c')]=function(_0x408b0b,_0x8e193b,_0x1fe365){var _0x2e1668={};var _0x4eaa15={};var _0x3f4b44;var _0x31c039;return db[_0xaac1('0x2d')]['findOne']({'where':{'id':_0x408b0b[_0xaac1('0x4b')]['id']}})['then'](handleEntityNotFound(_0x8e193b,null))['then'](function(_0x256899){if(_0x256899){_0x3f4b44=_0x256899;_0x4eaa15['model']=_[_0xaac1('0x32')](db[_0xaac1('0x4d')][_0xaac1('0x2e')]);_0x4eaa15[_0xaac1('0x31')]=_['keys'](_0x408b0b[_0xaac1('0x31')]);_0x4eaa15['filters']=_['intersection'](_0x4eaa15[_0xaac1('0x34')],_0x4eaa15[_0xaac1('0x31')]);_0x2e1668[_0xaac1('0x37')]=_[_0xaac1('0x35')](_0x4eaa15['model'],qs[_0xaac1('0x36')](_0x408b0b[_0xaac1('0x31')]['fields']));_0x2e1668[_0xaac1('0x37')]=_0x2e1668[_0xaac1('0x37')]['length']?_0x2e1668[_0xaac1('0x37')]:_0x4eaa15[_0xaac1('0x34')];_0x2e1668[_0xaac1('0x4e')]=qs['sort'](_0x408b0b[_0xaac1('0x31')]['sort']);_0x2e1668[_0xaac1('0x3d')]=qs[_0xaac1('0x33')](_[_0xaac1('0x3b')](_0x408b0b['query'],_0x4eaa15[_0xaac1('0x33')]));if(_0x408b0b['query']['filter']){_0x2e1668[_0xaac1('0x3d')]=_[_0xaac1('0x3e')](_0x2e1668['where'],{'$or':_[_0xaac1('0x2c')](_0x2e1668[_0xaac1('0x37')],function(_0x1623f0){var _0x4a4584={};_0x4a4584[_0x1623f0]={'$like':'%'+_0x408b0b[_0xaac1('0x31')][_0xaac1('0x3c')]+'%'};return _0x4a4584;})});}_0x2e1668=_[_0xaac1('0x3e')]({},_0x2e1668,_0x408b0b[_0xaac1('0x40')]);return _0x3f4b44[_0xaac1('0x4c')](_0x2e1668);}})[_0xaac1('0x25')](function(_0x30c245){if(_0x30c245){_0x31c039=_0x30c245['length'];if(!_0x408b0b['query']['hasOwnProperty'](_0xaac1('0x39'))){_0x2e1668['limit']=qs[_0xaac1('0x1d')](_0x408b0b[_0xaac1('0x31')][_0xaac1('0x1d')]);_0x2e1668[_0xaac1('0x1b')]=qs[_0xaac1('0x1b')](_0x408b0b[_0xaac1('0x31')][_0xaac1('0x1b')]);}return _0x3f4b44[_0xaac1('0x4c')](_0x2e1668);}})[_0xaac1('0x25')](function(_0x2c8908){if(_0x2c8908){return _0x2c8908?{'count':_0x31c039,'rows':_0x2c8908}:null;}})[_0xaac1('0x25')](respondWithResult(_0x8e193b,null))[_0xaac1('0x48')](handleError(_0x8e193b,null));};exports['addConfiguration']=function(_0x4fa371,_0x1e7d0f,_0x1ea2fb){if(_0x4fa371['body']['id']){delete _0x4fa371[_0xaac1('0x4a')]['id'];}return db[_0xaac1('0x2d')][_0xaac1('0x4f')]({'where':{'id':_0x4fa371[_0xaac1('0x4b')]['id']}})[_0xaac1('0x25')](handleEntityNotFound(_0x1e7d0f,null))['then'](function(_0x3f3c6e){if(_0x3f3c6e){_0x4fa371['body'][_0xaac1('0x50')]=_0x3f3c6e['id'];_0x4fa371[_0xaac1('0x4a')][_0xaac1('0x51')]=integrations['getSubjects'](_0x4fa371[_0xaac1('0x4a')][_0xaac1('0x52')],_0x4fa371[_0xaac1('0x4a')][_0xaac1('0x2f')]);_0x4fa371[_0xaac1('0x4a')][_0xaac1('0x53')]=integrations['getDescriptions'](_0x4fa371[_0xaac1('0x4a')][_0xaac1('0x52')],_0x4fa371[_0xaac1('0x4a')]['type']);return db[_0xaac1('0x4d')]['create'](_0x4fa371[_0xaac1('0x4a')],{'include':[{'model':db[_0xaac1('0x54')],'as':_0xaac1('0x51')},{'model':db[_0xaac1('0x54')],'as':_0xaac1('0x53')}]});}return null;})['then'](respondWithResult(_0x1e7d0f,null))['catch'](handleError(_0x1e7d0f,null));};function getAccessToken(_0x284e0f){return new Promise(function(_0x2d8160,_0x6bd4d0){var _0xfca0ec;switch(_0x284e0f[_0xaac1('0x55')]){case'US':_0xfca0ec=_0xaac1('0x56');break;case'AU':_0xfca0ec=_0xaac1('0x57');break;case'EU':_0xfca0ec=_0xaac1('0x58');break;case'IN':_0xfca0ec=_0xaac1('0x59');break;case'CN':_0xfca0ec=_0xaac1('0x5a');break;default:_0xfca0ec='https://accounts.zoho.eu';break;}var _0x30cff5={'method':'POST','uri':_0xfca0ec+_0xaac1('0x5b'),'qs':{'refresh_token':_0x284e0f['refreshToken'],'client_id':_0x284e0f[_0xaac1('0x5c')],'client_secret':_0x284e0f[_0xaac1('0x5d')],'grant_type':_0xaac1('0x5e')},'json':!![]};return rp(_0x30cff5)[_0xaac1('0x25')](function(_0x536522){if(_0x536522[_0xaac1('0x5f')]){_0x2d8160(_0x536522['access_token']);}else{_0x6bd4d0(_0xaac1('0x60'));}})['catch'](function(_0xfb5c47){_0x6bd4d0(_0xfb5c47);});});}exports[_0xaac1('0x61')]=function(_0x50c431,_0x24c059,_0x23458a){var _0x40810d,_0x13377c,_0x52182a,_0xe2e2e7,_0x28846b;return db['ZohoAccount'][_0xaac1('0x4f')]({'where':{'id':_0x50c431[_0xaac1('0x4b')]['id']},'attributes':['id',_0xaac1('0x62'),'zone','clientId',_0xaac1('0x5d'),'serverUrl','code',_0xaac1('0x63')]})[_0xaac1('0x25')](handleEntityNotFound(_0x24c059,null))['then'](function(_0x51b293){_0x28846b=_0x51b293;_0x40810d=_0x28846b['host'];_0x13377c=_0x40810d===_0xaac1('0x64')?'eu':_0xaac1('0x65');_0x52182a=_0x28846b[_0xaac1('0x66')];var _0x42311c=_0x52182a['slice'](-0x1);if(_0x42311c==='/'||_0x42311c==='\x5c'||_0x42311c===':'){_0x52182a=_0x52182a[_0xaac1('0x67')](0x0,_0x52182a[_0xaac1('0x68')](_0x42311c));}if(!_0x28846b[_0xaac1('0x63')]){throw new Error(_0xaac1('0x69'));}return getAccessToken(_0x28846b);})[_0xaac1('0x25')](function(_0x46c5ed){if(_0x46c5ed){return rp({'method':_0xaac1('0x6a'),'uri':util['format'](_0xaac1('0x6b'),_0x13377c),'qs':{'module':_0xaac1('0x6c')},'headers':{'Authorization':_0xaac1('0x6d')+_0x46c5ed},'json':!![]});}})[_0xaac1('0x25')](function(_0x445bca){if(_0x445bca){if(_0x445bca['response']&&_0x445bca[_0xaac1('0x6e')][_0xaac1('0x28')]){throw new Error(_0x445bca['response']['error'][_0xaac1('0x6f')]);}var _0x5ae58b=[];var _0x50e21f=[];var _0x43b472=[_0xaac1('0x70'),_0xaac1('0x71'),_0xaac1('0x72'),_0xaac1('0x73'),_0xaac1('0x74'),_0xaac1('0x75'),'Call_Start_Time',_0xaac1('0x76')];_0x50e21f=_[_0xaac1('0x77')](_0x445bca[_0xaac1('0x36')],function(_0x3201ca){return _0x43b472[_0xaac1('0x78')](_0x3201ca[_0xaac1('0x79')]);});for(var _0x307dfe=0x0;_0x307dfe<_0x50e21f[_0xaac1('0x46')];_0x307dfe++){if(_0x50e21f[_0x307dfe][_0xaac1('0x7a')]===![]){_0x5ae58b['push']({'id':_0x50e21f[_0x307dfe]['id'],'name':_0x50e21f[_0x307dfe][_0xaac1('0x7b')],'custom':_0x50e21f[_0x307dfe][_0xaac1('0x7c')],'options':_0x50e21f[_0x307dfe][_0xaac1('0x7d')]===_0xaac1('0x7e')&&_0x50e21f[_0x307dfe][_0xaac1('0x7f')]['length']>-0x1?_[_0xaac1('0x2c')](_0x50e21f[_0x307dfe][_0xaac1('0x7f')],function(_0x117b62){return{'name':_0x117b62,'value':_0x117b62};}):[]});}}return{'count':_0x5ae58b[_0xaac1('0x46')],'rows':_0x5ae58b};}else{return{'count':0x0,'rows':[]};}})[_0xaac1('0x25')](respondWithResult(_0x24c059,null))[_0xaac1('0x48')](function(_0xbe6c94){var _0x3ae2fa=_0x50c431[_0xaac1('0x31')][_0xaac1('0x80')]?0x1f4:_0xbe6c94[_0xaac1('0x81')]||0x1f4;logger[_0xaac1('0x28')](_0xaac1('0x82'),_0xaac1('0x61'),_0x3ae2fa,JSON[_0xaac1('0x83')](_0xbe6c94));delete _0xbe6c94['name'];if(_0x3ae2fa===0x191){_0x3ae2fa=0x190;}_0x24c059[_0xaac1('0x1a')](_0x3ae2fa)[_0xaac1('0x84')](_0x50c431[_0xaac1('0x31')][_0xaac1('0x80')]?{'message':_0xaac1('0x85'),'statusCode':_0xbe6c94[_0xaac1('0x81')]}:_0xbe6c94);});}; \ No newline at end of file +var _0xf0cf=['https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','host','serverUrl','code','zoho.eu','slice','substring','lastIndexOf','GET','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','Owner','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','api_name','system_mandatory','push','custom_field','data_type','pick_list_values','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','send','test','eml-format','rimraf','zip-dir','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/logger','api','../../config/utils','../../config/environment','../../components/integrations/configuration','sendStatus','status','json','offset','limit','count','Content-Range','apply','reject','save','update','destroy','then','end','error','stack','name','index','map','rawAttributes','type','key','model','query','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','ZohoAccount','rows','show','keys','length','find','catch','create','body','params','getConfigurations','findOne','ZohoConfiguration','hasOwnProperty','addConfiguration','AccountId','Subjects','channel','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in'];(function(_0x10eb92,_0x52eaf5){var _0x113e84=function(_0x4486c2){while(--_0x4486c2){_0x10eb92['push'](_0x10eb92['shift']());}};_0x113e84(++_0x52eaf5);}(_0xf0cf,0x133));var _0xff0c=function(_0x1ec7db,_0x2ff8cc){_0x1ec7db=_0x1ec7db-0x0;var _0x20327a=_0xf0cf[_0x1ec7db];return _0x20327a;};'use strict';var emlformat=require(_0xff0c('0x0'));var rimraf=require(_0xff0c('0x1'));var zipdir=require(_0xff0c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xff0c('0x3'));var BPromise=require(_0xff0c('0x4'));var Mustache=require(_0xff0c('0x5'));var util=require(_0xff0c('0x6'));var path=require(_0xff0c('0x7'));var sox=require(_0xff0c('0x8'));var csv=require('to-csv');var ejs=require(_0xff0c('0x9'));var fs=require('fs');var fs_extra=require(_0xff0c('0xa'));var _=require(_0xff0c('0xb'));var squel=require(_0xff0c('0xc'));var crypto=require(_0xff0c('0xd'));var jsforce=require(_0xff0c('0xe'));var deskjs=require(_0xff0c('0xf'));var toCsv=require(_0xff0c('0x10'));var querystring=require(_0xff0c('0x11'));var Papa=require(_0xff0c('0x12'));var Redis=require(_0xff0c('0x13'));var authService=require(_0xff0c('0x14'));var qs=require(_0xff0c('0x15'));var as=require(_0xff0c('0x16'));var hardwareService=require(_0xff0c('0x17'));var logger=require(_0xff0c('0x18'))(_0xff0c('0x19'));var utils=require(_0xff0c('0x1a'));var config=require(_0xff0c('0x1b'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0xff0c('0x1c'));function respondWithStatusCode(_0x2a869e,_0x41b6f5){_0x41b6f5=_0x41b6f5||0xcc;return function(_0x48db1a){if(_0x48db1a){return _0x2a869e[_0xff0c('0x1d')](_0x41b6f5);}return _0x2a869e['status'](_0x41b6f5)['end']();};}function respondWithResult(_0xaf9208,_0x996eb8){_0x996eb8=_0x996eb8||0xc8;return function(_0x401d3d){if(_0x401d3d){return _0xaf9208[_0xff0c('0x1e')](_0x996eb8)[_0xff0c('0x1f')](_0x401d3d);}};}function respondWithFilteredResult(_0x11cc64,_0xa92507){return function(_0x5c23eb){if(_0x5c23eb){var _0x24af53=typeof _0xa92507[_0xff0c('0x20')]==='undefined'&&typeof _0xa92507[_0xff0c('0x21')]==='undefined';var _0x19d224=_0x5c23eb[_0xff0c('0x22')];var _0x272f1a=_0x24af53?0x0:_0xa92507['offset'];var _0x1fa807=_0x24af53?_0x5c23eb[_0xff0c('0x22')]:_0xa92507[_0xff0c('0x20')]+_0xa92507[_0xff0c('0x21')];var _0x1846cd;if(_0x1fa807>=_0x19d224){_0x1fa807=_0x19d224;_0x1846cd=0xc8;}else{_0x1846cd=0xce;}_0x11cc64['status'](_0x1846cd);return _0x11cc64['set'](_0xff0c('0x23'),_0x272f1a+'-'+_0x1fa807+'/'+_0x19d224)[_0xff0c('0x1f')](_0x5c23eb);}return null;};}function patchUpdates(_0x1edf93){return function(_0x449027){try{jsonpatch[_0xff0c('0x24')](_0x449027,_0x1edf93,!![]);}catch(_0x3c1183){return BPromise[_0xff0c('0x25')](_0x3c1183);}return _0x449027[_0xff0c('0x26')]();};}function saveUpdates(_0x2381cb,_0x2435c8){return function(_0x2dd3bb){if(_0x2dd3bb){return _0x2dd3bb[_0xff0c('0x27')](_0x2381cb)['then'](function(_0x52e437){return _0x52e437;});}return null;};}function removeEntity(_0x26a71a,_0x20ab79){return function(_0x1ee8e){if(_0x1ee8e){return _0x1ee8e[_0xff0c('0x28')]()[_0xff0c('0x29')](function(){_0x26a71a['status'](0xcc)[_0xff0c('0x2a')]();});}};}function handleEntityNotFound(_0x437fa3,_0x4ddd32){return function(_0x7f3745){if(!_0x7f3745){_0x437fa3[_0xff0c('0x1d')](0x194);}return _0x7f3745;};}function handleError(_0x21e43a,_0x1003cf){_0x1003cf=_0x1003cf||0x1f4;return function(_0x39575a){logger[_0xff0c('0x2b')](_0x39575a[_0xff0c('0x2c')]);if(_0x39575a[_0xff0c('0x2d')]){delete _0x39575a[_0xff0c('0x2d')];}_0x21e43a['status'](_0x1003cf)['send'](_0x39575a);};}exports[_0xff0c('0x2e')]=function(_0x357fbf,_0x4ec765){var _0xed45e0={},_0x2a3697={},_0x30bbfb={'count':0x0,'rows':[]};var _0x12f404=_[_0xff0c('0x2f')](db['ZohoAccount'][_0xff0c('0x30')],function(_0x5d502a){return{'name':_0x5d502a['fieldName'],'type':_0x5d502a[_0xff0c('0x31')][_0xff0c('0x32')]};});_0x2a3697[_0xff0c('0x33')]=_[_0xff0c('0x2f')](_0x12f404,_0xff0c('0x2d'));_0x2a3697[_0xff0c('0x34')]=_['keys'](_0x357fbf[_0xff0c('0x34')]);_0x2a3697[_0xff0c('0x35')]=_[_0xff0c('0x36')](_0x2a3697[_0xff0c('0x33')],_0x2a3697[_0xff0c('0x34')]);_0xed45e0['attributes']=_['intersection'](_0x2a3697[_0xff0c('0x33')],qs[_0xff0c('0x37')](_0x357fbf['query'][_0xff0c('0x37')]));_0xed45e0['attributes']=_0xed45e0[_0xff0c('0x38')]['length']?_0xed45e0[_0xff0c('0x38')]:_0x2a3697['model'];if(!_0x357fbf[_0xff0c('0x34')]['hasOwnProperty'](_0xff0c('0x39'))){_0xed45e0[_0xff0c('0x21')]=qs[_0xff0c('0x21')](_0x357fbf[_0xff0c('0x34')][_0xff0c('0x21')]);_0xed45e0[_0xff0c('0x20')]=qs[_0xff0c('0x20')](_0x357fbf[_0xff0c('0x34')]['offset']);}_0xed45e0[_0xff0c('0x3a')]=qs[_0xff0c('0x3b')](_0x357fbf['query'][_0xff0c('0x3b')]);_0xed45e0[_0xff0c('0x3c')]=qs[_0xff0c('0x35')](_[_0xff0c('0x3d')](_0x357fbf['query'],_0x2a3697[_0xff0c('0x35')]),_0x12f404);if(_0x357fbf[_0xff0c('0x34')][_0xff0c('0x3e')]){_0xed45e0[_0xff0c('0x3c')]=_[_0xff0c('0x3f')](_0xed45e0['where'],{'$or':_[_0xff0c('0x2f')](_0x12f404,function(_0x429096){if(_0x429096[_0xff0c('0x31')]!==_0xff0c('0x40')){var _0x49d658={};_0x49d658[_0x429096['name']]={'$like':'%'+_0x357fbf[_0xff0c('0x34')]['filter']+'%'};return _0x49d658;}})});}_0xed45e0=_[_0xff0c('0x3f')]({},_0xed45e0,_0x357fbf[_0xff0c('0x41')]);var _0x5b5e0f={'where':_0xed45e0[_0xff0c('0x3c')]};return db['ZohoAccount']['count'](_0x5b5e0f)[_0xff0c('0x29')](function(_0x2191f5){_0x30bbfb[_0xff0c('0x22')]=_0x2191f5;if(_0x357fbf[_0xff0c('0x34')][_0xff0c('0x42')]){_0xed45e0[_0xff0c('0x43')]=[{'all':!![]}];}return db[_0xff0c('0x44')]['findAll'](_0xed45e0);})['then'](function(_0x518b64){_0x30bbfb[_0xff0c('0x45')]=_0x518b64;return _0x30bbfb;})[_0xff0c('0x29')](respondWithFilteredResult(_0x4ec765,_0xed45e0))['catch'](handleError(_0x4ec765,null));};exports[_0xff0c('0x46')]=function(_0x5367af,_0x5ac2d2){var _0x2d306b={'raw':![],'where':{'id':_0x5367af['params']['id']}},_0x562fbf={};_0x562fbf['model']=_['keys'](db[_0xff0c('0x44')][_0xff0c('0x30')]);_0x562fbf[_0xff0c('0x34')]=_[_0xff0c('0x47')](_0x5367af[_0xff0c('0x34')]);_0x562fbf['filters']=_[_0xff0c('0x36')](_0x562fbf[_0xff0c('0x33')],_0x562fbf[_0xff0c('0x34')]);_0x2d306b[_0xff0c('0x38')]=_[_0xff0c('0x36')](_0x562fbf['model'],qs[_0xff0c('0x37')](_0x5367af[_0xff0c('0x34')][_0xff0c('0x37')]));_0x2d306b[_0xff0c('0x38')]=_0x2d306b[_0xff0c('0x38')][_0xff0c('0x48')]?_0x2d306b[_0xff0c('0x38')]:_0x562fbf['model'];if(_0x5367af[_0xff0c('0x34')][_0xff0c('0x42')]){_0x2d306b[_0xff0c('0x43')]=[{'all':!![]}];}_0x2d306b=_[_0xff0c('0x3f')]({},_0x2d306b,_0x5367af[_0xff0c('0x41')]);return db[_0xff0c('0x44')][_0xff0c('0x49')](_0x2d306b)['then'](handleEntityNotFound(_0x5ac2d2,null))[_0xff0c('0x29')](respondWithResult(_0x5ac2d2,null))[_0xff0c('0x4a')](handleError(_0x5ac2d2,null));};exports[_0xff0c('0x4b')]=function(_0x205220,_0x30cbde){return db[_0xff0c('0x44')][_0xff0c('0x4b')](_0x205220[_0xff0c('0x4c')],{})['then'](respondWithResult(_0x30cbde,0xc9))[_0xff0c('0x4a')](handleError(_0x30cbde,null));};exports[_0xff0c('0x27')]=function(_0x315ae6,_0x31745b){if(_0x315ae6[_0xff0c('0x4c')]['id']){delete _0x315ae6[_0xff0c('0x4c')]['id'];}return db[_0xff0c('0x44')][_0xff0c('0x49')]({'where':{'id':_0x315ae6[_0xff0c('0x4d')]['id']}})[_0xff0c('0x29')](handleEntityNotFound(_0x31745b,null))['then'](saveUpdates(_0x315ae6[_0xff0c('0x4c')],null))['then'](respondWithResult(_0x31745b,null))[_0xff0c('0x4a')](handleError(_0x31745b,null));};exports[_0xff0c('0x28')]=function(_0x3d2654,_0x171fae){return db['ZohoAccount']['find']({'where':{'id':_0x3d2654[_0xff0c('0x4d')]['id']}})[_0xff0c('0x29')](handleEntityNotFound(_0x171fae,null))[_0xff0c('0x29')](removeEntity(_0x171fae,null))[_0xff0c('0x4a')](handleError(_0x171fae,null));};exports[_0xff0c('0x4e')]=function(_0x15542e,_0x43b7d6,_0x4b4361){var _0x5c7ceb={};var _0x5b4afc={};var _0x309fa8;var _0x243863;return db[_0xff0c('0x44')][_0xff0c('0x4f')]({'where':{'id':_0x15542e[_0xff0c('0x4d')]['id']}})[_0xff0c('0x29')](handleEntityNotFound(_0x43b7d6,null))[_0xff0c('0x29')](function(_0x9ac136){if(_0x9ac136){_0x309fa8=_0x9ac136;_0x5b4afc[_0xff0c('0x33')]=_[_0xff0c('0x47')](db[_0xff0c('0x50')][_0xff0c('0x30')]);_0x5b4afc[_0xff0c('0x34')]=_[_0xff0c('0x47')](_0x15542e[_0xff0c('0x34')]);_0x5b4afc['filters']=_[_0xff0c('0x36')](_0x5b4afc[_0xff0c('0x33')],_0x5b4afc[_0xff0c('0x34')]);_0x5c7ceb['attributes']=_[_0xff0c('0x36')](_0x5b4afc['model'],qs[_0xff0c('0x37')](_0x15542e[_0xff0c('0x34')][_0xff0c('0x37')]));_0x5c7ceb[_0xff0c('0x38')]=_0x5c7ceb[_0xff0c('0x38')]['length']?_0x5c7ceb[_0xff0c('0x38')]:_0x5b4afc[_0xff0c('0x33')];_0x5c7ceb[_0xff0c('0x3a')]=qs[_0xff0c('0x3b')](_0x15542e[_0xff0c('0x34')][_0xff0c('0x3b')]);_0x5c7ceb[_0xff0c('0x3c')]=qs['filters'](_[_0xff0c('0x3d')](_0x15542e[_0xff0c('0x34')],_0x5b4afc[_0xff0c('0x35')]));if(_0x15542e[_0xff0c('0x34')][_0xff0c('0x3e')]){_0x5c7ceb[_0xff0c('0x3c')]=_[_0xff0c('0x3f')](_0x5c7ceb[_0xff0c('0x3c')],{'$or':_[_0xff0c('0x2f')](_0x5c7ceb[_0xff0c('0x38')],function(_0x11d8af){var _0x5eb193={};_0x5eb193[_0x11d8af]={'$like':'%'+_0x15542e[_0xff0c('0x34')][_0xff0c('0x3e')]+'%'};return _0x5eb193;})});}_0x5c7ceb=_[_0xff0c('0x3f')]({},_0x5c7ceb,_0x15542e[_0xff0c('0x41')]);return _0x309fa8['getConfigurations'](_0x5c7ceb);}})[_0xff0c('0x29')](function(_0x998041){if(_0x998041){_0x243863=_0x998041['length'];if(!_0x15542e[_0xff0c('0x34')][_0xff0c('0x51')](_0xff0c('0x39'))){_0x5c7ceb['limit']=qs[_0xff0c('0x21')](_0x15542e['query'][_0xff0c('0x21')]);_0x5c7ceb['offset']=qs[_0xff0c('0x20')](_0x15542e[_0xff0c('0x34')][_0xff0c('0x20')]);}return _0x309fa8[_0xff0c('0x4e')](_0x5c7ceb);}})[_0xff0c('0x29')](function(_0x19658a){if(_0x19658a){return _0x19658a?{'count':_0x243863,'rows':_0x19658a}:null;}})['then'](respondWithResult(_0x43b7d6,null))[_0xff0c('0x4a')](handleError(_0x43b7d6,null));};exports[_0xff0c('0x52')]=function(_0x32c1d3,_0x3d9c7e,_0x731915){if(_0x32c1d3[_0xff0c('0x4c')]['id']){delete _0x32c1d3[_0xff0c('0x4c')]['id'];}return db['ZohoAccount'][_0xff0c('0x4f')]({'where':{'id':_0x32c1d3[_0xff0c('0x4d')]['id']}})[_0xff0c('0x29')](handleEntityNotFound(_0x3d9c7e,null))[_0xff0c('0x29')](function(_0x586db7){if(_0x586db7){_0x32c1d3[_0xff0c('0x4c')][_0xff0c('0x53')]=_0x586db7['id'];_0x32c1d3[_0xff0c('0x4c')][_0xff0c('0x54')]=integrations['getSubjects'](_0x32c1d3[_0xff0c('0x4c')][_0xff0c('0x55')],_0x32c1d3['body'][_0xff0c('0x31')]);_0x32c1d3[_0xff0c('0x4c')]['Descriptions']=integrations['getDescriptions'](_0x32c1d3[_0xff0c('0x4c')][_0xff0c('0x55')],_0x32c1d3[_0xff0c('0x4c')][_0xff0c('0x31')]);return db[_0xff0c('0x50')][_0xff0c('0x4b')](_0x32c1d3[_0xff0c('0x4c')],{'include':[{'model':db[_0xff0c('0x56')],'as':'Subjects'},{'model':db[_0xff0c('0x56')],'as':'Descriptions'}]});}return null;})[_0xff0c('0x29')](respondWithResult(_0x3d9c7e,null))[_0xff0c('0x4a')](handleError(_0x3d9c7e,null));};function getAccessToken(_0x4458cf){return new Promise(function(_0x3650a0,_0x26ecc6){var _0x2de14f;switch(_0x4458cf[_0xff0c('0x57')]){case'US':_0x2de14f=_0xff0c('0x58');break;case'AU':_0x2de14f=_0xff0c('0x59');break;case'EU':_0x2de14f=_0xff0c('0x5a');break;case'IN':_0x2de14f=_0xff0c('0x5b');break;case'CN':_0x2de14f=_0xff0c('0x5c');break;default:_0x2de14f=_0xff0c('0x5a');break;}var _0x38b312={'method':_0xff0c('0x5d'),'uri':_0x2de14f+_0xff0c('0x5e'),'qs':{'refresh_token':_0x4458cf[_0xff0c('0x5f')],'client_id':_0x4458cf[_0xff0c('0x60')],'client_secret':_0x4458cf[_0xff0c('0x61')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x38b312)[_0xff0c('0x29')](function(_0x20d99d){if(_0x20d99d[_0xff0c('0x62')]){_0x3650a0(_0x20d99d[_0xff0c('0x62')]);}else{_0x26ecc6(_0xff0c('0x63'));}})[_0xff0c('0x4a')](function(_0x2139e0){_0x26ecc6(_0x2139e0);});});}exports['getFields']=function(_0x4f871d,_0x451c99,_0x1e02df){var _0x39befc,_0x2b4f30,_0x5f92ed,_0x53b2d8,_0x356140;return db[_0xff0c('0x44')][_0xff0c('0x4f')]({'where':{'id':_0x4f871d[_0xff0c('0x4d')]['id']},'attributes':['id',_0xff0c('0x64'),_0xff0c('0x57'),_0xff0c('0x60'),_0xff0c('0x61'),_0xff0c('0x65'),_0xff0c('0x66'),_0xff0c('0x5f')]})['then'](handleEntityNotFound(_0x451c99,null))[_0xff0c('0x29')](function(_0x524cef){_0x356140=_0x524cef;_0x39befc=_0x356140[_0xff0c('0x64')];_0x2b4f30=_0x39befc===_0xff0c('0x67')?'eu':'com';_0x5f92ed=_0x356140['serverUrl'];var _0xcf6295=_0x5f92ed[_0xff0c('0x68')](-0x1);if(_0xcf6295==='/'||_0xcf6295==='\x5c'||_0xcf6295===':'){_0x5f92ed=_0x5f92ed[_0xff0c('0x69')](0x0,_0x5f92ed[_0xff0c('0x6a')](_0xcf6295));}if(!_0x356140['refreshToken']){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x356140);})[_0xff0c('0x29')](function(_0x66a9e2){if(_0x66a9e2){return rp({'method':_0xff0c('0x6b'),'uri':util['format'](_0xff0c('0x6c'),_0x2b4f30),'qs':{'module':_0xff0c('0x6d')},'headers':{'Authorization':_0xff0c('0x6e')+_0x66a9e2},'json':!![]});}})['then'](function(_0x179a70){if(_0x179a70){if(_0x179a70['response']&&_0x179a70['response']['error']){throw new Error(_0x179a70[_0xff0c('0x6f')][_0xff0c('0x2b')]['message']);}var _0x5b5647=[];var _0x54b79b=[];var _0x4d1588=[_0xff0c('0x70'),_0xff0c('0x71'),_0xff0c('0x72'),_0xff0c('0x73'),_0xff0c('0x74'),_0xff0c('0x75'),_0xff0c('0x76'),_0xff0c('0x77')];_0x54b79b=_[_0xff0c('0x78')](_0x179a70[_0xff0c('0x37')],function(_0x325143){return _0x4d1588['includes'](_0x325143[_0xff0c('0x79')]);});for(var _0x1d3047=0x0;_0x1d3047<_0x54b79b[_0xff0c('0x48')];_0x1d3047++){if(_0x54b79b[_0x1d3047][_0xff0c('0x7a')]===![]){_0x5b5647[_0xff0c('0x7b')]({'id':_0x54b79b[_0x1d3047]['id'],'name':_0x54b79b[_0x1d3047]['display_label'],'custom':_0x54b79b[_0x1d3047][_0xff0c('0x7c')],'options':_0x54b79b[_0x1d3047][_0xff0c('0x7d')]==='picklist'&&_0x54b79b[_0x1d3047][_0xff0c('0x7e')]['length']>-0x1?_[_0xff0c('0x2f')](_0x54b79b[_0x1d3047][_0xff0c('0x7e')],function(_0x3ce5c9){return{'name':_0x3ce5c9,'value':_0x3ce5c9};}):[]});}}return{'count':_0x5b5647[_0xff0c('0x48')],'rows':_0x5b5647};}else{return{'count':0x0,'rows':[]};}})[_0xff0c('0x29')](respondWithResult(_0x451c99,null))[_0xff0c('0x4a')](function(_0x443e7d){var _0x17436a=_0x4f871d[_0xff0c('0x34')]['test']?0x1f4:_0x443e7d[_0xff0c('0x7f')]||0x1f4;logger[_0xff0c('0x2b')](_0xff0c('0x80'),_0xff0c('0x81'),_0x17436a,JSON[_0xff0c('0x82')](_0x443e7d));delete _0x443e7d[_0xff0c('0x2d')];if(_0x17436a===0x191){_0x17436a=0x190;}_0x451c99[_0xff0c('0x1e')](_0x17436a)[_0xff0c('0x83')](_0x4f871d[_0xff0c('0x34')][_0xff0c('0x84')]?{'message':'Wrong\x20credentials','statusCode':_0x443e7d['statusCode']}:_0x443e7d);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 69b86a0..187fe17 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 _0x0935=['slice','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','/oauth/v2/token','authorization_code','clientId','application/x-www-form-urlencoded','then','parse','refreshToken','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','https://accounts.zoho.com.au','refresh_token','info','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','int_zoho_accounts','zone','changed','clientSecret','code','host','serverUrl'];(function(_0xc491f0,_0x216d7a){var _0xe86f2a=function(_0x4e873c){while(--_0x4e873c){_0xc491f0['push'](_0xc491f0['shift']());}};_0xe86f2a(++_0x216d7a);}(_0x0935,0x126));var _0x5093=function(_0x3266f5,_0x20b834){_0x3266f5=_0x3266f5-0x0;var _0x256b71=_0x0935[_0x3266f5];return _0x256b71;};'use strict';var _=require(_0x5093('0x0'));var util=require(_0x5093('0x1'));var logger=require(_0x5093('0x2'))(_0x5093('0x3'));var moment=require(_0x5093('0x4'));var BPromise=require(_0x5093('0x5'));var rp=require(_0x5093('0x6'));var fs=require('fs');var path=require(_0x5093('0x7'));var rimraf=require(_0x5093('0x8'));var config=require(_0x5093('0x9'));var attributes=require(_0x5093('0xa'));var integrations=require(_0x5093('0xb'));module[_0x5093('0xc')]=function(_0x39c241,_0x1db165){return _0x39c241[_0x5093('0xd')]('ZohoAccount',attributes,{'tableName':_0x5093('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1f81bb,_0x2b5f79,_0x5de8bf){if(_0x1f81bb['changed'](_0x5093('0xf'))||_0x1f81bb[_0x5093('0x10')]('serverUrl')||_0x1f81bb[_0x5093('0x10')]('clientId')||_0x1f81bb[_0x5093('0x10')](_0x5093('0x11'))||_0x1f81bb[_0x5093('0x10')](_0x5093('0x12'))||_0x1f81bb[_0x5093('0x10')](_0x5093('0x13'))){var _0x20b8d3,_0x40a1b4;_0x20b8d3=_0x1f81bb[_0x5093('0x14')];var _0xae0c58=_0x20b8d3[_0x5093('0x15')](-0x1);if(_0xae0c58==='/'||_0xae0c58==='\x5c'||_0xae0c58===':'){_0x20b8d3=_0x20b8d3[_0x5093('0x16')](0x0,_0x20b8d3[_0x5093('0x17')](_0xae0c58));}switch(_0x1f81bb[_0x5093('0xf')]){case'US':_0x40a1b4=_0x5093('0x18');break;case'AU':_0x40a1b4='https://accounts.zoho.com.au';break;case'IN':_0x40a1b4=_0x5093('0x19');break;case'CN':_0x40a1b4=_0x5093('0x1a');break;default:_0x40a1b4=_0x5093('0x1b');break;}var _0x3cc94e={'method':'POST','uri':_0x40a1b4+_0x5093('0x1c'),'form':{'grant_type':_0x5093('0x1d'),'client_id':_0x1f81bb[_0x5093('0x1e')],'client_secret':_0x1f81bb['clientSecret'],'redirect_uri':_0x1f81bb[_0x5093('0x14')],'code':_0x1f81bb[_0x5093('0x12')]},'headers':{'Content-Type':_0x5093('0x1f')}};return rp(_0x3cc94e)[_0x5093('0x20')](function(_0x1ab4d6){var _0x47ac2d=JSON[_0x5093('0x21')](_0x1ab4d6);if(_0x47ac2d['refresh_token']){_0x1f81bb[_0x5093('0x22')]=_0x47ac2d['refresh_token'];logger['info'](util[_0x5093('0x23')](_0x5093('0x24'),_0x1f81bb[_0x5093('0x25')],_0x1f81bb['id']));}else{logger[_0x5093('0x26')](util[_0x5093('0x23')](_0x5093('0x27'),_0x1f81bb[_0x5093('0x25')],_0x1f81bb['id']),util[_0x5093('0x28')](_0x47ac2d,{'showHidden':![],'depth':null}));}return _0x5de8bf(null,_0x2b5f79);})[_0x5093('0x29')](function(_0x237c04){logger[_0x5093('0x26')](util[_0x5093('0x23')](_0x5093('0x27'),_0x1f81bb[_0x5093('0x25')],_0x1f81bb['id']),util[_0x5093('0x28')](parsedResult,{'showHidden':![],'depth':null}));return _0x5de8bf(_0x237c04);});}else{return _0x5de8bf(null,_0x2b5f79);}},'beforeUpdate':function(_0x5e8ecf,_0x40630c,_0x4ffb51){if(_0x5e8ecf['changed']('zone')||_0x5e8ecf[_0x5093('0x10')](_0x5093('0x14'))||_0x5e8ecf[_0x5093('0x10')](_0x5093('0x1e'))||_0x5e8ecf[_0x5093('0x10')](_0x5093('0x11'))||_0x5e8ecf[_0x5093('0x10')](_0x5093('0x12'))||_0x5e8ecf[_0x5093('0x10')](_0x5093('0x13'))){var _0xdaa75,_0x562386;_0xdaa75=_0x5e8ecf[_0x5093('0x14')];var _0x540e1d=_0xdaa75[_0x5093('0x15')](-0x1);if(_0x540e1d==='/'||_0x540e1d==='\x5c'||_0x540e1d===':'){_0xdaa75=_0xdaa75[_0x5093('0x16')](0x0,_0xdaa75[_0x5093('0x17')](_0x540e1d));}switch(_0x5e8ecf[_0x5093('0xf')]){case'US':_0x562386=_0x5093('0x18');break;case'AU':_0x562386=_0x5093('0x2a');break;case'IN':_0x562386='https://accounts.zoho.in';break;case'CN':_0x562386=_0x5093('0x1a');break;default:_0x562386='https://accounts.zoho.eu';break;}var _0x25c7d7={'method':'POST','uri':_0x562386+_0x5093('0x1c'),'form':{'grant_type':_0x5093('0x1d'),'client_id':_0x5e8ecf['clientId'],'client_secret':_0x5e8ecf[_0x5093('0x11')],'redirect_uri':_0x5e8ecf[_0x5093('0x14')],'code':_0x5e8ecf['code']},'headers':{'Content-Type':_0x5093('0x1f')}};return rp(_0x25c7d7)[_0x5093('0x20')](function(_0x45b4ba){var _0x3ee821=JSON[_0x5093('0x21')](_0x45b4ba);if(_0x3ee821[_0x5093('0x2b')]){_0x5e8ecf['refreshToken']=_0x3ee821[_0x5093('0x2b')];logger[_0x5093('0x2c')](util['format']('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x5e8ecf[_0x5093('0x25')],_0x5e8ecf['id']));}else{logger[_0x5093('0x26')](util[_0x5093('0x23')](_0x5093('0x27'),_0x5e8ecf[_0x5093('0x25')],_0x5e8ecf['id']),util[_0x5093('0x28')](_0x3ee821,{'showHidden':![],'depth':null}));}return _0x4ffb51(null,_0x40630c);})[_0x5093('0x29')](function(_0x69b4a6){logger['error'](util[_0x5093('0x23')](_0x5093('0x27'),_0x5e8ecf[_0x5093('0x25')],_0x5e8ecf['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x4ffb51(_0x69b4a6);});}else{return _0x4ffb51(null,_0x40630c);}}}});}; \ No newline at end of file +var _0xeb2e=['https://accounts.zoho.eu','POST','/oauth/v2/token','clientId','clientSecret','application/x-www-form-urlencoded','then','parse','refresh_token','refreshToken','info','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','format','inspect','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','zone','https://accounts.zoho.com','catch','lodash','moment','bluebird','request-promise','rimraf','../../config/environment','../../components/integrations/configuration','exports','int_zoho_accounts','changed','serverUrl','code','host','lastIndexOf','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn'];(function(_0x9aada2,_0xd2d349){var _0x196dff=function(_0x5ad061){while(--_0x5ad061){_0x9aada2['push'](_0x9aada2['shift']());}};_0x196dff(++_0xd2d349);}(_0xeb2e,0xa8));var _0xeeb2=function(_0x733313,_0x329dd5){_0x733313=_0x733313-0x0;var _0x4e84f0=_0xeb2e[_0x733313];return _0x4e84f0;};'use strict';var _=require(_0xeeb2('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xeeb2('0x1'));var BPromise=require(_0xeeb2('0x2'));var rp=require(_0xeeb2('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xeeb2('0x4'));var config=require(_0xeeb2('0x5'));var attributes=require('./intZohoAccount.attributes');var integrations=require(_0xeeb2('0x6'));module[_0xeeb2('0x7')]=function(_0x3612bf,_0x179b96){return _0x3612bf['define']('ZohoAccount',attributes,{'tableName':_0xeeb2('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2b32a0,_0x41a4d9,_0x205419){if(_0x2b32a0[_0xeeb2('0x9')]('zone')||_0x2b32a0[_0xeeb2('0x9')](_0xeeb2('0xa'))||_0x2b32a0['changed']('clientId')||_0x2b32a0[_0xeeb2('0x9')]('clientSecret')||_0x2b32a0[_0xeeb2('0x9')](_0xeeb2('0xb'))||_0x2b32a0[_0xeeb2('0x9')](_0xeeb2('0xc'))){var _0x36eba6,_0x9a2047;_0x36eba6=_0x2b32a0[_0xeeb2('0xa')];var _0x1122bf=_0x36eba6['slice'](-0x1);if(_0x1122bf==='/'||_0x1122bf==='\x5c'||_0x1122bf===':'){_0x36eba6=_0x36eba6['substring'](0x0,_0x36eba6[_0xeeb2('0xd')](_0x1122bf));}switch(_0x2b32a0['zone']){case'US':_0x9a2047='https://accounts.zoho.com';break;case'AU':_0x9a2047=_0xeeb2('0xe');break;case'IN':_0x9a2047=_0xeeb2('0xf');break;case'CN':_0x9a2047=_0xeeb2('0x10');break;default:_0x9a2047=_0xeeb2('0x11');break;}var _0x570f61={'method':_0xeeb2('0x12'),'uri':_0x9a2047+_0xeeb2('0x13'),'form':{'grant_type':'authorization_code','client_id':_0x2b32a0[_0xeeb2('0x14')],'client_secret':_0x2b32a0[_0xeeb2('0x15')],'redirect_uri':_0x2b32a0[_0xeeb2('0xa')],'code':_0x2b32a0[_0xeeb2('0xb')]},'headers':{'Content-Type':_0xeeb2('0x16')}};return rp(_0x570f61)[_0xeeb2('0x17')](function(_0x597947){var _0x268742=JSON[_0xeeb2('0x18')](_0x597947);if(_0x268742[_0xeeb2('0x19')]){_0x2b32a0[_0xeeb2('0x1a')]=_0x268742['refresh_token'];logger[_0xeeb2('0x1b')](util['format'](_0xeeb2('0x1c'),_0x2b32a0[_0xeeb2('0x1d')],_0x2b32a0['id']));}else{logger[_0xeeb2('0x1e')](util[_0xeeb2('0x1f')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x2b32a0['name'],_0x2b32a0['id']),util[_0xeeb2('0x20')](_0x268742,{'showHidden':![],'depth':null}));}return _0x205419(null,_0x41a4d9);})['catch'](function(_0x417378){logger[_0xeeb2('0x1e')](util['format'](_0xeeb2('0x21'),_0x2b32a0[_0xeeb2('0x1d')],_0x2b32a0['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x205419(_0x417378);});}else{return _0x205419(null,_0x41a4d9);}},'beforeUpdate':function(_0x2cb42c,_0x1d77c2,_0xf2dd99){if(_0x2cb42c[_0xeeb2('0x9')](_0xeeb2('0x22'))||_0x2cb42c[_0xeeb2('0x9')](_0xeeb2('0xa'))||_0x2cb42c[_0xeeb2('0x9')](_0xeeb2('0x14'))||_0x2cb42c[_0xeeb2('0x9')](_0xeeb2('0x15'))||_0x2cb42c[_0xeeb2('0x9')](_0xeeb2('0xb'))||_0x2cb42c[_0xeeb2('0x9')](_0xeeb2('0xc'))){var _0x3301f6,_0x58a266;_0x3301f6=_0x2cb42c[_0xeeb2('0xa')];var _0x547ae0=_0x3301f6['slice'](-0x1);if(_0x547ae0==='/'||_0x547ae0==='\x5c'||_0x547ae0===':'){_0x3301f6=_0x3301f6['substring'](0x0,_0x3301f6[_0xeeb2('0xd')](_0x547ae0));}switch(_0x2cb42c['zone']){case'US':_0x58a266=_0xeeb2('0x23');break;case'AU':_0x58a266=_0xeeb2('0xe');break;case'IN':_0x58a266='https://accounts.zoho.in';break;case'CN':_0x58a266=_0xeeb2('0x10');break;default:_0x58a266='https://accounts.zoho.eu';break;}var _0x2545e7={'method':_0xeeb2('0x12'),'uri':_0x58a266+'/oauth/v2/token','form':{'grant_type':'authorization_code','client_id':_0x2cb42c[_0xeeb2('0x14')],'client_secret':_0x2cb42c[_0xeeb2('0x15')],'redirect_uri':_0x2cb42c[_0xeeb2('0xa')],'code':_0x2cb42c[_0xeeb2('0xb')]},'headers':{'Content-Type':_0xeeb2('0x16')}};return rp(_0x2545e7)[_0xeeb2('0x17')](function(_0x5bbb00){var _0x42eaa4=JSON[_0xeeb2('0x18')](_0x5bbb00);if(_0x42eaa4['refresh_token']){_0x2cb42c[_0xeeb2('0x1a')]=_0x42eaa4['refresh_token'];logger[_0xeeb2('0x1b')](util[_0xeeb2('0x1f')](_0xeeb2('0x1c'),_0x2cb42c['name'],_0x2cb42c['id']));}else{logger[_0xeeb2('0x1e')](util[_0xeeb2('0x1f')](_0xeeb2('0x21'),_0x2cb42c[_0xeeb2('0x1d')],_0x2cb42c['id']),util['inspect'](_0x42eaa4,{'showHidden':![],'depth':null}));}return _0xf2dd99(null,_0x1d77c2);})[_0xeeb2('0x24')](function(_0x4a4bc1){logger[_0xeeb2('0x1e')](util[_0xeeb2('0x1f')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x2cb42c[_0xeeb2('0x1d')],_0x2cb42c['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0xf2dd99(_0x4a4bc1);});}else{return _0xf2dd99(null,_0x1d77c2);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 820ff1c..1153989 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 _0x0c19=['message','request\x20sent','catch','GetZohoAccount','ZohoAccount','options','raw','where','map','attributes','include','model','ShowZohoAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','ZohoAccount,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x2084c6,_0x34b23f){var _0x343ebb=function(_0x5494ad){while(--_0x5494ad){_0x2084c6['push'](_0x2084c6['shift']());}};_0x343ebb(++_0x34b23f);}(_0x0c19,0xf5));var _0x90c1=function(_0x3f0cf2,_0x20d943){_0x3f0cf2=_0x3f0cf2-0x0;var _0x5673b5=_0x0c19[_0x3f0cf2];return _0x5673b5;};'use strict';var _=require(_0x90c1('0x0'));var util=require(_0x90c1('0x1'));var moment=require(_0x90c1('0x2'));var BPromise=require(_0x90c1('0x3'));var rs=require(_0x90c1('0x4'));var fs=require('fs');var Redis=require(_0x90c1('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x90c1('0x6'));var logger=require(_0x90c1('0x7'))(_0x90c1('0x8'));var config=require('../../config/environment');var jayson=require(_0x90c1('0x9'));var client=jayson[_0x90c1('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x440f7a,_0x954ac4,_0x37d247){return new BPromise(function(_0x2ed328,_0x351d07){return client[_0x90c1('0xb')](_0x440f7a,_0x37d247)[_0x90c1('0xc')](function(_0x4895b5){logger[_0x90c1('0xd')](_0x90c1('0xe'),_0x954ac4,'request\x20sent');logger[_0x90c1('0xf')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x954ac4,'request\x20sent',JSON[_0x90c1('0x10')](_0x4895b5));if(_0x4895b5['error']){if(_0x4895b5[_0x90c1('0x11')][_0x90c1('0x12')]===0x1f4){logger[_0x90c1('0x11')](_0x90c1('0xe'),_0x954ac4,_0x4895b5['error']['message']);return _0x351d07(_0x4895b5[_0x90c1('0x11')][_0x90c1('0x13')]);}logger[_0x90c1('0x11')](_0x90c1('0xe'),_0x954ac4,_0x4895b5['error'][_0x90c1('0x13')]);return _0x2ed328(_0x4895b5[_0x90c1('0x11')][_0x90c1('0x13')]);}else{logger[_0x90c1('0xd')](_0x90c1('0xe'),_0x954ac4,_0x90c1('0x14'));_0x2ed328(_0x4895b5['result'][_0x90c1('0x13')]);}})[_0x90c1('0x15')](function(_0x45a64c){logger[_0x90c1('0x11')](_0x90c1('0xe'),_0x954ac4,_0x45a64c);_0x351d07(_0x45a64c);});});}exports[_0x90c1('0x16')]=function(_0x3b6671){var _0x2960f2=this;return new Promise(function(_0x372949,_0x112aa4){return db[_0x90c1('0x17')]['findAll']({'raw':_0x3b6671[_0x90c1('0x18')]?_0x3b6671[_0x90c1('0x18')][_0x90c1('0x19')]===undefined?!![]:![]:!![],'where':_0x3b6671[_0x90c1('0x18')]?_0x3b6671[_0x90c1('0x18')][_0x90c1('0x1a')]||null:null,'attributes':_0x3b6671['options']?_0x3b6671[_0x90c1('0x18')]['attributes']||null:null,'limit':_0x3b6671[_0x90c1('0x18')]?_0x3b6671['options']['limit']||null:null,'include':_0x3b6671[_0x90c1('0x18')]?_0x3b6671['options']['include']?_[_0x90c1('0x1b')](_0x3b6671['options']['include'],function(_0x36fe37){return{'model':db[_0x36fe37['model']],'as':_0x36fe37['as'],'attributes':_0x36fe37[_0x90c1('0x1c')],'include':_0x36fe37['include']?_[_0x90c1('0x1b')](_0x36fe37[_0x90c1('0x1d')],function(_0x309f83){return{'model':db[_0x309f83[_0x90c1('0x1e')]],'as':_0x309f83['as'],'attributes':_0x309f83[_0x90c1('0x1c')],'include':_0x309f83[_0x90c1('0x1d')]?_[_0x90c1('0x1b')](_0x309f83['include'],function(_0x26ee39){return{'model':db[_0x26ee39[_0x90c1('0x1e')]],'as':_0x26ee39['as'],'attributes':_0x26ee39[_0x90c1('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x90c1('0xc')](function(_0x3c3a20){logger[_0x90c1('0xd')](_0x90c1('0x16'),_0x3b6671);logger[_0x90c1('0xf')](_0x90c1('0x16'),_0x3b6671,JSON[_0x90c1('0x10')](_0x3c3a20));_0x372949(_0x3c3a20);})[_0x90c1('0x15')](function(_0x2f85dc){logger[_0x90c1('0x11')](_0x90c1('0x16'),_0x2f85dc[_0x90c1('0x13')],_0x3b6671);_0x112aa4(_0x2960f2['error'](0x1f4,_0x2f85dc[_0x90c1('0x13')]));});});};exports[_0x90c1('0x1f')]=function(_0x40c2f1){var _0x5be73c=this;return new Promise(function(_0x305e68,_0x578316){return db[_0x90c1('0x17')][_0x90c1('0x20')]({'raw':_0x40c2f1[_0x90c1('0x18')]?_0x40c2f1[_0x90c1('0x18')][_0x90c1('0x19')]===undefined?!![]:![]:!![],'where':_0x40c2f1['options']?_0x40c2f1[_0x90c1('0x18')][_0x90c1('0x1a')]||null:null,'attributes':_0x40c2f1[_0x90c1('0x18')]?_0x40c2f1['options'][_0x90c1('0x1c')]||null:null,'include':_0x40c2f1[_0x90c1('0x18')]?_0x40c2f1[_0x90c1('0x18')][_0x90c1('0x1d')]?_[_0x90c1('0x1b')](_0x40c2f1[_0x90c1('0x18')][_0x90c1('0x1d')],function(_0x36e431){return{'model':db[_0x36e431[_0x90c1('0x1e')]],'as':_0x36e431['as'],'attributes':_0x36e431[_0x90c1('0x1c')],'include':_0x36e431[_0x90c1('0x1d')]?_[_0x90c1('0x1b')](_0x36e431[_0x90c1('0x1d')],function(_0x3a130f){return{'model':db[_0x3a130f['model']],'as':_0x3a130f['as'],'attributes':_0x3a130f[_0x90c1('0x1c')],'include':_0x3a130f[_0x90c1('0x1d')]?_[_0x90c1('0x1b')](_0x3a130f[_0x90c1('0x1d')],function(_0x5c62a4){return{'model':db[_0x5c62a4['model']],'as':_0x5c62a4['as'],'attributes':_0x5c62a4[_0x90c1('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x90c1('0xc')](function(_0x1aa105){logger[_0x90c1('0xd')]('ShowZohoAccount',_0x40c2f1);logger['debug'](_0x90c1('0x1f'),_0x40c2f1,JSON[_0x90c1('0x10')](_0x1aa105));_0x305e68(_0x1aa105);})[_0x90c1('0x15')](function(_0x23bb5a){logger[_0x90c1('0x11')]('ShowZohoAccount',_0x23bb5a['message'],_0x40c2f1);_0x578316(_0x5be73c['error'](0x1f4,_0x23bb5a[_0x90c1('0x13')]));});});}; \ No newline at end of file +var _0xbe2c=['result','catch','ZohoAccount','findAll','options','where','attributes','include','map','model','then','GetZohoAccount','debug','ShowZohoAccount','find','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x227f56,_0x273e10){var _0x23c7c6=function(_0x1156c2){while(--_0x1156c2){_0x227f56['push'](_0x227f56['shift']());}};_0x23c7c6(++_0x273e10);}(_0xbe2c,0x18f));var _0xcbe2=function(_0xd4a5,_0x12a607){_0xd4a5=_0xd4a5-0x0;var _0x4c99f6=_0xbe2c[_0xd4a5];return _0x4c99f6;};'use strict';var _=require(_0xcbe2('0x0'));var util=require(_0xcbe2('0x1'));var moment=require('moment');var BPromise=require(_0xcbe2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcbe2('0x3'));var db=require(_0xcbe2('0x4'))['db'];var utils=require(_0xcbe2('0x5'));var logger=require(_0xcbe2('0x6'))(_0xcbe2('0x7'));var config=require('../../config/environment');var jayson=require(_0xcbe2('0x8'));var client=jayson[_0xcbe2('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0389,_0x3eb920,_0x1c28ab){return new BPromise(function(_0x294a61,_0x21233e){return client['request'](_0x2c0389,_0x1c28ab)['then'](function(_0xb7fe3c){logger[_0xcbe2('0xa')](_0xcbe2('0xb'),_0x3eb920,_0xcbe2('0xc'));logger['debug']('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x3eb920,_0xcbe2('0xc'),JSON[_0xcbe2('0xd')](_0xb7fe3c));if(_0xb7fe3c[_0xcbe2('0xe')]){if(_0xb7fe3c[_0xcbe2('0xe')][_0xcbe2('0xf')]===0x1f4){logger[_0xcbe2('0xe')]('ZohoAccount,\x20%s,\x20%s',_0x3eb920,_0xb7fe3c[_0xcbe2('0xe')][_0xcbe2('0x10')]);return _0x21233e(_0xb7fe3c['error'][_0xcbe2('0x10')]);}logger['error'](_0xcbe2('0xb'),_0x3eb920,_0xb7fe3c['error'][_0xcbe2('0x10')]);return _0x294a61(_0xb7fe3c['error']['message']);}else{logger[_0xcbe2('0xa')]('ZohoAccount,\x20%s,\x20%s',_0x3eb920,_0xcbe2('0xc'));_0x294a61(_0xb7fe3c[_0xcbe2('0x11')][_0xcbe2('0x10')]);}})[_0xcbe2('0x12')](function(_0x40dc0f){logger[_0xcbe2('0xe')](_0xcbe2('0xb'),_0x3eb920,_0x40dc0f);_0x21233e(_0x40dc0f);});});}exports['GetZohoAccount']=function(_0xb968ac){var _0x5acacd=this;return new Promise(function(_0x1c09cb,_0xff2918){return db[_0xcbe2('0x13')][_0xcbe2('0x14')]({'raw':_0xb968ac['options']?_0xb968ac[_0xcbe2('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0xb968ac['options']?_0xb968ac[_0xcbe2('0x15')][_0xcbe2('0x16')]||null:null,'attributes':_0xb968ac[_0xcbe2('0x15')]?_0xb968ac['options'][_0xcbe2('0x17')]||null:null,'limit':_0xb968ac[_0xcbe2('0x15')]?_0xb968ac[_0xcbe2('0x15')]['limit']||null:null,'include':_0xb968ac[_0xcbe2('0x15')]?_0xb968ac[_0xcbe2('0x15')][_0xcbe2('0x18')]?_[_0xcbe2('0x19')](_0xb968ac[_0xcbe2('0x15')][_0xcbe2('0x18')],function(_0x2f1e25){return{'model':db[_0x2f1e25[_0xcbe2('0x1a')]],'as':_0x2f1e25['as'],'attributes':_0x2f1e25['attributes'],'include':_0x2f1e25[_0xcbe2('0x18')]?_[_0xcbe2('0x19')](_0x2f1e25['include'],function(_0x40039f){return{'model':db[_0x40039f[_0xcbe2('0x1a')]],'as':_0x40039f['as'],'attributes':_0x40039f[_0xcbe2('0x17')],'include':_0x40039f[_0xcbe2('0x18')]?_[_0xcbe2('0x19')](_0x40039f['include'],function(_0xbc5aab){return{'model':db[_0xbc5aab[_0xcbe2('0x1a')]],'as':_0xbc5aab['as'],'attributes':_0xbc5aab['attributes']};}):[]};}):[]};}):[]:[]})[_0xcbe2('0x1b')](function(_0x5ad2e9){logger[_0xcbe2('0xa')](_0xcbe2('0x1c'),_0xb968ac);logger[_0xcbe2('0x1d')](_0xcbe2('0x1c'),_0xb968ac,JSON['stringify'](_0x5ad2e9));_0x1c09cb(_0x5ad2e9);})[_0xcbe2('0x12')](function(_0x37eb8b){logger['error'](_0xcbe2('0x1c'),_0x37eb8b[_0xcbe2('0x10')],_0xb968ac);_0xff2918(_0x5acacd[_0xcbe2('0xe')](0x1f4,_0x37eb8b[_0xcbe2('0x10')]));});});};exports[_0xcbe2('0x1e')]=function(_0x3cffd1){var _0x3744f3=this;return new Promise(function(_0x8824fc,_0x39ab14){return db[_0xcbe2('0x13')][_0xcbe2('0x1f')]({'raw':_0x3cffd1[_0xcbe2('0x15')]?_0x3cffd1[_0xcbe2('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x3cffd1[_0xcbe2('0x15')]?_0x3cffd1[_0xcbe2('0x15')]['where']||null:null,'attributes':_0x3cffd1['options']?_0x3cffd1[_0xcbe2('0x15')]['attributes']||null:null,'include':_0x3cffd1[_0xcbe2('0x15')]?_0x3cffd1[_0xcbe2('0x15')][_0xcbe2('0x18')]?_[_0xcbe2('0x19')](_0x3cffd1[_0xcbe2('0x15')][_0xcbe2('0x18')],function(_0x183953){return{'model':db[_0x183953['model']],'as':_0x183953['as'],'attributes':_0x183953[_0xcbe2('0x17')],'include':_0x183953['include']?_['map'](_0x183953[_0xcbe2('0x18')],function(_0x4bd628){return{'model':db[_0x4bd628[_0xcbe2('0x1a')]],'as':_0x4bd628['as'],'attributes':_0x4bd628['attributes'],'include':_0x4bd628[_0xcbe2('0x18')]?_[_0xcbe2('0x19')](_0x4bd628['include'],function(_0x97be46){return{'model':db[_0x97be46['model']],'as':_0x97be46['as'],'attributes':_0x97be46[_0xcbe2('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5e9023){logger[_0xcbe2('0xa')]('ShowZohoAccount',_0x3cffd1);logger['debug'](_0xcbe2('0x1e'),_0x3cffd1,JSON['stringify'](_0x5e9023));_0x8824fc(_0x5e9023);})[_0xcbe2('0x12')](function(_0xc0cc08){logger[_0xcbe2('0xe')]('ShowZohoAccount',_0xc0cc08[_0xcbe2('0x10')],_0x3cffd1);_0x39ab14(_0x3744f3[_0xcbe2('0xe')](0x1f4,_0xc0cc08['message']));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 2015c0a..384811f 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 _0x3a83=['/:id/fields','isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','update','delete','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','index','/:id','show'];(function(_0x334db2,_0x4d9f0f){var _0x513d3e=function(_0x419c31){while(--_0x419c31){_0x334db2['push'](_0x334db2['shift']());}};_0x513d3e(++_0x4d9f0f);}(_0x3a83,0x16a));var _0x33a8=function(_0x411567,_0x15240e){_0x411567=_0x411567-0x0;var _0x20ac5c=_0x3a83[_0x411567];return _0x20ac5c;};'use strict';var multer=require('multer');var util=require(_0x33a8('0x0'));var path=require(_0x33a8('0x1'));var timeout=require(_0x33a8('0x2'));var express=require(_0x33a8('0x3'));var router=express[_0x33a8('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x33a8('0x5'));var interaction=require(_0x33a8('0x6'));var config=require(_0x33a8('0x7'));var controller=require(_0x33a8('0x8'));router[_0x33a8('0x9')]('/',auth['isAuthenticated'](),controller[_0x33a8('0xa')]);router['get'](_0x33a8('0xb'),auth['isAuthenticated'](),controller[_0x33a8('0xc')]);router[_0x33a8('0x9')](_0x33a8('0xd'),auth[_0x33a8('0xe')](),controller[_0x33a8('0xf')]);router[_0x33a8('0x9')](_0x33a8('0x10'),auth[_0x33a8('0xe')](),controller[_0x33a8('0x11')]);router[_0x33a8('0x9')](_0x33a8('0x12'),auth[_0x33a8('0xe')](),controller['getDescriptions']);router[_0x33a8('0x13')]('/',auth[_0x33a8('0xe')](),controller[_0x33a8('0x14')]);router[_0x33a8('0x15')](_0x33a8('0xb'),auth['isAuthenticated'](),controller[_0x33a8('0x16')]);router[_0x33a8('0x17')](_0x33a8('0xb'),auth[_0x33a8('0xe')](),controller[_0x33a8('0x18')]);module['exports']=router; \ No newline at end of file +var _0x3287=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','/:id','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x3287,0x1ab));var _0x7328=function(_0x3aedf5,_0x150c1d){_0x3aedf5=_0x3aedf5-0x0;var _0x5e1ac5=_0x3287[_0x3aedf5];return _0x5e1ac5;};'use strict';var multer=require(_0x7328('0x0'));var util=require(_0x7328('0x1'));var path=require(_0x7328('0x2'));var timeout=require(_0x7328('0x3'));var express=require(_0x7328('0x4'));var router=express[_0x7328('0x5')]();var fs_extra=require(_0x7328('0x6'));var auth=require(_0x7328('0x7'));var interaction=require(_0x7328('0x8'));var config=require(_0x7328('0x9'));var controller=require(_0x7328('0xa'));router[_0x7328('0xb')]('/',auth[_0x7328('0xc')](),controller['index']);router[_0x7328('0xb')](_0x7328('0xd'),auth[_0x7328('0xc')](),controller['show']);router['get']('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router['get'](_0x7328('0xe'),auth[_0x7328('0xc')](),controller[_0x7328('0xf')]);router[_0x7328('0xb')](_0x7328('0x10'),auth[_0x7328('0xc')](),controller['getDescriptions']);router[_0x7328('0x11')]('/',auth[_0x7328('0xc')](),controller[_0x7328('0x12')]);router[_0x7328('0x13')](_0x7328('0xd'),auth[_0x7328('0xc')](),controller[_0x7328('0x14')]);router[_0x7328('0x15')](_0x7328('0xd'),auth[_0x7328('0xc')](),controller[_0x7328('0x16')]);module[_0x7328('0x17')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index dad12cc..76985af 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 _0xb1f6=['ENUM','lead','contact_lead','exports','STRING'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb1f6,0x14d));var _0x6b1f=function(_0x3771c7,_0x6673b8){_0x3771c7=_0x3771c7-0x0;var _0x5e7bb0=_0xb1f6[_0x3771c7];return _0x5e7bb0;};'use strict';var Sequelize=require('sequelize');module[_0x6b1f('0x0')]={'name':{'type':Sequelize[_0x6b1f('0x1')]},'moduleCreate':{'type':Sequelize['ENUM']('lead','contact','nothing'),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize[_0x6b1f('0x2')]('contact_lead','contact',_0x6b1f('0x3')),'defaultValue':_0x6b1f('0x4')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd8e5=['nothing','contact_lead','exports','STRING','ENUM','lead','contact'];(function(_0x1cbe6b,_0x4cd68b){var _0x596cf1=function(_0x179bae){while(--_0x179bae){_0x1cbe6b['push'](_0x1cbe6b['shift']());}};_0x596cf1(++_0x4cd68b);}(_0xd8e5,0x6b));var _0x5d8e=function(_0x4fa989,_0x2dfdbc){_0x4fa989=_0x4fa989-0x0;var _0x1f14ee=_0xd8e5[_0x4fa989];return _0x1f14ee;};'use strict';var Sequelize=require('sequelize');module[_0x5d8e('0x0')]={'name':{'type':Sequelize[_0x5d8e('0x1')]},'moduleCreate':{'type':Sequelize[_0x5d8e('0x2')](_0x5d8e('0x3'),_0x5d8e('0x4'),_0x5d8e('0x5')),'defaultValue':_0x5d8e('0x3')},'moduleSearch':{'type':Sequelize['ENUM'](_0x5d8e('0x6'),_0x5d8e('0x4'),_0x5d8e('0x3')),'defaultValue':_0x5d8e('0x6')},'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 cf25c4e..a1373da 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 _0xd555=['to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','offset','count','set','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','where','pick','filter','VIRTUAL','merge','options','ZohoConfiguration','includeAll','include','rows','catch','show','params','find','create','body','getFields','findOne','ZohoField','sort','nolimit','getSubjects','getDescriptions','eml-format','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x3f91f8,_0x3ac21d){var _0x31a568=function(_0xd3da14){while(--_0xd3da14){_0x3f91f8['push'](_0x3f91f8['shift']());}};_0x31a568(++_0x3ac21d);}(_0xd555,0x197));var _0x5d55=function(_0x16a7bc,_0x3ee4fb){_0x16a7bc=_0x16a7bc-0x0;var _0x54e51d=_0xd555[_0x16a7bc];return _0x54e51d;};'use strict';var emlformat=require(_0x5d55('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5d55('0x1'));var moment=require(_0x5d55('0x2'));var BPromise=require(_0x5d55('0x3'));var Mustache=require(_0x5d55('0x4'));var util=require(_0x5d55('0x5'));var path=require(_0x5d55('0x6'));var sox=require(_0x5d55('0x7'));var csv=require(_0x5d55('0x8'));var ejs=require(_0x5d55('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5d55('0xa'));var squel=require(_0x5d55('0xb'));var crypto=require('crypto');var jsforce=require(_0x5d55('0xc'));var deskjs=require(_0x5d55('0xd'));var toCsv=require(_0x5d55('0x8'));var querystring=require(_0x5d55('0xe'));var Papa=require(_0x5d55('0xf'));var Redis=require(_0x5d55('0x10'));var authService=require(_0x5d55('0x11'));var qs=require(_0x5d55('0x12'));var as=require(_0x5d55('0x13'));var hardwareService=require(_0x5d55('0x14'));var logger=require(_0x5d55('0x15'))(_0x5d55('0x16'));var utils=require(_0x5d55('0x17'));var config=require(_0x5d55('0x18'));var licenseUtil=require(_0x5d55('0x19'));var db=require(_0x5d55('0x1a'))['db'];function respondWithStatusCode(_0x4c35a1,_0x297b49){_0x297b49=_0x297b49||0xcc;return function(_0x4dcf83){if(_0x4dcf83){return _0x4c35a1[_0x5d55('0x1b')](_0x297b49);}return _0x4c35a1[_0x5d55('0x1c')](_0x297b49)['end']();};}function respondWithResult(_0x2d3961,_0x3cd63f){_0x3cd63f=_0x3cd63f||0xc8;return function(_0x413a24){if(_0x413a24){return _0x2d3961['status'](_0x3cd63f)['json'](_0x413a24);}};}function respondWithFilteredResult(_0x53aae1,_0x12eef3){return function(_0x3d6782){if(_0x3d6782){var _0x4c360b=typeof _0x12eef3['offset']===_0x5d55('0x1d')&&typeof _0x12eef3[_0x5d55('0x1e')]===_0x5d55('0x1d');var _0x47e6cf=_0x3d6782['count'];var _0x5b656a=_0x4c360b?0x0:_0x12eef3[_0x5d55('0x1f')];var _0x1795b4=_0x4c360b?_0x3d6782[_0x5d55('0x20')]:_0x12eef3[_0x5d55('0x1f')]+_0x12eef3[_0x5d55('0x1e')];var _0x9b8a13;if(_0x1795b4>=_0x47e6cf){_0x1795b4=_0x47e6cf;_0x9b8a13=0xc8;}else{_0x9b8a13=0xce;}_0x53aae1[_0x5d55('0x1c')](_0x9b8a13);return _0x53aae1[_0x5d55('0x21')](_0x5d55('0x22'),_0x5b656a+'-'+_0x1795b4+'/'+_0x47e6cf)[_0x5d55('0x23')](_0x3d6782);}return null;};}function patchUpdates(_0x205712){return function(_0x422343){try{jsonpatch[_0x5d55('0x24')](_0x422343,_0x205712,!![]);}catch(_0x5eeff0){return BPromise['reject'](_0x5eeff0);}return _0x422343[_0x5d55('0x25')]();};}function saveUpdates(_0x248070,_0x1eeba3){return function(_0x596b03){if(_0x596b03){return _0x596b03[_0x5d55('0x26')](_0x248070)[_0x5d55('0x27')](function(_0x121872){return _0x121872;});}return null;};}function removeEntity(_0x3e151f,_0x352b0a){return function(_0x1153df){if(_0x1153df){return _0x1153df[_0x5d55('0x28')]()[_0x5d55('0x27')](function(){_0x3e151f[_0x5d55('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x38fc0f,_0x21547f){return function(_0x37398e){if(!_0x37398e){_0x38fc0f[_0x5d55('0x1b')](0x194);}return _0x37398e;};}function handleError(_0x31a4d5,_0x207558){_0x207558=_0x207558||0x1f4;return function(_0x4697ec){logger[_0x5d55('0x29')](_0x4697ec[_0x5d55('0x2a')]);if(_0x4697ec[_0x5d55('0x2b')]){delete _0x4697ec[_0x5d55('0x2b')];}_0x31a4d5['status'](_0x207558)[_0x5d55('0x2c')](_0x4697ec);};}exports[_0x5d55('0x2d')]=function(_0x12df1a,_0xc05ce){var _0x440f91={},_0x4d7f33={},_0x1374b2={'count':0x0,'rows':[]};var _0x20cbfd=_[_0x5d55('0x2e')](db['ZohoConfiguration'][_0x5d55('0x2f')],function(_0x3b5d1a){return{'name':_0x3b5d1a['fieldName'],'type':_0x3b5d1a[_0x5d55('0x30')][_0x5d55('0x31')]};});_0x4d7f33[_0x5d55('0x32')]=_[_0x5d55('0x2e')](_0x20cbfd,_0x5d55('0x2b'));_0x4d7f33['query']=_[_0x5d55('0x33')](_0x12df1a[_0x5d55('0x34')]);_0x4d7f33[_0x5d55('0x35')]=_[_0x5d55('0x36')](_0x4d7f33[_0x5d55('0x32')],_0x4d7f33['query']);_0x440f91[_0x5d55('0x37')]=_['intersection'](_0x4d7f33[_0x5d55('0x32')],qs[_0x5d55('0x38')](_0x12df1a[_0x5d55('0x34')]['fields']));_0x440f91[_0x5d55('0x37')]=_0x440f91[_0x5d55('0x37')][_0x5d55('0x39')]?_0x440f91[_0x5d55('0x37')]:_0x4d7f33[_0x5d55('0x32')];if(!_0x12df1a[_0x5d55('0x34')][_0x5d55('0x3a')]('nolimit')){_0x440f91[_0x5d55('0x1e')]=qs['limit'](_0x12df1a[_0x5d55('0x34')]['limit']);_0x440f91[_0x5d55('0x1f')]=qs[_0x5d55('0x1f')](_0x12df1a[_0x5d55('0x34')]['offset']);}_0x440f91[_0x5d55('0x3b')]=qs['sort'](_0x12df1a[_0x5d55('0x34')]['sort']);_0x440f91[_0x5d55('0x3c')]=qs[_0x5d55('0x35')](_[_0x5d55('0x3d')](_0x12df1a[_0x5d55('0x34')],_0x4d7f33[_0x5d55('0x35')]),_0x20cbfd);if(_0x12df1a[_0x5d55('0x34')][_0x5d55('0x3e')]){_0x440f91[_0x5d55('0x3c')]=_['merge'](_0x440f91[_0x5d55('0x3c')],{'$or':_[_0x5d55('0x2e')](_0x20cbfd,function(_0x43697c){if(_0x43697c[_0x5d55('0x30')]!==_0x5d55('0x3f')){var _0x42d4fb={};_0x42d4fb[_0x43697c[_0x5d55('0x2b')]]={'$like':'%'+_0x12df1a['query'][_0x5d55('0x3e')]+'%'};return _0x42d4fb;}})});}_0x440f91=_[_0x5d55('0x40')]({},_0x440f91,_0x12df1a[_0x5d55('0x41')]);var _0xe55f55={'where':_0x440f91[_0x5d55('0x3c')]};return db[_0x5d55('0x42')][_0x5d55('0x20')](_0xe55f55)['then'](function(_0x3ee7c4){_0x1374b2[_0x5d55('0x20')]=_0x3ee7c4;if(_0x12df1a['query'][_0x5d55('0x43')]){_0x440f91[_0x5d55('0x44')]=[{'all':!![]}];}return db[_0x5d55('0x42')]['findAll'](_0x440f91);})[_0x5d55('0x27')](function(_0x49352b){_0x1374b2[_0x5d55('0x45')]=_0x49352b;return _0x1374b2;})[_0x5d55('0x27')](respondWithFilteredResult(_0xc05ce,_0x440f91))[_0x5d55('0x46')](handleError(_0xc05ce,null));};exports[_0x5d55('0x47')]=function(_0xa24d74,_0x512209){var _0x25f8e1={'raw':![],'where':{'id':_0xa24d74[_0x5d55('0x48')]['id']}},_0x638b75={};_0x638b75[_0x5d55('0x32')]=_['keys'](db['ZohoConfiguration']['rawAttributes']);_0x638b75[_0x5d55('0x34')]=_['keys'](_0xa24d74[_0x5d55('0x34')]);_0x638b75[_0x5d55('0x35')]=_[_0x5d55('0x36')](_0x638b75[_0x5d55('0x32')],_0x638b75[_0x5d55('0x34')]);_0x25f8e1['attributes']=_[_0x5d55('0x36')](_0x638b75[_0x5d55('0x32')],qs['fields'](_0xa24d74[_0x5d55('0x34')][_0x5d55('0x38')]));_0x25f8e1[_0x5d55('0x37')]=_0x25f8e1[_0x5d55('0x37')]['length']?_0x25f8e1[_0x5d55('0x37')]:_0x638b75[_0x5d55('0x32')];if(_0xa24d74[_0x5d55('0x34')][_0x5d55('0x43')]){_0x25f8e1[_0x5d55('0x44')]=[{'all':!![]}];}_0x25f8e1=_[_0x5d55('0x40')]({},_0x25f8e1,_0xa24d74[_0x5d55('0x41')]);return db[_0x5d55('0x42')][_0x5d55('0x49')](_0x25f8e1)[_0x5d55('0x27')](handleEntityNotFound(_0x512209,null))['then'](respondWithResult(_0x512209,null))[_0x5d55('0x46')](handleError(_0x512209,null));};exports['create']=function(_0x3585a4,_0x35798f){return db[_0x5d55('0x42')][_0x5d55('0x4a')](_0x3585a4['body'],{})[_0x5d55('0x27')](respondWithResult(_0x35798f,0xc9))[_0x5d55('0x46')](handleError(_0x35798f,null));};exports[_0x5d55('0x26')]=function(_0x1f709d,_0x456940){if(_0x1f709d['body']['id']){delete _0x1f709d[_0x5d55('0x4b')]['id'];}return db[_0x5d55('0x42')][_0x5d55('0x49')]({'where':{'id':_0x1f709d[_0x5d55('0x48')]['id']}})[_0x5d55('0x27')](handleEntityNotFound(_0x456940,null))['then'](saveUpdates(_0x1f709d[_0x5d55('0x4b')],null))[_0x5d55('0x27')](respondWithResult(_0x456940,null))[_0x5d55('0x46')](handleError(_0x456940,null));};exports[_0x5d55('0x28')]=function(_0x51923d,_0xfb009){return db[_0x5d55('0x42')]['find']({'where':{'id':_0x51923d['params']['id']}})[_0x5d55('0x27')](handleEntityNotFound(_0xfb009,null))[_0x5d55('0x27')](removeEntity(_0xfb009,null))['catch'](handleError(_0xfb009,null));};exports[_0x5d55('0x4c')]=function(_0x2fc93f,_0x336b0e,_0x4d7ea8){var _0x1d3f6d={};var _0x3e4bc4={};var _0x48d271;var _0x31224b;return db[_0x5d55('0x42')][_0x5d55('0x4d')]({'where':{'id':_0x2fc93f[_0x5d55('0x48')]['id']}})[_0x5d55('0x27')](handleEntityNotFound(_0x336b0e,null))[_0x5d55('0x27')](function(_0x48ac74){if(_0x48ac74){_0x48d271=_0x48ac74;_0x3e4bc4[_0x5d55('0x32')]=_[_0x5d55('0x33')](db[_0x5d55('0x4e')]['rawAttributes']);_0x3e4bc4[_0x5d55('0x34')]=_[_0x5d55('0x33')](_0x2fc93f[_0x5d55('0x34')]);_0x3e4bc4[_0x5d55('0x35')]=_[_0x5d55('0x36')](_0x3e4bc4['model'],_0x3e4bc4[_0x5d55('0x34')]);_0x1d3f6d['attributes']=_[_0x5d55('0x36')](_0x3e4bc4[_0x5d55('0x32')],qs[_0x5d55('0x38')](_0x2fc93f[_0x5d55('0x34')]['fields']));_0x1d3f6d[_0x5d55('0x37')]=_0x1d3f6d[_0x5d55('0x37')]['length']?_0x1d3f6d[_0x5d55('0x37')]:_0x3e4bc4[_0x5d55('0x32')];_0x1d3f6d[_0x5d55('0x3b')]=qs[_0x5d55('0x4f')](_0x2fc93f['query']['sort']);_0x1d3f6d[_0x5d55('0x3c')]=qs['filters'](_['pick'](_0x2fc93f[_0x5d55('0x34')],_0x3e4bc4['filters']));if(_0x2fc93f[_0x5d55('0x34')]['filter']){_0x1d3f6d['where']=_[_0x5d55('0x40')](_0x1d3f6d[_0x5d55('0x3c')],{'$or':_[_0x5d55('0x2e')](_0x1d3f6d[_0x5d55('0x37')],function(_0x3061a5){var _0x7c00bc={};_0x7c00bc[_0x3061a5]={'$like':'%'+_0x2fc93f[_0x5d55('0x34')][_0x5d55('0x3e')]+'%'};return _0x7c00bc;})});}_0x1d3f6d=_['merge']({},_0x1d3f6d,_0x2fc93f[_0x5d55('0x41')]);return _0x48d271[_0x5d55('0x4c')](_0x1d3f6d);}})[_0x5d55('0x27')](function(_0x254f1f){if(_0x254f1f){_0x31224b=_0x254f1f[_0x5d55('0x39')];if(!_0x2fc93f[_0x5d55('0x34')][_0x5d55('0x3a')](_0x5d55('0x50'))){_0x1d3f6d[_0x5d55('0x1e')]=qs['limit'](_0x2fc93f[_0x5d55('0x34')][_0x5d55('0x1e')]);_0x1d3f6d['offset']=qs[_0x5d55('0x1f')](_0x2fc93f['query'][_0x5d55('0x1f')]);}return _0x48d271[_0x5d55('0x4c')](_0x1d3f6d);}})[_0x5d55('0x27')](function(_0x53c178){if(_0x53c178){return _0x53c178?{'count':_0x31224b,'rows':_0x53c178}:null;}})[_0x5d55('0x27')](respondWithResult(_0x336b0e,null))[_0x5d55('0x46')](handleError(_0x336b0e,null));};exports[_0x5d55('0x51')]=function(_0x5dd648,_0x1315eb,_0x17b3a6){var _0x3e5bc1={};var _0x4c390a={};var _0x572ec1;var _0x5e77be;return db[_0x5d55('0x42')][_0x5d55('0x4d')]({'where':{'id':_0x5dd648[_0x5d55('0x48')]['id']}})[_0x5d55('0x27')](handleEntityNotFound(_0x1315eb,null))['then'](function(_0x3b2d56){if(_0x3b2d56){_0x572ec1=_0x3b2d56;_0x4c390a[_0x5d55('0x32')]=_[_0x5d55('0x33')](db[_0x5d55('0x4e')][_0x5d55('0x2f')]);_0x4c390a[_0x5d55('0x34')]=_['keys'](_0x5dd648[_0x5d55('0x34')]);_0x4c390a[_0x5d55('0x35')]=_[_0x5d55('0x36')](_0x4c390a[_0x5d55('0x32')],_0x4c390a[_0x5d55('0x34')]);_0x3e5bc1[_0x5d55('0x37')]=_[_0x5d55('0x36')](_0x4c390a['model'],qs[_0x5d55('0x38')](_0x5dd648[_0x5d55('0x34')][_0x5d55('0x38')]));_0x3e5bc1[_0x5d55('0x37')]=_0x3e5bc1[_0x5d55('0x37')][_0x5d55('0x39')]?_0x3e5bc1[_0x5d55('0x37')]:_0x4c390a[_0x5d55('0x32')];_0x3e5bc1[_0x5d55('0x3b')]=qs[_0x5d55('0x4f')](_0x5dd648['query'][_0x5d55('0x4f')]);_0x3e5bc1[_0x5d55('0x3c')]=qs[_0x5d55('0x35')](_[_0x5d55('0x3d')](_0x5dd648[_0x5d55('0x34')],_0x4c390a['filters']));if(_0x5dd648[_0x5d55('0x34')][_0x5d55('0x3e')]){_0x3e5bc1[_0x5d55('0x3c')]=_[_0x5d55('0x40')](_0x3e5bc1['where'],{'$or':_[_0x5d55('0x2e')](_0x3e5bc1[_0x5d55('0x37')],function(_0x10e255){var _0x5c1936={};_0x5c1936[_0x10e255]={'$like':'%'+_0x5dd648['query'][_0x5d55('0x3e')]+'%'};return _0x5c1936;})});}_0x3e5bc1=_[_0x5d55('0x40')]({},_0x3e5bc1,_0x5dd648[_0x5d55('0x41')]);return _0x572ec1[_0x5d55('0x51')](_0x3e5bc1);}})[_0x5d55('0x27')](function(_0x3bfa0d){if(_0x3bfa0d){_0x5e77be=_0x3bfa0d[_0x5d55('0x39')];if(!_0x5dd648['query'][_0x5d55('0x3a')]('nolimit')){_0x3e5bc1[_0x5d55('0x1e')]=qs[_0x5d55('0x1e')](_0x5dd648[_0x5d55('0x34')][_0x5d55('0x1e')]);_0x3e5bc1[_0x5d55('0x1f')]=qs[_0x5d55('0x1f')](_0x5dd648['query']['offset']);}return _0x572ec1[_0x5d55('0x51')](_0x3e5bc1);}})[_0x5d55('0x27')](function(_0x44d945){if(_0x44d945){return _0x44d945?{'count':_0x5e77be,'rows':_0x44d945}:null;}})[_0x5d55('0x27')](respondWithResult(_0x1315eb,null))[_0x5d55('0x46')](handleError(_0x1315eb,null));};exports[_0x5d55('0x52')]=function(_0x595fb7,_0x345236,_0x232e2){var _0x43a872={};var _0x312a70={};var _0x5a9490;var _0x346b0b;return db[_0x5d55('0x42')][_0x5d55('0x4d')]({'where':{'id':_0x595fb7[_0x5d55('0x48')]['id']}})[_0x5d55('0x27')](handleEntityNotFound(_0x345236,null))[_0x5d55('0x27')](function(_0x4bd97a){if(_0x4bd97a){_0x5a9490=_0x4bd97a;_0x312a70[_0x5d55('0x32')]=_[_0x5d55('0x33')](db[_0x5d55('0x4e')][_0x5d55('0x2f')]);_0x312a70['query']=_[_0x5d55('0x33')](_0x595fb7[_0x5d55('0x34')]);_0x312a70['filters']=_[_0x5d55('0x36')](_0x312a70[_0x5d55('0x32')],_0x312a70[_0x5d55('0x34')]);_0x43a872['attributes']=_[_0x5d55('0x36')](_0x312a70[_0x5d55('0x32')],qs[_0x5d55('0x38')](_0x595fb7[_0x5d55('0x34')][_0x5d55('0x38')]));_0x43a872[_0x5d55('0x37')]=_0x43a872[_0x5d55('0x37')][_0x5d55('0x39')]?_0x43a872[_0x5d55('0x37')]:_0x312a70[_0x5d55('0x32')];_0x43a872[_0x5d55('0x3b')]=qs[_0x5d55('0x4f')](_0x595fb7[_0x5d55('0x34')][_0x5d55('0x4f')]);_0x43a872['where']=qs['filters'](_[_0x5d55('0x3d')](_0x595fb7[_0x5d55('0x34')],_0x312a70[_0x5d55('0x35')]));if(_0x595fb7[_0x5d55('0x34')]['filter']){_0x43a872[_0x5d55('0x3c')]=_[_0x5d55('0x40')](_0x43a872[_0x5d55('0x3c')],{'$or':_[_0x5d55('0x2e')](_0x43a872[_0x5d55('0x37')],function(_0x49885a){var _0x57ecfc={};_0x57ecfc[_0x49885a]={'$like':'%'+_0x595fb7['query'][_0x5d55('0x3e')]+'%'};return _0x57ecfc;})});}_0x43a872=_['merge']({},_0x43a872,_0x595fb7[_0x5d55('0x41')]);return _0x5a9490['getDescriptions'](_0x43a872);}})[_0x5d55('0x27')](function(_0x15c8c1){if(_0x15c8c1){_0x346b0b=_0x15c8c1['length'];if(!_0x595fb7[_0x5d55('0x34')]['hasOwnProperty'](_0x5d55('0x50'))){_0x43a872['limit']=qs[_0x5d55('0x1e')](_0x595fb7[_0x5d55('0x34')][_0x5d55('0x1e')]);_0x43a872['offset']=qs[_0x5d55('0x1f')](_0x595fb7[_0x5d55('0x34')]['offset']);}return _0x5a9490[_0x5d55('0x52')](_0x43a872);}})[_0x5d55('0x27')](function(_0x3949f3){if(_0x3949f3){return _0x3949f3?{'count':_0x346b0b,'rows':_0x3949f3}:null;}})[_0x5d55('0x27')](respondWithResult(_0x345236,null))[_0x5d55('0x46')](handleError(_0x345236,null));}; \ No newline at end of file +var _0xf988=['options','includeAll','rows','show','params','include','find','create','body','catch','getFields','findOne','ZohoField','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','index','map','ZohoConfiguration','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge'];(function(_0x552192,_0x4d9370){var _0x6b7953=function(_0x4bccbf){while(--_0x4bccbf){_0x552192['push'](_0x552192['shift']());}};_0x6b7953(++_0x4d9370);}(_0xf988,0x1ae));var _0x8f98=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xf988[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require(_0x8f98('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8f98('0x1'));var jsonpatch=require(_0x8f98('0x2'));var rp=require(_0x8f98('0x3'));var moment=require('moment');var BPromise=require(_0x8f98('0x4'));var Mustache=require(_0x8f98('0x5'));var util=require(_0x8f98('0x6'));var path=require(_0x8f98('0x7'));var sox=require(_0x8f98('0x8'));var csv=require(_0x8f98('0x9'));var ejs=require(_0x8f98('0xa'));var fs=require('fs');var fs_extra=require(_0x8f98('0xb'));var _=require(_0x8f98('0xc'));var squel=require(_0x8f98('0xd'));var crypto=require('crypto');var jsforce=require(_0x8f98('0xe'));var deskjs=require(_0x8f98('0xf'));var toCsv=require(_0x8f98('0x9'));var querystring=require(_0x8f98('0x10'));var Papa=require(_0x8f98('0x11'));var Redis=require(_0x8f98('0x12'));var authService=require(_0x8f98('0x13'));var qs=require(_0x8f98('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8f98('0x15'));var logger=require(_0x8f98('0x16'))('api');var utils=require(_0x8f98('0x17'));var config=require(_0x8f98('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x8f98('0x19'))['db'];function respondWithStatusCode(_0x340f6f,_0x20d33a){_0x20d33a=_0x20d33a||0xcc;return function(_0x6436e5){if(_0x6436e5){return _0x340f6f['sendStatus'](_0x20d33a);}return _0x340f6f[_0x8f98('0x1a')](_0x20d33a)['end']();};}function respondWithResult(_0x49e2c8,_0x46e3e6){_0x46e3e6=_0x46e3e6||0xc8;return function(_0x470b99){if(_0x470b99){return _0x49e2c8['status'](_0x46e3e6)['json'](_0x470b99);}};}function respondWithFilteredResult(_0x365b4e,_0x16928a){return function(_0x140dbc){if(_0x140dbc){var _0x282c95=typeof _0x16928a[_0x8f98('0x1b')]===_0x8f98('0x1c')&&typeof _0x16928a[_0x8f98('0x1d')]===_0x8f98('0x1c');var _0x391e26=_0x140dbc[_0x8f98('0x1e')];var _0x3f3497=_0x282c95?0x0:_0x16928a[_0x8f98('0x1b')];var _0x2730ed=_0x282c95?_0x140dbc[_0x8f98('0x1e')]:_0x16928a[_0x8f98('0x1b')]+_0x16928a['limit'];var _0x4f7d85;if(_0x2730ed>=_0x391e26){_0x2730ed=_0x391e26;_0x4f7d85=0xc8;}else{_0x4f7d85=0xce;}_0x365b4e[_0x8f98('0x1a')](_0x4f7d85);return _0x365b4e['set'](_0x8f98('0x1f'),_0x3f3497+'-'+_0x2730ed+'/'+_0x391e26)[_0x8f98('0x20')](_0x140dbc);}return null;};}function patchUpdates(_0x4be875){return function(_0x4e8900){try{jsonpatch[_0x8f98('0x21')](_0x4e8900,_0x4be875,!![]);}catch(_0x265267){return BPromise[_0x8f98('0x22')](_0x265267);}return _0x4e8900[_0x8f98('0x23')]();};}function saveUpdates(_0x107a55,_0x24c748){return function(_0x5b79eb){if(_0x5b79eb){return _0x5b79eb[_0x8f98('0x24')](_0x107a55)[_0x8f98('0x25')](function(_0x448b90){return _0x448b90;});}return null;};}function removeEntity(_0x456657,_0x23c533){return function(_0x33ed8d){if(_0x33ed8d){return _0x33ed8d[_0x8f98('0x26')]()[_0x8f98('0x25')](function(){_0x456657[_0x8f98('0x1a')](0xcc)[_0x8f98('0x27')]();});}};}function handleEntityNotFound(_0x4cad6e,_0x2ee5bb){return function(_0x468034){if(!_0x468034){_0x4cad6e[_0x8f98('0x28')](0x194);}return _0x468034;};}function handleError(_0x4c82ef,_0x2cf0cc){_0x2cf0cc=_0x2cf0cc||0x1f4;return function(_0x5f00e7){logger[_0x8f98('0x29')](_0x5f00e7[_0x8f98('0x2a')]);if(_0x5f00e7[_0x8f98('0x2b')]){delete _0x5f00e7[_0x8f98('0x2b')];}_0x4c82ef[_0x8f98('0x1a')](_0x2cf0cc)['send'](_0x5f00e7);};}exports[_0x8f98('0x2c')]=function(_0x47489f,_0x4cffe4){var _0x10dae3={},_0x4b27f9={},_0x256153={'count':0x0,'rows':[]};var _0x11d6e7=_[_0x8f98('0x2d')](db[_0x8f98('0x2e')][_0x8f98('0x2f')],function(_0x8be1be){return{'name':_0x8be1be[_0x8f98('0x30')],'type':_0x8be1be['type'][_0x8f98('0x31')]};});_0x4b27f9[_0x8f98('0x32')]=_[_0x8f98('0x2d')](_0x11d6e7,_0x8f98('0x2b'));_0x4b27f9[_0x8f98('0x33')]=_[_0x8f98('0x34')](_0x47489f['query']);_0x4b27f9[_0x8f98('0x35')]=_[_0x8f98('0x36')](_0x4b27f9[_0x8f98('0x32')],_0x4b27f9[_0x8f98('0x33')]);_0x10dae3['attributes']=_[_0x8f98('0x36')](_0x4b27f9[_0x8f98('0x32')],qs[_0x8f98('0x37')](_0x47489f[_0x8f98('0x33')][_0x8f98('0x37')]));_0x10dae3[_0x8f98('0x38')]=_0x10dae3[_0x8f98('0x38')][_0x8f98('0x39')]?_0x10dae3[_0x8f98('0x38')]:_0x4b27f9['model'];if(!_0x47489f[_0x8f98('0x33')][_0x8f98('0x3a')](_0x8f98('0x3b'))){_0x10dae3['limit']=qs[_0x8f98('0x1d')](_0x47489f[_0x8f98('0x33')]['limit']);_0x10dae3[_0x8f98('0x1b')]=qs[_0x8f98('0x1b')](_0x47489f['query']['offset']);}_0x10dae3[_0x8f98('0x3c')]=qs[_0x8f98('0x3d')](_0x47489f[_0x8f98('0x33')][_0x8f98('0x3d')]);_0x10dae3[_0x8f98('0x3e')]=qs[_0x8f98('0x35')](_[_0x8f98('0x3f')](_0x47489f['query'],_0x4b27f9[_0x8f98('0x35')]),_0x11d6e7);if(_0x47489f[_0x8f98('0x33')][_0x8f98('0x40')]){_0x10dae3[_0x8f98('0x3e')]=_['merge'](_0x10dae3[_0x8f98('0x3e')],{'$or':_[_0x8f98('0x2d')](_0x11d6e7,function(_0x21dc72){if(_0x21dc72[_0x8f98('0x41')]!==_0x8f98('0x42')){var _0x1db1a7={};_0x1db1a7[_0x21dc72[_0x8f98('0x2b')]]={'$like':'%'+_0x47489f[_0x8f98('0x33')]['filter']+'%'};return _0x1db1a7;}})});}_0x10dae3=_[_0x8f98('0x43')]({},_0x10dae3,_0x47489f[_0x8f98('0x44')]);var _0x5288e1={'where':_0x10dae3[_0x8f98('0x3e')]};return db[_0x8f98('0x2e')]['count'](_0x5288e1)[_0x8f98('0x25')](function(_0x4b00f2){_0x256153[_0x8f98('0x1e')]=_0x4b00f2;if(_0x47489f[_0x8f98('0x33')][_0x8f98('0x45')]){_0x10dae3['include']=[{'all':!![]}];}return db[_0x8f98('0x2e')]['findAll'](_0x10dae3);})[_0x8f98('0x25')](function(_0x18fad0){_0x256153[_0x8f98('0x46')]=_0x18fad0;return _0x256153;})[_0x8f98('0x25')](respondWithFilteredResult(_0x4cffe4,_0x10dae3))['catch'](handleError(_0x4cffe4,null));};exports[_0x8f98('0x47')]=function(_0xeb4b56,_0x5befc2){var _0x5e3218={'raw':![],'where':{'id':_0xeb4b56[_0x8f98('0x48')]['id']}},_0x5a896b={};_0x5a896b['model']=_[_0x8f98('0x34')](db[_0x8f98('0x2e')][_0x8f98('0x2f')]);_0x5a896b[_0x8f98('0x33')]=_[_0x8f98('0x34')](_0xeb4b56[_0x8f98('0x33')]);_0x5a896b['filters']=_['intersection'](_0x5a896b[_0x8f98('0x32')],_0x5a896b['query']);_0x5e3218[_0x8f98('0x38')]=_[_0x8f98('0x36')](_0x5a896b[_0x8f98('0x32')],qs[_0x8f98('0x37')](_0xeb4b56[_0x8f98('0x33')]['fields']));_0x5e3218[_0x8f98('0x38')]=_0x5e3218['attributes'][_0x8f98('0x39')]?_0x5e3218[_0x8f98('0x38')]:_0x5a896b['model'];if(_0xeb4b56[_0x8f98('0x33')]['includeAll']){_0x5e3218[_0x8f98('0x49')]=[{'all':!![]}];}_0x5e3218=_['merge']({},_0x5e3218,_0xeb4b56[_0x8f98('0x44')]);return db[_0x8f98('0x2e')][_0x8f98('0x4a')](_0x5e3218)[_0x8f98('0x25')](handleEntityNotFound(_0x5befc2,null))[_0x8f98('0x25')](respondWithResult(_0x5befc2,null))['catch'](handleError(_0x5befc2,null));};exports[_0x8f98('0x4b')]=function(_0x2e726e,_0x3cf00c){return db['ZohoConfiguration'][_0x8f98('0x4b')](_0x2e726e[_0x8f98('0x4c')],{})[_0x8f98('0x25')](respondWithResult(_0x3cf00c,0xc9))[_0x8f98('0x4d')](handleError(_0x3cf00c,null));};exports[_0x8f98('0x24')]=function(_0x373ca1,_0x57e3f6){if(_0x373ca1[_0x8f98('0x4c')]['id']){delete _0x373ca1[_0x8f98('0x4c')]['id'];}return db['ZohoConfiguration'][_0x8f98('0x4a')]({'where':{'id':_0x373ca1[_0x8f98('0x48')]['id']}})['then'](handleEntityNotFound(_0x57e3f6,null))[_0x8f98('0x25')](saveUpdates(_0x373ca1['body'],null))[_0x8f98('0x25')](respondWithResult(_0x57e3f6,null))[_0x8f98('0x4d')](handleError(_0x57e3f6,null));};exports[_0x8f98('0x26')]=function(_0x507ad2,_0x558677){return db[_0x8f98('0x2e')][_0x8f98('0x4a')]({'where':{'id':_0x507ad2['params']['id']}})[_0x8f98('0x25')](handleEntityNotFound(_0x558677,null))[_0x8f98('0x25')](removeEntity(_0x558677,null))[_0x8f98('0x4d')](handleError(_0x558677,null));};exports[_0x8f98('0x4e')]=function(_0x43bc89,_0x47251f,_0xbeda7d){var _0x15cb0d={};var _0x29d9f6={};var _0x292e77;var _0x309f35;return db[_0x8f98('0x2e')][_0x8f98('0x4f')]({'where':{'id':_0x43bc89[_0x8f98('0x48')]['id']}})[_0x8f98('0x25')](handleEntityNotFound(_0x47251f,null))[_0x8f98('0x25')](function(_0x57df94){if(_0x57df94){_0x292e77=_0x57df94;_0x29d9f6[_0x8f98('0x32')]=_['keys'](db[_0x8f98('0x50')]['rawAttributes']);_0x29d9f6[_0x8f98('0x33')]=_['keys'](_0x43bc89[_0x8f98('0x33')]);_0x29d9f6[_0x8f98('0x35')]=_[_0x8f98('0x36')](_0x29d9f6[_0x8f98('0x32')],_0x29d9f6[_0x8f98('0x33')]);_0x15cb0d['attributes']=_['intersection'](_0x29d9f6[_0x8f98('0x32')],qs[_0x8f98('0x37')](_0x43bc89[_0x8f98('0x33')][_0x8f98('0x37')]));_0x15cb0d[_0x8f98('0x38')]=_0x15cb0d['attributes'][_0x8f98('0x39')]?_0x15cb0d[_0x8f98('0x38')]:_0x29d9f6['model'];_0x15cb0d[_0x8f98('0x3c')]=qs[_0x8f98('0x3d')](_0x43bc89['query']['sort']);_0x15cb0d[_0x8f98('0x3e')]=qs[_0x8f98('0x35')](_[_0x8f98('0x3f')](_0x43bc89[_0x8f98('0x33')],_0x29d9f6[_0x8f98('0x35')]));if(_0x43bc89[_0x8f98('0x33')]['filter']){_0x15cb0d[_0x8f98('0x3e')]=_['merge'](_0x15cb0d[_0x8f98('0x3e')],{'$or':_['map'](_0x15cb0d[_0x8f98('0x38')],function(_0x2b8d62){var _0x5e1ae1={};_0x5e1ae1[_0x2b8d62]={'$like':'%'+_0x43bc89['query']['filter']+'%'};return _0x5e1ae1;})});}_0x15cb0d=_[_0x8f98('0x43')]({},_0x15cb0d,_0x43bc89[_0x8f98('0x44')]);return _0x292e77[_0x8f98('0x4e')](_0x15cb0d);}})[_0x8f98('0x25')](function(_0x5dd104){if(_0x5dd104){_0x309f35=_0x5dd104[_0x8f98('0x39')];if(!_0x43bc89[_0x8f98('0x33')]['hasOwnProperty'](_0x8f98('0x3b'))){_0x15cb0d[_0x8f98('0x1d')]=qs[_0x8f98('0x1d')](_0x43bc89[_0x8f98('0x33')][_0x8f98('0x1d')]);_0x15cb0d[_0x8f98('0x1b')]=qs[_0x8f98('0x1b')](_0x43bc89['query'][_0x8f98('0x1b')]);}return _0x292e77[_0x8f98('0x4e')](_0x15cb0d);}})[_0x8f98('0x25')](function(_0x4516fe){if(_0x4516fe){return _0x4516fe?{'count':_0x309f35,'rows':_0x4516fe}:null;}})[_0x8f98('0x25')](respondWithResult(_0x47251f,null))[_0x8f98('0x4d')](handleError(_0x47251f,null));};exports[_0x8f98('0x51')]=function(_0x172307,_0x4b57bb,_0x37c126){var _0x5db460={};var _0x3c8546={};var _0x508121;var _0x2ddf97;return db[_0x8f98('0x2e')][_0x8f98('0x4f')]({'where':{'id':_0x172307[_0x8f98('0x48')]['id']}})[_0x8f98('0x25')](handleEntityNotFound(_0x4b57bb,null))[_0x8f98('0x25')](function(_0x5f447b){if(_0x5f447b){_0x508121=_0x5f447b;_0x3c8546[_0x8f98('0x32')]=_[_0x8f98('0x34')](db[_0x8f98('0x50')][_0x8f98('0x2f')]);_0x3c8546[_0x8f98('0x33')]=_['keys'](_0x172307[_0x8f98('0x33')]);_0x3c8546[_0x8f98('0x35')]=_[_0x8f98('0x36')](_0x3c8546[_0x8f98('0x32')],_0x3c8546[_0x8f98('0x33')]);_0x5db460[_0x8f98('0x38')]=_[_0x8f98('0x36')](_0x3c8546[_0x8f98('0x32')],qs[_0x8f98('0x37')](_0x172307[_0x8f98('0x33')][_0x8f98('0x37')]));_0x5db460[_0x8f98('0x38')]=_0x5db460['attributes'][_0x8f98('0x39')]?_0x5db460[_0x8f98('0x38')]:_0x3c8546['model'];_0x5db460['order']=qs[_0x8f98('0x3d')](_0x172307['query'][_0x8f98('0x3d')]);_0x5db460[_0x8f98('0x3e')]=qs[_0x8f98('0x35')](_[_0x8f98('0x3f')](_0x172307['query'],_0x3c8546[_0x8f98('0x35')]));if(_0x172307[_0x8f98('0x33')]['filter']){_0x5db460[_0x8f98('0x3e')]=_[_0x8f98('0x43')](_0x5db460[_0x8f98('0x3e')],{'$or':_['map'](_0x5db460['attributes'],function(_0x7c8069){var _0x2ed5c9={};_0x2ed5c9[_0x7c8069]={'$like':'%'+_0x172307[_0x8f98('0x33')]['filter']+'%'};return _0x2ed5c9;})});}_0x5db460=_[_0x8f98('0x43')]({},_0x5db460,_0x172307['options']);return _0x508121[_0x8f98('0x51')](_0x5db460);}})['then'](function(_0x56b5ca){if(_0x56b5ca){_0x2ddf97=_0x56b5ca[_0x8f98('0x39')];if(!_0x172307[_0x8f98('0x33')][_0x8f98('0x3a')](_0x8f98('0x3b'))){_0x5db460[_0x8f98('0x1d')]=qs[_0x8f98('0x1d')](_0x172307['query'][_0x8f98('0x1d')]);_0x5db460[_0x8f98('0x1b')]=qs['offset'](_0x172307['query'][_0x8f98('0x1b')]);}return _0x508121['getSubjects'](_0x5db460);}})[_0x8f98('0x25')](function(_0x3435af){if(_0x3435af){return _0x3435af?{'count':_0x2ddf97,'rows':_0x3435af}:null;}})['then'](respondWithResult(_0x4b57bb,null))['catch'](handleError(_0x4b57bb,null));};exports[_0x8f98('0x52')]=function(_0x2a1650,_0x1a2881,_0x238a00){var _0x3911f8={};var _0xe9eea1={};var _0x35cc8e;var _0x55abe9;return db['ZohoConfiguration']['findOne']({'where':{'id':_0x2a1650[_0x8f98('0x48')]['id']}})[_0x8f98('0x25')](handleEntityNotFound(_0x1a2881,null))[_0x8f98('0x25')](function(_0x10a498){if(_0x10a498){_0x35cc8e=_0x10a498;_0xe9eea1['model']=_[_0x8f98('0x34')](db[_0x8f98('0x50')]['rawAttributes']);_0xe9eea1[_0x8f98('0x33')]=_[_0x8f98('0x34')](_0x2a1650[_0x8f98('0x33')]);_0xe9eea1[_0x8f98('0x35')]=_['intersection'](_0xe9eea1[_0x8f98('0x32')],_0xe9eea1['query']);_0x3911f8[_0x8f98('0x38')]=_[_0x8f98('0x36')](_0xe9eea1[_0x8f98('0x32')],qs[_0x8f98('0x37')](_0x2a1650[_0x8f98('0x33')]['fields']));_0x3911f8[_0x8f98('0x38')]=_0x3911f8[_0x8f98('0x38')][_0x8f98('0x39')]?_0x3911f8['attributes']:_0xe9eea1[_0x8f98('0x32')];_0x3911f8[_0x8f98('0x3c')]=qs[_0x8f98('0x3d')](_0x2a1650['query'][_0x8f98('0x3d')]);_0x3911f8[_0x8f98('0x3e')]=qs[_0x8f98('0x35')](_['pick'](_0x2a1650[_0x8f98('0x33')],_0xe9eea1[_0x8f98('0x35')]));if(_0x2a1650['query'][_0x8f98('0x40')]){_0x3911f8['where']=_['merge'](_0x3911f8[_0x8f98('0x3e')],{'$or':_['map'](_0x3911f8[_0x8f98('0x38')],function(_0x1c2770){var _0x14b68b={};_0x14b68b[_0x1c2770]={'$like':'%'+_0x2a1650[_0x8f98('0x33')][_0x8f98('0x40')]+'%'};return _0x14b68b;})});}_0x3911f8=_[_0x8f98('0x43')]({},_0x3911f8,_0x2a1650[_0x8f98('0x44')]);return _0x35cc8e['getDescriptions'](_0x3911f8);}})[_0x8f98('0x25')](function(_0xb56ceb){if(_0xb56ceb){_0x55abe9=_0xb56ceb[_0x8f98('0x39')];if(!_0x2a1650['query'][_0x8f98('0x3a')](_0x8f98('0x3b'))){_0x3911f8['limit']=qs['limit'](_0x2a1650[_0x8f98('0x33')]['limit']);_0x3911f8['offset']=qs[_0x8f98('0x1b')](_0x2a1650['query'][_0x8f98('0x1b')]);}return _0x35cc8e[_0x8f98('0x52')](_0x3911f8);}})[_0x8f98('0x25')](function(_0x2b6faa){if(_0x2b6faa){return _0x2b6faa?{'count':_0x55abe9,'rows':_0x2b6faa}:null;}})[_0x8f98('0x25')](respondWithResult(_0x1a2881,null))[_0x8f98('0x4d')](handleError(_0x1a2881,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 5ec7799..db90e51 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 _0x4cd8=['../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x5eed79,_0x2159b2){var _0x4d92bd=function(_0x457a7f){while(--_0x457a7f){_0x5eed79['push'](_0x5eed79['shift']());}};_0x4d92bd(++_0x2159b2);}(_0x4cd8,0x1a9));var _0x84cd=function(_0x400322,_0x4353a8){_0x400322=_0x400322-0x0;var _0xfdd597=_0x4cd8[_0x400322];return _0xfdd597;};'use strict';var _=require(_0x84cd('0x0'));var util=require(_0x84cd('0x1'));var logger=require(_0x84cd('0x2'))('api');var moment=require(_0x84cd('0x3'));var BPromise=require(_0x84cd('0x4'));var rp=require(_0x84cd('0x5'));var fs=require('fs');var path=require(_0x84cd('0x6'));var rimraf=require('rimraf');var config=require(_0x84cd('0x7'));var attributes=require(_0x84cd('0x8'));module[_0x84cd('0x9')]=function(_0x7f7f33,_0x17b1bc){return _0x7f7f33[_0x84cd('0xa')](_0x84cd('0xb'),attributes,{'tableName':'int_zoho_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0e07=['path','rimraf','../../config/environment','exports','ZohoConfiguration','int_zoho_configurations','lodash','util','api','moment','request-promise'];(function(_0x383dc2,_0x57b489){var _0x10934f=function(_0x51e2ff){while(--_0x51e2ff){_0x383dc2['push'](_0x383dc2['shift']());}};_0x10934f(++_0x57b489);}(_0x0e07,0x7f));var _0x70e0=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x0e07[_0x1035c1];return _0x308d67;};'use strict';var _=require(_0x70e0('0x0'));var util=require(_0x70e0('0x1'));var logger=require('../../config/logger')(_0x70e0('0x2'));var moment=require(_0x70e0('0x3'));var BPromise=require('bluebird');var rp=require(_0x70e0('0x4'));var fs=require('fs');var path=require(_0x70e0('0x5'));var rimraf=require(_0x70e0('0x6'));var config=require(_0x70e0('0x7'));var attributes=require('./intZohoConfiguration.attributes');module[_0x70e0('0x8')]=function(_0x492fd1,_0x7bedcf){return _0x492fd1['define'](_0x70e0('0x9'),attributes,{'tableName':_0x70e0('0xa'),'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 c7f6e2c..0e63782 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 _0x0eed=['result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x4d82e1,_0x5ac72b){var _0x5f3bd9=function(_0x5380db){while(--_0x5380db){_0x4d82e1['push'](_0x4d82e1['shift']());}};_0x5f3bd9(++_0x5ac72b);}(_0x0eed,0x1ca));var _0xd0ee=function(_0x20bff0,_0x1c5598){_0x20bff0=_0x20bff0-0x0;var _0x57b2fd=_0x0eed[_0x20bff0];return _0x57b2fd;};'use strict';var _=require(_0xd0ee('0x0'));var util=require(_0xd0ee('0x1'));var moment=require(_0xd0ee('0x2'));var BPromise=require('bluebird');var rs=require(_0xd0ee('0x3'));var fs=require('fs');var Redis=require(_0xd0ee('0x4'));var db=require(_0xd0ee('0x5'))['db'];var utils=require(_0xd0ee('0x6'));var logger=require(_0xd0ee('0x7'))(_0xd0ee('0x8'));var config=require(_0xd0ee('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd0ee('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x450e69,_0x56bc61,_0x575dd0){return new BPromise(function(_0x252353,_0x329076){return client[_0xd0ee('0xb')](_0x450e69,_0x575dd0)[_0xd0ee('0xc')](function(_0x56ebcd){logger[_0xd0ee('0xd')](_0xd0ee('0xe'),_0x56bc61,'request\x20sent');logger[_0xd0ee('0xf')](_0xd0ee('0x10'),_0x56bc61,_0xd0ee('0x11'),JSON[_0xd0ee('0x12')](_0x56ebcd));if(_0x56ebcd['error']){if(_0x56ebcd[_0xd0ee('0x13')][_0xd0ee('0x14')]===0x1f4){logger[_0xd0ee('0x13')](_0xd0ee('0xe'),_0x56bc61,_0x56ebcd[_0xd0ee('0x13')]['message']);return _0x329076(_0x56ebcd[_0xd0ee('0x13')][_0xd0ee('0x15')]);}logger[_0xd0ee('0x13')](_0xd0ee('0xe'),_0x56bc61,_0x56ebcd[_0xd0ee('0x13')][_0xd0ee('0x15')]);return _0x252353(_0x56ebcd[_0xd0ee('0x13')][_0xd0ee('0x15')]);}else{logger[_0xd0ee('0xd')](_0xd0ee('0xe'),_0x56bc61,_0xd0ee('0x11'));_0x252353(_0x56ebcd[_0xd0ee('0x16')][_0xd0ee('0x15')]);}})[_0xd0ee('0x17')](function(_0x56f7bd){logger[_0xd0ee('0x13')](_0xd0ee('0xe'),_0x56bc61,_0x56f7bd);_0x329076(_0x56f7bd);});});} \ No newline at end of file +var _0xdc33=['code','message','result','catch','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','error'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0xdc33,0x148));var _0x3dc3=function(_0x4590cd,_0x52ea0b){_0x4590cd=_0x4590cd-0x0;var _0x2984b6=_0xdc33[_0x4590cd];return _0x2984b6;};'use strict';var _=require(_0x3dc3('0x0'));var util=require(_0x3dc3('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3dc3('0x2'));var db=require(_0x3dc3('0x3'))['db'];var utils=require(_0x3dc3('0x4'));var logger=require(_0x3dc3('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3dc3('0x6'));var client=jayson[_0x3dc3('0x7')][_0x3dc3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4dbb41,_0xa1cd1a,_0x2f0e49){return new BPromise(function(_0x26ab37,_0x3ad384){return client[_0x3dc3('0x9')](_0x4dbb41,_0x2f0e49)['then'](function(_0xeb5eff){logger[_0x3dc3('0xa')](_0x3dc3('0xb'),_0xa1cd1a,'request\x20sent');logger['debug']('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0xa1cd1a,_0x3dc3('0xc'),JSON['stringify'](_0xeb5eff));if(_0xeb5eff[_0x3dc3('0xd')]){if(_0xeb5eff[_0x3dc3('0xd')][_0x3dc3('0xe')]===0x1f4){logger[_0x3dc3('0xd')](_0x3dc3('0xb'),_0xa1cd1a,_0xeb5eff[_0x3dc3('0xd')][_0x3dc3('0xf')]);return _0x3ad384(_0xeb5eff[_0x3dc3('0xd')][_0x3dc3('0xf')]);}logger[_0x3dc3('0xd')](_0x3dc3('0xb'),_0xa1cd1a,_0xeb5eff[_0x3dc3('0xd')][_0x3dc3('0xf')]);return _0x26ab37(_0xeb5eff[_0x3dc3('0xd')][_0x3dc3('0xf')]);}else{logger[_0x3dc3('0xa')](_0x3dc3('0xb'),_0xa1cd1a,_0x3dc3('0xc'));_0x26ab37(_0xeb5eff[_0x3dc3('0x10')][_0x3dc3('0xf')]);}})[_0x3dc3('0x11')](function(_0x18c846){logger['error'](_0x3dc3('0xb'),_0xa1cd1a,_0x18c846);_0x3ad384(_0x18c846);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 1123709..bb34fe2 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 _0x2763=['../../components/auth/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra'];(function(_0x16a8f2,_0x38ed96){var _0x4df43c=function(_0x968127){while(--_0x968127){_0x16a8f2['push'](_0x16a8f2['shift']());}};_0x4df43c(++_0x38ed96);}(_0x2763,0x18a));var _0x3276=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2763[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0x3276('0x0'));var path=require(_0x3276('0x1'));var timeout=require(_0x3276('0x2'));var express=require('express');var router=express[_0x3276('0x3')]();var fs_extra=require(_0x3276('0x4'));var auth=require(_0x3276('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x3276('0x6'));var controller=require(_0x3276('0x7'));router[_0x3276('0x8')]('/',auth[_0x3276('0x9')](),controller[_0x3276('0xa')]);router['get'](_0x3276('0xb'),auth[_0x3276('0x9')](),controller[_0x3276('0xc')]);router[_0x3276('0xd')]('/',auth[_0x3276('0x9')](),controller['create']);router[_0x3276('0xe')]('/:id',auth[_0x3276('0x9')](),controller[_0x3276('0xf')]);router[_0x3276('0x10')](_0x3276('0xb'),auth[_0x3276('0x9')](),controller[_0x3276('0x11')]);module[_0x3276('0x12')]=router; \ No newline at end of file +var _0xa83a=['delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','show','post','create','update'];(function(_0x4a5f11,_0x49e856){var _0x631a38=function(_0x47ac95){while(--_0x47ac95){_0x4a5f11['push'](_0x4a5f11['shift']());}};_0x631a38(++_0x49e856);}(_0xa83a,0x16a));var _0xaa83=function(_0x1f53ff,_0x451076){_0x1f53ff=_0x1f53ff-0x0;var _0x599de3=_0xa83a[_0x1f53ff];return _0x599de3;};'use strict';var multer=require('multer');var util=require(_0xaa83('0x0'));var path=require(_0xaa83('0x1'));var timeout=require(_0xaa83('0x2'));var express=require(_0xaa83('0x3'));var router=express[_0xaa83('0x4')]();var fs_extra=require(_0xaa83('0x5'));var auth=require(_0xaa83('0x6'));var interaction=require(_0xaa83('0x7'));var config=require(_0xaa83('0x8'));var controller=require('./intZohoField.controller');router['get']('/',auth[_0xaa83('0x9')](),controller['index']);router[_0xaa83('0xa')](_0xaa83('0xb'),auth[_0xaa83('0x9')](),controller[_0xaa83('0xc')]);router[_0xaa83('0xd')]('/',auth[_0xaa83('0x9')](),controller[_0xaa83('0xe')]);router['put'](_0xaa83('0xb'),auth[_0xaa83('0x9')](),controller[_0xaa83('0xf')]);router[_0xaa83('0x10')]('/:id',auth[_0xaa83('0x9')](),controller[_0xaa83('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 15c0492..783ecb2 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 _0xa036=['ENUM','string','customVariable','keyValue','picklist','STRING','variable','BOOLEAN','exports'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0xa036,0xaa));var _0x6a03=function(_0xa5fc76,_0x16dc68){_0xa5fc76=_0xa5fc76-0x0;var _0x306259=_0xa036[_0xa5fc76];return _0x306259;};'use strict';var Sequelize=require('sequelize');module[_0x6a03('0x0')]={'type':{'type':Sequelize[_0x6a03('0x1')](_0x6a03('0x2'),'variable',_0x6a03('0x3'),_0x6a03('0x4'),_0x6a03('0x5')),'defaultValue':_0x6a03('0x2')},'content':{'type':Sequelize[_0x6a03('0x6')]},'key':{'type':Sequelize[_0x6a03('0x6')]},'keyType':{'type':Sequelize[_0x6a03('0x1')](_0x6a03('0x2'),_0x6a03('0x7'),_0x6a03('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x6a03('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x62c4=['BOOLEAN','ENUM','keyValue','STRING','string','variable','customVariable'];(function(_0x1c99ce,_0x651181){var _0x49bf4f=function(_0x3862dd){while(--_0x3862dd){_0x1c99ce['push'](_0x1c99ce['shift']());}};_0x49bf4f(++_0x651181);}(_0x62c4,0x10b));var _0x462c=function(_0x5b7ad0,_0x2ef5ed){_0x5b7ad0=_0x5b7ad0-0x0;var _0x21ba44=_0x62c4[_0x5b7ad0];return _0x21ba44;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x462c('0x0')]('string','variable','customVariable',_0x462c('0x1'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x462c('0x2')]},'key':{'type':Sequelize[_0x462c('0x2')]},'keyType':{'type':Sequelize['ENUM'](_0x462c('0x3'),_0x462c('0x4'),_0x462c('0x5'))},'keyContent':{'type':Sequelize[_0x462c('0x2')]},'idField':{'type':Sequelize[_0x462c('0x2')]},'nameField':{'type':Sequelize[_0x462c('0x2')]},'customField':{'type':Sequelize[_0x462c('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x462c('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 49e371c..04e08bc 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 _0x64dd=['Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','index','map','ZohoField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set'];(function(_0x379647,_0x166b76){var _0x31e125=function(_0x510017){while(--_0x510017){_0x379647['push'](_0x379647['shift']());}};_0x31e125(++_0x166b76);}(_0x64dd,0xc3));var _0xd64d=function(_0x3ce557,_0x483912){_0x3ce557=_0x3ce557-0x0;var _0x4a1aef=_0x64dd[_0x3ce557];return _0x4a1aef;};'use strict';var emlformat=require(_0xd64d('0x0'));var rimraf=require(_0xd64d('0x1'));var zipdir=require(_0xd64d('0x2'));var jsonpatch=require(_0xd64d('0x3'));var rp=require(_0xd64d('0x4'));var moment=require('moment');var BPromise=require(_0xd64d('0x5'));var Mustache=require(_0xd64d('0x6'));var util=require(_0xd64d('0x7'));var path=require(_0xd64d('0x8'));var sox=require(_0xd64d('0x9'));var csv=require('to-csv');var ejs=require(_0xd64d('0xa'));var fs=require('fs');var fs_extra=require(_0xd64d('0xb'));var _=require(_0xd64d('0xc'));var squel=require(_0xd64d('0xd'));var crypto=require('crypto');var jsforce=require(_0xd64d('0xe'));var deskjs=require(_0xd64d('0xf'));var toCsv=require('to-csv');var querystring=require(_0xd64d('0x10'));var Papa=require(_0xd64d('0x11'));var Redis=require(_0xd64d('0x12'));var authService=require(_0xd64d('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd64d('0x14'));var logger=require(_0xd64d('0x15'))(_0xd64d('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd64d('0x17'));var db=require(_0xd64d('0x18'))['db'];function respondWithStatusCode(_0x152902,_0x24aed6){_0x24aed6=_0x24aed6||0xcc;return function(_0x61b248){if(_0x61b248){return _0x152902[_0xd64d('0x19')](_0x24aed6);}return _0x152902[_0xd64d('0x1a')](_0x24aed6)['end']();};}function respondWithResult(_0x4f03a2,_0x231630){_0x231630=_0x231630||0xc8;return function(_0x3423cc){if(_0x3423cc){return _0x4f03a2[_0xd64d('0x1a')](_0x231630)[_0xd64d('0x1b')](_0x3423cc);}};}function respondWithFilteredResult(_0x5ccb16,_0x38efae){return function(_0x580362){if(_0x580362){var _0x5aa3b8=typeof _0x38efae[_0xd64d('0x1c')]===_0xd64d('0x1d')&&typeof _0x38efae['limit']===_0xd64d('0x1d');var _0x2b443c=_0x580362[_0xd64d('0x1e')];var _0x35ab62=_0x5aa3b8?0x0:_0x38efae['offset'];var _0x1ce545=_0x5aa3b8?_0x580362[_0xd64d('0x1e')]:_0x38efae[_0xd64d('0x1c')]+_0x38efae[_0xd64d('0x1f')];var _0x4b3ae2;if(_0x1ce545>=_0x2b443c){_0x1ce545=_0x2b443c;_0x4b3ae2=0xc8;}else{_0x4b3ae2=0xce;}_0x5ccb16['status'](_0x4b3ae2);return _0x5ccb16[_0xd64d('0x20')](_0xd64d('0x21'),_0x35ab62+'-'+_0x1ce545+'/'+_0x2b443c)[_0xd64d('0x1b')](_0x580362);}return null;};}function patchUpdates(_0x4c7c00){return function(_0x257cd9){try{jsonpatch[_0xd64d('0x22')](_0x257cd9,_0x4c7c00,!![]);}catch(_0x1a55cd){return BPromise[_0xd64d('0x23')](_0x1a55cd);}return _0x257cd9['save']();};}function saveUpdates(_0x4529ab,_0x53083e){return function(_0x27d796){if(_0x27d796){return _0x27d796[_0xd64d('0x24')](_0x4529ab)[_0xd64d('0x25')](function(_0x4bc291){return _0x4bc291;});}return null;};}function removeEntity(_0xbf911f,_0x369156){return function(_0x556a27){if(_0x556a27){return _0x556a27[_0xd64d('0x26')]()[_0xd64d('0x25')](function(){_0xbf911f[_0xd64d('0x1a')](0xcc)[_0xd64d('0x27')]();});}};}function handleEntityNotFound(_0x53138a,_0xa9f6db){return function(_0x4d6e27){if(!_0x4d6e27){_0x53138a[_0xd64d('0x19')](0x194);}return _0x4d6e27;};}function handleError(_0x2f215d,_0x4cf28a){_0x4cf28a=_0x4cf28a||0x1f4;return function(_0x11a6f2){logger[_0xd64d('0x28')](_0x11a6f2[_0xd64d('0x29')]);if(_0x11a6f2[_0xd64d('0x2a')]){delete _0x11a6f2[_0xd64d('0x2a')];}_0x2f215d['status'](_0x4cf28a)[_0xd64d('0x2b')](_0x11a6f2);};}exports[_0xd64d('0x2c')]=function(_0x2e13dd,_0x1c58c0){var _0x147eed={},_0x1683f1={},_0x350bf3={'count':0x0,'rows':[]};var _0x169c9d=_[_0xd64d('0x2d')](db[_0xd64d('0x2e')][_0xd64d('0x2f')],function(_0x556387){return{'name':_0x556387[_0xd64d('0x30')],'type':_0x556387[_0xd64d('0x31')][_0xd64d('0x32')]};});_0x1683f1[_0xd64d('0x33')]=_[_0xd64d('0x2d')](_0x169c9d,'name');_0x1683f1[_0xd64d('0x34')]=_[_0xd64d('0x35')](_0x2e13dd[_0xd64d('0x34')]);_0x1683f1[_0xd64d('0x36')]=_[_0xd64d('0x37')](_0x1683f1['model'],_0x1683f1[_0xd64d('0x34')]);_0x147eed[_0xd64d('0x38')]=_['intersection'](_0x1683f1['model'],qs[_0xd64d('0x39')](_0x2e13dd[_0xd64d('0x34')]['fields']));_0x147eed[_0xd64d('0x38')]=_0x147eed['attributes'][_0xd64d('0x3a')]?_0x147eed[_0xd64d('0x38')]:_0x1683f1[_0xd64d('0x33')];if(!_0x2e13dd['query']['hasOwnProperty']('nolimit')){_0x147eed['limit']=qs[_0xd64d('0x1f')](_0x2e13dd[_0xd64d('0x34')]['limit']);_0x147eed[_0xd64d('0x1c')]=qs[_0xd64d('0x1c')](_0x2e13dd['query']['offset']);}_0x147eed[_0xd64d('0x3b')]=qs[_0xd64d('0x3c')](_0x2e13dd[_0xd64d('0x34')][_0xd64d('0x3c')]);_0x147eed[_0xd64d('0x3d')]=qs['filters'](_['pick'](_0x2e13dd[_0xd64d('0x34')],_0x1683f1['filters']),_0x169c9d);if(_0x2e13dd[_0xd64d('0x34')]['filter']){_0x147eed[_0xd64d('0x3d')]=_[_0xd64d('0x3e')](_0x147eed[_0xd64d('0x3d')],{'$or':_['map'](_0x169c9d,function(_0x346a44){if(_0x346a44[_0xd64d('0x31')]!==_0xd64d('0x3f')){var _0x1c4134={};_0x1c4134[_0x346a44[_0xd64d('0x2a')]]={'$like':'%'+_0x2e13dd[_0xd64d('0x34')][_0xd64d('0x40')]+'%'};return _0x1c4134;}})});}_0x147eed=_[_0xd64d('0x3e')]({},_0x147eed,_0x2e13dd[_0xd64d('0x41')]);var _0x423243={'where':_0x147eed[_0xd64d('0x3d')]};return db[_0xd64d('0x2e')][_0xd64d('0x1e')](_0x423243)[_0xd64d('0x25')](function(_0x1e92b1){_0x350bf3[_0xd64d('0x1e')]=_0x1e92b1;if(_0x2e13dd[_0xd64d('0x34')][_0xd64d('0x42')]){_0x147eed[_0xd64d('0x43')]=[{'all':!![]}];}return db[_0xd64d('0x2e')][_0xd64d('0x44')](_0x147eed);})[_0xd64d('0x25')](function(_0x5a442e){_0x350bf3[_0xd64d('0x45')]=_0x5a442e;return _0x350bf3;})['then'](respondWithFilteredResult(_0x1c58c0,_0x147eed))[_0xd64d('0x46')](handleError(_0x1c58c0,null));};exports[_0xd64d('0x47')]=function(_0x17a491,_0x412519){var _0x1420f2={'raw':!![],'where':{'id':_0x17a491['params']['id']}},_0x5d3f3d={};_0x5d3f3d[_0xd64d('0x33')]=_[_0xd64d('0x35')](db[_0xd64d('0x2e')][_0xd64d('0x2f')]);_0x5d3f3d[_0xd64d('0x34')]=_[_0xd64d('0x35')](_0x17a491['query']);_0x5d3f3d['filters']=_[_0xd64d('0x37')](_0x5d3f3d['model'],_0x5d3f3d['query']);_0x1420f2[_0xd64d('0x38')]=_[_0xd64d('0x37')](_0x5d3f3d['model'],qs[_0xd64d('0x39')](_0x17a491[_0xd64d('0x34')][_0xd64d('0x39')]));_0x1420f2[_0xd64d('0x38')]=_0x1420f2[_0xd64d('0x38')][_0xd64d('0x3a')]?_0x1420f2[_0xd64d('0x38')]:_0x5d3f3d['model'];if(_0x17a491[_0xd64d('0x34')][_0xd64d('0x42')]){_0x1420f2[_0xd64d('0x43')]=[{'all':!![]}];}_0x1420f2=_[_0xd64d('0x3e')]({},_0x1420f2,_0x17a491[_0xd64d('0x41')]);return db[_0xd64d('0x2e')][_0xd64d('0x48')](_0x1420f2)[_0xd64d('0x25')](handleEntityNotFound(_0x412519,null))[_0xd64d('0x25')](respondWithResult(_0x412519,null))[_0xd64d('0x46')](handleError(_0x412519,null));};exports[_0xd64d('0x49')]=function(_0x34456f,_0x5ef2f4){return db[_0xd64d('0x2e')][_0xd64d('0x49')](_0x34456f['body'],{})[_0xd64d('0x25')](respondWithResult(_0x5ef2f4,0xc9))[_0xd64d('0x46')](handleError(_0x5ef2f4,null));};exports[_0xd64d('0x24')]=function(_0x46cc66,_0x28f9f2){if(_0x46cc66[_0xd64d('0x4a')]['id']){delete _0x46cc66[_0xd64d('0x4a')]['id'];}return db['ZohoField'][_0xd64d('0x48')]({'where':{'id':_0x46cc66['params']['id']}})['then'](handleEntityNotFound(_0x28f9f2,null))[_0xd64d('0x25')](saveUpdates(_0x46cc66[_0xd64d('0x4a')],null))[_0xd64d('0x25')](respondWithResult(_0x28f9f2,null))['catch'](handleError(_0x28f9f2,null));};exports[_0xd64d('0x26')]=function(_0x5f4b08,_0x1bc024){return db['ZohoField'][_0xd64d('0x48')]({'where':{'id':_0x5f4b08[_0xd64d('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1bc024,null))['then'](removeEntity(_0x1bc024,null))[_0xd64d('0x46')](handleError(_0x1bc024,null));}; \ No newline at end of file +var _0x05ea=['params','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','error','stack','name','index','map','ZohoField','fieldName','type','key','query','filters','attributes','intersection','model','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','show','keys','rawAttributes','find','create','update','body'];(function(_0x52b2ba,_0x385f19){var _0x1a879d=function(_0x345ba3){while(--_0x345ba3){_0x52b2ba['push'](_0x52b2ba['shift']());}};_0x1a879d(++_0x385f19);}(_0x05ea,0x187));var _0xa05e=function(_0x2ac4af,_0x288c53){_0x2ac4af=_0x2ac4af-0x0;var _0x3a36df=_0x05ea[_0x2ac4af];return _0x3a36df;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa05e('0x0'));var zipdir=require(_0xa05e('0x1'));var jsonpatch=require(_0xa05e('0x2'));var rp=require('request-promise');var moment=require(_0xa05e('0x3'));var BPromise=require(_0xa05e('0x4'));var Mustache=require('mustache');var util=require(_0xa05e('0x5'));var path=require(_0xa05e('0x6'));var sox=require(_0xa05e('0x7'));var csv=require(_0xa05e('0x8'));var ejs=require(_0xa05e('0x9'));var fs=require('fs');var fs_extra=require(_0xa05e('0xa'));var _=require(_0xa05e('0xb'));var squel=require(_0xa05e('0xc'));var crypto=require(_0xa05e('0xd'));var jsforce=require(_0xa05e('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa05e('0x8'));var querystring=require(_0xa05e('0xf'));var Papa=require(_0xa05e('0x10'));var Redis=require(_0xa05e('0x11'));var authService=require(_0xa05e('0x12'));var qs=require(_0xa05e('0x13'));var as=require(_0xa05e('0x14'));var hardwareService=require(_0xa05e('0x15'));var logger=require(_0xa05e('0x16'))('api');var utils=require(_0xa05e('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa05e('0x18'))['db'];function respondWithStatusCode(_0x50ae05,_0x3ca77e){_0x3ca77e=_0x3ca77e||0xcc;return function(_0x2b3f7e){if(_0x2b3f7e){return _0x50ae05[_0xa05e('0x19')](_0x3ca77e);}return _0x50ae05[_0xa05e('0x1a')](_0x3ca77e)[_0xa05e('0x1b')]();};}function respondWithResult(_0x110653,_0x54de2a){_0x54de2a=_0x54de2a||0xc8;return function(_0x4f3cad){if(_0x4f3cad){return _0x110653['status'](_0x54de2a)[_0xa05e('0x1c')](_0x4f3cad);}};}function respondWithFilteredResult(_0x4925cf,_0x3097e6){return function(_0x107a0d){if(_0x107a0d){var _0x428e54=typeof _0x3097e6[_0xa05e('0x1d')]===_0xa05e('0x1e')&&typeof _0x3097e6[_0xa05e('0x1f')]===_0xa05e('0x1e');var _0x2be969=_0x107a0d[_0xa05e('0x20')];var _0x3e341e=_0x428e54?0x0:_0x3097e6[_0xa05e('0x1d')];var _0x500b78=_0x428e54?_0x107a0d[_0xa05e('0x20')]:_0x3097e6[_0xa05e('0x1d')]+_0x3097e6[_0xa05e('0x1f')];var _0x26f6ed;if(_0x500b78>=_0x2be969){_0x500b78=_0x2be969;_0x26f6ed=0xc8;}else{_0x26f6ed=0xce;}_0x4925cf['status'](_0x26f6ed);return _0x4925cf[_0xa05e('0x21')](_0xa05e('0x22'),_0x3e341e+'-'+_0x500b78+'/'+_0x2be969)[_0xa05e('0x1c')](_0x107a0d);}return null;};}function patchUpdates(_0x22e9a9){return function(_0xec1590){try{jsonpatch[_0xa05e('0x23')](_0xec1590,_0x22e9a9,!![]);}catch(_0x236d56){return BPromise[_0xa05e('0x24')](_0x236d56);}return _0xec1590[_0xa05e('0x25')]();};}function saveUpdates(_0x13d00a,_0x544c0a){return function(_0x1adf76){if(_0x1adf76){return _0x1adf76['update'](_0x13d00a)['then'](function(_0x1a9624){return _0x1a9624;});}return null;};}function removeEntity(_0x47c7b4,_0x45fa63){return function(_0x448fbc){if(_0x448fbc){return _0x448fbc[_0xa05e('0x26')]()['then'](function(){_0x47c7b4[_0xa05e('0x1a')](0xcc)[_0xa05e('0x1b')]();});}};}function handleEntityNotFound(_0x4c6cf0,_0x40c998){return function(_0x32b051){if(!_0x32b051){_0x4c6cf0['sendStatus'](0x194);}return _0x32b051;};}function handleError(_0x1601cb,_0xd2849b){_0xd2849b=_0xd2849b||0x1f4;return function(_0x49f32f){logger[_0xa05e('0x27')](_0x49f32f[_0xa05e('0x28')]);if(_0x49f32f['name']){delete _0x49f32f[_0xa05e('0x29')];}_0x1601cb[_0xa05e('0x1a')](_0xd2849b)['send'](_0x49f32f);};}exports[_0xa05e('0x2a')]=function(_0x289faf,_0x5b2fe2){var _0x26985b={},_0x290be2={},_0x5aba8b={'count':0x0,'rows':[]};var _0x592fd2=_[_0xa05e('0x2b')](db[_0xa05e('0x2c')]['rawAttributes'],function(_0x35c20c){return{'name':_0x35c20c[_0xa05e('0x2d')],'type':_0x35c20c[_0xa05e('0x2e')][_0xa05e('0x2f')]};});_0x290be2['model']=_[_0xa05e('0x2b')](_0x592fd2,_0xa05e('0x29'));_0x290be2['query']=_['keys'](_0x289faf[_0xa05e('0x30')]);_0x290be2[_0xa05e('0x31')]=_['intersection'](_0x290be2['model'],_0x290be2[_0xa05e('0x30')]);_0x26985b[_0xa05e('0x32')]=_[_0xa05e('0x33')](_0x290be2[_0xa05e('0x34')],qs[_0xa05e('0x35')](_0x289faf['query'][_0xa05e('0x35')]));_0x26985b[_0xa05e('0x32')]=_0x26985b[_0xa05e('0x32')][_0xa05e('0x36')]?_0x26985b['attributes']:_0x290be2[_0xa05e('0x34')];if(!_0x289faf[_0xa05e('0x30')]['hasOwnProperty'](_0xa05e('0x37'))){_0x26985b[_0xa05e('0x1f')]=qs['limit'](_0x289faf[_0xa05e('0x30')][_0xa05e('0x1f')]);_0x26985b[_0xa05e('0x1d')]=qs[_0xa05e('0x1d')](_0x289faf['query'][_0xa05e('0x1d')]);}_0x26985b[_0xa05e('0x38')]=qs[_0xa05e('0x39')](_0x289faf[_0xa05e('0x30')][_0xa05e('0x39')]);_0x26985b[_0xa05e('0x3a')]=qs[_0xa05e('0x31')](_[_0xa05e('0x3b')](_0x289faf[_0xa05e('0x30')],_0x290be2[_0xa05e('0x31')]),_0x592fd2);if(_0x289faf['query'][_0xa05e('0x3c')]){_0x26985b[_0xa05e('0x3a')]=_[_0xa05e('0x3d')](_0x26985b[_0xa05e('0x3a')],{'$or':_[_0xa05e('0x2b')](_0x592fd2,function(_0x514960){if(_0x514960['type']!==_0xa05e('0x3e')){var _0x15e88c={};_0x15e88c[_0x514960['name']]={'$like':'%'+_0x289faf[_0xa05e('0x30')][_0xa05e('0x3c')]+'%'};return _0x15e88c;}})});}_0x26985b=_[_0xa05e('0x3d')]({},_0x26985b,_0x289faf[_0xa05e('0x3f')]);var _0x78d04e={'where':_0x26985b[_0xa05e('0x3a')]};return db['ZohoField']['count'](_0x78d04e)[_0xa05e('0x40')](function(_0xf68b40){_0x5aba8b[_0xa05e('0x20')]=_0xf68b40;if(_0x289faf[_0xa05e('0x30')][_0xa05e('0x41')]){_0x26985b[_0xa05e('0x42')]=[{'all':!![]}];}return db['ZohoField'][_0xa05e('0x43')](_0x26985b);})[_0xa05e('0x40')](function(_0x34be5d){_0x5aba8b[_0xa05e('0x44')]=_0x34be5d;return _0x5aba8b;})[_0xa05e('0x40')](respondWithFilteredResult(_0x5b2fe2,_0x26985b))[_0xa05e('0x45')](handleError(_0x5b2fe2,null));};exports[_0xa05e('0x46')]=function(_0x2a0c1c,_0x58a7c5){var _0x259f52={'raw':!![],'where':{'id':_0x2a0c1c['params']['id']}},_0x5b0436={};_0x5b0436[_0xa05e('0x34')]=_[_0xa05e('0x47')](db[_0xa05e('0x2c')][_0xa05e('0x48')]);_0x5b0436[_0xa05e('0x30')]=_[_0xa05e('0x47')](_0x2a0c1c[_0xa05e('0x30')]);_0x5b0436[_0xa05e('0x31')]=_['intersection'](_0x5b0436[_0xa05e('0x34')],_0x5b0436[_0xa05e('0x30')]);_0x259f52[_0xa05e('0x32')]=_['intersection'](_0x5b0436[_0xa05e('0x34')],qs[_0xa05e('0x35')](_0x2a0c1c['query']['fields']));_0x259f52[_0xa05e('0x32')]=_0x259f52['attributes'][_0xa05e('0x36')]?_0x259f52['attributes']:_0x5b0436[_0xa05e('0x34')];if(_0x2a0c1c[_0xa05e('0x30')]['includeAll']){_0x259f52[_0xa05e('0x42')]=[{'all':!![]}];}_0x259f52=_[_0xa05e('0x3d')]({},_0x259f52,_0x2a0c1c[_0xa05e('0x3f')]);return db['ZohoField'][_0xa05e('0x49')](_0x259f52)['then'](handleEntityNotFound(_0x58a7c5,null))[_0xa05e('0x40')](respondWithResult(_0x58a7c5,null))[_0xa05e('0x45')](handleError(_0x58a7c5,null));};exports[_0xa05e('0x4a')]=function(_0x44b3d8,_0x19f142){return db[_0xa05e('0x2c')]['create'](_0x44b3d8['body'],{})[_0xa05e('0x40')](respondWithResult(_0x19f142,0xc9))[_0xa05e('0x45')](handleError(_0x19f142,null));};exports[_0xa05e('0x4b')]=function(_0x15a689,_0x1c7c17){if(_0x15a689[_0xa05e('0x4c')]['id']){delete _0x15a689[_0xa05e('0x4c')]['id'];}return db['ZohoField'][_0xa05e('0x49')]({'where':{'id':_0x15a689[_0xa05e('0x4d')]['id']}})[_0xa05e('0x40')](handleEntityNotFound(_0x1c7c17,null))[_0xa05e('0x40')](saveUpdates(_0x15a689[_0xa05e('0x4c')],null))[_0xa05e('0x40')](respondWithResult(_0x1c7c17,null))[_0xa05e('0x45')](handleError(_0x1c7c17,null));};exports[_0xa05e('0x26')]=function(_0x455ca5,_0x4d71bc){return db[_0xa05e('0x2c')][_0xa05e('0x49')]({'where':{'id':_0x455ca5[_0xa05e('0x4d')]['id']}})[_0xa05e('0x40')](handleEntityNotFound(_0x4d71bc,null))['then'](removeEntity(_0x4d71bc,null))[_0xa05e('0x45')](handleError(_0x4d71bc,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 75ca9c2..658e463 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 _0xd046=['util','../../config/logger','api','bluebird','rimraf','./intZohoField.attributes','define','zoho_unique_index','idField'];(function(_0x27c43,_0x4928a1){var _0xa5d68=function(_0x3f23ba){while(--_0x3f23ba){_0x27c43['push'](_0x27c43['shift']());}};_0xa5d68(++_0x4928a1);}(_0xd046,0x129));var _0x6d04=function(_0x4a5093,_0x321d0b){_0x4a5093=_0x4a5093-0x0;var _0x55652b=_0xd046[_0x4a5093];return _0x55652b;};'use strict';var _=require('lodash');var util=require(_0x6d04('0x0'));var logger=require(_0x6d04('0x1'))(_0x6d04('0x2'));var moment=require('moment');var BPromise=require(_0x6d04('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6d04('0x4'));var config=require('../../config/environment');var attributes=require(_0x6d04('0x5'));module['exports']=function(_0x4bacb1,_0xf3b4e7){return _0x4bacb1[_0x6d04('0x6')]('ZohoField',attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':_0x6d04('0x7'),'fields':[_0x6d04('0x8'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0120=['rimraf','../../config/environment','./intZohoField.attributes','exports','ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0xb949a9,_0x2f948a){var _0x31932b=function(_0x1e7414){while(--_0x1e7414){_0xb949a9['push'](_0xb949a9['shift']());}};_0x31932b(++_0x2f948a);}(_0x0120,0x6f));var _0x0012=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x0120[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x0012('0x0'));var util=require(_0x0012('0x1'));var logger=require(_0x0012('0x2'))(_0x0012('0x3'));var moment=require(_0x0012('0x4'));var BPromise=require(_0x0012('0x5'));var rp=require(_0x0012('0x6'));var fs=require('fs');var path=require(_0x0012('0x7'));var rimraf=require(_0x0012('0x8'));var config=require(_0x0012('0x9'));var attributes=require(_0x0012('0xa'));module[_0x0012('0xb')]=function(_0x4eaa5b,_0x4b396c){return _0x4eaa5b['define'](_0x0012('0xc'),attributes,{'tableName':_0x0012('0xd'),'paranoid':![],'indexes':[{'name':_0x0012('0xe'),'fields':[_0x0012('0xf'),_0x0012('0x10')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.rpc.js b/server/api/intZohoField/intZohoField.rpc.js index 8539dfa..fb08530 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 _0x60dc=['error','code','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','ZohoField,\x20%s,\x20%s','request\x20sent','ZohoField,\x20%s,\x20%s,\x20%s'];(function(_0x283952,_0x442596){var _0x57bb99=function(_0x5cd9b6){while(--_0x5cd9b6){_0x283952['push'](_0x283952['shift']());}};_0x57bb99(++_0x442596);}(_0x60dc,0xec));var _0xc60d=function(_0x402bf7,_0xaace6e){_0x402bf7=_0x402bf7-0x0;var _0x57a60b=_0x60dc[_0x402bf7];return _0x57a60b;};'use strict';var _=require('lodash');var util=require(_0xc60d('0x0'));var moment=require(_0xc60d('0x1'));var BPromise=require('bluebird');var rs=require(_0xc60d('0x2'));var fs=require('fs');var Redis=require(_0xc60d('0x3'));var db=require(_0xc60d('0x4'))['db'];var utils=require(_0xc60d('0x5'));var logger=require(_0xc60d('0x6'))(_0xc60d('0x7'));var config=require(_0xc60d('0x8'));var jayson=require(_0xc60d('0x9'));var client=jayson[_0xc60d('0xa')][_0xc60d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x117bb5,_0x31fce9,_0x4d4adf){return new BPromise(function(_0x27654a,_0x33368f){return client['request'](_0x117bb5,_0x4d4adf)['then'](function(_0x595d51){logger[_0xc60d('0xc')](_0xc60d('0xd'),_0x31fce9,_0xc60d('0xe'));logger['debug'](_0xc60d('0xf'),_0x31fce9,_0xc60d('0xe'),JSON['stringify'](_0x595d51));if(_0x595d51[_0xc60d('0x10')]){if(_0x595d51[_0xc60d('0x10')][_0xc60d('0x11')]===0x1f4){logger['error'](_0xc60d('0xd'),_0x31fce9,_0x595d51[_0xc60d('0x10')][_0xc60d('0x12')]);return _0x33368f(_0x595d51[_0xc60d('0x10')][_0xc60d('0x12')]);}logger[_0xc60d('0x10')](_0xc60d('0xd'),_0x31fce9,_0x595d51['error']['message']);return _0x27654a(_0x595d51[_0xc60d('0x10')][_0xc60d('0x12')]);}else{logger[_0xc60d('0xc')](_0xc60d('0xd'),_0x31fce9,_0xc60d('0xe'));_0x27654a(_0x595d51[_0xc60d('0x13')]['message']);}})[_0xc60d('0x14')](function(_0x30ebfa){logger[_0xc60d('0x10')]('ZohoField,\x20%s,\x20%s',_0x31fce9,_0x30ebfa);_0x33368f(_0x30ebfa);});});} \ No newline at end of file +var _0x7749=['message','catch','lodash','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ZohoField,\x20%s,\x20%s','debug','ZohoField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0xefc148,_0x115db0){var _0x442f0a=function(_0x13e774){while(--_0x13e774){_0xefc148['push'](_0xefc148['shift']());}};_0x442f0a(++_0x115db0);}(_0x7749,0x17e));var _0x9774=function(_0xf9dca1,_0x324d98){_0xf9dca1=_0xf9dca1-0x0;var _0x518bbc=_0x7749[_0xf9dca1];return _0x518bbc;};'use strict';var _=require(_0x9774('0x0'));var util=require('util');var moment=require(_0x9774('0x1'));var BPromise=require(_0x9774('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9774('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9774('0x4'))(_0x9774('0x5'));var config=require(_0x9774('0x6'));var jayson=require(_0x9774('0x7'));var client=jayson[_0x9774('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x43dd11,_0x34de9a,_0x140810){return new BPromise(function(_0x355f41,_0x322f0a){return client[_0x9774('0x9')](_0x43dd11,_0x140810)[_0x9774('0xa')](function(_0x58e2f6){logger[_0x9774('0xb')](_0x9774('0xc'),_0x34de9a,'request\x20sent');logger[_0x9774('0xd')](_0x9774('0xe'),_0x34de9a,_0x9774('0xf'),JSON['stringify'](_0x58e2f6));if(_0x58e2f6['error']){if(_0x58e2f6[_0x9774('0x10')][_0x9774('0x11')]===0x1f4){logger[_0x9774('0x10')](_0x9774('0xc'),_0x34de9a,_0x58e2f6['error'][_0x9774('0x12')]);return _0x322f0a(_0x58e2f6[_0x9774('0x10')][_0x9774('0x12')]);}logger[_0x9774('0x10')](_0x9774('0xc'),_0x34de9a,_0x58e2f6['error'][_0x9774('0x12')]);return _0x355f41(_0x58e2f6[_0x9774('0x10')][_0x9774('0x12')]);}else{logger['info'](_0x9774('0xc'),_0x34de9a,_0x9774('0xf'));_0x355f41(_0x58e2f6['result'][_0x9774('0x12')]);}})[_0x9774('0x13')](function(_0x53fc21){logger['error']('ZohoField,\x20%s,\x20%s',_0x34de9a,_0x53fc21);_0x322f0a(_0x53fc21);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index c19ac4a..a92bc64 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x5a8e19,_0x5d2520){var _0x355277=function(_0x3e1c74){while(--_0x3e1c74){_0x5a8e19['push'](_0x5a8e19['shift']());}};_0x355277(++_0x5d2520);}(_0x70e0,0x17b));var _0x070e=function(_0x1e4a72,_0x246a4f){_0x1e4a72=_0x1e4a72-0x0;var _0x408673=_0x70e0[_0x1e4a72];return _0x408673;};'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(_0x1a33ad,_0x218bbe){var _0x5b6734=function(_0x3c22ee){while(--_0x3c22ee){_0x1a33ad['push'](_0x1a33ad['shift']());}};_0x5b6734(++_0x218bbe);}(_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/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 467a609..f84ffa7 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 _0x90b2=['BOOLEAN','state','sequelize','STRING','unique_name_and_version','INTEGER'];(function(_0x3a762b,_0x139726){var _0x47f8fc=function(_0x3c6e8a){while(--_0x3c6e8a){_0x3a762b['push'](_0x3a762b['shift']());}};_0x47f8fc(++_0x139726);}(_0x90b2,0x14c));var _0x290b=function(_0x4fe35d,_0x21fee1){_0x4fe35d=_0x4fe35d-0x0;var _0x5bb28e=_0x90b2[_0x4fe35d];return _0x5bb28e;};'use strict';var Sequelize=require(_0x290b('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0x290b('0x1')],'allowNull':![],'unique':_0x290b('0x2')},'main':{'type':Sequelize[_0x290b('0x1')],'defaultValue':'app.js'},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize[_0x290b('0x1')]},'type':{'type':Sequelize[_0x290b('0x1')]},'size':{'type':Sequelize[_0x290b('0x3')]},'active':{'type':Sequelize[_0x290b('0x4')],'defaultValue':![]},'author':{'type':Sequelize[_0x290b('0x1')]},'logo':{'type':Sequelize[_0x290b('0x1')]},'state':{'type':Sequelize['STRING'],'unique':_0x290b('0x5')},'description':{'type':Sequelize[_0x290b('0x1')]},'title':{'type':Sequelize[_0x290b('0x1')]},'remoteUri':{'type':Sequelize[_0x290b('0x1')]},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}}; \ No newline at end of file +var _0x051f=['STRING','unique_name_and_version','INTEGER','exports'];(function(_0x57d370,_0x3ed0f6){var _0x550fd2=function(_0x59634f){while(--_0x59634f){_0x57d370['push'](_0x57d370['shift']());}};_0x550fd2(++_0x3ed0f6);}(_0x051f,0x177));var _0xf051=function(_0x582f51,_0x2bf3e7){_0x582f51=_0x582f51-0x0;var _0x5130eb=_0x051f[_0x582f51];return _0x5130eb;};'use strict';var Sequelize=require('sequelize');module[_0xf051('0x0')]={'name':{'type':Sequelize[_0xf051('0x1')],'allowNull':![],'unique':_0xf051('0x2')},'version':{'type':Sequelize[_0xf051('0x1')],'allowNull':![],'unique':_0xf051('0x2')},'main':{'type':Sequelize[_0xf051('0x1')],'defaultValue':'app.js'},'filename':{'type':Sequelize[_0xf051('0x1')]},'path':{'type':Sequelize[_0xf051('0x1')]},'type':{'type':Sequelize[_0xf051('0x1')]},'size':{'type':Sequelize[_0xf051('0x3')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize[_0xf051('0x1')]},'logo':{'type':Sequelize[_0xf051('0x1')]},'state':{'type':Sequelize[_0xf051('0x1')],'unique':'state'},'description':{'type':Sequelize[_0xf051('0x1')]},'title':{'type':Sequelize[_0xf051('0x1')]},'remoteUri':{'type':Sequelize[_0xf051('0x1')]},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index aaabdbc..da578b1 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 _0xd943=['mustache','util','path','ejs','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','end','error','stack','name','send','index','Integration','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','map','merge','includeAll','include','findAll','catch','show','params','options','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird'];(function(_0x302e2c,_0x1fdfc3){var _0x19a45d=function(_0x4482f5){while(--_0x4482f5){_0x302e2c['push'](_0x302e2c['shift']());}};_0x19a45d(++_0x1fdfc3);}(_0xd943,0x15d));var _0x3d94=function(_0x588f67,_0xaa4ee5){_0x588f67=_0x588f67-0x0;var _0x3dc24b=_0xd943[_0x588f67];return _0x3dc24b;};'use strict';var emlformat=require(_0x3d94('0x0'));var rimraf=require(_0x3d94('0x1'));var zipdir=require(_0x3d94('0x2'));var jsonpatch=require(_0x3d94('0x3'));var rp=require('request-promise');var moment=require(_0x3d94('0x4'));var BPromise=require(_0x3d94('0x5'));var Mustache=require(_0x3d94('0x6'));var util=require(_0x3d94('0x7'));var path=require(_0x3d94('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3d94('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x3d94('0xa'));var jsforce=require(_0x3d94('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3d94('0xc'));var Papa=require(_0x3d94('0xd'));var Redis=require(_0x3d94('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x3d94('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3d94('0x10'));var logger=require(_0x3d94('0x11'))('api');var utils=require(_0x3d94('0x12'));var config=require(_0x3d94('0x13'));var licenseUtil=require(_0x3d94('0x14'));var db=require(_0x3d94('0x15'))['db'];function respondWithStatusCode(_0x15a392,_0x548b89){_0x548b89=_0x548b89||0xcc;return function(_0x96c54b){if(_0x96c54b){return _0x15a392[_0x3d94('0x16')](_0x548b89);}return _0x15a392[_0x3d94('0x17')](_0x548b89)['end']();};}function respondWithResult(_0x24e8b9,_0x29608d){_0x29608d=_0x29608d||0xc8;return function(_0x7d6969){if(_0x7d6969){return _0x24e8b9['status'](_0x29608d)[_0x3d94('0x18')](_0x7d6969);}};}function respondWithFilteredResult(_0x340818,_0x292419){return function(_0x34098e){if(_0x34098e){var _0xaf939a=typeof _0x292419[_0x3d94('0x19')]===_0x3d94('0x1a')&&typeof _0x292419[_0x3d94('0x1b')]==='undefined';var _0x22676a=_0x34098e[_0x3d94('0x1c')];var _0x2acee3=_0xaf939a?0x0:_0x292419[_0x3d94('0x19')];var _0x4afc92=_0xaf939a?_0x34098e[_0x3d94('0x1c')]:_0x292419[_0x3d94('0x19')]+_0x292419['limit'];var _0x9bca24;if(_0x4afc92>=_0x22676a){_0x4afc92=_0x22676a;_0x9bca24=0xc8;}else{_0x9bca24=0xce;}_0x340818['status'](_0x9bca24);return _0x340818[_0x3d94('0x1d')](_0x3d94('0x1e'),_0x2acee3+'-'+_0x4afc92+'/'+_0x22676a)[_0x3d94('0x18')](_0x34098e);}return null;};}function patchUpdates(_0x1e9ec2){return function(_0x35a3cc){try{jsonpatch['apply'](_0x35a3cc,_0x1e9ec2,!![]);}catch(_0x578002){return BPromise[_0x3d94('0x1f')](_0x578002);}return _0x35a3cc[_0x3d94('0x20')]();};}function saveUpdates(_0x9c2f2c,_0x4edee4){return function(_0x30af25){if(_0x30af25){return _0x30af25[_0x3d94('0x21')](_0x9c2f2c)[_0x3d94('0x22')](function(_0x384f76){return _0x384f76;});}return null;};}function removeEntity(_0x395133,_0x4093a4){return function(_0x295493){if(_0x295493){return _0x295493[_0x3d94('0x23')]()[_0x3d94('0x22')](function(){_0x395133[_0x3d94('0x17')](0xcc)[_0x3d94('0x24')]();});}};}function handleEntityNotFound(_0x192839,_0x292976){return function(_0x3496c3){if(!_0x3496c3){_0x192839[_0x3d94('0x16')](0x194);}return _0x3496c3;};}function handleError(_0x5b3b31,_0x123183){_0x123183=_0x123183||0x1f4;return function(_0x558fd2){logger[_0x3d94('0x25')](_0x558fd2[_0x3d94('0x26')]);if(_0x558fd2[_0x3d94('0x27')]){delete _0x558fd2[_0x3d94('0x27')];}_0x5b3b31[_0x3d94('0x17')](_0x123183)[_0x3d94('0x28')](_0x558fd2);};}exports[_0x3d94('0x29')]=function(_0x47d6ab,_0x584c4a){var _0x362642={},_0x4813e1={},_0x4dd410={'count':0x0,'rows':[]};var _0x23d20d=_['map'](db[_0x3d94('0x2a')][_0x3d94('0x2b')],function(_0x32403a){return{'name':_0x32403a['fieldName'],'type':_0x32403a[_0x3d94('0x2c')]['key']};});_0x4813e1[_0x3d94('0x2d')]=_['map'](_0x23d20d,_0x3d94('0x27'));_0x4813e1[_0x3d94('0x2e')]=_[_0x3d94('0x2f')](_0x47d6ab[_0x3d94('0x2e')]);_0x4813e1['filters']=_[_0x3d94('0x30')](_0x4813e1['model'],_0x4813e1[_0x3d94('0x2e')]);_0x362642[_0x3d94('0x31')]=_['intersection'](_0x4813e1['model'],qs[_0x3d94('0x32')](_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x32')]));_0x362642['attributes']=_0x362642[_0x3d94('0x31')][_0x3d94('0x33')]?_0x362642['attributes']:_0x4813e1[_0x3d94('0x2d')];if(!_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x34')](_0x3d94('0x35'))){_0x362642[_0x3d94('0x1b')]=qs['limit'](_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x1b')]);_0x362642[_0x3d94('0x19')]=qs[_0x3d94('0x19')](_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x19')]);}_0x362642['order']=qs['sort'](_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x36')]);_0x362642[_0x3d94('0x37')]=qs[_0x3d94('0x38')](_[_0x3d94('0x39')](_0x47d6ab[_0x3d94('0x2e')],_0x4813e1[_0x3d94('0x38')]),_0x23d20d);if(_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x3a')]){_0x362642[_0x3d94('0x37')]=_['merge'](_0x362642[_0x3d94('0x37')],{'$or':_[_0x3d94('0x3b')](_0x23d20d,function(_0x361fbb){if(_0x361fbb[_0x3d94('0x2c')]!=='VIRTUAL'){var _0xcf7a73={};_0xcf7a73[_0x361fbb[_0x3d94('0x27')]]={'$like':'%'+_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x3a')]+'%'};return _0xcf7a73;}})});}_0x362642=_[_0x3d94('0x3c')]({},_0x362642,_0x47d6ab['options']);var _0x217e5e={'where':_0x362642[_0x3d94('0x37')]};return db[_0x3d94('0x2a')]['count'](_0x217e5e)['then'](function(_0x4d8a8f){_0x4dd410['count']=_0x4d8a8f;if(_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x3d')]){_0x362642[_0x3d94('0x3e')]=[{'all':!![]}];}return db[_0x3d94('0x2a')][_0x3d94('0x3f')](_0x362642);})[_0x3d94('0x22')](function(_0x3a3898){_0x4dd410['rows']=_0x3a3898;return _0x4dd410;})['then'](respondWithFilteredResult(_0x584c4a,_0x362642))[_0x3d94('0x40')](handleError(_0x584c4a,null));};exports[_0x3d94('0x41')]=function(_0x512cef,_0x2d0aa2){var _0x4af4b6={'raw':![],'where':{'id':_0x512cef[_0x3d94('0x42')]['id']}},_0x1361fb={};_0x1361fb[_0x3d94('0x2d')]=_[_0x3d94('0x2f')](db[_0x3d94('0x2a')]['rawAttributes']);_0x1361fb[_0x3d94('0x2e')]=_[_0x3d94('0x2f')](_0x512cef[_0x3d94('0x2e')]);_0x1361fb['filters']=_[_0x3d94('0x30')](_0x1361fb['model'],_0x1361fb['query']);_0x4af4b6[_0x3d94('0x31')]=_[_0x3d94('0x30')](_0x1361fb[_0x3d94('0x2d')],qs[_0x3d94('0x32')](_0x512cef['query'][_0x3d94('0x32')]));_0x4af4b6['attributes']=_0x4af4b6[_0x3d94('0x31')][_0x3d94('0x33')]?_0x4af4b6[_0x3d94('0x31')]:_0x1361fb[_0x3d94('0x2d')];if(_0x512cef[_0x3d94('0x2e')][_0x3d94('0x3d')]){_0x4af4b6[_0x3d94('0x3e')]=[{'all':!![]}];}_0x4af4b6=_['merge']({},_0x4af4b6,_0x512cef[_0x3d94('0x43')]);return db[_0x3d94('0x2a')]['find'](_0x4af4b6)['then'](handleEntityNotFound(_0x2d0aa2,null))[_0x3d94('0x22')](respondWithResult(_0x2d0aa2,null))[_0x3d94('0x40')](handleError(_0x2d0aa2,null));};exports['create']=function(_0x3c8571,_0x13fda9){return db[_0x3d94('0x2a')][_0x3d94('0x44')](_0x3c8571[_0x3d94('0x45')],{})[_0x3d94('0x22')](respondWithResult(_0x13fda9,0xc9))[_0x3d94('0x40')](handleError(_0x13fda9,null));};exports[_0x3d94('0x21')]=function(_0x60279f,_0x2429bc){if(_0x60279f[_0x3d94('0x45')]['id']){delete _0x60279f[_0x3d94('0x45')]['id'];}return db[_0x3d94('0x2a')][_0x3d94('0x46')]({'where':{'id':_0x60279f[_0x3d94('0x42')]['id']}})['then'](handleEntityNotFound(_0x2429bc,null))[_0x3d94('0x22')](saveUpdates(_0x60279f[_0x3d94('0x45')],null))[_0x3d94('0x22')](respondWithResult(_0x2429bc,null))[_0x3d94('0x40')](handleError(_0x2429bc,null));};exports[_0x3d94('0x23')]=function(_0x3ce0be,_0x129783){return db[_0x3d94('0x2a')][_0x3d94('0x46')]({'where':{'id':_0x3ce0be['params']['id']}})[_0x3d94('0x22')](handleEntityNotFound(_0x129783,null))['then'](removeEntity(_0x129783,null))[_0x3d94('0x40')](handleError(_0x129783,null));}; \ No newline at end of file +var _0x53ec=['count','set','Content-Range','apply','reject','save','then','sendStatus','name','send','map','Integration','rawAttributes','fieldName','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','rows','show','params','include','find','catch','create','update','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x53ec,0x192));var _0xc53e=function(_0x3c4274,_0x858023){_0x3c4274=_0x3c4274-0x0;var _0x36a214=_0x53ec[_0x3c4274];return _0x36a214;};'use strict';var emlformat=require(_0xc53e('0x0'));var rimraf=require(_0xc53e('0x1'));var zipdir=require(_0xc53e('0x2'));var jsonpatch=require(_0xc53e('0x3'));var rp=require(_0xc53e('0x4'));var moment=require(_0xc53e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc53e('0x6'));var util=require('util');var path=require(_0xc53e('0x7'));var sox=require(_0xc53e('0x8'));var csv=require('to-csv');var ejs=require(_0xc53e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc53e('0xa'));var squel=require(_0xc53e('0xb'));var crypto=require('crypto');var jsforce=require(_0xc53e('0xc'));var deskjs=require(_0xc53e('0xd'));var toCsv=require(_0xc53e('0xe'));var querystring=require(_0xc53e('0xf'));var Papa=require(_0xc53e('0x10'));var Redis=require(_0xc53e('0x11'));var authService=require(_0xc53e('0x12'));var qs=require(_0xc53e('0x13'));var as=require(_0xc53e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc53e('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc53e('0x16'));var db=require(_0xc53e('0x17'))['db'];function respondWithStatusCode(_0x863fa,_0x4203aa){_0x4203aa=_0x4203aa||0xcc;return function(_0x56f0e5){if(_0x56f0e5){return _0x863fa['sendStatus'](_0x4203aa);}return _0x863fa[_0xc53e('0x18')](_0x4203aa)[_0xc53e('0x19')]();};}function respondWithResult(_0x7cd798,_0x3d2e17){_0x3d2e17=_0x3d2e17||0xc8;return function(_0x358ef3){if(_0x358ef3){return _0x7cd798[_0xc53e('0x18')](_0x3d2e17)[_0xc53e('0x1a')](_0x358ef3);}};}function respondWithFilteredResult(_0x19c0d1,_0x455e4d){return function(_0x2ad6eb){if(_0x2ad6eb){var _0x5b0a88=typeof _0x455e4d[_0xc53e('0x1b')]===_0xc53e('0x1c')&&typeof _0x455e4d[_0xc53e('0x1d')]===_0xc53e('0x1c');var _0x15333b=_0x2ad6eb[_0xc53e('0x1e')];var _0x164016=_0x5b0a88?0x0:_0x455e4d[_0xc53e('0x1b')];var _0x3b550e=_0x5b0a88?_0x2ad6eb['count']:_0x455e4d['offset']+_0x455e4d[_0xc53e('0x1d')];var _0x2a5bac;if(_0x3b550e>=_0x15333b){_0x3b550e=_0x15333b;_0x2a5bac=0xc8;}else{_0x2a5bac=0xce;}_0x19c0d1[_0xc53e('0x18')](_0x2a5bac);return _0x19c0d1[_0xc53e('0x1f')](_0xc53e('0x20'),_0x164016+'-'+_0x3b550e+'/'+_0x15333b)[_0xc53e('0x1a')](_0x2ad6eb);}return null;};}function patchUpdates(_0x15a015){return function(_0x25702b){try{jsonpatch[_0xc53e('0x21')](_0x25702b,_0x15a015,!![]);}catch(_0x401af6){return BPromise[_0xc53e('0x22')](_0x401af6);}return _0x25702b[_0xc53e('0x23')]();};}function saveUpdates(_0x426467,_0x4fb695){return function(_0x47cfdd){if(_0x47cfdd){return _0x47cfdd['update'](_0x426467)[_0xc53e('0x24')](function(_0x384218){return _0x384218;});}return null;};}function removeEntity(_0x7591c1,_0x4015c8){return function(_0x180811){if(_0x180811){return _0x180811['destroy']()['then'](function(){_0x7591c1[_0xc53e('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ae55e,_0x3a5ce8){return function(_0x443179){if(!_0x443179){_0x1ae55e[_0xc53e('0x25')](0x194);}return _0x443179;};}function handleError(_0x63c5dc,_0x4df8cf){_0x4df8cf=_0x4df8cf||0x1f4;return function(_0x398e7a){logger['error'](_0x398e7a['stack']);if(_0x398e7a['name']){delete _0x398e7a[_0xc53e('0x26')];}_0x63c5dc['status'](_0x4df8cf)[_0xc53e('0x27')](_0x398e7a);};}exports['index']=function(_0x24a77e,_0x5112d2){var _0x5ce216={},_0x8f0ee6={},_0x6a62b0={'count':0x0,'rows':[]};var _0x42dec1=_[_0xc53e('0x28')](db[_0xc53e('0x29')][_0xc53e('0x2a')],function(_0x3280fe){return{'name':_0x3280fe[_0xc53e('0x2b')],'type':_0x3280fe['type'][_0xc53e('0x2c')]};});_0x8f0ee6[_0xc53e('0x2d')]=_[_0xc53e('0x28')](_0x42dec1,'name');_0x8f0ee6[_0xc53e('0x2e')]=_['keys'](_0x24a77e[_0xc53e('0x2e')]);_0x8f0ee6[_0xc53e('0x2f')]=_['intersection'](_0x8f0ee6['model'],_0x8f0ee6[_0xc53e('0x2e')]);_0x5ce216[_0xc53e('0x30')]=_[_0xc53e('0x31')](_0x8f0ee6[_0xc53e('0x2d')],qs[_0xc53e('0x32')](_0x24a77e[_0xc53e('0x2e')][_0xc53e('0x32')]));_0x5ce216[_0xc53e('0x30')]=_0x5ce216['attributes'][_0xc53e('0x33')]?_0x5ce216[_0xc53e('0x30')]:_0x8f0ee6[_0xc53e('0x2d')];if(!_0x24a77e[_0xc53e('0x2e')][_0xc53e('0x34')](_0xc53e('0x35'))){_0x5ce216[_0xc53e('0x1d')]=qs[_0xc53e('0x1d')](_0x24a77e[_0xc53e('0x2e')]['limit']);_0x5ce216[_0xc53e('0x1b')]=qs['offset'](_0x24a77e[_0xc53e('0x2e')][_0xc53e('0x1b')]);}_0x5ce216['order']=qs[_0xc53e('0x36')](_0x24a77e[_0xc53e('0x2e')][_0xc53e('0x36')]);_0x5ce216['where']=qs[_0xc53e('0x2f')](_[_0xc53e('0x37')](_0x24a77e[_0xc53e('0x2e')],_0x8f0ee6[_0xc53e('0x2f')]),_0x42dec1);if(_0x24a77e[_0xc53e('0x2e')][_0xc53e('0x38')]){_0x5ce216[_0xc53e('0x39')]=_['merge'](_0x5ce216[_0xc53e('0x39')],{'$or':_[_0xc53e('0x28')](_0x42dec1,function(_0x2db711){if(_0x2db711['type']!==_0xc53e('0x3a')){var _0x5e8ab7={};_0x5e8ab7[_0x2db711[_0xc53e('0x26')]]={'$like':'%'+_0x24a77e[_0xc53e('0x2e')][_0xc53e('0x38')]+'%'};return _0x5e8ab7;}})});}_0x5ce216=_[_0xc53e('0x3b')]({},_0x5ce216,_0x24a77e[_0xc53e('0x3c')]);var _0x5507d0={'where':_0x5ce216[_0xc53e('0x39')]};return db[_0xc53e('0x29')]['count'](_0x5507d0)['then'](function(_0x5e9e15){_0x6a62b0['count']=_0x5e9e15;if(_0x24a77e[_0xc53e('0x2e')][_0xc53e('0x3d')]){_0x5ce216['include']=[{'all':!![]}];}return db[_0xc53e('0x29')]['findAll'](_0x5ce216);})['then'](function(_0x53447e){_0x6a62b0[_0xc53e('0x3e')]=_0x53447e;return _0x6a62b0;})['then'](respondWithFilteredResult(_0x5112d2,_0x5ce216))['catch'](handleError(_0x5112d2,null));};exports[_0xc53e('0x3f')]=function(_0x53a82f,_0x422088){var _0x360af9={'raw':![],'where':{'id':_0x53a82f[_0xc53e('0x40')]['id']}},_0x49f204={};_0x49f204[_0xc53e('0x2d')]=_['keys'](db[_0xc53e('0x29')]['rawAttributes']);_0x49f204['query']=_['keys'](_0x53a82f['query']);_0x49f204[_0xc53e('0x2f')]=_[_0xc53e('0x31')](_0x49f204[_0xc53e('0x2d')],_0x49f204['query']);_0x360af9[_0xc53e('0x30')]=_[_0xc53e('0x31')](_0x49f204['model'],qs['fields'](_0x53a82f[_0xc53e('0x2e')][_0xc53e('0x32')]));_0x360af9[_0xc53e('0x30')]=_0x360af9['attributes'][_0xc53e('0x33')]?_0x360af9[_0xc53e('0x30')]:_0x49f204[_0xc53e('0x2d')];if(_0x53a82f[_0xc53e('0x2e')][_0xc53e('0x3d')]){_0x360af9[_0xc53e('0x41')]=[{'all':!![]}];}_0x360af9=_[_0xc53e('0x3b')]({},_0x360af9,_0x53a82f['options']);return db[_0xc53e('0x29')][_0xc53e('0x42')](_0x360af9)[_0xc53e('0x24')](handleEntityNotFound(_0x422088,null))['then'](respondWithResult(_0x422088,null))[_0xc53e('0x43')](handleError(_0x422088,null));};exports[_0xc53e('0x44')]=function(_0x4458c8,_0x15e744){return db[_0xc53e('0x29')][_0xc53e('0x44')](_0x4458c8['body'],{})[_0xc53e('0x24')](respondWithResult(_0x15e744,0xc9))[_0xc53e('0x43')](handleError(_0x15e744,null));};exports[_0xc53e('0x45')]=function(_0x5a6e41,_0x33d45c){if(_0x5a6e41[_0xc53e('0x46')]['id']){delete _0x5a6e41[_0xc53e('0x46')]['id'];}return db[_0xc53e('0x29')][_0xc53e('0x42')]({'where':{'id':_0x5a6e41[_0xc53e('0x40')]['id']}})[_0xc53e('0x24')](handleEntityNotFound(_0x33d45c,null))[_0xc53e('0x24')](saveUpdates(_0x5a6e41[_0xc53e('0x46')],null))[_0xc53e('0x24')](respondWithResult(_0x33d45c,null))['catch'](handleError(_0x33d45c,null));};exports[_0xc53e('0x47')]=function(_0x17cf13,_0x38520c){return db[_0xc53e('0x29')][_0xc53e('0x42')]({'where':{'id':_0x17cf13['params']['id']}})['then'](handleEntityNotFound(_0x38520c,null))[_0xc53e('0x24')](removeEntity(_0x38520c,null))['catch'](handleError(_0x38520c,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 81aa304..a850e65 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 _0xa537=['integrations','lodash','../../config/logger','api','moment','bluebird','path','../../config/environment','./integration.attributes','exports','define','Integration'];(function(_0x3a04ab,_0x31b9fd){var _0x4bff6d=function(_0x125f7e){while(--_0x125f7e){_0x3a04ab['push'](_0x3a04ab['shift']());}};_0x4bff6d(++_0x31b9fd);}(_0xa537,0x1d5));var _0x7a53=function(_0x5caf0b,_0x1f14c6){_0x5caf0b=_0x5caf0b-0x0;var _0x12b542=_0xa537[_0x5caf0b];return _0x12b542;};'use strict';var _=require(_0x7a53('0x0'));var util=require('util');var logger=require(_0x7a53('0x1'))(_0x7a53('0x2'));var moment=require(_0x7a53('0x3'));var BPromise=require(_0x7a53('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7a53('0x5'));var rimraf=require('rimraf');var config=require(_0x7a53('0x6'));var attributes=require(_0x7a53('0x7'));module[_0x7a53('0x8')]=function(_0x5c322d,_0x511837){return _0x5c322d[_0x7a53('0x9')](_0x7a53('0xa'),attributes,{'tableName':_0x7a53('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7e35=['./integration.attributes','define','Integration','integrations','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x478414,_0xcf142d){var _0x5eb6b9=function(_0x10e6fe){while(--_0x10e6fe){_0x478414['push'](_0x478414['shift']());}};_0x5eb6b9(++_0xcf142d);}(_0x7e35,0x1d8));var _0x57e3=function(_0x59cc31,_0x4d61e2){_0x59cc31=_0x59cc31-0x0;var _0x86bdc=_0x7e35[_0x59cc31];return _0x86bdc;};'use strict';var _=require('lodash');var util=require(_0x57e3('0x0'));var logger=require(_0x57e3('0x1'))(_0x57e3('0x2'));var moment=require(_0x57e3('0x3'));var BPromise=require(_0x57e3('0x4'));var rp=require(_0x57e3('0x5'));var fs=require('fs');var path=require(_0x57e3('0x6'));var rimraf=require(_0x57e3('0x7'));var config=require(_0x57e3('0x8'));var attributes=require(_0x57e3('0x9'));module['exports']=function(_0x5881b0,_0x4db615){return _0x5881b0[_0x57e3('0xa')](_0x57e3('0xb'),attributes,{'tableName':_0x57e3('0xc'),'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 09a3b02..e66dac3 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 _0x57ca=['client','http','request','info','request\x20sent','Integration,\x20%s,\x20%s,\x20%s','error','code','Integration,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x3915f4,_0x4ad379){var _0x3d46c0=function(_0x2a8d22){while(--_0x2a8d22){_0x3915f4['push'](_0x3915f4['shift']());}};_0x3d46c0(++_0x4ad379);}(_0x57ca,0x108));var _0xa57c=function(_0x5ee893,_0x260e68){_0x5ee893=_0x5ee893-0x0;var _0x79ab0e=_0x57ca[_0x5ee893];return _0x79ab0e;};'use strict';var _=require('lodash');var util=require(_0xa57c('0x0'));var moment=require(_0xa57c('0x1'));var BPromise=require('bluebird');var rs=require(_0xa57c('0x2'));var fs=require('fs');var Redis=require(_0xa57c('0x3'));var db=require(_0xa57c('0x4'))['db'];var utils=require(_0xa57c('0x5'));var logger=require(_0xa57c('0x6'))('rpc');var config=require(_0xa57c('0x7'));var jayson=require(_0xa57c('0x8'));var client=jayson[_0xa57c('0x9')][_0xa57c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xbdfffb,_0x314574,_0x19e28e){return new BPromise(function(_0x271ccc,_0x5e3962){return client[_0xa57c('0xb')](_0xbdfffb,_0x19e28e)['then'](function(_0x46ba92){logger[_0xa57c('0xc')]('Integration,\x20%s,\x20%s',_0x314574,_0xa57c('0xd'));logger['debug'](_0xa57c('0xe'),_0x314574,_0xa57c('0xd'),JSON['stringify'](_0x46ba92));if(_0x46ba92[_0xa57c('0xf')]){if(_0x46ba92['error'][_0xa57c('0x10')]===0x1f4){logger[_0xa57c('0xf')](_0xa57c('0x11'),_0x314574,_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);return _0x5e3962(_0x46ba92['error'][_0xa57c('0x12')]);}logger['error'](_0xa57c('0x11'),_0x314574,_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);return _0x271ccc(_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);}else{logger[_0xa57c('0xc')](_0xa57c('0x11'),_0x314574,'request\x20sent');_0x271ccc(_0x46ba92[_0xa57c('0x13')][_0xa57c('0x12')]);}})[_0xa57c('0x14')](function(_0x5a6024){logger[_0xa57c('0xf')]('Integration,\x20%s,\x20%s',_0x314574,_0x5a6024);_0x5e3962(_0x5a6024);});});} \ No newline at end of file +var _0xc2c7=['../../config/logger','jayson/promise','client','http','request','then','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0xc2c7,0x134));var _0x7c2c=function(_0x36a6de,_0x24cb9e){_0x36a6de=_0x36a6de-0x0;var _0x22ba02=_0xc2c7[_0x36a6de];return _0x22ba02;};'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')]('Integration,\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/integrationReport/index.js b/server/api/integrationReport/index.js index 64a3eab..f08aa77 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 _0xdb28=['destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','create','put','update'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0xdb28,0x106));var _0x8db2=function(_0x4a3929,_0x2a7cfa){_0x4a3929=_0x4a3929-0x0;var _0x14d0d8=_0xdb28[_0x4a3929];return _0x14d0d8;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./integrationReport.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post']('/',auth[_0x8db2('0xa')](),controller[_0x8db2('0xf')]);router[_0x8db2('0x10')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x11')]);router['delete'](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x12')]);module[_0x8db2('0x13')]=router; \ No newline at end of file +var _0x1967=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','update','delete','destroy','exports','util','path','connect-timeout'];(function(_0x11ba83,_0xd5611a){var _0x3f3925=function(_0x3d7cb0){while(--_0x3d7cb0){_0x11ba83['push'](_0x11ba83['shift']());}};_0x3f3925(++_0xd5611a);}(_0x1967,0x173));var _0x7196=function(_0x201495,_0x327960){_0x201495=_0x201495-0x0;var _0x1ce497=_0x1967[_0x201495];return _0x1ce497;};'use strict';var multer=require('multer');var util=require(_0x7196('0x0'));var path=require(_0x7196('0x1'));var timeout=require(_0x7196('0x2'));var express=require(_0x7196('0x3'));var router=express[_0x7196('0x4')]();var fs_extra=require(_0x7196('0x5'));var auth=require(_0x7196('0x6'));var interaction=require(_0x7196('0x7'));var config=require(_0x7196('0x8'));var controller=require(_0x7196('0x9'));router['get']('/',auth[_0x7196('0xa')](),controller[_0x7196('0xb')]);router[_0x7196('0xc')](_0x7196('0xd'),auth[_0x7196('0xa')](),controller[_0x7196('0xe')]);router['get'](_0x7196('0xf'),auth[_0x7196('0xa')](),controller[_0x7196('0x10')]);router[_0x7196('0x11')]('/',auth[_0x7196('0xa')](),controller['create']);router['put'](_0x7196('0xf'),auth[_0x7196('0xa')](),controller[_0x7196('0x12')]);router[_0x7196('0x13')](_0x7196('0xf'),auth[_0x7196('0xa')](),controller[_0x7196('0x14')]);module[_0x7196('0x15')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index c837407..a81dada 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 _0xd5c5=['SENDING','RECEIVED','FAILED','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT'];(function(_0x4fa7a3,_0x4514b7){var _0x207c87=function(_0xe59fb9){while(--_0xe59fb9){_0x4fa7a3['push'](_0x4fa7a3['shift']());}};_0x207c87(++_0x4514b7);}(_0xd5c5,0x1e7));var _0x5d5c=function(_0x349367,_0x1cede2){_0x349367=_0x349367-0x0;var _0x14179b=_0xd5c5[_0x349367];return _0x14179b;};'use strict';var Sequelize=require('sequelize');module[_0x5d5c('0x0')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize[_0x5d5c('0x1')]},'exitStatus':{'type':Sequelize[_0x5d5c('0x1')]},'ticketId':{'type':Sequelize[_0x5d5c('0x1')]},'integrationId':{'type':Sequelize[_0x5d5c('0x2')]},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x5d5c('0x1')]},'calleridnum':{'type':Sequelize[_0x5d5c('0x1')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x5d5c('0x1')]},'interface':{'type':Sequelize[_0x5d5c('0x1')]},'membername':{'type':Sequelize[_0x5d5c('0x1')]},'agentcalledAt':{'type':Sequelize[_0x5d5c('0x3')]},'agentconnectAt':{'type':Sequelize[_0x5d5c('0x3')]},'holdtime':{'type':Sequelize[_0x5d5c('0x2')]},'agentcomplete':{'type':Sequelize[_0x5d5c('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x5d5c('0x3')]},'talktime':{'type':Sequelize[_0x5d5c('0x2')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x5d5c('0x2')]},'reason':{'type':Sequelize[_0x5d5c('0x1')]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x5d5c('0x3')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0x5d5c('0x1')]},'channel':{'type':Sequelize[_0x5d5c('0x1')]},'channelstate':{'type':Sequelize[_0x5d5c('0x2')]},'channelstatedesc':{'type':Sequelize[_0x5d5c('0x1')]},'connectedlinenum':{'type':Sequelize[_0x5d5c('0x1')]},'connectedlinename':{'type':Sequelize[_0x5d5c('0x1')]},'language':{'type':Sequelize[_0x5d5c('0x1')]},'accountcode':{'type':Sequelize[_0x5d5c('0x1')]},'context':{'type':Sequelize[_0x5d5c('0x1')]},'exten':{'type':Sequelize[_0x5d5c('0x1')]},'priority':{'type':Sequelize[_0x5d5c('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x5d5c('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x5d5c('0x1')]},'destcalleridnum':{'type':Sequelize[_0x5d5c('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x5d5c('0x1')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x5d5c('0x1')]},'destuniqueid':{'type':Sequelize[_0x5d5c('0x1')]},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x5d5c('0x1')]},'subject':{'type':Sequelize[_0x5d5c('0x1')]},'from':{'type':Sequelize[_0x5d5c('0x1')]},'to':{'type':Sequelize[_0x5d5c('0x1')]},'cc':{'type':Sequelize[_0x5d5c('0x1')]},'attachment':{'type':Sequelize[_0x5d5c('0x5')]},'html':{'type':Sequelize[_0x5d5c('0x5')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0x5d5c('0x6')](_0x5d5c('0x7'),_0x5d5c('0x8'),_0x5d5c('0x9'),_0x5d5c('0xa'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0x5d5c('0x1')]},'appdata':{'type':Sequelize[_0x5d5c('0x1')]},'projectId':{'type':Sequelize[_0x5d5c('0x2')]}}; \ No newline at end of file +var _0x6d06=['ENUM','SENT','FAILED','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT'];(function(_0x163625,_0x24439c){var _0x6d181c=function(_0x57643d){while(--_0x57643d){_0x163625['push'](_0x163625['shift']());}};_0x6d181c(++_0x24439c);}(_0x6d06,0x111));var _0x66d0=function(_0x4c98b9,_0x1ad11b){_0x4c98b9=_0x4c98b9-0x0;var _0x3a257a=_0x6d06[_0x4c98b9];return _0x3a257a;};'use strict';var Sequelize=require('sequelize');module[_0x66d0('0x0')]={'integration':{'type':Sequelize[_0x66d0('0x1')]},'eventChannel':{'type':Sequelize[_0x66d0('0x1')]},'exitStatus':{'type':Sequelize[_0x66d0('0x1')]},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0x66d0('0x2')]},'contacts':{'type':Sequelize[_0x66d0('0x1')]},'uniqueid':{'type':Sequelize[_0x66d0('0x1')]},'calleridnum':{'type':Sequelize[_0x66d0('0x1')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x66d0('0x1')]},'interface':{'type':Sequelize[_0x66d0('0x1')]},'membername':{'type':Sequelize[_0x66d0('0x1')]},'agentcalledAt':{'type':Sequelize[_0x66d0('0x3')]},'agentconnectAt':{'type':Sequelize[_0x66d0('0x3')]},'holdtime':{'type':Sequelize[_0x66d0('0x2')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x66d0('0x3')]},'talktime':{'type':Sequelize[_0x66d0('0x2')]},'agentacw':{'type':Sequelize[_0x66d0('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x66d0('0x2')]},'reason':{'type':Sequelize[_0x66d0('0x1')]},'agentringnoanswer':{'type':Sequelize[_0x66d0('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x66d0('0x3')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x66d0('0x3')]},'lastevent':{'type':Sequelize[_0x66d0('0x1')]},'channel':{'type':Sequelize[_0x66d0('0x1')]},'channelstate':{'type':Sequelize[_0x66d0('0x2')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x66d0('0x1')]},'connectedlinename':{'type':Sequelize[_0x66d0('0x1')]},'language':{'type':Sequelize[_0x66d0('0x1')]},'accountcode':{'type':Sequelize[_0x66d0('0x1')]},'context':{'type':Sequelize[_0x66d0('0x1')]},'exten':{'type':Sequelize[_0x66d0('0x1')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x66d0('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x66d0('0x1')]},'destcalleridnum':{'type':Sequelize[_0x66d0('0x1')]},'destcalleridname':{'type':Sequelize[_0x66d0('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x66d0('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x66d0('0x1')]},'destlanguage':{'type':Sequelize[_0x66d0('0x1')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x66d0('0x1')]},'destpriority':{'type':Sequelize[_0x66d0('0x1')]},'destuniqueid':{'type':Sequelize[_0x66d0('0x1')]},'messageId':{'type':Sequelize[_0x66d0('0x1')]},'inReplyTo':{'type':Sequelize[_0x66d0('0x1')]},'subject':{'type':Sequelize[_0x66d0('0x1')]},'from':{'type':Sequelize[_0x66d0('0x1')]},'to':{'type':Sequelize[_0x66d0('0x1')]},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize[_0x66d0('0x5')]},'html':{'type':Sequelize[_0x66d0('0x5')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0x66d0('0x6')](_0x66d0('0x7'),'SENDING','RECEIVED',_0x66d0('0x8'))},'url':{'type':Sequelize[_0x66d0('0x1')]},'app':{'type':Sequelize[_0x66d0('0x1')]},'appdata':{'type':Sequelize[_0x66d0('0x1')]},'projectId':{'type':Sequelize[_0x66d0('0x2')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index bbcf3e4..ed1c4cf 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 _0x1014=['crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','save','then','sendStatus','error','stack','name','send','index','map','IntegrationReport','rawAttributes','fieldName','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','update','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x14ff54,_0xcd0dc6){var _0xb6e056=function(_0x136d45){while(--_0x136d45){_0x14ff54['push'](_0x14ff54['shift']());}};_0xb6e056(++_0xcd0dc6);}(_0x1014,0x11f));var _0x4101=function(_0x3b0209,_0x1048cd){_0x3b0209=_0x3b0209-0x0;var _0xf6c555=_0x1014[_0x3b0209];return _0xf6c555;};'use strict';var emlformat=require(_0x4101('0x0'));var rimraf=require(_0x4101('0x1'));var zipdir=require(_0x4101('0x2'));var jsonpatch=require(_0x4101('0x3'));var rp=require(_0x4101('0x4'));var moment=require(_0x4101('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4101('0x6'));var util=require(_0x4101('0x7'));var path=require('path');var sox=require(_0x4101('0x8'));var csv=require(_0x4101('0x9'));var ejs=require(_0x4101('0xa'));var fs=require('fs');var fs_extra=require(_0x4101('0xb'));var _=require(_0x4101('0xc'));var squel=require('squel');var crypto=require(_0x4101('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x4101('0xe'));var toCsv=require(_0x4101('0x9'));var querystring=require(_0x4101('0xf'));var Papa=require(_0x4101('0x10'));var Redis=require('ioredis');var authService=require(_0x4101('0x11'));var qs=require(_0x4101('0x12'));var as=require(_0x4101('0x13'));var hardwareService=require(_0x4101('0x14'));var logger=require('../../config/logger')(_0x4101('0x15'));var utils=require('../../config/utils');var config=require(_0x4101('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x4101('0x17'))['db'];function respondWithStatusCode(_0x508e9e,_0x8e2d1){_0x8e2d1=_0x8e2d1||0xcc;return function(_0xc8f84){if(_0xc8f84){return _0x508e9e['sendStatus'](_0x8e2d1);}return _0x508e9e[_0x4101('0x18')](_0x8e2d1)[_0x4101('0x19')]();};}function respondWithResult(_0x427b99,_0x184c7c){_0x184c7c=_0x184c7c||0xc8;return function(_0x20c6e0){if(_0x20c6e0){return _0x427b99[_0x4101('0x18')](_0x184c7c)[_0x4101('0x1a')](_0x20c6e0);}};}function respondWithFilteredResult(_0x5ddb06,_0x4235a9){return function(_0x46f804){if(_0x46f804){var _0xe9e6e4=typeof _0x4235a9[_0x4101('0x1b')]===_0x4101('0x1c')&&typeof _0x4235a9['limit']===_0x4101('0x1c');var _0x1249ee=_0x46f804['count'];var _0x452c7a=_0xe9e6e4?0x0:_0x4235a9['offset'];var _0x389038=_0xe9e6e4?_0x46f804[_0x4101('0x1d')]:_0x4235a9[_0x4101('0x1b')]+_0x4235a9[_0x4101('0x1e')];var _0x424835;if(_0x389038>=_0x1249ee){_0x389038=_0x1249ee;_0x424835=0xc8;}else{_0x424835=0xce;}_0x5ddb06[_0x4101('0x18')](_0x424835);return _0x5ddb06[_0x4101('0x1f')](_0x4101('0x20'),_0x452c7a+'-'+_0x389038+'/'+_0x1249ee)[_0x4101('0x1a')](_0x46f804);}return null;};}function patchUpdates(_0x41e7a1){return function(_0x204b8e){try{jsonpatch['apply'](_0x204b8e,_0x41e7a1,!![]);}catch(_0x3ec023){return BPromise['reject'](_0x3ec023);}return _0x204b8e[_0x4101('0x21')]();};}function saveUpdates(_0x36de05,_0x45c9e8){return function(_0x32ffc0){if(_0x32ffc0){return _0x32ffc0['update'](_0x36de05)[_0x4101('0x22')](function(_0x55d3ba){return _0x55d3ba;});}return null;};}function removeEntity(_0x519058,_0x212357){return function(_0x2d47bf){if(_0x2d47bf){return _0x2d47bf['destroy']()[_0x4101('0x22')](function(){_0x519058['status'](0xcc)[_0x4101('0x19')]();});}};}function handleEntityNotFound(_0x524dc2,_0x514851){return function(_0x1ebefa){if(!_0x1ebefa){_0x524dc2[_0x4101('0x23')](0x194);}return _0x1ebefa;};}function handleError(_0x55d1be,_0x48813a){_0x48813a=_0x48813a||0x1f4;return function(_0x4e528a){logger[_0x4101('0x24')](_0x4e528a[_0x4101('0x25')]);if(_0x4e528a[_0x4101('0x26')]){delete _0x4e528a['name'];}_0x55d1be[_0x4101('0x18')](_0x48813a)[_0x4101('0x27')](_0x4e528a);};}exports[_0x4101('0x28')]=function(_0x8b50a,_0x357790){var _0xa7cf3={},_0x4dff77={},_0x20d707={'count':0x0,'rows':[]};var _0x4901d6=_[_0x4101('0x29')](db[_0x4101('0x2a')][_0x4101('0x2b')],function(_0x41a0aa){return{'name':_0x41a0aa[_0x4101('0x2c')],'type':_0x41a0aa['type'][_0x4101('0x2d')]};});_0x4dff77['model']=_[_0x4101('0x29')](_0x4901d6,_0x4101('0x26'));_0x4dff77[_0x4101('0x2e')]=_[_0x4101('0x2f')](_0x8b50a[_0x4101('0x2e')]);_0x4dff77[_0x4101('0x30')]=_['intersection'](_0x4dff77[_0x4101('0x31')],_0x4dff77['query']);_0xa7cf3[_0x4101('0x32')]=_[_0x4101('0x33')](_0x4dff77[_0x4101('0x31')],qs[_0x4101('0x34')](_0x8b50a[_0x4101('0x2e')][_0x4101('0x34')]));_0xa7cf3['attributes']=_0xa7cf3[_0x4101('0x32')][_0x4101('0x35')]?_0xa7cf3[_0x4101('0x32')]:_0x4dff77['model'];if(!_0x8b50a[_0x4101('0x2e')][_0x4101('0x36')](_0x4101('0x37'))){_0xa7cf3[_0x4101('0x1e')]=qs[_0x4101('0x1e')](_0x8b50a[_0x4101('0x2e')]['limit']);_0xa7cf3[_0x4101('0x1b')]=qs['offset'](_0x8b50a[_0x4101('0x2e')]['offset']);}_0xa7cf3['order']=qs[_0x4101('0x38')](_0x8b50a[_0x4101('0x2e')]['sort']);_0xa7cf3[_0x4101('0x39')]=qs[_0x4101('0x30')](_[_0x4101('0x3a')](_0x8b50a[_0x4101('0x2e')],_0x4dff77[_0x4101('0x30')]),_0x4901d6);if(_0x8b50a[_0x4101('0x2e')]['filter']){_0xa7cf3[_0x4101('0x39')]=_[_0x4101('0x3b')](_0xa7cf3[_0x4101('0x39')],{'$or':_[_0x4101('0x29')](_0x4901d6,function(_0x367561){if(_0x367561[_0x4101('0x3c')]!==_0x4101('0x3d')){var _0x4bfab6={};_0x4bfab6[_0x367561[_0x4101('0x26')]]={'$like':'%'+_0x8b50a['query']['filter']+'%'};return _0x4bfab6;}})});}_0xa7cf3=_[_0x4101('0x3b')]({},_0xa7cf3,_0x8b50a[_0x4101('0x3e')]);var _0x172dd4={'where':_0xa7cf3[_0x4101('0x39')]};return db[_0x4101('0x2a')]['count'](_0x172dd4)[_0x4101('0x22')](function(_0x3156be){_0x20d707['count']=_0x3156be;if(_0x8b50a[_0x4101('0x2e')][_0x4101('0x3f')]){_0xa7cf3[_0x4101('0x40')]=[{'all':!![]}];}return db['IntegrationReport']['findAll'](_0xa7cf3);})[_0x4101('0x22')](function(_0x2c1dad){_0x20d707[_0x4101('0x41')]=_0x2c1dad;return _0x20d707;})['then'](respondWithFilteredResult(_0x357790,_0xa7cf3))[_0x4101('0x42')](handleError(_0x357790,null));};exports[_0x4101('0x43')]=function(_0x551e33,_0x2e7c50){var _0x2a5661={'raw':![],'where':{'id':_0x551e33[_0x4101('0x44')]['id']}},_0x3b3802={};_0x3b3802[_0x4101('0x31')]=_[_0x4101('0x2f')](db[_0x4101('0x2a')][_0x4101('0x2b')]);_0x3b3802[_0x4101('0x2e')]=_[_0x4101('0x2f')](_0x551e33[_0x4101('0x2e')]);_0x3b3802[_0x4101('0x30')]=_['intersection'](_0x3b3802['model'],_0x3b3802[_0x4101('0x2e')]);_0x2a5661[_0x4101('0x32')]=_[_0x4101('0x33')](_0x3b3802[_0x4101('0x31')],qs[_0x4101('0x34')](_0x551e33[_0x4101('0x2e')]['fields']));_0x2a5661[_0x4101('0x32')]=_0x2a5661['attributes'][_0x4101('0x35')]?_0x2a5661[_0x4101('0x32')]:_0x3b3802['model'];if(_0x551e33[_0x4101('0x2e')][_0x4101('0x3f')]){_0x2a5661[_0x4101('0x40')]=[{'all':!![]}];}_0x2a5661=_[_0x4101('0x3b')]({},_0x2a5661,_0x551e33['options']);return db[_0x4101('0x2a')][_0x4101('0x45')](_0x2a5661)['then'](handleEntityNotFound(_0x2e7c50,null))[_0x4101('0x22')](respondWithResult(_0x2e7c50,null))[_0x4101('0x42')](handleError(_0x2e7c50,null));};exports['create']=function(_0x2511ad,_0x502a19){return db['IntegrationReport'][_0x4101('0x46')](_0x2511ad[_0x4101('0x47')],{})[_0x4101('0x22')](respondWithResult(_0x502a19,0xc9))[_0x4101('0x42')](handleError(_0x502a19,null));};exports[_0x4101('0x48')]=function(_0x35f8f5,_0x58ab6b){if(_0x35f8f5[_0x4101('0x47')]['id']){delete _0x35f8f5[_0x4101('0x47')]['id'];}return db[_0x4101('0x2a')]['find']({'where':{'id':_0x35f8f5[_0x4101('0x44')]['id']}})[_0x4101('0x22')](handleEntityNotFound(_0x58ab6b,null))[_0x4101('0x22')](saveUpdates(_0x35f8f5[_0x4101('0x47')],null))[_0x4101('0x22')](respondWithResult(_0x58ab6b,null))[_0x4101('0x42')](handleError(_0x58ab6b,null));};exports[_0x4101('0x49')]=function(_0x18898f,_0x1b533a){return db[_0x4101('0x2a')]['find']({'where':{'id':_0x18898f[_0x4101('0x44')]['id']}})['then'](handleEntityNotFound(_0x1b533a,null))[_0x4101('0x22')](removeEntity(_0x1b533a,null))[_0x4101('0x42')](handleError(_0x1b533a,null));};exports[_0x4101('0x4a')]=function(_0x2bbe2a,_0x58708e){return db[_0x4101('0x2a')][_0x4101('0x4a')]()[_0x4101('0x22')](respondWithResult(_0x58708e,null))[_0x4101('0x42')](handleError(_0x58708e,null));}; \ No newline at end of file +var _0xc854=['map','query','filters','intersection','model','fields','attributes','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','keys','rawAttributes','length','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','IntegrationReport','fieldName','type','key'];(function(_0xf3d32c,_0xd29dcc){var _0x4516e6=function(_0x236a34){while(--_0x236a34){_0xf3d32c['push'](_0xf3d32c['shift']());}};_0x4516e6(++_0xd29dcc);}(_0xc854,0x158));var _0x4c85=function(_0x43241c,_0xad3f71){_0x43241c=_0x43241c-0x0;var _0x43b112=_0xc854[_0x43241c];return _0x43b112;};'use strict';var emlformat=require(_0x4c85('0x0'));var rimraf=require(_0x4c85('0x1'));var zipdir=require(_0x4c85('0x2'));var jsonpatch=require(_0x4c85('0x3'));var rp=require(_0x4c85('0x4'));var moment=require(_0x4c85('0x5'));var BPromise=require(_0x4c85('0x6'));var Mustache=require(_0x4c85('0x7'));var util=require(_0x4c85('0x8'));var path=require('path');var sox=require(_0x4c85('0x9'));var csv=require(_0x4c85('0xa'));var ejs=require(_0x4c85('0xb'));var fs=require('fs');var fs_extra=require(_0x4c85('0xc'));var _=require(_0x4c85('0xd'));var squel=require(_0x4c85('0xe'));var crypto=require('crypto');var jsforce=require(_0x4c85('0xf'));var deskjs=require(_0x4c85('0x10'));var toCsv=require(_0x4c85('0xa'));var querystring=require(_0x4c85('0x11'));var Papa=require(_0x4c85('0x12'));var Redis=require(_0x4c85('0x13'));var authService=require(_0x4c85('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x4c85('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4c85('0x16'))(_0x4c85('0x17'));var utils=require(_0x4c85('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x4c85('0x19'));var db=require(_0x4c85('0x1a'))['db'];function respondWithStatusCode(_0x22d4d7,_0x49ce6f){_0x49ce6f=_0x49ce6f||0xcc;return function(_0x5f2d63){if(_0x5f2d63){return _0x22d4d7[_0x4c85('0x1b')](_0x49ce6f);}return _0x22d4d7[_0x4c85('0x1c')](_0x49ce6f)[_0x4c85('0x1d')]();};}function respondWithResult(_0xad751d,_0x170504){_0x170504=_0x170504||0xc8;return function(_0x38aacf){if(_0x38aacf){return _0xad751d[_0x4c85('0x1c')](_0x170504)[_0x4c85('0x1e')](_0x38aacf);}};}function respondWithFilteredResult(_0x48d398,_0x1d486c){return function(_0x364203){if(_0x364203){var _0xf70674=typeof _0x1d486c[_0x4c85('0x1f')]===_0x4c85('0x20')&&typeof _0x1d486c[_0x4c85('0x21')]===_0x4c85('0x20');var _0x4e2e7f=_0x364203['count'];var _0x5b6f5c=_0xf70674?0x0:_0x1d486c[_0x4c85('0x1f')];var _0x2cea7b=_0xf70674?_0x364203[_0x4c85('0x22')]:_0x1d486c['offset']+_0x1d486c['limit'];var _0x1e5e85;if(_0x2cea7b>=_0x4e2e7f){_0x2cea7b=_0x4e2e7f;_0x1e5e85=0xc8;}else{_0x1e5e85=0xce;}_0x48d398['status'](_0x1e5e85);return _0x48d398[_0x4c85('0x23')](_0x4c85('0x24'),_0x5b6f5c+'-'+_0x2cea7b+'/'+_0x4e2e7f)[_0x4c85('0x1e')](_0x364203);}return null;};}function patchUpdates(_0x12104b){return function(_0xedb374){try{jsonpatch[_0x4c85('0x25')](_0xedb374,_0x12104b,!![]);}catch(_0xadc25d){return BPromise[_0x4c85('0x26')](_0xadc25d);}return _0xedb374[_0x4c85('0x27')]();};}function saveUpdates(_0x398d9d,_0x1370a0){return function(_0x246150){if(_0x246150){return _0x246150[_0x4c85('0x28')](_0x398d9d)[_0x4c85('0x29')](function(_0x15b465){return _0x15b465;});}return null;};}function removeEntity(_0x1fe514,_0x102d42){return function(_0x565dc6){if(_0x565dc6){return _0x565dc6[_0x4c85('0x2a')]()[_0x4c85('0x29')](function(){_0x1fe514[_0x4c85('0x1c')](0xcc)[_0x4c85('0x1d')]();});}};}function handleEntityNotFound(_0x1fbfa0,_0x2d2561){return function(_0x3a8a96){if(!_0x3a8a96){_0x1fbfa0[_0x4c85('0x1b')](0x194);}return _0x3a8a96;};}function handleError(_0x107a8f,_0x200cc5){_0x200cc5=_0x200cc5||0x1f4;return function(_0x57de81){logger['error'](_0x57de81[_0x4c85('0x2b')]);if(_0x57de81[_0x4c85('0x2c')]){delete _0x57de81[_0x4c85('0x2c')];}_0x107a8f[_0x4c85('0x1c')](_0x200cc5)[_0x4c85('0x2d')](_0x57de81);};}exports[_0x4c85('0x2e')]=function(_0x22ec9f,_0x433608){var _0x2fc359={},_0x292b99={},_0x181482={'count':0x0,'rows':[]};var _0x58bbcc=_['map'](db[_0x4c85('0x2f')]['rawAttributes'],function(_0x1302bd){return{'name':_0x1302bd[_0x4c85('0x30')],'type':_0x1302bd[_0x4c85('0x31')][_0x4c85('0x32')]};});_0x292b99['model']=_[_0x4c85('0x33')](_0x58bbcc,_0x4c85('0x2c'));_0x292b99[_0x4c85('0x34')]=_['keys'](_0x22ec9f['query']);_0x292b99[_0x4c85('0x35')]=_[_0x4c85('0x36')](_0x292b99[_0x4c85('0x37')],_0x292b99['query']);_0x2fc359['attributes']=_['intersection'](_0x292b99[_0x4c85('0x37')],qs[_0x4c85('0x38')](_0x22ec9f[_0x4c85('0x34')][_0x4c85('0x38')]));_0x2fc359['attributes']=_0x2fc359[_0x4c85('0x39')]['length']?_0x2fc359[_0x4c85('0x39')]:_0x292b99[_0x4c85('0x37')];if(!_0x22ec9f[_0x4c85('0x34')]['hasOwnProperty'](_0x4c85('0x3a'))){_0x2fc359['limit']=qs['limit'](_0x22ec9f[_0x4c85('0x34')]['limit']);_0x2fc359['offset']=qs['offset'](_0x22ec9f[_0x4c85('0x34')][_0x4c85('0x1f')]);}_0x2fc359[_0x4c85('0x3b')]=qs['sort'](_0x22ec9f[_0x4c85('0x34')][_0x4c85('0x3c')]);_0x2fc359[_0x4c85('0x3d')]=qs['filters'](_[_0x4c85('0x3e')](_0x22ec9f['query'],_0x292b99[_0x4c85('0x35')]),_0x58bbcc);if(_0x22ec9f[_0x4c85('0x34')][_0x4c85('0x3f')]){_0x2fc359[_0x4c85('0x3d')]=_[_0x4c85('0x40')](_0x2fc359[_0x4c85('0x3d')],{'$or':_['map'](_0x58bbcc,function(_0x2d0822){if(_0x2d0822[_0x4c85('0x31')]!==_0x4c85('0x41')){var _0x514d0e={};_0x514d0e[_0x2d0822['name']]={'$like':'%'+_0x22ec9f[_0x4c85('0x34')]['filter']+'%'};return _0x514d0e;}})});}_0x2fc359=_[_0x4c85('0x40')]({},_0x2fc359,_0x22ec9f[_0x4c85('0x42')]);var _0xf04bf9={'where':_0x2fc359[_0x4c85('0x3d')]};return db[_0x4c85('0x2f')]['count'](_0xf04bf9)[_0x4c85('0x29')](function(_0x3e78c7){_0x181482[_0x4c85('0x22')]=_0x3e78c7;if(_0x22ec9f[_0x4c85('0x34')][_0x4c85('0x43')]){_0x2fc359[_0x4c85('0x44')]=[{'all':!![]}];}return db[_0x4c85('0x2f')][_0x4c85('0x45')](_0x2fc359);})[_0x4c85('0x29')](function(_0x17a476){_0x181482['rows']=_0x17a476;return _0x181482;})['then'](respondWithFilteredResult(_0x433608,_0x2fc359))[_0x4c85('0x46')](handleError(_0x433608,null));};exports['show']=function(_0x47bc5a,_0x351c52){var _0x12da7c={'raw':![],'where':{'id':_0x47bc5a[_0x4c85('0x47')]['id']}},_0x4d5790={};_0x4d5790[_0x4c85('0x37')]=_[_0x4c85('0x48')](db['IntegrationReport'][_0x4c85('0x49')]);_0x4d5790[_0x4c85('0x34')]=_[_0x4c85('0x48')](_0x47bc5a['query']);_0x4d5790['filters']=_[_0x4c85('0x36')](_0x4d5790[_0x4c85('0x37')],_0x4d5790['query']);_0x12da7c[_0x4c85('0x39')]=_['intersection'](_0x4d5790['model'],qs[_0x4c85('0x38')](_0x47bc5a[_0x4c85('0x34')]['fields']));_0x12da7c[_0x4c85('0x39')]=_0x12da7c[_0x4c85('0x39')][_0x4c85('0x4a')]?_0x12da7c[_0x4c85('0x39')]:_0x4d5790[_0x4c85('0x37')];if(_0x47bc5a['query'][_0x4c85('0x43')]){_0x12da7c[_0x4c85('0x44')]=[{'all':!![]}];}_0x12da7c=_[_0x4c85('0x40')]({},_0x12da7c,_0x47bc5a[_0x4c85('0x42')]);return db[_0x4c85('0x2f')][_0x4c85('0x4b')](_0x12da7c)[_0x4c85('0x29')](handleEntityNotFound(_0x351c52,null))[_0x4c85('0x29')](respondWithResult(_0x351c52,null))['catch'](handleError(_0x351c52,null));};exports[_0x4c85('0x4c')]=function(_0x403f63,_0x3cdb37){return db[_0x4c85('0x2f')][_0x4c85('0x4c')](_0x403f63[_0x4c85('0x4d')],{})[_0x4c85('0x29')](respondWithResult(_0x3cdb37,0xc9))[_0x4c85('0x46')](handleError(_0x3cdb37,null));};exports['update']=function(_0x398111,_0x5523ce){if(_0x398111[_0x4c85('0x4d')]['id']){delete _0x398111[_0x4c85('0x4d')]['id'];}return db[_0x4c85('0x2f')][_0x4c85('0x4b')]({'where':{'id':_0x398111[_0x4c85('0x47')]['id']}})[_0x4c85('0x29')](handleEntityNotFound(_0x5523ce,null))[_0x4c85('0x29')](saveUpdates(_0x398111['body'],null))[_0x4c85('0x29')](respondWithResult(_0x5523ce,null))[_0x4c85('0x46')](handleError(_0x5523ce,null));};exports[_0x4c85('0x2a')]=function(_0x2ba673,_0x591b3c){return db[_0x4c85('0x2f')][_0x4c85('0x4b')]({'where':{'id':_0x2ba673[_0x4c85('0x47')]['id']}})[_0x4c85('0x29')](handleEntityNotFound(_0x591b3c,null))['then'](removeEntity(_0x591b3c,null))['catch'](handleError(_0x591b3c,null));};exports[_0x4c85('0x4e')]=function(_0x4ea1ab,_0x385fac){return db[_0x4c85('0x2f')][_0x4c85('0x4e')]()[_0x4c85('0x29')](respondWithResult(_0x385fac,null))[_0x4c85('0x46')](handleError(_0x385fac,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 890511b..e1b149d 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 _0x05ad=['exports','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./integrationReport.attributes'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x05ad,0x109));var _0xd05a=function(_0x140c8a,_0x14fb5b){_0x140c8a=_0x140c8a-0x0;var _0x391e5d=_0x05ad[_0x140c8a];return _0x391e5d;};'use strict';var _=require(_0xd05a('0x0'));var util=require(_0xd05a('0x1'));var logger=require(_0xd05a('0x2'))(_0xd05a('0x3'));var moment=require(_0xd05a('0x4'));var BPromise=require('bluebird');var rp=require(_0xd05a('0x5'));var fs=require('fs');var path=require(_0xd05a('0x6'));var rimraf=require(_0xd05a('0x7'));var config=require(_0xd05a('0x8'));var attributes=require(_0xd05a('0x9'));module[_0xd05a('0xa')]=function(_0x115b58,_0x1663ab){return _0x115b58['define']('IntegrationReport',attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb89c=['./integrationReport.attributes','define','IntegrationReport','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5cd51d,_0x20d4fa){var _0x444608=function(_0x32a9dc){while(--_0x32a9dc){_0x5cd51d['push'](_0x5cd51d['shift']());}};_0x444608(++_0x20d4fa);}(_0xb89c,0x1ef));var _0xcb89=function(_0x4f7dfe,_0x2fa4a0){_0x4f7dfe=_0x4f7dfe-0x0;var _0x18c892=_0xb89c[_0x4f7dfe];return _0x18c892;};'use strict';var _=require('lodash');var util=require(_0xcb89('0x0'));var logger=require(_0xcb89('0x1'))(_0xcb89('0x2'));var moment=require(_0xcb89('0x3'));var BPromise=require(_0xcb89('0x4'));var rp=require(_0xcb89('0x5'));var fs=require('fs');var path=require(_0xcb89('0x6'));var rimraf=require(_0xcb89('0x7'));var config=require(_0xcb89('0x8'));var attributes=require(_0xcb89('0x9'));module['exports']=function(_0x35983b,_0xae90e3){return _0x35983b[_0xcb89('0xa')](_0xcb89('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 e50e376..a628dad 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 _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','IntegrationReport,\x20%s,\x20%s','IntegrationReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x150ee9,_0x3b68ed){var _0x5d41dc=function(_0x343012){while(--_0x343012){_0x150ee9['push'](_0x150ee9['shift']());}};_0x5d41dc(++_0x3b68ed);}(_0x2ef3,0xba));var _0x32ef=function(_0xc948c5,_0x243618){_0xc948c5=_0xc948c5-0x0;var _0x7b937f=_0x2ef3[_0xc948c5];return _0x7b937f;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('IntegrationReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('IntegrationReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file +var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x1897be,_0x1ab064){var _0x30b007=function(_0x1f84c3){while(--_0x1f84c3){_0x1897be['push'](_0x1897be['shift']());}};_0x30b007(++_0x1ab064);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0xc4aa[_0x2e4aa2];return _0x5e6092;};'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')]('IntegrationReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index 8f43d6e..a8563e6 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 _0x7412=['/:id/sub_intervals','getIntervals','post','create','addInterval','/:id/sub_intervals/create_many','addIntervals','put','/:id','update','delete','destroy','exports','multer','connect-timeout','Router','isAuthenticated','index','get','show'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7412,0x161));var _0x2741=function(_0x59d89e,_0x55edf5){_0x59d89e=_0x59d89e-0x0;var _0x554e93=_0x7412[_0x59d89e];return _0x554e93;};'use strict';var multer=require(_0x2741('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2741('0x1'));var express=require('express');var router=express[_0x2741('0x2')]();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('./interval.controller');router['get']('/',auth[_0x2741('0x3')](),controller[_0x2741('0x4')]);router[_0x2741('0x5')]('/:id',auth[_0x2741('0x3')](),controller[_0x2741('0x6')]);router[_0x2741('0x5')](_0x2741('0x7'),auth['isAuthenticated'](),controller[_0x2741('0x8')]);router[_0x2741('0x9')]('/',auth[_0x2741('0x3')](),controller[_0x2741('0xa')]);router[_0x2741('0x9')]('/:id/sub_intervals',auth[_0x2741('0x3')](),controller[_0x2741('0xb')]);router[_0x2741('0x9')](_0x2741('0xc'),auth[_0x2741('0x3')](),controller[_0x2741('0xd')]);router[_0x2741('0xe')](_0x2741('0xf'),auth['isAuthenticated'](),controller[_0x2741('0x10')]);router[_0x2741('0x11')](_0x2741('0xf'),auth[_0x2741('0x3')](),controller[_0x2741('0x12')]);module[_0x2741('0x13')]=router; \ No newline at end of file +var _0xf006=['addIntervals','put','/:id','update','destroy','exports','path','connect-timeout','Router','../../components/auth/service','./interval.controller','get','isAuthenticated','show','/:id/sub_intervals','getIntervals','post','create','addInterval','/:id/sub_intervals/create_many'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xf006,0x146));var _0x6f00=function(_0x5b1208,_0x958935){_0x5b1208=_0x5b1208-0x0;var _0x34c899=_0xf006[_0x5b1208];return _0x34c899;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6f00('0x0'));var timeout=require(_0x6f00('0x1'));var express=require('express');var router=express[_0x6f00('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x6f00('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6f00('0x4'));router[_0x6f00('0x5')]('/',auth[_0x6f00('0x6')](),controller['index']);router[_0x6f00('0x5')]('/:id',auth[_0x6f00('0x6')](),controller[_0x6f00('0x7')]);router[_0x6f00('0x5')](_0x6f00('0x8'),auth[_0x6f00('0x6')](),controller[_0x6f00('0x9')]);router[_0x6f00('0xa')]('/',auth[_0x6f00('0x6')](),controller[_0x6f00('0xb')]);router[_0x6f00('0xa')](_0x6f00('0x8'),auth[_0x6f00('0x6')](),controller[_0x6f00('0xc')]);router['post'](_0x6f00('0xd'),auth[_0x6f00('0x6')](),controller[_0x6f00('0xe')]);router[_0x6f00('0xf')](_0x6f00('0x10'),auth['isAuthenticated'](),controller[_0x6f00('0x11')]);router['delete'](_0x6f00('0x10'),auth['isAuthenticated'](),controller[_0x6f00('0x12')]);module[_0x6f00('0x13')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 798605d..84437ca 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 _0x48a2=['exports','STRING'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x48a2,0x1ca));var _0x248a=function(_0x3bbd1f,_0x119571){_0x3bbd1f=_0x3bbd1f-0x0;var _0x4cb1fe=_0x48a2[_0x3bbd1f];return _0x4cb1fe;};'use strict';var Sequelize=require('sequelize');module[_0x248a('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x248a('0x1')]},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0x37b8=['exports','STRING','sequelize'];(function(_0x777a6b,_0x53d27a){var _0x52423d=function(_0x5a79b8){while(--_0x5a79b8){_0x777a6b['push'](_0x777a6b['shift']());}};_0x52423d(++_0x53d27a);}(_0x37b8,0x1e2));var _0x837b=function(_0x30fe3a,_0x26a088){_0x30fe3a=_0x30fe3a-0x0;var _0x5a08d2=_0x37b8[_0x30fe3a];return _0x5a08d2;};'use strict';var Sequelize=require(_0x837b('0x0'));module[_0x837b('0x1')]={'name':{'type':Sequelize[_0x837b('0x2')]},'description':{'type':Sequelize[_0x837b('0x2')]},'interval':{'type':Sequelize[_0x837b('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 a6c2652..45d5581 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 _0x8ae5=['fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/extensions/rewrite','end','json','offset','undefined','limit','count','status','set','apply','reject','save','update','destroy','then','Intervals','UserProfileResource','sendStatus','error','name','send','index','map','rawAttributes','fieldName','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','include','Interval','findAll','rows','catch','show','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addInterval','getIntervals','addIntervals','bulkCreate','eml-format','rimraf','zip-dir','bluebird','mustache'];(function(_0xf0c851,_0x2916f0){var _0x1f2fb2=function(_0x4e8af7){while(--_0x4e8af7){_0xf0c851['push'](_0xf0c851['shift']());}};_0x1f2fb2(++_0x2916f0);}(_0x8ae5,0xa5));var _0x58ae=function(_0x3a61a1,_0x2fcfec){_0x3a61a1=_0x3a61a1-0x0;var _0x296d8c=_0x8ae5[_0x3a61a1];return _0x296d8c;};'use strict';var emlformat=require(_0x58ae('0x0'));var rimraf=require(_0x58ae('0x1'));var zipdir=require(_0x58ae('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x58ae('0x3'));var Mustache=require(_0x58ae('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x58ae('0x5'));var _=require(_0x58ae('0x6'));var squel=require(_0x58ae('0x7'));var crypto=require(_0x58ae('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x58ae('0x9'));var toCsv=require(_0x58ae('0xa'));var querystring=require(_0x58ae('0xb'));var Papa=require(_0x58ae('0xc'));var Redis=require(_0x58ae('0xd'));var authService=require(_0x58ae('0xe'));var qs=require(_0x58ae('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x58ae('0x10'))(_0x58ae('0x11'));var utils=require(_0x58ae('0x12'));var config=require(_0x58ae('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x58ae('0x14'))['db'];var extensions=require(_0x58ae('0x15'));function respondWithStatusCode(_0x5f57a1,_0x3af521){_0x3af521=_0x3af521||0xcc;return function(_0x584e14){if(_0x584e14){return _0x5f57a1['sendStatus'](_0x3af521);}return _0x5f57a1['status'](_0x3af521)[_0x58ae('0x16')]();};}function respondWithResult(_0x9b3a93,_0x4ad1de){_0x4ad1de=_0x4ad1de||0xc8;return function(_0x3a9358){if(_0x3a9358){return _0x9b3a93['status'](_0x4ad1de)[_0x58ae('0x17')](_0x3a9358);}};}function respondWithFilteredResult(_0xe7a55a,_0x417f78){return function(_0x49bf2f){if(_0x49bf2f){var _0x5ce4e4=typeof _0x417f78[_0x58ae('0x18')]===_0x58ae('0x19')&&typeof _0x417f78[_0x58ae('0x1a')]==='undefined';var _0xca8aa0=_0x49bf2f['count'];var _0x4bf802=_0x5ce4e4?0x0:_0x417f78['offset'];var _0x2d52a9=_0x5ce4e4?_0x49bf2f[_0x58ae('0x1b')]:_0x417f78[_0x58ae('0x18')]+_0x417f78['limit'];var _0x5aded6;if(_0x2d52a9>=_0xca8aa0){_0x2d52a9=_0xca8aa0;_0x5aded6=0xc8;}else{_0x5aded6=0xce;}_0xe7a55a[_0x58ae('0x1c')](_0x5aded6);return _0xe7a55a[_0x58ae('0x1d')]('Content-Range',_0x4bf802+'-'+_0x2d52a9+'/'+_0xca8aa0)[_0x58ae('0x17')](_0x49bf2f);}return null;};}function patchUpdates(_0x179f63){return function(_0x250171){try{jsonpatch[_0x58ae('0x1e')](_0x250171,_0x179f63,!![]);}catch(_0x118419){return BPromise[_0x58ae('0x1f')](_0x118419);}return _0x250171[_0x58ae('0x20')]();};}function saveUpdates(_0x134445,_0x13608c){return function(_0x2be372){if(_0x2be372){return _0x2be372[_0x58ae('0x21')](_0x134445)['then'](function(_0x5d10a0){return _0x5d10a0;});}return null;};}function removeEntity(_0x45bd1d,_0x5c3620){return function(_0x10f174){if(_0x10f174){return _0x10f174[_0x58ae('0x22')]()[_0x58ae('0x23')](function(){var _0x1dead3=_0x10f174['get']({'plain':!![]});var _0x1cda47=_0x58ae('0x24');return db[_0x58ae('0x25')][_0x58ae('0x22')]({'where':{'type':_0x1cda47,'resourceId':_0x1dead3['id']}})[_0x58ae('0x23')](function(){return _0x10f174;});})[_0x58ae('0x23')](function(){_0x45bd1d[_0x58ae('0x1c')](0xcc)[_0x58ae('0x16')]();});}};}function handleEntityNotFound(_0x34ffa8,_0x588eeb){return function(_0x305f31){if(!_0x305f31){_0x34ffa8[_0x58ae('0x26')](0x194);}return _0x305f31;};}function handleError(_0x33cc75,_0x315819){_0x315819=_0x315819||0x1f4;return function(_0x5beeb8){logger[_0x58ae('0x27')](_0x5beeb8['stack']);if(_0x5beeb8[_0x58ae('0x28')]){delete _0x5beeb8[_0x58ae('0x28')];}_0x33cc75[_0x58ae('0x1c')](_0x315819)[_0x58ae('0x29')](_0x5beeb8);};}exports[_0x58ae('0x2a')]=function(_0x4308cf,_0xe8763){var _0x3e0067={},_0x5c9ee3={},_0x26179f={'count':0x0,'rows':[]};var _0xaa4b70=_[_0x58ae('0x2b')](db['Interval'][_0x58ae('0x2c')],function(_0x3d024c){return{'name':_0x3d024c[_0x58ae('0x2d')],'type':_0x3d024c['type']['key']};});_0x5c9ee3[_0x58ae('0x2e')]=_['map'](_0xaa4b70,_0x58ae('0x28'));_0x5c9ee3['query']=_[_0x58ae('0x2f')](_0x4308cf['query']);_0x5c9ee3[_0x58ae('0x30')]=_[_0x58ae('0x31')](_0x5c9ee3[_0x58ae('0x2e')],_0x5c9ee3[_0x58ae('0x32')]);_0x3e0067[_0x58ae('0x33')]=_[_0x58ae('0x31')](_0x5c9ee3[_0x58ae('0x2e')],qs[_0x58ae('0x34')](_0x4308cf[_0x58ae('0x32')][_0x58ae('0x34')]));_0x3e0067[_0x58ae('0x33')]=_0x3e0067[_0x58ae('0x33')][_0x58ae('0x35')]?_0x3e0067[_0x58ae('0x33')]:_0x5c9ee3['model'];if(!_0x4308cf['query'][_0x58ae('0x36')](_0x58ae('0x37'))){_0x3e0067[_0x58ae('0x1a')]=qs[_0x58ae('0x1a')](_0x4308cf[_0x58ae('0x32')]['limit']);_0x3e0067[_0x58ae('0x18')]=qs['offset'](_0x4308cf[_0x58ae('0x32')][_0x58ae('0x18')]);}_0x3e0067[_0x58ae('0x38')]=qs[_0x58ae('0x39')](_0x4308cf[_0x58ae('0x32')]['sort']);_0x3e0067[_0x58ae('0x3a')]=qs[_0x58ae('0x30')](_[_0x58ae('0x3b')](_0x4308cf[_0x58ae('0x32')],_0x5c9ee3[_0x58ae('0x30')]),_0xaa4b70);if(_0x4308cf['query'][_0x58ae('0x3c')]){_0x3e0067[_0x58ae('0x3a')]=_[_0x58ae('0x3d')](_0x3e0067['where'],{'$or':_[_0x58ae('0x2b')](_0xaa4b70,function(_0x222a89){if(_0x222a89[_0x58ae('0x3e')]!=='VIRTUAL'){var _0x1c99d1={};_0x1c99d1[_0x222a89['name']]={'$like':'%'+_0x4308cf[_0x58ae('0x32')]['filter']+'%'};return _0x1c99d1;}})});}_0x3e0067=_[_0x58ae('0x3d')]({},_0x3e0067,_0x4308cf[_0x58ae('0x3f')]);var _0x437f61={'where':_0x3e0067[_0x58ae('0x3a')]};return db['Interval'][_0x58ae('0x1b')](_0x437f61)[_0x58ae('0x23')](function(_0x35d7fa){_0x26179f['count']=_0x35d7fa;if(_0x4308cf[_0x58ae('0x32')][_0x58ae('0x40')]){_0x3e0067[_0x58ae('0x41')]=[{'all':!![]}];}return db[_0x58ae('0x42')][_0x58ae('0x43')](_0x3e0067);})['then'](function(_0x2538f4){_0x26179f[_0x58ae('0x44')]=_0x2538f4;return _0x26179f;})[_0x58ae('0x23')](respondWithFilteredResult(_0xe8763,_0x3e0067))[_0x58ae('0x45')](handleError(_0xe8763,null));};exports[_0x58ae('0x46')]=function(_0xe445f1,_0x49013e){var _0x233dbe={'raw':!![],'where':{'id':_0xe445f1['params']['id']}},_0x204593={};_0x204593['model']=_[_0x58ae('0x2f')](db[_0x58ae('0x42')]['rawAttributes']);_0x204593[_0x58ae('0x32')]=_[_0x58ae('0x2f')](_0xe445f1[_0x58ae('0x32')]);_0x204593['filters']=_['intersection'](_0x204593[_0x58ae('0x2e')],_0x204593[_0x58ae('0x32')]);_0x233dbe[_0x58ae('0x33')]=_[_0x58ae('0x31')](_0x204593[_0x58ae('0x2e')],qs[_0x58ae('0x34')](_0xe445f1[_0x58ae('0x32')][_0x58ae('0x34')]));_0x233dbe[_0x58ae('0x33')]=_0x233dbe['attributes']['length']?_0x233dbe['attributes']:_0x204593[_0x58ae('0x2e')];if(_0xe445f1[_0x58ae('0x32')]['includeAll']){_0x233dbe[_0x58ae('0x41')]=[{'all':!![]}];}_0x233dbe=_[_0x58ae('0x3d')]({},_0x233dbe,_0xe445f1['options']);return db[_0x58ae('0x42')]['find'](_0x233dbe)[_0x58ae('0x23')](handleEntityNotFound(_0x49013e,null))[_0x58ae('0x23')](respondWithResult(_0x49013e,null))[_0x58ae('0x45')](handleError(_0x49013e,null));};exports[_0x58ae('0x47')]=function(_0x4f0376,_0x48b0fa){return db[_0x58ae('0x42')]['create'](_0x4f0376[_0x58ae('0x48')],{})['then'](function(_0x5f49c6){var _0x4acd6d=_0x4f0376[_0x58ae('0x49')][_0x58ae('0x4a')]({'plain':!![]});if(!_0x4acd6d)throw new Error(_0x58ae('0x4b'));if(_0x4acd6d[_0x58ae('0x4c')]===_0x58ae('0x49')){var _0x4bf985=_0x5f49c6[_0x58ae('0x4a')]({'plain':!![]});var _0x5da034=_0x58ae('0x24');return db[_0x58ae('0x4d')][_0x58ae('0x4e')]({'where':{'name':_0x5da034,'userProfileId':_0x4acd6d['userProfileId']},'raw':!![]})[_0x58ae('0x23')](function(_0xf5a424){if(_0xf5a424&&_0xf5a424['autoAssociation']===0x0){return db['UserProfileResource'][_0x58ae('0x47')]({'name':_0x4bf985['name'],'resourceId':_0x4bf985['id'],'type':_0xf5a424[_0x58ae('0x28')],'sectionId':_0xf5a424['id']},{})['then'](function(){return _0x5f49c6;});}else{return _0x5f49c6;}})['catch'](function(_0x4d5d56){logger[_0x58ae('0x27')](_0x58ae('0x4f'),_0x4d5d56);throw _0x4d5d56;});}return _0x5f49c6;})[_0x58ae('0x23')](respondWithResult(_0x48b0fa,0xc9))['catch'](handleError(_0x48b0fa,null));};exports[_0x58ae('0x21')]=function(_0x4f5950,_0x5498c5){if(_0x4f5950['body']['id']){delete _0x4f5950[_0x58ae('0x48')]['id'];}return db[_0x58ae('0x42')][_0x58ae('0x4e')]({'where':{'id':_0x4f5950[_0x58ae('0x50')]['id']}})['then'](handleEntityNotFound(_0x5498c5,null))['then'](saveUpdates(_0x4f5950[_0x58ae('0x48')],null))[_0x58ae('0x23')](respondWithResult(_0x5498c5,null))[_0x58ae('0x45')](handleError(_0x5498c5,null));};exports['destroy']=function(_0x1df053,_0x45d2d0){return db[_0x58ae('0x42')]['find']({'where':{'id':_0x1df053[_0x58ae('0x50')]['id']}})[_0x58ae('0x23')](handleEntityNotFound(_0x45d2d0,null))[_0x58ae('0x23')](removeEntity(_0x45d2d0,null))[_0x58ae('0x45')](handleError(_0x45d2d0,null));};exports[_0x58ae('0x51')]=function(_0x9c4568,_0x14ce16,_0x4a491b){if(_0x9c4568[_0x58ae('0x48')]['id']){delete _0x9c4568['body']['id'];}return db[_0x58ae('0x42')][_0x58ae('0x4e')]({'where':{'id':_0x9c4568[_0x58ae('0x50')]['id']}})[_0x58ae('0x23')](handleEntityNotFound(_0x14ce16,null))[_0x58ae('0x23')](function(_0x8f7fd1){if(_0x8f7fd1){_0x9c4568[_0x58ae('0x48')]['IntervalId']=_0x8f7fd1['id'];return db['Interval'][_0x58ae('0x47')](_0x9c4568[_0x58ae('0x48')]);}})['then'](respondWithResult(_0x14ce16,null))[_0x58ae('0x45')](handleError(_0x14ce16,null));};exports['getIntervals']=function(_0x236343,_0x2be2f8,_0x40e442){var _0x5c1acc={};var _0x565772={};var _0x3d395e;var _0x4c4e34;return db[_0x58ae('0x42')]['findOne']({'where':{'id':_0x236343[_0x58ae('0x50')]['id']}})[_0x58ae('0x23')](handleEntityNotFound(_0x2be2f8,null))[_0x58ae('0x23')](function(_0x63c583){if(_0x63c583){_0x3d395e=_0x63c583;_0x565772[_0x58ae('0x2e')]=_[_0x58ae('0x2f')](db[_0x58ae('0x42')][_0x58ae('0x2c')]);_0x565772['query']=_[_0x58ae('0x2f')](_0x236343[_0x58ae('0x32')]);_0x565772[_0x58ae('0x30')]=_[_0x58ae('0x31')](_0x565772['model'],_0x565772[_0x58ae('0x32')]);_0x5c1acc[_0x58ae('0x33')]=_['intersection'](_0x565772[_0x58ae('0x2e')],qs['fields'](_0x236343[_0x58ae('0x32')][_0x58ae('0x34')]));_0x5c1acc[_0x58ae('0x33')]=_0x5c1acc[_0x58ae('0x33')][_0x58ae('0x35')]?_0x5c1acc[_0x58ae('0x33')]:_0x565772[_0x58ae('0x2e')];_0x5c1acc[_0x58ae('0x38')]=qs[_0x58ae('0x39')](_0x236343['query'][_0x58ae('0x39')]);_0x5c1acc[_0x58ae('0x3a')]=qs['filters'](_['pick'](_0x236343[_0x58ae('0x32')],_0x565772[_0x58ae('0x30')]));if(_0x236343[_0x58ae('0x32')][_0x58ae('0x3c')]){_0x5c1acc[_0x58ae('0x3a')]=_[_0x58ae('0x3d')](_0x5c1acc[_0x58ae('0x3a')],{'$or':_[_0x58ae('0x2b')](_0x5c1acc[_0x58ae('0x33')],function(_0x39a8e0){var _0x11ea1e={};_0x11ea1e[_0x39a8e0]={'$like':'%'+_0x236343['query'][_0x58ae('0x3c')]+'%'};return _0x11ea1e;})});}_0x5c1acc=_[_0x58ae('0x3d')]({},_0x5c1acc,_0x236343[_0x58ae('0x3f')]);return _0x3d395e[_0x58ae('0x52')](_0x5c1acc);}})[_0x58ae('0x23')](function(_0x3d2f23){if(_0x3d2f23){_0x4c4e34=_0x3d2f23[_0x58ae('0x35')];if(!_0x236343[_0x58ae('0x32')][_0x58ae('0x36')]('nolimit')){_0x5c1acc[_0x58ae('0x1a')]=qs[_0x58ae('0x1a')](_0x236343[_0x58ae('0x32')][_0x58ae('0x1a')]);_0x5c1acc[_0x58ae('0x18')]=qs[_0x58ae('0x18')](_0x236343['query'][_0x58ae('0x18')]);}return _0x3d395e[_0x58ae('0x52')](_0x5c1acc);}})[_0x58ae('0x23')](function(_0x516d1e){if(_0x516d1e){return _0x516d1e?{'count':_0x4c4e34,'rows':_0x516d1e}:null;}})[_0x58ae('0x23')](respondWithResult(_0x2be2f8,null))[_0x58ae('0x45')](handleError(_0x2be2f8,null));};exports[_0x58ae('0x53')]=function(_0x189b69,_0x147d32,_0x23a33c){return db[_0x58ae('0x42')]['findOne']({'where':{'id':_0x189b69[_0x58ae('0x50')]['id']}})[_0x58ae('0x23')](handleEntityNotFound(_0x147d32,null))[_0x58ae('0x23')](function(_0x1ec741){if(_0x1ec741){return db['sequelize']['transaction'](function(_0x3f88f9){return db[_0x58ae('0x42')]['destroy']({'where':{'IntervalId':_0x189b69[_0x58ae('0x50')]['id']},'transaction':_0x3f88f9})[_0x58ae('0x23')](function(_0x53df30){var _0x500db6=_[_0x58ae('0x2b')](_0x189b69[_0x58ae('0x48')],function(_0x19b155){delete _0x19b155['id'];_0x19b155['IntervalId']=_0x189b69[_0x58ae('0x50')]['id'];return _0x19b155;});return db[_0x58ae('0x42')][_0x58ae('0x54')](_0x500db6,{'transaction':_0x3f88f9});});})[_0x58ae('0x23')](function(){return db[_0x58ae('0x42')][_0x58ae('0x43')]({'where':{'IntervalId':_0x189b69['params']['id']}});});}})['then'](respondWithResult(_0x147d32,null))['catch'](handleError(_0x147d32,null));}; \ No newline at end of file +var _0x81a1=['params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addInterval','IntervalId','sort','getIntervals','nolimit','addIntervals','findOne','sequelize','transaction','bulkCreate','eml-format','rimraf','zip-dir','moment','bluebird','util','path','ejs','lodash','squel','crypto','jsforce','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','undefined','limit','count','offset','Content-Range','save','destroy','then','get','Intervals','end','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','pick','filter','where','merge','options','Interval','include','findAll','rows','catch','show'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x81a1,0x6e));var _0x181a=function(_0xeaa115,_0x564245){_0xeaa115=_0xeaa115-0x0;var _0x462593=_0x81a1[_0xeaa115];return _0x462593;};'use strict';var emlformat=require(_0x181a('0x0'));var rimraf=require(_0x181a('0x1'));var zipdir=require(_0x181a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x181a('0x3'));var BPromise=require(_0x181a('0x4'));var Mustache=require('mustache');var util=require(_0x181a('0x5'));var path=require(_0x181a('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x181a('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x181a('0x8'));var squel=require(_0x181a('0x9'));var crypto=require(_0x181a('0xa'));var jsforce=require(_0x181a('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x181a('0xc'));var querystring=require('querystring');var Papa=require(_0x181a('0xd'));var Redis=require('ioredis');var authService=require(_0x181a('0xe'));var qs=require(_0x181a('0xf'));var as=require(_0x181a('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x181a('0x11'))(_0x181a('0x12'));var utils=require('../../config/utils');var config=require(_0x181a('0x13'));var licenseUtil=require(_0x181a('0x14'));var db=require(_0x181a('0x15'))['db'];var extensions=require(_0x181a('0x16'));function respondWithStatusCode(_0x39f743,_0x3fa831){_0x3fa831=_0x3fa831||0xcc;return function(_0x5a62d5){if(_0x5a62d5){return _0x39f743[_0x181a('0x17')](_0x3fa831);}return _0x39f743[_0x181a('0x18')](_0x3fa831)['end']();};}function respondWithResult(_0x1c736c,_0x139b8c){_0x139b8c=_0x139b8c||0xc8;return function(_0x147f8a){if(_0x147f8a){return _0x1c736c[_0x181a('0x18')](_0x139b8c)['json'](_0x147f8a);}};}function respondWithFilteredResult(_0x40f9d0,_0x5cd533){return function(_0x22448d){if(_0x22448d){var _0x2e55c7=typeof _0x5cd533['offset']===_0x181a('0x19')&&typeof _0x5cd533[_0x181a('0x1a')]===_0x181a('0x19');var _0x4a2a9d=_0x22448d[_0x181a('0x1b')];var _0x4c2fd6=_0x2e55c7?0x0:_0x5cd533[_0x181a('0x1c')];var _0x4ad1e5=_0x2e55c7?_0x22448d[_0x181a('0x1b')]:_0x5cd533[_0x181a('0x1c')]+_0x5cd533[_0x181a('0x1a')];var _0x34cc0d;if(_0x4ad1e5>=_0x4a2a9d){_0x4ad1e5=_0x4a2a9d;_0x34cc0d=0xc8;}else{_0x34cc0d=0xce;}_0x40f9d0['status'](_0x34cc0d);return _0x40f9d0['set'](_0x181a('0x1d'),_0x4c2fd6+'-'+_0x4ad1e5+'/'+_0x4a2a9d)['json'](_0x22448d);}return null;};}function patchUpdates(_0x19a539){return function(_0x1bf397){try{jsonpatch['apply'](_0x1bf397,_0x19a539,!![]);}catch(_0x2001b9){return BPromise['reject'](_0x2001b9);}return _0x1bf397[_0x181a('0x1e')]();};}function saveUpdates(_0x1e74e9,_0x44f671){return function(_0x183347){if(_0x183347){return _0x183347['update'](_0x1e74e9)['then'](function(_0x477887){return _0x477887;});}return null;};}function removeEntity(_0x33fcf6,_0x20873f){return function(_0x2a81a3){if(_0x2a81a3){return _0x2a81a3[_0x181a('0x1f')]()[_0x181a('0x20')](function(){var _0x38fd54=_0x2a81a3[_0x181a('0x21')]({'plain':!![]});var _0x20e0b5=_0x181a('0x22');return db['UserProfileResource'][_0x181a('0x1f')]({'where':{'type':_0x20e0b5,'resourceId':_0x38fd54['id']}})[_0x181a('0x20')](function(){return _0x2a81a3;});})['then'](function(){_0x33fcf6[_0x181a('0x18')](0xcc)[_0x181a('0x23')]();});}};}function handleEntityNotFound(_0x1798cf,_0x1fe931){return function(_0x312d62){if(!_0x312d62){_0x1798cf[_0x181a('0x17')](0x194);}return _0x312d62;};}function handleError(_0x2ec397,_0x13f413){_0x13f413=_0x13f413||0x1f4;return function(_0x3aa86d){logger[_0x181a('0x24')](_0x3aa86d[_0x181a('0x25')]);if(_0x3aa86d[_0x181a('0x26')]){delete _0x3aa86d[_0x181a('0x26')];}_0x2ec397[_0x181a('0x18')](_0x13f413)[_0x181a('0x27')](_0x3aa86d);};}exports[_0x181a('0x28')]=function(_0x42bbaa,_0x2e496b){var _0x10cd76={},_0x2e6fee={},_0xa9c3d9={'count':0x0,'rows':[]};var _0x1ee45b=_[_0x181a('0x29')](db['Interval'][_0x181a('0x2a')],function(_0x4654be){return{'name':_0x4654be['fieldName'],'type':_0x4654be[_0x181a('0x2b')][_0x181a('0x2c')]};});_0x2e6fee[_0x181a('0x2d')]=_[_0x181a('0x29')](_0x1ee45b,_0x181a('0x26'));_0x2e6fee[_0x181a('0x2e')]=_[_0x181a('0x2f')](_0x42bbaa[_0x181a('0x2e')]);_0x2e6fee[_0x181a('0x30')]=_[_0x181a('0x31')](_0x2e6fee[_0x181a('0x2d')],_0x2e6fee[_0x181a('0x2e')]);_0x10cd76[_0x181a('0x32')]=_[_0x181a('0x31')](_0x2e6fee[_0x181a('0x2d')],qs[_0x181a('0x33')](_0x42bbaa[_0x181a('0x2e')]['fields']));_0x10cd76['attributes']=_0x10cd76['attributes'][_0x181a('0x34')]?_0x10cd76['attributes']:_0x2e6fee[_0x181a('0x2d')];if(!_0x42bbaa[_0x181a('0x2e')][_0x181a('0x35')]('nolimit')){_0x10cd76[_0x181a('0x1a')]=qs[_0x181a('0x1a')](_0x42bbaa[_0x181a('0x2e')][_0x181a('0x1a')]);_0x10cd76['offset']=qs[_0x181a('0x1c')](_0x42bbaa[_0x181a('0x2e')][_0x181a('0x1c')]);}_0x10cd76[_0x181a('0x36')]=qs['sort'](_0x42bbaa[_0x181a('0x2e')]['sort']);_0x10cd76['where']=qs[_0x181a('0x30')](_[_0x181a('0x37')](_0x42bbaa['query'],_0x2e6fee['filters']),_0x1ee45b);if(_0x42bbaa[_0x181a('0x2e')][_0x181a('0x38')]){_0x10cd76[_0x181a('0x39')]=_[_0x181a('0x3a')](_0x10cd76[_0x181a('0x39')],{'$or':_[_0x181a('0x29')](_0x1ee45b,function(_0x8ec634){if(_0x8ec634['type']!=='VIRTUAL'){var _0x1ac0ee={};_0x1ac0ee[_0x8ec634[_0x181a('0x26')]]={'$like':'%'+_0x42bbaa['query']['filter']+'%'};return _0x1ac0ee;}})});}_0x10cd76=_[_0x181a('0x3a')]({},_0x10cd76,_0x42bbaa[_0x181a('0x3b')]);var _0x5e02ed={'where':_0x10cd76[_0x181a('0x39')]};return db[_0x181a('0x3c')][_0x181a('0x1b')](_0x5e02ed)[_0x181a('0x20')](function(_0x528d37){_0xa9c3d9[_0x181a('0x1b')]=_0x528d37;if(_0x42bbaa['query']['includeAll']){_0x10cd76[_0x181a('0x3d')]=[{'all':!![]}];}return db[_0x181a('0x3c')][_0x181a('0x3e')](_0x10cd76);})[_0x181a('0x20')](function(_0x2a9c7b){_0xa9c3d9[_0x181a('0x3f')]=_0x2a9c7b;return _0xa9c3d9;})['then'](respondWithFilteredResult(_0x2e496b,_0x10cd76))[_0x181a('0x40')](handleError(_0x2e496b,null));};exports[_0x181a('0x41')]=function(_0x3e6b3d,_0x417823){var _0x11a706={'raw':!![],'where':{'id':_0x3e6b3d[_0x181a('0x42')]['id']}},_0x3165f3={};_0x3165f3[_0x181a('0x2d')]=_[_0x181a('0x2f')](db[_0x181a('0x3c')][_0x181a('0x2a')]);_0x3165f3[_0x181a('0x2e')]=_[_0x181a('0x2f')](_0x3e6b3d[_0x181a('0x2e')]);_0x3165f3['filters']=_['intersection'](_0x3165f3[_0x181a('0x2d')],_0x3165f3['query']);_0x11a706[_0x181a('0x32')]=_[_0x181a('0x31')](_0x3165f3['model'],qs[_0x181a('0x33')](_0x3e6b3d[_0x181a('0x2e')][_0x181a('0x33')]));_0x11a706['attributes']=_0x11a706['attributes']['length']?_0x11a706['attributes']:_0x3165f3[_0x181a('0x2d')];if(_0x3e6b3d['query']['includeAll']){_0x11a706['include']=[{'all':!![]}];}_0x11a706=_[_0x181a('0x3a')]({},_0x11a706,_0x3e6b3d[_0x181a('0x3b')]);return db[_0x181a('0x3c')][_0x181a('0x43')](_0x11a706)['then'](handleEntityNotFound(_0x417823,null))['then'](respondWithResult(_0x417823,null))[_0x181a('0x40')](handleError(_0x417823,null));};exports[_0x181a('0x44')]=function(_0x5eade3,_0x22c93c){return db[_0x181a('0x3c')][_0x181a('0x44')](_0x5eade3[_0x181a('0x45')],{})[_0x181a('0x20')](function(_0x3a46b8){var _0x3a29b1=_0x5eade3['user'][_0x181a('0x21')]({'plain':!![]});if(!_0x3a29b1)throw new Error(_0x181a('0x46'));if(_0x3a29b1[_0x181a('0x47')]===_0x181a('0x48')){var _0x5d7c7d=_0x3a46b8[_0x181a('0x21')]({'plain':!![]});var _0x4dae55=_0x181a('0x22');return db['UserProfileSection'][_0x181a('0x43')]({'where':{'name':_0x4dae55,'userProfileId':_0x3a29b1[_0x181a('0x49')]},'raw':!![]})['then'](function(_0x1b2614){if(_0x1b2614&&_0x1b2614[_0x181a('0x4a')]===0x0){return db[_0x181a('0x4b')][_0x181a('0x44')]({'name':_0x5d7c7d[_0x181a('0x26')],'resourceId':_0x5d7c7d['id'],'type':_0x1b2614[_0x181a('0x26')],'sectionId':_0x1b2614['id']},{})[_0x181a('0x20')](function(){return _0x3a46b8;});}else{return _0x3a46b8;}})[_0x181a('0x40')](function(_0x237b0f){logger[_0x181a('0x24')](_0x181a('0x4c'),_0x237b0f);throw _0x237b0f;});}return _0x3a46b8;})['then'](respondWithResult(_0x22c93c,0xc9))['catch'](handleError(_0x22c93c,null));};exports[_0x181a('0x4d')]=function(_0x312c39,_0x453b9c){if(_0x312c39[_0x181a('0x45')]['id']){delete _0x312c39[_0x181a('0x45')]['id'];}return db[_0x181a('0x3c')][_0x181a('0x43')]({'where':{'id':_0x312c39['params']['id']}})['then'](handleEntityNotFound(_0x453b9c,null))[_0x181a('0x20')](saveUpdates(_0x312c39[_0x181a('0x45')],null))[_0x181a('0x20')](respondWithResult(_0x453b9c,null))[_0x181a('0x40')](handleError(_0x453b9c,null));};exports[_0x181a('0x1f')]=function(_0xaead67,_0x5b1fb8){return db[_0x181a('0x3c')][_0x181a('0x43')]({'where':{'id':_0xaead67[_0x181a('0x42')]['id']}})[_0x181a('0x20')](handleEntityNotFound(_0x5b1fb8,null))[_0x181a('0x20')](removeEntity(_0x5b1fb8,null))['catch'](handleError(_0x5b1fb8,null));};exports[_0x181a('0x4e')]=function(_0x57733c,_0x108611,_0xa98ee7){if(_0x57733c['body']['id']){delete _0x57733c[_0x181a('0x45')]['id'];}return db[_0x181a('0x3c')][_0x181a('0x43')]({'where':{'id':_0x57733c[_0x181a('0x42')]['id']}})['then'](handleEntityNotFound(_0x108611,null))[_0x181a('0x20')](function(_0x3c602e){if(_0x3c602e){_0x57733c[_0x181a('0x45')][_0x181a('0x4f')]=_0x3c602e['id'];return db[_0x181a('0x3c')][_0x181a('0x44')](_0x57733c[_0x181a('0x45')]);}})[_0x181a('0x20')](respondWithResult(_0x108611,null))[_0x181a('0x40')](handleError(_0x108611,null));};exports['getIntervals']=function(_0x734459,_0x28483b,_0x3c4f20){var _0x9cdfb6={};var _0x4cbd27={};var _0x51ed30;var _0x4743c3;return db[_0x181a('0x3c')]['findOne']({'where':{'id':_0x734459[_0x181a('0x42')]['id']}})['then'](handleEntityNotFound(_0x28483b,null))[_0x181a('0x20')](function(_0x3af071){if(_0x3af071){_0x51ed30=_0x3af071;_0x4cbd27['model']=_[_0x181a('0x2f')](db[_0x181a('0x3c')][_0x181a('0x2a')]);_0x4cbd27[_0x181a('0x2e')]=_[_0x181a('0x2f')](_0x734459['query']);_0x4cbd27[_0x181a('0x30')]=_[_0x181a('0x31')](_0x4cbd27[_0x181a('0x2d')],_0x4cbd27[_0x181a('0x2e')]);_0x9cdfb6[_0x181a('0x32')]=_[_0x181a('0x31')](_0x4cbd27[_0x181a('0x2d')],qs[_0x181a('0x33')](_0x734459['query'][_0x181a('0x33')]));_0x9cdfb6[_0x181a('0x32')]=_0x9cdfb6[_0x181a('0x32')][_0x181a('0x34')]?_0x9cdfb6[_0x181a('0x32')]:_0x4cbd27[_0x181a('0x2d')];_0x9cdfb6[_0x181a('0x36')]=qs[_0x181a('0x50')](_0x734459[_0x181a('0x2e')][_0x181a('0x50')]);_0x9cdfb6['where']=qs[_0x181a('0x30')](_['pick'](_0x734459[_0x181a('0x2e')],_0x4cbd27[_0x181a('0x30')]));if(_0x734459['query'][_0x181a('0x38')]){_0x9cdfb6['where']=_[_0x181a('0x3a')](_0x9cdfb6[_0x181a('0x39')],{'$or':_[_0x181a('0x29')](_0x9cdfb6[_0x181a('0x32')],function(_0x197e9b){var _0x7a36a1={};_0x7a36a1[_0x197e9b]={'$like':'%'+_0x734459[_0x181a('0x2e')]['filter']+'%'};return _0x7a36a1;})});}_0x9cdfb6=_[_0x181a('0x3a')]({},_0x9cdfb6,_0x734459[_0x181a('0x3b')]);return _0x51ed30[_0x181a('0x51')](_0x9cdfb6);}})['then'](function(_0x27a557){if(_0x27a557){_0x4743c3=_0x27a557[_0x181a('0x34')];if(!_0x734459[_0x181a('0x2e')][_0x181a('0x35')](_0x181a('0x52'))){_0x9cdfb6['limit']=qs[_0x181a('0x1a')](_0x734459[_0x181a('0x2e')][_0x181a('0x1a')]);_0x9cdfb6['offset']=qs[_0x181a('0x1c')](_0x734459[_0x181a('0x2e')][_0x181a('0x1c')]);}return _0x51ed30[_0x181a('0x51')](_0x9cdfb6);}})[_0x181a('0x20')](function(_0x32edea){if(_0x32edea){return _0x32edea?{'count':_0x4743c3,'rows':_0x32edea}:null;}})['then'](respondWithResult(_0x28483b,null))['catch'](handleError(_0x28483b,null));};exports[_0x181a('0x53')]=function(_0x3f192e,_0x5101e0,_0x935af0){return db['Interval'][_0x181a('0x54')]({'where':{'id':_0x3f192e[_0x181a('0x42')]['id']}})[_0x181a('0x20')](handleEntityNotFound(_0x5101e0,null))[_0x181a('0x20')](function(_0x3ca509){if(_0x3ca509){return db[_0x181a('0x55')][_0x181a('0x56')](function(_0x1424ae){return db[_0x181a('0x3c')][_0x181a('0x1f')]({'where':{'IntervalId':_0x3f192e['params']['id']},'transaction':_0x1424ae})['then'](function(_0x2e6c5b){var _0x51f8b3=_[_0x181a('0x29')](_0x3f192e[_0x181a('0x45')],function(_0x172902){delete _0x172902['id'];_0x172902[_0x181a('0x4f')]=_0x3f192e['params']['id'];return _0x172902;});return db['Interval'][_0x181a('0x57')](_0x51f8b3,{'transaction':_0x1424ae});});})[_0x181a('0x20')](function(){return db[_0x181a('0x3c')]['findAll']({'where':{'IntervalId':_0x3f192e[_0x181a('0x42')]['id']}});});}})[_0x181a('0x20')](respondWithResult(_0x5101e0,null))[_0x181a('0x40')](handleError(_0x5101e0,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 908f64b..0d55c54 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 _0x600a=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./interval.attributes','../../components/extensions/rewrite','exports','define','Interval','tools_intervals','rewrite','util'];(function(_0x3b9c02,_0x24655d){var _0x2bc33e=function(_0x5786b7){while(--_0x5786b7){_0x3b9c02['push'](_0x3b9c02['shift']());}};_0x2bc33e(++_0x24655d);}(_0x600a,0xe0));var _0xa600=function(_0x209fcd,_0x1ecccc){_0x209fcd=_0x209fcd-0x0;var _0x501d5e=_0x600a[_0x209fcd];return _0x501d5e;};'use strict';var _=require('lodash');var util=require(_0xa600('0x0'));var logger=require('../../config/logger')(_0xa600('0x1'));var moment=require(_0xa600('0x2'));var BPromise=require(_0xa600('0x3'));var rp=require(_0xa600('0x4'));var fs=require('fs');var path=require(_0xa600('0x5'));var rimraf=require(_0xa600('0x6'));var config=require(_0xa600('0x7'));var attributes=require(_0xa600('0x8'));var extensions=require(_0xa600('0x9'));module[_0xa600('0xa')]=function(_0x33d062,_0x4dfc17){return _0x33d062[_0xa600('0xb')](_0xa600('0xc'),attributes,{'tableName':_0xa600('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x58fb7a,_0x1bedac){extensions[_0xa600('0xe')](_0x33d062,_0x58fb7a);},'afterBulkCreate':function(_0x298c43,_0x29ecd8,_0x1ea8bb){_0x1ea8bb();extensions[_0xa600('0xe')](_0x33d062,_0x298c43[0x0]);},'afterUpdate':function(_0x2fbe99,_0x5ee943){extensions['rewrite'](_0x33d062,_0x2fbe99);},'afterDestroy':function(_0x394e00,_0x158c3a){extensions['rewrite'](_0x33d062,_0x394e00);}}});}; \ No newline at end of file +var _0x32c2=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','../../components/extensions/rewrite','exports','define','Interval','tools_intervals','rewrite','lodash','util'];(function(_0x311909,_0x414bf7){var _0x8d3163=function(_0x226f55){while(--_0x226f55){_0x311909['push'](_0x311909['shift']());}};_0x8d3163(++_0x414bf7);}(_0x32c2,0x1c0));var _0x232c=function(_0xefb203,_0x253b72){_0xefb203=_0xefb203-0x0;var _0x1bf1bd=_0x32c2[_0xefb203];return _0x1bf1bd;};'use strict';var _=require(_0x232c('0x0'));var util=require(_0x232c('0x1'));var logger=require(_0x232c('0x2'))(_0x232c('0x3'));var moment=require(_0x232c('0x4'));var BPromise=require(_0x232c('0x5'));var rp=require(_0x232c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x232c('0x7'));var config=require(_0x232c('0x8'));var attributes=require('./interval.attributes');var extensions=require(_0x232c('0x9'));module[_0x232c('0xa')]=function(_0x5f4107,_0x310bbf){return _0x5f4107[_0x232c('0xb')](_0x232c('0xc'),attributes,{'tableName':_0x232c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x16cb66,_0x4c7083){extensions['rewrite'](_0x5f4107,_0x16cb66);},'afterBulkCreate':function(_0x2546f1,_0x16849e,_0x22c8cc){_0x22c8cc();extensions[_0x232c('0xe')](_0x5f4107,_0x2546f1[0x0]);},'afterUpdate':function(_0x4b35ae,_0x5639ef){extensions[_0x232c('0xe')](_0x5f4107,_0x4b35ae);},'afterDestroy':function(_0x567faa,_0x30a3ee){extensions[_0x232c('0xe')](_0x5f4107,_0x567faa);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index fc4e2d4..2cd2629 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(_0x5d9867,_0x5e9030){var _0x7d2118=function(_0x2e5149){while(--_0x2e5149){_0x5d9867['push'](_0x5d9867['shift']());}};_0x7d2118(++_0x5e9030);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'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(_0x209bbf,_0x2e2375){var _0x592d4b=function(_0x419947){while(--_0x419947){_0x209bbf['push'](_0x209bbf['shift']());}};_0x592d4b(++_0x2e2375);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'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 1bec397..23e5c4a 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(_0x18b349,_0x1b285d){var _0xa23b92=function(_0x187011){while(--_0x187011){_0x18b349['push'](_0x18b349['shift']());}};_0xa23b92(++_0x1b285d);}(_0x2032,0xd9));var _0x2203=function(_0x4daaad,_0x1aaca3){_0x4daaad=_0x4daaad-0x0;var _0x46592a=_0x2032[_0x4daaad];return _0x46592a;};'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 _0xb10b=['./jira.controller','post','send','exports','express','../../components/auth/service'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0xb10b,0x12a));var _0xbb10=function(_0x21dd50,_0x921f70){_0x21dd50=_0x21dd50-0x0;var _0x1b7d5e=_0xb10b[_0x21dd50];return _0x1b7d5e;};'use strict';var express=require(_0xbb10('0x0'));var router=express['Router']();var auth=require(_0xbb10('0x1'));var controller=require(_0xbb10('0x2'));router[_0xbb10('0x3')]('/',auth['isAuthenticated'](),controller[_0xbb10('0x4')]);module[_0xbb10('0x5')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index aeb2d6b..7583c3b 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 _0x0422=['x-forwarded-for','connection','remoteAddress','socket','https','../../config/logger','support','key','summary','Report','\x20from\x20','description','stringify','issuetype','fields','customfield_11500','email','customfield_11501','customfield_11502','newToken','customfield_11503','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','toString','base64','request','setEncoding','utf8','data','end','status','statusCode','parse','error','json','api.jira','write','send','body','headers'];(function(_0x228a23,_0x241972){var _0x56d2fc=function(_0x769e32){while(--_0x769e32){_0x228a23['push'](_0x228a23['shift']());}};_0x56d2fc(++_0x241972);}(_0x0422,0x15c));var _0x2042=function(_0x27604f,_0x5ae336){_0x27604f=_0x27604f-0x0;var _0x40d189=_0x0422[_0x27604f];return _0x40d189;};'use strict';var BPromise=require('bluebird');var https=require(_0x2042('0x0'));var logger=require(_0x2042('0x1'))('api');var USERNAME=_0x2042('0x2');var PASSWORD='3eAmWpBVP0';function openIssue(_0x32c2ed,_0x22deb4){var _0x1e0741={'fields':{'project':{'key':_0x32c2ed[_0x2042('0x3')]||'MOTGUI'},'summary':(_0x32c2ed[_0x2042('0x4')]||_0x2042('0x5'))+_0x2042('0x6')+_0x32c2ed['ip'],'description':_0x32c2ed[_0x2042('0x7')]||JSON[_0x2042('0x8')](_0x32c2ed),'issuetype':{'name':_0x32c2ed[_0x2042('0x9')]||'Bug'}}};_0x1e0741[_0x2042('0xa')][_0x2042('0xb')]=_0x32c2ed[_0x2042('0xc')];_0x1e0741[_0x2042('0xa')][_0x2042('0xd')]=_0x32c2ed['oldToken'];_0x1e0741[_0x2042('0xa')][_0x2042('0xe')]=_0x32c2ed[_0x2042('0xf')];_0x1e0741[_0x2042('0xa')][_0x2042('0x10')]=_0x32c2ed['name'];_0x1e0741['fields'][_0x2042('0x11')]=_0x32c2ed[_0x2042('0x12')];_0x1e0741[_0x2042('0xa')][_0x2042('0x13')]=_0x32c2ed['ip'];var _0x276703={'host':_0x2042('0x14'),'port':0x1bb,'path':_0x2042('0x15'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)[_0x2042('0x16')](_0x2042('0x17'))}};var _0x5bd7a8=JSON[_0x2042('0x8')](_0x1e0741);var _0x433049=https[_0x2042('0x18')](_0x276703,function(_0x3d5201){_0x3d5201[_0x2042('0x19')](_0x2042('0x1a'));var _0x47f711='';_0x3d5201['on'](_0x2042('0x1b'),function(_0x10638a){_0x47f711+=_0x10638a;});_0x3d5201['on'](_0x2042('0x1c'),function(){if(_0x22deb4){return _0x22deb4[_0x2042('0x1d')](_0x3d5201[_0x2042('0x1e')])['json'](JSON[_0x2042('0x1f')](_0x47f711));}});});_0x433049['on'](_0x2042('0x20'),function(_0x3d81bb){if(_0x22deb4){return _0x22deb4[_0x2042('0x1d')](0x1f4)[_0x2042('0x21')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0x2042('0x22')}]});}});_0x433049[_0x2042('0x23')](_0x5bd7a8);_0x433049[_0x2042('0x1c')]();}exports['openIssue']=openIssue;exports[_0x2042('0x24')]=function(_0x1d0625,_0x8c1c99){_0x1d0625[_0x2042('0x25')]['ip']=_0x1d0625[_0x2042('0x26')][_0x2042('0x27')]||_0x1d0625[_0x2042('0x28')][_0x2042('0x29')]||_0x1d0625[_0x2042('0x2a')][_0x2042('0x29')]||_0x1d0625['connection'][_0x2042('0x2a')][_0x2042('0x29')];return openIssue(_0x1d0625[_0x2042('0x25')],_0x8c1c99);}; \ No newline at end of file +var _0x81ff=['Bug','fields','customfield_11500','email','oldToken','customfield_11502','newToken','name','customfield_11504','customfield_10102','track.xcallymotion.com','POST','Basic\x20','base64','request','setEncoding','end','status','statusCode','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','send','connection','remoteAddress','socket','body','bluebird','https','../../config/logger','api','support','3eAmWpBVP0','key','MOTGUI','\x20from\x20','stringify'];(function(_0x4b49c9,_0x290d55){var _0xab2d67=function(_0x3a8e9c){while(--_0x3a8e9c){_0x4b49c9['push'](_0x4b49c9['shift']());}};_0xab2d67(++_0x290d55);}(_0x81ff,0xb9));var _0xf81f=function(_0x28e53a,_0x266519){_0x28e53a=_0x28e53a-0x0;var _0x1caa4a=_0x81ff[_0x28e53a];return _0x1caa4a;};'use strict';var BPromise=require(_0xf81f('0x0'));var https=require(_0xf81f('0x1'));var logger=require(_0xf81f('0x2'))(_0xf81f('0x3'));var USERNAME=_0xf81f('0x4');var PASSWORD=_0xf81f('0x5');function openIssue(_0x13bd31,_0x27c409){var _0x2244d8={'fields':{'project':{'key':_0x13bd31[_0xf81f('0x6')]||_0xf81f('0x7')},'summary':(_0x13bd31['summary']||'Report')+_0xf81f('0x8')+_0x13bd31['ip'],'description':_0x13bd31['description']||JSON[_0xf81f('0x9')](_0x13bd31),'issuetype':{'name':_0x13bd31['issuetype']||_0xf81f('0xa')}}};_0x2244d8[_0xf81f('0xb')][_0xf81f('0xc')]=_0x13bd31[_0xf81f('0xd')];_0x2244d8[_0xf81f('0xb')]['customfield_11501']=_0x13bd31[_0xf81f('0xe')];_0x2244d8[_0xf81f('0xb')][_0xf81f('0xf')]=_0x13bd31[_0xf81f('0x10')];_0x2244d8[_0xf81f('0xb')]['customfield_11503']=_0x13bd31[_0xf81f('0x11')];_0x2244d8[_0xf81f('0xb')][_0xf81f('0x12')]=_0x13bd31['reason'];_0x2244d8[_0xf81f('0xb')][_0xf81f('0x13')]=_0x13bd31['ip'];var _0x54e17d={'host':_0xf81f('0x14'),'port':0x1bb,'path':'/rest/api/2/issue','method':_0xf81f('0x15'),'timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':_0xf81f('0x16')+new Buffer(USERNAME+':'+PASSWORD)['toString'](_0xf81f('0x17'))}};var _0x31b47c=JSON[_0xf81f('0x9')](_0x2244d8);var _0x500498=https[_0xf81f('0x18')](_0x54e17d,function(_0x798dae){_0x798dae[_0xf81f('0x19')]('utf8');var _0x54481a='';_0x798dae['on']('data',function(_0x2abd8d){_0x54481a+=_0x2abd8d;});_0x798dae['on'](_0xf81f('0x1a'),function(){if(_0x27c409){return _0x27c409[_0xf81f('0x1b')](_0x798dae[_0xf81f('0x1c')])[_0xf81f('0x1d')](JSON[_0xf81f('0x1e')](_0x54481a));}});});_0x500498['on'](_0xf81f('0x1f'),function(_0x737557){if(_0x27c409){return _0x27c409['status'](0x1f4)['json']({'errors':[{'message':_0xf81f('0x20'),'type':_0xf81f('0x21')}]});}});_0x500498['write'](_0x31b47c);_0x500498[_0xf81f('0x1a')]();}exports['openIssue']=openIssue;exports[_0xf81f('0x22')]=function(_0x28d7fe,_0x129b93){_0x28d7fe['body']['ip']=_0x28d7fe['headers']['x-forwarded-for']||_0x28d7fe[_0xf81f('0x23')][_0xf81f('0x24')]||_0x28d7fe['socket'][_0xf81f('0x24')]||_0x28d7fe['connection'][_0xf81f('0x25')]['remoteAddress'];return openIssue(_0x28d7fe[_0xf81f('0x26')],_0x129b93);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 456185c..f2facef 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 _0x3c81=['index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','multer','util','connect-timeout','express','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated'];(function(_0xee7f65,_0x4ff021){var _0x5449bc=function(_0x8090e2){while(--_0x8090e2){_0xee7f65['push'](_0xee7f65['shift']());}};_0x5449bc(++_0x4ff021);}(_0x3c81,0x102));var _0x13c8=function(_0x3901bb,_0x5a6fdc){_0x3901bb=_0x3901bb-0x0;var _0x4778e1=_0x3c81[_0x3901bb];return _0x4778e1;};'use strict';var multer=require(_0x13c8('0x0'));var util=require(_0x13c8('0x1'));var path=require('path');var timeout=require(_0x13c8('0x2'));var express=require(_0x13c8('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(_0x13c8('0x4'));var controller=require(_0x13c8('0x5'));router[_0x13c8('0x6')]('/',auth[_0x13c8('0x7')](),controller[_0x13c8('0x8')]);router[_0x13c8('0x6')](_0x13c8('0x9'),auth['isAuthenticated'](),controller[_0x13c8('0xa')]);router['get'](_0x13c8('0xb'),auth[_0x13c8('0x7')](),controller[_0x13c8('0xc')]);router[_0x13c8('0xd')]('/',auth[_0x13c8('0x7')](),controller[_0x13c8('0xe')]);router[_0x13c8('0xf')](_0x13c8('0xb'),auth[_0x13c8('0x7')](),controller[_0x13c8('0x10')]);router[_0x13c8('0x11')](_0x13c8('0xb'),auth[_0x13c8('0x7')](),controller[_0x13c8('0x12')]);module['exports']=router; \ No newline at end of file +var _0xf4eb=['./jscriptyAnswerReport.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','exports','multer','Router','../../components/interaction/service','../../config/environment'];(function(_0x316ca6,_0x1b1764){var _0x56ca34=function(_0x59f395){while(--_0x59f395){_0x316ca6['push'](_0x316ca6['shift']());}};_0x56ca34(++_0x1b1764);}(_0xf4eb,0xec));var _0xbf4e=function(_0x3dfab7,_0x320db5){_0x3dfab7=_0x3dfab7-0x0;var _0x3fdfc9=_0xf4eb[_0x3dfab7];return _0x3fdfc9;};'use strict';var multer=require(_0xbf4e('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbf4e('0x1')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xbf4e('0x2'));var config=require(_0xbf4e('0x3'));var controller=require(_0xbf4e('0x4'));router[_0xbf4e('0x5')]('/',auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x7')]);router[_0xbf4e('0x5')]('/describe',auth[_0xbf4e('0x6')](),controller['describe']);router['get'](_0xbf4e('0x8'),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x9')]);router[_0xbf4e('0xa')]('/',auth[_0xbf4e('0x6')](),controller[_0xbf4e('0xb')]);router[_0xbf4e('0xc')]('/:id',auth['isAuthenticated'](),controller[_0xbf4e('0xd')]);router['delete'](_0xbf4e('0x8'),auth[_0xbf4e('0x6')](),controller['destroy']);module[_0xbf4e('0xe')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index e8ddb78..d789996 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(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x7a54,0x106));var _0x47a5=function(_0xb48924,_0x1365c3){_0xb48924=_0xb48924-0x0;var _0x336e56=_0x7a54[_0xb48924];return _0x336e56;};'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(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x7a54,0x106));var _0x47a5=function(_0xeec77,_0x51c330){_0xeec77=_0xeec77-0x0;var _0x44ddc7=_0x7a54[_0xeec77];return _0x44ddc7;};'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 80e8bb8..c51c95b 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 _0x3435=['filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','JscriptyAnswerReport','count','includeAll','include','findAll','catch','params','rawAttributes','length','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','reject','save','update','then','destroy','stack','send','map','fieldName','type','key','name','query','keys'];(function(_0x27ac27,_0x4ed567){var _0x1b077c=function(_0x2df079){while(--_0x2df079){_0x27ac27['push'](_0x27ac27['shift']());}};_0x1b077c(++_0x4ed567);}(_0x3435,0xfa));var _0x5343=function(_0x1a72f3,_0x217011){_0x1a72f3=_0x1a72f3-0x0;var _0x57ef47=_0x3435[_0x1a72f3];return _0x57ef47;};'use strict';var emlformat=require(_0x5343('0x0'));var rimraf=require(_0x5343('0x1'));var zipdir=require(_0x5343('0x2'));var jsonpatch=require(_0x5343('0x3'));var rp=require(_0x5343('0x4'));var moment=require(_0x5343('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x5343('0x6'));var util=require(_0x5343('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x5343('0x8'));var ejs=require(_0x5343('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5343('0xa'));var crypto=require(_0x5343('0xb'));var jsforce=require(_0x5343('0xc'));var deskjs=require(_0x5343('0xd'));var toCsv=require(_0x5343('0x8'));var querystring=require('querystring');var Papa=require(_0x5343('0xe'));var Redis=require('ioredis');var authService=require(_0x5343('0xf'));var qs=require(_0x5343('0x10'));var as=require(_0x5343('0x11'));var hardwareService=require(_0x5343('0x12'));var logger=require(_0x5343('0x13'))('api');var utils=require(_0x5343('0x14'));var config=require(_0x5343('0x15'));var licenseUtil=require(_0x5343('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2ddeb7,_0x5f473f){_0x5f473f=_0x5f473f||0xcc;return function(_0x82074d){if(_0x82074d){return _0x2ddeb7[_0x5343('0x17')](_0x5f473f);}return _0x2ddeb7['status'](_0x5f473f)[_0x5343('0x18')]();};}function respondWithResult(_0x4cdfae,_0x13066f){_0x13066f=_0x13066f||0xc8;return function(_0x46c3d7){if(_0x46c3d7){return _0x4cdfae[_0x5343('0x19')](_0x13066f)[_0x5343('0x1a')](_0x46c3d7);}};}function respondWithFilteredResult(_0x4dbff1,_0x446e90){return function(_0x588a96){if(_0x588a96){var _0x1df724=typeof _0x446e90[_0x5343('0x1b')]===_0x5343('0x1c')&&typeof _0x446e90[_0x5343('0x1d')]===_0x5343('0x1c');var _0x4b5852=_0x588a96['count'];var _0x432992=_0x1df724?0x0:_0x446e90[_0x5343('0x1b')];var _0x1f5098=_0x1df724?_0x588a96['count']:_0x446e90[_0x5343('0x1b')]+_0x446e90[_0x5343('0x1d')];var _0x376c35;if(_0x1f5098>=_0x4b5852){_0x1f5098=_0x4b5852;_0x376c35=0xc8;}else{_0x376c35=0xce;}_0x4dbff1[_0x5343('0x19')](_0x376c35);return _0x4dbff1[_0x5343('0x1e')](_0x5343('0x1f'),_0x432992+'-'+_0x1f5098+'/'+_0x4b5852)[_0x5343('0x1a')](_0x588a96);}return null;};}function patchUpdates(_0x40ba38){return function(_0x35d41d){try{jsonpatch['apply'](_0x35d41d,_0x40ba38,!![]);}catch(_0x287304){return BPromise[_0x5343('0x20')](_0x287304);}return _0x35d41d[_0x5343('0x21')]();};}function saveUpdates(_0x42f92d,_0xd95a5b){return function(_0x4e7c0f){if(_0x4e7c0f){return _0x4e7c0f[_0x5343('0x22')](_0x42f92d)[_0x5343('0x23')](function(_0x24c250){return _0x24c250;});}return null;};}function removeEntity(_0x380aae,_0x290ce8){return function(_0x486597){if(_0x486597){return _0x486597[_0x5343('0x24')]()[_0x5343('0x23')](function(){_0x380aae['status'](0xcc)[_0x5343('0x18')]();});}};}function handleEntityNotFound(_0x96bbf6,_0x1ab5eb){return function(_0x5e4344){if(!_0x5e4344){_0x96bbf6['sendStatus'](0x194);}return _0x5e4344;};}function handleError(_0x462cb6,_0x5871de){_0x5871de=_0x5871de||0x1f4;return function(_0x14d05a){logger['error'](_0x14d05a[_0x5343('0x25')]);if(_0x14d05a['name']){delete _0x14d05a['name'];}_0x462cb6[_0x5343('0x19')](_0x5871de)[_0x5343('0x26')](_0x14d05a);};}exports['index']=function(_0x5d597e,_0x1202bb){var _0x5d0853={},_0x2ed8c9={},_0x47d49a={'count':0x0,'rows':[]};var _0x5c689e=_[_0x5343('0x27')](db['JscriptyAnswerReport']['rawAttributes'],function(_0x125e4c){return{'name':_0x125e4c[_0x5343('0x28')],'type':_0x125e4c[_0x5343('0x29')][_0x5343('0x2a')]};});_0x2ed8c9['model']=_['map'](_0x5c689e,_0x5343('0x2b'));_0x2ed8c9[_0x5343('0x2c')]=_[_0x5343('0x2d')](_0x5d597e[_0x5343('0x2c')]);_0x2ed8c9[_0x5343('0x2e')]=_[_0x5343('0x2f')](_0x2ed8c9[_0x5343('0x30')],_0x2ed8c9[_0x5343('0x2c')]);_0x5d0853[_0x5343('0x31')]=_[_0x5343('0x2f')](_0x2ed8c9[_0x5343('0x30')],qs[_0x5343('0x32')](_0x5d597e['query']['fields']));_0x5d0853[_0x5343('0x31')]=_0x5d0853[_0x5343('0x31')]['length']?_0x5d0853[_0x5343('0x31')]:_0x2ed8c9['model'];if(!_0x5d597e[_0x5343('0x2c')][_0x5343('0x33')](_0x5343('0x34'))){_0x5d0853[_0x5343('0x1d')]=qs['limit'](_0x5d597e['query'][_0x5343('0x1d')]);_0x5d0853['offset']=qs[_0x5343('0x1b')](_0x5d597e[_0x5343('0x2c')]['offset']);}_0x5d0853[_0x5343('0x35')]=qs['sort'](_0x5d597e['query'][_0x5343('0x36')]);_0x5d0853[_0x5343('0x37')]=qs[_0x5343('0x2e')](_[_0x5343('0x38')](_0x5d597e['query'],_0x2ed8c9['filters']),_0x5c689e);if(_0x5d597e['query']['filter']){_0x5d0853[_0x5343('0x37')]=_[_0x5343('0x39')](_0x5d0853[_0x5343('0x37')],{'$or':_[_0x5343('0x27')](_0x5c689e,function(_0x3c517a){if(_0x3c517a[_0x5343('0x29')]!==_0x5343('0x3a')){var _0x4d2951={};_0x4d2951[_0x3c517a[_0x5343('0x2b')]]={'$like':'%'+_0x5d597e['query'][_0x5343('0x3b')]+'%'};return _0x4d2951;}})});}_0x5d0853=_[_0x5343('0x39')]({},_0x5d0853,_0x5d597e[_0x5343('0x3c')]);var _0x2f004a={'where':_0x5d0853[_0x5343('0x37')]};return db[_0x5343('0x3d')][_0x5343('0x3e')](_0x2f004a)['then'](function(_0xb93d9){_0x47d49a['count']=_0xb93d9;if(_0x5d597e[_0x5343('0x2c')][_0x5343('0x3f')]){_0x5d0853[_0x5343('0x40')]=[{'all':!![]}];}return db[_0x5343('0x3d')][_0x5343('0x41')](_0x5d0853);})[_0x5343('0x23')](function(_0x2c75bd){_0x47d49a['rows']=_0x2c75bd;return _0x47d49a;})[_0x5343('0x23')](respondWithFilteredResult(_0x1202bb,_0x5d0853))[_0x5343('0x42')](handleError(_0x1202bb,null));};exports['show']=function(_0x41df61,_0x16c880){var _0x4c576d={'raw':!![],'where':{'id':_0x41df61[_0x5343('0x43')]['id']}},_0x53c3c7={};_0x53c3c7[_0x5343('0x30')]=_[_0x5343('0x2d')](db['JscriptyAnswerReport'][_0x5343('0x44')]);_0x53c3c7[_0x5343('0x2c')]=_[_0x5343('0x2d')](_0x41df61[_0x5343('0x2c')]);_0x53c3c7[_0x5343('0x2e')]=_[_0x5343('0x2f')](_0x53c3c7[_0x5343('0x30')],_0x53c3c7['query']);_0x4c576d[_0x5343('0x31')]=_[_0x5343('0x2f')](_0x53c3c7[_0x5343('0x30')],qs[_0x5343('0x32')](_0x41df61[_0x5343('0x2c')][_0x5343('0x32')]));_0x4c576d[_0x5343('0x31')]=_0x4c576d[_0x5343('0x31')][_0x5343('0x45')]?_0x4c576d[_0x5343('0x31')]:_0x53c3c7[_0x5343('0x30')];if(_0x41df61[_0x5343('0x2c')][_0x5343('0x3f')]){_0x4c576d[_0x5343('0x40')]=[{'all':!![]}];}_0x4c576d=_[_0x5343('0x39')]({},_0x4c576d,_0x41df61['options']);return db[_0x5343('0x3d')][_0x5343('0x46')](_0x4c576d)['then'](handleEntityNotFound(_0x16c880,null))[_0x5343('0x23')](respondWithResult(_0x16c880,null))[_0x5343('0x42')](handleError(_0x16c880,null));};exports[_0x5343('0x47')]=function(_0x1da1b7,_0x194316){return db['JscriptyAnswerReport'][_0x5343('0x47')](_0x1da1b7['body'],{})['then'](respondWithResult(_0x194316,0xc9))[_0x5343('0x42')](handleError(_0x194316,null));};exports[_0x5343('0x22')]=function(_0x10329c,_0x1cd4ed){if(_0x10329c['body']['id']){delete _0x10329c[_0x5343('0x48')]['id'];}return db[_0x5343('0x3d')][_0x5343('0x46')]({'where':{'id':_0x10329c[_0x5343('0x43')]['id']}})[_0x5343('0x23')](handleEntityNotFound(_0x1cd4ed,null))[_0x5343('0x23')](saveUpdates(_0x10329c[_0x5343('0x48')],null))[_0x5343('0x23')](respondWithResult(_0x1cd4ed,null))[_0x5343('0x42')](handleError(_0x1cd4ed,null));};exports[_0x5343('0x24')]=function(_0x566d71,_0x1cbf7c){return db[_0x5343('0x3d')][_0x5343('0x46')]({'where':{'id':_0x566d71[_0x5343('0x43')]['id']}})[_0x5343('0x23')](handleEntityNotFound(_0x1cbf7c,null))[_0x5343('0x23')](removeEntity(_0x1cbf7c,null))[_0x5343('0x42')](handleError(_0x1cbf7c,null));};exports[_0x5343('0x49')]=function(_0x3b3c64,_0xad51f4){return db['JscriptyAnswerReport'][_0x5343('0x49')]()['then'](respondWithResult(_0xad51f4,null))['catch'](handleError(_0xad51f4,null));}; \ No newline at end of file +var _0x42b0=['update','destroy','then','stack','name','send','index','JscriptyAnswerReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','count','include','rows','catch','show','params','includeAll','create','body','find','describe','eml-format','rimraf','fast-json-patch','moment','util','path','sox','to-csv','ejs','squel','crypto','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','set','apply','reject','save'];(function(_0x12f502,_0x17b594){var _0x8dd5e5=function(_0x5259e3){while(--_0x5259e3){_0x12f502['push'](_0x12f502['shift']());}};_0x8dd5e5(++_0x17b594);}(_0x42b0,0xbc));var _0x042b=function(_0x43e53b,_0xc4f07c){_0x43e53b=_0x43e53b-0x0;var _0x5deb08=_0x42b0[_0x43e53b];return _0x5deb08;};'use strict';var emlformat=require(_0x042b('0x0'));var rimraf=require(_0x042b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x042b('0x2'));var rp=require('request-promise');var moment=require(_0x042b('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x042b('0x4'));var path=require(_0x042b('0x5'));var sox=require(_0x042b('0x6'));var csv=require(_0x042b('0x7'));var ejs=require(_0x042b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x042b('0x9'));var crypto=require(_0x042b('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x042b('0x7'));var querystring=require('querystring');var Papa=require(_0x042b('0xb'));var Redis=require('ioredis');var authService=require(_0x042b('0xc'));var qs=require(_0x042b('0xd'));var as=require(_0x042b('0xe'));var hardwareService=require(_0x042b('0xf'));var logger=require(_0x042b('0x10'))(_0x042b('0x11'));var utils=require(_0x042b('0x12'));var config=require(_0x042b('0x13'));var licenseUtil=require(_0x042b('0x14'));var db=require(_0x042b('0x15'))['db'];function respondWithStatusCode(_0x2c0a6f,_0x35414e){_0x35414e=_0x35414e||0xcc;return function(_0x950ed9){if(_0x950ed9){return _0x2c0a6f['sendStatus'](_0x35414e);}return _0x2c0a6f[_0x042b('0x16')](_0x35414e)['end']();};}function respondWithResult(_0x1e5626,_0x5681bd){_0x5681bd=_0x5681bd||0xc8;return function(_0x31c22e){if(_0x31c22e){return _0x1e5626[_0x042b('0x16')](_0x5681bd)[_0x042b('0x17')](_0x31c22e);}};}function respondWithFilteredResult(_0xf9f4f3,_0x30c86f){return function(_0x183225){if(_0x183225){var _0x4dc4a6=typeof _0x30c86f[_0x042b('0x18')]===_0x042b('0x19')&&typeof _0x30c86f[_0x042b('0x1a')]===_0x042b('0x19');var _0x1e4eee=_0x183225['count'];var _0x2e2cb6=_0x4dc4a6?0x0:_0x30c86f[_0x042b('0x18')];var _0x4b5c25=_0x4dc4a6?_0x183225['count']:_0x30c86f[_0x042b('0x18')]+_0x30c86f[_0x042b('0x1a')];var _0x561d06;if(_0x4b5c25>=_0x1e4eee){_0x4b5c25=_0x1e4eee;_0x561d06=0xc8;}else{_0x561d06=0xce;}_0xf9f4f3[_0x042b('0x16')](_0x561d06);return _0xf9f4f3[_0x042b('0x1b')]('Content-Range',_0x2e2cb6+'-'+_0x4b5c25+'/'+_0x1e4eee)['json'](_0x183225);}return null;};}function patchUpdates(_0x5e6d8a){return function(_0x4eec67){try{jsonpatch[_0x042b('0x1c')](_0x4eec67,_0x5e6d8a,!![]);}catch(_0x23c915){return BPromise[_0x042b('0x1d')](_0x23c915);}return _0x4eec67[_0x042b('0x1e')]();};}function saveUpdates(_0x336c40,_0x50be84){return function(_0x36fabf){if(_0x36fabf){return _0x36fabf[_0x042b('0x1f')](_0x336c40)['then'](function(_0x5bc416){return _0x5bc416;});}return null;};}function removeEntity(_0x434d21,_0x59af51){return function(_0x558889){if(_0x558889){return _0x558889[_0x042b('0x20')]()[_0x042b('0x21')](function(){_0x434d21['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3204fc,_0x2f6e67){return function(_0x3c5491){if(!_0x3c5491){_0x3204fc['sendStatus'](0x194);}return _0x3c5491;};}function handleError(_0xda0462,_0x45d2c6){_0x45d2c6=_0x45d2c6||0x1f4;return function(_0x1b1250){logger['error'](_0x1b1250[_0x042b('0x22')]);if(_0x1b1250[_0x042b('0x23')]){delete _0x1b1250['name'];}_0xda0462[_0x042b('0x16')](_0x45d2c6)[_0x042b('0x24')](_0x1b1250);};}exports[_0x042b('0x25')]=function(_0x39596c,_0x52e467){var _0x5b5fe7={},_0x572d6a={},_0x5c0c41={'count':0x0,'rows':[]};var _0x34bb9e=_['map'](db[_0x042b('0x26')][_0x042b('0x27')],function(_0xddc276){return{'name':_0xddc276[_0x042b('0x28')],'type':_0xddc276[_0x042b('0x29')][_0x042b('0x2a')]};});_0x572d6a[_0x042b('0x2b')]=_[_0x042b('0x2c')](_0x34bb9e,_0x042b('0x23'));_0x572d6a[_0x042b('0x2d')]=_[_0x042b('0x2e')](_0x39596c[_0x042b('0x2d')]);_0x572d6a[_0x042b('0x2f')]=_[_0x042b('0x30')](_0x572d6a[_0x042b('0x2b')],_0x572d6a[_0x042b('0x2d')]);_0x5b5fe7['attributes']=_[_0x042b('0x30')](_0x572d6a[_0x042b('0x2b')],qs[_0x042b('0x31')](_0x39596c[_0x042b('0x2d')][_0x042b('0x31')]));_0x5b5fe7[_0x042b('0x32')]=_0x5b5fe7['attributes'][_0x042b('0x33')]?_0x5b5fe7[_0x042b('0x32')]:_0x572d6a['model'];if(!_0x39596c[_0x042b('0x2d')][_0x042b('0x34')](_0x042b('0x35'))){_0x5b5fe7[_0x042b('0x1a')]=qs['limit'](_0x39596c[_0x042b('0x2d')][_0x042b('0x1a')]);_0x5b5fe7[_0x042b('0x18')]=qs[_0x042b('0x18')](_0x39596c[_0x042b('0x2d')]['offset']);}_0x5b5fe7[_0x042b('0x36')]=qs[_0x042b('0x37')](_0x39596c[_0x042b('0x2d')]['sort']);_0x5b5fe7[_0x042b('0x38')]=qs['filters'](_[_0x042b('0x39')](_0x39596c[_0x042b('0x2d')],_0x572d6a['filters']),_0x34bb9e);if(_0x39596c[_0x042b('0x2d')][_0x042b('0x3a')]){_0x5b5fe7['where']=_['merge'](_0x5b5fe7[_0x042b('0x38')],{'$or':_[_0x042b('0x2c')](_0x34bb9e,function(_0x4aa81d){if(_0x4aa81d[_0x042b('0x29')]!==_0x042b('0x3b')){var _0x1f38c2={};_0x1f38c2[_0x4aa81d['name']]={'$like':'%'+_0x39596c['query'][_0x042b('0x3a')]+'%'};return _0x1f38c2;}})});}_0x5b5fe7=_[_0x042b('0x3c')]({},_0x5b5fe7,_0x39596c[_0x042b('0x3d')]);var _0x296b35={'where':_0x5b5fe7['where']};return db['JscriptyAnswerReport'][_0x042b('0x3e')](_0x296b35)['then'](function(_0x220653){_0x5c0c41['count']=_0x220653;if(_0x39596c[_0x042b('0x2d')]['includeAll']){_0x5b5fe7[_0x042b('0x3f')]=[{'all':!![]}];}return db[_0x042b('0x26')]['findAll'](_0x5b5fe7);})[_0x042b('0x21')](function(_0x5471fa){_0x5c0c41[_0x042b('0x40')]=_0x5471fa;return _0x5c0c41;})['then'](respondWithFilteredResult(_0x52e467,_0x5b5fe7))[_0x042b('0x41')](handleError(_0x52e467,null));};exports[_0x042b('0x42')]=function(_0x1a9245,_0x4ee3a4){var _0x527f49={'raw':!![],'where':{'id':_0x1a9245[_0x042b('0x43')]['id']}},_0x1fb824={};_0x1fb824[_0x042b('0x2b')]=_[_0x042b('0x2e')](db[_0x042b('0x26')][_0x042b('0x27')]);_0x1fb824[_0x042b('0x2d')]=_[_0x042b('0x2e')](_0x1a9245[_0x042b('0x2d')]);_0x1fb824[_0x042b('0x2f')]=_['intersection'](_0x1fb824[_0x042b('0x2b')],_0x1fb824[_0x042b('0x2d')]);_0x527f49[_0x042b('0x32')]=_[_0x042b('0x30')](_0x1fb824['model'],qs['fields'](_0x1a9245[_0x042b('0x2d')]['fields']));_0x527f49[_0x042b('0x32')]=_0x527f49[_0x042b('0x32')][_0x042b('0x33')]?_0x527f49['attributes']:_0x1fb824[_0x042b('0x2b')];if(_0x1a9245[_0x042b('0x2d')][_0x042b('0x44')]){_0x527f49[_0x042b('0x3f')]=[{'all':!![]}];}_0x527f49=_[_0x042b('0x3c')]({},_0x527f49,_0x1a9245[_0x042b('0x3d')]);return db[_0x042b('0x26')]['find'](_0x527f49)[_0x042b('0x21')](handleEntityNotFound(_0x4ee3a4,null))['then'](respondWithResult(_0x4ee3a4,null))[_0x042b('0x41')](handleError(_0x4ee3a4,null));};exports[_0x042b('0x45')]=function(_0x533862,_0x37488a){return db[_0x042b('0x26')][_0x042b('0x45')](_0x533862[_0x042b('0x46')],{})[_0x042b('0x21')](respondWithResult(_0x37488a,0xc9))[_0x042b('0x41')](handleError(_0x37488a,null));};exports[_0x042b('0x1f')]=function(_0x476eda,_0x48fe3e){if(_0x476eda[_0x042b('0x46')]['id']){delete _0x476eda[_0x042b('0x46')]['id'];}return db[_0x042b('0x26')][_0x042b('0x47')]({'where':{'id':_0x476eda[_0x042b('0x43')]['id']}})['then'](handleEntityNotFound(_0x48fe3e,null))['then'](saveUpdates(_0x476eda['body'],null))[_0x042b('0x21')](respondWithResult(_0x48fe3e,null))[_0x042b('0x41')](handleError(_0x48fe3e,null));};exports[_0x042b('0x20')]=function(_0x396da4,_0x261c87){return db['JscriptyAnswerReport']['find']({'where':{'id':_0x396da4[_0x042b('0x43')]['id']}})['then'](handleEntityNotFound(_0x261c87,null))['then'](removeEntity(_0x261c87,null))[_0x042b('0x41')](handleError(_0x261c87,null));};exports['describe']=function(_0x15e46f,_0x170056){return db[_0x042b('0x26')][_0x042b('0x48')]()['then'](respondWithResult(_0x170056,null))[_0x042b('0x41')](handleError(_0x170056,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 9321fdc..ab78fcf 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 _0x75a4=['util','../../config/logger','moment','request-promise','rimraf','exports','define','JscriptyAnswerReport','report_jscripty_answers','lodash'];(function(_0x4e0fef,_0x41024e){var _0x6336cf=function(_0x33bfc9){while(--_0x33bfc9){_0x4e0fef['push'](_0x4e0fef['shift']());}};_0x6336cf(++_0x41024e);}(_0x75a4,0x81));var _0x475a=function(_0x4189c8,_0x5be762){_0x4189c8=_0x4189c8-0x0;var _0x25d483=_0x75a4[_0x4189c8];return _0x25d483;};'use strict';var _=require(_0x475a('0x0'));var util=require(_0x475a('0x1'));var logger=require(_0x475a('0x2'))('api');var moment=require(_0x475a('0x3'));var BPromise=require('bluebird');var rp=require(_0x475a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x475a('0x5'));var config=require('../../config/environment');var attributes=require('./jscriptyAnswerReport.attributes');module[_0x475a('0x6')]=function(_0x10b7fc,_0x414484){return _0x10b7fc[_0x475a('0x7')](_0x475a('0x8'),attributes,{'tableName':_0x475a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xde6f=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport','report_jscripty_answers'];(function(_0xb415fc,_0x5f4555){var _0x5d05ba=function(_0xab932e){while(--_0xab932e){_0xb415fc['push'](_0xb415fc['shift']());}};_0x5d05ba(++_0x5f4555);}(_0xde6f,0x84));var _0xfde6=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xde6f[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xfde6('0x0'))(_0xfde6('0x1'));var moment=require(_0xfde6('0x2'));var BPromise=require('bluebird');var rp=require(_0xfde6('0x3'));var fs=require('fs');var path=require(_0xfde6('0x4'));var rimraf=require(_0xfde6('0x5'));var config=require(_0xfde6('0x6'));var attributes=require(_0xfde6('0x7'));module[_0xfde6('0x8')]=function(_0x50d21a,_0x5628ea){return _0x50d21a[_0xfde6('0x9')](_0xfde6('0xa'),attributes,{'tableName':_0xfde6('0xb'),'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 f56a87c..ee14af7 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 _0xc424=['JscriptyAnswerReport,\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','jayson/promise','client','http','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent'];(function(_0x2081f1,_0x36e8ce){var _0x2ad889=function(_0x51ce96){while(--_0x51ce96){_0x2081f1['push'](_0x2081f1['shift']());}};_0x2ad889(++_0x36e8ce);}(_0xc424,0xbe));var _0x4c42=function(_0x3a81fd,_0x1237c0){_0x3a81fd=_0x3a81fd-0x0;var _0x126cca=_0xc424[_0x3a81fd];return _0x126cca;};'use strict';var _=require(_0x4c42('0x0'));var util=require(_0x4c42('0x1'));var moment=require(_0x4c42('0x2'));var BPromise=require(_0x4c42('0x3'));var rs=require(_0x4c42('0x4'));var fs=require('fs');var Redis=require(_0x4c42('0x5'));var db=require(_0x4c42('0x6'))['db'];var utils=require(_0x4c42('0x7'));var logger=require(_0x4c42('0x8'))(_0x4c42('0x9'));var config=require(_0x4c42('0xa'));var jayson=require(_0x4c42('0xb'));var client=jayson[_0x4c42('0xc')][_0x4c42('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x402a1c,_0x2ae8a7,_0xe62554){return new BPromise(function(_0x3ba7cb,_0x1fa6b0){return client['request'](_0x402a1c,_0xe62554)['then'](function(_0x513e03){logger[_0x4c42('0xe')](_0x4c42('0xf'),_0x2ae8a7,_0x4c42('0x10'));logger['debug'](_0x4c42('0x11'),_0x2ae8a7,_0x4c42('0x10'),JSON['stringify'](_0x513e03));if(_0x513e03[_0x4c42('0x12')]){if(_0x513e03['error'][_0x4c42('0x13')]===0x1f4){logger['error'](_0x4c42('0xf'),_0x2ae8a7,_0x513e03[_0x4c42('0x12')][_0x4c42('0x14')]);return _0x1fa6b0(_0x513e03[_0x4c42('0x12')][_0x4c42('0x14')]);}logger['error'](_0x4c42('0xf'),_0x2ae8a7,_0x513e03[_0x4c42('0x12')][_0x4c42('0x14')]);return _0x3ba7cb(_0x513e03[_0x4c42('0x12')]['message']);}else{logger[_0x4c42('0xe')](_0x4c42('0xf'),_0x2ae8a7,_0x4c42('0x10'));_0x3ba7cb(_0x513e03[_0x4c42('0x15')]['message']);}})[_0x4c42('0x16')](function(_0x3087e5){logger[_0x4c42('0x12')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x2ae8a7,_0x3087e5);_0x1fa6b0(_0x3087e5);});});} \ No newline at end of file +var _0xcc27=['JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x262fb3,_0x4fae4d){var _0x1cb5ac=function(_0x5ce152){while(--_0x5ce152){_0x262fb3['push'](_0x262fb3['shift']());}};_0x1cb5ac(++_0x4fae4d);}(_0xcc27,0xec));var _0x7cc2=function(_0x43ff36,_0x152cb7){_0x43ff36=_0x43ff36-0x0;var _0x6b6c08=_0xcc27[_0x43ff36];return _0x6b6c08;};'use strict';var _=require(_0x7cc2('0x0'));var util=require('util');var moment=require(_0x7cc2('0x1'));var BPromise=require(_0x7cc2('0x2'));var rs=require(_0x7cc2('0x3'));var fs=require('fs');var Redis=require(_0x7cc2('0x4'));var db=require(_0x7cc2('0x5'))['db'];var utils=require(_0x7cc2('0x6'));var logger=require('../../config/logger')(_0x7cc2('0x7'));var config=require('../../config/environment');var jayson=require(_0x7cc2('0x8'));var client=jayson['client'][_0x7cc2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5f0079,_0x446f96,_0x43f7de){return new BPromise(function(_0x37e1bc,_0x30c912){return client[_0x7cc2('0xa')](_0x5f0079,_0x43f7de)[_0x7cc2('0xb')](function(_0x2be146){logger[_0x7cc2('0xc')](_0x7cc2('0xd'),_0x446f96,_0x7cc2('0xe'));logger[_0x7cc2('0xf')](_0x7cc2('0x10'),_0x446f96,'request\x20sent',JSON['stringify'](_0x2be146));if(_0x2be146[_0x7cc2('0x11')]){if(_0x2be146[_0x7cc2('0x11')]['code']===0x1f4){logger[_0x7cc2('0x11')](_0x7cc2('0xd'),_0x446f96,_0x2be146['error']['message']);return _0x30c912(_0x2be146['error'][_0x7cc2('0x12')]);}logger[_0x7cc2('0x11')](_0x7cc2('0xd'),_0x446f96,_0x2be146[_0x7cc2('0x11')][_0x7cc2('0x12')]);return _0x37e1bc(_0x2be146[_0x7cc2('0x11')][_0x7cc2('0x12')]);}else{logger[_0x7cc2('0xc')](_0x7cc2('0xd'),_0x446f96,'request\x20sent');_0x37e1bc(_0x2be146[_0x7cc2('0x13')]['message']);}})[_0x7cc2('0x14')](function(_0x3d7e94){logger[_0x7cc2('0x11')](_0x7cc2('0xd'),_0x446f96,_0x3d7e94);_0x30c912(_0x3d7e94);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 73dde14..83e3246 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 _0xbb2a=['30s','getSummary','post','clone','put','update','delete','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/sessions','getSessions','getAnswers'];(function(_0x2b50e0,_0x48d2bb){var _0x379c45=function(_0x5d652f){while(--_0x5d652f){_0x2b50e0['push'](_0x2b50e0['shift']());}};_0x379c45(++_0x48d2bb);}(_0xbb2a,0x1d4));var _0xabb2=function(_0x1bb831,_0x5d76be){_0x1bb831=_0x1bb831-0x0;var _0x4a94af=_0xbb2a[_0x1bb831];return _0x4a94af;};'use strict';var multer=require('multer');var util=require(_0xabb2('0x0'));var path=require('path');var timeout=require(_0xabb2('0x1'));var express=require(_0xabb2('0x2'));var router=express[_0xabb2('0x3')]();var fs_extra=require(_0xabb2('0x4'));var auth=require(_0xabb2('0x5'));var interaction=require(_0xabb2('0x6'));var config=require(_0xabb2('0x7'));var controller=require('./jscriptyProject.controller');router[_0xabb2('0x8')]('/',auth[_0xabb2('0x9')](),controller[_0xabb2('0xa')]);router['get'](_0xabb2('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xabb2('0x8')](_0xabb2('0xc'),auth[_0xabb2('0x9')](),controller[_0xabb2('0xd')]);router[_0xabb2('0x8')]('/:id/answers',auth[_0xabb2('0x9')](),controller[_0xabb2('0xe')]);router[_0xabb2('0x8')]('/:id/summary',auth[_0xabb2('0x9')](),timeout(_0xabb2('0xf')),controller[_0xabb2('0x10')]);router[_0xabb2('0x11')]('/',auth[_0xabb2('0x9')](),controller['create']);router[_0xabb2('0x11')]('/:id/clone',auth['isAuthenticated'](),controller[_0xabb2('0x12')]);router[_0xabb2('0x13')](_0xabb2('0xb'),auth['isAuthenticated'](),controller[_0xabb2('0x14')]);router[_0xabb2('0x15')](_0xabb2('0xb'),auth[_0xabb2('0x9')](),controller['destroy']);module[_0xabb2('0x16')]=router; \ No newline at end of file +var _0x2684=['isAuthenticated','/:id/sessions','/:id/answers','getAnswers','/:id/summary','getSummary','create','/:id/clone','clone','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyProject.controller','get'];(function(_0x4b8b98,_0x178c88){var _0x1fb023=function(_0x53aa9b){while(--_0x53aa9b){_0x4b8b98['push'](_0x4b8b98['shift']());}};_0x1fb023(++_0x178c88);}(_0x2684,0x12d));var _0x4268=function(_0x3df1bf,_0x58d83e){_0x3df1bf=_0x3df1bf-0x0;var _0x182289=_0x2684[_0x3df1bf];return _0x182289;};'use strict';var multer=require(_0x4268('0x0'));var util=require(_0x4268('0x1'));var path=require(_0x4268('0x2'));var timeout=require(_0x4268('0x3'));var express=require(_0x4268('0x4'));var router=express[_0x4268('0x5')]();var fs_extra=require(_0x4268('0x6'));var auth=require(_0x4268('0x7'));var interaction=require(_0x4268('0x8'));var config=require('../../config/environment');var controller=require(_0x4268('0x9'));router[_0x4268('0xa')]('/',auth[_0x4268('0xb')](),controller['index']);router[_0x4268('0xa')]('/:id',auth[_0x4268('0xb')](),controller['show']);router[_0x4268('0xa')](_0x4268('0xc'),auth[_0x4268('0xb')](),controller['getSessions']);router[_0x4268('0xa')](_0x4268('0xd'),auth[_0x4268('0xb')](),controller[_0x4268('0xe')]);router[_0x4268('0xa')](_0x4268('0xf'),auth['isAuthenticated'](),timeout('30s'),controller[_0x4268('0x10')]);router['post']('/',auth[_0x4268('0xb')](),controller[_0x4268('0x11')]);router['post'](_0x4268('0x12'),auth['isAuthenticated'](),controller[_0x4268('0x13')]);router['put']('/:id',auth[_0x4268('0xb')](),controller[_0x4268('0x14')]);router[_0x4268('0x15')]('/:id',auth[_0x4268('0xb')](),controller[_0x4268('0x16')]);module[_0x4268('0x17')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index cf9dbb3..31f0afe 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 _0x32cd=['BOOLEAN','sequelize','lodash','util','exports','STRING','name','TEXT','long','isObjectLike','setDataValue','formData','stringify','isString','format','getDataValue'];(function(_0x201269,_0x24f740){var _0x44f06d=function(_0x5b63be){while(--_0x5b63be){_0x201269['push'](_0x201269['shift']());}};_0x44f06d(++_0x24f740);}(_0x32cd,0x1d1));var _0xd32c=function(_0x7000cc,_0x2258e5){_0x7000cc=_0x7000cc-0x0;var _0x480fc7=_0x32cd[_0x7000cc];return _0x480fc7;};'use strict';var Sequelize=require(_0xd32c('0x0'));var _=require(_0xd32c('0x1'));var util=require(_0xd32c('0x2'));module[_0xd32c('0x3')]={'name':{'type':Sequelize[_0xd32c('0x4')],'unique':_0xd32c('0x5')},'description':{'type':Sequelize[_0xd32c('0x4')]},'formData':{'type':Sequelize[_0xd32c('0x6')](_0xd32c('0x7')),'set':function(_0x51a6bb){if(_[_0xd32c('0x8')](_0x51a6bb)){this[_0xd32c('0x9')](_0xd32c('0xa'),JSON[_0xd32c('0xb')](_0x51a6bb));}else if(_[_0xd32c('0xc')](_0x51a6bb)){this[_0xd32c('0x9')](_0xd32c('0xa'),_0x51a6bb);}else{this['setDataValue'](_0xd32c('0xa'),util[_0xd32c('0xd')]('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this[_0xd32c('0xe')](_0xd32c('0x5'))||'',this['getDataValue']('description')||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xd32c('0xf')],'defaultValue':![]}}; \ No newline at end of file +var _0x86f6=['{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','name','description','BOOLEAN','util','exports','STRING','long','setDataValue','formData','stringify','isString','format'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x86f6,0xd7));var _0x686f=function(_0x237e86,_0x4c628e){_0x237e86=_0x237e86-0x0;var _0x2bcf51=_0x86f6[_0x237e86];return _0x2bcf51;};'use strict';var Sequelize=require('sequelize');var _=require('lodash');var util=require(_0x686f('0x0'));module[_0x686f('0x1')]={'name':{'type':Sequelize[_0x686f('0x2')],'unique':'name'},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize['TEXT'](_0x686f('0x3')),'set':function(_0x48bd99){if(_['isObjectLike'](_0x48bd99)){this[_0x686f('0x4')](_0x686f('0x5'),JSON[_0x686f('0x6')](_0x48bd99));}else if(_[_0x686f('0x7')](_0x48bd99)){this['setDataValue'](_0x686f('0x5'),_0x48bd99);}else{this[_0x686f('0x4')](_0x686f('0x5'),util[_0x686f('0x8')](_0x686f('0x9'),this[_0x686f('0xa')](_0x686f('0xb'))||'',this[_0x686f('0xa')](_0x686f('0xc'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x686f('0xd')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x686f('0xd')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index 7edfc23..e41f33d 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 _0x281d=['catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','createdAt','updatedAt','omit','UserProfileSection','getSessions','findOne','JscriptySessionReport','order','ProjectId','findAll','getAnswers','JscriptyAnswerReport','number','toString','indexOf','getSummary','startTime','starttime','parse','JscriptyQuestionReport','-createdAt','hasOwnProperty','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','isEmpty','now','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','attachment;\x20filename=','Content-type','text/csv','download','sendStatus','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','Projects','UserProfileResource','error','stack','name','send','index','map','JscriptyProject','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','type','options','includeAll','rows','show','include'];(function(_0x2fb450,_0x2e4e56){var _0x3ce76e=function(_0x224cb2){while(--_0x224cb2){_0x2fb450['push'](_0x2fb450['shift']());}};_0x3ce76e(++_0x2e4e56);}(_0x281d,0x195));var _0xd281=function(_0x215757,_0x1a9557){_0x215757=_0x215757-0x0;var _0x5900ac=_0x281d[_0x215757];return _0x5900ac;};'use strict';var emlformat=require(_0xd281('0x0'));var rimraf=require(_0xd281('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd281('0x2'));var rp=require(_0xd281('0x3'));var moment=require(_0xd281('0x4'));var BPromise=require(_0xd281('0x5'));var Mustache=require(_0xd281('0x6'));var util=require('util');var path=require('path');var sox=require(_0xd281('0x7'));var csv=require(_0xd281('0x8'));var ejs=require(_0xd281('0x9'));var fs=require('fs');var fs_extra=require(_0xd281('0xa'));var _=require('lodash');var squel=require(_0xd281('0xb'));var crypto=require('crypto');var jsforce=require(_0xd281('0xc'));var deskjs=require(_0xd281('0xd'));var toCsv=require(_0xd281('0x8'));var querystring=require(_0xd281('0xe'));var Papa=require(_0xd281('0xf'));var Redis=require(_0xd281('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xd281('0x11'));var as=require(_0xd281('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd281('0x13'))(_0xd281('0x14'));var utils=require(_0xd281('0x15'));var config=require(_0xd281('0x16'));var licenseUtil=require(_0xd281('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2f9785,_0x34f63a){_0x34f63a=_0x34f63a||0xcc;return function(_0x1f3000){if(_0x1f3000){return _0x2f9785['sendStatus'](_0x34f63a);}return _0x2f9785[_0xd281('0x18')](_0x34f63a)[_0xd281('0x19')]();};}function respondWithResult(_0x14765e,_0x2e12f4){_0x2e12f4=_0x2e12f4||0xc8;return function(_0x4de9e9){if(_0x4de9e9){return _0x14765e[_0xd281('0x18')](_0x2e12f4)[_0xd281('0x1a')](_0x4de9e9);}};}function respondWithFilteredResult(_0x46f573,_0x2bd07c){return function(_0x22d167){if(_0x22d167){var _0x3a1609=typeof _0x2bd07c[_0xd281('0x1b')]===_0xd281('0x1c')&&typeof _0x2bd07c[_0xd281('0x1d')]===_0xd281('0x1c');var _0x4993fb=_0x22d167[_0xd281('0x1e')];var _0x537002=_0x3a1609?0x0:_0x2bd07c[_0xd281('0x1b')];var _0x3e9ee0=_0x3a1609?_0x22d167['count']:_0x2bd07c[_0xd281('0x1b')]+_0x2bd07c[_0xd281('0x1d')];var _0x2144b1;if(_0x3e9ee0>=_0x4993fb){_0x3e9ee0=_0x4993fb;_0x2144b1=0xc8;}else{_0x2144b1=0xce;}_0x46f573[_0xd281('0x18')](_0x2144b1);return _0x46f573[_0xd281('0x1f')](_0xd281('0x20'),_0x537002+'-'+_0x3e9ee0+'/'+_0x4993fb)['json'](_0x22d167);}return null;};}function patchUpdates(_0xcf20e6){return function(_0x13e796){try{jsonpatch[_0xd281('0x21')](_0x13e796,_0xcf20e6,!![]);}catch(_0x6f1f58){return BPromise[_0xd281('0x22')](_0x6f1f58);}return _0x13e796['save']();};}function saveUpdates(_0x1d6b91,_0x5a2416){return function(_0x1ec197){if(_0x1ec197){return _0x1ec197[_0xd281('0x23')](_0x1d6b91)[_0xd281('0x24')](function(_0x2e1798){return _0x2e1798;});}return null;};}function removeEntity(_0x67e9b6,_0x352c3b){return function(_0x3a15ce){if(_0x3a15ce){return _0x3a15ce[_0xd281('0x25')]()[_0xd281('0x24')](function(){var _0xa7165b=_0x3a15ce[_0xd281('0x26')]({'plain':!![]});var _0x4998b5=_0xd281('0x27');return db[_0xd281('0x28')][_0xd281('0x25')]({'where':{'type':_0x4998b5,'resourceId':_0xa7165b['id']}})[_0xd281('0x24')](function(){return _0x3a15ce;});})['then'](function(){_0x67e9b6[_0xd281('0x18')](0xcc)[_0xd281('0x19')]();});}};}function handleEntityNotFound(_0x3df7e5,_0x4b9e04){return function(_0x41ae36){if(!_0x41ae36){_0x3df7e5['sendStatus'](0x194);}return _0x41ae36;};}function handleError(_0x59862c,_0x21ad56){_0x21ad56=_0x21ad56||0x1f4;return function(_0x2172a4){logger[_0xd281('0x29')](_0x2172a4[_0xd281('0x2a')]);if(_0x2172a4['name']){delete _0x2172a4[_0xd281('0x2b')];}_0x59862c[_0xd281('0x18')](_0x21ad56)[_0xd281('0x2c')](_0x2172a4);};}exports[_0xd281('0x2d')]=function(_0x49c656,_0x5ef27d){var _0x113c75={},_0x4b2d64={},_0x548984={'count':0x0,'rows':[]};var _0x35690b=_[_0xd281('0x2e')](db[_0xd281('0x2f')][_0xd281('0x30')],function(_0x5d08c0){return{'name':_0x5d08c0[_0xd281('0x31')],'type':_0x5d08c0['type'][_0xd281('0x32')]};});_0x4b2d64[_0xd281('0x33')]=_['map'](_0x35690b,_0xd281('0x2b'));_0x4b2d64[_0xd281('0x34')]=_[_0xd281('0x35')](_0x49c656['query']);_0x4b2d64[_0xd281('0x36')]=_[_0xd281('0x37')](_0x4b2d64[_0xd281('0x33')],_0x4b2d64[_0xd281('0x34')]);_0x113c75[_0xd281('0x38')]=_[_0xd281('0x37')](_0x4b2d64['model'],qs[_0xd281('0x39')](_0x49c656[_0xd281('0x34')][_0xd281('0x39')]));_0x113c75[_0xd281('0x38')]=_0x113c75[_0xd281('0x38')][_0xd281('0x3a')]?_0x113c75['attributes']:_0x4b2d64[_0xd281('0x33')];if(!_0x49c656[_0xd281('0x34')]['hasOwnProperty'](_0xd281('0x3b'))){_0x113c75[_0xd281('0x1d')]=qs['limit'](_0x49c656[_0xd281('0x34')][_0xd281('0x1d')]);_0x113c75['offset']=qs[_0xd281('0x1b')](_0x49c656[_0xd281('0x34')][_0xd281('0x1b')]);}_0x113c75['order']=qs[_0xd281('0x3c')](_0x49c656['query'][_0xd281('0x3c')]);_0x113c75[_0xd281('0x3d')]=qs['filters'](_[_0xd281('0x3e')](_0x49c656['query'],_0x4b2d64[_0xd281('0x36')]),_0x35690b);if(_0x49c656[_0xd281('0x34')][_0xd281('0x3f')]){_0x113c75[_0xd281('0x3d')]=_[_0xd281('0x40')](_0x113c75[_0xd281('0x3d')],{'$or':_[_0xd281('0x2e')](_0x35690b,function(_0x29769c){if(_0x29769c[_0xd281('0x41')]!=='VIRTUAL'){var _0x151b69={};_0x151b69[_0x29769c['name']]={'$like':'%'+_0x49c656[_0xd281('0x34')][_0xd281('0x3f')]+'%'};return _0x151b69;}})});}_0x113c75=_['merge']({},_0x113c75,_0x49c656[_0xd281('0x42')]);var _0x3bcc8b={'where':_0x113c75[_0xd281('0x3d')]};return db['JscriptyProject'][_0xd281('0x1e')](_0x3bcc8b)[_0xd281('0x24')](function(_0xbc05a2){_0x548984[_0xd281('0x1e')]=_0xbc05a2;if(_0x49c656[_0xd281('0x34')][_0xd281('0x43')]){_0x113c75['include']=[{'all':!![]}];}return db[_0xd281('0x2f')]['findAll'](_0x113c75);})[_0xd281('0x24')](function(_0x33caaa){_0x548984[_0xd281('0x44')]=_0x33caaa;return _0x548984;})[_0xd281('0x24')](respondWithFilteredResult(_0x5ef27d,_0x113c75))['catch'](handleError(_0x5ef27d,null));};exports[_0xd281('0x45')]=function(_0x2b624a,_0x2535c3){var _0x5caff8={'raw':![],'where':{'id':_0x2b624a['params']['id']}},_0x50d958={};_0x50d958['model']=_[_0xd281('0x35')](db[_0xd281('0x2f')][_0xd281('0x30')]);_0x50d958[_0xd281('0x34')]=_['keys'](_0x2b624a[_0xd281('0x34')]);_0x50d958[_0xd281('0x36')]=_[_0xd281('0x37')](_0x50d958['model'],_0x50d958[_0xd281('0x34')]);_0x5caff8[_0xd281('0x38')]=_[_0xd281('0x37')](_0x50d958[_0xd281('0x33')],qs[_0xd281('0x39')](_0x2b624a[_0xd281('0x34')][_0xd281('0x39')]));_0x5caff8[_0xd281('0x38')]=_0x5caff8[_0xd281('0x38')]['length']?_0x5caff8[_0xd281('0x38')]:_0x50d958['model'];if(_0x2b624a[_0xd281('0x34')][_0xd281('0x43')]){_0x5caff8[_0xd281('0x46')]=[{'all':!![]}];}_0x5caff8=_[_0xd281('0x40')]({},_0x5caff8,_0x2b624a[_0xd281('0x42')]);return db[_0xd281('0x2f')]['find'](_0x5caff8)['then'](handleEntityNotFound(_0x2535c3,null))[_0xd281('0x24')](respondWithResult(_0x2535c3,null))[_0xd281('0x47')](handleError(_0x2535c3,null));};exports[_0xd281('0x48')]=function(_0x257c7b,_0xa72d34){return db['JscriptyProject'][_0xd281('0x48')](_0x257c7b[_0xd281('0x49')],{})[_0xd281('0x24')](function(_0x443582){var _0xee2a2f=_0x257c7b[_0xd281('0x4a')][_0xd281('0x26')]({'plain':!![]});if(!_0xee2a2f)throw new Error(_0xd281('0x4b'));if(_0xee2a2f[_0xd281('0x4c')]===_0xd281('0x4a')){var _0x49f580=_0x443582['get']({'plain':!![]});var _0x5d4b71='Projects';return db['UserProfileSection'][_0xd281('0x4d')]({'where':{'name':_0x5d4b71,'userProfileId':_0xee2a2f[_0xd281('0x4e')]},'raw':!![]})[_0xd281('0x24')](function(_0x50bd6f){if(_0x50bd6f&&_0x50bd6f[_0xd281('0x4f')]===0x0){return db['UserProfileResource'][_0xd281('0x48')]({'name':_0x49f580[_0xd281('0x2b')],'resourceId':_0x49f580['id'],'type':_0x50bd6f[_0xd281('0x2b')],'sectionId':_0x50bd6f['id']},{})[_0xd281('0x24')](function(){return _0x443582;});}else{return _0x443582;}})[_0xd281('0x47')](function(_0x419023){logger[_0xd281('0x29')](_0xd281('0x50'),_0x419023);throw _0x419023;});}return _0x443582;})[_0xd281('0x24')](respondWithResult(_0xa72d34,0xc9))[_0xd281('0x47')](handleError(_0xa72d34,null));};exports['clone']=function(_0x20c1b7,_0x4c3ca2){var _0x44efe0={'where':{'id':_0x20c1b7[_0xd281('0x51')]['id']}},_0x1a120c={};_0x1a120c[_0xd281('0x33')]=_[_0xd281('0x35')](db['JscriptyProject']['rawAttributes']);_0x44efe0['attributes']=_[_0xd281('0x37')](_0x1a120c[_0xd281('0x33')],qs[_0xd281('0x39')](_0x20c1b7[_0xd281('0x34')][_0xd281('0x39')]));_0x44efe0[_0xd281('0x38')]=_0x44efe0[_0xd281('0x38')]['length']?_0x44efe0[_0xd281('0x38')]:_0x1a120c[_0xd281('0x33')];if(_0x20c1b7[_0xd281('0x34')]['includeAll']){_0x44efe0[_0xd281('0x46')]=[{'all':!![]}];}_0x44efe0=_[_0xd281('0x40')]({},_0x44efe0,_0x20c1b7[_0xd281('0x42')]);return db[_0xd281('0x2f')][_0xd281('0x4d')](_0x44efe0)[_0xd281('0x24')](handleEntityNotFound(_0x4c3ca2,null))['then'](function(_0x2c7e26){if(_0x2c7e26){var _0x2ad66a=_0x2c7e26[_0xd281('0x26')]({'plain':!![]});_0x2ad66a=qs['omit'](_0x2ad66a,['id',_0xd281('0x52'),_0xd281('0x53')]);_0x20c1b7[_0xd281('0x49')]=_[_0xd281('0x54')](_0x20c1b7[_0xd281('0x49')],['id',_0xd281('0x52'),_0xd281('0x53')]);return db[_0xd281('0x2f')][_0xd281('0x48')](_['merge'](_0x2ad66a,_0x20c1b7[_0xd281('0x49')]),{'include':_0x20c1b7[_0xd281('0x34')][_0xd281('0x43')]?[{'all':!![]}]:undefined})[_0xd281('0x24')](function(_0x297fe5){var _0x17ac1b=_0x20c1b7['user'][_0xd281('0x26')]({'plain':!![]});if(!_0x17ac1b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x17ac1b[_0xd281('0x4c')]===_0xd281('0x4a')){var _0x3e5c1d=_0x297fe5[_0xd281('0x26')]({'plain':!![]});var _0x4c33b9=_0xd281('0x27');return db[_0xd281('0x55')][_0xd281('0x4d')]({'where':{'name':_0x4c33b9,'userProfileId':_0x17ac1b['userProfileId']},'raw':!![]})[_0xd281('0x24')](function(_0xa173ce){if(_0xa173ce&&_0xa173ce[_0xd281('0x4f')]===0x0){return db[_0xd281('0x28')][_0xd281('0x48')]({'name':_0x3e5c1d[_0xd281('0x2b')],'resourceId':_0x3e5c1d['id'],'type':_0xa173ce[_0xd281('0x2b')],'sectionId':_0xa173ce['id']},{})[_0xd281('0x24')](function(){return _0x297fe5;});}else{return _0x297fe5;}})[_0xd281('0x47')](function(_0x4fd523){logger[_0xd281('0x29')](_0xd281('0x50'),_0x4fd523);throw _0x4fd523;});}return _0x297fe5;});}})[_0xd281('0x24')](respondWithResult(_0x4c3ca2,0xc9))[_0xd281('0x47')](handleError(_0x4c3ca2,null));};exports[_0xd281('0x23')]=function(_0x1e63d5,_0x2c6ff6){if(_0x1e63d5[_0xd281('0x49')]['id']){delete _0x1e63d5['body']['id'];}return db[_0xd281('0x2f')]['find']({'where':{'id':_0x1e63d5[_0xd281('0x51')]['id']}})[_0xd281('0x24')](handleEntityNotFound(_0x2c6ff6,null))['then'](saveUpdates(_0x1e63d5[_0xd281('0x49')],null))[_0xd281('0x24')](respondWithResult(_0x2c6ff6,null))[_0xd281('0x47')](handleError(_0x2c6ff6,null));};exports[_0xd281('0x25')]=function(_0x49d9ea,_0x28632b){return db['JscriptyProject'][_0xd281('0x4d')]({'where':{'id':_0x49d9ea[_0xd281('0x51')]['id']}})['then'](handleEntityNotFound(_0x28632b,null))[_0xd281('0x24')](removeEntity(_0x28632b,null))[_0xd281('0x47')](handleError(_0x28632b,null));};exports[_0xd281('0x56')]=function(_0x6b4e5,_0x3670b5,_0x3e5ed5){var _0xf6cbcb={'raw':!![],'where':{}};var _0x2a1a8f={};var _0x2e5bf4={'count':0x0,'rows':[]};return db['JscriptyProject'][_0xd281('0x57')]({'where':{'id':_0x6b4e5[_0xd281('0x51')]['id']}})[_0xd281('0x24')](handleEntityNotFound(_0x3670b5,null))['then'](function(_0x1ca508){if(_0x1ca508){_0x2a1a8f[_0xd281('0x33')]=_['keys'](db[_0xd281('0x58')][_0xd281('0x30')]);_0x2a1a8f['query']=_[_0xd281('0x35')](_0x6b4e5[_0xd281('0x34')]);_0x2a1a8f[_0xd281('0x36')]=_[_0xd281('0x37')](_0x2a1a8f[_0xd281('0x33')],_0x2a1a8f['query']);_0xf6cbcb[_0xd281('0x38')]=_[_0xd281('0x37')](_0x2a1a8f[_0xd281('0x33')],qs[_0xd281('0x39')](_0x6b4e5[_0xd281('0x34')][_0xd281('0x39')]));_0xf6cbcb[_0xd281('0x38')]=_0xf6cbcb['attributes'][_0xd281('0x3a')]?_0xf6cbcb[_0xd281('0x38')]:_0x2a1a8f[_0xd281('0x33')];if(!_0x6b4e5[_0xd281('0x34')]['hasOwnProperty'](_0xd281('0x3b'))){_0xf6cbcb[_0xd281('0x1d')]=qs['limit'](_0x6b4e5['query'][_0xd281('0x1d')]);_0xf6cbcb[_0xd281('0x1b')]=qs['offset'](_0x6b4e5[_0xd281('0x34')][_0xd281('0x1b')]);}_0xf6cbcb[_0xd281('0x59')]=qs[_0xd281('0x3c')](_0x6b4e5[_0xd281('0x34')][_0xd281('0x3c')]);_0xf6cbcb[_0xd281('0x3d')]=qs['filters'](_[_0xd281('0x3e')](_0x6b4e5['query'],_0x2a1a8f[_0xd281('0x36')]));_0xf6cbcb[_0xd281('0x3d')][_0xd281('0x5a')]=_0x1ca508['id'];if(_0x6b4e5[_0xd281('0x34')][_0xd281('0x3f')]){_0xf6cbcb[_0xd281('0x3d')]=_[_0xd281('0x40')](_0xf6cbcb[_0xd281('0x3d')],{'$or':_['map'](_0xf6cbcb[_0xd281('0x38')],function(_0x392da4){var _0x1c56ec={};_0x1c56ec[_0x392da4]={'$like':'%'+_0x6b4e5[_0xd281('0x34')][_0xd281('0x3f')]+'%'};return _0x1c56ec;})});}_0xf6cbcb=_[_0xd281('0x40')]({},_0xf6cbcb,_0x6b4e5[_0xd281('0x42')]);return db[_0xd281('0x58')][_0xd281('0x1e')]({'where':_0xf6cbcb['where']})[_0xd281('0x24')](function(_0x2ca34c){_0x2e5bf4[_0xd281('0x1e')]=_0x2ca34c;if(_0x6b4e5[_0xd281('0x34')][_0xd281('0x43')]){_0xf6cbcb[_0xd281('0x46')]=[{'all':!![]}];}return db[_0xd281('0x58')][_0xd281('0x5b')](_0xf6cbcb);})[_0xd281('0x24')](function(_0x245831){_0x2e5bf4['rows']=_0x245831;return _0x2e5bf4;});}})[_0xd281('0x24')](respondWithFilteredResult(_0x3670b5,_0xf6cbcb))['catch'](handleError(_0x3670b5,null));};exports[_0xd281('0x5c')]=function(_0xec1a4,_0x2304b9,_0xe66e14){var _0x5b9f73={'raw':!![],'where':{}};var _0x4ab061={};var _0x2c904e={'count':0x0,'rows':[]};return db[_0xd281('0x2f')]['findOne']({'where':{'id':_0xec1a4[_0xd281('0x51')]['id']}})[_0xd281('0x24')](handleEntityNotFound(_0x2304b9,null))['then'](function(_0x973f36){if(_0x973f36){_0x4ab061[_0xd281('0x33')]=_[_0xd281('0x35')](db[_0xd281('0x5d')]['rawAttributes']);_0x4ab061['query']=_['keys'](_0xec1a4[_0xd281('0x34')]);_0x4ab061[_0xd281('0x36')]=_['intersection'](_0x4ab061[_0xd281('0x33')],_0x4ab061[_0xd281('0x34')]);_0x5b9f73['attributes']=_[_0xd281('0x37')](_0x4ab061['model'],qs['fields'](_0xec1a4[_0xd281('0x34')][_0xd281('0x39')]));_0x5b9f73['attributes']=_0x5b9f73['attributes'][_0xd281('0x3a')]?_0x5b9f73[_0xd281('0x38')]:_0x4ab061[_0xd281('0x33')];if(!_0xec1a4['query']['hasOwnProperty'](_0xd281('0x3b'))){_0x5b9f73[_0xd281('0x1d')]=qs[_0xd281('0x1d')](_0xec1a4[_0xd281('0x34')][_0xd281('0x1d')]);_0x5b9f73[_0xd281('0x1b')]=qs[_0xd281('0x1b')](_0xec1a4['query'][_0xd281('0x1b')]);}_0x5b9f73[_0xd281('0x59')]=qs[_0xd281('0x3c')](_0xec1a4[_0xd281('0x34')][_0xd281('0x3c')]);_0x5b9f73[_0xd281('0x3d')]=qs[_0xd281('0x36')](_[_0xd281('0x3e')](_0xec1a4['query'],_0x4ab061[_0xd281('0x36')]));_0x5b9f73[_0xd281('0x3d')][_0xd281('0x5a')]=_0x973f36['id'];if(_0xec1a4[_0xd281('0x34')][_0xd281('0x3f')]){_0x5b9f73[_0xd281('0x3d')]=_[_0xd281('0x40')](_0x5b9f73['where'],{'$or':_[_0xd281('0x2e')](_0x5b9f73[_0xd281('0x38')],function(_0x4f7d2a){var _0x25f076={};_0x25f076[_0x4f7d2a]={'$like':'%'+_0xec1a4[_0xd281('0x34')][_0xd281('0x3f')]+'%'};return _0x25f076;})});}_0x5b9f73=_[_0xd281('0x40')]({},_0x5b9f73,_0xec1a4[_0xd281('0x42')]);return db['JscriptyAnswerReport'][_0xd281('0x1e')]({'where':_0x5b9f73[_0xd281('0x3d')]})['then'](function(_0x5dff26){_0x2c904e[_0xd281('0x1e')]=_0x5dff26;if(_0xec1a4[_0xd281('0x34')]['includeAll']){_0x5b9f73[_0xd281('0x46')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0xd281('0x5b')](_0x5b9f73);})[_0xd281('0x24')](function(_0x2f2676){_0x2c904e['rows']=_0x2f2676;return _0x2c904e;});}})[_0xd281('0x24')](respondWithFilteredResult(_0x2304b9,_0x5b9f73))['catch'](handleError(_0x2304b9,null));};function char(_0x218823){return _0xd281('0x5e')===typeof _0x218823?String['fromCharCode'][_0xd281('0x21')](null,arguments):_0x218823;}function needsEncapsulation(_0x512c2e){return!!_0x512c2e&&(_0x512c2e[_0xd281('0x5f')]()[_0xd281('0x60')](char(0xd))>=0x0||_0x512c2e['toString']()[_0xd281('0x60')](char(0xa))>=0x0||_0x512c2e[_0xd281('0x5f')]()[_0xd281('0x60')](char(0x2c))>=0x0||_0x512c2e[_0xd281('0x5f')]()[_0xd281('0x60')](char(0x22))>=0x0);}function encapsulate(_0x5c9641){var _0xf7bc0d=char(0x22),_0x438145='\x5c'+char(0x22),_0x577b7f=_0x5c9641[_0xd281('0x5f')]()['replace'](new RegExp(_0xf7bc0d,'g'),_0x438145);return _0xf7bc0d+_0x577b7f+_0xf7bc0d;}exports[_0xd281('0x61')]=function(_0x3b68a8,_0x5476a7,_0x22e5e9){var _0x2443ef,_0x54dc57;var _0x8b37e1={'where':{'ProjectId':_0x3b68a8[_0xd281('0x51')]['id']}};if(_0x3b68a8[_0xd281('0x34')][_0xd281('0x62')]){_0x8b37e1[_0xd281('0x3d')][_0xd281('0x63')]=JSON[_0xd281('0x64')](_0x3b68a8[_0xd281('0x34')]['startTime']);}return db[_0xd281('0x58')]['findAll'](_0x8b37e1)[_0xd281('0x24')](handleEntityNotFound(_0x5476a7,null))['then'](function(_0x1b1dfa){if(_0x1b1dfa){_0x2443ef=_0x1b1dfa;return db[_0xd281('0x65')]['findAll']({'where':{'SessionId':{'$in':_[_0xd281('0x2e')](_0x2443ef,'id')},'ProjectId':_0x3b68a8['params']['id']},'order':_0xd281('0x66')});}})[_0xd281('0x24')](handleEntityNotFound(_0x5476a7,null))[_0xd281('0x24')](function(_0x350b9d){if(_0x350b9d){_0x54dc57=_0x350b9d;var _0x13a154={};for(var _0x1f19f1=0x0,_0x541b1c=_0x54dc57[_0xd281('0x3a')];_0x1f19f1<_0x541b1c;_0x1f19f1++){if(!_0x13a154[_0xd281('0x67')](_0x54dc57[_0x1f19f1][_0xd281('0x68')])){_0x13a154[_0x54dc57[_0x1f19f1][_0xd281('0x68')]]=needsEncapsulation(_0x54dc57[_0x1f19f1][_0xd281('0x69')])?encapsulate(_0x54dc57[_0x1f19f1][_0xd281('0x69')]):_0x54dc57[_0x1f19f1][_0xd281('0x69')];}}var _0x153fa4=[],_0x467c85={};for(var _0x5b9171=0x0,_0x3acf9f=_0x2443ef[_0xd281('0x3a')];_0x5b9171<_0x3acf9f;_0x5b9171++){_0x467c85={'ProjectId':_0x3b68a8['params']['id'],'SessionId':_0x2443ef[_0x5b9171]['id'],'StartTime':moment(_0x2443ef[_0x5b9171][_0xd281('0x63')])[_0xd281('0x6a')](_0xd281('0x6b'))};for(var _0x4568ba=0x0,_0x53b66f=_0x54dc57[_0xd281('0x3a')];_0x4568ba<_0x53b66f;_0x4568ba++){if(_0x54dc57[_0x4568ba][_0xd281('0x6c')]==_0x2443ef[_0x5b9171]['id']&&_0x13a154[_0xd281('0x67')](_0x54dc57[_0x4568ba][_0xd281('0x68')])){_0x467c85[_0x13a154[_0x54dc57[_0x4568ba][_0xd281('0x68')]]]=_0x54dc57[_0x4568ba][_0xd281('0x6d')];}}for(var _0x117538 in _0x13a154){if(!_0x467c85[_0xd281('0x67')](_0x13a154[_0x117538])){_0x467c85[_0x13a154[_0x117538]]=null;}}_0x153fa4['push'](_0x467c85);}return _0x153fa4;}})[_0xd281('0x24')](function(_0x266238){if(!_[_0xd281('0x6e')](_0x266238)){var _0x3a3bba=toCsv(_0x266238);var _0x1860b4=Date[_0xd281('0x6f')]();fs['writeFileSync'](util[_0xd281('0x6a')](_0xd281('0x70'),_0x3b68a8[_0xd281('0x51')]['id'],_0x1860b4),_0x3a3bba);_0x5476a7[_0xd281('0x71')]('Content-disposition',_0xd281('0x72')+util[_0xd281('0x6a')]('Jscripty_Project_%d_Summary_%s.csv',_0x3b68a8[_0xd281('0x51')]['id'],_0x1860b4));_0x5476a7['setHeader'](_0xd281('0x73'),_0xd281('0x74'));return _0x5476a7[_0xd281('0x75')](util[_0xd281('0x6a')](_0xd281('0x70'),_0x3b68a8[_0xd281('0x51')]['id'],_0x1860b4));}else{return _0x5476a7[_0xd281('0x76')](0xcc);}})[_0xd281('0x47')](handleError(_0x5476a7,null));}; \ No newline at end of file +var _0x7c80=['catch','show','params','includeAll','include','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Projects','find','userProfileId','UserProfileResource','omit','createdAt','updatedAt','UserProfileSection','autoAssociation','getSessions','findOne','JscriptySessionReport','filters','ProjectId','getAnswers','JscriptyAnswerReport','rows','fromCharCode','toString','indexOf','replace','getSummary','startTime','parse','JscriptyQuestionReport','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','now','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','get','error','stack','name','send','index','map','JscriptyProject','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','findAll'];(function(_0x420214,_0x3f9e13){var _0x3ee9f9=function(_0x14e6f6){while(--_0x14e6f6){_0x420214['push'](_0x420214['shift']());}};_0x3ee9f9(++_0x3f9e13);}(_0x7c80,0xa4));var _0x07c8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7c80[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x07c8('0x0'));var rimraf=require(_0x07c8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x07c8('0x2'));var moment=require(_0x07c8('0x3'));var BPromise=require(_0x07c8('0x4'));var Mustache=require('mustache');var util=require(_0x07c8('0x5'));var path=require(_0x07c8('0x6'));var sox=require(_0x07c8('0x7'));var csv=require('to-csv');var ejs=require(_0x07c8('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x07c8('0x9'));var crypto=require(_0x07c8('0xa'));var jsforce=require(_0x07c8('0xb'));var deskjs=require(_0x07c8('0xc'));var toCsv=require(_0x07c8('0xd'));var querystring=require(_0x07c8('0xe'));var Papa=require('papaparse');var Redis=require(_0x07c8('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x07c8('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x07c8('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x07c8('0x12'));var licenseUtil=require(_0x07c8('0x13'));var db=require(_0x07c8('0x14'))['db'];function respondWithStatusCode(_0x39d243,_0x5c2abf){_0x5c2abf=_0x5c2abf||0xcc;return function(_0x338d94){if(_0x338d94){return _0x39d243[_0x07c8('0x15')](_0x5c2abf);}return _0x39d243[_0x07c8('0x16')](_0x5c2abf)[_0x07c8('0x17')]();};}function respondWithResult(_0x5d84de,_0x5da90b){_0x5da90b=_0x5da90b||0xc8;return function(_0x29fe2b){if(_0x29fe2b){return _0x5d84de['status'](_0x5da90b)[_0x07c8('0x18')](_0x29fe2b);}};}function respondWithFilteredResult(_0x439159,_0x3d2e32){return function(_0x3997e7){if(_0x3997e7){var _0x1d6bca=typeof _0x3d2e32[_0x07c8('0x19')]===_0x07c8('0x1a')&&typeof _0x3d2e32[_0x07c8('0x1b')]===_0x07c8('0x1a');var _0x1a85c0=_0x3997e7[_0x07c8('0x1c')];var _0x36da01=_0x1d6bca?0x0:_0x3d2e32[_0x07c8('0x19')];var _0x444259=_0x1d6bca?_0x3997e7[_0x07c8('0x1c')]:_0x3d2e32[_0x07c8('0x19')]+_0x3d2e32[_0x07c8('0x1b')];var _0x12aeb1;if(_0x444259>=_0x1a85c0){_0x444259=_0x1a85c0;_0x12aeb1=0xc8;}else{_0x12aeb1=0xce;}_0x439159['status'](_0x12aeb1);return _0x439159[_0x07c8('0x1d')]('Content-Range',_0x36da01+'-'+_0x444259+'/'+_0x1a85c0)['json'](_0x3997e7);}return null;};}function patchUpdates(_0x5bb42b){return function(_0xeb1372){try{jsonpatch[_0x07c8('0x1e')](_0xeb1372,_0x5bb42b,!![]);}catch(_0x2750a2){return BPromise[_0x07c8('0x1f')](_0x2750a2);}return _0xeb1372[_0x07c8('0x20')]();};}function saveUpdates(_0x4e33b3,_0x397ccd){return function(_0x278561){if(_0x278561){return _0x278561[_0x07c8('0x21')](_0x4e33b3)['then'](function(_0xefbb7d){return _0xefbb7d;});}return null;};}function removeEntity(_0x356d4f,_0x3e3965){return function(_0x470fe1){if(_0x470fe1){return _0x470fe1[_0x07c8('0x22')]()[_0x07c8('0x23')](function(){var _0x4ae36a=_0x470fe1[_0x07c8('0x24')]({'plain':!![]});var _0x550a69='Projects';return db['UserProfileResource']['destroy']({'where':{'type':_0x550a69,'resourceId':_0x4ae36a['id']}})[_0x07c8('0x23')](function(){return _0x470fe1;});})[_0x07c8('0x23')](function(){_0x356d4f[_0x07c8('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ce5da,_0x569886){return function(_0x13086a){if(!_0x13086a){_0x4ce5da[_0x07c8('0x15')](0x194);}return _0x13086a;};}function handleError(_0x5faab8,_0x6dbc13){_0x6dbc13=_0x6dbc13||0x1f4;return function(_0x129455){logger[_0x07c8('0x25')](_0x129455[_0x07c8('0x26')]);if(_0x129455['name']){delete _0x129455[_0x07c8('0x27')];}_0x5faab8['status'](_0x6dbc13)[_0x07c8('0x28')](_0x129455);};}exports[_0x07c8('0x29')]=function(_0x50dbec,_0x3132b0){var _0x4d7c4e={},_0xd7edf9={},_0x26deb0={'count':0x0,'rows':[]};var _0x300682=_[_0x07c8('0x2a')](db[_0x07c8('0x2b')][_0x07c8('0x2c')],function(_0x1382c6){return{'name':_0x1382c6[_0x07c8('0x2d')],'type':_0x1382c6[_0x07c8('0x2e')][_0x07c8('0x2f')]};});_0xd7edf9[_0x07c8('0x30')]=_[_0x07c8('0x2a')](_0x300682,_0x07c8('0x27'));_0xd7edf9[_0x07c8('0x31')]=_[_0x07c8('0x32')](_0x50dbec[_0x07c8('0x31')]);_0xd7edf9['filters']=_[_0x07c8('0x33')](_0xd7edf9[_0x07c8('0x30')],_0xd7edf9['query']);_0x4d7c4e[_0x07c8('0x34')]=_[_0x07c8('0x33')](_0xd7edf9[_0x07c8('0x30')],qs[_0x07c8('0x35')](_0x50dbec[_0x07c8('0x31')][_0x07c8('0x35')]));_0x4d7c4e[_0x07c8('0x34')]=_0x4d7c4e['attributes'][_0x07c8('0x36')]?_0x4d7c4e[_0x07c8('0x34')]:_0xd7edf9[_0x07c8('0x30')];if(!_0x50dbec[_0x07c8('0x31')][_0x07c8('0x37')](_0x07c8('0x38'))){_0x4d7c4e[_0x07c8('0x1b')]=qs[_0x07c8('0x1b')](_0x50dbec[_0x07c8('0x31')]['limit']);_0x4d7c4e[_0x07c8('0x19')]=qs[_0x07c8('0x19')](_0x50dbec[_0x07c8('0x31')][_0x07c8('0x19')]);}_0x4d7c4e[_0x07c8('0x39')]=qs[_0x07c8('0x3a')](_0x50dbec[_0x07c8('0x31')][_0x07c8('0x3a')]);_0x4d7c4e['where']=qs['filters'](_[_0x07c8('0x3b')](_0x50dbec[_0x07c8('0x31')],_0xd7edf9['filters']),_0x300682);if(_0x50dbec[_0x07c8('0x31')][_0x07c8('0x3c')]){_0x4d7c4e['where']=_[_0x07c8('0x3d')](_0x4d7c4e[_0x07c8('0x3e')],{'$or':_[_0x07c8('0x2a')](_0x300682,function(_0x233af2){if(_0x233af2[_0x07c8('0x2e')]!==_0x07c8('0x3f')){var _0x230c1a={};_0x230c1a[_0x233af2[_0x07c8('0x27')]]={'$like':'%'+_0x50dbec['query'][_0x07c8('0x3c')]+'%'};return _0x230c1a;}})});}_0x4d7c4e=_['merge']({},_0x4d7c4e,_0x50dbec[_0x07c8('0x40')]);var _0x207a82={'where':_0x4d7c4e[_0x07c8('0x3e')]};return db[_0x07c8('0x2b')][_0x07c8('0x1c')](_0x207a82)['then'](function(_0x5e88b){_0x26deb0[_0x07c8('0x1c')]=_0x5e88b;if(_0x50dbec[_0x07c8('0x31')]['includeAll']){_0x4d7c4e['include']=[{'all':!![]}];}return db[_0x07c8('0x2b')][_0x07c8('0x41')](_0x4d7c4e);})[_0x07c8('0x23')](function(_0x435908){_0x26deb0['rows']=_0x435908;return _0x26deb0;})[_0x07c8('0x23')](respondWithFilteredResult(_0x3132b0,_0x4d7c4e))[_0x07c8('0x42')](handleError(_0x3132b0,null));};exports[_0x07c8('0x43')]=function(_0x28ea4b,_0x18e443){var _0x298f41={'raw':![],'where':{'id':_0x28ea4b[_0x07c8('0x44')]['id']}},_0x1a574d={};_0x1a574d['model']=_['keys'](db[_0x07c8('0x2b')]['rawAttributes']);_0x1a574d[_0x07c8('0x31')]=_['keys'](_0x28ea4b[_0x07c8('0x31')]);_0x1a574d['filters']=_['intersection'](_0x1a574d[_0x07c8('0x30')],_0x1a574d[_0x07c8('0x31')]);_0x298f41[_0x07c8('0x34')]=_[_0x07c8('0x33')](_0x1a574d[_0x07c8('0x30')],qs[_0x07c8('0x35')](_0x28ea4b[_0x07c8('0x31')][_0x07c8('0x35')]));_0x298f41[_0x07c8('0x34')]=_0x298f41[_0x07c8('0x34')]['length']?_0x298f41['attributes']:_0x1a574d['model'];if(_0x28ea4b[_0x07c8('0x31')][_0x07c8('0x45')]){_0x298f41[_0x07c8('0x46')]=[{'all':!![]}];}_0x298f41=_[_0x07c8('0x3d')]({},_0x298f41,_0x28ea4b['options']);return db[_0x07c8('0x2b')]['find'](_0x298f41)[_0x07c8('0x23')](handleEntityNotFound(_0x18e443,null))['then'](respondWithResult(_0x18e443,null))[_0x07c8('0x42')](handleError(_0x18e443,null));};exports[_0x07c8('0x47')]=function(_0x264b33,_0x40754e){return db[_0x07c8('0x2b')][_0x07c8('0x47')](_0x264b33[_0x07c8('0x48')],{})[_0x07c8('0x23')](function(_0x4ba4e3){var _0x33be4d=_0x264b33['user'][_0x07c8('0x24')]({'plain':!![]});if(!_0x33be4d)throw new Error(_0x07c8('0x49'));if(_0x33be4d[_0x07c8('0x4a')]===_0x07c8('0x4b')){var _0x53b280=_0x4ba4e3[_0x07c8('0x24')]({'plain':!![]});var _0xa8b33c=_0x07c8('0x4c');return db['UserProfileSection'][_0x07c8('0x4d')]({'where':{'name':_0xa8b33c,'userProfileId':_0x33be4d[_0x07c8('0x4e')]},'raw':!![]})[_0x07c8('0x23')](function(_0x5a65ec){if(_0x5a65ec&&_0x5a65ec['autoAssociation']===0x0){return db[_0x07c8('0x4f')]['create']({'name':_0x53b280['name'],'resourceId':_0x53b280['id'],'type':_0x5a65ec['name'],'sectionId':_0x5a65ec['id']},{})[_0x07c8('0x23')](function(){return _0x4ba4e3;});}else{return _0x4ba4e3;}})[_0x07c8('0x42')](function(_0x47aa2a){logger[_0x07c8('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x47aa2a);throw _0x47aa2a;});}return _0x4ba4e3;})[_0x07c8('0x23')](respondWithResult(_0x40754e,0xc9))['catch'](handleError(_0x40754e,null));};exports['clone']=function(_0x16786b,_0x2181cc){var _0x595dae={'where':{'id':_0x16786b['params']['id']}},_0x428dac={};_0x428dac[_0x07c8('0x30')]=_[_0x07c8('0x32')](db[_0x07c8('0x2b')][_0x07c8('0x2c')]);_0x595dae[_0x07c8('0x34')]=_[_0x07c8('0x33')](_0x428dac[_0x07c8('0x30')],qs[_0x07c8('0x35')](_0x16786b[_0x07c8('0x31')][_0x07c8('0x35')]));_0x595dae[_0x07c8('0x34')]=_0x595dae[_0x07c8('0x34')][_0x07c8('0x36')]?_0x595dae[_0x07c8('0x34')]:_0x428dac[_0x07c8('0x30')];if(_0x16786b[_0x07c8('0x31')][_0x07c8('0x45')]){_0x595dae['include']=[{'all':!![]}];}_0x595dae=_['merge']({},_0x595dae,_0x16786b[_0x07c8('0x40')]);return db['JscriptyProject']['find'](_0x595dae)['then'](handleEntityNotFound(_0x2181cc,null))[_0x07c8('0x23')](function(_0xb064a0){if(_0xb064a0){var _0x526b51=_0xb064a0[_0x07c8('0x24')]({'plain':!![]});_0x526b51=qs[_0x07c8('0x50')](_0x526b51,['id',_0x07c8('0x51'),_0x07c8('0x52')]);_0x16786b[_0x07c8('0x48')]=_[_0x07c8('0x50')](_0x16786b[_0x07c8('0x48')],['id','createdAt',_0x07c8('0x52')]);return db['JscriptyProject'][_0x07c8('0x47')](_[_0x07c8('0x3d')](_0x526b51,_0x16786b['body']),{'include':_0x16786b[_0x07c8('0x31')][_0x07c8('0x45')]?[{'all':!![]}]:undefined})[_0x07c8('0x23')](function(_0x556f91){var _0x1ea139=_0x16786b[_0x07c8('0x4b')][_0x07c8('0x24')]({'plain':!![]});if(!_0x1ea139)throw new Error(_0x07c8('0x49'));if(_0x1ea139[_0x07c8('0x4a')]===_0x07c8('0x4b')){var _0x2b58a7=_0x556f91[_0x07c8('0x24')]({'plain':!![]});var _0x23e6be=_0x07c8('0x4c');return db[_0x07c8('0x53')]['find']({'where':{'name':_0x23e6be,'userProfileId':_0x1ea139['userProfileId']},'raw':!![]})[_0x07c8('0x23')](function(_0x16cda8){if(_0x16cda8&&_0x16cda8[_0x07c8('0x54')]===0x0){return db[_0x07c8('0x4f')][_0x07c8('0x47')]({'name':_0x2b58a7[_0x07c8('0x27')],'resourceId':_0x2b58a7['id'],'type':_0x16cda8[_0x07c8('0x27')],'sectionId':_0x16cda8['id']},{})[_0x07c8('0x23')](function(){return _0x556f91;});}else{return _0x556f91;}})[_0x07c8('0x42')](function(_0x4a6c60){logger[_0x07c8('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4a6c60);throw _0x4a6c60;});}return _0x556f91;});}})[_0x07c8('0x23')](respondWithResult(_0x2181cc,0xc9))[_0x07c8('0x42')](handleError(_0x2181cc,null));};exports[_0x07c8('0x21')]=function(_0x14a4a9,_0x484e3d){if(_0x14a4a9[_0x07c8('0x48')]['id']){delete _0x14a4a9[_0x07c8('0x48')]['id'];}return db['JscriptyProject'][_0x07c8('0x4d')]({'where':{'id':_0x14a4a9[_0x07c8('0x44')]['id']}})['then'](handleEntityNotFound(_0x484e3d,null))[_0x07c8('0x23')](saveUpdates(_0x14a4a9[_0x07c8('0x48')],null))[_0x07c8('0x23')](respondWithResult(_0x484e3d,null))[_0x07c8('0x42')](handleError(_0x484e3d,null));};exports[_0x07c8('0x22')]=function(_0x4024af,_0x506242){return db[_0x07c8('0x2b')]['find']({'where':{'id':_0x4024af[_0x07c8('0x44')]['id']}})['then'](handleEntityNotFound(_0x506242,null))['then'](removeEntity(_0x506242,null))[_0x07c8('0x42')](handleError(_0x506242,null));};exports[_0x07c8('0x55')]=function(_0x56874b,_0x242bfc,_0x239499){var _0x33d0a0={'raw':!![],'where':{}};var _0x4d1086={};var _0xd9d1dc={'count':0x0,'rows':[]};return db[_0x07c8('0x2b')][_0x07c8('0x56')]({'where':{'id':_0x56874b[_0x07c8('0x44')]['id']}})[_0x07c8('0x23')](handleEntityNotFound(_0x242bfc,null))[_0x07c8('0x23')](function(_0x17abad){if(_0x17abad){_0x4d1086[_0x07c8('0x30')]=_['keys'](db[_0x07c8('0x57')]['rawAttributes']);_0x4d1086[_0x07c8('0x31')]=_['keys'](_0x56874b[_0x07c8('0x31')]);_0x4d1086[_0x07c8('0x58')]=_[_0x07c8('0x33')](_0x4d1086['model'],_0x4d1086[_0x07c8('0x31')]);_0x33d0a0[_0x07c8('0x34')]=_[_0x07c8('0x33')](_0x4d1086[_0x07c8('0x30')],qs[_0x07c8('0x35')](_0x56874b[_0x07c8('0x31')]['fields']));_0x33d0a0[_0x07c8('0x34')]=_0x33d0a0[_0x07c8('0x34')]['length']?_0x33d0a0[_0x07c8('0x34')]:_0x4d1086[_0x07c8('0x30')];if(!_0x56874b[_0x07c8('0x31')][_0x07c8('0x37')](_0x07c8('0x38'))){_0x33d0a0[_0x07c8('0x1b')]=qs[_0x07c8('0x1b')](_0x56874b[_0x07c8('0x31')]['limit']);_0x33d0a0[_0x07c8('0x19')]=qs[_0x07c8('0x19')](_0x56874b[_0x07c8('0x31')]['offset']);}_0x33d0a0[_0x07c8('0x39')]=qs['sort'](_0x56874b[_0x07c8('0x31')][_0x07c8('0x3a')]);_0x33d0a0[_0x07c8('0x3e')]=qs['filters'](_[_0x07c8('0x3b')](_0x56874b['query'],_0x4d1086['filters']));_0x33d0a0[_0x07c8('0x3e')][_0x07c8('0x59')]=_0x17abad['id'];if(_0x56874b[_0x07c8('0x31')][_0x07c8('0x3c')]){_0x33d0a0[_0x07c8('0x3e')]=_['merge'](_0x33d0a0[_0x07c8('0x3e')],{'$or':_[_0x07c8('0x2a')](_0x33d0a0[_0x07c8('0x34')],function(_0x3f2e46){var _0x16041c={};_0x16041c[_0x3f2e46]={'$like':'%'+_0x56874b[_0x07c8('0x31')][_0x07c8('0x3c')]+'%'};return _0x16041c;})});}_0x33d0a0=_['merge']({},_0x33d0a0,_0x56874b[_0x07c8('0x40')]);return db[_0x07c8('0x57')][_0x07c8('0x1c')]({'where':_0x33d0a0[_0x07c8('0x3e')]})[_0x07c8('0x23')](function(_0xfc349c){_0xd9d1dc[_0x07c8('0x1c')]=_0xfc349c;if(_0x56874b['query'][_0x07c8('0x45')]){_0x33d0a0[_0x07c8('0x46')]=[{'all':!![]}];}return db['JscriptySessionReport']['findAll'](_0x33d0a0);})[_0x07c8('0x23')](function(_0x28df2c){_0xd9d1dc['rows']=_0x28df2c;return _0xd9d1dc;});}})[_0x07c8('0x23')](respondWithFilteredResult(_0x242bfc,_0x33d0a0))['catch'](handleError(_0x242bfc,null));};exports[_0x07c8('0x5a')]=function(_0x18a5ec,_0x3342da,_0x46fd72){var _0x2341a4={'raw':!![],'where':{}};var _0x3abfa9={};var _0x5413cb={'count':0x0,'rows':[]};return db[_0x07c8('0x2b')][_0x07c8('0x56')]({'where':{'id':_0x18a5ec[_0x07c8('0x44')]['id']}})[_0x07c8('0x23')](handleEntityNotFound(_0x3342da,null))['then'](function(_0x4329c0){if(_0x4329c0){_0x3abfa9[_0x07c8('0x30')]=_['keys'](db['JscriptyAnswerReport']['rawAttributes']);_0x3abfa9[_0x07c8('0x31')]=_[_0x07c8('0x32')](_0x18a5ec[_0x07c8('0x31')]);_0x3abfa9[_0x07c8('0x58')]=_['intersection'](_0x3abfa9[_0x07c8('0x30')],_0x3abfa9['query']);_0x2341a4['attributes']=_[_0x07c8('0x33')](_0x3abfa9['model'],qs[_0x07c8('0x35')](_0x18a5ec[_0x07c8('0x31')][_0x07c8('0x35')]));_0x2341a4['attributes']=_0x2341a4[_0x07c8('0x34')]['length']?_0x2341a4['attributes']:_0x3abfa9['model'];if(!_0x18a5ec[_0x07c8('0x31')][_0x07c8('0x37')]('nolimit')){_0x2341a4[_0x07c8('0x1b')]=qs['limit'](_0x18a5ec[_0x07c8('0x31')][_0x07c8('0x1b')]);_0x2341a4[_0x07c8('0x19')]=qs[_0x07c8('0x19')](_0x18a5ec['query'][_0x07c8('0x19')]);}_0x2341a4['order']=qs[_0x07c8('0x3a')](_0x18a5ec['query'][_0x07c8('0x3a')]);_0x2341a4['where']=qs[_0x07c8('0x58')](_[_0x07c8('0x3b')](_0x18a5ec['query'],_0x3abfa9[_0x07c8('0x58')]));_0x2341a4[_0x07c8('0x3e')][_0x07c8('0x59')]=_0x4329c0['id'];if(_0x18a5ec[_0x07c8('0x31')]['filter']){_0x2341a4[_0x07c8('0x3e')]=_['merge'](_0x2341a4[_0x07c8('0x3e')],{'$or':_['map'](_0x2341a4[_0x07c8('0x34')],function(_0x468c17){var _0x3890d0={};_0x3890d0[_0x468c17]={'$like':'%'+_0x18a5ec[_0x07c8('0x31')][_0x07c8('0x3c')]+'%'};return _0x3890d0;})});}_0x2341a4=_[_0x07c8('0x3d')]({},_0x2341a4,_0x18a5ec[_0x07c8('0x40')]);return db[_0x07c8('0x5b')]['count']({'where':_0x2341a4[_0x07c8('0x3e')]})[_0x07c8('0x23')](function(_0x516346){_0x5413cb[_0x07c8('0x1c')]=_0x516346;if(_0x18a5ec['query'][_0x07c8('0x45')]){_0x2341a4[_0x07c8('0x46')]=[{'all':!![]}];}return db[_0x07c8('0x5b')][_0x07c8('0x41')](_0x2341a4);})['then'](function(_0x2eb084){_0x5413cb[_0x07c8('0x5c')]=_0x2eb084;return _0x5413cb;});}})[_0x07c8('0x23')](respondWithFilteredResult(_0x3342da,_0x2341a4))['catch'](handleError(_0x3342da,null));};function char(_0x5d4048){return'number'===typeof _0x5d4048?String[_0x07c8('0x5d')][_0x07c8('0x1e')](null,arguments):_0x5d4048;}function needsEncapsulation(_0x2ccb94){return!!_0x2ccb94&&(_0x2ccb94[_0x07c8('0x5e')]()[_0x07c8('0x5f')](char(0xd))>=0x0||_0x2ccb94[_0x07c8('0x5e')]()[_0x07c8('0x5f')](char(0xa))>=0x0||_0x2ccb94[_0x07c8('0x5e')]()[_0x07c8('0x5f')](char(0x2c))>=0x0||_0x2ccb94[_0x07c8('0x5e')]()[_0x07c8('0x5f')](char(0x22))>=0x0);}function encapsulate(_0x5ef448){var _0x1d9a95=char(0x22),_0x391552='\x5c'+char(0x22),_0xb06eed=_0x5ef448[_0x07c8('0x5e')]()[_0x07c8('0x60')](new RegExp(_0x1d9a95,'g'),_0x391552);return _0x1d9a95+_0xb06eed+_0x1d9a95;}exports[_0x07c8('0x61')]=function(_0x36ce4e,_0x139e5c,_0x5b36d8){var _0x2c9ca8,_0x40582b;var _0x28dadc={'where':{'ProjectId':_0x36ce4e[_0x07c8('0x44')]['id']}};if(_0x36ce4e['query'][_0x07c8('0x62')]){_0x28dadc['where']['starttime']=JSON[_0x07c8('0x63')](_0x36ce4e[_0x07c8('0x31')]['startTime']);}return db[_0x07c8('0x57')][_0x07c8('0x41')](_0x28dadc)[_0x07c8('0x23')](handleEntityNotFound(_0x139e5c,null))[_0x07c8('0x23')](function(_0x567acd){if(_0x567acd){_0x2c9ca8=_0x567acd;return db[_0x07c8('0x64')][_0x07c8('0x41')]({'where':{'SessionId':{'$in':_[_0x07c8('0x2a')](_0x2c9ca8,'id')},'ProjectId':_0x36ce4e[_0x07c8('0x44')]['id']},'order':'-createdAt'});}})[_0x07c8('0x23')](handleEntityNotFound(_0x139e5c,null))['then'](function(_0x50d965){if(_0x50d965){_0x40582b=_0x50d965;var _0x5891bc={};for(var _0x2ce952=0x0,_0x347f68=_0x40582b[_0x07c8('0x36')];_0x2ce952<_0x347f68;_0x2ce952++){if(!_0x5891bc[_0x07c8('0x37')](_0x40582b[_0x2ce952][_0x07c8('0x65')])){_0x5891bc[_0x40582b[_0x2ce952][_0x07c8('0x65')]]=needsEncapsulation(_0x40582b[_0x2ce952][_0x07c8('0x66')])?encapsulate(_0x40582b[_0x2ce952]['question']):_0x40582b[_0x2ce952][_0x07c8('0x66')];}}var _0x4f4e56=[],_0x589ac3={};for(var _0x2aa164=0x0,_0x4c06dd=_0x2c9ca8[_0x07c8('0x36')];_0x2aa164<_0x4c06dd;_0x2aa164++){_0x589ac3={'ProjectId':_0x36ce4e[_0x07c8('0x44')]['id'],'SessionId':_0x2c9ca8[_0x2aa164]['id'],'StartTime':moment(_0x2c9ca8[_0x2aa164]['starttime'])[_0x07c8('0x67')](_0x07c8('0x68'))};for(var _0x1b6612=0x0,_0x1a529c=_0x40582b['length'];_0x1b6612<_0x1a529c;_0x1b6612++){if(_0x40582b[_0x1b6612][_0x07c8('0x69')]==_0x2c9ca8[_0x2aa164]['id']&&_0x5891bc[_0x07c8('0x37')](_0x40582b[_0x1b6612][_0x07c8('0x65')])){_0x589ac3[_0x5891bc[_0x40582b[_0x1b6612][_0x07c8('0x65')]]]=_0x40582b[_0x1b6612][_0x07c8('0x6a')];}}for(var _0x12ca68 in _0x5891bc){if(!_0x589ac3[_0x07c8('0x37')](_0x5891bc[_0x12ca68])){_0x589ac3[_0x5891bc[_0x12ca68]]=null;}}_0x4f4e56['push'](_0x589ac3);}return _0x4f4e56;}})[_0x07c8('0x23')](function(_0x30a748){if(!_['isEmpty'](_0x30a748)){var _0x50eedd=toCsv(_0x30a748);var _0x13ddc1=Date[_0x07c8('0x6b')]();fs['writeFileSync'](util[_0x07c8('0x67')](_0x07c8('0x6c'),_0x36ce4e[_0x07c8('0x44')]['id'],_0x13ddc1),_0x50eedd);_0x139e5c[_0x07c8('0x6d')]('Content-disposition',_0x07c8('0x6e')+util[_0x07c8('0x67')](_0x07c8('0x6f'),_0x36ce4e[_0x07c8('0x44')]['id'],_0x13ddc1));_0x139e5c['setHeader'](_0x07c8('0x70'),_0x07c8('0x71'));return _0x139e5c[_0x07c8('0x72')](util[_0x07c8('0x67')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x36ce4e[_0x07c8('0x44')]['id'],_0x13ddc1));}else{return _0x139e5c['sendStatus'](0xcc);}})[_0x07c8('0x42')](handleError(_0x139e5c,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 2b052d3..65a4b32 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 _0xeb79=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./jscriptyProject.attributes','exports','define','jscripty_projects'];(function(_0x50d757,_0x17458d){var _0x467560=function(_0x16aa0f){while(--_0x16aa0f){_0x50d757['push'](_0x50d757['shift']());}};_0x467560(++_0x17458d);}(_0xeb79,0x87));var _0x9eb7=function(_0x2bf67e,_0x16d378){_0x2bf67e=_0x2bf67e-0x0;var _0x5138d5=_0xeb79[_0x2bf67e];return _0x5138d5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9eb7('0x0'))('api');var moment=require(_0x9eb7('0x1'));var BPromise=require('bluebird');var rp=require(_0x9eb7('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9eb7('0x3'));var config=require(_0x9eb7('0x4'));var attributes=require(_0x9eb7('0x5'));module[_0x9eb7('0x6')]=function(_0x58bc03,_0x501d0c){return _0x58bc03[_0x9eb7('0x7')]('JscriptyProject',attributes,{'tableName':_0x9eb7('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xac31=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','define','JscriptyProject','jscripty_projects','lodash','util'];(function(_0x5b5603,_0x2abf98){var _0x402979=function(_0x128f73){while(--_0x128f73){_0x5b5603['push'](_0x5b5603['shift']());}};_0x402979(++_0x2abf98);}(_0xac31,0xca));var _0x1ac3=function(_0x547e37,_0x2d5852){_0x547e37=_0x547e37-0x0;var _0x3eaa7d=_0xac31[_0x547e37];return _0x3eaa7d;};'use strict';var _=require(_0x1ac3('0x0'));var util=require(_0x1ac3('0x1'));var logger=require(_0x1ac3('0x2'))(_0x1ac3('0x3'));var moment=require(_0x1ac3('0x4'));var BPromise=require(_0x1ac3('0x5'));var rp=require(_0x1ac3('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1ac3('0x7'));var config=require(_0x1ac3('0x8'));var attributes=require('./jscriptyProject.attributes');module['exports']=function(_0xbe22b7,_0x20027f){return _0xbe22b7[_0x1ac3('0x9')](_0x1ac3('0xa'),attributes,{'tableName':_0x1ac3('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 61999e4..451e835 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 _0xaa88=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','error','JscriptyProject,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird'];(function(_0x5bd60b,_0x13465a){var _0x2dcff0=function(_0x31079c){while(--_0x31079c){_0x5bd60b['push'](_0x5bd60b['shift']());}};_0x2dcff0(++_0x13465a);}(_0xaa88,0x137));var _0x8aa8=function(_0x3e8270,_0x293590){_0x3e8270=_0x3e8270-0x0;var _0x1ccde9=_0xaa88[_0x3e8270];return _0x1ccde9;};'use strict';var _=require(_0x8aa8('0x0'));var util=require(_0x8aa8('0x1'));var moment=require(_0x8aa8('0x2'));var BPromise=require(_0x8aa8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8aa8('0x4'));var db=require(_0x8aa8('0x5'))['db'];var utils=require(_0x8aa8('0x6'));var logger=require(_0x8aa8('0x7'))(_0x8aa8('0x8'));var config=require(_0x8aa8('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8aa8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5264ff,_0x449d2d,_0x1ed84d){return new BPromise(function(_0x27c08d,_0x40826f){return client['request'](_0x5264ff,_0x1ed84d)[_0x8aa8('0xb')](function(_0x2d974c){logger[_0x8aa8('0xc')]('JscriptyProject,\x20%s,\x20%s',_0x449d2d,_0x8aa8('0xd'));logger[_0x8aa8('0xe')](_0x8aa8('0xf'),_0x449d2d,_0x8aa8('0xd'),JSON['stringify'](_0x2d974c));if(_0x2d974c[_0x8aa8('0x10')]){if(_0x2d974c[_0x8aa8('0x10')]['code']===0x1f4){logger[_0x8aa8('0x10')](_0x8aa8('0x11'),_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x40826f(_0x2d974c[_0x8aa8('0x10')][_0x8aa8('0x12')]);}logger[_0x8aa8('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x27c08d(_0x2d974c['error'][_0x8aa8('0x12')]);}else{logger[_0x8aa8('0xc')](_0x8aa8('0x11'),_0x449d2d,_0x8aa8('0xd'));_0x27c08d(_0x2d974c[_0x8aa8('0x13')][_0x8aa8('0x12')]);}})[_0x8aa8('0x14')](function(_0xd59fb8){logger[_0x8aa8('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x449d2d,_0xd59fb8);_0x40826f(_0xd59fb8);});});} \ No newline at end of file +var _0xf4eb=['JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x5c70d0,_0xfeac42){var _0x484491=function(_0x533149){while(--_0x533149){_0x5c70d0['push'](_0x5c70d0['shift']());}};_0x484491(++_0xfeac42);}(_0xf4eb,0xec));var _0xbf4e=function(_0x254cba,_0x338141){_0x254cba=_0x254cba-0x0;var _0x49463a=_0xf4eb[_0x254cba];return _0x49463a;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf4e('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbf4e('0x2'))(_0xbf4e('0x3'));var config=require(_0xbf4e('0x4'));var jayson=require(_0xbf4e('0x5'));var client=jayson[_0xbf4e('0x6')][_0xbf4e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x15b99f,_0x540736,_0x449d55){return new BPromise(function(_0x5013c2,_0x5e23d4){return client[_0xbf4e('0x8')](_0x15b99f,_0x449d55)[_0xbf4e('0x9')](function(_0xcc4097){logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));logger[_0xbf4e('0xd')]('JscriptyProject,\x20%s,\x20%s,\x20%s',_0x540736,'request\x20sent',JSON[_0xbf4e('0xe')](_0xcc4097));if(_0xcc4097['error']){if(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x10')]===0x1f4){logger['error'](_0xbf4e('0xb'),_0x540736,_0xcc4097['error']['message']);return _0x5e23d4(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);}logger[_0xbf4e('0xf')](_0xbf4e('0xb'),_0x540736,_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);return _0x5013c2(_0xcc4097['error']['message']);}else{logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));_0x5013c2(_0xcc4097['result'][_0xbf4e('0x11')]);}})[_0xbf4e('0x12')](function(_0x912fc0){logger[_0xbf4e('0xf')]('JscriptyProject,\x20%s,\x20%s',_0x540736,_0x912fc0);_0x5e23d4(_0x912fc0);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index f6de300..cfdb0ed 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 _0x1171=['post','update','delete','exports','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','index','/describe','/:id','show'];(function(_0xa3d3ae,_0x321f1c){var _0x46a3ce=function(_0x1e9dcb){while(--_0x1e9dcb){_0xa3d3ae['push'](_0xa3d3ae['shift']());}};_0x46a3ce(++_0x321f1c);}(_0x1171,0x1be));var _0x1117=function(_0x1b5805,_0x1d1f54){_0x1b5805=_0x1b5805-0x0;var _0x4b0de6=_0x1171[_0x1b5805];return _0x4b0de6;};'use strict';var multer=require('multer');var util=require(_0x1117('0x0'));var path=require(_0x1117('0x1'));var timeout=require('connect-timeout');var express=require(_0x1117('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1117('0x3'));var interaction=require(_0x1117('0x4'));var config=require(_0x1117('0x5'));var controller=require(_0x1117('0x6'));router[_0x1117('0x7')]('/',auth[_0x1117('0x8')](),controller[_0x1117('0x9')]);router[_0x1117('0x7')](_0x1117('0xa'),auth[_0x1117('0x8')](),controller['describe']);router[_0x1117('0x7')](_0x1117('0xb'),auth[_0x1117('0x8')](),controller[_0x1117('0xc')]);router[_0x1117('0xd')]('/',auth[_0x1117('0x8')](),controller['create']);router['put']('/:id',auth[_0x1117('0x8')](),controller[_0x1117('0xe')]);router[_0x1117('0xf')]('/:id',auth[_0x1117('0x8')](),controller['destroy']);module[_0x1117('0x10')]=router; \ No newline at end of file +var _0x903d=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','index','/describe','describe','/:id','put','update','delete','destroy','exports','util','path','connect-timeout','Router'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x903d,0x1b4));var _0xd903=function(_0xf1b44d,_0xfdef4c){_0xf1b44d=_0xf1b44d-0x0;var _0x3d8dfb=_0x903d[_0xf1b44d];return _0x3d8dfb;};'use strict';var multer=require('multer');var util=require(_0xd903('0x0'));var path=require(_0xd903('0x1'));var timeout=require(_0xd903('0x2'));var express=require('express');var router=express[_0xd903('0x3')]();var fs_extra=require(_0xd903('0x4'));var auth=require(_0xd903('0x5'));var interaction=require(_0xd903('0x6'));var config=require(_0xd903('0x7'));var controller=require(_0xd903('0x8'));router[_0xd903('0x9')]('/',auth[_0xd903('0xa')](),controller[_0xd903('0xb')]);router[_0xd903('0x9')](_0xd903('0xc'),auth[_0xd903('0xa')](),controller[_0xd903('0xd')]);router[_0xd903('0x9')](_0xd903('0xe'),auth[_0xd903('0xa')](),controller['show']);router['post']('/',auth[_0xd903('0xa')](),controller['create']);router[_0xd903('0xf')](_0xd903('0xe'),auth[_0xd903('0xa')](),controller[_0xd903('0x10')]);router[_0xd903('0x11')](_0xd903('0xe'),auth[_0xd903('0xa')](),controller[_0xd903('0x12')]);module[_0xd903('0x13')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index e42cd28..e68f161 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(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0x7a54,0x106));var _0x47a5=function(_0xf5a1f9,_0x36889f){_0xf5a1f9=_0xf5a1f9-0x0;var _0x5a8156=_0x7a54[_0xf5a1f9];return _0x5a8156;};'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(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0x7a54,0x106));var _0x47a5=function(_0x32285e,_0x5e5694){_0x32285e=_0x32285e-0x0;var _0x4f29c2=_0x7a54[_0x32285e];return _0x4f29c2;};'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 25b1ea9..668ec00 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 _0x75e4=['request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','JscriptyQuestionReport','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','type','VIRTUAL','includeAll','include','rows','catch','show','params','options','create','body','find','describe','rimraf','fast-json-patch'];(function(_0x57d57e,_0x285579){var _0x4331a3=function(_0x5b6d8a){while(--_0x5b6d8a){_0x57d57e['push'](_0x57d57e['shift']());}};_0x4331a3(++_0x285579);}(_0x75e4,0x92));var _0x475e=function(_0x237546,_0xa81b26){_0x237546=_0x237546-0x0;var _0x233e29=_0x75e4[_0x237546];return _0x233e29;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x475e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x475e('0x1'));var rp=require(_0x475e('0x2'));var moment=require(_0x475e('0x3'));var BPromise=require(_0x475e('0x4'));var Mustache=require(_0x475e('0x5'));var util=require(_0x475e('0x6'));var path=require('path');var sox=require(_0x475e('0x7'));var csv=require(_0x475e('0x8'));var ejs=require(_0x475e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x475e('0xa'));var squel=require(_0x475e('0xb'));var crypto=require(_0x475e('0xc'));var jsforce=require(_0x475e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x475e('0x8'));var querystring=require(_0x475e('0xe'));var Papa=require('papaparse');var Redis=require(_0x475e('0xf'));var authService=require(_0x475e('0x10'));var qs=require(_0x475e('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x475e('0x12'));var logger=require('../../config/logger')(_0x475e('0x13'));var utils=require(_0x475e('0x14'));var config=require(_0x475e('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2851c0,_0x470d2d){_0x470d2d=_0x470d2d||0xcc;return function(_0x534cf3){if(_0x534cf3){return _0x2851c0[_0x475e('0x16')](_0x470d2d);}return _0x2851c0[_0x475e('0x17')](_0x470d2d)['end']();};}function respondWithResult(_0x519736,_0x2b4140){_0x2b4140=_0x2b4140||0xc8;return function(_0xd7bd1a){if(_0xd7bd1a){return _0x519736[_0x475e('0x17')](_0x2b4140)[_0x475e('0x18')](_0xd7bd1a);}};}function respondWithFilteredResult(_0x21b8f5,_0x580ca3){return function(_0x54e7f0){if(_0x54e7f0){var _0x4047dd=typeof _0x580ca3[_0x475e('0x19')]===_0x475e('0x1a')&&typeof _0x580ca3['limit']===_0x475e('0x1a');var _0x1d5e2c=_0x54e7f0['count'];var _0x3c5744=_0x4047dd?0x0:_0x580ca3[_0x475e('0x19')];var _0x59a826=_0x4047dd?_0x54e7f0[_0x475e('0x1b')]:_0x580ca3[_0x475e('0x19')]+_0x580ca3[_0x475e('0x1c')];var _0x21fd72;if(_0x59a826>=_0x1d5e2c){_0x59a826=_0x1d5e2c;_0x21fd72=0xc8;}else{_0x21fd72=0xce;}_0x21b8f5['status'](_0x21fd72);return _0x21b8f5[_0x475e('0x1d')](_0x475e('0x1e'),_0x3c5744+'-'+_0x59a826+'/'+_0x1d5e2c)[_0x475e('0x18')](_0x54e7f0);}return null;};}function patchUpdates(_0x75c9c2){return function(_0x1db4ab){try{jsonpatch[_0x475e('0x1f')](_0x1db4ab,_0x75c9c2,!![]);}catch(_0x2a4470){return BPromise['reject'](_0x2a4470);}return _0x1db4ab[_0x475e('0x20')]();};}function saveUpdates(_0x9905b6,_0x4e7662){return function(_0x5dbaab){if(_0x5dbaab){return _0x5dbaab[_0x475e('0x21')](_0x9905b6)[_0x475e('0x22')](function(_0x31c89f){return _0x31c89f;});}return null;};}function removeEntity(_0x14700e,_0x1de032){return function(_0x4a031e){if(_0x4a031e){return _0x4a031e[_0x475e('0x23')]()['then'](function(){_0x14700e[_0x475e('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x281594,_0x5b599c){return function(_0x23ae5d){if(!_0x23ae5d){_0x281594[_0x475e('0x16')](0x194);}return _0x23ae5d;};}function handleError(_0x4c92fc,_0x3232aa){_0x3232aa=_0x3232aa||0x1f4;return function(_0x45e052){logger[_0x475e('0x24')](_0x45e052[_0x475e('0x25')]);if(_0x45e052['name']){delete _0x45e052[_0x475e('0x26')];}_0x4c92fc[_0x475e('0x17')](_0x3232aa)[_0x475e('0x27')](_0x45e052);};}exports[_0x475e('0x28')]=function(_0x53e54d,_0x197239){var _0x2e4a24={},_0x22aa0e={},_0xee09d2={'count':0x0,'rows':[]};var _0x5c2127=_[_0x475e('0x29')](db[_0x475e('0x2a')][_0x475e('0x2b')],function(_0x2b5155){return{'name':_0x2b5155[_0x475e('0x2c')],'type':_0x2b5155['type'][_0x475e('0x2d')]};});_0x22aa0e[_0x475e('0x2e')]=_['map'](_0x5c2127,_0x475e('0x26'));_0x22aa0e['query']=_[_0x475e('0x2f')](_0x53e54d[_0x475e('0x30')]);_0x22aa0e[_0x475e('0x31')]=_[_0x475e('0x32')](_0x22aa0e[_0x475e('0x2e')],_0x22aa0e[_0x475e('0x30')]);_0x2e4a24[_0x475e('0x33')]=_[_0x475e('0x32')](_0x22aa0e['model'],qs[_0x475e('0x34')](_0x53e54d[_0x475e('0x30')][_0x475e('0x34')]));_0x2e4a24[_0x475e('0x33')]=_0x2e4a24['attributes'][_0x475e('0x35')]?_0x2e4a24[_0x475e('0x33')]:_0x22aa0e[_0x475e('0x2e')];if(!_0x53e54d[_0x475e('0x30')][_0x475e('0x36')](_0x475e('0x37'))){_0x2e4a24[_0x475e('0x1c')]=qs[_0x475e('0x1c')](_0x53e54d['query']['limit']);_0x2e4a24[_0x475e('0x19')]=qs[_0x475e('0x19')](_0x53e54d[_0x475e('0x30')][_0x475e('0x19')]);}_0x2e4a24[_0x475e('0x38')]=qs['sort'](_0x53e54d[_0x475e('0x30')]['sort']);_0x2e4a24[_0x475e('0x39')]=qs['filters'](_[_0x475e('0x3a')](_0x53e54d['query'],_0x22aa0e['filters']),_0x5c2127);if(_0x53e54d[_0x475e('0x30')][_0x475e('0x3b')]){_0x2e4a24[_0x475e('0x39')]=_[_0x475e('0x3c')](_0x2e4a24[_0x475e('0x39')],{'$or':_[_0x475e('0x29')](_0x5c2127,function(_0x344238){if(_0x344238[_0x475e('0x3d')]!==_0x475e('0x3e')){var _0xa7416={};_0xa7416[_0x344238[_0x475e('0x26')]]={'$like':'%'+_0x53e54d[_0x475e('0x30')][_0x475e('0x3b')]+'%'};return _0xa7416;}})});}_0x2e4a24=_['merge']({},_0x2e4a24,_0x53e54d['options']);var _0x241b37={'where':_0x2e4a24[_0x475e('0x39')]};return db['JscriptyQuestionReport'][_0x475e('0x1b')](_0x241b37)[_0x475e('0x22')](function(_0x49d346){_0xee09d2[_0x475e('0x1b')]=_0x49d346;if(_0x53e54d['query'][_0x475e('0x3f')]){_0x2e4a24[_0x475e('0x40')]=[{'all':!![]}];}return db['JscriptyQuestionReport']['findAll'](_0x2e4a24);})[_0x475e('0x22')](function(_0x17b10d){_0xee09d2[_0x475e('0x41')]=_0x17b10d;return _0xee09d2;})['then'](respondWithFilteredResult(_0x197239,_0x2e4a24))[_0x475e('0x42')](handleError(_0x197239,null));};exports[_0x475e('0x43')]=function(_0x5535f1,_0x2c814c){var _0x45bc65={'raw':!![],'where':{'id':_0x5535f1[_0x475e('0x44')]['id']}},_0x4371c6={};_0x4371c6[_0x475e('0x2e')]=_['keys'](db[_0x475e('0x2a')][_0x475e('0x2b')]);_0x4371c6[_0x475e('0x30')]=_[_0x475e('0x2f')](_0x5535f1['query']);_0x4371c6[_0x475e('0x31')]=_[_0x475e('0x32')](_0x4371c6[_0x475e('0x2e')],_0x4371c6[_0x475e('0x30')]);_0x45bc65[_0x475e('0x33')]=_[_0x475e('0x32')](_0x4371c6[_0x475e('0x2e')],qs[_0x475e('0x34')](_0x5535f1['query'][_0x475e('0x34')]));_0x45bc65['attributes']=_0x45bc65[_0x475e('0x33')][_0x475e('0x35')]?_0x45bc65[_0x475e('0x33')]:_0x4371c6[_0x475e('0x2e')];if(_0x5535f1['query'][_0x475e('0x3f')]){_0x45bc65[_0x475e('0x40')]=[{'all':!![]}];}_0x45bc65=_[_0x475e('0x3c')]({},_0x45bc65,_0x5535f1[_0x475e('0x45')]);return db['JscriptyQuestionReport']['find'](_0x45bc65)[_0x475e('0x22')](handleEntityNotFound(_0x2c814c,null))[_0x475e('0x22')](respondWithResult(_0x2c814c,null))[_0x475e('0x42')](handleError(_0x2c814c,null));};exports[_0x475e('0x46')]=function(_0xfa6b1d,_0x340efa){return db[_0x475e('0x2a')]['create'](_0xfa6b1d[_0x475e('0x47')],{})['then'](respondWithResult(_0x340efa,0xc9))[_0x475e('0x42')](handleError(_0x340efa,null));};exports[_0x475e('0x21')]=function(_0x16a47e,_0xedabc8){if(_0x16a47e[_0x475e('0x47')]['id']){delete _0x16a47e[_0x475e('0x47')]['id'];}return db[_0x475e('0x2a')][_0x475e('0x48')]({'where':{'id':_0x16a47e[_0x475e('0x44')]['id']}})[_0x475e('0x22')](handleEntityNotFound(_0xedabc8,null))['then'](saveUpdates(_0x16a47e[_0x475e('0x47')],null))[_0x475e('0x22')](respondWithResult(_0xedabc8,null))[_0x475e('0x42')](handleError(_0xedabc8,null));};exports['destroy']=function(_0x45ff9a,_0x1fdfe2){return db['JscriptyQuestionReport']['find']({'where':{'id':_0x45ff9a['params']['id']}})[_0x475e('0x22')](handleEntityNotFound(_0x1fdfe2,null))['then'](removeEntity(_0x1fdfe2,null))[_0x475e('0x42')](handleError(_0x1fdfe2,null));};exports['describe']=function(_0x11378d,_0x4700ae){return db[_0x475e('0x2a')][_0x475e('0x49')]()[_0x475e('0x22')](respondWithResult(_0x4700ae,null))[_0x475e('0x42')](handleError(_0x4700ae,null));}; \ No newline at end of file +var _0x9d4c=['intersection','attributes','fields','nolimit','limit','sort','where','filter','merge','VIRTUAL','options','JscriptyQuestionReport','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','update','destroy','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','set','Content-Range','apply','save','then','stack','name','index','map','rawAttributes','type','key','model','query','keys','filters'];(function(_0x57d9da,_0x3487e0){var _0x1d8809=function(_0xd33054){while(--_0xd33054){_0x57d9da['push'](_0x57d9da['shift']());}};_0x1d8809(++_0x3487e0);}(_0x9d4c,0xaa));var _0xc9d4=function(_0x12b650,_0x22418f){_0x12b650=_0x12b650-0x0;var _0x39c3d5=_0x9d4c[_0x12b650];return _0x39c3d5;};'use strict';var emlformat=require(_0xc9d4('0x0'));var rimraf=require(_0xc9d4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc9d4('0x2'));var rp=require('request-promise');var moment=require(_0xc9d4('0x3'));var BPromise=require(_0xc9d4('0x4'));var Mustache=require('mustache');var util=require(_0xc9d4('0x5'));var path=require(_0xc9d4('0x6'));var sox=require(_0xc9d4('0x7'));var csv=require(_0xc9d4('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc9d4('0x9'));var _=require('lodash');var squel=require(_0xc9d4('0xa'));var crypto=require(_0xc9d4('0xb'));var jsforce=require(_0xc9d4('0xc'));var deskjs=require(_0xc9d4('0xd'));var toCsv=require(_0xc9d4('0x8'));var querystring=require(_0xc9d4('0xe'));var Papa=require(_0xc9d4('0xf'));var Redis=require('ioredis');var authService=require(_0xc9d4('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xc9d4('0x11'));var hardwareService=require(_0xc9d4('0x12'));var logger=require('../../config/logger')(_0xc9d4('0x13'));var utils=require(_0xc9d4('0x14'));var config=require(_0xc9d4('0x15'));var licenseUtil=require(_0xc9d4('0x16'));var db=require(_0xc9d4('0x17'))['db'];function respondWithStatusCode(_0x29c887,_0x309cc3){_0x309cc3=_0x309cc3||0xcc;return function(_0x2a2b63){if(_0x2a2b63){return _0x29c887[_0xc9d4('0x18')](_0x309cc3);}return _0x29c887[_0xc9d4('0x19')](_0x309cc3)[_0xc9d4('0x1a')]();};}function respondWithResult(_0x6da4a3,_0x2e07f4){_0x2e07f4=_0x2e07f4||0xc8;return function(_0x1be6b2){if(_0x1be6b2){return _0x6da4a3[_0xc9d4('0x19')](_0x2e07f4)['json'](_0x1be6b2);}};}function respondWithFilteredResult(_0x25e248,_0x4b4777){return function(_0xdb59cb){if(_0xdb59cb){var _0x5e2393=typeof _0x4b4777[_0xc9d4('0x1b')]===_0xc9d4('0x1c')&&typeof _0x4b4777['limit']===_0xc9d4('0x1c');var _0x29f1cf=_0xdb59cb[_0xc9d4('0x1d')];var _0x475fc8=_0x5e2393?0x0:_0x4b4777['offset'];var _0x558b12=_0x5e2393?_0xdb59cb[_0xc9d4('0x1d')]:_0x4b4777['offset']+_0x4b4777['limit'];var _0x1c52f5;if(_0x558b12>=_0x29f1cf){_0x558b12=_0x29f1cf;_0x1c52f5=0xc8;}else{_0x1c52f5=0xce;}_0x25e248[_0xc9d4('0x19')](_0x1c52f5);return _0x25e248[_0xc9d4('0x1e')](_0xc9d4('0x1f'),_0x475fc8+'-'+_0x558b12+'/'+_0x29f1cf)['json'](_0xdb59cb);}return null;};}function patchUpdates(_0x4e040d){return function(_0x5047b8){try{jsonpatch[_0xc9d4('0x20')](_0x5047b8,_0x4e040d,!![]);}catch(_0xdeceef){return BPromise['reject'](_0xdeceef);}return _0x5047b8[_0xc9d4('0x21')]();};}function saveUpdates(_0x6bad7d,_0x5f564c){return function(_0x1321da){if(_0x1321da){return _0x1321da['update'](_0x6bad7d)[_0xc9d4('0x22')](function(_0x125ebd){return _0x125ebd;});}return null;};}function removeEntity(_0xa1f9f0,_0x4a2f64){return function(_0x3c4a95){if(_0x3c4a95){return _0x3c4a95['destroy']()[_0xc9d4('0x22')](function(){_0xa1f9f0['status'](0xcc)[_0xc9d4('0x1a')]();});}};}function handleEntityNotFound(_0x47f9f6,_0x20774e){return function(_0x3176d6){if(!_0x3176d6){_0x47f9f6[_0xc9d4('0x18')](0x194);}return _0x3176d6;};}function handleError(_0x41acc2,_0x128113){_0x128113=_0x128113||0x1f4;return function(_0x4e4503){logger['error'](_0x4e4503[_0xc9d4('0x23')]);if(_0x4e4503[_0xc9d4('0x24')]){delete _0x4e4503[_0xc9d4('0x24')];}_0x41acc2['status'](_0x128113)['send'](_0x4e4503);};}exports[_0xc9d4('0x25')]=function(_0x2cb166,_0x1e6c39){var _0x387d0e={},_0x4a8a28={},_0x2ae94c={'count':0x0,'rows':[]};var _0x4ac81c=_[_0xc9d4('0x26')](db['JscriptyQuestionReport'][_0xc9d4('0x27')],function(_0x23b12b){return{'name':_0x23b12b['fieldName'],'type':_0x23b12b[_0xc9d4('0x28')][_0xc9d4('0x29')]};});_0x4a8a28[_0xc9d4('0x2a')]=_[_0xc9d4('0x26')](_0x4ac81c,'name');_0x4a8a28[_0xc9d4('0x2b')]=_[_0xc9d4('0x2c')](_0x2cb166[_0xc9d4('0x2b')]);_0x4a8a28[_0xc9d4('0x2d')]=_[_0xc9d4('0x2e')](_0x4a8a28[_0xc9d4('0x2a')],_0x4a8a28[_0xc9d4('0x2b')]);_0x387d0e[_0xc9d4('0x2f')]=_[_0xc9d4('0x2e')](_0x4a8a28['model'],qs[_0xc9d4('0x30')](_0x2cb166[_0xc9d4('0x2b')][_0xc9d4('0x30')]));_0x387d0e[_0xc9d4('0x2f')]=_0x387d0e['attributes']['length']?_0x387d0e['attributes']:_0x4a8a28[_0xc9d4('0x2a')];if(!_0x2cb166[_0xc9d4('0x2b')]['hasOwnProperty'](_0xc9d4('0x31'))){_0x387d0e['limit']=qs['limit'](_0x2cb166[_0xc9d4('0x2b')][_0xc9d4('0x32')]);_0x387d0e[_0xc9d4('0x1b')]=qs[_0xc9d4('0x1b')](_0x2cb166[_0xc9d4('0x2b')][_0xc9d4('0x1b')]);}_0x387d0e['order']=qs[_0xc9d4('0x33')](_0x2cb166[_0xc9d4('0x2b')][_0xc9d4('0x33')]);_0x387d0e[_0xc9d4('0x34')]=qs[_0xc9d4('0x2d')](_['pick'](_0x2cb166[_0xc9d4('0x2b')],_0x4a8a28[_0xc9d4('0x2d')]),_0x4ac81c);if(_0x2cb166[_0xc9d4('0x2b')][_0xc9d4('0x35')]){_0x387d0e[_0xc9d4('0x34')]=_[_0xc9d4('0x36')](_0x387d0e[_0xc9d4('0x34')],{'$or':_[_0xc9d4('0x26')](_0x4ac81c,function(_0x4aa93b){if(_0x4aa93b[_0xc9d4('0x28')]!==_0xc9d4('0x37')){var _0x4c20cd={};_0x4c20cd[_0x4aa93b['name']]={'$like':'%'+_0x2cb166[_0xc9d4('0x2b')]['filter']+'%'};return _0x4c20cd;}})});}_0x387d0e=_[_0xc9d4('0x36')]({},_0x387d0e,_0x2cb166[_0xc9d4('0x38')]);var _0x5bf17d={'where':_0x387d0e['where']};return db[_0xc9d4('0x39')][_0xc9d4('0x1d')](_0x5bf17d)[_0xc9d4('0x22')](function(_0x4109c5){_0x2ae94c[_0xc9d4('0x1d')]=_0x4109c5;if(_0x2cb166[_0xc9d4('0x2b')][_0xc9d4('0x3a')]){_0x387d0e[_0xc9d4('0x3b')]=[{'all':!![]}];}return db[_0xc9d4('0x39')][_0xc9d4('0x3c')](_0x387d0e);})[_0xc9d4('0x22')](function(_0x53cf30){_0x2ae94c[_0xc9d4('0x3d')]=_0x53cf30;return _0x2ae94c;})[_0xc9d4('0x22')](respondWithFilteredResult(_0x1e6c39,_0x387d0e))[_0xc9d4('0x3e')](handleError(_0x1e6c39,null));};exports[_0xc9d4('0x3f')]=function(_0xe5e387,_0x8cdfcd){var _0x198335={'raw':!![],'where':{'id':_0xe5e387[_0xc9d4('0x40')]['id']}},_0x45106e={};_0x45106e[_0xc9d4('0x2a')]=_['keys'](db[_0xc9d4('0x39')][_0xc9d4('0x27')]);_0x45106e[_0xc9d4('0x2b')]=_['keys'](_0xe5e387[_0xc9d4('0x2b')]);_0x45106e['filters']=_[_0xc9d4('0x2e')](_0x45106e[_0xc9d4('0x2a')],_0x45106e[_0xc9d4('0x2b')]);_0x198335['attributes']=_[_0xc9d4('0x2e')](_0x45106e['model'],qs['fields'](_0xe5e387[_0xc9d4('0x2b')][_0xc9d4('0x30')]));_0x198335[_0xc9d4('0x2f')]=_0x198335[_0xc9d4('0x2f')][_0xc9d4('0x41')]?_0x198335[_0xc9d4('0x2f')]:_0x45106e['model'];if(_0xe5e387[_0xc9d4('0x2b')]['includeAll']){_0x198335[_0xc9d4('0x3b')]=[{'all':!![]}];}_0x198335=_['merge']({},_0x198335,_0xe5e387[_0xc9d4('0x38')]);return db[_0xc9d4('0x39')][_0xc9d4('0x42')](_0x198335)['then'](handleEntityNotFound(_0x8cdfcd,null))['then'](respondWithResult(_0x8cdfcd,null))[_0xc9d4('0x3e')](handleError(_0x8cdfcd,null));};exports[_0xc9d4('0x43')]=function(_0x5959a8,_0x12e9dd){return db['JscriptyQuestionReport'][_0xc9d4('0x43')](_0x5959a8[_0xc9d4('0x44')],{})[_0xc9d4('0x22')](respondWithResult(_0x12e9dd,0xc9))[_0xc9d4('0x3e')](handleError(_0x12e9dd,null));};exports[_0xc9d4('0x45')]=function(_0x170955,_0x3d2d30){if(_0x170955['body']['id']){delete _0x170955[_0xc9d4('0x44')]['id'];}return db[_0xc9d4('0x39')]['find']({'where':{'id':_0x170955[_0xc9d4('0x40')]['id']}})[_0xc9d4('0x22')](handleEntityNotFound(_0x3d2d30,null))[_0xc9d4('0x22')](saveUpdates(_0x170955[_0xc9d4('0x44')],null))[_0xc9d4('0x22')](respondWithResult(_0x3d2d30,null))['catch'](handleError(_0x3d2d30,null));};exports[_0xc9d4('0x46')]=function(_0x534201,_0x53340d){return db[_0xc9d4('0x39')]['find']({'where':{'id':_0x534201[_0xc9d4('0x40')]['id']}})[_0xc9d4('0x22')](handleEntityNotFound(_0x53340d,null))['then'](removeEntity(_0x53340d,null))[_0xc9d4('0x3e')](handleError(_0x53340d,null));};exports[_0xc9d4('0x47')]=function(_0x59458d,_0x535068){return db[_0xc9d4('0x39')][_0xc9d4('0x47')]()['then'](respondWithResult(_0x535068,null))['catch'](handleError(_0x535068,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 20fcd38..cfbf556 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 _0xaf67=['JscriptyQuestionReport','report_jscripty_questions','util','moment','bluebird','path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','define'];(function(_0x50224a,_0x225d85){var _0x248354=function(_0x46a4e7){while(--_0x46a4e7){_0x50224a['push'](_0x50224a['shift']());}};_0x248354(++_0x225d85);}(_0xaf67,0x12e));var _0x7af6=function(_0x2b376c,_0x301c2a){_0x2b376c=_0x2b376c-0x0;var _0x4e7952=_0xaf67[_0x2b376c];return _0x4e7952;};'use strict';var _=require('lodash');var util=require(_0x7af6('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x7af6('0x1'));var BPromise=require(_0x7af6('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7af6('0x3'));var rimraf=require(_0x7af6('0x4'));var config=require(_0x7af6('0x5'));var attributes=require(_0x7af6('0x6'));module['exports']=function(_0x56087a,_0x4ffcf4){return _0x56087a[_0x7af6('0x7')](_0x7af6('0x8'),attributes,{'tableName':_0x7af6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8d5d=['api','bluebird','request-promise','rimraf','../../config/environment','exports','define','report_jscripty_questions','lodash','util','../../config/logger'];(function(_0x71fb3,_0x2b6e41){var _0x17cd49=function(_0x540588){while(--_0x540588){_0x71fb3['push'](_0x71fb3['shift']());}};_0x17cd49(++_0x2b6e41);}(_0x8d5d,0x110));var _0xd8d5=function(_0x425d50,_0x244fe6){_0x425d50=_0x425d50-0x0;var _0x2fe1f4=_0x8d5d[_0x425d50];return _0x2fe1f4;};'use strict';var _=require(_0xd8d5('0x0'));var util=require(_0xd8d5('0x1'));var logger=require(_0xd8d5('0x2'))(_0xd8d5('0x3'));var moment=require('moment');var BPromise=require(_0xd8d5('0x4'));var rp=require(_0xd8d5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd8d5('0x6'));var config=require(_0xd8d5('0x7'));var attributes=require('./jscriptyQuestionReport.attributes');module[_0xd8d5('0x8')]=function(_0x1ea942,_0x4d46ee){return _0x1ea942[_0xd8d5('0x9')]('JscriptyQuestionReport',attributes,{'tableName':_0xd8d5('0xa'),'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 f655031..55e917f 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 _0x3628=['request\x20sent','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','JscriptyQuestionReport,\x20%s,\x20%s'];(function(_0x44f011,_0x262232){var _0xe4ac6c=function(_0x3643fe){while(--_0x3643fe){_0x44f011['push'](_0x44f011['shift']());}};_0xe4ac6c(++_0x262232);}(_0x3628,0x1ec));var _0x8362=function(_0x4492af,_0x47e25d){_0x4492af=_0x4492af-0x0;var _0x216729=_0x3628[_0x4492af];return _0x216729;};'use strict';var _=require(_0x8362('0x0'));var util=require(_0x8362('0x1'));var moment=require('moment');var BPromise=require(_0x8362('0x2'));var rs=require(_0x8362('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8362('0x4'))['db'];var utils=require(_0x8362('0x5'));var logger=require('../../config/logger')(_0x8362('0x6'));var config=require(_0x8362('0x7'));var jayson=require(_0x8362('0x8'));var client=jayson[_0x8362('0x9')][_0x8362('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x18bdf7,_0x151d02,_0x331abb){return new BPromise(function(_0x5bf506,_0x436d01){return client['request'](_0x18bdf7,_0x331abb)[_0x8362('0xb')](function(_0x29532c){logger[_0x8362('0xc')](_0x8362('0xd'),_0x151d02,_0x8362('0xe'));logger['debug'](_0x8362('0xf'),_0x151d02,'request\x20sent',JSON[_0x8362('0x10')](_0x29532c));if(_0x29532c[_0x8362('0x11')]){if(_0x29532c[_0x8362('0x11')][_0x8362('0x12')]===0x1f4){logger[_0x8362('0x11')](_0x8362('0xd'),_0x151d02,_0x29532c[_0x8362('0x11')][_0x8362('0x13')]);return _0x436d01(_0x29532c['error'][_0x8362('0x13')]);}logger['error'](_0x8362('0xd'),_0x151d02,_0x29532c[_0x8362('0x11')]['message']);return _0x5bf506(_0x29532c['error'][_0x8362('0x13')]);}else{logger[_0x8362('0xc')](_0x8362('0xd'),_0x151d02,'request\x20sent');_0x5bf506(_0x29532c[_0x8362('0x14')][_0x8362('0x13')]);}})[_0x8362('0x15')](function(_0x953e95){logger[_0x8362('0x11')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x151d02,_0x953e95);_0x436d01(_0x953e95);});});} \ No newline at end of file +var _0xe675=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','JscriptyQuestionReport,\x20%s,\x20%s','debug','request\x20sent','error','message','result','catch','lodash','util','moment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe675,0xcf));var _0x5e67=function(_0x52bf4e,_0x309762){_0x52bf4e=_0x52bf4e-0x0;var _0x45c923=_0xe675[_0x52bf4e];return _0x45c923;};'use strict';var _=require(_0x5e67('0x0'));var util=require(_0x5e67('0x1'));var moment=require(_0x5e67('0x2'));var BPromise=require(_0x5e67('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5e67('0x4'));var db=require(_0x5e67('0x5'))['db'];var utils=require(_0x5e67('0x6'));var logger=require(_0x5e67('0x7'))(_0x5e67('0x8'));var config=require('../../config/environment');var jayson=require(_0x5e67('0x9'));var client=jayson[_0x5e67('0xa')][_0x5e67('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4d2fb2,_0x345abb,_0x4db5ca){return new BPromise(function(_0x158ae8,_0x13ad2){return client['request'](_0x4d2fb2,_0x4db5ca)[_0x5e67('0xc')](function(_0x58a813){logger[_0x5e67('0xd')](_0x5e67('0xe'),_0x345abb,'request\x20sent');logger[_0x5e67('0xf')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x345abb,_0x5e67('0x10'),JSON['stringify'](_0x58a813));if(_0x58a813[_0x5e67('0x11')]){if(_0x58a813[_0x5e67('0x11')]['code']===0x1f4){logger[_0x5e67('0x11')](_0x5e67('0xe'),_0x345abb,_0x58a813['error'][_0x5e67('0x12')]);return _0x13ad2(_0x58a813['error'][_0x5e67('0x12')]);}logger['error'](_0x5e67('0xe'),_0x345abb,_0x58a813[_0x5e67('0x11')][_0x5e67('0x12')]);return _0x158ae8(_0x58a813['error'][_0x5e67('0x12')]);}else{logger[_0x5e67('0xd')](_0x5e67('0xe'),_0x345abb,'request\x20sent');_0x158ae8(_0x58a813[_0x5e67('0x13')][_0x5e67('0x12')]);}})[_0x5e67('0x14')](function(_0x2e177e){logger[_0x5e67('0x11')](_0x5e67('0xe'),_0x345abb,_0x2e177e);_0x13ad2(_0x2e177e);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index b321133..f644b2f 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 _0xbdc2=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptySessionReport.controller','get','isAuthenticated','/describe','describe','show','/:id/questions','getQuestions','post','create','put','update','delete','/:id'];(function(_0x5d9f5c,_0x189d90){var _0x171fba=function(_0x136011){while(--_0x136011){_0x5d9f5c['push'](_0x5d9f5c['shift']());}};_0x171fba(++_0x189d90);}(_0xbdc2,0xe3));var _0x2bdc=function(_0xf8ef4a,_0x34a9d5){_0xf8ef4a=_0xf8ef4a-0x0;var _0x1869c9=_0xbdc2[_0xf8ef4a];return _0x1869c9;};'use strict';var multer=require(_0x2bdc('0x0'));var util=require(_0x2bdc('0x1'));var path=require(_0x2bdc('0x2'));var timeout=require(_0x2bdc('0x3'));var express=require(_0x2bdc('0x4'));var router=express[_0x2bdc('0x5')]();var fs_extra=require(_0x2bdc('0x6'));var auth=require(_0x2bdc('0x7'));var interaction=require(_0x2bdc('0x8'));var config=require('../../config/environment');var controller=require(_0x2bdc('0x9'));router[_0x2bdc('0xa')]('/',auth[_0x2bdc('0xb')](),controller['index']);router['get'](_0x2bdc('0xc'),auth[_0x2bdc('0xb')](),controller[_0x2bdc('0xd')]);router[_0x2bdc('0xa')]('/:id',auth[_0x2bdc('0xb')](),controller[_0x2bdc('0xe')]);router['get'](_0x2bdc('0xf'),auth[_0x2bdc('0xb')](),controller[_0x2bdc('0x10')]);router[_0x2bdc('0x11')]('/',auth[_0x2bdc('0xb')](),controller[_0x2bdc('0x12')]);router[_0x2bdc('0x13')]('/:id',auth[_0x2bdc('0xb')](),controller[_0x2bdc('0x14')]);router[_0x2bdc('0x15')](_0x2bdc('0x16'),auth[_0x2bdc('0xb')](),controller[_0x2bdc('0x17')]);module[_0x2bdc('0x18')]=router; \ No newline at end of file +var _0xf913=['describe','/:id','show','/:id/questions','getQuestions','post','create','put','update','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','index'];(function(_0xb9d4a0,_0x567b19){var _0x2cc656=function(_0x47c335){while(--_0x47c335){_0xb9d4a0['push'](_0xb9d4a0['shift']());}};_0x2cc656(++_0x567b19);}(_0xf913,0x128));var _0x3f91=function(_0x1ab463,_0x27fa05){_0x1ab463=_0x1ab463-0x0;var _0x1904c1=_0xf913[_0x1ab463];return _0x1904c1;};'use strict';var multer=require(_0x3f91('0x0'));var util=require(_0x3f91('0x1'));var path=require(_0x3f91('0x2'));var timeout=require(_0x3f91('0x3'));var express=require('express');var router=express[_0x3f91('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3f91('0x5'));var interaction=require(_0x3f91('0x6'));var config=require(_0x3f91('0x7'));var controller=require(_0x3f91('0x8'));router[_0x3f91('0x9')]('/',auth[_0x3f91('0xa')](),controller[_0x3f91('0xb')]);router[_0x3f91('0x9')]('/describe',auth[_0x3f91('0xa')](),controller[_0x3f91('0xc')]);router[_0x3f91('0x9')](_0x3f91('0xd'),auth[_0x3f91('0xa')](),controller[_0x3f91('0xe')]);router[_0x3f91('0x9')](_0x3f91('0xf'),auth[_0x3f91('0xa')](),controller[_0x3f91('0x10')]);router[_0x3f91('0x11')]('/',auth[_0x3f91('0xa')](),controller[_0x3f91('0x12')]);router[_0x3f91('0x13')](_0x3f91('0xd'),auth[_0x3f91('0xa')](),controller[_0x3f91('0x14')]);router['delete'](_0x3f91('0xd'),auth[_0x3f91('0xa')](),controller[_0x3f91('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 4c3a69b..c2ccd37 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 _0x8a04=['format','DATE','STRING','sequelize','exports','setDataValue','starttime'];(function(_0x37e845,_0x219f9f){var _0x59e55b=function(_0x5dc6c8){while(--_0x5dc6c8){_0x37e845['push'](_0x37e845['shift']());}};_0x59e55b(++_0x219f9f);}(_0x8a04,0x14c));var _0x48a0=function(_0x4fea26,_0x24d062){_0x4fea26=_0x4fea26-0x0;var _0x3c7be0=_0x8a04[_0x4fea26];return _0x3c7be0;};'use strict';var moment=require('moment');var Sequelize=require(_0x48a0('0x0'));module[_0x48a0('0x1')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0x1150fd){this[_0x48a0('0x2')](_0x48a0('0x3'),_0x1150fd);this[_0x48a0('0x2')]('endtime',moment()[_0x48a0('0x4')]('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize[_0x48a0('0x5')]},'membername':{'type':Sequelize[_0x48a0('0x6')]},'projectname':{'type':Sequelize[_0x48a0('0x6')]},'queue':{'type':Sequelize[_0x48a0('0x6')]},'uniqueid':{'type':Sequelize[_0x48a0('0x6')]},'calleridname':{'type':Sequelize[_0x48a0('0x6')]},'calleridnum':{'type':Sequelize[_0x48a0('0x6')]},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xe538=['starttime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment','DATE','setDataValue'];(function(_0x5c7e77,_0x372833){var _0x31e43c=function(_0x26fe61){while(--_0x26fe61){_0x5c7e77['push'](_0x5c7e77['shift']());}};_0x31e43c(++_0x372833);}(_0xe538,0xba));var _0x8e53=function(_0x35a0e2,_0x302ad1){_0x35a0e2=_0x35a0e2-0x0;var _0x31ea9a=_0xe538[_0x35a0e2];return _0x31ea9a;};'use strict';var moment=require(_0x8e53('0x0'));var Sequelize=require('sequelize');module['exports']={'starttime':{'type':Sequelize[_0x8e53('0x1')],'set':function(_0x121804){this[_0x8e53('0x2')](_0x8e53('0x3'),_0x121804);this[_0x8e53('0x2')](_0x8e53('0x4'),moment()[_0x8e53('0x5')](_0x8e53('0x6')));}},'endtime':{'type':Sequelize[_0x8e53('0x1')]},'membername':{'type':Sequelize[_0x8e53('0x7')]},'projectname':{'type':Sequelize[_0x8e53('0x7')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x8e53('0x7')]},'calleridnum':{'type':Sequelize[_0x8e53('0x7')]},'completed':{'type':Sequelize[_0x8e53('0x8')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 57feedb..e3ef650 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 _0x8fb2=['mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','then','error','stack','name','index','map','JscriptySessionReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','VIRTUAL','merge','options','includeAll','include','rows','params','create','body','catch','destroy','find','describe','getQuestions','findOne','JscriptyQuestionReport','pick','findAll','rimraf','fast-json-patch','request-promise','moment'];(function(_0x845646,_0x47bfcd){var _0x274ccf=function(_0xffbb3c){while(--_0xffbb3c){_0x845646['push'](_0x845646['shift']());}};_0x274ccf(++_0x47bfcd);}(_0x8fb2,0x92));var _0x28fb=function(_0x216386,_0x4e82ff){_0x216386=_0x216386-0x0;var _0x30de65=_0x8fb2[_0x216386];return _0x30de65;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x28fb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x28fb('0x1'));var rp=require(_0x28fb('0x2'));var moment=require(_0x28fb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x28fb('0x4'));var util=require(_0x28fb('0x5'));var path=require(_0x28fb('0x6'));var sox=require(_0x28fb('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x28fb('0x8'));var _=require(_0x28fb('0x9'));var squel=require('squel');var crypto=require(_0x28fb('0xa'));var jsforce=require(_0x28fb('0xb'));var deskjs=require(_0x28fb('0xc'));var toCsv=require('to-csv');var querystring=require(_0x28fb('0xd'));var Papa=require('papaparse');var Redis=require(_0x28fb('0xe'));var authService=require(_0x28fb('0xf'));var qs=require(_0x28fb('0x10'));var as=require(_0x28fb('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x28fb('0x12'))(_0x28fb('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x28fb('0x14'));var db=require(_0x28fb('0x15'))['db'];function respondWithStatusCode(_0x161225,_0xdb743b){_0xdb743b=_0xdb743b||0xcc;return function(_0x57b765){if(_0x57b765){return _0x161225[_0x28fb('0x16')](_0xdb743b);}return _0x161225[_0x28fb('0x17')](_0xdb743b)[_0x28fb('0x18')]();};}function respondWithResult(_0x5abdcc,_0x52989b){_0x52989b=_0x52989b||0xc8;return function(_0x3ee6bc){if(_0x3ee6bc){return _0x5abdcc['status'](_0x52989b)[_0x28fb('0x19')](_0x3ee6bc);}};}function respondWithFilteredResult(_0x28c2c9,_0x35aaec){return function(_0x20c75a){if(_0x20c75a){var _0x1118c6=typeof _0x35aaec[_0x28fb('0x1a')]===_0x28fb('0x1b')&&typeof _0x35aaec[_0x28fb('0x1c')]===_0x28fb('0x1b');var _0x367fb0=_0x20c75a[_0x28fb('0x1d')];var _0x5f2e9d=_0x1118c6?0x0:_0x35aaec[_0x28fb('0x1a')];var _0x3d29f4=_0x1118c6?_0x20c75a[_0x28fb('0x1d')]:_0x35aaec[_0x28fb('0x1a')]+_0x35aaec[_0x28fb('0x1c')];var _0x26ec41;if(_0x3d29f4>=_0x367fb0){_0x3d29f4=_0x367fb0;_0x26ec41=0xc8;}else{_0x26ec41=0xce;}_0x28c2c9['status'](_0x26ec41);return _0x28c2c9[_0x28fb('0x1e')]('Content-Range',_0x5f2e9d+'-'+_0x3d29f4+'/'+_0x367fb0)[_0x28fb('0x19')](_0x20c75a);}return null;};}function patchUpdates(_0x58ac01){return function(_0x3619a0){try{jsonpatch[_0x28fb('0x1f')](_0x3619a0,_0x58ac01,!![]);}catch(_0x2235b1){return BPromise['reject'](_0x2235b1);}return _0x3619a0['save']();};}function saveUpdates(_0x12087c,_0x573c1e){return function(_0x606ed8){if(_0x606ed8){return _0x606ed8['update'](_0x12087c)[_0x28fb('0x20')](function(_0x664be3){return _0x664be3;});}return null;};}function removeEntity(_0x54635e,_0x3ce853){return function(_0x4a414e){if(_0x4a414e){return _0x4a414e['destroy']()[_0x28fb('0x20')](function(){_0x54635e[_0x28fb('0x17')](0xcc)[_0x28fb('0x18')]();});}};}function handleEntityNotFound(_0x1465e6,_0x51384b){return function(_0x216c2e){if(!_0x216c2e){_0x1465e6[_0x28fb('0x16')](0x194);}return _0x216c2e;};}function handleError(_0x2b2056,_0xfb6fe4){_0xfb6fe4=_0xfb6fe4||0x1f4;return function(_0x34dfaa){logger[_0x28fb('0x21')](_0x34dfaa[_0x28fb('0x22')]);if(_0x34dfaa[_0x28fb('0x23')]){delete _0x34dfaa[_0x28fb('0x23')];}_0x2b2056[_0x28fb('0x17')](_0xfb6fe4)['send'](_0x34dfaa);};}exports[_0x28fb('0x24')]=function(_0x5371d5,_0x101026){var _0x515f36={},_0x45d06b={},_0x3dfea3={'count':0x0,'rows':[]};var _0x2acc29=_[_0x28fb('0x25')](db[_0x28fb('0x26')][_0x28fb('0x27')],function(_0xef7e47){return{'name':_0xef7e47[_0x28fb('0x28')],'type':_0xef7e47[_0x28fb('0x29')][_0x28fb('0x2a')]};});_0x45d06b[_0x28fb('0x2b')]=_[_0x28fb('0x25')](_0x2acc29,_0x28fb('0x23'));_0x45d06b[_0x28fb('0x2c')]=_[_0x28fb('0x2d')](_0x5371d5[_0x28fb('0x2c')]);_0x45d06b[_0x28fb('0x2e')]=_[_0x28fb('0x2f')](_0x45d06b['model'],_0x45d06b['query']);_0x515f36['attributes']=_[_0x28fb('0x2f')](_0x45d06b[_0x28fb('0x2b')],qs[_0x28fb('0x30')](_0x5371d5[_0x28fb('0x2c')][_0x28fb('0x30')]));_0x515f36[_0x28fb('0x31')]=_0x515f36[_0x28fb('0x31')][_0x28fb('0x32')]?_0x515f36[_0x28fb('0x31')]:_0x45d06b[_0x28fb('0x2b')];if(!_0x5371d5['query'][_0x28fb('0x33')](_0x28fb('0x34'))){_0x515f36[_0x28fb('0x1c')]=qs[_0x28fb('0x1c')](_0x5371d5[_0x28fb('0x2c')][_0x28fb('0x1c')]);_0x515f36[_0x28fb('0x1a')]=qs[_0x28fb('0x1a')](_0x5371d5[_0x28fb('0x2c')][_0x28fb('0x1a')]);}_0x515f36[_0x28fb('0x35')]=qs[_0x28fb('0x36')](_0x5371d5['query'][_0x28fb('0x36')]);_0x515f36['where']=qs[_0x28fb('0x2e')](_['pick'](_0x5371d5[_0x28fb('0x2c')],_0x45d06b[_0x28fb('0x2e')]),_0x2acc29);if(_0x5371d5[_0x28fb('0x2c')][_0x28fb('0x37')]){_0x515f36[_0x28fb('0x38')]=_['merge'](_0x515f36[_0x28fb('0x38')],{'$or':_[_0x28fb('0x25')](_0x2acc29,function(_0x4e6476){if(_0x4e6476['type']!==_0x28fb('0x39')){var _0x53974c={};_0x53974c[_0x4e6476[_0x28fb('0x23')]]={'$like':'%'+_0x5371d5['query'][_0x28fb('0x37')]+'%'};return _0x53974c;}})});}_0x515f36=_[_0x28fb('0x3a')]({},_0x515f36,_0x5371d5[_0x28fb('0x3b')]);var _0x4b9399={'where':_0x515f36['where']};return db['JscriptySessionReport']['count'](_0x4b9399)['then'](function(_0x48c8c5){_0x3dfea3[_0x28fb('0x1d')]=_0x48c8c5;if(_0x5371d5[_0x28fb('0x2c')][_0x28fb('0x3c')]){_0x515f36[_0x28fb('0x3d')]=[{'all':!![]}];}return db[_0x28fb('0x26')]['findAll'](_0x515f36);})[_0x28fb('0x20')](function(_0x334b93){_0x3dfea3[_0x28fb('0x3e')]=_0x334b93;return _0x3dfea3;})[_0x28fb('0x20')](respondWithFilteredResult(_0x101026,_0x515f36))['catch'](handleError(_0x101026,null));};exports['show']=function(_0x3c2f12,_0xbe5376){var _0x4719e2={'raw':!![],'where':{'id':_0x3c2f12[_0x28fb('0x3f')]['id']}},_0x838339={};_0x838339[_0x28fb('0x2b')]=_['keys'](db[_0x28fb('0x26')][_0x28fb('0x27')]);_0x838339[_0x28fb('0x2c')]=_[_0x28fb('0x2d')](_0x3c2f12['query']);_0x838339[_0x28fb('0x2e')]=_[_0x28fb('0x2f')](_0x838339[_0x28fb('0x2b')],_0x838339[_0x28fb('0x2c')]);_0x4719e2[_0x28fb('0x31')]=_[_0x28fb('0x2f')](_0x838339[_0x28fb('0x2b')],qs[_0x28fb('0x30')](_0x3c2f12[_0x28fb('0x2c')][_0x28fb('0x30')]));_0x4719e2['attributes']=_0x4719e2[_0x28fb('0x31')][_0x28fb('0x32')]?_0x4719e2['attributes']:_0x838339['model'];if(_0x3c2f12[_0x28fb('0x2c')][_0x28fb('0x3c')]){_0x4719e2[_0x28fb('0x3d')]=[{'all':!![]}];}_0x4719e2=_[_0x28fb('0x3a')]({},_0x4719e2,_0x3c2f12[_0x28fb('0x3b')]);return db[_0x28fb('0x26')]['find'](_0x4719e2)['then'](handleEntityNotFound(_0xbe5376,null))[_0x28fb('0x20')](respondWithResult(_0xbe5376,null))['catch'](handleError(_0xbe5376,null));};exports['create']=function(_0x225fb8,_0x20a343){return db[_0x28fb('0x26')][_0x28fb('0x40')](_0x225fb8[_0x28fb('0x41')],{})['then'](respondWithResult(_0x20a343,0xc9))[_0x28fb('0x42')](handleError(_0x20a343,null));};exports['update']=function(_0xbccb7d,_0xca5bfd){if(_0xbccb7d[_0x28fb('0x41')]['id']){delete _0xbccb7d[_0x28fb('0x41')]['id'];}return db[_0x28fb('0x26')]['find']({'where':{'id':_0xbccb7d[_0x28fb('0x3f')]['id']}})[_0x28fb('0x20')](handleEntityNotFound(_0xca5bfd,null))['then'](saveUpdates(_0xbccb7d[_0x28fb('0x41')],null))[_0x28fb('0x20')](respondWithResult(_0xca5bfd,null))[_0x28fb('0x42')](handleError(_0xca5bfd,null));};exports[_0x28fb('0x43')]=function(_0x379b47,_0x4adaa0){return db[_0x28fb('0x26')][_0x28fb('0x44')]({'where':{'id':_0x379b47[_0x28fb('0x3f')]['id']}})[_0x28fb('0x20')](handleEntityNotFound(_0x4adaa0,null))[_0x28fb('0x20')](removeEntity(_0x4adaa0,null))[_0x28fb('0x42')](handleError(_0x4adaa0,null));};exports[_0x28fb('0x45')]=function(_0x231b22,_0x52165f){return db[_0x28fb('0x26')]['describe']()[_0x28fb('0x20')](respondWithResult(_0x52165f,null))[_0x28fb('0x42')](handleError(_0x52165f,null));};exports[_0x28fb('0x46')]=function(_0x468db8,_0x12d8c3,_0x45f8b0){var _0x3f233f={'raw':!![],'where':{}};var _0x1b1597={};var _0x1f1ac3={'count':0x0,'rows':[]};return db[_0x28fb('0x26')][_0x28fb('0x47')]({'where':{'id':_0x468db8[_0x28fb('0x3f')]['id']}})[_0x28fb('0x20')](handleEntityNotFound(_0x12d8c3,null))['then'](function(_0x17515e){if(_0x17515e){_0x1b1597[_0x28fb('0x2b')]=_['keys'](db[_0x28fb('0x48')][_0x28fb('0x27')]);_0x1b1597['query']=_['keys'](_0x468db8[_0x28fb('0x2c')]);_0x1b1597[_0x28fb('0x2e')]=_[_0x28fb('0x2f')](_0x1b1597[_0x28fb('0x2b')],_0x1b1597[_0x28fb('0x2c')]);_0x3f233f[_0x28fb('0x31')]=_[_0x28fb('0x2f')](_0x1b1597[_0x28fb('0x2b')],qs[_0x28fb('0x30')](_0x468db8[_0x28fb('0x2c')][_0x28fb('0x30')]));_0x3f233f['attributes']=_0x3f233f['attributes']['length']?_0x3f233f[_0x28fb('0x31')]:_0x1b1597[_0x28fb('0x2b')];if(!_0x468db8[_0x28fb('0x2c')][_0x28fb('0x33')]('nolimit')){_0x3f233f[_0x28fb('0x1c')]=qs[_0x28fb('0x1c')](_0x468db8['query']['limit']);_0x3f233f[_0x28fb('0x1a')]=qs[_0x28fb('0x1a')](_0x468db8[_0x28fb('0x2c')][_0x28fb('0x1a')]);}_0x3f233f[_0x28fb('0x35')]=qs[_0x28fb('0x36')](_0x468db8[_0x28fb('0x2c')][_0x28fb('0x36')]);_0x3f233f[_0x28fb('0x38')]=qs[_0x28fb('0x2e')](_[_0x28fb('0x49')](_0x468db8['query'],_0x1b1597[_0x28fb('0x2e')]));_0x3f233f[_0x28fb('0x38')]['SessionId']=_0x17515e['id'];if(_0x468db8[_0x28fb('0x2c')][_0x28fb('0x37')]){_0x3f233f['where']=_[_0x28fb('0x3a')](_0x3f233f[_0x28fb('0x38')],{'$or':_[_0x28fb('0x25')](_0x3f233f[_0x28fb('0x31')],function(_0x7c7d6c){var _0x2ff774={};_0x2ff774[_0x7c7d6c]={'$like':'%'+_0x468db8[_0x28fb('0x2c')]['filter']+'%'};return _0x2ff774;})});}_0x3f233f=_[_0x28fb('0x3a')]({},_0x3f233f,_0x468db8[_0x28fb('0x3b')]);return db[_0x28fb('0x48')][_0x28fb('0x1d')]({'where':_0x3f233f['where']})[_0x28fb('0x20')](function(_0x22e0c5){_0x1f1ac3[_0x28fb('0x1d')]=_0x22e0c5;if(_0x468db8[_0x28fb('0x2c')]['includeAll']){_0x3f233f[_0x28fb('0x3d')]=[{'all':!![]}];}return db[_0x28fb('0x48')][_0x28fb('0x4a')](_0x3f233f);})[_0x28fb('0x20')](function(_0x1e0e2c){_0x1f1ac3[_0x28fb('0x3e')]=_0x1e0e2c;return _0x1f1ac3;});}})[_0x28fb('0x20')](respondWithFilteredResult(_0x12d8c3,_0x3f233f))[_0x28fb('0x42')](handleError(_0x12d8c3,null));}; \ No newline at end of file +var _0x0804=['fast-json-patch','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../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','stack','name','send','index','map','rawAttributes','fieldName','key','keys','filters','intersection','model','query','attributes','fields','length','order','sort','pick','filter','where','merge','options','JscriptySessionReport','include','findAll','rows','catch','show','params','includeAll','find','create','body','describe','getQuestions','findOne','JscriptyQuestionReport','hasOwnProperty','nolimit','SessionId','eml-format','zip-dir'];(function(_0x28ca54,_0x191410){var _0x4c6493=function(_0x5a78d3){while(--_0x5a78d3){_0x28ca54['push'](_0x28ca54['shift']());}};_0x4c6493(++_0x191410);}(_0x0804,0x18e));var _0x4080=function(_0x58547b,_0x4b89c2){_0x58547b=_0x58547b-0x0;var _0x1d3fd2=_0x0804[_0x58547b];return _0x1d3fd2;};'use strict';var emlformat=require(_0x4080('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4080('0x1'));var jsonpatch=require(_0x4080('0x2'));var rp=require('request-promise');var moment=require(_0x4080('0x3'));var BPromise=require(_0x4080('0x4'));var Mustache=require(_0x4080('0x5'));var util=require(_0x4080('0x6'));var path=require('path');var sox=require(_0x4080('0x7'));var csv=require('to-csv');var ejs=require(_0x4080('0x8'));var fs=require('fs');var fs_extra=require(_0x4080('0x9'));var _=require(_0x4080('0xa'));var squel=require(_0x4080('0xb'));var crypto=require(_0x4080('0xc'));var jsforce=require(_0x4080('0xd'));var deskjs=require(_0x4080('0xe'));var toCsv=require('to-csv');var querystring=require(_0x4080('0xf'));var Papa=require('papaparse');var Redis=require(_0x4080('0x10'));var authService=require(_0x4080('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x4080('0x12'));var hardwareService=require(_0x4080('0x13'));var logger=require('../../config/logger')(_0x4080('0x14'));var utils=require('../../config/utils');var config=require(_0x4080('0x15'));var licenseUtil=require(_0x4080('0x16'));var db=require(_0x4080('0x17'))['db'];function respondWithStatusCode(_0x5499b6,_0x18a39f){_0x18a39f=_0x18a39f||0xcc;return function(_0x3b4939){if(_0x3b4939){return _0x5499b6[_0x4080('0x18')](_0x18a39f);}return _0x5499b6[_0x4080('0x19')](_0x18a39f)[_0x4080('0x1a')]();};}function respondWithResult(_0x2ae2ba,_0xfb9bad){_0xfb9bad=_0xfb9bad||0xc8;return function(_0x11fff1){if(_0x11fff1){return _0x2ae2ba['status'](_0xfb9bad)[_0x4080('0x1b')](_0x11fff1);}};}function respondWithFilteredResult(_0x466f65,_0x36cd75){return function(_0x535e39){if(_0x535e39){var _0x380897=typeof _0x36cd75[_0x4080('0x1c')]==='undefined'&&typeof _0x36cd75[_0x4080('0x1d')]===_0x4080('0x1e');var _0x5662b8=_0x535e39[_0x4080('0x1f')];var _0x3731d9=_0x380897?0x0:_0x36cd75[_0x4080('0x1c')];var _0x621198=_0x380897?_0x535e39[_0x4080('0x1f')]:_0x36cd75[_0x4080('0x1c')]+_0x36cd75['limit'];var _0x29d8e7;if(_0x621198>=_0x5662b8){_0x621198=_0x5662b8;_0x29d8e7=0xc8;}else{_0x29d8e7=0xce;}_0x466f65[_0x4080('0x19')](_0x29d8e7);return _0x466f65['set'](_0x4080('0x20'),_0x3731d9+'-'+_0x621198+'/'+_0x5662b8)['json'](_0x535e39);}return null;};}function patchUpdates(_0x40d0fa){return function(_0x27fce7){try{jsonpatch[_0x4080('0x21')](_0x27fce7,_0x40d0fa,!![]);}catch(_0x38ea76){return BPromise[_0x4080('0x22')](_0x38ea76);}return _0x27fce7[_0x4080('0x23')]();};}function saveUpdates(_0x25c5a3,_0x318db0){return function(_0x53194d){if(_0x53194d){return _0x53194d[_0x4080('0x24')](_0x25c5a3)[_0x4080('0x25')](function(_0x5340fa){return _0x5340fa;});}return null;};}function removeEntity(_0x44834a,_0x466c10){return function(_0x52a2e7){if(_0x52a2e7){return _0x52a2e7[_0x4080('0x26')]()['then'](function(){_0x44834a['status'](0xcc)[_0x4080('0x1a')]();});}};}function handleEntityNotFound(_0x4c3f60,_0x5e98cc){return function(_0x5e0c64){if(!_0x5e0c64){_0x4c3f60[_0x4080('0x18')](0x194);}return _0x5e0c64;};}function handleError(_0x548b62,_0x2d2fd8){_0x2d2fd8=_0x2d2fd8||0x1f4;return function(_0x54e4b5){logger['error'](_0x54e4b5[_0x4080('0x27')]);if(_0x54e4b5[_0x4080('0x28')]){delete _0x54e4b5[_0x4080('0x28')];}_0x548b62[_0x4080('0x19')](_0x2d2fd8)[_0x4080('0x29')](_0x54e4b5);};}exports[_0x4080('0x2a')]=function(_0x16d283,_0x448c61){var _0x45b28a={},_0x3bd701={},_0x119f66={'count':0x0,'rows':[]};var _0x50a612=_[_0x4080('0x2b')](db['JscriptySessionReport'][_0x4080('0x2c')],function(_0x29c1d7){return{'name':_0x29c1d7[_0x4080('0x2d')],'type':_0x29c1d7['type'][_0x4080('0x2e')]};});_0x3bd701['model']=_[_0x4080('0x2b')](_0x50a612,'name');_0x3bd701['query']=_[_0x4080('0x2f')](_0x16d283['query']);_0x3bd701[_0x4080('0x30')]=_[_0x4080('0x31')](_0x3bd701[_0x4080('0x32')],_0x3bd701[_0x4080('0x33')]);_0x45b28a[_0x4080('0x34')]=_[_0x4080('0x31')](_0x3bd701['model'],qs[_0x4080('0x35')](_0x16d283[_0x4080('0x33')][_0x4080('0x35')]));_0x45b28a[_0x4080('0x34')]=_0x45b28a['attributes'][_0x4080('0x36')]?_0x45b28a[_0x4080('0x34')]:_0x3bd701[_0x4080('0x32')];if(!_0x16d283[_0x4080('0x33')]['hasOwnProperty']('nolimit')){_0x45b28a['limit']=qs[_0x4080('0x1d')](_0x16d283[_0x4080('0x33')][_0x4080('0x1d')]);_0x45b28a[_0x4080('0x1c')]=qs[_0x4080('0x1c')](_0x16d283[_0x4080('0x33')][_0x4080('0x1c')]);}_0x45b28a[_0x4080('0x37')]=qs[_0x4080('0x38')](_0x16d283['query'][_0x4080('0x38')]);_0x45b28a['where']=qs[_0x4080('0x30')](_[_0x4080('0x39')](_0x16d283[_0x4080('0x33')],_0x3bd701['filters']),_0x50a612);if(_0x16d283[_0x4080('0x33')][_0x4080('0x3a')]){_0x45b28a[_0x4080('0x3b')]=_[_0x4080('0x3c')](_0x45b28a[_0x4080('0x3b')],{'$or':_[_0x4080('0x2b')](_0x50a612,function(_0x2de5c0){if(_0x2de5c0['type']!=='VIRTUAL'){var _0x1302ae={};_0x1302ae[_0x2de5c0['name']]={'$like':'%'+_0x16d283[_0x4080('0x33')][_0x4080('0x3a')]+'%'};return _0x1302ae;}})});}_0x45b28a=_['merge']({},_0x45b28a,_0x16d283[_0x4080('0x3d')]);var _0x1f1ada={'where':_0x45b28a['where']};return db[_0x4080('0x3e')][_0x4080('0x1f')](_0x1f1ada)[_0x4080('0x25')](function(_0x323d11){_0x119f66[_0x4080('0x1f')]=_0x323d11;if(_0x16d283['query']['includeAll']){_0x45b28a[_0x4080('0x3f')]=[{'all':!![]}];}return db[_0x4080('0x3e')][_0x4080('0x40')](_0x45b28a);})[_0x4080('0x25')](function(_0x2b8bb2){_0x119f66[_0x4080('0x41')]=_0x2b8bb2;return _0x119f66;})[_0x4080('0x25')](respondWithFilteredResult(_0x448c61,_0x45b28a))[_0x4080('0x42')](handleError(_0x448c61,null));};exports[_0x4080('0x43')]=function(_0xc27f54,_0xc59d2f){var _0xa7863d={'raw':!![],'where':{'id':_0xc27f54[_0x4080('0x44')]['id']}},_0x191541={};_0x191541[_0x4080('0x32')]=_['keys'](db[_0x4080('0x3e')][_0x4080('0x2c')]);_0x191541[_0x4080('0x33')]=_['keys'](_0xc27f54[_0x4080('0x33')]);_0x191541[_0x4080('0x30')]=_[_0x4080('0x31')](_0x191541['model'],_0x191541[_0x4080('0x33')]);_0xa7863d[_0x4080('0x34')]=_[_0x4080('0x31')](_0x191541[_0x4080('0x32')],qs[_0x4080('0x35')](_0xc27f54[_0x4080('0x33')]['fields']));_0xa7863d[_0x4080('0x34')]=_0xa7863d['attributes']['length']?_0xa7863d['attributes']:_0x191541[_0x4080('0x32')];if(_0xc27f54[_0x4080('0x33')][_0x4080('0x45')]){_0xa7863d[_0x4080('0x3f')]=[{'all':!![]}];}_0xa7863d=_[_0x4080('0x3c')]({},_0xa7863d,_0xc27f54[_0x4080('0x3d')]);return db[_0x4080('0x3e')][_0x4080('0x46')](_0xa7863d)[_0x4080('0x25')](handleEntityNotFound(_0xc59d2f,null))[_0x4080('0x25')](respondWithResult(_0xc59d2f,null))[_0x4080('0x42')](handleError(_0xc59d2f,null));};exports[_0x4080('0x47')]=function(_0xd93492,_0x3b3eca){return db[_0x4080('0x3e')][_0x4080('0x47')](_0xd93492[_0x4080('0x48')],{})['then'](respondWithResult(_0x3b3eca,0xc9))[_0x4080('0x42')](handleError(_0x3b3eca,null));};exports[_0x4080('0x24')]=function(_0x5d5372,_0x5aef27){if(_0x5d5372[_0x4080('0x48')]['id']){delete _0x5d5372[_0x4080('0x48')]['id'];}return db[_0x4080('0x3e')]['find']({'where':{'id':_0x5d5372[_0x4080('0x44')]['id']}})[_0x4080('0x25')](handleEntityNotFound(_0x5aef27,null))[_0x4080('0x25')](saveUpdates(_0x5d5372[_0x4080('0x48')],null))[_0x4080('0x25')](respondWithResult(_0x5aef27,null))[_0x4080('0x42')](handleError(_0x5aef27,null));};exports[_0x4080('0x26')]=function(_0x125cd3,_0x39fa79){return db['JscriptySessionReport'][_0x4080('0x46')]({'where':{'id':_0x125cd3[_0x4080('0x44')]['id']}})[_0x4080('0x25')](handleEntityNotFound(_0x39fa79,null))[_0x4080('0x25')](removeEntity(_0x39fa79,null))[_0x4080('0x42')](handleError(_0x39fa79,null));};exports[_0x4080('0x49')]=function(_0x544236,_0x25fb99){return db[_0x4080('0x3e')][_0x4080('0x49')]()[_0x4080('0x25')](respondWithResult(_0x25fb99,null))['catch'](handleError(_0x25fb99,null));};exports[_0x4080('0x4a')]=function(_0x346a3d,_0x1c18e9,_0x2de950){var _0x158807={'raw':!![],'where':{}};var _0x10d46d={};var _0x219b59={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0x4080('0x4b')]({'where':{'id':_0x346a3d['params']['id']}})[_0x4080('0x25')](handleEntityNotFound(_0x1c18e9,null))['then'](function(_0x7942b0){if(_0x7942b0){_0x10d46d[_0x4080('0x32')]=_[_0x4080('0x2f')](db[_0x4080('0x4c')][_0x4080('0x2c')]);_0x10d46d[_0x4080('0x33')]=_[_0x4080('0x2f')](_0x346a3d[_0x4080('0x33')]);_0x10d46d['filters']=_[_0x4080('0x31')](_0x10d46d[_0x4080('0x32')],_0x10d46d[_0x4080('0x33')]);_0x158807[_0x4080('0x34')]=_[_0x4080('0x31')](_0x10d46d[_0x4080('0x32')],qs[_0x4080('0x35')](_0x346a3d[_0x4080('0x33')][_0x4080('0x35')]));_0x158807[_0x4080('0x34')]=_0x158807[_0x4080('0x34')][_0x4080('0x36')]?_0x158807[_0x4080('0x34')]:_0x10d46d[_0x4080('0x32')];if(!_0x346a3d[_0x4080('0x33')][_0x4080('0x4d')](_0x4080('0x4e'))){_0x158807[_0x4080('0x1d')]=qs['limit'](_0x346a3d[_0x4080('0x33')][_0x4080('0x1d')]);_0x158807[_0x4080('0x1c')]=qs[_0x4080('0x1c')](_0x346a3d['query'][_0x4080('0x1c')]);}_0x158807[_0x4080('0x37')]=qs['sort'](_0x346a3d[_0x4080('0x33')][_0x4080('0x38')]);_0x158807['where']=qs[_0x4080('0x30')](_['pick'](_0x346a3d[_0x4080('0x33')],_0x10d46d[_0x4080('0x30')]));_0x158807[_0x4080('0x3b')][_0x4080('0x4f')]=_0x7942b0['id'];if(_0x346a3d[_0x4080('0x33')]['filter']){_0x158807[_0x4080('0x3b')]=_[_0x4080('0x3c')](_0x158807['where'],{'$or':_[_0x4080('0x2b')](_0x158807['attributes'],function(_0x3588f4){var _0x1dde25={};_0x1dde25[_0x3588f4]={'$like':'%'+_0x346a3d[_0x4080('0x33')]['filter']+'%'};return _0x1dde25;})});}_0x158807=_[_0x4080('0x3c')]({},_0x158807,_0x346a3d[_0x4080('0x3d')]);return db[_0x4080('0x4c')][_0x4080('0x1f')]({'where':_0x158807[_0x4080('0x3b')]})[_0x4080('0x25')](function(_0x17b1e3){_0x219b59[_0x4080('0x1f')]=_0x17b1e3;if(_0x346a3d['query'][_0x4080('0x45')]){_0x158807['include']=[{'all':!![]}];}return db[_0x4080('0x4c')][_0x4080('0x40')](_0x158807);})[_0x4080('0x25')](function(_0x571ea6){_0x219b59['rows']=_0x571ea6;return _0x219b59;});}})[_0x4080('0x25')](respondWithFilteredResult(_0x1c18e9,_0x158807))[_0x4080('0x42')](handleError(_0x1c18e9,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 798111e..846700e 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 _0x5334=['moment','request-promise','rimraf','../../config/environment','lodash','util','../../config/logger','api'];(function(_0x4b251e,_0x50150f){var _0x832ac6=function(_0x5194f5){while(--_0x5194f5){_0x4b251e['push'](_0x4b251e['shift']());}};_0x832ac6(++_0x50150f);}(_0x5334,0x84));var _0x4533=function(_0x3488a4,_0x2c59f3){_0x3488a4=_0x3488a4-0x0;var _0x4a69d6=_0x5334[_0x3488a4];return _0x4a69d6;};'use strict';var _=require(_0x4533('0x0'));var util=require(_0x4533('0x1'));var logger=require(_0x4533('0x2'))(_0x4533('0x3'));var moment=require(_0x4533('0x4'));var BPromise=require('bluebird');var rp=require(_0x4533('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4533('0x6'));var config=require(_0x4533('0x7'));var attributes=require('./jscriptySessionReport.attributes');module['exports']=function(_0x51b4ce,_0x201673){return _0x51b4ce['define']('JscriptySessionReport',attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7fbe=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x25f0d5,_0xc2dbf1){_0x25f0d5=_0x25f0d5-0x0;var _0x3dac6b=_0x7fbe[_0x25f0d5];return _0x3dac6b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe7fb('0x0'))(_0xe7fb('0x1'));var moment=require(_0xe7fb('0x2'));var BPromise=require(_0xe7fb('0x3'));var rp=require(_0xe7fb('0x4'));var fs=require('fs');var path=require(_0xe7fb('0x5'));var rimraf=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var attributes=require(_0xe7fb('0x8'));module[_0xe7fb('0x9')]=function(_0x290172,_0x12d1b0){return _0x290172[_0xe7fb('0xa')](_0xe7fb('0xb'),attributes,{'tableName':'report_jscripty_sessions','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 407dc4c..2919b8e 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 _0x0295=['client','http','then','info','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','JscriptySessionReport,\x20%s,\x20%s','message','result','catch','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xd0c14,_0x1c08a8){var _0x4d5789=function(_0x20c20a){while(--_0x20c20a){_0xd0c14['push'](_0xd0c14['shift']());}};_0x4d5789(++_0x1c08a8);}(_0x0295,0x1f0));var _0x5029=function(_0x4b3300,_0x1137f1){_0x4b3300=_0x4b3300-0x0;var _0x2d26d3=_0x0295[_0x4b3300];return _0x2d26d3;};'use strict';var _=require(_0x5029('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5029('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5029('0x2'))['db'];var utils=require(_0x5029('0x3'));var logger=require(_0x5029('0x4'))(_0x5029('0x5'));var config=require(_0x5029('0x6'));var jayson=require(_0x5029('0x7'));var client=jayson[_0x5029('0x8')][_0x5029('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5b3cd,_0x502a62,_0x54978f){return new BPromise(function(_0x4ee867,_0xf4459b){return client['request'](_0x5b3cd,_0x54978f)[_0x5029('0xa')](function(_0x5bccfc){logger[_0x5029('0xb')]('JscriptySessionReport,\x20%s,\x20%s',_0x502a62,_0x5029('0xc'));logger[_0x5029('0xd')](_0x5029('0xe'),_0x502a62,'request\x20sent',JSON[_0x5029('0xf')](_0x5bccfc));if(_0x5bccfc[_0x5029('0x10')]){if(_0x5bccfc[_0x5029('0x10')]['code']===0x1f4){logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x5bccfc['error']['message']);return _0xf4459b(_0x5bccfc['error']['message']);}logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x5bccfc[_0x5029('0x10')][_0x5029('0x12')]);return _0x4ee867(_0x5bccfc[_0x5029('0x10')][_0x5029('0x12')]);}else{logger[_0x5029('0xb')](_0x5029('0x11'),_0x502a62,_0x5029('0xc'));_0x4ee867(_0x5bccfc[_0x5029('0x13')][_0x5029('0x12')]);}})[_0x5029('0x14')](function(_0x3786b5){logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x3786b5);_0xf4459b(_0x3786b5);});});} \ No newline at end of file +var _0x4888=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x4646c0,_0x41ebb7){var _0x29f51d=function(_0x11cb12){while(--_0x11cb12){_0x4646c0['push'](_0x4646c0['shift']());}};_0x29f51d(++_0x41ebb7);}(_0x4888,0x198));var _0x8488=function(_0x2806f6,_0x294105){_0x2806f6=_0x2806f6-0x0;var _0x32ebb1=_0x4888[_0x2806f6];return _0x32ebb1;};'use strict';var _=require('lodash');var util=require(_0x8488('0x0'));var moment=require(_0x8488('0x1'));var BPromise=require(_0x8488('0x2'));var rs=require(_0x8488('0x3'));var fs=require('fs');var Redis=require(_0x8488('0x4'));var db=require(_0x8488('0x5'))['db'];var utils=require(_0x8488('0x6'));var logger=require('../../config/logger')(_0x8488('0x7'));var config=require(_0x8488('0x8'));var jayson=require(_0x8488('0x9'));var client=jayson[_0x8488('0xa')][_0x8488('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x19e508,_0x5250a1,_0x5b30a7){return new BPromise(function(_0x56aad0,_0x568a82){return client[_0x8488('0xc')](_0x19e508,_0x5b30a7)[_0x8488('0xd')](function(_0x542bd8){logger[_0x8488('0xe')](_0x8488('0xf'),_0x5250a1,_0x8488('0x10'));logger[_0x8488('0x11')]('JscriptySessionReport,\x20%s,\x20%s,\x20%s',_0x5250a1,_0x8488('0x10'),JSON[_0x8488('0x12')](_0x542bd8));if(_0x542bd8[_0x8488('0x13')]){if(_0x542bd8[_0x8488('0x13')][_0x8488('0x14')]===0x1f4){logger['error'](_0x8488('0xf'),_0x5250a1,_0x542bd8[_0x8488('0x13')]['message']);return _0x568a82(_0x542bd8['error'][_0x8488('0x15')]);}logger['error'](_0x8488('0xf'),_0x5250a1,_0x542bd8['error']['message']);return _0x56aad0(_0x542bd8[_0x8488('0x13')][_0x8488('0x15')]);}else{logger[_0x8488('0xe')](_0x8488('0xf'),_0x5250a1,_0x8488('0x10'));_0x56aad0(_0x542bd8[_0x8488('0x16')][_0x8488('0x15')]);}})['catch'](function(_0x3dad45){logger[_0x8488('0x13')](_0x8488('0xf'),_0x5250a1,_0x3dad45);_0x568a82(_0x3dad45);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 43ca346..66b90e4 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 _0x590c=['multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','get','index','put','/:id','isAuthenticated','update','exports'];(function(_0x5f0707,_0x4debdf){var _0x4220d7=function(_0x184eae){while(--_0x184eae){_0x5f0707['push'](_0x5f0707['shift']());}};_0x4220d7(++_0x4debdf);}(_0x590c,0x80));var _0xc590=function(_0x1dea0d,_0x25de3f){_0x1dea0d=_0x1dea0d-0x0;var _0x11f547=_0x590c[_0x1dea0d];return _0x11f547;};'use strict';var multer=require(_0xc590('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc590('0x1'));var express=require(_0xc590('0x2'));var router=express[_0xc590('0x3')]();var fs_extra=require(_0xc590('0x4'));var auth=require(_0xc590('0x5'));var interaction=require(_0xc590('0x6'));var config=require(_0xc590('0x7'));var controller=require(_0xc590('0x8'));router[_0xc590('0x9')]('/',controller[_0xc590('0xa')]);router[_0xc590('0xb')](_0xc590('0xc'),auth[_0xc590('0xd')](),controller[_0xc590('0xe')]);module[_0xc590('0xf')]=router; \ No newline at end of file +var _0xff2a=['/:id','isAuthenticated','update','exports','util','path','express','Router','../../components/auth/service','../../config/environment','./license.controller','index','put'];(function(_0x369151,_0x179f72){var _0x4292d5=function(_0x330422){while(--_0x330422){_0x369151['push'](_0x369151['shift']());}};_0x4292d5(++_0x179f72);}(_0xff2a,0x93));var _0xaff2=function(_0xe8668f,_0x42446c){_0xe8668f=_0xe8668f-0x0;var _0xf3d4ff=_0xff2a[_0xe8668f];return _0xf3d4ff;};'use strict';var multer=require('multer');var util=require(_0xaff2('0x0'));var path=require(_0xaff2('0x1'));var timeout=require('connect-timeout');var express=require(_0xaff2('0x2'));var router=express[_0xaff2('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xaff2('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xaff2('0x5'));var controller=require(_0xaff2('0x6'));router['get']('/',controller[_0xaff2('0x7')]);router[_0xaff2('0x8')](_0xaff2('0x9'),auth[_0xaff2('0xa')](),controller[_0xaff2('0xb')]);module[_0xaff2('0xc')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index e628d65..1c40ea2 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 _0x7792=['sequelize','exports','STRING'];(function(_0x4a1d55,_0xb60903){var _0x463b41=function(_0x18f753){while(--_0x18f753){_0x4a1d55['push'](_0x4a1d55['shift']());}};_0x463b41(++_0xb60903);}(_0x7792,0x1d7));var _0x2779=function(_0x147e9e,_0x3dfac5){_0x147e9e=_0x147e9e-0x0;var _0x1b42cf=_0x7792[_0x147e9e];return _0x1b42cf;};'use strict';var Sequelize=require(_0x2779('0x0'));module[_0x2779('0x1')]={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize[_0x2779('0x2')]},'data2':{'type':Sequelize[_0x2779('0x2')]},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x975a=['INTEGER','sequelize','exports','TEXT'];(function(_0x354407,_0x4ff27a){var _0x553679=function(_0x5a42ce){while(--_0x5a42ce){_0x354407['push'](_0x354407['shift']());}};_0x553679(++_0x4ff27a);}(_0x975a,0x9d));var _0xa975=function(_0x214673,_0x39adf4){_0x214673=_0x214673-0x0;var _0x4c52fb=_0x975a[_0x214673];return _0x4c52fb;};'use strict';var Sequelize=require(_0xa975('0x0'));module[_0xa975('0x1')]={'license':{'type':Sequelize[_0xa975('0x2')]},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize[_0xa975('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 fc2314d..3464664 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 _0x1261=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','stack','send','index','model','License','query','intersection','fields','attributes','merge','options','getLicense','catch','body','find','params','get','key','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis'];(function(_0x159811,_0x4caa5b){var _0x537769=function(_0xb0dfa9){while(--_0xb0dfa9){_0x159811['push'](_0x159811['shift']());}};_0x537769(++_0x4caa5b);}(_0x1261,0x144));var _0x1126=function(_0x111ccc,_0x4f5094){_0x111ccc=_0x111ccc-0x0;var _0x5bd2a5=_0x1261[_0x111ccc];return _0x5bd2a5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1126('0x0'));var zipdir=require(_0x1126('0x1'));var jsonpatch=require(_0x1126('0x2'));var rp=require(_0x1126('0x3'));var moment=require(_0x1126('0x4'));var BPromise=require(_0x1126('0x5'));var Mustache=require(_0x1126('0x6'));var util=require(_0x1126('0x7'));var path=require(_0x1126('0x8'));var sox=require(_0x1126('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1126('0xa'));var _=require(_0x1126('0xb'));var squel=require('squel');var crypto=require(_0x1126('0xc'));var jsforce=require(_0x1126('0xd'));var deskjs=require(_0x1126('0xe'));var toCsv=require(_0x1126('0xf'));var querystring=require(_0x1126('0x10'));var Papa=require('papaparse');var Redis=require(_0x1126('0x11'));var authService=require(_0x1126('0x12'));var qs=require(_0x1126('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1126('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x1126('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x1126('0x16'));var db=require(_0x1126('0x17'))['db'];function respondWithStatusCode(_0xd26a32,_0x273896){_0x273896=_0x273896||0xcc;return function(_0xca0355){if(_0xca0355){return _0xd26a32[_0x1126('0x18')](_0x273896);}return _0xd26a32[_0x1126('0x19')](_0x273896)[_0x1126('0x1a')]();};}function respondWithResult(_0x43850b,_0x53a8f0){_0x53a8f0=_0x53a8f0||0xc8;return function(_0x5de9a7){if(_0x5de9a7){return _0x43850b[_0x1126('0x19')](_0x53a8f0)[_0x1126('0x1b')](_0x5de9a7);}};}function respondWithFilteredResult(_0x279455,_0x4be0c6){return function(_0x45149c){if(_0x45149c){var _0x4794a7=typeof _0x4be0c6[_0x1126('0x1c')]===_0x1126('0x1d')&&typeof _0x4be0c6[_0x1126('0x1e')]==='undefined';var _0x245cd7=_0x45149c[_0x1126('0x1f')];var _0x4a7b49=_0x4794a7?0x0:_0x4be0c6['offset'];var _0x22ae0b=_0x4794a7?_0x45149c[_0x1126('0x1f')]:_0x4be0c6['offset']+_0x4be0c6['limit'];var _0x4564c0;if(_0x22ae0b>=_0x245cd7){_0x22ae0b=_0x245cd7;_0x4564c0=0xc8;}else{_0x4564c0=0xce;}_0x279455['status'](_0x4564c0);return _0x279455[_0x1126('0x20')](_0x1126('0x21'),_0x4a7b49+'-'+_0x22ae0b+'/'+_0x245cd7)[_0x1126('0x1b')](_0x45149c);}return null;};}function patchUpdates(_0x54400a){return function(_0x2a08ba){try{jsonpatch['apply'](_0x2a08ba,_0x54400a,!![]);}catch(_0x56efeb){return BPromise[_0x1126('0x22')](_0x56efeb);}return _0x2a08ba[_0x1126('0x23')]();};}function saveUpdates(_0x25b24b,_0x36d254){return function(_0x526ca1){if(_0x526ca1){return _0x526ca1[_0x1126('0x24')](_0x25b24b)[_0x1126('0x25')](function(_0x48a08d){return _0x48a08d;});}return null;};}function removeEntity(_0x2175fa,_0x59cd8e){return function(_0x529dd9){if(_0x529dd9){return _0x529dd9['destroy']()[_0x1126('0x25')](function(){_0x2175fa[_0x1126('0x19')](0xcc)[_0x1126('0x1a')]();});}};}function handleEntityNotFound(_0x34bcf1,_0x566c09){return function(_0x1b07a7){if(!_0x1b07a7){_0x34bcf1[_0x1126('0x18')](0x194);}return _0x1b07a7;};}function handleError(_0x38119d,_0x589725){_0x589725=_0x589725||0x1f4;return function(_0x35eec3){logger[_0x1126('0x26')](_0x35eec3[_0x1126('0x27')]);if(_0x35eec3['name']){delete _0x35eec3['name'];}_0x38119d[_0x1126('0x19')](_0x589725)[_0x1126('0x28')](_0x35eec3);};}var utilLicense=require('../../config/license/util');exports[_0x1126('0x29')]=function(_0x23d2bc,_0x4a334a){var _0x3fa694={'raw':!![],'where':{'id':0x1}},_0x4bf807={};_0x4bf807[_0x1126('0x2a')]=_['keys'](db[_0x1126('0x2b')]['rawAttributes']);_0x4bf807[_0x1126('0x2c')]=_['keys'](_0x23d2bc['query']);_0x4bf807['filters']=_[_0x1126('0x2d')](_0x4bf807[_0x1126('0x2a')],_0x4bf807[_0x1126('0x2c')]);_0x3fa694['attributes']=_[_0x1126('0x2d')](_0x4bf807[_0x1126('0x2a')],qs['fields'](_0x23d2bc[_0x1126('0x2c')][_0x1126('0x2e')]));_0x3fa694[_0x1126('0x2f')]=_0x3fa694[_0x1126('0x2f')]['length']?_0x3fa694['attributes']:_0x4bf807[_0x1126('0x2a')];_0x3fa694=_[_0x1126('0x30')]({},_0x3fa694,_0x23d2bc[_0x1126('0x31')]);return utilLicense[_0x1126('0x32')](_0x3fa694)['then'](respondWithResult(_0x4a334a,null))[_0x1126('0x33')](handleError(_0x4a334a,null));};exports[_0x1126('0x24')]=function(_0x313ebe,_0x22436c){if(_0x313ebe[_0x1126('0x34')]['id']){delete _0x313ebe['body']['id'];}return db[_0x1126('0x2b')][_0x1126('0x35')]({'where':{'id':_0x313ebe[_0x1126('0x36')]['id']}})[_0x1126('0x25')](handleEntityNotFound(_0x22436c,null))['then'](function(_0x4ca51c){var _0x22827a=_0x4ca51c[_0x1126('0x37')]({'plain':!![]});return utilLicense['checkLicense'](_0x22827a,_0x313ebe[_0x1126('0x34')][_0x1126('0x38')]);})[_0x1126('0x25')](function(_0x5c08b9){if(!_0x5c08b9['demo']){return saveUpdates(_0x313ebe[_0x1126('0x34')],null);}return _0x5c08b9;})[_0x1126('0x25')](respondWithResult(_0x22436c,null))[_0x1126('0x33')](handleError(_0x22436c,null));}; \ No newline at end of file +var _0xf494=['fields','length','merge','options','getLicense','body','License','find','params','get','key','demo','catch','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','error','stack','name','../../config/license/util','index','model','rawAttributes','query','keys','filters','intersection','attributes'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0xf494,0x1c6));var _0x4f49=function(_0x594707,_0x9f2444){_0x594707=_0x594707-0x0;var _0x481025=_0xf494[_0x594707];return _0x481025;};'use strict';var emlformat=require(_0x4f49('0x0'));var rimraf=require(_0x4f49('0x1'));var zipdir=require(_0x4f49('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4f49('0x3'));var moment=require(_0x4f49('0x4'));var BPromise=require(_0x4f49('0x5'));var Mustache=require(_0x4f49('0x6'));var util=require(_0x4f49('0x7'));var path=require(_0x4f49('0x8'));var sox=require(_0x4f49('0x9'));var csv=require(_0x4f49('0xa'));var ejs=require(_0x4f49('0xb'));var fs=require('fs');var fs_extra=require(_0x4f49('0xc'));var _=require(_0x4f49('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4f49('0xe'));var deskjs=require(_0x4f49('0xf'));var toCsv=require(_0x4f49('0xa'));var querystring=require(_0x4f49('0x10'));var Papa=require(_0x4f49('0x11'));var Redis=require(_0x4f49('0x12'));var authService=require(_0x4f49('0x13'));var qs=require(_0x4f49('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4f49('0x15'));var logger=require(_0x4f49('0x16'))('api');var utils=require(_0x4f49('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4f49('0x18'))['db'];function respondWithStatusCode(_0x12527d,_0x4bf89f){_0x4bf89f=_0x4bf89f||0xcc;return function(_0x1e1c37){if(_0x1e1c37){return _0x12527d[_0x4f49('0x19')](_0x4bf89f);}return _0x12527d[_0x4f49('0x1a')](_0x4bf89f)[_0x4f49('0x1b')]();};}function respondWithResult(_0x1a0f1e,_0x2f0131){_0x2f0131=_0x2f0131||0xc8;return function(_0xfdb477){if(_0xfdb477){return _0x1a0f1e['status'](_0x2f0131)[_0x4f49('0x1c')](_0xfdb477);}};}function respondWithFilteredResult(_0x1f2d0d,_0x415e83){return function(_0x5878f4){if(_0x5878f4){var _0x5bdfaf=typeof _0x415e83[_0x4f49('0x1d')]===_0x4f49('0x1e')&&typeof _0x415e83[_0x4f49('0x1f')]==='undefined';var _0x1dccfd=_0x5878f4[_0x4f49('0x20')];var _0x4e85df=_0x5bdfaf?0x0:_0x415e83['offset'];var _0x5bb23b=_0x5bdfaf?_0x5878f4['count']:_0x415e83['offset']+_0x415e83[_0x4f49('0x1f')];var _0x1834f4;if(_0x5bb23b>=_0x1dccfd){_0x5bb23b=_0x1dccfd;_0x1834f4=0xc8;}else{_0x1834f4=0xce;}_0x1f2d0d[_0x4f49('0x1a')](_0x1834f4);return _0x1f2d0d[_0x4f49('0x21')]('Content-Range',_0x4e85df+'-'+_0x5bb23b+'/'+_0x1dccfd)[_0x4f49('0x1c')](_0x5878f4);}return null;};}function patchUpdates(_0x2aed27){return function(_0x197a49){try{jsonpatch[_0x4f49('0x22')](_0x197a49,_0x2aed27,!![]);}catch(_0xea82f8){return BPromise['reject'](_0xea82f8);}return _0x197a49[_0x4f49('0x23')]();};}function saveUpdates(_0x357446,_0x3ae590){return function(_0x53b57d){if(_0x53b57d){return _0x53b57d[_0x4f49('0x24')](_0x357446)[_0x4f49('0x25')](function(_0x32ca7b){return _0x32ca7b;});}return null;};}function removeEntity(_0x43c458,_0x9d30aa){return function(_0x36187b){if(_0x36187b){return _0x36187b['destroy']()['then'](function(){_0x43c458[_0x4f49('0x1a')](0xcc)[_0x4f49('0x1b')]();});}};}function handleEntityNotFound(_0x4fedbb,_0x408552){return function(_0x2c1519){if(!_0x2c1519){_0x4fedbb[_0x4f49('0x19')](0x194);}return _0x2c1519;};}function handleError(_0x525950,_0xc54070){_0xc54070=_0xc54070||0x1f4;return function(_0x2eed1c){logger[_0x4f49('0x26')](_0x2eed1c[_0x4f49('0x27')]);if(_0x2eed1c[_0x4f49('0x28')]){delete _0x2eed1c[_0x4f49('0x28')];}_0x525950['status'](_0xc54070)['send'](_0x2eed1c);};}var utilLicense=require(_0x4f49('0x29'));exports[_0x4f49('0x2a')]=function(_0x605c91,_0x560050){var _0x3cbfbd={'raw':!![],'where':{'id':0x1}},_0x206203={};_0x206203[_0x4f49('0x2b')]=_['keys'](db['License'][_0x4f49('0x2c')]);_0x206203[_0x4f49('0x2d')]=_[_0x4f49('0x2e')](_0x605c91['query']);_0x206203[_0x4f49('0x2f')]=_[_0x4f49('0x30')](_0x206203[_0x4f49('0x2b')],_0x206203[_0x4f49('0x2d')]);_0x3cbfbd[_0x4f49('0x31')]=_[_0x4f49('0x30')](_0x206203[_0x4f49('0x2b')],qs[_0x4f49('0x32')](_0x605c91[_0x4f49('0x2d')][_0x4f49('0x32')]));_0x3cbfbd[_0x4f49('0x31')]=_0x3cbfbd[_0x4f49('0x31')][_0x4f49('0x33')]?_0x3cbfbd[_0x4f49('0x31')]:_0x206203[_0x4f49('0x2b')];_0x3cbfbd=_[_0x4f49('0x34')]({},_0x3cbfbd,_0x605c91[_0x4f49('0x35')]);return utilLicense[_0x4f49('0x36')](_0x3cbfbd)[_0x4f49('0x25')](respondWithResult(_0x560050,null))['catch'](handleError(_0x560050,null));};exports[_0x4f49('0x24')]=function(_0x46b7ba,_0x24f568){if(_0x46b7ba[_0x4f49('0x37')]['id']){delete _0x46b7ba[_0x4f49('0x37')]['id'];}return db[_0x4f49('0x38')][_0x4f49('0x39')]({'where':{'id':_0x46b7ba[_0x4f49('0x3a')]['id']}})[_0x4f49('0x25')](handleEntityNotFound(_0x24f568,null))[_0x4f49('0x25')](function(_0x44e6a0){var _0x343365=_0x44e6a0[_0x4f49('0x3b')]({'plain':!![]});return utilLicense['checkLicense'](_0x343365,_0x46b7ba[_0x4f49('0x37')][_0x4f49('0x3c')]);})[_0x4f49('0x25')](function(_0x26014f){if(!_0x26014f[_0x4f49('0x3d')]){return saveUpdates(_0x46b7ba[_0x4f49('0x37')],null);}return _0x26014f;})[_0x4f49('0x25')](respondWithResult(_0x24f568,null))[_0x4f49('0x3e')](handleError(_0x24f568,null));}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index e4e8fac..d90d0a4 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 _0x4e46=['exports','define','license','lodash','api','moment','bluebird','request-promise','../../config/environment','./license.attributes'];(function(_0x1cec84,_0x101ec2){var _0x12b7d3=function(_0x9679d8){while(--_0x9679d8){_0x1cec84['push'](_0x1cec84['shift']());}};_0x12b7d3(++_0x101ec2);}(_0x4e46,0x7b));var _0x64e4=function(_0x44b6df,_0x18db79){_0x44b6df=_0x44b6df-0x0;var _0x5628b3=_0x4e46[_0x44b6df];return _0x5628b3;};'use strict';var _=require(_0x64e4('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x64e4('0x1'));var moment=require(_0x64e4('0x2'));var BPromise=require(_0x64e4('0x3'));var rp=require(_0x64e4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x64e4('0x5'));var attributes=require(_0x64e4('0x6'));module[_0x64e4('0x7')]=function(_0x5b939c,_0x10d93b){return _0x5b939c[_0x64e4('0x8')]('License',attributes,{'tableName':_0x64e4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8bff=['moment','bluebird','request-promise','exports','define','license','lodash','util','../../config/logger','api'];(function(_0xf6b5a7,_0x3e9474){var _0x4cb73a=function(_0x5daebb){while(--_0x5daebb){_0xf6b5a7['push'](_0xf6b5a7['shift']());}};_0x4cb73a(++_0x3e9474);}(_0x8bff,0x1d2));var _0xf8bf=function(_0x32f85e,_0x3748c7){_0x32f85e=_0x32f85e-0x0;var _0x1963c9=_0x8bff[_0x32f85e];return _0x1963c9;};'use strict';var _=require(_0xf8bf('0x0'));var util=require(_0xf8bf('0x1'));var logger=require(_0xf8bf('0x2'))(_0xf8bf('0x3'));var moment=require(_0xf8bf('0x4'));var BPromise=require(_0xf8bf('0x5'));var rp=require(_0xf8bf('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./license.attributes');module[_0xf8bf('0x7')]=function(_0x3bfe63,_0x1369d4){return _0x3bfe63[_0xf8bf('0x8')]('License',attributes,{'tableName':_0xf8bf('0x9'),'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 70685f9..36f6fe9 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 _0x7d37=['randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','http','request','then','License,\x20%s,\x20%s','request\x20sent','License,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x7d37,0x1e0));var _0x77d3=function(_0x5c8c16,_0x208c6b){_0x5c8c16=_0x5c8c16-0x0;var _0x1cb779=_0x7d37[_0x5c8c16];return _0x1cb779;};'use strict';var _=require(_0x77d3('0x0'));var util=require(_0x77d3('0x1'));var moment=require(_0x77d3('0x2'));var BPromise=require(_0x77d3('0x3'));var rs=require(_0x77d3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x77d3('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x77d3('0x6'));var config=require(_0x77d3('0x7'));var jayson=require(_0x77d3('0x8'));var client=jayson['client'][_0x77d3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x35dd68,_0x28fdc3,_0x4e6343){return new BPromise(function(_0x471131,_0x1b38fd){return client[_0x77d3('0xa')](_0x35dd68,_0x4e6343)[_0x77d3('0xb')](function(_0x3b3cef){logger['info'](_0x77d3('0xc'),_0x28fdc3,_0x77d3('0xd'));logger['debug'](_0x77d3('0xe'),_0x28fdc3,_0x77d3('0xd'),JSON[_0x77d3('0xf')](_0x3b3cef));if(_0x3b3cef[_0x77d3('0x10')]){if(_0x3b3cef[_0x77d3('0x10')][_0x77d3('0x11')]===0x1f4){logger[_0x77d3('0x10')](_0x77d3('0xc'),_0x28fdc3,_0x3b3cef[_0x77d3('0x10')][_0x77d3('0x12')]);return _0x1b38fd(_0x3b3cef['error']['message']);}logger[_0x77d3('0x10')](_0x77d3('0xc'),_0x28fdc3,_0x3b3cef[_0x77d3('0x10')][_0x77d3('0x12')]);return _0x471131(_0x3b3cef['error'][_0x77d3('0x12')]);}else{logger[_0x77d3('0x13')](_0x77d3('0xc'),_0x28fdc3,_0x77d3('0xd'));_0x471131(_0x3b3cef[_0x77d3('0x14')]['message']);}})[_0x77d3('0x15')](function(_0x223670){logger['error']('License,\x20%s,\x20%s',_0x28fdc3,_0x223670);_0x1b38fd(_0x223670);});});} \ No newline at end of file +var _0x26bf=['License,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','License,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x26bf,0xf5));var _0xf26b=function(_0x1a2889,_0xea581){_0x1a2889=_0x1a2889-0x0;var _0x19da9d=_0x26bf[_0x1a2889];return _0x19da9d;};'use strict';var _=require(_0xf26b('0x0'));var util=require(_0xf26b('0x1'));var moment=require(_0xf26b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf26b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf26b('0x4'));var logger=require(_0xf26b('0x5'))(_0xf26b('0x6'));var config=require(_0xf26b('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf26b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x436578,_0x550f50,_0x140d34){return new BPromise(function(_0x25fe95,_0x2ae384){return client[_0xf26b('0x9')](_0x436578,_0x140d34)[_0xf26b('0xa')](function(_0x34ad50){logger[_0xf26b('0xb')](_0xf26b('0xc'),_0x550f50,_0xf26b('0xd'));logger[_0xf26b('0xe')](_0xf26b('0xf'),_0x550f50,'request\x20sent',JSON['stringify'](_0x34ad50));if(_0x34ad50[_0xf26b('0x10')]){if(_0x34ad50[_0xf26b('0x10')][_0xf26b('0x11')]===0x1f4){logger[_0xf26b('0x10')](_0xf26b('0xc'),_0x550f50,_0x34ad50['error'][_0xf26b('0x12')]);return _0x2ae384(_0x34ad50[_0xf26b('0x10')][_0xf26b('0x12')]);}logger[_0xf26b('0x10')](_0xf26b('0xc'),_0x550f50,_0x34ad50[_0xf26b('0x10')]['message']);return _0x25fe95(_0x34ad50[_0xf26b('0x10')][_0xf26b('0x12')]);}else{logger[_0xf26b('0xb')](_0xf26b('0xc'),_0x550f50,_0xf26b('0xd'));_0x25fe95(_0x34ad50['result']['message']);}})[_0xf26b('0x13')](function(_0x30a8cb){logger[_0xf26b('0x10')]('License,\x20%s,\x20%s',_0x550f50,_0x30a8cb);_0x2ae384(_0x30a8cb);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index c0cd97e..749112b 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 _0x0a38=['put','delete','removeDispositions','removeAnswers','removeSmtp','destroy','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','index','/describe','isAuthenticated','describe','/:id','/:id/dispositions','getDispositions','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','post','addDisposition','/:id/canned_answers','addAnswer','addSmtp','addInteraction','/:id/send','send','addAgents'];(function(_0xa1de8d,_0x1399a8){var _0x478b44=function(_0x3c8db7){while(--_0x3c8db7){_0xa1de8d['push'](_0xa1de8d['shift']());}};_0x478b44(++_0x1399a8);}(_0x0a38,0x9b));var _0x80a3=function(_0x1631d8,_0x42f051){_0x1631d8=_0x1631d8-0x0;var _0x287eec=_0x0a38[_0x1631d8];return _0x287eec;};'use strict';var multer=require(_0x80a3('0x0'));var util=require('util');var path=require(_0x80a3('0x1'));var timeout=require(_0x80a3('0x2'));var express=require(_0x80a3('0x3'));var router=express[_0x80a3('0x4')]();var fs_extra=require(_0x80a3('0x5'));var auth=require(_0x80a3('0x6'));var interaction=require(_0x80a3('0x7'));var config=require(_0x80a3('0x8'));var controller=require(_0x80a3('0x9'));router[_0x80a3('0xa')]('/',auth['isAuthenticated'](),controller[_0x80a3('0xb')]);router[_0x80a3('0xa')](_0x80a3('0xc'),auth[_0x80a3('0xd')](),controller[_0x80a3('0xe')]);router[_0x80a3('0xa')](_0x80a3('0xf'),auth[_0x80a3('0xd')](),controller['show']);router[_0x80a3('0xa')](_0x80a3('0x10'),auth[_0x80a3('0xd')](),controller[_0x80a3('0x11')]);router['get']('/:id/canned_answers',auth[_0x80a3('0xd')](),controller[_0x80a3('0x12')]);router[_0x80a3('0xa')](_0x80a3('0x13'),auth[_0x80a3('0xd')](),controller[_0x80a3('0x14')]);router[_0x80a3('0xa')](_0x80a3('0x15'),auth[_0x80a3('0xd')](),controller[_0x80a3('0x16')]);router[_0x80a3('0xa')](_0x80a3('0x17'),auth['isAuthenticated'](),controller[_0x80a3('0x18')]);router['get'](_0x80a3('0x19'),auth[_0x80a3('0xd')](),controller[_0x80a3('0x1a')]);router[_0x80a3('0xa')](_0x80a3('0x1b'),auth[_0x80a3('0xd')](),controller[_0x80a3('0x1c')]);router['get'](_0x80a3('0x1d'),auth[_0x80a3('0xd')](),controller[_0x80a3('0x1e')]);router[_0x80a3('0xa')](_0x80a3('0x1f'),auth['isAuthenticated'](),controller['getAgents']);router[_0x80a3('0x20')](_0x80a3('0x10'),auth[_0x80a3('0xd')](),controller[_0x80a3('0x21')]);router[_0x80a3('0x20')](_0x80a3('0x22'),auth['isAuthenticated'](),controller[_0x80a3('0x23')]);router[_0x80a3('0x20')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x80a3('0x13'),auth['isAuthenticated'](),controller['addImap']);router[_0x80a3('0x20')](_0x80a3('0x15'),auth[_0x80a3('0xd')](),controller[_0x80a3('0x24')]);router['post'](_0x80a3('0x17'),auth[_0x80a3('0xd')](),controller[_0x80a3('0x25')]);router[_0x80a3('0x20')](_0x80a3('0x19'),auth[_0x80a3('0xd')](),controller['addApplications']);router[_0x80a3('0x20')](_0x80a3('0x26'),auth[_0x80a3('0xd')](),controller[_0x80a3('0x27')]);router[_0x80a3('0x20')](_0x80a3('0x1f'),auth[_0x80a3('0xd')](),controller[_0x80a3('0x28')]);router[_0x80a3('0x29')](_0x80a3('0xf'),auth['isAuthenticated'](),controller['update']);router[_0x80a3('0x2a')](_0x80a3('0x10'),auth[_0x80a3('0xd')](),controller[_0x80a3('0x2b')]);router[_0x80a3('0x2a')](_0x80a3('0x22'),auth['isAuthenticated'](),controller[_0x80a3('0x2c')]);router[_0x80a3('0x2a')](_0x80a3('0x13'),auth['isAuthenticated'](),controller['removeImap']);router[_0x80a3('0x2a')]('/:id/out_servers',auth[_0x80a3('0xd')](),controller[_0x80a3('0x2d')]);router[_0x80a3('0x2a')](_0x80a3('0xf'),auth[_0x80a3('0xd')](),controller[_0x80a3('0x2e')]);router['delete'](_0x80a3('0x1f'),auth[_0x80a3('0xd')](),controller[_0x80a3('0x2f')]);module[_0x80a3('0x30')]=router; \ No newline at end of file +var _0xa7a6=['index','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/applications','/:id/messages','getMessages','verifySmtp','/:id/users','post','create','addImap','addSmtp','/:id/interactions','/:id/send','send','put','update','delete','removeDispositions','removeSmtp','destroy','removeAgents','exports','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailAccount.controller','get'];(function(_0x5ee044,_0x4e21ac){var _0x27084e=function(_0x4b95c6){while(--_0x4b95c6){_0x5ee044['push'](_0x5ee044['shift']());}};_0x27084e(++_0x4e21ac);}(_0xa7a6,0xee));var _0x6a7a=function(_0x24ae03,_0x334660){_0x24ae03=_0x24ae03-0x0;var _0x38a29e=_0xa7a6[_0x24ae03];return _0x38a29e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6a7a('0x0'));var timeout=require(_0x6a7a('0x1'));var express=require('express');var router=express[_0x6a7a('0x2')]();var fs_extra=require(_0x6a7a('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x6a7a('0x4'));var config=require(_0x6a7a('0x5'));var controller=require(_0x6a7a('0x6'));router[_0x6a7a('0x7')]('/',auth['isAuthenticated'](),controller[_0x6a7a('0x8')]);router[_0x6a7a('0x7')](_0x6a7a('0x9'),auth[_0x6a7a('0xa')](),controller[_0x6a7a('0xb')]);router[_0x6a7a('0x7')](_0x6a7a('0xc'),auth[_0x6a7a('0xa')](),controller[_0x6a7a('0xd')]);router[_0x6a7a('0x7')](_0x6a7a('0xe'),auth['isAuthenticated'](),controller['getDispositions']);router[_0x6a7a('0x7')](_0x6a7a('0xf'),auth[_0x6a7a('0xa')](),controller[_0x6a7a('0x10')]);router[_0x6a7a('0x7')](_0x6a7a('0x11'),auth[_0x6a7a('0xa')](),controller[_0x6a7a('0x12')]);router[_0x6a7a('0x7')](_0x6a7a('0x13'),auth[_0x6a7a('0xa')](),controller[_0x6a7a('0x14')]);router[_0x6a7a('0x7')]('/:id/interactions',auth['isAuthenticated'](),controller['getInteractions']);router[_0x6a7a('0x7')](_0x6a7a('0x15'),auth['isAuthenticated'](),controller['getApplications']);router[_0x6a7a('0x7')](_0x6a7a('0x16'),auth['isAuthenticated'](),controller[_0x6a7a('0x17')]);router[_0x6a7a('0x7')]('/:id/verify',auth['isAuthenticated'](),controller[_0x6a7a('0x18')]);router[_0x6a7a('0x7')](_0x6a7a('0x19'),auth[_0x6a7a('0xa')](),controller['getAgents']);router['post'](_0x6a7a('0xe'),auth[_0x6a7a('0xa')](),controller['addDisposition']);router[_0x6a7a('0x1a')](_0x6a7a('0xf'),auth[_0x6a7a('0xa')](),controller['addAnswer']);router['post']('/',auth[_0x6a7a('0xa')](),controller[_0x6a7a('0x1b')]);router[_0x6a7a('0x1a')]('/:id/in_servers',auth[_0x6a7a('0xa')](),controller[_0x6a7a('0x1c')]);router['post']('/:id/out_servers',auth[_0x6a7a('0xa')](),controller[_0x6a7a('0x1d')]);router[_0x6a7a('0x1a')](_0x6a7a('0x1e'),auth[_0x6a7a('0xa')](),controller['addInteraction']);router[_0x6a7a('0x1a')](_0x6a7a('0x15'),auth[_0x6a7a('0xa')](),controller['addApplications']);router['post'](_0x6a7a('0x1f'),auth[_0x6a7a('0xa')](),controller[_0x6a7a('0x20')]);router[_0x6a7a('0x1a')](_0x6a7a('0x19'),auth['isAuthenticated'](),controller['addAgents']);router[_0x6a7a('0x21')](_0x6a7a('0xc'),auth[_0x6a7a('0xa')](),controller[_0x6a7a('0x22')]);router[_0x6a7a('0x23')](_0x6a7a('0xe'),auth[_0x6a7a('0xa')](),controller[_0x6a7a('0x24')]);router[_0x6a7a('0x23')](_0x6a7a('0xf'),auth['isAuthenticated'](),controller['removeAnswers']);router[_0x6a7a('0x23')](_0x6a7a('0x11'),auth[_0x6a7a('0xa')](),controller['removeImap']);router['delete']('/:id/out_servers',auth[_0x6a7a('0xa')](),controller[_0x6a7a('0x25')]);router[_0x6a7a('0x23')](_0x6a7a('0xc'),auth[_0x6a7a('0xa')](),controller[_0x6a7a('0x26')]);router[_0x6a7a('0x23')]('/:id/users',auth['isAuthenticated'](),controller[_0x6a7a('0x27')]);module[_0x6a7a('0x28')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 6cbe4b7..8e682c4 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 _0x17c4=['STRING','BOOLEAN','TEXT','INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','setDataValue','mandatoryDispositionPauseId','sequelize','exports'];(function(_0x3957ee,_0x106e67){var _0x279939=function(_0x2727c9){while(--_0x2727c9){_0x3957ee['push'](_0x3957ee['shift']());}};_0x279939(++_0x106e67);}(_0x17c4,0x102));var _0x417c=function(_0x178d9c,_0x3aaad3){_0x178d9c=_0x178d9c-0x0;var _0x9656c5=_0x17c4[_0x178d9c];return _0x9656c5;};'use strict';var Sequelize=require(_0x417c('0x0'));module[_0x417c('0x1')]={'description':{'type':Sequelize[_0x417c('0x2')]},'name':{'type':Sequelize[_0x417c('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0x417c('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x417c('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x417c('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0x417c('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0x417c('0x4')]},'markAsUnread':{'type':Sequelize[_0x417c('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x417c('0x2')],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize[_0x417c('0x5')](0x2)[_0x417c('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x417c('0x4')],'defaultValue':function(){return _0x417c('0x7');}},'notificationSound':{'type':Sequelize[_0x417c('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x417c('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x417c('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x417c('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x417c('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x417c('0x5')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x417c('0x3')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x8755fd){if(!_0x8755fd)this[_0x417c('0x8')](_0x417c('0x9'),null);this[_0x417c('0x8')]('mandatoryDisposition',_0x8755fd);}}}; \ No newline at end of file +var _0x31af=['mandatoryDisposition','sequelize','exports','STRING','TEXT','BOOLEAN','INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId'];(function(_0x55333e,_0x9020fb){var _0x223f9c=function(_0x1054a9){while(--_0x1054a9){_0x55333e['push'](_0x55333e['shift']());}};_0x223f9c(++_0x9020fb);}(_0x31af,0xde));var _0xf31a=function(_0x25d267,_0x50dcfb){_0x25d267=_0x25d267-0x0;var _0x1a046f=_0x31af[_0x25d267];return _0x1a046f;};'use strict';var Sequelize=require(_0xf31a('0x0'));module[_0xf31a('0x1')]={'description':{'type':Sequelize[_0xf31a('0x2')]},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0xf31a('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize[_0xf31a('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0xf31a('0x3')]},'markAsUnread':{'type':Sequelize[_0xf31a('0x4')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xf31a('0x2')],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize[_0xf31a('0x5')](0x2)[_0xf31a('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xf31a('0x3')],'defaultValue':function(){return _0xf31a('0x7');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xf31a('0x4')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xf31a('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xf31a('0x4')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xf31a('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xf31a('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf31a('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0xf31a('0x8')},'mandatoryDisposition':{'type':Sequelize[_0xf31a('0x4')],'defaultValue':![],'comment':_0xf31a('0x9'),'set':function(_0x5165aa){if(!_0x5165aa)this[_0xf31a('0xa')](_0xf31a('0xb'),null);this[_0xf31a('0xa')](_0xf31a('0xc'),_0x5165aa);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 8b055fc..be47c18 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 _0xf466=['jayson/promise','client','http','request','info','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','MailAccount,\x20%s,\x20%s','message','result','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','destroy','then','get','MailAccounts','name','send','index','MailServerIn','Imap','MailServerOut','Smtp','Pause','mandatoryDispositionPause','map','MailAccount','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','rawAttributes','find','body','describe','addDisposition','Disposition','create','findOne','MailAccountId','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','email','isNil','active','description','cservice','cauthentication','user','password','cpassword','authentication','host','port','service','pass','userProfileId','autoAssociation','UserProfileResource','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','addInteraction','MailInteraction','omit','CmContact','Owner','fullname','internal','Tags','color','tag','transaction','MailApplication','bulkCreate','priority','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','CmList','List','Contacts','updatedAt','DESC','from','%s\x20<%s>','attachments','join','root','server/files/attachments','auth','secure','SendMail','sendMail','ListId','List\x20not\x20found','messageId','subject','out','Interaction','Messages','verifySmtp','VerifySmtp','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','User','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','html-to-text','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','./mailAccount.socket','register'];(function(_0x1ccec2,_0x3ae6de){var _0x557d89=function(_0x326fe1){while(--_0x326fe1){_0x1ccec2['push'](_0x1ccec2['shift']());}};_0x557d89(++_0x3ae6de);}(_0xf466,0xa4));var _0x6f46=function(_0x5b987d,_0x24a344){_0x5b987d=_0x5b987d-0x0;var _0x282e0d=_0xf466[_0x5b987d];return _0x282e0d;};'use strict';var emlformat=require(_0x6f46('0x0'));var rimraf=require(_0x6f46('0x1'));var zipdir=require(_0x6f46('0x2'));var jsonpatch=require(_0x6f46('0x3'));var rp=require(_0x6f46('0x4'));var moment=require(_0x6f46('0x5'));var BPromise=require(_0x6f46('0x6'));var Mustache=require(_0x6f46('0x7'));var util=require(_0x6f46('0x8'));var path=require(_0x6f46('0x9'));var sox=require(_0x6f46('0xa'));var csv=require(_0x6f46('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6f46('0xc'));var _=require(_0x6f46('0xd'));var squel=require(_0x6f46('0xe'));var crypto=require(_0x6f46('0xf'));var jsforce=require(_0x6f46('0x10'));var deskjs=require(_0x6f46('0x11'));var toCsv=require(_0x6f46('0xb'));var querystring=require(_0x6f46('0x12'));var Papa=require(_0x6f46('0x13'));var htmlToText=require(_0x6f46('0x14'));var juice=require('juice');var Redis=require(_0x6f46('0x15'));var authService=require(_0x6f46('0x16'));var qs=require(_0x6f46('0x17'));var as=require(_0x6f46('0x18'));var hardwareService=require(_0x6f46('0x19'));var logger=require(_0x6f46('0x1a'))('api');var utils=require(_0x6f46('0x1b'));var config=require(_0x6f46('0x1c'));var licenseUtil=require(_0x6f46('0x1d'));var db=require(_0x6f46('0x1e'))['db'];config[_0x6f46('0x1f')]=_[_0x6f46('0x20')](config[_0x6f46('0x1f')],{'host':_0x6f46('0x21'),'port':0x18eb});var socket=require(_0x6f46('0x22'))(new Redis(config[_0x6f46('0x1f')]));require(_0x6f46('0x23'))[_0x6f46('0x24')](socket);var jayson=require(_0x6f46('0x25'));var client=jayson[_0x6f46('0x26')][_0x6f46('0x27')]({'port':0x232b});function respondWithRpcPromise(_0x1a0b31,_0x23518c,_0x52c4a0,_0x5c3565){return new BPromise(function(_0x59a52a,_0x276256){var _0x4460d4=_0x5c3565||client;return _0x4460d4[_0x6f46('0x28')](_0x1a0b31,_0x52c4a0)['then'](function(_0x12795c){logger[_0x6f46('0x29')]('MailAccount,\x20%s,\x20%s',_0x23518c,_0x6f46('0x2a'));logger[_0x6f46('0x2b')](_0x6f46('0x2c'),_0x23518c,_0x6f46('0x2a'),JSON[_0x6f46('0x2d')](_0x12795c));if(_0x12795c[_0x6f46('0x2e')]){if(_0x12795c[_0x6f46('0x2e')][_0x6f46('0x2f')]===0x1f4){logger[_0x6f46('0x2e')](_0x6f46('0x30'),_0x23518c,_0x12795c[_0x6f46('0x2e')][_0x6f46('0x31')]);return _0x276256(_0x12795c[_0x6f46('0x2e')][_0x6f46('0x31')]);}logger[_0x6f46('0x2e')](_0x6f46('0x30'),_0x23518c,_0x12795c[_0x6f46('0x2e')][_0x6f46('0x31')]);return _0x59a52a(_0x12795c[_0x6f46('0x2e')][_0x6f46('0x31')]);}else{logger['info'](_0x6f46('0x30'),_0x23518c,'request\x20sent');_0x59a52a(_0x12795c[_0x6f46('0x32')]['message']);}})['catch'](function(_0xf80b3e){logger[_0x6f46('0x2e')](_0x6f46('0x30'),_0x23518c,_0xf80b3e);_0x276256(_0xf80b3e);});});}function respondWithStatusCode(_0x5a89fa,_0x4eed2d){_0x4eed2d=_0x4eed2d||0xcc;return function(_0x3f5d27){if(_0x3f5d27){return _0x5a89fa[_0x6f46('0x33')](_0x4eed2d);}return _0x5a89fa['status'](_0x4eed2d)[_0x6f46('0x34')]();};}function respondWithResult(_0x2c100c,_0x382cb2){_0x382cb2=_0x382cb2||0xc8;return function(_0x536abc){if(_0x536abc){return _0x2c100c['status'](_0x382cb2)[_0x6f46('0x35')](_0x536abc);}};}function respondWithFilteredResult(_0x139bcd,_0x200bd4){return function(_0x17051e){if(_0x17051e){var _0x258060=typeof _0x200bd4[_0x6f46('0x36')]===_0x6f46('0x37')&&typeof _0x200bd4[_0x6f46('0x38')]===_0x6f46('0x37');var _0x38a9c5=_0x17051e[_0x6f46('0x39')];var _0x337d22=_0x258060?0x0:_0x200bd4[_0x6f46('0x36')];var _0x34f781=_0x258060?_0x17051e[_0x6f46('0x39')]:_0x200bd4[_0x6f46('0x36')]+_0x200bd4[_0x6f46('0x38')];var _0x2021e5;if(_0x34f781>=_0x38a9c5){_0x34f781=_0x38a9c5;_0x2021e5=0xc8;}else{_0x2021e5=0xce;}_0x139bcd[_0x6f46('0x3a')](_0x2021e5);return _0x139bcd[_0x6f46('0x3b')](_0x6f46('0x3c'),_0x337d22+'-'+_0x34f781+'/'+_0x38a9c5)['json'](_0x17051e);}return null;};}function patchUpdates(_0x55d478){return function(_0x277266){try{jsonpatch[_0x6f46('0x3d')](_0x277266,_0x55d478,!![]);}catch(_0x5f0965){return BPromise[_0x6f46('0x3e')](_0x5f0965);}return _0x277266[_0x6f46('0x3f')]();};}function saveUpdates(_0x3e798a,_0x562a48){return function(_0x22bc50){if(_0x22bc50){return _0x22bc50[_0x6f46('0x40')](_0x3e798a)['then'](function(_0x1c6cc6){return _0x1c6cc6;});}return null;};}function removeEntity(_0x32892b,_0x4ece81){return function(_0x52cb5d){if(_0x52cb5d){return _0x52cb5d[_0x6f46('0x41')]()[_0x6f46('0x42')](function(){var _0x2cbef1=_0x52cb5d[_0x6f46('0x43')]({'plain':!![]});var _0x50207d=_0x6f46('0x44');return db['UserProfileResource'][_0x6f46('0x41')]({'where':{'type':_0x50207d,'resourceId':_0x2cbef1['id']}})[_0x6f46('0x42')](function(){return _0x52cb5d;});})[_0x6f46('0x42')](function(){_0x32892b[_0x6f46('0x3a')](0xcc)[_0x6f46('0x34')]();});}};}function handleEntityNotFound(_0x267ad7,_0x3898e0){return function(_0x2058d6){if(!_0x2058d6){_0x267ad7[_0x6f46('0x33')](0x194);}return _0x2058d6;};}function handleError(_0x57120c,_0x1ae749){_0x1ae749=_0x1ae749||0x1f4;return function(_0xeeb99c){logger['error'](_0xeeb99c['stack']);if(_0xeeb99c[_0x6f46('0x45')]){delete _0xeeb99c[_0x6f46('0x45')];}_0x57120c['status'](_0x1ae749)[_0x6f46('0x46')](_0xeeb99c);};}exports[_0x6f46('0x47')]=function(_0x42c314,_0x1b6a1a){var _0x2c67ed={'include':[{'model':db[_0x6f46('0x48')],'as':_0x6f46('0x49')},{'model':db[_0x6f46('0x4a')],'as':_0x6f46('0x4b')},{'model':db[_0x6f46('0x4c')],'as':_0x6f46('0x4d')}]},_0x3fe614={},_0x5e98b2={'count':0x0,'rows':[]};var _0x33c167=_[_0x6f46('0x4e')](db[_0x6f46('0x4f')]['rawAttributes'],function(_0x6e190a){return{'name':_0x6e190a[_0x6f46('0x50')],'type':_0x6e190a['type'][_0x6f46('0x51')]};});_0x3fe614[_0x6f46('0x52')]=_[_0x6f46('0x4e')](_0x33c167,_0x6f46('0x45'));_0x3fe614[_0x6f46('0x53')]=_[_0x6f46('0x54')](_0x42c314[_0x6f46('0x53')]);_0x3fe614[_0x6f46('0x55')]=_[_0x6f46('0x56')](_0x3fe614[_0x6f46('0x52')],_0x3fe614[_0x6f46('0x53')]);_0x2c67ed[_0x6f46('0x57')]=_[_0x6f46('0x56')](_0x3fe614['model'],qs[_0x6f46('0x58')](_0x42c314[_0x6f46('0x53')]['fields']));_0x2c67ed[_0x6f46('0x57')]=_0x2c67ed['attributes'][_0x6f46('0x59')]?_0x2c67ed[_0x6f46('0x57')]:_0x3fe614['model'];if(!_0x42c314[_0x6f46('0x53')][_0x6f46('0x5a')](_0x6f46('0x5b'))){_0x2c67ed['limit']=qs[_0x6f46('0x38')](_0x42c314[_0x6f46('0x53')][_0x6f46('0x38')]);_0x2c67ed[_0x6f46('0x36')]=qs[_0x6f46('0x36')](_0x42c314[_0x6f46('0x53')]['offset']);}_0x2c67ed[_0x6f46('0x5c')]=qs[_0x6f46('0x5d')](_0x42c314[_0x6f46('0x53')][_0x6f46('0x5d')]);_0x2c67ed['where']=qs[_0x6f46('0x55')](_[_0x6f46('0x5e')](_0x42c314[_0x6f46('0x53')],_0x3fe614[_0x6f46('0x55')]),_0x33c167);if(_0x42c314[_0x6f46('0x53')][_0x6f46('0x5f')]){_0x2c67ed[_0x6f46('0x60')]=_['merge'](_0x2c67ed['where'],{'$or':_[_0x6f46('0x4e')](_0x33c167,function(_0x58f7b3){if(_0x58f7b3['type']!==_0x6f46('0x61')){var _0x3cec3a={};_0x3cec3a[_0x58f7b3[_0x6f46('0x45')]]={'$like':'%'+_0x42c314[_0x6f46('0x53')][_0x6f46('0x5f')]+'%'};return _0x3cec3a;}})});}_0x2c67ed=_[_0x6f46('0x62')]({},_0x2c67ed,_0x42c314[_0x6f46('0x63')]);var _0x2df8d8={'where':_0x2c67ed['where']};return db['MailAccount'][_0x6f46('0x39')](_0x2df8d8)[_0x6f46('0x42')](function(_0x45b441){_0x5e98b2['count']=_0x45b441;if(_0x42c314[_0x6f46('0x53')][_0x6f46('0x64')]){_0x2c67ed[_0x6f46('0x65')]=[{'all':!![]}];}return db['MailAccount'][_0x6f46('0x66')](_0x2c67ed);})[_0x6f46('0x42')](function(_0x3f1bad){_0x5e98b2[_0x6f46('0x67')]=_0x3f1bad;return _0x5e98b2;})[_0x6f46('0x42')](respondWithFilteredResult(_0x1b6a1a,_0x2c67ed))[_0x6f46('0x68')](handleError(_0x1b6a1a,null));};exports['show']=function(_0x5a8871,_0xeec41e){var _0x1c26ff={'raw':![],'where':{'id':_0x5a8871[_0x6f46('0x69')]['id']},'include':[{'model':db[_0x6f46('0x48')],'as':_0x6f46('0x49')},{'model':db['MailServerOut'],'as':'Smtp'},{'model':db['Pause'],'as':_0x6f46('0x4d')}]},_0x3abc5a={};_0x3abc5a['model']=_[_0x6f46('0x54')](db['MailAccount'][_0x6f46('0x6a')]);_0x3abc5a[_0x6f46('0x53')]=_['keys'](_0x5a8871[_0x6f46('0x53')]);_0x3abc5a['filters']=_['intersection'](_0x3abc5a['model'],_0x3abc5a[_0x6f46('0x53')]);_0x1c26ff[_0x6f46('0x57')]=_['intersection'](_0x3abc5a[_0x6f46('0x52')],qs[_0x6f46('0x58')](_0x5a8871[_0x6f46('0x53')]['fields']));_0x1c26ff['attributes']=_0x1c26ff[_0x6f46('0x57')][_0x6f46('0x59')]?_0x1c26ff[_0x6f46('0x57')]:_0x3abc5a[_0x6f46('0x52')];if(_0x5a8871[_0x6f46('0x53')][_0x6f46('0x64')]){_0x1c26ff[_0x6f46('0x65')]=[{'all':!![]}];}_0x1c26ff=_[_0x6f46('0x62')]({},_0x1c26ff,_0x5a8871[_0x6f46('0x63')]);return db[_0x6f46('0x4f')][_0x6f46('0x6b')](_0x1c26ff)['then'](handleEntityNotFound(_0xeec41e,null))['then'](respondWithResult(_0xeec41e,null))[_0x6f46('0x68')](handleError(_0xeec41e,null));};exports[_0x6f46('0x40')]=function(_0x5df00b,_0x187f09){if(_0x5df00b[_0x6f46('0x6c')]['id']){delete _0x5df00b[_0x6f46('0x6c')]['id'];}return db[_0x6f46('0x4f')][_0x6f46('0x6b')]({'where':{'id':_0x5df00b[_0x6f46('0x69')]['id']},'include':[{'model':db[_0x6f46('0x48')],'as':_0x6f46('0x49')},{'model':db[_0x6f46('0x4a')],'as':_0x6f46('0x4b')},{'model':db[_0x6f46('0x4c')],'as':_0x6f46('0x4d')}]})[_0x6f46('0x42')](handleEntityNotFound(_0x187f09,null))[_0x6f46('0x42')](saveUpdates(_0x5df00b[_0x6f46('0x6c')],null))[_0x6f46('0x42')](function(_0x53193f){if(_0x53193f&&_0x5df00b[_0x6f46('0x6c')][_0x6f46('0x49')]){return db[_0x6f46('0x48')][_0x6f46('0x40')](_0x5df00b['body'][_0x6f46('0x49')],{'where':{'MailAccountId':_0x53193f['id']}})[_0x6f46('0x42')](function(){return _0x53193f;});}return _0x53193f;})[_0x6f46('0x42')](function(_0x2bdf30){if(_0x2bdf30&&_0x5df00b[_0x6f46('0x6c')][_0x6f46('0x4b')]){return db[_0x6f46('0x4a')][_0x6f46('0x40')](_0x5df00b['body'][_0x6f46('0x4b')],{'where':{'MailAccountId':_0x2bdf30['id']}})['then'](function(){return _0x2bdf30;});}return _0x2bdf30;})[_0x6f46('0x42')](respondWithResult(_0x187f09,null))[_0x6f46('0x68')](handleError(_0x187f09,null));};exports[_0x6f46('0x6d')]=function(_0x16576c,_0xd523c1){return db[_0x6f46('0x4f')]['describe']()[_0x6f46('0x42')](respondWithResult(_0xd523c1,null))['catch'](handleError(_0xd523c1,null));};exports[_0x6f46('0x6e')]=function(_0x58dff6,_0x27ebfd,_0x2ec588){if(_0x58dff6['body']['id']){delete _0x58dff6[_0x6f46('0x6c')]['id'];}return db[_0x6f46('0x4f')][_0x6f46('0x6b')]({'where':{'id':_0x58dff6['params']['id']}})['then'](handleEntityNotFound(_0x27ebfd,null))[_0x6f46('0x42')](function(_0x3600e5){if(_0x3600e5){_0x58dff6[_0x6f46('0x6c')]['MailAccountId']=_0x3600e5['id'];return db[_0x6f46('0x6f')][_0x6f46('0x70')](_0x58dff6[_0x6f46('0x6c')]);}})[_0x6f46('0x42')](respondWithResult(_0x27ebfd,null))['catch'](handleError(_0x27ebfd,null));};exports['getDispositions']=function(_0x423ad3,_0x3ce19e,_0x1bd1c2){var _0x477400={'raw':![],'where':{}};var _0x4b2379={};var _0x18dc3b={'count':0x0,'rows':[]};return db['MailAccount'][_0x6f46('0x71')]({'where':{'id':_0x423ad3[_0x6f46('0x69')]['id']}})[_0x6f46('0x42')](handleEntityNotFound(_0x3ce19e,null))[_0x6f46('0x42')](function(_0x175ba7){if(_0x175ba7){_0x4b2379[_0x6f46('0x52')]=_[_0x6f46('0x54')](db[_0x6f46('0x6f')][_0x6f46('0x6a')]);_0x4b2379['query']=_[_0x6f46('0x54')](_0x423ad3[_0x6f46('0x53')]);_0x4b2379[_0x6f46('0x55')]=_[_0x6f46('0x56')](_0x4b2379[_0x6f46('0x52')],_0x4b2379['query']);_0x477400[_0x6f46('0x57')]=_[_0x6f46('0x56')](_0x4b2379[_0x6f46('0x52')],qs[_0x6f46('0x58')](_0x423ad3[_0x6f46('0x53')][_0x6f46('0x58')]));_0x477400[_0x6f46('0x57')]=_0x477400[_0x6f46('0x57')][_0x6f46('0x59')]?_0x477400[_0x6f46('0x57')]:_0x4b2379['model'];if(!_0x423ad3[_0x6f46('0x53')]['hasOwnProperty']('nolimit')){_0x477400[_0x6f46('0x38')]=qs[_0x6f46('0x38')](_0x423ad3[_0x6f46('0x53')][_0x6f46('0x38')]);_0x477400[_0x6f46('0x36')]=qs['offset'](_0x423ad3['query'][_0x6f46('0x36')]);}_0x477400[_0x6f46('0x5c')]=qs[_0x6f46('0x5d')](_0x423ad3[_0x6f46('0x53')]['sort']);_0x477400[_0x6f46('0x60')]=qs[_0x6f46('0x55')](_[_0x6f46('0x5e')](_0x423ad3[_0x6f46('0x53')],_0x4b2379[_0x6f46('0x55')]));_0x477400[_0x6f46('0x60')][_0x6f46('0x72')]=_0x175ba7['id'];if(_0x423ad3['query'][_0x6f46('0x5f')]){_0x477400[_0x6f46('0x60')]=_[_0x6f46('0x62')](_0x477400[_0x6f46('0x60')],{'$or':_[_0x6f46('0x4e')](_0x477400[_0x6f46('0x57')],function(_0x3e5e9a){var _0x48dd4a={};_0x48dd4a[_0x3e5e9a]={'$like':'%'+_0x423ad3[_0x6f46('0x53')][_0x6f46('0x5f')]+'%'};return _0x48dd4a;})});}_0x477400=_[_0x6f46('0x62')]({},_0x477400,_0x423ad3['options']);return db[_0x6f46('0x6f')][_0x6f46('0x39')]({'where':_0x477400[_0x6f46('0x60')]})[_0x6f46('0x42')](function(_0x35f163){_0x18dc3b[_0x6f46('0x39')]=_0x35f163;if(_0x423ad3['query'][_0x6f46('0x64')]){_0x477400[_0x6f46('0x65')]=[{'all':!![]}];}return db[_0x6f46('0x6f')][_0x6f46('0x66')](_0x477400);})[_0x6f46('0x42')](function(_0x12e03f){_0x18dc3b[_0x6f46('0x67')]=_0x12e03f;return _0x18dc3b;});}})[_0x6f46('0x42')](respondWithFilteredResult(_0x3ce19e,_0x477400))['catch'](handleError(_0x3ce19e,null));};exports['removeDispositions']=function(_0x4434e1,_0x489f94,_0x444b94){return db[_0x6f46('0x4f')]['find']({'where':{'id':_0x4434e1[_0x6f46('0x69')]['id']}})['then'](handleEntityNotFound(_0x489f94,null))['then'](function(_0x437277){if(_0x437277){return _0x437277['removeDispositions'](_0x4434e1[_0x6f46('0x53')]['ids']);}})[_0x6f46('0x42')](respondWithStatusCode(_0x489f94,null))[_0x6f46('0x68')](handleError(_0x489f94,null));};exports[_0x6f46('0x73')]=function(_0x45e1b2,_0x45e035,_0x37c586){if(_0x45e1b2[_0x6f46('0x6c')]['id']){delete _0x45e1b2[_0x6f46('0x6c')]['id'];}return db['MailAccount'][_0x6f46('0x6b')]({'where':{'id':_0x45e1b2['params']['id']}})[_0x6f46('0x42')](handleEntityNotFound(_0x45e035,null))[_0x6f46('0x42')](function(_0x3fbeee){if(_0x3fbeee){_0x45e1b2[_0x6f46('0x6c')]['MailAccountId']=_0x3fbeee['id'];return db[_0x6f46('0x74')][_0x6f46('0x70')](_0x45e1b2[_0x6f46('0x6c')]);}})[_0x6f46('0x42')](respondWithResult(_0x45e035,null))[_0x6f46('0x68')](handleError(_0x45e035,null));};exports[_0x6f46('0x75')]=function(_0x41eb73,_0x4ba10a,_0x1767e6){var _0x31e1c8={'raw':![],'where':{}};var _0x3cd126={};var _0x4089ca={'count':0x0,'rows':[]};return db[_0x6f46('0x4f')][_0x6f46('0x71')]({'where':{'id':_0x41eb73[_0x6f46('0x69')]['id']}})[_0x6f46('0x42')](handleEntityNotFound(_0x4ba10a,null))[_0x6f46('0x42')](function(_0x41a5d9){if(_0x41a5d9){_0x3cd126[_0x6f46('0x52')]=_[_0x6f46('0x54')](db[_0x6f46('0x74')][_0x6f46('0x6a')]);_0x3cd126[_0x6f46('0x53')]=_[_0x6f46('0x54')](_0x41eb73[_0x6f46('0x53')]);_0x3cd126['filters']=_[_0x6f46('0x56')](_0x3cd126['model'],_0x3cd126[_0x6f46('0x53')]);_0x31e1c8[_0x6f46('0x57')]=_[_0x6f46('0x56')](_0x3cd126[_0x6f46('0x52')],qs['fields'](_0x41eb73[_0x6f46('0x53')][_0x6f46('0x58')]));_0x31e1c8[_0x6f46('0x57')]=_0x31e1c8[_0x6f46('0x57')]['length']?_0x31e1c8[_0x6f46('0x57')]:_0x3cd126['model'];if(!_0x41eb73[_0x6f46('0x53')][_0x6f46('0x5a')](_0x6f46('0x5b'))){_0x31e1c8[_0x6f46('0x38')]=qs[_0x6f46('0x38')](_0x41eb73['query'][_0x6f46('0x38')]);_0x31e1c8['offset']=qs[_0x6f46('0x36')](_0x41eb73[_0x6f46('0x53')][_0x6f46('0x36')]);}_0x31e1c8[_0x6f46('0x5c')]=qs['sort'](_0x41eb73[_0x6f46('0x53')][_0x6f46('0x5d')]);_0x31e1c8['where']=qs[_0x6f46('0x55')](_[_0x6f46('0x5e')](_0x41eb73['query'],_0x3cd126['filters']));_0x31e1c8[_0x6f46('0x60')][_0x6f46('0x72')]=_0x41a5d9['id'];if(_0x41eb73[_0x6f46('0x53')]['filter']){_0x31e1c8[_0x6f46('0x60')]=_['merge'](_0x31e1c8[_0x6f46('0x60')],{'$or':_[_0x6f46('0x4e')](_0x31e1c8[_0x6f46('0x57')],function(_0xda86d){var _0x479089={};_0x479089[_0xda86d]={'$like':'%'+_0x41eb73[_0x6f46('0x53')][_0x6f46('0x5f')]+'%'};return _0x479089;})});}_0x31e1c8=_[_0x6f46('0x62')]({},_0x31e1c8,_0x41eb73['options']);return db[_0x6f46('0x74')]['count']({'where':_0x31e1c8[_0x6f46('0x60')]})[_0x6f46('0x42')](function(_0x565d77){_0x4089ca[_0x6f46('0x39')]=_0x565d77;if(_0x41eb73[_0x6f46('0x53')]['includeAll']){_0x31e1c8['include']=[{'all':!![]}];}return db[_0x6f46('0x74')][_0x6f46('0x66')](_0x31e1c8);})[_0x6f46('0x42')](function(_0x596a44){_0x4089ca['rows']=_0x596a44;return _0x4089ca;});}})['then'](respondWithFilteredResult(_0x4ba10a,_0x31e1c8))[_0x6f46('0x68')](handleError(_0x4ba10a,null));};exports[_0x6f46('0x76')]=function(_0x3725c7,_0x475a6e,_0x567bd4){return db[_0x6f46('0x4f')][_0x6f46('0x6b')]({'where':{'id':_0x3725c7[_0x6f46('0x69')]['id']}})[_0x6f46('0x42')](handleEntityNotFound(_0x475a6e,null))['then'](function(_0x2a133b){if(_0x2a133b){return _0x2a133b[_0x6f46('0x76')](_0x3725c7['query'][_0x6f46('0x77')]);}})[_0x6f46('0x42')](respondWithStatusCode(_0x475a6e,null))[_0x6f46('0x68')](handleError(_0x475a6e,null));};exports[_0x6f46('0x70')]=function(_0x4f7e17,_0xe72239){var _0x14c80f={'name':_0x4f7e17[_0x6f46('0x6c')][_0x6f46('0x45')],'key':_0x4f7e17[_0x6f46('0x6c')][_0x6f46('0x51')],'email':_0x4f7e17['body'][_0x6f46('0x78')],'ListId':_0x4f7e17['body']['ListId'],'active':!_[_0x6f46('0x79')](_0x4f7e17[_0x6f46('0x6c')][_0x6f46('0x7a')])?_0x4f7e17[_0x6f46('0x6c')][_0x6f46('0x7a')]:!![],'description':_0x4f7e17[_0x6f46('0x6c')][_0x6f46('0x7b')]||null,'Imap':{},'Smtp':{}};if(_[_0x6f46('0x79')](_0x4f7e17[_0x6f46('0x6c')][_0x6f46('0x7c')])){if(_0x4f7e17[_0x6f46('0x6c')][_0x6f46('0x7d')]){_0x14c80f[_0x6f46('0x49')][_0x6f46('0x7e')]=_0x14c80f[_0x6f46('0x4b')][_0x6f46('0x7e')]=_0x4f7e17[_0x6f46('0x6c')]['cuser'];_0x14c80f[_0x6f46('0x49')][_0x6f46('0x7f')]=_0x14c80f[_0x6f46('0x4b')]['pass']=_0x4f7e17['body'][_0x6f46('0x80')];}else{_0x14c80f[_0x6f46('0x49')]['authentication']=_0x14c80f['Smtp'][_0x6f46('0x81')]=![];}_0x14c80f[_0x6f46('0x49')][_0x6f46('0x82')]=_0x4f7e17[_0x6f46('0x6c')][_0x6f46('0x49')][_0x6f46('0x82')];_0x14c80f['Imap'][_0x6f46('0x83')]=_0x4f7e17['body'][_0x6f46('0x49')]['port'];_0x14c80f[_0x6f46('0x4b')][_0x6f46('0x82')]=_0x4f7e17[_0x6f46('0x6c')][_0x6f46('0x4b')][_0x6f46('0x82')];_0x14c80f[_0x6f46('0x4b')]['port']=_0x4f7e17[_0x6f46('0x6c')][_0x6f46('0x4b')][_0x6f46('0x83')];}else{_0x14c80f[_0x6f46('0x49')][_0x6f46('0x84')]=_0x14c80f['Smtp'][_0x6f46('0x84')]=_0x4f7e17[_0x6f46('0x6c')][_0x6f46('0x7c')];_0x14c80f['Imap'][_0x6f46('0x7e')]=_0x14c80f[_0x6f46('0x4b')]['user']=_0x4f7e17[_0x6f46('0x6c')]['cuser'];_0x14c80f['Imap'][_0x6f46('0x7f')]=_0x14c80f[_0x6f46('0x4b')][_0x6f46('0x85')]=_0x4f7e17[_0x6f46('0x6c')][_0x6f46('0x80')];}return db[_0x6f46('0x4f')]['create'](_0x14c80f,{'include':[{'model':db['MailServerOut'],'as':_0x6f46('0x4b')},{'model':db[_0x6f46('0x48')],'as':_0x6f46('0x49')}]})[_0x6f46('0x42')](function(_0x1298cc){var _0x2e1374=_0x4f7e17['user'][_0x6f46('0x43')]({'plain':!![]});if(!_0x2e1374)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2e1374['role']===_0x6f46('0x7e')){var _0xfe55b6=_0x1298cc[_0x6f46('0x43')]({'plain':!![]});return db['UserProfileSection'][_0x6f46('0x6b')]({'where':{'name':_0x6f46('0x44'),'userProfileId':_0x2e1374[_0x6f46('0x86')]},'raw':!![]})[_0x6f46('0x42')](function(_0x4836bb){if(_0x4836bb&&_0x4836bb[_0x6f46('0x87')]===0x0){return db[_0x6f46('0x88')][_0x6f46('0x70')]({'name':_0xfe55b6[_0x6f46('0x45')],'resourceId':_0xfe55b6['id'],'type':_0x4836bb[_0x6f46('0x45')],'sectionId':_0x4836bb['id']},{})[_0x6f46('0x42')](function(){return _0x1298cc;});}else{return _0x1298cc;}})[_0x6f46('0x68')](function(_0x24e2c1){logger[_0x6f46('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x24e2c1);throw _0x24e2c1;});}return _0x1298cc;})['then'](respondWithResult(_0xe72239,0xc9))['catch'](handleError(_0xe72239,null));};exports[_0x6f46('0x89')]=function(_0x2440c8,_0x3fc07a,_0x1ac9e0){return db[_0x6f46('0x4f')][_0x6f46('0x71')]({'where':{'id':_0x2440c8['params']['id']}})[_0x6f46('0x42')](handleEntityNotFound(_0x3fc07a,null))['then'](function(_0x4b3090){if(_0x4b3090){return _0x4b3090['getImap']();}return null;})[_0x6f46('0x42')](respondWithResult(_0x3fc07a,null))[_0x6f46('0x68')](handleError(_0x3fc07a,null));};exports[_0x6f46('0x8a')]=function(_0x4afd62,_0x9765bf,_0xc46af1){if(_0x4afd62[_0x6f46('0x6c')]['id']){delete _0x4afd62[_0x6f46('0x6c')]['id'];}return db['MailAccount'][_0x6f46('0x6b')]({'where':{'id':_0x4afd62[_0x6f46('0x69')]['id']}})['then'](handleEntityNotFound(_0x9765bf,null))[_0x6f46('0x42')](function(_0x214e33){if(_0x214e33){_0x4afd62[_0x6f46('0x6c')][_0x6f46('0x72')]=_0x214e33['id'];return db[_0x6f46('0x48')][_0x6f46('0x70')](_0x4afd62['body']);}})[_0x6f46('0x42')](respondWithResult(_0x9765bf,null))['catch'](handleError(_0x9765bf,null));};exports[_0x6f46('0x8b')]=function(_0x5ef072,_0x1aaa9b,_0x235893){return db[_0x6f46('0x4f')][_0x6f46('0x71')]({'where':{'id':_0x5ef072[_0x6f46('0x69')]['id']}})['then'](handleEntityNotFound(_0x1aaa9b,null))[_0x6f46('0x42')](function(_0x5b3bbd){if(_0x5b3bbd){return _0x5b3bbd[_0x6f46('0x8c')](null);}return null;})[_0x6f46('0x42')](respondWithStatusCode(_0x1aaa9b,null))['catch'](handleError(_0x1aaa9b,null));};exports[_0x6f46('0x8d')]=function(_0x51de50,_0x5544f5,_0x177925){return db['MailAccount'][_0x6f46('0x71')]({'where':{'id':_0x51de50[_0x6f46('0x69')]['id']}})[_0x6f46('0x42')](handleEntityNotFound(_0x5544f5,null))[_0x6f46('0x42')](function(_0x2c660d){if(_0x2c660d){return _0x2c660d[_0x6f46('0x8d')]();}return null;})[_0x6f46('0x42')](respondWithResult(_0x5544f5,null))[_0x6f46('0x68')](handleError(_0x5544f5,null));};exports[_0x6f46('0x8e')]=function(_0x17ff18,_0x39789a,_0xb97b8b){if(_0x17ff18['body']['id']){delete _0x17ff18['body']['id'];}return db[_0x6f46('0x4f')][_0x6f46('0x6b')]({'where':{'id':_0x17ff18[_0x6f46('0x69')]['id']}})[_0x6f46('0x42')](handleEntityNotFound(_0x39789a,null))[_0x6f46('0x42')](function(_0x23c971){if(_0x23c971){_0x17ff18['body'][_0x6f46('0x72')]=_0x23c971['id'];return db['MailServerOut'][_0x6f46('0x70')](_0x17ff18['body']);}})[_0x6f46('0x42')](respondWithResult(_0x39789a,null))['catch'](handleError(_0x39789a,null));};exports['removeSmtp']=function(_0x75b7e6,_0x46762f,_0x20dcec){return db[_0x6f46('0x4f')][_0x6f46('0x71')]({'where':{'id':_0x75b7e6[_0x6f46('0x69')]['id']}})[_0x6f46('0x42')](handleEntityNotFound(_0x46762f,null))[_0x6f46('0x42')](function(_0x5ddc21){if(_0x5ddc21){return _0x5ddc21['setSmtp'](null);}return null;})['then'](respondWithStatusCode(_0x46762f,null))[_0x6f46('0x68')](handleError(_0x46762f,null));};exports[_0x6f46('0x8f')]=function(_0x32aa18,_0x43e614,_0x361930){return db[_0x6f46('0x90')]['find']({'where':{'id':_0x32aa18[_0x6f46('0x69')]['id']}})[_0x6f46('0x42')](handleEntityNotFound(_0x43e614,null))[_0x6f46('0x42')](function(_0x372af7){if(_0x372af7){return _0x372af7[_0x6f46('0x8f')](_0x32aa18[_0x6f46('0x6c')]['ids'],_[_0x6f46('0x91')](_0x32aa18['body'],[_0x6f46('0x77'),'id'])||{});}})['then'](respondWithResult(_0x43e614,null))[_0x6f46('0x68')](handleError(_0x43e614,null));};exports['getInteractions']=function(_0x43cc5f,_0x2f5a6a,_0x145663){var _0x23ad7b={'raw':![],'where':{}};var _0x545224={};var _0x147b32={'count':0x0,'rows':[]};return db[_0x6f46('0x4f')][_0x6f46('0x71')]({'where':{'id':_0x43cc5f[_0x6f46('0x69')]['id']}})[_0x6f46('0x42')](handleEntityNotFound(_0x2f5a6a,null))[_0x6f46('0x42')](function(_0x3738b4){if(_0x3738b4){_0x545224['model']=_[_0x6f46('0x54')](db[_0x6f46('0x90')][_0x6f46('0x6a')]);_0x545224['query']=_[_0x6f46('0x54')](_0x43cc5f[_0x6f46('0x53')]);_0x545224[_0x6f46('0x55')]=_[_0x6f46('0x56')](_0x545224[_0x6f46('0x52')],_0x545224['query']);_0x23ad7b['attributes']=_[_0x6f46('0x56')](_0x545224[_0x6f46('0x52')],qs[_0x6f46('0x58')](_0x43cc5f[_0x6f46('0x53')]['fields']));_0x23ad7b['attributes']=_0x23ad7b[_0x6f46('0x57')][_0x6f46('0x59')]?_0x23ad7b[_0x6f46('0x57')]:_0x545224['model'];if(!_0x43cc5f[_0x6f46('0x53')][_0x6f46('0x5a')](_0x6f46('0x5b'))){_0x23ad7b[_0x6f46('0x38')]=qs[_0x6f46('0x38')](_0x43cc5f[_0x6f46('0x53')][_0x6f46('0x38')]);_0x23ad7b[_0x6f46('0x36')]=qs[_0x6f46('0x36')](_0x43cc5f[_0x6f46('0x53')][_0x6f46('0x36')]);}_0x23ad7b['order']=qs[_0x6f46('0x5d')](_0x43cc5f['query'][_0x6f46('0x5d')]);_0x23ad7b['where']=qs[_0x6f46('0x55')](_[_0x6f46('0x5e')](_0x43cc5f[_0x6f46('0x53')],_0x545224['filters']));_0x23ad7b[_0x6f46('0x60')][_0x6f46('0x72')]=_0x3738b4['id'];if(_0x43cc5f[_0x6f46('0x53')][_0x6f46('0x5f')]){_0x23ad7b[_0x6f46('0x60')]=_[_0x6f46('0x62')](_0x23ad7b[_0x6f46('0x60')],{'$or':_[_0x6f46('0x4e')](_0x23ad7b['attributes'],function(_0x205afc){var _0x1befe6={};_0x1befe6[_0x205afc]={'$like':'%'+_0x43cc5f[_0x6f46('0x53')][_0x6f46('0x5f')]+'%'};return _0x1befe6;})});}_0x23ad7b=_[_0x6f46('0x62')]({},_0x23ad7b,_0x43cc5f[_0x6f46('0x63')]);return db[_0x6f46('0x90')]['count']({'where':_0x23ad7b[_0x6f46('0x60')]})[_0x6f46('0x42')](function(_0x17fa46){_0x147b32[_0x6f46('0x39')]=_0x17fa46;if(_0x43cc5f[_0x6f46('0x53')][_0x6f46('0x64')]){_0x23ad7b[_0x6f46('0x65')]=[{'model':db[_0x6f46('0x92')],'as':'Contact','required':![]},{'model':db['User'],'as':_0x6f46('0x93'),'attributes':[_0x6f46('0x45'),_0x6f46('0x94'),_0x6f46('0x95')],'required':![]},{'model':db['Tag'],'as':_0x6f46('0x96'),'attributes':['id',_0x6f46('0x45'),_0x6f46('0x97')],'where':_0x43cc5f[_0x6f46('0x53')]['tag']?{'id':_0x43cc5f['query'][_0x6f46('0x98')]}:undefined,'required':_0x43cc5f['query'][_0x6f46('0x98')]?!![]:![]}];}return db['MailInteraction']['findAll'](_0x23ad7b);})[_0x6f46('0x42')](function(_0x278ed7){_0x147b32[_0x6f46('0x67')]=_0x278ed7;return _0x147b32;});}})[_0x6f46('0x42')](respondWithFilteredResult(_0x2f5a6a,_0x23ad7b))['catch'](handleError(_0x2f5a6a,null));};exports['addApplications']=function(_0x3aa454,_0x4574e7,_0x5d981b){return db[_0x6f46('0x4f')][_0x6f46('0x71')]({'where':{'id':_0x3aa454['params']['id']}})[_0x6f46('0x42')](handleEntityNotFound(_0x4574e7,null))[_0x6f46('0x42')](function(_0x188225){if(_0x188225){return db['sequelize'][_0x6f46('0x99')](function(_0x18665e){return db['MailApplication'][_0x6f46('0x41')]({'where':{'MailAccountId':_0x3aa454[_0x6f46('0x69')]['id']},'transaction':_0x18665e})[_0x6f46('0x42')](function(_0x38c4ae){var _0x25f255=_[_0x6f46('0x4e')](_0x3aa454[_0x6f46('0x6c')],function(_0x360523){_0x360523[_0x6f46('0x72')]=_0x3aa454[_0x6f46('0x69')]['id'];return _0x360523;});return db[_0x6f46('0x9a')][_0x6f46('0x9b')](_0x25f255,{'transaction':_0x18665e});});})[_0x6f46('0x42')](function(){return db[_0x6f46('0x9a')]['findAndCountAll']({'where':{'MailAccountId':_0x3aa454[_0x6f46('0x69')]['id']},'order':_0x6f46('0x9c')});});}})[_0x6f46('0x42')](respondWithResult(_0x4574e7,null))[_0x6f46('0x68')](handleError(_0x4574e7,null));};exports[_0x6f46('0x9d')]=function(_0x4a0025,_0x271e9e,_0x12c265){var _0x541bfb={};var _0x2769e4={};var _0x4bfb65;var _0x324b24;return db[_0x6f46('0x4f')][_0x6f46('0x71')]({'where':{'id':_0x4a0025[_0x6f46('0x69')]['id']}})[_0x6f46('0x42')](handleEntityNotFound(_0x271e9e,null))[_0x6f46('0x42')](function(_0x916ef){if(_0x916ef){_0x4bfb65=_0x916ef;_0x2769e4[_0x6f46('0x52')]=_[_0x6f46('0x54')](db['MailApplication'][_0x6f46('0x6a')]);_0x2769e4[_0x6f46('0x53')]=_[_0x6f46('0x54')](_0x4a0025[_0x6f46('0x53')]);_0x2769e4[_0x6f46('0x55')]=_[_0x6f46('0x56')](_0x2769e4[_0x6f46('0x52')],_0x2769e4[_0x6f46('0x53')]);_0x541bfb[_0x6f46('0x57')]=_[_0x6f46('0x56')](_0x2769e4[_0x6f46('0x52')],qs[_0x6f46('0x58')](_0x4a0025['query']['fields']));_0x541bfb[_0x6f46('0x57')]=_0x541bfb[_0x6f46('0x57')]['length']?_0x541bfb[_0x6f46('0x57')]:_0x2769e4[_0x6f46('0x52')];_0x541bfb['order']=qs['sort'](_0x4a0025[_0x6f46('0x53')][_0x6f46('0x5d')]);_0x541bfb[_0x6f46('0x60')]=qs['filters'](_[_0x6f46('0x5e')](_0x4a0025[_0x6f46('0x53')],_0x2769e4[_0x6f46('0x55')]));if(_0x4a0025['query']['filter']){_0x541bfb[_0x6f46('0x60')]=_[_0x6f46('0x62')](_0x541bfb[_0x6f46('0x60')],{'$or':_[_0x6f46('0x4e')](_0x541bfb[_0x6f46('0x57')],function(_0x4d1128){var _0x36780d={};_0x36780d[_0x4d1128]={'$like':'%'+_0x4a0025[_0x6f46('0x53')]['filter']+'%'};return _0x36780d;})});}_0x541bfb=_['merge']({},_0x541bfb,_0x4a0025[_0x6f46('0x63')]);return _0x4bfb65[_0x6f46('0x9d')](_0x541bfb);}})[_0x6f46('0x42')](function(_0x1ace39){if(_0x1ace39){_0x324b24=_0x1ace39['length'];if(!_0x4a0025[_0x6f46('0x53')][_0x6f46('0x5a')](_0x6f46('0x5b'))){_0x541bfb[_0x6f46('0x38')]=qs[_0x6f46('0x38')](_0x4a0025[_0x6f46('0x53')]['limit']);_0x541bfb[_0x6f46('0x36')]=qs[_0x6f46('0x36')](_0x4a0025[_0x6f46('0x53')]['offset']);}return _0x4bfb65[_0x6f46('0x9d')](_0x541bfb);}})['then'](function(_0x285daa){if(_0x285daa){return _0x285daa?{'count':_0x324b24,'rows':_0x285daa}:null;}})[_0x6f46('0x42')](respondWithResult(_0x271e9e,null))['catch'](handleError(_0x271e9e,null));};exports[_0x6f46('0x9e')]=function(_0x524588,_0x1494d3,_0x29ba95){var _0x1bdb8c={'raw':!![],'where':{}};var _0x385220={};var _0x137d0c={'count':0x0,'rows':[]};return db[_0x6f46('0x4f')][_0x6f46('0x71')]({'where':{'id':_0x524588['params']['id']}})[_0x6f46('0x42')](handleEntityNotFound(_0x1494d3,null))[_0x6f46('0x42')](function(_0x12aa0e){if(_0x12aa0e){_0x385220['model']=_[_0x6f46('0x54')](db[_0x6f46('0x9f')]['rawAttributes']);_0x385220[_0x6f46('0x53')]=_[_0x6f46('0x54')](_0x524588['query']);_0x385220['filters']=_[_0x6f46('0x56')](_0x385220[_0x6f46('0x52')],_0x385220[_0x6f46('0x53')]);_0x1bdb8c[_0x6f46('0x57')]=_[_0x6f46('0x56')](_0x385220[_0x6f46('0x52')],qs[_0x6f46('0x58')](_0x524588['query'][_0x6f46('0x58')]));_0x1bdb8c[_0x6f46('0x57')]=_0x1bdb8c[_0x6f46('0x57')][_0x6f46('0x59')]?_0x1bdb8c[_0x6f46('0x57')]:_0x385220[_0x6f46('0x52')];if(!_0x524588[_0x6f46('0x53')][_0x6f46('0x5a')](_0x6f46('0x5b'))){_0x1bdb8c['limit']=qs[_0x6f46('0x38')](_0x524588[_0x6f46('0x53')]['limit']);_0x1bdb8c[_0x6f46('0x36')]=qs[_0x6f46('0x36')](_0x524588[_0x6f46('0x53')]['offset']);}_0x1bdb8c['order']=qs[_0x6f46('0x5d')](_0x524588[_0x6f46('0x53')][_0x6f46('0x5d')]);_0x1bdb8c[_0x6f46('0x60')]=qs[_0x6f46('0x55')](_[_0x6f46('0x5e')](_0x524588[_0x6f46('0x53')],_0x385220[_0x6f46('0x55')]));_0x1bdb8c['where'][_0x6f46('0x72')]=_0x12aa0e['id'];if(_0x524588[_0x6f46('0x53')][_0x6f46('0x5f')]){_0x1bdb8c['where']=_[_0x6f46('0x62')](_0x1bdb8c[_0x6f46('0x60')],{'$or':_[_0x6f46('0x4e')](_0x1bdb8c['attributes'],function(_0x42f116){var _0xf44ae2={};_0xf44ae2[_0x42f116]={'$like':'%'+_0x524588[_0x6f46('0x53')]['filter']+'%'};return _0xf44ae2;})});}if(_0x524588[_0x6f46('0x53')][_0x6f46('0xa0')]){var _0x79b2cd=_0x524588['query'][_0x6f46('0xa0')][_0x6f46('0xa1')](',');var _0x5c18e3={};_0x5c18e3[_0x79b2cd[0x0]]={'$gte':moment(_0x79b2cd[0x1])[_0x6f46('0xa2')](_0x6f46('0xa3'))};_0x1bdb8c[_0x6f46('0x60')]=_['merge'](_0x1bdb8c['where'],_0x5c18e3);}_0x1bdb8c=_['merge']({},_0x1bdb8c,_0x524588[_0x6f46('0x63')]);return db[_0x6f46('0x9f')][_0x6f46('0x39')]({'where':_0x1bdb8c[_0x6f46('0x60')]})[_0x6f46('0x42')](function(_0x55a0c9){_0x137d0c['count']=_0x55a0c9;if(_0x524588[_0x6f46('0x53')][_0x6f46('0x64')]){_0x1bdb8c['include']=[{'all':!![]}];}return db[_0x6f46('0x9f')][_0x6f46('0x66')](_0x1bdb8c);})[_0x6f46('0x42')](function(_0x3197d5){if(_0x524588[_0x6f46('0x53')][_0x6f46('0xa4')]===_0x6f46('0xa5')){for(var _0x2f7315=0x0;_0x2f7315<_0x3197d5[_0x6f46('0x59')];_0x2f7315++){_0x3197d5[_0x2f7315][_0x6f46('0x6c')]=juice(_0x3197d5[_0x2f7315][_0x6f46('0x6c')]);}}_0x137d0c[_0x6f46('0x67')]=_0x3197d5;return _0x137d0c;});}})['then'](respondWithFilteredResult(_0x1494d3,_0x1bdb8c))[_0x6f46('0x68')](handleError(_0x1494d3,null));};exports['send']=function(_0x9f7623,_0x1e5381,_0xd1929b){var _0x29f43e,_0x29c9a8={},_0x211e34;if(_0x9f7623['body']['to']){_0x211e34=_0x9f7623['body']['to'][_0x6f46('0xa1')](',')[0x0];}return db[_0x6f46('0x4f')][_0x6f46('0x6b')]({'where':{'id':_0x9f7623[_0x6f46('0x69')]['id']},'include':[{'model':db[_0x6f46('0xa6')],'as':_0x6f46('0xa7'),'include':[{'model':db['CmContact'],'as':_0x6f46('0xa8'),'where':{'email':_0x211e34},'limit':0x1,'order':[[_0x6f46('0xa9'),_0x6f46('0xaa')]]}]},{'model':db[_0x6f46('0x4a')],'as':_0x6f46('0x4b'),'raw':!![]}]})[_0x6f46('0x42')](handleEntityNotFound(_0x1e5381,null))[_0x6f46('0x42')](function(_0x4a697a){if(_0x4a697a){_0x29f43e=_0x4a697a;if(_0x4a697a['Smtp']){if(_['isNil'](_0x9f7623['body'][_0x6f46('0xab')])){_0x9f7623['body'][_0x6f46('0xab')]=util[_0x6f46('0xa2')](_0x6f46('0xac'),_0x4a697a[_0x6f46('0x45')],_0x4a697a[_0x6f46('0x78')]||_0x4a697a[_0x6f46('0x4b')][_0x6f46('0x7e')]);}if(_0x9f7623[_0x6f46('0x6c')]['attachments']&&_0x9f7623[_0x6f46('0x6c')][_0x6f46('0xad')]['length']){for(var _0xd03f31=0x0;_0xd03f31<_0x9f7623[_0x6f46('0x6c')][_0x6f46('0xad')][_0x6f46('0x59')];_0xd03f31+=0x1){_0x9f7623['body'][_0x6f46('0xad')][_0xd03f31]={'filename':_0x9f7623[_0x6f46('0x6c')][_0x6f46('0xad')][_0xd03f31][_0x6f46('0x45')],'path':path[_0x6f46('0xae')](config[_0x6f46('0xaf')],_0x6f46('0xb0'),_0x9f7623['body'][_0x6f46('0xad')][_0xd03f31]['basename'])};}}var _0x354e43={'tls':{'rejectUnauthorized':![]}};if(_[_0x6f46('0x79')](_0x4a697a['Smtp'][_0x6f46('0x84')])){if(_0x4a697a['Smtp']['authentication']){_0x354e43[_0x6f46('0xb1')]={'user':_0x4a697a[_0x6f46('0x4b')][_0x6f46('0x7e')],'pass':_0x4a697a[_0x6f46('0x4b')][_0x6f46('0x85')]};}_0x354e43[_0x6f46('0x82')]=_0x4a697a[_0x6f46('0x4b')][_0x6f46('0x82')];_0x354e43[_0x6f46('0x83')]=_0x4a697a['Smtp'][_0x6f46('0x83')];_0x354e43[_0x6f46('0xb2')]=_0x4a697a['Smtp']['secure'];}else{_0x354e43[_0x6f46('0x84')]=_0x4a697a[_0x6f46('0x4b')]['service'];_0x354e43['auth']={'user':_0x4a697a[_0x6f46('0x4b')][_0x6f46('0x7e')],'pass':_0x4a697a[_0x6f46('0x4b')][_0x6f46('0x85')]};}return respondWithRpcPromise(_0x6f46('0xb3'),_0x6f46('0xb4'),{'account':_0x354e43,'message':_0x9f7623[_0x6f46('0x6c')]});}else{throw new Error('List\x20not\x20found');}}})[_0x6f46('0x42')](function(_0x4013cb){if(_0x4013cb){_0x29c9a8=_0x4013cb;if(_0x29f43e['List']){if(_0x29f43e[_0x6f46('0xa7')][_0x6f46('0xa8')][_0x6f46('0x59')]){return _0x29f43e['List'][_0x6f46('0xa8')][0x0];}else{return db[_0x6f46('0x92')][_0x6f46('0x70')](_[_0x6f46('0x20')](_0x9f7623['body'],{'firstName':_0x9f7623['body']['to'],'email':_0x9f7623[_0x6f46('0x6c')]['to'],'phone':_0x9f7623[_0x6f46('0x6c')]['to'],'ListId':_0x29f43e[_0x6f46('0xb5')]}));}}else{throw new Error(_0x6f46('0xb6'));}}})[_0x6f46('0x42')](function(_0x21c4bb){if(_0x21c4bb){var _0xba694c={'UserId':_0x9f7623[_0x6f46('0x7e')]['id'],'ContactId':_0x21c4bb['id'],'MailAccountId':_0x29f43e['id'],'inReplyTo':_0x29c9a8[_0x6f46('0xb7')],'to':_0x9f7623[_0x6f46('0x6c')][_0x6f46('0xab')],'cc':_0x9f7623[_0x6f46('0x6c')]['cc'],'subject':_0x9f7623['body'][_0x6f46('0xb8')],'attach':_0x9f7623[_0x6f46('0x6c')]['attach'],'firstMsgDirection':_0x6f46('0xb9'),'lastMsgAt':moment()['format'](_0x6f46('0xa3')),'lastMsgDirection':_0x6f46('0xb9'),'Messages':[_[_0x6f46('0x62')](_0x9f7623[_0x6f46('0x6c')],{'messageId':_0x29c9a8[_0x6f46('0xb7')],'sentAt':moment()['format'](_0x6f46('0xa3')),'read':!![],'MailAccountId':_0x29f43e['id'],'UserId':_0x9f7623[_0x6f46('0x7e')]['id'],'ContactId':_0x21c4bb['id']})]};if(_0x9f7623[_0x6f46('0x6c')]['Interaction']){_0xba694c=_[_0x6f46('0x62')](_0xba694c,_0x9f7623[_0x6f46('0x6c')][_0x6f46('0xba')]);}return db['MailInteraction']['create'](_0xba694c,{'include':[{'model':db[_0x6f46('0x9f')],'as':_0x6f46('0xbb')}]});}})[_0x6f46('0x42')](respondWithResult(_0x1e5381,null))[_0x6f46('0x68')](handleError(_0x1e5381,null));};exports[_0x6f46('0xbc')]=function(_0x871852,_0x4d5a90,_0x540007){return db[_0x6f46('0x4f')][_0x6f46('0x6b')]({'where':{'id':_0x871852[_0x6f46('0x69')]['id']},'include':[{'model':db[_0x6f46('0x4a')],'as':_0x6f46('0x4b'),'raw':!![]}]})[_0x6f46('0x42')](handleEntityNotFound(_0x4d5a90,null))[_0x6f46('0x42')](function(_0x2aec64){if(_0x2aec64&&_0x2aec64[_0x6f46('0x4b')]){var _0x27a265={'id':_0x2aec64['id'],'tls':{'rejectUnauthorized':![]}};if(_0x2aec64['Smtp']['service']){_0x27a265['service']=_0x2aec64[_0x6f46('0x4b')][_0x6f46('0x84')];}else{_0x27a265[_0x6f46('0x82')]=_0x2aec64[_0x6f46('0x4b')][_0x6f46('0x82')];_0x27a265[_0x6f46('0x83')]=_0x2aec64[_0x6f46('0x4b')][_0x6f46('0x83')];_0x27a265[_0x6f46('0xb2')]=_0x2aec64['Smtp']['secure'];}if(_0x2aec64[_0x6f46('0x4b')][_0x6f46('0x81')]){_0x27a265['auth']={'user':_0x2aec64[_0x6f46('0x4b')][_0x6f46('0x7e')],'pass':_0x2aec64['Smtp'][_0x6f46('0x85')]};}return respondWithRpcPromise(_0x6f46('0xbd'),_0x6f46('0xbc'),{'account':_0x27a265});}})['then'](respondWithResult(_0x4d5a90,null))[_0x6f46('0x68')](handleError(_0x4d5a90,null));};exports[_0x6f46('0x41')]=function(_0x4cf89d,_0x524100){return db['MailAccount'][_0x6f46('0x6b')]({'where':{'id':_0x4cf89d['params']['id']}})[_0x6f46('0x42')](handleEntityNotFound(_0x524100,null))[_0x6f46('0x42')](function(_0x4f975f){if(_0x4f975f&&_0x4f975f['service']){throw new db['Sequelize'][(_0x6f46('0xbe'))](_0x6f46('0xbf'));}return _0x4f975f;})[_0x6f46('0x42')](removeEntity(_0x524100,null))['catch'](handleError(_0x524100,null));};exports[_0x6f46('0xc0')]=function(_0x39b4d3,_0x17a1d6,_0x537389){return db[_0x6f46('0x4f')]['find']({'where':{'id':_0x39b4d3[_0x6f46('0x69')]['id']}})[_0x6f46('0x42')](handleEntityNotFound(_0x17a1d6,null))['then'](function(_0x3ba1f9){if(_0x3ba1f9){return _0x3ba1f9[_0x6f46('0xc0')](_0x39b4d3[_0x6f46('0x6c')][_0x6f46('0x77')],_[_0x6f46('0x91')](_0x39b4d3[_0x6f46('0x6c')],[_0x6f46('0x77'),'id'])||{})[_0x6f46('0xc1')](function(_0xefc02f){for(var _0x576ee5=0x0;_0x576ee5<_0x39b4d3['body'][_0x6f46('0x77')][_0x6f46('0x59')];_0x576ee5+=0x1){socket[_0x6f46('0xc2')](_0x6f46('0xc3'),{'UserId':Number(_0x39b4d3[_0x6f46('0x6c')][_0x6f46('0x77')][_0x576ee5]),'MailAccountId':Number(_0x39b4d3[_0x6f46('0x69')]['id'])});}return _0xefc02f;});}})[_0x6f46('0x42')](respondWithResult(_0x17a1d6,null))['catch'](handleError(_0x17a1d6,null));};exports[_0x6f46('0xc4')]=function(_0x202dc9,_0x46a6bd,_0x176ef6){return db[_0x6f46('0x4f')][_0x6f46('0x6b')]({'where':{'id':_0x202dc9[_0x6f46('0x69')]['id']}})[_0x6f46('0x42')](handleEntityNotFound(_0x46a6bd,null))[_0x6f46('0x42')](function(_0x276ebd){if(_0x276ebd){return _0x276ebd[_0x6f46('0xc4')](_0x202dc9[_0x6f46('0x53')][_0x6f46('0x77')])['then'](function(){if(_[_0x6f46('0xc5')](_0x202dc9[_0x6f46('0x53')]['ids'])){for(var _0x44f6d8=0x0;_0x44f6d8<_0x202dc9[_0x6f46('0x53')][_0x6f46('0x77')]['length'];_0x44f6d8+=0x1){socket[_0x6f46('0xc2')](_0x6f46('0xc6'),{'UserId':Number(_0x202dc9[_0x6f46('0x53')]['ids'][_0x44f6d8]),'MailAccountId':Number(_0x202dc9['params']['id'])});}}else{socket[_0x6f46('0xc2')]('userMailAccount:remove',{'UserId':Number(_0x202dc9[_0x6f46('0x53')][_0x6f46('0x77')]),'MailAccountId':Number(_0x202dc9[_0x6f46('0x69')]['id'])});}});}})['then'](respondWithStatusCode(_0x46a6bd,null))[_0x6f46('0x68')](handleError(_0x46a6bd,null));};exports['getAgents']=function(_0x101f01,_0xf7190b,_0x3e2f94){var _0x42b71f={};var _0x10f9bb={};var _0x194dba;var _0x36ed69;return db[_0x6f46('0x4f')][_0x6f46('0x71')]({'where':{'id':_0x101f01[_0x6f46('0x69')]['id']}})[_0x6f46('0x42')](handleEntityNotFound(_0xf7190b,null))[_0x6f46('0x42')](function(_0x5c4ffe){if(_0x5c4ffe){_0x194dba=_0x5c4ffe;_0x10f9bb[_0x6f46('0x52')]=_[_0x6f46('0x54')](db[_0x6f46('0xc7')]['rawAttributes']);_0x10f9bb['query']=_[_0x6f46('0x54')](_0x101f01[_0x6f46('0x53')]);_0x10f9bb[_0x6f46('0x55')]=_[_0x6f46('0x56')](_0x10f9bb[_0x6f46('0x52')],_0x10f9bb[_0x6f46('0x53')]);_0x42b71f['attributes']=_[_0x6f46('0x56')](_0x10f9bb[_0x6f46('0x52')],qs[_0x6f46('0x58')](_0x101f01[_0x6f46('0x53')]['fields']));_0x42b71f[_0x6f46('0x57')]=_0x42b71f[_0x6f46('0x57')][_0x6f46('0x59')]?_0x42b71f['attributes']:_0x10f9bb['model'];_0x42b71f['order']=qs[_0x6f46('0x5d')](_0x101f01[_0x6f46('0x53')][_0x6f46('0x5d')]);_0x42b71f['where']=qs[_0x6f46('0x55')](_[_0x6f46('0x5e')](_0x101f01[_0x6f46('0x53')],_0x10f9bb['filters']));if(_0x101f01['query']['filter']){_0x42b71f[_0x6f46('0x60')]=_['merge'](_0x42b71f['where'],{'$or':_[_0x6f46('0x4e')](_0x42b71f[_0x6f46('0x57')],function(_0x432e99){var _0x492666={};_0x492666[_0x432e99]={'$like':'%'+_0x101f01[_0x6f46('0x53')][_0x6f46('0x5f')]+'%'};return _0x492666;})});}_0x42b71f=_[_0x6f46('0x62')]({},_0x42b71f,_0x101f01[_0x6f46('0x63')]);return _0x194dba['getAgents'](_0x42b71f);}})[_0x6f46('0x42')](function(_0x358cf2){if(_0x358cf2){_0x36ed69=_0x358cf2[_0x6f46('0x59')];if(!_0x101f01[_0x6f46('0x53')]['hasOwnProperty'](_0x6f46('0x5b'))){_0x42b71f[_0x6f46('0x38')]=qs[_0x6f46('0x38')](_0x101f01[_0x6f46('0x53')]['limit']);_0x42b71f[_0x6f46('0x36')]=qs['offset'](_0x101f01[_0x6f46('0x53')][_0x6f46('0x36')]);}return _0x194dba[_0x6f46('0xc8')](_0x42b71f);}})[_0x6f46('0x42')](function(_0x1ea6d3){if(_0x1ea6d3){return _0x1ea6d3?{'count':_0x36ed69,'rows':_0x1ea6d3}:null;}})[_0x6f46('0x42')](respondWithResult(_0xf7190b,null))[_0x6f46('0x68')](handleError(_0xf7190b,null));}; \ No newline at end of file +var _0x5833=['User','internal','Tag','Tags','tag','sequelize','transaction','MailApplication','findAndCountAll','priority','getApplications','getMessages','MailMessage','$gte','split','format','true','CmList','List','DESC','from','%s\x20<%s>','attachments','root','server/files/attachments','basename','auth','secure','SendMail','sendMail','Contacts','messageId','attach','out','YYYY-MM-DD\x20HH:mm:ss','Interaction','Messages','verifySmtp','VerifySmtp','Sequelize','ValidationError','addAgents','omit','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','querystring','html-to-text','juice','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','http','then','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','apply','update','destroy','get','MailAccounts','UserProfileResource','stack','name','send','index','MailServerIn','Imap','MailServerOut','Smtp','MailAccount','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','show','Pause','find','body','params','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','findOne','pick','includeAll','removeDispositions','ids','getAnswers','CannedAnswer','removeAnswers','key','ListId','isNil','active','description','cservice','cauthentication','user','cuser','password','pass','cpassword','authentication','host','port','service','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','getSmtp','setSmtp','addInteraction','MailInteraction','getInteractions','CmContact','Contact'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x5833,0xee));var _0x3583=function(_0x332bea,_0x34b4ea){_0x332bea=_0x332bea-0x0;var _0x2e1fda=_0x5833[_0x332bea];return _0x2e1fda;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3583('0x0'));var zipdir=require(_0x3583('0x1'));var jsonpatch=require(_0x3583('0x2'));var rp=require(_0x3583('0x3'));var moment=require('moment');var BPromise=require(_0x3583('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3583('0x5'));var sox=require(_0x3583('0x6'));var csv=require(_0x3583('0x7'));var ejs=require(_0x3583('0x8'));var fs=require('fs');var fs_extra=require(_0x3583('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x3583('0xa'));var jsforce=require(_0x3583('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x3583('0x7'));var querystring=require(_0x3583('0xc'));var Papa=require('papaparse');var htmlToText=require(_0x3583('0xd'));var juice=require(_0x3583('0xe'));var Redis=require(_0x3583('0xf'));var authService=require(_0x3583('0x10'));var qs=require(_0x3583('0x11'));var as=require(_0x3583('0x12'));var hardwareService=require(_0x3583('0x13'));var logger=require(_0x3583('0x14'))(_0x3583('0x15'));var utils=require('../../config/utils');var config=require(_0x3583('0x16'));var licenseUtil=require(_0x3583('0x17'));var db=require('../../mysqldb')['db'];config[_0x3583('0x18')]=_[_0x3583('0x19')](config[_0x3583('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x3583('0x1a'))(new Redis(config[_0x3583('0x18')]));require(_0x3583('0x1b'))[_0x3583('0x1c')](socket);var jayson=require(_0x3583('0x1d'));var client=jayson[_0x3583('0x1e')][_0x3583('0x1f')]({'port':0x232b});function respondWithRpcPromise(_0x2bcf73,_0x10a805,_0x19d713,_0x4c8f64){return new BPromise(function(_0xff974,_0x3ac849){var _0x27d3c3=_0x4c8f64||client;return _0x27d3c3['request'](_0x2bcf73,_0x19d713)[_0x3583('0x20')](function(_0x5b2e64){logger['info'](_0x3583('0x21'),_0x10a805,_0x3583('0x22'));logger[_0x3583('0x23')](_0x3583('0x24'),_0x10a805,_0x3583('0x22'),JSON[_0x3583('0x25')](_0x5b2e64));if(_0x5b2e64[_0x3583('0x26')]){if(_0x5b2e64[_0x3583('0x26')][_0x3583('0x27')]===0x1f4){logger[_0x3583('0x26')](_0x3583('0x21'),_0x10a805,_0x5b2e64[_0x3583('0x26')][_0x3583('0x28')]);return _0x3ac849(_0x5b2e64[_0x3583('0x26')][_0x3583('0x28')]);}logger[_0x3583('0x26')](_0x3583('0x21'),_0x10a805,_0x5b2e64['error'][_0x3583('0x28')]);return _0xff974(_0x5b2e64[_0x3583('0x26')][_0x3583('0x28')]);}else{logger['info']('MailAccount,\x20%s,\x20%s',_0x10a805,_0x3583('0x22'));_0xff974(_0x5b2e64[_0x3583('0x29')][_0x3583('0x28')]);}})[_0x3583('0x2a')](function(_0x5322a6){logger['error']('MailAccount,\x20%s,\x20%s',_0x10a805,_0x5322a6);_0x3ac849(_0x5322a6);});});}function respondWithStatusCode(_0x4b8f4e,_0x574944){_0x574944=_0x574944||0xcc;return function(_0x4234b5){if(_0x4234b5){return _0x4b8f4e[_0x3583('0x2b')](_0x574944);}return _0x4b8f4e[_0x3583('0x2c')](_0x574944)[_0x3583('0x2d')]();};}function respondWithResult(_0x38d66f,_0x2f5f8a){_0x2f5f8a=_0x2f5f8a||0xc8;return function(_0x18b26b){if(_0x18b26b){return _0x38d66f['status'](_0x2f5f8a)['json'](_0x18b26b);}};}function respondWithFilteredResult(_0x5b9904,_0x5a8b95){return function(_0x857073){if(_0x857073){var _0x3e1127=typeof _0x5a8b95['offset']===_0x3583('0x2e')&&typeof _0x5a8b95[_0x3583('0x2f')]===_0x3583('0x2e');var _0x286edc=_0x857073[_0x3583('0x30')];var _0x4e5c43=_0x3e1127?0x0:_0x5a8b95[_0x3583('0x31')];var _0x3ace16=_0x3e1127?_0x857073['count']:_0x5a8b95[_0x3583('0x31')]+_0x5a8b95['limit'];var _0x192b22;if(_0x3ace16>=_0x286edc){_0x3ace16=_0x286edc;_0x192b22=0xc8;}else{_0x192b22=0xce;}_0x5b9904[_0x3583('0x2c')](_0x192b22);return _0x5b9904['set'](_0x3583('0x32'),_0x4e5c43+'-'+_0x3ace16+'/'+_0x286edc)[_0x3583('0x33')](_0x857073);}return null;};}function patchUpdates(_0x334283){return function(_0x24e682){try{jsonpatch[_0x3583('0x34')](_0x24e682,_0x334283,!![]);}catch(_0x25c1ae){return BPromise['reject'](_0x25c1ae);}return _0x24e682['save']();};}function saveUpdates(_0x465fb6,_0x3c24c8){return function(_0x15d3e7){if(_0x15d3e7){return _0x15d3e7[_0x3583('0x35')](_0x465fb6)['then'](function(_0x48d0c7){return _0x48d0c7;});}return null;};}function removeEntity(_0x32542d,_0x4d336f){return function(_0x43df5d){if(_0x43df5d){return _0x43df5d[_0x3583('0x36')]()['then'](function(){var _0x1c6e6c=_0x43df5d[_0x3583('0x37')]({'plain':!![]});var _0x550913=_0x3583('0x38');return db[_0x3583('0x39')][_0x3583('0x36')]({'where':{'type':_0x550913,'resourceId':_0x1c6e6c['id']}})[_0x3583('0x20')](function(){return _0x43df5d;});})[_0x3583('0x20')](function(){_0x32542d['status'](0xcc)[_0x3583('0x2d')]();});}};}function handleEntityNotFound(_0x52ae99,_0x1de34c){return function(_0x583ca5){if(!_0x583ca5){_0x52ae99[_0x3583('0x2b')](0x194);}return _0x583ca5;};}function handleError(_0x4f0626,_0x2de50a){_0x2de50a=_0x2de50a||0x1f4;return function(_0x346f5c){logger['error'](_0x346f5c[_0x3583('0x3a')]);if(_0x346f5c[_0x3583('0x3b')]){delete _0x346f5c[_0x3583('0x3b')];}_0x4f0626[_0x3583('0x2c')](_0x2de50a)[_0x3583('0x3c')](_0x346f5c);};}exports[_0x3583('0x3d')]=function(_0x21eead,_0x2b26ff){var _0x36e92d={'include':[{'model':db[_0x3583('0x3e')],'as':_0x3583('0x3f')},{'model':db[_0x3583('0x40')],'as':_0x3583('0x41')},{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x233496={},_0x53ae10={'count':0x0,'rows':[]};var _0x37c50f=_['map'](db[_0x3583('0x42')][_0x3583('0x43')],function(_0x5a30d7){return{'name':_0x5a30d7[_0x3583('0x44')],'type':_0x5a30d7[_0x3583('0x45')]['key']};});_0x233496[_0x3583('0x46')]=_[_0x3583('0x47')](_0x37c50f,_0x3583('0x3b'));_0x233496[_0x3583('0x48')]=_[_0x3583('0x49')](_0x21eead[_0x3583('0x48')]);_0x233496[_0x3583('0x4a')]=_[_0x3583('0x4b')](_0x233496[_0x3583('0x46')],_0x233496['query']);_0x36e92d[_0x3583('0x4c')]=_[_0x3583('0x4b')](_0x233496[_0x3583('0x46')],qs[_0x3583('0x4d')](_0x21eead[_0x3583('0x48')][_0x3583('0x4d')]));_0x36e92d[_0x3583('0x4c')]=_0x36e92d[_0x3583('0x4c')][_0x3583('0x4e')]?_0x36e92d[_0x3583('0x4c')]:_0x233496[_0x3583('0x46')];if(!_0x21eead['query'][_0x3583('0x4f')](_0x3583('0x50'))){_0x36e92d['limit']=qs[_0x3583('0x2f')](_0x21eead[_0x3583('0x48')]['limit']);_0x36e92d[_0x3583('0x31')]=qs[_0x3583('0x31')](_0x21eead['query'][_0x3583('0x31')]);}_0x36e92d[_0x3583('0x51')]=qs[_0x3583('0x52')](_0x21eead[_0x3583('0x48')][_0x3583('0x52')]);_0x36e92d[_0x3583('0x53')]=qs[_0x3583('0x4a')](_['pick'](_0x21eead[_0x3583('0x48')],_0x233496[_0x3583('0x4a')]),_0x37c50f);if(_0x21eead[_0x3583('0x48')][_0x3583('0x54')]){_0x36e92d[_0x3583('0x53')]=_[_0x3583('0x55')](_0x36e92d['where'],{'$or':_[_0x3583('0x47')](_0x37c50f,function(_0x373450){if(_0x373450[_0x3583('0x45')]!==_0x3583('0x56')){var _0x1745ee={};_0x1745ee[_0x373450[_0x3583('0x3b')]]={'$like':'%'+_0x21eead[_0x3583('0x48')]['filter']+'%'};return _0x1745ee;}})});}_0x36e92d=_[_0x3583('0x55')]({},_0x36e92d,_0x21eead[_0x3583('0x57')]);var _0x5bc4d3={'where':_0x36e92d[_0x3583('0x53')]};return db[_0x3583('0x42')][_0x3583('0x30')](_0x5bc4d3)['then'](function(_0x1bdb8d){_0x53ae10[_0x3583('0x30')]=_0x1bdb8d;if(_0x21eead[_0x3583('0x48')]['includeAll']){_0x36e92d[_0x3583('0x58')]=[{'all':!![]}];}return db['MailAccount'][_0x3583('0x59')](_0x36e92d);})[_0x3583('0x20')](function(_0x29d65a){_0x53ae10[_0x3583('0x5a')]=_0x29d65a;return _0x53ae10;})[_0x3583('0x20')](respondWithFilteredResult(_0x2b26ff,_0x36e92d))[_0x3583('0x2a')](handleError(_0x2b26ff,null));};exports[_0x3583('0x5b')]=function(_0x116a96,_0x4fa026){var _0x231efb={'raw':![],'where':{'id':_0x116a96['params']['id']},'include':[{'model':db[_0x3583('0x3e')],'as':_0x3583('0x3f')},{'model':db[_0x3583('0x40')],'as':'Smtp'},{'model':db[_0x3583('0x5c')],'as':'mandatoryDispositionPause'}]},_0x5d11cd={};_0x5d11cd['model']=_[_0x3583('0x49')](db[_0x3583('0x42')][_0x3583('0x43')]);_0x5d11cd[_0x3583('0x48')]=_[_0x3583('0x49')](_0x116a96[_0x3583('0x48')]);_0x5d11cd['filters']=_['intersection'](_0x5d11cd[_0x3583('0x46')],_0x5d11cd[_0x3583('0x48')]);_0x231efb['attributes']=_[_0x3583('0x4b')](_0x5d11cd[_0x3583('0x46')],qs[_0x3583('0x4d')](_0x116a96[_0x3583('0x48')][_0x3583('0x4d')]));_0x231efb[_0x3583('0x4c')]=_0x231efb[_0x3583('0x4c')][_0x3583('0x4e')]?_0x231efb[_0x3583('0x4c')]:_0x5d11cd['model'];if(_0x116a96[_0x3583('0x48')]['includeAll']){_0x231efb[_0x3583('0x58')]=[{'all':!![]}];}_0x231efb=_[_0x3583('0x55')]({},_0x231efb,_0x116a96[_0x3583('0x57')]);return db['MailAccount'][_0x3583('0x5d')](_0x231efb)['then'](handleEntityNotFound(_0x4fa026,null))[_0x3583('0x20')](respondWithResult(_0x4fa026,null))[_0x3583('0x2a')](handleError(_0x4fa026,null));};exports[_0x3583('0x35')]=function(_0x400b92,_0x3cfdb0){if(_0x400b92['body']['id']){delete _0x400b92[_0x3583('0x5e')]['id'];}return db[_0x3583('0x42')][_0x3583('0x5d')]({'where':{'id':_0x400b92[_0x3583('0x5f')]['id']},'include':[{'model':db[_0x3583('0x3e')],'as':'Imap'},{'model':db['MailServerOut'],'as':_0x3583('0x41')},{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x3583('0x20')](handleEntityNotFound(_0x3cfdb0,null))[_0x3583('0x20')](saveUpdates(_0x400b92['body'],null))[_0x3583('0x20')](function(_0x33eb76){if(_0x33eb76&&_0x400b92[_0x3583('0x5e')]['Imap']){return db[_0x3583('0x3e')][_0x3583('0x35')](_0x400b92['body']['Imap'],{'where':{'MailAccountId':_0x33eb76['id']}})['then'](function(){return _0x33eb76;});}return _0x33eb76;})[_0x3583('0x20')](function(_0x431128){if(_0x431128&&_0x400b92[_0x3583('0x5e')]['Smtp']){return db[_0x3583('0x40')]['update'](_0x400b92[_0x3583('0x5e')][_0x3583('0x41')],{'where':{'MailAccountId':_0x431128['id']}})['then'](function(){return _0x431128;});}return _0x431128;})[_0x3583('0x20')](respondWithResult(_0x3cfdb0,null))['catch'](handleError(_0x3cfdb0,null));};exports[_0x3583('0x60')]=function(_0x129b55,_0x130aa1){return db['MailAccount'][_0x3583('0x60')]()[_0x3583('0x20')](respondWithResult(_0x130aa1,null))[_0x3583('0x2a')](handleError(_0x130aa1,null));};exports[_0x3583('0x61')]=function(_0x12c4f5,_0x58483c,_0x333324){if(_0x12c4f5['body']['id']){delete _0x12c4f5[_0x3583('0x5e')]['id'];}return db[_0x3583('0x42')][_0x3583('0x5d')]({'where':{'id':_0x12c4f5[_0x3583('0x5f')]['id']}})[_0x3583('0x20')](handleEntityNotFound(_0x58483c,null))[_0x3583('0x20')](function(_0xeea17d){if(_0xeea17d){_0x12c4f5[_0x3583('0x5e')][_0x3583('0x62')]=_0xeea17d['id'];return db[_0x3583('0x63')][_0x3583('0x64')](_0x12c4f5['body']);}})[_0x3583('0x20')](respondWithResult(_0x58483c,null))['catch'](handleError(_0x58483c,null));};exports[_0x3583('0x65')]=function(_0x48d2cd,_0x3770dc,_0xd75d3a){var _0x1d48e9={'raw':![],'where':{}};var _0x1cc89c={};var _0x1d5f5c={'count':0x0,'rows':[]};return db['MailAccount'][_0x3583('0x66')]({'where':{'id':_0x48d2cd[_0x3583('0x5f')]['id']}})[_0x3583('0x20')](handleEntityNotFound(_0x3770dc,null))[_0x3583('0x20')](function(_0x226a78){if(_0x226a78){_0x1cc89c[_0x3583('0x46')]=_['keys'](db['Disposition']['rawAttributes']);_0x1cc89c['query']=_[_0x3583('0x49')](_0x48d2cd[_0x3583('0x48')]);_0x1cc89c[_0x3583('0x4a')]=_[_0x3583('0x4b')](_0x1cc89c[_0x3583('0x46')],_0x1cc89c[_0x3583('0x48')]);_0x1d48e9[_0x3583('0x4c')]=_[_0x3583('0x4b')](_0x1cc89c[_0x3583('0x46')],qs['fields'](_0x48d2cd[_0x3583('0x48')][_0x3583('0x4d')]));_0x1d48e9[_0x3583('0x4c')]=_0x1d48e9['attributes'][_0x3583('0x4e')]?_0x1d48e9[_0x3583('0x4c')]:_0x1cc89c['model'];if(!_0x48d2cd[_0x3583('0x48')][_0x3583('0x4f')](_0x3583('0x50'))){_0x1d48e9[_0x3583('0x2f')]=qs[_0x3583('0x2f')](_0x48d2cd[_0x3583('0x48')][_0x3583('0x2f')]);_0x1d48e9[_0x3583('0x31')]=qs[_0x3583('0x31')](_0x48d2cd['query'][_0x3583('0x31')]);}_0x1d48e9[_0x3583('0x51')]=qs[_0x3583('0x52')](_0x48d2cd['query'][_0x3583('0x52')]);_0x1d48e9[_0x3583('0x53')]=qs[_0x3583('0x4a')](_[_0x3583('0x67')](_0x48d2cd[_0x3583('0x48')],_0x1cc89c[_0x3583('0x4a')]));_0x1d48e9['where']['MailAccountId']=_0x226a78['id'];if(_0x48d2cd[_0x3583('0x48')][_0x3583('0x54')]){_0x1d48e9['where']=_[_0x3583('0x55')](_0x1d48e9['where'],{'$or':_['map'](_0x1d48e9[_0x3583('0x4c')],function(_0x983940){var _0x3065b4={};_0x3065b4[_0x983940]={'$like':'%'+_0x48d2cd[_0x3583('0x48')]['filter']+'%'};return _0x3065b4;})});}_0x1d48e9=_[_0x3583('0x55')]({},_0x1d48e9,_0x48d2cd[_0x3583('0x57')]);return db[_0x3583('0x63')][_0x3583('0x30')]({'where':_0x1d48e9[_0x3583('0x53')]})[_0x3583('0x20')](function(_0x3b02ee){_0x1d5f5c[_0x3583('0x30')]=_0x3b02ee;if(_0x48d2cd[_0x3583('0x48')][_0x3583('0x68')]){_0x1d48e9[_0x3583('0x58')]=[{'all':!![]}];}return db[_0x3583('0x63')]['findAll'](_0x1d48e9);})['then'](function(_0x1dccf6){_0x1d5f5c[_0x3583('0x5a')]=_0x1dccf6;return _0x1d5f5c;});}})['then'](respondWithFilteredResult(_0x3770dc,_0x1d48e9))[_0x3583('0x2a')](handleError(_0x3770dc,null));};exports[_0x3583('0x69')]=function(_0x41a245,_0x323184,_0x4f96be){return db[_0x3583('0x42')][_0x3583('0x5d')]({'where':{'id':_0x41a245['params']['id']}})[_0x3583('0x20')](handleEntityNotFound(_0x323184,null))[_0x3583('0x20')](function(_0x31def0){if(_0x31def0){return _0x31def0[_0x3583('0x69')](_0x41a245['query'][_0x3583('0x6a')]);}})[_0x3583('0x20')](respondWithStatusCode(_0x323184,null))[_0x3583('0x2a')](handleError(_0x323184,null));};exports['addAnswer']=function(_0x1e898f,_0xe71337,_0x4618a4){if(_0x1e898f['body']['id']){delete _0x1e898f[_0x3583('0x5e')]['id'];}return db[_0x3583('0x42')][_0x3583('0x5d')]({'where':{'id':_0x1e898f[_0x3583('0x5f')]['id']}})['then'](handleEntityNotFound(_0xe71337,null))['then'](function(_0x37888e){if(_0x37888e){_0x1e898f[_0x3583('0x5e')]['MailAccountId']=_0x37888e['id'];return db['CannedAnswer'][_0x3583('0x64')](_0x1e898f[_0x3583('0x5e')]);}})[_0x3583('0x20')](respondWithResult(_0xe71337,null))[_0x3583('0x2a')](handleError(_0xe71337,null));};exports[_0x3583('0x6b')]=function(_0x3a80d0,_0x3bbaa4,_0x1ab8b7){var _0x278277={'raw':![],'where':{}};var _0x350bc2={};var _0x2be8b0={'count':0x0,'rows':[]};return db[_0x3583('0x42')]['findOne']({'where':{'id':_0x3a80d0[_0x3583('0x5f')]['id']}})['then'](handleEntityNotFound(_0x3bbaa4,null))['then'](function(_0x33c7cd){if(_0x33c7cd){_0x350bc2[_0x3583('0x46')]=_[_0x3583('0x49')](db['CannedAnswer'][_0x3583('0x43')]);_0x350bc2['query']=_[_0x3583('0x49')](_0x3a80d0[_0x3583('0x48')]);_0x350bc2[_0x3583('0x4a')]=_['intersection'](_0x350bc2['model'],_0x350bc2[_0x3583('0x48')]);_0x278277['attributes']=_[_0x3583('0x4b')](_0x350bc2[_0x3583('0x46')],qs[_0x3583('0x4d')](_0x3a80d0['query'][_0x3583('0x4d')]));_0x278277[_0x3583('0x4c')]=_0x278277[_0x3583('0x4c')][_0x3583('0x4e')]?_0x278277[_0x3583('0x4c')]:_0x350bc2[_0x3583('0x46')];if(!_0x3a80d0[_0x3583('0x48')][_0x3583('0x4f')](_0x3583('0x50'))){_0x278277[_0x3583('0x2f')]=qs[_0x3583('0x2f')](_0x3a80d0[_0x3583('0x48')][_0x3583('0x2f')]);_0x278277['offset']=qs[_0x3583('0x31')](_0x3a80d0[_0x3583('0x48')][_0x3583('0x31')]);}_0x278277[_0x3583('0x51')]=qs['sort'](_0x3a80d0[_0x3583('0x48')][_0x3583('0x52')]);_0x278277[_0x3583('0x53')]=qs[_0x3583('0x4a')](_[_0x3583('0x67')](_0x3a80d0[_0x3583('0x48')],_0x350bc2[_0x3583('0x4a')]));_0x278277['where'][_0x3583('0x62')]=_0x33c7cd['id'];if(_0x3a80d0[_0x3583('0x48')]['filter']){_0x278277[_0x3583('0x53')]=_[_0x3583('0x55')](_0x278277[_0x3583('0x53')],{'$or':_[_0x3583('0x47')](_0x278277[_0x3583('0x4c')],function(_0x5c4a21){var _0x37e0e9={};_0x37e0e9[_0x5c4a21]={'$like':'%'+_0x3a80d0[_0x3583('0x48')]['filter']+'%'};return _0x37e0e9;})});}_0x278277=_['merge']({},_0x278277,_0x3a80d0[_0x3583('0x57')]);return db[_0x3583('0x6c')][_0x3583('0x30')]({'where':_0x278277[_0x3583('0x53')]})[_0x3583('0x20')](function(_0x328374){_0x2be8b0['count']=_0x328374;if(_0x3a80d0[_0x3583('0x48')]['includeAll']){_0x278277[_0x3583('0x58')]=[{'all':!![]}];}return db['CannedAnswer'][_0x3583('0x59')](_0x278277);})[_0x3583('0x20')](function(_0x2838f9){_0x2be8b0[_0x3583('0x5a')]=_0x2838f9;return _0x2be8b0;});}})['then'](respondWithFilteredResult(_0x3bbaa4,_0x278277))[_0x3583('0x2a')](handleError(_0x3bbaa4,null));};exports[_0x3583('0x6d')]=function(_0x184ace,_0x50078d,_0x615c4a){return db['MailAccount'][_0x3583('0x5d')]({'where':{'id':_0x184ace['params']['id']}})[_0x3583('0x20')](handleEntityNotFound(_0x50078d,null))[_0x3583('0x20')](function(_0x29d61e){if(_0x29d61e){return _0x29d61e[_0x3583('0x6d')](_0x184ace[_0x3583('0x48')][_0x3583('0x6a')]);}})[_0x3583('0x20')](respondWithStatusCode(_0x50078d,null))[_0x3583('0x2a')](handleError(_0x50078d,null));};exports[_0x3583('0x64')]=function(_0x217ab9,_0x25c4df){var _0x14a74f={'name':_0x217ab9[_0x3583('0x5e')][_0x3583('0x3b')],'key':_0x217ab9[_0x3583('0x5e')][_0x3583('0x6e')],'email':_0x217ab9[_0x3583('0x5e')]['email'],'ListId':_0x217ab9[_0x3583('0x5e')][_0x3583('0x6f')],'active':!_[_0x3583('0x70')](_0x217ab9[_0x3583('0x5e')][_0x3583('0x71')])?_0x217ab9[_0x3583('0x5e')][_0x3583('0x71')]:!![],'description':_0x217ab9[_0x3583('0x5e')][_0x3583('0x72')]||null,'Imap':{},'Smtp':{}};if(_[_0x3583('0x70')](_0x217ab9[_0x3583('0x5e')][_0x3583('0x73')])){if(_0x217ab9[_0x3583('0x5e')][_0x3583('0x74')]){_0x14a74f[_0x3583('0x3f')][_0x3583('0x75')]=_0x14a74f[_0x3583('0x41')][_0x3583('0x75')]=_0x217ab9['body'][_0x3583('0x76')];_0x14a74f[_0x3583('0x3f')][_0x3583('0x77')]=_0x14a74f[_0x3583('0x41')][_0x3583('0x78')]=_0x217ab9[_0x3583('0x5e')][_0x3583('0x79')];}else{_0x14a74f[_0x3583('0x3f')][_0x3583('0x7a')]=_0x14a74f[_0x3583('0x41')][_0x3583('0x7a')]=![];}_0x14a74f[_0x3583('0x3f')][_0x3583('0x7b')]=_0x217ab9[_0x3583('0x5e')][_0x3583('0x3f')][_0x3583('0x7b')];_0x14a74f[_0x3583('0x3f')]['port']=_0x217ab9[_0x3583('0x5e')][_0x3583('0x3f')]['port'];_0x14a74f[_0x3583('0x41')][_0x3583('0x7b')]=_0x217ab9[_0x3583('0x5e')][_0x3583('0x41')][_0x3583('0x7b')];_0x14a74f[_0x3583('0x41')][_0x3583('0x7c')]=_0x217ab9[_0x3583('0x5e')]['Smtp'][_0x3583('0x7c')];}else{_0x14a74f[_0x3583('0x3f')]['service']=_0x14a74f['Smtp'][_0x3583('0x7d')]=_0x217ab9[_0x3583('0x5e')][_0x3583('0x73')];_0x14a74f[_0x3583('0x3f')][_0x3583('0x75')]=_0x14a74f[_0x3583('0x41')][_0x3583('0x75')]=_0x217ab9[_0x3583('0x5e')]['cuser'];_0x14a74f['Imap']['password']=_0x14a74f[_0x3583('0x41')][_0x3583('0x78')]=_0x217ab9[_0x3583('0x5e')]['cpassword'];}return db[_0x3583('0x42')][_0x3583('0x64')](_0x14a74f,{'include':[{'model':db[_0x3583('0x40')],'as':_0x3583('0x41')},{'model':db[_0x3583('0x3e')],'as':'Imap'}]})[_0x3583('0x20')](function(_0x47afde){var _0x4ec8a4=_0x217ab9[_0x3583('0x75')]['get']({'plain':!![]});if(!_0x4ec8a4)throw new Error(_0x3583('0x7e'));if(_0x4ec8a4[_0x3583('0x7f')]==='user'){var _0x44f5b2=_0x47afde[_0x3583('0x37')]({'plain':!![]});return db[_0x3583('0x80')][_0x3583('0x5d')]({'where':{'name':_0x3583('0x38'),'userProfileId':_0x4ec8a4[_0x3583('0x81')]},'raw':!![]})[_0x3583('0x20')](function(_0x3deb3d){if(_0x3deb3d&&_0x3deb3d['autoAssociation']===0x0){return db[_0x3583('0x39')]['create']({'name':_0x44f5b2[_0x3583('0x3b')],'resourceId':_0x44f5b2['id'],'type':_0x3deb3d[_0x3583('0x3b')],'sectionId':_0x3deb3d['id']},{})['then'](function(){return _0x47afde;});}else{return _0x47afde;}})[_0x3583('0x2a')](function(_0x40b6e8){logger[_0x3583('0x26')](_0x3583('0x82'),_0x40b6e8);throw _0x40b6e8;});}return _0x47afde;})[_0x3583('0x20')](respondWithResult(_0x25c4df,0xc9))['catch'](handleError(_0x25c4df,null));};exports['getImap']=function(_0xc9cdff,_0x35da83,_0x52db08){return db[_0x3583('0x42')][_0x3583('0x66')]({'where':{'id':_0xc9cdff[_0x3583('0x5f')]['id']}})['then'](handleEntityNotFound(_0x35da83,null))[_0x3583('0x20')](function(_0x35b7ad){if(_0x35b7ad){return _0x35b7ad[_0x3583('0x83')]();}return null;})[_0x3583('0x20')](respondWithResult(_0x35da83,null))[_0x3583('0x2a')](handleError(_0x35da83,null));};exports[_0x3583('0x84')]=function(_0x183a51,_0xb8fa4a,_0x253bcf){if(_0x183a51[_0x3583('0x5e')]['id']){delete _0x183a51[_0x3583('0x5e')]['id'];}return db[_0x3583('0x42')][_0x3583('0x5d')]({'where':{'id':_0x183a51['params']['id']}})['then'](handleEntityNotFound(_0xb8fa4a,null))[_0x3583('0x20')](function(_0x3779dc){if(_0x3779dc){_0x183a51['body'][_0x3583('0x62')]=_0x3779dc['id'];return db['MailServerIn'][_0x3583('0x64')](_0x183a51[_0x3583('0x5e')]);}})[_0x3583('0x20')](respondWithResult(_0xb8fa4a,null))['catch'](handleError(_0xb8fa4a,null));};exports['removeImap']=function(_0x54b93f,_0x147f3e,_0x42d90f){return db['MailAccount'][_0x3583('0x66')]({'where':{'id':_0x54b93f[_0x3583('0x5f')]['id']}})[_0x3583('0x20')](handleEntityNotFound(_0x147f3e,null))[_0x3583('0x20')](function(_0x270640){if(_0x270640){return _0x270640['setImap'](null);}return null;})[_0x3583('0x20')](respondWithStatusCode(_0x147f3e,null))[_0x3583('0x2a')](handleError(_0x147f3e,null));};exports[_0x3583('0x85')]=function(_0x5d70f9,_0x568642,_0x4fe683){return db['MailAccount'][_0x3583('0x66')]({'where':{'id':_0x5d70f9[_0x3583('0x5f')]['id']}})['then'](handleEntityNotFound(_0x568642,null))[_0x3583('0x20')](function(_0x3069a5){if(_0x3069a5){return _0x3069a5[_0x3583('0x85')]();}return null;})[_0x3583('0x20')](respondWithResult(_0x568642,null))[_0x3583('0x2a')](handleError(_0x568642,null));};exports['addSmtp']=function(_0x2d6c4b,_0x2f020f,_0x2c3e10){if(_0x2d6c4b['body']['id']){delete _0x2d6c4b[_0x3583('0x5e')]['id'];}return db[_0x3583('0x42')]['find']({'where':{'id':_0x2d6c4b[_0x3583('0x5f')]['id']}})[_0x3583('0x20')](handleEntityNotFound(_0x2f020f,null))[_0x3583('0x20')](function(_0x5da785){if(_0x5da785){_0x2d6c4b[_0x3583('0x5e')][_0x3583('0x62')]=_0x5da785['id'];return db[_0x3583('0x40')]['create'](_0x2d6c4b['body']);}})[_0x3583('0x20')](respondWithResult(_0x2f020f,null))[_0x3583('0x2a')](handleError(_0x2f020f,null));};exports['removeSmtp']=function(_0x4e552f,_0x4da17f,_0x370bd5){return db[_0x3583('0x42')][_0x3583('0x66')]({'where':{'id':_0x4e552f['params']['id']}})[_0x3583('0x20')](handleEntityNotFound(_0x4da17f,null))['then'](function(_0x30e42b){if(_0x30e42b){return _0x30e42b[_0x3583('0x86')](null);}return null;})[_0x3583('0x20')](respondWithStatusCode(_0x4da17f,null))[_0x3583('0x2a')](handleError(_0x4da17f,null));};exports[_0x3583('0x87')]=function(_0xd012ee,_0x55145a,_0x1eb2d5){return db[_0x3583('0x88')][_0x3583('0x5d')]({'where':{'id':_0xd012ee[_0x3583('0x5f')]['id']}})['then'](handleEntityNotFound(_0x55145a,null))['then'](function(_0x1b390a){if(_0x1b390a){return _0x1b390a['addInteraction'](_0xd012ee[_0x3583('0x5e')][_0x3583('0x6a')],_['omit'](_0xd012ee[_0x3583('0x5e')],['ids','id'])||{});}})[_0x3583('0x20')](respondWithResult(_0x55145a,null))['catch'](handleError(_0x55145a,null));};exports[_0x3583('0x89')]=function(_0x5dbbad,_0x31d076,_0x2f003d){var _0x19bde5={'raw':![],'where':{}};var _0x14ba56={};var _0x15d1e4={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x5dbbad['params']['id']}})[_0x3583('0x20')](handleEntityNotFound(_0x31d076,null))[_0x3583('0x20')](function(_0x372025){if(_0x372025){_0x14ba56[_0x3583('0x46')]=_[_0x3583('0x49')](db[_0x3583('0x88')][_0x3583('0x43')]);_0x14ba56['query']=_['keys'](_0x5dbbad['query']);_0x14ba56[_0x3583('0x4a')]=_[_0x3583('0x4b')](_0x14ba56[_0x3583('0x46')],_0x14ba56[_0x3583('0x48')]);_0x19bde5[_0x3583('0x4c')]=_[_0x3583('0x4b')](_0x14ba56[_0x3583('0x46')],qs[_0x3583('0x4d')](_0x5dbbad[_0x3583('0x48')][_0x3583('0x4d')]));_0x19bde5[_0x3583('0x4c')]=_0x19bde5[_0x3583('0x4c')]['length']?_0x19bde5[_0x3583('0x4c')]:_0x14ba56[_0x3583('0x46')];if(!_0x5dbbad[_0x3583('0x48')][_0x3583('0x4f')](_0x3583('0x50'))){_0x19bde5[_0x3583('0x2f')]=qs['limit'](_0x5dbbad['query'][_0x3583('0x2f')]);_0x19bde5[_0x3583('0x31')]=qs['offset'](_0x5dbbad[_0x3583('0x48')][_0x3583('0x31')]);}_0x19bde5[_0x3583('0x51')]=qs['sort'](_0x5dbbad[_0x3583('0x48')][_0x3583('0x52')]);_0x19bde5[_0x3583('0x53')]=qs[_0x3583('0x4a')](_['pick'](_0x5dbbad['query'],_0x14ba56[_0x3583('0x4a')]));_0x19bde5['where'][_0x3583('0x62')]=_0x372025['id'];if(_0x5dbbad[_0x3583('0x48')][_0x3583('0x54')]){_0x19bde5['where']=_[_0x3583('0x55')](_0x19bde5[_0x3583('0x53')],{'$or':_['map'](_0x19bde5[_0x3583('0x4c')],function(_0x580dc9){var _0x198ade={};_0x198ade[_0x580dc9]={'$like':'%'+_0x5dbbad['query'][_0x3583('0x54')]+'%'};return _0x198ade;})});}_0x19bde5=_[_0x3583('0x55')]({},_0x19bde5,_0x5dbbad[_0x3583('0x57')]);return db[_0x3583('0x88')][_0x3583('0x30')]({'where':_0x19bde5[_0x3583('0x53')]})[_0x3583('0x20')](function(_0x2dbdba){_0x15d1e4[_0x3583('0x30')]=_0x2dbdba;if(_0x5dbbad[_0x3583('0x48')][_0x3583('0x68')]){_0x19bde5[_0x3583('0x58')]=[{'model':db[_0x3583('0x8a')],'as':_0x3583('0x8b'),'required':![]},{'model':db[_0x3583('0x8c')],'as':'Owner','attributes':[_0x3583('0x3b'),'fullname',_0x3583('0x8d')],'required':![]},{'model':db[_0x3583('0x8e')],'as':_0x3583('0x8f'),'attributes':['id',_0x3583('0x3b'),'color'],'where':_0x5dbbad[_0x3583('0x48')]['tag']?{'id':_0x5dbbad[_0x3583('0x48')][_0x3583('0x90')]}:undefined,'required':_0x5dbbad[_0x3583('0x48')][_0x3583('0x90')]?!![]:![]}];}return db[_0x3583('0x88')][_0x3583('0x59')](_0x19bde5);})['then'](function(_0x496751){_0x15d1e4[_0x3583('0x5a')]=_0x496751;return _0x15d1e4;});}})[_0x3583('0x20')](respondWithFilteredResult(_0x31d076,_0x19bde5))[_0x3583('0x2a')](handleError(_0x31d076,null));};exports['addApplications']=function(_0x54ac9c,_0x220870,_0xb53c62){return db['MailAccount'][_0x3583('0x66')]({'where':{'id':_0x54ac9c[_0x3583('0x5f')]['id']}})[_0x3583('0x20')](handleEntityNotFound(_0x220870,null))[_0x3583('0x20')](function(_0x5e7f7b){if(_0x5e7f7b){return db[_0x3583('0x91')][_0x3583('0x92')](function(_0x276e5a){return db[_0x3583('0x93')][_0x3583('0x36')]({'where':{'MailAccountId':_0x54ac9c[_0x3583('0x5f')]['id']},'transaction':_0x276e5a})[_0x3583('0x20')](function(_0x20ee13){var _0x4f93d3=_[_0x3583('0x47')](_0x54ac9c['body'],function(_0x5b1169){_0x5b1169['MailAccountId']=_0x54ac9c[_0x3583('0x5f')]['id'];return _0x5b1169;});return db[_0x3583('0x93')]['bulkCreate'](_0x4f93d3,{'transaction':_0x276e5a});});})[_0x3583('0x20')](function(){return db['MailApplication'][_0x3583('0x94')]({'where':{'MailAccountId':_0x54ac9c[_0x3583('0x5f')]['id']},'order':_0x3583('0x95')});});}})['then'](respondWithResult(_0x220870,null))[_0x3583('0x2a')](handleError(_0x220870,null));};exports[_0x3583('0x96')]=function(_0x428061,_0x2fea7e,_0x4c09b2){var _0xf2ee28={};var _0x2993b4={};var _0x582c24;var _0x20e9ce;return db['MailAccount'][_0x3583('0x66')]({'where':{'id':_0x428061[_0x3583('0x5f')]['id']}})[_0x3583('0x20')](handleEntityNotFound(_0x2fea7e,null))[_0x3583('0x20')](function(_0x249faa){if(_0x249faa){_0x582c24=_0x249faa;_0x2993b4[_0x3583('0x46')]=_[_0x3583('0x49')](db[_0x3583('0x93')][_0x3583('0x43')]);_0x2993b4[_0x3583('0x48')]=_['keys'](_0x428061[_0x3583('0x48')]);_0x2993b4[_0x3583('0x4a')]=_[_0x3583('0x4b')](_0x2993b4[_0x3583('0x46')],_0x2993b4[_0x3583('0x48')]);_0xf2ee28['attributes']=_[_0x3583('0x4b')](_0x2993b4['model'],qs[_0x3583('0x4d')](_0x428061[_0x3583('0x48')]['fields']));_0xf2ee28[_0x3583('0x4c')]=_0xf2ee28['attributes'][_0x3583('0x4e')]?_0xf2ee28[_0x3583('0x4c')]:_0x2993b4[_0x3583('0x46')];_0xf2ee28['order']=qs[_0x3583('0x52')](_0x428061[_0x3583('0x48')][_0x3583('0x52')]);_0xf2ee28['where']=qs[_0x3583('0x4a')](_['pick'](_0x428061['query'],_0x2993b4[_0x3583('0x4a')]));if(_0x428061['query'][_0x3583('0x54')]){_0xf2ee28['where']=_['merge'](_0xf2ee28[_0x3583('0x53')],{'$or':_[_0x3583('0x47')](_0xf2ee28['attributes'],function(_0x59cbf4){var _0x1b284d={};_0x1b284d[_0x59cbf4]={'$like':'%'+_0x428061[_0x3583('0x48')][_0x3583('0x54')]+'%'};return _0x1b284d;})});}_0xf2ee28=_[_0x3583('0x55')]({},_0xf2ee28,_0x428061[_0x3583('0x57')]);return _0x582c24[_0x3583('0x96')](_0xf2ee28);}})[_0x3583('0x20')](function(_0x101809){if(_0x101809){_0x20e9ce=_0x101809['length'];if(!_0x428061['query'][_0x3583('0x4f')](_0x3583('0x50'))){_0xf2ee28['limit']=qs[_0x3583('0x2f')](_0x428061[_0x3583('0x48')][_0x3583('0x2f')]);_0xf2ee28[_0x3583('0x31')]=qs[_0x3583('0x31')](_0x428061['query'][_0x3583('0x31')]);}return _0x582c24[_0x3583('0x96')](_0xf2ee28);}})[_0x3583('0x20')](function(_0x3aa4cb){if(_0x3aa4cb){return _0x3aa4cb?{'count':_0x20e9ce,'rows':_0x3aa4cb}:null;}})[_0x3583('0x20')](respondWithResult(_0x2fea7e,null))[_0x3583('0x2a')](handleError(_0x2fea7e,null));};exports[_0x3583('0x97')]=function(_0x294f74,_0x37f187,_0x2fa36f){var _0xdb3e4c={'raw':!![],'where':{}};var _0x3b60c1={};var _0x19308e={'count':0x0,'rows':[]};return db[_0x3583('0x42')][_0x3583('0x66')]({'where':{'id':_0x294f74[_0x3583('0x5f')]['id']}})[_0x3583('0x20')](handleEntityNotFound(_0x37f187,null))['then'](function(_0x3d7d3c){if(_0x3d7d3c){_0x3b60c1[_0x3583('0x46')]=_['keys'](db[_0x3583('0x98')]['rawAttributes']);_0x3b60c1[_0x3583('0x48')]=_[_0x3583('0x49')](_0x294f74[_0x3583('0x48')]);_0x3b60c1[_0x3583('0x4a')]=_[_0x3583('0x4b')](_0x3b60c1[_0x3583('0x46')],_0x3b60c1['query']);_0xdb3e4c['attributes']=_[_0x3583('0x4b')](_0x3b60c1[_0x3583('0x46')],qs[_0x3583('0x4d')](_0x294f74[_0x3583('0x48')]['fields']));_0xdb3e4c['attributes']=_0xdb3e4c[_0x3583('0x4c')][_0x3583('0x4e')]?_0xdb3e4c[_0x3583('0x4c')]:_0x3b60c1['model'];if(!_0x294f74[_0x3583('0x48')][_0x3583('0x4f')](_0x3583('0x50'))){_0xdb3e4c[_0x3583('0x2f')]=qs[_0x3583('0x2f')](_0x294f74[_0x3583('0x48')][_0x3583('0x2f')]);_0xdb3e4c[_0x3583('0x31')]=qs[_0x3583('0x31')](_0x294f74[_0x3583('0x48')][_0x3583('0x31')]);}_0xdb3e4c['order']=qs[_0x3583('0x52')](_0x294f74['query']['sort']);_0xdb3e4c[_0x3583('0x53')]=qs['filters'](_['pick'](_0x294f74[_0x3583('0x48')],_0x3b60c1['filters']));_0xdb3e4c[_0x3583('0x53')][_0x3583('0x62')]=_0x3d7d3c['id'];if(_0x294f74[_0x3583('0x48')][_0x3583('0x54')]){_0xdb3e4c['where']=_[_0x3583('0x55')](_0xdb3e4c['where'],{'$or':_[_0x3583('0x47')](_0xdb3e4c[_0x3583('0x4c')],function(_0x49b51e){var _0x164cc5={};_0x164cc5[_0x49b51e]={'$like':'%'+_0x294f74[_0x3583('0x48')][_0x3583('0x54')]+'%'};return _0x164cc5;})});}if(_0x294f74['query']['$gte']){var _0x57b3c8=_0x294f74[_0x3583('0x48')][_0x3583('0x99')][_0x3583('0x9a')](',');var _0x458be3={};_0x458be3[_0x57b3c8[0x0]]={'$gte':moment(_0x57b3c8[0x1])[_0x3583('0x9b')]('YYYY-MM-DD\x20HH:mm:ss')};_0xdb3e4c['where']=_['merge'](_0xdb3e4c[_0x3583('0x53')],_0x458be3);}_0xdb3e4c=_[_0x3583('0x55')]({},_0xdb3e4c,_0x294f74[_0x3583('0x57')]);return db[_0x3583('0x98')][_0x3583('0x30')]({'where':_0xdb3e4c[_0x3583('0x53')]})[_0x3583('0x20')](function(_0x3e8d99){_0x19308e['count']=_0x3e8d99;if(_0x294f74[_0x3583('0x48')][_0x3583('0x68')]){_0xdb3e4c[_0x3583('0x58')]=[{'all':!![]}];}return db[_0x3583('0x98')][_0x3583('0x59')](_0xdb3e4c);})[_0x3583('0x20')](function(_0x293cbb){if(_0x294f74[_0x3583('0x48')]['inlineCss']===_0x3583('0x9c')){for(var _0xd9275d=0x0;_0xd9275d<_0x293cbb['length'];_0xd9275d++){_0x293cbb[_0xd9275d][_0x3583('0x5e')]=juice(_0x293cbb[_0xd9275d][_0x3583('0x5e')]);}}_0x19308e[_0x3583('0x5a')]=_0x293cbb;return _0x19308e;});}})[_0x3583('0x20')](respondWithFilteredResult(_0x37f187,_0xdb3e4c))[_0x3583('0x2a')](handleError(_0x37f187,null));};exports['send']=function(_0x95e74c,_0xdaf1f0,_0x42a351){var _0x239f05,_0x1f88c8={},_0x53c3ab;if(_0x95e74c[_0x3583('0x5e')]['to']){_0x53c3ab=_0x95e74c[_0x3583('0x5e')]['to']['split'](',')[0x0];}return db[_0x3583('0x42')][_0x3583('0x5d')]({'where':{'id':_0x95e74c[_0x3583('0x5f')]['id']},'include':[{'model':db[_0x3583('0x9d')],'as':_0x3583('0x9e'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'email':_0x53c3ab},'limit':0x1,'order':[['updatedAt',_0x3583('0x9f')]]}]},{'model':db[_0x3583('0x40')],'as':_0x3583('0x41'),'raw':!![]}]})[_0x3583('0x20')](handleEntityNotFound(_0xdaf1f0,null))[_0x3583('0x20')](function(_0x50d354){if(_0x50d354){_0x239f05=_0x50d354;if(_0x50d354[_0x3583('0x41')]){if(_['isNil'](_0x95e74c[_0x3583('0x5e')][_0x3583('0xa0')])){_0x95e74c['body']['from']=util[_0x3583('0x9b')](_0x3583('0xa1'),_0x50d354[_0x3583('0x3b')],_0x50d354['email']||_0x50d354[_0x3583('0x41')]['user']);}if(_0x95e74c[_0x3583('0x5e')][_0x3583('0xa2')]&&_0x95e74c[_0x3583('0x5e')][_0x3583('0xa2')]['length']){for(var _0x2aac91=0x0;_0x2aac91<_0x95e74c[_0x3583('0x5e')]['attachments'][_0x3583('0x4e')];_0x2aac91+=0x1){_0x95e74c[_0x3583('0x5e')][_0x3583('0xa2')][_0x2aac91]={'filename':_0x95e74c[_0x3583('0x5e')][_0x3583('0xa2')][_0x2aac91][_0x3583('0x3b')],'path':path['join'](config[_0x3583('0xa3')],_0x3583('0xa4'),_0x95e74c[_0x3583('0x5e')][_0x3583('0xa2')][_0x2aac91][_0x3583('0xa5')])};}}var _0x5802a7={'tls':{'rejectUnauthorized':![]}};if(_[_0x3583('0x70')](_0x50d354[_0x3583('0x41')][_0x3583('0x7d')])){if(_0x50d354['Smtp'][_0x3583('0x7a')]){_0x5802a7[_0x3583('0xa6')]={'user':_0x50d354[_0x3583('0x41')]['user'],'pass':_0x50d354[_0x3583('0x41')][_0x3583('0x78')]};}_0x5802a7['host']=_0x50d354[_0x3583('0x41')][_0x3583('0x7b')];_0x5802a7[_0x3583('0x7c')]=_0x50d354['Smtp'][_0x3583('0x7c')];_0x5802a7[_0x3583('0xa7')]=_0x50d354[_0x3583('0x41')][_0x3583('0xa7')];}else{_0x5802a7['service']=_0x50d354[_0x3583('0x41')][_0x3583('0x7d')];_0x5802a7[_0x3583('0xa6')]={'user':_0x50d354[_0x3583('0x41')]['user'],'pass':_0x50d354[_0x3583('0x41')][_0x3583('0x78')]};}return respondWithRpcPromise(_0x3583('0xa8'),_0x3583('0xa9'),{'account':_0x5802a7,'message':_0x95e74c[_0x3583('0x5e')]});}else{throw new Error('List\x20not\x20found');}}})[_0x3583('0x20')](function(_0x1bd522){if(_0x1bd522){_0x1f88c8=_0x1bd522;if(_0x239f05[_0x3583('0x9e')]){if(_0x239f05[_0x3583('0x9e')][_0x3583('0xaa')][_0x3583('0x4e')]){return _0x239f05[_0x3583('0x9e')][_0x3583('0xaa')][0x0];}else{return db[_0x3583('0x8a')][_0x3583('0x64')](_['defaults'](_0x95e74c[_0x3583('0x5e')],{'firstName':_0x95e74c[_0x3583('0x5e')]['to'],'email':_0x95e74c[_0x3583('0x5e')]['to'],'phone':_0x95e74c['body']['to'],'ListId':_0x239f05[_0x3583('0x6f')]}));}}else{throw new Error('List\x20not\x20found');}}})[_0x3583('0x20')](function(_0x39eaa6){if(_0x39eaa6){var _0x216696={'UserId':_0x95e74c[_0x3583('0x75')]['id'],'ContactId':_0x39eaa6['id'],'MailAccountId':_0x239f05['id'],'inReplyTo':_0x1f88c8[_0x3583('0xab')],'to':_0x95e74c['body']['from'],'cc':_0x95e74c['body']['cc'],'subject':_0x95e74c[_0x3583('0x5e')]['subject'],'attach':_0x95e74c[_0x3583('0x5e')][_0x3583('0xac')],'firstMsgDirection':_0x3583('0xad'),'lastMsgAt':moment()[_0x3583('0x9b')](_0x3583('0xae')),'lastMsgDirection':_0x3583('0xad'),'Messages':[_[_0x3583('0x55')](_0x95e74c['body'],{'messageId':_0x1f88c8['messageId'],'sentAt':moment()[_0x3583('0x9b')](_0x3583('0xae')),'read':!![],'MailAccountId':_0x239f05['id'],'UserId':_0x95e74c['user']['id'],'ContactId':_0x39eaa6['id']})]};if(_0x95e74c[_0x3583('0x5e')][_0x3583('0xaf')]){_0x216696=_['merge'](_0x216696,_0x95e74c[_0x3583('0x5e')]['Interaction']);}return db[_0x3583('0x88')]['create'](_0x216696,{'include':[{'model':db['MailMessage'],'as':_0x3583('0xb0')}]});}})[_0x3583('0x20')](respondWithResult(_0xdaf1f0,null))[_0x3583('0x2a')](handleError(_0xdaf1f0,null));};exports[_0x3583('0xb1')]=function(_0x5ce5be,_0x19e9fc,_0x4af936){return db[_0x3583('0x42')][_0x3583('0x5d')]({'where':{'id':_0x5ce5be[_0x3583('0x5f')]['id']},'include':[{'model':db[_0x3583('0x40')],'as':_0x3583('0x41'),'raw':!![]}]})[_0x3583('0x20')](handleEntityNotFound(_0x19e9fc,null))[_0x3583('0x20')](function(_0x377d31){if(_0x377d31&&_0x377d31[_0x3583('0x41')]){var _0x46e809={'id':_0x377d31['id'],'tls':{'rejectUnauthorized':![]}};if(_0x377d31[_0x3583('0x41')][_0x3583('0x7d')]){_0x46e809['service']=_0x377d31[_0x3583('0x41')][_0x3583('0x7d')];}else{_0x46e809['host']=_0x377d31[_0x3583('0x41')][_0x3583('0x7b')];_0x46e809[_0x3583('0x7c')]=_0x377d31[_0x3583('0x41')][_0x3583('0x7c')];_0x46e809[_0x3583('0xa7')]=_0x377d31[_0x3583('0x41')]['secure'];}if(_0x377d31[_0x3583('0x41')]['authentication']){_0x46e809['auth']={'user':_0x377d31['Smtp']['user'],'pass':_0x377d31[_0x3583('0x41')][_0x3583('0x78')]};}return respondWithRpcPromise(_0x3583('0xb2'),_0x3583('0xb1'),{'account':_0x46e809});}})[_0x3583('0x20')](respondWithResult(_0x19e9fc,null))[_0x3583('0x2a')](handleError(_0x19e9fc,null));};exports[_0x3583('0x36')]=function(_0x5a8831,_0x448a53){return db[_0x3583('0x42')][_0x3583('0x5d')]({'where':{'id':_0x5a8831['params']['id']}})['then'](handleEntityNotFound(_0x448a53,null))['then'](function(_0x1541a6){if(_0x1541a6&&_0x1541a6['service']){throw new db[(_0x3583('0xb3'))][(_0x3583('0xb4'))]('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x1541a6;})[_0x3583('0x20')](removeEntity(_0x448a53,null))['catch'](handleError(_0x448a53,null));};exports['addAgents']=function(_0x364a89,_0x1c8f40,_0x20b870){return db[_0x3583('0x42')][_0x3583('0x5d')]({'where':{'id':_0x364a89[_0x3583('0x5f')]['id']}})[_0x3583('0x20')](handleEntityNotFound(_0x1c8f40,null))[_0x3583('0x20')](function(_0x44ac4b){if(_0x44ac4b){return _0x44ac4b[_0x3583('0xb5')](_0x364a89['body'][_0x3583('0x6a')],_[_0x3583('0xb6')](_0x364a89[_0x3583('0x5e')],[_0x3583('0x6a'),'id'])||{})['spread'](function(_0x38edc0){for(var _0x151cfc=0x0;_0x151cfc<_0x364a89[_0x3583('0x5e')][_0x3583('0x6a')][_0x3583('0x4e')];_0x151cfc+=0x1){socket[_0x3583('0xb7')](_0x3583('0xb8'),{'UserId':Number(_0x364a89[_0x3583('0x5e')][_0x3583('0x6a')][_0x151cfc]),'MailAccountId':Number(_0x364a89[_0x3583('0x5f')]['id'])});}return _0x38edc0;});}})[_0x3583('0x20')](respondWithResult(_0x1c8f40,null))[_0x3583('0x2a')](handleError(_0x1c8f40,null));};exports['removeAgents']=function(_0x8c407f,_0x5af916,_0x4ce77a){return db[_0x3583('0x42')][_0x3583('0x5d')]({'where':{'id':_0x8c407f[_0x3583('0x5f')]['id']}})[_0x3583('0x20')](handleEntityNotFound(_0x5af916,null))[_0x3583('0x20')](function(_0x500068){if(_0x500068){return _0x500068[_0x3583('0xb9')](_0x8c407f[_0x3583('0x48')][_0x3583('0x6a')])[_0x3583('0x20')](function(){if(_[_0x3583('0xba')](_0x8c407f[_0x3583('0x48')]['ids'])){for(var _0x1651db=0x0;_0x1651db<_0x8c407f['query'][_0x3583('0x6a')][_0x3583('0x4e')];_0x1651db+=0x1){socket[_0x3583('0xb7')](_0x3583('0xbb'),{'UserId':Number(_0x8c407f[_0x3583('0x48')]['ids'][_0x1651db]),'MailAccountId':Number(_0x8c407f[_0x3583('0x5f')]['id'])});}}else{socket[_0x3583('0xb7')](_0x3583('0xbb'),{'UserId':Number(_0x8c407f[_0x3583('0x48')]['ids']),'MailAccountId':Number(_0x8c407f[_0x3583('0x5f')]['id'])});}});}})[_0x3583('0x20')](respondWithStatusCode(_0x5af916,null))[_0x3583('0x2a')](handleError(_0x5af916,null));};exports[_0x3583('0xbc')]=function(_0xaba4c7,_0x443126,_0x250e9d){var _0xd2f29a={};var _0x2381e8={};var _0x288b57;var _0x2caa6c;return db[_0x3583('0x42')]['findOne']({'where':{'id':_0xaba4c7[_0x3583('0x5f')]['id']}})[_0x3583('0x20')](handleEntityNotFound(_0x443126,null))[_0x3583('0x20')](function(_0x43d309){if(_0x43d309){_0x288b57=_0x43d309;_0x2381e8[_0x3583('0x46')]=_[_0x3583('0x49')](db[_0x3583('0x8c')][_0x3583('0x43')]);_0x2381e8[_0x3583('0x48')]=_[_0x3583('0x49')](_0xaba4c7[_0x3583('0x48')]);_0x2381e8['filters']=_[_0x3583('0x4b')](_0x2381e8[_0x3583('0x46')],_0x2381e8['query']);_0xd2f29a['attributes']=_['intersection'](_0x2381e8[_0x3583('0x46')],qs[_0x3583('0x4d')](_0xaba4c7[_0x3583('0x48')]['fields']));_0xd2f29a[_0x3583('0x4c')]=_0xd2f29a['attributes'][_0x3583('0x4e')]?_0xd2f29a['attributes']:_0x2381e8[_0x3583('0x46')];_0xd2f29a[_0x3583('0x51')]=qs['sort'](_0xaba4c7[_0x3583('0x48')][_0x3583('0x52')]);_0xd2f29a['where']=qs[_0x3583('0x4a')](_['pick'](_0xaba4c7[_0x3583('0x48')],_0x2381e8[_0x3583('0x4a')]));if(_0xaba4c7[_0x3583('0x48')][_0x3583('0x54')]){_0xd2f29a[_0x3583('0x53')]=_[_0x3583('0x55')](_0xd2f29a[_0x3583('0x53')],{'$or':_[_0x3583('0x47')](_0xd2f29a[_0x3583('0x4c')],function(_0x49020c){var _0x1dc640={};_0x1dc640[_0x49020c]={'$like':'%'+_0xaba4c7[_0x3583('0x48')]['filter']+'%'};return _0x1dc640;})});}_0xd2f29a=_[_0x3583('0x55')]({},_0xd2f29a,_0xaba4c7[_0x3583('0x57')]);return _0x288b57[_0x3583('0xbc')](_0xd2f29a);}})[_0x3583('0x20')](function(_0x49f7c4){if(_0x49f7c4){_0x2caa6c=_0x49f7c4[_0x3583('0x4e')];if(!_0xaba4c7[_0x3583('0x48')][_0x3583('0x4f')](_0x3583('0x50'))){_0xd2f29a['limit']=qs['limit'](_0xaba4c7[_0x3583('0x48')][_0x3583('0x2f')]);_0xd2f29a[_0x3583('0x31')]=qs[_0x3583('0x31')](_0xaba4c7[_0x3583('0x48')][_0x3583('0x31')]);}return _0x288b57[_0x3583('0xbc')](_0xd2f29a);}})[_0x3583('0x20')](function(_0x595da0){if(_0x595da0){return _0x595da0?{'count':_0x2caa6c,'rows':_0x595da0}:null;}})[_0x3583('0x20')](respondWithResult(_0x443126,null))[_0x3583('0x2a')](handleError(_0x443126,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 84b837a..c6e092b 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 _0xb3f9=['emit','hook','exports','events','../../mysqldb','save','remove'];(function(_0x2f0a48,_0xd06ab8){var _0x1c3c79=function(_0x14be7d){while(--_0x14be7d){_0x2f0a48['push'](_0x2f0a48['shift']());}};_0x1c3c79(++_0xd06ab8);}(_0xb3f9,0x7a));var _0x9b3f=function(_0x33f296,_0x58bdba){_0x33f296=_0x33f296-0x0;var _0x3611b6=_0xb3f9[_0x33f296];return _0x3611b6;};'use strict';var EventEmitter=require(_0x9b3f('0x0'));var MailAccount=require(_0x9b3f('0x1'))['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9b3f('0x2'),'afterUpdate':'update','afterDestroy':_0x9b3f('0x3')};function emitEvent(_0x361db7){return function(_0x35fd0b,_0xa9df41,_0x227cca){MailAccountEvents[_0x9b3f('0x4')](_0x361db7+':'+_0x35fd0b['id'],_0x35fd0b);MailAccountEvents['emit'](_0x361db7,_0x35fd0b);_0x227cca(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount[_0x9b3f('0x5')](e,emitEvent(event));}}module[_0x9b3f('0x6')]=MailAccountEvents; \ No newline at end of file +var _0x4d07=['hook','exports','events','MailAccount','emit','hasOwnProperty'];(function(_0x341850,_0x227d13){var _0x550b31=function(_0x2c78f9){while(--_0x2c78f9){_0x341850['push'](_0x341850['shift']());}};_0x550b31(++_0x227d13);}(_0x4d07,0x18e));var _0x74d0=function(_0x5912b2,_0x227589){_0x5912b2=_0x5912b2-0x0;var _0x44b48e=_0x4d07[_0x5912b2];return _0x44b48e;};'use strict';var EventEmitter=require(_0x74d0('0x0'));var MailAccount=require('../../mysqldb')['db'][_0x74d0('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x214bc6){return function(_0x464dbf,_0x28dc64,_0x236780){MailAccountEvents[_0x74d0('0x2')](_0x214bc6+':'+_0x464dbf['id'],_0x464dbf);MailAccountEvents[_0x74d0('0x2')](_0x214bc6,_0x464dbf);_0x236780(null);};}for(var e in events){if(events[_0x74d0('0x3')](e)){var event=events[e];MailAccount[_0x74d0('0x4')](e,emitEvent(event));}}module[_0x74d0('0x5')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 6895068..d09e8ed 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 _0x4b72=['moment','request-promise','path','rimraf','../../config/environment','./mailAccount.attributes','exports','define','MailAccount','mail_accounts','util','../../config/logger','api'];(function(_0x2e9cef,_0x57b5c6){var _0x3f7007=function(_0x1675e5){while(--_0x1675e5){_0x2e9cef['push'](_0x2e9cef['shift']());}};_0x3f7007(++_0x57b5c6);}(_0x4b72,0x183));var _0x24b7=function(_0x22eb5b,_0x56b8f9){_0x22eb5b=_0x22eb5b-0x0;var _0x164b76=_0x4b72[_0x22eb5b];return _0x164b76;};'use strict';var _=require('lodash');var util=require(_0x24b7('0x0'));var logger=require(_0x24b7('0x1'))(_0x24b7('0x2'));var moment=require(_0x24b7('0x3'));var BPromise=require('bluebird');var rp=require(_0x24b7('0x4'));var fs=require('fs');var path=require(_0x24b7('0x5'));var rimraf=require(_0x24b7('0x6'));var config=require(_0x24b7('0x7'));var attributes=require(_0x24b7('0x8'));module[_0x24b7('0x9')]=function(_0x2b3dc8,_0x3c1c6c){return _0x2b3dc8[_0x24b7('0xa')](_0x24b7('0xb'),attributes,{'tableName':_0x24b7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd905=['lodash','util','api','request-promise','rimraf','./mailAccount.attributes','define','MailAccount'];(function(_0x43ffa4,_0x655a2c){var _0x36c6e9=function(_0x31c4e3){while(--_0x31c4e3){_0x43ffa4['push'](_0x43ffa4['shift']());}};_0x36c6e9(++_0x655a2c);}(_0xd905,0x1e0));var _0x5d90=function(_0x4a9520,_0x4e67b2){_0x4a9520=_0x4a9520-0x0;var _0x27d098=_0xd905[_0x4a9520];return _0x27d098;};'use strict';var _=require(_0x5d90('0x0'));var util=require(_0x5d90('0x1'));var logger=require('../../config/logger')(_0x5d90('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5d90('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5d90('0x4'));var config=require('../../config/environment');var attributes=require(_0x5d90('0x5'));module['exports']=function(_0x127442,_0x4c04ae){return _0x127442[_0x5d90('0x6')](_0x5d90('0x7'),attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index aeb9e8f..712828a 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 _0xfd2f=['result','catch','MailAccount','findAll','options','raw','limit','include','map','model','attributes','then','GetMailAccount','ShowMailAccount','find','where','mail','keys','CmContact','rawAttributes','createdAt','CompanyId','ListId','body','from','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','account','List','Contacts','updatedAt','DESC','MailApplication','get','omit','Applications','list','applications','priority','autoclose','length','*,*,*,*','create','List\x20not\x20found','contact','messageId','generate','attach','format','MailMessage','inReplyTo','MailInteraction','Contact\x20not\x20found','spread','update','subject','YYYY-MM-DD\x20HH:mm:ss','interaction','created','attachments','originTo','ChatWebsiteId','originChannel','Email','Attachments','User','unshift','name','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','request','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfd2f,0x11b));var _0xffd2=function(_0x5b8ac2,_0x1939ef){_0x5b8ac2=_0x5b8ac2-0x0;var _0x54fcb=_0xfd2f[_0x5b8ac2];return _0x54fcb;};'use strict';var _=require(_0xffd2('0x0'));var util=require(_0xffd2('0x1'));var moment=require(_0xffd2('0x2'));var BPromise=require(_0xffd2('0x3'));var rs=require(_0xffd2('0x4'));var fs=require('fs');var Redis=require(_0xffd2('0x5'));var db=require(_0xffd2('0x6'))['db'];var utils=require(_0xffd2('0x7'));var logger=require(_0xffd2('0x8'))(_0xffd2('0x9'));var config=require(_0xffd2('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xffd2('0xb')][_0xffd2('0xc')]({'port':0x232c});config[_0xffd2('0xd')]=_[_0xffd2('0xe')](config[_0xffd2('0xd')],{'host':_0xffd2('0xf'),'port':0x18eb});var socket=require(_0xffd2('0x10'))(new Redis(config[_0xffd2('0xd')]));require(_0xffd2('0x11'))[_0xffd2('0x12')](socket);function respondWithRpcPromise(_0xcf4147,_0xbbad52,_0x36a653){return new BPromise(function(_0x23eb54,_0x7a62ad){return client[_0xffd2('0x13')](_0xcf4147,_0x36a653)['then'](function(_0x1b70cd){logger[_0xffd2('0x14')](_0xffd2('0x15'),_0xbbad52,_0xffd2('0x16'));logger[_0xffd2('0x17')](_0xffd2('0x18'),_0xbbad52,_0xffd2('0x16'),JSON[_0xffd2('0x19')](_0x1b70cd));if(_0x1b70cd[_0xffd2('0x1a')]){if(_0x1b70cd['error'][_0xffd2('0x1b')]===0x1f4){logger['error'](_0xffd2('0x15'),_0xbbad52,_0x1b70cd[_0xffd2('0x1a')]['message']);return _0x7a62ad(_0x1b70cd[_0xffd2('0x1a')][_0xffd2('0x1c')]);}logger['error']('MailAccount,\x20%s,\x20%s',_0xbbad52,_0x1b70cd[_0xffd2('0x1a')][_0xffd2('0x1c')]);return _0x23eb54(_0x1b70cd[_0xffd2('0x1a')]['message']);}else{logger['info']('MailAccount,\x20%s,\x20%s',_0xbbad52,_0xffd2('0x16'));_0x23eb54(_0x1b70cd[_0xffd2('0x1d')][_0xffd2('0x1c')]);}})[_0xffd2('0x1e')](function(_0x1f4c5f){logger[_0xffd2('0x1a')](_0xffd2('0x15'),_0xbbad52,_0x1f4c5f);_0x7a62ad(_0x1f4c5f);});});}exports['GetMailAccount']=function(_0x43a474){var _0x41e79c=this;return new Promise(function(_0x41b056,_0x29ad80){return db[_0xffd2('0x1f')][_0xffd2('0x20')]({'raw':_0x43a474[_0xffd2('0x21')]?_0x43a474[_0xffd2('0x21')][_0xffd2('0x22')]===undefined?!![]:![]:!![],'where':_0x43a474[_0xffd2('0x21')]?_0x43a474[_0xffd2('0x21')]['where']||null:null,'attributes':_0x43a474['options']?_0x43a474[_0xffd2('0x21')]['attributes']||null:null,'limit':_0x43a474[_0xffd2('0x21')]?_0x43a474[_0xffd2('0x21')][_0xffd2('0x23')]||null:null,'include':_0x43a474[_0xffd2('0x21')]?_0x43a474[_0xffd2('0x21')][_0xffd2('0x24')]?_[_0xffd2('0x25')](_0x43a474[_0xffd2('0x21')][_0xffd2('0x24')],function(_0x5b53bc){return{'model':db[_0x5b53bc[_0xffd2('0x26')]],'as':_0x5b53bc['as'],'attributes':_0x5b53bc[_0xffd2('0x27')],'include':_0x5b53bc[_0xffd2('0x24')]?_['map'](_0x5b53bc['include'],function(_0x48bfe8){return{'model':db[_0x48bfe8['model']],'as':_0x48bfe8['as'],'attributes':_0x48bfe8[_0xffd2('0x27')],'include':_0x48bfe8[_0xffd2('0x24')]?_[_0xffd2('0x25')](_0x48bfe8[_0xffd2('0x24')],function(_0x1de3b1){return{'model':db[_0x1de3b1[_0xffd2('0x26')]],'as':_0x1de3b1['as'],'attributes':_0x1de3b1['attributes']};}):[]};}):[]};}):[]:[]})[_0xffd2('0x28')](function(_0x3a1130){logger[_0xffd2('0x14')](_0xffd2('0x29'),_0x43a474);logger[_0xffd2('0x17')]('GetMailAccount',_0x43a474,JSON['stringify'](_0x3a1130));_0x41b056(_0x3a1130);})[_0xffd2('0x1e')](function(_0x3d6b66){logger[_0xffd2('0x1a')](_0xffd2('0x29'),_0x3d6b66[_0xffd2('0x1c')],_0x43a474);_0x29ad80(_0x41e79c[_0xffd2('0x1a')](0x1f4,_0x3d6b66[_0xffd2('0x1c')]));});});};exports[_0xffd2('0x2a')]=function(_0x33d0b1){var _0x44b7f2=this;return new Promise(function(_0x50b62a,_0x3188dc){return db[_0xffd2('0x1f')][_0xffd2('0x2b')]({'raw':_0x33d0b1[_0xffd2('0x21')]?_0x33d0b1['options'][_0xffd2('0x22')]===undefined?!![]:![]:!![],'where':_0x33d0b1[_0xffd2('0x21')]?_0x33d0b1[_0xffd2('0x21')][_0xffd2('0x2c')]||null:null,'attributes':_0x33d0b1[_0xffd2('0x21')]?_0x33d0b1[_0xffd2('0x21')]['attributes']||null:null,'include':_0x33d0b1[_0xffd2('0x21')]?_0x33d0b1['options'][_0xffd2('0x24')]?_[_0xffd2('0x25')](_0x33d0b1['options'][_0xffd2('0x24')],function(_0x2496e8){return{'model':db[_0x2496e8['model']],'as':_0x2496e8['as'],'attributes':_0x2496e8[_0xffd2('0x27')],'include':_0x2496e8['include']?_['map'](_0x2496e8[_0xffd2('0x24')],function(_0x4065ff){return{'model':db[_0x4065ff[_0xffd2('0x26')]],'as':_0x4065ff['as'],'attributes':_0x4065ff[_0xffd2('0x27')],'include':_0x4065ff['include']?_[_0xffd2('0x25')](_0x4065ff[_0xffd2('0x24')],function(_0x39b58b){return{'model':db[_0x39b58b[_0xffd2('0x26')]],'as':_0x39b58b['as'],'attributes':_0x39b58b[_0xffd2('0x27')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x106acb){logger['info'](_0xffd2('0x2a'),_0x33d0b1);logger[_0xffd2('0x17')](_0xffd2('0x2a'),_0x33d0b1,JSON[_0xffd2('0x19')](_0x106acb));_0x50b62a(_0x106acb);})[_0xffd2('0x1e')](function(_0x210e0a){logger['error']('ShowMailAccount',_0x210e0a[_0xffd2('0x1c')],_0x33d0b1);_0x3188dc(_0x44b7f2['error'](0x1f4,_0x210e0a[_0xffd2('0x1c')]));});});};exports['NotifyMailAccount']=function(_0x186134){var _0x1fd7ba=this;return new Promise(function(_0x3cf6a6,_0xac3520){var _0x818fb8={'body':_0x186134['body'],'channel':_0xffd2('0x2d')};var _0x482b0c=_['difference'](_[_0xffd2('0x2e')](db[_0xffd2('0x2f')][_0xffd2('0x30')]),[_0xffd2('0x31'),'updatedAt',_0xffd2('0x32'),_0xffd2('0x33')]);var _0x4fede3=![];if(_0x186134[_0xffd2('0x34')]['id']){delete _0x186134[_0xffd2('0x34')]['id'];}if(_['isNil'](_0x186134['body'][_0xffd2('0x35')])){return _0xac3520(_0x1fd7ba[_0xffd2('0x1a')](0x1f4,'from\x20is\x20mandatory'));}if(_[_0xffd2('0x36')](_0x186134['body']['body'])||_0x186134['body'][_0xffd2('0x34')]===''){return _0xac3520(_0x1fd7ba[_0xffd2('0x1a')](0x1f4,_0xffd2('0x37')));}if(_[_0xffd2('0x36')](_0x186134[_0xffd2('0x34')][_0xffd2('0x38')])){return _0xac3520(_0x1fd7ba[_0xffd2('0x1a')](0x1f4,_0xffd2('0x39')+_0x482b0c));}if(!_[_0xffd2('0x3a')](_0x482b0c,_0x186134[_0xffd2('0x34')][_0xffd2('0x38')])){return _0xac3520(_0x1fd7ba[_0xffd2('0x1a')](0x1f4,_0xffd2('0x3b')+_0x482b0c));}var _0x2db9f2={};_0x2db9f2[_0x186134[_0xffd2('0x34')][_0xffd2('0x38')]]=_0x186134[_0xffd2('0x34')][_0xffd2('0x35')];return db[_0xffd2('0x1f')][_0xffd2('0x2b')]({'where':{'id':_0x186134[_0xffd2('0x3c')]['id']},'include':[{'model':db['CmList'],'as':_0xffd2('0x3d'),'include':[{'model':db[_0xffd2('0x2f')],'as':_0xffd2('0x3e'),'where':_0x2db9f2,'limit':0x1,'order':[[_0xffd2('0x3f'),_0xffd2('0x40')]]}]},{'model':db[_0xffd2('0x41')],'as':'Applications'},{'model':db['MailServerOut'],'as':'Smtp'}]})[_0xffd2('0x28')](function(_0xe3b495){if(_0xe3b495&&_0xe3b495[_0xffd2('0x3d')]){var _0x3231fe=_0xe3b495[_0xffd2('0x42')]({'plain':!![]});_0x818fb8[_0xffd2('0x3c')]=_[_0xffd2('0x43')](_0x3231fe,[_0xffd2('0x44'),_0xffd2('0x3d')]);_0x818fb8['applications']=_0x3231fe[_0xffd2('0x44')];_0x818fb8[_0xffd2('0x45')]=_0x3231fe['List'];_0x818fb8['applications']=_['orderBy'](_0x818fb8[_0xffd2('0x46')],[_0xffd2('0x47')],['asc']);if(_0x818fb8['account']&&_0x818fb8[_0xffd2('0x3c')][_0xffd2('0x48')]){_0x818fb8[_0xffd2('0x46')]['push']({'id':0x0,'priority':_0x818fb8['applications'][_0xffd2('0x49')]+0x1,'app':'close','appdata':_0xffd2('0x48'),'interval':_0xffd2('0x4a')});}if(_0x818fb8[_0xffd2('0x3c')]['Applications']){delete _0x818fb8[_0xffd2('0x3c')][_0xffd2('0x44')];}if(_0x818fb8[_0xffd2('0x3c')][_0xffd2('0x3d')]){delete _0x818fb8[_0xffd2('0x3c')]['List'];}if(_0x3231fe['List']['Contacts']['length']){return _0x3231fe['List'][_0xffd2('0x3e')][0x0];}var _0x436071=_['defaults'](_0x186134[_0xffd2('0x34')],{'firstName':_0x186134[_0xffd2('0x34')][_0xffd2('0x35')],'ListId':_0x3231fe[_0xffd2('0x33')]});_0x436071[_0x186134[_0xffd2('0x34')][_0xffd2('0x38')]]=_0x186134[_0xffd2('0x34')]['from'];return db[_0xffd2('0x2f')][_0xffd2('0x4b')](_0x436071);}else{throw new Error(_0xffd2('0x4c'));}})[_0xffd2('0x28')](function(_0x83c82a){_0x818fb8[_0xffd2('0x4d')]=_0x83c82a;if(_0x83c82a){if(!_0x186134['body'][_0xffd2('0x1c')][_0xffd2('0x4e')]){_0x186134[_0xffd2('0x34')][_0xffd2('0x1c')][_0xffd2('0x4e')]=rs[_0xffd2('0x4f')]()+'\x20'+_0x186134['body'][_0xffd2('0x1c')][_0xffd2('0x35')];}var _0x4f6d3b={'ContactId':_0x83c82a['id'],'MailAccountId':_0x186134[_0xffd2('0x3c')]['id'],'inReplyTo':_0x186134[_0xffd2('0x34')]['message']['messageId'],'to':_0x186134[_0xffd2('0x34')]['message'][_0xffd2('0x35')],'cc':_0x186134[_0xffd2('0x34')][_0xffd2('0x1c')]['cc'],'subject':_0x186134['body'][_0xffd2('0x1c')]['subject'],'attach':_0x186134[_0xffd2('0x34')][_0xffd2('0x1c')][_0xffd2('0x50')],'lastMsgAt':moment()[_0xffd2('0x51')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db['MailInteraction'][_0xffd2('0x2b')]({'where':{'closed':![],'MailAccountId':_0x186134['account']['id']},'include':[{'model':db[_0xffd2('0x52')],'as':'Messages','attributes':[_0xffd2('0x4e')],'where':{'messageId':_0x186134['body'][_0xffd2('0x1c')][_0xffd2('0x53')]}}]})[_0xffd2('0x28')](function(_0x313314){if(_0x313314){return[_0x313314,![]];}return db[_0xffd2('0x54')][_0xffd2('0x4b')](_0x4f6d3b)[_0xffd2('0x28')](function(_0x51ee4d){return[_0x51ee4d,!![]];});});}else{throw new Error(_0xffd2('0x55'));}})[_0xffd2('0x56')](function(_0x280ba1,_0x5d388b){if(_0x280ba1){_0x4fede3=_0x5d388b;if(!_0x5d388b){return _0x280ba1[_0xffd2('0x57')]({'inReplyTo':_0x186134[_0xffd2('0x34')][_0xffd2('0x1c')][_0xffd2('0x4e')],'to':_0x186134['body'][_0xffd2('0x1c')][_0xffd2('0x35')],'cc':_0x186134['body'][_0xffd2('0x1c')]['cc'],'subject':_0x186134[_0xffd2('0x34')][_0xffd2('0x1c')][_0xffd2('0x58')],'attach':_0x280ba1[_0xffd2('0x50')]?_0x280ba1[_0xffd2('0x50')]:_0x186134[_0xffd2('0x34')][_0xffd2('0x1c')][_0xffd2('0x50')],'substatus':null,'substatusAt':moment()[_0xffd2('0x51')](_0xffd2('0x59')),'lastMsgAt':moment()[_0xffd2('0x51')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'});}else{return _0x280ba1;}}})[_0xffd2('0x28')](function(_0x52b59f){_0x818fb8[_0xffd2('0x5a')]=_0x52b59f[_0xffd2('0x42')]({'plain':!![]});_0x818fb8['interaction'][_0xffd2('0x5b')]=_0x4fede3;return db[_0xffd2('0x52')][_0xffd2('0x4b')]({'body':_0x186134['body']['body'],'MailAccountId':_0x186134[_0xffd2('0x3c')]['id'],'MailInteractionId':_0x52b59f['id'],'direction':'in','ContactId':_0x818fb8[_0xffd2('0x4d')]['id'],'messageId':_0x186134[_0xffd2('0x34')]['message'][_0xffd2('0x4e')],'from':_0x186134['body'][_0xffd2('0x1c')][_0xffd2('0x35')],'to':_0x186134[_0xffd2('0x34')]['message']['to'],'cc':_0x186134[_0xffd2('0x34')][_0xffd2('0x1c')]['cc'],'subject':_0x186134[_0xffd2('0x34')][_0xffd2('0x1c')][_0xffd2('0x58')],'attach':_0x186134[_0xffd2('0x34')]['message'][_0xffd2('0x50')],'Attachments':_0x186134[_0xffd2('0x34')][_0xffd2('0x1c')][_0xffd2('0x5c')],'originTo':_0x186134[_0xffd2('0x34')]['message'][_0xffd2('0x5d')],'originCc':_0x186134[_0xffd2('0x34')][_0xffd2('0x1c')]['originCc'],'bcc':_0x186134['body'][_0xffd2('0x1c')]['bcc'],'ChatWebsiteId':_0x186134[_0xffd2('0x34')][_0xffd2('0x1c')][_0xffd2('0x5e')]||null,'originChannel':_0x186134['body'][_0xffd2('0x1c')][_0xffd2('0x5f')]||_0xffd2('0x60'),'ChatOfflineMessageId':_0x186134[_0xffd2('0x34')][_0xffd2('0x1c')]['ChatOfflineMessageId']||null},{'include':[{'model':db['Attachment'],'as':_0xffd2('0x61')}]});})[_0xffd2('0x28')](function(_0xec483f){_0x818fb8['message']=_0xec483f;if(_0x818fb8[_0xffd2('0x5a')]['UserId']){return db[_0xffd2('0x62')][_0xffd2('0x2b')]({'attributes':['id','name'],'where':{'id':_0x818fb8[_0xffd2('0x5a')]['UserId']}})['then'](function(_0x39743f){if(_0x39743f){_0x818fb8[_0xffd2('0x46')][_0xffd2('0x63')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x39743f[_0xffd2('0x64')]+','+(_0x818fb8['account'][_0xffd2('0x65')]||0xa),'interval':_0xffd2('0x4a')});}return respondWithRpcPromise(_0xffd2('0x66'),_0xffd2('0x67'),_0x818fb8);});}return respondWithRpcPromise(_0xffd2('0x66'),'startRouting',_0x818fb8);})['then'](function(_0x24e25b){_0x3cf6a6(_0x24e25b);})['catch'](function(_0x4abb86){_0xac3520(_0x1fd7ba[_0xffd2('0x1a')](0x1f4,_0x4abb86['message']));});});}; \ No newline at end of file +var _0xec49=['Start','startRouting','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','redis','./mailAccount.socket','register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetMailAccount','findAll','options','raw','where','attributes','limit','map','include','model','debug','MailAccount','find','ShowMailAccount','NotifyMailAccount','body','mail','difference','keys','CmContact','rawAttributes','createdAt','updatedAt','CompanyId','ListId','from','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','account','List','Contacts','DESC','MailApplication','MailServerOut','Smtp','get','omit','applications','list','priority','asc','push','length','close','*,*,*,*','Applications','create','List\x20not\x20found','contact','messageId','generate','subject','attach','format','MailInteraction','MailMessage','Messages','Contact\x20not\x20found','YYYY-MM-DD\x20HH:mm:ss','interaction','created','attachments','originTo','originCc','bcc','ChatWebsiteId','originChannel','Email','Attachment','Attachments','UserId','User','name','unshift','agent','waitForTheAssignedAgent'];(function(_0x2fbd0e,_0x3460a9){var _0x481c9f=function(_0x4bc402){while(--_0x4bc402){_0x2fbd0e['push'](_0x2fbd0e['shift']());}};_0x481c9f(++_0x3460a9);}(_0xec49,0x6c));var _0x9ec4=function(_0x28f17b,_0x27ce52){_0x28f17b=_0x28f17b-0x0;var _0x167400=_0xec49[_0x28f17b];return _0x167400;};'use strict';var _=require('lodash');var util=require(_0x9ec4('0x0'));var moment=require(_0x9ec4('0x1'));var BPromise=require(_0x9ec4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9ec4('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9ec4('0x4'));var logger=require('../../config/logger')(_0x9ec4('0x5'));var config=require(_0x9ec4('0x6'));var jayson=require(_0x9ec4('0x7'));var client=jayson[_0x9ec4('0x8')][_0x9ec4('0x9')]({'port':0x232c});config['redis']=_[_0x9ec4('0xa')](config['redis'],{'host':_0x9ec4('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9ec4('0xc')]));require(_0x9ec4('0xd'))[_0x9ec4('0xe')](socket);function respondWithRpcPromise(_0x31c3ef,_0x170487,_0x3ab23a){return new BPromise(function(_0x2ace30,_0x3f2114){return client[_0x9ec4('0xf')](_0x31c3ef,_0x3ab23a)[_0x9ec4('0x10')](function(_0x3982a6){logger[_0x9ec4('0x11')](_0x9ec4('0x12'),_0x170487,_0x9ec4('0x13'));logger['debug']('MailAccount,\x20%s,\x20%s,\x20%s',_0x170487,_0x9ec4('0x13'),JSON[_0x9ec4('0x14')](_0x3982a6));if(_0x3982a6[_0x9ec4('0x15')]){if(_0x3982a6[_0x9ec4('0x15')][_0x9ec4('0x16')]===0x1f4){logger[_0x9ec4('0x15')](_0x9ec4('0x12'),_0x170487,_0x3982a6[_0x9ec4('0x15')][_0x9ec4('0x17')]);return _0x3f2114(_0x3982a6[_0x9ec4('0x15')][_0x9ec4('0x17')]);}logger['error'](_0x9ec4('0x12'),_0x170487,_0x3982a6['error'][_0x9ec4('0x17')]);return _0x2ace30(_0x3982a6['error'][_0x9ec4('0x17')]);}else{logger[_0x9ec4('0x11')](_0x9ec4('0x12'),_0x170487,'request\x20sent');_0x2ace30(_0x3982a6[_0x9ec4('0x18')][_0x9ec4('0x17')]);}})[_0x9ec4('0x19')](function(_0x201e48){logger[_0x9ec4('0x15')](_0x9ec4('0x12'),_0x170487,_0x201e48);_0x3f2114(_0x201e48);});});}exports[_0x9ec4('0x1a')]=function(_0x473166){var _0x6c1a1a=this;return new Promise(function(_0x26a107,_0x1cc30a){return db['MailAccount'][_0x9ec4('0x1b')]({'raw':_0x473166[_0x9ec4('0x1c')]?_0x473166[_0x9ec4('0x1c')][_0x9ec4('0x1d')]===undefined?!![]:![]:!![],'where':_0x473166[_0x9ec4('0x1c')]?_0x473166[_0x9ec4('0x1c')][_0x9ec4('0x1e')]||null:null,'attributes':_0x473166['options']?_0x473166[_0x9ec4('0x1c')][_0x9ec4('0x1f')]||null:null,'limit':_0x473166[_0x9ec4('0x1c')]?_0x473166[_0x9ec4('0x1c')][_0x9ec4('0x20')]||null:null,'include':_0x473166[_0x9ec4('0x1c')]?_0x473166['options']['include']?_[_0x9ec4('0x21')](_0x473166[_0x9ec4('0x1c')][_0x9ec4('0x22')],function(_0x406e88){return{'model':db[_0x406e88['model']],'as':_0x406e88['as'],'attributes':_0x406e88[_0x9ec4('0x1f')],'include':_0x406e88[_0x9ec4('0x22')]?_[_0x9ec4('0x21')](_0x406e88[_0x9ec4('0x22')],function(_0x1562fa){return{'model':db[_0x1562fa[_0x9ec4('0x23')]],'as':_0x1562fa['as'],'attributes':_0x1562fa[_0x9ec4('0x1f')],'include':_0x1562fa[_0x9ec4('0x22')]?_[_0x9ec4('0x21')](_0x1562fa[_0x9ec4('0x22')],function(_0x822ab2){return{'model':db[_0x822ab2['model']],'as':_0x822ab2['as'],'attributes':_0x822ab2[_0x9ec4('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x9ec4('0x10')](function(_0xd3f1d9){logger[_0x9ec4('0x11')](_0x9ec4('0x1a'),_0x473166);logger[_0x9ec4('0x24')](_0x9ec4('0x1a'),_0x473166,JSON[_0x9ec4('0x14')](_0xd3f1d9));_0x26a107(_0xd3f1d9);})['catch'](function(_0xf79c82){logger[_0x9ec4('0x15')](_0x9ec4('0x1a'),_0xf79c82[_0x9ec4('0x17')],_0x473166);_0x1cc30a(_0x6c1a1a[_0x9ec4('0x15')](0x1f4,_0xf79c82[_0x9ec4('0x17')]));});});};exports['ShowMailAccount']=function(_0x37fefb){var _0x5633d0=this;return new Promise(function(_0x743307,_0x2b70fd){return db[_0x9ec4('0x25')][_0x9ec4('0x26')]({'raw':_0x37fefb[_0x9ec4('0x1c')]?_0x37fefb['options'][_0x9ec4('0x1d')]===undefined?!![]:![]:!![],'where':_0x37fefb[_0x9ec4('0x1c')]?_0x37fefb[_0x9ec4('0x1c')][_0x9ec4('0x1e')]||null:null,'attributes':_0x37fefb[_0x9ec4('0x1c')]?_0x37fefb[_0x9ec4('0x1c')][_0x9ec4('0x1f')]||null:null,'include':_0x37fefb[_0x9ec4('0x1c')]?_0x37fefb['options'][_0x9ec4('0x22')]?_[_0x9ec4('0x21')](_0x37fefb[_0x9ec4('0x1c')]['include'],function(_0x5ee60c){return{'model':db[_0x5ee60c[_0x9ec4('0x23')]],'as':_0x5ee60c['as'],'attributes':_0x5ee60c[_0x9ec4('0x1f')],'include':_0x5ee60c[_0x9ec4('0x22')]?_['map'](_0x5ee60c[_0x9ec4('0x22')],function(_0x5f2209){return{'model':db[_0x5f2209[_0x9ec4('0x23')]],'as':_0x5f2209['as'],'attributes':_0x5f2209['attributes'],'include':_0x5f2209[_0x9ec4('0x22')]?_[_0x9ec4('0x21')](_0x5f2209[_0x9ec4('0x22')],function(_0xcd75a8){return{'model':db[_0xcd75a8[_0x9ec4('0x23')]],'as':_0xcd75a8['as'],'attributes':_0xcd75a8[_0x9ec4('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x9ec4('0x10')](function(_0x10782b){logger[_0x9ec4('0x11')](_0x9ec4('0x27'),_0x37fefb);logger[_0x9ec4('0x24')](_0x9ec4('0x27'),_0x37fefb,JSON[_0x9ec4('0x14')](_0x10782b));_0x743307(_0x10782b);})[_0x9ec4('0x19')](function(_0x312edd){logger[_0x9ec4('0x15')](_0x9ec4('0x27'),_0x312edd[_0x9ec4('0x17')],_0x37fefb);_0x2b70fd(_0x5633d0[_0x9ec4('0x15')](0x1f4,_0x312edd[_0x9ec4('0x17')]));});});};exports[_0x9ec4('0x28')]=function(_0x2c51fb){var _0x4b0472=this;return new Promise(function(_0x19799f,_0x19f656){var _0x5c53c4={'body':_0x2c51fb[_0x9ec4('0x29')],'channel':_0x9ec4('0x2a')};var _0x18073d=_[_0x9ec4('0x2b')](_[_0x9ec4('0x2c')](db[_0x9ec4('0x2d')][_0x9ec4('0x2e')]),[_0x9ec4('0x2f'),_0x9ec4('0x30'),_0x9ec4('0x31'),_0x9ec4('0x32')]);var _0x353a66=![];if(_0x2c51fb[_0x9ec4('0x29')]['id']){delete _0x2c51fb['body']['id'];}if(_['isNil'](_0x2c51fb[_0x9ec4('0x29')][_0x9ec4('0x33')])){return _0x19f656(_0x4b0472[_0x9ec4('0x15')](0x1f4,'from\x20is\x20mandatory'));}if(_[_0x9ec4('0x34')](_0x2c51fb[_0x9ec4('0x29')][_0x9ec4('0x29')])||_0x2c51fb['body']['body']===''){return _0x19f656(_0x4b0472[_0x9ec4('0x15')](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x9ec4('0x34')](_0x2c51fb[_0x9ec4('0x29')][_0x9ec4('0x35')])){return _0x19f656(_0x4b0472[_0x9ec4('0x15')](0x1f4,_0x9ec4('0x36')+_0x18073d));}if(!_[_0x9ec4('0x37')](_0x18073d,_0x2c51fb['body']['mapKey'])){return _0x19f656(_0x4b0472['error'](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x18073d));}var _0x15133e={};_0x15133e[_0x2c51fb[_0x9ec4('0x29')][_0x9ec4('0x35')]]=_0x2c51fb[_0x9ec4('0x29')]['from'];return db[_0x9ec4('0x25')][_0x9ec4('0x26')]({'where':{'id':_0x2c51fb[_0x9ec4('0x38')]['id']},'include':[{'model':db['CmList'],'as':_0x9ec4('0x39'),'include':[{'model':db[_0x9ec4('0x2d')],'as':_0x9ec4('0x3a'),'where':_0x15133e,'limit':0x1,'order':[['updatedAt',_0x9ec4('0x3b')]]}]},{'model':db[_0x9ec4('0x3c')],'as':'Applications'},{'model':db[_0x9ec4('0x3d')],'as':_0x9ec4('0x3e')}]})[_0x9ec4('0x10')](function(_0x250c7a){if(_0x250c7a&&_0x250c7a['List']){var _0x3cd99f=_0x250c7a[_0x9ec4('0x3f')]({'plain':!![]});_0x5c53c4[_0x9ec4('0x38')]=_[_0x9ec4('0x40')](_0x3cd99f,['Applications',_0x9ec4('0x39')]);_0x5c53c4[_0x9ec4('0x41')]=_0x3cd99f['Applications'];_0x5c53c4[_0x9ec4('0x42')]=_0x3cd99f[_0x9ec4('0x39')];_0x5c53c4['applications']=_['orderBy'](_0x5c53c4['applications'],[_0x9ec4('0x43')],[_0x9ec4('0x44')]);if(_0x5c53c4[_0x9ec4('0x38')]&&_0x5c53c4[_0x9ec4('0x38')]['autoclose']){_0x5c53c4[_0x9ec4('0x41')][_0x9ec4('0x45')]({'id':0x0,'priority':_0x5c53c4[_0x9ec4('0x41')][_0x9ec4('0x46')]+0x1,'app':_0x9ec4('0x47'),'appdata':'autoclose','interval':_0x9ec4('0x48')});}if(_0x5c53c4[_0x9ec4('0x38')][_0x9ec4('0x49')]){delete _0x5c53c4['account'][_0x9ec4('0x49')];}if(_0x5c53c4[_0x9ec4('0x38')][_0x9ec4('0x39')]){delete _0x5c53c4[_0x9ec4('0x38')][_0x9ec4('0x39')];}if(_0x3cd99f['List'][_0x9ec4('0x3a')][_0x9ec4('0x46')]){return _0x3cd99f[_0x9ec4('0x39')][_0x9ec4('0x3a')][0x0];}var _0x2f075b=_[_0x9ec4('0xa')](_0x2c51fb[_0x9ec4('0x29')],{'firstName':_0x2c51fb[_0x9ec4('0x29')][_0x9ec4('0x33')],'ListId':_0x3cd99f[_0x9ec4('0x32')]});_0x2f075b[_0x2c51fb[_0x9ec4('0x29')][_0x9ec4('0x35')]]=_0x2c51fb[_0x9ec4('0x29')][_0x9ec4('0x33')];return db[_0x9ec4('0x2d')][_0x9ec4('0x4a')](_0x2f075b);}else{throw new Error(_0x9ec4('0x4b'));}})[_0x9ec4('0x10')](function(_0x52212b){_0x5c53c4[_0x9ec4('0x4c')]=_0x52212b;if(_0x52212b){if(!_0x2c51fb[_0x9ec4('0x29')]['message']['messageId']){_0x2c51fb[_0x9ec4('0x29')][_0x9ec4('0x17')][_0x9ec4('0x4d')]=rs[_0x9ec4('0x4e')]()+'\x20'+_0x2c51fb[_0x9ec4('0x29')]['message'][_0x9ec4('0x33')];}var _0x50dc06={'ContactId':_0x52212b['id'],'MailAccountId':_0x2c51fb[_0x9ec4('0x38')]['id'],'inReplyTo':_0x2c51fb[_0x9ec4('0x29')][_0x9ec4('0x17')][_0x9ec4('0x4d')],'to':_0x2c51fb[_0x9ec4('0x29')][_0x9ec4('0x17')][_0x9ec4('0x33')],'cc':_0x2c51fb['body']['message']['cc'],'subject':_0x2c51fb[_0x9ec4('0x29')][_0x9ec4('0x17')][_0x9ec4('0x4f')],'attach':_0x2c51fb[_0x9ec4('0x29')][_0x9ec4('0x17')][_0x9ec4('0x50')],'lastMsgAt':moment()[_0x9ec4('0x51')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db[_0x9ec4('0x52')]['find']({'where':{'closed':![],'MailAccountId':_0x2c51fb[_0x9ec4('0x38')]['id']},'include':[{'model':db[_0x9ec4('0x53')],'as':_0x9ec4('0x54'),'attributes':[_0x9ec4('0x4d')],'where':{'messageId':_0x2c51fb['body'][_0x9ec4('0x17')]['inReplyTo']}}]})[_0x9ec4('0x10')](function(_0x46858e){if(_0x46858e){return[_0x46858e,![]];}return db['MailInteraction'][_0x9ec4('0x4a')](_0x50dc06)[_0x9ec4('0x10')](function(_0x1a48c5){return[_0x1a48c5,!![]];});});}else{throw new Error(_0x9ec4('0x55'));}})['spread'](function(_0x25eba5,_0x578636){if(_0x25eba5){_0x353a66=_0x578636;if(!_0x578636){return _0x25eba5['update']({'inReplyTo':_0x2c51fb[_0x9ec4('0x29')][_0x9ec4('0x17')][_0x9ec4('0x4d')],'to':_0x2c51fb['body'][_0x9ec4('0x17')][_0x9ec4('0x33')],'cc':_0x2c51fb[_0x9ec4('0x29')][_0x9ec4('0x17')]['cc'],'subject':_0x2c51fb['body']['message'][_0x9ec4('0x4f')],'attach':_0x25eba5[_0x9ec4('0x50')]?_0x25eba5[_0x9ec4('0x50')]:_0x2c51fb[_0x9ec4('0x29')]['message'][_0x9ec4('0x50')],'substatus':null,'substatusAt':moment()[_0x9ec4('0x51')](_0x9ec4('0x56')),'lastMsgAt':moment()['format'](_0x9ec4('0x56')),'lastMsgDirection':'in'});}else{return _0x25eba5;}}})[_0x9ec4('0x10')](function(_0x4225de){_0x5c53c4[_0x9ec4('0x57')]=_0x4225de[_0x9ec4('0x3f')]({'plain':!![]});_0x5c53c4['interaction'][_0x9ec4('0x58')]=_0x353a66;return db[_0x9ec4('0x53')]['create']({'body':_0x2c51fb[_0x9ec4('0x29')][_0x9ec4('0x29')],'MailAccountId':_0x2c51fb['account']['id'],'MailInteractionId':_0x4225de['id'],'direction':'in','ContactId':_0x5c53c4[_0x9ec4('0x4c')]['id'],'messageId':_0x2c51fb['body'][_0x9ec4('0x17')][_0x9ec4('0x4d')],'from':_0x2c51fb[_0x9ec4('0x29')][_0x9ec4('0x17')][_0x9ec4('0x33')],'to':_0x2c51fb[_0x9ec4('0x29')][_0x9ec4('0x17')]['to'],'cc':_0x2c51fb[_0x9ec4('0x29')][_0x9ec4('0x17')]['cc'],'subject':_0x2c51fb['body'][_0x9ec4('0x17')][_0x9ec4('0x4f')],'attach':_0x2c51fb[_0x9ec4('0x29')][_0x9ec4('0x17')]['attach'],'Attachments':_0x2c51fb[_0x9ec4('0x29')][_0x9ec4('0x17')][_0x9ec4('0x59')],'originTo':_0x2c51fb[_0x9ec4('0x29')][_0x9ec4('0x17')][_0x9ec4('0x5a')],'originCc':_0x2c51fb[_0x9ec4('0x29')]['message'][_0x9ec4('0x5b')],'bcc':_0x2c51fb[_0x9ec4('0x29')]['message'][_0x9ec4('0x5c')],'ChatWebsiteId':_0x2c51fb[_0x9ec4('0x29')][_0x9ec4('0x17')][_0x9ec4('0x5d')]||null,'originChannel':_0x2c51fb['body'][_0x9ec4('0x17')][_0x9ec4('0x5e')]||_0x9ec4('0x5f'),'ChatOfflineMessageId':_0x2c51fb[_0x9ec4('0x29')]['message']['ChatOfflineMessageId']||null},{'include':[{'model':db[_0x9ec4('0x60')],'as':_0x9ec4('0x61')}]});})[_0x9ec4('0x10')](function(_0x52b997){_0x5c53c4[_0x9ec4('0x17')]=_0x52b997;if(_0x5c53c4[_0x9ec4('0x57')][_0x9ec4('0x62')]){return db[_0x9ec4('0x63')]['find']({'attributes':['id',_0x9ec4('0x64')],'where':{'id':_0x5c53c4[_0x9ec4('0x57')][_0x9ec4('0x62')]}})[_0x9ec4('0x10')](function(_0x5dab2b){if(_0x5dab2b){_0x5c53c4[_0x9ec4('0x41')][_0x9ec4('0x65')]({'id':0x0,'priority':0x0,'app':_0x9ec4('0x66'),'appdata':_0x5dab2b[_0x9ec4('0x64')]+','+(_0x5c53c4[_0x9ec4('0x38')][_0x9ec4('0x67')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x9ec4('0x68'),_0x9ec4('0x69'),_0x5c53c4);});}return respondWithRpcPromise(_0x9ec4('0x68'),_0x9ec4('0x69'),_0x5c53c4);})['then'](function(_0x522809){_0x19799f(_0x522809);})['catch'](function(_0x15632c){_0x19f656(_0x4b0472[_0x9ec4('0x15')](0x1f4,_0x15632c[_0x9ec4('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 6763435..0a53848 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 _0xf3a8=['length','mailAccount:','save','remove','emit','register'];(function(_0x5db96a,_0x60039){var _0x13fdb0=function(_0x1efab0){while(--_0x1efab0){_0x5db96a['push'](_0x5db96a['shift']());}};_0x13fdb0(++_0x60039);}(_0xf3a8,0xf2));var _0x8f3a=function(_0x224d19,_0x39cde7){_0x224d19=_0x224d19-0x0;var _0x212137=_0xf3a8[_0x224d19];return _0x212137;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=[_0x8f3a('0x0'),_0x8f3a('0x1'),'update'];function createListener(_0xa87ecd,_0x4a1bc3){return function(_0x5c0cbb){_0x4a1bc3[_0x8f3a('0x2')](_0xa87ecd,_0x5c0cbb);};}function removeListener(_0x48673f,_0x38fe23){return function(){MailAccountEvents['removeListener'](_0x48673f,_0x38fe23);};}exports[_0x8f3a('0x3')]=function(_0x3d6e2d){for(var _0x109997=0x0,_0x32bb3a=events[_0x8f3a('0x4')];_0x109997<_0x32bb3a;_0x109997++){var _0x2e290d=events[_0x109997];var _0x3dc1ea=createListener(_0x8f3a('0x5')+_0x2e290d,_0x3d6e2d);MailAccountEvents['on'](_0x2e290d,_0x3dc1ea);}}; \ No newline at end of file +var _0x3164=['update','emit','removeListener','register','mailAccount:','./mailAccount.events','save','remove'];(function(_0x6addb5,_0x4706a9){var _0x1d8085=function(_0x2a09ec){while(--_0x2a09ec){_0x6addb5['push'](_0x6addb5['shift']());}};_0x1d8085(++_0x4706a9);}(_0x3164,0x85));var _0x4316=function(_0x3bc255,_0x5712b0){_0x3bc255=_0x3bc255-0x0;var _0x14e4fc=_0x3164[_0x3bc255];return _0x14e4fc;};'use strict';var MailAccountEvents=require(_0x4316('0x0'));var events=[_0x4316('0x1'),_0x4316('0x2'),_0x4316('0x3')];function createListener(_0x343ae7,_0x1821ca){return function(_0x345a8f){_0x1821ca[_0x4316('0x4')](_0x343ae7,_0x345a8f);};}function removeListener(_0x102cfe,_0xb7cb37){return function(){MailAccountEvents[_0x4316('0x5')](_0x102cfe,_0xb7cb37);};}exports[_0x4316('0x6')]=function(_0x3f82c4){for(var _0x364941=0x0,_0x5ed321=events['length'];_0x364941<_0x5ed321;_0x364941++){var _0x375ce2=events[_0x364941];var _0x242b12=createListener(_0x4316('0x7')+_0x375ce2,_0x3f82c4);MailAccountEvents['on'](_0x375ce2,_0x242b12);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 697cb5a..b6aa517 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 _0x4d85=['get','/:id','isAuthenticated','show','put','update','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller'];(function(_0x440133,_0x9576ce){var _0x3847b8=function(_0x9b3d76){while(--_0x9b3d76){_0x440133['push'](_0x440133['shift']());}};_0x3847b8(++_0x9576ce);}(_0x4d85,0x15c));var _0x54d8=function(_0x3aaa0f,_0x24d22f){_0x3aaa0f=_0x3aaa0f-0x0;var _0x555de6=_0x4d85[_0x3aaa0f];return _0x555de6;};'use strict';var multer=require('multer');var util=require(_0x54d8('0x0'));var path=require(_0x54d8('0x1'));var timeout=require('connect-timeout');var express=require(_0x54d8('0x2'));var router=express[_0x54d8('0x3')]();var fs_extra=require(_0x54d8('0x4'));var auth=require(_0x54d8('0x5'));var interaction=require(_0x54d8('0x6'));var config=require(_0x54d8('0x7'));var controller=require(_0x54d8('0x8'));router[_0x54d8('0x9')](_0x54d8('0xa'),auth[_0x54d8('0xb')](),controller[_0x54d8('0xc')]);router[_0x54d8('0xd')](_0x54d8('0xa'),auth[_0x54d8('0xb')](),controller[_0x54d8('0xe')]);router['delete'](_0x54d8('0xa'),auth[_0x54d8('0xb')](),controller[_0x54d8('0xf')]);module[_0x54d8('0x10')]=router; \ No newline at end of file +var _0xbe3d=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','put','delete','destroy','util','path','connect-timeout'];(function(_0x4b3172,_0x470bd5){var _0x3d67c3=function(_0x1fa0f3){while(--_0x1fa0f3){_0x4b3172['push'](_0x4b3172['shift']());}};_0x3d67c3(++_0x470bd5);}(_0xbe3d,0x66));var _0xdbe3=function(_0x205b48,_0x366c2c){_0x205b48=_0x205b48-0x0;var _0xa2d878=_0xbe3d[_0x205b48];return _0xa2d878;};'use strict';var multer=require('multer');var util=require(_0xdbe3('0x0'));var path=require(_0xdbe3('0x1'));var timeout=require(_0xdbe3('0x2'));var express=require('express');var router=express[_0xdbe3('0x3')]();var fs_extra=require(_0xdbe3('0x4'));var auth=require(_0xdbe3('0x5'));var interaction=require(_0xdbe3('0x6'));var config=require(_0xdbe3('0x7'));var controller=require('./mailApplication.controller');router[_0xdbe3('0x8')](_0xdbe3('0x9'),auth[_0xdbe3('0xa')](),controller[_0xdbe3('0xb')]);router[_0xdbe3('0xc')]('/:id',auth[_0xdbe3('0xa')](),controller['update']);router[_0xdbe3('0xd')](_0xdbe3('0x9'),auth[_0xdbe3('0xa')](),controller[_0xdbe3('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index df344b8..d6fa48d 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 _0x53b8=['STRING','*,*,*,*','sequelize','exports','INTEGER','TEXT'];(function(_0xffc56b,_0x5caa71){var _0xa0731b=function(_0x2f8357){while(--_0x2f8357){_0xffc56b['push'](_0xffc56b['shift']());}};_0xa0731b(++_0x5caa71);}(_0x53b8,0xf8));var _0x853b=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x53b8[_0x167cc1];return _0x10bc4b;};'use strict';var Sequelize=require(_0x853b('0x0'));module[_0x853b('0x1')]={'priority':{'type':Sequelize[_0x853b('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x853b('0x3')]()},'description':{'type':Sequelize[_0x853b('0x4')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x853b('0x5')}}; \ No newline at end of file +var _0xf66b=['STRING','noop','TEXT','*,*,*,*','exports'];(function(_0x13edb1,_0x32d69a){var _0x3fa656=function(_0x5ba395){while(--_0x5ba395){_0x13edb1['push'](_0x13edb1['shift']());}};_0x3fa656(++_0x32d69a);}(_0xf66b,0x180));var _0xbf66=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xf66b[_0x13d07a];return _0x5ee0ee;};'use strict';var Sequelize=require('sequelize');module[_0xbf66('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xbf66('0x1')],'allowNull':![],'defaultValue':_0xbf66('0x2')},'appdata':{'type':Sequelize[_0xbf66('0x3')]()},'description':{'type':Sequelize[_0xbf66('0x1')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xbf66('0x4')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index da9e9b8..f229159 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(_0x14647d,_0x20a244){var _0x3a0cae=function(_0x6f6909){while(--_0x6f6909){_0x14647d['push'](_0x14647d['shift']());}};_0x3a0cae(++_0x20a244);}(_0x9c44,0x178));var _0x49c4=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x9c44[_0x1d9aa0];return _0x226868;};'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 _0xb43b=['name','status','send','show','params','keys','MailApplication','rawAttributes','query','intersection','model','fields','attributes','length','includeAll','merge','options','find','then','catch','body','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','undefined','count','offset','limit','set','Content-Range','json','apply','reject','update','destroy','sendStatus'];(function(_0x1ead1d,_0x15b2d4){var _0x4e6075=function(_0x4418d5){while(--_0x4418d5){_0x1ead1d['push'](_0x1ead1d['shift']());}};_0x4e6075(++_0x15b2d4);}(_0xb43b,0x1b2));var _0xbb43=function(_0x4f9ae6,_0x1c8dda){_0x4f9ae6=_0x4f9ae6-0x0;var _0x1dd4c2=_0xb43b[_0x4f9ae6];return _0x1dd4c2;};'use strict';var emlformat=require(_0xbb43('0x0'));var rimraf=require(_0xbb43('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbb43('0x2'));var rp=require(_0xbb43('0x3'));var moment=require(_0xbb43('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xbb43('0x5'));var util=require(_0xbb43('0x6'));var path=require(_0xbb43('0x7'));var sox=require(_0xbb43('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb43('0x9'));var _=require('lodash');var squel=require(_0xbb43('0xa'));var crypto=require(_0xbb43('0xb'));var jsforce=require(_0xbb43('0xc'));var deskjs=require(_0xbb43('0xd'));var toCsv=require(_0xbb43('0xe'));var querystring=require('querystring');var Papa=require(_0xbb43('0xf'));var Redis=require(_0xbb43('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xbb43('0x11'));var as=require(_0xbb43('0x12'));var hardwareService=require(_0xbb43('0x13'));var logger=require(_0xbb43('0x14'))(_0xbb43('0x15'));var utils=require(_0xbb43('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xbb43('0x17'));var db=require(_0xbb43('0x18'))['db'];function respondWithStatusCode(_0x50e2c0,_0x578392){_0x578392=_0x578392||0xcc;return function(_0x41e7e5){if(_0x41e7e5){return _0x50e2c0['sendStatus'](_0x578392);}return _0x50e2c0['status'](_0x578392)[_0xbb43('0x19')]();};}function respondWithResult(_0x5a509f,_0x68d45d){_0x68d45d=_0x68d45d||0xc8;return function(_0x43021d){if(_0x43021d){return _0x5a509f['status'](_0x68d45d)['json'](_0x43021d);}};}function respondWithFilteredResult(_0x4d5bcf,_0x338120){return function(_0x2abce0){if(_0x2abce0){var _0x57bd1d=typeof _0x338120['offset']===_0xbb43('0x1a')&&typeof _0x338120['limit']==='undefined';var _0x2b0797=_0x2abce0[_0xbb43('0x1b')];var _0x2e3b43=_0x57bd1d?0x0:_0x338120['offset'];var _0x1c16d7=_0x57bd1d?_0x2abce0['count']:_0x338120[_0xbb43('0x1c')]+_0x338120[_0xbb43('0x1d')];var _0x4dfc54;if(_0x1c16d7>=_0x2b0797){_0x1c16d7=_0x2b0797;_0x4dfc54=0xc8;}else{_0x4dfc54=0xce;}_0x4d5bcf['status'](_0x4dfc54);return _0x4d5bcf[_0xbb43('0x1e')](_0xbb43('0x1f'),_0x2e3b43+'-'+_0x1c16d7+'/'+_0x2b0797)[_0xbb43('0x20')](_0x2abce0);}return null;};}function patchUpdates(_0x2bf2d4){return function(_0x5bcce7){try{jsonpatch[_0xbb43('0x21')](_0x5bcce7,_0x2bf2d4,!![]);}catch(_0x5f4416){return BPromise[_0xbb43('0x22')](_0x5f4416);}return _0x5bcce7['save']();};}function saveUpdates(_0x2f5e31,_0x565256){return function(_0x3f323e){if(_0x3f323e){return _0x3f323e[_0xbb43('0x23')](_0x2f5e31)['then'](function(_0x1d0768){return _0x1d0768;});}return null;};}function removeEntity(_0x4dfb7f,_0xf24e60){return function(_0x298ce2){if(_0x298ce2){return _0x298ce2[_0xbb43('0x24')]()['then'](function(){_0x4dfb7f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x269ca5,_0x32d7f0){return function(_0x5d8310){if(!_0x5d8310){_0x269ca5[_0xbb43('0x25')](0x194);}return _0x5d8310;};}function handleError(_0x2da653,_0x226827){_0x226827=_0x226827||0x1f4;return function(_0x3874fb){logger['error'](_0x3874fb['stack']);if(_0x3874fb[_0xbb43('0x26')]){delete _0x3874fb[_0xbb43('0x26')];}_0x2da653[_0xbb43('0x27')](_0x226827)[_0xbb43('0x28')](_0x3874fb);};}exports[_0xbb43('0x29')]=function(_0x40b04b,_0x21d386){var _0x473828={'raw':!![],'where':{'id':_0x40b04b[_0xbb43('0x2a')]['id']}},_0x539730={};_0x539730['model']=_[_0xbb43('0x2b')](db[_0xbb43('0x2c')][_0xbb43('0x2d')]);_0x539730[_0xbb43('0x2e')]=_['keys'](_0x40b04b[_0xbb43('0x2e')]);_0x539730['filters']=_['intersection'](_0x539730['model'],_0x539730[_0xbb43('0x2e')]);_0x473828['attributes']=_[_0xbb43('0x2f')](_0x539730[_0xbb43('0x30')],qs[_0xbb43('0x31')](_0x40b04b['query'][_0xbb43('0x31')]));_0x473828[_0xbb43('0x32')]=_0x473828[_0xbb43('0x32')][_0xbb43('0x33')]?_0x473828[_0xbb43('0x32')]:_0x539730[_0xbb43('0x30')];if(_0x40b04b[_0xbb43('0x2e')][_0xbb43('0x34')]){_0x473828['include']=[{'all':!![]}];}_0x473828=_[_0xbb43('0x35')]({},_0x473828,_0x40b04b[_0xbb43('0x36')]);return db[_0xbb43('0x2c')][_0xbb43('0x37')](_0x473828)[_0xbb43('0x38')](handleEntityNotFound(_0x21d386,null))[_0xbb43('0x38')](respondWithResult(_0x21d386,null))[_0xbb43('0x39')](handleError(_0x21d386,null));};exports[_0xbb43('0x23')]=function(_0x349a83,_0x57105c){if(_0x349a83[_0xbb43('0x3a')]['id']){delete _0x349a83[_0xbb43('0x3a')]['id'];}return db[_0xbb43('0x2c')][_0xbb43('0x37')]({'where':{'id':_0x349a83[_0xbb43('0x2a')]['id']}})[_0xbb43('0x38')](handleEntityNotFound(_0x57105c,null))['then'](saveUpdates(_0x349a83[_0xbb43('0x3a')],null))[_0xbb43('0x38')](respondWithResult(_0x57105c,null))['catch'](handleError(_0x57105c,null));};exports[_0xbb43('0x24')]=function(_0x2c9a7c,_0x11d384){return db['MailApplication']['find']({'where':{'id':_0x2c9a7c['params']['id']}})[_0xbb43('0x38')](handleEntityNotFound(_0x11d384,null))[_0xbb43('0x38')](removeEntity(_0x11d384,null))['catch'](handleError(_0x11d384,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index da014a0..a3d94c1 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 _0x7597=['define','MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./mailApplication.attributes','exports'];(function(_0x5a704d,_0x4082d8){var _0x1f76e1=function(_0x3d20c0){while(--_0x3d20c0){_0x5a704d['push'](_0x5a704d['shift']());}};_0x1f76e1(++_0x4082d8);}(_0x7597,0x1c5));var _0x7759=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x7597[_0x4d613c];return _0x301fe3;};'use strict';var _=require(_0x7759('0x0'));var util=require('util');var logger=require(_0x7759('0x1'))(_0x7759('0x2'));var moment=require(_0x7759('0x3'));var BPromise=require('bluebird');var rp=require(_0x7759('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7759('0x5'));var config=require(_0x7759('0x6'));var attributes=require(_0x7759('0x7'));module[_0x7759('0x8')]=function(_0x1cf28a,_0x3d0457){return _0x1cf28a[_0x7759('0x9')](_0x7759('0xa'),attributes,{'tableName':_0x7759('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7759('0xc'),'collate':_0x7759('0xd')});}; \ No newline at end of file +var _0x2dc2=['moment','bluebird','path','../../config/environment','define','MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x247705,_0x52b3d0){var _0x1edb0f=function(_0xf9f794){while(--_0xf9f794){_0x247705['push'](_0x247705['shift']());}};_0x1edb0f(++_0x52b3d0);}(_0x2dc2,0x11a));var _0x22dc=function(_0xdc37a1,_0x53ebb9){_0xdc37a1=_0xdc37a1-0x0;var _0x99b4fe=_0x2dc2[_0xdc37a1];return _0x99b4fe;};'use strict';var _=require(_0x22dc('0x0'));var util=require(_0x22dc('0x1'));var logger=require(_0x22dc('0x2'))(_0x22dc('0x3'));var moment=require(_0x22dc('0x4'));var BPromise=require(_0x22dc('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x22dc('0x6'));var rimraf=require('rimraf');var config=require(_0x22dc('0x7'));var attributes=require('./mailApplication.attributes');module['exports']=function(_0x5a4012,_0x3cedd4){return _0x5a4012[_0x22dc('0x8')](_0x22dc('0x9'),attributes,{'tableName':_0x22dc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x22dc('0xb'),'collate':_0x22dc('0xc')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 3391d19..b1d9e76 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 _0x67ac=['debug','stringify','error','code','message','UpdateMailApplication','MailApplication','update','options','where','attributes','limit','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','MailApplication,\x20%s,\x20%s','request\x20sent'];(function(_0xe4852c,_0x1e02f8){var _0x405528=function(_0x45be74){while(--_0x45be74){_0xe4852c['push'](_0xe4852c['shift']());}};_0x405528(++_0x1e02f8);}(_0x67ac,0x7d));var _0xc67a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x67ac[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc67a('0x0'));var util=require(_0xc67a('0x1'));var moment=require('moment');var BPromise=require(_0xc67a('0x2'));var rs=require(_0xc67a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc67a('0x4'))['db'];var utils=require(_0xc67a('0x5'));var logger=require('../../config/logger')(_0xc67a('0x6'));var config=require(_0xc67a('0x7'));var jayson=require(_0xc67a('0x8'));var client=jayson[_0xc67a('0x9')][_0xc67a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x79f6a5,_0x15b580,_0x880820){return new BPromise(function(_0x566008,_0x47126a){return client['request'](_0x79f6a5,_0x880820)[_0xc67a('0xb')](function(_0x3897f7){logger[_0xc67a('0xc')](_0xc67a('0xd'),_0x15b580,_0xc67a('0xe'));logger[_0xc67a('0xf')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x15b580,_0xc67a('0xe'),JSON[_0xc67a('0x10')](_0x3897f7));if(_0x3897f7[_0xc67a('0x11')]){if(_0x3897f7[_0xc67a('0x11')][_0xc67a('0x12')]===0x1f4){logger['error'](_0xc67a('0xd'),_0x15b580,_0x3897f7[_0xc67a('0x11')][_0xc67a('0x13')]);return _0x47126a(_0x3897f7[_0xc67a('0x11')]['message']);}logger[_0xc67a('0x11')](_0xc67a('0xd'),_0x15b580,_0x3897f7[_0xc67a('0x11')][_0xc67a('0x13')]);return _0x566008(_0x3897f7['error'][_0xc67a('0x13')]);}else{logger[_0xc67a('0xc')](_0xc67a('0xd'),_0x15b580,'request\x20sent');_0x566008(_0x3897f7['result'][_0xc67a('0x13')]);}})['catch'](function(_0x5b6a60){logger['error'](_0xc67a('0xd'),_0x15b580,_0x5b6a60);_0x47126a(_0x5b6a60);});});}exports[_0xc67a('0x14')]=function(_0x4506ab){var _0x48fe21=this;return new Promise(function(_0x3d23d6,_0x2ff426){return db[_0xc67a('0x15')][_0xc67a('0x16')](_0x4506ab['body'],{'raw':_0x4506ab[_0xc67a('0x17')]?_0x4506ab['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4506ab['options']?_0x4506ab[_0xc67a('0x17')][_0xc67a('0x18')]||null:null,'attributes':_0x4506ab['options']?_0x4506ab['options'][_0xc67a('0x19')]||null:null,'limit':_0x4506ab[_0xc67a('0x17')]?_0x4506ab[_0xc67a('0x17')][_0xc67a('0x1a')]||null:null})[_0xc67a('0xb')](function(_0x5a81b6){logger[_0xc67a('0xc')]('UpdateMailApplication',_0x4506ab);logger[_0xc67a('0xf')](_0xc67a('0x14'),_0x4506ab,JSON[_0xc67a('0x10')](_0x5a81b6));_0x3d23d6(_0x5a81b6);})[_0xc67a('0x1b')](function(_0x1e3a0d){logger[_0xc67a('0x11')]('UpdateMailApplication',_0x1e3a0d[_0xc67a('0x13')],_0x4506ab);_0x2ff426(_0x48fe21['error'](0x1f4,_0x1e3a0d[_0xc67a('0x13')]));});});}; \ No newline at end of file +var _0xeaf8=['stringify','error','message','result','catch','UpdateMailApplication','MailApplication','options','raw','limit','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s'];(function(_0x237d67,_0x4ff2db){var _0x292dfb=function(_0x565a7d){while(--_0x565a7d){_0x237d67['push'](_0x237d67['shift']());}};_0x292dfb(++_0x4ff2db);}(_0xeaf8,0x192));var _0x8eaf=function(_0x48a10f,_0x38cd51){_0x48a10f=_0x48a10f-0x0;var _0x15c5f6=_0xeaf8[_0x48a10f];return _0x15c5f6;};'use strict';var _=require(_0x8eaf('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8eaf('0x1'));var rs=require(_0x8eaf('0x2'));var fs=require('fs');var Redis=require(_0x8eaf('0x3'));var db=require(_0x8eaf('0x4'))['db'];var utils=require(_0x8eaf('0x5'));var logger=require(_0x8eaf('0x6'))('rpc');var config=require(_0x8eaf('0x7'));var jayson=require(_0x8eaf('0x8'));var client=jayson[_0x8eaf('0x9')][_0x8eaf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3600f7,_0xea7a3f,_0x206ccc){return new BPromise(function(_0x55ddac,_0x4f2b04){return client[_0x8eaf('0xb')](_0x3600f7,_0x206ccc)[_0x8eaf('0xc')](function(_0x195c15){logger[_0x8eaf('0xd')](_0x8eaf('0xe'),_0xea7a3f,_0x8eaf('0xf'));logger[_0x8eaf('0x10')](_0x8eaf('0x11'),_0xea7a3f,_0x8eaf('0xf'),JSON[_0x8eaf('0x12')](_0x195c15));if(_0x195c15[_0x8eaf('0x13')]){if(_0x195c15[_0x8eaf('0x13')]['code']===0x1f4){logger[_0x8eaf('0x13')](_0x8eaf('0xe'),_0xea7a3f,_0x195c15[_0x8eaf('0x13')][_0x8eaf('0x14')]);return _0x4f2b04(_0x195c15[_0x8eaf('0x13')][_0x8eaf('0x14')]);}logger[_0x8eaf('0x13')](_0x8eaf('0xe'),_0xea7a3f,_0x195c15[_0x8eaf('0x13')][_0x8eaf('0x14')]);return _0x55ddac(_0x195c15[_0x8eaf('0x13')]['message']);}else{logger[_0x8eaf('0xd')](_0x8eaf('0xe'),_0xea7a3f,_0x8eaf('0xf'));_0x55ddac(_0x195c15[_0x8eaf('0x15')][_0x8eaf('0x14')]);}})[_0x8eaf('0x16')](function(_0x33a6ad){logger[_0x8eaf('0x13')](_0x8eaf('0xe'),_0xea7a3f,_0x33a6ad);_0x4f2b04(_0x33a6ad);});});}exports[_0x8eaf('0x17')]=function(_0x2f1678){var _0x3e0686=this;return new Promise(function(_0x5c1261,_0x4133fb){return db[_0x8eaf('0x18')]['update'](_0x2f1678['body'],{'raw':_0x2f1678[_0x8eaf('0x19')]?_0x2f1678['options'][_0x8eaf('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2f1678[_0x8eaf('0x19')]?_0x2f1678['options']['where']||null:null,'attributes':_0x2f1678[_0x8eaf('0x19')]?_0x2f1678['options']['attributes']||null:null,'limit':_0x2f1678['options']?_0x2f1678[_0x8eaf('0x19')][_0x8eaf('0x1b')]||null:null})[_0x8eaf('0xc')](function(_0x30f5cd){logger[_0x8eaf('0xd')](_0x8eaf('0x17'),_0x2f1678);logger['debug'](_0x8eaf('0x17'),_0x2f1678,JSON['stringify'](_0x30f5cd));_0x5c1261(_0x30f5cd);})[_0x8eaf('0x16')](function(_0x32aca9){logger['error'](_0x8eaf('0x17'),_0x32aca9['message'],_0x2f1678);_0x4133fb(_0x3e0686[_0x8eaf('0x13')](0x1f4,_0x32aca9[_0x8eaf('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 4cccafc..29aae3b 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 _0x3c62=['./mailInteraction.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/messages','getMessages','download','post','create','addMessage','/:id/tags','mail','mailinteraction:addtags','addTags','tracked','update','delete','mailinteraction:destroy','destroy','removeTags','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x34d387,_0xdfae87){var _0xdff3b0=function(_0x295861){while(--_0x295861){_0x34d387['push'](_0x34d387['shift']());}};_0xdff3b0(++_0xdfae87);}(_0x3c62,0x99));var _0x23c6=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0x3c62[_0x491a7f];return _0x3d8f44;};'use strict';var express=require('express');var router=express[_0x23c6('0x0')]();var auth=require(_0x23c6('0x1'));var interaction=require(_0x23c6('0x2'));var controller=require(_0x23c6('0x3'));router[_0x23c6('0x4')]('/',auth[_0x23c6('0x5')](),controller['index']);router[_0x23c6('0x4')](_0x23c6('0x6'),auth[_0x23c6('0x5')](),controller[_0x23c6('0x7')]);router[_0x23c6('0x4')](_0x23c6('0x8'),auth[_0x23c6('0x5')](),controller[_0x23c6('0x9')]);router[_0x23c6('0x4')](_0x23c6('0xa'),auth['isAuthenticated'](),controller[_0x23c6('0xb')]);router['get']('/:id/download',auth[_0x23c6('0x5')](),controller[_0x23c6('0xc')]);router[_0x23c6('0xd')]('/',auth['isAuthenticated'](),controller[_0x23c6('0xe')]);router['post'](_0x23c6('0xa'),auth[_0x23c6('0x5')](),controller[_0x23c6('0xf')]);router[_0x23c6('0xd')](_0x23c6('0x10'),auth['isAuthenticated'](),interaction['tracked'](_0x23c6('0x11'),_0x23c6('0x12')),controller[_0x23c6('0x13')]);router['put'](_0x23c6('0x8'),auth[_0x23c6('0x5')](),interaction[_0x23c6('0x14')]('mail','mailinteraction:update'),controller[_0x23c6('0x15')]);router[_0x23c6('0x16')]('/:id',auth[_0x23c6('0x5')](),interaction[_0x23c6('0x14')](_0x23c6('0x11'),_0x23c6('0x17')),controller[_0x23c6('0x18')]);router[_0x23c6('0x16')](_0x23c6('0x10'),auth[_0x23c6('0x5')](),controller[_0x23c6('0x19')]);module['exports']=router; \ No newline at end of file +var _0x2b47=['show','/:id/messages','getMessages','/:id/download','create','addMessage','post','/:id/tags','tracked','mailinteraction:addtags','put','mail','mailinteraction:update','update','mailinteraction:destroy','destroy','delete','exports','Router','../../components/interaction/service','./mailInteraction.controller','isAuthenticated','index','get','describe','/:id'];(function(_0x17726c,_0x5151b3){var _0xb1472c=function(_0x56a323){while(--_0x56a323){_0x17726c['push'](_0x17726c['shift']());}};_0xb1472c(++_0x5151b3);}(_0x2b47,0x198));var _0x72b4=function(_0x2db272,_0x5c7dd6){_0x2db272=_0x2db272-0x0;var _0x346892=_0x2b47[_0x2db272];return _0x346892;};'use strict';var express=require('express');var router=express[_0x72b4('0x0')]();var auth=require('../../components/auth/service');var interaction=require(_0x72b4('0x1'));var controller=require(_0x72b4('0x2'));router['get']('/',auth[_0x72b4('0x3')](),controller[_0x72b4('0x4')]);router[_0x72b4('0x5')]('/describe',auth['isAuthenticated'](),controller[_0x72b4('0x6')]);router['get'](_0x72b4('0x7'),auth[_0x72b4('0x3')](),controller[_0x72b4('0x8')]);router[_0x72b4('0x5')](_0x72b4('0x9'),auth[_0x72b4('0x3')](),controller[_0x72b4('0xa')]);router[_0x72b4('0x5')](_0x72b4('0xb'),auth[_0x72b4('0x3')](),controller['download']);router['post']('/',auth['isAuthenticated'](),controller[_0x72b4('0xc')]);router['post'](_0x72b4('0x9'),auth['isAuthenticated'](),controller[_0x72b4('0xd')]);router[_0x72b4('0xe')](_0x72b4('0xf'),auth[_0x72b4('0x3')](),interaction[_0x72b4('0x10')]('mail',_0x72b4('0x11')),controller['addTags']);router[_0x72b4('0x12')](_0x72b4('0x7'),auth['isAuthenticated'](),interaction[_0x72b4('0x10')](_0x72b4('0x13'),_0x72b4('0x14')),controller[_0x72b4('0x15')]);router['delete']('/:id',auth[_0x72b4('0x3')](),interaction[_0x72b4('0x10')](_0x72b4('0x13'),_0x72b4('0x16')),controller[_0x72b4('0x17')]);router[_0x72b4('0x18')](_0x72b4('0xf'),auth[_0x72b4('0x3')](),controller['removeTags']);module[_0x72b4('0x19')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 5bc6195..27423f1 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 _0x6fff=['DATE','STRING','TEXT','long','out','ENUM','iconv','BOOLEAN'];(function(_0x4b775b,_0x2aadc6){var _0xf84d39=function(_0x55ac96){while(--_0x55ac96){_0x4b775b['push'](_0x4b775b['shift']());}};_0xf84d39(++_0x2aadc6);}(_0x6fff,0x1ce));var _0xf6ff=function(_0x2e459b,_0x124329){_0x2e459b=_0x2e459b-0x0;var _0x20c3e9=_0x6fff[_0x2e459b];return _0x20c3e9;};'use strict';var Sequelize=require('sequelize');var iconv=require(_0xf6ff('0x0'));module['exports']={'closed':{'type':Sequelize[_0xf6ff('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xf6ff('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xf6ff('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xf6ff('0x3')]},'inReplyTo':{'type':Sequelize[_0xf6ff('0x3')](0x1fe)},'to':{'type':Sequelize[_0xf6ff('0x3')]},'cc':{'type':Sequelize[_0xf6ff('0x4')](_0xf6ff('0x5'))},'subject':{'type':Sequelize[_0xf6ff('0x4')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xf6ff('0x2')]},'substatus':{'type':Sequelize[_0xf6ff('0x3')](0x3c)},'substatusAt':{'type':Sequelize[_0xf6ff('0x2')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xf6ff('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xf6ff('0x7')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xf6ff('0x1')],'defaultValue':![]}}; \ No newline at end of file +var _0xe577=['ENUM','out','sequelize','iconv','exports','BOOLEAN','STRING','long','TEXT','DATE'];(function(_0x40a3bd,_0x26b586){var _0x224d4c=function(_0x2d8749){while(--_0x2d8749){_0x40a3bd['push'](_0x40a3bd['shift']());}};_0x224d4c(++_0x26b586);}(_0xe577,0xb6));var _0x7e57=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0xe577[_0x2dea24];return _0x309d58;};'use strict';var Sequelize=require(_0x7e57('0x0'));var iconv=require(_0x7e57('0x1'));module[_0x7e57('0x2')]={'closed':{'type':Sequelize[_0x7e57('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x7e57('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x7e57('0x4')]},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0x7e57('0x4')]},'cc':{'type':Sequelize['TEXT'](_0x7e57('0x5'))},'subject':{'type':Sequelize[_0x7e57('0x6')]()},'attach':{'type':Sequelize[_0x7e57('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x7e57('0x7')]},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x7e57('0x8')]('in',_0x7e57('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x7e57('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x7e57('0x8')]('in',_0x7e57('0x9')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x7e57('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index eba68fc..30a60ab 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 _0xb10b=['Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','Setting','findOne','enableEmailPreview','show','params','rawAttributes','includeAll','include','merge','options','create','body','describe','addMessage','ids','omit','getMessages','nolimit','pick','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','inlineCss','rows','spread','emit','mailInteractionTags:save','removeTags','download','unix','join','server','tmp','root','files','attachments','transcript-%d-%s.zip','Attachment','Attachments','Messages','subject','get','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','basename','existsSync','build','message%d.eml','unlinkSync','eml-format','zip-dir','moment','bluebird','path','lodash','squel','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','then','error','stack','name','send','fullname','TagIds','Tags','split','forEach','push','MailMessage','out','-id','trimStart','plainBody','catch','index','map','MailInteraction','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','field','color','tools_tags','u.id','ui.MailInteractionId','from','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','select','mail_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','it.MailInteractionId\x20=\x20i.id','expr','search','parseSearch','conditions','length','find','unreadMessages','value','having','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','some','compact','isEmpty','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','isEmail','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','MailAccountId','i.MailAccountId\x20IS\x20NOT\x20NULL','role','getMailAccounts','i.MailAccountId\x20IS\x20NULL','agent','toString','sequelize','keyBy','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.createdAt','i.updatedAt','i.closed','i.attach','i.lastMsgAt','i.subject','i.disposition','i.secondDisposition','i.thirdDisposition','i.ContactId','i.MailAccountId','Contact.firstName','c.email'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0xb10b,0x12a));var _0xbb10=function(_0x2dbd12,_0x3eedd2){_0x2dbd12=_0x2dbd12-0x0;var _0x378a8=_0xb10b[_0x2dbd12];return _0x378a8;};'use strict';var emlformat=require(_0xbb10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var BPromise=require(_0xbb10('0x3'));var util=require('util');var path=require(_0xbb10('0x4'));var fs=require('fs');var _=require(_0xbb10('0x5'));var squel=require(_0xbb10('0x6'));var juice=require(_0xbb10('0x7'));var Redis=require(_0xbb10('0x8'));var qs=require(_0xbb10('0x9'));var as=require('../../components/parsers/advancedSearch');var logger=require(_0xbb10('0xa'))(_0xbb10('0xb'));var config=require('../../config/environment');var db=require(_0xbb10('0xc'))['db'];config[_0xbb10('0xd')]=_[_0xbb10('0xe')](config[_0xbb10('0xd')],{'host':_0xbb10('0xf'),'port':0x18eb});var socket=require(_0xbb10('0x10'))(new Redis(config[_0xbb10('0xd')]));require(_0xbb10('0x11'))['register'](socket);function respondWithStatusCode(_0x4e47f8,_0x20bd61){_0x20bd61=_0x20bd61||0xcc;return function(_0x118a74){if(_0x118a74){return _0x4e47f8[_0xbb10('0x12')](_0x20bd61);}return _0x4e47f8['status'](_0x20bd61)[_0xbb10('0x13')]();};}function respondWithResult(_0x5be7e0,_0x44fb19){_0x44fb19=_0x44fb19||0xc8;return function(_0x916a32){if(_0x916a32){return _0x5be7e0[_0xbb10('0x14')](_0x44fb19)[_0xbb10('0x15')](_0x916a32);}};}function respondWithFilteredResult(_0x442548,_0x147230){return function(_0x58a612){if(_0x58a612){var _0x26e021=typeof _0x147230[_0xbb10('0x16')]===_0xbb10('0x17')&&typeof _0x147230[_0xbb10('0x18')]===_0xbb10('0x17');var _0x2f2ebf=_0x58a612[_0xbb10('0x19')];var _0x36b5e8=_0x26e021?0x0:_0x147230[_0xbb10('0x16')];var _0x2b184e=_0x26e021?_0x58a612['count']:_0x147230[_0xbb10('0x16')]+_0x147230[_0xbb10('0x18')];var _0x133ac2;if(_0x2b184e>=_0x2f2ebf){_0x2b184e=_0x2f2ebf;_0x133ac2=0xc8;}else{_0x133ac2=0xce;}_0x442548[_0xbb10('0x14')](_0x133ac2);return _0x442548[_0xbb10('0x1a')](_0xbb10('0x1b'),_0x36b5e8+'-'+_0x2b184e+'/'+_0x2f2ebf)[_0xbb10('0x15')](_0x58a612);}return null;};}function saveUpdates(_0x30efc6){return function(_0xbf2906){if(_0xbf2906){return _0xbf2906[_0xbb10('0x1c')](_0x30efc6)['then'](function(_0x5ff0cf){return _0x5ff0cf;});}return null;};}function removeEntity(_0x19f48d){return function(_0x388fab){if(_0x388fab){return _0x388fab[_0xbb10('0x1d')]()[_0xbb10('0x1e')](function(){_0x19f48d[_0xbb10('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12f888){return function(_0x12ef77){if(!_0x12ef77){_0x12f888['sendStatus'](0x194);}return _0x12ef77;};}function handleError(_0x4c4b0d,_0x8e2b97){_0x8e2b97=_0x8e2b97||0x1f4;return function(_0x311abe){logger[_0xbb10('0x1f')](_0x311abe[_0xbb10('0x20')]);if(_0x311abe[_0xbb10('0x21')]){delete _0x311abe[_0xbb10('0x21')];}_0x4c4b0d[_0xbb10('0x14')](_0x8e2b97)[_0xbb10('0x22')](_0x311abe);};}function getInteractionUsers(_0x7f2377,_0x395404){return new BPromise(function(_0x3ba6cd,_0x26ad93){try{if(_0x395404[_0x7f2377['id']]){_0x7f2377['Users']=_['map'](_0x395404[_0x7f2377['id']],function(_0x4fb5e0){return{'id':_0x4fb5e0['id'],'fullname':_0x4fb5e0[_0xbb10('0x23')]};});}}catch(_0x3c5ae7){_0x26ad93(_0x3c5ae7);}_0x3ba6cd(_0x7f2377);});}function getInteractionTags(_0x2c89b9,_0x4e25ff){return new BPromise(function(_0x2fdde9,_0x24d586){try{if(_0x2c89b9[_0xbb10('0x24')]){_0x2c89b9[_0xbb10('0x25')]=[];_0x2c89b9[_0xbb10('0x24')][_0xbb10('0x26')](',')[_0xbb10('0x27')](function(_0x4aabb9){_0x2c89b9[_0xbb10('0x25')][_0xbb10('0x28')](_0x4e25ff[_0x4aabb9]);});}delete _0x2c89b9[_0xbb10('0x24')];}catch(_0x2e0249){_0x24d586(_0x2e0249);}_0x2fdde9(_0x2c89b9);});}function getLastMessageText(_0x1d30aa){return new BPromise(function(_0x2ff4c1,_0x5d5c80){return db[_0xbb10('0x29')]['findOne']({'where':{'$and':[{'MailInteractionId':_0x1d30aa['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xbb10('0x2a')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0xbb10('0x2b'),'raw':!![]})[_0xbb10('0x1e')](function(_0x1b59f9){if(_0x1b59f9&&_0x1b59f9['plainBody']){_0x1d30aa['lastMsgText']=_[_0xbb10('0x2c')](_0x1b59f9[_0xbb10('0x2d')]);}_0x2ff4c1(_0x1d30aa);})['catch'](function(_0x359ad4){_0x5d5c80(_0x359ad4);});});}function updateMailInteraction(_0x37dde7,_0x2f653f,_0x1c0b57,_0x37a83f){return new BPromise(function(_0x138bc6,_0xf85197){return getInteractionUsers(_0x37dde7,_0x1c0b57)['then'](function(_0x25acb3){return getInteractionTags(_0x25acb3,_0x2f653f);})[_0xbb10('0x1e')](function(_0x441d15){if(_0x37a83f){_0x138bc6(getLastMessageText(_0x441d15));}else{_0x138bc6(_0x441d15);}})[_0xbb10('0x2e')](function(_0xfb2c5e){_0xf85197(_0xfb2c5e);});});}exports[_0xbb10('0x2f')]=function(_0x188cbd,_0x10202c){var _0x3c8d7d={},_0x56943c={},_0x2b5352={'count':0x0,'rows':[]};var _0x150107=_[_0xbb10('0x30')](db[_0xbb10('0x31')]['rawAttributes'],function(_0x111762){return{'name':_0x111762['fieldName'],'type':_0x111762['type'][_0xbb10('0x32')]};});_0x56943c[_0xbb10('0x33')]=_[_0xbb10('0x30')](_0x150107,_0xbb10('0x21'));_0x56943c[_0xbb10('0x34')]=_[_0xbb10('0x35')](_0x188cbd['query']);_0x56943c[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x56943c['model'],_0x56943c['query']);_0x3c8d7d['attributes']=_[_0xbb10('0x37')](_0x56943c[_0xbb10('0x33')],qs[_0xbb10('0x38')](_0x188cbd['query'][_0xbb10('0x38')]));_0x3c8d7d[_0xbb10('0x39')]=_0x3c8d7d[_0xbb10('0x39')]['length']?_0x3c8d7d[_0xbb10('0x39')]:_0x56943c[_0xbb10('0x33')];if(!_0x188cbd[_0xbb10('0x34')][_0xbb10('0x3a')]('nolimit')){_0x3c8d7d[_0xbb10('0x18')]=qs[_0xbb10('0x18')](_0x188cbd['query'][_0xbb10('0x18')]);_0x3c8d7d[_0xbb10('0x16')]=qs[_0xbb10('0x16')](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x16')]);}_0x3c8d7d[_0xbb10('0x3b')]=qs['sort'](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x3c')]);_0x3c8d7d[_0xbb10('0x3d')]=qs[_0xbb10('0x36')](_['pick'](_0x188cbd[_0xbb10('0x34')],_0x56943c[_0xbb10('0x36')]),_0x150107);var _0x23dc18=[];var _0x403beb=squel['select']()[_0xbb10('0x3e')]('id')[_0xbb10('0x3e')]('name')['field'](_0xbb10('0x3f'))['from'](_0xbb10('0x40'));var _0x180933=squel['select']()[_0xbb10('0x3e')](_0xbb10('0x41'))[_0xbb10('0x3e')]('u.fullname')[_0xbb10('0x3e')](_0xbb10('0x42'))[_0xbb10('0x43')](_0xbb10('0x44'),'ui')[_0xbb10('0x45')](_0xbb10('0x46'),'u',_0xbb10('0x47'));var _0x3efa96=squel[_0xbb10('0x48')]()[_0xbb10('0x43')](_0xbb10('0x49'),'i')[_0xbb10('0x45')]('cm_contacts','c',_0xbb10('0x4a'))[_0xbb10('0x45')]('users','o',_0xbb10('0x4b'))[_0xbb10('0x45')](_0xbb10('0x4c'),'a',_0xbb10('0x4d'))[_0xbb10('0x45')](_0xbb10('0x4e'),'me',_0xbb10('0x4f'))['left_join']('mail_interaction_has_tags','it',_0xbb10('0x50'))[_0xbb10('0x45')](_0xbb10('0x40'),'t','t.id\x20=\x20it.TagId');var _0x5f0c12=squel[_0xbb10('0x51')]();var _0x34cf4e=[];var _0x1bd054=squel[_0xbb10('0x51')]();var _0x10159b;if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x52')]){_0x10159b=as[_0xbb10('0x53')](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x52')]);var _0x550111=_0x10159b['sqlOperator'];for(var _0x412e13=0x0;_0x412e13<_0x10159b[_0xbb10('0x54')][_0xbb10('0x55')];_0x412e13++){var _0xb014b0=_0x10159b[_0xbb10('0x54')][_0x412e13];var _0x440f9e='i';var _0x358e7e=_[_0xbb10('0x56')](_0x150107,[_0xbb10('0x21'),_0xb014b0[_0xbb10('0x3e')]]);if(!_0x358e7e){switch(_0xb014b0[_0xbb10('0x3e')]){case _0xbb10('0x57'):if(_0xb014b0[_0xbb10('0x58')]==0x1){_0x3efa96[_0xbb10('0x59')]('`'+_0xb014b0[_0xbb10('0x3e')]+'`\x20=\x200');}else{_0x3efa96[_0xbb10('0x59')]('`'+_0xb014b0['field']+_0xbb10('0x5a'));}break;case _0xbb10('0x5b'):if(_0xb014b0[_0xbb10('0x5c')]===_0xbb10('0x5d')){if(_0xb014b0[_0xbb10('0x58')][_0xbb10('0x26')]('\x20')[_0xbb10('0x55')]>0x1){_0x5f0c12[_0x550111](_0xbb10('0x5e'),qs[_0xbb10('0x5f')](_0xb014b0[_0xbb10('0x58')]),null);}else{var _0x44a056='%'+_0xb014b0[_0xbb10('0x58')]+'%';_0x5f0c12[_0x550111](_0xbb10('0x60'),_0x44a056,_0x44a056,_0x44a056);}}else{_0x358e7e=_[_0xbb10('0x56')](_0x150107,[_0xbb10('0x21'),'ContactId']);_0xb014b0[_0xbb10('0x3e')]=_0xbb10('0x61');_0x155dc5=as[_0xbb10('0x62')](_0x440f9e,_0x358e7e[_0xbb10('0x63')],_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5[_0xbb10('0x64')],_0x155dc5[_0xbb10('0x58')]['start'],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x13')]);}break;case _0xbb10('0x65'):var _0x14fed3=_0xb014b0[_0xbb10('0x58')][_0xbb10('0x26')](',')[_0xbb10('0x30')](function(_0x12ec18){return Number(_0x12ec18);});_0x14fed3[_0xbb10('0x27')](function(_0x40c4fb){_0x1bd054['or'](_0xbb10('0x66'),'%,'+_0x40c4fb+',%');});_0x34cf4e=_[_0xbb10('0x67')](_0x34cf4e,_0x14fed3);break;case _0xbb10('0x68'):if(_0xb014b0['operator']==='$substring'){_0x5f0c12[_0x550111](_0xbb10('0x69'),'%'+_0xb014b0[_0xbb10('0x58')]+'%',null);}else{_0x358e7e=_[_0xbb10('0x56')](_0x150107,[_0xbb10('0x21'),'UserId']);_0xb014b0['field']=_0xbb10('0x6a');_0x155dc5=as[_0xbb10('0x62')](_0x440f9e,_0x358e7e[_0xbb10('0x63')],_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5[_0xbb10('0x64')],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x6b')],_0x155dc5[_0xbb10('0x58')]['end']);}break;case _0xbb10('0x2d'):_0x155dc5=as[_0xbb10('0x62')]('me',null,_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5['text'],_0x155dc5['value']['start'],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x13')]);break;}}else{var _0x155dc5=as['buildExpression'](_0x440f9e,_0x358e7e['type'],_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5['text'],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x6b')],_0x155dc5[_0xbb10('0x58')]['end']);}}}else{var _0xa1bbd9=_(_0x188cbd[_0xbb10('0x34')])['keys']()['map'](function(_0x27d7b9){return _[_0xbb10('0x6c')](_0x150107,[_0xbb10('0x21'),_0x27d7b9])?_0x27d7b9:undefined;})[_0xbb10('0x6d')]()['value']();if(!_[_0xbb10('0x6e')](_0xa1bbd9)){_0xa1bbd9[_0xbb10('0x27')](function(_0xa7179d){if(_0xa7179d==='MailAccountId'){_0x3efa96[_0xbb10('0x3d')](_0xbb10('0x6f'),[][_0xbb10('0x70')](_0x188cbd['query'][_0xa7179d]));}else if(_0xa7179d===_0xbb10('0x71')){var _0x31e85e=JSON[_0xbb10('0x72')](_0x188cbd[_0xbb10('0x34')][_0xa7179d])['$gte'];var _0x251417=JSON[_0xbb10('0x72')](_0x188cbd[_0xbb10('0x34')][_0xa7179d])[_0xbb10('0x73')];_0x3efa96['where'](_0xbb10('0x74'),_0x31e85e,_0x251417);}else{if(_0x188cbd[_0xbb10('0x34')][_0xa7179d]===_0xbb10('0x75')){_0x3efa96[_0xbb10('0x3d')]('i.'+_0xa7179d+_0xbb10('0x76'));}else{_0x3efa96[_0xbb10('0x3d')]('i.'+_0xa7179d+_0xbb10('0x77'),_0x188cbd['query'][_0xa7179d]);}}});}if(_0x188cbd['query']['read']){if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x78')]==0x1){_0x3efa96[_0xbb10('0x59')]('`unreadMessages`\x20=\x200');}else{_0x3efa96['having'](_0xbb10('0x79'));}}if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7a')]){_0x34cf4e=_[_0xbb10('0x7b')](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7a')])?_0x188cbd['query'][_0xbb10('0x7a')]:new Array(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7a')]);_0x34cf4e[_0xbb10('0x27')](function(_0x2aaaa6){_0x1bd054['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2aaaa6+',%');});}if(_0x188cbd['query']['filter']){var _0x329da7=_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7c')][_0xbb10('0x7d')]('\x5c','\x5c\x5c')[_0xbb10('0x7d')](/'/g,'\x27\x27');if(qs[_0xbb10('0x7e')](_0x329da7)){_0x5f0c12['or']('i.id\x20LIKE\x20?',_0x329da7+'%');}else if(qs[_0xbb10('0x7f')](_0x329da7)){_0x5f0c12['or']('c.email\x20LIKE\x20?',_0x329da7+'%');}else{_0x5f0c12['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x329da7))['or'](_0xbb10('0x80'),qs[_0xbb10('0x5f')](_0x329da7));}}}_0x3efa96[_0xbb10('0x3d')](_0x5f0c12);_0x3efa96[_0xbb10('0x81')]('i.id');var _0x122d38={'type':db['Sequelize']['QueryTypes'][_0xbb10('0x82')],'raw':!![]};var _0xfe3db0=_0x3efa96[_0xbb10('0x83')]();_0xfe3db0[_0xbb10('0x3e')](_0xbb10('0x84'));_0xfe3db0['field'](_0xbb10('0x85'),_0xbb10('0x57'));if(_0x3c8d7d[_0xbb10('0x3b')]){_0x3c8d7d[_0xbb10('0x3b')][_0xbb10('0x27')](function(_0x27f42f){var _0x174395=_0x27f42f[0x0]==='contactName'?_0x27f42f[0x0]:'i.'+_0x27f42f[0x0];_0x3efa96[_0xbb10('0x3b')](_0x174395,_0x27f42f[0x1]===_0xbb10('0x86')?![]:!![]);});}if(!_[_0xbb10('0x6e')](_0x34cf4e)){_0x3efa96[_0xbb10('0x59')](_0x1bd054);_0xfe3db0[_0xbb10('0x3d')](_0xbb10('0x87'),_0x34cf4e);}BPromise[_0xbb10('0x88')]()[_0xbb10('0x1e')](function(){if(!_0x10159b){if(_0x188cbd['query'][_0xbb10('0x89')])return;_0xfe3db0[_0xbb10('0x3d')](_0xbb10('0x8a'));_0x3efa96['where']('i.MailAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x188cbd['user'][_0xbb10('0x8b')]!=='agent')return;return _0x188cbd['user'][_0xbb10('0x8c')]({'attributes':['id'],'raw':!![]})[_0xbb10('0x1e')](function(_0x33ff06){if(_[_0xbb10('0x6e')](_0x33ff06)){_0xfe3db0[_0xbb10('0x3d')](_0xbb10('0x8d'));_0x3efa96[_0xbb10('0x3d')](_0xbb10('0x8d'));}else{_0xfe3db0[_0xbb10('0x3d')]('i.MailAccountId\x20IN\x20?',_[_0xbb10('0x30')](_0x33ff06,'id'));_0x3efa96[_0xbb10('0x3d')](_0xbb10('0x6f'),_[_0xbb10('0x30')](_0x33ff06,'id'));}});})['then'](function(){if(_0x188cbd['user'][_0xbb10('0x8b')]===_0xbb10('0x8e')&&!_0x10159b&&!_0x188cbd[_0xbb10('0x34')][_0xbb10('0x89')])return[];return db['sequelize'][_0xbb10('0x34')](_0xfe3db0[_0xbb10('0x8f')](),_0x122d38);})[_0xbb10('0x1e')](function(_0xf7b3e1){_0x2b5352[_0xbb10('0x19')]=_0xf7b3e1['length'];if(_0x2b5352['count']===0x0)return[];return db[_0xbb10('0x90')][_0xbb10('0x34')](_0x403beb[_0xbb10('0x8f')](),_0x122d38)['then'](function(_0x256b35){_0x23dc18=_[_0xbb10('0x91')](_0x256b35,'id');_0x122d38=_['merge'](_0x122d38,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x38')]){_0x3c8d7d[_0xbb10('0x39')]['forEach'](function(_0x32d5a5){_0x3efa96[_0xbb10('0x3e')]('i.'+_0x32d5a5);});}else{_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x85'),_0xbb10('0x57'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x92'),_0xbb10('0x93'));_0x3efa96[_0xbb10('0x3e')]('a.mandatoryDisposition',_0xbb10('0x94'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x95'),_0xbb10('0x96'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x84'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x97'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x98'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x99'));_0x3efa96['field']('i.closedAt');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9a'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9b'));_0x3efa96[_0xbb10('0x3e')]('i.lastMsgDirection');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9c'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9d'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9e'));_0x3efa96['field'](_0xbb10('0x9f'));_0x3efa96[_0xbb10('0x3e')]('i.substatus');_0x3efa96[_0xbb10('0x3e')]('i.to');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa0'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa1'));_0x3efa96[_0xbb10('0x3e')]('i.UserId');_0x3efa96[_0xbb10('0x3e')]('c.firstName',_0xbb10('0xa2'));_0x3efa96[_0xbb10('0x3e')]('c.lastName','Contact.lastName');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa3'),_0xbb10('0xa4'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa5'),_0xbb10('0xa6'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa7'),_0xbb10('0xa8'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa9'),'Contact.fax');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xaa'),_0xbb10('0xab'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xac'),_0xbb10('0xad'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xae'),_0xbb10('0x24'));}if(_0x3c8d7d[_0xbb10('0x18')])_0x3efa96[_0xbb10('0x18')](_0x3c8d7d[_0xbb10('0x18')]);if(_0x3c8d7d['offset'])_0x3efa96[_0xbb10('0x16')](_0x3c8d7d['offset']);return db[_0xbb10('0x90')][_0xbb10('0x34')](_0x3efa96[_0xbb10('0x8f')](),_0x122d38);})[_0xbb10('0x1e')](function(_0x38d369){if(_0x38d369['length']>0x0)_0x180933[_0xbb10('0x3d')](_0xbb10('0xaf'),_[_0xbb10('0x30')](_0x38d369,'id'));return db[_0xbb10('0x90')][_0xbb10('0x34')](_0x180933[_0xbb10('0x8f')](),_0x122d38)['then'](function(_0x4bd470){var _0x5cc9d7=_[_0xbb10('0xb0')](_0x4bd470,_0xbb10('0xb1'));var _0x57d5a1=[];return db[_0xbb10('0xb2')][_0xbb10('0xb3')]({'attributes':['enableEmailPreview'],'raw':!![]})[_0xbb10('0x1e')](function(_0xaede56){var _0x5642c3=_0xaede56[_0xbb10('0xb4')];_0x38d369['forEach'](function(_0x34cec7){_0x57d5a1[_0xbb10('0x28')](updateMailInteraction(_0x34cec7,_0x23dc18,_0x5cc9d7,_0x5642c3));});return BPromise['all'](_0x57d5a1);});});});})[_0xbb10('0x1e')](function(_0x28cc74){_0x2b5352['rows']=_0x28cc74;return _0x2b5352;})['then'](respondWithFilteredResult(_0x10202c,_0x3c8d7d))[_0xbb10('0x2e')](handleError(_0x10202c,null));};exports[_0xbb10('0xb5')]=function(_0x3e0e34,_0x3299bc){var _0x3ceb77={'raw':![],'where':{'id':_0x3e0e34[_0xbb10('0xb6')]['id']}},_0x4c3bdc={};_0x4c3bdc[_0xbb10('0x33')]=_[_0xbb10('0x35')](db['MailInteraction'][_0xbb10('0xb7')]);_0x4c3bdc[_0xbb10('0x34')]=_[_0xbb10('0x35')](_0x3e0e34[_0xbb10('0x34')]);_0x4c3bdc[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x4c3bdc[_0xbb10('0x33')],_0x4c3bdc[_0xbb10('0x34')]);_0x3ceb77[_0xbb10('0x39')]=_['intersection'](_0x4c3bdc['model'],qs[_0xbb10('0x38')](_0x3e0e34[_0xbb10('0x34')][_0xbb10('0x38')]));_0x3ceb77[_0xbb10('0x39')]=_0x3ceb77[_0xbb10('0x39')][_0xbb10('0x55')]?_0x3ceb77[_0xbb10('0x39')]:_0x4c3bdc[_0xbb10('0x33')];if(_0x3e0e34[_0xbb10('0x34')][_0xbb10('0xb8')]){_0x3ceb77[_0xbb10('0xb9')]=[{'all':!![]}];}_0x3ceb77=_[_0xbb10('0xba')]({},_0x3ceb77,_0x3e0e34[_0xbb10('0xbb')]);return db['MailInteraction'][_0xbb10('0x56')](_0x3ceb77)[_0xbb10('0x1e')](handleEntityNotFound(_0x3299bc,null))[_0xbb10('0x1e')](respondWithResult(_0x3299bc,null))[_0xbb10('0x2e')](handleError(_0x3299bc,null));};exports[_0xbb10('0xbc')]=function(_0xd9284e,_0x4258fc){return db[_0xbb10('0x31')][_0xbb10('0xbc')](_0xd9284e[_0xbb10('0xbd')],{})[_0xbb10('0x1e')](respondWithResult(_0x4258fc,0xc9))['catch'](handleError(_0x4258fc,null));};exports[_0xbb10('0x1c')]=function(_0x5e1ac5,_0x3faaca){if(_0x5e1ac5[_0xbb10('0xbd')]['id']){delete _0x5e1ac5[_0xbb10('0xbd')]['id'];}return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x5e1ac5[_0xbb10('0xb6')]['id']}})['then'](handleEntityNotFound(_0x3faaca,null))[_0xbb10('0x1e')](saveUpdates(_0x5e1ac5['body'],null))[_0xbb10('0x1e')](respondWithResult(_0x3faaca,null))[_0xbb10('0x2e')](handleError(_0x3faaca,null));};exports[_0xbb10('0x1d')]=function(_0x576bb6,_0x2b652c){return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x576bb6[_0xbb10('0xb6')]['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x2b652c,null))[_0xbb10('0x1e')](removeEntity(_0x2b652c,null))[_0xbb10('0x2e')](handleError(_0x2b652c,null));};exports[_0xbb10('0xbe')]=function(_0x589565,_0x3696b3){return db['MailInteraction'][_0xbb10('0xbe')]()[_0xbb10('0x1e')](respondWithResult(_0x3696b3,null))[_0xbb10('0x2e')](handleError(_0x3696b3,null));};exports[_0xbb10('0xbf')]=function(_0x44c229,_0x40271f){return db[_0xbb10('0x29')]['find']({'where':{'id':_0x44c229[_0xbb10('0xb6')]['id']}})['then'](handleEntityNotFound(_0x40271f,null))['then'](function(_0x1513e0){if(_0x1513e0){return _0x1513e0[_0xbb10('0xbf')](_0x44c229[_0xbb10('0xbd')][_0xbb10('0xc0')],_[_0xbb10('0xc1')](_0x44c229[_0xbb10('0xbd')],['ids','id'])||{});}})[_0xbb10('0x1e')](respondWithResult(_0x40271f,null))[_0xbb10('0x2e')](handleError(_0x40271f,null));};exports[_0xbb10('0xc2')]=function(_0xb1b7c8,_0x136520){var _0x28127c={'raw':![],'where':{}};var _0x528aff={};var _0xdfdc42={'count':0x0,'rows':[]};return db[_0xbb10('0x31')][_0xbb10('0xb3')]({'where':{'id':_0xb1b7c8[_0xbb10('0xb6')]['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x136520,null))[_0xbb10('0x1e')](function(_0x2764e1){if(_0x2764e1){_0x528aff['model']=_[_0xbb10('0x35')](db['MailMessage'][_0xbb10('0xb7')]);_0x528aff['query']=_['keys'](_0xb1b7c8[_0xbb10('0x34')]);_0x528aff[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x528aff[_0xbb10('0x33')],_0x528aff[_0xbb10('0x34')]);_0x28127c['attributes']=_[_0xbb10('0x37')](_0x528aff['model'],qs['fields'](_0xb1b7c8['query'][_0xbb10('0x38')]));_0x28127c[_0xbb10('0x39')]=_0x28127c[_0xbb10('0x39')][_0xbb10('0x55')]?_0x28127c[_0xbb10('0x39')]:_0x528aff['model'];if(!_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x3a')](_0xbb10('0xc3'))){_0x28127c[_0xbb10('0x18')]=qs[_0xbb10('0x18')](_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x18')]);_0x28127c['offset']=qs['offset'](_0xb1b7c8['query'][_0xbb10('0x16')]);}_0x28127c[_0xbb10('0x3b')]=qs[_0xbb10('0x3c')](_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x3c')]);_0x28127c[_0xbb10('0x3d')]=qs[_0xbb10('0x36')](_[_0xbb10('0xc4')](_0xb1b7c8[_0xbb10('0x34')],_0x528aff[_0xbb10('0x36')]));_0x28127c['where']['MailInteractionId']=_0x2764e1['id'];if(_0xb1b7c8['query'][_0xbb10('0x7c')]){_0x28127c[_0xbb10('0x3d')]=_[_0xbb10('0xba')](_0x28127c['where'],{'$or':_[_0xbb10('0x30')](_0x28127c[_0xbb10('0x39')],function(_0x2c638d){var _0x290280={};_0x290280[_0x2c638d]={'$like':'%'+_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x7c')]+'%'};return _0x290280;})});}if(_0xb1b7c8['query']['$gte']){var _0x356660=_0xb1b7c8['query'][_0xbb10('0xc5')][_0xbb10('0x26')](',');var _0x152ca9={};_0x152ca9[_0x356660[0x0]]={'$gte':moment(_0x356660[0x1])[_0xbb10('0xc6')](_0xbb10('0xc7'))};_0x28127c[_0xbb10('0x3d')]=_[_0xbb10('0xba')](_0x28127c[_0xbb10('0x3d')],_0x152ca9);}_0x28127c=_[_0xbb10('0xba')]({},_0x28127c,_0xb1b7c8[_0xbb10('0xbb')]);return db['MailMessage'][_0xbb10('0x19')]({'where':_0x28127c['where']})[_0xbb10('0x1e')](function(_0x5547fa){_0xdfdc42[_0xbb10('0x19')]=_0x5547fa;if(_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0xb8')]){_0x28127c[_0xbb10('0xb9')]=[{'all':!![]}];}return db['MailMessage'][_0xbb10('0xc8')](_0x28127c);})['then'](function(_0xfe1154){if(_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0xc9')]==='true'){for(var _0x298167=0x0;_0x298167<_0xfe1154[_0xbb10('0x55')];_0x298167++){_0xfe1154[_0x298167][_0xbb10('0xbd')]=juice(_0xfe1154[_0x298167][_0xbb10('0xbd')]);}}_0xdfdc42[_0xbb10('0xca')]=_0xfe1154;return _0xdfdc42;});}})[_0xbb10('0x1e')](respondWithFilteredResult(_0x136520,_0x28127c))['catch'](handleError(_0x136520,null));};exports['addTags']=function(_0x522a88,_0x26a752){return db['MailInteraction'][_0xbb10('0x56')]({'where':{'id':_0x522a88['params']['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x26a752,null))[_0xbb10('0x1e')](function(_0x385ad3){if(_0x385ad3){return _0x385ad3['setTags'](_0x522a88['body'][_0xbb10('0xc0')],_[_0xbb10('0xc1')](_0x522a88[_0xbb10('0xbd')],['ids','id'])||{})[_0xbb10('0xcb')](function(){return db[_0xbb10('0x65')][_0xbb10('0xc8')]({'attributes':['id','name','color'],'where':{'id':_0x522a88['body'][_0xbb10('0xc0')]}});})['then'](function(_0x3dfbcd){socket[_0xbb10('0xcc')](_0xbb10('0xcd'),{'id':Number(_0x522a88[_0xbb10('0xb6')]['id']),'tags':_0x3dfbcd||[]});return{'id':Number(_0x522a88[_0xbb10('0xb6')]['id']),'tags':_0x3dfbcd||[]};});}})[_0xbb10('0x1e')](respondWithResult(_0x26a752,null))[_0xbb10('0x2e')](handleError(_0x26a752,null));};exports[_0xbb10('0xce')]=function(_0x2746eb,_0x431792){return db[_0xbb10('0x31')]['find']({'where':{'id':_0x2746eb[_0xbb10('0xb6')]['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x431792,null))['then'](function(_0x14ef50){if(_0x14ef50){return _0x14ef50['removeTags'](_0x2746eb['query'][_0xbb10('0xc0')]);}})[_0xbb10('0x1e')](respondWithStatusCode(_0x431792,null))[_0xbb10('0x2e')](handleError(_0x431792,null));};exports[_0xbb10('0xcf')]=function(_0x99c4,_0x4ca4ce){var _0x161171=moment()[_0xbb10('0xd0')]()['toString']();var _0xa45726=path[_0xbb10('0xd1')](config['root'],_0xbb10('0xd2'),'files',_0xbb10('0xd3'));var _0x8e8049=path[_0xbb10('0xd1')](config[_0xbb10('0xd4')],_0xbb10('0xd2'),_0xbb10('0xd5'),_0xbb10('0xd6'));var _0x56f902=path[_0xbb10('0xd1')](_0xa45726,_0x161171);var _0x4720a1=util[_0xbb10('0xc6')](_0xbb10('0xd7'),_0x99c4[_0xbb10('0xb6')]['id'],_0x161171);var _0x1301e3=path['join'](_0xa45726,_0x4720a1);var _0x550301=[];if(_0x99c4['query'][_0xbb10('0xd6')]){_0x550301[_0xbb10('0x28')]({'model':db[_0xbb10('0xd8')],'as':_0xbb10('0xd9'),'raw':!![]});}var _0x57700b=[{'model':db[_0xbb10('0x29')],'as':_0xbb10('0xda'),'attributes':['id',_0xbb10('0xbd'),'from','to','cc','bcc',_0xbb10('0xdb'),'createdAt'],'where':{'secret':![]},'order':qs[_0xbb10('0x3c')]('id'),'include':_0x550301}];return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x99c4[_0xbb10('0xb6')]['id']},'include':_0x57700b})[_0xbb10('0x1e')](handleEntityNotFound(_0x4ca4ce,null))[_0xbb10('0x1e')](function(_0x1fe250){if(_0x1fe250&&_0x1fe250['Messages']){var _0x424371=_0x1fe250[_0xbb10('0xdc')]({'plain':!![]});fs['mkdirSync'](_0x56f902);return BPromise[_0xbb10('0xdd')](_0x424371[_0xbb10('0xda')],function(_0x32f261,_0x5b11a2){var _0x4b490a={'from':_0x32f261['from'],'to':_0x32f261['to'],'subject':_0x32f261[_0xbb10('0xdb')],'html':_0x32f261[_0xbb10('0xbd')],'headers':{'Date':moment(_0x32f261['createdAt'])[_0xbb10('0xc6')](_0xbb10('0xde'))},'attachments':[]};if(_0x32f261['cc']){_0x4b490a[_0xbb10('0xdf')]['Cc']=_0x32f261['cc'];}if(_0x32f261[_0xbb10('0xe0')]){_0x4b490a[_0xbb10('0xdf')][_0xbb10('0xe1')]=_0x32f261[_0xbb10('0xe0')];}return new BPromise(function(_0x48f0eb,_0x304603){if(_0x32f261['Attachments']){for(var _0x5a7c4e=0x0;_0x5a7c4e<_0x32f261['Attachments'][_0xbb10('0x55')];_0x5a7c4e++){var _0x572d73=_0x32f261['Attachments'][_0x5a7c4e];var _0x1f09f1=path['join'](_0x8e8049,_0x572d73[_0xbb10('0xe2')]);if(fs[_0xbb10('0xe3')](_0x1f09f1)){_0x4b490a[_0xbb10('0xd6')]['push']({'name':_0x572d73['name'],'contentType':_0x572d73[_0xbb10('0x63')],'data':fs['readFileSync'](_0x1f09f1)});}}}emlformat[_0xbb10('0xe4')](_0x4b490a,function(_0x211172,_0x589ecb){if(_0x211172)return _0x304603(_0x211172);fs['writeFileSync'](path[_0xbb10('0xd1')](_0x56f902,util[_0xbb10('0xc6')](_0xbb10('0xe5'),_0x5b11a2)),_0x589ecb);return _0x48f0eb(_0x589ecb);});});})['then'](function(){return new BPromise(function(_0x4f4aa8,_0x426a4f){zipdir(_0x56f902,{'saveTo':_0x1301e3},function(_0x22f153,_0x4d47cc){if(_0x22f153)return _0x426a4f(_0x22f153);return _0x4f4aa8(_0x4d47cc);});})[_0xbb10('0x1e')](function(){return new BPromise(function(_0x203e5a,_0xe88e90){rimraf(_0x56f902,function(_0x4845b5){if(_0x4845b5)_0xe88e90(_0x4845b5);return _0x203e5a();});});})[_0xbb10('0x1e')](function(){return _0x4ca4ce[_0xbb10('0xcf')](_0x1301e3,_0x4720a1,function(_0x166f4f){if(!_0x166f4f)fs[_0xbb10('0xe6')](_0x1301e3);});});});}else{return _0x4ca4ce[_0xbb10('0x12')](0xc8);}})[_0xbb10('0x2e')](handleError(_0x4ca4ce,null));}; \ No newline at end of file +var _0xb10b=['Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','Setting','findOne','enableEmailPreview','show','params','rawAttributes','includeAll','include','merge','options','create','body','describe','addMessage','ids','omit','getMessages','nolimit','pick','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','inlineCss','rows','spread','emit','mailInteractionTags:save','removeTags','download','unix','join','server','tmp','root','files','attachments','transcript-%d-%s.zip','Attachment','Attachments','Messages','subject','get','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','basename','existsSync','build','message%d.eml','unlinkSync','eml-format','zip-dir','moment','bluebird','path','lodash','squel','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','then','error','stack','name','send','fullname','TagIds','Tags','split','forEach','push','MailMessage','out','-id','trimStart','plainBody','catch','index','map','MailInteraction','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','field','color','tools_tags','u.id','ui.MailInteractionId','from','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','select','mail_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','it.MailInteractionId\x20=\x20i.id','expr','search','parseSearch','conditions','length','find','unreadMessages','value','having','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','some','compact','isEmpty','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','isEmail','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','MailAccountId','i.MailAccountId\x20IS\x20NOT\x20NULL','role','getMailAccounts','i.MailAccountId\x20IS\x20NULL','agent','toString','sequelize','keyBy','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.createdAt','i.updatedAt','i.closed','i.attach','i.lastMsgAt','i.subject','i.disposition','i.secondDisposition','i.thirdDisposition','i.ContactId','i.MailAccountId','Contact.firstName','c.email'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0xb10b,0x12a));var _0xbb10=function(_0x5e8b46,_0x21eb4a){_0x5e8b46=_0x5e8b46-0x0;var _0x252814=_0xb10b[_0x5e8b46];return _0x252814;};'use strict';var emlformat=require(_0xbb10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var BPromise=require(_0xbb10('0x3'));var util=require('util');var path=require(_0xbb10('0x4'));var fs=require('fs');var _=require(_0xbb10('0x5'));var squel=require(_0xbb10('0x6'));var juice=require(_0xbb10('0x7'));var Redis=require(_0xbb10('0x8'));var qs=require(_0xbb10('0x9'));var as=require('../../components/parsers/advancedSearch');var logger=require(_0xbb10('0xa'))(_0xbb10('0xb'));var config=require('../../config/environment');var db=require(_0xbb10('0xc'))['db'];config[_0xbb10('0xd')]=_[_0xbb10('0xe')](config[_0xbb10('0xd')],{'host':_0xbb10('0xf'),'port':0x18eb});var socket=require(_0xbb10('0x10'))(new Redis(config[_0xbb10('0xd')]));require(_0xbb10('0x11'))['register'](socket);function respondWithStatusCode(_0x4e47f8,_0x20bd61){_0x20bd61=_0x20bd61||0xcc;return function(_0x118a74){if(_0x118a74){return _0x4e47f8[_0xbb10('0x12')](_0x20bd61);}return _0x4e47f8['status'](_0x20bd61)[_0xbb10('0x13')]();};}function respondWithResult(_0x5be7e0,_0x44fb19){_0x44fb19=_0x44fb19||0xc8;return function(_0x916a32){if(_0x916a32){return _0x5be7e0[_0xbb10('0x14')](_0x44fb19)[_0xbb10('0x15')](_0x916a32);}};}function respondWithFilteredResult(_0x442548,_0x147230){return function(_0x58a612){if(_0x58a612){var _0x26e021=typeof _0x147230[_0xbb10('0x16')]===_0xbb10('0x17')&&typeof _0x147230[_0xbb10('0x18')]===_0xbb10('0x17');var _0x2f2ebf=_0x58a612[_0xbb10('0x19')];var _0x36b5e8=_0x26e021?0x0:_0x147230[_0xbb10('0x16')];var _0x2b184e=_0x26e021?_0x58a612['count']:_0x147230[_0xbb10('0x16')]+_0x147230[_0xbb10('0x18')];var _0x133ac2;if(_0x2b184e>=_0x2f2ebf){_0x2b184e=_0x2f2ebf;_0x133ac2=0xc8;}else{_0x133ac2=0xce;}_0x442548[_0xbb10('0x14')](_0x133ac2);return _0x442548[_0xbb10('0x1a')](_0xbb10('0x1b'),_0x36b5e8+'-'+_0x2b184e+'/'+_0x2f2ebf)[_0xbb10('0x15')](_0x58a612);}return null;};}function saveUpdates(_0x30efc6){return function(_0xbf2906){if(_0xbf2906){return _0xbf2906[_0xbb10('0x1c')](_0x30efc6)['then'](function(_0x5ff0cf){return _0x5ff0cf;});}return null;};}function removeEntity(_0x19f48d){return function(_0x388fab){if(_0x388fab){return _0x388fab[_0xbb10('0x1d')]()[_0xbb10('0x1e')](function(){_0x19f48d[_0xbb10('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12f888){return function(_0x12ef77){if(!_0x12ef77){_0x12f888['sendStatus'](0x194);}return _0x12ef77;};}function handleError(_0x4c4b0d,_0x8e2b97){_0x8e2b97=_0x8e2b97||0x1f4;return function(_0x311abe){logger[_0xbb10('0x1f')](_0x311abe[_0xbb10('0x20')]);if(_0x311abe[_0xbb10('0x21')]){delete _0x311abe[_0xbb10('0x21')];}_0x4c4b0d[_0xbb10('0x14')](_0x8e2b97)[_0xbb10('0x22')](_0x311abe);};}function getInteractionUsers(_0x7f2377,_0x395404){return new BPromise(function(_0x3ba6cd,_0x26ad93){try{if(_0x395404[_0x7f2377['id']]){_0x7f2377['Users']=_['map'](_0x395404[_0x7f2377['id']],function(_0x4fb5e0){return{'id':_0x4fb5e0['id'],'fullname':_0x4fb5e0[_0xbb10('0x23')]};});}}catch(_0x3c5ae7){_0x26ad93(_0x3c5ae7);}_0x3ba6cd(_0x7f2377);});}function getInteractionTags(_0x2c89b9,_0x4e25ff){return new BPromise(function(_0x2fdde9,_0x24d586){try{if(_0x2c89b9[_0xbb10('0x24')]){_0x2c89b9[_0xbb10('0x25')]=[];_0x2c89b9[_0xbb10('0x24')][_0xbb10('0x26')](',')[_0xbb10('0x27')](function(_0x4aabb9){_0x2c89b9[_0xbb10('0x25')][_0xbb10('0x28')](_0x4e25ff[_0x4aabb9]);});}delete _0x2c89b9[_0xbb10('0x24')];}catch(_0x2e0249){_0x24d586(_0x2e0249);}_0x2fdde9(_0x2c89b9);});}function getLastMessageText(_0x1d30aa){return new BPromise(function(_0x2ff4c1,_0x5d5c80){return db[_0xbb10('0x29')]['findOne']({'where':{'$and':[{'MailInteractionId':_0x1d30aa['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xbb10('0x2a')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0xbb10('0x2b'),'raw':!![]})[_0xbb10('0x1e')](function(_0x1b59f9){if(_0x1b59f9&&_0x1b59f9['plainBody']){_0x1d30aa['lastMsgText']=_[_0xbb10('0x2c')](_0x1b59f9[_0xbb10('0x2d')]);}_0x2ff4c1(_0x1d30aa);})['catch'](function(_0x359ad4){_0x5d5c80(_0x359ad4);});});}function updateMailInteraction(_0x37dde7,_0x2f653f,_0x1c0b57,_0x37a83f){return new BPromise(function(_0x138bc6,_0xf85197){return getInteractionUsers(_0x37dde7,_0x1c0b57)['then'](function(_0x25acb3){return getInteractionTags(_0x25acb3,_0x2f653f);})[_0xbb10('0x1e')](function(_0x441d15){if(_0x37a83f){_0x138bc6(getLastMessageText(_0x441d15));}else{_0x138bc6(_0x441d15);}})[_0xbb10('0x2e')](function(_0xfb2c5e){_0xf85197(_0xfb2c5e);});});}exports[_0xbb10('0x2f')]=function(_0x188cbd,_0x10202c){var _0x3c8d7d={},_0x56943c={},_0x2b5352={'count':0x0,'rows':[]};var _0x150107=_[_0xbb10('0x30')](db[_0xbb10('0x31')]['rawAttributes'],function(_0x111762){return{'name':_0x111762['fieldName'],'type':_0x111762['type'][_0xbb10('0x32')]};});_0x56943c[_0xbb10('0x33')]=_[_0xbb10('0x30')](_0x150107,_0xbb10('0x21'));_0x56943c[_0xbb10('0x34')]=_[_0xbb10('0x35')](_0x188cbd['query']);_0x56943c[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x56943c['model'],_0x56943c['query']);_0x3c8d7d['attributes']=_[_0xbb10('0x37')](_0x56943c[_0xbb10('0x33')],qs[_0xbb10('0x38')](_0x188cbd['query'][_0xbb10('0x38')]));_0x3c8d7d[_0xbb10('0x39')]=_0x3c8d7d[_0xbb10('0x39')]['length']?_0x3c8d7d[_0xbb10('0x39')]:_0x56943c[_0xbb10('0x33')];if(!_0x188cbd[_0xbb10('0x34')][_0xbb10('0x3a')]('nolimit')){_0x3c8d7d[_0xbb10('0x18')]=qs[_0xbb10('0x18')](_0x188cbd['query'][_0xbb10('0x18')]);_0x3c8d7d[_0xbb10('0x16')]=qs[_0xbb10('0x16')](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x16')]);}_0x3c8d7d[_0xbb10('0x3b')]=qs['sort'](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x3c')]);_0x3c8d7d[_0xbb10('0x3d')]=qs[_0xbb10('0x36')](_['pick'](_0x188cbd[_0xbb10('0x34')],_0x56943c[_0xbb10('0x36')]),_0x150107);var _0x23dc18=[];var _0x403beb=squel['select']()[_0xbb10('0x3e')]('id')[_0xbb10('0x3e')]('name')['field'](_0xbb10('0x3f'))['from'](_0xbb10('0x40'));var _0x180933=squel['select']()[_0xbb10('0x3e')](_0xbb10('0x41'))[_0xbb10('0x3e')]('u.fullname')[_0xbb10('0x3e')](_0xbb10('0x42'))[_0xbb10('0x43')](_0xbb10('0x44'),'ui')[_0xbb10('0x45')](_0xbb10('0x46'),'u',_0xbb10('0x47'));var _0x3efa96=squel[_0xbb10('0x48')]()[_0xbb10('0x43')](_0xbb10('0x49'),'i')[_0xbb10('0x45')]('cm_contacts','c',_0xbb10('0x4a'))[_0xbb10('0x45')]('users','o',_0xbb10('0x4b'))[_0xbb10('0x45')](_0xbb10('0x4c'),'a',_0xbb10('0x4d'))[_0xbb10('0x45')](_0xbb10('0x4e'),'me',_0xbb10('0x4f'))['left_join']('mail_interaction_has_tags','it',_0xbb10('0x50'))[_0xbb10('0x45')](_0xbb10('0x40'),'t','t.id\x20=\x20it.TagId');var _0x5f0c12=squel[_0xbb10('0x51')]();var _0x34cf4e=[];var _0x1bd054=squel[_0xbb10('0x51')]();var _0x10159b;if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x52')]){_0x10159b=as[_0xbb10('0x53')](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x52')]);var _0x550111=_0x10159b['sqlOperator'];for(var _0x412e13=0x0;_0x412e13<_0x10159b[_0xbb10('0x54')][_0xbb10('0x55')];_0x412e13++){var _0xb014b0=_0x10159b[_0xbb10('0x54')][_0x412e13];var _0x440f9e='i';var _0x358e7e=_[_0xbb10('0x56')](_0x150107,[_0xbb10('0x21'),_0xb014b0[_0xbb10('0x3e')]]);if(!_0x358e7e){switch(_0xb014b0[_0xbb10('0x3e')]){case _0xbb10('0x57'):if(_0xb014b0[_0xbb10('0x58')]==0x1){_0x3efa96[_0xbb10('0x59')]('`'+_0xb014b0[_0xbb10('0x3e')]+'`\x20=\x200');}else{_0x3efa96[_0xbb10('0x59')]('`'+_0xb014b0['field']+_0xbb10('0x5a'));}break;case _0xbb10('0x5b'):if(_0xb014b0[_0xbb10('0x5c')]===_0xbb10('0x5d')){if(_0xb014b0[_0xbb10('0x58')][_0xbb10('0x26')]('\x20')[_0xbb10('0x55')]>0x1){_0x5f0c12[_0x550111](_0xbb10('0x5e'),qs[_0xbb10('0x5f')](_0xb014b0[_0xbb10('0x58')]),null);}else{var _0x44a056='%'+_0xb014b0[_0xbb10('0x58')]+'%';_0x5f0c12[_0x550111](_0xbb10('0x60'),_0x44a056,_0x44a056,_0x44a056);}}else{_0x358e7e=_[_0xbb10('0x56')](_0x150107,[_0xbb10('0x21'),'ContactId']);_0xb014b0[_0xbb10('0x3e')]=_0xbb10('0x61');_0x155dc5=as[_0xbb10('0x62')](_0x440f9e,_0x358e7e[_0xbb10('0x63')],_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5[_0xbb10('0x64')],_0x155dc5[_0xbb10('0x58')]['start'],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x13')]);}break;case _0xbb10('0x65'):var _0x14fed3=_0xb014b0[_0xbb10('0x58')][_0xbb10('0x26')](',')[_0xbb10('0x30')](function(_0x12ec18){return Number(_0x12ec18);});_0x14fed3[_0xbb10('0x27')](function(_0x40c4fb){_0x1bd054['or'](_0xbb10('0x66'),'%,'+_0x40c4fb+',%');});_0x34cf4e=_[_0xbb10('0x67')](_0x34cf4e,_0x14fed3);break;case _0xbb10('0x68'):if(_0xb014b0['operator']==='$substring'){_0x5f0c12[_0x550111](_0xbb10('0x69'),'%'+_0xb014b0[_0xbb10('0x58')]+'%',null);}else{_0x358e7e=_[_0xbb10('0x56')](_0x150107,[_0xbb10('0x21'),'UserId']);_0xb014b0['field']=_0xbb10('0x6a');_0x155dc5=as[_0xbb10('0x62')](_0x440f9e,_0x358e7e[_0xbb10('0x63')],_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5[_0xbb10('0x64')],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x6b')],_0x155dc5[_0xbb10('0x58')]['end']);}break;case _0xbb10('0x2d'):_0x155dc5=as[_0xbb10('0x62')]('me',null,_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5['text'],_0x155dc5['value']['start'],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x13')]);break;}}else{var _0x155dc5=as['buildExpression'](_0x440f9e,_0x358e7e['type'],_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5['text'],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x6b')],_0x155dc5[_0xbb10('0x58')]['end']);}}}else{var _0xa1bbd9=_(_0x188cbd[_0xbb10('0x34')])['keys']()['map'](function(_0x27d7b9){return _[_0xbb10('0x6c')](_0x150107,[_0xbb10('0x21'),_0x27d7b9])?_0x27d7b9:undefined;})[_0xbb10('0x6d')]()['value']();if(!_[_0xbb10('0x6e')](_0xa1bbd9)){_0xa1bbd9[_0xbb10('0x27')](function(_0xa7179d){if(_0xa7179d==='MailAccountId'){_0x3efa96[_0xbb10('0x3d')](_0xbb10('0x6f'),[][_0xbb10('0x70')](_0x188cbd['query'][_0xa7179d]));}else if(_0xa7179d===_0xbb10('0x71')){var _0x31e85e=JSON[_0xbb10('0x72')](_0x188cbd[_0xbb10('0x34')][_0xa7179d])['$gte'];var _0x251417=JSON[_0xbb10('0x72')](_0x188cbd[_0xbb10('0x34')][_0xa7179d])[_0xbb10('0x73')];_0x3efa96['where'](_0xbb10('0x74'),_0x31e85e,_0x251417);}else{if(_0x188cbd[_0xbb10('0x34')][_0xa7179d]===_0xbb10('0x75')){_0x3efa96[_0xbb10('0x3d')]('i.'+_0xa7179d+_0xbb10('0x76'));}else{_0x3efa96[_0xbb10('0x3d')]('i.'+_0xa7179d+_0xbb10('0x77'),_0x188cbd['query'][_0xa7179d]);}}});}if(_0x188cbd['query']['read']){if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x78')]==0x1){_0x3efa96[_0xbb10('0x59')]('`unreadMessages`\x20=\x200');}else{_0x3efa96['having'](_0xbb10('0x79'));}}if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7a')]){_0x34cf4e=_[_0xbb10('0x7b')](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7a')])?_0x188cbd['query'][_0xbb10('0x7a')]:new Array(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7a')]);_0x34cf4e[_0xbb10('0x27')](function(_0x2aaaa6){_0x1bd054['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2aaaa6+',%');});}if(_0x188cbd['query']['filter']){var _0x329da7=_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7c')][_0xbb10('0x7d')]('\x5c','\x5c\x5c')[_0xbb10('0x7d')](/'/g,'\x27\x27');if(qs[_0xbb10('0x7e')](_0x329da7)){_0x5f0c12['or']('i.id\x20LIKE\x20?',_0x329da7+'%');}else if(qs[_0xbb10('0x7f')](_0x329da7)){_0x5f0c12['or']('c.email\x20LIKE\x20?',_0x329da7+'%');}else{_0x5f0c12['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x329da7))['or'](_0xbb10('0x80'),qs[_0xbb10('0x5f')](_0x329da7));}}}_0x3efa96[_0xbb10('0x3d')](_0x5f0c12);_0x3efa96[_0xbb10('0x81')]('i.id');var _0x122d38={'type':db['Sequelize']['QueryTypes'][_0xbb10('0x82')],'raw':!![]};var _0xfe3db0=_0x3efa96[_0xbb10('0x83')]();_0xfe3db0[_0xbb10('0x3e')](_0xbb10('0x84'));_0xfe3db0['field'](_0xbb10('0x85'),_0xbb10('0x57'));if(_0x3c8d7d[_0xbb10('0x3b')]){_0x3c8d7d[_0xbb10('0x3b')][_0xbb10('0x27')](function(_0x27f42f){var _0x174395=_0x27f42f[0x0]==='contactName'?_0x27f42f[0x0]:'i.'+_0x27f42f[0x0];_0x3efa96[_0xbb10('0x3b')](_0x174395,_0x27f42f[0x1]===_0xbb10('0x86')?![]:!![]);});}if(!_[_0xbb10('0x6e')](_0x34cf4e)){_0x3efa96[_0xbb10('0x59')](_0x1bd054);_0xfe3db0[_0xbb10('0x3d')](_0xbb10('0x87'),_0x34cf4e);}BPromise[_0xbb10('0x88')]()[_0xbb10('0x1e')](function(){if(!_0x10159b){if(_0x188cbd['query'][_0xbb10('0x89')])return;_0xfe3db0[_0xbb10('0x3d')](_0xbb10('0x8a'));_0x3efa96['where']('i.MailAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x188cbd['user'][_0xbb10('0x8b')]!=='agent')return;return _0x188cbd['user'][_0xbb10('0x8c')]({'attributes':['id'],'raw':!![]})[_0xbb10('0x1e')](function(_0x33ff06){if(_[_0xbb10('0x6e')](_0x33ff06)){_0xfe3db0[_0xbb10('0x3d')](_0xbb10('0x8d'));_0x3efa96[_0xbb10('0x3d')](_0xbb10('0x8d'));}else{_0xfe3db0[_0xbb10('0x3d')]('i.MailAccountId\x20IN\x20?',_[_0xbb10('0x30')](_0x33ff06,'id'));_0x3efa96[_0xbb10('0x3d')](_0xbb10('0x6f'),_[_0xbb10('0x30')](_0x33ff06,'id'));}});})['then'](function(){if(_0x188cbd['user'][_0xbb10('0x8b')]===_0xbb10('0x8e')&&!_0x10159b&&!_0x188cbd[_0xbb10('0x34')][_0xbb10('0x89')])return[];return db['sequelize'][_0xbb10('0x34')](_0xfe3db0[_0xbb10('0x8f')](),_0x122d38);})[_0xbb10('0x1e')](function(_0xf7b3e1){_0x2b5352[_0xbb10('0x19')]=_0xf7b3e1['length'];if(_0x2b5352['count']===0x0)return[];return db[_0xbb10('0x90')][_0xbb10('0x34')](_0x403beb[_0xbb10('0x8f')](),_0x122d38)['then'](function(_0x256b35){_0x23dc18=_[_0xbb10('0x91')](_0x256b35,'id');_0x122d38=_['merge'](_0x122d38,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x38')]){_0x3c8d7d[_0xbb10('0x39')]['forEach'](function(_0x32d5a5){_0x3efa96[_0xbb10('0x3e')]('i.'+_0x32d5a5);});}else{_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x85'),_0xbb10('0x57'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x92'),_0xbb10('0x93'));_0x3efa96[_0xbb10('0x3e')]('a.mandatoryDisposition',_0xbb10('0x94'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x95'),_0xbb10('0x96'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x84'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x97'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x98'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x99'));_0x3efa96['field']('i.closedAt');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9a'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9b'));_0x3efa96[_0xbb10('0x3e')]('i.lastMsgDirection');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9c'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9d'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9e'));_0x3efa96['field'](_0xbb10('0x9f'));_0x3efa96[_0xbb10('0x3e')]('i.substatus');_0x3efa96[_0xbb10('0x3e')]('i.to');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa0'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa1'));_0x3efa96[_0xbb10('0x3e')]('i.UserId');_0x3efa96[_0xbb10('0x3e')]('c.firstName',_0xbb10('0xa2'));_0x3efa96[_0xbb10('0x3e')]('c.lastName','Contact.lastName');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa3'),_0xbb10('0xa4'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa5'),_0xbb10('0xa6'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa7'),_0xbb10('0xa8'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa9'),'Contact.fax');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xaa'),_0xbb10('0xab'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xac'),_0xbb10('0xad'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xae'),_0xbb10('0x24'));}if(_0x3c8d7d[_0xbb10('0x18')])_0x3efa96[_0xbb10('0x18')](_0x3c8d7d[_0xbb10('0x18')]);if(_0x3c8d7d['offset'])_0x3efa96[_0xbb10('0x16')](_0x3c8d7d['offset']);return db[_0xbb10('0x90')][_0xbb10('0x34')](_0x3efa96[_0xbb10('0x8f')](),_0x122d38);})[_0xbb10('0x1e')](function(_0x38d369){if(_0x38d369['length']>0x0)_0x180933[_0xbb10('0x3d')](_0xbb10('0xaf'),_[_0xbb10('0x30')](_0x38d369,'id'));return db[_0xbb10('0x90')][_0xbb10('0x34')](_0x180933[_0xbb10('0x8f')](),_0x122d38)['then'](function(_0x4bd470){var _0x5cc9d7=_[_0xbb10('0xb0')](_0x4bd470,_0xbb10('0xb1'));var _0x57d5a1=[];return db[_0xbb10('0xb2')][_0xbb10('0xb3')]({'attributes':['enableEmailPreview'],'raw':!![]})[_0xbb10('0x1e')](function(_0xaede56){var _0x5642c3=_0xaede56[_0xbb10('0xb4')];_0x38d369['forEach'](function(_0x34cec7){_0x57d5a1[_0xbb10('0x28')](updateMailInteraction(_0x34cec7,_0x23dc18,_0x5cc9d7,_0x5642c3));});return BPromise['all'](_0x57d5a1);});});});})[_0xbb10('0x1e')](function(_0x28cc74){_0x2b5352['rows']=_0x28cc74;return _0x2b5352;})['then'](respondWithFilteredResult(_0x10202c,_0x3c8d7d))[_0xbb10('0x2e')](handleError(_0x10202c,null));};exports[_0xbb10('0xb5')]=function(_0x3e0e34,_0x3299bc){var _0x3ceb77={'raw':![],'where':{'id':_0x3e0e34[_0xbb10('0xb6')]['id']}},_0x4c3bdc={};_0x4c3bdc[_0xbb10('0x33')]=_[_0xbb10('0x35')](db['MailInteraction'][_0xbb10('0xb7')]);_0x4c3bdc[_0xbb10('0x34')]=_[_0xbb10('0x35')](_0x3e0e34[_0xbb10('0x34')]);_0x4c3bdc[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x4c3bdc[_0xbb10('0x33')],_0x4c3bdc[_0xbb10('0x34')]);_0x3ceb77[_0xbb10('0x39')]=_['intersection'](_0x4c3bdc['model'],qs[_0xbb10('0x38')](_0x3e0e34[_0xbb10('0x34')][_0xbb10('0x38')]));_0x3ceb77[_0xbb10('0x39')]=_0x3ceb77[_0xbb10('0x39')][_0xbb10('0x55')]?_0x3ceb77[_0xbb10('0x39')]:_0x4c3bdc[_0xbb10('0x33')];if(_0x3e0e34[_0xbb10('0x34')][_0xbb10('0xb8')]){_0x3ceb77[_0xbb10('0xb9')]=[{'all':!![]}];}_0x3ceb77=_[_0xbb10('0xba')]({},_0x3ceb77,_0x3e0e34[_0xbb10('0xbb')]);return db['MailInteraction'][_0xbb10('0x56')](_0x3ceb77)[_0xbb10('0x1e')](handleEntityNotFound(_0x3299bc,null))[_0xbb10('0x1e')](respondWithResult(_0x3299bc,null))[_0xbb10('0x2e')](handleError(_0x3299bc,null));};exports[_0xbb10('0xbc')]=function(_0xd9284e,_0x4258fc){return db[_0xbb10('0x31')][_0xbb10('0xbc')](_0xd9284e[_0xbb10('0xbd')],{})[_0xbb10('0x1e')](respondWithResult(_0x4258fc,0xc9))['catch'](handleError(_0x4258fc,null));};exports[_0xbb10('0x1c')]=function(_0x5e1ac5,_0x3faaca){if(_0x5e1ac5[_0xbb10('0xbd')]['id']){delete _0x5e1ac5[_0xbb10('0xbd')]['id'];}return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x5e1ac5[_0xbb10('0xb6')]['id']}})['then'](handleEntityNotFound(_0x3faaca,null))[_0xbb10('0x1e')](saveUpdates(_0x5e1ac5['body'],null))[_0xbb10('0x1e')](respondWithResult(_0x3faaca,null))[_0xbb10('0x2e')](handleError(_0x3faaca,null));};exports[_0xbb10('0x1d')]=function(_0x576bb6,_0x2b652c){return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x576bb6[_0xbb10('0xb6')]['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x2b652c,null))[_0xbb10('0x1e')](removeEntity(_0x2b652c,null))[_0xbb10('0x2e')](handleError(_0x2b652c,null));};exports[_0xbb10('0xbe')]=function(_0x589565,_0x3696b3){return db['MailInteraction'][_0xbb10('0xbe')]()[_0xbb10('0x1e')](respondWithResult(_0x3696b3,null))[_0xbb10('0x2e')](handleError(_0x3696b3,null));};exports[_0xbb10('0xbf')]=function(_0x44c229,_0x40271f){return db[_0xbb10('0x29')]['find']({'where':{'id':_0x44c229[_0xbb10('0xb6')]['id']}})['then'](handleEntityNotFound(_0x40271f,null))['then'](function(_0x1513e0){if(_0x1513e0){return _0x1513e0[_0xbb10('0xbf')](_0x44c229[_0xbb10('0xbd')][_0xbb10('0xc0')],_[_0xbb10('0xc1')](_0x44c229[_0xbb10('0xbd')],['ids','id'])||{});}})[_0xbb10('0x1e')](respondWithResult(_0x40271f,null))[_0xbb10('0x2e')](handleError(_0x40271f,null));};exports[_0xbb10('0xc2')]=function(_0xb1b7c8,_0x136520){var _0x28127c={'raw':![],'where':{}};var _0x528aff={};var _0xdfdc42={'count':0x0,'rows':[]};return db[_0xbb10('0x31')][_0xbb10('0xb3')]({'where':{'id':_0xb1b7c8[_0xbb10('0xb6')]['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x136520,null))[_0xbb10('0x1e')](function(_0x2764e1){if(_0x2764e1){_0x528aff['model']=_[_0xbb10('0x35')](db['MailMessage'][_0xbb10('0xb7')]);_0x528aff['query']=_['keys'](_0xb1b7c8[_0xbb10('0x34')]);_0x528aff[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x528aff[_0xbb10('0x33')],_0x528aff[_0xbb10('0x34')]);_0x28127c['attributes']=_[_0xbb10('0x37')](_0x528aff['model'],qs['fields'](_0xb1b7c8['query'][_0xbb10('0x38')]));_0x28127c[_0xbb10('0x39')]=_0x28127c[_0xbb10('0x39')][_0xbb10('0x55')]?_0x28127c[_0xbb10('0x39')]:_0x528aff['model'];if(!_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x3a')](_0xbb10('0xc3'))){_0x28127c[_0xbb10('0x18')]=qs[_0xbb10('0x18')](_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x18')]);_0x28127c['offset']=qs['offset'](_0xb1b7c8['query'][_0xbb10('0x16')]);}_0x28127c[_0xbb10('0x3b')]=qs[_0xbb10('0x3c')](_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x3c')]);_0x28127c[_0xbb10('0x3d')]=qs[_0xbb10('0x36')](_[_0xbb10('0xc4')](_0xb1b7c8[_0xbb10('0x34')],_0x528aff[_0xbb10('0x36')]));_0x28127c['where']['MailInteractionId']=_0x2764e1['id'];if(_0xb1b7c8['query'][_0xbb10('0x7c')]){_0x28127c[_0xbb10('0x3d')]=_[_0xbb10('0xba')](_0x28127c['where'],{'$or':_[_0xbb10('0x30')](_0x28127c[_0xbb10('0x39')],function(_0x2c638d){var _0x290280={};_0x290280[_0x2c638d]={'$like':'%'+_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x7c')]+'%'};return _0x290280;})});}if(_0xb1b7c8['query']['$gte']){var _0x356660=_0xb1b7c8['query'][_0xbb10('0xc5')][_0xbb10('0x26')](',');var _0x152ca9={};_0x152ca9[_0x356660[0x0]]={'$gte':moment(_0x356660[0x1])[_0xbb10('0xc6')](_0xbb10('0xc7'))};_0x28127c[_0xbb10('0x3d')]=_[_0xbb10('0xba')](_0x28127c[_0xbb10('0x3d')],_0x152ca9);}_0x28127c=_[_0xbb10('0xba')]({},_0x28127c,_0xb1b7c8[_0xbb10('0xbb')]);return db['MailMessage'][_0xbb10('0x19')]({'where':_0x28127c['where']})[_0xbb10('0x1e')](function(_0x5547fa){_0xdfdc42[_0xbb10('0x19')]=_0x5547fa;if(_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0xb8')]){_0x28127c[_0xbb10('0xb9')]=[{'all':!![]}];}return db['MailMessage'][_0xbb10('0xc8')](_0x28127c);})['then'](function(_0xfe1154){if(_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0xc9')]==='true'){for(var _0x298167=0x0;_0x298167<_0xfe1154[_0xbb10('0x55')];_0x298167++){_0xfe1154[_0x298167][_0xbb10('0xbd')]=juice(_0xfe1154[_0x298167][_0xbb10('0xbd')]);}}_0xdfdc42[_0xbb10('0xca')]=_0xfe1154;return _0xdfdc42;});}})[_0xbb10('0x1e')](respondWithFilteredResult(_0x136520,_0x28127c))['catch'](handleError(_0x136520,null));};exports['addTags']=function(_0x522a88,_0x26a752){return db['MailInteraction'][_0xbb10('0x56')]({'where':{'id':_0x522a88['params']['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x26a752,null))[_0xbb10('0x1e')](function(_0x385ad3){if(_0x385ad3){return _0x385ad3['setTags'](_0x522a88['body'][_0xbb10('0xc0')],_[_0xbb10('0xc1')](_0x522a88[_0xbb10('0xbd')],['ids','id'])||{})[_0xbb10('0xcb')](function(){return db[_0xbb10('0x65')][_0xbb10('0xc8')]({'attributes':['id','name','color'],'where':{'id':_0x522a88['body'][_0xbb10('0xc0')]}});})['then'](function(_0x3dfbcd){socket[_0xbb10('0xcc')](_0xbb10('0xcd'),{'id':Number(_0x522a88[_0xbb10('0xb6')]['id']),'tags':_0x3dfbcd||[]});return{'id':Number(_0x522a88[_0xbb10('0xb6')]['id']),'tags':_0x3dfbcd||[]};});}})[_0xbb10('0x1e')](respondWithResult(_0x26a752,null))[_0xbb10('0x2e')](handleError(_0x26a752,null));};exports[_0xbb10('0xce')]=function(_0x2746eb,_0x431792){return db[_0xbb10('0x31')]['find']({'where':{'id':_0x2746eb[_0xbb10('0xb6')]['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x431792,null))['then'](function(_0x14ef50){if(_0x14ef50){return _0x14ef50['removeTags'](_0x2746eb['query'][_0xbb10('0xc0')]);}})[_0xbb10('0x1e')](respondWithStatusCode(_0x431792,null))[_0xbb10('0x2e')](handleError(_0x431792,null));};exports[_0xbb10('0xcf')]=function(_0x99c4,_0x4ca4ce){var _0x161171=moment()[_0xbb10('0xd0')]()['toString']();var _0xa45726=path[_0xbb10('0xd1')](config['root'],_0xbb10('0xd2'),'files',_0xbb10('0xd3'));var _0x8e8049=path[_0xbb10('0xd1')](config[_0xbb10('0xd4')],_0xbb10('0xd2'),_0xbb10('0xd5'),_0xbb10('0xd6'));var _0x56f902=path[_0xbb10('0xd1')](_0xa45726,_0x161171);var _0x4720a1=util[_0xbb10('0xc6')](_0xbb10('0xd7'),_0x99c4[_0xbb10('0xb6')]['id'],_0x161171);var _0x1301e3=path['join'](_0xa45726,_0x4720a1);var _0x550301=[];if(_0x99c4['query'][_0xbb10('0xd6')]){_0x550301[_0xbb10('0x28')]({'model':db[_0xbb10('0xd8')],'as':_0xbb10('0xd9'),'raw':!![]});}var _0x57700b=[{'model':db[_0xbb10('0x29')],'as':_0xbb10('0xda'),'attributes':['id',_0xbb10('0xbd'),'from','to','cc','bcc',_0xbb10('0xdb'),'createdAt'],'where':{'secret':![]},'order':qs[_0xbb10('0x3c')]('id'),'include':_0x550301}];return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x99c4[_0xbb10('0xb6')]['id']},'include':_0x57700b})[_0xbb10('0x1e')](handleEntityNotFound(_0x4ca4ce,null))[_0xbb10('0x1e')](function(_0x1fe250){if(_0x1fe250&&_0x1fe250['Messages']){var _0x424371=_0x1fe250[_0xbb10('0xdc')]({'plain':!![]});fs['mkdirSync'](_0x56f902);return BPromise[_0xbb10('0xdd')](_0x424371[_0xbb10('0xda')],function(_0x32f261,_0x5b11a2){var _0x4b490a={'from':_0x32f261['from'],'to':_0x32f261['to'],'subject':_0x32f261[_0xbb10('0xdb')],'html':_0x32f261[_0xbb10('0xbd')],'headers':{'Date':moment(_0x32f261['createdAt'])[_0xbb10('0xc6')](_0xbb10('0xde'))},'attachments':[]};if(_0x32f261['cc']){_0x4b490a[_0xbb10('0xdf')]['Cc']=_0x32f261['cc'];}if(_0x32f261[_0xbb10('0xe0')]){_0x4b490a[_0xbb10('0xdf')][_0xbb10('0xe1')]=_0x32f261[_0xbb10('0xe0')];}return new BPromise(function(_0x48f0eb,_0x304603){if(_0x32f261['Attachments']){for(var _0x5a7c4e=0x0;_0x5a7c4e<_0x32f261['Attachments'][_0xbb10('0x55')];_0x5a7c4e++){var _0x572d73=_0x32f261['Attachments'][_0x5a7c4e];var _0x1f09f1=path['join'](_0x8e8049,_0x572d73[_0xbb10('0xe2')]);if(fs[_0xbb10('0xe3')](_0x1f09f1)){_0x4b490a[_0xbb10('0xd6')]['push']({'name':_0x572d73['name'],'contentType':_0x572d73[_0xbb10('0x63')],'data':fs['readFileSync'](_0x1f09f1)});}}}emlformat[_0xbb10('0xe4')](_0x4b490a,function(_0x211172,_0x589ecb){if(_0x211172)return _0x304603(_0x211172);fs['writeFileSync'](path[_0xbb10('0xd1')](_0x56f902,util[_0xbb10('0xc6')](_0xbb10('0xe5'),_0x5b11a2)),_0x589ecb);return _0x48f0eb(_0x589ecb);});});})['then'](function(){return new BPromise(function(_0x4f4aa8,_0x426a4f){zipdir(_0x56f902,{'saveTo':_0x1301e3},function(_0x22f153,_0x4d47cc){if(_0x22f153)return _0x426a4f(_0x22f153);return _0x4f4aa8(_0x4d47cc);});})[_0xbb10('0x1e')](function(){return new BPromise(function(_0x203e5a,_0xe88e90){rimraf(_0x56f902,function(_0x4845b5){if(_0x4845b5)_0xe88e90(_0x4845b5);return _0x203e5a();});});})[_0xbb10('0x1e')](function(){return _0x4ca4ce[_0xbb10('0xcf')](_0x1301e3,_0x4720a1,function(_0x166f4f){if(!_0x166f4f)fs[_0xbb10('0xe6')](_0x1301e3);});});});}else{return _0x4ca4ce[_0xbb10('0x12')](0xc8);}})[_0xbb10('0x2e')](handleError(_0x4ca4ce,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 20211c2..12647cb 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 _0x9ef2=['hasOwnProperty','hook','exports','events','../../mysqldb','MailInteraction','setMaxListeners','save','update','remove','then','setDataValue','Users','map','unreadMessages','length','emit','catch'];(function(_0x56f935,_0xbb3e13){var _0x25ff2f=function(_0x3d0fad){while(--_0x3d0fad){_0x56f935['push'](_0x56f935['shift']());}};_0x25ff2f(++_0xbb3e13);}(_0x9ef2,0xdb));var _0x29ef=function(_0x2359a3,_0x39fac1){_0x2359a3=_0x2359a3-0x0;var _0x4d4e3b=_0x9ef2[_0x2359a3];return _0x4d4e3b;};'use strict';var EventEmitter=require(_0x29ef('0x0'));var MailInteraction=require(_0x29ef('0x1'))['db'][_0x29ef('0x2')];var MailMessage=require('../../mysqldb')['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x29ef('0x3')](0x0);var events={'afterCreate':_0x29ef('0x4'),'afterUpdate':_0x29ef('0x5'),'afterDestroy':_0x29ef('0x6')};function emitEvent(_0x559da7){return function(_0x576e48,_0x5381f6,_0x1e74ed){_0x576e48['getUsers']({'attributes':['id'],'raw':!![]})[_0x29ef('0x7')](function(_0x348647){_0x576e48[_0x29ef('0x8')](_0x29ef('0x9'),_0x348647[_0x29ef('0xa')](function(_0x239ae6){return{'id':_0x239ae6['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x576e48['id'],'direction':'in','read':![]},'raw':!![]});})[_0x29ef('0x7')](function(_0x445aed){_0x576e48[_0x29ef('0x8')](_0x29ef('0xb'),_0x445aed[_0x29ef('0xc')]);MailInteractionEvents[_0x29ef('0xd')](_0x559da7+':'+_0x576e48['id'],_0x576e48);MailInteractionEvents[_0x29ef('0xd')](_0x559da7,_0x576e48);_0x1e74ed(null);})[_0x29ef('0xe')](_0x1e74ed(null));};}for(var e in events){if(events[_0x29ef('0xf')](e)){var event=events[e];MailInteraction[_0x29ef('0x10')](e,emitEvent(event));}}module[_0x29ef('0x11')]=MailInteractionEvents; \ No newline at end of file +var _0x157c=['../../mysqldb','MailMessage','setMaxListeners','update','remove','then','setDataValue','Users','findAll','unreadMessages','length','emit','catch','exports','events','MailInteraction'];(function(_0x562f3b,_0x4c65ae){var _0x1edd55=function(_0xe67e06){while(--_0xe67e06){_0x562f3b['push'](_0x562f3b['shift']());}};_0x1edd55(++_0x4c65ae);}(_0x157c,0x15e));var _0xc157=function(_0xac151d,_0x4ea1d2){_0xac151d=_0xac151d-0x0;var _0x111dba=_0x157c[_0xac151d];return _0x111dba;};'use strict';var EventEmitter=require(_0xc157('0x0'));var MailInteraction=require('../../mysqldb')['db'][_0xc157('0x1')];var MailMessage=require(_0xc157('0x2'))['db'][_0xc157('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xc157('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc157('0x5'),'afterDestroy':_0xc157('0x6')};function emitEvent(_0x5f369e){return function(_0x25ea61,_0x281afe,_0xdd7431){_0x25ea61['getUsers']({'attributes':['id'],'raw':!![]})[_0xc157('0x7')](function(_0x1a7923){_0x25ea61[_0xc157('0x8')](_0xc157('0x9'),_0x1a7923['map'](function(_0x51548b){return{'id':_0x51548b['id']};}));return MailMessage[_0xc157('0xa')]({'where':{'MailInteractionId':_0x25ea61['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc157('0x7')](function(_0x1de482){_0x25ea61[_0xc157('0x8')](_0xc157('0xb'),_0x1de482[_0xc157('0xc')]);MailInteractionEvents[_0xc157('0xd')](_0x5f369e+':'+_0x25ea61['id'],_0x25ea61);MailInteractionEvents[_0xc157('0xd')](_0x5f369e,_0x25ea61);_0xdd7431(null);})[_0xc157('0xe')](_0xdd7431(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module[_0xc157('0xf')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 3a2d235..ca4f294 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 _0x68c5=['substatus','substatusAt','YYYY-MM-DD\x20HH:mm:ss','closedAt','format','changed','closed','get','MailMessage','update','then','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./mailInteraction.attributes','MailInteraction','mail_interactions','fti_mail_interactions','FULLTEXT'];(function(_0x41a8f5,_0x2ab807){var _0x25fb25=function(_0xd197a4){while(--_0xd197a4){_0x41a8f5['push'](_0x41a8f5['shift']());}};_0x25fb25(++_0x2ab807);}(_0x68c5,0x101));var _0x568c=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x68c5[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0x568c('0x0'));var util=require(_0x568c('0x1'));var logger=require(_0x568c('0x2'))(_0x568c('0x3'));var moment=require('moment');var BPromise=require(_0x568c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x568c('0x5'));var rimraf=require(_0x568c('0x6'));var config=require(_0x568c('0x7'));var attributes=require(_0x568c('0x8'));module['exports']=function(_0x1b5731,_0x43bdb0){return _0x1b5731['define'](_0x568c('0x9'),attributes,{'tableName':_0x568c('0xa'),'paranoid':![],'indexes':[{'name':_0x568c('0xb'),'fields':['subject','to'],'type':_0x568c('0xc')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x23e9c4,_0x2ca484,_0x23c9db){if(_0x23e9c4[_0x568c('0xd')]){_0x23e9c4[_0x568c('0xe')]=moment()['format'](_0x568c('0xf'));}if(_0x23e9c4['closed']){_0x23e9c4[_0x568c('0x10')]=moment()[_0x568c('0x11')](_0x568c('0xf'));}_0x23c9db(null,_0x2ca484);},'beforeUpdate':function(_0x4f525c,_0x6a1945,_0x108e30){if(_0x4f525c[_0x568c('0x12')](_0x568c('0xd'))){_0x4f525c[_0x568c('0xe')]=_0x4f525c[_0x568c('0xd')]?moment()['format'](_0x568c('0xf')):null;}if(_0x4f525c['changed'](_0x568c('0x13'))){_0x4f525c[_0x568c('0x10')]=moment()[_0x568c('0x11')]('YYYY-MM-DD\x20HH:mm:ss');_0x4f525c['substatus']=null;_0x4f525c['substatusAt']=null;}_0x108e30(null,_0x4f525c);},'afterUpdate':function(_0x32b194,_0x578312,_0xf5f273){var _0x2ae06b=_0x1b5731['models'];var _0x400c96=_0x32b194[_0x568c('0x14')]({'plain':!![]});if(_0x400c96[_0x568c('0x13')]){return _0x2ae06b[_0x568c('0x15')][_0x568c('0x16')]({'read':!![]},{'where':{'MailInteractionId':_0x400c96['id']}})[_0x568c('0x17')](function(){_0xf5f273();})[_0x568c('0x18')](function(_0x42e4d1){_0xf5f273(_0x42e4d1);});}else{_0xf5f273();}}},'charset':_0x568c('0x19'),'collate':_0x568c('0x1a')});}; \ No newline at end of file +var _0xd8f2=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailInteraction.attributes','MailInteraction','mail_interactions','fti_mail_interactions','FULLTEXT','substatus','substatusAt','YYYY-MM-DD\x20HH:mm:ss','closed','format','changed','closedAt','MailMessage','update','then','catch','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger'];(function(_0x4839a2,_0x1f67eb){var _0x465147=function(_0x4eae2e){while(--_0x4eae2e){_0x4839a2['push'](_0x4839a2['shift']());}};_0x465147(++_0x1f67eb);}(_0xd8f2,0xbb));var _0x2d8f=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xd8f2[_0x3947c9];return _0x2e7871;};'use strict';var _=require('lodash');var util=require(_0x2d8f('0x0'));var logger=require(_0x2d8f('0x1'))(_0x2d8f('0x2'));var moment=require(_0x2d8f('0x3'));var BPromise=require(_0x2d8f('0x4'));var rp=require(_0x2d8f('0x5'));var fs=require('fs');var path=require(_0x2d8f('0x6'));var rimraf=require(_0x2d8f('0x7'));var config=require(_0x2d8f('0x8'));var attributes=require(_0x2d8f('0x9'));module['exports']=function(_0x3c063f,_0xa184fa){return _0x3c063f['define'](_0x2d8f('0xa'),attributes,{'tableName':_0x2d8f('0xb'),'paranoid':![],'indexes':[{'name':_0x2d8f('0xc'),'fields':['subject','to'],'type':_0x2d8f('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x57aa8f,_0x5eecbd,_0x19d5c6){if(_0x57aa8f[_0x2d8f('0xe')]){_0x57aa8f[_0x2d8f('0xf')]=moment()['format'](_0x2d8f('0x10'));}if(_0x57aa8f[_0x2d8f('0x11')]){_0x57aa8f['closedAt']=moment()[_0x2d8f('0x12')](_0x2d8f('0x10'));}_0x19d5c6(null,_0x5eecbd);},'beforeUpdate':function(_0x2c6f55,_0x1ae697,_0xea7c03){if(_0x2c6f55[_0x2d8f('0x13')](_0x2d8f('0xe'))){_0x2c6f55[_0x2d8f('0xf')]=_0x2c6f55[_0x2d8f('0xe')]?moment()[_0x2d8f('0x12')](_0x2d8f('0x10')):null;}if(_0x2c6f55[_0x2d8f('0x13')](_0x2d8f('0x11'))){_0x2c6f55[_0x2d8f('0x14')]=moment()[_0x2d8f('0x12')](_0x2d8f('0x10'));_0x2c6f55[_0x2d8f('0xe')]=null;_0x2c6f55[_0x2d8f('0xf')]=null;}_0xea7c03(null,_0x2c6f55);},'afterUpdate':function(_0xf67a1f,_0x1f2ad8,_0x5dba8d){var _0x453842=_0x3c063f['models'];var _0x371d75=_0xf67a1f['get']({'plain':!![]});if(_0x371d75['closed']){return _0x453842[_0x2d8f('0x15')][_0x2d8f('0x16')]({'read':!![]},{'where':{'MailInteractionId':_0x371d75['id']}})[_0x2d8f('0x17')](function(){_0x5dba8d();})[_0x2d8f('0x18')](function(_0x18cff7){_0x5dba8d(_0x18cff7);});}else{_0x5dba8d();}}},'charset':_0x2d8f('0x19'),'collate':_0x2d8f('0x1a')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 865b179..3d8d430 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 _0x7e69=['options','where','AddTagsToMailInteraction','find','addTags','ids','omit','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','socket.io-emitter','./mailInteraction.socket','then','info','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','MailInteraction,\x20%s,\x20%s','message','catch','UpdateMailInteraction','update','body'];(function(_0x4c61c8,_0x2f5ccc){var _0x41e34a=function(_0xe091dd){while(--_0xe091dd){_0x4c61c8['push'](_0x4c61c8['shift']());}};_0x41e34a(++_0x2f5ccc);}(_0x7e69,0x1b8));var _0x97e6=function(_0x3055ab,_0x4d1f74){_0x3055ab=_0x3055ab-0x0;var _0x31d336=_0x7e69[_0x3055ab];return _0x31d336;};'use strict';var _=require(_0x97e6('0x0'));var util=require('util');var moment=require(_0x97e6('0x1'));var BPromise=require(_0x97e6('0x2'));var rs=require(_0x97e6('0x3'));var fs=require('fs');var Redis=require(_0x97e6('0x4'));var db=require(_0x97e6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x97e6('0x6'))(_0x97e6('0x7'));var config=require(_0x97e6('0x8'));var jayson=require(_0x97e6('0x9'));var client=jayson['client'][_0x97e6('0xa')]({'port':0x232a});config[_0x97e6('0xb')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x97e6('0xc'))(new Redis(config['redis']));require(_0x97e6('0xd'))['register'](socket);function respondWithRpcPromise(_0x5db1a6,_0x2a0d39,_0x3c5603){return new BPromise(function(_0x33e80c,_0x334a16){return client['request'](_0x5db1a6,_0x3c5603)[_0x97e6('0xe')](function(_0x5bd156){logger[_0x97e6('0xf')]('MailInteraction,\x20%s,\x20%s',_0x2a0d39,_0x97e6('0x10'));logger[_0x97e6('0x11')](_0x97e6('0x12'),_0x2a0d39,_0x97e6('0x10'),JSON[_0x97e6('0x13')](_0x5bd156));if(_0x5bd156['error']){if(_0x5bd156[_0x97e6('0x14')][_0x97e6('0x15')]===0x1f4){logger['error'](_0x97e6('0x16'),_0x2a0d39,_0x5bd156[_0x97e6('0x14')][_0x97e6('0x17')]);return _0x334a16(_0x5bd156['error'][_0x97e6('0x17')]);}logger[_0x97e6('0x14')](_0x97e6('0x16'),_0x2a0d39,_0x5bd156[_0x97e6('0x14')][_0x97e6('0x17')]);return _0x33e80c(_0x5bd156[_0x97e6('0x14')][_0x97e6('0x17')]);}else{logger[_0x97e6('0xf')](_0x97e6('0x16'),_0x2a0d39,'request\x20sent');_0x33e80c(_0x5bd156['result'][_0x97e6('0x17')]);}})[_0x97e6('0x18')](function(_0x194b40){logger[_0x97e6('0x14')](_0x97e6('0x16'),_0x2a0d39,_0x194b40);_0x334a16(_0x194b40);});});}exports[_0x97e6('0x19')]=function(_0x3e8c39){var _0x27e68d=this;return new Promise(function(_0x43a874,_0x199058){return db['MailInteraction'][_0x97e6('0x1a')](_0x3e8c39[_0x97e6('0x1b')],{'raw':_0x3e8c39[_0x97e6('0x1c')]?_0x3e8c39[_0x97e6('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3e8c39[_0x97e6('0x1c')]?_0x3e8c39[_0x97e6('0x1c')][_0x97e6('0x1d')]||null:null,'attributes':_0x3e8c39[_0x97e6('0x1c')]?_0x3e8c39[_0x97e6('0x1c')]['attributes']||null:null,'limit':_0x3e8c39[_0x97e6('0x1c')]?_0x3e8c39[_0x97e6('0x1c')]['limit']||null:null})[_0x97e6('0xe')](function(_0x9364fd){logger[_0x97e6('0xf')]('UpdateMailInteraction',_0x3e8c39);logger[_0x97e6('0x11')](_0x97e6('0x19'),_0x3e8c39,JSON[_0x97e6('0x13')](_0x9364fd));_0x43a874(_0x9364fd);})['catch'](function(_0x16c0ad){logger[_0x97e6('0x14')]('UpdateMailInteraction',_0x16c0ad['message'],_0x3e8c39);_0x199058(_0x27e68d[_0x97e6('0x14')](0x1f4,_0x16c0ad[_0x97e6('0x17')]));});});};exports[_0x97e6('0x1e')]=function(_0x2a8e90){return new Promise(function(_0x78379c,_0x124c7b){return db['MailInteraction'][_0x97e6('0x1f')]({'where':_0x2a8e90['options']?_0x2a8e90[_0x97e6('0x1c')][_0x97e6('0x1d')]||null:null})[_0x97e6('0xe')](function(_0x283698){if(_0x283698){return _0x283698[_0x97e6('0x20')](_0x2a8e90['body'][_0x97e6('0x21')],_[_0x97e6('0x22')](_0x2a8e90[_0x97e6('0x1b')],[_0x97e6('0x21'),'id'])||{});}})['spread'](function(_0x355f71){logger['info'](_0x97e6('0x23'),_0x2a8e90);logger['debug'](_0x97e6('0x23'),_0x2a8e90,JSON[_0x97e6('0x13')](_0x355f71));_0x78379c(_0x355f71);})[_0x97e6('0x18')](function(_0x408a0c){logger['error']('AddTags',_0x408a0c[_0x97e6('0x17')],_0x2a8e90);_0x124c7b(_this[_0x97e6('0x14')](0x1f4,_0x408a0c[_0x97e6('0x17')]));});});}; \ No newline at end of file +var _0xf198=['socket.io-emitter','register','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','MailInteraction','update','body','options','attributes','limit','UpdateMailInteraction','where','spread','AddTags','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost'];(function(_0x21ff06,_0x59a73c){var _0x2e4a11=function(_0x2fc366){while(--_0x2fc366){_0x21ff06['push'](_0x21ff06['shift']());}};_0x2e4a11(++_0x59a73c);}(_0xf198,0xd1));var _0x8f19=function(_0x5b9049,_0x1ebc46){_0x5b9049=_0x5b9049-0x0;var _0x1fd946=_0xf198[_0x5b9049];return _0x1fd946;};'use strict';var _=require('lodash');var util=require(_0x8f19('0x0'));var moment=require('moment');var BPromise=require(_0x8f19('0x1'));var rs=require(_0x8f19('0x2'));var fs=require('fs');var Redis=require(_0x8f19('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x8f19('0x4'));var logger=require(_0x8f19('0x5'))(_0x8f19('0x6'));var config=require(_0x8f19('0x7'));var jayson=require(_0x8f19('0x8'));var client=jayson[_0x8f19('0x9')]['http']({'port':0x232a});config[_0x8f19('0xa')]=_[_0x8f19('0xb')](config[_0x8f19('0xa')],{'host':_0x8f19('0xc'),'port':0x18eb});var socket=require(_0x8f19('0xd'))(new Redis(config[_0x8f19('0xa')]));require('./mailInteraction.socket')[_0x8f19('0xe')](socket);function respondWithRpcPromise(_0x26171d,_0x1fe175,_0x4a5d1b){return new BPromise(function(_0x15f0d3,_0x3a1595){return client[_0x8f19('0xf')](_0x26171d,_0x4a5d1b)[_0x8f19('0x10')](function(_0x5b0b93){logger[_0x8f19('0x11')](_0x8f19('0x12'),_0x1fe175,_0x8f19('0x13'));logger[_0x8f19('0x14')](_0x8f19('0x15'),_0x1fe175,_0x8f19('0x13'),JSON[_0x8f19('0x16')](_0x5b0b93));if(_0x5b0b93[_0x8f19('0x17')]){if(_0x5b0b93['error'][_0x8f19('0x18')]===0x1f4){logger[_0x8f19('0x17')](_0x8f19('0x12'),_0x1fe175,_0x5b0b93[_0x8f19('0x17')][_0x8f19('0x19')]);return _0x3a1595(_0x5b0b93['error'][_0x8f19('0x19')]);}logger[_0x8f19('0x17')](_0x8f19('0x12'),_0x1fe175,_0x5b0b93[_0x8f19('0x17')][_0x8f19('0x19')]);return _0x15f0d3(_0x5b0b93[_0x8f19('0x17')]['message']);}else{logger['info'](_0x8f19('0x12'),_0x1fe175,'request\x20sent');_0x15f0d3(_0x5b0b93['result']['message']);}})[_0x8f19('0x1a')](function(_0xdf88f2){logger[_0x8f19('0x17')](_0x8f19('0x12'),_0x1fe175,_0xdf88f2);_0x3a1595(_0xdf88f2);});});}exports['UpdateMailInteraction']=function(_0x63b6df){var _0x546384=this;return new Promise(function(_0x1142c5,_0x16d351){return db[_0x8f19('0x1b')][_0x8f19('0x1c')](_0x63b6df[_0x8f19('0x1d')],{'raw':_0x63b6df[_0x8f19('0x1e')]?_0x63b6df[_0x8f19('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x63b6df[_0x8f19('0x1e')]?_0x63b6df[_0x8f19('0x1e')]['where']||null:null,'attributes':_0x63b6df[_0x8f19('0x1e')]?_0x63b6df['options'][_0x8f19('0x1f')]||null:null,'limit':_0x63b6df['options']?_0x63b6df[_0x8f19('0x1e')][_0x8f19('0x20')]||null:null})[_0x8f19('0x10')](function(_0x2ab0cc){logger[_0x8f19('0x11')](_0x8f19('0x21'),_0x63b6df);logger['debug']('UpdateMailInteraction',_0x63b6df,JSON[_0x8f19('0x16')](_0x2ab0cc));_0x1142c5(_0x2ab0cc);})[_0x8f19('0x1a')](function(_0x41b5d5){logger['error'](_0x8f19('0x21'),_0x41b5d5[_0x8f19('0x19')],_0x63b6df);_0x16d351(_0x546384[_0x8f19('0x17')](0x1f4,_0x41b5d5[_0x8f19('0x19')]));});});};exports['AddTagsToMailInteraction']=function(_0x1de08e){return new Promise(function(_0x271438,_0x282980){return db[_0x8f19('0x1b')]['find']({'where':_0x1de08e[_0x8f19('0x1e')]?_0x1de08e[_0x8f19('0x1e')][_0x8f19('0x22')]||null:null})[_0x8f19('0x10')](function(_0x3bdc92){if(_0x3bdc92){return _0x3bdc92['addTags'](_0x1de08e[_0x8f19('0x1d')]['ids'],_['omit'](_0x1de08e[_0x8f19('0x1d')],['ids','id'])||{});}})[_0x8f19('0x23')](function(_0x38a06c){logger['info'](_0x8f19('0x24'),_0x1de08e);logger[_0x8f19('0x14')](_0x8f19('0x24'),_0x1de08e,JSON['stringify'](_0x38a06c));_0x271438(_0x38a06c);})['catch'](function(_0x1fb0dd){logger[_0x8f19('0x17')](_0x8f19('0x24'),_0x1fb0dd[_0x8f19('0x19')],_0x1de08e);_0x282980(_this[_0x8f19('0x17')](0x1f4,_0x1fb0dd[_0x8f19('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 2709765..8198b76 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 _0xca75=['mailInteraction:','./mailInteraction.events','save','update','emit','length'];(function(_0x427b1c,_0x5010b9){var _0x52d73c=function(_0x3a8c99){while(--_0x3a8c99){_0x427b1c['push'](_0x427b1c['shift']());}};_0x52d73c(++_0x5010b9);}(_0xca75,0x16f));var _0x5ca7=function(_0x374ea8,_0x444720){_0x374ea8=_0x374ea8-0x0;var _0x5bdf9f=_0xca75[_0x374ea8];return _0x5bdf9f;};'use strict';var MailInteractionEvents=require(_0x5ca7('0x0'));var events=[_0x5ca7('0x1'),'remove',_0x5ca7('0x2')];function createListener(_0x34f267,_0x1a8200){return function(_0x191e52){_0x1a8200[_0x5ca7('0x3')](_0x34f267,_0x191e52);};}function removeListener(_0x39826f,_0xae2f10){return function(){MailInteractionEvents['removeListener'](_0x39826f,_0xae2f10);};}exports['register']=function(_0x3243e8){for(var _0x7315d1=0x0,_0x42b5c2=events[_0x5ca7('0x4')];_0x7315d1<_0x42b5c2;_0x7315d1++){var _0x1d2f24=events[_0x7315d1];var _0x3117d2=createListener(_0x5ca7('0x5')+_0x1d2f24,_0x3243e8);MailInteractionEvents['on'](_0x1d2f24,_0x3117d2);}}; \ No newline at end of file +var _0xc51e=['removeListener','register','length','./mailInteraction.events','update','emit'];(function(_0x882c43,_0x3f9678){var _0x297932=function(_0x3437a8){while(--_0x3437a8){_0x882c43['push'](_0x882c43['shift']());}};_0x297932(++_0x3f9678);}(_0xc51e,0x123));var _0xec51=function(_0x2f3738,_0x115a52){_0x2f3738=_0x2f3738-0x0;var _0x3dfa2c=_0xc51e[_0x2f3738];return _0x3dfa2c;};'use strict';var MailInteractionEvents=require(_0xec51('0x0'));var events=['save','remove',_0xec51('0x1')];function createListener(_0x620a3e,_0x169643){return function(_0x25d566){_0x169643[_0xec51('0x2')](_0x620a3e,_0x25d566);};}function removeListener(_0x2b7523,_0x4df4d6){return function(){MailInteractionEvents[_0xec51('0x3')](_0x2b7523,_0x4df4d6);};}exports[_0xec51('0x4')]=function(_0x47000c){for(var _0x6b6576=0x0,_0x16df7b=events[_0xec51('0x5')];_0x6b6576<_0x16df7b;_0x6b6576++){var _0x3d46e5=events[_0x6b6576];var _0x3795b4=createListener('mailInteraction:'+_0x3d46e5,_0x47000c);MailInteractionEvents['on'](_0x3d46e5,_0x3795b4);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 08c9429..868a80b 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 _0xb406=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','/:id/download','download','tracked','mail','mailmessage:create','put','update','/:id/accept','reject','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x3767a8,_0x222977){var _0x4d2ce3=function(_0x5db23b){while(--_0x5db23b){_0x3767a8['push'](_0x3767a8['shift']());}};_0x4d2ce3(++_0x222977);}(_0xb406,0x10c));var _0x6b40=function(_0x33d851,_0xa747ba){_0x33d851=_0x33d851-0x0;var _0x197a88=_0xb406[_0x33d851];return _0x197a88;};'use strict';var multer=require(_0x6b40('0x0'));var util=require(_0x6b40('0x1'));var path=require(_0x6b40('0x2'));var timeout=require(_0x6b40('0x3'));var express=require(_0x6b40('0x4'));var router=express[_0x6b40('0x5')]();var fs_extra=require(_0x6b40('0x6'));var auth=require(_0x6b40('0x7'));var interaction=require(_0x6b40('0x8'));var config=require(_0x6b40('0x9'));var controller=require('./mailMessage.controller');router[_0x6b40('0xa')]('/',auth[_0x6b40('0xb')](),controller[_0x6b40('0xc')]);router[_0x6b40('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x6b40('0xd')]);router[_0x6b40('0xa')](_0x6b40('0xe'),auth['isAuthenticated'](),controller[_0x6b40('0xf')]);router[_0x6b40('0xa')](_0x6b40('0x10'),auth[_0x6b40('0xb')](),controller[_0x6b40('0x11')]);router['post']('/',auth[_0x6b40('0xb')](),interaction[_0x6b40('0x12')](_0x6b40('0x13'),_0x6b40('0x14')),controller['create']);router[_0x6b40('0x15')](_0x6b40('0xe'),auth[_0x6b40('0xb')](),controller[_0x6b40('0x16')]);router[_0x6b40('0x15')](_0x6b40('0x17'),auth[_0x6b40('0xb')](),controller['accept']);router[_0x6b40('0x15')]('/:id/reject',auth[_0x6b40('0xb')](),controller[_0x6b40('0x18')]);router['delete'](_0x6b40('0xe'),auth[_0x6b40('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x9d9b=['put','/:id/accept','accept','/:id/reject','destroy','exports','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./mailMessage.controller','isAuthenticated','index','/describe','describe','get','/:id','show','post','tracked','mailmessage:create','create','update'];(function(_0x2d2ca2,_0x51873f){var _0x48489d=function(_0x1a2cf7){while(--_0x1a2cf7){_0x2d2ca2['push'](_0x2d2ca2['shift']());}};_0x48489d(++_0x51873f);}(_0x9d9b,0x1e1));var _0xb9d9=function(_0x344dc4,_0x50eb33){_0x344dc4=_0x344dc4-0x0;var _0x3e722f=_0x9d9b[_0x344dc4];return _0x3e722f;};'use strict';var multer=require('multer');var util=require(_0xb9d9('0x0'));var path=require(_0xb9d9('0x1'));var timeout=require('connect-timeout');var express=require(_0xb9d9('0x2'));var router=express['Router']();var fs_extra=require(_0xb9d9('0x3'));var auth=require(_0xb9d9('0x4'));var interaction=require(_0xb9d9('0x5'));var config=require('../../config/environment');var controller=require(_0xb9d9('0x6'));router['get']('/',auth[_0xb9d9('0x7')](),controller[_0xb9d9('0x8')]);router['get'](_0xb9d9('0x9'),auth[_0xb9d9('0x7')](),controller[_0xb9d9('0xa')]);router[_0xb9d9('0xb')](_0xb9d9('0xc'),auth[_0xb9d9('0x7')](),controller[_0xb9d9('0xd')]);router['get']('/:id/download',auth['isAuthenticated'](),controller['download']);router[_0xb9d9('0xe')]('/',auth[_0xb9d9('0x7')](),interaction[_0xb9d9('0xf')]('mail',_0xb9d9('0x10')),controller[_0xb9d9('0x11')]);router['put'](_0xb9d9('0xc'),auth['isAuthenticated'](),controller[_0xb9d9('0x12')]);router[_0xb9d9('0x13')](_0xb9d9('0x14'),auth[_0xb9d9('0x7')](),controller[_0xb9d9('0x15')]);router[_0xb9d9('0x13')](_0xb9d9('0x16'),auth[_0xb9d9('0x7')](),controller['reject']);router['delete'](_0xb9d9('0xc'),auth[_0xb9d9('0x7')](),controller[_0xb9d9('0x17')]);module[_0xb9d9('0x18')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 7b009e8..1372332 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 _0x41fb=['INTEGER','Chat','sequelize','lodash','exports','TEXT','long','medium','BOOLEAN','ENUM','out','STRING','DATE'];(function(_0x114b7c,_0xc4b93b){var _0x47185f=function(_0x5b4cfa){while(--_0x5b4cfa){_0x114b7c['push'](_0x114b7c['shift']());}};_0x47185f(++_0xc4b93b);}(_0x41fb,0x1e3));var _0xb41f=function(_0x312428,_0x458f28){_0x312428=_0x312428-0x0;var _0x583514=_0x41fb[_0x312428];return _0x583514;};'use strict';var Sequelize=require(_0xb41f('0x0'));var _=require(_0xb41f('0x1'));module[_0xb41f('0x2')]={'body':{'type':Sequelize[_0xb41f('0x3')](_0xb41f('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xb41f('0x3')](_0xb41f('0x5'))},'read':{'type':Sequelize[_0xb41f('0x6')],'defaultValue':![]},'direction':{'type':Sequelize[_0xb41f('0x7')]('in',_0xb41f('0x8')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xb41f('0x9')](0x1fe)},'from':{'type':Sequelize[_0xb41f('0x9')]},'to':{'type':Sequelize[_0xb41f('0x3')](_0xb41f('0x4'))},'cc':{'type':Sequelize[_0xb41f('0x3')](_0xb41f('0x4'))},'bcc':{'type':Sequelize[_0xb41f('0x3')](_0xb41f('0x4'))},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize[_0xb41f('0xa')]},'attach':{'type':Sequelize[_0xb41f('0xb')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xb41f('0x6')],'defaultValue':![]},'readAt':{'type':Sequelize[_0xb41f('0xa')]},'originTo':{'type':Sequelize[_0xb41f('0x3')]('long')},'originCc':{'type':Sequelize['TEXT']('long')},'originChannel':{'type':Sequelize[_0xb41f('0x7')]('Email',_0xb41f('0xc')),'defaultValue':'Email','allowNull':![]}}; \ No newline at end of file +var _0x58ff=['sequelize','lodash','exports','TEXT','long','medium','ENUM','out','STRING','INTEGER','BOOLEAN','Email'];(function(_0x205147,_0x2a415f){var _0x214c1b=function(_0xe16c58){while(--_0xe16c58){_0x205147['push'](_0x205147['shift']());}};_0x214c1b(++_0x2a415f);}(_0x58ff,0x180));var _0xf58f=function(_0x3dd964,_0x58452e){_0x3dd964=_0x3dd964-0x0;var _0x588bd6=_0x58ff[_0x3dd964];return _0x588bd6;};'use strict';var Sequelize=require(_0xf58f('0x0'));var _=require(_0xf58f('0x1'));module[_0xf58f('0x2')]={'body':{'type':Sequelize[_0xf58f('0x3')](_0xf58f('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xf58f('0x3')](_0xf58f('0x5'))},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xf58f('0x6')]('in','out'),'defaultValue':_0xf58f('0x7'),'allowNull':![]},'messageId':{'type':Sequelize[_0xf58f('0x8')](0x1fe)},'from':{'type':Sequelize[_0xf58f('0x8')]},'to':{'type':Sequelize[_0xf58f('0x3')](_0xf58f('0x4'))},'cc':{'type':Sequelize[_0xf58f('0x3')](_0xf58f('0x4'))},'bcc':{'type':Sequelize[_0xf58f('0x3')](_0xf58f('0x4'))},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize[_0xf58f('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xf58f('0xa')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize['TEXT']('long')},'originCc':{'type':Sequelize[_0xf58f('0x3')](_0xf58f('0x4'))},'originChannel':{'type':Sequelize['ENUM'](_0xf58f('0xb'),'Chat'),'defaultValue':_0xf58f('0xb'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 5fa5d14..6d39036 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 _0x8ee0=['where','pick','filter','type','VIRTUAL','options','MailMessage','includeAll','include','findAll','rows','show','params','keys','body','find','describe','create','out','split','findOne','MailAccountId','CmList','CmContact','DESC','MailServerOut','Smtp','service','host','port','secure','auth','user','pass','attachments','join','root','server/files/attachments','basename','List','Contacts','ListId','List\x20not\x20found','SendMail','sendMail','update','format','YYYY-MM-DD\x20HH:mm:ss','accept','read','UserId','agent','get','isNil','read1stAt','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','interaction','null','AcceptMessage','Sequelize','QueryTypes','SELECT','contact','User','fullname','internal','SIP/%s','channel','motionChannel','event','fromString','EventManager','acceptmessage','reject','mail','MailInteraction','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','ContactId','sequelize','email','rejectmessage','download','unix','toString','server','files','message-%s.eml','bcc','subject','createdAt','Attachment','Attachments','from','headers','existsSync','push','unlinkSync','eml-format','moment','bluebird','lodash','html-to-text','../../config/logger','api','mail-interactions','../../config/environment','redis','defaults','register','jayson/promise','client','http','request','then','info','MailMessage,\x20%s,\x20%s','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','status','json','offset','undefined','count','set','Content-Range','destroy','end','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','nolimit','limit','order','sort'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0x8ee0,0x19e));var _0x08ee=function(_0x5ef161,_0x27d16c){_0x5ef161=_0x5ef161-0x0;var _0x1c6e9e=_0x8ee0[_0x5ef161];return _0x1c6e9e;};'use strict';var emlformat=require(_0x08ee('0x0'));var moment=require(_0x08ee('0x1'));var BPromise=require(_0x08ee('0x2'));var util=require('util');var path=require('path');var fs=require('fs');var _=require(_0x08ee('0x3'));var Redis=require('ioredis');var htmlToText=require(_0x08ee('0x4'));var qs=require('../../components/parsers/qs');var logger=require(_0x08ee('0x5'))(_0x08ee('0x6'));var interaction_log=require(_0x08ee('0x5'))(_0x08ee('0x7'));var config=require(_0x08ee('0x8'));var db=require('../../mysqldb')['db'];config[_0x08ee('0x9')]=_[_0x08ee('0xa')](config[_0x08ee('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./mailMessage.socket')[_0x08ee('0xb')](socket);var jayson=require(_0x08ee('0xc'));var client=jayson[_0x08ee('0xd')][_0x08ee('0xe')]({'port':0x232c});var client9003=jayson[_0x08ee('0xd')][_0x08ee('0xe')]({'port':0x232b});var client9002=jayson['client'][_0x08ee('0xe')]({'port':0x232a});function respondWithRpcPromise(_0x25b351,_0x567008,_0x5cd371,_0x35b5ee){return new BPromise(function(_0xfbd7a7,_0x3ef215){var _0x4b46f6=_0x35b5ee||client;return _0x4b46f6[_0x08ee('0xf')](_0x25b351,_0x5cd371)[_0x08ee('0x10')](function(_0xb78d89){logger[_0x08ee('0x11')](_0x08ee('0x12'),_0x567008,'request\x20sent');logger[_0x08ee('0x13')](_0x08ee('0x14'),_0x567008,_0x08ee('0x15'),JSON[_0x08ee('0x16')](_0xb78d89));if(_0xb78d89[_0x08ee('0x17')]){if(_0xb78d89[_0x08ee('0x17')][_0x08ee('0x18')]===0x1f4){logger['error'](_0x08ee('0x12'),_0x567008,_0xb78d89[_0x08ee('0x17')][_0x08ee('0x19')]);return _0x3ef215(_0xb78d89['error'][_0x08ee('0x19')]);}logger[_0x08ee('0x17')]('MailMessage,\x20%s,\x20%s',_0x567008,_0xb78d89[_0x08ee('0x17')][_0x08ee('0x19')]);return _0xfbd7a7(_0xb78d89[_0x08ee('0x17')][_0x08ee('0x19')]);}else{logger[_0x08ee('0x11')](_0x08ee('0x12'),_0x567008,'request\x20sent');_0xfbd7a7(_0xb78d89[_0x08ee('0x1a')][_0x08ee('0x19')]);}})[_0x08ee('0x1b')](function(_0x10f913){logger[_0x08ee('0x17')](_0x08ee('0x12'),_0x567008,_0x10f913);_0x3ef215(_0x10f913);});});}function respondWithResult(_0x3a64d9,_0x2801fe){_0x2801fe=_0x2801fe||0xc8;return function(_0x208efd){if(_0x208efd){return _0x3a64d9[_0x08ee('0x1c')](_0x2801fe)[_0x08ee('0x1d')](_0x208efd);}};}function respondWithFilteredResult(_0x4765db,_0x101948){return function(_0x52d72c){if(_0x52d72c){var _0x443201=typeof _0x101948[_0x08ee('0x1e')]===_0x08ee('0x1f')&&typeof _0x101948['limit']===_0x08ee('0x1f');var _0x306945=_0x52d72c[_0x08ee('0x20')];var _0x41d317=_0x443201?0x0:_0x101948['offset'];var _0x8f5e30=_0x443201?_0x52d72c[_0x08ee('0x20')]:_0x101948[_0x08ee('0x1e')]+_0x101948['limit'];var _0x3b48cb;if(_0x8f5e30>=_0x306945){_0x8f5e30=_0x306945;_0x3b48cb=0xc8;}else{_0x3b48cb=0xce;}_0x4765db[_0x08ee('0x1c')](_0x3b48cb);return _0x4765db[_0x08ee('0x21')](_0x08ee('0x22'),_0x41d317+'-'+_0x8f5e30+'/'+_0x306945)['json'](_0x52d72c);}return null;};}function saveUpdates(_0x275452){return function(_0x11fae9){if(_0x11fae9){return _0x11fae9['update'](_0x275452)[_0x08ee('0x10')](function(_0x4bccd6){return _0x4bccd6;});}return null;};}function removeEntity(_0x5a4b37){return function(_0x1b4cda){if(_0x1b4cda){return _0x1b4cda[_0x08ee('0x23')]()['then'](function(){_0x5a4b37[_0x08ee('0x1c')](0xcc)[_0x08ee('0x24')]();});}};}function handleEntityNotFound(_0x22cbee){return function(_0x16ca0e){if(!_0x16ca0e){_0x22cbee[_0x08ee('0x25')](0x194);}return _0x16ca0e;};}function handleError(_0x201698,_0x185605){_0x185605=_0x185605||0x1f4;return function(_0x4c326e){logger[_0x08ee('0x17')](_0x4c326e[_0x08ee('0x26')]);if(_0x4c326e[_0x08ee('0x27')]){delete _0x4c326e[_0x08ee('0x27')];}_0x201698[_0x08ee('0x1c')](_0x185605)[_0x08ee('0x28')](_0x4c326e);};}exports[_0x08ee('0x29')]=function(_0x38ee2f,_0x1f59c3){var _0x5ed0cc={},_0x4968b2={},_0x5e8448={'count':0x0,'rows':[]};var _0x45f314=_[_0x08ee('0x2a')](db['MailMessage'][_0x08ee('0x2b')],function(_0x2f90c1){return{'name':_0x2f90c1[_0x08ee('0x2c')],'type':_0x2f90c1['type'][_0x08ee('0x2d')]};});_0x4968b2[_0x08ee('0x2e')]=_[_0x08ee('0x2a')](_0x45f314,_0x08ee('0x27'));_0x4968b2['query']=_['keys'](_0x38ee2f[_0x08ee('0x2f')]);_0x4968b2[_0x08ee('0x30')]=_[_0x08ee('0x31')](_0x4968b2[_0x08ee('0x2e')],_0x4968b2['query']);_0x5ed0cc['attributes']=_[_0x08ee('0x31')](_0x4968b2['model'],qs[_0x08ee('0x32')](_0x38ee2f[_0x08ee('0x2f')]['fields']));_0x5ed0cc[_0x08ee('0x33')]=_0x5ed0cc['attributes'][_0x08ee('0x34')]?_0x5ed0cc[_0x08ee('0x33')]:_0x4968b2[_0x08ee('0x2e')];if(!_0x38ee2f[_0x08ee('0x2f')]['hasOwnProperty'](_0x08ee('0x35'))){_0x5ed0cc['limit']=qs[_0x08ee('0x36')](_0x38ee2f[_0x08ee('0x2f')]['limit']);_0x5ed0cc[_0x08ee('0x1e')]=qs[_0x08ee('0x1e')](_0x38ee2f[_0x08ee('0x2f')][_0x08ee('0x1e')]);}_0x5ed0cc[_0x08ee('0x37')]=qs[_0x08ee('0x38')](_0x38ee2f[_0x08ee('0x2f')][_0x08ee('0x38')]);_0x5ed0cc[_0x08ee('0x39')]=qs[_0x08ee('0x30')](_[_0x08ee('0x3a')](_0x38ee2f[_0x08ee('0x2f')],_0x4968b2[_0x08ee('0x30')]),_0x45f314);if(_0x38ee2f[_0x08ee('0x2f')][_0x08ee('0x3b')]){_0x5ed0cc[_0x08ee('0x39')]=_['merge'](_0x5ed0cc[_0x08ee('0x39')],{'$or':_[_0x08ee('0x2a')](_0x45f314,function(_0x79bcf3){if(_0x79bcf3[_0x08ee('0x3c')]!==_0x08ee('0x3d')){var _0x1b34e1={};_0x1b34e1[_0x79bcf3['name']]={'$like':'%'+_0x38ee2f['query'][_0x08ee('0x3b')]+'%'};return _0x1b34e1;}})});}_0x5ed0cc=_['merge']({},_0x5ed0cc,_0x38ee2f[_0x08ee('0x3e')]);var _0x294e80={'where':_0x5ed0cc[_0x08ee('0x39')]};return db[_0x08ee('0x3f')][_0x08ee('0x20')](_0x294e80)[_0x08ee('0x10')](function(_0x583fc7){_0x5e8448[_0x08ee('0x20')]=_0x583fc7;if(_0x38ee2f[_0x08ee('0x2f')][_0x08ee('0x40')]){_0x5ed0cc[_0x08ee('0x41')]=[{'all':!![]}];}return db[_0x08ee('0x3f')][_0x08ee('0x42')](_0x5ed0cc);})['then'](function(_0x52c4ab){_0x5e8448[_0x08ee('0x43')]=_0x52c4ab;return _0x5e8448;})[_0x08ee('0x10')](respondWithFilteredResult(_0x1f59c3,_0x5ed0cc))[_0x08ee('0x1b')](handleError(_0x1f59c3,null));};exports[_0x08ee('0x44')]=function(_0x4d8a92,_0x51680b){var _0x5ac8bb={'raw':!![],'where':{'id':_0x4d8a92[_0x08ee('0x45')]['id']}},_0x15aa05={};_0x15aa05[_0x08ee('0x2e')]=_[_0x08ee('0x46')](db[_0x08ee('0x3f')][_0x08ee('0x2b')]);_0x15aa05[_0x08ee('0x2f')]=_[_0x08ee('0x46')](_0x4d8a92['query']);_0x15aa05[_0x08ee('0x30')]=_[_0x08ee('0x31')](_0x15aa05[_0x08ee('0x2e')],_0x15aa05[_0x08ee('0x2f')]);_0x5ac8bb[_0x08ee('0x33')]=_[_0x08ee('0x31')](_0x15aa05[_0x08ee('0x2e')],qs['fields'](_0x4d8a92[_0x08ee('0x2f')]['fields']));_0x5ac8bb[_0x08ee('0x33')]=_0x5ac8bb[_0x08ee('0x33')]['length']?_0x5ac8bb[_0x08ee('0x33')]:_0x15aa05['model'];if(_0x4d8a92[_0x08ee('0x2f')][_0x08ee('0x40')]){_0x5ac8bb[_0x08ee('0x41')]=[{'all':!![]}];}_0x5ac8bb=_['merge']({},_0x5ac8bb,_0x4d8a92[_0x08ee('0x3e')]);return db[_0x08ee('0x3f')]['find'](_0x5ac8bb)[_0x08ee('0x10')](handleEntityNotFound(_0x51680b,null))[_0x08ee('0x10')](respondWithResult(_0x51680b,null))[_0x08ee('0x1b')](handleError(_0x51680b,null));};exports['update']=function(_0x1278c7,_0x5dc96b){if(_0x1278c7['body']['id']){delete _0x1278c7[_0x08ee('0x47')]['id'];}return db[_0x08ee('0x3f')][_0x08ee('0x48')]({'where':{'id':_0x1278c7[_0x08ee('0x45')]['id']}})[_0x08ee('0x10')](handleEntityNotFound(_0x5dc96b,null))[_0x08ee('0x10')](saveUpdates(_0x1278c7['body'],null))[_0x08ee('0x10')](respondWithResult(_0x5dc96b,null))['catch'](handleError(_0x5dc96b,null));};exports['destroy']=function(_0x4432dd,_0x4364fd){return db['MailMessage'][_0x08ee('0x48')]({'where':{'id':_0x4432dd['params']['id']}})[_0x08ee('0x10')](handleEntityNotFound(_0x4364fd,null))[_0x08ee('0x10')](removeEntity(_0x4364fd,null))[_0x08ee('0x1b')](handleError(_0x4364fd,null));};exports[_0x08ee('0x49')]=function(_0x5eefae,_0x3ed67f){return db['MailMessage'][_0x08ee('0x49')]()[_0x08ee('0x10')](respondWithResult(_0x3ed67f,null))[_0x08ee('0x1b')](handleError(_0x3ed67f,null));};exports[_0x08ee('0x4a')]=function(_0x2fd870,_0x227bf2){return db[_0x08ee('0x3f')][_0x08ee('0x4a')](_0x2fd870[_0x08ee('0x47')])[_0x08ee('0x10')](function(_0x50d30a){if(_0x50d30a){if(_0x50d30a['direction']===_0x08ee('0x4b')&&!_0x50d30a['secret']){var _0x577a6d,_0xce9c4a,_0x4e8bdc;if(_0x2fd870[_0x08ee('0x47')]['to']){_0xce9c4a=_0x2fd870['body']['to'][_0x08ee('0x4c')](',')[0x0];}return db['MailAccount'][_0x08ee('0x4d')]({'where':{'id':_0x50d30a[_0x08ee('0x4e')]},'include':[{'model':db[_0x08ee('0x4f')],'as':'List','include':[{'model':db[_0x08ee('0x50')],'as':'Contacts','where':{'email':_0xce9c4a},'limit':0x1,'order':[['updatedAt',_0x08ee('0x51')]]}]},{'model':db[_0x08ee('0x52')],'as':_0x08ee('0x53'),'raw':!![]}]})[_0x08ee('0x10')](function(_0x55e134){_0x577a6d=_0x55e134;if(_0x577a6d&&_0x577a6d[_0x08ee('0x53')]){var _0x1e87f6={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x577a6d['Smtp'][_0x08ee('0x54')])){_0x1e87f6[_0x08ee('0x55')]=_0x577a6d[_0x08ee('0x53')][_0x08ee('0x55')];_0x1e87f6[_0x08ee('0x56')]=_0x577a6d[_0x08ee('0x53')][_0x08ee('0x56')];_0x1e87f6[_0x08ee('0x57')]=_0x577a6d[_0x08ee('0x53')][_0x08ee('0x57')];if(_0x577a6d[_0x08ee('0x53')]['authentication']){_0x1e87f6[_0x08ee('0x58')]={'user':_0x577a6d[_0x08ee('0x53')][_0x08ee('0x59')],'pass':_0x577a6d['Smtp'][_0x08ee('0x5a')]};}}else{_0x1e87f6[_0x08ee('0x54')]=_0x577a6d[_0x08ee('0x53')][_0x08ee('0x54')];_0x1e87f6[_0x08ee('0x58')]={'user':_0x577a6d[_0x08ee('0x53')]['user'],'pass':_0x577a6d[_0x08ee('0x53')][_0x08ee('0x5a')]};_0x1e87f6['secure']=_0x577a6d['Smtp'][_0x08ee('0x57')];}if(_0x2fd870['body'][_0x08ee('0x5b')]&&_0x2fd870[_0x08ee('0x47')][_0x08ee('0x5b')][_0x08ee('0x34')]){for(var _0x240420=0x0;_0x240420<_0x2fd870[_0x08ee('0x47')][_0x08ee('0x5b')][_0x08ee('0x34')];_0x240420+=0x1){_0x2fd870[_0x08ee('0x47')][_0x08ee('0x5b')][_0x240420]={'filename':_0x2fd870['body'][_0x08ee('0x5b')][_0x240420]['name'],'path':path[_0x08ee('0x5c')](config[_0x08ee('0x5d')],_0x08ee('0x5e'),_0x2fd870[_0x08ee('0x47')][_0x08ee('0x5b')][_0x240420][_0x08ee('0x5f')])};}}_0x4e8bdc={'account':_0x1e87f6,'message':_0x2fd870[_0x08ee('0x47')]};return;}})['then'](function(){if(_0x577a6d['List']){if(_0x577a6d[_0x08ee('0x60')][_0x08ee('0x61')]['length']){return _0x577a6d[_0x08ee('0x60')][_0x08ee('0x61')][0x0];}else{return db[_0x08ee('0x50')][_0x08ee('0x4a')](_[_0x08ee('0xa')](_0x2fd870['body'],{'firstName':_0x2fd870[_0x08ee('0x47')]['to'],'email':_0x2fd870['body']['to'],'phone':_0x2fd870[_0x08ee('0x47')]['to'],'ListId':_0x577a6d[_0x08ee('0x62')]}));}}else{throw new Error(_0x08ee('0x63'));}})['then'](function(){if(_0x4e8bdc){return respondWithRpcPromise(_0x08ee('0x64'),_0x08ee('0x65'),_0x4e8bdc,client9003)[_0x08ee('0x10')](function(_0x52a02e){return _0x50d30a[_0x08ee('0x66')]({'read':!![],'messageId':_0x52a02e['messageId'],'sentAt':moment()[_0x08ee('0x67')](_0x08ee('0x68'))});})[_0x08ee('0x1b')](function(_0x80c71e){logger[_0x08ee('0x17')]('%s',JSON['stringify'](_0x80c71e));return _0x50d30a;});}return _0x50d30a;});}return _0x50d30a;}})[_0x08ee('0x10')](respondWithResult(_0x227bf2,0xc9))[_0x08ee('0x1b')](handleError(_0x227bf2,null));};exports[_0x08ee('0x69')]=function(_0x126b8f,_0x517a3e){var _0x4658b9={'agent':{},'channel':'mail'};if(_0x126b8f[_0x08ee('0x47')]['id']){delete _0x126b8f[_0x08ee('0x47')]['id'];}_0x126b8f['body'][_0x08ee('0x6a')]=!![];_0x126b8f[_0x08ee('0x47')]['readAt']=moment()['format'](_0x08ee('0x68'));_0x126b8f[_0x08ee('0x47')]['UserId']=_0x126b8f[_0x08ee('0x47')][_0x08ee('0x6b')]||_0x126b8f[_0x08ee('0x59')]['id'];_0x4658b9[_0x08ee('0x6c')]['id']=_0x126b8f['body'][_0x08ee('0x6b')];return db['MailMessage'][_0x08ee('0x48')]({'where':{'id':_0x126b8f[_0x08ee('0x45')]['id'],'UserId':null}})[_0x08ee('0x10')](handleEntityNotFound(_0x517a3e,null))[_0x08ee('0x10')](saveUpdates(_0x126b8f[_0x08ee('0x47')],null))[_0x08ee('0x10')](function(_0x28ed25){if(_0x28ed25){_0x4658b9['message']=_0x28ed25[_0x08ee('0x6d')]({'plain':!![]});return db['MailInteraction'][_0x08ee('0x48')]({'where':{'id':_0x28ed25['MailInteractionId']}});}return null;})[_0x08ee('0x10')](handleEntityNotFound(_0x517a3e,null))[_0x08ee('0x10')](function(_0x47d02d){if(_0x47d02d){return _0x47d02d['update']({'UserId':_0x126b8f['body']['UserId'],'read1stAt':_[_0x08ee('0x6e')](_0x47d02d[_0x08ee('0x6f')])?moment()[_0x08ee('0x67')](_0x08ee('0x68')):undefined});}return null;})[_0x08ee('0x10')](function(_0x37033e){if(_0x37033e){_0x4658b9['interaction']=_0x37033e[_0x08ee('0x6d')]({'plain':!![]});interaction_log[_0x08ee('0x11')](_0x08ee('0x70'),_0x126b8f[_0x08ee('0x59')]['id'],_0x126b8f[_0x08ee('0x59')]['name'],_0x126b8f[_0x08ee('0x59')]['role'],_0x4658b9[_0x08ee('0x71')]['id'],_0x126b8f['body']?JSON[_0x08ee('0x16')](_0x126b8f['body']):_0x08ee('0x72'));return respondWithRpcPromise(_0x08ee('0x73'),'acceptMessage',_0x4658b9);}return null;})[_0x08ee('0x10')](function(_0x593541){var _0x4e9fd9='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x593541['message']['ContactId'];return db['sequelize']['query'](_0x4e9fd9,{'type':db[_0x08ee('0x74')][_0x08ee('0x75')][_0x08ee('0x76')],'raw':!![]})[_0x08ee('0x10')](function(_0x38a2d2){return _0x38a2d2;});})[_0x08ee('0x10')](function(_0x334f74){if(_0x334f74){_0x4658b9[_0x08ee('0x19')][_0x08ee('0x77')]=_0x334f74[0x0];if(!_0x126b8f[_0x08ee('0x47')][_0x08ee('0x6b')])return;return db[_0x08ee('0x78')][_0x08ee('0x48')]({'where':{'id':_0x126b8f[_0x08ee('0x47')][_0x08ee('0x6b')],'role':'agent'},'attributes':['id',_0x08ee('0x27'),_0x08ee('0x79'),'email',_0x08ee('0x7a')],'raw':!![]});}return null;})[_0x08ee('0x10')](function(_0x46e93){if(!_0x46e93)return null;_0x4658b9['message'][_0x08ee('0x6c')]=_0x46e93;return _0x4658b9;})[_0x08ee('0x10')](function(_0x45c444){if(_0x45c444){if(_0x126b8f[_0x08ee('0x47')]['manual']){_0x4658b9[_0x08ee('0x19')]['interface']=util[_0x08ee('0x67')](_0x08ee('0x7b'),_0x126b8f[_0x08ee('0x59')][_0x08ee('0x27')]);_0x4658b9[_0x08ee('0x19')][_0x08ee('0x7c')]=_0x4658b9[_0x08ee('0x7c')];_0x4658b9[_0x08ee('0x19')][_0x08ee('0x7d')]=_0x4658b9[_0x08ee('0x7c')];_0x4658b9[_0x08ee('0x19')][_0x08ee('0x7e')]=_0x08ee('0x69');_0x4658b9[_0x08ee('0x19')][_0x08ee('0x47')]=htmlToText[_0x08ee('0x7f')](_0x4658b9['message']['body']);return respondWithRpcPromise(_0x08ee('0x80'),'EventManager',{'event':_0x08ee('0x81'),'message':_0x4658b9['message']},client9002)[_0x08ee('0x10')](function(){return _0x4658b9;});}return _0x4658b9;}return null;})[_0x08ee('0x10')](respondWithResult(_0x517a3e,null))[_0x08ee('0x1b')](handleError(_0x517a3e,null));};exports[_0x08ee('0x82')]=function(_0x5ae3b7,_0x2d1bdb){var _0x350b4c={'agent':{},'channel':_0x08ee('0x83')};if(_0x5ae3b7[_0x08ee('0x47')]['id']){delete _0x5ae3b7[_0x08ee('0x47')]['id'];}_0x5ae3b7[_0x08ee('0x47')][_0x08ee('0x6b')]=_0x5ae3b7[_0x08ee('0x47')]['UserId']||_0x5ae3b7['user']['id'];_0x350b4c[_0x08ee('0x6c')]['id']=_0x5ae3b7[_0x08ee('0x47')][_0x08ee('0x6b')];return db['MailMessage'][_0x08ee('0x48')]({'where':{'id':_0x5ae3b7[_0x08ee('0x45')]['id'],'UserId':null}})[_0x08ee('0x10')](handleEntityNotFound(_0x2d1bdb,null))['then'](function(_0x4a42fc){if(_0x4a42fc){_0x350b4c[_0x08ee('0x19')]=_0x4a42fc[_0x08ee('0x6d')]({'plain':!![]});return db[_0x08ee('0x84')][_0x08ee('0x48')]({'where':{'id':_0x4a42fc['MailInteractionId']}});}return null;})[_0x08ee('0x10')](handleEntityNotFound(_0x2d1bdb,null))[_0x08ee('0x10')](function(_0x520c4f){if(_0x520c4f){_0x350b4c['interaction']=_0x520c4f[_0x08ee('0x6d')]({'plain':!![]});interaction_log[_0x08ee('0x11')](_0x08ee('0x85'),_0x5ae3b7[_0x08ee('0x59')]['id'],_0x5ae3b7[_0x08ee('0x59')][_0x08ee('0x27')],_0x5ae3b7['user'][_0x08ee('0x86')],_0x350b4c['interaction']['id'],_0x5ae3b7['body']?JSON[_0x08ee('0x16')](_0x5ae3b7[_0x08ee('0x47')]):_0x08ee('0x72'));return respondWithRpcPromise(_0x08ee('0x87'),_0x08ee('0x88'),_0x350b4c);}return null;})['then'](function(_0x2a008b){var _0x154067='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2a008b[_0x08ee('0x19')][_0x08ee('0x89')];return db[_0x08ee('0x8a')]['query'](_0x154067,{'type':db[_0x08ee('0x74')][_0x08ee('0x75')]['SELECT'],'raw':!![]})['then'](function(_0x16e3bc){return _0x16e3bc;});})['then'](function(_0x45534a){if(_0x45534a){_0x350b4c[_0x08ee('0x19')][_0x08ee('0x77')]=_0x45534a[0x0];if(!_0x5ae3b7[_0x08ee('0x47')][_0x08ee('0x6b')])return;return db[_0x08ee('0x78')][_0x08ee('0x48')]({'where':{'id':_0x5ae3b7[_0x08ee('0x47')][_0x08ee('0x6b')],'role':_0x08ee('0x6c')},'attributes':['id',_0x08ee('0x27'),_0x08ee('0x79'),_0x08ee('0x8b'),_0x08ee('0x7a')],'raw':!![]});}return null;})[_0x08ee('0x10')](function(_0xa45ff1){if(!_0xa45ff1)return null;_0x350b4c[_0x08ee('0x19')][_0x08ee('0x6c')]=_0xa45ff1;return _0x350b4c;})[_0x08ee('0x10')](function(_0x579094){if(_0x579094){_0x579094[_0x08ee('0x19')]['interface']=util[_0x08ee('0x67')](_0x08ee('0x7b'),_0x5ae3b7['user'][_0x08ee('0x27')]);_0x579094[_0x08ee('0x19')][_0x08ee('0x7c')]=_0x350b4c[_0x08ee('0x7c')];_0x579094['message'][_0x08ee('0x7d')]=_0x350b4c[_0x08ee('0x7c')];_0x579094[_0x08ee('0x19')]['event']='reject';_0x579094[_0x08ee('0x19')][_0x08ee('0x47')]=htmlToText[_0x08ee('0x7f')](_0x350b4c[_0x08ee('0x19')][_0x08ee('0x47')]);respondWithRpcPromise(_0x08ee('0x80'),_0x08ee('0x80'),{'event':_0x08ee('0x8c'),'message':_0x579094[_0x08ee('0x19')]},client9002);return _0x350b4c;}return null;})['then'](respondWithResult(_0x2d1bdb,null))['catch'](handleError(_0x2d1bdb,null));};exports[_0x08ee('0x8d')]=function(_0x3be076,_0x462cad){var _0x2b018b=moment()[_0x08ee('0x8e')]()[_0x08ee('0x8f')]();var _0x8fb29d=path[_0x08ee('0x5c')](config[_0x08ee('0x5d')],_0x08ee('0x90'),_0x08ee('0x91'),'tmp');var _0x2d5d1e=path[_0x08ee('0x5c')](config[_0x08ee('0x5d')],'server',_0x08ee('0x91'),_0x08ee('0x5b'));var _0x58f12e=util['format'](_0x08ee('0x92'),_0x2b018b);return db[_0x08ee('0x3f')]['find']({'where':{'id':_0x3be076[_0x08ee('0x45')]['id']},'attributes':['id',_0x08ee('0x47'),'from','to','cc',_0x08ee('0x93'),_0x08ee('0x94'),_0x08ee('0x95')],'include':_0x3be076['query'][_0x08ee('0x5b')]?[{'model':db[_0x08ee('0x96')],'as':_0x08ee('0x97')}]:undefined})[_0x08ee('0x10')](handleEntityNotFound(_0x462cad,null))[_0x08ee('0x10')](function(_0xfef019){if(_0xfef019){var _0x272098=_0xfef019;var _0x46afc8={'from':_0x272098[_0x08ee('0x98')],'to':_0x272098['to'],'subject':_0x272098[_0x08ee('0x94')],'html':_0x272098[_0x08ee('0x47')],'headers':{'Date':moment(_0x272098[_0x08ee('0x95')])['format']('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0xfef019['cc']){_0x46afc8[_0x08ee('0x99')]['Cc']=_0xfef019['cc'];}if(_0xfef019[_0x08ee('0x93')]){_0x46afc8[_0x08ee('0x99')]['Bcc']=_0xfef019['bcc'];}return new BPromise(function(_0x4d5e7e,_0x46f9e2){if(_0xfef019[_0x08ee('0x97')]){for(var _0x376595=0x0;_0x376595<_0xfef019[_0x08ee('0x97')][_0x08ee('0x34')];_0x376595++){var _0x1f9343=_0xfef019['Attachments'][_0x376595];var _0x214f1b=path['join'](_0x2d5d1e,_0x1f9343['basename']);if(fs[_0x08ee('0x9a')](_0x214f1b)){_0x46afc8[_0x08ee('0x5b')][_0x08ee('0x9b')]({'name':_0x1f9343[_0x08ee('0x27')],'contentType':_0x1f9343[_0x08ee('0x3c')],'data':fs['readFileSync'](_0x214f1b)});}}}emlformat['build'](_0x46afc8,function(_0x5d70fe,_0x3abb81){if(_0x5d70fe)return _0x46f9e2(_0x5d70fe);fs['writeFileSync'](path['join'](_0x8fb29d,_0x58f12e),_0x3abb81);return _0x4d5e7e(_0x3abb81);});});}})[_0x08ee('0x10')](function(_0x3b2f45){if(_0x3b2f45){return _0x462cad[_0x08ee('0x8d')](path[_0x08ee('0x5c')](_0x8fb29d,_0x58f12e),_0x58f12e,function(_0x37a6ed){if(!_0x37a6ed)fs[_0x08ee('0x9c')](path[_0x08ee('0x5c')](_0x8fb29d,_0x58f12e));});}})[_0x08ee('0x1b')](handleError(_0x462cad,null));}; \ No newline at end of file +var _0x5dea=['catch','status','json','offset','limit','undefined','count','Content-Range','update','then','destroy','end','stack','name','send','map','rawAttributes','fieldName','type','key','keys','query','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','MailMessage','includeAll','findAll','show','find','body','params','describe','create','direction','out','secret','split','MailAccount','findOne','CmList','List','CmContact','Contacts','updatedAt','DESC','Smtp','isNil','service','port','secure','authentication','user','pass','auth','attachments','join','root','basename','ListId','List\x20not\x20found','SendMail','format','YYYY-MM-DD\x20HH:mm:ss','stringify','accept','mail','read','readAt','UserId','agent','get','MailInteractionId','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','SELECT','contact','fullname','internal','interface','SIP/%s','motionChannel','channel','event','EventManager','acceptmessage','reject','MailInteraction','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','ContactId','QueryTypes','User','rejectmessage','unix','toString','server','files','tmp','from','bcc','subject','Attachments','createdAt','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','push','build','download','unlinkSync','moment','bluebird','util','path','lodash','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./mailMessage.socket','register','jayson/promise','client','http','request','info','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','error','code','MailMessage,\x20%s,\x20%s','message','result'];(function(_0x2f7231,_0x20670d){var _0x1a9d86=function(_0x27c00d){while(--_0x27c00d){_0x2f7231['push'](_0x2f7231['shift']());}};_0x1a9d86(++_0x20670d);}(_0x5dea,0x1c5));var _0xa5de=function(_0x23341f,_0xb59ff7){_0x23341f=_0x23341f-0x0;var _0x1d73a2=_0x5dea[_0x23341f];return _0x1d73a2;};'use strict';var emlformat=require('eml-format');var moment=require(_0xa5de('0x0'));var BPromise=require(_0xa5de('0x1'));var util=require(_0xa5de('0x2'));var path=require(_0xa5de('0x3'));var fs=require('fs');var _=require(_0xa5de('0x4'));var Redis=require(_0xa5de('0x5'));var htmlToText=require(_0xa5de('0x6'));var qs=require(_0xa5de('0x7'));var logger=require(_0xa5de('0x8'))(_0xa5de('0x9'));var interaction_log=require(_0xa5de('0x8'))(_0xa5de('0xa'));var config=require('../../config/environment');var db=require(_0xa5de('0xb'))['db'];config['redis']=_[_0xa5de('0xc')](config[_0xa5de('0xd')],{'host':_0xa5de('0xe'),'port':0x18eb});var socket=require(_0xa5de('0xf'))(new Redis(config[_0xa5de('0xd')]));require(_0xa5de('0x10'))[_0xa5de('0x11')](socket);var jayson=require(_0xa5de('0x12'));var client=jayson[_0xa5de('0x13')]['http']({'port':0x232c});var client9003=jayson['client']['http']({'port':0x232b});var client9002=jayson['client'][_0xa5de('0x14')]({'port':0x232a});function respondWithRpcPromise(_0x3374a5,_0x97b5bf,_0x17bd7c,_0x37c2e4){return new BPromise(function(_0x349b99,_0x214595){var _0x27736a=_0x37c2e4||client;return _0x27736a[_0xa5de('0x15')](_0x3374a5,_0x17bd7c)['then'](function(_0x2ea490){logger[_0xa5de('0x16')]('MailMessage,\x20%s,\x20%s',_0x97b5bf,_0xa5de('0x17'));logger['debug'](_0xa5de('0x18'),_0x97b5bf,_0xa5de('0x17'),JSON['stringify'](_0x2ea490));if(_0x2ea490[_0xa5de('0x19')]){if(_0x2ea490[_0xa5de('0x19')][_0xa5de('0x1a')]===0x1f4){logger[_0xa5de('0x19')](_0xa5de('0x1b'),_0x97b5bf,_0x2ea490[_0xa5de('0x19')][_0xa5de('0x1c')]);return _0x214595(_0x2ea490[_0xa5de('0x19')][_0xa5de('0x1c')]);}logger[_0xa5de('0x19')]('MailMessage,\x20%s,\x20%s',_0x97b5bf,_0x2ea490[_0xa5de('0x19')]['message']);return _0x349b99(_0x2ea490[_0xa5de('0x19')][_0xa5de('0x1c')]);}else{logger[_0xa5de('0x16')](_0xa5de('0x1b'),_0x97b5bf,_0xa5de('0x17'));_0x349b99(_0x2ea490[_0xa5de('0x1d')][_0xa5de('0x1c')]);}})[_0xa5de('0x1e')](function(_0x43dd45){logger['error'](_0xa5de('0x1b'),_0x97b5bf,_0x43dd45);_0x214595(_0x43dd45);});});}function respondWithResult(_0x10d7e9,_0x2af701){_0x2af701=_0x2af701||0xc8;return function(_0x32471e){if(_0x32471e){return _0x10d7e9[_0xa5de('0x1f')](_0x2af701)[_0xa5de('0x20')](_0x32471e);}};}function respondWithFilteredResult(_0x2d7279,_0x5e23dc){return function(_0x17617c){if(_0x17617c){var _0x1aae8b=typeof _0x5e23dc[_0xa5de('0x21')]==='undefined'&&typeof _0x5e23dc[_0xa5de('0x22')]===_0xa5de('0x23');var _0x23af58=_0x17617c[_0xa5de('0x24')];var _0x580623=_0x1aae8b?0x0:_0x5e23dc[_0xa5de('0x21')];var _0x5c0694=_0x1aae8b?_0x17617c[_0xa5de('0x24')]:_0x5e23dc[_0xa5de('0x21')]+_0x5e23dc[_0xa5de('0x22')];var _0x5f4c43;if(_0x5c0694>=_0x23af58){_0x5c0694=_0x23af58;_0x5f4c43=0xc8;}else{_0x5f4c43=0xce;}_0x2d7279[_0xa5de('0x1f')](_0x5f4c43);return _0x2d7279['set'](_0xa5de('0x25'),_0x580623+'-'+_0x5c0694+'/'+_0x23af58)[_0xa5de('0x20')](_0x17617c);}return null;};}function saveUpdates(_0x3d15a0){return function(_0x3e8d47){if(_0x3e8d47){return _0x3e8d47[_0xa5de('0x26')](_0x3d15a0)[_0xa5de('0x27')](function(_0x2dc0ff){return _0x2dc0ff;});}return null;};}function removeEntity(_0x4614a2){return function(_0x4504ba){if(_0x4504ba){return _0x4504ba[_0xa5de('0x28')]()[_0xa5de('0x27')](function(){_0x4614a2[_0xa5de('0x1f')](0xcc)[_0xa5de('0x29')]();});}};}function handleEntityNotFound(_0x3559af){return function(_0x206746){if(!_0x206746){_0x3559af['sendStatus'](0x194);}return _0x206746;};}function handleError(_0x3d8426,_0x377c64){_0x377c64=_0x377c64||0x1f4;return function(_0x17c1e9){logger[_0xa5de('0x19')](_0x17c1e9[_0xa5de('0x2a')]);if(_0x17c1e9[_0xa5de('0x2b')]){delete _0x17c1e9[_0xa5de('0x2b')];}_0x3d8426[_0xa5de('0x1f')](_0x377c64)[_0xa5de('0x2c')](_0x17c1e9);};}exports['index']=function(_0x405a29,_0x387f00){var _0x2c6421={},_0x110916={},_0x436d86={'count':0x0,'rows':[]};var _0x3c2573=_[_0xa5de('0x2d')](db['MailMessage'][_0xa5de('0x2e')],function(_0x4efe08){return{'name':_0x4efe08[_0xa5de('0x2f')],'type':_0x4efe08[_0xa5de('0x30')][_0xa5de('0x31')]};});_0x110916['model']=_[_0xa5de('0x2d')](_0x3c2573,_0xa5de('0x2b'));_0x110916['query']=_[_0xa5de('0x32')](_0x405a29[_0xa5de('0x33')]);_0x110916['filters']=_[_0xa5de('0x34')](_0x110916['model'],_0x110916[_0xa5de('0x33')]);_0x2c6421[_0xa5de('0x35')]=_['intersection'](_0x110916[_0xa5de('0x36')],qs['fields'](_0x405a29[_0xa5de('0x33')][_0xa5de('0x37')]));_0x2c6421[_0xa5de('0x35')]=_0x2c6421['attributes'][_0xa5de('0x38')]?_0x2c6421[_0xa5de('0x35')]:_0x110916['model'];if(!_0x405a29[_0xa5de('0x33')][_0xa5de('0x39')](_0xa5de('0x3a'))){_0x2c6421['limit']=qs[_0xa5de('0x22')](_0x405a29[_0xa5de('0x33')][_0xa5de('0x22')]);_0x2c6421[_0xa5de('0x21')]=qs[_0xa5de('0x21')](_0x405a29[_0xa5de('0x33')][_0xa5de('0x21')]);}_0x2c6421[_0xa5de('0x3b')]=qs[_0xa5de('0x3c')](_0x405a29['query'][_0xa5de('0x3c')]);_0x2c6421[_0xa5de('0x3d')]=qs[_0xa5de('0x3e')](_[_0xa5de('0x3f')](_0x405a29[_0xa5de('0x33')],_0x110916[_0xa5de('0x3e')]),_0x3c2573);if(_0x405a29[_0xa5de('0x33')][_0xa5de('0x40')]){_0x2c6421[_0xa5de('0x3d')]=_[_0xa5de('0x41')](_0x2c6421['where'],{'$or':_[_0xa5de('0x2d')](_0x3c2573,function(_0x304405){if(_0x304405[_0xa5de('0x30')]!==_0xa5de('0x42')){var _0x27a810={};_0x27a810[_0x304405[_0xa5de('0x2b')]]={'$like':'%'+_0x405a29['query'][_0xa5de('0x40')]+'%'};return _0x27a810;}})});}_0x2c6421=_['merge']({},_0x2c6421,_0x405a29[_0xa5de('0x43')]);var _0x165deb={'where':_0x2c6421['where']};return db[_0xa5de('0x44')][_0xa5de('0x24')](_0x165deb)[_0xa5de('0x27')](function(_0x3f7419){_0x436d86[_0xa5de('0x24')]=_0x3f7419;if(_0x405a29[_0xa5de('0x33')][_0xa5de('0x45')]){_0x2c6421['include']=[{'all':!![]}];}return db['MailMessage'][_0xa5de('0x46')](_0x2c6421);})[_0xa5de('0x27')](function(_0x26301a){_0x436d86['rows']=_0x26301a;return _0x436d86;})['then'](respondWithFilteredResult(_0x387f00,_0x2c6421))[_0xa5de('0x1e')](handleError(_0x387f00,null));};exports[_0xa5de('0x47')]=function(_0x3efc5b,_0x557e5c){var _0xa58e22={'raw':!![],'where':{'id':_0x3efc5b['params']['id']}},_0x2e303b={};_0x2e303b['model']=_[_0xa5de('0x32')](db[_0xa5de('0x44')]['rawAttributes']);_0x2e303b[_0xa5de('0x33')]=_['keys'](_0x3efc5b[_0xa5de('0x33')]);_0x2e303b[_0xa5de('0x3e')]=_['intersection'](_0x2e303b[_0xa5de('0x36')],_0x2e303b[_0xa5de('0x33')]);_0xa58e22['attributes']=_[_0xa5de('0x34')](_0x2e303b['model'],qs[_0xa5de('0x37')](_0x3efc5b[_0xa5de('0x33')][_0xa5de('0x37')]));_0xa58e22[_0xa5de('0x35')]=_0xa58e22['attributes'][_0xa5de('0x38')]?_0xa58e22[_0xa5de('0x35')]:_0x2e303b['model'];if(_0x3efc5b[_0xa5de('0x33')][_0xa5de('0x45')]){_0xa58e22['include']=[{'all':!![]}];}_0xa58e22=_[_0xa5de('0x41')]({},_0xa58e22,_0x3efc5b[_0xa5de('0x43')]);return db[_0xa5de('0x44')][_0xa5de('0x48')](_0xa58e22)['then'](handleEntityNotFound(_0x557e5c,null))[_0xa5de('0x27')](respondWithResult(_0x557e5c,null))[_0xa5de('0x1e')](handleError(_0x557e5c,null));};exports[_0xa5de('0x26')]=function(_0x1c70ef,_0x1ce1cc){if(_0x1c70ef[_0xa5de('0x49')]['id']){delete _0x1c70ef[_0xa5de('0x49')]['id'];}return db['MailMessage'][_0xa5de('0x48')]({'where':{'id':_0x1c70ef['params']['id']}})[_0xa5de('0x27')](handleEntityNotFound(_0x1ce1cc,null))[_0xa5de('0x27')](saveUpdates(_0x1c70ef[_0xa5de('0x49')],null))['then'](respondWithResult(_0x1ce1cc,null))[_0xa5de('0x1e')](handleError(_0x1ce1cc,null));};exports['destroy']=function(_0x2c6e82,_0x122061){return db['MailMessage'][_0xa5de('0x48')]({'where':{'id':_0x2c6e82[_0xa5de('0x4a')]['id']}})[_0xa5de('0x27')](handleEntityNotFound(_0x122061,null))[_0xa5de('0x27')](removeEntity(_0x122061,null))[_0xa5de('0x1e')](handleError(_0x122061,null));};exports['describe']=function(_0x1b3f10,_0x44af8f){return db[_0xa5de('0x44')][_0xa5de('0x4b')]()[_0xa5de('0x27')](respondWithResult(_0x44af8f,null))[_0xa5de('0x1e')](handleError(_0x44af8f,null));};exports['create']=function(_0x4a1179,_0x17dcf5){return db[_0xa5de('0x44')][_0xa5de('0x4c')](_0x4a1179[_0xa5de('0x49')])['then'](function(_0x4c3832){if(_0x4c3832){if(_0x4c3832[_0xa5de('0x4d')]===_0xa5de('0x4e')&&!_0x4c3832[_0xa5de('0x4f')]){var _0x4d2840,_0x3a749f,_0x1533af;if(_0x4a1179[_0xa5de('0x49')]['to']){_0x3a749f=_0x4a1179[_0xa5de('0x49')]['to'][_0xa5de('0x50')](',')[0x0];}return db[_0xa5de('0x51')][_0xa5de('0x52')]({'where':{'id':_0x4c3832['MailAccountId']},'include':[{'model':db[_0xa5de('0x53')],'as':_0xa5de('0x54'),'include':[{'model':db[_0xa5de('0x55')],'as':_0xa5de('0x56'),'where':{'email':_0x3a749f},'limit':0x1,'order':[[_0xa5de('0x57'),_0xa5de('0x58')]]}]},{'model':db['MailServerOut'],'as':_0xa5de('0x59'),'raw':!![]}]})['then'](function(_0x1a310e){_0x4d2840=_0x1a310e;if(_0x4d2840&&_0x4d2840['Smtp']){var _0x16f2e4={'tls':{'rejectUnauthorized':![]}};if(_[_0xa5de('0x5a')](_0x4d2840[_0xa5de('0x59')][_0xa5de('0x5b')])){_0x16f2e4['host']=_0x4d2840[_0xa5de('0x59')]['host'];_0x16f2e4[_0xa5de('0x5c')]=_0x4d2840[_0xa5de('0x59')][_0xa5de('0x5c')];_0x16f2e4[_0xa5de('0x5d')]=_0x4d2840[_0xa5de('0x59')][_0xa5de('0x5d')];if(_0x4d2840['Smtp'][_0xa5de('0x5e')]){_0x16f2e4['auth']={'user':_0x4d2840[_0xa5de('0x59')][_0xa5de('0x5f')],'pass':_0x4d2840[_0xa5de('0x59')][_0xa5de('0x60')]};}}else{_0x16f2e4['service']=_0x4d2840[_0xa5de('0x59')][_0xa5de('0x5b')];_0x16f2e4[_0xa5de('0x61')]={'user':_0x4d2840['Smtp'][_0xa5de('0x5f')],'pass':_0x4d2840[_0xa5de('0x59')]['pass']};_0x16f2e4[_0xa5de('0x5d')]=_0x4d2840[_0xa5de('0x59')][_0xa5de('0x5d')];}if(_0x4a1179[_0xa5de('0x49')][_0xa5de('0x62')]&&_0x4a1179[_0xa5de('0x49')][_0xa5de('0x62')][_0xa5de('0x38')]){for(var _0x23d22d=0x0;_0x23d22d<_0x4a1179[_0xa5de('0x49')]['attachments'][_0xa5de('0x38')];_0x23d22d+=0x1){_0x4a1179[_0xa5de('0x49')][_0xa5de('0x62')][_0x23d22d]={'filename':_0x4a1179[_0xa5de('0x49')][_0xa5de('0x62')][_0x23d22d][_0xa5de('0x2b')],'path':path[_0xa5de('0x63')](config[_0xa5de('0x64')],'server/files/attachments',_0x4a1179[_0xa5de('0x49')][_0xa5de('0x62')][_0x23d22d][_0xa5de('0x65')])};}}_0x1533af={'account':_0x16f2e4,'message':_0x4a1179[_0xa5de('0x49')]};return;}})['then'](function(){if(_0x4d2840[_0xa5de('0x54')]){if(_0x4d2840['List'][_0xa5de('0x56')][_0xa5de('0x38')]){return _0x4d2840['List'][_0xa5de('0x56')][0x0];}else{return db[_0xa5de('0x55')][_0xa5de('0x4c')](_[_0xa5de('0xc')](_0x4a1179[_0xa5de('0x49')],{'firstName':_0x4a1179[_0xa5de('0x49')]['to'],'email':_0x4a1179[_0xa5de('0x49')]['to'],'phone':_0x4a1179['body']['to'],'ListId':_0x4d2840[_0xa5de('0x66')]}));}}else{throw new Error(_0xa5de('0x67'));}})['then'](function(){if(_0x1533af){return respondWithRpcPromise(_0xa5de('0x68'),'sendMail',_0x1533af,client9003)[_0xa5de('0x27')](function(_0x178d03){return _0x4c3832['update']({'read':!![],'messageId':_0x178d03['messageId'],'sentAt':moment()[_0xa5de('0x69')](_0xa5de('0x6a'))});})['catch'](function(_0x2904ff){logger['error']('%s',JSON[_0xa5de('0x6b')](_0x2904ff));return _0x4c3832;});}return _0x4c3832;});}return _0x4c3832;}})['then'](respondWithResult(_0x17dcf5,0xc9))[_0xa5de('0x1e')](handleError(_0x17dcf5,null));};exports[_0xa5de('0x6c')]=function(_0x5bd6b1,_0x133dea){var _0x232899={'agent':{},'channel':_0xa5de('0x6d')};if(_0x5bd6b1['body']['id']){delete _0x5bd6b1['body']['id'];}_0x5bd6b1[_0xa5de('0x49')][_0xa5de('0x6e')]=!![];_0x5bd6b1['body'][_0xa5de('0x6f')]=moment()[_0xa5de('0x69')](_0xa5de('0x6a'));_0x5bd6b1['body'][_0xa5de('0x70')]=_0x5bd6b1[_0xa5de('0x49')]['UserId']||_0x5bd6b1[_0xa5de('0x5f')]['id'];_0x232899[_0xa5de('0x71')]['id']=_0x5bd6b1[_0xa5de('0x49')]['UserId'];return db[_0xa5de('0x44')][_0xa5de('0x48')]({'where':{'id':_0x5bd6b1[_0xa5de('0x4a')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x133dea,null))[_0xa5de('0x27')](saveUpdates(_0x5bd6b1[_0xa5de('0x49')],null))['then'](function(_0x203cad){if(_0x203cad){_0x232899[_0xa5de('0x1c')]=_0x203cad[_0xa5de('0x72')]({'plain':!![]});return db['MailInteraction']['find']({'where':{'id':_0x203cad[_0xa5de('0x73')]}});}return null;})[_0xa5de('0x27')](handleEntityNotFound(_0x133dea,null))[_0xa5de('0x27')](function(_0x4f9982){if(_0x4f9982){return _0x4f9982[_0xa5de('0x26')]({'UserId':_0x5bd6b1[_0xa5de('0x49')][_0xa5de('0x70')],'read1stAt':_[_0xa5de('0x5a')](_0x4f9982[_0xa5de('0x74')])?moment()[_0xa5de('0x69')](_0xa5de('0x6a')):undefined});}return null;})[_0xa5de('0x27')](function(_0x441d03){if(_0x441d03){_0x232899[_0xa5de('0x75')]=_0x441d03['get']({'plain':!![]});interaction_log[_0xa5de('0x16')](_0xa5de('0x76'),_0x5bd6b1[_0xa5de('0x5f')]['id'],_0x5bd6b1[_0xa5de('0x5f')]['name'],_0x5bd6b1[_0xa5de('0x5f')][_0xa5de('0x77')],_0x232899[_0xa5de('0x75')]['id'],_0x5bd6b1[_0xa5de('0x49')]?JSON[_0xa5de('0x6b')](_0x5bd6b1[_0xa5de('0x49')]):_0xa5de('0x78'));return respondWithRpcPromise('AcceptMessage',_0xa5de('0x79'),_0x232899);}return null;})[_0xa5de('0x27')](function(_0x425df1){var _0x41df00=_0xa5de('0x7a')+_0x425df1[_0xa5de('0x1c')]['ContactId'];return db[_0xa5de('0x7b')][_0xa5de('0x33')](_0x41df00,{'type':db[_0xa5de('0x7c')]['QueryTypes'][_0xa5de('0x7d')],'raw':!![]})[_0xa5de('0x27')](function(_0x338cf4){return _0x338cf4;});})[_0xa5de('0x27')](function(_0x1f84ec){if(_0x1f84ec){_0x232899[_0xa5de('0x1c')][_0xa5de('0x7e')]=_0x1f84ec[0x0];if(!_0x5bd6b1[_0xa5de('0x49')]['UserId'])return;return db['User'][_0xa5de('0x48')]({'where':{'id':_0x5bd6b1[_0xa5de('0x49')][_0xa5de('0x70')],'role':_0xa5de('0x71')},'attributes':['id',_0xa5de('0x2b'),_0xa5de('0x7f'),'email',_0xa5de('0x80')],'raw':!![]});}return null;})[_0xa5de('0x27')](function(_0x3f35f4){if(!_0x3f35f4)return null;_0x232899[_0xa5de('0x1c')][_0xa5de('0x71')]=_0x3f35f4;return _0x232899;})[_0xa5de('0x27')](function(_0x19c95d){if(_0x19c95d){if(_0x5bd6b1['body']['manual']){_0x232899[_0xa5de('0x1c')][_0xa5de('0x81')]=util[_0xa5de('0x69')](_0xa5de('0x82'),_0x5bd6b1[_0xa5de('0x5f')][_0xa5de('0x2b')]);_0x232899[_0xa5de('0x1c')]['channel']=_0x232899['channel'];_0x232899[_0xa5de('0x1c')][_0xa5de('0x83')]=_0x232899[_0xa5de('0x84')];_0x232899['message'][_0xa5de('0x85')]='accept';_0x232899[_0xa5de('0x1c')][_0xa5de('0x49')]=htmlToText['fromString'](_0x232899['message'][_0xa5de('0x49')]);return respondWithRpcPromise(_0xa5de('0x86'),_0xa5de('0x86'),{'event':_0xa5de('0x87'),'message':_0x232899[_0xa5de('0x1c')]},client9002)[_0xa5de('0x27')](function(){return _0x232899;});}return _0x232899;}return null;})[_0xa5de('0x27')](respondWithResult(_0x133dea,null))[_0xa5de('0x1e')](handleError(_0x133dea,null));};exports[_0xa5de('0x88')]=function(_0x410727,_0x3c7705){var _0x2fee43={'agent':{},'channel':_0xa5de('0x6d')};if(_0x410727[_0xa5de('0x49')]['id']){delete _0x410727[_0xa5de('0x49')]['id'];}_0x410727[_0xa5de('0x49')][_0xa5de('0x70')]=_0x410727[_0xa5de('0x49')][_0xa5de('0x70')]||_0x410727[_0xa5de('0x5f')]['id'];_0x2fee43[_0xa5de('0x71')]['id']=_0x410727['body'][_0xa5de('0x70')];return db[_0xa5de('0x44')][_0xa5de('0x48')]({'where':{'id':_0x410727[_0xa5de('0x4a')]['id'],'UserId':null}})[_0xa5de('0x27')](handleEntityNotFound(_0x3c7705,null))['then'](function(_0x3c9ba2){if(_0x3c9ba2){_0x2fee43[_0xa5de('0x1c')]=_0x3c9ba2[_0xa5de('0x72')]({'plain':!![]});return db[_0xa5de('0x89')][_0xa5de('0x48')]({'where':{'id':_0x3c9ba2[_0xa5de('0x73')]}});}return null;})[_0xa5de('0x27')](handleEntityNotFound(_0x3c7705,null))[_0xa5de('0x27')](function(_0x2c6cec){if(_0x2c6cec){_0x2fee43[_0xa5de('0x75')]=_0x2c6cec[_0xa5de('0x72')]({'plain':!![]});interaction_log['info'](_0xa5de('0x8a'),_0x410727[_0xa5de('0x5f')]['id'],_0x410727[_0xa5de('0x5f')][_0xa5de('0x2b')],_0x410727[_0xa5de('0x5f')][_0xa5de('0x77')],_0x2fee43[_0xa5de('0x75')]['id'],_0x410727[_0xa5de('0x49')]?JSON[_0xa5de('0x6b')](_0x410727[_0xa5de('0x49')]):_0xa5de('0x78'));return respondWithRpcPromise(_0xa5de('0x8b'),_0xa5de('0x8c'),_0x2fee43);}return null;})['then'](function(_0x235c8b){var _0x2dea7e=_0xa5de('0x7a')+_0x235c8b[_0xa5de('0x1c')][_0xa5de('0x8d')];return db['sequelize'][_0xa5de('0x33')](_0x2dea7e,{'type':db[_0xa5de('0x7c')][_0xa5de('0x8e')][_0xa5de('0x7d')],'raw':!![]})[_0xa5de('0x27')](function(_0x3e9923){return _0x3e9923;});})['then'](function(_0x3c3f81){if(_0x3c3f81){_0x2fee43[_0xa5de('0x1c')][_0xa5de('0x7e')]=_0x3c3f81[0x0];if(!_0x410727['body']['UserId'])return;return db[_0xa5de('0x8f')][_0xa5de('0x48')]({'where':{'id':_0x410727[_0xa5de('0x49')][_0xa5de('0x70')],'role':_0xa5de('0x71')},'attributes':['id',_0xa5de('0x2b'),_0xa5de('0x7f'),'email',_0xa5de('0x80')],'raw':!![]});}return null;})[_0xa5de('0x27')](function(_0x2392d8){if(!_0x2392d8)return null;_0x2fee43[_0xa5de('0x1c')]['agent']=_0x2392d8;return _0x2fee43;})[_0xa5de('0x27')](function(_0x237b23){if(_0x237b23){_0x237b23[_0xa5de('0x1c')]['interface']=util[_0xa5de('0x69')](_0xa5de('0x82'),_0x410727['user'][_0xa5de('0x2b')]);_0x237b23[_0xa5de('0x1c')][_0xa5de('0x84')]=_0x2fee43[_0xa5de('0x84')];_0x237b23[_0xa5de('0x1c')][_0xa5de('0x83')]=_0x2fee43[_0xa5de('0x84')];_0x237b23[_0xa5de('0x1c')][_0xa5de('0x85')]=_0xa5de('0x88');_0x237b23[_0xa5de('0x1c')][_0xa5de('0x49')]=htmlToText['fromString'](_0x2fee43[_0xa5de('0x1c')]['body']);respondWithRpcPromise(_0xa5de('0x86'),'EventManager',{'event':_0xa5de('0x90'),'message':_0x237b23['message']},client9002);return _0x2fee43;}return null;})[_0xa5de('0x27')](respondWithResult(_0x3c7705,null))['catch'](handleError(_0x3c7705,null));};exports['download']=function(_0x49bd9b,_0x404266){var _0xa375f8=moment()[_0xa5de('0x91')]()[_0xa5de('0x92')]();var _0x16d1f2=path[_0xa5de('0x63')](config[_0xa5de('0x64')],_0xa5de('0x93'),_0xa5de('0x94'),_0xa5de('0x95'));var _0x56207c=path['join'](config[_0xa5de('0x64')],_0xa5de('0x93'),_0xa5de('0x94'),_0xa5de('0x62'));var _0x5c2390=util[_0xa5de('0x69')]('message-%s.eml',_0xa375f8);return db['MailMessage'][_0xa5de('0x48')]({'where':{'id':_0x49bd9b[_0xa5de('0x4a')]['id']},'attributes':['id',_0xa5de('0x49'),_0xa5de('0x96'),'to','cc',_0xa5de('0x97'),_0xa5de('0x98'),'createdAt'],'include':_0x49bd9b[_0xa5de('0x33')]['attachments']?[{'model':db['Attachment'],'as':_0xa5de('0x99')}]:undefined})['then'](handleEntityNotFound(_0x404266,null))[_0xa5de('0x27')](function(_0x1ad146){if(_0x1ad146){var _0x4922d1=_0x1ad146;var _0x52855f={'from':_0x4922d1[_0xa5de('0x96')],'to':_0x4922d1['to'],'subject':_0x4922d1['subject'],'html':_0x4922d1['body'],'headers':{'Date':moment(_0x4922d1[_0xa5de('0x9a')])['format'](_0xa5de('0x9b'))},'attachments':[]};if(_0x1ad146['cc']){_0x52855f[_0xa5de('0x9c')]['Cc']=_0x1ad146['cc'];}if(_0x1ad146['bcc']){_0x52855f[_0xa5de('0x9c')]['Bcc']=_0x1ad146['bcc'];}return new BPromise(function(_0xe2ccb0,_0x9d6023){if(_0x1ad146[_0xa5de('0x99')]){for(var _0x4b102c=0x0;_0x4b102c<_0x1ad146['Attachments'][_0xa5de('0x38')];_0x4b102c++){var _0x51f51c=_0x1ad146[_0xa5de('0x99')][_0x4b102c];var _0x460ae5=path['join'](_0x56207c,_0x51f51c[_0xa5de('0x65')]);if(fs['existsSync'](_0x460ae5)){_0x52855f[_0xa5de('0x62')][_0xa5de('0x9d')]({'name':_0x51f51c[_0xa5de('0x2b')],'contentType':_0x51f51c[_0xa5de('0x30')],'data':fs['readFileSync'](_0x460ae5)});}}}emlformat[_0xa5de('0x9e')](_0x52855f,function(_0x556bd,_0x2a1bb8){if(_0x556bd)return _0x9d6023(_0x556bd);fs['writeFileSync'](path[_0xa5de('0x63')](_0x16d1f2,_0x5c2390),_0x2a1bb8);return _0xe2ccb0(_0x2a1bb8);});});}})[_0xa5de('0x27')](function(_0x4f175b){if(_0x4f175b){return _0x404266[_0xa5de('0x9f')](path[_0xa5de('0x63')](_0x16d1f2,_0x5c2390),_0x5c2390,function(_0x348b9f){if(!_0x348b9f)fs[_0xa5de('0xa0')](path[_0xa5de('0x63')](_0x16d1f2,_0x5c2390));});}})[_0xa5de('0x1e')](handleError(_0x404266,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 254d627..ec1ef17 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 _0xd732=['setMaxListeners','save','update','emit','events'];(function(_0xaf0996,_0x3ee642){var _0x8fde5a=function(_0x130dc7){while(--_0x130dc7){_0xaf0996['push'](_0xaf0996['shift']());}};_0x8fde5a(++_0x3ee642);}(_0xd732,0x171));var _0x2d73=function(_0x3a8b72,_0x5746f9){_0x3a8b72=_0x3a8b72-0x0;var _0x1f66fb=_0xd732[_0x3a8b72];return _0x1f66fb;};'use strict';var EventEmitter=require(_0x2d73('0x0'));var MailMessage=require('../../mysqldb')['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x2d73('0x1')](0x0);var events={'afterCreate':_0x2d73('0x2'),'afterUpdate':_0x2d73('0x3'),'afterDestroy':'remove'};function emitEvent(_0x5e2fae){return function(_0x48fa58,_0x12e063,_0x4d73eb){MailMessageEvents[_0x2d73('0x4')](_0x5e2fae+':'+_0x48fa58['id'],_0x48fa58);MailMessageEvents[_0x2d73('0x4')](_0x5e2fae,_0x48fa58);_0x4d73eb(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module['exports']=MailMessageEvents; \ No newline at end of file +var _0x6402=['update','remove','emit','hasOwnProperty','hook','exports','setMaxListeners','save'];(function(_0x494ffe,_0x557e9e){var _0x1a3f2b=function(_0x52ed7f){while(--_0x52ed7f){_0x494ffe['push'](_0x494ffe['shift']());}};_0x1a3f2b(++_0x557e9e);}(_0x6402,0x66));var _0x2640=function(_0x1fff84,_0x3432fe){_0x1fff84=_0x1fff84-0x0;var _0x4c9c8c=_0x6402[_0x1fff84];return _0x4c9c8c;};'use strict';var EventEmitter=require('events');var MailMessage=require('../../mysqldb')['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x2640('0x0')](0x0);var events={'afterCreate':_0x2640('0x1'),'afterUpdate':_0x2640('0x2'),'afterDestroy':_0x2640('0x3')};function emitEvent(_0x5393b3){return function(_0x413d52,_0x2e0119,_0x589608){MailMessageEvents[_0x2640('0x4')](_0x5393b3+':'+_0x413d52['id'],_0x413d52);MailMessageEvents['emit'](_0x5393b3,_0x413d52);_0x589608(null);};}for(var e in events){if(events[_0x2640('0x5')](e)){var event=events[e];MailMessage[_0x2640('0x6')](e,emitEvent(event));}}module[_0x2640('0x7')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 5d91dd4..e07ac3f 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 _0xb367=['update','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','html-to-text','path','rimraf','./mailMessage.attributes','exports','define','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body','fromString','get','direction','out','secret','isNil','UserId','MailInteraction','MailInteractionId'];(function(_0x92a418,_0xb7558a){var _0x3eb3f1=function(_0x58e2a8){while(--_0x58e2a8){_0x92a418['push'](_0x92a418['shift']());}};_0x3eb3f1(++_0xb7558a);}(_0xb367,0x88));var _0x7b36=function(_0x3d7516,_0x3109fa){_0x3d7516=_0x3d7516-0x0;var _0xb30d=_0xb367[_0x3d7516];return _0xb30d;};'use strict';var _=require(_0x7b36('0x0'));var util=require(_0x7b36('0x1'));var logger=require(_0x7b36('0x2'))(_0x7b36('0x3'));var moment=require(_0x7b36('0x4'));var BPromise=require('bluebird');var rp=require(_0x7b36('0x5'));var htmlToText=require(_0x7b36('0x6'));var fs=require('fs');var path=require(_0x7b36('0x7'));var rimraf=require(_0x7b36('0x8'));var config=require('../../config/environment');var attributes=require(_0x7b36('0x9'));module[_0x7b36('0xa')]=function(_0x42d7f4,_0x7a2197){return _0x42d7f4[_0x7b36('0xb')](_0x7b36('0xc'),attributes,{'tableName':_0x7b36('0xd'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x7b36('0xe')]},{'name':_0x7b36('0xf'),'fields':[_0x7b36('0x10'),_0x7b36('0x11')],'type':_0x7b36('0x12')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3187d8,_0x5b4c42,_0x4ee5ab){if(_0x3187d8[_0x7b36('0x13')]){_0x3187d8[_0x7b36('0x10')]=htmlToText[_0x7b36('0x14')](_0x3187d8[_0x7b36('0x13')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x4ee5ab(null,_0x5b4c42);},'afterCreate':function(_0x201762,_0x48a9c2,_0x2c0c36){var _0x4a8389=_0x42d7f4['models'];var _0x31e393=_0x201762[_0x7b36('0x15')]({'plain':!![]});if(_0x31e393[_0x7b36('0x16')]['toLowerCase']()==='in'||_0x31e393[_0x7b36('0x16')]['toLowerCase']()===_0x7b36('0x17')&&!_0x31e393[_0x7b36('0x18')]&&!_[_0x7b36('0x19')](_0x31e393[_0x7b36('0x1a')])){_0x4a8389[_0x7b36('0x1b')]['findOne']({'where':{'id':_0x31e393[_0x7b36('0x1c')]}})['then'](function(_0x15d10b){if(_0x15d10b){_0x15d10b[_0x7b36('0x1d')]({'lastMsgAt':_0x31e393['createdAt'],'lastMsgDirection':_0x31e393[_0x7b36('0x16')]['toLowerCase']()});}})[_0x7b36('0x1e')](function(_0x1e73f6){console['error'](_0x1e73f6);});}_0x2c0c36();}},'charset':_0x7b36('0x1f'),'collate':_0x7b36('0x20')});}; \ No newline at end of file +var _0xa77a=['createdAt','direction','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','html-to-text','rimraf','../../config/environment','./mailMessage.attributes','define','MailMessage','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body','fromString','models','get','toLowerCase','out','secret','UserId','MailInteraction','findOne','MailInteractionId','then'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa77a,0x126));var _0xaa77=function(_0x541ea6,_0x51cab6){_0x541ea6=_0x541ea6-0x0;var _0x3c3e84=_0xa77a[_0x541ea6];return _0x3c3e84;};'use strict';var _=require(_0xaa77('0x0'));var util=require(_0xaa77('0x1'));var logger=require(_0xaa77('0x2'))(_0xaa77('0x3'));var moment=require(_0xaa77('0x4'));var BPromise=require(_0xaa77('0x5'));var rp=require(_0xaa77('0x6'));var htmlToText=require(_0xaa77('0x7'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaa77('0x8'));var config=require(_0xaa77('0x9'));var attributes=require(_0xaa77('0xa'));module['exports']=function(_0x5ebc30,_0x36313e){return _0x5ebc30[_0xaa77('0xb')](_0xaa77('0xc'),attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0xaa77('0xd'),'fields':[_0xaa77('0xd')]},{'name':_0xaa77('0xe'),'fields':[_0xaa77('0xf'),_0xaa77('0x10')],'type':_0xaa77('0x11')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x33ccee,_0x1b050c,_0x52888d){if(_0x33ccee[_0xaa77('0x12')]){_0x33ccee[_0xaa77('0xf')]=htmlToText[_0xaa77('0x13')](_0x33ccee[_0xaa77('0x12')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x52888d(null,_0x1b050c);},'afterCreate':function(_0x47dde1,_0xa31242,_0x6f9a2b){var _0x1f8d8e=_0x5ebc30[_0xaa77('0x14')];var _0x283c96=_0x47dde1[_0xaa77('0x15')]({'plain':!![]});if(_0x283c96['direction']['toLowerCase']()==='in'||_0x283c96['direction'][_0xaa77('0x16')]()===_0xaa77('0x17')&&!_0x283c96[_0xaa77('0x18')]&&!_['isNil'](_0x283c96[_0xaa77('0x19')])){_0x1f8d8e[_0xaa77('0x1a')][_0xaa77('0x1b')]({'where':{'id':_0x283c96[_0xaa77('0x1c')]}})[_0xaa77('0x1d')](function(_0x266a36){if(_0x266a36){_0x266a36['update']({'lastMsgAt':_0x283c96[_0xaa77('0x1e')],'lastMsgDirection':_0x283c96[_0xaa77('0x1f')][_0xaa77('0x16')]()});}})[_0xaa77('0x20')](function(_0x330d54){console[_0xaa77('0x21')](_0x330d54);});}_0x6f9a2b();}},'charset':_0xaa77('0x22'),'collate':_0xaa77('0x23')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index a115ae7..c55e0fc 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 _0xb10b=['options','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./mailMessage.socket','register','request','then','info','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','MailMessage,\x20%s,\x20%s','message','result','catch','CreateMailMessage','MailMessage','body'];(function(_0x2c697e,_0x399834){var _0x5bd6d5=function(_0x3a5c9d){while(--_0x3a5c9d){_0x2c697e['push'](_0x2c697e['shift']());}};_0x5bd6d5(++_0x399834);}(_0xb10b,0x12a));var _0xbb10=function(_0x20edd4,_0x7c30f2){_0x20edd4=_0x20edd4-0x0;var _0xc4a1e4=_0xb10b[_0x20edd4];return _0xc4a1e4;};'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});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);function respondWithRpcPromise(_0x229887,_0xa3adc8,_0x5ab04a){return new BPromise(function(_0x4e47f8,_0x20bd61){return client[_0xbb10('0x10')](_0x229887,_0x5ab04a)[_0xbb10('0x11')](function(_0x5e136d){logger[_0xbb10('0x12')]('MailMessage,\x20%s,\x20%s',_0xa3adc8,_0xbb10('0x13'));logger[_0xbb10('0x14')](_0xbb10('0x15'),_0xa3adc8,_0xbb10('0x13'),JSON[_0xbb10('0x16')](_0x5e136d));if(_0x5e136d[_0xbb10('0x17')]){if(_0x5e136d['error'][_0xbb10('0x18')]===0x1f4){logger[_0xbb10('0x17')](_0xbb10('0x19'),_0xa3adc8,_0x5e136d[_0xbb10('0x17')][_0xbb10('0x1a')]);return _0x20bd61(_0x5e136d[_0xbb10('0x17')][_0xbb10('0x1a')]);}logger[_0xbb10('0x17')](_0xbb10('0x19'),_0xa3adc8,_0x5e136d[_0xbb10('0x17')]['message']);return _0x4e47f8(_0x5e136d[_0xbb10('0x17')][_0xbb10('0x1a')]);}else{logger[_0xbb10('0x12')](_0xbb10('0x19'),_0xa3adc8,_0xbb10('0x13'));_0x4e47f8(_0x5e136d[_0xbb10('0x1b')][_0xbb10('0x1a')]);}})[_0xbb10('0x1c')](function(_0xbf2906){logger[_0xbb10('0x17')]('MailMessage,\x20%s,\x20%s',_0xa3adc8,_0xbf2906);_0x20bd61(_0xbf2906);});});}exports[_0xbb10('0x1d')]=function(_0x19f48d){var _0x388fab=this;return new Promise(function(_0x109908,_0xdf237d){return db[_0xbb10('0x1e')]['create'](_0x19f48d[_0xbb10('0x1f')],{'raw':_0x19f48d[_0xbb10('0x20')]?_0x19f48d['options']['raw']===undefined?!![]:![]:!![]})[_0xbb10('0x11')](function(_0x311abe){logger[_0xbb10('0x12')](_0xbb10('0x1d'),_0x19f48d);logger[_0xbb10('0x14')](_0xbb10('0x1d'),_0x19f48d,JSON[_0xbb10('0x16')](_0x311abe));_0x109908(_0x311abe);})[_0xbb10('0x1c')](function(_0x7f2377){logger[_0xbb10('0x17')](_0xbb10('0x1d'),_0x7f2377[_0xbb10('0x1a')],_0x19f48d);_0xdf237d(_0x388fab['error'](0x1f4,_0x7f2377['message']));});});}; \ No newline at end of file +var _0x32b6=['raw','CreateMailMessage','stringify','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','body','options'];(function(_0x5ce3c8,_0x2503bd){var _0xa76867=function(_0x52815e){while(--_0x52815e){_0x5ce3c8['push'](_0x5ce3c8['shift']());}};_0xa76867(++_0x2503bd);}(_0x32b6,0x1d1));var _0x632b=function(_0x47c6f7,_0x557aad){_0x47c6f7=_0x47c6f7-0x0;var _0x3a3845=_0x32b6[_0x47c6f7];return _0x3a3845;};'use strict';var _=require(_0x632b('0x0'));var util=require(_0x632b('0x1'));var moment=require('moment');var BPromise=require(_0x632b('0x2'));var rs=require(_0x632b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x632b('0x4'));var logger=require(_0x632b('0x5'))(_0x632b('0x6'));var config=require(_0x632b('0x7'));var jayson=require(_0x632b('0x8'));var client=jayson[_0x632b('0x9')][_0x632b('0xa')]({'port':0x232a});config[_0x632b('0xb')]=_[_0x632b('0xc')](config[_0x632b('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x632b('0xd'))(new Redis(config[_0x632b('0xb')]));require(_0x632b('0xe'))[_0x632b('0xf')](socket);function respondWithRpcPromise(_0x4961b1,_0x5904e8,_0x56e7b6){return new BPromise(function(_0x3ce569,_0x484b3a){return client[_0x632b('0x10')](_0x4961b1,_0x56e7b6)[_0x632b('0x11')](function(_0x2eca51){logger[_0x632b('0x12')](_0x632b('0x13'),_0x5904e8,_0x632b('0x14'));logger[_0x632b('0x15')](_0x632b('0x16'),_0x5904e8,_0x632b('0x14'),JSON['stringify'](_0x2eca51));if(_0x2eca51[_0x632b('0x17')]){if(_0x2eca51[_0x632b('0x17')][_0x632b('0x18')]===0x1f4){logger['error'](_0x632b('0x13'),_0x5904e8,_0x2eca51[_0x632b('0x17')][_0x632b('0x19')]);return _0x484b3a(_0x2eca51[_0x632b('0x17')][_0x632b('0x19')]);}logger[_0x632b('0x17')]('MailMessage,\x20%s,\x20%s',_0x5904e8,_0x2eca51[_0x632b('0x17')]['message']);return _0x3ce569(_0x2eca51['error'][_0x632b('0x19')]);}else{logger['info'](_0x632b('0x13'),_0x5904e8,_0x632b('0x14'));_0x3ce569(_0x2eca51[_0x632b('0x1a')]['message']);}})[_0x632b('0x1b')](function(_0x32ca1){logger[_0x632b('0x17')](_0x632b('0x13'),_0x5904e8,_0x32ca1);_0x484b3a(_0x32ca1);});});}exports['CreateMailMessage']=function(_0x472e34){var _0xd9d29f=this;return new Promise(function(_0x4f377f,_0x116f62){return db['MailMessage']['create'](_0x472e34[_0x632b('0x1c')],{'raw':_0x472e34['options']?_0x472e34[_0x632b('0x1d')][_0x632b('0x1e')]===undefined?!![]:![]:!![]})[_0x632b('0x11')](function(_0x540bfb){logger[_0x632b('0x12')](_0x632b('0x1f'),_0x472e34);logger['debug'](_0x632b('0x1f'),_0x472e34,JSON[_0x632b('0x20')](_0x540bfb));_0x4f377f(_0x540bfb);})[_0x632b('0x1b')](function(_0x1e448c){logger[_0x632b('0x17')](_0x632b('0x1f'),_0x1e448c['message'],_0x472e34);_0x116f62(_0xd9d29f['error'](0x1f4,_0x1e448c[_0x632b('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 04625b8..edd5064 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 _0xa43d=['remove','update','removeListener','register','length','mailMessage:','save'];(function(_0x51cad9,_0x110e59){var _0x132691=function(_0x193190){while(--_0x193190){_0x51cad9['push'](_0x51cad9['shift']());}};_0x132691(++_0x110e59);}(_0xa43d,0x172));var _0xda43=function(_0x2404ab,_0x1008c2){_0x2404ab=_0x2404ab-0x0;var _0x5edff9=_0xa43d[_0x2404ab];return _0x5edff9;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=[_0xda43('0x0'),_0xda43('0x1'),_0xda43('0x2')];function createListener(_0x4a8780,_0x56fb7d){return function(_0x2435e7){_0x56fb7d['emit'](_0x4a8780,_0x2435e7);};}function removeListener(_0x3d583a,_0x492d51){return function(){MailMessageEvents[_0xda43('0x3')](_0x3d583a,_0x492d51);};}exports[_0xda43('0x4')]=function(_0x3f188b){for(var _0x16a8ed=0x0,_0x3febdc=events[_0xda43('0x5')];_0x16a8ed<_0x3febdc;_0x16a8ed++){var _0x3071da=events[_0x16a8ed];var _0x568b61=createListener(_0xda43('0x6')+_0x3071da,_0x3f188b);MailMessageEvents['on'](_0x3071da,_0x568b61);}}; \ No newline at end of file +var _0xd293=['length','mailMessage:','./mailMessage.events','removeListener'];(function(_0x4be6b9,_0x2871c5){var _0x3a2870=function(_0xaa3114){while(--_0xaa3114){_0x4be6b9['push'](_0x4be6b9['shift']());}};_0x3a2870(++_0x2871c5);}(_0xd293,0x10e));var _0x3d29=function(_0x40ee81,_0x118f7d){_0x40ee81=_0x40ee81-0x0;var _0x8d81b2=_0xd293[_0x40ee81];return _0x8d81b2;};'use strict';var MailMessageEvents=require(_0x3d29('0x0'));var events=['save','remove','update'];function createListener(_0x2541e5,_0x17354d){return function(_0x15063b){_0x17354d['emit'](_0x2541e5,_0x15063b);};}function removeListener(_0x13fe0d,_0x2df6a9){return function(){MailMessageEvents[_0x3d29('0x1')](_0x13fe0d,_0x2df6a9);};}exports['register']=function(_0x2a9239){for(var _0x55fdc2=0x0,_0x47538a=events[_0x3d29('0x2')];_0x55fdc2<_0x47538a;_0x55fdc2++){var _0x36dd09=events[_0x55fdc2];var _0x1d1d36=createListener(_0x3d29('0x3')+_0x36dd09,_0x2a9239);MailMessageEvents['on'](_0x36dd09,_0x1d1d36);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index f7d29f2..39b4a32 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 _0xdb7e=['/:id','destroy','removeAgents','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./mailQueue.controller','get','index','/describe','describe','isAuthenticated','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','addAgents','put','update','delete'];(function(_0x5f4db8,_0xd07888){var _0x1430e9=function(_0x136aba){while(--_0x136aba){_0x5f4db8['push'](_0x5f4db8['shift']());}};_0x1430e9(++_0xd07888);}(_0xdb7e,0x1d4));var _0xedb7=function(_0x48d835,_0x12734){_0x48d835=_0x48d835-0x0;var _0x519f4f=_0xdb7e[_0x48d835];return _0x519f4f;};'use strict';var multer=require(_0xedb7('0x0'));var util=require(_0xedb7('0x1'));var path=require(_0xedb7('0x2'));var timeout=require(_0xedb7('0x3'));var express=require(_0xedb7('0x4'));var router=express['Router']();var fs_extra=require(_0xedb7('0x5'));var auth=require(_0xedb7('0x6'));var interaction=require(_0xedb7('0x7'));var config=require('../../config/environment');var controller=require(_0xedb7('0x8'));router[_0xedb7('0x9')]('/',auth['isAuthenticated'](),controller[_0xedb7('0xa')]);router[_0xedb7('0x9')](_0xedb7('0xb'),auth['isAuthenticated'](),controller[_0xedb7('0xc')]);router[_0xedb7('0x9')]('/:id',auth[_0xedb7('0xd')](),controller[_0xedb7('0xe')]);router['get'](_0xedb7('0xf'),auth[_0xedb7('0xd')](),controller[_0xedb7('0x10')]);router[_0xedb7('0x9')](_0xedb7('0x11'),auth[_0xedb7('0xd')](),controller[_0xedb7('0x12')]);router['get'](_0xedb7('0x13'),auth[_0xedb7('0xd')](),controller['getAgents']);router[_0xedb7('0x14')]('/',auth[_0xedb7('0xd')](),controller['create']);router[_0xedb7('0x14')](_0xedb7('0x11'),auth[_0xedb7('0xd')](),controller['addTeams']);router[_0xedb7('0x14')](_0xedb7('0x13'),auth['isAuthenticated'](),controller[_0xedb7('0x15')]);router[_0xedb7('0x16')]('/:id',auth[_0xedb7('0xd')](),controller[_0xedb7('0x17')]);router[_0xedb7('0x18')](_0xedb7('0x19'),auth[_0xedb7('0xd')](),controller[_0xedb7('0x1a')]);router[_0xedb7('0x18')](_0xedb7('0x11'),auth[_0xedb7('0xd')](),controller['removeTeams']);router['delete'](_0xedb7('0x13'),auth[_0xedb7('0xd')](),controller[_0xedb7('0x1b')]);module[_0xedb7('0x1c')]=router; \ No newline at end of file +var _0xaedb=['./mailQueue.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getAgents','post','create','addTeams','/:id/users','addAgents','delete','removeAgents','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x233220,_0x4b9591){var _0x3747e8=function(_0x1905aa){while(--_0x1905aa){_0x233220['push'](_0x233220['shift']());}};_0x3747e8(++_0x4b9591);}(_0xaedb,0x107));var _0xbaed=function(_0x6629f5,_0x49adc5){_0x6629f5=_0x6629f5-0x0;var _0x1ba145=_0xaedb[_0x6629f5];return _0x1ba145;};'use strict';var multer=require('multer');var util=require(_0xbaed('0x0'));var path=require(_0xbaed('0x1'));var timeout=require('connect-timeout');var express=require(_0xbaed('0x2'));var router=express[_0xbaed('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbaed('0x4'));var interaction=require(_0xbaed('0x5'));var config=require(_0xbaed('0x6'));var controller=require(_0xbaed('0x7'));router['get']('/',auth[_0xbaed('0x8')](),controller[_0xbaed('0x9')]);router[_0xbaed('0xa')](_0xbaed('0xb'),auth[_0xbaed('0x8')](),controller[_0xbaed('0xc')]);router[_0xbaed('0xa')](_0xbaed('0xd'),auth[_0xbaed('0x8')](),controller[_0xbaed('0xe')]);router[_0xbaed('0xa')](_0xbaed('0xf'),auth['isAuthenticated'](),controller[_0xbaed('0x10')]);router['get'](_0xbaed('0x11'),auth[_0xbaed('0x8')](),controller['getTeams']);router['get']('/:id/users',auth['isAuthenticated'](),controller[_0xbaed('0x12')]);router[_0xbaed('0x13')]('/',auth['isAuthenticated'](),controller[_0xbaed('0x14')]);router[_0xbaed('0x13')](_0xbaed('0x11'),auth[_0xbaed('0x8')](),controller[_0xbaed('0x15')]);router['post'](_0xbaed('0x16'),auth['isAuthenticated'](),controller[_0xbaed('0x17')]);router['put']('/:id',auth[_0xbaed('0x8')](),controller['update']);router['delete'](_0xbaed('0xd'),auth[_0xbaed('0x8')](),controller['destroy']);router[_0xbaed('0x18')]('/:id/teams',auth[_0xbaed('0x8')](),controller['removeTeams']);router['delete'](_0xbaed('0x16'),auth['isAuthenticated'](),controller[_0xbaed('0x19')]);module[_0xbaed('0x1a')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index ed76d1a..b296190 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 _0x843a=['exports','STRING','name','INTEGER','ENUM','rrmemory','roundrobin'];(function(_0x1551b4,_0x879665){var _0x40e499=function(_0x2e81b6){while(--_0x2e81b6){_0x1551b4['push'](_0x1551b4['shift']());}};_0x40e499(++_0x879665);}(_0x843a,0xd9));var _0xa843=function(_0x3973b7,_0x5bb5c4){_0x3973b7=_0x3973b7-0x0;var _0xcb5a3c=_0x843a[_0x3973b7];return _0xcb5a3c;};'use strict';var Sequelize=require('sequelize');module[_0xa843('0x0')]={'name':{'type':Sequelize[_0xa843('0x1')],'unique':_0xa843('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa843('0x1')]},'timeout':{'type':Sequelize[_0xa843('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa843('0x4')](_0xa843('0x5'),'beepall',_0xa843('0x6'))}}; \ No newline at end of file +var _0x016d=['name','ENUM','beepall','roundrobin','sequelize','STRING'];(function(_0x240347,_0x39ab4f){var _0x34dbf8=function(_0x185cd0){while(--_0x185cd0){_0x240347['push'](_0x240347['shift']());}};_0x34dbf8(++_0x39ab4f);}(_0x016d,0xa0));var _0xd016=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x016d[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xd016('0x0'));module['exports']={'name':{'type':Sequelize[_0xd016('0x1')],'unique':_0xd016('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xd016('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xd016('0x3')]('rrmemory',_0xd016('0x4'),_0xd016('0x5'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 4417179..f03550b 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 _0xd588=['get','MailQueues','UserProfileResource','then','end','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','fields','length','attributes','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','filter','options','MailQueue','include','rows','catch','show','intersection','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','getMembers','UserMailQueue','order','pick','MailQueueId','findAll','findAndCountAll','UserId','agent','mailPause','updatedAt','format','%s/%s','SIP','createdAt','getTeams','findOne','addTeams','ids','User','Agents','online','voicePause','interface','flatMap','each','findOrCreate','emit','userMailQueue:save','removeTeams','Team','select','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','push','toString','sequelize','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','forEach','userMailQueue:remove','addAgents','spread','removeAgents','isArray','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','./mailQueue.socket','register','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','destroy'];(function(_0x4947d7,_0x270f05){var _0x4b6e94=function(_0x469ae4){while(--_0x469ae4){_0x4947d7['push'](_0x4947d7['shift']());}};_0x4b6e94(++_0x270f05);}(_0xd588,0x195));var _0x8d58=function(_0x30d31e,_0x292e17){_0x30d31e=_0x30d31e-0x0;var _0x3ad2fe=_0xd588[_0x30d31e];return _0x3ad2fe;};'use strict';var emlformat=require(_0x8d58('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8d58('0x1'));var jsonpatch=require(_0x8d58('0x2'));var rp=require(_0x8d58('0x3'));var moment=require(_0x8d58('0x4'));var BPromise=require(_0x8d58('0x5'));var Mustache=require(_0x8d58('0x6'));var util=require(_0x8d58('0x7'));var path=require(_0x8d58('0x8'));var sox=require(_0x8d58('0x9'));var csv=require(_0x8d58('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8d58('0xb'));var crypto=require(_0x8d58('0xc'));var jsforce=require(_0x8d58('0xd'));var deskjs=require(_0x8d58('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8d58('0xf'));var Papa=require(_0x8d58('0x10'));var Redis=require(_0x8d58('0x11'));var authService=require(_0x8d58('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x8d58('0x13'));var hardwareService=require(_0x8d58('0x14'));var logger=require(_0x8d58('0x15'))(_0x8d58('0x16'));var utils=require(_0x8d58('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8d58('0x18'))['db'];config[_0x8d58('0x19')]=_['defaults'](config['redis'],{'host':_0x8d58('0x1a'),'port':0x18eb});var socket=require(_0x8d58('0x1b'))(new Redis(config[_0x8d58('0x19')]));require(_0x8d58('0x1c'))[_0x8d58('0x1d')](socket);function respondWithStatusCode(_0x1ae6c9,_0x5edd33){_0x5edd33=_0x5edd33||0xcc;return function(_0x278141){if(_0x278141){return _0x1ae6c9['sendStatus'](_0x5edd33);}return _0x1ae6c9['status'](_0x5edd33)['end']();};}function respondWithResult(_0x453711,_0xe274ad){_0xe274ad=_0xe274ad||0xc8;return function(_0x593fb6){if(_0x593fb6){return _0x453711['status'](_0xe274ad)[_0x8d58('0x1e')](_0x593fb6);}};}function respondWithFilteredResult(_0x54b83c,_0x3d4db2){return function(_0x58897f){if(_0x58897f){var _0x1176c0=typeof _0x3d4db2[_0x8d58('0x1f')]===_0x8d58('0x20')&&typeof _0x3d4db2[_0x8d58('0x21')]==='undefined';var _0xfc71fe=_0x58897f['count'];var _0x1e27f7=_0x1176c0?0x0:_0x3d4db2[_0x8d58('0x1f')];var _0x1ac3e3=_0x1176c0?_0x58897f[_0x8d58('0x22')]:_0x3d4db2[_0x8d58('0x1f')]+_0x3d4db2['limit'];var _0x570c4d;if(_0x1ac3e3>=_0xfc71fe){_0x1ac3e3=_0xfc71fe;_0x570c4d=0xc8;}else{_0x570c4d=0xce;}_0x54b83c[_0x8d58('0x23')](_0x570c4d);return _0x54b83c[_0x8d58('0x24')](_0x8d58('0x25'),_0x1e27f7+'-'+_0x1ac3e3+'/'+_0xfc71fe)[_0x8d58('0x1e')](_0x58897f);}return null;};}function patchUpdates(_0x586dfb){return function(_0x5cc330){try{jsonpatch[_0x8d58('0x26')](_0x5cc330,_0x586dfb,!![]);}catch(_0x5a1684){return BPromise[_0x8d58('0x27')](_0x5a1684);}return _0x5cc330[_0x8d58('0x28')]();};}function saveUpdates(_0x44fd3f,_0x44c49c){return function(_0x803db9){if(_0x803db9){return _0x803db9['update'](_0x44fd3f)['then'](function(_0x1cc19a){return _0x1cc19a;});}return null;};}function removeEntity(_0x4405e6,_0x1e2bc7){return function(_0x3afcc6){if(_0x3afcc6){return _0x3afcc6[_0x8d58('0x29')]()['then'](function(){var _0x434a6c=_0x3afcc6[_0x8d58('0x2a')]({'plain':!![]});var _0x47544f=_0x8d58('0x2b');return db[_0x8d58('0x2c')][_0x8d58('0x29')]({'where':{'type':_0x47544f,'resourceId':_0x434a6c['id']}})[_0x8d58('0x2d')](function(){return _0x3afcc6;});})['then'](function(){_0x4405e6[_0x8d58('0x23')](0xcc)[_0x8d58('0x2e')]();});}};}function handleEntityNotFound(_0x414b10,_0x2d8975){return function(_0x188d6a){if(!_0x188d6a){_0x414b10['sendStatus'](0x194);}return _0x188d6a;};}function handleError(_0x87eca2,_0x39b05b){_0x39b05b=_0x39b05b||0x1f4;return function(_0x3fdb03){logger[_0x8d58('0x2f')](_0x3fdb03[_0x8d58('0x30')]);if(_0x3fdb03['name']){delete _0x3fdb03[_0x8d58('0x31')];}_0x87eca2[_0x8d58('0x23')](_0x39b05b)['send'](_0x3fdb03);};}exports[_0x8d58('0x32')]=function(_0x4b1b55,_0x160f8f){var _0x42c63e={},_0xec154d={},_0x395a83={'count':0x0,'rows':[]};var _0x1e15eb=_[_0x8d58('0x33')](db['MailQueue'][_0x8d58('0x34')],function(_0x41e2a4){return{'name':_0x41e2a4[_0x8d58('0x35')],'type':_0x41e2a4[_0x8d58('0x36')][_0x8d58('0x37')]};});_0xec154d[_0x8d58('0x38')]=_['map'](_0x1e15eb,_0x8d58('0x31'));_0xec154d['query']=_[_0x8d58('0x39')](_0x4b1b55[_0x8d58('0x3a')]);_0xec154d[_0x8d58('0x3b')]=_['intersection'](_0xec154d['model'],_0xec154d[_0x8d58('0x3a')]);_0x42c63e['attributes']=_['intersection'](_0xec154d[_0x8d58('0x38')],qs[_0x8d58('0x3c')](_0x4b1b55[_0x8d58('0x3a')]['fields']));_0x42c63e['attributes']=_0x42c63e['attributes'][_0x8d58('0x3d')]?_0x42c63e[_0x8d58('0x3e')]:_0xec154d[_0x8d58('0x38')];if(!_0x4b1b55['query'][_0x8d58('0x3f')](_0x8d58('0x40'))){_0x42c63e[_0x8d58('0x21')]=qs['limit'](_0x4b1b55[_0x8d58('0x3a')]['limit']);_0x42c63e[_0x8d58('0x1f')]=qs[_0x8d58('0x1f')](_0x4b1b55[_0x8d58('0x3a')][_0x8d58('0x1f')]);}_0x42c63e['order']=qs[_0x8d58('0x41')](_0x4b1b55[_0x8d58('0x3a')][_0x8d58('0x41')]);_0x42c63e[_0x8d58('0x42')]=qs['filters'](_['pick'](_0x4b1b55[_0x8d58('0x3a')],_0xec154d[_0x8d58('0x3b')]),_0x1e15eb);if(_0x4b1b55[_0x8d58('0x3a')]['filter']){_0x42c63e[_0x8d58('0x42')]=_[_0x8d58('0x43')](_0x42c63e['where'],{'$or':_[_0x8d58('0x33')](_0x1e15eb,function(_0x538416){if(_0x538416['type']!==_0x8d58('0x44')){var _0x35cea0={};_0x35cea0[_0x538416['name']]={'$like':'%'+_0x4b1b55[_0x8d58('0x3a')][_0x8d58('0x45')]+'%'};return _0x35cea0;}})});}_0x42c63e=_[_0x8d58('0x43')]({},_0x42c63e,_0x4b1b55[_0x8d58('0x46')]);var _0x43b157={'where':_0x42c63e['where']};return db[_0x8d58('0x47')][_0x8d58('0x22')](_0x43b157)[_0x8d58('0x2d')](function(_0x4c4ba8){_0x395a83[_0x8d58('0x22')]=_0x4c4ba8;if(_0x4b1b55['query']['includeAll']){_0x42c63e[_0x8d58('0x48')]=[{'all':!![]}];}return db[_0x8d58('0x47')]['findAll'](_0x42c63e);})['then'](function(_0x45f606){_0x395a83[_0x8d58('0x49')]=_0x45f606;return _0x395a83;})['then'](respondWithFilteredResult(_0x160f8f,_0x42c63e))[_0x8d58('0x4a')](handleError(_0x160f8f,null));};exports[_0x8d58('0x4b')]=function(_0x3b0593,_0x2f23c2){var _0x196d16={'raw':!![],'where':{'id':_0x3b0593['params']['id']}},_0x50e7db={};_0x50e7db[_0x8d58('0x38')]=_[_0x8d58('0x39')](db[_0x8d58('0x47')][_0x8d58('0x34')]);_0x50e7db[_0x8d58('0x3a')]=_[_0x8d58('0x39')](_0x3b0593[_0x8d58('0x3a')]);_0x50e7db[_0x8d58('0x3b')]=_[_0x8d58('0x4c')](_0x50e7db[_0x8d58('0x38')],_0x50e7db['query']);_0x196d16[_0x8d58('0x3e')]=_[_0x8d58('0x4c')](_0x50e7db[_0x8d58('0x38')],qs[_0x8d58('0x3c')](_0x3b0593['query']['fields']));_0x196d16['attributes']=_0x196d16[_0x8d58('0x3e')][_0x8d58('0x3d')]?_0x196d16[_0x8d58('0x3e')]:_0x50e7db['model'];if(_0x3b0593[_0x8d58('0x3a')][_0x8d58('0x4d')]){_0x196d16[_0x8d58('0x48')]=[{'all':!![]}];}_0x196d16=_[_0x8d58('0x43')]({},_0x196d16,_0x3b0593[_0x8d58('0x46')]);return db[_0x8d58('0x47')][_0x8d58('0x4e')](_0x196d16)['then'](handleEntityNotFound(_0x2f23c2,null))[_0x8d58('0x2d')](respondWithResult(_0x2f23c2,null))['catch'](handleError(_0x2f23c2,null));};exports[_0x8d58('0x4f')]=function(_0x46b1f5,_0x53fd95){return db['MailQueue'][_0x8d58('0x4f')](_0x46b1f5[_0x8d58('0x50')],{})[_0x8d58('0x2d')](function(_0x444b24){var _0x5c371f=_0x46b1f5[_0x8d58('0x51')][_0x8d58('0x2a')]({'plain':!![]});if(!_0x5c371f)throw new Error(_0x8d58('0x52'));if(_0x5c371f[_0x8d58('0x53')]==='user'){var _0x10f541=_0x444b24[_0x8d58('0x2a')]({'plain':!![]});var _0x2e6ef4=_0x8d58('0x2b');return db[_0x8d58('0x54')][_0x8d58('0x4e')]({'where':{'name':_0x2e6ef4,'userProfileId':_0x5c371f['userProfileId']},'raw':!![]})[_0x8d58('0x2d')](function(_0x27772a){if(_0x27772a&&_0x27772a[_0x8d58('0x55')]===0x0){return db[_0x8d58('0x2c')][_0x8d58('0x4f')]({'name':_0x10f541[_0x8d58('0x31')],'resourceId':_0x10f541['id'],'type':_0x27772a[_0x8d58('0x31')],'sectionId':_0x27772a['id']},{})['then'](function(){return _0x444b24;});}else{return _0x444b24;}})['catch'](function(_0x528d2a){logger[_0x8d58('0x2f')](_0x8d58('0x56'),_0x528d2a);throw _0x528d2a;});}return _0x444b24;})[_0x8d58('0x2d')](respondWithResult(_0x53fd95,0xc9))[_0x8d58('0x4a')](handleError(_0x53fd95,null));};exports[_0x8d58('0x57')]=function(_0x310141,_0x49734a){if(_0x310141[_0x8d58('0x50')]['id']){delete _0x310141[_0x8d58('0x50')]['id'];}return db['MailQueue'][_0x8d58('0x4e')]({'where':{'id':_0x310141['params']['id']}})[_0x8d58('0x2d')](handleEntityNotFound(_0x49734a,null))[_0x8d58('0x2d')](saveUpdates(_0x310141[_0x8d58('0x50')],null))[_0x8d58('0x2d')](respondWithResult(_0x49734a,null))[_0x8d58('0x4a')](handleError(_0x49734a,null));};exports[_0x8d58('0x29')]=function(_0x540b4f,_0xf690ce){return db[_0x8d58('0x47')][_0x8d58('0x4e')]({'where':{'id':_0x540b4f[_0x8d58('0x58')]['id']}})[_0x8d58('0x2d')](handleEntityNotFound(_0xf690ce,null))[_0x8d58('0x2d')](removeEntity(_0xf690ce,null))[_0x8d58('0x4a')](handleError(_0xf690ce,null));};exports[_0x8d58('0x59')]=function(_0x24e948,_0x3eba10){return db[_0x8d58('0x47')]['describe']()['then'](respondWithResult(_0x3eba10,null))[_0x8d58('0x4a')](handleError(_0x3eba10,null));};exports[_0x8d58('0x5a')]=function(_0x143abf,_0x3864b5,_0x3f1d8d){var _0x12d2c9={'raw':!![],'where':{}},_0xf71b97={},_0x108aeb;return db[_0x8d58('0x47')]['findOne']({'where':{'id':_0x143abf[_0x8d58('0x58')]['id']}})['then'](handleEntityNotFound(_0x3864b5,null))[_0x8d58('0x2d')](function(_0x4a741d){if(_0x4a741d){_0x108aeb=_0x4a741d[_0x8d58('0x2a')]({'plain':!![]});_0xf71b97[_0x8d58('0x38')]=_[_0x8d58('0x39')](db[_0x8d58('0x5b')]['rawAttributes']);_0xf71b97[_0x8d58('0x3a')]=_['keys'](_0x143abf[_0x8d58('0x3a')]);_0xf71b97['filters']=_[_0x8d58('0x4c')](_0xf71b97[_0x8d58('0x38')],_0xf71b97[_0x8d58('0x3a')]);_0x12d2c9[_0x8d58('0x3e')]=_[_0x8d58('0x4c')](_0xf71b97['model'],qs[_0x8d58('0x3c')](_0x143abf[_0x8d58('0x3a')][_0x8d58('0x3c')]));_0x12d2c9[_0x8d58('0x3e')]=_0x12d2c9[_0x8d58('0x3e')][_0x8d58('0x3d')]?_0x12d2c9['attributes']:_0xf71b97[_0x8d58('0x38')];if(!_0x143abf[_0x8d58('0x3a')][_0x8d58('0x3f')]('nolimit')){_0x12d2c9['limit']=qs[_0x8d58('0x21')](_0x143abf[_0x8d58('0x3a')][_0x8d58('0x21')]);_0x12d2c9['offset']=qs[_0x8d58('0x1f')](_0x143abf[_0x8d58('0x3a')][_0x8d58('0x1f')]);}_0x12d2c9[_0x8d58('0x5c')]=qs[_0x8d58('0x41')](_0x143abf['query'][_0x8d58('0x41')]);_0x12d2c9['where']=qs['filters'](_[_0x8d58('0x5d')](_0x143abf[_0x8d58('0x3a')],_0xf71b97[_0x8d58('0x3b')]));_0x12d2c9[_0x8d58('0x42')][_0x8d58('0x5e')]=_0x4a741d['id'];if(_0x143abf['query']['filter']){_0x12d2c9[_0x8d58('0x42')]=_[_0x8d58('0x43')](_0x12d2c9['where'],{'$or':_[_0x8d58('0x33')](_0x12d2c9[_0x8d58('0x3e')],function(_0x1cc9e8){var _0x34e052={};_0x34e052[_0x1cc9e8]={'$like':'%'+_0x143abf[_0x8d58('0x3a')][_0x8d58('0x45')]+'%'};return _0x34e052;})});}_0x12d2c9=_[_0x8d58('0x43')]({},_0x12d2c9,_0x143abf[_0x8d58('0x46')]);return db[_0x8d58('0x5b')][_0x8d58('0x5f')](_0x12d2c9);}})[_0x8d58('0x2d')](function(_0x434a42){if(_0x434a42){return db['User'][_0x8d58('0x60')]({'where':{'id':_['map'](_0x434a42,_0x8d58('0x61')),'role':_0x8d58('0x62')},'attributes':['id','name',_0x8d58('0x63'),_0x8d58('0x64'),'createdAt']});}})[_0x8d58('0x2d')](function(_0x2117c2){if(_0x2117c2){return{'count':_0x2117c2[_0x8d58('0x22')],'rows':_[_0x8d58('0x33')](_0x2117c2[_0x8d58('0x49')],function(_0x29c496){return{'membername':_0x29c496[_0x8d58('0x31')],'UserId':_0x29c496['id'],'queue_name':_0x108aeb[_0x8d58('0x31')],'MailQueueId':_0x108aeb['id'],'interface':util[_0x8d58('0x65')](_0x8d58('0x66'),_0x8d58('0x67'),_0x29c496[_0x8d58('0x31')]),'penalty':0x0,'paused':_0x29c496['mailPause'],'createdAt':_0x29c496[_0x8d58('0x68')],'updatedAt':_0x29c496[_0x8d58('0x64')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x8d58('0x2d')](respondWithFilteredResult(_0x3864b5,_0x12d2c9))[_0x8d58('0x4a')](handleError(_0x3864b5,null));};exports[_0x8d58('0x69')]=function(_0x2aabcb,_0x47f519,_0x20689c){var _0x810907={};var _0x549702={};var _0xa44fcd;var _0x186bb3;return db[_0x8d58('0x47')][_0x8d58('0x6a')]({'where':{'id':_0x2aabcb['params']['id']}})[_0x8d58('0x2d')](handleEntityNotFound(_0x47f519,null))[_0x8d58('0x2d')](function(_0xd80c39){if(_0xd80c39){_0xa44fcd=_0xd80c39;_0x549702[_0x8d58('0x38')]=_[_0x8d58('0x39')](db['Team']['rawAttributes']);_0x549702[_0x8d58('0x3a')]=_[_0x8d58('0x39')](_0x2aabcb[_0x8d58('0x3a')]);_0x549702['filters']=_[_0x8d58('0x4c')](_0x549702[_0x8d58('0x38')],_0x549702[_0x8d58('0x3a')]);_0x810907[_0x8d58('0x3e')]=_[_0x8d58('0x4c')](_0x549702[_0x8d58('0x38')],qs[_0x8d58('0x3c')](_0x2aabcb[_0x8d58('0x3a')][_0x8d58('0x3c')]));_0x810907[_0x8d58('0x3e')]=_0x810907[_0x8d58('0x3e')][_0x8d58('0x3d')]?_0x810907[_0x8d58('0x3e')]:_0x549702[_0x8d58('0x38')];_0x810907[_0x8d58('0x5c')]=qs['sort'](_0x2aabcb['query']['sort']);_0x810907[_0x8d58('0x42')]=qs[_0x8d58('0x3b')](_[_0x8d58('0x5d')](_0x2aabcb['query'],_0x549702[_0x8d58('0x3b')]));if(_0x2aabcb[_0x8d58('0x3a')][_0x8d58('0x45')]){_0x810907['where']=_['merge'](_0x810907[_0x8d58('0x42')],{'$or':_[_0x8d58('0x33')](_0x810907[_0x8d58('0x3e')],function(_0x55a369){var _0x114a87={};_0x114a87[_0x55a369]={'$like':'%'+_0x2aabcb[_0x8d58('0x3a')][_0x8d58('0x45')]+'%'};return _0x114a87;})});}_0x810907=_[_0x8d58('0x43')]({},_0x810907,_0x2aabcb[_0x8d58('0x46')]);return _0xa44fcd['getTeams'](_0x810907);}})['then'](function(_0x25f4d1){if(_0x25f4d1){_0x186bb3=_0x25f4d1['length'];if(!_0x2aabcb[_0x8d58('0x3a')][_0x8d58('0x3f')]('nolimit')){_0x810907[_0x8d58('0x21')]=qs['limit'](_0x2aabcb[_0x8d58('0x3a')][_0x8d58('0x21')]);_0x810907[_0x8d58('0x1f')]=qs[_0x8d58('0x1f')](_0x2aabcb['query'][_0x8d58('0x1f')]);}return _0xa44fcd[_0x8d58('0x69')](_0x810907);}})[_0x8d58('0x2d')](function(_0x49da17){if(_0x49da17){return _0x49da17?{'count':_0x186bb3,'rows':_0x49da17}:null;}})[_0x8d58('0x2d')](respondWithResult(_0x47f519,null))[_0x8d58('0x4a')](handleError(_0x47f519,null));};exports[_0x8d58('0x6b')]=function(_0x57d3cd,_0x2f01ba,_0x39f24b){var _0x41606b=_0x57d3cd['body'][_0x8d58('0x6c')];return db['Team'][_0x8d58('0x5f')]({'where':{'id':_0x41606b},'attributes':['id'],'include':[{'model':db[_0x8d58('0x6d')],'as':_0x8d58('0x6e'),'attributes':['id',_0x8d58('0x31'),_0x8d58('0x6f'),_0x8d58('0x70'),_0x8d58('0x71')],'raw':!![]}]})[_0x8d58('0x2d')](function(_0x102334){if(_0x102334){var _0x3f2996=_[_0x8d58('0x72')](_0x102334,function(_0x583bfa){var _0xd0170f=_0x583bfa[_0x8d58('0x2a')]({'plain':!![]});return _0xd0170f[_0x8d58('0x6e')];});return db['MailQueue'][_0x8d58('0x4e')]({'where':{'id':_0x57d3cd[_0x8d58('0x58')]['id']}})[_0x8d58('0x2d')](function(_0x40a304){return db['sequelize']['transaction'](function(_0xad3916){return _0x40a304[_0x8d58('0x6b')](_0x41606b,{'transaction':_0xad3916})[_0x8d58('0x2d')](function(){return BPromise[_0x8d58('0x73')](_0x3f2996,function(_0x26ddbb){return db['UserMailQueue'][_0x8d58('0x74')]({'where':{'UserId':_0x26ddbb['id'],'MailQueueId':_0x57d3cd[_0x8d58('0x58')]['id']},'transaction':_0xad3916});});})[_0x8d58('0x2d')](function(){_0x3f2996['forEach'](function(_0x3fcf35){socket[_0x8d58('0x75')](_0x8d58('0x76'),{'UserId':_0x3fcf35['id'],'MailQueueId':_0x40a304['id']});});});});});}})[_0x8d58('0x2d')](respondWithStatusCode(_0x2f01ba,null))['catch'](handleError(_0x2f01ba,null));};exports[_0x8d58('0x77')]=function(_0x1fbbf9,_0x547e78,_0x2dc34b){return db[_0x8d58('0x78')][_0x8d58('0x5f')]({'where':{'id':_0x1fbbf9[_0x8d58('0x3a')]['ids']},'attributes':['id'],'include':[{'model':db[_0x8d58('0x6d')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x8d58('0x2d')](handleEntityNotFound(_0x547e78,null))[_0x8d58('0x2d')](function(_0x5754ee){var _0x202228=_[_0x8d58('0x33')](_0x5754ee,'id');var _0x45174c=[];var _0x1dd264=[];var _0x101aff=squel[_0x8d58('0x79')]();_0x101aff['field'](_0x8d58('0x7a'))[_0x8d58('0x7b')](_0x8d58('0x7c'),'tq')[_0x8d58('0x7d')](_0x8d58('0x7e'),'ut',_0x8d58('0x7f'))[_0x8d58('0x42')]('MailQueueId\x20=\x20?',_0x1fbbf9[_0x8d58('0x58')]['id']);for(var _0x2dc2d9=0x0;_0x2dc2d9<_0x5754ee['length'];_0x2dc2d9+=0x1){let _0x3b7cfc=_0x5754ee[_0x2dc2d9];for(var _0x16ae2a=0x0;_0x16ae2a<_0x3b7cfc[_0x8d58('0x6e')][_0x8d58('0x3d')];_0x16ae2a+=0x1){let _0x45426c=_0x3b7cfc[_0x8d58('0x6e')][_0x16ae2a];var _0x4cd41e=_0x101aff[_0x8d58('0x80')]();_0x4cd41e[_0x8d58('0x42')]('ut.UserId\x20=\x20?',_0x45426c['id']);_0x1dd264[_0x8d58('0x81')](db['sequelize'][_0x8d58('0x3a')](_0x4cd41e[_0x8d58('0x82')](),{'type':db[_0x8d58('0x83')][_0x8d58('0x84')][_0x8d58('0x85')]})[_0x8d58('0x2d')](function(_0x14433b){if(_0x14433b[_0x8d58('0x3d')]===0x1){return _0x45426c['id'];}else{var _0x189ff6=_[_0x8d58('0x86')](_['map'](_0x14433b,_0x8d58('0x87')),function(_0x465248){return _[_0x8d58('0x88')](_0x202228,_0x465248);});if(_0x189ff6){return _0x45426c['id'];}}}));}}return BPromise[_0x8d58('0x89')](_0x1dd264)[_0x8d58('0x2d')](function(_0x241abd){_0x45174c=_(_0x45174c)[_0x8d58('0x8a')](_0x241abd)[_0x8d58('0x8b')]()[_0x8d58('0x8c')]();return db[_0x8d58('0x47')]['find']({'where':{'id':_0x1fbbf9[_0x8d58('0x58')]['id']}})['then'](function(_0x212f90){return db['sequelize']['transaction'](function(_0x5c1d83){return _0x212f90['removeTeams'](_0x1fbbf9['query'][_0x8d58('0x6c')],{'transaction':_0x5c1d83})[_0x8d58('0x2d')](function(){if(!_[_0x8d58('0x8d')](_0x45174c)){return _0x212f90['removeAgents'](_0x45174c,{'transaction':_0x5c1d83});}})[_0x8d58('0x2d')](function(){_0x45174c[_0x8d58('0x8e')](function(_0x3d88c1){socket[_0x8d58('0x75')](_0x8d58('0x8f'),{'UserId':_0x3d88c1,'MailQueueId':_0x212f90['id']});});});});});});})['then'](respondWithStatusCode(_0x547e78,null))[_0x8d58('0x4a')](handleError(_0x547e78,null));};exports[_0x8d58('0x90')]=function(_0x2fa761,_0x2b61ec,_0x240924){return db['MailQueue'][_0x8d58('0x4e')]({'where':{'id':_0x2fa761['params']['id']}})['then'](handleEntityNotFound(_0x2b61ec,null))[_0x8d58('0x2d')](function(_0x3c3b66){if(_0x3c3b66){return _0x3c3b66[_0x8d58('0x90')](_0x2fa761[_0x8d58('0x50')][_0x8d58('0x6c')],_['omit'](_0x2fa761[_0x8d58('0x50')],['ids','id'])||{})[_0x8d58('0x91')](function(_0x274c64){for(var _0x324b1e=0x0;_0x324b1e<_0x2fa761['body'][_0x8d58('0x6c')][_0x8d58('0x3d')];_0x324b1e+=0x1){socket[_0x8d58('0x75')](_0x8d58('0x76'),{'UserId':Number(_0x2fa761[_0x8d58('0x50')][_0x8d58('0x6c')][_0x324b1e]),'MailQueueId':Number(_0x2fa761['params']['id'])});}return _0x274c64;});}})[_0x8d58('0x2d')](respondWithResult(_0x2b61ec,null))[_0x8d58('0x4a')](handleError(_0x2b61ec,null));};exports[_0x8d58('0x92')]=function(_0x841583,_0x5efca1,_0x1ebce9){return db[_0x8d58('0x47')][_0x8d58('0x4e')]({'where':{'id':_0x841583[_0x8d58('0x58')]['id']}})[_0x8d58('0x2d')](handleEntityNotFound(_0x5efca1,null))[_0x8d58('0x2d')](function(_0xa59b05){if(_0xa59b05){return _0xa59b05[_0x8d58('0x92')](_0x841583[_0x8d58('0x3a')][_0x8d58('0x6c')])[_0x8d58('0x2d')](function(){if(_[_0x8d58('0x93')](_0x841583[_0x8d58('0x3a')][_0x8d58('0x6c')])){for(var _0x9e3779=0x0;_0x9e3779<_0x841583[_0x8d58('0x3a')][_0x8d58('0x6c')]['length'];_0x9e3779+=0x1){socket['emit'](_0x8d58('0x8f'),{'UserId':Number(_0x841583[_0x8d58('0x3a')][_0x8d58('0x6c')][_0x9e3779]),'MailQueueId':Number(_0x841583['params']['id'])});}}else{socket['emit'](_0x8d58('0x8f'),{'UserId':Number(_0x841583['query'][_0x8d58('0x6c')]),'MailQueueId':Number(_0x841583[_0x8d58('0x58')]['id'])});}});}})['then'](respondWithStatusCode(_0x5efca1,null))['catch'](handleError(_0x5efca1,null));};exports[_0x8d58('0x94')]=function(_0x25ac07,_0x555e4d,_0x114cd2){var _0x240360={};var _0x4569e5={};var _0x27bc45;var _0x1f4d80;return db[_0x8d58('0x47')][_0x8d58('0x6a')]({'where':{'id':_0x25ac07['params']['id']}})[_0x8d58('0x2d')](handleEntityNotFound(_0x555e4d,null))['then'](function(_0x167ac6){if(_0x167ac6){_0x27bc45=_0x167ac6;_0x4569e5[_0x8d58('0x38')]=_['keys'](db[_0x8d58('0x6d')][_0x8d58('0x34')]);_0x4569e5[_0x8d58('0x3a')]=_['keys'](_0x25ac07[_0x8d58('0x3a')]);_0x4569e5[_0x8d58('0x3b')]=_[_0x8d58('0x4c')](_0x4569e5[_0x8d58('0x38')],_0x4569e5[_0x8d58('0x3a')]);_0x240360[_0x8d58('0x3e')]=_['intersection'](_0x4569e5[_0x8d58('0x38')],qs['fields'](_0x25ac07[_0x8d58('0x3a')]['fields']));_0x240360[_0x8d58('0x3e')]=_0x240360[_0x8d58('0x3e')][_0x8d58('0x3d')]?_0x240360[_0x8d58('0x3e')]:_0x4569e5[_0x8d58('0x38')];_0x240360[_0x8d58('0x5c')]=qs['sort'](_0x25ac07['query'][_0x8d58('0x41')]);_0x240360['where']=qs[_0x8d58('0x3b')](_[_0x8d58('0x5d')](_0x25ac07[_0x8d58('0x3a')],_0x4569e5[_0x8d58('0x3b')]));if(_0x25ac07[_0x8d58('0x3a')][_0x8d58('0x45')]){_0x240360['where']=_[_0x8d58('0x43')](_0x240360[_0x8d58('0x42')],{'$or':_['map'](_0x240360[_0x8d58('0x3e')],function(_0x303153){var _0x4944ae={};_0x4944ae[_0x303153]={'$like':'%'+_0x25ac07[_0x8d58('0x3a')][_0x8d58('0x45')]+'%'};return _0x4944ae;})});}_0x240360=_[_0x8d58('0x43')]({},_0x240360,_0x25ac07[_0x8d58('0x46')]);return _0x27bc45[_0x8d58('0x94')](_0x240360);}})[_0x8d58('0x2d')](function(_0x25480f){if(_0x25480f){_0x1f4d80=_0x25480f['length'];if(!_0x25ac07[_0x8d58('0x3a')][_0x8d58('0x3f')](_0x8d58('0x40'))){_0x240360[_0x8d58('0x21')]=qs[_0x8d58('0x21')](_0x25ac07[_0x8d58('0x3a')][_0x8d58('0x21')]);_0x240360['offset']=qs[_0x8d58('0x1f')](_0x25ac07[_0x8d58('0x3a')][_0x8d58('0x1f')]);}return _0x27bc45[_0x8d58('0x94')](_0x240360);}})[_0x8d58('0x2d')](function(_0x4c2c47){if(_0x4c2c47){return _0x4c2c47?{'count':_0x1f4d80,'rows':_0x4c2c47}:null;}})[_0x8d58('0x2d')](respondWithResult(_0x555e4d,null))[_0x8d58('0x4a')](handleError(_0x555e4d,null));}; \ No newline at end of file +var _0xfaf3=['addAgents','spread','userMailQueue:save','isArray','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./mailQueue.socket','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','reject','update','then','MailQueues','UserProfileResource','error','name','send','map','MailQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','fields','attributes','order','sort','pick','filter','where','VIRTUAL','merge','options','include','findAll','catch','params','intersection','length','includeAll','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','describe','getMembers','hasOwnProperty','nolimit','MailQueueId','UserMailQueue','User','findAndCountAll','UserId','agent','mailPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','findOne','Team','addTeams','ids','Agents','online','voicePause','interface','sequelize','findOrCreate','forEach','select','field','tq.TeamId','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','toString','SELECT','every','includes','union','compact','value','removeTeams','isEmpty','removeAgents','emit','userMailQueue:remove'];(function(_0x3a429d,_0x5bc6a9){var _0x3adfa1=function(_0x543d91){while(--_0x543d91){_0x3a429d['push'](_0x3a429d['shift']());}};_0x3adfa1(++_0x5bc6a9);}(_0xfaf3,0x93));var _0x3faf=function(_0x39fbd4,_0x150283){_0x39fbd4=_0x39fbd4-0x0;var _0x343944=_0xfaf3[_0x39fbd4];return _0x343944;};'use strict';var emlformat=require(_0x3faf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3faf('0x1'));var jsonpatch=require(_0x3faf('0x2'));var rp=require(_0x3faf('0x3'));var moment=require(_0x3faf('0x4'));var BPromise=require(_0x3faf('0x5'));var Mustache=require(_0x3faf('0x6'));var util=require(_0x3faf('0x7'));var path=require(_0x3faf('0x8'));var sox=require(_0x3faf('0x9'));var csv=require(_0x3faf('0xa'));var ejs=require(_0x3faf('0xb'));var fs=require('fs');var fs_extra=require(_0x3faf('0xc'));var _=require(_0x3faf('0xd'));var squel=require(_0x3faf('0xe'));var crypto=require(_0x3faf('0xf'));var jsforce=require(_0x3faf('0x10'));var deskjs=require(_0x3faf('0x11'));var toCsv=require('to-csv');var querystring=require(_0x3faf('0x12'));var Papa=require(_0x3faf('0x13'));var Redis=require(_0x3faf('0x14'));var authService=require(_0x3faf('0x15'));var qs=require(_0x3faf('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3faf('0x17'));var logger=require(_0x3faf('0x18'))(_0x3faf('0x19'));var utils=require(_0x3faf('0x1a'));var config=require(_0x3faf('0x1b'));var licenseUtil=require(_0x3faf('0x1c'));var db=require(_0x3faf('0x1d'))['db'];config[_0x3faf('0x1e')]=_[_0x3faf('0x1f')](config['redis'],{'host':_0x3faf('0x20'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3faf('0x1e')]));require(_0x3faf('0x21'))['register'](socket);function respondWithStatusCode(_0x31995d,_0x4e34fe){_0x4e34fe=_0x4e34fe||0xcc;return function(_0x59fd15){if(_0x59fd15){return _0x31995d[_0x3faf('0x22')](_0x4e34fe);}return _0x31995d['status'](_0x4e34fe)['end']();};}function respondWithResult(_0x1a6d5e,_0x34894a){_0x34894a=_0x34894a||0xc8;return function(_0x8d80a2){if(_0x8d80a2){return _0x1a6d5e[_0x3faf('0x23')](_0x34894a)[_0x3faf('0x24')](_0x8d80a2);}};}function respondWithFilteredResult(_0xbdb00,_0x47795d){return function(_0x5568db){if(_0x5568db){var _0x3d311d=typeof _0x47795d[_0x3faf('0x25')]===_0x3faf('0x26')&&typeof _0x47795d['limit']===_0x3faf('0x26');var _0x29306c=_0x5568db[_0x3faf('0x27')];var _0x47d7a4=_0x3d311d?0x0:_0x47795d[_0x3faf('0x25')];var _0x2e382d=_0x3d311d?_0x5568db['count']:_0x47795d[_0x3faf('0x25')]+_0x47795d[_0x3faf('0x28')];var _0x15806a;if(_0x2e382d>=_0x29306c){_0x2e382d=_0x29306c;_0x15806a=0xc8;}else{_0x15806a=0xce;}_0xbdb00[_0x3faf('0x23')](_0x15806a);return _0xbdb00[_0x3faf('0x29')](_0x3faf('0x2a'),_0x47d7a4+'-'+_0x2e382d+'/'+_0x29306c)[_0x3faf('0x24')](_0x5568db);}return null;};}function patchUpdates(_0x44c73d){return function(_0x1d3728){try{jsonpatch['apply'](_0x1d3728,_0x44c73d,!![]);}catch(_0x7c968){return BPromise[_0x3faf('0x2b')](_0x7c968);}return _0x1d3728['save']();};}function saveUpdates(_0x1ba12b,_0x7071bd){return function(_0x44a47f){if(_0x44a47f){return _0x44a47f[_0x3faf('0x2c')](_0x1ba12b)[_0x3faf('0x2d')](function(_0x230aa9){return _0x230aa9;});}return null;};}function removeEntity(_0x1f7b8e,_0x5eff89){return function(_0x1c611a){if(_0x1c611a){return _0x1c611a['destroy']()[_0x3faf('0x2d')](function(){var _0x5f347e=_0x1c611a['get']({'plain':!![]});var _0x26c4ab=_0x3faf('0x2e');return db[_0x3faf('0x2f')]['destroy']({'where':{'type':_0x26c4ab,'resourceId':_0x5f347e['id']}})[_0x3faf('0x2d')](function(){return _0x1c611a;});})['then'](function(){_0x1f7b8e[_0x3faf('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24fe39,_0xcec611){return function(_0x43d660){if(!_0x43d660){_0x24fe39['sendStatus'](0x194);}return _0x43d660;};}function handleError(_0x3d112a,_0x37cd79){_0x37cd79=_0x37cd79||0x1f4;return function(_0x54587e){logger[_0x3faf('0x30')](_0x54587e['stack']);if(_0x54587e[_0x3faf('0x31')]){delete _0x54587e[_0x3faf('0x31')];}_0x3d112a[_0x3faf('0x23')](_0x37cd79)[_0x3faf('0x32')](_0x54587e);};}exports['index']=function(_0x21c1ce,_0x3fa177){var _0x5f54f8={},_0x226db5={},_0x38ab8e={'count':0x0,'rows':[]};var _0x1ec31d=_[_0x3faf('0x33')](db[_0x3faf('0x34')][_0x3faf('0x35')],function(_0x5bbb13){return{'name':_0x5bbb13[_0x3faf('0x36')],'type':_0x5bbb13[_0x3faf('0x37')][_0x3faf('0x38')]};});_0x226db5[_0x3faf('0x39')]=_['map'](_0x1ec31d,_0x3faf('0x31'));_0x226db5[_0x3faf('0x3a')]=_[_0x3faf('0x3b')](_0x21c1ce['query']);_0x226db5[_0x3faf('0x3c')]=_['intersection'](_0x226db5[_0x3faf('0x39')],_0x226db5[_0x3faf('0x3a')]);_0x5f54f8['attributes']=_['intersection'](_0x226db5[_0x3faf('0x39')],qs[_0x3faf('0x3d')](_0x21c1ce[_0x3faf('0x3a')]['fields']));_0x5f54f8['attributes']=_0x5f54f8['attributes']['length']?_0x5f54f8[_0x3faf('0x3e')]:_0x226db5[_0x3faf('0x39')];if(!_0x21c1ce[_0x3faf('0x3a')]['hasOwnProperty']('nolimit')){_0x5f54f8[_0x3faf('0x28')]=qs['limit'](_0x21c1ce[_0x3faf('0x3a')][_0x3faf('0x28')]);_0x5f54f8[_0x3faf('0x25')]=qs['offset'](_0x21c1ce['query']['offset']);}_0x5f54f8[_0x3faf('0x3f')]=qs[_0x3faf('0x40')](_0x21c1ce[_0x3faf('0x3a')]['sort']);_0x5f54f8['where']=qs[_0x3faf('0x3c')](_[_0x3faf('0x41')](_0x21c1ce['query'],_0x226db5[_0x3faf('0x3c')]),_0x1ec31d);if(_0x21c1ce[_0x3faf('0x3a')][_0x3faf('0x42')]){_0x5f54f8[_0x3faf('0x43')]=_['merge'](_0x5f54f8[_0x3faf('0x43')],{'$or':_[_0x3faf('0x33')](_0x1ec31d,function(_0x278012){if(_0x278012[_0x3faf('0x37')]!==_0x3faf('0x44')){var _0x26ed54={};_0x26ed54[_0x278012[_0x3faf('0x31')]]={'$like':'%'+_0x21c1ce[_0x3faf('0x3a')][_0x3faf('0x42')]+'%'};return _0x26ed54;}})});}_0x5f54f8=_[_0x3faf('0x45')]({},_0x5f54f8,_0x21c1ce[_0x3faf('0x46')]);var _0xe538e3={'where':_0x5f54f8['where']};return db[_0x3faf('0x34')][_0x3faf('0x27')](_0xe538e3)[_0x3faf('0x2d')](function(_0x1ec838){_0x38ab8e[_0x3faf('0x27')]=_0x1ec838;if(_0x21c1ce[_0x3faf('0x3a')]['includeAll']){_0x5f54f8[_0x3faf('0x47')]=[{'all':!![]}];}return db[_0x3faf('0x34')][_0x3faf('0x48')](_0x5f54f8);})[_0x3faf('0x2d')](function(_0x3ee414){_0x38ab8e['rows']=_0x3ee414;return _0x38ab8e;})[_0x3faf('0x2d')](respondWithFilteredResult(_0x3fa177,_0x5f54f8))[_0x3faf('0x49')](handleError(_0x3fa177,null));};exports['show']=function(_0x2d38c6,_0x558b55){var _0x3b59c7={'raw':!![],'where':{'id':_0x2d38c6[_0x3faf('0x4a')]['id']}},_0x4fb496={};_0x4fb496[_0x3faf('0x39')]=_[_0x3faf('0x3b')](db[_0x3faf('0x34')][_0x3faf('0x35')]);_0x4fb496[_0x3faf('0x3a')]=_['keys'](_0x2d38c6['query']);_0x4fb496[_0x3faf('0x3c')]=_['intersection'](_0x4fb496[_0x3faf('0x39')],_0x4fb496['query']);_0x3b59c7[_0x3faf('0x3e')]=_[_0x3faf('0x4b')](_0x4fb496[_0x3faf('0x39')],qs['fields'](_0x2d38c6[_0x3faf('0x3a')][_0x3faf('0x3d')]));_0x3b59c7[_0x3faf('0x3e')]=_0x3b59c7['attributes'][_0x3faf('0x4c')]?_0x3b59c7[_0x3faf('0x3e')]:_0x4fb496[_0x3faf('0x39')];if(_0x2d38c6[_0x3faf('0x3a')][_0x3faf('0x4d')]){_0x3b59c7[_0x3faf('0x47')]=[{'all':!![]}];}_0x3b59c7=_[_0x3faf('0x45')]({},_0x3b59c7,_0x2d38c6[_0x3faf('0x46')]);return db[_0x3faf('0x34')][_0x3faf('0x4e')](_0x3b59c7)[_0x3faf('0x2d')](handleEntityNotFound(_0x558b55,null))[_0x3faf('0x2d')](respondWithResult(_0x558b55,null))[_0x3faf('0x49')](handleError(_0x558b55,null));};exports[_0x3faf('0x4f')]=function(_0x58f292,_0x299fcf){return db[_0x3faf('0x34')][_0x3faf('0x4f')](_0x58f292[_0x3faf('0x50')],{})[_0x3faf('0x2d')](function(_0x5774d8){var _0x5a6b97=_0x58f292['user'][_0x3faf('0x51')]({'plain':!![]});if(!_0x5a6b97)throw new Error(_0x3faf('0x52'));if(_0x5a6b97[_0x3faf('0x53')]===_0x3faf('0x54')){var _0x159029=_0x5774d8['get']({'plain':!![]});var _0x510db3=_0x3faf('0x2e');return db[_0x3faf('0x55')][_0x3faf('0x4e')]({'where':{'name':_0x510db3,'userProfileId':_0x5a6b97[_0x3faf('0x56')]},'raw':!![]})['then'](function(_0x515c1d){if(_0x515c1d&&_0x515c1d[_0x3faf('0x57')]===0x0){return db[_0x3faf('0x2f')][_0x3faf('0x4f')]({'name':_0x159029[_0x3faf('0x31')],'resourceId':_0x159029['id'],'type':_0x515c1d[_0x3faf('0x31')],'sectionId':_0x515c1d['id']},{})['then'](function(){return _0x5774d8;});}else{return _0x5774d8;}})['catch'](function(_0xfdacd5){logger[_0x3faf('0x30')](_0x3faf('0x58'),_0xfdacd5);throw _0xfdacd5;});}return _0x5774d8;})['then'](respondWithResult(_0x299fcf,0xc9))[_0x3faf('0x49')](handleError(_0x299fcf,null));};exports[_0x3faf('0x2c')]=function(_0x5b7ec1,_0x4ce652){if(_0x5b7ec1['body']['id']){delete _0x5b7ec1[_0x3faf('0x50')]['id'];}return db[_0x3faf('0x34')][_0x3faf('0x4e')]({'where':{'id':_0x5b7ec1['params']['id']}})[_0x3faf('0x2d')](handleEntityNotFound(_0x4ce652,null))['then'](saveUpdates(_0x5b7ec1['body'],null))[_0x3faf('0x2d')](respondWithResult(_0x4ce652,null))['catch'](handleError(_0x4ce652,null));};exports[_0x3faf('0x59')]=function(_0x472db0,_0x2aedff){return db[_0x3faf('0x34')][_0x3faf('0x4e')]({'where':{'id':_0x472db0[_0x3faf('0x4a')]['id']}})[_0x3faf('0x2d')](handleEntityNotFound(_0x2aedff,null))['then'](removeEntity(_0x2aedff,null))[_0x3faf('0x49')](handleError(_0x2aedff,null));};exports[_0x3faf('0x5a')]=function(_0x10bebb,_0x587aa3){return db['MailQueue'][_0x3faf('0x5a')]()[_0x3faf('0x2d')](respondWithResult(_0x587aa3,null))['catch'](handleError(_0x587aa3,null));};exports[_0x3faf('0x5b')]=function(_0x4dd929,_0x12ff00,_0x315a44){var _0x265f90={'raw':!![],'where':{}},_0x159376={},_0x1189c4;return db[_0x3faf('0x34')]['findOne']({'where':{'id':_0x4dd929[_0x3faf('0x4a')]['id']}})[_0x3faf('0x2d')](handleEntityNotFound(_0x12ff00,null))[_0x3faf('0x2d')](function(_0x14be21){if(_0x14be21){_0x1189c4=_0x14be21[_0x3faf('0x51')]({'plain':!![]});_0x159376[_0x3faf('0x39')]=_[_0x3faf('0x3b')](db['UserMailQueue']['rawAttributes']);_0x159376[_0x3faf('0x3a')]=_[_0x3faf('0x3b')](_0x4dd929['query']);_0x159376[_0x3faf('0x3c')]=_[_0x3faf('0x4b')](_0x159376[_0x3faf('0x39')],_0x159376[_0x3faf('0x3a')]);_0x265f90[_0x3faf('0x3e')]=_[_0x3faf('0x4b')](_0x159376[_0x3faf('0x39')],qs[_0x3faf('0x3d')](_0x4dd929[_0x3faf('0x3a')][_0x3faf('0x3d')]));_0x265f90[_0x3faf('0x3e')]=_0x265f90['attributes']['length']?_0x265f90[_0x3faf('0x3e')]:_0x159376['model'];if(!_0x4dd929[_0x3faf('0x3a')][_0x3faf('0x5c')](_0x3faf('0x5d'))){_0x265f90['limit']=qs[_0x3faf('0x28')](_0x4dd929['query'][_0x3faf('0x28')]);_0x265f90[_0x3faf('0x25')]=qs[_0x3faf('0x25')](_0x4dd929[_0x3faf('0x3a')]['offset']);}_0x265f90[_0x3faf('0x3f')]=qs['sort'](_0x4dd929[_0x3faf('0x3a')]['sort']);_0x265f90[_0x3faf('0x43')]=qs[_0x3faf('0x3c')](_['pick'](_0x4dd929[_0x3faf('0x3a')],_0x159376[_0x3faf('0x3c')]));_0x265f90[_0x3faf('0x43')][_0x3faf('0x5e')]=_0x14be21['id'];if(_0x4dd929[_0x3faf('0x3a')][_0x3faf('0x42')]){_0x265f90['where']=_[_0x3faf('0x45')](_0x265f90[_0x3faf('0x43')],{'$or':_['map'](_0x265f90[_0x3faf('0x3e')],function(_0x1e567e){var _0x34c550={};_0x34c550[_0x1e567e]={'$like':'%'+_0x4dd929[_0x3faf('0x3a')]['filter']+'%'};return _0x34c550;})});}_0x265f90=_[_0x3faf('0x45')]({},_0x265f90,_0x4dd929[_0x3faf('0x46')]);return db[_0x3faf('0x5f')][_0x3faf('0x48')](_0x265f90);}})[_0x3faf('0x2d')](function(_0x43230f){if(_0x43230f){return db[_0x3faf('0x60')][_0x3faf('0x61')]({'where':{'id':_[_0x3faf('0x33')](_0x43230f,_0x3faf('0x62')),'role':_0x3faf('0x63')},'attributes':['id',_0x3faf('0x31'),_0x3faf('0x64'),_0x3faf('0x65'),_0x3faf('0x66')]});}})[_0x3faf('0x2d')](function(_0x58f55d){if(_0x58f55d){return{'count':_0x58f55d['count'],'rows':_[_0x3faf('0x33')](_0x58f55d['rows'],function(_0x8b2359){return{'membername':_0x8b2359['name'],'UserId':_0x8b2359['id'],'queue_name':_0x1189c4[_0x3faf('0x31')],'MailQueueId':_0x1189c4['id'],'interface':util[_0x3faf('0x67')](_0x3faf('0x68'),_0x3faf('0x69'),_0x8b2359['name']),'penalty':0x0,'paused':_0x8b2359[_0x3faf('0x64')],'createdAt':_0x8b2359['createdAt'],'updatedAt':_0x8b2359['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x3faf('0x2d')](respondWithFilteredResult(_0x12ff00,_0x265f90))[_0x3faf('0x49')](handleError(_0x12ff00,null));};exports[_0x3faf('0x6a')]=function(_0x1c175b,_0x9aa336,_0x6bb58b){var _0x15687e={};var _0x46a786={};var _0x2a9974;var _0x35b94d;return db[_0x3faf('0x34')][_0x3faf('0x6b')]({'where':{'id':_0x1c175b['params']['id']}})[_0x3faf('0x2d')](handleEntityNotFound(_0x9aa336,null))['then'](function(_0x4275ce){if(_0x4275ce){_0x2a9974=_0x4275ce;_0x46a786[_0x3faf('0x39')]=_['keys'](db[_0x3faf('0x6c')][_0x3faf('0x35')]);_0x46a786[_0x3faf('0x3a')]=_[_0x3faf('0x3b')](_0x1c175b[_0x3faf('0x3a')]);_0x46a786['filters']=_[_0x3faf('0x4b')](_0x46a786[_0x3faf('0x39')],_0x46a786[_0x3faf('0x3a')]);_0x15687e[_0x3faf('0x3e')]=_[_0x3faf('0x4b')](_0x46a786[_0x3faf('0x39')],qs['fields'](_0x1c175b['query'][_0x3faf('0x3d')]));_0x15687e['attributes']=_0x15687e[_0x3faf('0x3e')]['length']?_0x15687e['attributes']:_0x46a786['model'];_0x15687e['order']=qs[_0x3faf('0x40')](_0x1c175b[_0x3faf('0x3a')][_0x3faf('0x40')]);_0x15687e[_0x3faf('0x43')]=qs['filters'](_[_0x3faf('0x41')](_0x1c175b[_0x3faf('0x3a')],_0x46a786['filters']));if(_0x1c175b[_0x3faf('0x3a')][_0x3faf('0x42')]){_0x15687e[_0x3faf('0x43')]=_[_0x3faf('0x45')](_0x15687e[_0x3faf('0x43')],{'$or':_[_0x3faf('0x33')](_0x15687e[_0x3faf('0x3e')],function(_0x481423){var _0x401a6c={};_0x401a6c[_0x481423]={'$like':'%'+_0x1c175b[_0x3faf('0x3a')][_0x3faf('0x42')]+'%'};return _0x401a6c;})});}_0x15687e=_[_0x3faf('0x45')]({},_0x15687e,_0x1c175b[_0x3faf('0x46')]);return _0x2a9974[_0x3faf('0x6a')](_0x15687e);}})[_0x3faf('0x2d')](function(_0x399fa){if(_0x399fa){_0x35b94d=_0x399fa[_0x3faf('0x4c')];if(!_0x1c175b[_0x3faf('0x3a')][_0x3faf('0x5c')]('nolimit')){_0x15687e[_0x3faf('0x28')]=qs[_0x3faf('0x28')](_0x1c175b[_0x3faf('0x3a')]['limit']);_0x15687e[_0x3faf('0x25')]=qs[_0x3faf('0x25')](_0x1c175b[_0x3faf('0x3a')]['offset']);}return _0x2a9974[_0x3faf('0x6a')](_0x15687e);}})[_0x3faf('0x2d')](function(_0xdc28c4){if(_0xdc28c4){return _0xdc28c4?{'count':_0x35b94d,'rows':_0xdc28c4}:null;}})[_0x3faf('0x2d')](respondWithResult(_0x9aa336,null))[_0x3faf('0x49')](handleError(_0x9aa336,null));};exports[_0x3faf('0x6d')]=function(_0x4280a4,_0x1b8eda,_0x2548d0){var _0x2acc47=_0x4280a4[_0x3faf('0x50')][_0x3faf('0x6e')];return db[_0x3faf('0x6c')][_0x3faf('0x48')]({'where':{'id':_0x2acc47},'attributes':['id'],'include':[{'model':db['User'],'as':_0x3faf('0x6f'),'attributes':['id',_0x3faf('0x31'),_0x3faf('0x70'),_0x3faf('0x71'),_0x3faf('0x72')],'raw':!![]}]})[_0x3faf('0x2d')](function(_0x2a567f){if(_0x2a567f){var _0xef8e15=_['flatMap'](_0x2a567f,function(_0x1be8db){var _0x375ea3=_0x1be8db[_0x3faf('0x51')]({'plain':!![]});return _0x375ea3['Agents'];});return db[_0x3faf('0x34')]['find']({'where':{'id':_0x4280a4[_0x3faf('0x4a')]['id']}})[_0x3faf('0x2d')](function(_0x571f8f){return db[_0x3faf('0x73')]['transaction'](function(_0x5cbfcc){return _0x571f8f[_0x3faf('0x6d')](_0x2acc47,{'transaction':_0x5cbfcc})['then'](function(){return BPromise['each'](_0xef8e15,function(_0x18422c){return db[_0x3faf('0x5f')][_0x3faf('0x74')]({'where':{'UserId':_0x18422c['id'],'MailQueueId':_0x4280a4[_0x3faf('0x4a')]['id']},'transaction':_0x5cbfcc});});})[_0x3faf('0x2d')](function(){_0xef8e15[_0x3faf('0x75')](function(_0xb70e31){socket['emit']('userMailQueue:save',{'UserId':_0xb70e31['id'],'MailQueueId':_0x571f8f['id']});});});});});}})[_0x3faf('0x2d')](respondWithStatusCode(_0x1b8eda,null))[_0x3faf('0x49')](handleError(_0x1b8eda,null));};exports['removeTeams']=function(_0x419c1b,_0x273721,_0xcc8776){return db[_0x3faf('0x6c')][_0x3faf('0x48')]({'where':{'id':_0x419c1b[_0x3faf('0x3a')][_0x3faf('0x6e')]},'attributes':['id'],'include':[{'model':db[_0x3faf('0x60')],'as':_0x3faf('0x6f'),'attributes':['id'],'raw':!![]}]})[_0x3faf('0x2d')](handleEntityNotFound(_0x273721,null))[_0x3faf('0x2d')](function(_0x5e3ca3){var _0x10fe8e=_[_0x3faf('0x33')](_0x5e3ca3,'id');var _0x454aa6=[];var _0x1431e2=[];var _0x38ef20=squel[_0x3faf('0x76')]();_0x38ef20[_0x3faf('0x77')](_0x3faf('0x78'))['from']('team_has_mail_queues','tq')['join'](_0x3faf('0x79'),'ut',_0x3faf('0x7a'))[_0x3faf('0x43')]('MailQueueId\x20=\x20?',_0x419c1b[_0x3faf('0x4a')]['id']);for(var _0x47eb2c=0x0;_0x47eb2c<_0x5e3ca3[_0x3faf('0x4c')];_0x47eb2c+=0x1){let _0x3c8712=_0x5e3ca3[_0x47eb2c];for(var _0x407511=0x0;_0x407511<_0x3c8712['Agents']['length'];_0x407511+=0x1){let _0x330bc4=_0x3c8712[_0x3faf('0x6f')][_0x407511];var _0x16fb0e=_0x38ef20['clone']();_0x16fb0e[_0x3faf('0x43')](_0x3faf('0x7b'),_0x330bc4['id']);_0x1431e2[_0x3faf('0x7c')](db['sequelize'][_0x3faf('0x3a')](_0x16fb0e[_0x3faf('0x7d')](),{'type':db[_0x3faf('0x73')]['QueryTypes'][_0x3faf('0x7e')]})[_0x3faf('0x2d')](function(_0xa923cd){if(_0xa923cd['length']===0x1){return _0x330bc4['id'];}else{var _0x1bb381=_[_0x3faf('0x7f')](_[_0x3faf('0x33')](_0xa923cd,'TeamId'),function(_0x4daed2){return _[_0x3faf('0x80')](_0x10fe8e,_0x4daed2);});if(_0x1bb381){return _0x330bc4['id'];}}}));}}return BPromise['all'](_0x1431e2)[_0x3faf('0x2d')](function(_0x716e2a){_0x454aa6=_(_0x454aa6)[_0x3faf('0x81')](_0x716e2a)[_0x3faf('0x82')]()[_0x3faf('0x83')]();return db[_0x3faf('0x34')][_0x3faf('0x4e')]({'where':{'id':_0x419c1b[_0x3faf('0x4a')]['id']}})[_0x3faf('0x2d')](function(_0x9ede16){return db[_0x3faf('0x73')]['transaction'](function(_0x8d5ae2){return _0x9ede16[_0x3faf('0x84')](_0x419c1b['query'][_0x3faf('0x6e')],{'transaction':_0x8d5ae2})[_0x3faf('0x2d')](function(){if(!_[_0x3faf('0x85')](_0x454aa6)){return _0x9ede16[_0x3faf('0x86')](_0x454aa6,{'transaction':_0x8d5ae2});}})[_0x3faf('0x2d')](function(){_0x454aa6[_0x3faf('0x75')](function(_0x34fe6a){socket[_0x3faf('0x87')](_0x3faf('0x88'),{'UserId':_0x34fe6a,'MailQueueId':_0x9ede16['id']});});});});});});})['then'](respondWithStatusCode(_0x273721,null))[_0x3faf('0x49')](handleError(_0x273721,null));};exports[_0x3faf('0x89')]=function(_0x4a5d99,_0x51c92c,_0x7999e8){return db['MailQueue'][_0x3faf('0x4e')]({'where':{'id':_0x4a5d99[_0x3faf('0x4a')]['id']}})['then'](handleEntityNotFound(_0x51c92c,null))[_0x3faf('0x2d')](function(_0x53fb4e){if(_0x53fb4e){return _0x53fb4e[_0x3faf('0x89')](_0x4a5d99[_0x3faf('0x50')][_0x3faf('0x6e')],_['omit'](_0x4a5d99['body'],[_0x3faf('0x6e'),'id'])||{})[_0x3faf('0x8a')](function(_0x16d23c){for(var _0x30b3c0=0x0;_0x30b3c0<_0x4a5d99[_0x3faf('0x50')]['ids']['length'];_0x30b3c0+=0x1){socket['emit'](_0x3faf('0x8b'),{'UserId':Number(_0x4a5d99[_0x3faf('0x50')]['ids'][_0x30b3c0]),'MailQueueId':Number(_0x4a5d99[_0x3faf('0x4a')]['id'])});}return _0x16d23c;});}})[_0x3faf('0x2d')](respondWithResult(_0x51c92c,null))['catch'](handleError(_0x51c92c,null));};exports[_0x3faf('0x86')]=function(_0x3824ad,_0x2b66ac,_0x31d890){return db['MailQueue'][_0x3faf('0x4e')]({'where':{'id':_0x3824ad[_0x3faf('0x4a')]['id']}})[_0x3faf('0x2d')](handleEntityNotFound(_0x2b66ac,null))[_0x3faf('0x2d')](function(_0x433e7b){if(_0x433e7b){return _0x433e7b[_0x3faf('0x86')](_0x3824ad['query'][_0x3faf('0x6e')])[_0x3faf('0x2d')](function(){if(_[_0x3faf('0x8c')](_0x3824ad['query'][_0x3faf('0x6e')])){for(var _0xb0266d=0x0;_0xb0266d<_0x3824ad[_0x3faf('0x3a')]['ids'][_0x3faf('0x4c')];_0xb0266d+=0x1){socket['emit'](_0x3faf('0x88'),{'UserId':Number(_0x3824ad['query']['ids'][_0xb0266d]),'MailQueueId':Number(_0x3824ad[_0x3faf('0x4a')]['id'])});}}else{socket['emit'](_0x3faf('0x88'),{'UserId':Number(_0x3824ad[_0x3faf('0x3a')][_0x3faf('0x6e')]),'MailQueueId':Number(_0x3824ad[_0x3faf('0x4a')]['id'])});}});}})[_0x3faf('0x2d')](respondWithStatusCode(_0x2b66ac,null))[_0x3faf('0x49')](handleError(_0x2b66ac,null));};exports[_0x3faf('0x8d')]=function(_0x32a0f1,_0x4dad51,_0x2702f4){var _0x5069fa={};var _0x13364c={};var _0x74f76e;var _0x27f865;return db[_0x3faf('0x34')][_0x3faf('0x6b')]({'where':{'id':_0x32a0f1[_0x3faf('0x4a')]['id']}})[_0x3faf('0x2d')](handleEntityNotFound(_0x4dad51,null))[_0x3faf('0x2d')](function(_0x47f260){if(_0x47f260){_0x74f76e=_0x47f260;_0x13364c[_0x3faf('0x39')]=_['keys'](db[_0x3faf('0x60')][_0x3faf('0x35')]);_0x13364c['query']=_[_0x3faf('0x3b')](_0x32a0f1['query']);_0x13364c[_0x3faf('0x3c')]=_[_0x3faf('0x4b')](_0x13364c[_0x3faf('0x39')],_0x13364c['query']);_0x5069fa[_0x3faf('0x3e')]=_[_0x3faf('0x4b')](_0x13364c['model'],qs[_0x3faf('0x3d')](_0x32a0f1['query']['fields']));_0x5069fa[_0x3faf('0x3e')]=_0x5069fa[_0x3faf('0x3e')][_0x3faf('0x4c')]?_0x5069fa['attributes']:_0x13364c['model'];_0x5069fa[_0x3faf('0x3f')]=qs['sort'](_0x32a0f1[_0x3faf('0x3a')]['sort']);_0x5069fa['where']=qs[_0x3faf('0x3c')](_[_0x3faf('0x41')](_0x32a0f1[_0x3faf('0x3a')],_0x13364c['filters']));if(_0x32a0f1[_0x3faf('0x3a')]['filter']){_0x5069fa['where']=_[_0x3faf('0x45')](_0x5069fa[_0x3faf('0x43')],{'$or':_[_0x3faf('0x33')](_0x5069fa['attributes'],function(_0x3532d4){var _0x16efa5={};_0x16efa5[_0x3532d4]={'$like':'%'+_0x32a0f1[_0x3faf('0x3a')][_0x3faf('0x42')]+'%'};return _0x16efa5;})});}_0x5069fa=_[_0x3faf('0x45')]({},_0x5069fa,_0x32a0f1[_0x3faf('0x46')]);return _0x74f76e[_0x3faf('0x8d')](_0x5069fa);}})['then'](function(_0x5c8a48){if(_0x5c8a48){_0x27f865=_0x5c8a48[_0x3faf('0x4c')];if(!_0x32a0f1['query'][_0x3faf('0x5c')]('nolimit')){_0x5069fa['limit']=qs[_0x3faf('0x28')](_0x32a0f1[_0x3faf('0x3a')][_0x3faf('0x28')]);_0x5069fa[_0x3faf('0x25')]=qs[_0x3faf('0x25')](_0x32a0f1[_0x3faf('0x3a')]['offset']);}return _0x74f76e[_0x3faf('0x8d')](_0x5069fa);}})[_0x3faf('0x2d')](function(_0x11e0de){if(_0x11e0de){return _0x11e0de?{'count':_0x27f865,'rows':_0x11e0de}:null;}})['then'](respondWithResult(_0x4dad51,null))[_0x3faf('0x49')](handleError(_0x4dad51,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 6b7c9fd..89c8988 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 _0x9181=['events','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x2f3848,_0x48564d){var _0x102668=function(_0x5e32ab){while(--_0x5e32ab){_0x2f3848['push'](_0x2f3848['shift']());}};_0x102668(++_0x48564d);}(_0x9181,0x1f1));var _0x1918=function(_0x3fb12f,_0x57a82a){_0x3fb12f=_0x3fb12f-0x0;var _0x17d130=_0x9181[_0x3fb12f];return _0x17d130;};'use strict';var EventEmitter=require(_0x1918('0x0'));var MailQueue=require('../../mysqldb')['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x1918('0x1')](0x0);var events={'afterCreate':_0x1918('0x2'),'afterUpdate':_0x1918('0x3'),'afterDestroy':'remove'};function emitEvent(_0x258d5e){return function(_0x3bf794,_0x34a27d,_0x4a4d53){MailQueueEvents[_0x1918('0x4')](_0x258d5e+':'+_0x3bf794['id'],_0x3bf794);MailQueueEvents[_0x1918('0x4')](_0x258d5e,_0x3bf794);_0x4a4d53(null);};}for(var e in events){if(events[_0x1918('0x5')](e)){var event=events[e];MailQueue[_0x1918('0x6')](e,emitEvent(event));}}module['exports']=MailQueueEvents; \ No newline at end of file +var _0xe661=['save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x4c5696,_0x118bd3){var _0x35886d=function(_0x4fdcb7){while(--_0x4fdcb7){_0x4c5696['push'](_0x4c5696['shift']());}};_0x35886d(++_0x118bd3);}(_0xe661,0x166));var _0x1e66=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe661[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require(_0x1e66('0x0'));var MailQueue=require(_0x1e66('0x1'))['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1e66('0x2'),'afterUpdate':'update','afterDestroy':_0x1e66('0x3')};function emitEvent(_0x82c3b){return function(_0x1299a2,_0x2c24fe,_0x16b3d2){MailQueueEvents[_0x1e66('0x4')](_0x82c3b+':'+_0x1299a2['id'],_0x1299a2);MailQueueEvents[_0x1e66('0x4')](_0x82c3b,_0x1299a2);_0x16b3d2(null);};}for(var e in events){if(events[_0x1e66('0x5')](e)){var event=events[e];MailQueue[_0x1e66('0x6')](e,emitEvent(event));}}module[_0x1e66('0x7')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 1be482f..c75f8ac 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 _0x628d=['path','../../config/environment','./mailQueue.attributes','exports','define','MailQueue','mail_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x628d,0xe7));var _0xd628=function(_0x28b252,_0x4bae93){_0x28b252=_0x28b252-0x0;var _0x2fb34c=_0x628d[_0x28b252];return _0x2fb34c;};'use strict';var _=require(_0xd628('0x0'));var util=require(_0xd628('0x1'));var logger=require(_0xd628('0x2'))(_0xd628('0x3'));var moment=require(_0xd628('0x4'));var BPromise=require(_0xd628('0x5'));var rp=require(_0xd628('0x6'));var fs=require('fs');var path=require(_0xd628('0x7'));var rimraf=require('rimraf');var config=require(_0xd628('0x8'));var attributes=require(_0xd628('0x9'));module[_0xd628('0xa')]=function(_0x1402e9,_0x16b4c9){return _0x1402e9[_0xd628('0xb')](_0xd628('0xc'),attributes,{'tableName':_0xd628('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc0f9=['api','moment','bluebird','path','rimraf','../../config/environment','exports','define','MailQueue','util','../../config/logger'];(function(_0x5c5e5d,_0x36e7ac){var _0x3e47ad=function(_0x2f6feb){while(--_0x2f6feb){_0x5c5e5d['push'](_0x5c5e5d['shift']());}};_0x3e47ad(++_0x36e7ac);}(_0xc0f9,0x1ed));var _0x9c0f=function(_0x1b8f5a,_0x57c154){_0x1b8f5a=_0x1b8f5a-0x0;var _0x594189=_0xc0f9[_0x1b8f5a];return _0x594189;};'use strict';var _=require('lodash');var util=require(_0x9c0f('0x0'));var logger=require(_0x9c0f('0x1'))(_0x9c0f('0x2'));var moment=require(_0x9c0f('0x3'));var BPromise=require(_0x9c0f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9c0f('0x5'));var rimraf=require(_0x9c0f('0x6'));var config=require(_0x9c0f('0x7'));var attributes=require('./mailQueue.attributes');module[_0x9c0f('0x8')]=function(_0x35d5c2,_0xcb9da1){return _0x35d5c2[_0x9c0f('0x9')](_0x9c0f('0xa'),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 c926634..df02d17 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 _0x0fd1=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./mailQueue.socket','register','request','then','MailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MailQueue,\x20%s,\x20%s','message','info','result','catch','GetMailQueue','MailQueue','findAll','options','attributes','limit','include','map','model','debug','find','raw','where','ShowMailQueue','lodash','util'];(function(_0x1b925b,_0x1ab3c9){var _0x275f07=function(_0x2ffbe4){while(--_0x2ffbe4){_0x1b925b['push'](_0x1b925b['shift']());}};_0x275f07(++_0x1ab3c9);}(_0x0fd1,0x12b));var _0x10fd=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x0fd1[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x10fd('0x0'));var util=require(_0x10fd('0x1'));var moment=require(_0x10fd('0x2'));var BPromise=require('bluebird');var rs=require(_0x10fd('0x3'));var fs=require('fs');var Redis=require(_0x10fd('0x4'));var db=require(_0x10fd('0x5'))['db'];var utils=require(_0x10fd('0x6'));var logger=require(_0x10fd('0x7'))(_0x10fd('0x8'));var config=require(_0x10fd('0x9'));var jayson=require(_0x10fd('0xa'));var client=jayson['client'][_0x10fd('0xb')]({'port':0x232a});config[_0x10fd('0xc')]=_[_0x10fd('0xd')](config[_0x10fd('0xc')],{'host':_0x10fd('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x10fd('0xf'))[_0x10fd('0x10')](socket);function respondWithRpcPromise(_0x29ac15,_0x300601,_0x2ae208){return new BPromise(function(_0x53dfe3,_0x1b0fbf){return client[_0x10fd('0x11')](_0x29ac15,_0x2ae208)[_0x10fd('0x12')](function(_0x3cf82e){logger['info']('MailQueue,\x20%s,\x20%s',_0x300601,'request\x20sent');logger['debug'](_0x10fd('0x13'),_0x300601,_0x10fd('0x14'),JSON[_0x10fd('0x15')](_0x3cf82e));if(_0x3cf82e[_0x10fd('0x16')]){if(_0x3cf82e[_0x10fd('0x16')][_0x10fd('0x17')]===0x1f4){logger[_0x10fd('0x16')](_0x10fd('0x18'),_0x300601,_0x3cf82e[_0x10fd('0x16')]['message']);return _0x1b0fbf(_0x3cf82e[_0x10fd('0x16')]['message']);}logger[_0x10fd('0x16')](_0x10fd('0x18'),_0x300601,_0x3cf82e[_0x10fd('0x16')][_0x10fd('0x19')]);return _0x53dfe3(_0x3cf82e[_0x10fd('0x16')]['message']);}else{logger[_0x10fd('0x1a')](_0x10fd('0x18'),_0x300601,_0x10fd('0x14'));_0x53dfe3(_0x3cf82e[_0x10fd('0x1b')]['message']);}})[_0x10fd('0x1c')](function(_0x313dd2){logger[_0x10fd('0x16')]('MailQueue,\x20%s,\x20%s',_0x300601,_0x313dd2);_0x1b0fbf(_0x313dd2);});});}exports[_0x10fd('0x1d')]=function(_0x211cf6){var _0x1de1c5=this;return new Promise(function(_0x876e80,_0x3b49c1){return db[_0x10fd('0x1e')][_0x10fd('0x1f')]({'raw':_0x211cf6[_0x10fd('0x20')]?_0x211cf6[_0x10fd('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x211cf6[_0x10fd('0x20')]?_0x211cf6[_0x10fd('0x20')]['where']||null:null,'attributes':_0x211cf6[_0x10fd('0x20')]?_0x211cf6[_0x10fd('0x20')][_0x10fd('0x21')]||null:null,'limit':_0x211cf6[_0x10fd('0x20')]?_0x211cf6['options'][_0x10fd('0x22')]||null:null,'include':_0x211cf6[_0x10fd('0x20')]?_0x211cf6[_0x10fd('0x20')][_0x10fd('0x23')]?_['map'](_0x211cf6['options'][_0x10fd('0x23')],function(_0x58c823){return{'model':db[_0x58c823['model']],'as':_0x58c823['as'],'attributes':_0x58c823[_0x10fd('0x21')],'include':_0x58c823['include']?_[_0x10fd('0x24')](_0x58c823[_0x10fd('0x23')],function(_0xa1bc61){return{'model':db[_0xa1bc61['model']],'as':_0xa1bc61['as'],'attributes':_0xa1bc61[_0x10fd('0x21')],'include':_0xa1bc61[_0x10fd('0x23')]?_['map'](_0xa1bc61[_0x10fd('0x23')],function(_0x5a46bb){return{'model':db[_0x5a46bb[_0x10fd('0x25')]],'as':_0x5a46bb['as'],'attributes':_0x5a46bb[_0x10fd('0x21')]};}):[]};}):[]};}):[]:[]})[_0x10fd('0x12')](function(_0x4217f8){logger[_0x10fd('0x1a')]('GetMailQueue',_0x211cf6);logger[_0x10fd('0x26')](_0x10fd('0x1d'),_0x211cf6,JSON[_0x10fd('0x15')](_0x4217f8));_0x876e80(_0x4217f8);})[_0x10fd('0x1c')](function(_0x197d19){logger['error'](_0x10fd('0x1d'),_0x197d19[_0x10fd('0x19')],_0x211cf6);_0x3b49c1(_0x1de1c5[_0x10fd('0x16')](0x1f4,_0x197d19[_0x10fd('0x19')]));});});};exports['ShowMailQueue']=function(_0x5ace87){var _0x4118c8=this;return new Promise(function(_0x45720,_0x4b9ead){return db[_0x10fd('0x1e')][_0x10fd('0x27')]({'raw':_0x5ace87['options']?_0x5ace87['options'][_0x10fd('0x28')]===undefined?!![]:![]:!![],'where':_0x5ace87[_0x10fd('0x20')]?_0x5ace87[_0x10fd('0x20')][_0x10fd('0x29')]||null:null,'attributes':_0x5ace87[_0x10fd('0x20')]?_0x5ace87[_0x10fd('0x20')][_0x10fd('0x21')]||null:null,'include':_0x5ace87[_0x10fd('0x20')]?_0x5ace87[_0x10fd('0x20')][_0x10fd('0x23')]?_[_0x10fd('0x24')](_0x5ace87[_0x10fd('0x20')]['include'],function(_0x56bbc5){return{'model':db[_0x56bbc5[_0x10fd('0x25')]],'as':_0x56bbc5['as'],'attributes':_0x56bbc5[_0x10fd('0x21')],'include':_0x56bbc5[_0x10fd('0x23')]?_[_0x10fd('0x24')](_0x56bbc5[_0x10fd('0x23')],function(_0x1d7287){return{'model':db[_0x1d7287[_0x10fd('0x25')]],'as':_0x1d7287['as'],'attributes':_0x1d7287[_0x10fd('0x21')],'include':_0x1d7287[_0x10fd('0x23')]?_[_0x10fd('0x24')](_0x1d7287[_0x10fd('0x23')],function(_0x41ff53){return{'model':db[_0x41ff53[_0x10fd('0x25')]],'as':_0x41ff53['as'],'attributes':_0x41ff53[_0x10fd('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3a7bf8){logger[_0x10fd('0x1a')]('ShowMailQueue',_0x5ace87);logger[_0x10fd('0x26')](_0x10fd('0x2a'),_0x5ace87,JSON[_0x10fd('0x15')](_0x3a7bf8));_0x45720(_0x3a7bf8);})[_0x10fd('0x1c')](function(_0x3103cd){logger[_0x10fd('0x16')]('ShowMailQueue',_0x3103cd[_0x10fd('0x19')],_0x5ace87);_0x4b9ead(_0x4118c8[_0x10fd('0x16')](0x1f4,_0x3103cd[_0x10fd('0x19')]));});});}; \ No newline at end of file +var _0x1bf8=['request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','code','error','message','catch','GetMailQueue','MailQueue','options','raw','attributes','limit','include','map','model','stringify','ShowMailQueue','find','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','redis','defaults','socket.io-emitter','then','info','MailQueue,\x20%s,\x20%s'];(function(_0x5e85a7,_0x180744){var _0x4768b1=function(_0x2cc65d){while(--_0x2cc65d){_0x5e85a7['push'](_0x5e85a7['shift']());}};_0x4768b1(++_0x180744);}(_0x1bf8,0x161));var _0x81bf=function(_0x305a37,_0x534646){_0x305a37=_0x305a37-0x0;var _0x1dfc2a=_0x1bf8[_0x305a37];return _0x1dfc2a;};'use strict';var _=require(_0x81bf('0x0'));var util=require(_0x81bf('0x1'));var moment=require(_0x81bf('0x2'));var BPromise=require(_0x81bf('0x3'));var rs=require(_0x81bf('0x4'));var fs=require('fs');var Redis=require(_0x81bf('0x5'));var db=require(_0x81bf('0x6'))['db'];var utils=require(_0x81bf('0x7'));var logger=require('../../config/logger')(_0x81bf('0x8'));var config=require(_0x81bf('0x9'));var jayson=require(_0x81bf('0xa'));var client=jayson['client']['http']({'port':0x232a});config[_0x81bf('0xb')]=_[_0x81bf('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x81bf('0xd'))(new Redis(config[_0x81bf('0xb')]));require('./mailQueue.socket')['register'](socket);function respondWithRpcPromise(_0x43258f,_0x1ea255,_0x3928f2){return new BPromise(function(_0x11f3e3,_0x136e75){return client['request'](_0x43258f,_0x3928f2)[_0x81bf('0xe')](function(_0x375fa2){logger[_0x81bf('0xf')](_0x81bf('0x10'),_0x1ea255,_0x81bf('0x11'));logger[_0x81bf('0x12')](_0x81bf('0x13'),_0x1ea255,'request\x20sent',JSON['stringify'](_0x375fa2));if(_0x375fa2['error']){if(_0x375fa2['error'][_0x81bf('0x14')]===0x1f4){logger[_0x81bf('0x15')](_0x81bf('0x10'),_0x1ea255,_0x375fa2[_0x81bf('0x15')][_0x81bf('0x16')]);return _0x136e75(_0x375fa2[_0x81bf('0x15')][_0x81bf('0x16')]);}logger[_0x81bf('0x15')](_0x81bf('0x10'),_0x1ea255,_0x375fa2[_0x81bf('0x15')]['message']);return _0x11f3e3(_0x375fa2[_0x81bf('0x15')][_0x81bf('0x16')]);}else{logger[_0x81bf('0xf')](_0x81bf('0x10'),_0x1ea255,_0x81bf('0x11'));_0x11f3e3(_0x375fa2['result']['message']);}})[_0x81bf('0x17')](function(_0x59f381){logger[_0x81bf('0x15')](_0x81bf('0x10'),_0x1ea255,_0x59f381);_0x136e75(_0x59f381);});});}exports[_0x81bf('0x18')]=function(_0x428014){var _0x1d713d=this;return new Promise(function(_0x2cc7e2,_0x2cd6f3){return db[_0x81bf('0x19')]['findAll']({'raw':_0x428014[_0x81bf('0x1a')]?_0x428014[_0x81bf('0x1a')][_0x81bf('0x1b')]===undefined?!![]:![]:!![],'where':_0x428014[_0x81bf('0x1a')]?_0x428014[_0x81bf('0x1a')]['where']||null:null,'attributes':_0x428014[_0x81bf('0x1a')]?_0x428014[_0x81bf('0x1a')][_0x81bf('0x1c')]||null:null,'limit':_0x428014[_0x81bf('0x1a')]?_0x428014['options'][_0x81bf('0x1d')]||null:null,'include':_0x428014[_0x81bf('0x1a')]?_0x428014[_0x81bf('0x1a')][_0x81bf('0x1e')]?_[_0x81bf('0x1f')](_0x428014[_0x81bf('0x1a')][_0x81bf('0x1e')],function(_0x534fb7){return{'model':db[_0x534fb7['model']],'as':_0x534fb7['as'],'attributes':_0x534fb7[_0x81bf('0x1c')],'include':_0x534fb7[_0x81bf('0x1e')]?_[_0x81bf('0x1f')](_0x534fb7[_0x81bf('0x1e')],function(_0x210330){return{'model':db[_0x210330[_0x81bf('0x20')]],'as':_0x210330['as'],'attributes':_0x210330['attributes'],'include':_0x210330['include']?_[_0x81bf('0x1f')](_0x210330[_0x81bf('0x1e')],function(_0x94271){return{'model':db[_0x94271['model']],'as':_0x94271['as'],'attributes':_0x94271[_0x81bf('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x216bb4){logger[_0x81bf('0xf')](_0x81bf('0x18'),_0x428014);logger[_0x81bf('0x12')](_0x81bf('0x18'),_0x428014,JSON[_0x81bf('0x21')](_0x216bb4));_0x2cc7e2(_0x216bb4);})[_0x81bf('0x17')](function(_0x10fc24){logger[_0x81bf('0x15')](_0x81bf('0x18'),_0x10fc24[_0x81bf('0x16')],_0x428014);_0x2cd6f3(_0x1d713d[_0x81bf('0x15')](0x1f4,_0x10fc24[_0x81bf('0x16')]));});});};exports[_0x81bf('0x22')]=function(_0x2f4e7c){var _0x201d0e=this;return new Promise(function(_0x157f74,_0x373759){return db[_0x81bf('0x19')][_0x81bf('0x23')]({'raw':_0x2f4e7c['options']?_0x2f4e7c[_0x81bf('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x2f4e7c[_0x81bf('0x1a')]?_0x2f4e7c['options'][_0x81bf('0x24')]||null:null,'attributes':_0x2f4e7c[_0x81bf('0x1a')]?_0x2f4e7c[_0x81bf('0x1a')][_0x81bf('0x1c')]||null:null,'include':_0x2f4e7c['options']?_0x2f4e7c[_0x81bf('0x1a')][_0x81bf('0x1e')]?_[_0x81bf('0x1f')](_0x2f4e7c[_0x81bf('0x1a')][_0x81bf('0x1e')],function(_0x91adf){return{'model':db[_0x91adf[_0x81bf('0x20')]],'as':_0x91adf['as'],'attributes':_0x91adf[_0x81bf('0x1c')],'include':_0x91adf[_0x81bf('0x1e')]?_['map'](_0x91adf['include'],function(_0x135b37){return{'model':db[_0x135b37[_0x81bf('0x20')]],'as':_0x135b37['as'],'attributes':_0x135b37[_0x81bf('0x1c')],'include':_0x135b37[_0x81bf('0x1e')]?_[_0x81bf('0x1f')](_0x135b37[_0x81bf('0x1e')],function(_0x1f28ad){return{'model':db[_0x1f28ad[_0x81bf('0x20')]],'as':_0x1f28ad['as'],'attributes':_0x1f28ad[_0x81bf('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x81bf('0xe')](function(_0x3db54d){logger[_0x81bf('0xf')](_0x81bf('0x22'),_0x2f4e7c);logger[_0x81bf('0x12')](_0x81bf('0x22'),_0x2f4e7c,JSON['stringify'](_0x3db54d));_0x157f74(_0x3db54d);})[_0x81bf('0x17')](function(_0x38f498){logger['error'](_0x81bf('0x22'),_0x38f498[_0x81bf('0x16')],_0x2f4e7c);_0x373759(_0x201d0e[_0x81bf('0x15')](0x1f4,_0x38f498[_0x81bf('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 63744aa..ca31c51 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 _0x15a5=['save','update','emit','removeListener','register','length','./mailQueue.events'];(function(_0x1d1f04,_0x9d3533){var _0x448de6=function(_0x5d6300){while(--_0x5d6300){_0x1d1f04['push'](_0x1d1f04['shift']());}};_0x448de6(++_0x9d3533);}(_0x15a5,0x148));var _0x515a=function(_0x15db27,_0x5c163b){_0x15db27=_0x15db27-0x0;var _0x1d0efb=_0x15a5[_0x15db27];return _0x1d0efb;};'use strict';var MailQueueEvents=require(_0x515a('0x0'));var events=[_0x515a('0x1'),'remove',_0x515a('0x2')];function createListener(_0x467e8f,_0x913958){return function(_0x60cb5b){_0x913958[_0x515a('0x3')](_0x467e8f,_0x60cb5b);};}function removeListener(_0x33911d,_0x1740cb){return function(){MailQueueEvents[_0x515a('0x4')](_0x33911d,_0x1740cb);};}exports[_0x515a('0x5')]=function(_0x58da7d){for(var _0xeec4a4=0x0,_0x94d3e9=events[_0x515a('0x6')];_0xeec4a4<_0x94d3e9;_0xeec4a4++){var _0xc67e74=events[_0xeec4a4];var _0x8b9dee=createListener('mailQueue:'+_0xc67e74,_0x58da7d);MailQueueEvents['on'](_0xc67e74,_0x8b9dee);}}; \ No newline at end of file +var _0x2d65=['./mailQueue.events','save','update','emit','removeListener','register'];(function(_0x4f0e77,_0x253bc4){var _0x47d74c=function(_0x359a2a){while(--_0x359a2a){_0x4f0e77['push'](_0x4f0e77['shift']());}};_0x47d74c(++_0x253bc4);}(_0x2d65,0x1f2));var _0x52d6=function(_0x6788ac,_0x47a4d5){_0x6788ac=_0x6788ac-0x0;var _0x4e0439=_0x2d65[_0x6788ac];return _0x4e0439;};'use strict';var MailQueueEvents=require(_0x52d6('0x0'));var events=[_0x52d6('0x1'),'remove',_0x52d6('0x2')];function createListener(_0x4b8bc5,_0x1dc7ed){return function(_0x3741ab){_0x1dc7ed[_0x52d6('0x3')](_0x4b8bc5,_0x3741ab);};}function removeListener(_0x2969ef,_0x5cadff){return function(){MailQueueEvents[_0x52d6('0x4')](_0x2969ef,_0x5cadff);};}exports[_0x52d6('0x5')]=function(_0x15aa48){for(var _0x3d3acc=0x0,_0x261f88=events['length'];_0x3d3acc<_0x261f88;_0x3d3acc++){var _0x2ec89e=events[_0x3d3acc];var _0x18b4ab=createListener('mailQueue:'+_0x2ec89e,_0x15aa48);MailQueueEvents['on'](_0x2ec89e,_0x18b4ab);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index d84f3db..a5f0672 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 _0x52bd=['/:id','show','put','update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./mailQueueReport.controller','get','isAuthenticated','describe'];(function(_0x4f44e7,_0x15ef68){var _0x3e2c9a=function(_0x20468b){while(--_0x20468b){_0x4f44e7['push'](_0x4f44e7['shift']());}};_0x3e2c9a(++_0x15ef68);}(_0x52bd,0x127));var _0xd52b=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0x52bd[_0x32d457];return _0x338386;};'use strict';var multer=require(_0xd52b('0x0'));var util=require('util');var path=require(_0xd52b('0x1'));var timeout=require(_0xd52b('0x2'));var express=require(_0xd52b('0x3'));var router=express['Router']();var fs_extra=require(_0xd52b('0x4'));var auth=require(_0xd52b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd52b('0x6'));var controller=require(_0xd52b('0x7'));router[_0xd52b('0x8')]('/',auth[_0xd52b('0x9')](),controller['index']);router['get']('/describe',auth[_0xd52b('0x9')](),controller[_0xd52b('0xa')]);router['get'](_0xd52b('0xb'),auth[_0xd52b('0x9')](),controller[_0xd52b('0xc')]);router['post']('/',auth[_0xd52b('0x9')](),controller['create']);router[_0xd52b('0xd')](_0xd52b('0xb'),auth['isAuthenticated'](),controller[_0xd52b('0xe')]);router[_0xd52b('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xd52b('0x10')]);module[_0xd52b('0x11')]=router; \ No newline at end of file +var _0x5754=['show','post','create','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get','index','/describe','isAuthenticated','describe','/:id'];(function(_0x2cc594,_0x4d727b){var _0x4abff7=function(_0x22b01d){while(--_0x22b01d){_0x2cc594['push'](_0x2cc594['shift']());}};_0x4abff7(++_0x4d727b);}(_0x5754,0x1a8));var _0x4575=function(_0x11c6fc,_0x4d536d){_0x11c6fc=_0x11c6fc-0x0;var _0x3b851e=_0x5754[_0x11c6fc];return _0x3b851e;};'use strict';var multer=require(_0x4575('0x0'));var util=require(_0x4575('0x1'));var path=require(_0x4575('0x2'));var timeout=require(_0x4575('0x3'));var express=require('express');var router=express[_0x4575('0x4')]();var fs_extra=require(_0x4575('0x5'));var auth=require(_0x4575('0x6'));var interaction=require(_0x4575('0x7'));var config=require(_0x4575('0x8'));var controller=require(_0x4575('0x9'));router[_0x4575('0xa')]('/',auth['isAuthenticated'](),controller[_0x4575('0xb')]);router[_0x4575('0xa')](_0x4575('0xc'),auth[_0x4575('0xd')](),controller[_0x4575('0xe')]);router['get'](_0x4575('0xf'),auth['isAuthenticated'](),controller[_0x4575('0x10')]);router[_0x4575('0x11')]('/',auth[_0x4575('0xd')](),controller[_0x4575('0x12')]);router['put'](_0x4575('0xf'),auth['isAuthenticated'](),controller[_0x4575('0x13')]);router['delete'](_0x4575('0xf'),auth['isAuthenticated'](),controller[_0x4575('0x14')]);module[_0x4575('0x15')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 65c5681..1dd2dc0 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 _0x0da1=['exports','STRING','DATE'];(function(_0x2d6bf5,_0x4996a5){var _0xdfa6f4=function(_0x4f1136){while(--_0x4f1136){_0x2d6bf5['push'](_0x2d6bf5['shift']());}};_0xdfa6f4(++_0x4996a5);}(_0x0da1,0x153));var _0x10da=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x0da1[_0x19e35c];return _0x3e1fe8;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x10da('0x0')]={'uniqueid':{'type':Sequelize[_0x10da('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x10da('0x1')]},'joinAt':{'type':Sequelize[_0x10da('0x2')]},'leaveAt':{'type':Sequelize[_0x10da('0x2')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x10da('0x2')]},'reason':{'type':Sequelize[_0x10da('0x1')]}}; \ No newline at end of file +var _0x4677=['DATE','moment','exports','STRING'];(function(_0x39c734,_0x2f3e06){var _0xb2a2f9=function(_0x502f3f){while(--_0x502f3f){_0x39c734['push'](_0x39c734['shift']());}};_0xb2a2f9(++_0x2f3e06);}(_0x4677,0x155));var _0x7467=function(_0x33656b,_0xc4b65c){_0x33656b=_0x33656b-0x0;var _0x13d4dd=_0x4677[_0x33656b];return _0x13d4dd;};'use strict';var moment=require(_0x7467('0x0'));var Sequelize=require('sequelize');module[_0x7467('0x1')]={'uniqueid':{'type':Sequelize[_0x7467('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7467('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7467('0x3')]},'acceptAt':{'type':Sequelize[_0x7467('0x3')]},'exitAt':{'type':Sequelize[_0x7467('0x3')]},'reason':{'type':Sequelize[_0x7467('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 4b3cb21..c6a0052 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 _0xe3da=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','MailQueueReport','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','order','sort','where','pick','map','VIRTUAL','filter','merge','options','count','include','findAll','rows','catch','show','params','length','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api'];(function(_0x54311d,_0x2a5e5e){var _0x376a1b=function(_0x5c08e2){while(--_0x5c08e2){_0x54311d['push'](_0x54311d['shift']());}};_0x376a1b(++_0x2a5e5e);}(_0xe3da,0x1cd));var _0xae3d=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xe3da[_0x19950b];return _0x3c6b41;};'use strict';var emlformat=require(_0xae3d('0x0'));var rimraf=require(_0xae3d('0x1'));var zipdir=require(_0xae3d('0x2'));var jsonpatch=require(_0xae3d('0x3'));var rp=require(_0xae3d('0x4'));var moment=require(_0xae3d('0x5'));var BPromise=require(_0xae3d('0x6'));var Mustache=require(_0xae3d('0x7'));var util=require(_0xae3d('0x8'));var path=require(_0xae3d('0x9'));var sox=require(_0xae3d('0xa'));var csv=require(_0xae3d('0xb'));var ejs=require(_0xae3d('0xc'));var fs=require('fs');var fs_extra=require(_0xae3d('0xd'));var _=require(_0xae3d('0xe'));var squel=require(_0xae3d('0xf'));var crypto=require('crypto');var jsforce=require(_0xae3d('0x10'));var deskjs=require(_0xae3d('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xae3d('0x12'));var Redis=require(_0xae3d('0x13'));var authService=require(_0xae3d('0x14'));var qs=require(_0xae3d('0x15'));var as=require(_0xae3d('0x16'));var hardwareService=require(_0xae3d('0x17'));var logger=require('../../config/logger')(_0xae3d('0x18'));var utils=require('../../config/utils');var config=require(_0xae3d('0x19'));var licenseUtil=require(_0xae3d('0x1a'));var db=require(_0xae3d('0x1b'))['db'];function respondWithStatusCode(_0x172f7a,_0x48aa74){_0x48aa74=_0x48aa74||0xcc;return function(_0xfb7869){if(_0xfb7869){return _0x172f7a[_0xae3d('0x1c')](_0x48aa74);}return _0x172f7a[_0xae3d('0x1d')](_0x48aa74)[_0xae3d('0x1e')]();};}function respondWithResult(_0x2afdd3,_0x430659){_0x430659=_0x430659||0xc8;return function(_0x31498d){if(_0x31498d){return _0x2afdd3['status'](_0x430659)[_0xae3d('0x1f')](_0x31498d);}};}function respondWithFilteredResult(_0x42f4b4,_0x46295b){return function(_0x230afb){if(_0x230afb){var _0x192c13=typeof _0x46295b[_0xae3d('0x20')]==='undefined'&&typeof _0x46295b[_0xae3d('0x21')]===_0xae3d('0x22');var _0x2e31f1=_0x230afb['count'];var _0x3f8cf9=_0x192c13?0x0:_0x46295b[_0xae3d('0x20')];var _0x558e42=_0x192c13?_0x230afb['count']:_0x46295b[_0xae3d('0x20')]+_0x46295b[_0xae3d('0x21')];var _0x19c44d;if(_0x558e42>=_0x2e31f1){_0x558e42=_0x2e31f1;_0x19c44d=0xc8;}else{_0x19c44d=0xce;}_0x42f4b4[_0xae3d('0x1d')](_0x19c44d);return _0x42f4b4[_0xae3d('0x23')]('Content-Range',_0x3f8cf9+'-'+_0x558e42+'/'+_0x2e31f1)[_0xae3d('0x1f')](_0x230afb);}return null;};}function patchUpdates(_0x48f00e){return function(_0x4a09c2){try{jsonpatch[_0xae3d('0x24')](_0x4a09c2,_0x48f00e,!![]);}catch(_0x1415e8){return BPromise[_0xae3d('0x25')](_0x1415e8);}return _0x4a09c2[_0xae3d('0x26')]();};}function saveUpdates(_0x3e7afc,_0x26c419){return function(_0x155099){if(_0x155099){return _0x155099[_0xae3d('0x27')](_0x3e7afc)[_0xae3d('0x28')](function(_0x300be8){return _0x300be8;});}return null;};}function removeEntity(_0x9bf34a,_0x37f5ff){return function(_0x1b2acb){if(_0x1b2acb){return _0x1b2acb[_0xae3d('0x29')]()[_0xae3d('0x28')](function(){_0x9bf34a[_0xae3d('0x1d')](0xcc)[_0xae3d('0x1e')]();});}};}function handleEntityNotFound(_0x2131e9,_0x1b1217){return function(_0x5d45db){if(!_0x5d45db){_0x2131e9[_0xae3d('0x1c')](0x194);}return _0x5d45db;};}function handleError(_0x185e71,_0xb5940){_0xb5940=_0xb5940||0x1f4;return function(_0x52df0f){logger[_0xae3d('0x2a')](_0x52df0f[_0xae3d('0x2b')]);if(_0x52df0f[_0xae3d('0x2c')]){delete _0x52df0f['name'];}_0x185e71['status'](_0xb5940)[_0xae3d('0x2d')](_0x52df0f);};}exports[_0xae3d('0x2e')]=function(_0x3a5840,_0x3114f9){var _0xb69ec9={},_0x561371={},_0x1d1483={'count':0x0,'rows':[]};var _0x3a2434=_['map'](db[_0xae3d('0x2f')][_0xae3d('0x30')],function(_0x2cf750){return{'name':_0x2cf750[_0xae3d('0x31')],'type':_0x2cf750[_0xae3d('0x32')][_0xae3d('0x33')]};});_0x561371['model']=_['map'](_0x3a2434,'name');_0x561371[_0xae3d('0x34')]=_[_0xae3d('0x35')](_0x3a5840[_0xae3d('0x34')]);_0x561371[_0xae3d('0x36')]=_['intersection'](_0x561371[_0xae3d('0x37')],_0x561371[_0xae3d('0x34')]);_0xb69ec9[_0xae3d('0x38')]=_[_0xae3d('0x39')](_0x561371[_0xae3d('0x37')],qs[_0xae3d('0x3a')](_0x3a5840[_0xae3d('0x34')]['fields']));_0xb69ec9[_0xae3d('0x38')]=_0xb69ec9['attributes']['length']?_0xb69ec9[_0xae3d('0x38')]:_0x561371['model'];if(!_0x3a5840[_0xae3d('0x34')]['hasOwnProperty']('nolimit')){_0xb69ec9[_0xae3d('0x21')]=qs[_0xae3d('0x21')](_0x3a5840[_0xae3d('0x34')]['limit']);_0xb69ec9[_0xae3d('0x20')]=qs['offset'](_0x3a5840[_0xae3d('0x34')][_0xae3d('0x20')]);}_0xb69ec9[_0xae3d('0x3b')]=qs[_0xae3d('0x3c')](_0x3a5840[_0xae3d('0x34')][_0xae3d('0x3c')]);_0xb69ec9[_0xae3d('0x3d')]=qs[_0xae3d('0x36')](_[_0xae3d('0x3e')](_0x3a5840[_0xae3d('0x34')],_0x561371[_0xae3d('0x36')]),_0x3a2434);if(_0x3a5840['query']['filter']){_0xb69ec9[_0xae3d('0x3d')]=_['merge'](_0xb69ec9[_0xae3d('0x3d')],{'$or':_[_0xae3d('0x3f')](_0x3a2434,function(_0x1db3c1){if(_0x1db3c1[_0xae3d('0x32')]!==_0xae3d('0x40')){var _0x35db44={};_0x35db44[_0x1db3c1[_0xae3d('0x2c')]]={'$like':'%'+_0x3a5840[_0xae3d('0x34')][_0xae3d('0x41')]+'%'};return _0x35db44;}})});}_0xb69ec9=_[_0xae3d('0x42')]({},_0xb69ec9,_0x3a5840[_0xae3d('0x43')]);var _0x549db8={'where':_0xb69ec9[_0xae3d('0x3d')]};return db[_0xae3d('0x2f')][_0xae3d('0x44')](_0x549db8)['then'](function(_0x4df102){_0x1d1483[_0xae3d('0x44')]=_0x4df102;if(_0x3a5840[_0xae3d('0x34')]['includeAll']){_0xb69ec9[_0xae3d('0x45')]=[{'all':!![]}];}return db[_0xae3d('0x2f')][_0xae3d('0x46')](_0xb69ec9);})[_0xae3d('0x28')](function(_0x436a04){_0x1d1483[_0xae3d('0x47')]=_0x436a04;return _0x1d1483;})['then'](respondWithFilteredResult(_0x3114f9,_0xb69ec9))[_0xae3d('0x48')](handleError(_0x3114f9,null));};exports[_0xae3d('0x49')]=function(_0xce7f34,_0x938811){var _0x1fef90={'raw':!![],'where':{'id':_0xce7f34[_0xae3d('0x4a')]['id']}},_0x515220={};_0x515220['model']=_[_0xae3d('0x35')](db[_0xae3d('0x2f')][_0xae3d('0x30')]);_0x515220[_0xae3d('0x34')]=_['keys'](_0xce7f34['query']);_0x515220['filters']=_[_0xae3d('0x39')](_0x515220[_0xae3d('0x37')],_0x515220['query']);_0x1fef90['attributes']=_['intersection'](_0x515220[_0xae3d('0x37')],qs[_0xae3d('0x3a')](_0xce7f34[_0xae3d('0x34')][_0xae3d('0x3a')]));_0x1fef90[_0xae3d('0x38')]=_0x1fef90[_0xae3d('0x38')][_0xae3d('0x4b')]?_0x1fef90['attributes']:_0x515220['model'];if(_0xce7f34['query'][_0xae3d('0x4c')]){_0x1fef90['include']=[{'all':!![]}];}_0x1fef90=_[_0xae3d('0x42')]({},_0x1fef90,_0xce7f34[_0xae3d('0x43')]);return db[_0xae3d('0x2f')][_0xae3d('0x4d')](_0x1fef90)[_0xae3d('0x28')](handleEntityNotFound(_0x938811,null))[_0xae3d('0x28')](respondWithResult(_0x938811,null))[_0xae3d('0x48')](handleError(_0x938811,null));};exports[_0xae3d('0x4e')]=function(_0x38f92d,_0x4ed0f9){return db[_0xae3d('0x2f')]['create'](_0x38f92d['body'],{})['then'](respondWithResult(_0x4ed0f9,0xc9))[_0xae3d('0x48')](handleError(_0x4ed0f9,null));};exports[_0xae3d('0x27')]=function(_0x39f213,_0x6fa6c){if(_0x39f213['body']['id']){delete _0x39f213['body']['id'];}return db[_0xae3d('0x2f')][_0xae3d('0x4d')]({'where':{'id':_0x39f213[_0xae3d('0x4a')]['id']}})[_0xae3d('0x28')](handleEntityNotFound(_0x6fa6c,null))['then'](saveUpdates(_0x39f213[_0xae3d('0x4f')],null))[_0xae3d('0x28')](respondWithResult(_0x6fa6c,null))[_0xae3d('0x48')](handleError(_0x6fa6c,null));};exports[_0xae3d('0x29')]=function(_0x2a6a24,_0x38ccf1){return db[_0xae3d('0x2f')][_0xae3d('0x4d')]({'where':{'id':_0x2a6a24[_0xae3d('0x4a')]['id']}})[_0xae3d('0x28')](handleEntityNotFound(_0x38ccf1,null))[_0xae3d('0x28')](removeEntity(_0x38ccf1,null))[_0xae3d('0x48')](handleError(_0x38ccf1,null));};exports['describe']=function(_0x4f4694,_0x4c6dab){return db[_0xae3d('0x2f')][_0xae3d('0x50')]()['then'](respondWithResult(_0x4c6dab,null))[_0xae3d('0x48')](handleError(_0x4c6dab,null));}; \ No newline at end of file +var _0x7096=['Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','send','map','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','params','MailQueueReport','find','catch','create','body','describe','rimraf','fast-json-patch','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','set'];(function(_0x5af93d,_0xa9ecba){var _0x16cc7e=function(_0x1773c1){while(--_0x1773c1){_0x5af93d['push'](_0x5af93d['shift']());}};_0x16cc7e(++_0xa9ecba);}(_0x7096,0x10c));var _0x6709=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x7096[_0x1035c1];return _0x308d67;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6709('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6709('0x1'));var rp=require('request-promise');var moment=require(_0x6709('0x2'));var BPromise=require(_0x6709('0x3'));var Mustache=require(_0x6709('0x4'));var util=require(_0x6709('0x5'));var path=require(_0x6709('0x6'));var sox=require(_0x6709('0x7'));var csv=require(_0x6709('0x8'));var ejs=require(_0x6709('0x9'));var fs=require('fs');var fs_extra=require(_0x6709('0xa'));var _=require(_0x6709('0xb'));var squel=require(_0x6709('0xc'));var crypto=require(_0x6709('0xd'));var jsforce=require(_0x6709('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6709('0xf'));var Papa=require(_0x6709('0x10'));var Redis=require(_0x6709('0x11'));var authService=require(_0x6709('0x12'));var qs=require(_0x6709('0x13'));var as=require(_0x6709('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6709('0x15'));var utils=require(_0x6709('0x16'));var config=require(_0x6709('0x17'));var licenseUtil=require(_0x6709('0x18'));var db=require(_0x6709('0x19'))['db'];function respondWithStatusCode(_0x288f51,_0x1d56a5){_0x1d56a5=_0x1d56a5||0xcc;return function(_0x1ac547){if(_0x1ac547){return _0x288f51['sendStatus'](_0x1d56a5);}return _0x288f51[_0x6709('0x1a')](_0x1d56a5)[_0x6709('0x1b')]();};}function respondWithResult(_0x4d5255,_0x3706e1){_0x3706e1=_0x3706e1||0xc8;return function(_0x4e4587){if(_0x4e4587){return _0x4d5255[_0x6709('0x1a')](_0x3706e1)['json'](_0x4e4587);}};}function respondWithFilteredResult(_0x41af1f,_0x4bc059){return function(_0x149233){if(_0x149233){var _0x28866a=typeof _0x4bc059[_0x6709('0x1c')]===_0x6709('0x1d')&&typeof _0x4bc059['limit']==='undefined';var _0x5c4f94=_0x149233[_0x6709('0x1e')];var _0x235a54=_0x28866a?0x0:_0x4bc059['offset'];var _0x9c1fd8=_0x28866a?_0x149233[_0x6709('0x1e')]:_0x4bc059[_0x6709('0x1c')]+_0x4bc059['limit'];var _0x13cf04;if(_0x9c1fd8>=_0x5c4f94){_0x9c1fd8=_0x5c4f94;_0x13cf04=0xc8;}else{_0x13cf04=0xce;}_0x41af1f[_0x6709('0x1a')](_0x13cf04);return _0x41af1f[_0x6709('0x1f')](_0x6709('0x20'),_0x235a54+'-'+_0x9c1fd8+'/'+_0x5c4f94)['json'](_0x149233);}return null;};}function patchUpdates(_0x3c4971){return function(_0x1edac3){try{jsonpatch[_0x6709('0x21')](_0x1edac3,_0x3c4971,!![]);}catch(_0x3cf882){return BPromise[_0x6709('0x22')](_0x3cf882);}return _0x1edac3[_0x6709('0x23')]();};}function saveUpdates(_0x45921e,_0x17763d){return function(_0x386224){if(_0x386224){return _0x386224[_0x6709('0x24')](_0x45921e)[_0x6709('0x25')](function(_0xa36371){return _0xa36371;});}return null;};}function removeEntity(_0x5cf48b,_0x29f25f){return function(_0x81138e){if(_0x81138e){return _0x81138e[_0x6709('0x26')]()['then'](function(){_0x5cf48b[_0x6709('0x1a')](0xcc)[_0x6709('0x1b')]();});}};}function handleEntityNotFound(_0x20a347,_0x44b465){return function(_0x588e00){if(!_0x588e00){_0x20a347[_0x6709('0x27')](0x194);}return _0x588e00;};}function handleError(_0x3076fe,_0x50f7d6){_0x50f7d6=_0x50f7d6||0x1f4;return function(_0x585073){logger[_0x6709('0x28')](_0x585073['stack']);if(_0x585073[_0x6709('0x29')]){delete _0x585073[_0x6709('0x29')];}_0x3076fe['status'](_0x50f7d6)[_0x6709('0x2a')](_0x585073);};}exports['index']=function(_0x46a325,_0x3cd555){var _0x5b6906={},_0x137137={},_0x4e6989={'count':0x0,'rows':[]};var _0xe066d8=_[_0x6709('0x2b')](db['MailQueueReport'][_0x6709('0x2c')],function(_0x5deff5){return{'name':_0x5deff5[_0x6709('0x2d')],'type':_0x5deff5[_0x6709('0x2e')]['key']};});_0x137137['model']=_[_0x6709('0x2b')](_0xe066d8,_0x6709('0x29'));_0x137137[_0x6709('0x2f')]=_[_0x6709('0x30')](_0x46a325[_0x6709('0x2f')]);_0x137137[_0x6709('0x31')]=_[_0x6709('0x32')](_0x137137[_0x6709('0x33')],_0x137137[_0x6709('0x2f')]);_0x5b6906['attributes']=_[_0x6709('0x32')](_0x137137[_0x6709('0x33')],qs[_0x6709('0x34')](_0x46a325[_0x6709('0x2f')]['fields']));_0x5b6906[_0x6709('0x35')]=_0x5b6906[_0x6709('0x35')][_0x6709('0x36')]?_0x5b6906[_0x6709('0x35')]:_0x137137['model'];if(!_0x46a325[_0x6709('0x2f')][_0x6709('0x37')]('nolimit')){_0x5b6906[_0x6709('0x38')]=qs[_0x6709('0x38')](_0x46a325['query'][_0x6709('0x38')]);_0x5b6906[_0x6709('0x1c')]=qs[_0x6709('0x1c')](_0x46a325[_0x6709('0x2f')][_0x6709('0x1c')]);}_0x5b6906[_0x6709('0x39')]=qs[_0x6709('0x3a')](_0x46a325['query'][_0x6709('0x3a')]);_0x5b6906[_0x6709('0x3b')]=qs['filters'](_[_0x6709('0x3c')](_0x46a325[_0x6709('0x2f')],_0x137137[_0x6709('0x31')]),_0xe066d8);if(_0x46a325[_0x6709('0x2f')][_0x6709('0x3d')]){_0x5b6906[_0x6709('0x3b')]=_['merge'](_0x5b6906[_0x6709('0x3b')],{'$or':_['map'](_0xe066d8,function(_0x31e05a){if(_0x31e05a[_0x6709('0x2e')]!==_0x6709('0x3e')){var _0x48492f={};_0x48492f[_0x31e05a[_0x6709('0x29')]]={'$like':'%'+_0x46a325[_0x6709('0x2f')][_0x6709('0x3d')]+'%'};return _0x48492f;}})});}_0x5b6906=_[_0x6709('0x3f')]({},_0x5b6906,_0x46a325[_0x6709('0x40')]);var _0x1030ee={'where':_0x5b6906[_0x6709('0x3b')]};return db['MailQueueReport'][_0x6709('0x1e')](_0x1030ee)[_0x6709('0x25')](function(_0x50fbcd){_0x4e6989[_0x6709('0x1e')]=_0x50fbcd;if(_0x46a325[_0x6709('0x2f')][_0x6709('0x41')]){_0x5b6906[_0x6709('0x42')]=[{'all':!![]}];}return db['MailQueueReport']['findAll'](_0x5b6906);})[_0x6709('0x25')](function(_0x3f0da1){_0x4e6989[_0x6709('0x43')]=_0x3f0da1;return _0x4e6989;})[_0x6709('0x25')](respondWithFilteredResult(_0x3cd555,_0x5b6906))['catch'](handleError(_0x3cd555,null));};exports['show']=function(_0x5af1fb,_0x3d4237){var _0x293577={'raw':!![],'where':{'id':_0x5af1fb[_0x6709('0x44')]['id']}},_0x54f74e={};_0x54f74e[_0x6709('0x33')]=_['keys'](db['MailQueueReport'][_0x6709('0x2c')]);_0x54f74e[_0x6709('0x2f')]=_[_0x6709('0x30')](_0x5af1fb[_0x6709('0x2f')]);_0x54f74e[_0x6709('0x31')]=_['intersection'](_0x54f74e[_0x6709('0x33')],_0x54f74e['query']);_0x293577[_0x6709('0x35')]=_[_0x6709('0x32')](_0x54f74e[_0x6709('0x33')],qs['fields'](_0x5af1fb[_0x6709('0x2f')]['fields']));_0x293577['attributes']=_0x293577[_0x6709('0x35')][_0x6709('0x36')]?_0x293577[_0x6709('0x35')]:_0x54f74e[_0x6709('0x33')];if(_0x5af1fb[_0x6709('0x2f')][_0x6709('0x41')]){_0x293577[_0x6709('0x42')]=[{'all':!![]}];}_0x293577=_[_0x6709('0x3f')]({},_0x293577,_0x5af1fb[_0x6709('0x40')]);return db[_0x6709('0x45')][_0x6709('0x46')](_0x293577)[_0x6709('0x25')](handleEntityNotFound(_0x3d4237,null))[_0x6709('0x25')](respondWithResult(_0x3d4237,null))[_0x6709('0x47')](handleError(_0x3d4237,null));};exports[_0x6709('0x48')]=function(_0x4f82a0,_0xfbb810){return db['MailQueueReport']['create'](_0x4f82a0[_0x6709('0x49')],{})[_0x6709('0x25')](respondWithResult(_0xfbb810,0xc9))[_0x6709('0x47')](handleError(_0xfbb810,null));};exports[_0x6709('0x24')]=function(_0x22363b,_0x2b05dc){if(_0x22363b[_0x6709('0x49')]['id']){delete _0x22363b[_0x6709('0x49')]['id'];}return db['MailQueueReport'][_0x6709('0x46')]({'where':{'id':_0x22363b[_0x6709('0x44')]['id']}})[_0x6709('0x25')](handleEntityNotFound(_0x2b05dc,null))[_0x6709('0x25')](saveUpdates(_0x22363b['body'],null))[_0x6709('0x25')](respondWithResult(_0x2b05dc,null))['catch'](handleError(_0x2b05dc,null));};exports[_0x6709('0x26')]=function(_0x34a950,_0x2a563b){return db[_0x6709('0x45')][_0x6709('0x46')]({'where':{'id':_0x34a950['params']['id']}})[_0x6709('0x25')](handleEntityNotFound(_0x2a563b,null))[_0x6709('0x25')](removeEntity(_0x2a563b,null))[_0x6709('0x47')](handleError(_0x2a563b,null));};exports[_0x6709('0x4a')]=function(_0x1015e0,_0x55188c){return db['MailQueueReport'][_0x6709('0x4a')]()['then'](respondWithResult(_0x55188c,null))['catch'](handleError(_0x55188c,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 278927e..38fb734 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 _0xb658=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','MailQueueReport','report_mail_queue','uniqueid','lodash','../../config/logger'];(function(_0x2d7e3b,_0xf89c8b){var _0x480845=function(_0x5bebc0){while(--_0x5bebc0){_0x2d7e3b['push'](_0x2d7e3b['shift']());}};_0x480845(++_0xf89c8b);}(_0xb658,0x15a));var _0x8b65=function(_0x4c72ee,_0x2cf314){_0x4c72ee=_0x4c72ee-0x0;var _0x13a6e7=_0xb658[_0x4c72ee];return _0x13a6e7;};'use strict';var _=require(_0x8b65('0x0'));var util=require('util');var logger=require(_0x8b65('0x1'))('api');var moment=require(_0x8b65('0x2'));var BPromise=require(_0x8b65('0x3'));var rp=require(_0x8b65('0x4'));var fs=require('fs');var path=require(_0x8b65('0x5'));var rimraf=require(_0x8b65('0x6'));var config=require(_0x8b65('0x7'));var attributes=require('./mailQueueReport.attributes');module[_0x8b65('0x8')]=function(_0x50367b,_0x1e583a){return _0x50367b['define'](_0x8b65('0x9'),attributes,{'tableName':_0x8b65('0xa'),'paranoid':![],'indexes':[{'name':_0x8b65('0xb'),'fields':[_0x8b65('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6bac=['uniqueid','lodash','util','api','bluebird','request-promise','path','rimraf','./mailQueueReport.attributes','exports','define','MailQueueReport'];(function(_0x5de7c2,_0x5c354e){var _0x5364bf=function(_0x1ceb13){while(--_0x1ceb13){_0x5de7c2['push'](_0x5de7c2['shift']());}};_0x5364bf(++_0x5c354e);}(_0x6bac,0xf1));var _0xc6ba=function(_0x31d717,_0x5d60c3){_0x31d717=_0x31d717-0x0;var _0x34d2f8=_0x6bac[_0x31d717];return _0x34d2f8;};'use strict';var _=require(_0xc6ba('0x0'));var util=require(_0xc6ba('0x1'));var logger=require('../../config/logger')(_0xc6ba('0x2'));var moment=require('moment');var BPromise=require(_0xc6ba('0x3'));var rp=require(_0xc6ba('0x4'));var fs=require('fs');var path=require(_0xc6ba('0x5'));var rimraf=require(_0xc6ba('0x6'));var config=require('../../config/environment');var attributes=require(_0xc6ba('0x7'));module[_0xc6ba('0x8')]=function(_0x1f2244,_0x521a0e){return _0x1f2244[_0xc6ba('0x9')](_0xc6ba('0xa'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xc6ba('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 2d7bfbc..639d1b1 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 _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(_0x52bda3,_0x42a0f9){var _0x398643=function(_0x28a2d2){while(--_0x28a2d2){_0x52bda3['push'](_0x52bda3['shift']());}};_0x398643(++_0x42a0f9);}(_0x5f2f,0x73));var _0xf5f2=function(_0x53f2e6,_0x2d726e){_0x53f2e6=_0x53f2e6-0x0;var _0x347e90=_0x5f2f[_0x53f2e6];return _0x347e90;};'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 +var _0xadb5=['MailQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateMailQueueReport','create','options','raw','debug','MailQueueReport','body','attributes','limit','UpdateMailQueueReport','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x64a9ca,_0x43440f){var _0x319429=function(_0xb11879){while(--_0xb11879){_0x64a9ca['push'](_0x64a9ca['shift']());}};_0x319429(++_0x43440f);}(_0xadb5,0xad));var _0x5adb=function(_0x4e29e3,_0x373655){_0x4e29e3=_0x4e29e3-0x0;var _0x53b96a=_0xadb5[_0x4e29e3];return _0x53b96a;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('MailQueueReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});}exports[_0x5adb('0x15')]=function(_0x529b65){var _0x3fff62=this;return new Promise(function(_0x5de028,_0x1d9e86){return db['MailQueueReport'][_0x5adb('0x16')](_0x529b65['body'],{'raw':_0x529b65['options']?_0x529b65[_0x5adb('0x17')][_0x5adb('0x18')]===undefined?!![]:![]:!![]})[_0x5adb('0xb')](function(_0x1fd4a7){logger[_0x5adb('0xc')]('CreateMailQueueReport',_0x529b65);logger[_0x5adb('0x19')]('CreateMailQueueReport',_0x529b65,JSON['stringify'](_0x1fd4a7));_0x5de028(_0x1fd4a7);})[_0x5adb('0x14')](function(_0x379b33){logger[_0x5adb('0x10')](_0x5adb('0x15'),_0x379b33[_0x5adb('0x12')],_0x529b65);_0x1d9e86(_0x3fff62[_0x5adb('0x10')](0x1f4,_0x379b33[_0x5adb('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x4b1957){var _0x373cc3=this;return new Promise(function(_0x3220cd,_0x3839fb){return db[_0x5adb('0x1a')]['update'](_0x4b1957[_0x5adb('0x1b')],{'raw':_0x4b1957[_0x5adb('0x17')]?_0x4b1957['options'][_0x5adb('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')]['where']||null:null,'attributes':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')][_0x5adb('0x1c')]||null:null,'limit':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')][_0x5adb('0x1d')]||null:null})['then'](function(_0x49992e){logger['info'](_0x5adb('0x1e'),_0x4b1957);logger[_0x5adb('0x19')](_0x5adb('0x1e'),_0x4b1957,JSON[_0x5adb('0xf')](_0x49992e));_0x3220cd(_0x49992e);})[_0x5adb('0x14')](function(_0x4de310){logger[_0x5adb('0x10')](_0x5adb('0x1e'),_0x4de310[_0x5adb('0x12')],_0x4b1957);_0x3839fb(_0x373cc3[_0x5adb('0x10')](0x1f4,_0x4de310[_0x5adb('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 00685d7..2088d97 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(_0x5d3d39,_0x5ed8a1){var _0x2de363=function(_0x450907){while(--_0x450907){_0x5d3d39['push'](_0x5d3d39['shift']());}};_0x2de363(++_0x5ed8a1);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x8cfd08,_0x656b39){var _0x1c6452=function(_0x34a7cc){while(--_0x34a7cc){_0x8cfd08['push'](_0x8cfd08['shift']());}};_0x1c6452(++_0x656b39);}(_0x9c44,0x178));var _0x49c4=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x9c44[_0x1d1779];return _0x2377e9;};'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/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 029b574..d6c1378 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 _0x2bb0=['BOOLEAN','INTEGER','INBOX','sequelize','exports','STRING'];(function(_0x224995,_0x37fd2d){var _0x15f82e=function(_0x1ab6c3){while(--_0x1ab6c3){_0x224995['push'](_0x224995['shift']());}};_0x15f82e(++_0x37fd2d);}(_0x2bb0,0xf3));var _0x02bb=function(_0xfe38b4,_0x3b20b7){_0xfe38b4=_0xfe38b4-0x0;var _0x10c11e=_0x2bb0[_0xfe38b4];return _0x10c11e;};'use strict';var Sequelize=require(_0x02bb('0x0'));module[_0x02bb('0x1')]={'description':{'type':Sequelize[_0x02bb('0x2')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x02bb('0x3')],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x02bb('0x4')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x02bb('0x2')],'defaultValue':_0x02bb('0x5')},'connTimeout':{'type':Sequelize[_0x02bb('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x02bb('0x4')],'defaultValue':0x5},'service':{'type':Sequelize[_0x02bb('0x2')]}}; \ No newline at end of file +var _0xbee3=['INTEGER','exports','BOOLEAN','STRING'];(function(_0x5777aa,_0x1c01b0){var _0x40f69e=function(_0x40675b){while(--_0x40675b){_0x5777aa['push'](_0x5777aa['shift']());}};_0x40f69e(++_0x1c01b0);}(_0xbee3,0xd5));var _0x3bee=function(_0x51be20,_0x3d5246){_0x51be20=_0x51be20-0x0;var _0xd275ea=_0xbee3[_0x51be20];return _0xd275ea;};'use strict';var Sequelize=require('sequelize');module[_0x3bee('0x0')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x3bee('0x1')],'defaultValue':!![]},'user':{'type':Sequelize[_0x3bee('0x2')]},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x3bee('0x3')]},'tls':{'type':Sequelize[_0x3bee('0x1')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x3bee('0x2')],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize[_0x3bee('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x3bee('0x3')],'defaultValue':0x5},'service':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 8cdefd8..ef23349 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 _0x94dc=['MailServerIn','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./mailServerIn.attributes'];(function(_0x28659e,_0x494fd0){var _0x504384=function(_0x5a97fe){while(--_0x5a97fe){_0x28659e['push'](_0x28659e['shift']());}};_0x504384(++_0x494fd0);}(_0x94dc,0xf4));var _0xc94d=function(_0x35885d,_0x3edc49){_0x35885d=_0x35885d-0x0;var _0x25bc54=_0x94dc[_0x35885d];return _0x25bc54;};'use strict';var _=require('lodash');var util=require(_0xc94d('0x0'));var logger=require(_0xc94d('0x1'))('api');var moment=require(_0xc94d('0x2'));var BPromise=require(_0xc94d('0x3'));var rp=require(_0xc94d('0x4'));var fs=require('fs');var path=require(_0xc94d('0x5'));var rimraf=require(_0xc94d('0x6'));var config=require('../../config/environment');var attributes=require(_0xc94d('0x7'));module['exports']=function(_0x269c97,_0x394dc2){return _0x269c97['define'](_0xc94d('0x8'),attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x076a=['define','MailServerIn','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports'];(function(_0x1e730e,_0x1bed73){var _0x46c191=function(_0x34feac){while(--_0x34feac){_0x1e730e['push'](_0x1e730e['shift']());}};_0x46c191(++_0x1bed73);}(_0x076a,0x92));var _0xa076=function(_0x382189,_0x4c38a9){_0x382189=_0x382189-0x0;var _0x36f350=_0x076a[_0x382189];return _0x36f350;};'use strict';var _=require(_0xa076('0x0'));var util=require(_0xa076('0x1'));var logger=require(_0xa076('0x2'))(_0xa076('0x3'));var moment=require(_0xa076('0x4'));var BPromise=require(_0xa076('0x5'));var rp=require(_0xa076('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa076('0x7'));var config=require(_0xa076('0x8'));var attributes=require('./mailServerIn.attributes');module[_0xa076('0x9')]=function(_0xd467f6,_0x485e26){return _0xd467f6[_0xa076('0xa')](_0xa076('0xb'),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 73336b0..c145915 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 _0xa376=['stringify','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','debug','error','MailServerIn,\x20%s,\x20%s','message','result','catch','GetMailServerIn','findAll','options','raw','attributes','limit','map','include','model'];(function(_0x5bbe55,_0x117f68){var _0xf412c1=function(_0x69ba11){while(--_0x69ba11){_0x5bbe55['push'](_0x5bbe55['shift']());}};_0xf412c1(++_0x117f68);}(_0xa376,0x88));var _0x6a37=function(_0x4b2bbc,_0x3cb2ce){_0x4b2bbc=_0x4b2bbc-0x0;var _0x257290=_0xa376[_0x4b2bbc];return _0x257290;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6a37('0x0'));var BPromise=require('bluebird');var rs=require(_0x6a37('0x1'));var fs=require('fs');var Redis=require(_0x6a37('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6a37('0x3'))(_0x6a37('0x4'));var config=require(_0x6a37('0x5'));var jayson=require(_0x6a37('0x6'));var client=jayson[_0x6a37('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x247887,_0x155f90,_0x3d66c8){return new BPromise(function(_0x1ec441,_0xac3aa2){return client[_0x6a37('0x8')](_0x247887,_0x3d66c8)[_0x6a37('0x9')](function(_0x488b87){logger[_0x6a37('0xa')]('MailServerIn,\x20%s,\x20%s',_0x155f90,'request\x20sent');logger[_0x6a37('0xb')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0x155f90,'request\x20sent',JSON['stringify'](_0x488b87));if(_0x488b87['error']){if(_0x488b87[_0x6a37('0xc')]['code']===0x1f4){logger[_0x6a37('0xc')](_0x6a37('0xd'),_0x155f90,_0x488b87[_0x6a37('0xc')][_0x6a37('0xe')]);return _0xac3aa2(_0x488b87[_0x6a37('0xc')]['message']);}logger[_0x6a37('0xc')]('MailServerIn,\x20%s,\x20%s',_0x155f90,_0x488b87[_0x6a37('0xc')]['message']);return _0x1ec441(_0x488b87[_0x6a37('0xc')]['message']);}else{logger[_0x6a37('0xa')](_0x6a37('0xd'),_0x155f90,'request\x20sent');_0x1ec441(_0x488b87[_0x6a37('0xf')][_0x6a37('0xe')]);}})[_0x6a37('0x10')](function(_0x2f8e0a){logger[_0x6a37('0xc')](_0x6a37('0xd'),_0x155f90,_0x2f8e0a);_0xac3aa2(_0x2f8e0a);});});}exports[_0x6a37('0x11')]=function(_0x6b525a){var _0x3ecd35=this;return new Promise(function(_0x22fc54,_0x4f91df){return db['MailServerIn'][_0x6a37('0x12')]({'raw':_0x6b525a[_0x6a37('0x13')]?_0x6b525a[_0x6a37('0x13')][_0x6a37('0x14')]===undefined?!![]:![]:!![],'where':_0x6b525a['options']?_0x6b525a[_0x6a37('0x13')]['where']||null:null,'attributes':_0x6b525a['options']?_0x6b525a[_0x6a37('0x13')][_0x6a37('0x15')]||null:null,'limit':_0x6b525a[_0x6a37('0x13')]?_0x6b525a[_0x6a37('0x13')][_0x6a37('0x16')]||null:null,'include':_0x6b525a[_0x6a37('0x13')]?_0x6b525a[_0x6a37('0x13')]['include']?_[_0x6a37('0x17')](_0x6b525a[_0x6a37('0x13')][_0x6a37('0x18')],function(_0x13fc84){return{'model':db[_0x13fc84[_0x6a37('0x19')]],'as':_0x13fc84['as'],'attributes':_0x13fc84[_0x6a37('0x15')],'include':_0x13fc84[_0x6a37('0x18')]?_['map'](_0x13fc84[_0x6a37('0x18')],function(_0xf8d82d){return{'model':db[_0xf8d82d[_0x6a37('0x19')]],'as':_0xf8d82d['as'],'attributes':_0xf8d82d[_0x6a37('0x15')],'include':_0xf8d82d[_0x6a37('0x18')]?_[_0x6a37('0x17')](_0xf8d82d[_0x6a37('0x18')],function(_0x3c25a5){return{'model':db[_0x3c25a5[_0x6a37('0x19')]],'as':_0x3c25a5['as'],'attributes':_0x3c25a5[_0x6a37('0x15')]};}):[]};}):[]};}):[]:[]})[_0x6a37('0x9')](function(_0x1a45dd){logger[_0x6a37('0xa')](_0x6a37('0x11'),_0x6b525a);logger[_0x6a37('0xb')](_0x6a37('0x11'),_0x6b525a,JSON[_0x6a37('0x1a')](_0x1a45dd));_0x22fc54(_0x1a45dd);})[_0x6a37('0x10')](function(_0x2573e5){logger['error']('GetMailServerIn',_0x2573e5[_0x6a37('0xe')],_0x6b525a);_0x4f91df(_0x3ecd35[_0x6a37('0xc')](0x1f4,_0x2573e5[_0x6a37('0xe')]));});});}; \ No newline at end of file +var _0xec08=['map','model','attributes','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','GetMailServerIn','findAll','options','raw','where','include'];(function(_0x4058a7,_0x46326c){var _0x26079f=function(_0xa16e96){while(--_0xa16e96){_0x4058a7['push'](_0x4058a7['shift']());}};_0x26079f(++_0x46326c);}(_0xec08,0xad));var _0x8ec0=function(_0x379f98,_0x26e8cd){_0x379f98=_0x379f98-0x0;var _0x250ba2=_0xec08[_0x379f98];return _0x250ba2;};'use strict';var _=require('lodash');var util=require(_0x8ec0('0x0'));var moment=require('moment');var BPromise=require(_0x8ec0('0x1'));var rs=require(_0x8ec0('0x2'));var fs=require('fs');var Redis=require(_0x8ec0('0x3'));var db=require(_0x8ec0('0x4'))['db'];var utils=require(_0x8ec0('0x5'));var logger=require(_0x8ec0('0x6'))(_0x8ec0('0x7'));var config=require(_0x8ec0('0x8'));var jayson=require(_0x8ec0('0x9'));var client=jayson[_0x8ec0('0xa')][_0x8ec0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xe6f4dc,_0x1a021d,_0x1a06c8){return new BPromise(function(_0x590a23,_0x2821eb){return client[_0x8ec0('0xc')](_0xe6f4dc,_0x1a06c8)[_0x8ec0('0xd')](function(_0x1fc9c0){logger[_0x8ec0('0xe')](_0x8ec0('0xf'),_0x1a021d,_0x8ec0('0x10'));logger[_0x8ec0('0x11')](_0x8ec0('0x12'),_0x1a021d,'request\x20sent',JSON[_0x8ec0('0x13')](_0x1fc9c0));if(_0x1fc9c0['error']){if(_0x1fc9c0['error'][_0x8ec0('0x14')]===0x1f4){logger['error'](_0x8ec0('0xf'),_0x1a021d,_0x1fc9c0[_0x8ec0('0x15')][_0x8ec0('0x16')]);return _0x2821eb(_0x1fc9c0['error'][_0x8ec0('0x16')]);}logger[_0x8ec0('0x15')](_0x8ec0('0xf'),_0x1a021d,_0x1fc9c0['error'][_0x8ec0('0x16')]);return _0x590a23(_0x1fc9c0[_0x8ec0('0x15')][_0x8ec0('0x16')]);}else{logger[_0x8ec0('0xe')](_0x8ec0('0xf'),_0x1a021d,_0x8ec0('0x10'));_0x590a23(_0x1fc9c0[_0x8ec0('0x17')][_0x8ec0('0x16')]);}})[_0x8ec0('0x18')](function(_0x26b3a7){logger[_0x8ec0('0x15')](_0x8ec0('0xf'),_0x1a021d,_0x26b3a7);_0x2821eb(_0x26b3a7);});});}exports[_0x8ec0('0x19')]=function(_0x92d98f){var _0x583b7b=this;return new Promise(function(_0x2dfc23,_0x54599d){return db['MailServerIn'][_0x8ec0('0x1a')]({'raw':_0x92d98f['options']?_0x92d98f[_0x8ec0('0x1b')][_0x8ec0('0x1c')]===undefined?!![]:![]:!![],'where':_0x92d98f['options']?_0x92d98f['options'][_0x8ec0('0x1d')]||null:null,'attributes':_0x92d98f['options']?_0x92d98f[_0x8ec0('0x1b')]['attributes']||null:null,'limit':_0x92d98f[_0x8ec0('0x1b')]?_0x92d98f['options']['limit']||null:null,'include':_0x92d98f['options']?_0x92d98f[_0x8ec0('0x1b')][_0x8ec0('0x1e')]?_[_0x8ec0('0x1f')](_0x92d98f[_0x8ec0('0x1b')][_0x8ec0('0x1e')],function(_0x3c150c){return{'model':db[_0x3c150c[_0x8ec0('0x20')]],'as':_0x3c150c['as'],'attributes':_0x3c150c[_0x8ec0('0x21')],'include':_0x3c150c[_0x8ec0('0x1e')]?_[_0x8ec0('0x1f')](_0x3c150c[_0x8ec0('0x1e')],function(_0x5124bd){return{'model':db[_0x5124bd['model']],'as':_0x5124bd['as'],'attributes':_0x5124bd[_0x8ec0('0x21')],'include':_0x5124bd[_0x8ec0('0x1e')]?_[_0x8ec0('0x1f')](_0x5124bd[_0x8ec0('0x1e')],function(_0x448819){return{'model':db[_0x448819[_0x8ec0('0x20')]],'as':_0x448819['as'],'attributes':_0x448819['attributes']};}):[]};}):[]};}):[]:[]})[_0x8ec0('0xd')](function(_0x1ab61c){logger[_0x8ec0('0xe')]('GetMailServerIn',_0x92d98f);logger[_0x8ec0('0x11')]('GetMailServerIn',_0x92d98f,JSON[_0x8ec0('0x13')](_0x1ab61c));_0x2dfc23(_0x1ab61c);})[_0x8ec0('0x18')](function(_0x236c80){logger[_0x8ec0('0x15')](_0x8ec0('0x19'),_0x236c80[_0x8ec0('0x16')],_0x92d98f);_0x54599d(_0x583b7b['error'](0x1f4,_0x236c80[_0x8ec0('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 6e0ab0f..5c7387c 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 _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(_0x3e112d,_0x2bb132){var _0x531c31=function(_0x1954bc){while(--_0x1954bc){_0x3e112d['push'](_0x3e112d['shift']());}};_0x531c31(++_0x2bb132);}(_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 +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(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'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 ebf6462..d216b4e 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 _0x3b71=['exports','STRING','BOOLEAN','sequelize'];(function(_0x378606,_0x2c0e11){var _0x987f1=function(_0x1242d8){while(--_0x1242d8){_0x378606['push'](_0x378606['shift']());}};_0x987f1(++_0x2c0e11);}(_0x3b71,0x18f));var _0x13b7=function(_0x5bdd72,_0x4ee4a7){_0x5bdd72=_0x5bdd72-0x0;var _0x3d6c8b=_0x3b71[_0x5bdd72];return _0x3d6c8b;};'use strict';var Sequelize=require(_0x13b7('0x0'));module[_0x13b7('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x13b7('0x2')]},'user':{'type':Sequelize[_0x13b7('0x2')]},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize[_0x13b7('0x2')]},'authentication':{'type':Sequelize[_0x13b7('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0xfcc7=['BOOLEAN','STRING','INTEGER'];(function(_0x4d83ab,_0x1a67ab){var _0x4ddbeb=function(_0x1e0c42){while(--_0x1e0c42){_0x4d83ab['push'](_0x4d83ab['shift']());}};_0x4ddbeb(++_0x1a67ab);}(_0xfcc7,0x6a));var _0x7fcc=function(_0xd2d54,_0x5329f7){_0xd2d54=_0xd2d54-0x0;var _0x78b113=_0xfcc7[_0xd2d54];return _0x78b113;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize[_0x7fcc('0x0')]},'host':{'type':Sequelize[_0x7fcc('0x0')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x7fcc('0x1')]},'secure':{'type':Sequelize[_0x7fcc('0x2')],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x7fcc('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index 7b2ea8c..d8b9029 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 _0x3550=['keys','includeAll','catch','create','body','find','params','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','apply','save','update','destroy','then','end','error','stack','send','index','map','MailServerOut','fieldName','type','key','model','name','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','where','VIRTUAL','include','findAll','show'];(function(_0x285448,_0x17f8f8){var _0x1ab6f5=function(_0x50929e){while(--_0x50929e){_0x285448['push'](_0x285448['shift']());}};_0x1ab6f5(++_0x17f8f8);}(_0x3550,0x1b1));var _0x0355=function(_0x42ca15,_0x193ccb){_0x42ca15=_0x42ca15-0x0;var _0x1c6ded=_0x3550[_0x42ca15];return _0x1c6ded;};'use strict';var emlformat=require(_0x0355('0x0'));var rimraf=require(_0x0355('0x1'));var zipdir=require(_0x0355('0x2'));var jsonpatch=require(_0x0355('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0355('0x4'));var Mustache=require(_0x0355('0x5'));var util=require('util');var path=require(_0x0355('0x6'));var sox=require(_0x0355('0x7'));var csv=require('to-csv');var ejs=require(_0x0355('0x8'));var fs=require('fs');var fs_extra=require(_0x0355('0x9'));var _=require(_0x0355('0xa'));var squel=require(_0x0355('0xb'));var crypto=require(_0x0355('0xc'));var jsforce=require(_0x0355('0xd'));var deskjs=require(_0x0355('0xe'));var toCsv=require(_0x0355('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0355('0x10'));var as=require(_0x0355('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0355('0x12'))('api');var utils=require(_0x0355('0x13'));var config=require(_0x0355('0x14'));var licenseUtil=require(_0x0355('0x15'));var db=require(_0x0355('0x16'))['db'];function respondWithStatusCode(_0x4e4ea6,_0x571482){_0x571482=_0x571482||0xcc;return function(_0x5b3202){if(_0x5b3202){return _0x4e4ea6[_0x0355('0x17')](_0x571482);}return _0x4e4ea6[_0x0355('0x18')](_0x571482)['end']();};}function respondWithResult(_0x1c412f,_0xa7687e){_0xa7687e=_0xa7687e||0xc8;return function(_0x37d20f){if(_0x37d20f){return _0x1c412f[_0x0355('0x18')](_0xa7687e)[_0x0355('0x19')](_0x37d20f);}};}function respondWithFilteredResult(_0x39bff9,_0x594510){return function(_0x278925){if(_0x278925){var _0xee6d76=typeof _0x594510['offset']==='undefined'&&typeof _0x594510[_0x0355('0x1a')]===_0x0355('0x1b');var _0x37c608=_0x278925[_0x0355('0x1c')];var _0x28fb56=_0xee6d76?0x0:_0x594510['offset'];var _0x306670=_0xee6d76?_0x278925[_0x0355('0x1c')]:_0x594510[_0x0355('0x1d')]+_0x594510[_0x0355('0x1a')];var _0x89ac99;if(_0x306670>=_0x37c608){_0x306670=_0x37c608;_0x89ac99=0xc8;}else{_0x89ac99=0xce;}_0x39bff9['status'](_0x89ac99);return _0x39bff9[_0x0355('0x1e')](_0x0355('0x1f'),_0x28fb56+'-'+_0x306670+'/'+_0x37c608)['json'](_0x278925);}return null;};}function patchUpdates(_0x18061f){return function(_0x3c23a4){try{jsonpatch[_0x0355('0x20')](_0x3c23a4,_0x18061f,!![]);}catch(_0xae61bc){return BPromise['reject'](_0xae61bc);}return _0x3c23a4[_0x0355('0x21')]();};}function saveUpdates(_0x2136c9,_0x1e7108){return function(_0x296a1b){if(_0x296a1b){return _0x296a1b[_0x0355('0x22')](_0x2136c9)['then'](function(_0x530230){return _0x530230;});}return null;};}function removeEntity(_0x50c5aa,_0x31aa16){return function(_0x135ed4){if(_0x135ed4){return _0x135ed4[_0x0355('0x23')]()[_0x0355('0x24')](function(){_0x50c5aa[_0x0355('0x18')](0xcc)[_0x0355('0x25')]();});}};}function handleEntityNotFound(_0x54e36c,_0x167761){return function(_0xaf85ff){if(!_0xaf85ff){_0x54e36c[_0x0355('0x17')](0x194);}return _0xaf85ff;};}function handleError(_0x3c4e76,_0x216768){_0x216768=_0x216768||0x1f4;return function(_0x205532){logger[_0x0355('0x26')](_0x205532[_0x0355('0x27')]);if(_0x205532['name']){delete _0x205532['name'];}_0x3c4e76[_0x0355('0x18')](_0x216768)[_0x0355('0x28')](_0x205532);};}exports[_0x0355('0x29')]=function(_0x31a92b,_0x55eb32){var _0x30981e={},_0x21c24c={},_0x13e09d={'count':0x0,'rows':[]};var _0x57229c=_[_0x0355('0x2a')](db[_0x0355('0x2b')]['rawAttributes'],function(_0xde61a){return{'name':_0xde61a[_0x0355('0x2c')],'type':_0xde61a[_0x0355('0x2d')][_0x0355('0x2e')]};});_0x21c24c[_0x0355('0x2f')]=_[_0x0355('0x2a')](_0x57229c,_0x0355('0x30'));_0x21c24c[_0x0355('0x31')]=_['keys'](_0x31a92b['query']);_0x21c24c[_0x0355('0x32')]=_['intersection'](_0x21c24c[_0x0355('0x2f')],_0x21c24c[_0x0355('0x31')]);_0x30981e[_0x0355('0x33')]=_[_0x0355('0x34')](_0x21c24c[_0x0355('0x2f')],qs[_0x0355('0x35')](_0x31a92b[_0x0355('0x31')][_0x0355('0x35')]));_0x30981e[_0x0355('0x33')]=_0x30981e['attributes'][_0x0355('0x36')]?_0x30981e[_0x0355('0x33')]:_0x21c24c[_0x0355('0x2f')];if(!_0x31a92b[_0x0355('0x31')][_0x0355('0x37')](_0x0355('0x38'))){_0x30981e[_0x0355('0x1a')]=qs[_0x0355('0x1a')](_0x31a92b[_0x0355('0x31')][_0x0355('0x1a')]);_0x30981e[_0x0355('0x1d')]=qs[_0x0355('0x1d')](_0x31a92b[_0x0355('0x31')]['offset']);}_0x30981e['order']=qs[_0x0355('0x39')](_0x31a92b[_0x0355('0x31')]['sort']);_0x30981e['where']=qs[_0x0355('0x32')](_[_0x0355('0x3a')](_0x31a92b[_0x0355('0x31')],_0x21c24c['filters']),_0x57229c);if(_0x31a92b[_0x0355('0x31')]['filter']){_0x30981e[_0x0355('0x3b')]=_['merge'](_0x30981e[_0x0355('0x3b')],{'$or':_['map'](_0x57229c,function(_0x94ef28){if(_0x94ef28[_0x0355('0x2d')]!==_0x0355('0x3c')){var _0x17716c={};_0x17716c[_0x94ef28[_0x0355('0x30')]]={'$like':'%'+_0x31a92b[_0x0355('0x31')]['filter']+'%'};return _0x17716c;}})});}_0x30981e=_['merge']({},_0x30981e,_0x31a92b['options']);var _0x3b062b={'where':_0x30981e[_0x0355('0x3b')]};return db[_0x0355('0x2b')][_0x0355('0x1c')](_0x3b062b)[_0x0355('0x24')](function(_0x413203){_0x13e09d['count']=_0x413203;if(_0x31a92b['query']['includeAll']){_0x30981e[_0x0355('0x3d')]=[{'all':!![]}];}return db[_0x0355('0x2b')][_0x0355('0x3e')](_0x30981e);})[_0x0355('0x24')](function(_0x31a507){_0x13e09d['rows']=_0x31a507;return _0x13e09d;})[_0x0355('0x24')](respondWithFilteredResult(_0x55eb32,_0x30981e))['catch'](handleError(_0x55eb32,null));};exports[_0x0355('0x3f')]=function(_0x2520fa,_0x34e19d){var _0x433d7e={'raw':!![],'where':{'id':_0x2520fa['params']['id']}},_0x1ad13c={};_0x1ad13c[_0x0355('0x2f')]=_[_0x0355('0x40')](db['MailServerOut']['rawAttributes']);_0x1ad13c[_0x0355('0x31')]=_[_0x0355('0x40')](_0x2520fa[_0x0355('0x31')]);_0x1ad13c[_0x0355('0x32')]=_['intersection'](_0x1ad13c[_0x0355('0x2f')],_0x1ad13c[_0x0355('0x31')]);_0x433d7e[_0x0355('0x33')]=_['intersection'](_0x1ad13c[_0x0355('0x2f')],qs[_0x0355('0x35')](_0x2520fa[_0x0355('0x31')][_0x0355('0x35')]));_0x433d7e[_0x0355('0x33')]=_0x433d7e[_0x0355('0x33')][_0x0355('0x36')]?_0x433d7e[_0x0355('0x33')]:_0x1ad13c['model'];if(_0x2520fa[_0x0355('0x31')][_0x0355('0x41')]){_0x433d7e['include']=[{'all':!![]}];}_0x433d7e=_['merge']({},_0x433d7e,_0x2520fa['options']);return db['MailServerOut']['find'](_0x433d7e)[_0x0355('0x24')](handleEntityNotFound(_0x34e19d,null))['then'](respondWithResult(_0x34e19d,null))[_0x0355('0x42')](handleError(_0x34e19d,null));};exports[_0x0355('0x43')]=function(_0xbbb85f,_0x92e651){return db[_0x0355('0x2b')][_0x0355('0x43')](_0xbbb85f['body'],{})['then'](respondWithResult(_0x92e651,0xc9))[_0x0355('0x42')](handleError(_0x92e651,null));};exports[_0x0355('0x22')]=function(_0x41c02f,_0x333f35){if(_0x41c02f[_0x0355('0x44')]['id']){delete _0x41c02f['body']['id'];}return db['MailServerOut'][_0x0355('0x45')]({'where':{'id':_0x41c02f['params']['id']}})['then'](handleEntityNotFound(_0x333f35,null))['then'](saveUpdates(_0x41c02f['body'],null))[_0x0355('0x24')](respondWithResult(_0x333f35,null))[_0x0355('0x42')](handleError(_0x333f35,null));};exports['destroy']=function(_0x243d28,_0x3632ed){return db[_0x0355('0x2b')][_0x0355('0x45')]({'where':{'id':_0x243d28[_0x0355('0x46')]['id']}})[_0x0355('0x24')](handleEntityNotFound(_0x3632ed,null))[_0x0355('0x24')](removeEntity(_0x3632ed,null))[_0x0355('0x42')](handleError(_0x3632ed,null));}; \ No newline at end of file +var _0x2068=['intersection','query','fields','attributes','length','nolimit','where','filters','pick','merge','VIRTUAL','filter','MailServerOut','includeAll','include','findAll','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','undefined','limit','offset','count','set','Content-Range','json','apply','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys'];(function(_0x78d733,_0x4aa741){var _0x5b913a=function(_0x5f0f57){while(--_0x5f0f57){_0x78d733['push'](_0x78d733['shift']());}};_0x5b913a(++_0x4aa741);}(_0x2068,0xeb));var _0x8206=function(_0x40c601,_0x25997e){_0x40c601=_0x40c601-0x0;var _0x214a0=_0x2068[_0x40c601];return _0x214a0;};'use strict';var emlformat=require(_0x8206('0x0'));var rimraf=require(_0x8206('0x1'));var zipdir=require(_0x8206('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8206('0x3'));var moment=require(_0x8206('0x4'));var BPromise=require(_0x8206('0x5'));var Mustache=require(_0x8206('0x6'));var util=require('util');var path=require('path');var sox=require(_0x8206('0x7'));var csv=require(_0x8206('0x8'));var ejs=require(_0x8206('0x9'));var fs=require('fs');var fs_extra=require(_0x8206('0xa'));var _=require(_0x8206('0xb'));var squel=require(_0x8206('0xc'));var crypto=require(_0x8206('0xd'));var jsforce=require(_0x8206('0xe'));var deskjs=require(_0x8206('0xf'));var toCsv=require(_0x8206('0x8'));var querystring=require(_0x8206('0x10'));var Papa=require('papaparse');var Redis=require(_0x8206('0x11'));var authService=require(_0x8206('0x12'));var qs=require(_0x8206('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8206('0x14'));var logger=require('../../config/logger')(_0x8206('0x15'));var utils=require(_0x8206('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8206('0x17'))['db'];function respondWithStatusCode(_0x319491,_0x4b5df7){_0x4b5df7=_0x4b5df7||0xcc;return function(_0x1ab0ea){if(_0x1ab0ea){return _0x319491[_0x8206('0x18')](_0x4b5df7);}return _0x319491['status'](_0x4b5df7)['end']();};}function respondWithResult(_0x5c879e,_0x4b610f){_0x4b610f=_0x4b610f||0xc8;return function(_0x3aacce){if(_0x3aacce){return _0x5c879e[_0x8206('0x19')](_0x4b610f)['json'](_0x3aacce);}};}function respondWithFilteredResult(_0x41e775,_0x44729c){return function(_0x114d75){if(_0x114d75){var _0x3baac9=typeof _0x44729c['offset']===_0x8206('0x1a')&&typeof _0x44729c[_0x8206('0x1b')]===_0x8206('0x1a');var _0x475a8d=_0x114d75['count'];var _0x4aa872=_0x3baac9?0x0:_0x44729c[_0x8206('0x1c')];var _0x28253c=_0x3baac9?_0x114d75[_0x8206('0x1d')]:_0x44729c['offset']+_0x44729c[_0x8206('0x1b')];var _0xcee9ac;if(_0x28253c>=_0x475a8d){_0x28253c=_0x475a8d;_0xcee9ac=0xc8;}else{_0xcee9ac=0xce;}_0x41e775[_0x8206('0x19')](_0xcee9ac);return _0x41e775[_0x8206('0x1e')](_0x8206('0x1f'),_0x4aa872+'-'+_0x28253c+'/'+_0x475a8d)[_0x8206('0x20')](_0x114d75);}return null;};}function patchUpdates(_0x3bfee9){return function(_0x672338){try{jsonpatch[_0x8206('0x21')](_0x672338,_0x3bfee9,!![]);}catch(_0x1d1eff){return BPromise['reject'](_0x1d1eff);}return _0x672338['save']();};}function saveUpdates(_0x1638fa,_0x57e837){return function(_0x27b7f3){if(_0x27b7f3){return _0x27b7f3[_0x8206('0x22')](_0x1638fa)[_0x8206('0x23')](function(_0x2025c2){return _0x2025c2;});}return null;};}function removeEntity(_0x15fea5,_0x38e8ef){return function(_0x3b0ca7){if(_0x3b0ca7){return _0x3b0ca7[_0x8206('0x24')]()[_0x8206('0x23')](function(){_0x15fea5[_0x8206('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39c7a7,_0x3f951f){return function(_0x2ecfc7){if(!_0x2ecfc7){_0x39c7a7['sendStatus'](0x194);}return _0x2ecfc7;};}function handleError(_0x2034da,_0x5a626f){_0x5a626f=_0x5a626f||0x1f4;return function(_0x13a190){logger[_0x8206('0x25')](_0x13a190[_0x8206('0x26')]);if(_0x13a190[_0x8206('0x27')]){delete _0x13a190[_0x8206('0x27')];}_0x2034da[_0x8206('0x19')](_0x5a626f)[_0x8206('0x28')](_0x13a190);};}exports[_0x8206('0x29')]=function(_0xb6e23c,_0x510513){var _0x50fd4b={},_0x198972={},_0x5b3932={'count':0x0,'rows':[]};var _0x550dc3=_[_0x8206('0x2a')](db['MailServerOut'][_0x8206('0x2b')],function(_0x2dd1ec){return{'name':_0x2dd1ec[_0x8206('0x2c')],'type':_0x2dd1ec[_0x8206('0x2d')][_0x8206('0x2e')]};});_0x198972[_0x8206('0x2f')]=_['map'](_0x550dc3,_0x8206('0x27'));_0x198972['query']=_[_0x8206('0x30')](_0xb6e23c['query']);_0x198972['filters']=_[_0x8206('0x31')](_0x198972[_0x8206('0x2f')],_0x198972[_0x8206('0x32')]);_0x50fd4b['attributes']=_[_0x8206('0x31')](_0x198972[_0x8206('0x2f')],qs[_0x8206('0x33')](_0xb6e23c[_0x8206('0x32')][_0x8206('0x33')]));_0x50fd4b['attributes']=_0x50fd4b[_0x8206('0x34')][_0x8206('0x35')]?_0x50fd4b[_0x8206('0x34')]:_0x198972['model'];if(!_0xb6e23c[_0x8206('0x32')]['hasOwnProperty'](_0x8206('0x36'))){_0x50fd4b['limit']=qs[_0x8206('0x1b')](_0xb6e23c[_0x8206('0x32')][_0x8206('0x1b')]);_0x50fd4b[_0x8206('0x1c')]=qs[_0x8206('0x1c')](_0xb6e23c['query']['offset']);}_0x50fd4b['order']=qs['sort'](_0xb6e23c[_0x8206('0x32')]['sort']);_0x50fd4b[_0x8206('0x37')]=qs[_0x8206('0x38')](_[_0x8206('0x39')](_0xb6e23c[_0x8206('0x32')],_0x198972['filters']),_0x550dc3);if(_0xb6e23c[_0x8206('0x32')]['filter']){_0x50fd4b[_0x8206('0x37')]=_[_0x8206('0x3a')](_0x50fd4b['where'],{'$or':_[_0x8206('0x2a')](_0x550dc3,function(_0x1b18c1){if(_0x1b18c1[_0x8206('0x2d')]!==_0x8206('0x3b')){var _0x51a671={};_0x51a671[_0x1b18c1[_0x8206('0x27')]]={'$like':'%'+_0xb6e23c[_0x8206('0x32')][_0x8206('0x3c')]+'%'};return _0x51a671;}})});}_0x50fd4b=_[_0x8206('0x3a')]({},_0x50fd4b,_0xb6e23c['options']);var _0x3129e0={'where':_0x50fd4b[_0x8206('0x37')]};return db[_0x8206('0x3d')][_0x8206('0x1d')](_0x3129e0)['then'](function(_0x435dec){_0x5b3932[_0x8206('0x1d')]=_0x435dec;if(_0xb6e23c[_0x8206('0x32')][_0x8206('0x3e')]){_0x50fd4b[_0x8206('0x3f')]=[{'all':!![]}];}return db[_0x8206('0x3d')][_0x8206('0x40')](_0x50fd4b);})[_0x8206('0x23')](function(_0xef3bc){_0x5b3932['rows']=_0xef3bc;return _0x5b3932;})[_0x8206('0x23')](respondWithFilteredResult(_0x510513,_0x50fd4b))[_0x8206('0x41')](handleError(_0x510513,null));};exports[_0x8206('0x42')]=function(_0x3f6cd5,_0x33afe8){var _0x13db34={'raw':!![],'where':{'id':_0x3f6cd5[_0x8206('0x43')]['id']}},_0x747dbf={};_0x747dbf['model']=_[_0x8206('0x30')](db[_0x8206('0x3d')][_0x8206('0x2b')]);_0x747dbf['query']=_[_0x8206('0x30')](_0x3f6cd5['query']);_0x747dbf[_0x8206('0x38')]=_['intersection'](_0x747dbf[_0x8206('0x2f')],_0x747dbf[_0x8206('0x32')]);_0x13db34[_0x8206('0x34')]=_[_0x8206('0x31')](_0x747dbf[_0x8206('0x2f')],qs['fields'](_0x3f6cd5['query']['fields']));_0x13db34['attributes']=_0x13db34[_0x8206('0x34')]['length']?_0x13db34['attributes']:_0x747dbf[_0x8206('0x2f')];if(_0x3f6cd5[_0x8206('0x32')][_0x8206('0x3e')]){_0x13db34[_0x8206('0x3f')]=[{'all':!![]}];}_0x13db34=_['merge']({},_0x13db34,_0x3f6cd5['options']);return db['MailServerOut'][_0x8206('0x44')](_0x13db34)[_0x8206('0x23')](handleEntityNotFound(_0x33afe8,null))[_0x8206('0x23')](respondWithResult(_0x33afe8,null))['catch'](handleError(_0x33afe8,null));};exports['create']=function(_0x1056ef,_0x27114e){return db['MailServerOut'][_0x8206('0x45')](_0x1056ef[_0x8206('0x46')],{})[_0x8206('0x23')](respondWithResult(_0x27114e,0xc9))[_0x8206('0x41')](handleError(_0x27114e,null));};exports[_0x8206('0x22')]=function(_0xefc049,_0x2e07a3){if(_0xefc049[_0x8206('0x46')]['id']){delete _0xefc049[_0x8206('0x46')]['id'];}return db[_0x8206('0x3d')][_0x8206('0x44')]({'where':{'id':_0xefc049['params']['id']}})['then'](handleEntityNotFound(_0x2e07a3,null))[_0x8206('0x23')](saveUpdates(_0xefc049[_0x8206('0x46')],null))[_0x8206('0x23')](respondWithResult(_0x2e07a3,null))['catch'](handleError(_0x2e07a3,null));};exports[_0x8206('0x24')]=function(_0x1da2dc,_0x41e687){return db[_0x8206('0x3d')]['find']({'where':{'id':_0x1da2dc[_0x8206('0x43')]['id']}})[_0x8206('0x23')](handleEntityNotFound(_0x41e687,null))[_0x8206('0x23')](removeEntity(_0x41e687,null))[_0x8206('0x41')](handleError(_0x41e687,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 3607840..297bf5e 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 _0x139b=['./mailServerOut.attributes','exports','MailServerOut','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x139b,0x1c6));var _0xb139=function(_0x6b686d,_0x13bf06){_0x6b686d=_0x6b686d-0x0;var _0x44ab8e=_0x139b[_0x6b686d];return _0x44ab8e;};'use strict';var _=require(_0xb139('0x0'));var util=require(_0xb139('0x1'));var logger=require(_0xb139('0x2'))('api');var moment=require('moment');var BPromise=require(_0xb139('0x3'));var rp=require(_0xb139('0x4'));var fs=require('fs');var path=require(_0xb139('0x5'));var rimraf=require(_0xb139('0x6'));var config=require(_0xb139('0x7'));var attributes=require(_0xb139('0x8'));module[_0xb139('0x9')]=function(_0x5ab4c4,_0x307f7e){return _0x5ab4c4['define'](_0xb139('0xa'),attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa1dc=['exports','define','MailServerOut','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment'];(function(_0x3a48c5,_0x2b7ffd){var _0x56cd79=function(_0x502930){while(--_0x502930){_0x3a48c5['push'](_0x3a48c5['shift']());}};_0x56cd79(++_0x2b7ffd);}(_0xa1dc,0x1d1));var _0xca1d=function(_0x224f17,_0x5097ed){_0x224f17=_0x224f17-0x0;var _0x20d80f=_0xa1dc[_0x224f17];return _0x20d80f;};'use strict';var _=require(_0xca1d('0x0'));var util=require(_0xca1d('0x1'));var logger=require(_0xca1d('0x2'))(_0xca1d('0x3'));var moment=require(_0xca1d('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xca1d('0x5'));var rimraf=require(_0xca1d('0x6'));var config=require(_0xca1d('0x7'));var attributes=require('./mailServerOut.attributes');module[_0xca1d('0x8')]=function(_0x39114a,_0x8e4031){return _0x39114a[_0xca1d('0x9')](_0xca1d('0xa'),attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js index e7383f9..978ee2d 100644 --- a/server/api/mailServerOut/mailServerOut.rpc.js +++ b/server/api/mailServerOut/mailServerOut.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','MailServerOut,\x20%s,\x20%s','MailServerOut,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0xfb0cfd,_0x500179){var _0x2fd8aa=function(_0xccb501){while(--_0xccb501){_0xfb0cfd['push'](_0xfb0cfd['shift']());}};_0x2fd8aa(++_0x500179);}(_0x2ef3,0xba));var _0x32ef=function(_0xd0086e,_0x22b47d){_0xd0086e=_0xd0086e-0x0;var _0x2dcf06=_0x2ef3[_0xd0086e];return _0x2dcf06;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('MailServerOut,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('MailServerOut,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file +var _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(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7a54,0x106));var _0x47a5=function(_0x522425,_0x35526c){_0x522425=_0x522425-0x0;var _0x1f47f2=_0x7a54[_0x522425];return _0x1f47f2;};'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 44f6886..e6d2504 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 _0x245c=['../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','/describe','describe','/:id','isAuthenticated','show','post','create','put','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x2ea8f6,_0x23b546){var _0x54c517=function(_0x211f97){while(--_0x211f97){_0x2ea8f6['push'](_0x2ea8f6['shift']());}};_0x54c517(++_0x23b546);}(_0x245c,0xa9));var _0xc245=function(_0x2097ea,_0x502d35){_0x2097ea=_0x2097ea-0x0;var _0x229136=_0x245c[_0x2097ea];return _0x229136;};'use strict';var multer=require('multer');var util=require(_0xc245('0x0'));var path=require(_0xc245('0x1'));var timeout=require(_0xc245('0x2'));var express=require(_0xc245('0x3'));var router=express[_0xc245('0x4')]();var fs_extra=require(_0xc245('0x5'));var auth=require(_0xc245('0x6'));var interaction=require(_0xc245('0x7'));var config=require(_0xc245('0x8'));var controller=require(_0xc245('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xc245('0xa')](_0xc245('0xb'),auth['isAuthenticated'](),controller[_0xc245('0xc')]);router[_0xc245('0xa')](_0xc245('0xd'),auth[_0xc245('0xe')](),controller[_0xc245('0xf')]);router[_0xc245('0x10')]('/',auth['isAuthenticated'](),controller[_0xc245('0x11')]);router[_0xc245('0x12')](_0xc245('0xd'),auth['isAuthenticated'](),controller[_0xc245('0x13')]);router[_0xc245('0x14')](_0xc245('0xd'),auth[_0xc245('0xe')](),controller['destroy']);module[_0xc245('0x15')]=router; \ No newline at end of file +var _0x3d5e=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','isAuthenticated','index','get','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express'];(function(_0x4e8909,_0x585934){var _0x4ad056=function(_0x3f1b83){while(--_0x3f1b83){_0x4e8909['push'](_0x4e8909['shift']());}};_0x4ad056(++_0x585934);}(_0x3d5e,0x9d));var _0xe3d5=function(_0x1cdaaf,_0x32ba6e){_0x1cdaaf=_0x1cdaaf-0x0;var _0x48f2d4=_0x3d5e[_0x1cdaaf];return _0x48f2d4;};'use strict';var multer=require(_0xe3d5('0x0'));var util=require('util');var path=require(_0xe3d5('0x1'));var timeout=require(_0xe3d5('0x2'));var express=require(_0xe3d5('0x3'));var router=express[_0xe3d5('0x4')]();var fs_extra=require(_0xe3d5('0x5'));var auth=require(_0xe3d5('0x6'));var interaction=require(_0xe3d5('0x7'));var config=require(_0xe3d5('0x8'));var controller=require(_0xe3d5('0x9'));router['get']('/',auth[_0xe3d5('0xa')](),controller[_0xe3d5('0xb')]);router[_0xe3d5('0xc')]('/describe',auth[_0xe3d5('0xa')](),controller[_0xe3d5('0xd')]);router[_0xe3d5('0xc')](_0xe3d5('0xe'),auth[_0xe3d5('0xa')](),controller[_0xe3d5('0xf')]);router[_0xe3d5('0x10')]('/',auth[_0xe3d5('0xa')](),controller[_0xe3d5('0x11')]);router[_0xe3d5('0x12')](_0xe3d5('0xe'),auth[_0xe3d5('0xa')](),controller[_0xe3d5('0x13')]);router[_0xe3d5('0x14')](_0xe3d5('0xe'),auth[_0xe3d5('0xa')](),controller[_0xe3d5('0x15')]);module[_0xe3d5('0x16')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 3c302ac..fa39ea4 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 _0x31f0=['STRING','sequelize'];(function(_0x383158,_0x415e43){var _0x507985=function(_0x1e498e){while(--_0x1e498e){_0x383158['push'](_0x383158['shift']());}};_0x507985(++_0x415e43);}(_0x31f0,0xb7));var _0x031f=function(_0xfff454,_0x1cf303){_0xfff454=_0xfff454-0x0;var _0x2d994d=_0x31f0[_0xfff454];return _0x2d994d;};'use strict';var Sequelize=require(_0x031f('0x0'));module['exports']={'name':{'type':Sequelize[_0x031f('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x031f('0x1')]}}; \ No newline at end of file +var _0xc03e=['sequelize','name'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0xc03e,0x15a));var _0xec03=function(_0x216f7d,_0x496249){_0x216f7d=_0x216f7d-0x0;var _0xc49d7f=_0xc03e[_0x216f7d];return _0xc49d7f;};'use strict';var Sequelize=require(_0xec03('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xec03('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 31e99f0..820247f 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 _0xd374=['pick','filter','where','merge','MailSubstatus','includeAll','include','findAll','catch','show','params','keys','options','create','body','find','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','update','then','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xd374,0x189));var _0x4d37=function(_0xce75,_0x1a0484){_0xce75=_0xce75-0x0;var _0x8e22bb=_0xd374[_0xce75];return _0x8e22bb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4d37('0x0'));var zipdir=require(_0x4d37('0x1'));var jsonpatch=require(_0x4d37('0x2'));var rp=require(_0x4d37('0x3'));var moment=require(_0x4d37('0x4'));var BPromise=require(_0x4d37('0x5'));var Mustache=require(_0x4d37('0x6'));var util=require(_0x4d37('0x7'));var path=require('path');var sox=require(_0x4d37('0x8'));var csv=require(_0x4d37('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4d37('0xa'));var _=require(_0x4d37('0xb'));var squel=require(_0x4d37('0xc'));var crypto=require(_0x4d37('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4d37('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4d37('0xe'));var authService=require(_0x4d37('0xf'));var qs=require(_0x4d37('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4d37('0x11'))(_0x4d37('0x12'));var utils=require(_0x4d37('0x13'));var config=require(_0x4d37('0x14'));var licenseUtil=require(_0x4d37('0x15'));var db=require(_0x4d37('0x16'))['db'];function respondWithStatusCode(_0x421710,_0x43da4a){_0x43da4a=_0x43da4a||0xcc;return function(_0x396d4c){if(_0x396d4c){return _0x421710[_0x4d37('0x17')](_0x43da4a);}return _0x421710[_0x4d37('0x18')](_0x43da4a)[_0x4d37('0x19')]();};}function respondWithResult(_0x35cc41,_0x4a6d2e){_0x4a6d2e=_0x4a6d2e||0xc8;return function(_0xca6224){if(_0xca6224){return _0x35cc41['status'](_0x4a6d2e)['json'](_0xca6224);}};}function respondWithFilteredResult(_0x38d1b1,_0x104eb1){return function(_0x2fbdff){if(_0x2fbdff){var _0x408893=typeof _0x104eb1[_0x4d37('0x1a')]===_0x4d37('0x1b')&&typeof _0x104eb1['limit']==='undefined';var _0x4e445c=_0x2fbdff[_0x4d37('0x1c')];var _0x1b60b9=_0x408893?0x0:_0x104eb1[_0x4d37('0x1a')];var _0x385c7a=_0x408893?_0x2fbdff['count']:_0x104eb1[_0x4d37('0x1a')]+_0x104eb1[_0x4d37('0x1d')];var _0x23e022;if(_0x385c7a>=_0x4e445c){_0x385c7a=_0x4e445c;_0x23e022=0xc8;}else{_0x23e022=0xce;}_0x38d1b1[_0x4d37('0x18')](_0x23e022);return _0x38d1b1[_0x4d37('0x1e')](_0x4d37('0x1f'),_0x1b60b9+'-'+_0x385c7a+'/'+_0x4e445c)[_0x4d37('0x20')](_0x2fbdff);}return null;};}function patchUpdates(_0x497bde){return function(_0x4eada3){try{jsonpatch[_0x4d37('0x21')](_0x4eada3,_0x497bde,!![]);}catch(_0x1e2325){return BPromise[_0x4d37('0x22')](_0x1e2325);}return _0x4eada3['save']();};}function saveUpdates(_0x2aa74a,_0x1b4422){return function(_0x302809){if(_0x302809){return _0x302809[_0x4d37('0x23')](_0x2aa74a)[_0x4d37('0x24')](function(_0x12beb3){return _0x12beb3;});}return null;};}function removeEntity(_0x12c543,_0x522cea){return function(_0x5db18d){if(_0x5db18d){return _0x5db18d['destroy']()[_0x4d37('0x24')](function(){_0x12c543['status'](0xcc)[_0x4d37('0x19')]();});}};}function handleEntityNotFound(_0x148efa,_0x8427af){return function(_0x2812e9){if(!_0x2812e9){_0x148efa[_0x4d37('0x17')](0x194);}return _0x2812e9;};}function handleError(_0xf42763,_0x48f937){_0x48f937=_0x48f937||0x1f4;return function(_0x25eeef){logger[_0x4d37('0x25')](_0x25eeef[_0x4d37('0x26')]);if(_0x25eeef[_0x4d37('0x27')]){delete _0x25eeef['name'];}_0xf42763[_0x4d37('0x18')](_0x48f937)[_0x4d37('0x28')](_0x25eeef);};}exports['index']=function(_0xa81317,_0x585aab){var _0x5cde5={},_0x15772e={},_0xfe75cc={'count':0x0,'rows':[]};var _0x527069=_[_0x4d37('0x29')](db['MailSubstatus'][_0x4d37('0x2a')],function(_0x2267c7){return{'name':_0x2267c7[_0x4d37('0x2b')],'type':_0x2267c7[_0x4d37('0x2c')][_0x4d37('0x2d')]};});_0x15772e[_0x4d37('0x2e')]=_['map'](_0x527069,_0x4d37('0x27'));_0x15772e['query']=_['keys'](_0xa81317[_0x4d37('0x2f')]);_0x15772e['filters']=_[_0x4d37('0x30')](_0x15772e[_0x4d37('0x2e')],_0x15772e[_0x4d37('0x2f')]);_0x5cde5[_0x4d37('0x31')]=_['intersection'](_0x15772e[_0x4d37('0x2e')],qs[_0x4d37('0x32')](_0xa81317[_0x4d37('0x2f')][_0x4d37('0x32')]));_0x5cde5[_0x4d37('0x31')]=_0x5cde5[_0x4d37('0x31')][_0x4d37('0x33')]?_0x5cde5[_0x4d37('0x31')]:_0x15772e['model'];if(!_0xa81317['query'][_0x4d37('0x34')](_0x4d37('0x35'))){_0x5cde5[_0x4d37('0x1d')]=qs[_0x4d37('0x1d')](_0xa81317[_0x4d37('0x2f')][_0x4d37('0x1d')]);_0x5cde5[_0x4d37('0x1a')]=qs[_0x4d37('0x1a')](_0xa81317[_0x4d37('0x2f')][_0x4d37('0x1a')]);}_0x5cde5[_0x4d37('0x36')]=qs[_0x4d37('0x37')](_0xa81317[_0x4d37('0x2f')][_0x4d37('0x37')]);_0x5cde5['where']=qs[_0x4d37('0x38')](_[_0x4d37('0x39')](_0xa81317[_0x4d37('0x2f')],_0x15772e[_0x4d37('0x38')]),_0x527069);if(_0xa81317[_0x4d37('0x2f')][_0x4d37('0x3a')]){_0x5cde5[_0x4d37('0x3b')]=_[_0x4d37('0x3c')](_0x5cde5[_0x4d37('0x3b')],{'$or':_[_0x4d37('0x29')](_0x527069,function(_0x4a9fdd){if(_0x4a9fdd['type']!=='VIRTUAL'){var _0x23dfd6={};_0x23dfd6[_0x4a9fdd[_0x4d37('0x27')]]={'$like':'%'+_0xa81317[_0x4d37('0x2f')]['filter']+'%'};return _0x23dfd6;}})});}_0x5cde5=_[_0x4d37('0x3c')]({},_0x5cde5,_0xa81317['options']);var _0x139905={'where':_0x5cde5[_0x4d37('0x3b')]};return db[_0x4d37('0x3d')]['count'](_0x139905)['then'](function(_0x54120e){_0xfe75cc[_0x4d37('0x1c')]=_0x54120e;if(_0xa81317[_0x4d37('0x2f')][_0x4d37('0x3e')]){_0x5cde5[_0x4d37('0x3f')]=[{'all':!![]}];}return db[_0x4d37('0x3d')][_0x4d37('0x40')](_0x5cde5);})['then'](function(_0x219eae){_0xfe75cc['rows']=_0x219eae;return _0xfe75cc;})['then'](respondWithFilteredResult(_0x585aab,_0x5cde5))[_0x4d37('0x41')](handleError(_0x585aab,null));};exports[_0x4d37('0x42')]=function(_0x3f080f,_0x4ba9d1){var _0x4343ca={'raw':!![],'where':{'id':_0x3f080f[_0x4d37('0x43')]['id']}},_0x57e10e={};_0x57e10e[_0x4d37('0x2e')]=_[_0x4d37('0x44')](db[_0x4d37('0x3d')][_0x4d37('0x2a')]);_0x57e10e[_0x4d37('0x2f')]=_[_0x4d37('0x44')](_0x3f080f[_0x4d37('0x2f')]);_0x57e10e[_0x4d37('0x38')]=_[_0x4d37('0x30')](_0x57e10e['model'],_0x57e10e[_0x4d37('0x2f')]);_0x4343ca[_0x4d37('0x31')]=_['intersection'](_0x57e10e['model'],qs[_0x4d37('0x32')](_0x3f080f[_0x4d37('0x2f')][_0x4d37('0x32')]));_0x4343ca[_0x4d37('0x31')]=_0x4343ca[_0x4d37('0x31')][_0x4d37('0x33')]?_0x4343ca[_0x4d37('0x31')]:_0x57e10e[_0x4d37('0x2e')];if(_0x3f080f[_0x4d37('0x2f')][_0x4d37('0x3e')]){_0x4343ca[_0x4d37('0x3f')]=[{'all':!![]}];}_0x4343ca=_[_0x4d37('0x3c')]({},_0x4343ca,_0x3f080f[_0x4d37('0x45')]);return db['MailSubstatus']['find'](_0x4343ca)[_0x4d37('0x24')](handleEntityNotFound(_0x4ba9d1,null))[_0x4d37('0x24')](respondWithResult(_0x4ba9d1,null))[_0x4d37('0x41')](handleError(_0x4ba9d1,null));};exports['create']=function(_0x45dfcc,_0x11b504){return db['MailSubstatus'][_0x4d37('0x46')](_0x45dfcc[_0x4d37('0x47')],{})[_0x4d37('0x24')](respondWithResult(_0x11b504,0xc9))['catch'](handleError(_0x11b504,null));};exports['update']=function(_0x24ecf9,_0x3e218e){if(_0x24ecf9[_0x4d37('0x47')]['id']){delete _0x24ecf9['body']['id'];}return db[_0x4d37('0x3d')][_0x4d37('0x48')]({'where':{'id':_0x24ecf9[_0x4d37('0x43')]['id']}})[_0x4d37('0x24')](handleEntityNotFound(_0x3e218e,null))[_0x4d37('0x24')](saveUpdates(_0x24ecf9[_0x4d37('0x47')],null))[_0x4d37('0x24')](respondWithResult(_0x3e218e,null))[_0x4d37('0x41')](handleError(_0x3e218e,null));};exports[_0x4d37('0x49')]=function(_0x400bf5,_0x111086){return db[_0x4d37('0x3d')][_0x4d37('0x48')]({'where':{'id':_0x400bf5[_0x4d37('0x43')]['id']}})[_0x4d37('0x24')](handleEntityNotFound(_0x111086,null))[_0x4d37('0x24')](removeEntity(_0x111086,null))['catch'](handleError(_0x111086,null));};exports['describe']=function(_0x3d29b7,_0x3d7dd2){return db[_0x4d37('0x3d')][_0x4d37('0x4a')]()['then'](respondWithResult(_0x3d7dd2,null))[_0x4d37('0x41')](handleError(_0x3d7dd2,null));}; \ No newline at end of file +var _0xfc40=['undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','MailSubstatus','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','keys','rawAttributes','length','find','create','body','params','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json'];(function(_0x4e3cda,_0x44c3f1){var _0x42c4b0=function(_0x218db6){while(--_0x218db6){_0x4e3cda['push'](_0x4e3cda['shift']());}};_0x42c4b0(++_0x44c3f1);}(_0xfc40,0x108));var _0x0fc4=function(_0xcb26e4,_0x5baf0b){_0xcb26e4=_0xcb26e4-0x0;var _0x34fae4=_0xfc40[_0xcb26e4];return _0x34fae4;};'use strict';var emlformat=require(_0x0fc4('0x0'));var rimraf=require(_0x0fc4('0x1'));var zipdir=require(_0x0fc4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0fc4('0x3'));var moment=require('moment');var BPromise=require(_0x0fc4('0x4'));var Mustache=require(_0x0fc4('0x5'));var util=require('util');var path=require(_0x0fc4('0x6'));var sox=require('sox');var csv=require(_0x0fc4('0x7'));var ejs=require(_0x0fc4('0x8'));var fs=require('fs');var fs_extra=require(_0x0fc4('0x9'));var _=require(_0x0fc4('0xa'));var squel=require(_0x0fc4('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0fc4('0xc'));var Papa=require(_0x0fc4('0xd'));var Redis=require('ioredis');var authService=require(_0x0fc4('0xe'));var qs=require(_0x0fc4('0xf'));var as=require(_0x0fc4('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0fc4('0x11'))('api');var utils=require(_0x0fc4('0x12'));var config=require(_0x0fc4('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x0fc4('0x14'))['db'];function respondWithStatusCode(_0x50f3d8,_0x4e036d){_0x4e036d=_0x4e036d||0xcc;return function(_0x22943d){if(_0x22943d){return _0x50f3d8['sendStatus'](_0x4e036d);}return _0x50f3d8[_0x0fc4('0x15')](_0x4e036d)[_0x0fc4('0x16')]();};}function respondWithResult(_0x4d561d,_0xea7409){_0xea7409=_0xea7409||0xc8;return function(_0x1e978d){if(_0x1e978d){return _0x4d561d['status'](_0xea7409)[_0x0fc4('0x17')](_0x1e978d);}};}function respondWithFilteredResult(_0x1ab146,_0x43701d){return function(_0x47425d){if(_0x47425d){var _0x59b386=typeof _0x43701d['offset']===_0x0fc4('0x18')&&typeof _0x43701d[_0x0fc4('0x19')]==='undefined';var _0x3260be=_0x47425d[_0x0fc4('0x1a')];var _0x4f084f=_0x59b386?0x0:_0x43701d[_0x0fc4('0x1b')];var _0x266199=_0x59b386?_0x47425d['count']:_0x43701d[_0x0fc4('0x1b')]+_0x43701d['limit'];var _0x493683;if(_0x266199>=_0x3260be){_0x266199=_0x3260be;_0x493683=0xc8;}else{_0x493683=0xce;}_0x1ab146[_0x0fc4('0x15')](_0x493683);return _0x1ab146[_0x0fc4('0x1c')](_0x0fc4('0x1d'),_0x4f084f+'-'+_0x266199+'/'+_0x3260be)['json'](_0x47425d);}return null;};}function patchUpdates(_0x14775e){return function(_0x3c1318){try{jsonpatch[_0x0fc4('0x1e')](_0x3c1318,_0x14775e,!![]);}catch(_0x6bf6ad){return BPromise[_0x0fc4('0x1f')](_0x6bf6ad);}return _0x3c1318[_0x0fc4('0x20')]();};}function saveUpdates(_0xe7b729,_0x242ca5){return function(_0x342764){if(_0x342764){return _0x342764[_0x0fc4('0x21')](_0xe7b729)[_0x0fc4('0x22')](function(_0x57f563){return _0x57f563;});}return null;};}function removeEntity(_0xa6c1a9,_0x391b3a){return function(_0x1dc603){if(_0x1dc603){return _0x1dc603[_0x0fc4('0x23')]()[_0x0fc4('0x22')](function(){_0xa6c1a9[_0x0fc4('0x15')](0xcc)[_0x0fc4('0x16')]();});}};}function handleEntityNotFound(_0x826964,_0x49d304){return function(_0x572089){if(!_0x572089){_0x826964['sendStatus'](0x194);}return _0x572089;};}function handleError(_0x194f23,_0x181c15){_0x181c15=_0x181c15||0x1f4;return function(_0x4970d8){logger['error'](_0x4970d8[_0x0fc4('0x24')]);if(_0x4970d8[_0x0fc4('0x25')]){delete _0x4970d8[_0x0fc4('0x25')];}_0x194f23[_0x0fc4('0x15')](_0x181c15)[_0x0fc4('0x26')](_0x4970d8);};}exports[_0x0fc4('0x27')]=function(_0x54fb81,_0x4e6edd){var _0xf9aba9={},_0x32dd79={},_0x2acdc7={'count':0x0,'rows':[]};var _0x53ebbe=_[_0x0fc4('0x28')](db[_0x0fc4('0x29')]['rawAttributes'],function(_0x2a7958){return{'name':_0x2a7958[_0x0fc4('0x2a')],'type':_0x2a7958[_0x0fc4('0x2b')]['key']};});_0x32dd79[_0x0fc4('0x2c')]=_[_0x0fc4('0x28')](_0x53ebbe,_0x0fc4('0x25'));_0x32dd79[_0x0fc4('0x2d')]=_['keys'](_0x54fb81[_0x0fc4('0x2d')]);_0x32dd79[_0x0fc4('0x2e')]=_[_0x0fc4('0x2f')](_0x32dd79[_0x0fc4('0x2c')],_0x32dd79[_0x0fc4('0x2d')]);_0xf9aba9[_0x0fc4('0x30')]=_['intersection'](_0x32dd79[_0x0fc4('0x2c')],qs['fields'](_0x54fb81[_0x0fc4('0x2d')][_0x0fc4('0x31')]));_0xf9aba9[_0x0fc4('0x30')]=_0xf9aba9[_0x0fc4('0x30')]['length']?_0xf9aba9[_0x0fc4('0x30')]:_0x32dd79[_0x0fc4('0x2c')];if(!_0x54fb81[_0x0fc4('0x2d')][_0x0fc4('0x32')](_0x0fc4('0x33'))){_0xf9aba9['limit']=qs['limit'](_0x54fb81['query']['limit']);_0xf9aba9[_0x0fc4('0x1b')]=qs['offset'](_0x54fb81['query'][_0x0fc4('0x1b')]);}_0xf9aba9[_0x0fc4('0x34')]=qs['sort'](_0x54fb81['query']['sort']);_0xf9aba9[_0x0fc4('0x35')]=qs[_0x0fc4('0x2e')](_[_0x0fc4('0x36')](_0x54fb81[_0x0fc4('0x2d')],_0x32dd79[_0x0fc4('0x2e')]),_0x53ebbe);if(_0x54fb81[_0x0fc4('0x2d')][_0x0fc4('0x37')]){_0xf9aba9[_0x0fc4('0x35')]=_[_0x0fc4('0x38')](_0xf9aba9['where'],{'$or':_[_0x0fc4('0x28')](_0x53ebbe,function(_0x12eeac){if(_0x12eeac[_0x0fc4('0x2b')]!=='VIRTUAL'){var _0x303e04={};_0x303e04[_0x12eeac[_0x0fc4('0x25')]]={'$like':'%'+_0x54fb81[_0x0fc4('0x2d')][_0x0fc4('0x37')]+'%'};return _0x303e04;}})});}_0xf9aba9=_[_0x0fc4('0x38')]({},_0xf9aba9,_0x54fb81[_0x0fc4('0x39')]);var _0x48712b={'where':_0xf9aba9[_0x0fc4('0x35')]};return db[_0x0fc4('0x29')]['count'](_0x48712b)['then'](function(_0x119103){_0x2acdc7[_0x0fc4('0x1a')]=_0x119103;if(_0x54fb81[_0x0fc4('0x2d')][_0x0fc4('0x3a')]){_0xf9aba9[_0x0fc4('0x3b')]=[{'all':!![]}];}return db[_0x0fc4('0x29')][_0x0fc4('0x3c')](_0xf9aba9);})[_0x0fc4('0x22')](function(_0x13bb55){_0x2acdc7[_0x0fc4('0x3d')]=_0x13bb55;return _0x2acdc7;})['then'](respondWithFilteredResult(_0x4e6edd,_0xf9aba9))[_0x0fc4('0x3e')](handleError(_0x4e6edd,null));};exports[_0x0fc4('0x3f')]=function(_0x3fbc17,_0x2a0347){var _0x2614e5={'raw':!![],'where':{'id':_0x3fbc17['params']['id']}},_0xdd3e9b={};_0xdd3e9b[_0x0fc4('0x2c')]=_[_0x0fc4('0x40')](db[_0x0fc4('0x29')][_0x0fc4('0x41')]);_0xdd3e9b[_0x0fc4('0x2d')]=_[_0x0fc4('0x40')](_0x3fbc17[_0x0fc4('0x2d')]);_0xdd3e9b['filters']=_[_0x0fc4('0x2f')](_0xdd3e9b[_0x0fc4('0x2c')],_0xdd3e9b[_0x0fc4('0x2d')]);_0x2614e5['attributes']=_['intersection'](_0xdd3e9b[_0x0fc4('0x2c')],qs[_0x0fc4('0x31')](_0x3fbc17['query'][_0x0fc4('0x31')]));_0x2614e5[_0x0fc4('0x30')]=_0x2614e5['attributes'][_0x0fc4('0x42')]?_0x2614e5['attributes']:_0xdd3e9b['model'];if(_0x3fbc17[_0x0fc4('0x2d')][_0x0fc4('0x3a')]){_0x2614e5[_0x0fc4('0x3b')]=[{'all':!![]}];}_0x2614e5=_[_0x0fc4('0x38')]({},_0x2614e5,_0x3fbc17[_0x0fc4('0x39')]);return db[_0x0fc4('0x29')][_0x0fc4('0x43')](_0x2614e5)[_0x0fc4('0x22')](handleEntityNotFound(_0x2a0347,null))[_0x0fc4('0x22')](respondWithResult(_0x2a0347,null))[_0x0fc4('0x3e')](handleError(_0x2a0347,null));};exports['create']=function(_0x4c3b01,_0x539cb0){return db[_0x0fc4('0x29')][_0x0fc4('0x44')](_0x4c3b01['body'],{})['then'](respondWithResult(_0x539cb0,0xc9))['catch'](handleError(_0x539cb0,null));};exports['update']=function(_0x2961b7,_0xe07153){if(_0x2961b7[_0x0fc4('0x45')]['id']){delete _0x2961b7[_0x0fc4('0x45')]['id'];}return db[_0x0fc4('0x29')]['find']({'where':{'id':_0x2961b7[_0x0fc4('0x46')]['id']}})['then'](handleEntityNotFound(_0xe07153,null))[_0x0fc4('0x22')](saveUpdates(_0x2961b7[_0x0fc4('0x45')],null))[_0x0fc4('0x22')](respondWithResult(_0xe07153,null))['catch'](handleError(_0xe07153,null));};exports[_0x0fc4('0x23')]=function(_0x573af3,_0x5a0908){return db[_0x0fc4('0x29')][_0x0fc4('0x43')]({'where':{'id':_0x573af3[_0x0fc4('0x46')]['id']}})[_0x0fc4('0x22')](handleEntityNotFound(_0x5a0908,null))[_0x0fc4('0x22')](removeEntity(_0x5a0908,null))[_0x0fc4('0x3e')](handleError(_0x5a0908,null));};exports[_0x0fc4('0x47')]=function(_0x4aa0aa,_0x3c23ee){return db[_0x0fc4('0x29')][_0x0fc4('0x47')]()[_0x0fc4('0x22')](respondWithResult(_0x3c23ee,null))[_0x0fc4('0x3e')](handleError(_0x3c23ee,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 6805608..0fd8ecb 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 _0xcfef=['../../config/logger','api','bluebird','request-promise','path','exports','lodash','util'];(function(_0x46cb09,_0x184159){var _0x234867=function(_0x27364a){while(--_0x27364a){_0x46cb09['push'](_0x46cb09['shift']());}};_0x234867(++_0x184159);}(_0xcfef,0x86));var _0xfcfe=function(_0x2fdf18,_0x61958c){_0x2fdf18=_0x2fdf18-0x0;var _0x207782=_0xcfef[_0x2fdf18];return _0x207782;};'use strict';var _=require(_0xfcfe('0x0'));var util=require(_0xfcfe('0x1'));var logger=require(_0xfcfe('0x2'))(_0xfcfe('0x3'));var moment=require('moment');var BPromise=require(_0xfcfe('0x4'));var rp=require(_0xfcfe('0x5'));var fs=require('fs');var path=require(_0xfcfe('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./mailSubstatus.attributes');module[_0xfcfe('0x7')]=function(_0x1568a3,_0x502f6){return _0x1568a3['define']('MailSubstatus',attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3e2a=['request-promise','path','rimraf','../../config/environment','./mailSubstatus.attributes','define','MailSubstatus','mail_substatuses','lodash','util','../../config/logger','bluebird'];(function(_0x1f406d,_0x513361){var _0xe28eb1=function(_0x1dda0c){while(--_0x1dda0c){_0x1f406d['push'](_0x1f406d['shift']());}};_0xe28eb1(++_0x513361);}(_0x3e2a,0x1b8));var _0xa3e2=function(_0x752093,_0x2e2670){_0x752093=_0x752093-0x0;var _0x3a6ab5=_0x3e2a[_0x752093];return _0x3a6ab5;};'use strict';var _=require(_0xa3e2('0x0'));var util=require(_0xa3e2('0x1'));var logger=require(_0xa3e2('0x2'))('api');var moment=require('moment');var BPromise=require(_0xa3e2('0x3'));var rp=require(_0xa3e2('0x4'));var fs=require('fs');var path=require(_0xa3e2('0x5'));var rimraf=require(_0xa3e2('0x6'));var config=require(_0xa3e2('0x7'));var attributes=require(_0xa3e2('0x8'));module['exports']=function(_0x52bb67,_0x45168c){return _0x52bb67[_0xa3e2('0x9')](_0xa3e2('0xa'),attributes,{'tableName':_0xa3e2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 361516b..736fb3f 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 _0xfa9e=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','randomstring'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xfa9e,0xad));var _0xefa9=function(_0xa6ef1a,_0x3cdf3e){_0xa6ef1a=_0xa6ef1a-0x0;var _0x3448ad=_0xfa9e[_0xa6ef1a];return _0x3448ad;};'use strict';var _=require(_0xefa9('0x0'));var util=require('util');var moment=require(_0xefa9('0x1'));var BPromise=require('bluebird');var rs=require(_0xefa9('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xefa9('0x3'));var logger=require(_0xefa9('0x4'))(_0xefa9('0x5'));var config=require(_0xefa9('0x6'));var jayson=require(_0xefa9('0x7'));var client=jayson[_0xefa9('0x8')][_0xefa9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xae770c,_0x4e941e,_0x3b555a){return new BPromise(function(_0x5a5583,_0x59b36e){return client[_0xefa9('0xa')](_0xae770c,_0x3b555a)[_0xefa9('0xb')](function(_0x9b9586){logger[_0xefa9('0xc')](_0xefa9('0xd'),_0x4e941e,_0xefa9('0xe'));logger[_0xefa9('0xf')](_0xefa9('0x10'),_0x4e941e,_0xefa9('0xe'),JSON[_0xefa9('0x11')](_0x9b9586));if(_0x9b9586[_0xefa9('0x12')]){if(_0x9b9586[_0xefa9('0x12')][_0xefa9('0x13')]===0x1f4){logger[_0xefa9('0x12')](_0xefa9('0xd'),_0x4e941e,_0x9b9586[_0xefa9('0x12')][_0xefa9('0x14')]);return _0x59b36e(_0x9b9586['error'][_0xefa9('0x14')]);}logger[_0xefa9('0x12')](_0xefa9('0xd'),_0x4e941e,_0x9b9586[_0xefa9('0x12')]['message']);return _0x5a5583(_0x9b9586['error'][_0xefa9('0x14')]);}else{logger['info'](_0xefa9('0xd'),_0x4e941e,_0xefa9('0xe'));_0x5a5583(_0x9b9586['result'][_0xefa9('0x14')]);}})[_0xefa9('0x15')](function(_0x1f50dd){logger[_0xefa9('0x12')](_0xefa9('0xd'),_0x4e941e,_0x1f50dd);_0x59b36e(_0x1f50dd);});});} \ No newline at end of file +var _0x23f9=['request\x20sent','debug','stringify','error','code','message','MailSubstatus,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','info'];(function(_0x81a741,_0x53911d){var _0xadb73=function(_0x4f5677){while(--_0x4f5677){_0x81a741['push'](_0x81a741['shift']());}};_0xadb73(++_0x53911d);}(_0x23f9,0x1d7));var _0x923f=function(_0x515661,_0x36a15d){_0x515661=_0x515661-0x0;var _0x1bf063=_0x23f9[_0x515661];return _0x1bf063;};'use strict';var _=require(_0x923f('0x0'));var util=require(_0x923f('0x1'));var moment=require(_0x923f('0x2'));var BPromise=require(_0x923f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x923f('0x4'));var db=require(_0x923f('0x5'))['db'];var utils=require(_0x923f('0x6'));var logger=require(_0x923f('0x7'))(_0x923f('0x8'));var config=require('../../config/environment');var jayson=require(_0x923f('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4c709,_0x14968f,_0x2d3a29){return new BPromise(function(_0x4cd4af,_0x18b809){return client[_0x923f('0xa')](_0x4c709,_0x2d3a29)['then'](function(_0x49c19c){logger[_0x923f('0xb')]('MailSubstatus,\x20%s,\x20%s',_0x14968f,_0x923f('0xc'));logger[_0x923f('0xd')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x14968f,_0x923f('0xc'),JSON[_0x923f('0xe')](_0x49c19c));if(_0x49c19c[_0x923f('0xf')]){if(_0x49c19c[_0x923f('0xf')][_0x923f('0x10')]===0x1f4){logger[_0x923f('0xf')]('MailSubstatus,\x20%s,\x20%s',_0x14968f,_0x49c19c[_0x923f('0xf')][_0x923f('0x11')]);return _0x18b809(_0x49c19c[_0x923f('0xf')][_0x923f('0x11')]);}logger[_0x923f('0xf')](_0x923f('0x12'),_0x14968f,_0x49c19c[_0x923f('0xf')][_0x923f('0x11')]);return _0x4cd4af(_0x49c19c[_0x923f('0xf')][_0x923f('0x11')]);}else{logger[_0x923f('0xb')](_0x923f('0x12'),_0x14968f,_0x923f('0xc'));_0x4cd4af(_0x49c19c[_0x923f('0x13')][_0x923f('0x11')]);}})[_0x923f('0x14')](function(_0x1b3759){logger['error'](_0x923f('0x12'),_0x14968f,_0x1b3759);_0x18b809(_0x1b3759);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index db2021f..ce1febb 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 _0xc678=['index','/describe','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x321c48,_0x2a88a5){var _0x417d8c=function(_0x34c64b){while(--_0x34c64b){_0x321c48['push'](_0x321c48['shift']());}};_0x417d8c(++_0x2a88a5);}(_0xc678,0xba));var _0x8c67=function(_0x2869af,_0x1d3bcf){_0x2869af=_0x2869af-0x0;var _0x3d7dea=_0xc678[_0x2869af];return _0x3d7dea;};'use strict';var multer=require(_0x8c67('0x0'));var util=require(_0x8c67('0x1'));var path=require(_0x8c67('0x2'));var timeout=require(_0x8c67('0x3'));var express=require(_0x8c67('0x4'));var router=express[_0x8c67('0x5')]();var fs_extra=require(_0x8c67('0x6'));var auth=require(_0x8c67('0x7'));var interaction=require(_0x8c67('0x8'));var config=require(_0x8c67('0x9'));var controller=require('./mailTransferReport.controller');router[_0x8c67('0xa')]('/',auth[_0x8c67('0xb')](),controller[_0x8c67('0xc')]);router[_0x8c67('0xa')](_0x8c67('0xd'),auth[_0x8c67('0xb')](),controller['describe']);router['get'](_0x8c67('0xe'),auth['isAuthenticated'](),controller[_0x8c67('0xf')]);router[_0x8c67('0x10')]('/',auth[_0x8c67('0xb')](),controller[_0x8c67('0x11')]);router['put']('/:id',auth[_0x8c67('0xb')](),controller[_0x8c67('0x12')]);router[_0x8c67('0x13')](_0x8c67('0xe'),auth[_0x8c67('0xb')](),controller[_0x8c67('0x14')]);module[_0x8c67('0x15')]=router; \ No newline at end of file +var _0xbeba=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','update','delete','destroy'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xbeba,0x9a));var _0xabeb=function(_0x479eee,_0x2f91fa){_0x479eee=_0x479eee-0x0;var _0x3f3d66=_0xbeba[_0x479eee];return _0x3f3d66;};'use strict';var multer=require(_0xabeb('0x0'));var util=require(_0xabeb('0x1'));var path=require(_0xabeb('0x2'));var timeout=require(_0xabeb('0x3'));var express=require('express');var router=express[_0xabeb('0x4')]();var fs_extra=require(_0xabeb('0x5'));var auth=require(_0xabeb('0x6'));var interaction=require(_0xabeb('0x7'));var config=require(_0xabeb('0x8'));var controller=require(_0xabeb('0x9'));router['get']('/',auth[_0xabeb('0xa')](),controller[_0xabeb('0xb')]);router[_0xabeb('0xc')](_0xabeb('0xd'),auth[_0xabeb('0xa')](),controller[_0xabeb('0xe')]);router['get'](_0xabeb('0xf'),auth['isAuthenticated'](),controller[_0xabeb('0x10')]);router[_0xabeb('0x11')]('/',auth[_0xabeb('0xa')](),controller[_0xabeb('0x12')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xabeb('0x13')]);router[_0xabeb('0x14')](_0xabeb('0xf'),auth['isAuthenticated'](),controller[_0xabeb('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index a3a2f00..9ee3cb5 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 _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x54ef,0x112));var _0xf54e=function(_0x5210e1,_0x167ee4){_0x5210e1=_0x5210e1-0x0;var _0x17c602=_0x54ef[_0x5210e1];return _0x17c602;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}}; \ No newline at end of file +var _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x3d69cb,_0x4bab98){var _0x1155c0=function(_0x1ec8f0){while(--_0x1ec8f0){_0x3d69cb['push'](_0x3d69cb['shift']());}};_0x1155c0(++_0x4bab98);}(_0xedd9,0xfc));var _0x9edd=function(_0x482c5c,_0x5d8108){_0x482c5c=_0x482c5c-0x0;var _0x10826a=_0xedd9[_0x482c5c];return _0x10826a;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 5c14963..e3ca14c 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 _0xe1af=['model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','merge','where','type','VIRTUAL','options','count','include','findAll','then','rows','catch','show','keys','includeAll','create','body','find','destroy','describe','eml-format','rimraf','zip-dir','moment','mustache','util','sox','ejs','fs-extra','lodash','squel','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','offset','limit','Content-Range','apply','reject','update','error','name','send','map','MailTransferReport','rawAttributes','fieldName','key'];(function(_0x43f2fd,_0x4eb9b9){var _0x28b4b8=function(_0x47b844){while(--_0x47b844){_0x43f2fd['push'](_0x43f2fd['shift']());}};_0x28b4b8(++_0x4eb9b9);}(_0xe1af,0xb1));var _0xfe1a=function(_0x2de564,_0x14ac58){_0x2de564=_0x2de564-0x0;var _0x5b7809=_0xe1af[_0x2de564];return _0x5b7809;};'use strict';var emlformat=require(_0xfe1a('0x0'));var rimraf=require(_0xfe1a('0x1'));var zipdir=require(_0xfe1a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xfe1a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xfe1a('0x4'));var util=require(_0xfe1a('0x5'));var path=require('path');var sox=require(_0xfe1a('0x6'));var csv=require('to-csv');var ejs=require(_0xfe1a('0x7'));var fs=require('fs');var fs_extra=require(_0xfe1a('0x8'));var _=require(_0xfe1a('0x9'));var squel=require(_0xfe1a('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xfe1a('0xb'));var querystring=require(_0xfe1a('0xc'));var Papa=require(_0xfe1a('0xd'));var Redis=require(_0xfe1a('0xe'));var authService=require(_0xfe1a('0xf'));var qs=require(_0xfe1a('0x10'));var as=require(_0xfe1a('0x11'));var hardwareService=require(_0xfe1a('0x12'));var logger=require(_0xfe1a('0x13'))('api');var utils=require(_0xfe1a('0x14'));var config=require(_0xfe1a('0x15'));var licenseUtil=require(_0xfe1a('0x16'));var db=require(_0xfe1a('0x17'))['db'];function respondWithStatusCode(_0x53182b,_0x967d7b){_0x967d7b=_0x967d7b||0xcc;return function(_0xfe38bf){if(_0xfe38bf){return _0x53182b[_0xfe1a('0x18')](_0x967d7b);}return _0x53182b[_0xfe1a('0x19')](_0x967d7b)['end']();};}function respondWithResult(_0x2b31fc,_0x18e6fc){_0x18e6fc=_0x18e6fc||0xc8;return function(_0x42811b){if(_0x42811b){return _0x2b31fc['status'](_0x18e6fc)[_0xfe1a('0x1a')](_0x42811b);}};}function respondWithFilteredResult(_0xb98972,_0x59615a){return function(_0x2d9bdb){if(_0x2d9bdb){var _0x3b1b3a=typeof _0x59615a['offset']===_0xfe1a('0x1b')&&typeof _0x59615a['limit']===_0xfe1a('0x1b');var _0x5df9cb=_0x2d9bdb['count'];var _0x562f9f=_0x3b1b3a?0x0:_0x59615a[_0xfe1a('0x1c')];var _0x4ea822=_0x3b1b3a?_0x2d9bdb['count']:_0x59615a[_0xfe1a('0x1c')]+_0x59615a[_0xfe1a('0x1d')];var _0x5ee2c5;if(_0x4ea822>=_0x5df9cb){_0x4ea822=_0x5df9cb;_0x5ee2c5=0xc8;}else{_0x5ee2c5=0xce;}_0xb98972[_0xfe1a('0x19')](_0x5ee2c5);return _0xb98972['set'](_0xfe1a('0x1e'),_0x562f9f+'-'+_0x4ea822+'/'+_0x5df9cb)[_0xfe1a('0x1a')](_0x2d9bdb);}return null;};}function patchUpdates(_0x407f64){return function(_0x5f1f8e){try{jsonpatch[_0xfe1a('0x1f')](_0x5f1f8e,_0x407f64,!![]);}catch(_0x3fcfd7){return BPromise[_0xfe1a('0x20')](_0x3fcfd7);}return _0x5f1f8e['save']();};}function saveUpdates(_0xbe55e8,_0x71ef00){return function(_0xa813db){if(_0xa813db){return _0xa813db[_0xfe1a('0x21')](_0xbe55e8)['then'](function(_0x319627){return _0x319627;});}return null;};}function removeEntity(_0x50b88a,_0x1e28ba){return function(_0x56b18c){if(_0x56b18c){return _0x56b18c['destroy']()['then'](function(){_0x50b88a[_0xfe1a('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x38ed85,_0x2e1423){return function(_0x57a92c){if(!_0x57a92c){_0x38ed85[_0xfe1a('0x18')](0x194);}return _0x57a92c;};}function handleError(_0x96390b,_0xdb2ddb){_0xdb2ddb=_0xdb2ddb||0x1f4;return function(_0x88db28){logger[_0xfe1a('0x22')](_0x88db28['stack']);if(_0x88db28[_0xfe1a('0x23')]){delete _0x88db28[_0xfe1a('0x23')];}_0x96390b['status'](_0xdb2ddb)[_0xfe1a('0x24')](_0x88db28);};}exports['index']=function(_0x104516,_0x4cb7ea){var _0x55bfae={},_0x507eeb={},_0x2babcc={'count':0x0,'rows':[]};var _0x6648e7=_[_0xfe1a('0x25')](db[_0xfe1a('0x26')][_0xfe1a('0x27')],function(_0x4bd3a6){return{'name':_0x4bd3a6[_0xfe1a('0x28')],'type':_0x4bd3a6['type'][_0xfe1a('0x29')]};});_0x507eeb[_0xfe1a('0x2a')]=_['map'](_0x6648e7,_0xfe1a('0x23'));_0x507eeb[_0xfe1a('0x2b')]=_['keys'](_0x104516['query']);_0x507eeb[_0xfe1a('0x2c')]=_[_0xfe1a('0x2d')](_0x507eeb['model'],_0x507eeb[_0xfe1a('0x2b')]);_0x55bfae[_0xfe1a('0x2e')]=_['intersection'](_0x507eeb['model'],qs[_0xfe1a('0x2f')](_0x104516['query'][_0xfe1a('0x2f')]));_0x55bfae[_0xfe1a('0x2e')]=_0x55bfae[_0xfe1a('0x2e')][_0xfe1a('0x30')]?_0x55bfae['attributes']:_0x507eeb[_0xfe1a('0x2a')];if(!_0x104516['query'][_0xfe1a('0x31')](_0xfe1a('0x32'))){_0x55bfae[_0xfe1a('0x1d')]=qs['limit'](_0x104516[_0xfe1a('0x2b')][_0xfe1a('0x1d')]);_0x55bfae[_0xfe1a('0x1c')]=qs[_0xfe1a('0x1c')](_0x104516['query'][_0xfe1a('0x1c')]);}_0x55bfae['order']=qs['sort'](_0x104516[_0xfe1a('0x2b')][_0xfe1a('0x33')]);_0x55bfae['where']=qs[_0xfe1a('0x2c')](_[_0xfe1a('0x34')](_0x104516['query'],_0x507eeb[_0xfe1a('0x2c')]),_0x6648e7);if(_0x104516['query'][_0xfe1a('0x35')]){_0x55bfae['where']=_[_0xfe1a('0x36')](_0x55bfae[_0xfe1a('0x37')],{'$or':_[_0xfe1a('0x25')](_0x6648e7,function(_0x3ed6b3){if(_0x3ed6b3[_0xfe1a('0x38')]!==_0xfe1a('0x39')){var _0x4c2aaa={};_0x4c2aaa[_0x3ed6b3[_0xfe1a('0x23')]]={'$like':'%'+_0x104516[_0xfe1a('0x2b')]['filter']+'%'};return _0x4c2aaa;}})});}_0x55bfae=_['merge']({},_0x55bfae,_0x104516[_0xfe1a('0x3a')]);var _0x1c3686={'where':_0x55bfae[_0xfe1a('0x37')]};return db[_0xfe1a('0x26')][_0xfe1a('0x3b')](_0x1c3686)['then'](function(_0x50fb32){_0x2babcc[_0xfe1a('0x3b')]=_0x50fb32;if(_0x104516[_0xfe1a('0x2b')]['includeAll']){_0x55bfae[_0xfe1a('0x3c')]=[{'all':!![]}];}return db[_0xfe1a('0x26')][_0xfe1a('0x3d')](_0x55bfae);})[_0xfe1a('0x3e')](function(_0x5787f7){_0x2babcc[_0xfe1a('0x3f')]=_0x5787f7;return _0x2babcc;})[_0xfe1a('0x3e')](respondWithFilteredResult(_0x4cb7ea,_0x55bfae))[_0xfe1a('0x40')](handleError(_0x4cb7ea,null));};exports[_0xfe1a('0x41')]=function(_0xc9e926,_0x4683cb){var _0x2f0531={'raw':!![],'where':{'id':_0xc9e926['params']['id']}},_0x4af966={};_0x4af966[_0xfe1a('0x2a')]=_[_0xfe1a('0x42')](db[_0xfe1a('0x26')][_0xfe1a('0x27')]);_0x4af966[_0xfe1a('0x2b')]=_[_0xfe1a('0x42')](_0xc9e926[_0xfe1a('0x2b')]);_0x4af966['filters']=_[_0xfe1a('0x2d')](_0x4af966[_0xfe1a('0x2a')],_0x4af966[_0xfe1a('0x2b')]);_0x2f0531['attributes']=_['intersection'](_0x4af966['model'],qs[_0xfe1a('0x2f')](_0xc9e926[_0xfe1a('0x2b')][_0xfe1a('0x2f')]));_0x2f0531[_0xfe1a('0x2e')]=_0x2f0531[_0xfe1a('0x2e')][_0xfe1a('0x30')]?_0x2f0531['attributes']:_0x4af966['model'];if(_0xc9e926[_0xfe1a('0x2b')][_0xfe1a('0x43')]){_0x2f0531[_0xfe1a('0x3c')]=[{'all':!![]}];}_0x2f0531=_[_0xfe1a('0x36')]({},_0x2f0531,_0xc9e926['options']);return db['MailTransferReport']['find'](_0x2f0531)['then'](handleEntityNotFound(_0x4683cb,null))['then'](respondWithResult(_0x4683cb,null))[_0xfe1a('0x40')](handleError(_0x4683cb,null));};exports[_0xfe1a('0x44')]=function(_0x2f043e,_0x5c8672){return db['MailTransferReport'][_0xfe1a('0x44')](_0x2f043e[_0xfe1a('0x45')],{})[_0xfe1a('0x3e')](respondWithResult(_0x5c8672,0xc9))[_0xfe1a('0x40')](handleError(_0x5c8672,null));};exports[_0xfe1a('0x21')]=function(_0x22e175,_0x193c89){if(_0x22e175[_0xfe1a('0x45')]['id']){delete _0x22e175[_0xfe1a('0x45')]['id'];}return db[_0xfe1a('0x26')][_0xfe1a('0x46')]({'where':{'id':_0x22e175['params']['id']}})['then'](handleEntityNotFound(_0x193c89,null))[_0xfe1a('0x3e')](saveUpdates(_0x22e175[_0xfe1a('0x45')],null))[_0xfe1a('0x3e')](respondWithResult(_0x193c89,null))[_0xfe1a('0x40')](handleError(_0x193c89,null));};exports[_0xfe1a('0x47')]=function(_0x3354f3,_0x1b161c){return db[_0xfe1a('0x26')][_0xfe1a('0x46')]({'where':{'id':_0x3354f3['params']['id']}})['then'](handleEntityNotFound(_0x1b161c,null))[_0xfe1a('0x3e')](removeEntity(_0x1b161c,null))['catch'](handleError(_0x1b161c,null));};exports[_0xfe1a('0x48')]=function(_0x1faa05,_0x5039ac){return db[_0xfe1a('0x26')]['describe']()[_0xfe1a('0x3e')](respondWithResult(_0x5039ac,null))[_0xfe1a('0x40')](handleError(_0x5039ac,null));}; \ No newline at end of file +var _0x7b15=['sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','json','undefined','limit','count','offset','set','reject','save','update','then','end','error','stack','name','send','index','map','MailTransferReport','rawAttributes','fieldName','key','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','show','include','find','catch','create','body','destroy','describe','eml-format','rimraf','request-promise','bluebird','mustache','util','path'];(function(_0x4ef240,_0x351747){var _0x18127d=function(_0x1cfa79){while(--_0x1cfa79){_0x4ef240['push'](_0x4ef240['shift']());}};_0x18127d(++_0x351747);}(_0x7b15,0x1bb));var _0x57b1=function(_0x3a598b,_0x11e23e){_0x3a598b=_0x3a598b-0x0;var _0x5fb606=_0x7b15[_0x3a598b];return _0x5fb606;};'use strict';var emlformat=require(_0x57b1('0x0'));var rimraf=require(_0x57b1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x57b1('0x2'));var moment=require('moment');var BPromise=require(_0x57b1('0x3'));var Mustache=require(_0x57b1('0x4'));var util=require(_0x57b1('0x5'));var path=require(_0x57b1('0x6'));var sox=require(_0x57b1('0x7'));var csv=require(_0x57b1('0x8'));var ejs=require(_0x57b1('0x9'));var fs=require('fs');var fs_extra=require(_0x57b1('0xa'));var _=require(_0x57b1('0xb'));var squel=require(_0x57b1('0xc'));var crypto=require(_0x57b1('0xd'));var jsforce=require(_0x57b1('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x57b1('0xf'));var Papa=require(_0x57b1('0x10'));var Redis=require('ioredis');var authService=require(_0x57b1('0x11'));var qs=require(_0x57b1('0x12'));var as=require(_0x57b1('0x13'));var hardwareService=require(_0x57b1('0x14'));var logger=require(_0x57b1('0x15'))(_0x57b1('0x16'));var utils=require('../../config/utils');var config=require(_0x57b1('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x226a04,_0x344b1c){_0x344b1c=_0x344b1c||0xcc;return function(_0x813bf8){if(_0x813bf8){return _0x226a04[_0x57b1('0x18')](_0x344b1c);}return _0x226a04['status'](_0x344b1c)['end']();};}function respondWithResult(_0xbb4471,_0x3f0759){_0x3f0759=_0x3f0759||0xc8;return function(_0x1cdd13){if(_0x1cdd13){return _0xbb4471[_0x57b1('0x19')](_0x3f0759)[_0x57b1('0x1a')](_0x1cdd13);}};}function respondWithFilteredResult(_0x12da0e,_0x2215a0){return function(_0x5a86e9){if(_0x5a86e9){var _0x40aeb8=typeof _0x2215a0['offset']===_0x57b1('0x1b')&&typeof _0x2215a0[_0x57b1('0x1c')]===_0x57b1('0x1b');var _0x53ad1b=_0x5a86e9[_0x57b1('0x1d')];var _0x43f4f4=_0x40aeb8?0x0:_0x2215a0[_0x57b1('0x1e')];var _0x42786f=_0x40aeb8?_0x5a86e9[_0x57b1('0x1d')]:_0x2215a0[_0x57b1('0x1e')]+_0x2215a0['limit'];var _0x3d1166;if(_0x42786f>=_0x53ad1b){_0x42786f=_0x53ad1b;_0x3d1166=0xc8;}else{_0x3d1166=0xce;}_0x12da0e[_0x57b1('0x19')](_0x3d1166);return _0x12da0e[_0x57b1('0x1f')]('Content-Range',_0x43f4f4+'-'+_0x42786f+'/'+_0x53ad1b)['json'](_0x5a86e9);}return null;};}function patchUpdates(_0x33978a){return function(_0x269d74){try{jsonpatch['apply'](_0x269d74,_0x33978a,!![]);}catch(_0x5d43f9){return BPromise[_0x57b1('0x20')](_0x5d43f9);}return _0x269d74[_0x57b1('0x21')]();};}function saveUpdates(_0x83a05d,_0x6f96c7){return function(_0x1f7f82){if(_0x1f7f82){return _0x1f7f82[_0x57b1('0x22')](_0x83a05d)['then'](function(_0x349a6){return _0x349a6;});}return null;};}function removeEntity(_0x356a00,_0x1b8c0c){return function(_0x3ef269){if(_0x3ef269){return _0x3ef269['destroy']()[_0x57b1('0x23')](function(){_0x356a00['status'](0xcc)[_0x57b1('0x24')]();});}};}function handleEntityNotFound(_0x9dabfe,_0x21dc8c){return function(_0x350a9c){if(!_0x350a9c){_0x9dabfe[_0x57b1('0x18')](0x194);}return _0x350a9c;};}function handleError(_0x3066a1,_0x57b381){_0x57b381=_0x57b381||0x1f4;return function(_0xf44c4d){logger[_0x57b1('0x25')](_0xf44c4d[_0x57b1('0x26')]);if(_0xf44c4d[_0x57b1('0x27')]){delete _0xf44c4d[_0x57b1('0x27')];}_0x3066a1[_0x57b1('0x19')](_0x57b381)[_0x57b1('0x28')](_0xf44c4d);};}exports[_0x57b1('0x29')]=function(_0x5230bb,_0x2f0756){var _0x340cfc={},_0x1c0a06={},_0x32d529={'count':0x0,'rows':[]};var _0x4a7eab=_[_0x57b1('0x2a')](db[_0x57b1('0x2b')][_0x57b1('0x2c')],function(_0x3e4525){return{'name':_0x3e4525[_0x57b1('0x2d')],'type':_0x3e4525['type'][_0x57b1('0x2e')]};});_0x1c0a06['model']=_[_0x57b1('0x2a')](_0x4a7eab,_0x57b1('0x27'));_0x1c0a06['query']=_[_0x57b1('0x2f')](_0x5230bb[_0x57b1('0x30')]);_0x1c0a06[_0x57b1('0x31')]=_[_0x57b1('0x32')](_0x1c0a06[_0x57b1('0x33')],_0x1c0a06['query']);_0x340cfc['attributes']=_[_0x57b1('0x32')](_0x1c0a06[_0x57b1('0x33')],qs['fields'](_0x5230bb[_0x57b1('0x30')][_0x57b1('0x34')]));_0x340cfc[_0x57b1('0x35')]=_0x340cfc[_0x57b1('0x35')][_0x57b1('0x36')]?_0x340cfc['attributes']:_0x1c0a06[_0x57b1('0x33')];if(!_0x5230bb['query'][_0x57b1('0x37')](_0x57b1('0x38'))){_0x340cfc['limit']=qs[_0x57b1('0x1c')](_0x5230bb[_0x57b1('0x30')][_0x57b1('0x1c')]);_0x340cfc['offset']=qs[_0x57b1('0x1e')](_0x5230bb[_0x57b1('0x30')]['offset']);}_0x340cfc[_0x57b1('0x39')]=qs[_0x57b1('0x3a')](_0x5230bb['query'][_0x57b1('0x3a')]);_0x340cfc[_0x57b1('0x3b')]=qs[_0x57b1('0x31')](_[_0x57b1('0x3c')](_0x5230bb['query'],_0x1c0a06[_0x57b1('0x31')]),_0x4a7eab);if(_0x5230bb[_0x57b1('0x30')][_0x57b1('0x3d')]){_0x340cfc['where']=_[_0x57b1('0x3e')](_0x340cfc[_0x57b1('0x3b')],{'$or':_[_0x57b1('0x2a')](_0x4a7eab,function(_0x4e82ae){if(_0x4e82ae[_0x57b1('0x3f')]!==_0x57b1('0x40')){var _0x3e5db8={};_0x3e5db8[_0x4e82ae[_0x57b1('0x27')]]={'$like':'%'+_0x5230bb[_0x57b1('0x30')][_0x57b1('0x3d')]+'%'};return _0x3e5db8;}})});}_0x340cfc=_[_0x57b1('0x3e')]({},_0x340cfc,_0x5230bb[_0x57b1('0x41')]);var _0x5b5013={'where':_0x340cfc[_0x57b1('0x3b')]};return db['MailTransferReport'][_0x57b1('0x1d')](_0x5b5013)[_0x57b1('0x23')](function(_0x40228b){_0x32d529[_0x57b1('0x1d')]=_0x40228b;if(_0x5230bb[_0x57b1('0x30')][_0x57b1('0x42')]){_0x340cfc['include']=[{'all':!![]}];}return db['MailTransferReport']['findAll'](_0x340cfc);})[_0x57b1('0x23')](function(_0x15acbf){_0x32d529['rows']=_0x15acbf;return _0x32d529;})['then'](respondWithFilteredResult(_0x2f0756,_0x340cfc))['catch'](handleError(_0x2f0756,null));};exports[_0x57b1('0x43')]=function(_0xeab95b,_0x2da9ad){var _0x19db5f={'raw':!![],'where':{'id':_0xeab95b['params']['id']}},_0x2674c9={};_0x2674c9[_0x57b1('0x33')]=_['keys'](db['MailTransferReport']['rawAttributes']);_0x2674c9[_0x57b1('0x30')]=_[_0x57b1('0x2f')](_0xeab95b[_0x57b1('0x30')]);_0x2674c9['filters']=_['intersection'](_0x2674c9[_0x57b1('0x33')],_0x2674c9[_0x57b1('0x30')]);_0x19db5f[_0x57b1('0x35')]=_[_0x57b1('0x32')](_0x2674c9['model'],qs[_0x57b1('0x34')](_0xeab95b['query']['fields']));_0x19db5f[_0x57b1('0x35')]=_0x19db5f[_0x57b1('0x35')][_0x57b1('0x36')]?_0x19db5f[_0x57b1('0x35')]:_0x2674c9['model'];if(_0xeab95b[_0x57b1('0x30')]['includeAll']){_0x19db5f[_0x57b1('0x44')]=[{'all':!![]}];}_0x19db5f=_[_0x57b1('0x3e')]({},_0x19db5f,_0xeab95b[_0x57b1('0x41')]);return db[_0x57b1('0x2b')][_0x57b1('0x45')](_0x19db5f)['then'](handleEntityNotFound(_0x2da9ad,null))[_0x57b1('0x23')](respondWithResult(_0x2da9ad,null))[_0x57b1('0x46')](handleError(_0x2da9ad,null));};exports[_0x57b1('0x47')]=function(_0x417ccc,_0x103010){return db['MailTransferReport']['create'](_0x417ccc[_0x57b1('0x48')],{})[_0x57b1('0x23')](respondWithResult(_0x103010,0xc9))[_0x57b1('0x46')](handleError(_0x103010,null));};exports[_0x57b1('0x22')]=function(_0x14c0a4,_0x34652c){if(_0x14c0a4[_0x57b1('0x48')]['id']){delete _0x14c0a4[_0x57b1('0x48')]['id'];}return db[_0x57b1('0x2b')][_0x57b1('0x45')]({'where':{'id':_0x14c0a4['params']['id']}})[_0x57b1('0x23')](handleEntityNotFound(_0x34652c,null))[_0x57b1('0x23')](saveUpdates(_0x14c0a4[_0x57b1('0x48')],null))['then'](respondWithResult(_0x34652c,null))[_0x57b1('0x46')](handleError(_0x34652c,null));};exports[_0x57b1('0x49')]=function(_0x5ed171,_0x457de1){return db['MailTransferReport'][_0x57b1('0x45')]({'where':{'id':_0x5ed171['params']['id']}})[_0x57b1('0x23')](handleEntityNotFound(_0x457de1,null))[_0x57b1('0x23')](removeEntity(_0x457de1,null))[_0x57b1('0x46')](handleError(_0x457de1,null));};exports[_0x57b1('0x4a')]=function(_0x397d7f,_0x37d91c){return db[_0x57b1('0x2b')][_0x57b1('0x4a')]()[_0x57b1('0x23')](respondWithResult(_0x37d91c,null))[_0x57b1('0x46')](handleError(_0x37d91c,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 2cb12ad..4cc03ca 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 _0xf987=['define','MailTransferReport','report_mail_transfer','uniqueid','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./mailTransferReport.attributes','exports'];(function(_0x2abac9,_0x4d0bcb){var _0x77125b=function(_0x11a9d4){while(--_0x11a9d4){_0x2abac9['push'](_0x2abac9['shift']());}};_0x77125b(++_0x4d0bcb);}(_0xf987,0x18a));var _0x7f98=function(_0x36ef94,_0x16ba28){_0x36ef94=_0x36ef94-0x0;var _0x9b0e30=_0xf987[_0x36ef94];return _0x9b0e30;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7f98('0x0'))(_0x7f98('0x1'));var moment=require('moment');var BPromise=require(_0x7f98('0x2'));var rp=require(_0x7f98('0x3'));var fs=require('fs');var path=require(_0x7f98('0x4'));var rimraf=require(_0x7f98('0x5'));var config=require(_0x7f98('0x6'));var attributes=require(_0x7f98('0x7'));module[_0x7f98('0x8')]=function(_0x3b5abb,_0x3fb8e2){return _0x3b5abb[_0x7f98('0x9')](_0x7f98('0xa'),attributes,{'tableName':_0x7f98('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x7f98('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8ad5=['MailTransferReport','report_mail_transfer','uniqueid','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./mailTransferReport.attributes','exports','define'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0x8ad5,0xf1));var _0x58ad=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0x8ad5[_0x3054be];return _0x3df150;};'use strict';var _=require(_0x58ad('0x0'));var util=require(_0x58ad('0x1'));var logger=require(_0x58ad('0x2'))(_0x58ad('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x58ad('0x4'));var fs=require('fs');var path=require(_0x58ad('0x5'));var rimraf=require(_0x58ad('0x6'));var config=require(_0x58ad('0x7'));var attributes=require(_0x58ad('0x8'));module[_0x58ad('0x9')]=function(_0x51d560,_0x5888f7){return _0x51d560[_0x58ad('0xa')](_0x58ad('0xb'),attributes,{'tableName':_0x58ad('0xc'),'paranoid':![],'indexes':[{'name':_0x58ad('0xd'),'fields':[_0x58ad('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 93fb581..ba63464 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 _0xe1ee=['request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/environment','jayson/promise'];(function(_0x2b5584,_0x2c1bab){var _0x3f8885=function(_0x4dc68c){while(--_0x4dc68c){_0x2b5584['push'](_0x2b5584['shift']());}};_0x3f8885(++_0x2c1bab);}(_0xe1ee,0xc9));var _0xee1e=function(_0x1e4b33,_0x2d64c7){_0x1e4b33=_0x1e4b33-0x0;var _0x5aeaae=_0xe1ee[_0x1e4b33];return _0x5aeaae;};'use strict';var _=require(_0xee1e('0x0'));var util=require(_0xee1e('0x1'));var moment=require(_0xee1e('0x2'));var BPromise=require(_0xee1e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xee1e('0x4'))['db'];var utils=require(_0xee1e('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xee1e('0x6'));var jayson=require(_0xee1e('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xf9f049,_0x38060c,_0x1432ae){return new BPromise(function(_0x485d9e,_0x44c851){return client[_0xee1e('0x8')](_0xf9f049,_0x1432ae)[_0xee1e('0x9')](function(_0x497ed1){logger[_0xee1e('0xa')](_0xee1e('0xb'),_0x38060c,_0xee1e('0xc'));logger[_0xee1e('0xd')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x38060c,'request\x20sent',JSON[_0xee1e('0xe')](_0x497ed1));if(_0x497ed1[_0xee1e('0xf')]){if(_0x497ed1[_0xee1e('0xf')][_0xee1e('0x10')]===0x1f4){logger[_0xee1e('0xf')](_0xee1e('0xb'),_0x38060c,_0x497ed1[_0xee1e('0xf')][_0xee1e('0x11')]);return _0x44c851(_0x497ed1[_0xee1e('0xf')][_0xee1e('0x11')]);}logger[_0xee1e('0xf')](_0xee1e('0xb'),_0x38060c,_0x497ed1[_0xee1e('0xf')][_0xee1e('0x11')]);return _0x485d9e(_0x497ed1[_0xee1e('0xf')][_0xee1e('0x11')]);}else{logger['info'](_0xee1e('0xb'),_0x38060c,_0xee1e('0xc'));_0x485d9e(_0x497ed1['result']['message']);}})[_0xee1e('0x12')](function(_0x383945){logger[_0xee1e('0xf')](_0xee1e('0xb'),_0x38060c,_0x383945);_0x44c851(_0x383945);});});} \ No newline at end of file +var _0xb5b2=['MailTransferReport,\x20%s,\x20%s','request\x20sent','MailTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then','info'];(function(_0x57c2f7,_0x2b71f6){var _0x1df861=function(_0x5c73f8){while(--_0x5c73f8){_0x57c2f7['push'](_0x57c2f7['shift']());}};_0x1df861(++_0x2b71f6);}(_0xb5b2,0x1ab));var _0x2b5b=function(_0x839f0d,_0x4c5583){_0x839f0d=_0x839f0d-0x0;var _0x5c31c3=_0xb5b2[_0x839f0d];return _0x5c31c3;};'use strict';var _=require(_0x2b5b('0x0'));var util=require(_0x2b5b('0x1'));var moment=require(_0x2b5b('0x2'));var BPromise=require(_0x2b5b('0x3'));var rs=require(_0x2b5b('0x4'));var fs=require('fs');var Redis=require(_0x2b5b('0x5'));var db=require(_0x2b5b('0x6'))['db'];var utils=require(_0x2b5b('0x7'));var logger=require(_0x2b5b('0x8'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2b5b('0x9')][_0x2b5b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe6de73,_0x23d93c,_0x2e9ad5){return new BPromise(function(_0x3426cc,_0x5ebdec){return client[_0x2b5b('0xb')](_0xe6de73,_0x2e9ad5)[_0x2b5b('0xc')](function(_0x24998f){logger[_0x2b5b('0xd')](_0x2b5b('0xe'),_0x23d93c,_0x2b5b('0xf'));logger['debug'](_0x2b5b('0x10'),_0x23d93c,_0x2b5b('0xf'),JSON['stringify'](_0x24998f));if(_0x24998f[_0x2b5b('0x11')]){if(_0x24998f[_0x2b5b('0x11')][_0x2b5b('0x12')]===0x1f4){logger[_0x2b5b('0x11')](_0x2b5b('0xe'),_0x23d93c,_0x24998f[_0x2b5b('0x11')][_0x2b5b('0x13')]);return _0x5ebdec(_0x24998f[_0x2b5b('0x11')][_0x2b5b('0x13')]);}logger[_0x2b5b('0x11')]('MailTransferReport,\x20%s,\x20%s',_0x23d93c,_0x24998f['error'][_0x2b5b('0x13')]);return _0x3426cc(_0x24998f[_0x2b5b('0x11')][_0x2b5b('0x13')]);}else{logger[_0x2b5b('0xd')]('MailTransferReport,\x20%s,\x20%s',_0x23d93c,'request\x20sent');_0x3426cc(_0x24998f['result']['message']);}})[_0x2b5b('0x14')](function(_0x42177f){logger[_0x2b5b('0x11')](_0x2b5b('0xe'),_0x23d93c,_0x42177f);_0x5ebdec(_0x42177f);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 32850ba..a8b08a9 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 _0x62dd=['destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./memberReport.controller','get','isAuthenticated','index','describe','/:id','show','post','put','delete'];(function(_0x30a31e,_0x31f766){var _0x170879=function(_0x313ee7){while(--_0x313ee7){_0x30a31e['push'](_0x30a31e['shift']());}};_0x170879(++_0x31f766);}(_0x62dd,0x10c));var _0xd62d=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x62dd[_0x2641f9];return _0x585741;};'use strict';var multer=require('multer');var util=require(_0xd62d('0x0'));var path=require('path');var timeout=require(_0xd62d('0x1'));var express=require(_0xd62d('0x2'));var router=express[_0xd62d('0x3')]();var fs_extra=require(_0xd62d('0x4'));var auth=require(_0xd62d('0x5'));var interaction=require(_0xd62d('0x6'));var config=require('../../config/environment');var controller=require(_0xd62d('0x7'));router[_0xd62d('0x8')]('/',auth[_0xd62d('0x9')](),controller[_0xd62d('0xa')]);router[_0xd62d('0x8')]('/describe',auth['isAuthenticated'](),controller[_0xd62d('0xb')]);router[_0xd62d('0x8')](_0xd62d('0xc'),auth[_0xd62d('0x9')](),controller[_0xd62d('0xd')]);router[_0xd62d('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xd62d('0xf')]('/:id',auth[_0xd62d('0x9')](),controller['update']);router[_0xd62d('0x10')](_0xd62d('0xc'),auth[_0xd62d('0x9')](),controller[_0xd62d('0x11')]);module[_0xd62d('0x12')]=router; \ No newline at end of file +var _0x4066=['show','create','put','/:id','update','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get','index','/describe','isAuthenticated','describe'];(function(_0xa7c249,_0x599b5e){var _0x1a9b26=function(_0x2b8797){while(--_0x2b8797){_0xa7c249['push'](_0xa7c249['shift']());}};_0x1a9b26(++_0x599b5e);}(_0x4066,0xbb));var _0x6406=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x4066[_0x21a9d9];return _0x46adce;};'use strict';var multer=require(_0x6406('0x0'));var util=require('util');var path=require(_0x6406('0x1'));var timeout=require('connect-timeout');var express=require(_0x6406('0x2'));var router=express[_0x6406('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x6406('0x4'));var interaction=require(_0x6406('0x5'));var config=require(_0x6406('0x6'));var controller=require(_0x6406('0x7'));router[_0x6406('0x8')]('/',auth['isAuthenticated'](),controller[_0x6406('0x9')]);router[_0x6406('0x8')](_0x6406('0xa'),auth[_0x6406('0xb')](),controller[_0x6406('0xc')]);router['get']('/:id',auth[_0x6406('0xb')](),controller[_0x6406('0xd')]);router['post']('/',auth[_0x6406('0xb')](),controller[_0x6406('0xe')]);router[_0x6406('0xf')](_0x6406('0x10'),auth[_0x6406('0xb')](),controller[_0x6406('0x11')]);router['delete'](_0x6406('0x10'),auth[_0x6406('0xb')](),controller[_0x6406('0x12')]);module[_0x6406('0x13')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index dfa14c3..6a2bdbd 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 _0x00bb=['enterAt','diff','seconds','setDataValue','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[queue]','sequelize','moment','exports','STRING','DEFAULT\x20PAUSE','INTEGER','DATE','getDataValue'];(function(_0x43f489,_0x2b4fea){var _0x4134b4=function(_0x4365f6){while(--_0x4365f6){_0x43f489['push'](_0x43f489['shift']());}};_0x4134b4(++_0x2b4fea);}(_0x00bb,0x1d8));var _0xb00b=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x00bb[_0x1d9aa0];return _0x226868;};'use strict';var Sequelize=require(_0xb00b('0x0'));var moment=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xb00b('0x3')]},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xb00b('0x3')],'defaultValue':_0xb00b('0x4'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize[_0xb00b('0x5')]},'enterAt':{'type':Sequelize[_0xb00b('0x6')]},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x574cf8){var _0x532ffb=moment(_0x574cf8);var _0x36e363=moment(this[_0xb00b('0x7')](_0xb00b('0x8')));var _0x37f07d=_0x532ffb[_0xb00b('0x9')](_0x36e363,_0xb00b('0xa'));this['setDataValue']('exitAt',_0x574cf8);this[_0xb00b('0xb')](_0xb00b('0xc'),_0x37f07d||null);}},'data1':{'type':Sequelize[_0xb00b('0x3')],'comment':_0xb00b('0xd')},'data2':{'type':Sequelize[_0xb00b('0x3')],'comment':'talk:[start]'},'data3':{'type':Sequelize[_0xb00b('0x3')],'comment':'talk:[destination]'},'data4':{'type':Sequelize['STRING'],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0xb00b('0x3')],'comment':_0xb00b('0xe')},'role':{'type':Sequelize[_0xb00b('0x3')]},'internal':{'type':Sequelize[_0xb00b('0x5')]},'uniqueid':{'type':Sequelize[_0xb00b('0x3')]}}; \ No newline at end of file +var _0xc678=['talk:[dial\x20string]','talk:[queue]','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','enterAt','diff','seconds','setDataValue','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[destination]'];(function(_0x22c29c,_0xa80f96){var _0x35d8c9=function(_0x3aa85e){while(--_0x3aa85e){_0x22c29c['push'](_0x22c29c['shift']());}};_0x35d8c9(++_0xa80f96);}(_0xc678,0x1b4));var _0x8c67=function(_0x201097,_0x40ff26){_0x201097=_0x201097-0x0;var _0x46176a=_0xc678[_0x201097];return _0x46176a;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x8c67('0x0')]={'channel':{'type':Sequelize[_0x8c67('0x1')]},'membername':{'type':Sequelize[_0x8c67('0x1')]},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x8c67('0x1')],'defaultValue':_0x8c67('0x2'),'comment':_0x8c67('0x3')},'duration':{'type':Sequelize[_0x8c67('0x4')]},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x8c67('0x5')],'set':function(_0x5cdb40){var _0x351c21=moment(_0x5cdb40);var _0x1b4ceb=moment(this['getDataValue'](_0x8c67('0x6')));var _0x22d7e4=_0x351c21[_0x8c67('0x7')](_0x1b4ceb,_0x8c67('0x8'));this[_0x8c67('0x9')]('exitAt',_0x5cdb40);this[_0x8c67('0x9')]('duration',_0x22d7e4||null);}},'data1':{'type':Sequelize[_0x8c67('0x1')],'comment':_0x8c67('0xa')},'data2':{'type':Sequelize[_0x8c67('0x1')],'comment':'talk:[start]'},'data3':{'type':Sequelize[_0x8c67('0x1')],'comment':_0x8c67('0xb')},'data4':{'type':Sequelize[_0x8c67('0x1')],'comment':_0x8c67('0xc')},'data5':{'type':Sequelize['STRING'],'comment':_0x8c67('0xd')},'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 f926c53..d79a969 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 _0x008c=['destroy','sendStatus','send','index','MemberReport','rawAttributes','key','model','map','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','show','catch','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','save','update','then'];(function(_0x196388,_0x498baf){var _0x9346b2=function(_0x210214){while(--_0x210214){_0x196388['push'](_0x196388['shift']());}};_0x9346b2(++_0x498baf);}(_0x008c,0x188));var _0xc008=function(_0x434ab8,_0x164e29){_0x434ab8=_0x434ab8-0x0;var _0x4173a2=_0x008c[_0x434ab8];return _0x4173a2;};'use strict';var emlformat=require(_0xc008('0x0'));var rimraf=require(_0xc008('0x1'));var zipdir=require(_0xc008('0x2'));var jsonpatch=require(_0xc008('0x3'));var rp=require(_0xc008('0x4'));var moment=require('moment');var BPromise=require(_0xc008('0x5'));var Mustache=require(_0xc008('0x6'));var util=require(_0xc008('0x7'));var path=require(_0xc008('0x8'));var sox=require(_0xc008('0x9'));var csv=require(_0xc008('0xa'));var ejs=require(_0xc008('0xb'));var fs=require('fs');var fs_extra=require(_0xc008('0xc'));var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc008('0x12'));var logger=require(_0xc008('0x13'))('api');var utils=require(_0xc008('0x14'));var config=require(_0xc008('0x15'));var licenseUtil=require(_0xc008('0x16'));var db=require(_0xc008('0x17'))['db'];function respondWithStatusCode(_0x9ffa93,_0x1819c6){_0x1819c6=_0x1819c6||0xcc;return function(_0x69726e){if(_0x69726e){return _0x9ffa93['sendStatus'](_0x1819c6);}return _0x9ffa93['status'](_0x1819c6)[_0xc008('0x18')]();};}function respondWithResult(_0x50c1ab,_0x25e13f){_0x25e13f=_0x25e13f||0xc8;return function(_0x4584e1){if(_0x4584e1){return _0x50c1ab[_0xc008('0x19')](_0x25e13f)[_0xc008('0x1a')](_0x4584e1);}};}function respondWithFilteredResult(_0x3f0ecf,_0x5ee00b){return function(_0x5e894e){if(_0x5e894e){var _0x4bd0f4=typeof _0x5ee00b[_0xc008('0x1b')]===_0xc008('0x1c')&&typeof _0x5ee00b[_0xc008('0x1d')]===_0xc008('0x1c');var _0x4fe771=_0x5e894e['count'];var _0x540e45=_0x4bd0f4?0x0:_0x5ee00b['offset'];var _0x46042b=_0x4bd0f4?_0x5e894e[_0xc008('0x1e')]:_0x5ee00b['offset']+_0x5ee00b[_0xc008('0x1d')];var _0x5906e6;if(_0x46042b>=_0x4fe771){_0x46042b=_0x4fe771;_0x5906e6=0xc8;}else{_0x5906e6=0xce;}_0x3f0ecf['status'](_0x5906e6);return _0x3f0ecf['set']('Content-Range',_0x540e45+'-'+_0x46042b+'/'+_0x4fe771)[_0xc008('0x1a')](_0x5e894e);}return null;};}function patchUpdates(_0x4b9726){return function(_0x5560b1){try{jsonpatch['apply'](_0x5560b1,_0x4b9726,!![]);}catch(_0x4a582d){return BPromise['reject'](_0x4a582d);}return _0x5560b1[_0xc008('0x1f')]();};}function saveUpdates(_0x4777a6,_0x251db2){return function(_0x415af3){if(_0x415af3){return _0x415af3[_0xc008('0x20')](_0x4777a6)[_0xc008('0x21')](function(_0x4f43e2){return _0x4f43e2;});}return null;};}function removeEntity(_0x459fd9,_0x5c85f2){return function(_0x58a6ea){if(_0x58a6ea){return _0x58a6ea[_0xc008('0x22')]()[_0xc008('0x21')](function(){_0x459fd9[_0xc008('0x19')](0xcc)[_0xc008('0x18')]();});}};}function handleEntityNotFound(_0x5410f5,_0x48582b){return function(_0x5de1e9){if(!_0x5de1e9){_0x5410f5[_0xc008('0x23')](0x194);}return _0x5de1e9;};}function handleError(_0x15dade,_0x92c582){_0x92c582=_0x92c582||0x1f4;return function(_0x2e31c2){logger['error'](_0x2e31c2['stack']);if(_0x2e31c2['name']){delete _0x2e31c2['name'];}_0x15dade['status'](_0x92c582)[_0xc008('0x24')](_0x2e31c2);};}exports[_0xc008('0x25')]=function(_0x25eae4,_0x529961){var _0x24c14c={},_0x32390d={},_0x209591={'count':0x0,'rows':[]};var _0x2a7d4f=_['map'](db[_0xc008('0x26')][_0xc008('0x27')],function(_0x53ed35){return{'name':_0x53ed35['fieldName'],'type':_0x53ed35['type'][_0xc008('0x28')]};});_0x32390d[_0xc008('0x29')]=_[_0xc008('0x2a')](_0x2a7d4f,_0xc008('0x2b'));_0x32390d[_0xc008('0x2c')]=_[_0xc008('0x2d')](_0x25eae4[_0xc008('0x2c')]);_0x32390d[_0xc008('0x2e')]=_[_0xc008('0x2f')](_0x32390d[_0xc008('0x29')],_0x32390d[_0xc008('0x2c')]);_0x24c14c[_0xc008('0x30')]=_['intersection'](_0x32390d[_0xc008('0x29')],qs[_0xc008('0x31')](_0x25eae4['query'][_0xc008('0x31')]));_0x24c14c[_0xc008('0x30')]=_0x24c14c[_0xc008('0x30')][_0xc008('0x32')]?_0x24c14c[_0xc008('0x30')]:_0x32390d[_0xc008('0x29')];if(!_0x25eae4[_0xc008('0x2c')][_0xc008('0x33')](_0xc008('0x34'))){_0x24c14c['limit']=qs[_0xc008('0x1d')](_0x25eae4[_0xc008('0x2c')][_0xc008('0x1d')]);_0x24c14c[_0xc008('0x1b')]=qs[_0xc008('0x1b')](_0x25eae4[_0xc008('0x2c')][_0xc008('0x1b')]);}_0x24c14c['order']=qs[_0xc008('0x35')](_0x25eae4[_0xc008('0x2c')]['sort']);_0x24c14c[_0xc008('0x36')]=qs[_0xc008('0x2e')](_['pick'](_0x25eae4[_0xc008('0x2c')],_0x32390d[_0xc008('0x2e')]),_0x2a7d4f);if(_0x25eae4[_0xc008('0x2c')]['filter']){_0x24c14c['where']=_['merge'](_0x24c14c[_0xc008('0x36')],{'$or':_['map'](_0x2a7d4f,function(_0x3dd0ac){if(_0x3dd0ac[_0xc008('0x37')]!==_0xc008('0x38')){var _0x440459={};_0x440459[_0x3dd0ac[_0xc008('0x2b')]]={'$like':'%'+_0x25eae4[_0xc008('0x2c')][_0xc008('0x39')]+'%'};return _0x440459;}})});}_0x24c14c=_[_0xc008('0x3a')]({},_0x24c14c,_0x25eae4[_0xc008('0x3b')]);var _0x387dfd={'where':_0x24c14c[_0xc008('0x36')]};return db[_0xc008('0x26')][_0xc008('0x1e')](_0x387dfd)[_0xc008('0x21')](function(_0x4cace5){_0x209591[_0xc008('0x1e')]=_0x4cace5;if(_0x25eae4[_0xc008('0x2c')][_0xc008('0x3c')]){_0x24c14c[_0xc008('0x3d')]=[{'all':!![]}];}return db['MemberReport'][_0xc008('0x3e')](_0x24c14c);})[_0xc008('0x21')](function(_0xc8cb91){_0x209591[_0xc008('0x3f')]=_0xc8cb91;return _0x209591;})[_0xc008('0x21')](respondWithFilteredResult(_0x529961,_0x24c14c))['catch'](handleError(_0x529961,null));};exports[_0xc008('0x40')]=function(_0x3323f4,_0x3794b0){var _0x3e9a99={'raw':!![],'where':{'id':_0x3323f4['params']['id']}},_0x7279e8={};_0x7279e8[_0xc008('0x29')]=_[_0xc008('0x2d')](db[_0xc008('0x26')][_0xc008('0x27')]);_0x7279e8['query']=_[_0xc008('0x2d')](_0x3323f4[_0xc008('0x2c')]);_0x7279e8[_0xc008('0x2e')]=_['intersection'](_0x7279e8[_0xc008('0x29')],_0x7279e8['query']);_0x3e9a99[_0xc008('0x30')]=_['intersection'](_0x7279e8[_0xc008('0x29')],qs[_0xc008('0x31')](_0x3323f4['query'][_0xc008('0x31')]));_0x3e9a99[_0xc008('0x30')]=_0x3e9a99[_0xc008('0x30')]['length']?_0x3e9a99[_0xc008('0x30')]:_0x7279e8[_0xc008('0x29')];if(_0x3323f4[_0xc008('0x2c')][_0xc008('0x3c')]){_0x3e9a99[_0xc008('0x3d')]=[{'all':!![]}];}_0x3e9a99=_[_0xc008('0x3a')]({},_0x3e9a99,_0x3323f4['options']);return db['MemberReport']['find'](_0x3e9a99)[_0xc008('0x21')](handleEntityNotFound(_0x3794b0,null))[_0xc008('0x21')](respondWithResult(_0x3794b0,null))[_0xc008('0x41')](handleError(_0x3794b0,null));};exports[_0xc008('0x42')]=function(_0x25289f,_0x24f6a4){return db[_0xc008('0x26')][_0xc008('0x42')](_0x25289f['body'],{})['then'](respondWithResult(_0x24f6a4,0xc9))['catch'](handleError(_0x24f6a4,null));};exports[_0xc008('0x20')]=function(_0x2651cf,_0x158eae){if(_0x2651cf['body']['id']){delete _0x2651cf[_0xc008('0x43')]['id'];}return db[_0xc008('0x26')][_0xc008('0x44')]({'where':{'id':_0x2651cf[_0xc008('0x45')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x158eae,null))[_0xc008('0x21')](saveUpdates(_0x2651cf[_0xc008('0x43')],null))[_0xc008('0x21')](respondWithResult(_0x158eae,null))[_0xc008('0x41')](handleError(_0x158eae,null));};exports[_0xc008('0x22')]=function(_0x52c444,_0x4c63d4){return db[_0xc008('0x26')]['find']({'where':{'id':_0x52c444[_0xc008('0x45')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x4c63d4,null))[_0xc008('0x21')](removeEntity(_0x4c63d4,null))['catch'](handleError(_0x4c63d4,null));};exports[_0xc008('0x46')]=function(_0x32b435,_0xee64){return db[_0xc008('0x26')][_0xc008('0x46')]()['then'](respondWithResult(_0xee64,null))[_0xc008('0x41')](handleError(_0xee64,null));}; \ No newline at end of file +var _0x008c=['destroy','sendStatus','send','index','MemberReport','rawAttributes','key','model','map','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','show','catch','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','save','update','then'];(function(_0xbccf,_0x5f3f74){var _0x24c504=function(_0x1442a0){while(--_0x1442a0){_0xbccf['push'](_0xbccf['shift']());}};_0x24c504(++_0x5f3f74);}(_0x008c,0x188));var _0xc008=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0x008c[_0x1da04e];return _0xdd8c41;};'use strict';var emlformat=require(_0xc008('0x0'));var rimraf=require(_0xc008('0x1'));var zipdir=require(_0xc008('0x2'));var jsonpatch=require(_0xc008('0x3'));var rp=require(_0xc008('0x4'));var moment=require('moment');var BPromise=require(_0xc008('0x5'));var Mustache=require(_0xc008('0x6'));var util=require(_0xc008('0x7'));var path=require(_0xc008('0x8'));var sox=require(_0xc008('0x9'));var csv=require(_0xc008('0xa'));var ejs=require(_0xc008('0xb'));var fs=require('fs');var fs_extra=require(_0xc008('0xc'));var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc008('0x12'));var logger=require(_0xc008('0x13'))('api');var utils=require(_0xc008('0x14'));var config=require(_0xc008('0x15'));var licenseUtil=require(_0xc008('0x16'));var db=require(_0xc008('0x17'))['db'];function respondWithStatusCode(_0x9ffa93,_0x1819c6){_0x1819c6=_0x1819c6||0xcc;return function(_0x69726e){if(_0x69726e){return _0x9ffa93['sendStatus'](_0x1819c6);}return _0x9ffa93['status'](_0x1819c6)[_0xc008('0x18')]();};}function respondWithResult(_0x50c1ab,_0x25e13f){_0x25e13f=_0x25e13f||0xc8;return function(_0x4584e1){if(_0x4584e1){return _0x50c1ab[_0xc008('0x19')](_0x25e13f)[_0xc008('0x1a')](_0x4584e1);}};}function respondWithFilteredResult(_0x3f0ecf,_0x5ee00b){return function(_0x5e894e){if(_0x5e894e){var _0x4bd0f4=typeof _0x5ee00b[_0xc008('0x1b')]===_0xc008('0x1c')&&typeof _0x5ee00b[_0xc008('0x1d')]===_0xc008('0x1c');var _0x4fe771=_0x5e894e['count'];var _0x540e45=_0x4bd0f4?0x0:_0x5ee00b['offset'];var _0x46042b=_0x4bd0f4?_0x5e894e[_0xc008('0x1e')]:_0x5ee00b['offset']+_0x5ee00b[_0xc008('0x1d')];var _0x5906e6;if(_0x46042b>=_0x4fe771){_0x46042b=_0x4fe771;_0x5906e6=0xc8;}else{_0x5906e6=0xce;}_0x3f0ecf['status'](_0x5906e6);return _0x3f0ecf['set']('Content-Range',_0x540e45+'-'+_0x46042b+'/'+_0x4fe771)[_0xc008('0x1a')](_0x5e894e);}return null;};}function patchUpdates(_0x4b9726){return function(_0x5560b1){try{jsonpatch['apply'](_0x5560b1,_0x4b9726,!![]);}catch(_0x4a582d){return BPromise['reject'](_0x4a582d);}return _0x5560b1[_0xc008('0x1f')]();};}function saveUpdates(_0x4777a6,_0x251db2){return function(_0x415af3){if(_0x415af3){return _0x415af3[_0xc008('0x20')](_0x4777a6)[_0xc008('0x21')](function(_0x4f43e2){return _0x4f43e2;});}return null;};}function removeEntity(_0x459fd9,_0x5c85f2){return function(_0x58a6ea){if(_0x58a6ea){return _0x58a6ea[_0xc008('0x22')]()[_0xc008('0x21')](function(){_0x459fd9[_0xc008('0x19')](0xcc)[_0xc008('0x18')]();});}};}function handleEntityNotFound(_0x5410f5,_0x48582b){return function(_0x5de1e9){if(!_0x5de1e9){_0x5410f5[_0xc008('0x23')](0x194);}return _0x5de1e9;};}function handleError(_0x15dade,_0x92c582){_0x92c582=_0x92c582||0x1f4;return function(_0x2e31c2){logger['error'](_0x2e31c2['stack']);if(_0x2e31c2['name']){delete _0x2e31c2['name'];}_0x15dade['status'](_0x92c582)[_0xc008('0x24')](_0x2e31c2);};}exports[_0xc008('0x25')]=function(_0x25eae4,_0x529961){var _0x24c14c={},_0x32390d={},_0x209591={'count':0x0,'rows':[]};var _0x2a7d4f=_['map'](db[_0xc008('0x26')][_0xc008('0x27')],function(_0x53ed35){return{'name':_0x53ed35['fieldName'],'type':_0x53ed35['type'][_0xc008('0x28')]};});_0x32390d[_0xc008('0x29')]=_[_0xc008('0x2a')](_0x2a7d4f,_0xc008('0x2b'));_0x32390d[_0xc008('0x2c')]=_[_0xc008('0x2d')](_0x25eae4[_0xc008('0x2c')]);_0x32390d[_0xc008('0x2e')]=_[_0xc008('0x2f')](_0x32390d[_0xc008('0x29')],_0x32390d[_0xc008('0x2c')]);_0x24c14c[_0xc008('0x30')]=_['intersection'](_0x32390d[_0xc008('0x29')],qs[_0xc008('0x31')](_0x25eae4['query'][_0xc008('0x31')]));_0x24c14c[_0xc008('0x30')]=_0x24c14c[_0xc008('0x30')][_0xc008('0x32')]?_0x24c14c[_0xc008('0x30')]:_0x32390d[_0xc008('0x29')];if(!_0x25eae4[_0xc008('0x2c')][_0xc008('0x33')](_0xc008('0x34'))){_0x24c14c['limit']=qs[_0xc008('0x1d')](_0x25eae4[_0xc008('0x2c')][_0xc008('0x1d')]);_0x24c14c[_0xc008('0x1b')]=qs[_0xc008('0x1b')](_0x25eae4[_0xc008('0x2c')][_0xc008('0x1b')]);}_0x24c14c['order']=qs[_0xc008('0x35')](_0x25eae4[_0xc008('0x2c')]['sort']);_0x24c14c[_0xc008('0x36')]=qs[_0xc008('0x2e')](_['pick'](_0x25eae4[_0xc008('0x2c')],_0x32390d[_0xc008('0x2e')]),_0x2a7d4f);if(_0x25eae4[_0xc008('0x2c')]['filter']){_0x24c14c['where']=_['merge'](_0x24c14c[_0xc008('0x36')],{'$or':_['map'](_0x2a7d4f,function(_0x3dd0ac){if(_0x3dd0ac[_0xc008('0x37')]!==_0xc008('0x38')){var _0x440459={};_0x440459[_0x3dd0ac[_0xc008('0x2b')]]={'$like':'%'+_0x25eae4[_0xc008('0x2c')][_0xc008('0x39')]+'%'};return _0x440459;}})});}_0x24c14c=_[_0xc008('0x3a')]({},_0x24c14c,_0x25eae4[_0xc008('0x3b')]);var _0x387dfd={'where':_0x24c14c[_0xc008('0x36')]};return db[_0xc008('0x26')][_0xc008('0x1e')](_0x387dfd)[_0xc008('0x21')](function(_0x4cace5){_0x209591[_0xc008('0x1e')]=_0x4cace5;if(_0x25eae4[_0xc008('0x2c')][_0xc008('0x3c')]){_0x24c14c[_0xc008('0x3d')]=[{'all':!![]}];}return db['MemberReport'][_0xc008('0x3e')](_0x24c14c);})[_0xc008('0x21')](function(_0xc8cb91){_0x209591[_0xc008('0x3f')]=_0xc8cb91;return _0x209591;})[_0xc008('0x21')](respondWithFilteredResult(_0x529961,_0x24c14c))['catch'](handleError(_0x529961,null));};exports[_0xc008('0x40')]=function(_0x3323f4,_0x3794b0){var _0x3e9a99={'raw':!![],'where':{'id':_0x3323f4['params']['id']}},_0x7279e8={};_0x7279e8[_0xc008('0x29')]=_[_0xc008('0x2d')](db[_0xc008('0x26')][_0xc008('0x27')]);_0x7279e8['query']=_[_0xc008('0x2d')](_0x3323f4[_0xc008('0x2c')]);_0x7279e8[_0xc008('0x2e')]=_['intersection'](_0x7279e8[_0xc008('0x29')],_0x7279e8['query']);_0x3e9a99[_0xc008('0x30')]=_['intersection'](_0x7279e8[_0xc008('0x29')],qs[_0xc008('0x31')](_0x3323f4['query'][_0xc008('0x31')]));_0x3e9a99[_0xc008('0x30')]=_0x3e9a99[_0xc008('0x30')]['length']?_0x3e9a99[_0xc008('0x30')]:_0x7279e8[_0xc008('0x29')];if(_0x3323f4[_0xc008('0x2c')][_0xc008('0x3c')]){_0x3e9a99[_0xc008('0x3d')]=[{'all':!![]}];}_0x3e9a99=_[_0xc008('0x3a')]({},_0x3e9a99,_0x3323f4['options']);return db['MemberReport']['find'](_0x3e9a99)[_0xc008('0x21')](handleEntityNotFound(_0x3794b0,null))[_0xc008('0x21')](respondWithResult(_0x3794b0,null))[_0xc008('0x41')](handleError(_0x3794b0,null));};exports[_0xc008('0x42')]=function(_0x25289f,_0x24f6a4){return db[_0xc008('0x26')][_0xc008('0x42')](_0x25289f['body'],{})['then'](respondWithResult(_0x24f6a4,0xc9))['catch'](handleError(_0x24f6a4,null));};exports[_0xc008('0x20')]=function(_0x2651cf,_0x158eae){if(_0x2651cf['body']['id']){delete _0x2651cf[_0xc008('0x43')]['id'];}return db[_0xc008('0x26')][_0xc008('0x44')]({'where':{'id':_0x2651cf[_0xc008('0x45')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x158eae,null))[_0xc008('0x21')](saveUpdates(_0x2651cf[_0xc008('0x43')],null))[_0xc008('0x21')](respondWithResult(_0x158eae,null))[_0xc008('0x41')](handleError(_0x158eae,null));};exports[_0xc008('0x22')]=function(_0x52c444,_0x4c63d4){return db[_0xc008('0x26')]['find']({'where':{'id':_0x52c444[_0xc008('0x45')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x4c63d4,null))[_0xc008('0x21')](removeEntity(_0x4c63d4,null))['catch'](handleError(_0x4c63d4,null));};exports[_0xc008('0x46')]=function(_0x32b435,_0xee64){return db[_0xc008('0x26')][_0xc008('0x46')]()['then'](respondWithResult(_0xee64,null))[_0xc008('0x41')](handleError(_0xee64,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index dc0f4d7..750fd9a 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 _0xdc6f=['define','report_member','membername_interface','membername','interface','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment'];(function(_0x575f73,_0x55a7ef){var _0x52a3c1=function(_0x25bfdc){while(--_0x25bfdc){_0x575f73['push'](_0x575f73['shift']());}};_0x52a3c1(++_0x55a7ef);}(_0xdc6f,0x6d));var _0xfdc6=function(_0x51a0a9,_0x569499){_0x51a0a9=_0x51a0a9-0x0;var _0x4bd20c=_0xdc6f[_0x51a0a9];return _0x4bd20c;};'use strict';var _=require(_0xfdc6('0x0'));var util=require(_0xfdc6('0x1'));var logger=require(_0xfdc6('0x2'))(_0xfdc6('0x3'));var moment=require(_0xfdc6('0x4'));var BPromise=require(_0xfdc6('0x5'));var rp=require(_0xfdc6('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xfdc6('0x7'));var attributes=require('./memberReport.attributes');module['exports']=function(_0x2e8a52,_0x124108){return _0x2e8a52[_0xfdc6('0x8')]('MemberReport',attributes,{'tableName':_0xfdc6('0x9'),'paranoid':![],'indexes':[{'name':_0xfdc6('0xa'),'fields':[_0xfdc6('0xb'),_0xfdc6('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x120b=['path','./memberReport.attributes','exports','define','interface','util','../../config/logger','moment'];(function(_0x20489b,_0x465eab){var _0x241234=function(_0x122625){while(--_0x122625){_0x20489b['push'](_0x20489b['shift']());}};_0x241234(++_0x465eab);}(_0x120b,0x19d));var _0xb120=function(_0x5eb0ee,_0x3760b0){_0x5eb0ee=_0x5eb0ee-0x0;var _0x6fdba6=_0x120b[_0x5eb0ee];return _0x6fdba6;};'use strict';var _=require('lodash');var util=require(_0xb120('0x0'));var logger=require(_0xb120('0x1'))('api');var moment=require(_0xb120('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb120('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb120('0x4'));module[_0xb120('0x5')]=function(_0xb8ab22,_0x4b70cd){return _0xb8ab22[_0xb120('0x6')]('MemberReport',attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':'membername_interface','fields':['membername',_0xb120('0x7')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 38992cd..6a4d6d2 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 _0x0f4d=['code','message','result','catch','GetMemberReport','MemberReport','findAll','options','raw','where','attributes','limit','map','include','info','CreateMemberReport','create','body','UpdateMemberReport','update','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','MemberReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x223c0d,_0x3ec04d){var _0x207827=function(_0x39d240){while(--_0x39d240){_0x223c0d['push'](_0x223c0d['shift']());}};_0x207827(++_0x3ec04d);}(_0x0f4d,0x12c));var _0xd0f4=function(_0x57292e,_0x53e24f){_0x57292e=_0x57292e-0x0;var _0x2f692e=_0x0f4d[_0x57292e];return _0x2f692e;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xd0f4('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd0f4('0x1'));var db=require(_0xd0f4('0x2'))['db'];var utils=require(_0xd0f4('0x3'));var logger=require(_0xd0f4('0x4'))(_0xd0f4('0x5'));var config=require(_0xd0f4('0x6'));var jayson=require(_0xd0f4('0x7'));var client=jayson[_0xd0f4('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1164da,_0x27acb8,_0x4d0ab0){return new BPromise(function(_0x3992be,_0x2a0057){return client['request'](_0x1164da,_0x4d0ab0)[_0xd0f4('0x9')](function(_0x2570f0){logger['info'](_0xd0f4('0xa'),_0x27acb8,_0xd0f4('0xb'));logger[_0xd0f4('0xc')]('MemberReport,\x20%s,\x20%s,\x20%s',_0x27acb8,'request\x20sent',JSON[_0xd0f4('0xd')](_0x2570f0));if(_0x2570f0[_0xd0f4('0xe')]){if(_0x2570f0[_0xd0f4('0xe')][_0xd0f4('0xf')]===0x1f4){logger[_0xd0f4('0xe')](_0xd0f4('0xa'),_0x27acb8,_0x2570f0[_0xd0f4('0xe')]['message']);return _0x2a0057(_0x2570f0[_0xd0f4('0xe')][_0xd0f4('0x10')]);}logger['error'](_0xd0f4('0xa'),_0x27acb8,_0x2570f0['error'][_0xd0f4('0x10')]);return _0x3992be(_0x2570f0['error'][_0xd0f4('0x10')]);}else{logger['info']('MemberReport,\x20%s,\x20%s',_0x27acb8,'request\x20sent');_0x3992be(_0x2570f0[_0xd0f4('0x11')][_0xd0f4('0x10')]);}})[_0xd0f4('0x12')](function(_0x46c005){logger[_0xd0f4('0xe')](_0xd0f4('0xa'),_0x27acb8,_0x46c005);_0x2a0057(_0x46c005);});});}exports[_0xd0f4('0x13')]=function(_0x35be48){var _0x247cff=this;return new Promise(function(_0x5de07b,_0xb7169b){return db[_0xd0f4('0x14')][_0xd0f4('0x15')]({'raw':_0x35be48[_0xd0f4('0x16')]?_0x35be48['options'][_0xd0f4('0x17')]===undefined?!![]:![]:!![],'where':_0x35be48[_0xd0f4('0x16')]?_0x35be48[_0xd0f4('0x16')][_0xd0f4('0x18')]||null:null,'attributes':_0x35be48['options']?_0x35be48[_0xd0f4('0x16')][_0xd0f4('0x19')]||null:null,'limit':_0x35be48[_0xd0f4('0x16')]?_0x35be48[_0xd0f4('0x16')][_0xd0f4('0x1a')]||null:null,'include':_0x35be48[_0xd0f4('0x16')]?_0x35be48[_0xd0f4('0x16')]['include']?_[_0xd0f4('0x1b')](_0x35be48[_0xd0f4('0x16')][_0xd0f4('0x1c')],function(_0x299904){return{'model':db[_0x299904['model']],'as':_0x299904['as'],'attributes':_0x299904[_0xd0f4('0x19')],'include':_0x299904['include']?_[_0xd0f4('0x1b')](_0x299904[_0xd0f4('0x1c')],function(_0x1cf493){return{'model':db[_0x1cf493['model']],'as':_0x1cf493['as'],'attributes':_0x1cf493[_0xd0f4('0x19')],'include':_0x1cf493[_0xd0f4('0x1c')]?_[_0xd0f4('0x1b')](_0x1cf493[_0xd0f4('0x1c')],function(_0x366af6){return{'model':db[_0x366af6['model']],'as':_0x366af6['as'],'attributes':_0x366af6[_0xd0f4('0x19')]};}):[]};}):[]};}):[]:[]})[_0xd0f4('0x9')](function(_0x1b36c2){logger[_0xd0f4('0x1d')](_0xd0f4('0x13'),_0x35be48);logger[_0xd0f4('0xc')](_0xd0f4('0x13'),_0x35be48,JSON[_0xd0f4('0xd')](_0x1b36c2));_0x5de07b(_0x1b36c2);})[_0xd0f4('0x12')](function(_0x4cff90){logger[_0xd0f4('0xe')](_0xd0f4('0x13'),_0x4cff90[_0xd0f4('0x10')],_0x35be48);_0xb7169b(_0x247cff[_0xd0f4('0xe')](0x1f4,_0x4cff90['message']));});});};exports[_0xd0f4('0x1e')]=function(_0x52a22a){var _0x4f92a9=this;return new Promise(function(_0x4f7fd3,_0x22f599){return db[_0xd0f4('0x14')][_0xd0f4('0x1f')](_0x52a22a[_0xd0f4('0x20')],{'raw':_0x52a22a[_0xd0f4('0x16')]?_0x52a22a[_0xd0f4('0x16')][_0xd0f4('0x17')]===undefined?!![]:![]:!![]})[_0xd0f4('0x9')](function(_0x55f23f){logger[_0xd0f4('0x1d')]('CreateMemberReport',_0x52a22a);logger[_0xd0f4('0xc')](_0xd0f4('0x1e'),_0x52a22a,JSON['stringify'](_0x55f23f));_0x4f7fd3(_0x55f23f);})['catch'](function(_0x35632c){logger['error'](_0xd0f4('0x1e'),_0x35632c[_0xd0f4('0x10')],_0x52a22a);_0x22f599(_0x4f92a9['error'](0x1f4,_0x35632c[_0xd0f4('0x10')]));});});};exports[_0xd0f4('0x21')]=function(_0x4b722f){var _0x590a66=this;return new Promise(function(_0x3605fe,_0x1f22d3){return db['MemberReport'][_0xd0f4('0x22')](_0x4b722f['body'],{'raw':_0x4b722f[_0xd0f4('0x16')]?_0x4b722f[_0xd0f4('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b722f[_0xd0f4('0x16')]?_0x4b722f[_0xd0f4('0x16')][_0xd0f4('0x18')]||null:null,'attributes':_0x4b722f[_0xd0f4('0x16')]?_0x4b722f[_0xd0f4('0x16')]['attributes']||null:null,'limit':_0x4b722f[_0xd0f4('0x16')]?_0x4b722f[_0xd0f4('0x16')][_0xd0f4('0x1a')]||null:null})[_0xd0f4('0x9')](function(_0x4ccdf2){logger[_0xd0f4('0x1d')](_0xd0f4('0x21'),_0x4b722f);logger[_0xd0f4('0xc')](_0xd0f4('0x21'),_0x4b722f,JSON[_0xd0f4('0xd')](_0x4ccdf2));_0x3605fe(_0x4ccdf2);})[_0xd0f4('0x12')](function(_0x4ff5f6){logger[_0xd0f4('0xe')](_0xd0f4('0x21'),_0x4ff5f6[_0xd0f4('0x10')],_0x4b722f);_0x1f22d3(_0x590a66['error'](0x1f4,_0x4ff5f6[_0xd0f4('0x10')]));});});}; \ No newline at end of file +var _0x48e3=['result','GetMemberReport','options','raw','where','limit','map','include','model','attributes','catch','CreateMemberReport','MemberReport','create','body','UpdateMemberReport','update','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x48e3,0xe9));var _0x348e=function(_0x1e23c6,_0x2506cd){_0x1e23c6=_0x1e23c6-0x0;var _0x161855=_0x48e3[_0x1e23c6];return _0x161855;};'use strict';var _=require(_0x348e('0x0'));var util=require(_0x348e('0x1'));var moment=require('moment');var BPromise=require(_0x348e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x348e('0x3'))['db'];var utils=require(_0x348e('0x4'));var logger=require(_0x348e('0x5'))(_0x348e('0x6'));var config=require('../../config/environment');var jayson=require(_0x348e('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x13b150,_0x5afaa1,_0x5919ce){return new BPromise(function(_0x33295b,_0x5d908f){return client[_0x348e('0x8')](_0x13b150,_0x5919ce)[_0x348e('0x9')](function(_0x16ec91){logger[_0x348e('0xa')](_0x348e('0xb'),_0x5afaa1,_0x348e('0xc'));logger[_0x348e('0xd')](_0x348e('0xe'),_0x5afaa1,_0x348e('0xc'),JSON[_0x348e('0xf')](_0x16ec91));if(_0x16ec91[_0x348e('0x10')]){if(_0x16ec91[_0x348e('0x10')][_0x348e('0x11')]===0x1f4){logger[_0x348e('0x10')]('MemberReport,\x20%s,\x20%s',_0x5afaa1,_0x16ec91[_0x348e('0x10')][_0x348e('0x12')]);return _0x5d908f(_0x16ec91[_0x348e('0x10')]['message']);}logger[_0x348e('0x10')](_0x348e('0xb'),_0x5afaa1,_0x16ec91[_0x348e('0x10')][_0x348e('0x12')]);return _0x33295b(_0x16ec91[_0x348e('0x10')]['message']);}else{logger['info'](_0x348e('0xb'),_0x5afaa1,_0x348e('0xc'));_0x33295b(_0x16ec91[_0x348e('0x13')][_0x348e('0x12')]);}})['catch'](function(_0x378442){logger['error'](_0x348e('0xb'),_0x5afaa1,_0x378442);_0x5d908f(_0x378442);});});}exports[_0x348e('0x14')]=function(_0x409ea8){var _0x57a6fa=this;return new Promise(function(_0x2326bc,_0x548e17){return db['MemberReport']['findAll']({'raw':_0x409ea8[_0x348e('0x15')]?_0x409ea8[_0x348e('0x15')][_0x348e('0x16')]===undefined?!![]:![]:!![],'where':_0x409ea8[_0x348e('0x15')]?_0x409ea8[_0x348e('0x15')][_0x348e('0x17')]||null:null,'attributes':_0x409ea8[_0x348e('0x15')]?_0x409ea8[_0x348e('0x15')]['attributes']||null:null,'limit':_0x409ea8['options']?_0x409ea8[_0x348e('0x15')][_0x348e('0x18')]||null:null,'include':_0x409ea8[_0x348e('0x15')]?_0x409ea8[_0x348e('0x15')]['include']?_[_0x348e('0x19')](_0x409ea8[_0x348e('0x15')][_0x348e('0x1a')],function(_0x4a5a84){return{'model':db[_0x4a5a84[_0x348e('0x1b')]],'as':_0x4a5a84['as'],'attributes':_0x4a5a84[_0x348e('0x1c')],'include':_0x4a5a84[_0x348e('0x1a')]?_['map'](_0x4a5a84[_0x348e('0x1a')],function(_0x845e7f){return{'model':db[_0x845e7f[_0x348e('0x1b')]],'as':_0x845e7f['as'],'attributes':_0x845e7f['attributes'],'include':_0x845e7f[_0x348e('0x1a')]?_[_0x348e('0x19')](_0x845e7f[_0x348e('0x1a')],function(_0x23bed7){return{'model':db[_0x23bed7['model']],'as':_0x23bed7['as'],'attributes':_0x23bed7[_0x348e('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x348e('0x9')](function(_0x13eabb){logger[_0x348e('0xa')](_0x348e('0x14'),_0x409ea8);logger[_0x348e('0xd')](_0x348e('0x14'),_0x409ea8,JSON['stringify'](_0x13eabb));_0x2326bc(_0x13eabb);})[_0x348e('0x1d')](function(_0xcf7f99){logger['error'](_0x348e('0x14'),_0xcf7f99[_0x348e('0x12')],_0x409ea8);_0x548e17(_0x57a6fa['error'](0x1f4,_0xcf7f99[_0x348e('0x12')]));});});};exports[_0x348e('0x1e')]=function(_0x4b6dc4){var _0x408641=this;return new Promise(function(_0x369740,_0x2f909d){return db[_0x348e('0x1f')][_0x348e('0x20')](_0x4b6dc4[_0x348e('0x21')],{'raw':_0x4b6dc4[_0x348e('0x15')]?_0x4b6dc4['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x191ccd){logger[_0x348e('0xa')](_0x348e('0x1e'),_0x4b6dc4);logger['debug'](_0x348e('0x1e'),_0x4b6dc4,JSON['stringify'](_0x191ccd));_0x369740(_0x191ccd);})['catch'](function(_0x251b0e){logger[_0x348e('0x10')](_0x348e('0x1e'),_0x251b0e[_0x348e('0x12')],_0x4b6dc4);_0x2f909d(_0x408641['error'](0x1f4,_0x251b0e[_0x348e('0x12')]));});});};exports[_0x348e('0x22')]=function(_0x1742f9){var _0x990733=this;return new Promise(function(_0x445c30,_0x3a3b2c){return db[_0x348e('0x1f')][_0x348e('0x23')](_0x1742f9['body'],{'raw':_0x1742f9['options']?_0x1742f9[_0x348e('0x15')][_0x348e('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1742f9[_0x348e('0x15')]?_0x1742f9[_0x348e('0x15')][_0x348e('0x17')]||null:null,'attributes':_0x1742f9[_0x348e('0x15')]?_0x1742f9['options'][_0x348e('0x1c')]||null:null,'limit':_0x1742f9[_0x348e('0x15')]?_0x1742f9[_0x348e('0x15')]['limit']||null:null})[_0x348e('0x9')](function(_0xca0c30){logger[_0x348e('0xa')](_0x348e('0x22'),_0x1742f9);logger[_0x348e('0xd')](_0x348e('0x22'),_0x1742f9,JSON[_0x348e('0xf')](_0xca0c30));_0x445c30(_0xca0c30);})['catch'](function(_0x37a7e7){logger[_0x348e('0x10')]('UpdateMemberReport',_0x37a7e7[_0x348e('0x12')],_0x1742f9);_0x3a3b2c(_0x990733[_0x348e('0x10')](0x1f4,_0x37a7e7[_0x348e('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 8b58a67..b4d6930 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 _0x03f0=['../../components/interaction/service','../../config/environment','get','index','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x57db65,_0x205aca){var _0x3c580b=function(_0x1e15e9){while(--_0x1e15e9){_0x57db65['push'](_0x57db65['shift']());}};_0x3c580b(++_0x205aca);}(_0x03f0,0x1b2));var _0x003f=function(_0x111f04,_0x4d17fd){_0x111f04=_0x111f04-0x0;var _0x252b1f=_0x03f0[_0x111f04];return _0x252b1f;};'use strict';var multer=require('multer');var util=require(_0x003f('0x0'));var path=require('path');var timeout=require(_0x003f('0x1'));var express=require(_0x003f('0x2'));var router=express[_0x003f('0x3')]();var fs_extra=require(_0x003f('0x4'));var auth=require(_0x003f('0x5'));var interaction=require(_0x003f('0x6'));var config=require(_0x003f('0x7'));var controller=require('./migration.controller');router[_0x003f('0x8')]('/',controller[_0x003f('0x9')]);module['exports']=router; \ No newline at end of file +var _0xc283=['../../components/auth/service','../../config/environment','./migration.controller','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x198489,_0x3f8fc4){var _0x367cad=function(_0x1a33ec){while(--_0x1a33ec){_0x198489['push'](_0x198489['shift']());}};_0x367cad(++_0x3f8fc4);}(_0xc283,0x189));var _0x3c28=function(_0x50370d,_0x2aafef){_0x50370d=_0x50370d-0x0;var _0x22c52d=_0xc283[_0x50370d];return _0x22c52d;};'use strict';var multer=require(_0x3c28('0x0'));var util=require(_0x3c28('0x1'));var path=require(_0x3c28('0x2'));var timeout=require(_0x3c28('0x3'));var express=require(_0x3c28('0x4'));var router=express[_0x3c28('0x5')]();var fs_extra=require(_0x3c28('0x6'));var auth=require(_0x3c28('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x3c28('0x8'));var controller=require(_0x3c28('0x9'));router['get']('/',controller['index']);module['exports']=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index ca6578e..96afb7c 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 _0xad8b=['sequelize','exports','version'];(function(_0x1f8798,_0xfbbfd4){var _0x10c6be=function(_0x92c5a7){while(--_0x92c5a7){_0x1f8798['push'](_0x1f8798['shift']());}};_0x10c6be(++_0xfbbfd4);}(_0xad8b,0x16e));var _0xbad8=function(_0x2211ed,_0x1bca0b){_0x2211ed=_0x2211ed-0x0;var _0x4d78cc=_0xad8b[_0x2211ed];return _0x4d78cc;};'use strict';var Sequelize=require(_0xbad8('0x0'));module[_0xbad8('0x1')]={'version':{'type':Sequelize['STRING'],'unique':_0xbad8('0x2')}}; \ No newline at end of file +var _0xd495=['STRING','sequelize'];(function(_0x1e9963,_0x2d628f){var _0x4c73d9=function(_0x2e7532){while(--_0x2e7532){_0x1e9963['push'](_0x1e9963['shift']());}};_0x4c73d9(++_0x2d628f);}(_0xd495,0x1d1));var _0x5d49=function(_0x2891d1,_0x2ddd3e){_0x2891d1=_0x2891d1-0x0;var _0x486948=_0xd495[_0x2891d1];return _0x486948;};'use strict';var Sequelize=require(_0x5d49('0x0'));module['exports']={'version':{'type':Sequelize[_0x5d49('0x1')],'unique':'version'}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 1601ddd..c54240f 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 _0x5c1f=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','map','Migration','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','to-csv','ejs','lodash','squel','crypto','jsforce','ioredis'];(function(_0x280f4a,_0x2ed8d6){var _0x1bb157=function(_0x37de94){while(--_0x37de94){_0x280f4a['push'](_0x280f4a['shift']());}};_0x1bb157(++_0x2ed8d6);}(_0x5c1f,0x1b3));var _0xf5c1=function(_0x4d180c,_0x45c68e){_0x4d180c=_0x4d180c-0x0;var _0x49b57e=_0x5c1f[_0x4d180c];return _0x49b57e;};'use strict';var emlformat=require(_0xf5c1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf5c1('0x1'));var jsonpatch=require(_0xf5c1('0x2'));var rp=require('request-promise');var moment=require(_0xf5c1('0x3'));var BPromise=require(_0xf5c1('0x4'));var Mustache=require(_0xf5c1('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xf5c1('0x6'));var ejs=require(_0xf5c1('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf5c1('0x8'));var squel=require(_0xf5c1('0x9'));var crypto=require(_0xf5c1('0xa'));var jsforce=require(_0xf5c1('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf5c1('0xc'));var authService=require(_0xf5c1('0xd'));var qs=require(_0xf5c1('0xe'));var as=require(_0xf5c1('0xf'));var hardwareService=require(_0xf5c1('0x10'));var logger=require(_0xf5c1('0x11'))(_0xf5c1('0x12'));var utils=require(_0xf5c1('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xf5c1('0x14'));var db=require(_0xf5c1('0x15'))['db'];function respondWithStatusCode(_0x252b9f,_0x3519b4){_0x3519b4=_0x3519b4||0xcc;return function(_0x26c748){if(_0x26c748){return _0x252b9f['sendStatus'](_0x3519b4);}return _0x252b9f[_0xf5c1('0x16')](_0x3519b4)['end']();};}function respondWithResult(_0x45bf57,_0x42f44f){_0x42f44f=_0x42f44f||0xc8;return function(_0x2eb021){if(_0x2eb021){return _0x45bf57['status'](_0x42f44f)[_0xf5c1('0x17')](_0x2eb021);}};}function respondWithFilteredResult(_0x11ff7a,_0x2fe583){return function(_0x42234e){if(_0x42234e){var _0x5891a9=typeof _0x2fe583[_0xf5c1('0x18')]===_0xf5c1('0x19')&&typeof _0x2fe583[_0xf5c1('0x1a')]===_0xf5c1('0x19');var _0x32e05a=_0x42234e['count'];var _0x46d8e4=_0x5891a9?0x0:_0x2fe583[_0xf5c1('0x18')];var _0x2d1db9=_0x5891a9?_0x42234e[_0xf5c1('0x1b')]:_0x2fe583[_0xf5c1('0x18')]+_0x2fe583[_0xf5c1('0x1a')];var _0x199e25;if(_0x2d1db9>=_0x32e05a){_0x2d1db9=_0x32e05a;_0x199e25=0xc8;}else{_0x199e25=0xce;}_0x11ff7a[_0xf5c1('0x16')](_0x199e25);return _0x11ff7a['set'](_0xf5c1('0x1c'),_0x46d8e4+'-'+_0x2d1db9+'/'+_0x32e05a)[_0xf5c1('0x17')](_0x42234e);}return null;};}function patchUpdates(_0x4c360a){return function(_0x113b04){try{jsonpatch[_0xf5c1('0x1d')](_0x113b04,_0x4c360a,!![]);}catch(_0x1dd38c){return BPromise[_0xf5c1('0x1e')](_0x1dd38c);}return _0x113b04[_0xf5c1('0x1f')]();};}function saveUpdates(_0x65d095,_0x2383f8){return function(_0x4955d6){if(_0x4955d6){return _0x4955d6[_0xf5c1('0x20')](_0x65d095)[_0xf5c1('0x21')](function(_0x6b2a5d){return _0x6b2a5d;});}return null;};}function removeEntity(_0x5e99a8,_0x1d17cd){return function(_0x3f6ac8){if(_0x3f6ac8){return _0x3f6ac8[_0xf5c1('0x22')]()[_0xf5c1('0x21')](function(){_0x5e99a8['status'](0xcc)[_0xf5c1('0x23')]();});}};}function handleEntityNotFound(_0x2acb65,_0x38bcb2){return function(_0x237b70){if(!_0x237b70){_0x2acb65['sendStatus'](0x194);}return _0x237b70;};}function handleError(_0x505bfe,_0x46f866){_0x46f866=_0x46f866||0x1f4;return function(_0x12c706){logger[_0xf5c1('0x24')](_0x12c706[_0xf5c1('0x25')]);if(_0x12c706['name']){delete _0x12c706[_0xf5c1('0x26')];}_0x505bfe[_0xf5c1('0x16')](_0x46f866)['send'](_0x12c706);};}exports['index']=function(_0x3ac679,_0x291088){var _0x380178={},_0x36fff6={},_0x5eb7cd={'count':0x0,'rows':[]};var _0x24ff24=_[_0xf5c1('0x27')](db[_0xf5c1('0x28')][_0xf5c1('0x29')],function(_0x4670ad){return{'name':_0x4670ad[_0xf5c1('0x2a')],'type':_0x4670ad['type'][_0xf5c1('0x2b')]};});_0x36fff6[_0xf5c1('0x2c')]=_['map'](_0x24ff24,'name');_0x36fff6[_0xf5c1('0x2d')]=_['keys'](_0x3ac679[_0xf5c1('0x2d')]);_0x36fff6[_0xf5c1('0x2e')]=_[_0xf5c1('0x2f')](_0x36fff6[_0xf5c1('0x2c')],_0x36fff6[_0xf5c1('0x2d')]);_0x380178[_0xf5c1('0x30')]=_[_0xf5c1('0x2f')](_0x36fff6[_0xf5c1('0x2c')],qs[_0xf5c1('0x31')](_0x3ac679[_0xf5c1('0x2d')]['fields']));_0x380178[_0xf5c1('0x30')]=_0x380178[_0xf5c1('0x30')][_0xf5c1('0x32')]?_0x380178[_0xf5c1('0x30')]:_0x36fff6[_0xf5c1('0x2c')];if(!_0x3ac679[_0xf5c1('0x2d')][_0xf5c1('0x33')](_0xf5c1('0x34'))){_0x380178[_0xf5c1('0x1a')]=qs['limit'](_0x3ac679[_0xf5c1('0x2d')][_0xf5c1('0x1a')]);_0x380178[_0xf5c1('0x18')]=qs[_0xf5c1('0x18')](_0x3ac679[_0xf5c1('0x2d')][_0xf5c1('0x18')]);}_0x380178[_0xf5c1('0x35')]=qs[_0xf5c1('0x36')](_0x3ac679['query'][_0xf5c1('0x36')]);_0x380178[_0xf5c1('0x37')]=qs[_0xf5c1('0x2e')](_[_0xf5c1('0x38')](_0x3ac679[_0xf5c1('0x2d')],_0x36fff6[_0xf5c1('0x2e')]),_0x24ff24);if(_0x3ac679[_0xf5c1('0x2d')][_0xf5c1('0x39')]){_0x380178['where']=_[_0xf5c1('0x3a')](_0x380178[_0xf5c1('0x37')],{'$or':_[_0xf5c1('0x27')](_0x24ff24,function(_0x1e536b){if(_0x1e536b['type']!==_0xf5c1('0x3b')){var _0x30798d={};_0x30798d[_0x1e536b[_0xf5c1('0x26')]]={'$like':'%'+_0x3ac679['query'][_0xf5c1('0x39')]+'%'};return _0x30798d;}})});}_0x380178=_['merge']({},_0x380178,_0x3ac679[_0xf5c1('0x3c')]);var _0x4c43cc={'where':_0x380178[_0xf5c1('0x37')]};return db[_0xf5c1('0x28')][_0xf5c1('0x1b')](_0x4c43cc)[_0xf5c1('0x21')](function(_0x11e57d){_0x5eb7cd[_0xf5c1('0x1b')]=_0x11e57d;if(_0x3ac679['query']['includeAll']){_0x380178['include']=[{'all':!![]}];}return db['Migration'][_0xf5c1('0x3d')](_0x380178);})[_0xf5c1('0x21')](function(_0x46aa33){_0x5eb7cd[_0xf5c1('0x3e')]=_0x46aa33;return _0x5eb7cd;})[_0xf5c1('0x21')](respondWithFilteredResult(_0x291088,_0x380178))[_0xf5c1('0x3f')](handleError(_0x291088,null));}; \ No newline at end of file +var _0xf9d5=['index','map','Migration','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','then','sendStatus','error','stack','name'];(function(_0x194599,_0x3fa008){var _0x81bf4c=function(_0x4f7e13){while(--_0x4f7e13){_0x194599['push'](_0x194599['shift']());}};_0x81bf4c(++_0x3fa008);}(_0xf9d5,0x122));var _0x5f9d=function(_0x477cd0,_0x46a464){_0x477cd0=_0x477cd0-0x0;var _0x43b0da=_0xf9d5[_0x477cd0];return _0x43b0da;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5f9d('0x0'));var zipdir=require(_0x5f9d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5f9d('0x2'));var moment=require(_0x5f9d('0x3'));var BPromise=require(_0x5f9d('0x4'));var Mustache=require(_0x5f9d('0x5'));var util=require(_0x5f9d('0x6'));var path=require(_0x5f9d('0x7'));var sox=require(_0x5f9d('0x8'));var csv=require('to-csv');var ejs=require(_0x5f9d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5f9d('0xa'));var squel=require(_0x5f9d('0xb'));var crypto=require('crypto');var jsforce=require(_0x5f9d('0xc'));var deskjs=require(_0x5f9d('0xd'));var toCsv=require(_0x5f9d('0xe'));var querystring=require(_0x5f9d('0xf'));var Papa=require(_0x5f9d('0x10'));var Redis=require(_0x5f9d('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5f9d('0x12'));var as=require(_0x5f9d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5f9d('0x14'));var utils=require(_0x5f9d('0x15'));var config=require(_0x5f9d('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x5f9d('0x17'))['db'];function respondWithStatusCode(_0x10f5b1,_0x257910){_0x257910=_0x257910||0xcc;return function(_0x23a39f){if(_0x23a39f){return _0x10f5b1['sendStatus'](_0x257910);}return _0x10f5b1[_0x5f9d('0x18')](_0x257910)[_0x5f9d('0x19')]();};}function respondWithResult(_0x234902,_0x5aacdc){_0x5aacdc=_0x5aacdc||0xc8;return function(_0x8e2381){if(_0x8e2381){return _0x234902[_0x5f9d('0x18')](_0x5aacdc)['json'](_0x8e2381);}};}function respondWithFilteredResult(_0x4fd1cb,_0x2f0154){return function(_0x334cea){if(_0x334cea){var _0x3d4a1c=typeof _0x2f0154[_0x5f9d('0x1a')]===_0x5f9d('0x1b')&&typeof _0x2f0154['limit']==='undefined';var _0x54bd00=_0x334cea[_0x5f9d('0x1c')];var _0x4fb9a5=_0x3d4a1c?0x0:_0x2f0154[_0x5f9d('0x1a')];var _0x48448e=_0x3d4a1c?_0x334cea[_0x5f9d('0x1c')]:_0x2f0154[_0x5f9d('0x1a')]+_0x2f0154[_0x5f9d('0x1d')];var _0x55a31c;if(_0x48448e>=_0x54bd00){_0x48448e=_0x54bd00;_0x55a31c=0xc8;}else{_0x55a31c=0xce;}_0x4fd1cb[_0x5f9d('0x18')](_0x55a31c);return _0x4fd1cb[_0x5f9d('0x1e')](_0x5f9d('0x1f'),_0x4fb9a5+'-'+_0x48448e+'/'+_0x54bd00)[_0x5f9d('0x20')](_0x334cea);}return null;};}function patchUpdates(_0x320182){return function(_0xa62826){try{jsonpatch[_0x5f9d('0x21')](_0xa62826,_0x320182,!![]);}catch(_0x2563d5){return BPromise[_0x5f9d('0x22')](_0x2563d5);}return _0xa62826['save']();};}function saveUpdates(_0x4a2eeb,_0x5465b1){return function(_0x1bc76b){if(_0x1bc76b){return _0x1bc76b['update'](_0x4a2eeb)[_0x5f9d('0x23')](function(_0x5a3472){return _0x5a3472;});}return null;};}function removeEntity(_0x9d86ce,_0x564886){return function(_0x4875c5){if(_0x4875c5){return _0x4875c5['destroy']()[_0x5f9d('0x23')](function(){_0x9d86ce[_0x5f9d('0x18')](0xcc)[_0x5f9d('0x19')]();});}};}function handleEntityNotFound(_0x234511,_0x542bbc){return function(_0x379d2d){if(!_0x379d2d){_0x234511[_0x5f9d('0x24')](0x194);}return _0x379d2d;};}function handleError(_0x190402,_0x74f212){_0x74f212=_0x74f212||0x1f4;return function(_0x2d097f){logger[_0x5f9d('0x25')](_0x2d097f[_0x5f9d('0x26')]);if(_0x2d097f[_0x5f9d('0x27')]){delete _0x2d097f[_0x5f9d('0x27')];}_0x190402[_0x5f9d('0x18')](_0x74f212)['send'](_0x2d097f);};}exports[_0x5f9d('0x28')]=function(_0x1b9054,_0x1496c0){var _0x13cc7c={},_0x10e542={},_0x24233e={'count':0x0,'rows':[]};var _0x38b10d=_[_0x5f9d('0x29')](db[_0x5f9d('0x2a')]['rawAttributes'],function(_0x4ed27d){return{'name':_0x4ed27d['fieldName'],'type':_0x4ed27d[_0x5f9d('0x2b')]['key']};});_0x10e542[_0x5f9d('0x2c')]=_['map'](_0x38b10d,_0x5f9d('0x27'));_0x10e542['query']=_[_0x5f9d('0x2d')](_0x1b9054[_0x5f9d('0x2e')]);_0x10e542[_0x5f9d('0x2f')]=_[_0x5f9d('0x30')](_0x10e542[_0x5f9d('0x2c')],_0x10e542['query']);_0x13cc7c[_0x5f9d('0x31')]=_['intersection'](_0x10e542[_0x5f9d('0x2c')],qs['fields'](_0x1b9054[_0x5f9d('0x2e')][_0x5f9d('0x32')]));_0x13cc7c['attributes']=_0x13cc7c[_0x5f9d('0x31')][_0x5f9d('0x33')]?_0x13cc7c[_0x5f9d('0x31')]:_0x10e542['model'];if(!_0x1b9054[_0x5f9d('0x2e')][_0x5f9d('0x34')](_0x5f9d('0x35'))){_0x13cc7c[_0x5f9d('0x1d')]=qs[_0x5f9d('0x1d')](_0x1b9054['query'][_0x5f9d('0x1d')]);_0x13cc7c[_0x5f9d('0x1a')]=qs[_0x5f9d('0x1a')](_0x1b9054[_0x5f9d('0x2e')][_0x5f9d('0x1a')]);}_0x13cc7c[_0x5f9d('0x36')]=qs['sort'](_0x1b9054[_0x5f9d('0x2e')][_0x5f9d('0x37')]);_0x13cc7c[_0x5f9d('0x38')]=qs['filters'](_['pick'](_0x1b9054[_0x5f9d('0x2e')],_0x10e542[_0x5f9d('0x2f')]),_0x38b10d);if(_0x1b9054[_0x5f9d('0x2e')][_0x5f9d('0x39')]){_0x13cc7c[_0x5f9d('0x38')]=_['merge'](_0x13cc7c['where'],{'$or':_[_0x5f9d('0x29')](_0x38b10d,function(_0x3c5737){if(_0x3c5737['type']!==_0x5f9d('0x3a')){var _0x4e15be={};_0x4e15be[_0x3c5737[_0x5f9d('0x27')]]={'$like':'%'+_0x1b9054[_0x5f9d('0x2e')]['filter']+'%'};return _0x4e15be;}})});}_0x13cc7c=_[_0x5f9d('0x3b')]({},_0x13cc7c,_0x1b9054[_0x5f9d('0x3c')]);var _0x4d3288={'where':_0x13cc7c['where']};return db[_0x5f9d('0x2a')][_0x5f9d('0x1c')](_0x4d3288)[_0x5f9d('0x23')](function(_0x3c43f6){_0x24233e[_0x5f9d('0x1c')]=_0x3c43f6;if(_0x1b9054[_0x5f9d('0x2e')][_0x5f9d('0x3d')]){_0x13cc7c[_0x5f9d('0x3e')]=[{'all':!![]}];}return db[_0x5f9d('0x2a')][_0x5f9d('0x3f')](_0x13cc7c);})[_0x5f9d('0x23')](function(_0x227ef6){_0x24233e[_0x5f9d('0x40')]=_0x227ef6;return _0x24233e;})[_0x5f9d('0x23')](respondWithFilteredResult(_0x1496c0,_0x13cc7c))[_0x5f9d('0x41')](handleError(_0x1496c0,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 2f3dd57..4bd73c0 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 _0xff8f=['path','rimraf','../../config/environment','./migration.attributes','exports','migrations','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x495c65,_0x1325c1){var _0x1e70b9=function(_0x3b2bac){while(--_0x3b2bac){_0x495c65['push'](_0x495c65['shift']());}};_0x1e70b9(++_0x1325c1);}(_0xff8f,0x6e));var _0xfff8=function(_0x1e173d,_0x446a27){_0x1e173d=_0x1e173d-0x0;var _0x55be3d=_0xff8f[_0x1e173d];return _0x55be3d;};'use strict';var _=require(_0xfff8('0x0'));var util=require(_0xfff8('0x1'));var logger=require(_0xfff8('0x2'))(_0xfff8('0x3'));var moment=require(_0xfff8('0x4'));var BPromise=require(_0xfff8('0x5'));var rp=require(_0xfff8('0x6'));var fs=require('fs');var path=require(_0xfff8('0x7'));var rimraf=require(_0xfff8('0x8'));var config=require(_0xfff8('0x9'));var attributes=require(_0xfff8('0xa'));module[_0xfff8('0xb')]=function(_0x4bb1df,_0x4d2f5b){return _0x4bb1df['define']('Migration',attributes,{'tableName':_0xfff8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6203=['./migration.attributes','exports','Migration','migrations','lodash','../../config/logger','api','request-promise','rimraf','../../config/environment'];(function(_0x1e2415,_0xf9d99f){var _0x26801b=function(_0x332896){while(--_0x332896){_0x1e2415['push'](_0x1e2415['shift']());}};_0x26801b(++_0xf9d99f);}(_0x6203,0xe0));var _0x3620=function(_0x1e0427,_0x217d05){_0x1e0427=_0x1e0427-0x0;var _0x4821c5=_0x6203[_0x1e0427];return _0x4821c5;};'use strict';var _=require(_0x3620('0x0'));var util=require('util');var logger=require(_0x3620('0x1'))(_0x3620('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3620('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3620('0x4'));var config=require(_0x3620('0x5'));var attributes=require(_0x3620('0x6'));module[_0x3620('0x7')]=function(_0x5e7a31,_0x24802c){return _0x5e7a31['define'](_0x3620('0x8'),attributes,{'tableName':_0x3620('0x9'),'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 06efe24..d6f870e 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 _0x9f94=['debug','error','code','message','info','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','Migration,\x20%s,\x20%s','request\x20sent'];(function(_0x2278de,_0x25cc69){var _0x3ed51f=function(_0x406c52){while(--_0x406c52){_0x2278de['push'](_0x2278de['shift']());}};_0x3ed51f(++_0x25cc69);}(_0x9f94,0x1e7));var _0x49f9=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x9f94[_0x1cc8fe];return _0x230054;};'use strict';var _=require(_0x49f9('0x0'));var util=require(_0x49f9('0x1'));var moment=require(_0x49f9('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x49f9('0x3'));var db=require(_0x49f9('0x4'))['db'];var utils=require(_0x49f9('0x5'));var logger=require(_0x49f9('0x6'))(_0x49f9('0x7'));var config=require('../../config/environment');var jayson=require(_0x49f9('0x8'));var client=jayson[_0x49f9('0x9')][_0x49f9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2fdbf1,_0x10ada8,_0x2e0928){return new BPromise(function(_0x355683,_0x2eddd1){return client['request'](_0x2fdbf1,_0x2e0928)['then'](function(_0x1628bb){logger['info'](_0x49f9('0xb'),_0x10ada8,_0x49f9('0xc'));logger[_0x49f9('0xd')]('Migration,\x20%s,\x20%s,\x20%s',_0x10ada8,_0x49f9('0xc'),JSON['stringify'](_0x1628bb));if(_0x1628bb[_0x49f9('0xe')]){if(_0x1628bb[_0x49f9('0xe')][_0x49f9('0xf')]===0x1f4){logger[_0x49f9('0xe')]('Migration,\x20%s,\x20%s',_0x10ada8,_0x1628bb['error'][_0x49f9('0x10')]);return _0x2eddd1(_0x1628bb[_0x49f9('0xe')][_0x49f9('0x10')]);}logger[_0x49f9('0xe')]('Migration,\x20%s,\x20%s',_0x10ada8,_0x1628bb['error']['message']);return _0x355683(_0x1628bb[_0x49f9('0xe')]['message']);}else{logger[_0x49f9('0x11')]('Migration,\x20%s,\x20%s',_0x10ada8,_0x49f9('0xc'));_0x355683(_0x1628bb[_0x49f9('0x12')]['message']);}})[_0x49f9('0x13')](function(_0x1a2026){logger[_0x49f9('0xe')](_0x49f9('0xb'),_0x10ada8,_0x1a2026);_0x2eddd1(_0x1a2026);});});} \ No newline at end of file +var _0x79d8=['moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','Migration,\x20%s,\x20%s','Migration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util'];(function(_0x362000,_0xa7b6a){var _0xdb74ac=function(_0x594ddf){while(--_0x594ddf){_0x362000['push'](_0x362000['shift']());}};_0xdb74ac(++_0xa7b6a);}(_0x79d8,0x67));var _0x879d=function(_0x29fa41,_0x3c1e25){_0x29fa41=_0x29fa41-0x0;var _0x1d6938=_0x79d8[_0x29fa41];return _0x1d6938;};'use strict';var _=require(_0x879d('0x0'));var util=require(_0x879d('0x1'));var moment=require(_0x879d('0x2'));var BPromise=require(_0x879d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x879d('0x4'));var db=require(_0x879d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x879d('0x6'))(_0x879d('0x7'));var config=require(_0x879d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x879d('0x9')][_0x879d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x142181,_0xc70b64,_0x49c05d){return new BPromise(function(_0x257050,_0x154db7){return client[_0x879d('0xb')](_0x142181,_0x49c05d)[_0x879d('0xc')](function(_0x2d5fbc){logger['info'](_0x879d('0xd'),_0xc70b64,'request\x20sent');logger['debug'](_0x879d('0xe'),_0xc70b64,_0x879d('0xf'),JSON[_0x879d('0x10')](_0x2d5fbc));if(_0x2d5fbc['error']){if(_0x2d5fbc[_0x879d('0x11')][_0x879d('0x12')]===0x1f4){logger['error'](_0x879d('0xd'),_0xc70b64,_0x2d5fbc[_0x879d('0x11')]['message']);return _0x154db7(_0x2d5fbc[_0x879d('0x11')]['message']);}logger[_0x879d('0x11')](_0x879d('0xd'),_0xc70b64,_0x2d5fbc[_0x879d('0x11')][_0x879d('0x13')]);return _0x257050(_0x2d5fbc[_0x879d('0x11')][_0x879d('0x13')]);}else{logger['info']('Migration,\x20%s,\x20%s',_0xc70b64,_0x879d('0xf'));_0x257050(_0x2d5fbc[_0x879d('0x14')]['message']);}})['catch'](function(_0x7478cd){logger[_0x879d('0x11')](_0x879d('0xd'),_0xc70b64,_0x7478cd);_0x154db7(_0x7478cd);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 993b1eb..91df41a 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 _0x2bbc=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','isAuthenticated','index','get','create','put','update','delete','/:id','exports','multer','util','path','connect-timeout'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2bbc,0x1ea));var _0xc2bb=function(_0x500d43,_0x58db3b){_0x500d43=_0x500d43-0x0;var _0x34d7eb=_0x2bbc[_0x500d43];return _0x34d7eb;};'use strict';var multer=require(_0xc2bb('0x0'));var util=require(_0xc2bb('0x1'));var path=require(_0xc2bb('0x2'));var timeout=require(_0xc2bb('0x3'));var express=require('express');var router=express[_0xc2bb('0x4')]();var fs_extra=require(_0xc2bb('0x5'));var auth=require(_0xc2bb('0x6'));var interaction=require(_0xc2bb('0x7'));var config=require(_0xc2bb('0x8'));var controller=require(_0xc2bb('0x9'));router['get']('/',auth[_0xc2bb('0xa')](),controller[_0xc2bb('0xb')]);router[_0xc2bb('0xc')]('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xc2bb('0xa')](),controller[_0xc2bb('0xd')]);router[_0xc2bb('0xe')]('/:id',auth[_0xc2bb('0xa')](),controller[_0xc2bb('0xf')]);router[_0xc2bb('0x10')](_0xc2bb('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0xc2bb('0x12')]=router; \ No newline at end of file +var _0xdf8d=['put','/:id','update','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','create'];(function(_0x17ed9e,_0x493e01){var _0x42fb55=function(_0x370846){while(--_0x370846){_0x17ed9e['push'](_0x17ed9e['shift']());}};_0x42fb55(++_0x493e01);}(_0xdf8d,0x1e0));var _0xddf8=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xdf8d[_0x8c43de];return _0xa6591b;};'use strict';var multer=require(_0xddf8('0x0'));var util=require(_0xddf8('0x1'));var path=require('path');var timeout=require(_0xddf8('0x2'));var express=require(_0xddf8('0x3'));var router=express['Router']();var fs_extra=require(_0xddf8('0x4'));var auth=require(_0xddf8('0x5'));var interaction=require(_0xddf8('0x6'));var config=require(_0xddf8('0x7'));var controller=require('./network.controller');router[_0xddf8('0x8')]('/',auth[_0xddf8('0x9')](),controller[_0xddf8('0xa')]);router[_0xddf8('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xddf8('0xb')]);router[_0xddf8('0xc')]('/',auth[_0xddf8('0x9')](),controller[_0xddf8('0xd')]);router[_0xddf8('0xe')](_0xddf8('0xf'),auth[_0xddf8('0x9')](),controller[_0xddf8('0x10')]);router['delete'](_0xddf8('0xf'),auth[_0xddf8('0x9')](),controller[_0xddf8('0x11')]);module[_0xddf8('0x12')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index d3473f3..60f2d9c 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 _0x06ba=['ENUM','localnet','externip','stun','turn','STRING','sequelize','exports'];(function(_0x4ec87a,_0x4ac569){var _0xf825fc=function(_0x17be2d){while(--_0x17be2d){_0x4ec87a['push'](_0x4ec87a['shift']());}};_0xf825fc(++_0x4ac569);}(_0x06ba,0x16e));var _0xa06b=function(_0x143e75,_0x86607e){_0x143e75=_0x143e75-0x0;var _0x26371b=_0x06ba[_0x143e75];return _0x26371b;};'use strict';var Sequelize=require(_0xa06b('0x0'));module[_0xa06b('0x1')]={'type':{'type':Sequelize[_0xa06b('0x2')](_0xa06b('0x3'),_0xa06b('0x4'),_0xa06b('0x5'),_0xa06b('0x6'))},'value':{'type':Sequelize[_0xa06b('0x7')]},'username':{'type':Sequelize[_0xa06b('0x7')]},'password':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x743d=['localnet','stun','turn','STRING','sequelize','exports','ENUM'];(function(_0x1e9322,_0x416ce8){var _0x35d1ad=function(_0x4c98c7){while(--_0x4c98c7){_0x1e9322['push'](_0x1e9322['shift']());}};_0x35d1ad(++_0x416ce8);}(_0x743d,0x185));var _0xd743=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x743d[_0x432682];return _0x463d05;};'use strict';var Sequelize=require(_0xd743('0x0'));module[_0xd743('0x1')]={'type':{'type':Sequelize[_0xd743('0x2')](_0xd743('0x3'),'externip',_0xd743('0x4'),_0xd743('0x5'))},'value':{'type':Sequelize[_0xd743('0x6')]},'username':{'type':Sequelize[_0xd743('0x6')]},'password':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index a4f5bcc..791d61a 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 _0x2234=['includeAll','include','rows','show','find','sequelize','transaction','body','findAll','toUpperCase','STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs','render','writeFileSync','Reload','res_stun_monitor.so','TURN','utf8','/etc/asterisk/turn_xcally.conf','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','create','update','params','/etc/asterisk/stun_xcally.conf','server/files/templates/turn_multiple.ejs','server/files/templates/network.ejs','chan_sip.so','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','client','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','destroy','stack','name','send','index','map','Network','rawAttributes','type','key','keys','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options'];(function(_0x1a887f,_0x28423c){var _0x1841ff=function(_0x21f786){while(--_0x21f786){_0x1a887f['push'](_0x1a887f['shift']());}};_0x1841ff(++_0x28423c);}(_0x2234,0x16e));var _0x4223=function(_0x51b42e,_0x8dea09){_0x51b42e=_0x51b42e-0x0;var _0x43ed23=_0x2234[_0x51b42e];return _0x43ed23;};'use strict';var emlformat=require(_0x4223('0x0'));var rimraf=require(_0x4223('0x1'));var zipdir=require(_0x4223('0x2'));var jsonpatch=require(_0x4223('0x3'));var rp=require(_0x4223('0x4'));var moment=require(_0x4223('0x5'));var BPromise=require(_0x4223('0x6'));var Mustache=require(_0x4223('0x7'));var util=require(_0x4223('0x8'));var path=require(_0x4223('0x9'));var sox=require('sox');var csv=require(_0x4223('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4223('0xb'));var _=require(_0x4223('0xc'));var squel=require(_0x4223('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4223('0xa'));var querystring=require(_0x4223('0xe'));var Papa=require(_0x4223('0xf'));var Redis=require(_0x4223('0x10'));var authService=require(_0x4223('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x4223('0x12'));var hardwareService=require(_0x4223('0x13'));var logger=require(_0x4223('0x14'))(_0x4223('0x15'));var utils=require(_0x4223('0x16'));var config=require(_0x4223('0x17'));var licenseUtil=require(_0x4223('0x18'));var db=require(_0x4223('0x19'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x4223('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x287bbc,_0x5ebef1,_0x3c6fdb,_0x3b41bb){return new BPromise(function(_0x20649e,_0x5604b8){var _0x4dae32=_0x3b41bb||client;return _0x4dae32['request'](_0x287bbc,_0x3c6fdb)[_0x4223('0x1b')](function(_0x1da527){logger[_0x4223('0x1c')](_0x4223('0x1d'),_0x5ebef1,_0x4223('0x1e'));logger[_0x4223('0x1f')](_0x4223('0x20'),_0x5ebef1,_0x4223('0x1e'),JSON[_0x4223('0x21')](_0x1da527));if(_0x1da527[_0x4223('0x22')]){if(_0x1da527[_0x4223('0x22')][_0x4223('0x23')]===0x1f4){logger[_0x4223('0x22')](_0x4223('0x1d'),_0x5ebef1,_0x1da527[_0x4223('0x22')]['message']);return _0x5604b8(_0x1da527[_0x4223('0x22')]['message']);}logger[_0x4223('0x22')](_0x4223('0x1d'),_0x5ebef1,_0x1da527['error'][_0x4223('0x24')]);return _0x20649e(_0x1da527[_0x4223('0x22')][_0x4223('0x24')]);}else{logger[_0x4223('0x1c')]('Network,\x20%s,\x20%s',_0x5ebef1,_0x4223('0x1e'));_0x20649e(_0x1da527[_0x4223('0x25')]['message']);}})['catch'](function(_0x240b52){logger[_0x4223('0x22')](_0x4223('0x1d'),_0x5ebef1,_0x240b52);_0x5604b8(_0x240b52);});});}function respondWithStatusCode(_0x2c54c5,_0x16a99c){_0x16a99c=_0x16a99c||0xcc;return function(_0x3aa2e0){if(_0x3aa2e0){return _0x2c54c5[_0x4223('0x26')](_0x16a99c);}return _0x2c54c5[_0x4223('0x27')](_0x16a99c)[_0x4223('0x28')]();};}function respondWithResult(_0x285e61,_0x415b9c){_0x415b9c=_0x415b9c||0xc8;return function(_0x3dd9e5){if(_0x3dd9e5){return _0x285e61['status'](_0x415b9c)['json'](_0x3dd9e5);}};}function respondWithFilteredResult(_0x20a8a0,_0x148dd7){return function(_0x1efbd6){if(_0x1efbd6){var _0x4b4a5c=typeof _0x148dd7[_0x4223('0x29')]==='undefined'&&typeof _0x148dd7[_0x4223('0x2a')]===_0x4223('0x2b');var _0x27bc98=_0x1efbd6[_0x4223('0x2c')];var _0x4309d3=_0x4b4a5c?0x0:_0x148dd7[_0x4223('0x29')];var _0x14e25a=_0x4b4a5c?_0x1efbd6['count']:_0x148dd7[_0x4223('0x29')]+_0x148dd7[_0x4223('0x2a')];var _0x167cc8;if(_0x14e25a>=_0x27bc98){_0x14e25a=_0x27bc98;_0x167cc8=0xc8;}else{_0x167cc8=0xce;}_0x20a8a0['status'](_0x167cc8);return _0x20a8a0[_0x4223('0x2d')](_0x4223('0x2e'),_0x4309d3+'-'+_0x14e25a+'/'+_0x27bc98)[_0x4223('0x2f')](_0x1efbd6);}return null;};}function patchUpdates(_0x5cfe9a){return function(_0x4172da){try{jsonpatch[_0x4223('0x30')](_0x4172da,_0x5cfe9a,!![]);}catch(_0x2b15f5){return BPromise[_0x4223('0x31')](_0x2b15f5);}return _0x4172da['save']();};}function saveUpdates(_0x238f42,_0x15545e){return function(_0x2f4ddf){if(_0x2f4ddf){return _0x2f4ddf['update'](_0x238f42)[_0x4223('0x1b')](function(_0x101e75){return _0x101e75;});}return null;};}function removeEntity(_0x498758,_0x1ada27){return function(_0x5e3800){if(_0x5e3800){return _0x5e3800[_0x4223('0x32')]()[_0x4223('0x1b')](function(){_0x498758[_0x4223('0x27')](0xcc)[_0x4223('0x28')]();});}};}function handleEntityNotFound(_0x4c7ab9,_0x122914){return function(_0x52b8b0){if(!_0x52b8b0){_0x4c7ab9[_0x4223('0x26')](0x194);}return _0x52b8b0;};}function handleError(_0x1051ae,_0x1c8cc4){_0x1c8cc4=_0x1c8cc4||0x1f4;return function(_0x1c82f3){logger[_0x4223('0x22')](_0x1c82f3[_0x4223('0x33')]);if(_0x1c82f3['name']){delete _0x1c82f3[_0x4223('0x34')];}_0x1051ae['status'](_0x1c8cc4)[_0x4223('0x35')](_0x1c82f3);};}exports[_0x4223('0x36')]=function(_0x309c45,_0x19e58c){var _0x4128ac={},_0x20bbc2={},_0x2587a9={'count':0x0,'rows':[]};var _0x1ed66d=_[_0x4223('0x37')](db[_0x4223('0x38')][_0x4223('0x39')],function(_0x3cf1b3){return{'name':_0x3cf1b3['fieldName'],'type':_0x3cf1b3[_0x4223('0x3a')][_0x4223('0x3b')]};});_0x20bbc2['model']=_['map'](_0x1ed66d,_0x4223('0x34'));_0x20bbc2['query']=_[_0x4223('0x3c')](_0x309c45[_0x4223('0x3d')]);_0x20bbc2[_0x4223('0x3e')]=_[_0x4223('0x3f')](_0x20bbc2['model'],_0x20bbc2['query']);_0x4128ac[_0x4223('0x40')]=_[_0x4223('0x3f')](_0x20bbc2['model'],qs['fields'](_0x309c45['query'][_0x4223('0x41')]));_0x4128ac[_0x4223('0x40')]=_0x4128ac[_0x4223('0x40')][_0x4223('0x42')]?_0x4128ac['attributes']:_0x20bbc2[_0x4223('0x43')];if(!_0x309c45[_0x4223('0x3d')][_0x4223('0x44')](_0x4223('0x45'))){_0x4128ac['limit']=qs['limit'](_0x309c45[_0x4223('0x3d')][_0x4223('0x2a')]);_0x4128ac['offset']=qs['offset'](_0x309c45[_0x4223('0x3d')][_0x4223('0x29')]);}_0x4128ac[_0x4223('0x46')]=qs[_0x4223('0x47')](_0x309c45[_0x4223('0x3d')]['sort']);_0x4128ac[_0x4223('0x48')]=qs[_0x4223('0x3e')](_[_0x4223('0x49')](_0x309c45[_0x4223('0x3d')],_0x20bbc2['filters']),_0x1ed66d);if(_0x309c45['query'][_0x4223('0x4a')]){_0x4128ac['where']=_['merge'](_0x4128ac['where'],{'$or':_[_0x4223('0x37')](_0x1ed66d,function(_0x50de3e){if(_0x50de3e['type']!==_0x4223('0x4b')){var _0x37b818={};_0x37b818[_0x50de3e['name']]={'$like':'%'+_0x309c45['query'][_0x4223('0x4a')]+'%'};return _0x37b818;}})});}_0x4128ac=_[_0x4223('0x4c')]({},_0x4128ac,_0x309c45[_0x4223('0x4d')]);var _0x5c0104={'where':_0x4128ac[_0x4223('0x48')]};return db[_0x4223('0x38')][_0x4223('0x2c')](_0x5c0104)[_0x4223('0x1b')](function(_0x2226b8){_0x2587a9[_0x4223('0x2c')]=_0x2226b8;if(_0x309c45['query'][_0x4223('0x4e')]){_0x4128ac[_0x4223('0x4f')]=[{'all':!![]}];}return db['Network']['findAll'](_0x4128ac);})[_0x4223('0x1b')](function(_0xecde5f){_0x2587a9[_0x4223('0x50')]=_0xecde5f;return _0x2587a9;})[_0x4223('0x1b')](respondWithFilteredResult(_0x19e58c,_0x4128ac))['catch'](handleError(_0x19e58c,null));};exports[_0x4223('0x51')]=function(_0x49868f,_0x39c14b){var _0x4d5698={'raw':!![],'where':{'id':_0x49868f['params']['id']}},_0x33a9cd={};_0x33a9cd['model']=_[_0x4223('0x3c')](db[_0x4223('0x38')][_0x4223('0x39')]);_0x33a9cd['query']=_[_0x4223('0x3c')](_0x49868f[_0x4223('0x3d')]);_0x33a9cd[_0x4223('0x3e')]=_['intersection'](_0x33a9cd['model'],_0x33a9cd[_0x4223('0x3d')]);_0x4d5698['attributes']=_['intersection'](_0x33a9cd[_0x4223('0x43')],qs['fields'](_0x49868f[_0x4223('0x3d')][_0x4223('0x41')]));_0x4d5698[_0x4223('0x40')]=_0x4d5698[_0x4223('0x40')]['length']?_0x4d5698['attributes']:_0x33a9cd[_0x4223('0x43')];if(_0x49868f[_0x4223('0x3d')][_0x4223('0x4e')]){_0x4d5698['include']=[{'all':!![]}];}_0x4d5698=_[_0x4223('0x4c')]({},_0x4d5698,_0x49868f[_0x4223('0x4d')]);return db[_0x4223('0x38')][_0x4223('0x52')](_0x4d5698)[_0x4223('0x1b')](handleEntityNotFound(_0x39c14b,null))[_0x4223('0x1b')](respondWithResult(_0x39c14b,null))['catch'](handleError(_0x39c14b,null));};exports['create']=function(_0x388e2a,_0x141c2f,_0x251d37){var _0xeb1320;return db[_0x4223('0x53')][_0x4223('0x54')](function(_0x52087a){return db[_0x4223('0x38')]['create'](_0x388e2a[_0x4223('0x55')],{'raw':!![]})[_0x4223('0x1b')](function(_0xf5cfe){_0xeb1320=_0xf5cfe;return db['Network'][_0x4223('0x56')]({'where':{'type':_0x388e2a[_0x4223('0x55')][_0x4223('0x3a')]},'raw':!![]});})[_0x4223('0x1b')](function(_0x72ea48){if(_0xeb1320[_0x4223('0x3a')][_0x4223('0x57')]()==_0x4223('0x58')){var _0x27df03=fs[_0x4223('0x59')](path[_0x4223('0x5a')](config[_0x4223('0x5b')],_0x4223('0x5c')),'utf8');var _0x5cbbdd=ejs[_0x4223('0x5d')](_0x27df03,{'networks':_0x72ea48||[]});fs[_0x4223('0x5e')]('/etc/asterisk/stun_xcally.conf',_0x5cbbdd);return respondWithRpcPromise(_0x4223('0x5f'),'create',{'module':_0x4223('0x60')});}else if(_0xeb1320[_0x4223('0x3a')][_0x4223('0x57')]()==_0x4223('0x61')){var _0x2ee307=fs[_0x4223('0x59')](path[_0x4223('0x5a')](config[_0x4223('0x5b')],'server/files/templates/turn_multiple.ejs'),_0x4223('0x62'));var _0x1b9351=ejs[_0x4223('0x5d')](_0x2ee307,{'networks':_0x72ea48||[]});fs['writeFileSync'](_0x4223('0x63'),_0x1b9351);return respondWithRpcPromise('Reload','create',{'module':_0x4223('0x60')});}else{var _0x3b8c91=fs[_0x4223('0x59')](path[_0x4223('0x5a')](config[_0x4223('0x5b')],'server/files/templates/network.ejs'),_0x4223('0x62'));var _0x5d524f=ejs['render'](_0x3b8c91,{'networks':_0x72ea48||[]});fs['writeFileSync'](util[_0x4223('0x64')](_0x4223('0x65'),_0x388e2a[_0x4223('0x55')]['type'][_0x4223('0x66')]()),_0x5d524f);return respondWithRpcPromise(_0x4223('0x5f'),_0x4223('0x67'),{'module':'chan_sip.so'});}return null;})[_0x4223('0x1b')](function(){return _0xeb1320;});})[_0x4223('0x1b')](respondWithResult(_0x141c2f,0xc9))['catch'](handleError(_0x141c2f,null));};exports[_0x4223('0x68')]=function(_0x451cc0,_0x182b32,_0x58f40d){var _0xdc73a6;return db[_0x4223('0x53')][_0x4223('0x54')](function(_0x20374c){return db['Network'][_0x4223('0x52')]({'where':{'id':_0x451cc0[_0x4223('0x69')]['id']}})[_0x4223('0x1b')](handleEntityNotFound(_0x182b32,null))['then'](saveUpdates(_0x451cc0[_0x4223('0x55')],null))[_0x4223('0x1b')](function(_0x1dde3a){if(_0x1dde3a){_0xdc73a6=_0x1dde3a;return db[_0x4223('0x38')][_0x4223('0x56')]({'where':{'type':_0xdc73a6[_0x4223('0x3a')]},'raw':!![]});}return null;})[_0x4223('0x1b')](function(_0x1d41f4){if(_0xdc73a6['type'][_0x4223('0x57')]()==_0x4223('0x58')){var _0x3e5544=fs[_0x4223('0x59')](path['join'](config['root'],_0x4223('0x5c')),_0x4223('0x62'));var _0x1b4150=ejs[_0x4223('0x5d')](_0x3e5544,{'networks':_0x1d41f4||[]});fs[_0x4223('0x5e')](_0x4223('0x6a'),_0x1b4150);return respondWithRpcPromise('Reload','update',{'module':_0x4223('0x60')});}else if(_0xdc73a6[_0x4223('0x3a')]['toUpperCase']()==_0x4223('0x61')){var _0xdf6293=fs[_0x4223('0x59')](path[_0x4223('0x5a')](config[_0x4223('0x5b')],_0x4223('0x6b')),_0x4223('0x62'));var _0x4a132d=ejs[_0x4223('0x5d')](_0xdf6293,{'networks':_0x1d41f4||[]});fs[_0x4223('0x5e')](_0x4223('0x63'),_0x4a132d);return respondWithRpcPromise('Reload',_0x4223('0x68'),{'module':_0x4223('0x60')});}else{var _0x2ee2d0=fs[_0x4223('0x59')](path[_0x4223('0x5a')](config[_0x4223('0x5b')],_0x4223('0x6c')),'utf8');var _0x2f36a1=ejs['render'](_0x2ee2d0,{'networks':_0x1d41f4||[]});fs[_0x4223('0x5e')](util['format'](_0x4223('0x65'),_0x451cc0[_0x4223('0x55')][_0x4223('0x3a')][_0x4223('0x66')]()),_0x2f36a1);return respondWithRpcPromise(_0x4223('0x5f'),_0x4223('0x68'),{'module':_0x4223('0x6d')});}return null;})[_0x4223('0x1b')](function(_0x4bc1e7){if(_0x4bc1e7){return _0xdc73a6;}return null;});})[_0x4223('0x1b')](respondWithResult(_0x182b32,null))[_0x4223('0x6e')](handleError(_0x182b32,null));};exports[_0x4223('0x32')]=function(_0x48d491,_0x12d61e,_0x55df02){var _0x4efa74;return db[_0x4223('0x38')][_0x4223('0x52')]({'where':{'id':_0x48d491[_0x4223('0x69')]['id']}})[_0x4223('0x1b')](function(_0x3195b8){_0x4efa74=_0x3195b8;return _0x3195b8;})[_0x4223('0x1b')](handleEntityNotFound(_0x12d61e,null))[_0x4223('0x1b')](removeEntity(_0x12d61e,null))[_0x4223('0x1b')](function(){if(_0x4efa74){return db['Network'][_0x4223('0x56')]({'where':{'type':_0x4efa74[_0x4223('0x3a')]},'raw':!![]});}})[_0x4223('0x1b')](function(_0x4c8dbb){if(_0x4efa74[_0x4223('0x3a')][_0x4223('0x57')]()=='STUN'){var _0x1d12d8=fs['readFileSync'](path['join'](config['root'],_0x4223('0x5c')),_0x4223('0x62'));var _0xdb3d0a=ejs[_0x4223('0x5d')](_0x1d12d8,{'networks':_0x4c8dbb||[]});fs[_0x4223('0x5e')](_0x4223('0x6a'),_0xdb3d0a);return respondWithRpcPromise(_0x4223('0x5f'),_0x4223('0x32'),{'module':'res_stun_monitor.so'});}else if(_0x4efa74['type']['toUpperCase']()=='TURN'){var _0x205999=fs[_0x4223('0x59')](path[_0x4223('0x5a')](config[_0x4223('0x5b')],'server/files/templates/turn_multiple.ejs'),_0x4223('0x62'));var _0x3aafc3=ejs[_0x4223('0x5d')](_0x205999,{'networks':_0x4c8dbb||[]});fs['writeFileSync']('/etc/asterisk/turn_xcally.conf',_0x3aafc3);return respondWithRpcPromise(_0x4223('0x5f'),_0x4223('0x32'),{'module':'res_stun_monitor.so'});}else{var _0x51bfbe=fs[_0x4223('0x59')](path[_0x4223('0x5a')](config[_0x4223('0x5b')],_0x4223('0x6c')),_0x4223('0x62'));var _0x53fd3c=ejs['render'](_0x51bfbe,{'networks':_0x4c8dbb||[]});fs[_0x4223('0x5e')](util['format'](_0x4223('0x65'),_0x48d491[_0x4223('0x55')][_0x4223('0x3a')]['toLowerCase']()),_0x53fd3c);return respondWithRpcPromise(_0x4223('0x5f'),_0x4223('0x32'),{'module':_0x4223('0x6d')});}return null;})['catch'](handleError(_0x12d61e,null));}; \ No newline at end of file +var _0x43b8=['bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','client','http','request','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','sendStatus','stack','name','send','index','Network','rawAttributes','fieldName','type','model','map','query','keys','intersection','attributes','fields','length','nolimit','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','show','params','include','find','create','sequelize','findAll','body','toUpperCase','STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','server/files/templates/turn_multiple.ejs','render','/etc/asterisk/turn_xcally.conf','format','chan_sip.so','server/files/templates/network.ejs','/etc/asterisk/sip_xcally_%s.conf','destroy','TURN','toLowerCase','eml-format','rimraf','fast-json-patch','request-promise','moment'];(function(_0x1da04e,_0x31024b){var _0xdd8c41=function(_0x2036f9){while(--_0x2036f9){_0x1da04e['push'](_0x1da04e['shift']());}};_0xdd8c41(++_0x31024b);}(_0x43b8,0x13c));var _0x843b=function(_0x25ef21,_0x235385){_0x25ef21=_0x25ef21-0x0;var _0x54d896=_0x43b8[_0x25ef21];return _0x54d896;};'use strict';var emlformat=require(_0x843b('0x0'));var rimraf=require(_0x843b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x843b('0x2'));var rp=require(_0x843b('0x3'));var moment=require(_0x843b('0x4'));var BPromise=require(_0x843b('0x5'));var Mustache=require(_0x843b('0x6'));var util=require(_0x843b('0x7'));var path=require(_0x843b('0x8'));var sox=require(_0x843b('0x9'));var csv=require(_0x843b('0xa'));var ejs=require(_0x843b('0xb'));var fs=require('fs');var fs_extra=require(_0x843b('0xc'));var _=require(_0x843b('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x843b('0xe'));var deskjs=require(_0x843b('0xf'));var toCsv=require(_0x843b('0xa'));var querystring=require('querystring');var Papa=require(_0x843b('0x10'));var Redis=require(_0x843b('0x11'));var authService=require(_0x843b('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x843b('0x13'));var logger=require('../../config/logger')(_0x843b('0x14'));var utils=require(_0x843b('0x15'));var config=require(_0x843b('0x16'));var licenseUtil=require(_0x843b('0x17'));var db=require('../../mysqldb')['db'];var jayson=require(_0x843b('0x18'));var client=jayson[_0x843b('0x19')][_0x843b('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x541999,_0x55d54b,_0x25542a,_0x43f26a){return new BPromise(function(_0x3f80a0,_0x3cc2e2){var _0x377c5a=_0x43f26a||client;return _0x377c5a[_0x843b('0x1b')](_0x541999,_0x25542a)['then'](function(_0x7540e5){logger[_0x843b('0x1c')](_0x843b('0x1d'),_0x55d54b,_0x843b('0x1e'));logger[_0x843b('0x1f')](_0x843b('0x20'),_0x55d54b,'request\x20sent',JSON[_0x843b('0x21')](_0x7540e5));if(_0x7540e5['error']){if(_0x7540e5['error'][_0x843b('0x22')]===0x1f4){logger[_0x843b('0x23')]('Network,\x20%s,\x20%s',_0x55d54b,_0x7540e5[_0x843b('0x23')][_0x843b('0x24')]);return _0x3cc2e2(_0x7540e5[_0x843b('0x23')]['message']);}logger[_0x843b('0x23')](_0x843b('0x1d'),_0x55d54b,_0x7540e5[_0x843b('0x23')][_0x843b('0x24')]);return _0x3f80a0(_0x7540e5[_0x843b('0x23')][_0x843b('0x24')]);}else{logger[_0x843b('0x1c')](_0x843b('0x1d'),_0x55d54b,_0x843b('0x1e'));_0x3f80a0(_0x7540e5['result'][_0x843b('0x24')]);}})[_0x843b('0x25')](function(_0x104f07){logger[_0x843b('0x23')](_0x843b('0x1d'),_0x55d54b,_0x104f07);_0x3cc2e2(_0x104f07);});});}function respondWithStatusCode(_0x5dfe18,_0xdc0ca7){_0xdc0ca7=_0xdc0ca7||0xcc;return function(_0xb1d454){if(_0xb1d454){return _0x5dfe18['sendStatus'](_0xdc0ca7);}return _0x5dfe18[_0x843b('0x26')](_0xdc0ca7)[_0x843b('0x27')]();};}function respondWithResult(_0x473193,_0x5ac5a8){_0x5ac5a8=_0x5ac5a8||0xc8;return function(_0x4d6b2f){if(_0x4d6b2f){return _0x473193[_0x843b('0x26')](_0x5ac5a8)[_0x843b('0x28')](_0x4d6b2f);}};}function respondWithFilteredResult(_0x40109f,_0x3b9503){return function(_0x25f7e4){if(_0x25f7e4){var _0x1a3804=typeof _0x3b9503[_0x843b('0x29')]==='undefined'&&typeof _0x3b9503[_0x843b('0x2a')]==='undefined';var _0x4e5d3f=_0x25f7e4[_0x843b('0x2b')];var _0x41d021=_0x1a3804?0x0:_0x3b9503['offset'];var _0x3d6c4d=_0x1a3804?_0x25f7e4[_0x843b('0x2b')]:_0x3b9503[_0x843b('0x29')]+_0x3b9503[_0x843b('0x2a')];var _0x5ddaee;if(_0x3d6c4d>=_0x4e5d3f){_0x3d6c4d=_0x4e5d3f;_0x5ddaee=0xc8;}else{_0x5ddaee=0xce;}_0x40109f[_0x843b('0x26')](_0x5ddaee);return _0x40109f[_0x843b('0x2c')](_0x843b('0x2d'),_0x41d021+'-'+_0x3d6c4d+'/'+_0x4e5d3f)[_0x843b('0x28')](_0x25f7e4);}return null;};}function patchUpdates(_0x4d3eee){return function(_0x2ce848){try{jsonpatch[_0x843b('0x2e')](_0x2ce848,_0x4d3eee,!![]);}catch(_0x1a6c89){return BPromise[_0x843b('0x2f')](_0x1a6c89);}return _0x2ce848[_0x843b('0x30')]();};}function saveUpdates(_0x1cc7c9,_0x25a8f7){return function(_0x51375b){if(_0x51375b){return _0x51375b[_0x843b('0x31')](_0x1cc7c9)[_0x843b('0x32')](function(_0x3cbfcc){return _0x3cbfcc;});}return null;};}function removeEntity(_0x1df8b9,_0x2cff87){return function(_0x3f223e){if(_0x3f223e){return _0x3f223e['destroy']()[_0x843b('0x32')](function(){_0x1df8b9[_0x843b('0x26')](0xcc)[_0x843b('0x27')]();});}};}function handleEntityNotFound(_0x1a3ba7,_0x5c04a3){return function(_0x316945){if(!_0x316945){_0x1a3ba7[_0x843b('0x33')](0x194);}return _0x316945;};}function handleError(_0x516077,_0xb16019){_0xb16019=_0xb16019||0x1f4;return function(_0x219bbe){logger['error'](_0x219bbe[_0x843b('0x34')]);if(_0x219bbe[_0x843b('0x35')]){delete _0x219bbe[_0x843b('0x35')];}_0x516077['status'](_0xb16019)[_0x843b('0x36')](_0x219bbe);};}exports[_0x843b('0x37')]=function(_0x62f3bf,_0x113507){var _0x5733e9={},_0x43da2e={},_0x52e92c={'count':0x0,'rows':[]};var _0x3c41b4=_['map'](db[_0x843b('0x38')][_0x843b('0x39')],function(_0x1a88ef){return{'name':_0x1a88ef[_0x843b('0x3a')],'type':_0x1a88ef[_0x843b('0x3b')]['key']};});_0x43da2e[_0x843b('0x3c')]=_[_0x843b('0x3d')](_0x3c41b4,_0x843b('0x35'));_0x43da2e[_0x843b('0x3e')]=_[_0x843b('0x3f')](_0x62f3bf[_0x843b('0x3e')]);_0x43da2e['filters']=_[_0x843b('0x40')](_0x43da2e['model'],_0x43da2e['query']);_0x5733e9[_0x843b('0x41')]=_['intersection'](_0x43da2e[_0x843b('0x3c')],qs[_0x843b('0x42')](_0x62f3bf[_0x843b('0x3e')]['fields']));_0x5733e9[_0x843b('0x41')]=_0x5733e9[_0x843b('0x41')][_0x843b('0x43')]?_0x5733e9[_0x843b('0x41')]:_0x43da2e[_0x843b('0x3c')];if(!_0x62f3bf[_0x843b('0x3e')]['hasOwnProperty'](_0x843b('0x44'))){_0x5733e9[_0x843b('0x2a')]=qs['limit'](_0x62f3bf[_0x843b('0x3e')][_0x843b('0x2a')]);_0x5733e9[_0x843b('0x29')]=qs['offset'](_0x62f3bf['query'][_0x843b('0x29')]);}_0x5733e9['order']=qs[_0x843b('0x45')](_0x62f3bf[_0x843b('0x3e')][_0x843b('0x45')]);_0x5733e9[_0x843b('0x46')]=qs[_0x843b('0x47')](_[_0x843b('0x48')](_0x62f3bf[_0x843b('0x3e')],_0x43da2e[_0x843b('0x47')]),_0x3c41b4);if(_0x62f3bf[_0x843b('0x3e')][_0x843b('0x49')]){_0x5733e9[_0x843b('0x46')]=_['merge'](_0x5733e9['where'],{'$or':_[_0x843b('0x3d')](_0x3c41b4,function(_0x3a1de7){if(_0x3a1de7[_0x843b('0x3b')]!==_0x843b('0x4a')){var _0x4617d7={};_0x4617d7[_0x3a1de7[_0x843b('0x35')]]={'$like':'%'+_0x62f3bf['query'][_0x843b('0x49')]+'%'};return _0x4617d7;}})});}_0x5733e9=_[_0x843b('0x4b')]({},_0x5733e9,_0x62f3bf[_0x843b('0x4c')]);var _0x34d211={'where':_0x5733e9[_0x843b('0x46')]};return db[_0x843b('0x38')][_0x843b('0x2b')](_0x34d211)[_0x843b('0x32')](function(_0xdc1df8){_0x52e92c['count']=_0xdc1df8;if(_0x62f3bf[_0x843b('0x3e')][_0x843b('0x4d')]){_0x5733e9['include']=[{'all':!![]}];}return db['Network']['findAll'](_0x5733e9);})['then'](function(_0x342169){_0x52e92c['rows']=_0x342169;return _0x52e92c;})[_0x843b('0x32')](respondWithFilteredResult(_0x113507,_0x5733e9))[_0x843b('0x25')](handleError(_0x113507,null));};exports[_0x843b('0x4e')]=function(_0x304d05,_0x419d91){var _0x36d82b={'raw':!![],'where':{'id':_0x304d05[_0x843b('0x4f')]['id']}},_0x5cce31={};_0x5cce31[_0x843b('0x3c')]=_[_0x843b('0x3f')](db[_0x843b('0x38')][_0x843b('0x39')]);_0x5cce31[_0x843b('0x3e')]=_[_0x843b('0x3f')](_0x304d05[_0x843b('0x3e')]);_0x5cce31['filters']=_['intersection'](_0x5cce31[_0x843b('0x3c')],_0x5cce31[_0x843b('0x3e')]);_0x36d82b[_0x843b('0x41')]=_[_0x843b('0x40')](_0x5cce31[_0x843b('0x3c')],qs[_0x843b('0x42')](_0x304d05[_0x843b('0x3e')][_0x843b('0x42')]));_0x36d82b[_0x843b('0x41')]=_0x36d82b[_0x843b('0x41')][_0x843b('0x43')]?_0x36d82b[_0x843b('0x41')]:_0x5cce31['model'];if(_0x304d05[_0x843b('0x3e')][_0x843b('0x4d')]){_0x36d82b[_0x843b('0x50')]=[{'all':!![]}];}_0x36d82b=_[_0x843b('0x4b')]({},_0x36d82b,_0x304d05[_0x843b('0x4c')]);return db[_0x843b('0x38')][_0x843b('0x51')](_0x36d82b)['then'](handleEntityNotFound(_0x419d91,null))[_0x843b('0x32')](respondWithResult(_0x419d91,null))['catch'](handleError(_0x419d91,null));};exports[_0x843b('0x52')]=function(_0xdd7518,_0x1c6f36,_0x23ccfc){var _0x570b0b;return db[_0x843b('0x53')]['transaction'](function(_0x1f3e46){return db[_0x843b('0x38')][_0x843b('0x52')](_0xdd7518['body'],{'raw':!![]})[_0x843b('0x32')](function(_0x599b7b){_0x570b0b=_0x599b7b;return db['Network'][_0x843b('0x54')]({'where':{'type':_0xdd7518[_0x843b('0x55')][_0x843b('0x3b')]},'raw':!![]});})[_0x843b('0x32')](function(_0x115d04){if(_0x570b0b[_0x843b('0x3b')][_0x843b('0x56')]()==_0x843b('0x57')){var _0x13cf42=fs[_0x843b('0x58')](path[_0x843b('0x59')](config[_0x843b('0x5a')],_0x843b('0x5b')),_0x843b('0x5c'));var _0x4dc05b=ejs['render'](_0x13cf42,{'networks':_0x115d04||[]});fs[_0x843b('0x5d')](_0x843b('0x5e'),_0x4dc05b);return respondWithRpcPromise(_0x843b('0x5f'),_0x843b('0x52'),{'module':_0x843b('0x60')});}else if(_0x570b0b[_0x843b('0x3b')][_0x843b('0x56')]()=='TURN'){var _0x43edaf=fs['readFileSync'](path['join'](config['root'],_0x843b('0x61')),_0x843b('0x5c'));var _0x21c1ff=ejs[_0x843b('0x62')](_0x43edaf,{'networks':_0x115d04||[]});fs[_0x843b('0x5d')](_0x843b('0x63'),_0x21c1ff);return respondWithRpcPromise('Reload','create',{'module':_0x843b('0x60')});}else{var _0x22dfb2=fs[_0x843b('0x58')](path[_0x843b('0x59')](config['root'],'server/files/templates/network.ejs'),_0x843b('0x5c'));var _0xae2513=ejs[_0x843b('0x62')](_0x22dfb2,{'networks':_0x115d04||[]});fs[_0x843b('0x5d')](util[_0x843b('0x64')]('/etc/asterisk/sip_xcally_%s.conf',_0xdd7518['body'][_0x843b('0x3b')]['toLowerCase']()),_0xae2513);return respondWithRpcPromise(_0x843b('0x5f'),_0x843b('0x52'),{'module':_0x843b('0x65')});}return null;})[_0x843b('0x32')](function(){return _0x570b0b;});})[_0x843b('0x32')](respondWithResult(_0x1c6f36,0xc9))['catch'](handleError(_0x1c6f36,null));};exports[_0x843b('0x31')]=function(_0x487cec,_0x7df9c5,_0x5543d0){var _0x2ad323;return db[_0x843b('0x53')]['transaction'](function(_0x2d254d){return db['Network'][_0x843b('0x51')]({'where':{'id':_0x487cec[_0x843b('0x4f')]['id']}})['then'](handleEntityNotFound(_0x7df9c5,null))[_0x843b('0x32')](saveUpdates(_0x487cec[_0x843b('0x55')],null))[_0x843b('0x32')](function(_0x1343bc){if(_0x1343bc){_0x2ad323=_0x1343bc;return db[_0x843b('0x38')][_0x843b('0x54')]({'where':{'type':_0x2ad323['type']},'raw':!![]});}return null;})['then'](function(_0x168a61){if(_0x2ad323[_0x843b('0x3b')][_0x843b('0x56')]()=='STUN'){var _0x2bebeb=fs[_0x843b('0x58')](path[_0x843b('0x59')](config['root'],'server/files/templates/stun_multiple.ejs'),'utf8');var _0x49fc6d=ejs[_0x843b('0x62')](_0x2bebeb,{'networks':_0x168a61||[]});fs[_0x843b('0x5d')](_0x843b('0x5e'),_0x49fc6d);return respondWithRpcPromise(_0x843b('0x5f'),_0x843b('0x31'),{'module':_0x843b('0x60')});}else if(_0x2ad323[_0x843b('0x3b')]['toUpperCase']()=='TURN'){var _0x3555ac=fs[_0x843b('0x58')](path[_0x843b('0x59')](config[_0x843b('0x5a')],_0x843b('0x61')),_0x843b('0x5c'));var _0x3aee46=ejs['render'](_0x3555ac,{'networks':_0x168a61||[]});fs[_0x843b('0x5d')]('/etc/asterisk/turn_xcally.conf',_0x3aee46);return respondWithRpcPromise('Reload',_0x843b('0x31'),{'module':_0x843b('0x60')});}else{var _0x2ca5ba=fs[_0x843b('0x58')](path[_0x843b('0x59')](config['root'],_0x843b('0x66')),_0x843b('0x5c'));var _0x3ffde5=ejs[_0x843b('0x62')](_0x2ca5ba,{'networks':_0x168a61||[]});fs[_0x843b('0x5d')](util[_0x843b('0x64')](_0x843b('0x67'),_0x487cec['body'][_0x843b('0x3b')]['toLowerCase']()),_0x3ffde5);return respondWithRpcPromise(_0x843b('0x5f'),_0x843b('0x31'),{'module':_0x843b('0x65')});}return null;})[_0x843b('0x32')](function(_0x3b2ac8){if(_0x3b2ac8){return _0x2ad323;}return null;});})[_0x843b('0x32')](respondWithResult(_0x7df9c5,null))[_0x843b('0x25')](handleError(_0x7df9c5,null));};exports[_0x843b('0x68')]=function(_0x42666d,_0x5328ee,_0x557c72){var _0xf4729c;return db['Network']['find']({'where':{'id':_0x42666d['params']['id']}})[_0x843b('0x32')](function(_0x1645f2){_0xf4729c=_0x1645f2;return _0x1645f2;})[_0x843b('0x32')](handleEntityNotFound(_0x5328ee,null))['then'](removeEntity(_0x5328ee,null))[_0x843b('0x32')](function(){if(_0xf4729c){return db[_0x843b('0x38')]['findAll']({'where':{'type':_0xf4729c['type']},'raw':!![]});}})[_0x843b('0x32')](function(_0x4f8619){if(_0xf4729c['type'][_0x843b('0x56')]()==_0x843b('0x57')){var _0x484ef1=fs[_0x843b('0x58')](path[_0x843b('0x59')](config[_0x843b('0x5a')],'server/files/templates/stun_multiple.ejs'),'utf8');var _0x2b8e3d=ejs['render'](_0x484ef1,{'networks':_0x4f8619||[]});fs[_0x843b('0x5d')](_0x843b('0x5e'),_0x2b8e3d);return respondWithRpcPromise(_0x843b('0x5f'),_0x843b('0x68'),{'module':'res_stun_monitor.so'});}else if(_0xf4729c[_0x843b('0x3b')]['toUpperCase']()==_0x843b('0x69')){var _0x260465=fs[_0x843b('0x58')](path[_0x843b('0x59')](config['root'],_0x843b('0x61')),_0x843b('0x5c'));var _0x42d952=ejs[_0x843b('0x62')](_0x260465,{'networks':_0x4f8619||[]});fs['writeFileSync']('/etc/asterisk/turn_xcally.conf',_0x42d952);return respondWithRpcPromise('Reload',_0x843b('0x68'),{'module':_0x843b('0x60')});}else{var _0x2d231f=fs['readFileSync'](path['join'](config[_0x843b('0x5a')],_0x843b('0x66')),_0x843b('0x5c'));var _0x1522aa=ejs[_0x843b('0x62')](_0x2d231f,{'networks':_0x4f8619||[]});fs[_0x843b('0x5d')](util[_0x843b('0x64')](_0x843b('0x67'),_0x42666d[_0x843b('0x55')]['type'][_0x843b('0x6a')]()),_0x1522aa);return respondWithRpcPromise(_0x843b('0x5f'),'destroy',{'module':_0x843b('0x65')});}return null;})[_0x843b('0x25')](handleError(_0x5328ee,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index da30a32..1de752b 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 _0xf403=['path','rimraf','../../config/environment','define','Network','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xdcf9ec,_0x44e08e){var _0x2ef172=function(_0x5821aa){while(--_0x5821aa){_0xdcf9ec['push'](_0xdcf9ec['shift']());}};_0x2ef172(++_0x44e08e);}(_0xf403,0x1d3));var _0x3f40=function(_0x1eeaad,_0x4a2db5){_0x1eeaad=_0x1eeaad-0x0;var _0x53bce8=_0xf403[_0x1eeaad];return _0x53bce8;};'use strict';var _=require(_0x3f40('0x0'));var util=require('util');var logger=require(_0x3f40('0x1'))(_0x3f40('0x2'));var moment=require(_0x3f40('0x3'));var BPromise=require(_0x3f40('0x4'));var rp=require(_0x3f40('0x5'));var fs=require('fs');var path=require(_0x3f40('0x6'));var rimraf=require(_0x3f40('0x7'));var config=require(_0x3f40('0x8'));var attributes=require('./network.attributes');module['exports']=function(_0x33f742,_0x22d5e6){return _0x33f742[_0x3f40('0x9')](_0x3f40('0xa'),attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xda65=['../../config/environment','./network.attributes','exports','Network','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0xda65,0x1d0));var _0x5da6=function(_0x17eba5,_0x3a0baf){_0x17eba5=_0x17eba5-0x0;var _0x5a6e80=_0xda65[_0x17eba5];return _0x5a6e80;};'use strict';var _=require(_0x5da6('0x0'));var util=require(_0x5da6('0x1'));var logger=require(_0x5da6('0x2'))('api');var moment=require(_0x5da6('0x3'));var BPromise=require(_0x5da6('0x4'));var rp=require(_0x5da6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5da6('0x6'));var attributes=require(_0x5da6('0x7'));module[_0x5da6('0x8')]=function(_0x32ff03,_0x75126f){return _0x32ff03['define'](_0x5da6('0x9'),attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/network/network.rpc.js b/server/api/network/network.rpc.js index 8f15a06..0824595 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(_0x493e46,_0x17ea39){var _0x20ff9d=function(_0x85170c){while(--_0x85170c){_0x493e46['push'](_0x493e46['shift']());}};_0x20ff9d(++_0x17ea39);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file +var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7a54,0x106));var _0x47a5=function(_0xb257ad,_0x461619){_0xb257ad=_0xb257ad-0x0;var _0x58948e=_0x7a54[_0xb257ad];return _0x58948e;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index 91357d1..3d5cf62 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 _0x6337=['/:id/canned_answers','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','index','describe','/:id','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications','create','post','addAnswer','/:id/notify','notify','addApplications','/:id/users','addAgents','/:id/send','send','put','update','delete','destroy','removeDispositions'];(function(_0x20241e,_0x189bc0){var _0x17e8a8=function(_0x58814f){while(--_0x58814f){_0x20241e['push'](_0x20241e['shift']());}};_0x17e8a8(++_0x189bc0);}(_0x6337,0x12b));var _0x7633=function(_0x525b4c,_0x232348){_0x525b4c=_0x525b4c-0x0;var _0x184b7a=_0x6337[_0x525b4c];return _0x184b7a;};'use strict';var multer=require(_0x7633('0x0'));var util=require('util');var path=require(_0x7633('0x1'));var timeout=require('connect-timeout');var express=require(_0x7633('0x2'));var router=express[_0x7633('0x3')]();var fs_extra=require(_0x7633('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x7633('0x5'));var config=require('../../config/environment');var controller=require('./openchannelAccount.controller');router[_0x7633('0x6')]('/',auth[_0x7633('0x7')](),controller[_0x7633('0x8')]);router[_0x7633('0x6')]('/describe',auth[_0x7633('0x7')](),controller[_0x7633('0x9')]);router[_0x7633('0x6')](_0x7633('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x7633('0x6')](_0x7633('0xb'),auth[_0x7633('0x7')](),controller[_0x7633('0xc')]);router[_0x7633('0x6')]('/:id/canned_answers',auth[_0x7633('0x7')](),controller[_0x7633('0xd')]);router['get'](_0x7633('0xe'),auth[_0x7633('0x7')](),controller[_0x7633('0xf')]);router['get']('/:id/interactions',auth[_0x7633('0x7')](),controller['getInteractions']);router['get']('/:id/users',auth[_0x7633('0x7')](),controller['getAgents']);router['post']('/',auth[_0x7633('0x7')](),controller[_0x7633('0x10')]);router[_0x7633('0x11')](_0x7633('0xb'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x7633('0x11')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x7633('0x12')]);router['post'](_0x7633('0x13'),controller[_0x7633('0x14')]);router[_0x7633('0x11')](_0x7633('0xe'),auth[_0x7633('0x7')](),controller[_0x7633('0x15')]);router['post'](_0x7633('0x16'),auth[_0x7633('0x7')](),controller[_0x7633('0x17')]);router[_0x7633('0x11')](_0x7633('0x18'),auth[_0x7633('0x7')](),controller[_0x7633('0x19')]);router[_0x7633('0x1a')](_0x7633('0xa'),auth[_0x7633('0x7')](),controller[_0x7633('0x1b')]);router[_0x7633('0x1c')]('/:id',auth['isAuthenticated'](),controller[_0x7633('0x1d')]);router[_0x7633('0x1c')](_0x7633('0xb'),auth['isAuthenticated'](),controller[_0x7633('0x1e')]);router[_0x7633('0x1c')](_0x7633('0x1f'),auth[_0x7633('0x7')](),controller['removeAnswers']);router[_0x7633('0x1c')](_0x7633('0x16'),auth[_0x7633('0x7')](),controller['removeAgents']);module[_0x7633('0x20')]=router; \ No newline at end of file +var _0x4662=['exports','multer','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','/describe','describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','getAgents','post','create','/:id/dispositions','addDisposition','addAnswer','/:id/notify','addApplications','/:id/users','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents'];(function(_0xc1e05a,_0x5d4cdc){var _0xb6a24c=function(_0x45200a){while(--_0x45200a){_0xc1e05a['push'](_0xc1e05a['shift']());}};_0xb6a24c(++_0x5d4cdc);}(_0x4662,0x17d));var _0x2466=function(_0x3c98d5,_0x47ee0e){_0x3c98d5=_0x3c98d5-0x0;var _0x2f6ea5=_0x4662[_0x3c98d5];return _0x2f6ea5;};'use strict';var multer=require(_0x2466('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2466('0x1'));var router=express[_0x2466('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x2466('0x3'));var interaction=require(_0x2466('0x4'));var config=require(_0x2466('0x5'));var controller=require(_0x2466('0x6'));router[_0x2466('0x7')]('/',auth[_0x2466('0x8')](),controller['index']);router[_0x2466('0x7')](_0x2466('0x9'),auth[_0x2466('0x8')](),controller[_0x2466('0xa')]);router[_0x2466('0x7')](_0x2466('0xb'),auth[_0x2466('0x8')](),controller[_0x2466('0xc')]);router['get']('/:id/dispositions',auth['isAuthenticated'](),controller[_0x2466('0xd')]);router[_0x2466('0x7')](_0x2466('0xe'),auth[_0x2466('0x8')](),controller[_0x2466('0xf')]);router[_0x2466('0x7')](_0x2466('0x10'),auth[_0x2466('0x8')](),controller[_0x2466('0x11')]);router[_0x2466('0x7')](_0x2466('0x12'),auth['isAuthenticated'](),controller[_0x2466('0x13')]);router['get']('/:id/users',auth[_0x2466('0x8')](),controller[_0x2466('0x14')]);router[_0x2466('0x15')]('/',auth['isAuthenticated'](),controller[_0x2466('0x16')]);router[_0x2466('0x15')](_0x2466('0x17'),auth[_0x2466('0x8')](),controller[_0x2466('0x18')]);router['post'](_0x2466('0xe'),auth['isAuthenticated'](),controller[_0x2466('0x19')]);router['post'](_0x2466('0x1a'),controller['notify']);router[_0x2466('0x15')](_0x2466('0x10'),auth[_0x2466('0x8')](),controller[_0x2466('0x1b')]);router[_0x2466('0x15')](_0x2466('0x1c'),auth[_0x2466('0x8')](),controller[_0x2466('0x1d')]);router[_0x2466('0x15')]('/:id/send',auth['isAuthenticated'](),controller['send']);router[_0x2466('0x1e')](_0x2466('0xb'),auth[_0x2466('0x8')](),controller[_0x2466('0x1f')]);router[_0x2466('0x20')](_0x2466('0xb'),auth['isAuthenticated'](),controller[_0x2466('0x21')]);router[_0x2466('0x20')]('/:id/dispositions',auth[_0x2466('0x8')](),controller[_0x2466('0x22')]);router[_0x2466('0x20')]('/:id/canned_answers',auth[_0x2466('0x8')](),controller[_0x2466('0x23')]);router[_0x2466('0x20')](_0x2466('0x1c'),auth[_0x2466('0x8')](),controller[_0x2466('0x24')]);module[_0x2466('0x25')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 0ddbf35..7b00525 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 _0xfd05=['generate','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','mandatoryDispositionPauseId','sequelize','exports','STRING','name'];(function(_0x59947c,_0x594122){var _0x324b2b=function(_0x5cbc04){while(--_0x5cbc04){_0x59947c['push'](_0x59947c['shift']());}};_0x324b2b(++_0x594122);}(_0xfd05,0xd9));var _0x5fd0=function(_0x193e01,_0x45df72){_0x193e01=_0x193e01-0x0;var _0xfbed4b=_0xfd05[_0x193e01];return _0xfbed4b;};'use strict';var Sequelize=require(_0x5fd0('0x0'));var rs=require('randomstring');module[_0x5fd0('0x1')]={'name':{'type':Sequelize[_0x5fd0('0x2')],'unique':_0x5fd0('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x5fd0('0x2')]},'token':{'type':Sequelize[_0x5fd0('0x2')],'defaultValue':function(){return rs[_0x5fd0('0x4')]();}},'replyUri':{'type':Sequelize[_0x5fd0('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x5fd0('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x5fd0('0x5')],'defaultValue':function(){return _0x5fd0('0x6');}},'notificationSound':{'type':Sequelize[_0x5fd0('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x5fd0('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x5fd0('0x2')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x5fd0('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x5fd0('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x5fd0('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x5fd0('0x9')},'mandatoryDisposition':{'type':Sequelize[_0x5fd0('0x7')],'defaultValue':![],'comment':_0x5fd0('0xa'),'set':function(_0x51e1aa){if(!_0x51e1aa)this[_0x5fd0('0xb')](_0x5fd0('0xc'),null);this[_0x5fd0('0xb')]('mandatoryDisposition',_0x51e1aa);}}}; \ No newline at end of file +var _0xad8a=['mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue'];(function(_0x5ce68d,_0x314ca2){var _0x249370=function(_0x2bedd5){while(--_0x2bedd5){_0x5ce68d['push'](_0x5ce68d['shift']());}};_0x249370(++_0x314ca2);}(_0xad8a,0x112));var _0xaad8=function(_0x48ddc7,_0x259b27){_0x48ddc7=_0x48ddc7-0x0;var _0x65a3b8=_0xad8a[_0x48ddc7];return _0x65a3b8;};'use strict';var Sequelize=require(_0xaad8('0x0'));var rs=require(_0xaad8('0x1'));module[_0xaad8('0x2')]={'name':{'type':Sequelize[_0xaad8('0x3')],'unique':_0xaad8('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0xaad8('0x3')]},'token':{'type':Sequelize[_0xaad8('0x3')],'defaultValue':function(){return rs[_0xaad8('0x5')]();}},'replyUri':{'type':Sequelize[_0xaad8('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xaad8('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xaad8('0x6');}},'notificationSound':{'type':Sequelize[_0xaad8('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xaad8('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xaad8('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xaad8('0x3')]},'queueTransfer':{'type':Sequelize[_0xaad8('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xaad8('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xaad8('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xaad8('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xaad8('0x8')],'allowNull':!![],'defaultValue':null,'comment':_0xaad8('0x9')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xaad8('0xa'),'set':function(_0x1467dc){if(!_0x1467dc)this[_0xaad8('0xb')]('mandatoryDispositionPauseId',null);this[_0xaad8('0xb')](_0xaad8('0xc'),_0x1467dc);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 1ad229c..7ce9382 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 _0xf970=['DESC','OpenchannelApplication','applications','Applications','list','orderBy','asc','account','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','messageId','interaction','created','autoclose','close','unmanaged','OpenchannelMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting','EventManager','sequelize','bulkCreate','priority','getApplications','Contact','fullname','internal','Tags','color','tag','omit','userOpenchannelAccount:save','isArray','emit','userOpenchannelAccount:remove','getAgents','out','Messages','push','dataValues','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','then','info','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','undefined','limit','offset','Content-Range','apply','reject','update','destroy','OpenchannelAccounts','end','stack','name','send','index','Pause','mandatoryDispositionPause','map','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','merge','type','options','OpenchannelAccount','count','include','findAll','rows','show','params','keys','rawAttributes','includeAll','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','findOne','nolimit','where','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts'];(function(_0x2440fe,_0x281a11){var _0x5cf734=function(_0x38e12b){while(--_0x38e12b){_0x2440fe['push'](_0x2440fe['shift']());}};_0x5cf734(++_0x281a11);}(_0xf970,0x1b2));var _0x0f97=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf970[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x0f97('0x0'));var rimraf=require(_0x0f97('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0f97('0x2'));var rp=require('request-promise');var moment=require(_0x0f97('0x3'));var BPromise=require(_0x0f97('0x4'));var Mustache=require(_0x0f97('0x5'));var util=require(_0x0f97('0x6'));var path=require(_0x0f97('0x7'));var sox=require(_0x0f97('0x8'));var csv=require('to-csv');var ejs=require(_0x0f97('0x9'));var fs=require('fs');var fs_extra=require(_0x0f97('0xa'));var _=require(_0x0f97('0xb'));var squel=require(_0x0f97('0xc'));var crypto=require(_0x0f97('0xd'));var jsforce=require(_0x0f97('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x0f97('0xf'));var querystring=require(_0x0f97('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0f97('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x0f97('0x12'));var hardwareService=require(_0x0f97('0x13'));var logger=require(_0x0f97('0x14'))(_0x0f97('0x15'));var utils=require(_0x0f97('0x16'));var config=require(_0x0f97('0x17'));var licenseUtil=require(_0x0f97('0x18'));var db=require(_0x0f97('0x19'))['db'];config[_0x0f97('0x1a')]=_[_0x0f97('0x1b')](config[_0x0f97('0x1a')],{'host':_0x0f97('0x1c'),'port':0x18eb});var socket=require(_0x0f97('0x1d'))(new Redis(config[_0x0f97('0x1a')]));require('./openchannelAccount.socket')[_0x0f97('0x1e')](socket);var jayson=require(_0x0f97('0x1f'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x0f97('0x20')]['http']({'port':0x232a});function respondWithRpcPromise(_0xbb70dd,_0x39a9ff,_0x5e4d87,_0x484933){return new BPromise(function(_0x4b9553,_0x1eb1c3){var _0x3c8027=_0x484933||client;return _0x3c8027['request'](_0xbb70dd,_0x5e4d87)[_0x0f97('0x21')](function(_0x59196a){logger[_0x0f97('0x22')]('OpenchannelAccount,\x20%s,\x20%s',_0x39a9ff,_0x0f97('0x23'));logger[_0x0f97('0x24')](_0x0f97('0x25'),_0x39a9ff,_0x0f97('0x23'),JSON[_0x0f97('0x26')](_0x59196a));if(_0x59196a['error']){if(_0x59196a['error']['code']===0x1f4){logger[_0x0f97('0x27')](_0x0f97('0x28'),_0x39a9ff,_0x59196a[_0x0f97('0x27')][_0x0f97('0x29')]);return _0x1eb1c3(_0x59196a[_0x0f97('0x27')]['message']);}logger[_0x0f97('0x27')](_0x0f97('0x28'),_0x39a9ff,_0x59196a['error'][_0x0f97('0x29')]);return _0x4b9553(_0x59196a[_0x0f97('0x27')][_0x0f97('0x29')]);}else{logger[_0x0f97('0x22')]('OpenchannelAccount,\x20%s,\x20%s',_0x39a9ff,_0x0f97('0x23'));_0x4b9553(_0x59196a[_0x0f97('0x2a')]['message']);}})[_0x0f97('0x2b')](function(_0x1d85db){logger['error'](_0x0f97('0x28'),_0x39a9ff,_0x1d85db);_0x1eb1c3(_0x1d85db);});});}function respondWithStatusCode(_0x4a463c,_0x36e4d0){_0x36e4d0=_0x36e4d0||0xcc;return function(_0x16638e){if(_0x16638e){return _0x4a463c[_0x0f97('0x2c')](_0x36e4d0);}return _0x4a463c[_0x0f97('0x2d')](_0x36e4d0)['end']();};}function respondWithResult(_0x40a0e0,_0x176153){_0x176153=_0x176153||0xc8;return function(_0x360d5e){if(_0x360d5e){return _0x40a0e0[_0x0f97('0x2d')](_0x176153)[_0x0f97('0x2e')](_0x360d5e);}};}function respondWithFilteredResult(_0x3792ec,_0x24b531){return function(_0x2691c6){if(_0x2691c6){var _0xa688f6=typeof _0x24b531['offset']===_0x0f97('0x2f')&&typeof _0x24b531[_0x0f97('0x30')]==='undefined';var _0x264228=_0x2691c6['count'];var _0x400aac=_0xa688f6?0x0:_0x24b531[_0x0f97('0x31')];var _0x2a9993=_0xa688f6?_0x2691c6['count']:_0x24b531[_0x0f97('0x31')]+_0x24b531[_0x0f97('0x30')];var _0x22bf27;if(_0x2a9993>=_0x264228){_0x2a9993=_0x264228;_0x22bf27=0xc8;}else{_0x22bf27=0xce;}_0x3792ec[_0x0f97('0x2d')](_0x22bf27);return _0x3792ec['set'](_0x0f97('0x32'),_0x400aac+'-'+_0x2a9993+'/'+_0x264228)[_0x0f97('0x2e')](_0x2691c6);}return null;};}function patchUpdates(_0x5915f2){return function(_0x354763){try{jsonpatch[_0x0f97('0x33')](_0x354763,_0x5915f2,!![]);}catch(_0x2f3288){return BPromise[_0x0f97('0x34')](_0x2f3288);}return _0x354763['save']();};}function saveUpdates(_0x6f3786,_0x285c98){return function(_0x476483){if(_0x476483){return _0x476483[_0x0f97('0x35')](_0x6f3786)[_0x0f97('0x21')](function(_0x42f45c){return _0x42f45c;});}return null;};}function removeEntity(_0x42e919,_0xc32b69){return function(_0x1e15aa){if(_0x1e15aa){return _0x1e15aa[_0x0f97('0x36')]()[_0x0f97('0x21')](function(){var _0x2f6f67=_0x1e15aa['get']({'plain':!![]});var _0x510301=_0x0f97('0x37');return db['UserProfileResource'][_0x0f97('0x36')]({'where':{'type':_0x510301,'resourceId':_0x2f6f67['id']}})['then'](function(){return _0x1e15aa;});})[_0x0f97('0x21')](function(){_0x42e919[_0x0f97('0x2d')](0xcc)[_0x0f97('0x38')]();});}};}function handleEntityNotFound(_0x5a9d01,_0x2f8759){return function(_0x1c7914){if(!_0x1c7914){_0x5a9d01['sendStatus'](0x194);}return _0x1c7914;};}function handleError(_0x30edc4,_0x3ae60b){_0x3ae60b=_0x3ae60b||0x1f4;return function(_0x4ee5fc){logger['error'](_0x4ee5fc[_0x0f97('0x39')]);if(_0x4ee5fc[_0x0f97('0x3a')]){delete _0x4ee5fc['name'];}_0x30edc4[_0x0f97('0x2d')](_0x3ae60b)[_0x0f97('0x3b')](_0x4ee5fc);};}exports[_0x0f97('0x3c')]=function(_0x4cde42,_0x381961){var _0x4f82e0={'include':[{'model':db[_0x0f97('0x3d')],'as':_0x0f97('0x3e')}]},_0x41626b={},_0x47050e={'count':0x0,'rows':[]};var _0x2f1353=_[_0x0f97('0x3f')](db['OpenchannelAccount']['rawAttributes'],function(_0x22febb){return{'name':_0x22febb[_0x0f97('0x40')],'type':_0x22febb['type'][_0x0f97('0x41')]};});_0x41626b[_0x0f97('0x42')]=_[_0x0f97('0x3f')](_0x2f1353,_0x0f97('0x3a'));_0x41626b[_0x0f97('0x43')]=_['keys'](_0x4cde42['query']);_0x41626b[_0x0f97('0x44')]=_[_0x0f97('0x45')](_0x41626b[_0x0f97('0x42')],_0x41626b[_0x0f97('0x43')]);_0x4f82e0[_0x0f97('0x46')]=_[_0x0f97('0x45')](_0x41626b[_0x0f97('0x42')],qs[_0x0f97('0x47')](_0x4cde42[_0x0f97('0x43')][_0x0f97('0x47')]));_0x4f82e0[_0x0f97('0x46')]=_0x4f82e0['attributes'][_0x0f97('0x48')]?_0x4f82e0['attributes']:_0x41626b[_0x0f97('0x42')];if(!_0x4cde42[_0x0f97('0x43')][_0x0f97('0x49')]('nolimit')){_0x4f82e0[_0x0f97('0x30')]=qs['limit'](_0x4cde42[_0x0f97('0x43')][_0x0f97('0x30')]);_0x4f82e0[_0x0f97('0x31')]=qs[_0x0f97('0x31')](_0x4cde42['query'][_0x0f97('0x31')]);}_0x4f82e0[_0x0f97('0x4a')]=qs[_0x0f97('0x4b')](_0x4cde42[_0x0f97('0x43')]['sort']);_0x4f82e0['where']=qs[_0x0f97('0x44')](_[_0x0f97('0x4c')](_0x4cde42[_0x0f97('0x43')],_0x41626b[_0x0f97('0x44')]),_0x2f1353);if(_0x4cde42[_0x0f97('0x43')][_0x0f97('0x4d')]){_0x4f82e0['where']=_[_0x0f97('0x4e')](_0x4f82e0['where'],{'$or':_[_0x0f97('0x3f')](_0x2f1353,function(_0x4f287a){if(_0x4f287a[_0x0f97('0x4f')]!=='VIRTUAL'){var _0x356878={};_0x356878[_0x4f287a[_0x0f97('0x3a')]]={'$like':'%'+_0x4cde42[_0x0f97('0x43')][_0x0f97('0x4d')]+'%'};return _0x356878;}})});}_0x4f82e0=_[_0x0f97('0x4e')]({},_0x4f82e0,_0x4cde42[_0x0f97('0x50')]);var _0xfc2a0={'where':_0x4f82e0['where']};return db[_0x0f97('0x51')][_0x0f97('0x52')](_0xfc2a0)[_0x0f97('0x21')](function(_0x43380c){_0x47050e[_0x0f97('0x52')]=_0x43380c;if(_0x4cde42['query']['includeAll']){_0x4f82e0[_0x0f97('0x53')]=[{'all':!![]}];}return db[_0x0f97('0x51')][_0x0f97('0x54')](_0x4f82e0);})[_0x0f97('0x21')](function(_0x497be5){_0x47050e[_0x0f97('0x55')]=_0x497be5;return _0x47050e;})[_0x0f97('0x21')](respondWithFilteredResult(_0x381961,_0x4f82e0))[_0x0f97('0x2b')](handleError(_0x381961,null));};exports[_0x0f97('0x56')]=function(_0x1b93bb,_0x1b6588){var _0x227ccf={'raw':![],'where':{'id':_0x1b93bb[_0x0f97('0x57')]['id']},'include':[{'model':db[_0x0f97('0x3d')],'as':_0x0f97('0x3e')}]},_0x1b9604={};_0x1b9604[_0x0f97('0x42')]=_[_0x0f97('0x58')](db[_0x0f97('0x51')][_0x0f97('0x59')]);_0x1b9604[_0x0f97('0x43')]=_['keys'](_0x1b93bb[_0x0f97('0x43')]);_0x1b9604['filters']=_[_0x0f97('0x45')](_0x1b9604['model'],_0x1b9604[_0x0f97('0x43')]);_0x227ccf[_0x0f97('0x46')]=_[_0x0f97('0x45')](_0x1b9604[_0x0f97('0x42')],qs[_0x0f97('0x47')](_0x1b93bb['query'][_0x0f97('0x47')]));_0x227ccf[_0x0f97('0x46')]=_0x227ccf[_0x0f97('0x46')]['length']?_0x227ccf['attributes']:_0x1b9604[_0x0f97('0x42')];if(_0x1b93bb['query'][_0x0f97('0x5a')]){_0x227ccf[_0x0f97('0x53')]=[{'all':!![]}];}_0x227ccf=_[_0x0f97('0x4e')]({},_0x227ccf,_0x1b93bb[_0x0f97('0x50')]);return db[_0x0f97('0x51')]['find'](_0x227ccf)[_0x0f97('0x21')](handleEntityNotFound(_0x1b6588,null))['then'](respondWithResult(_0x1b6588,null))[_0x0f97('0x2b')](handleError(_0x1b6588,null));};exports[_0x0f97('0x5b')]=function(_0x4825ac,_0xeeb3b7){return db[_0x0f97('0x51')][_0x0f97('0x5b')](_0x4825ac[_0x0f97('0x5c')],{})[_0x0f97('0x21')](function(_0x2fc21a){var _0x5893f3=_0x4825ac[_0x0f97('0x5d')][_0x0f97('0x5e')]({'plain':!![]});if(!_0x5893f3)throw new Error(_0x0f97('0x5f'));if(_0x5893f3[_0x0f97('0x60')]===_0x0f97('0x5d')){var _0x1c0aa3=_0x2fc21a['get']({'plain':!![]});var _0x528d99=_0x0f97('0x37');return db[_0x0f97('0x61')][_0x0f97('0x62')]({'where':{'name':_0x528d99,'userProfileId':_0x5893f3[_0x0f97('0x63')]},'raw':!![]})[_0x0f97('0x21')](function(_0x37eacc){if(_0x37eacc&&_0x37eacc[_0x0f97('0x64')]===0x0){return db[_0x0f97('0x65')][_0x0f97('0x5b')]({'name':_0x1c0aa3['name'],'resourceId':_0x1c0aa3['id'],'type':_0x37eacc[_0x0f97('0x3a')],'sectionId':_0x37eacc['id']},{})[_0x0f97('0x21')](function(){return _0x2fc21a;});}else{return _0x2fc21a;}})[_0x0f97('0x2b')](function(_0x23d3e4){logger['error'](_0x0f97('0x66'),_0x23d3e4);throw _0x23d3e4;});}return _0x2fc21a;})[_0x0f97('0x21')](respondWithResult(_0xeeb3b7,0xc9))[_0x0f97('0x2b')](handleError(_0xeeb3b7,null));};exports[_0x0f97('0x35')]=function(_0x444f99,_0x4a091c){if(_0x444f99[_0x0f97('0x5c')]['id']){delete _0x444f99[_0x0f97('0x5c')]['id'];}return db['OpenchannelAccount'][_0x0f97('0x62')]({'where':{'id':_0x444f99[_0x0f97('0x57')]['id']},'include':[{'model':db['Pause'],'as':_0x0f97('0x3e')}]})[_0x0f97('0x21')](handleEntityNotFound(_0x4a091c,null))[_0x0f97('0x21')](saveUpdates(_0x444f99['body'],null))[_0x0f97('0x21')](respondWithResult(_0x4a091c,null))[_0x0f97('0x2b')](handleError(_0x4a091c,null));};exports[_0x0f97('0x36')]=function(_0x448fb3,_0x35b6e3){return db[_0x0f97('0x51')][_0x0f97('0x62')]({'where':{'id':_0x448fb3[_0x0f97('0x57')]['id']}})[_0x0f97('0x21')](handleEntityNotFound(_0x35b6e3,null))[_0x0f97('0x21')](removeEntity(_0x35b6e3,null))[_0x0f97('0x2b')](handleError(_0x35b6e3,null));};exports[_0x0f97('0x67')]=function(_0x40f6e2,_0x914e07){return db['OpenchannelAccount'][_0x0f97('0x67')]()[_0x0f97('0x21')](respondWithResult(_0x914e07,null))['catch'](handleError(_0x914e07,null));};exports[_0x0f97('0x68')]=function(_0x122639,_0x1d546f,_0x3f94a6){if(_0x122639[_0x0f97('0x5c')]['id']){delete _0x122639[_0x0f97('0x5c')]['id'];}return db[_0x0f97('0x51')]['find']({'where':{'id':_0x122639[_0x0f97('0x57')]['id']}})[_0x0f97('0x21')](handleEntityNotFound(_0x1d546f,null))['then'](function(_0x165c83){if(_0x165c83){_0x122639[_0x0f97('0x5c')][_0x0f97('0x69')]=_0x165c83['id'];return db[_0x0f97('0x6a')][_0x0f97('0x5b')](_0x122639[_0x0f97('0x5c')]);}})[_0x0f97('0x21')](respondWithResult(_0x1d546f,null))[_0x0f97('0x2b')](handleError(_0x1d546f,null));};exports[_0x0f97('0x6b')]=function(_0x2e2222,_0x16c1b2,_0x4e04be){var _0x53ea78={'raw':![],'where':{}};var _0x5b0464={};var _0x1b009c={'count':0x0,'rows':[]};return db[_0x0f97('0x51')][_0x0f97('0x6c')]({'where':{'id':_0x2e2222['params']['id']}})[_0x0f97('0x21')](handleEntityNotFound(_0x16c1b2,null))['then'](function(_0x7e045e){if(_0x7e045e){_0x5b0464['model']=_['keys'](db[_0x0f97('0x6a')][_0x0f97('0x59')]);_0x5b0464[_0x0f97('0x43')]=_[_0x0f97('0x58')](_0x2e2222[_0x0f97('0x43')]);_0x5b0464[_0x0f97('0x44')]=_[_0x0f97('0x45')](_0x5b0464[_0x0f97('0x42')],_0x5b0464[_0x0f97('0x43')]);_0x53ea78[_0x0f97('0x46')]=_[_0x0f97('0x45')](_0x5b0464['model'],qs[_0x0f97('0x47')](_0x2e2222[_0x0f97('0x43')][_0x0f97('0x47')]));_0x53ea78['attributes']=_0x53ea78[_0x0f97('0x46')][_0x0f97('0x48')]?_0x53ea78['attributes']:_0x5b0464[_0x0f97('0x42')];if(!_0x2e2222[_0x0f97('0x43')][_0x0f97('0x49')](_0x0f97('0x6d'))){_0x53ea78[_0x0f97('0x30')]=qs[_0x0f97('0x30')](_0x2e2222[_0x0f97('0x43')][_0x0f97('0x30')]);_0x53ea78[_0x0f97('0x31')]=qs[_0x0f97('0x31')](_0x2e2222[_0x0f97('0x43')]['offset']);}_0x53ea78['order']=qs[_0x0f97('0x4b')](_0x2e2222[_0x0f97('0x43')][_0x0f97('0x4b')]);_0x53ea78['where']=qs[_0x0f97('0x44')](_['pick'](_0x2e2222[_0x0f97('0x43')],_0x5b0464['filters']));_0x53ea78['where'][_0x0f97('0x69')]=_0x7e045e['id'];if(_0x2e2222[_0x0f97('0x43')][_0x0f97('0x4d')]){_0x53ea78['where']=_[_0x0f97('0x4e')](_0x53ea78[_0x0f97('0x6e')],{'$or':_[_0x0f97('0x3f')](_0x53ea78[_0x0f97('0x46')],function(_0x3a29d4){var _0x1cbbb9={};_0x1cbbb9[_0x3a29d4]={'$like':'%'+_0x2e2222[_0x0f97('0x43')]['filter']+'%'};return _0x1cbbb9;})});}_0x53ea78=_['merge']({},_0x53ea78,_0x2e2222[_0x0f97('0x50')]);return db['Disposition'][_0x0f97('0x52')]({'where':_0x53ea78[_0x0f97('0x6e')]})[_0x0f97('0x21')](function(_0x157eff){_0x1b009c[_0x0f97('0x52')]=_0x157eff;if(_0x2e2222['query'][_0x0f97('0x5a')]){_0x53ea78[_0x0f97('0x53')]=[{'all':!![]}];}return db[_0x0f97('0x6a')][_0x0f97('0x54')](_0x53ea78);})[_0x0f97('0x21')](function(_0x36218e){_0x1b009c[_0x0f97('0x55')]=_0x36218e;return _0x1b009c;});}})['then'](respondWithFilteredResult(_0x16c1b2,_0x53ea78))['catch'](handleError(_0x16c1b2,null));};exports['removeDispositions']=function(_0x2cf0af,_0xb5e91a,_0x4b86da){return db[_0x0f97('0x51')]['find']({'where':{'id':_0x2cf0af[_0x0f97('0x57')]['id']}})['then'](handleEntityNotFound(_0xb5e91a,null))['then'](function(_0xc82650){if(_0xc82650){return _0xc82650[_0x0f97('0x6f')](_0x2cf0af[_0x0f97('0x43')][_0x0f97('0x70')]);}})[_0x0f97('0x21')](respondWithStatusCode(_0xb5e91a,null))[_0x0f97('0x2b')](handleError(_0xb5e91a,null));};exports[_0x0f97('0x71')]=function(_0x5af76a,_0x12a2e5,_0x192afe){if(_0x5af76a['body']['id']){delete _0x5af76a['body']['id'];}return db[_0x0f97('0x51')][_0x0f97('0x62')]({'where':{'id':_0x5af76a[_0x0f97('0x57')]['id']}})[_0x0f97('0x21')](handleEntityNotFound(_0x12a2e5,null))['then'](function(_0x2f0001){if(_0x2f0001){_0x5af76a[_0x0f97('0x5c')][_0x0f97('0x69')]=_0x2f0001['id'];return db[_0x0f97('0x72')]['create'](_0x5af76a[_0x0f97('0x5c')]);}})['then'](respondWithResult(_0x12a2e5,null))['catch'](handleError(_0x12a2e5,null));};exports[_0x0f97('0x73')]=function(_0x2c4c90,_0x319880,_0x19a83d){var _0x4752cc={'raw':![],'where':{}};var _0x23a577={};var _0x27924f={'count':0x0,'rows':[]};return db[_0x0f97('0x51')][_0x0f97('0x6c')]({'where':{'id':_0x2c4c90[_0x0f97('0x57')]['id']}})['then'](handleEntityNotFound(_0x319880,null))[_0x0f97('0x21')](function(_0x59e55a){if(_0x59e55a){_0x23a577[_0x0f97('0x42')]=_[_0x0f97('0x58')](db[_0x0f97('0x72')][_0x0f97('0x59')]);_0x23a577[_0x0f97('0x43')]=_[_0x0f97('0x58')](_0x2c4c90[_0x0f97('0x43')]);_0x23a577['filters']=_['intersection'](_0x23a577[_0x0f97('0x42')],_0x23a577[_0x0f97('0x43')]);_0x4752cc['attributes']=_[_0x0f97('0x45')](_0x23a577[_0x0f97('0x42')],qs[_0x0f97('0x47')](_0x2c4c90[_0x0f97('0x43')]['fields']));_0x4752cc['attributes']=_0x4752cc[_0x0f97('0x46')][_0x0f97('0x48')]?_0x4752cc['attributes']:_0x23a577['model'];if(!_0x2c4c90['query'][_0x0f97('0x49')](_0x0f97('0x6d'))){_0x4752cc[_0x0f97('0x30')]=qs[_0x0f97('0x30')](_0x2c4c90[_0x0f97('0x43')][_0x0f97('0x30')]);_0x4752cc[_0x0f97('0x31')]=qs[_0x0f97('0x31')](_0x2c4c90['query'][_0x0f97('0x31')]);}_0x4752cc['order']=qs['sort'](_0x2c4c90[_0x0f97('0x43')][_0x0f97('0x4b')]);_0x4752cc[_0x0f97('0x6e')]=qs[_0x0f97('0x44')](_[_0x0f97('0x4c')](_0x2c4c90['query'],_0x23a577[_0x0f97('0x44')]));_0x4752cc[_0x0f97('0x6e')][_0x0f97('0x69')]=_0x59e55a['id'];if(_0x2c4c90[_0x0f97('0x43')][_0x0f97('0x4d')]){_0x4752cc[_0x0f97('0x6e')]=_[_0x0f97('0x4e')](_0x4752cc[_0x0f97('0x6e')],{'$or':_[_0x0f97('0x3f')](_0x4752cc[_0x0f97('0x46')],function(_0x52aba7){var _0x183e1a={};_0x183e1a[_0x52aba7]={'$like':'%'+_0x2c4c90['query']['filter']+'%'};return _0x183e1a;})});}_0x4752cc=_['merge']({},_0x4752cc,_0x2c4c90['options']);return db[_0x0f97('0x72')][_0x0f97('0x52')]({'where':_0x4752cc[_0x0f97('0x6e')]})[_0x0f97('0x21')](function(_0x4723f1){_0x27924f[_0x0f97('0x52')]=_0x4723f1;if(_0x2c4c90[_0x0f97('0x43')]['includeAll']){_0x4752cc[_0x0f97('0x53')]=[{'all':!![]}];}return db[_0x0f97('0x72')]['findAll'](_0x4752cc);})[_0x0f97('0x21')](function(_0x2d9e9a){_0x27924f[_0x0f97('0x55')]=_0x2d9e9a;return _0x27924f;});}})[_0x0f97('0x21')](respondWithFilteredResult(_0x319880,_0x4752cc))[_0x0f97('0x2b')](handleError(_0x319880,null));};exports[_0x0f97('0x74')]=function(_0x5c9d41,_0x50d535,_0x1e0123){return db[_0x0f97('0x51')][_0x0f97('0x62')]({'where':{'id':_0x5c9d41['params']['id']}})['then'](handleEntityNotFound(_0x50d535,null))[_0x0f97('0x21')](function(_0x43deeb){if(_0x43deeb){return _0x43deeb[_0x0f97('0x74')](_0x5c9d41[_0x0f97('0x43')]['ids']);}})[_0x0f97('0x21')](respondWithStatusCode(_0x50d535,null))[_0x0f97('0x2b')](handleError(_0x50d535,null));};exports[_0x0f97('0x75')]=function(_0x110144,_0x45f800,_0x5dfd9c){var _0x2d297={'body':_0x110144['body'],'channel':_0x0f97('0x76')};var _0x20f805=[];var _0x503f1a=[];var _0x47e022={};var _0x2fe5c3=![];return db[_0x0f97('0x77')][_0x0f97('0x67')]()['then'](function(_0x5b3b86){if(!_0x5b3b86){throw new db[(_0x0f97('0x78'))][(_0x0f97('0x79'))](_0x0f97('0x7a'));}_0x20f805=_['difference'](_['keys'](_0x5b3b86),[_0x0f97('0x7b'),_0x0f97('0x7c')]);_0x503f1a=_[_0x0f97('0x7d')](_[_0x0f97('0x58')](_0x5b3b86),[_0x0f97('0x7b'),'updatedAt',_0x0f97('0x7e'),_0x0f97('0x7f')]);if(_0x110144[_0x0f97('0x5c')]['id']){delete _0x110144[_0x0f97('0x5c')]['id'];}if(_[_0x0f97('0x80')](_0x110144[_0x0f97('0x5c')][_0x0f97('0x81')])){throw new db[(_0x0f97('0x78'))][(_0x0f97('0x79'))](_0x0f97('0x82'));}if(_[_0x0f97('0x80')](_0x110144[_0x0f97('0x5c')][_0x0f97('0x5c')])||_0x110144[_0x0f97('0x5c')][_0x0f97('0x5c')]===''){throw new db['Sequelize'][(_0x0f97('0x79'))](_0x0f97('0x83'));}if(_[_0x0f97('0x80')](_0x110144[_0x0f97('0x5c')][_0x0f97('0x84')])){throw new db[(_0x0f97('0x78'))][(_0x0f97('0x79'))](_0x0f97('0x85')+_0x503f1a);}if(!_[_0x0f97('0x86')](_0x503f1a,_0x110144[_0x0f97('0x5c')][_0x0f97('0x84')])){throw new db[(_0x0f97('0x78'))]['ValidationError'](_0x0f97('0x87')+_0x503f1a);}_0x47e022[_0x110144['body']['mapKey']]=_0x110144[_0x0f97('0x5c')][_0x0f97('0x81')];})[_0x0f97('0x21')](function(){return db[_0x0f97('0x51')][_0x0f97('0x62')]({'where':{'id':_0x110144['params']['id']},'include':[{'model':db[_0x0f97('0x88')],'as':_0x0f97('0x89'),'include':[{'model':db[_0x0f97('0x77')],'as':_0x0f97('0x8a'),'where':_0x47e022,'limit':0x1,'order':[[_0x0f97('0x7c'),_0x0f97('0x8b')]]}]},{'model':db[_0x0f97('0x8c')],'as':'Applications'}]});})['then'](handleEntityNotFound(_0x45f800,null))[_0x0f97('0x21')](function(_0x55ca09){if(_0x55ca09&&_0x55ca09['List']){_0x2d297['account']=_0x55ca09;_0x2d297[_0x0f97('0x8d')]=_0x55ca09[_0x0f97('0x8e')];_0x2d297[_0x0f97('0x8f')]=_0x55ca09[_0x0f97('0x89')];_0x2d297['applications']=_[_0x0f97('0x90')](_0x2d297['applications'],['priority'],[_0x0f97('0x91')]);if(_0x2d297['account'][_0x0f97('0x8e')]){delete _0x2d297['account']['Applications'];}if(_0x2d297[_0x0f97('0x92')][_0x0f97('0x89')]&&_0x2d297[_0x0f97('0x92')][_0x0f97('0x89')][_0x0f97('0x8a')][_0x0f97('0x48')]){return _0x2d297[_0x0f97('0x92')][_0x0f97('0x89')][_0x0f97('0x8a')][0x0];}var _0x38aa66=_[_0x0f97('0x1b')](_0x110144['body'],{'firstName':_0x110144['body'][_0x0f97('0x81')],'ListId':_0x55ca09[_0x0f97('0x7f')]});_0x38aa66[_0x110144['body'][_0x0f97('0x84')]]=_0x110144[_0x0f97('0x5c')][_0x0f97('0x81')];return db[_0x0f97('0x77')]['create'](_0x38aa66,{'fields':_0x20f805,'raw':!![]});}})[_0x0f97('0x21')](handleEntityNotFound(_0x45f800,null))['then'](function(_0x233a69){_0x2d297[_0x0f97('0x93')]=_0x233a69;if(_0x233a69){var _0x5a783c={'ContactId':_0x233a69['id'],'OpenchannelAccountId':_0x110144[_0x0f97('0x57')]['id'],'from':(_0x233a69[_0x0f97('0x94')]||'')+'\x20'+(_0x233a69[_0x0f97('0x95')]||'')};var _0x5e9cff={'OpenchannelAccountId':_0x110144[_0x0f97('0x57')]['id'],'closed':![]};if(_0x110144['body'][_0x0f97('0x96')]){_0x5e9cff[_0x0f97('0x96')]=_0x110144[_0x0f97('0x5c')][_0x0f97('0x96')];return db[_0x0f97('0x97')][_0x0f97('0x62')]({'where':_0x5e9cff})[_0x0f97('0x21')](function(_0x2aa0e3){if(_0x2aa0e3){return[_0x2aa0e3,![]];}_0x5a783c[_0x0f97('0x96')]=_0x110144[_0x0f97('0x5c')]['threadId'];_0x5a783c[_0x0f97('0x98')]=_0x110144[_0x0f97('0x5c')][_0x0f97('0x98')];return db[_0x0f97('0x97')][_0x0f97('0x5b')](_0x5a783c)['then'](function(_0x217a14){return[_0x217a14,!![]];});});}else{_0x5e9cff['threadId']=null;}_0x5e9cff[_0x0f97('0x99')]=_0x233a69['id'];return db[_0x0f97('0x97')][_0x0f97('0x62')]({'where':_0x5e9cff})[_0x0f97('0x21')](function(_0x1a7210){if(_0x1a7210){return[_0x1a7210,![]];}return db['OpenchannelInteraction'][_0x0f97('0x5b')](_0x5a783c)['then'](function(_0x19f1a5){return[_0x19f1a5,!![]];});});}})[_0x0f97('0x9a')](function(_0x4f6f05,_0x11c2a9){if(_0x4f6f05){_0x2fe5c3=_0x11c2a9;if(!_0x11c2a9){var _0x5e9401={'from':(_0x2d297['contact'][_0x0f97('0x94')]||'')+'\x20'+(_0x2d297['contact'][_0x0f97('0x95')]||'')};if(_0x110144[_0x0f97('0x5c')][_0x0f97('0x96')]&&_0x110144[_0x0f97('0x5c')]['messageId']&&_0x110144[_0x0f97('0x5c')][_0x0f97('0x96')]!=_0x110144['body'][_0x0f97('0x9b')]){_0x5e9401[_0x0f97('0x96')]=_0x110144[_0x0f97('0x5c')][_0x0f97('0x9b')];}return _0x4f6f05[_0x0f97('0x35')](_0x5e9401);}else{return _0x4f6f05;}}})['then'](function(_0x479a67){_0x2d297[_0x0f97('0x9c')]=_0x479a67[_0x0f97('0x5e')]({'plain':!![]});_0x2d297[_0x0f97('0x9c')][_0x0f97('0x9d')]=_0x2fe5c3;if(_0x2d297[_0x0f97('0x9c')][_0x0f97('0x9d')]){if(_0x2d297[_0x0f97('0x92')][_0x0f97('0x9e')]){_0x2d297[_0x0f97('0x8d')]['push']({'id':0x0,'priority':_0x2d297[_0x0f97('0x8d')][_0x0f97('0x48')]+0x1,'app':_0x0f97('0x9f'),'appdata':_0x0f97('0xa0'),'interval':'*,*,*,*'});}}return db[_0x0f97('0xa1')][_0x0f97('0x5b')]({'body':_0x110144['body']['body'],'OpenchannelAccountId':_0x110144['params']['id'],'OpenchannelInteractionId':_0x479a67['id'],'direction':'in','ContactId':_0x2d297[_0x0f97('0x93')]['id'],'AttachmentId':_0x110144[_0x0f97('0x5c')][_0x0f97('0xa2')]});})[_0x0f97('0x21')](function(_0x4388a7){_0x2d297[_0x0f97('0x29')]=_0x4388a7;if(_0x2d297[_0x0f97('0x9c')][_0x0f97('0xa3')]){return db[_0x0f97('0xa4')][_0x0f97('0x62')]({'attributes':['id',_0x0f97('0x3a')],'where':{'id':_0x2d297[_0x0f97('0x9c')][_0x0f97('0xa3')]}})[_0x0f97('0x21')](function(_0x3bac1a){if(_0x3bac1a){_0x2d297['applications'][_0x0f97('0xa5')]({'id':0x0,'priority':0x0,'app':_0x0f97('0xa6'),'appdata':_0x3bac1a[_0x0f97('0x3a')]+','+(_0x2d297[_0x0f97('0x92')][_0x0f97('0xa7')]||0xa),'interval':'*,*,*,*'});_0x2d297['forcedOwnership']=![];}return respondWithRpcPromise(_0x0f97('0xa8'),_0x0f97('0xa9'),_0x2d297);});}return respondWithRpcPromise(_0x0f97('0xa8'),_0x0f97('0xa9'),_0x2d297);})['then'](function(_0xdccb1c){respondWithRpcPromise('EventManager',_0x0f97('0xaa'),{'event':_0x0f97('0x75'),'message':_0xdccb1c},client9002);return _0xdccb1c;})['then'](respondWithResult(_0x45f800,null))[_0x0f97('0x2b')](handleError(_0x45f800,null));};exports['addApplications']=function(_0x9bae92,_0x5410b1,_0x483dea){return db['OpenchannelAccount']['findOne']({'where':{'id':_0x9bae92[_0x0f97('0x57')]['id']}})['then'](handleEntityNotFound(_0x5410b1,null))[_0x0f97('0x21')](function(_0xc9c1a4){if(_0xc9c1a4){return db[_0x0f97('0xab')]['transaction'](function(_0x4d062b){return db['OpenchannelApplication'][_0x0f97('0x36')]({'where':{'OpenchannelAccountId':_0x9bae92['params']['id']},'transaction':_0x4d062b})[_0x0f97('0x21')](function(_0x23b71d){var _0x4941c5=_[_0x0f97('0x3f')](_0x9bae92[_0x0f97('0x5c')],function(_0x5e3eeb){_0x5e3eeb[_0x0f97('0x69')]=_0x9bae92['params']['id'];return _0x5e3eeb;});return db[_0x0f97('0x8c')][_0x0f97('0xac')](_0x4941c5,{'transaction':_0x4d062b});});})[_0x0f97('0x21')](function(){return db['OpenchannelApplication']['findAndCountAll']({'where':{'OpenchannelAccountId':_0x9bae92[_0x0f97('0x57')]['id']},'order':_0x0f97('0xad')});});}})[_0x0f97('0x21')](respondWithResult(_0x5410b1,null))[_0x0f97('0x2b')](handleError(_0x5410b1,null));};exports[_0x0f97('0xae')]=function(_0x3f2d1b,_0xecf9ab,_0x299bc3){var _0x378f61={};var _0x13d601={};var _0x3cec9f;var _0x523a4e;return db[_0x0f97('0x51')][_0x0f97('0x6c')]({'where':{'id':_0x3f2d1b[_0x0f97('0x57')]['id']}})['then'](handleEntityNotFound(_0xecf9ab,null))[_0x0f97('0x21')](function(_0x33ab5e){if(_0x33ab5e){_0x3cec9f=_0x33ab5e;_0x13d601[_0x0f97('0x42')]=_['keys'](db[_0x0f97('0x8c')][_0x0f97('0x59')]);_0x13d601[_0x0f97('0x43')]=_[_0x0f97('0x58')](_0x3f2d1b['query']);_0x13d601[_0x0f97('0x44')]=_[_0x0f97('0x45')](_0x13d601['model'],_0x13d601[_0x0f97('0x43')]);_0x378f61['attributes']=_[_0x0f97('0x45')](_0x13d601[_0x0f97('0x42')],qs[_0x0f97('0x47')](_0x3f2d1b[_0x0f97('0x43')][_0x0f97('0x47')]));_0x378f61['attributes']=_0x378f61[_0x0f97('0x46')][_0x0f97('0x48')]?_0x378f61[_0x0f97('0x46')]:_0x13d601[_0x0f97('0x42')];_0x378f61['order']=qs[_0x0f97('0x4b')](_0x3f2d1b[_0x0f97('0x43')][_0x0f97('0x4b')]);_0x378f61['where']=qs[_0x0f97('0x44')](_[_0x0f97('0x4c')](_0x3f2d1b[_0x0f97('0x43')],_0x13d601[_0x0f97('0x44')]));if(_0x3f2d1b[_0x0f97('0x43')]['filter']){_0x378f61[_0x0f97('0x6e')]=_[_0x0f97('0x4e')](_0x378f61[_0x0f97('0x6e')],{'$or':_[_0x0f97('0x3f')](_0x378f61[_0x0f97('0x46')],function(_0x1e1995){var _0x4a8aa7={};_0x4a8aa7[_0x1e1995]={'$like':'%'+_0x3f2d1b[_0x0f97('0x43')]['filter']+'%'};return _0x4a8aa7;})});}_0x378f61=_[_0x0f97('0x4e')]({},_0x378f61,_0x3f2d1b[_0x0f97('0x50')]);return _0x3cec9f[_0x0f97('0xae')](_0x378f61);}})[_0x0f97('0x21')](function(_0x3d3605){if(_0x3d3605){_0x523a4e=_0x3d3605[_0x0f97('0x48')];if(!_0x3f2d1b[_0x0f97('0x43')][_0x0f97('0x49')]('nolimit')){_0x378f61[_0x0f97('0x30')]=qs[_0x0f97('0x30')](_0x3f2d1b[_0x0f97('0x43')]['limit']);_0x378f61[_0x0f97('0x31')]=qs[_0x0f97('0x31')](_0x3f2d1b['query'][_0x0f97('0x31')]);}return _0x3cec9f[_0x0f97('0xae')](_0x378f61);}})[_0x0f97('0x21')](function(_0xe0ab70){if(_0xe0ab70){return _0xe0ab70?{'count':_0x523a4e,'rows':_0xe0ab70}:null;}})[_0x0f97('0x21')](respondWithResult(_0xecf9ab,null))[_0x0f97('0x2b')](handleError(_0xecf9ab,null));};exports['getInteractions']=function(_0x3f9f1a,_0x12bec5,_0x1623f1){var _0x1206d4={'raw':![],'where':{}};var _0x401b78={};var _0x2f4d07={'count':0x0,'rows':[]};return db[_0x0f97('0x51')][_0x0f97('0x6c')]({'where':{'id':_0x3f9f1a[_0x0f97('0x57')]['id']}})[_0x0f97('0x21')](handleEntityNotFound(_0x12bec5,null))['then'](function(_0x5bb6e6){if(_0x5bb6e6){_0x401b78[_0x0f97('0x42')]=_[_0x0f97('0x58')](db['OpenchannelInteraction'][_0x0f97('0x59')]);_0x401b78[_0x0f97('0x43')]=_['keys'](_0x3f9f1a[_0x0f97('0x43')]);_0x401b78[_0x0f97('0x44')]=_[_0x0f97('0x45')](_0x401b78[_0x0f97('0x42')],_0x401b78[_0x0f97('0x43')]);_0x1206d4[_0x0f97('0x46')]=_['intersection'](_0x401b78[_0x0f97('0x42')],qs['fields'](_0x3f9f1a[_0x0f97('0x43')][_0x0f97('0x47')]));_0x1206d4[_0x0f97('0x46')]=_0x1206d4['attributes'][_0x0f97('0x48')]?_0x1206d4[_0x0f97('0x46')]:_0x401b78[_0x0f97('0x42')];if(!_0x3f9f1a['query']['hasOwnProperty']('nolimit')){_0x1206d4[_0x0f97('0x30')]=qs[_0x0f97('0x30')](_0x3f9f1a[_0x0f97('0x43')][_0x0f97('0x30')]);_0x1206d4['offset']=qs[_0x0f97('0x31')](_0x3f9f1a[_0x0f97('0x43')][_0x0f97('0x31')]);}_0x1206d4[_0x0f97('0x4a')]=qs[_0x0f97('0x4b')](_0x3f9f1a[_0x0f97('0x43')][_0x0f97('0x4b')]);_0x1206d4[_0x0f97('0x6e')]=qs[_0x0f97('0x44')](_[_0x0f97('0x4c')](_0x3f9f1a['query'],_0x401b78[_0x0f97('0x44')]));_0x1206d4[_0x0f97('0x6e')][_0x0f97('0x69')]=_0x5bb6e6['id'];if(_0x3f9f1a[_0x0f97('0x43')]['filter']){_0x1206d4[_0x0f97('0x6e')]=_[_0x0f97('0x4e')](_0x1206d4[_0x0f97('0x6e')],{'$or':_['map'](_0x1206d4[_0x0f97('0x46')],function(_0x4f2ec5){var _0x3a6a15={};_0x3a6a15[_0x4f2ec5]={'$like':'%'+_0x3f9f1a[_0x0f97('0x43')][_0x0f97('0x4d')]+'%'};return _0x3a6a15;})});}_0x1206d4=_['merge']({},_0x1206d4,_0x3f9f1a[_0x0f97('0x50')]);return db[_0x0f97('0x97')][_0x0f97('0x52')]({'where':_0x1206d4[_0x0f97('0x6e')]})['then'](function(_0x8bba1f){_0x2f4d07[_0x0f97('0x52')]=_0x8bba1f;if(_0x3f9f1a[_0x0f97('0x43')]['includeAll']){_0x1206d4['include']=[{'model':db[_0x0f97('0x77')],'as':_0x0f97('0xaf'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x0f97('0x3a'),_0x0f97('0xb0'),_0x0f97('0xb1')],'required':![]},{'model':db['Tag'],'as':_0x0f97('0xb2'),'attributes':['id',_0x0f97('0x3a'),_0x0f97('0xb3')],'where':_0x3f9f1a[_0x0f97('0x43')][_0x0f97('0xb4')]?{'id':_0x3f9f1a[_0x0f97('0x43')][_0x0f97('0xb4')]}:undefined,'required':_0x3f9f1a[_0x0f97('0x43')][_0x0f97('0xb4')]?!![]:![]}];}return db['OpenchannelInteraction']['findAll'](_0x1206d4);})[_0x0f97('0x21')](function(_0x5be99d){_0x2f4d07[_0x0f97('0x55')]=_0x5be99d;return _0x2f4d07;});}})[_0x0f97('0x21')](respondWithFilteredResult(_0x12bec5,_0x1206d4))[_0x0f97('0x2b')](handleError(_0x12bec5,null));};exports['addAgents']=function(_0x5e63c5,_0x2b59fb,_0x169895){return db[_0x0f97('0x51')][_0x0f97('0x62')]({'where':{'id':_0x5e63c5['params']['id']}})[_0x0f97('0x21')](handleEntityNotFound(_0x2b59fb,null))[_0x0f97('0x21')](function(_0x3cb85f){if(_0x3cb85f){return _0x3cb85f['addAgents'](_0x5e63c5[_0x0f97('0x5c')][_0x0f97('0x70')],_[_0x0f97('0xb5')](_0x5e63c5['body'],[_0x0f97('0x70'),'id'])||{})[_0x0f97('0x9a')](function(_0x59db10){for(var _0x83e99=0x0;_0x83e99<_0x5e63c5[_0x0f97('0x5c')]['ids']['length'];_0x83e99+=0x1){socket['emit'](_0x0f97('0xb6'),{'UserId':Number(_0x5e63c5[_0x0f97('0x5c')][_0x0f97('0x70')][_0x83e99]),'OpenchannelAccountId':Number(_0x5e63c5['params']['id'])});}return _0x59db10;});}})[_0x0f97('0x21')](respondWithResult(_0x2b59fb,null))['catch'](handleError(_0x2b59fb,null));};exports['removeAgents']=function(_0x52a7ff,_0x404c6d,_0x3cc3b7){return db['OpenchannelAccount'][_0x0f97('0x62')]({'where':{'id':_0x52a7ff['params']['id']}})[_0x0f97('0x21')](handleEntityNotFound(_0x404c6d,null))['then'](function(_0x43bc75){if(_0x43bc75){return _0x43bc75['removeAgents'](_0x52a7ff[_0x0f97('0x43')][_0x0f97('0x70')])['then'](function(){if(_[_0x0f97('0xb7')](_0x52a7ff[_0x0f97('0x43')][_0x0f97('0x70')])){for(var _0x439e05=0x0;_0x439e05<_0x52a7ff[_0x0f97('0x43')][_0x0f97('0x70')][_0x0f97('0x48')];_0x439e05+=0x1){socket[_0x0f97('0xb8')](_0x0f97('0xb9'),{'UserId':Number(_0x52a7ff[_0x0f97('0x43')][_0x0f97('0x70')][_0x439e05]),'OpenchannelAccountId':Number(_0x52a7ff['params']['id'])});}}else{socket['emit'](_0x0f97('0xb9'),{'UserId':Number(_0x52a7ff[_0x0f97('0x43')]['ids']),'OpenchannelAccountId':Number(_0x52a7ff[_0x0f97('0x57')]['id'])});}});}})[_0x0f97('0x21')](respondWithStatusCode(_0x404c6d,null))['catch'](handleError(_0x404c6d,null));};exports[_0x0f97('0xba')]=function(_0x3ff01c,_0x3a780a,_0x5918ed){var _0x273974={};var _0x244b1d={};var _0x319b9d;var _0x2d2b3d;return db[_0x0f97('0x51')][_0x0f97('0x6c')]({'where':{'id':_0x3ff01c[_0x0f97('0x57')]['id']}})[_0x0f97('0x21')](handleEntityNotFound(_0x3a780a,null))[_0x0f97('0x21')](function(_0x3cef25){if(_0x3cef25){_0x319b9d=_0x3cef25;_0x244b1d[_0x0f97('0x42')]=_[_0x0f97('0x58')](db[_0x0f97('0xa4')][_0x0f97('0x59')]);_0x244b1d['query']=_[_0x0f97('0x58')](_0x3ff01c[_0x0f97('0x43')]);_0x244b1d[_0x0f97('0x44')]=_[_0x0f97('0x45')](_0x244b1d[_0x0f97('0x42')],_0x244b1d[_0x0f97('0x43')]);_0x273974[_0x0f97('0x46')]=_[_0x0f97('0x45')](_0x244b1d[_0x0f97('0x42')],qs[_0x0f97('0x47')](_0x3ff01c[_0x0f97('0x43')][_0x0f97('0x47')]));_0x273974[_0x0f97('0x46')]=_0x273974[_0x0f97('0x46')][_0x0f97('0x48')]?_0x273974[_0x0f97('0x46')]:_0x244b1d[_0x0f97('0x42')];_0x273974[_0x0f97('0x4a')]=qs[_0x0f97('0x4b')](_0x3ff01c[_0x0f97('0x43')][_0x0f97('0x4b')]);_0x273974['where']=qs['filters'](_[_0x0f97('0x4c')](_0x3ff01c[_0x0f97('0x43')],_0x244b1d[_0x0f97('0x44')]));if(_0x3ff01c[_0x0f97('0x43')][_0x0f97('0x4d')]){_0x273974[_0x0f97('0x6e')]=_[_0x0f97('0x4e')](_0x273974['where'],{'$or':_[_0x0f97('0x3f')](_0x273974[_0x0f97('0x46')],function(_0x5a1c37){var _0x6c567a={};_0x6c567a[_0x5a1c37]={'$like':'%'+_0x3ff01c['query'][_0x0f97('0x4d')]+'%'};return _0x6c567a;})});}_0x273974=_[_0x0f97('0x4e')]({},_0x273974,_0x3ff01c[_0x0f97('0x50')]);return _0x319b9d['getAgents'](_0x273974);}})[_0x0f97('0x21')](function(_0x58830b){if(_0x58830b){_0x2d2b3d=_0x58830b['length'];if(!_0x3ff01c[_0x0f97('0x43')][_0x0f97('0x49')](_0x0f97('0x6d'))){_0x273974['limit']=qs[_0x0f97('0x30')](_0x3ff01c['query']['limit']);_0x273974[_0x0f97('0x31')]=qs[_0x0f97('0x31')](_0x3ff01c['query'][_0x0f97('0x31')]);}return _0x319b9d['getAgents'](_0x273974);}})[_0x0f97('0x21')](function(_0x1b45ab){if(_0x1b45ab){return _0x1b45ab?{'count':_0x2d2b3d,'rows':_0x1b45ab}:null;}})[_0x0f97('0x21')](respondWithResult(_0x3a780a,null))[_0x0f97('0x2b')](handleError(_0x3a780a,null));};exports[_0x0f97('0x3b')]=function(_0x1d09a9,_0xa891ce,_0x1f742f){var _0x54d411,_0x5c91b6,_0x3da4a6;if(_[_0x0f97('0x80')](_0x1d09a9[_0x0f97('0x5c')]['body'])||_0x1d09a9[_0x0f97('0x5c')][_0x0f97('0x5c')]===''){throw new db[(_0x0f97('0x78'))][(_0x0f97('0x79'))](_0x0f97('0x83'));}if(_[_0x0f97('0x80')](_0x1d09a9[_0x0f97('0x5c')]['to'])){}_0x54d411=_0x1d09a9[_0x0f97('0x5c')]['to'];return db[_0x0f97('0x51')]['findOne']({'where':{'id':_0x1d09a9['params']['id']}})['then'](handleEntityNotFound(_0xa891ce,null))['then'](function(_0x28e19d){if(_0x28e19d){return db[_0x0f97('0x51')][_0x0f97('0x62')]({'where':{'id':_0x28e19d['id']},'include':[{'model':db[_0x0f97('0x88')],'as':_0x0f97('0x89'),'include':[{'model':db[_0x0f97('0x77')],'as':_0x0f97('0x8a'),'where':{[_0x28e19d[_0x0f97('0x84')]]:_0x54d411},'limit':0x1,'order':[[_0x0f97('0x7c'),_0x0f97('0x8b')]]}]}]})[_0x0f97('0x21')](handleEntityNotFound(_0xa891ce,null))['then'](function(_0x4f27ce){if(_0x4f27ce&&_0x4f27ce[_0x0f97('0x89')]){_0x5c91b6=_0x4f27ce[_0x0f97('0x5e')]({'plain':!![]});if(_0x5c91b6[_0x0f97('0x89')]&&_0x5c91b6[_0x0f97('0x89')][_0x0f97('0x8a')][_0x0f97('0x48')]){return _0x5c91b6[_0x0f97('0x89')][_0x0f97('0x8a')][0x0];}return db['CmContact'][_0x0f97('0x5b')](_[_0x0f97('0x1b')](_0x1d09a9[_0x0f97('0x5c')],{'firstName':_0x54d411,[_0x4f27ce[_0x0f97('0x84')]]:_0x54d411,'phone':_0x54d411,'ListId':_0x5c91b6['ListId']}));}})[_0x0f97('0x21')](handleEntityNotFound(_0xa891ce,null))['then'](function(_0x5bc402){if(_0x5bc402){_0x3da4a6=_0x5bc402;return db[_0x0f97('0x97')][_0x0f97('0x62')]({'where':{'ContactId':_0x3da4a6['id'],'closed':![],'OpenchannelAccountId':_0x5c91b6['id']}})[_0x0f97('0x21')](function(_0x50ddb){if(_0x50ddb){return[_0x50ddb,![]];}return db[_0x0f97('0x97')]['create']({'UserId':_0x1d09a9[_0x0f97('0x5d')]['id'],'ContactId':_0x3da4a6['id'],'OpenchannelAccountId':_0x5c91b6['id'],'lastMsgDirection':_0x0f97('0xbb'),'Messages':[_[_0x0f97('0x4e')](_0x1d09a9['body'],{'read':![],'body':_0x1d09a9[_0x0f97('0x5c')]['body'],'OpenchannelAccountId':_0x5c91b6['id'],'UserId':_0x1d09a9[_0x0f97('0x5d')]['id'],'ContactId':_0x3da4a6['id']})]},{'include':[{'model':db[_0x0f97('0xa1')],'as':_0x0f97('0xbc')}]})[_0x0f97('0x21')](function(_0xc63f4d){return[_0xc63f4d,!![]];});});}})[_0x0f97('0x9a')](function(_0x1e4d19,_0x2b3380){if(_0x2b3380){return _0x1e4d19;}return db[_0x0f97('0xa1')][_0x0f97('0x5b')](_[_0x0f97('0x4e')](_0x1d09a9['body'],{'read':![],'body':_0x1d09a9[_0x0f97('0x5c')][_0x0f97('0x5c')],'OpenchannelAccountId':_0x5c91b6['id'],'OpenchannelInteractionId':_0x1e4d19['id'],'UserId':_0x1d09a9[_0x0f97('0x5d')]['id'],'ContactId':_0x3da4a6['id']}))[_0x0f97('0x21')](function(_0x11e9d1){_0x1e4d19['dataValues'][_0x0f97('0xbc')]=[];_0x1e4d19['dataValues'][_0x0f97('0xbc')][_0x0f97('0xbd')](_0x11e9d1[_0x0f97('0xbe')]);return _0x1e4d19;});});}})[_0x0f97('0x21')](respondWithResult(_0xa891ce,null))['catch'](handleError(_0xa891ce,null));}; \ No newline at end of file +var _0x7279=['nolimit','order','sort','pick','filter','where','map','VIRTUAL','options','includeAll','include','findAll','rows','params','keys','merge','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','OpenchannelAccountId','Disposition','getDispositions','findOne','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','openchannel','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','from\x20is\x20mandatory','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','DESC','OpenchannelApplication','applications','Applications','orderBy','priority','account','ListId','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','messageId','interaction','created','push','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','forcedOwnership','startRouting','Start','EventManager','addApplications','transaction','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','addAgents','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','body\x20is\x20mandatory\x20and\x20not\x20empty','Contacts','out','Messages','dataValues','eml-format','rimraf','fast-json-patch','request-promise','bluebird','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','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','client','http','then','info','request\x20sent','debug','stringify','error','code','OpenchannelAccount,\x20%s,\x20%s','message','result','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','get','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','OpenchannelAccount','rawAttributes','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty'];(function(_0x4c78d0,_0x5646f9){var _0x332176=function(_0x39863f){while(--_0x39863f){_0x4c78d0['push'](_0x4c78d0['shift']());}};_0x332176(++_0x5646f9);}(_0x7279,0x1e7));var _0x9727=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x7279[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0x9727('0x0'));var rimraf=require(_0x9727('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9727('0x2'));var rp=require(_0x9727('0x3'));var moment=require('moment');var BPromise=require(_0x9727('0x4'));var Mustache=require(_0x9727('0x5'));var util=require(_0x9727('0x6'));var path=require(_0x9727('0x7'));var sox=require(_0x9727('0x8'));var csv=require(_0x9727('0x9'));var ejs=require(_0x9727('0xa'));var fs=require('fs');var fs_extra=require(_0x9727('0xb'));var _=require(_0x9727('0xc'));var squel=require(_0x9727('0xd'));var crypto=require(_0x9727('0xe'));var jsforce=require(_0x9727('0xf'));var deskjs=require(_0x9727('0x10'));var toCsv=require(_0x9727('0x9'));var querystring=require(_0x9727('0x11'));var Papa=require('papaparse');var Redis=require(_0x9727('0x12'));var authService=require(_0x9727('0x13'));var qs=require(_0x9727('0x14'));var as=require(_0x9727('0x15'));var hardwareService=require(_0x9727('0x16'));var logger=require('../../config/logger')(_0x9727('0x17'));var utils=require(_0x9727('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x9727('0x19'));var db=require(_0x9727('0x1a'))['db'];config[_0x9727('0x1b')]=_[_0x9727('0x1c')](config[_0x9727('0x1b')],{'host':_0x9727('0x1d'),'port':0x18eb});var socket=require(_0x9727('0x1e'))(new Redis(config['redis']));require(_0x9727('0x1f'))[_0x9727('0x20')](socket);var jayson=require('jayson/promise');var client=jayson[_0x9727('0x21')][_0x9727('0x22')]({'port':0x232c});var client9002=jayson[_0x9727('0x21')][_0x9727('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x2bf4d9,_0x3454a4,_0x36ee28,_0x1e104b){return new BPromise(function(_0x54066a,_0x5777ad){var _0x5ec033=_0x1e104b||client;return _0x5ec033['request'](_0x2bf4d9,_0x36ee28)[_0x9727('0x23')](function(_0xdfff91){logger[_0x9727('0x24')]('OpenchannelAccount,\x20%s,\x20%s',_0x3454a4,_0x9727('0x25'));logger[_0x9727('0x26')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x3454a4,_0x9727('0x25'),JSON[_0x9727('0x27')](_0xdfff91));if(_0xdfff91[_0x9727('0x28')]){if(_0xdfff91['error'][_0x9727('0x29')]===0x1f4){logger[_0x9727('0x28')](_0x9727('0x2a'),_0x3454a4,_0xdfff91[_0x9727('0x28')][_0x9727('0x2b')]);return _0x5777ad(_0xdfff91[_0x9727('0x28')][_0x9727('0x2b')]);}logger[_0x9727('0x28')](_0x9727('0x2a'),_0x3454a4,_0xdfff91['error']['message']);return _0x54066a(_0xdfff91[_0x9727('0x28')]['message']);}else{logger[_0x9727('0x24')](_0x9727('0x2a'),_0x3454a4,_0x9727('0x25'));_0x54066a(_0xdfff91[_0x9727('0x2c')][_0x9727('0x2b')]);}})['catch'](function(_0x410c88){logger[_0x9727('0x28')]('OpenchannelAccount,\x20%s,\x20%s',_0x3454a4,_0x410c88);_0x5777ad(_0x410c88);});});}function respondWithStatusCode(_0x2949f4,_0x48528b){_0x48528b=_0x48528b||0xcc;return function(_0x313718){if(_0x313718){return _0x2949f4[_0x9727('0x2d')](_0x48528b);}return _0x2949f4[_0x9727('0x2e')](_0x48528b)[_0x9727('0x2f')]();};}function respondWithResult(_0x2cbeb7,_0x4ceafc){_0x4ceafc=_0x4ceafc||0xc8;return function(_0x2b5788){if(_0x2b5788){return _0x2cbeb7[_0x9727('0x2e')](_0x4ceafc)[_0x9727('0x30')](_0x2b5788);}};}function respondWithFilteredResult(_0x2517e7,_0x34eae1){return function(_0x2f27cb){if(_0x2f27cb){var _0x9201af=typeof _0x34eae1[_0x9727('0x31')]===_0x9727('0x32')&&typeof _0x34eae1['limit']==='undefined';var _0x129aba=_0x2f27cb[_0x9727('0x33')];var _0x24bec9=_0x9201af?0x0:_0x34eae1[_0x9727('0x31')];var _0x3f9aae=_0x9201af?_0x2f27cb[_0x9727('0x33')]:_0x34eae1['offset']+_0x34eae1[_0x9727('0x34')];var _0x3e9dd0;if(_0x3f9aae>=_0x129aba){_0x3f9aae=_0x129aba;_0x3e9dd0=0xc8;}else{_0x3e9dd0=0xce;}_0x2517e7['status'](_0x3e9dd0);return _0x2517e7[_0x9727('0x35')](_0x9727('0x36'),_0x24bec9+'-'+_0x3f9aae+'/'+_0x129aba)[_0x9727('0x30')](_0x2f27cb);}return null;};}function patchUpdates(_0x4e504d){return function(_0x36ffe2){try{jsonpatch[_0x9727('0x37')](_0x36ffe2,_0x4e504d,!![]);}catch(_0x1a15c5){return BPromise[_0x9727('0x38')](_0x1a15c5);}return _0x36ffe2[_0x9727('0x39')]();};}function saveUpdates(_0x1ef9b4,_0x1de61f){return function(_0x2a7b75){if(_0x2a7b75){return _0x2a7b75[_0x9727('0x3a')](_0x1ef9b4)[_0x9727('0x23')](function(_0x3bba31){return _0x3bba31;});}return null;};}function removeEntity(_0x48f655,_0x5db3bf){return function(_0x16fa96){if(_0x16fa96){return _0x16fa96[_0x9727('0x3b')]()['then'](function(){var _0x115411=_0x16fa96[_0x9727('0x3c')]({'plain':!![]});var _0x4e8302='OpenchannelAccounts';return db[_0x9727('0x3d')][_0x9727('0x3b')]({'where':{'type':_0x4e8302,'resourceId':_0x115411['id']}})[_0x9727('0x23')](function(){return _0x16fa96;});})[_0x9727('0x23')](function(){_0x48f655[_0x9727('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3cb051,_0x20e936){return function(_0x1e1c97){if(!_0x1e1c97){_0x3cb051[_0x9727('0x2d')](0x194);}return _0x1e1c97;};}function handleError(_0x409132,_0x4452c9){_0x4452c9=_0x4452c9||0x1f4;return function(_0x5d2f68){logger[_0x9727('0x28')](_0x5d2f68[_0x9727('0x3e')]);if(_0x5d2f68[_0x9727('0x3f')]){delete _0x5d2f68[_0x9727('0x3f')];}_0x409132[_0x9727('0x2e')](_0x4452c9)[_0x9727('0x40')](_0x5d2f68);};}exports[_0x9727('0x41')]=function(_0x2bc140,_0x1ed31f){var _0x4ea049={'include':[{'model':db[_0x9727('0x42')],'as':_0x9727('0x43')}]},_0x519157={},_0x397fc9={'count':0x0,'rows':[]};var _0x2555e7=_['map'](db[_0x9727('0x44')][_0x9727('0x45')],function(_0x4dcfa0){return{'name':_0x4dcfa0['fieldName'],'type':_0x4dcfa0[_0x9727('0x46')][_0x9727('0x47')]};});_0x519157['model']=_['map'](_0x2555e7,_0x9727('0x3f'));_0x519157[_0x9727('0x48')]=_['keys'](_0x2bc140[_0x9727('0x48')]);_0x519157[_0x9727('0x49')]=_[_0x9727('0x4a')](_0x519157[_0x9727('0x4b')],_0x519157['query']);_0x4ea049[_0x9727('0x4c')]=_[_0x9727('0x4a')](_0x519157['model'],qs[_0x9727('0x4d')](_0x2bc140['query'][_0x9727('0x4d')]));_0x4ea049[_0x9727('0x4c')]=_0x4ea049[_0x9727('0x4c')][_0x9727('0x4e')]?_0x4ea049[_0x9727('0x4c')]:_0x519157[_0x9727('0x4b')];if(!_0x2bc140[_0x9727('0x48')][_0x9727('0x4f')](_0x9727('0x50'))){_0x4ea049[_0x9727('0x34')]=qs['limit'](_0x2bc140[_0x9727('0x48')][_0x9727('0x34')]);_0x4ea049[_0x9727('0x31')]=qs['offset'](_0x2bc140[_0x9727('0x48')][_0x9727('0x31')]);}_0x4ea049[_0x9727('0x51')]=qs[_0x9727('0x52')](_0x2bc140['query'][_0x9727('0x52')]);_0x4ea049['where']=qs['filters'](_[_0x9727('0x53')](_0x2bc140[_0x9727('0x48')],_0x519157[_0x9727('0x49')]),_0x2555e7);if(_0x2bc140['query'][_0x9727('0x54')]){_0x4ea049[_0x9727('0x55')]=_['merge'](_0x4ea049[_0x9727('0x55')],{'$or':_[_0x9727('0x56')](_0x2555e7,function(_0x2a4b1f){if(_0x2a4b1f[_0x9727('0x46')]!==_0x9727('0x57')){var _0x443127={};_0x443127[_0x2a4b1f['name']]={'$like':'%'+_0x2bc140[_0x9727('0x48')][_0x9727('0x54')]+'%'};return _0x443127;}})});}_0x4ea049=_['merge']({},_0x4ea049,_0x2bc140[_0x9727('0x58')]);var _0x4574b0={'where':_0x4ea049[_0x9727('0x55')]};return db[_0x9727('0x44')]['count'](_0x4574b0)[_0x9727('0x23')](function(_0x1cee04){_0x397fc9[_0x9727('0x33')]=_0x1cee04;if(_0x2bc140[_0x9727('0x48')][_0x9727('0x59')]){_0x4ea049[_0x9727('0x5a')]=[{'all':!![]}];}return db[_0x9727('0x44')][_0x9727('0x5b')](_0x4ea049);})['then'](function(_0x26c81c){_0x397fc9[_0x9727('0x5c')]=_0x26c81c;return _0x397fc9;})[_0x9727('0x23')](respondWithFilteredResult(_0x1ed31f,_0x4ea049))['catch'](handleError(_0x1ed31f,null));};exports['show']=function(_0x276f89,_0x1888c2){var _0x4e912b={'raw':![],'where':{'id':_0x276f89[_0x9727('0x5d')]['id']},'include':[{'model':db[_0x9727('0x42')],'as':_0x9727('0x43')}]},_0x12a421={};_0x12a421[_0x9727('0x4b')]=_[_0x9727('0x5e')](db[_0x9727('0x44')]['rawAttributes']);_0x12a421[_0x9727('0x48')]=_[_0x9727('0x5e')](_0x276f89['query']);_0x12a421[_0x9727('0x49')]=_['intersection'](_0x12a421[_0x9727('0x4b')],_0x12a421[_0x9727('0x48')]);_0x4e912b[_0x9727('0x4c')]=_[_0x9727('0x4a')](_0x12a421['model'],qs[_0x9727('0x4d')](_0x276f89[_0x9727('0x48')][_0x9727('0x4d')]));_0x4e912b['attributes']=_0x4e912b[_0x9727('0x4c')]['length']?_0x4e912b['attributes']:_0x12a421[_0x9727('0x4b')];if(_0x276f89[_0x9727('0x48')][_0x9727('0x59')]){_0x4e912b['include']=[{'all':!![]}];}_0x4e912b=_[_0x9727('0x5f')]({},_0x4e912b,_0x276f89[_0x9727('0x58')]);return db[_0x9727('0x44')][_0x9727('0x60')](_0x4e912b)[_0x9727('0x23')](handleEntityNotFound(_0x1888c2,null))[_0x9727('0x23')](respondWithResult(_0x1888c2,null))[_0x9727('0x61')](handleError(_0x1888c2,null));};exports[_0x9727('0x62')]=function(_0x349d7e,_0x4e03e3){return db[_0x9727('0x44')]['create'](_0x349d7e[_0x9727('0x63')],{})['then'](function(_0x3daa12){var _0x4f6d50=_0x349d7e[_0x9727('0x64')][_0x9727('0x3c')]({'plain':!![]});if(!_0x4f6d50)throw new Error(_0x9727('0x65'));if(_0x4f6d50[_0x9727('0x66')]==='user'){var _0x50006b=_0x3daa12['get']({'plain':!![]});var _0x581adb='OpenchannelAccounts';return db[_0x9727('0x67')]['find']({'where':{'name':_0x581adb,'userProfileId':_0x4f6d50['userProfileId']},'raw':!![]})[_0x9727('0x23')](function(_0x37fe4f){if(_0x37fe4f&&_0x37fe4f['autoAssociation']===0x0){return db['UserProfileResource'][_0x9727('0x62')]({'name':_0x50006b[_0x9727('0x3f')],'resourceId':_0x50006b['id'],'type':_0x37fe4f[_0x9727('0x3f')],'sectionId':_0x37fe4f['id']},{})[_0x9727('0x23')](function(){return _0x3daa12;});}else{return _0x3daa12;}})[_0x9727('0x61')](function(_0x1e3f8d){logger['error'](_0x9727('0x68'),_0x1e3f8d);throw _0x1e3f8d;});}return _0x3daa12;})[_0x9727('0x23')](respondWithResult(_0x4e03e3,0xc9))['catch'](handleError(_0x4e03e3,null));};exports[_0x9727('0x3a')]=function(_0x1bf700,_0x2c424f){if(_0x1bf700[_0x9727('0x63')]['id']){delete _0x1bf700[_0x9727('0x63')]['id'];}return db[_0x9727('0x44')][_0x9727('0x60')]({'where':{'id':_0x1bf700[_0x9727('0x5d')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x2c424f,null))['then'](saveUpdates(_0x1bf700['body'],null))[_0x9727('0x23')](respondWithResult(_0x2c424f,null))[_0x9727('0x61')](handleError(_0x2c424f,null));};exports[_0x9727('0x3b')]=function(_0xc37a90,_0x4c9574){return db[_0x9727('0x44')][_0x9727('0x60')]({'where':{'id':_0xc37a90[_0x9727('0x5d')]['id']}})[_0x9727('0x23')](handleEntityNotFound(_0x4c9574,null))['then'](removeEntity(_0x4c9574,null))[_0x9727('0x61')](handleError(_0x4c9574,null));};exports[_0x9727('0x69')]=function(_0x4d397a,_0x20c64b){return db[_0x9727('0x44')][_0x9727('0x69')]()['then'](respondWithResult(_0x20c64b,null))['catch'](handleError(_0x20c64b,null));};exports['addDisposition']=function(_0x3c75f6,_0x493967,_0x4e3c88){if(_0x3c75f6[_0x9727('0x63')]['id']){delete _0x3c75f6['body']['id'];}return db[_0x9727('0x44')]['find']({'where':{'id':_0x3c75f6['params']['id']}})['then'](handleEntityNotFound(_0x493967,null))['then'](function(_0x46b60a){if(_0x46b60a){_0x3c75f6['body'][_0x9727('0x6a')]=_0x46b60a['id'];return db[_0x9727('0x6b')][_0x9727('0x62')](_0x3c75f6[_0x9727('0x63')]);}})['then'](respondWithResult(_0x493967,null))[_0x9727('0x61')](handleError(_0x493967,null));};exports[_0x9727('0x6c')]=function(_0x4b0ab0,_0x7e9f9e,_0x40d2d3){var _0x5f4736={'raw':![],'where':{}};var _0x3d867e={};var _0x522632={'count':0x0,'rows':[]};return db[_0x9727('0x44')][_0x9727('0x6d')]({'where':{'id':_0x4b0ab0['params']['id']}})['then'](handleEntityNotFound(_0x7e9f9e,null))[_0x9727('0x23')](function(_0x2e20f1){if(_0x2e20f1){_0x3d867e[_0x9727('0x4b')]=_[_0x9727('0x5e')](db[_0x9727('0x6b')][_0x9727('0x45')]);_0x3d867e[_0x9727('0x48')]=_[_0x9727('0x5e')](_0x4b0ab0[_0x9727('0x48')]);_0x3d867e['filters']=_['intersection'](_0x3d867e['model'],_0x3d867e[_0x9727('0x48')]);_0x5f4736[_0x9727('0x4c')]=_[_0x9727('0x4a')](_0x3d867e[_0x9727('0x4b')],qs[_0x9727('0x4d')](_0x4b0ab0[_0x9727('0x48')][_0x9727('0x4d')]));_0x5f4736[_0x9727('0x4c')]=_0x5f4736[_0x9727('0x4c')][_0x9727('0x4e')]?_0x5f4736['attributes']:_0x3d867e[_0x9727('0x4b')];if(!_0x4b0ab0['query'][_0x9727('0x4f')](_0x9727('0x50'))){_0x5f4736[_0x9727('0x34')]=qs[_0x9727('0x34')](_0x4b0ab0['query']['limit']);_0x5f4736[_0x9727('0x31')]=qs['offset'](_0x4b0ab0['query'][_0x9727('0x31')]);}_0x5f4736['order']=qs[_0x9727('0x52')](_0x4b0ab0['query']['sort']);_0x5f4736['where']=qs[_0x9727('0x49')](_[_0x9727('0x53')](_0x4b0ab0['query'],_0x3d867e[_0x9727('0x49')]));_0x5f4736[_0x9727('0x55')][_0x9727('0x6a')]=_0x2e20f1['id'];if(_0x4b0ab0[_0x9727('0x48')]['filter']){_0x5f4736[_0x9727('0x55')]=_[_0x9727('0x5f')](_0x5f4736[_0x9727('0x55')],{'$or':_[_0x9727('0x56')](_0x5f4736[_0x9727('0x4c')],function(_0x3fd6cd){var _0x4369d2={};_0x4369d2[_0x3fd6cd]={'$like':'%'+_0x4b0ab0[_0x9727('0x48')]['filter']+'%'};return _0x4369d2;})});}_0x5f4736=_['merge']({},_0x5f4736,_0x4b0ab0['options']);return db[_0x9727('0x6b')][_0x9727('0x33')]({'where':_0x5f4736['where']})[_0x9727('0x23')](function(_0x594c5f){_0x522632[_0x9727('0x33')]=_0x594c5f;if(_0x4b0ab0['query']['includeAll']){_0x5f4736[_0x9727('0x5a')]=[{'all':!![]}];}return db[_0x9727('0x6b')][_0x9727('0x5b')](_0x5f4736);})['then'](function(_0x37ed01){_0x522632['rows']=_0x37ed01;return _0x522632;});}})['then'](respondWithFilteredResult(_0x7e9f9e,_0x5f4736))['catch'](handleError(_0x7e9f9e,null));};exports[_0x9727('0x6e')]=function(_0x5d512a,_0x34f1e,_0xfce95f){return db[_0x9727('0x44')][_0x9727('0x60')]({'where':{'id':_0x5d512a[_0x9727('0x5d')]['id']}})[_0x9727('0x23')](handleEntityNotFound(_0x34f1e,null))[_0x9727('0x23')](function(_0x4d7493){if(_0x4d7493){return _0x4d7493[_0x9727('0x6e')](_0x5d512a[_0x9727('0x48')][_0x9727('0x6f')]);}})[_0x9727('0x23')](respondWithStatusCode(_0x34f1e,null))[_0x9727('0x61')](handleError(_0x34f1e,null));};exports['addAnswer']=function(_0x14abb1,_0x56c847,_0x5efa34){if(_0x14abb1[_0x9727('0x63')]['id']){delete _0x14abb1[_0x9727('0x63')]['id'];}return db[_0x9727('0x44')]['find']({'where':{'id':_0x14abb1[_0x9727('0x5d')]['id']}})[_0x9727('0x23')](handleEntityNotFound(_0x56c847,null))[_0x9727('0x23')](function(_0x577019){if(_0x577019){_0x14abb1[_0x9727('0x63')][_0x9727('0x6a')]=_0x577019['id'];return db[_0x9727('0x70')][_0x9727('0x62')](_0x14abb1[_0x9727('0x63')]);}})[_0x9727('0x23')](respondWithResult(_0x56c847,null))['catch'](handleError(_0x56c847,null));};exports[_0x9727('0x71')]=function(_0xbdd99e,_0x41ac7a,_0x934747){var _0x164c93={'raw':![],'where':{}};var _0x39f449={};var _0x254145={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x9727('0x6d')]({'where':{'id':_0xbdd99e[_0x9727('0x5d')]['id']}})[_0x9727('0x23')](handleEntityNotFound(_0x41ac7a,null))[_0x9727('0x23')](function(_0x33a1de){if(_0x33a1de){_0x39f449[_0x9727('0x4b')]=_[_0x9727('0x5e')](db['CannedAnswer']['rawAttributes']);_0x39f449[_0x9727('0x48')]=_[_0x9727('0x5e')](_0xbdd99e[_0x9727('0x48')]);_0x39f449['filters']=_[_0x9727('0x4a')](_0x39f449[_0x9727('0x4b')],_0x39f449['query']);_0x164c93[_0x9727('0x4c')]=_[_0x9727('0x4a')](_0x39f449[_0x9727('0x4b')],qs[_0x9727('0x4d')](_0xbdd99e[_0x9727('0x48')][_0x9727('0x4d')]));_0x164c93['attributes']=_0x164c93['attributes']['length']?_0x164c93[_0x9727('0x4c')]:_0x39f449[_0x9727('0x4b')];if(!_0xbdd99e['query'][_0x9727('0x4f')]('nolimit')){_0x164c93[_0x9727('0x34')]=qs[_0x9727('0x34')](_0xbdd99e[_0x9727('0x48')]['limit']);_0x164c93[_0x9727('0x31')]=qs[_0x9727('0x31')](_0xbdd99e[_0x9727('0x48')]['offset']);}_0x164c93[_0x9727('0x51')]=qs[_0x9727('0x52')](_0xbdd99e[_0x9727('0x48')][_0x9727('0x52')]);_0x164c93[_0x9727('0x55')]=qs[_0x9727('0x49')](_[_0x9727('0x53')](_0xbdd99e[_0x9727('0x48')],_0x39f449['filters']));_0x164c93[_0x9727('0x55')][_0x9727('0x6a')]=_0x33a1de['id'];if(_0xbdd99e[_0x9727('0x48')][_0x9727('0x54')]){_0x164c93[_0x9727('0x55')]=_['merge'](_0x164c93[_0x9727('0x55')],{'$or':_['map'](_0x164c93[_0x9727('0x4c')],function(_0x4c4943){var _0x187d41={};_0x187d41[_0x4c4943]={'$like':'%'+_0xbdd99e['query'][_0x9727('0x54')]+'%'};return _0x187d41;})});}_0x164c93=_[_0x9727('0x5f')]({},_0x164c93,_0xbdd99e[_0x9727('0x58')]);return db[_0x9727('0x70')][_0x9727('0x33')]({'where':_0x164c93[_0x9727('0x55')]})['then'](function(_0x3f68b4){_0x254145[_0x9727('0x33')]=_0x3f68b4;if(_0xbdd99e['query']['includeAll']){_0x164c93[_0x9727('0x5a')]=[{'all':!![]}];}return db[_0x9727('0x70')][_0x9727('0x5b')](_0x164c93);})[_0x9727('0x23')](function(_0x41f7c0){_0x254145[_0x9727('0x5c')]=_0x41f7c0;return _0x254145;});}})[_0x9727('0x23')](respondWithFilteredResult(_0x41ac7a,_0x164c93))[_0x9727('0x61')](handleError(_0x41ac7a,null));};exports[_0x9727('0x72')]=function(_0x344cb8,_0x44725c,_0x13eb08){return db[_0x9727('0x44')][_0x9727('0x60')]({'where':{'id':_0x344cb8[_0x9727('0x5d')]['id']}})[_0x9727('0x23')](handleEntityNotFound(_0x44725c,null))[_0x9727('0x23')](function(_0x3f66d4){if(_0x3f66d4){return _0x3f66d4['removeAnswers'](_0x344cb8[_0x9727('0x48')][_0x9727('0x6f')]);}})[_0x9727('0x23')](respondWithStatusCode(_0x44725c,null))[_0x9727('0x61')](handleError(_0x44725c,null));};exports['notify']=function(_0x1af9b9,_0x3cdc68,_0x2fc479){var _0x4f7b31={'body':_0x1af9b9[_0x9727('0x63')],'channel':_0x9727('0x73')};var _0x7f5f24=[];var _0x19f675=[];var _0x2d8dac={};var _0x4dc8a2=![];return db[_0x9727('0x74')][_0x9727('0x69')]()['then'](function(_0x37ad23){if(!_0x37ad23){throw new db[(_0x9727('0x75'))][(_0x9727('0x76'))]('no\x20available\x20attributes');}_0x7f5f24=_[_0x9727('0x77')](_[_0x9727('0x5e')](_0x37ad23),[_0x9727('0x78'),_0x9727('0x79')]);_0x19f675=_['difference'](_['keys'](_0x37ad23),[_0x9727('0x78'),_0x9727('0x79'),_0x9727('0x7a'),'ListId']);if(_0x1af9b9[_0x9727('0x63')]['id']){delete _0x1af9b9[_0x9727('0x63')]['id'];}if(_['isNil'](_0x1af9b9['body']['from'])){throw new db[(_0x9727('0x75'))][(_0x9727('0x76'))](_0x9727('0x7b'));}if(_[_0x9727('0x7c')](_0x1af9b9[_0x9727('0x63')][_0x9727('0x63')])||_0x1af9b9[_0x9727('0x63')][_0x9727('0x63')]===''){throw new db['Sequelize']['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x9727('0x7c')](_0x1af9b9[_0x9727('0x63')][_0x9727('0x7d')])){throw new db[(_0x9727('0x75'))]['ValidationError'](_0x9727('0x7e')+_0x19f675);}if(!_[_0x9727('0x7f')](_0x19f675,_0x1af9b9[_0x9727('0x63')][_0x9727('0x7d')])){throw new db[(_0x9727('0x75'))][(_0x9727('0x76'))](_0x9727('0x80')+_0x19f675);}_0x2d8dac[_0x1af9b9[_0x9727('0x63')]['mapKey']]=_0x1af9b9[_0x9727('0x63')][_0x9727('0x81')];})['then'](function(){return db[_0x9727('0x44')][_0x9727('0x60')]({'where':{'id':_0x1af9b9[_0x9727('0x5d')]['id']},'include':[{'model':db[_0x9727('0x82')],'as':_0x9727('0x83'),'include':[{'model':db[_0x9727('0x74')],'as':'Contacts','where':_0x2d8dac,'limit':0x1,'order':[[_0x9727('0x79'),_0x9727('0x84')]]}]},{'model':db[_0x9727('0x85')],'as':'Applications'}]});})[_0x9727('0x23')](handleEntityNotFound(_0x3cdc68,null))[_0x9727('0x23')](function(_0x473416){if(_0x473416&&_0x473416['List']){_0x4f7b31['account']=_0x473416;_0x4f7b31[_0x9727('0x86')]=_0x473416[_0x9727('0x87')];_0x4f7b31['list']=_0x473416[_0x9727('0x83')];_0x4f7b31[_0x9727('0x86')]=_[_0x9727('0x88')](_0x4f7b31[_0x9727('0x86')],[_0x9727('0x89')],['asc']);if(_0x4f7b31[_0x9727('0x8a')][_0x9727('0x87')]){delete _0x4f7b31[_0x9727('0x8a')][_0x9727('0x87')];}if(_0x4f7b31[_0x9727('0x8a')][_0x9727('0x83')]&&_0x4f7b31[_0x9727('0x8a')]['List']['Contacts'][_0x9727('0x4e')]){return _0x4f7b31['account'][_0x9727('0x83')]['Contacts'][0x0];}var _0xc0e09a=_[_0x9727('0x1c')](_0x1af9b9[_0x9727('0x63')],{'firstName':_0x1af9b9[_0x9727('0x63')]['from'],'ListId':_0x473416[_0x9727('0x8b')]});_0xc0e09a[_0x1af9b9['body']['mapKey']]=_0x1af9b9['body'][_0x9727('0x81')];return db[_0x9727('0x74')][_0x9727('0x62')](_0xc0e09a,{'fields':_0x7f5f24,'raw':!![]});}})[_0x9727('0x23')](handleEntityNotFound(_0x3cdc68,null))[_0x9727('0x23')](function(_0x406c72){_0x4f7b31[_0x9727('0x8c')]=_0x406c72;if(_0x406c72){var _0x3e04e8={'ContactId':_0x406c72['id'],'OpenchannelAccountId':_0x1af9b9[_0x9727('0x5d')]['id'],'from':(_0x406c72[_0x9727('0x8d')]||'')+'\x20'+(_0x406c72[_0x9727('0x8e')]||'')};var _0x1dc79e={'OpenchannelAccountId':_0x1af9b9[_0x9727('0x5d')]['id'],'closed':![]};if(_0x1af9b9['body'][_0x9727('0x8f')]){_0x1dc79e[_0x9727('0x8f')]=_0x1af9b9[_0x9727('0x63')]['threadId'];return db[_0x9727('0x90')][_0x9727('0x60')]({'where':_0x1dc79e})['then'](function(_0x569f7c){if(_0x569f7c){return[_0x569f7c,![]];}_0x3e04e8[_0x9727('0x8f')]=_0x1af9b9[_0x9727('0x63')][_0x9727('0x8f')];_0x3e04e8[_0x9727('0x91')]=_0x1af9b9[_0x9727('0x63')]['externalUrl'];return db['OpenchannelInteraction'][_0x9727('0x62')](_0x3e04e8)[_0x9727('0x23')](function(_0x265626){return[_0x265626,!![]];});});}else{_0x1dc79e[_0x9727('0x8f')]=null;}_0x1dc79e[_0x9727('0x92')]=_0x406c72['id'];return db['OpenchannelInteraction'][_0x9727('0x60')]({'where':_0x1dc79e})['then'](function(_0x4bfefd){if(_0x4bfefd){return[_0x4bfefd,![]];}return db[_0x9727('0x90')][_0x9727('0x62')](_0x3e04e8)[_0x9727('0x23')](function(_0x3a63bd){return[_0x3a63bd,!![]];});});}})[_0x9727('0x93')](function(_0x510e9f,_0x154845){if(_0x510e9f){_0x4dc8a2=_0x154845;if(!_0x154845){var _0x5b5aab={'from':(_0x4f7b31[_0x9727('0x8c')][_0x9727('0x8d')]||'')+'\x20'+(_0x4f7b31[_0x9727('0x8c')][_0x9727('0x8e')]||'')};if(_0x1af9b9[_0x9727('0x63')][_0x9727('0x8f')]&&_0x1af9b9[_0x9727('0x63')]['messageId']&&_0x1af9b9[_0x9727('0x63')]['threadId']!=_0x1af9b9[_0x9727('0x63')][_0x9727('0x94')]){_0x5b5aab[_0x9727('0x8f')]=_0x1af9b9['body']['messageId'];}return _0x510e9f[_0x9727('0x3a')](_0x5b5aab);}else{return _0x510e9f;}}})[_0x9727('0x23')](function(_0x1da21f){_0x4f7b31[_0x9727('0x95')]=_0x1da21f[_0x9727('0x3c')]({'plain':!![]});_0x4f7b31[_0x9727('0x95')][_0x9727('0x96')]=_0x4dc8a2;if(_0x4f7b31[_0x9727('0x95')][_0x9727('0x96')]){if(_0x4f7b31['account']['autoclose']){_0x4f7b31[_0x9727('0x86')][_0x9727('0x97')]({'id':0x0,'priority':_0x4f7b31['applications'][_0x9727('0x4e')]+0x1,'app':'close','appdata':'unmanaged','interval':_0x9727('0x98')});}}return db[_0x9727('0x99')][_0x9727('0x62')]({'body':_0x1af9b9['body'][_0x9727('0x63')],'OpenchannelAccountId':_0x1af9b9[_0x9727('0x5d')]['id'],'OpenchannelInteractionId':_0x1da21f['id'],'direction':'in','ContactId':_0x4f7b31['contact']['id'],'AttachmentId':_0x1af9b9[_0x9727('0x63')][_0x9727('0x9a')]});})[_0x9727('0x23')](function(_0x1b5f7b){_0x4f7b31['message']=_0x1b5f7b;if(_0x4f7b31[_0x9727('0x95')][_0x9727('0x9b')]){return db[_0x9727('0x9c')][_0x9727('0x60')]({'attributes':['id',_0x9727('0x3f')],'where':{'id':_0x4f7b31[_0x9727('0x95')]['UserId']}})[_0x9727('0x23')](function(_0x304d8f){if(_0x304d8f){_0x4f7b31['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0x9727('0x9d'),'appdata':_0x304d8f[_0x9727('0x3f')]+','+(_0x4f7b31['account'][_0x9727('0x9e')]||0xa),'interval':_0x9727('0x98')});_0x4f7b31[_0x9727('0x9f')]=![];}return respondWithRpcPromise('Start',_0x9727('0xa0'),_0x4f7b31);});}return respondWithRpcPromise(_0x9727('0xa1'),_0x9727('0xa0'),_0x4f7b31);})[_0x9727('0x23')](function(_0x2d9bc7){respondWithRpcPromise(_0x9727('0xa2'),'EventManager',{'event':'notify','message':_0x2d9bc7},client9002);return _0x2d9bc7;})[_0x9727('0x23')](respondWithResult(_0x3cdc68,null))[_0x9727('0x61')](handleError(_0x3cdc68,null));};exports[_0x9727('0xa3')]=function(_0xd10646,_0x249dda,_0x50196d){return db[_0x9727('0x44')]['findOne']({'where':{'id':_0xd10646['params']['id']}})[_0x9727('0x23')](handleEntityNotFound(_0x249dda,null))['then'](function(_0x488fc5){if(_0x488fc5){return db['sequelize'][_0x9727('0xa4')](function(_0x5f22fc){return db[_0x9727('0x85')][_0x9727('0x3b')]({'where':{'OpenchannelAccountId':_0xd10646[_0x9727('0x5d')]['id']},'transaction':_0x5f22fc})[_0x9727('0x23')](function(_0x410a0f){var _0x1e813d=_['map'](_0xd10646[_0x9727('0x63')],function(_0x551347){_0x551347['OpenchannelAccountId']=_0xd10646[_0x9727('0x5d')]['id'];return _0x551347;});return db['OpenchannelApplication'][_0x9727('0xa5')](_0x1e813d,{'transaction':_0x5f22fc});});})[_0x9727('0x23')](function(){return db[_0x9727('0x85')][_0x9727('0xa6')]({'where':{'OpenchannelAccountId':_0xd10646['params']['id']},'order':_0x9727('0x89')});});}})['then'](respondWithResult(_0x249dda,null))[_0x9727('0x61')](handleError(_0x249dda,null));};exports[_0x9727('0xa7')]=function(_0x51b2f5,_0x1a34cb,_0x21a0f4){var _0x2efedd={};var _0x2a4cb7={};var _0x11d270;var _0x3c82d6;return db[_0x9727('0x44')][_0x9727('0x6d')]({'where':{'id':_0x51b2f5['params']['id']}})['then'](handleEntityNotFound(_0x1a34cb,null))[_0x9727('0x23')](function(_0x12ca5f){if(_0x12ca5f){_0x11d270=_0x12ca5f;_0x2a4cb7[_0x9727('0x4b')]=_[_0x9727('0x5e')](db[_0x9727('0x85')][_0x9727('0x45')]);_0x2a4cb7['query']=_[_0x9727('0x5e')](_0x51b2f5['query']);_0x2a4cb7[_0x9727('0x49')]=_[_0x9727('0x4a')](_0x2a4cb7[_0x9727('0x4b')],_0x2a4cb7[_0x9727('0x48')]);_0x2efedd['attributes']=_['intersection'](_0x2a4cb7['model'],qs['fields'](_0x51b2f5['query']['fields']));_0x2efedd[_0x9727('0x4c')]=_0x2efedd[_0x9727('0x4c')][_0x9727('0x4e')]?_0x2efedd[_0x9727('0x4c')]:_0x2a4cb7[_0x9727('0x4b')];_0x2efedd['order']=qs[_0x9727('0x52')](_0x51b2f5[_0x9727('0x48')][_0x9727('0x52')]);_0x2efedd[_0x9727('0x55')]=qs[_0x9727('0x49')](_[_0x9727('0x53')](_0x51b2f5[_0x9727('0x48')],_0x2a4cb7[_0x9727('0x49')]));if(_0x51b2f5[_0x9727('0x48')]['filter']){_0x2efedd['where']=_['merge'](_0x2efedd[_0x9727('0x55')],{'$or':_[_0x9727('0x56')](_0x2efedd[_0x9727('0x4c')],function(_0x2af453){var _0x4623aa={};_0x4623aa[_0x2af453]={'$like':'%'+_0x51b2f5[_0x9727('0x48')][_0x9727('0x54')]+'%'};return _0x4623aa;})});}_0x2efedd=_[_0x9727('0x5f')]({},_0x2efedd,_0x51b2f5[_0x9727('0x58')]);return _0x11d270['getApplications'](_0x2efedd);}})[_0x9727('0x23')](function(_0x66a439){if(_0x66a439){_0x3c82d6=_0x66a439['length'];if(!_0x51b2f5[_0x9727('0x48')]['hasOwnProperty']('nolimit')){_0x2efedd[_0x9727('0x34')]=qs[_0x9727('0x34')](_0x51b2f5[_0x9727('0x48')][_0x9727('0x34')]);_0x2efedd[_0x9727('0x31')]=qs['offset'](_0x51b2f5[_0x9727('0x48')]['offset']);}return _0x11d270['getApplications'](_0x2efedd);}})[_0x9727('0x23')](function(_0x4790d1){if(_0x4790d1){return _0x4790d1?{'count':_0x3c82d6,'rows':_0x4790d1}:null;}})['then'](respondWithResult(_0x1a34cb,null))['catch'](handleError(_0x1a34cb,null));};exports[_0x9727('0xa8')]=function(_0x592ba0,_0x535901,_0x35aa3b){var _0x2d9347={'raw':![],'where':{}};var _0x1cf559={};var _0x1208e3={'count':0x0,'rows':[]};return db[_0x9727('0x44')][_0x9727('0x6d')]({'where':{'id':_0x592ba0['params']['id']}})[_0x9727('0x23')](handleEntityNotFound(_0x535901,null))[_0x9727('0x23')](function(_0x20b322){if(_0x20b322){_0x1cf559['model']=_[_0x9727('0x5e')](db[_0x9727('0x90')]['rawAttributes']);_0x1cf559[_0x9727('0x48')]=_['keys'](_0x592ba0['query']);_0x1cf559[_0x9727('0x49')]=_[_0x9727('0x4a')](_0x1cf559[_0x9727('0x4b')],_0x1cf559['query']);_0x2d9347[_0x9727('0x4c')]=_[_0x9727('0x4a')](_0x1cf559[_0x9727('0x4b')],qs[_0x9727('0x4d')](_0x592ba0['query'][_0x9727('0x4d')]));_0x2d9347[_0x9727('0x4c')]=_0x2d9347[_0x9727('0x4c')]['length']?_0x2d9347[_0x9727('0x4c')]:_0x1cf559[_0x9727('0x4b')];if(!_0x592ba0[_0x9727('0x48')]['hasOwnProperty'](_0x9727('0x50'))){_0x2d9347[_0x9727('0x34')]=qs['limit'](_0x592ba0[_0x9727('0x48')][_0x9727('0x34')]);_0x2d9347[_0x9727('0x31')]=qs[_0x9727('0x31')](_0x592ba0['query']['offset']);}_0x2d9347[_0x9727('0x51')]=qs[_0x9727('0x52')](_0x592ba0[_0x9727('0x48')][_0x9727('0x52')]);_0x2d9347[_0x9727('0x55')]=qs[_0x9727('0x49')](_[_0x9727('0x53')](_0x592ba0[_0x9727('0x48')],_0x1cf559[_0x9727('0x49')]));_0x2d9347[_0x9727('0x55')][_0x9727('0x6a')]=_0x20b322['id'];if(_0x592ba0[_0x9727('0x48')][_0x9727('0x54')]){_0x2d9347[_0x9727('0x55')]=_['merge'](_0x2d9347[_0x9727('0x55')],{'$or':_[_0x9727('0x56')](_0x2d9347['attributes'],function(_0x2ee915){var _0x2c5351={};_0x2c5351[_0x2ee915]={'$like':'%'+_0x592ba0[_0x9727('0x48')][_0x9727('0x54')]+'%'};return _0x2c5351;})});}_0x2d9347=_['merge']({},_0x2d9347,_0x592ba0[_0x9727('0x58')]);return db[_0x9727('0x90')]['count']({'where':_0x2d9347['where']})[_0x9727('0x23')](function(_0x5f0b75){_0x1208e3[_0x9727('0x33')]=_0x5f0b75;if(_0x592ba0[_0x9727('0x48')]['includeAll']){_0x2d9347[_0x9727('0x5a')]=[{'model':db[_0x9727('0x74')],'as':_0x9727('0xa9'),'required':![]},{'model':db['User'],'as':_0x9727('0xaa'),'attributes':[_0x9727('0x3f'),_0x9727('0xab'),_0x9727('0xac')],'required':![]},{'model':db[_0x9727('0xad')],'as':_0x9727('0xae'),'attributes':['id',_0x9727('0x3f'),_0x9727('0xaf')],'where':_0x592ba0[_0x9727('0x48')][_0x9727('0xb0')]?{'id':_0x592ba0[_0x9727('0x48')][_0x9727('0xb0')]}:undefined,'required':_0x592ba0[_0x9727('0x48')][_0x9727('0xb0')]?!![]:![]}];}return db[_0x9727('0x90')][_0x9727('0x5b')](_0x2d9347);})['then'](function(_0x415e89){_0x1208e3[_0x9727('0x5c')]=_0x415e89;return _0x1208e3;});}})['then'](respondWithFilteredResult(_0x535901,_0x2d9347))[_0x9727('0x61')](handleError(_0x535901,null));};exports[_0x9727('0xb1')]=function(_0x3ccb27,_0x247e48,_0x52fe6e){return db[_0x9727('0x44')][_0x9727('0x60')]({'where':{'id':_0x3ccb27[_0x9727('0x5d')]['id']}})[_0x9727('0x23')](handleEntityNotFound(_0x247e48,null))[_0x9727('0x23')](function(_0xb49a4a){if(_0xb49a4a){return _0xb49a4a[_0x9727('0xb1')](_0x3ccb27[_0x9727('0x63')][_0x9727('0x6f')],_['omit'](_0x3ccb27[_0x9727('0x63')],[_0x9727('0x6f'),'id'])||{})[_0x9727('0x93')](function(_0x44f162){for(var _0x59e711=0x0;_0x59e711<_0x3ccb27[_0x9727('0x63')][_0x9727('0x6f')][_0x9727('0x4e')];_0x59e711+=0x1){socket[_0x9727('0xb2')](_0x9727('0xb3'),{'UserId':Number(_0x3ccb27[_0x9727('0x63')][_0x9727('0x6f')][_0x59e711]),'OpenchannelAccountId':Number(_0x3ccb27['params']['id'])});}return _0x44f162;});}})['then'](respondWithResult(_0x247e48,null))[_0x9727('0x61')](handleError(_0x247e48,null));};exports[_0x9727('0xb4')]=function(_0x5aaf68,_0x30d958,_0x1c9d54){return db[_0x9727('0x44')][_0x9727('0x60')]({'where':{'id':_0x5aaf68['params']['id']}})[_0x9727('0x23')](handleEntityNotFound(_0x30d958,null))['then'](function(_0x4e00f9){if(_0x4e00f9){return _0x4e00f9[_0x9727('0xb4')](_0x5aaf68[_0x9727('0x48')][_0x9727('0x6f')])['then'](function(){if(_[_0x9727('0xb5')](_0x5aaf68[_0x9727('0x48')][_0x9727('0x6f')])){for(var _0x3a86a2=0x0;_0x3a86a2<_0x5aaf68[_0x9727('0x48')][_0x9727('0x6f')][_0x9727('0x4e')];_0x3a86a2+=0x1){socket[_0x9727('0xb2')](_0x9727('0xb6'),{'UserId':Number(_0x5aaf68['query']['ids'][_0x3a86a2]),'OpenchannelAccountId':Number(_0x5aaf68[_0x9727('0x5d')]['id'])});}}else{socket[_0x9727('0xb2')](_0x9727('0xb6'),{'UserId':Number(_0x5aaf68[_0x9727('0x48')][_0x9727('0x6f')]),'OpenchannelAccountId':Number(_0x5aaf68[_0x9727('0x5d')]['id'])});}});}})[_0x9727('0x23')](respondWithStatusCode(_0x30d958,null))[_0x9727('0x61')](handleError(_0x30d958,null));};exports[_0x9727('0xb7')]=function(_0x366bda,_0x37ae28,_0x41e722){var _0x3b1a99={};var _0xefbe6b={};var _0x114cc0;var _0x4c6143;return db[_0x9727('0x44')][_0x9727('0x6d')]({'where':{'id':_0x366bda[_0x9727('0x5d')]['id']}})['then'](handleEntityNotFound(_0x37ae28,null))[_0x9727('0x23')](function(_0x4a16e7){if(_0x4a16e7){_0x114cc0=_0x4a16e7;_0xefbe6b[_0x9727('0x4b')]=_[_0x9727('0x5e')](db[_0x9727('0x9c')][_0x9727('0x45')]);_0xefbe6b[_0x9727('0x48')]=_[_0x9727('0x5e')](_0x366bda[_0x9727('0x48')]);_0xefbe6b['filters']=_[_0x9727('0x4a')](_0xefbe6b[_0x9727('0x4b')],_0xefbe6b[_0x9727('0x48')]);_0x3b1a99[_0x9727('0x4c')]=_[_0x9727('0x4a')](_0xefbe6b[_0x9727('0x4b')],qs[_0x9727('0x4d')](_0x366bda[_0x9727('0x48')][_0x9727('0x4d')]));_0x3b1a99['attributes']=_0x3b1a99['attributes'][_0x9727('0x4e')]?_0x3b1a99[_0x9727('0x4c')]:_0xefbe6b[_0x9727('0x4b')];_0x3b1a99[_0x9727('0x51')]=qs[_0x9727('0x52')](_0x366bda['query'][_0x9727('0x52')]);_0x3b1a99['where']=qs[_0x9727('0x49')](_[_0x9727('0x53')](_0x366bda[_0x9727('0x48')],_0xefbe6b[_0x9727('0x49')]));if(_0x366bda[_0x9727('0x48')][_0x9727('0x54')]){_0x3b1a99[_0x9727('0x55')]=_[_0x9727('0x5f')](_0x3b1a99[_0x9727('0x55')],{'$or':_['map'](_0x3b1a99[_0x9727('0x4c')],function(_0x141fce){var _0x2d7469={};_0x2d7469[_0x141fce]={'$like':'%'+_0x366bda['query'][_0x9727('0x54')]+'%'};return _0x2d7469;})});}_0x3b1a99=_[_0x9727('0x5f')]({},_0x3b1a99,_0x366bda['options']);return _0x114cc0[_0x9727('0xb7')](_0x3b1a99);}})[_0x9727('0x23')](function(_0x10d79e){if(_0x10d79e){_0x4c6143=_0x10d79e[_0x9727('0x4e')];if(!_0x366bda[_0x9727('0x48')][_0x9727('0x4f')](_0x9727('0x50'))){_0x3b1a99['limit']=qs[_0x9727('0x34')](_0x366bda['query'][_0x9727('0x34')]);_0x3b1a99[_0x9727('0x31')]=qs[_0x9727('0x31')](_0x366bda['query'][_0x9727('0x31')]);}return _0x114cc0[_0x9727('0xb7')](_0x3b1a99);}})[_0x9727('0x23')](function(_0x3f94f6){if(_0x3f94f6){return _0x3f94f6?{'count':_0x4c6143,'rows':_0x3f94f6}:null;}})[_0x9727('0x23')](respondWithResult(_0x37ae28,null))['catch'](handleError(_0x37ae28,null));};exports[_0x9727('0x40')]=function(_0x40cdf0,_0x2a2bee,_0x492ecd){var _0x16b6e5,_0x5f183c,_0x1eef04;if(_[_0x9727('0x7c')](_0x40cdf0['body'][_0x9727('0x63')])||_0x40cdf0[_0x9727('0x63')][_0x9727('0x63')]===''){throw new db[(_0x9727('0x75'))][(_0x9727('0x76'))](_0x9727('0xb8'));}if(_[_0x9727('0x7c')](_0x40cdf0['body']['to'])){}_0x16b6e5=_0x40cdf0[_0x9727('0x63')]['to'];return db[_0x9727('0x44')][_0x9727('0x6d')]({'where':{'id':_0x40cdf0[_0x9727('0x5d')]['id']}})['then'](handleEntityNotFound(_0x2a2bee,null))[_0x9727('0x23')](function(_0x3dba49){if(_0x3dba49){return db[_0x9727('0x44')]['find']({'where':{'id':_0x3dba49['id']},'include':[{'model':db[_0x9727('0x82')],'as':_0x9727('0x83'),'include':[{'model':db[_0x9727('0x74')],'as':_0x9727('0xb9'),'where':{[_0x3dba49[_0x9727('0x7d')]]:_0x16b6e5},'limit':0x1,'order':[['updatedAt',_0x9727('0x84')]]}]}]})[_0x9727('0x23')](handleEntityNotFound(_0x2a2bee,null))['then'](function(_0x4e3935){if(_0x4e3935&&_0x4e3935[_0x9727('0x83')]){_0x5f183c=_0x4e3935[_0x9727('0x3c')]({'plain':!![]});if(_0x5f183c['List']&&_0x5f183c[_0x9727('0x83')][_0x9727('0xb9')][_0x9727('0x4e')]){return _0x5f183c[_0x9727('0x83')][_0x9727('0xb9')][0x0];}return db[_0x9727('0x74')][_0x9727('0x62')](_[_0x9727('0x1c')](_0x40cdf0['body'],{'firstName':_0x16b6e5,[_0x4e3935[_0x9727('0x7d')]]:_0x16b6e5,'phone':_0x16b6e5,'ListId':_0x5f183c[_0x9727('0x8b')]}));}})[_0x9727('0x23')](handleEntityNotFound(_0x2a2bee,null))[_0x9727('0x23')](function(_0x1bdbeb){if(_0x1bdbeb){_0x1eef04=_0x1bdbeb;return db[_0x9727('0x90')]['find']({'where':{'ContactId':_0x1eef04['id'],'closed':![],'OpenchannelAccountId':_0x5f183c['id']}})[_0x9727('0x23')](function(_0x32dd12){if(_0x32dd12){return[_0x32dd12,![]];}return db[_0x9727('0x90')][_0x9727('0x62')]({'UserId':_0x40cdf0['user']['id'],'ContactId':_0x1eef04['id'],'OpenchannelAccountId':_0x5f183c['id'],'lastMsgDirection':_0x9727('0xba'),'Messages':[_[_0x9727('0x5f')](_0x40cdf0['body'],{'read':![],'body':_0x40cdf0['body'][_0x9727('0x63')],'OpenchannelAccountId':_0x5f183c['id'],'UserId':_0x40cdf0['user']['id'],'ContactId':_0x1eef04['id']})]},{'include':[{'model':db[_0x9727('0x99')],'as':_0x9727('0xbb')}]})[_0x9727('0x23')](function(_0x416786){return[_0x416786,!![]];});});}})[_0x9727('0x93')](function(_0x56ff16,_0x50a5c6){if(_0x50a5c6){return _0x56ff16;}return db[_0x9727('0x99')][_0x9727('0x62')](_[_0x9727('0x5f')](_0x40cdf0[_0x9727('0x63')],{'read':![],'body':_0x40cdf0[_0x9727('0x63')]['body'],'OpenchannelAccountId':_0x5f183c['id'],'OpenchannelInteractionId':_0x56ff16['id'],'UserId':_0x40cdf0[_0x9727('0x64')]['id'],'ContactId':_0x1eef04['id']}))[_0x9727('0x23')](function(_0x54c82c){_0x56ff16['dataValues'][_0x9727('0xbb')]=[];_0x56ff16[_0x9727('0xbc')][_0x9727('0xbb')]['push'](_0x54c82c[_0x9727('0xbc')]);return _0x56ff16;});});}})['then'](respondWithResult(_0x2a2bee,null))[_0x9727('0x61')](handleError(_0x2a2bee,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 4bd0c53..0e65fc9 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 _0xda55=['update','remove','emit','hook','exports','events','../../mysqldb','save'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xda55,0x6d));var _0x5da5=function(_0x4d3be7,_0x4db16f){_0x4d3be7=_0x4d3be7-0x0;var _0x2018aa=_0xda55[_0x4d3be7];return _0x2018aa;};'use strict';var EventEmitter=require(_0x5da5('0x0'));var OpenchannelAccount=require(_0x5da5('0x1'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5da5('0x2'),'afterUpdate':_0x5da5('0x3'),'afterDestroy':_0x5da5('0x4')};function emitEvent(_0x50cf9f){return function(_0x1c3afd,_0x5da254,_0x3400e9){OpenchannelAccountEvents['emit'](_0x50cf9f+':'+_0x1c3afd['id'],_0x1c3afd);OpenchannelAccountEvents[_0x5da5('0x5')](_0x50cf9f,_0x1c3afd);_0x3400e9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0x5da5('0x6')](e,emitEvent(event));}}module[_0x5da5('0x7')]=OpenchannelAccountEvents; \ No newline at end of file +var _0x9348=['../../mysqldb','OpenchannelAccount','setMaxListeners','save','remove','emit','hasOwnProperty','hook','events'];(function(_0x44cf52,_0x287a43){var _0x2a06c6=function(_0x4ba730){while(--_0x4ba730){_0x44cf52['push'](_0x44cf52['shift']());}};_0x2a06c6(++_0x287a43);}(_0x9348,0x10d));var _0x8934=function(_0x2e7560,_0x48cd8f){_0x2e7560=_0x2e7560-0x0;var _0x57a2be=_0x9348[_0x2e7560];return _0x57a2be;};'use strict';var EventEmitter=require(_0x8934('0x0'));var OpenchannelAccount=require(_0x8934('0x1'))['db'][_0x8934('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x8934('0x3')](0x0);var events={'afterCreate':_0x8934('0x4'),'afterUpdate':'update','afterDestroy':_0x8934('0x5')};function emitEvent(_0x35da0b){return function(_0x5f34d7,_0x34f94c,_0x923aa3){OpenchannelAccountEvents[_0x8934('0x6')](_0x35da0b+':'+_0x5f34d7['id'],_0x5f34d7);OpenchannelAccountEvents[_0x8934('0x6')](_0x35da0b,_0x5f34d7);_0x923aa3(null);};}for(var e in events){if(events[_0x8934('0x7')](e)){var event=events[e];OpenchannelAccount[_0x8934('0x8')](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 91abcd3..0996a1d 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(_0x14296b,_0x2bf307){var _0x387d94=function(_0x1c00fc){while(--_0x1c00fc){_0x14296b['push'](_0x14296b['shift']());}};_0x387d94(++_0x2bf307);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'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(_0x1ad318,_0xee9ec3){var _0x19662d=function(_0x1ca199){while(--_0x1ca199){_0x1ad318['push'](_0x1ad318['shift']());}};_0x19662d(++_0xee9ec3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'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 ab67934..bf53076 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 _0xd757=['redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','info','OpenchannelAccount,\x20%s,\x20%s','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x3c0ea0,_0x127cd2){var _0x114c06=function(_0x4e58c8){while(--_0x4e58c8){_0x3c0ea0['push'](_0x3c0ea0['shift']());}};_0x114c06(++_0x127cd2);}(_0xd757,0x1e5));var _0x7d75=function(_0x54c24f,_0x30ce78){_0x54c24f=_0x54c24f-0x0;var _0x2d395b=_0xd757[_0x54c24f];return _0x2d395b;};'use strict';var _=require(_0x7d75('0x0'));var util=require(_0x7d75('0x1'));var moment=require(_0x7d75('0x2'));var BPromise=require(_0x7d75('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7d75('0x4'))['db'];var utils=require(_0x7d75('0x5'));var logger=require('../../config/logger')(_0x7d75('0x6'));var config=require(_0x7d75('0x7'));var jayson=require(_0x7d75('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x7d75('0x9')]=_[_0x7d75('0xa')](config[_0x7d75('0x9')],{'host':_0x7d75('0xb'),'port':0x18eb});var socket=require(_0x7d75('0xc'))(new Redis(config[_0x7d75('0x9')]));require(_0x7d75('0xd'))[_0x7d75('0xe')](socket);function respondWithRpcPromise(_0x24e1d8,_0x79266b,_0x1222b3){return new BPromise(function(_0x3043fc,_0x2ac971){return client['request'](_0x24e1d8,_0x1222b3)['then'](function(_0x38cd18){logger[_0x7d75('0xf')](_0x7d75('0x10'),_0x79266b,'request\x20sent');logger[_0x7d75('0x11')](_0x7d75('0x12'),_0x79266b,'request\x20sent',JSON[_0x7d75('0x13')](_0x38cd18));if(_0x38cd18[_0x7d75('0x14')]){if(_0x38cd18[_0x7d75('0x14')][_0x7d75('0x15')]===0x1f4){logger[_0x7d75('0x14')](_0x7d75('0x10'),_0x79266b,_0x38cd18['error'][_0x7d75('0x16')]);return _0x2ac971(_0x38cd18[_0x7d75('0x14')][_0x7d75('0x16')]);}logger[_0x7d75('0x14')](_0x7d75('0x10'),_0x79266b,_0x38cd18[_0x7d75('0x14')]['message']);return _0x3043fc(_0x38cd18[_0x7d75('0x14')]['message']);}else{logger[_0x7d75('0xf')](_0x7d75('0x10'),_0x79266b,_0x7d75('0x17'));_0x3043fc(_0x38cd18[_0x7d75('0x18')][_0x7d75('0x16')]);}})[_0x7d75('0x19')](function(_0x17a61c){logger[_0x7d75('0x14')]('OpenchannelAccount,\x20%s,\x20%s',_0x79266b,_0x17a61c);_0x2ac971(_0x17a61c);});});} \ No newline at end of file +var _0x0102=['debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','util','moment','bluebird','randomstring','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x1d04b3,_0x2dfd11){var _0x1cf900=function(_0x34a7d9){while(--_0x34a7d9){_0x1d04b3['push'](_0x1d04b3['shift']());}};_0x1cf900(++_0x2dfd11);}(_0x0102,0x186));var _0x2010=function(_0x465450,_0x59e56b){_0x465450=_0x465450-0x0;var _0x5159bb=_0x0102[_0x465450];return _0x5159bb;};'use strict';var _=require('lodash');var util=require(_0x2010('0x0'));var moment=require(_0x2010('0x1'));var BPromise=require(_0x2010('0x2'));var rs=require(_0x2010('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x2010('0x4'));var jayson=require(_0x2010('0x5'));var client=jayson[_0x2010('0x6')][_0x2010('0x7')]({'port':0x232a});config['redis']=_[_0x2010('0x8')](config['redis'],{'host':_0x2010('0x9'),'port':0x18eb});var socket=require(_0x2010('0xa'))(new Redis(config['redis']));require(_0x2010('0xb'))[_0x2010('0xc')](socket);function respondWithRpcPromise(_0x3d34d4,_0x3acdbb,_0x1aedbb){return new BPromise(function(_0x2a27b0,_0x289ad4){return client[_0x2010('0xd')](_0x3d34d4,_0x1aedbb)[_0x2010('0xe')](function(_0x39a821){logger[_0x2010('0xf')](_0x2010('0x10'),_0x3acdbb,_0x2010('0x11'));logger[_0x2010('0x12')](_0x2010('0x13'),_0x3acdbb,_0x2010('0x11'),JSON['stringify'](_0x39a821));if(_0x39a821['error']){if(_0x39a821[_0x2010('0x14')][_0x2010('0x15')]===0x1f4){logger[_0x2010('0x14')](_0x2010('0x10'),_0x3acdbb,_0x39a821[_0x2010('0x14')][_0x2010('0x16')]);return _0x289ad4(_0x39a821['error'][_0x2010('0x16')]);}logger[_0x2010('0x14')]('OpenchannelAccount,\x20%s,\x20%s',_0x3acdbb,_0x39a821[_0x2010('0x14')][_0x2010('0x16')]);return _0x2a27b0(_0x39a821[_0x2010('0x14')][_0x2010('0x16')]);}else{logger[_0x2010('0xf')](_0x2010('0x10'),_0x3acdbb,_0x2010('0x11'));_0x2a27b0(_0x39a821[_0x2010('0x17')][_0x2010('0x16')]);}})['catch'](function(_0x559ed6){logger[_0x2010('0x14')](_0x2010('0x10'),_0x3acdbb,_0x559ed6);_0x289ad4(_0x559ed6);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 3195518..d315dcc 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 _0x630e=['removeListener','register','length','openchannelAccount:','./openchannelAccount.events','remove','emit'];(function(_0x373441,_0x29b77a){var _0x27848c=function(_0x456e96){while(--_0x456e96){_0x373441['push'](_0x373441['shift']());}};_0x27848c(++_0x29b77a);}(_0x630e,0x1af));var _0xe630=function(_0x3e68ae,_0x688aaa){_0x3e68ae=_0x3e68ae-0x0;var _0x773fa4=_0x630e[_0x3e68ae];return _0x773fa4;};'use strict';var OpenchannelAccountEvents=require(_0xe630('0x0'));var events=['save',_0xe630('0x1'),'update'];function createListener(_0x559334,_0x36902e){return function(_0x143cb6){_0x36902e[_0xe630('0x2')](_0x559334,_0x143cb6);};}function removeListener(_0x5c5606,_0x2f3a0f){return function(){OpenchannelAccountEvents[_0xe630('0x3')](_0x5c5606,_0x2f3a0f);};}exports[_0xe630('0x4')]=function(_0x3d6f93){for(var _0x3936fd=0x0,_0x481b21=events[_0xe630('0x5')];_0x3936fd<_0x481b21;_0x3936fd++){var _0x34bad4=events[_0x3936fd];var _0x5a73ad=createListener(_0xe630('0x6')+_0x34bad4,_0x3d6f93);OpenchannelAccountEvents['on'](_0x34bad4,_0x5a73ad);}}; \ No newline at end of file +var _0x3f49=['./openchannelAccount.events','save','update','emit','register','length','openchannelAccount:'];(function(_0x1f3dc4,_0x5b8b02){var _0x343760=function(_0x5500c0){while(--_0x5500c0){_0x1f3dc4['push'](_0x1f3dc4['shift']());}};_0x343760(++_0x5b8b02);}(_0x3f49,0x11f));var _0x93f4=function(_0x1cac0c,_0x218591){_0x1cac0c=_0x1cac0c-0x0;var _0xea52c8=_0x3f49[_0x1cac0c];return _0xea52c8;};'use strict';var OpenchannelAccountEvents=require(_0x93f4('0x0'));var events=[_0x93f4('0x1'),'remove',_0x93f4('0x2')];function createListener(_0x265b8d,_0xe3894b){return function(_0x5a1210){_0xe3894b[_0x93f4('0x3')](_0x265b8d,_0x5a1210);};}function removeListener(_0x4232db,_0x58a15b){return function(){OpenchannelAccountEvents['removeListener'](_0x4232db,_0x58a15b);};}exports[_0x93f4('0x4')]=function(_0x38eb6c){for(var _0x2dfdf7=0x0,_0x5a86ad=events[_0x93f4('0x5')];_0x2dfdf7<_0x5a86ad;_0x2dfdf7++){var _0x5d22d9=events[_0x2dfdf7];var _0x144f31=createListener(_0x93f4('0x6')+_0x5d22d9,_0x38eb6c);OpenchannelAccountEvents['on'](_0x5d22d9,_0x144f31);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index e993492..16faf00 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 _0x1560=['./openchannelApplication.controller','get','isAuthenticated','index','post','create','/:id','update','delete','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x33dcf7,_0x3d5390){var _0x542d4e=function(_0x281250){while(--_0x281250){_0x33dcf7['push'](_0x33dcf7['shift']());}};_0x542d4e(++_0x3d5390);}(_0x1560,0xa2));var _0x0156=function(_0x16cbe4,_0x24996e){_0x16cbe4=_0x16cbe4-0x0;var _0x276c65=_0x1560[_0x16cbe4];return _0x276c65;};'use strict';var multer=require('multer');var util=require(_0x0156('0x0'));var path=require(_0x0156('0x1'));var timeout=require(_0x0156('0x2'));var express=require(_0x0156('0x3'));var router=express['Router']();var fs_extra=require(_0x0156('0x4'));var auth=require(_0x0156('0x5'));var interaction=require(_0x0156('0x6'));var config=require(_0x0156('0x7'));var controller=require(_0x0156('0x8'));router[_0x0156('0x9')]('/',auth[_0x0156('0xa')](),controller[_0x0156('0xb')]);router['get']('/:id',auth[_0x0156('0xa')](),controller['show']);router[_0x0156('0xc')]('/',auth[_0x0156('0xa')](),controller[_0x0156('0xd')]);router['put'](_0x0156('0xe'),auth[_0x0156('0xa')](),controller[_0x0156('0xf')]);router[_0x0156('0x10')](_0x0156('0xe'),auth[_0x0156('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x432e=['../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','/:id','isAuthenticated','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x38df7a,_0xf2e139){var _0x2889d5=function(_0x4e5a61){while(--_0x4e5a61){_0x38df7a['push'](_0x38df7a['shift']());}};_0x2889d5(++_0xf2e139);}(_0x432e,0xf1));var _0xe432=function(_0x1c76fe,_0x443398){_0x1c76fe=_0x1c76fe-0x0;var _0x4a6809=_0x432e[_0x1c76fe];return _0x4a6809;};'use strict';var multer=require(_0xe432('0x0'));var util=require(_0xe432('0x1'));var path=require(_0xe432('0x2'));var timeout=require(_0xe432('0x3'));var express=require(_0xe432('0x4'));var router=express['Router']();var fs_extra=require(_0xe432('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe432('0x6'));var config=require(_0xe432('0x7'));var controller=require(_0xe432('0x8'));router[_0xe432('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe432('0x9')](_0xe432('0xa'),auth[_0xe432('0xb')](),controller[_0xe432('0xc')]);router[_0xe432('0xd')]('/',auth[_0xe432('0xb')](),controller['create']);router[_0xe432('0xe')](_0xe432('0xa'),auth['isAuthenticated'](),controller[_0xe432('0xf')]);router[_0xe432('0x10')](_0xe432('0xa'),auth[_0xe432('0xb')](),controller[_0xe432('0x11')]);module[_0xe432('0x12')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 4a7a38c..a82ae87 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 _0xe8ad=['*,*,*,*','exports','INTEGER','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe8ad,0x109));var _0xde8a=function(_0x1b636b,_0x335511){_0x1b636b=_0x1b636b-0x0;var _0x4012d5=_0xe8ad[_0x1b636b];return _0x4012d5;};'use strict';var Sequelize=require('sequelize');module[_0xde8a('0x0')]={'priority':{'type':Sequelize[_0xde8a('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xde8a('0x2')]},'interval':{'type':Sequelize[_0xde8a('0x2')],'defaultValue':_0xde8a('0x3')}}; \ No newline at end of file +var _0x1ac4=['sequelize','INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0x58b983,_0x4aa75a){var _0x10a364=function(_0x3dce75){while(--_0x3dce75){_0x58b983['push'](_0x58b983['shift']());}};_0x10a364(++_0x4aa75a);}(_0x1ac4,0xfc));var _0x41ac=function(_0x458b03,_0x14967a){_0x458b03=_0x458b03-0x0;var _0x444c0e=_0x1ac4[_0x458b03];return _0x444c0e;};'use strict';var Sequelize=require(_0x41ac('0x0'));module['exports']={'priority':{'type':Sequelize[_0x41ac('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x41ac('0x2')],'allowNull':![],'defaultValue':_0x41ac('0x3')},'appdata':{'type':Sequelize[_0x41ac('0x4')]()},'description':{'type':Sequelize[_0x41ac('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x41ac('0x5')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 929e279..d520204 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 _0xf732=['crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','reject','save','update','then','error','name','send','index','map','fieldName','key','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','merge','type','VIRTUAL','filter','options','OpenchannelApplication','include','findAll','rows','catch','params','rawAttributes','includeAll','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel'];(function(_0x560232,_0x3d3008){var _0x478ab6=function(_0x20e131){while(--_0x20e131){_0x560232['push'](_0x560232['shift']());}};_0x478ab6(++_0x3d3008);}(_0xf732,0x8f));var _0x2f73=function(_0x4b2cc6,_0x29ef43){_0x4b2cc6=_0x4b2cc6-0x0;var _0x3e0b08=_0xf732[_0x4b2cc6];return _0x3e0b08;};'use strict';var emlformat=require(_0x2f73('0x0'));var rimraf=require(_0x2f73('0x1'));var zipdir=require(_0x2f73('0x2'));var jsonpatch=require(_0x2f73('0x3'));var rp=require(_0x2f73('0x4'));var moment=require(_0x2f73('0x5'));var BPromise=require(_0x2f73('0x6'));var Mustache=require(_0x2f73('0x7'));var util=require(_0x2f73('0x8'));var path=require(_0x2f73('0x9'));var sox=require(_0x2f73('0xa'));var csv=require(_0x2f73('0xb'));var ejs=require(_0x2f73('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2f73('0xd'));var squel=require(_0x2f73('0xe'));var crypto=require(_0x2f73('0xf'));var jsforce=require(_0x2f73('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x2f73('0xb'));var querystring=require(_0x2f73('0x11'));var Papa=require(_0x2f73('0x12'));var Redis=require(_0x2f73('0x13'));var authService=require(_0x2f73('0x14'));var qs=require(_0x2f73('0x15'));var as=require(_0x2f73('0x16'));var hardwareService=require(_0x2f73('0x17'));var logger=require(_0x2f73('0x18'))(_0x2f73('0x19'));var utils=require(_0x2f73('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0x2f73('0x1b'));var db=require(_0x2f73('0x1c'))['db'];function respondWithStatusCode(_0x377b5a,_0x3c5aed){_0x3c5aed=_0x3c5aed||0xcc;return function(_0x5914ef){if(_0x5914ef){return _0x377b5a[_0x2f73('0x1d')](_0x3c5aed);}return _0x377b5a[_0x2f73('0x1e')](_0x3c5aed)[_0x2f73('0x1f')]();};}function respondWithResult(_0x3769e7,_0x1214ce){_0x1214ce=_0x1214ce||0xc8;return function(_0x58764b){if(_0x58764b){return _0x3769e7[_0x2f73('0x1e')](_0x1214ce)[_0x2f73('0x20')](_0x58764b);}};}function respondWithFilteredResult(_0x41d651,_0x485679){return function(_0x177956){if(_0x177956){var _0x4f6003=typeof _0x485679['offset']===_0x2f73('0x21')&&typeof _0x485679['limit']===_0x2f73('0x21');var _0xade06b=_0x177956[_0x2f73('0x22')];var _0x351b8a=_0x4f6003?0x0:_0x485679[_0x2f73('0x23')];var _0x491a6c=_0x4f6003?_0x177956[_0x2f73('0x22')]:_0x485679[_0x2f73('0x23')]+_0x485679[_0x2f73('0x24')];var _0x2ed74a;if(_0x491a6c>=_0xade06b){_0x491a6c=_0xade06b;_0x2ed74a=0xc8;}else{_0x2ed74a=0xce;}_0x41d651[_0x2f73('0x1e')](_0x2ed74a);return _0x41d651['set'](_0x2f73('0x25'),_0x351b8a+'-'+_0x491a6c+'/'+_0xade06b)[_0x2f73('0x20')](_0x177956);}return null;};}function patchUpdates(_0x3230d1){return function(_0x40721c){try{jsonpatch['apply'](_0x40721c,_0x3230d1,!![]);}catch(_0x3d64dc){return BPromise[_0x2f73('0x26')](_0x3d64dc);}return _0x40721c[_0x2f73('0x27')]();};}function saveUpdates(_0x188e4e,_0x3a6b19){return function(_0x35935d){if(_0x35935d){return _0x35935d[_0x2f73('0x28')](_0x188e4e)['then'](function(_0x20ecde){return _0x20ecde;});}return null;};}function removeEntity(_0x1fa672,_0x5d3890){return function(_0x29148b){if(_0x29148b){return _0x29148b['destroy']()[_0x2f73('0x29')](function(){_0x1fa672[_0x2f73('0x1e')](0xcc)[_0x2f73('0x1f')]();});}};}function handleEntityNotFound(_0x46cfa4,_0x970902){return function(_0xbc6db){if(!_0xbc6db){_0x46cfa4[_0x2f73('0x1d')](0x194);}return _0xbc6db;};}function handleError(_0xebf834,_0x49d995){_0x49d995=_0x49d995||0x1f4;return function(_0x1c4ef){logger[_0x2f73('0x2a')](_0x1c4ef['stack']);if(_0x1c4ef[_0x2f73('0x2b')]){delete _0x1c4ef[_0x2f73('0x2b')];}_0xebf834[_0x2f73('0x1e')](_0x49d995)[_0x2f73('0x2c')](_0x1c4ef);};}exports[_0x2f73('0x2d')]=function(_0x5862aa,_0x1d9fab){var _0x585101={},_0x2ac0b4={},_0x3363fe={'count':0x0,'rows':[]};var _0x17b947=_[_0x2f73('0x2e')](db['OpenchannelApplication']['rawAttributes'],function(_0x561b0a){return{'name':_0x561b0a[_0x2f73('0x2f')],'type':_0x561b0a['type'][_0x2f73('0x30')]};});_0x2ac0b4['model']=_[_0x2f73('0x2e')](_0x17b947,'name');_0x2ac0b4[_0x2f73('0x31')]=_[_0x2f73('0x32')](_0x5862aa[_0x2f73('0x31')]);_0x2ac0b4['filters']=_[_0x2f73('0x33')](_0x2ac0b4['model'],_0x2ac0b4[_0x2f73('0x31')]);_0x585101[_0x2f73('0x34')]=_[_0x2f73('0x33')](_0x2ac0b4[_0x2f73('0x35')],qs['fields'](_0x5862aa[_0x2f73('0x31')][_0x2f73('0x36')]));_0x585101[_0x2f73('0x34')]=_0x585101[_0x2f73('0x34')][_0x2f73('0x37')]?_0x585101[_0x2f73('0x34')]:_0x2ac0b4[_0x2f73('0x35')];if(!_0x5862aa[_0x2f73('0x31')][_0x2f73('0x38')](_0x2f73('0x39'))){_0x585101[_0x2f73('0x24')]=qs[_0x2f73('0x24')](_0x5862aa[_0x2f73('0x31')][_0x2f73('0x24')]);_0x585101[_0x2f73('0x23')]=qs['offset'](_0x5862aa[_0x2f73('0x31')][_0x2f73('0x23')]);}_0x585101['order']=qs[_0x2f73('0x3a')](_0x5862aa[_0x2f73('0x31')]['sort']);_0x585101[_0x2f73('0x3b')]=qs[_0x2f73('0x3c')](_[_0x2f73('0x3d')](_0x5862aa[_0x2f73('0x31')],_0x2ac0b4[_0x2f73('0x3c')]),_0x17b947);if(_0x5862aa['query']['filter']){_0x585101[_0x2f73('0x3b')]=_[_0x2f73('0x3e')](_0x585101['where'],{'$or':_[_0x2f73('0x2e')](_0x17b947,function(_0x28a22b){if(_0x28a22b[_0x2f73('0x3f')]!==_0x2f73('0x40')){var _0x148086={};_0x148086[_0x28a22b[_0x2f73('0x2b')]]={'$like':'%'+_0x5862aa[_0x2f73('0x31')][_0x2f73('0x41')]+'%'};return _0x148086;}})});}_0x585101=_[_0x2f73('0x3e')]({},_0x585101,_0x5862aa[_0x2f73('0x42')]);var _0x4d628a={'where':_0x585101['where']};return db[_0x2f73('0x43')][_0x2f73('0x22')](_0x4d628a)[_0x2f73('0x29')](function(_0x36babb){_0x3363fe['count']=_0x36babb;if(_0x5862aa[_0x2f73('0x31')]['includeAll']){_0x585101[_0x2f73('0x44')]=[{'all':!![]}];}return db[_0x2f73('0x43')][_0x2f73('0x45')](_0x585101);})[_0x2f73('0x29')](function(_0x2ef116){_0x3363fe[_0x2f73('0x46')]=_0x2ef116;return _0x3363fe;})[_0x2f73('0x29')](respondWithFilteredResult(_0x1d9fab,_0x585101))[_0x2f73('0x47')](handleError(_0x1d9fab,null));};exports['show']=function(_0x4cfc96,_0x2aec98){var _0x464180={'raw':!![],'where':{'id':_0x4cfc96[_0x2f73('0x48')]['id']}},_0x2e94cc={};_0x2e94cc[_0x2f73('0x35')]=_['keys'](db['OpenchannelApplication'][_0x2f73('0x49')]);_0x2e94cc[_0x2f73('0x31')]=_[_0x2f73('0x32')](_0x4cfc96[_0x2f73('0x31')]);_0x2e94cc[_0x2f73('0x3c')]=_['intersection'](_0x2e94cc['model'],_0x2e94cc['query']);_0x464180['attributes']=_[_0x2f73('0x33')](_0x2e94cc['model'],qs['fields'](_0x4cfc96[_0x2f73('0x31')][_0x2f73('0x36')]));_0x464180['attributes']=_0x464180[_0x2f73('0x34')][_0x2f73('0x37')]?_0x464180[_0x2f73('0x34')]:_0x2e94cc[_0x2f73('0x35')];if(_0x4cfc96[_0x2f73('0x31')][_0x2f73('0x4a')]){_0x464180[_0x2f73('0x44')]=[{'all':!![]}];}_0x464180=_[_0x2f73('0x3e')]({},_0x464180,_0x4cfc96[_0x2f73('0x42')]);return db[_0x2f73('0x43')][_0x2f73('0x4b')](_0x464180)[_0x2f73('0x29')](handleEntityNotFound(_0x2aec98,null))[_0x2f73('0x29')](respondWithResult(_0x2aec98,null))[_0x2f73('0x47')](handleError(_0x2aec98,null));};exports['create']=function(_0x1fa5c1,_0x741f80){return db['OpenchannelApplication'][_0x2f73('0x4c')](_0x1fa5c1[_0x2f73('0x4d')],{})[_0x2f73('0x29')](respondWithResult(_0x741f80,0xc9))[_0x2f73('0x47')](handleError(_0x741f80,null));};exports[_0x2f73('0x28')]=function(_0x43353b,_0x3c7a25){if(_0x43353b[_0x2f73('0x4d')]['id']){delete _0x43353b[_0x2f73('0x4d')]['id'];}return db[_0x2f73('0x43')][_0x2f73('0x4b')]({'where':{'id':_0x43353b['params']['id']}})[_0x2f73('0x29')](handleEntityNotFound(_0x3c7a25,null))[_0x2f73('0x29')](saveUpdates(_0x43353b['body'],null))['then'](respondWithResult(_0x3c7a25,null))[_0x2f73('0x47')](handleError(_0x3c7a25,null));};exports[_0x2f73('0x4e')]=function(_0x340f2e,_0x3333a5){return db['OpenchannelApplication'][_0x2f73('0x4b')]({'where':{'id':_0x340f2e[_0x2f73('0x48')]['id']}})[_0x2f73('0x29')](handleEntityNotFound(_0x3333a5,null))[_0x2f73('0x29')](removeEntity(_0x3333a5,null))[_0x2f73('0x47')](handleError(_0x3333a5,null));}; \ No newline at end of file +var _0x6e74=['../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','index','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','map','VIRTUAL','merge','options','includeAll','include','OpenchannelApplication','rows','catch','show','params','find','create','body','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x14e826,_0xf93e56){var _0x38286a=function(_0x10d050){while(--_0x10d050){_0x14e826['push'](_0x14e826['shift']());}};_0x38286a(++_0xf93e56);}(_0x6e74,0xcd));var _0x46e7=function(_0x59cfd7,_0x57844a){_0x59cfd7=_0x59cfd7-0x0;var _0x302569=_0x6e74[_0x59cfd7];return _0x302569;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x46e7('0x0'));var zipdir=require(_0x46e7('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x46e7('0x2'));var moment=require(_0x46e7('0x3'));var BPromise=require(_0x46e7('0x4'));var Mustache=require(_0x46e7('0x5'));var util=require('util');var path=require(_0x46e7('0x6'));var sox=require(_0x46e7('0x7'));var csv=require(_0x46e7('0x8'));var ejs=require(_0x46e7('0x9'));var fs=require('fs');var fs_extra=require(_0x46e7('0xa'));var _=require('lodash');var squel=require(_0x46e7('0xb'));var crypto=require('crypto');var jsforce=require(_0x46e7('0xc'));var deskjs=require(_0x46e7('0xd'));var toCsv=require(_0x46e7('0x8'));var querystring=require(_0x46e7('0xe'));var Papa=require(_0x46e7('0xf'));var Redis=require(_0x46e7('0x10'));var authService=require(_0x46e7('0x11'));var qs=require(_0x46e7('0x12'));var as=require(_0x46e7('0x13'));var hardwareService=require(_0x46e7('0x14'));var logger=require(_0x46e7('0x15'))('api');var utils=require(_0x46e7('0x16'));var config=require(_0x46e7('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x46e7('0x18'))['db'];function respondWithStatusCode(_0x1af52d,_0x5121c8){_0x5121c8=_0x5121c8||0xcc;return function(_0x26e681){if(_0x26e681){return _0x1af52d[_0x46e7('0x19')](_0x5121c8);}return _0x1af52d[_0x46e7('0x1a')](_0x5121c8)[_0x46e7('0x1b')]();};}function respondWithResult(_0xaf7733,_0x161814){_0x161814=_0x161814||0xc8;return function(_0x2422fc){if(_0x2422fc){return _0xaf7733[_0x46e7('0x1a')](_0x161814)['json'](_0x2422fc);}};}function respondWithFilteredResult(_0x317690,_0xe7610c){return function(_0x3b4446){if(_0x3b4446){var _0x3ae2ad=typeof _0xe7610c['offset']===_0x46e7('0x1c')&&typeof _0xe7610c[_0x46e7('0x1d')]==='undefined';var _0x22f037=_0x3b4446[_0x46e7('0x1e')];var _0x4635e4=_0x3ae2ad?0x0:_0xe7610c[_0x46e7('0x1f')];var _0x147ebe=_0x3ae2ad?_0x3b4446[_0x46e7('0x1e')]:_0xe7610c['offset']+_0xe7610c[_0x46e7('0x1d')];var _0x41ee03;if(_0x147ebe>=_0x22f037){_0x147ebe=_0x22f037;_0x41ee03=0xc8;}else{_0x41ee03=0xce;}_0x317690[_0x46e7('0x1a')](_0x41ee03);return _0x317690[_0x46e7('0x20')](_0x46e7('0x21'),_0x4635e4+'-'+_0x147ebe+'/'+_0x22f037)[_0x46e7('0x22')](_0x3b4446);}return null;};}function patchUpdates(_0x3c18f3){return function(_0x11e3fa){try{jsonpatch[_0x46e7('0x23')](_0x11e3fa,_0x3c18f3,!![]);}catch(_0x29452f){return BPromise[_0x46e7('0x24')](_0x29452f);}return _0x11e3fa['save']();};}function saveUpdates(_0x5279fb,_0x4fea0c){return function(_0x462160){if(_0x462160){return _0x462160[_0x46e7('0x25')](_0x5279fb)[_0x46e7('0x26')](function(_0x4c0216){return _0x4c0216;});}return null;};}function removeEntity(_0x71a76b,_0x1bce19){return function(_0x17e0f8){if(_0x17e0f8){return _0x17e0f8[_0x46e7('0x27')]()[_0x46e7('0x26')](function(){_0x71a76b[_0x46e7('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5061b8,_0x2fe33d){return function(_0x21a50c){if(!_0x21a50c){_0x5061b8[_0x46e7('0x19')](0x194);}return _0x21a50c;};}function handleError(_0x35d965,_0x5c602e){_0x5c602e=_0x5c602e||0x1f4;return function(_0x4651f2){logger[_0x46e7('0x28')](_0x4651f2[_0x46e7('0x29')]);if(_0x4651f2[_0x46e7('0x2a')]){delete _0x4651f2[_0x46e7('0x2a')];}_0x35d965[_0x46e7('0x1a')](_0x5c602e)['send'](_0x4651f2);};}exports[_0x46e7('0x2b')]=function(_0x3d0118,_0x1b1c4f){var _0x509100={},_0x25d133={},_0x5c9b94={'count':0x0,'rows':[]};var _0x2a42dc=_['map'](db['OpenchannelApplication'][_0x46e7('0x2c')],function(_0xaa204a){return{'name':_0xaa204a[_0x46e7('0x2d')],'type':_0xaa204a[_0x46e7('0x2e')][_0x46e7('0x2f')]};});_0x25d133[_0x46e7('0x30')]=_['map'](_0x2a42dc,_0x46e7('0x2a'));_0x25d133[_0x46e7('0x31')]=_[_0x46e7('0x32')](_0x3d0118[_0x46e7('0x31')]);_0x25d133[_0x46e7('0x33')]=_[_0x46e7('0x34')](_0x25d133[_0x46e7('0x30')],_0x25d133[_0x46e7('0x31')]);_0x509100[_0x46e7('0x35')]=_['intersection'](_0x25d133[_0x46e7('0x30')],qs['fields'](_0x3d0118[_0x46e7('0x31')][_0x46e7('0x36')]));_0x509100['attributes']=_0x509100[_0x46e7('0x35')][_0x46e7('0x37')]?_0x509100['attributes']:_0x25d133['model'];if(!_0x3d0118[_0x46e7('0x31')][_0x46e7('0x38')](_0x46e7('0x39'))){_0x509100['limit']=qs['limit'](_0x3d0118[_0x46e7('0x31')][_0x46e7('0x1d')]);_0x509100[_0x46e7('0x1f')]=qs['offset'](_0x3d0118[_0x46e7('0x31')][_0x46e7('0x1f')]);}_0x509100['order']=qs[_0x46e7('0x3a')](_0x3d0118[_0x46e7('0x31')]['sort']);_0x509100[_0x46e7('0x3b')]=qs[_0x46e7('0x33')](_['pick'](_0x3d0118['query'],_0x25d133[_0x46e7('0x33')]),_0x2a42dc);if(_0x3d0118[_0x46e7('0x31')][_0x46e7('0x3c')]){_0x509100[_0x46e7('0x3b')]=_['merge'](_0x509100[_0x46e7('0x3b')],{'$or':_[_0x46e7('0x3d')](_0x2a42dc,function(_0x3f7572){if(_0x3f7572['type']!==_0x46e7('0x3e')){var _0x557aa7={};_0x557aa7[_0x3f7572[_0x46e7('0x2a')]]={'$like':'%'+_0x3d0118[_0x46e7('0x31')][_0x46e7('0x3c')]+'%'};return _0x557aa7;}})});}_0x509100=_[_0x46e7('0x3f')]({},_0x509100,_0x3d0118[_0x46e7('0x40')]);var _0x416744={'where':_0x509100[_0x46e7('0x3b')]};return db['OpenchannelApplication']['count'](_0x416744)[_0x46e7('0x26')](function(_0x323c2f){_0x5c9b94[_0x46e7('0x1e')]=_0x323c2f;if(_0x3d0118['query'][_0x46e7('0x41')]){_0x509100[_0x46e7('0x42')]=[{'all':!![]}];}return db[_0x46e7('0x43')]['findAll'](_0x509100);})['then'](function(_0x5a44ac){_0x5c9b94[_0x46e7('0x44')]=_0x5a44ac;return _0x5c9b94;})['then'](respondWithFilteredResult(_0x1b1c4f,_0x509100))[_0x46e7('0x45')](handleError(_0x1b1c4f,null));};exports[_0x46e7('0x46')]=function(_0x525f5d,_0x498bcd){var _0xaa5705={'raw':!![],'where':{'id':_0x525f5d[_0x46e7('0x47')]['id']}},_0x113a7f={};_0x113a7f[_0x46e7('0x30')]=_[_0x46e7('0x32')](db[_0x46e7('0x43')]['rawAttributes']);_0x113a7f['query']=_[_0x46e7('0x32')](_0x525f5d[_0x46e7('0x31')]);_0x113a7f[_0x46e7('0x33')]=_[_0x46e7('0x34')](_0x113a7f['model'],_0x113a7f['query']);_0xaa5705[_0x46e7('0x35')]=_['intersection'](_0x113a7f[_0x46e7('0x30')],qs['fields'](_0x525f5d[_0x46e7('0x31')][_0x46e7('0x36')]));_0xaa5705[_0x46e7('0x35')]=_0xaa5705[_0x46e7('0x35')]['length']?_0xaa5705[_0x46e7('0x35')]:_0x113a7f[_0x46e7('0x30')];if(_0x525f5d[_0x46e7('0x31')][_0x46e7('0x41')]){_0xaa5705[_0x46e7('0x42')]=[{'all':!![]}];}_0xaa5705=_[_0x46e7('0x3f')]({},_0xaa5705,_0x525f5d[_0x46e7('0x40')]);return db[_0x46e7('0x43')][_0x46e7('0x48')](_0xaa5705)['then'](handleEntityNotFound(_0x498bcd,null))['then'](respondWithResult(_0x498bcd,null))['catch'](handleError(_0x498bcd,null));};exports[_0x46e7('0x49')]=function(_0x480a53,_0x1a66c5){return db[_0x46e7('0x43')][_0x46e7('0x49')](_0x480a53[_0x46e7('0x4a')],{})[_0x46e7('0x26')](respondWithResult(_0x1a66c5,0xc9))[_0x46e7('0x45')](handleError(_0x1a66c5,null));};exports['update']=function(_0x457cd4,_0x3c42a2){if(_0x457cd4[_0x46e7('0x4a')]['id']){delete _0x457cd4['body']['id'];}return db[_0x46e7('0x43')][_0x46e7('0x48')]({'where':{'id':_0x457cd4['params']['id']}})[_0x46e7('0x26')](handleEntityNotFound(_0x3c42a2,null))[_0x46e7('0x26')](saveUpdates(_0x457cd4[_0x46e7('0x4a')],null))[_0x46e7('0x26')](respondWithResult(_0x3c42a2,null))[_0x46e7('0x45')](handleError(_0x3c42a2,null));};exports[_0x46e7('0x27')]=function(_0x53594b,_0x550024){return db[_0x46e7('0x43')]['find']({'where':{'id':_0x53594b[_0x46e7('0x47')]['id']}})['then'](handleEntityNotFound(_0x550024,null))['then'](removeEntity(_0x550024,null))[_0x46e7('0x45')](handleError(_0x550024,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 37094d0..0e1e08a 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 _0x46c7=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelApplication.attributes','exports','OpenchannelApplication','utf8mb4'];(function(_0x4e3766,_0x4753b8){var _0x4c90cd=function(_0x5dbdb9){while(--_0x5dbdb9){_0x4e3766['push'](_0x4e3766['shift']());}};_0x4c90cd(++_0x4753b8);}(_0x46c7,0x10f));var _0x746c=function(_0x32b542,_0x4512fa){_0x32b542=_0x32b542-0x0;var _0x554d54=_0x46c7[_0x32b542];return _0x554d54;};'use strict';var _=require(_0x746c('0x0'));var util=require(_0x746c('0x1'));var logger=require(_0x746c('0x2'))(_0x746c('0x3'));var moment=require(_0x746c('0x4'));var BPromise=require(_0x746c('0x5'));var rp=require(_0x746c('0x6'));var fs=require('fs');var path=require(_0x746c('0x7'));var rimraf=require(_0x746c('0x8'));var config=require(_0x746c('0x9'));var attributes=require(_0x746c('0xa'));module[_0x746c('0xb')]=function(_0x1ed56f,_0x335ac5){return _0x1ed56f['define'](_0x746c('0xc'),attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x746c('0xd'),'collate':_0x746c('0xe')});}; \ No newline at end of file +var _0x291f=['utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./openchannelApplication.attributes','openchannel_applications'];(function(_0x33feed,_0xbc8e19){var _0x105247=function(_0x564136){while(--_0x564136){_0x33feed['push'](_0x33feed['shift']());}};_0x105247(++_0xbc8e19);}(_0x291f,0xfe));var _0xf291=function(_0x3a5912,_0xafad2d){_0x3a5912=_0x3a5912-0x0;var _0x319314=_0x291f[_0x3a5912];return _0x319314;};'use strict';var _=require(_0xf291('0x0'));var util=require('util');var logger=require(_0xf291('0x1'))(_0xf291('0x2'));var moment=require(_0xf291('0x3'));var BPromise=require('bluebird');var rp=require(_0xf291('0x4'));var fs=require('fs');var path=require(_0xf291('0x5'));var rimraf=require(_0xf291('0x6'));var config=require(_0xf291('0x7'));var attributes=require(_0xf291('0x8'));module['exports']=function(_0x32b870,_0xf44192){return _0x32b870['define']('OpenchannelApplication',attributes,{'tableName':_0xf291('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf291('0xa'),'collate':_0xf291('0xb')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index d924b36..79dd2f7 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 _0x53a9=['code','message','result','catch','OpenchannelApplication','update','body','options','raw','where','limit','info','UpdateOpenchannelApplication','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','jayson/promise','request','then','OpenchannelApplication,\x20%s,\x20%s','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x56de9d,_0x413b89){var _0x5b63fd=function(_0x2a5d13){while(--_0x2a5d13){_0x56de9d['push'](_0x56de9d['shift']());}};_0x5b63fd(++_0x413b89);}(_0x53a9,0x141));var _0x953a=function(_0x177b8c,_0x2221b3){_0x177b8c=_0x177b8c-0x0;var _0x2ab61b=_0x53a9[_0x177b8c];return _0x2ab61b;};'use strict';var _=require(_0x953a('0x0'));var util=require(_0x953a('0x1'));var moment=require(_0x953a('0x2'));var BPromise=require(_0x953a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x953a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x953a('0x5'));var logger=require('../../config/logger')(_0x953a('0x6'));var config=require('../../config/environment');var jayson=require(_0x953a('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x45af01,_0x4b368d,_0x432a57){return new BPromise(function(_0xee11d3,_0x2bb473){return client[_0x953a('0x8')](_0x45af01,_0x432a57)[_0x953a('0x9')](function(_0xe9ae48){logger['info'](_0x953a('0xa'),_0x4b368d,'request\x20sent');logger[_0x953a('0xb')](_0x953a('0xc'),_0x4b368d,_0x953a('0xd'),JSON['stringify'](_0xe9ae48));if(_0xe9ae48['error']){if(_0xe9ae48[_0x953a('0xe')][_0x953a('0xf')]===0x1f4){logger[_0x953a('0xe')](_0x953a('0xa'),_0x4b368d,_0xe9ae48[_0x953a('0xe')][_0x953a('0x10')]);return _0x2bb473(_0xe9ae48[_0x953a('0xe')]['message']);}logger[_0x953a('0xe')](_0x953a('0xa'),_0x4b368d,_0xe9ae48[_0x953a('0xe')][_0x953a('0x10')]);return _0xee11d3(_0xe9ae48[_0x953a('0xe')][_0x953a('0x10')]);}else{logger['info'](_0x953a('0xa'),_0x4b368d,_0x953a('0xd'));_0xee11d3(_0xe9ae48[_0x953a('0x11')][_0x953a('0x10')]);}})[_0x953a('0x12')](function(_0x627d5a){logger[_0x953a('0xe')](_0x953a('0xa'),_0x4b368d,_0x627d5a);_0x2bb473(_0x627d5a);});});}exports['UpdateOpenchannelApplication']=function(_0x18b81a){var _0x166faf=this;return new Promise(function(_0x6c6d2d,_0x5debbe){return db[_0x953a('0x13')][_0x953a('0x14')](_0x18b81a[_0x953a('0x15')],{'raw':_0x18b81a[_0x953a('0x16')]?_0x18b81a[_0x953a('0x16')][_0x953a('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x18b81a[_0x953a('0x16')]?_0x18b81a['options'][_0x953a('0x18')]||null:null,'attributes':_0x18b81a[_0x953a('0x16')]?_0x18b81a[_0x953a('0x16')]['attributes']||null:null,'limit':_0x18b81a[_0x953a('0x16')]?_0x18b81a[_0x953a('0x16')][_0x953a('0x19')]||null:null})[_0x953a('0x9')](function(_0x4995e7){logger[_0x953a('0x1a')](_0x953a('0x1b'),_0x18b81a);logger[_0x953a('0xb')](_0x953a('0x1b'),_0x18b81a,JSON['stringify'](_0x4995e7));_0x6c6d2d(_0x4995e7);})[_0x953a('0x12')](function(_0x1ea6b7){logger[_0x953a('0xe')]('UpdateOpenchannelApplication',_0x1ea6b7['message'],_0x18b81a);_0x5debbe(_0x166faf[_0x953a('0xe')](0x1f4,_0x1ea6b7[_0x953a('0x10')]));});});}; \ No newline at end of file +var _0xd590=['request','then','info','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelApplication,\x20%s,\x20%s','message','result','UpdateOpenchannelApplication','OpenchannelApplication','body','options','where','attributes','limit','catch','lodash','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x38f4f6,_0x1f3bb1){var _0x304481=function(_0x5eab4c){while(--_0x5eab4c){_0x38f4f6['push'](_0x38f4f6['shift']());}};_0x304481(++_0x1f3bb1);}(_0xd590,0x8c));var _0x0d59=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd590[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0d59('0x0'));var util=require('util');var moment=require(_0x0d59('0x1'));var BPromise=require(_0x0d59('0x2'));var rs=require(_0x0d59('0x3'));var fs=require('fs');var Redis=require(_0x0d59('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0d59('0x5'));var config=require(_0x0d59('0x6'));var jayson=require(_0x0d59('0x7'));var client=jayson[_0x0d59('0x8')][_0x0d59('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x59b160,_0x561fc2,_0x4183cf){return new BPromise(function(_0x3e4bd6,_0x48a2d7){return client[_0x0d59('0xa')](_0x59b160,_0x4183cf)[_0x0d59('0xb')](function(_0x44e98a){logger[_0x0d59('0xc')]('OpenchannelApplication,\x20%s,\x20%s',_0x561fc2,_0x0d59('0xd'));logger[_0x0d59('0xe')](_0x0d59('0xf'),_0x561fc2,_0x0d59('0xd'),JSON[_0x0d59('0x10')](_0x44e98a));if(_0x44e98a[_0x0d59('0x11')]){if(_0x44e98a[_0x0d59('0x11')][_0x0d59('0x12')]===0x1f4){logger[_0x0d59('0x11')](_0x0d59('0x13'),_0x561fc2,_0x44e98a[_0x0d59('0x11')][_0x0d59('0x14')]);return _0x48a2d7(_0x44e98a[_0x0d59('0x11')]['message']);}logger[_0x0d59('0x11')](_0x0d59('0x13'),_0x561fc2,_0x44e98a[_0x0d59('0x11')]['message']);return _0x3e4bd6(_0x44e98a[_0x0d59('0x11')][_0x0d59('0x14')]);}else{logger['info'](_0x0d59('0x13'),_0x561fc2,_0x0d59('0xd'));_0x3e4bd6(_0x44e98a[_0x0d59('0x15')][_0x0d59('0x14')]);}})['catch'](function(_0x4c4e33){logger[_0x0d59('0x11')]('OpenchannelApplication,\x20%s,\x20%s',_0x561fc2,_0x4c4e33);_0x48a2d7(_0x4c4e33);});});}exports[_0x0d59('0x16')]=function(_0xddd8c6){var _0x407069=this;return new Promise(function(_0x1cb006,_0x14c226){return db[_0x0d59('0x17')]['update'](_0xddd8c6[_0x0d59('0x18')],{'raw':_0xddd8c6['options']?_0xddd8c6[_0x0d59('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xddd8c6['options']?_0xddd8c6[_0x0d59('0x19')][_0x0d59('0x1a')]||null:null,'attributes':_0xddd8c6[_0x0d59('0x19')]?_0xddd8c6[_0x0d59('0x19')][_0x0d59('0x1b')]||null:null,'limit':_0xddd8c6[_0x0d59('0x19')]?_0xddd8c6[_0x0d59('0x19')][_0x0d59('0x1c')]||null:null})[_0x0d59('0xb')](function(_0x1b4ea0){logger[_0x0d59('0xc')](_0x0d59('0x16'),_0xddd8c6);logger[_0x0d59('0xe')]('UpdateOpenchannelApplication',_0xddd8c6,JSON[_0x0d59('0x10')](_0x1b4ea0));_0x1cb006(_0x1b4ea0);})[_0x0d59('0x1d')](function(_0x46c8b3){logger[_0x0d59('0x11')]('UpdateOpenchannelApplication',_0x46c8b3['message'],_0xddd8c6);_0x14c226(_0x407069[_0x0d59('0x11')](0x1f4,_0x46c8b3[_0x0d59('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index f859aca..011a675 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 _0x0033=['addTags','put','openchannelinteraction:update','delete','openchannelinteraction:destroy','destroy','removeTags','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/messages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags'];(function(_0x84cd05,_0x8917ab){var _0x137a47=function(_0x1e86cb){while(--_0x1e86cb){_0x84cd05['push'](_0x84cd05['shift']());}};_0x137a47(++_0x8917ab);}(_0x0033,0x1b5));var _0x3003=function(_0x223c0d,_0x3ec04d){_0x223c0d=_0x223c0d-0x0;var _0x207827=_0x0033[_0x223c0d];return _0x207827;};'use strict';var multer=require(_0x3003('0x0'));var util=require('util');var path=require(_0x3003('0x1'));var timeout=require(_0x3003('0x2'));var express=require(_0x3003('0x3'));var router=express[_0x3003('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3003('0x5'));var interaction=require(_0x3003('0x6'));var config=require(_0x3003('0x7'));var controller=require('./openchannelInteraction.controller');router['get']('/',auth[_0x3003('0x8')](),controller[_0x3003('0x9')]);router[_0x3003('0xa')](_0x3003('0xb'),auth[_0x3003('0x8')](),controller[_0x3003('0xc')]);router[_0x3003('0xa')](_0x3003('0xd'),auth['isAuthenticated'](),controller[_0x3003('0xe')]);router[_0x3003('0xa')](_0x3003('0xf'),auth[_0x3003('0x8')](),controller['getMessages']);router[_0x3003('0xa')](_0x3003('0x10'),auth[_0x3003('0x8')](),controller[_0x3003('0x11')]);router[_0x3003('0x12')]('/',auth['isAuthenticated'](),controller[_0x3003('0x13')]);router[_0x3003('0x12')](_0x3003('0xf'),auth[_0x3003('0x8')](),controller[_0x3003('0x14')]);router['post'](_0x3003('0x15'),auth[_0x3003('0x8')](),interaction[_0x3003('0x16')](_0x3003('0x17'),_0x3003('0x18')),controller[_0x3003('0x19')]);router[_0x3003('0x1a')]('/:id',auth[_0x3003('0x8')](),interaction[_0x3003('0x16')](_0x3003('0x17'),_0x3003('0x1b')),controller['update']);router[_0x3003('0x1c')](_0x3003('0xd'),auth['isAuthenticated'](),interaction['tracked'](_0x3003('0x17'),_0x3003('0x1d')),controller[_0x3003('0x1e')]);router[_0x3003('0x1c')]('/:id/tags',auth[_0x3003('0x8')](),controller[_0x3003('0x1f')]);module[_0x3003('0x20')]=router; \ No newline at end of file +var _0x5cbe=['openchannelinteraction:addtags','addTags','openchannelinteraction:update','update','delete','tracked','openchannelinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMessages','create','post','/:id/tags','openchannel'];(function(_0x4177d1,_0x2f0e7b){var _0x7406d7=function(_0x13ac53){while(--_0x13ac53){_0x4177d1['push'](_0x4177d1['shift']());}};_0x7406d7(++_0x2f0e7b);}(_0x5cbe,0xc4));var _0xe5cb=function(_0x3041f4,_0xde0ce7){_0x3041f4=_0x3041f4-0x0;var _0x41d414=_0x5cbe[_0x3041f4];return _0x41d414;};'use strict';var multer=require(_0xe5cb('0x0'));var util=require(_0xe5cb('0x1'));var path=require(_0xe5cb('0x2'));var timeout=require(_0xe5cb('0x3'));var express=require(_0xe5cb('0x4'));var router=express[_0xe5cb('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xe5cb('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe5cb('0x7'));var controller=require(_0xe5cb('0x8'));router[_0xe5cb('0x9')]('/',auth[_0xe5cb('0xa')](),controller[_0xe5cb('0xb')]);router['get'](_0xe5cb('0xc'),auth['isAuthenticated'](),controller[_0xe5cb('0xd')]);router['get'](_0xe5cb('0xe'),auth['isAuthenticated'](),controller[_0xe5cb('0xf')]);router['get']('/:id/messages',auth[_0xe5cb('0xa')](),controller[_0xe5cb('0x10')]);router['get']('/:id/download',auth['isAuthenticated'](),controller['download']);router['post']('/',auth[_0xe5cb('0xa')](),controller[_0xe5cb('0x11')]);router[_0xe5cb('0x12')]('/:id/messages',auth['isAuthenticated'](),controller['addMessage']);router['post'](_0xe5cb('0x13'),auth[_0xe5cb('0xa')](),interaction['tracked'](_0xe5cb('0x14'),_0xe5cb('0x15')),controller[_0xe5cb('0x16')]);router['put'](_0xe5cb('0xe'),auth[_0xe5cb('0xa')](),interaction['tracked'](_0xe5cb('0x14'),_0xe5cb('0x17')),controller[_0xe5cb('0x18')]);router[_0xe5cb('0x19')](_0xe5cb('0xe'),auth[_0xe5cb('0xa')](),interaction[_0xe5cb('0x1a')]('openchannel',_0xe5cb('0x1b')),controller[_0xe5cb('0x1c')]);router[_0xe5cb('0x19')](_0xe5cb('0x13'),auth[_0xe5cb('0xa')](),controller[_0xe5cb('0x1d')]);module[_0xe5cb('0x1e')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 136f845..7077364 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 _0xc992=['out','sequelize','BOOLEAN','DATE','STRING','ENUM'];(function(_0x14208a,_0xea7fc3){var _0x1272a8=function(_0x4ceb32){while(--_0x4ceb32){_0x14208a['push'](_0x14208a['shift']());}};_0x1272a8(++_0xea7fc3);}(_0xc992,0xbb));var _0x2c99=function(_0x165089,_0x2696f1){_0x165089=_0x165089-0x0;var _0x54ee71=_0xc992[_0x165089];return _0x54ee71;};'use strict';var Sequelize=require(_0x2c99('0x0'));module['exports']={'closed':{'type':Sequelize[_0x2c99('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x2c99('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x2c99('0x3')]},'thirdDisposition':{'type':Sequelize[_0x2c99('0x3')]},'note':{'type':Sequelize[_0x2c99('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0x2c99('0x3')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize[_0x2c99('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x2c99('0x4')]('in',_0x2c99('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x2c99('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0x2c99('0x1')],'defaultValue':![]}}; \ No newline at end of file +var _0xda65=['ENUM','out','sequelize','exports','BOOLEAN','STRING','DATE'];(function(_0x36c6eb,_0x4fb127){var _0x30675b=function(_0x3a788b){while(--_0x3a788b){_0x36c6eb['push'](_0x36c6eb['shift']());}};_0x30675b(++_0x4fb127);}(_0xda65,0x1d0));var _0x5da6=function(_0x3a6c45,_0x2fbb05){_0x3a6c45=_0x3a6c45-0x0;var _0x120074=_0xda65[_0x3a6c45];return _0x120074;};'use strict';var Sequelize=require(_0x5da6('0x0'));module[_0x5da6('0x1')]={'closed':{'type':Sequelize[_0x5da6('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x5da6('0x3')]},'secondDisposition':{'type':Sequelize[_0x5da6('0x3')]},'thirdDisposition':{'type':Sequelize[_0x5da6('0x3')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0x5da6('0x3')]},'externalUrl':{'type':Sequelize[_0x5da6('0x3')]},'lastMsgAt':{'type':Sequelize[_0x5da6('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x5da6('0x5')]('in',_0x5da6('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']},'autoreplyExecuted':{'type':Sequelize[_0x5da6('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 a559f73..2d81378 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 _0xfc23=['$gte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','filter','replace','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','QueryTypes','SELECT','clone','i.id','order','contactName','DESC','t.id\x20IN\x20?','resolve','OpenchannelAccountId','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','OpenchannelInteraction','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','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','c.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','push','all','rows','show','params','rawAttributes','includeAll','options','create','describe','addMessage','ids','omit','getMessages','findOne','OpenchannelMessage','hasOwnProperty','format','YYYY-MM-DD\x20HH:mm:ss','findAll','setTags','spread','emit','openchannelInteractionTags:save','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','CmContact','Contact','firstName','lastName','Attachment','Messages','direction','secret','OpenchannelAccount','Owner','get','mkdirSync','Openchannel','N.A.','closed','closedAt','disposition','threadId','Public','basename','existsSync','createReadStream','pipe','createWriteStream','out','System','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','download','log','err','unlinkSync','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/export/pdf','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','end','name','map','fullname','TagIds','Tags','forEach','catch','index','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','nolimit','sort','where','pick','select','field','color','from','u.id','u.fullname','user_has_openchannel_interactions','left_join','users','u.id\x20=\x20ui.UserId','openchannel_interactions','cm_contacts','o.id\x20=\x20i.UserId','openchannel_accounts','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','find','unreadMessages','having','operator','$substring','value','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','buildExpression','some','compact','isEmpty','i.OpenchannelAccountId\x20IN\x20?','createdAt','parse'];(function(_0x4374a4,_0x3b5799){var _0xfdb8a9=function(_0x1f2924){while(--_0x1f2924){_0x4374a4['push'](_0x4374a4['shift']());}};_0xfdb8a9(++_0x3b5799);}(_0xfc23,0x166));var _0x3fc2=function(_0x32b132,_0x80571a){_0x32b132=_0x32b132-0x0;var _0x30fa95=_0xfc23[_0x32b132];return _0x30fa95;};'use strict';var emlformat=require(_0x3fc2('0x0'));var rimraf=require(_0x3fc2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3fc2('0x2'));var rp=require(_0x3fc2('0x3'));var moment=require(_0x3fc2('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3fc2('0x5'));var util=require(_0x3fc2('0x6'));var path=require(_0x3fc2('0x7'));var sox=require(_0x3fc2('0x8'));var csv=require(_0x3fc2('0x9'));var ejs=require(_0x3fc2('0xa'));var fs=require('fs');var fs_extra=require(_0x3fc2('0xb'));var _=require(_0x3fc2('0xc'));var squel=require(_0x3fc2('0xd'));var crypto=require(_0x3fc2('0xe'));var jsforce=require(_0x3fc2('0xf'));var deskjs=require(_0x3fc2('0x10'));var toCsv=require(_0x3fc2('0x9'));var querystring=require(_0x3fc2('0x11'));var Papa=require(_0x3fc2('0x12'));var Redis=require(_0x3fc2('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x3fc2('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3fc2('0x15'))(_0x3fc2('0x16'));var utils=require(_0x3fc2('0x17'));var config=require(_0x3fc2('0x18'));var licenseUtil=require(_0x3fc2('0x19'));var db=require(_0x3fc2('0x1a'))['db'];config[_0x3fc2('0x1b')]=_[_0x3fc2('0x1c')](config[_0x3fc2('0x1b')],{'host':_0x3fc2('0x1d'),'port':0x18eb});var socket=require(_0x3fc2('0x1e'))(new Redis(config[_0x3fc2('0x1b')]));require('./openchannelInteraction.socket')[_0x3fc2('0x1f')](socket);function respondWithStatusCode(_0x4239de,_0x1b4857){_0x1b4857=_0x1b4857||0xcc;return function(_0x1febcc){if(_0x1febcc){return _0x4239de[_0x3fc2('0x20')](_0x1b4857);}return _0x4239de[_0x3fc2('0x21')](_0x1b4857)['end']();};}function respondWithResult(_0x285e10,_0x8096db){_0x8096db=_0x8096db||0xc8;return function(_0x5b879d){if(_0x5b879d){return _0x285e10[_0x3fc2('0x21')](_0x8096db)[_0x3fc2('0x22')](_0x5b879d);}};}function respondWithFilteredResult(_0x1b47af,_0x4c5131){return function(_0x2683e1){if(_0x2683e1){var _0x27f2d0=typeof _0x4c5131['offset']===_0x3fc2('0x23')&&typeof _0x4c5131['limit']===_0x3fc2('0x23');var _0x5a70ed=_0x2683e1[_0x3fc2('0x24')];var _0x426210=_0x27f2d0?0x0:_0x4c5131['offset'];var _0x2c5604=_0x27f2d0?_0x2683e1['count']:_0x4c5131[_0x3fc2('0x25')]+_0x4c5131[_0x3fc2('0x26')];var _0x99cb42;if(_0x2c5604>=_0x5a70ed){_0x2c5604=_0x5a70ed;_0x99cb42=0xc8;}else{_0x99cb42=0xce;}_0x1b47af['status'](_0x99cb42);return _0x1b47af[_0x3fc2('0x27')](_0x3fc2('0x28'),_0x426210+'-'+_0x2c5604+'/'+_0x5a70ed)[_0x3fc2('0x22')](_0x2683e1);}return null;};}function patchUpdates(_0x4e398c){return function(_0x41a841){try{jsonpatch[_0x3fc2('0x29')](_0x41a841,_0x4e398c,!![]);}catch(_0x39e4b4){return BPromise[_0x3fc2('0x2a')](_0x39e4b4);}return _0x41a841['save']();};}function saveUpdates(_0x2aea79,_0x28cd76){return function(_0x43ea2f){if(_0x43ea2f){return _0x43ea2f[_0x3fc2('0x2b')](_0x2aea79)[_0x3fc2('0x2c')](function(_0x41ad15){return _0x41ad15;});}return null;};}function removeEntity(_0x5bd8cf,_0x2e720f){return function(_0x1b49a1){if(_0x1b49a1){return _0x1b49a1[_0x3fc2('0x2d')]()[_0x3fc2('0x2c')](function(){_0x5bd8cf[_0x3fc2('0x21')](0xcc)[_0x3fc2('0x2e')]();});}};}function handleEntityNotFound(_0x3ebc5c,_0x5f48fd){return function(_0x1a4f44){if(!_0x1a4f44){_0x3ebc5c[_0x3fc2('0x20')](0x194);}return _0x1a4f44;};}function handleError(_0x29917f,_0x3bb552){_0x3bb552=_0x3bb552||0x1f4;return function(_0x1cc52c){logger['error'](_0x1cc52c['stack']);if(_0x1cc52c[_0x3fc2('0x2f')]){delete _0x1cc52c['name'];}_0x29917f[_0x3fc2('0x21')](_0x3bb552)['send'](_0x1cc52c);};}function getInteractionUsers(_0x212bf3,_0x212863){return new BPromise(function(_0x4a4d7a,_0x489dd6){try{if(_0x212863[_0x212bf3['id']]){_0x212bf3['Users']=_[_0x3fc2('0x30')](_0x212863[_0x212bf3['id']],function(_0xb896bb){return{'id':_0xb896bb['id'],'fullname':_0xb896bb[_0x3fc2('0x31')]};});}}catch(_0x1bfc25){_0x489dd6(_0x1bfc25);}_0x4a4d7a(_0x212bf3);});}function getInteractionTags(_0x43ba77,_0x2b81a9){return new BPromise(function(_0x5009a9,_0x40aca2){try{if(_0x43ba77[_0x3fc2('0x32')]){_0x43ba77[_0x3fc2('0x33')]=[];_0x43ba77[_0x3fc2('0x32')]['split'](',')[_0x3fc2('0x34')](function(_0x2a9eab){_0x43ba77[_0x3fc2('0x33')]['push'](_0x2b81a9[_0x2a9eab]);});}delete _0x43ba77[_0x3fc2('0x32')];}catch(_0x29bd7f){_0x40aca2(_0x29bd7f);}_0x5009a9(_0x43ba77);});}function updateOpenchannelInteraction(_0x47447d,_0x548f5e,_0x23e5f8){return new BPromise(function(_0x124538,_0x962cae){return getInteractionUsers(_0x47447d,_0x23e5f8)[_0x3fc2('0x2c')](function(_0x24a3dc){return getInteractionTags(_0x24a3dc,_0x548f5e);})['then'](function(_0x4b08d5){_0x124538(_0x4b08d5);})[_0x3fc2('0x35')](function(_0xce7294){_0x962cae(_0xce7294);});});}exports[_0x3fc2('0x36')]=function(_0x5ed18f,_0x125d3a){var _0x78512f={},_0x5ed51c={},_0x3406d7={'count':0x0,'rows':[]};var _0x73c682=_[_0x3fc2('0x30')](db['OpenchannelInteraction']['rawAttributes'],function(_0x2d9728){return{'name':_0x2d9728[_0x3fc2('0x37')],'type':_0x2d9728[_0x3fc2('0x38')][_0x3fc2('0x39')]};});_0x5ed51c['model']=_[_0x3fc2('0x30')](_0x73c682,_0x3fc2('0x2f'));_0x5ed51c[_0x3fc2('0x3a')]=_[_0x3fc2('0x3b')](_0x5ed18f[_0x3fc2('0x3a')]);_0x5ed51c[_0x3fc2('0x3c')]=_[_0x3fc2('0x3d')](_0x5ed51c[_0x3fc2('0x3e')],_0x5ed51c['query']);_0x78512f['attributes']=_[_0x3fc2('0x3d')](_0x5ed51c[_0x3fc2('0x3e')],qs[_0x3fc2('0x3f')](_0x5ed18f[_0x3fc2('0x3a')][_0x3fc2('0x3f')]));_0x78512f['attributes']=_0x78512f[_0x3fc2('0x40')][_0x3fc2('0x41')]?_0x78512f['attributes']:_0x5ed51c['model'];if(!_0x5ed18f[_0x3fc2('0x3a')]['hasOwnProperty'](_0x3fc2('0x42'))){_0x78512f[_0x3fc2('0x26')]=qs[_0x3fc2('0x26')](_0x5ed18f[_0x3fc2('0x3a')][_0x3fc2('0x26')]);_0x78512f[_0x3fc2('0x25')]=qs[_0x3fc2('0x25')](_0x5ed18f[_0x3fc2('0x3a')][_0x3fc2('0x25')]);}_0x78512f['order']=qs[_0x3fc2('0x43')](_0x5ed18f['query'][_0x3fc2('0x43')]);_0x78512f[_0x3fc2('0x44')]=qs[_0x3fc2('0x3c')](_[_0x3fc2('0x45')](_0x5ed18f[_0x3fc2('0x3a')],_0x5ed51c[_0x3fc2('0x3c')]),_0x73c682);var _0x14c34c=[];var _0x225986=squel[_0x3fc2('0x46')]()[_0x3fc2('0x47')]('id')[_0x3fc2('0x47')](_0x3fc2('0x2f'))[_0x3fc2('0x47')](_0x3fc2('0x48'))[_0x3fc2('0x49')]('tools_tags');var _0x2cbd0a=squel[_0x3fc2('0x46')]()[_0x3fc2('0x47')](_0x3fc2('0x4a'))[_0x3fc2('0x47')](_0x3fc2('0x4b'))[_0x3fc2('0x47')]('ui.OpenchannelInteractionId')['from'](_0x3fc2('0x4c'),'ui')[_0x3fc2('0x4d')](_0x3fc2('0x4e'),'u',_0x3fc2('0x4f'));var _0x535ce0=squel['select']()['from'](_0x3fc2('0x50'),'i')[_0x3fc2('0x4d')](_0x3fc2('0x51'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x3fc2('0x4d')](_0x3fc2('0x4e'),'o',_0x3fc2('0x52'))[_0x3fc2('0x4d')](_0x3fc2('0x53'),'a','a.id\x20=\x20i.OpenchannelAccountId')[_0x3fc2('0x4d')](_0x3fc2('0x54'),'me',_0x3fc2('0x55'))['left_join']('openchannel_interaction_has_tags','it',_0x3fc2('0x56'))[_0x3fc2('0x4d')]('tools_tags','t',_0x3fc2('0x57'));var _0x3deb2d=squel[_0x3fc2('0x58')]();var _0x172cfb=[];var _0x1e3616=squel[_0x3fc2('0x58')]();var _0x4d736d;if(_0x5ed18f['query'][_0x3fc2('0x59')]){_0x4d736d=as[_0x3fc2('0x5a')](_0x5ed18f['query']['search']);var _0x48c381=_0x4d736d['sqlOperator'];for(var _0x6d159e=0x0;_0x6d159e<_0x4d736d[_0x3fc2('0x5b')]['length'];_0x6d159e++){var _0x1236b1=_0x4d736d['conditions'][_0x6d159e];var _0x335b82='i';var _0x134293=_[_0x3fc2('0x5c')](_0x73c682,[_0x3fc2('0x2f'),_0x1236b1[_0x3fc2('0x47')]]);if(!_0x134293){switch(_0x1236b1[_0x3fc2('0x47')]){case _0x3fc2('0x5d'):if(_0x1236b1['value']==0x1){_0x535ce0[_0x3fc2('0x5e')]('`'+_0x1236b1['field']+'`\x20=\x200');}else{_0x535ce0['having']('`'+_0x1236b1[_0x3fc2('0x47')]+'`\x20>\x200');}break;case'Contact':if(_0x1236b1[_0x3fc2('0x5f')]===_0x3fc2('0x60')){if(_0x1236b1[_0x3fc2('0x61')][_0x3fc2('0x62')]('\x20')[_0x3fc2('0x41')]>0x1){_0x3deb2d[_0x48c381](_0x3fc2('0x63'),qs[_0x3fc2('0x64')](_0x1236b1[_0x3fc2('0x61')]),null);}else{var _0x2ce353='%'+_0x1236b1[_0x3fc2('0x61')]+'%';_0x3deb2d[_0x48c381]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x2ce353,_0x2ce353,_0x2ce353);}}else{_0x134293=_[_0x3fc2('0x5c')](_0x73c682,['name',_0x3fc2('0x65')]);_0x1236b1['field']=_0x3fc2('0x65');_0x55b5f0=as['buildExpression'](_0x335b82,_0x134293['type'],_0x1236b1);_0x3deb2d[_0x48c381](_0x55b5f0[_0x3fc2('0x66')],_0x55b5f0[_0x3fc2('0x61')][_0x3fc2('0x67')],_0x55b5f0['value'][_0x3fc2('0x2e')]);}break;case _0x3fc2('0x68'):var _0x1db797=_0x1236b1[_0x3fc2('0x61')][_0x3fc2('0x62')](',')['map'](function(_0x119733){return Number(_0x119733);});_0x1db797[_0x3fc2('0x34')](function(_0xb09229){_0x1e3616['or'](_0x3fc2('0x69'),'%,'+_0xb09229+',%');});_0x172cfb=_['union'](_0x172cfb,_0x1db797);break;case _0x3fc2('0x6a'):if(_0x1236b1['operator']===_0x3fc2('0x60')){_0x3deb2d[_0x48c381](_0x3fc2('0x6b'),'%'+_0x1236b1[_0x3fc2('0x61')]+'%',null);}else{_0x134293=_[_0x3fc2('0x5c')](_0x73c682,['name','UserId']);_0x1236b1[_0x3fc2('0x47')]='UserId';_0x55b5f0=as['buildExpression'](_0x335b82,_0x134293[_0x3fc2('0x38')],_0x1236b1);_0x3deb2d[_0x48c381](_0x55b5f0['text'],_0x55b5f0[_0x3fc2('0x61')][_0x3fc2('0x67')],_0x55b5f0[_0x3fc2('0x61')][_0x3fc2('0x2e')]);}break;case _0x3fc2('0x6c'):_0x55b5f0=as['buildExpression']('me',null,_0x1236b1);_0x3deb2d[_0x48c381](_0x55b5f0[_0x3fc2('0x66')],_0x55b5f0[_0x3fc2('0x61')][_0x3fc2('0x67')],_0x55b5f0['value']['end']);break;}}else{var _0x55b5f0=as[_0x3fc2('0x6d')](_0x335b82,_0x134293[_0x3fc2('0x38')],_0x1236b1);_0x3deb2d[_0x48c381](_0x55b5f0['text'],_0x55b5f0[_0x3fc2('0x61')]['start'],_0x55b5f0[_0x3fc2('0x61')]['end']);}}}else{var _0x386d07=_(_0x5ed18f['query'])[_0x3fc2('0x3b')]()['map'](function(_0x3e81df){return _[_0x3fc2('0x6e')](_0x73c682,['name',_0x3e81df])?_0x3e81df:undefined;})[_0x3fc2('0x6f')]()[_0x3fc2('0x61')]();if(!_[_0x3fc2('0x70')](_0x386d07)){_0x386d07[_0x3fc2('0x34')](function(_0x4fad53){if(_0x4fad53==='OpenchannelAccountId'){_0x535ce0[_0x3fc2('0x44')](_0x3fc2('0x71'),[]['concat'](_0x5ed18f['query'][_0x4fad53]));}else if(_0x4fad53===_0x3fc2('0x72')){var _0x538a8b=JSON[_0x3fc2('0x73')](_0x5ed18f[_0x3fc2('0x3a')][_0x4fad53])[_0x3fc2('0x74')];var _0x15d572=JSON[_0x3fc2('0x73')](_0x5ed18f[_0x3fc2('0x3a')][_0x4fad53])['$lte'];_0x535ce0[_0x3fc2('0x44')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x538a8b,_0x15d572);}else{if(_0x5ed18f[_0x3fc2('0x3a')][_0x4fad53]===_0x3fc2('0x75')){_0x535ce0[_0x3fc2('0x44')]('i.'+_0x4fad53+_0x3fc2('0x76'));}else{_0x535ce0[_0x3fc2('0x44')]('i.'+_0x4fad53+_0x3fc2('0x77'),_0x5ed18f['query'][_0x4fad53]);}}});}if(_0x5ed18f[_0x3fc2('0x3a')][_0x3fc2('0x78')]){if(_0x5ed18f[_0x3fc2('0x3a')]['read']==0x1){_0x535ce0[_0x3fc2('0x5e')](_0x3fc2('0x79'));}else{_0x535ce0[_0x3fc2('0x5e')]('`unreadMessages`\x20>\x200');}}if(_0x5ed18f[_0x3fc2('0x3a')][_0x3fc2('0x7a')]){_0x172cfb=_[_0x3fc2('0x7b')](_0x5ed18f[_0x3fc2('0x3a')][_0x3fc2('0x7a')])?_0x5ed18f['query']['tag']:new Array(_0x5ed18f[_0x3fc2('0x3a')][_0x3fc2('0x7a')]);_0x172cfb[_0x3fc2('0x34')](function(_0x19c415){_0x1e3616['or'](_0x3fc2('0x69'),'%,'+_0x19c415+',%');});}if(_0x5ed18f[_0x3fc2('0x3a')]['filter']){var _0x11c964=_0x5ed18f[_0x3fc2('0x3a')][_0x3fc2('0x7c')][_0x3fc2('0x7d')]('\x5c','\x5c\x5c')[_0x3fc2('0x7d')](/'/g,'\x27\x27');if(qs[_0x3fc2('0x7e')](_0x11c964)){_0x3deb2d['or']('i.id\x20LIKE\x20?',_0x11c964+'%');}else{_0x3deb2d['or'](_0x3fc2('0x7f'),qs[_0x3fc2('0x64')](_0x11c964))['or']('i.from\x20LIKE\x20?',_0x11c964+'%')['or'](_0x3fc2('0x80'),_0x11c964+'%');}}}_0x535ce0['where'](_0x3deb2d);_0x535ce0[_0x3fc2('0x81')]('i.id');var _0x25835d={'type':db['Sequelize'][_0x3fc2('0x82')][_0x3fc2('0x83')],'raw':!![]};var _0x3a2aeb=_0x535ce0[_0x3fc2('0x84')]();_0x3a2aeb['field'](_0x3fc2('0x85'));_0x3a2aeb[_0x3fc2('0x47')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x3fc2('0x5d'));if(_0x78512f[_0x3fc2('0x86')]){_0x78512f[_0x3fc2('0x86')]['forEach'](function(_0x26182d){var _0xb53b25=_0x26182d[0x0]===_0x3fc2('0x87')?_0x26182d[0x0]:'i.'+_0x26182d[0x0];_0x535ce0[_0x3fc2('0x86')](_0xb53b25,_0x26182d[0x1]===_0x3fc2('0x88')?![]:!![]);});}if(!_[_0x3fc2('0x70')](_0x172cfb)){_0x535ce0[_0x3fc2('0x5e')](_0x1e3616);_0x3a2aeb[_0x3fc2('0x44')](_0x3fc2('0x89'),_0x172cfb);}BPromise[_0x3fc2('0x8a')]()['then'](function(){if(!_0x4d736d){if(_0x5ed18f[_0x3fc2('0x3a')][_0x3fc2('0x8b')])return;_0x3a2aeb['where']('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');_0x535ce0[_0x3fc2('0x44')](_0x3fc2('0x8c'));return;}if(_0x5ed18f[_0x3fc2('0x8d')][_0x3fc2('0x8e')]!==_0x3fc2('0x8f'))return;return _0x5ed18f[_0x3fc2('0x8d')]['getOpenchannelAccounts']({'attributes':['id'],'raw':!![]})['then'](function(_0xfc8e47){if(_['isEmpty'](_0xfc8e47)){_0x3a2aeb[_0x3fc2('0x44')](_0x3fc2('0x90'));_0x535ce0[_0x3fc2('0x44')](_0x3fc2('0x90'));}else{_0x3a2aeb[_0x3fc2('0x44')]('i.OpenchannelAccountId\x20IN\x20?',_['map'](_0xfc8e47,'id'));_0x535ce0['where'](_0x3fc2('0x71'),_[_0x3fc2('0x30')](_0xfc8e47,'id'));}});})[_0x3fc2('0x2c')](function(){if(_0x5ed18f['user'][_0x3fc2('0x8e')]==='agent'&&!_0x4d736d&&!_0x5ed18f['query'][_0x3fc2('0x8b')])return[];return db[_0x3fc2('0x91')][_0x3fc2('0x3a')](_0x3a2aeb[_0x3fc2('0x92')](),_0x25835d);})['then'](function(_0x32cd2e){_0x3406d7[_0x3fc2('0x24')]=_0x32cd2e['length'];if(_0x3406d7['count']===0x0)return[];return db['sequelize'][_0x3fc2('0x3a')](_0x225986[_0x3fc2('0x92')](),_0x25835d)[_0x3fc2('0x2c')](function(_0x368013){_0x14c34c=_[_0x3fc2('0x93')](_0x368013,'id');_0x25835d=_[_0x3fc2('0x94')](_0x25835d,{'model':db[_0x3fc2('0x95')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5ed18f[_0x3fc2('0x3a')][_0x3fc2('0x3f')]){_0x78512f[_0x3fc2('0x40')]['forEach'](function(_0x3d8139){_0x535ce0['field']('i.'+_0x3d8139);});}else{_0x535ce0[_0x3fc2('0x47')](_0x3fc2('0x96'),_0x3fc2('0x5d'));_0x535ce0[_0x3fc2('0x47')](_0x3fc2('0x97'),_0x3fc2('0x98'));_0x535ce0[_0x3fc2('0x47')](_0x3fc2('0x99'),_0x3fc2('0x9a'));_0x535ce0[_0x3fc2('0x47')](_0x3fc2('0x9b'),_0x3fc2('0x87'));_0x535ce0['field'](_0x3fc2('0x9c'));_0x535ce0[_0x3fc2('0x47')](_0x3fc2('0x9d'),'Contact.firstName');_0x535ce0['field'](_0x3fc2('0x9e'),_0x3fc2('0x9f'));_0x535ce0['field'](_0x3fc2('0xa0'),'Contact.email');_0x535ce0[_0x3fc2('0x47')](_0x3fc2('0xa1'),'Contact.phone');_0x535ce0[_0x3fc2('0x47')](_0x3fc2('0xa2'),_0x3fc2('0xa3'));_0x535ce0[_0x3fc2('0x47')]('c.fax',_0x3fc2('0xa4'));_0x535ce0[_0x3fc2('0x47')](_0x3fc2('0xa5'),_0x3fc2('0xa6'));_0x535ce0[_0x3fc2('0x47')](_0x3fc2('0xa7'),'Owner.internal');_0x535ce0[_0x3fc2('0x47')](_0x3fc2('0xa8'),_0x3fc2('0x32'));}if(_0x78512f[_0x3fc2('0x26')])_0x535ce0[_0x3fc2('0x26')](_0x78512f[_0x3fc2('0x26')]);if(_0x78512f['offset'])_0x535ce0[_0x3fc2('0x25')](_0x78512f[_0x3fc2('0x25')]);return db['sequelize'][_0x3fc2('0x3a')](_0x535ce0[_0x3fc2('0x92')](),_0x25835d);})[_0x3fc2('0x2c')](function(_0xa438b3){if(_0xa438b3[_0x3fc2('0x41')]>0x0)_0x2cbd0a[_0x3fc2('0x44')](_0x3fc2('0xa9'),_['map'](_0xa438b3,'id'));return db['sequelize'][_0x3fc2('0x3a')](_0x2cbd0a[_0x3fc2('0x92')](),_0x25835d)['then'](function(_0x55d411){var _0x3ed34e=_['groupBy'](_0x55d411,'OpenchannelInteractionId');var _0x31ebab=[];_0xa438b3[_0x3fc2('0x34')](function(_0x3c20d1){_0x31ebab[_0x3fc2('0xaa')](updateOpenchannelInteraction(_0x3c20d1,_0x14c34c,_0x3ed34e));});return BPromise[_0x3fc2('0xab')](_0x31ebab);});});})[_0x3fc2('0x2c')](function(_0x51d615){_0x3406d7[_0x3fc2('0xac')]=_0x51d615;return _0x3406d7;})['then'](respondWithFilteredResult(_0x125d3a,_0x78512f))['catch'](handleError(_0x125d3a,null));};exports[_0x3fc2('0xad')]=function(_0x4a5701,_0x1d99d8){var _0x279d0b={};if(_0x4a5701[_0x3fc2('0x3a')][_0x3fc2('0x38')]&&_0x4a5701[_0x3fc2('0x3a')]['type']===_0x3fc2('0x49')){_0x279d0b[_0x3fc2('0x49')]=_0x4a5701[_0x3fc2('0xae')]['id'];}else{_0x279d0b['id']=_0x4a5701[_0x3fc2('0xae')]['id'];}var _0x4fc653={'raw':![],'where':_0x279d0b},_0x388337={};_0x388337['model']=_[_0x3fc2('0x3b')](db[_0x3fc2('0x95')][_0x3fc2('0xaf')]);_0x388337[_0x3fc2('0x3a')]=_[_0x3fc2('0x3b')](_0x4a5701[_0x3fc2('0x3a')]);_0x388337[_0x3fc2('0x3c')]=_[_0x3fc2('0x3d')](_0x388337[_0x3fc2('0x3e')],_0x388337['query']);_0x4fc653[_0x3fc2('0x40')]=_['intersection'](_0x388337['model'],qs[_0x3fc2('0x3f')](_0x4a5701[_0x3fc2('0x3a')]['fields']));_0x4fc653['attributes']=_0x4fc653['attributes'][_0x3fc2('0x41')]?_0x4fc653['attributes']:_0x388337['model'];if(_0x4a5701[_0x3fc2('0x3a')][_0x3fc2('0xb0')]){_0x4fc653['include']=[{'all':!![]}];}_0x4fc653=_[_0x3fc2('0x94')]({},_0x4fc653,_0x4a5701[_0x3fc2('0xb1')]);return db['OpenchannelInteraction']['find'](_0x4fc653)['then'](handleEntityNotFound(_0x1d99d8,null))[_0x3fc2('0x2c')](respondWithResult(_0x1d99d8,null))['catch'](handleError(_0x1d99d8,null));};exports[_0x3fc2('0xb2')]=function(_0x39cdda,_0x7f7b0b){return db[_0x3fc2('0x95')][_0x3fc2('0xb2')](_0x39cdda[_0x3fc2('0x6c')],{})[_0x3fc2('0x2c')](respondWithResult(_0x7f7b0b,0xc9))[_0x3fc2('0x35')](handleError(_0x7f7b0b,null));};exports['update']=function(_0x44f3ee,_0x4ad548){if(_0x44f3ee[_0x3fc2('0x6c')]['id']){delete _0x44f3ee[_0x3fc2('0x6c')]['id'];}return db[_0x3fc2('0x95')][_0x3fc2('0x5c')]({'where':{'id':_0x44f3ee[_0x3fc2('0xae')]['id']}})[_0x3fc2('0x2c')](handleEntityNotFound(_0x4ad548,null))[_0x3fc2('0x2c')](saveUpdates(_0x44f3ee[_0x3fc2('0x6c')],null))[_0x3fc2('0x2c')](respondWithResult(_0x4ad548,null))['catch'](handleError(_0x4ad548,null));};exports[_0x3fc2('0x2d')]=function(_0x5f0c47,_0xfe800c){return db[_0x3fc2('0x95')][_0x3fc2('0x5c')]({'where':{'id':_0x5f0c47[_0x3fc2('0xae')]['id']}})[_0x3fc2('0x2c')](handleEntityNotFound(_0xfe800c,null))[_0x3fc2('0x2c')](removeEntity(_0xfe800c,null))['catch'](handleError(_0xfe800c,null));};exports[_0x3fc2('0xb3')]=function(_0x467481,_0xfa7a93){return db[_0x3fc2('0x95')][_0x3fc2('0xb3')]()[_0x3fc2('0x2c')](respondWithResult(_0xfa7a93,null))[_0x3fc2('0x35')](handleError(_0xfa7a93,null));};exports['addMessage']=function(_0x5be2e4,_0x8c3782,_0x19e0cd){return db['OpenchannelMessage'][_0x3fc2('0x5c')]({'where':{'id':_0x5be2e4[_0x3fc2('0xae')]['id']}})['then'](handleEntityNotFound(_0x8c3782,null))[_0x3fc2('0x2c')](function(_0x210c4d){if(_0x210c4d){return _0x210c4d[_0x3fc2('0xb4')](_0x5be2e4[_0x3fc2('0x6c')][_0x3fc2('0xb5')],_[_0x3fc2('0xb6')](_0x5be2e4[_0x3fc2('0x6c')],['ids','id'])||{});}})[_0x3fc2('0x2c')](respondWithResult(_0x8c3782,null))[_0x3fc2('0x35')](handleError(_0x8c3782,null));};exports[_0x3fc2('0xb7')]=function(_0x4f648c,_0x350b04,_0x443c84){var _0x2575fd={'raw':![],'where':{}};var _0x212a32={};var _0x534b85={'count':0x0,'rows':[]};return db[_0x3fc2('0x95')][_0x3fc2('0xb8')]({'where':{'id':_0x4f648c[_0x3fc2('0xae')]['id']}})[_0x3fc2('0x2c')](handleEntityNotFound(_0x350b04,null))[_0x3fc2('0x2c')](function(_0x226287){if(_0x226287){_0x212a32[_0x3fc2('0x3e')]=_[_0x3fc2('0x3b')](db[_0x3fc2('0xb9')]['rawAttributes']);_0x212a32['query']=_[_0x3fc2('0x3b')](_0x4f648c[_0x3fc2('0x3a')]);_0x212a32[_0x3fc2('0x3c')]=_[_0x3fc2('0x3d')](_0x212a32[_0x3fc2('0x3e')],_0x212a32['query']);_0x2575fd[_0x3fc2('0x40')]=_[_0x3fc2('0x3d')](_0x212a32[_0x3fc2('0x3e')],qs[_0x3fc2('0x3f')](_0x4f648c[_0x3fc2('0x3a')][_0x3fc2('0x3f')]));_0x2575fd['attributes']=_0x2575fd[_0x3fc2('0x40')][_0x3fc2('0x41')]?_0x2575fd[_0x3fc2('0x40')]:_0x212a32[_0x3fc2('0x3e')];if(!_0x4f648c[_0x3fc2('0x3a')][_0x3fc2('0xba')](_0x3fc2('0x42'))){_0x2575fd[_0x3fc2('0x26')]=qs[_0x3fc2('0x26')](_0x4f648c[_0x3fc2('0x3a')][_0x3fc2('0x26')]);_0x2575fd[_0x3fc2('0x25')]=qs[_0x3fc2('0x25')](_0x4f648c[_0x3fc2('0x3a')][_0x3fc2('0x25')]);}_0x2575fd[_0x3fc2('0x86')]=qs[_0x3fc2('0x43')](_0x4f648c['query'][_0x3fc2('0x43')]);_0x2575fd[_0x3fc2('0x44')]=qs['filters'](_[_0x3fc2('0x45')](_0x4f648c[_0x3fc2('0x3a')],_0x212a32[_0x3fc2('0x3c')]));_0x2575fd[_0x3fc2('0x44')]['OpenchannelInteractionId']=_0x226287['id'];if(_0x4f648c['query']['filter']){_0x2575fd[_0x3fc2('0x44')]=_[_0x3fc2('0x94')](_0x2575fd[_0x3fc2('0x44')],{'$or':_[_0x3fc2('0x30')](_0x2575fd[_0x3fc2('0x40')],function(_0x3f1c45){var _0x3bac43={};_0x3bac43[_0x3f1c45]={'$like':'%'+_0x4f648c[_0x3fc2('0x3a')][_0x3fc2('0x7c')]+'%'};return _0x3bac43;})});}if(_0x4f648c[_0x3fc2('0x3a')][_0x3fc2('0x74')]){var _0x50b6db=_0x4f648c[_0x3fc2('0x3a')][_0x3fc2('0x74')][_0x3fc2('0x62')](',');var _0x5e0f5a={};_0x5e0f5a[_0x50b6db[0x0]]={'$gte':moment(_0x50b6db[0x1])[_0x3fc2('0xbb')](_0x3fc2('0xbc'))};_0x2575fd[_0x3fc2('0x44')]=_[_0x3fc2('0x94')](_0x2575fd['where'],_0x5e0f5a);}_0x2575fd=_[_0x3fc2('0x94')]({},_0x2575fd,_0x4f648c['options']);return db[_0x3fc2('0xb9')]['count']({'where':_0x2575fd[_0x3fc2('0x44')]})[_0x3fc2('0x2c')](function(_0x560967){_0x534b85[_0x3fc2('0x24')]=_0x560967;if(_0x4f648c[_0x3fc2('0x3a')][_0x3fc2('0xb0')]){_0x2575fd['include']=[{'all':!![]}];}return db['OpenchannelMessage'][_0x3fc2('0xbd')](_0x2575fd);})['then'](function(_0x2845c6){_0x534b85[_0x3fc2('0xac')]=_0x2845c6;return _0x534b85;});}})[_0x3fc2('0x2c')](respondWithFilteredResult(_0x350b04,_0x2575fd))[_0x3fc2('0x35')](handleError(_0x350b04,null));};exports['addTags']=function(_0x5521d5,_0x29a7cb,_0x4e8e15){return db[_0x3fc2('0x95')][_0x3fc2('0x5c')]({'where':{'id':_0x5521d5[_0x3fc2('0xae')]['id']}})[_0x3fc2('0x2c')](handleEntityNotFound(_0x29a7cb,null))[_0x3fc2('0x2c')](function(_0x14f020){if(_0x14f020){return _0x14f020[_0x3fc2('0xbe')](_0x5521d5[_0x3fc2('0x6c')][_0x3fc2('0xb5')],_[_0x3fc2('0xb6')](_0x5521d5[_0x3fc2('0x6c')],[_0x3fc2('0xb5'),'id'])||{})[_0x3fc2('0xbf')](function(){return db[_0x3fc2('0x68')][_0x3fc2('0xbd')]({'attributes':['id',_0x3fc2('0x2f'),'color'],'where':{'id':_0x5521d5[_0x3fc2('0x6c')][_0x3fc2('0xb5')]}});})[_0x3fc2('0x2c')](function(_0x344a47){socket[_0x3fc2('0xc0')](_0x3fc2('0xc1'),{'id':Number(_0x5521d5[_0x3fc2('0xae')]['id']),'tags':_0x344a47||[]});return{'id':Number(_0x5521d5[_0x3fc2('0xae')]['id']),'tags':_0x344a47||[]};});}})['then'](respondWithResult(_0x29a7cb,null))[_0x3fc2('0x35')](handleError(_0x29a7cb,null));};exports['removeTags']=function(_0x20540f,_0xb2985,_0x4442d5){return db[_0x3fc2('0x95')]['find']({'where':{'id':_0x20540f['params']['id']}})[_0x3fc2('0x2c')](handleEntityNotFound(_0xb2985,null))['then'](function(_0x4d129a){if(_0x4d129a){return _0x4d129a['removeTags'](_0x20540f[_0x3fc2('0x3a')]['ids']);}})[_0x3fc2('0x2c')](respondWithStatusCode(_0xb2985,null))[_0x3fc2('0x35')](handleError(_0xb2985,null));};exports['download']=function(_0x2ab87c,_0x1f7731){var _0x21877c=moment()[_0x3fc2('0xc2')]()[_0x3fc2('0x92')]();var _0x33fb77=path[_0x3fc2('0xc3')](config[_0x3fc2('0xc4')],_0x3fc2('0xc5'),_0x3fc2('0xc6'),_0x3fc2('0xc7'));var _0x5f0817=path[_0x3fc2('0xc3')](config['root'],'server',_0x3fc2('0xc6'),_0x3fc2('0xc8'));var _0x3b17f5=path[_0x3fc2('0xc3')](_0x33fb77,_0x21877c);var _0x33d92e=util[_0x3fc2('0xbb')](_0x3fc2('0xc9'),_0x2ab87c[_0x3fc2('0xae')]['id'],_0x21877c);var _0x36c9d2=path[_0x3fc2('0xc3')](_0x33fb77,_0x33d92e);var _0x544abd=[];_0x544abd[_0x3fc2('0xaa')]({'model':db[_0x3fc2('0x6a')],'as':_0x3fc2('0x6a'),'attributes':['id',_0x3fc2('0x31')],'raw':!![]});_0x544abd['push']({'model':db[_0x3fc2('0xca')],'as':_0x3fc2('0xcb'),'attributes':['id',_0x3fc2('0xcc'),_0x3fc2('0xcd')],'raw':!![]});if(_0x2ab87c[_0x3fc2('0x3a')][_0x3fc2('0xc8')]){_0x544abd[_0x3fc2('0xaa')]({'model':db[_0x3fc2('0xce')],'as':_0x3fc2('0xce'),'raw':!![]});}var _0x52cfef=[{'model':db['OpenchannelMessage'],'as':_0x3fc2('0xcf'),'attributes':['id',_0x3fc2('0x6c'),_0x3fc2('0x72'),_0x3fc2('0xd0'),_0x3fc2('0xd1'),'read'],'include':_0x544abd}];_0x52cfef[_0x3fc2('0xaa')]({'model':db[_0x3fc2('0xd2')],'as':'Account','attributes':['id',_0x3fc2('0x2f')]});_0x52cfef[_0x3fc2('0xaa')]({'model':db[_0x3fc2('0x6a')],'as':_0x3fc2('0xd3'),'attributes':['id',_0x3fc2('0x31')]});return db[_0x3fc2('0x95')][_0x3fc2('0x5c')]({'where':{'id':_0x2ab87c['params']['id']},'include':_0x52cfef})['then'](handleEntityNotFound(_0x1f7731,null))[_0x3fc2('0x2c')](function(_0x4ebee3){if(_0x4ebee3){var _0x25cc65=_0x4ebee3[_0x3fc2('0xd4')]({'plain':!![]});fs[_0x3fc2('0xd5')](_0x3b17f5);var _0x1afe7b={'channel':_0x3fc2('0xd6'),'account':_0x25cc65['Account']['name'],'agent':_0x25cc65[_0x3fc2('0xd3')]?_0x25cc65['Owner'][_0x3fc2('0x31')]:_0x3fc2('0xd7'),'createdAt':moment(_0x25cc65[_0x3fc2('0x72')])[_0x3fc2('0xbb')](_0x3fc2('0xbc'))['toString'](),'closedAt':_0x25cc65[_0x3fc2('0xd8')]?moment(_0x25cc65[_0x3fc2('0xd9')])[_0x3fc2('0xbb')](_0x3fc2('0xbc'))['toString']():'','disposition':_0x25cc65[_0x3fc2('0xda')],'visibility':_0x25cc65[_0x3fc2('0xdb')]?_0x3fc2('0xdc'):'Private','messages':_(_0x25cc65[_0x3fc2('0xcf')])[_0x3fc2('0x7c')]({'secret':![]})[_0x3fc2('0x30')](function(_0x2f1799){if(_0x2f1799['Attachment']){var _0x1adf3a=path['join'](_0x5f0817,_0x2f1799[_0x3fc2('0xce')][_0x3fc2('0xdd')]);if(fs[_0x3fc2('0xde')](_0x1adf3a)){fs[_0x3fc2('0xdf')](_0x1adf3a)[_0x3fc2('0xe0')](fs[_0x3fc2('0xe1')](path[_0x3fc2('0xc3')](_0x3b17f5,_0x2f1799[_0x3fc2('0xce')][_0x3fc2('0xdd')])));}}return{'date':moment(_0x2f1799[_0x3fc2('0x72')])['format'](_0x3fc2('0xbc'))[_0x3fc2('0x92')](),'sender':_0x2f1799[_0x3fc2('0xd0')]===_0x3fc2('0xe2')?_0x2f1799[_0x3fc2('0x6a')]?_0x2f1799[_0x3fc2('0x6a')]['fullname']:_0x3fc2('0xe3'):_0x2f1799[_0x3fc2('0xcb')][_0x3fc2('0xcc')]+(_0x2f1799[_0x3fc2('0xcb')]['lastName']?'\x20'+_0x2f1799[_0x3fc2('0xcb')]['lastName']:''),'body':_0x2f1799[_0x3fc2('0xce')]?_0x2f1799[_0x3fc2('0xce')][_0x3fc2('0xdd')]:_0x2f1799[_0x3fc2('0x6c')],'direction':_0x2f1799[_0x3fc2('0xd0')]===_0x3fc2('0xe2')?'A':'C','secret':_0x2f1799['secret'],'read':_0x2f1799[_0x3fc2('0x78')],'attachment':_0x2f1799[_0x3fc2('0xce')]};})[_0x3fc2('0x61')]()};return ejs[_0x3fc2('0xe4')](path[_0x3fc2('0xc3')](config[_0x3fc2('0xc4')],'server',_0x3fc2('0xe5'),_0x3fc2('0xe6')),{'interaction':_0x1afe7b})[_0x3fc2('0x2c')](function(_0x175330){var _0x42cddd=path[_0x3fc2('0xc3')](_0x3b17f5,_0x3fc2('0xe7')+_0x25cc65['id']+'-'+_0x21877c+_0x3fc2('0xe8'));var _0x13bf31={'path':_0x42cddd,'channel':_0x3fc2('0xd6'),'interactionId':_0x25cc65['id']};return pdf['createPdfFromHTML'](_0x175330,_0x13bf31);})[_0x3fc2('0x2c')](function(){return new BPromise(function(_0x3bb262,_0xf9f86d){zipdir(_0x3b17f5,{'saveTo':_0x36c9d2},function(_0x462613,_0x567621){if(_0x462613)return _0xf9f86d(_0x462613);return _0x3bb262(_0x567621);});})[_0x3fc2('0x2c')](function(){return new BPromise(function(_0x3b1589,_0x2f0330){rimraf(_0x3b17f5,function(_0x30156e){if(_0x30156e)_0x2f0330(_0x30156e);return _0x3b1589();});});})[_0x3fc2('0x2c')](function(){return _0x1f7731[_0x3fc2('0xe9')](_0x36c9d2,_0x33d92e,function(_0x97eae3){if(_0x97eae3){console[_0x3fc2('0xea')](_0x3fc2('0xeb'),_0x97eae3);}else{fs[_0x3fc2('0xec')](_0x36c9d2);}});});});}else{return _0x1f7731[_0x3fc2('0x20')](0xc8);}})[_0x3fc2('0x35')](handleError(_0x1f7731,null));}; \ No newline at end of file +var _0x2a22=['addTags','ids','omit','spread','openchannelInteractionTags:save','removeTags','download','unix','join','root','server','files','attachments','transcript-%d-%s.zip','fullname','CmContact','firstName','lastName','Attachment','Messages','direction','secret','OpenchannelAccount','Account','Owner','Openchannel','closed','closedAt','disposition','threadId','Private','basename','createReadStream','out','System','renderFile','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','log','err','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','sendStatus','status','end','json','limit','undefined','offset','count','apply','save','update','then','error','stack','name','Users','map','TagIds','split','forEach','push','catch','index','OpenchannelInteraction','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','nolimit','sort','where','pick','select','field','color','from','u.id','ui.OpenchannelInteractionId','user_has_openchannel_interactions','left_join','users','u.id\x20=\x20ui.UserId','openchannel_interactions','cm_contacts','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','length','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)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','find','UserId','body','some','isEmpty','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','filter','replace','isNumeric','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','Sequelize','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','t.id\x20IN\x20?','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','keyBy','merge','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','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','toString','OpenchannelInteractionId','all','rows','params','include','options','create','describe','addMessage','OpenchannelMessage','findOne','hasOwnProperty','format','YYYY-MM-DD\x20HH:mm:ss','findAll'];(function(_0x57e944,_0x54b50c){var _0x23d9f0=function(_0x532c9b){while(--_0x532c9b){_0x57e944['push'](_0x57e944['shift']());}};_0x23d9f0(++_0x54b50c);}(_0x2a22,0x1ec));var _0x22a2=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x2a22[_0xdea41a];return _0x15d0d8;};'use strict';var emlformat=require(_0x22a2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x22a2('0x1'));var jsonpatch=require(_0x22a2('0x2'));var rp=require(_0x22a2('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x22a2('0x4'));var util=require(_0x22a2('0x5'));var path=require(_0x22a2('0x6'));var sox=require(_0x22a2('0x7'));var csv=require(_0x22a2('0x8'));var ejs=require(_0x22a2('0x9'));var fs=require('fs');var fs_extra=require(_0x22a2('0xa'));var _=require(_0x22a2('0xb'));var squel=require('squel');var crypto=require(_0x22a2('0xc'));var jsforce=require(_0x22a2('0xd'));var deskjs=require(_0x22a2('0xe'));var toCsv=require('to-csv');var querystring=require(_0x22a2('0xf'));var Papa=require(_0x22a2('0x10'));var Redis=require(_0x22a2('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x22a2('0x12'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0x22a2('0x13'));var logger=require(_0x22a2('0x14'))(_0x22a2('0x15'));var utils=require(_0x22a2('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x22a2('0x17'));var db=require('../../mysqldb')['db'];config[_0x22a2('0x18')]=_['defaults'](config['redis'],{'host':_0x22a2('0x19'),'port':0x18eb});var socket=require(_0x22a2('0x1a'))(new Redis(config[_0x22a2('0x18')]));require(_0x22a2('0x1b'))['register'](socket);function respondWithStatusCode(_0x17c547,_0x2765e5){_0x2765e5=_0x2765e5||0xcc;return function(_0x5adfc3){if(_0x5adfc3){return _0x17c547[_0x22a2('0x1c')](_0x2765e5);}return _0x17c547[_0x22a2('0x1d')](_0x2765e5)[_0x22a2('0x1e')]();};}function respondWithResult(_0x3303ea,_0x588f6a){_0x588f6a=_0x588f6a||0xc8;return function(_0x20c84a){if(_0x20c84a){return _0x3303ea[_0x22a2('0x1d')](_0x588f6a)[_0x22a2('0x1f')](_0x20c84a);}};}function respondWithFilteredResult(_0x52f8b5,_0x4f5b94){return function(_0x289511){if(_0x289511){var _0x2fc62d=typeof _0x4f5b94['offset']==='undefined'&&typeof _0x4f5b94[_0x22a2('0x20')]===_0x22a2('0x21');var _0x2e3eaa=_0x289511['count'];var _0x2585f1=_0x2fc62d?0x0:_0x4f5b94[_0x22a2('0x22')];var _0x372aac=_0x2fc62d?_0x289511[_0x22a2('0x23')]:_0x4f5b94[_0x22a2('0x22')]+_0x4f5b94['limit'];var _0x26b41;if(_0x372aac>=_0x2e3eaa){_0x372aac=_0x2e3eaa;_0x26b41=0xc8;}else{_0x26b41=0xce;}_0x52f8b5[_0x22a2('0x1d')](_0x26b41);return _0x52f8b5['set']('Content-Range',_0x2585f1+'-'+_0x372aac+'/'+_0x2e3eaa)['json'](_0x289511);}return null;};}function patchUpdates(_0xb2093a){return function(_0x1d7522){try{jsonpatch[_0x22a2('0x24')](_0x1d7522,_0xb2093a,!![]);}catch(_0x48db65){return BPromise['reject'](_0x48db65);}return _0x1d7522[_0x22a2('0x25')]();};}function saveUpdates(_0x27d876,_0x73d501){return function(_0x1c2043){if(_0x1c2043){return _0x1c2043[_0x22a2('0x26')](_0x27d876)[_0x22a2('0x27')](function(_0x211fac){return _0x211fac;});}return null;};}function removeEntity(_0x3437a6,_0x1e4f99){return function(_0x3423a7){if(_0x3423a7){return _0x3423a7['destroy']()[_0x22a2('0x27')](function(){_0x3437a6[_0x22a2('0x1d')](0xcc)[_0x22a2('0x1e')]();});}};}function handleEntityNotFound(_0x5ea972,_0x28b0e6){return function(_0x5bd16c){if(!_0x5bd16c){_0x5ea972[_0x22a2('0x1c')](0x194);}return _0x5bd16c;};}function handleError(_0x197f7a,_0x8fa86f){_0x8fa86f=_0x8fa86f||0x1f4;return function(_0x20fa7e){logger[_0x22a2('0x28')](_0x20fa7e[_0x22a2('0x29')]);if(_0x20fa7e['name']){delete _0x20fa7e[_0x22a2('0x2a')];}_0x197f7a[_0x22a2('0x1d')](_0x8fa86f)['send'](_0x20fa7e);};}function getInteractionUsers(_0x2a65c7,_0x140fd5){return new BPromise(function(_0x4a8302,_0x45163e){try{if(_0x140fd5[_0x2a65c7['id']]){_0x2a65c7[_0x22a2('0x2b')]=_[_0x22a2('0x2c')](_0x140fd5[_0x2a65c7['id']],function(_0x4bd2b1){return{'id':_0x4bd2b1['id'],'fullname':_0x4bd2b1['fullname']};});}}catch(_0xb0808e){_0x45163e(_0xb0808e);}_0x4a8302(_0x2a65c7);});}function getInteractionTags(_0x506f4a,_0x3a2957){return new BPromise(function(_0x14f351,_0x4af1b7){try{if(_0x506f4a[_0x22a2('0x2d')]){_0x506f4a['Tags']=[];_0x506f4a['TagIds'][_0x22a2('0x2e')](',')[_0x22a2('0x2f')](function(_0x3572f3){_0x506f4a['Tags'][_0x22a2('0x30')](_0x3a2957[_0x3572f3]);});}delete _0x506f4a[_0x22a2('0x2d')];}catch(_0x27403f){_0x4af1b7(_0x27403f);}_0x14f351(_0x506f4a);});}function updateOpenchannelInteraction(_0x14d8cc,_0x5398c5,_0x4dc155){return new BPromise(function(_0x891e5,_0x42ad8f){return getInteractionUsers(_0x14d8cc,_0x4dc155)[_0x22a2('0x27')](function(_0x25932f){return getInteractionTags(_0x25932f,_0x5398c5);})[_0x22a2('0x27')](function(_0x234dc4){_0x891e5(_0x234dc4);})[_0x22a2('0x31')](function(_0x5b4e01){_0x42ad8f(_0x5b4e01);});});}exports[_0x22a2('0x32')]=function(_0x58c2db,_0xe0ed5f){var _0x5022c6={},_0x3c7264={},_0x2299c3={'count':0x0,'rows':[]};var _0x5d5384=_['map'](db[_0x22a2('0x33')][_0x22a2('0x34')],function(_0x406a93){return{'name':_0x406a93[_0x22a2('0x35')],'type':_0x406a93[_0x22a2('0x36')][_0x22a2('0x37')]};});_0x3c7264[_0x22a2('0x38')]=_[_0x22a2('0x2c')](_0x5d5384,'name');_0x3c7264[_0x22a2('0x39')]=_[_0x22a2('0x3a')](_0x58c2db[_0x22a2('0x39')]);_0x3c7264[_0x22a2('0x3b')]=_[_0x22a2('0x3c')](_0x3c7264[_0x22a2('0x38')],_0x3c7264[_0x22a2('0x39')]);_0x5022c6['attributes']=_[_0x22a2('0x3c')](_0x3c7264[_0x22a2('0x38')],qs['fields'](_0x58c2db['query'][_0x22a2('0x3d')]));_0x5022c6[_0x22a2('0x3e')]=_0x5022c6['attributes']['length']?_0x5022c6[_0x22a2('0x3e')]:_0x3c7264[_0x22a2('0x38')];if(!_0x58c2db['query']['hasOwnProperty'](_0x22a2('0x3f'))){_0x5022c6[_0x22a2('0x20')]=qs[_0x22a2('0x20')](_0x58c2db[_0x22a2('0x39')][_0x22a2('0x20')]);_0x5022c6[_0x22a2('0x22')]=qs['offset'](_0x58c2db['query'][_0x22a2('0x22')]);}_0x5022c6['order']=qs[_0x22a2('0x40')](_0x58c2db[_0x22a2('0x39')][_0x22a2('0x40')]);_0x5022c6[_0x22a2('0x41')]=qs[_0x22a2('0x3b')](_[_0x22a2('0x42')](_0x58c2db[_0x22a2('0x39')],_0x3c7264[_0x22a2('0x3b')]),_0x5d5384);var _0x4ee01c=[];var _0x2cd816=squel[_0x22a2('0x43')]()[_0x22a2('0x44')]('id')[_0x22a2('0x44')](_0x22a2('0x2a'))['field'](_0x22a2('0x45'))[_0x22a2('0x46')]('tools_tags');var _0x29780b=squel[_0x22a2('0x43')]()[_0x22a2('0x44')](_0x22a2('0x47'))[_0x22a2('0x44')]('u.fullname')[_0x22a2('0x44')](_0x22a2('0x48'))[_0x22a2('0x46')](_0x22a2('0x49'),'ui')[_0x22a2('0x4a')](_0x22a2('0x4b'),'u',_0x22a2('0x4c'));var _0x4d121e=squel['select']()[_0x22a2('0x46')](_0x22a2('0x4d'),'i')[_0x22a2('0x4a')](_0x22a2('0x4e'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0x22a2('0x4b'),'o',_0x22a2('0x4f'))['left_join'](_0x22a2('0x50'),'a',_0x22a2('0x51'))[_0x22a2('0x4a')](_0x22a2('0x52'),'me',_0x22a2('0x53'))[_0x22a2('0x4a')](_0x22a2('0x54'),'it',_0x22a2('0x55'))['left_join']('tools_tags','t',_0x22a2('0x56'));var _0x41289c=squel[_0x22a2('0x57')]();var _0x80cec4=[];var _0x162c81=squel[_0x22a2('0x57')]();var _0xc2d973;if(_0x58c2db[_0x22a2('0x39')][_0x22a2('0x58')]){_0xc2d973=as[_0x22a2('0x59')](_0x58c2db[_0x22a2('0x39')]['search']);var _0x3c86cd=_0xc2d973[_0x22a2('0x5a')];for(var _0x351527=0x0;_0x351527<_0xc2d973['conditions'][_0x22a2('0x5b')];_0x351527++){var _0x40d04f=_0xc2d973[_0x22a2('0x5c')][_0x351527];var _0x1ad0ef='i';var _0x4a35c8=_['find'](_0x5d5384,[_0x22a2('0x2a'),_0x40d04f[_0x22a2('0x44')]]);if(!_0x4a35c8){switch(_0x40d04f['field']){case _0x22a2('0x5d'):if(_0x40d04f[_0x22a2('0x5e')]==0x1){_0x4d121e[_0x22a2('0x5f')]('`'+_0x40d04f['field']+_0x22a2('0x60'));}else{_0x4d121e[_0x22a2('0x5f')]('`'+_0x40d04f[_0x22a2('0x44')]+_0x22a2('0x61'));}break;case _0x22a2('0x62'):if(_0x40d04f[_0x22a2('0x63')]===_0x22a2('0x64')){if(_0x40d04f[_0x22a2('0x5e')]['split']('\x20')[_0x22a2('0x5b')]>0x1){_0x41289c[_0x3c86cd](_0x22a2('0x65'),qs['getFullTextValue'](_0x40d04f[_0x22a2('0x5e')]),null);}else{var _0x1a4aef='%'+_0x40d04f['value']+'%';_0x41289c[_0x3c86cd](_0x22a2('0x66'),_0x1a4aef,_0x1a4aef,_0x1a4aef);}}else{_0x4a35c8=_['find'](_0x5d5384,[_0x22a2('0x2a'),'ContactId']);_0x40d04f[_0x22a2('0x44')]=_0x22a2('0x67');_0x582a61=as[_0x22a2('0x68')](_0x1ad0ef,_0x4a35c8[_0x22a2('0x36')],_0x40d04f);_0x41289c[_0x3c86cd](_0x582a61[_0x22a2('0x69')],_0x582a61['value'][_0x22a2('0x6a')],_0x582a61[_0x22a2('0x5e')][_0x22a2('0x1e')]);}break;case'Tag':var _0x1ff162=_0x40d04f['value'][_0x22a2('0x2e')](',')[_0x22a2('0x2c')](function(_0x4502e6){return Number(_0x4502e6);});_0x1ff162[_0x22a2('0x2f')](function(_0x263ea0){_0x162c81['or'](_0x22a2('0x6b'),'%,'+_0x263ea0+',%');});_0x80cec4=_['union'](_0x80cec4,_0x1ff162);break;case _0x22a2('0x6c'):if(_0x40d04f[_0x22a2('0x63')]===_0x22a2('0x64')){_0x41289c[_0x3c86cd](_0x22a2('0x6d'),'%'+_0x40d04f[_0x22a2('0x5e')]+'%',null);}else{_0x4a35c8=_[_0x22a2('0x6e')](_0x5d5384,[_0x22a2('0x2a'),_0x22a2('0x6f')]);_0x40d04f[_0x22a2('0x44')]=_0x22a2('0x6f');_0x582a61=as[_0x22a2('0x68')](_0x1ad0ef,_0x4a35c8[_0x22a2('0x36')],_0x40d04f);_0x41289c[_0x3c86cd](_0x582a61['text'],_0x582a61['value'][_0x22a2('0x6a')],_0x582a61['value'][_0x22a2('0x1e')]);}break;case _0x22a2('0x70'):_0x582a61=as['buildExpression']('me',null,_0x40d04f);_0x41289c[_0x3c86cd](_0x582a61['text'],_0x582a61[_0x22a2('0x5e')][_0x22a2('0x6a')],_0x582a61['value'][_0x22a2('0x1e')]);break;}}else{var _0x582a61=as[_0x22a2('0x68')](_0x1ad0ef,_0x4a35c8[_0x22a2('0x36')],_0x40d04f);_0x41289c[_0x3c86cd](_0x582a61['text'],_0x582a61[_0x22a2('0x5e')]['start'],_0x582a61[_0x22a2('0x5e')][_0x22a2('0x1e')]);}}}else{var _0x19604a=_(_0x58c2db[_0x22a2('0x39')])[_0x22a2('0x3a')]()[_0x22a2('0x2c')](function(_0xd8bfcc){return _[_0x22a2('0x71')](_0x5d5384,[_0x22a2('0x2a'),_0xd8bfcc])?_0xd8bfcc:undefined;})['compact']()[_0x22a2('0x5e')]();if(!_[_0x22a2('0x72')](_0x19604a)){_0x19604a['forEach'](function(_0xab3b93){if(_0xab3b93===_0x22a2('0x73')){_0x4d121e['where'](_0x22a2('0x74'),[][_0x22a2('0x75')](_0x58c2db[_0x22a2('0x39')][_0xab3b93]));}else if(_0xab3b93===_0x22a2('0x76')){var _0x5ca950=JSON[_0x22a2('0x77')](_0x58c2db[_0x22a2('0x39')][_0xab3b93])[_0x22a2('0x78')];var _0x10f5a9=JSON[_0x22a2('0x77')](_0x58c2db[_0x22a2('0x39')][_0xab3b93])['$lte'];_0x4d121e[_0x22a2('0x41')](_0x22a2('0x79'),_0x5ca950,_0x10f5a9);}else{if(_0x58c2db[_0x22a2('0x39')][_0xab3b93]===_0x22a2('0x7a')){_0x4d121e[_0x22a2('0x41')]('i.'+_0xab3b93+_0x22a2('0x7b'));}else{_0x4d121e[_0x22a2('0x41')]('i.'+_0xab3b93+_0x22a2('0x7c'),_0x58c2db['query'][_0xab3b93]);}}});}if(_0x58c2db[_0x22a2('0x39')][_0x22a2('0x7d')]){if(_0x58c2db[_0x22a2('0x39')][_0x22a2('0x7d')]==0x1){_0x4d121e['having'](_0x22a2('0x7e'));}else{_0x4d121e['having']('`unreadMessages`\x20>\x200');}}if(_0x58c2db[_0x22a2('0x39')][_0x22a2('0x7f')]){_0x80cec4=_[_0x22a2('0x80')](_0x58c2db[_0x22a2('0x39')][_0x22a2('0x7f')])?_0x58c2db[_0x22a2('0x39')][_0x22a2('0x7f')]:new Array(_0x58c2db[_0x22a2('0x39')][_0x22a2('0x7f')]);_0x80cec4[_0x22a2('0x2f')](function(_0x105372){_0x162c81['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x105372+',%');});}if(_0x58c2db['query']['filter']){var _0x5f28c3=_0x58c2db[_0x22a2('0x39')][_0x22a2('0x81')]['replace']('\x5c','\x5c\x5c')[_0x22a2('0x82')](/'/g,'\x27\x27');if(qs[_0x22a2('0x83')](_0x5f28c3)){_0x41289c['or']('i.id\x20LIKE\x20?',_0x5f28c3+'%');}else{_0x41289c['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x5f28c3))['or']('i.from\x20LIKE\x20?',_0x5f28c3+'%')['or'](_0x22a2('0x84'),_0x5f28c3+'%');}}}_0x4d121e[_0x22a2('0x41')](_0x41289c);_0x4d121e['group']('i.id');var _0x18e73b={'type':db[_0x22a2('0x85')]['QueryTypes']['SELECT'],'raw':!![]};var _0x58480b=_0x4d121e[_0x22a2('0x86')]();_0x58480b[_0x22a2('0x44')](_0x22a2('0x87'));_0x58480b[_0x22a2('0x44')](_0x22a2('0x88'),_0x22a2('0x5d'));if(_0x5022c6['order']){_0x5022c6[_0x22a2('0x89')][_0x22a2('0x2f')](function(_0x4a2ca2){var _0x263182=_0x4a2ca2[0x0]===_0x22a2('0x8a')?_0x4a2ca2[0x0]:'i.'+_0x4a2ca2[0x0];_0x4d121e[_0x22a2('0x89')](_0x263182,_0x4a2ca2[0x1]==='DESC'?![]:!![]);});}if(!_[_0x22a2('0x72')](_0x80cec4)){_0x4d121e[_0x22a2('0x5f')](_0x162c81);_0x58480b[_0x22a2('0x41')](_0x22a2('0x8b'),_0x80cec4);}BPromise[_0x22a2('0x8c')]()[_0x22a2('0x27')](function(){if(!_0xc2d973){if(_0x58c2db[_0x22a2('0x39')][_0x22a2('0x73')])return;_0x58480b[_0x22a2('0x41')](_0x22a2('0x8d'));_0x4d121e[_0x22a2('0x41')](_0x22a2('0x8d'));return;}if(_0x58c2db[_0x22a2('0x8e')][_0x22a2('0x8f')]!==_0x22a2('0x90'))return;return _0x58c2db['user'][_0x22a2('0x91')]({'attributes':['id'],'raw':!![]})[_0x22a2('0x27')](function(_0x363098){if(_[_0x22a2('0x72')](_0x363098)){_0x58480b[_0x22a2('0x41')](_0x22a2('0x92'));_0x4d121e['where'](_0x22a2('0x92'));}else{_0x58480b[_0x22a2('0x41')](_0x22a2('0x74'),_['map'](_0x363098,'id'));_0x4d121e[_0x22a2('0x41')](_0x22a2('0x74'),_[_0x22a2('0x2c')](_0x363098,'id'));}});})[_0x22a2('0x27')](function(){if(_0x58c2db[_0x22a2('0x8e')][_0x22a2('0x8f')]===_0x22a2('0x90')&&!_0xc2d973&&!_0x58c2db[_0x22a2('0x39')][_0x22a2('0x73')])return[];return db[_0x22a2('0x93')]['query'](_0x58480b['toString'](),_0x18e73b);})['then'](function(_0xc2c963){_0x2299c3[_0x22a2('0x23')]=_0xc2c963['length'];if(_0x2299c3['count']===0x0)return[];return db[_0x22a2('0x93')][_0x22a2('0x39')](_0x2cd816['toString'](),_0x18e73b)[_0x22a2('0x27')](function(_0x358466){_0x4ee01c=_[_0x22a2('0x94')](_0x358466,'id');_0x18e73b=_[_0x22a2('0x95')](_0x18e73b,{'model':db[_0x22a2('0x33')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x58c2db[_0x22a2('0x39')][_0x22a2('0x3d')]){_0x5022c6[_0x22a2('0x3e')][_0x22a2('0x2f')](function(_0x3d5b0a){_0x4d121e[_0x22a2('0x44')]('i.'+_0x3d5b0a);});}else{_0x4d121e[_0x22a2('0x44')](_0x22a2('0x88'),_0x22a2('0x5d'));_0x4d121e[_0x22a2('0x44')]('a.key','Account.key');_0x4d121e['field'](_0x22a2('0x96'),_0x22a2('0x97'));_0x4d121e['field'](_0x22a2('0x98'),_0x22a2('0x8a'));_0x4d121e[_0x22a2('0x44')](_0x22a2('0x99'));_0x4d121e[_0x22a2('0x44')](_0x22a2('0x9a'),'Contact.firstName');_0x4d121e['field'](_0x22a2('0x9b'),_0x22a2('0x9c'));_0x4d121e[_0x22a2('0x44')]('c.email',_0x22a2('0x9d'));_0x4d121e[_0x22a2('0x44')](_0x22a2('0x9e'),_0x22a2('0x9f'));_0x4d121e['field']('c.mobile',_0x22a2('0xa0'));_0x4d121e[_0x22a2('0x44')](_0x22a2('0xa1'),'Contact.fax');_0x4d121e['field'](_0x22a2('0xa2'),_0x22a2('0xa3'));_0x4d121e[_0x22a2('0x44')](_0x22a2('0xa4'),_0x22a2('0xa5'));_0x4d121e[_0x22a2('0x44')](_0x22a2('0xa6'),_0x22a2('0x2d'));}if(_0x5022c6[_0x22a2('0x20')])_0x4d121e['limit'](_0x5022c6[_0x22a2('0x20')]);if(_0x5022c6[_0x22a2('0x22')])_0x4d121e[_0x22a2('0x22')](_0x5022c6['offset']);return db[_0x22a2('0x93')]['query'](_0x4d121e[_0x22a2('0xa7')](),_0x18e73b);})[_0x22a2('0x27')](function(_0x262c4f){if(_0x262c4f[_0x22a2('0x5b')]>0x0)_0x29780b[_0x22a2('0x41')]('ui.OpenchannelInteractionId\x20IN\x20?',_[_0x22a2('0x2c')](_0x262c4f,'id'));return db['sequelize'][_0x22a2('0x39')](_0x29780b[_0x22a2('0xa7')](),_0x18e73b)[_0x22a2('0x27')](function(_0x3a7243){var _0x4cbdb1=_['groupBy'](_0x3a7243,_0x22a2('0xa8'));var _0x3a5fe6=[];_0x262c4f[_0x22a2('0x2f')](function(_0x72abbf){_0x3a5fe6[_0x22a2('0x30')](updateOpenchannelInteraction(_0x72abbf,_0x4ee01c,_0x4cbdb1));});return BPromise[_0x22a2('0xa9')](_0x3a5fe6);});});})[_0x22a2('0x27')](function(_0x23d116){_0x2299c3[_0x22a2('0xaa')]=_0x23d116;return _0x2299c3;})[_0x22a2('0x27')](respondWithFilteredResult(_0xe0ed5f,_0x5022c6))['catch'](handleError(_0xe0ed5f,null));};exports['show']=function(_0x39e55c,_0x178190){var _0x3e9829={};if(_0x39e55c[_0x22a2('0x39')][_0x22a2('0x36')]&&_0x39e55c[_0x22a2('0x39')][_0x22a2('0x36')]==='from'){_0x3e9829[_0x22a2('0x46')]=_0x39e55c[_0x22a2('0xab')]['id'];}else{_0x3e9829['id']=_0x39e55c[_0x22a2('0xab')]['id'];}var _0x4d2fca={'raw':![],'where':_0x3e9829},_0x246c57={};_0x246c57['model']=_[_0x22a2('0x3a')](db[_0x22a2('0x33')][_0x22a2('0x34')]);_0x246c57['query']=_[_0x22a2('0x3a')](_0x39e55c[_0x22a2('0x39')]);_0x246c57[_0x22a2('0x3b')]=_['intersection'](_0x246c57[_0x22a2('0x38')],_0x246c57[_0x22a2('0x39')]);_0x4d2fca[_0x22a2('0x3e')]=_[_0x22a2('0x3c')](_0x246c57[_0x22a2('0x38')],qs[_0x22a2('0x3d')](_0x39e55c['query'][_0x22a2('0x3d')]));_0x4d2fca[_0x22a2('0x3e')]=_0x4d2fca[_0x22a2('0x3e')]['length']?_0x4d2fca[_0x22a2('0x3e')]:_0x246c57[_0x22a2('0x38')];if(_0x39e55c[_0x22a2('0x39')]['includeAll']){_0x4d2fca[_0x22a2('0xac')]=[{'all':!![]}];}_0x4d2fca=_['merge']({},_0x4d2fca,_0x39e55c[_0x22a2('0xad')]);return db[_0x22a2('0x33')][_0x22a2('0x6e')](_0x4d2fca)[_0x22a2('0x27')](handleEntityNotFound(_0x178190,null))[_0x22a2('0x27')](respondWithResult(_0x178190,null))['catch'](handleError(_0x178190,null));};exports['create']=function(_0x30bbf3,_0x3ca554){return db[_0x22a2('0x33')][_0x22a2('0xae')](_0x30bbf3['body'],{})[_0x22a2('0x27')](respondWithResult(_0x3ca554,0xc9))[_0x22a2('0x31')](handleError(_0x3ca554,null));};exports[_0x22a2('0x26')]=function(_0x4b63f6,_0x2ea6a2){if(_0x4b63f6['body']['id']){delete _0x4b63f6[_0x22a2('0x70')]['id'];}return db['OpenchannelInteraction'][_0x22a2('0x6e')]({'where':{'id':_0x4b63f6[_0x22a2('0xab')]['id']}})[_0x22a2('0x27')](handleEntityNotFound(_0x2ea6a2,null))[_0x22a2('0x27')](saveUpdates(_0x4b63f6[_0x22a2('0x70')],null))[_0x22a2('0x27')](respondWithResult(_0x2ea6a2,null))[_0x22a2('0x31')](handleError(_0x2ea6a2,null));};exports['destroy']=function(_0x3d5783,_0x51052f){return db[_0x22a2('0x33')][_0x22a2('0x6e')]({'where':{'id':_0x3d5783[_0x22a2('0xab')]['id']}})[_0x22a2('0x27')](handleEntityNotFound(_0x51052f,null))[_0x22a2('0x27')](removeEntity(_0x51052f,null))['catch'](handleError(_0x51052f,null));};exports[_0x22a2('0xaf')]=function(_0x3cb479,_0x136ddc){return db[_0x22a2('0x33')]['describe']()[_0x22a2('0x27')](respondWithResult(_0x136ddc,null))[_0x22a2('0x31')](handleError(_0x136ddc,null));};exports[_0x22a2('0xb0')]=function(_0x478eae,_0x2671a2,_0x29a598){return db[_0x22a2('0xb1')][_0x22a2('0x6e')]({'where':{'id':_0x478eae['params']['id']}})[_0x22a2('0x27')](handleEntityNotFound(_0x2671a2,null))[_0x22a2('0x27')](function(_0x5df59c){if(_0x5df59c){return _0x5df59c['addMessage'](_0x478eae[_0x22a2('0x70')]['ids'],_['omit'](_0x478eae[_0x22a2('0x70')],['ids','id'])||{});}})['then'](respondWithResult(_0x2671a2,null))[_0x22a2('0x31')](handleError(_0x2671a2,null));};exports['getMessages']=function(_0x4f84b2,_0xfe6f2c,_0x4ac11f){var _0xdb9fb8={'raw':![],'where':{}};var _0x3a8150={};var _0x1c6aa7={'count':0x0,'rows':[]};return db['OpenchannelInteraction'][_0x22a2('0xb2')]({'where':{'id':_0x4f84b2[_0x22a2('0xab')]['id']}})['then'](handleEntityNotFound(_0xfe6f2c,null))[_0x22a2('0x27')](function(_0xa76a8d){if(_0xa76a8d){_0x3a8150[_0x22a2('0x38')]=_[_0x22a2('0x3a')](db[_0x22a2('0xb1')][_0x22a2('0x34')]);_0x3a8150['query']=_['keys'](_0x4f84b2[_0x22a2('0x39')]);_0x3a8150[_0x22a2('0x3b')]=_[_0x22a2('0x3c')](_0x3a8150['model'],_0x3a8150[_0x22a2('0x39')]);_0xdb9fb8[_0x22a2('0x3e')]=_[_0x22a2('0x3c')](_0x3a8150[_0x22a2('0x38')],qs[_0x22a2('0x3d')](_0x4f84b2[_0x22a2('0x39')][_0x22a2('0x3d')]));_0xdb9fb8['attributes']=_0xdb9fb8[_0x22a2('0x3e')][_0x22a2('0x5b')]?_0xdb9fb8[_0x22a2('0x3e')]:_0x3a8150[_0x22a2('0x38')];if(!_0x4f84b2['query'][_0x22a2('0xb3')]('nolimit')){_0xdb9fb8[_0x22a2('0x20')]=qs[_0x22a2('0x20')](_0x4f84b2['query'][_0x22a2('0x20')]);_0xdb9fb8[_0x22a2('0x22')]=qs[_0x22a2('0x22')](_0x4f84b2[_0x22a2('0x39')]['offset']);}_0xdb9fb8[_0x22a2('0x89')]=qs[_0x22a2('0x40')](_0x4f84b2[_0x22a2('0x39')][_0x22a2('0x40')]);_0xdb9fb8[_0x22a2('0x41')]=qs[_0x22a2('0x3b')](_[_0x22a2('0x42')](_0x4f84b2[_0x22a2('0x39')],_0x3a8150['filters']));_0xdb9fb8[_0x22a2('0x41')][_0x22a2('0xa8')]=_0xa76a8d['id'];if(_0x4f84b2[_0x22a2('0x39')][_0x22a2('0x81')]){_0xdb9fb8[_0x22a2('0x41')]=_[_0x22a2('0x95')](_0xdb9fb8[_0x22a2('0x41')],{'$or':_[_0x22a2('0x2c')](_0xdb9fb8[_0x22a2('0x3e')],function(_0x33e118){var _0x5f3a32={};_0x5f3a32[_0x33e118]={'$like':'%'+_0x4f84b2[_0x22a2('0x39')][_0x22a2('0x81')]+'%'};return _0x5f3a32;})});}if(_0x4f84b2['query'][_0x22a2('0x78')]){var _0xdc52f3=_0x4f84b2['query'][_0x22a2('0x78')]['split'](',');var _0x486a17={};_0x486a17[_0xdc52f3[0x0]]={'$gte':moment(_0xdc52f3[0x1])[_0x22a2('0xb4')](_0x22a2('0xb5'))};_0xdb9fb8[_0x22a2('0x41')]=_[_0x22a2('0x95')](_0xdb9fb8[_0x22a2('0x41')],_0x486a17);}_0xdb9fb8=_['merge']({},_0xdb9fb8,_0x4f84b2[_0x22a2('0xad')]);return db[_0x22a2('0xb1')][_0x22a2('0x23')]({'where':_0xdb9fb8[_0x22a2('0x41')]})[_0x22a2('0x27')](function(_0x2f9e64){_0x1c6aa7[_0x22a2('0x23')]=_0x2f9e64;if(_0x4f84b2[_0x22a2('0x39')]['includeAll']){_0xdb9fb8[_0x22a2('0xac')]=[{'all':!![]}];}return db[_0x22a2('0xb1')][_0x22a2('0xb6')](_0xdb9fb8);})[_0x22a2('0x27')](function(_0x56dbc4){_0x1c6aa7[_0x22a2('0xaa')]=_0x56dbc4;return _0x1c6aa7;});}})[_0x22a2('0x27')](respondWithFilteredResult(_0xfe6f2c,_0xdb9fb8))[_0x22a2('0x31')](handleError(_0xfe6f2c,null));};exports[_0x22a2('0xb7')]=function(_0x55fcbf,_0x4f854c,_0x33f438){return db[_0x22a2('0x33')][_0x22a2('0x6e')]({'where':{'id':_0x55fcbf[_0x22a2('0xab')]['id']}})[_0x22a2('0x27')](handleEntityNotFound(_0x4f854c,null))[_0x22a2('0x27')](function(_0x35258d){if(_0x35258d){return _0x35258d['setTags'](_0x55fcbf[_0x22a2('0x70')][_0x22a2('0xb8')],_[_0x22a2('0xb9')](_0x55fcbf[_0x22a2('0x70')],[_0x22a2('0xb8'),'id'])||{})[_0x22a2('0xba')](function(){return db['Tag'][_0x22a2('0xb6')]({'attributes':['id',_0x22a2('0x2a'),_0x22a2('0x45')],'where':{'id':_0x55fcbf[_0x22a2('0x70')][_0x22a2('0xb8')]}});})['then'](function(_0x31de8e){socket['emit'](_0x22a2('0xbb'),{'id':Number(_0x55fcbf['params']['id']),'tags':_0x31de8e||[]});return{'id':Number(_0x55fcbf['params']['id']),'tags':_0x31de8e||[]};});}})['then'](respondWithResult(_0x4f854c,null))[_0x22a2('0x31')](handleError(_0x4f854c,null));};exports[_0x22a2('0xbc')]=function(_0x243b8c,_0x2d11e2,_0x3e817f){return db['OpenchannelInteraction'][_0x22a2('0x6e')]({'where':{'id':_0x243b8c[_0x22a2('0xab')]['id']}})[_0x22a2('0x27')](handleEntityNotFound(_0x2d11e2,null))[_0x22a2('0x27')](function(_0x193082){if(_0x193082){return _0x193082[_0x22a2('0xbc')](_0x243b8c[_0x22a2('0x39')]['ids']);}})[_0x22a2('0x27')](respondWithStatusCode(_0x2d11e2,null))['catch'](handleError(_0x2d11e2,null));};exports[_0x22a2('0xbd')]=function(_0x125dbc,_0x269f64){var _0x58c63a=moment()[_0x22a2('0xbe')]()[_0x22a2('0xa7')]();var _0xe87ae2=path[_0x22a2('0xbf')](config[_0x22a2('0xc0')],_0x22a2('0xc1'),_0x22a2('0xc2'),'tmp');var _0x5bafed=path[_0x22a2('0xbf')](config[_0x22a2('0xc0')],_0x22a2('0xc1'),'files',_0x22a2('0xc3'));var _0x2fe4fc=path[_0x22a2('0xbf')](_0xe87ae2,_0x58c63a);var _0x4901f0=util['format'](_0x22a2('0xc4'),_0x125dbc[_0x22a2('0xab')]['id'],_0x58c63a);var _0x47697d=path[_0x22a2('0xbf')](_0xe87ae2,_0x4901f0);var _0x523ebf=[];_0x523ebf[_0x22a2('0x30')]({'model':db[_0x22a2('0x6c')],'as':_0x22a2('0x6c'),'attributes':['id',_0x22a2('0xc5')],'raw':!![]});_0x523ebf[_0x22a2('0x30')]({'model':db[_0x22a2('0xc6')],'as':'Contact','attributes':['id',_0x22a2('0xc7'),_0x22a2('0xc8')],'raw':!![]});if(_0x125dbc[_0x22a2('0x39')]['attachments']){_0x523ebf['push']({'model':db[_0x22a2('0xc9')],'as':_0x22a2('0xc9'),'raw':!![]});}var _0x43e081=[{'model':db[_0x22a2('0xb1')],'as':_0x22a2('0xca'),'attributes':['id',_0x22a2('0x70'),'createdAt',_0x22a2('0xcb'),_0x22a2('0xcc'),_0x22a2('0x7d')],'include':_0x523ebf}];_0x43e081[_0x22a2('0x30')]({'model':db[_0x22a2('0xcd')],'as':_0x22a2('0xce'),'attributes':['id',_0x22a2('0x2a')]});_0x43e081[_0x22a2('0x30')]({'model':db[_0x22a2('0x6c')],'as':_0x22a2('0xcf'),'attributes':['id',_0x22a2('0xc5')]});return db[_0x22a2('0x33')][_0x22a2('0x6e')]({'where':{'id':_0x125dbc[_0x22a2('0xab')]['id']},'include':_0x43e081})[_0x22a2('0x27')](handleEntityNotFound(_0x269f64,null))[_0x22a2('0x27')](function(_0x4140f2){if(_0x4140f2){var _0x1362f0=_0x4140f2['get']({'plain':!![]});fs['mkdirSync'](_0x2fe4fc);var _0x2cf1b5={'channel':_0x22a2('0xd0'),'account':_0x1362f0['Account']['name'],'agent':_0x1362f0[_0x22a2('0xcf')]?_0x1362f0[_0x22a2('0xcf')]['fullname']:'N.A.','createdAt':moment(_0x1362f0['createdAt'])[_0x22a2('0xb4')](_0x22a2('0xb5'))[_0x22a2('0xa7')](),'closedAt':_0x1362f0[_0x22a2('0xd1')]?moment(_0x1362f0[_0x22a2('0xd2')])[_0x22a2('0xb4')](_0x22a2('0xb5'))[_0x22a2('0xa7')]():'','disposition':_0x1362f0[_0x22a2('0xd3')],'visibility':_0x1362f0[_0x22a2('0xd4')]?'Public':_0x22a2('0xd5'),'messages':_(_0x1362f0[_0x22a2('0xca')])[_0x22a2('0x81')]({'secret':![]})['map'](function(_0x4d73a3){if(_0x4d73a3['Attachment']){var _0x201285=path[_0x22a2('0xbf')](_0x5bafed,_0x4d73a3[_0x22a2('0xc9')][_0x22a2('0xd6')]);if(fs['existsSync'](_0x201285)){fs[_0x22a2('0xd7')](_0x201285)['pipe'](fs['createWriteStream'](path['join'](_0x2fe4fc,_0x4d73a3[_0x22a2('0xc9')]['basename'])));}}return{'date':moment(_0x4d73a3[_0x22a2('0x76')])[_0x22a2('0xb4')](_0x22a2('0xb5'))[_0x22a2('0xa7')](),'sender':_0x4d73a3[_0x22a2('0xcb')]===_0x22a2('0xd8')?_0x4d73a3[_0x22a2('0x6c')]?_0x4d73a3[_0x22a2('0x6c')][_0x22a2('0xc5')]:_0x22a2('0xd9'):_0x4d73a3[_0x22a2('0x62')][_0x22a2('0xc7')]+(_0x4d73a3[_0x22a2('0x62')][_0x22a2('0xc8')]?'\x20'+_0x4d73a3[_0x22a2('0x62')][_0x22a2('0xc8')]:''),'body':_0x4d73a3[_0x22a2('0xc9')]?_0x4d73a3[_0x22a2('0xc9')][_0x22a2('0xd6')]:_0x4d73a3[_0x22a2('0x70')],'direction':_0x4d73a3['direction']===_0x22a2('0xd8')?'A':'C','secret':_0x4d73a3[_0x22a2('0xcc')],'read':_0x4d73a3[_0x22a2('0x7d')],'attachment':_0x4d73a3['Attachment']};})[_0x22a2('0x5e')]()};return ejs[_0x22a2('0xda')](path[_0x22a2('0xbf')](config[_0x22a2('0xc0')],'server',_0x22a2('0xdb'),_0x22a2('0xdc')),{'interaction':_0x2cf1b5})[_0x22a2('0x27')](function(_0x13940b){var _0x4af476=path[_0x22a2('0xbf')](_0x2fe4fc,'transcript-'+_0x1362f0['id']+'-'+_0x58c63a+_0x22a2('0xdd'));var _0x4460a4={'path':_0x4af476,'channel':_0x22a2('0xd0'),'interactionId':_0x1362f0['id']};return pdf[_0x22a2('0xde')](_0x13940b,_0x4460a4);})[_0x22a2('0x27')](function(){return new BPromise(function(_0xace0aa,_0x4289a5){zipdir(_0x2fe4fc,{'saveTo':_0x47697d},function(_0x1e6e5b,_0x13b8c3){if(_0x1e6e5b)return _0x4289a5(_0x1e6e5b);return _0xace0aa(_0x13b8c3);});})[_0x22a2('0x27')](function(){return new BPromise(function(_0x774f3c,_0x503cf3){rimraf(_0x2fe4fc,function(_0x13006d){if(_0x13006d)_0x503cf3(_0x13006d);return _0x774f3c();});});})[_0x22a2('0x27')](function(){return _0x269f64['download'](_0x47697d,_0x4901f0,function(_0x15dc84){if(_0x15dc84){console[_0x22a2('0xdf')](_0x22a2('0xe0'),_0x15dc84);}else{fs['unlinkSync'](_0x47697d);}});});});}else{return _0x269f64[_0x22a2('0x1c')](0xc8);}})['catch'](handleError(_0x269f64,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 7b7b473..c52f977 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 _0xf8c3=['map','findAll','unreadMessages','emit','catch','hasOwnProperty','hook','exports','events','OpenchannelInteraction','../../mysqldb','OpenchannelMessage','setMaxListeners','remove','getUsers','then','setDataValue','Users'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0xf8c3,0x98));var _0x3f8c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf8c3[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x3f8c('0x0'));var OpenchannelInteraction=require('../../mysqldb')['db'][_0x3f8c('0x1')];var OpenchannelMessage=require(_0x3f8c('0x2'))['db'][_0x3f8c('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x3f8c('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x3f8c('0x5')};function emitEvent(_0x3eb2cd){return function(_0x55d6e9,_0x2f87ef,_0xbb5c01){_0x55d6e9[_0x3f8c('0x6')]({'attributes':['id'],'raw':!![]})[_0x3f8c('0x7')](function(_0x3aacce){_0x55d6e9[_0x3f8c('0x8')](_0x3f8c('0x9'),_0x3aacce[_0x3f8c('0xa')](function(_0x54f965){return{'id':_0x54f965['id']};}));return OpenchannelMessage[_0x3f8c('0xb')]({'where':{'OpenchannelInteractionId':_0x55d6e9['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3f8c('0x7')](function(_0x513857){_0x55d6e9[_0x3f8c('0x8')](_0x3f8c('0xc'),_0x513857['length']);OpenchannelInteractionEvents[_0x3f8c('0xd')](_0x3eb2cd+':'+_0x55d6e9['id'],_0x55d6e9);OpenchannelInteractionEvents[_0x3f8c('0xd')](_0x3eb2cd,_0x55d6e9);_0xbb5c01(null);})[_0x3f8c('0xe')](_0xbb5c01(null));};}for(var e in events){if(events[_0x3f8c('0xf')](e)){var event=events[e];OpenchannelInteraction[_0x3f8c('0x10')](e,emitEvent(event));}}module[_0x3f8c('0x11')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0xaddd=['OpenchannelInteraction','OpenchannelMessage','save','update','remove','getUsers','then','setDataValue','Users','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x25455b,_0x2600b1){var _0x6ffbb3=function(_0x4442df){while(--_0x4442df){_0x25455b['push'](_0x25455b['shift']());}};_0x6ffbb3(++_0x2600b1);}(_0xaddd,0x12e));var _0xdadd=function(_0x1030ce,_0xbe3f74){_0x1030ce=_0x1030ce-0x0;var _0x3367fd=_0xaddd[_0x1030ce];return _0x3367fd;};'use strict';var EventEmitter=require(_0xdadd('0x0'));var OpenchannelInteraction=require(_0xdadd('0x1'))['db'][_0xdadd('0x2')];var OpenchannelMessage=require(_0xdadd('0x1'))['db'][_0xdadd('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xdadd('0x4'),'afterUpdate':_0xdadd('0x5'),'afterDestroy':_0xdadd('0x6')};function emitEvent(_0x18cd76){return function(_0x24192d,_0x181b98,_0x3b792e){_0x24192d[_0xdadd('0x7')]({'attributes':['id'],'raw':!![]})[_0xdadd('0x8')](function(_0x438273){_0x24192d[_0xdadd('0x9')](_0xdadd('0xa'),_0x438273['map'](function(_0x174a77){return{'id':_0x174a77['id']};}));return OpenchannelMessage[_0xdadd('0xb')]({'where':{'OpenchannelInteractionId':_0x24192d['id'],'direction':'in','read':![]},'raw':!![]});})[_0xdadd('0x8')](function(_0x38407f){_0x24192d[_0xdadd('0x9')](_0xdadd('0xc'),_0x38407f[_0xdadd('0xd')]);OpenchannelInteractionEvents['emit'](_0x18cd76+':'+_0x24192d['id'],_0x24192d);OpenchannelInteractionEvents[_0xdadd('0xe')](_0x18cd76,_0x24192d);_0x3b792e(null);})[_0xdadd('0xf')](_0x3b792e(null));};}for(var e in events){if(events[_0xdadd('0x10')](e)){var event=events[e];OpenchannelInteraction[_0xdadd('0x11')](e,emitEvent(event));}}module[_0xdadd('0x12')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 4d61f3b..27f33ef 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 _0x46fa=['OpenchannelInteraction','utf8mb4_unicode_ci','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x46fa,0x76));var _0xa46f=function(_0x462071,_0x41a842){_0x462071=_0x462071-0x0;var _0x46b2bb=_0x46fa[_0x462071];return _0x46b2bb;};'use strict';var _=require(_0xa46f('0x0'));var util=require('util');var logger=require(_0xa46f('0x1'))(_0xa46f('0x2'));var moment=require(_0xa46f('0x3'));var BPromise=require('bluebird');var rp=require(_0xa46f('0x4'));var fs=require('fs');var path=require(_0xa46f('0x5'));var rimraf=require(_0xa46f('0x6'));var config=require(_0xa46f('0x7'));var attributes=require('./openchannelInteraction.attributes');module[_0xa46f('0x8')]=function(_0x50cff6,_0x5ea799){return _0x50cff6[_0xa46f('0x9')](_0xa46f('0xa'),attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xa46f('0xb'),'hooks':{'beforeUpdate':function(_0x1dfd5a,_0x52543a,_0x47969e){if(_0x1dfd5a[_0xa46f('0xc')](_0xa46f('0xd'))){_0x1dfd5a['closedAt']=moment()[_0xa46f('0xe')](_0xa46f('0xf'));}_0x47969e(null,_0x1dfd5a);}}});}; \ No newline at end of file +var _0x27f8=['util','../../config/logger','api','moment','path','../../config/environment','exports','define','OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x331d58,_0x3701d1){var _0x429bff=function(_0x30ee54){while(--_0x30ee54){_0x331d58['push'](_0x331d58['shift']());}};_0x429bff(++_0x3701d1);}(_0x27f8,0x180));var _0x827f=function(_0x5db1a4,_0x14aa78){_0x5db1a4=_0x5db1a4-0x0;var _0x21ac3f=_0x27f8[_0x5db1a4];return _0x21ac3f;};'use strict';var _=require('lodash');var util=require(_0x827f('0x0'));var logger=require(_0x827f('0x1'))(_0x827f('0x2'));var moment=require(_0x827f('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x827f('0x4'));var rimraf=require('rimraf');var config=require(_0x827f('0x5'));var attributes=require('./openchannelInteraction.attributes');module[_0x827f('0x6')]=function(_0x383e27,_0x23958c){return _0x383e27[_0x827f('0x7')](_0x827f('0x8'),attributes,{'tableName':_0x827f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x827f('0xa'),'collate':_0x827f('0xb'),'hooks':{'beforeUpdate':function(_0x55477c,_0x438f32,_0xdcdd3f){if(_0x55477c[_0x827f('0xc')](_0x827f('0xd'))){_0x55477c['closedAt']=moment()[_0x827f('0xe')](_0x827f('0xf'));}_0xdcdd3f(null,_0x55477c);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index a3b7070..0231283 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 _0x517a=['http','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','where','options','attributes','limit','then','catch','AddTagsToOpenchannelInteraction','find','addTags','ids','spread','AddTags','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x57bd88,_0x2e6e03){var _0x9d70d6=function(_0x27a7c4){while(--_0x27a7c4){_0x57bd88['push'](_0x57bd88['shift']());}};_0x9d70d6(++_0x2e6e03);}(_0x517a,0x108));var _0xa517=function(_0x4c3f7a,_0x1c1baf){_0x4c3f7a=_0x4c3f7a-0x0;var _0x163c23=_0x517a[_0x4c3f7a];return _0x163c23;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa517('0x0'));var BPromise=require(_0xa517('0x1'));var rs=require(_0xa517('0x2'));var fs=require('fs');var Redis=require(_0xa517('0x3'));var db=require(_0xa517('0x4'))['db'];var utils=require(_0xa517('0x5'));var logger=require(_0xa517('0x6'))(_0xa517('0x7'));var config=require('../../config/environment');var jayson=require(_0xa517('0x8'));var client=jayson['client'][_0xa517('0x9')]({'port':0x232a});config[_0xa517('0xa')]=_['defaults'](config['redis'],{'host':_0xa517('0xb'),'port':0x18eb});var socket=require(_0xa517('0xc'))(new Redis(config[_0xa517('0xa')]));require(_0xa517('0xd'))[_0xa517('0xe')](socket);function respondWithRpcPromise(_0x395fd6,_0x4d9031,_0x52f93d){return new BPromise(function(_0x5e8842,_0x23ae45){return client['request'](_0x395fd6,_0x52f93d)['then'](function(_0x24b510){logger[_0xa517('0xf')](_0xa517('0x10'),_0x4d9031,_0xa517('0x11'));logger[_0xa517('0x12')](_0xa517('0x13'),_0x4d9031,_0xa517('0x11'),JSON[_0xa517('0x14')](_0x24b510));if(_0x24b510[_0xa517('0x15')]){if(_0x24b510[_0xa517('0x15')]['code']===0x1f4){logger['error'](_0xa517('0x10'),_0x4d9031,_0x24b510['error'][_0xa517('0x16')]);return _0x23ae45(_0x24b510[_0xa517('0x15')]['message']);}logger[_0xa517('0x15')]('OpenchannelInteraction,\x20%s,\x20%s',_0x4d9031,_0x24b510['error'][_0xa517('0x16')]);return _0x5e8842(_0x24b510[_0xa517('0x15')]['message']);}else{logger['info'](_0xa517('0x10'),_0x4d9031,_0xa517('0x11'));_0x5e8842(_0x24b510['result'][_0xa517('0x16')]);}})['catch'](function(_0x19c470){logger[_0xa517('0x15')](_0xa517('0x10'),_0x4d9031,_0x19c470);_0x23ae45(_0x19c470);});});}exports[_0xa517('0x17')]=function(_0x244c0d){var _0x38a984=this;return new Promise(function(_0x406baa,_0x211f9e){return db[_0xa517('0x18')][_0xa517('0x19')](_0x244c0d[_0xa517('0x1a')],{'raw':_0x244c0d['options']?_0x244c0d['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x244c0d['options']?_0x244c0d['options'][_0xa517('0x1b')]||null:null,'attributes':_0x244c0d[_0xa517('0x1c')]?_0x244c0d[_0xa517('0x1c')][_0xa517('0x1d')]||null:null,'limit':_0x244c0d[_0xa517('0x1c')]?_0x244c0d['options'][_0xa517('0x1e')]||null:null})[_0xa517('0x1f')](function(_0x23ad4b){logger[_0xa517('0xf')](_0xa517('0x17'),_0x244c0d);logger[_0xa517('0x12')](_0xa517('0x17'),_0x244c0d,JSON[_0xa517('0x14')](_0x23ad4b));_0x406baa(_0x23ad4b);})[_0xa517('0x20')](function(_0x5fa0d){logger[_0xa517('0x15')]('UpdateOpenchannelInteraction',_0x5fa0d[_0xa517('0x16')],_0x244c0d);_0x211f9e(_0x38a984[_0xa517('0x15')](0x1f4,_0x5fa0d[_0xa517('0x16')]));});});};exports[_0xa517('0x21')]=function(_0x382d02){return new Promise(function(_0x5c187c,_0x2689df){return db[_0xa517('0x18')][_0xa517('0x22')]({'where':_0x382d02[_0xa517('0x1c')]?_0x382d02['options'][_0xa517('0x1b')]||null:null})['then'](function(_0x91b2a9){if(_0x91b2a9){return _0x91b2a9[_0xa517('0x23')](_0x382d02['body']['ids'],_['omit'](_0x382d02[_0xa517('0x1a')],[_0xa517('0x24'),'id'])||{});}})[_0xa517('0x25')](function(_0x35ab83){logger[_0xa517('0xf')](_0xa517('0x26'),_0x382d02);logger['debug'](_0xa517('0x26'),_0x382d02,JSON[_0xa517('0x14')](_0x35ab83));_0x5c187c(_0x35ab83);})[_0xa517('0x20')](function(_0xe64de9){logger[_0xa517('0x15')](_0xa517('0x26'),_0xe64de9[_0xa517('0x16')],_0x382d02);_0x2689df(_this['error'](0x1f4,_0xe64de9[_0xa517('0x16')]));});});}; \ No newline at end of file +var _0x5ffa=['spread','AddTags','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','request','then','info','request\x20sent','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelInteraction,\x20%s,\x20%s','message','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','options','where','attributes','limit','debug','find','addTags','ids','omit'];(function(_0x4254e7,_0x4fc342){var _0x5e0844=function(_0x3a92c7){while(--_0x3a92c7){_0x4254e7['push'](_0x4254e7['shift']());}};_0x5e0844(++_0x4fc342);}(_0x5ffa,0xca));var _0xa5ff=function(_0x516832,_0x43e87d){_0x516832=_0x516832-0x0;var _0x273a80=_0x5ffa[_0x516832];return _0x273a80;};'use strict';var _=require('lodash');var util=require(_0xa5ff('0x0'));var moment=require(_0xa5ff('0x1'));var BPromise=require(_0xa5ff('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa5ff('0x3'));var db=require(_0xa5ff('0x4'))['db'];var utils=require(_0xa5ff('0x5'));var logger=require(_0xa5ff('0x6'))('rpc');var config=require(_0xa5ff('0x7'));var jayson=require(_0xa5ff('0x8'));var client=jayson['client'][_0xa5ff('0x9')]({'port':0x232a});config[_0xa5ff('0xa')]=_[_0xa5ff('0xb')](config[_0xa5ff('0xa')],{'host':_0xa5ff('0xc'),'port':0x18eb});var socket=require(_0xa5ff('0xd'))(new Redis(config[_0xa5ff('0xa')]));require(_0xa5ff('0xe'))['register'](socket);function respondWithRpcPromise(_0x3ad2ab,_0x4cada4,_0x167efb){return new BPromise(function(_0x17d740,_0x22d0a8){return client[_0xa5ff('0xf')](_0x3ad2ab,_0x167efb)[_0xa5ff('0x10')](function(_0x191920){logger[_0xa5ff('0x11')]('OpenchannelInteraction,\x20%s,\x20%s',_0x4cada4,_0xa5ff('0x12'));logger['debug'](_0xa5ff('0x13'),_0x4cada4,'request\x20sent',JSON[_0xa5ff('0x14')](_0x191920));if(_0x191920[_0xa5ff('0x15')]){if(_0x191920[_0xa5ff('0x15')][_0xa5ff('0x16')]===0x1f4){logger[_0xa5ff('0x15')](_0xa5ff('0x17'),_0x4cada4,_0x191920[_0xa5ff('0x15')][_0xa5ff('0x18')]);return _0x22d0a8(_0x191920['error'][_0xa5ff('0x18')]);}logger['error'](_0xa5ff('0x17'),_0x4cada4,_0x191920[_0xa5ff('0x15')][_0xa5ff('0x18')]);return _0x17d740(_0x191920[_0xa5ff('0x15')]['message']);}else{logger[_0xa5ff('0x11')](_0xa5ff('0x17'),_0x4cada4,'request\x20sent');_0x17d740(_0x191920['result']['message']);}})[_0xa5ff('0x19')](function(_0x24cd70){logger[_0xa5ff('0x15')](_0xa5ff('0x17'),_0x4cada4,_0x24cd70);_0x22d0a8(_0x24cd70);});});}exports[_0xa5ff('0x1a')]=function(_0x1dd19e){var _0xc95fef=this;return new Promise(function(_0x243a3c,_0x383168){return db[_0xa5ff('0x1b')][_0xa5ff('0x1c')](_0x1dd19e['body'],{'raw':_0x1dd19e[_0xa5ff('0x1d')]?_0x1dd19e['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1dd19e[_0xa5ff('0x1d')]?_0x1dd19e[_0xa5ff('0x1d')][_0xa5ff('0x1e')]||null:null,'attributes':_0x1dd19e[_0xa5ff('0x1d')]?_0x1dd19e['options'][_0xa5ff('0x1f')]||null:null,'limit':_0x1dd19e[_0xa5ff('0x1d')]?_0x1dd19e[_0xa5ff('0x1d')][_0xa5ff('0x20')]||null:null})[_0xa5ff('0x10')](function(_0x4ab72f){logger[_0xa5ff('0x11')](_0xa5ff('0x1a'),_0x1dd19e);logger[_0xa5ff('0x21')](_0xa5ff('0x1a'),_0x1dd19e,JSON['stringify'](_0x4ab72f));_0x243a3c(_0x4ab72f);})[_0xa5ff('0x19')](function(_0x586bb1){logger['error'](_0xa5ff('0x1a'),_0x586bb1[_0xa5ff('0x18')],_0x1dd19e);_0x383168(_0xc95fef[_0xa5ff('0x15')](0x1f4,_0x586bb1[_0xa5ff('0x18')]));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x2b9053){return new Promise(function(_0x368378,_0x3d3475){return db['OpenchannelInteraction'][_0xa5ff('0x22')]({'where':_0x2b9053[_0xa5ff('0x1d')]?_0x2b9053[_0xa5ff('0x1d')]['where']||null:null})[_0xa5ff('0x10')](function(_0x2aca5e){if(_0x2aca5e){return _0x2aca5e[_0xa5ff('0x23')](_0x2b9053['body'][_0xa5ff('0x24')],_[_0xa5ff('0x25')](_0x2b9053['body'],[_0xa5ff('0x24'),'id'])||{});}})[_0xa5ff('0x26')](function(_0x12e8da){logger[_0xa5ff('0x11')](_0xa5ff('0x27'),_0x2b9053);logger['debug'](_0xa5ff('0x27'),_0x2b9053,JSON[_0xa5ff('0x14')](_0x12e8da));_0x368378(_0x12e8da);})[_0xa5ff('0x19')](function(_0x56b0be){logger[_0xa5ff('0x15')](_0xa5ff('0x27'),_0x56b0be[_0xa5ff('0x18')],_0x2b9053);_0x3d3475(_this[_0xa5ff('0x15')](0x1f4,_0x56b0be[_0xa5ff('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 320c4b7..5ee9a0c 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 _0xb2c1=['./openchannelInteraction.events','save','remove','update','emit','removeListener','register','length','openchannelInteraction:'];(function(_0x24af04,_0x4b89f6){var _0x281812=function(_0xc44877){while(--_0xc44877){_0x24af04['push'](_0x24af04['shift']());}};_0x281812(++_0x4b89f6);}(_0xb2c1,0x1d4));var _0x1b2c=function(_0x1ebd10,_0x4914b4){_0x1ebd10=_0x1ebd10-0x0;var _0x1004d3=_0xb2c1[_0x1ebd10];return _0x1004d3;};'use strict';var OpenchannelInteractionEvents=require(_0x1b2c('0x0'));var events=[_0x1b2c('0x1'),_0x1b2c('0x2'),_0x1b2c('0x3')];function createListener(_0xbd4988,_0x32f2c3){return function(_0x30e271){_0x32f2c3[_0x1b2c('0x4')](_0xbd4988,_0x30e271);};}function removeListener(_0x4611ac,_0x11c4f4){return function(){OpenchannelInteractionEvents[_0x1b2c('0x5')](_0x4611ac,_0x11c4f4);};}exports[_0x1b2c('0x6')]=function(_0x127dea){for(var _0x47a518=0x0,_0x30f81e=events[_0x1b2c('0x7')];_0x47a518<_0x30f81e;_0x47a518++){var _0x152b66=events[_0x47a518];var _0xf64c93=createListener(_0x1b2c('0x8')+_0x152b66,_0x127dea);OpenchannelInteractionEvents['on'](_0x152b66,_0xf64c93);}}; \ No newline at end of file +var _0x2f61=['register','length','openchannelInteraction:','./openchannelInteraction.events','save','update','emit'];(function(_0x481fdc,_0x11979c){var _0x25e264=function(_0x35a803){while(--_0x35a803){_0x481fdc['push'](_0x481fdc['shift']());}};_0x25e264(++_0x11979c);}(_0x2f61,0x1a7));var _0x12f6=function(_0x59c7d3,_0x529559){_0x59c7d3=_0x59c7d3-0x0;var _0x5a286b=_0x2f61[_0x59c7d3];return _0x5a286b;};'use strict';var OpenchannelInteractionEvents=require(_0x12f6('0x0'));var events=[_0x12f6('0x1'),'remove',_0x12f6('0x2')];function createListener(_0x2527dc,_0x1ada57){return function(_0x52005a){_0x1ada57[_0x12f6('0x3')](_0x2527dc,_0x52005a);};}function removeListener(_0x29a678,_0x2f7acd){return function(){OpenchannelInteractionEvents['removeListener'](_0x29a678,_0x2f7acd);};}exports[_0x12f6('0x4')]=function(_0x4b4773){for(var _0x477dad=0x0,_0x57875b=events[_0x12f6('0x5')];_0x477dad<_0x57875b;_0x477dad++){var _0x2e2d44=events[_0x477dad];var _0x1ef61b=createListener(_0x12f6('0x6')+_0x2e2d44,_0x4b4773);OpenchannelInteractionEvents['on'](_0x2e2d44,_0x1ef61b);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index b220db3..ef32f3b 100644 --- a/server/api/openchannelMessage/index.js +++ b/server/api/openchannelMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['index','get','/describe','/:id','show','tracked','openchannel','create','put','update','accept','/:id/reject','reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./openchannelMessage.controller','isAuthenticated'];(function(_0x5a9461,_0x30e8dc){var _0x39a3be=function(_0x5b05ee){while(--_0x5b05ee){_0x5a9461['push'](_0x5a9461['shift']());}};_0x39a3be(++_0x30e8dc);}(_0x9c44,0x178));var _0x49c4=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0x9c44[_0x17b6e3];return _0x3906f3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x49c4('0x6'));router['get']('/',auth[_0x49c4('0x7')](),controller[_0x49c4('0x8')]);router[_0x49c4('0x9')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller['describe']);router[_0x49c4('0x9')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0xc')]);router['post']('/',auth['isAuthenticated'](),interaction[_0x49c4('0xd')](_0x49c4('0xe'),'openchannelmessage:create'),controller[_0x49c4('0xf')]);router[_0x49c4('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x49c4('0x11')]);router[_0x49c4('0x10')]('/:id/accept',auth[_0x49c4('0x7')](),controller[_0x49c4('0x12')]);router['put'](_0x49c4('0x13'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x14')]);router[_0x49c4('0x15')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x16')]);module[_0x49c4('0x17')]=router; \ No newline at end of file +var _0x0713=['get','isAuthenticated','index','/describe','describe','/:id','post','tracked','openchannel','openchannelmessage:create','put','update','accept','/:id/reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelMessage.controller'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var controller=require(_0x3071('0x7'));router[_0x3071('0x8')]('/',auth[_0x3071('0x9')](),controller[_0x3071('0xa')]);router[_0x3071('0x8')](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0xc')]);router[_0x3071('0x8')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller['show']);router[_0x3071('0xe')]('/',auth[_0x3071('0x9')](),interaction[_0x3071('0xf')](_0x3071('0x10'),_0x3071('0x11')),controller['create']);router[_0x3071('0x12')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller[_0x3071('0x13')]);router[_0x3071('0x12')]('/:id/accept',auth['isAuthenticated'](),controller[_0x3071('0x14')]);router['put'](_0x3071('0x15'),auth[_0x3071('0x9')](),controller['reject']);router[_0x3071('0x16')]('/:id',auth[_0x3071('0x9')](),controller[_0x3071('0x17')]);module[_0x3071('0x18')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 8301574..d6147fc 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 _0x0490=['DATE','STRING','TEXT','exports','ENUM','out'];(function(_0x2090a4,_0xa68974){var _0x38b531=function(_0x409765){while(--_0x409765){_0x2090a4['push'](_0x2090a4['shift']());}};_0x38b531(++_0xa68974);}(_0x0490,0x147));var _0x0049=function(_0x5f207b,_0x2bd4f2){_0x5f207b=_0x5f207b-0x0;var _0x4a1825=_0x0490[_0x5f207b];return _0x4a1825;};'use strict';var Sequelize=require('sequelize');module[_0x0049('0x0')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x0049('0x1')]('in',_0x0049('0x2')),'defaultValue':_0x0049('0x2'),'allowNull':![]},'readAt':{'type':Sequelize[_0x0049('0x3')]},'providerName':{'type':Sequelize[_0x0049('0x4')]},'providerResponse':{'type':Sequelize[_0x0049('0x5')]}}; \ No newline at end of file +var _0x8f59=['medium','BOOLEAN','out','DATE','STRING','sequelize','exports','TEXT'];(function(_0x4b3fd0,_0x5a13b3){var _0x453c61=function(_0x2a00aa){while(--_0x2a00aa){_0x4b3fd0['push'](_0x4b3fd0['shift']());}};_0x453c61(++_0x5a13b3);}(_0x8f59,0x11d));var _0x98f5=function(_0x4f9e00,_0x4d3a17){_0x4f9e00=_0x4f9e00-0x0;var _0x73b307=_0x8f59[_0x4f9e00];return _0x73b307;};'use strict';var Sequelize=require(_0x98f5('0x0'));module[_0x98f5('0x1')]={'body':{'type':Sequelize[_0x98f5('0x2')](_0x98f5('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x98f5('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x98f5('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x98f5('0x5')),'defaultValue':_0x98f5('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x98f5('0x6')]},'providerName':{'type':Sequelize[_0x98f5('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 804d07c..1cfdf23 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 _0x71ab=['http','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','stack','name','index','map','OpenchannelMessage','type','key','model','query','intersection','attributes','fields','length','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','keys','include','create','body','find','describe','openchannel-interactions','openchannel','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','read1stAt','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','interaction','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','SELECT','contact','User','fullname','internal','manual','interface','format','channel','motionChannel','event','accept','EventManager','OpenchannelInteractionId','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','rejectMessage','sequelize','QueryTypes','email','SIP/%s','reject','rejectmessage','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','client'];(function(_0x4a2431,_0x1a303e){var _0x2b57a6=function(_0xf43ea2){while(--_0xf43ea2){_0x4a2431['push'](_0x4a2431['shift']());}};_0x2b57a6(++_0x1a303e);}(_0x71ab,0x64));var _0xb71a=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x71ab[_0x432682];return _0x463d05;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb71a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb71a('0x1'));var rp=require('request-promise');var moment=require(_0xb71a('0x2'));var BPromise=require(_0xb71a('0x3'));var Mustache=require(_0xb71a('0x4'));var util=require(_0xb71a('0x5'));var path=require(_0xb71a('0x6'));var sox=require(_0xb71a('0x7'));var csv=require(_0xb71a('0x8'));var ejs=require(_0xb71a('0x9'));var fs=require('fs');var fs_extra=require(_0xb71a('0xa'));var _=require(_0xb71a('0xb'));var squel=require(_0xb71a('0xc'));var crypto=require(_0xb71a('0xd'));var jsforce=require(_0xb71a('0xe'));var deskjs=require(_0xb71a('0xf'));var toCsv=require(_0xb71a('0x8'));var querystring=require(_0xb71a('0x10'));var Papa=require(_0xb71a('0x11'));var Redis=require(_0xb71a('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xb71a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb71a('0x14'));var logger=require(_0xb71a('0x15'))(_0xb71a('0x16'));var utils=require('../../config/utils');var config=require(_0xb71a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xb71a('0x18'))['db'];config['redis']=_['defaults'](config[_0xb71a('0x19')],{'host':_0xb71a('0x1a'),'port':0x18eb});var socket=require(_0xb71a('0x1b'))(new Redis(config[_0xb71a('0x19')]));require('./openchannelMessage.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xb71a('0x1c')][_0xb71a('0x1d')]({'port':0x232c});var client9002=jayson[_0xb71a('0x1c')][_0xb71a('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x3cd0f0,_0x1e9363,_0x31def2,_0x2ec64a){return new BPromise(function(_0x7710a8,_0x5588cf){var _0x1ca65e=_0x2ec64a||client;return _0x1ca65e[_0xb71a('0x1e')](_0x3cd0f0,_0x31def2)[_0xb71a('0x1f')](function(_0x346524){logger[_0xb71a('0x20')](_0xb71a('0x21'),_0x1e9363,_0xb71a('0x22'));logger[_0xb71a('0x23')](_0xb71a('0x24'),_0x1e9363,_0xb71a('0x22'),JSON[_0xb71a('0x25')](_0x346524));if(_0x346524['error']){if(_0x346524['error'][_0xb71a('0x26')]===0x1f4){logger[_0xb71a('0x27')]('OpenchannelMessage,\x20%s,\x20%s',_0x1e9363,_0x346524['error'][_0xb71a('0x28')]);return _0x5588cf(_0x346524['error'][_0xb71a('0x28')]);}logger[_0xb71a('0x27')](_0xb71a('0x21'),_0x1e9363,_0x346524[_0xb71a('0x27')][_0xb71a('0x28')]);return _0x7710a8(_0x346524[_0xb71a('0x27')][_0xb71a('0x28')]);}else{logger[_0xb71a('0x20')]('OpenchannelMessage,\x20%s,\x20%s',_0x1e9363,_0xb71a('0x22'));_0x7710a8(_0x346524[_0xb71a('0x29')][_0xb71a('0x28')]);}})[_0xb71a('0x2a')](function(_0x3401f7){logger[_0xb71a('0x27')](_0xb71a('0x21'),_0x1e9363,_0x3401f7);_0x5588cf(_0x3401f7);});});}function respondWithStatusCode(_0xfc8df0,_0x31085b){_0x31085b=_0x31085b||0xcc;return function(_0x2a847a){if(_0x2a847a){return _0xfc8df0[_0xb71a('0x2b')](_0x31085b);}return _0xfc8df0[_0xb71a('0x2c')](_0x31085b)[_0xb71a('0x2d')]();};}function respondWithResult(_0x5ae0ed,_0x2e8ea6){_0x2e8ea6=_0x2e8ea6||0xc8;return function(_0x39d874){if(_0x39d874){return _0x5ae0ed[_0xb71a('0x2c')](_0x2e8ea6)[_0xb71a('0x2e')](_0x39d874);}};}function respondWithFilteredResult(_0x2fbd73,_0x38178c){return function(_0x44826e){if(_0x44826e){var _0x25364c=typeof _0x38178c[_0xb71a('0x2f')]===_0xb71a('0x30')&&typeof _0x38178c[_0xb71a('0x31')]==='undefined';var _0x56f5a4=_0x44826e[_0xb71a('0x32')];var _0x5c2a45=_0x25364c?0x0:_0x38178c[_0xb71a('0x2f')];var _0x1b1aa8=_0x25364c?_0x44826e['count']:_0x38178c[_0xb71a('0x2f')]+_0x38178c[_0xb71a('0x31')];var _0x1fe058;if(_0x1b1aa8>=_0x56f5a4){_0x1b1aa8=_0x56f5a4;_0x1fe058=0xc8;}else{_0x1fe058=0xce;}_0x2fbd73[_0xb71a('0x2c')](_0x1fe058);return _0x2fbd73[_0xb71a('0x33')](_0xb71a('0x34'),_0x5c2a45+'-'+_0x1b1aa8+'/'+_0x56f5a4)['json'](_0x44826e);}return null;};}function patchUpdates(_0x204f99){return function(_0x3f137a){try{jsonpatch[_0xb71a('0x35')](_0x3f137a,_0x204f99,!![]);}catch(_0x31e708){return BPromise['reject'](_0x31e708);}return _0x3f137a[_0xb71a('0x36')]();};}function saveUpdates(_0x140c25,_0x3e1261){return function(_0x3db4e0){if(_0x3db4e0){return _0x3db4e0[_0xb71a('0x37')](_0x140c25)[_0xb71a('0x1f')](function(_0x2962a0){return _0x2962a0;});}return null;};}function removeEntity(_0x333280,_0x10a203){return function(_0x3f5531){if(_0x3f5531){return _0x3f5531['destroy']()['then'](function(){_0x333280[_0xb71a('0x2c')](0xcc)[_0xb71a('0x2d')]();});}};}function handleEntityNotFound(_0x2fd09e,_0x12b907){return function(_0xb5d842){if(!_0xb5d842){_0x2fd09e[_0xb71a('0x2b')](0x194);}return _0xb5d842;};}function handleError(_0x394b4f,_0x564fd8){_0x564fd8=_0x564fd8||0x1f4;return function(_0x990c82){logger['error'](_0x990c82[_0xb71a('0x38')]);if(_0x990c82[_0xb71a('0x39')]){delete _0x990c82[_0xb71a('0x39')];}_0x394b4f[_0xb71a('0x2c')](_0x564fd8)['send'](_0x990c82);};}exports[_0xb71a('0x3a')]=function(_0x3ff4ed,_0x4694fd){var _0x1fa15c={},_0x1ce0ed={},_0x3f495c={'count':0x0,'rows':[]};var _0x4571c0=_[_0xb71a('0x3b')](db[_0xb71a('0x3c')]['rawAttributes'],function(_0x24a3af){return{'name':_0x24a3af['fieldName'],'type':_0x24a3af[_0xb71a('0x3d')][_0xb71a('0x3e')]};});_0x1ce0ed[_0xb71a('0x3f')]=_[_0xb71a('0x3b')](_0x4571c0,_0xb71a('0x39'));_0x1ce0ed[_0xb71a('0x40')]=_['keys'](_0x3ff4ed['query']);_0x1ce0ed['filters']=_[_0xb71a('0x41')](_0x1ce0ed['model'],_0x1ce0ed[_0xb71a('0x40')]);_0x1fa15c[_0xb71a('0x42')]=_[_0xb71a('0x41')](_0x1ce0ed[_0xb71a('0x3f')],qs[_0xb71a('0x43')](_0x3ff4ed[_0xb71a('0x40')]['fields']));_0x1fa15c[_0xb71a('0x42')]=_0x1fa15c[_0xb71a('0x42')][_0xb71a('0x44')]?_0x1fa15c[_0xb71a('0x42')]:_0x1ce0ed[_0xb71a('0x3f')];if(!_0x3ff4ed[_0xb71a('0x40')]['hasOwnProperty'](_0xb71a('0x45'))){_0x1fa15c[_0xb71a('0x31')]=qs[_0xb71a('0x31')](_0x3ff4ed[_0xb71a('0x40')][_0xb71a('0x31')]);_0x1fa15c[_0xb71a('0x2f')]=qs[_0xb71a('0x2f')](_0x3ff4ed['query']['offset']);}_0x1fa15c[_0xb71a('0x46')]=qs[_0xb71a('0x47')](_0x3ff4ed[_0xb71a('0x40')][_0xb71a('0x47')]);_0x1fa15c['where']=qs[_0xb71a('0x48')](_['pick'](_0x3ff4ed[_0xb71a('0x40')],_0x1ce0ed[_0xb71a('0x48')]),_0x4571c0);if(_0x3ff4ed['query'][_0xb71a('0x49')]){_0x1fa15c[_0xb71a('0x4a')]=_[_0xb71a('0x4b')](_0x1fa15c[_0xb71a('0x4a')],{'$or':_['map'](_0x4571c0,function(_0x188896){if(_0x188896[_0xb71a('0x3d')]!==_0xb71a('0x4c')){var _0x5516bd={};_0x5516bd[_0x188896[_0xb71a('0x39')]]={'$like':'%'+_0x3ff4ed[_0xb71a('0x40')][_0xb71a('0x49')]+'%'};return _0x5516bd;}})});}_0x1fa15c=_['merge']({},_0x1fa15c,_0x3ff4ed[_0xb71a('0x4d')]);var _0xfc6a80={'where':_0x1fa15c[_0xb71a('0x4a')]};return db[_0xb71a('0x3c')][_0xb71a('0x32')](_0xfc6a80)['then'](function(_0x1d876a){_0x3f495c[_0xb71a('0x32')]=_0x1d876a;if(_0x3ff4ed[_0xb71a('0x40')][_0xb71a('0x4e')]){_0x1fa15c['include']=[{'all':!![]}];}return db['OpenchannelMessage'][_0xb71a('0x4f')](_0x1fa15c);})[_0xb71a('0x1f')](function(_0x1a3755){_0x3f495c[_0xb71a('0x50')]=_0x1a3755;return _0x3f495c;})[_0xb71a('0x1f')](respondWithFilteredResult(_0x4694fd,_0x1fa15c))[_0xb71a('0x2a')](handleError(_0x4694fd,null));};exports[_0xb71a('0x51')]=function(_0x15e593,_0x2ebe69){var _0x357662={'raw':!![],'where':{'id':_0x15e593[_0xb71a('0x52')]['id']}},_0x47e8e2={};_0x47e8e2[_0xb71a('0x3f')]=_['keys'](db[_0xb71a('0x3c')]['rawAttributes']);_0x47e8e2[_0xb71a('0x40')]=_[_0xb71a('0x53')](_0x15e593[_0xb71a('0x40')]);_0x47e8e2[_0xb71a('0x48')]=_[_0xb71a('0x41')](_0x47e8e2['model'],_0x47e8e2[_0xb71a('0x40')]);_0x357662['attributes']=_[_0xb71a('0x41')](_0x47e8e2[_0xb71a('0x3f')],qs['fields'](_0x15e593['query'][_0xb71a('0x43')]));_0x357662[_0xb71a('0x42')]=_0x357662['attributes']['length']?_0x357662['attributes']:_0x47e8e2[_0xb71a('0x3f')];if(_0x15e593['query']['includeAll']){_0x357662[_0xb71a('0x54')]=[{'all':!![]}];}_0x357662=_[_0xb71a('0x4b')]({},_0x357662,_0x15e593[_0xb71a('0x4d')]);return db[_0xb71a('0x3c')]['find'](_0x357662)[_0xb71a('0x1f')](handleEntityNotFound(_0x2ebe69,null))[_0xb71a('0x1f')](respondWithResult(_0x2ebe69,null))[_0xb71a('0x2a')](handleError(_0x2ebe69,null));};exports['create']=function(_0x2ac617,_0x7de9e6){return db['OpenchannelMessage'][_0xb71a('0x55')](_0x2ac617[_0xb71a('0x56')],{})[_0xb71a('0x1f')](respondWithResult(_0x7de9e6,0xc9))['catch'](handleError(_0x7de9e6,null));};exports[_0xb71a('0x37')]=function(_0x51112b,_0x2af7f0){if(_0x51112b[_0xb71a('0x56')]['id']){delete _0x51112b['body']['id'];}return db[_0xb71a('0x3c')][_0xb71a('0x57')]({'where':{'id':_0x51112b[_0xb71a('0x52')]['id']}})[_0xb71a('0x1f')](handleEntityNotFound(_0x2af7f0,null))[_0xb71a('0x1f')](saveUpdates(_0x51112b[_0xb71a('0x56')],null))[_0xb71a('0x1f')](respondWithResult(_0x2af7f0,null))['catch'](handleError(_0x2af7f0,null));};exports['destroy']=function(_0x19c72d,_0x43e9ea){return db[_0xb71a('0x3c')][_0xb71a('0x57')]({'where':{'id':_0x19c72d[_0xb71a('0x52')]['id']}})['then'](handleEntityNotFound(_0x43e9ea,null))['then'](removeEntity(_0x43e9ea,null))[_0xb71a('0x2a')](handleError(_0x43e9ea,null));};exports[_0xb71a('0x58')]=function(_0x581bf5,_0x34d664){return db[_0xb71a('0x3c')]['describe']()[_0xb71a('0x1f')](respondWithResult(_0x34d664,null))[_0xb71a('0x2a')](handleError(_0x34d664,null));};var interaction_log=require(_0xb71a('0x15'))(_0xb71a('0x59'));exports['accept']=function(_0x22146b,_0x32e9e5,_0x4c80f8){var _0x471c3c={'agent':{},'channel':_0xb71a('0x5a')};if(_0x22146b[_0xb71a('0x56')]['id']){delete _0x22146b[_0xb71a('0x56')]['id'];}_0x22146b[_0xb71a('0x56')][_0xb71a('0x5b')]=!![];_0x22146b[_0xb71a('0x56')][_0xb71a('0x5c')]=moment()['format'](_0xb71a('0x5d'));_0x22146b[_0xb71a('0x56')]['UserId']=_0x22146b[_0xb71a('0x56')][_0xb71a('0x5e')]||_0x22146b['user']['id'];_0x471c3c[_0xb71a('0x5f')]['id']=_0x22146b[_0xb71a('0x56')][_0xb71a('0x5e')];return db[_0xb71a('0x3c')][_0xb71a('0x57')]({'where':{'id':_0x22146b[_0xb71a('0x52')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x32e9e5,null))['then'](saveUpdates(_0x22146b[_0xb71a('0x56')],null))[_0xb71a('0x1f')](function(_0x6fefb8){if(_0x6fefb8){_0x471c3c['message']=_0x6fefb8[_0xb71a('0x60')]({'plain':!![]});return db['OpenchannelInteraction'][_0xb71a('0x57')]({'where':{'id':_0x6fefb8['OpenchannelInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x32e9e5,null))[_0xb71a('0x1f')](function(_0x9af0c){if(_0x9af0c){return _0x9af0c[_0xb71a('0x37')]({'UserId':_0x22146b[_0xb71a('0x56')][_0xb71a('0x5e')],'read1stAt':_['isNil'](_0x9af0c[_0xb71a('0x61')])?moment()['format'](_0xb71a('0x5d')):undefined});}return null;})[_0xb71a('0x1f')](function(_0x41f5fe){if(_0x41f5fe){_0x471c3c['interaction']=_0x41f5fe['get']({'plain':!![]});interaction_log[_0xb71a('0x20')](_0xb71a('0x62'),_0x22146b[_0xb71a('0x63')]['id'],_0x22146b[_0xb71a('0x63')][_0xb71a('0x39')],_0x22146b['user'][_0xb71a('0x64')],_0x471c3c[_0xb71a('0x65')]['id'],_0x22146b[_0xb71a('0x56')]?JSON[_0xb71a('0x25')](_0x22146b[_0xb71a('0x56')]):'null');return respondWithRpcPromise('AcceptMessage',_0xb71a('0x66'),_0x471c3c);}return null;})[_0xb71a('0x1f')](function(_0x38a8a1){var _0x3a39be=_0xb71a('0x67')+_0x38a8a1[_0xb71a('0x28')][_0xb71a('0x68')];return db['sequelize'][_0xb71a('0x40')](_0x3a39be,{'type':db[_0xb71a('0x69')]['QueryTypes'][_0xb71a('0x6a')],'raw':!![]})[_0xb71a('0x1f')](function(_0x47486d){return _0x47486d;});})['then'](function(_0x6d255e){if(_0x6d255e){_0x471c3c[_0xb71a('0x28')][_0xb71a('0x6b')]=_0x6d255e[0x0];if(!_0x22146b['body'][_0xb71a('0x5e')])return;return db[_0xb71a('0x6c')][_0xb71a('0x57')]({'where':{'id':_0x22146b[_0xb71a('0x56')][_0xb71a('0x5e')],'role':_0xb71a('0x5f')},'attributes':['id',_0xb71a('0x39'),_0xb71a('0x6d'),'email',_0xb71a('0x6e')],'raw':!![]});}return null;})[_0xb71a('0x1f')](function(_0x57896d){if(!_0x57896d)return null;_0x471c3c[_0xb71a('0x28')][_0xb71a('0x5f')]=_0x57896d;return _0x471c3c;})[_0xb71a('0x1f')](function(_0x2e9ac6){if(_0x2e9ac6){if(_0x22146b['body'][_0xb71a('0x6f')]){_0x471c3c['message'][_0xb71a('0x70')]=util[_0xb71a('0x71')]('SIP/%s',_0x22146b[_0xb71a('0x63')]['name']);_0x471c3c[_0xb71a('0x28')]['channel']=_0x471c3c[_0xb71a('0x72')];_0x471c3c[_0xb71a('0x28')][_0xb71a('0x73')]=_0x471c3c[_0xb71a('0x72')];_0x471c3c['message'][_0xb71a('0x74')]=_0xb71a('0x75');return respondWithRpcPromise('EventManager',_0xb71a('0x76'),{'event':'acceptmessage','message':_0x471c3c['message']},client9002)['then'](function(){return _0x471c3c;});}return _0x471c3c;}return null;})['then'](respondWithResult(_0x32e9e5,null))[_0xb71a('0x2a')](handleError(_0x32e9e5,null));};var interaction_log=require(_0xb71a('0x15'))(_0xb71a('0x59'));exports['reject']=function(_0x2bdf9b,_0x433d38,_0x58ed5f){var _0x299349={'agent':{},'channel':_0xb71a('0x5a')};if(_0x2bdf9b[_0xb71a('0x56')]['id']){delete _0x2bdf9b[_0xb71a('0x56')]['id'];}_0x2bdf9b[_0xb71a('0x56')][_0xb71a('0x5e')]=_0x2bdf9b['body'][_0xb71a('0x5e')]||_0x2bdf9b[_0xb71a('0x63')]['id'];_0x299349[_0xb71a('0x5f')]['id']=_0x2bdf9b[_0xb71a('0x56')][_0xb71a('0x5e')];return db[_0xb71a('0x3c')]['find']({'where':{'id':_0x2bdf9b[_0xb71a('0x52')]['id'],'UserId':null}})[_0xb71a('0x1f')](handleEntityNotFound(_0x433d38,null))['then'](function(_0x1e3966){if(_0x1e3966){_0x299349[_0xb71a('0x28')]=_0x1e3966[_0xb71a('0x60')]({'plain':!![]});return db['OpenchannelInteraction'][_0xb71a('0x57')]({'where':{'id':_0x1e3966[_0xb71a('0x77')]}});}return null;})[_0xb71a('0x1f')](handleEntityNotFound(_0x433d38,null))['then'](function(_0x1a658e){if(_0x1a658e){_0x299349[_0xb71a('0x65')]=_0x1a658e['get']({'plain':!![]});interaction_log[_0xb71a('0x20')](_0xb71a('0x78'),_0x2bdf9b[_0xb71a('0x63')]['id'],_0x2bdf9b[_0xb71a('0x63')]['name'],_0x2bdf9b[_0xb71a('0x63')][_0xb71a('0x64')],_0x299349[_0xb71a('0x65')]['id'],_0x2bdf9b[_0xb71a('0x56')]?JSON['stringify'](_0x2bdf9b[_0xb71a('0x56')]):_0xb71a('0x79'));return respondWithRpcPromise('RejectMessage',_0xb71a('0x7a'),_0x299349);}return null;})[_0xb71a('0x1f')](function(_0x5df234){var _0x1bc530=_0xb71a('0x67')+_0x5df234[_0xb71a('0x28')]['ContactId'];return db[_0xb71a('0x7b')][_0xb71a('0x40')](_0x1bc530,{'type':db[_0xb71a('0x69')][_0xb71a('0x7c')][_0xb71a('0x6a')],'raw':!![]})[_0xb71a('0x1f')](function(_0x3106c3){return _0x3106c3;});})[_0xb71a('0x1f')](function(_0x19d364){if(_0x19d364){_0x299349['message']['contact']=_0x19d364[0x0];if(!_0x2bdf9b[_0xb71a('0x56')][_0xb71a('0x5e')])return;return db[_0xb71a('0x6c')][_0xb71a('0x57')]({'where':{'id':_0x2bdf9b[_0xb71a('0x56')][_0xb71a('0x5e')],'role':'agent'},'attributes':['id',_0xb71a('0x39'),'fullname',_0xb71a('0x7d'),'internal'],'raw':!![]});}return null;})[_0xb71a('0x1f')](function(_0x2b5ef8){if(!_0x2b5ef8)return null;_0x299349['message'][_0xb71a('0x5f')]=_0x2b5ef8;return _0x299349;})[_0xb71a('0x1f')](function(_0xe0940f){if(_0xe0940f){_0xe0940f[_0xb71a('0x28')][_0xb71a('0x70')]=util['format'](_0xb71a('0x7e'),_0x2bdf9b[_0xb71a('0x63')]['name']);_0xe0940f[_0xb71a('0x28')][_0xb71a('0x72')]=_0x299349['channel'];_0xe0940f[_0xb71a('0x28')][_0xb71a('0x73')]=_0x299349[_0xb71a('0x72')];_0xe0940f['message'][_0xb71a('0x74')]=_0xb71a('0x7f');respondWithRpcPromise(_0xb71a('0x76'),'EventManager',{'event':_0xb71a('0x80'),'message':_0xe0940f[_0xb71a('0x28')]},client9002);return _0x299349;}return null;})[_0xb71a('0x1f')](respondWithResult(_0x433d38,null))[_0xb71a('0x2a')](handleError(_0x433d38,null));}; \ No newline at end of file +var _0x1622=['agent','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','interaction','user','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','contact','User','fullname','email','internal','channel','event','EventManager','acceptmessage','RejectMessage','QueryTypes','SIP/%s','rejectmessage','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','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','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','request','then','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','sendStatus','name','send','index','map','OpenchannelMessage','type','key','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','rawAttributes','length','find','body','destroy','describe','openchannel-interactions','accept','openchannel','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId'];(function(_0x3dc29f,_0x3454f2){var _0x189d7c=function(_0x4e24f9){while(--_0x4e24f9){_0x3dc29f['push'](_0x3dc29f['shift']());}};_0x189d7c(++_0x3454f2);}(_0x1622,0x18b));var _0x2162=function(_0x42e694,_0x2bda04){_0x42e694=_0x42e694-0x0;var _0x16a539=_0x1622[_0x42e694];return _0x16a539;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2162('0x0'));var zipdir=require(_0x2162('0x1'));var jsonpatch=require(_0x2162('0x2'));var rp=require(_0x2162('0x3'));var moment=require(_0x2162('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2162('0x5'));var util=require('util');var path=require('path');var sox=require(_0x2162('0x6'));var csv=require(_0x2162('0x7'));var ejs=require(_0x2162('0x8'));var fs=require('fs');var fs_extra=require(_0x2162('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2162('0xa'));var toCsv=require('to-csv');var querystring=require(_0x2162('0xb'));var Papa=require(_0x2162('0xc'));var Redis=require(_0x2162('0xd'));var authService=require(_0x2162('0xe'));var qs=require(_0x2162('0xf'));var as=require(_0x2162('0x10'));var hardwareService=require(_0x2162('0x11'));var logger=require(_0x2162('0x12'))('api');var utils=require(_0x2162('0x13'));var config=require(_0x2162('0x14'));var licenseUtil=require(_0x2162('0x15'));var db=require(_0x2162('0x16'))['db'];config[_0x2162('0x17')]=_['defaults'](config[_0x2162('0x17')],{'host':_0x2162('0x18'),'port':0x18eb});var socket=require(_0x2162('0x19'))(new Redis(config[_0x2162('0x17')]));require(_0x2162('0x1a'))[_0x2162('0x1b')](socket);var jayson=require(_0x2162('0x1c'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x296322,_0x152f18,_0x9e7229,_0x5a63a5){return new BPromise(function(_0x54006a,_0x1952aa){var _0x4d72c8=_0x5a63a5||client;return _0x4d72c8[_0x2162('0x1d')](_0x296322,_0x9e7229)[_0x2162('0x1e')](function(_0xc3a42){logger['info'](_0x2162('0x1f'),_0x152f18,_0x2162('0x20'));logger['debug']('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x152f18,_0x2162('0x20'),JSON[_0x2162('0x21')](_0xc3a42));if(_0xc3a42[_0x2162('0x22')]){if(_0xc3a42[_0x2162('0x22')]['code']===0x1f4){logger[_0x2162('0x22')](_0x2162('0x1f'),_0x152f18,_0xc3a42['error'][_0x2162('0x23')]);return _0x1952aa(_0xc3a42[_0x2162('0x22')][_0x2162('0x23')]);}logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x152f18,_0xc3a42[_0x2162('0x22')][_0x2162('0x23')]);return _0x54006a(_0xc3a42['error'][_0x2162('0x23')]);}else{logger[_0x2162('0x24')](_0x2162('0x1f'),_0x152f18,_0x2162('0x20'));_0x54006a(_0xc3a42[_0x2162('0x25')][_0x2162('0x23')]);}})[_0x2162('0x26')](function(_0x16dddd){logger[_0x2162('0x22')](_0x2162('0x1f'),_0x152f18,_0x16dddd);_0x1952aa(_0x16dddd);});});}function respondWithStatusCode(_0x5565c5,_0x35f804){_0x35f804=_0x35f804||0xcc;return function(_0x45d4f7){if(_0x45d4f7){return _0x5565c5['sendStatus'](_0x35f804);}return _0x5565c5[_0x2162('0x27')](_0x35f804)[_0x2162('0x28')]();};}function respondWithResult(_0x30c5c6,_0x2a98d3){_0x2a98d3=_0x2a98d3||0xc8;return function(_0x11d0bc){if(_0x11d0bc){return _0x30c5c6[_0x2162('0x27')](_0x2a98d3)[_0x2162('0x29')](_0x11d0bc);}};}function respondWithFilteredResult(_0x583657,_0x289dbd){return function(_0x6cabf1){if(_0x6cabf1){var _0x4a5147=typeof _0x289dbd[_0x2162('0x2a')]===_0x2162('0x2b')&&typeof _0x289dbd[_0x2162('0x2c')]===_0x2162('0x2b');var _0x3fa077=_0x6cabf1[_0x2162('0x2d')];var _0x555f35=_0x4a5147?0x0:_0x289dbd[_0x2162('0x2a')];var _0x1ae39d=_0x4a5147?_0x6cabf1[_0x2162('0x2d')]:_0x289dbd[_0x2162('0x2a')]+_0x289dbd[_0x2162('0x2c')];var _0x3dd8f7;if(_0x1ae39d>=_0x3fa077){_0x1ae39d=_0x3fa077;_0x3dd8f7=0xc8;}else{_0x3dd8f7=0xce;}_0x583657['status'](_0x3dd8f7);return _0x583657[_0x2162('0x2e')](_0x2162('0x2f'),_0x555f35+'-'+_0x1ae39d+'/'+_0x3fa077)[_0x2162('0x29')](_0x6cabf1);}return null;};}function patchUpdates(_0x5e43d1){return function(_0x33a007){try{jsonpatch[_0x2162('0x30')](_0x33a007,_0x5e43d1,!![]);}catch(_0xf9f145){return BPromise[_0x2162('0x31')](_0xf9f145);}return _0x33a007['save']();};}function saveUpdates(_0x269d1d,_0x48f24f){return function(_0x5af20d){if(_0x5af20d){return _0x5af20d[_0x2162('0x32')](_0x269d1d)[_0x2162('0x1e')](function(_0x352dca){return _0x352dca;});}return null;};}function removeEntity(_0x2f40fa,_0x2095d2){return function(_0x172786){if(_0x172786){return _0x172786['destroy']()[_0x2162('0x1e')](function(){_0x2f40fa[_0x2162('0x27')](0xcc)[_0x2162('0x28')]();});}};}function handleEntityNotFound(_0x48ffcf,_0x5edb24){return function(_0x52cf44){if(!_0x52cf44){_0x48ffcf[_0x2162('0x33')](0x194);}return _0x52cf44;};}function handleError(_0x21277c,_0x3d865b){_0x3d865b=_0x3d865b||0x1f4;return function(_0x29f4dd){logger[_0x2162('0x22')](_0x29f4dd['stack']);if(_0x29f4dd[_0x2162('0x34')]){delete _0x29f4dd['name'];}_0x21277c['status'](_0x3d865b)[_0x2162('0x35')](_0x29f4dd);};}exports[_0x2162('0x36')]=function(_0x8e7548,_0x48cc60){var _0x2efb01={},_0x419868={},_0x529b9f={'count':0x0,'rows':[]};var _0x3c90c9=_[_0x2162('0x37')](db[_0x2162('0x38')]['rawAttributes'],function(_0x4803bc){return{'name':_0x4803bc['fieldName'],'type':_0x4803bc[_0x2162('0x39')][_0x2162('0x3a')]};});_0x419868[_0x2162('0x3b')]=_[_0x2162('0x37')](_0x3c90c9,_0x2162('0x34'));_0x419868[_0x2162('0x3c')]=_[_0x2162('0x3d')](_0x8e7548[_0x2162('0x3c')]);_0x419868['filters']=_['intersection'](_0x419868[_0x2162('0x3b')],_0x419868[_0x2162('0x3c')]);_0x2efb01[_0x2162('0x3e')]=_[_0x2162('0x3f')](_0x419868[_0x2162('0x3b')],qs[_0x2162('0x40')](_0x8e7548[_0x2162('0x3c')]['fields']));_0x2efb01[_0x2162('0x3e')]=_0x2efb01[_0x2162('0x3e')]['length']?_0x2efb01[_0x2162('0x3e')]:_0x419868[_0x2162('0x3b')];if(!_0x8e7548[_0x2162('0x3c')][_0x2162('0x41')](_0x2162('0x42'))){_0x2efb01['limit']=qs['limit'](_0x8e7548[_0x2162('0x3c')][_0x2162('0x2c')]);_0x2efb01[_0x2162('0x2a')]=qs[_0x2162('0x2a')](_0x8e7548[_0x2162('0x3c')]['offset']);}_0x2efb01['order']=qs[_0x2162('0x43')](_0x8e7548[_0x2162('0x3c')][_0x2162('0x43')]);_0x2efb01[_0x2162('0x44')]=qs[_0x2162('0x45')](_[_0x2162('0x46')](_0x8e7548[_0x2162('0x3c')],_0x419868[_0x2162('0x45')]),_0x3c90c9);if(_0x8e7548['query'][_0x2162('0x47')]){_0x2efb01['where']=_[_0x2162('0x48')](_0x2efb01['where'],{'$or':_[_0x2162('0x37')](_0x3c90c9,function(_0x4efed5){if(_0x4efed5[_0x2162('0x39')]!==_0x2162('0x49')){var _0x288f26={};_0x288f26[_0x4efed5[_0x2162('0x34')]]={'$like':'%'+_0x8e7548[_0x2162('0x3c')][_0x2162('0x47')]+'%'};return _0x288f26;}})});}_0x2efb01=_[_0x2162('0x48')]({},_0x2efb01,_0x8e7548[_0x2162('0x4a')]);var _0x4572f7={'where':_0x2efb01[_0x2162('0x44')]};return db[_0x2162('0x38')][_0x2162('0x2d')](_0x4572f7)['then'](function(_0x34cc45){_0x529b9f[_0x2162('0x2d')]=_0x34cc45;if(_0x8e7548[_0x2162('0x3c')][_0x2162('0x4b')]){_0x2efb01[_0x2162('0x4c')]=[{'all':!![]}];}return db[_0x2162('0x38')]['findAll'](_0x2efb01);})[_0x2162('0x1e')](function(_0x2f0630){_0x529b9f[_0x2162('0x4d')]=_0x2f0630;return _0x529b9f;})['then'](respondWithFilteredResult(_0x48cc60,_0x2efb01))[_0x2162('0x26')](handleError(_0x48cc60,null));};exports[_0x2162('0x4e')]=function(_0x19d456,_0x19a1fd){var _0xdbca5c={'raw':!![],'where':{'id':_0x19d456[_0x2162('0x4f')]['id']}},_0xea33b4={};_0xea33b4[_0x2162('0x3b')]=_[_0x2162('0x3d')](db[_0x2162('0x38')][_0x2162('0x50')]);_0xea33b4[_0x2162('0x3c')]=_[_0x2162('0x3d')](_0x19d456[_0x2162('0x3c')]);_0xea33b4['filters']=_[_0x2162('0x3f')](_0xea33b4[_0x2162('0x3b')],_0xea33b4['query']);_0xdbca5c[_0x2162('0x3e')]=_[_0x2162('0x3f')](_0xea33b4[_0x2162('0x3b')],qs[_0x2162('0x40')](_0x19d456['query']['fields']));_0xdbca5c[_0x2162('0x3e')]=_0xdbca5c[_0x2162('0x3e')][_0x2162('0x51')]?_0xdbca5c['attributes']:_0xea33b4[_0x2162('0x3b')];if(_0x19d456[_0x2162('0x3c')][_0x2162('0x4b')]){_0xdbca5c['include']=[{'all':!![]}];}_0xdbca5c=_['merge']({},_0xdbca5c,_0x19d456[_0x2162('0x4a')]);return db['OpenchannelMessage'][_0x2162('0x52')](_0xdbca5c)[_0x2162('0x1e')](handleEntityNotFound(_0x19a1fd,null))[_0x2162('0x1e')](respondWithResult(_0x19a1fd,null))[_0x2162('0x26')](handleError(_0x19a1fd,null));};exports['create']=function(_0x5de907,_0x1427c8){return db['OpenchannelMessage']['create'](_0x5de907[_0x2162('0x53')],{})[_0x2162('0x1e')](respondWithResult(_0x1427c8,0xc9))['catch'](handleError(_0x1427c8,null));};exports['update']=function(_0x6a6a19,_0x487050){if(_0x6a6a19[_0x2162('0x53')]['id']){delete _0x6a6a19[_0x2162('0x53')]['id'];}return db[_0x2162('0x38')][_0x2162('0x52')]({'where':{'id':_0x6a6a19[_0x2162('0x4f')]['id']}})[_0x2162('0x1e')](handleEntityNotFound(_0x487050,null))[_0x2162('0x1e')](saveUpdates(_0x6a6a19[_0x2162('0x53')],null))[_0x2162('0x1e')](respondWithResult(_0x487050,null))[_0x2162('0x26')](handleError(_0x487050,null));};exports[_0x2162('0x54')]=function(_0x39f225,_0x1bc414){return db['OpenchannelMessage'][_0x2162('0x52')]({'where':{'id':_0x39f225[_0x2162('0x4f')]['id']}})[_0x2162('0x1e')](handleEntityNotFound(_0x1bc414,null))[_0x2162('0x1e')](removeEntity(_0x1bc414,null))[_0x2162('0x26')](handleError(_0x1bc414,null));};exports[_0x2162('0x55')]=function(_0x195035,_0x12f11d){return db[_0x2162('0x38')]['describe']()[_0x2162('0x1e')](respondWithResult(_0x12f11d,null))[_0x2162('0x26')](handleError(_0x12f11d,null));};var interaction_log=require(_0x2162('0x12'))(_0x2162('0x56'));exports[_0x2162('0x57')]=function(_0xf8f979,_0x3dbcef,_0x56586b){var _0x4b5dc5={'agent':{},'channel':_0x2162('0x58')};if(_0xf8f979[_0x2162('0x53')]['id']){delete _0xf8f979[_0x2162('0x53')]['id'];}_0xf8f979[_0x2162('0x53')][_0x2162('0x59')]=!![];_0xf8f979['body']['readAt']=moment()[_0x2162('0x5a')](_0x2162('0x5b'));_0xf8f979[_0x2162('0x53')]['UserId']=_0xf8f979[_0x2162('0x53')][_0x2162('0x5c')]||_0xf8f979['user']['id'];_0x4b5dc5[_0x2162('0x5d')]['id']=_0xf8f979[_0x2162('0x53')][_0x2162('0x5c')];return db[_0x2162('0x38')][_0x2162('0x52')]({'where':{'id':_0xf8f979[_0x2162('0x4f')]['id'],'UserId':null}})[_0x2162('0x1e')](handleEntityNotFound(_0x3dbcef,null))['then'](saveUpdates(_0xf8f979['body'],null))['then'](function(_0x3da660){if(_0x3da660){_0x4b5dc5[_0x2162('0x23')]=_0x3da660[_0x2162('0x5e')]({'plain':!![]});return db[_0x2162('0x5f')]['find']({'where':{'id':_0x3da660[_0x2162('0x60')]}});}return null;})[_0x2162('0x1e')](handleEntityNotFound(_0x3dbcef,null))[_0x2162('0x1e')](function(_0x19ba60){if(_0x19ba60){return _0x19ba60[_0x2162('0x32')]({'UserId':_0xf8f979[_0x2162('0x53')][_0x2162('0x5c')],'read1stAt':_[_0x2162('0x61')](_0x19ba60[_0x2162('0x62')])?moment()['format'](_0x2162('0x5b')):undefined});}return null;})[_0x2162('0x1e')](function(_0x12b638){if(_0x12b638){_0x4b5dc5[_0x2162('0x63')]=_0x12b638[_0x2162('0x5e')]({'plain':!![]});interaction_log[_0x2162('0x24')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xf8f979[_0x2162('0x64')]['id'],_0xf8f979[_0x2162('0x64')]['name'],_0xf8f979[_0x2162('0x64')][_0x2162('0x65')],_0x4b5dc5['interaction']['id'],_0xf8f979['body']?JSON[_0x2162('0x21')](_0xf8f979[_0x2162('0x53')]):_0x2162('0x66'));return respondWithRpcPromise(_0x2162('0x67'),'acceptMessage',_0x4b5dc5);}return null;})[_0x2162('0x1e')](function(_0x3ac002){var _0x2db081=_0x2162('0x68')+_0x3ac002[_0x2162('0x23')][_0x2162('0x69')];return db[_0x2162('0x6a')][_0x2162('0x3c')](_0x2db081,{'type':db[_0x2162('0x6b')]['QueryTypes'][_0x2162('0x6c')],'raw':!![]})[_0x2162('0x1e')](function(_0x1851d8){return _0x1851d8;});})[_0x2162('0x1e')](function(_0x5f1cc1){if(_0x5f1cc1){_0x4b5dc5['message'][_0x2162('0x6d')]=_0x5f1cc1[0x0];if(!_0xf8f979[_0x2162('0x53')][_0x2162('0x5c')])return;return db[_0x2162('0x6e')]['find']({'where':{'id':_0xf8f979[_0x2162('0x53')][_0x2162('0x5c')],'role':_0x2162('0x5d')},'attributes':['id','name',_0x2162('0x6f'),_0x2162('0x70'),_0x2162('0x71')],'raw':!![]});}return null;})[_0x2162('0x1e')](function(_0x523474){if(!_0x523474)return null;_0x4b5dc5[_0x2162('0x23')]['agent']=_0x523474;return _0x4b5dc5;})[_0x2162('0x1e')](function(_0x5c7722){if(_0x5c7722){if(_0xf8f979['body']['manual']){_0x4b5dc5[_0x2162('0x23')]['interface']=util['format']('SIP/%s',_0xf8f979['user']['name']);_0x4b5dc5[_0x2162('0x23')][_0x2162('0x72')]=_0x4b5dc5[_0x2162('0x72')];_0x4b5dc5[_0x2162('0x23')]['motionChannel']=_0x4b5dc5['channel'];_0x4b5dc5[_0x2162('0x23')][_0x2162('0x73')]='accept';return respondWithRpcPromise(_0x2162('0x74'),'EventManager',{'event':_0x2162('0x75'),'message':_0x4b5dc5['message']},client9002)[_0x2162('0x1e')](function(){return _0x4b5dc5;});}return _0x4b5dc5;}return null;})[_0x2162('0x1e')](respondWithResult(_0x3dbcef,null))['catch'](handleError(_0x3dbcef,null));};var interaction_log=require(_0x2162('0x12'))(_0x2162('0x56'));exports[_0x2162('0x31')]=function(_0x550b32,_0x4e7970,_0x1f54bd){var _0x4cfe0e={'agent':{},'channel':_0x2162('0x58')};if(_0x550b32[_0x2162('0x53')]['id']){delete _0x550b32[_0x2162('0x53')]['id'];}_0x550b32[_0x2162('0x53')][_0x2162('0x5c')]=_0x550b32[_0x2162('0x53')][_0x2162('0x5c')]||_0x550b32[_0x2162('0x64')]['id'];_0x4cfe0e[_0x2162('0x5d')]['id']=_0x550b32[_0x2162('0x53')][_0x2162('0x5c')];return db['OpenchannelMessage'][_0x2162('0x52')]({'where':{'id':_0x550b32['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4e7970,null))['then'](function(_0x1c8724){if(_0x1c8724){_0x4cfe0e[_0x2162('0x23')]=_0x1c8724[_0x2162('0x5e')]({'plain':!![]});return db['OpenchannelInteraction'][_0x2162('0x52')]({'where':{'id':_0x1c8724[_0x2162('0x60')]}});}return null;})['then'](handleEntityNotFound(_0x4e7970,null))[_0x2162('0x1e')](function(_0x1c8254){if(_0x1c8254){_0x4cfe0e[_0x2162('0x63')]=_0x1c8254[_0x2162('0x5e')]({'plain':!![]});interaction_log[_0x2162('0x24')]('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x550b32[_0x2162('0x64')]['id'],_0x550b32[_0x2162('0x64')][_0x2162('0x34')],_0x550b32[_0x2162('0x64')][_0x2162('0x65')],_0x4cfe0e['interaction']['id'],_0x550b32[_0x2162('0x53')]?JSON[_0x2162('0x21')](_0x550b32[_0x2162('0x53')]):_0x2162('0x66'));return respondWithRpcPromise(_0x2162('0x76'),'rejectMessage',_0x4cfe0e);}return null;})[_0x2162('0x1e')](function(_0x42d57e){var _0x40f5ae=_0x2162('0x68')+_0x42d57e[_0x2162('0x23')][_0x2162('0x69')];return db[_0x2162('0x6a')]['query'](_0x40f5ae,{'type':db[_0x2162('0x6b')][_0x2162('0x77')][_0x2162('0x6c')],'raw':!![]})['then'](function(_0x1a3373){return _0x1a3373;});})[_0x2162('0x1e')](function(_0x3ba26b){if(_0x3ba26b){_0x4cfe0e[_0x2162('0x23')]['contact']=_0x3ba26b[0x0];if(!_0x550b32[_0x2162('0x53')]['UserId'])return;return db[_0x2162('0x6e')][_0x2162('0x52')]({'where':{'id':_0x550b32[_0x2162('0x53')][_0x2162('0x5c')],'role':_0x2162('0x5d')},'attributes':['id',_0x2162('0x34'),'fullname',_0x2162('0x70'),_0x2162('0x71')],'raw':!![]});}return null;})['then'](function(_0x16cc1c){if(!_0x16cc1c)return null;_0x4cfe0e[_0x2162('0x23')]['agent']=_0x16cc1c;return _0x4cfe0e;})['then'](function(_0xd964ef){if(_0xd964ef){_0xd964ef[_0x2162('0x23')]['interface']=util['format'](_0x2162('0x78'),_0x550b32[_0x2162('0x64')]['name']);_0xd964ef[_0x2162('0x23')][_0x2162('0x72')]=_0x4cfe0e[_0x2162('0x72')];_0xd964ef[_0x2162('0x23')]['motionChannel']=_0x4cfe0e[_0x2162('0x72')];_0xd964ef[_0x2162('0x23')][_0x2162('0x73')]=_0x2162('0x31');respondWithRpcPromise(_0x2162('0x74'),_0x2162('0x74'),{'event':_0x2162('0x79'),'message':_0xd964ef[_0x2162('0x23')]},client9002);return _0x4cfe0e;}return null;})[_0x2162('0x1e')](respondWithResult(_0x4e7970,null))[_0x2162('0x26')](handleError(_0x4e7970,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 49e99e7..74cc6ff 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 _0x79ed=['emit','hasOwnProperty','exports','../../mysqldb','OpenchannelMessage','setMaxListeners','save','remove'];(function(_0x243217,_0x522951){var _0x478029=function(_0x18d053){while(--_0x18d053){_0x243217['push'](_0x243217['shift']());}};_0x478029(++_0x522951);}(_0x79ed,0x193));var _0xd79e=function(_0x216eeb,_0x1d4d7e){_0x216eeb=_0x216eeb-0x0;var _0x1af5ab=_0x79ed[_0x216eeb];return _0x1af5ab;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0xd79e('0x0'))['db'][_0xd79e('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xd79e('0x2')](0x0);var events={'afterCreate':_0xd79e('0x3'),'afterUpdate':'update','afterDestroy':_0xd79e('0x4')};function emitEvent(_0x17c8b9){return function(_0x2b89f0,_0x1d11e7,_0x515bd5){OpenchannelMessageEvents[_0xd79e('0x5')](_0x17c8b9+':'+_0x2b89f0['id'],_0x2b89f0);OpenchannelMessageEvents[_0xd79e('0x5')](_0x17c8b9,_0x2b89f0);_0x515bd5(null);};}for(var e in events){if(events[_0xd79e('0x6')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0xd79e('0x7')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x75ea=['exports','setMaxListeners','update','remove','emit'];(function(_0x465019,_0x4475eb){var _0x9127eb=function(_0x1f1042){while(--_0x1f1042){_0x465019['push'](_0x465019['shift']());}};_0x9127eb(++_0x4475eb);}(_0x75ea,0x14b));var _0xa75e=function(_0x4f55c7,_0x287ffe){_0x4f55c7=_0x4f55c7-0x0;var _0x407c7c=_0x75ea[_0x4f55c7];return _0x407c7c;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require('../../mysqldb')['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xa75e('0x0')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa75e('0x1'),'afterDestroy':_0xa75e('0x2')};function emitEvent(_0x3bd3ee){return function(_0x4c0f18,_0x393ff4,_0x44d895){OpenchannelMessageEvents['emit'](_0x3bd3ee+':'+_0x4c0f18['id'],_0x4c0f18);OpenchannelMessageEvents[_0xa75e('0x3')](_0x3bd3ee,_0x4c0f18);_0x44d895(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0xa75e('0x4')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 7b14efc..6732194 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 _0x6e6c=['util','api','moment','path','../../config/environment','exports','define','OpenchannelMessage','fti_openchannel_messages','body','models','get','direction','toLowerCase','secret','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','update','createdAt','error','out','find','OpenchannelAccountId','Interactions','CmContact','Contact','keys','then','replyUri','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','POST','method','info','Message\x20%d\x20forwarded\x20to\x20%s','threadId','catch','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x399da2,_0x3fa505){var _0x3408f6=function(_0x3c6a45){while(--_0x3c6a45){_0x399da2['push'](_0x399da2['shift']());}};_0x3408f6(++_0x3fa505);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x6e6c[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0xc6e6('0x0'));var util=require(_0xc6e6('0x1'));var logger=require('../../config/logger')(_0xc6e6('0x2'));var moment=require(_0xc6e6('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc6e6('0x4'));var rimraf=require('rimraf');var config=require(_0xc6e6('0x5'));var attributes=require('./openchannelMessage.attributes');module[_0xc6e6('0x6')]=function(_0x1182c7,_0x4bf906){return _0x1182c7[_0xc6e6('0x7')](_0xc6e6('0x8'),attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0xc6e6('0x9'),'fields':[_0xc6e6('0xa')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x324f05,_0x481799,_0x172aa9){var _0x3b2f50=_0x1182c7[_0xc6e6('0xb')];var _0x3ddf6f=_0x324f05[_0xc6e6('0xc')]({'plain':!![]});if(_0x3ddf6f[_0xc6e6('0xd')][_0xc6e6('0xe')]()==='in'||_0x3ddf6f[_0xc6e6('0xd')][_0xc6e6('0xe')]()==='out'&&!_0x3ddf6f[_0xc6e6('0xf')]&&!_['isNil'](_0x3ddf6f[_0xc6e6('0x10')])){_0x3b2f50[_0xc6e6('0x11')][_0xc6e6('0x12')]({'where':{'id':_0x3ddf6f[_0xc6e6('0x13')]}})['then'](function(_0x149ac6){if(_0x149ac6){_0x149ac6[_0xc6e6('0x14')]({'lastMsgAt':_0x3ddf6f[_0xc6e6('0x15')],'lastMsgDirection':_0x3ddf6f[_0xc6e6('0xd')][_0xc6e6('0xe')]()});}})['catch'](function(_0x413cf8){console[_0xc6e6('0x16')](_0x413cf8);});}if(_0x3ddf6f['direction']===_0xc6e6('0x17')&&!_0x3ddf6f[_0xc6e6('0xf')]){var _0xedf127;_0x3b2f50['CmContact']['describe']()['then'](function(_0x3a1ccc){return _0x3b2f50['OpenchannelAccount'][_0xc6e6('0x18')]({'where':{'id':_0x3ddf6f[_0xc6e6('0x19')]},'include':[{'model':_0x3b2f50[_0xc6e6('0x11')],'as':_0xc6e6('0x1a'),'where':{'id':_0x3ddf6f[_0xc6e6('0x13')]},'limit':0x1,'include':[{'model':_0x3b2f50[_0xc6e6('0x1b')],'as':_0xc6e6('0x1c'),'attributes':_[_0xc6e6('0x1d')](_0x3a1ccc)}]}]});})[_0xc6e6('0x1e')](function(_0x3d734d){_0xedf127=_0x3d734d['get']({'plain':!![]});if(_0xedf127&&_0xedf127[_0xc6e6('0x1f')]){logger['info'](_0xc6e6('0x20'),_0xc6e6('0x21'),util[_0xc6e6('0x22')](_0xc6e6('0x23'),_0x3ddf6f['id'],_0xedf127['replyUri']));if(_0xedf127[_0xc6e6('0x1a')]&&_0xedf127[_0xc6e6('0x1a')][_0xc6e6('0x24')]){_0x3ddf6f[_0xc6e6('0x25')]=_[_0xc6e6('0x26')](_0xedf127['Interactions'][0x0],_0xc6e6('0x1c'));_0x3ddf6f['Contact']=_0xedf127[_0xc6e6('0x1a')][0x0][_0xc6e6('0x1c')];}var _0x481799={'method':_0xc6e6('0x27'),'uri':encodeURI(_0xedf127['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x481799[_0xc6e6('0x28')]){case'GET':_0x481799['qs']=_0x3ddf6f;break;case _0xc6e6('0x27'):_0x481799['body']=_0x3ddf6f;break;}return rp(_0x481799)[_0xc6e6('0x1e')](function(_0x16dcd9){logger[_0xc6e6('0x29')](_0xc6e6('0x20'),_0xc6e6('0x21'),util['format'](_0xc6e6('0x2a'),_0x3ddf6f['id'],_0xedf127[_0xc6e6('0x1f')]));if(_0x16dcd9[_0xc6e6('0xa')][_0xc6e6('0x2b')]&&_0x16dcd9['body'][_0xc6e6('0x2b')]!=_0x3ddf6f['Interaction'][_0xc6e6('0x2b')]){return _0x3b2f50[_0xc6e6('0x11')][_0xc6e6('0x14')]({'threadId':_0x16dcd9[_0xc6e6('0xa')][_0xc6e6('0x2b')]},{'logging':!![],'where':{'id':_0x3ddf6f[_0xc6e6('0x25')]['id']}});}else{return;}})[_0xc6e6('0x1e')](function(){return _0x324f05[_0xc6e6('0x14')]({'read':!![]});})[_0xc6e6('0x2c')](function(_0x1eb477){logger[_0xc6e6('0x16')](_0xc6e6('0x20'),_0xc6e6('0x21'),util[_0xc6e6('0x2d')](_0x1eb477,{'showHidden':![],'depth':null}));_0x172aa9();});}else{_0x172aa9();}})[_0xc6e6('0x2e')](function(){_0x172aa9();});}else{_0x172aa9();}}},'charset':_0xc6e6('0x2f'),'collate':_0xc6e6('0x30')});}; \ No newline at end of file +var _0xd4a2=['OpenchannelInteractionId','then','createdAt','toLowerCase','catch','error','describe','OpenchannelAccount','Interactions','CmContact','Contact','keys','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','method','POST','threadId','update','inspect','finally','utf8mb4','lodash','api','bluebird','path','../../config/environment','./openchannelMessage.attributes','exports','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','get','direction','out','secret','isNil','UserId','OpenchannelInteraction','findOne'];(function(_0x583887,_0x166ee0){var _0x4934af=function(_0x5e13a4){while(--_0x5e13a4){_0x583887['push'](_0x583887['shift']());}};_0x4934af(++_0x166ee0);}(_0xd4a2,0x173));var _0x2d4a=function(_0x5b2e49,_0x2ee38e){_0x5b2e49=_0x5b2e49-0x0;var _0x501efa=_0xd4a2[_0x5b2e49];return _0x501efa;};'use strict';var _=require(_0x2d4a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2d4a('0x1'));var moment=require('moment');var BPromise=require(_0x2d4a('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2d4a('0x3'));var rimraf=require('rimraf');var config=require(_0x2d4a('0x4'));var attributes=require(_0x2d4a('0x5'));module[_0x2d4a('0x6')]=function(_0x3a88e2,_0x1ca10b){return _0x3a88e2['define'](_0x2d4a('0x7'),attributes,{'tableName':_0x2d4a('0x8'),'paranoid':![],'indexes':[{'name':_0x2d4a('0x9'),'fields':[_0x2d4a('0xa')],'type':_0x2d4a('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x535b2f,_0xb9f016,_0x113839){var _0x33b786=_0x3a88e2[_0x2d4a('0xc')];var _0x3abbbd=_0x535b2f[_0x2d4a('0xd')]({'plain':!![]});if(_0x3abbbd['direction']['toLowerCase']()==='in'||_0x3abbbd[_0x2d4a('0xe')]['toLowerCase']()===_0x2d4a('0xf')&&!_0x3abbbd[_0x2d4a('0x10')]&&!_[_0x2d4a('0x11')](_0x3abbbd[_0x2d4a('0x12')])){_0x33b786[_0x2d4a('0x13')][_0x2d4a('0x14')]({'where':{'id':_0x3abbbd[_0x2d4a('0x15')]}})[_0x2d4a('0x16')](function(_0x544622){if(_0x544622){_0x544622['update']({'lastMsgAt':_0x3abbbd[_0x2d4a('0x17')],'lastMsgDirection':_0x3abbbd['direction'][_0x2d4a('0x18')]()});}})[_0x2d4a('0x19')](function(_0x11896d){console[_0x2d4a('0x1a')](_0x11896d);});}if(_0x3abbbd['direction']===_0x2d4a('0xf')&&!_0x3abbbd['secret']){var _0x2838fa;_0x33b786['CmContact'][_0x2d4a('0x1b')]()[_0x2d4a('0x16')](function(_0x2188b2){return _0x33b786[_0x2d4a('0x1c')]['find']({'where':{'id':_0x3abbbd['OpenchannelAccountId']},'include':[{'model':_0x33b786['OpenchannelInteraction'],'as':_0x2d4a('0x1d'),'where':{'id':_0x3abbbd[_0x2d4a('0x15')]},'limit':0x1,'include':[{'model':_0x33b786[_0x2d4a('0x1e')],'as':_0x2d4a('0x1f'),'attributes':_[_0x2d4a('0x20')](_0x2188b2)}]}]});})[_0x2d4a('0x16')](function(_0x56445a){_0x2838fa=_0x56445a['get']({'plain':!![]});if(_0x2838fa&&_0x2838fa[_0x2d4a('0x21')]){logger[_0x2d4a('0x22')](_0x2d4a('0x23'),_0x2d4a('0x24'),util[_0x2d4a('0x25')](_0x2d4a('0x26'),_0x3abbbd['id'],_0x2838fa[_0x2d4a('0x21')]));if(_0x2838fa[_0x2d4a('0x1d')]&&_0x2838fa['Interactions'][_0x2d4a('0x27')]){_0x3abbbd[_0x2d4a('0x28')]=_[_0x2d4a('0x29')](_0x2838fa[_0x2d4a('0x1d')][0x0],_0x2d4a('0x1f'));_0x3abbbd[_0x2d4a('0x1f')]=_0x2838fa[_0x2d4a('0x1d')][0x0][_0x2d4a('0x1f')];}var _0xb9f016={'method':'POST','uri':encodeURI(_0x2838fa['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0xb9f016[_0x2d4a('0x2a')]){case'GET':_0xb9f016['qs']=_0x3abbbd;break;case _0x2d4a('0x2b'):_0xb9f016[_0x2d4a('0xa')]=_0x3abbbd;break;}return rp(_0xb9f016)[_0x2d4a('0x16')](function(_0x1d2fa6){logger[_0x2d4a('0x22')](_0x2d4a('0x23'),_0x2d4a('0x24'),util[_0x2d4a('0x25')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x3abbbd['id'],_0x2838fa[_0x2d4a('0x21')]));if(_0x1d2fa6['body'][_0x2d4a('0x2c')]&&_0x1d2fa6[_0x2d4a('0xa')][_0x2d4a('0x2c')]!=_0x3abbbd[_0x2d4a('0x28')][_0x2d4a('0x2c')]){return _0x33b786[_0x2d4a('0x13')][_0x2d4a('0x2d')]({'threadId':_0x1d2fa6[_0x2d4a('0xa')]['threadId']},{'logging':!![],'where':{'id':_0x3abbbd[_0x2d4a('0x28')]['id']}});}else{return;}})[_0x2d4a('0x16')](function(){return _0x535b2f[_0x2d4a('0x2d')]({'read':!![]});})[_0x2d4a('0x19')](function(_0x2b66af){logger['error'](_0x2d4a('0x23'),_0x2d4a('0x24'),util[_0x2d4a('0x2e')](_0x2b66af,{'showHidden':![],'depth':null}));_0x113839();});}else{_0x113839();}})[_0x2d4a('0x2f')](function(){_0x113839();});}else{_0x113839();}}},'charset':_0x2d4a('0x30'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index df0a95f..7d82519 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(_0x392c53,_0x2ada7c){var _0x10216a=function(_0x58d78a){while(--_0x58d78a){_0x392c53['push'](_0x392c53['shift']());}};_0x10216a(++_0x2ada7c);}(_0x5f66,0x1a0));var _0x65f6=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x5f66[_0x126558];return _0x1f6d14;};'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 _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(_0x2597b3,_0x2c905a){var _0x42a9b5=function(_0x4adb43){while(--_0x4adb43){_0x2597b3['push'](_0x2597b3['shift']());}};_0x42a9b5(++_0x2c905a);}(_0x5f66,0x1a0));var _0x65f6=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x5f66[_0x432682];return _0x463d05;};'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 diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 8c61e47..a184dbf 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 _0x3e6d=['length','save','remove','update','emit','register'];(function(_0x35b07d,_0x3d0ae7){var _0x2868bc=function(_0xd8ef42){while(--_0xd8ef42){_0x35b07d['push'](_0x35b07d['shift']());}};_0x2868bc(++_0x3d0ae7);}(_0x3e6d,0x187));var _0xd3e6=function(_0x24b2e0,_0x59e72b){_0x24b2e0=_0x24b2e0-0x0;var _0x5bc0fa=_0x3e6d[_0x24b2e0];return _0x5bc0fa;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=[_0xd3e6('0x0'),_0xd3e6('0x1'),_0xd3e6('0x2')];function createListener(_0x1d7b91,_0x4c27e3){return function(_0x35714f){_0x4c27e3[_0xd3e6('0x3')](_0x1d7b91,_0x35714f);};}function removeListener(_0x1dbbf0,_0x3b0b26){return function(){OpenchannelMessageEvents['removeListener'](_0x1dbbf0,_0x3b0b26);};}exports[_0xd3e6('0x4')]=function(_0x108e97){for(var _0x171231=0x0,_0x126e04=events[_0xd3e6('0x5')];_0x171231<_0x126e04;_0x171231++){var _0x768d4=events[_0x171231];var _0x12b32a=createListener('openchannelMessage:'+_0x768d4,_0x108e97);OpenchannelMessageEvents['on'](_0x768d4,_0x12b32a);}}; \ No newline at end of file +var _0x8802=['./openchannelMessage.events','remove','emit','removeListener','register','length'];(function(_0x53a5e8,_0x40041f){var _0xbe7394=function(_0x41459e){while(--_0x41459e){_0x53a5e8['push'](_0x53a5e8['shift']());}};_0xbe7394(++_0x40041f);}(_0x8802,0x7e));var _0x2880=function(_0x17ac5b,_0x1a2d16){_0x17ac5b=_0x17ac5b-0x0;var _0x2dcec9=_0x8802[_0x17ac5b];return _0x2dcec9;};'use strict';var OpenchannelMessageEvents=require(_0x2880('0x0'));var events=['save',_0x2880('0x1'),'update'];function createListener(_0x2c4d85,_0x47210e){return function(_0x21beb3){_0x47210e[_0x2880('0x2')](_0x2c4d85,_0x21beb3);};}function removeListener(_0x9a7dcc,_0xf47dec){return function(){OpenchannelMessageEvents[_0x2880('0x3')](_0x9a7dcc,_0xf47dec);};}exports[_0x2880('0x4')]=function(_0x19be07){for(var _0x10d734=0x0,_0xc45306=events[_0x2880('0x5')];_0x10d734<_0xc45306;_0x10d734++){var _0x1e4eb6=events[_0x10d734];var _0x1142a3=createListener('openchannelMessage:'+_0x1e4eb6,_0x19be07);OpenchannelMessageEvents['on'](_0x1e4eb6,_0x1142a3);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 6e0749e..b0c6b33 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 _0x8f67=['post','create','addTeams','/:id/users','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/:id/members','/:id/teams','getTeams','getAgents'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0x8f67,0xac));var _0x78f6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8f67[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x78f6('0x0'));var util=require(_0x78f6('0x1'));var path=require(_0x78f6('0x2'));var timeout=require(_0x78f6('0x3'));var express=require(_0x78f6('0x4'));var router=express[_0x78f6('0x5')]();var fs_extra=require(_0x78f6('0x6'));var auth=require(_0x78f6('0x7'));var interaction=require(_0x78f6('0x8'));var config=require(_0x78f6('0x9'));var controller=require('./openchannelQueue.controller');router[_0x78f6('0xa')]('/',auth[_0x78f6('0xb')](),controller[_0x78f6('0xc')]);router[_0x78f6('0xa')](_0x78f6('0xd'),auth[_0x78f6('0xb')](),controller['describe']);router[_0x78f6('0xa')](_0x78f6('0xe'),auth[_0x78f6('0xb')](),controller[_0x78f6('0xf')]);router[_0x78f6('0xa')](_0x78f6('0x10'),auth[_0x78f6('0xb')](),controller['getMembers']);router['get'](_0x78f6('0x11'),auth[_0x78f6('0xb')](),controller[_0x78f6('0x12')]);router[_0x78f6('0xa')]('/:id/users',auth['isAuthenticated'](),controller[_0x78f6('0x13')]);router[_0x78f6('0x14')]('/',auth[_0x78f6('0xb')](),controller[_0x78f6('0x15')]);router[_0x78f6('0x14')]('/:id/teams',auth[_0x78f6('0xb')](),controller[_0x78f6('0x16')]);router[_0x78f6('0x14')](_0x78f6('0x17'),auth[_0x78f6('0xb')](),controller[_0x78f6('0x18')]);router[_0x78f6('0x19')](_0x78f6('0xe'),auth[_0x78f6('0xb')](),controller[_0x78f6('0x1a')]);router[_0x78f6('0x1b')](_0x78f6('0xe'),auth['isAuthenticated'](),controller[_0x78f6('0x1c')]);router[_0x78f6('0x1b')](_0x78f6('0x11'),auth['isAuthenticated'](),controller[_0x78f6('0x1d')]);router['delete']('/:id/users',auth[_0x78f6('0xb')](),controller[_0x78f6('0x1e')]);module[_0x78f6('0x1f')]=router; \ No newline at end of file +var _0xc731=['/:id/members','/:id/teams','getTeams','/:id/users','addTeams','put','delete','removeTeams','removeAgents','path','connect-timeout','express','Router','fs-extra','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x4c9bb9,_0x5e0b46){var _0x437c20=function(_0x3eb3fa){while(--_0x3eb3fa){_0x4c9bb9['push'](_0x4c9bb9['shift']());}};_0x437c20(++_0x5e0b46);}(_0xc731,0x87));var _0x1c73=function(_0x5f1254,_0x5de734){_0x5f1254=_0x5f1254-0x0;var _0x427806=_0xc731[_0x5f1254];return _0x427806;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1c73('0x0'));var timeout=require(_0x1c73('0x1'));var express=require(_0x1c73('0x2'));var router=express[_0x1c73('0x3')]();var fs_extra=require(_0x1c73('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1c73('0x5'));var controller=require('./openchannelQueue.controller');router[_0x1c73('0x6')]('/',auth[_0x1c73('0x7')](),controller[_0x1c73('0x8')]);router['get'](_0x1c73('0x9'),auth['isAuthenticated'](),controller[_0x1c73('0xa')]);router['get'](_0x1c73('0xb'),auth[_0x1c73('0x7')](),controller['show']);router[_0x1c73('0x6')](_0x1c73('0xc'),auth[_0x1c73('0x7')](),controller['getMembers']);router[_0x1c73('0x6')](_0x1c73('0xd'),auth['isAuthenticated'](),controller[_0x1c73('0xe')]);router[_0x1c73('0x6')](_0x1c73('0xf'),auth[_0x1c73('0x7')](),controller['getAgents']);router['post']('/',auth[_0x1c73('0x7')](),controller['create']);router['post'](_0x1c73('0xd'),auth[_0x1c73('0x7')](),controller[_0x1c73('0x10')]);router['post'](_0x1c73('0xf'),auth[_0x1c73('0x7')](),controller['addAgents']);router[_0x1c73('0x11')](_0x1c73('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x1c73('0x12')](_0x1c73('0xb'),auth[_0x1c73('0x7')](),controller['destroy']);router[_0x1c73('0x12')](_0x1c73('0xd'),auth[_0x1c73('0x7')](),controller[_0x1c73('0x13')]);router['delete'](_0x1c73('0xf'),auth['isAuthenticated'](),controller[_0x1c73('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index fdb7c93..e185264 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 _0x90da=['STRING','ENUM','rrmemory','beepall','roundrobin','exports'];(function(_0x3338ae,_0x377968){var _0x1a5dd1=function(_0x2185e7){while(--_0x2185e7){_0x3338ae['push'](_0x3338ae['shift']());}};_0x1a5dd1(++_0x377968);}(_0x90da,0x1b5));var _0xa90d=function(_0xd46820,_0x1b6305){_0xd46820=_0xd46820-0x0;var _0x34dffc=_0x90da[_0xd46820];return _0x34dffc;};'use strict';var Sequelize=require('sequelize');module[_0xa90d('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa90d('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa90d('0x2')](_0xa90d('0x3'),_0xa90d('0x4'),_0xa90d('0x5'))}}; \ No newline at end of file +var _0x16bb=['sequelize','name','INTEGER','ENUM','rrmemory','beepall'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x16bb,0xb4));var _0xb16b=function(_0x20b0fb,_0x1ef6a5){_0x20b0fb=_0x20b0fb-0x0;var _0x4d44b0=_0x16bb[_0x20b0fb];return _0x4d44b0;};'use strict';var Sequelize=require(_0xb16b('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xb16b('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xb16b('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xb16b('0x3')](_0xb16b('0x4'),_0xb16b('0x5'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 035c2fc..e4365d3 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 _0x02a3=['type','model','keys','query','intersection','attributes','fields','length','nolimit','order','sort','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','show','params','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','UserOpenchannelQueue','hasOwnProperty','where','OpenchannelQueueId','findAndCountAll','UserId','agent','openchannelPause','updatedAt','createdAt','format','%s/%s','SIP','Team','ids','User','Agents','voicePause','interface','flatMap','sequelize','transaction','addTeams','findOrCreate','forEach','emit','userOpenchannelQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_openchannel_queues','join','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','toString','QueryTypes','every','includes','union','compact','value','isEmpty','userOpenchannelQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','zip-dir','fast-json-patch','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/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','count','limit','apply','save','then','get','OpenchannelQueues','UserProfileResource','destroy','error','stack','name','send','map','OpenchannelQueue','rawAttributes','fieldName'];(function(_0xa4b8e1,_0x49d30b){var _0x507e42=function(_0xca2abc){while(--_0xca2abc){_0xa4b8e1['push'](_0xa4b8e1['shift']());}};_0x507e42(++_0x49d30b);}(_0x02a3,0xe6));var _0x302a=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x02a3[_0x19950b];return _0x3c6b41;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x302a('0x0'));var jsonpatch=require(_0x302a('0x1'));var rp=require('request-promise');var moment=require(_0x302a('0x2'));var BPromise=require(_0x302a('0x3'));var Mustache=require(_0x302a('0x4'));var util=require(_0x302a('0x5'));var path=require(_0x302a('0x6'));var sox=require(_0x302a('0x7'));var csv=require(_0x302a('0x8'));var ejs=require(_0x302a('0x9'));var fs=require('fs');var fs_extra=require(_0x302a('0xa'));var _=require(_0x302a('0xb'));var squel=require(_0x302a('0xc'));var crypto=require(_0x302a('0xd'));var jsforce=require(_0x302a('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x302a('0x8'));var querystring=require(_0x302a('0xf'));var Papa=require(_0x302a('0x10'));var Redis=require(_0x302a('0x11'));var authService=require(_0x302a('0x12'));var qs=require(_0x302a('0x13'));var as=require(_0x302a('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x302a('0x15'))(_0x302a('0x16'));var utils=require(_0x302a('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x302a('0x18'));var db=require(_0x302a('0x19'))['db'];config[_0x302a('0x1a')]=_[_0x302a('0x1b')](config['redis'],{'host':_0x302a('0x1c'),'port':0x18eb});var socket=require(_0x302a('0x1d'))(new Redis(config[_0x302a('0x1a')]));require('./openchannelQueue.socket')[_0x302a('0x1e')](socket);function respondWithStatusCode(_0x51ca67,_0x4d9bed){_0x4d9bed=_0x4d9bed||0xcc;return function(_0x28a3d9){if(_0x28a3d9){return _0x51ca67[_0x302a('0x1f')](_0x4d9bed);}return _0x51ca67[_0x302a('0x20')](_0x4d9bed)[_0x302a('0x21')]();};}function respondWithResult(_0x4752d1,_0x501038){_0x501038=_0x501038||0xc8;return function(_0x574ed6){if(_0x574ed6){return _0x4752d1[_0x302a('0x20')](_0x501038)[_0x302a('0x22')](_0x574ed6);}};}function respondWithFilteredResult(_0xc17ee2,_0x21b420){return function(_0x7e4d66){if(_0x7e4d66){var _0x4e3b7e=typeof _0x21b420[_0x302a('0x23')]==='undefined'&&typeof _0x21b420['limit']===_0x302a('0x24');var _0x511d00=_0x7e4d66[_0x302a('0x25')];var _0x318931=_0x4e3b7e?0x0:_0x21b420[_0x302a('0x23')];var _0x32139e=_0x4e3b7e?_0x7e4d66[_0x302a('0x25')]:_0x21b420[_0x302a('0x23')]+_0x21b420[_0x302a('0x26')];var _0x175e9b;if(_0x32139e>=_0x511d00){_0x32139e=_0x511d00;_0x175e9b=0xc8;}else{_0x175e9b=0xce;}_0xc17ee2[_0x302a('0x20')](_0x175e9b);return _0xc17ee2['set']('Content-Range',_0x318931+'-'+_0x32139e+'/'+_0x511d00)[_0x302a('0x22')](_0x7e4d66);}return null;};}function patchUpdates(_0x25833a){return function(_0x286c64){try{jsonpatch[_0x302a('0x27')](_0x286c64,_0x25833a,!![]);}catch(_0x1c8287){return BPromise['reject'](_0x1c8287);}return _0x286c64[_0x302a('0x28')]();};}function saveUpdates(_0x27b9f9,_0xeddb38){return function(_0x4605c2){if(_0x4605c2){return _0x4605c2['update'](_0x27b9f9)['then'](function(_0x189c12){return _0x189c12;});}return null;};}function removeEntity(_0x37285b,_0x86ccb2){return function(_0x56f12f){if(_0x56f12f){return _0x56f12f['destroy']()[_0x302a('0x29')](function(){var _0x2fe715=_0x56f12f[_0x302a('0x2a')]({'plain':!![]});var _0x375309=_0x302a('0x2b');return db[_0x302a('0x2c')][_0x302a('0x2d')]({'where':{'type':_0x375309,'resourceId':_0x2fe715['id']}})[_0x302a('0x29')](function(){return _0x56f12f;});})[_0x302a('0x29')](function(){_0x37285b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b2ae7,_0x1c7a29){return function(_0x3f0053){if(!_0x3f0053){_0x3b2ae7[_0x302a('0x1f')](0x194);}return _0x3f0053;};}function handleError(_0x18a110,_0x9448a9){_0x9448a9=_0x9448a9||0x1f4;return function(_0x32123a){logger[_0x302a('0x2e')](_0x32123a[_0x302a('0x2f')]);if(_0x32123a[_0x302a('0x30')]){delete _0x32123a[_0x302a('0x30')];}_0x18a110['status'](_0x9448a9)[_0x302a('0x31')](_0x32123a);};}exports['index']=function(_0x3419f0,_0x2e2a3f){var _0xf7365={},_0x3af8ac={},_0x2c3093={'count':0x0,'rows':[]};var _0x579f12=_[_0x302a('0x32')](db[_0x302a('0x33')][_0x302a('0x34')],function(_0x31c80a){return{'name':_0x31c80a[_0x302a('0x35')],'type':_0x31c80a[_0x302a('0x36')]['key']};});_0x3af8ac[_0x302a('0x37')]=_[_0x302a('0x32')](_0x579f12,_0x302a('0x30'));_0x3af8ac['query']=_[_0x302a('0x38')](_0x3419f0[_0x302a('0x39')]);_0x3af8ac['filters']=_[_0x302a('0x3a')](_0x3af8ac[_0x302a('0x37')],_0x3af8ac['query']);_0xf7365[_0x302a('0x3b')]=_[_0x302a('0x3a')](_0x3af8ac[_0x302a('0x37')],qs[_0x302a('0x3c')](_0x3419f0[_0x302a('0x39')][_0x302a('0x3c')]));_0xf7365[_0x302a('0x3b')]=_0xf7365[_0x302a('0x3b')][_0x302a('0x3d')]?_0xf7365[_0x302a('0x3b')]:_0x3af8ac['model'];if(!_0x3419f0[_0x302a('0x39')]['hasOwnProperty'](_0x302a('0x3e'))){_0xf7365[_0x302a('0x26')]=qs['limit'](_0x3419f0[_0x302a('0x39')][_0x302a('0x26')]);_0xf7365[_0x302a('0x23')]=qs[_0x302a('0x23')](_0x3419f0[_0x302a('0x39')][_0x302a('0x23')]);}_0xf7365[_0x302a('0x3f')]=qs['sort'](_0x3419f0[_0x302a('0x39')][_0x302a('0x40')]);_0xf7365['where']=qs[_0x302a('0x41')](_[_0x302a('0x42')](_0x3419f0['query'],_0x3af8ac[_0x302a('0x41')]),_0x579f12);if(_0x3419f0[_0x302a('0x39')]['filter']){_0xf7365['where']=_[_0x302a('0x43')](_0xf7365['where'],{'$or':_[_0x302a('0x32')](_0x579f12,function(_0x5db8d8){if(_0x5db8d8[_0x302a('0x36')]!==_0x302a('0x44')){var _0x5b8654={};_0x5b8654[_0x5db8d8[_0x302a('0x30')]]={'$like':'%'+_0x3419f0['query'][_0x302a('0x45')]+'%'};return _0x5b8654;}})});}_0xf7365=_[_0x302a('0x43')]({},_0xf7365,_0x3419f0[_0x302a('0x46')]);var _0x1980cf={'where':_0xf7365['where']};return db['OpenchannelQueue']['count'](_0x1980cf)[_0x302a('0x29')](function(_0x7f5feb){_0x2c3093[_0x302a('0x25')]=_0x7f5feb;if(_0x3419f0['query'][_0x302a('0x47')]){_0xf7365[_0x302a('0x48')]=[{'all':!![]}];}return db[_0x302a('0x33')][_0x302a('0x49')](_0xf7365);})['then'](function(_0x1779d9){_0x2c3093['rows']=_0x1779d9;return _0x2c3093;})[_0x302a('0x29')](respondWithFilteredResult(_0x2e2a3f,_0xf7365))['catch'](handleError(_0x2e2a3f,null));};exports[_0x302a('0x4a')]=function(_0x8bb515,_0x9c09b8){var _0xf1e3e9={'raw':!![],'where':{'id':_0x8bb515[_0x302a('0x4b')]['id']}},_0x7261f5={};_0x7261f5[_0x302a('0x37')]=_[_0x302a('0x38')](db[_0x302a('0x33')][_0x302a('0x34')]);_0x7261f5[_0x302a('0x39')]=_['keys'](_0x8bb515[_0x302a('0x39')]);_0x7261f5['filters']=_[_0x302a('0x3a')](_0x7261f5[_0x302a('0x37')],_0x7261f5[_0x302a('0x39')]);_0xf1e3e9['attributes']=_[_0x302a('0x3a')](_0x7261f5['model'],qs[_0x302a('0x3c')](_0x8bb515[_0x302a('0x39')][_0x302a('0x3c')]));_0xf1e3e9['attributes']=_0xf1e3e9['attributes']['length']?_0xf1e3e9['attributes']:_0x7261f5[_0x302a('0x37')];if(_0x8bb515['query'][_0x302a('0x47')]){_0xf1e3e9[_0x302a('0x48')]=[{'all':!![]}];}_0xf1e3e9=_[_0x302a('0x43')]({},_0xf1e3e9,_0x8bb515['options']);return db[_0x302a('0x33')][_0x302a('0x4c')](_0xf1e3e9)[_0x302a('0x29')](handleEntityNotFound(_0x9c09b8,null))[_0x302a('0x29')](respondWithResult(_0x9c09b8,null))[_0x302a('0x4d')](handleError(_0x9c09b8,null));};exports['create']=function(_0x33426b,_0x54d766){return db[_0x302a('0x33')][_0x302a('0x4e')](_0x33426b[_0x302a('0x4f')],{})[_0x302a('0x29')](function(_0x3c9c02){var _0x29d046=_0x33426b[_0x302a('0x50')][_0x302a('0x2a')]({'plain':!![]});if(!_0x29d046)throw new Error(_0x302a('0x51'));if(_0x29d046[_0x302a('0x52')]===_0x302a('0x50')){var _0x2e7023=_0x3c9c02[_0x302a('0x2a')]({'plain':!![]});var _0x58b181=_0x302a('0x2b');return db[_0x302a('0x53')][_0x302a('0x4c')]({'where':{'name':_0x58b181,'userProfileId':_0x29d046[_0x302a('0x54')]},'raw':!![]})['then'](function(_0x272600){if(_0x272600&&_0x272600[_0x302a('0x55')]===0x0){return db[_0x302a('0x2c')][_0x302a('0x4e')]({'name':_0x2e7023[_0x302a('0x30')],'resourceId':_0x2e7023['id'],'type':_0x272600[_0x302a('0x30')],'sectionId':_0x272600['id']},{})[_0x302a('0x29')](function(){return _0x3c9c02;});}else{return _0x3c9c02;}})[_0x302a('0x4d')](function(_0x4e4261){logger[_0x302a('0x2e')](_0x302a('0x56'),_0x4e4261);throw _0x4e4261;});}return _0x3c9c02;})[_0x302a('0x29')](respondWithResult(_0x54d766,0xc9))[_0x302a('0x4d')](handleError(_0x54d766,null));};exports[_0x302a('0x57')]=function(_0x4566b7,_0x1c54b8){if(_0x4566b7[_0x302a('0x4f')]['id']){delete _0x4566b7['body']['id'];}return db['OpenchannelQueue'][_0x302a('0x4c')]({'where':{'id':_0x4566b7[_0x302a('0x4b')]['id']}})[_0x302a('0x29')](handleEntityNotFound(_0x1c54b8,null))[_0x302a('0x29')](saveUpdates(_0x4566b7[_0x302a('0x4f')],null))[_0x302a('0x29')](respondWithResult(_0x1c54b8,null))[_0x302a('0x4d')](handleError(_0x1c54b8,null));};exports[_0x302a('0x2d')]=function(_0x6d78b4,_0x470777){return db[_0x302a('0x33')]['find']({'where':{'id':_0x6d78b4['params']['id']}})['then'](handleEntityNotFound(_0x470777,null))['then'](removeEntity(_0x470777,null))[_0x302a('0x4d')](handleError(_0x470777,null));};exports[_0x302a('0x58')]=function(_0x545a6d,_0x38a5ae){return db[_0x302a('0x33')]['describe']()[_0x302a('0x29')](respondWithResult(_0x38a5ae,null))['catch'](handleError(_0x38a5ae,null));};exports[_0x302a('0x59')]=function(_0x43693f,_0x497626,_0x71f2ac){var _0x4c3072={'raw':!![],'where':{}},_0x2ae6fd={},_0x4e88a1;return db[_0x302a('0x33')][_0x302a('0x5a')]({'where':{'id':_0x43693f['params']['id']}})[_0x302a('0x29')](handleEntityNotFound(_0x497626,null))[_0x302a('0x29')](function(_0x24eae7){if(_0x24eae7){_0x4e88a1=_0x24eae7[_0x302a('0x2a')]({'plain':!![]});_0x2ae6fd['model']=_[_0x302a('0x38')](db[_0x302a('0x5b')][_0x302a('0x34')]);_0x2ae6fd[_0x302a('0x39')]=_[_0x302a('0x38')](_0x43693f[_0x302a('0x39')]);_0x2ae6fd['filters']=_[_0x302a('0x3a')](_0x2ae6fd[_0x302a('0x37')],_0x2ae6fd[_0x302a('0x39')]);_0x4c3072[_0x302a('0x3b')]=_[_0x302a('0x3a')](_0x2ae6fd[_0x302a('0x37')],qs['fields'](_0x43693f['query'][_0x302a('0x3c')]));_0x4c3072[_0x302a('0x3b')]=_0x4c3072[_0x302a('0x3b')][_0x302a('0x3d')]?_0x4c3072[_0x302a('0x3b')]:_0x2ae6fd[_0x302a('0x37')];if(!_0x43693f[_0x302a('0x39')][_0x302a('0x5c')](_0x302a('0x3e'))){_0x4c3072[_0x302a('0x26')]=qs['limit'](_0x43693f[_0x302a('0x39')][_0x302a('0x26')]);_0x4c3072['offset']=qs[_0x302a('0x23')](_0x43693f[_0x302a('0x39')][_0x302a('0x23')]);}_0x4c3072[_0x302a('0x3f')]=qs['sort'](_0x43693f['query'][_0x302a('0x40')]);_0x4c3072[_0x302a('0x5d')]=qs[_0x302a('0x41')](_[_0x302a('0x42')](_0x43693f['query'],_0x2ae6fd[_0x302a('0x41')]));_0x4c3072['where'][_0x302a('0x5e')]=_0x24eae7['id'];if(_0x43693f['query'][_0x302a('0x45')]){_0x4c3072['where']=_[_0x302a('0x43')](_0x4c3072[_0x302a('0x5d')],{'$or':_[_0x302a('0x32')](_0x4c3072['attributes'],function(_0x185c0c){var _0x2c4d39={};_0x2c4d39[_0x185c0c]={'$like':'%'+_0x43693f[_0x302a('0x39')][_0x302a('0x45')]+'%'};return _0x2c4d39;})});}_0x4c3072=_[_0x302a('0x43')]({},_0x4c3072,_0x43693f[_0x302a('0x46')]);return db[_0x302a('0x5b')][_0x302a('0x49')](_0x4c3072);}})[_0x302a('0x29')](function(_0x5e039f){if(_0x5e039f){return db['User'][_0x302a('0x5f')]({'where':{'id':_[_0x302a('0x32')](_0x5e039f,_0x302a('0x60')),'role':_0x302a('0x61')},'attributes':['id',_0x302a('0x30'),_0x302a('0x62'),_0x302a('0x63'),_0x302a('0x64')]});}})[_0x302a('0x29')](function(_0xcdfe63){if(_0xcdfe63){return{'count':_0xcdfe63['count'],'rows':_[_0x302a('0x32')](_0xcdfe63['rows'],function(_0x2f7e13){return{'membername':_0x2f7e13[_0x302a('0x30')],'UserId':_0x2f7e13['id'],'queue_name':_0x4e88a1[_0x302a('0x30')],'OpenchannelQueueId':_0x4e88a1['id'],'interface':util[_0x302a('0x65')](_0x302a('0x66'),_0x302a('0x67'),_0x2f7e13[_0x302a('0x30')]),'penalty':0x0,'paused':_0x2f7e13[_0x302a('0x62')],'createdAt':_0x2f7e13[_0x302a('0x64')],'updatedAt':_0x2f7e13['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x302a('0x29')](respondWithFilteredResult(_0x497626,_0x4c3072))[_0x302a('0x4d')](handleError(_0x497626,null));};exports['getTeams']=function(_0x8e7b27,_0x472af2,_0x226819){var _0x42cf3f={};var _0x17896a={};var _0x20d641;var _0x19e8e7;return db[_0x302a('0x33')][_0x302a('0x5a')]({'where':{'id':_0x8e7b27[_0x302a('0x4b')]['id']}})[_0x302a('0x29')](handleEntityNotFound(_0x472af2,null))['then'](function(_0x4f5a9f){if(_0x4f5a9f){_0x20d641=_0x4f5a9f;_0x17896a[_0x302a('0x37')]=_[_0x302a('0x38')](db[_0x302a('0x68')][_0x302a('0x34')]);_0x17896a[_0x302a('0x39')]=_[_0x302a('0x38')](_0x8e7b27[_0x302a('0x39')]);_0x17896a[_0x302a('0x41')]=_[_0x302a('0x3a')](_0x17896a[_0x302a('0x37')],_0x17896a['query']);_0x42cf3f['attributes']=_['intersection'](_0x17896a['model'],qs[_0x302a('0x3c')](_0x8e7b27[_0x302a('0x39')]['fields']));_0x42cf3f[_0x302a('0x3b')]=_0x42cf3f['attributes'][_0x302a('0x3d')]?_0x42cf3f[_0x302a('0x3b')]:_0x17896a[_0x302a('0x37')];_0x42cf3f['order']=qs['sort'](_0x8e7b27[_0x302a('0x39')][_0x302a('0x40')]);_0x42cf3f[_0x302a('0x5d')]=qs[_0x302a('0x41')](_[_0x302a('0x42')](_0x8e7b27[_0x302a('0x39')],_0x17896a[_0x302a('0x41')]));if(_0x8e7b27[_0x302a('0x39')][_0x302a('0x45')]){_0x42cf3f[_0x302a('0x5d')]=_[_0x302a('0x43')](_0x42cf3f[_0x302a('0x5d')],{'$or':_[_0x302a('0x32')](_0x42cf3f['attributes'],function(_0x496b68){var _0x316508={};_0x316508[_0x496b68]={'$like':'%'+_0x8e7b27[_0x302a('0x39')][_0x302a('0x45')]+'%'};return _0x316508;})});}_0x42cf3f=_[_0x302a('0x43')]({},_0x42cf3f,_0x8e7b27[_0x302a('0x46')]);return _0x20d641['getTeams'](_0x42cf3f);}})['then'](function(_0x556fef){if(_0x556fef){_0x19e8e7=_0x556fef['length'];if(!_0x8e7b27[_0x302a('0x39')][_0x302a('0x5c')](_0x302a('0x3e'))){_0x42cf3f['limit']=qs['limit'](_0x8e7b27['query'][_0x302a('0x26')]);_0x42cf3f[_0x302a('0x23')]=qs[_0x302a('0x23')](_0x8e7b27[_0x302a('0x39')][_0x302a('0x23')]);}return _0x20d641['getTeams'](_0x42cf3f);}})[_0x302a('0x29')](function(_0x52d3c1){if(_0x52d3c1){return _0x52d3c1?{'count':_0x19e8e7,'rows':_0x52d3c1}:null;}})['then'](respondWithResult(_0x472af2,null))['catch'](handleError(_0x472af2,null));};exports['addTeams']=function(_0x319a6b,_0x468dd1,_0x4f0d7b){var _0x24024a=_0x319a6b['body'][_0x302a('0x69')];return db[_0x302a('0x68')][_0x302a('0x49')]({'where':{'id':_0x24024a},'attributes':['id'],'include':[{'model':db[_0x302a('0x6a')],'as':_0x302a('0x6b'),'attributes':['id',_0x302a('0x30'),'online',_0x302a('0x6c'),_0x302a('0x6d')],'raw':!![]}]})[_0x302a('0x29')](function(_0x1f0cc8){if(_0x1f0cc8){var _0x59d589=_[_0x302a('0x6e')](_0x1f0cc8,function(_0x584dc7){var _0x2f9e7b=_0x584dc7[_0x302a('0x2a')]({'plain':!![]});return _0x2f9e7b[_0x302a('0x6b')];});return db[_0x302a('0x33')][_0x302a('0x4c')]({'where':{'id':_0x319a6b[_0x302a('0x4b')]['id']}})[_0x302a('0x29')](function(_0x4a68be){return db[_0x302a('0x6f')][_0x302a('0x70')](function(_0x3ea91b){return _0x4a68be[_0x302a('0x71')](_0x24024a,{'transaction':_0x3ea91b})[_0x302a('0x29')](function(){return BPromise['each'](_0x59d589,function(_0x3ae822){return db[_0x302a('0x5b')][_0x302a('0x72')]({'where':{'UserId':_0x3ae822['id'],'OpenchannelQueueId':_0x319a6b[_0x302a('0x4b')]['id']},'transaction':_0x3ea91b});});})['then'](function(){_0x59d589[_0x302a('0x73')](function(_0x5eeacd){socket[_0x302a('0x74')](_0x302a('0x75'),{'UserId':_0x5eeacd['id'],'OpenchannelQueueId':_0x4a68be['id']});});});});});}})[_0x302a('0x29')](respondWithStatusCode(_0x468dd1,null))['catch'](handleError(_0x468dd1,null));};exports[_0x302a('0x76')]=function(_0x4540cc,_0x3ae1b8,_0x516a4d){return db[_0x302a('0x68')][_0x302a('0x49')]({'where':{'id':_0x4540cc['query'][_0x302a('0x69')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x302a('0x6b'),'attributes':['id'],'raw':!![]}]})[_0x302a('0x29')](handleEntityNotFound(_0x3ae1b8,null))[_0x302a('0x29')](function(_0x4de724){var _0x34813a=_[_0x302a('0x32')](_0x4de724,'id');var _0x5c5f0a=[];var _0x1bd7ab=[];var _0x62945=squel[_0x302a('0x77')]();_0x62945[_0x302a('0x78')](_0x302a('0x79'))[_0x302a('0x7a')](_0x302a('0x7b'),'tq')[_0x302a('0x7c')]('user_has_teams','ut',_0x302a('0x7d'))[_0x302a('0x5d')](_0x302a('0x7e'),_0x4540cc[_0x302a('0x4b')]['id']);for(var _0x437b0d=0x0;_0x437b0d<_0x4de724[_0x302a('0x3d')];_0x437b0d+=0x1){let _0x3814bb=_0x4de724[_0x437b0d];for(var _0x2c43d2=0x0;_0x2c43d2<_0x3814bb[_0x302a('0x6b')]['length'];_0x2c43d2+=0x1){let _0x465abf=_0x3814bb[_0x302a('0x6b')][_0x2c43d2];var _0xe5aed=_0x62945['clone']();_0xe5aed[_0x302a('0x5d')]('ut.UserId\x20=\x20?',_0x465abf['id']);_0x1bd7ab['push'](db[_0x302a('0x6f')][_0x302a('0x39')](_0xe5aed[_0x302a('0x7f')](),{'type':db['sequelize'][_0x302a('0x80')]['SELECT']})[_0x302a('0x29')](function(_0x5741e3){if(_0x5741e3[_0x302a('0x3d')]===0x1){return _0x465abf['id'];}else{var _0x52b979=_[_0x302a('0x81')](_[_0x302a('0x32')](_0x5741e3,'TeamId'),function(_0x2dee8e){return _[_0x302a('0x82')](_0x34813a,_0x2dee8e);});if(_0x52b979){return _0x465abf['id'];}}}));}}return BPromise['all'](_0x1bd7ab)[_0x302a('0x29')](function(_0x412573){_0x5c5f0a=_(_0x5c5f0a)[_0x302a('0x83')](_0x412573)[_0x302a('0x84')]()[_0x302a('0x85')]();return db[_0x302a('0x33')][_0x302a('0x4c')]({'where':{'id':_0x4540cc[_0x302a('0x4b')]['id']}})[_0x302a('0x29')](function(_0x462bb9){return db[_0x302a('0x6f')][_0x302a('0x70')](function(_0x2ef814){return _0x462bb9[_0x302a('0x76')](_0x4540cc[_0x302a('0x39')][_0x302a('0x69')],{'transaction':_0x2ef814})[_0x302a('0x29')](function(){if(!_[_0x302a('0x86')](_0x5c5f0a)){return _0x462bb9['removeAgents'](_0x5c5f0a,{'transaction':_0x2ef814});}})[_0x302a('0x29')](function(){_0x5c5f0a[_0x302a('0x73')](function(_0x280b6c){socket['emit'](_0x302a('0x87'),{'UserId':_0x280b6c,'OpenchannelQueueId':_0x462bb9['id']});});});});});});})[_0x302a('0x29')](respondWithStatusCode(_0x3ae1b8,null))[_0x302a('0x4d')](handleError(_0x3ae1b8,null));};exports[_0x302a('0x88')]=function(_0x544d83,_0x4941d8,_0x232d8f){return db[_0x302a('0x33')][_0x302a('0x4c')]({'where':{'id':_0x544d83['params']['id']}})[_0x302a('0x29')](handleEntityNotFound(_0x4941d8,null))[_0x302a('0x29')](function(_0x1496bf){if(_0x1496bf){return _0x1496bf['addAgents'](_0x544d83[_0x302a('0x4f')][_0x302a('0x69')],_[_0x302a('0x89')](_0x544d83[_0x302a('0x4f')],[_0x302a('0x69'),'id'])||{})[_0x302a('0x8a')](function(_0x21e7f3){for(var _0x2e6f1c=0x0;_0x2e6f1c<_0x544d83[_0x302a('0x4f')][_0x302a('0x69')][_0x302a('0x3d')];_0x2e6f1c+=0x1){socket[_0x302a('0x74')](_0x302a('0x75'),{'UserId':Number(_0x544d83['body'][_0x302a('0x69')][_0x2e6f1c]),'OpenchannelQueueId':Number(_0x544d83[_0x302a('0x4b')]['id'])});}return _0x21e7f3;});}})['then'](respondWithResult(_0x4941d8,null))[_0x302a('0x4d')](handleError(_0x4941d8,null));};exports['removeAgents']=function(_0x45c0c3,_0x1061c2,_0x2aa806){return db[_0x302a('0x33')][_0x302a('0x4c')]({'where':{'id':_0x45c0c3[_0x302a('0x4b')]['id']}})[_0x302a('0x29')](handleEntityNotFound(_0x1061c2,null))[_0x302a('0x29')](function(_0x20c4d0){if(_0x20c4d0){return _0x20c4d0[_0x302a('0x8b')](_0x45c0c3['query'][_0x302a('0x69')])[_0x302a('0x29')](function(){if(_[_0x302a('0x8c')](_0x45c0c3[_0x302a('0x39')]['ids'])){for(var _0x5d8bfb=0x0;_0x5d8bfb<_0x45c0c3[_0x302a('0x39')]['ids']['length'];_0x5d8bfb+=0x1){socket[_0x302a('0x74')]('userOpenchannelQueue:remove',{'UserId':Number(_0x45c0c3['query'][_0x302a('0x69')][_0x5d8bfb]),'OpenchannelQueueId':Number(_0x45c0c3[_0x302a('0x4b')]['id'])});}}else{socket[_0x302a('0x74')](_0x302a('0x87'),{'UserId':Number(_0x45c0c3['query'][_0x302a('0x69')]),'OpenchannelQueueId':Number(_0x45c0c3['params']['id'])});}});}})[_0x302a('0x29')](respondWithStatusCode(_0x1061c2,null))['catch'](handleError(_0x1061c2,null));};exports['getAgents']=function(_0x3749a4,_0x3948de,_0x16ec75){var _0x52b08c={};var _0x230abf={};var _0x3ed741;var _0x3561e8;return db[_0x302a('0x33')]['findOne']({'where':{'id':_0x3749a4[_0x302a('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3948de,null))[_0x302a('0x29')](function(_0x407311){if(_0x407311){_0x3ed741=_0x407311;_0x230abf[_0x302a('0x37')]=_[_0x302a('0x38')](db['User'][_0x302a('0x34')]);_0x230abf['query']=_['keys'](_0x3749a4[_0x302a('0x39')]);_0x230abf['filters']=_[_0x302a('0x3a')](_0x230abf[_0x302a('0x37')],_0x230abf[_0x302a('0x39')]);_0x52b08c[_0x302a('0x3b')]=_[_0x302a('0x3a')](_0x230abf[_0x302a('0x37')],qs[_0x302a('0x3c')](_0x3749a4['query'][_0x302a('0x3c')]));_0x52b08c[_0x302a('0x3b')]=_0x52b08c['attributes'][_0x302a('0x3d')]?_0x52b08c[_0x302a('0x3b')]:_0x230abf[_0x302a('0x37')];_0x52b08c[_0x302a('0x3f')]=qs[_0x302a('0x40')](_0x3749a4['query'][_0x302a('0x40')]);_0x52b08c[_0x302a('0x5d')]=qs[_0x302a('0x41')](_[_0x302a('0x42')](_0x3749a4[_0x302a('0x39')],_0x230abf[_0x302a('0x41')]));if(_0x3749a4[_0x302a('0x39')][_0x302a('0x45')]){_0x52b08c[_0x302a('0x5d')]=_['merge'](_0x52b08c[_0x302a('0x5d')],{'$or':_[_0x302a('0x32')](_0x52b08c['attributes'],function(_0x1615c1){var _0x63f593={};_0x63f593[_0x1615c1]={'$like':'%'+_0x3749a4[_0x302a('0x39')][_0x302a('0x45')]+'%'};return _0x63f593;})});}_0x52b08c=_[_0x302a('0x43')]({},_0x52b08c,_0x3749a4[_0x302a('0x46')]);return _0x3ed741[_0x302a('0x8d')](_0x52b08c);}})['then'](function(_0x464c57){if(_0x464c57){_0x3561e8=_0x464c57[_0x302a('0x3d')];if(!_0x3749a4['query'][_0x302a('0x5c')]('nolimit')){_0x52b08c[_0x302a('0x26')]=qs['limit'](_0x3749a4[_0x302a('0x39')][_0x302a('0x26')]);_0x52b08c['offset']=qs[_0x302a('0x23')](_0x3749a4[_0x302a('0x39')][_0x302a('0x23')]);}return _0x3ed741['getAgents'](_0x52b08c);}})[_0x302a('0x29')](function(_0x507ab){if(_0x507ab){return _0x507ab?{'count':_0x3561e8,'rows':_0x507ab}:null;}})[_0x302a('0x29')](respondWithResult(_0x3948de,null))['catch'](handleError(_0x3948de,null));}; \ No newline at end of file +var _0x3c64=['path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','sendStatus','status','end','json','undefined','count','offset','limit','set','apply','save','update','then','destroy','OpenchannelQueues','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','OpenchannelQueue','includeAll','include','catch','show','keys','find','create','body','user','get','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','nolimit','UserOpenchannelQueue','findAll','findAndCountAll','UserId','updatedAt','createdAt','rows','format','%s/%s','SIP','getTeams','Team','addTeams','ids','User','Agents','online','voicePause','interface','flatMap','transaction','findOrCreate','forEach','emit','select','field','tq.TeamId','from','team_has_openchannel_queues','join','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','all','compact','value','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','spread','userOpenchannelQueue:save','isArray','getAgents','eml-format','rimraf','moment','mustache','util'];(function(_0x1e6db3,_0x5643ac){var _0x1de886=function(_0x351318){while(--_0x351318){_0x1e6db3['push'](_0x1e6db3['shift']());}};_0x1de886(++_0x5643ac);}(_0x3c64,0x193));var _0x43c6=function(_0x1f0bcf,_0x408bd6){_0x1f0bcf=_0x1f0bcf-0x0;var _0x1cb51c=_0x3c64[_0x1f0bcf];return _0x1cb51c;};'use strict';var emlformat=require(_0x43c6('0x0'));var rimraf=require(_0x43c6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x43c6('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x43c6('0x3'));var util=require(_0x43c6('0x4'));var path=require(_0x43c6('0x5'));var sox=require(_0x43c6('0x6'));var csv=require(_0x43c6('0x7'));var ejs=require(_0x43c6('0x8'));var fs=require('fs');var fs_extra=require(_0x43c6('0x9'));var _=require('lodash');var squel=require(_0x43c6('0xa'));var crypto=require(_0x43c6('0xb'));var jsforce=require(_0x43c6('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x43c6('0xd'));var Redis=require(_0x43c6('0xe'));var authService=require(_0x43c6('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x43c6('0x10'));var logger=require(_0x43c6('0x11'))('api');var utils=require(_0x43c6('0x12'));var config=require(_0x43c6('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x43c6('0x14')]=_[_0x43c6('0x15')](config['redis'],{'host':_0x43c6('0x16'),'port':0x18eb});var socket=require(_0x43c6('0x17'))(new Redis(config[_0x43c6('0x14')]));require(_0x43c6('0x18'))['register'](socket);function respondWithStatusCode(_0x38a3bb,_0x998440){_0x998440=_0x998440||0xcc;return function(_0x2bb51a){if(_0x2bb51a){return _0x38a3bb[_0x43c6('0x19')](_0x998440);}return _0x38a3bb[_0x43c6('0x1a')](_0x998440)[_0x43c6('0x1b')]();};}function respondWithResult(_0x56e108,_0x8b8acb){_0x8b8acb=_0x8b8acb||0xc8;return function(_0xc23e5f){if(_0xc23e5f){return _0x56e108[_0x43c6('0x1a')](_0x8b8acb)[_0x43c6('0x1c')](_0xc23e5f);}};}function respondWithFilteredResult(_0x327b3d,_0x4ba4f7){return function(_0x2ba9a2){if(_0x2ba9a2){var _0x4b2224=typeof _0x4ba4f7['offset']==='undefined'&&typeof _0x4ba4f7['limit']===_0x43c6('0x1d');var _0x1f0962=_0x2ba9a2[_0x43c6('0x1e')];var _0x184926=_0x4b2224?0x0:_0x4ba4f7['offset'];var _0x73db6d=_0x4b2224?_0x2ba9a2[_0x43c6('0x1e')]:_0x4ba4f7[_0x43c6('0x1f')]+_0x4ba4f7[_0x43c6('0x20')];var _0x330456;if(_0x73db6d>=_0x1f0962){_0x73db6d=_0x1f0962;_0x330456=0xc8;}else{_0x330456=0xce;}_0x327b3d['status'](_0x330456);return _0x327b3d[_0x43c6('0x21')]('Content-Range',_0x184926+'-'+_0x73db6d+'/'+_0x1f0962)[_0x43c6('0x1c')](_0x2ba9a2);}return null;};}function patchUpdates(_0x1beca2){return function(_0x3f0ae2){try{jsonpatch[_0x43c6('0x22')](_0x3f0ae2,_0x1beca2,!![]);}catch(_0x54d1b2){return BPromise['reject'](_0x54d1b2);}return _0x3f0ae2[_0x43c6('0x23')]();};}function saveUpdates(_0x134a1f,_0x559a37){return function(_0x38526a){if(_0x38526a){return _0x38526a[_0x43c6('0x24')](_0x134a1f)[_0x43c6('0x25')](function(_0x268b2d){return _0x268b2d;});}return null;};}function removeEntity(_0x2375e2,_0x4f6a49){return function(_0x24e67b){if(_0x24e67b){return _0x24e67b[_0x43c6('0x26')]()[_0x43c6('0x25')](function(){var _0x32c0b0=_0x24e67b['get']({'plain':!![]});var _0x26d325=_0x43c6('0x27');return db[_0x43c6('0x28')][_0x43c6('0x26')]({'where':{'type':_0x26d325,'resourceId':_0x32c0b0['id']}})[_0x43c6('0x25')](function(){return _0x24e67b;});})[_0x43c6('0x25')](function(){_0x2375e2[_0x43c6('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e7d76,_0x3edd18){return function(_0x3577e4){if(!_0x3577e4){_0x2e7d76['sendStatus'](0x194);}return _0x3577e4;};}function handleError(_0x29b5ab,_0x29ab76){_0x29ab76=_0x29ab76||0x1f4;return function(_0x26c2f4){logger[_0x43c6('0x29')](_0x26c2f4[_0x43c6('0x2a')]);if(_0x26c2f4[_0x43c6('0x2b')]){delete _0x26c2f4[_0x43c6('0x2b')];}_0x29b5ab['status'](_0x29ab76)[_0x43c6('0x2c')](_0x26c2f4);};}exports[_0x43c6('0x2d')]=function(_0x1433da,_0x5f3754){var _0x53016b={},_0x4a6e57={},_0x3cf121={'count':0x0,'rows':[]};var _0x164cbe=_[_0x43c6('0x2e')](db['OpenchannelQueue'][_0x43c6('0x2f')],function(_0x506d15){return{'name':_0x506d15[_0x43c6('0x30')],'type':_0x506d15[_0x43c6('0x31')]['key']};});_0x4a6e57[_0x43c6('0x32')]=_[_0x43c6('0x2e')](_0x164cbe,_0x43c6('0x2b'));_0x4a6e57[_0x43c6('0x33')]=_['keys'](_0x1433da[_0x43c6('0x33')]);_0x4a6e57[_0x43c6('0x34')]=_['intersection'](_0x4a6e57[_0x43c6('0x32')],_0x4a6e57[_0x43c6('0x33')]);_0x53016b[_0x43c6('0x35')]=_[_0x43c6('0x36')](_0x4a6e57[_0x43c6('0x32')],qs[_0x43c6('0x37')](_0x1433da[_0x43c6('0x33')][_0x43c6('0x37')]));_0x53016b['attributes']=_0x53016b[_0x43c6('0x35')][_0x43c6('0x38')]?_0x53016b[_0x43c6('0x35')]:_0x4a6e57[_0x43c6('0x32')];if(!_0x1433da['query'][_0x43c6('0x39')]('nolimit')){_0x53016b[_0x43c6('0x20')]=qs['limit'](_0x1433da['query']['limit']);_0x53016b[_0x43c6('0x1f')]=qs[_0x43c6('0x1f')](_0x1433da['query'][_0x43c6('0x1f')]);}_0x53016b[_0x43c6('0x3a')]=qs[_0x43c6('0x3b')](_0x1433da[_0x43c6('0x33')][_0x43c6('0x3b')]);_0x53016b[_0x43c6('0x3c')]=qs[_0x43c6('0x34')](_[_0x43c6('0x3d')](_0x1433da['query'],_0x4a6e57[_0x43c6('0x34')]),_0x164cbe);if(_0x1433da[_0x43c6('0x33')][_0x43c6('0x3e')]){_0x53016b[_0x43c6('0x3c')]=_[_0x43c6('0x3f')](_0x53016b['where'],{'$or':_['map'](_0x164cbe,function(_0x7749e4){if(_0x7749e4[_0x43c6('0x31')]!=='VIRTUAL'){var _0x2244a6={};_0x2244a6[_0x7749e4['name']]={'$like':'%'+_0x1433da[_0x43c6('0x33')][_0x43c6('0x3e')]+'%'};return _0x2244a6;}})});}_0x53016b=_[_0x43c6('0x3f')]({},_0x53016b,_0x1433da[_0x43c6('0x40')]);var _0x3707c4={'where':_0x53016b[_0x43c6('0x3c')]};return db[_0x43c6('0x41')]['count'](_0x3707c4)[_0x43c6('0x25')](function(_0x8c8ff9){_0x3cf121[_0x43c6('0x1e')]=_0x8c8ff9;if(_0x1433da['query'][_0x43c6('0x42')]){_0x53016b[_0x43c6('0x43')]=[{'all':!![]}];}return db[_0x43c6('0x41')]['findAll'](_0x53016b);})['then'](function(_0x1bbf6f){_0x3cf121['rows']=_0x1bbf6f;return _0x3cf121;})[_0x43c6('0x25')](respondWithFilteredResult(_0x5f3754,_0x53016b))[_0x43c6('0x44')](handleError(_0x5f3754,null));};exports[_0x43c6('0x45')]=function(_0x4c003f,_0x1a8e25){var _0x3a6f32={'raw':!![],'where':{'id':_0x4c003f['params']['id']}},_0x40bfa2={};_0x40bfa2['model']=_[_0x43c6('0x46')](db[_0x43c6('0x41')][_0x43c6('0x2f')]);_0x40bfa2[_0x43c6('0x33')]=_[_0x43c6('0x46')](_0x4c003f[_0x43c6('0x33')]);_0x40bfa2[_0x43c6('0x34')]=_['intersection'](_0x40bfa2[_0x43c6('0x32')],_0x40bfa2[_0x43c6('0x33')]);_0x3a6f32[_0x43c6('0x35')]=_[_0x43c6('0x36')](_0x40bfa2[_0x43c6('0x32')],qs[_0x43c6('0x37')](_0x4c003f[_0x43c6('0x33')][_0x43c6('0x37')]));_0x3a6f32[_0x43c6('0x35')]=_0x3a6f32['attributes'][_0x43c6('0x38')]?_0x3a6f32[_0x43c6('0x35')]:_0x40bfa2[_0x43c6('0x32')];if(_0x4c003f[_0x43c6('0x33')][_0x43c6('0x42')]){_0x3a6f32['include']=[{'all':!![]}];}_0x3a6f32=_[_0x43c6('0x3f')]({},_0x3a6f32,_0x4c003f[_0x43c6('0x40')]);return db[_0x43c6('0x41')][_0x43c6('0x47')](_0x3a6f32)[_0x43c6('0x25')](handleEntityNotFound(_0x1a8e25,null))['then'](respondWithResult(_0x1a8e25,null))[_0x43c6('0x44')](handleError(_0x1a8e25,null));};exports[_0x43c6('0x48')]=function(_0x1a20e1,_0x3e73a0){return db[_0x43c6('0x41')]['create'](_0x1a20e1[_0x43c6('0x49')],{})[_0x43c6('0x25')](function(_0x381d20){var _0x1d4112=_0x1a20e1[_0x43c6('0x4a')][_0x43c6('0x4b')]({'plain':!![]});if(!_0x1d4112)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1d4112['role']===_0x43c6('0x4a')){var _0x20698b=_0x381d20['get']({'plain':!![]});var _0x49ed8d=_0x43c6('0x27');return db['UserProfileSection'][_0x43c6('0x47')]({'where':{'name':_0x49ed8d,'userProfileId':_0x1d4112[_0x43c6('0x4c')]},'raw':!![]})['then'](function(_0x176cc7){if(_0x176cc7&&_0x176cc7[_0x43c6('0x4d')]===0x0){return db[_0x43c6('0x28')]['create']({'name':_0x20698b['name'],'resourceId':_0x20698b['id'],'type':_0x176cc7[_0x43c6('0x2b')],'sectionId':_0x176cc7['id']},{})[_0x43c6('0x25')](function(){return _0x381d20;});}else{return _0x381d20;}})[_0x43c6('0x44')](function(_0xbc15ae){logger[_0x43c6('0x29')](_0x43c6('0x4e'),_0xbc15ae);throw _0xbc15ae;});}return _0x381d20;})[_0x43c6('0x25')](respondWithResult(_0x3e73a0,0xc9))[_0x43c6('0x44')](handleError(_0x3e73a0,null));};exports['update']=function(_0x2ed316,_0x41ad97){if(_0x2ed316[_0x43c6('0x49')]['id']){delete _0x2ed316[_0x43c6('0x49')]['id'];}return db[_0x43c6('0x41')][_0x43c6('0x47')]({'where':{'id':_0x2ed316[_0x43c6('0x4f')]['id']}})[_0x43c6('0x25')](handleEntityNotFound(_0x41ad97,null))[_0x43c6('0x25')](saveUpdates(_0x2ed316[_0x43c6('0x49')],null))[_0x43c6('0x25')](respondWithResult(_0x41ad97,null))[_0x43c6('0x44')](handleError(_0x41ad97,null));};exports['destroy']=function(_0x5e6acd,_0x1831aa){return db[_0x43c6('0x41')][_0x43c6('0x47')]({'where':{'id':_0x5e6acd[_0x43c6('0x4f')]['id']}})[_0x43c6('0x25')](handleEntityNotFound(_0x1831aa,null))[_0x43c6('0x25')](removeEntity(_0x1831aa,null))[_0x43c6('0x44')](handleError(_0x1831aa,null));};exports['describe']=function(_0x486dba,_0x42d1b9){return db[_0x43c6('0x41')][_0x43c6('0x50')]()['then'](respondWithResult(_0x42d1b9,null))[_0x43c6('0x44')](handleError(_0x42d1b9,null));};exports[_0x43c6('0x51')]=function(_0x14c44b,_0x4be3ef,_0x161124){var _0x4a64ce={'raw':!![],'where':{}},_0x5e444d={},_0x2367b0;return db['OpenchannelQueue'][_0x43c6('0x52')]({'where':{'id':_0x14c44b[_0x43c6('0x4f')]['id']}})['then'](handleEntityNotFound(_0x4be3ef,null))[_0x43c6('0x25')](function(_0x23782c){if(_0x23782c){_0x2367b0=_0x23782c['get']({'plain':!![]});_0x5e444d[_0x43c6('0x32')]=_[_0x43c6('0x46')](db['UserOpenchannelQueue'][_0x43c6('0x2f')]);_0x5e444d[_0x43c6('0x33')]=_[_0x43c6('0x46')](_0x14c44b['query']);_0x5e444d[_0x43c6('0x34')]=_[_0x43c6('0x36')](_0x5e444d['model'],_0x5e444d['query']);_0x4a64ce[_0x43c6('0x35')]=_[_0x43c6('0x36')](_0x5e444d[_0x43c6('0x32')],qs['fields'](_0x14c44b[_0x43c6('0x33')][_0x43c6('0x37')]));_0x4a64ce[_0x43c6('0x35')]=_0x4a64ce[_0x43c6('0x35')][_0x43c6('0x38')]?_0x4a64ce[_0x43c6('0x35')]:_0x5e444d[_0x43c6('0x32')];if(!_0x14c44b[_0x43c6('0x33')][_0x43c6('0x39')](_0x43c6('0x53'))){_0x4a64ce[_0x43c6('0x20')]=qs[_0x43c6('0x20')](_0x14c44b[_0x43c6('0x33')][_0x43c6('0x20')]);_0x4a64ce['offset']=qs[_0x43c6('0x1f')](_0x14c44b[_0x43c6('0x33')]['offset']);}_0x4a64ce[_0x43c6('0x3a')]=qs['sort'](_0x14c44b['query']['sort']);_0x4a64ce['where']=qs[_0x43c6('0x34')](_[_0x43c6('0x3d')](_0x14c44b[_0x43c6('0x33')],_0x5e444d[_0x43c6('0x34')]));_0x4a64ce['where']['OpenchannelQueueId']=_0x23782c['id'];if(_0x14c44b[_0x43c6('0x33')][_0x43c6('0x3e')]){_0x4a64ce[_0x43c6('0x3c')]=_[_0x43c6('0x3f')](_0x4a64ce[_0x43c6('0x3c')],{'$or':_[_0x43c6('0x2e')](_0x4a64ce[_0x43c6('0x35')],function(_0x3be5a2){var _0x3b021c={};_0x3b021c[_0x3be5a2]={'$like':'%'+_0x14c44b[_0x43c6('0x33')][_0x43c6('0x3e')]+'%'};return _0x3b021c;})});}_0x4a64ce=_['merge']({},_0x4a64ce,_0x14c44b[_0x43c6('0x40')]);return db[_0x43c6('0x54')][_0x43c6('0x55')](_0x4a64ce);}})[_0x43c6('0x25')](function(_0x5c4163){if(_0x5c4163){return db['User'][_0x43c6('0x56')]({'where':{'id':_['map'](_0x5c4163,_0x43c6('0x57')),'role':'agent'},'attributes':['id','name','openchannelPause',_0x43c6('0x58'),_0x43c6('0x59')]});}})[_0x43c6('0x25')](function(_0x1e456c){if(_0x1e456c){return{'count':_0x1e456c['count'],'rows':_[_0x43c6('0x2e')](_0x1e456c[_0x43c6('0x5a')],function(_0x456720){return{'membername':_0x456720[_0x43c6('0x2b')],'UserId':_0x456720['id'],'queue_name':_0x2367b0['name'],'OpenchannelQueueId':_0x2367b0['id'],'interface':util[_0x43c6('0x5b')](_0x43c6('0x5c'),_0x43c6('0x5d'),_0x456720[_0x43c6('0x2b')]),'penalty':0x0,'paused':_0x456720['openchannelPause'],'createdAt':_0x456720['createdAt'],'updatedAt':_0x456720['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x4be3ef,_0x4a64ce))[_0x43c6('0x44')](handleError(_0x4be3ef,null));};exports[_0x43c6('0x5e')]=function(_0x1eba4e,_0x915e5f,_0x5e35ad){var _0x5415a2={};var _0x473550={};var _0x26662d;var _0xa3aa39;return db[_0x43c6('0x41')][_0x43c6('0x52')]({'where':{'id':_0x1eba4e[_0x43c6('0x4f')]['id']}})[_0x43c6('0x25')](handleEntityNotFound(_0x915e5f,null))['then'](function(_0x589283){if(_0x589283){_0x26662d=_0x589283;_0x473550['model']=_[_0x43c6('0x46')](db[_0x43c6('0x5f')]['rawAttributes']);_0x473550['query']=_[_0x43c6('0x46')](_0x1eba4e[_0x43c6('0x33')]);_0x473550['filters']=_[_0x43c6('0x36')](_0x473550[_0x43c6('0x32')],_0x473550[_0x43c6('0x33')]);_0x5415a2['attributes']=_[_0x43c6('0x36')](_0x473550['model'],qs[_0x43c6('0x37')](_0x1eba4e[_0x43c6('0x33')][_0x43c6('0x37')]));_0x5415a2[_0x43c6('0x35')]=_0x5415a2[_0x43c6('0x35')][_0x43c6('0x38')]?_0x5415a2['attributes']:_0x473550['model'];_0x5415a2[_0x43c6('0x3a')]=qs[_0x43c6('0x3b')](_0x1eba4e[_0x43c6('0x33')][_0x43c6('0x3b')]);_0x5415a2[_0x43c6('0x3c')]=qs[_0x43c6('0x34')](_[_0x43c6('0x3d')](_0x1eba4e[_0x43c6('0x33')],_0x473550[_0x43c6('0x34')]));if(_0x1eba4e[_0x43c6('0x33')]['filter']){_0x5415a2[_0x43c6('0x3c')]=_[_0x43c6('0x3f')](_0x5415a2[_0x43c6('0x3c')],{'$or':_[_0x43c6('0x2e')](_0x5415a2[_0x43c6('0x35')],function(_0x181f50){var _0x500b69={};_0x500b69[_0x181f50]={'$like':'%'+_0x1eba4e[_0x43c6('0x33')][_0x43c6('0x3e')]+'%'};return _0x500b69;})});}_0x5415a2=_[_0x43c6('0x3f')]({},_0x5415a2,_0x1eba4e[_0x43c6('0x40')]);return _0x26662d[_0x43c6('0x5e')](_0x5415a2);}})['then'](function(_0x2d4eb2){if(_0x2d4eb2){_0xa3aa39=_0x2d4eb2[_0x43c6('0x38')];if(!_0x1eba4e[_0x43c6('0x33')][_0x43c6('0x39')]('nolimit')){_0x5415a2[_0x43c6('0x20')]=qs[_0x43c6('0x20')](_0x1eba4e[_0x43c6('0x33')][_0x43c6('0x20')]);_0x5415a2[_0x43c6('0x1f')]=qs[_0x43c6('0x1f')](_0x1eba4e['query'][_0x43c6('0x1f')]);}return _0x26662d[_0x43c6('0x5e')](_0x5415a2);}})[_0x43c6('0x25')](function(_0x33657c){if(_0x33657c){return _0x33657c?{'count':_0xa3aa39,'rows':_0x33657c}:null;}})[_0x43c6('0x25')](respondWithResult(_0x915e5f,null))[_0x43c6('0x44')](handleError(_0x915e5f,null));};exports[_0x43c6('0x60')]=function(_0x6a39c1,_0x5c2c04,_0x210245){var _0x28bfe1=_0x6a39c1['body'][_0x43c6('0x61')];return db['Team']['findAll']({'where':{'id':_0x28bfe1},'attributes':['id'],'include':[{'model':db[_0x43c6('0x62')],'as':_0x43c6('0x63'),'attributes':['id','name',_0x43c6('0x64'),_0x43c6('0x65'),_0x43c6('0x66')],'raw':!![]}]})[_0x43c6('0x25')](function(_0x49b9e0){if(_0x49b9e0){var _0x35aaac=_[_0x43c6('0x67')](_0x49b9e0,function(_0x4fa0de){var _0x35484a=_0x4fa0de['get']({'plain':!![]});return _0x35484a[_0x43c6('0x63')];});return db['OpenchannelQueue'][_0x43c6('0x47')]({'where':{'id':_0x6a39c1[_0x43c6('0x4f')]['id']}})[_0x43c6('0x25')](function(_0x12c141){return db['sequelize'][_0x43c6('0x68')](function(_0x2b5ebb){return _0x12c141[_0x43c6('0x60')](_0x28bfe1,{'transaction':_0x2b5ebb})['then'](function(){return BPromise['each'](_0x35aaac,function(_0x591535){return db[_0x43c6('0x54')][_0x43c6('0x69')]({'where':{'UserId':_0x591535['id'],'OpenchannelQueueId':_0x6a39c1['params']['id']},'transaction':_0x2b5ebb});});})[_0x43c6('0x25')](function(){_0x35aaac[_0x43c6('0x6a')](function(_0xa763e1){socket[_0x43c6('0x6b')]('userOpenchannelQueue:save',{'UserId':_0xa763e1['id'],'OpenchannelQueueId':_0x12c141['id']});});});});});}})[_0x43c6('0x25')](respondWithStatusCode(_0x5c2c04,null))[_0x43c6('0x44')](handleError(_0x5c2c04,null));};exports['removeTeams']=function(_0x25d425,_0x48f629,_0x4bb862){return db[_0x43c6('0x5f')][_0x43c6('0x55')]({'where':{'id':_0x25d425[_0x43c6('0x33')]['ids']},'attributes':['id'],'include':[{'model':db[_0x43c6('0x62')],'as':_0x43c6('0x63'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x48f629,null))[_0x43c6('0x25')](function(_0x297650){var _0x4e43e7=_[_0x43c6('0x2e')](_0x297650,'id');var _0x64e20d=[];var _0x26e12d=[];var _0x1641b8=squel[_0x43c6('0x6c')]();_0x1641b8[_0x43c6('0x6d')](_0x43c6('0x6e'))[_0x43c6('0x6f')](_0x43c6('0x70'),'tq')[_0x43c6('0x71')]('user_has_teams','ut',_0x43c6('0x72'))[_0x43c6('0x3c')](_0x43c6('0x73'),_0x25d425[_0x43c6('0x4f')]['id']);for(var _0x44ae8c=0x0;_0x44ae8c<_0x297650[_0x43c6('0x38')];_0x44ae8c+=0x1){let _0x29f0e3=_0x297650[_0x44ae8c];for(var _0x271d35=0x0;_0x271d35<_0x29f0e3[_0x43c6('0x63')][_0x43c6('0x38')];_0x271d35+=0x1){let _0x5dbb73=_0x29f0e3['Agents'][_0x271d35];var _0x48446e=_0x1641b8[_0x43c6('0x74')]();_0x48446e[_0x43c6('0x3c')](_0x43c6('0x75'),_0x5dbb73['id']);_0x26e12d['push'](db[_0x43c6('0x76')][_0x43c6('0x33')](_0x48446e[_0x43c6('0x77')](),{'type':db[_0x43c6('0x76')][_0x43c6('0x78')][_0x43c6('0x79')]})[_0x43c6('0x25')](function(_0x27f75d){if(_0x27f75d['length']===0x1){return _0x5dbb73['id'];}else{var _0x1a4c5c=_[_0x43c6('0x7a')](_[_0x43c6('0x2e')](_0x27f75d,_0x43c6('0x7b')),function(_0x2ee0c3){return _[_0x43c6('0x7c')](_0x4e43e7,_0x2ee0c3);});if(_0x1a4c5c){return _0x5dbb73['id'];}}}));}}return BPromise[_0x43c6('0x7d')](_0x26e12d)[_0x43c6('0x25')](function(_0x2d7b91){_0x64e20d=_(_0x64e20d)['union'](_0x2d7b91)[_0x43c6('0x7e')]()[_0x43c6('0x7f')]();return db[_0x43c6('0x41')]['find']({'where':{'id':_0x25d425[_0x43c6('0x4f')]['id']}})[_0x43c6('0x25')](function(_0x3ee2b1){return db[_0x43c6('0x76')][_0x43c6('0x68')](function(_0x4e980c){return _0x3ee2b1['removeTeams'](_0x25d425[_0x43c6('0x33')][_0x43c6('0x61')],{'transaction':_0x4e980c})[_0x43c6('0x25')](function(){if(!_[_0x43c6('0x80')](_0x64e20d)){return _0x3ee2b1[_0x43c6('0x81')](_0x64e20d,{'transaction':_0x4e980c});}})[_0x43c6('0x25')](function(){_0x64e20d['forEach'](function(_0x8a6465){socket[_0x43c6('0x6b')](_0x43c6('0x82'),{'UserId':_0x8a6465,'OpenchannelQueueId':_0x3ee2b1['id']});});});});});});})[_0x43c6('0x25')](respondWithStatusCode(_0x48f629,null))[_0x43c6('0x44')](handleError(_0x48f629,null));};exports[_0x43c6('0x83')]=function(_0xdee30d,_0x435eec,_0x238a7a){return db[_0x43c6('0x41')][_0x43c6('0x47')]({'where':{'id':_0xdee30d[_0x43c6('0x4f')]['id']}})[_0x43c6('0x25')](handleEntityNotFound(_0x435eec,null))[_0x43c6('0x25')](function(_0x4a8644){if(_0x4a8644){return _0x4a8644[_0x43c6('0x83')](_0xdee30d['body'][_0x43c6('0x61')],_['omit'](_0xdee30d['body'],['ids','id'])||{})[_0x43c6('0x84')](function(_0x43fb45){for(var _0x387c11=0x0;_0x387c11<_0xdee30d[_0x43c6('0x49')][_0x43c6('0x61')][_0x43c6('0x38')];_0x387c11+=0x1){socket['emit'](_0x43c6('0x85'),{'UserId':Number(_0xdee30d[_0x43c6('0x49')]['ids'][_0x387c11]),'OpenchannelQueueId':Number(_0xdee30d['params']['id'])});}return _0x43fb45;});}})[_0x43c6('0x25')](respondWithResult(_0x435eec,null))[_0x43c6('0x44')](handleError(_0x435eec,null));};exports['removeAgents']=function(_0x99c21a,_0x5c1e48,_0x5d0da7){return db[_0x43c6('0x41')][_0x43c6('0x47')]({'where':{'id':_0x99c21a['params']['id']}})[_0x43c6('0x25')](handleEntityNotFound(_0x5c1e48,null))[_0x43c6('0x25')](function(_0x39d2f0){if(_0x39d2f0){return _0x39d2f0['removeAgents'](_0x99c21a[_0x43c6('0x33')][_0x43c6('0x61')])['then'](function(){if(_[_0x43c6('0x86')](_0x99c21a[_0x43c6('0x33')]['ids'])){for(var _0x4a2d79=0x0;_0x4a2d79<_0x99c21a[_0x43c6('0x33')][_0x43c6('0x61')][_0x43c6('0x38')];_0x4a2d79+=0x1){socket[_0x43c6('0x6b')](_0x43c6('0x82'),{'UserId':Number(_0x99c21a[_0x43c6('0x33')][_0x43c6('0x61')][_0x4a2d79]),'OpenchannelQueueId':Number(_0x99c21a[_0x43c6('0x4f')]['id'])});}}else{socket[_0x43c6('0x6b')](_0x43c6('0x82'),{'UserId':Number(_0x99c21a['query'][_0x43c6('0x61')]),'OpenchannelQueueId':Number(_0x99c21a[_0x43c6('0x4f')]['id'])});}});}})[_0x43c6('0x25')](respondWithStatusCode(_0x5c1e48,null))['catch'](handleError(_0x5c1e48,null));};exports[_0x43c6('0x87')]=function(_0xe2598,_0x4b118c,_0x100468){var _0x376069={};var _0x2f890d={};var _0x104345;var _0x11075f;return db[_0x43c6('0x41')][_0x43c6('0x52')]({'where':{'id':_0xe2598[_0x43c6('0x4f')]['id']}})['then'](handleEntityNotFound(_0x4b118c,null))['then'](function(_0x3adba2){if(_0x3adba2){_0x104345=_0x3adba2;_0x2f890d['model']=_['keys'](db[_0x43c6('0x62')][_0x43c6('0x2f')]);_0x2f890d[_0x43c6('0x33')]=_['keys'](_0xe2598['query']);_0x2f890d[_0x43c6('0x34')]=_[_0x43c6('0x36')](_0x2f890d['model'],_0x2f890d['query']);_0x376069['attributes']=_['intersection'](_0x2f890d[_0x43c6('0x32')],qs[_0x43c6('0x37')](_0xe2598[_0x43c6('0x33')][_0x43c6('0x37')]));_0x376069[_0x43c6('0x35')]=_0x376069[_0x43c6('0x35')][_0x43c6('0x38')]?_0x376069[_0x43c6('0x35')]:_0x2f890d[_0x43c6('0x32')];_0x376069[_0x43c6('0x3a')]=qs['sort'](_0xe2598['query'][_0x43c6('0x3b')]);_0x376069[_0x43c6('0x3c')]=qs[_0x43c6('0x34')](_[_0x43c6('0x3d')](_0xe2598[_0x43c6('0x33')],_0x2f890d['filters']));if(_0xe2598[_0x43c6('0x33')][_0x43c6('0x3e')]){_0x376069[_0x43c6('0x3c')]=_[_0x43c6('0x3f')](_0x376069['where'],{'$or':_[_0x43c6('0x2e')](_0x376069['attributes'],function(_0x144b4f){var _0x45098e={};_0x45098e[_0x144b4f]={'$like':'%'+_0xe2598[_0x43c6('0x33')][_0x43c6('0x3e')]+'%'};return _0x45098e;})});}_0x376069=_['merge']({},_0x376069,_0xe2598[_0x43c6('0x40')]);return _0x104345['getAgents'](_0x376069);}})['then'](function(_0x34695e){if(_0x34695e){_0x11075f=_0x34695e[_0x43c6('0x38')];if(!_0xe2598[_0x43c6('0x33')][_0x43c6('0x39')](_0x43c6('0x53'))){_0x376069['limit']=qs[_0x43c6('0x20')](_0xe2598[_0x43c6('0x33')][_0x43c6('0x20')]);_0x376069[_0x43c6('0x1f')]=qs['offset'](_0xe2598[_0x43c6('0x33')]['offset']);}return _0x104345[_0x43c6('0x87')](_0x376069);}})['then'](function(_0x6f4770){if(_0x6f4770){return _0x6f4770?{'count':_0x11075f,'rows':_0x6f4770}:null;}})[_0x43c6('0x25')](respondWithResult(_0x4b118c,null))[_0x43c6('0x44')](handleError(_0x4b118c,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 4f160ae..5f03a66 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 _0xad0d=['events','../../mysqldb','OpenchannelQueue','setMaxListeners','update','remove','emit','hook'];(function(_0x5bf309,_0x4c1c1b){var _0x42a1ed=function(_0x5e7d8a){while(--_0x5e7d8a){_0x5bf309['push'](_0x5bf309['shift']());}};_0x42a1ed(++_0x4c1c1b);}(_0xad0d,0x98));var _0xdad0=function(_0xd78bd0,_0x428c14){_0xd78bd0=_0xd78bd0-0x0;var _0x21cecd=_0xad0d[_0xd78bd0];return _0x21cecd;};'use strict';var EventEmitter=require(_0xdad0('0x0'));var OpenchannelQueue=require(_0xdad0('0x1'))['db'][_0xdad0('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xdad0('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xdad0('0x4'),'afterDestroy':_0xdad0('0x5')};function emitEvent(_0x86196d){return function(_0xc34b95,_0x20fc1c,_0x476c25){OpenchannelQueueEvents[_0xdad0('0x6')](_0x86196d+':'+_0xc34b95['id'],_0xc34b95);OpenchannelQueueEvents[_0xdad0('0x6')](_0x86196d,_0xc34b95);_0x476c25(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue[_0xdad0('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file +var _0xba6a=['events','save','remove','emit','hasOwnProperty','hook'];(function(_0x4f749a,_0x541f4f){var _0x1152b7=function(_0xca0409){while(--_0xca0409){_0x4f749a['push'](_0x4f749a['shift']());}};_0x1152b7(++_0x541f4f);}(_0xba6a,0x19e));var _0xaba6=function(_0xf79bae,_0x263b2a){_0xf79bae=_0xf79bae-0x0;var _0x5d2cb7=_0xba6a[_0xf79bae];return _0x5d2cb7;};'use strict';var EventEmitter=require(_0xaba6('0x0'));var OpenchannelQueue=require('../../mysqldb')['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xaba6('0x1'),'afterUpdate':'update','afterDestroy':_0xaba6('0x2')};function emitEvent(_0x2b7a57){return function(_0xb9268b,_0x52388e,_0x518e15){OpenchannelQueueEvents['emit'](_0x2b7a57+':'+_0xb9268b['id'],_0xb9268b);OpenchannelQueueEvents[_0xaba6('0x3')](_0x2b7a57,_0xb9268b);_0x518e15(null);};}for(var e in events){if(events[_0xaba6('0x4')](e)){var event=events[e];OpenchannelQueue[_0xaba6('0x5')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index ac926c9..90e1295 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 _0x0aee=['exports','define','lodash','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x0aee,0xe8));var _0xe0ae=function(_0x41f991,_0x19c930){_0x41f991=_0x41f991-0x0;var _0x5aafaa=_0x0aee[_0x41f991];return _0x5aafaa;};'use strict';var _=require(_0xe0ae('0x0'));var util=require('util');var logger=require(_0xe0ae('0x1'))(_0xe0ae('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe0ae('0x3'));var fs=require('fs');var path=require(_0xe0ae('0x4'));var rimraf=require(_0xe0ae('0x5'));var config=require(_0xe0ae('0x6'));var attributes=require(_0xe0ae('0x7'));module[_0xe0ae('0x8')]=function(_0x16db47,_0x2eca5a){return _0x16db47[_0xe0ae('0x9')]('OpenchannelQueue',attributes,{'tableName':'openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdec6=['moment','path','rimraf','../../config/environment','./openchannelQueue.attributes','exports','define','OpenchannelQueue','lodash','../../config/logger','api'];(function(_0x1bba84,_0x387145){var _0x574857=function(_0x42caf5){while(--_0x42caf5){_0x1bba84['push'](_0x1bba84['shift']());}};_0x574857(++_0x387145);}(_0xdec6,0xe4));var _0x6dec=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0xdec6[_0x2ec461];return _0x28603d;};'use strict';var _=require(_0x6dec('0x0'));var util=require('util');var logger=require(_0x6dec('0x1'))(_0x6dec('0x2'));var moment=require(_0x6dec('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6dec('0x4'));var rimraf=require(_0x6dec('0x5'));var config=require(_0x6dec('0x6'));var attributes=require(_0x6dec('0x7'));module[_0x6dec('0x8')]=function(_0x3bdb95,_0x373a64){return _0x3bdb95[_0x6dec('0x9')](_0x6dec('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 568bd30..22e1150 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 _0xe127=['result','catch','GetOpenchannelQueue','OpenchannelQueue','options','raw','where','attributes','limit','include','model','map','ShowOpenchannelQueue','find','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','./openchannelQueue.socket','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x3f38b0,_0x38ba25){var _0x475fd9=function(_0x4d9ccf){while(--_0x4d9ccf){_0x3f38b0['push'](_0x3f38b0['shift']());}};_0x475fd9(++_0x38ba25);}(_0xe127,0x1e2));var _0x7e12=function(_0x2594d6,_0x5df875){_0x2594d6=_0x2594d6-0x0;var _0x226f3f=_0xe127[_0x2594d6];return _0x226f3f;};'use strict';var _=require('lodash');var util=require(_0x7e12('0x0'));var moment=require(_0x7e12('0x1'));var BPromise=require('bluebird');var rs=require(_0x7e12('0x2'));var fs=require('fs');var Redis=require(_0x7e12('0x3'));var db=require(_0x7e12('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7e12('0x5'))(_0x7e12('0x6'));var config=require(_0x7e12('0x7'));var jayson=require(_0x7e12('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x7e12('0x9')]=_[_0x7e12('0xa')](config['redis'],{'host':_0x7e12('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7e12('0x9')]));require(_0x7e12('0xc'))['register'](socket);function respondWithRpcPromise(_0x17ba99,_0x477556,_0x198021){return new BPromise(function(_0x4f01a6,_0x41bee1){return client['request'](_0x17ba99,_0x198021)[_0x7e12('0xd')](function(_0x31ee92){logger[_0x7e12('0xe')](_0x7e12('0xf'),_0x477556,_0x7e12('0x10'));logger[_0x7e12('0x11')](_0x7e12('0x12'),_0x477556,_0x7e12('0x10'),JSON[_0x7e12('0x13')](_0x31ee92));if(_0x31ee92['error']){if(_0x31ee92['error']['code']===0x1f4){logger['error'](_0x7e12('0xf'),_0x477556,_0x31ee92[_0x7e12('0x14')]['message']);return _0x41bee1(_0x31ee92[_0x7e12('0x14')][_0x7e12('0x15')]);}logger[_0x7e12('0x14')](_0x7e12('0xf'),_0x477556,_0x31ee92[_0x7e12('0x14')][_0x7e12('0x15')]);return _0x4f01a6(_0x31ee92[_0x7e12('0x14')][_0x7e12('0x15')]);}else{logger[_0x7e12('0xe')](_0x7e12('0xf'),_0x477556,_0x7e12('0x10'));_0x4f01a6(_0x31ee92[_0x7e12('0x16')]['message']);}})[_0x7e12('0x17')](function(_0xa5c0dd){logger[_0x7e12('0x14')](_0x7e12('0xf'),_0x477556,_0xa5c0dd);_0x41bee1(_0xa5c0dd);});});}exports[_0x7e12('0x18')]=function(_0x2e46c9){var _0x2cd5a8=this;return new Promise(function(_0x38266e,_0x55de45){return db[_0x7e12('0x19')]['findAll']({'raw':_0x2e46c9['options']?_0x2e46c9[_0x7e12('0x1a')][_0x7e12('0x1b')]===undefined?!![]:![]:!![],'where':_0x2e46c9[_0x7e12('0x1a')]?_0x2e46c9[_0x7e12('0x1a')][_0x7e12('0x1c')]||null:null,'attributes':_0x2e46c9[_0x7e12('0x1a')]?_0x2e46c9[_0x7e12('0x1a')][_0x7e12('0x1d')]||null:null,'limit':_0x2e46c9[_0x7e12('0x1a')]?_0x2e46c9[_0x7e12('0x1a')][_0x7e12('0x1e')]||null:null,'include':_0x2e46c9[_0x7e12('0x1a')]?_0x2e46c9['options'][_0x7e12('0x1f')]?_['map'](_0x2e46c9[_0x7e12('0x1a')][_0x7e12('0x1f')],function(_0x2dc8ce){return{'model':db[_0x2dc8ce[_0x7e12('0x20')]],'as':_0x2dc8ce['as'],'attributes':_0x2dc8ce[_0x7e12('0x1d')],'include':_0x2dc8ce['include']?_[_0x7e12('0x21')](_0x2dc8ce[_0x7e12('0x1f')],function(_0x5930e6){return{'model':db[_0x5930e6[_0x7e12('0x20')]],'as':_0x5930e6['as'],'attributes':_0x5930e6['attributes'],'include':_0x5930e6['include']?_[_0x7e12('0x21')](_0x5930e6[_0x7e12('0x1f')],function(_0x4f0c58){return{'model':db[_0x4f0c58[_0x7e12('0x20')]],'as':_0x4f0c58['as'],'attributes':_0x4f0c58[_0x7e12('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x7e12('0xd')](function(_0x3c191e){logger[_0x7e12('0xe')]('GetOpenchannelQueue',_0x2e46c9);logger[_0x7e12('0x11')](_0x7e12('0x18'),_0x2e46c9,JSON[_0x7e12('0x13')](_0x3c191e));_0x38266e(_0x3c191e);})[_0x7e12('0x17')](function(_0x1d59fa){logger[_0x7e12('0x14')]('GetOpenchannelQueue',_0x1d59fa[_0x7e12('0x15')],_0x2e46c9);_0x55de45(_0x2cd5a8['error'](0x1f4,_0x1d59fa[_0x7e12('0x15')]));});});};exports[_0x7e12('0x22')]=function(_0x163b86){var _0x15e789=this;return new Promise(function(_0x38e2b6,_0x127a7c){return db[_0x7e12('0x19')][_0x7e12('0x23')]({'raw':_0x163b86['options']?_0x163b86[_0x7e12('0x1a')][_0x7e12('0x1b')]===undefined?!![]:![]:!![],'where':_0x163b86[_0x7e12('0x1a')]?_0x163b86[_0x7e12('0x1a')][_0x7e12('0x1c')]||null:null,'attributes':_0x163b86['options']?_0x163b86[_0x7e12('0x1a')]['attributes']||null:null,'include':_0x163b86[_0x7e12('0x1a')]?_0x163b86[_0x7e12('0x1a')][_0x7e12('0x1f')]?_['map'](_0x163b86['options'][_0x7e12('0x1f')],function(_0x3d858e){return{'model':db[_0x3d858e[_0x7e12('0x20')]],'as':_0x3d858e['as'],'attributes':_0x3d858e[_0x7e12('0x1d')],'include':_0x3d858e[_0x7e12('0x1f')]?_[_0x7e12('0x21')](_0x3d858e[_0x7e12('0x1f')],function(_0x4f6c3d){return{'model':db[_0x4f6c3d[_0x7e12('0x20')]],'as':_0x4f6c3d['as'],'attributes':_0x4f6c3d[_0x7e12('0x1d')],'include':_0x4f6c3d['include']?_[_0x7e12('0x21')](_0x4f6c3d[_0x7e12('0x1f')],function(_0x4289e2){return{'model':db[_0x4289e2[_0x7e12('0x20')]],'as':_0x4289e2['as'],'attributes':_0x4289e2[_0x7e12('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x7e12('0xd')](function(_0xe47e49){logger[_0x7e12('0xe')](_0x7e12('0x22'),_0x163b86);logger[_0x7e12('0x11')]('ShowOpenchannelQueue',_0x163b86,JSON[_0x7e12('0x13')](_0xe47e49));_0x38e2b6(_0xe47e49);})[_0x7e12('0x17')](function(_0x491f26){logger[_0x7e12('0x14')](_0x7e12('0x22'),_0x491f26[_0x7e12('0x15')],_0x163b86);_0x127a7c(_0x15e789[_0x7e12('0x14')](0x1f4,_0x491f26['message']));});});}; \ No newline at end of file +var _0x0b9d=['where','attributes','map','include','model','ShowOpenchannelQueue','OpenchannelQueue','find','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./openchannelQueue.socket','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetOpenchannelQueue','findAll','options','raw'];(function(_0xd92ffd,_0x5c38eb){var _0x8adb0b=function(_0x44b145){while(--_0x44b145){_0xd92ffd['push'](_0xd92ffd['shift']());}};_0x8adb0b(++_0x5c38eb);}(_0x0b9d,0xfe));var _0xd0b9=function(_0x1779b0,_0x4bc60f){_0x1779b0=_0x1779b0-0x0;var _0x5d4883=_0x0b9d[_0x1779b0];return _0x5d4883;};'use strict';var _=require('lodash');var util=require(_0xd0b9('0x0'));var moment=require(_0xd0b9('0x1'));var BPromise=require(_0xd0b9('0x2'));var rs=require(_0xd0b9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd0b9('0x4'))['db'];var utils=require(_0xd0b9('0x5'));var logger=require(_0xd0b9('0x6'))(_0xd0b9('0x7'));var config=require(_0xd0b9('0x8'));var jayson=require(_0xd0b9('0x9'));var client=jayson[_0xd0b9('0xa')]['http']({'port':0x232a});config[_0xd0b9('0xb')]=_[_0xd0b9('0xc')](config[_0xd0b9('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xd0b9('0xd'))(new Redis(config['redis']));require(_0xd0b9('0xe'))[_0xd0b9('0xf')](socket);function respondWithRpcPromise(_0x409356,_0x2c23b6,_0x5422a6){return new BPromise(function(_0x135e4f,_0x1d182b){return client[_0xd0b9('0x10')](_0x409356,_0x5422a6)[_0xd0b9('0x11')](function(_0x227fa5){logger[_0xd0b9('0x12')](_0xd0b9('0x13'),_0x2c23b6,'request\x20sent');logger[_0xd0b9('0x14')](_0xd0b9('0x15'),_0x2c23b6,_0xd0b9('0x16'),JSON[_0xd0b9('0x17')](_0x227fa5));if(_0x227fa5['error']){if(_0x227fa5[_0xd0b9('0x18')][_0xd0b9('0x19')]===0x1f4){logger[_0xd0b9('0x18')](_0xd0b9('0x13'),_0x2c23b6,_0x227fa5[_0xd0b9('0x18')][_0xd0b9('0x1a')]);return _0x1d182b(_0x227fa5['error'][_0xd0b9('0x1a')]);}logger[_0xd0b9('0x18')](_0xd0b9('0x13'),_0x2c23b6,_0x227fa5[_0xd0b9('0x18')]['message']);return _0x135e4f(_0x227fa5[_0xd0b9('0x18')][_0xd0b9('0x1a')]);}else{logger[_0xd0b9('0x12')]('OpenchannelQueue,\x20%s,\x20%s',_0x2c23b6,_0xd0b9('0x16'));_0x135e4f(_0x227fa5[_0xd0b9('0x1b')][_0xd0b9('0x1a')]);}})[_0xd0b9('0x1c')](function(_0x360256){logger[_0xd0b9('0x18')](_0xd0b9('0x13'),_0x2c23b6,_0x360256);_0x1d182b(_0x360256);});});}exports[_0xd0b9('0x1d')]=function(_0x1fcef9){var _0x5cac5c=this;return new Promise(function(_0x4f8174,_0x433111){return db['OpenchannelQueue'][_0xd0b9('0x1e')]({'raw':_0x1fcef9[_0xd0b9('0x1f')]?_0x1fcef9[_0xd0b9('0x1f')][_0xd0b9('0x20')]===undefined?!![]:![]:!![],'where':_0x1fcef9[_0xd0b9('0x1f')]?_0x1fcef9[_0xd0b9('0x1f')][_0xd0b9('0x21')]||null:null,'attributes':_0x1fcef9[_0xd0b9('0x1f')]?_0x1fcef9[_0xd0b9('0x1f')][_0xd0b9('0x22')]||null:null,'limit':_0x1fcef9[_0xd0b9('0x1f')]?_0x1fcef9[_0xd0b9('0x1f')]['limit']||null:null,'include':_0x1fcef9['options']?_0x1fcef9[_0xd0b9('0x1f')]['include']?_[_0xd0b9('0x23')](_0x1fcef9['options'][_0xd0b9('0x24')],function(_0xe6b5d2){return{'model':db[_0xe6b5d2['model']],'as':_0xe6b5d2['as'],'attributes':_0xe6b5d2[_0xd0b9('0x22')],'include':_0xe6b5d2[_0xd0b9('0x24')]?_[_0xd0b9('0x23')](_0xe6b5d2[_0xd0b9('0x24')],function(_0x1b734a){return{'model':db[_0x1b734a[_0xd0b9('0x25')]],'as':_0x1b734a['as'],'attributes':_0x1b734a[_0xd0b9('0x22')],'include':_0x1b734a[_0xd0b9('0x24')]?_[_0xd0b9('0x23')](_0x1b734a['include'],function(_0x4da054){return{'model':db[_0x4da054[_0xd0b9('0x25')]],'as':_0x4da054['as'],'attributes':_0x4da054[_0xd0b9('0x22')]};}):[]};}):[]};}):[]:[]})[_0xd0b9('0x11')](function(_0x3b34e2){logger['info'](_0xd0b9('0x1d'),_0x1fcef9);logger['debug'](_0xd0b9('0x1d'),_0x1fcef9,JSON[_0xd0b9('0x17')](_0x3b34e2));_0x4f8174(_0x3b34e2);})[_0xd0b9('0x1c')](function(_0xdfff94){logger['error'](_0xd0b9('0x1d'),_0xdfff94[_0xd0b9('0x1a')],_0x1fcef9);_0x433111(_0x5cac5c['error'](0x1f4,_0xdfff94[_0xd0b9('0x1a')]));});});};exports[_0xd0b9('0x26')]=function(_0x3808ca){var _0x4ce8ad=this;return new Promise(function(_0x1e64d9,_0x4219fd){return db[_0xd0b9('0x27')][_0xd0b9('0x28')]({'raw':_0x3808ca['options']?_0x3808ca['options'][_0xd0b9('0x20')]===undefined?!![]:![]:!![],'where':_0x3808ca[_0xd0b9('0x1f')]?_0x3808ca[_0xd0b9('0x1f')]['where']||null:null,'attributes':_0x3808ca[_0xd0b9('0x1f')]?_0x3808ca[_0xd0b9('0x1f')][_0xd0b9('0x22')]||null:null,'include':_0x3808ca[_0xd0b9('0x1f')]?_0x3808ca[_0xd0b9('0x1f')][_0xd0b9('0x24')]?_[_0xd0b9('0x23')](_0x3808ca[_0xd0b9('0x1f')][_0xd0b9('0x24')],function(_0x128a2b){return{'model':db[_0x128a2b[_0xd0b9('0x25')]],'as':_0x128a2b['as'],'attributes':_0x128a2b[_0xd0b9('0x22')],'include':_0x128a2b[_0xd0b9('0x24')]?_['map'](_0x128a2b[_0xd0b9('0x24')],function(_0x5a31ab){return{'model':db[_0x5a31ab['model']],'as':_0x5a31ab['as'],'attributes':_0x5a31ab['attributes'],'include':_0x5a31ab[_0xd0b9('0x24')]?_[_0xd0b9('0x23')](_0x5a31ab['include'],function(_0x490205){return{'model':db[_0x490205[_0xd0b9('0x25')]],'as':_0x490205['as'],'attributes':_0x490205['attributes']};}):[]};}):[]};}):[]:[]})[_0xd0b9('0x11')](function(_0x4f0ccf){logger[_0xd0b9('0x12')](_0xd0b9('0x26'),_0x3808ca);logger['debug']('ShowOpenchannelQueue',_0x3808ca,JSON['stringify'](_0x4f0ccf));_0x1e64d9(_0x4f0ccf);})[_0xd0b9('0x1c')](function(_0x492233){logger['error']('ShowOpenchannelQueue',_0x492233[_0xd0b9('0x1a')],_0x3808ca);_0x4219fd(_0x4ce8ad[_0xd0b9('0x18')](0x1f4,_0x492233['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 34dd1be..2bfb72b 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 _0x182f=['length','openchannelQueue:','./openchannelQueue.events','save','update','emit'];(function(_0x93fe3a,_0x52ba4e){var _0x35f7ce=function(_0x259567){while(--_0x259567){_0x93fe3a['push'](_0x93fe3a['shift']());}};_0x35f7ce(++_0x52ba4e);}(_0x182f,0xaa));var _0xf182=function(_0x42f05a,_0x27b3b3){_0x42f05a=_0x42f05a-0x0;var _0x524c2a=_0x182f[_0x42f05a];return _0x524c2a;};'use strict';var OpenchannelQueueEvents=require(_0xf182('0x0'));var events=[_0xf182('0x1'),'remove',_0xf182('0x2')];function createListener(_0x46614c,_0x479119){return function(_0x3375c1){_0x479119[_0xf182('0x3')](_0x46614c,_0x3375c1);};}function removeListener(_0x808f1f,_0x1092b3){return function(){OpenchannelQueueEvents['removeListener'](_0x808f1f,_0x1092b3);};}exports['register']=function(_0x1b7401){for(var _0x23beb7=0x0,_0x5377fd=events[_0xf182('0x4')];_0x23beb7<_0x5377fd;_0x23beb7++){var _0x22e98f=events[_0x23beb7];var _0x5ac689=createListener(_0xf182('0x5')+_0x22e98f,_0x1b7401);OpenchannelQueueEvents['on'](_0x22e98f,_0x5ac689);}}; \ No newline at end of file +var _0x3783=['removeListener','register','length','./openchannelQueue.events','save','remove','update','emit'];(function(_0x30121e,_0x240c86){var _0x4ba328=function(_0x2601c1){while(--_0x2601c1){_0x30121e['push'](_0x30121e['shift']());}};_0x4ba328(++_0x240c86);}(_0x3783,0xc3));var _0x3378=function(_0x210431,_0x1834dd){_0x210431=_0x210431-0x0;var _0x9948fa=_0x3783[_0x210431];return _0x9948fa;};'use strict';var OpenchannelQueueEvents=require(_0x3378('0x0'));var events=[_0x3378('0x1'),_0x3378('0x2'),_0x3378('0x3')];function createListener(_0x1d4d7f,_0x48ca24){return function(_0x9f1240){_0x48ca24[_0x3378('0x4')](_0x1d4d7f,_0x9f1240);};}function removeListener(_0x408bdd,_0xbb371c){return function(){OpenchannelQueueEvents[_0x3378('0x5')](_0x408bdd,_0xbb371c);};}exports[_0x3378('0x6')]=function(_0x51bf13){for(var _0x5f2bb2=0x0,_0x269260=events[_0x3378('0x7')];_0x5f2bb2<_0x269260;_0x5f2bb2++){var _0x2b5b9e=events[_0x5f2bb2];var _0x40f2b7=createListener('openchannelQueue:'+_0x2b5b9e,_0x51bf13);OpenchannelQueueEvents['on'](_0x2b5b9e,_0x40f2b7);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index e7972aa..a092166 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 _0xa9f4=['./openchannelQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','update','delete','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x784e31,_0x51f0f1){var _0x221db5=function(_0x18c42c){while(--_0x18c42c){_0x784e31['push'](_0x784e31['shift']());}};_0x221db5(++_0x51f0f1);}(_0xa9f4,0x14d));var _0x4a9f=function(_0x3cfa5a,_0x3f051d){_0x3cfa5a=_0x3cfa5a-0x0;var _0x3c882e=_0xa9f4[_0x3cfa5a];return _0x3c882e;};'use strict';var multer=require('multer');var util=require(_0x4a9f('0x0'));var path=require(_0x4a9f('0x1'));var timeout=require(_0x4a9f('0x2'));var express=require('express');var router=express[_0x4a9f('0x3')]();var fs_extra=require(_0x4a9f('0x4'));var auth=require(_0x4a9f('0x5'));var interaction=require(_0x4a9f('0x6'));var config=require('../../config/environment');var controller=require(_0x4a9f('0x7'));router[_0x4a9f('0x8')]('/',auth[_0x4a9f('0x9')](),controller['index']);router['get'](_0x4a9f('0xa'),auth[_0x4a9f('0x9')](),controller[_0x4a9f('0xb')]);router['get'](_0x4a9f('0xc'),auth[_0x4a9f('0x9')](),controller[_0x4a9f('0xd')]);router[_0x4a9f('0xe')]('/',auth[_0x4a9f('0x9')](),controller[_0x4a9f('0xf')]);router[_0x4a9f('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x4a9f('0x11')]);router[_0x4a9f('0x12')]('/:id',auth[_0x4a9f('0x9')](),controller['destroy']);module[_0x4a9f('0x13')]=router; \ No newline at end of file +var _0x6a46=['/:id','post','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','isAuthenticated','index','/describe','describe'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x6a46,0x180));var _0x66a4=function(_0x33efcc,_0x3d4ed8){_0x33efcc=_0x33efcc-0x0;var _0x2da3a1=_0x6a46[_0x33efcc];return _0x2da3a1;};'use strict';var multer=require(_0x66a4('0x0'));var util=require(_0x66a4('0x1'));var path=require(_0x66a4('0x2'));var timeout=require(_0x66a4('0x3'));var express=require(_0x66a4('0x4'));var router=express[_0x66a4('0x5')]();var fs_extra=require(_0x66a4('0x6'));var auth=require(_0x66a4('0x7'));var interaction=require(_0x66a4('0x8'));var config=require(_0x66a4('0x9'));var controller=require(_0x66a4('0xa'));router['get']('/',auth[_0x66a4('0xb')](),controller[_0x66a4('0xc')]);router['get'](_0x66a4('0xd'),auth[_0x66a4('0xb')](),controller[_0x66a4('0xe')]);router['get'](_0x66a4('0xf'),auth[_0x66a4('0xb')](),controller['show']);router[_0x66a4('0x10')]('/',auth[_0x66a4('0xb')](),controller['create']);router['put']('/:id',auth[_0x66a4('0xb')](),controller[_0x66a4('0x11')]);router['delete'](_0x66a4('0xf'),auth[_0x66a4('0xb')](),controller[_0x66a4('0x12')]);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 7dcf7d0..f613c29 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 _0x9fc3=['DATE','moment','exports','STRING'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x9fc3,0x199));var _0x39fc=function(_0x4d8182,_0x304d9c){_0x4d8182=_0x4d8182-0x0;var _0x10e3ef=_0x9fc3[_0x4d8182];return _0x10e3ef;};'use strict';var moment=require(_0x39fc('0x0'));var Sequelize=require('sequelize');module[_0x39fc('0x1')]={'uniqueid':{'type':Sequelize[_0x39fc('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x39fc('0x2')]},'joinAt':{'type':Sequelize[_0x39fc('0x3')]},'leaveAt':{'type':Sequelize[_0x39fc('0x3')]},'acceptAt':{'type':Sequelize[_0x39fc('0x3')]},'exitAt':{'type':Sequelize[_0x39fc('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x5966=['moment','sequelize','STRING','DATE'];(function(_0x1e9124,_0x4c1ed1){var _0x42def8=function(_0xc9f57f){while(--_0xc9f57f){_0x1e9124['push'](_0x1e9124['shift']());}};_0x42def8(++_0x4c1ed1);}(_0x5966,0xdc));var _0x6596=function(_0x1073ad,_0x44bf0b){_0x1073ad=_0x1073ad-0x0;var _0x528474=_0x5966[_0x1073ad];return _0x528474;};'use strict';var moment=require(_0x6596('0x0'));var Sequelize=require(_0x6596('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x6596('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x6596('0x2')]},'joinAt':{'type':Sequelize[_0x6596('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x6596('0x3')]},'exitAt':{'type':Sequelize[_0x6596('0x3')]},'reason':{'type':Sequelize[_0x6596('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index cae768d..8ea5068 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 _0xad2f=['../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','end','undefined','count','offset','json','save','update','then','destroy','sendStatus','name','send','map','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','nolimit','limit','order','filters','filter','where','VIRTUAL','merge','OpenchannelQueueReport','include','rows','catch','show','params','includeAll','create','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xad2f,0x74));var _0xfad2=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xad2f[_0x618414];return _0x21c19a;};'use strict';var emlformat=require(_0xfad2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfad2('0x1'));var jsonpatch=require(_0xfad2('0x2'));var rp=require(_0xfad2('0x3'));var moment=require(_0xfad2('0x4'));var BPromise=require(_0xfad2('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xfad2('0x6'));var sox=require(_0xfad2('0x7'));var csv=require(_0xfad2('0x8'));var ejs=require(_0xfad2('0x9'));var fs=require('fs');var fs_extra=require(_0xfad2('0xa'));var _=require(_0xfad2('0xb'));var squel=require(_0xfad2('0xc'));var crypto=require(_0xfad2('0xd'));var jsforce=require(_0xfad2('0xe'));var deskjs=require(_0xfad2('0xf'));var toCsv=require('to-csv');var querystring=require(_0xfad2('0x10'));var Papa=require(_0xfad2('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xfad2('0x12'));var as=require(_0xfad2('0x13'));var hardwareService=require(_0xfad2('0x14'));var logger=require(_0xfad2('0x15'))('api');var utils=require(_0xfad2('0x16'));var config=require(_0xfad2('0x17'));var licenseUtil=require(_0xfad2('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x100bf5,_0x21f0b4){_0x21f0b4=_0x21f0b4||0xcc;return function(_0x1a818){if(_0x1a818){return _0x100bf5['sendStatus'](_0x21f0b4);}return _0x100bf5[_0xfad2('0x19')](_0x21f0b4)[_0xfad2('0x1a')]();};}function respondWithResult(_0x3aa3fd,_0x2f5853){_0x2f5853=_0x2f5853||0xc8;return function(_0x36cd4f){if(_0x36cd4f){return _0x3aa3fd[_0xfad2('0x19')](_0x2f5853)['json'](_0x36cd4f);}};}function respondWithFilteredResult(_0x45d819,_0x4b7cbd){return function(_0x25bdd2){if(_0x25bdd2){var _0x5d600d=typeof _0x4b7cbd['offset']===_0xfad2('0x1b')&&typeof _0x4b7cbd['limit']===_0xfad2('0x1b');var _0x5ec770=_0x25bdd2[_0xfad2('0x1c')];var _0x1236f5=_0x5d600d?0x0:_0x4b7cbd[_0xfad2('0x1d')];var _0x3023c2=_0x5d600d?_0x25bdd2[_0xfad2('0x1c')]:_0x4b7cbd[_0xfad2('0x1d')]+_0x4b7cbd['limit'];var _0x2da79e;if(_0x3023c2>=_0x5ec770){_0x3023c2=_0x5ec770;_0x2da79e=0xc8;}else{_0x2da79e=0xce;}_0x45d819[_0xfad2('0x19')](_0x2da79e);return _0x45d819['set']('Content-Range',_0x1236f5+'-'+_0x3023c2+'/'+_0x5ec770)[_0xfad2('0x1e')](_0x25bdd2);}return null;};}function patchUpdates(_0x27e990){return function(_0x481484){try{jsonpatch['apply'](_0x481484,_0x27e990,!![]);}catch(_0x562de6){return BPromise['reject'](_0x562de6);}return _0x481484[_0xfad2('0x1f')]();};}function saveUpdates(_0x3b6b8f,_0x295638){return function(_0x36571b){if(_0x36571b){return _0x36571b[_0xfad2('0x20')](_0x3b6b8f)[_0xfad2('0x21')](function(_0x386d83){return _0x386d83;});}return null;};}function removeEntity(_0x175c67,_0x3f6da0){return function(_0xa508ff){if(_0xa508ff){return _0xa508ff[_0xfad2('0x22')]()[_0xfad2('0x21')](function(){_0x175c67['status'](0xcc)[_0xfad2('0x1a')]();});}};}function handleEntityNotFound(_0x39bb5a,_0x389aea){return function(_0x5e04f0){if(!_0x5e04f0){_0x39bb5a[_0xfad2('0x23')](0x194);}return _0x5e04f0;};}function handleError(_0x4c2204,_0x32bf09){_0x32bf09=_0x32bf09||0x1f4;return function(_0x56cd75){logger['error'](_0x56cd75['stack']);if(_0x56cd75[_0xfad2('0x24')]){delete _0x56cd75['name'];}_0x4c2204[_0xfad2('0x19')](_0x32bf09)[_0xfad2('0x25')](_0x56cd75);};}exports['index']=function(_0x48b5ac,_0xf6f518){var _0x5e7230={},_0x2644f8={},_0x26e2f9={'count':0x0,'rows':[]};var _0x337b31=_[_0xfad2('0x26')](db['OpenchannelQueueReport'][_0xfad2('0x27')],function(_0x469330){return{'name':_0x469330[_0xfad2('0x28')],'type':_0x469330[_0xfad2('0x29')]['key']};});_0x2644f8[_0xfad2('0x2a')]=_[_0xfad2('0x26')](_0x337b31,'name');_0x2644f8[_0xfad2('0x2b')]=_[_0xfad2('0x2c')](_0x48b5ac[_0xfad2('0x2b')]);_0x2644f8['filters']=_[_0xfad2('0x2d')](_0x2644f8[_0xfad2('0x2a')],_0x2644f8[_0xfad2('0x2b')]);_0x5e7230[_0xfad2('0x2e')]=_['intersection'](_0x2644f8[_0xfad2('0x2a')],qs[_0xfad2('0x2f')](_0x48b5ac[_0xfad2('0x2b')][_0xfad2('0x2f')]));_0x5e7230['attributes']=_0x5e7230[_0xfad2('0x2e')][_0xfad2('0x30')]?_0x5e7230[_0xfad2('0x2e')]:_0x2644f8[_0xfad2('0x2a')];if(!_0x48b5ac[_0xfad2('0x2b')]['hasOwnProperty'](_0xfad2('0x31'))){_0x5e7230['limit']=qs[_0xfad2('0x32')](_0x48b5ac[_0xfad2('0x2b')][_0xfad2('0x32')]);_0x5e7230[_0xfad2('0x1d')]=qs[_0xfad2('0x1d')](_0x48b5ac['query'][_0xfad2('0x1d')]);}_0x5e7230[_0xfad2('0x33')]=qs['sort'](_0x48b5ac[_0xfad2('0x2b')]['sort']);_0x5e7230['where']=qs[_0xfad2('0x34')](_['pick'](_0x48b5ac[_0xfad2('0x2b')],_0x2644f8['filters']),_0x337b31);if(_0x48b5ac[_0xfad2('0x2b')][_0xfad2('0x35')]){_0x5e7230['where']=_['merge'](_0x5e7230[_0xfad2('0x36')],{'$or':_[_0xfad2('0x26')](_0x337b31,function(_0xbc1dec){if(_0xbc1dec[_0xfad2('0x29')]!==_0xfad2('0x37')){var _0x3e5766={};_0x3e5766[_0xbc1dec[_0xfad2('0x24')]]={'$like':'%'+_0x48b5ac[_0xfad2('0x2b')]['filter']+'%'};return _0x3e5766;}})});}_0x5e7230=_[_0xfad2('0x38')]({},_0x5e7230,_0x48b5ac['options']);var _0x1dfe3e={'where':_0x5e7230['where']};return db[_0xfad2('0x39')][_0xfad2('0x1c')](_0x1dfe3e)[_0xfad2('0x21')](function(_0x5aea2e){_0x26e2f9[_0xfad2('0x1c')]=_0x5aea2e;if(_0x48b5ac[_0xfad2('0x2b')]['includeAll']){_0x5e7230[_0xfad2('0x3a')]=[{'all':!![]}];}return db[_0xfad2('0x39')]['findAll'](_0x5e7230);})['then'](function(_0x54a0c7){_0x26e2f9[_0xfad2('0x3b')]=_0x54a0c7;return _0x26e2f9;})[_0xfad2('0x21')](respondWithFilteredResult(_0xf6f518,_0x5e7230))[_0xfad2('0x3c')](handleError(_0xf6f518,null));};exports[_0xfad2('0x3d')]=function(_0x4d3e0f,_0xc932d3){var _0x24b743={'raw':!![],'where':{'id':_0x4d3e0f[_0xfad2('0x3e')]['id']}},_0x3e8076={};_0x3e8076[_0xfad2('0x2a')]=_[_0xfad2('0x2c')](db[_0xfad2('0x39')][_0xfad2('0x27')]);_0x3e8076[_0xfad2('0x2b')]=_['keys'](_0x4d3e0f[_0xfad2('0x2b')]);_0x3e8076['filters']=_[_0xfad2('0x2d')](_0x3e8076['model'],_0x3e8076[_0xfad2('0x2b')]);_0x24b743[_0xfad2('0x2e')]=_['intersection'](_0x3e8076[_0xfad2('0x2a')],qs[_0xfad2('0x2f')](_0x4d3e0f[_0xfad2('0x2b')][_0xfad2('0x2f')]));_0x24b743[_0xfad2('0x2e')]=_0x24b743[_0xfad2('0x2e')][_0xfad2('0x30')]?_0x24b743['attributes']:_0x3e8076[_0xfad2('0x2a')];if(_0x4d3e0f[_0xfad2('0x2b')][_0xfad2('0x3f')]){_0x24b743['include']=[{'all':!![]}];}_0x24b743=_['merge']({},_0x24b743,_0x4d3e0f['options']);return db[_0xfad2('0x39')]['find'](_0x24b743)[_0xfad2('0x21')](handleEntityNotFound(_0xc932d3,null))[_0xfad2('0x21')](respondWithResult(_0xc932d3,null))['catch'](handleError(_0xc932d3,null));};exports[_0xfad2('0x40')]=function(_0x415769,_0x507dbd){return db[_0xfad2('0x39')][_0xfad2('0x40')](_0x415769['body'],{})[_0xfad2('0x21')](respondWithResult(_0x507dbd,0xc9))['catch'](handleError(_0x507dbd,null));};exports[_0xfad2('0x20')]=function(_0x1acced,_0x56f9a1){if(_0x1acced[_0xfad2('0x41')]['id']){delete _0x1acced[_0xfad2('0x41')]['id'];}return db[_0xfad2('0x39')][_0xfad2('0x42')]({'where':{'id':_0x1acced[_0xfad2('0x3e')]['id']}})[_0xfad2('0x21')](handleEntityNotFound(_0x56f9a1,null))['then'](saveUpdates(_0x1acced[_0xfad2('0x41')],null))[_0xfad2('0x21')](respondWithResult(_0x56f9a1,null))[_0xfad2('0x3c')](handleError(_0x56f9a1,null));};exports[_0xfad2('0x22')]=function(_0x22f6d0,_0x2effce){return db[_0xfad2('0x39')][_0xfad2('0x42')]({'where':{'id':_0x22f6d0[_0xfad2('0x3e')]['id']}})[_0xfad2('0x21')](handleEntityNotFound(_0x2effce,null))[_0xfad2('0x21')](removeEntity(_0x2effce,null))[_0xfad2('0x3c')](handleError(_0x2effce,null));};exports[_0xfad2('0x43')]=function(_0x5dd3d0,_0x36cad2){return db[_0xfad2('0x39')]['describe']()[_0xfad2('0x21')](respondWithResult(_0x36cad2,null))[_0xfad2('0x3c')](handleError(_0x36cad2,null));}; \ No newline at end of file +var _0x6fed=['type','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','params','keys','fields','find','create','body','describe','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','limit','undefined','count','Content-Range','json','save','update','then','destroy','stack','name','send','index','map','OpenchannelQueueReport','rawAttributes'];(function(_0x3cbd7d,_0x4b1bbb){var _0x26d335=function(_0x154b72){while(--_0x154b72){_0x3cbd7d['push'](_0x3cbd7d['shift']());}};_0x26d335(++_0x4b1bbb);}(_0x6fed,0x1cb));var _0xd6fe=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x6fed[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd6fe('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd6fe('0x1'));var rp=require(_0xd6fe('0x2'));var moment=require('moment');var BPromise=require(_0xd6fe('0x3'));var Mustache=require(_0xd6fe('0x4'));var util=require('util');var path=require(_0xd6fe('0x5'));var sox=require(_0xd6fe('0x6'));var csv=require(_0xd6fe('0x7'));var ejs=require(_0xd6fe('0x8'));var fs=require('fs');var fs_extra=require(_0xd6fe('0x9'));var _=require('lodash');var squel=require(_0xd6fe('0xa'));var crypto=require('crypto');var jsforce=require(_0xd6fe('0xb'));var deskjs=require(_0xd6fe('0xc'));var toCsv=require('to-csv');var querystring=require(_0xd6fe('0xd'));var Papa=require(_0xd6fe('0xe'));var Redis=require(_0xd6fe('0xf'));var authService=require(_0xd6fe('0x10'));var qs=require(_0xd6fe('0x11'));var as=require(_0xd6fe('0x12'));var hardwareService=require(_0xd6fe('0x13'));var logger=require(_0xd6fe('0x14'))(_0xd6fe('0x15'));var utils=require(_0xd6fe('0x16'));var config=require(_0xd6fe('0x17'));var licenseUtil=require(_0xd6fe('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b1ac3,_0x3cd066){_0x3cd066=_0x3cd066||0xcc;return function(_0x1893eb){if(_0x1893eb){return _0x2b1ac3[_0xd6fe('0x19')](_0x3cd066);}return _0x2b1ac3[_0xd6fe('0x1a')](_0x3cd066)[_0xd6fe('0x1b')]();};}function respondWithResult(_0x42679e,_0x1c017a){_0x1c017a=_0x1c017a||0xc8;return function(_0x5c8940){if(_0x5c8940){return _0x42679e[_0xd6fe('0x1a')](_0x1c017a)['json'](_0x5c8940);}};}function respondWithFilteredResult(_0x2155be,_0x25d904){return function(_0x32fe20){if(_0x32fe20){var _0x4eb5ec=typeof _0x25d904[_0xd6fe('0x1c')]==='undefined'&&typeof _0x25d904[_0xd6fe('0x1d')]===_0xd6fe('0x1e');var _0x48ba6a=_0x32fe20[_0xd6fe('0x1f')];var _0x1496a4=_0x4eb5ec?0x0:_0x25d904[_0xd6fe('0x1c')];var _0x15f3b4=_0x4eb5ec?_0x32fe20['count']:_0x25d904[_0xd6fe('0x1c')]+_0x25d904[_0xd6fe('0x1d')];var _0x528e3f;if(_0x15f3b4>=_0x48ba6a){_0x15f3b4=_0x48ba6a;_0x528e3f=0xc8;}else{_0x528e3f=0xce;}_0x2155be[_0xd6fe('0x1a')](_0x528e3f);return _0x2155be['set'](_0xd6fe('0x20'),_0x1496a4+'-'+_0x15f3b4+'/'+_0x48ba6a)[_0xd6fe('0x21')](_0x32fe20);}return null;};}function patchUpdates(_0x2e6e63){return function(_0x1ed00a){try{jsonpatch['apply'](_0x1ed00a,_0x2e6e63,!![]);}catch(_0x49c645){return BPromise['reject'](_0x49c645);}return _0x1ed00a[_0xd6fe('0x22')]();};}function saveUpdates(_0xcf78bd,_0x5c6aa2){return function(_0x478ce1){if(_0x478ce1){return _0x478ce1[_0xd6fe('0x23')](_0xcf78bd)[_0xd6fe('0x24')](function(_0x4f6bd8){return _0x4f6bd8;});}return null;};}function removeEntity(_0x5be1ad,_0x149831){return function(_0x3b7322){if(_0x3b7322){return _0x3b7322[_0xd6fe('0x25')]()[_0xd6fe('0x24')](function(){_0x5be1ad[_0xd6fe('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x38545a,_0x46d494){return function(_0x4ce18e){if(!_0x4ce18e){_0x38545a[_0xd6fe('0x19')](0x194);}return _0x4ce18e;};}function handleError(_0x1ab688,_0x502cfb){_0x502cfb=_0x502cfb||0x1f4;return function(_0x2500e5){logger['error'](_0x2500e5[_0xd6fe('0x26')]);if(_0x2500e5['name']){delete _0x2500e5[_0xd6fe('0x27')];}_0x1ab688['status'](_0x502cfb)[_0xd6fe('0x28')](_0x2500e5);};}exports[_0xd6fe('0x29')]=function(_0x128bc3,_0x11d71c){var _0x4d39dc={},_0x26fe96={},_0x49bcf2={'count':0x0,'rows':[]};var _0x57f71a=_[_0xd6fe('0x2a')](db[_0xd6fe('0x2b')][_0xd6fe('0x2c')],function(_0x30f5da){return{'name':_0x30f5da['fieldName'],'type':_0x30f5da[_0xd6fe('0x2d')]['key']};});_0x26fe96[_0xd6fe('0x2e')]=_[_0xd6fe('0x2a')](_0x57f71a,_0xd6fe('0x27'));_0x26fe96[_0xd6fe('0x2f')]=_['keys'](_0x128bc3[_0xd6fe('0x2f')]);_0x26fe96[_0xd6fe('0x30')]=_[_0xd6fe('0x31')](_0x26fe96['model'],_0x26fe96[_0xd6fe('0x2f')]);_0x4d39dc[_0xd6fe('0x32')]=_[_0xd6fe('0x31')](_0x26fe96[_0xd6fe('0x2e')],qs['fields'](_0x128bc3[_0xd6fe('0x2f')]['fields']));_0x4d39dc['attributes']=_0x4d39dc['attributes'][_0xd6fe('0x33')]?_0x4d39dc[_0xd6fe('0x32')]:_0x26fe96[_0xd6fe('0x2e')];if(!_0x128bc3[_0xd6fe('0x2f')][_0xd6fe('0x34')](_0xd6fe('0x35'))){_0x4d39dc[_0xd6fe('0x1d')]=qs[_0xd6fe('0x1d')](_0x128bc3[_0xd6fe('0x2f')][_0xd6fe('0x1d')]);_0x4d39dc['offset']=qs['offset'](_0x128bc3[_0xd6fe('0x2f')][_0xd6fe('0x1c')]);}_0x4d39dc[_0xd6fe('0x36')]=qs[_0xd6fe('0x37')](_0x128bc3[_0xd6fe('0x2f')][_0xd6fe('0x37')]);_0x4d39dc[_0xd6fe('0x38')]=qs[_0xd6fe('0x30')](_[_0xd6fe('0x39')](_0x128bc3['query'],_0x26fe96[_0xd6fe('0x30')]),_0x57f71a);if(_0x128bc3[_0xd6fe('0x2f')][_0xd6fe('0x3a')]){_0x4d39dc[_0xd6fe('0x38')]=_[_0xd6fe('0x3b')](_0x4d39dc[_0xd6fe('0x38')],{'$or':_['map'](_0x57f71a,function(_0x5d517f){if(_0x5d517f['type']!=='VIRTUAL'){var _0x13197d={};_0x13197d[_0x5d517f[_0xd6fe('0x27')]]={'$like':'%'+_0x128bc3[_0xd6fe('0x2f')][_0xd6fe('0x3a')]+'%'};return _0x13197d;}})});}_0x4d39dc=_['merge']({},_0x4d39dc,_0x128bc3[_0xd6fe('0x3c')]);var _0x4304f2={'where':_0x4d39dc['where']};return db[_0xd6fe('0x2b')]['count'](_0x4304f2)['then'](function(_0x40b5c8){_0x49bcf2['count']=_0x40b5c8;if(_0x128bc3[_0xd6fe('0x2f')][_0xd6fe('0x3d')]){_0x4d39dc[_0xd6fe('0x3e')]=[{'all':!![]}];}return db['OpenchannelQueueReport']['findAll'](_0x4d39dc);})['then'](function(_0x47fcd1){_0x49bcf2[_0xd6fe('0x3f')]=_0x47fcd1;return _0x49bcf2;})[_0xd6fe('0x24')](respondWithFilteredResult(_0x11d71c,_0x4d39dc))[_0xd6fe('0x40')](handleError(_0x11d71c,null));};exports['show']=function(_0x355246,_0x3fb1ad){var _0x18b337={'raw':!![],'where':{'id':_0x355246[_0xd6fe('0x41')]['id']}},_0x4717b7={};_0x4717b7[_0xd6fe('0x2e')]=_[_0xd6fe('0x42')](db[_0xd6fe('0x2b')][_0xd6fe('0x2c')]);_0x4717b7[_0xd6fe('0x2f')]=_['keys'](_0x355246[_0xd6fe('0x2f')]);_0x4717b7[_0xd6fe('0x30')]=_[_0xd6fe('0x31')](_0x4717b7['model'],_0x4717b7['query']);_0x18b337[_0xd6fe('0x32')]=_[_0xd6fe('0x31')](_0x4717b7['model'],qs['fields'](_0x355246['query'][_0xd6fe('0x43')]));_0x18b337[_0xd6fe('0x32')]=_0x18b337['attributes'][_0xd6fe('0x33')]?_0x18b337[_0xd6fe('0x32')]:_0x4717b7['model'];if(_0x355246['query'][_0xd6fe('0x3d')]){_0x18b337[_0xd6fe('0x3e')]=[{'all':!![]}];}_0x18b337=_[_0xd6fe('0x3b')]({},_0x18b337,_0x355246[_0xd6fe('0x3c')]);return db['OpenchannelQueueReport'][_0xd6fe('0x44')](_0x18b337)[_0xd6fe('0x24')](handleEntityNotFound(_0x3fb1ad,null))[_0xd6fe('0x24')](respondWithResult(_0x3fb1ad,null))['catch'](handleError(_0x3fb1ad,null));};exports[_0xd6fe('0x45')]=function(_0x3f994b,_0x40d5d3){return db[_0xd6fe('0x2b')][_0xd6fe('0x45')](_0x3f994b[_0xd6fe('0x46')],{})[_0xd6fe('0x24')](respondWithResult(_0x40d5d3,0xc9))[_0xd6fe('0x40')](handleError(_0x40d5d3,null));};exports['update']=function(_0x2af579,_0x308a60){if(_0x2af579[_0xd6fe('0x46')]['id']){delete _0x2af579[_0xd6fe('0x46')]['id'];}return db[_0xd6fe('0x2b')][_0xd6fe('0x44')]({'where':{'id':_0x2af579[_0xd6fe('0x41')]['id']}})['then'](handleEntityNotFound(_0x308a60,null))[_0xd6fe('0x24')](saveUpdates(_0x2af579[_0xd6fe('0x46')],null))[_0xd6fe('0x24')](respondWithResult(_0x308a60,null))[_0xd6fe('0x40')](handleError(_0x308a60,null));};exports[_0xd6fe('0x25')]=function(_0x3e264a,_0x55f33c){return db[_0xd6fe('0x2b')][_0xd6fe('0x44')]({'where':{'id':_0x3e264a[_0xd6fe('0x41')]['id']}})[_0xd6fe('0x24')](handleEntityNotFound(_0x55f33c,null))[_0xd6fe('0x24')](removeEntity(_0x55f33c,null))[_0xd6fe('0x40')](handleError(_0x55f33c,null));};exports['describe']=function(_0x28117d,_0x132c8a){return db[_0xd6fe('0x2b')][_0xd6fe('0x47')]()[_0xd6fe('0x24')](respondWithResult(_0x132c8a,null))[_0xd6fe('0x40')](handleError(_0x132c8a,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 6a35c34..5707743 100644 --- a/server/api/openchannelQueueReport/openchannelQueueReport.model.js +++ b/server/api/openchannelQueueReport/openchannelQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x326f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash'];(function(_0x3e7775,_0x325b15){var _0x4ba57a=function(_0x3c2ca1){while(--_0x3c2ca1){_0x3e7775['push'](_0x3e7775['shift']());}};_0x4ba57a(++_0x325b15);}(_0x326f,0xd1));var _0xf326=function(_0x268f1a,_0x1721ef){_0x268f1a=_0x268f1a-0x0;var _0x20f2db=_0x326f[_0x268f1a];return _0x20f2db;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf326('0x1'));var moment=require(_0xf326('0x2'));var BPromise=require(_0xf326('0x3'));var rp=require(_0xf326('0x4'));var fs=require('fs');var path=require(_0xf326('0x5'));var rimraf=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var attributes=require(_0xf326('0x8'));module[_0xf326('0x9')]=function(_0x3ace29,_0x4c2249){return _0x3ace29[_0xf326('0xa')](_0xf326('0xb'),attributes,{'tableName':_0xf326('0xc'),'paranoid':![],'indexes':[{'name':_0xf326('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x326f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash'];(function(_0x49f1b5,_0x4668ac){var _0xff60f1=function(_0x5e4dc9){while(--_0x5e4dc9){_0x49f1b5['push'](_0x49f1b5['shift']());}};_0xff60f1(++_0x4668ac);}(_0x326f,0xd1));var _0xf326=function(_0x51cf63,_0x42ac05){_0x51cf63=_0x51cf63-0x0;var _0x4c218b=_0x326f[_0x51cf63];return _0x4c218b;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf326('0x1'));var moment=require(_0xf326('0x2'));var BPromise=require(_0xf326('0x3'));var rp=require(_0xf326('0x4'));var fs=require('fs');var path=require(_0xf326('0x5'));var rimraf=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var attributes=require(_0xf326('0x8'));module[_0xf326('0x9')]=function(_0x3ace29,_0x4c2249){return _0x3ace29[_0xf326('0xa')](_0xf326('0xb'),attributes,{'tableName':_0xf326('0xc'),'paranoid':![],'indexes':[{'name':_0xf326('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 0be4b74..47530dc 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 _0x1a85=['error','code','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','body','options','raw','then','update','where','attributes','limit','UpdateOpenchannelQueueReport','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','http','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x139a3c,_0x4fc883){var _0x2b375b=function(_0x525dbf){while(--_0x525dbf){_0x139a3c['push'](_0x139a3c['shift']());}};_0x2b375b(++_0x4fc883);}(_0x1a85,0x178));var _0x51a8=function(_0x2f89c0,_0x455702){_0x2f89c0=_0x2f89c0-0x0;var _0x164223=_0x1a85[_0x2f89c0];return _0x164223;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x51a8('0x0'));var BPromise=require(_0x51a8('0x1'));var rs=require(_0x51a8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x51a8('0x3'));var logger=require(_0x51a8('0x4'))(_0x51a8('0x5'));var config=require('../../config/environment');var jayson=require(_0x51a8('0x6'));var client=jayson['client'][_0x51a8('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5cf430,_0x331117,_0x16a21e){return new BPromise(function(_0x4f3919,_0x228c64){return client['request'](_0x5cf430,_0x16a21e)['then'](function(_0x39e06a){logger[_0x51a8('0x8')](_0x51a8('0x9'),_0x331117,_0x51a8('0xa'));logger[_0x51a8('0xb')](_0x51a8('0xc'),_0x331117,_0x51a8('0xa'),JSON[_0x51a8('0xd')](_0x39e06a));if(_0x39e06a[_0x51a8('0xe')]){if(_0x39e06a[_0x51a8('0xe')][_0x51a8('0xf')]===0x1f4){logger[_0x51a8('0xe')](_0x51a8('0x9'),_0x331117,_0x39e06a[_0x51a8('0xe')][_0x51a8('0x10')]);return _0x228c64(_0x39e06a[_0x51a8('0xe')][_0x51a8('0x10')]);}logger['error'](_0x51a8('0x9'),_0x331117,_0x39e06a[_0x51a8('0xe')][_0x51a8('0x10')]);return _0x4f3919(_0x39e06a['error'][_0x51a8('0x10')]);}else{logger['info'](_0x51a8('0x9'),_0x331117,_0x51a8('0xa'));_0x4f3919(_0x39e06a[_0x51a8('0x11')][_0x51a8('0x10')]);}})[_0x51a8('0x12')](function(_0x3e0603){logger[_0x51a8('0xe')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x331117,_0x3e0603);_0x228c64(_0x3e0603);});});}exports[_0x51a8('0x13')]=function(_0x45a433){var _0xd52230=this;return new Promise(function(_0x23539e,_0x3bc1a2){return db[_0x51a8('0x14')]['create'](_0x45a433[_0x51a8('0x15')],{'raw':_0x45a433[_0x51a8('0x16')]?_0x45a433[_0x51a8('0x16')][_0x51a8('0x17')]===undefined?!![]:![]:!![]})[_0x51a8('0x18')](function(_0x3bc044){logger[_0x51a8('0x8')](_0x51a8('0x13'),_0x45a433);logger['debug'](_0x51a8('0x13'),_0x45a433,JSON['stringify'](_0x3bc044));_0x23539e(_0x3bc044);})[_0x51a8('0x12')](function(_0x12c029){logger[_0x51a8('0xe')](_0x51a8('0x13'),_0x12c029['message'],_0x45a433);_0x3bc1a2(_0xd52230[_0x51a8('0xe')](0x1f4,_0x12c029['message']));});});};exports['UpdateOpenchannelQueueReport']=function(_0x23d26a){var _0x52e503=this;return new Promise(function(_0x384d25,_0x78d3d6){return db[_0x51a8('0x14')][_0x51a8('0x19')](_0x23d26a[_0x51a8('0x15')],{'raw':_0x23d26a[_0x51a8('0x16')]?_0x23d26a[_0x51a8('0x16')][_0x51a8('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x23d26a['options']?_0x23d26a[_0x51a8('0x16')][_0x51a8('0x1a')]||null:null,'attributes':_0x23d26a[_0x51a8('0x16')]?_0x23d26a[_0x51a8('0x16')][_0x51a8('0x1b')]||null:null,'limit':_0x23d26a[_0x51a8('0x16')]?_0x23d26a[_0x51a8('0x16')][_0x51a8('0x1c')]||null:null})[_0x51a8('0x18')](function(_0x4b5cda){logger[_0x51a8('0x8')](_0x51a8('0x1d'),_0x23d26a);logger['debug'](_0x51a8('0x1d'),_0x23d26a,JSON['stringify'](_0x4b5cda));_0x384d25(_0x4b5cda);})[_0x51a8('0x12')](function(_0x3bc19a){logger[_0x51a8('0xe')](_0x51a8('0x1d'),_0x3bc19a[_0x51a8('0x10')],_0x23d26a);_0x78d3d6(_0x52e503['error'](0x1f4,_0x3bc19a[_0x51a8('0x10')]));});});}; \ No newline at end of file +var _0x7fce=['options','raw','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','OpenchannelQueueReport','update','where','attributes','limit','stringify','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','client','then','info','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','error','OpenchannelQueueReport,\x20%s,\x20%s','message','result','catch','create','body'];(function(_0x1c047f,_0x32a5e3){var _0x4cd049=function(_0x469874){while(--_0x469874){_0x1c047f['push'](_0x1c047f['shift']());}};_0x4cd049(++_0x32a5e3);}(_0x7fce,0xdc));var _0xe7fc=function(_0x274d1a,_0x1547df){_0x274d1a=_0x274d1a-0x0;var _0x236627=_0x7fce[_0x274d1a];return _0x236627;};'use strict';var _=require(_0xe7fc('0x0'));var util=require(_0xe7fc('0x1'));var moment=require(_0xe7fc('0x2'));var BPromise=require('bluebird');var rs=require(_0xe7fc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe7fc('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe7fc('0x5'))(_0xe7fc('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe7fc('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4665f6,_0x161dca,_0x296b2e){return new BPromise(function(_0x19eeef,_0x22fabf){return client['request'](_0x4665f6,_0x296b2e)[_0xe7fc('0x8')](function(_0x4a1209){logger[_0xe7fc('0x9')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x161dca,_0xe7fc('0xa'));logger[_0xe7fc('0xb')](_0xe7fc('0xc'),_0x161dca,_0xe7fc('0xa'),JSON['stringify'](_0x4a1209));if(_0x4a1209[_0xe7fc('0xd')]){if(_0x4a1209[_0xe7fc('0xd')]['code']===0x1f4){logger['error'](_0xe7fc('0xe'),_0x161dca,_0x4a1209['error'][_0xe7fc('0xf')]);return _0x22fabf(_0x4a1209['error']['message']);}logger[_0xe7fc('0xd')](_0xe7fc('0xe'),_0x161dca,_0x4a1209[_0xe7fc('0xd')][_0xe7fc('0xf')]);return _0x19eeef(_0x4a1209[_0xe7fc('0xd')]['message']);}else{logger[_0xe7fc('0x9')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x161dca,'request\x20sent');_0x19eeef(_0x4a1209[_0xe7fc('0x10')][_0xe7fc('0xf')]);}})[_0xe7fc('0x11')](function(_0x3a44a6){logger['error']('OpenchannelQueueReport,\x20%s,\x20%s',_0x161dca,_0x3a44a6);_0x22fabf(_0x3a44a6);});});}exports['CreateOpenchannelQueueReport']=function(_0x4aa4f0){var _0x52902f=this;return new Promise(function(_0x490a99,_0x14515d){return db['OpenchannelQueueReport'][_0xe7fc('0x12')](_0x4aa4f0[_0xe7fc('0x13')],{'raw':_0x4aa4f0[_0xe7fc('0x14')]?_0x4aa4f0[_0xe7fc('0x14')][_0xe7fc('0x15')]===undefined?!![]:![]:!![]})[_0xe7fc('0x8')](function(_0x329051){logger[_0xe7fc('0x9')]('CreateOpenchannelQueueReport',_0x4aa4f0);logger[_0xe7fc('0xb')](_0xe7fc('0x16'),_0x4aa4f0,JSON['stringify'](_0x329051));_0x490a99(_0x329051);})['catch'](function(_0x35bb53){logger[_0xe7fc('0xd')](_0xe7fc('0x16'),_0x35bb53[_0xe7fc('0xf')],_0x4aa4f0);_0x14515d(_0x52902f[_0xe7fc('0xd')](0x1f4,_0x35bb53[_0xe7fc('0xf')]));});});};exports[_0xe7fc('0x17')]=function(_0x1731b6){var _0xb00cb9=this;return new Promise(function(_0x3e7e7e,_0x1d1348){return db[_0xe7fc('0x18')][_0xe7fc('0x19')](_0x1731b6['body'],{'raw':_0x1731b6[_0xe7fc('0x14')]?_0x1731b6[_0xe7fc('0x14')][_0xe7fc('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1731b6[_0xe7fc('0x14')]?_0x1731b6[_0xe7fc('0x14')][_0xe7fc('0x1a')]||null:null,'attributes':_0x1731b6['options']?_0x1731b6[_0xe7fc('0x14')][_0xe7fc('0x1b')]||null:null,'limit':_0x1731b6[_0xe7fc('0x14')]?_0x1731b6[_0xe7fc('0x14')][_0xe7fc('0x1c')]||null:null})[_0xe7fc('0x8')](function(_0x383ca6){logger['info'](_0xe7fc('0x17'),_0x1731b6);logger[_0xe7fc('0xb')]('UpdateOpenchannelQueueReport',_0x1731b6,JSON[_0xe7fc('0x1d')](_0x383ca6));_0x3e7e7e(_0x383ca6);})['catch'](function(_0x39d908){logger[_0xe7fc('0xd')]('UpdateOpenchannelQueueReport',_0x39d908[_0xe7fc('0xf')],_0x1731b6);_0x1d1348(_0xb00cb9['error'](0x1f4,_0x39d908[_0xe7fc('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 49ed931..76b50ca 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 _0x7895=['isAuthenticated','index','get','post','create','put','/:id','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelTransferReport.controller'];(function(_0x23e203,_0x4f3489){var _0x119c69=function(_0x50b54d){while(--_0x50b54d){_0x23e203['push'](_0x23e203['shift']());}};_0x119c69(++_0x4f3489);}(_0x7895,0x128));var _0x5789=function(_0x1f7b2,_0x323a69){_0x1f7b2=_0x1f7b2-0x0;var _0x5ef4e1=_0x7895[_0x1f7b2];return _0x5ef4e1;};'use strict';var multer=require('multer');var util=require(_0x5789('0x0'));var path=require('path');var timeout=require(_0x5789('0x1'));var express=require(_0x5789('0x2'));var router=express[_0x5789('0x3')]();var fs_extra=require(_0x5789('0x4'));var auth=require(_0x5789('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5789('0x6'));var controller=require(_0x5789('0x7'));router['get']('/',auth[_0x5789('0x8')](),controller[_0x5789('0x9')]);router['get']('/describe',auth[_0x5789('0x8')](),controller['describe']);router[_0x5789('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x5789('0xb')]('/',auth[_0x5789('0x8')](),controller[_0x5789('0xc')]);router[_0x5789('0xd')](_0x5789('0xe'),auth[_0x5789('0x8')](),controller[_0x5789('0xf')]);router[_0x5789('0x10')](_0x5789('0xe'),auth[_0x5789('0x8')](),controller[_0x5789('0x11')]);module[_0x5789('0x12')]=router; \ No newline at end of file +var _0xedaf=['put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post'];(function(_0x51154d,_0x5e6d43){var _0x2dd7ef=function(_0x37f14f){while(--_0x37f14f){_0x51154d['push'](_0x51154d['shift']());}};_0x2dd7ef(++_0x5e6d43);}(_0xedaf,0x175));var _0xfeda=function(_0x31b12e,_0x4c2c49){_0x31b12e=_0x31b12e-0x0;var _0x2dce76=_0xedaf[_0x31b12e];return _0x2dce76;};'use strict';var multer=require(_0xfeda('0x0'));var util=require('util');var path=require(_0xfeda('0x1'));var timeout=require(_0xfeda('0x2'));var express=require(_0xfeda('0x3'));var router=express[_0xfeda('0x4')]();var fs_extra=require(_0xfeda('0x5'));var auth=require(_0xfeda('0x6'));var interaction=require(_0xfeda('0x7'));var config=require(_0xfeda('0x8'));var controller=require(_0xfeda('0x9'));router[_0xfeda('0xa')]('/',auth['isAuthenticated'](),controller[_0xfeda('0xb')]);router[_0xfeda('0xa')](_0xfeda('0xc'),auth[_0xfeda('0xd')](),controller[_0xfeda('0xe')]);router[_0xfeda('0xa')](_0xfeda('0xf'),auth['isAuthenticated'](),controller[_0xfeda('0x10')]);router[_0xfeda('0x11')]('/',auth[_0xfeda('0xd')](),controller['create']);router[_0xfeda('0x12')](_0xfeda('0xf'),auth[_0xfeda('0xd')](),controller[_0xfeda('0x13')]);router[_0xfeda('0x14')](_0xfeda('0xf'),auth['isAuthenticated'](),controller[_0xfeda('0x15')]);module[_0xfeda('0x16')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 7d37ee2..1020ed7 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 _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x134c9b,_0x2b4738){var _0x33f38e=function(_0x53e7b5){while(--_0x53e7b5){_0x134c9b['push'](_0x134c9b['shift']());}};_0x33f38e(++_0x2b4738);}(_0x9c44,0x178));var _0x49c4=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0x9c44[_0x2dea24];return _0x309d58;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}}; \ No newline at end of file +var _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x3fb38c,_0x49d7e5){var _0x5a480c=function(_0x5386c3){while(--_0x5386c3){_0x3fb38c['push'](_0x3fb38c['shift']());}};_0x5a480c(++_0x49d7e5);}(_0xedd9,0xfc));var _0x9edd=function(_0x39fc11,_0x2de90b){_0x39fc11=_0x39fc11-0x0;var _0x45f1d3=_0xedd9[_0x39fc11];return _0x45f1d3;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 1d63f85..b4f2728 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 _0x861c=['keys','filters','attributes','intersection','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','create','body','update','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','undefined','count','offset','limit','apply','reject','save','then','destroy','status','end','name','index','map','OpenchannelTransferReport','rawAttributes','fieldName','type','key','model','query'];(function(_0x1fb4e1,_0x3d4ce6){var _0x22d1b0=function(_0x553822){while(--_0x553822){_0x1fb4e1['push'](_0x1fb4e1['shift']());}};_0x22d1b0(++_0x3d4ce6);}(_0x861c,0x9e));var _0xc861=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x861c[_0x21a9d9];return _0x46adce;};'use strict';var emlformat=require(_0xc861('0x0'));var rimraf=require(_0xc861('0x1'));var zipdir=require(_0xc861('0x2'));var jsonpatch=require(_0xc861('0x3'));var rp=require(_0xc861('0x4'));var moment=require('moment');var BPromise=require(_0xc861('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xc861('0x6'));var csv=require(_0xc861('0x7'));var ejs=require(_0xc861('0x8'));var fs=require('fs');var fs_extra=require(_0xc861('0x9'));var _=require(_0xc861('0xa'));var squel=require('squel');var crypto=require(_0xc861('0xb'));var jsforce=require(_0xc861('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xc861('0x7'));var querystring=require(_0xc861('0xd'));var Papa=require('papaparse');var Redis=require(_0xc861('0xe'));var authService=require(_0xc861('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc861('0x10'));var utils=require(_0xc861('0x11'));var config=require(_0xc861('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xc861('0x13'))['db'];function respondWithStatusCode(_0x190943,_0x35afdf){_0x35afdf=_0x35afdf||0xcc;return function(_0x4a321b){if(_0x4a321b){return _0x190943[_0xc861('0x14')](_0x35afdf);}return _0x190943['status'](_0x35afdf)['end']();};}function respondWithResult(_0x28ea7a,_0x4a37d0){_0x4a37d0=_0x4a37d0||0xc8;return function(_0x5613e1){if(_0x5613e1){return _0x28ea7a['status'](_0x4a37d0)[_0xc861('0x15')](_0x5613e1);}};}function respondWithFilteredResult(_0x1fa736,_0x1703d5){return function(_0x2801e4){if(_0x2801e4){var _0x36607e=typeof _0x1703d5['offset']===_0xc861('0x16')&&typeof _0x1703d5['limit']===_0xc861('0x16');var _0x12ab23=_0x2801e4[_0xc861('0x17')];var _0x190753=_0x36607e?0x0:_0x1703d5[_0xc861('0x18')];var _0x374f29=_0x36607e?_0x2801e4[_0xc861('0x17')]:_0x1703d5[_0xc861('0x18')]+_0x1703d5[_0xc861('0x19')];var _0x1043e4;if(_0x374f29>=_0x12ab23){_0x374f29=_0x12ab23;_0x1043e4=0xc8;}else{_0x1043e4=0xce;}_0x1fa736['status'](_0x1043e4);return _0x1fa736['set']('Content-Range',_0x190753+'-'+_0x374f29+'/'+_0x12ab23)[_0xc861('0x15')](_0x2801e4);}return null;};}function patchUpdates(_0x5af059){return function(_0x5095b9){try{jsonpatch[_0xc861('0x1a')](_0x5095b9,_0x5af059,!![]);}catch(_0x4d9dc2){return BPromise[_0xc861('0x1b')](_0x4d9dc2);}return _0x5095b9[_0xc861('0x1c')]();};}function saveUpdates(_0x237f37,_0x391760){return function(_0x1c70f2){if(_0x1c70f2){return _0x1c70f2['update'](_0x237f37)[_0xc861('0x1d')](function(_0x36050c){return _0x36050c;});}return null;};}function removeEntity(_0x4653d9,_0xe46a88){return function(_0x20a343){if(_0x20a343){return _0x20a343[_0xc861('0x1e')]()[_0xc861('0x1d')](function(){_0x4653d9[_0xc861('0x1f')](0xcc)[_0xc861('0x20')]();});}};}function handleEntityNotFound(_0x1cae60,_0x1179b5){return function(_0x2f0723){if(!_0x2f0723){_0x1cae60[_0xc861('0x14')](0x194);}return _0x2f0723;};}function handleError(_0x5bab44,_0x20a35f){_0x20a35f=_0x20a35f||0x1f4;return function(_0x3f70a7){logger['error'](_0x3f70a7['stack']);if(_0x3f70a7['name']){delete _0x3f70a7[_0xc861('0x21')];}_0x5bab44[_0xc861('0x1f')](_0x20a35f)['send'](_0x3f70a7);};}exports[_0xc861('0x22')]=function(_0x2a1176,_0x3926b5){var _0x26df8e={},_0x6dacf3={},_0x233623={'count':0x0,'rows':[]};var _0x185e38=_[_0xc861('0x23')](db[_0xc861('0x24')][_0xc861('0x25')],function(_0x3788c5){return{'name':_0x3788c5[_0xc861('0x26')],'type':_0x3788c5[_0xc861('0x27')][_0xc861('0x28')]};});_0x6dacf3[_0xc861('0x29')]=_['map'](_0x185e38,_0xc861('0x21'));_0x6dacf3[_0xc861('0x2a')]=_[_0xc861('0x2b')](_0x2a1176['query']);_0x6dacf3[_0xc861('0x2c')]=_['intersection'](_0x6dacf3['model'],_0x6dacf3[_0xc861('0x2a')]);_0x26df8e[_0xc861('0x2d')]=_[_0xc861('0x2e')](_0x6dacf3[_0xc861('0x29')],qs[_0xc861('0x2f')](_0x2a1176['query'][_0xc861('0x2f')]));_0x26df8e[_0xc861('0x2d')]=_0x26df8e[_0xc861('0x2d')][_0xc861('0x30')]?_0x26df8e['attributes']:_0x6dacf3[_0xc861('0x29')];if(!_0x2a1176[_0xc861('0x2a')]['hasOwnProperty']('nolimit')){_0x26df8e[_0xc861('0x19')]=qs[_0xc861('0x19')](_0x2a1176[_0xc861('0x2a')][_0xc861('0x19')]);_0x26df8e[_0xc861('0x18')]=qs[_0xc861('0x18')](_0x2a1176[_0xc861('0x2a')][_0xc861('0x18')]);}_0x26df8e[_0xc861('0x31')]=qs[_0xc861('0x32')](_0x2a1176['query'][_0xc861('0x32')]);_0x26df8e[_0xc861('0x33')]=qs[_0xc861('0x2c')](_[_0xc861('0x34')](_0x2a1176[_0xc861('0x2a')],_0x6dacf3[_0xc861('0x2c')]),_0x185e38);if(_0x2a1176['query'][_0xc861('0x35')]){_0x26df8e[_0xc861('0x33')]=_[_0xc861('0x36')](_0x26df8e[_0xc861('0x33')],{'$or':_[_0xc861('0x23')](_0x185e38,function(_0x29eb49){if(_0x29eb49[_0xc861('0x27')]!==_0xc861('0x37')){var _0x3e63e0={};_0x3e63e0[_0x29eb49[_0xc861('0x21')]]={'$like':'%'+_0x2a1176[_0xc861('0x2a')]['filter']+'%'};return _0x3e63e0;}})});}_0x26df8e=_[_0xc861('0x36')]({},_0x26df8e,_0x2a1176[_0xc861('0x38')]);var _0x1ce83f={'where':_0x26df8e[_0xc861('0x33')]};return db['OpenchannelTransferReport']['count'](_0x1ce83f)[_0xc861('0x1d')](function(_0x37ba06){_0x233623[_0xc861('0x17')]=_0x37ba06;if(_0x2a1176['query'][_0xc861('0x39')]){_0x26df8e[_0xc861('0x3a')]=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0xc861('0x3b')](_0x26df8e);})['then'](function(_0x38a2db){_0x233623[_0xc861('0x3c')]=_0x38a2db;return _0x233623;})[_0xc861('0x1d')](respondWithFilteredResult(_0x3926b5,_0x26df8e))[_0xc861('0x3d')](handleError(_0x3926b5,null));};exports['show']=function(_0x25cf5f,_0x19ee7e){var _0x206596={'raw':!![],'where':{'id':_0x25cf5f[_0xc861('0x3e')]['id']}},_0x68e929={};_0x68e929[_0xc861('0x29')]=_[_0xc861('0x2b')](db[_0xc861('0x24')][_0xc861('0x25')]);_0x68e929['query']=_[_0xc861('0x2b')](_0x25cf5f[_0xc861('0x2a')]);_0x68e929[_0xc861('0x2c')]=_[_0xc861('0x2e')](_0x68e929['model'],_0x68e929[_0xc861('0x2a')]);_0x206596[_0xc861('0x2d')]=_[_0xc861('0x2e')](_0x68e929['model'],qs[_0xc861('0x2f')](_0x25cf5f[_0xc861('0x2a')][_0xc861('0x2f')]));_0x206596[_0xc861('0x2d')]=_0x206596['attributes'][_0xc861('0x30')]?_0x206596[_0xc861('0x2d')]:_0x68e929[_0xc861('0x29')];if(_0x25cf5f[_0xc861('0x2a')][_0xc861('0x39')]){_0x206596[_0xc861('0x3a')]=[{'all':!![]}];}_0x206596=_[_0xc861('0x36')]({},_0x206596,_0x25cf5f[_0xc861('0x38')]);return db[_0xc861('0x24')]['find'](_0x206596)[_0xc861('0x1d')](handleEntityNotFound(_0x19ee7e,null))[_0xc861('0x1d')](respondWithResult(_0x19ee7e,null))['catch'](handleError(_0x19ee7e,null));};exports[_0xc861('0x3f')]=function(_0x2e7fa7,_0x1ff73a){return db[_0xc861('0x24')][_0xc861('0x3f')](_0x2e7fa7[_0xc861('0x40')],{})['then'](respondWithResult(_0x1ff73a,0xc9))[_0xc861('0x3d')](handleError(_0x1ff73a,null));};exports[_0xc861('0x41')]=function(_0x8fb8d0,_0x3cdc77){if(_0x8fb8d0[_0xc861('0x40')]['id']){delete _0x8fb8d0[_0xc861('0x40')]['id'];}return db[_0xc861('0x24')][_0xc861('0x42')]({'where':{'id':_0x8fb8d0[_0xc861('0x3e')]['id']}})['then'](handleEntityNotFound(_0x3cdc77,null))[_0xc861('0x1d')](saveUpdates(_0x8fb8d0[_0xc861('0x40')],null))[_0xc861('0x1d')](respondWithResult(_0x3cdc77,null))[_0xc861('0x3d')](handleError(_0x3cdc77,null));};exports[_0xc861('0x1e')]=function(_0x9dbe16,_0x87f4){return db['OpenchannelTransferReport']['find']({'where':{'id':_0x9dbe16[_0xc861('0x3e')]['id']}})[_0xc861('0x1d')](handleEntityNotFound(_0x87f4,null))['then'](removeEntity(_0x87f4,null))[_0xc861('0x3d')](handleError(_0x87f4,null));};exports['describe']=function(_0x19ffb7,_0x5592b8){return db[_0xc861('0x24')]['describe']()[_0xc861('0x1d')](respondWithResult(_0x5592b8,null))[_0xc861('0x3d')](handleError(_0x5592b8,null));}; \ No newline at end of file +var _0xc1b5=['pick','filters','filter','merge','include','findAll','rows','catch','show','params','keys','find','create','body','update','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','ejs','lodash','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','error','stack','name','send','OpenchannelTransferReport','rawAttributes','fieldName','type','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x482214,_0x2550ff){var _0x38d0cb=function(_0x2ba281){while(--_0x2ba281){_0x482214['push'](_0x482214['shift']());}};_0x38d0cb(++_0x2550ff);}(_0xc1b5,0x1c0));var _0x5c1b=function(_0x548200,_0x3241b8){_0x548200=_0x548200-0x0;var _0x1a6d74=_0xc1b5[_0x548200];return _0x1a6d74;};'use strict';var emlformat=require(_0x5c1b('0x0'));var rimraf=require(_0x5c1b('0x1'));var zipdir=require(_0x5c1b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5c1b('0x3'));var moment=require(_0x5c1b('0x4'));var BPromise=require(_0x5c1b('0x5'));var Mustache=require(_0x5c1b('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5c1b('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5c1b('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5c1b('0x9'));var deskjs=require(_0x5c1b('0xa'));var toCsv=require(_0x5c1b('0xb'));var querystring=require(_0x5c1b('0xc'));var Papa=require(_0x5c1b('0xd'));var Redis=require('ioredis');var authService=require(_0x5c1b('0xe'));var qs=require(_0x5c1b('0xf'));var as=require(_0x5c1b('0x10'));var hardwareService=require(_0x5c1b('0x11'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x5c1b('0x12'));var licenseUtil=require(_0x5c1b('0x13'));var db=require(_0x5c1b('0x14'))['db'];function respondWithStatusCode(_0x4bd202,_0x21a417){_0x21a417=_0x21a417||0xcc;return function(_0x1b056e){if(_0x1b056e){return _0x4bd202[_0x5c1b('0x15')](_0x21a417);}return _0x4bd202['status'](_0x21a417)[_0x5c1b('0x16')]();};}function respondWithResult(_0x1e15af,_0x349771){_0x349771=_0x349771||0xc8;return function(_0x2924c1){if(_0x2924c1){return _0x1e15af[_0x5c1b('0x17')](_0x349771)[_0x5c1b('0x18')](_0x2924c1);}};}function respondWithFilteredResult(_0x2f3421,_0x158320){return function(_0x590feb){if(_0x590feb){var _0x5fa72e=typeof _0x158320[_0x5c1b('0x19')]===_0x5c1b('0x1a')&&typeof _0x158320[_0x5c1b('0x1b')]===_0x5c1b('0x1a');var _0x4fad57=_0x590feb[_0x5c1b('0x1c')];var _0x569486=_0x5fa72e?0x0:_0x158320['offset'];var _0x98bc15=_0x5fa72e?_0x590feb['count']:_0x158320['offset']+_0x158320[_0x5c1b('0x1b')];var _0x100e07;if(_0x98bc15>=_0x4fad57){_0x98bc15=_0x4fad57;_0x100e07=0xc8;}else{_0x100e07=0xce;}_0x2f3421[_0x5c1b('0x17')](_0x100e07);return _0x2f3421[_0x5c1b('0x1d')](_0x5c1b('0x1e'),_0x569486+'-'+_0x98bc15+'/'+_0x4fad57)[_0x5c1b('0x18')](_0x590feb);}return null;};}function patchUpdates(_0xdc0bb3){return function(_0x124ef2){try{jsonpatch[_0x5c1b('0x1f')](_0x124ef2,_0xdc0bb3,!![]);}catch(_0x158580){return BPromise['reject'](_0x158580);}return _0x124ef2[_0x5c1b('0x20')]();};}function saveUpdates(_0x191e34,_0x3d74f3){return function(_0x2cea77){if(_0x2cea77){return _0x2cea77['update'](_0x191e34)[_0x5c1b('0x21')](function(_0x5ff94f){return _0x5ff94f;});}return null;};}function removeEntity(_0x39b914,_0x4e3d88){return function(_0x1150da){if(_0x1150da){return _0x1150da[_0x5c1b('0x22')]()['then'](function(){_0x39b914['status'](0xcc)[_0x5c1b('0x16')]();});}};}function handleEntityNotFound(_0x4308ac,_0x3f57ec){return function(_0x318ca6){if(!_0x318ca6){_0x4308ac[_0x5c1b('0x15')](0x194);}return _0x318ca6;};}function handleError(_0x22f1a0,_0x2274ef){_0x2274ef=_0x2274ef||0x1f4;return function(_0xd447b){logger[_0x5c1b('0x23')](_0xd447b[_0x5c1b('0x24')]);if(_0xd447b[_0x5c1b('0x25')]){delete _0xd447b[_0x5c1b('0x25')];}_0x22f1a0[_0x5c1b('0x17')](_0x2274ef)[_0x5c1b('0x26')](_0xd447b);};}exports['index']=function(_0x386c90,_0x29de53){var _0x49c3ea={},_0x3987a2={},_0x450482={'count':0x0,'rows':[]};var _0x4b8e31=_['map'](db[_0x5c1b('0x27')][_0x5c1b('0x28')],function(_0x2f627d){return{'name':_0x2f627d[_0x5c1b('0x29')],'type':_0x2f627d[_0x5c1b('0x2a')][_0x5c1b('0x2b')]};});_0x3987a2[_0x5c1b('0x2c')]=_[_0x5c1b('0x2d')](_0x4b8e31,'name');_0x3987a2['query']=_['keys'](_0x386c90[_0x5c1b('0x2e')]);_0x3987a2['filters']=_[_0x5c1b('0x2f')](_0x3987a2[_0x5c1b('0x2c')],_0x3987a2[_0x5c1b('0x2e')]);_0x49c3ea[_0x5c1b('0x30')]=_[_0x5c1b('0x2f')](_0x3987a2[_0x5c1b('0x2c')],qs[_0x5c1b('0x31')](_0x386c90[_0x5c1b('0x2e')]['fields']));_0x49c3ea[_0x5c1b('0x30')]=_0x49c3ea[_0x5c1b('0x30')][_0x5c1b('0x32')]?_0x49c3ea[_0x5c1b('0x30')]:_0x3987a2[_0x5c1b('0x2c')];if(!_0x386c90[_0x5c1b('0x2e')][_0x5c1b('0x33')](_0x5c1b('0x34'))){_0x49c3ea['limit']=qs[_0x5c1b('0x1b')](_0x386c90[_0x5c1b('0x2e')][_0x5c1b('0x1b')]);_0x49c3ea[_0x5c1b('0x19')]=qs['offset'](_0x386c90[_0x5c1b('0x2e')][_0x5c1b('0x19')]);}_0x49c3ea[_0x5c1b('0x35')]=qs[_0x5c1b('0x36')](_0x386c90[_0x5c1b('0x2e')]['sort']);_0x49c3ea[_0x5c1b('0x37')]=qs['filters'](_[_0x5c1b('0x38')](_0x386c90[_0x5c1b('0x2e')],_0x3987a2[_0x5c1b('0x39')]),_0x4b8e31);if(_0x386c90['query'][_0x5c1b('0x3a')]){_0x49c3ea['where']=_[_0x5c1b('0x3b')](_0x49c3ea['where'],{'$or':_[_0x5c1b('0x2d')](_0x4b8e31,function(_0x4308f9){if(_0x4308f9[_0x5c1b('0x2a')]!=='VIRTUAL'){var _0x1f2c5d={};_0x1f2c5d[_0x4308f9['name']]={'$like':'%'+_0x386c90[_0x5c1b('0x2e')][_0x5c1b('0x3a')]+'%'};return _0x1f2c5d;}})});}_0x49c3ea=_['merge']({},_0x49c3ea,_0x386c90['options']);var _0x580e55={'where':_0x49c3ea[_0x5c1b('0x37')]};return db[_0x5c1b('0x27')]['count'](_0x580e55)[_0x5c1b('0x21')](function(_0x2e2729){_0x450482['count']=_0x2e2729;if(_0x386c90[_0x5c1b('0x2e')]['includeAll']){_0x49c3ea[_0x5c1b('0x3c')]=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0x5c1b('0x3d')](_0x49c3ea);})[_0x5c1b('0x21')](function(_0x583c8f){_0x450482[_0x5c1b('0x3e')]=_0x583c8f;return _0x450482;})[_0x5c1b('0x21')](respondWithFilteredResult(_0x29de53,_0x49c3ea))[_0x5c1b('0x3f')](handleError(_0x29de53,null));};exports[_0x5c1b('0x40')]=function(_0x3ce42b,_0x4bef69){var _0x290fa9={'raw':!![],'where':{'id':_0x3ce42b[_0x5c1b('0x41')]['id']}},_0x130630={};_0x130630[_0x5c1b('0x2c')]=_[_0x5c1b('0x42')](db[_0x5c1b('0x27')]['rawAttributes']);_0x130630[_0x5c1b('0x2e')]=_['keys'](_0x3ce42b[_0x5c1b('0x2e')]);_0x130630[_0x5c1b('0x39')]=_[_0x5c1b('0x2f')](_0x130630[_0x5c1b('0x2c')],_0x130630[_0x5c1b('0x2e')]);_0x290fa9[_0x5c1b('0x30')]=_[_0x5c1b('0x2f')](_0x130630[_0x5c1b('0x2c')],qs[_0x5c1b('0x31')](_0x3ce42b[_0x5c1b('0x2e')][_0x5c1b('0x31')]));_0x290fa9['attributes']=_0x290fa9[_0x5c1b('0x30')]['length']?_0x290fa9[_0x5c1b('0x30')]:_0x130630[_0x5c1b('0x2c')];if(_0x3ce42b[_0x5c1b('0x2e')]['includeAll']){_0x290fa9[_0x5c1b('0x3c')]=[{'all':!![]}];}_0x290fa9=_[_0x5c1b('0x3b')]({},_0x290fa9,_0x3ce42b['options']);return db[_0x5c1b('0x27')][_0x5c1b('0x43')](_0x290fa9)['then'](handleEntityNotFound(_0x4bef69,null))[_0x5c1b('0x21')](respondWithResult(_0x4bef69,null))[_0x5c1b('0x3f')](handleError(_0x4bef69,null));};exports[_0x5c1b('0x44')]=function(_0x19f335,_0x57697a){return db[_0x5c1b('0x27')][_0x5c1b('0x44')](_0x19f335[_0x5c1b('0x45')],{})[_0x5c1b('0x21')](respondWithResult(_0x57697a,0xc9))[_0x5c1b('0x3f')](handleError(_0x57697a,null));};exports[_0x5c1b('0x46')]=function(_0x5525be,_0x276e10){if(_0x5525be[_0x5c1b('0x45')]['id']){delete _0x5525be[_0x5c1b('0x45')]['id'];}return db[_0x5c1b('0x27')]['find']({'where':{'id':_0x5525be[_0x5c1b('0x41')]['id']}})[_0x5c1b('0x21')](handleEntityNotFound(_0x276e10,null))[_0x5c1b('0x21')](saveUpdates(_0x5525be[_0x5c1b('0x45')],null))[_0x5c1b('0x21')](respondWithResult(_0x276e10,null))[_0x5c1b('0x3f')](handleError(_0x276e10,null));};exports['destroy']=function(_0x19460b,_0x4f972a){return db[_0x5c1b('0x27')][_0x5c1b('0x43')]({'where':{'id':_0x19460b[_0x5c1b('0x41')]['id']}})['then'](handleEntityNotFound(_0x4f972a,null))[_0x5c1b('0x21')](removeEntity(_0x4f972a,null))[_0x5c1b('0x3f')](handleError(_0x4f972a,null));};exports[_0x5c1b('0x47')]=function(_0x1e8959,_0x2513ab){return db[_0x5c1b('0x27')][_0x5c1b('0x47')]()[_0x5c1b('0x21')](respondWithResult(_0x2513ab,null))['catch'](handleError(_0x2513ab,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 3a512cd..db06f55 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 _0x3d71=['../../config/logger','api','bluebird','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','define','report_openchannel_transfer','uniqueid','lodash','util'];(function(_0xe8679c,_0x3da241){var _0x2ece11=function(_0x328ff8){while(--_0x328ff8){_0xe8679c['push'](_0xe8679c['shift']());}};_0x2ece11(++_0x3da241);}(_0x3d71,0xa6));var _0x13d7=function(_0x46374c,_0xb088ab){_0x46374c=_0x46374c-0x0;var _0x2747c3=_0x3d71[_0x46374c];return _0x2747c3;};'use strict';var _=require(_0x13d7('0x0'));var util=require(_0x13d7('0x1'));var logger=require(_0x13d7('0x2'))(_0x13d7('0x3'));var moment=require('moment');var BPromise=require(_0x13d7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x13d7('0x5'));var rimraf=require(_0x13d7('0x6'));var config=require(_0x13d7('0x7'));var attributes=require(_0x13d7('0x8'));module['exports']=function(_0x469796,_0x18f6ea){return _0x469796[_0x13d7('0x9')]('OpenchannelTransferReport',attributes,{'tableName':_0x13d7('0xa'),'paranoid':![],'indexes':[{'name':_0x13d7('0xb'),'fields':[_0x13d7('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3c45=['uniqueid','lodash','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','report_openchannel_transfer'];(function(_0x3b8774,_0x301a46){var _0x5bcfcc=function(_0x5d9d2f){while(--_0x5d9d2f){_0x3b8774['push'](_0x3b8774['shift']());}};_0x5bcfcc(++_0x301a46);}(_0x3c45,0xc9));var _0x53c4=function(_0x2f2036,_0x11175){_0x2f2036=_0x2f2036-0x0;var _0x3aaf7e=_0x3c45[_0x2f2036];return _0x3aaf7e;};'use strict';var _=require(_0x53c4('0x0'));var util=require('util');var logger=require(_0x53c4('0x1'))(_0x53c4('0x2'));var moment=require('moment');var BPromise=require(_0x53c4('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x53c4('0x4'));var rimraf=require(_0x53c4('0x5'));var config=require(_0x53c4('0x6'));var attributes=require(_0x53c4('0x7'));module['exports']=function(_0x3dbfd9,_0x478609){return _0x3dbfd9['define']('OpenchannelTransferReport',attributes,{'tableName':_0x53c4('0x8'),'paranoid':![],'indexes':[{'name':_0x53c4('0x9'),'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 21646ff..6d0f76d 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 _0x7579=['message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x430205,_0x328c94){var _0x3f5146=function(_0x3cd6bd){while(--_0x3cd6bd){_0x430205['push'](_0x430205['shift']());}};_0x3f5146(++_0x328c94);}(_0x7579,0x1e2));var _0x9757=function(_0xa9b8fb,_0x2d66cb){_0xa9b8fb=_0xa9b8fb-0x0;var _0x1495c1=_0x7579[_0xa9b8fb];return _0x1495c1;};'use strict';var _=require(_0x9757('0x0'));var util=require(_0x9757('0x1'));var moment=require(_0x9757('0x2'));var BPromise=require(_0x9757('0x3'));var rs=require(_0x9757('0x4'));var fs=require('fs');var Redis=require(_0x9757('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x9757('0x6'));var logger=require(_0x9757('0x7'))(_0x9757('0x8'));var config=require(_0x9757('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9757('0xa')][_0x9757('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4757e9,_0x4b5446,_0x28a14a){return new BPromise(function(_0x51a1c8,_0x2d65dd){return client[_0x9757('0xc')](_0x4757e9,_0x28a14a)[_0x9757('0xd')](function(_0x5b5749){logger[_0x9757('0xe')](_0x9757('0xf'),_0x4b5446,_0x9757('0x10'));logger[_0x9757('0x11')](_0x9757('0x12'),_0x4b5446,_0x9757('0x10'),JSON[_0x9757('0x13')](_0x5b5749));if(_0x5b5749[_0x9757('0x14')]){if(_0x5b5749[_0x9757('0x14')][_0x9757('0x15')]===0x1f4){logger[_0x9757('0x14')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x4b5446,_0x5b5749[_0x9757('0x14')][_0x9757('0x16')]);return _0x2d65dd(_0x5b5749[_0x9757('0x14')]['message']);}logger[_0x9757('0x14')](_0x9757('0xf'),_0x4b5446,_0x5b5749[_0x9757('0x14')][_0x9757('0x16')]);return _0x51a1c8(_0x5b5749[_0x9757('0x14')][_0x9757('0x16')]);}else{logger[_0x9757('0xe')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x4b5446,_0x9757('0x10'));_0x51a1c8(_0x5b5749['result'][_0x9757('0x16')]);}})[_0x9757('0x17')](function(_0xad2a22){logger[_0x9757('0x14')](_0x9757('0xf'),_0x4b5446,_0xad2a22);_0x2d65dd(_0xad2a22);});});} \ No newline at end of file +var _0xf95f=['../../config/logger','../../config/environment','client','request','then','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelTransferReport,\x20%s,\x20%s','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x2c9596,_0x10d04a){var _0x41adb6=function(_0x43cbae){while(--_0x43cbae){_0x2c9596['push'](_0x2c9596['shift']());}};_0x41adb6(++_0x10d04a);}(_0xf95f,0x142));var _0xff95=function(_0x54fc23,_0x13657e){_0x54fc23=_0x54fc23-0x0;var _0x1948e5=_0xf95f[_0x54fc23];return _0x1948e5;};'use strict';var _=require(_0xff95('0x0'));var util=require(_0xff95('0x1'));var moment=require(_0xff95('0x2'));var BPromise=require(_0xff95('0x3'));var rs=require(_0xff95('0x4'));var fs=require('fs');var Redis=require(_0xff95('0x5'));var db=require(_0xff95('0x6'))['db'];var utils=require(_0xff95('0x7'));var logger=require(_0xff95('0x8'))('rpc');var config=require(_0xff95('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xff95('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x314fb4,_0x781e05,_0x2b9ce9){return new BPromise(function(_0x1a42b2,_0x198a51){return client[_0xff95('0xb')](_0x314fb4,_0x2b9ce9)[_0xff95('0xc')](function(_0xa2a50d){logger['info']('OpenchannelTransferReport,\x20%s,\x20%s',_0x781e05,_0xff95('0xd'));logger[_0xff95('0xe')](_0xff95('0xf'),_0x781e05,_0xff95('0xd'),JSON[_0xff95('0x10')](_0xa2a50d));if(_0xa2a50d[_0xff95('0x11')]){if(_0xa2a50d[_0xff95('0x11')]['code']===0x1f4){logger['error'](_0xff95('0x12'),_0x781e05,_0xa2a50d[_0xff95('0x11')]['message']);return _0x198a51(_0xa2a50d[_0xff95('0x11')]['message']);}logger['error']('OpenchannelTransferReport,\x20%s,\x20%s',_0x781e05,_0xa2a50d[_0xff95('0x11')][_0xff95('0x13')]);return _0x1a42b2(_0xa2a50d[_0xff95('0x11')][_0xff95('0x13')]);}else{logger[_0xff95('0x14')](_0xff95('0x12'),_0x781e05,'request\x20sent');_0x1a42b2(_0xa2a50d['result'][_0xff95('0x13')]);}})[_0xff95('0x15')](function(_0x83e644){logger[_0xff95('0x11')](_0xff95('0x12'),_0x781e05,_0x83e644);_0x198a51(_0x83e644);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 63f61e6..77d9bce 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 _0x2d21=['put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./pause.controller','get','index','/:id','isAuthenticated','show','post','create'];(function(_0x2987ae,_0x448f60){var _0x5e6fb7=function(_0x1bcc07){while(--_0x1bcc07){_0x2987ae['push'](_0x2987ae['shift']());}};_0x5e6fb7(++_0x448f60);}(_0x2d21,0x6d));var _0x12d2=function(_0x427352,_0x1bce61){_0x427352=_0x427352-0x0;var _0x23e0e6=_0x2d21[_0x427352];return _0x23e0e6;};'use strict';var multer=require(_0x12d2('0x0'));var util=require(_0x12d2('0x1'));var path=require(_0x12d2('0x2'));var timeout=require(_0x12d2('0x3'));var express=require(_0x12d2('0x4'));var router=express[_0x12d2('0x5')]();var fs_extra=require(_0x12d2('0x6'));var auth=require(_0x12d2('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x12d2('0x8'));var controller=require(_0x12d2('0x9'));router[_0x12d2('0xa')]('/',auth['isAuthenticated'](),controller[_0x12d2('0xb')]);router['get'](_0x12d2('0xc'),auth[_0x12d2('0xd')](),controller[_0x12d2('0xe')]);router[_0x12d2('0xf')]('/',auth[_0x12d2('0xd')](),controller[_0x12d2('0x10')]);router[_0x12d2('0x11')](_0x12d2('0xc'),auth[_0x12d2('0xd')](),controller[_0x12d2('0x12')]);router[_0x12d2('0x13')](_0x12d2('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x12d2('0x14')]=router; \ No newline at end of file +var _0x5c72=['/:id','show','create','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5c72,0xf1));var _0x25c7=function(_0x13b16f,_0x543b7a){_0x13b16f=_0x13b16f-0x0;var _0x5e9489=_0x5c72[_0x13b16f];return _0x5e9489;};'use strict';var multer=require(_0x25c7('0x0'));var util=require('util');var path=require(_0x25c7('0x1'));var timeout=require(_0x25c7('0x2'));var express=require(_0x25c7('0x3'));var router=express[_0x25c7('0x4')]();var fs_extra=require(_0x25c7('0x5'));var auth=require(_0x25c7('0x6'));var interaction=require(_0x25c7('0x7'));var config=require('../../config/environment');var controller=require('./pause.controller');router[_0x25c7('0x8')]('/',auth[_0x25c7('0x9')](),controller[_0x25c7('0xa')]);router[_0x25c7('0x8')](_0x25c7('0xb'),auth['isAuthenticated'](),controller[_0x25c7('0xc')]);router['post']('/',auth[_0x25c7('0x9')](),controller[_0x25c7('0xd')]);router[_0x25c7('0xe')]('/:id',auth[_0x25c7('0x9')](),controller['update']);router[_0x25c7('0xf')]('/:id',auth[_0x25c7('0x9')](),controller[_0x25c7('0x10')]);module[_0x25c7('0x11')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index cecb8b4..9a44e1f 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 _0x00b7=['sequelize','exports','name'];(function(_0x3c42a6,_0x572744){var _0x50e627=function(_0x5100f5){while(--_0x5100f5){_0x3c42a6['push'](_0x3c42a6['shift']());}};_0x50e627(++_0x572744);}(_0x00b7,0xe1));var _0x700b=function(_0x1eca2e,_0x3eb8f5){_0x1eca2e=_0x1eca2e-0x0;var _0x400ae2=_0x00b7[_0x1eca2e];return _0x400ae2;};'use strict';var Sequelize=require(_0x700b('0x0'));module[_0x700b('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x700b('0x2'),'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9734=['exports','STRING','name','sequelize'];(function(_0x130b34,_0x852ea6){var _0x57489c=function(_0x5d99ad){while(--_0x5d99ad){_0x130b34['push'](_0x130b34['shift']());}};_0x57489c(++_0x852ea6);}(_0x9734,0x15b));var _0x4973=function(_0x152e48,_0x25f775){_0x152e48=_0x152e48-0x0;var _0x30b1a4=_0x9734[_0x152e48];return _0x30b1a4;};'use strict';var Sequelize=require(_0x4973('0x0'));module[_0x4973('0x1')]={'name':{'type':Sequelize[_0x4973('0x2')],'unique':_0x4973('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x4973('0x2')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index ea19426..f8684ca 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 _0xd252=['options','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','body','user','get','role','Pauses','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','UserProfileResource','error','stack','name','send','index','Pause','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','where','pick','filter','type','VIRTUAL','merge'];(function(_0x560653,_0x3c1465){var _0x1f850c=function(_0x2d3b7c){while(--_0x2d3b7c){_0x560653['push'](_0x560653['shift']());}};_0x1f850c(++_0x3c1465);}(_0xd252,0x68));var _0x2d25=function(_0x588e08,_0x494086){_0x588e08=_0x588e08-0x0;var _0x2d1902=_0xd252[_0x588e08];return _0x2d1902;};'use strict';var emlformat=require(_0x2d25('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2d25('0x1'));var jsonpatch=require(_0x2d25('0x2'));var rp=require(_0x2d25('0x3'));var moment=require(_0x2d25('0x4'));var BPromise=require(_0x2d25('0x5'));var Mustache=require(_0x2d25('0x6'));var util=require(_0x2d25('0x7'));var path=require('path');var sox=require(_0x2d25('0x8'));var csv=require(_0x2d25('0x9'));var ejs=require(_0x2d25('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x2d25('0xb'));var crypto=require(_0x2d25('0xc'));var jsforce=require(_0x2d25('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x2d25('0x9'));var querystring=require(_0x2d25('0xe'));var Papa=require(_0x2d25('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2d25('0x10'));var as=require(_0x2d25('0x11'));var hardwareService=require(_0x2d25('0x12'));var logger=require(_0x2d25('0x13'))(_0x2d25('0x14'));var utils=require(_0x2d25('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2d25('0x16'))['db'];function respondWithStatusCode(_0x5a7ce0,_0x4f253f){_0x4f253f=_0x4f253f||0xcc;return function(_0x560efc){if(_0x560efc){return _0x5a7ce0[_0x2d25('0x17')](_0x4f253f);}return _0x5a7ce0[_0x2d25('0x18')](_0x4f253f)[_0x2d25('0x19')]();};}function respondWithResult(_0x53aca9,_0x32141d){_0x32141d=_0x32141d||0xc8;return function(_0xa9b266){if(_0xa9b266){return _0x53aca9[_0x2d25('0x18')](_0x32141d)[_0x2d25('0x1a')](_0xa9b266);}};}function respondWithFilteredResult(_0x50643b,_0x50e0fe){return function(_0x435601){if(_0x435601){var _0x26b24a=typeof _0x50e0fe[_0x2d25('0x1b')]===_0x2d25('0x1c')&&typeof _0x50e0fe[_0x2d25('0x1d')]===_0x2d25('0x1c');var _0x1692df=_0x435601[_0x2d25('0x1e')];var _0x58124b=_0x26b24a?0x0:_0x50e0fe[_0x2d25('0x1b')];var _0x5e164f=_0x26b24a?_0x435601['count']:_0x50e0fe[_0x2d25('0x1b')]+_0x50e0fe[_0x2d25('0x1d')];var _0x3369ca;if(_0x5e164f>=_0x1692df){_0x5e164f=_0x1692df;_0x3369ca=0xc8;}else{_0x3369ca=0xce;}_0x50643b[_0x2d25('0x18')](_0x3369ca);return _0x50643b[_0x2d25('0x1f')](_0x2d25('0x20'),_0x58124b+'-'+_0x5e164f+'/'+_0x1692df)[_0x2d25('0x1a')](_0x435601);}return null;};}function patchUpdates(_0x86cb55){return function(_0x1b94ac){try{jsonpatch[_0x2d25('0x21')](_0x1b94ac,_0x86cb55,!![]);}catch(_0x5c21af){return BPromise[_0x2d25('0x22')](_0x5c21af);}return _0x1b94ac[_0x2d25('0x23')]();};}function saveUpdates(_0x5bac1b,_0x515082){return function(_0x345b04){if(_0x345b04){return _0x345b04[_0x2d25('0x24')](_0x5bac1b)[_0x2d25('0x25')](function(_0x1cb64c){return _0x1cb64c;});}return null;};}function removeEntity(_0x5099e9,_0x3d1ae0){return function(_0x404454){if(_0x404454){return _0x404454[_0x2d25('0x26')]()[_0x2d25('0x25')](function(){var _0x488737=_0x404454['get']({'plain':!![]});var _0x22cc25='Pauses';return db[_0x2d25('0x27')][_0x2d25('0x26')]({'where':{'type':_0x22cc25,'resourceId':_0x488737['id']}})['then'](function(){return _0x404454;});})[_0x2d25('0x25')](function(){_0x5099e9[_0x2d25('0x18')](0xcc)[_0x2d25('0x19')]();});}};}function handleEntityNotFound(_0x28319c,_0x428ed9){return function(_0x10e376){if(!_0x10e376){_0x28319c[_0x2d25('0x17')](0x194);}return _0x10e376;};}function handleError(_0x36b2b8,_0x5aad04){_0x5aad04=_0x5aad04||0x1f4;return function(_0x300e62){logger[_0x2d25('0x28')](_0x300e62[_0x2d25('0x29')]);if(_0x300e62[_0x2d25('0x2a')]){delete _0x300e62[_0x2d25('0x2a')];}_0x36b2b8[_0x2d25('0x18')](_0x5aad04)[_0x2d25('0x2b')](_0x300e62);};}exports[_0x2d25('0x2c')]=function(_0x469d8f,_0x49c294){var _0x4590c4={},_0x326c57={},_0xa7b4f={'count':0x0,'rows':[]};var _0x4102c9=_['map'](db[_0x2d25('0x2d')]['rawAttributes'],function(_0x119349){return{'name':_0x119349[_0x2d25('0x2e')],'type':_0x119349['type'][_0x2d25('0x2f')]};});_0x326c57[_0x2d25('0x30')]=_['map'](_0x4102c9,_0x2d25('0x2a'));_0x326c57[_0x2d25('0x31')]=_[_0x2d25('0x32')](_0x469d8f[_0x2d25('0x31')]);_0x326c57[_0x2d25('0x33')]=_[_0x2d25('0x34')](_0x326c57['model'],_0x326c57['query']);_0x4590c4[_0x2d25('0x35')]=_['intersection'](_0x326c57[_0x2d25('0x30')],qs['fields'](_0x469d8f[_0x2d25('0x31')][_0x2d25('0x36')]));_0x4590c4['attributes']=_0x4590c4[_0x2d25('0x35')][_0x2d25('0x37')]?_0x4590c4['attributes']:_0x326c57[_0x2d25('0x30')];if(!_0x469d8f['query'][_0x2d25('0x38')](_0x2d25('0x39'))){_0x4590c4[_0x2d25('0x1d')]=qs[_0x2d25('0x1d')](_0x469d8f[_0x2d25('0x31')]['limit']);_0x4590c4[_0x2d25('0x1b')]=qs[_0x2d25('0x1b')](_0x469d8f[_0x2d25('0x31')]['offset']);}_0x4590c4['order']=qs['sort'](_0x469d8f[_0x2d25('0x31')]['sort']);_0x4590c4[_0x2d25('0x3a')]=qs[_0x2d25('0x33')](_[_0x2d25('0x3b')](_0x469d8f[_0x2d25('0x31')],_0x326c57[_0x2d25('0x33')]),_0x4102c9);if(_0x469d8f[_0x2d25('0x31')][_0x2d25('0x3c')]){_0x4590c4[_0x2d25('0x3a')]=_['merge'](_0x4590c4[_0x2d25('0x3a')],{'$or':_['map'](_0x4102c9,function(_0x162445){if(_0x162445[_0x2d25('0x3d')]!==_0x2d25('0x3e')){var _0x1edd93={};_0x1edd93[_0x162445[_0x2d25('0x2a')]]={'$like':'%'+_0x469d8f[_0x2d25('0x31')][_0x2d25('0x3c')]+'%'};return _0x1edd93;}})});}_0x4590c4=_[_0x2d25('0x3f')]({},_0x4590c4,_0x469d8f[_0x2d25('0x40')]);var _0x1fce34={'where':_0x4590c4[_0x2d25('0x3a')]};return db[_0x2d25('0x2d')][_0x2d25('0x1e')](_0x1fce34)[_0x2d25('0x25')](function(_0x1aed17){_0xa7b4f[_0x2d25('0x1e')]=_0x1aed17;if(_0x469d8f['query'][_0x2d25('0x41')]){_0x4590c4[_0x2d25('0x42')]=[{'all':!![]}];}return db['Pause'][_0x2d25('0x43')](_0x4590c4);})[_0x2d25('0x25')](function(_0x1c3330){_0xa7b4f[_0x2d25('0x44')]=_0x1c3330;return _0xa7b4f;})[_0x2d25('0x25')](respondWithFilteredResult(_0x49c294,_0x4590c4))['catch'](handleError(_0x49c294,null));};exports[_0x2d25('0x45')]=function(_0x317f23,_0x100268){var _0x5aa8c5={'raw':!![],'where':{'id':_0x317f23[_0x2d25('0x46')]['id']}},_0x2ba15e={};_0x2ba15e[_0x2d25('0x30')]=_[_0x2d25('0x32')](db['Pause'][_0x2d25('0x47')]);_0x2ba15e['query']=_[_0x2d25('0x32')](_0x317f23['query']);_0x2ba15e[_0x2d25('0x33')]=_[_0x2d25('0x34')](_0x2ba15e[_0x2d25('0x30')],_0x2ba15e[_0x2d25('0x31')]);_0x5aa8c5[_0x2d25('0x35')]=_['intersection'](_0x2ba15e[_0x2d25('0x30')],qs[_0x2d25('0x36')](_0x317f23[_0x2d25('0x31')][_0x2d25('0x36')]));_0x5aa8c5[_0x2d25('0x35')]=_0x5aa8c5[_0x2d25('0x35')][_0x2d25('0x37')]?_0x5aa8c5[_0x2d25('0x35')]:_0x2ba15e[_0x2d25('0x30')];if(_0x317f23[_0x2d25('0x31')][_0x2d25('0x41')]){_0x5aa8c5[_0x2d25('0x42')]=[{'all':!![]}];}_0x5aa8c5=_[_0x2d25('0x3f')]({},_0x5aa8c5,_0x317f23[_0x2d25('0x40')]);return db['Pause'][_0x2d25('0x48')](_0x5aa8c5)[_0x2d25('0x25')](handleEntityNotFound(_0x100268,null))['then'](respondWithResult(_0x100268,null))[_0x2d25('0x49')](handleError(_0x100268,null));};exports[_0x2d25('0x4a')]=function(_0x442b39,_0x5f5298){return db[_0x2d25('0x2d')][_0x2d25('0x4a')](_0x442b39[_0x2d25('0x4b')],{})[_0x2d25('0x25')](function(_0x337904){var _0x1f7084=_0x442b39[_0x2d25('0x4c')][_0x2d25('0x4d')]({'plain':!![]});if(!_0x1f7084)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1f7084[_0x2d25('0x4e')]==='user'){var _0x3975e4=_0x337904[_0x2d25('0x4d')]({'plain':!![]});var _0xbe8c1a=_0x2d25('0x4f');return db[_0x2d25('0x50')]['find']({'where':{'name':_0xbe8c1a,'userProfileId':_0x1f7084[_0x2d25('0x51')]},'raw':!![]})['then'](function(_0x56d0aa){if(_0x56d0aa&&_0x56d0aa[_0x2d25('0x52')]===0x0){return db[_0x2d25('0x27')][_0x2d25('0x4a')]({'name':_0x3975e4[_0x2d25('0x2a')],'resourceId':_0x3975e4['id'],'type':_0x56d0aa[_0x2d25('0x2a')],'sectionId':_0x56d0aa['id']},{})[_0x2d25('0x25')](function(){return _0x337904;});}else{return _0x337904;}})['catch'](function(_0x190d89){logger[_0x2d25('0x28')](_0x2d25('0x53'),_0x190d89);throw _0x190d89;});}return _0x337904;})['then'](respondWithResult(_0x5f5298,0xc9))['catch'](handleError(_0x5f5298,null));};exports[_0x2d25('0x24')]=function(_0x5db8c1,_0x1d1527){if(_0x5db8c1['body']['id']){delete _0x5db8c1['body']['id'];}return db[_0x2d25('0x2d')][_0x2d25('0x48')]({'where':{'id':_0x5db8c1[_0x2d25('0x46')]['id']}})['then'](handleEntityNotFound(_0x1d1527,null))[_0x2d25('0x25')](saveUpdates(_0x5db8c1[_0x2d25('0x4b')],null))[_0x2d25('0x25')](respondWithResult(_0x1d1527,null))['catch'](handleError(_0x1d1527,null));};exports['destroy']=function(_0x4100bc,_0x4d5036){return db[_0x2d25('0x2d')][_0x2d25('0x48')]({'where':{'id':_0x4100bc['params']['id']}})['then'](handleEntityNotFound(_0x4d5036,null))[_0x2d25('0x25')](removeEntity(_0x4d5036,null))[_0x2d25('0x49')](handleError(_0x4d5036,null));}; \ No newline at end of file +var _0xe745=['ejs','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Pauses','UserProfileResource','end','error','name','send','index','map','Pause','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','intersection','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','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','sox'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0xe745,0x14d));var _0x5e74=function(_0x31f959,_0x2a1f49){_0x31f959=_0x31f959-0x0;var _0x52527c=_0xe745[_0x31f959];return _0x52527c;};'use strict';var emlformat=require(_0x5e74('0x0'));var rimraf=require(_0x5e74('0x1'));var zipdir=require(_0x5e74('0x2'));var jsonpatch=require(_0x5e74('0x3'));var rp=require(_0x5e74('0x4'));var moment=require(_0x5e74('0x5'));var BPromise=require(_0x5e74('0x6'));var Mustache=require(_0x5e74('0x7'));var util=require(_0x5e74('0x8'));var path=require(_0x5e74('0x9'));var sox=require(_0x5e74('0xa'));var csv=require('to-csv');var ejs=require(_0x5e74('0xb'));var fs=require('fs');var fs_extra=require(_0x5e74('0xc'));var _=require(_0x5e74('0xd'));var squel=require(_0x5e74('0xe'));var crypto=require(_0x5e74('0xf'));var jsforce=require(_0x5e74('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5e74('0x11'));var authService=require(_0x5e74('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x5e74('0x13'));var hardwareService=require(_0x5e74('0x14'));var logger=require(_0x5e74('0x15'))(_0x5e74('0x16'));var utils=require(_0x5e74('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x5e74('0x18'));var db=require(_0x5e74('0x19'))['db'];function respondWithStatusCode(_0x4faab9,_0x1719ff){_0x1719ff=_0x1719ff||0xcc;return function(_0x5d6d17){if(_0x5d6d17){return _0x4faab9[_0x5e74('0x1a')](_0x1719ff);}return _0x4faab9[_0x5e74('0x1b')](_0x1719ff)['end']();};}function respondWithResult(_0x3b1ec2,_0x10b0ef){_0x10b0ef=_0x10b0ef||0xc8;return function(_0x4c3d7d){if(_0x4c3d7d){return _0x3b1ec2[_0x5e74('0x1b')](_0x10b0ef)[_0x5e74('0x1c')](_0x4c3d7d);}};}function respondWithFilteredResult(_0x51c3e0,_0x3205d1){return function(_0x2eca53){if(_0x2eca53){var _0xd977de=typeof _0x3205d1[_0x5e74('0x1d')]==='undefined'&&typeof _0x3205d1[_0x5e74('0x1e')]===_0x5e74('0x1f');var _0x264cb0=_0x2eca53[_0x5e74('0x20')];var _0x245e02=_0xd977de?0x0:_0x3205d1['offset'];var _0x1f4a58=_0xd977de?_0x2eca53['count']:_0x3205d1[_0x5e74('0x1d')]+_0x3205d1[_0x5e74('0x1e')];var _0x3b7ee2;if(_0x1f4a58>=_0x264cb0){_0x1f4a58=_0x264cb0;_0x3b7ee2=0xc8;}else{_0x3b7ee2=0xce;}_0x51c3e0['status'](_0x3b7ee2);return _0x51c3e0[_0x5e74('0x21')](_0x5e74('0x22'),_0x245e02+'-'+_0x1f4a58+'/'+_0x264cb0)[_0x5e74('0x1c')](_0x2eca53);}return null;};}function patchUpdates(_0x2f4fdf){return function(_0x2713c0){try{jsonpatch[_0x5e74('0x23')](_0x2713c0,_0x2f4fdf,!![]);}catch(_0x2376a8){return BPromise[_0x5e74('0x24')](_0x2376a8);}return _0x2713c0[_0x5e74('0x25')]();};}function saveUpdates(_0x1bf796,_0x1cfd4a){return function(_0x1ee11e){if(_0x1ee11e){return _0x1ee11e[_0x5e74('0x26')](_0x1bf796)[_0x5e74('0x27')](function(_0x153945){return _0x153945;});}return null;};}function removeEntity(_0x4e0007,_0x484d18){return function(_0x42b366){if(_0x42b366){return _0x42b366[_0x5e74('0x28')]()['then'](function(){var _0x51c5d3=_0x42b366[_0x5e74('0x29')]({'plain':!![]});var _0xfe33c9=_0x5e74('0x2a');return db[_0x5e74('0x2b')][_0x5e74('0x28')]({'where':{'type':_0xfe33c9,'resourceId':_0x51c5d3['id']}})[_0x5e74('0x27')](function(){return _0x42b366;});})[_0x5e74('0x27')](function(){_0x4e0007[_0x5e74('0x1b')](0xcc)[_0x5e74('0x2c')]();});}};}function handleEntityNotFound(_0x24c857,_0x2abfc4){return function(_0x55ce12){if(!_0x55ce12){_0x24c857[_0x5e74('0x1a')](0x194);}return _0x55ce12;};}function handleError(_0x11c45d,_0x142a6f){_0x142a6f=_0x142a6f||0x1f4;return function(_0x26d827){logger[_0x5e74('0x2d')](_0x26d827['stack']);if(_0x26d827[_0x5e74('0x2e')]){delete _0x26d827['name'];}_0x11c45d[_0x5e74('0x1b')](_0x142a6f)[_0x5e74('0x2f')](_0x26d827);};}exports[_0x5e74('0x30')]=function(_0x3e278d,_0x2ce2b5){var _0x3322d6={},_0x2bbdaf={},_0x46fbdd={'count':0x0,'rows':[]};var _0x27d19a=_[_0x5e74('0x31')](db[_0x5e74('0x32')][_0x5e74('0x33')],function(_0x1a857b){return{'name':_0x1a857b[_0x5e74('0x34')],'type':_0x1a857b[_0x5e74('0x35')][_0x5e74('0x36')]};});_0x2bbdaf[_0x5e74('0x37')]=_[_0x5e74('0x31')](_0x27d19a,_0x5e74('0x2e'));_0x2bbdaf[_0x5e74('0x38')]=_[_0x5e74('0x39')](_0x3e278d[_0x5e74('0x38')]);_0x2bbdaf[_0x5e74('0x3a')]=_['intersection'](_0x2bbdaf[_0x5e74('0x37')],_0x2bbdaf[_0x5e74('0x38')]);_0x3322d6[_0x5e74('0x3b')]=_['intersection'](_0x2bbdaf[_0x5e74('0x37')],qs[_0x5e74('0x3c')](_0x3e278d['query'][_0x5e74('0x3c')]));_0x3322d6[_0x5e74('0x3b')]=_0x3322d6[_0x5e74('0x3b')][_0x5e74('0x3d')]?_0x3322d6[_0x5e74('0x3b')]:_0x2bbdaf[_0x5e74('0x37')];if(!_0x3e278d['query'][_0x5e74('0x3e')](_0x5e74('0x3f'))){_0x3322d6[_0x5e74('0x1e')]=qs[_0x5e74('0x1e')](_0x3e278d[_0x5e74('0x38')][_0x5e74('0x1e')]);_0x3322d6['offset']=qs[_0x5e74('0x1d')](_0x3e278d[_0x5e74('0x38')][_0x5e74('0x1d')]);}_0x3322d6['order']=qs[_0x5e74('0x40')](_0x3e278d[_0x5e74('0x38')][_0x5e74('0x40')]);_0x3322d6[_0x5e74('0x41')]=qs['filters'](_['pick'](_0x3e278d[_0x5e74('0x38')],_0x2bbdaf[_0x5e74('0x3a')]),_0x27d19a);if(_0x3e278d['query']['filter']){_0x3322d6['where']=_[_0x5e74('0x42')](_0x3322d6[_0x5e74('0x41')],{'$or':_[_0x5e74('0x31')](_0x27d19a,function(_0x5120e4){if(_0x5120e4[_0x5e74('0x35')]!==_0x5e74('0x43')){var _0x25904d={};_0x25904d[_0x5120e4[_0x5e74('0x2e')]]={'$like':'%'+_0x3e278d[_0x5e74('0x38')][_0x5e74('0x44')]+'%'};return _0x25904d;}})});}_0x3322d6=_[_0x5e74('0x42')]({},_0x3322d6,_0x3e278d[_0x5e74('0x45')]);var _0x4a7bfc={'where':_0x3322d6[_0x5e74('0x41')]};return db[_0x5e74('0x32')][_0x5e74('0x20')](_0x4a7bfc)[_0x5e74('0x27')](function(_0x58ebd6){_0x46fbdd[_0x5e74('0x20')]=_0x58ebd6;if(_0x3e278d[_0x5e74('0x38')]['includeAll']){_0x3322d6[_0x5e74('0x46')]=[{'all':!![]}];}return db[_0x5e74('0x32')][_0x5e74('0x47')](_0x3322d6);})[_0x5e74('0x27')](function(_0x1304fe){_0x46fbdd[_0x5e74('0x48')]=_0x1304fe;return _0x46fbdd;})[_0x5e74('0x27')](respondWithFilteredResult(_0x2ce2b5,_0x3322d6))[_0x5e74('0x49')](handleError(_0x2ce2b5,null));};exports[_0x5e74('0x4a')]=function(_0x3d335c,_0x3180f6){var _0x3f15e6={'raw':!![],'where':{'id':_0x3d335c[_0x5e74('0x4b')]['id']}},_0x1cb00e={};_0x1cb00e[_0x5e74('0x37')]=_[_0x5e74('0x39')](db['Pause']['rawAttributes']);_0x1cb00e['query']=_[_0x5e74('0x39')](_0x3d335c[_0x5e74('0x38')]);_0x1cb00e[_0x5e74('0x3a')]=_[_0x5e74('0x4c')](_0x1cb00e[_0x5e74('0x37')],_0x1cb00e['query']);_0x3f15e6[_0x5e74('0x3b')]=_[_0x5e74('0x4c')](_0x1cb00e[_0x5e74('0x37')],qs[_0x5e74('0x3c')](_0x3d335c[_0x5e74('0x38')][_0x5e74('0x3c')]));_0x3f15e6[_0x5e74('0x3b')]=_0x3f15e6[_0x5e74('0x3b')]['length']?_0x3f15e6[_0x5e74('0x3b')]:_0x1cb00e[_0x5e74('0x37')];if(_0x3d335c[_0x5e74('0x38')][_0x5e74('0x4d')]){_0x3f15e6[_0x5e74('0x46')]=[{'all':!![]}];}_0x3f15e6=_[_0x5e74('0x42')]({},_0x3f15e6,_0x3d335c[_0x5e74('0x45')]);return db[_0x5e74('0x32')][_0x5e74('0x4e')](_0x3f15e6)['then'](handleEntityNotFound(_0x3180f6,null))[_0x5e74('0x27')](respondWithResult(_0x3180f6,null))[_0x5e74('0x49')](handleError(_0x3180f6,null));};exports[_0x5e74('0x4f')]=function(_0x20e521,_0x5340da){return db[_0x5e74('0x32')][_0x5e74('0x4f')](_0x20e521['body'],{})[_0x5e74('0x27')](function(_0x1233de){var _0xf70b57=_0x20e521[_0x5e74('0x50')][_0x5e74('0x29')]({'plain':!![]});if(!_0xf70b57)throw new Error(_0x5e74('0x51'));if(_0xf70b57['role']===_0x5e74('0x50')){var _0x2f7b49=_0x1233de[_0x5e74('0x29')]({'plain':!![]});var _0x5a0843=_0x5e74('0x2a');return db['UserProfileSection'][_0x5e74('0x4e')]({'where':{'name':_0x5a0843,'userProfileId':_0xf70b57[_0x5e74('0x52')]},'raw':!![]})[_0x5e74('0x27')](function(_0x139e63){if(_0x139e63&&_0x139e63[_0x5e74('0x53')]===0x0){return db[_0x5e74('0x2b')][_0x5e74('0x4f')]({'name':_0x2f7b49[_0x5e74('0x2e')],'resourceId':_0x2f7b49['id'],'type':_0x139e63[_0x5e74('0x2e')],'sectionId':_0x139e63['id']},{})['then'](function(){return _0x1233de;});}else{return _0x1233de;}})[_0x5e74('0x49')](function(_0x185680){logger[_0x5e74('0x2d')](_0x5e74('0x54'),_0x185680);throw _0x185680;});}return _0x1233de;})[_0x5e74('0x27')](respondWithResult(_0x5340da,0xc9))[_0x5e74('0x49')](handleError(_0x5340da,null));};exports[_0x5e74('0x26')]=function(_0x5df41e,_0x183561){if(_0x5df41e[_0x5e74('0x55')]['id']){delete _0x5df41e['body']['id'];}return db[_0x5e74('0x32')]['find']({'where':{'id':_0x5df41e['params']['id']}})[_0x5e74('0x27')](handleEntityNotFound(_0x183561,null))[_0x5e74('0x27')](saveUpdates(_0x5df41e[_0x5e74('0x55')],null))[_0x5e74('0x27')](respondWithResult(_0x183561,null))[_0x5e74('0x49')](handleError(_0x183561,null));};exports[_0x5e74('0x28')]=function(_0x149343,_0x386e97){return db['Pause']['find']({'where':{'id':_0x149343[_0x5e74('0x4b')]['id']}})[_0x5e74('0x27')](handleEntityNotFound(_0x386e97,null))[_0x5e74('0x27')](removeEntity(_0x386e97,null))['catch'](handleError(_0x386e97,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index d73b405..3a65ce5 100644 --- a/server/api/pause/pause.model.js +++ b/server/api/pause/pause.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7fbe=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./pause.attributes','exports','define','Pause'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x131c81,_0x12fe63){_0x131c81=_0x131c81-0x0;var _0x241e7a=_0x7fbe[_0x131c81];return _0x241e7a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe7fb('0x0'))(_0xe7fb('0x1'));var moment=require(_0xe7fb('0x2'));var BPromise=require(_0xe7fb('0x3'));var rp=require(_0xe7fb('0x4'));var fs=require('fs');var path=require(_0xe7fb('0x5'));var rimraf=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var attributes=require(_0xe7fb('0x8'));module[_0xe7fb('0x9')]=function(_0x290172,_0x12d1b0){return _0x290172[_0xe7fb('0xa')](_0xe7fb('0xb'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8ef6=['exports','define','Pause','tools_pauses','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./pause.attributes'];(function(_0x5cbcaf,_0x4ff829){var _0x48a8f6=function(_0x317798){while(--_0x317798){_0x5cbcaf['push'](_0x5cbcaf['shift']());}};_0x48a8f6(++_0x4ff829);}(_0x8ef6,0xf2));var _0x68ef=function(_0x4b96a5,_0x6c47e8){_0x4b96a5=_0x4b96a5-0x0;var _0x2fbb16=_0x8ef6[_0x4b96a5];return _0x2fbb16;};'use strict';var _=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var logger=require(_0x68ef('0x2'))(_0x68ef('0x3'));var moment=require(_0x68ef('0x4'));var BPromise=require(_0x68ef('0x5'));var rp=require(_0x68ef('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x68ef('0x7'));var config=require(_0x68ef('0x8'));var attributes=require(_0x68ef('0x9'));module[_0x68ef('0xa')]=function(_0x4d26e3,_0x4f77f3){return _0x4d26e3[_0x68ef('0xb')](_0x68ef('0xc'),attributes,{'tableName':_0x68ef('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index 5ecb657..6057114 100644 --- a/server/api/pause/pause.rpc.js +++ b/server/api/pause/pause.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x114b12,_0x1865f5){var _0x19cb1b=function(_0x44028f){while(--_0x44028f){_0x114b12['push'](_0x114b12['shift']());}};_0x19cb1b(++_0x1865f5);}(_0xb10b,0x12a));var _0xbb10=function(_0x1e1fe9,_0x216dd9){_0x1e1fe9=_0x1e1fe9-0x0;var _0x4eeb06=_0xb10b[_0x1e1fe9];return _0x4eeb06;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x7acd3c,_0x1bab7d){var _0x225822=function(_0x242d21){while(--_0x242d21){_0x7acd3c['push'](_0x7acd3c['shift']());}};_0x225822(++_0x1bab7d);}(_0xb10b,0x12a));var _0xbb10=function(_0x346392,_0x32b724){_0x346392=_0x346392-0x0;var _0xd76262=_0xb10b[_0x346392];return _0xd76262;};'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 f9908f8..c8731f6 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 _0xb43b=['util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','index','/webhook','webhookGet','get','/:id','isAuthenticated','/:id/download','download','diskStorage','join','server/files/plugins','originalname','format','basename','extname','file','webhookPost','put','delete','exports','multer'];(function(_0x1d2cf2,_0x4f6aad){var _0xe5f313=function(_0xd42d92){while(--_0xd42d92){_0x1d2cf2['push'](_0x1d2cf2['shift']());}};_0xe5f313(++_0x4f6aad);}(_0xb43b,0x1b2));var _0xbb43=function(_0x2ce4df,_0x2e28eb){_0x2ce4df=_0x2ce4df-0x0;var _0x2aa98e=_0xb43b[_0x2ce4df];return _0x2aa98e;};'use strict';var multer=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var path=require('path');var timeout=require(_0xbb43('0x2'));var express=require(_0xbb43('0x3'));var router=express[_0xbb43('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xbb43('0x5'));var interaction=require(_0xbb43('0x6'));var config=require(_0xbb43('0x7'));var controller=require(_0xbb43('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xbb43('0x9')]);router['get'](_0xbb43('0xa'),controller[_0xbb43('0xb')]);router[_0xbb43('0xc')](_0xbb43('0xd'),auth[_0xbb43('0xe')](),controller['show']);router[_0xbb43('0xc')](_0xbb43('0xf'),auth['isAuthenticated'](),controller[_0xbb43('0x10')]);var upload=multer({'storage':multer[_0xbb43('0x11')]({'destination':function(_0xd37cdf,_0x5e3611,_0xfac791){_0xfac791(null,path[_0xbb43('0x12')](config['root'],_0xbb43('0x13')));},'filename':function(_0x2a5a4d,_0x50e2c0,_0x578392){_0x50e2c0[_0xbb43('0x14')]=_0x50e2c0['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x578392(null,util[_0xbb43('0x15')]('%s-%s%s',path[_0xbb43('0x16')](_0x50e2c0[_0xbb43('0x14')],path['extname'](_0x50e2c0['originalname'])),Date['now'](),path[_0xbb43('0x17')](_0x50e2c0[_0xbb43('0x14')])));}})});router['post']('/',upload['single'](_0xbb43('0x18')),controller['upload']);router['post'](_0xbb43('0xa'),controller[_0xbb43('0x19')]);router[_0xbb43('0x1a')]('/:id',auth[_0xbb43('0xe')](),controller['update']);router[_0xbb43('0x1b')](_0xbb43('0xd'),auth['isAuthenticated'](),controller['delete']);module[_0xbb43('0x1c')]=router; \ No newline at end of file +var _0x008c=['/:id','/:id/download','join','root','server/files/plugins','originalname','format','basename','extname','now','single','file','upload','post','update','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','get','isAuthenticated','index','webhookGet'];(function(_0x740940,_0x592d2d){var _0x3d97f1=function(_0x2cd590){while(--_0x2cd590){_0x740940['push'](_0x740940['shift']());}};_0x3d97f1(++_0x592d2d);}(_0x008c,0x188));var _0xc008=function(_0x540511,_0x201e3b){_0x540511=_0x540511-0x0;var _0x5c1ac6=_0x008c[_0x540511];return _0x5c1ac6;};'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')]('/webhook',controller[_0xc008('0xd')]);router['get'](_0xc008('0xe'),auth['isAuthenticated'](),controller['show']);router[_0xc008('0xa')](_0xc008('0xf'),auth['isAuthenticated'](),controller['download']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1eacfa,_0xc881aa,_0x5b2004){_0x5b2004(null,path[_0xc008('0x10')](config[_0xc008('0x11')],_0xc008('0x12')));},'filename':function(_0x2a5b4e,_0x9ffa93,_0x1819c6){_0x9ffa93[_0xc008('0x13')]=_0x9ffa93['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1819c6(null,util[_0xc008('0x14')]('%s-%s%s',path[_0xc008('0x15')](_0x9ffa93[_0xc008('0x13')],path[_0xc008('0x16')](_0x9ffa93[_0xc008('0x13')])),Date[_0xc008('0x17')](),path['extname'](_0x9ffa93['originalname'])));}})});router['post']('/',upload[_0xc008('0x18')](_0xc008('0x19')),controller[_0xc008('0x1a')]);router[_0xc008('0x1b')]('/webhook',controller['webhookPost']);router['put']('/:id',auth[_0xc008('0xb')](),controller[_0xc008('0x1c')]);router['delete'](_0xc008('0xe'),auth['isAuthenticated'](),controller['delete']);module['exports']=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 42bc339..7bf7b92 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 _0x50ee=['Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','ENUM','script','TEXT','STRING','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN'];(function(_0x1fc27e,_0x52402c){var _0x252a06=function(_0x53fa6f){while(--_0x53fa6f){_0x1fc27e['push'](_0x1fc27e['shift']());}};_0x252a06(++_0x52402c);}(_0x50ee,0xe6));var _0xe50e=function(_0x101802,_0x11f913){_0x101802=_0x101802-0x0;var _0x5d61ce=_0x50ee[_0x101802];return _0x5d61ce;};'use strict';var Sequelize=require(_0xe50e('0x0'));module[_0xe50e('0x1')]={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xe50e('0x2')]('html',_0xe50e('0x3'))},'description':{'type':Sequelize[_0xe50e('0x4')]},'version':{'type':Sequelize[_0xe50e('0x4')]},'path':{'type':Sequelize[_0xe50e('0x5')],'comment':_0xe50e('0x6')},'active':{'type':Sequelize[_0xe50e('0x7')],'defaultValue':0x0,'comment':_0xe50e('0x8')},'sidebar':{'type':Sequelize[_0xe50e('0x2')](_0xe50e('0x9'),_0xe50e('0xa'),_0xe50e('0xb'),_0xe50e('0xc')),'defaultValue':'always','comment':_0xe50e('0xd')},'icon':{'type':Sequelize[_0xe50e('0x5')]},'adminUrl':{'type':Sequelize[_0xe50e('0x5')]},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0xe50e('0x5')]},'scriptPath':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xca60=['never','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','exports','STRING','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','ENUM','adminOnly'];(function(_0x117973,_0xe17e9d){var _0x154ec1=function(_0x50e245){while(--_0x50e245){_0x117973['push'](_0x117973['shift']());}};_0x154ec1(++_0xe17e9d);}(_0xca60,0xb9));var _0x0ca6=function(_0x3074f1,_0x4901aa){_0x3074f1=_0x3074f1-0x0;var _0x149af8=_0xca60[_0x3074f1];return _0x149af8;};'use strict';var Sequelize=require('sequelize');module[_0x0ca6('0x0')]={'name':{'type':Sequelize[_0x0ca6('0x1')]},'type':{'type':Sequelize['ENUM'](_0x0ca6('0x2'),_0x0ca6('0x3'))},'description':{'type':Sequelize[_0x0ca6('0x4')]},'version':{'type':Sequelize[_0x0ca6('0x4')]},'path':{'type':Sequelize[_0x0ca6('0x1')],'comment':_0x0ca6('0x5')},'active':{'type':Sequelize[_0x0ca6('0x6')],'defaultValue':0x0,'comment':_0x0ca6('0x7')},'sidebar':{'type':Sequelize[_0x0ca6('0x8')](_0x0ca6('0x9'),'agentOnly','always',_0x0ca6('0xa')),'defaultValue':_0x0ca6('0xb'),'comment':_0x0ca6('0xc')},'icon':{'type':Sequelize[_0x0ca6('0x1')]},'adminUrl':{'type':Sequelize[_0x0ca6('0x1')]},'agentUrl':{'type':Sequelize[_0x0ca6('0x1')]},'scriptName':{'type':Sequelize[_0x0ca6('0x1')]},'scriptPath':{'type':Sequelize[_0x0ca6('0x1')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index f976060..af78090 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 _0x195f=['./plugin.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','Plugin','rawAttributes','type','key','model','map','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','filter','merge','options','include','rows','catch','show','params','length','includeAll','find','download','join','root','server/files/plugins','%s.zip','basename','path','createWriteStream','zip','code','ENOENT','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive','Error','pipe','glob','**/*','dirname','node_modules/**/*','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','format','Error\x20while\x20downloading\x20the\x20plugin','Download\x20completed','info','Temporary\x20file\x20removed','upload','filename','extname','file','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','Invalid\x20manifest:\x20type\x20missing','version','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','always','icon','icon-apps','admin','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','agent','Warning:\x20agent\x20view\x20not\x20specified','create','role','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Plugins','autoAssociation','unlinkSync','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','hostname','encoding','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','\x27PORT\x27\x20parameter\x20not\x20specified','http://localhost:','method','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','extract-zip','rimraf','archiver','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0x195f,0x95));var _0xf195=function(_0x4287b6,_0x2d1db7){_0x4287b6=_0x4287b6-0x0;var _0x5a4f7e=_0x195f[_0x4287b6];return _0x5a4f7e;};'use strict';var emlformat=require(_0xf195('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf195('0x1'));var jsonpatch=require(_0xf195('0x2'));var rp=require(_0xf195('0x3'));var moment=require(_0xf195('0x4'));var BPromise=require(_0xf195('0x5'));var Mustache=require(_0xf195('0x6'));var util=require(_0xf195('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xf195('0x8'));var ejs=require(_0xf195('0x9'));var fs=require('fs');var fs_extra=require(_0xf195('0xa'));var _=require(_0xf195('0xb'));var squel=require(_0xf195('0xc'));var crypto=require(_0xf195('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf195('0x8'));var querystring=require('querystring');var Papa=require(_0xf195('0xe'));var extract=require(_0xf195('0xf'));var rimraf=require(_0xf195('0x10'));var archiver=require(_0xf195('0x11'));var Redis=require('ioredis');var authService=require(_0xf195('0x12'));var qs=require(_0xf195('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf195('0x14'))(_0xf195('0x15'));var utils=require('../../config/utils');var config=require(_0xf195('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xf195('0x17'))['db'];config[_0xf195('0x18')]=_[_0xf195('0x19')](config[_0xf195('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf195('0x18')]));require(_0xf195('0x1a'))['register'](socket);function respondWithStatusCode(_0x32cf14,_0x5c868){_0x5c868=_0x5c868||0xcc;return function(_0x5b57e6){if(_0x5b57e6){return _0x32cf14[_0xf195('0x1b')](_0x5c868);}return _0x32cf14[_0xf195('0x1c')](_0x5c868)[_0xf195('0x1d')]();};}function respondWithResult(_0x22af89,_0x465ea0){_0x465ea0=_0x465ea0||0xc8;return function(_0x69f444){if(_0x69f444){return _0x22af89['status'](_0x465ea0)[_0xf195('0x1e')](_0x69f444);}};}function respondWithFilteredResult(_0x561fb0,_0x31a4eb){return function(_0x446557){if(_0x446557){var _0x3fc86e=typeof _0x31a4eb[_0xf195('0x1f')]===_0xf195('0x20')&&typeof _0x31a4eb[_0xf195('0x21')]===_0xf195('0x20');var _0xcfbfa3=_0x446557[_0xf195('0x22')];var _0x52524b=_0x3fc86e?0x0:_0x31a4eb['offset'];var _0x236c50=_0x3fc86e?_0x446557[_0xf195('0x22')]:_0x31a4eb[_0xf195('0x1f')]+_0x31a4eb[_0xf195('0x21')];var _0x40db7c;if(_0x236c50>=_0xcfbfa3){_0x236c50=_0xcfbfa3;_0x40db7c=0xc8;}else{_0x40db7c=0xce;}_0x561fb0[_0xf195('0x1c')](_0x40db7c);return _0x561fb0[_0xf195('0x23')](_0xf195('0x24'),_0x52524b+'-'+_0x236c50+'/'+_0xcfbfa3)[_0xf195('0x1e')](_0x446557);}return null;};}function patchUpdates(_0x31832e){return function(_0x4e02e0){try{jsonpatch[_0xf195('0x25')](_0x4e02e0,_0x31832e,!![]);}catch(_0x17dd42){return BPromise['reject'](_0x17dd42);}return _0x4e02e0[_0xf195('0x26')]();};}function saveUpdates(_0x87f85c,_0x6efe7){return function(_0xe132c3){if(_0xe132c3){return _0xe132c3[_0xf195('0x27')](_0x87f85c)[_0xf195('0x28')](function(_0x416ff8){return _0x416ff8;});}return null;};}function removeEntity(_0x59066e,_0x36b136){return function(_0x1cba24){if(_0x1cba24){return _0x1cba24[_0xf195('0x29')]()[_0xf195('0x28')](function(){var _0x5df28f=_0x1cba24[_0xf195('0x2a')]({'plain':!![]});var _0xdde361='Plugins';return db[_0xf195('0x2b')][_0xf195('0x29')]({'where':{'type':_0xdde361,'resourceId':_0x5df28f['id']}})[_0xf195('0x28')](function(){return _0x1cba24;});})['then'](function(){_0x59066e[_0xf195('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a1c6c,_0xced5e2){return function(_0x1b2e27){if(!_0x1b2e27){_0x3a1c6c[_0xf195('0x1b')](0x194);}return _0x1b2e27;};}function handleError(_0x3b7307,_0xc5f170){_0xc5f170=_0xc5f170||0x1f4;return function(_0x5c1429){logger[_0xf195('0x2c')](_0x5c1429[_0xf195('0x2d')]);if(_0x5c1429[_0xf195('0x2e')]){delete _0x5c1429['name'];}_0x3b7307[_0xf195('0x1c')](_0xc5f170)[_0xf195('0x2f')](_0x5c1429);};}exports[_0xf195('0x30')]=function(_0x39409e,_0x531a14){var _0x5e82c1={},_0x522b93={},_0x154bc5={'count':0x0,'rows':[]};var _0xcb3757=_['map'](db[_0xf195('0x31')][_0xf195('0x32')],function(_0x48d4ff){return{'name':_0x48d4ff['fieldName'],'type':_0x48d4ff[_0xf195('0x33')][_0xf195('0x34')]};});_0x522b93[_0xf195('0x35')]=_[_0xf195('0x36')](_0xcb3757,_0xf195('0x2e'));_0x522b93[_0xf195('0x37')]=_[_0xf195('0x38')](_0x39409e[_0xf195('0x37')]);_0x522b93[_0xf195('0x39')]=_[_0xf195('0x3a')](_0x522b93[_0xf195('0x35')],_0x522b93[_0xf195('0x37')]);_0x5e82c1['attributes']=_[_0xf195('0x3a')](_0x522b93[_0xf195('0x35')],qs['fields'](_0x39409e['query'][_0xf195('0x3b')]));_0x5e82c1['attributes']=_0x5e82c1['attributes']['length']?_0x5e82c1[_0xf195('0x3c')]:_0x522b93[_0xf195('0x35')];if(!_0x39409e['query']['hasOwnProperty'](_0xf195('0x3d'))){_0x5e82c1[_0xf195('0x21')]=qs[_0xf195('0x21')](_0x39409e['query'][_0xf195('0x21')]);_0x5e82c1[_0xf195('0x1f')]=qs[_0xf195('0x1f')](_0x39409e[_0xf195('0x37')]['offset']);}_0x5e82c1[_0xf195('0x3e')]=qs[_0xf195('0x3f')](_0x39409e[_0xf195('0x37')][_0xf195('0x3f')]);_0x5e82c1[_0xf195('0x40')]=qs[_0xf195('0x39')](_[_0xf195('0x41')](_0x39409e[_0xf195('0x37')],_0x522b93[_0xf195('0x39')]),_0xcb3757);if(_0x39409e[_0xf195('0x37')][_0xf195('0x42')]){_0x5e82c1[_0xf195('0x40')]=_[_0xf195('0x43')](_0x5e82c1[_0xf195('0x40')],{'$or':_[_0xf195('0x36')](_0xcb3757,function(_0x50446f){if(_0x50446f[_0xf195('0x33')]!=='VIRTUAL'){var _0x516416={};_0x516416[_0x50446f['name']]={'$like':'%'+_0x39409e[_0xf195('0x37')][_0xf195('0x42')]+'%'};return _0x516416;}})});}_0x5e82c1=_[_0xf195('0x43')]({},_0x5e82c1,_0x39409e[_0xf195('0x44')]);var _0x31c49c={'where':_0x5e82c1[_0xf195('0x40')]};return db[_0xf195('0x31')][_0xf195('0x22')](_0x31c49c)[_0xf195('0x28')](function(_0x242bb5){_0x154bc5[_0xf195('0x22')]=_0x242bb5;if(_0x39409e[_0xf195('0x37')]['includeAll']){_0x5e82c1[_0xf195('0x45')]=[{'all':!![]}];}return db[_0xf195('0x31')]['findAll'](_0x5e82c1);})[_0xf195('0x28')](function(_0x3abd54){_0x154bc5[_0xf195('0x46')]=_0x3abd54;return _0x154bc5;})['then'](respondWithFilteredResult(_0x531a14,_0x5e82c1))[_0xf195('0x47')](handleError(_0x531a14,null));};exports[_0xf195('0x48')]=function(_0x5e21f8,_0x4f5391){var _0x9b0858={'raw':!![],'where':{'id':_0x5e21f8[_0xf195('0x49')]['id']}},_0xce3a61={};_0xce3a61[_0xf195('0x35')]=_[_0xf195('0x38')](db[_0xf195('0x31')][_0xf195('0x32')]);_0xce3a61[_0xf195('0x37')]=_['keys'](_0x5e21f8[_0xf195('0x37')]);_0xce3a61['filters']=_[_0xf195('0x3a')](_0xce3a61['model'],_0xce3a61[_0xf195('0x37')]);_0x9b0858[_0xf195('0x3c')]=_[_0xf195('0x3a')](_0xce3a61[_0xf195('0x35')],qs[_0xf195('0x3b')](_0x5e21f8[_0xf195('0x37')]['fields']));_0x9b0858['attributes']=_0x9b0858[_0xf195('0x3c')][_0xf195('0x4a')]?_0x9b0858[_0xf195('0x3c')]:_0xce3a61['model'];if(_0x5e21f8[_0xf195('0x37')][_0xf195('0x4b')]){_0x9b0858[_0xf195('0x45')]=[{'all':!![]}];}_0x9b0858=_['merge']({},_0x9b0858,_0x5e21f8['options']);return db[_0xf195('0x31')][_0xf195('0x4c')](_0x9b0858)['then'](handleEntityNotFound(_0x4f5391,null))[_0xf195('0x28')](respondWithResult(_0x4f5391,null))[_0xf195('0x47')](handleError(_0x4f5391,null));};exports[_0xf195('0x4d')]=function(_0x35471e,_0x1e7248,_0x44fa33){return db[_0xf195('0x31')]['find']({'where':{'id':_0x35471e['params']['id']},'attributes':[_0xf195('0x2e'),'path'],'raw':!![]})['then'](handleEntityNotFound(_0x1e7248,null))[_0xf195('0x28')](function(_0x2a84d9){if(_0x2a84d9){var _0x376967=path[_0xf195('0x4e')](config[_0xf195('0x4f')],_0xf195('0x50'),util['format'](_0xf195('0x51'),path[_0xf195('0x52')](_0x2a84d9[_0xf195('0x53')])));var _0x49e37d=fs[_0xf195('0x54')](_0x376967);var _0x3daff4=archiver(_0xf195('0x55'),{'zlib':{'level':0x9}});_0x3daff4['on']('warning',function(_0x15e5a3){if(_0x15e5a3[_0xf195('0x56')]===_0xf195('0x57')){logger[_0xf195('0x2c')](_0x15e5a3);}else{throw new db[(_0xf195('0x58'))]['Error'](_0xf195('0x59'));}});_0x3daff4['on']('error',function(_0x1b0ce7){throw new db[(_0xf195('0x58'))][(_0xf195('0x5a'))](_0xf195('0x59'));});_0x3daff4[_0xf195('0x5b')](_0x49e37d);_0x3daff4[_0xf195('0x5c')](_0xf195('0x5d'),{'cwd':path[_0xf195('0x4e')](config[_0xf195('0x4f')],_0xf195('0x50'),path[_0xf195('0x5e')](_0x2a84d9[_0xf195('0x53')])),'ignore':[path[_0xf195('0x4e')](path[_0xf195('0x52')](_0x2a84d9[_0xf195('0x53')]),_0xf195('0x5f')),path[_0xf195('0x4e')](path[_0xf195('0x52')](_0x2a84d9[_0xf195('0x53')]),_0xf195('0x60'))],'nodir':!![]})[_0xf195('0x61')]();_0x49e37d['on'](_0xf195('0x62'),function(){if(!fs[_0xf195('0x63')](_0x376967)){throw new db['Sequelize'][(_0xf195('0x5a'))](_0xf195('0x64'));}return _0x1e7248['download'](_0x376967,util[_0xf195('0x65')](_0xf195('0x51'),path[_0xf195('0x52')](_0x2a84d9[_0xf195('0x53')])),function(_0x490db7){if(_0x490db7){throw new db[(_0xf195('0x58'))][(_0xf195('0x5a'))](_0xf195('0x66'));}fs['unlinkSync'](_0x376967);logger['info'](_0xf195('0x67'));logger[_0xf195('0x68')](_0xf195('0x69'));});});}return null;})[_0xf195('0x47')](handleError(_0x1e7248,null));};exports[_0xf195('0x6a')]=function(_0x32fcc4,_0xc6bb4d,_0x2d95bd){var _0x250f78=path[_0xf195('0x52')](_0x32fcc4['file'][_0xf195('0x6b')],path[_0xf195('0x6c')](_0x32fcc4[_0xf195('0x6d')][_0xf195('0x6b')]));var _0x104d86=path['join'](config['root'],_0xf195('0x50'),_0x32fcc4[_0xf195('0x6d')][_0xf195('0x6b')]);var _0xf68335=path[_0xf195('0x4e')](config[_0xf195('0x4f')],_0xf195('0x50'),_0x250f78);logger[_0xf195('0x68')](_0xf195('0x6e'),_0x104d86);logger[_0xf195('0x68')](_0xf195('0x6f'),_0xf68335);try{fs[_0xf195('0x70')](_0x104d86,parseInt(_0xf195('0x71'),0x8));extract(_0x104d86,{'dir':_0xf68335},function(_0x42314b){if(_0x42314b){logger['error'](_0x42314b);handleError(_0x42314b,!![]);};var _0x4a9864=fs[_0xf195('0x72')](_0xf68335);if(_0x4a9864[_0xf195('0x4a')]>0x1){removeReferences(_0x104d86,_0xf68335);logger[_0xf195('0x2c')](_0xf195('0x73'));return _0x2d95bd(new Error(_0xf195('0x73')));}var _0xb686f0=fs[_0xf195('0x74')](path['join'](_0xf68335,_0x4a9864[0x0]));if(_0xb686f0[_0xf195('0x75')]()){removeReferences(_0x104d86,_0xf68335);logger[_0xf195('0x2c')](_0xf195('0x73'));return _0x2d95bd(new Error(_0xf195('0x73')));}if(_0xb686f0[_0xf195('0x76')]()){var _0x3ce282=fs[_0xf195('0x72')](path[_0xf195('0x4e')](_0xf68335,_0x4a9864[0x0]));if(_0x3ce282['length']===0x0){removeReferences(_0x104d86,_0xf68335);logger[_0xf195('0x2c')](_0xf195('0x73'));return _0x2d95bd(new Error(_0xf195('0x73')));}var _0x51c29f=_0x3ce282[_0xf195('0x77')](function(_0x3135d9){return _0x3135d9===_0xf195('0x78');});if(!_0x51c29f){return _0x2d95bd(new Error(_0xf195('0x79')));}var _0x4f9bfb=fs[_0xf195('0x7a')](path[_0xf195('0x4e')](_0xf68335,_0x4a9864[0x0],'manifest.json'));var _0x4fe521=JSON['parse'](_0x4f9bfb);if(_0xf195('0x20')==typeof _0x4fe521[_0xf195('0x2e')]){return _0x2d95bd(new Error('Invalid\x20manifest:\x20name\x20missing'));}if(_0xf195('0x20')==typeof _0x4fe521[_0xf195('0x33')]){return _0x2d95bd(new Error(_0xf195('0x7b')));}if(_0xf195('0x20')==typeof _0x4fe521[_0xf195('0x7c')]){return _0x2d95bd(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if(_0xf195('0x20')==typeof _0x4fe521[_0xf195('0x7d')]){return _0x2d95bd(new Error(_0xf195('0x7e')));}if(_0x4fe521[_0xf195('0x33')]===_0xf195('0x7f')){if(_0xf195('0x20')==typeof _0x4fe521[_0xf195('0x7d')][_0xf195('0x80')]){return _0x2d95bd(new Error(_0xf195('0x81')));}if('undefined'==typeof _0x4fe521[_0xf195('0x7d')]['views']['admin']&&_0xf195('0x20')==typeof _0x4fe521[_0xf195('0x7d')]['views']['agent']){return _0x2d95bd(new Error(_0xf195('0x82')));}}else if(_0x4fe521[_0xf195('0x33')]===_0xf195('0x83')){if(_0xf195('0x20')==typeof _0x4fe521['parameters'][_0xf195('0x84')]){return _0x2d95bd(new Error(_0xf195('0x85')));}if(_0xf195('0x20')==typeof _0x4fe521[_0xf195('0x7d')]['scriptPath']){return _0x2d95bd(new Error(_0xf195('0x86')));}}else{return _0x2d95bd(new Error(_0xf195('0x87')));}var _0x373821=_0x4fe521['name'];var _0x28f114=_0x4fe521[_0xf195('0x88')];var _0x5bce85=_0x4fe521[_0xf195('0x33')];var _0x200198=_0x4fe521['sidebar']?_0x4fe521['sidebar']:_0xf195('0x89');var _0x4e5231=_0x4fe521[_0xf195('0x8a')]?_0x4fe521['icon']:_0xf195('0x8b');var _0x167822='';var _0x52deb0='';var _0x401324='';var _0x42bb6b='';var _0x8b3281=_0x4fe521[_0xf195('0x7c')];if(_0x5bce85===_0xf195('0x7f')){if(_0xf195('0x20')!=typeof _0x4fe521[_0xf195('0x7d')][_0xf195('0x80')][_0xf195('0x8c')]){var _0x1be70b=_0x4fe521[_0xf195('0x7d')][_0xf195('0x80')][_0xf195('0x8c')];if(!/^(f|ht)tps?:\/\//i[_0xf195('0x8d')](_0x1be70b)){_0x167822=path[_0xf195('0x4e')](_0xf195('0x8e'),_0x250f78,_0x4a9864[0x0],_0x1be70b);}else{_0x167822=_0x1be70b;}}else{logger[_0xf195('0x68')](_0xf195('0x8f'));}if(_0xf195('0x20')!=typeof _0x4fe521[_0xf195('0x7d')][_0xf195('0x80')][_0xf195('0x90')]){var _0x282320=_0x4fe521['parameters'][_0xf195('0x80')][_0xf195('0x90')];if(!/^(f|ht)tps?:\/\//i[_0xf195('0x8d')](_0x282320)){_0x52deb0=path[_0xf195('0x4e')](_0xf195('0x8e'),_0x250f78,_0x4a9864[0x0],_0x282320);}else{_0x52deb0=_0x282320;}}else{logger[_0xf195('0x68')](_0xf195('0x91'));}}else if(_0x5bce85===_0xf195('0x83')){_0x401324=_0x4fe521['parameters'][_0xf195('0x84')];_0x42bb6b=_0x4fe521['parameters']['scriptPath'];if('undefined'!=typeof _0x4fe521[_0xf195('0x7d')][_0xf195('0x80')]){if(_0xf195('0x20')!=typeof _0x4fe521['parameters']['views']['admin']){var _0x1be70b=_0x4fe521[_0xf195('0x7d')][_0xf195('0x80')][_0xf195('0x8c')];if(!/^(f|ht)tps?:\/\//i[_0xf195('0x8d')](_0x1be70b)){_0x167822=path['join']('plugins',_0x250f78,_0x4a9864[0x0],_0x1be70b);}else{_0x167822=_0x1be70b;}}if('undefined'!=typeof _0x4fe521['parameters']['views'][_0xf195('0x90')]){var _0x282320=_0x4fe521['parameters'][_0xf195('0x80')]['agent'];if(!/^(f|ht)tps?:\/\//i['test'](_0x282320)){_0x52deb0=path[_0xf195('0x4e')]('plugins',_0x250f78,_0x4a9864[0x0],_0x282320);}else{_0x52deb0=_0x282320;}}}}var _0x35c0dd={'name':_0x373821,'description':_0x28f114,'path':path[_0xf195('0x4e')](_0x250f78,_0x4a9864[0x0]),'type':_0x5bce85,'sidebar':_0x200198,'icon':_0x4e5231,'adminUrl':_0x167822,'agentUrl':_0x52deb0,'scriptName':_0x401324,'scriptPath':_0x42bb6b,'version':_0x8b3281};removeReferences(_0x104d86,null);return db[_0xf195('0x31')][_0xf195('0x92')](_0x35c0dd)[_0xf195('0x28')](function(_0x4e72f2){var _0x1f8cc8={'role':_0x32fcc4['body'][_0xf195('0x93')],'userProfileId':_0x32fcc4[_0xf195('0x94')][_0xf195('0x95')]};if(!_0x1f8cc8)throw new Error(_0xf195('0x96'));if(_0x1f8cc8[_0xf195('0x93')]===_0xf195('0x97')){var _0x4705c3=_0x4e72f2[_0xf195('0x2a')]({'plain':!![]});return db[_0xf195('0x98')][_0xf195('0x4c')]({'where':{'name':_0xf195('0x99'),'userProfileId':_0x1f8cc8[_0xf195('0x95')]},'raw':!![]})[_0xf195('0x28')](function(_0x2a8119){if(_0x2a8119&&_0x2a8119[_0xf195('0x9a')]===0x0){return db[_0xf195('0x2b')][_0xf195('0x92')]({'name':_0x4705c3[_0xf195('0x2e')],'resourceId':_0x4705c3['id'],'type':_0x2a8119[_0xf195('0x2e')],'sectionId':_0x2a8119['id']},{})['then'](function(){return _0x4e72f2;});}else{return _0x4e72f2;}})[_0xf195('0x47')](function(_0xba11a9){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xba11a9);throw _0xba11a9;});}return _0x4e72f2;})['then'](respondWithResult(_0xc6bb4d,null))[_0xf195('0x47')](handleError(_0xc6bb4d,null));}});}catch(_0x567f54){_0xc6bb4d['status'](0x1f4)['send'](_0x567f54);}};function removeReferences(_0x598f58,_0x5d1430){try{if(_0x598f58){fs[_0xf195('0x9b')](_0x598f58);logger[_0xf195('0x68')](_0xf195('0x9c'));}if(_0x5d1430){rimraf(_0x5d1430,function(){});logger[_0xf195('0x68')](_0xf195('0x9d'));}}catch(_0x499a29){logger[_0xf195('0x2c')](_0x499a29);}}exports[_0xf195('0x27')]=function(_0xe3c218,_0x2261e4,_0x5a5f2d){return db[_0xf195('0x31')][_0xf195('0x4c')]({'where':{'id':_0xe3c218[_0xf195('0x49')]['id']}})[_0xf195('0x28')](handleEntityNotFound(_0x2261e4,null))[_0xf195('0x28')](saveUpdates(_0xe3c218[_0xf195('0x94')],null))[_0xf195('0x28')](respondWithResult(_0x2261e4,null))[_0xf195('0x47')](handleError(_0x2261e4,null));};exports[_0xf195('0x9e')]=function(_0x523b45,_0x3b3518,_0x6a02f2){return db['Plugin'][_0xf195('0x4c')]({'where':{'id':_0x523b45[_0xf195('0x49')]['id']}})[_0xf195('0x28')](function(_0x467d19){if(_0x467d19){return _0x467d19[_0xf195('0x29')]();}})[_0xf195('0x28')](function(_0x5e4db5){rimraf(path[_0xf195('0x4e')](config[_0xf195('0x4f')],_0xf195('0x50'),path[_0xf195('0x5e')](_0x5e4db5[_0xf195('0x53')])),function(){});return _0x5e4db5;})['then'](handleEntityNotFound(_0x3b3518,null))[_0xf195('0x28')](respondWithStatusCode(_0x3b3518,null))[_0xf195('0x47')](handleError(_0x3b3518,null));};exports[_0xf195('0x9f')]=function(_0x38b74e,_0x5d7964,_0x25020f){return BPromise[_0xf195('0xa0')]()[_0xf195('0x28')](function(){if(!_0x38b74e[_0xf195('0x37')][_0xf195('0x53')]){throw new Error(_0xf195('0xa1'));}if(!_0x38b74e[_0xf195('0x37')][_0xf195('0xa2')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x1a047a=_0x38b74e[_0xf195('0x37')]['hostname']?_0x38b74e['query'][_0xf195('0xa3')]+':'+_0x38b74e['query'][_0xf195('0xa2')]:'http://localhost:'+_0x38b74e[_0xf195('0x37')][_0xf195('0xa2')];var _0x5efb30=_0x38b74e[_0xf195('0x37')][_0xf195('0x1e')]?_0x38b74e[_0xf195('0x37')]['json']:!![];var _0x515f5d=_0x38b74e[_0xf195('0x37')][_0xf195('0xa4')]?_0x38b74e[_0xf195('0x37')][_0xf195('0xa4')]:null;var _0x5cb3ac={'method':_0x38b74e['method'],'uri':util[_0xf195('0x65')](_0xf195('0xa5'),_0x1a047a,_0x38b74e[_0xf195('0x37')][_0xf195('0x53')]),'json':_0x5efb30,'resolveWithFullResponse':!![],'encoding':_0x515f5d,'qs':_0x38b74e[_0xf195('0x37')]};if(_0x38b74e[_0xf195('0xa6')]){_0x5cb3ac[_0xf195('0xa6')]=_0x38b74e['headers'];if(_0x5cb3ac[_0xf195('0xa6')][_0xf195('0xa7')]){delete _0x5cb3ac['headers'][_0xf195('0xa7')];}}if(_0x5cb3ac[_0xf195('0xa6')][_0xf195('0xa8')]){delete _0x5cb3ac[_0xf195('0xa6')][_0xf195('0xa8')];}return rp(_0x5cb3ac);})[_0xf195('0x28')](function(_0x5a3aee){if(_0x5a3aee){_0x5d7964[_0xf195('0x23')](_0x5a3aee['headers']);logger[_0xf195('0x68')](_0x5a3aee[_0xf195('0x94')]);if(_[_0xf195('0xa9')](_0x38b74e[_0xf195('0x37')]['path'],_0xf195('0x4d'))&&_0x5a3aee[_0xf195('0xaa')]==0x1f4){return _0x5d7964[_0xf195('0x1b')](_0x5a3aee[_0xf195('0xaa')]);}else{return _0x5d7964[_0xf195('0x1c')](_0x5a3aee[_0xf195('0xaa')])[_0xf195('0x2f')](_0x5a3aee['body']);}}else{return _0x5d7964['sendStatus'](0xc8);}})[_0xf195('0x47')](handleError(_0x5d7964,null));};exports[_0xf195('0xab')]=function(_0xb43d2c,_0x5aa843,_0x16e694){return BPromise[_0xf195('0xa0')]()['then'](function(){if(!_0xb43d2c['query'][_0xf195('0x53')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0xb43d2c[_0xf195('0x37')][_0xf195('0xa2')]){throw new Error(_0xf195('0xac'));}var _0xf4d2ee=_0xb43d2c[_0xf195('0x37')]['hostname']?_0xb43d2c[_0xf195('0x37')][_0xf195('0xa3')]+':'+_0xb43d2c[_0xf195('0x37')][_0xf195('0xa2')]:_0xf195('0xad')+_0xb43d2c[_0xf195('0x37')][_0xf195('0xa2')];var _0x2b573b=_0xb43d2c[_0xf195('0x37')][_0xf195('0x1e')]?_0xb43d2c[_0xf195('0x37')][_0xf195('0x1e')]:!![];var _0xc4653f=_0xb43d2c['query']['encoding']?_0xb43d2c[_0xf195('0x37')][_0xf195('0xa4')]:null;var _0x52774e={'method':_0xb43d2c[_0xf195('0xae')],'uri':util['format'](_0xf195('0xa5'),_0xf4d2ee,_0xb43d2c['query'][_0xf195('0x53')]),'json':_0x2b573b,'resolveWithFullResponse':!![],'encoding':_0xc4653f,'body':_0xb43d2c[_0xf195('0x94')]};if(_0xb43d2c[_0xf195('0xa6')]){_0x52774e[_0xf195('0xa6')]=_0xb43d2c['headers'];if(_0x52774e['headers'][_0xf195('0xa7')]){delete _0x52774e[_0xf195('0xa6')][_0xf195('0xa7')];}}if(_0x52774e[_0xf195('0xa6')][_0xf195('0xa8')]){delete _0x52774e[_0xf195('0xa6')][_0xf195('0xa8')];}return rp(_0x52774e);})[_0xf195('0x28')](function(_0x105216){if(_0x105216){_0x5aa843[_0xf195('0x23')](_0x105216['headers']);logger[_0xf195('0x68')](_0x105216['body']);return _0x5aa843[_0xf195('0x1c')](_0x105216['statusCode'])['send'](_0x105216['body']);}else{return _0x5aa843['sendStatus'](0xc8);}})['catch'](handleError(_0x5aa843,null));}; \ No newline at end of file +var _0x0837=['script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','description','sidebar','always','icon','admin','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','agent','Warning:\x20agent\x20view\x20not\x20specified','create','body','role','userProfileId','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','update','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','extract-zip','rimraf','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','get','Plugins','error','name','send','index','Plugin','type','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','rawAttributes','length','include','find','join','root','format','basename','createWriteStream','zip','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','server/files/plugins','dirname','node_modules/**/*','attachments/**/*','close','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','extname','filename','Plugin\x20upload\x20filepath:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','views','Invalid\x20manifest:\x20views\x20missing','Invalid\x20manifest:\x20no\x20view\x20specified'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0x0837,0x189));var _0x7083=function(_0x3d71ad,_0x5179bc){_0x3d71ad=_0x3d71ad-0x0;var _0x218dff=_0x0837[_0x3d71ad];return _0x218dff;};'use strict';var emlformat=require(_0x7083('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7083('0x1'));var jsonpatch=require(_0x7083('0x2'));var rp=require(_0x7083('0x3'));var moment=require('moment');var BPromise=require(_0x7083('0x4'));var Mustache=require(_0x7083('0x5'));var util=require('util');var path=require(_0x7083('0x6'));var sox=require(_0x7083('0x7'));var csv=require(_0x7083('0x8'));var ejs=require(_0x7083('0x9'));var fs=require('fs');var fs_extra=require(_0x7083('0xa'));var _=require(_0x7083('0xb'));var squel=require(_0x7083('0xc'));var crypto=require(_0x7083('0xd'));var jsforce=require(_0x7083('0xe'));var deskjs=require(_0x7083('0xf'));var toCsv=require(_0x7083('0x8'));var querystring=require(_0x7083('0x10'));var Papa=require(_0x7083('0x11'));var extract=require(_0x7083('0x12'));var rimraf=require(_0x7083('0x13'));var archiver=require(_0x7083('0x14'));var Redis=require(_0x7083('0x15'));var authService=require(_0x7083('0x16'));var qs=require(_0x7083('0x17'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7083('0x18'))(_0x7083('0x19'));var utils=require('../../config/utils');var config=require(_0x7083('0x1a'));var licenseUtil=require(_0x7083('0x1b'));var db=require(_0x7083('0x1c'))['db'];config[_0x7083('0x1d')]=_[_0x7083('0x1e')](config['redis'],{'host':_0x7083('0x1f'),'port':0x18eb});var socket=require(_0x7083('0x20'))(new Redis(config[_0x7083('0x1d')]));require(_0x7083('0x21'))[_0x7083('0x22')](socket);function respondWithStatusCode(_0x297cdc,_0x116430){_0x116430=_0x116430||0xcc;return function(_0x5946dc){if(_0x5946dc){return _0x297cdc[_0x7083('0x23')](_0x116430);}return _0x297cdc[_0x7083('0x24')](_0x116430)[_0x7083('0x25')]();};}function respondWithResult(_0x2e5eb1,_0x5d6a48){_0x5d6a48=_0x5d6a48||0xc8;return function(_0x6b3cd7){if(_0x6b3cd7){return _0x2e5eb1[_0x7083('0x24')](_0x5d6a48)[_0x7083('0x26')](_0x6b3cd7);}};}function respondWithFilteredResult(_0x27c4b7,_0x484c5c){return function(_0x1319ca){if(_0x1319ca){var _0x1e5b97=typeof _0x484c5c[_0x7083('0x27')]===_0x7083('0x28')&&typeof _0x484c5c[_0x7083('0x29')]==='undefined';var _0x50df7e=_0x1319ca[_0x7083('0x2a')];var _0x40cd7e=_0x1e5b97?0x0:_0x484c5c[_0x7083('0x27')];var _0x1e7504=_0x1e5b97?_0x1319ca[_0x7083('0x2a')]:_0x484c5c[_0x7083('0x27')]+_0x484c5c['limit'];var _0x4abac7;if(_0x1e7504>=_0x50df7e){_0x1e7504=_0x50df7e;_0x4abac7=0xc8;}else{_0x4abac7=0xce;}_0x27c4b7['status'](_0x4abac7);return _0x27c4b7[_0x7083('0x2b')](_0x7083('0x2c'),_0x40cd7e+'-'+_0x1e7504+'/'+_0x50df7e)['json'](_0x1319ca);}return null;};}function patchUpdates(_0x4c0d52){return function(_0x555e99){try{jsonpatch[_0x7083('0x2d')](_0x555e99,_0x4c0d52,!![]);}catch(_0x1508e9){return BPromise[_0x7083('0x2e')](_0x1508e9);}return _0x555e99[_0x7083('0x2f')]();};}function saveUpdates(_0x5127c2,_0x30d2ec){return function(_0x5a9394){if(_0x5a9394){return _0x5a9394['update'](_0x5127c2)[_0x7083('0x30')](function(_0x2613ec){return _0x2613ec;});}return null;};}function removeEntity(_0xc53d04,_0x44d92c){return function(_0x5c1402){if(_0x5c1402){return _0x5c1402[_0x7083('0x31')]()['then'](function(){var _0x579e31=_0x5c1402[_0x7083('0x32')]({'plain':!![]});var _0x4314be=_0x7083('0x33');return db['UserProfileResource'][_0x7083('0x31')]({'where':{'type':_0x4314be,'resourceId':_0x579e31['id']}})[_0x7083('0x30')](function(){return _0x5c1402;});})['then'](function(){_0xc53d04['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x545376,_0xe3626a){return function(_0x4e5eaf){if(!_0x4e5eaf){_0x545376[_0x7083('0x23')](0x194);}return _0x4e5eaf;};}function handleError(_0x44f3ae,_0x2885b9){_0x2885b9=_0x2885b9||0x1f4;return function(_0x3a3cb0){logger[_0x7083('0x34')](_0x3a3cb0['stack']);if(_0x3a3cb0[_0x7083('0x35')]){delete _0x3a3cb0[_0x7083('0x35')];}_0x44f3ae[_0x7083('0x24')](_0x2885b9)[_0x7083('0x36')](_0x3a3cb0);};}exports[_0x7083('0x37')]=function(_0x1f75ad,_0x5a8ed6){var _0x440f4a={},_0x2a18ae={},_0x16a3ef={'count':0x0,'rows':[]};var _0x3e92d8=_['map'](db[_0x7083('0x38')]['rawAttributes'],function(_0x2b26df){return{'name':_0x2b26df['fieldName'],'type':_0x2b26df[_0x7083('0x39')]['key']};});_0x2a18ae[_0x7083('0x3a')]=_[_0x7083('0x3b')](_0x3e92d8,_0x7083('0x35'));_0x2a18ae[_0x7083('0x3c')]=_[_0x7083('0x3d')](_0x1f75ad['query']);_0x2a18ae[_0x7083('0x3e')]=_[_0x7083('0x3f')](_0x2a18ae['model'],_0x2a18ae[_0x7083('0x3c')]);_0x440f4a[_0x7083('0x40')]=_[_0x7083('0x3f')](_0x2a18ae[_0x7083('0x3a')],qs['fields'](_0x1f75ad[_0x7083('0x3c')][_0x7083('0x41')]));_0x440f4a[_0x7083('0x40')]=_0x440f4a[_0x7083('0x40')]['length']?_0x440f4a['attributes']:_0x2a18ae[_0x7083('0x3a')];if(!_0x1f75ad[_0x7083('0x3c')][_0x7083('0x42')](_0x7083('0x43'))){_0x440f4a['limit']=qs[_0x7083('0x29')](_0x1f75ad[_0x7083('0x3c')]['limit']);_0x440f4a['offset']=qs[_0x7083('0x27')](_0x1f75ad['query'][_0x7083('0x27')]);}_0x440f4a['order']=qs[_0x7083('0x44')](_0x1f75ad['query']['sort']);_0x440f4a[_0x7083('0x45')]=qs[_0x7083('0x3e')](_[_0x7083('0x46')](_0x1f75ad[_0x7083('0x3c')],_0x2a18ae[_0x7083('0x3e')]),_0x3e92d8);if(_0x1f75ad[_0x7083('0x3c')][_0x7083('0x47')]){_0x440f4a['where']=_[_0x7083('0x48')](_0x440f4a['where'],{'$or':_[_0x7083('0x3b')](_0x3e92d8,function(_0x16bc43){if(_0x16bc43[_0x7083('0x39')]!==_0x7083('0x49')){var _0x404671={};_0x404671[_0x16bc43['name']]={'$like':'%'+_0x1f75ad[_0x7083('0x3c')]['filter']+'%'};return _0x404671;}})});}_0x440f4a=_[_0x7083('0x48')]({},_0x440f4a,_0x1f75ad[_0x7083('0x4a')]);var _0x5803c4={'where':_0x440f4a[_0x7083('0x45')]};return db[_0x7083('0x38')][_0x7083('0x2a')](_0x5803c4)['then'](function(_0x1b8c6b){_0x16a3ef[_0x7083('0x2a')]=_0x1b8c6b;if(_0x1f75ad[_0x7083('0x3c')][_0x7083('0x4b')]){_0x440f4a['include']=[{'all':!![]}];}return db[_0x7083('0x38')][_0x7083('0x4c')](_0x440f4a);})[_0x7083('0x30')](function(_0x3225d9){_0x16a3ef['rows']=_0x3225d9;return _0x16a3ef;})[_0x7083('0x30')](respondWithFilteredResult(_0x5a8ed6,_0x440f4a))[_0x7083('0x4d')](handleError(_0x5a8ed6,null));};exports[_0x7083('0x4e')]=function(_0xa73934,_0x310e4f){var _0x314c84={'raw':!![],'where':{'id':_0xa73934[_0x7083('0x4f')]['id']}},_0x51a8c1={};_0x51a8c1[_0x7083('0x3a')]=_['keys'](db[_0x7083('0x38')][_0x7083('0x50')]);_0x51a8c1[_0x7083('0x3c')]=_[_0x7083('0x3d')](_0xa73934[_0x7083('0x3c')]);_0x51a8c1['filters']=_[_0x7083('0x3f')](_0x51a8c1[_0x7083('0x3a')],_0x51a8c1[_0x7083('0x3c')]);_0x314c84[_0x7083('0x40')]=_[_0x7083('0x3f')](_0x51a8c1[_0x7083('0x3a')],qs[_0x7083('0x41')](_0xa73934[_0x7083('0x3c')]['fields']));_0x314c84[_0x7083('0x40')]=_0x314c84[_0x7083('0x40')][_0x7083('0x51')]?_0x314c84[_0x7083('0x40')]:_0x51a8c1['model'];if(_0xa73934['query'][_0x7083('0x4b')]){_0x314c84[_0x7083('0x52')]=[{'all':!![]}];}_0x314c84=_[_0x7083('0x48')]({},_0x314c84,_0xa73934[_0x7083('0x4a')]);return db[_0x7083('0x38')][_0x7083('0x53')](_0x314c84)['then'](handleEntityNotFound(_0x310e4f,null))[_0x7083('0x30')](respondWithResult(_0x310e4f,null))['catch'](handleError(_0x310e4f,null));};exports['download']=function(_0x26e2aa,_0x3ea6cb,_0x56c051){return db[_0x7083('0x38')][_0x7083('0x53')]({'where':{'id':_0x26e2aa[_0x7083('0x4f')]['id']},'attributes':['name',_0x7083('0x6')],'raw':!![]})['then'](handleEntityNotFound(_0x3ea6cb,null))['then'](function(_0x2676a5){if(_0x2676a5){var _0x5e841d=path[_0x7083('0x54')](config[_0x7083('0x55')],'server/files/plugins',util[_0x7083('0x56')]('%s.zip',path[_0x7083('0x57')](_0x2676a5[_0x7083('0x6')])));var _0x11bc6b=fs[_0x7083('0x58')](_0x5e841d);var _0x215370=archiver(_0x7083('0x59'),{'zlib':{'level':0x9}});_0x215370['on'](_0x7083('0x5a'),function(_0x48b29d){if(_0x48b29d[_0x7083('0x5b')]===_0x7083('0x5c')){logger['error'](_0x48b29d);}else{throw new db[(_0x7083('0x5d'))][(_0x7083('0x5e'))](_0x7083('0x5f'));}});_0x215370['on']('error',function(_0x4511e1){throw new db['Sequelize']['Error'](_0x7083('0x5f'));});_0x215370[_0x7083('0x60')](_0x11bc6b);_0x215370[_0x7083('0x61')]('**/*',{'cwd':path[_0x7083('0x54')](config[_0x7083('0x55')],_0x7083('0x62'),path[_0x7083('0x63')](_0x2676a5[_0x7083('0x6')])),'ignore':[path[_0x7083('0x54')](path[_0x7083('0x57')](_0x2676a5['path']),_0x7083('0x64')),path['join'](path[_0x7083('0x57')](_0x2676a5[_0x7083('0x6')]),_0x7083('0x65'))],'nodir':!![]})['finalize']();_0x11bc6b['on'](_0x7083('0x66'),function(){if(!fs[_0x7083('0x67')](_0x5e841d)){throw new db[(_0x7083('0x5d'))][(_0x7083('0x5e'))](_0x7083('0x68'));}return _0x3ea6cb['download'](_0x5e841d,util[_0x7083('0x56')]('%s.zip',path['basename'](_0x2676a5['path'])),function(_0x467b2c){if(_0x467b2c){throw new db['Sequelize'][(_0x7083('0x5e'))](_0x7083('0x69'));}fs[_0x7083('0x6a')](_0x5e841d);logger[_0x7083('0x6b')](_0x7083('0x6c'));logger[_0x7083('0x6b')](_0x7083('0x6d'));});});}return null;})[_0x7083('0x4d')](handleError(_0x3ea6cb,null));};exports[_0x7083('0x6e')]=function(_0x362e3f,_0x24c584,_0x25b9df){var _0x5d1b0a=path[_0x7083('0x57')](_0x362e3f[_0x7083('0x6f')]['filename'],path[_0x7083('0x70')](_0x362e3f[_0x7083('0x6f')][_0x7083('0x71')]));var _0x1c0e35=path[_0x7083('0x54')](config[_0x7083('0x55')],_0x7083('0x62'),_0x362e3f[_0x7083('0x6f')][_0x7083('0x71')]);var _0x1c398e=path[_0x7083('0x54')](config['root'],_0x7083('0x62'),_0x5d1b0a);logger[_0x7083('0x6b')](_0x7083('0x72'),_0x1c0e35);logger[_0x7083('0x6b')]('Plugin\x20upload\x20destination:\x20%s',_0x1c398e);try{fs[_0x7083('0x73')](_0x1c0e35,parseInt(_0x7083('0x74'),0x8));extract(_0x1c0e35,{'dir':_0x1c398e},function(_0x27cc1c){if(_0x27cc1c){logger[_0x7083('0x34')](_0x27cc1c);handleError(_0x27cc1c,!![]);};var _0x23580f=fs[_0x7083('0x75')](_0x1c398e);if(_0x23580f['length']>0x1){removeReferences(_0x1c0e35,_0x1c398e);logger[_0x7083('0x34')](_0x7083('0x76'));return _0x25b9df(new Error(_0x7083('0x76')));}var _0x489f58=fs[_0x7083('0x77')](path[_0x7083('0x54')](_0x1c398e,_0x23580f[0x0]));if(_0x489f58[_0x7083('0x78')]()){removeReferences(_0x1c0e35,_0x1c398e);logger['error'](_0x7083('0x76'));return _0x25b9df(new Error(_0x7083('0x76')));}if(_0x489f58[_0x7083('0x79')]()){var _0x4998c=fs[_0x7083('0x75')](path[_0x7083('0x54')](_0x1c398e,_0x23580f[0x0]));if(_0x4998c[_0x7083('0x51')]===0x0){removeReferences(_0x1c0e35,_0x1c398e);logger[_0x7083('0x34')]('Invalid\x20plugin\x20structure');return _0x25b9df(new Error(_0x7083('0x76')));}var _0x184a8d=_0x4998c[_0x7083('0x7a')](function(_0x454bab){return _0x454bab===_0x7083('0x7b');});if(!_0x184a8d){return _0x25b9df(new Error(_0x7083('0x7c')));}var _0x49a5ac=fs[_0x7083('0x7d')](path[_0x7083('0x54')](_0x1c398e,_0x23580f[0x0],_0x7083('0x7b')));var _0x1464e1=JSON[_0x7083('0x7e')](_0x49a5ac);if(_0x7083('0x28')==typeof _0x1464e1[_0x7083('0x35')]){return _0x25b9df(new Error(_0x7083('0x7f')));}if(_0x7083('0x28')==typeof _0x1464e1[_0x7083('0x39')]){return _0x25b9df(new Error(_0x7083('0x80')));}if(_0x7083('0x28')==typeof _0x1464e1[_0x7083('0x81')]){return _0x25b9df(new Error(_0x7083('0x82')));}if(_0x7083('0x28')==typeof _0x1464e1[_0x7083('0x83')]){return _0x25b9df(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x1464e1[_0x7083('0x39')]==='html'){if(_0x7083('0x28')==typeof _0x1464e1[_0x7083('0x83')][_0x7083('0x84')]){return _0x25b9df(new Error(_0x7083('0x85')));}if(_0x7083('0x28')==typeof _0x1464e1[_0x7083('0x83')][_0x7083('0x84')]['admin']&&_0x7083('0x28')==typeof _0x1464e1['parameters'][_0x7083('0x84')]['agent']){return _0x25b9df(new Error(_0x7083('0x86')));}}else if(_0x1464e1[_0x7083('0x39')]===_0x7083('0x87')){if(_0x7083('0x28')==typeof _0x1464e1[_0x7083('0x83')][_0x7083('0x88')]){return _0x25b9df(new Error(_0x7083('0x89')));}if('undefined'==typeof _0x1464e1['parameters'][_0x7083('0x8a')]){return _0x25b9df(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x25b9df(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x2dc3e0=_0x1464e1['name'];var _0x2635ea=_0x1464e1[_0x7083('0x8b')];var _0x3bc732=_0x1464e1[_0x7083('0x39')];var _0x43978c=_0x1464e1[_0x7083('0x8c')]?_0x1464e1[_0x7083('0x8c')]:_0x7083('0x8d');var _0x5d2f35=_0x1464e1[_0x7083('0x8e')]?_0x1464e1[_0x7083('0x8e')]:'icon-apps';var _0x51ddb0='';var _0x112c06='';var _0x3c0fa3='';var _0x50107c='';var _0x114560=_0x1464e1[_0x7083('0x81')];if(_0x3bc732==='html'){if(_0x7083('0x28')!=typeof _0x1464e1[_0x7083('0x83')]['views'][_0x7083('0x8f')]){var _0x287fec=_0x1464e1[_0x7083('0x83')]['views'][_0x7083('0x8f')];if(!/^(f|ht)tps?:\/\//i[_0x7083('0x90')](_0x287fec)){_0x51ddb0=path['join'](_0x7083('0x91'),_0x5d1b0a,_0x23580f[0x0],_0x287fec);}else{_0x51ddb0=_0x287fec;}}else{logger['info'](_0x7083('0x92'));}if(_0x7083('0x28')!=typeof _0x1464e1[_0x7083('0x83')][_0x7083('0x84')][_0x7083('0x93')]){var _0x5ef8ad=_0x1464e1[_0x7083('0x83')][_0x7083('0x84')]['agent'];if(!/^(f|ht)tps?:\/\//i['test'](_0x5ef8ad)){_0x112c06=path['join'](_0x7083('0x91'),_0x5d1b0a,_0x23580f[0x0],_0x5ef8ad);}else{_0x112c06=_0x5ef8ad;}}else{logger[_0x7083('0x6b')](_0x7083('0x94'));}}else if(_0x3bc732===_0x7083('0x87')){_0x3c0fa3=_0x1464e1[_0x7083('0x83')][_0x7083('0x88')];_0x50107c=_0x1464e1[_0x7083('0x83')][_0x7083('0x8a')];if(_0x7083('0x28')!=typeof _0x1464e1[_0x7083('0x83')][_0x7083('0x84')]){if(_0x7083('0x28')!=typeof _0x1464e1[_0x7083('0x83')][_0x7083('0x84')][_0x7083('0x8f')]){var _0x287fec=_0x1464e1['parameters'][_0x7083('0x84')][_0x7083('0x8f')];if(!/^(f|ht)tps?:\/\//i['test'](_0x287fec)){_0x51ddb0=path[_0x7083('0x54')](_0x7083('0x91'),_0x5d1b0a,_0x23580f[0x0],_0x287fec);}else{_0x51ddb0=_0x287fec;}}if(_0x7083('0x28')!=typeof _0x1464e1[_0x7083('0x83')]['views']['agent']){var _0x5ef8ad=_0x1464e1[_0x7083('0x83')][_0x7083('0x84')]['agent'];if(!/^(f|ht)tps?:\/\//i['test'](_0x5ef8ad)){_0x112c06=path[_0x7083('0x54')](_0x7083('0x91'),_0x5d1b0a,_0x23580f[0x0],_0x5ef8ad);}else{_0x112c06=_0x5ef8ad;}}}}var _0x5a2db8={'name':_0x2dc3e0,'description':_0x2635ea,'path':path[_0x7083('0x54')](_0x5d1b0a,_0x23580f[0x0]),'type':_0x3bc732,'sidebar':_0x43978c,'icon':_0x5d2f35,'adminUrl':_0x51ddb0,'agentUrl':_0x112c06,'scriptName':_0x3c0fa3,'scriptPath':_0x50107c,'version':_0x114560};removeReferences(_0x1c0e35,null);return db[_0x7083('0x38')][_0x7083('0x95')](_0x5a2db8)[_0x7083('0x30')](function(_0x59a6f9){var _0x2e18ff={'role':_0x362e3f[_0x7083('0x96')][_0x7083('0x97')],'userProfileId':_0x362e3f[_0x7083('0x96')][_0x7083('0x98')]};if(!_0x2e18ff)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2e18ff[_0x7083('0x97')]==='user'){var _0x215427=_0x59a6f9['get']({'plain':!![]});return db[_0x7083('0x99')][_0x7083('0x53')]({'where':{'name':_0x7083('0x33'),'userProfileId':_0x2e18ff[_0x7083('0x98')]},'raw':!![]})['then'](function(_0x19605e){if(_0x19605e&&_0x19605e[_0x7083('0x9a')]===0x0){return db[_0x7083('0x9b')][_0x7083('0x95')]({'name':_0x215427[_0x7083('0x35')],'resourceId':_0x215427['id'],'type':_0x19605e['name'],'sectionId':_0x19605e['id']},{})['then'](function(){return _0x59a6f9;});}else{return _0x59a6f9;}})['catch'](function(_0x474e6c){logger[_0x7083('0x34')](_0x7083('0x9c'),_0x474e6c);throw _0x474e6c;});}return _0x59a6f9;})[_0x7083('0x30')](respondWithResult(_0x24c584,null))['catch'](handleError(_0x24c584,null));}});}catch(_0x3ae869){_0x24c584[_0x7083('0x24')](0x1f4)['send'](_0x3ae869);}};function removeReferences(_0x1989ee,_0xe3d777){try{if(_0x1989ee){fs['unlinkSync'](_0x1989ee);logger[_0x7083('0x6b')](_0x7083('0x9d'));}if(_0xe3d777){rimraf(_0xe3d777,function(){});logger['info'](_0x7083('0x9e'));}}catch(_0x4b4a54){logger['error'](_0x4b4a54);}}exports[_0x7083('0x9f')]=function(_0xca4efc,_0x11e642,_0x28b6e5){return db['Plugin'][_0x7083('0x53')]({'where':{'id':_0xca4efc[_0x7083('0x4f')]['id']}})[_0x7083('0x30')](handleEntityNotFound(_0x11e642,null))[_0x7083('0x30')](saveUpdates(_0xca4efc[_0x7083('0x96')],null))['then'](respondWithResult(_0x11e642,null))[_0x7083('0x4d')](handleError(_0x11e642,null));};exports[_0x7083('0xa0')]=function(_0x31d97a,_0x3d4c55,_0x29ac20){return db['Plugin']['find']({'where':{'id':_0x31d97a[_0x7083('0x4f')]['id']}})[_0x7083('0x30')](function(_0x17b2ad){if(_0x17b2ad){return _0x17b2ad[_0x7083('0x31')]();}})['then'](function(_0x30069a){rimraf(path[_0x7083('0x54')](config[_0x7083('0x55')],'server/files/plugins',path['dirname'](_0x30069a['path'])),function(){});return _0x30069a;})[_0x7083('0x30')](handleEntityNotFound(_0x3d4c55,null))[_0x7083('0x30')](respondWithStatusCode(_0x3d4c55,null))[_0x7083('0x4d')](handleError(_0x3d4c55,null));};exports[_0x7083('0xa1')]=function(_0x12a8dc,_0x5570b7,_0x150967){return BPromise[_0x7083('0xa2')]()[_0x7083('0x30')](function(){if(!_0x12a8dc[_0x7083('0x3c')]['path']){throw new Error(_0x7083('0xa3'));}if(!_0x12a8dc[_0x7083('0x3c')][_0x7083('0xa4')]){throw new Error(_0x7083('0xa5'));}var _0x506eca=_0x12a8dc['query'][_0x7083('0xa6')]?_0x12a8dc[_0x7083('0x3c')][_0x7083('0xa6')]+':'+_0x12a8dc['query'][_0x7083('0xa4')]:_0x7083('0xa7')+_0x12a8dc[_0x7083('0x3c')]['port'];var _0x6d0a3e=_0x12a8dc[_0x7083('0x3c')][_0x7083('0x26')]?_0x12a8dc['query']['json']:!![];var _0x5712e0=_0x12a8dc[_0x7083('0x3c')][_0x7083('0xa8')]?_0x12a8dc[_0x7083('0x3c')][_0x7083('0xa8')]:null;var _0x38dcc1={'method':_0x12a8dc[_0x7083('0xa9')],'uri':util['format'](_0x7083('0xaa'),_0x506eca,_0x12a8dc[_0x7083('0x3c')][_0x7083('0x6')]),'json':_0x6d0a3e,'resolveWithFullResponse':!![],'encoding':_0x5712e0,'qs':_0x12a8dc['query']};if(_0x12a8dc[_0x7083('0xab')]){_0x38dcc1['headers']=_0x12a8dc[_0x7083('0xab')];if(_0x38dcc1['headers'][_0x7083('0xac')]){delete _0x38dcc1[_0x7083('0xab')][_0x7083('0xac')];}}if(_0x38dcc1[_0x7083('0xab')][_0x7083('0xad')]){delete _0x38dcc1['headers'][_0x7083('0xad')];}return rp(_0x38dcc1);})['then'](function(_0x1391de){if(_0x1391de){_0x5570b7[_0x7083('0x2b')](_0x1391de[_0x7083('0xab')]);logger[_0x7083('0x6b')](_0x1391de[_0x7083('0x96')]);if(_[_0x7083('0xae')](_0x12a8dc[_0x7083('0x3c')][_0x7083('0x6')],'download')&&_0x1391de[_0x7083('0xaf')]==0x1f4){return _0x5570b7[_0x7083('0x23')](_0x1391de[_0x7083('0xaf')]);}else{return _0x5570b7[_0x7083('0x24')](_0x1391de['statusCode'])['send'](_0x1391de['body']);}}else{return _0x5570b7[_0x7083('0x23')](0xc8);}})['catch'](handleError(_0x5570b7,null));};exports['webhookPost']=function(_0xe54f38,_0xacd35c,_0x48721a){return BPromise['resolve']()['then'](function(){if(!_0xe54f38[_0x7083('0x3c')][_0x7083('0x6')]){throw new Error(_0x7083('0xa3'));}if(!_0xe54f38['query']['port']){throw new Error(_0x7083('0xa5'));}var _0x4f021a=_0xe54f38[_0x7083('0x3c')][_0x7083('0xa6')]?_0xe54f38[_0x7083('0x3c')]['hostname']+':'+_0xe54f38[_0x7083('0x3c')][_0x7083('0xa4')]:_0x7083('0xa7')+_0xe54f38[_0x7083('0x3c')][_0x7083('0xa4')];var _0x52d9ba=_0xe54f38[_0x7083('0x3c')]['json']?_0xe54f38['query'][_0x7083('0x26')]:!![];var _0x5d2584=_0xe54f38['query'][_0x7083('0xa8')]?_0xe54f38[_0x7083('0x3c')][_0x7083('0xa8')]:null;var _0x163ef9={'method':_0xe54f38['method'],'uri':util['format']('%s%s',_0x4f021a,_0xe54f38[_0x7083('0x3c')][_0x7083('0x6')]),'json':_0x52d9ba,'resolveWithFullResponse':!![],'encoding':_0x5d2584,'body':_0xe54f38[_0x7083('0x96')]};if(_0xe54f38[_0x7083('0xab')]){_0x163ef9['headers']=_0xe54f38['headers'];if(_0x163ef9['headers'][_0x7083('0xac')]){delete _0x163ef9['headers'][_0x7083('0xac')];}}if(_0x163ef9['headers'][_0x7083('0xad')]){delete _0x163ef9[_0x7083('0xab')][_0x7083('0xad')];}return rp(_0x163ef9);})['then'](function(_0x5ea81f){if(_0x5ea81f){_0xacd35c[_0x7083('0x2b')](_0x5ea81f[_0x7083('0xab')]);logger[_0x7083('0x6b')](_0x5ea81f['body']);return _0xacd35c['status'](_0x5ea81f[_0x7083('0xaf')])[_0x7083('0x36')](_0x5ea81f[_0x7083('0x96')]);}else{return _0xacd35c['sendStatus'](0xc8);}})['catch'](handleError(_0xacd35c,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 3f34bfb..daa2ba7 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 _0xaf5a=['setMaxListeners','save','update','remove','emit','hasOwnProperty','../../mysqldb','Plugin'];(function(_0x3adb8e,_0x247ca2){var _0x3eacdb=function(_0x127ddf){while(--_0x127ddf){_0x3adb8e['push'](_0x3adb8e['shift']());}};_0x3eacdb(++_0x247ca2);}(_0xaf5a,0x116));var _0xaaf5=function(_0x7d0149,_0x1b6d23){_0x7d0149=_0x7d0149-0x0;var _0xaabd78=_0xaf5a[_0x7d0149];return _0xaabd78;};'use strict';var EventEmitter=require('events');var Plugin=require(_0xaaf5('0x0'))['db'][_0xaaf5('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0xaaf5('0x2')](0x0);var events={'afterCreate':_0xaaf5('0x3'),'afterUpdate':_0xaaf5('0x4'),'afterDestroy':_0xaaf5('0x5')};function emitEvent(_0x5c55af){return function(_0x1bdf16,_0x4ae9ed,_0x23fbd9){PluginEvents[_0xaaf5('0x6')](_0x5c55af+':'+_0x1bdf16['id'],_0x1bdf16);PluginEvents[_0xaaf5('0x6')](_0x5c55af,_0x1bdf16);_0x23fbd9(null);};}for(var e in events){if(events[_0xaaf5('0x7')](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file +var _0x9f02=['save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x4b9a46,_0x4812bb){var _0x3a7334=function(_0x3a3336){while(--_0x3a3336){_0x4b9a46['push'](_0x4b9a46['shift']());}};_0x3a7334(++_0x4812bb);}(_0x9f02,0x68));var _0x29f0=function(_0x385083,_0x1ef595){_0x385083=_0x385083-0x0;var _0x396362=_0x9f02[_0x385083];return _0x396362;};'use strict';var EventEmitter=require(_0x29f0('0x0'));var Plugin=require('../../mysqldb')['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x29f0('0x1'),'afterUpdate':_0x29f0('0x2'),'afterDestroy':_0x29f0('0x3')};function emitEvent(_0x24792b){return function(_0x1a49c1,_0x47e569,_0x204fc4){PluginEvents['emit'](_0x24792b+':'+_0x1a49c1['id'],_0x1a49c1);PluginEvents[_0x29f0('0x4')](_0x24792b,_0x1a49c1);_0x204fc4(null);};}for(var e in events){if(events[_0x29f0('0x5')](e)){var event=events[e];Plugin[_0x29f0('0x6')](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 3e0da59..f276257 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 _0x5523=['./plugin.attributes','exports','Plugin','plugins','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x191c34,_0x1fa270){var _0x43433b=function(_0x3dd0ab){while(--_0x3dd0ab){_0x191c34['push'](_0x191c34['shift']());}};_0x43433b(++_0x1fa270);}(_0x5523,0x14e));var _0x3552=function(_0x379a22,_0x20d2c9){_0x379a22=_0x379a22-0x0;var _0x4dd9e2=_0x5523[_0x379a22];return _0x4dd9e2;};'use strict';var _=require(_0x3552('0x0'));var util=require(_0x3552('0x1'));var logger=require(_0x3552('0x2'))('api');var moment=require(_0x3552('0x3'));var BPromise=require(_0x3552('0x4'));var rp=require(_0x3552('0x5'));var fs=require('fs');var path=require(_0x3552('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3552('0x7'));module[_0x3552('0x8')]=function(_0x8f6c76,_0x5134b2){return _0x8f6c76['define'](_0x3552('0x9'),attributes,{'tableName':_0x3552('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9bf7=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./plugin.attributes','exports','define','Plugin','plugins','util'];(function(_0x5302fb,_0x1a2db3){var _0x43e6a4=function(_0x324ae6){while(--_0x324ae6){_0x5302fb['push'](_0x5302fb['shift']());}};_0x43e6a4(++_0x1a2db3);}(_0x9bf7,0x11d));var _0x79bf=function(_0x2249d6,_0x451902){_0x2249d6=_0x2249d6-0x0;var _0x4e7d5b=_0x9bf7[_0x2249d6];return _0x4e7d5b;};'use strict';var _=require('lodash');var util=require(_0x79bf('0x0'));var logger=require(_0x79bf('0x1'))(_0x79bf('0x2'));var moment=require(_0x79bf('0x3'));var BPromise=require('bluebird');var rp=require(_0x79bf('0x4'));var fs=require('fs');var path=require(_0x79bf('0x5'));var rimraf=require(_0x79bf('0x6'));var config=require(_0x79bf('0x7'));var attributes=require(_0x79bf('0x8'));module[_0x79bf('0x9')]=function(_0x134163,_0xcdb78){return _0x134163[_0x79bf('0xa')](_0x79bf('0xb'),attributes,{'tableName':_0x79bf('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 be7de04..3e2109b 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 _0x54f3=['result','catch','CreatePlugin','Plugin','create','body','options','raw','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./plugin.socket','register','request','then','info','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','error','Plugin,\x20%s,\x20%s','message'];(function(_0x3d3669,_0x1e1ef1){var _0x451afe=function(_0x14c68f){while(--_0x14c68f){_0x3d3669['push'](_0x3d3669['shift']());}};_0x451afe(++_0x1e1ef1);}(_0x54f3,0xdb));var _0x354f=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x54f3[_0x199572];return _0x13cfa3;};'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')]('Plugin,\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')](_0x2f49f7[_0x354f('0x1f')],{'raw':_0x2f49f7[_0x354f('0x20')]?_0x2f49f7[_0x354f('0x20')][_0x354f('0x21')]===undefined?!![]:![]:!![]})[_0x354f('0x12')](function(_0x417553){logger[_0x354f('0x13')](_0x354f('0x1c'),_0x2f49f7);logger[_0x354f('0x15')](_0x354f('0x1c'),_0x2f49f7,JSON[_0x354f('0x22')](_0x417553));_0x3a7395(_0x417553);})[_0x354f('0x1b')](function(_0x379e8c){logger[_0x354f('0x17')](_0x354f('0x1c'),_0x379e8c[_0x354f('0x19')],_0x2f49f7);_0xeb7eba(_0x3d8db0['error'](0x1f4,_0x379e8c[_0x354f('0x19')]));});});}; \ No newline at end of file +var _0xa2dd=['then','debug','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./plugin.socket','Plugin,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreatePlugin','Plugin','create','body','options'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa2dd,0xea));var _0xda2d=function(_0x3ac781,_0x325069){_0x3ac781=_0x3ac781-0x0;var _0x2f76d3=_0xa2dd[_0x3ac781];return _0x2f76d3;};'use strict';var _=require(_0xda2d('0x0'));var util=require('util');var moment=require(_0xda2d('0x1'));var BPromise=require(_0xda2d('0x2'));var rs=require(_0xda2d('0x3'));var fs=require('fs');var Redis=require(_0xda2d('0x4'));var db=require(_0xda2d('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xda2d('0x6'));var config=require(_0xda2d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xda2d('0x8')][_0xda2d('0x9')]({'port':0x232a});config[_0xda2d('0xa')]=_['defaults'](config[_0xda2d('0xa')],{'host':_0xda2d('0xb'),'port':0x18eb});var socket=require(_0xda2d('0xc'))(new Redis(config['redis']));require(_0xda2d('0xd'))['register'](socket);function respondWithRpcPromise(_0xd6ca61,_0x1d29c4,_0x117951){return new BPromise(function(_0x28b966,_0x2c37c9){return client['request'](_0xd6ca61,_0x117951)['then'](function(_0x33bef0){logger['info'](_0xda2d('0xe'),_0x1d29c4,'request\x20sent');logger['debug']('Plugin,\x20%s,\x20%s,\x20%s',_0x1d29c4,_0xda2d('0xf'),JSON[_0xda2d('0x10')](_0x33bef0));if(_0x33bef0[_0xda2d('0x11')]){if(_0x33bef0['error'][_0xda2d('0x12')]===0x1f4){logger['error']('Plugin,\x20%s,\x20%s',_0x1d29c4,_0x33bef0[_0xda2d('0x11')]['message']);return _0x2c37c9(_0x33bef0[_0xda2d('0x11')][_0xda2d('0x13')]);}logger[_0xda2d('0x11')](_0xda2d('0xe'),_0x1d29c4,_0x33bef0[_0xda2d('0x11')]['message']);return _0x28b966(_0x33bef0[_0xda2d('0x11')][_0xda2d('0x13')]);}else{logger['info'](_0xda2d('0xe'),_0x1d29c4,_0xda2d('0xf'));_0x28b966(_0x33bef0[_0xda2d('0x14')][_0xda2d('0x13')]);}})[_0xda2d('0x15')](function(_0x457cdc){logger['error'](_0xda2d('0xe'),_0x1d29c4,_0x457cdc);_0x2c37c9(_0x457cdc);});});}exports[_0xda2d('0x16')]=function(_0x42c271){var _0x4ac57d=this;return new Promise(function(_0x4b6a11,_0x14b932){return db[_0xda2d('0x17')][_0xda2d('0x18')](_0x42c271[_0xda2d('0x19')],{'raw':_0x42c271[_0xda2d('0x1a')]?_0x42c271[_0xda2d('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0xda2d('0x1b')](function(_0x58f7db){logger['info']('CreatePlugin',_0x42c271);logger[_0xda2d('0x1c')]('CreatePlugin',_0x42c271,JSON[_0xda2d('0x10')](_0x58f7db));_0x4b6a11(_0x58f7db);})['catch'](function(_0x4933b4){logger[_0xda2d('0x11')](_0xda2d('0x16'),_0x4933b4['message'],_0x42c271);_0x14b932(_0x4ac57d[_0xda2d('0x11')](0x1f4,_0x4933b4[_0xda2d('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 261c832..aa5acef 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 _0xa812=['emit','removeListener','register','plugin:','./plugin.events','save','update'];(function(_0x2a0183,_0x3fc93c){var _0x158c3a=function(_0x57a903){while(--_0x57a903){_0x2a0183['push'](_0x2a0183['shift']());}};_0x158c3a(++_0x3fc93c);}(_0xa812,0x100));var _0x2a81=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0xa812[_0x82129b];return _0x2ae5dc;};'use strict';var PluginEvents=require(_0x2a81('0x0'));var events=[_0x2a81('0x1'),'remove',_0x2a81('0x2')];function createListener(_0x458f7c,_0x5df04b){return function(_0x318e3a){_0x5df04b[_0x2a81('0x3')](_0x458f7c,_0x318e3a);};}function removeListener(_0x9740e5,_0x5bfcb5){return function(){PluginEvents[_0x2a81('0x4')](_0x9740e5,_0x5bfcb5);};}exports[_0x2a81('0x5')]=function(_0x394c4c){for(var _0x44e3d7=0x0,_0xa36c7a=events['length'];_0x44e3d7<_0xa36c7a;_0x44e3d7++){var _0xd5e781=events[_0x44e3d7];var _0x1e7ccb=createListener(_0x2a81('0x6')+_0xd5e781,_0x394c4c);PluginEvents['on'](_0xd5e781,_0x1e7ccb);}}; \ No newline at end of file +var _0xbda2=['length','save','remove','update','emit'];(function(_0x581af1,_0x4f02c5){var _0x54c22e=function(_0x5a7a5a){while(--_0x5a7a5a){_0x581af1['push'](_0x581af1['shift']());}};_0x54c22e(++_0x4f02c5);}(_0xbda2,0x169));var _0x2bda=function(_0x33e9b6,_0x176e0d){_0x33e9b6=_0x33e9b6-0x0;var _0xc561ed=_0xbda2[_0x33e9b6];return _0xc561ed;};'use strict';var PluginEvents=require('./plugin.events');var events=[_0x2bda('0x0'),_0x2bda('0x1'),_0x2bda('0x2')];function createListener(_0x390262,_0x14b004){return function(_0x4283ec){_0x14b004[_0x2bda('0x3')](_0x390262,_0x4283ec);};}function removeListener(_0x2fca97,_0x5889b4){return function(){PluginEvents['removeListener'](_0x2fca97,_0x5889b4);};}exports['register']=function(_0x4864ba){for(var _0x6ab9ab=0x0,_0x3a6a59=events[_0x2bda('0x4')];_0x6ab9ab<_0x3a6a59;_0x6ab9ab++){var _0x3db8dc=events[_0x6ab9ab];var _0x1cb5c8=createListener('plugin:'+_0x3db8dc,_0x4864ba);PluginEvents['on'](_0x3db8dc,_0x1cb5c8);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index bd3fd83..87dc42b 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(_0x36ea93,_0x5abc0d){var _0x5b5b08=function(_0x3cc394){while(--_0x3cc394){_0x36ea93['push'](_0x36ea93['shift']());}};_0x5b5b08(++_0x5abc0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xa9e0[_0x3635ce];return _0x97ecd0;};'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(_0x5d790e,_0x1fce17){var _0x49fbac=function(_0x27deb3){while(--_0x27deb3){_0x5d790e['push'](_0x5d790e['shift']());}};_0x49fbac(++_0x1fce17);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xa9e0[_0x1b828b];return _0x98da1a;};'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 448a597..3fbe953 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 _0x55e0=['hasOwnProperty','Unknown\x20status','destroy','delete','lodash','../../config/pm2','../../config/logger','api','exec','bluebird','sendStatus','json','error','name','status','send','info','index','then','reject','express','motion2','catch','show','params','body','script','join','../../files/plugins','cwd','dirname','chdir','dump','Missing\x20name\x20and/or\x20path','update','restart'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x55e0,0xdc));var _0x055e=function(_0x18afb5,_0x9f0654){_0x18afb5=_0x18afb5-0x0;var _0x2c5a6b=_0x55e0[_0x18afb5];return _0x2c5a6b;};'use strict';var _=require(_0x055e('0x0'));var pm2=require(_0x055e('0x1'));var logger=require(_0x055e('0x2'))(_0x055e('0x3'));var path=require('path');var exec=require('child_process')[_0x055e('0x4')];var BPromise=require(_0x055e('0x5'));function handleEntityNotFound(_0x33cd7b,_0x2773e4){return function(_0x157473){if(!_0x157473){_0x33cd7b[_0x055e('0x6')](0x194);;}return _0x157473;};}function respondWithResult(_0x490ee1,_0x5239f6){_0x5239f6=_0x5239f6||0xc8;return function(_0x4384ff){if(_0x4384ff){return _0x490ee1['status'](_0x5239f6)[_0x055e('0x7')](_0x4384ff);}return null;};}function handleError(_0x3c4cf,_0x376618){_0x376618=_0x376618||0x1f4;return function(_0x230c32){logger[_0x055e('0x8')](_0x230c32['stack']);if(_0x230c32[_0x055e('0x9')]){delete _0x230c32[_0x055e('0x9')];}_0x3c4cf[_0x055e('0xa')](_0x376618)[_0x055e('0xb')](_0x230c32);};}function execChildProcess(){return new BPromise(function(_0x238068,_0x5237d9){exec('npm\x20install',function(_0x187cce,_0x51c524,_0x3c44b2){logger[_0x055e('0xc')](_0x51c524);logger[_0x055e('0xc')](_0x3c44b2);if(_0x187cce){logger[_0x055e('0x8')](_0x187cce);return _0x5237d9(_0x187cce);}return _0x238068(_0x51c524);});});}exports[_0x055e('0xd')]=function(_0x31c649,_0x236a2b){return pm2['list']()[_0x055e('0xe')](function(_0xb80d83){if(_0xb80d83){var _0x3cfd14=_[_0x055e('0xf')](_0xb80d83,function(_0x222817){return _0x222817['name']===_0x055e('0x10')||_0x222817[_0x055e('0x9')]===_0x055e('0x11');});return{'rows':_0x3cfd14,'count':_0x3cfd14['length']};}return null;})[_0x055e('0xe')](respondWithResult(_0x236a2b,null))[_0x055e('0x12')](handleError(_0x236a2b,null));};exports[_0x055e('0x13')]=function(_0x2bad86,_0x2cc84e){return pm2['describe'](_0x2bad86[_0x055e('0x14')]['id'])[_0x055e('0xe')](respondWithResult(_0x2cc84e,null))[_0x055e('0xe')](handleEntityNotFound(_0x2cc84e,null))[_0x055e('0x12')](handleError(_0x2cc84e,null));};exports['create']=function(_0x4004ce,_0x3cdd68){if(_0x4004ce['body'][_0x055e('0x9')]&&_0x4004ce[_0x055e('0x15')][_0x055e('0x16')]){var _0x124d86=path[_0x055e('0x17')](__dirname,_0x055e('0x18'),_0x4004ce['body'][_0x055e('0x16')]);var _0x2f0346=process[_0x055e('0x19')]();process['chdir'](path[_0x055e('0x1a')](_0x124d86));return execChildProcess()[_0x055e('0xe')](function(_0x32c64e){process[_0x055e('0x1b')](_0x2f0346);return pm2['start']({'name':_0x4004ce[_0x055e('0x15')]['name'],'script':_0x124d86});})[_0x055e('0xe')](function(_0x42a6aa){pm2[_0x055e('0x1c')]();return _0x42a6aa[0x0];})[_0x055e('0xe')](respondWithResult(_0x3cdd68,0xc9))[_0x055e('0x12')](handleError(_0x3cdd68,null));}else{return _0x3cdd68[_0x055e('0xa')](0x1f4)['send']({'message':_0x055e('0x1d')});}};exports[_0x055e('0x1e')]=function(_0x2a82f8,_0x4b5891){if(_0x2a82f8[_0x055e('0x15')]['id']){delete _0x2a82f8[_0x055e('0x15')]['id'];}var _0x42f2df={'online':_0x055e('0x1f'),'stopped':'stop'};if(_0x42f2df[_0x055e('0x20')](_0x2a82f8['body'][_0x055e('0xa')])){return pm2[_0x42f2df[_0x2a82f8[_0x055e('0x15')][_0x055e('0xa')]]](_0x2a82f8[_0x055e('0x14')]['id'])[_0x055e('0xe')](respondWithResult(_0x4b5891,0xc8))['catch'](handleError(_0x4b5891,null));}else{return _0x4b5891[_0x055e('0xa')](0x1f4)[_0x055e('0xb')]({'message':_0x055e('0x21')});}};exports[_0x055e('0x22')]=function(_0x36abb2,_0x225c88){if(_0x36abb2[_0x055e('0x15')]['id']){delete _0x36abb2[_0x055e('0x15')]['id'];}if(_0x36abb2['params']['id']){return pm2[_0x055e('0x23')](_0x36abb2[_0x055e('0x14')]['id'])['then'](function(_0xd9298d){pm2[_0x055e('0x1c')]();return _0xd9298d[0x0];})[_0x055e('0xe')](respondWithResult(_0x225c88,null))[_0x055e('0x12')](handleError(_0x225c88,null));}else{return _0x225c88[_0x055e('0xa')](0x1f4)[_0x055e('0xb')]({'message':'Unknown\x20id'});}}; \ No newline at end of file +var _0x44a3=['hasOwnProperty','params','Unknown\x20status','dump','Unknown\x20id','lodash','../../config/pm2','../../config/logger','api','path','child_process','exec','bluebird','sendStatus','error','stack','name','status','send','info','index','list','then','reject','express','length','catch','show','describe','create','body','script','join','../../files/plugins','cwd','chdir','dirname','start','Missing\x20name\x20and/or\x20path','update','restart','stop'];(function(_0x5a2bdc,_0x2e7c7e){var _0x3ea58e=function(_0x46bc2a){while(--_0x46bc2a){_0x5a2bdc['push'](_0x5a2bdc['shift']());}};_0x3ea58e(++_0x2e7c7e);}(_0x44a3,0x1a9));var _0x344a=function(_0x51a85c,_0x2660a3){_0x51a85c=_0x51a85c-0x0;var _0x55001f=_0x44a3[_0x51a85c];return _0x55001f;};'use strict';var _=require(_0x344a('0x0'));var pm2=require(_0x344a('0x1'));var logger=require(_0x344a('0x2'))(_0x344a('0x3'));var path=require(_0x344a('0x4'));var exec=require(_0x344a('0x5'))[_0x344a('0x6')];var BPromise=require(_0x344a('0x7'));function handleEntityNotFound(_0x528a13,_0x23004c){return function(_0x1bc716){if(!_0x1bc716){_0x528a13[_0x344a('0x8')](0x194);;}return _0x1bc716;};}function respondWithResult(_0x28b51e,_0x39984a){_0x39984a=_0x39984a||0xc8;return function(_0x504bd1){if(_0x504bd1){return _0x28b51e['status'](_0x39984a)['json'](_0x504bd1);}return null;};}function handleError(_0x484661,_0x475dab){_0x475dab=_0x475dab||0x1f4;return function(_0x2f9486){logger[_0x344a('0x9')](_0x2f9486[_0x344a('0xa')]);if(_0x2f9486[_0x344a('0xb')]){delete _0x2f9486['name'];}_0x484661[_0x344a('0xc')](_0x475dab)[_0x344a('0xd')](_0x2f9486);};}function execChildProcess(){return new BPromise(function(_0x559406,_0x2734ec){exec('npm\x20install',function(_0x397476,_0x5e6c98,_0xd53a4f){logger[_0x344a('0xe')](_0x5e6c98);logger['info'](_0xd53a4f);if(_0x397476){logger['error'](_0x397476);return _0x2734ec(_0x397476);}return _0x559406(_0x5e6c98);});});}exports[_0x344a('0xf')]=function(_0x2ad7eb,_0x3a974e){return pm2[_0x344a('0x10')]()[_0x344a('0x11')](function(_0x133ad4){if(_0x133ad4){var _0x4ee562=_[_0x344a('0x12')](_0x133ad4,function(_0x2360e9){return _0x2360e9[_0x344a('0xb')]===_0x344a('0x13')||_0x2360e9['name']==='motion2';});return{'rows':_0x4ee562,'count':_0x4ee562[_0x344a('0x14')]};}return null;})[_0x344a('0x11')](respondWithResult(_0x3a974e,null))[_0x344a('0x15')](handleError(_0x3a974e,null));};exports[_0x344a('0x16')]=function(_0x48b3ab,_0x397de6){return pm2[_0x344a('0x17')](_0x48b3ab['params']['id'])[_0x344a('0x11')](respondWithResult(_0x397de6,null))[_0x344a('0x11')](handleEntityNotFound(_0x397de6,null))[_0x344a('0x15')](handleError(_0x397de6,null));};exports[_0x344a('0x18')]=function(_0x13b382,_0x43fa0f){if(_0x13b382[_0x344a('0x19')][_0x344a('0xb')]&&_0x13b382[_0x344a('0x19')][_0x344a('0x1a')]){var _0x4b3552=path[_0x344a('0x1b')](__dirname,_0x344a('0x1c'),_0x13b382[_0x344a('0x19')][_0x344a('0x1a')]);var _0x240be3=process[_0x344a('0x1d')]();process[_0x344a('0x1e')](path[_0x344a('0x1f')](_0x4b3552));return execChildProcess()[_0x344a('0x11')](function(_0x27f527){process[_0x344a('0x1e')](_0x240be3);return pm2[_0x344a('0x20')]({'name':_0x13b382[_0x344a('0x19')][_0x344a('0xb')],'script':_0x4b3552});})['then'](function(_0x6ccfba){pm2['dump']();return _0x6ccfba[0x0];})[_0x344a('0x11')](respondWithResult(_0x43fa0f,0xc9))['catch'](handleError(_0x43fa0f,null));}else{return _0x43fa0f[_0x344a('0xc')](0x1f4)[_0x344a('0xd')]({'message':_0x344a('0x21')});}};exports[_0x344a('0x22')]=function(_0x26f059,_0x28749b){if(_0x26f059[_0x344a('0x19')]['id']){delete _0x26f059[_0x344a('0x19')]['id'];}var _0x4f2499={'online':_0x344a('0x23'),'stopped':_0x344a('0x24')};if(_0x4f2499[_0x344a('0x25')](_0x26f059[_0x344a('0x19')][_0x344a('0xc')])){return pm2[_0x4f2499[_0x26f059[_0x344a('0x19')]['status']]](_0x26f059[_0x344a('0x26')]['id'])['then'](respondWithResult(_0x28749b,0xc8))['catch'](handleError(_0x28749b,null));}else{return _0x28749b[_0x344a('0xc')](0x1f4)[_0x344a('0xd')]({'message':_0x344a('0x27')});}};exports['destroy']=function(_0x5cd9c6,_0x5cafd2){if(_0x5cd9c6[_0x344a('0x19')]['id']){delete _0x5cd9c6[_0x344a('0x19')]['id'];}if(_0x5cd9c6[_0x344a('0x26')]['id']){return pm2['delete'](_0x5cd9c6[_0x344a('0x26')]['id'])[_0x344a('0x11')](function(_0x71f3ec){pm2[_0x344a('0x28')]();return _0x71f3ec[0x0];})[_0x344a('0x11')](respondWithResult(_0x5cafd2,null))[_0x344a('0x15')](handleError(_0x5cafd2,null));}else{return _0x5cafd2[_0x344a('0xc')](0x1f4)['send']({'message':_0x344a('0x29')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index c158d8c..77f5d8e 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 _0x2041=['/queues','isAuthenticated','exports','express','Router','./realtime.controller','get'];(function(_0x38c632,_0x14e8e6){var _0x12737e=function(_0x3e0fe4){while(--_0x3e0fe4){_0x38c632['push'](_0x38c632['shift']());}};_0x12737e(++_0x14e8e6);}(_0x2041,0x10d));var _0x1204=function(_0x429c61,_0x36ba19){_0x429c61=_0x429c61-0x0;var _0x94e689=_0x2041[_0x429c61];return _0x94e689;};'use strict';var express=require(_0x1204('0x0'));var router=express[_0x1204('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x1204('0x2'));router[_0x1204('0x3')](_0x1204('0x4'),auth[_0x1204('0x5')](),controller['getQueues']);module[_0x1204('0x6')]=router; \ No newline at end of file +var _0x3e9c=['isAuthenticated','getQueues','exports','express','Router','../../components/auth/service','./realtime.controller','get','/queues'];(function(_0x135aaa,_0x3f2319){var _0x5d2b59=function(_0x53e657){while(--_0x53e657){_0x135aaa['push'](_0x135aaa['shift']());}};_0x5d2b59(++_0x3f2319);}(_0x3e9c,0x6f));var _0xc3e9=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x3e9c[_0x21a9d9];return _0x46adce;};'use strict';var express=require(_0xc3e9('0x0'));var router=express[_0xc3e9('0x1')]();var auth=require(_0xc3e9('0x2'));var controller=require(_0xc3e9('0x3'));router[_0xc3e9('0x4')](_0xc3e9('0x5'),auth[_0xc3e9('0x6')](),controller[_0xc3e9('0x7')]);module[_0xc3e9('0x8')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index 8b62150..bef00ea 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 _0x8f9d=['fax','resolve','query','channel','Invalid\x20channel','toLowerCase','startCase','map','rawAttributes','fieldName','type','getOptions','user','role','userProfileId','voice','outbound','QueueCampaigns','Queues','findAndCountAll','then','request','format','loggedIn','available','waiting','talking','paused','message','dialActive','dialMethod','Trunk','startPredictive','erlangCallToSecond','erlangAbandonmentRate','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','rows','get','loggedInDb','pTalking','originated','find','merge','pick','getMembers','length','online','agents','User','Queue','Pause','findAll','QueueId','UserId','agent','all','catch','util','jayson/promise','../../config/logger','api','../../mysqldb','client','http','offset','undefined','count','limit','status','set','Content-Range','error','stack','name','send','getQueues','mail','chat','sms','openchannel'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x8f9d,0x93));var _0xd8f9=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x8f9d[_0x42cae2];return _0x5f256f;};'use strict';var util=require(_0xd8f9('0x0'));var _=require('lodash');var jayson=require(_0xd8f9('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0xd8f9('0x2'))(_0xd8f9('0x3'));var db=require(_0xd8f9('0x4'))['db'];var client=jayson[_0xd8f9('0x5')][_0xd8f9('0x6')]({'port':0x232a});var routingClient=jayson[_0xd8f9('0x5')][_0xd8f9('0x6')]({'port':0x232c});function respondWithFilteredResult(_0x5941ce,_0x1c37be){return function(_0x24dd1e){if(_0x24dd1e){var _0x25d417=typeof _0x1c37be[_0xd8f9('0x7')]===_0xd8f9('0x8')&&typeof _0x1c37be['limit']===_0xd8f9('0x8');var _0x6691e=_0x24dd1e['count'];var _0x33c31e=_0x25d417?0x0:_0x1c37be['offset'];var _0x5caee9=_0x25d417?_0x24dd1e[_0xd8f9('0x9')]:_0x1c37be[_0xd8f9('0x7')]+_0x1c37be[_0xd8f9('0xa')];var _0x379359;if(_0x5caee9>=_0x6691e){_0x5caee9=_0x6691e;_0x379359=0xc8;}else{_0x379359=0xce;}_0x5941ce[_0xd8f9('0xb')](_0x379359);return _0x5941ce[_0xd8f9('0xc')](_0xd8f9('0xd'),_0x33c31e+'-'+_0x5caee9+'/'+_0x6691e)['json'](_0x24dd1e);}return null;};}function handleError(_0x3a214b,_0x56e0d6){_0x56e0d6=_0x56e0d6||0x1f4;return function(_0x39aca0){logger[_0xd8f9('0xe')](_0x39aca0[_0xd8f9('0xf')]);if(_0x39aca0['name']){delete _0x39aca0[_0xd8f9('0x10')];}_0x3a214b[_0xd8f9('0xb')](_0x56e0d6)[_0xd8f9('0x11')](_0x39aca0);};}exports[_0xd8f9('0x12')]=function(_0x4c11f2,_0x3529e9){var _0x1525d6=[_0xd8f9('0x13'),_0xd8f9('0x14'),_0xd8f9('0x15'),_0xd8f9('0x16'),_0xd8f9('0x17'),'whatsapp','voice'];var _0x284a1a={'count':0x0,'rows':[]},_0xc6a825={},_0x4d5b8d;Promise[_0xd8f9('0x18')]()['then'](function(){if(_0x4c11f2[_0xd8f9('0x19')]['channel']){if(!_['includes'](_0x1525d6,_0x4c11f2['query'][_0xd8f9('0x1a')]['toLowerCase']()))throw new Error(_0xd8f9('0x1b'));_0x4d5b8d=_0x4c11f2[_0xd8f9('0x19')][_0xd8f9('0x1a')][_0xd8f9('0x1c')]();}var _0x3b141a=_[_0xd8f9('0x1d')](_0x4d5b8d)+'Queue';var _0x1de3cc=_[_0xd8f9('0x1e')](db[_0x3b141a][_0xd8f9('0x1f')],function(_0x36d740){return{'name':_0x36d740[_0xd8f9('0x20')],'type':_0x36d740[_0xd8f9('0x21')]['key']};});_0xc6a825=qs[_0xd8f9('0x22')](_0x1de3cc,_0x4c11f2);if(_0x4c11f2[_0xd8f9('0x23')][_0xd8f9('0x24')]===_0xd8f9('0x23')){var _0x290553={'params':{'id':_0x4c11f2['user'][_0xd8f9('0x25')]},'query':{'section':_0x4d5b8d===_0xd8f9('0x26')&&_0x4c11f2[_0xd8f9('0x19')][_0xd8f9('0x21')]===_0xd8f9('0x27')?_0xd8f9('0x28'):_[_0xd8f9('0x1d')](_0x4d5b8d)+_0xd8f9('0x29'),'type':_0x4c11f2['query'][_0xd8f9('0x21')],'nolimit':!![],'sort':_0xd8f9('0x10'),'filter':_0x4c11f2[_0xd8f9('0x19')]['filter']}};return db['UserProfile']['getResources'](_0x290553);}return db[_0x3b141a][_0xd8f9('0x2a')](_0xc6a825);})[_0xd8f9('0x2b')](function(_0x5050a4){_0x284a1a[_0xd8f9('0x9')]=_0x5050a4[_0xd8f9('0x9')];var _0x5da878=_0x4d5b8d===_0xd8f9('0x26')?client:routingClient;return _0x5da878[_0xd8f9('0x2c')](_[_0xd8f9('0x1d')](_0x4d5b8d)+'Queues',_0x4c11f2)[_0xd8f9('0x2b')](function(_0x48f7c0){if(_0x48f7c0[_0xd8f9('0xe')])throw new Error(util[_0xd8f9('0x2d')]('Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues',_0x4d5b8d));var _0x19d639=_0x48f7c0['result'];var _0x340f0a=[_0xd8f9('0x2e'),_0xd8f9('0x2f'),_0xd8f9('0x30'),_0xd8f9('0x31'),_0xd8f9('0x32')];if(_0x4d5b8d===_0xd8f9('0x26')&&_0x4c11f2['query'][_0xd8f9('0x21')]==='outbound'){_0x340f0a['push']('pTalking','originated',_0xd8f9('0x33'),_0xd8f9('0x34'),_0xd8f9('0x35'),_0xd8f9('0x36'),_0xd8f9('0x37'),'startProgressive','erlangCalls',_0xd8f9('0x38'),_0xd8f9('0x39'),'erlangBusyFactor',_0xd8f9('0x3a'),_0xd8f9('0x3b'),_0xd8f9('0x3c'),'predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout',_0xd8f9('0x3d'),_0xd8f9('0x3e'),_0xd8f9('0x3f'));}var _0x219c5f=_0x5050a4[_0xd8f9('0x40')]['map'](function(_0x3333ea){var _0x2bc390=_0x3333ea[_0xd8f9('0x41')]({'plain':!![]});_0x2bc390[_0xd8f9('0x32')]=0x0;_0x2bc390[_0xd8f9('0x42')]=0x0;_0x2bc390[_0xd8f9('0x2e')]=0x0;_0x2bc390[_0xd8f9('0x2f')]=0x0;_0x2bc390[_0xd8f9('0x32')]=0x0;_0x2bc390[_0xd8f9('0x30')]=0x0;if(_0x4d5b8d===_0xd8f9('0x26')){_0x2bc390[_0xd8f9('0x31')]=0x0;if(_0x4c11f2['query'][_0xd8f9('0x21')]===_0xd8f9('0x27')){_0x2bc390[_0xd8f9('0x43')]=0x0;_0x2bc390[_0xd8f9('0x44')]=0x0;}}_0x2bc390['agents']=[];var _0x157dfd=_[_0xd8f9('0x45')](_0x19d639[_0xd8f9('0x40')],['id',_0x2bc390['id']]);if(_0x157dfd)_[_0xd8f9('0x46')](_0x2bc390,_[_0xd8f9('0x47')](_0x157dfd,_0x340f0a));if(_0x4d5b8d===_0xd8f9('0x26')){return _0x3333ea['getAgents']({'attributes':['id','name','online'],'joinTableAttributes':[],'raw':!![]})[_0xd8f9('0x2b')](function(_0x293179){return _0x3333ea[_0xd8f9('0x48')]({'raw':!![]})[_0xd8f9('0x2b')](function(_0x9af000){for(var _0x324f18=0x0;_0x324f18<_0x293179[_0xd8f9('0x49')];_0x324f18++){var _0x2ff764=_[_0xd8f9('0x45')](_0x9af000,['UserId',_0x293179[_0x324f18]['id']]);var _0x4aabbe={'id':_0x293179[_0x324f18]['id'],'name':_0x293179[_0x324f18][_0xd8f9('0x10')],'online':Boolean(_0x293179[_0x324f18][_0xd8f9('0x4a')]),'paused':_0x2ff764?Boolean(_0x2ff764[_0xd8f9('0x32')]):![]};if(_0x4aabbe['online'])_0x2bc390['loggedInDb']++;if(_0x4aabbe[_0xd8f9('0x32')])_0x2bc390[_0xd8f9('0x32')]++;_0x2bc390[_0xd8f9('0x4b')]['push'](_0x4aabbe);}return _0x2bc390;});});}else{var _0xd6b6bf=_0xd8f9('0x4c')+_[_0xd8f9('0x1d')](_0x4d5b8d)+_0xd8f9('0x4d');var _0x207ad2=_0x4d5b8d+_0xd8f9('0x4e');return db[_0xd6b6bf][_0xd8f9('0x4f')]({'where':{[_[_0xd8f9('0x1d')](_0x4d5b8d)+_0xd8f9('0x50')]:_0x3333ea['id']},'raw':!![]})['then'](function(_0x53594f){return db['User'][_0xd8f9('0x4f')]({'attributes':['id',_0xd8f9('0x10'),_0xd8f9('0x4a'),_0x207ad2],'where':{'id':_[_0xd8f9('0x1e')](_0x53594f,_0xd8f9('0x51')),'role':_0xd8f9('0x52')},'raw':!![]});})[_0xd8f9('0x2b')](function(_0x26b892){for(var _0x26527c=0x0;_0x26527c<_0x26b892[_0xd8f9('0x49')];_0x26527c++){var _0x35f7a6={'id':_0x26b892[_0x26527c]['id'],'name':_0x26b892[_0x26527c][_0xd8f9('0x10')],'online':Boolean(_0x26b892[_0x26527c][_0xd8f9('0x4a')]),'paused':Boolean(_0x26b892[_0x26527c][_0x207ad2])};if(_0x35f7a6['online'])_0x2bc390[_0xd8f9('0x42')]++;if(_0x35f7a6[_0xd8f9('0x32')])_0x2bc390[_0xd8f9('0x32')]++;_0x2bc390[_0xd8f9('0x4b')]['push'](_0x35f7a6);}return _0x2bc390;});}});return Promise[_0xd8f9('0x53')](_0x219c5f);});})['then'](function(_0x59952e){_0x284a1a[_0xd8f9('0x40')]=_0x59952e;return _0x284a1a;})[_0xd8f9('0x2b')](respondWithFilteredResult(_0x3529e9,_0xc6a825))[_0xd8f9('0x54')](handleError(_0x3529e9,null));}; \ No newline at end of file +var _0x741c=['error','stack','name','send','getQueues','mail','chat','sms','whatsapp','then','query','channel','toLowerCase','Invalid\x20channel','startCase','rawAttributes','fieldName','type','key','user','outbound','QueueCampaigns','Queues','filter','UserProfile','getResources','findAndCountAll','voice','request','format','waiting','talking','paused','pTalking','originated','message','dialActive','dialMethod','Trunk','startPredictive','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','rows','map','get','loggedInDb','available','agents','find','merge','getAgents','getMembers','length','UserId','online','push','User','Queue','findAll','agent','catch','util','lodash','jayson/promise','../../components/parsers/qs','../../config/logger','api','http','offset','undefined','count','limit','status','set','Content-Range'];(function(_0x1e48d3,_0x5d8c43){var _0x2852b1=function(_0x11d7b3){while(--_0x11d7b3){_0x1e48d3['push'](_0x1e48d3['shift']());}};_0x2852b1(++_0x5d8c43);}(_0x741c,0x196));var _0xc741=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x741c[_0x42cae2];return _0x5f256f;};'use strict';var util=require(_0xc741('0x0'));var _=require(_0xc741('0x1'));var jayson=require(_0xc741('0x2'));var qs=require(_0xc741('0x3'));var logger=require(_0xc741('0x4'))(_0xc741('0x5'));var db=require('../../mysqldb')['db'];var client=jayson['client'][_0xc741('0x6')]({'port':0x232a});var routingClient=jayson['client'][_0xc741('0x6')]({'port':0x232c});function respondWithFilteredResult(_0x1935b4,_0x3708ae){return function(_0x133bc4){if(_0x133bc4){var _0x3f3d82=typeof _0x3708ae[_0xc741('0x7')]===_0xc741('0x8')&&typeof _0x3708ae['limit']===_0xc741('0x8');var _0x1f53bf=_0x133bc4['count'];var _0xc6555=_0x3f3d82?0x0:_0x3708ae['offset'];var _0x4a4693=_0x3f3d82?_0x133bc4[_0xc741('0x9')]:_0x3708ae[_0xc741('0x7')]+_0x3708ae[_0xc741('0xa')];var _0x47501c;if(_0x4a4693>=_0x1f53bf){_0x4a4693=_0x1f53bf;_0x47501c=0xc8;}else{_0x47501c=0xce;}_0x1935b4[_0xc741('0xb')](_0x47501c);return _0x1935b4[_0xc741('0xc')](_0xc741('0xd'),_0xc6555+'-'+_0x4a4693+'/'+_0x1f53bf)['json'](_0x133bc4);}return null;};}function handleError(_0x4c8ef0,_0x51bc33){_0x51bc33=_0x51bc33||0x1f4;return function(_0x12a073){logger[_0xc741('0xe')](_0x12a073[_0xc741('0xf')]);if(_0x12a073[_0xc741('0x10')]){delete _0x12a073[_0xc741('0x10')];}_0x4c8ef0['status'](_0x51bc33)[_0xc741('0x11')](_0x12a073);};}exports[_0xc741('0x12')]=function(_0x4c190d,_0xc0383){var _0x3c7569=[_0xc741('0x13'),_0xc741('0x14'),_0xc741('0x15'),'openchannel','fax',_0xc741('0x16'),'voice'];var _0x1c4f3a={'count':0x0,'rows':[]},_0x3903c6={},_0x575184;Promise['resolve']()[_0xc741('0x17')](function(){if(_0x4c190d[_0xc741('0x18')][_0xc741('0x19')]){if(!_['includes'](_0x3c7569,_0x4c190d[_0xc741('0x18')][_0xc741('0x19')][_0xc741('0x1a')]()))throw new Error(_0xc741('0x1b'));_0x575184=_0x4c190d[_0xc741('0x18')][_0xc741('0x19')][_0xc741('0x1a')]();}var _0x30b7ea=_[_0xc741('0x1c')](_0x575184)+'Queue';var _0x26bf01=_['map'](db[_0x30b7ea][_0xc741('0x1d')],function(_0x4b5b31){return{'name':_0x4b5b31[_0xc741('0x1e')],'type':_0x4b5b31[_0xc741('0x1f')][_0xc741('0x20')]};});_0x3903c6=qs['getOptions'](_0x26bf01,_0x4c190d);if(_0x4c190d[_0xc741('0x21')]['role']===_0xc741('0x21')){var _0x28a041={'params':{'id':_0x4c190d[_0xc741('0x21')]['userProfileId']},'query':{'section':_0x575184==='voice'&&_0x4c190d['query'][_0xc741('0x1f')]===_0xc741('0x22')?_0xc741('0x23'):_[_0xc741('0x1c')](_0x575184)+_0xc741('0x24'),'type':_0x4c190d['query']['type'],'nolimit':!![],'sort':_0xc741('0x10'),'filter':_0x4c190d[_0xc741('0x18')][_0xc741('0x25')]}};return db[_0xc741('0x26')][_0xc741('0x27')](_0x28a041);}return db[_0x30b7ea][_0xc741('0x28')](_0x3903c6);})['then'](function(_0x353729){_0x1c4f3a[_0xc741('0x9')]=_0x353729['count'];var _0x3797c5=_0x575184===_0xc741('0x29')?client:routingClient;return _0x3797c5[_0xc741('0x2a')](_[_0xc741('0x1c')](_0x575184)+_0xc741('0x24'),_0x4c190d)[_0xc741('0x17')](function(_0x3b3703){if(_0x3b3703[_0xc741('0xe')])throw new Error(util[_0xc741('0x2b')]('Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues',_0x575184));var _0x3094de=_0x3b3703['result'];var _0xbf2274=['loggedIn','available',_0xc741('0x2c'),_0xc741('0x2d'),_0xc741('0x2e')];if(_0x575184==='voice'&&_0x4c190d[_0xc741('0x18')][_0xc741('0x1f')]===_0xc741('0x22')){_0xbf2274['push'](_0xc741('0x2f'),_0xc741('0x30'),_0xc741('0x31'),_0xc741('0x32'),_0xc741('0x33'),_0xc741('0x34'),_0xc741('0x35'),'startProgressive','erlangCalls',_0xc741('0x36'),_0xc741('0x37'),_0xc741('0x38'),_0xc741('0x39'),_0xc741('0x3a'),_0xc741('0x3b'),'predictiveIntervalAvailable',_0xc741('0x3c'),_0xc741('0x3d'),'predictiveIntervalDroppedCallsTimeout',_0xc741('0x3e'),_0xc741('0x3f'),_0xc741('0x40'));}var _0x560e85=_0x353729[_0xc741('0x41')][_0xc741('0x42')](function(_0x85e752){var _0x39e9fb=_0x85e752[_0xc741('0x43')]({'plain':!![]});_0x39e9fb[_0xc741('0x2e')]=0x0;_0x39e9fb[_0xc741('0x44')]=0x0;_0x39e9fb['loggedIn']=0x0;_0x39e9fb[_0xc741('0x45')]=0x0;_0x39e9fb[_0xc741('0x2e')]=0x0;_0x39e9fb[_0xc741('0x2c')]=0x0;if(_0x575184===_0xc741('0x29')){_0x39e9fb[_0xc741('0x2d')]=0x0;if(_0x4c190d[_0xc741('0x18')][_0xc741('0x1f')]===_0xc741('0x22')){_0x39e9fb['pTalking']=0x0;_0x39e9fb[_0xc741('0x30')]=0x0;}}_0x39e9fb[_0xc741('0x46')]=[];var _0x29bc62=_[_0xc741('0x47')](_0x3094de['rows'],['id',_0x39e9fb['id']]);if(_0x29bc62)_[_0xc741('0x48')](_0x39e9fb,_['pick'](_0x29bc62,_0xbf2274));if(_0x575184===_0xc741('0x29')){return _0x85e752[_0xc741('0x49')]({'attributes':['id',_0xc741('0x10'),'online'],'joinTableAttributes':[],'raw':!![]})['then'](function(_0x3686b2){return _0x85e752[_0xc741('0x4a')]({'raw':!![]})[_0xc741('0x17')](function(_0x3f12ea){for(var _0x1336f7=0x0;_0x1336f7<_0x3686b2[_0xc741('0x4b')];_0x1336f7++){var _0x3e7b76=_[_0xc741('0x47')](_0x3f12ea,[_0xc741('0x4c'),_0x3686b2[_0x1336f7]['id']]);var _0x2542aa={'id':_0x3686b2[_0x1336f7]['id'],'name':_0x3686b2[_0x1336f7][_0xc741('0x10')],'online':Boolean(_0x3686b2[_0x1336f7][_0xc741('0x4d')]),'paused':_0x3e7b76?Boolean(_0x3e7b76[_0xc741('0x2e')]):![]};if(_0x2542aa[_0xc741('0x4d')])_0x39e9fb[_0xc741('0x44')]++;if(_0x2542aa[_0xc741('0x2e')])_0x39e9fb[_0xc741('0x2e')]++;_0x39e9fb['agents'][_0xc741('0x4e')](_0x2542aa);}return _0x39e9fb;});});}else{var _0x497598=_0xc741('0x4f')+_['startCase'](_0x575184)+_0xc741('0x50');var _0x258281=_0x575184+'Pause';return db[_0x497598][_0xc741('0x51')]({'where':{[_[_0xc741('0x1c')](_0x575184)+'QueueId']:_0x85e752['id']},'raw':!![]})[_0xc741('0x17')](function(_0x14ce60){return db[_0xc741('0x4f')][_0xc741('0x51')]({'attributes':['id',_0xc741('0x10'),_0xc741('0x4d'),_0x258281],'where':{'id':_[_0xc741('0x42')](_0x14ce60,'UserId'),'role':_0xc741('0x52')},'raw':!![]});})['then'](function(_0x47ac55){for(var _0x61bfc7=0x0;_0x61bfc7<_0x47ac55['length'];_0x61bfc7++){var _0x113c1e={'id':_0x47ac55[_0x61bfc7]['id'],'name':_0x47ac55[_0x61bfc7][_0xc741('0x10')],'online':Boolean(_0x47ac55[_0x61bfc7][_0xc741('0x4d')]),'paused':Boolean(_0x47ac55[_0x61bfc7][_0x258281])};if(_0x113c1e[_0xc741('0x4d')])_0x39e9fb[_0xc741('0x44')]++;if(_0x113c1e[_0xc741('0x2e')])_0x39e9fb[_0xc741('0x2e')]++;_0x39e9fb[_0xc741('0x46')][_0xc741('0x4e')](_0x113c1e);}return _0x39e9fb;});}});return Promise['all'](_0x560e85);});})['then'](function(_0x12dde4){_0x1c4f3a[_0xc741('0x41')]=_0x12dde4;return _0x1c4f3a;})[_0xc741('0x17')](respondWithFilteredResult(_0xc0383,_0x3903c6))[_0xc741('0x53')](handleError(_0xc0383,null));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index eb0ffc9..6813cf3 100644 --- a/server/api/reportAgentPreview/index.js +++ b/server/api/reportAgentPreview/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x44a483,_0xa9b240){var _0x3c6fc7=function(_0x12bdfd){while(--_0x12bdfd){_0x44a483['push'](_0x44a483['shift']());}};_0x3c6fc7(++_0xa9b240);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x547456,_0x1de17e){_0x547456=_0x547456-0x0;var _0xc1fd7b=_0xcb91[_0x547456];return _0xc1fd7b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x440c24,_0x2388d1){var _0x2f52f0=function(_0x2c52bd){while(--_0x2c52bd){_0x440c24['push'](_0x440c24['shift']());}};_0x2f52f0(++_0x2388d1);}(_0xedd9,0xfc));var _0x9edd=function(_0xbbd83d,_0xfbe6f0){_0xbbd83d=_0xbbd83d-0x0;var _0x19cb4a=_0xedd9[_0xbbd83d];return _0x19cb4a;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 4854c9f..706649a 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 _0x41fe=['exports','INTEGER','STRING','DATE','sequelize'];(function(_0x5806c3,_0x5105d8){var _0x48ac77=function(_0x4826ec){while(--_0x4826ec){_0x5806c3['push'](_0x5806c3['shift']());}};_0x48ac77(++_0x5105d8);}(_0x41fe,0xd1));var _0xe41f=function(_0x2f9467,_0x40576f){_0x2f9467=_0x2f9467-0x0;var _0x39894c=_0x41fe[_0x2f9467];return _0x39894c;};'use strict';var Sequelize=require(_0xe41f('0x0'));module[_0xe41f('0x1')]={'state':{'type':Sequelize[_0xe41f('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xe41f('0x3')]},'scheduledat':{'type':Sequelize[_0xe41f('0x4')]},'uniqueid':{'type':Sequelize[_0xe41f('0x3')]},'starttime':{'type':Sequelize[_0xe41f('0x4')]},'responsetime':{'type':Sequelize[_0xe41f('0x4')]},'ringtime':{'type':Sequelize[_0xe41f('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xe41f('0x3')]},'campaigntype':{'type':Sequelize[_0xe41f('0x3')]},'membername':{'type':Sequelize[_0xe41f('0x3')]}}; \ No newline at end of file +var _0xf435=['exports','INTEGER','STRING','DATE'];(function(_0x16d7c4,_0x364a61){var _0x57f2f5=function(_0x2e49ab){while(--_0x2e49ab){_0x16d7c4['push'](_0x16d7c4['shift']());}};_0x57f2f5(++_0x364a61);}(_0xf435,0x174));var _0x5f43=function(_0x24d304,_0x5995f3){_0x24d304=_0x24d304-0x0;var _0x5652d3=_0xf435[_0x24d304];return _0x5652d3;};'use strict';var Sequelize=require('sequelize');module[_0x5f43('0x0')]={'state':{'type':Sequelize[_0x5f43('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x5f43('0x2')]},'scheduledat':{'type':Sequelize[_0x5f43('0x3')]},'uniqueid':{'type':Sequelize[_0x5f43('0x2')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x5f43('0x3')]},'ringtime':{'type':Sequelize[_0x5f43('0x1')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x5f43('0x2')]},'campaigntype':{'type':Sequelize[_0x5f43('0x2')]},'membername':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 9257108..289dc3d 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 _0xe70c=['moment','bluebird','request-promise','path','../../config/environment','./reportAgentPreview.attributes','exports','ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger','api'];(function(_0x58b592,_0x112da5){var _0x4f5bb4=function(_0xf6658){while(--_0xf6658){_0x58b592['push'](_0x58b592['shift']());}};_0x4f5bb4(++_0x112da5);}(_0xe70c,0x1a9));var _0xce70=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xe70c[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0xce70('0x0'));var util=require(_0xce70('0x1'));var logger=require(_0xce70('0x2'))(_0xce70('0x3'));var moment=require(_0xce70('0x4'));var BPromise=require(_0xce70('0x5'));var rp=require(_0xce70('0x6'));var fs=require('fs');var path=require(_0xce70('0x7'));var rimraf=require('rimraf');var config=require(_0xce70('0x8'));var attributes=require(_0xce70('0x9'));module[_0xce70('0xa')]=function(_0x4b8363,_0x50e03e){return _0x4b8363['define'](_0xce70('0xb'),attributes,{'tableName':_0xce70('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9863=['util','api','moment','bluebird','request-promise','path','../../config/environment','./reportAgentPreview.attributes','define','ReportAgentPreview'];(function(_0x364cf8,_0x146b9b){var _0x6a59ee=function(_0x3d81eb){while(--_0x3d81eb){_0x364cf8['push'](_0x364cf8['shift']());}};_0x6a59ee(++_0x146b9b);}(_0x9863,0x1d6));var _0x3986=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9863[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x3986('0x0'));var logger=require('../../config/logger')(_0x3986('0x1'));var moment=require(_0x3986('0x2'));var BPromise=require(_0x3986('0x3'));var rp=require(_0x3986('0x4'));var fs=require('fs');var path=require(_0x3986('0x5'));var rimraf=require('rimraf');var config=require(_0x3986('0x6'));var attributes=require(_0x3986('0x7'));module['exports']=function(_0x52fad9,_0x271bae){return _0x52fad9[_0x3986('0x8')](_0x3986('0x9'),attributes,{'tableName':'report_agent_preview','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 600f2d8..eb88281 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 _0x4ec5=['error','code','message','info','result','CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw','debug','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3b59d5,_0x1e23f2){var _0x30cc91=function(_0x54815d){while(--_0x54815d){_0x3b59d5['push'](_0x3b59d5['shift']());}};_0x30cc91(++_0x1e23f2);}(_0x4ec5,0x9e));var _0x54ec=function(_0x38524d,_0x1f6fd6){_0x38524d=_0x38524d-0x0;var _0x46907f=_0x4ec5[_0x38524d];return _0x46907f;};'use strict';var _=require(_0x54ec('0x0'));var util=require('util');var moment=require(_0x54ec('0x1'));var BPromise=require(_0x54ec('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x54ec('0x3'));var db=require(_0x54ec('0x4'))['db'];var utils=require(_0x54ec('0x5'));var logger=require(_0x54ec('0x6'))('rpc');var config=require(_0x54ec('0x7'));var jayson=require(_0x54ec('0x8'));var client=jayson[_0x54ec('0x9')][_0x54ec('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x51e8d2,_0xc5ad8b,_0x400f6d){return new BPromise(function(_0x1ae390,_0x15b3c9){return client['request'](_0x51e8d2,_0x400f6d)[_0x54ec('0xb')](function(_0x2e1423){logger['info'](_0x54ec('0xc'),_0xc5ad8b,_0x54ec('0xd'));logger['debug'](_0x54ec('0xe'),_0xc5ad8b,_0x54ec('0xd'),JSON[_0x54ec('0xf')](_0x2e1423));if(_0x2e1423[_0x54ec('0x10')]){if(_0x2e1423[_0x54ec('0x10')][_0x54ec('0x11')]===0x1f4){logger[_0x54ec('0x10')](_0x54ec('0xc'),_0xc5ad8b,_0x2e1423[_0x54ec('0x10')][_0x54ec('0x12')]);return _0x15b3c9(_0x2e1423[_0x54ec('0x10')]['message']);}logger[_0x54ec('0x10')](_0x54ec('0xc'),_0xc5ad8b,_0x2e1423[_0x54ec('0x10')][_0x54ec('0x12')]);return _0x1ae390(_0x2e1423[_0x54ec('0x10')][_0x54ec('0x12')]);}else{logger[_0x54ec('0x13')](_0x54ec('0xc'),_0xc5ad8b,_0x54ec('0xd'));_0x1ae390(_0x2e1423[_0x54ec('0x14')][_0x54ec('0x12')]);}})['catch'](function(_0x24ee4c){logger[_0x54ec('0x10')](_0x54ec('0xc'),_0xc5ad8b,_0x24ee4c);_0x15b3c9(_0x24ee4c);});});}exports[_0x54ec('0x15')]=function(_0x401bc7){var _0x2903a2=this;return new Promise(function(_0x24779d,_0x1c558c){return db[_0x54ec('0x16')][_0x54ec('0x17')](_0x401bc7[_0x54ec('0x18')],{'raw':_0x401bc7[_0x54ec('0x19')]?_0x401bc7[_0x54ec('0x19')][_0x54ec('0x1a')]===undefined?!![]:![]:!![]})[_0x54ec('0xb')](function(_0x38b5e1){logger[_0x54ec('0x13')](_0x54ec('0x15'),_0x401bc7);logger[_0x54ec('0x1b')](_0x54ec('0x15'),_0x401bc7,JSON[_0x54ec('0xf')](_0x38b5e1));_0x24779d(_0x38b5e1);})[_0x54ec('0x1c')](function(_0x184173){logger['error'](_0x54ec('0x15'),_0x184173[_0x54ec('0x12')],_0x401bc7);_0x1c558c(_0x2903a2[_0x54ec('0x10')](0x1f4,_0x184173[_0x54ec('0x12')]));});});}; \ No newline at end of file +var _0xd312=['jayson/promise','client','http','request','info','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','ReportAgentPreview,\x20%s,\x20%s','message','result','catch','CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw','then','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0xd312,0x136));var _0x2d31=function(_0x5094f6,_0x260159){_0x5094f6=_0x5094f6-0x0;var _0x2facdf=_0xd312[_0x5094f6];return _0x2facdf;};'use strict';var _=require(_0x2d31('0x0'));var util=require('util');var moment=require(_0x2d31('0x1'));var BPromise=require(_0x2d31('0x2'));var rs=require(_0x2d31('0x3'));var fs=require('fs');var Redis=require(_0x2d31('0x4'));var db=require(_0x2d31('0x5'))['db'];var utils=require(_0x2d31('0x6'));var logger=require(_0x2d31('0x7'))(_0x2d31('0x8'));var config=require(_0x2d31('0x9'));var jayson=require(_0x2d31('0xa'));var client=jayson[_0x2d31('0xb')][_0x2d31('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x128a5d,_0x898c13,_0x1637cd){return new BPromise(function(_0x1c96d9,_0x5df2de){return client[_0x2d31('0xd')](_0x128a5d,_0x1637cd)['then'](function(_0x5b7f62){logger[_0x2d31('0xe')]('ReportAgentPreview,\x20%s,\x20%s',_0x898c13,_0x2d31('0xf'));logger[_0x2d31('0x10')](_0x2d31('0x11'),_0x898c13,'request\x20sent',JSON[_0x2d31('0x12')](_0x5b7f62));if(_0x5b7f62[_0x2d31('0x13')]){if(_0x5b7f62[_0x2d31('0x13')][_0x2d31('0x14')]===0x1f4){logger[_0x2d31('0x13')](_0x2d31('0x15'),_0x898c13,_0x5b7f62[_0x2d31('0x13')]['message']);return _0x5df2de(_0x5b7f62[_0x2d31('0x13')]['message']);}logger[_0x2d31('0x13')](_0x2d31('0x15'),_0x898c13,_0x5b7f62[_0x2d31('0x13')]['message']);return _0x1c96d9(_0x5b7f62['error'][_0x2d31('0x16')]);}else{logger['info'](_0x2d31('0x15'),_0x898c13,_0x2d31('0xf'));_0x1c96d9(_0x5b7f62[_0x2d31('0x17')][_0x2d31('0x16')]);}})[_0x2d31('0x18')](function(_0x191054){logger[_0x2d31('0x13')](_0x2d31('0x15'),_0x898c13,_0x191054);_0x5df2de(_0x191054);});});}exports[_0x2d31('0x19')]=function(_0x2b04ef){var _0xe4b272=this;return new Promise(function(_0x4f5624,_0xed0d57){return db[_0x2d31('0x1a')][_0x2d31('0x1b')](_0x2b04ef[_0x2d31('0x1c')],{'raw':_0x2b04ef[_0x2d31('0x1d')]?_0x2b04ef[_0x2d31('0x1d')][_0x2d31('0x1e')]===undefined?!![]:![]:!![]})[_0x2d31('0x1f')](function(_0x121980){logger[_0x2d31('0xe')](_0x2d31('0x19'),_0x2b04ef);logger[_0x2d31('0x10')](_0x2d31('0x19'),_0x2b04ef,JSON[_0x2d31('0x12')](_0x121980));_0x4f5624(_0x121980);})[_0x2d31('0x18')](function(_0x294569){logger[_0x2d31('0x13')](_0x2d31('0x19'),_0x294569[_0x2d31('0x16')],_0x2b04ef);_0xed0d57(_0xe4b272['error'](0x1f4,_0x294569[_0x2d31('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 883157c..932b729 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 _0xb4f5=['voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','/outbound','/outbound/channels','/agents','agents','agentCapacity','/telephones','telephones','trunks','/campaigns','campaigns','faxAccounts','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','/mail/queues/:id/notify','queueNotify','showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','fax','/fax/queues/:id','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','post','/sms/queues/:id/notify','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','agentNotify','exports','multer','util','path','express','Router','../../components/auth/service','./rpc.controller','get','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','/fax/queues','faxQueues','/voice/queues/preview/:id','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup'];(function(_0x1cc2c6,_0x38b744){var _0x8e249d=function(_0x52ce6b){while(--_0x52ce6b){_0x1cc2c6['push'](_0x1cc2c6['shift']());}};_0x8e249d(++_0x38b744);}(_0xb4f5,0x80));var _0x5b4f=function(_0x43b833,_0x345a9e){_0x43b833=_0x43b833-0x0;var _0x5085d0=_0xb4f5[_0x43b833];return _0x5085d0;};'use strict';var multer=require(_0x5b4f('0x0'));var util=require(_0x5b4f('0x1'));var path=require(_0x5b4f('0x2'));var express=require(_0x5b4f('0x3'));var router=express[_0x5b4f('0x4')]();var auth=require(_0x5b4f('0x5'));var controller=require(_0x5b4f('0x6'));router[_0x5b4f('0x7')]('/voice/channels',auth[_0x5b4f('0x8')](),controller[_0x5b4f('0x9')]);router[_0x5b4f('0x7')](_0x5b4f('0xa'),auth['isAuthenticated'](),controller['voiceChannelMixMonitor']);router[_0x5b4f('0x7')](_0x5b4f('0xb'),auth['isAuthenticated'](),controller[_0x5b4f('0xc')]);router[_0x5b4f('0x7')]('/voice/queues',auth['isAuthenticated'](),controller[_0x5b4f('0xd')]);router['get'](_0x5b4f('0xe'),auth[_0x5b4f('0x8')](),controller[_0x5b4f('0xf')]);router['get'](_0x5b4f('0x10'),auth[_0x5b4f('0x8')](),controller[_0x5b4f('0x11')]);router[_0x5b4f('0x7')](_0x5b4f('0x12'),auth[_0x5b4f('0x8')](),controller[_0x5b4f('0x13')]);router[_0x5b4f('0x7')]('/openchannel/queues',auth[_0x5b4f('0x8')](),controller[_0x5b4f('0x14')]);router[_0x5b4f('0x7')](_0x5b4f('0x15'),auth[_0x5b4f('0x8')](),controller[_0x5b4f('0x16')]);router[_0x5b4f('0x7')](_0x5b4f('0x17'),auth[_0x5b4f('0x8')](),controller['whatsappQueues']);router[_0x5b4f('0x7')](_0x5b4f('0x18'),auth['isAuthenticated'](),controller[_0x5b4f('0x19')]);router[_0x5b4f('0x7')](_0x5b4f('0x1a'),auth[_0x5b4f('0x8')](),controller['voiceQueuesPreview']);router[_0x5b4f('0x7')](_0x5b4f('0x1b'),auth['isAuthenticated'](),controller[_0x5b4f('0x1c')]);router[_0x5b4f('0x7')](_0x5b4f('0x1d'),auth[_0x5b4f('0x8')](),controller[_0x5b4f('0x1e')]);router[_0x5b4f('0x7')](_0x5b4f('0x1f'),auth[_0x5b4f('0x8')](),controller[_0x5b4f('0x20')]);router['get'](_0x5b4f('0x21'),auth['isAuthenticated'](),controller['voiceQueuesChannelRedirect']);router[_0x5b4f('0x7')](_0x5b4f('0x22'),auth[_0x5b4f('0x8')](),controller[_0x5b4f('0x23')]);router[_0x5b4f('0x24')](_0x5b4f('0x22'),auth[_0x5b4f('0x8')](),controller[_0x5b4f('0x25')]);router[_0x5b4f('0x7')](_0x5b4f('0x26'),auth[_0x5b4f('0x8')](),controller['outbound']);router[_0x5b4f('0x7')](_0x5b4f('0x27'),auth[_0x5b4f('0x8')](),controller['outboundChannels']);router[_0x5b4f('0x7')](_0x5b4f('0x28'),auth[_0x5b4f('0x8')](),controller[_0x5b4f('0x29')]);router[_0x5b4f('0x24')]('/agents/:id/capacity',auth[_0x5b4f('0x8')](),controller[_0x5b4f('0x2a')]);router[_0x5b4f('0x7')](_0x5b4f('0x2b'),auth[_0x5b4f('0x8')](),controller[_0x5b4f('0x2c')]);router[_0x5b4f('0x7')]('/trunks',auth[_0x5b4f('0x8')](),controller[_0x5b4f('0x2d')]);router[_0x5b4f('0x7')](_0x5b4f('0x2e'),auth[_0x5b4f('0x8')](),controller[_0x5b4f('0x2f')]);router['get']('/fax/accounts',auth['isAuthenticated'](),controller[_0x5b4f('0x30')]);router[_0x5b4f('0x7')]('/chat/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0x5b4f('0x31')]);router['get'](_0x5b4f('0x32'),auth[_0x5b4f('0x8')](),controller[_0x5b4f('0x33')]);router['get'](_0x5b4f('0x34'),auth[_0x5b4f('0x8')](),controller[_0x5b4f('0x35')]);router[_0x5b4f('0x7')]('/openchannel/queues/:id/waitinginteractions',auth[_0x5b4f('0x8')](),controller['openchannelQueuesIdWaitingInteractions']);router[_0x5b4f('0x7')](_0x5b4f('0x36'),auth['isAuthenticated'](),controller[_0x5b4f('0x37')]);router['get'](_0x5b4f('0x38'),auth['isAuthenticated'](),controller[_0x5b4f('0x39')]);router[_0x5b4f('0x7')](_0x5b4f('0x3a'),auth[_0x5b4f('0x8')](),controller[_0x5b4f('0x3b')]);router['post'](_0x5b4f('0x3c'),auth[_0x5b4f('0x8')](),controller[_0x5b4f('0x3d')]('mail'));router[_0x5b4f('0x7')]('/mail/queues/:id',auth[_0x5b4f('0x8')](),controller[_0x5b4f('0x3e')]);router['post'](_0x5b4f('0x3f'),auth['isAuthenticated'](),controller[_0x5b4f('0x3d')](_0x5b4f('0x40')));router['get'](_0x5b4f('0x41'),auth[_0x5b4f('0x8')](),controller[_0x5b4f('0x42')]);router['post']('/fax/queues/:id/notify',auth[_0x5b4f('0x8')](),controller[_0x5b4f('0x3d')](_0x5b4f('0x43')));router[_0x5b4f('0x7')](_0x5b4f('0x44'),auth[_0x5b4f('0x8')](),controller['showFaxQueues']);router['post'](_0x5b4f('0x45'),auth[_0x5b4f('0x8')](),controller[_0x5b4f('0x3d')](_0x5b4f('0x46')));router['get'](_0x5b4f('0x47'),auth[_0x5b4f('0x8')](),controller['showOpenchannelQueues']);router[_0x5b4f('0x48')](_0x5b4f('0x49'),auth[_0x5b4f('0x8')](),controller[_0x5b4f('0x3d')]('sms'));router[_0x5b4f('0x48')]('/whatsapp/queues/:id/notify',auth[_0x5b4f('0x8')](),controller[_0x5b4f('0x3d')]('whatsapp'));router[_0x5b4f('0x7')](_0x5b4f('0x4a'),auth[_0x5b4f('0x8')](),controller[_0x5b4f('0x4b')]);router[_0x5b4f('0x7')](_0x5b4f('0x4c'),auth[_0x5b4f('0x8')](),controller[_0x5b4f('0x4d')]);router[_0x5b4f('0x48')]('/agents/:id/notify',auth[_0x5b4f('0x8')](),controller[_0x5b4f('0x4e')]);module[_0x5b4f('0x4f')]=router; \ No newline at end of file +var _0xbed6=['whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','/agents/:id/notify','agentNotify','multer','util','express','../../components/auth/service','get','/voice/channels','isAuthenticated','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','chatQueues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','/sms/queues','whatsappQueues','/fax/queues','/voice/queues/preview/:id','voiceQueuesPreview','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','/outbound','outbound','outboundChannels','/agents/:id/capacity','agentCapacity','/telephones','telephones','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify'];(function(_0x5149c7,_0xfd2f67){var _0x5010b0=function(_0x408cb0){while(--_0x408cb0){_0x5149c7['push'](_0x5149c7['shift']());}};_0x5010b0(++_0xfd2f67);}(_0xbed6,0x146));var _0x6bed=function(_0x5416db,_0x55683a){_0x5416db=_0x5416db-0x0;var _0x243e35=_0xbed6[_0x5416db];return _0x243e35;};'use strict';var multer=require(_0x6bed('0x0'));var util=require(_0x6bed('0x1'));var path=require('path');var express=require(_0x6bed('0x2'));var router=express['Router']();var auth=require(_0x6bed('0x3'));var controller=require('./rpc.controller');router[_0x6bed('0x4')](_0x6bed('0x5'),auth[_0x6bed('0x6')](),controller['voiceChannels']);router['get'](_0x6bed('0x7'),auth['isAuthenticated'](),controller[_0x6bed('0x8')]);router[_0x6bed('0x4')](_0x6bed('0x9'),auth['isAuthenticated'](),controller[_0x6bed('0xa')]);router[_0x6bed('0x4')](_0x6bed('0xb'),auth[_0x6bed('0x6')](),controller[_0x6bed('0xc')]);router['get']('/chat/queues',auth[_0x6bed('0x6')](),controller[_0x6bed('0xd')]);router[_0x6bed('0x4')]('/mail/queues',auth[_0x6bed('0x6')](),controller[_0x6bed('0xe')]);router[_0x6bed('0x4')](_0x6bed('0xf'),auth[_0x6bed('0x6')](),controller[_0x6bed('0x10')]);router[_0x6bed('0x4')](_0x6bed('0x11'),auth['isAuthenticated'](),controller['openchannelQueues']);router['get'](_0x6bed('0x12'),auth[_0x6bed('0x6')](),controller['smsQueues']);router[_0x6bed('0x4')]('/whatsapp/queues',auth[_0x6bed('0x6')](),controller[_0x6bed('0x13')]);router[_0x6bed('0x4')](_0x6bed('0x14'),auth[_0x6bed('0x6')](),controller['faxQueues']);router['get'](_0x6bed('0x15'),auth[_0x6bed('0x6')](),controller[_0x6bed('0x16')]);router['get']('/voice/queues/channels',auth[_0x6bed('0x6')](),controller[_0x6bed('0x17')]);router['get'](_0x6bed('0x18'),auth[_0x6bed('0x6')](),controller[_0x6bed('0x19')]);router[_0x6bed('0x4')](_0x6bed('0x1a'),auth['isAuthenticated'](),controller[_0x6bed('0x1b')]);router[_0x6bed('0x4')](_0x6bed('0x1c'),auth[_0x6bed('0x6')](),controller[_0x6bed('0x1d')]);router[_0x6bed('0x4')](_0x6bed('0x1e'),auth[_0x6bed('0x6')](),controller[_0x6bed('0x1f')]);router[_0x6bed('0x20')](_0x6bed('0x1e'),auth['isAuthenticated'](),controller[_0x6bed('0x21')]);router[_0x6bed('0x4')](_0x6bed('0x22'),auth[_0x6bed('0x6')](),controller[_0x6bed('0x23')]);router['get']('/outbound/channels',auth['isAuthenticated'](),controller[_0x6bed('0x24')]);router['get']('/agents',auth['isAuthenticated'](),controller['agents']);router['put'](_0x6bed('0x25'),auth[_0x6bed('0x6')](),controller[_0x6bed('0x26')]);router['get'](_0x6bed('0x27'),auth[_0x6bed('0x6')](),controller[_0x6bed('0x28')]);router[_0x6bed('0x4')]('/trunks',auth[_0x6bed('0x6')](),controller[_0x6bed('0x29')]);router[_0x6bed('0x4')](_0x6bed('0x2a'),auth['isAuthenticated'](),controller[_0x6bed('0x2b')]);router[_0x6bed('0x4')](_0x6bed('0x2c'),auth[_0x6bed('0x6')](),controller[_0x6bed('0x2d')]);router[_0x6bed('0x4')](_0x6bed('0x2e'),auth[_0x6bed('0x6')](),controller[_0x6bed('0x2f')]);router[_0x6bed('0x4')](_0x6bed('0x30'),auth[_0x6bed('0x6')](),controller[_0x6bed('0x31')]);router['get']('/openchannel/queues/waitinginteractions',auth[_0x6bed('0x6')](),controller[_0x6bed('0x32')]);router[_0x6bed('0x4')]('/openchannel/queues/:id/waitinginteractions',auth[_0x6bed('0x6')](),controller[_0x6bed('0x33')]);router['get'](_0x6bed('0x34'),auth['isAuthenticated'](),controller[_0x6bed('0x35')]);router[_0x6bed('0x4')](_0x6bed('0x36'),auth['isAuthenticated'](),controller[_0x6bed('0x37')]);router[_0x6bed('0x4')]('/fax/queues/waitinginteractions',auth[_0x6bed('0x6')](),controller[_0x6bed('0x38')]);router[_0x6bed('0x39')](_0x6bed('0x3a'),auth['isAuthenticated'](),controller[_0x6bed('0x3b')]('mail'));router['get'](_0x6bed('0x3c'),auth['isAuthenticated'](),controller[_0x6bed('0x3d')]);router[_0x6bed('0x39')](_0x6bed('0x3e'),auth[_0x6bed('0x6')](),controller[_0x6bed('0x3b')](_0x6bed('0x3f')));router['get'](_0x6bed('0x40'),auth[_0x6bed('0x6')](),controller[_0x6bed('0x41')]);router[_0x6bed('0x39')](_0x6bed('0x42'),auth[_0x6bed('0x6')](),controller[_0x6bed('0x3b')](_0x6bed('0x43')));router['get'](_0x6bed('0x44'),auth[_0x6bed('0x6')](),controller[_0x6bed('0x45')]);router['post']('/openchannel/queues/:id/notify',auth['isAuthenticated'](),controller[_0x6bed('0x3b')]('openchannel'));router[_0x6bed('0x4')](_0x6bed('0x46'),auth[_0x6bed('0x6')](),controller['showOpenchannelQueues']);router[_0x6bed('0x39')](_0x6bed('0x47'),auth[_0x6bed('0x6')](),controller[_0x6bed('0x3b')](_0x6bed('0x48')));router[_0x6bed('0x39')](_0x6bed('0x49'),auth[_0x6bed('0x6')](),controller[_0x6bed('0x3b')](_0x6bed('0x4a')));router[_0x6bed('0x4')](_0x6bed('0x4b'),auth[_0x6bed('0x6')](),controller[_0x6bed('0x4c')]);router[_0x6bed('0x4')](_0x6bed('0x4d'),auth[_0x6bed('0x6')](),controller['showWhatsappQueues']);router[_0x6bed('0x39')](_0x6bed('0x4e'),auth[_0x6bed('0x6')](),controller[_0x6bed('0x4f')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 44c6021..e1416bc 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 _0x9c5a=['Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','FaxAccounts','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','map','queue_id','uniq','filter','indexOf','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Queue','findOne','Message','messageId','Interaction','Account','\x20Message\x20not\x20found','update','MessageId','InteractionId','QueueId','TransferReport','create','queue','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','User','Agent\x20not\x20found','From','Start','bluebird','moment','util','../../mysqldb','../../config/logger','api','client','http','request','then','error','message','result','catch','status','sendStatus','stack','name','send','isNil','rows','find','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','params','voiceChannelStopMixMonitor','voiceQueues','VoiceQueues','updateVoiceQueue','UpdateVoiceQueue','merge','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','body','user','interaction','hasOwnProperty','MemberReport','findAll','INTERACTION','length','updateAttributes','findOrCreate','SIP/%s','format','agent','internal','AgentCapacity','telephones','Telephones','trunks','Trunks'];(function(_0xe1b5f6,_0x210c09){var _0x44636e=function(_0x3a3212){while(--_0x3a3212){_0xe1b5f6['push'](_0xe1b5f6['shift']());}};_0x44636e(++_0x210c09);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x5b44c4,_0x1c75b7){_0x5b44c4=_0x5b44c4-0x0;var _0x4c1fa0=_0x9c5a[_0x5b44c4];return _0x4c1fa0;};'use strict';var BPromise=require(_0xa9c5('0x0'));var moment=require(_0xa9c5('0x1'));var _=require('lodash');var util=require(_0xa9c5('0x2'));var db=require(_0xa9c5('0x3'))['db'];var logger=require(_0xa9c5('0x4'))(_0xa9c5('0x5'));var jayson=require('jayson/promise');var amiClient=jayson[_0xa9c5('0x6')][_0xa9c5('0x7')]({'port':0x232a});var mailClient=jayson['client'][_0xa9c5('0x7')]({'port':0x232b});var routingClient=jayson['client'][_0xa9c5('0x7')]({'port':0x232c});function respondWithRpcPromise(_0x3df556,_0x4cb597,_0x4b6db6){return new BPromise(function(_0x3d6b50,_0x16f331){var _0x52afb2=_0x4b6db6?_0x4b6db6:amiClient;return _0x52afb2[_0xa9c5('0x8')](_0x3df556,_0x4cb597)[_0xa9c5('0x9')](function(_0x51c14c){if(_0x51c14c[_0xa9c5('0xa')]){if(_0x51c14c[_0xa9c5('0xa')]['code']===0x1f4){return _0x16f331(_0x51c14c['error'][_0xa9c5('0xb')]);}return _0x3d6b50(_0x51c14c[_0xa9c5('0xa')][_0xa9c5('0xb')]);}else{_0x3d6b50(_0x51c14c[_0xa9c5('0xc')]);}})[_0xa9c5('0xd')](function(_0x4492a4){_0x16f331(_0x4492a4);});});}function respondWithResult(_0x51c8d,_0x42d5cf){_0x42d5cf=_0x42d5cf||0xc8;return function(_0x3c5ac7){if(_0x3c5ac7){return _0x51c8d[_0xa9c5('0xe')](_0x42d5cf)['json'](_0x3c5ac7);}return _0x51c8d[_0xa9c5('0xf')](0x194);};}function handleError(_0x1276d2,_0x7df76d){_0x7df76d=_0x7df76d||0x1f4;return function(_0x3806c4){logger[_0xa9c5('0xa')](_0x3806c4[_0xa9c5('0x10')]);if(_0x3806c4[_0xa9c5('0x11')]){delete _0x3806c4[_0xa9c5('0x11')];}_0x1276d2[_0xa9c5('0xe')](_0x7df76d)[_0xa9c5('0x12')](_0x3806c4);};}function findById(_0x4bb57e){return function(_0x2b0d73){if(!_[_0xa9c5('0x13')](_0x4bb57e)&&!_[_0xa9c5('0x13')](_0x2b0d73)&&!_['isNil'](_0x2b0d73[_0xa9c5('0x14')])){return _[_0xa9c5('0x15')](_0x2b0d73[_0xa9c5('0x14')],function(_0x3b8cf7){return _0x3b8cf7['id']==_0x4bb57e;});}return null;};}exports[_0xa9c5('0x16')]=function(_0x349f27,_0x3b8d4d){return respondWithRpcPromise(_0xa9c5('0x17'),_0x349f27[_0xa9c5('0x18')])[_0xa9c5('0x9')](respondWithResult(_0x3b8d4d,null))[_0xa9c5('0xd')](handleError(_0x3b8d4d,null));};exports[_0xa9c5('0x19')]=function(_0x54f8b9,_0x1115ad){return respondWithRpcPromise(_0xa9c5('0x1a'),_['merge'](_0x54f8b9['query'],_0x54f8b9[_0xa9c5('0x1b')]))[_0xa9c5('0x9')](respondWithResult(_0x1115ad,null))[_0xa9c5('0xd')](handleError(_0x1115ad,null));};exports[_0xa9c5('0x1c')]=function(_0xc0bca3,_0xd4b8a1){return respondWithRpcPromise('VoiceChannelStopMixMonitor',_['merge'](_0xc0bca3[_0xa9c5('0x18')],_0xc0bca3[_0xa9c5('0x1b')]))['then'](respondWithResult(_0xd4b8a1,null))[_0xa9c5('0xd')](handleError(_0xd4b8a1,null));};exports[_0xa9c5('0x1d')]=function(_0x306c9b,_0x32fc7d){return respondWithRpcPromise(_0xa9c5('0x1e'),_0x306c9b[_0xa9c5('0x18')])[_0xa9c5('0x9')](respondWithResult(_0x32fc7d,null))['catch'](handleError(_0x32fc7d,null));};exports['showVoiceQueues']=function(_0x242771,_0x4cd5e6){return respondWithRpcPromise(_0xa9c5('0x1e'),_0x242771[_0xa9c5('0x18')])['then'](findById(_0x242771[_0xa9c5('0x1b')]['id']))[_0xa9c5('0x9')](respondWithResult(_0x4cd5e6,null))['catch'](handleError(_0x4cd5e6,null));};exports[_0xa9c5('0x1f')]=function(_0x32baf9,_0x198cdf){return respondWithRpcPromise(_0xa9c5('0x20'),_[_0xa9c5('0x21')](_0x32baf9['body'],_0x32baf9[_0xa9c5('0x1b')]))['then'](respondWithResult(_0x198cdf,null))[_0xa9c5('0xd')](handleError(_0x198cdf,null));};exports[_0xa9c5('0x22')]=function(_0x2eeed1,_0x541475){return respondWithRpcPromise(_0xa9c5('0x23'),_[_0xa9c5('0x21')](_0x2eeed1['query'],_0x2eeed1[_0xa9c5('0x1b')]))[_0xa9c5('0x9')](respondWithResult(_0x541475,null))[_0xa9c5('0xd')](handleError(_0x541475,null));};exports[_0xa9c5('0x24')]=function(_0x22ee21,_0x3392d0){return respondWithRpcPromise(_0xa9c5('0x25'),_0x22ee21['query'])[_0xa9c5('0x9')](respondWithResult(_0x3392d0,null))[_0xa9c5('0xd')](handleError(_0x3392d0,null));};exports[_0xa9c5('0x26')]=function(_0x1c01f9,_0x1c617c){return respondWithRpcPromise(_0xa9c5('0x27'),_[_0xa9c5('0x21')](_0x1c01f9[_0xa9c5('0x18')],_0x1c01f9['params']))['then'](respondWithResult(_0x1c617c,null))[_0xa9c5('0xd')](handleError(_0x1c617c,null));};exports[_0xa9c5('0x28')]=function(_0xf2bebc,_0x1313b2){return respondWithRpcPromise(_0xa9c5('0x29'),_[_0xa9c5('0x21')](_0xf2bebc['query'],_0xf2bebc['params']))['then'](respondWithResult(_0x1313b2,null))[_0xa9c5('0xd')](handleError(_0x1313b2,null));};exports[_0xa9c5('0x2a')]=function(_0x5087e4,_0x13a1f5){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0xa9c5('0x21')](_0x5087e4[_0xa9c5('0x18')],_0x5087e4[_0xa9c5('0x1b')]))[_0xa9c5('0x9')](respondWithResult(_0x13a1f5,null))['catch'](handleError(_0x13a1f5,null));};exports[_0xa9c5('0x2b')]=function(_0x2cd721,_0x191153){return respondWithRpcPromise(_0xa9c5('0x2c'),_0x2cd721[_0xa9c5('0x18')])[_0xa9c5('0x9')](respondWithResult(_0x191153,null))[_0xa9c5('0xd')](handleError(_0x191153,null));};exports[_0xa9c5('0x2d')]=function(_0x573fc0,_0x11b2b2){return respondWithRpcPromise(_0xa9c5('0x2e'),_0x573fc0[_0xa9c5('0x18')])[_0xa9c5('0x9')](respondWithResult(_0x11b2b2,null))[_0xa9c5('0xd')](handleError(_0x11b2b2,null));};exports[_0xa9c5('0x2f')]=function(_0x493b20,_0x307736){var _0x5b7a0a;return respondWithRpcPromise(_0xa9c5('0x30'),_0x493b20['query'])[_0xa9c5('0x9')](function(_0xd4305d){_0x5b7a0a=_0xd4305d;return respondWithRpcPromise(_0xa9c5('0x30'),_0x493b20['query'],routingClient);})[_0xa9c5('0x9')](function(_0x1ddd72){return _[_0xa9c5('0x21')]({},_0x1ddd72,_0x5b7a0a);})[_0xa9c5('0x9')](respondWithResult(_0x307736,null))['catch'](handleError(_0x307736,null));};exports[_0xa9c5('0x31')]=function(_0x97803f,_0x3db918){if(_0x97803f[_0xa9c5('0x32')]&&_0x97803f[_0xa9c5('0x32')]['interaction']&&_0x97803f[_0xa9c5('0x33')]&&_0x97803f['user'][_0xa9c5('0x11')]){for(var _0x397614 in _0x97803f[_0xa9c5('0x32')][_0xa9c5('0x34')]){if(_0x97803f[_0xa9c5('0x32')][_0xa9c5('0x34')][_0xa9c5('0x35')](_0x397614)){db[_0xa9c5('0x36')][_0xa9c5('0x37')]({'where':{'channel':_0x397614,'membername':_0x97803f[_0xa9c5('0x33')]['name'],'type':_0xa9c5('0x38'),'exitAt':null,'uniqueid':_0x97803f[_0xa9c5('0x32')][_0xa9c5('0x34')][_0x397614]&&_0x97803f[_0xa9c5('0x32')][_0xa9c5('0x34')][_0x397614][_0xa9c5('0x39')]?{'$notIn':_0x97803f['body'][_0xa9c5('0x34')][_0x397614]}:{'$ne':null}}})[_0xa9c5('0x9')](function(_0x557c21){var _0x52cfbf=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');for(var _0x4e97bf=0x0,_0x160020=_0x557c21[_0xa9c5('0x39')];_0x4e97bf<_0x160020;_0x4e97bf+=0x1){_0x557c21[_0x4e97bf][_0xa9c5('0x3a')]({'exitAt':_0x52cfbf});}});for(var _0x1e8f5f=0x0;_0x1e8f5f<_0x97803f[_0xa9c5('0x32')][_0xa9c5('0x34')][_0x397614][_0xa9c5('0x39')];_0x1e8f5f+=0x1){db[_0xa9c5('0x36')][_0xa9c5('0x3b')]({'where':{'channel':_0x397614,'membername':_0x97803f[_0xa9c5('0x33')][_0xa9c5('0x11')],'type':_0xa9c5('0x38'),'uniqueid':_0x97803f[_0xa9c5('0x32')]['interaction'][_0x397614][_0x1e8f5f],'exitAt':null},'defaults':{'channel':_0x397614,'membername':_0x97803f[_0xa9c5('0x33')]['name'],'interface':_[_0xa9c5('0x13')](_0x97803f[_0xa9c5('0x33')]['interface'])?util['format'](_0xa9c5('0x3c'),_0x97803f[_0xa9c5('0x33')][_0xa9c5('0x11')]):_0x97803f['user']['interface'],'type':_0xa9c5('0x38'),'enterAt':moment()[_0xa9c5('0x3d')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0xa9c5('0x3e'),'internal':_0x97803f[_0xa9c5('0x33')][_0xa9c5('0x3f')],'uniqueid':_0x97803f[_0xa9c5('0x32')][_0xa9c5('0x34')][_0x397614][_0x1e8f5f]}});}}}}return respondWithRpcPromise(_0xa9c5('0x40'),{'id':_0x97803f['params']['id'],'capacity':_0x97803f['body']['capacity']},routingClient)[_0xa9c5('0x9')](respondWithResult(_0x3db918,null))[_0xa9c5('0xd')](handleError(_0x3db918,null));};exports[_0xa9c5('0x41')]=function(_0xef4d2,_0x380266){return respondWithRpcPromise(_0xa9c5('0x42'),_0xef4d2['query'])[_0xa9c5('0x9')](respondWithResult(_0x380266,null))[_0xa9c5('0xd')](handleError(_0x380266,null));};exports[_0xa9c5('0x43')]=function(_0x2bdc77,_0xa0b458){return respondWithRpcPromise(_0xa9c5('0x44'),_0x2bdc77['query'])['then'](respondWithResult(_0xa0b458,null))[_0xa9c5('0xd')](handleError(_0xa0b458,null));};exports['campaigns']=function(_0x1b158f,_0x5ea9b0){return respondWithRpcPromise(_0xa9c5('0x45'),_0x1b158f[_0xa9c5('0x18')])[_0xa9c5('0x9')](respondWithResult(_0x5ea9b0,null))['catch'](handleError(_0x5ea9b0,null));};exports[_0xa9c5('0x46')]=function(_0xe5390f,_0x1a75f3){return respondWithRpcPromise(_0xa9c5('0x47'),_0xe5390f['query'],routingClient)['then'](respondWithResult(_0x1a75f3,null))[_0xa9c5('0xd')](handleError(_0x1a75f3,null));};exports[_0xa9c5('0x48')]=function(_0x3205f2,_0x5b4323){return respondWithRpcPromise(_0xa9c5('0x47'),_0x3205f2[_0xa9c5('0x18')],routingClient)[_0xa9c5('0x9')](findById(_0x3205f2[_0xa9c5('0x1b')]['id']))[_0xa9c5('0x9')](respondWithResult(_0x5b4323,null))[_0xa9c5('0xd')](handleError(_0x5b4323,null));};exports[_0xa9c5('0x49')]=function(_0x298b3d,_0x5a7f0a){return respondWithRpcPromise(_0xa9c5('0x4a'),_0x298b3d['query'],routingClient)[_0xa9c5('0x9')](respondWithResult(_0x5a7f0a,null))[_0xa9c5('0xd')](handleError(_0x5a7f0a,null));};exports[_0xa9c5('0x4b')]=function(_0x4dfe3a,_0x4d475a){return respondWithRpcPromise(_0xa9c5('0x4a'),_0x4dfe3a['query'],routingClient)[_0xa9c5('0x9')](findById(_0x4dfe3a[_0xa9c5('0x1b')]['id']))[_0xa9c5('0x9')](respondWithResult(_0x4d475a,null))[_0xa9c5('0xd')](handleError(_0x4d475a,null));};exports['mailAccounts']=function(_0x3505d3,_0x222091){return respondWithRpcPromise(_0xa9c5('0x4c'),_0x3505d3[_0xa9c5('0x18')],mailClient)['then'](respondWithResult(_0x222091,null))['catch'](handleError(_0x222091,null));};exports[_0xa9c5('0x4d')]=function(_0x3deb64,_0x67c1f8){return respondWithRpcPromise(_0xa9c5('0x4e'),_0x3deb64[_0xa9c5('0x18')],routingClient)[_0xa9c5('0x9')](respondWithResult(_0x67c1f8,null))['catch'](handleError(_0x67c1f8,null));};exports[_0xa9c5('0x4f')]=function(_0x1e787e,_0x2497e1){return respondWithRpcPromise(_0xa9c5('0x4e'),_0x1e787e[_0xa9c5('0x18')],routingClient)[_0xa9c5('0x9')](findById(_0x1e787e[_0xa9c5('0x1b')]['id']))[_0xa9c5('0x9')](respondWithResult(_0x2497e1,null))[_0xa9c5('0xd')](handleError(_0x2497e1,null));};exports[_0xa9c5('0x50')]=function(_0x50d438,_0x5e17a2){return respondWithRpcPromise(_0xa9c5('0x51'),_0x50d438[_0xa9c5('0x18')],routingClient)[_0xa9c5('0x9')](respondWithResult(_0x5e17a2,null))[_0xa9c5('0xd')](handleError(_0x5e17a2,null));};exports['showSmsQueues']=function(_0x1c2478,_0x4aa699){return respondWithRpcPromise(_0xa9c5('0x51'),_0x1c2478[_0xa9c5('0x18')],routingClient)[_0xa9c5('0x9')](findById(_0x1c2478[_0xa9c5('0x1b')]['id']))[_0xa9c5('0x9')](respondWithResult(_0x4aa699,null))[_0xa9c5('0xd')](handleError(_0x4aa699,null));};exports[_0xa9c5('0x52')]=function(_0x3890b4,_0x2f323e){return respondWithRpcPromise(_0xa9c5('0x53'),_0x3890b4[_0xa9c5('0x18')],routingClient)[_0xa9c5('0x9')](respondWithResult(_0x2f323e,null))['catch'](handleError(_0x2f323e,null));};exports[_0xa9c5('0x54')]=function(_0x1a4aa7,_0x15eb25){return respondWithRpcPromise(_0xa9c5('0x53'),_0x1a4aa7[_0xa9c5('0x18')],routingClient)[_0xa9c5('0x9')](findById(_0x1a4aa7[_0xa9c5('0x1b')]['id']))['then'](respondWithResult(_0x15eb25,null))['catch'](handleError(_0x15eb25,null));};exports[_0xa9c5('0x55')]=function(_0x502a00,_0x2ae087){return respondWithRpcPromise(_0xa9c5('0x56'),_0x502a00['query'],routingClient)[_0xa9c5('0x9')](respondWithResult(_0x2ae087,null))[_0xa9c5('0xd')](handleError(_0x2ae087,null));};exports['showFaxQueues']=function(_0x4f8d9e,_0x14c4f2){return respondWithRpcPromise(_0xa9c5('0x56'),_0x4f8d9e[_0xa9c5('0x18')],routingClient)['then'](findById(_0x4f8d9e['params']['id']))[_0xa9c5('0x9')](respondWithResult(_0x14c4f2,null))[_0xa9c5('0xd')](handleError(_0x14c4f2,null));};exports['faxAccounts']=function(_0xd0371c,_0x393b00){return respondWithRpcPromise(_0xa9c5('0x57'),_0xd0371c[_0xa9c5('0x18')])[_0xa9c5('0x9')](respondWithResult(_0x393b00,null))[_0xa9c5('0xd')](handleError(_0x393b00,null));};exports['chatQueuesWaitingInteractions']=function(_0x44d969,_0x3aeb3c){return respondWithRpcPromise(_0xa9c5('0x58'),_0x44d969[_0xa9c5('0x18')],routingClient)['then'](respondWithResult(_0x3aeb3c,null))[_0xa9c5('0xd')](handleError(_0x3aeb3c,null));};exports[_0xa9c5('0x59')]=function(_0x59e917,_0x112d64){return respondWithRpcPromise(_0xa9c5('0x5a'),_0x59e917[_0xa9c5('0x18')],routingClient)['then'](respondWithResult(_0x112d64,null))[_0xa9c5('0xd')](handleError(_0x112d64,null));};exports[_0xa9c5('0x5b')]=function(_0x18dbfa,_0x2e00f5){return respondWithRpcPromise(_0xa9c5('0x5c'),_0x18dbfa[_0xa9c5('0x18')],routingClient)[_0xa9c5('0x9')](respondWithResult(_0x2e00f5,null))['catch'](handleError(_0x2e00f5,null));};exports[_0xa9c5('0x5d')]=function(_0x40468b,_0x7f9e83){return respondWithRpcPromise(_0xa9c5('0x5c'),_0x40468b[_0xa9c5('0x18')],routingClient)[_0xa9c5('0x9')](function(_0x39fae1){if(_0x40468b[_0xa9c5('0x18')][_0xa9c5('0x5e')]!==undefined){var _0x7d0e85=_(_0x39fae1[_0xa9c5('0x14')])['filter']([_0x40468b[_0xa9c5('0x18')][_0xa9c5('0x5e')],_0x40468b['params']['id']])[_0xa9c5('0x5f')](_0xa9c5('0x60'))[_0xa9c5('0x61')]()['value']();return _0x39fae1[_0xa9c5('0x14')][_0xa9c5('0x62')](function(_0x22dfd7){return _0x7d0e85[_0xa9c5('0x63')](_0x22dfd7['queue_id'])>-0x1;});}else{return _0x39fae1[_0xa9c5('0x14')][_0xa9c5('0x62')](function(_0x4f4fa1){return _0x4f4fa1['queue_id']===parseInt(_0x40468b['params']['id']);});}})['then'](respondWithResult(_0x7f9e83,null))['catch'](handleError(_0x7f9e83,null));};exports['smsQueuesWaitingInteractions']=function(_0x5277ee,_0x54c8f5){return respondWithRpcPromise(_0xa9c5('0x64'),_0x5277ee[_0xa9c5('0x18')],routingClient)[_0xa9c5('0x9')](respondWithResult(_0x54c8f5,null))[_0xa9c5('0xd')](handleError(_0x54c8f5,null));};exports[_0xa9c5('0x65')]=function(_0x592594,_0x4d7772){return respondWithRpcPromise('WhatsappQueuesWaitingInteractions',_0x592594['query'],routingClient)[_0xa9c5('0x9')](respondWithResult(_0x4d7772,null))[_0xa9c5('0xd')](handleError(_0x4d7772,null));};exports[_0xa9c5('0x66')]=function(_0x2eda17,_0x5253e8){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x2eda17[_0xa9c5('0x18')],routingClient)[_0xa9c5('0x9')](respondWithResult(_0x5253e8,null))[_0xa9c5('0xd')](handleError(_0x5253e8,null));};exports[_0xa9c5('0x67')]=function(_0x1d89ec){return function(_0x5673f1,_0x2b69b9){var _0x43ae9,_0xd063cf;var _0x58de52=_[_0xa9c5('0x68')](_0x1d89ec);var _0x2741df=_0x1d89ec===_0xa9c5('0x69')?_0xa9c5('0x6a'):'Account';return db[_0x58de52+_0xa9c5('0x6b')][_0xa9c5('0x6c')]({'raw':!![],'where':{'id':_0x5673f1['params']['id']}})['then'](function(_0x2f1e9f){if(_['isNil'](_0x2f1e9f)){throw new Error(_0x58de52+'\x20Queue\x20not\x20found');}_0x43ae9=_0x2f1e9f;return db[_0x58de52+_0xa9c5('0x6d')][_0xa9c5('0x6c')]({'where':{'id':_0x5673f1[_0xa9c5('0x32')][_0xa9c5('0x6e')]},'include':[{'model':db[_0x58de52+_0xa9c5('0x6f')],'as':'Interaction'},{'model':db[_0x58de52+_0x2741df],'as':_0xa9c5('0x70')}]});})['then'](function(_0x129157){if(_[_0xa9c5('0x13')](_0x129157)){throw new Error(_0x58de52+_0xa9c5('0x71'));}_0xd063cf=_0x129157;return _0x129157[_0xa9c5('0x72')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x4b056e={'uniqueid':_0x1d89ec+'.'+_0xd063cf['id']+'.'+_0xd063cf[_0xa9c5('0x6f')]['id'],'FromUserId':_0x5673f1['user']['id'],'type':'queue'};_0x4b056e[_0x58de52+_0xa9c5('0x73')]=_0xd063cf['id'];_0x4b056e[_0x58de52+_0xa9c5('0x74')]=_0xd063cf['Interaction']['id'];_0x4b056e['From'+_0x58de52+_0x2741df+'Id']=_0xd063cf[_0xa9c5('0x70')]['id'];_0x4b056e['To'+_0x58de52+_0xa9c5('0x75')]=_0x43ae9['id'];return db[_0x58de52+_0xa9c5('0x76')][_0xa9c5('0x77')](_0x4b056e);})['then'](function(){return respondWithRpcPromise('Start',{'channel':_0x1d89ec,'interaction':_0xd063cf[_0xa9c5('0x6f')],'message':_0xd063cf,'account':_0xd063cf[_0xa9c5('0x70')],'applications':[{'id':0x0,'priority':0x1,'app':_0xa9c5('0x78'),'appdata':_0x43ae9[_0xa9c5('0x11')]+','+(_0xd063cf[_0xa9c5('0x70')][_0xa9c5('0x79')]||0x12c),'interval':_0xa9c5('0x7a')}]},routingClient);})['then'](respondWithResult(_0x2b69b9,null))[_0xa9c5('0xd')](handleError(_0x2b69b9,null));};};exports[_0xa9c5('0x7b')]=function(_0x5065e2,_0x328869){var _0x2488aa,_0x5544d8;if(_[_0xa9c5('0x13')](_0x5065e2[_0xa9c5('0x32')][_0xa9c5('0x7c')])){throw new Error(_0xa9c5('0x7d'));}var _0x21e3ba=_0x5065e2[_0xa9c5('0x32')][_0xa9c5('0x7c')];var _0x13e233=_[_0xa9c5('0x68')](_0x21e3ba);var _0x24a6d3=_0x21e3ba===_0xa9c5('0x69')?_0xa9c5('0x6a'):_0xa9c5('0x70');return db[_0xa9c5('0x7e')][_0xa9c5('0x6c')]({'raw':!![],'where':{'id':_0x5065e2[_0xa9c5('0x1b')]['id'],'role':_0xa9c5('0x3e')}})['then'](function(_0x425b92){if(_[_0xa9c5('0x13')](_0x425b92)){throw new Error(_0xa9c5('0x7f'));}_0x2488aa=_0x425b92;return db[_0x13e233+'Message'][_0xa9c5('0x6c')]({'where':{'id':_0x5065e2[_0xa9c5('0x32')]['messageId']},'include':[{'model':db[_0x13e233+_0xa9c5('0x6f')],'as':_0xa9c5('0x6f')},{'model':db[_0x13e233+_0x24a6d3],'as':_0xa9c5('0x70')}]});})[_0xa9c5('0x9')](function(_0x343b35){if(_[_0xa9c5('0x13')](_0x343b35)){throw new Error(_0x13e233+_0xa9c5('0x71'));}_0x5544d8=_0x343b35;return _0x343b35[_0xa9c5('0x72')]({'read':0x0,'readAt':null,'UserId':null});})[_0xa9c5('0x9')](function(){var _0xb09d88={'uniqueid':_0x21e3ba+'.'+_0x5544d8['id']+'.'+_0x5544d8[_0xa9c5('0x6f')]['id'],'FromUserId':_0x5065e2[_0xa9c5('0x33')]['id'],'type':_0xa9c5('0x78'),'ToUserId':_0x2488aa['id']};_0xb09d88[_0x13e233+'MessageId']=_0x5544d8['id'];_0xb09d88[_0x13e233+'InteractionId']=_0x5544d8[_0xa9c5('0x6f')]['id'];_0xb09d88[_0xa9c5('0x80')+_0x13e233+_0x24a6d3+'Id']=_0x5544d8['Account']['id'];return db[_0x13e233+_0xa9c5('0x76')][_0xa9c5('0x77')](_0xb09d88);})[_0xa9c5('0x9')](function(){return respondWithRpcPromise(_0xa9c5('0x81'),{'channel':_0x21e3ba,'interaction':_0x5544d8['Interaction'],'message':_0x5544d8,'account':_0x5544d8['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0xa9c5('0x3e'),'appdata':_0x2488aa[_0xa9c5('0x11')]+','+(_0x5544d8[_0xa9c5('0x70')]['agentTransferTimeout']||0x12c),'interval':_0xa9c5('0x7a')}]},routingClient);})[_0xa9c5('0x9')](respondWithResult(_0x328869,null))[_0xa9c5('0xd')](handleError(_0x328869,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(_0x3b2f1e,_0xfb5e77){var _0x3b5fbd=function(_0x5346d9){while(--_0x5346d9){_0x3b2f1e['push'](_0x3b2f1e['shift']());}};_0x3b5fbd(++_0xfb5e77);}(_0x6f47,0xc7));var _0x76f4=function(_0x432fca,_0xb0b1b5){_0x432fca=_0x432fca-0x0;var _0x3adba4=_0x6f47[_0x432fca];return _0x3adba4;};'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 6f51a92..2aaa858 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 _0xffbb=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','index','/:id','isAuthenticated','show','/:id/run','run','post','create','put','update','delete','destroy'];(function(_0x3e9516,_0x454408){var _0x37e2ab=function(_0x459edd){while(--_0x459edd){_0x3e9516['push'](_0x3e9516['shift']());}};_0x37e2ab(++_0x454408);}(_0xffbb,0x15f));var _0xbffb=function(_0x3b69f2,_0xea851e){_0x3b69f2=_0x3b69f2-0x0;var _0x191fb2=_0xffbb[_0x3b69f2];return _0x191fb2;};'use strict';var multer=require(_0xbffb('0x0'));var util=require(_0xbffb('0x1'));var path=require(_0xbffb('0x2'));var timeout=require(_0xbffb('0x3'));var express=require(_0xbffb('0x4'));var router=express[_0xbffb('0x5')]();var fs_extra=require(_0xbffb('0x6'));var auth=require(_0xbffb('0x7'));var interaction=require(_0xbffb('0x8'));var config=require(_0xbffb('0x9'));var controller=require(_0xbffb('0xa'));router[_0xbffb('0xb')]('/',auth['isAuthenticated'](),controller[_0xbffb('0xc')]);router[_0xbffb('0xb')](_0xbffb('0xd'),auth[_0xbffb('0xe')](),controller[_0xbffb('0xf')]);router['get'](_0xbffb('0x10'),auth['isAuthenticated'](),controller[_0xbffb('0x11')]);router[_0xbffb('0x12')]('/',auth[_0xbffb('0xe')](),controller[_0xbffb('0x13')]);router[_0xbffb('0x14')](_0xbffb('0xd'),auth[_0xbffb('0xe')](),controller[_0xbffb('0x15')]);router[_0xbffb('0x16')](_0xbffb('0xd'),auth[_0xbffb('0xe')](),controller[_0xbffb('0x17')]);module[_0xbffb('0x18')]=router; \ No newline at end of file +var _0x28b6=['exports','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./schedule.controller','get','index','isAuthenticated','show','run','post','create','put','update','delete','/:id','destroy'];(function(_0x5d5fb8,_0x2bb8fa){var _0x27e196=function(_0x4a0253){while(--_0x4a0253){_0x5d5fb8['push'](_0x5d5fb8['shift']());}};_0x27e196(++_0x2bb8fa);}(_0x28b6,0x1cd));var _0x628b=function(_0x1e2006,_0x7e0059){_0x1e2006=_0x1e2006-0x0;var _0x18dd7c=_0x28b6[_0x1e2006];return _0x18dd7c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x628b('0x0'));var timeout=require('connect-timeout');var express=require(_0x628b('0x1'));var router=express[_0x628b('0x2')]();var fs_extra=require(_0x628b('0x3'));var auth=require(_0x628b('0x4'));var interaction=require(_0x628b('0x5'));var config=require('../../config/environment');var controller=require(_0x628b('0x6'));router[_0x628b('0x7')]('/',auth['isAuthenticated'](),controller[_0x628b('0x8')]);router['get']('/:id',auth[_0x628b('0x9')](),controller[_0x628b('0xa')]);router['get']('/:id/run',auth[_0x628b('0x9')](),controller[_0x628b('0xb')]);router[_0x628b('0xc')]('/',auth['isAuthenticated'](),controller[_0x628b('0xd')]);router[_0x628b('0xe')]('/:id',auth[_0x628b('0x9')](),controller[_0x628b('0xf')]);router[_0x628b('0x10')](_0x628b('0x11'),auth['isAuthenticated'](),controller[_0x628b('0x12')]);module[_0x628b('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 0d5491d..d8991ad 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 _0x5ed3=['minutes','csv','pdf','xlsx','custom','default','TEXT','sequelize','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','ENUM','years','months','days','hours'];(function(_0x23b1d5,_0x3043fa){var _0x3f5702=function(_0xc9b7eb){while(--_0xc9b7eb){_0x23b1d5['push'](_0x23b1d5['shift']());}};_0x3f5702(++_0x3043fa);}(_0x5ed3,0xc2));var _0x35ed=function(_0x151d79,_0x422c2b){_0x151d79=_0x151d79-0x0;var _0xe551a0=_0x5ed3[_0x151d79];return _0xe551a0;};'use strict';var Sequelize=require(_0x35ed('0x0'));module['exports']={'name':{'type':Sequelize[_0x35ed('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x35ed('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x35ed('0x1')],'allowNull':![],'defaultValue':_0x35ed('0x3')},'startAt':{'type':Sequelize[_0x35ed('0x4')],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x35ed('0x5')](_0x35ed('0x6'),'quarters',_0x35ed('0x7'),'weeks',_0x35ed('0x8'),_0x35ed('0x9'),_0x35ed('0xa')),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize['ENUM'](_0x35ed('0xb'),_0x35ed('0xc'),_0x35ed('0xd')),'allowNull':![],'defaultValue':_0x35ed('0xb')},'type':{'type':Sequelize[_0x35ed('0x5')](_0x35ed('0xe'),_0x35ed('0xf')),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize[_0x35ed('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x35ed('0x1')]},'cc':{'type':Sequelize[_0x35ed('0x10')]},'bcc':{'type':Sequelize[_0x35ed('0x10')]},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0xdbbe=['xlsx','custom','TEXT','sequelize','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','ENUM','quarters','months','days','minutes','csv'];(function(_0x269471,_0x127481){var _0x3fb1c2=function(_0x336bc3){while(--_0x336bc3){_0x269471['push'](_0x269471['shift']());}};_0x3fb1c2(++_0x127481);}(_0xdbbe,0x1ed));var _0xedbb=function(_0x2ff238,_0x1811d2){_0x2ff238=_0x2ff238-0x0;var _0x204a56=_0xdbbe[_0x2ff238];return _0x204a56;};'use strict';var Sequelize=require(_0xedbb('0x0'));module['exports']={'name':{'type':Sequelize[_0xedbb('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xedbb('0x1')]},'active':{'type':Sequelize[_0xedbb('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xedbb('0x3')},'startAt':{'type':Sequelize[_0xedbb('0x4')],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xedbb('0x5')]('years',_0xedbb('0x6'),_0xedbb('0x7'),'weeks',_0xedbb('0x8'),'hours',_0xedbb('0x9')),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize[_0xedbb('0x5')](_0xedbb('0xa'),'pdf',_0xedbb('0xb')),'allowNull':![],'defaultValue':_0xedbb('0xa')},'type':{'type':Sequelize[_0xedbb('0x5')](_0xedbb('0xc'),'default'),'allowNull':![],'defaultValue':_0xedbb('0xc')},'sendMail':{'type':Sequelize[_0xedbb('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0xedbb('0x1')]},'cc':{'type':Sequelize[_0xedbb('0xd')]},'bcc':{'type':Sequelize[_0xedbb('0xd')]},'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 a9fb525..f7df8b3 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 _0x7981=['get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Scheduler','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','run','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','then','destroy','UserProfileResource','error','stack','send','map','Schedule','rawAttributes','fieldName','type','query','filters','intersection','model','attributes','fields','length','nolimit','sort','where','filter','VIRTUAL','name','merge','options','includeAll','findAll','rows','catch','show','keys','include','find','create','body','user'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x7981,0x1a9));var _0x1798=function(_0x3bae0a,_0x320c37){_0x3bae0a=_0x3bae0a-0x0;var _0x2a8cc7=_0x7981[_0x3bae0a];return _0x2a8cc7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1798('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1798('0x1'));var rp=require(_0x1798('0x2'));var moment=require(_0x1798('0x3'));var BPromise=require(_0x1798('0x4'));var Mustache=require(_0x1798('0x5'));var util=require(_0x1798('0x6'));var path=require('path');var sox=require(_0x1798('0x7'));var csv=require(_0x1798('0x8'));var ejs=require(_0x1798('0x9'));var fs=require('fs');var fs_extra=require(_0x1798('0xa'));var _=require(_0x1798('0xb'));var squel=require(_0x1798('0xc'));var crypto=require(_0x1798('0xd'));var jsforce=require(_0x1798('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x1798('0xf'));var Papa=require(_0x1798('0x10'));var Redis=require(_0x1798('0x11'));var authService=require(_0x1798('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1798('0x13'));var logger=require(_0x1798('0x14'))('api');var utils=require(_0x1798('0x15'));var config=require(_0x1798('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x1798('0x17'))['db'];function respondWithStatusCode(_0x3cb0b9,_0x2f5901){_0x2f5901=_0x2f5901||0xcc;return function(_0x1254c2){if(_0x1254c2){return _0x3cb0b9[_0x1798('0x18')](_0x2f5901);}return _0x3cb0b9[_0x1798('0x19')](_0x2f5901)[_0x1798('0x1a')]();};}function respondWithResult(_0x1368e0,_0x5da820){_0x5da820=_0x5da820||0xc8;return function(_0x25edfc){if(_0x25edfc){return _0x1368e0[_0x1798('0x19')](_0x5da820)[_0x1798('0x1b')](_0x25edfc);}};}function respondWithFilteredResult(_0x515a8c,_0x42ef53){return function(_0xd733dd){if(_0xd733dd){var _0x1319fb=typeof _0x42ef53[_0x1798('0x1c')]===_0x1798('0x1d')&&typeof _0x42ef53['limit']===_0x1798('0x1d');var _0x23dd62=_0xd733dd['count'];var _0x41a3e2=_0x1319fb?0x0:_0x42ef53['offset'];var _0x513712=_0x1319fb?_0xd733dd[_0x1798('0x1e')]:_0x42ef53['offset']+_0x42ef53[_0x1798('0x1f')];var _0x50d95e;if(_0x513712>=_0x23dd62){_0x513712=_0x23dd62;_0x50d95e=0xc8;}else{_0x50d95e=0xce;}_0x515a8c['status'](_0x50d95e);return _0x515a8c[_0x1798('0x20')](_0x1798('0x21'),_0x41a3e2+'-'+_0x513712+'/'+_0x23dd62)[_0x1798('0x1b')](_0xd733dd);}return null;};}function patchUpdates(_0x4517aa){return function(_0x3f7c72){try{jsonpatch[_0x1798('0x22')](_0x3f7c72,_0x4517aa,!![]);}catch(_0x2ac54c){return BPromise[_0x1798('0x23')](_0x2ac54c);}return _0x3f7c72['save']();};}function saveUpdates(_0x14e401,_0x115f4b){return function(_0x5bbc96){if(_0x5bbc96){return _0x5bbc96['update'](_0x14e401)[_0x1798('0x24')](function(_0x22a4d3){return _0x22a4d3;});}return null;};}function removeEntity(_0x328eba,_0x51cd18){return function(_0x2e7c0b){if(_0x2e7c0b){return _0x2e7c0b[_0x1798('0x25')]()['then'](function(){var _0x878469=_0x2e7c0b['get']({'plain':!![]});var _0x3a2fc0='Scheduler';return db[_0x1798('0x26')]['destroy']({'where':{'type':_0x3a2fc0,'resourceId':_0x878469['id']}})[_0x1798('0x24')](function(){return _0x2e7c0b;});})['then'](function(){_0x328eba[_0x1798('0x19')](0xcc)[_0x1798('0x1a')]();});}};}function handleEntityNotFound(_0x7ad8c9,_0x4f85a6){return function(_0x5b9af0){if(!_0x5b9af0){_0x7ad8c9[_0x1798('0x18')](0x194);}return _0x5b9af0;};}function handleError(_0x40204c,_0x57b39a){_0x57b39a=_0x57b39a||0x1f4;return function(_0x256f02){logger[_0x1798('0x27')](_0x256f02[_0x1798('0x28')]);if(_0x256f02['name']){delete _0x256f02['name'];}_0x40204c[_0x1798('0x19')](_0x57b39a)[_0x1798('0x29')](_0x256f02);};}exports['index']=function(_0xdc94ea,_0x4faeae){var _0x386fe4={},_0x5a9ca1={},_0x114777={'count':0x0,'rows':[]};var _0x14014e=_[_0x1798('0x2a')](db[_0x1798('0x2b')][_0x1798('0x2c')],function(_0x3438e3){return{'name':_0x3438e3[_0x1798('0x2d')],'type':_0x3438e3[_0x1798('0x2e')]['key']};});_0x5a9ca1['model']=_[_0x1798('0x2a')](_0x14014e,'name');_0x5a9ca1[_0x1798('0x2f')]=_['keys'](_0xdc94ea[_0x1798('0x2f')]);_0x5a9ca1[_0x1798('0x30')]=_[_0x1798('0x31')](_0x5a9ca1[_0x1798('0x32')],_0x5a9ca1[_0x1798('0x2f')]);_0x386fe4[_0x1798('0x33')]=_[_0x1798('0x31')](_0x5a9ca1['model'],qs[_0x1798('0x34')](_0xdc94ea[_0x1798('0x2f')][_0x1798('0x34')]));_0x386fe4['attributes']=_0x386fe4[_0x1798('0x33')][_0x1798('0x35')]?_0x386fe4['attributes']:_0x5a9ca1[_0x1798('0x32')];if(!_0xdc94ea[_0x1798('0x2f')]['hasOwnProperty'](_0x1798('0x36'))){_0x386fe4[_0x1798('0x1f')]=qs[_0x1798('0x1f')](_0xdc94ea['query']['limit']);_0x386fe4['offset']=qs[_0x1798('0x1c')](_0xdc94ea['query']['offset']);}_0x386fe4['order']=qs['sort'](_0xdc94ea[_0x1798('0x2f')][_0x1798('0x37')]);_0x386fe4[_0x1798('0x38')]=qs[_0x1798('0x30')](_['pick'](_0xdc94ea[_0x1798('0x2f')],_0x5a9ca1['filters']),_0x14014e);if(_0xdc94ea['query'][_0x1798('0x39')]){_0x386fe4[_0x1798('0x38')]=_['merge'](_0x386fe4[_0x1798('0x38')],{'$or':_[_0x1798('0x2a')](_0x14014e,function(_0x5aaaa5){if(_0x5aaaa5[_0x1798('0x2e')]!==_0x1798('0x3a')){var _0x314c3d={};_0x314c3d[_0x5aaaa5[_0x1798('0x3b')]]={'$like':'%'+_0xdc94ea['query'][_0x1798('0x39')]+'%'};return _0x314c3d;}})});}_0x386fe4=_[_0x1798('0x3c')]({},_0x386fe4,_0xdc94ea[_0x1798('0x3d')]);var _0x370b04={'where':_0x386fe4['where']};return db[_0x1798('0x2b')][_0x1798('0x1e')](_0x370b04)[_0x1798('0x24')](function(_0x1ecb14){_0x114777[_0x1798('0x1e')]=_0x1ecb14;if(_0xdc94ea[_0x1798('0x2f')][_0x1798('0x3e')]){_0x386fe4['include']=[{'all':!![]}];}return db['Schedule'][_0x1798('0x3f')](_0x386fe4);})['then'](function(_0xe38e93){_0x114777[_0x1798('0x40')]=_0xe38e93;return _0x114777;})[_0x1798('0x24')](respondWithFilteredResult(_0x4faeae,_0x386fe4))[_0x1798('0x41')](handleError(_0x4faeae,null));};exports[_0x1798('0x42')]=function(_0x4de5c1,_0x1c05e2){var _0x1e7d4a={'raw':![],'where':{'id':_0x4de5c1['params']['id']}},_0x3b4a75={};_0x3b4a75['model']=_['keys'](db[_0x1798('0x2b')][_0x1798('0x2c')]);_0x3b4a75[_0x1798('0x2f')]=_[_0x1798('0x43')](_0x4de5c1[_0x1798('0x2f')]);_0x3b4a75[_0x1798('0x30')]=_['intersection'](_0x3b4a75[_0x1798('0x32')],_0x3b4a75[_0x1798('0x2f')]);_0x1e7d4a['attributes']=_['intersection'](_0x3b4a75[_0x1798('0x32')],qs[_0x1798('0x34')](_0x4de5c1[_0x1798('0x2f')][_0x1798('0x34')]));_0x1e7d4a['attributes']=_0x1e7d4a['attributes']['length']?_0x1e7d4a[_0x1798('0x33')]:_0x3b4a75['model'];if(_0x4de5c1[_0x1798('0x2f')][_0x1798('0x3e')]){_0x1e7d4a[_0x1798('0x44')]=[{'all':!![]}];}_0x1e7d4a=_['merge']({},_0x1e7d4a,_0x4de5c1['options']);return db[_0x1798('0x2b')][_0x1798('0x45')](_0x1e7d4a)[_0x1798('0x24')](handleEntityNotFound(_0x1c05e2,null))['then'](respondWithResult(_0x1c05e2,null))[_0x1798('0x41')](handleError(_0x1c05e2,null));};exports[_0x1798('0x46')]=function(_0x3e5217,_0x2161f4){return db['Schedule'][_0x1798('0x46')](_0x3e5217[_0x1798('0x47')],{})['then'](function(_0x1375d6){var _0x86b4da=_0x3e5217[_0x1798('0x48')][_0x1798('0x49')]({'plain':!![]});if(!_0x86b4da)throw new Error(_0x1798('0x4a'));if(_0x86b4da[_0x1798('0x4b')]===_0x1798('0x48')){var _0x3fedc4=_0x1375d6[_0x1798('0x49')]({'plain':!![]});var _0x32e57b=_0x1798('0x4c');return db[_0x1798('0x4d')][_0x1798('0x45')]({'where':{'name':_0x32e57b,'userProfileId':_0x86b4da[_0x1798('0x4e')]},'raw':!![]})[_0x1798('0x24')](function(_0x20a218){if(_0x20a218&&_0x20a218['autoAssociation']===0x0){return db[_0x1798('0x26')][_0x1798('0x46')]({'name':_0x3fedc4['name'],'resourceId':_0x3fedc4['id'],'type':_0x20a218[_0x1798('0x3b')],'sectionId':_0x20a218['id']},{})[_0x1798('0x24')](function(){return _0x1375d6;});}else{return _0x1375d6;}})[_0x1798('0x41')](function(_0x4594cb){logger['error'](_0x1798('0x4f'),_0x4594cb);throw _0x4594cb;});}return _0x1375d6;})[_0x1798('0x24')](respondWithResult(_0x2161f4,0xc9))[_0x1798('0x41')](handleError(_0x2161f4,null));};exports[_0x1798('0x50')]=function(_0xd48f2f,_0x1b3e06){if(_0xd48f2f[_0x1798('0x47')]['id']){delete _0xd48f2f['body']['id'];}return db['Schedule'][_0x1798('0x45')]({'where':{'id':_0xd48f2f[_0x1798('0x51')]['id']}})[_0x1798('0x24')](handleEntityNotFound(_0x1b3e06,null))[_0x1798('0x24')](saveUpdates(_0xd48f2f[_0x1798('0x47')],null))['then'](respondWithResult(_0x1b3e06,null))[_0x1798('0x41')](handleError(_0x1b3e06,null));};exports[_0x1798('0x25')]=function(_0x9c78ea,_0x11e3ff){return db[_0x1798('0x2b')][_0x1798('0x45')]({'where':{'id':_0x9c78ea[_0x1798('0x51')]['id']}})[_0x1798('0x24')](handleEntityNotFound(_0x11e3ff,null))[_0x1798('0x24')](removeEntity(_0x11e3ff,null))[_0x1798('0x41')](handleError(_0x11e3ff,null));};exports[_0x1798('0x52')]=function(_0x23823d,_0x5ed6c0,_0x40e3e8){var _0x2903c8=require('../../config/schedule');return db[_0x1798('0x2b')]['find']({'where':{'id':_0x23823d[_0x1798('0x51')]['id']},'raw':!![]})[_0x1798('0x24')](handleEntityNotFound(_0x5ed6c0,null))[_0x1798('0x24')](function(){_0x2903c8[_0x1798('0x52')](_0x23823d[_0x1798('0x51')]['id']);})['then'](respondWithStatusCode(_0x5ed6c0,null))[_0x1798('0x41')](handleError(_0x5ed6c0,null));}; \ No newline at end of file +var _0x55c4=['lodash','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','sendStatus','status','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','get','Scheduler','end','error','stack','name','send','Schedule','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','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','../../config/schedule','run','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra'];(function(_0x9c530a,_0x2021ba){var _0x1f6ffe=function(_0x234b27){while(--_0x234b27){_0x9c530a['push'](_0x9c530a['shift']());}};_0x1f6ffe(++_0x2021ba);}(_0x55c4,0x14e));var _0x455c=function(_0x56472d,_0x4b2ea2){_0x56472d=_0x56472d-0x0;var _0x2dd761=_0x55c4[_0x56472d];return _0x2dd761;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x455c('0x0'));var zipdir=require(_0x455c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x455c('0x2'));var moment=require('moment');var BPromise=require(_0x455c('0x3'));var Mustache=require(_0x455c('0x4'));var util=require(_0x455c('0x5'));var path=require(_0x455c('0x6'));var sox=require('sox');var csv=require(_0x455c('0x7'));var ejs=require(_0x455c('0x8'));var fs=require('fs');var fs_extra=require(_0x455c('0x9'));var _=require(_0x455c('0xa'));var squel=require('squel');var crypto=require(_0x455c('0xb'));var jsforce=require(_0x455c('0xc'));var deskjs=require(_0x455c('0xd'));var toCsv=require('to-csv');var querystring=require(_0x455c('0xe'));var Papa=require(_0x455c('0xf'));var Redis=require(_0x455c('0x10'));var authService=require(_0x455c('0x11'));var qs=require(_0x455c('0x12'));var as=require(_0x455c('0x13'));var hardwareService=require(_0x455c('0x14'));var logger=require('../../config/logger')(_0x455c('0x15'));var utils=require('../../config/utils');var config=require(_0x455c('0x16'));var licenseUtil=require(_0x455c('0x17'));var db=require(_0x455c('0x18'))['db'];function respondWithStatusCode(_0x1c3254,_0x26fbda){_0x26fbda=_0x26fbda||0xcc;return function(_0x1fc57b){if(_0x1fc57b){return _0x1c3254[_0x455c('0x19')](_0x26fbda);}return _0x1c3254[_0x455c('0x1a')](_0x26fbda)['end']();};}function respondWithResult(_0x1540c6,_0x42643b){_0x42643b=_0x42643b||0xc8;return function(_0x35de87){if(_0x35de87){return _0x1540c6[_0x455c('0x1a')](_0x42643b)['json'](_0x35de87);}};}function respondWithFilteredResult(_0x1762b2,_0x57281e){return function(_0x271aa8){if(_0x271aa8){var _0x8aad97=typeof _0x57281e[_0x455c('0x1b')]===_0x455c('0x1c')&&typeof _0x57281e[_0x455c('0x1d')]===_0x455c('0x1c');var _0x294b69=_0x271aa8[_0x455c('0x1e')];var _0xbd1763=_0x8aad97?0x0:_0x57281e[_0x455c('0x1b')];var _0xcfad93=_0x8aad97?_0x271aa8[_0x455c('0x1e')]:_0x57281e[_0x455c('0x1b')]+_0x57281e[_0x455c('0x1d')];var _0x347886;if(_0xcfad93>=_0x294b69){_0xcfad93=_0x294b69;_0x347886=0xc8;}else{_0x347886=0xce;}_0x1762b2[_0x455c('0x1a')](_0x347886);return _0x1762b2[_0x455c('0x1f')]('Content-Range',_0xbd1763+'-'+_0xcfad93+'/'+_0x294b69)['json'](_0x271aa8);}return null;};}function patchUpdates(_0x4d2c5e){return function(_0x357dbf){try{jsonpatch[_0x455c('0x20')](_0x357dbf,_0x4d2c5e,!![]);}catch(_0x42223b){return BPromise[_0x455c('0x21')](_0x42223b);}return _0x357dbf[_0x455c('0x22')]();};}function saveUpdates(_0x18a38a,_0x1523c0){return function(_0x57f102){if(_0x57f102){return _0x57f102[_0x455c('0x23')](_0x18a38a)['then'](function(_0x422c22){return _0x422c22;});}return null;};}function removeEntity(_0x14f352,_0x2aa04e){return function(_0x41e1e3){if(_0x41e1e3){return _0x41e1e3[_0x455c('0x24')]()[_0x455c('0x25')](function(){var _0x4d4491=_0x41e1e3[_0x455c('0x26')]({'plain':!![]});var _0x3799a2=_0x455c('0x27');return db['UserProfileResource'][_0x455c('0x24')]({'where':{'type':_0x3799a2,'resourceId':_0x4d4491['id']}})[_0x455c('0x25')](function(){return _0x41e1e3;});})[_0x455c('0x25')](function(){_0x14f352[_0x455c('0x1a')](0xcc)[_0x455c('0x28')]();});}};}function handleEntityNotFound(_0x2296ae,_0x2bb345){return function(_0x538654){if(!_0x538654){_0x2296ae['sendStatus'](0x194);}return _0x538654;};}function handleError(_0x31332b,_0x48a810){_0x48a810=_0x48a810||0x1f4;return function(_0x3eb066){logger[_0x455c('0x29')](_0x3eb066[_0x455c('0x2a')]);if(_0x3eb066['name']){delete _0x3eb066[_0x455c('0x2b')];}_0x31332b[_0x455c('0x1a')](_0x48a810)[_0x455c('0x2c')](_0x3eb066);};}exports['index']=function(_0x215e50,_0x229055){var _0x41f935={},_0x388dfb={},_0x51bae0={'count':0x0,'rows':[]};var _0x5d7a17=_['map'](db[_0x455c('0x2d')][_0x455c('0x2e')],function(_0x2f0a59){return{'name':_0x2f0a59[_0x455c('0x2f')],'type':_0x2f0a59[_0x455c('0x30')][_0x455c('0x31')]};});_0x388dfb[_0x455c('0x32')]=_[_0x455c('0x33')](_0x5d7a17,_0x455c('0x2b'));_0x388dfb['query']=_[_0x455c('0x34')](_0x215e50[_0x455c('0x35')]);_0x388dfb[_0x455c('0x36')]=_[_0x455c('0x37')](_0x388dfb[_0x455c('0x32')],_0x388dfb[_0x455c('0x35')]);_0x41f935[_0x455c('0x38')]=_[_0x455c('0x37')](_0x388dfb[_0x455c('0x32')],qs['fields'](_0x215e50[_0x455c('0x35')][_0x455c('0x39')]));_0x41f935[_0x455c('0x38')]=_0x41f935[_0x455c('0x38')][_0x455c('0x3a')]?_0x41f935[_0x455c('0x38')]:_0x388dfb[_0x455c('0x32')];if(!_0x215e50[_0x455c('0x35')][_0x455c('0x3b')]('nolimit')){_0x41f935[_0x455c('0x1d')]=qs[_0x455c('0x1d')](_0x215e50[_0x455c('0x35')][_0x455c('0x1d')]);_0x41f935[_0x455c('0x1b')]=qs[_0x455c('0x1b')](_0x215e50['query'][_0x455c('0x1b')]);}_0x41f935[_0x455c('0x3c')]=qs[_0x455c('0x3d')](_0x215e50[_0x455c('0x35')][_0x455c('0x3d')]);_0x41f935['where']=qs[_0x455c('0x36')](_[_0x455c('0x3e')](_0x215e50[_0x455c('0x35')],_0x388dfb[_0x455c('0x36')]),_0x5d7a17);if(_0x215e50['query'][_0x455c('0x3f')]){_0x41f935[_0x455c('0x40')]=_[_0x455c('0x41')](_0x41f935[_0x455c('0x40')],{'$or':_[_0x455c('0x33')](_0x5d7a17,function(_0x5a244a){if(_0x5a244a[_0x455c('0x30')]!==_0x455c('0x42')){var _0x17fab6={};_0x17fab6[_0x5a244a[_0x455c('0x2b')]]={'$like':'%'+_0x215e50[_0x455c('0x35')][_0x455c('0x3f')]+'%'};return _0x17fab6;}})});}_0x41f935=_[_0x455c('0x41')]({},_0x41f935,_0x215e50[_0x455c('0x43')]);var _0x30164f={'where':_0x41f935['where']};return db['Schedule']['count'](_0x30164f)[_0x455c('0x25')](function(_0x38c09b){_0x51bae0['count']=_0x38c09b;if(_0x215e50['query'][_0x455c('0x44')]){_0x41f935[_0x455c('0x45')]=[{'all':!![]}];}return db[_0x455c('0x2d')][_0x455c('0x46')](_0x41f935);})[_0x455c('0x25')](function(_0x5807b1){_0x51bae0['rows']=_0x5807b1;return _0x51bae0;})[_0x455c('0x25')](respondWithFilteredResult(_0x229055,_0x41f935))[_0x455c('0x47')](handleError(_0x229055,null));};exports[_0x455c('0x48')]=function(_0x420b2c,_0x4d569e){var _0x190f84={'raw':![],'where':{'id':_0x420b2c[_0x455c('0x49')]['id']}},_0x4574d0={};_0x4574d0[_0x455c('0x32')]=_[_0x455c('0x34')](db[_0x455c('0x2d')][_0x455c('0x2e')]);_0x4574d0[_0x455c('0x35')]=_[_0x455c('0x34')](_0x420b2c[_0x455c('0x35')]);_0x4574d0['filters']=_[_0x455c('0x37')](_0x4574d0[_0x455c('0x32')],_0x4574d0[_0x455c('0x35')]);_0x190f84[_0x455c('0x38')]=_[_0x455c('0x37')](_0x4574d0[_0x455c('0x32')],qs[_0x455c('0x39')](_0x420b2c[_0x455c('0x35')]['fields']));_0x190f84[_0x455c('0x38')]=_0x190f84['attributes']['length']?_0x190f84['attributes']:_0x4574d0[_0x455c('0x32')];if(_0x420b2c[_0x455c('0x35')][_0x455c('0x44')]){_0x190f84[_0x455c('0x45')]=[{'all':!![]}];}_0x190f84=_['merge']({},_0x190f84,_0x420b2c[_0x455c('0x43')]);return db[_0x455c('0x2d')][_0x455c('0x4a')](_0x190f84)['then'](handleEntityNotFound(_0x4d569e,null))[_0x455c('0x25')](respondWithResult(_0x4d569e,null))['catch'](handleError(_0x4d569e,null));};exports[_0x455c('0x4b')]=function(_0x277940,_0x166109){return db[_0x455c('0x2d')][_0x455c('0x4b')](_0x277940[_0x455c('0x4c')],{})[_0x455c('0x25')](function(_0x23f2f6){var _0xc67a0f=_0x277940[_0x455c('0x4d')][_0x455c('0x26')]({'plain':!![]});if(!_0xc67a0f)throw new Error(_0x455c('0x4e'));if(_0xc67a0f[_0x455c('0x4f')]===_0x455c('0x4d')){var _0x397e17=_0x23f2f6[_0x455c('0x26')]({'plain':!![]});var _0x25b15f=_0x455c('0x27');return db[_0x455c('0x50')][_0x455c('0x4a')]({'where':{'name':_0x25b15f,'userProfileId':_0xc67a0f[_0x455c('0x51')]},'raw':!![]})[_0x455c('0x25')](function(_0x328a2a){if(_0x328a2a&&_0x328a2a['autoAssociation']===0x0){return db[_0x455c('0x52')][_0x455c('0x4b')]({'name':_0x397e17[_0x455c('0x2b')],'resourceId':_0x397e17['id'],'type':_0x328a2a[_0x455c('0x2b')],'sectionId':_0x328a2a['id']},{})[_0x455c('0x25')](function(){return _0x23f2f6;});}else{return _0x23f2f6;}})[_0x455c('0x47')](function(_0x3d28c1){logger['error'](_0x455c('0x53'),_0x3d28c1);throw _0x3d28c1;});}return _0x23f2f6;})['then'](respondWithResult(_0x166109,0xc9))[_0x455c('0x47')](handleError(_0x166109,null));};exports[_0x455c('0x23')]=function(_0x138769,_0x5638d8){if(_0x138769[_0x455c('0x4c')]['id']){delete _0x138769['body']['id'];}return db[_0x455c('0x2d')][_0x455c('0x4a')]({'where':{'id':_0x138769[_0x455c('0x49')]['id']}})[_0x455c('0x25')](handleEntityNotFound(_0x5638d8,null))['then'](saveUpdates(_0x138769[_0x455c('0x4c')],null))[_0x455c('0x25')](respondWithResult(_0x5638d8,null))[_0x455c('0x47')](handleError(_0x5638d8,null));};exports[_0x455c('0x24')]=function(_0x5835b8,_0x4680e8){return db[_0x455c('0x2d')]['find']({'where':{'id':_0x5835b8[_0x455c('0x49')]['id']}})[_0x455c('0x25')](handleEntityNotFound(_0x4680e8,null))[_0x455c('0x25')](removeEntity(_0x4680e8,null))[_0x455c('0x47')](handleError(_0x4680e8,null));};exports['run']=function(_0x18de98,_0x15425f,_0x15a05c){var _0x580f6a=require(_0x455c('0x54'));return db[_0x455c('0x2d')]['find']({'where':{'id':_0x18de98[_0x455c('0x49')]['id']},'raw':!![]})[_0x455c('0x25')](handleEntityNotFound(_0x15425f,null))[_0x455c('0x25')](function(){_0x580f6a[_0x455c('0x55')](_0x18de98[_0x455c('0x49')]['id']);})[_0x455c('0x25')](respondWithStatusCode(_0x15425f,null))[_0x455c('0x47')](handleError(_0x15425f,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 1adc567..cd65003 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 _0x0f22=['bluebird','path','rimraf','../../config/environment','./schedule.attributes','exports','define','Schedule','lodash','../../config/logger','api','moment'];(function(_0x544b78,_0x25c64a){var _0x448881=function(_0x16f1c1){while(--_0x16f1c1){_0x544b78['push'](_0x544b78['shift']());}};_0x448881(++_0x25c64a);}(_0x0f22,0x128));var _0x20f2=function(_0x475c3e,_0x29459d){_0x475c3e=_0x475c3e-0x0;var _0x46977a=_0x0f22[_0x475c3e];return _0x46977a;};'use strict';var _=require(_0x20f2('0x0'));var util=require('util');var logger=require(_0x20f2('0x1'))(_0x20f2('0x2'));var moment=require(_0x20f2('0x3'));var BPromise=require(_0x20f2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x20f2('0x5'));var rimraf=require(_0x20f2('0x6'));var config=require(_0x20f2('0x7'));var attributes=require(_0x20f2('0x8'));module[_0x20f2('0x9')]=function(_0x32ec14,_0x2e4c05){return _0x32ec14[_0x20f2('0xa')](_0x20f2('0xb'),attributes,{'tableName':'tools_schedules','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcc42=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./schedule.attributes','exports','define','Schedule','tools_schedules','util','../../config/logger','api'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0xcc42,0x14d));var _0x2cc4=function(_0x54edc9,_0x345f01){_0x54edc9=_0x54edc9-0x0;var _0x2ae7a9=_0xcc42[_0x54edc9];return _0x2ae7a9;};'use strict';var _=require('lodash');var util=require(_0x2cc4('0x0'));var logger=require(_0x2cc4('0x1'))(_0x2cc4('0x2'));var moment=require(_0x2cc4('0x3'));var BPromise=require(_0x2cc4('0x4'));var rp=require(_0x2cc4('0x5'));var fs=require('fs');var path=require(_0x2cc4('0x6'));var rimraf=require(_0x2cc4('0x7'));var config=require(_0x2cc4('0x8'));var attributes=require(_0x2cc4('0x9'));module[_0x2cc4('0xa')]=function(_0x17a4ed,_0x217874){return _0x17a4ed[_0x2cc4('0xb')](_0x2cc4('0xc'),attributes,{'tableName':_0x2cc4('0xd'),'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 b43be65..2f3984d 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 _0x48f7=['error','code','message','Schedule,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1a0957,_0x4ecb2e){var _0x49b9d3=function(_0x49d45d){while(--_0x49d45d){_0x1a0957['push'](_0x1a0957['shift']());}};_0x49b9d3(++_0x4ecb2e);}(_0x48f7,0x124));var _0x748f=function(_0x212e3a,_0x2846f4){_0x212e3a=_0x212e3a-0x0;var _0x27c076=_0x48f7[_0x212e3a];return _0x27c076;};'use strict';var _=require(_0x748f('0x0'));var util=require(_0x748f('0x1'));var moment=require(_0x748f('0x2'));var BPromise=require(_0x748f('0x3'));var rs=require(_0x748f('0x4'));var fs=require('fs');var Redis=require(_0x748f('0x5'));var db=require(_0x748f('0x6'))['db'];var utils=require(_0x748f('0x7'));var logger=require(_0x748f('0x8'))(_0x748f('0x9'));var config=require(_0x748f('0xa'));var jayson=require(_0x748f('0xb'));var client=jayson[_0x748f('0xc')][_0x748f('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x312344,_0x32d93b,_0x5630ed){return new BPromise(function(_0xa982e8,_0x53248c){return client['request'](_0x312344,_0x5630ed)[_0x748f('0xe')](function(_0x229618){logger[_0x748f('0xf')]('Schedule,\x20%s,\x20%s',_0x32d93b,_0x748f('0x10'));logger[_0x748f('0x11')](_0x748f('0x12'),_0x32d93b,_0x748f('0x10'),JSON[_0x748f('0x13')](_0x229618));if(_0x229618[_0x748f('0x14')]){if(_0x229618['error'][_0x748f('0x15')]===0x1f4){logger[_0x748f('0x14')]('Schedule,\x20%s,\x20%s',_0x32d93b,_0x229618['error'][_0x748f('0x16')]);return _0x53248c(_0x229618[_0x748f('0x14')][_0x748f('0x16')]);}logger[_0x748f('0x14')](_0x748f('0x17'),_0x32d93b,_0x229618['error'][_0x748f('0x16')]);return _0xa982e8(_0x229618[_0x748f('0x14')][_0x748f('0x16')]);}else{logger[_0x748f('0xf')](_0x748f('0x17'),_0x32d93b,'request\x20sent');_0xa982e8(_0x229618[_0x748f('0x18')]['message']);}})[_0x748f('0x19')](function(_0x4bdf82){logger[_0x748f('0x14')]('Schedule,\x20%s,\x20%s',_0x32d93b,_0x4bdf82);_0x53248c(_0x4bdf82);});});} \ No newline at end of file +var _0xffbe=['request\x20sent','Schedule,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','Schedule,\x20%s,\x20%s'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xffbe,0x99));var _0xeffb=function(_0x474fad,_0x3c0274){_0x474fad=_0x474fad-0x0;var _0x2948f2=_0xffbe[_0x474fad];return _0x2948f2;};'use strict';var _=require(_0xeffb('0x0'));var util=require('util');var moment=require(_0xeffb('0x1'));var BPromise=require(_0xeffb('0x2'));var rs=require(_0xeffb('0x3'));var fs=require('fs');var Redis=require(_0xeffb('0x4'));var db=require(_0xeffb('0x5'))['db'];var utils=require(_0xeffb('0x6'));var logger=require(_0xeffb('0x7'))(_0xeffb('0x8'));var config=require('../../config/environment');var jayson=require(_0xeffb('0x9'));var client=jayson[_0xeffb('0xa')][_0xeffb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24547f,_0x3c7c93,_0x277fab){return new BPromise(function(_0x138d2c,_0x261af2){return client['request'](_0x24547f,_0x277fab)[_0xeffb('0xc')](function(_0x4f10a7){logger[_0xeffb('0xd')](_0xeffb('0xe'),_0x3c7c93,_0xeffb('0xf'));logger['debug'](_0xeffb('0x10'),_0x3c7c93,'request\x20sent',JSON['stringify'](_0x4f10a7));if(_0x4f10a7[_0xeffb('0x11')]){if(_0x4f10a7[_0xeffb('0x11')]['code']===0x1f4){logger[_0xeffb('0x11')](_0xeffb('0xe'),_0x3c7c93,_0x4f10a7[_0xeffb('0x11')]['message']);return _0x261af2(_0x4f10a7[_0xeffb('0x11')][_0xeffb('0x12')]);}logger[_0xeffb('0x11')](_0xeffb('0xe'),_0x3c7c93,_0x4f10a7['error']['message']);return _0x138d2c(_0x4f10a7[_0xeffb('0x11')][_0xeffb('0x12')]);}else{logger[_0xeffb('0xd')]('Schedule,\x20%s,\x20%s',_0x3c7c93,_0xeffb('0xf'));_0x138d2c(_0x4f10a7[_0xeffb('0x13')][_0xeffb('0x12')]);}})[_0xeffb('0x14')](function(_0x5072d7){logger[_0xeffb('0x11')](_0xeffb('0xe'),_0x3c7c93,_0x5072d7);_0x261af2(_0x5072d7);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 40ab1ef..f3e4ef0 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 _0x3599=['index','/describe','/:id','show','post','create','put','update','delete','destroy','multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','isAuthenticated'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x3599,0x172));var _0x9359=function(_0x6af504,_0x14b0b2){_0x6af504=_0x6af504-0x0;var _0x469276=_0x3599[_0x6af504];return _0x469276;};'use strict';var multer=require(_0x9359('0x0'));var util=require('util');var path=require(_0x9359('0x1'));var timeout=require(_0x9359('0x2'));var express=require('express');var router=express[_0x9359('0x3')]();var fs_extra=require(_0x9359('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9359('0x5'));var config=require(_0x9359('0x6'));var controller=require(_0x9359('0x7'));router[_0x9359('0x8')]('/',auth[_0x9359('0x9')](),controller[_0x9359('0xa')]);router[_0x9359('0x8')](_0x9359('0xb'),auth[_0x9359('0x9')](),controller['describe']);router[_0x9359('0x8')](_0x9359('0xc'),auth[_0x9359('0x9')](),controller[_0x9359('0xd')]);router[_0x9359('0x8')]('/:id/download',auth[_0x9359('0x9')](),controller['download']);router[_0x9359('0xe')]('/',auth['isAuthenticated'](),controller[_0x9359('0xf')]);router[_0x9359('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x9359('0x11')]);router[_0x9359('0x12')](_0x9359('0xc'),auth[_0x9359('0x9')](),controller[_0x9359('0x13')]);module['exports']=router; \ No newline at end of file +var _0x03ae=['/:id/download','download','post','create','put','/:id','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','index','/describe','describe','show'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x03ae,0x135));var _0xe03a=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x03ae[_0x173441];return _0x2423a8;};'use strict';var multer=require(_0xe03a('0x0'));var util=require(_0xe03a('0x1'));var path=require(_0xe03a('0x2'));var timeout=require(_0xe03a('0x3'));var express=require('express');var router=express[_0xe03a('0x4')]();var fs_extra=require(_0xe03a('0x5'));var auth=require(_0xe03a('0x6'));var interaction=require(_0xe03a('0x7'));var config=require(_0xe03a('0x8'));var controller=require(_0xe03a('0x9'));router[_0xe03a('0xa')]('/',auth[_0xe03a('0xb')](),controller[_0xe03a('0xc')]);router[_0xe03a('0xa')](_0xe03a('0xd'),auth['isAuthenticated'](),controller[_0xe03a('0xe')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xe03a('0xf')]);router[_0xe03a('0xa')](_0xe03a('0x10'),auth[_0xe03a('0xb')](),controller[_0xe03a('0x11')]);router[_0xe03a('0x12')]('/',auth[_0xe03a('0xb')](),controller[_0xe03a('0x13')]);router[_0xe03a('0x14')](_0xe03a('0x15'),auth[_0xe03a('0xb')](),controller[_0xe03a('0x16')]);router[_0xe03a('0x17')](_0xe03a('0x15'),auth[_0xe03a('0xb')](),controller['destroy']);module[_0xe03a('0x18')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index e5d643b..a5bb569 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 _0x3d04=['sequelize','moment','path','../../config/environment','exports','VIRTUAL','getDataValue','value','STRING','setDataValue','INTEGER','subtract','duration','DATE','format','MM-DD-YYYY\x20HH:mm','closedAt','toString','createdAt'];(function(_0x3e21c8,_0x2e53b3){var _0x131399=function(_0xb012eb){while(--_0xb012eb){_0x3e21c8['push'](_0x3e21c8['shift']());}};_0x131399(++_0x2e53b3);}(_0x3d04,0xbe));var _0x43d0=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x3d04[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require(_0x43d0('0x0'));var moment=require(_0x43d0('0x1'));var path=require(_0x43d0('0x2'));var config=require(_0x43d0('0x3'));module[_0x43d0('0x4')]={'format':{'type':Sequelize[_0x43d0('0x5')],'get':function(){return this[_0x43d0('0x6')](_0x43d0('0x7'))?path['extname'](this[_0x43d0('0x6')](_0x43d0('0x7'))):undefined;}},'interactionid':{'type':Sequelize[_0x43d0('0x8')]},'channel':{'type':Sequelize[_0x43d0('0x8')]},'value':{'type':Sequelize['STRING'],'set':function(_0x484271){var _0x50919e=_0x484271['replace'](/\\/g,'/');this[_0x43d0('0x9')](_0x43d0('0x7'),_0x50919e);}},'rating':{'type':Sequelize[_0x43d0('0xa')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x43d0('0xa')],'set':function(_0x44a763){this['setDataValue']('startedAt',moment()[_0x43d0('0xb')](_0x44a763,'ms'));this['setDataValue']('closedAt',moment());this[_0x43d0('0x9')](_0x43d0('0xc'),_0x44a763);}},'startedAt':{'type':Sequelize[_0x43d0('0xd')],'get':function(){return moment(this[_0x43d0('0x6')]('startedAt'))[_0x43d0('0xe')](_0x43d0('0xf'))['toString']();}},'closedAt':{'type':Sequelize[_0x43d0('0xd')],'get':function(){return moment(this[_0x43d0('0x6')](_0x43d0('0x10')))['format'](_0x43d0('0xf'))[_0x43d0('0x11')]();}},'createdAt':{'type':Sequelize[_0x43d0('0xd')],'get':function(){return moment(this['getDataValue'](_0x43d0('0x12')))[_0x43d0('0xe')](_0x43d0('0xf'))[_0x43d0('0x11')]();}},'updatedAt':{'type':Sequelize[_0x43d0('0xd')],'get':function(){return moment(this['getDataValue']('updatedAt'))[_0x43d0('0xe')](_0x43d0('0xf'))[_0x43d0('0x11')]();}}}; \ No newline at end of file +var _0xf1f9=['moment','path','../../config/environment','exports','getDataValue','value','extname','STRING','replace','setDataValue','INTEGER','startedAt','subtract','closedAt','duration','DATE','MM-DD-YYYY\x20HH:mm','format','toString','createdAt','updatedAt','sequelize'];(function(_0x8a7be1,_0xd364c){var _0x29d057=function(_0x5da1cf){while(--_0x5da1cf){_0x8a7be1['push'](_0x8a7be1['shift']());}};_0x29d057(++_0xd364c);}(_0xf1f9,0x1cd));var _0x9f1f=function(_0x5bd1d2,_0x58be8e){_0x5bd1d2=_0x5bd1d2-0x0;var _0x3f5480=_0xf1f9[_0x5bd1d2];return _0x3f5480;};'use strict';var Sequelize=require(_0x9f1f('0x0'));var moment=require(_0x9f1f('0x1'));var path=require(_0x9f1f('0x2'));var config=require(_0x9f1f('0x3'));module[_0x9f1f('0x4')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x9f1f('0x5')](_0x9f1f('0x6'))?path[_0x9f1f('0x7')](this[_0x9f1f('0x5')](_0x9f1f('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0x9f1f('0x8')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize['STRING'],'set':function(_0x363d26){var _0x373b98=_0x363d26[_0x9f1f('0x9')](/\\/g,'/');this[_0x9f1f('0xa')]('value',_0x373b98);}},'rating':{'type':Sequelize[_0x9f1f('0xb')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x9f1f('0xb')],'set':function(_0x3efac2){this[_0x9f1f('0xa')](_0x9f1f('0xc'),moment()[_0x9f1f('0xd')](_0x3efac2,'ms'));this[_0x9f1f('0xa')](_0x9f1f('0xe'),moment());this['setDataValue'](_0x9f1f('0xf'),_0x3efac2);}},'startedAt':{'type':Sequelize[_0x9f1f('0x10')],'get':function(){return moment(this[_0x9f1f('0x5')]('startedAt'))['format'](_0x9f1f('0x11'))['toString']();}},'closedAt':{'type':Sequelize[_0x9f1f('0x10')],'get':function(){return moment(this[_0x9f1f('0x5')](_0x9f1f('0xe')))[_0x9f1f('0x12')](_0x9f1f('0x11'))[_0x9f1f('0x13')]();}},'createdAt':{'type':Sequelize[_0x9f1f('0x10')],'get':function(){return moment(this['getDataValue'](_0x9f1f('0x14')))['format'](_0x9f1f('0x11'))[_0x9f1f('0x13')]();}},'updatedAt':{'type':Sequelize[_0x9f1f('0x10')],'get':function(){return moment(this[_0x9f1f('0x5')](_0x9f1f('0x15')))['format'](_0x9f1f('0x11'))[_0x9f1f('0x13')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 46ab79f..7e39038 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 _0x9a19=['limit','count','set','Content-Range','save','then','destroy','error','stack','name','send','map','ScreenRecording','fieldName','type','key','model','differenceBy','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','update','duration','value','find','describe','download','../../components/encryptor','uniqueid','join','root','format','%s.cypher','existsSync','decryptFile','recording','server/files/screen_recordings','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','isNil','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','info','.cypher','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined'];(function(_0x542d80,_0x150561){var _0x1f4492=function(_0x542215){while(--_0x542215){_0x542d80['push'](_0x542d80['shift']());}};_0x1f4492(++_0x150561);}(_0x9a19,0x114));var _0x99a1=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x9a19[_0x16b9ed];return _0x66b1f8;};'use strict';var emlformat=require(_0x99a1('0x0'));var rimraf=require(_0x99a1('0x1'));var zipdir=require(_0x99a1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x99a1('0x3'));var moment=require(_0x99a1('0x4'));var BPromise=require(_0x99a1('0x5'));var Mustache=require(_0x99a1('0x6'));var util=require(_0x99a1('0x7'));var path=require(_0x99a1('0x8'));var sox=require(_0x99a1('0x9'));var csv=require(_0x99a1('0xa'));var ejs=require(_0x99a1('0xb'));var fs=require('fs');var fs_extra=require(_0x99a1('0xc'));var _=require(_0x99a1('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x99a1('0xe'));var toCsv=require(_0x99a1('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x99a1('0xf'));var authService=require(_0x99a1('0x10'));var qs=require(_0x99a1('0x11'));var as=require(_0x99a1('0x12'));var hardwareService=require(_0x99a1('0x13'));var logger=require('../../config/logger')(_0x99a1('0x14'));var utils=require(_0x99a1('0x15'));var config=require(_0x99a1('0x16'));var licenseUtil=require(_0x99a1('0x17'));var db=require(_0x99a1('0x18'))['db'];function respondWithStatusCode(_0x1bc7aa,_0x2ff655){_0x2ff655=_0x2ff655||0xcc;return function(_0x532f56){if(_0x532f56){return _0x1bc7aa[_0x99a1('0x19')](_0x2ff655);}return _0x1bc7aa[_0x99a1('0x1a')](_0x2ff655)[_0x99a1('0x1b')]();};}function respondWithResult(_0x47815e,_0xe1a1f){_0xe1a1f=_0xe1a1f||0xc8;return function(_0x3c9ef4){if(_0x3c9ef4){return _0x47815e[_0x99a1('0x1a')](_0xe1a1f)['json'](_0x3c9ef4);}};}function respondWithFilteredResult(_0x2d81ed,_0x3e45d4){return function(_0x1bb464){if(_0x1bb464){var _0x3d40cc=typeof _0x3e45d4[_0x99a1('0x1c')]===_0x99a1('0x1d')&&typeof _0x3e45d4[_0x99a1('0x1e')]==='undefined';var _0x4f049c=_0x1bb464[_0x99a1('0x1f')];var _0xbf62f1=_0x3d40cc?0x0:_0x3e45d4[_0x99a1('0x1c')];var _0x1fcd00=_0x3d40cc?_0x1bb464[_0x99a1('0x1f')]:_0x3e45d4[_0x99a1('0x1c')]+_0x3e45d4[_0x99a1('0x1e')];var _0x3cd62c;if(_0x1fcd00>=_0x4f049c){_0x1fcd00=_0x4f049c;_0x3cd62c=0xc8;}else{_0x3cd62c=0xce;}_0x2d81ed[_0x99a1('0x1a')](_0x3cd62c);return _0x2d81ed[_0x99a1('0x20')](_0x99a1('0x21'),_0xbf62f1+'-'+_0x1fcd00+'/'+_0x4f049c)['json'](_0x1bb464);}return null;};}function patchUpdates(_0x3023a1){return function(_0x20007e){try{jsonpatch['apply'](_0x20007e,_0x3023a1,!![]);}catch(_0x38435b){return BPromise['reject'](_0x38435b);}return _0x20007e[_0x99a1('0x22')]();};}function saveUpdates(_0x2927b0,_0x2d6f20){return function(_0x2d3b82){if(_0x2d3b82){return _0x2d3b82['update'](_0x2927b0)[_0x99a1('0x23')](function(_0x1268a7){return _0x1268a7;});}return null;};}function removeEntity(_0x483c17,_0x44df2d){return function(_0x5b5dfa){if(_0x5b5dfa){return _0x5b5dfa[_0x99a1('0x24')]()[_0x99a1('0x23')](function(){_0x483c17[_0x99a1('0x1a')](0xcc)[_0x99a1('0x1b')]();});}};}function handleEntityNotFound(_0x3c813,_0x491341){return function(_0x4fe7f7){if(!_0x4fe7f7){_0x3c813[_0x99a1('0x19')](0x194);}return _0x4fe7f7;};}function handleError(_0x5dabd9,_0x5dc733){_0x5dc733=_0x5dc733||0x1f4;return function(_0xafea84){logger[_0x99a1('0x25')](_0xafea84[_0x99a1('0x26')]);if(_0xafea84[_0x99a1('0x27')]){delete _0xafea84[_0x99a1('0x27')];}_0x5dabd9[_0x99a1('0x1a')](_0x5dc733)[_0x99a1('0x28')](_0xafea84);};}exports['index']=function(_0xf41b0d,_0x499eef){var _0x255197={},_0x1137f2={},_0x26fbae={'count':0x0,'rows':[]};var _0x523668=_[_0x99a1('0x29')](db[_0x99a1('0x2a')]['rawAttributes'],function(_0x37514e){return{'name':_0x37514e[_0x99a1('0x2b')],'type':_0x37514e[_0x99a1('0x2c')][_0x99a1('0x2d')]};});_0x1137f2[_0x99a1('0x2e')]=_[_0x99a1('0x2f')](_[_0x99a1('0x29')](_0x523668,_0x99a1('0x27')),['format']);_0x1137f2['query']=_[_0x99a1('0x30')](_0xf41b0d['query']);_0x1137f2[_0x99a1('0x31')]=_[_0x99a1('0x32')](_0x1137f2['model'],_0x1137f2[_0x99a1('0x33')]);_0x255197[_0x99a1('0x34')]=_[_0x99a1('0x32')](_0x1137f2[_0x99a1('0x2e')],qs[_0x99a1('0x35')](_0xf41b0d[_0x99a1('0x33')][_0x99a1('0x35')]));_0x255197[_0x99a1('0x34')]=_0x255197[_0x99a1('0x34')][_0x99a1('0x36')]?_0x255197[_0x99a1('0x34')]:_0x1137f2[_0x99a1('0x2e')];if(!_0xf41b0d[_0x99a1('0x33')][_0x99a1('0x37')]('nolimit')){_0x255197['limit']=qs[_0x99a1('0x1e')](_0xf41b0d[_0x99a1('0x33')][_0x99a1('0x1e')]);_0x255197[_0x99a1('0x1c')]=qs[_0x99a1('0x1c')](_0xf41b0d[_0x99a1('0x33')][_0x99a1('0x1c')]);}_0x255197['order']=qs[_0x99a1('0x38')](_0xf41b0d[_0x99a1('0x33')]['sort']);_0x255197[_0x99a1('0x39')]=qs[_0x99a1('0x31')](_[_0x99a1('0x3a')](_0xf41b0d[_0x99a1('0x33')],_0x1137f2[_0x99a1('0x31')]),_0x523668);if(_0xf41b0d[_0x99a1('0x33')][_0x99a1('0x3b')]){_0x255197[_0x99a1('0x39')]=_[_0x99a1('0x3c')](_0x255197[_0x99a1('0x39')],{'$or':_[_0x99a1('0x29')](_0x523668,function(_0x152969){if(_0x152969[_0x99a1('0x2c')]!=='VIRTUAL'){var _0x5553e4={};_0x5553e4[_0x152969['name']]={'$like':'%'+_0xf41b0d[_0x99a1('0x33')][_0x99a1('0x3b')]+'%'};return _0x5553e4;}})});}_0x255197=_[_0x99a1('0x3c')]({},_0x255197,_0xf41b0d[_0x99a1('0x3d')]);var _0x40613a={'where':_0x255197['where']};return db[_0x99a1('0x2a')][_0x99a1('0x1f')](_0x40613a)[_0x99a1('0x23')](function(_0x51efe5){_0x26fbae['count']=_0x51efe5;if(_0xf41b0d[_0x99a1('0x33')][_0x99a1('0x3e')]){_0x255197[_0x99a1('0x3f')]=[{'all':!![]}];}return db['ScreenRecording'][_0x99a1('0x40')](_0x255197);})[_0x99a1('0x23')](function(_0x1b5d2d){_0x26fbae[_0x99a1('0x41')]=_0x1b5d2d;return _0x26fbae;})[_0x99a1('0x23')](respondWithFilteredResult(_0x499eef,_0x255197))[_0x99a1('0x42')](handleError(_0x499eef,null));};exports[_0x99a1('0x43')]=function(_0x29d0a0,_0x1c4ce4){var _0x2be9e3={'raw':![],'where':{'id':_0x29d0a0[_0x99a1('0x44')]['id']}},_0x4b40e1={};_0x4b40e1[_0x99a1('0x2e')]=_[_0x99a1('0x30')](db['ScreenRecording'][_0x99a1('0x45')]);_0x4b40e1['query']=_[_0x99a1('0x30')](_0x29d0a0[_0x99a1('0x33')]);_0x4b40e1[_0x99a1('0x31')]=_[_0x99a1('0x32')](_0x4b40e1[_0x99a1('0x2e')],_0x4b40e1[_0x99a1('0x33')]);_0x2be9e3['attributes']=_[_0x99a1('0x32')](_0x4b40e1['model'],qs[_0x99a1('0x35')](_0x29d0a0[_0x99a1('0x33')][_0x99a1('0x35')]));_0x2be9e3[_0x99a1('0x34')]=_0x2be9e3[_0x99a1('0x34')][_0x99a1('0x36')]?_0x2be9e3[_0x99a1('0x34')]:_0x4b40e1[_0x99a1('0x2e')];if(_0x29d0a0[_0x99a1('0x33')][_0x99a1('0x3e')]){_0x2be9e3[_0x99a1('0x3f')]=[{'all':!![]}];}_0x2be9e3=_['merge']({},_0x2be9e3,_0x29d0a0[_0x99a1('0x3d')]);return db[_0x99a1('0x2a')]['find'](_0x2be9e3)[_0x99a1('0x23')](handleEntityNotFound(_0x1c4ce4,null))[_0x99a1('0x23')](respondWithResult(_0x1c4ce4,null))[_0x99a1('0x42')](handleError(_0x1c4ce4,null));};exports[_0x99a1('0x46')]=function(_0x113dd9,_0x254c41){return db[_0x99a1('0x2a')]['create'](_0x113dd9[_0x99a1('0x47')],{})['then'](respondWithResult(_0x254c41,0xc9))[_0x99a1('0x42')](handleError(_0x254c41,null));};exports[_0x99a1('0x48')]=function(_0x566442,_0x5433f2){if(_0x566442[_0x99a1('0x47')]['id']){delete _0x566442[_0x99a1('0x47')]['id'];}delete _0x566442[_0x99a1('0x47')][_0x99a1('0x49')];delete _0x566442[_0x99a1('0x47')]['createdAt'];delete _0x566442['body']['closedAt'];delete _0x566442[_0x99a1('0x47')][_0x99a1('0x4a')];return db[_0x99a1('0x2a')][_0x99a1('0x4b')]({'where':{'id':_0x566442[_0x99a1('0x44')]['id']}})[_0x99a1('0x23')](handleEntityNotFound(_0x5433f2,null))[_0x99a1('0x23')](saveUpdates(_0x566442['body'],null))[_0x99a1('0x23')](respondWithResult(_0x5433f2,null))[_0x99a1('0x42')](handleError(_0x5433f2,null));};exports[_0x99a1('0x4c')]=function(_0x5e877f,_0x81e218){return db['ScreenRecording']['describe']()[_0x99a1('0x23')](respondWithResult(_0x81e218,null))[_0x99a1('0x42')](handleError(_0x81e218,null));};exports[_0x99a1('0x4d')]=function(_0x175f6d,_0x11632d,_0xf8208a){var _0x240d2e=require(_0x99a1('0x4e'));var _0x16641e=![];var _0x53e9eb={};if(_0x175f6d[_0x99a1('0x33')]['type']&&_0x175f6d[_0x99a1('0x33')][_0x99a1('0x2c')]==='uniqueid'){_0x53e9eb[_0x99a1('0x4f')]=_0x175f6d[_0x99a1('0x44')]['id'];}else{_0x53e9eb['id']=_0x175f6d[_0x99a1('0x44')]['id'];}return db[_0x99a1('0x2a')][_0x99a1('0x4b')]({'where':_0x53e9eb,'attributes':['id',_0x99a1('0x4a')],'raw':!![]})[_0x99a1('0x23')](handleEntityNotFound(_0x11632d,null))[_0x99a1('0x23')](function(_0x28ba8f){if(_0x28ba8f){var _0x1c2926=path[_0x99a1('0x50')](config[_0x99a1('0x51')],'server/files/screen_recordings',_0x28ba8f['value']);var _0x2e3e08=util[_0x99a1('0x52')](_0x99a1('0x53'),_0x1c2926);if(fs[_0x99a1('0x54')](_0x2e3e08)){_0x16641e=!![];return _0x240d2e[_0x99a1('0x55')](_0x2e3e08,_0x1c2926,config['secrets'][_0x99a1('0x56')])[_0x99a1('0x23')](function(){return _0x28ba8f;});}return _0x28ba8f;}})['then'](function(_0x6107cd){if(_0x6107cd){var _0x95f20a=path[_0x99a1('0x50')](config[_0x99a1('0x51')],_0x99a1('0x57'),_0x6107cd['value']);if(!fs[_0x99a1('0x54')](_0x95f20a)){throw new db[(_0x99a1('0x58'))][(_0x99a1('0x59'))](_0x99a1('0x5a'));}if(_0x6107cd[_0x99a1('0x5b')]){return _0x11632d[_0x99a1('0x4d')](_0x95f20a,_0x6107cd['filename']+path[_0x99a1('0x5c')](_0x95f20a),function(){if(_0x16641e){fs[_0x99a1('0x5d')](_0x95f20a);}});}else{return _0x11632d['download'](_0x95f20a,function(_0x33feb9){if(_0x16641e){fs[_0x99a1('0x5d')](_0x95f20a);}});}}})[_0x99a1('0x42')](function(_0xb126dd){if(_0xb126dd[_0x99a1('0x5e')]==='ScreenRecording\x20not\x20found'){_0x11632d[_0x99a1('0x1a')](0x194)['send']('Not\x20found');}else{return handleError(_0x11632d,null);}});};exports['destroy']=function(_0x38ce3c,_0x3f7c16){return db['ScreenRecording']['find']({'where':{'id':_0x38ce3c[_0x99a1('0x44')]['id']}})['then'](function(_0x21a5f6){if(_[_0x99a1('0x5f')](_0x21a5f6)){throw new ReferenceError(_0x99a1('0x60'));}return _0x21a5f6;})[_0x99a1('0x23')](function(_0x56d6cf){var _0x18f74b=path[_0x99a1('0x50')](config[_0x99a1('0x51')],'server/files/screen_recordings',_0x56d6cf[_0x99a1('0x4a')]);logger['info'](_0x99a1('0x61'),_0x18f74b);if(!_[_0x99a1('0x5f')](_0x56d6cf[_0x99a1('0x4a')])&&fs[_0x99a1('0x54')](_0x18f74b)){logger[_0x99a1('0x62')]('File:\x20\x22'+_0x18f74b+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x18f74b);}_0x18f74b=_0x18f74b+_0x99a1('0x63');if(!_[_0x99a1('0x5f')](_0x56d6cf['value'])&&fs['existsSync'](_0x18f74b)){logger[_0x99a1('0x62')](_0x99a1('0x64')+_0x18f74b+_0x99a1('0x65'));fs['unlinkSync'](_0x18f74b);}return _0x56d6cf;})['then'](function(_0x2b8df8){if(!_0x2b8df8)throw new InternalError();return _0x2b8df8['destroy']();})[_0x99a1('0x23')](function(){_0x3f7c16[_0x99a1('0x1a')](0xcc)[_0x99a1('0x1b')]();})['catch'](handleError(_0x3f7c16,null));}; \ No newline at end of file +var _0xabce=['sendStatus','error','name','send','index','map','ScreenRecording','rawAttributes','type','model','differenceBy','format','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','where','merge','options','include','rows','includeAll','find','catch','create','body','createdAt','closedAt','value','params','describe','download','../../components/encryptor','uniqueid','%s.cypher','existsSync','decryptFile','recording','join','root','server/files/screen_recordings','Sequelize','ValidationError','ScreenRecording\x20not\x20found','unlink','Not\x20found','destroy','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','count','offset','Content-Range','apply','reject','save','update','then'];(function(_0x35b51c,_0x3e8fe0){var _0x2841a4=function(_0x3d4d51){while(--_0x3d4d51){_0x35b51c['push'](_0x35b51c['shift']());}};_0x2841a4(++_0x3e8fe0);}(_0xabce,0x103));var _0xeabc=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0xabce[_0x55e08b];return _0xd1a7ff;};'use strict';var emlformat=require(_0xeabc('0x0'));var rimraf=require(_0xeabc('0x1'));var zipdir=require(_0xeabc('0x2'));var jsonpatch=require(_0xeabc('0x3'));var rp=require(_0xeabc('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xeabc('0x5'));var util=require(_0xeabc('0x6'));var path=require(_0xeabc('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xeabc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeabc('0x9'));var squel=require('squel');var crypto=require(_0xeabc('0xa'));var jsforce=require(_0xeabc('0xb'));var deskjs=require(_0xeabc('0xc'));var toCsv=require('to-csv');var querystring=require(_0xeabc('0xd'));var Papa=require(_0xeabc('0xe'));var Redis=require(_0xeabc('0xf'));var authService=require(_0xeabc('0x10'));var qs=require(_0xeabc('0x11'));var as=require(_0xeabc('0x12'));var hardwareService=require(_0xeabc('0x13'));var logger=require(_0xeabc('0x14'))(_0xeabc('0x15'));var utils=require(_0xeabc('0x16'));var config=require(_0xeabc('0x17'));var licenseUtil=require(_0xeabc('0x18'));var db=require(_0xeabc('0x19'))['db'];function respondWithStatusCode(_0x3fd0b5,_0x36a92e){_0x36a92e=_0x36a92e||0xcc;return function(_0xcfbf06){if(_0xcfbf06){return _0x3fd0b5['sendStatus'](_0x36a92e);}return _0x3fd0b5[_0xeabc('0x1a')](_0x36a92e)[_0xeabc('0x1b')]();};}function respondWithResult(_0x3251c6,_0x55f0de){_0x55f0de=_0x55f0de||0xc8;return function(_0x5f4ee8){if(_0x5f4ee8){return _0x3251c6[_0xeabc('0x1a')](_0x55f0de)[_0xeabc('0x1c')](_0x5f4ee8);}};}function respondWithFilteredResult(_0x326bac,_0x53d5cb){return function(_0xf913d7){if(_0xf913d7){var _0x638976=typeof _0x53d5cb['offset']==='undefined'&&typeof _0x53d5cb[_0xeabc('0x1d')]==='undefined';var _0x3d0e21=_0xf913d7[_0xeabc('0x1e')];var _0x58a3c0=_0x638976?0x0:_0x53d5cb[_0xeabc('0x1f')];var _0x31dd53=_0x638976?_0xf913d7[_0xeabc('0x1e')]:_0x53d5cb[_0xeabc('0x1f')]+_0x53d5cb[_0xeabc('0x1d')];var _0x5d92e5;if(_0x31dd53>=_0x3d0e21){_0x31dd53=_0x3d0e21;_0x5d92e5=0xc8;}else{_0x5d92e5=0xce;}_0x326bac[_0xeabc('0x1a')](_0x5d92e5);return _0x326bac['set'](_0xeabc('0x20'),_0x58a3c0+'-'+_0x31dd53+'/'+_0x3d0e21)[_0xeabc('0x1c')](_0xf913d7);}return null;};}function patchUpdates(_0x502947){return function(_0x28063a){try{jsonpatch[_0xeabc('0x21')](_0x28063a,_0x502947,!![]);}catch(_0x254590){return BPromise[_0xeabc('0x22')](_0x254590);}return _0x28063a[_0xeabc('0x23')]();};}function saveUpdates(_0x4e99a4,_0xecdbf){return function(_0x10c675){if(_0x10c675){return _0x10c675[_0xeabc('0x24')](_0x4e99a4)['then'](function(_0x457f27){return _0x457f27;});}return null;};}function removeEntity(_0x3854d2,_0x214953){return function(_0x319119){if(_0x319119){return _0x319119['destroy']()[_0xeabc('0x25')](function(){_0x3854d2['status'](0xcc)[_0xeabc('0x1b')]();});}};}function handleEntityNotFound(_0x4d4e29,_0x811f0d){return function(_0x12acbd){if(!_0x12acbd){_0x4d4e29[_0xeabc('0x26')](0x194);}return _0x12acbd;};}function handleError(_0x3f194e,_0x3a1a04){_0x3a1a04=_0x3a1a04||0x1f4;return function(_0x137293){logger[_0xeabc('0x27')](_0x137293['stack']);if(_0x137293['name']){delete _0x137293[_0xeabc('0x28')];}_0x3f194e['status'](_0x3a1a04)[_0xeabc('0x29')](_0x137293);};}exports[_0xeabc('0x2a')]=function(_0x48fb52,_0x2163e6){var _0x38572d={},_0x2b568f={},_0x2f8633={'count':0x0,'rows':[]};var _0x149170=_[_0xeabc('0x2b')](db[_0xeabc('0x2c')][_0xeabc('0x2d')],function(_0x2915c1){return{'name':_0x2915c1['fieldName'],'type':_0x2915c1[_0xeabc('0x2e')]['key']};});_0x2b568f[_0xeabc('0x2f')]=_[_0xeabc('0x30')](_[_0xeabc('0x2b')](_0x149170,_0xeabc('0x28')),[_0xeabc('0x31')]);_0x2b568f[_0xeabc('0x32')]=_[_0xeabc('0x33')](_0x48fb52['query']);_0x2b568f[_0xeabc('0x34')]=_[_0xeabc('0x35')](_0x2b568f[_0xeabc('0x2f')],_0x2b568f['query']);_0x38572d[_0xeabc('0x36')]=_[_0xeabc('0x35')](_0x2b568f[_0xeabc('0x2f')],qs['fields'](_0x48fb52[_0xeabc('0x32')][_0xeabc('0x37')]));_0x38572d[_0xeabc('0x36')]=_0x38572d['attributes'][_0xeabc('0x38')]?_0x38572d[_0xeabc('0x36')]:_0x2b568f['model'];if(!_0x48fb52['query'][_0xeabc('0x39')](_0xeabc('0x3a'))){_0x38572d['limit']=qs[_0xeabc('0x1d')](_0x48fb52[_0xeabc('0x32')][_0xeabc('0x1d')]);_0x38572d[_0xeabc('0x1f')]=qs[_0xeabc('0x1f')](_0x48fb52['query'][_0xeabc('0x1f')]);}_0x38572d['order']=qs[_0xeabc('0x3b')](_0x48fb52[_0xeabc('0x32')][_0xeabc('0x3b')]);_0x38572d['where']=qs['filters'](_[_0xeabc('0x3c')](_0x48fb52['query'],_0x2b568f[_0xeabc('0x34')]),_0x149170);if(_0x48fb52['query']['filter']){_0x38572d['where']=_['merge'](_0x38572d[_0xeabc('0x3d')],{'$or':_['map'](_0x149170,function(_0x257fe8){if(_0x257fe8[_0xeabc('0x2e')]!=='VIRTUAL'){var _0xe8fa6e={};_0xe8fa6e[_0x257fe8['name']]={'$like':'%'+_0x48fb52[_0xeabc('0x32')]['filter']+'%'};return _0xe8fa6e;}})});}_0x38572d=_[_0xeabc('0x3e')]({},_0x38572d,_0x48fb52[_0xeabc('0x3f')]);var _0xeeef02={'where':_0x38572d['where']};return db['ScreenRecording']['count'](_0xeeef02)[_0xeabc('0x25')](function(_0x23fb33){_0x2f8633[_0xeabc('0x1e')]=_0x23fb33;if(_0x48fb52['query']['includeAll']){_0x38572d[_0xeabc('0x40')]=[{'all':!![]}];}return db[_0xeabc('0x2c')]['findAll'](_0x38572d);})[_0xeabc('0x25')](function(_0x5e0b78){_0x2f8633[_0xeabc('0x41')]=_0x5e0b78;return _0x2f8633;})['then'](respondWithFilteredResult(_0x2163e6,_0x38572d))['catch'](handleError(_0x2163e6,null));};exports['show']=function(_0x25958b,_0x37c926){var _0xd03226={'raw':![],'where':{'id':_0x25958b['params']['id']}},_0x3eeeb5={};_0x3eeeb5[_0xeabc('0x2f')]=_['keys'](db[_0xeabc('0x2c')][_0xeabc('0x2d')]);_0x3eeeb5[_0xeabc('0x32')]=_[_0xeabc('0x33')](_0x25958b[_0xeabc('0x32')]);_0x3eeeb5['filters']=_['intersection'](_0x3eeeb5[_0xeabc('0x2f')],_0x3eeeb5['query']);_0xd03226[_0xeabc('0x36')]=_[_0xeabc('0x35')](_0x3eeeb5['model'],qs[_0xeabc('0x37')](_0x25958b[_0xeabc('0x32')][_0xeabc('0x37')]));_0xd03226[_0xeabc('0x36')]=_0xd03226[_0xeabc('0x36')][_0xeabc('0x38')]?_0xd03226[_0xeabc('0x36')]:_0x3eeeb5['model'];if(_0x25958b[_0xeabc('0x32')][_0xeabc('0x42')]){_0xd03226[_0xeabc('0x40')]=[{'all':!![]}];}_0xd03226=_[_0xeabc('0x3e')]({},_0xd03226,_0x25958b[_0xeabc('0x3f')]);return db[_0xeabc('0x2c')][_0xeabc('0x43')](_0xd03226)[_0xeabc('0x25')](handleEntityNotFound(_0x37c926,null))[_0xeabc('0x25')](respondWithResult(_0x37c926,null))[_0xeabc('0x44')](handleError(_0x37c926,null));};exports['create']=function(_0x38356c,_0x2e6efb){return db[_0xeabc('0x2c')][_0xeabc('0x45')](_0x38356c[_0xeabc('0x46')],{})[_0xeabc('0x25')](respondWithResult(_0x2e6efb,0xc9))[_0xeabc('0x44')](handleError(_0x2e6efb,null));};exports['update']=function(_0x766743,_0x32e09b){if(_0x766743[_0xeabc('0x46')]['id']){delete _0x766743[_0xeabc('0x46')]['id'];}delete _0x766743[_0xeabc('0x46')]['duration'];delete _0x766743[_0xeabc('0x46')][_0xeabc('0x47')];delete _0x766743[_0xeabc('0x46')][_0xeabc('0x48')];delete _0x766743['body'][_0xeabc('0x49')];return db[_0xeabc('0x2c')]['find']({'where':{'id':_0x766743[_0xeabc('0x4a')]['id']}})['then'](handleEntityNotFound(_0x32e09b,null))[_0xeabc('0x25')](saveUpdates(_0x766743['body'],null))[_0xeabc('0x25')](respondWithResult(_0x32e09b,null))[_0xeabc('0x44')](handleError(_0x32e09b,null));};exports[_0xeabc('0x4b')]=function(_0x1524c3,_0x1ee837){return db[_0xeabc('0x2c')][_0xeabc('0x4b')]()[_0xeabc('0x25')](respondWithResult(_0x1ee837,null))[_0xeabc('0x44')](handleError(_0x1ee837,null));};exports[_0xeabc('0x4c')]=function(_0x48a13f,_0x180a14,_0x2537ab){var _0x4072cb=require(_0xeabc('0x4d'));var _0x555d6b=![];var _0x1cef45={};if(_0x48a13f[_0xeabc('0x32')][_0xeabc('0x2e')]&&_0x48a13f[_0xeabc('0x32')]['type']===_0xeabc('0x4e')){_0x1cef45[_0xeabc('0x4e')]=_0x48a13f[_0xeabc('0x4a')]['id'];}else{_0x1cef45['id']=_0x48a13f[_0xeabc('0x4a')]['id'];}return db[_0xeabc('0x2c')][_0xeabc('0x43')]({'where':_0x1cef45,'attributes':['id',_0xeabc('0x49')],'raw':!![]})[_0xeabc('0x25')](handleEntityNotFound(_0x180a14,null))[_0xeabc('0x25')](function(_0x58ab08){if(_0x58ab08){var _0x4546c4=path['join'](config['root'],'server/files/screen_recordings',_0x58ab08[_0xeabc('0x49')]);var _0x8d4cca=util[_0xeabc('0x31')](_0xeabc('0x4f'),_0x4546c4);if(fs[_0xeabc('0x50')](_0x8d4cca)){_0x555d6b=!![];return _0x4072cb[_0xeabc('0x51')](_0x8d4cca,_0x4546c4,config['secrets'][_0xeabc('0x52')])[_0xeabc('0x25')](function(){return _0x58ab08;});}return _0x58ab08;}})[_0xeabc('0x25')](function(_0x104c1e){if(_0x104c1e){var _0x2ddc53=path[_0xeabc('0x53')](config[_0xeabc('0x54')],_0xeabc('0x55'),_0x104c1e['value']);if(!fs['existsSync'](_0x2ddc53)){throw new db[(_0xeabc('0x56'))][(_0xeabc('0x57'))](_0xeabc('0x58'));}if(_0x104c1e['filename']){return _0x180a14[_0xeabc('0x4c')](_0x2ddc53,_0x104c1e['filename']+path['extname'](_0x2ddc53),function(){if(_0x555d6b){fs[_0xeabc('0x59')](_0x2ddc53);}});}else{return _0x180a14[_0xeabc('0x4c')](_0x2ddc53,function(_0x13f04f){if(_0x555d6b){fs[_0xeabc('0x59')](_0x2ddc53);}});}}})[_0xeabc('0x44')](function(_0xc2ef0c){if(_0xc2ef0c['message']===_0xeabc('0x58')){_0x180a14[_0xeabc('0x1a')](0x194)[_0xeabc('0x29')](_0xeabc('0x5a'));}else{return handleError(_0x180a14,null);}});};exports[_0xeabc('0x5b')]=function(_0x514787,_0x5c61b4){return db[_0xeabc('0x2c')][_0xeabc('0x43')]({'where':{'id':_0x514787[_0xeabc('0x4a')]['id']}})[_0xeabc('0x25')](function(_0x1b61a8){if(_[_0xeabc('0x5c')](_0x1b61a8)){throw new ReferenceError(_0xeabc('0x5d'));}return _0x1b61a8;})[_0xeabc('0x25')](function(_0x3f829b){var _0x54d2b3=path[_0xeabc('0x53')](config['root'],_0xeabc('0x55'),_0x3f829b[_0xeabc('0x49')]);logger[_0xeabc('0x5e')](_0xeabc('0x5f'),_0x54d2b3);if(!_[_0xeabc('0x5c')](_0x3f829b[_0xeabc('0x49')])&&fs[_0xeabc('0x50')](_0x54d2b3)){logger[_0xeabc('0x5e')](_0xeabc('0x60')+_0x54d2b3+_0xeabc('0x61'));fs['unlinkSync'](_0x54d2b3);}_0x54d2b3=_0x54d2b3+_0xeabc('0x62');if(!_[_0xeabc('0x5c')](_0x3f829b[_0xeabc('0x49')])&&fs[_0xeabc('0x50')](_0x54d2b3)){logger['info'](_0xeabc('0x60')+_0x54d2b3+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x54d2b3);}return _0x3f829b;})[_0xeabc('0x25')](function(_0x11bc62){if(!_0x11bc62)throw new InternalError();return _0x11bc62[_0xeabc('0x5b')]();})[_0xeabc('0x25')](function(){_0x5c61b4['status'](0xcc)['end']();})[_0xeabc('0x44')](handleError(_0x5c61b4,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 4cc6bd2..d20912f 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 _0x272a=['./screenRecording.attributes','exports','ScreenRecording','screen_recordings','interactionid','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3d5fa0,_0x3c966a){var _0xd84696=function(_0x1f1e0a){while(--_0x1f1e0a){_0x3d5fa0['push'](_0x3d5fa0['shift']());}};_0xd84696(++_0x3c966a);}(_0x272a,0xef));var _0xa272=function(_0x2aedd1,_0x1c21c5){_0x2aedd1=_0x2aedd1-0x0;var _0x53d33f=_0x272a[_0x2aedd1];return _0x53d33f;};'use strict';var _=require(_0xa272('0x0'));var util=require(_0xa272('0x1'));var logger=require('../../config/logger')(_0xa272('0x2'));var moment=require(_0xa272('0x3'));var BPromise=require(_0xa272('0x4'));var rp=require(_0xa272('0x5'));var fs=require('fs');var path=require(_0xa272('0x6'));var rimraf=require(_0xa272('0x7'));var config=require('../../config/environment');var attributes=require(_0xa272('0x8'));module[_0xa272('0x9')]=function(_0x5e4bb3,_0x32496d){return _0x5e4bb3['define'](_0xa272('0xa'),attributes,{'tableName':_0xa272('0xb'),'paranoid':![],'indexes':[{'name':_0xa272('0xc'),'fields':[_0xa272('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf9c7=['path','../../config/environment','./screenRecording.attributes','exports','define','ScreenRecording','interactionid','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x19e928,_0x26a0e4){var _0x4e941f=function(_0x52a5cd){while(--_0x52a5cd){_0x19e928['push'](_0x19e928['shift']());}};_0x4e941f(++_0x26a0e4);}(_0xf9c7,0x173));var _0x7f9c=function(_0x310302,_0x425fd4){_0x310302=_0x310302-0x0;var _0x8c5d17=_0xf9c7[_0x310302];return _0x8c5d17;};'use strict';var _=require(_0x7f9c('0x0'));var util=require('util');var logger=require(_0x7f9c('0x1'))(_0x7f9c('0x2'));var moment=require(_0x7f9c('0x3'));var BPromise=require(_0x7f9c('0x4'));var rp=require(_0x7f9c('0x5'));var fs=require('fs');var path=require(_0x7f9c('0x6'));var rimraf=require('rimraf');var config=require(_0x7f9c('0x7'));var attributes=require(_0x7f9c('0x8'));module[_0x7f9c('0x9')]=function(_0x43af23,_0x25865e){return _0x43af23[_0x7f9c('0xa')](_0x7f9c('0xb'),attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':'interactionid','fields':[_0x7f9c('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 8b7290f..1c6c4a2 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 _0x81d6=['bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','error','ScreenRecording,\x20%s,\x20%s','message','result','catch','lodash','util','moment'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x81d6,0xad));var _0x681d=function(_0x9a184f,_0x5dc1e8){_0x9a184f=_0x9a184f-0x0;var _0x5ed401=_0x81d6[_0x9a184f];return _0x5ed401;};'use strict';var _=require(_0x681d('0x0'));var util=require(_0x681d('0x1'));var moment=require(_0x681d('0x2'));var BPromise=require(_0x681d('0x3'));var rs=require(_0x681d('0x4'));var fs=require('fs');var Redis=require(_0x681d('0x5'));var db=require(_0x681d('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x681d('0x7'));var config=require(_0x681d('0x8'));var jayson=require(_0x681d('0x9'));var client=jayson[_0x681d('0xa')][_0x681d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3cd96b,_0x31f8f1,_0x2fce61){return new BPromise(function(_0x3b7bc0,_0x2fcbff){return client[_0x681d('0xc')](_0x3cd96b,_0x2fce61)[_0x681d('0xd')](function(_0xcc0bc2){logger[_0x681d('0xe')]('ScreenRecording,\x20%s,\x20%s',_0x31f8f1,_0x681d('0xf'));logger[_0x681d('0x10')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x31f8f1,_0x681d('0xf'),JSON['stringify'](_0xcc0bc2));if(_0xcc0bc2['error']){if(_0xcc0bc2[_0x681d('0x11')]['code']===0x1f4){logger[_0x681d('0x11')](_0x681d('0x12'),_0x31f8f1,_0xcc0bc2[_0x681d('0x11')]['message']);return _0x2fcbff(_0xcc0bc2[_0x681d('0x11')][_0x681d('0x13')]);}logger[_0x681d('0x11')](_0x681d('0x12'),_0x31f8f1,_0xcc0bc2[_0x681d('0x11')][_0x681d('0x13')]);return _0x3b7bc0(_0xcc0bc2[_0x681d('0x11')][_0x681d('0x13')]);}else{logger[_0x681d('0xe')](_0x681d('0x12'),_0x31f8f1,_0x681d('0xf'));_0x3b7bc0(_0xcc0bc2[_0x681d('0x14')][_0x681d('0x13')]);}})[_0x681d('0x15')](function(_0x52e1d9){logger[_0x681d('0x11')](_0x681d('0x12'),_0x31f8f1,_0x52e1d9);_0x2fcbff(_0x52e1d9);});});} \ No newline at end of file +var _0x1368=['stringify','error','code','ScreenRecording,\x20%s,\x20%s','message','info','catch','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1368,0x8b));var _0x8136=function(_0x485514,_0x17778a){_0x485514=_0x485514-0x0;var _0x16dc27=_0x1368[_0x485514];return _0x16dc27;};'use strict';var _=require(_0x8136('0x0'));var util=require('util');var moment=require(_0x8136('0x1'));var BPromise=require('bluebird');var rs=require(_0x8136('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8136('0x3'))['db'];var utils=require(_0x8136('0x4'));var logger=require(_0x8136('0x5'))(_0x8136('0x6'));var config=require('../../config/environment');var jayson=require(_0x8136('0x7'));var client=jayson[_0x8136('0x8')][_0x8136('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5f39ae,_0x4a842f,_0x485afc){return new BPromise(function(_0x1fc94e,_0x3b89bd){return client[_0x8136('0xa')](_0x5f39ae,_0x485afc)[_0x8136('0xb')](function(_0x5591b5){logger['info']('ScreenRecording,\x20%s,\x20%s',_0x4a842f,_0x8136('0xc'));logger[_0x8136('0xd')](_0x8136('0xe'),_0x4a842f,_0x8136('0xc'),JSON[_0x8136('0xf')](_0x5591b5));if(_0x5591b5[_0x8136('0x10')]){if(_0x5591b5[_0x8136('0x10')][_0x8136('0x11')]===0x1f4){logger[_0x8136('0x10')](_0x8136('0x12'),_0x4a842f,_0x5591b5[_0x8136('0x10')][_0x8136('0x13')]);return _0x3b89bd(_0x5591b5[_0x8136('0x10')]['message']);}logger[_0x8136('0x10')]('ScreenRecording,\x20%s,\x20%s',_0x4a842f,_0x5591b5[_0x8136('0x10')][_0x8136('0x13')]);return _0x1fc94e(_0x5591b5[_0x8136('0x10')][_0x8136('0x13')]);}else{logger[_0x8136('0x14')]('ScreenRecording,\x20%s,\x20%s',_0x4a842f,_0x8136('0xc'));_0x1fc94e(_0x5591b5['result']['message']);}})[_0x8136('0x15')](function(_0x1779bc){logger[_0x8136('0x10')](_0x8136('0x12'),_0x4a842f,_0x1779bc);_0x3b89bd(_0x1779bc);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 9edc2f3..f7a077c 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 _0x0986=['getFavicon','diskStorage','join','root','server/files/images/logos/','format','single','file','addLogo','%s%s','logologin','extname','originalname','post','addLogoLogin','preferred','/:id/preferred','addPreferred','addFavicon','put','/:id','update','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','/now','getDate','show','/:id/logo','/:id/logo_login','getLogoLogin','gdpr','/:id/favicon'];(function(_0x5ee039,_0x120e85){var _0x5eaf53=function(_0x1994e1){while(--_0x1994e1){_0x5ee039['push'](_0x5ee039['shift']());}};_0x5eaf53(++_0x120e85);}(_0x0986,0x1bb));var _0x6098=function(_0x4f81bc,_0xde6714){_0x4f81bc=_0x4f81bc-0x0;var _0x16a08a=_0x0986[_0x4f81bc];return _0x16a08a;};'use strict';var multer=require(_0x6098('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6098('0x1'));var express=require(_0x6098('0x2'));var router=express[_0x6098('0x3')]();var fs_extra=require(_0x6098('0x4'));var auth=require(_0x6098('0x5'));var interaction=require(_0x6098('0x6'));var config=require(_0x6098('0x7'));var controller=require(_0x6098('0x8'));router[_0x6098('0x9')]('/',auth[_0x6098('0xa')](),controller['index']);router[_0x6098('0x9')](_0x6098('0xb'),controller[_0x6098('0xc')]);router[_0x6098('0x9')]('/:id',controller[_0x6098('0xd')]);router[_0x6098('0x9')](_0x6098('0xe'),controller['getLogo']);router[_0x6098('0x9')](_0x6098('0xf'),controller[_0x6098('0x10')]);router['get']('/:id/gdpr',controller[_0x6098('0x11')]);router[_0x6098('0x9')]('/:id/preferred',controller['getPreferred']);router[_0x6098('0x9')](_0x6098('0x12'),controller[_0x6098('0x13')]);var upload=multer({'storage':multer[_0x6098('0x14')]({'destination':function(_0x182c46,_0x7988d6,_0x100627){_0x100627(null,path[_0x6098('0x15')](config[_0x6098('0x16')],_0x6098('0x17')));},'filename':function(_0x25ed4f,_0x4490c6,_0x50d511){_0x50d511(null,util[_0x6098('0x18')]('%s%s','logo',path['extname'](_0x4490c6['originalname'])));}})});router['post'](_0x6098('0xe'),upload[_0x6098('0x19')](_0x6098('0x1a')),controller[_0x6098('0x1b')]);var upload=multer({'storage':multer[_0x6098('0x14')]({'destination':function(_0x2cc0f8,_0x273f7c,_0x117c06){_0x117c06(null,path['join'](config[_0x6098('0x16')],_0x6098('0x17')));},'filename':function(_0x47b3d6,_0x41884e,_0x32014b){_0x32014b(null,util[_0x6098('0x18')](_0x6098('0x1c'),_0x6098('0x1d'),path[_0x6098('0x1e')](_0x41884e[_0x6098('0x1f')])));}})});router[_0x6098('0x20')](_0x6098('0xf'),upload[_0x6098('0x19')]('file'),controller[_0x6098('0x21')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5cbf9c,_0x45d103,_0x379122){_0x379122(null,path['join'](config[_0x6098('0x16')],'server/files/images/logos/'));},'filename':function(_0x4d98dd,_0x483a19,_0x1423b9){_0x1423b9(null,util[_0x6098('0x18')](_0x6098('0x1c'),_0x6098('0x22'),path[_0x6098('0x1e')](_0x483a19['originalname'])));}})});router[_0x6098('0x20')](_0x6098('0x23'),upload[_0x6098('0x19')]('file'),controller[_0x6098('0x24')]);var upload=multer({'storage':multer[_0x6098('0x14')]({'destination':function(_0xf15ac1,_0x398999,_0x37de97){_0x37de97(null,path[_0x6098('0x15')](config['root'],_0x6098('0x17')));},'filename':function(_0x2836e2,_0x215717,_0x3d7ae4){_0x3d7ae4(null,util[_0x6098('0x18')]('%s%s','favicon',path[_0x6098('0x1e')](_0x215717[_0x6098('0x1f')])));}})});router[_0x6098('0x20')]('/:id/favicon',upload[_0x6098('0x19')](_0x6098('0x1a')),controller[_0x6098('0x25')]);router[_0x6098('0x26')](_0x6098('0x27'),auth[_0x6098('0xa')](),controller[_0x6098('0x28')]);module[_0x6098('0x29')]=router; \ No newline at end of file +var _0x20d7=['extname','originalname','post','single','file','root','logologin','addLogoLogin','join','preferred','/:id/preferred','favicon','put','update','multer','util','connect-timeout','express','Router','./setting.controller','get','isAuthenticated','index','getDate','/:id','show','/:id/logo','/:id/logo_login','getLogoLogin','gdpr','/:id/favicon','getFavicon','diskStorage','server/files/images/logos/','format','%s%s','logo'];(function(_0x1343c3,_0x5e8727){var _0x4e60a0=function(_0x4a8f8c){while(--_0x4a8f8c){_0x1343c3['push'](_0x1343c3['shift']());}};_0x4e60a0(++_0x5e8727);}(_0x20d7,0x1ca));var _0x720d=function(_0x40067f,_0x10b863){_0x40067f=_0x40067f-0x0;var _0x356b48=_0x20d7[_0x40067f];return _0x356b48;};'use strict';var multer=require(_0x720d('0x0'));var util=require(_0x720d('0x1'));var path=require('path');var timeout=require(_0x720d('0x2'));var express=require(_0x720d('0x3'));var router=express[_0x720d('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x720d('0x5'));router[_0x720d('0x6')]('/',auth[_0x720d('0x7')](),controller[_0x720d('0x8')]);router['get']('/now',controller[_0x720d('0x9')]);router['get'](_0x720d('0xa'),controller[_0x720d('0xb')]);router[_0x720d('0x6')](_0x720d('0xc'),controller['getLogo']);router[_0x720d('0x6')](_0x720d('0xd'),controller[_0x720d('0xe')]);router[_0x720d('0x6')]('/:id/gdpr',controller[_0x720d('0xf')]);router['get']('/:id/preferred',controller['getPreferred']);router['get'](_0x720d('0x10'),controller[_0x720d('0x11')]);var upload=multer({'storage':multer[_0x720d('0x12')]({'destination':function(_0x7f048c,_0x49685e,_0x50b32d){_0x50b32d(null,path['join'](config['root'],_0x720d('0x13')));},'filename':function(_0x3ea2b0,_0xab677f,_0x3f9faf){_0x3f9faf(null,util[_0x720d('0x14')](_0x720d('0x15'),_0x720d('0x16'),path[_0x720d('0x17')](_0xab677f[_0x720d('0x18')])));}})});router[_0x720d('0x19')](_0x720d('0xc'),upload[_0x720d('0x1a')](_0x720d('0x1b')),controller['addLogo']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xf9ff2,_0x193d6e,_0x6609f9){_0x6609f9(null,path['join'](config[_0x720d('0x1c')],'server/files/images/logos/'));},'filename':function(_0x49a359,_0x7d588b,_0x31a81f){_0x31a81f(null,util[_0x720d('0x14')](_0x720d('0x15'),_0x720d('0x1d'),path['extname'](_0x7d588b[_0x720d('0x18')])));}})});router['post'](_0x720d('0xd'),upload[_0x720d('0x1a')]('file'),controller[_0x720d('0x1e')]);var upload=multer({'storage':multer[_0x720d('0x12')]({'destination':function(_0x4b5005,_0x6a4939,_0x297066){_0x297066(null,path[_0x720d('0x1f')](config['root'],_0x720d('0x13')));},'filename':function(_0x1704fc,_0x1524ca,_0x440a13){_0x440a13(null,util['format'](_0x720d('0x15'),_0x720d('0x20'),path['extname'](_0x1524ca[_0x720d('0x18')])));}})});router[_0x720d('0x19')](_0x720d('0x21'),upload[_0x720d('0x1a')](_0x720d('0x1b')),controller['addPreferred']);var upload=multer({'storage':multer[_0x720d('0x12')]({'destination':function(_0x5e9f8b,_0x3f40f5,_0x9e0a96){_0x9e0a96(null,path[_0x720d('0x1f')](config[_0x720d('0x1c')],'server/files/images/logos/'));},'filename':function(_0x45b0f3,_0x189cc6,_0x506802){_0x506802(null,util['format']('%s%s',_0x720d('0x22'),path[_0x720d('0x17')](_0x189cc6['originalname'])));}})});router[_0x720d('0x19')](_0x720d('0x10'),upload[_0x720d('0x1a')](_0x720d('0x1b')),controller['addFavicon']);router[_0x720d('0x23')](_0x720d('0xa'),auth[_0x720d('0x7')](),controller[_0x720d('0x24')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index e89096f..21adc1a 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 _0xdb28=['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','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xdb28,0x106));var _0x8db2=function(_0x3329cf,_0x4e0b7e){_0x3329cf=_0x3329cf-0x0;var _0x44e008=_0xdb28[_0x3329cf];return _0x44e008;};'use strict';var Sequelize=require(_0x8db2('0x0'));module[_0x8db2('0x1')]={'min_internal':{'type':Sequelize[_0x8db2('0x2')](0xb),'unique':_0x8db2('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x8db2('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x8db2('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x8db2('0x5')],'defaultValue':_0x8db2('0x6')},'logo':{'type':Sequelize[_0x8db2('0x5')]},'defaultLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x8db2('0x5')]},'defaultLoginLogo':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize['STRING']},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x8db2('0x5')]},'turnaddr':{'type':Sequelize[_0x8db2('0x5')]},'turnusername':{'type':Sequelize[_0x8db2('0x5')]},'turnpassword':{'type':Sequelize[_0x8db2('0x5')]},'pageTitle':{'type':Sequelize[_0x8db2('0x5')]},'defaultPageTitle':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x8db2('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':_0x8db2('0x8')},'enableEmailPreview':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x8db2('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x8db2('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x8db2('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x8db2('0x5')],'defaultValue':_0x8db2('0x9')},'chatTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x8db2('0x5')]},'defaultPreferred':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x8db2('0x5')]},'allowedLoginAttempts':{'type':Sequelize[_0x8db2('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x8db2('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x8db2('0x5')]},'defaultFavicon':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x8db2('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x8db2('0x2')]},'transcribeRegion':{'type':Sequelize[_0x8db2('0x5')]},'sentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x8db2('0x2')]},'sentimentRegion':{'type':Sequelize[_0x8db2('0x5')]},'language':{'type':Sequelize[_0x8db2('0x5')]},'bucket':{'type':Sequelize[_0x8db2('0x5')]},'googleSsoEnabled':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize['INTEGER'](0x2)[_0x8db2('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x8db2('0x2')](0x2)[_0x8db2('0xa')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x8db2('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x8db2('0x2')](0x2)[_0x8db2('0xa')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x8db2('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x8db2('0x2')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x8db2('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0x8db2('0x2')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':![]}}; \ No newline at end of file +var _0xadb5=['https://www.xcally.com/bar/phonebar/autoupdater.xml','UNSIGNED','exports','min_internal','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN'];(function(_0x3aeb36,_0x312dc9){var _0xa2ef21=function(_0x50a46b){while(--_0x50a46b){_0x3aeb36['push'](_0x3aeb36['shift']());}};_0xa2ef21(++_0x312dc9);}(_0xadb5,0xad));var _0x5adb=function(_0x3e2ea6,_0x47eb42){_0x3e2ea6=_0x3e2ea6-0x0;var _0x43b804=_0xadb5[_0x3e2ea6];return _0x43b804;};'use strict';var Sequelize=require('sequelize');module[_0x5adb('0x0')]={'min_internal':{'type':Sequelize['INTEGER'](0xb),'unique':_0x5adb('0x1'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x5adb('0x2')](0xb),'unique':_0x5adb('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x5adb('0x4')],'defaultValue':_0x5adb('0x5')},'logo':{'type':Sequelize[_0x5adb('0x4')]},'defaultLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x5adb('0x4')]},'defaultLoginLogo':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x5adb('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x5adb('0x4')]},'turnaddr':{'type':Sequelize[_0x5adb('0x4')]},'turnusername':{'type':Sequelize[_0x5adb('0x4')]},'turnpassword':{'type':Sequelize[_0x5adb('0x4')]},'pageTitle':{'type':Sequelize[_0x5adb('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x5adb('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':_0x5adb('0x7')},'enableEmailPreview':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x5adb('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x5adb('0x4')],'defaultValue':'alternate'},'chatTimeout':{'type':Sequelize[_0x5adb('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x5adb('0x4')]},'defaultPreferred':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x5adb('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x5adb('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x5adb('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x5adb('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x5adb('0x2')]},'transcribeRegion':{'type':Sequelize[_0x5adb('0x4')]},'sentiment':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x5adb('0x2')]},'sentimentRegion':{'type':Sequelize[_0x5adb('0x4')]},'language':{'type':Sequelize['STRING']},'bucket':{'type':Sequelize[_0x5adb('0x4')]},'googleSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize['INTEGER'](0x2)[_0x5adb('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x5adb('0x2')](0x2)[_0x5adb('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x5adb('0x2')](0x2)[_0x5adb('0x8')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x5adb('0x2')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0x5adb('0x2')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index 27def57..0175245 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 _0x0b1a=['defaultLogo','defaultLoginLogo','defaultPreferred','default_loginLogo.svg','gdpr','securePassword','getPreferred','default_preferred.png','addFavicon','defaultFavicon','default_favicon.ico','getDate','utcOffset','now','YYYY-MM-DD\x20HH:mm:ss:SSS','send','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','update','then','destroy','end','name','index','Setting','rawAttributes','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','keys','options','find','body','params','addLogo','file','filename','logo','addLogoLogin','loginLogo','getLogo','server/files/images/logos','getLicense','preferred','favicon','existsSync','join','root','toLower','default_logo.svg','default','upperFirst','custom','Sequelize','ValidationError','\x20not\x20found','download','getLogoLogin'];(function(_0xe4c530,_0x4a01b0){var _0x365a05=function(_0x58f8df){while(--_0x58f8df){_0xe4c530['push'](_0xe4c530['shift']());}};_0x365a05(++_0x4a01b0);}(_0x0b1a,0x10c));var _0xa0b1=function(_0x134468,_0x3c5956){_0x134468=_0x134468-0x0;var _0x3d6658=_0x0b1a[_0x134468];return _0x3d6658;};'use strict';var emlformat=require(_0xa0b1('0x0'));var rimraf=require(_0xa0b1('0x1'));var zipdir=require(_0xa0b1('0x2'));var jsonpatch=require(_0xa0b1('0x3'));var rp=require(_0xa0b1('0x4'));var moment=require(_0xa0b1('0x5'));var BPromise=require(_0xa0b1('0x6'));var Mustache=require(_0xa0b1('0x7'));var util=require(_0xa0b1('0x8'));var path=require(_0xa0b1('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa0b1('0xa'));var fs=require('fs');var fs_extra=require(_0xa0b1('0xb'));var _=require(_0xa0b1('0xc'));var squel=require(_0xa0b1('0xd'));var crypto=require(_0xa0b1('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa0b1('0xf'));var querystring=require(_0xa0b1('0x10'));var Papa=require('papaparse');var Redis=require(_0xa0b1('0x11'));var authService=require(_0xa0b1('0x12'));var qs=require(_0xa0b1('0x13'));var as=require(_0xa0b1('0x14'));var hardwareService=require(_0xa0b1('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xa0b1('0x16'));var config=require(_0xa0b1('0x17'));var licenseUtil=require(_0xa0b1('0x18'));var db=require(_0xa0b1('0x19'))['db'];var jayson=require(_0xa0b1('0x1a'));var client=jayson[_0xa0b1('0x1b')][_0xa0b1('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x561521,_0x438a43,_0xa30880,_0x49691b){return new BPromise(function(_0x212c83,_0x547bda){var _0x131cb8=_0x49691b||client;return _0x131cb8[_0xa0b1('0x1d')](_0x561521,_0xa30880)['then'](function(_0x45e2fe){logger['info'](_0xa0b1('0x1e'),_0x438a43,_0xa0b1('0x1f'));logger[_0xa0b1('0x20')](_0xa0b1('0x21'),_0x438a43,_0xa0b1('0x1f'),JSON[_0xa0b1('0x22')](_0x45e2fe));if(_0x45e2fe[_0xa0b1('0x23')]){if(_0x45e2fe[_0xa0b1('0x23')][_0xa0b1('0x24')]===0x1f4){logger[_0xa0b1('0x23')](_0xa0b1('0x1e'),_0x438a43,_0x45e2fe[_0xa0b1('0x23')][_0xa0b1('0x25')]);return _0x547bda(_0x45e2fe[_0xa0b1('0x23')][_0xa0b1('0x25')]);}logger[_0xa0b1('0x23')](_0xa0b1('0x1e'),_0x438a43,_0x45e2fe[_0xa0b1('0x23')][_0xa0b1('0x25')]);return _0x212c83(_0x45e2fe[_0xa0b1('0x23')][_0xa0b1('0x25')]);}else{logger[_0xa0b1('0x26')](_0xa0b1('0x1e'),_0x438a43,_0xa0b1('0x1f'));_0x212c83(_0x45e2fe[_0xa0b1('0x27')][_0xa0b1('0x25')]);}})['catch'](function(_0x36a9dd){logger['error']('Setting,\x20%s,\x20%s',_0x438a43,_0x36a9dd);_0x547bda(_0x36a9dd);});});}function respondWithStatusCode(_0xe7c73c,_0x4198c7){_0x4198c7=_0x4198c7||0xcc;return function(_0x18c523){if(_0x18c523){return _0xe7c73c[_0xa0b1('0x28')](_0x4198c7);}return _0xe7c73c[_0xa0b1('0x29')](_0x4198c7)['end']();};}function respondWithResult(_0x59e8e2,_0x5451c6){_0x5451c6=_0x5451c6||0xc8;return function(_0x5ac90d){if(_0x5ac90d){return _0x59e8e2['status'](_0x5451c6)[_0xa0b1('0x2a')](_0x5ac90d);}};}function respondWithFilteredResult(_0x2c76f8,_0x4af13b){return function(_0x2ede08){if(_0x2ede08){var _0xf1fc1=typeof _0x4af13b['offset']===_0xa0b1('0x2b')&&typeof _0x4af13b[_0xa0b1('0x2c')]===_0xa0b1('0x2b');var _0x493eb1=_0x2ede08[_0xa0b1('0x2d')];var _0x1b7fa2=_0xf1fc1?0x0:_0x4af13b[_0xa0b1('0x2e')];var _0x212a8d=_0xf1fc1?_0x2ede08['count']:_0x4af13b['offset']+_0x4af13b['limit'];var _0x45b1d3;if(_0x212a8d>=_0x493eb1){_0x212a8d=_0x493eb1;_0x45b1d3=0xc8;}else{_0x45b1d3=0xce;}_0x2c76f8[_0xa0b1('0x29')](_0x45b1d3);return _0x2c76f8[_0xa0b1('0x2f')](_0xa0b1('0x30'),_0x1b7fa2+'-'+_0x212a8d+'/'+_0x493eb1)['json'](_0x2ede08);}return null;};}function patchUpdates(_0x21e099){return function(_0x4b2155){try{jsonpatch[_0xa0b1('0x31')](_0x4b2155,_0x21e099,!![]);}catch(_0x4eeb87){return BPromise['reject'](_0x4eeb87);}return _0x4b2155['save']();};}function saveUpdates(_0x160848,_0x5342fc){return function(_0x2ceeea){if(_0x2ceeea){return _0x2ceeea[_0xa0b1('0x32')](_0x160848)[_0xa0b1('0x33')](function(_0x5c1a47){return _0x5c1a47;});}return null;};}function removeEntity(_0x28c418,_0x46aa49){return function(_0x43a984){if(_0x43a984){return _0x43a984[_0xa0b1('0x34')]()['then'](function(){_0x28c418[_0xa0b1('0x29')](0xcc)[_0xa0b1('0x35')]();});}};}function handleEntityNotFound(_0x185583,_0x307130){return function(_0x3fd03b){if(!_0x3fd03b){_0x185583['sendStatus'](0x194);}return _0x3fd03b;};}function handleError(_0x1b6761,_0x3b6334){_0x3b6334=_0x3b6334||0x1f4;return function(_0x2fe6c6){logger[_0xa0b1('0x23')](_0x2fe6c6['stack']);if(_0x2fe6c6[_0xa0b1('0x36')]){delete _0x2fe6c6['name'];}_0x1b6761[_0xa0b1('0x29')](_0x3b6334)['send'](_0x2fe6c6);};}exports[_0xa0b1('0x37')]=function(_0x162e83,_0x98d2ae){var _0x18b787={},_0x2968eb={},_0x3ee941={'count':0x0,'rows':[]};var _0x220321=_['map'](db[_0xa0b1('0x38')][_0xa0b1('0x39')],function(_0x48a578){return{'name':_0x48a578[_0xa0b1('0x3a')],'type':_0x48a578[_0xa0b1('0x3b')]['key']};});_0x2968eb[_0xa0b1('0x3c')]=_[_0xa0b1('0x3d')](_0x220321,_0xa0b1('0x36'));_0x2968eb[_0xa0b1('0x3e')]=_['keys'](_0x162e83[_0xa0b1('0x3e')]);_0x2968eb[_0xa0b1('0x3f')]=_[_0xa0b1('0x40')](_0x2968eb['model'],_0x2968eb[_0xa0b1('0x3e')]);_0x18b787[_0xa0b1('0x41')]=_['intersection'](_0x2968eb[_0xa0b1('0x3c')],qs[_0xa0b1('0x42')](_0x162e83['query']['fields']));_0x18b787[_0xa0b1('0x41')]=_0x18b787[_0xa0b1('0x41')][_0xa0b1('0x43')]?_0x18b787[_0xa0b1('0x41')]:_0x2968eb[_0xa0b1('0x3c')];if(!_0x162e83[_0xa0b1('0x3e')][_0xa0b1('0x44')](_0xa0b1('0x45'))){_0x18b787[_0xa0b1('0x2c')]=qs[_0xa0b1('0x2c')](_0x162e83[_0xa0b1('0x3e')][_0xa0b1('0x2c')]);_0x18b787['offset']=qs[_0xa0b1('0x2e')](_0x162e83[_0xa0b1('0x3e')][_0xa0b1('0x2e')]);}_0x18b787[_0xa0b1('0x46')]=qs[_0xa0b1('0x47')](_0x162e83['query'][_0xa0b1('0x47')]);_0x18b787[_0xa0b1('0x48')]=qs['filters'](_[_0xa0b1('0x49')](_0x162e83[_0xa0b1('0x3e')],_0x2968eb[_0xa0b1('0x3f')]),_0x220321);if(_0x162e83[_0xa0b1('0x3e')][_0xa0b1('0x4a')]){_0x18b787[_0xa0b1('0x48')]=_['merge'](_0x18b787['where'],{'$or':_[_0xa0b1('0x3d')](_0x220321,function(_0x3e73a6){if(_0x3e73a6[_0xa0b1('0x3b')]!=='VIRTUAL'){var _0x2a64c6={};_0x2a64c6[_0x3e73a6['name']]={'$like':'%'+_0x162e83['query']['filter']+'%'};return _0x2a64c6;}})});}_0x18b787=_[_0xa0b1('0x4b')]({},_0x18b787,_0x162e83['options']);var _0x219b02={'where':_0x18b787[_0xa0b1('0x48')]};return db[_0xa0b1('0x38')][_0xa0b1('0x2d')](_0x219b02)[_0xa0b1('0x33')](function(_0x175286){_0x3ee941[_0xa0b1('0x2d')]=_0x175286;if(_0x162e83[_0xa0b1('0x3e')][_0xa0b1('0x4c')]){_0x18b787[_0xa0b1('0x4d')]=[{'all':!![]}];}return db[_0xa0b1('0x38')][_0xa0b1('0x4e')](_0x18b787);})[_0xa0b1('0x33')](function(_0x265e10){_0x3ee941[_0xa0b1('0x4f')]=_0x265e10;return _0x3ee941;})[_0xa0b1('0x33')](respondWithFilteredResult(_0x98d2ae,_0x18b787))[_0xa0b1('0x50')](handleError(_0x98d2ae,null));};exports['show']=function(_0x478928,_0x5c1584){var _0xd67e9={'raw':![],'where':{'id':_0x478928['params']['id']}},_0xf1e4ce={};_0xf1e4ce['model']=_[_0xa0b1('0x51')](db['Setting'][_0xa0b1('0x39')]);_0xf1e4ce[_0xa0b1('0x3e')]=_[_0xa0b1('0x51')](_0x478928[_0xa0b1('0x3e')]);_0xf1e4ce[_0xa0b1('0x3f')]=_[_0xa0b1('0x40')](_0xf1e4ce[_0xa0b1('0x3c')],_0xf1e4ce['query']);_0xd67e9[_0xa0b1('0x41')]=_[_0xa0b1('0x40')](_0xf1e4ce[_0xa0b1('0x3c')],qs['fields'](_0x478928['query'][_0xa0b1('0x42')]));_0xd67e9[_0xa0b1('0x41')]=_0xd67e9[_0xa0b1('0x41')][_0xa0b1('0x43')]?_0xd67e9[_0xa0b1('0x41')]:_0xf1e4ce['model'];if(_0x478928[_0xa0b1('0x3e')][_0xa0b1('0x4c')]){_0xd67e9['include']=[{'all':!![]}];}_0xd67e9=_[_0xa0b1('0x4b')]({},_0xd67e9,_0x478928[_0xa0b1('0x52')]);return db['Setting'][_0xa0b1('0x53')](_0xd67e9)[_0xa0b1('0x33')](handleEntityNotFound(_0x5c1584,null))['then'](respondWithResult(_0x5c1584,null))[_0xa0b1('0x50')](handleError(_0x5c1584,null));};exports[_0xa0b1('0x32')]=function(_0xc09a15,_0x6fccc9){if(_0xc09a15[_0xa0b1('0x54')]['id']){delete _0xc09a15[_0xa0b1('0x54')]['id'];}return db['Setting'][_0xa0b1('0x53')]({'where':{'id':_0xc09a15[_0xa0b1('0x55')]['id']}})[_0xa0b1('0x33')](handleEntityNotFound(_0x6fccc9,null))[_0xa0b1('0x33')](saveUpdates(_0xc09a15[_0xa0b1('0x54')],null))[_0xa0b1('0x33')](respondWithResult(_0x6fccc9,null))[_0xa0b1('0x50')](handleError(_0x6fccc9,null));};exports[_0xa0b1('0x56')]=function(_0x1ed172,_0x205c0f,_0x1a5bf3){if(_0x1ed172['file']&&_0x1ed172[_0xa0b1('0x57')][_0xa0b1('0x58')]){_0x1ed172[_0xa0b1('0x54')][_0xa0b1('0x59')]=_0x1ed172['file'][_0xa0b1('0x58')];}return db[_0xa0b1('0x38')][_0xa0b1('0x53')]({'where':{'id':_0x1ed172[_0xa0b1('0x55')]['id']}})[_0xa0b1('0x33')](handleEntityNotFound(_0x205c0f,null))['then'](saveUpdates(_0x1ed172[_0xa0b1('0x54')],null))['then'](respondWithResult(_0x205c0f,null))[_0xa0b1('0x50')](handleError(_0x205c0f,null));};exports[_0xa0b1('0x5a')]=function(_0x1d1df2,_0x4f2b9a,_0x8d9937){if(_0x1d1df2[_0xa0b1('0x57')]&&_0x1d1df2[_0xa0b1('0x57')][_0xa0b1('0x58')]){_0x1d1df2[_0xa0b1('0x54')][_0xa0b1('0x5b')]=_0x1d1df2[_0xa0b1('0x57')][_0xa0b1('0x58')];}return db[_0xa0b1('0x38')][_0xa0b1('0x53')]({'where':{'id':_0x1d1df2[_0xa0b1('0x55')]['id']}})[_0xa0b1('0x33')](handleEntityNotFound(_0x4f2b9a,null))['then'](saveUpdates(_0x1d1df2['body'],null))['then'](respondWithResult(_0x4f2b9a,null))[_0xa0b1('0x50')](handleError(_0x4f2b9a,null));};var utilLicense=require(_0xa0b1('0x18'));exports[_0xa0b1('0x5c')]=function(_0x1b1f6a,_0x51d686,_0x303d96){var _0x13849a=_0xa0b1('0x5d');var _0x4217d1={'custom':![]};return utilLicense[_0xa0b1('0x5e')]()[_0xa0b1('0x33')](function(_0x30efd2){if(_0x30efd2){_0x4217d1=_0x30efd2;}return db[_0xa0b1('0x38')][_0xa0b1('0x53')]({'where':{'id':_0x1b1f6a['params']['id']},'attributes':[_0xa0b1('0x59'),'loginLogo',_0xa0b1('0x5f'),_0xa0b1('0x60'),'defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon'],'raw':!![]});})[_0xa0b1('0x33')](handleEntityNotFound(_0x51d686,null))[_0xa0b1('0x33')](function(_0x498539){if(_0x498539){var _0x285ab0=_0x498539[_0xa0b1('0x59')]&&fs[_0xa0b1('0x61')](path[_0xa0b1('0x62')](config[_0xa0b1('0x63')],_0x13849a,_[_0xa0b1('0x64')](_0x498539[_0xa0b1('0x59')])))?path[_0xa0b1('0x62')](config['root'],_0x13849a,_[_0xa0b1('0x64')](_0x498539['logo'])):path['join'](config[_0xa0b1('0x63')],_0x13849a,_['toLower'](_0xa0b1('0x65')));var _0x3d96e0=_0xa0b1('0x66')+_[_0xa0b1('0x67')](_0xa0b1('0x59'));if(_0x498539[_0x3d96e0]||!_0x4217d1[_0xa0b1('0x68')]){_0x285ab0=path['join'](config[_0xa0b1('0x63')],_0x13849a,_[_0xa0b1('0x64')](_0xa0b1('0x65')));}if(!fs[_0xa0b1('0x61')](_0x285ab0)){throw new db[(_0xa0b1('0x69'))][(_0xa0b1('0x6a'))](_['upperFirst']('logo')+_0xa0b1('0x6b'));}return _0x51d686[_0xa0b1('0x6c')](_0x285ab0);}})[_0xa0b1('0x50')](handleError(_0x51d686,null));};var utilLicense=require(_0xa0b1('0x18'));exports[_0xa0b1('0x6d')]=function(_0x1b0480,_0x3f9e0e,_0x53051f){var _0x249f3c=_0xa0b1('0x5d');var _0x129662={'custom':![]};return utilLicense[_0xa0b1('0x5e')]()[_0xa0b1('0x33')](function(_0x187558){if(_0x187558){_0x129662=_0x187558;}return db[_0xa0b1('0x38')][_0xa0b1('0x53')]({'where':{'id':_0x1b0480[_0xa0b1('0x55')]['id']},'attributes':[_0xa0b1('0x59'),_0xa0b1('0x5b'),_0xa0b1('0x5f'),_0xa0b1('0x60'),_0xa0b1('0x6e'),_0xa0b1('0x6f'),_0xa0b1('0x70'),'defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x3f9e0e,null))[_0xa0b1('0x33')](function(_0x42af3c){if(_0x42af3c){var _0x32fa03=_0x42af3c[_0xa0b1('0x5b')]&&fs[_0xa0b1('0x61')](path[_0xa0b1('0x62')](config[_0xa0b1('0x63')],_0x249f3c,_[_0xa0b1('0x64')](_0x42af3c['loginLogo'])))?path[_0xa0b1('0x62')](config[_0xa0b1('0x63')],_0x249f3c,_[_0xa0b1('0x64')](_0x42af3c[_0xa0b1('0x5b')])):path[_0xa0b1('0x62')](config[_0xa0b1('0x63')],_0x249f3c,_['toLower'](_0xa0b1('0x71')));var _0x425bb2=_0xa0b1('0x66')+_['upperFirst'](_0xa0b1('0x5b'));if(_0x42af3c[_0x425bb2]||!_0x129662[_0xa0b1('0x68')]){_0x32fa03=path[_0xa0b1('0x62')](config['root'],_0x249f3c,_[_0xa0b1('0x64')]('default_loginLogo.svg'));}if(!fs[_0xa0b1('0x61')](_0x32fa03)){throw new db['Sequelize'][(_0xa0b1('0x6a'))](_[_0xa0b1('0x67')]('loginLogo')+_0xa0b1('0x6b'));}return _0x3f9e0e['download'](_0x32fa03);}})[_0xa0b1('0x50')](handleError(_0x3f9e0e,null));};exports[_0xa0b1('0x72')]=function(_0x4ef178,_0x1e8f4e){return db[_0xa0b1('0x38')][_0xa0b1('0x53')]({'where':{'id':_0x4ef178[_0xa0b1('0x55')]['id']},'attributes':[_0xa0b1('0x73')]})['then'](respondWithResult(_0x1e8f4e,null))[_0xa0b1('0x50')](handleError(_0x1e8f4e,null));};exports['addPreferred']=function(_0x5afd99,_0x5d10cc,_0x3ec2a0){if(_0x5afd99['file']&&_0x5afd99[_0xa0b1('0x57')]['filename']){_0x5afd99[_0xa0b1('0x54')][_0xa0b1('0x5f')]=_0x5afd99[_0xa0b1('0x57')][_0xa0b1('0x58')];}return db[_0xa0b1('0x38')][_0xa0b1('0x53')]({'where':{'id':_0x5afd99[_0xa0b1('0x55')]['id']}})[_0xa0b1('0x33')](handleEntityNotFound(_0x5d10cc,null))[_0xa0b1('0x33')](saveUpdates(_0x5afd99[_0xa0b1('0x54')],null))['then'](respondWithResult(_0x5d10cc,null))[_0xa0b1('0x50')](handleError(_0x5d10cc,null));};var utilLicense=require(_0xa0b1('0x18'));exports[_0xa0b1('0x74')]=function(_0x2f918a,_0x2cccf6,_0x1a1442){var _0x4fb3a2=_0xa0b1('0x5d');var _0x11f30e={'custom':![]};return utilLicense[_0xa0b1('0x5e')]()[_0xa0b1('0x33')](function(_0x97e82a){if(_0x97e82a){_0x11f30e=_0x97e82a;}return db[_0xa0b1('0x38')][_0xa0b1('0x53')]({'where':{'id':_0x2f918a['params']['id']},'attributes':['logo','loginLogo',_0xa0b1('0x5f'),_0xa0b1('0x60'),_0xa0b1('0x6e'),'defaultLoginLogo',_0xa0b1('0x70'),'defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x2cccf6,null))[_0xa0b1('0x33')](function(_0x47a4b6){if(_0x47a4b6){var _0x203deb=_0x47a4b6[_0xa0b1('0x5f')]&&fs[_0xa0b1('0x61')](path[_0xa0b1('0x62')](config['root'],_0x4fb3a2,_[_0xa0b1('0x64')](_0x47a4b6['preferred'])))?path[_0xa0b1('0x62')](config[_0xa0b1('0x63')],_0x4fb3a2,_[_0xa0b1('0x64')](_0x47a4b6[_0xa0b1('0x5f')])):path[_0xa0b1('0x62')](config[_0xa0b1('0x63')],_0x4fb3a2,_['toLower'](_0xa0b1('0x75')));var _0x217b82=_0xa0b1('0x66')+_[_0xa0b1('0x67')](_0xa0b1('0x5f'));if(_0x47a4b6[_0x217b82]||!_0x11f30e[_0xa0b1('0x68')]||!_0x11f30e['preferred']){_0x203deb=path['join'](config[_0xa0b1('0x63')],_0x4fb3a2,_[_0xa0b1('0x64')]('default_preferred.png'));}if(!fs[_0xa0b1('0x61')](_0x203deb)){throw new db[(_0xa0b1('0x69'))]['ValidationError'](_['upperFirst'](_0xa0b1('0x5f'))+_0xa0b1('0x6b'));}return _0x2cccf6['download'](_0x203deb);}})[_0xa0b1('0x50')](handleError(_0x2cccf6,null));};exports[_0xa0b1('0x76')]=function(_0x44ab01,_0x39dbc9,_0xbacf20){if(_0x44ab01[_0xa0b1('0x57')]&&_0x44ab01[_0xa0b1('0x57')][_0xa0b1('0x58')]){_0x44ab01[_0xa0b1('0x54')][_0xa0b1('0x60')]=_0x44ab01[_0xa0b1('0x57')][_0xa0b1('0x58')];}return db[_0xa0b1('0x38')][_0xa0b1('0x53')]({'where':{'id':_0x44ab01[_0xa0b1('0x55')]['id']}})['then'](handleEntityNotFound(_0x39dbc9,null))[_0xa0b1('0x33')](saveUpdates(_0x44ab01['body'],null))[_0xa0b1('0x33')](respondWithResult(_0x39dbc9,null))[_0xa0b1('0x50')](handleError(_0x39dbc9,null));};var utilLicense=require(_0xa0b1('0x18'));exports['getFavicon']=function(_0x5df929,_0x3335f6,_0x2ff011){var _0x4fd46f=_0xa0b1('0x5d');var _0x5a67c3={'custom':![]};return utilLicense[_0xa0b1('0x5e')]()[_0xa0b1('0x33')](function(_0x256cbd){if(_0x256cbd){_0x5a67c3=_0x256cbd;}return db['Setting'][_0xa0b1('0x53')]({'where':{'id':_0x5df929[_0xa0b1('0x55')]['id']},'attributes':[_0xa0b1('0x59'),_0xa0b1('0x5b'),'preferred',_0xa0b1('0x60'),_0xa0b1('0x6e'),_0xa0b1('0x6f'),'defaultPreferred',_0xa0b1('0x77')],'raw':!![]});})[_0xa0b1('0x33')](handleEntityNotFound(_0x3335f6,null))['then'](function(_0x5dc577){if(_0x5dc577){var _0x105450=_0x5dc577['favicon']&&fs[_0xa0b1('0x61')](path[_0xa0b1('0x62')](config[_0xa0b1('0x63')],_0x4fd46f,_[_0xa0b1('0x64')](_0x5dc577['favicon'])))?path[_0xa0b1('0x62')](config[_0xa0b1('0x63')],_0x4fd46f,_['toLower'](_0x5dc577[_0xa0b1('0x60')])):path[_0xa0b1('0x62')](config[_0xa0b1('0x63')],_0x4fd46f,_[_0xa0b1('0x64')]('default_favicon.ico'));var _0x27f37b='default'+_['upperFirst'](_0xa0b1('0x60'));if(_0x5dc577[_0x27f37b]||!_0x5a67c3[_0xa0b1('0x68')]){_0x105450=path[_0xa0b1('0x62')](config[_0xa0b1('0x63')],_0x4fd46f,_['toLower'](_0xa0b1('0x78')));}if(!fs['existsSync'](_0x105450)){throw new db['Sequelize'][(_0xa0b1('0x6a'))](_['upperFirst'](_0xa0b1('0x60'))+_0xa0b1('0x6b'));}return _0x3335f6[_0xa0b1('0x6c')](_0x105450);}})[_0xa0b1('0x50')](handleError(_0x3335f6,null));};exports[_0xa0b1('0x79')]=function(_0x1af717,_0x10b97a){var _0x1b8deb={'offset':moment()[_0xa0b1('0x7a')]()};_0x1b8deb[_0xa0b1('0x7b')]=moment()[_0xa0b1('0x7a')](_0x1b8deb[_0xa0b1('0x2e')])['format'](_0xa0b1('0x7c'));return _0x10b97a[_0xa0b1('0x29')](0xc8)[_0xa0b1('0x7d')](_0x1b8deb);}; \ No newline at end of file +var _0xd83c=['favicon','defaultLogo','defaultLoginLogo','defaultFavicon','existsSync','join','root','toLower','default_logo.svg','upperFirst','custom','Sequelize','ValidationError','\x20not\x20found','download','getLogoLogin','preferred','defaultPreferred','default_loginLogo.svg','gdpr','securePassword','addPreferred','addFavicon','getFavicon','default','default_favicon.ico','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','client','http','request','then','info','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','Setting','includeAll','include','rows','show','params','find','body','addLogo','file','filename','logo','addLogoLogin','loginLogo','getLogo','server/files/images/logos','getLicense'];(function(_0x3bd792,_0x171a3e){var _0x405c0f=function(_0x3c2cae){while(--_0x3c2cae){_0x3bd792['push'](_0x3bd792['shift']());}};_0x405c0f(++_0x171a3e);}(_0xd83c,0x1a5));var _0xcd83=function(_0x183256,_0x1a596d){_0x183256=_0x183256-0x0;var _0x5394a2=_0xd83c[_0x183256];return _0x5394a2;};'use strict';var emlformat=require(_0xcd83('0x0'));var rimraf=require(_0xcd83('0x1'));var zipdir=require(_0xcd83('0x2'));var jsonpatch=require(_0xcd83('0x3'));var rp=require(_0xcd83('0x4'));var moment=require('moment');var BPromise=require(_0xcd83('0x5'));var Mustache=require(_0xcd83('0x6'));var util=require(_0xcd83('0x7'));var path=require(_0xcd83('0x8'));var sox=require(_0xcd83('0x9'));var csv=require(_0xcd83('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcd83('0xb'));var squel=require(_0xcd83('0xc'));var crypto=require(_0xcd83('0xd'));var jsforce=require(_0xcd83('0xe'));var deskjs=require(_0xcd83('0xf'));var toCsv=require(_0xcd83('0xa'));var querystring=require(_0xcd83('0x10'));var Papa=require(_0xcd83('0x11'));var Redis=require(_0xcd83('0x12'));var authService=require(_0xcd83('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xcd83('0x14'));var hardwareService=require(_0xcd83('0x15'));var logger=require(_0xcd83('0x16'))(_0xcd83('0x17'));var utils=require(_0xcd83('0x18'));var config=require(_0xcd83('0x19'));var licenseUtil=require(_0xcd83('0x1a'));var db=require(_0xcd83('0x1b'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xcd83('0x1c')][_0xcd83('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x4e502d,_0x11462a,_0x77ae07,_0x30ed90){return new BPromise(function(_0x1d4263,_0x3355ae){var _0x8b973c=_0x30ed90||client;return _0x8b973c[_0xcd83('0x1e')](_0x4e502d,_0x77ae07)[_0xcd83('0x1f')](function(_0x1fca39){logger[_0xcd83('0x20')](_0xcd83('0x21'),_0x11462a,'request\x20sent');logger[_0xcd83('0x22')](_0xcd83('0x23'),_0x11462a,_0xcd83('0x24'),JSON[_0xcd83('0x25')](_0x1fca39));if(_0x1fca39[_0xcd83('0x26')]){if(_0x1fca39[_0xcd83('0x26')]['code']===0x1f4){logger[_0xcd83('0x26')](_0xcd83('0x21'),_0x11462a,_0x1fca39[_0xcd83('0x26')][_0xcd83('0x27')]);return _0x3355ae(_0x1fca39['error']['message']);}logger[_0xcd83('0x26')](_0xcd83('0x21'),_0x11462a,_0x1fca39[_0xcd83('0x26')][_0xcd83('0x27')]);return _0x1d4263(_0x1fca39[_0xcd83('0x26')][_0xcd83('0x27')]);}else{logger[_0xcd83('0x20')](_0xcd83('0x21'),_0x11462a,'request\x20sent');_0x1d4263(_0x1fca39['result'][_0xcd83('0x27')]);}})[_0xcd83('0x28')](function(_0x4971d9){logger[_0xcd83('0x26')]('Setting,\x20%s,\x20%s',_0x11462a,_0x4971d9);_0x3355ae(_0x4971d9);});});}function respondWithStatusCode(_0x2b1766,_0xeda5b1){_0xeda5b1=_0xeda5b1||0xcc;return function(_0x5a3fd8){if(_0x5a3fd8){return _0x2b1766[_0xcd83('0x29')](_0xeda5b1);}return _0x2b1766[_0xcd83('0x2a')](_0xeda5b1)[_0xcd83('0x2b')]();};}function respondWithResult(_0x8e728e,_0x3fd68c){_0x3fd68c=_0x3fd68c||0xc8;return function(_0x19e5cc){if(_0x19e5cc){return _0x8e728e['status'](_0x3fd68c)['json'](_0x19e5cc);}};}function respondWithFilteredResult(_0x3f7c25,_0x14f0b5){return function(_0x3d56ee){if(_0x3d56ee){var _0x9f8590=typeof _0x14f0b5[_0xcd83('0x2c')]===_0xcd83('0x2d')&&typeof _0x14f0b5['limit']===_0xcd83('0x2d');var _0x2225c6=_0x3d56ee[_0xcd83('0x2e')];var _0x568a5d=_0x9f8590?0x0:_0x14f0b5[_0xcd83('0x2c')];var _0x2c2c40=_0x9f8590?_0x3d56ee['count']:_0x14f0b5['offset']+_0x14f0b5[_0xcd83('0x2f')];var _0xb6bb28;if(_0x2c2c40>=_0x2225c6){_0x2c2c40=_0x2225c6;_0xb6bb28=0xc8;}else{_0xb6bb28=0xce;}_0x3f7c25[_0xcd83('0x2a')](_0xb6bb28);return _0x3f7c25[_0xcd83('0x30')](_0xcd83('0x31'),_0x568a5d+'-'+_0x2c2c40+'/'+_0x2225c6)[_0xcd83('0x32')](_0x3d56ee);}return null;};}function patchUpdates(_0x2ae180){return function(_0x2ffb19){try{jsonpatch[_0xcd83('0x33')](_0x2ffb19,_0x2ae180,!![]);}catch(_0x53efde){return BPromise[_0xcd83('0x34')](_0x53efde);}return _0x2ffb19[_0xcd83('0x35')]();};}function saveUpdates(_0x2c18ba,_0x4c7317){return function(_0x204a90){if(_0x204a90){return _0x204a90[_0xcd83('0x36')](_0x2c18ba)[_0xcd83('0x1f')](function(_0xb70d91){return _0xb70d91;});}return null;};}function removeEntity(_0x196c57,_0x1d4e66){return function(_0x5a0c7a){if(_0x5a0c7a){return _0x5a0c7a[_0xcd83('0x37')]()['then'](function(){_0x196c57[_0xcd83('0x2a')](0xcc)[_0xcd83('0x2b')]();});}};}function handleEntityNotFound(_0x323acc,_0x331aea){return function(_0xd6c562){if(!_0xd6c562){_0x323acc[_0xcd83('0x29')](0x194);}return _0xd6c562;};}function handleError(_0x157b8e,_0x1b55a9){_0x1b55a9=_0x1b55a9||0x1f4;return function(_0x248909){logger[_0xcd83('0x26')](_0x248909[_0xcd83('0x38')]);if(_0x248909[_0xcd83('0x39')]){delete _0x248909[_0xcd83('0x39')];}_0x157b8e[_0xcd83('0x2a')](_0x1b55a9)[_0xcd83('0x3a')](_0x248909);};}exports[_0xcd83('0x3b')]=function(_0x56cd5e,_0x119fbb){var _0x318e3d={},_0x56dd43={},_0x3903d8={'count':0x0,'rows':[]};var _0x461780=_[_0xcd83('0x3c')](db['Setting'][_0xcd83('0x3d')],function(_0x2e6c0b){return{'name':_0x2e6c0b[_0xcd83('0x3e')],'type':_0x2e6c0b[_0xcd83('0x3f')][_0xcd83('0x40')]};});_0x56dd43[_0xcd83('0x41')]=_[_0xcd83('0x3c')](_0x461780,_0xcd83('0x39'));_0x56dd43['query']=_[_0xcd83('0x42')](_0x56cd5e['query']);_0x56dd43[_0xcd83('0x43')]=_[_0xcd83('0x44')](_0x56dd43['model'],_0x56dd43[_0xcd83('0x45')]);_0x318e3d[_0xcd83('0x46')]=_[_0xcd83('0x44')](_0x56dd43[_0xcd83('0x41')],qs['fields'](_0x56cd5e['query'][_0xcd83('0x47')]));_0x318e3d[_0xcd83('0x46')]=_0x318e3d[_0xcd83('0x46')][_0xcd83('0x48')]?_0x318e3d[_0xcd83('0x46')]:_0x56dd43[_0xcd83('0x41')];if(!_0x56cd5e[_0xcd83('0x45')][_0xcd83('0x49')](_0xcd83('0x4a'))){_0x318e3d['limit']=qs['limit'](_0x56cd5e[_0xcd83('0x45')][_0xcd83('0x2f')]);_0x318e3d['offset']=qs[_0xcd83('0x2c')](_0x56cd5e[_0xcd83('0x45')][_0xcd83('0x2c')]);}_0x318e3d[_0xcd83('0x4b')]=qs['sort'](_0x56cd5e[_0xcd83('0x45')][_0xcd83('0x4c')]);_0x318e3d[_0xcd83('0x4d')]=qs['filters'](_[_0xcd83('0x4e')](_0x56cd5e['query'],_0x56dd43['filters']),_0x461780);if(_0x56cd5e[_0xcd83('0x45')][_0xcd83('0x4f')]){_0x318e3d['where']=_[_0xcd83('0x50')](_0x318e3d[_0xcd83('0x4d')],{'$or':_[_0xcd83('0x3c')](_0x461780,function(_0x1252c7){if(_0x1252c7['type']!=='VIRTUAL'){var _0x9ccc6={};_0x9ccc6[_0x1252c7['name']]={'$like':'%'+_0x56cd5e['query'][_0xcd83('0x4f')]+'%'};return _0x9ccc6;}})});}_0x318e3d=_['merge']({},_0x318e3d,_0x56cd5e[_0xcd83('0x51')]);var _0x3b9e4d={'where':_0x318e3d[_0xcd83('0x4d')]};return db[_0xcd83('0x52')][_0xcd83('0x2e')](_0x3b9e4d)[_0xcd83('0x1f')](function(_0x3fb1d7){_0x3903d8[_0xcd83('0x2e')]=_0x3fb1d7;if(_0x56cd5e['query'][_0xcd83('0x53')]){_0x318e3d[_0xcd83('0x54')]=[{'all':!![]}];}return db[_0xcd83('0x52')]['findAll'](_0x318e3d);})[_0xcd83('0x1f')](function(_0x15856c){_0x3903d8[_0xcd83('0x55')]=_0x15856c;return _0x3903d8;})[_0xcd83('0x1f')](respondWithFilteredResult(_0x119fbb,_0x318e3d))[_0xcd83('0x28')](handleError(_0x119fbb,null));};exports[_0xcd83('0x56')]=function(_0x5adb88,_0x20e6c8){var _0x18af3a={'raw':![],'where':{'id':_0x5adb88[_0xcd83('0x57')]['id']}},_0x3311b1={};_0x3311b1[_0xcd83('0x41')]=_['keys'](db['Setting'][_0xcd83('0x3d')]);_0x3311b1['query']=_[_0xcd83('0x42')](_0x5adb88[_0xcd83('0x45')]);_0x3311b1[_0xcd83('0x43')]=_[_0xcd83('0x44')](_0x3311b1[_0xcd83('0x41')],_0x3311b1[_0xcd83('0x45')]);_0x18af3a[_0xcd83('0x46')]=_[_0xcd83('0x44')](_0x3311b1[_0xcd83('0x41')],qs[_0xcd83('0x47')](_0x5adb88[_0xcd83('0x45')]['fields']));_0x18af3a[_0xcd83('0x46')]=_0x18af3a[_0xcd83('0x46')][_0xcd83('0x48')]?_0x18af3a[_0xcd83('0x46')]:_0x3311b1[_0xcd83('0x41')];if(_0x5adb88['query'][_0xcd83('0x53')]){_0x18af3a[_0xcd83('0x54')]=[{'all':!![]}];}_0x18af3a=_[_0xcd83('0x50')]({},_0x18af3a,_0x5adb88[_0xcd83('0x51')]);return db[_0xcd83('0x52')][_0xcd83('0x58')](_0x18af3a)[_0xcd83('0x1f')](handleEntityNotFound(_0x20e6c8,null))[_0xcd83('0x1f')](respondWithResult(_0x20e6c8,null))['catch'](handleError(_0x20e6c8,null));};exports[_0xcd83('0x36')]=function(_0xd18c51,_0xa5be2){if(_0xd18c51[_0xcd83('0x59')]['id']){delete _0xd18c51['body']['id'];}return db['Setting']['find']({'where':{'id':_0xd18c51[_0xcd83('0x57')]['id']}})[_0xcd83('0x1f')](handleEntityNotFound(_0xa5be2,null))[_0xcd83('0x1f')](saveUpdates(_0xd18c51['body'],null))[_0xcd83('0x1f')](respondWithResult(_0xa5be2,null))[_0xcd83('0x28')](handleError(_0xa5be2,null));};exports[_0xcd83('0x5a')]=function(_0x5ebcfe,_0x4a7ccd,_0x1327c4){if(_0x5ebcfe[_0xcd83('0x5b')]&&_0x5ebcfe['file'][_0xcd83('0x5c')]){_0x5ebcfe['body'][_0xcd83('0x5d')]=_0x5ebcfe[_0xcd83('0x5b')][_0xcd83('0x5c')];}return db['Setting'][_0xcd83('0x58')]({'where':{'id':_0x5ebcfe[_0xcd83('0x57')]['id']}})[_0xcd83('0x1f')](handleEntityNotFound(_0x4a7ccd,null))[_0xcd83('0x1f')](saveUpdates(_0x5ebcfe[_0xcd83('0x59')],null))[_0xcd83('0x1f')](respondWithResult(_0x4a7ccd,null))[_0xcd83('0x28')](handleError(_0x4a7ccd,null));};exports[_0xcd83('0x5e')]=function(_0x1ecef9,_0x3d8142,_0x33e263){if(_0x1ecef9[_0xcd83('0x5b')]&&_0x1ecef9[_0xcd83('0x5b')][_0xcd83('0x5c')]){_0x1ecef9[_0xcd83('0x59')][_0xcd83('0x5f')]=_0x1ecef9[_0xcd83('0x5b')][_0xcd83('0x5c')];}return db[_0xcd83('0x52')][_0xcd83('0x58')]({'where':{'id':_0x1ecef9['params']['id']}})[_0xcd83('0x1f')](handleEntityNotFound(_0x3d8142,null))[_0xcd83('0x1f')](saveUpdates(_0x1ecef9[_0xcd83('0x59')],null))[_0xcd83('0x1f')](respondWithResult(_0x3d8142,null))['catch'](handleError(_0x3d8142,null));};var utilLicense=require(_0xcd83('0x1a'));exports[_0xcd83('0x60')]=function(_0x17f7fd,_0x104b49,_0x1296b8){var _0x20977f=_0xcd83('0x61');var _0xe22223={'custom':![]};return utilLicense[_0xcd83('0x62')]()[_0xcd83('0x1f')](function(_0x1733a3){if(_0x1733a3){_0xe22223=_0x1733a3;}return db[_0xcd83('0x52')][_0xcd83('0x58')]({'where':{'id':_0x17f7fd[_0xcd83('0x57')]['id']},'attributes':['logo','loginLogo','preferred',_0xcd83('0x63'),_0xcd83('0x64'),_0xcd83('0x65'),'defaultPreferred',_0xcd83('0x66')],'raw':!![]});})['then'](handleEntityNotFound(_0x104b49,null))['then'](function(_0x42cd2f){if(_0x42cd2f){var _0x14574d=_0x42cd2f[_0xcd83('0x5d')]&&fs[_0xcd83('0x67')](path[_0xcd83('0x68')](config[_0xcd83('0x69')],_0x20977f,_[_0xcd83('0x6a')](_0x42cd2f[_0xcd83('0x5d')])))?path[_0xcd83('0x68')](config[_0xcd83('0x69')],_0x20977f,_[_0xcd83('0x6a')](_0x42cd2f[_0xcd83('0x5d')])):path['join'](config[_0xcd83('0x69')],_0x20977f,_[_0xcd83('0x6a')](_0xcd83('0x6b')));var _0x5e4ea4='default'+_[_0xcd83('0x6c')]('logo');if(_0x42cd2f[_0x5e4ea4]||!_0xe22223[_0xcd83('0x6d')]){_0x14574d=path['join'](config[_0xcd83('0x69')],_0x20977f,_['toLower']('default_logo.svg'));}if(!fs[_0xcd83('0x67')](_0x14574d)){throw new db[(_0xcd83('0x6e'))][(_0xcd83('0x6f'))](_[_0xcd83('0x6c')]('logo')+_0xcd83('0x70'));}return _0x104b49[_0xcd83('0x71')](_0x14574d);}})[_0xcd83('0x28')](handleError(_0x104b49,null));};var utilLicense=require(_0xcd83('0x1a'));exports[_0xcd83('0x72')]=function(_0x5bd948,_0x2d9340,_0x3acc4d){var _0x54e3eb=_0xcd83('0x61');var _0x52d96e={'custom':![]};return utilLicense[_0xcd83('0x62')]()[_0xcd83('0x1f')](function(_0x3d9305){if(_0x3d9305){_0x52d96e=_0x3d9305;}return db['Setting'][_0xcd83('0x58')]({'where':{'id':_0x5bd948[_0xcd83('0x57')]['id']},'attributes':['logo',_0xcd83('0x5f'),_0xcd83('0x73'),_0xcd83('0x63'),_0xcd83('0x64'),_0xcd83('0x65'),_0xcd83('0x74'),'defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x2d9340,null))[_0xcd83('0x1f')](function(_0x19a433){if(_0x19a433){var _0x2de9e4=_0x19a433['loginLogo']&&fs[_0xcd83('0x67')](path[_0xcd83('0x68')](config['root'],_0x54e3eb,_[_0xcd83('0x6a')](_0x19a433[_0xcd83('0x5f')])))?path[_0xcd83('0x68')](config['root'],_0x54e3eb,_[_0xcd83('0x6a')](_0x19a433[_0xcd83('0x5f')])):path['join'](config[_0xcd83('0x69')],_0x54e3eb,_[_0xcd83('0x6a')](_0xcd83('0x75')));var _0x36b629='default'+_[_0xcd83('0x6c')](_0xcd83('0x5f'));if(_0x19a433[_0x36b629]||!_0x52d96e[_0xcd83('0x6d')]){_0x2de9e4=path[_0xcd83('0x68')](config[_0xcd83('0x69')],_0x54e3eb,_[_0xcd83('0x6a')](_0xcd83('0x75')));}if(!fs['existsSync'](_0x2de9e4)){throw new db[(_0xcd83('0x6e'))][(_0xcd83('0x6f'))](_[_0xcd83('0x6c')](_0xcd83('0x5f'))+'\x20not\x20found');}return _0x2d9340['download'](_0x2de9e4);}})['catch'](handleError(_0x2d9340,null));};exports[_0xcd83('0x76')]=function(_0x147556,_0x678088){return db[_0xcd83('0x52')][_0xcd83('0x58')]({'where':{'id':_0x147556['params']['id']},'attributes':[_0xcd83('0x77')]})['then'](respondWithResult(_0x678088,null))[_0xcd83('0x28')](handleError(_0x678088,null));};exports[_0xcd83('0x78')]=function(_0x47eac3,_0x11a462,_0x3461ca){if(_0x47eac3[_0xcd83('0x5b')]&&_0x47eac3['file']['filename']){_0x47eac3[_0xcd83('0x59')][_0xcd83('0x73')]=_0x47eac3[_0xcd83('0x5b')][_0xcd83('0x5c')];}return db[_0xcd83('0x52')][_0xcd83('0x58')]({'where':{'id':_0x47eac3[_0xcd83('0x57')]['id']}})['then'](handleEntityNotFound(_0x11a462,null))['then'](saveUpdates(_0x47eac3[_0xcd83('0x59')],null))[_0xcd83('0x1f')](respondWithResult(_0x11a462,null))[_0xcd83('0x28')](handleError(_0x11a462,null));};var utilLicense=require(_0xcd83('0x1a'));exports['getPreferred']=function(_0x11f3c9,_0x15f969,_0x1232a2){var _0x5cd31b=_0xcd83('0x61');var _0xb22f90={'custom':![]};return utilLicense['getLicense']()[_0xcd83('0x1f')](function(_0x5ed7ce){if(_0x5ed7ce){_0xb22f90=_0x5ed7ce;}return db[_0xcd83('0x52')][_0xcd83('0x58')]({'where':{'id':_0x11f3c9[_0xcd83('0x57')]['id']},'attributes':['logo',_0xcd83('0x5f'),_0xcd83('0x73'),_0xcd83('0x63'),_0xcd83('0x64'),'defaultLoginLogo','defaultPreferred','defaultFavicon'],'raw':!![]});})[_0xcd83('0x1f')](handleEntityNotFound(_0x15f969,null))[_0xcd83('0x1f')](function(_0x3acc20){if(_0x3acc20){var _0x5b2fac=_0x3acc20[_0xcd83('0x73')]&&fs[_0xcd83('0x67')](path[_0xcd83('0x68')](config[_0xcd83('0x69')],_0x5cd31b,_[_0xcd83('0x6a')](_0x3acc20[_0xcd83('0x73')])))?path[_0xcd83('0x68')](config[_0xcd83('0x69')],_0x5cd31b,_[_0xcd83('0x6a')](_0x3acc20['preferred'])):path[_0xcd83('0x68')](config[_0xcd83('0x69')],_0x5cd31b,_[_0xcd83('0x6a')]('default_preferred.png'));var _0x5643ca='default'+_['upperFirst'](_0xcd83('0x73'));if(_0x3acc20[_0x5643ca]||!_0xb22f90['custom']||!_0xb22f90[_0xcd83('0x73')]){_0x5b2fac=path['join'](config[_0xcd83('0x69')],_0x5cd31b,_[_0xcd83('0x6a')]('default_preferred.png'));}if(!fs[_0xcd83('0x67')](_0x5b2fac)){throw new db[(_0xcd83('0x6e'))][(_0xcd83('0x6f'))](_[_0xcd83('0x6c')](_0xcd83('0x73'))+_0xcd83('0x70'));}return _0x15f969[_0xcd83('0x71')](_0x5b2fac);}})[_0xcd83('0x28')](handleError(_0x15f969,null));};exports[_0xcd83('0x79')]=function(_0x3068da,_0x47c4f0,_0x31b474){if(_0x3068da[_0xcd83('0x5b')]&&_0x3068da[_0xcd83('0x5b')][_0xcd83('0x5c')]){_0x3068da['body'][_0xcd83('0x63')]=_0x3068da['file']['filename'];}return db['Setting']['find']({'where':{'id':_0x3068da['params']['id']}})[_0xcd83('0x1f')](handleEntityNotFound(_0x47c4f0,null))[_0xcd83('0x1f')](saveUpdates(_0x3068da[_0xcd83('0x59')],null))['then'](respondWithResult(_0x47c4f0,null))[_0xcd83('0x28')](handleError(_0x47c4f0,null));};var utilLicense=require('../../config/license/util');exports[_0xcd83('0x7a')]=function(_0x5a3a95,_0x221475,_0x3e1473){var _0x3c20aa=_0xcd83('0x61');var _0x2474e9={'custom':![]};return utilLicense[_0xcd83('0x62')]()[_0xcd83('0x1f')](function(_0x22dc3a){if(_0x22dc3a){_0x2474e9=_0x22dc3a;}return db[_0xcd83('0x52')][_0xcd83('0x58')]({'where':{'id':_0x5a3a95['params']['id']},'attributes':[_0xcd83('0x5d'),_0xcd83('0x5f'),_0xcd83('0x73'),'favicon',_0xcd83('0x64'),'defaultLoginLogo',_0xcd83('0x74'),_0xcd83('0x66')],'raw':!![]});})[_0xcd83('0x1f')](handleEntityNotFound(_0x221475,null))[_0xcd83('0x1f')](function(_0x18d275){if(_0x18d275){var _0x196796=_0x18d275[_0xcd83('0x63')]&&fs['existsSync'](path[_0xcd83('0x68')](config['root'],_0x3c20aa,_[_0xcd83('0x6a')](_0x18d275[_0xcd83('0x63')])))?path['join'](config['root'],_0x3c20aa,_['toLower'](_0x18d275['favicon'])):path[_0xcd83('0x68')](config[_0xcd83('0x69')],_0x3c20aa,_[_0xcd83('0x6a')]('default_favicon.ico'));var _0x54f932=_0xcd83('0x7b')+_[_0xcd83('0x6c')](_0xcd83('0x63'));if(_0x18d275[_0x54f932]||!_0x2474e9[_0xcd83('0x6d')]){_0x196796=path['join'](config['root'],_0x3c20aa,_['toLower'](_0xcd83('0x7c')));}if(!fs['existsSync'](_0x196796)){throw new db['Sequelize'][(_0xcd83('0x6f'))](_['upperFirst']('favicon')+_0xcd83('0x70'));}return _0x221475[_0xcd83('0x71')](_0x196796);}})[_0xcd83('0x28')](handleError(_0x221475,null));};exports[_0xcd83('0x7d')]=function(_0x53c08b,_0x1d8855){var _0x2dfb1a={'offset':moment()[_0xcd83('0x7e')]()};_0x2dfb1a[_0xcd83('0x7f')]=moment()[_0xcd83('0x7e')](_0x2dfb1a['offset'])[_0xcd83('0x80')](_0xcd83('0x81'));return _0x1d8855[_0xcd83('0x2a')](0xc8)['send'](_0x2dfb1a);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index f781369..f3ca31b 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 _0x008c=['define','settings','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports'];(function(_0x316c42,_0x3391f0){var _0x2b38f7=function(_0x38d2cf){while(--_0x38d2cf){_0x316c42['push'](_0x316c42['shift']());}};_0x2b38f7(++_0x3391f0);}(_0x008c,0x188));var _0xc008=function(_0x1f4f14,_0x570d4b){_0x1f4f14=_0x1f4f14-0x0;var _0x3135b1=_0x008c[_0x1f4f14];return _0x3135b1;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('Setting',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x34e8=['settings','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports','Setting'];(function(_0x109f5f,_0x5ba0e8){var _0x2d86cf=function(_0xc40b7){while(--_0xc40b7){_0x109f5f['push'](_0x109f5f['shift']());}};_0x2d86cf(++_0x5ba0e8);}(_0x34e8,0x12c));var _0x834e=function(_0x19a50c,_0x5225e8){_0x19a50c=_0x19a50c-0x0;var _0x464a79=_0x34e8[_0x19a50c];return _0x464a79;};'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 diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index 4b121b6..afbecff 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 _0x254f=['result','catch','Setting','find','options','raw','where','attributes','map','include','model','ShowSetting','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x355188,_0x44c2fc){var _0x2ca382=function(_0x33b260){while(--_0x33b260){_0x355188['push'](_0x355188['shift']());}};_0x2ca382(++_0x44c2fc);}(_0x254f,0x182));var _0xf254=function(_0x40372d,_0x2cdea7){_0x40372d=_0x40372d-0x0;var _0x3b3760=_0x254f[_0x40372d];return _0x3b3760;};'use strict';var _=require(_0xf254('0x0'));var util=require(_0xf254('0x1'));var moment=require(_0xf254('0x2'));var BPromise=require(_0xf254('0x3'));var rs=require(_0xf254('0x4'));var fs=require('fs');var Redis=require(_0xf254('0x5'));var db=require(_0xf254('0x6'))['db'];var utils=require(_0xf254('0x7'));var logger=require('../../config/logger')(_0xf254('0x8'));var config=require('../../config/environment');var jayson=require(_0xf254('0x9'));var client=jayson[_0xf254('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x842f2e,_0x4fa5d8,_0x1bfd5f){return new BPromise(function(_0x1fff82,_0x28fa76){return client[_0xf254('0xb')](_0x842f2e,_0x1bfd5f)[_0xf254('0xc')](function(_0x16dcb1){logger[_0xf254('0xd')](_0xf254('0xe'),_0x4fa5d8,_0xf254('0xf'));logger[_0xf254('0x10')](_0xf254('0x11'),_0x4fa5d8,_0xf254('0xf'),JSON[_0xf254('0x12')](_0x16dcb1));if(_0x16dcb1[_0xf254('0x13')]){if(_0x16dcb1[_0xf254('0x13')][_0xf254('0x14')]===0x1f4){logger[_0xf254('0x13')](_0xf254('0xe'),_0x4fa5d8,_0x16dcb1[_0xf254('0x13')][_0xf254('0x15')]);return _0x28fa76(_0x16dcb1[_0xf254('0x13')][_0xf254('0x15')]);}logger[_0xf254('0x13')](_0xf254('0xe'),_0x4fa5d8,_0x16dcb1[_0xf254('0x13')][_0xf254('0x15')]);return _0x1fff82(_0x16dcb1[_0xf254('0x13')]['message']);}else{logger[_0xf254('0xd')](_0xf254('0xe'),_0x4fa5d8,_0xf254('0xf'));_0x1fff82(_0x16dcb1[_0xf254('0x16')][_0xf254('0x15')]);}})[_0xf254('0x17')](function(_0x52faa4){logger['error'](_0xf254('0xe'),_0x4fa5d8,_0x52faa4);_0x28fa76(_0x52faa4);});});}exports['ShowSetting']=function(_0x3c4ed3){var _0x207538=this;return new Promise(function(_0x29b295,_0x3d0c54){return db[_0xf254('0x18')][_0xf254('0x19')]({'raw':_0x3c4ed3['options']?_0x3c4ed3[_0xf254('0x1a')][_0xf254('0x1b')]===undefined?!![]:![]:!![],'where':_0x3c4ed3['options']?_0x3c4ed3[_0xf254('0x1a')][_0xf254('0x1c')]||null:null,'attributes':_0x3c4ed3['options']?_0x3c4ed3['options'][_0xf254('0x1d')]||null:null,'include':_0x3c4ed3[_0xf254('0x1a')]?_0x3c4ed3['options']['include']?_[_0xf254('0x1e')](_0x3c4ed3[_0xf254('0x1a')]['include'],function(_0x32a1b8){return{'model':db[_0x32a1b8['model']],'as':_0x32a1b8['as'],'attributes':_0x32a1b8['attributes'],'include':_0x32a1b8[_0xf254('0x1f')]?_[_0xf254('0x1e')](_0x32a1b8[_0xf254('0x1f')],function(_0xeef509){return{'model':db[_0xeef509[_0xf254('0x20')]],'as':_0xeef509['as'],'attributes':_0xeef509['attributes'],'include':_0xeef509[_0xf254('0x1f')]?_[_0xf254('0x1e')](_0xeef509[_0xf254('0x1f')],function(_0x341c4a){return{'model':db[_0x341c4a[_0xf254('0x20')]],'as':_0x341c4a['as'],'attributes':_0x341c4a[_0xf254('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xf254('0xc')](function(_0x1d567b){logger[_0xf254('0xd')]('ShowSetting',_0x3c4ed3);logger[_0xf254('0x10')](_0xf254('0x21'),_0x3c4ed3,JSON[_0xf254('0x12')](_0x1d567b));_0x29b295(_0x1d567b);})[_0xf254('0x17')](function(_0x798ee2){logger[_0xf254('0x13')]('ShowSetting',_0x798ee2['message'],_0x3c4ed3);_0x3d0c54(_0x207538[_0xf254('0x13')](0x1f4,_0x798ee2[_0xf254('0x15')]));});});}; \ No newline at end of file +var _0xe2c7=['attributes','map','model','include','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','Setting,\x20%s,\x20%s','message','result','catch','ShowSetting','Setting','find','options','where'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xe2c7,0xf2));var _0x7e2c=function(_0x22f75e,_0x4a9e06){_0x22f75e=_0x22f75e-0x0;var _0x1f6ab3=_0xe2c7[_0x22f75e];return _0x1f6ab3;};'use strict';var _=require(_0x7e2c('0x0'));var util=require(_0x7e2c('0x1'));var moment=require('moment');var BPromise=require(_0x7e2c('0x2'));var rs=require(_0x7e2c('0x3'));var fs=require('fs');var Redis=require(_0x7e2c('0x4'));var db=require(_0x7e2c('0x5'))['db'];var utils=require(_0x7e2c('0x6'));var logger=require(_0x7e2c('0x7'))(_0x7e2c('0x8'));var config=require(_0x7e2c('0x9'));var jayson=require(_0x7e2c('0xa'));var client=jayson[_0x7e2c('0xb')][_0x7e2c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x21d97f,_0x700b7f,_0x276a67){return new BPromise(function(_0x539177,_0x1cf0da){return client[_0x7e2c('0xd')](_0x21d97f,_0x276a67)[_0x7e2c('0xe')](function(_0x40b8c3){logger[_0x7e2c('0xf')]('Setting,\x20%s,\x20%s',_0x700b7f,_0x7e2c('0x10'));logger[_0x7e2c('0x11')]('Setting,\x20%s,\x20%s,\x20%s',_0x700b7f,_0x7e2c('0x10'),JSON[_0x7e2c('0x12')](_0x40b8c3));if(_0x40b8c3['error']){if(_0x40b8c3[_0x7e2c('0x13')][_0x7e2c('0x14')]===0x1f4){logger['error'](_0x7e2c('0x15'),_0x700b7f,_0x40b8c3[_0x7e2c('0x13')][_0x7e2c('0x16')]);return _0x1cf0da(_0x40b8c3[_0x7e2c('0x13')][_0x7e2c('0x16')]);}logger['error'](_0x7e2c('0x15'),_0x700b7f,_0x40b8c3[_0x7e2c('0x13')][_0x7e2c('0x16')]);return _0x539177(_0x40b8c3[_0x7e2c('0x13')][_0x7e2c('0x16')]);}else{logger['info']('Setting,\x20%s,\x20%s',_0x700b7f,_0x7e2c('0x10'));_0x539177(_0x40b8c3[_0x7e2c('0x17')][_0x7e2c('0x16')]);}})[_0x7e2c('0x18')](function(_0x52c174){logger[_0x7e2c('0x13')](_0x7e2c('0x15'),_0x700b7f,_0x52c174);_0x1cf0da(_0x52c174);});});}exports[_0x7e2c('0x19')]=function(_0x2ec492){var _0x219fbf=this;return new Promise(function(_0x2d9cc1,_0x1b45d0){return db[_0x7e2c('0x1a')][_0x7e2c('0x1b')]({'raw':_0x2ec492[_0x7e2c('0x1c')]?_0x2ec492['options']['raw']===undefined?!![]:![]:!![],'where':_0x2ec492[_0x7e2c('0x1c')]?_0x2ec492[_0x7e2c('0x1c')][_0x7e2c('0x1d')]||null:null,'attributes':_0x2ec492[_0x7e2c('0x1c')]?_0x2ec492[_0x7e2c('0x1c')][_0x7e2c('0x1e')]||null:null,'include':_0x2ec492[_0x7e2c('0x1c')]?_0x2ec492[_0x7e2c('0x1c')]['include']?_[_0x7e2c('0x1f')](_0x2ec492[_0x7e2c('0x1c')]['include'],function(_0x4e481e){return{'model':db[_0x4e481e[_0x7e2c('0x20')]],'as':_0x4e481e['as'],'attributes':_0x4e481e['attributes'],'include':_0x4e481e[_0x7e2c('0x21')]?_['map'](_0x4e481e[_0x7e2c('0x21')],function(_0x2723d4){return{'model':db[_0x2723d4['model']],'as':_0x2723d4['as'],'attributes':_0x2723d4[_0x7e2c('0x1e')],'include':_0x2723d4[_0x7e2c('0x21')]?_[_0x7e2c('0x1f')](_0x2723d4[_0x7e2c('0x21')],function(_0x5af8b8){return{'model':db[_0x5af8b8[_0x7e2c('0x20')]],'as':_0x5af8b8['as'],'attributes':_0x5af8b8[_0x7e2c('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x7e2c('0xe')](function(_0x1b1402){logger[_0x7e2c('0xf')]('ShowSetting',_0x2ec492);logger[_0x7e2c('0x11')](_0x7e2c('0x19'),_0x2ec492,JSON[_0x7e2c('0x12')](_0x1b1402));_0x2d9cc1(_0x1b1402);})['catch'](function(_0xbeee1b){logger[_0x7e2c('0x13')](_0x7e2c('0x19'),_0xbeee1b[_0x7e2c('0x16')],_0x2ec492);_0x1b45d0(_0x219fbf[_0x7e2c('0x13')](0x1f4,_0xbeee1b[_0x7e2c('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index d30ceab..04f2e67 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 _0x6aa7=['create','addDisposition','addAnswer','addApplications','/:id/send','send','status','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status','/:id/users','getAgents','post'];(function(_0x5e90e8,_0x4d437f){var _0x5288b7=function(_0x458569){while(--_0x458569){_0x5e90e8['push'](_0x5e90e8['shift']());}};_0x5288b7(++_0x4d437f);}(_0x6aa7,0x178));var _0x76aa=function(_0x544fd3,_0x7e104a){_0x544fd3=_0x544fd3-0x0;var _0xa3e75c=_0x6aa7[_0x544fd3];return _0xa3e75c;};'use strict';var multer=require(_0x76aa('0x0'));var util=require('util');var path=require(_0x76aa('0x1'));var timeout=require(_0x76aa('0x2'));var express=require(_0x76aa('0x3'));var router=express[_0x76aa('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x76aa('0x5'));var interaction=require(_0x76aa('0x6'));var config=require(_0x76aa('0x7'));var controller=require('./smsAccount.controller');router['get']('/',auth[_0x76aa('0x8')](),controller['index']);router[_0x76aa('0x9')](_0x76aa('0xa'),auth[_0x76aa('0x8')](),controller['describe']);router[_0x76aa('0x9')](_0x76aa('0xb'),auth[_0x76aa('0x8')](),controller['show']);router[_0x76aa('0x9')](_0x76aa('0xc'),auth[_0x76aa('0x8')](),controller[_0x76aa('0xd')]);router[_0x76aa('0x9')](_0x76aa('0xe'),auth[_0x76aa('0x8')](),controller[_0x76aa('0xf')]);router[_0x76aa('0x9')](_0x76aa('0x10'),auth['isAuthenticated'](),controller[_0x76aa('0x11')]);router['get'](_0x76aa('0x12'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x13')]);router[_0x76aa('0x9')](_0x76aa('0x14'),controller['statusGet']);router['get'](_0x76aa('0x15'),auth['isAuthenticated'](),controller[_0x76aa('0x16')]);router[_0x76aa('0x17')]('/',auth['isAuthenticated'](),controller[_0x76aa('0x18')]);router['post'](_0x76aa('0xc'),auth['isAuthenticated'](),controller[_0x76aa('0x19')]);router[_0x76aa('0x17')](_0x76aa('0xe'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x1a')]);router[_0x76aa('0x17')]('/:id/notify',controller['notify']);router[_0x76aa('0x17')](_0x76aa('0x10'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x1b')]);router[_0x76aa('0x17')](_0x76aa('0x1c'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x1d')]);router[_0x76aa('0x17')]('/:id/status',controller[_0x76aa('0x1e')]);router[_0x76aa('0x17')](_0x76aa('0x15'),auth['isAuthenticated'](),controller[_0x76aa('0x1f')]);router[_0x76aa('0x20')](_0x76aa('0xb'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x21')]);router[_0x76aa('0x22')](_0x76aa('0xb'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x23')]);router[_0x76aa('0x22')](_0x76aa('0xc'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x24')]);router['delete'](_0x76aa('0xe'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x25')]);router[_0x76aa('0x22')](_0x76aa('0x15'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x26')]);module[_0x76aa('0x27')]=router; \ No newline at end of file +var _0x8ef6=['addApplications','/:id/send','send','status','update','delete','destroy','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','/describe','isAuthenticated','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','/:id/status','statusGet','/:id/users','getAgents','create','post','addDisposition','addAnswer','notify'];(function(_0x36ee04,_0x334267){var _0x1802ef=function(_0x566658){while(--_0x566658){_0x36ee04['push'](_0x36ee04['shift']());}};_0x1802ef(++_0x334267);}(_0x8ef6,0xf2));var _0x68ef=function(_0x27f43b,_0x58f291){_0x27f43b=_0x27f43b-0x0;var _0x31a3a3=_0x8ef6[_0x27f43b];return _0x31a3a3;};'use strict';var multer=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var path=require(_0x68ef('0x2'));var timeout=require(_0x68ef('0x3'));var express=require(_0x68ef('0x4'));var router=express[_0x68ef('0x5')]();var fs_extra=require(_0x68ef('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x68ef('0x7'));var config=require(_0x68ef('0x8'));var controller=require(_0x68ef('0x9'));router[_0x68ef('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x68ef('0xa')](_0x68ef('0xb'),auth[_0x68ef('0xc')](),controller['describe']);router[_0x68ef('0xa')](_0x68ef('0xd'),auth[_0x68ef('0xc')](),controller[_0x68ef('0xe')]);router[_0x68ef('0xa')](_0x68ef('0xf'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x10')]);router[_0x68ef('0xa')](_0x68ef('0x11'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x12')]);router['get'](_0x68ef('0x13'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x14')]);router[_0x68ef('0xa')](_0x68ef('0x15'),auth[_0x68ef('0xc')](),controller['getInteractions']);router[_0x68ef('0xa')](_0x68ef('0x16'),controller[_0x68ef('0x17')]);router['get'](_0x68ef('0x18'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x19')]);router['post']('/',auth[_0x68ef('0xc')](),controller[_0x68ef('0x1a')]);router[_0x68ef('0x1b')](_0x68ef('0xf'),auth['isAuthenticated'](),controller[_0x68ef('0x1c')]);router['post']('/:id/canned_answers',auth[_0x68ef('0xc')](),controller[_0x68ef('0x1d')]);router['post']('/:id/notify',controller[_0x68ef('0x1e')]);router[_0x68ef('0x1b')](_0x68ef('0x13'),auth['isAuthenticated'](),controller[_0x68ef('0x1f')]);router[_0x68ef('0x1b')](_0x68ef('0x20'),auth['isAuthenticated'](),controller[_0x68ef('0x21')]);router[_0x68ef('0x1b')]('/:id/status',controller[_0x68ef('0x22')]);router[_0x68ef('0x1b')](_0x68ef('0x18'),auth['isAuthenticated'](),controller['addAgents']);router['put'](_0x68ef('0xd'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x23')]);router[_0x68ef('0x24')](_0x68ef('0xd'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x25')]);router[_0x68ef('0x24')](_0x68ef('0xf'),auth[_0x68ef('0xc')](),controller['removeDispositions']);router[_0x68ef('0x24')]('/:id/canned_answers',auth['isAuthenticated'](),controller['removeAnswers']);router[_0x68ef('0x24')](_0x68ef('0x18'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x26')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index e40786a..d5a7d57 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 _0x35f2=['STRING','name','twilio','skebby','clicksend','plivo','clickatell','bandwidth','infobip','ENUM','BOOLEAN','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports'];(function(_0x205d2b,_0x394f82){var _0x2de4e8=function(_0x1cc39c){while(--_0x1cc39c){_0x205d2b['push'](_0x205d2b['shift']());}};_0x2de4e8(++_0x394f82);}(_0x35f2,0x162));var _0x235f=function(_0x4c81ec,_0x3e72a1){_0x4c81ec=_0x4c81ec-0x0;var _0x5d215a=_0x35f2[_0x4c81ec];return _0x5d215a;};'use strict';var Sequelize=require(_0x235f('0x0'));var rs=require(_0x235f('0x1'));module[_0x235f('0x2')]={'name':{'type':Sequelize[_0x235f('0x3')],'unique':_0x235f('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0x235f('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x235f('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x235f('0x3')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0x235f('0x3')]},'type':{'type':Sequelize['ENUM'](_0x235f('0x5'),_0x235f('0x6'),'connectel',_0x235f('0x7'),_0x235f('0x8'),_0x235f('0x9'),_0x235f('0xa'),'csc',_0x235f('0xb'),'intelepeer')},'accountSid':{'type':Sequelize[_0x235f('0x3')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize[_0x235f('0xc')]('SI','TI','GP')},'username':{'type':Sequelize[_0x235f('0x3')]},'password':{'type':Sequelize[_0x235f('0x3')]},'apiKey':{'type':Sequelize[_0x235f('0x3')]},'applicationId':{'type':Sequelize[_0x235f('0x3')]},'accountId':{'type':Sequelize[_0x235f('0x3')]},'senderString':{'type':Sequelize[_0x235f('0x3')]},'deliveryReport':{'type':Sequelize[_0x235f('0xd')],'defaultValue':![]},'description':{'type':Sequelize[_0x235f('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x235f('0xe');}},'notificationSound':{'type':Sequelize[_0x235f('0xd')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x235f('0xd')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x235f('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x235f('0xd')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x235f('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x235f('0xd')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x235f('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x235f('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x235f('0x10')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x235f('0x11'),'set':function(_0xa4c7cc){if(!_0xa4c7cc)this[_0x235f('0x12')](_0x235f('0x13'),null);this['setDataValue'](_0x235f('0x14'),_0xa4c7cc);}}}; \ No newline at end of file +var _0xb5d6=['connectel','clicksend','plivo','clickatell','csc','intelepeer','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','generate','ENUM','twilio','skebby'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xb5d6,0xf5));var _0x6b5d=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xb5d6[_0x2c91e9];return _0x13f0ff;};'use strict';var Sequelize=require(_0x6b5d('0x0'));var rs=require(_0x6b5d('0x1'));module[_0x6b5d('0x2')]={'name':{'type':Sequelize[_0x6b5d('0x3')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0x6b5d('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x6b5d('0x3')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x6b5d('0x4')]();}},'phone':{'type':Sequelize[_0x6b5d('0x3')]},'type':{'type':Sequelize[_0x6b5d('0x5')](_0x6b5d('0x6'),_0x6b5d('0x7'),_0x6b5d('0x8'),_0x6b5d('0x9'),_0x6b5d('0xa'),_0x6b5d('0xb'),'bandwidth',_0x6b5d('0xc'),'infobip',_0x6b5d('0xd'))},'accountSid':{'type':Sequelize[_0x6b5d('0x3')]},'authId':{'type':Sequelize[_0x6b5d('0x3')]},'authToken':{'type':Sequelize[_0x6b5d('0x3')]},'smsMethod':{'type':Sequelize[_0x6b5d('0x5')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0x6b5d('0x3')]},'applicationId':{'type':Sequelize[_0x6b5d('0x3')]},'accountId':{'type':Sequelize[_0x6b5d('0x3')]},'senderString':{'type':Sequelize['STRING']},'deliveryReport':{'type':Sequelize[_0x6b5d('0xe')],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x6b5d('0xf')],'defaultValue':function(){return _0x6b5d('0x10');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x6b5d('0xe')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x6b5d('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x6b5d('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x6b5d('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x6b5d('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x6b5d('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6b5d('0x11')],'comment':_0x6b5d('0x12')},'mandatoryDisposition':{'type':Sequelize[_0x6b5d('0xe')],'defaultValue':![],'comment':_0x6b5d('0x13'),'set':function(_0x3796c9){if(!_0x3796c9)this[_0x6b5d('0x14')](_0x6b5d('0x15'),null);this['setDataValue'](_0x6b5d('0x16'),_0x3796c9);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index b2e3c30..b2c1ea3 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 _0xc31a=['Contact','Owner','fullname','internal','Tag','Tags','color','tag','to\x20is\x20mandatory','List','out','Messages','dataValues','inspect','skebby_dispatch_id','requestid','statusInt','status_code','groupName','DELIVERED','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','statusGet','message-id','state','addAgents','ids','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./smsAccount.socket','register','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','sendStatus','status','offset','limit','undefined','count','set','Content-Range','reject','save','update','get','SmsAccounts','UserProfileResource','destroy','name','index','Pause','map','SmsAccount','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','filters','pick','filter','merge','where','VIRTUAL','options','includeAll','findAll','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','mandatoryDispositionPause','describe','addDisposition','SmsAccountId','Disposition','getDispositions','findOne','nolimit','include','removeDispositions','addAnswer','getAnswers','CannedAnswer','length','rows','removeAnswers','notify','sms','SmsApplication','Applications','account','applications','orderBy','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','ListId','mobile','type','from','From','Body','messageId','MessageSid','skebby','sender','text','connectel','clicksend','message_id','plivo','Text','MessageUUID','infobip','results','csc','originatingAddress','clickatell','fromNumber','replyMessageId','bandwidth','intelepeer','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','omit','contact','SmsInteraction','spread','interaction','created','autoclose','close','unmanaged','*,*,*,*','SmsMessage','ContactId','AttachmentId','UserId','User','unshift','agent','Start','startRouting','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s','entity\x20found','stringify','twilio','Content-Type','text/xml','send','\x0a','json','addApplications','sequelize','transaction','bulkCreate','findAndCountAll','priority','getApplications','getInteractions'];(function(_0x35a274,_0x98b399){var _0x40d905=function(_0x5c8455){while(--_0x5c8455){_0x35a274['push'](_0x35a274['shift']());}};_0x40d905(++_0x98b399);}(_0xc31a,0x1f4));var _0xac31=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc31a[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xac31('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xac31('0x1'));var rp=require(_0xac31('0x2'));var moment=require(_0xac31('0x3'));var BPromise=require(_0xac31('0x4'));var Mustache=require(_0xac31('0x5'));var util=require(_0xac31('0x6'));var path=require(_0xac31('0x7'));var sox=require(_0xac31('0x8'));var csv=require(_0xac31('0x9'));var ejs=require(_0xac31('0xa'));var fs=require('fs');var fs_extra=require(_0xac31('0xb'));var _=require(_0xac31('0xc'));var squel=require(_0xac31('0xd'));var crypto=require(_0xac31('0xe'));var jsforce=require(_0xac31('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xac31('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xac31('0x10'));var qs=require(_0xac31('0x11'));var as=require(_0xac31('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac31('0x13'))(_0xac31('0x14'));var utils=require(_0xac31('0x15'));var config=require(_0xac31('0x16'));var licenseUtil=require(_0xac31('0x17'));var db=require(_0xac31('0x18'))['db'];config[_0xac31('0x19')]=_[_0xac31('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xac31('0x1b'))(new Redis(config[_0xac31('0x19')]));require(_0xac31('0x1c'))[_0xac31('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x23402c,_0x13151e,_0x19f8d6,_0x2095bd){return new BPromise(function(_0xfdc95d,_0x4b3a3b){var _0x576c98=_0x2095bd||client;return _0x576c98['request'](_0x23402c,_0x19f8d6)[_0xac31('0x1e')](function(_0x379ac4){logger[_0xac31('0x1f')](_0xac31('0x20'),_0x13151e,_0xac31('0x21'));logger[_0xac31('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x13151e,_0xac31('0x21'),JSON['stringify'](_0x379ac4));if(_0x379ac4[_0xac31('0x23')]){if(_0x379ac4['error'][_0xac31('0x24')]===0x1f4){logger[_0xac31('0x23')](_0xac31('0x20'),_0x13151e,_0x379ac4['error'][_0xac31('0x25')]);return _0x4b3a3b(_0x379ac4[_0xac31('0x23')][_0xac31('0x25')]);}logger['error'](_0xac31('0x20'),_0x13151e,_0x379ac4[_0xac31('0x23')][_0xac31('0x25')]);return _0xfdc95d(_0x379ac4[_0xac31('0x23')][_0xac31('0x25')]);}else{logger[_0xac31('0x1f')](_0xac31('0x20'),_0x13151e,'request\x20sent');_0xfdc95d(_0x379ac4[_0xac31('0x26')]['message']);}})[_0xac31('0x27')](function(_0x305eec){logger[_0xac31('0x23')]('SmsAccount,\x20%s,\x20%s',_0x13151e,_0x305eec);_0x4b3a3b(_0x305eec);});});}function respondWithStatusCode(_0x10babc,_0x450f68){_0x450f68=_0x450f68||0xcc;return function(_0x3bf9d4){if(_0x3bf9d4){return _0x10babc[_0xac31('0x28')](_0x450f68);}return _0x10babc[_0xac31('0x29')](_0x450f68)['end']();};}function respondWithResult(_0x5e39ef,_0x44858e){_0x44858e=_0x44858e||0xc8;return function(_0x3a6038){if(_0x3a6038){return _0x5e39ef[_0xac31('0x29')](_0x44858e)['json'](_0x3a6038);}};}function respondWithFilteredResult(_0x3f2280,_0x3f2285){return function(_0x5af057){if(_0x5af057){var _0x4eea6f=typeof _0x3f2285[_0xac31('0x2a')]==='undefined'&&typeof _0x3f2285[_0xac31('0x2b')]===_0xac31('0x2c');var _0x15e8e9=_0x5af057[_0xac31('0x2d')];var _0x5e6e76=_0x4eea6f?0x0:_0x3f2285[_0xac31('0x2a')];var _0x1dbda9=_0x4eea6f?_0x5af057[_0xac31('0x2d')]:_0x3f2285[_0xac31('0x2a')]+_0x3f2285['limit'];var _0x2d28e7;if(_0x1dbda9>=_0x15e8e9){_0x1dbda9=_0x15e8e9;_0x2d28e7=0xc8;}else{_0x2d28e7=0xce;}_0x3f2280[_0xac31('0x29')](_0x2d28e7);return _0x3f2280[_0xac31('0x2e')](_0xac31('0x2f'),_0x5e6e76+'-'+_0x1dbda9+'/'+_0x15e8e9)['json'](_0x5af057);}return null;};}function patchUpdates(_0x499148){return function(_0x18c752){try{jsonpatch['apply'](_0x18c752,_0x499148,!![]);}catch(_0x574884){return BPromise[_0xac31('0x30')](_0x574884);}return _0x18c752[_0xac31('0x31')]();};}function saveUpdates(_0x29290e,_0x3cfe5f){return function(_0x3f4117){if(_0x3f4117){return _0x3f4117[_0xac31('0x32')](_0x29290e)[_0xac31('0x1e')](function(_0x213958){return _0x213958;});}return null;};}function removeEntity(_0x9542e0,_0x33c600){return function(_0x482a0f){if(_0x482a0f){return _0x482a0f['destroy']()['then'](function(){var _0x4f53f4=_0x482a0f[_0xac31('0x33')]({'plain':!![]});var _0x3a8ee4=_0xac31('0x34');return db[_0xac31('0x35')][_0xac31('0x36')]({'where':{'type':_0x3a8ee4,'resourceId':_0x4f53f4['id']}})[_0xac31('0x1e')](function(){return _0x482a0f;});})['then'](function(){_0x9542e0[_0xac31('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a076a,_0x2dfb5a){return function(_0x3ecf8f){if(!_0x3ecf8f){_0x3a076a[_0xac31('0x28')](0x194);}return _0x3ecf8f;};}function handleError(_0x2437b6,_0x6e3185){_0x6e3185=_0x6e3185||0x1f4;return function(_0x525f72){logger[_0xac31('0x23')](_0x525f72['stack']);if(_0x525f72[_0xac31('0x37')]){delete _0x525f72['name'];}_0x2437b6[_0xac31('0x29')](_0x6e3185)['send'](_0x525f72);};}exports[_0xac31('0x38')]=function(_0x2d83c4,_0x16f4ca){var _0x28c277={'include':[{'model':db[_0xac31('0x39')],'as':'mandatoryDispositionPause'}]},_0x7cc165={},_0x59e7c6={'count':0x0,'rows':[]};var _0xba918e=_[_0xac31('0x3a')](db[_0xac31('0x3b')][_0xac31('0x3c')],function(_0x144368){return{'name':_0x144368[_0xac31('0x3d')],'type':_0x144368['type'][_0xac31('0x3e')]};});_0x7cc165[_0xac31('0x3f')]=_[_0xac31('0x3a')](_0xba918e,_0xac31('0x37'));_0x7cc165[_0xac31('0x40')]=_[_0xac31('0x41')](_0x2d83c4[_0xac31('0x40')]);_0x7cc165['filters']=_[_0xac31('0x42')](_0x7cc165[_0xac31('0x3f')],_0x7cc165[_0xac31('0x40')]);_0x28c277[_0xac31('0x43')]=_[_0xac31('0x42')](_0x7cc165[_0xac31('0x3f')],qs[_0xac31('0x44')](_0x2d83c4[_0xac31('0x40')][_0xac31('0x44')]));_0x28c277['attributes']=_0x28c277['attributes']['length']?_0x28c277['attributes']:_0x7cc165[_0xac31('0x3f')];if(!_0x2d83c4[_0xac31('0x40')][_0xac31('0x45')]('nolimit')){_0x28c277[_0xac31('0x2b')]=qs['limit'](_0x2d83c4[_0xac31('0x40')]['limit']);_0x28c277[_0xac31('0x2a')]=qs[_0xac31('0x2a')](_0x2d83c4[_0xac31('0x40')]['offset']);}_0x28c277[_0xac31('0x46')]=qs['sort'](_0x2d83c4[_0xac31('0x40')][_0xac31('0x47')]);_0x28c277['where']=qs[_0xac31('0x48')](_[_0xac31('0x49')](_0x2d83c4[_0xac31('0x40')],_0x7cc165['filters']),_0xba918e);if(_0x2d83c4[_0xac31('0x40')][_0xac31('0x4a')]){_0x28c277['where']=_[_0xac31('0x4b')](_0x28c277[_0xac31('0x4c')],{'$or':_['map'](_0xba918e,function(_0x58d79d){if(_0x58d79d['type']!==_0xac31('0x4d')){var _0x31a908={};_0x31a908[_0x58d79d['name']]={'$like':'%'+_0x2d83c4[_0xac31('0x40')]['filter']+'%'};return _0x31a908;}})});}_0x28c277=_[_0xac31('0x4b')]({},_0x28c277,_0x2d83c4[_0xac31('0x4e')]);var _0x4b4dd0={'where':_0x28c277[_0xac31('0x4c')]};return db[_0xac31('0x3b')][_0xac31('0x2d')](_0x4b4dd0)[_0xac31('0x1e')](function(_0x2e546b){_0x59e7c6[_0xac31('0x2d')]=_0x2e546b;if(_0x2d83c4[_0xac31('0x40')][_0xac31('0x4f')]){_0x28c277['include']=[{'all':!![]}];}return db['SmsAccount'][_0xac31('0x50')](_0x28c277);})[_0xac31('0x1e')](function(_0x1491a0){_0x59e7c6['rows']=_0x1491a0;return _0x59e7c6;})[_0xac31('0x1e')](respondWithFilteredResult(_0x16f4ca,_0x28c277))[_0xac31('0x27')](handleError(_0x16f4ca,null));};exports['show']=function(_0x4eafac,_0x54aa69){var _0x199751={'raw':![],'where':{'id':_0x4eafac[_0xac31('0x51')]['id']},'include':[{'model':db[_0xac31('0x39')],'as':'mandatoryDispositionPause'}]},_0xb7f457={};_0xb7f457['model']=_[_0xac31('0x41')](db[_0xac31('0x3b')][_0xac31('0x3c')]);_0xb7f457[_0xac31('0x40')]=_[_0xac31('0x41')](_0x4eafac['query']);_0xb7f457[_0xac31('0x48')]=_['intersection'](_0xb7f457[_0xac31('0x3f')],_0xb7f457[_0xac31('0x40')]);_0x199751['attributes']=_[_0xac31('0x42')](_0xb7f457['model'],qs[_0xac31('0x44')](_0x4eafac[_0xac31('0x40')][_0xac31('0x44')]));_0x199751[_0xac31('0x43')]=_0x199751[_0xac31('0x43')]['length']?_0x199751[_0xac31('0x43')]:_0xb7f457[_0xac31('0x3f')];if(_0x4eafac[_0xac31('0x40')][_0xac31('0x4f')]){_0x199751['include']=[{'all':!![]}];}_0x199751=_[_0xac31('0x4b')]({},_0x199751,_0x4eafac['options']);return db[_0xac31('0x3b')]['find'](_0x199751)[_0xac31('0x1e')](handleEntityNotFound(_0x54aa69,null))[_0xac31('0x1e')](respondWithResult(_0x54aa69,null))[_0xac31('0x27')](handleError(_0x54aa69,null));};exports['create']=function(_0x2b89da,_0x5a2558){return db['SmsAccount'][_0xac31('0x52')](_0x2b89da[_0xac31('0x53')],{})[_0xac31('0x1e')](function(_0xa382cc){var _0x5052e5=_0x2b89da[_0xac31('0x54')][_0xac31('0x33')]({'plain':!![]});if(!_0x5052e5)throw new Error(_0xac31('0x55'));if(_0x5052e5[_0xac31('0x56')]==='user'){var _0x2b53fd=_0xa382cc[_0xac31('0x33')]({'plain':!![]});var _0x5a14f2=_0xac31('0x34');return db[_0xac31('0x57')][_0xac31('0x58')]({'where':{'name':_0x5a14f2,'userProfileId':_0x5052e5[_0xac31('0x59')]},'raw':!![]})['then'](function(_0xa5028){if(_0xa5028&&_0xa5028['autoAssociation']===0x0){return db[_0xac31('0x35')][_0xac31('0x52')]({'name':_0x2b53fd[_0xac31('0x37')],'resourceId':_0x2b53fd['id'],'type':_0xa5028[_0xac31('0x37')],'sectionId':_0xa5028['id']},{})['then'](function(){return _0xa382cc;});}else{return _0xa382cc;}})[_0xac31('0x27')](function(_0xa4f960){logger[_0xac31('0x23')](_0xac31('0x5a'),_0xa4f960);throw _0xa4f960;});}return _0xa382cc;})[_0xac31('0x1e')](respondWithResult(_0x5a2558,0xc9))[_0xac31('0x27')](handleError(_0x5a2558,null));};exports[_0xac31('0x32')]=function(_0x360401,_0x3c3c55){if(_0x360401[_0xac31('0x53')]['id']){delete _0x360401[_0xac31('0x53')]['id'];}return db[_0xac31('0x3b')]['find']({'where':{'id':_0x360401[_0xac31('0x51')]['id']},'include':[{'model':db[_0xac31('0x39')],'as':_0xac31('0x5b')}]})['then'](handleEntityNotFound(_0x3c3c55,null))['then'](saveUpdates(_0x360401[_0xac31('0x53')],null))[_0xac31('0x1e')](respondWithResult(_0x3c3c55,null))[_0xac31('0x27')](handleError(_0x3c3c55,null));};exports[_0xac31('0x36')]=function(_0x5c3085,_0xd1c321){return db['SmsAccount'][_0xac31('0x58')]({'where':{'id':_0x5c3085[_0xac31('0x51')]['id']}})[_0xac31('0x1e')](handleEntityNotFound(_0xd1c321,null))[_0xac31('0x1e')](removeEntity(_0xd1c321,null))[_0xac31('0x27')](handleError(_0xd1c321,null));};exports[_0xac31('0x5c')]=function(_0x3c0bab,_0x46e447){return db[_0xac31('0x3b')][_0xac31('0x5c')]()[_0xac31('0x1e')](respondWithResult(_0x46e447,null))[_0xac31('0x27')](handleError(_0x46e447,null));};exports[_0xac31('0x5d')]=function(_0x319594,_0x59b7c6,_0x5af3b4){if(_0x319594[_0xac31('0x53')]['id']){delete _0x319594[_0xac31('0x53')]['id'];}return db[_0xac31('0x3b')][_0xac31('0x58')]({'where':{'id':_0x319594[_0xac31('0x51')]['id']}})['then'](handleEntityNotFound(_0x59b7c6,null))[_0xac31('0x1e')](function(_0x39af1f){if(_0x39af1f){_0x319594[_0xac31('0x53')][_0xac31('0x5e')]=_0x39af1f['id'];return db[_0xac31('0x5f')][_0xac31('0x52')](_0x319594[_0xac31('0x53')]);}})[_0xac31('0x1e')](respondWithResult(_0x59b7c6,null))['catch'](handleError(_0x59b7c6,null));};exports[_0xac31('0x60')]=function(_0x2642c2,_0x588f79,_0x1560de){var _0x28c9ba={'raw':![],'where':{}};var _0x3799bc={};var _0x2a44f3={'count':0x0,'rows':[]};return db['SmsAccount'][_0xac31('0x61')]({'where':{'id':_0x2642c2['params']['id']}})[_0xac31('0x1e')](handleEntityNotFound(_0x588f79,null))[_0xac31('0x1e')](function(_0x3e6d4b){if(_0x3e6d4b){_0x3799bc['model']=_[_0xac31('0x41')](db[_0xac31('0x5f')][_0xac31('0x3c')]);_0x3799bc[_0xac31('0x40')]=_[_0xac31('0x41')](_0x2642c2[_0xac31('0x40')]);_0x3799bc[_0xac31('0x48')]=_[_0xac31('0x42')](_0x3799bc['model'],_0x3799bc[_0xac31('0x40')]);_0x28c9ba[_0xac31('0x43')]=_[_0xac31('0x42')](_0x3799bc[_0xac31('0x3f')],qs[_0xac31('0x44')](_0x2642c2[_0xac31('0x40')][_0xac31('0x44')]));_0x28c9ba[_0xac31('0x43')]=_0x28c9ba[_0xac31('0x43')]['length']?_0x28c9ba[_0xac31('0x43')]:_0x3799bc[_0xac31('0x3f')];if(!_0x2642c2[_0xac31('0x40')][_0xac31('0x45')](_0xac31('0x62'))){_0x28c9ba[_0xac31('0x2b')]=qs['limit'](_0x2642c2[_0xac31('0x40')][_0xac31('0x2b')]);_0x28c9ba[_0xac31('0x2a')]=qs[_0xac31('0x2a')](_0x2642c2[_0xac31('0x40')][_0xac31('0x2a')]);}_0x28c9ba[_0xac31('0x46')]=qs[_0xac31('0x47')](_0x2642c2['query'][_0xac31('0x47')]);_0x28c9ba['where']=qs[_0xac31('0x48')](_['pick'](_0x2642c2['query'],_0x3799bc[_0xac31('0x48')]));_0x28c9ba[_0xac31('0x4c')][_0xac31('0x5e')]=_0x3e6d4b['id'];if(_0x2642c2[_0xac31('0x40')][_0xac31('0x4a')]){_0x28c9ba['where']=_[_0xac31('0x4b')](_0x28c9ba[_0xac31('0x4c')],{'$or':_[_0xac31('0x3a')](_0x28c9ba[_0xac31('0x43')],function(_0x133fdb){var _0x3a82c9={};_0x3a82c9[_0x133fdb]={'$like':'%'+_0x2642c2[_0xac31('0x40')]['filter']+'%'};return _0x3a82c9;})});}_0x28c9ba=_[_0xac31('0x4b')]({},_0x28c9ba,_0x2642c2['options']);return db[_0xac31('0x5f')]['count']({'where':_0x28c9ba[_0xac31('0x4c')]})[_0xac31('0x1e')](function(_0x2b9eba){_0x2a44f3[_0xac31('0x2d')]=_0x2b9eba;if(_0x2642c2[_0xac31('0x40')][_0xac31('0x4f')]){_0x28c9ba[_0xac31('0x63')]=[{'all':!![]}];}return db[_0xac31('0x5f')]['findAll'](_0x28c9ba);})[_0xac31('0x1e')](function(_0x797e8a){_0x2a44f3['rows']=_0x797e8a;return _0x2a44f3;});}})[_0xac31('0x1e')](respondWithFilteredResult(_0x588f79,_0x28c9ba))['catch'](handleError(_0x588f79,null));};exports['removeDispositions']=function(_0x12a93d,_0x2d5d51,_0x516fac){return db[_0xac31('0x3b')][_0xac31('0x58')]({'where':{'id':_0x12a93d[_0xac31('0x51')]['id']}})[_0xac31('0x1e')](handleEntityNotFound(_0x2d5d51,null))['then'](function(_0xa11d12){if(_0xa11d12){return _0xa11d12[_0xac31('0x64')](_0x12a93d['query']['ids']);}})['then'](respondWithStatusCode(_0x2d5d51,null))[_0xac31('0x27')](handleError(_0x2d5d51,null));};exports[_0xac31('0x65')]=function(_0x5d6bb4,_0x4eb660,_0x1e287b){if(_0x5d6bb4[_0xac31('0x53')]['id']){delete _0x5d6bb4[_0xac31('0x53')]['id'];}return db[_0xac31('0x3b')][_0xac31('0x58')]({'where':{'id':_0x5d6bb4['params']['id']}})['then'](handleEntityNotFound(_0x4eb660,null))[_0xac31('0x1e')](function(_0x3ca153){if(_0x3ca153){_0x5d6bb4[_0xac31('0x53')][_0xac31('0x5e')]=_0x3ca153['id'];return db['CannedAnswer']['create'](_0x5d6bb4['body']);}})[_0xac31('0x1e')](respondWithResult(_0x4eb660,null))[_0xac31('0x27')](handleError(_0x4eb660,null));};exports[_0xac31('0x66')]=function(_0x2e61e0,_0x32e4ef,_0x3964b8){var _0x2fe48c={'raw':![],'where':{}};var _0x357f9d={};var _0x28354c={'count':0x0,'rows':[]};return db['SmsAccount'][_0xac31('0x61')]({'where':{'id':_0x2e61e0[_0xac31('0x51')]['id']}})[_0xac31('0x1e')](handleEntityNotFound(_0x32e4ef,null))[_0xac31('0x1e')](function(_0x311519){if(_0x311519){_0x357f9d[_0xac31('0x3f')]=_[_0xac31('0x41')](db[_0xac31('0x67')][_0xac31('0x3c')]);_0x357f9d[_0xac31('0x40')]=_[_0xac31('0x41')](_0x2e61e0[_0xac31('0x40')]);_0x357f9d[_0xac31('0x48')]=_[_0xac31('0x42')](_0x357f9d[_0xac31('0x3f')],_0x357f9d[_0xac31('0x40')]);_0x2fe48c[_0xac31('0x43')]=_['intersection'](_0x357f9d[_0xac31('0x3f')],qs['fields'](_0x2e61e0[_0xac31('0x40')][_0xac31('0x44')]));_0x2fe48c[_0xac31('0x43')]=_0x2fe48c['attributes'][_0xac31('0x68')]?_0x2fe48c[_0xac31('0x43')]:_0x357f9d[_0xac31('0x3f')];if(!_0x2e61e0[_0xac31('0x40')][_0xac31('0x45')]('nolimit')){_0x2fe48c[_0xac31('0x2b')]=qs[_0xac31('0x2b')](_0x2e61e0[_0xac31('0x40')]['limit']);_0x2fe48c[_0xac31('0x2a')]=qs[_0xac31('0x2a')](_0x2e61e0[_0xac31('0x40')][_0xac31('0x2a')]);}_0x2fe48c[_0xac31('0x46')]=qs['sort'](_0x2e61e0[_0xac31('0x40')][_0xac31('0x47')]);_0x2fe48c[_0xac31('0x4c')]=qs[_0xac31('0x48')](_[_0xac31('0x49')](_0x2e61e0[_0xac31('0x40')],_0x357f9d['filters']));_0x2fe48c[_0xac31('0x4c')][_0xac31('0x5e')]=_0x311519['id'];if(_0x2e61e0[_0xac31('0x40')][_0xac31('0x4a')]){_0x2fe48c['where']=_['merge'](_0x2fe48c[_0xac31('0x4c')],{'$or':_[_0xac31('0x3a')](_0x2fe48c[_0xac31('0x43')],function(_0x16393a){var _0x1d5d44={};_0x1d5d44[_0x16393a]={'$like':'%'+_0x2e61e0[_0xac31('0x40')][_0xac31('0x4a')]+'%'};return _0x1d5d44;})});}_0x2fe48c=_[_0xac31('0x4b')]({},_0x2fe48c,_0x2e61e0[_0xac31('0x4e')]);return db[_0xac31('0x67')][_0xac31('0x2d')]({'where':_0x2fe48c['where']})['then'](function(_0x1b6906){_0x28354c[_0xac31('0x2d')]=_0x1b6906;if(_0x2e61e0[_0xac31('0x40')][_0xac31('0x4f')]){_0x2fe48c[_0xac31('0x63')]=[{'all':!![]}];}return db[_0xac31('0x67')][_0xac31('0x50')](_0x2fe48c);})[_0xac31('0x1e')](function(_0x223e75){_0x28354c[_0xac31('0x69')]=_0x223e75;return _0x28354c;});}})[_0xac31('0x1e')](respondWithFilteredResult(_0x32e4ef,_0x2fe48c))[_0xac31('0x27')](handleError(_0x32e4ef,null));};exports[_0xac31('0x6a')]=function(_0x40918f,_0x478e4a,_0x1f1d32){return db[_0xac31('0x3b')][_0xac31('0x58')]({'where':{'id':_0x40918f[_0xac31('0x51')]['id']}})[_0xac31('0x1e')](handleEntityNotFound(_0x478e4a,null))['then'](function(_0x3cf107){if(_0x3cf107){return _0x3cf107['removeAnswers'](_0x40918f['query']['ids']);}})[_0xac31('0x1e')](respondWithStatusCode(_0x478e4a,null))[_0xac31('0x27')](handleError(_0x478e4a,null));};exports[_0xac31('0x6b')]=function(_0x2ac620,_0x4c504a,_0x41c9ad){var _0x3642aa={'channel':_0xac31('0x6c')};var _0x5ed5cc=[];var _0x3dacab=[];var _0x2027cc={};return db[_0xac31('0x3b')]['find']({'where':{'id':_0x2ac620['params']['id']},'include':[{'model':db[_0xac31('0x6d')],'as':_0xac31('0x6e')}]})[_0xac31('0x1e')](handleEntityNotFound(_0x4c504a,null))[_0xac31('0x1e')](function(_0x3dd2bd){_0x3642aa[_0xac31('0x6f')]=_0x3dd2bd;_0x3642aa[_0xac31('0x70')]=_[_0xac31('0x71')](_0x3dd2bd[_0xac31('0x6e')],['priority'],[_0xac31('0x72')]);if(_0x3642aa[_0xac31('0x6f')][_0xac31('0x6e')]){delete _0x3642aa[_0xac31('0x6f')][_0xac31('0x6e')];}return db[_0xac31('0x73')][_0xac31('0x5c')]();})[_0xac31('0x1e')](function(_0x592a15){if(!_0x592a15){throw new db[(_0xac31('0x74'))][(_0xac31('0x75'))](_0xac31('0x76'));}_0x5ed5cc=_[_0xac31('0x77')](_['keys'](_0x592a15),['createdAt',_0xac31('0x78')]);_0x3dacab=_['difference'](_[_0xac31('0x41')](_0x592a15),[_0xac31('0x79'),_0xac31('0x78'),'CompanyId',_0xac31('0x7a')]);_0x3642aa[_0xac31('0x53')]={'mapKey':_0xac31('0x7b')};if(_0x3642aa[_0xac31('0x6f')][_0xac31('0x7c')]){switch(_0x3642aa[_0xac31('0x6f')][_0xac31('0x7c')]){case'twilio':_0x3642aa[_0xac31('0x53')][_0xac31('0x7d')]=_0x2ac620[_0xac31('0x53')][_0xac31('0x7e')];_0x3642aa['body'][_0xac31('0x53')]=_0x2ac620[_0xac31('0x53')][_0xac31('0x7f')];_0x3642aa[_0xac31('0x53')][_0xac31('0x80')]=_0x2ac620[_0xac31('0x53')][_0xac31('0x81')];break;case _0xac31('0x82'):_0x3642aa[_0xac31('0x53')][_0xac31('0x7d')]='+'+_0x2ac620[_0xac31('0x53')][_0xac31('0x83')];_0x3642aa[_0xac31('0x53')][_0xac31('0x53')]=_0x2ac620[_0xac31('0x53')][_0xac31('0x84')];break;case _0xac31('0x85'):_0x3642aa[_0xac31('0x53')][_0xac31('0x7d')]=_0x2ac620[_0xac31('0x53')][_0xac31('0x7d')];_0x3642aa['body']['body']=_0x2ac620[_0xac31('0x53')][_0xac31('0x25')];break;case _0xac31('0x86'):_0x3642aa[_0xac31('0x53')]['from']=_0x2ac620['body']['from'];_0x3642aa[_0xac31('0x53')]['body']=_0x2ac620['body']['body'];_0x3642aa[_0xac31('0x53')][_0xac31('0x80')]=_0x2ac620['body'][_0xac31('0x87')];break;case _0xac31('0x88'):_0x3642aa[_0xac31('0x53')][_0xac31('0x7d')]=_0x2ac620[_0xac31('0x53')][_0xac31('0x7e')];_0x3642aa[_0xac31('0x53')][_0xac31('0x53')]=_0x2ac620[_0xac31('0x53')][_0xac31('0x89')];_0x3642aa['body'][_0xac31('0x80')]=_0x2ac620[_0xac31('0x53')][_0xac31('0x8a')];break;case _0xac31('0x8b'):_0x3642aa[_0xac31('0x53')][_0xac31('0x7d')]='+'+_0x2ac620[_0xac31('0x53')][_0xac31('0x8c')][0x0][_0xac31('0x7d')];_0x3642aa[_0xac31('0x53')]['body']=_0x2ac620['body'][_0xac31('0x8c')][0x0][_0xac31('0x84')];_0x3642aa[_0xac31('0x53')]['messageId']=_0x2ac620[_0xac31('0x53')][_0xac31('0x8c')][0x0][_0xac31('0x80')];break;case _0xac31('0x8d'):_0x3642aa['body'][_0xac31('0x7d')]=_0x2ac620[_0xac31('0x53')][_0xac31('0x8e')];_0x3642aa[_0xac31('0x53')][_0xac31('0x53')]=_0x2ac620['body']['segmentedMessage'][_0xac31('0x25')];break;case _0xac31('0x8f'):_0x3642aa[_0xac31('0x53')][_0xac31('0x7d')]=_0x2ac620[_0xac31('0x53')][_0xac31('0x90')];_0x3642aa[_0xac31('0x53')][_0xac31('0x53')]=_0x2ac620[_0xac31('0x53')]['text'];_0x3642aa['body']['messageId']=_0x2ac620[_0xac31('0x53')][_0xac31('0x91')];break;case _0xac31('0x92'):_0x3642aa[_0xac31('0x53')][_0xac31('0x80')]=_0x2ac620[_0xac31('0x53')][0x0][_0xac31('0x25')]['id'];_0x3642aa[_0xac31('0x53')][_0xac31('0x7d')]=_0x2ac620[_0xac31('0x53')][0x0]['message'][_0xac31('0x7d')];_0x3642aa[_0xac31('0x53')][_0xac31('0x53')]=_0x2ac620['body'][0x0][_0xac31('0x25')]['text'];break;case _0xac31('0x93'):_0x3642aa[_0xac31('0x53')][_0xac31('0x7d')]=_0x2ac620['body'][_0xac31('0x7d')];_0x3642aa[_0xac31('0x53')][_0xac31('0x53')]=_0x2ac620[_0xac31('0x53')][_0xac31('0x25')];_0x3642aa['body'][_0xac31('0x80')]=_0x2ac620[_0xac31('0x53')]['refid'];break;}}if(_0x3642aa[_0xac31('0x53')]['id']){delete _0x3642aa[_0xac31('0x53')]['id'];}if(_[_0xac31('0x94')](_0x3642aa[_0xac31('0x53')]['from'])){throw new db[(_0xac31('0x74'))][(_0xac31('0x75'))](_0xac31('0x95'));}if(_[_0xac31('0x94')](_0x3642aa[_0xac31('0x53')]['body'])||_0x3642aa[_0xac31('0x53')][_0xac31('0x53')]===''){throw new db[(_0xac31('0x74'))][(_0xac31('0x75'))](_0xac31('0x96'));}if(_[_0xac31('0x94')](_0x3642aa[_0xac31('0x53')][_0xac31('0x97')])){throw new db[(_0xac31('0x74'))][(_0xac31('0x75'))](_0xac31('0x98')+_0x3dacab);}if(!_[_0xac31('0x99')](_0x3dacab,_0x3642aa['body'][_0xac31('0x97')])){throw new db['Sequelize'][(_0xac31('0x75'))](_0xac31('0x9a')+_0x3dacab);}_0x2027cc[_0x3642aa['body'][_0xac31('0x97')]]=_0x3642aa['body'][_0xac31('0x7d')];return db[_0xac31('0x9b')][_0xac31('0x58')]({'where':{'id':_0x3642aa[_0xac31('0x6f')][_0xac31('0x7a')]},'include':[{'model':db[_0xac31('0x73')],'as':_0xac31('0x9c'),'where':_0x2027cc,'limit':0x1,'order':[[_0xac31('0x78'),_0xac31('0x9d')]]}]});})[_0xac31('0x1e')](handleEntityNotFound(_0x4c504a,null))[_0xac31('0x1e')](function(_0x510d51){if(_0x510d51){_0x3642aa[_0xac31('0x9e')]=_[_0xac31('0x9f')](_0x510d51,[_0xac31('0x9c')]);if(_0x510d51[_0xac31('0x9c')][_0xac31('0x68')]){return _0x510d51[_0xac31('0x9c')][0x0];}var _0xbd5034=_['defaults'](_0x3642aa[_0xac31('0x53')],{'firstName':_0x3642aa[_0xac31('0x53')][_0xac31('0x7d')],'ListId':_0x510d51['id']});_0xbd5034[_0x3642aa[_0xac31('0x53')][_0xac31('0x97')]]=_0x3642aa[_0xac31('0x53')][_0xac31('0x7d')];return db['CmContact']['create'](_0xbd5034,{'fields':_0x5ed5cc,'raw':!![]});}})['then'](handleEntityNotFound(_0x4c504a,null))[_0xac31('0x1e')](function(_0x4bd685){if(_0x4bd685){_0x3642aa[_0xac31('0xa0')]=_0x4bd685;var _0x4c4260={'ContactId':_0x4bd685['id'],'phone':_0x3642aa[_0xac31('0x53')][_0xac31('0x7d')],'SmsAccountId':_0x2ac620[_0xac31('0x51')]['id']};var _0x592d09={'ContactId':_0x4bd685['id'],'SmsAccountId':_0x2ac620[_0xac31('0x51')]['id'],'closed':![]};return db[_0xac31('0xa1')][_0xac31('0x58')]({'where':_0x592d09})[_0xac31('0x1e')](function(_0x501ef6){if(_0x501ef6){return[_0x501ef6,![]];}return db[_0xac31('0xa1')][_0xac31('0x52')](_0x4c4260)[_0xac31('0x1e')](function(_0x3710a6){return[_0x3710a6,!![]];});});}})[_0xac31('0xa2')](function(_0x2354d6,_0x2512f7){_0x3642aa[_0xac31('0xa3')]=_0x2354d6[_0xac31('0x33')]({'plain':!![]});_0x3642aa[_0xac31('0xa3')][_0xac31('0xa4')]=![];if(_0x2512f7){if(_0x3642aa[_0xac31('0x6f')][_0xac31('0xa5')]){_0x3642aa['applications']['push']({'id':0x0,'priority':_0x3642aa[_0xac31('0x70')][_0xac31('0x68')]+0x1,'app':_0xac31('0xa6'),'appdata':_0xac31('0xa7'),'interval':_0xac31('0xa8')});}_0x3642aa['interaction'][_0xac31('0xa4')]=!![];}return db[_0xac31('0xa9')][_0xac31('0x52')]({'phone':_0x3642aa['body'][_0xac31('0x7d')],'messageId':_0x3642aa[_0xac31('0x53')][_0xac31('0x80')],'body':_0x3642aa['body'][_0xac31('0x53')],'SmsAccountId':_0x2ac620[_0xac31('0x51')]['id'],'SmsInteractionId':_0x2354d6['id'],'direction':'in','ContactId':_0x2354d6[_0xac31('0xaa')],'AttachmentId':_0x3642aa[_0xac31('0x53')][_0xac31('0xab')]});})['then'](function(_0x3d94ae){_0x3642aa[_0xac31('0x25')]=_0x3d94ae;if(_0x3642aa[_0xac31('0xa3')][_0xac31('0xac')]){return db[_0xac31('0xad')]['find']({'attributes':['id','name'],'where':{'id':_0x3642aa[_0xac31('0xa3')]['UserId']}})[_0xac31('0x1e')](function(_0x219f40){if(_0x219f40){_0x3642aa[_0xac31('0x70')][_0xac31('0xae')]({'id':0x0,'priority':0x0,'app':_0xac31('0xaf'),'appdata':_0x219f40[_0xac31('0x37')]+','+(_0x3642aa['account']['waitForTheAssignedAgent']||0xa),'interval':_0xac31('0xa8')});}return respondWithRpcPromise(_0xac31('0xb0'),_0xac31('0xb1'),_0x3642aa);});}return respondWithRpcPromise(_0xac31('0xb0'),_0xac31('0xb1'),_0x3642aa);})[_0xac31('0x1e')](function(_0x47111d){if(_0x47111d){var _0x465576=0xc8;var _0x306a65=_0xac31('0xb2');logger['info'](_0xac31('0xb3'),_0x306a65,_0x465576,'entity\x20found');logger[_0xac31('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x306a65,_0x465576,_0xac31('0xb4'),JSON[_0xac31('0xb5')](_0x47111d));if(_0x3642aa[_0xac31('0x6f')]['type']===_0xac31('0xb6')){return _0x4c504a[_0xac31('0x29')](_0x465576)[_0xac31('0x2e')](_0xac31('0xb7'),_0xac31('0xb8'))[_0xac31('0xb9')](_0xac31('0xba'));}else{return _0x4c504a['status'](_0x465576)[_0xac31('0xbb')](_0x47111d);}}})[_0xac31('0x27')](handleError(_0x4c504a,null));};exports[_0xac31('0xbc')]=function(_0x140115,_0x136442,_0x123ea9){return db[_0xac31('0x3b')]['findOne']({'where':{'id':_0x140115['params']['id']}})[_0xac31('0x1e')](handleEntityNotFound(_0x136442,null))[_0xac31('0x1e')](function(_0x49b543){if(_0x49b543){return db[_0xac31('0xbd')][_0xac31('0xbe')](function(_0x2c985b){return db[_0xac31('0x6d')][_0xac31('0x36')]({'where':{'SmsAccountId':_0x140115['params']['id']},'transaction':_0x2c985b})[_0xac31('0x1e')](function(_0x559066){var _0x1505a8=_[_0xac31('0x3a')](_0x140115[_0xac31('0x53')],function(_0x2450d9){_0x2450d9[_0xac31('0x5e')]=_0x140115[_0xac31('0x51')]['id'];return _0x2450d9;});return db['SmsApplication'][_0xac31('0xbf')](_0x1505a8,{'transaction':_0x2c985b});});})['then'](function(){return db[_0xac31('0x6d')][_0xac31('0xc0')]({'where':{'SmsAccountId':_0x140115[_0xac31('0x51')]['id']},'order':_0xac31('0xc1')});});}})[_0xac31('0x1e')](respondWithResult(_0x136442,null))['catch'](handleError(_0x136442,null));};exports[_0xac31('0xc2')]=function(_0x297a3f,_0x16df47,_0x43f271){var _0x243dff={};var _0x40e18c={};var _0x30714f;var _0x10bf83;return db[_0xac31('0x3b')][_0xac31('0x61')]({'where':{'id':_0x297a3f[_0xac31('0x51')]['id']}})['then'](handleEntityNotFound(_0x16df47,null))[_0xac31('0x1e')](function(_0x1d85fa){if(_0x1d85fa){_0x30714f=_0x1d85fa;_0x40e18c[_0xac31('0x3f')]=_[_0xac31('0x41')](db[_0xac31('0x6d')]['rawAttributes']);_0x40e18c[_0xac31('0x40')]=_['keys'](_0x297a3f[_0xac31('0x40')]);_0x40e18c[_0xac31('0x48')]=_['intersection'](_0x40e18c[_0xac31('0x3f')],_0x40e18c[_0xac31('0x40')]);_0x243dff[_0xac31('0x43')]=_[_0xac31('0x42')](_0x40e18c[_0xac31('0x3f')],qs[_0xac31('0x44')](_0x297a3f[_0xac31('0x40')][_0xac31('0x44')]));_0x243dff['attributes']=_0x243dff[_0xac31('0x43')][_0xac31('0x68')]?_0x243dff[_0xac31('0x43')]:_0x40e18c[_0xac31('0x3f')];_0x243dff['order']=qs[_0xac31('0x47')](_0x297a3f[_0xac31('0x40')][_0xac31('0x47')]);_0x243dff[_0xac31('0x4c')]=qs[_0xac31('0x48')](_['pick'](_0x297a3f[_0xac31('0x40')],_0x40e18c[_0xac31('0x48')]));if(_0x297a3f['query'][_0xac31('0x4a')]){_0x243dff[_0xac31('0x4c')]=_['merge'](_0x243dff[_0xac31('0x4c')],{'$or':_['map'](_0x243dff[_0xac31('0x43')],function(_0x5769a4){var _0x21e0f2={};_0x21e0f2[_0x5769a4]={'$like':'%'+_0x297a3f[_0xac31('0x40')][_0xac31('0x4a')]+'%'};return _0x21e0f2;})});}_0x243dff=_[_0xac31('0x4b')]({},_0x243dff,_0x297a3f[_0xac31('0x4e')]);return _0x30714f['getApplications'](_0x243dff);}})[_0xac31('0x1e')](function(_0x3659f2){if(_0x3659f2){_0x10bf83=_0x3659f2[_0xac31('0x68')];if(!_0x297a3f[_0xac31('0x40')][_0xac31('0x45')](_0xac31('0x62'))){_0x243dff[_0xac31('0x2b')]=qs[_0xac31('0x2b')](_0x297a3f[_0xac31('0x40')][_0xac31('0x2b')]);_0x243dff['offset']=qs[_0xac31('0x2a')](_0x297a3f[_0xac31('0x40')][_0xac31('0x2a')]);}return _0x30714f['getApplications'](_0x243dff);}})[_0xac31('0x1e')](function(_0x585a6c){if(_0x585a6c){return _0x585a6c?{'count':_0x10bf83,'rows':_0x585a6c}:null;}})[_0xac31('0x1e')](respondWithResult(_0x16df47,null))['catch'](handleError(_0x16df47,null));};exports[_0xac31('0xc3')]=function(_0x562cc5,_0x53f42d,_0x104fa9){var _0x11ae91={'raw':![],'where':{}};var _0x3deb9b={};var _0x502815={'count':0x0,'rows':[]};return db['SmsAccount']['findOne']({'where':{'id':_0x562cc5[_0xac31('0x51')]['id']}})['then'](handleEntityNotFound(_0x53f42d,null))[_0xac31('0x1e')](function(_0x4317e3){if(_0x4317e3){_0x3deb9b[_0xac31('0x3f')]=_[_0xac31('0x41')](db[_0xac31('0xa1')][_0xac31('0x3c')]);_0x3deb9b[_0xac31('0x40')]=_[_0xac31('0x41')](_0x562cc5[_0xac31('0x40')]);_0x3deb9b['filters']=_[_0xac31('0x42')](_0x3deb9b[_0xac31('0x3f')],_0x3deb9b[_0xac31('0x40')]);_0x11ae91['attributes']=_['intersection'](_0x3deb9b[_0xac31('0x3f')],qs[_0xac31('0x44')](_0x562cc5[_0xac31('0x40')][_0xac31('0x44')]));_0x11ae91[_0xac31('0x43')]=_0x11ae91['attributes']['length']?_0x11ae91[_0xac31('0x43')]:_0x3deb9b['model'];if(!_0x562cc5[_0xac31('0x40')][_0xac31('0x45')](_0xac31('0x62'))){_0x11ae91[_0xac31('0x2b')]=qs[_0xac31('0x2b')](_0x562cc5['query'][_0xac31('0x2b')]);_0x11ae91[_0xac31('0x2a')]=qs[_0xac31('0x2a')](_0x562cc5[_0xac31('0x40')][_0xac31('0x2a')]);}_0x11ae91[_0xac31('0x46')]=qs['sort'](_0x562cc5[_0xac31('0x40')][_0xac31('0x47')]);_0x11ae91['where']=qs[_0xac31('0x48')](_[_0xac31('0x49')](_0x562cc5[_0xac31('0x40')],_0x3deb9b[_0xac31('0x48')]));_0x11ae91['where']['SmsAccountId']=_0x4317e3['id'];if(_0x562cc5[_0xac31('0x40')][_0xac31('0x4a')]){_0x11ae91[_0xac31('0x4c')]=_[_0xac31('0x4b')](_0x11ae91[_0xac31('0x4c')],{'$or':_[_0xac31('0x3a')](_0x11ae91[_0xac31('0x43')],function(_0x2dba0d){var _0xe58f6={};_0xe58f6[_0x2dba0d]={'$like':'%'+_0x562cc5[_0xac31('0x40')][_0xac31('0x4a')]+'%'};return _0xe58f6;})});}_0x11ae91=_[_0xac31('0x4b')]({},_0x11ae91,_0x562cc5[_0xac31('0x4e')]);return db['SmsInteraction'][_0xac31('0x2d')]({'where':_0x11ae91[_0xac31('0x4c')]})[_0xac31('0x1e')](function(_0x1b2cdf){_0x502815[_0xac31('0x2d')]=_0x1b2cdf;if(_0x562cc5[_0xac31('0x40')]['includeAll']){_0x11ae91[_0xac31('0x63')]=[{'model':db[_0xac31('0x73')],'as':_0xac31('0xc4'),'required':![]},{'model':db['User'],'as':_0xac31('0xc5'),'attributes':['name',_0xac31('0xc6'),_0xac31('0xc7')],'required':![]},{'model':db[_0xac31('0xc8')],'as':_0xac31('0xc9'),'attributes':['id',_0xac31('0x37'),_0xac31('0xca')],'where':_0x562cc5[_0xac31('0x40')][_0xac31('0xcb')]?{'id':_0x562cc5[_0xac31('0x40')][_0xac31('0xcb')]}:undefined,'required':_0x562cc5[_0xac31('0x40')][_0xac31('0xcb')]?!![]:![]}];}return db['SmsInteraction'][_0xac31('0x50')](_0x11ae91);})[_0xac31('0x1e')](function(_0x166ebb){_0x502815[_0xac31('0x69')]=_0x166ebb;return _0x502815;});}})[_0xac31('0x1e')](respondWithFilteredResult(_0x53f42d,_0x11ae91))[_0xac31('0x27')](handleError(_0x53f42d,null));};exports[_0xac31('0xb9')]=function(_0x1d4639,_0x53a887,_0x36b180){var _0x2194e5,_0x2f7646,_0x210d74;if(_[_0xac31('0x94')](_0x1d4639[_0xac31('0x53')]['body'])||_0x1d4639['body'][_0xac31('0x53')]===''){throw new db[(_0xac31('0x74'))][(_0xac31('0x75'))](_0xac31('0x96'));}if(_['isNil'](_0x1d4639[_0xac31('0x53')]['to'])){throw new db['Sequelize']['ValidationError'](_0xac31('0xcc'));}_0x2194e5=_0x1d4639['body']['to'];return db[_0xac31('0x3b')][_0xac31('0x58')]({'where':{'id':_0x1d4639[_0xac31('0x51')]['id']},'include':[{'model':db['CmList'],'as':_0xac31('0xcd'),'include':[{'model':db[_0xac31('0x73')],'as':'Contacts','where':{'mobile':_0x2194e5},'limit':0x1,'order':[[_0xac31('0x78'),_0xac31('0x9d')]]}]}]})['then'](handleEntityNotFound(_0x53a887,null))[_0xac31('0x1e')](function(_0x49ceb1){if(_0x49ceb1&&_0x49ceb1[_0xac31('0xcd')]){_0x2f7646=_0x49ceb1[_0xac31('0x33')]({'plain':!![]});if(_0x2f7646[_0xac31('0xcd')]&&_0x2f7646['List'][_0xac31('0x9c')][_0xac31('0x68')]){return _0x2f7646[_0xac31('0xcd')][_0xac31('0x9c')][0x0];}return db[_0xac31('0x73')]['create'](_[_0xac31('0x1a')](_0x1d4639[_0xac31('0x53')],{'firstName':_0x2194e5,'mobile':_0x2194e5,'phone':_0x2194e5,'ListId':_0x2f7646[_0xac31('0x7a')]}));}})['then'](handleEntityNotFound(_0x53a887,null))[_0xac31('0x1e')](function(_0x22a378){if(_0x22a378){_0x210d74=_0x22a378;return db[_0xac31('0xa1')]['find']({'where':{'ContactId':_0x210d74['id'],'closed':![],'SmsAccountId':_0x2f7646['id']}})[_0xac31('0x1e')](function(_0x5d1cf6){if(_0x5d1cf6){return[_0x5d1cf6,![]];}return db[_0xac31('0xa1')][_0xac31('0x52')]({'UserId':_0x1d4639[_0xac31('0x54')]['id'],'ContactId':_0x210d74['id'],'SmsAccountId':_0x2f7646['id'],'phone':_0x2194e5,'firstMsgDirection':_0xac31('0xce'),'Messages':[_[_0xac31('0x4b')](_0x1d4639[_0xac31('0x53')],{'read':![],'body':_0x1d4639[_0xac31('0x53')][_0xac31('0x53')],'phone':_0x2194e5,'SmsAccountId':_0x2f7646['id'],'UserId':_0x1d4639[_0xac31('0x54')]['id'],'ContactId':_0x210d74['id']})]},{'include':[{'model':db[_0xac31('0xa9')],'as':_0xac31('0xcf')}]})[_0xac31('0x1e')](function(_0x293e8d){return[_0x293e8d,!![]];});});}})[_0xac31('0xa2')](function(_0x4e4e79,_0x3438ae){if(_0x3438ae){return _0x4e4e79;}return db[_0xac31('0xa9')][_0xac31('0x52')](_[_0xac31('0x4b')](_0x1d4639[_0xac31('0x53')],{'read':![],'body':_0x1d4639['body']['body'],'phone':_0x2194e5,'SmsAccountId':_0x2f7646['id'],'SmsInteractionId':_0x4e4e79['id'],'UserId':_0x1d4639[_0xac31('0x54')]['id'],'ContactId':_0x210d74['id']}))[_0xac31('0x1e')](function(_0x5a5851){_0x4e4e79['dataValues'][_0xac31('0xcf')]=[];_0x4e4e79[_0xac31('0xd0')][_0xac31('0xcf')]['push'](_0x5a5851[_0xac31('0xd0')]);return _0x4e4e79;});})[_0xac31('0x1e')](respondWithResult(_0x53a887,null))[_0xac31('0x27')](handleError(_0x53a887,null));};exports[_0xac31('0x29')]=function(_0x173706,_0x46df4e,_0x2572ac){if(_0x173706['body']['id']){delete _0x173706[_0xac31('0x53')]['id'];}var _0x1ea009,_0x377ec2,_0x3e777c;return db[_0xac31('0x3b')][_0xac31('0x58')]({'where':{'id':_0x173706[_0xac31('0x51')]['id']}})[_0xac31('0x1e')](handleEntityNotFound(_0x46df4e,null))[_0xac31('0x1e')](function(_0x266c72){if(_0x266c72){_0x3e777c=_0x266c72;logger[_0xac31('0x22')](_0xac31('0xb3'),'status','received\x20delivery\x20report\x20from',_0x266c72[_0xac31('0x7c')],util[_0xac31('0xd1')](_0x173706[_0xac31('0x53')],{'showHidden':![],'depth':null}));switch(_0x266c72[_0xac31('0x7c')]){case _0xac31('0x82'):if(_0x173706[_0xac31('0x53')]['skebby_dispatch_id']&&_0x173706[_0xac31('0x53')][_0xac31('0x29')]){_0x377ec2=_0x173706[_0xac31('0x53')][_0xac31('0x29')];return db[_0xac31('0xa9')]['find']({'where':{'messageId':_0x173706[_0xac31('0x53')][_0xac31('0xd2')]}});}break;case _0xac31('0x85'):if(_0x173706[_0xac31('0x53')][_0xac31('0xd3')]&&_0x173706['body'][_0xac31('0xd4')]){_0x377ec2=_0x173706[_0xac31('0x53')]['statusInt'];return db['SmsMessage'][_0xac31('0x58')]({'where':{'messageId':_0x173706[_0xac31('0x53')][_0xac31('0xd3')]}});}break;case'clicksend':if(_0x173706[_0xac31('0x53')][_0xac31('0x87')]&&_0x173706[_0xac31('0x53')][_0xac31('0xd5')]){_0x377ec2=_0x173706[_0xac31('0x53')][_0xac31('0xd5')];return db[_0xac31('0xa9')][_0xac31('0x58')]({'where':{'messageId':_0x173706[_0xac31('0x53')][_0xac31('0x87')]}});}break;case _0xac31('0x8b'):var _0x3e302a=_0x173706['body'][_0xac31('0x8c')][0x0];if(_0x3e302a['messageId']&&_0x3e302a['status'][_0xac31('0xd6')]===_0xac31('0xd7')){_0x377ec2=_0x3e302a['status']['groupName'];return db['SmsMessage'][_0xac31('0x58')]({'where':{'messageId':_0x3e302a[_0xac31('0x80')]}});}break;case _0xac31('0x8f'):if(_0x173706['body'][_0xac31('0x80')]&&_0x173706[_0xac31('0x53')]['status']){_0x377ec2=_0x173706[_0xac31('0x53')][_0xac31('0x29')];return db[_0xac31('0xa9')][_0xac31('0x58')]({'where':{'messageId':_0x173706['body'][_0xac31('0x80')]}});}break;case _0xac31('0x92'):if(_0x173706[_0xac31('0x53')][0x0][_0xac31('0x25')]['id']){_0x377ec2=_0x173706['body'][0x0][_0xac31('0x7c')];return db[_0xac31('0xa9')]['find']({'where':{'messageId':_0x173706[_0xac31('0x53')][0x0][_0xac31('0x25')]['id']}});}break;case _0xac31('0x93'):if(_0x173706['body']['redif']&&_0x173706[_0xac31('0x53')]['status']){_0x377ec2=_0x173706[_0xac31('0x53')][_0xac31('0x29')];return db[_0xac31('0xa9')]['find']({'where':{'messageId':_0x173706['body']['redif']}});}break;}}})['then'](handleEntityNotFound(_0x46df4e,null))[_0xac31('0x1e')](function(_0x3efe60){if(_0x3efe60){_0x1ea009=_0x3efe60;switch(_0x3e777c['type']){case _0xac31('0x82'):if(_0x377ec2===_0xac31('0xd7')){return _0x1ea009[_0xac31('0x32')]({'read':!![]});}else{logger[_0xac31('0x23')](_0xac31('0xb3'),_0xac31('0x29'),_0xac31('0x82'),util[_0xac31('0xd1')](_0x173706[_0xac31('0x53')],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x377ec2==='1'){return _0x1ea009[_0xac31('0x32')]({'read':!![]});}else{logger[_0xac31('0x23')](_0xac31('0xb3'),_0xac31('0x29'),'skebby',util[_0xac31('0xd1')](_0x173706[_0xac31('0x53')],{'showHidden':![],'depth':null}));}break;case _0xac31('0x86'):if(!_0x173706['body'][_0xac31('0xd8')]&&_0x377ec2>=0xc8&&_0x377ec2<=0xce){return _0x1ea009[_0xac31('0x32')]({'read':!![]});}else{logger[_0xac31('0x23')](_0xac31('0xb3'),'status',_0xac31('0x86'),util[_0xac31('0xd1')](_0x173706[_0xac31('0x53')],{'showHidden':![],'depth':null}));}break;case _0xac31('0x8b'):var _0x128cb5=_0x173706['body'][_0xac31('0x8c')][0x0];if(_0x128cb5[_0xac31('0x29')][_0xac31('0xd6')]==='DELIVERED'){return _0x1ea009[_0xac31('0x32')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xac31('0x8b'),util[_0xac31('0xd1')](_0x173706[_0xac31('0x53')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x377ec2==_0xac31('0xd9')||_0x377ec2==_0xac31('0xda')){return _0x1ea009[_0xac31('0x32')]({'read':!![]});}else{logger[_0xac31('0x23')](_0xac31('0xb3'),_0xac31('0x29'),_0xac31('0x8f'),util[_0xac31('0xd1')](_0x173706[_0xac31('0x53')],{'showHidden':![],'depth':null}));}break;case _0xac31('0x92'):if(_0x377ec2==_0xac31('0xdb')){return _0x1ea009[_0xac31('0x32')]({'read':!![]});}else{logger[_0xac31('0x23')](_0xac31('0xb3'),'status',_0xac31('0x92'),util[_0xac31('0xd1')](_0x173706[_0xac31('0x53')],{'showHidden':![],'depth':null}));}break;case _0xac31('0x93'):if(_0x377ec2===_0xac31('0xdc')||_0x377ec2==='ACCEPTD'){return _0x1ea009[_0xac31('0x32')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xac31('0x29'),'intelepeer',util[_0xac31('0xd1')](_0x173706[_0xac31('0x53')],{'showHidden':![],'depth':null}));}break;}return _0x1ea009;}})[_0xac31('0x1e')](respondWithResult(_0x46df4e,null))[_0xac31('0x27')](handleError(_0x46df4e,null));};exports[_0xac31('0xdd')]=function(_0x493b0c,_0x2b7d0a,_0x4c7fd9){var _0x5c14c6,_0x2b6f8f,_0x4e3510;return db[_0xac31('0x3b')][_0xac31('0x58')]({'where':{'id':_0x493b0c[_0xac31('0x51')]['id']}})[_0xac31('0x1e')](handleEntityNotFound(_0x2b7d0a,null))[_0xac31('0x1e')](function(_0x45c2af){if(_0x45c2af){_0x4e3510=_0x45c2af;logger[_0xac31('0x22')](_0xac31('0xb3'),'status','received\x20delivery\x20report\x20from',_0x45c2af[_0xac31('0x7c')],util['inspect'](_0x493b0c[_0xac31('0x40')],{'showHidden':![],'depth':null}));switch(_0x45c2af[_0xac31('0x7c')]){case _0xac31('0x8d'):if(_0x493b0c[_0xac31('0x40')][_0xac31('0xde')]&&_0x493b0c[_0xac31('0x40')][_0xac31('0xdf')]){_0x2b6f8f=_0x493b0c['query'][_0xac31('0xdf')];return db[_0xac31('0xa9')][_0xac31('0x58')]({'where':{'messageId':_0x493b0c[_0xac31('0x40')]['message-id']}});}break;}}})[_0xac31('0x1e')](handleEntityNotFound(_0x2b7d0a,null))[_0xac31('0x1e')](function(_0x28c299){if(_0x28c299){_0x5c14c6=_0x28c299;switch(_0x4e3510[_0xac31('0x7c')]){case _0xac31('0x8d'):if(_0x2b6f8f==='2'||_0x2b6f8f==='6'){return _0x5c14c6[_0xac31('0x32')]({'read':!![]});}else{logger[_0xac31('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xac31('0x29'),_0xac31('0x8d'),util[_0xac31('0xd1')](_0x493b0c[_0xac31('0x40')],{'showHidden':![],'depth':null}));};break;}return _0x5c14c6;}})[_0xac31('0x1e')](respondWithResult(_0x2b7d0a,null))['catch'](handleError(_0x2b7d0a,null));};exports[_0xac31('0xe0')]=function(_0x1b785b,_0x5e188b,_0x1c15bb){return db[_0xac31('0x3b')][_0xac31('0x58')]({'where':{'id':_0x1b785b[_0xac31('0x51')]['id']}})[_0xac31('0x1e')](handleEntityNotFound(_0x5e188b,null))['then'](function(_0x57f71f){if(_0x57f71f){return _0x57f71f['addAgents'](_0x1b785b[_0xac31('0x53')][_0xac31('0xe1')],_[_0xac31('0x9f')](_0x1b785b[_0xac31('0x53')],[_0xac31('0xe1'),'id'])||{})[_0xac31('0xa2')](function(_0x51b572){for(var _0x251324=0x0;_0x251324<_0x1b785b[_0xac31('0x53')][_0xac31('0xe1')][_0xac31('0x68')];_0x251324+=0x1){socket[_0xac31('0xe2')](_0xac31('0xe3'),{'UserId':Number(_0x1b785b['body'][_0xac31('0xe1')][_0x251324]),'SmsAccountId':Number(_0x1b785b['params']['id'])});}return _0x51b572;});}})['then'](respondWithResult(_0x5e188b,null))['catch'](handleError(_0x5e188b,null));};exports[_0xac31('0xe4')]=function(_0xb653e5,_0x39114a,_0x514272){return db[_0xac31('0x3b')][_0xac31('0x58')]({'where':{'id':_0xb653e5['params']['id']}})[_0xac31('0x1e')](handleEntityNotFound(_0x39114a,null))['then'](function(_0x1ed52a){if(_0x1ed52a){return _0x1ed52a[_0xac31('0xe4')](_0xb653e5['query']['ids'])['then'](function(){if(_[_0xac31('0xe5')](_0xb653e5[_0xac31('0x40')]['ids'])){for(var _0x14fde9=0x0;_0x14fde9<_0xb653e5['query'][_0xac31('0xe1')][_0xac31('0x68')];_0x14fde9+=0x1){socket[_0xac31('0xe2')](_0xac31('0xe6'),{'UserId':Number(_0xb653e5[_0xac31('0x40')][_0xac31('0xe1')][_0x14fde9]),'SmsAccountId':Number(_0xb653e5['params']['id'])});}}else{socket[_0xac31('0xe2')](_0xac31('0xe6'),{'UserId':Number(_0xb653e5[_0xac31('0x40')][_0xac31('0xe1')]),'SmsAccountId':Number(_0xb653e5['params']['id'])});}});}})[_0xac31('0x1e')](respondWithStatusCode(_0x39114a,null))[_0xac31('0x27')](handleError(_0x39114a,null));};exports[_0xac31('0xe7')]=function(_0x216de5,_0xdc398f,_0x82d46d){var _0x37f2e0={};var _0x4c5007={};var _0x3dc4d2;var _0x206834;return db[_0xac31('0x3b')][_0xac31('0x61')]({'where':{'id':_0x216de5['params']['id']}})['then'](handleEntityNotFound(_0xdc398f,null))[_0xac31('0x1e')](function(_0x295d2b){if(_0x295d2b){_0x3dc4d2=_0x295d2b;_0x4c5007[_0xac31('0x3f')]=_['keys'](db[_0xac31('0xad')][_0xac31('0x3c')]);_0x4c5007['query']=_[_0xac31('0x41')](_0x216de5[_0xac31('0x40')]);_0x4c5007[_0xac31('0x48')]=_[_0xac31('0x42')](_0x4c5007[_0xac31('0x3f')],_0x4c5007[_0xac31('0x40')]);_0x37f2e0[_0xac31('0x43')]=_['intersection'](_0x4c5007[_0xac31('0x3f')],qs[_0xac31('0x44')](_0x216de5[_0xac31('0x40')][_0xac31('0x44')]));_0x37f2e0[_0xac31('0x43')]=_0x37f2e0[_0xac31('0x43')]['length']?_0x37f2e0[_0xac31('0x43')]:_0x4c5007[_0xac31('0x3f')];_0x37f2e0[_0xac31('0x46')]=qs[_0xac31('0x47')](_0x216de5[_0xac31('0x40')][_0xac31('0x47')]);_0x37f2e0[_0xac31('0x4c')]=qs['filters'](_[_0xac31('0x49')](_0x216de5['query'],_0x4c5007[_0xac31('0x48')]));if(_0x216de5[_0xac31('0x40')][_0xac31('0x4a')]){_0x37f2e0['where']=_[_0xac31('0x4b')](_0x37f2e0[_0xac31('0x4c')],{'$or':_[_0xac31('0x3a')](_0x37f2e0[_0xac31('0x43')],function(_0x35b113){var _0xd2bbba={};_0xd2bbba[_0x35b113]={'$like':'%'+_0x216de5[_0xac31('0x40')][_0xac31('0x4a')]+'%'};return _0xd2bbba;})});}_0x37f2e0=_[_0xac31('0x4b')]({},_0x37f2e0,_0x216de5[_0xac31('0x4e')]);return _0x3dc4d2[_0xac31('0xe7')](_0x37f2e0);}})[_0xac31('0x1e')](function(_0x5b86cd){if(_0x5b86cd){_0x206834=_0x5b86cd['length'];if(!_0x216de5[_0xac31('0x40')]['hasOwnProperty'](_0xac31('0x62'))){_0x37f2e0[_0xac31('0x2b')]=qs[_0xac31('0x2b')](_0x216de5['query'][_0xac31('0x2b')]);_0x37f2e0[_0xac31('0x2a')]=qs[_0xac31('0x2a')](_0x216de5[_0xac31('0x40')][_0xac31('0x2a')]);}return _0x3dc4d2[_0xac31('0xe7')](_0x37f2e0);}})[_0xac31('0x1e')](function(_0x1dfeed){if(_0x1dfeed){return _0x1dfeed?{'count':_0x206834,'rows':_0x1dfeed}:null;}})['then'](respondWithResult(_0xdc398f,null))['catch'](handleError(_0xdc398f,null));}; \ No newline at end of file +var _0x8ff5=['Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','SmsAccountId','Disposition','findOne','hasOwnProperty','nolimit','order','removeDispositions','addAnswer','getAnswers','CannedAnswer','removeAnswers','ids','notify','SmsApplication','Applications','account','applications','orderBy','priority','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','mobile','twilio','from','From','Body','MessageSid','skebby','sender','text','connectel','clicksend','message_id','messageId','results','originatingAddress','replyMessageId','bandwidth','intelepeer','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','ListId','DESC','list','omit','Contacts','SmsInteraction','spread','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','ContactId','UserId','User','unshift','agent','waitForTheAssignedAgent','startRouting','Start','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s','entity\x20found','set','Content-Type','json','addApplications','sequelize','bulkCreate','findAndCountAll','getApplications','getInteractions','Owner','fullname','internal','Tag','color','tag','List','out','SmsMessage','Messages','dataValues','received\x20delivery\x20report\x20from','skebby_dispatch_id','requestid','statusInt','status_code','infobip','groupName','DELIVERED','clickatell','redif','update','inspect','error_code','RECEIVED_BY_RECIPIENT','DELIVRD','ACCEPTD','statusGet','message-id','state','csc','addAgents','removeAgents','isArray','emit','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./smsAccount.socket','register','jayson/promise','client','request','then','info','request\x20sent','debug','stringify','error','code','SmsAccount,\x20%s,\x20%s','message','catch','status','end','offset','undefined','limit','count','Content-Range','apply','reject','save','destroy','get','SmsAccounts','UserProfileResource','stack','name','send','index'];(function(_0xbf5e16,_0x146ce3){var _0x5975a5=function(_0x2387a7){while(--_0x2387a7){_0xbf5e16['push'](_0xbf5e16['shift']());}};_0x5975a5(++_0x146ce3);}(_0x8ff5,0xa2));var _0x58ff=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x8ff5[_0x8c43de];return _0xa6591b;};'use strict';var emlformat=require(_0x58ff('0x0'));var rimraf=require(_0x58ff('0x1'));var zipdir=require(_0x58ff('0x2'));var jsonpatch=require(_0x58ff('0x3'));var rp=require(_0x58ff('0x4'));var moment=require(_0x58ff('0x5'));var BPromise=require(_0x58ff('0x6'));var Mustache=require(_0x58ff('0x7'));var util=require(_0x58ff('0x8'));var path=require(_0x58ff('0x9'));var sox=require(_0x58ff('0xa'));var csv=require(_0x58ff('0xb'));var ejs=require(_0x58ff('0xc'));var fs=require('fs');var fs_extra=require(_0x58ff('0xd'));var _=require(_0x58ff('0xe'));var squel=require(_0x58ff('0xf'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x58ff('0xb'));var querystring=require(_0x58ff('0x10'));var Papa=require(_0x58ff('0x11'));var Redis=require(_0x58ff('0x12'));var authService=require(_0x58ff('0x13'));var qs=require(_0x58ff('0x14'));var as=require(_0x58ff('0x15'));var hardwareService=require(_0x58ff('0x16'));var logger=require('../../config/logger')(_0x58ff('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x58ff('0x18'));var db=require(_0x58ff('0x19'))['db'];config['redis']=_[_0x58ff('0x1a')](config[_0x58ff('0x1b')],{'host':_0x58ff('0x1c'),'port':0x18eb});var socket=require(_0x58ff('0x1d'))(new Redis(config[_0x58ff('0x1b')]));require(_0x58ff('0x1e'))[_0x58ff('0x1f')](socket);var jayson=require(_0x58ff('0x20'));var client=jayson[_0x58ff('0x21')]['http']({'port':0x232c});function respondWithRpcPromise(_0x837689,_0x16cbe2,_0x1765b3,_0x4e1c45){return new BPromise(function(_0x3aeea4,_0x339b25){var _0x170114=_0x4e1c45||client;return _0x170114[_0x58ff('0x22')](_0x837689,_0x1765b3)[_0x58ff('0x23')](function(_0x4e9ca2){logger[_0x58ff('0x24')]('SmsAccount,\x20%s,\x20%s',_0x16cbe2,_0x58ff('0x25'));logger[_0x58ff('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x16cbe2,'request\x20sent',JSON[_0x58ff('0x27')](_0x4e9ca2));if(_0x4e9ca2[_0x58ff('0x28')]){if(_0x4e9ca2[_0x58ff('0x28')][_0x58ff('0x29')]===0x1f4){logger[_0x58ff('0x28')](_0x58ff('0x2a'),_0x16cbe2,_0x4e9ca2['error'][_0x58ff('0x2b')]);return _0x339b25(_0x4e9ca2[_0x58ff('0x28')][_0x58ff('0x2b')]);}logger['error'](_0x58ff('0x2a'),_0x16cbe2,_0x4e9ca2[_0x58ff('0x28')][_0x58ff('0x2b')]);return _0x3aeea4(_0x4e9ca2[_0x58ff('0x28')]['message']);}else{logger[_0x58ff('0x24')](_0x58ff('0x2a'),_0x16cbe2,_0x58ff('0x25'));_0x3aeea4(_0x4e9ca2['result']['message']);}})[_0x58ff('0x2c')](function(_0x407d0c){logger[_0x58ff('0x28')](_0x58ff('0x2a'),_0x16cbe2,_0x407d0c);_0x339b25(_0x407d0c);});});}function respondWithStatusCode(_0x4fa5d1,_0x5403c2){_0x5403c2=_0x5403c2||0xcc;return function(_0xfd0888){if(_0xfd0888){return _0x4fa5d1['sendStatus'](_0x5403c2);}return _0x4fa5d1[_0x58ff('0x2d')](_0x5403c2)[_0x58ff('0x2e')]();};}function respondWithResult(_0x2684f5,_0x506621){_0x506621=_0x506621||0xc8;return function(_0x335a06){if(_0x335a06){return _0x2684f5['status'](_0x506621)['json'](_0x335a06);}};}function respondWithFilteredResult(_0x3d1614,_0x34efef){return function(_0x4f04b6){if(_0x4f04b6){var _0x3f440e=typeof _0x34efef[_0x58ff('0x2f')]===_0x58ff('0x30')&&typeof _0x34efef[_0x58ff('0x31')]===_0x58ff('0x30');var _0x206e55=_0x4f04b6[_0x58ff('0x32')];var _0x2ff252=_0x3f440e?0x0:_0x34efef[_0x58ff('0x2f')];var _0x4e28a3=_0x3f440e?_0x4f04b6[_0x58ff('0x32')]:_0x34efef[_0x58ff('0x2f')]+_0x34efef[_0x58ff('0x31')];var _0x1ae636;if(_0x4e28a3>=_0x206e55){_0x4e28a3=_0x206e55;_0x1ae636=0xc8;}else{_0x1ae636=0xce;}_0x3d1614[_0x58ff('0x2d')](_0x1ae636);return _0x3d1614['set'](_0x58ff('0x33'),_0x2ff252+'-'+_0x4e28a3+'/'+_0x206e55)['json'](_0x4f04b6);}return null;};}function patchUpdates(_0x5f2ada){return function(_0x2730ce){try{jsonpatch[_0x58ff('0x34')](_0x2730ce,_0x5f2ada,!![]);}catch(_0xc5eae6){return BPromise[_0x58ff('0x35')](_0xc5eae6);}return _0x2730ce[_0x58ff('0x36')]();};}function saveUpdates(_0x2ac5d0,_0x7ce7e3){return function(_0x593489){if(_0x593489){return _0x593489['update'](_0x2ac5d0)[_0x58ff('0x23')](function(_0xf92f78){return _0xf92f78;});}return null;};}function removeEntity(_0x2c692e,_0x1a0e43){return function(_0x4644bd){if(_0x4644bd){return _0x4644bd[_0x58ff('0x37')]()['then'](function(){var _0x412ac1=_0x4644bd[_0x58ff('0x38')]({'plain':!![]});var _0x305d25=_0x58ff('0x39');return db[_0x58ff('0x3a')]['destroy']({'where':{'type':_0x305d25,'resourceId':_0x412ac1['id']}})[_0x58ff('0x23')](function(){return _0x4644bd;});})[_0x58ff('0x23')](function(){_0x2c692e[_0x58ff('0x2d')](0xcc)[_0x58ff('0x2e')]();});}};}function handleEntityNotFound(_0x43a5ab,_0xc43357){return function(_0x3986b8){if(!_0x3986b8){_0x43a5ab['sendStatus'](0x194);}return _0x3986b8;};}function handleError(_0x48a158,_0x51e652){_0x51e652=_0x51e652||0x1f4;return function(_0xab175){logger[_0x58ff('0x28')](_0xab175[_0x58ff('0x3b')]);if(_0xab175[_0x58ff('0x3c')]){delete _0xab175[_0x58ff('0x3c')];}_0x48a158[_0x58ff('0x2d')](_0x51e652)[_0x58ff('0x3d')](_0xab175);};}exports[_0x58ff('0x3e')]=function(_0x5d4dc1,_0x23cd76){var _0x41231e={'include':[{'model':db[_0x58ff('0x3f')],'as':_0x58ff('0x40')}]},_0x3d114f={},_0x45dca1={'count':0x0,'rows':[]};var _0x180b9a=_[_0x58ff('0x41')](db[_0x58ff('0x42')][_0x58ff('0x43')],function(_0x5a78b4){return{'name':_0x5a78b4[_0x58ff('0x44')],'type':_0x5a78b4['type'][_0x58ff('0x45')]};});_0x3d114f[_0x58ff('0x46')]=_[_0x58ff('0x41')](_0x180b9a,_0x58ff('0x3c'));_0x3d114f['query']=_['keys'](_0x5d4dc1[_0x58ff('0x47')]);_0x3d114f[_0x58ff('0x48')]=_[_0x58ff('0x49')](_0x3d114f['model'],_0x3d114f['query']);_0x41231e[_0x58ff('0x4a')]=_[_0x58ff('0x49')](_0x3d114f['model'],qs['fields'](_0x5d4dc1['query'][_0x58ff('0x4b')]));_0x41231e[_0x58ff('0x4a')]=_0x41231e['attributes']['length']?_0x41231e['attributes']:_0x3d114f[_0x58ff('0x46')];if(!_0x5d4dc1['query']['hasOwnProperty']('nolimit')){_0x41231e[_0x58ff('0x31')]=qs['limit'](_0x5d4dc1['query']['limit']);_0x41231e['offset']=qs['offset'](_0x5d4dc1[_0x58ff('0x47')]['offset']);}_0x41231e['order']=qs[_0x58ff('0x4c')](_0x5d4dc1[_0x58ff('0x47')][_0x58ff('0x4c')]);_0x41231e[_0x58ff('0x4d')]=qs[_0x58ff('0x48')](_[_0x58ff('0x4e')](_0x5d4dc1[_0x58ff('0x47')],_0x3d114f[_0x58ff('0x48')]),_0x180b9a);if(_0x5d4dc1[_0x58ff('0x47')][_0x58ff('0x4f')]){_0x41231e['where']=_[_0x58ff('0x50')](_0x41231e[_0x58ff('0x4d')],{'$or':_[_0x58ff('0x41')](_0x180b9a,function(_0x2aed98){if(_0x2aed98[_0x58ff('0x51')]!==_0x58ff('0x52')){var _0x45ae85={};_0x45ae85[_0x2aed98[_0x58ff('0x3c')]]={'$like':'%'+_0x5d4dc1[_0x58ff('0x47')]['filter']+'%'};return _0x45ae85;}})});}_0x41231e=_[_0x58ff('0x50')]({},_0x41231e,_0x5d4dc1[_0x58ff('0x53')]);var _0xb5d55a={'where':_0x41231e[_0x58ff('0x4d')]};return db[_0x58ff('0x42')][_0x58ff('0x32')](_0xb5d55a)[_0x58ff('0x23')](function(_0x2eb71e){_0x45dca1[_0x58ff('0x32')]=_0x2eb71e;if(_0x5d4dc1[_0x58ff('0x47')][_0x58ff('0x54')]){_0x41231e[_0x58ff('0x55')]=[{'all':!![]}];}return db[_0x58ff('0x42')][_0x58ff('0x56')](_0x41231e);})[_0x58ff('0x23')](function(_0x3f14ad){_0x45dca1[_0x58ff('0x57')]=_0x3f14ad;return _0x45dca1;})[_0x58ff('0x23')](respondWithFilteredResult(_0x23cd76,_0x41231e))[_0x58ff('0x2c')](handleError(_0x23cd76,null));};exports[_0x58ff('0x58')]=function(_0x5eeae1,_0xb7d06a){var _0x253c72={'raw':![],'where':{'id':_0x5eeae1[_0x58ff('0x59')]['id']},'include':[{'model':db[_0x58ff('0x3f')],'as':_0x58ff('0x40')}]},_0x48c0f3={};_0x48c0f3[_0x58ff('0x46')]=_[_0x58ff('0x5a')](db['SmsAccount'][_0x58ff('0x43')]);_0x48c0f3[_0x58ff('0x47')]=_[_0x58ff('0x5a')](_0x5eeae1[_0x58ff('0x47')]);_0x48c0f3[_0x58ff('0x48')]=_[_0x58ff('0x49')](_0x48c0f3[_0x58ff('0x46')],_0x48c0f3['query']);_0x253c72['attributes']=_[_0x58ff('0x49')](_0x48c0f3[_0x58ff('0x46')],qs[_0x58ff('0x4b')](_0x5eeae1[_0x58ff('0x47')]['fields']));_0x253c72[_0x58ff('0x4a')]=_0x253c72[_0x58ff('0x4a')][_0x58ff('0x5b')]?_0x253c72[_0x58ff('0x4a')]:_0x48c0f3[_0x58ff('0x46')];if(_0x5eeae1[_0x58ff('0x47')][_0x58ff('0x54')]){_0x253c72[_0x58ff('0x55')]=[{'all':!![]}];}_0x253c72=_[_0x58ff('0x50')]({},_0x253c72,_0x5eeae1['options']);return db[_0x58ff('0x42')][_0x58ff('0x5c')](_0x253c72)['then'](handleEntityNotFound(_0xb7d06a,null))[_0x58ff('0x23')](respondWithResult(_0xb7d06a,null))[_0x58ff('0x2c')](handleError(_0xb7d06a,null));};exports[_0x58ff('0x5d')]=function(_0x5a8752,_0x278c0e){return db['SmsAccount']['create'](_0x5a8752[_0x58ff('0x5e')],{})[_0x58ff('0x23')](function(_0x5b8df0){var _0x2474e1=_0x5a8752['user'][_0x58ff('0x38')]({'plain':!![]});if(!_0x2474e1)throw new Error(_0x58ff('0x5f'));if(_0x2474e1[_0x58ff('0x60')]===_0x58ff('0x61')){var _0x92b876=_0x5b8df0[_0x58ff('0x38')]({'plain':!![]});var _0x5c35ea=_0x58ff('0x39');return db[_0x58ff('0x62')][_0x58ff('0x5c')]({'where':{'name':_0x5c35ea,'userProfileId':_0x2474e1[_0x58ff('0x63')]},'raw':!![]})[_0x58ff('0x23')](function(_0x384c54){if(_0x384c54&&_0x384c54['autoAssociation']===0x0){return db[_0x58ff('0x3a')]['create']({'name':_0x92b876[_0x58ff('0x3c')],'resourceId':_0x92b876['id'],'type':_0x384c54[_0x58ff('0x3c')],'sectionId':_0x384c54['id']},{})[_0x58ff('0x23')](function(){return _0x5b8df0;});}else{return _0x5b8df0;}})[_0x58ff('0x2c')](function(_0x3ac2c8){logger['error'](_0x58ff('0x64'),_0x3ac2c8);throw _0x3ac2c8;});}return _0x5b8df0;})['then'](respondWithResult(_0x278c0e,0xc9))[_0x58ff('0x2c')](handleError(_0x278c0e,null));};exports['update']=function(_0xed88c1,_0x1608ba){if(_0xed88c1[_0x58ff('0x5e')]['id']){delete _0xed88c1[_0x58ff('0x5e')]['id'];}return db['SmsAccount']['find']({'where':{'id':_0xed88c1[_0x58ff('0x59')]['id']},'include':[{'model':db[_0x58ff('0x3f')],'as':_0x58ff('0x40')}]})['then'](handleEntityNotFound(_0x1608ba,null))[_0x58ff('0x23')](saveUpdates(_0xed88c1['body'],null))[_0x58ff('0x23')](respondWithResult(_0x1608ba,null))[_0x58ff('0x2c')](handleError(_0x1608ba,null));};exports['destroy']=function(_0x515ddd,_0x2209e7){return db[_0x58ff('0x42')][_0x58ff('0x5c')]({'where':{'id':_0x515ddd[_0x58ff('0x59')]['id']}})[_0x58ff('0x23')](handleEntityNotFound(_0x2209e7,null))[_0x58ff('0x23')](removeEntity(_0x2209e7,null))['catch'](handleError(_0x2209e7,null));};exports[_0x58ff('0x65')]=function(_0x470b87,_0x388908){return db[_0x58ff('0x42')][_0x58ff('0x65')]()['then'](respondWithResult(_0x388908,null))['catch'](handleError(_0x388908,null));};exports['addDisposition']=function(_0x16d75c,_0x38529f,_0x4c49c4){if(_0x16d75c[_0x58ff('0x5e')]['id']){delete _0x16d75c[_0x58ff('0x5e')]['id'];}return db[_0x58ff('0x42')][_0x58ff('0x5c')]({'where':{'id':_0x16d75c[_0x58ff('0x59')]['id']}})[_0x58ff('0x23')](handleEntityNotFound(_0x38529f,null))[_0x58ff('0x23')](function(_0x2b83d9){if(_0x2b83d9){_0x16d75c[_0x58ff('0x5e')][_0x58ff('0x66')]=_0x2b83d9['id'];return db[_0x58ff('0x67')]['create'](_0x16d75c[_0x58ff('0x5e')]);}})[_0x58ff('0x23')](respondWithResult(_0x38529f,null))[_0x58ff('0x2c')](handleError(_0x38529f,null));};exports['getDispositions']=function(_0x31fd82,_0x5445f9,_0x5e1db8){var _0x35543e={'raw':![],'where':{}};var _0xd4fc7b={};var _0x1e9695={'count':0x0,'rows':[]};return db[_0x58ff('0x42')][_0x58ff('0x68')]({'where':{'id':_0x31fd82[_0x58ff('0x59')]['id']}})[_0x58ff('0x23')](handleEntityNotFound(_0x5445f9,null))[_0x58ff('0x23')](function(_0x4337e5){if(_0x4337e5){_0xd4fc7b[_0x58ff('0x46')]=_[_0x58ff('0x5a')](db['Disposition'][_0x58ff('0x43')]);_0xd4fc7b['query']=_[_0x58ff('0x5a')](_0x31fd82[_0x58ff('0x47')]);_0xd4fc7b[_0x58ff('0x48')]=_[_0x58ff('0x49')](_0xd4fc7b[_0x58ff('0x46')],_0xd4fc7b[_0x58ff('0x47')]);_0x35543e[_0x58ff('0x4a')]=_[_0x58ff('0x49')](_0xd4fc7b[_0x58ff('0x46')],qs[_0x58ff('0x4b')](_0x31fd82[_0x58ff('0x47')][_0x58ff('0x4b')]));_0x35543e['attributes']=_0x35543e['attributes'][_0x58ff('0x5b')]?_0x35543e['attributes']:_0xd4fc7b[_0x58ff('0x46')];if(!_0x31fd82[_0x58ff('0x47')][_0x58ff('0x69')](_0x58ff('0x6a'))){_0x35543e[_0x58ff('0x31')]=qs[_0x58ff('0x31')](_0x31fd82['query'][_0x58ff('0x31')]);_0x35543e[_0x58ff('0x2f')]=qs[_0x58ff('0x2f')](_0x31fd82[_0x58ff('0x47')]['offset']);}_0x35543e[_0x58ff('0x6b')]=qs['sort'](_0x31fd82['query'][_0x58ff('0x4c')]);_0x35543e[_0x58ff('0x4d')]=qs[_0x58ff('0x48')](_['pick'](_0x31fd82[_0x58ff('0x47')],_0xd4fc7b[_0x58ff('0x48')]));_0x35543e['where'][_0x58ff('0x66')]=_0x4337e5['id'];if(_0x31fd82[_0x58ff('0x47')][_0x58ff('0x4f')]){_0x35543e['where']=_['merge'](_0x35543e[_0x58ff('0x4d')],{'$or':_[_0x58ff('0x41')](_0x35543e['attributes'],function(_0x619517){var _0x4cedc1={};_0x4cedc1[_0x619517]={'$like':'%'+_0x31fd82[_0x58ff('0x47')][_0x58ff('0x4f')]+'%'};return _0x4cedc1;})});}_0x35543e=_['merge']({},_0x35543e,_0x31fd82[_0x58ff('0x53')]);return db[_0x58ff('0x67')][_0x58ff('0x32')]({'where':_0x35543e['where']})['then'](function(_0x57c0d8){_0x1e9695['count']=_0x57c0d8;if(_0x31fd82[_0x58ff('0x47')]['includeAll']){_0x35543e[_0x58ff('0x55')]=[{'all':!![]}];}return db[_0x58ff('0x67')][_0x58ff('0x56')](_0x35543e);})[_0x58ff('0x23')](function(_0x3b9316){_0x1e9695[_0x58ff('0x57')]=_0x3b9316;return _0x1e9695;});}})['then'](respondWithFilteredResult(_0x5445f9,_0x35543e))[_0x58ff('0x2c')](handleError(_0x5445f9,null));};exports[_0x58ff('0x6c')]=function(_0x4555e2,_0x46f87b,_0x217e14){return db[_0x58ff('0x42')][_0x58ff('0x5c')]({'where':{'id':_0x4555e2[_0x58ff('0x59')]['id']}})[_0x58ff('0x23')](handleEntityNotFound(_0x46f87b,null))[_0x58ff('0x23')](function(_0x379918){if(_0x379918){return _0x379918[_0x58ff('0x6c')](_0x4555e2['query']['ids']);}})[_0x58ff('0x23')](respondWithStatusCode(_0x46f87b,null))[_0x58ff('0x2c')](handleError(_0x46f87b,null));};exports[_0x58ff('0x6d')]=function(_0x249f54,_0x4c6fd6,_0xe66332){if(_0x249f54['body']['id']){delete _0x249f54['body']['id'];}return db[_0x58ff('0x42')][_0x58ff('0x5c')]({'where':{'id':_0x249f54[_0x58ff('0x59')]['id']}})[_0x58ff('0x23')](handleEntityNotFound(_0x4c6fd6,null))[_0x58ff('0x23')](function(_0xdefe41){if(_0xdefe41){_0x249f54[_0x58ff('0x5e')][_0x58ff('0x66')]=_0xdefe41['id'];return db['CannedAnswer'][_0x58ff('0x5d')](_0x249f54[_0x58ff('0x5e')]);}})['then'](respondWithResult(_0x4c6fd6,null))[_0x58ff('0x2c')](handleError(_0x4c6fd6,null));};exports[_0x58ff('0x6e')]=function(_0x4265a1,_0x2a390a,_0x1b4d63){var _0x1850d3={'raw':![],'where':{}};var _0x203f06={};var _0x2085f2={'count':0x0,'rows':[]};return db['SmsAccount'][_0x58ff('0x68')]({'where':{'id':_0x4265a1['params']['id']}})[_0x58ff('0x23')](handleEntityNotFound(_0x2a390a,null))[_0x58ff('0x23')](function(_0xcabe2e){if(_0xcabe2e){_0x203f06[_0x58ff('0x46')]=_[_0x58ff('0x5a')](db[_0x58ff('0x6f')][_0x58ff('0x43')]);_0x203f06[_0x58ff('0x47')]=_[_0x58ff('0x5a')](_0x4265a1[_0x58ff('0x47')]);_0x203f06[_0x58ff('0x48')]=_[_0x58ff('0x49')](_0x203f06[_0x58ff('0x46')],_0x203f06[_0x58ff('0x47')]);_0x1850d3['attributes']=_['intersection'](_0x203f06['model'],qs[_0x58ff('0x4b')](_0x4265a1[_0x58ff('0x47')]['fields']));_0x1850d3[_0x58ff('0x4a')]=_0x1850d3[_0x58ff('0x4a')][_0x58ff('0x5b')]?_0x1850d3[_0x58ff('0x4a')]:_0x203f06[_0x58ff('0x46')];if(!_0x4265a1[_0x58ff('0x47')][_0x58ff('0x69')](_0x58ff('0x6a'))){_0x1850d3['limit']=qs[_0x58ff('0x31')](_0x4265a1['query'][_0x58ff('0x31')]);_0x1850d3['offset']=qs[_0x58ff('0x2f')](_0x4265a1[_0x58ff('0x47')][_0x58ff('0x2f')]);}_0x1850d3[_0x58ff('0x6b')]=qs['sort'](_0x4265a1[_0x58ff('0x47')]['sort']);_0x1850d3[_0x58ff('0x4d')]=qs[_0x58ff('0x48')](_[_0x58ff('0x4e')](_0x4265a1[_0x58ff('0x47')],_0x203f06['filters']));_0x1850d3[_0x58ff('0x4d')]['SmsAccountId']=_0xcabe2e['id'];if(_0x4265a1[_0x58ff('0x47')]['filter']){_0x1850d3[_0x58ff('0x4d')]=_[_0x58ff('0x50')](_0x1850d3[_0x58ff('0x4d')],{'$or':_[_0x58ff('0x41')](_0x1850d3[_0x58ff('0x4a')],function(_0x135ff6){var _0xb7efee={};_0xb7efee[_0x135ff6]={'$like':'%'+_0x4265a1[_0x58ff('0x47')][_0x58ff('0x4f')]+'%'};return _0xb7efee;})});}_0x1850d3=_[_0x58ff('0x50')]({},_0x1850d3,_0x4265a1[_0x58ff('0x53')]);return db[_0x58ff('0x6f')][_0x58ff('0x32')]({'where':_0x1850d3['where']})[_0x58ff('0x23')](function(_0x165bc4){_0x2085f2[_0x58ff('0x32')]=_0x165bc4;if(_0x4265a1[_0x58ff('0x47')][_0x58ff('0x54')]){_0x1850d3[_0x58ff('0x55')]=[{'all':!![]}];}return db[_0x58ff('0x6f')][_0x58ff('0x56')](_0x1850d3);})['then'](function(_0x4d6b19){_0x2085f2['rows']=_0x4d6b19;return _0x2085f2;});}})[_0x58ff('0x23')](respondWithFilteredResult(_0x2a390a,_0x1850d3))[_0x58ff('0x2c')](handleError(_0x2a390a,null));};exports[_0x58ff('0x70')]=function(_0x269255,_0x2a80a9,_0x176d5e){return db[_0x58ff('0x42')][_0x58ff('0x5c')]({'where':{'id':_0x269255[_0x58ff('0x59')]['id']}})[_0x58ff('0x23')](handleEntityNotFound(_0x2a80a9,null))[_0x58ff('0x23')](function(_0x2e5bf4){if(_0x2e5bf4){return _0x2e5bf4[_0x58ff('0x70')](_0x269255[_0x58ff('0x47')][_0x58ff('0x71')]);}})[_0x58ff('0x23')](respondWithStatusCode(_0x2a80a9,null))[_0x58ff('0x2c')](handleError(_0x2a80a9,null));};exports[_0x58ff('0x72')]=function(_0x5a489b,_0x46528d,_0x133b70){var _0x4ed030={'channel':'sms'};var _0x2807fb=[];var _0x54b6b3=[];var _0x30c10c={};return db[_0x58ff('0x42')][_0x58ff('0x5c')]({'where':{'id':_0x5a489b[_0x58ff('0x59')]['id']},'include':[{'model':db[_0x58ff('0x73')],'as':_0x58ff('0x74')}]})[_0x58ff('0x23')](handleEntityNotFound(_0x46528d,null))['then'](function(_0x22811f){_0x4ed030[_0x58ff('0x75')]=_0x22811f;_0x4ed030[_0x58ff('0x76')]=_[_0x58ff('0x77')](_0x22811f[_0x58ff('0x74')],[_0x58ff('0x78')],['asc']);if(_0x4ed030['account'][_0x58ff('0x74')]){delete _0x4ed030['account'][_0x58ff('0x74')];}return db[_0x58ff('0x79')][_0x58ff('0x65')]();})['then'](function(_0x1e6b27){if(!_0x1e6b27){throw new db[(_0x58ff('0x7a'))][(_0x58ff('0x7b'))](_0x58ff('0x7c'));}_0x2807fb=_[_0x58ff('0x7d')](_[_0x58ff('0x5a')](_0x1e6b27),[_0x58ff('0x7e'),_0x58ff('0x7f')]);_0x54b6b3=_['difference'](_[_0x58ff('0x5a')](_0x1e6b27),[_0x58ff('0x7e'),_0x58ff('0x7f'),'CompanyId','ListId']);_0x4ed030[_0x58ff('0x5e')]={'mapKey':_0x58ff('0x80')};if(_0x4ed030[_0x58ff('0x75')][_0x58ff('0x51')]){switch(_0x4ed030['account'][_0x58ff('0x51')]){case _0x58ff('0x81'):_0x4ed030['body'][_0x58ff('0x82')]=_0x5a489b['body'][_0x58ff('0x83')];_0x4ed030[_0x58ff('0x5e')]['body']=_0x5a489b[_0x58ff('0x5e')][_0x58ff('0x84')];_0x4ed030[_0x58ff('0x5e')]['messageId']=_0x5a489b['body'][_0x58ff('0x85')];break;case _0x58ff('0x86'):_0x4ed030[_0x58ff('0x5e')][_0x58ff('0x82')]='+'+_0x5a489b[_0x58ff('0x5e')][_0x58ff('0x87')];_0x4ed030[_0x58ff('0x5e')][_0x58ff('0x5e')]=_0x5a489b[_0x58ff('0x5e')][_0x58ff('0x88')];break;case _0x58ff('0x89'):_0x4ed030['body']['from']=_0x5a489b[_0x58ff('0x5e')]['from'];_0x4ed030[_0x58ff('0x5e')]['body']=_0x5a489b['body'][_0x58ff('0x2b')];break;case _0x58ff('0x8a'):_0x4ed030[_0x58ff('0x5e')][_0x58ff('0x82')]=_0x5a489b[_0x58ff('0x5e')][_0x58ff('0x82')];_0x4ed030[_0x58ff('0x5e')][_0x58ff('0x5e')]=_0x5a489b[_0x58ff('0x5e')][_0x58ff('0x5e')];_0x4ed030[_0x58ff('0x5e')]['messageId']=_0x5a489b[_0x58ff('0x5e')][_0x58ff('0x8b')];break;case'plivo':_0x4ed030[_0x58ff('0x5e')][_0x58ff('0x82')]=_0x5a489b[_0x58ff('0x5e')][_0x58ff('0x83')];_0x4ed030['body'][_0x58ff('0x5e')]=_0x5a489b[_0x58ff('0x5e')]['Text'];_0x4ed030[_0x58ff('0x5e')][_0x58ff('0x8c')]=_0x5a489b[_0x58ff('0x5e')]['MessageUUID'];break;case'infobip':_0x4ed030['body'][_0x58ff('0x82')]='+'+_0x5a489b[_0x58ff('0x5e')]['results'][0x0][_0x58ff('0x82')];_0x4ed030['body'][_0x58ff('0x5e')]=_0x5a489b[_0x58ff('0x5e')][_0x58ff('0x8d')][0x0]['text'];_0x4ed030[_0x58ff('0x5e')][_0x58ff('0x8c')]=_0x5a489b['body'][_0x58ff('0x8d')][0x0][_0x58ff('0x8c')];break;case'csc':_0x4ed030['body'][_0x58ff('0x82')]=_0x5a489b[_0x58ff('0x5e')][_0x58ff('0x8e')];_0x4ed030[_0x58ff('0x5e')][_0x58ff('0x5e')]=_0x5a489b['body']['segmentedMessage'][_0x58ff('0x2b')];break;case'clickatell':_0x4ed030['body']['from']=_0x5a489b[_0x58ff('0x5e')]['fromNumber'];_0x4ed030[_0x58ff('0x5e')]['body']=_0x5a489b[_0x58ff('0x5e')][_0x58ff('0x88')];_0x4ed030[_0x58ff('0x5e')][_0x58ff('0x8c')]=_0x5a489b[_0x58ff('0x5e')][_0x58ff('0x8f')];break;case _0x58ff('0x90'):_0x4ed030[_0x58ff('0x5e')][_0x58ff('0x8c')]=_0x5a489b[_0x58ff('0x5e')][0x0][_0x58ff('0x2b')]['id'];_0x4ed030[_0x58ff('0x5e')][_0x58ff('0x82')]=_0x5a489b[_0x58ff('0x5e')][0x0][_0x58ff('0x2b')][_0x58ff('0x82')];_0x4ed030[_0x58ff('0x5e')][_0x58ff('0x5e')]=_0x5a489b['body'][0x0][_0x58ff('0x2b')]['text'];break;case _0x58ff('0x91'):_0x4ed030[_0x58ff('0x5e')][_0x58ff('0x82')]=_0x5a489b[_0x58ff('0x5e')]['from'];_0x4ed030['body'][_0x58ff('0x5e')]=_0x5a489b[_0x58ff('0x5e')][_0x58ff('0x2b')];_0x4ed030[_0x58ff('0x5e')]['messageId']=_0x5a489b[_0x58ff('0x5e')]['refid'];break;}}if(_0x4ed030[_0x58ff('0x5e')]['id']){delete _0x4ed030[_0x58ff('0x5e')]['id'];}if(_[_0x58ff('0x92')](_0x4ed030[_0x58ff('0x5e')]['from'])){throw new db[(_0x58ff('0x7a'))]['ValidationError'](_0x58ff('0x93'));}if(_['isNil'](_0x4ed030[_0x58ff('0x5e')][_0x58ff('0x5e')])||_0x4ed030['body']['body']===''){throw new db['Sequelize'][(_0x58ff('0x7b'))](_0x58ff('0x94'));}if(_[_0x58ff('0x92')](_0x4ed030[_0x58ff('0x5e')][_0x58ff('0x95')])){throw new db[(_0x58ff('0x7a'))][(_0x58ff('0x7b'))](_0x58ff('0x96')+_0x54b6b3);}if(!_[_0x58ff('0x97')](_0x54b6b3,_0x4ed030[_0x58ff('0x5e')][_0x58ff('0x95')])){throw new db[(_0x58ff('0x7a'))][(_0x58ff('0x7b'))](_0x58ff('0x98')+_0x54b6b3);}_0x30c10c[_0x4ed030[_0x58ff('0x5e')][_0x58ff('0x95')]]=_0x4ed030[_0x58ff('0x5e')][_0x58ff('0x82')];return db[_0x58ff('0x99')]['find']({'where':{'id':_0x4ed030[_0x58ff('0x75')][_0x58ff('0x9a')]},'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x30c10c,'limit':0x1,'order':[['updatedAt',_0x58ff('0x9b')]]}]});})[_0x58ff('0x23')](handleEntityNotFound(_0x46528d,null))[_0x58ff('0x23')](function(_0x3e92fd){if(_0x3e92fd){_0x4ed030[_0x58ff('0x9c')]=_[_0x58ff('0x9d')](_0x3e92fd,[_0x58ff('0x9e')]);if(_0x3e92fd['Contacts']['length']){return _0x3e92fd[_0x58ff('0x9e')][0x0];}var _0x3e8683=_['defaults'](_0x4ed030[_0x58ff('0x5e')],{'firstName':_0x4ed030[_0x58ff('0x5e')][_0x58ff('0x82')],'ListId':_0x3e92fd['id']});_0x3e8683[_0x4ed030[_0x58ff('0x5e')]['mapKey']]=_0x4ed030[_0x58ff('0x5e')][_0x58ff('0x82')];return db[_0x58ff('0x79')]['create'](_0x3e8683,{'fields':_0x2807fb,'raw':!![]});}})[_0x58ff('0x23')](handleEntityNotFound(_0x46528d,null))[_0x58ff('0x23')](function(_0x501485){if(_0x501485){_0x4ed030['contact']=_0x501485;var _0xbbcb75={'ContactId':_0x501485['id'],'phone':_0x4ed030['body']['from'],'SmsAccountId':_0x5a489b[_0x58ff('0x59')]['id']};var _0x291552={'ContactId':_0x501485['id'],'SmsAccountId':_0x5a489b[_0x58ff('0x59')]['id'],'closed':![]};return db[_0x58ff('0x9f')][_0x58ff('0x5c')]({'where':_0x291552})[_0x58ff('0x23')](function(_0x18d74a){if(_0x18d74a){return[_0x18d74a,![]];}return db[_0x58ff('0x9f')][_0x58ff('0x5d')](_0xbbcb75)[_0x58ff('0x23')](function(_0x2c6a4c){return[_0x2c6a4c,!![]];});});}})[_0x58ff('0xa0')](function(_0x32bc78,_0x4aa2ab){_0x4ed030[_0x58ff('0xa1')]=_0x32bc78[_0x58ff('0x38')]({'plain':!![]});_0x4ed030[_0x58ff('0xa1')][_0x58ff('0xa2')]=![];if(_0x4aa2ab){if(_0x4ed030[_0x58ff('0x75')][_0x58ff('0xa3')]){_0x4ed030[_0x58ff('0x76')][_0x58ff('0xa4')]({'id':0x0,'priority':_0x4ed030['applications'][_0x58ff('0x5b')]+0x1,'app':_0x58ff('0xa5'),'appdata':_0x58ff('0xa6'),'interval':_0x58ff('0xa7')});}_0x4ed030[_0x58ff('0xa1')][_0x58ff('0xa2')]=!![];}return db['SmsMessage'][_0x58ff('0x5d')]({'phone':_0x4ed030[_0x58ff('0x5e')]['from'],'messageId':_0x4ed030[_0x58ff('0x5e')]['messageId'],'body':_0x4ed030[_0x58ff('0x5e')][_0x58ff('0x5e')],'SmsAccountId':_0x5a489b[_0x58ff('0x59')]['id'],'SmsInteractionId':_0x32bc78['id'],'direction':'in','ContactId':_0x32bc78[_0x58ff('0xa8')],'AttachmentId':_0x4ed030[_0x58ff('0x5e')]['AttachmentId']});})[_0x58ff('0x23')](function(_0x252afd){_0x4ed030[_0x58ff('0x2b')]=_0x252afd;if(_0x4ed030['interaction'][_0x58ff('0xa9')]){return db[_0x58ff('0xaa')][_0x58ff('0x5c')]({'attributes':['id',_0x58ff('0x3c')],'where':{'id':_0x4ed030[_0x58ff('0xa1')][_0x58ff('0xa9')]}})['then'](function(_0x50de4c){if(_0x50de4c){_0x4ed030[_0x58ff('0x76')][_0x58ff('0xab')]({'id':0x0,'priority':0x0,'app':_0x58ff('0xac'),'appdata':_0x50de4c[_0x58ff('0x3c')]+','+(_0x4ed030['account'][_0x58ff('0xad')]||0xa),'interval':_0x58ff('0xa7')});}return respondWithRpcPromise('Start',_0x58ff('0xae'),_0x4ed030);});}return respondWithRpcPromise(_0x58ff('0xaf'),'startRouting',_0x4ed030);})[_0x58ff('0x23')](function(_0x5d30c8){if(_0x5d30c8){var _0x4ab359=0xc8;var _0x26ad02=_0x58ff('0xb0');logger[_0x58ff('0x24')](_0x58ff('0xb1'),_0x26ad02,_0x4ab359,'entity\x20found');logger[_0x58ff('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x26ad02,_0x4ab359,_0x58ff('0xb2'),JSON[_0x58ff('0x27')](_0x5d30c8));if(_0x4ed030['account'][_0x58ff('0x51')]===_0x58ff('0x81')){return _0x46528d['status'](_0x4ab359)[_0x58ff('0xb3')](_0x58ff('0xb4'),'text/xml')[_0x58ff('0x3d')]('\x0a');}else{return _0x46528d[_0x58ff('0x2d')](_0x4ab359)[_0x58ff('0xb5')](_0x5d30c8);}}})[_0x58ff('0x2c')](handleError(_0x46528d,null));};exports[_0x58ff('0xb6')]=function(_0x3a35fc,_0x241b93,_0x314334){return db[_0x58ff('0x42')][_0x58ff('0x68')]({'where':{'id':_0x3a35fc[_0x58ff('0x59')]['id']}})['then'](handleEntityNotFound(_0x241b93,null))[_0x58ff('0x23')](function(_0x2ad5f1){if(_0x2ad5f1){return db[_0x58ff('0xb7')]['transaction'](function(_0x900b2b){return db[_0x58ff('0x73')][_0x58ff('0x37')]({'where':{'SmsAccountId':_0x3a35fc[_0x58ff('0x59')]['id']},'transaction':_0x900b2b})[_0x58ff('0x23')](function(_0xa7dd85){var _0x4e5cc0=_['map'](_0x3a35fc['body'],function(_0x468369){_0x468369[_0x58ff('0x66')]=_0x3a35fc[_0x58ff('0x59')]['id'];return _0x468369;});return db[_0x58ff('0x73')][_0x58ff('0xb8')](_0x4e5cc0,{'transaction':_0x900b2b});});})['then'](function(){return db[_0x58ff('0x73')][_0x58ff('0xb9')]({'where':{'SmsAccountId':_0x3a35fc[_0x58ff('0x59')]['id']},'order':_0x58ff('0x78')});});}})['then'](respondWithResult(_0x241b93,null))[_0x58ff('0x2c')](handleError(_0x241b93,null));};exports[_0x58ff('0xba')]=function(_0x5ba25c,_0x28f402,_0x2dc89d){var _0x5d4a18={};var _0x44a8ec={};var _0x2aac19;var _0x148021;return db[_0x58ff('0x42')][_0x58ff('0x68')]({'where':{'id':_0x5ba25c['params']['id']}})[_0x58ff('0x23')](handleEntityNotFound(_0x28f402,null))['then'](function(_0x3fcf96){if(_0x3fcf96){_0x2aac19=_0x3fcf96;_0x44a8ec['model']=_[_0x58ff('0x5a')](db[_0x58ff('0x73')]['rawAttributes']);_0x44a8ec[_0x58ff('0x47')]=_['keys'](_0x5ba25c['query']);_0x44a8ec[_0x58ff('0x48')]=_[_0x58ff('0x49')](_0x44a8ec[_0x58ff('0x46')],_0x44a8ec['query']);_0x5d4a18[_0x58ff('0x4a')]=_[_0x58ff('0x49')](_0x44a8ec['model'],qs['fields'](_0x5ba25c[_0x58ff('0x47')]['fields']));_0x5d4a18[_0x58ff('0x4a')]=_0x5d4a18[_0x58ff('0x4a')][_0x58ff('0x5b')]?_0x5d4a18[_0x58ff('0x4a')]:_0x44a8ec[_0x58ff('0x46')];_0x5d4a18[_0x58ff('0x6b')]=qs[_0x58ff('0x4c')](_0x5ba25c['query'][_0x58ff('0x4c')]);_0x5d4a18[_0x58ff('0x4d')]=qs[_0x58ff('0x48')](_[_0x58ff('0x4e')](_0x5ba25c[_0x58ff('0x47')],_0x44a8ec[_0x58ff('0x48')]));if(_0x5ba25c['query'][_0x58ff('0x4f')]){_0x5d4a18['where']=_[_0x58ff('0x50')](_0x5d4a18[_0x58ff('0x4d')],{'$or':_['map'](_0x5d4a18['attributes'],function(_0x470008){var _0x396116={};_0x396116[_0x470008]={'$like':'%'+_0x5ba25c[_0x58ff('0x47')][_0x58ff('0x4f')]+'%'};return _0x396116;})});}_0x5d4a18=_[_0x58ff('0x50')]({},_0x5d4a18,_0x5ba25c[_0x58ff('0x53')]);return _0x2aac19[_0x58ff('0xba')](_0x5d4a18);}})[_0x58ff('0x23')](function(_0x3e34f0){if(_0x3e34f0){_0x148021=_0x3e34f0[_0x58ff('0x5b')];if(!_0x5ba25c['query'][_0x58ff('0x69')](_0x58ff('0x6a'))){_0x5d4a18[_0x58ff('0x31')]=qs[_0x58ff('0x31')](_0x5ba25c[_0x58ff('0x47')][_0x58ff('0x31')]);_0x5d4a18[_0x58ff('0x2f')]=qs[_0x58ff('0x2f')](_0x5ba25c[_0x58ff('0x47')][_0x58ff('0x2f')]);}return _0x2aac19[_0x58ff('0xba')](_0x5d4a18);}})[_0x58ff('0x23')](function(_0x189b6b){if(_0x189b6b){return _0x189b6b?{'count':_0x148021,'rows':_0x189b6b}:null;}})[_0x58ff('0x23')](respondWithResult(_0x28f402,null))[_0x58ff('0x2c')](handleError(_0x28f402,null));};exports[_0x58ff('0xbb')]=function(_0x4e8a64,_0x31d3c0,_0x4c4341){var _0x5c15ef={'raw':![],'where':{}};var _0x20267f={};var _0xf28a5b={'count':0x0,'rows':[]};return db[_0x58ff('0x42')][_0x58ff('0x68')]({'where':{'id':_0x4e8a64['params']['id']}})['then'](handleEntityNotFound(_0x31d3c0,null))['then'](function(_0x201ad7){if(_0x201ad7){_0x20267f['model']=_[_0x58ff('0x5a')](db[_0x58ff('0x9f')][_0x58ff('0x43')]);_0x20267f[_0x58ff('0x47')]=_[_0x58ff('0x5a')](_0x4e8a64[_0x58ff('0x47')]);_0x20267f[_0x58ff('0x48')]=_[_0x58ff('0x49')](_0x20267f[_0x58ff('0x46')],_0x20267f[_0x58ff('0x47')]);_0x5c15ef[_0x58ff('0x4a')]=_[_0x58ff('0x49')](_0x20267f[_0x58ff('0x46')],qs[_0x58ff('0x4b')](_0x4e8a64[_0x58ff('0x47')][_0x58ff('0x4b')]));_0x5c15ef['attributes']=_0x5c15ef[_0x58ff('0x4a')][_0x58ff('0x5b')]?_0x5c15ef['attributes']:_0x20267f['model'];if(!_0x4e8a64[_0x58ff('0x47')][_0x58ff('0x69')](_0x58ff('0x6a'))){_0x5c15ef[_0x58ff('0x31')]=qs[_0x58ff('0x31')](_0x4e8a64['query'][_0x58ff('0x31')]);_0x5c15ef[_0x58ff('0x2f')]=qs[_0x58ff('0x2f')](_0x4e8a64[_0x58ff('0x47')][_0x58ff('0x2f')]);}_0x5c15ef['order']=qs[_0x58ff('0x4c')](_0x4e8a64[_0x58ff('0x47')][_0x58ff('0x4c')]);_0x5c15ef[_0x58ff('0x4d')]=qs[_0x58ff('0x48')](_['pick'](_0x4e8a64['query'],_0x20267f[_0x58ff('0x48')]));_0x5c15ef[_0x58ff('0x4d')]['SmsAccountId']=_0x201ad7['id'];if(_0x4e8a64[_0x58ff('0x47')][_0x58ff('0x4f')]){_0x5c15ef[_0x58ff('0x4d')]=_[_0x58ff('0x50')](_0x5c15ef[_0x58ff('0x4d')],{'$or':_[_0x58ff('0x41')](_0x5c15ef[_0x58ff('0x4a')],function(_0x21f570){var _0x4be91b={};_0x4be91b[_0x21f570]={'$like':'%'+_0x4e8a64[_0x58ff('0x47')][_0x58ff('0x4f')]+'%'};return _0x4be91b;})});}_0x5c15ef=_[_0x58ff('0x50')]({},_0x5c15ef,_0x4e8a64[_0x58ff('0x53')]);return db['SmsInteraction'][_0x58ff('0x32')]({'where':_0x5c15ef[_0x58ff('0x4d')]})['then'](function(_0x3aa846){_0xf28a5b['count']=_0x3aa846;if(_0x4e8a64[_0x58ff('0x47')][_0x58ff('0x54')]){_0x5c15ef['include']=[{'model':db[_0x58ff('0x79')],'as':'Contact','required':![]},{'model':db[_0x58ff('0xaa')],'as':_0x58ff('0xbc'),'attributes':[_0x58ff('0x3c'),_0x58ff('0xbd'),_0x58ff('0xbe')],'required':![]},{'model':db[_0x58ff('0xbf')],'as':'Tags','attributes':['id','name',_0x58ff('0xc0')],'where':_0x4e8a64[_0x58ff('0x47')][_0x58ff('0xc1')]?{'id':_0x4e8a64['query']['tag']}:undefined,'required':_0x4e8a64[_0x58ff('0x47')][_0x58ff('0xc1')]?!![]:![]}];}return db['SmsInteraction']['findAll'](_0x5c15ef);})[_0x58ff('0x23')](function(_0x573bfe){_0xf28a5b[_0x58ff('0x57')]=_0x573bfe;return _0xf28a5b;});}})['then'](respondWithFilteredResult(_0x31d3c0,_0x5c15ef))[_0x58ff('0x2c')](handleError(_0x31d3c0,null));};exports[_0x58ff('0x3d')]=function(_0x5c9159,_0x331b2f,_0x580078){var _0x4d91f9,_0x691be0,_0x177e0f;if(_[_0x58ff('0x92')](_0x5c9159[_0x58ff('0x5e')][_0x58ff('0x5e')])||_0x5c9159[_0x58ff('0x5e')][_0x58ff('0x5e')]===''){throw new db['Sequelize'][(_0x58ff('0x7b'))](_0x58ff('0x94'));}if(_[_0x58ff('0x92')](_0x5c9159[_0x58ff('0x5e')]['to'])){throw new db[(_0x58ff('0x7a'))][(_0x58ff('0x7b'))]('to\x20is\x20mandatory');}_0x4d91f9=_0x5c9159[_0x58ff('0x5e')]['to'];return db[_0x58ff('0x42')]['find']({'where':{'id':_0x5c9159[_0x58ff('0x59')]['id']},'include':[{'model':db[_0x58ff('0x99')],'as':_0x58ff('0xc2'),'include':[{'model':db[_0x58ff('0x79')],'as':_0x58ff('0x9e'),'where':{'mobile':_0x4d91f9},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})['then'](handleEntityNotFound(_0x331b2f,null))[_0x58ff('0x23')](function(_0x3df067){if(_0x3df067&&_0x3df067[_0x58ff('0xc2')]){_0x691be0=_0x3df067[_0x58ff('0x38')]({'plain':!![]});if(_0x691be0[_0x58ff('0xc2')]&&_0x691be0[_0x58ff('0xc2')][_0x58ff('0x9e')][_0x58ff('0x5b')]){return _0x691be0[_0x58ff('0xc2')][_0x58ff('0x9e')][0x0];}return db[_0x58ff('0x79')][_0x58ff('0x5d')](_[_0x58ff('0x1a')](_0x5c9159['body'],{'firstName':_0x4d91f9,'mobile':_0x4d91f9,'phone':_0x4d91f9,'ListId':_0x691be0[_0x58ff('0x9a')]}));}})[_0x58ff('0x23')](handleEntityNotFound(_0x331b2f,null))[_0x58ff('0x23')](function(_0x513849){if(_0x513849){_0x177e0f=_0x513849;return db[_0x58ff('0x9f')][_0x58ff('0x5c')]({'where':{'ContactId':_0x177e0f['id'],'closed':![],'SmsAccountId':_0x691be0['id']}})[_0x58ff('0x23')](function(_0x2f1a03){if(_0x2f1a03){return[_0x2f1a03,![]];}return db['SmsInteraction']['create']({'UserId':_0x5c9159[_0x58ff('0x61')]['id'],'ContactId':_0x177e0f['id'],'SmsAccountId':_0x691be0['id'],'phone':_0x4d91f9,'firstMsgDirection':_0x58ff('0xc3'),'Messages':[_[_0x58ff('0x50')](_0x5c9159[_0x58ff('0x5e')],{'read':![],'body':_0x5c9159[_0x58ff('0x5e')][_0x58ff('0x5e')],'phone':_0x4d91f9,'SmsAccountId':_0x691be0['id'],'UserId':_0x5c9159[_0x58ff('0x61')]['id'],'ContactId':_0x177e0f['id']})]},{'include':[{'model':db[_0x58ff('0xc4')],'as':_0x58ff('0xc5')}]})['then'](function(_0x500ef7){return[_0x500ef7,!![]];});});}})['spread'](function(_0xe27bdb,_0x3c8d44){if(_0x3c8d44){return _0xe27bdb;}return db['SmsMessage'][_0x58ff('0x5d')](_[_0x58ff('0x50')](_0x5c9159[_0x58ff('0x5e')],{'read':![],'body':_0x5c9159['body'][_0x58ff('0x5e')],'phone':_0x4d91f9,'SmsAccountId':_0x691be0['id'],'SmsInteractionId':_0xe27bdb['id'],'UserId':_0x5c9159[_0x58ff('0x61')]['id'],'ContactId':_0x177e0f['id']}))['then'](function(_0x5bbe16){_0xe27bdb[_0x58ff('0xc6')][_0x58ff('0xc5')]=[];_0xe27bdb[_0x58ff('0xc6')][_0x58ff('0xc5')]['push'](_0x5bbe16[_0x58ff('0xc6')]);return _0xe27bdb;});})[_0x58ff('0x23')](respondWithResult(_0x331b2f,null))[_0x58ff('0x2c')](handleError(_0x331b2f,null));};exports[_0x58ff('0x2d')]=function(_0x3c0edb,_0x2d5a8c,_0x4ff33e){if(_0x3c0edb['body']['id']){delete _0x3c0edb['body']['id'];}var _0x3f76b8,_0x3ff72a,_0x1ffa94;return db[_0x58ff('0x42')][_0x58ff('0x5c')]({'where':{'id':_0x3c0edb['params']['id']}})[_0x58ff('0x23')](handleEntityNotFound(_0x2d5a8c,null))['then'](function(_0x5ad9c4){if(_0x5ad9c4){_0x1ffa94=_0x5ad9c4;logger[_0x58ff('0x26')](_0x58ff('0xb1'),_0x58ff('0x2d'),_0x58ff('0xc7'),_0x5ad9c4[_0x58ff('0x51')],util['inspect'](_0x3c0edb[_0x58ff('0x5e')],{'showHidden':![],'depth':null}));switch(_0x5ad9c4['type']){case _0x58ff('0x86'):if(_0x3c0edb[_0x58ff('0x5e')][_0x58ff('0xc8')]&&_0x3c0edb[_0x58ff('0x5e')][_0x58ff('0x2d')]){_0x3ff72a=_0x3c0edb[_0x58ff('0x5e')]['status'];return db[_0x58ff('0xc4')][_0x58ff('0x5c')]({'where':{'messageId':_0x3c0edb[_0x58ff('0x5e')]['skebby_dispatch_id']}});}break;case _0x58ff('0x89'):if(_0x3c0edb['body'][_0x58ff('0xc9')]&&_0x3c0edb[_0x58ff('0x5e')]['statusInt']){_0x3ff72a=_0x3c0edb[_0x58ff('0x5e')][_0x58ff('0xca')];return db[_0x58ff('0xc4')][_0x58ff('0x5c')]({'where':{'messageId':_0x3c0edb[_0x58ff('0x5e')][_0x58ff('0xc9')]}});}break;case _0x58ff('0x8a'):if(_0x3c0edb[_0x58ff('0x5e')][_0x58ff('0x8b')]&&_0x3c0edb['body'][_0x58ff('0xcb')]){_0x3ff72a=_0x3c0edb[_0x58ff('0x5e')][_0x58ff('0xcb')];return db[_0x58ff('0xc4')][_0x58ff('0x5c')]({'where':{'messageId':_0x3c0edb[_0x58ff('0x5e')][_0x58ff('0x8b')]}});}break;case _0x58ff('0xcc'):var _0x5a94dd=_0x3c0edb['body'][_0x58ff('0x8d')][0x0];if(_0x5a94dd[_0x58ff('0x8c')]&&_0x5a94dd[_0x58ff('0x2d')][_0x58ff('0xcd')]===_0x58ff('0xce')){_0x3ff72a=_0x5a94dd[_0x58ff('0x2d')]['groupName'];return db[_0x58ff('0xc4')][_0x58ff('0x5c')]({'where':{'messageId':_0x5a94dd[_0x58ff('0x8c')]}});}break;case _0x58ff('0xcf'):if(_0x3c0edb['body'][_0x58ff('0x8c')]&&_0x3c0edb[_0x58ff('0x5e')][_0x58ff('0x2d')]){_0x3ff72a=_0x3c0edb[_0x58ff('0x5e')][_0x58ff('0x2d')];return db['SmsMessage'][_0x58ff('0x5c')]({'where':{'messageId':_0x3c0edb[_0x58ff('0x5e')][_0x58ff('0x8c')]}});}break;case _0x58ff('0x90'):if(_0x3c0edb['body'][0x0][_0x58ff('0x2b')]['id']){_0x3ff72a=_0x3c0edb['body'][0x0][_0x58ff('0x51')];return db[_0x58ff('0xc4')]['find']({'where':{'messageId':_0x3c0edb['body'][0x0][_0x58ff('0x2b')]['id']}});}break;case _0x58ff('0x91'):if(_0x3c0edb['body']['redif']&&_0x3c0edb[_0x58ff('0x5e')][_0x58ff('0x2d')]){_0x3ff72a=_0x3c0edb[_0x58ff('0x5e')][_0x58ff('0x2d')];return db[_0x58ff('0xc4')][_0x58ff('0x5c')]({'where':{'messageId':_0x3c0edb[_0x58ff('0x5e')][_0x58ff('0xd0')]}});}break;}}})[_0x58ff('0x23')](handleEntityNotFound(_0x2d5a8c,null))['then'](function(_0x191824){if(_0x191824){_0x3f76b8=_0x191824;switch(_0x1ffa94['type']){case _0x58ff('0x86'):if(_0x3ff72a==='DELIVERED'){return _0x3f76b8[_0x58ff('0xd1')]({'read':!![]});}else{logger[_0x58ff('0x28')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x58ff('0x2d'),_0x58ff('0x86'),util[_0x58ff('0xd2')](_0x3c0edb[_0x58ff('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x58ff('0x89'):if(_0x3ff72a==='1'){return _0x3f76b8[_0x58ff('0xd1')]({'read':!![]});}else{logger['error'](_0x58ff('0xb1'),'status',_0x58ff('0x86'),util['inspect'](_0x3c0edb[_0x58ff('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x58ff('0x8a'):if(!_0x3c0edb[_0x58ff('0x5e')][_0x58ff('0xd3')]&&_0x3ff72a>=0xc8&&_0x3ff72a<=0xce){return _0x3f76b8[_0x58ff('0xd1')]({'read':!![]});}else{logger[_0x58ff('0x28')](_0x58ff('0xb1'),'status','clicksend',util[_0x58ff('0xd2')](_0x3c0edb[_0x58ff('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x58ff('0xcc'):var _0x2f17ae=_0x3c0edb['body'][_0x58ff('0x8d')][0x0];if(_0x2f17ae['status'][_0x58ff('0xcd')]===_0x58ff('0xce')){return _0x3f76b8['update']({'read':!![]});}else{logger[_0x58ff('0x28')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x58ff('0x2d'),'infobip',util[_0x58ff('0xd2')](_0x3c0edb[_0x58ff('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x58ff('0xcf'):if(_0x3ff72a=='DELIVERED_TO_GATEWAY'||_0x3ff72a==_0x58ff('0xd4')){return _0x3f76b8[_0x58ff('0xd1')]({'read':!![]});}else{logger[_0x58ff('0x28')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x58ff('0x2d'),'clickatell',util['inspect'](_0x3c0edb[_0x58ff('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x58ff('0x90'):if(_0x3ff72a=='message-delivered'){return _0x3f76b8[_0x58ff('0xd1')]({'read':!![]});}else{logger['error'](_0x58ff('0xb1'),_0x58ff('0x2d'),'bandwidth',util[_0x58ff('0xd2')](_0x3c0edb[_0x58ff('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x58ff('0x91'):if(_0x3ff72a===_0x58ff('0xd5')||_0x3ff72a===_0x58ff('0xd6')){return _0x3f76b8[_0x58ff('0xd1')]({'read':!![]});}else{logger[_0x58ff('0x28')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x58ff('0x2d'),_0x58ff('0x91'),util[_0x58ff('0xd2')](_0x3c0edb[_0x58ff('0x5e')],{'showHidden':![],'depth':null}));}break;}return _0x3f76b8;}})[_0x58ff('0x23')](respondWithResult(_0x2d5a8c,null))[_0x58ff('0x2c')](handleError(_0x2d5a8c,null));};exports[_0x58ff('0xd7')]=function(_0x2bed71,_0x362ee5,_0x43a554){var _0x486d7d,_0x2da5e5,_0x96a7a4;return db[_0x58ff('0x42')][_0x58ff('0x5c')]({'where':{'id':_0x2bed71['params']['id']}})[_0x58ff('0x23')](handleEntityNotFound(_0x362ee5,null))[_0x58ff('0x23')](function(_0x174866){if(_0x174866){_0x96a7a4=_0x174866;logger[_0x58ff('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x58ff('0xc7'),_0x174866[_0x58ff('0x51')],util['inspect'](_0x2bed71[_0x58ff('0x47')],{'showHidden':![],'depth':null}));switch(_0x174866[_0x58ff('0x51')]){case'csc':if(_0x2bed71[_0x58ff('0x47')][_0x58ff('0xd8')]&&_0x2bed71[_0x58ff('0x47')]['state']){_0x2da5e5=_0x2bed71[_0x58ff('0x47')][_0x58ff('0xd9')];return db[_0x58ff('0xc4')][_0x58ff('0x5c')]({'where':{'messageId':_0x2bed71[_0x58ff('0x47')]['message-id']}});}break;}}})['then'](handleEntityNotFound(_0x362ee5,null))[_0x58ff('0x23')](function(_0x28cd96){if(_0x28cd96){_0x486d7d=_0x28cd96;switch(_0x96a7a4[_0x58ff('0x51')]){case _0x58ff('0xda'):if(_0x2da5e5==='2'||_0x2da5e5==='6'){return _0x486d7d[_0x58ff('0xd1')]({'read':!![]});}else{logger['error'](_0x58ff('0xb1'),_0x58ff('0x2d'),'csc',util[_0x58ff('0xd2')](_0x2bed71[_0x58ff('0x47')],{'showHidden':![],'depth':null}));};break;}return _0x486d7d;}})['then'](respondWithResult(_0x362ee5,null))[_0x58ff('0x2c')](handleError(_0x362ee5,null));};exports[_0x58ff('0xdb')]=function(_0x2925c3,_0x3480ce,_0x3315a9){return db['SmsAccount'][_0x58ff('0x5c')]({'where':{'id':_0x2925c3[_0x58ff('0x59')]['id']}})[_0x58ff('0x23')](handleEntityNotFound(_0x3480ce,null))[_0x58ff('0x23')](function(_0x31c025){if(_0x31c025){return _0x31c025['addAgents'](_0x2925c3[_0x58ff('0x5e')][_0x58ff('0x71')],_[_0x58ff('0x9d')](_0x2925c3[_0x58ff('0x5e')],[_0x58ff('0x71'),'id'])||{})[_0x58ff('0xa0')](function(_0x1a2fde){for(var _0x4ab9b8=0x0;_0x4ab9b8<_0x2925c3['body']['ids'][_0x58ff('0x5b')];_0x4ab9b8+=0x1){socket['emit']('userSmsAccount:save',{'UserId':Number(_0x2925c3[_0x58ff('0x5e')][_0x58ff('0x71')][_0x4ab9b8]),'SmsAccountId':Number(_0x2925c3[_0x58ff('0x59')]['id'])});}return _0x1a2fde;});}})[_0x58ff('0x23')](respondWithResult(_0x3480ce,null))['catch'](handleError(_0x3480ce,null));};exports[_0x58ff('0xdc')]=function(_0x7636a3,_0x46555a,_0x3d0647){return db[_0x58ff('0x42')]['find']({'where':{'id':_0x7636a3[_0x58ff('0x59')]['id']}})[_0x58ff('0x23')](handleEntityNotFound(_0x46555a,null))[_0x58ff('0x23')](function(_0x5c2f50){if(_0x5c2f50){return _0x5c2f50[_0x58ff('0xdc')](_0x7636a3['query'][_0x58ff('0x71')])[_0x58ff('0x23')](function(){if(_[_0x58ff('0xdd')](_0x7636a3[_0x58ff('0x47')]['ids'])){for(var _0x226112=0x0;_0x226112<_0x7636a3[_0x58ff('0x47')][_0x58ff('0x71')]['length'];_0x226112+=0x1){socket[_0x58ff('0xde')](_0x58ff('0xdf'),{'UserId':Number(_0x7636a3[_0x58ff('0x47')][_0x58ff('0x71')][_0x226112]),'SmsAccountId':Number(_0x7636a3[_0x58ff('0x59')]['id'])});}}else{socket['emit'](_0x58ff('0xdf'),{'UserId':Number(_0x7636a3[_0x58ff('0x47')][_0x58ff('0x71')]),'SmsAccountId':Number(_0x7636a3[_0x58ff('0x59')]['id'])});}});}})[_0x58ff('0x23')](respondWithStatusCode(_0x46555a,null))[_0x58ff('0x2c')](handleError(_0x46555a,null));};exports['getAgents']=function(_0x48466a,_0x2303ce,_0x4b3d4f){var _0x5763f5={};var _0x48e237={};var _0x5bb71a;var _0x13849d;return db[_0x58ff('0x42')][_0x58ff('0x68')]({'where':{'id':_0x48466a[_0x58ff('0x59')]['id']}})[_0x58ff('0x23')](handleEntityNotFound(_0x2303ce,null))['then'](function(_0x3bddb5){if(_0x3bddb5){_0x5bb71a=_0x3bddb5;_0x48e237[_0x58ff('0x46')]=_['keys'](db[_0x58ff('0xaa')][_0x58ff('0x43')]);_0x48e237[_0x58ff('0x47')]=_[_0x58ff('0x5a')](_0x48466a[_0x58ff('0x47')]);_0x48e237[_0x58ff('0x48')]=_[_0x58ff('0x49')](_0x48e237[_0x58ff('0x46')],_0x48e237[_0x58ff('0x47')]);_0x5763f5[_0x58ff('0x4a')]=_[_0x58ff('0x49')](_0x48e237[_0x58ff('0x46')],qs[_0x58ff('0x4b')](_0x48466a[_0x58ff('0x47')][_0x58ff('0x4b')]));_0x5763f5[_0x58ff('0x4a')]=_0x5763f5['attributes'][_0x58ff('0x5b')]?_0x5763f5[_0x58ff('0x4a')]:_0x48e237[_0x58ff('0x46')];_0x5763f5['order']=qs[_0x58ff('0x4c')](_0x48466a[_0x58ff('0x47')][_0x58ff('0x4c')]);_0x5763f5[_0x58ff('0x4d')]=qs[_0x58ff('0x48')](_['pick'](_0x48466a['query'],_0x48e237[_0x58ff('0x48')]));if(_0x48466a['query'][_0x58ff('0x4f')]){_0x5763f5[_0x58ff('0x4d')]=_[_0x58ff('0x50')](_0x5763f5['where'],{'$or':_[_0x58ff('0x41')](_0x5763f5[_0x58ff('0x4a')],function(_0x1b19f0){var _0x1dbe9e={};_0x1dbe9e[_0x1b19f0]={'$like':'%'+_0x48466a[_0x58ff('0x47')][_0x58ff('0x4f')]+'%'};return _0x1dbe9e;})});}_0x5763f5=_[_0x58ff('0x50')]({},_0x5763f5,_0x48466a['options']);return _0x5bb71a[_0x58ff('0xe0')](_0x5763f5);}})[_0x58ff('0x23')](function(_0x5659b3){if(_0x5659b3){_0x13849d=_0x5659b3['length'];if(!_0x48466a['query'][_0x58ff('0x69')](_0x58ff('0x6a'))){_0x5763f5['limit']=qs[_0x58ff('0x31')](_0x48466a[_0x58ff('0x47')]['limit']);_0x5763f5[_0x58ff('0x2f')]=qs[_0x58ff('0x2f')](_0x48466a[_0x58ff('0x47')][_0x58ff('0x2f')]);}return _0x5bb71a['getAgents'](_0x5763f5);}})['then'](function(_0x3df41b){if(_0x3df41b){return _0x3df41b?{'count':_0x13849d,'rows':_0x3df41b}:null;}})[_0x58ff('0x23')](respondWithResult(_0x2303ce,null))[_0x58ff('0x2c')](handleError(_0x2303ce,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 98bb739..57cf035 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 _0x3322=['update','remove','hasOwnProperty','hook','exports','events','../../mysqldb','SmsAccount','setMaxListeners','save'];(function(_0x6e222c,_0x4ea6a4){var _0x484826=function(_0x547613){while(--_0x547613){_0x6e222c['push'](_0x6e222c['shift']());}};_0x484826(++_0x4ea6a4);}(_0x3322,0xd7));var _0x2332=function(_0x128029,_0x348b4d){_0x128029=_0x128029-0x0;var _0x4ac5ab=_0x3322[_0x128029];return _0x4ac5ab;};'use strict';var EventEmitter=require(_0x2332('0x0'));var SmsAccount=require(_0x2332('0x1'))['db'][_0x2332('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x2332('0x3')](0x0);var events={'afterCreate':_0x2332('0x4'),'afterUpdate':_0x2332('0x5'),'afterDestroy':_0x2332('0x6')};function emitEvent(_0x578d62){return function(_0xc992d9,_0x377c5f,_0x169dd1){SmsAccountEvents['emit'](_0x578d62+':'+_0xc992d9['id'],_0xc992d9);SmsAccountEvents['emit'](_0x578d62,_0xc992d9);_0x169dd1(null);};}for(var e in events){if(events[_0x2332('0x7')](e)){var event=events[e];SmsAccount[_0x2332('0x8')](e,emitEvent(event));}}module[_0x2332('0x9')]=SmsAccountEvents; \ No newline at end of file +var _0x6537=['hook','exports','events','../../mysqldb','SmsAccount','setMaxListeners','save','update','remove','hasOwnProperty'];(function(_0x5612a7,_0x56171e){var _0x1f3782=function(_0x853d73){while(--_0x853d73){_0x5612a7['push'](_0x5612a7['shift']());}};_0x1f3782(++_0x56171e);}(_0x6537,0x1d8));var _0x7653=function(_0x15f70c,_0x432c62){_0x15f70c=_0x15f70c-0x0;var _0x6c0ab2=_0x6537[_0x15f70c];return _0x6c0ab2;};'use strict';var EventEmitter=require(_0x7653('0x0'));var SmsAccount=require(_0x7653('0x1'))['db'][_0x7653('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x7653('0x3')](0x0);var events={'afterCreate':_0x7653('0x4'),'afterUpdate':_0x7653('0x5'),'afterDestroy':_0x7653('0x6')};function emitEvent(_0x8bc892){return function(_0x133593,_0x4dc5a5,_0x53454b){SmsAccountEvents['emit'](_0x8bc892+':'+_0x133593['id'],_0x133593);SmsAccountEvents['emit'](_0x8bc892,_0x133593);_0x53454b(null);};}for(var e in events){if(events[_0x7653('0x7')](e)){var event=events[e];SmsAccount[_0x7653('0x8')](e,emitEvent(event));}}module[_0x7653('0x9')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 11a09ef..70c4685 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 _0x97ff=['./smsAccount.attributes','exports','define','SmsAccount','sms_accounts','lodash','util','../../config/logger','request-promise','path','../../config/environment'];(function(_0x224477,_0x1e669b){var _0x4e32c5=function(_0x298dbb){while(--_0x298dbb){_0x224477['push'](_0x224477['shift']());}};_0x4e32c5(++_0x1e669b);}(_0x97ff,0x94));var _0xf97f=function(_0xe3bde,_0x4e8c25){_0xe3bde=_0xe3bde-0x0;var _0x454a1c=_0x97ff[_0xe3bde];return _0x454a1c;};'use strict';var _=require(_0xf97f('0x0'));var util=require(_0xf97f('0x1'));var logger=require(_0xf97f('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf97f('0x3'));var fs=require('fs');var path=require(_0xf97f('0x4'));var rimraf=require('rimraf');var config=require(_0xf97f('0x5'));var attributes=require(_0xf97f('0x6'));module[_0xf97f('0x7')]=function(_0x178bdc,_0x1cf29f){return _0x178bdc[_0xf97f('0x8')](_0xf97f('0x9'),attributes,{'tableName':_0xf97f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf1ae=['path','rimraf','../../config/environment','./smsAccount.attributes','exports','define','SmsAccount','sms_accounts','lodash','util','moment','request-promise'];(function(_0x1e9edb,_0x212f29){var _0x4f279b=function(_0x51f639){while(--_0x51f639){_0x1e9edb['push'](_0x1e9edb['shift']());}};_0x4f279b(++_0x212f29);}(_0xf1ae,0xc8));var _0xef1a=function(_0x2dc45d,_0x586405){_0x2dc45d=_0x2dc45d-0x0;var _0x125e2f=_0xf1ae[_0x2dc45d];return _0x125e2f;};'use strict';var _=require(_0xef1a('0x0'));var util=require(_0xef1a('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xef1a('0x2'));var BPromise=require('bluebird');var rp=require(_0xef1a('0x3'));var fs=require('fs');var path=require(_0xef1a('0x4'));var rimraf=require(_0xef1a('0x5'));var config=require(_0xef1a('0x6'));var attributes=require(_0xef1a('0x7'));module[_0xef1a('0x8')]=function(_0x5adafb,_0x5e47be){return _0x5adafb[_0xef1a('0x9')](_0xef1a('0xa'),attributes,{'tableName':_0xef1a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.rpc.js b/server/api/smsAccount/smsAccount.rpc.js index edbb89b..70b224e 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 _0x6683=['SmsAccount,\x20%s,\x20%s','message','result','catch','ShowSmsAccount','SmsAccount','find','options','raw','where','map','include','model','attributes','debug','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','./smsAccount.socket','then','info','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x6683,0x14a));var _0x3668=function(_0x54f1dc,_0x863c6b){_0x54f1dc=_0x54f1dc-0x0;var _0x257fcb=_0x6683[_0x54f1dc];return _0x257fcb;};'use strict';var _=require(_0x3668('0x0'));var util=require('util');var moment=require(_0x3668('0x1'));var BPromise=require(_0x3668('0x2'));var rs=require(_0x3668('0x3'));var fs=require('fs');var Redis=require(_0x3668('0x4'));var db=require(_0x3668('0x5'))['db'];var utils=require(_0x3668('0x6'));var logger=require(_0x3668('0x7'))(_0x3668('0x8'));var config=require(_0x3668('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x3668('0xa')]['http']({'port':0x232a});config[_0x3668('0xb')]=_[_0x3668('0xc')](config[_0x3668('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3668('0xb')]));require(_0x3668('0xd'))['register'](socket);function respondWithRpcPromise(_0xa72075,_0x3a2556,_0x540328){return new BPromise(function(_0x37f30e,_0x1b19e0){return client['request'](_0xa72075,_0x540328)[_0x3668('0xe')](function(_0xa0bf3b){logger[_0x3668('0xf')]('SmsAccount,\x20%s,\x20%s',_0x3a2556,_0x3668('0x10'));logger['debug'](_0x3668('0x11'),_0x3a2556,'request\x20sent',JSON[_0x3668('0x12')](_0xa0bf3b));if(_0xa0bf3b[_0x3668('0x13')]){if(_0xa0bf3b[_0x3668('0x13')]['code']===0x1f4){logger[_0x3668('0x13')](_0x3668('0x14'),_0x3a2556,_0xa0bf3b[_0x3668('0x13')][_0x3668('0x15')]);return _0x1b19e0(_0xa0bf3b[_0x3668('0x13')][_0x3668('0x15')]);}logger[_0x3668('0x13')]('SmsAccount,\x20%s,\x20%s',_0x3a2556,_0xa0bf3b['error'][_0x3668('0x15')]);return _0x37f30e(_0xa0bf3b[_0x3668('0x13')][_0x3668('0x15')]);}else{logger[_0x3668('0xf')](_0x3668('0x14'),_0x3a2556,_0x3668('0x10'));_0x37f30e(_0xa0bf3b[_0x3668('0x16')][_0x3668('0x15')]);}})[_0x3668('0x17')](function(_0x5cf105){logger['error'](_0x3668('0x14'),_0x3a2556,_0x5cf105);_0x1b19e0(_0x5cf105);});});}exports[_0x3668('0x18')]=function(_0x346da2){var _0x4d9bac=this;return new Promise(function(_0x16d398,_0x5aeb6c){return db[_0x3668('0x19')][_0x3668('0x1a')]({'raw':_0x346da2[_0x3668('0x1b')]?_0x346da2[_0x3668('0x1b')][_0x3668('0x1c')]===undefined?!![]:![]:!![],'where':_0x346da2['options']?_0x346da2[_0x3668('0x1b')][_0x3668('0x1d')]||null:null,'attributes':_0x346da2['options']?_0x346da2['options']['attributes']||null:null,'include':_0x346da2[_0x3668('0x1b')]?_0x346da2[_0x3668('0x1b')]['include']?_[_0x3668('0x1e')](_0x346da2[_0x3668('0x1b')][_0x3668('0x1f')],function(_0x30aeaf){return{'model':db[_0x30aeaf[_0x3668('0x20')]],'as':_0x30aeaf['as'],'attributes':_0x30aeaf[_0x3668('0x21')],'include':_0x30aeaf[_0x3668('0x1f')]?_[_0x3668('0x1e')](_0x30aeaf['include'],function(_0x429f6f){return{'model':db[_0x429f6f[_0x3668('0x20')]],'as':_0x429f6f['as'],'attributes':_0x429f6f['attributes'],'include':_0x429f6f[_0x3668('0x1f')]?_['map'](_0x429f6f[_0x3668('0x1f')],function(_0x3d3739){return{'model':db[_0x3d3739[_0x3668('0x20')]],'as':_0x3d3739['as'],'attributes':_0x3d3739['attributes']};}):[]};}):[]};}):[]:[]})[_0x3668('0xe')](function(_0x483a3e){logger['info'](_0x3668('0x18'),_0x346da2);logger[_0x3668('0x22')]('ShowSmsAccount',_0x346da2,JSON['stringify'](_0x483a3e));_0x16d398(_0x483a3e);})['catch'](function(_0x169370){logger[_0x3668('0x13')]('ShowSmsAccount',_0x169370[_0x3668('0x15')],_0x346da2);_0x5aeb6c(_0x4d9bac[_0x3668('0x13')](0x1f4,_0x169370[_0x3668('0x15')]));});});}; \ No newline at end of file +var _0x4bdf=['info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','ShowSmsAccount','SmsAccount','find','options','where','map','attributes','include','model','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./smsAccount.socket','register','request','then'];(function(_0x358bd7,_0x31c530){var _0x508dcf=function(_0x4221e6){while(--_0x4221e6){_0x358bd7['push'](_0x358bd7['shift']());}};_0x508dcf(++_0x31c530);}(_0x4bdf,0x1e7));var _0xf4bd=function(_0x3450b1,_0x2ea9a9){_0x3450b1=_0x3450b1-0x0;var _0x590954=_0x4bdf[_0x3450b1];return _0x590954;};'use strict';var _=require(_0xf4bd('0x0'));var util=require(_0xf4bd('0x1'));var moment=require(_0xf4bd('0x2'));var BPromise=require(_0xf4bd('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf4bd('0x4'));var db=require(_0xf4bd('0x5'))['db'];var utils=require(_0xf4bd('0x6'));var logger=require(_0xf4bd('0x7'))(_0xf4bd('0x8'));var config=require(_0xf4bd('0x9'));var jayson=require(_0xf4bd('0xa'));var client=jayson[_0xf4bd('0xb')][_0xf4bd('0xc')]({'port':0x232a});config['redis']=_['defaults'](config[_0xf4bd('0xd')],{'host':_0xf4bd('0xe'),'port':0x18eb});var socket=require(_0xf4bd('0xf'))(new Redis(config['redis']));require(_0xf4bd('0x10'))[_0xf4bd('0x11')](socket);function respondWithRpcPromise(_0x4ecef5,_0x501d5e,_0x260d84){return new BPromise(function(_0x2bec5b,_0x2a4302){return client[_0xf4bd('0x12')](_0x4ecef5,_0x260d84)[_0xf4bd('0x13')](function(_0x5dca01){logger[_0xf4bd('0x14')](_0xf4bd('0x15'),_0x501d5e,_0xf4bd('0x16'));logger[_0xf4bd('0x17')](_0xf4bd('0x18'),_0x501d5e,_0xf4bd('0x16'),JSON['stringify'](_0x5dca01));if(_0x5dca01['error']){if(_0x5dca01[_0xf4bd('0x19')][_0xf4bd('0x1a')]===0x1f4){logger[_0xf4bd('0x19')](_0xf4bd('0x15'),_0x501d5e,_0x5dca01[_0xf4bd('0x19')]['message']);return _0x2a4302(_0x5dca01['error'][_0xf4bd('0x1b')]);}logger[_0xf4bd('0x19')](_0xf4bd('0x15'),_0x501d5e,_0x5dca01[_0xf4bd('0x19')][_0xf4bd('0x1b')]);return _0x2bec5b(_0x5dca01[_0xf4bd('0x19')]['message']);}else{logger[_0xf4bd('0x14')](_0xf4bd('0x15'),_0x501d5e,_0xf4bd('0x16'));_0x2bec5b(_0x5dca01['result']['message']);}})[_0xf4bd('0x1c')](function(_0xc509f){logger[_0xf4bd('0x19')](_0xf4bd('0x15'),_0x501d5e,_0xc509f);_0x2a4302(_0xc509f);});});}exports[_0xf4bd('0x1d')]=function(_0x426322){var _0x729829=this;return new Promise(function(_0x1cc674,_0x1a0547){return db[_0xf4bd('0x1e')][_0xf4bd('0x1f')]({'raw':_0x426322['options']?_0x426322[_0xf4bd('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x426322[_0xf4bd('0x20')]?_0x426322[_0xf4bd('0x20')][_0xf4bd('0x21')]||null:null,'attributes':_0x426322[_0xf4bd('0x20')]?_0x426322[_0xf4bd('0x20')]['attributes']||null:null,'include':_0x426322[_0xf4bd('0x20')]?_0x426322[_0xf4bd('0x20')]['include']?_[_0xf4bd('0x22')](_0x426322[_0xf4bd('0x20')]['include'],function(_0x3fa00f){return{'model':db[_0x3fa00f['model']],'as':_0x3fa00f['as'],'attributes':_0x3fa00f[_0xf4bd('0x23')],'include':_0x3fa00f['include']?_[_0xf4bd('0x22')](_0x3fa00f[_0xf4bd('0x24')],function(_0x3e0a8d){return{'model':db[_0x3e0a8d['model']],'as':_0x3e0a8d['as'],'attributes':_0x3e0a8d[_0xf4bd('0x23')],'include':_0x3e0a8d[_0xf4bd('0x24')]?_[_0xf4bd('0x22')](_0x3e0a8d[_0xf4bd('0x24')],function(_0x436aac){return{'model':db[_0x436aac[_0xf4bd('0x25')]],'as':_0x436aac['as'],'attributes':_0x436aac[_0xf4bd('0x23')]};}):[]};}):[]};}):[]:[]})[_0xf4bd('0x13')](function(_0x2a17ac){logger[_0xf4bd('0x14')](_0xf4bd('0x1d'),_0x426322);logger[_0xf4bd('0x17')]('ShowSmsAccount',_0x426322,JSON[_0xf4bd('0x26')](_0x2a17ac));_0x1cc674(_0x2a17ac);})[_0xf4bd('0x1c')](function(_0x244120){logger['error'](_0xf4bd('0x1d'),_0x244120[_0xf4bd('0x1b')],_0x426322);_0x1a0547(_0x729829[_0xf4bd('0x19')](0x1f4,_0x244120[_0xf4bd('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 784e6c4..fcec19d 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(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'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 dc0dae5..1854461 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(_0x54be41,_0x1d0f66){var _0x761326=function(_0x32db7f){while(--_0x32db7f){_0x54be41['push'](_0x54be41['shift']());}};_0x761326(++_0x1d0f66);}(_0x008c,0x188));var _0xc008=function(_0x18a81a,_0x4fc65b){_0x18a81a=_0x18a81a-0x0;var _0x114027=_0x008c[_0x18a81a];return _0x114027;};'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 _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_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/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index a2143c9..f54bf00 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 _0xd677=['STRING','TEXT'];(function(_0x55b78d,_0x1d1561){var _0x3aa8c9=function(_0x3f7bb8){while(--_0x3f7bb8){_0x55b78d['push'](_0x55b78d['shift']());}};_0x3aa8c9(++_0x1d1561);}(_0xd677,0x94));var _0x7d67=function(_0x94118,_0x3bf157){_0x94118=_0x94118-0x0;var _0x685a42=_0xd677[_0x94118];return _0x685a42;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x7d67('0x0')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x7d67('0x1')]()},'description':{'type':Sequelize[_0x7d67('0x0')]},'interval':{'type':Sequelize[_0x7d67('0x0')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x9584=['noop','TEXT','*,*,*,*','sequelize','exports','STRING'];(function(_0x4503df,_0xfec122){var _0x3f1b2b=function(_0x32b1de){while(--_0x32b1de){_0x4503df['push'](_0x4503df['shift']());}};_0x3f1b2b(++_0xfec122);}(_0x9584,0x9f));var _0x4958=function(_0x3163c9,_0x476a78){_0x3163c9=_0x3163c9-0x0;var _0x2e0f94=_0x9584[_0x3163c9];return _0x2e0f94;};'use strict';var Sequelize=require(_0x4958('0x0'));module[_0x4958('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x4958('0x2')],'allowNull':![],'defaultValue':_0x4958('0x3')},'appdata':{'type':Sequelize[_0x4958('0x4')]()},'description':{'type':Sequelize[_0x4958('0x2')]},'interval':{'type':Sequelize[_0x4958('0x2')],'defaultValue':_0x4958('0x5')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index bba3cc4..700e3ad 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 _0xa2a6=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where','VIRTUAL','filter','merge','include','findAll','rows','catch','show','params','SmsApplication','includeAll','options','find','create','body','eml-format','rimraf','fast-json-patch','moment','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse'];(function(_0x190912,_0x13c19b){var _0x3db018=function(_0x57625a){while(--_0x57625a){_0x190912['push'](_0x190912['shift']());}};_0x3db018(++_0x13c19b);}(_0xa2a6,0x116));var _0x6a2a=function(_0x266e50,_0x58680c){_0x266e50=_0x266e50-0x0;var _0x9d7a26=_0xa2a6[_0x266e50];return _0x9d7a26;};'use strict';var emlformat=require(_0x6a2a('0x0'));var rimraf=require(_0x6a2a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6a2a('0x2'));var rp=require('request-promise');var moment=require(_0x6a2a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6a2a('0x4'));var util=require(_0x6a2a('0x5'));var path=require('path');var sox=require(_0x6a2a('0x6'));var csv=require(_0x6a2a('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6a2a('0x8'));var _=require(_0x6a2a('0x9'));var squel=require(_0x6a2a('0xa'));var crypto=require(_0x6a2a('0xb'));var jsforce=require(_0x6a2a('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6a2a('0x7'));var querystring=require('querystring');var Papa=require(_0x6a2a('0xd'));var Redis=require(_0x6a2a('0xe'));var authService=require(_0x6a2a('0xf'));var qs=require(_0x6a2a('0x10'));var as=require(_0x6a2a('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6a2a('0x12'));var utils=require('../../config/utils');var config=require(_0x6a2a('0x13'));var licenseUtil=require(_0x6a2a('0x14'));var db=require(_0x6a2a('0x15'))['db'];function respondWithStatusCode(_0x56e71e,_0x44d5a7){_0x44d5a7=_0x44d5a7||0xcc;return function(_0x560e05){if(_0x560e05){return _0x56e71e[_0x6a2a('0x16')](_0x44d5a7);}return _0x56e71e[_0x6a2a('0x17')](_0x44d5a7)[_0x6a2a('0x18')]();};}function respondWithResult(_0x4929d4,_0x4e102b){_0x4e102b=_0x4e102b||0xc8;return function(_0xe226b4){if(_0xe226b4){return _0x4929d4['status'](_0x4e102b)[_0x6a2a('0x19')](_0xe226b4);}};}function respondWithFilteredResult(_0x17f7e9,_0x4062e9){return function(_0x13149d){if(_0x13149d){var _0x27f1ba=typeof _0x4062e9[_0x6a2a('0x1a')]===_0x6a2a('0x1b')&&typeof _0x4062e9[_0x6a2a('0x1c')]===_0x6a2a('0x1b');var _0x5af11f=_0x13149d[_0x6a2a('0x1d')];var _0x40e176=_0x27f1ba?0x0:_0x4062e9[_0x6a2a('0x1a')];var _0x52ac48=_0x27f1ba?_0x13149d[_0x6a2a('0x1d')]:_0x4062e9[_0x6a2a('0x1a')]+_0x4062e9['limit'];var _0x11215b;if(_0x52ac48>=_0x5af11f){_0x52ac48=_0x5af11f;_0x11215b=0xc8;}else{_0x11215b=0xce;}_0x17f7e9['status'](_0x11215b);return _0x17f7e9['set']('Content-Range',_0x40e176+'-'+_0x52ac48+'/'+_0x5af11f)[_0x6a2a('0x19')](_0x13149d);}return null;};}function patchUpdates(_0x2807e7){return function(_0x363538){try{jsonpatch[_0x6a2a('0x1e')](_0x363538,_0x2807e7,!![]);}catch(_0x270ae0){return BPromise['reject'](_0x270ae0);}return _0x363538['save']();};}function saveUpdates(_0x2c4656,_0x2d0bc0){return function(_0x1f418e){if(_0x1f418e){return _0x1f418e[_0x6a2a('0x1f')](_0x2c4656)[_0x6a2a('0x20')](function(_0x3fd07f){return _0x3fd07f;});}return null;};}function removeEntity(_0xfa9879,_0x324881){return function(_0x5b4496){if(_0x5b4496){return _0x5b4496[_0x6a2a('0x21')]()[_0x6a2a('0x20')](function(){_0xfa9879[_0x6a2a('0x17')](0xcc)[_0x6a2a('0x18')]();});}};}function handleEntityNotFound(_0x44cfa0,_0x118589){return function(_0x1cc415){if(!_0x1cc415){_0x44cfa0[_0x6a2a('0x16')](0x194);}return _0x1cc415;};}function handleError(_0x241908,_0x2ad0bd){_0x2ad0bd=_0x2ad0bd||0x1f4;return function(_0x252bc8){logger[_0x6a2a('0x22')](_0x252bc8[_0x6a2a('0x23')]);if(_0x252bc8[_0x6a2a('0x24')]){delete _0x252bc8[_0x6a2a('0x24')];}_0x241908[_0x6a2a('0x17')](_0x2ad0bd)[_0x6a2a('0x25')](_0x252bc8);};}exports[_0x6a2a('0x26')]=function(_0x2a0927,_0x125c5e){var _0x1e6acd={},_0x335e56={},_0x3a8cd0={'count':0x0,'rows':[]};var _0x5ddba5=_[_0x6a2a('0x27')](db['SmsApplication'][_0x6a2a('0x28')],function(_0x2b9713){return{'name':_0x2b9713[_0x6a2a('0x29')],'type':_0x2b9713[_0x6a2a('0x2a')][_0x6a2a('0x2b')]};});_0x335e56[_0x6a2a('0x2c')]=_[_0x6a2a('0x27')](_0x5ddba5,_0x6a2a('0x24'));_0x335e56[_0x6a2a('0x2d')]=_[_0x6a2a('0x2e')](_0x2a0927[_0x6a2a('0x2d')]);_0x335e56[_0x6a2a('0x2f')]=_[_0x6a2a('0x30')](_0x335e56['model'],_0x335e56[_0x6a2a('0x2d')]);_0x1e6acd['attributes']=_[_0x6a2a('0x30')](_0x335e56[_0x6a2a('0x2c')],qs['fields'](_0x2a0927[_0x6a2a('0x2d')][_0x6a2a('0x31')]));_0x1e6acd[_0x6a2a('0x32')]=_0x1e6acd[_0x6a2a('0x32')][_0x6a2a('0x33')]?_0x1e6acd[_0x6a2a('0x32')]:_0x335e56[_0x6a2a('0x2c')];if(!_0x2a0927['query'][_0x6a2a('0x34')](_0x6a2a('0x35'))){_0x1e6acd[_0x6a2a('0x1c')]=qs[_0x6a2a('0x1c')](_0x2a0927[_0x6a2a('0x2d')][_0x6a2a('0x1c')]);_0x1e6acd[_0x6a2a('0x1a')]=qs['offset'](_0x2a0927[_0x6a2a('0x2d')]['offset']);}_0x1e6acd[_0x6a2a('0x36')]=qs['sort'](_0x2a0927[_0x6a2a('0x2d')][_0x6a2a('0x37')]);_0x1e6acd['where']=qs[_0x6a2a('0x2f')](_[_0x6a2a('0x38')](_0x2a0927['query'],_0x335e56[_0x6a2a('0x2f')]),_0x5ddba5);if(_0x2a0927[_0x6a2a('0x2d')]['filter']){_0x1e6acd[_0x6a2a('0x39')]=_['merge'](_0x1e6acd[_0x6a2a('0x39')],{'$or':_[_0x6a2a('0x27')](_0x5ddba5,function(_0x47c066){if(_0x47c066['type']!==_0x6a2a('0x3a')){var _0xdea8bf={};_0xdea8bf[_0x47c066['name']]={'$like':'%'+_0x2a0927[_0x6a2a('0x2d')][_0x6a2a('0x3b')]+'%'};return _0xdea8bf;}})});}_0x1e6acd=_[_0x6a2a('0x3c')]({},_0x1e6acd,_0x2a0927['options']);var _0x56eba7={'where':_0x1e6acd[_0x6a2a('0x39')]};return db['SmsApplication']['count'](_0x56eba7)[_0x6a2a('0x20')](function(_0x25a648){_0x3a8cd0[_0x6a2a('0x1d')]=_0x25a648;if(_0x2a0927[_0x6a2a('0x2d')]['includeAll']){_0x1e6acd[_0x6a2a('0x3d')]=[{'all':!![]}];}return db['SmsApplication'][_0x6a2a('0x3e')](_0x1e6acd);})['then'](function(_0x3896b2){_0x3a8cd0[_0x6a2a('0x3f')]=_0x3896b2;return _0x3a8cd0;})['then'](respondWithFilteredResult(_0x125c5e,_0x1e6acd))[_0x6a2a('0x40')](handleError(_0x125c5e,null));};exports[_0x6a2a('0x41')]=function(_0x388bdb,_0x1448f4){var _0x31aa50={'raw':!![],'where':{'id':_0x388bdb[_0x6a2a('0x42')]['id']}},_0x30e16b={};_0x30e16b[_0x6a2a('0x2c')]=_['keys'](db[_0x6a2a('0x43')][_0x6a2a('0x28')]);_0x30e16b[_0x6a2a('0x2d')]=_[_0x6a2a('0x2e')](_0x388bdb[_0x6a2a('0x2d')]);_0x30e16b[_0x6a2a('0x2f')]=_[_0x6a2a('0x30')](_0x30e16b[_0x6a2a('0x2c')],_0x30e16b[_0x6a2a('0x2d')]);_0x31aa50['attributes']=_[_0x6a2a('0x30')](_0x30e16b[_0x6a2a('0x2c')],qs['fields'](_0x388bdb[_0x6a2a('0x2d')][_0x6a2a('0x31')]));_0x31aa50[_0x6a2a('0x32')]=_0x31aa50['attributes'][_0x6a2a('0x33')]?_0x31aa50['attributes']:_0x30e16b[_0x6a2a('0x2c')];if(_0x388bdb[_0x6a2a('0x2d')][_0x6a2a('0x44')]){_0x31aa50[_0x6a2a('0x3d')]=[{'all':!![]}];}_0x31aa50=_[_0x6a2a('0x3c')]({},_0x31aa50,_0x388bdb[_0x6a2a('0x45')]);return db[_0x6a2a('0x43')][_0x6a2a('0x46')](_0x31aa50)['then'](handleEntityNotFound(_0x1448f4,null))[_0x6a2a('0x20')](respondWithResult(_0x1448f4,null))[_0x6a2a('0x40')](handleError(_0x1448f4,null));};exports[_0x6a2a('0x47')]=function(_0x33eca9,_0x3109ef){return db[_0x6a2a('0x43')]['create'](_0x33eca9['body'],{})[_0x6a2a('0x20')](respondWithResult(_0x3109ef,0xc9))[_0x6a2a('0x40')](handleError(_0x3109ef,null));};exports[_0x6a2a('0x1f')]=function(_0x9bff63,_0x635abe){if(_0x9bff63[_0x6a2a('0x48')]['id']){delete _0x9bff63['body']['id'];}return db['SmsApplication'][_0x6a2a('0x46')]({'where':{'id':_0x9bff63[_0x6a2a('0x42')]['id']}})[_0x6a2a('0x20')](handleEntityNotFound(_0x635abe,null))['then'](saveUpdates(_0x9bff63[_0x6a2a('0x48')],null))[_0x6a2a('0x20')](respondWithResult(_0x635abe,null))[_0x6a2a('0x40')](handleError(_0x635abe,null));};exports[_0x6a2a('0x21')]=function(_0x723439,_0x319217){return db[_0x6a2a('0x43')][_0x6a2a('0x46')]({'where':{'id':_0x723439[_0x6a2a('0x42')]['id']}})[_0x6a2a('0x20')](handleEntityNotFound(_0x319217,null))['then'](removeEntity(_0x319217,null))['catch'](handleError(_0x319217,null));}; \ No newline at end of file +var _0xa5f1=['sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','SmsApplication','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','find','create','body','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa5f1,0x168));var _0x1a5f=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa5f1[_0x5447fd];return _0x15b28a;};'use strict';var emlformat=require(_0x1a5f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1a5f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1a5f('0x2'));var moment=require(_0x1a5f('0x3'));var BPromise=require(_0x1a5f('0x4'));var Mustache=require(_0x1a5f('0x5'));var util=require(_0x1a5f('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1a5f('0x7'));var fs=require('fs');var fs_extra=require(_0x1a5f('0x8'));var _=require(_0x1a5f('0x9'));var squel=require('squel');var crypto=require(_0x1a5f('0xa'));var jsforce=require(_0x1a5f('0xb'));var deskjs=require(_0x1a5f('0xc'));var toCsv=require(_0x1a5f('0xd'));var querystring=require(_0x1a5f('0xe'));var Papa=require(_0x1a5f('0xf'));var Redis=require(_0x1a5f('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x1a5f('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1a5f('0x12'));var logger=require(_0x1a5f('0x13'))(_0x1a5f('0x14'));var utils=require(_0x1a5f('0x15'));var config=require(_0x1a5f('0x16'));var licenseUtil=require(_0x1a5f('0x17'));var db=require(_0x1a5f('0x18'))['db'];function respondWithStatusCode(_0x4631eb,_0x357198){_0x357198=_0x357198||0xcc;return function(_0x45fbae){if(_0x45fbae){return _0x4631eb[_0x1a5f('0x19')](_0x357198);}return _0x4631eb[_0x1a5f('0x1a')](_0x357198)[_0x1a5f('0x1b')]();};}function respondWithResult(_0x379b49,_0x605cef){_0x605cef=_0x605cef||0xc8;return function(_0x53bddc){if(_0x53bddc){return _0x379b49[_0x1a5f('0x1a')](_0x605cef)[_0x1a5f('0x1c')](_0x53bddc);}};}function respondWithFilteredResult(_0x3d5aff,_0x5e3c03){return function(_0x457d67){if(_0x457d67){var _0x540d77=typeof _0x5e3c03[_0x1a5f('0x1d')]===_0x1a5f('0x1e')&&typeof _0x5e3c03[_0x1a5f('0x1f')]===_0x1a5f('0x1e');var _0x4864b2=_0x457d67[_0x1a5f('0x20')];var _0x329f1d=_0x540d77?0x0:_0x5e3c03['offset'];var _0x85e9b2=_0x540d77?_0x457d67[_0x1a5f('0x20')]:_0x5e3c03[_0x1a5f('0x1d')]+_0x5e3c03[_0x1a5f('0x1f')];var _0x226f0d;if(_0x85e9b2>=_0x4864b2){_0x85e9b2=_0x4864b2;_0x226f0d=0xc8;}else{_0x226f0d=0xce;}_0x3d5aff['status'](_0x226f0d);return _0x3d5aff[_0x1a5f('0x21')](_0x1a5f('0x22'),_0x329f1d+'-'+_0x85e9b2+'/'+_0x4864b2)[_0x1a5f('0x1c')](_0x457d67);}return null;};}function patchUpdates(_0x3905ec){return function(_0x29b1e8){try{jsonpatch[_0x1a5f('0x23')](_0x29b1e8,_0x3905ec,!![]);}catch(_0x41ad5b){return BPromise[_0x1a5f('0x24')](_0x41ad5b);}return _0x29b1e8[_0x1a5f('0x25')]();};}function saveUpdates(_0x5caaef,_0x295747){return function(_0x390043){if(_0x390043){return _0x390043['update'](_0x5caaef)[_0x1a5f('0x26')](function(_0x5a215c){return _0x5a215c;});}return null;};}function removeEntity(_0x889e4,_0x38ba89){return function(_0x14708d){if(_0x14708d){return _0x14708d[_0x1a5f('0x27')]()[_0x1a5f('0x26')](function(){_0x889e4[_0x1a5f('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16fdfc,_0x32cbd6){return function(_0x20ce59){if(!_0x20ce59){_0x16fdfc[_0x1a5f('0x19')](0x194);}return _0x20ce59;};}function handleError(_0x281c0d,_0x271bd1){_0x271bd1=_0x271bd1||0x1f4;return function(_0x3877dc){logger[_0x1a5f('0x28')](_0x3877dc[_0x1a5f('0x29')]);if(_0x3877dc[_0x1a5f('0x2a')]){delete _0x3877dc['name'];}_0x281c0d['status'](_0x271bd1)[_0x1a5f('0x2b')](_0x3877dc);};}exports[_0x1a5f('0x2c')]=function(_0x12d12a,_0xfda71e){var _0x5d6769={},_0x39939d={},_0x571e29={'count':0x0,'rows':[]};var _0x3a1ff1=_[_0x1a5f('0x2d')](db[_0x1a5f('0x2e')][_0x1a5f('0x2f')],function(_0x291854){return{'name':_0x291854[_0x1a5f('0x30')],'type':_0x291854[_0x1a5f('0x31')][_0x1a5f('0x32')]};});_0x39939d[_0x1a5f('0x33')]=_[_0x1a5f('0x2d')](_0x3a1ff1,'name');_0x39939d['query']=_['keys'](_0x12d12a[_0x1a5f('0x34')]);_0x39939d[_0x1a5f('0x35')]=_[_0x1a5f('0x36')](_0x39939d['model'],_0x39939d[_0x1a5f('0x34')]);_0x5d6769[_0x1a5f('0x37')]=_['intersection'](_0x39939d[_0x1a5f('0x33')],qs[_0x1a5f('0x38')](_0x12d12a[_0x1a5f('0x34')][_0x1a5f('0x38')]));_0x5d6769[_0x1a5f('0x37')]=_0x5d6769['attributes'][_0x1a5f('0x39')]?_0x5d6769[_0x1a5f('0x37')]:_0x39939d['model'];if(!_0x12d12a[_0x1a5f('0x34')][_0x1a5f('0x3a')]('nolimit')){_0x5d6769[_0x1a5f('0x1f')]=qs[_0x1a5f('0x1f')](_0x12d12a[_0x1a5f('0x34')][_0x1a5f('0x1f')]);_0x5d6769[_0x1a5f('0x1d')]=qs[_0x1a5f('0x1d')](_0x12d12a['query'][_0x1a5f('0x1d')]);}_0x5d6769[_0x1a5f('0x3b')]=qs[_0x1a5f('0x3c')](_0x12d12a[_0x1a5f('0x34')][_0x1a5f('0x3c')]);_0x5d6769['where']=qs[_0x1a5f('0x35')](_[_0x1a5f('0x3d')](_0x12d12a['query'],_0x39939d[_0x1a5f('0x35')]),_0x3a1ff1);if(_0x12d12a[_0x1a5f('0x34')][_0x1a5f('0x3e')]){_0x5d6769[_0x1a5f('0x3f')]=_[_0x1a5f('0x40')](_0x5d6769['where'],{'$or':_[_0x1a5f('0x2d')](_0x3a1ff1,function(_0x54cf5a){if(_0x54cf5a[_0x1a5f('0x31')]!==_0x1a5f('0x41')){var _0x4ac6a4={};_0x4ac6a4[_0x54cf5a[_0x1a5f('0x2a')]]={'$like':'%'+_0x12d12a[_0x1a5f('0x34')]['filter']+'%'};return _0x4ac6a4;}})});}_0x5d6769=_[_0x1a5f('0x40')]({},_0x5d6769,_0x12d12a[_0x1a5f('0x42')]);var _0x10ee6c={'where':_0x5d6769[_0x1a5f('0x3f')]};return db[_0x1a5f('0x2e')]['count'](_0x10ee6c)[_0x1a5f('0x26')](function(_0x21899d){_0x571e29['count']=_0x21899d;if(_0x12d12a['query'][_0x1a5f('0x43')]){_0x5d6769[_0x1a5f('0x44')]=[{'all':!![]}];}return db[_0x1a5f('0x2e')]['findAll'](_0x5d6769);})[_0x1a5f('0x26')](function(_0x52cd4c){_0x571e29[_0x1a5f('0x45')]=_0x52cd4c;return _0x571e29;})['then'](respondWithFilteredResult(_0xfda71e,_0x5d6769))[_0x1a5f('0x46')](handleError(_0xfda71e,null));};exports[_0x1a5f('0x47')]=function(_0x21fef3,_0x5442a7){var _0x55afa1={'raw':!![],'where':{'id':_0x21fef3[_0x1a5f('0x48')]['id']}},_0x2d84d7={};_0x2d84d7[_0x1a5f('0x33')]=_[_0x1a5f('0x49')](db[_0x1a5f('0x2e')]['rawAttributes']);_0x2d84d7[_0x1a5f('0x34')]=_['keys'](_0x21fef3[_0x1a5f('0x34')]);_0x2d84d7[_0x1a5f('0x35')]=_[_0x1a5f('0x36')](_0x2d84d7[_0x1a5f('0x33')],_0x2d84d7['query']);_0x55afa1[_0x1a5f('0x37')]=_[_0x1a5f('0x36')](_0x2d84d7['model'],qs[_0x1a5f('0x38')](_0x21fef3['query']['fields']));_0x55afa1['attributes']=_0x55afa1[_0x1a5f('0x37')]['length']?_0x55afa1[_0x1a5f('0x37')]:_0x2d84d7[_0x1a5f('0x33')];if(_0x21fef3[_0x1a5f('0x34')]['includeAll']){_0x55afa1['include']=[{'all':!![]}];}_0x55afa1=_[_0x1a5f('0x40')]({},_0x55afa1,_0x21fef3[_0x1a5f('0x42')]);return db['SmsApplication'][_0x1a5f('0x4a')](_0x55afa1)['then'](handleEntityNotFound(_0x5442a7,null))[_0x1a5f('0x26')](respondWithResult(_0x5442a7,null))['catch'](handleError(_0x5442a7,null));};exports[_0x1a5f('0x4b')]=function(_0x246e83,_0x533d41){return db[_0x1a5f('0x2e')]['create'](_0x246e83[_0x1a5f('0x4c')],{})[_0x1a5f('0x26')](respondWithResult(_0x533d41,0xc9))['catch'](handleError(_0x533d41,null));};exports['update']=function(_0x2c5ebe,_0x17c73d){if(_0x2c5ebe[_0x1a5f('0x4c')]['id']){delete _0x2c5ebe[_0x1a5f('0x4c')]['id'];}return db[_0x1a5f('0x2e')][_0x1a5f('0x4a')]({'where':{'id':_0x2c5ebe[_0x1a5f('0x48')]['id']}})[_0x1a5f('0x26')](handleEntityNotFound(_0x17c73d,null))[_0x1a5f('0x26')](saveUpdates(_0x2c5ebe[_0x1a5f('0x4c')],null))[_0x1a5f('0x26')](respondWithResult(_0x17c73d,null))[_0x1a5f('0x46')](handleError(_0x17c73d,null));};exports['destroy']=function(_0x2aee22,_0x140a82){return db[_0x1a5f('0x2e')][_0x1a5f('0x4a')]({'where':{'id':_0x2aee22[_0x1a5f('0x48')]['id']}})[_0x1a5f('0x26')](handleEntityNotFound(_0x140a82,null))[_0x1a5f('0x26')](removeEntity(_0x140a82,null))[_0x1a5f('0x46')](handleError(_0x140a82,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 6edb249..dd41e42 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 _0x1f0d=['api','moment','bluebird','request-promise','path','rimraf','./smsApplication.attributes','exports','define','SmsApplication','sms_applications','utf8mb4','lodash','util','../../config/logger'];(function(_0x549834,_0x54044c){var _0x42eb5d=function(_0x298252){while(--_0x298252){_0x549834['push'](_0x549834['shift']());}};_0x42eb5d(++_0x54044c);}(_0x1f0d,0x165));var _0xd1f0=function(_0x3bed33,_0x33e08f){_0x3bed33=_0x3bed33-0x0;var _0x389c18=_0x1f0d[_0x3bed33];return _0x389c18;};'use strict';var _=require(_0xd1f0('0x0'));var util=require(_0xd1f0('0x1'));var logger=require(_0xd1f0('0x2'))(_0xd1f0('0x3'));var moment=require(_0xd1f0('0x4'));var BPromise=require(_0xd1f0('0x5'));var rp=require(_0xd1f0('0x6'));var fs=require('fs');var path=require(_0xd1f0('0x7'));var rimraf=require(_0xd1f0('0x8'));var config=require('../../config/environment');var attributes=require(_0xd1f0('0x9'));module[_0xd1f0('0xa')]=function(_0x21dce4,_0x595cd0){return _0x21dce4[_0xd1f0('0xb')](_0xd1f0('0xc'),attributes,{'tableName':_0xd1f0('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd1f0('0xe'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xab28=['api','bluebird','request-promise','path','./smsApplication.attributes','define','sms_applications','utf8mb4','lodash','util','../../config/logger'];(function(_0x2476c9,_0x4d99d5){var _0x29a95d=function(_0x506377){while(--_0x506377){_0x2476c9['push'](_0x2476c9['shift']());}};_0x29a95d(++_0x4d99d5);}(_0xab28,0x15d));var _0x8ab2=function(_0x31a371,_0x50828e){_0x31a371=_0x31a371-0x0;var _0x2a5bd6=_0xab28[_0x31a371];return _0x2a5bd6;};'use strict';var _=require(_0x8ab2('0x0'));var util=require(_0x8ab2('0x1'));var logger=require(_0x8ab2('0x2'))(_0x8ab2('0x3'));var moment=require('moment');var BPromise=require(_0x8ab2('0x4'));var rp=require(_0x8ab2('0x5'));var fs=require('fs');var path=require(_0x8ab2('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8ab2('0x7'));module['exports']=function(_0x8863d0,_0x53b62f){return _0x8863d0[_0x8ab2('0x8')]('SmsApplication',attributes,{'tableName':_0x8ab2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8ab2('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index c6fa149..03c1acd 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 _0xed3c=['result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x501401,_0x2d8737){var _0xfd0a47=function(_0x57decb){while(--_0x57decb){_0x501401['push'](_0x501401['shift']());}};_0xfd0a47(++_0x2d8737);}(_0xed3c,0x1a6));var _0xced3=function(_0x2fb16e,_0x161667){_0x2fb16e=_0x2fb16e-0x0;var _0x5e0882=_0xed3c[_0x2fb16e];return _0x5e0882;};'use strict';var _=require(_0xced3('0x0'));var util=require(_0xced3('0x1'));var moment=require(_0xced3('0x2'));var BPromise=require(_0xced3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xced3('0x4'));var db=require(_0xced3('0x5'))['db'];var utils=require(_0xced3('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xced3('0x7'));var jayson=require(_0xced3('0x8'));var client=jayson[_0xced3('0x9')][_0xced3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4795cd,_0x510164,_0x5ca701){return new BPromise(function(_0x851bd3,_0x5f2f90){return client['request'](_0x4795cd,_0x5ca701)['then'](function(_0x19a727){logger[_0xced3('0xb')](_0xced3('0xc'),_0x510164,_0xced3('0xd'));logger[_0xced3('0xe')]('SmsApplication,\x20%s,\x20%s,\x20%s',_0x510164,_0xced3('0xd'),JSON[_0xced3('0xf')](_0x19a727));if(_0x19a727[_0xced3('0x10')]){if(_0x19a727['error'][_0xced3('0x11')]===0x1f4){logger[_0xced3('0x10')](_0xced3('0xc'),_0x510164,_0x19a727[_0xced3('0x10')][_0xced3('0x12')]);return _0x5f2f90(_0x19a727[_0xced3('0x10')][_0xced3('0x12')]);}logger['error'](_0xced3('0xc'),_0x510164,_0x19a727['error'][_0xced3('0x12')]);return _0x851bd3(_0x19a727[_0xced3('0x10')][_0xced3('0x12')]);}else{logger[_0xced3('0xb')]('SmsApplication,\x20%s,\x20%s',_0x510164,_0xced3('0xd'));_0x851bd3(_0x19a727[_0xced3('0x13')]['message']);}})[_0xced3('0x14')](function(_0x37e2d5){logger[_0xced3('0x10')](_0xced3('0xc'),_0x510164,_0x37e2d5);_0x5f2f90(_0x37e2d5);});});} \ No newline at end of file +var _0x5ed9=['stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','info','SmsApplication,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5ed9,0x1e9));var _0x95ed=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x5ed9[_0x278e3c];return _0x3e2d9b;};'use strict';var _=require(_0x95ed('0x0'));var util=require(_0x95ed('0x1'));var moment=require('moment');var BPromise=require(_0x95ed('0x2'));var rs=require(_0x95ed('0x3'));var fs=require('fs');var Redis=require(_0x95ed('0x4'));var db=require(_0x95ed('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x95ed('0x6'))(_0x95ed('0x7'));var config=require(_0x95ed('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x95ed('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32bf25,_0xaa1eb1,_0x3753b5){return new BPromise(function(_0x1df51f,_0x46ed43){return client[_0x95ed('0xa')](_0x32bf25,_0x3753b5)['then'](function(_0x2b59f5){logger[_0x95ed('0xb')](_0x95ed('0xc'),_0xaa1eb1,'request\x20sent');logger[_0x95ed('0xd')]('SmsApplication,\x20%s,\x20%s,\x20%s',_0xaa1eb1,_0x95ed('0xe'),JSON[_0x95ed('0xf')](_0x2b59f5));if(_0x2b59f5[_0x95ed('0x10')]){if(_0x2b59f5[_0x95ed('0x10')][_0x95ed('0x11')]===0x1f4){logger['error']('SmsApplication,\x20%s,\x20%s',_0xaa1eb1,_0x2b59f5[_0x95ed('0x10')][_0x95ed('0x12')]);return _0x46ed43(_0x2b59f5['error']['message']);}logger[_0x95ed('0x10')](_0x95ed('0xc'),_0xaa1eb1,_0x2b59f5[_0x95ed('0x10')][_0x95ed('0x12')]);return _0x1df51f(_0x2b59f5['error'][_0x95ed('0x12')]);}else{logger[_0x95ed('0xb')](_0x95ed('0xc'),_0xaa1eb1,_0x95ed('0xe'));_0x1df51f(_0x2b59f5[_0x95ed('0x13')]['message']);}})[_0x95ed('0x14')](function(_0x54ad78){logger['error']('SmsApplication,\x20%s,\x20%s',_0xaa1eb1,_0x54ad78);_0x46ed43(_0x54ad78);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 8fc120f..f50fce1 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 _0x3c81=['express','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','addTags','tracked','sms','update','delete','smsinteraction:destroy','destroy','/:id/tags','exports','multer','util','connect-timeout'];(function(_0x24ca90,_0x596e1d){var _0x31d9ef=function(_0x40fa9e){while(--_0x40fa9e){_0x24ca90['push'](_0x24ca90['shift']());}};_0x31d9ef(++_0x596e1d);}(_0x3c81,0x102));var _0x13c8=function(_0x3b2eaa,_0x108aa6){_0x3b2eaa=_0x3b2eaa-0x0;var _0x219ee0=_0x3c81[_0x3b2eaa];return _0x219ee0;};'use strict';var multer=require(_0x13c8('0x0'));var util=require(_0x13c8('0x1'));var path=require('path');var timeout=require(_0x13c8('0x2'));var express=require(_0x13c8('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(_0x13c8('0x4'));var controller=require(_0x13c8('0x5'));router[_0x13c8('0x6')]('/',auth[_0x13c8('0x7')](),controller[_0x13c8('0x8')]);router[_0x13c8('0x6')](_0x13c8('0x9'),auth['isAuthenticated'](),controller[_0x13c8('0xa')]);router['get'](_0x13c8('0xb'),auth[_0x13c8('0x7')](),controller[_0x13c8('0xc')]);router[_0x13c8('0x6')](_0x13c8('0xd'),auth[_0x13c8('0x7')](),controller[_0x13c8('0xe')]);router[_0x13c8('0x6')](_0x13c8('0xf'),auth[_0x13c8('0x7')](),controller[_0x13c8('0x10')]);router[_0x13c8('0x11')]('/',auth[_0x13c8('0x7')](),controller[_0x13c8('0x12')]);router['post'](_0x13c8('0xd'),auth[_0x13c8('0x7')](),controller[_0x13c8('0x13')]);router[_0x13c8('0x11')]('/:id/tags',auth[_0x13c8('0x7')](),interaction['tracked']('sms','smsinteraction:addtags'),controller[_0x13c8('0x14')]);router['put'](_0x13c8('0xb'),auth[_0x13c8('0x7')](),interaction[_0x13c8('0x15')](_0x13c8('0x16'),'smsinteraction:update'),controller[_0x13c8('0x17')]);router[_0x13c8('0x18')](_0x13c8('0xb'),auth[_0x13c8('0x7')](),interaction[_0x13c8('0x15')](_0x13c8('0x16'),_0x13c8('0x19')),controller[_0x13c8('0x1a')]);router[_0x13c8('0x18')](_0x13c8('0x1b'),auth[_0x13c8('0x7')](),controller['removeTags']);module[_0x13c8('0x1c')]=router; \ No newline at end of file +var _0xe605=['./smsInteraction.controller','get','isAuthenticated','index','show','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','/:id','update','delete','smsinteraction:destroy','removeTags','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x244166,_0x3eac5f){var _0x36df5f=function(_0xa4b477){while(--_0xa4b477){_0x244166['push'](_0x244166['shift']());}};_0x36df5f(++_0x3eac5f);}(_0xe605,0x92));var _0x5e60=function(_0x2bf29a,_0x22540f){_0x2bf29a=_0x2bf29a-0x0;var _0x3cf88b=_0xe605[_0x2bf29a];return _0x3cf88b;};'use strict';var multer=require(_0x5e60('0x0'));var util=require(_0x5e60('0x1'));var path=require('path');var timeout=require(_0x5e60('0x2'));var express=require(_0x5e60('0x3'));var router=express[_0x5e60('0x4')]();var fs_extra=require(_0x5e60('0x5'));var auth=require(_0x5e60('0x6'));var interaction=require(_0x5e60('0x7'));var config=require(_0x5e60('0x8'));var controller=require(_0x5e60('0x9'));router[_0x5e60('0xa')]('/',auth[_0x5e60('0xb')](),controller[_0x5e60('0xc')]);router[_0x5e60('0xa')]('/describe',auth[_0x5e60('0xb')](),controller['describe']);router['get']('/:id',auth[_0x5e60('0xb')](),controller[_0x5e60('0xd')]);router[_0x5e60('0xa')](_0x5e60('0xe'),auth[_0x5e60('0xb')](),controller[_0x5e60('0xf')]);router['get'](_0x5e60('0x10'),auth['isAuthenticated'](),controller[_0x5e60('0x11')]);router[_0x5e60('0x12')]('/',auth[_0x5e60('0xb')](),controller['create']);router[_0x5e60('0x12')](_0x5e60('0xe'),auth[_0x5e60('0xb')](),controller[_0x5e60('0x13')]);router[_0x5e60('0x12')](_0x5e60('0x14'),auth['isAuthenticated'](),interaction[_0x5e60('0x15')](_0x5e60('0x16'),_0x5e60('0x17')),controller[_0x5e60('0x18')]);router['put'](_0x5e60('0x19'),auth['isAuthenticated'](),interaction[_0x5e60('0x15')](_0x5e60('0x16'),'smsinteraction:update'),controller[_0x5e60('0x1a')]);router[_0x5e60('0x1b')](_0x5e60('0x19'),auth[_0x5e60('0xb')](),interaction['tracked'](_0x5e60('0x16'),_0x5e60('0x1c')),controller['destroy']);router[_0x5e60('0x1b')](_0x5e60('0x14'),auth[_0x5e60('0xb')](),controller[_0x5e60('0x1d')]);module[_0x5e60('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 01ca3a7..875c446 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 _0xf350=['ENUM','sequelize','BOOLEAN','DATE','STRING'];(function(_0x2d9c6a,_0x59393d){var _0xf3c918=function(_0x4f3f26){while(--_0x4f3f26){_0x2d9c6a['push'](_0x2d9c6a['shift']());}};_0xf3c918(++_0x59393d);}(_0xf350,0x105));var _0x0f35=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf350[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x0f35('0x0'));var moment=require('moment');module['exports']={'closed':{'type':Sequelize[_0x0f35('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x0f35('0x2')]},'disposition':{'type':Sequelize[_0x0f35('0x3')]},'secondDisposition':{'type':Sequelize[_0x0f35('0x3')]},'thirdDisposition':{'type':Sequelize[_0x0f35('0x3')]},'note':{'type':Sequelize[_0x0f35('0x3')]},'phone':{'type':Sequelize[_0x0f35('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x0f35('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x0f35('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x5398=['ENUM','out','moment','exports','BOOLEAN','DATE','STRING'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0x5398,0xe2));var _0x8539=function(_0x316a9c,_0x5033a0){_0x316a9c=_0x316a9c-0x0;var _0x4d5635=_0x5398[_0x316a9c];return _0x4d5635;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x8539('0x0'));module[_0x8539('0x1')]={'closed':{'type':Sequelize[_0x8539('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x8539('0x3')]},'disposition':{'type':Sequelize[_0x8539('0x4')]},'secondDisposition':{'type':Sequelize[_0x8539('0x4')]},'thirdDisposition':{'type':Sequelize[_0x8539('0x4')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x8539('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x8539('0x5')]('in',_0x8539('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x8539('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x8539('0x5')]('in',_0x8539('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 5d11cb1..fd68451 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 _0x7a7a=['contactName','t.id\x20IN\x20?','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','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','Contact.email','c.phone','Contact.phone','Contact.mobile','Contact.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','groupBy','SmsInteractionId','rows','catch','show','create','body','params','describe','addMessage','SmsMessage','ids','getMessages','hasOwnProperty','$gte','YYYY-MM-DD\x20HH:mm:ss','options','includeAll','include','addTags','setTags','omit','spread','findAll','smsInteractionTags:save','removeTags','download','server','join','root','attachments','format','transcript-%d-%s.zip','Contact','lastName','Messages','direction','secret','Account','Owner','get','mkdirSync','Sms','N.A.','createdAt','closed','closedAt','disposition','out','System','firstName','renderFile','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','log','err','unlinkSync','zip-dir','request-promise','moment','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','./smsInteraction.socket','register','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','Users','map','fullname','Tags','split','forEach','push','index','SmsInteraction','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','select','field','color','from','tools_tags','u.fullname','ui.SmsInteractionId','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','sms_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','find','unreadMessages','value','having','`\x20>\x200','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','UserId','buildExpression','some','compact','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','parse','$lte','where','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)'];(function(_0x3070ec,_0x4c4d59){var _0x39aef3=function(_0x46987f){while(--_0x46987f){_0x3070ec['push'](_0x3070ec['shift']());}};_0x39aef3(++_0x4c4d59);}(_0x7a7a,0x140));var _0xa7a7=function(_0x5a79e2,_0x319b1a){_0x5a79e2=_0x5a79e2-0x0;var _0x266c45=_0x7a7a[_0x5a79e2];return _0x266c45;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa7a7('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa7a7('0x1'));var moment=require(_0xa7a7('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa7a7('0x3'));var path=require(_0xa7a7('0x4'));var sox=require(_0xa7a7('0x5'));var csv=require('to-csv');var ejs=require(_0xa7a7('0x6'));var fs=require('fs');var fs_extra=require(_0xa7a7('0x7'));var _=require(_0xa7a7('0x8'));var squel=require('squel');var crypto=require(_0xa7a7('0x9'));var jsforce=require(_0xa7a7('0xa'));var deskjs=require(_0xa7a7('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa7a7('0xc'));var Redis=require(_0xa7a7('0xd'));var authService=require(_0xa7a7('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xa7a7('0xf'));var pdf=require(_0xa7a7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa7a7('0x11'))(_0xa7a7('0x12'));var utils=require(_0xa7a7('0x13'));var config=require(_0xa7a7('0x14'));var licenseUtil=require(_0xa7a7('0x15'));var db=require('../../mysqldb')['db'];config[_0xa7a7('0x16')]=_['defaults'](config[_0xa7a7('0x16')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa7a7('0x16')]));require(_0xa7a7('0x17'))[_0xa7a7('0x18')](socket);function respondWithStatusCode(_0x13b98c,_0x2212e3){_0x2212e3=_0x2212e3||0xcc;return function(_0x1ef89c){if(_0x1ef89c){return _0x13b98c['sendStatus'](_0x2212e3);}return _0x13b98c[_0xa7a7('0x19')](_0x2212e3)[_0xa7a7('0x1a')]();};}function respondWithResult(_0x68d2c4,_0x48246d){_0x48246d=_0x48246d||0xc8;return function(_0x854fe2){if(_0x854fe2){return _0x68d2c4['status'](_0x48246d)[_0xa7a7('0x1b')](_0x854fe2);}};}function respondWithFilteredResult(_0x3f1384,_0x533fe8){return function(_0x2c955d){if(_0x2c955d){var _0x1fb868=typeof _0x533fe8[_0xa7a7('0x1c')]===_0xa7a7('0x1d')&&typeof _0x533fe8[_0xa7a7('0x1e')]===_0xa7a7('0x1d');var _0x5a0af3=_0x2c955d[_0xa7a7('0x1f')];var _0x55cb11=_0x1fb868?0x0:_0x533fe8[_0xa7a7('0x1c')];var _0xd8be63=_0x1fb868?_0x2c955d[_0xa7a7('0x1f')]:_0x533fe8[_0xa7a7('0x1c')]+_0x533fe8[_0xa7a7('0x1e')];var _0x237032;if(_0xd8be63>=_0x5a0af3){_0xd8be63=_0x5a0af3;_0x237032=0xc8;}else{_0x237032=0xce;}_0x3f1384[_0xa7a7('0x19')](_0x237032);return _0x3f1384[_0xa7a7('0x20')]('Content-Range',_0x55cb11+'-'+_0xd8be63+'/'+_0x5a0af3)[_0xa7a7('0x1b')](_0x2c955d);}return null;};}function patchUpdates(_0xfdcfdf){return function(_0x92cb7f){try{jsonpatch[_0xa7a7('0x21')](_0x92cb7f,_0xfdcfdf,!![]);}catch(_0x1b436a){return BPromise[_0xa7a7('0x22')](_0x1b436a);}return _0x92cb7f[_0xa7a7('0x23')]();};}function saveUpdates(_0x3bd5b5,_0x3db3d8){return function(_0x903914){if(_0x903914){return _0x903914[_0xa7a7('0x24')](_0x3bd5b5)[_0xa7a7('0x25')](function(_0xe765ea){return _0xe765ea;});}return null;};}function removeEntity(_0x455454,_0xa6796){return function(_0x3a6731){if(_0x3a6731){return _0x3a6731[_0xa7a7('0x26')]()[_0xa7a7('0x25')](function(){_0x455454[_0xa7a7('0x19')](0xcc)[_0xa7a7('0x1a')]();});}};}function handleEntityNotFound(_0x140f69,_0x268493){return function(_0x315c8f){if(!_0x315c8f){_0x140f69[_0xa7a7('0x27')](0x194);}return _0x315c8f;};}function handleError(_0x12440a,_0x251ec8){_0x251ec8=_0x251ec8||0x1f4;return function(_0x3e1b91){logger[_0xa7a7('0x28')](_0x3e1b91[_0xa7a7('0x29')]);if(_0x3e1b91[_0xa7a7('0x2a')]){delete _0x3e1b91[_0xa7a7('0x2a')];}_0x12440a[_0xa7a7('0x19')](_0x251ec8)[_0xa7a7('0x2b')](_0x3e1b91);};}function getInteractionUsers(_0x101aec,_0x49cd54){return new BPromise(function(_0x3241d5,_0x9ba18a){try{if(_0x49cd54[_0x101aec['id']]){_0x101aec[_0xa7a7('0x2c')]=_[_0xa7a7('0x2d')](_0x49cd54[_0x101aec['id']],function(_0x14cb82){return{'id':_0x14cb82['id'],'fullname':_0x14cb82[_0xa7a7('0x2e')]};});}}catch(_0x5b1bc7){_0x9ba18a(_0x5b1bc7);}_0x3241d5(_0x101aec);});}function getInteractionTags(_0x4efef3,_0x195943){return new BPromise(function(_0x2a2db1,_0x100772){try{if(_0x4efef3['TagIds']){_0x4efef3[_0xa7a7('0x2f')]=[];_0x4efef3['TagIds'][_0xa7a7('0x30')](',')[_0xa7a7('0x31')](function(_0x18da9d){_0x4efef3['Tags'][_0xa7a7('0x32')](_0x195943[_0x18da9d]);});}delete _0x4efef3['TagIds'];}catch(_0x483ad7){_0x100772(_0x483ad7);}_0x2a2db1(_0x4efef3);});}function updateSmsInteraction(_0x43a631,_0xf83a51,_0x20dc9a){return new BPromise(function(_0x217ba0,_0x2a2abf){return getInteractionUsers(_0x43a631,_0x20dc9a)[_0xa7a7('0x25')](function(_0x208a14){return getInteractionTags(_0x208a14,_0xf83a51);})[_0xa7a7('0x25')](function(_0x3e53a2){_0x217ba0(_0x3e53a2);})['catch'](function(_0x2d3d63){_0x2a2abf(_0x2d3d63);});});}exports[_0xa7a7('0x33')]=function(_0x3cc234,_0x3239e8){var _0x322dc0={},_0x118684={},_0x560c9a={'count':0x0,'rows':[]};var _0x368c59=_[_0xa7a7('0x2d')](db[_0xa7a7('0x34')][_0xa7a7('0x35')],function(_0x380b9b){return{'name':_0x380b9b[_0xa7a7('0x36')],'type':_0x380b9b[_0xa7a7('0x37')]['key']};});_0x118684[_0xa7a7('0x38')]=_[_0xa7a7('0x2d')](_0x368c59,'name');_0x118684[_0xa7a7('0x39')]=_[_0xa7a7('0x3a')](_0x3cc234[_0xa7a7('0x39')]);_0x118684[_0xa7a7('0x3b')]=_[_0xa7a7('0x3c')](_0x118684[_0xa7a7('0x38')],_0x118684[_0xa7a7('0x39')]);_0x322dc0[_0xa7a7('0x3d')]=_['intersection'](_0x118684['model'],qs[_0xa7a7('0x3e')](_0x3cc234[_0xa7a7('0x39')][_0xa7a7('0x3e')]));_0x322dc0[_0xa7a7('0x3d')]=_0x322dc0[_0xa7a7('0x3d')][_0xa7a7('0x3f')]?_0x322dc0[_0xa7a7('0x3d')]:_0x118684['model'];if(!_0x3cc234[_0xa7a7('0x39')]['hasOwnProperty'](_0xa7a7('0x40'))){_0x322dc0[_0xa7a7('0x1e')]=qs[_0xa7a7('0x1e')](_0x3cc234[_0xa7a7('0x39')]['limit']);_0x322dc0[_0xa7a7('0x1c')]=qs['offset'](_0x3cc234[_0xa7a7('0x39')]['offset']);}_0x322dc0[_0xa7a7('0x41')]=qs[_0xa7a7('0x42')](_0x3cc234['query'][_0xa7a7('0x42')]);_0x322dc0['where']=qs['filters'](_[_0xa7a7('0x43')](_0x3cc234[_0xa7a7('0x39')],_0x118684['filters']),_0x368c59);var _0x535e05=[];var _0x192e18=squel[_0xa7a7('0x44')]()[_0xa7a7('0x45')]('id')[_0xa7a7('0x45')]('name')['field'](_0xa7a7('0x46'))[_0xa7a7('0x47')](_0xa7a7('0x48'));var _0x12c67e=squel[_0xa7a7('0x44')]()[_0xa7a7('0x45')]('u.id')[_0xa7a7('0x45')](_0xa7a7('0x49'))[_0xa7a7('0x45')](_0xa7a7('0x4a'))['from'](_0xa7a7('0x4b'),'ui')[_0xa7a7('0x4c')](_0xa7a7('0x4d'),'u',_0xa7a7('0x4e'));var _0x5998a0=squel[_0xa7a7('0x44')]()[_0xa7a7('0x47')](_0xa7a7('0x4f'),'i')[_0xa7a7('0x4c')](_0xa7a7('0x50'),'c',_0xa7a7('0x51'))['left_join']('users','o',_0xa7a7('0x52'))[_0xa7a7('0x4c')](_0xa7a7('0x53'),'a',_0xa7a7('0x54'))['left_join'](_0xa7a7('0x55'),'me',_0xa7a7('0x56'))[_0xa7a7('0x4c')](_0xa7a7('0x57'),'it','it.SmsInteractionId\x20=\x20i.id')[_0xa7a7('0x4c')](_0xa7a7('0x48'),'t',_0xa7a7('0x58'));var _0x56f4da=squel[_0xa7a7('0x59')]();var _0x432956=[];var _0x3bb2e1=squel[_0xa7a7('0x59')]();var _0x5753a1;if(_0x3cc234[_0xa7a7('0x39')][_0xa7a7('0x5a')]){_0x5753a1=as[_0xa7a7('0x5b')](_0x3cc234[_0xa7a7('0x39')]['search']);var _0x16ec20=_0x5753a1['sqlOperator'];for(var _0x18b352=0x0;_0x18b352<_0x5753a1[_0xa7a7('0x5c')][_0xa7a7('0x3f')];_0x18b352++){var _0x445c68=_0x5753a1[_0xa7a7('0x5c')][_0x18b352];var _0x4bdcaf='i';var _0x49ee2c=_[_0xa7a7('0x5d')](_0x368c59,['name',_0x445c68[_0xa7a7('0x45')]]);if(!_0x49ee2c){switch(_0x445c68[_0xa7a7('0x45')]){case _0xa7a7('0x5e'):if(_0x445c68[_0xa7a7('0x5f')]==0x1){_0x5998a0['having']('`'+_0x445c68['field']+'`\x20=\x200');}else{_0x5998a0[_0xa7a7('0x60')]('`'+_0x445c68[_0xa7a7('0x45')]+_0xa7a7('0x61'));}break;case'Contact':if(_0x445c68[_0xa7a7('0x62')]==='$substring'){if(_0x445c68[_0xa7a7('0x5f')][_0xa7a7('0x30')]('\x20')[_0xa7a7('0x3f')]>0x1){_0x56f4da[_0x16ec20](_0xa7a7('0x63'),qs[_0xa7a7('0x64')](_0x445c68[_0xa7a7('0x5f')]),null);}else{var _0x1665ff='%'+_0x445c68['value']+'%';_0x56f4da[_0x16ec20]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x1665ff,_0x1665ff,_0x1665ff);}}else{_0x49ee2c=_['find'](_0x368c59,[_0xa7a7('0x2a'),_0xa7a7('0x65')]);_0x445c68[_0xa7a7('0x45')]=_0xa7a7('0x65');_0xc397f4=as['buildExpression'](_0x4bdcaf,_0x49ee2c[_0xa7a7('0x37')],_0x445c68);_0x56f4da[_0x16ec20](_0xc397f4[_0xa7a7('0x66')],_0xc397f4[_0xa7a7('0x5f')][_0xa7a7('0x67')],_0xc397f4['value'][_0xa7a7('0x1a')]);}break;case _0xa7a7('0x68'):var _0x2af412=_0x445c68['value'][_0xa7a7('0x30')](',')['map'](function(_0x977dd5){return Number(_0x977dd5);});_0x2af412['forEach'](function(_0x459269){_0x3bb2e1['or'](_0xa7a7('0x69'),'%,'+_0x459269+',%');});_0x432956=_[_0xa7a7('0x6a')](_0x432956,_0x2af412);break;case _0xa7a7('0x6b'):if(_0x445c68[_0xa7a7('0x62')]===_0xa7a7('0x6c')){_0x56f4da[_0x16ec20]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x445c68[_0xa7a7('0x5f')]+'%',null);}else{_0x49ee2c=_[_0xa7a7('0x5d')](_0x368c59,[_0xa7a7('0x2a'),_0xa7a7('0x6d')]);_0x445c68['field']='UserId';_0xc397f4=as[_0xa7a7('0x6e')](_0x4bdcaf,_0x49ee2c[_0xa7a7('0x37')],_0x445c68);_0x56f4da[_0x16ec20](_0xc397f4[_0xa7a7('0x66')],_0xc397f4[_0xa7a7('0x5f')][_0xa7a7('0x67')],_0xc397f4[_0xa7a7('0x5f')][_0xa7a7('0x1a')]);}break;case'body':_0xc397f4=as['buildExpression']('me',null,_0x445c68);_0x56f4da[_0x16ec20](_0xc397f4['text'],_0xc397f4['value'][_0xa7a7('0x67')],_0xc397f4[_0xa7a7('0x5f')][_0xa7a7('0x1a')]);break;}}else{var _0xc397f4=as[_0xa7a7('0x6e')](_0x4bdcaf,_0x49ee2c['type'],_0x445c68);_0x56f4da[_0x16ec20](_0xc397f4[_0xa7a7('0x66')],_0xc397f4[_0xa7a7('0x5f')][_0xa7a7('0x67')],_0xc397f4['value'][_0xa7a7('0x1a')]);}}}else{var _0x2e8784=_(_0x3cc234[_0xa7a7('0x39')])[_0xa7a7('0x3a')]()[_0xa7a7('0x2d')](function(_0x584d72){return _[_0xa7a7('0x6f')](_0x368c59,[_0xa7a7('0x2a'),_0x584d72])?_0x584d72:undefined;})[_0xa7a7('0x70')]()[_0xa7a7('0x5f')]();if(!_[_0xa7a7('0x71')](_0x2e8784)){_0x2e8784[_0xa7a7('0x31')](function(_0xed56b7){if(_0xed56b7===_0xa7a7('0x72')){_0x5998a0['where'](_0xa7a7('0x73'),[][_0xa7a7('0x74')](_0x3cc234[_0xa7a7('0x39')][_0xed56b7]));}else if(_0xed56b7==='createdAt'){var _0x57371f=JSON[_0xa7a7('0x75')](_0x3cc234[_0xa7a7('0x39')][_0xed56b7])['$gte'];var _0x5d4129=JSON[_0xa7a7('0x75')](_0x3cc234[_0xa7a7('0x39')][_0xed56b7])[_0xa7a7('0x76')];_0x5998a0[_0xa7a7('0x77')](_0xa7a7('0x78'),_0x57371f,_0x5d4129);}else{if(_0x3cc234[_0xa7a7('0x39')][_0xed56b7]===_0xa7a7('0x79')){_0x5998a0[_0xa7a7('0x77')]('i.'+_0xed56b7+_0xa7a7('0x7a'));}else{_0x5998a0[_0xa7a7('0x77')]('i.'+_0xed56b7+_0xa7a7('0x7b'),_0x3cc234[_0xa7a7('0x39')][_0xed56b7]);}}});}if(_0x3cc234['query'][_0xa7a7('0x7c')]){if(_0x3cc234['query'][_0xa7a7('0x7c')]==0x1){_0x5998a0[_0xa7a7('0x60')](_0xa7a7('0x7d'));}else{_0x5998a0['having'](_0xa7a7('0x7e'));}}if(_0x3cc234[_0xa7a7('0x39')][_0xa7a7('0x7f')]){_0x432956=_[_0xa7a7('0x80')](_0x3cc234[_0xa7a7('0x39')][_0xa7a7('0x7f')])?_0x3cc234[_0xa7a7('0x39')][_0xa7a7('0x7f')]:new Array(_0x3cc234['query'][_0xa7a7('0x7f')]);_0x432956['forEach'](function(_0x446e46){_0x3bb2e1['or'](_0xa7a7('0x69'),'%,'+_0x446e46+',%');});}if(_0x3cc234[_0xa7a7('0x39')][_0xa7a7('0x81')]){var _0xcaa26a=_0x3cc234[_0xa7a7('0x39')][_0xa7a7('0x81')][_0xa7a7('0x82')]('\x5c','\x5c\x5c')[_0xa7a7('0x82')](/'/g,'\x27\x27');if(qs['isNumeric'](_0xcaa26a)){_0x56f4da['or'](_0xa7a7('0x83'),_0xcaa26a+'%')['or'](_0xa7a7('0x84'),_0xcaa26a+'%');}else{_0x56f4da['or'](_0xa7a7('0x85'),qs[_0xa7a7('0x64')](_0xcaa26a))['or'](_0xa7a7('0x86'),_0xcaa26a+'%');}}}_0x5998a0[_0xa7a7('0x77')](_0x56f4da);_0x5998a0[_0xa7a7('0x87')](_0xa7a7('0x88'));var _0x2ae19f={'type':db[_0xa7a7('0x89')][_0xa7a7('0x8a')][_0xa7a7('0x8b')],'raw':!![]};var _0x3ceeaa=_0x5998a0[_0xa7a7('0x8c')]();_0x3ceeaa[_0xa7a7('0x45')](_0xa7a7('0x88'));_0x3ceeaa[_0xa7a7('0x45')](_0xa7a7('0x8d'),'unreadMessages');if(_0x322dc0['order']){_0x322dc0[_0xa7a7('0x41')]['forEach'](function(_0x2d483d){var _0x570412=_0x2d483d[0x0]===_0xa7a7('0x8e')?_0x2d483d[0x0]:'i.'+_0x2d483d[0x0];_0x5998a0[_0xa7a7('0x41')](_0x570412,_0x2d483d[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x432956)){_0x5998a0[_0xa7a7('0x60')](_0x3bb2e1);_0x3ceeaa[_0xa7a7('0x77')](_0xa7a7('0x8f'),_0x432956);}BPromise[_0xa7a7('0x90')]()[_0xa7a7('0x25')](function(){if(!_0x5753a1){if(_0x3cc234[_0xa7a7('0x39')]['SmsAccountId'])return;_0x3ceeaa[_0xa7a7('0x77')]('i.SmsAccountId\x20IS\x20NOT\x20NULL');_0x5998a0[_0xa7a7('0x77')](_0xa7a7('0x91'));return;}if(_0x3cc234[_0xa7a7('0x92')][_0xa7a7('0x93')]!==_0xa7a7('0x94'))return;return _0x3cc234['user']['getSmsAccounts']({'attributes':['id'],'raw':!![]})['then'](function(_0x46f369){if(_[_0xa7a7('0x71')](_0x46f369)){_0x3ceeaa['where'](_0xa7a7('0x95'));_0x5998a0[_0xa7a7('0x77')]('i.SmsAccountId\x20IS\x20NULL');}else{_0x3ceeaa[_0xa7a7('0x77')](_0xa7a7('0x73'),_[_0xa7a7('0x2d')](_0x46f369,'id'));_0x5998a0[_0xa7a7('0x77')](_0xa7a7('0x73'),_['map'](_0x46f369,'id'));}});})[_0xa7a7('0x25')](function(){if(_0x3cc234[_0xa7a7('0x92')][_0xa7a7('0x93')]===_0xa7a7('0x94')&&!_0x5753a1&&!_0x3cc234[_0xa7a7('0x39')][_0xa7a7('0x72')])return[];return db[_0xa7a7('0x96')]['query'](_0x3ceeaa[_0xa7a7('0x97')](),_0x2ae19f);})[_0xa7a7('0x25')](function(_0x25d141){_0x560c9a[_0xa7a7('0x1f')]=_0x25d141[_0xa7a7('0x3f')];if(_0x560c9a['count']===0x0)return[];return db['sequelize'][_0xa7a7('0x39')](_0x192e18[_0xa7a7('0x97')](),_0x2ae19f)[_0xa7a7('0x25')](function(_0x319dfc){_0x535e05=_['keyBy'](_0x319dfc,'id');_0x2ae19f=_[_0xa7a7('0x98')](_0x2ae19f,{'model':db['SmsInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3cc234[_0xa7a7('0x39')][_0xa7a7('0x3e')]){_0x322dc0[_0xa7a7('0x3d')][_0xa7a7('0x31')](function(_0x189193){_0x5998a0[_0xa7a7('0x45')]('i.'+_0x189193);});}else{_0x5998a0[_0xa7a7('0x45')](_0xa7a7('0x8d'),_0xa7a7('0x5e'));_0x5998a0[_0xa7a7('0x45')](_0xa7a7('0x99'),'Account.key');_0x5998a0[_0xa7a7('0x45')](_0xa7a7('0x9a'),_0xa7a7('0x9b'));_0x5998a0[_0xa7a7('0x45')](_0xa7a7('0x9c'),_0xa7a7('0x8e'));_0x5998a0['field'](_0xa7a7('0x9d'));_0x5998a0[_0xa7a7('0x45')](_0xa7a7('0x9e'),'Contact.firstName');_0x5998a0[_0xa7a7('0x45')](_0xa7a7('0x9f'),_0xa7a7('0xa0'));_0x5998a0[_0xa7a7('0x45')](_0xa7a7('0xa1'),_0xa7a7('0xa2'));_0x5998a0[_0xa7a7('0x45')](_0xa7a7('0xa3'),_0xa7a7('0xa4'));_0x5998a0[_0xa7a7('0x45')]('c.mobile',_0xa7a7('0xa5'));_0x5998a0[_0xa7a7('0x45')]('c.fax',_0xa7a7('0xa6'));_0x5998a0[_0xa7a7('0x45')]('o.fullname',_0xa7a7('0xa7'));_0x5998a0[_0xa7a7('0x45')](_0xa7a7('0xa8'),_0xa7a7('0xa9'));_0x5998a0[_0xa7a7('0x45')](_0xa7a7('0xaa'),_0xa7a7('0xab'));}if(_0x322dc0[_0xa7a7('0x1e')])_0x5998a0['limit'](_0x322dc0[_0xa7a7('0x1e')]);if(_0x322dc0[_0xa7a7('0x1c')])_0x5998a0[_0xa7a7('0x1c')](_0x322dc0[_0xa7a7('0x1c')]);return db[_0xa7a7('0x96')][_0xa7a7('0x39')](_0x5998a0[_0xa7a7('0x97')](),_0x2ae19f);})[_0xa7a7('0x25')](function(_0x584b91){if(_0x584b91[_0xa7a7('0x3f')]>0x0)_0x12c67e['where']('ui.SmsInteractionId\x20IN\x20?',_['map'](_0x584b91,'id'));return db[_0xa7a7('0x96')][_0xa7a7('0x39')](_0x12c67e[_0xa7a7('0x97')](),_0x2ae19f)['then'](function(_0x13469b){var _0x472092=_[_0xa7a7('0xac')](_0x13469b,_0xa7a7('0xad'));var _0x12135c=[];_0x584b91[_0xa7a7('0x31')](function(_0x3063e1){_0x12135c['push'](updateSmsInteraction(_0x3063e1,_0x535e05,_0x472092));});return BPromise['all'](_0x12135c);});});})[_0xa7a7('0x25')](function(_0x524ddb){_0x560c9a[_0xa7a7('0xae')]=_0x524ddb;return _0x560c9a;})[_0xa7a7('0x25')](respondWithFilteredResult(_0x3239e8,_0x322dc0))[_0xa7a7('0xaf')](handleError(_0x3239e8,null));};exports[_0xa7a7('0xb0')]=function(_0x21cb14,_0x23a0f0){var _0x284e42={'raw':![],'where':{'id':_0x21cb14['params']['id']}},_0x36045e={};_0x36045e[_0xa7a7('0x38')]=_[_0xa7a7('0x3a')](db['SmsInteraction'][_0xa7a7('0x35')]);_0x36045e[_0xa7a7('0x39')]=_[_0xa7a7('0x3a')](_0x21cb14[_0xa7a7('0x39')]);_0x36045e[_0xa7a7('0x3b')]=_['intersection'](_0x36045e[_0xa7a7('0x38')],_0x36045e[_0xa7a7('0x39')]);_0x284e42['attributes']=_[_0xa7a7('0x3c')](_0x36045e[_0xa7a7('0x38')],qs[_0xa7a7('0x3e')](_0x21cb14[_0xa7a7('0x39')]['fields']));_0x284e42[_0xa7a7('0x3d')]=_0x284e42[_0xa7a7('0x3d')][_0xa7a7('0x3f')]?_0x284e42[_0xa7a7('0x3d')]:_0x36045e[_0xa7a7('0x38')];if(_0x21cb14['query']['includeAll']){_0x284e42['include']=[{'all':!![]}];}_0x284e42=_[_0xa7a7('0x98')]({},_0x284e42,_0x21cb14['options']);return db[_0xa7a7('0x34')][_0xa7a7('0x5d')](_0x284e42)[_0xa7a7('0x25')](handleEntityNotFound(_0x23a0f0,null))[_0xa7a7('0x25')](respondWithResult(_0x23a0f0,null))['catch'](handleError(_0x23a0f0,null));};exports[_0xa7a7('0xb1')]=function(_0x45325b,_0x823d4f){return db[_0xa7a7('0x34')][_0xa7a7('0xb1')](_0x45325b[_0xa7a7('0xb2')],{})['then'](respondWithResult(_0x823d4f,0xc9))[_0xa7a7('0xaf')](handleError(_0x823d4f,null));};exports[_0xa7a7('0x24')]=function(_0x217b9a,_0x278142){if(_0x217b9a[_0xa7a7('0xb2')]['id']){delete _0x217b9a[_0xa7a7('0xb2')]['id'];}return db[_0xa7a7('0x34')][_0xa7a7('0x5d')]({'where':{'id':_0x217b9a[_0xa7a7('0xb3')]['id']}})[_0xa7a7('0x25')](handleEntityNotFound(_0x278142,null))[_0xa7a7('0x25')](saveUpdates(_0x217b9a[_0xa7a7('0xb2')],null))[_0xa7a7('0x25')](respondWithResult(_0x278142,null))[_0xa7a7('0xaf')](handleError(_0x278142,null));};exports['destroy']=function(_0x3aeba8,_0x4bd9d3){return db[_0xa7a7('0x34')][_0xa7a7('0x5d')]({'where':{'id':_0x3aeba8[_0xa7a7('0xb3')]['id']}})['then'](handleEntityNotFound(_0x4bd9d3,null))[_0xa7a7('0x25')](removeEntity(_0x4bd9d3,null))[_0xa7a7('0xaf')](handleError(_0x4bd9d3,null));};exports[_0xa7a7('0xb4')]=function(_0x34c2cf,_0x1aebaf){return db[_0xa7a7('0x34')][_0xa7a7('0xb4')]()[_0xa7a7('0x25')](respondWithResult(_0x1aebaf,null))[_0xa7a7('0xaf')](handleError(_0x1aebaf,null));};exports[_0xa7a7('0xb5')]=function(_0x190ba9,_0x3a04bf,_0x228651){return db[_0xa7a7('0xb6')][_0xa7a7('0x5d')]({'where':{'id':_0x190ba9['params']['id']}})['then'](handleEntityNotFound(_0x3a04bf,null))[_0xa7a7('0x25')](function(_0x1e1325){if(_0x1e1325){return _0x1e1325[_0xa7a7('0xb5')](_0x190ba9[_0xa7a7('0xb2')][_0xa7a7('0xb7')],_['omit'](_0x190ba9[_0xa7a7('0xb2')],['ids','id'])||{});}})[_0xa7a7('0x25')](respondWithResult(_0x3a04bf,null))[_0xa7a7('0xaf')](handleError(_0x3a04bf,null));};exports[_0xa7a7('0xb8')]=function(_0x4ec4a0,_0x144202,_0x2c062d){var _0x3a1cf9={'raw':![],'where':{}};var _0x42e1fd={};var _0x40ca36={'count':0x0,'rows':[]};return db[_0xa7a7('0x34')]['findOne']({'where':{'id':_0x4ec4a0[_0xa7a7('0xb3')]['id']}})[_0xa7a7('0x25')](handleEntityNotFound(_0x144202,null))[_0xa7a7('0x25')](function(_0x28a076){if(_0x28a076){_0x42e1fd[_0xa7a7('0x38')]=_[_0xa7a7('0x3a')](db[_0xa7a7('0xb6')]['rawAttributes']);_0x42e1fd[_0xa7a7('0x39')]=_[_0xa7a7('0x3a')](_0x4ec4a0[_0xa7a7('0x39')]);_0x42e1fd[_0xa7a7('0x3b')]=_[_0xa7a7('0x3c')](_0x42e1fd[_0xa7a7('0x38')],_0x42e1fd[_0xa7a7('0x39')]);_0x3a1cf9[_0xa7a7('0x3d')]=_[_0xa7a7('0x3c')](_0x42e1fd[_0xa7a7('0x38')],qs['fields'](_0x4ec4a0['query'][_0xa7a7('0x3e')]));_0x3a1cf9[_0xa7a7('0x3d')]=_0x3a1cf9[_0xa7a7('0x3d')][_0xa7a7('0x3f')]?_0x3a1cf9[_0xa7a7('0x3d')]:_0x42e1fd[_0xa7a7('0x38')];if(!_0x4ec4a0[_0xa7a7('0x39')][_0xa7a7('0xb9')](_0xa7a7('0x40'))){_0x3a1cf9['limit']=qs[_0xa7a7('0x1e')](_0x4ec4a0['query'][_0xa7a7('0x1e')]);_0x3a1cf9['offset']=qs['offset'](_0x4ec4a0[_0xa7a7('0x39')][_0xa7a7('0x1c')]);}_0x3a1cf9[_0xa7a7('0x41')]=qs[_0xa7a7('0x42')](_0x4ec4a0[_0xa7a7('0x39')][_0xa7a7('0x42')]);_0x3a1cf9[_0xa7a7('0x77')]=qs[_0xa7a7('0x3b')](_[_0xa7a7('0x43')](_0x4ec4a0[_0xa7a7('0x39')],_0x42e1fd[_0xa7a7('0x3b')]));_0x3a1cf9[_0xa7a7('0x77')][_0xa7a7('0xad')]=_0x28a076['id'];if(_0x4ec4a0[_0xa7a7('0x39')][_0xa7a7('0x81')]){_0x3a1cf9[_0xa7a7('0x77')]=_[_0xa7a7('0x98')](_0x3a1cf9[_0xa7a7('0x77')],{'$or':_[_0xa7a7('0x2d')](_0x3a1cf9[_0xa7a7('0x3d')],function(_0x29a99e){var _0x22fb20={};_0x22fb20[_0x29a99e]={'$like':'%'+_0x4ec4a0['query'][_0xa7a7('0x81')]+'%'};return _0x22fb20;})});}if(_0x4ec4a0[_0xa7a7('0x39')][_0xa7a7('0xba')]){var _0x24c204=_0x4ec4a0['query']['$gte'][_0xa7a7('0x30')](',');var _0x235daa={};_0x235daa[_0x24c204[0x0]]={'$gte':moment(_0x24c204[0x1])['format'](_0xa7a7('0xbb'))};_0x3a1cf9[_0xa7a7('0x77')]=_['merge'](_0x3a1cf9[_0xa7a7('0x77')],_0x235daa);}_0x3a1cf9=_[_0xa7a7('0x98')]({},_0x3a1cf9,_0x4ec4a0[_0xa7a7('0xbc')]);return db[_0xa7a7('0xb6')][_0xa7a7('0x1f')]({'where':_0x3a1cf9[_0xa7a7('0x77')]})[_0xa7a7('0x25')](function(_0x1ccb94){_0x40ca36['count']=_0x1ccb94;if(_0x4ec4a0[_0xa7a7('0x39')][_0xa7a7('0xbd')]){_0x3a1cf9[_0xa7a7('0xbe')]=[{'all':!![]}];}return db[_0xa7a7('0xb6')]['findAll'](_0x3a1cf9);})[_0xa7a7('0x25')](function(_0x2cf814){_0x40ca36[_0xa7a7('0xae')]=_0x2cf814;return _0x40ca36;});}})['then'](respondWithFilteredResult(_0x144202,_0x3a1cf9))[_0xa7a7('0xaf')](handleError(_0x144202,null));};exports[_0xa7a7('0xbf')]=function(_0x4ba932,_0x21628c,_0x38ec93){return db[_0xa7a7('0x34')][_0xa7a7('0x5d')]({'where':{'id':_0x4ba932[_0xa7a7('0xb3')]['id']}})[_0xa7a7('0x25')](handleEntityNotFound(_0x21628c,null))[_0xa7a7('0x25')](function(_0x4a3aa5){if(_0x4a3aa5){return _0x4a3aa5[_0xa7a7('0xc0')](_0x4ba932[_0xa7a7('0xb2')][_0xa7a7('0xb7')],_[_0xa7a7('0xc1')](_0x4ba932['body'],[_0xa7a7('0xb7'),'id'])||{})[_0xa7a7('0xc2')](function(){return db[_0xa7a7('0x68')][_0xa7a7('0xc3')]({'attributes':['id',_0xa7a7('0x2a'),_0xa7a7('0x46')],'where':{'id':_0x4ba932[_0xa7a7('0xb2')]['ids']}});})['then'](function(_0x3b7c83){socket['emit'](_0xa7a7('0xc4'),{'id':Number(_0x4ba932['params']['id']),'tags':_0x3b7c83||[]});return{'id':Number(_0x4ba932[_0xa7a7('0xb3')]['id']),'tags':_0x3b7c83||[]};});}})[_0xa7a7('0x25')](respondWithResult(_0x21628c,null))['catch'](handleError(_0x21628c,null));};exports[_0xa7a7('0xc5')]=function(_0x6db9c8,_0x36d002,_0x2c44c6){return db[_0xa7a7('0x34')][_0xa7a7('0x5d')]({'where':{'id':_0x6db9c8[_0xa7a7('0xb3')]['id']}})[_0xa7a7('0x25')](handleEntityNotFound(_0x36d002,null))[_0xa7a7('0x25')](function(_0x996ff8){if(_0x996ff8){return _0x996ff8['removeTags'](_0x6db9c8[_0xa7a7('0x39')][_0xa7a7('0xb7')]);}})['then'](respondWithStatusCode(_0x36d002,null))[_0xa7a7('0xaf')](handleError(_0x36d002,null));};exports[_0xa7a7('0xc6')]=function(_0x2b4654,_0x38a96f){var _0x310e46=moment()['unix']()[_0xa7a7('0x97')]();var _0x1716ac=path['join'](config['root'],_0xa7a7('0xc7'),'files','tmp');var _0x3822a0=path[_0xa7a7('0xc8')](config[_0xa7a7('0xc9')],_0xa7a7('0xc7'),'files',_0xa7a7('0xca'));var _0x3a2111=path[_0xa7a7('0xc8')](_0x1716ac,_0x310e46);var _0x4f7736=util[_0xa7a7('0xcb')](_0xa7a7('0xcc'),_0x2b4654[_0xa7a7('0xb3')]['id'],_0x310e46);var _0x300575=path[_0xa7a7('0xc8')](_0x1716ac,_0x4f7736);var _0x27594e=[];_0x27594e[_0xa7a7('0x32')]({'model':db[_0xa7a7('0x6b')],'as':_0xa7a7('0x6b'),'attributes':['id','fullname'],'raw':!![]});_0x27594e['push']({'model':db['CmContact'],'as':_0xa7a7('0xcd'),'attributes':['id','firstName',_0xa7a7('0xce')],'raw':!![]});var _0xa7bfeb=[{'model':db[_0xa7a7('0xb6')],'as':_0xa7a7('0xcf'),'attributes':['id','body','createdAt',_0xa7a7('0xd0'),_0xa7a7('0xd1'),'read'],'include':_0x27594e}];_0xa7bfeb[_0xa7a7('0x32')]({'model':db['SmsAccount'],'as':_0xa7a7('0xd2'),'attributes':['id',_0xa7a7('0x2a')]});_0xa7bfeb[_0xa7a7('0x32')]({'model':db[_0xa7a7('0x6b')],'as':_0xa7a7('0xd3'),'attributes':['id','fullname']});return db[_0xa7a7('0x34')][_0xa7a7('0x5d')]({'where':{'id':_0x2b4654[_0xa7a7('0xb3')]['id']},'include':_0xa7bfeb})['then'](handleEntityNotFound(_0x38a96f,null))[_0xa7a7('0x25')](function(_0x300877){if(_0x300877){var _0x5078f2=_0x300877[_0xa7a7('0xd4')]({'plain':!![]});fs[_0xa7a7('0xd5')](_0x3a2111);var _0x36f7ef={'channel':_0xa7a7('0xd6'),'account':_0x5078f2['Account']['name'],'agent':_0x5078f2['Owner']?_0x5078f2[_0xa7a7('0xd3')]['fullname']:_0xa7a7('0xd7'),'createdAt':moment(_0x5078f2[_0xa7a7('0xd8')])[_0xa7a7('0xcb')](_0xa7a7('0xbb'))['toString'](),'closedAt':_0x5078f2[_0xa7a7('0xd9')]?moment(_0x5078f2[_0xa7a7('0xda')])[_0xa7a7('0xcb')](_0xa7a7('0xbb'))['toString']():'','disposition':_0x5078f2[_0xa7a7('0xdb')],'messages':_(_0x5078f2[_0xa7a7('0xcf')])['filter']({'secret':![]})[_0xa7a7('0x2d')](function(_0x10e726){return{'date':moment(_0x10e726['createdAt'])[_0xa7a7('0xcb')](_0xa7a7('0xbb'))[_0xa7a7('0x97')](),'sender':_0x10e726[_0xa7a7('0xd0')]===_0xa7a7('0xdc')?_0x10e726['User']?_0x10e726[_0xa7a7('0x6b')][_0xa7a7('0x2e')]:_0xa7a7('0xdd'):_0x10e726['Contact'][_0xa7a7('0xde')]+(_0x10e726[_0xa7a7('0xcd')][_0xa7a7('0xce')]?'\x20'+_0x10e726[_0xa7a7('0xcd')][_0xa7a7('0xce')]:''),'body':_0x10e726['body'],'direction':_0x10e726[_0xa7a7('0xd0')]===_0xa7a7('0xdc')?'A':'C','secret':_0x10e726[_0xa7a7('0xd1')],'read':_0x10e726[_0xa7a7('0x7c')]};})[_0xa7a7('0x5f')]()};return ejs[_0xa7a7('0xdf')](path['join'](config['root'],_0xa7a7('0xc7'),_0xa7a7('0xe0'),_0xa7a7('0xe1')),{'interaction':_0x36f7ef})['then'](function(_0x444a00){var _0x124db9=path[_0xa7a7('0xc8')](_0x3a2111,_0xa7a7('0xe2')+_0x5078f2['id']+'-'+_0x310e46+'.pdf');var _0x4262f8={'path':_0x124db9,'channel':_0xa7a7('0xd6'),'interactionId':_0x5078f2['id']};return pdf[_0xa7a7('0xe3')](_0x444a00,_0x4262f8);})[_0xa7a7('0x25')](function(){return new BPromise(function(_0x50fef7,_0xf7fc8e){zipdir(_0x3a2111,{'saveTo':_0x300575},function(_0x435ebe,_0x39c888){if(_0x435ebe)return _0xf7fc8e(_0x435ebe);return _0x50fef7(_0x39c888);});})[_0xa7a7('0x25')](function(){return new BPromise(function(_0x49e685,_0x13867f){rimraf(_0x3a2111,function(_0x1d6c5b){if(_0x1d6c5b)_0x13867f(_0x1d6c5b);return _0x49e685();});});})[_0xa7a7('0x25')](function(){return _0x38a96f['download'](_0x300575,_0x4f7736,function(_0x28afb8){if(_0x28afb8){console[_0xa7a7('0xe4')](_0xa7a7('0xe5'),_0x28afb8);}else{fs[_0xa7a7('0xe6')](_0x300575);}});});});}else{return _0x38a96f[_0xa7a7('0x27')](0xc8);}})['catch'](handleError(_0x38a96f,null));}; \ No newline at end of file +var _0x64b7=['buildExpression','type','start','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','text','body','some','compact','isEmpty','concat','createdAt','parse','$gte','$lte','null','\x20IS\x20NULL','read','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','DESC','t.id\x20IN\x20?','SmsAccountId','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','i.SmsAccountId\x20IN\x20?','sequelize','toString','keyBy','merge','SmsInteraction','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.*','c.firstName','c.lastName','Contact.lastName','c.email','c.mobile','Contact.mobile','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','SmsInteractionId','rows','catch','show','params','create','addMessage','SmsMessage','omit','ids','getMessages','findOne','pick','format','options','includeAll','include','findAll','setTags','spread','Tag','emit','smsInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','User','fullname','CmContact','firstName','lastName','Messages','SmsAccount','Account','Owner','get','mkdirSync','Sms','N.A.','YYYY-MM-DD\x20HH:mm:ss','closed','disposition','System','views','downloadInteraction.ejs','createPdfFromHTML','log','err','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','destroy','then','end','error','stack','name','send','Users','TagIds','Tags','split','push','map','rawAttributes','fieldName','model','keys','query','intersection','attributes','fields','nolimit','order','sort','where','filters','select','field','color','from','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','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','tools_tags','expr','search','parseSearch','sqlOperator','conditions','length','value','having','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'];(function(_0x42cc1f,_0xe9eb20){var _0x175df5=function(_0x2f3e22){while(--_0x2f3e22){_0x42cc1f['push'](_0x42cc1f['shift']());}};_0x175df5(++_0xe9eb20);}(_0x64b7,0x78));var _0x764b=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x64b7[_0x397e5f];return _0x5302b8;};'use strict';var emlformat=require(_0x764b('0x0'));var rimraf=require(_0x764b('0x1'));var zipdir=require(_0x764b('0x2'));var jsonpatch=require(_0x764b('0x3'));var rp=require(_0x764b('0x4'));var moment=require('moment');var BPromise=require(_0x764b('0x5'));var Mustache=require(_0x764b('0x6'));var util=require(_0x764b('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x764b('0x8'));var ejs=require(_0x764b('0x9'));var fs=require('fs');var fs_extra=require(_0x764b('0xa'));var _=require(_0x764b('0xb'));var squel=require(_0x764b('0xc'));var crypto=require(_0x764b('0xd'));var jsforce=require(_0x764b('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x764b('0xf'));var Papa=require(_0x764b('0x10'));var Redis=require(_0x764b('0x11'));var authService=require(_0x764b('0x12'));var qs=require(_0x764b('0x13'));var as=require(_0x764b('0x14'));var pdf=require('../../components/export/pdf');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x764b('0x15'));var utils=require('../../config/utils');var config=require(_0x764b('0x16'));var licenseUtil=require(_0x764b('0x17'));var db=require(_0x764b('0x18'))['db'];config[_0x764b('0x19')]=_[_0x764b('0x1a')](config['redis'],{'host':_0x764b('0x1b'),'port':0x18eb});var socket=require(_0x764b('0x1c'))(new Redis(config[_0x764b('0x19')]));require('./smsInteraction.socket')['register'](socket);function respondWithStatusCode(_0x7d064e,_0x1c9217){_0x1c9217=_0x1c9217||0xcc;return function(_0x35e4e3){if(_0x35e4e3){return _0x7d064e[_0x764b('0x1d')](_0x1c9217);}return _0x7d064e[_0x764b('0x1e')](_0x1c9217)['end']();};}function respondWithResult(_0x3253cb,_0x50cfcc){_0x50cfcc=_0x50cfcc||0xc8;return function(_0x44b2fd){if(_0x44b2fd){return _0x3253cb['status'](_0x50cfcc)['json'](_0x44b2fd);}};}function respondWithFilteredResult(_0x416265,_0xd9bb40){return function(_0x28b6f2){if(_0x28b6f2){var _0x3a1e3f=typeof _0xd9bb40[_0x764b('0x1f')]===_0x764b('0x20')&&typeof _0xd9bb40[_0x764b('0x21')]==='undefined';var _0x23f5cb=_0x28b6f2[_0x764b('0x22')];var _0xe8fdb8=_0x3a1e3f?0x0:_0xd9bb40[_0x764b('0x1f')];var _0x141eda=_0x3a1e3f?_0x28b6f2[_0x764b('0x22')]:_0xd9bb40[_0x764b('0x1f')]+_0xd9bb40['limit'];var _0x20b994;if(_0x141eda>=_0x23f5cb){_0x141eda=_0x23f5cb;_0x20b994=0xc8;}else{_0x20b994=0xce;}_0x416265['status'](_0x20b994);return _0x416265['set'](_0x764b('0x23'),_0xe8fdb8+'-'+_0x141eda+'/'+_0x23f5cb)[_0x764b('0x24')](_0x28b6f2);}return null;};}function patchUpdates(_0x5bb323){return function(_0x5c22fd){try{jsonpatch[_0x764b('0x25')](_0x5c22fd,_0x5bb323,!![]);}catch(_0xd3811d){return BPromise[_0x764b('0x26')](_0xd3811d);}return _0x5c22fd[_0x764b('0x27')]();};}function saveUpdates(_0x575803,_0x1a54ef){return function(_0x871be){if(_0x871be){return _0x871be[_0x764b('0x28')](_0x575803)['then'](function(_0x387adb){return _0x387adb;});}return null;};}function removeEntity(_0x504195,_0x596914){return function(_0x3716d0){if(_0x3716d0){return _0x3716d0[_0x764b('0x29')]()[_0x764b('0x2a')](function(){_0x504195['status'](0xcc)[_0x764b('0x2b')]();});}};}function handleEntityNotFound(_0x35d1f0,_0x1b2f17){return function(_0x21a9ad){if(!_0x21a9ad){_0x35d1f0[_0x764b('0x1d')](0x194);}return _0x21a9ad;};}function handleError(_0x422c94,_0x4dc006){_0x4dc006=_0x4dc006||0x1f4;return function(_0x3c125e){logger[_0x764b('0x2c')](_0x3c125e[_0x764b('0x2d')]);if(_0x3c125e['name']){delete _0x3c125e[_0x764b('0x2e')];}_0x422c94[_0x764b('0x1e')](_0x4dc006)[_0x764b('0x2f')](_0x3c125e);};}function getInteractionUsers(_0x42de9c,_0x4251e9){return new BPromise(function(_0x5106a2,_0x30fee8){try{if(_0x4251e9[_0x42de9c['id']]){_0x42de9c[_0x764b('0x30')]=_['map'](_0x4251e9[_0x42de9c['id']],function(_0x1e7fe1){return{'id':_0x1e7fe1['id'],'fullname':_0x1e7fe1['fullname']};});}}catch(_0x55a12b){_0x30fee8(_0x55a12b);}_0x5106a2(_0x42de9c);});}function getInteractionTags(_0x16f5f4,_0x50ac3c){return new BPromise(function(_0x2cb65c,_0xffafcd){try{if(_0x16f5f4[_0x764b('0x31')]){_0x16f5f4[_0x764b('0x32')]=[];_0x16f5f4[_0x764b('0x31')][_0x764b('0x33')](',')['forEach'](function(_0x51b522){_0x16f5f4[_0x764b('0x32')][_0x764b('0x34')](_0x50ac3c[_0x51b522]);});}delete _0x16f5f4[_0x764b('0x31')];}catch(_0x4dc9fc){_0xffafcd(_0x4dc9fc);}_0x2cb65c(_0x16f5f4);});}function updateSmsInteraction(_0x1cc061,_0x1185e4,_0x79ec1e){return new BPromise(function(_0x11465c,_0x2a42be){return getInteractionUsers(_0x1cc061,_0x79ec1e)[_0x764b('0x2a')](function(_0x5d928e){return getInteractionTags(_0x5d928e,_0x1185e4);})['then'](function(_0x23ff29){_0x11465c(_0x23ff29);})['catch'](function(_0x2b4c48){_0x2a42be(_0x2b4c48);});});}exports['index']=function(_0x474c08,_0x53e0da){var _0x54fdc3={},_0x4b5d28={},_0x2147a2={'count':0x0,'rows':[]};var _0x2349d8=_[_0x764b('0x35')](db['SmsInteraction'][_0x764b('0x36')],function(_0x3faead){return{'name':_0x3faead[_0x764b('0x37')],'type':_0x3faead['type']['key']};});_0x4b5d28[_0x764b('0x38')]=_[_0x764b('0x35')](_0x2349d8,_0x764b('0x2e'));_0x4b5d28['query']=_[_0x764b('0x39')](_0x474c08[_0x764b('0x3a')]);_0x4b5d28['filters']=_[_0x764b('0x3b')](_0x4b5d28['model'],_0x4b5d28[_0x764b('0x3a')]);_0x54fdc3[_0x764b('0x3c')]=_['intersection'](_0x4b5d28[_0x764b('0x38')],qs[_0x764b('0x3d')](_0x474c08['query'][_0x764b('0x3d')]));_0x54fdc3[_0x764b('0x3c')]=_0x54fdc3['attributes']['length']?_0x54fdc3[_0x764b('0x3c')]:_0x4b5d28[_0x764b('0x38')];if(!_0x474c08[_0x764b('0x3a')]['hasOwnProperty'](_0x764b('0x3e'))){_0x54fdc3[_0x764b('0x21')]=qs[_0x764b('0x21')](_0x474c08[_0x764b('0x3a')][_0x764b('0x21')]);_0x54fdc3['offset']=qs['offset'](_0x474c08[_0x764b('0x3a')]['offset']);}_0x54fdc3[_0x764b('0x3f')]=qs[_0x764b('0x40')](_0x474c08[_0x764b('0x3a')][_0x764b('0x40')]);_0x54fdc3[_0x764b('0x41')]=qs[_0x764b('0x42')](_['pick'](_0x474c08[_0x764b('0x3a')],_0x4b5d28[_0x764b('0x42')]),_0x2349d8);var _0x596da9=[];var _0xc8099a=squel[_0x764b('0x43')]()[_0x764b('0x44')]('id')[_0x764b('0x44')](_0x764b('0x2e'))['field'](_0x764b('0x45'))[_0x764b('0x46')]('tools_tags');var _0x2bad2c=squel['select']()[_0x764b('0x44')]('u.id')[_0x764b('0x44')]('u.fullname')[_0x764b('0x44')](_0x764b('0x47'))[_0x764b('0x46')](_0x764b('0x48'),'ui')[_0x764b('0x49')](_0x764b('0x4a'),'u',_0x764b('0x4b'));var _0x1e8dd6=squel[_0x764b('0x43')]()[_0x764b('0x46')](_0x764b('0x4c'),'i')['left_join'](_0x764b('0x4d'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join']('users','o',_0x764b('0x4e'))[_0x764b('0x49')](_0x764b('0x4f'),'a',_0x764b('0x50'))[_0x764b('0x49')](_0x764b('0x51'),'me',_0x764b('0x52'))['left_join'](_0x764b('0x53'),'it',_0x764b('0x54'))[_0x764b('0x49')](_0x764b('0x55'),'t','t.id\x20=\x20it.TagId');var _0x2303e1=squel['expr']();var _0xc436e8=[];var _0x4709df=squel[_0x764b('0x56')]();var _0x2f7b21;if(_0x474c08['query'][_0x764b('0x57')]){_0x2f7b21=as[_0x764b('0x58')](_0x474c08['query']['search']);var _0x483bab=_0x2f7b21[_0x764b('0x59')];for(var _0x58b440=0x0;_0x58b440<_0x2f7b21[_0x764b('0x5a')][_0x764b('0x5b')];_0x58b440++){var _0x15fdbb=_0x2f7b21[_0x764b('0x5a')][_0x58b440];var _0x40c8af='i';var _0x44f155=_['find'](_0x2349d8,[_0x764b('0x2e'),_0x15fdbb['field']]);if(!_0x44f155){switch(_0x15fdbb[_0x764b('0x44')]){case'unreadMessages':if(_0x15fdbb[_0x764b('0x5c')]==0x1){_0x1e8dd6['having']('`'+_0x15fdbb[_0x764b('0x44')]+'`\x20=\x200');}else{_0x1e8dd6[_0x764b('0x5d')]('`'+_0x15fdbb[_0x764b('0x44')]+'`\x20>\x200');}break;case _0x764b('0x5e'):if(_0x15fdbb[_0x764b('0x5f')]===_0x764b('0x60')){if(_0x15fdbb[_0x764b('0x5c')][_0x764b('0x33')]('\x20')[_0x764b('0x5b')]>0x1){_0x2303e1[_0x483bab](_0x764b('0x61'),qs[_0x764b('0x62')](_0x15fdbb[_0x764b('0x5c')]),null);}else{var _0x5d2a5f='%'+_0x15fdbb[_0x764b('0x5c')]+'%';_0x2303e1[_0x483bab](_0x764b('0x63'),_0x5d2a5f,_0x5d2a5f,_0x5d2a5f);}}else{_0x44f155=_[_0x764b('0x64')](_0x2349d8,[_0x764b('0x2e'),_0x764b('0x65')]);_0x15fdbb[_0x764b('0x44')]=_0x764b('0x65');_0x436754=as[_0x764b('0x66')](_0x40c8af,_0x44f155[_0x764b('0x67')],_0x15fdbb);_0x2303e1[_0x483bab](_0x436754['text'],_0x436754['value'][_0x764b('0x68')],_0x436754[_0x764b('0x5c')]['end']);}break;case'Tag':var _0x517eac=_0x15fdbb[_0x764b('0x5c')]['split'](',')['map'](function(_0x404361){return Number(_0x404361);});_0x517eac[_0x764b('0x69')](function(_0x5ae07b){_0x4709df['or'](_0x764b('0x6a'),'%,'+_0x5ae07b+',%');});_0xc436e8=_['union'](_0xc436e8,_0x517eac);break;case'User':if(_0x15fdbb[_0x764b('0x5f')]===_0x764b('0x60')){_0x2303e1[_0x483bab](_0x764b('0x6b'),'%'+_0x15fdbb['value']+'%',null);}else{_0x44f155=_[_0x764b('0x64')](_0x2349d8,[_0x764b('0x2e'),_0x764b('0x6c')]);_0x15fdbb[_0x764b('0x44')]=_0x764b('0x6c');_0x436754=as[_0x764b('0x66')](_0x40c8af,_0x44f155[_0x764b('0x67')],_0x15fdbb);_0x2303e1[_0x483bab](_0x436754[_0x764b('0x6d')],_0x436754[_0x764b('0x5c')][_0x764b('0x68')],_0x436754['value'][_0x764b('0x2b')]);}break;case _0x764b('0x6e'):_0x436754=as[_0x764b('0x66')]('me',null,_0x15fdbb);_0x2303e1[_0x483bab](_0x436754[_0x764b('0x6d')],_0x436754['value'][_0x764b('0x68')],_0x436754['value'][_0x764b('0x2b')]);break;}}else{var _0x436754=as[_0x764b('0x66')](_0x40c8af,_0x44f155[_0x764b('0x67')],_0x15fdbb);_0x2303e1[_0x483bab](_0x436754['text'],_0x436754[_0x764b('0x5c')][_0x764b('0x68')],_0x436754[_0x764b('0x5c')][_0x764b('0x2b')]);}}}else{var _0xf811bb=_(_0x474c08[_0x764b('0x3a')])[_0x764b('0x39')]()[_0x764b('0x35')](function(_0xf84dcf){return _[_0x764b('0x6f')](_0x2349d8,[_0x764b('0x2e'),_0xf84dcf])?_0xf84dcf:undefined;})[_0x764b('0x70')]()['value']();if(!_[_0x764b('0x71')](_0xf811bb)){_0xf811bb[_0x764b('0x69')](function(_0x1673f1){if(_0x1673f1==='SmsAccountId'){_0x1e8dd6[_0x764b('0x41')]('i.SmsAccountId\x20IN\x20?',[][_0x764b('0x72')](_0x474c08['query'][_0x1673f1]));}else if(_0x1673f1===_0x764b('0x73')){var _0x43e314=JSON[_0x764b('0x74')](_0x474c08[_0x764b('0x3a')][_0x1673f1])[_0x764b('0x75')];var _0xd30db4=JSON[_0x764b('0x74')](_0x474c08['query'][_0x1673f1])[_0x764b('0x76')];_0x1e8dd6[_0x764b('0x41')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x43e314,_0xd30db4);}else{if(_0x474c08[_0x764b('0x3a')][_0x1673f1]===_0x764b('0x77')){_0x1e8dd6[_0x764b('0x41')]('i.'+_0x1673f1+_0x764b('0x78'));}else{_0x1e8dd6[_0x764b('0x41')]('i.'+_0x1673f1+'\x20=\x20?',_0x474c08[_0x764b('0x3a')][_0x1673f1]);}}});}if(_0x474c08[_0x764b('0x3a')][_0x764b('0x79')]){if(_0x474c08[_0x764b('0x3a')][_0x764b('0x79')]==0x1){_0x1e8dd6[_0x764b('0x5d')]('`unreadMessages`\x20=\x200');}else{_0x1e8dd6[_0x764b('0x5d')]('`unreadMessages`\x20>\x200');}}if(_0x474c08[_0x764b('0x3a')]['tag']){_0xc436e8=_['isArray'](_0x474c08['query'][_0x764b('0x7a')])?_0x474c08[_0x764b('0x3a')]['tag']:new Array(_0x474c08['query'][_0x764b('0x7a')]);_0xc436e8[_0x764b('0x69')](function(_0x1226a0){_0x4709df['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x1226a0+',%');});}if(_0x474c08['query'][_0x764b('0x7b')]){var _0x50d550=_0x474c08[_0x764b('0x3a')][_0x764b('0x7b')][_0x764b('0x7c')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x764b('0x7d')](_0x50d550)){_0x2303e1['or'](_0x764b('0x7e'),_0x50d550+'%')['or'](_0x764b('0x7f'),_0x50d550+'%');}else{_0x2303e1['or'](_0x764b('0x80'),qs[_0x764b('0x62')](_0x50d550))['or'](_0x764b('0x81'),_0x50d550+'%');}}}_0x1e8dd6['where'](_0x2303e1);_0x1e8dd6[_0x764b('0x82')](_0x764b('0x83'));var _0x17383={'type':db[_0x764b('0x84')][_0x764b('0x85')]['SELECT'],'raw':!![]};var _0x4c1c7e=_0x1e8dd6[_0x764b('0x86')]();_0x4c1c7e[_0x764b('0x44')]('i.id');_0x4c1c7e[_0x764b('0x44')](_0x764b('0x87'),_0x764b('0x88'));if(_0x54fdc3[_0x764b('0x3f')]){_0x54fdc3[_0x764b('0x3f')][_0x764b('0x69')](function(_0x2093ce){var _0x23b8b1=_0x2093ce[0x0]===_0x764b('0x89')?_0x2093ce[0x0]:'i.'+_0x2093ce[0x0];_0x1e8dd6[_0x764b('0x3f')](_0x23b8b1,_0x2093ce[0x1]===_0x764b('0x8a')?![]:!![]);});}if(!_['isEmpty'](_0xc436e8)){_0x1e8dd6[_0x764b('0x5d')](_0x4709df);_0x4c1c7e['where'](_0x764b('0x8b'),_0xc436e8);}BPromise['resolve']()[_0x764b('0x2a')](function(){if(!_0x2f7b21){if(_0x474c08[_0x764b('0x3a')][_0x764b('0x8c')])return;_0x4c1c7e[_0x764b('0x41')](_0x764b('0x8d'));_0x1e8dd6[_0x764b('0x41')](_0x764b('0x8d'));return;}if(_0x474c08[_0x764b('0x8e')][_0x764b('0x8f')]!==_0x764b('0x90'))return;return _0x474c08[_0x764b('0x8e')][_0x764b('0x91')]({'attributes':['id'],'raw':!![]})[_0x764b('0x2a')](function(_0x8b3f37){if(_[_0x764b('0x71')](_0x8b3f37)){_0x4c1c7e[_0x764b('0x41')](_0x764b('0x92'));_0x1e8dd6[_0x764b('0x41')](_0x764b('0x92'));}else{_0x4c1c7e[_0x764b('0x41')](_0x764b('0x93'),_[_0x764b('0x35')](_0x8b3f37,'id'));_0x1e8dd6[_0x764b('0x41')](_0x764b('0x93'),_['map'](_0x8b3f37,'id'));}});})[_0x764b('0x2a')](function(){if(_0x474c08['user'][_0x764b('0x8f')]===_0x764b('0x90')&&!_0x2f7b21&&!_0x474c08[_0x764b('0x3a')][_0x764b('0x8c')])return[];return db[_0x764b('0x94')][_0x764b('0x3a')](_0x4c1c7e['toString'](),_0x17383);})[_0x764b('0x2a')](function(_0x4e9983){_0x2147a2[_0x764b('0x22')]=_0x4e9983['length'];if(_0x2147a2[_0x764b('0x22')]===0x0)return[];return db[_0x764b('0x94')][_0x764b('0x3a')](_0xc8099a[_0x764b('0x95')](),_0x17383)[_0x764b('0x2a')](function(_0x19589c){_0x596da9=_[_0x764b('0x96')](_0x19589c,'id');_0x17383=_[_0x764b('0x97')](_0x17383,{'model':db[_0x764b('0x98')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x474c08[_0x764b('0x3a')][_0x764b('0x3d')]){_0x54fdc3[_0x764b('0x3c')][_0x764b('0x69')](function(_0x4a2869){_0x1e8dd6[_0x764b('0x44')]('i.'+_0x4a2869);});}else{_0x1e8dd6[_0x764b('0x44')](_0x764b('0x87'),_0x764b('0x88'));_0x1e8dd6[_0x764b('0x44')](_0x764b('0x99'),_0x764b('0x9a'));_0x1e8dd6['field']('a.mandatoryDisposition',_0x764b('0x9b'));_0x1e8dd6[_0x764b('0x44')](_0x764b('0x9c'),_0x764b('0x89'));_0x1e8dd6['field'](_0x764b('0x9d'));_0x1e8dd6[_0x764b('0x44')](_0x764b('0x9e'),'Contact.firstName');_0x1e8dd6[_0x764b('0x44')](_0x764b('0x9f'),_0x764b('0xa0'));_0x1e8dd6[_0x764b('0x44')](_0x764b('0xa1'),'Contact.email');_0x1e8dd6[_0x764b('0x44')]('c.phone','Contact.phone');_0x1e8dd6[_0x764b('0x44')](_0x764b('0xa2'),_0x764b('0xa3'));_0x1e8dd6['field']('c.fax','Contact.fax');_0x1e8dd6[_0x764b('0x44')]('o.fullname','Owner.fullname');_0x1e8dd6[_0x764b('0x44')](_0x764b('0xa4'),_0x764b('0xa5'));_0x1e8dd6['field'](_0x764b('0xa6'),_0x764b('0x31'));}if(_0x54fdc3[_0x764b('0x21')])_0x1e8dd6[_0x764b('0x21')](_0x54fdc3['limit']);if(_0x54fdc3[_0x764b('0x1f')])_0x1e8dd6[_0x764b('0x1f')](_0x54fdc3[_0x764b('0x1f')]);return db['sequelize']['query'](_0x1e8dd6[_0x764b('0x95')](),_0x17383);})[_0x764b('0x2a')](function(_0x4b043e){if(_0x4b043e[_0x764b('0x5b')]>0x0)_0x2bad2c[_0x764b('0x41')]('ui.SmsInteractionId\x20IN\x20?',_[_0x764b('0x35')](_0x4b043e,'id'));return db[_0x764b('0x94')][_0x764b('0x3a')](_0x2bad2c[_0x764b('0x95')](),_0x17383)[_0x764b('0x2a')](function(_0x46f59d){var _0x493b0f=_['groupBy'](_0x46f59d,_0x764b('0xa7'));var _0x45fea4=[];_0x4b043e[_0x764b('0x69')](function(_0x2b7471){_0x45fea4[_0x764b('0x34')](updateSmsInteraction(_0x2b7471,_0x596da9,_0x493b0f));});return BPromise['all'](_0x45fea4);});});})[_0x764b('0x2a')](function(_0x395417){_0x2147a2[_0x764b('0xa8')]=_0x395417;return _0x2147a2;})[_0x764b('0x2a')](respondWithFilteredResult(_0x53e0da,_0x54fdc3))[_0x764b('0xa9')](handleError(_0x53e0da,null));};exports[_0x764b('0xaa')]=function(_0x7a666f,_0x3ce80b){var _0x5e6f82={'raw':![],'where':{'id':_0x7a666f[_0x764b('0xab')]['id']}},_0x1fbef5={};_0x1fbef5[_0x764b('0x38')]=_[_0x764b('0x39')](db['SmsInteraction']['rawAttributes']);_0x1fbef5[_0x764b('0x3a')]=_[_0x764b('0x39')](_0x7a666f[_0x764b('0x3a')]);_0x1fbef5['filters']=_['intersection'](_0x1fbef5[_0x764b('0x38')],_0x1fbef5['query']);_0x5e6f82['attributes']=_[_0x764b('0x3b')](_0x1fbef5['model'],qs[_0x764b('0x3d')](_0x7a666f[_0x764b('0x3a')][_0x764b('0x3d')]));_0x5e6f82[_0x764b('0x3c')]=_0x5e6f82['attributes'][_0x764b('0x5b')]?_0x5e6f82['attributes']:_0x1fbef5[_0x764b('0x38')];if(_0x7a666f[_0x764b('0x3a')]['includeAll']){_0x5e6f82['include']=[{'all':!![]}];}_0x5e6f82=_[_0x764b('0x97')]({},_0x5e6f82,_0x7a666f['options']);return db['SmsInteraction'][_0x764b('0x64')](_0x5e6f82)[_0x764b('0x2a')](handleEntityNotFound(_0x3ce80b,null))[_0x764b('0x2a')](respondWithResult(_0x3ce80b,null))[_0x764b('0xa9')](handleError(_0x3ce80b,null));};exports[_0x764b('0xac')]=function(_0x17e19d,_0x413a08){return db[_0x764b('0x98')][_0x764b('0xac')](_0x17e19d['body'],{})[_0x764b('0x2a')](respondWithResult(_0x413a08,0xc9))[_0x764b('0xa9')](handleError(_0x413a08,null));};exports[_0x764b('0x28')]=function(_0x1fda4f,_0x3c5149){if(_0x1fda4f['body']['id']){delete _0x1fda4f[_0x764b('0x6e')]['id'];}return db['SmsInteraction']['find']({'where':{'id':_0x1fda4f[_0x764b('0xab')]['id']}})[_0x764b('0x2a')](handleEntityNotFound(_0x3c5149,null))[_0x764b('0x2a')](saveUpdates(_0x1fda4f[_0x764b('0x6e')],null))[_0x764b('0x2a')](respondWithResult(_0x3c5149,null))[_0x764b('0xa9')](handleError(_0x3c5149,null));};exports[_0x764b('0x29')]=function(_0x934525,_0xdd151){return db[_0x764b('0x98')][_0x764b('0x64')]({'where':{'id':_0x934525[_0x764b('0xab')]['id']}})[_0x764b('0x2a')](handleEntityNotFound(_0xdd151,null))['then'](removeEntity(_0xdd151,null))['catch'](handleError(_0xdd151,null));};exports['describe']=function(_0x48894f,_0x47b953){return db['SmsInteraction']['describe']()[_0x764b('0x2a')](respondWithResult(_0x47b953,null))[_0x764b('0xa9')](handleError(_0x47b953,null));};exports[_0x764b('0xad')]=function(_0xa3db95,_0xb8bb4e,_0x255ec0){return db[_0x764b('0xae')]['find']({'where':{'id':_0xa3db95[_0x764b('0xab')]['id']}})[_0x764b('0x2a')](handleEntityNotFound(_0xb8bb4e,null))[_0x764b('0x2a')](function(_0x15dda4){if(_0x15dda4){return _0x15dda4['addMessage'](_0xa3db95['body']['ids'],_[_0x764b('0xaf')](_0xa3db95[_0x764b('0x6e')],[_0x764b('0xb0'),'id'])||{});}})[_0x764b('0x2a')](respondWithResult(_0xb8bb4e,null))[_0x764b('0xa9')](handleError(_0xb8bb4e,null));};exports[_0x764b('0xb1')]=function(_0x271d2d,_0x5d1971,_0x2ac8a5){var _0x468899={'raw':![],'where':{}};var _0x5d499e={};var _0x1d3746={'count':0x0,'rows':[]};return db[_0x764b('0x98')][_0x764b('0xb2')]({'where':{'id':_0x271d2d[_0x764b('0xab')]['id']}})[_0x764b('0x2a')](handleEntityNotFound(_0x5d1971,null))[_0x764b('0x2a')](function(_0x2b8057){if(_0x2b8057){_0x5d499e[_0x764b('0x38')]=_[_0x764b('0x39')](db['SmsMessage'][_0x764b('0x36')]);_0x5d499e[_0x764b('0x3a')]=_[_0x764b('0x39')](_0x271d2d['query']);_0x5d499e['filters']=_[_0x764b('0x3b')](_0x5d499e[_0x764b('0x38')],_0x5d499e[_0x764b('0x3a')]);_0x468899[_0x764b('0x3c')]=_['intersection'](_0x5d499e[_0x764b('0x38')],qs[_0x764b('0x3d')](_0x271d2d['query']['fields']));_0x468899[_0x764b('0x3c')]=_0x468899['attributes'][_0x764b('0x5b')]?_0x468899[_0x764b('0x3c')]:_0x5d499e[_0x764b('0x38')];if(!_0x271d2d[_0x764b('0x3a')]['hasOwnProperty'](_0x764b('0x3e'))){_0x468899[_0x764b('0x21')]=qs[_0x764b('0x21')](_0x271d2d[_0x764b('0x3a')][_0x764b('0x21')]);_0x468899[_0x764b('0x1f')]=qs[_0x764b('0x1f')](_0x271d2d[_0x764b('0x3a')][_0x764b('0x1f')]);}_0x468899[_0x764b('0x3f')]=qs[_0x764b('0x40')](_0x271d2d[_0x764b('0x3a')][_0x764b('0x40')]);_0x468899[_0x764b('0x41')]=qs[_0x764b('0x42')](_[_0x764b('0xb3')](_0x271d2d['query'],_0x5d499e[_0x764b('0x42')]));_0x468899[_0x764b('0x41')][_0x764b('0xa7')]=_0x2b8057['id'];if(_0x271d2d[_0x764b('0x3a')][_0x764b('0x7b')]){_0x468899['where']=_[_0x764b('0x97')](_0x468899[_0x764b('0x41')],{'$or':_[_0x764b('0x35')](_0x468899[_0x764b('0x3c')],function(_0x1872c7){var _0x277ff6={};_0x277ff6[_0x1872c7]={'$like':'%'+_0x271d2d[_0x764b('0x3a')]['filter']+'%'};return _0x277ff6;})});}if(_0x271d2d['query'][_0x764b('0x75')]){var _0x1dfca9=_0x271d2d[_0x764b('0x3a')]['$gte'][_0x764b('0x33')](',');var _0x5cd83a={};_0x5cd83a[_0x1dfca9[0x0]]={'$gte':moment(_0x1dfca9[0x1])[_0x764b('0xb4')]('YYYY-MM-DD\x20HH:mm:ss')};_0x468899[_0x764b('0x41')]=_[_0x764b('0x97')](_0x468899[_0x764b('0x41')],_0x5cd83a);}_0x468899=_[_0x764b('0x97')]({},_0x468899,_0x271d2d[_0x764b('0xb5')]);return db[_0x764b('0xae')][_0x764b('0x22')]({'where':_0x468899['where']})[_0x764b('0x2a')](function(_0x2e318a){_0x1d3746[_0x764b('0x22')]=_0x2e318a;if(_0x271d2d[_0x764b('0x3a')][_0x764b('0xb6')]){_0x468899[_0x764b('0xb7')]=[{'all':!![]}];}return db['SmsMessage'][_0x764b('0xb8')](_0x468899);})[_0x764b('0x2a')](function(_0x4f74b5){_0x1d3746[_0x764b('0xa8')]=_0x4f74b5;return _0x1d3746;});}})['then'](respondWithFilteredResult(_0x5d1971,_0x468899))[_0x764b('0xa9')](handleError(_0x5d1971,null));};exports['addTags']=function(_0x3d06ff,_0x3c64cb,_0x5140b9){return db['SmsInteraction'][_0x764b('0x64')]({'where':{'id':_0x3d06ff[_0x764b('0xab')]['id']}})[_0x764b('0x2a')](handleEntityNotFound(_0x3c64cb,null))['then'](function(_0x4d81ea){if(_0x4d81ea){return _0x4d81ea[_0x764b('0xb9')](_0x3d06ff[_0x764b('0x6e')][_0x764b('0xb0')],_['omit'](_0x3d06ff['body'],[_0x764b('0xb0'),'id'])||{})[_0x764b('0xba')](function(){return db[_0x764b('0xbb')]['findAll']({'attributes':['id',_0x764b('0x2e'),_0x764b('0x45')],'where':{'id':_0x3d06ff[_0x764b('0x6e')]['ids']}});})[_0x764b('0x2a')](function(_0x55b014){socket[_0x764b('0xbc')](_0x764b('0xbd'),{'id':Number(_0x3d06ff[_0x764b('0xab')]['id']),'tags':_0x55b014||[]});return{'id':Number(_0x3d06ff[_0x764b('0xab')]['id']),'tags':_0x55b014||[]};});}})[_0x764b('0x2a')](respondWithResult(_0x3c64cb,null))['catch'](handleError(_0x3c64cb,null));};exports[_0x764b('0xbe')]=function(_0x56d916,_0x54b382,_0x4b32da){return db[_0x764b('0x98')][_0x764b('0x64')]({'where':{'id':_0x56d916[_0x764b('0xab')]['id']}})[_0x764b('0x2a')](handleEntityNotFound(_0x54b382,null))['then'](function(_0x3f915d){if(_0x3f915d){return _0x3f915d[_0x764b('0xbe')](_0x56d916['query']['ids']);}})[_0x764b('0x2a')](respondWithStatusCode(_0x54b382,null))[_0x764b('0xa9')](handleError(_0x54b382,null));};exports[_0x764b('0xbf')]=function(_0x10339b,_0x28e7e0){var _0x4049b4=moment()[_0x764b('0xc0')]()['toString']();var _0x23d1e6=path[_0x764b('0xc1')](config[_0x764b('0xc2')],_0x764b('0xc3'),_0x764b('0xc4'),_0x764b('0xc5'));var _0x133adf=path[_0x764b('0xc1')](config['root'],_0x764b('0xc3'),_0x764b('0xc4'),_0x764b('0xc6'));var _0x4b4bcb=path['join'](_0x23d1e6,_0x4049b4);var _0x2bb5ff=util[_0x764b('0xb4')](_0x764b('0xc7'),_0x10339b[_0x764b('0xab')]['id'],_0x4049b4);var _0x156dca=path['join'](_0x23d1e6,_0x2bb5ff);var _0x4da000=[];_0x4da000[_0x764b('0x34')]({'model':db[_0x764b('0xc8')],'as':_0x764b('0xc8'),'attributes':['id',_0x764b('0xc9')],'raw':!![]});_0x4da000[_0x764b('0x34')]({'model':db[_0x764b('0xca')],'as':_0x764b('0x5e'),'attributes':['id',_0x764b('0xcb'),_0x764b('0xcc')],'raw':!![]});var _0xeb5333=[{'model':db[_0x764b('0xae')],'as':_0x764b('0xcd'),'attributes':['id','body',_0x764b('0x73'),'direction','secret',_0x764b('0x79')],'include':_0x4da000}];_0xeb5333[_0x764b('0x34')]({'model':db[_0x764b('0xce')],'as':_0x764b('0xcf'),'attributes':['id',_0x764b('0x2e')]});_0xeb5333[_0x764b('0x34')]({'model':db['User'],'as':_0x764b('0xd0'),'attributes':['id',_0x764b('0xc9')]});return db[_0x764b('0x98')]['find']({'where':{'id':_0x10339b[_0x764b('0xab')]['id']},'include':_0xeb5333})[_0x764b('0x2a')](handleEntityNotFound(_0x28e7e0,null))[_0x764b('0x2a')](function(_0xbe53ab){if(_0xbe53ab){var _0x4f4253=_0xbe53ab[_0x764b('0xd1')]({'plain':!![]});fs[_0x764b('0xd2')](_0x4b4bcb);var _0x5bd005={'channel':_0x764b('0xd3'),'account':_0x4f4253[_0x764b('0xcf')]['name'],'agent':_0x4f4253[_0x764b('0xd0')]?_0x4f4253[_0x764b('0xd0')][_0x764b('0xc9')]:_0x764b('0xd4'),'createdAt':moment(_0x4f4253[_0x764b('0x73')])[_0x764b('0xb4')](_0x764b('0xd5'))[_0x764b('0x95')](),'closedAt':_0x4f4253[_0x764b('0xd6')]?moment(_0x4f4253['closedAt'])[_0x764b('0xb4')]('YYYY-MM-DD\x20HH:mm:ss')[_0x764b('0x95')]():'','disposition':_0x4f4253[_0x764b('0xd7')],'messages':_(_0x4f4253[_0x764b('0xcd')])[_0x764b('0x7b')]({'secret':![]})[_0x764b('0x35')](function(_0x308ed6){return{'date':moment(_0x308ed6[_0x764b('0x73')])['format'](_0x764b('0xd5'))[_0x764b('0x95')](),'sender':_0x308ed6['direction']==='out'?_0x308ed6[_0x764b('0xc8')]?_0x308ed6[_0x764b('0xc8')]['fullname']:_0x764b('0xd8'):_0x308ed6[_0x764b('0x5e')]['firstName']+(_0x308ed6['Contact'][_0x764b('0xcc')]?'\x20'+_0x308ed6[_0x764b('0x5e')][_0x764b('0xcc')]:''),'body':_0x308ed6['body'],'direction':_0x308ed6['direction']==='out'?'A':'C','secret':_0x308ed6['secret'],'read':_0x308ed6['read']};})[_0x764b('0x5c')]()};return ejs['renderFile'](path[_0x764b('0xc1')](config[_0x764b('0xc2')],_0x764b('0xc3'),_0x764b('0xd9'),_0x764b('0xda')),{'interaction':_0x5bd005})[_0x764b('0x2a')](function(_0x40e955){var _0x511578=path[_0x764b('0xc1')](_0x4b4bcb,'transcript-'+_0x4f4253['id']+'-'+_0x4049b4+'.pdf');var _0x244963={'path':_0x511578,'channel':'Sms','interactionId':_0x4f4253['id']};return pdf[_0x764b('0xdb')](_0x40e955,_0x244963);})['then'](function(){return new BPromise(function(_0x413728,_0x5eecb0){zipdir(_0x4b4bcb,{'saveTo':_0x156dca},function(_0x5537e9,_0x1f10b2){if(_0x5537e9)return _0x5eecb0(_0x5537e9);return _0x413728(_0x1f10b2);});})[_0x764b('0x2a')](function(){return new BPromise(function(_0x2a69ea,_0x309588){rimraf(_0x4b4bcb,function(_0xa5f52d){if(_0xa5f52d)_0x309588(_0xa5f52d);return _0x2a69ea();});});})['then'](function(){return _0x28e7e0[_0x764b('0xbf')](_0x156dca,_0x2bb5ff,function(_0x2f6939){if(_0x2f6939){console[_0x764b('0xdc')](_0x764b('0xdd'),_0x2f6939);}else{fs['unlinkSync'](_0x156dca);}});});});}else{return _0x28e7e0[_0x764b('0x1d')](0xc8);}})[_0x764b('0xa9')](handleError(_0x28e7e0,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 079cc58..7cb146a 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 _0x2272=['findAll','unreadMessages','length','emit','catch','hook','exports','events','../../mysqldb','SmsInteraction','SmsMessage','save','update','remove','getUsers','then','setDataValue','Users','map'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x2272,0xd8));var _0x2227=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x2272[_0x17d9e3];return _0x14192d;};'use strict';var EventEmitter=require(_0x2227('0x0'));var SmsInteraction=require(_0x2227('0x1'))['db'][_0x2227('0x2')];var SmsMessage=require(_0x2227('0x1'))['db'][_0x2227('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2227('0x4'),'afterUpdate':_0x2227('0x5'),'afterDestroy':_0x2227('0x6')};function emitEvent(_0x4c17c2){return function(_0x4ebde3,_0x1e5a8a,_0x3b8661){_0x4ebde3[_0x2227('0x7')]({'attributes':['id'],'raw':!![]})[_0x2227('0x8')](function(_0xaec623){_0x4ebde3[_0x2227('0x9')](_0x2227('0xa'),_0xaec623[_0x2227('0xb')](function(_0x18094d){return{'id':_0x18094d['id']};}));return SmsMessage[_0x2227('0xc')]({'where':{'SmsInteractionId':_0x4ebde3['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x799370){_0x4ebde3['setDataValue'](_0x2227('0xd'),_0x799370[_0x2227('0xe')]);SmsInteractionEvents[_0x2227('0xf')](_0x4c17c2+':'+_0x4ebde3['id'],_0x4ebde3);SmsInteractionEvents[_0x2227('0xf')](_0x4c17c2,_0x4ebde3);_0x3b8661(null);})[_0x2227('0x10')](_0x3b8661(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction[_0x2227('0x11')](e,emitEvent(event));}}module[_0x2227('0x12')]=SmsInteractionEvents; \ No newline at end of file +var _0x955f=['save','getUsers','setDataValue','map','findAll','then','unreadMessages','emit','catch','hasOwnProperty','hook','events','../../mysqldb','SmsInteraction','SmsMessage'];(function(_0x3783b8,_0x4d916d){var _0xb2304a=function(_0x22204e){while(--_0x22204e){_0x3783b8['push'](_0x3783b8['shift']());}};_0xb2304a(++_0x4d916d);}(_0x955f,0x1eb));var _0xf955=function(_0x128904,_0x2a44ce){_0x128904=_0x128904-0x0;var _0x574dcc=_0x955f[_0x128904];return _0x574dcc;};'use strict';var EventEmitter=require(_0xf955('0x0'));var SmsInteraction=require(_0xf955('0x1'))['db'][_0xf955('0x2')];var SmsMessage=require(_0xf955('0x1'))['db'][_0xf955('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf955('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1db0dd){return function(_0x5a20bc,_0x13b796,_0x2caff2){_0x5a20bc[_0xf955('0x5')]({'attributes':['id'],'raw':!![]})['then'](function(_0x18432f){_0x5a20bc[_0xf955('0x6')]('Users',_0x18432f[_0xf955('0x7')](function(_0x151034){return{'id':_0x151034['id']};}));return SmsMessage[_0xf955('0x8')]({'where':{'SmsInteractionId':_0x5a20bc['id'],'direction':'in','read':![]},'raw':!![]});})[_0xf955('0x9')](function(_0x134c1b){_0x5a20bc[_0xf955('0x6')](_0xf955('0xa'),_0x134c1b['length']);SmsInteractionEvents[_0xf955('0xb')](_0x1db0dd+':'+_0x5a20bc['id'],_0x5a20bc);SmsInteractionEvents['emit'](_0x1db0dd,_0x5a20bc);_0x2caff2(null);})[_0xf955('0xc')](_0x2caff2(null));};}for(var e in events){if(events[_0xf955('0xd')](e)){var event=events[e];SmsInteraction[_0xf955('0xe')](e,emitEvent(event));}}module['exports']=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 796dbd6..aa06382 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 _0x4475=['bluebird','request-promise','./smsInteraction.attributes','exports','define','SmsInteraction','changed','closed','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api'];(function(_0xe73080,_0x24c56d){var _0x12cbc4=function(_0x1377e2){while(--_0x1377e2){_0xe73080['push'](_0xe73080['shift']());}};_0x12cbc4(++_0x24c56d);}(_0x4475,0x189));var _0x5447=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x4475[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x5447('0x0'));var util=require('util');var logger=require(_0x5447('0x1'))(_0x5447('0x2'));var moment=require('moment');var BPromise=require(_0x5447('0x3'));var rp=require(_0x5447('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5447('0x5'));module[_0x5447('0x6')]=function(_0x334982,_0x4f5725){return _0x334982[_0x5447('0x7')](_0x5447('0x8'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x37f9bc,_0x48e913,_0x4098cf){if(_0x37f9bc[_0x5447('0x9')](_0x5447('0xa'))){_0x37f9bc['closedAt']=moment()['format'](_0x5447('0xb'));}_0x4098cf(null,_0x37f9bc);}}});}; \ No newline at end of file +var _0xfdbf=['exports','define','SmsInteraction','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','bluebird','rimraf','../../config/environment','./smsInteraction.attributes'];(function(_0x558fe9,_0x1ca3f7){var _0x554d2a=function(_0x16895a){while(--_0x16895a){_0x558fe9['push'](_0x558fe9['shift']());}};_0x554d2a(++_0x1ca3f7);}(_0xfdbf,0x138));var _0xffdb=function(_0x1e381c,_0x47b5b9){_0x1e381c=_0x1e381c-0x0;var _0x9b5ea9=_0xfdbf[_0x1e381c];return _0x9b5ea9;};'use strict';var _=require(_0xffdb('0x0'));var util=require(_0xffdb('0x1'));var logger=require(_0xffdb('0x2'))(_0xffdb('0x3'));var moment=require('moment');var BPromise=require(_0xffdb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xffdb('0x5'));var config=require(_0xffdb('0x6'));var attributes=require(_0xffdb('0x7'));module[_0xffdb('0x8')]=function(_0x2daa6e,_0x585a6e){return _0x2daa6e[_0xffdb('0x9')](_0xffdb('0xa'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1e9cd9,_0x2e23c1,_0x207580){if(_0x1e9cd9[_0xffdb('0xb')](_0xffdb('0xc'))){_0x1e9cd9[_0xffdb('0xd')]=moment()[_0xffdb('0xe')](_0xffdb('0xf'));}_0x207580(null,_0x1e9cd9);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 11c6562..d393d5c 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 _0x7845=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateSmsInteraction','SmsInteraction','body','options','raw','where','attributes','limit','find','ids','spread','AddTags','catch'];(function(_0x5036a0,_0x3817ae){var _0x315660=function(_0x5b8854){while(--_0x5b8854){_0x5036a0['push'](_0x5036a0['shift']());}};_0x315660(++_0x3817ae);}(_0x7845,0xd2));var _0x5784=function(_0x561f40,_0x22bc3e){_0x561f40=_0x561f40-0x0;var _0x52ba0c=_0x7845[_0x561f40];return _0x52ba0c;};'use strict';var _=require(_0x5784('0x0'));var util=require(_0x5784('0x1'));var moment=require(_0x5784('0x2'));var BPromise=require(_0x5784('0x3'));var rs=require(_0x5784('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5784('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5784('0x6'))(_0x5784('0x7'));var config=require(_0x5784('0x8'));var jayson=require(_0x5784('0x9'));var client=jayson['client'][_0x5784('0xa')]({'port':0x232a});config[_0x5784('0xb')]=_[_0x5784('0xc')](config[_0x5784('0xb')],{'host':_0x5784('0xd'),'port':0x18eb});var socket=require(_0x5784('0xe'))(new Redis(config[_0x5784('0xb')]));require(_0x5784('0xf'))[_0x5784('0x10')](socket);function respondWithRpcPromise(_0x3b3e83,_0x3e6532,_0x4f359b){return new BPromise(function(_0x4bfa1e,_0x3d0846){return client[_0x5784('0x11')](_0x3b3e83,_0x4f359b)[_0x5784('0x12')](function(_0x403eab){logger[_0x5784('0x13')](_0x5784('0x14'),_0x3e6532,_0x5784('0x15'));logger[_0x5784('0x16')](_0x5784('0x17'),_0x3e6532,_0x5784('0x15'),JSON[_0x5784('0x18')](_0x403eab));if(_0x403eab['error']){if(_0x403eab[_0x5784('0x19')][_0x5784('0x1a')]===0x1f4){logger[_0x5784('0x19')]('SmsInteraction,\x20%s,\x20%s',_0x3e6532,_0x403eab[_0x5784('0x19')][_0x5784('0x1b')]);return _0x3d0846(_0x403eab[_0x5784('0x19')]['message']);}logger[_0x5784('0x19')](_0x5784('0x14'),_0x3e6532,_0x403eab[_0x5784('0x19')][_0x5784('0x1b')]);return _0x4bfa1e(_0x403eab[_0x5784('0x19')][_0x5784('0x1b')]);}else{logger[_0x5784('0x13')](_0x5784('0x14'),_0x3e6532,_0x5784('0x15'));_0x4bfa1e(_0x403eab[_0x5784('0x1c')][_0x5784('0x1b')]);}})['catch'](function(_0x23829e){logger['error'](_0x5784('0x14'),_0x3e6532,_0x23829e);_0x3d0846(_0x23829e);});});}exports[_0x5784('0x1d')]=function(_0x1ef6eb){var _0x353711=this;return new Promise(function(_0xb7e92e,_0xbe4864){return db[_0x5784('0x1e')]['update'](_0x1ef6eb[_0x5784('0x1f')],{'raw':_0x1ef6eb[_0x5784('0x20')]?_0x1ef6eb['options'][_0x5784('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ef6eb[_0x5784('0x20')]?_0x1ef6eb[_0x5784('0x20')][_0x5784('0x22')]||null:null,'attributes':_0x1ef6eb['options']?_0x1ef6eb['options'][_0x5784('0x23')]||null:null,'limit':_0x1ef6eb['options']?_0x1ef6eb[_0x5784('0x20')][_0x5784('0x24')]||null:null})[_0x5784('0x12')](function(_0x220387){logger['info'](_0x5784('0x1d'),_0x1ef6eb);logger['debug']('UpdateSmsInteraction',_0x1ef6eb,JSON[_0x5784('0x18')](_0x220387));_0xb7e92e(_0x220387);})['catch'](function(_0x5b4a81){logger[_0x5784('0x19')](_0x5784('0x1d'),_0x5b4a81[_0x5784('0x1b')],_0x1ef6eb);_0xbe4864(_0x353711[_0x5784('0x19')](0x1f4,_0x5b4a81[_0x5784('0x1b')]));});});};exports['AddTagsToSmsInteraction']=function(_0x455315){return new Promise(function(_0x3515e6,_0x2eff03){return db['SmsInteraction'][_0x5784('0x25')]({'where':_0x455315[_0x5784('0x20')]?_0x455315['options'][_0x5784('0x22')]||null:null})['then'](function(_0x40afad){if(_0x40afad){return _0x40afad['addTags'](_0x455315[_0x5784('0x1f')][_0x5784('0x26')],_['omit'](_0x455315[_0x5784('0x1f')],[_0x5784('0x26'),'id'])||{});}})[_0x5784('0x27')](function(_0x4f00bd){logger['info'](_0x5784('0x28'),_0x455315);logger[_0x5784('0x16')](_0x5784('0x28'),_0x455315,JSON[_0x5784('0x18')](_0x4f00bd));_0x3515e6(_0x4f00bd);})[_0x5784('0x29')](function(_0x565eb9){logger[_0x5784('0x19')](_0x5784('0x28'),_0x565eb9[_0x5784('0x1b')],_0x455315);_0x2eff03(_this[_0x5784('0x19')](0x1f4,_0x565eb9[_0x5784('0x1b')]));});});}; \ No newline at end of file +var _0x3799=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','redis','localhost','./smsInteraction.socket','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','SmsInteraction','update','body','options','raw','where','attributes','UpdateSmsInteraction','debug','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring'];(function(_0x347509,_0xb82d32){var _0x30a2c1=function(_0x522893){while(--_0x522893){_0x347509['push'](_0x347509['shift']());}};_0x30a2c1(++_0xb82d32);}(_0x3799,0x9b));var _0x9379=function(_0x4ba8cb,_0x17d27e){_0x4ba8cb=_0x4ba8cb-0x0;var _0x3cc653=_0x3799[_0x4ba8cb];return _0x3cc653;};'use strict';var _=require(_0x9379('0x0'));var util=require(_0x9379('0x1'));var moment=require(_0x9379('0x2'));var BPromise=require(_0x9379('0x3'));var rs=require(_0x9379('0x4'));var fs=require('fs');var Redis=require(_0x9379('0x5'));var db=require(_0x9379('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9379('0x7'))(_0x9379('0x8'));var config=require(_0x9379('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9379('0xa')]['http']({'port':0x232a});config[_0x9379('0xb')]=_['defaults'](config[_0x9379('0xb')],{'host':_0x9379('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9379('0xb')]));require(_0x9379('0xd'))['register'](socket);function respondWithRpcPromise(_0x45d250,_0x393cb6,_0x3deeef){return new BPromise(function(_0x220fc6,_0xc8a159){return client[_0x9379('0xe')](_0x45d250,_0x3deeef)[_0x9379('0xf')](function(_0x53dfa0){logger[_0x9379('0x10')](_0x9379('0x11'),_0x393cb6,_0x9379('0x12'));logger['debug'](_0x9379('0x13'),_0x393cb6,_0x9379('0x12'),JSON[_0x9379('0x14')](_0x53dfa0));if(_0x53dfa0[_0x9379('0x15')]){if(_0x53dfa0[_0x9379('0x15')][_0x9379('0x16')]===0x1f4){logger['error'](_0x9379('0x11'),_0x393cb6,_0x53dfa0[_0x9379('0x15')][_0x9379('0x17')]);return _0xc8a159(_0x53dfa0['error'][_0x9379('0x17')]);}logger['error'](_0x9379('0x11'),_0x393cb6,_0x53dfa0[_0x9379('0x15')]['message']);return _0x220fc6(_0x53dfa0[_0x9379('0x15')][_0x9379('0x17')]);}else{logger[_0x9379('0x10')]('SmsInteraction,\x20%s,\x20%s',_0x393cb6,'request\x20sent');_0x220fc6(_0x53dfa0['result'][_0x9379('0x17')]);}})[_0x9379('0x18')](function(_0xcc831e){logger[_0x9379('0x15')](_0x9379('0x11'),_0x393cb6,_0xcc831e);_0xc8a159(_0xcc831e);});});}exports['UpdateSmsInteraction']=function(_0x16d17c){var _0x1cb2c3=this;return new Promise(function(_0x99fca9,_0x387db6){return db[_0x9379('0x19')][_0x9379('0x1a')](_0x16d17c[_0x9379('0x1b')],{'raw':_0x16d17c[_0x9379('0x1c')]?_0x16d17c['options'][_0x9379('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x16d17c['options']?_0x16d17c[_0x9379('0x1c')][_0x9379('0x1e')]||null:null,'attributes':_0x16d17c[_0x9379('0x1c')]?_0x16d17c['options'][_0x9379('0x1f')]||null:null,'limit':_0x16d17c[_0x9379('0x1c')]?_0x16d17c[_0x9379('0x1c')]['limit']||null:null})['then'](function(_0xcbefe9){logger[_0x9379('0x10')](_0x9379('0x20'),_0x16d17c);logger[_0x9379('0x21')]('UpdateSmsInteraction',_0x16d17c,JSON[_0x9379('0x14')](_0xcbefe9));_0x99fca9(_0xcbefe9);})[_0x9379('0x18')](function(_0xbd95a5){logger[_0x9379('0x15')](_0x9379('0x20'),_0xbd95a5[_0x9379('0x17')],_0x16d17c);_0x387db6(_0x1cb2c3[_0x9379('0x15')](0x1f4,_0xbd95a5['message']));});});};exports['AddTagsToSmsInteraction']=function(_0x564a4a){return new Promise(function(_0x550cbf,_0x432af9){return db['SmsInteraction'][_0x9379('0x22')]({'where':_0x564a4a[_0x9379('0x1c')]?_0x564a4a[_0x9379('0x1c')]['where']||null:null})[_0x9379('0xf')](function(_0x52c0ec){if(_0x52c0ec){return _0x52c0ec[_0x9379('0x23')](_0x564a4a[_0x9379('0x1b')][_0x9379('0x24')],_[_0x9379('0x25')](_0x564a4a[_0x9379('0x1b')],[_0x9379('0x24'),'id'])||{});}})[_0x9379('0x26')](function(_0x291f87){logger[_0x9379('0x10')]('AddTags',_0x564a4a);logger[_0x9379('0x21')](_0x9379('0x27'),_0x564a4a,JSON[_0x9379('0x14')](_0x291f87));_0x550cbf(_0x291f87);})[_0x9379('0x18')](function(_0x1a9f5a){logger[_0x9379('0x15')](_0x9379('0x27'),_0x1a9f5a[_0x9379('0x17')],_0x564a4a);_0x432af9(_this[_0x9379('0x15')](0x1f4,_0x1a9f5a[_0x9379('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index db50346..cccc208 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 _0x379c=['removeListener','register','length','save','remove','emit'];(function(_0x3c5f8d,_0x39891f){var _0x3b7beb=function(_0x44d6c9){while(--_0x44d6c9){_0x3c5f8d['push'](_0x3c5f8d['shift']());}};_0x3b7beb(++_0x39891f);}(_0x379c,0x19b));var _0xc379=function(_0x289556,_0x7f8fc5){_0x289556=_0x289556-0x0;var _0x1c59c3=_0x379c[_0x289556];return _0x1c59c3;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0xc379('0x0'),_0xc379('0x1'),'update'];function createListener(_0x541690,_0x94fab3){return function(_0x4f96e3){_0x94fab3[_0xc379('0x2')](_0x541690,_0x4f96e3);};}function removeListener(_0x349d3d,_0x318634){return function(){SmsInteractionEvents[_0xc379('0x3')](_0x349d3d,_0x318634);};}exports[_0xc379('0x4')]=function(_0x5b880a){for(var _0xc84bf=0x0,_0x2a35a8=events[_0xc379('0x5')];_0xc84bf<_0x2a35a8;_0xc84bf++){var _0x20ebc6=events[_0xc84bf];var _0x52e45a=createListener('smsInteraction:'+_0x20ebc6,_0x5b880a);SmsInteractionEvents['on'](_0x20ebc6,_0x52e45a);}}; \ No newline at end of file +var _0x06d8=['removeListener','length','smsInteraction:','save','remove','update','emit'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x06d8,0x1ed));var _0x806d=function(_0x89c6ce,_0x41dbf7){_0x89c6ce=_0x89c6ce-0x0;var _0x564ec1=_0x06d8[_0x89c6ce];return _0x564ec1;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0x806d('0x0'),_0x806d('0x1'),_0x806d('0x2')];function createListener(_0x40d90f,_0x39ef19){return function(_0x4ddbde){_0x39ef19[_0x806d('0x3')](_0x40d90f,_0x4ddbde);};}function removeListener(_0x56f97b,_0x3792c5){return function(){SmsInteractionEvents[_0x806d('0x4')](_0x56f97b,_0x3792c5);};}exports['register']=function(_0x3c5271){for(var _0x18d3c4=0x0,_0xcd96f6=events[_0x806d('0x5')];_0x18d3c4<_0xcd96f6;_0x18d3c4++){var _0x123dbd=events[_0x18d3c4];var _0x5a07f6=createListener(_0x806d('0x6')+_0x123dbd,_0x3c5271);SmsInteractionEvents['on'](_0x123dbd,_0x5a07f6);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 6baca16..d82e10b 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 _0x6be9=['describe','/:id','post','tracked','smsmessage:create','create','/:id/status','status','put','reject','delete','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','index','/describe'];(function(_0x4e4966,_0x45f39c){var _0x5ecb0f=function(_0x5566b3){while(--_0x5566b3){_0x4e4966['push'](_0x4e4966['shift']());}};_0x5ecb0f(++_0x45f39c);}(_0x6be9,0xec));var _0x96be=function(_0x3e2445,_0x326268){_0x3e2445=_0x3e2445-0x0;var _0x56f3ec=_0x6be9[_0x3e2445];return _0x56f3ec;};'use strict';var multer=require(_0x96be('0x0'));var util=require(_0x96be('0x1'));var path=require(_0x96be('0x2'));var timeout=require(_0x96be('0x3'));var express=require('express');var router=express[_0x96be('0x4')]();var fs_extra=require(_0x96be('0x5'));var auth=require(_0x96be('0x6'));var interaction=require(_0x96be('0x7'));var config=require(_0x96be('0x8'));var controller=require(_0x96be('0x9'));router[_0x96be('0xa')]('/',auth[_0x96be('0xb')](),controller[_0x96be('0xc')]);router[_0x96be('0xa')](_0x96be('0xd'),auth[_0x96be('0xb')](),controller[_0x96be('0xe')]);router['get'](_0x96be('0xf'),auth[_0x96be('0xb')](),controller['show']);router[_0x96be('0x10')]('/',auth[_0x96be('0xb')](),interaction[_0x96be('0x11')]('sms',_0x96be('0x12')),controller[_0x96be('0x13')]);router[_0x96be('0x10')](_0x96be('0x14'),controller[_0x96be('0x15')]);router['put'](_0x96be('0xf'),auth[_0x96be('0xb')](),controller['update']);router[_0x96be('0x16')]('/:id/accept',auth['isAuthenticated'](),controller['accept']);router[_0x96be('0x16')]('/:id/reject',auth[_0x96be('0xb')](),controller[_0x96be('0x17')]);router[_0x96be('0x18')](_0x96be('0xf'),auth[_0x96be('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x8d5e=['post','smsmessage:create','create','/:id/status','update','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','/describe','describe','/:id','isAuthenticated'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x8d5e,0xf6));var _0xe8d5=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x8d5e[_0x37bd26];return _0xe83dc4;};'use strict';var multer=require(_0xe8d5('0x0'));var util=require(_0xe8d5('0x1'));var path=require(_0xe8d5('0x2'));var timeout=require(_0xe8d5('0x3'));var express=require(_0xe8d5('0x4'));var router=express[_0xe8d5('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xe8d5('0x6'));var config=require(_0xe8d5('0x7'));var controller=require(_0xe8d5('0x8'));router[_0xe8d5('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe8d5('0x9')](_0xe8d5('0xa'),auth['isAuthenticated'](),controller[_0xe8d5('0xb')]);router[_0xe8d5('0x9')](_0xe8d5('0xc'),auth[_0xe8d5('0xd')](),controller['show']);router[_0xe8d5('0xe')]('/',auth[_0xe8d5('0xd')](),interaction['tracked']('sms',_0xe8d5('0xf')),controller[_0xe8d5('0x10')]);router['post'](_0xe8d5('0x11'),controller['status']);router['put']('/:id',auth[_0xe8d5('0xd')](),controller[_0xe8d5('0x12')]);router[_0xe8d5('0x13')](_0xe8d5('0x14'),auth[_0xe8d5('0xd')](),controller[_0xe8d5('0x15')]);router[_0xe8d5('0x13')](_0xe8d5('0x16'),auth[_0xe8d5('0xd')](),controller[_0xe8d5('0x17')]);router[_0xe8d5('0x18')]('/:id',auth[_0xe8d5('0xd')](),controller[_0xe8d5('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 001f11c..87bb0cc 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 _0x035a=['STRING','DATE','BOOLEAN','TEXT','sequelize','exports','medium','ENUM','out'];(function(_0x13e168,_0x5a97be){var _0x278370=function(_0x210b7f){while(--_0x210b7f){_0x13e168['push'](_0x13e168['shift']());}};_0x278370(++_0x5a97be);}(_0x035a,0x17e));var _0xa035=function(_0x258834,_0x127a91){_0x258834=_0x258834-0x0;var _0x59a804=_0x035a[_0x258834];return _0x59a804;};'use strict';var Sequelize=require(_0xa035('0x0'));module[_0xa035('0x1')]={'body':{'type':Sequelize['TEXT'](_0xa035('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xa035('0x3')]('in',_0xa035('0x4')),'defaultValue':_0xa035('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0xa035('0x5')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0xa035('0x6')]},'secret':{'type':Sequelize[_0xa035('0x7')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xa035('0x5')]},'providerResponse':{'type':Sequelize[_0xa035('0x8')]}}; \ No newline at end of file +var _0x6e66=['ENUM','out','STRING','DATE','TEXT','sequelize','medium','BOOLEAN'];(function(_0x41cd93,_0x382eb8){var _0x58a7f8=function(_0x19e25f){while(--_0x19e25f){_0x41cd93['push'](_0x41cd93['shift']());}};_0x58a7f8(++_0x382eb8);}(_0x6e66,0x9d));var _0x66e6=function(_0xc0a3d3,_0x2c8d00){_0xc0a3d3=_0xc0a3d3-0x0;var _0x3386e8=_0x6e66[_0xc0a3d3];return _0x3386e8;};'use strict';var Sequelize=require(_0x66e6('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x66e6('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x66e6('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x66e6('0x3')]('in',_0x66e6('0x4')),'defaultValue':_0x66e6('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0x66e6('0x5')](0xbe)},'phone':{'type':Sequelize[_0x66e6('0x5')]},'readAt':{'type':Sequelize[_0x66e6('0x6')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0x66e6('0x5')]},'providerResponse':{'type':Sequelize[_0x66e6('0x7')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 3df086f..ecdbbcb 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 _0x66fa=['delivered','results','infobip','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','redis','defaults','client','http','then','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','save','update','destroy','stack','name','index','map','SmsMessage','rawAttributes','key','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','findAll','rows','catch','show','params','keys','includeAll','include','create','body','find','describe','sms-interactions','accept','sms','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','SmsInteraction','isNil','read1stAt','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','ContactId','sequelize','QueryTypes','SELECT','contact','User','internal','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','SmsInteractionId','interaction','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','email','reject','rejectmessage','SmsAccount','type','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','indexOf','sent'];(function(_0x3c51d4,_0x36ba53){var _0x53c45f=function(_0x3d6683){while(--_0x3d6683){_0x3c51d4['push'](_0x3c51d4['shift']());}};_0x53c45f(++_0x36ba53);}(_0x66fa,0x117));var _0xa66f=function(_0x598a75,_0x1776ff){_0x598a75=_0x598a75-0x0;var _0xce8613=_0x66fa[_0x598a75];return _0xce8613;};'use strict';var emlformat=require(_0xa66f('0x0'));var rimraf=require(_0xa66f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa66f('0x2'));var rp=require(_0xa66f('0x3'));var moment=require(_0xa66f('0x4'));var BPromise=require(_0xa66f('0x5'));var Mustache=require(_0xa66f('0x6'));var util=require(_0xa66f('0x7'));var path=require(_0xa66f('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa66f('0x9'));var fs=require('fs');var fs_extra=require(_0xa66f('0xa'));var _=require(_0xa66f('0xb'));var squel=require(_0xa66f('0xc'));var crypto=require(_0xa66f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa66f('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa66f('0xf'));var Papa=require('papaparse');var Redis=require(_0xa66f('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa66f('0x11'));var logger=require(_0xa66f('0x12'))('api');var utils=require(_0xa66f('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xa66f('0x14'));var db=require('../../mysqldb')['db'];config[_0xa66f('0x15')]=_[_0xa66f('0x16')](config[_0xa66f('0x15')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa66f('0x15')]));require('./smsMessage.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xa66f('0x17')][_0xa66f('0x18')]({'port':0x232c});var client9002=jayson[_0xa66f('0x17')][_0xa66f('0x18')]({'port':0x232a});function respondWithRpcPromise(_0xd348f9,_0x567d4f,_0x5510dc,_0x19b5ac){return new BPromise(function(_0x32d338,_0x295acf){var _0x403f4d=_0x19b5ac||client;return _0x403f4d['request'](_0xd348f9,_0x5510dc)[_0xa66f('0x19')](function(_0x55b59d){logger['info'](_0xa66f('0x1a'),_0x567d4f,_0xa66f('0x1b'));logger[_0xa66f('0x1c')](_0xa66f('0x1d'),_0x567d4f,_0xa66f('0x1b'),JSON[_0xa66f('0x1e')](_0x55b59d));if(_0x55b59d[_0xa66f('0x1f')]){if(_0x55b59d[_0xa66f('0x1f')][_0xa66f('0x20')]===0x1f4){logger[_0xa66f('0x1f')](_0xa66f('0x1a'),_0x567d4f,_0x55b59d[_0xa66f('0x1f')][_0xa66f('0x21')]);return _0x295acf(_0x55b59d[_0xa66f('0x1f')][_0xa66f('0x21')]);}logger['error'](_0xa66f('0x1a'),_0x567d4f,_0x55b59d[_0xa66f('0x1f')][_0xa66f('0x21')]);return _0x32d338(_0x55b59d[_0xa66f('0x1f')]['message']);}else{logger[_0xa66f('0x22')](_0xa66f('0x1a'),_0x567d4f,_0xa66f('0x1b'));_0x32d338(_0x55b59d[_0xa66f('0x23')]['message']);}})['catch'](function(_0xed98b9){logger['error'](_0xa66f('0x1a'),_0x567d4f,_0xed98b9);_0x295acf(_0xed98b9);});});}function respondWithStatusCode(_0xc661f2,_0x384164){_0x384164=_0x384164||0xcc;return function(_0x57da7f){if(_0x57da7f){return _0xc661f2[_0xa66f('0x24')](_0x384164);}return _0xc661f2[_0xa66f('0x25')](_0x384164)[_0xa66f('0x26')]();};}function respondWithResult(_0x238eb2,_0x17c103){_0x17c103=_0x17c103||0xc8;return function(_0x236046){if(_0x236046){return _0x238eb2[_0xa66f('0x25')](_0x17c103)[_0xa66f('0x27')](_0x236046);}};}function respondWithFilteredResult(_0x20ee67,_0x117d03){return function(_0x45f71c){if(_0x45f71c){var _0x63650b=typeof _0x117d03[_0xa66f('0x28')]===_0xa66f('0x29')&&typeof _0x117d03['limit']==='undefined';var _0x38daac=_0x45f71c[_0xa66f('0x2a')];var _0x55f309=_0x63650b?0x0:_0x117d03[_0xa66f('0x28')];var _0x2de5f3=_0x63650b?_0x45f71c['count']:_0x117d03[_0xa66f('0x28')]+_0x117d03[_0xa66f('0x2b')];var _0x9d78d5;if(_0x2de5f3>=_0x38daac){_0x2de5f3=_0x38daac;_0x9d78d5=0xc8;}else{_0x9d78d5=0xce;}_0x20ee67[_0xa66f('0x25')](_0x9d78d5);return _0x20ee67[_0xa66f('0x2c')]('Content-Range',_0x55f309+'-'+_0x2de5f3+'/'+_0x38daac)[_0xa66f('0x27')](_0x45f71c);}return null;};}function patchUpdates(_0x4fcdc1){return function(_0x306b35){try{jsonpatch[_0xa66f('0x2d')](_0x306b35,_0x4fcdc1,!![]);}catch(_0x2e4dc8){return BPromise['reject'](_0x2e4dc8);}return _0x306b35[_0xa66f('0x2e')]();};}function saveUpdates(_0xadc17d,_0x4f1668){return function(_0x1a5d4a){if(_0x1a5d4a){return _0x1a5d4a[_0xa66f('0x2f')](_0xadc17d)[_0xa66f('0x19')](function(_0x3e7ac5){return _0x3e7ac5;});}return null;};}function removeEntity(_0x10a782,_0x2452d2){return function(_0x25c74c){if(_0x25c74c){return _0x25c74c[_0xa66f('0x30')]()[_0xa66f('0x19')](function(){_0x10a782[_0xa66f('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17984d,_0x5bf736){return function(_0x1c7eda){if(!_0x1c7eda){_0x17984d[_0xa66f('0x24')](0x194);}return _0x1c7eda;};}function handleError(_0x9c7756,_0x3b9261){_0x3b9261=_0x3b9261||0x1f4;return function(_0x3722d3){logger[_0xa66f('0x1f')](_0x3722d3[_0xa66f('0x31')]);if(_0x3722d3[_0xa66f('0x32')]){delete _0x3722d3['name'];}_0x9c7756[_0xa66f('0x25')](_0x3b9261)['send'](_0x3722d3);};}exports[_0xa66f('0x33')]=function(_0x45eeb8,_0x2ed1fb){var _0x47b21a={},_0x4d60f9={},_0x1b9174={'count':0x0,'rows':[]};var _0x4214db=_[_0xa66f('0x34')](db[_0xa66f('0x35')][_0xa66f('0x36')],function(_0x581dca){return{'name':_0x581dca['fieldName'],'type':_0x581dca['type'][_0xa66f('0x37')]};});_0x4d60f9['model']=_['map'](_0x4214db,'name');_0x4d60f9[_0xa66f('0x38')]=_['keys'](_0x45eeb8[_0xa66f('0x38')]);_0x4d60f9[_0xa66f('0x39')]=_[_0xa66f('0x3a')](_0x4d60f9[_0xa66f('0x3b')],_0x4d60f9[_0xa66f('0x38')]);_0x47b21a[_0xa66f('0x3c')]=_[_0xa66f('0x3a')](_0x4d60f9[_0xa66f('0x3b')],qs[_0xa66f('0x3d')](_0x45eeb8[_0xa66f('0x38')][_0xa66f('0x3d')]));_0x47b21a[_0xa66f('0x3c')]=_0x47b21a[_0xa66f('0x3c')][_0xa66f('0x3e')]?_0x47b21a['attributes']:_0x4d60f9[_0xa66f('0x3b')];if(!_0x45eeb8[_0xa66f('0x38')]['hasOwnProperty'](_0xa66f('0x3f'))){_0x47b21a['limit']=qs[_0xa66f('0x2b')](_0x45eeb8[_0xa66f('0x38')]['limit']);_0x47b21a[_0xa66f('0x28')]=qs[_0xa66f('0x28')](_0x45eeb8[_0xa66f('0x38')]['offset']);}_0x47b21a[_0xa66f('0x40')]=qs['sort'](_0x45eeb8[_0xa66f('0x38')][_0xa66f('0x41')]);_0x47b21a[_0xa66f('0x42')]=qs[_0xa66f('0x39')](_[_0xa66f('0x43')](_0x45eeb8[_0xa66f('0x38')],_0x4d60f9[_0xa66f('0x39')]),_0x4214db);if(_0x45eeb8['query'][_0xa66f('0x44')]){_0x47b21a[_0xa66f('0x42')]=_[_0xa66f('0x45')](_0x47b21a[_0xa66f('0x42')],{'$or':_[_0xa66f('0x34')](_0x4214db,function(_0x50a5ac){if(_0x50a5ac['type']!==_0xa66f('0x46')){var _0x356b7c={};_0x356b7c[_0x50a5ac[_0xa66f('0x32')]]={'$like':'%'+_0x45eeb8[_0xa66f('0x38')][_0xa66f('0x44')]+'%'};return _0x356b7c;}})});}_0x47b21a=_[_0xa66f('0x45')]({},_0x47b21a,_0x45eeb8['options']);var _0x18f1b5={'where':_0x47b21a[_0xa66f('0x42')]};return db[_0xa66f('0x35')]['count'](_0x18f1b5)['then'](function(_0x4568f7){_0x1b9174[_0xa66f('0x2a')]=_0x4568f7;if(_0x45eeb8[_0xa66f('0x38')]['includeAll']){_0x47b21a['include']=[{'all':!![]}];}return db['SmsMessage'][_0xa66f('0x47')](_0x47b21a);})[_0xa66f('0x19')](function(_0x40d3b6){_0x1b9174[_0xa66f('0x48')]=_0x40d3b6;return _0x1b9174;})[_0xa66f('0x19')](respondWithFilteredResult(_0x2ed1fb,_0x47b21a))[_0xa66f('0x49')](handleError(_0x2ed1fb,null));};exports[_0xa66f('0x4a')]=function(_0x15de06,_0x56758a){var _0x1a299c={'raw':!![],'where':{'id':_0x15de06[_0xa66f('0x4b')]['id']}},_0x962415={};_0x962415[_0xa66f('0x3b')]=_[_0xa66f('0x4c')](db[_0xa66f('0x35')]['rawAttributes']);_0x962415[_0xa66f('0x38')]=_[_0xa66f('0x4c')](_0x15de06[_0xa66f('0x38')]);_0x962415[_0xa66f('0x39')]=_[_0xa66f('0x3a')](_0x962415['model'],_0x962415[_0xa66f('0x38')]);_0x1a299c['attributes']=_[_0xa66f('0x3a')](_0x962415['model'],qs['fields'](_0x15de06[_0xa66f('0x38')][_0xa66f('0x3d')]));_0x1a299c[_0xa66f('0x3c')]=_0x1a299c[_0xa66f('0x3c')][_0xa66f('0x3e')]?_0x1a299c[_0xa66f('0x3c')]:_0x962415['model'];if(_0x15de06[_0xa66f('0x38')][_0xa66f('0x4d')]){_0x1a299c[_0xa66f('0x4e')]=[{'all':!![]}];}_0x1a299c=_[_0xa66f('0x45')]({},_0x1a299c,_0x15de06['options']);return db[_0xa66f('0x35')]['find'](_0x1a299c)[_0xa66f('0x19')](handleEntityNotFound(_0x56758a,null))[_0xa66f('0x19')](respondWithResult(_0x56758a,null))[_0xa66f('0x49')](handleError(_0x56758a,null));};exports[_0xa66f('0x4f')]=function(_0x167015,_0x3a201f){return db[_0xa66f('0x35')]['create'](_0x167015[_0xa66f('0x50')],{})[_0xa66f('0x19')](respondWithResult(_0x3a201f,0xc9))[_0xa66f('0x49')](handleError(_0x3a201f,null));};exports[_0xa66f('0x2f')]=function(_0x38decb,_0x45989a){if(_0x38decb[_0xa66f('0x50')]['id']){delete _0x38decb[_0xa66f('0x50')]['id'];}return db[_0xa66f('0x35')]['find']({'where':{'id':_0x38decb['params']['id']}})[_0xa66f('0x19')](handleEntityNotFound(_0x45989a,null))[_0xa66f('0x19')](saveUpdates(_0x38decb[_0xa66f('0x50')],null))[_0xa66f('0x19')](respondWithResult(_0x45989a,null))[_0xa66f('0x49')](handleError(_0x45989a,null));};exports[_0xa66f('0x30')]=function(_0x8bea2b,_0x4b10cf){return db[_0xa66f('0x35')][_0xa66f('0x51')]({'where':{'id':_0x8bea2b[_0xa66f('0x4b')]['id']}})[_0xa66f('0x19')](handleEntityNotFound(_0x4b10cf,null))['then'](removeEntity(_0x4b10cf,null))[_0xa66f('0x49')](handleError(_0x4b10cf,null));};exports[_0xa66f('0x52')]=function(_0x19ff30,_0x3bf85a){return db[_0xa66f('0x35')][_0xa66f('0x52')]()['then'](respondWithResult(_0x3bf85a,null))['catch'](handleError(_0x3bf85a,null));};var interaction_log=require(_0xa66f('0x12'))(_0xa66f('0x53'));exports[_0xa66f('0x54')]=function(_0x52edb3,_0x442dd1,_0x39fb04){var _0x310d87={'agent':{},'channel':_0xa66f('0x55')};if(_0x52edb3[_0xa66f('0x50')]['id']){delete _0x52edb3[_0xa66f('0x50')]['id'];}_0x52edb3[_0xa66f('0x50')][_0xa66f('0x56')]=!![];_0x52edb3[_0xa66f('0x50')]['readAt']=moment()[_0xa66f('0x57')](_0xa66f('0x58'));_0x52edb3[_0xa66f('0x50')][_0xa66f('0x59')]=_0x52edb3[_0xa66f('0x50')][_0xa66f('0x59')]||_0x52edb3[_0xa66f('0x5a')]['id'];_0x310d87[_0xa66f('0x5b')]['id']=_0x52edb3['body']['UserId'];return db[_0xa66f('0x35')][_0xa66f('0x51')]({'where':{'id':_0x52edb3[_0xa66f('0x4b')]['id'],'UserId':null}})[_0xa66f('0x19')](handleEntityNotFound(_0x442dd1,null))[_0xa66f('0x19')](saveUpdates(_0x52edb3['body'],null))[_0xa66f('0x19')](function(_0x4c2b68){if(_0x4c2b68){_0x310d87[_0xa66f('0x21')]=_0x4c2b68[_0xa66f('0x5c')]({'plain':!![]});return db[_0xa66f('0x5d')][_0xa66f('0x51')]({'where':{'id':_0x4c2b68['SmsInteractionId']}});}return null;})[_0xa66f('0x19')](handleEntityNotFound(_0x442dd1,null))[_0xa66f('0x19')](function(_0x31c11b){if(_0x31c11b){return _0x31c11b[_0xa66f('0x2f')]({'UserId':_0x52edb3[_0xa66f('0x50')][_0xa66f('0x59')],'read1stAt':_[_0xa66f('0x5e')](_0x31c11b[_0xa66f('0x5f')])?moment()[_0xa66f('0x57')](_0xa66f('0x58')):undefined});}return null;})[_0xa66f('0x19')](function(_0x3eb1f5){if(_0x3eb1f5){_0x310d87['interaction']=_0x3eb1f5[_0xa66f('0x5c')]({'plain':!![]});interaction_log[_0xa66f('0x22')](_0xa66f('0x60'),_0x52edb3[_0xa66f('0x5a')]['id'],_0x52edb3[_0xa66f('0x5a')][_0xa66f('0x32')],_0x52edb3[_0xa66f('0x5a')][_0xa66f('0x61')],_0x310d87['interaction']['id'],_0x52edb3[_0xa66f('0x50')]?JSON[_0xa66f('0x1e')](_0x52edb3[_0xa66f('0x50')]):_0xa66f('0x62'));return respondWithRpcPromise(_0xa66f('0x63'),_0xa66f('0x64'),_0x310d87);}return null;})[_0xa66f('0x19')](function(_0x1f14d1){var _0x4b5785='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1f14d1[_0xa66f('0x21')][_0xa66f('0x65')];return db[_0xa66f('0x66')]['query'](_0x4b5785,{'type':db['Sequelize'][_0xa66f('0x67')][_0xa66f('0x68')],'raw':!![]})[_0xa66f('0x19')](function(_0x340dba){return _0x340dba;});})['then'](function(_0x43be19){if(_0x43be19){_0x310d87[_0xa66f('0x21')][_0xa66f('0x69')]=_0x43be19[0x0];if(!_0x52edb3[_0xa66f('0x50')][_0xa66f('0x59')])return;return db[_0xa66f('0x6a')][_0xa66f('0x51')]({'where':{'id':_0x52edb3[_0xa66f('0x50')]['UserId'],'role':_0xa66f('0x5b')},'attributes':['id',_0xa66f('0x32'),'fullname','email',_0xa66f('0x6b')],'raw':!![]});}return null;})[_0xa66f('0x19')](function(_0x4ee8e7){if(!_0x4ee8e7)return null;_0x310d87[_0xa66f('0x21')]['agent']=_0x4ee8e7;return _0x310d87;})[_0xa66f('0x19')](function(_0x558380){if(_0x558380){if(_0x52edb3['body']['manual']){_0x310d87[_0xa66f('0x21')][_0xa66f('0x6c')]=util[_0xa66f('0x57')](_0xa66f('0x6d'),_0x52edb3[_0xa66f('0x5a')][_0xa66f('0x32')]);_0x310d87[_0xa66f('0x21')][_0xa66f('0x6e')]=_0x310d87[_0xa66f('0x6e')];_0x310d87[_0xa66f('0x21')][_0xa66f('0x6f')]=_0x310d87[_0xa66f('0x6e')];_0x310d87[_0xa66f('0x21')][_0xa66f('0x70')]=_0xa66f('0x54');return respondWithRpcPromise(_0xa66f('0x71'),'EventManager',{'event':_0xa66f('0x72'),'message':_0x310d87['message']},client9002)[_0xa66f('0x19')](function(){return _0x310d87;});}return _0x310d87;}return null;})['then'](respondWithResult(_0x442dd1,null))[_0xa66f('0x49')](handleError(_0x442dd1,null));};var interaction_log=require(_0xa66f('0x12'))(_0xa66f('0x53'));exports['reject']=function(_0x4ea501,_0x1a1d63,_0x30bbee){var _0x38b869={'agent':{},'channel':_0xa66f('0x55')};if(_0x4ea501[_0xa66f('0x50')]['id']){delete _0x4ea501[_0xa66f('0x50')]['id'];}_0x4ea501[_0xa66f('0x50')]['UserId']=_0x4ea501[_0xa66f('0x50')][_0xa66f('0x59')]||_0x4ea501[_0xa66f('0x5a')]['id'];_0x38b869[_0xa66f('0x5b')]['id']=_0x4ea501[_0xa66f('0x50')][_0xa66f('0x59')];return db[_0xa66f('0x35')][_0xa66f('0x51')]({'where':{'id':_0x4ea501[_0xa66f('0x4b')]['id'],'UserId':null}})[_0xa66f('0x19')](handleEntityNotFound(_0x1a1d63,null))[_0xa66f('0x19')](function(_0x9c7e02){if(_0x9c7e02){_0x38b869[_0xa66f('0x21')]=_0x9c7e02['get']({'plain':!![]});return db[_0xa66f('0x5d')][_0xa66f('0x51')]({'where':{'id':_0x9c7e02[_0xa66f('0x73')]}});}return null;})[_0xa66f('0x19')](handleEntityNotFound(_0x1a1d63,null))[_0xa66f('0x19')](function(_0x31db5c){if(_0x31db5c){_0x38b869[_0xa66f('0x74')]=_0x31db5c[_0xa66f('0x5c')]({'plain':!![]});interaction_log[_0xa66f('0x22')]('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4ea501[_0xa66f('0x5a')]['id'],_0x4ea501['user'][_0xa66f('0x32')],_0x4ea501['user'][_0xa66f('0x61')],_0x38b869['interaction']['id'],_0x4ea501[_0xa66f('0x50')]?JSON['stringify'](_0x4ea501[_0xa66f('0x50')]):_0xa66f('0x62'));return respondWithRpcPromise(_0xa66f('0x75'),_0xa66f('0x76'),_0x38b869);}return null;})[_0xa66f('0x19')](function(_0x4539ab){var _0x4d7bae=_0xa66f('0x77')+_0x4539ab[_0xa66f('0x21')][_0xa66f('0x65')];return db['sequelize'][_0xa66f('0x38')](_0x4d7bae,{'type':db[_0xa66f('0x78')]['QueryTypes'][_0xa66f('0x68')],'raw':!![]})[_0xa66f('0x19')](function(_0x5ee6d5){return _0x5ee6d5;});})['then'](function(_0x125bf4){if(_0x125bf4){_0x38b869[_0xa66f('0x21')][_0xa66f('0x69')]=_0x125bf4[0x0];if(!_0x4ea501[_0xa66f('0x50')][_0xa66f('0x59')])return;return db['User'][_0xa66f('0x51')]({'where':{'id':_0x4ea501[_0xa66f('0x50')]['UserId'],'role':_0xa66f('0x5b')},'attributes':['id',_0xa66f('0x32'),'fullname',_0xa66f('0x79'),_0xa66f('0x6b')],'raw':!![]});}return null;})[_0xa66f('0x19')](function(_0x3a30ba){if(!_0x3a30ba)return null;_0x38b869[_0xa66f('0x21')]['agent']=_0x3a30ba;return _0x38b869;})[_0xa66f('0x19')](function(_0x247b26){if(_0x247b26){_0x247b26[_0xa66f('0x21')][_0xa66f('0x6c')]=util[_0xa66f('0x57')](_0xa66f('0x6d'),_0x4ea501['user'][_0xa66f('0x32')]);_0x247b26[_0xa66f('0x21')][_0xa66f('0x6e')]=_0x38b869[_0xa66f('0x6e')];_0x247b26[_0xa66f('0x21')][_0xa66f('0x6f')]=_0x38b869[_0xa66f('0x6e')];_0x247b26['message']['event']=_0xa66f('0x7a');respondWithRpcPromise('EventManager',_0xa66f('0x71'),{'event':_0xa66f('0x7b'),'message':_0x247b26['message']},client9002);return _0x38b869;}return null;})[_0xa66f('0x19')](respondWithResult(_0x1a1d63,null))[_0xa66f('0x49')](handleError(_0x1a1d63,null));};exports[_0xa66f('0x25')]=function(_0x598586,_0x4a2409,_0xfe65cc){if(_0x598586['body']['id']){delete _0x598586[_0xa66f('0x50')]['id'];}var _0x275957;return db[_0xa66f('0x35')]['find']({'where':{'id':_0x598586[_0xa66f('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4a2409,null))[_0xa66f('0x19')](function(_0xfdb067){if(_0xfdb067){_0x275957=_0xfdb067;return db[_0xa66f('0x7c')][_0xa66f('0x51')]({'where':{'id':_0xfdb067['SmsAccountId']}});}})[_0xa66f('0x19')](handleEntityNotFound(_0x4a2409,null))[_0xa66f('0x19')](function(_0x30e351){if(_0x30e351){logger[_0xa66f('0x1c')](_0xa66f('0x1d'),_0xa66f('0x25'),'received\x20delivery\x20report\x20from',_0x30e351[_0xa66f('0x7d')],util[_0xa66f('0x7e')](_0x598586[_0xa66f('0x50')],{'showHidden':![],'depth':null}));switch(_0x30e351[_0xa66f('0x7d')]){case _0xa66f('0x7f'):if(_0x598586['body']['MessageSid']&&_0x598586[_0xa66f('0x50')][_0xa66f('0x80')]===_0x275957[_0xa66f('0x81')]){return _0x275957[_0xa66f('0x2f')]({'read':!![]});}else{logger[_0xa66f('0x1f')](_0xa66f('0x82'),_0xa66f('0x25'),_0xa66f('0x7f'),util[_0xa66f('0x7e')](_0x598586[_0xa66f('0x50')],{'showHidden':![],'depth':null}));}break;case _0xa66f('0x83'):if(_0x598586[_0xa66f('0x50')]['MessageUUID']&&_0x598586[_0xa66f('0x50')][_0xa66f('0x84')]===_0x275957['messageId']&&_[_0xa66f('0x85')]([_0xa66f('0x86'),_0xa66f('0x87')],_0x598586['body']['Status'])>=0x0){return _0x275957[_0xa66f('0x2f')]({'read':!![]});}else{logger['error'](_0xa66f('0x82'),_0xa66f('0x25'),'plivio',util[_0xa66f('0x7e')](_0x598586[_0xa66f('0x50')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0xa568ed=_0x598586[_0xa66f('0x50')][_0xa66f('0x88')][0x0];if(_0xa568ed[_0xa66f('0x25')]['groupName']==='DELIVERED'){return _0x275957[_0xa66f('0x2f')]({'read':!![]});}else{logger[_0xa66f('0x1f')](_0xa66f('0x82'),_0xa66f('0x25'),_0xa66f('0x89'),util[_0xa66f('0x7e')](_0x598586[_0xa66f('0x50')],{'showHidden':![],'depth':null}));}break;}return _0x275957;}})[_0xa66f('0x19')](respondWithResult(_0x4a2409,null))[_0xa66f('0x49')](handleError(_0x4a2409,null));}; \ No newline at end of file +var _0x8c8c=['error','message','info','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','stack','name','send','index','map','SmsMessage','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','pick','where','merge','VIRTUAL','options','findAll','rows','params','includeAll','create','body','find','describe','accept','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','SmsInteraction','SmsInteractionId','isNil','format','interaction','[SMSMESSAGE: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','contact','User','fullname','email','internal','manual','interface','channel','motionChannel','event','EventManager','acceptmessage','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','Sequelize','rejectmessage','SmsAccount','SmsAccountId','inspect','SmsAccount,\x20%s,\x20%s,\x20%s','twilio','MessageUUID','messageId','sent','delivered','Status','plivio','infobip','results','groupName','DELIVERED','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./smsMessage.socket','register','client','http','request','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','code'];(function(_0x5b691f,_0x42846e){var _0x42cb0e=function(_0x2d8f42){while(--_0x2d8f42){_0x5b691f['push'](_0x5b691f['shift']());}};_0x42cb0e(++_0x42846e);}(_0x8c8c,0x185));var _0xc8c8=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8c8c[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xc8c8('0x0'));var rimraf=require(_0xc8c8('0x1'));var zipdir=require(_0xc8c8('0x2'));var jsonpatch=require(_0xc8c8('0x3'));var rp=require('request-promise');var moment=require(_0xc8c8('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc8c8('0x5'));var path=require(_0xc8c8('0x6'));var sox=require(_0xc8c8('0x7'));var csv=require(_0xc8c8('0x8'));var ejs=require(_0xc8c8('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc8c8('0xa'));var squel=require(_0xc8c8('0xb'));var crypto=require(_0xc8c8('0xc'));var jsforce=require(_0xc8c8('0xd'));var deskjs=require(_0xc8c8('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc8c8('0xf'));var Redis=require(_0xc8c8('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xc8c8('0x11'));var as=require(_0xc8c8('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc8c8('0x13'))('api');var utils=require(_0xc8c8('0x14'));var config=require(_0xc8c8('0x15'));var licenseUtil=require(_0xc8c8('0x16'));var db=require(_0xc8c8('0x17'))['db'];config[_0xc8c8('0x18')]=_['defaults'](config['redis'],{'host':_0xc8c8('0x19'),'port':0x18eb});var socket=require(_0xc8c8('0x1a'))(new Redis(config[_0xc8c8('0x18')]));require(_0xc8c8('0x1b'))[_0xc8c8('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0xc8c8('0x1d')][_0xc8c8('0x1e')]({'port':0x232c});var client9002=jayson[_0xc8c8('0x1d')][_0xc8c8('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x172e5b,_0x4c1a64,_0x42d576,_0x203595){return new BPromise(function(_0x2ae2dd,_0xc51cfd){var _0x3eb356=_0x203595||client;return _0x3eb356[_0xc8c8('0x1f')](_0x172e5b,_0x42d576)['then'](function(_0x13178b){logger['info'](_0xc8c8('0x20'),_0x4c1a64,_0xc8c8('0x21'));logger[_0xc8c8('0x22')](_0xc8c8('0x23'),_0x4c1a64,_0xc8c8('0x21'),JSON['stringify'](_0x13178b));if(_0x13178b['error']){if(_0x13178b['error'][_0xc8c8('0x24')]===0x1f4){logger[_0xc8c8('0x25')]('SmsMessage,\x20%s,\x20%s',_0x4c1a64,_0x13178b[_0xc8c8('0x25')]['message']);return _0xc51cfd(_0x13178b[_0xc8c8('0x25')][_0xc8c8('0x26')]);}logger[_0xc8c8('0x25')](_0xc8c8('0x20'),_0x4c1a64,_0x13178b[_0xc8c8('0x25')]['message']);return _0x2ae2dd(_0x13178b['error']['message']);}else{logger[_0xc8c8('0x27')]('SmsMessage,\x20%s,\x20%s',_0x4c1a64,_0xc8c8('0x21'));_0x2ae2dd(_0x13178b[_0xc8c8('0x28')][_0xc8c8('0x26')]);}})[_0xc8c8('0x29')](function(_0x5281c9){logger[_0xc8c8('0x25')](_0xc8c8('0x20'),_0x4c1a64,_0x5281c9);_0xc51cfd(_0x5281c9);});});}function respondWithStatusCode(_0x5dd6be,_0x49c872){_0x49c872=_0x49c872||0xcc;return function(_0x2a00c1){if(_0x2a00c1){return _0x5dd6be[_0xc8c8('0x2a')](_0x49c872);}return _0x5dd6be[_0xc8c8('0x2b')](_0x49c872)[_0xc8c8('0x2c')]();};}function respondWithResult(_0xbb7c10,_0x297e34){_0x297e34=_0x297e34||0xc8;return function(_0x413bd2){if(_0x413bd2){return _0xbb7c10[_0xc8c8('0x2b')](_0x297e34)[_0xc8c8('0x2d')](_0x413bd2);}};}function respondWithFilteredResult(_0x4d9d3d,_0xbaf25f){return function(_0x47327a){if(_0x47327a){var _0x4fc92f=typeof _0xbaf25f[_0xc8c8('0x2e')]===_0xc8c8('0x2f')&&typeof _0xbaf25f[_0xc8c8('0x30')]===_0xc8c8('0x2f');var _0xbeb70d=_0x47327a[_0xc8c8('0x31')];var _0x2d2e6e=_0x4fc92f?0x0:_0xbaf25f[_0xc8c8('0x2e')];var _0x286666=_0x4fc92f?_0x47327a['count']:_0xbaf25f[_0xc8c8('0x2e')]+_0xbaf25f[_0xc8c8('0x30')];var _0x419bca;if(_0x286666>=_0xbeb70d){_0x286666=_0xbeb70d;_0x419bca=0xc8;}else{_0x419bca=0xce;}_0x4d9d3d[_0xc8c8('0x2b')](_0x419bca);return _0x4d9d3d[_0xc8c8('0x32')]('Content-Range',_0x2d2e6e+'-'+_0x286666+'/'+_0xbeb70d)['json'](_0x47327a);}return null;};}function patchUpdates(_0x197f41){return function(_0x5b9192){try{jsonpatch[_0xc8c8('0x33')](_0x5b9192,_0x197f41,!![]);}catch(_0x10a760){return BPromise[_0xc8c8('0x34')](_0x10a760);}return _0x5b9192[_0xc8c8('0x35')]();};}function saveUpdates(_0x1cffe4,_0x1bcf42){return function(_0x399cd5){if(_0x399cd5){return _0x399cd5[_0xc8c8('0x36')](_0x1cffe4)[_0xc8c8('0x37')](function(_0x11632e){return _0x11632e;});}return null;};}function removeEntity(_0x28be18,_0x2bccf5){return function(_0x33616c){if(_0x33616c){return _0x33616c['destroy']()[_0xc8c8('0x37')](function(){_0x28be18[_0xc8c8('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x385413,_0x44d193){return function(_0x561013){if(!_0x561013){_0x385413[_0xc8c8('0x2a')](0x194);}return _0x561013;};}function handleError(_0x4643c2,_0x4625fc){_0x4625fc=_0x4625fc||0x1f4;return function(_0x555284){logger['error'](_0x555284[_0xc8c8('0x38')]);if(_0x555284[_0xc8c8('0x39')]){delete _0x555284[_0xc8c8('0x39')];}_0x4643c2[_0xc8c8('0x2b')](_0x4625fc)[_0xc8c8('0x3a')](_0x555284);};}exports[_0xc8c8('0x3b')]=function(_0x396e2d,_0x505bc0){var _0x1bc03c={},_0x37bfbc={},_0x39ee4={'count':0x0,'rows':[]};var _0x5bba3c=_[_0xc8c8('0x3c')](db[_0xc8c8('0x3d')][_0xc8c8('0x3e')],function(_0x409713){return{'name':_0x409713[_0xc8c8('0x3f')],'type':_0x409713[_0xc8c8('0x40')][_0xc8c8('0x41')]};});_0x37bfbc['model']=_[_0xc8c8('0x3c')](_0x5bba3c,_0xc8c8('0x39'));_0x37bfbc['query']=_[_0xc8c8('0x42')](_0x396e2d[_0xc8c8('0x43')]);_0x37bfbc[_0xc8c8('0x44')]=_[_0xc8c8('0x45')](_0x37bfbc[_0xc8c8('0x46')],_0x37bfbc[_0xc8c8('0x43')]);_0x1bc03c[_0xc8c8('0x47')]=_[_0xc8c8('0x45')](_0x37bfbc[_0xc8c8('0x46')],qs[_0xc8c8('0x48')](_0x396e2d[_0xc8c8('0x43')][_0xc8c8('0x48')]));_0x1bc03c[_0xc8c8('0x47')]=_0x1bc03c[_0xc8c8('0x47')]['length']?_0x1bc03c[_0xc8c8('0x47')]:_0x37bfbc[_0xc8c8('0x46')];if(!_0x396e2d['query'][_0xc8c8('0x49')](_0xc8c8('0x4a'))){_0x1bc03c[_0xc8c8('0x30')]=qs[_0xc8c8('0x30')](_0x396e2d['query']['limit']);_0x1bc03c[_0xc8c8('0x2e')]=qs[_0xc8c8('0x2e')](_0x396e2d['query'][_0xc8c8('0x2e')]);}_0x1bc03c['order']=qs[_0xc8c8('0x4b')](_0x396e2d[_0xc8c8('0x43')][_0xc8c8('0x4b')]);_0x1bc03c['where']=qs[_0xc8c8('0x44')](_[_0xc8c8('0x4c')](_0x396e2d[_0xc8c8('0x43')],_0x37bfbc[_0xc8c8('0x44')]),_0x5bba3c);if(_0x396e2d[_0xc8c8('0x43')]['filter']){_0x1bc03c[_0xc8c8('0x4d')]=_[_0xc8c8('0x4e')](_0x1bc03c[_0xc8c8('0x4d')],{'$or':_['map'](_0x5bba3c,function(_0x19de06){if(_0x19de06['type']!==_0xc8c8('0x4f')){var _0x87013={};_0x87013[_0x19de06[_0xc8c8('0x39')]]={'$like':'%'+_0x396e2d[_0xc8c8('0x43')]['filter']+'%'};return _0x87013;}})});}_0x1bc03c=_[_0xc8c8('0x4e')]({},_0x1bc03c,_0x396e2d[_0xc8c8('0x50')]);var _0x287f69={'where':_0x1bc03c['where']};return db[_0xc8c8('0x3d')]['count'](_0x287f69)['then'](function(_0x31ad82){_0x39ee4[_0xc8c8('0x31')]=_0x31ad82;if(_0x396e2d[_0xc8c8('0x43')]['includeAll']){_0x1bc03c['include']=[{'all':!![]}];}return db['SmsMessage'][_0xc8c8('0x51')](_0x1bc03c);})[_0xc8c8('0x37')](function(_0x52bd63){_0x39ee4[_0xc8c8('0x52')]=_0x52bd63;return _0x39ee4;})['then'](respondWithFilteredResult(_0x505bc0,_0x1bc03c))['catch'](handleError(_0x505bc0,null));};exports['show']=function(_0x2e6b85,_0x52a334){var _0x196e0c={'raw':!![],'where':{'id':_0x2e6b85[_0xc8c8('0x53')]['id']}},_0x5e1058={};_0x5e1058[_0xc8c8('0x46')]=_[_0xc8c8('0x42')](db['SmsMessage'][_0xc8c8('0x3e')]);_0x5e1058[_0xc8c8('0x43')]=_['keys'](_0x2e6b85[_0xc8c8('0x43')]);_0x5e1058['filters']=_[_0xc8c8('0x45')](_0x5e1058[_0xc8c8('0x46')],_0x5e1058[_0xc8c8('0x43')]);_0x196e0c[_0xc8c8('0x47')]=_[_0xc8c8('0x45')](_0x5e1058[_0xc8c8('0x46')],qs[_0xc8c8('0x48')](_0x2e6b85[_0xc8c8('0x43')]['fields']));_0x196e0c[_0xc8c8('0x47')]=_0x196e0c[_0xc8c8('0x47')]['length']?_0x196e0c['attributes']:_0x5e1058['model'];if(_0x2e6b85[_0xc8c8('0x43')][_0xc8c8('0x54')]){_0x196e0c['include']=[{'all':!![]}];}_0x196e0c=_[_0xc8c8('0x4e')]({},_0x196e0c,_0x2e6b85[_0xc8c8('0x50')]);return db[_0xc8c8('0x3d')]['find'](_0x196e0c)[_0xc8c8('0x37')](handleEntityNotFound(_0x52a334,null))['then'](respondWithResult(_0x52a334,null))['catch'](handleError(_0x52a334,null));};exports[_0xc8c8('0x55')]=function(_0x2e5dd0,_0x5d4626){return db[_0xc8c8('0x3d')]['create'](_0x2e5dd0['body'],{})[_0xc8c8('0x37')](respondWithResult(_0x5d4626,0xc9))[_0xc8c8('0x29')](handleError(_0x5d4626,null));};exports[_0xc8c8('0x36')]=function(_0x5add6d,_0x1e3acc){if(_0x5add6d[_0xc8c8('0x56')]['id']){delete _0x5add6d[_0xc8c8('0x56')]['id'];}return db[_0xc8c8('0x3d')][_0xc8c8('0x57')]({'where':{'id':_0x5add6d['params']['id']}})[_0xc8c8('0x37')](handleEntityNotFound(_0x1e3acc,null))[_0xc8c8('0x37')](saveUpdates(_0x5add6d['body'],null))[_0xc8c8('0x37')](respondWithResult(_0x1e3acc,null))[_0xc8c8('0x29')](handleError(_0x1e3acc,null));};exports['destroy']=function(_0x1d7691,_0x1d7087){return db[_0xc8c8('0x3d')][_0xc8c8('0x57')]({'where':{'id':_0x1d7691[_0xc8c8('0x53')]['id']}})[_0xc8c8('0x37')](handleEntityNotFound(_0x1d7087,null))[_0xc8c8('0x37')](removeEntity(_0x1d7087,null))['catch'](handleError(_0x1d7087,null));};exports[_0xc8c8('0x58')]=function(_0x4fae54,_0x2b484b){return db[_0xc8c8('0x3d')][_0xc8c8('0x58')]()[_0xc8c8('0x37')](respondWithResult(_0x2b484b,null))[_0xc8c8('0x29')](handleError(_0x2b484b,null));};var interaction_log=require(_0xc8c8('0x13'))('sms-interactions');exports[_0xc8c8('0x59')]=function(_0x3d8442,_0x3b6e83,_0x49b730){var _0x1a6535={'agent':{},'channel':'sms'};if(_0x3d8442[_0xc8c8('0x56')]['id']){delete _0x3d8442['body']['id'];}_0x3d8442['body']['read']=!![];_0x3d8442[_0xc8c8('0x56')][_0xc8c8('0x5a')]=moment()['format'](_0xc8c8('0x5b'));_0x3d8442[_0xc8c8('0x56')][_0xc8c8('0x5c')]=_0x3d8442[_0xc8c8('0x56')][_0xc8c8('0x5c')]||_0x3d8442[_0xc8c8('0x5d')]['id'];_0x1a6535[_0xc8c8('0x5e')]['id']=_0x3d8442[_0xc8c8('0x56')][_0xc8c8('0x5c')];return db[_0xc8c8('0x3d')][_0xc8c8('0x57')]({'where':{'id':_0x3d8442[_0xc8c8('0x53')]['id'],'UserId':null}})[_0xc8c8('0x37')](handleEntityNotFound(_0x3b6e83,null))[_0xc8c8('0x37')](saveUpdates(_0x3d8442[_0xc8c8('0x56')],null))['then'](function(_0x176e9e){if(_0x176e9e){_0x1a6535[_0xc8c8('0x26')]=_0x176e9e[_0xc8c8('0x5f')]({'plain':!![]});return db[_0xc8c8('0x60')]['find']({'where':{'id':_0x176e9e[_0xc8c8('0x61')]}});}return null;})['then'](handleEntityNotFound(_0x3b6e83,null))['then'](function(_0x11ee11){if(_0x11ee11){return _0x11ee11[_0xc8c8('0x36')]({'UserId':_0x3d8442[_0xc8c8('0x56')]['UserId'],'read1stAt':_[_0xc8c8('0x62')](_0x11ee11['read1stAt'])?moment()[_0xc8c8('0x63')](_0xc8c8('0x5b')):undefined});}return null;})[_0xc8c8('0x37')](function(_0x4f2566){if(_0x4f2566){_0x1a6535[_0xc8c8('0x64')]=_0x4f2566[_0xc8c8('0x5f')]({'plain':!![]});interaction_log[_0xc8c8('0x27')](_0xc8c8('0x65'),_0x3d8442[_0xc8c8('0x5d')]['id'],_0x3d8442[_0xc8c8('0x5d')][_0xc8c8('0x39')],_0x3d8442[_0xc8c8('0x5d')][_0xc8c8('0x66')],_0x1a6535[_0xc8c8('0x64')]['id'],_0x3d8442[_0xc8c8('0x56')]?JSON[_0xc8c8('0x67')](_0x3d8442[_0xc8c8('0x56')]):_0xc8c8('0x68'));return respondWithRpcPromise('AcceptMessage',_0xc8c8('0x69'),_0x1a6535);}return null;})[_0xc8c8('0x37')](function(_0x5bc824){var _0x5e1fef=_0xc8c8('0x6a')+_0x5bc824['message'][_0xc8c8('0x6b')];return db[_0xc8c8('0x6c')][_0xc8c8('0x43')](_0x5e1fef,{'type':db['Sequelize'][_0xc8c8('0x6d')][_0xc8c8('0x6e')],'raw':!![]})[_0xc8c8('0x37')](function(_0x427dc5){return _0x427dc5;});})['then'](function(_0x2801fb){if(_0x2801fb){_0x1a6535[_0xc8c8('0x26')][_0xc8c8('0x6f')]=_0x2801fb[0x0];if(!_0x3d8442['body']['UserId'])return;return db[_0xc8c8('0x70')][_0xc8c8('0x57')]({'where':{'id':_0x3d8442[_0xc8c8('0x56')]['UserId'],'role':_0xc8c8('0x5e')},'attributes':['id',_0xc8c8('0x39'),_0xc8c8('0x71'),_0xc8c8('0x72'),_0xc8c8('0x73')],'raw':!![]});}return null;})[_0xc8c8('0x37')](function(_0x109936){if(!_0x109936)return null;_0x1a6535[_0xc8c8('0x26')][_0xc8c8('0x5e')]=_0x109936;return _0x1a6535;})['then'](function(_0x2d6440){if(_0x2d6440){if(_0x3d8442[_0xc8c8('0x56')][_0xc8c8('0x74')]){_0x1a6535[_0xc8c8('0x26')][_0xc8c8('0x75')]=util[_0xc8c8('0x63')]('SIP/%s',_0x3d8442[_0xc8c8('0x5d')][_0xc8c8('0x39')]);_0x1a6535[_0xc8c8('0x26')][_0xc8c8('0x76')]=_0x1a6535['channel'];_0x1a6535[_0xc8c8('0x26')][_0xc8c8('0x77')]=_0x1a6535['channel'];_0x1a6535[_0xc8c8('0x26')][_0xc8c8('0x78')]=_0xc8c8('0x59');return respondWithRpcPromise(_0xc8c8('0x79'),_0xc8c8('0x79'),{'event':_0xc8c8('0x7a'),'message':_0x1a6535['message']},client9002)['then'](function(){return _0x1a6535;});}return _0x1a6535;}return null;})[_0xc8c8('0x37')](respondWithResult(_0x3b6e83,null))[_0xc8c8('0x29')](handleError(_0x3b6e83,null));};var interaction_log=require('../../config/logger')('sms-interactions');exports[_0xc8c8('0x34')]=function(_0x5c1b08,_0x3e155e,_0x170320){var _0x50c972={'agent':{},'channel':'sms'};if(_0x5c1b08[_0xc8c8('0x56')]['id']){delete _0x5c1b08[_0xc8c8('0x56')]['id'];}_0x5c1b08['body'][_0xc8c8('0x5c')]=_0x5c1b08['body'][_0xc8c8('0x5c')]||_0x5c1b08[_0xc8c8('0x5d')]['id'];_0x50c972['agent']['id']=_0x5c1b08[_0xc8c8('0x56')][_0xc8c8('0x5c')];return db['SmsMessage'][_0xc8c8('0x57')]({'where':{'id':_0x5c1b08[_0xc8c8('0x53')]['id'],'UserId':null}})[_0xc8c8('0x37')](handleEntityNotFound(_0x3e155e,null))[_0xc8c8('0x37')](function(_0x1bfb50){if(_0x1bfb50){_0x50c972['message']=_0x1bfb50['get']({'plain':!![]});return db[_0xc8c8('0x60')][_0xc8c8('0x57')]({'where':{'id':_0x1bfb50['SmsInteractionId']}});}return null;})[_0xc8c8('0x37')](handleEntityNotFound(_0x3e155e,null))['then'](function(_0x5c52e4){if(_0x5c52e4){_0x50c972[_0xc8c8('0x64')]=_0x5c52e4[_0xc8c8('0x5f')]({'plain':!![]});interaction_log[_0xc8c8('0x27')](_0xc8c8('0x7b'),_0x5c1b08[_0xc8c8('0x5d')]['id'],_0x5c1b08[_0xc8c8('0x5d')][_0xc8c8('0x39')],_0x5c1b08[_0xc8c8('0x5d')]['role'],_0x50c972[_0xc8c8('0x64')]['id'],_0x5c1b08[_0xc8c8('0x56')]?JSON['stringify'](_0x5c1b08[_0xc8c8('0x56')]):_0xc8c8('0x68'));return respondWithRpcPromise(_0xc8c8('0x7c'),'rejectMessage',_0x50c972);}return null;})[_0xc8c8('0x37')](function(_0x344c2f){var _0x96e54=_0xc8c8('0x6a')+_0x344c2f[_0xc8c8('0x26')]['ContactId'];return db['sequelize'][_0xc8c8('0x43')](_0x96e54,{'type':db[_0xc8c8('0x7d')][_0xc8c8('0x6d')][_0xc8c8('0x6e')],'raw':!![]})[_0xc8c8('0x37')](function(_0x3e6815){return _0x3e6815;});})[_0xc8c8('0x37')](function(_0x1f143c){if(_0x1f143c){_0x50c972['message']['contact']=_0x1f143c[0x0];if(!_0x5c1b08['body'][_0xc8c8('0x5c')])return;return db[_0xc8c8('0x70')][_0xc8c8('0x57')]({'where':{'id':_0x5c1b08[_0xc8c8('0x56')]['UserId'],'role':_0xc8c8('0x5e')},'attributes':['id','name',_0xc8c8('0x71'),_0xc8c8('0x72'),'internal'],'raw':!![]});}return null;})[_0xc8c8('0x37')](function(_0x21a6fe){if(!_0x21a6fe)return null;_0x50c972[_0xc8c8('0x26')][_0xc8c8('0x5e')]=_0x21a6fe;return _0x50c972;})['then'](function(_0x19fc5c){if(_0x19fc5c){_0x19fc5c['message'][_0xc8c8('0x75')]=util[_0xc8c8('0x63')]('SIP/%s',_0x5c1b08['user']['name']);_0x19fc5c[_0xc8c8('0x26')][_0xc8c8('0x76')]=_0x50c972['channel'];_0x19fc5c[_0xc8c8('0x26')][_0xc8c8('0x77')]=_0x50c972[_0xc8c8('0x76')];_0x19fc5c[_0xc8c8('0x26')][_0xc8c8('0x78')]=_0xc8c8('0x34');respondWithRpcPromise(_0xc8c8('0x79'),_0xc8c8('0x79'),{'event':_0xc8c8('0x7e'),'message':_0x19fc5c['message']},client9002);return _0x50c972;}return null;})[_0xc8c8('0x37')](respondWithResult(_0x3e155e,null))[_0xc8c8('0x29')](handleError(_0x3e155e,null));};exports['status']=function(_0x27fcdf,_0x2d8256,_0x3fb1a8){if(_0x27fcdf[_0xc8c8('0x56')]['id']){delete _0x27fcdf['body']['id'];}var _0x52c218;return db[_0xc8c8('0x3d')]['find']({'where':{'id':_0x27fcdf['params']['id']}})[_0xc8c8('0x37')](handleEntityNotFound(_0x2d8256,null))['then'](function(_0x535848){if(_0x535848){_0x52c218=_0x535848;return db[_0xc8c8('0x7f')][_0xc8c8('0x57')]({'where':{'id':_0x535848[_0xc8c8('0x80')]}});}})[_0xc8c8('0x37')](handleEntityNotFound(_0x2d8256,null))['then'](function(_0xd4484c){if(_0xd4484c){logger[_0xc8c8('0x22')](_0xc8c8('0x23'),_0xc8c8('0x2b'),'received\x20delivery\x20report\x20from',_0xd4484c[_0xc8c8('0x40')],util[_0xc8c8('0x81')](_0x27fcdf[_0xc8c8('0x56')],{'showHidden':![],'depth':null}));switch(_0xd4484c[_0xc8c8('0x40')]){case'twilio':if(_0x27fcdf[_0xc8c8('0x56')]['MessageSid']&&_0x27fcdf['body']['MessageSid']===_0x52c218['messageId']){return _0x52c218[_0xc8c8('0x36')]({'read':!![]});}else{logger[_0xc8c8('0x25')](_0xc8c8('0x82'),_0xc8c8('0x2b'),_0xc8c8('0x83'),util['inspect'](_0x27fcdf[_0xc8c8('0x56')],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x27fcdf[_0xc8c8('0x56')]['MessageUUID']&&_0x27fcdf['body'][_0xc8c8('0x84')]===_0x52c218[_0xc8c8('0x85')]&&_['indexOf']([_0xc8c8('0x86'),_0xc8c8('0x87')],_0x27fcdf[_0xc8c8('0x56')][_0xc8c8('0x88')])>=0x0){return _0x52c218[_0xc8c8('0x36')]({'read':!![]});}else{logger['error'](_0xc8c8('0x82'),_0xc8c8('0x2b'),_0xc8c8('0x89'),util[_0xc8c8('0x81')](_0x27fcdf['body'],{'showHidden':![],'depth':null}));}break;case _0xc8c8('0x8a'):var _0xc226f2=_0x27fcdf[_0xc8c8('0x56')][_0xc8c8('0x8b')][0x0];if(_0xc226f2['status'][_0xc8c8('0x8c')]===_0xc8c8('0x8d')){return _0x52c218[_0xc8c8('0x36')]({'read':!![]});}else{logger[_0xc8c8('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xc8c8('0x2b'),_0xc8c8('0x8a'),util[_0xc8c8('0x81')](_0x27fcdf[_0xc8c8('0x56')],{'showHidden':![],'depth':null}));}break;}return _0x52c218;}})['then'](respondWithResult(_0x2d8256,null))[_0xc8c8('0x29')](handleError(_0x2d8256,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index fa87717..46208de 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 _0xebe0=['exports','../../mysqldb','SmsMessage','setMaxListeners','save','emit','hasOwnProperty','hook'];(function(_0x22c04b,_0x47650f){var _0x3e8699=function(_0x176b20){while(--_0x176b20){_0x22c04b['push'](_0x22c04b['shift']());}};_0x3e8699(++_0x47650f);}(_0xebe0,0x181));var _0x0ebe=function(_0x3135f8,_0x4a29cd){_0x3135f8=_0x3135f8-0x0;var _0x1cbdb9=_0xebe0[_0x3135f8];return _0x1cbdb9;};'use strict';var EventEmitter=require('events');var SmsMessage=require(_0x0ebe('0x0'))['db'][_0x0ebe('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x0ebe('0x2')](0x0);var events={'afterCreate':_0x0ebe('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x31ed8e){return function(_0x5278d2,_0x167206,_0x2fd669){SmsMessageEvents[_0x0ebe('0x4')](_0x31ed8e+':'+_0x5278d2['id'],_0x5278d2);SmsMessageEvents['emit'](_0x31ed8e,_0x5278d2);_0x2fd669(null);};}for(var e in events){if(events[_0x0ebe('0x5')](e)){var event=events[e];SmsMessage[_0x0ebe('0x6')](e,emitEvent(event));}}module[_0x0ebe('0x7')]=SmsMessageEvents; \ No newline at end of file +var _0x8eab=['hook','exports','events','SmsMessage','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x169c6b,_0x571727){var _0x5e2f58=function(_0x25a8a4){while(--_0x25a8a4){_0x169c6b['push'](_0x169c6b['shift']());}};_0x5e2f58(++_0x571727);}(_0x8eab,0x1c4));var _0xb8ea=function(_0x4f6ee2,_0x5267a5){_0x4f6ee2=_0x4f6ee2-0x0;var _0x486aec=_0x8eab[_0x4f6ee2];return _0x486aec;};'use strict';var EventEmitter=require(_0xb8ea('0x0'));var SmsMessage=require('../../mysqldb')['db'][_0xb8ea('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xb8ea('0x2')](0x0);var events={'afterCreate':_0xb8ea('0x3'),'afterUpdate':'update','afterDestroy':_0xb8ea('0x4')};function emitEvent(_0x555caf){return function(_0x310e56,_0x571068,_0x2a8341){SmsMessageEvents[_0xb8ea('0x5')](_0x555caf+':'+_0x310e56['id'],_0x310e56);SmsMessageEvents[_0xb8ea('0x5')](_0x555caf,_0x310e56);_0x2a8341(null);};}for(var e in events){if(events[_0xb8ea('0x6')](e)){var event=events[e];SmsMessage[_0xb8ea('0x7')](e,emitEvent(event));}}module[_0xb8ea('0x8')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index fb0c670..9151043 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 _0xfbb4=['bandwidth','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./smsMessage.attributes','exports','messageId','fti_sms_messages','FULLTEXT','models','get','toLowerCase','direction','out','secret','SmsInteraction','findOne','SmsInteractionId','then','update','catch','error','SmsAccount','find','SmsAccountId','type','twilio','accountSid','authToken','phone','messages','create','body','remote','/api/sms/messages/','sid','inspect','SmsMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','login?username=','GET','split','POST','session_key','total_sent','internal_order_id','read','afterCreate','Missing\x20parameters:\x20username,\x20password','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','connectel','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code','data','queued_count','head','message_id','deliveryReport','clickSend','authId','/status?token=','token','https://api.plivo.com/v1/Account/%s/Message/','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','sender','timestamp','keys','sort','length','createHash','md5','digest','hex','signature=','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','https://messaging.bandwidth.com/api/v2/users/','/messages','applicationId'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xfbb4,0x186));var _0x4fbb=function(_0x2f27e4,_0x333da7){_0x2f27e4=_0x2f27e4-0x0;var _0x523116=_0xfbb4[_0x2f27e4];return _0x523116;};'use strict';var _=require(_0x4fbb('0x0'));var util=require(_0x4fbb('0x1'));var logger=require(_0x4fbb('0x2'))(_0x4fbb('0x3'));var moment=require(_0x4fbb('0x4'));var BPromise=require(_0x4fbb('0x5'));var rp=require(_0x4fbb('0x6'));var fs=require('fs');var path=require(_0x4fbb('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4fbb('0x8'));module[_0x4fbb('0x9')]=function(_0x2b5756,_0x306f07){return _0x2b5756['define']('SmsMessage',attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':'messageId','fields':[_0x4fbb('0xa')]},{'name':_0x4fbb('0xb'),'fields':['body'],'type':_0x4fbb('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xc3ed78,_0x4cac34,_0x360c27){var _0x208526=_0x2b5756[_0x4fbb('0xd')];var _0x35185e=_0xc3ed78[_0x4fbb('0xe')]({'plain':!![]});if(_0x35185e['direction'][_0x4fbb('0xf')]()==='in'||_0x35185e[_0x4fbb('0x10')][_0x4fbb('0xf')]()===_0x4fbb('0x11')&&!_0x35185e[_0x4fbb('0x12')]&&!_['isNil'](_0x35185e['UserId'])){_0x208526[_0x4fbb('0x13')][_0x4fbb('0x14')]({'where':{'id':_0x35185e[_0x4fbb('0x15')]}})[_0x4fbb('0x16')](function(_0x4c180c){if(_0x4c180c){_0x4c180c[_0x4fbb('0x17')]({'lastMsgAt':_0x35185e['createdAt'],'lastMsgDirection':_0x35185e['direction'][_0x4fbb('0xf')]()});}})[_0x4fbb('0x18')](function(_0x4c47ff){console[_0x4fbb('0x19')](_0x4c47ff);});}if(_0x35185e[_0x4fbb('0x10')]==='out'&&!_0x35185e['secret']){var _0x3dd52a;_0x208526[_0x4fbb('0x1a')][_0x4fbb('0x1b')]({'where':{'id':_0x35185e[_0x4fbb('0x1c')]},'raw':!![]})[_0x4fbb('0x16')](function(_0x6647c3){_0x3dd52a=_0x6647c3;if(_0x3dd52a&&_0x3dd52a[_0x4fbb('0x1d')]){switch(_0x3dd52a[_0x4fbb('0x1d')]){case _0x4fbb('0x1e'):var _0x37088b=require(_0x4fbb('0x1e'));if(_0x3dd52a[_0x4fbb('0x1f')]&&_0x3dd52a[_0x4fbb('0x20')]&&_0x3dd52a[_0x4fbb('0x21')]){var _0x1b2f36=new _0x37088b(_0x3dd52a[_0x4fbb('0x1f')],_0x3dd52a[_0x4fbb('0x20')]);_0x1b2f36[_0x4fbb('0x22')][_0x4fbb('0x23')]({'body':_0x35185e[_0x4fbb('0x24')],'to':_0x35185e[_0x4fbb('0x21')],'from':_0x3dd52a[_0x4fbb('0x21')],'statusCallback':_0x3dd52a[_0x4fbb('0x25')]+_0x4fbb('0x26')+_0x35185e['id']+'/status?token='+_0x3dd52a['token']})[_0x4fbb('0x16')](function(_0x3d1a01){if(_0x3d1a01[_0x4fbb('0x27')]){return _0xc3ed78[_0x4fbb('0x17')]({'messageId':_0x3d1a01['sid']});}})[_0x4fbb('0x18')](function(_0x11ddd3){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x4fbb('0x1e'),util[_0x4fbb('0x28')](_0x11ddd3,{'showHidden':![],'depth':null}));});}else{logger[_0x4fbb('0x19')](_0x4fbb('0x29'),'afterCreate',_0x4fbb('0x1e'),_0x4fbb('0x2a'));}break;case _0x4fbb('0x2b'):var _0x48a189=_0x4fbb('0x2c');if(_0x3dd52a[_0x4fbb('0x2d')]&&_0x3dd52a[_0x4fbb('0x2e')]){var _0x25d66a={'recipient':[_0x35185e[_0x4fbb('0x21')]],'message':_0x35185e[_0x4fbb('0x24')],'message_type':_0x3dd52a[_0x4fbb('0x2f')]};if(_0x3dd52a['smsMethod']&&_0x3dd52a[_0x4fbb('0x2f')]!=='SI'){_0x25d66a['sender']=_0x3dd52a[_0x4fbb('0x21')];}var _0x31fae9={'url':_0x48a189+_0x4fbb('0x30')+_0x3dd52a[_0x4fbb('0x2d')]+'&password='+_0x3dd52a[_0x4fbb('0x2e')],'method':_0x4fbb('0x31')};rp(_0x31fae9)['then'](function(_0x4bccdf){var _0x19660f=_0x4bccdf[_0x4fbb('0x32')](';');var _0x126247={'user_key':_0x19660f[0x0],'session_key':_0x19660f[0x1]};_0x31fae9={'url':_0x48a189+'sms','method':_0x4fbb('0x33'),'headers':{'user_key':_0x126247['user_key'],'Session_key':_0x126247[_0x4fbb('0x34')]},'json':!![],'body':_0x25d66a};return rp(_0x31fae9);})[_0x4fbb('0x16')](function(_0x354488){if(_0x354488[_0x4fbb('0x35')]>=0x1){var _0x50ac50={'messageId':_0x354488[_0x4fbb('0x36')]};if(_0x3dd52a['smsMethod']!=='GP'||!_0x3dd52a['deliveryReport']){_0x50ac50[_0x4fbb('0x37')]=!![];}return _0xc3ed78['update'](_0x50ac50);}else{return logger[_0x4fbb('0x19')](_0x4fbb('0x29'),'afterCreate',_0x4fbb('0x2b'),util[_0x4fbb('0x28')](_0x354488,{'showHidden':![],'depth':null}));}})[_0x4fbb('0x18')](function(_0x176010){return logger[_0x4fbb('0x19')](_0x4fbb('0x29'),_0x4fbb('0x38'),_0x4fbb('0x2b'),util[_0x4fbb('0x28')](_0x176010,{'showHidden':![],'depth':null}));});}else{logger[_0x4fbb('0x19')](_0x4fbb('0x29'),_0x4fbb('0x38'),'skebby',_0x4fbb('0x39'));}break;case'connectel':if(_0x3dd52a[_0x4fbb('0x20')]){var _0x1af8da={'recipient':_0x35185e['phone'],'message':_0x35185e[_0x4fbb('0x24')],'sender':_0x3dd52a[_0x4fbb('0x3a')]||_0x3dd52a[_0x4fbb('0x21')],'authorization':_0x3dd52a['authToken']};var _0x4cac34={'method':_0x4fbb('0x33'),'uri':_0x4fbb('0x3b'),'body':_0x1af8da,'json':!![]};rp(_0x4cac34)[_0x4fbb('0x16')](function(_0x22b84f){var _0x39b5e8={'messageId':_0x22b84f[_0x4fbb('0x3c')]};if(!_0x3dd52a['deliveryReport']){_0x39b5e8[_0x4fbb('0x37')]=!![];}return _0xc3ed78['update'](_0x39b5e8);})[_0x4fbb('0x18')](function(_0x4fe898){logger[_0x4fbb('0x19')](_0x4fbb('0x29'),'afterCreate','connectel',util['inspect'](_0x4fe898,{'showHidden':![],'depth':null}));});}else{logger[_0x4fbb('0x19')](_0x4fbb('0x29'),_0x4fbb('0x38'),_0x4fbb('0x3d'),_0x4fbb('0x3e'));}break;case _0x4fbb('0x3f'):if(_0x3dd52a['username']&&_0x3dd52a[_0x4fbb('0x2e')]){var _0x1af8da={'messages':[{'source':_0x4fbb('0x40'),'to':_0x35185e[_0x4fbb('0x21')],'body':_0x35185e[_0x4fbb('0x24')],'from':_0x3dd52a[_0x4fbb('0x3a')]||_0x3dd52a[_0x4fbb('0x21')]}]};var _0x16f7c4=util[_0x4fbb('0x41')](_0x4fbb('0x42'),_0x3dd52a[_0x4fbb('0x2d')],_0x3dd52a[_0x4fbb('0x2e')]);var _0x4cac34={'method':'POST','uri':_0x4fbb('0x43'),'body':_0x1af8da,'headers':{'Authorization':util[_0x4fbb('0x41')](_0x4fbb('0x44'),new Buffer(_0x16f7c4)[_0x4fbb('0x45')](_0x4fbb('0x46')))},'json':!![]};rp(_0x4cac34)[_0x4fbb('0x16')](function(_0x5bbd77){if(_0x5bbd77[_0x4fbb('0x47')]>=0xc8&&_0x5bbd77[_0x4fbb('0x47')]<=0xce){if(_0x5bbd77['data']&&_0x5bbd77[_0x4fbb('0x48')][_0x4fbb('0x49')]>0x0){var _0x581cc4=_[_0x4fbb('0x4a')](_0x5bbd77[_0x4fbb('0x48')]['messages']);var _0x12bd71={'messageId':_0x581cc4[_0x4fbb('0x4b')]};if(!_0x3dd52a[_0x4fbb('0x4c')]){_0x12bd71[_0x4fbb('0x37')]=!![];}return _0xc3ed78[_0x4fbb('0x17')](_0x12bd71);}else{logger[_0x4fbb('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x4fbb('0x4d'),util['inspect'](_0x5bbd77,{'showHidden':![],'depth':null}));}}else{logger['error'](_0x4fbb('0x29'),_0x4fbb('0x38'),'clickSend',util[_0x4fbb('0x28')](_0x5bbd77,{'showHidden':![],'depth':null}));}})[_0x4fbb('0x18')](function(_0xf7f063){logger[_0x4fbb('0x19')](_0x4fbb('0x29'),_0x4fbb('0x38'),_0x4fbb('0x4d'),util[_0x4fbb('0x28')](_0xf7f063,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x4fbb('0x29'),_0x4fbb('0x38'),_0x4fbb('0x4d'),_0x4fbb('0x39'));}break;case'plivo':if(_0x3dd52a[_0x4fbb('0x4e')]&&_0x3dd52a[_0x4fbb('0x20')]){var _0x1af8da={'dst':_0x35185e['phone'],'text':_0x35185e[_0x4fbb('0x24')],'src':_0x3dd52a[_0x4fbb('0x3a')]||_0x3dd52a['phone'],'url':_0x3dd52a[_0x4fbb('0x25')]+_0x4fbb('0x26')+_0x35185e['id']+_0x4fbb('0x4f')+_0x3dd52a[_0x4fbb('0x50')]};var _0x16f7c4=util[_0x4fbb('0x41')]('%s:%s',_0x3dd52a[_0x4fbb('0x4e')],_0x3dd52a['authToken']);var _0x4cac34={'method':_0x4fbb('0x33'),'uri':util['format'](_0x4fbb('0x51'),_0x3dd52a[_0x4fbb('0x4e')]),'body':_0x1af8da,'headers':{'Authorization':util[_0x4fbb('0x41')]('Basic\x20%s',new Buffer(_0x16f7c4)[_0x4fbb('0x45')](_0x4fbb('0x46')))},'json':!![]};rp(_0x4cac34)['then'](function(_0x1b5e35){var _0x10557a={'messageId':_0x1b5e35['message_uuid'][0x0]};return _0xc3ed78[_0x4fbb('0x17')](_0x10557a);})['catch'](function(_0x200c52){logger[_0x4fbb('0x19')](_0x4fbb('0x29'),_0x4fbb('0x38'),'plivo',util['inspect'](_0x200c52,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4fbb('0x38'),'plivo','Missing\x20parameters:\x20authId,\x20authToken');}break;case _0x4fbb('0x52'):if(_0x3dd52a['username']&&_0x3dd52a[_0x4fbb('0x2e')]){if(_0x3dd52a[_0x4fbb('0x53')]){var _0x371a37={'method':_0x4fbb('0x33'),'uri':_0x3dd52a[_0x4fbb('0x53')]+_0x4fbb('0x54'),'body':{'username':_0x3dd52a['username'],'password':_0x3dd52a['password']},'json':!![]};return rp(_0x371a37)[_0x4fbb('0x16')](function(_0x3f5247){var _0x2bb13b={'method':_0x4fbb('0x33'),'uri':_0x3dd52a['baseUrl']+_0x4fbb('0x55'),'body':{'messages':[{'from':_0x3dd52a[_0x4fbb('0x21')],'destinations':[{'to':_0x35185e['phone']}],'text':_0x35185e[_0x4fbb('0x24')],'notifyUrl':_0x3dd52a[_0x4fbb('0x25')]+'/api/sms/messages/'+_0x35185e['id']+_0x4fbb('0x4f')+_0x3dd52a[_0x4fbb('0x50')],'notifyContentType':_0x4fbb('0x56'),'callbackData':_0x3dd52a[_0x4fbb('0x21')]+';'+_0x35185e['body']}]},'headers':{'Authorization':_0x4fbb('0x57')+_0x3f5247['token']},'json':!![]};return rp(_0x2bb13b)[_0x4fbb('0x16')](function(_0x100fcf){if(_0x100fcf['messages']){var _0x51f1c7={'messageId':_0x100fcf['messages'][0x0][_0x4fbb('0xa')]};if(!_0x3dd52a[_0x4fbb('0x4c')]){_0x51f1c7['read']=!![];}return _0xc3ed78[_0x4fbb('0x17')](_0x51f1c7);}else{return logger[_0x4fbb('0x19')](_0x4fbb('0x29'),'afterCreate',_0x4fbb('0x52'),util[_0x4fbb('0x28')](_0x100fcf,{'showHidden':![],'depth':null}));}});})[_0x4fbb('0x18')](function(_0x5ac919){return logger[_0x4fbb('0x19')](_0x4fbb('0x29'),_0x4fbb('0x38'),_0x4fbb('0x52'),util[_0x4fbb('0x28')](_0x5ac919,{'showHidden':![],'depth':null}));});}else{logger[_0x4fbb('0x19')](_0x4fbb('0x29'),_0x4fbb('0x38'),_0x4fbb('0x52'),_0x4fbb('0x58'));}}else{logger[_0x4fbb('0x19')](_0x4fbb('0x29'),'afterCreate',_0x4fbb('0x52'),_0x4fbb('0x39'));}break;case _0x4fbb('0x59'):var _0x38c475=require(_0x4fbb('0x5a'));if(_0x3dd52a[_0x4fbb('0x5b')]){var _0xe3ebcf={};_0xe3ebcf[_0x4fbb('0x5c')]=_0x3dd52a['username'];_0xe3ebcf[_0x4fbb('0x21')]=_0x35185e['phone'];_0xe3ebcf[_0x4fbb('0x5d')]=_0x3dd52a[_0x4fbb('0x21')];_0xe3ebcf['text']=_0x35185e[_0x4fbb('0x24')];_0xe3ebcf[_0x4fbb('0x5e')]=+new Date();var _0x5090af='';var _0x56cd52='';var _0x97312e=Object[_0x4fbb('0x5f')](_0xe3ebcf);_0x97312e[_0x4fbb('0x60')]();for(var _0x4cbbf5=0x0;_0x4cbbf5<_0x97312e[_0x4fbb('0x61')];_0x4cbbf5++){if(_0x5090af!=''){_0x5090af+='&';}_0x5090af+=_0x97312e[_0x4cbbf5]+'='+encodeURIComponent(_0xe3ebcf[_0x97312e[_0x4cbbf5]]);_0x56cd52+=_0xe3ebcf[_0x97312e[_0x4cbbf5]];}_0x56cd52+=_0x3dd52a[_0x4fbb('0x5b')];_0x56cd52=_0x38c475[_0x4fbb('0x62')](_0x4fbb('0x63'))[_0x4fbb('0x17')](_0x56cd52)[_0x4fbb('0x64')](_0x4fbb('0x65'));if(_0x5090af!==''){_0x5090af+='&';}_0x5090af+=_0x4fbb('0x66')+_0x56cd52;var _0x31fae9={'method':_0x4fbb('0x31'),'uri':_0x3dd52a['baseUrl']+_0x4fbb('0x67')+_0x5090af,'json':!![]};return rp(_0x31fae9)[_0x4fbb('0x16')](function(_0x3bb761){var _0x336bcc=Object[_0x4fbb('0x5f')](_0x3bb761);if(_0x3bb761[_0x336bcc[0x0]][_0x4fbb('0x19')]&&parseInt(_0x3bb761[_0x336bcc[0x0]]['error'])===0x0){var _0x5d0299={'messageId':_0x3bb761[_0x336bcc[0x0]][_0x4fbb('0x68')]};if(!_0x3dd52a[_0x4fbb('0x4c')]){_0x5d0299[_0x4fbb('0x37')]=!![];}return _0xc3ed78[_0x4fbb('0x17')](_0x5d0299);}else{return logger[_0x4fbb('0x19')](_0x4fbb('0x29'),_0x4fbb('0x38'),_0x4fbb('0x59'),util[_0x4fbb('0x28')](_0x3bb761[_0x4fbb('0x19')],{'showHidden':![],'depth':null}));}})[_0x4fbb('0x18')](function(_0x2a0ba3){return logger['error'](_0x4fbb('0x29'),_0x4fbb('0x38'),_0x4fbb('0x59'),util[_0x4fbb('0x28')](_0x2a0ba3,{'showHidden':![],'depth':null}));});}else{logger[_0x4fbb('0x19')](_0x4fbb('0x29'),'afterCreate','csc',_0x4fbb('0x69'));}break;case _0x4fbb('0x6a'):if(_0x3dd52a[_0x4fbb('0x5b')]){var _0x424742={'method':_0x4fbb('0x33'),'uri':_0x4fbb('0x6b'),'headers':{'Authorization':_0x3dd52a[_0x4fbb('0x5b')]},'body':{'content':_0x35185e['body'],'to':[_0x35185e[_0x4fbb('0x21')]],'from':_0x3dd52a[_0x4fbb('0x21')],'binary':![],'clientMessageId':_0x4fbb('0x6c'),'charset':_0x4fbb('0x6d')},'json':!![]};rp(_0x424742)[_0x4fbb('0x16')](function(_0x5da541){if(!_0x5da541[_0x4fbb('0x19')]){var _0x3fad74={'messageId':_0x5da541[_0x4fbb('0x22')][0x0][_0x4fbb('0x6e')]};if(!_0x3dd52a[_0x4fbb('0x4c')]){_0x3fad74[_0x4fbb('0x37')]=!![];}return _0xc3ed78[_0x4fbb('0x17')](_0x3fad74);}else{return logger['error'](_0x4fbb('0x29'),_0x4fbb('0x38'),_0x4fbb('0x6a'),util[_0x4fbb('0x28')](_0x5da541['error'],{'showHidden':![],'depth':null}));}})[_0x4fbb('0x18')](function(_0x149e5c){return logger[_0x4fbb('0x19')](_0x4fbb('0x29'),'afterCreate',_0x4fbb('0x6a'),util[_0x4fbb('0x28')](_0x149e5c,{'showHidden':![],'depth':null}));});}else{logger[_0x4fbb('0x19')](_0x4fbb('0x29'),_0x4fbb('0x38'),_0x4fbb('0x6a'),_0x4fbb('0x69'));}break;case'bandwidth':if(_0x3dd52a[_0x4fbb('0x2d')]&&_0x3dd52a[_0x4fbb('0x2e')]){var _0x16f7c4=util[_0x4fbb('0x41')](_0x4fbb('0x42'),_0x3dd52a[_0x4fbb('0x2d')],_0x3dd52a[_0x4fbb('0x2e')]);var _0x4cac34={'method':'POST','uri':_0x4fbb('0x6f')+_0x3dd52a['accountId']+_0x4fbb('0x70'),'body':{'to':[_0x35185e[_0x4fbb('0x21')]],'text':_0x35185e['body'],'from':_0x3dd52a[_0x4fbb('0x21')],'applicationId':_0x3dd52a[_0x4fbb('0x71')]},'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(_0x16f7c4)[_0x4fbb('0x45')](_0x4fbb('0x46')))},'json':!![]};rp(_0x4cac34)[_0x4fbb('0x16')](function(_0x274e8a){if(_0x274e8a['id']){var _0x16de5e={'messageId':_0x274e8a['id']};return _0xc3ed78['update'](_0x16de5e);}else{logger[_0x4fbb('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4fbb('0x38'),_0x4fbb('0x72'),util[_0x4fbb('0x28')](_0x274e8a,{'showHidden':![],'depth':null}));}})[_0x4fbb('0x18')](function(_0x4c3be3){logger[_0x4fbb('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4fbb('0x38'),_0x4fbb('0x72'),util[_0x4fbb('0x28')](_0x4c3be3,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4fbb('0x38'),_0x4fbb('0x72'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x4fbb('0x73'):if(_0x3dd52a[_0x4fbb('0x5b')]){var _0x38cc62={};var _0x31fae9={'method':_0x4fbb('0x33'),'uri':_0x4fbb('0x74'),'headers':{'Authorization':_0x4fbb('0x75')+_0x3dd52a[_0x4fbb('0x5b')],'Content-Type':_0x4fbb('0x56')},'body':{'from':_0x3dd52a['phone'],'to':_0x35185e['phone'],'text':_0x35185e[_0x4fbb('0x24')]},'json':!![]};return rp(_0x31fae9)['then'](function(_0x4fb052){if(_0x4fb052['code']==0xca){_0x38cc62[_0x4fbb('0x76')]=_0x4fb052;var _0x10b363={'method':_0x4fbb('0x33'),'uri':_0x4fbb('0x77'),'headers':{'Authorization':_0x4fbb('0x75')+_0x3dd52a[_0x4fbb('0x5b')],'Content-Type':_0x4fbb('0x56')},'body':{'refid':_0x38cc62[_0x4fbb('0x76')][_0x4fbb('0x78')]},'json':!![]};return rp(_0x10b363)[_0x4fbb('0x16')](function(_0x1ec8e8){_0x38cc62[_0x4fbb('0x79')]=_0x1ec8e8;var _0x3d2d4e={'messageId':_0x38cc62[_0x4fbb('0x76')][_0x4fbb('0x78')],'read':!![]};return _0xc3ed78[_0x4fbb('0x17')](_0x3d2d4e);});}else{return logger[_0x4fbb('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4fbb('0x38'),'intelepeer',util[_0x4fbb('0x28')](_0x4fb052,{'showHidden':![],'depth':null}));}})['catch'](function(_0x2e8b98){return logger[_0x4fbb('0x19')](_0x4fbb('0x29'),_0x4fbb('0x38'),_0x4fbb('0x73'),util['inspect'](_0x2e8b98,{'showHidden':![],'depth':null}));});}else{return logger[_0x4fbb('0x19')](_0x4fbb('0x29'),_0x4fbb('0x38'),'intelepeer',_0x4fbb('0x7a'));}break;}}})[_0x4fbb('0x7b')](function(){_0x360c27();});}else{_0x360c27();}}},'charset':_0x4fbb('0x7c'),'collate':_0x4fbb('0x7d')});}; \ No newline at end of file +var _0x36f1=['Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code','data','queued_count','head','message_id','clickSend','Missing\x20parameters:\x20username,\x20password','authId','token','message_uuid','plivo','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','remote','application/json','IBSSO\x20','csc','crypto','apiKey','login','keys','sort','md5','digest','hex','signature=','GET','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','clickatell','uuid','UTF-8','apiMessageId','https://messaging.bandwidth.com/api/v2/users/','/messages','applicationId','bandwidth','intelepeer','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','Bearer\x20','refid','Token\x20not\x20received','finally','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','exports','SmsMessage','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','toLowerCase','direction','out','secret','SmsInteraction','findOne','SmsInteractionId','update','createdAt','catch','error','SmsAccount','find','SmsAccountId','type','twilio','accountSid','authToken','phone','messages','/api/sms/messages/','/status?token=','then','sid','SmsMessage,\x20%s,\x20%s,\x20%s','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','username','password','smsMethod','sender','login?username=','&password=','split','sms','POST','user_key','internal_order_id','read','afterCreate','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','deliveryReport'];(function(_0x14c154,_0x37093b){var _0x29926c=function(_0x566d26){while(--_0x566d26){_0x14c154['push'](_0x14c154['shift']());}};_0x29926c(++_0x37093b);}(_0x36f1,0xb0));var _0x136f=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x36f1[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x136f('0x0'));var util=require('util');var logger=require(_0x136f('0x1'))('api');var moment=require(_0x136f('0x2'));var BPromise=require(_0x136f('0x3'));var rp=require(_0x136f('0x4'));var fs=require('fs');var path=require(_0x136f('0x5'));var rimraf=require(_0x136f('0x6'));var config=require(_0x136f('0x7'));var attributes=require(_0x136f('0x8'));module[_0x136f('0x9')]=function(_0x5b00b5,_0x430433){return _0x5b00b5['define'](_0x136f('0xa'),attributes,{'tableName':_0x136f('0xb'),'paranoid':![],'indexes':[{'name':_0x136f('0xc'),'fields':['messageId']},{'name':_0x136f('0xd'),'fields':[_0x136f('0xe')],'type':_0x136f('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x7b0a5b,_0x5252bc,_0x4cd978){var _0x1bf151=_0x5b00b5[_0x136f('0x10')];var _0x347e05=_0x7b0a5b['get']({'plain':!![]});if(_0x347e05['direction'][_0x136f('0x11')]()==='in'||_0x347e05[_0x136f('0x12')][_0x136f('0x11')]()===_0x136f('0x13')&&!_0x347e05[_0x136f('0x14')]&&!_['isNil'](_0x347e05['UserId'])){_0x1bf151[_0x136f('0x15')][_0x136f('0x16')]({'where':{'id':_0x347e05[_0x136f('0x17')]}})['then'](function(_0x43fca8){if(_0x43fca8){_0x43fca8[_0x136f('0x18')]({'lastMsgAt':_0x347e05[_0x136f('0x19')],'lastMsgDirection':_0x347e05[_0x136f('0x12')][_0x136f('0x11')]()});}})[_0x136f('0x1a')](function(_0x3a4a84){console[_0x136f('0x1b')](_0x3a4a84);});}if(_0x347e05['direction']===_0x136f('0x13')&&!_0x347e05[_0x136f('0x14')]){var _0x66cee;_0x1bf151[_0x136f('0x1c')][_0x136f('0x1d')]({'where':{'id':_0x347e05[_0x136f('0x1e')]},'raw':!![]})['then'](function(_0xcdab1){_0x66cee=_0xcdab1;if(_0x66cee&&_0x66cee[_0x136f('0x1f')]){switch(_0x66cee['type']){case _0x136f('0x20'):var _0x1e94de=require(_0x136f('0x20'));if(_0x66cee[_0x136f('0x21')]&&_0x66cee[_0x136f('0x22')]&&_0x66cee[_0x136f('0x23')]){var _0x493b41=new _0x1e94de(_0x66cee[_0x136f('0x21')],_0x66cee[_0x136f('0x22')]);_0x493b41[_0x136f('0x24')]['create']({'body':_0x347e05['body'],'to':_0x347e05[_0x136f('0x23')],'from':_0x66cee['phone'],'statusCallback':_0x66cee['remote']+_0x136f('0x25')+_0x347e05['id']+_0x136f('0x26')+_0x66cee['token']})[_0x136f('0x27')](function(_0x34f467){if(_0x34f467[_0x136f('0x28')]){return _0x7b0a5b['update']({'messageId':_0x34f467[_0x136f('0x28')]});}})[_0x136f('0x1a')](function(_0x538101){logger[_0x136f('0x1b')](_0x136f('0x29'),'afterCreate',_0x136f('0x20'),util[_0x136f('0x2a')](_0x538101,{'showHidden':![],'depth':null}));});}else{logger[_0x136f('0x1b')](_0x136f('0x29'),'afterCreate',_0x136f('0x20'),_0x136f('0x2b'));}break;case _0x136f('0x2c'):var _0x23ab25='https://api.skebby.it/API/v1.0/REST/';if(_0x66cee[_0x136f('0x2d')]&&_0x66cee[_0x136f('0x2e')]){var _0x1b8e90={'recipient':[_0x347e05[_0x136f('0x23')]],'message':_0x347e05[_0x136f('0xe')],'message_type':_0x66cee[_0x136f('0x2f')]};if(_0x66cee['smsMethod']&&_0x66cee[_0x136f('0x2f')]!=='SI'){_0x1b8e90[_0x136f('0x30')]=_0x66cee[_0x136f('0x23')];}var _0x5f51a6={'url':_0x23ab25+_0x136f('0x31')+_0x66cee['username']+_0x136f('0x32')+_0x66cee[_0x136f('0x2e')],'method':'GET'};rp(_0x5f51a6)[_0x136f('0x27')](function(_0x65ef2){var _0x21ad42=_0x65ef2[_0x136f('0x33')](';');var _0x268fbe={'user_key':_0x21ad42[0x0],'session_key':_0x21ad42[0x1]};_0x5f51a6={'url':_0x23ab25+_0x136f('0x34'),'method':_0x136f('0x35'),'headers':{'user_key':_0x268fbe[_0x136f('0x36')],'Session_key':_0x268fbe['session_key']},'json':!![],'body':_0x1b8e90};return rp(_0x5f51a6);})[_0x136f('0x27')](function(_0x4ebc7f){if(_0x4ebc7f['total_sent']>=0x1){var _0x504133={'messageId':_0x4ebc7f[_0x136f('0x37')]};if(_0x66cee['smsMethod']!=='GP'||!_0x66cee['deliveryReport']){_0x504133[_0x136f('0x38')]=!![];}return _0x7b0a5b[_0x136f('0x18')](_0x504133);}else{return logger[_0x136f('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x136f('0x39'),_0x136f('0x2c'),util[_0x136f('0x2a')](_0x4ebc7f,{'showHidden':![],'depth':null}));}})[_0x136f('0x1a')](function(_0x1e5138){return logger['error'](_0x136f('0x29'),_0x136f('0x39'),_0x136f('0x2c'),util[_0x136f('0x2a')](_0x1e5138,{'showHidden':![],'depth':null}));});}else{logger[_0x136f('0x1b')](_0x136f('0x29'),_0x136f('0x39'),_0x136f('0x2c'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x136f('0x3a'):if(_0x66cee[_0x136f('0x22')]){var _0x188dd5={'recipient':_0x347e05['phone'],'message':_0x347e05[_0x136f('0xe')],'sender':_0x66cee[_0x136f('0x3b')]||_0x66cee[_0x136f('0x23')],'authorization':_0x66cee[_0x136f('0x22')]};var _0x5252bc={'method':_0x136f('0x35'),'uri':_0x136f('0x3c'),'body':_0x188dd5,'json':!![]};rp(_0x5252bc)[_0x136f('0x27')](function(_0x1f9926){var _0xbd555e={'messageId':_0x1f9926['requestid']};if(!_0x66cee[_0x136f('0x3d')]){_0xbd555e[_0x136f('0x38')]=!![];}return _0x7b0a5b[_0x136f('0x18')](_0xbd555e);})['catch'](function(_0x56b620){logger[_0x136f('0x1b')](_0x136f('0x29'),_0x136f('0x39'),_0x136f('0x3a'),util[_0x136f('0x2a')](_0x56b620,{'showHidden':![],'depth':null}));});}else{logger[_0x136f('0x1b')](_0x136f('0x29'),_0x136f('0x39'),_0x136f('0x3a'),_0x136f('0x3e'));}break;case _0x136f('0x3f'):if(_0x66cee[_0x136f('0x2d')]&&_0x66cee[_0x136f('0x2e')]){var _0x188dd5={'messages':[{'source':_0x136f('0x40'),'to':_0x347e05[_0x136f('0x23')],'body':_0x347e05[_0x136f('0xe')],'from':_0x66cee[_0x136f('0x3b')]||_0x66cee[_0x136f('0x23')]}]};var _0x516732=util[_0x136f('0x41')](_0x136f('0x42'),_0x66cee[_0x136f('0x2d')],_0x66cee[_0x136f('0x2e')]);var _0x5252bc={'method':_0x136f('0x35'),'uri':_0x136f('0x43'),'body':_0x188dd5,'headers':{'Authorization':util[_0x136f('0x41')](_0x136f('0x44'),new Buffer(_0x516732)[_0x136f('0x45')](_0x136f('0x46')))},'json':!![]};rp(_0x5252bc)[_0x136f('0x27')](function(_0x49dc9d){if(_0x49dc9d[_0x136f('0x47')]>=0xc8&&_0x49dc9d[_0x136f('0x47')]<=0xce){if(_0x49dc9d['data']&&_0x49dc9d[_0x136f('0x48')][_0x136f('0x49')]>0x0){var _0x9e572b=_[_0x136f('0x4a')](_0x49dc9d[_0x136f('0x48')][_0x136f('0x24')]);var _0x20621c={'messageId':_0x9e572b[_0x136f('0x4b')]};if(!_0x66cee[_0x136f('0x3d')]){_0x20621c[_0x136f('0x38')]=!![];}return _0x7b0a5b[_0x136f('0x18')](_0x20621c);}else{logger[_0x136f('0x1b')](_0x136f('0x29'),_0x136f('0x39'),'clickSend',util[_0x136f('0x2a')](_0x49dc9d,{'showHidden':![],'depth':null}));}}else{logger[_0x136f('0x1b')](_0x136f('0x29'),_0x136f('0x39'),_0x136f('0x4c'),util[_0x136f('0x2a')](_0x49dc9d,{'showHidden':![],'depth':null}));}})[_0x136f('0x1a')](function(_0x293a49){logger[_0x136f('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x136f('0x39'),_0x136f('0x4c'),util[_0x136f('0x2a')](_0x293a49,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x136f('0x29'),_0x136f('0x39'),_0x136f('0x4c'),_0x136f('0x4d'));}break;case'plivo':if(_0x66cee[_0x136f('0x4e')]&&_0x66cee[_0x136f('0x22')]){var _0x188dd5={'dst':_0x347e05['phone'],'text':_0x347e05['body'],'src':_0x66cee[_0x136f('0x3b')]||_0x66cee[_0x136f('0x23')],'url':_0x66cee['remote']+_0x136f('0x25')+_0x347e05['id']+_0x136f('0x26')+_0x66cee[_0x136f('0x4f')]};var _0x516732=util['format'](_0x136f('0x42'),_0x66cee[_0x136f('0x4e')],_0x66cee[_0x136f('0x22')]);var _0x5252bc={'method':'POST','uri':util[_0x136f('0x41')]('https://api.plivo.com/v1/Account/%s/Message/',_0x66cee['authId']),'body':_0x188dd5,'headers':{'Authorization':util[_0x136f('0x41')](_0x136f('0x44'),new Buffer(_0x516732)[_0x136f('0x45')](_0x136f('0x46')))},'json':!![]};rp(_0x5252bc)[_0x136f('0x27')](function(_0x547cb8){var _0x44fc7e={'messageId':_0x547cb8[_0x136f('0x50')][0x0]};return _0x7b0a5b[_0x136f('0x18')](_0x44fc7e);})[_0x136f('0x1a')](function(_0x30b5ad){logger[_0x136f('0x1b')](_0x136f('0x29'),_0x136f('0x39'),'plivo',util[_0x136f('0x2a')](_0x30b5ad,{'showHidden':![],'depth':null}));});}else{logger[_0x136f('0x1b')](_0x136f('0x29'),_0x136f('0x39'),_0x136f('0x51'),'Missing\x20parameters:\x20authId,\x20authToken');}break;case _0x136f('0x52'):if(_0x66cee[_0x136f('0x2d')]&&_0x66cee[_0x136f('0x2e')]){if(_0x66cee[_0x136f('0x53')]){var _0x5a46e9={'method':_0x136f('0x35'),'uri':_0x66cee[_0x136f('0x53')]+_0x136f('0x54'),'body':{'username':_0x66cee[_0x136f('0x2d')],'password':_0x66cee[_0x136f('0x2e')]},'json':!![]};return rp(_0x5a46e9)[_0x136f('0x27')](function(_0x14ff2d){var _0x3476dd={'method':_0x136f('0x35'),'uri':_0x66cee[_0x136f('0x53')]+_0x136f('0x55'),'body':{'messages':[{'from':_0x66cee[_0x136f('0x23')],'destinations':[{'to':_0x347e05['phone']}],'text':_0x347e05[_0x136f('0xe')],'notifyUrl':_0x66cee[_0x136f('0x56')]+_0x136f('0x25')+_0x347e05['id']+_0x136f('0x26')+_0x66cee[_0x136f('0x4f')],'notifyContentType':_0x136f('0x57'),'callbackData':_0x66cee[_0x136f('0x23')]+';'+_0x347e05[_0x136f('0xe')]}]},'headers':{'Authorization':_0x136f('0x58')+_0x14ff2d[_0x136f('0x4f')]},'json':!![]};return rp(_0x3476dd)[_0x136f('0x27')](function(_0x550ae3){if(_0x550ae3[_0x136f('0x24')]){var _0x2926b5={'messageId':_0x550ae3[_0x136f('0x24')][0x0][_0x136f('0xc')]};if(!_0x66cee[_0x136f('0x3d')]){_0x2926b5[_0x136f('0x38')]=!![];}return _0x7b0a5b[_0x136f('0x18')](_0x2926b5);}else{return logger[_0x136f('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x136f('0x39'),_0x136f('0x52'),util[_0x136f('0x2a')](_0x550ae3,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x2a3395){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x136f('0x39'),_0x136f('0x52'),util[_0x136f('0x2a')](_0x2a3395,{'showHidden':![],'depth':null}));});}else{logger[_0x136f('0x1b')](_0x136f('0x29'),_0x136f('0x39'),_0x136f('0x52'),'Missing\x20parameters:\x20base_url');}}else{logger[_0x136f('0x1b')](_0x136f('0x29'),_0x136f('0x39'),_0x136f('0x52'),_0x136f('0x4d'));}break;case _0x136f('0x59'):var _0x3d7a48=require(_0x136f('0x5a'));if(_0x66cee[_0x136f('0x5b')]){var _0x2231a3={};_0x2231a3[_0x136f('0x5c')]=_0x66cee[_0x136f('0x2d')];_0x2231a3[_0x136f('0x23')]=_0x347e05[_0x136f('0x23')];_0x2231a3[_0x136f('0x30')]=_0x66cee['phone'];_0x2231a3['text']=_0x347e05[_0x136f('0xe')];_0x2231a3['timestamp']=+new Date();var _0x3df463='';var _0x4e148f='';var _0x396787=Object[_0x136f('0x5d')](_0x2231a3);_0x396787[_0x136f('0x5e')]();for(var _0x41e503=0x0;_0x41e503<_0x396787['length'];_0x41e503++){if(_0x3df463!=''){_0x3df463+='&';}_0x3df463+=_0x396787[_0x41e503]+'='+encodeURIComponent(_0x2231a3[_0x396787[_0x41e503]]);_0x4e148f+=_0x2231a3[_0x396787[_0x41e503]];}_0x4e148f+=_0x66cee[_0x136f('0x5b')];_0x4e148f=_0x3d7a48['createHash'](_0x136f('0x5f'))[_0x136f('0x18')](_0x4e148f)[_0x136f('0x60')](_0x136f('0x61'));if(_0x3df463!==''){_0x3df463+='&';}_0x3df463+=_0x136f('0x62')+_0x4e148f;var _0x5f51a6={'method':_0x136f('0x63'),'uri':_0x66cee[_0x136f('0x53')]+_0x136f('0x64')+_0x3df463,'json':!![]};return rp(_0x5f51a6)[_0x136f('0x27')](function(_0xaeba7e){var _0x3dcfce=Object[_0x136f('0x5d')](_0xaeba7e);if(_0xaeba7e[_0x3dcfce[0x0]][_0x136f('0x1b')]&&parseInt(_0xaeba7e[_0x3dcfce[0x0]][_0x136f('0x1b')])===0x0){var _0x58cae2={'messageId':_0xaeba7e[_0x3dcfce[0x0]][_0x136f('0x65')]};if(!_0x66cee[_0x136f('0x3d')]){_0x58cae2[_0x136f('0x38')]=!![];}return _0x7b0a5b[_0x136f('0x18')](_0x58cae2);}else{return logger['error'](_0x136f('0x29'),_0x136f('0x39'),_0x136f('0x59'),util['inspect'](_0xaeba7e[_0x136f('0x1b')],{'showHidden':![],'depth':null}));}})[_0x136f('0x1a')](function(_0xc01b7d){return logger[_0x136f('0x1b')](_0x136f('0x29'),'afterCreate','csc',util[_0x136f('0x2a')](_0xc01b7d,{'showHidden':![],'depth':null}));});}else{logger[_0x136f('0x1b')](_0x136f('0x29'),_0x136f('0x39'),_0x136f('0x59'),_0x136f('0x66'));}break;case _0x136f('0x67'):if(_0x66cee[_0x136f('0x5b')]){var _0x5579f5={'method':_0x136f('0x35'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x66cee[_0x136f('0x5b')]},'body':{'content':_0x347e05[_0x136f('0xe')],'to':[_0x347e05['phone']],'from':_0x66cee['phone'],'binary':![],'clientMessageId':_0x136f('0x68'),'charset':_0x136f('0x69')},'json':!![]};rp(_0x5579f5)['then'](function(_0x56fd66){if(!_0x56fd66[_0x136f('0x1b')]){var _0x3d2b97={'messageId':_0x56fd66[_0x136f('0x24')][0x0][_0x136f('0x6a')]};if(!_0x66cee[_0x136f('0x3d')]){_0x3d2b97[_0x136f('0x38')]=!![];}return _0x7b0a5b[_0x136f('0x18')](_0x3d2b97);}else{return logger[_0x136f('0x1b')](_0x136f('0x29'),_0x136f('0x39'),'clickatell',util[_0x136f('0x2a')](_0x56fd66[_0x136f('0x1b')],{'showHidden':![],'depth':null}));}})[_0x136f('0x1a')](function(_0x52d9bf){return logger[_0x136f('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x136f('0x39'),_0x136f('0x67'),util['inspect'](_0x52d9bf,{'showHidden':![],'depth':null}));});}else{logger[_0x136f('0x1b')](_0x136f('0x29'),_0x136f('0x39'),_0x136f('0x67'),_0x136f('0x66'));}break;case'bandwidth':if(_0x66cee[_0x136f('0x2d')]&&_0x66cee[_0x136f('0x2e')]){var _0x516732=util['format'](_0x136f('0x42'),_0x66cee[_0x136f('0x2d')],_0x66cee['password']);var _0x5252bc={'method':_0x136f('0x35'),'uri':_0x136f('0x6b')+_0x66cee['accountId']+_0x136f('0x6c'),'body':{'to':[_0x347e05[_0x136f('0x23')]],'text':_0x347e05[_0x136f('0xe')],'from':_0x66cee[_0x136f('0x23')],'applicationId':_0x66cee[_0x136f('0x6d')]},'headers':{'Authorization':util[_0x136f('0x41')]('Basic\x20%s',new Buffer(_0x516732)[_0x136f('0x45')](_0x136f('0x46')))},'json':!![]};rp(_0x5252bc)[_0x136f('0x27')](function(_0x281acc){if(_0x281acc['id']){var _0x5804fe={'messageId':_0x281acc['id']};return _0x7b0a5b[_0x136f('0x18')](_0x5804fe);}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x136f('0x39'),'bandwidth',util['inspect'](_0x281acc,{'showHidden':![],'depth':null}));}})[_0x136f('0x1a')](function(_0x5b33c3){logger[_0x136f('0x1b')](_0x136f('0x29'),_0x136f('0x39'),_0x136f('0x6e'),util[_0x136f('0x2a')](_0x5b33c3,{'showHidden':![],'depth':null}));});}else{logger[_0x136f('0x1b')](_0x136f('0x29'),_0x136f('0x39'),_0x136f('0x6e'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x136f('0x6f'):if(_0x66cee[_0x136f('0x5b')]){var _0x11a3f3={};var _0x5f51a6={'method':_0x136f('0x35'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':'Bearer\x20'+_0x66cee['apiKey'],'Content-Type':'application/json'},'body':{'from':_0x66cee[_0x136f('0x23')],'to':_0x347e05[_0x136f('0x23')],'text':_0x347e05[_0x136f('0xe')]},'json':!![]};return rp(_0x5f51a6)['then'](function(_0x44e4bf){if(_0x44e4bf['code']==0xca){_0x11a3f3[_0x136f('0x70')]=_0x44e4bf;var _0x4b6322={'method':'POST','uri':_0x136f('0x71'),'headers':{'Authorization':_0x136f('0x72')+_0x66cee['apiKey'],'Content-Type':_0x136f('0x57')},'body':{'refid':_0x11a3f3['message'][_0x136f('0x73')]},'json':!![]};return rp(_0x4b6322)[_0x136f('0x27')](function(_0x41c64a){_0x11a3f3['status']=_0x41c64a;var _0x3ee110={'messageId':_0x11a3f3[_0x136f('0x70')][_0x136f('0x73')],'read':!![]};return _0x7b0a5b['update'](_0x3ee110);});}else{return logger[_0x136f('0x1b')](_0x136f('0x29'),_0x136f('0x39'),_0x136f('0x6f'),util[_0x136f('0x2a')](_0x44e4bf,{'showHidden':![],'depth':null}));}})[_0x136f('0x1a')](function(_0x552246){return logger['error'](_0x136f('0x29'),_0x136f('0x39'),'intelepeer',util[_0x136f('0x2a')](_0x552246,{'showHidden':![],'depth':null}));});}else{return logger[_0x136f('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x136f('0x6f'),_0x136f('0x74'));}break;}}})[_0x136f('0x75')](function(){_0x4cd978();});}else{_0x4cd978();}}},'charset':'utf8mb4','collate':_0x136f('0x76')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 7ee8665..6f6b4db 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 _0xfaec=['raw','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./smsMessage.socket','register','then','info','debug','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','SmsMessage,\x20%s,\x20%s','message','result','catch','CreateSmsMessage','SmsMessage','create','body','options'];(function(_0xf17ae7,_0x3b7448){var _0x2d46b2=function(_0x458a4b){while(--_0x458a4b){_0xf17ae7['push'](_0xf17ae7['shift']());}};_0x2d46b2(++_0x3b7448);}(_0xfaec,0x156));var _0xcfae=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xfaec[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0xcfae('0x0'));var moment=require(_0xcfae('0x1'));var BPromise=require(_0xcfae('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcfae('0x3'))['db'];var utils=require(_0xcfae('0x4'));var logger=require(_0xcfae('0x5'))(_0xcfae('0x6'));var config=require(_0xcfae('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xcfae('0x8')][_0xcfae('0x9')]({'port':0x232a});config[_0xcfae('0xa')]=_['defaults'](config[_0xcfae('0xa')],{'host':_0xcfae('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcfae('0xa')]));require(_0xcfae('0xc'))[_0xcfae('0xd')](socket);function respondWithRpcPromise(_0x4b1922,_0xb2fc31,_0x334625){return new BPromise(function(_0x5c1285,_0x1e0187){return client['request'](_0x4b1922,_0x334625)[_0xcfae('0xe')](function(_0x8c56cd){logger[_0xcfae('0xf')]('SmsMessage,\x20%s,\x20%s',_0xb2fc31,'request\x20sent');logger[_0xcfae('0x10')](_0xcfae('0x11'),_0xb2fc31,_0xcfae('0x12'),JSON[_0xcfae('0x13')](_0x8c56cd));if(_0x8c56cd['error']){if(_0x8c56cd[_0xcfae('0x14')]['code']===0x1f4){logger['error'](_0xcfae('0x15'),_0xb2fc31,_0x8c56cd[_0xcfae('0x14')]['message']);return _0x1e0187(_0x8c56cd[_0xcfae('0x14')][_0xcfae('0x16')]);}logger[_0xcfae('0x14')](_0xcfae('0x15'),_0xb2fc31,_0x8c56cd[_0xcfae('0x14')][_0xcfae('0x16')]);return _0x5c1285(_0x8c56cd[_0xcfae('0x14')]['message']);}else{logger['info'](_0xcfae('0x15'),_0xb2fc31,_0xcfae('0x12'));_0x5c1285(_0x8c56cd[_0xcfae('0x17')][_0xcfae('0x16')]);}})[_0xcfae('0x18')](function(_0x3b2f93){logger[_0xcfae('0x14')](_0xcfae('0x15'),_0xb2fc31,_0x3b2f93);_0x1e0187(_0x3b2f93);});});}exports[_0xcfae('0x19')]=function(_0x393f98){var _0x304436=this;return new Promise(function(_0x245b0d,_0x14b5e5){return db[_0xcfae('0x1a')][_0xcfae('0x1b')](_0x393f98[_0xcfae('0x1c')],{'raw':_0x393f98[_0xcfae('0x1d')]?_0x393f98[_0xcfae('0x1d')][_0xcfae('0x1e')]===undefined?!![]:![]:!![]})[_0xcfae('0xe')](function(_0x1a3906){logger[_0xcfae('0xf')]('CreateSmsMessage',_0x393f98);logger[_0xcfae('0x10')](_0xcfae('0x19'),_0x393f98,JSON[_0xcfae('0x13')](_0x1a3906));_0x245b0d(_0x1a3906);})[_0xcfae('0x18')](function(_0x445be3){logger[_0xcfae('0x14')](_0xcfae('0x19'),_0x445be3[_0xcfae('0x16')],_0x393f98);_0x14b5e5(_0x304436['error'](0x1f4,_0x445be3[_0xcfae('0x16')]));});});}; \ No newline at end of file +var _0x3b30=['redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','request','then','info','SmsMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','CreateSmsMessage','create','body','options','raw','catch','lodash','util','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client'];(function(_0x338349,_0x21c3cc){var _0x2a13b8=function(_0x3d6ae9){while(--_0x3d6ae9){_0x338349['push'](_0x338349['shift']());}};_0x2a13b8(++_0x21c3cc);}(_0x3b30,0x14c));var _0x03b3=function(_0x37dbac,_0x53e80b){_0x37dbac=_0x37dbac-0x0;var _0x764119=_0x3b30[_0x37dbac];return _0x764119;};'use strict';var _=require(_0x03b3('0x0'));var util=require(_0x03b3('0x1'));var moment=require('moment');var BPromise=require(_0x03b3('0x2'));var rs=require(_0x03b3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x03b3('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x03b3('0x5'));var config=require(_0x03b3('0x6'));var jayson=require(_0x03b3('0x7'));var client=jayson[_0x03b3('0x8')]['http']({'port':0x232a});config[_0x03b3('0x9')]=_[_0x03b3('0xa')](config[_0x03b3('0x9')],{'host':_0x03b3('0xb'),'port':0x18eb});var socket=require(_0x03b3('0xc'))(new Redis(config['redis']));require(_0x03b3('0xd'))[_0x03b3('0xe')](socket);function respondWithRpcPromise(_0x370851,_0x4b2b77,_0x1f6f40){return new BPromise(function(_0x15cf9b,_0x41fcd9){return client[_0x03b3('0xf')](_0x370851,_0x1f6f40)[_0x03b3('0x10')](function(_0x1cd215){logger[_0x03b3('0x11')](_0x03b3('0x12'),_0x4b2b77,'request\x20sent');logger[_0x03b3('0x13')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4b2b77,_0x03b3('0x14'),JSON[_0x03b3('0x15')](_0x1cd215));if(_0x1cd215[_0x03b3('0x16')]){if(_0x1cd215[_0x03b3('0x16')][_0x03b3('0x17')]===0x1f4){logger['error'](_0x03b3('0x12'),_0x4b2b77,_0x1cd215[_0x03b3('0x16')]['message']);return _0x41fcd9(_0x1cd215['error']['message']);}logger[_0x03b3('0x16')](_0x03b3('0x12'),_0x4b2b77,_0x1cd215['error'][_0x03b3('0x18')]);return _0x15cf9b(_0x1cd215['error']['message']);}else{logger['info'](_0x03b3('0x12'),_0x4b2b77,_0x03b3('0x14'));_0x15cf9b(_0x1cd215['result'][_0x03b3('0x18')]);}})['catch'](function(_0x122eb0){logger[_0x03b3('0x16')](_0x03b3('0x12'),_0x4b2b77,_0x122eb0);_0x41fcd9(_0x122eb0);});});}exports[_0x03b3('0x19')]=function(_0x2a6314){var _0x6c9022=this;return new Promise(function(_0x248feb,_0x54f03b){return db['SmsMessage'][_0x03b3('0x1a')](_0x2a6314[_0x03b3('0x1b')],{'raw':_0x2a6314[_0x03b3('0x1c')]?_0x2a6314[_0x03b3('0x1c')][_0x03b3('0x1d')]===undefined?!![]:![]:!![]})[_0x03b3('0x10')](function(_0xf29306){logger[_0x03b3('0x11')](_0x03b3('0x19'),_0x2a6314);logger[_0x03b3('0x13')](_0x03b3('0x19'),_0x2a6314,JSON[_0x03b3('0x15')](_0xf29306));_0x248feb(_0xf29306);})[_0x03b3('0x1e')](function(_0x1ff0db){logger['error'](_0x03b3('0x19'),_0x1ff0db[_0x03b3('0x18')],_0x2a6314);_0x54f03b(_0x6c9022[_0x03b3('0x16')](0x1f4,_0x1ff0db[_0x03b3('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 6540d4c..00666b5 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 _0x17a2=['smsMessage:','./smsMessage.events','save','remove','update','emit','register','length'];(function(_0xffdd99,_0x3c3c45){var _0x2189ff=function(_0x24f59e){while(--_0x24f59e){_0xffdd99['push'](_0xffdd99['shift']());}};_0x2189ff(++_0x3c3c45);}(_0x17a2,0xd1));var _0x217a=function(_0xb5d559,_0x1269f0){_0xb5d559=_0xb5d559-0x0;var _0x7d3995=_0x17a2[_0xb5d559];return _0x7d3995;};'use strict';var SmsMessageEvents=require(_0x217a('0x0'));var events=[_0x217a('0x1'),_0x217a('0x2'),_0x217a('0x3')];function createListener(_0x36daf9,_0x53d5e2){return function(_0x3195d9){_0x53d5e2[_0x217a('0x4')](_0x36daf9,_0x3195d9);};}function removeListener(_0x3b66ac,_0x32f800){return function(){SmsMessageEvents['removeListener'](_0x3b66ac,_0x32f800);};}exports[_0x217a('0x5')]=function(_0x5dd4f9){for(var _0x31fc86=0x0,_0x4e5b75=events[_0x217a('0x6')];_0x31fc86<_0x4e5b75;_0x31fc86++){var _0x6d9efd=events[_0x31fc86];var _0x4aa778=createListener(_0x217a('0x7')+_0x6d9efd,_0x5dd4f9);SmsMessageEvents['on'](_0x6d9efd,_0x4aa778);}}; \ No newline at end of file +var _0xe1ec=['register','length','smsMessage:','./smsMessage.events','save','remove','emit','removeListener'];(function(_0xd5e2d3,_0x5873ba){var _0x5a2995=function(_0x4207f0){while(--_0x4207f0){_0xd5e2d3['push'](_0xd5e2d3['shift']());}};_0x5a2995(++_0x5873ba);}(_0xe1ec,0x1d3));var _0xce1e=function(_0x38c949,_0x5a8249){_0x38c949=_0x38c949-0x0;var _0x45375b=_0xe1ec[_0x38c949];return _0x45375b;};'use strict';var SmsMessageEvents=require(_0xce1e('0x0'));var events=[_0xce1e('0x1'),_0xce1e('0x2'),'update'];function createListener(_0x3c35b8,_0x58c3dc){return function(_0x53790b){_0x58c3dc[_0xce1e('0x3')](_0x3c35b8,_0x53790b);};}function removeListener(_0x1feccc,_0x1487d4){return function(){SmsMessageEvents[_0xce1e('0x4')](_0x1feccc,_0x1487d4);};}exports[_0xce1e('0x5')]=function(_0x569e6f){for(var _0x1f6427=0x0,_0x14b589=events[_0xce1e('0x6')];_0x1f6427<_0x14b589;_0x1f6427++){var _0x20e785=events[_0x1f6427];var _0x5711d6=createListener(_0xce1e('0x7')+_0x20e785,_0x569e6f);SmsMessageEvents['on'](_0x20e785,_0x5711d6);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 4067531..74a7bc4 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 _0xcfd2=['addTeams','/:id/users','update','delete','destroy','removeTeams','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./smsQueue.controller','isAuthenticated','get','/describe','/:id','show','/:id/members','getMembers','getTeams','getAgents','post','create','/:id/teams'];(function(_0x2adbb0,_0x21029d){var _0x469709=function(_0xaa8a27){while(--_0xaa8a27){_0x2adbb0['push'](_0x2adbb0['shift']());}};_0x469709(++_0x21029d);}(_0xcfd2,0x8e));var _0x2cfd=function(_0x47e1e7,_0x1a447d){_0x47e1e7=_0x47e1e7-0x0;var _0x299dfd=_0xcfd2[_0x47e1e7];return _0x299dfd;};'use strict';var multer=require('multer');var util=require(_0x2cfd('0x0'));var path=require(_0x2cfd('0x1'));var timeout=require(_0x2cfd('0x2'));var express=require(_0x2cfd('0x3'));var router=express[_0x2cfd('0x4')]();var fs_extra=require(_0x2cfd('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x2cfd('0x6'));var config=require('../../config/environment');var controller=require(_0x2cfd('0x7'));router['get']('/',auth[_0x2cfd('0x8')](),controller['index']);router[_0x2cfd('0x9')](_0x2cfd('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x2cfd('0x9')](_0x2cfd('0xb'),auth[_0x2cfd('0x8')](),controller[_0x2cfd('0xc')]);router['get'](_0x2cfd('0xd'),auth[_0x2cfd('0x8')](),controller[_0x2cfd('0xe')]);router[_0x2cfd('0x9')]('/:id/teams',auth[_0x2cfd('0x8')](),controller[_0x2cfd('0xf')]);router['get']('/:id/users',auth[_0x2cfd('0x8')](),controller[_0x2cfd('0x10')]);router[_0x2cfd('0x11')]('/',auth[_0x2cfd('0x8')](),controller[_0x2cfd('0x12')]);router[_0x2cfd('0x11')](_0x2cfd('0x13'),auth[_0x2cfd('0x8')](),controller[_0x2cfd('0x14')]);router['post'](_0x2cfd('0x15'),auth[_0x2cfd('0x8')](),controller['addAgents']);router['put'](_0x2cfd('0xb'),auth['isAuthenticated'](),controller[_0x2cfd('0x16')]);router[_0x2cfd('0x17')](_0x2cfd('0xb'),auth[_0x2cfd('0x8')](),controller[_0x2cfd('0x18')]);router[_0x2cfd('0x17')](_0x2cfd('0x13'),auth[_0x2cfd('0x8')](),controller[_0x2cfd('0x19')]);router['delete'](_0x2cfd('0x15'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x2cfd('0x1a')]=router; \ No newline at end of file +var _0x2b21=['express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout'];(function(_0x220a7a,_0x500163){var _0x3089b3=function(_0x3e34f3){while(--_0x3e34f3){_0x220a7a['push'](_0x220a7a['shift']());}};_0x3089b3(++_0x500163);}(_0x2b21,0x7d));var _0x12b2=function(_0x4e93a9,_0x413f30){_0x4e93a9=_0x4e93a9-0x0;var _0x43013c=_0x2b21[_0x4e93a9];return _0x43013c;};'use strict';var multer=require(_0x12b2('0x0'));var util=require(_0x12b2('0x1'));var path=require('path');var timeout=require(_0x12b2('0x2'));var express=require(_0x12b2('0x3'));var router=express[_0x12b2('0x4')]();var fs_extra=require(_0x12b2('0x5'));var auth=require(_0x12b2('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x12b2('0x7'));var controller=require('./smsQueue.controller');router[_0x12b2('0x8')]('/',auth[_0x12b2('0x9')](),controller[_0x12b2('0xa')]);router[_0x12b2('0x8')](_0x12b2('0xb'),auth[_0x12b2('0x9')](),controller[_0x12b2('0xc')]);router['get']('/:id',auth[_0x12b2('0x9')](),controller[_0x12b2('0xd')]);router[_0x12b2('0x8')](_0x12b2('0xe'),auth[_0x12b2('0x9')](),controller[_0x12b2('0xf')]);router[_0x12b2('0x8')](_0x12b2('0x10'),auth[_0x12b2('0x9')](),controller[_0x12b2('0x11')]);router[_0x12b2('0x8')](_0x12b2('0x12'),auth[_0x12b2('0x9')](),controller[_0x12b2('0x13')]);router[_0x12b2('0x14')]('/',auth[_0x12b2('0x9')](),controller[_0x12b2('0x15')]);router['post'](_0x12b2('0x10'),auth[_0x12b2('0x9')](),controller[_0x12b2('0x16')]);router[_0x12b2('0x14')]('/:id/users',auth[_0x12b2('0x9')](),controller[_0x12b2('0x17')]);router[_0x12b2('0x18')](_0x12b2('0x19'),auth['isAuthenticated'](),controller[_0x12b2('0x1a')]);router[_0x12b2('0x1b')](_0x12b2('0x19'),auth[_0x12b2('0x9')](),controller[_0x12b2('0x1c')]);router[_0x12b2('0x1b')](_0x12b2('0x10'),auth[_0x12b2('0x9')](),controller[_0x12b2('0x1d')]);router[_0x12b2('0x1b')]('/:id/users',auth[_0x12b2('0x9')](),controller[_0x12b2('0x1e')]);module[_0x12b2('0x1f')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 817f406..2658a07 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 _0xb521=['INTEGER','beepall','roundrobin','exports','STRING'];(function(_0x562fdb,_0x5684bb){var _0x318876=function(_0xcd34d9){while(--_0xcd34d9){_0x562fdb['push'](_0x562fdb['shift']());}};_0x318876(++_0x5684bb);}(_0xb521,0xb7));var _0x1b52=function(_0xfe9f6b,_0x2204cc){_0xfe9f6b=_0xfe9f6b-0x0;var _0x54a503=_0xb521[_0xfe9f6b];return _0x54a503;};'use strict';var Sequelize=require('sequelize');module[_0x1b52('0x0')]={'name':{'type':Sequelize[_0x1b52('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x1b52('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x1b52('0x3'),_0x1b52('0x4'))}}; \ No newline at end of file +var _0xe5ad=['STRING','name','INTEGER','rrmemory','beepall','roundrobin'];(function(_0x321d17,_0x474097){var _0x4ec235=function(_0x167ffc){while(--_0x167ffc){_0x321d17['push'](_0x321d17['shift']());}};_0x4ec235(++_0x474097);}(_0xe5ad,0x126));var _0xde5a=function(_0x172b87,_0x4e9e22){_0x172b87=_0x172b87-0x0;var _0x121f0d=_0xe5ad[_0x172b87];return _0x121f0d;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xde5a('0x0')],'unique':_0xde5a('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xde5a('0x0')]},'timeout':{'type':Sequelize[_0xde5a('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xde5a('0x3'),_0xde5a('0x4'),_0xde5a('0x5'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index ef17cde..659a363 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 _0x806d=['ids','Team','Agents','online','interface','each','findOrCreate','forEach','emit','userSmsQueue:save','select','field','tq.TeamId','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','sequelize','SELECT','every','TeamId','includes','all','union','compact','value','transaction','removeTeams','isEmpty','removeAgents','addAgents','spread','isArray','getAgents','eml-format','rimraf','zip-dir','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','then','get','SmsQueues','error','stack','name','map','SmsQueue','rawAttributes','fieldName','type','key','model','keys','intersection','attributes','fields','query','nolimit','order','sort','where','filters','filter','merge','options','include','findAll','rows','catch','show','params','length','includeAll','find','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','UserProfileResource','describe','getMembers','UserSmsQueue','hasOwnProperty','SmsQueueId','User','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','findOne','pick','addTeams'];(function(_0x5699eb,_0x59b821){var _0x5c8c85=function(_0x2ae249){while(--_0x2ae249){_0x5699eb['push'](_0x5699eb['shift']());}};_0x5c8c85(++_0x59b821);}(_0x806d,0x131));var _0xd806=function(_0x2f767f,_0x436c7c){_0x2f767f=_0x2f767f-0x0;var _0x14a53b=_0x806d[_0x2f767f];return _0x14a53b;};'use strict';var emlformat=require(_0xd806('0x0'));var rimraf=require(_0xd806('0x1'));var zipdir=require(_0xd806('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd806('0x3'));var Mustache=require(_0xd806('0x4'));var util=require('util');var path=require(_0xd806('0x5'));var sox=require('sox');var csv=require(_0xd806('0x6'));var ejs=require(_0xd806('0x7'));var fs=require('fs');var fs_extra=require(_0xd806('0x8'));var _=require(_0xd806('0x9'));var squel=require(_0xd806('0xa'));var crypto=require(_0xd806('0xb'));var jsforce=require(_0xd806('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xd806('0x6'));var querystring=require(_0xd806('0xd'));var Papa=require(_0xd806('0xe'));var Redis=require(_0xd806('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xd806('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd806('0x11'));var logger=require(_0xd806('0x12'))('api');var utils=require(_0xd806('0x13'));var config=require(_0xd806('0x14'));var licenseUtil=require(_0xd806('0x15'));var db=require(_0xd806('0x16'))['db'];config[_0xd806('0x17')]=_[_0xd806('0x18')](config[_0xd806('0x17')],{'host':_0xd806('0x19'),'port':0x18eb});var socket=require(_0xd806('0x1a'))(new Redis(config[_0xd806('0x17')]));require(_0xd806('0x1b'))['register'](socket);function respondWithStatusCode(_0x17d8bc,_0x359bfa){_0x359bfa=_0x359bfa||0xcc;return function(_0x69dd14){if(_0x69dd14){return _0x17d8bc['sendStatus'](_0x359bfa);}return _0x17d8bc[_0xd806('0x1c')](_0x359bfa)['end']();};}function respondWithResult(_0x33127f,_0x1195c4){_0x1195c4=_0x1195c4||0xc8;return function(_0x47f679){if(_0x47f679){return _0x33127f[_0xd806('0x1c')](_0x1195c4)[_0xd806('0x1d')](_0x47f679);}};}function respondWithFilteredResult(_0x1e7f7f,_0x3407f9){return function(_0x332eec){if(_0x332eec){var _0x1c9ce4=typeof _0x3407f9['offset']===_0xd806('0x1e')&&typeof _0x3407f9[_0xd806('0x1f')]===_0xd806('0x1e');var _0x5a3781=_0x332eec[_0xd806('0x20')];var _0x5f5b46=_0x1c9ce4?0x0:_0x3407f9[_0xd806('0x21')];var _0x1954f8=_0x1c9ce4?_0x332eec[_0xd806('0x20')]:_0x3407f9[_0xd806('0x21')]+_0x3407f9[_0xd806('0x1f')];var _0x58c632;if(_0x1954f8>=_0x5a3781){_0x1954f8=_0x5a3781;_0x58c632=0xc8;}else{_0x58c632=0xce;}_0x1e7f7f['status'](_0x58c632);return _0x1e7f7f[_0xd806('0x22')](_0xd806('0x23'),_0x5f5b46+'-'+_0x1954f8+'/'+_0x5a3781)[_0xd806('0x1d')](_0x332eec);}return null;};}function patchUpdates(_0x95450b){return function(_0x33b87a){try{jsonpatch['apply'](_0x33b87a,_0x95450b,!![]);}catch(_0x500f9d){return BPromise[_0xd806('0x24')](_0x500f9d);}return _0x33b87a[_0xd806('0x25')]();};}function saveUpdates(_0x17aa45,_0x36721b){return function(_0x3a4934){if(_0x3a4934){return _0x3a4934['update'](_0x17aa45)[_0xd806('0x26')](function(_0xf8df1e){return _0xf8df1e;});}return null;};}function removeEntity(_0x53782d,_0x479744){return function(_0x2fd73d){if(_0x2fd73d){return _0x2fd73d['destroy']()[_0xd806('0x26')](function(){var _0xe9664e=_0x2fd73d[_0xd806('0x27')]({'plain':!![]});var _0x3a4435=_0xd806('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x3a4435,'resourceId':_0xe9664e['id']}})[_0xd806('0x26')](function(){return _0x2fd73d;});})[_0xd806('0x26')](function(){_0x53782d[_0xd806('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b6b4d,_0x25a2f0){return function(_0x358ae2){if(!_0x358ae2){_0x2b6b4d['sendStatus'](0x194);}return _0x358ae2;};}function handleError(_0x47dc87,_0x552487){_0x552487=_0x552487||0x1f4;return function(_0x2d46d1){logger[_0xd806('0x29')](_0x2d46d1[_0xd806('0x2a')]);if(_0x2d46d1[_0xd806('0x2b')]){delete _0x2d46d1['name'];}_0x47dc87['status'](_0x552487)['send'](_0x2d46d1);};}exports['index']=function(_0x3e467e,_0x435d94){var _0x14ba23={},_0x1b6215={},_0x3b231c={'count':0x0,'rows':[]};var _0x135704=_[_0xd806('0x2c')](db[_0xd806('0x2d')][_0xd806('0x2e')],function(_0x52a1ae){return{'name':_0x52a1ae[_0xd806('0x2f')],'type':_0x52a1ae[_0xd806('0x30')][_0xd806('0x31')]};});_0x1b6215[_0xd806('0x32')]=_['map'](_0x135704,_0xd806('0x2b'));_0x1b6215['query']=_[_0xd806('0x33')](_0x3e467e['query']);_0x1b6215['filters']=_[_0xd806('0x34')](_0x1b6215[_0xd806('0x32')],_0x1b6215['query']);_0x14ba23[_0xd806('0x35')]=_[_0xd806('0x34')](_0x1b6215['model'],qs[_0xd806('0x36')](_0x3e467e[_0xd806('0x37')]['fields']));_0x14ba23[_0xd806('0x35')]=_0x14ba23[_0xd806('0x35')]['length']?_0x14ba23['attributes']:_0x1b6215[_0xd806('0x32')];if(!_0x3e467e[_0xd806('0x37')]['hasOwnProperty'](_0xd806('0x38'))){_0x14ba23[_0xd806('0x1f')]=qs['limit'](_0x3e467e['query']['limit']);_0x14ba23[_0xd806('0x21')]=qs[_0xd806('0x21')](_0x3e467e[_0xd806('0x37')][_0xd806('0x21')]);}_0x14ba23[_0xd806('0x39')]=qs[_0xd806('0x3a')](_0x3e467e[_0xd806('0x37')][_0xd806('0x3a')]);_0x14ba23[_0xd806('0x3b')]=qs[_0xd806('0x3c')](_['pick'](_0x3e467e[_0xd806('0x37')],_0x1b6215['filters']),_0x135704);if(_0x3e467e[_0xd806('0x37')][_0xd806('0x3d')]){_0x14ba23['where']=_[_0xd806('0x3e')](_0x14ba23['where'],{'$or':_[_0xd806('0x2c')](_0x135704,function(_0x4a30e4){if(_0x4a30e4['type']!=='VIRTUAL'){var _0x73e3fe={};_0x73e3fe[_0x4a30e4['name']]={'$like':'%'+_0x3e467e[_0xd806('0x37')][_0xd806('0x3d')]+'%'};return _0x73e3fe;}})});}_0x14ba23=_[_0xd806('0x3e')]({},_0x14ba23,_0x3e467e[_0xd806('0x3f')]);var _0xc395ce={'where':_0x14ba23['where']};return db['SmsQueue'][_0xd806('0x20')](_0xc395ce)['then'](function(_0x1c4191){_0x3b231c[_0xd806('0x20')]=_0x1c4191;if(_0x3e467e[_0xd806('0x37')]['includeAll']){_0x14ba23[_0xd806('0x40')]=[{'all':!![]}];}return db['SmsQueue'][_0xd806('0x41')](_0x14ba23);})[_0xd806('0x26')](function(_0xdc7ad){_0x3b231c[_0xd806('0x42')]=_0xdc7ad;return _0x3b231c;})['then'](respondWithFilteredResult(_0x435d94,_0x14ba23))[_0xd806('0x43')](handleError(_0x435d94,null));};exports[_0xd806('0x44')]=function(_0x2d686f,_0x5a6511){var _0x3d0c27={'raw':!![],'where':{'id':_0x2d686f[_0xd806('0x45')]['id']}},_0x557ee3={};_0x557ee3[_0xd806('0x32')]=_[_0xd806('0x33')](db[_0xd806('0x2d')]['rawAttributes']);_0x557ee3['query']=_[_0xd806('0x33')](_0x2d686f[_0xd806('0x37')]);_0x557ee3['filters']=_['intersection'](_0x557ee3[_0xd806('0x32')],_0x557ee3[_0xd806('0x37')]);_0x3d0c27[_0xd806('0x35')]=_[_0xd806('0x34')](_0x557ee3[_0xd806('0x32')],qs['fields'](_0x2d686f['query'][_0xd806('0x36')]));_0x3d0c27['attributes']=_0x3d0c27['attributes'][_0xd806('0x46')]?_0x3d0c27[_0xd806('0x35')]:_0x557ee3[_0xd806('0x32')];if(_0x2d686f['query'][_0xd806('0x47')]){_0x3d0c27['include']=[{'all':!![]}];}_0x3d0c27=_[_0xd806('0x3e')]({},_0x3d0c27,_0x2d686f[_0xd806('0x3f')]);return db[_0xd806('0x2d')][_0xd806('0x48')](_0x3d0c27)[_0xd806('0x26')](handleEntityNotFound(_0x5a6511,null))['then'](respondWithResult(_0x5a6511,null))['catch'](handleError(_0x5a6511,null));};exports['create']=function(_0x1badb8,_0x2ddedc){return db['SmsQueue']['create'](_0x1badb8[_0xd806('0x49')],{})[_0xd806('0x26')](function(_0x527dcb){var _0x1abead=_0x1badb8['user'][_0xd806('0x27')]({'plain':!![]});if(!_0x1abead)throw new Error(_0xd806('0x4a'));if(_0x1abead['role']===_0xd806('0x4b')){var _0x51b7e1=_0x527dcb[_0xd806('0x27')]({'plain':!![]});var _0x48201f=_0xd806('0x28');return db[_0xd806('0x4c')]['find']({'where':{'name':_0x48201f,'userProfileId':_0x1abead['userProfileId']},'raw':!![]})['then'](function(_0x3e1191){if(_0x3e1191&&_0x3e1191['autoAssociation']===0x0){return db[_0xd806('0x4d')]['create']({'name':_0x51b7e1['name'],'resourceId':_0x51b7e1['id'],'type':_0x3e1191[_0xd806('0x2b')],'sectionId':_0x3e1191['id']},{})[_0xd806('0x26')](function(){return _0x527dcb;});}else{return _0x527dcb;}})[_0xd806('0x43')](function(_0x56ca6b){logger[_0xd806('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x56ca6b);throw _0x56ca6b;});}return _0x527dcb;})[_0xd806('0x26')](respondWithResult(_0x2ddedc,0xc9))['catch'](handleError(_0x2ddedc,null));};exports['update']=function(_0x4c384b,_0x404c1c){if(_0x4c384b[_0xd806('0x49')]['id']){delete _0x4c384b['body']['id'];}return db[_0xd806('0x2d')][_0xd806('0x48')]({'where':{'id':_0x4c384b[_0xd806('0x45')]['id']}})[_0xd806('0x26')](handleEntityNotFound(_0x404c1c,null))[_0xd806('0x26')](saveUpdates(_0x4c384b['body'],null))[_0xd806('0x26')](respondWithResult(_0x404c1c,null))[_0xd806('0x43')](handleError(_0x404c1c,null));};exports['destroy']=function(_0xd9b253,_0x45a34b){return db['SmsQueue'][_0xd806('0x48')]({'where':{'id':_0xd9b253['params']['id']}})[_0xd806('0x26')](handleEntityNotFound(_0x45a34b,null))[_0xd806('0x26')](removeEntity(_0x45a34b,null))[_0xd806('0x43')](handleError(_0x45a34b,null));};exports['describe']=function(_0x9a7211,_0x57cb59){return db[_0xd806('0x2d')][_0xd806('0x4e')]()[_0xd806('0x26')](respondWithResult(_0x57cb59,null))[_0xd806('0x43')](handleError(_0x57cb59,null));};exports[_0xd806('0x4f')]=function(_0x49b364,_0x2d817f,_0xba795){var _0x29afa9={'raw':!![],'where':{}},_0x231fd3={},_0x3b4298;return db['SmsQueue']['findOne']({'where':{'id':_0x49b364['params']['id']}})[_0xd806('0x26')](handleEntityNotFound(_0x2d817f,null))['then'](function(_0x505857){if(_0x505857){_0x3b4298=_0x505857[_0xd806('0x27')]({'plain':!![]});_0x231fd3[_0xd806('0x32')]=_[_0xd806('0x33')](db[_0xd806('0x50')]['rawAttributes']);_0x231fd3['query']=_['keys'](_0x49b364[_0xd806('0x37')]);_0x231fd3[_0xd806('0x3c')]=_['intersection'](_0x231fd3[_0xd806('0x32')],_0x231fd3[_0xd806('0x37')]);_0x29afa9[_0xd806('0x35')]=_['intersection'](_0x231fd3[_0xd806('0x32')],qs[_0xd806('0x36')](_0x49b364[_0xd806('0x37')]['fields']));_0x29afa9['attributes']=_0x29afa9[_0xd806('0x35')][_0xd806('0x46')]?_0x29afa9[_0xd806('0x35')]:_0x231fd3[_0xd806('0x32')];if(!_0x49b364[_0xd806('0x37')][_0xd806('0x51')]('nolimit')){_0x29afa9[_0xd806('0x1f')]=qs['limit'](_0x49b364[_0xd806('0x37')]['limit']);_0x29afa9[_0xd806('0x21')]=qs['offset'](_0x49b364[_0xd806('0x37')][_0xd806('0x21')]);}_0x29afa9[_0xd806('0x39')]=qs[_0xd806('0x3a')](_0x49b364[_0xd806('0x37')]['sort']);_0x29afa9[_0xd806('0x3b')]=qs[_0xd806('0x3c')](_['pick'](_0x49b364[_0xd806('0x37')],_0x231fd3[_0xd806('0x3c')]));_0x29afa9['where'][_0xd806('0x52')]=_0x505857['id'];if(_0x49b364[_0xd806('0x37')][_0xd806('0x3d')]){_0x29afa9[_0xd806('0x3b')]=_['merge'](_0x29afa9[_0xd806('0x3b')],{'$or':_[_0xd806('0x2c')](_0x29afa9['attributes'],function(_0x4fb4fd){var _0x26ad79={};_0x26ad79[_0x4fb4fd]={'$like':'%'+_0x49b364[_0xd806('0x37')][_0xd806('0x3d')]+'%'};return _0x26ad79;})});}_0x29afa9=_[_0xd806('0x3e')]({},_0x29afa9,_0x49b364['options']);return db[_0xd806('0x50')]['findAll'](_0x29afa9);}})[_0xd806('0x26')](function(_0x53b810){if(_0x53b810){return db[_0xd806('0x53')][_0xd806('0x54')]({'where':{'id':_[_0xd806('0x2c')](_0x53b810,_0xd806('0x55')),'role':_0xd806('0x56')},'attributes':['id',_0xd806('0x2b'),_0xd806('0x57'),_0xd806('0x58'),_0xd806('0x59')]});}})[_0xd806('0x26')](function(_0x14803c){if(_0x14803c){return{'count':_0x14803c[_0xd806('0x20')],'rows':_[_0xd806('0x2c')](_0x14803c['rows'],function(_0x3a014f){return{'membername':_0x3a014f[_0xd806('0x2b')],'UserId':_0x3a014f['id'],'queue_name':_0x3b4298['name'],'SmsQueueId':_0x3b4298['id'],'interface':util[_0xd806('0x5a')](_0xd806('0x5b'),_0xd806('0x5c'),_0x3a014f[_0xd806('0x2b')]),'penalty':0x0,'paused':_0x3a014f[_0xd806('0x57')],'createdAt':_0x3a014f[_0xd806('0x59')],'updatedAt':_0x3a014f['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x2d817f,_0x29afa9))['catch'](handleError(_0x2d817f,null));};exports[_0xd806('0x5d')]=function(_0x7a31ed,_0x149d13,_0x4a603c){var _0x16c83e={};var _0x587c69={};var _0x560d83;var _0x5f3938;return db[_0xd806('0x2d')][_0xd806('0x5e')]({'where':{'id':_0x7a31ed[_0xd806('0x45')]['id']}})[_0xd806('0x26')](handleEntityNotFound(_0x149d13,null))[_0xd806('0x26')](function(_0x3263bf){if(_0x3263bf){_0x560d83=_0x3263bf;_0x587c69[_0xd806('0x32')]=_[_0xd806('0x33')](db['Team'][_0xd806('0x2e')]);_0x587c69[_0xd806('0x37')]=_['keys'](_0x7a31ed[_0xd806('0x37')]);_0x587c69[_0xd806('0x3c')]=_[_0xd806('0x34')](_0x587c69[_0xd806('0x32')],_0x587c69[_0xd806('0x37')]);_0x16c83e[_0xd806('0x35')]=_[_0xd806('0x34')](_0x587c69['model'],qs[_0xd806('0x36')](_0x7a31ed[_0xd806('0x37')][_0xd806('0x36')]));_0x16c83e[_0xd806('0x35')]=_0x16c83e[_0xd806('0x35')][_0xd806('0x46')]?_0x16c83e[_0xd806('0x35')]:_0x587c69[_0xd806('0x32')];_0x16c83e[_0xd806('0x39')]=qs['sort'](_0x7a31ed['query'][_0xd806('0x3a')]);_0x16c83e[_0xd806('0x3b')]=qs[_0xd806('0x3c')](_[_0xd806('0x5f')](_0x7a31ed['query'],_0x587c69[_0xd806('0x3c')]));if(_0x7a31ed[_0xd806('0x37')][_0xd806('0x3d')]){_0x16c83e[_0xd806('0x3b')]=_[_0xd806('0x3e')](_0x16c83e[_0xd806('0x3b')],{'$or':_[_0xd806('0x2c')](_0x16c83e[_0xd806('0x35')],function(_0x3be72f){var _0x4ae142={};_0x4ae142[_0x3be72f]={'$like':'%'+_0x7a31ed[_0xd806('0x37')][_0xd806('0x3d')]+'%'};return _0x4ae142;})});}_0x16c83e=_['merge']({},_0x16c83e,_0x7a31ed[_0xd806('0x3f')]);return _0x560d83[_0xd806('0x5d')](_0x16c83e);}})[_0xd806('0x26')](function(_0x10a412){if(_0x10a412){_0x5f3938=_0x10a412['length'];if(!_0x7a31ed['query'][_0xd806('0x51')](_0xd806('0x38'))){_0x16c83e[_0xd806('0x1f')]=qs[_0xd806('0x1f')](_0x7a31ed[_0xd806('0x37')]['limit']);_0x16c83e[_0xd806('0x21')]=qs['offset'](_0x7a31ed[_0xd806('0x37')][_0xd806('0x21')]);}return _0x560d83[_0xd806('0x5d')](_0x16c83e);}})[_0xd806('0x26')](function(_0x558974){if(_0x558974){return _0x558974?{'count':_0x5f3938,'rows':_0x558974}:null;}})[_0xd806('0x26')](respondWithResult(_0x149d13,null))[_0xd806('0x43')](handleError(_0x149d13,null));};exports[_0xd806('0x60')]=function(_0x56f596,_0x579ab8,_0x4723f3){var _0x467667=_0x56f596['body'][_0xd806('0x61')];return db[_0xd806('0x62')][_0xd806('0x41')]({'where':{'id':_0x467667},'attributes':['id'],'include':[{'model':db[_0xd806('0x53')],'as':_0xd806('0x63'),'attributes':['id',_0xd806('0x2b'),_0xd806('0x64'),'voicePause',_0xd806('0x65')],'raw':!![]}]})[_0xd806('0x26')](function(_0x38d70b){if(_0x38d70b){var _0x11b58a=_['flatMap'](_0x38d70b,function(_0xb38f72){var _0xf4f992=_0xb38f72[_0xd806('0x27')]({'plain':!![]});return _0xf4f992[_0xd806('0x63')];});return db['SmsQueue'][_0xd806('0x48')]({'where':{'id':_0x56f596[_0xd806('0x45')]['id']}})[_0xd806('0x26')](function(_0x4651bf){return db['sequelize']['transaction'](function(_0x4bde73){return _0x4651bf[_0xd806('0x60')](_0x467667,{'transaction':_0x4bde73})['then'](function(){return BPromise[_0xd806('0x66')](_0x11b58a,function(_0x25842a){return db[_0xd806('0x50')][_0xd806('0x67')]({'where':{'UserId':_0x25842a['id'],'SmsQueueId':_0x56f596[_0xd806('0x45')]['id']},'transaction':_0x4bde73});});})[_0xd806('0x26')](function(){_0x11b58a[_0xd806('0x68')](function(_0x592079){socket[_0xd806('0x69')](_0xd806('0x6a'),{'UserId':_0x592079['id'],'SmsQueueId':_0x4651bf['id']});});});});});}})[_0xd806('0x26')](respondWithStatusCode(_0x579ab8,null))['catch'](handleError(_0x579ab8,null));};exports['removeTeams']=function(_0x22fd06,_0x49c8cc,_0x8cc1d4){return db[_0xd806('0x62')][_0xd806('0x41')]({'where':{'id':_0x22fd06[_0xd806('0x37')][_0xd806('0x61')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xd806('0x63'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x49c8cc,null))[_0xd806('0x26')](function(_0x3dfbf3){var _0x1b48e0=_[_0xd806('0x2c')](_0x3dfbf3,'id');var _0x40274b=[];var _0x3e9037=[];var _0x23da5e=squel[_0xd806('0x6b')]();_0x23da5e[_0xd806('0x6c')](_0xd806('0x6d'))['from'](_0xd806('0x6e'),'tq')[_0xd806('0x6f')](_0xd806('0x70'),'ut',_0xd806('0x71'))['where'](_0xd806('0x72'),_0x22fd06[_0xd806('0x45')]['id']);for(var _0x3b8a6a=0x0;_0x3b8a6a<_0x3dfbf3[_0xd806('0x46')];_0x3b8a6a+=0x1){let _0x29869b=_0x3dfbf3[_0x3b8a6a];for(var _0x4c50a9=0x0;_0x4c50a9<_0x29869b['Agents'][_0xd806('0x46')];_0x4c50a9+=0x1){let _0x1d3f48=_0x29869b[_0xd806('0x63')][_0x4c50a9];var _0x199dad=_0x23da5e[_0xd806('0x73')]();_0x199dad['where'](_0xd806('0x74'),_0x1d3f48['id']);_0x3e9037['push'](db[_0xd806('0x75')]['query'](_0x199dad['toString'](),{'type':db['sequelize']['QueryTypes'][_0xd806('0x76')]})[_0xd806('0x26')](function(_0x21f060){if(_0x21f060[_0xd806('0x46')]===0x1){return _0x1d3f48['id'];}else{var _0x598fef=_[_0xd806('0x77')](_[_0xd806('0x2c')](_0x21f060,_0xd806('0x78')),function(_0x35eca7){return _[_0xd806('0x79')](_0x1b48e0,_0x35eca7);});if(_0x598fef){return _0x1d3f48['id'];}}}));}}return BPromise[_0xd806('0x7a')](_0x3e9037)[_0xd806('0x26')](function(_0x623c9c){_0x40274b=_(_0x40274b)[_0xd806('0x7b')](_0x623c9c)[_0xd806('0x7c')]()[_0xd806('0x7d')]();return db[_0xd806('0x2d')]['find']({'where':{'id':_0x22fd06['params']['id']}})[_0xd806('0x26')](function(_0x4edb16){return db[_0xd806('0x75')][_0xd806('0x7e')](function(_0x29a898){return _0x4edb16[_0xd806('0x7f')](_0x22fd06['query']['ids'],{'transaction':_0x29a898})[_0xd806('0x26')](function(){if(!_[_0xd806('0x80')](_0x40274b)){return _0x4edb16[_0xd806('0x81')](_0x40274b,{'transaction':_0x29a898});}})['then'](function(){_0x40274b[_0xd806('0x68')](function(_0x201e97){socket['emit']('userSmsQueue:remove',{'UserId':_0x201e97,'SmsQueueId':_0x4edb16['id']});});});});});});})[_0xd806('0x26')](respondWithStatusCode(_0x49c8cc,null))[_0xd806('0x43')](handleError(_0x49c8cc,null));};exports['addAgents']=function(_0x4ce4ea,_0x5dfd7e,_0x3ee1f8){return db[_0xd806('0x2d')]['find']({'where':{'id':_0x4ce4ea[_0xd806('0x45')]['id']}})['then'](handleEntityNotFound(_0x5dfd7e,null))[_0xd806('0x26')](function(_0x27e9c5){if(_0x27e9c5){return _0x27e9c5[_0xd806('0x82')](_0x4ce4ea[_0xd806('0x49')]['ids'],_['omit'](_0x4ce4ea['body'],[_0xd806('0x61'),'id'])||{})[_0xd806('0x83')](function(_0x1b771b){for(var _0x162b4e=0x0;_0x162b4e<_0x4ce4ea[_0xd806('0x49')][_0xd806('0x61')][_0xd806('0x46')];_0x162b4e+=0x1){socket[_0xd806('0x69')](_0xd806('0x6a'),{'UserId':Number(_0x4ce4ea['body'][_0xd806('0x61')][_0x162b4e]),'SmsQueueId':Number(_0x4ce4ea[_0xd806('0x45')]['id'])});}return _0x1b771b;});}})[_0xd806('0x26')](respondWithResult(_0x5dfd7e,null))[_0xd806('0x43')](handleError(_0x5dfd7e,null));};exports['removeAgents']=function(_0x11896,_0xba8db4,_0x13e387){return db[_0xd806('0x2d')][_0xd806('0x48')]({'where':{'id':_0x11896[_0xd806('0x45')]['id']}})['then'](handleEntityNotFound(_0xba8db4,null))[_0xd806('0x26')](function(_0x2da638){if(_0x2da638){return _0x2da638[_0xd806('0x81')](_0x11896[_0xd806('0x37')][_0xd806('0x61')])[_0xd806('0x26')](function(){if(_[_0xd806('0x84')](_0x11896[_0xd806('0x37')][_0xd806('0x61')])){for(var _0x224bc6=0x0;_0x224bc6<_0x11896[_0xd806('0x37')][_0xd806('0x61')][_0xd806('0x46')];_0x224bc6+=0x1){socket[_0xd806('0x69')]('userSmsQueue:remove',{'UserId':Number(_0x11896[_0xd806('0x37')][_0xd806('0x61')][_0x224bc6]),'SmsQueueId':Number(_0x11896['params']['id'])});}}else{socket['emit']('userSmsQueue:remove',{'UserId':Number(_0x11896[_0xd806('0x37')][_0xd806('0x61')]),'SmsQueueId':Number(_0x11896[_0xd806('0x45')]['id'])});}});}})[_0xd806('0x26')](respondWithStatusCode(_0xba8db4,null))[_0xd806('0x43')](handleError(_0xba8db4,null));};exports[_0xd806('0x85')]=function(_0xa0f47b,_0x4cf1fd,_0x3a1876){var _0x447875={};var _0x5e4c23={};var _0x170b30;var _0x47a677;return db[_0xd806('0x2d')][_0xd806('0x5e')]({'where':{'id':_0xa0f47b[_0xd806('0x45')]['id']}})[_0xd806('0x26')](handleEntityNotFound(_0x4cf1fd,null))[_0xd806('0x26')](function(_0x2ca88b){if(_0x2ca88b){_0x170b30=_0x2ca88b;_0x5e4c23[_0xd806('0x32')]=_[_0xd806('0x33')](db[_0xd806('0x53')][_0xd806('0x2e')]);_0x5e4c23['query']=_[_0xd806('0x33')](_0xa0f47b[_0xd806('0x37')]);_0x5e4c23[_0xd806('0x3c')]=_['intersection'](_0x5e4c23[_0xd806('0x32')],_0x5e4c23['query']);_0x447875['attributes']=_[_0xd806('0x34')](_0x5e4c23[_0xd806('0x32')],qs[_0xd806('0x36')](_0xa0f47b[_0xd806('0x37')][_0xd806('0x36')]));_0x447875[_0xd806('0x35')]=_0x447875[_0xd806('0x35')]['length']?_0x447875[_0xd806('0x35')]:_0x5e4c23[_0xd806('0x32')];_0x447875[_0xd806('0x39')]=qs[_0xd806('0x3a')](_0xa0f47b[_0xd806('0x37')][_0xd806('0x3a')]);_0x447875[_0xd806('0x3b')]=qs[_0xd806('0x3c')](_[_0xd806('0x5f')](_0xa0f47b[_0xd806('0x37')],_0x5e4c23['filters']));if(_0xa0f47b['query']['filter']){_0x447875[_0xd806('0x3b')]=_[_0xd806('0x3e')](_0x447875['where'],{'$or':_['map'](_0x447875[_0xd806('0x35')],function(_0x422059){var _0x243c17={};_0x243c17[_0x422059]={'$like':'%'+_0xa0f47b[_0xd806('0x37')][_0xd806('0x3d')]+'%'};return _0x243c17;})});}_0x447875=_['merge']({},_0x447875,_0xa0f47b['options']);return _0x170b30[_0xd806('0x85')](_0x447875);}})['then'](function(_0x1d6a06){if(_0x1d6a06){_0x47a677=_0x1d6a06[_0xd806('0x46')];if(!_0xa0f47b[_0xd806('0x37')][_0xd806('0x51')](_0xd806('0x38'))){_0x447875[_0xd806('0x1f')]=qs['limit'](_0xa0f47b['query'][_0xd806('0x1f')]);_0x447875[_0xd806('0x21')]=qs[_0xd806('0x21')](_0xa0f47b[_0xd806('0x37')]['offset']);}return _0x170b30[_0xd806('0x85')](_0x447875);}})[_0xd806('0x26')](function(_0x14fe71){if(_0x14fe71){return _0x14fe71?{'count':_0x47a677,'rows':_0x14fe71}:null;}})['then'](respondWithResult(_0x4cf1fd,null))['catch'](handleError(_0x4cf1fd,null));}; \ No newline at end of file +var _0xbada=['isEmpty','removeAgents','userSmsQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','fast-json-patch','util','sox','to-csv','ejs','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./smsQueue.socket','sendStatus','status','json','offset','limit','count','set','Content-Range','apply','update','then','destroy','UserProfileResource','end','stack','name','send','map','SmsQueue','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','merge','where','VIRTUAL','filter','options','includeAll','findAll','rows','catch','include','create','user','get','role','SmsQueues','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','params','describe','getMembers','findOne','UserSmsQueue','nolimit','order','pick','SmsQueueId','User','findAndCountAll','UserId','updatedAt','createdAt','format','%s/%s','SIP','smsPause','getTeams','addTeams','Team','Agents','online','voicePause','interface','transaction','each','emit','userSmsQueue:save','removeTeams','ids','select','team_has_sms_queues','join','user_has_teams','ut.UserId\x20=\x20?','sequelize','toString','SELECT','every','TeamId','includes','all','union','compact'];(function(_0x3b048d,_0x450938){var _0x31b2d4=function(_0x13ebc0){while(--_0x13ebc0){_0x3b048d['push'](_0x3b048d['shift']());}};_0x31b2d4(++_0x450938);}(_0xbada,0x18e));var _0xabad=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0xbada[_0x5f309e];return _0x487b5e;};'use strict';var emlformat=require(_0xabad('0x0'));var rimraf=require(_0xabad('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xabad('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xabad('0x3'));var path=require('path');var sox=require(_0xabad('0x4'));var csv=require(_0xabad('0x5'));var ejs=require(_0xabad('0x6'));var fs=require('fs');var fs_extra=require(_0xabad('0x7'));var _=require(_0xabad('0x8'));var squel=require(_0xabad('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xabad('0x5'));var querystring=require(_0xabad('0xa'));var Papa=require(_0xabad('0xb'));var Redis=require(_0xabad('0xc'));var authService=require(_0xabad('0xd'));var qs=require(_0xabad('0xe'));var as=require(_0xabad('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xabad('0x10'))(_0xabad('0x11'));var utils=require(_0xabad('0x12'));var config=require(_0xabad('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xabad('0x14')]=_['defaults'](config[_0xabad('0x14')],{'host':_0xabad('0x15'),'port':0x18eb});var socket=require(_0xabad('0x16'))(new Redis(config[_0xabad('0x14')]));require(_0xabad('0x17'))['register'](socket);function respondWithStatusCode(_0x50b2b3,_0x2d4b2c){_0x2d4b2c=_0x2d4b2c||0xcc;return function(_0x485f43){if(_0x485f43){return _0x50b2b3[_0xabad('0x18')](_0x2d4b2c);}return _0x50b2b3[_0xabad('0x19')](_0x2d4b2c)['end']();};}function respondWithResult(_0x48e87c,_0x1a752f){_0x1a752f=_0x1a752f||0xc8;return function(_0x45f13c){if(_0x45f13c){return _0x48e87c[_0xabad('0x19')](_0x1a752f)[_0xabad('0x1a')](_0x45f13c);}};}function respondWithFilteredResult(_0x946b0f,_0x2f301f){return function(_0x54998e){if(_0x54998e){var _0x2ba0ee=typeof _0x2f301f[_0xabad('0x1b')]==='undefined'&&typeof _0x2f301f[_0xabad('0x1c')]==='undefined';var _0x45a041=_0x54998e[_0xabad('0x1d')];var _0x21f657=_0x2ba0ee?0x0:_0x2f301f[_0xabad('0x1b')];var _0x322b30=_0x2ba0ee?_0x54998e['count']:_0x2f301f[_0xabad('0x1b')]+_0x2f301f[_0xabad('0x1c')];var _0x4bdd10;if(_0x322b30>=_0x45a041){_0x322b30=_0x45a041;_0x4bdd10=0xc8;}else{_0x4bdd10=0xce;}_0x946b0f[_0xabad('0x19')](_0x4bdd10);return _0x946b0f[_0xabad('0x1e')](_0xabad('0x1f'),_0x21f657+'-'+_0x322b30+'/'+_0x45a041)[_0xabad('0x1a')](_0x54998e);}return null;};}function patchUpdates(_0x237ed4){return function(_0x9f9c98){try{jsonpatch[_0xabad('0x20')](_0x9f9c98,_0x237ed4,!![]);}catch(_0x515476){return BPromise['reject'](_0x515476);}return _0x9f9c98['save']();};}function saveUpdates(_0xf8a0a5,_0x331514){return function(_0x1326b6){if(_0x1326b6){return _0x1326b6[_0xabad('0x21')](_0xf8a0a5)[_0xabad('0x22')](function(_0x91bd16){return _0x91bd16;});}return null;};}function removeEntity(_0x48a690,_0x58d04e){return function(_0xa5285f){if(_0xa5285f){return _0xa5285f[_0xabad('0x23')]()[_0xabad('0x22')](function(){var _0x7d83cd=_0xa5285f['get']({'plain':!![]});var _0x2296aa='SmsQueues';return db[_0xabad('0x24')][_0xabad('0x23')]({'where':{'type':_0x2296aa,'resourceId':_0x7d83cd['id']}})[_0xabad('0x22')](function(){return _0xa5285f;});})[_0xabad('0x22')](function(){_0x48a690['status'](0xcc)[_0xabad('0x25')]();});}};}function handleEntityNotFound(_0x543189,_0x2f5577){return function(_0xb3385e){if(!_0xb3385e){_0x543189['sendStatus'](0x194);}return _0xb3385e;};}function handleError(_0x501ed0,_0x50d8bb){_0x50d8bb=_0x50d8bb||0x1f4;return function(_0x526def){logger['error'](_0x526def[_0xabad('0x26')]);if(_0x526def[_0xabad('0x27')]){delete _0x526def[_0xabad('0x27')];}_0x501ed0[_0xabad('0x19')](_0x50d8bb)[_0xabad('0x28')](_0x526def);};}exports['index']=function(_0x4470a2,_0x2d10ae){var _0x95cdab={},_0x10bbda={},_0x3852cc={'count':0x0,'rows':[]};var _0x49942d=_[_0xabad('0x29')](db[_0xabad('0x2a')][_0xabad('0x2b')],function(_0x2a653c){return{'name':_0x2a653c[_0xabad('0x2c')],'type':_0x2a653c[_0xabad('0x2d')][_0xabad('0x2e')]};});_0x10bbda['model']=_[_0xabad('0x29')](_0x49942d,_0xabad('0x27'));_0x10bbda[_0xabad('0x2f')]=_[_0xabad('0x30')](_0x4470a2[_0xabad('0x2f')]);_0x10bbda[_0xabad('0x31')]=_[_0xabad('0x32')](_0x10bbda[_0xabad('0x33')],_0x10bbda[_0xabad('0x2f')]);_0x95cdab[_0xabad('0x34')]=_[_0xabad('0x32')](_0x10bbda[_0xabad('0x33')],qs[_0xabad('0x35')](_0x4470a2[_0xabad('0x2f')]['fields']));_0x95cdab[_0xabad('0x34')]=_0x95cdab[_0xabad('0x34')][_0xabad('0x36')]?_0x95cdab[_0xabad('0x34')]:_0x10bbda['model'];if(!_0x4470a2['query'][_0xabad('0x37')]('nolimit')){_0x95cdab[_0xabad('0x1c')]=qs[_0xabad('0x1c')](_0x4470a2[_0xabad('0x2f')][_0xabad('0x1c')]);_0x95cdab[_0xabad('0x1b')]=qs['offset'](_0x4470a2[_0xabad('0x2f')]['offset']);}_0x95cdab['order']=qs[_0xabad('0x38')](_0x4470a2[_0xabad('0x2f')]['sort']);_0x95cdab['where']=qs['filters'](_['pick'](_0x4470a2[_0xabad('0x2f')],_0x10bbda[_0xabad('0x31')]),_0x49942d);if(_0x4470a2[_0xabad('0x2f')]['filter']){_0x95cdab['where']=_[_0xabad('0x39')](_0x95cdab[_0xabad('0x3a')],{'$or':_[_0xabad('0x29')](_0x49942d,function(_0x5d6f2a){if(_0x5d6f2a[_0xabad('0x2d')]!==_0xabad('0x3b')){var _0x24d9ef={};_0x24d9ef[_0x5d6f2a[_0xabad('0x27')]]={'$like':'%'+_0x4470a2[_0xabad('0x2f')][_0xabad('0x3c')]+'%'};return _0x24d9ef;}})});}_0x95cdab=_[_0xabad('0x39')]({},_0x95cdab,_0x4470a2[_0xabad('0x3d')]);var _0x2e65bc={'where':_0x95cdab[_0xabad('0x3a')]};return db[_0xabad('0x2a')][_0xabad('0x1d')](_0x2e65bc)[_0xabad('0x22')](function(_0xcaa11d){_0x3852cc[_0xabad('0x1d')]=_0xcaa11d;if(_0x4470a2[_0xabad('0x2f')][_0xabad('0x3e')]){_0x95cdab['include']=[{'all':!![]}];}return db[_0xabad('0x2a')][_0xabad('0x3f')](_0x95cdab);})[_0xabad('0x22')](function(_0x5979ef){_0x3852cc[_0xabad('0x40')]=_0x5979ef;return _0x3852cc;})[_0xabad('0x22')](respondWithFilteredResult(_0x2d10ae,_0x95cdab))[_0xabad('0x41')](handleError(_0x2d10ae,null));};exports['show']=function(_0xa6112b,_0x150dad){var _0x19ab06={'raw':!![],'where':{'id':_0xa6112b['params']['id']}},_0x47be7c={};_0x47be7c[_0xabad('0x33')]=_[_0xabad('0x30')](db[_0xabad('0x2a')][_0xabad('0x2b')]);_0x47be7c[_0xabad('0x2f')]=_[_0xabad('0x30')](_0xa6112b['query']);_0x47be7c[_0xabad('0x31')]=_[_0xabad('0x32')](_0x47be7c['model'],_0x47be7c[_0xabad('0x2f')]);_0x19ab06['attributes']=_[_0xabad('0x32')](_0x47be7c['model'],qs[_0xabad('0x35')](_0xa6112b[_0xabad('0x2f')][_0xabad('0x35')]));_0x19ab06[_0xabad('0x34')]=_0x19ab06[_0xabad('0x34')]['length']?_0x19ab06['attributes']:_0x47be7c[_0xabad('0x33')];if(_0xa6112b[_0xabad('0x2f')][_0xabad('0x3e')]){_0x19ab06[_0xabad('0x42')]=[{'all':!![]}];}_0x19ab06=_[_0xabad('0x39')]({},_0x19ab06,_0xa6112b[_0xabad('0x3d')]);return db['SmsQueue']['find'](_0x19ab06)[_0xabad('0x22')](handleEntityNotFound(_0x150dad,null))[_0xabad('0x22')](respondWithResult(_0x150dad,null))[_0xabad('0x41')](handleError(_0x150dad,null));};exports[_0xabad('0x43')]=function(_0x307598,_0x2f570f){return db[_0xabad('0x2a')]['create'](_0x307598['body'],{})[_0xabad('0x22')](function(_0x638acd){var _0x3d1b56=_0x307598[_0xabad('0x44')][_0xabad('0x45')]({'plain':!![]});if(!_0x3d1b56)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3d1b56[_0xabad('0x46')]===_0xabad('0x44')){var _0x44415c=_0x638acd[_0xabad('0x45')]({'plain':!![]});var _0xab34b2=_0xabad('0x47');return db['UserProfileSection']['find']({'where':{'name':_0xab34b2,'userProfileId':_0x3d1b56[_0xabad('0x48')]},'raw':!![]})[_0xabad('0x22')](function(_0x468072){if(_0x468072&&_0x468072[_0xabad('0x49')]===0x0){return db[_0xabad('0x24')][_0xabad('0x43')]({'name':_0x44415c['name'],'resourceId':_0x44415c['id'],'type':_0x468072[_0xabad('0x27')],'sectionId':_0x468072['id']},{})[_0xabad('0x22')](function(){return _0x638acd;});}else{return _0x638acd;}})[_0xabad('0x41')](function(_0x2c2902){logger['error'](_0xabad('0x4a'),_0x2c2902);throw _0x2c2902;});}return _0x638acd;})[_0xabad('0x22')](respondWithResult(_0x2f570f,0xc9))['catch'](handleError(_0x2f570f,null));};exports[_0xabad('0x21')]=function(_0x334e4a,_0x938cd6){if(_0x334e4a[_0xabad('0x4b')]['id']){delete _0x334e4a['body']['id'];}return db['SmsQueue'][_0xabad('0x4c')]({'where':{'id':_0x334e4a[_0xabad('0x4d')]['id']}})[_0xabad('0x22')](handleEntityNotFound(_0x938cd6,null))[_0xabad('0x22')](saveUpdates(_0x334e4a[_0xabad('0x4b')],null))[_0xabad('0x22')](respondWithResult(_0x938cd6,null))[_0xabad('0x41')](handleError(_0x938cd6,null));};exports[_0xabad('0x23')]=function(_0x565c0c,_0x36de09){return db[_0xabad('0x2a')][_0xabad('0x4c')]({'where':{'id':_0x565c0c['params']['id']}})[_0xabad('0x22')](handleEntityNotFound(_0x36de09,null))[_0xabad('0x22')](removeEntity(_0x36de09,null))[_0xabad('0x41')](handleError(_0x36de09,null));};exports['describe']=function(_0x1c7fa9,_0x47e0ab){return db[_0xabad('0x2a')][_0xabad('0x4e')]()[_0xabad('0x22')](respondWithResult(_0x47e0ab,null))[_0xabad('0x41')](handleError(_0x47e0ab,null));};exports[_0xabad('0x4f')]=function(_0x2fddf9,_0x42662a,_0xefac6c){var _0x269f9b={'raw':!![],'where':{}},_0x1f1e01={},_0x2ec9f8;return db[_0xabad('0x2a')][_0xabad('0x50')]({'where':{'id':_0x2fddf9[_0xabad('0x4d')]['id']}})[_0xabad('0x22')](handleEntityNotFound(_0x42662a,null))['then'](function(_0x4bd3a5){if(_0x4bd3a5){_0x2ec9f8=_0x4bd3a5[_0xabad('0x45')]({'plain':!![]});_0x1f1e01[_0xabad('0x33')]=_[_0xabad('0x30')](db[_0xabad('0x51')][_0xabad('0x2b')]);_0x1f1e01[_0xabad('0x2f')]=_['keys'](_0x2fddf9[_0xabad('0x2f')]);_0x1f1e01[_0xabad('0x31')]=_['intersection'](_0x1f1e01[_0xabad('0x33')],_0x1f1e01[_0xabad('0x2f')]);_0x269f9b[_0xabad('0x34')]=_['intersection'](_0x1f1e01[_0xabad('0x33')],qs[_0xabad('0x35')](_0x2fddf9['query']['fields']));_0x269f9b[_0xabad('0x34')]=_0x269f9b[_0xabad('0x34')][_0xabad('0x36')]?_0x269f9b[_0xabad('0x34')]:_0x1f1e01[_0xabad('0x33')];if(!_0x2fddf9[_0xabad('0x2f')][_0xabad('0x37')](_0xabad('0x52'))){_0x269f9b['limit']=qs[_0xabad('0x1c')](_0x2fddf9[_0xabad('0x2f')][_0xabad('0x1c')]);_0x269f9b[_0xabad('0x1b')]=qs[_0xabad('0x1b')](_0x2fddf9[_0xabad('0x2f')][_0xabad('0x1b')]);}_0x269f9b[_0xabad('0x53')]=qs['sort'](_0x2fddf9[_0xabad('0x2f')][_0xabad('0x38')]);_0x269f9b['where']=qs[_0xabad('0x31')](_[_0xabad('0x54')](_0x2fddf9[_0xabad('0x2f')],_0x1f1e01['filters']));_0x269f9b['where'][_0xabad('0x55')]=_0x4bd3a5['id'];if(_0x2fddf9[_0xabad('0x2f')][_0xabad('0x3c')]){_0x269f9b[_0xabad('0x3a')]=_[_0xabad('0x39')](_0x269f9b[_0xabad('0x3a')],{'$or':_[_0xabad('0x29')](_0x269f9b['attributes'],function(_0x36bd39){var _0x30372c={};_0x30372c[_0x36bd39]={'$like':'%'+_0x2fddf9[_0xabad('0x2f')][_0xabad('0x3c')]+'%'};return _0x30372c;})});}_0x269f9b=_[_0xabad('0x39')]({},_0x269f9b,_0x2fddf9['options']);return db[_0xabad('0x51')]['findAll'](_0x269f9b);}})['then'](function(_0x7afc47){if(_0x7afc47){return db[_0xabad('0x56')][_0xabad('0x57')]({'where':{'id':_[_0xabad('0x29')](_0x7afc47,_0xabad('0x58')),'role':'agent'},'attributes':['id',_0xabad('0x27'),'smsPause',_0xabad('0x59'),_0xabad('0x5a')]});}})[_0xabad('0x22')](function(_0x5c9734){if(_0x5c9734){return{'count':_0x5c9734['count'],'rows':_[_0xabad('0x29')](_0x5c9734[_0xabad('0x40')],function(_0x43f400){return{'membername':_0x43f400[_0xabad('0x27')],'UserId':_0x43f400['id'],'queue_name':_0x2ec9f8[_0xabad('0x27')],'SmsQueueId':_0x2ec9f8['id'],'interface':util[_0xabad('0x5b')](_0xabad('0x5c'),_0xabad('0x5d'),_0x43f400[_0xabad('0x27')]),'penalty':0x0,'paused':_0x43f400[_0xabad('0x5e')],'createdAt':_0x43f400[_0xabad('0x5a')],'updatedAt':_0x43f400['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xabad('0x22')](respondWithFilteredResult(_0x42662a,_0x269f9b))[_0xabad('0x41')](handleError(_0x42662a,null));};exports['getTeams']=function(_0x3ab248,_0x219d97,_0x3f4b76){var _0x4d115f={};var _0x440b9a={};var _0x2d0dc2;var _0x29e265;return db[_0xabad('0x2a')][_0xabad('0x50')]({'where':{'id':_0x3ab248['params']['id']}})[_0xabad('0x22')](handleEntityNotFound(_0x219d97,null))[_0xabad('0x22')](function(_0x44cc7f){if(_0x44cc7f){_0x2d0dc2=_0x44cc7f;_0x440b9a[_0xabad('0x33')]=_[_0xabad('0x30')](db['Team'][_0xabad('0x2b')]);_0x440b9a['query']=_[_0xabad('0x30')](_0x3ab248['query']);_0x440b9a[_0xabad('0x31')]=_['intersection'](_0x440b9a['model'],_0x440b9a[_0xabad('0x2f')]);_0x4d115f[_0xabad('0x34')]=_[_0xabad('0x32')](_0x440b9a[_0xabad('0x33')],qs['fields'](_0x3ab248['query'][_0xabad('0x35')]));_0x4d115f['attributes']=_0x4d115f[_0xabad('0x34')][_0xabad('0x36')]?_0x4d115f[_0xabad('0x34')]:_0x440b9a[_0xabad('0x33')];_0x4d115f[_0xabad('0x53')]=qs[_0xabad('0x38')](_0x3ab248[_0xabad('0x2f')]['sort']);_0x4d115f['where']=qs[_0xabad('0x31')](_[_0xabad('0x54')](_0x3ab248[_0xabad('0x2f')],_0x440b9a[_0xabad('0x31')]));if(_0x3ab248[_0xabad('0x2f')][_0xabad('0x3c')]){_0x4d115f['where']=_['merge'](_0x4d115f[_0xabad('0x3a')],{'$or':_[_0xabad('0x29')](_0x4d115f[_0xabad('0x34')],function(_0x4bb24a){var _0x2b041f={};_0x2b041f[_0x4bb24a]={'$like':'%'+_0x3ab248[_0xabad('0x2f')][_0xabad('0x3c')]+'%'};return _0x2b041f;})});}_0x4d115f=_['merge']({},_0x4d115f,_0x3ab248[_0xabad('0x3d')]);return _0x2d0dc2[_0xabad('0x5f')](_0x4d115f);}})[_0xabad('0x22')](function(_0x2d8231){if(_0x2d8231){_0x29e265=_0x2d8231[_0xabad('0x36')];if(!_0x3ab248[_0xabad('0x2f')]['hasOwnProperty']('nolimit')){_0x4d115f[_0xabad('0x1c')]=qs[_0xabad('0x1c')](_0x3ab248[_0xabad('0x2f')][_0xabad('0x1c')]);_0x4d115f['offset']=qs['offset'](_0x3ab248['query'][_0xabad('0x1b')]);}return _0x2d0dc2['getTeams'](_0x4d115f);}})[_0xabad('0x22')](function(_0x15e3e6){if(_0x15e3e6){return _0x15e3e6?{'count':_0x29e265,'rows':_0x15e3e6}:null;}})[_0xabad('0x22')](respondWithResult(_0x219d97,null))[_0xabad('0x41')](handleError(_0x219d97,null));};exports[_0xabad('0x60')]=function(_0x50af2c,_0x4ab5d3,_0x16cd45){var _0x132c49=_0x50af2c[_0xabad('0x4b')]['ids'];return db[_0xabad('0x61')][_0xabad('0x3f')]({'where':{'id':_0x132c49},'attributes':['id'],'include':[{'model':db['User'],'as':_0xabad('0x62'),'attributes':['id',_0xabad('0x27'),_0xabad('0x63'),_0xabad('0x64'),_0xabad('0x65')],'raw':!![]}]})[_0xabad('0x22')](function(_0x51251a){if(_0x51251a){var _0x1eb115=_['flatMap'](_0x51251a,function(_0x45e6cd){var _0x1ff69c=_0x45e6cd[_0xabad('0x45')]({'plain':!![]});return _0x1ff69c['Agents'];});return db[_0xabad('0x2a')][_0xabad('0x4c')]({'where':{'id':_0x50af2c[_0xabad('0x4d')]['id']}})['then'](function(_0x549520){return db['sequelize'][_0xabad('0x66')](function(_0x36675a){return _0x549520[_0xabad('0x60')](_0x132c49,{'transaction':_0x36675a})['then'](function(){return BPromise[_0xabad('0x67')](_0x1eb115,function(_0x860d14){return db[_0xabad('0x51')]['findOrCreate']({'where':{'UserId':_0x860d14['id'],'SmsQueueId':_0x50af2c[_0xabad('0x4d')]['id']},'transaction':_0x36675a});});})[_0xabad('0x22')](function(){_0x1eb115['forEach'](function(_0x5f4248){socket[_0xabad('0x68')](_0xabad('0x69'),{'UserId':_0x5f4248['id'],'SmsQueueId':_0x549520['id']});});});});});}})[_0xabad('0x22')](respondWithStatusCode(_0x4ab5d3,null))['catch'](handleError(_0x4ab5d3,null));};exports[_0xabad('0x6a')]=function(_0x16a4a5,_0x51fd6b,_0x4d4d65){return db['Team']['findAll']({'where':{'id':_0x16a4a5[_0xabad('0x2f')][_0xabad('0x6b')]},'attributes':['id'],'include':[{'model':db[_0xabad('0x56')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xabad('0x22')](handleEntityNotFound(_0x51fd6b,null))[_0xabad('0x22')](function(_0x1c7c26){var _0x2cf525=_[_0xabad('0x29')](_0x1c7c26,'id');var _0x465cbf=[];var _0x1a393a=[];var _0xa1b35a=squel[_0xabad('0x6c')]();_0xa1b35a['field']('tq.TeamId')['from'](_0xabad('0x6d'),'tq')[_0xabad('0x6e')](_0xabad('0x6f'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where']('SmsQueueId\x20=\x20?',_0x16a4a5['params']['id']);for(var _0x4feceb=0x0;_0x4feceb<_0x1c7c26[_0xabad('0x36')];_0x4feceb+=0x1){let _0x34a4b2=_0x1c7c26[_0x4feceb];for(var _0x5f3f66=0x0;_0x5f3f66<_0x34a4b2[_0xabad('0x62')][_0xabad('0x36')];_0x5f3f66+=0x1){let _0x24adf8=_0x34a4b2[_0xabad('0x62')][_0x5f3f66];var _0x26a9e2=_0xa1b35a['clone']();_0x26a9e2[_0xabad('0x3a')](_0xabad('0x70'),_0x24adf8['id']);_0x1a393a['push'](db[_0xabad('0x71')][_0xabad('0x2f')](_0x26a9e2[_0xabad('0x72')](),{'type':db[_0xabad('0x71')]['QueryTypes'][_0xabad('0x73')]})[_0xabad('0x22')](function(_0x35401c){if(_0x35401c[_0xabad('0x36')]===0x1){return _0x24adf8['id'];}else{var _0x3eae33=_[_0xabad('0x74')](_['map'](_0x35401c,_0xabad('0x75')),function(_0xc00344){return _[_0xabad('0x76')](_0x2cf525,_0xc00344);});if(_0x3eae33){return _0x24adf8['id'];}}}));}}return BPromise[_0xabad('0x77')](_0x1a393a)[_0xabad('0x22')](function(_0x573ed5){_0x465cbf=_(_0x465cbf)[_0xabad('0x78')](_0x573ed5)[_0xabad('0x79')]()['value']();return db[_0xabad('0x2a')][_0xabad('0x4c')]({'where':{'id':_0x16a4a5['params']['id']}})[_0xabad('0x22')](function(_0x4e3806){return db[_0xabad('0x71')][_0xabad('0x66')](function(_0x3a1371){return _0x4e3806[_0xabad('0x6a')](_0x16a4a5['query'][_0xabad('0x6b')],{'transaction':_0x3a1371})[_0xabad('0x22')](function(){if(!_[_0xabad('0x7a')](_0x465cbf)){return _0x4e3806[_0xabad('0x7b')](_0x465cbf,{'transaction':_0x3a1371});}})[_0xabad('0x22')](function(){_0x465cbf['forEach'](function(_0x5dad31){socket[_0xabad('0x68')](_0xabad('0x7c'),{'UserId':_0x5dad31,'SmsQueueId':_0x4e3806['id']});});});});});});})['then'](respondWithStatusCode(_0x51fd6b,null))[_0xabad('0x41')](handleError(_0x51fd6b,null));};exports['addAgents']=function(_0x1abca8,_0x3b29b9,_0x4af40f){return db[_0xabad('0x2a')][_0xabad('0x4c')]({'where':{'id':_0x1abca8['params']['id']}})[_0xabad('0x22')](handleEntityNotFound(_0x3b29b9,null))[_0xabad('0x22')](function(_0x194d2b){if(_0x194d2b){return _0x194d2b[_0xabad('0x7d')](_0x1abca8[_0xabad('0x4b')][_0xabad('0x6b')],_[_0xabad('0x7e')](_0x1abca8[_0xabad('0x4b')],['ids','id'])||{})[_0xabad('0x7f')](function(_0x2619aa){for(var _0x5a6581=0x0;_0x5a6581<_0x1abca8['body'][_0xabad('0x6b')][_0xabad('0x36')];_0x5a6581+=0x1){socket['emit'](_0xabad('0x69'),{'UserId':Number(_0x1abca8[_0xabad('0x4b')][_0xabad('0x6b')][_0x5a6581]),'SmsQueueId':Number(_0x1abca8[_0xabad('0x4d')]['id'])});}return _0x2619aa;});}})['then'](respondWithResult(_0x3b29b9,null))[_0xabad('0x41')](handleError(_0x3b29b9,null));};exports[_0xabad('0x7b')]=function(_0x1cf39a,_0x31b86e,_0x554f95){return db['SmsQueue'][_0xabad('0x4c')]({'where':{'id':_0x1cf39a['params']['id']}})[_0xabad('0x22')](handleEntityNotFound(_0x31b86e,null))[_0xabad('0x22')](function(_0x1868f3){if(_0x1868f3){return _0x1868f3[_0xabad('0x7b')](_0x1cf39a['query'][_0xabad('0x6b')])[_0xabad('0x22')](function(){if(_[_0xabad('0x80')](_0x1cf39a[_0xabad('0x2f')][_0xabad('0x6b')])){for(var _0x49949d=0x0;_0x49949d<_0x1cf39a[_0xabad('0x2f')][_0xabad('0x6b')]['length'];_0x49949d+=0x1){socket[_0xabad('0x68')](_0xabad('0x7c'),{'UserId':Number(_0x1cf39a[_0xabad('0x2f')][_0xabad('0x6b')][_0x49949d]),'SmsQueueId':Number(_0x1cf39a['params']['id'])});}}else{socket[_0xabad('0x68')]('userSmsQueue:remove',{'UserId':Number(_0x1cf39a[_0xabad('0x2f')][_0xabad('0x6b')]),'SmsQueueId':Number(_0x1cf39a[_0xabad('0x4d')]['id'])});}});}})[_0xabad('0x22')](respondWithStatusCode(_0x31b86e,null))[_0xabad('0x41')](handleError(_0x31b86e,null));};exports[_0xabad('0x81')]=function(_0x1eb38e,_0x56d060,_0x4ead9c){var _0x3fbb31={};var _0x5edf08={};var _0x4b8a79;var _0x3a4095;return db['SmsQueue'][_0xabad('0x50')]({'where':{'id':_0x1eb38e[_0xabad('0x4d')]['id']}})[_0xabad('0x22')](handleEntityNotFound(_0x56d060,null))[_0xabad('0x22')](function(_0x1f1900){if(_0x1f1900){_0x4b8a79=_0x1f1900;_0x5edf08[_0xabad('0x33')]=_['keys'](db[_0xabad('0x56')][_0xabad('0x2b')]);_0x5edf08[_0xabad('0x2f')]=_[_0xabad('0x30')](_0x1eb38e[_0xabad('0x2f')]);_0x5edf08[_0xabad('0x31')]=_[_0xabad('0x32')](_0x5edf08[_0xabad('0x33')],_0x5edf08['query']);_0x3fbb31[_0xabad('0x34')]=_[_0xabad('0x32')](_0x5edf08[_0xabad('0x33')],qs[_0xabad('0x35')](_0x1eb38e[_0xabad('0x2f')][_0xabad('0x35')]));_0x3fbb31['attributes']=_0x3fbb31[_0xabad('0x34')]['length']?_0x3fbb31[_0xabad('0x34')]:_0x5edf08[_0xabad('0x33')];_0x3fbb31[_0xabad('0x53')]=qs['sort'](_0x1eb38e[_0xabad('0x2f')][_0xabad('0x38')]);_0x3fbb31[_0xabad('0x3a')]=qs[_0xabad('0x31')](_[_0xabad('0x54')](_0x1eb38e[_0xabad('0x2f')],_0x5edf08[_0xabad('0x31')]));if(_0x1eb38e[_0xabad('0x2f')][_0xabad('0x3c')]){_0x3fbb31['where']=_[_0xabad('0x39')](_0x3fbb31[_0xabad('0x3a')],{'$or':_[_0xabad('0x29')](_0x3fbb31[_0xabad('0x34')],function(_0x51fb3a){var _0x21438e={};_0x21438e[_0x51fb3a]={'$like':'%'+_0x1eb38e[_0xabad('0x2f')][_0xabad('0x3c')]+'%'};return _0x21438e;})});}_0x3fbb31=_[_0xabad('0x39')]({},_0x3fbb31,_0x1eb38e['options']);return _0x4b8a79[_0xabad('0x81')](_0x3fbb31);}})[_0xabad('0x22')](function(_0x5515df){if(_0x5515df){_0x3a4095=_0x5515df['length'];if(!_0x1eb38e[_0xabad('0x2f')][_0xabad('0x37')](_0xabad('0x52'))){_0x3fbb31[_0xabad('0x1c')]=qs[_0xabad('0x1c')](_0x1eb38e['query'][_0xabad('0x1c')]);_0x3fbb31[_0xabad('0x1b')]=qs['offset'](_0x1eb38e[_0xabad('0x2f')][_0xabad('0x1b')]);}return _0x4b8a79['getAgents'](_0x3fbb31);}})[_0xabad('0x22')](function(_0x200102){if(_0x200102){return _0x200102?{'count':_0x3a4095,'rows':_0x200102}:null;}})[_0xabad('0x22')](respondWithResult(_0x56d060,null))[_0xabad('0x41')](handleError(_0x56d060,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 619e476..ce5b666 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 _0x7867=['emit','hasOwnProperty','hook','exports','../../mysqldb','SmsQueue','setMaxListeners','update','remove'];(function(_0x37f810,_0x5d4e5c){var _0x4365f7=function(_0x1b886a){while(--_0x1b886a){_0x37f810['push'](_0x37f810['shift']());}};_0x4365f7(++_0x5d4e5c);}(_0x7867,0x175));var _0x7786=function(_0x3d102f,_0x24159e){_0x3d102f=_0x3d102f-0x0;var _0x4ac41b=_0x7867[_0x3d102f];return _0x4ac41b;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0x7786('0x0'))['db'][_0x7786('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x7786('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7786('0x3'),'afterDestroy':_0x7786('0x4')};function emitEvent(_0x52422d){return function(_0x32b244,_0x18003f,_0x5af723){SmsQueueEvents[_0x7786('0x5')](_0x52422d+':'+_0x32b244['id'],_0x32b244);SmsQueueEvents['emit'](_0x52422d,_0x32b244);_0x5af723(null);};}for(var e in events){if(events[_0x7786('0x6')](e)){var event=events[e];SmsQueue[_0x7786('0x7')](e,emitEvent(event));}}module[_0x7786('0x8')]=SmsQueueEvents; \ No newline at end of file +var _0x2e76=['remove','emit','events','SmsQueue','setMaxListeners','update'];(function(_0x4d1ee9,_0x394a78){var _0x9a5456=function(_0x224f3b){while(--_0x224f3b){_0x4d1ee9['push'](_0x4d1ee9['shift']());}};_0x9a5456(++_0x394a78);}(_0x2e76,0x1ca));var _0x62e7=function(_0x52229f,_0x406149){_0x52229f=_0x52229f-0x0;var _0x48d274=_0x2e76[_0x52229f];return _0x48d274;};'use strict';var EventEmitter=require(_0x62e7('0x0'));var SmsQueue=require('../../mysqldb')['db'][_0x62e7('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x62e7('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x62e7('0x3'),'afterDestroy':_0x62e7('0x4')};function emitEvent(_0x320474){return function(_0x3d4fbf,_0x25fa13,_0xbd85e6){SmsQueueEvents['emit'](_0x320474+':'+_0x3d4fbf['id'],_0x3d4fbf);SmsQueueEvents[_0x62e7('0x5')](_0x320474,_0x3d4fbf);_0xbd85e6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module['exports']=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 2d0ec36..3dd9698 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 _0xa385=['sms_queues','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./smsQueue.attributes','define','SmsQueue'];(function(_0x12ac45,_0xeb2f08){var _0x72a550=function(_0xe8be35){while(--_0xe8be35){_0x12ac45['push'](_0x12ac45['shift']());}};_0x72a550(++_0xeb2f08);}(_0xa385,0x12d));var _0x5a38=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xa385[_0x8c43de];return _0xa6591b;};'use strict';var _=require(_0x5a38('0x0'));var util=require(_0x5a38('0x1'));var logger=require(_0x5a38('0x2'))('api');var moment=require(_0x5a38('0x3'));var BPromise=require('bluebird');var rp=require(_0x5a38('0x4'));var fs=require('fs');var path=require(_0x5a38('0x5'));var rimraf=require(_0x5a38('0x6'));var config=require(_0x5a38('0x7'));var attributes=require(_0x5a38('0x8'));module['exports']=function(_0x28734a,_0x476e19){return _0x28734a[_0x5a38('0x9')](_0x5a38('0xa'),attributes,{'tableName':_0x5a38('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x97fd=['sms_queues','util','bluebird','request-promise','path','rimraf','./smsQueue.attributes','exports','SmsQueue'];(function(_0x5938e7,_0x11315a){var _0x832d2a=function(_0x576137){while(--_0x576137){_0x5938e7['push'](_0x5938e7['shift']());}};_0x832d2a(++_0x11315a);}(_0x97fd,0x145));var _0xd97f=function(_0x136d9b,_0x24b8fc){_0x136d9b=_0x136d9b-0x0;var _0x45d902=_0x97fd[_0x136d9b];return _0x45d902;};'use strict';var _=require('lodash');var util=require(_0xd97f('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xd97f('0x1'));var rp=require(_0xd97f('0x2'));var fs=require('fs');var path=require(_0xd97f('0x3'));var rimraf=require(_0xd97f('0x4'));var config=require('../../config/environment');var attributes=require(_0xd97f('0x5'));module[_0xd97f('0x6')]=function(_0x5317dc,_0x1b88fc){return _0x5317dc['define'](_0xd97f('0x7'),attributes,{'tableName':_0xd97f('0x8'),'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 e8671aa..32572cd 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 _0x5ab7=['then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','result','SmsQueue','options','raw','where','attributes','include','map','model','GetSmsQueue','message','ShowSmsQueue','find','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','localhost','socket.io-emitter','redis','register','request'];(function(_0x5b7e20,_0x17cfec){var _0x57eddf=function(_0x486ca0){while(--_0x486ca0){_0x5b7e20['push'](_0x5b7e20['shift']());}};_0x57eddf(++_0x17cfec);}(_0x5ab7,0x157));var _0x75ab=function(_0x219692,_0x5af86c){_0x219692=_0x219692-0x0;var _0x35fb96=_0x5ab7[_0x219692];return _0x35fb96;};'use strict';var _=require(_0x75ab('0x0'));var util=require(_0x75ab('0x1'));var moment=require(_0x75ab('0x2'));var BPromise=require(_0x75ab('0x3'));var rs=require(_0x75ab('0x4'));var fs=require('fs');var Redis=require(_0x75ab('0x5'));var db=require(_0x75ab('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x75ab('0x7'))(_0x75ab('0x8'));var config=require(_0x75ab('0x9'));var jayson=require(_0x75ab('0xa'));var client=jayson['client'][_0x75ab('0xb')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x75ab('0xc'),'port':0x18eb});var socket=require(_0x75ab('0xd'))(new Redis(config[_0x75ab('0xe')]));require('./smsQueue.socket')[_0x75ab('0xf')](socket);function respondWithRpcPromise(_0x48987d,_0x30fdeb,_0x19e1fe){return new BPromise(function(_0x32cc9f,_0x2ffec4){return client[_0x75ab('0x10')](_0x48987d,_0x19e1fe)[_0x75ab('0x11')](function(_0x46e423){logger[_0x75ab('0x12')](_0x75ab('0x13'),_0x30fdeb,_0x75ab('0x14'));logger[_0x75ab('0x15')](_0x75ab('0x16'),_0x30fdeb,_0x75ab('0x14'),JSON[_0x75ab('0x17')](_0x46e423));if(_0x46e423[_0x75ab('0x18')]){if(_0x46e423[_0x75ab('0x18')][_0x75ab('0x19')]===0x1f4){logger['error'](_0x75ab('0x13'),_0x30fdeb,_0x46e423[_0x75ab('0x18')]['message']);return _0x2ffec4(_0x46e423[_0x75ab('0x18')]['message']);}logger['error'](_0x75ab('0x13'),_0x30fdeb,_0x46e423[_0x75ab('0x18')]['message']);return _0x32cc9f(_0x46e423[_0x75ab('0x18')]['message']);}else{logger[_0x75ab('0x12')](_0x75ab('0x13'),_0x30fdeb,_0x75ab('0x14'));_0x32cc9f(_0x46e423[_0x75ab('0x1a')]['message']);}})['catch'](function(_0x4a264c){logger['error'](_0x75ab('0x13'),_0x30fdeb,_0x4a264c);_0x2ffec4(_0x4a264c);});});}exports['GetSmsQueue']=function(_0x409608){var _0x3ddfe7=this;return new Promise(function(_0x4fa9d6,_0x327555){return db[_0x75ab('0x1b')]['findAll']({'raw':_0x409608['options']?_0x409608[_0x75ab('0x1c')][_0x75ab('0x1d')]===undefined?!![]:![]:!![],'where':_0x409608[_0x75ab('0x1c')]?_0x409608[_0x75ab('0x1c')][_0x75ab('0x1e')]||null:null,'attributes':_0x409608[_0x75ab('0x1c')]?_0x409608[_0x75ab('0x1c')][_0x75ab('0x1f')]||null:null,'limit':_0x409608[_0x75ab('0x1c')]?_0x409608[_0x75ab('0x1c')]['limit']||null:null,'include':_0x409608[_0x75ab('0x1c')]?_0x409608['options'][_0x75ab('0x20')]?_[_0x75ab('0x21')](_0x409608[_0x75ab('0x1c')]['include'],function(_0x50ab53){return{'model':db[_0x50ab53[_0x75ab('0x22')]],'as':_0x50ab53['as'],'attributes':_0x50ab53[_0x75ab('0x1f')],'include':_0x50ab53[_0x75ab('0x20')]?_['map'](_0x50ab53[_0x75ab('0x20')],function(_0x3dfa0d){return{'model':db[_0x3dfa0d['model']],'as':_0x3dfa0d['as'],'attributes':_0x3dfa0d[_0x75ab('0x1f')],'include':_0x3dfa0d['include']?_[_0x75ab('0x21')](_0x3dfa0d[_0x75ab('0x20')],function(_0x4ea0d9){return{'model':db[_0x4ea0d9['model']],'as':_0x4ea0d9['as'],'attributes':_0x4ea0d9[_0x75ab('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x75ab('0x11')](function(_0x2226c5){logger['info']('GetSmsQueue',_0x409608);logger[_0x75ab('0x15')](_0x75ab('0x23'),_0x409608,JSON[_0x75ab('0x17')](_0x2226c5));_0x4fa9d6(_0x2226c5);})['catch'](function(_0x47a6ea){logger['error']('GetSmsQueue',_0x47a6ea[_0x75ab('0x24')],_0x409608);_0x327555(_0x3ddfe7['error'](0x1f4,_0x47a6ea[_0x75ab('0x24')]));});});};exports[_0x75ab('0x25')]=function(_0x2844c3){var _0x5588d7=this;return new Promise(function(_0x56af6e,_0x356557){return db[_0x75ab('0x1b')][_0x75ab('0x26')]({'raw':_0x2844c3[_0x75ab('0x1c')]?_0x2844c3['options']['raw']===undefined?!![]:![]:!![],'where':_0x2844c3[_0x75ab('0x1c')]?_0x2844c3['options'][_0x75ab('0x1e')]||null:null,'attributes':_0x2844c3[_0x75ab('0x1c')]?_0x2844c3[_0x75ab('0x1c')][_0x75ab('0x1f')]||null:null,'include':_0x2844c3[_0x75ab('0x1c')]?_0x2844c3[_0x75ab('0x1c')][_0x75ab('0x20')]?_[_0x75ab('0x21')](_0x2844c3[_0x75ab('0x1c')][_0x75ab('0x20')],function(_0x462640){return{'model':db[_0x462640[_0x75ab('0x22')]],'as':_0x462640['as'],'attributes':_0x462640[_0x75ab('0x1f')],'include':_0x462640[_0x75ab('0x20')]?_[_0x75ab('0x21')](_0x462640['include'],function(_0x41cfcb){return{'model':db[_0x41cfcb[_0x75ab('0x22')]],'as':_0x41cfcb['as'],'attributes':_0x41cfcb[_0x75ab('0x1f')],'include':_0x41cfcb['include']?_['map'](_0x41cfcb[_0x75ab('0x20')],function(_0x30fc2e){return{'model':db[_0x30fc2e[_0x75ab('0x22')]],'as':_0x30fc2e['as'],'attributes':_0x30fc2e[_0x75ab('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x75ab('0x11')](function(_0x2b7553){logger[_0x75ab('0x12')]('ShowSmsQueue',_0x2844c3);logger[_0x75ab('0x15')](_0x75ab('0x25'),_0x2844c3,JSON[_0x75ab('0x17')](_0x2b7553));_0x56af6e(_0x2b7553);})[_0x75ab('0x27')](function(_0xf45c12){logger[_0x75ab('0x18')](_0x75ab('0x25'),_0xf45c12[_0x75ab('0x24')],_0x2844c3);_0x356557(_0x5588d7['error'](0x1f4,_0xf45c12[_0x75ab('0x24')]));});});}; \ No newline at end of file +var _0x5563=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','defaults','redis','socket.io-emitter','register','then','info','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','error','code','SmsQueue,\x20%s,\x20%s','message','catch','GetSmsQueue','findAll','options','limit','include','map','model','attributes','stringify','SmsQueue','raw','ShowSmsQueue','lodash','util','moment'];(function(_0x1693fc,_0x48b09d){var _0x5bf0e5=function(_0x350c15){while(--_0x350c15){_0x1693fc['push'](_0x1693fc['shift']());}};_0x5bf0e5(++_0x48b09d);}(_0x5563,0x107));var _0x3556=function(_0xea2c9f,_0x39cd86){_0xea2c9f=_0xea2c9f-0x0;var _0x5989c2=_0x5563[_0xea2c9f];return _0x5989c2;};'use strict';var _=require(_0x3556('0x0'));var util=require(_0x3556('0x1'));var moment=require(_0x3556('0x2'));var BPromise=require(_0x3556('0x3'));var rs=require(_0x3556('0x4'));var fs=require('fs');var Redis=require(_0x3556('0x5'));var db=require(_0x3556('0x6'))['db'];var utils=require(_0x3556('0x7'));var logger=require('../../config/logger')(_0x3556('0x8'));var config=require('../../config/environment');var jayson=require(_0x3556('0x9'));var client=jayson[_0x3556('0xa')][_0x3556('0xb')]({'port':0x232a});config['redis']=_[_0x3556('0xc')](config[_0x3556('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x3556('0xe'))(new Redis(config[_0x3556('0xd')]));require('./smsQueue.socket')[_0x3556('0xf')](socket);function respondWithRpcPromise(_0x2a076f,_0x5a2f81,_0x3b08d5){return new BPromise(function(_0x778adf,_0x57dc25){return client['request'](_0x2a076f,_0x3b08d5)[_0x3556('0x10')](function(_0x5c92d0){logger[_0x3556('0x11')]('SmsQueue,\x20%s,\x20%s',_0x5a2f81,_0x3556('0x12'));logger[_0x3556('0x13')](_0x3556('0x14'),_0x5a2f81,_0x3556('0x12'),JSON['stringify'](_0x5c92d0));if(_0x5c92d0[_0x3556('0x15')]){if(_0x5c92d0[_0x3556('0x15')][_0x3556('0x16')]===0x1f4){logger[_0x3556('0x15')](_0x3556('0x17'),_0x5a2f81,_0x5c92d0[_0x3556('0x15')][_0x3556('0x18')]);return _0x57dc25(_0x5c92d0[_0x3556('0x15')][_0x3556('0x18')]);}logger[_0x3556('0x15')](_0x3556('0x17'),_0x5a2f81,_0x5c92d0[_0x3556('0x15')][_0x3556('0x18')]);return _0x778adf(_0x5c92d0['error']['message']);}else{logger[_0x3556('0x11')](_0x3556('0x17'),_0x5a2f81,_0x3556('0x12'));_0x778adf(_0x5c92d0['result']['message']);}})[_0x3556('0x19')](function(_0x2d8700){logger['error']('SmsQueue,\x20%s,\x20%s',_0x5a2f81,_0x2d8700);_0x57dc25(_0x2d8700);});});}exports[_0x3556('0x1a')]=function(_0x5e755e){var _0xbed08f=this;return new Promise(function(_0x20a133,_0x553414){return db['SmsQueue'][_0x3556('0x1b')]({'raw':_0x5e755e[_0x3556('0x1c')]?_0x5e755e[_0x3556('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x5e755e[_0x3556('0x1c')]?_0x5e755e[_0x3556('0x1c')]['where']||null:null,'attributes':_0x5e755e['options']?_0x5e755e[_0x3556('0x1c')]['attributes']||null:null,'limit':_0x5e755e[_0x3556('0x1c')]?_0x5e755e[_0x3556('0x1c')][_0x3556('0x1d')]||null:null,'include':_0x5e755e[_0x3556('0x1c')]?_0x5e755e['options'][_0x3556('0x1e')]?_[_0x3556('0x1f')](_0x5e755e[_0x3556('0x1c')]['include'],function(_0x36c7a1){return{'model':db[_0x36c7a1[_0x3556('0x20')]],'as':_0x36c7a1['as'],'attributes':_0x36c7a1[_0x3556('0x21')],'include':_0x36c7a1[_0x3556('0x1e')]?_[_0x3556('0x1f')](_0x36c7a1[_0x3556('0x1e')],function(_0x3ebdc3){return{'model':db[_0x3ebdc3[_0x3556('0x20')]],'as':_0x3ebdc3['as'],'attributes':_0x3ebdc3[_0x3556('0x21')],'include':_0x3ebdc3['include']?_[_0x3556('0x1f')](_0x3ebdc3[_0x3556('0x1e')],function(_0x3a8de2){return{'model':db[_0x3a8de2[_0x3556('0x20')]],'as':_0x3a8de2['as'],'attributes':_0x3a8de2[_0x3556('0x21')]};}):[]};}):[]};}):[]:[]})[_0x3556('0x10')](function(_0x5b6123){logger[_0x3556('0x11')]('GetSmsQueue',_0x5e755e);logger[_0x3556('0x13')](_0x3556('0x1a'),_0x5e755e,JSON[_0x3556('0x22')](_0x5b6123));_0x20a133(_0x5b6123);})[_0x3556('0x19')](function(_0x61143f){logger['error'](_0x3556('0x1a'),_0x61143f[_0x3556('0x18')],_0x5e755e);_0x553414(_0xbed08f[_0x3556('0x15')](0x1f4,_0x61143f[_0x3556('0x18')]));});});};exports['ShowSmsQueue']=function(_0x25afb9){var _0x153e3b=this;return new Promise(function(_0x24321c,_0x4a7388){return db[_0x3556('0x23')]['find']({'raw':_0x25afb9[_0x3556('0x1c')]?_0x25afb9[_0x3556('0x1c')][_0x3556('0x24')]===undefined?!![]:![]:!![],'where':_0x25afb9[_0x3556('0x1c')]?_0x25afb9[_0x3556('0x1c')]['where']||null:null,'attributes':_0x25afb9['options']?_0x25afb9[_0x3556('0x1c')]['attributes']||null:null,'include':_0x25afb9[_0x3556('0x1c')]?_0x25afb9['options'][_0x3556('0x1e')]?_[_0x3556('0x1f')](_0x25afb9['options'][_0x3556('0x1e')],function(_0x423955){return{'model':db[_0x423955[_0x3556('0x20')]],'as':_0x423955['as'],'attributes':_0x423955['attributes'],'include':_0x423955[_0x3556('0x1e')]?_[_0x3556('0x1f')](_0x423955[_0x3556('0x1e')],function(_0xa50ffb){return{'model':db[_0xa50ffb[_0x3556('0x20')]],'as':_0xa50ffb['as'],'attributes':_0xa50ffb['attributes'],'include':_0xa50ffb[_0x3556('0x1e')]?_[_0x3556('0x1f')](_0xa50ffb['include'],function(_0x480289){return{'model':db[_0x480289[_0x3556('0x20')]],'as':_0x480289['as'],'attributes':_0x480289[_0x3556('0x21')]};}):[]};}):[]};}):[]:[]})[_0x3556('0x10')](function(_0x2b513d){logger[_0x3556('0x11')](_0x3556('0x25'),_0x25afb9);logger[_0x3556('0x13')](_0x3556('0x25'),_0x25afb9,JSON['stringify'](_0x2b513d));_0x24321c(_0x2b513d);})[_0x3556('0x19')](function(_0x47d437){logger['error'](_0x3556('0x25'),_0x47d437[_0x3556('0x18')],_0x25afb9);_0x4a7388(_0x153e3b['error'](0x1f4,_0x47d437[_0x3556('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 26631ae..d5f5f55 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 _0x2b16=['emit','removeListener','register','length','smsQueue:','remove','update'];(function(_0x34b981,_0x516d2f){var _0x234c56=function(_0xca7c3){while(--_0xca7c3){_0x34b981['push'](_0x34b981['shift']());}};_0x234c56(++_0x516d2f);}(_0x2b16,0x1be));var _0x62b1=function(_0x23c48d,_0x1515b2){_0x23c48d=_0x23c48d-0x0;var _0x5878e1=_0x2b16[_0x23c48d];return _0x5878e1;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=['save',_0x62b1('0x0'),_0x62b1('0x1')];function createListener(_0x77943e,_0x495b7c){return function(_0x863d46){_0x495b7c[_0x62b1('0x2')](_0x77943e,_0x863d46);};}function removeListener(_0x305732,_0x2a5adf){return function(){SmsQueueEvents[_0x62b1('0x3')](_0x305732,_0x2a5adf);};}exports[_0x62b1('0x4')]=function(_0x2c6b68){for(var _0xe5daf9=0x0,_0x3947c6=events[_0x62b1('0x5')];_0xe5daf9<_0x3947c6;_0xe5daf9++){var _0x2da7df=events[_0xe5daf9];var _0x442152=createListener(_0x62b1('0x6')+_0x2da7df,_0x2c6b68);SmsQueueEvents['on'](_0x2da7df,_0x442152);}}; \ No newline at end of file +var _0x9b15=['emit','register','length','smsQueue:','./smsQueue.events','update'];(function(_0x5a7d5f,_0x5695cb){var _0x5dcded=function(_0x13f053){while(--_0x13f053){_0x5a7d5f['push'](_0x5a7d5f['shift']());}};_0x5dcded(++_0x5695cb);}(_0x9b15,0x172));var _0x59b1=function(_0x39b0c6,_0x1f3824){_0x39b0c6=_0x39b0c6-0x0;var _0x366b6b=_0x9b15[_0x39b0c6];return _0x366b6b;};'use strict';var SmsQueueEvents=require(_0x59b1('0x0'));var events=['save','remove',_0x59b1('0x1')];function createListener(_0x262e87,_0x29b7da){return function(_0x5964ff){_0x29b7da[_0x59b1('0x2')](_0x262e87,_0x5964ff);};}function removeListener(_0x548358,_0x140d07){return function(){SmsQueueEvents['removeListener'](_0x548358,_0x140d07);};}exports[_0x59b1('0x3')]=function(_0x322b6a){for(var _0xae7d72=0x0,_0x38b5af=events[_0x59b1('0x4')];_0xae7d72<_0x38b5af;_0xae7d72++){var _0x59e3cc=events[_0xae7d72];var _0x42553f=createListener(_0x59b1('0x5')+_0x59e3cc,_0x322b6a);SmsQueueEvents['on'](_0x59e3cc,_0x42553f);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 1d4e3f2..bc16147 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 _0x3463=['show','post','create','put','update','delete','destroy','multer','Router','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','index','get','/describe','isAuthenticated','describe','/:id'];(function(_0x51e11b,_0x171404){var _0x144c34=function(_0x284bd7){while(--_0x284bd7){_0x51e11b['push'](_0x51e11b['shift']());}};_0x144c34(++_0x171404);}(_0x3463,0x97));var _0x3346=function(_0x1ed1d8,_0x384889){_0x1ed1d8=_0x1ed1d8-0x0;var _0x4f145d=_0x3463[_0x1ed1d8];return _0x4f145d;};'use strict';var multer=require(_0x3346('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x3346('0x1')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x3346('0x2'));var config=require(_0x3346('0x3'));var controller=require(_0x3346('0x4'));router['get']('/',auth['isAuthenticated'](),controller[_0x3346('0x5')]);router[_0x3346('0x6')](_0x3346('0x7'),auth[_0x3346('0x8')](),controller[_0x3346('0x9')]);router['get'](_0x3346('0xa'),auth['isAuthenticated'](),controller[_0x3346('0xb')]);router[_0x3346('0xc')]('/',auth[_0x3346('0x8')](),controller[_0x3346('0xd')]);router[_0x3346('0xe')](_0x3346('0xa'),auth[_0x3346('0x8')](),controller[_0x3346('0xf')]);router[_0x3346('0x10')](_0x3346('0xa'),auth[_0x3346('0x8')](),controller[_0x3346('0x11')]);module['exports']=router; \ No newline at end of file +var _0x24e3=['create','put','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post'];(function(_0x5de33e,_0x4edaa4){var _0x3b0f72=function(_0x27a29c){while(--_0x27a29c){_0x5de33e['push'](_0x5de33e['shift']());}};_0x3b0f72(++_0x4edaa4);}(_0x24e3,0x1a4));var _0x324e=function(_0x1fc6a0,_0x1700c2){_0x1fc6a0=_0x1fc6a0-0x0;var _0x529f9a=_0x24e3[_0x1fc6a0];return _0x529f9a;};'use strict';var multer=require('multer');var util=require(_0x324e('0x0'));var path=require('path');var timeout=require(_0x324e('0x1'));var express=require(_0x324e('0x2'));var router=express[_0x324e('0x3')]();var fs_extra=require(_0x324e('0x4'));var auth=require(_0x324e('0x5'));var interaction=require(_0x324e('0x6'));var config=require(_0x324e('0x7'));var controller=require(_0x324e('0x8'));router[_0x324e('0x9')]('/',auth['isAuthenticated'](),controller[_0x324e('0xa')]);router[_0x324e('0x9')](_0x324e('0xb'),auth[_0x324e('0xc')](),controller[_0x324e('0xd')]);router[_0x324e('0x9')](_0x324e('0xe'),auth['isAuthenticated'](),controller[_0x324e('0xf')]);router[_0x324e('0x10')]('/',auth[_0x324e('0xc')](),controller[_0x324e('0x11')]);router[_0x324e('0x12')](_0x324e('0xe'),auth[_0x324e('0xc')](),controller[_0x324e('0x13')]);router[_0x324e('0x14')](_0x324e('0xe'),auth[_0x324e('0xc')](),controller[_0x324e('0x15')]);module[_0x324e('0x16')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 3dc2688..a9038d7 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 _0x6317=['STRING','DATE','moment','sequelize','exports'];(function(_0x2b5513,_0x3fe5cd){var _0x578fd2=function(_0x7a9106){while(--_0x7a9106){_0x2b5513['push'](_0x2b5513['shift']());}};_0x578fd2(++_0x3fe5cd);}(_0x6317,0x11a));var _0x7631=function(_0x2b5474,_0x5152f5){_0x2b5474=_0x2b5474-0x0;var _0x4e1517=_0x6317[_0x2b5474];return _0x4e1517;};'use strict';var moment=require(_0x7631('0x0'));var Sequelize=require(_0x7631('0x1'));module[_0x7631('0x2')]={'uniqueid':{'type':Sequelize[_0x7631('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x7631('0x3')]},'joinAt':{'type':Sequelize[_0x7631('0x4')]},'leaveAt':{'type':Sequelize[_0x7631('0x4')]},'acceptAt':{'type':Sequelize[_0x7631('0x4')]},'exitAt':{'type':Sequelize[_0x7631('0x4')]},'reason':{'type':Sequelize[_0x7631('0x3')]}}; \ No newline at end of file +var _0x34aa=['DATE','moment','exports','STRING'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x34aa,0x171));var _0xa34a=function(_0x52e68e,_0x309912){_0x52e68e=_0x52e68e-0x0;var _0x3211a4=_0x34aa[_0x52e68e];return _0x3211a4;};'use strict';var moment=require(_0xa34a('0x0'));var Sequelize=require('sequelize');module[_0xa34a('0x1')]={'uniqueid':{'type':Sequelize[_0xa34a('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xa34a('0x2')]},'joinAt':{'type':Sequelize[_0xa34a('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xa34a('0x3')]},'exitAt':{'type':Sequelize[_0xa34a('0x3')]},'reason':{'type':Sequelize[_0xa34a('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 751c228..f026217 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 _0xe41e=['../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','offset','undefined','limit','count','set','json','reject','save','update','then','destroy','stack','name','index','map','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters','merge','VIRTUAL','filter','options','SmsQueueReport','includeAll','include','rows','catch','show','params','rawAttributes','length','find','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x41e946,_0x802cd7){var _0x4c58e2=function(_0x61e755){while(--_0x61e755){_0x41e946['push'](_0x41e946['shift']());}};_0x4c58e2(++_0x802cd7);}(_0xe41e,0x7c));var _0xee41=function(_0x1482bf,_0x3f008f){_0x1482bf=_0x1482bf-0x0;var _0x1c18ab=_0xe41e[_0x1482bf];return _0x1c18ab;};'use strict';var emlformat=require(_0xee41('0x0'));var rimraf=require(_0xee41('0x1'));var zipdir=require(_0xee41('0x2'));var jsonpatch=require(_0xee41('0x3'));var rp=require(_0xee41('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xee41('0x5'));var util=require(_0xee41('0x6'));var path=require('path');var sox=require(_0xee41('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xee41('0x8'));var _=require(_0xee41('0x9'));var squel=require(_0xee41('0xa'));var crypto=require(_0xee41('0xb'));var jsforce=require(_0xee41('0xc'));var deskjs=require(_0xee41('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xee41('0xe'));var Redis=require(_0xee41('0xf'));var authService=require(_0xee41('0x10'));var qs=require(_0xee41('0x11'));var as=require(_0xee41('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xee41('0x13'))('api');var utils=require(_0xee41('0x14'));var config=require(_0xee41('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x589ffa,_0x1d6b61){_0x1d6b61=_0x1d6b61||0xcc;return function(_0x3ef6b1){if(_0x3ef6b1){return _0x589ffa[_0xee41('0x16')](_0x1d6b61);}return _0x589ffa[_0xee41('0x17')](_0x1d6b61)[_0xee41('0x18')]();};}function respondWithResult(_0x36dbda,_0x48d886){_0x48d886=_0x48d886||0xc8;return function(_0x1dc796){if(_0x1dc796){return _0x36dbda[_0xee41('0x17')](_0x48d886)['json'](_0x1dc796);}};}function respondWithFilteredResult(_0x104edb,_0x3e9a1f){return function(_0x1235bb){if(_0x1235bb){var _0x135a75=typeof _0x3e9a1f[_0xee41('0x19')]===_0xee41('0x1a')&&typeof _0x3e9a1f[_0xee41('0x1b')]===_0xee41('0x1a');var _0x4195d4=_0x1235bb[_0xee41('0x1c')];var _0x44106f=_0x135a75?0x0:_0x3e9a1f[_0xee41('0x19')];var _0x21e0e1=_0x135a75?_0x1235bb['count']:_0x3e9a1f[_0xee41('0x19')]+_0x3e9a1f[_0xee41('0x1b')];var _0x5e21e1;if(_0x21e0e1>=_0x4195d4){_0x21e0e1=_0x4195d4;_0x5e21e1=0xc8;}else{_0x5e21e1=0xce;}_0x104edb[_0xee41('0x17')](_0x5e21e1);return _0x104edb[_0xee41('0x1d')]('Content-Range',_0x44106f+'-'+_0x21e0e1+'/'+_0x4195d4)[_0xee41('0x1e')](_0x1235bb);}return null;};}function patchUpdates(_0x4d9cc1){return function(_0x205e18){try{jsonpatch['apply'](_0x205e18,_0x4d9cc1,!![]);}catch(_0x497b1f){return BPromise[_0xee41('0x1f')](_0x497b1f);}return _0x205e18[_0xee41('0x20')]();};}function saveUpdates(_0x15db4d,_0x21fbbf){return function(_0x53f6b4){if(_0x53f6b4){return _0x53f6b4[_0xee41('0x21')](_0x15db4d)[_0xee41('0x22')](function(_0x27e4f4){return _0x27e4f4;});}return null;};}function removeEntity(_0x5662d0,_0x65aad8){return function(_0x4fc2bb){if(_0x4fc2bb){return _0x4fc2bb[_0xee41('0x23')]()[_0xee41('0x22')](function(){_0x5662d0[_0xee41('0x17')](0xcc)[_0xee41('0x18')]();});}};}function handleEntityNotFound(_0x3ef55a,_0x21cdf3){return function(_0x16b576){if(!_0x16b576){_0x3ef55a[_0xee41('0x16')](0x194);}return _0x16b576;};}function handleError(_0x56db11,_0x4f83fa){_0x4f83fa=_0x4f83fa||0x1f4;return function(_0x10ac62){logger['error'](_0x10ac62[_0xee41('0x24')]);if(_0x10ac62[_0xee41('0x25')]){delete _0x10ac62[_0xee41('0x25')];}_0x56db11['status'](_0x4f83fa)['send'](_0x10ac62);};}exports[_0xee41('0x26')]=function(_0x33bbac,_0x1069c8){var _0x1ef244={},_0x564d2b={},_0x3904be={'count':0x0,'rows':[]};var _0x376de6=_[_0xee41('0x27')](db['SmsQueueReport']['rawAttributes'],function(_0x28ef21){return{'name':_0x28ef21[_0xee41('0x28')],'type':_0x28ef21[_0xee41('0x29')][_0xee41('0x2a')]};});_0x564d2b[_0xee41('0x2b')]=_[_0xee41('0x27')](_0x376de6,'name');_0x564d2b[_0xee41('0x2c')]=_[_0xee41('0x2d')](_0x33bbac['query']);_0x564d2b['filters']=_[_0xee41('0x2e')](_0x564d2b[_0xee41('0x2b')],_0x564d2b[_0xee41('0x2c')]);_0x1ef244[_0xee41('0x2f')]=_[_0xee41('0x2e')](_0x564d2b[_0xee41('0x2b')],qs[_0xee41('0x30')](_0x33bbac[_0xee41('0x2c')][_0xee41('0x30')]));_0x1ef244[_0xee41('0x2f')]=_0x1ef244[_0xee41('0x2f')]['length']?_0x1ef244[_0xee41('0x2f')]:_0x564d2b[_0xee41('0x2b')];if(!_0x33bbac[_0xee41('0x2c')][_0xee41('0x31')](_0xee41('0x32'))){_0x1ef244[_0xee41('0x1b')]=qs[_0xee41('0x1b')](_0x33bbac['query'][_0xee41('0x1b')]);_0x1ef244[_0xee41('0x19')]=qs['offset'](_0x33bbac[_0xee41('0x2c')][_0xee41('0x19')]);}_0x1ef244['order']=qs[_0xee41('0x33')](_0x33bbac[_0xee41('0x2c')][_0xee41('0x33')]);_0x1ef244[_0xee41('0x34')]=qs['filters'](_[_0xee41('0x35')](_0x33bbac['query'],_0x564d2b[_0xee41('0x36')]),_0x376de6);if(_0x33bbac[_0xee41('0x2c')]['filter']){_0x1ef244[_0xee41('0x34')]=_[_0xee41('0x37')](_0x1ef244[_0xee41('0x34')],{'$or':_[_0xee41('0x27')](_0x376de6,function(_0x4a1b4){if(_0x4a1b4[_0xee41('0x29')]!==_0xee41('0x38')){var _0x3e94f0={};_0x3e94f0[_0x4a1b4[_0xee41('0x25')]]={'$like':'%'+_0x33bbac[_0xee41('0x2c')][_0xee41('0x39')]+'%'};return _0x3e94f0;}})});}_0x1ef244=_[_0xee41('0x37')]({},_0x1ef244,_0x33bbac[_0xee41('0x3a')]);var _0x4806d5={'where':_0x1ef244[_0xee41('0x34')]};return db[_0xee41('0x3b')][_0xee41('0x1c')](_0x4806d5)[_0xee41('0x22')](function(_0x5264ad){_0x3904be[_0xee41('0x1c')]=_0x5264ad;if(_0x33bbac['query'][_0xee41('0x3c')]){_0x1ef244[_0xee41('0x3d')]=[{'all':!![]}];}return db['SmsQueueReport']['findAll'](_0x1ef244);})['then'](function(_0x394b1e){_0x3904be[_0xee41('0x3e')]=_0x394b1e;return _0x3904be;})['then'](respondWithFilteredResult(_0x1069c8,_0x1ef244))[_0xee41('0x3f')](handleError(_0x1069c8,null));};exports[_0xee41('0x40')]=function(_0x4135bf,_0x5014f6){var _0x3c5737={'raw':!![],'where':{'id':_0x4135bf[_0xee41('0x41')]['id']}},_0x1d2564={};_0x1d2564[_0xee41('0x2b')]=_[_0xee41('0x2d')](db[_0xee41('0x3b')][_0xee41('0x42')]);_0x1d2564['query']=_[_0xee41('0x2d')](_0x4135bf[_0xee41('0x2c')]);_0x1d2564[_0xee41('0x36')]=_[_0xee41('0x2e')](_0x1d2564['model'],_0x1d2564[_0xee41('0x2c')]);_0x3c5737[_0xee41('0x2f')]=_[_0xee41('0x2e')](_0x1d2564['model'],qs[_0xee41('0x30')](_0x4135bf[_0xee41('0x2c')][_0xee41('0x30')]));_0x3c5737[_0xee41('0x2f')]=_0x3c5737[_0xee41('0x2f')][_0xee41('0x43')]?_0x3c5737[_0xee41('0x2f')]:_0x1d2564['model'];if(_0x4135bf[_0xee41('0x2c')][_0xee41('0x3c')]){_0x3c5737[_0xee41('0x3d')]=[{'all':!![]}];}_0x3c5737=_[_0xee41('0x37')]({},_0x3c5737,_0x4135bf[_0xee41('0x3a')]);return db['SmsQueueReport'][_0xee41('0x44')](_0x3c5737)[_0xee41('0x22')](handleEntityNotFound(_0x5014f6,null))['then'](respondWithResult(_0x5014f6,null))[_0xee41('0x3f')](handleError(_0x5014f6,null));};exports['create']=function(_0xad5d6c,_0x1cab5b){return db['SmsQueueReport']['create'](_0xad5d6c[_0xee41('0x45')],{})['then'](respondWithResult(_0x1cab5b,0xc9))['catch'](handleError(_0x1cab5b,null));};exports[_0xee41('0x21')]=function(_0x4a6724,_0x777b5d){if(_0x4a6724['body']['id']){delete _0x4a6724[_0xee41('0x45')]['id'];}return db[_0xee41('0x3b')][_0xee41('0x44')]({'where':{'id':_0x4a6724[_0xee41('0x41')]['id']}})[_0xee41('0x22')](handleEntityNotFound(_0x777b5d,null))[_0xee41('0x22')](saveUpdates(_0x4a6724[_0xee41('0x45')],null))[_0xee41('0x22')](respondWithResult(_0x777b5d,null))[_0xee41('0x3f')](handleError(_0x777b5d,null));};exports[_0xee41('0x23')]=function(_0x1b0bc3,_0x2e2be5){return db['SmsQueueReport'][_0xee41('0x44')]({'where':{'id':_0x1b0bc3[_0xee41('0x41')]['id']}})[_0xee41('0x22')](handleEntityNotFound(_0x2e2be5,null))['then'](removeEntity(_0x2e2be5,null))[_0xee41('0x3f')](handleError(_0x2e2be5,null));};exports[_0xee41('0x46')]=function(_0x376bad,_0xc8edb9){return db[_0xee41('0x3b')][_0xee41('0x46')]()['then'](respondWithResult(_0xc8edb9,null))[_0xee41('0x3f')](handleError(_0xc8edb9,null));}; \ No newline at end of file +var _0xe950=['VIRTUAL','options','includeAll','findAll','rows','show','params','rawAttributes','find','catch','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','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','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','count','limit','set','Content-Range','apply','reject','update','destroy','then','error','stack','name','send','index','SmsQueueReport','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map'];(function(_0x5240be,_0x4349af){var _0xbb7734=function(_0xda9ee9){while(--_0xda9ee9){_0x5240be['push'](_0x5240be['shift']());}};_0xbb7734(++_0x4349af);}(_0xe950,0x18e));var _0x0e95=function(_0x3bd1c2,_0x4052db){_0x3bd1c2=_0x3bd1c2-0x0;var _0x106abb=_0xe950[_0x3bd1c2];return _0x106abb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0e95('0x0'));var zipdir=require(_0x0e95('0x1'));var jsonpatch=require(_0x0e95('0x2'));var rp=require(_0x0e95('0x3'));var moment=require(_0x0e95('0x4'));var BPromise=require(_0x0e95('0x5'));var Mustache=require(_0x0e95('0x6'));var util=require(_0x0e95('0x7'));var path=require(_0x0e95('0x8'));var sox=require(_0x0e95('0x9'));var csv=require(_0x0e95('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0e95('0xb'));var _=require(_0x0e95('0xc'));var squel=require(_0x0e95('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0e95('0xe'));var toCsv=require(_0x0e95('0xa'));var querystring=require('querystring');var Papa=require(_0x0e95('0xf'));var Redis=require(_0x0e95('0x10'));var authService=require(_0x0e95('0x11'));var qs=require(_0x0e95('0x12'));var as=require(_0x0e95('0x13'));var hardwareService=require(_0x0e95('0x14'));var logger=require('../../config/logger')(_0x0e95('0x15'));var utils=require(_0x0e95('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x0e95('0x17'));var db=require(_0x0e95('0x18'))['db'];function respondWithStatusCode(_0x18b853,_0xfc7c21){_0xfc7c21=_0xfc7c21||0xcc;return function(_0xc18a0b){if(_0xc18a0b){return _0x18b853[_0x0e95('0x19')](_0xfc7c21);}return _0x18b853[_0x0e95('0x1a')](_0xfc7c21)[_0x0e95('0x1b')]();};}function respondWithResult(_0x199d18,_0x202fdd){_0x202fdd=_0x202fdd||0xc8;return function(_0x28f70f){if(_0x28f70f){return _0x199d18[_0x0e95('0x1a')](_0x202fdd)[_0x0e95('0x1c')](_0x28f70f);}};}function respondWithFilteredResult(_0x27ad69,_0x946c92){return function(_0x5d4e50){if(_0x5d4e50){var _0x1baf72=typeof _0x946c92[_0x0e95('0x1d')]==='undefined'&&typeof _0x946c92['limit']==='undefined';var _0x214606=_0x5d4e50[_0x0e95('0x1e')];var _0x3e12d4=_0x1baf72?0x0:_0x946c92[_0x0e95('0x1d')];var _0x48ae02=_0x1baf72?_0x5d4e50[_0x0e95('0x1e')]:_0x946c92[_0x0e95('0x1d')]+_0x946c92[_0x0e95('0x1f')];var _0x5e786c;if(_0x48ae02>=_0x214606){_0x48ae02=_0x214606;_0x5e786c=0xc8;}else{_0x5e786c=0xce;}_0x27ad69[_0x0e95('0x1a')](_0x5e786c);return _0x27ad69[_0x0e95('0x20')](_0x0e95('0x21'),_0x3e12d4+'-'+_0x48ae02+'/'+_0x214606)[_0x0e95('0x1c')](_0x5d4e50);}return null;};}function patchUpdates(_0x19d80f){return function(_0x35b598){try{jsonpatch[_0x0e95('0x22')](_0x35b598,_0x19d80f,!![]);}catch(_0x2137bb){return BPromise[_0x0e95('0x23')](_0x2137bb);}return _0x35b598['save']();};}function saveUpdates(_0xedadb2,_0x17d454){return function(_0x1f3c75){if(_0x1f3c75){return _0x1f3c75[_0x0e95('0x24')](_0xedadb2)['then'](function(_0xcaf550){return _0xcaf550;});}return null;};}function removeEntity(_0x4d2c9d,_0x58c820){return function(_0x50524d){if(_0x50524d){return _0x50524d[_0x0e95('0x25')]()[_0x0e95('0x26')](function(){_0x4d2c9d[_0x0e95('0x1a')](0xcc)[_0x0e95('0x1b')]();});}};}function handleEntityNotFound(_0xb4847a,_0x4f5166){return function(_0x25cc63){if(!_0x25cc63){_0xb4847a[_0x0e95('0x19')](0x194);}return _0x25cc63;};}function handleError(_0x1deec8,_0x22c0ea){_0x22c0ea=_0x22c0ea||0x1f4;return function(_0x474aff){logger[_0x0e95('0x27')](_0x474aff[_0x0e95('0x28')]);if(_0x474aff['name']){delete _0x474aff[_0x0e95('0x29')];}_0x1deec8[_0x0e95('0x1a')](_0x22c0ea)[_0x0e95('0x2a')](_0x474aff);};}exports[_0x0e95('0x2b')]=function(_0x27cf8b,_0x4a4bd9){var _0x5259b4={},_0x58a54b={},_0x199d8b={'count':0x0,'rows':[]};var _0x31cf2e=_['map'](db[_0x0e95('0x2c')]['rawAttributes'],function(_0x155579){return{'name':_0x155579[_0x0e95('0x2d')],'type':_0x155579[_0x0e95('0x2e')]['key']};});_0x58a54b[_0x0e95('0x2f')]=_['map'](_0x31cf2e,'name');_0x58a54b[_0x0e95('0x30')]=_[_0x0e95('0x31')](_0x27cf8b[_0x0e95('0x30')]);_0x58a54b[_0x0e95('0x32')]=_[_0x0e95('0x33')](_0x58a54b['model'],_0x58a54b['query']);_0x5259b4[_0x0e95('0x34')]=_[_0x0e95('0x33')](_0x58a54b[_0x0e95('0x2f')],qs[_0x0e95('0x35')](_0x27cf8b[_0x0e95('0x30')][_0x0e95('0x35')]));_0x5259b4[_0x0e95('0x34')]=_0x5259b4[_0x0e95('0x34')][_0x0e95('0x36')]?_0x5259b4[_0x0e95('0x34')]:_0x58a54b[_0x0e95('0x2f')];if(!_0x27cf8b['query'][_0x0e95('0x37')](_0x0e95('0x38'))){_0x5259b4[_0x0e95('0x1f')]=qs[_0x0e95('0x1f')](_0x27cf8b['query'][_0x0e95('0x1f')]);_0x5259b4['offset']=qs[_0x0e95('0x1d')](_0x27cf8b[_0x0e95('0x30')][_0x0e95('0x1d')]);}_0x5259b4[_0x0e95('0x39')]=qs[_0x0e95('0x3a')](_0x27cf8b[_0x0e95('0x30')][_0x0e95('0x3a')]);_0x5259b4[_0x0e95('0x3b')]=qs[_0x0e95('0x32')](_[_0x0e95('0x3c')](_0x27cf8b['query'],_0x58a54b[_0x0e95('0x32')]),_0x31cf2e);if(_0x27cf8b[_0x0e95('0x30')][_0x0e95('0x3d')]){_0x5259b4[_0x0e95('0x3b')]=_[_0x0e95('0x3e')](_0x5259b4[_0x0e95('0x3b')],{'$or':_[_0x0e95('0x3f')](_0x31cf2e,function(_0x735d7){if(_0x735d7[_0x0e95('0x2e')]!==_0x0e95('0x40')){var _0x1954bf={};_0x1954bf[_0x735d7[_0x0e95('0x29')]]={'$like':'%'+_0x27cf8b[_0x0e95('0x30')]['filter']+'%'};return _0x1954bf;}})});}_0x5259b4=_[_0x0e95('0x3e')]({},_0x5259b4,_0x27cf8b[_0x0e95('0x41')]);var _0xb2bd96={'where':_0x5259b4[_0x0e95('0x3b')]};return db[_0x0e95('0x2c')][_0x0e95('0x1e')](_0xb2bd96)[_0x0e95('0x26')](function(_0x352bc0){_0x199d8b[_0x0e95('0x1e')]=_0x352bc0;if(_0x27cf8b[_0x0e95('0x30')][_0x0e95('0x42')]){_0x5259b4['include']=[{'all':!![]}];}return db[_0x0e95('0x2c')][_0x0e95('0x43')](_0x5259b4);})['then'](function(_0x6d5c19){_0x199d8b[_0x0e95('0x44')]=_0x6d5c19;return _0x199d8b;})['then'](respondWithFilteredResult(_0x4a4bd9,_0x5259b4))['catch'](handleError(_0x4a4bd9,null));};exports[_0x0e95('0x45')]=function(_0x3894a0,_0x3d7b88){var _0x51e8a7={'raw':!![],'where':{'id':_0x3894a0[_0x0e95('0x46')]['id']}},_0x123957={};_0x123957[_0x0e95('0x2f')]=_[_0x0e95('0x31')](db['SmsQueueReport'][_0x0e95('0x47')]);_0x123957[_0x0e95('0x30')]=_[_0x0e95('0x31')](_0x3894a0[_0x0e95('0x30')]);_0x123957[_0x0e95('0x32')]=_[_0x0e95('0x33')](_0x123957[_0x0e95('0x2f')],_0x123957[_0x0e95('0x30')]);_0x51e8a7[_0x0e95('0x34')]=_[_0x0e95('0x33')](_0x123957[_0x0e95('0x2f')],qs[_0x0e95('0x35')](_0x3894a0[_0x0e95('0x30')][_0x0e95('0x35')]));_0x51e8a7[_0x0e95('0x34')]=_0x51e8a7[_0x0e95('0x34')]['length']?_0x51e8a7[_0x0e95('0x34')]:_0x123957[_0x0e95('0x2f')];if(_0x3894a0[_0x0e95('0x30')][_0x0e95('0x42')]){_0x51e8a7['include']=[{'all':!![]}];}_0x51e8a7=_[_0x0e95('0x3e')]({},_0x51e8a7,_0x3894a0['options']);return db['SmsQueueReport'][_0x0e95('0x48')](_0x51e8a7)[_0x0e95('0x26')](handleEntityNotFound(_0x3d7b88,null))['then'](respondWithResult(_0x3d7b88,null))[_0x0e95('0x49')](handleError(_0x3d7b88,null));};exports[_0x0e95('0x4a')]=function(_0x303583,_0x194655){return db[_0x0e95('0x2c')]['create'](_0x303583[_0x0e95('0x4b')],{})[_0x0e95('0x26')](respondWithResult(_0x194655,0xc9))[_0x0e95('0x49')](handleError(_0x194655,null));};exports[_0x0e95('0x24')]=function(_0x410e84,_0x56f846){if(_0x410e84[_0x0e95('0x4b')]['id']){delete _0x410e84[_0x0e95('0x4b')]['id'];}return db[_0x0e95('0x2c')][_0x0e95('0x48')]({'where':{'id':_0x410e84[_0x0e95('0x46')]['id']}})[_0x0e95('0x26')](handleEntityNotFound(_0x56f846,null))[_0x0e95('0x26')](saveUpdates(_0x410e84[_0x0e95('0x4b')],null))[_0x0e95('0x26')](respondWithResult(_0x56f846,null))[_0x0e95('0x49')](handleError(_0x56f846,null));};exports[_0x0e95('0x25')]=function(_0x59a517,_0x6e60e5){return db[_0x0e95('0x2c')]['find']({'where':{'id':_0x59a517[_0x0e95('0x46')]['id']}})['then'](handleEntityNotFound(_0x6e60e5,null))[_0x0e95('0x26')](removeEntity(_0x6e60e5,null))[_0x0e95('0x49')](handleError(_0x6e60e5,null));};exports['describe']=function(_0x2b3461,_0x571292){return db[_0x0e95('0x2c')][_0x0e95('0x4c')]()[_0x0e95('0x26')](respondWithResult(_0x571292,null))[_0x0e95('0x49')](handleError(_0x571292,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index cefb441..43d6fcc 100644 --- a/server/api/smsQueueReport/smsQueueReport.model.js +++ b/server/api/smsQueueReport/smsQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['path','rimraf','./smsQueueReport.attributes','exports','define','report_sms_queue','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0x1360ba,_0x9a175d){var _0x18042e=function(_0x3485d1){while(--_0x3485d1){_0x1360ba['push'](_0x1360ba['shift']());}};_0x18042e(++_0x9a175d);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1deb72,_0x3f6338){_0x1deb72=_0x1deb72-0x0;var _0x18bbdf=_0xcb91[_0x1deb72];return _0x18bbdf;};'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'));module[_0x1cb9('0x7')]=function(_0x53ffbd,_0x226b69){return _0x53ffbd[_0x1cb9('0x8')]('SmsQueueReport',attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[{'name':_0x1cb9('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['define','SmsQueueReport','uniqueid','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'report_sms_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0a9e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index e0489bc..7ba5fb7 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 _0x3bc0=['../../config/logger','../../config/environment','client','request','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','SmsQueueReport','body','options','CreateSmsQueueReport','update','where','attributes','limit','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x5e9d35,_0x382c91){var _0x3beb2e=function(_0x4242cf){while(--_0x4242cf){_0x5e9d35['push'](_0x5e9d35['shift']());}};_0x3beb2e(++_0x382c91);}(_0x3bc0,0x1ab));var _0x03bc=function(_0x1a7846,_0x59723e){_0x1a7846=_0x1a7846-0x0;var _0x48049=_0x3bc0[_0x1a7846];return _0x48049;};'use strict';var _=require(_0x03bc('0x0'));var util=require(_0x03bc('0x1'));var moment=require(_0x03bc('0x2'));var BPromise=require(_0x03bc('0x3'));var rs=require(_0x03bc('0x4'));var fs=require('fs');var Redis=require(_0x03bc('0x5'));var db=require(_0x03bc('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x03bc('0x7'))('rpc');var config=require(_0x03bc('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x03bc('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x26ff39,_0x4f0495,_0x53240e){return new BPromise(function(_0x257655,_0x15988d){return client[_0x03bc('0xa')](_0x26ff39,_0x53240e)['then'](function(_0x29d774){logger[_0x03bc('0xb')](_0x03bc('0xc'),_0x4f0495,_0x03bc('0xd'));logger[_0x03bc('0xe')](_0x03bc('0xf'),_0x4f0495,_0x03bc('0xd'),JSON[_0x03bc('0x10')](_0x29d774));if(_0x29d774[_0x03bc('0x11')]){if(_0x29d774[_0x03bc('0x11')][_0x03bc('0x12')]===0x1f4){logger[_0x03bc('0x11')](_0x03bc('0xc'),_0x4f0495,_0x29d774[_0x03bc('0x11')]['message']);return _0x15988d(_0x29d774['error'][_0x03bc('0x13')]);}logger[_0x03bc('0x11')]('SmsQueueReport,\x20%s,\x20%s',_0x4f0495,_0x29d774[_0x03bc('0x11')][_0x03bc('0x13')]);return _0x257655(_0x29d774[_0x03bc('0x11')]['message']);}else{logger[_0x03bc('0xb')](_0x03bc('0xc'),_0x4f0495,_0x03bc('0xd'));_0x257655(_0x29d774[_0x03bc('0x14')][_0x03bc('0x13')]);}})[_0x03bc('0x15')](function(_0x2ff7b1){logger['error'](_0x03bc('0xc'),_0x4f0495,_0x2ff7b1);_0x15988d(_0x2ff7b1);});});}exports['CreateSmsQueueReport']=function(_0x422ee1){var _0x11f832=this;return new Promise(function(_0x508000,_0x523159){return db[_0x03bc('0x16')]['create'](_0x422ee1[_0x03bc('0x17')],{'raw':_0x422ee1[_0x03bc('0x18')]?_0x422ee1['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4d77f9){logger['info'](_0x03bc('0x19'),_0x422ee1);logger[_0x03bc('0xe')]('CreateSmsQueueReport',_0x422ee1,JSON[_0x03bc('0x10')](_0x4d77f9));_0x508000(_0x4d77f9);})[_0x03bc('0x15')](function(_0x4b6eb7){logger[_0x03bc('0x11')](_0x03bc('0x19'),_0x4b6eb7[_0x03bc('0x13')],_0x422ee1);_0x523159(_0x11f832[_0x03bc('0x11')](0x1f4,_0x4b6eb7[_0x03bc('0x13')]));});});};exports['UpdateSmsQueueReport']=function(_0x1122d3){var _0x11288e=this;return new Promise(function(_0x1c8f12,_0x468197){return db[_0x03bc('0x16')][_0x03bc('0x1a')](_0x1122d3['body'],{'raw':_0x1122d3[_0x03bc('0x18')]?_0x1122d3['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1122d3['options']?_0x1122d3[_0x03bc('0x18')][_0x03bc('0x1b')]||null:null,'attributes':_0x1122d3[_0x03bc('0x18')]?_0x1122d3['options'][_0x03bc('0x1c')]||null:null,'limit':_0x1122d3[_0x03bc('0x18')]?_0x1122d3[_0x03bc('0x18')][_0x03bc('0x1d')]||null:null})[_0x03bc('0x1e')](function(_0x3a49aa){logger[_0x03bc('0xb')]('UpdateSmsQueueReport',_0x1122d3);logger['debug']('UpdateSmsQueueReport',_0x1122d3,JSON[_0x03bc('0x10')](_0x3a49aa));_0x1c8f12(_0x3a49aa);})[_0x03bc('0x15')](function(_0x41f051){logger[_0x03bc('0x11')]('UpdateSmsQueueReport',_0x41f051[_0x03bc('0x13')],_0x1122d3);_0x468197(_0x11288e['error'](0x1f4,_0x41f051[_0x03bc('0x13')]));});});}; \ No newline at end of file +var _0xfd5a=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','CreateSmsQueueReport','create','raw','UpdateSmsQueueReport','SmsQueueReport','update','options','attributes','limit','lodash','util','moment','bluebird','randomstring'];(function(_0x474f74,_0x2d7973){var _0x5b6143=function(_0x48911e){while(--_0x48911e){_0x474f74['push'](_0x474f74['shift']());}};_0x5b6143(++_0x2d7973);}(_0xfd5a,0xc1));var _0xafd5=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xfd5a[_0x413feb];return _0x40ee88;};'use strict';var _=require(_0xafd5('0x0'));var util=require(_0xafd5('0x1'));var moment=require(_0xafd5('0x2'));var BPromise=require(_0xafd5('0x3'));var rs=require(_0xafd5('0x4'));var fs=require('fs');var Redis=require(_0xafd5('0x5'));var db=require(_0xafd5('0x6'))['db'];var utils=require(_0xafd5('0x7'));var logger=require(_0xafd5('0x8'))('rpc');var config=require(_0xafd5('0x9'));var jayson=require(_0xafd5('0xa'));var client=jayson[_0xafd5('0xb')][_0xafd5('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1e154e,_0x3ac79e,_0x326452){return new BPromise(function(_0x5940b5,_0x1973a1){return client[_0xafd5('0xd')](_0x1e154e,_0x326452)[_0xafd5('0xe')](function(_0x17341a){logger[_0xafd5('0xf')](_0xafd5('0x10'),_0x3ac79e,_0xafd5('0x11'));logger[_0xafd5('0x12')](_0xafd5('0x13'),_0x3ac79e,_0xafd5('0x11'),JSON[_0xafd5('0x14')](_0x17341a));if(_0x17341a[_0xafd5('0x15')]){if(_0x17341a[_0xafd5('0x15')]['code']===0x1f4){logger['error'](_0xafd5('0x10'),_0x3ac79e,_0x17341a[_0xafd5('0x15')][_0xafd5('0x16')]);return _0x1973a1(_0x17341a[_0xafd5('0x15')][_0xafd5('0x16')]);}logger[_0xafd5('0x15')](_0xafd5('0x10'),_0x3ac79e,_0x17341a[_0xafd5('0x15')][_0xafd5('0x16')]);return _0x5940b5(_0x17341a[_0xafd5('0x15')][_0xafd5('0x16')]);}else{logger[_0xafd5('0xf')](_0xafd5('0x10'),_0x3ac79e,_0xafd5('0x11'));_0x5940b5(_0x17341a['result']['message']);}})[_0xafd5('0x17')](function(_0x2f5a2a){logger[_0xafd5('0x15')](_0xafd5('0x10'),_0x3ac79e,_0x2f5a2a);_0x1973a1(_0x2f5a2a);});});}exports[_0xafd5('0x18')]=function(_0xbe6ca6){var _0x23f032=this;return new Promise(function(_0x247f8b,_0x1a7585){return db['SmsQueueReport'][_0xafd5('0x19')](_0xbe6ca6['body'],{'raw':_0xbe6ca6['options']?_0xbe6ca6['options'][_0xafd5('0x1a')]===undefined?!![]:![]:!![]})[_0xafd5('0xe')](function(_0x27902f){logger[_0xafd5('0xf')](_0xafd5('0x18'),_0xbe6ca6);logger[_0xafd5('0x12')](_0xafd5('0x18'),_0xbe6ca6,JSON[_0xafd5('0x14')](_0x27902f));_0x247f8b(_0x27902f);})[_0xafd5('0x17')](function(_0x4efebd){logger[_0xafd5('0x15')](_0xafd5('0x18'),_0x4efebd[_0xafd5('0x16')],_0xbe6ca6);_0x1a7585(_0x23f032['error'](0x1f4,_0x4efebd[_0xafd5('0x16')]));});});};exports[_0xafd5('0x1b')]=function(_0x296e3a){var _0x3f2100=this;return new Promise(function(_0x18cb68,_0x21942f){return db[_0xafd5('0x1c')][_0xafd5('0x1d')](_0x296e3a['body'],{'raw':_0x296e3a[_0xafd5('0x1e')]?_0x296e3a[_0xafd5('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x296e3a[_0xafd5('0x1e')]?_0x296e3a[_0xafd5('0x1e')]['where']||null:null,'attributes':_0x296e3a[_0xafd5('0x1e')]?_0x296e3a[_0xafd5('0x1e')][_0xafd5('0x1f')]||null:null,'limit':_0x296e3a[_0xafd5('0x1e')]?_0x296e3a[_0xafd5('0x1e')][_0xafd5('0x20')]||null:null})['then'](function(_0x46d38a){logger[_0xafd5('0xf')]('UpdateSmsQueueReport',_0x296e3a);logger[_0xafd5('0x12')](_0xafd5('0x1b'),_0x296e3a,JSON[_0xafd5('0x14')](_0x46d38a));_0x18cb68(_0x46d38a);})['catch'](function(_0x3ad549){logger[_0xafd5('0x15')](_0xafd5('0x1b'),_0x3ad549[_0xafd5('0x16')],_0x296e3a);_0x21942f(_0x3f2100[_0xafd5('0x15')](0x1f4,_0x3ad549[_0xafd5('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 19bfc0b..2708234 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 _0x2caf=['index','/describe','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2caf,0x6a));var _0xf2ca=function(_0x153bce,_0xe6925a){_0x153bce=_0x153bce-0x0;var _0x257ca0=_0x2caf[_0x153bce];return _0x257ca0;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xf2ca('0x0'));var express=require('express');var router=express[_0xf2ca('0x1')]();var fs_extra=require(_0xf2ca('0x2'));var auth=require(_0xf2ca('0x3'));var interaction=require(_0xf2ca('0x4'));var config=require(_0xf2ca('0x5'));var controller=require(_0xf2ca('0x6'));router[_0xf2ca('0x7')]('/',auth['isAuthenticated'](),controller[_0xf2ca('0x8')]);router[_0xf2ca('0x7')](_0xf2ca('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0xf2ca('0x7')](_0xf2ca('0xa'),auth[_0xf2ca('0xb')](),controller[_0xf2ca('0xc')]);router[_0xf2ca('0xd')]('/',auth['isAuthenticated'](),controller[_0xf2ca('0xe')]);router[_0xf2ca('0xf')](_0xf2ca('0xa'),auth[_0xf2ca('0xb')](),controller[_0xf2ca('0x10')]);router[_0xf2ca('0x11')]('/:id',auth[_0xf2ca('0xb')](),controller[_0xf2ca('0x12')]);module['exports']=router; \ No newline at end of file +var _0xd8b1=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','index','/describe','isAuthenticated','describe','get','show','create','/:id','update','delete','destroy'];(function(_0xf1603b,_0x257c11){var _0x298fab=function(_0x5a96fd){while(--_0x5a96fd){_0xf1603b['push'](_0xf1603b['shift']());}};_0x298fab(++_0x257c11);}(_0xd8b1,0x105));var _0x1d8b=function(_0x41d4ae,_0x44afc9){_0x41d4ae=_0x41d4ae-0x0;var _0x4cfb3f=_0xd8b1[_0x41d4ae];return _0x4cfb3f;};'use strict';var multer=require(_0x1d8b('0x0'));var util=require(_0x1d8b('0x1'));var path=require(_0x1d8b('0x2'));var timeout=require(_0x1d8b('0x3'));var express=require(_0x1d8b('0x4'));var router=express['Router']();var fs_extra=require(_0x1d8b('0x5'));var auth=require(_0x1d8b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1d8b('0x7'));var controller=require('./smsTransferReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x1d8b('0x8')]);router['get'](_0x1d8b('0x9'),auth[_0x1d8b('0xa')](),controller[_0x1d8b('0xb')]);router[_0x1d8b('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x1d8b('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1d8b('0xe')]);router['put'](_0x1d8b('0xf'),auth['isAuthenticated'](),controller[_0x1d8b('0x10')]);router[_0x1d8b('0x11')](_0x1d8b('0xf'),auth[_0x1d8b('0xa')](),controller[_0x1d8b('0x12')]);module[_0x1d8b('0x13')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index bebc03e..31407d4 100644 --- a/server/api/smsTransferReport/smsTransferReport.attributes.js +++ b/server/api/smsTransferReport/smsTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x4654c3,_0x2e6037){var _0x2851db=function(_0x4189b6){while(--_0x4189b6){_0x4654c3['push'](_0x4654c3['shift']());}};_0x2851db(++_0x2e6037);}(_0x00bb,0x1d8));var _0xb00b=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0x00bb[_0x4baae2];return _0x1a2285;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}}; \ No newline at end of file +var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x4d521e,_0x58ba39){var _0x3beb42=function(_0x1a7bd2){while(--_0x1a7bd2){_0x4d521e['push'](_0x4d521e['shift']());}};_0x3beb42(++_0x58ba39);}(_0xb43b,0x1b2));var _0xbb43=function(_0x181c8b,_0x3e9a63){_0x181c8b=_0x181c8b-0x0;var _0x3e141c=_0xb43b[_0x181c8b];return _0x3e141c;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index d55396a..fd40dd5 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 _0xcc20=['json','apply','reject','save','then','destroy','end','error','stack','name','send','index','map','rawAttributes','model','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','query','order','sort','where','pick','filters','filter','merge','type','VIRTUAL','SmsTransferReport','findAll','rows','catch','show','params','includeAll','include','options','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','path','sox','to-csv','fs-extra','lodash','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','sendStatus','status','undefined','count','offset','limit','set','Content-Range'];(function(_0x330bf4,_0x4bb1c7){var _0x56cfba=function(_0x1cae8a){while(--_0x1cae8a){_0x330bf4['push'](_0x330bf4['shift']());}};_0x56cfba(++_0x4bb1c7);}(_0xcc20,0x114));var _0x0cc2=function(_0x2ca8ed,_0x3a1723){_0x2ca8ed=_0x2ca8ed-0x0;var _0x498cce=_0xcc20[_0x2ca8ed];return _0x498cce;};'use strict';var emlformat=require(_0x0cc2('0x0'));var rimraf=require(_0x0cc2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0cc2('0x2'));var rp=require(_0x0cc2('0x3'));var moment=require('moment');var BPromise=require(_0x0cc2('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x0cc2('0x5'));var sox=require(_0x0cc2('0x6'));var csv=require(_0x0cc2('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0cc2('0x8'));var _=require(_0x0cc2('0x9'));var squel=require('squel');var crypto=require(_0x0cc2('0xa'));var jsforce=require(_0x0cc2('0xb'));var deskjs=require(_0x0cc2('0xc'));var toCsv=require(_0x0cc2('0x7'));var querystring=require(_0x0cc2('0xd'));var Papa=require(_0x0cc2('0xe'));var Redis=require('ioredis');var authService=require(_0x0cc2('0xf'));var qs=require(_0x0cc2('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0cc2('0x11'));var logger=require(_0x0cc2('0x12'))(_0x0cc2('0x13'));var utils=require(_0x0cc2('0x14'));var config=require(_0x0cc2('0x15'));var licenseUtil=require(_0x0cc2('0x16'));var db=require(_0x0cc2('0x17'))['db'];function respondWithStatusCode(_0x2db4af,_0x23e350){_0x23e350=_0x23e350||0xcc;return function(_0x1ca175){if(_0x1ca175){return _0x2db4af[_0x0cc2('0x18')](_0x23e350);}return _0x2db4af['status'](_0x23e350)['end']();};}function respondWithResult(_0x50c282,_0x26a506){_0x26a506=_0x26a506||0xc8;return function(_0x39fb38){if(_0x39fb38){return _0x50c282[_0x0cc2('0x19')](_0x26a506)['json'](_0x39fb38);}};}function respondWithFilteredResult(_0x151644,_0x29b1fd){return function(_0x305d9e){if(_0x305d9e){var _0x2741aa=typeof _0x29b1fd['offset']===_0x0cc2('0x1a')&&typeof _0x29b1fd['limit']===_0x0cc2('0x1a');var _0x215c0e=_0x305d9e[_0x0cc2('0x1b')];var _0x48522a=_0x2741aa?0x0:_0x29b1fd['offset'];var _0xc04f31=_0x2741aa?_0x305d9e[_0x0cc2('0x1b')]:_0x29b1fd[_0x0cc2('0x1c')]+_0x29b1fd[_0x0cc2('0x1d')];var _0x1b1b0d;if(_0xc04f31>=_0x215c0e){_0xc04f31=_0x215c0e;_0x1b1b0d=0xc8;}else{_0x1b1b0d=0xce;}_0x151644[_0x0cc2('0x19')](_0x1b1b0d);return _0x151644[_0x0cc2('0x1e')](_0x0cc2('0x1f'),_0x48522a+'-'+_0xc04f31+'/'+_0x215c0e)[_0x0cc2('0x20')](_0x305d9e);}return null;};}function patchUpdates(_0x102cb2){return function(_0x2f7a42){try{jsonpatch[_0x0cc2('0x21')](_0x2f7a42,_0x102cb2,!![]);}catch(_0x234bc8){return BPromise[_0x0cc2('0x22')](_0x234bc8);}return _0x2f7a42[_0x0cc2('0x23')]();};}function saveUpdates(_0x533bc5,_0x3aefc5){return function(_0x350edd){if(_0x350edd){return _0x350edd['update'](_0x533bc5)[_0x0cc2('0x24')](function(_0x35793c){return _0x35793c;});}return null;};}function removeEntity(_0x18cad3,_0x52289f){return function(_0x50c68c){if(_0x50c68c){return _0x50c68c[_0x0cc2('0x25')]()['then'](function(){_0x18cad3[_0x0cc2('0x19')](0xcc)[_0x0cc2('0x26')]();});}};}function handleEntityNotFound(_0x54702c,_0x1f51be){return function(_0x55d4fc){if(!_0x55d4fc){_0x54702c['sendStatus'](0x194);}return _0x55d4fc;};}function handleError(_0x85d71,_0xc58d9c){_0xc58d9c=_0xc58d9c||0x1f4;return function(_0x31bd1a){logger[_0x0cc2('0x27')](_0x31bd1a[_0x0cc2('0x28')]);if(_0x31bd1a[_0x0cc2('0x29')]){delete _0x31bd1a[_0x0cc2('0x29')];}_0x85d71['status'](_0xc58d9c)[_0x0cc2('0x2a')](_0x31bd1a);};}exports[_0x0cc2('0x2b')]=function(_0x5c7fb1,_0x8481d){var _0x5414e5={},_0x3996d4={},_0x3c8adb={'count':0x0,'rows':[]};var _0x2f7b92=_[_0x0cc2('0x2c')](db['SmsTransferReport'][_0x0cc2('0x2d')],function(_0x2d72ab){return{'name':_0x2d72ab['fieldName'],'type':_0x2d72ab['type']['key']};});_0x3996d4[_0x0cc2('0x2e')]=_[_0x0cc2('0x2c')](_0x2f7b92,_0x0cc2('0x29'));_0x3996d4['query']=_[_0x0cc2('0x2f')](_0x5c7fb1['query']);_0x3996d4['filters']=_[_0x0cc2('0x30')](_0x3996d4[_0x0cc2('0x2e')],_0x3996d4['query']);_0x5414e5['attributes']=_[_0x0cc2('0x30')](_0x3996d4[_0x0cc2('0x2e')],qs[_0x0cc2('0x31')](_0x5c7fb1['query'][_0x0cc2('0x31')]));_0x5414e5['attributes']=_0x5414e5[_0x0cc2('0x32')][_0x0cc2('0x33')]?_0x5414e5['attributes']:_0x3996d4[_0x0cc2('0x2e')];if(!_0x5c7fb1['query'][_0x0cc2('0x34')](_0x0cc2('0x35'))){_0x5414e5['limit']=qs[_0x0cc2('0x1d')](_0x5c7fb1[_0x0cc2('0x36')][_0x0cc2('0x1d')]);_0x5414e5['offset']=qs[_0x0cc2('0x1c')](_0x5c7fb1[_0x0cc2('0x36')][_0x0cc2('0x1c')]);}_0x5414e5[_0x0cc2('0x37')]=qs[_0x0cc2('0x38')](_0x5c7fb1[_0x0cc2('0x36')][_0x0cc2('0x38')]);_0x5414e5[_0x0cc2('0x39')]=qs['filters'](_[_0x0cc2('0x3a')](_0x5c7fb1[_0x0cc2('0x36')],_0x3996d4[_0x0cc2('0x3b')]),_0x2f7b92);if(_0x5c7fb1['query'][_0x0cc2('0x3c')]){_0x5414e5[_0x0cc2('0x39')]=_[_0x0cc2('0x3d')](_0x5414e5[_0x0cc2('0x39')],{'$or':_[_0x0cc2('0x2c')](_0x2f7b92,function(_0x58e92c){if(_0x58e92c[_0x0cc2('0x3e')]!==_0x0cc2('0x3f')){var _0x35861b={};_0x35861b[_0x58e92c[_0x0cc2('0x29')]]={'$like':'%'+_0x5c7fb1['query'][_0x0cc2('0x3c')]+'%'};return _0x35861b;}})});}_0x5414e5=_[_0x0cc2('0x3d')]({},_0x5414e5,_0x5c7fb1['options']);var _0x56c086={'where':_0x5414e5['where']};return db[_0x0cc2('0x40')][_0x0cc2('0x1b')](_0x56c086)[_0x0cc2('0x24')](function(_0x1737da){_0x3c8adb[_0x0cc2('0x1b')]=_0x1737da;if(_0x5c7fb1[_0x0cc2('0x36')]['includeAll']){_0x5414e5['include']=[{'all':!![]}];}return db['SmsTransferReport'][_0x0cc2('0x41')](_0x5414e5);})[_0x0cc2('0x24')](function(_0x5ebaef){_0x3c8adb[_0x0cc2('0x42')]=_0x5ebaef;return _0x3c8adb;})[_0x0cc2('0x24')](respondWithFilteredResult(_0x8481d,_0x5414e5))[_0x0cc2('0x43')](handleError(_0x8481d,null));};exports[_0x0cc2('0x44')]=function(_0x2d2945,_0x5d0989){var _0x2efd38={'raw':!![],'where':{'id':_0x2d2945[_0x0cc2('0x45')]['id']}},_0x3f3453={};_0x3f3453[_0x0cc2('0x2e')]=_['keys'](db[_0x0cc2('0x40')][_0x0cc2('0x2d')]);_0x3f3453['query']=_[_0x0cc2('0x2f')](_0x2d2945[_0x0cc2('0x36')]);_0x3f3453[_0x0cc2('0x3b')]=_['intersection'](_0x3f3453[_0x0cc2('0x2e')],_0x3f3453[_0x0cc2('0x36')]);_0x2efd38[_0x0cc2('0x32')]=_[_0x0cc2('0x30')](_0x3f3453[_0x0cc2('0x2e')],qs[_0x0cc2('0x31')](_0x2d2945[_0x0cc2('0x36')]['fields']));_0x2efd38[_0x0cc2('0x32')]=_0x2efd38[_0x0cc2('0x32')]['length']?_0x2efd38[_0x0cc2('0x32')]:_0x3f3453['model'];if(_0x2d2945[_0x0cc2('0x36')][_0x0cc2('0x46')]){_0x2efd38[_0x0cc2('0x47')]=[{'all':!![]}];}_0x2efd38=_[_0x0cc2('0x3d')]({},_0x2efd38,_0x2d2945[_0x0cc2('0x48')]);return db['SmsTransferReport'][_0x0cc2('0x49')](_0x2efd38)[_0x0cc2('0x24')](handleEntityNotFound(_0x5d0989,null))[_0x0cc2('0x24')](respondWithResult(_0x5d0989,null))['catch'](handleError(_0x5d0989,null));};exports['create']=function(_0x8ca241,_0x2b4350){return db[_0x0cc2('0x40')][_0x0cc2('0x4a')](_0x8ca241[_0x0cc2('0x4b')],{})[_0x0cc2('0x24')](respondWithResult(_0x2b4350,0xc9))[_0x0cc2('0x43')](handleError(_0x2b4350,null));};exports['update']=function(_0x3b74bb,_0x493f3a){if(_0x3b74bb[_0x0cc2('0x4b')]['id']){delete _0x3b74bb[_0x0cc2('0x4b')]['id'];}return db[_0x0cc2('0x40')][_0x0cc2('0x49')]({'where':{'id':_0x3b74bb[_0x0cc2('0x45')]['id']}})[_0x0cc2('0x24')](handleEntityNotFound(_0x493f3a,null))['then'](saveUpdates(_0x3b74bb[_0x0cc2('0x4b')],null))[_0x0cc2('0x24')](respondWithResult(_0x493f3a,null))['catch'](handleError(_0x493f3a,null));};exports['destroy']=function(_0x26acc8,_0x2e3c97){return db[_0x0cc2('0x40')][_0x0cc2('0x49')]({'where':{'id':_0x26acc8[_0x0cc2('0x45')]['id']}})[_0x0cc2('0x24')](handleEntityNotFound(_0x2e3c97,null))['then'](removeEntity(_0x2e3c97,null))[_0x0cc2('0x43')](handleError(_0x2e3c97,null));};exports[_0x0cc2('0x4c')]=function(_0x8a4b05,_0x392282){return db[_0x0cc2('0x40')][_0x0cc2('0x4c')]()[_0x0cc2('0x24')](respondWithResult(_0x392282,null))['catch'](handleError(_0x392282,null));}; \ No newline at end of file +var _0xa7c8=['moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','map','SmsTransferReport','fieldName','key','model','query','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','rawAttributes','intersection','length','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise'];(function(_0x1657a5,_0x3c859e){var _0x191408=function(_0x4487c9){while(--_0x4487c9){_0x1657a5['push'](_0x1657a5['shift']());}};_0x191408(++_0x3c859e);}(_0xa7c8,0x128));var _0x8a7c=function(_0x81bd9d,_0x55a430){_0x81bd9d=_0x81bd9d-0x0;var _0x3b079f=_0xa7c8[_0x81bd9d];return _0x3b079f;};'use strict';var emlformat=require(_0x8a7c('0x0'));var rimraf=require(_0x8a7c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8a7c('0x2'));var rp=require(_0x8a7c('0x3'));var moment=require(_0x8a7c('0x4'));var BPromise=require(_0x8a7c('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x8a7c('0x6'));var sox=require(_0x8a7c('0x7'));var csv=require(_0x8a7c('0x8'));var ejs=require(_0x8a7c('0x9'));var fs=require('fs');var fs_extra=require(_0x8a7c('0xa'));var _=require(_0x8a7c('0xb'));var squel=require(_0x8a7c('0xc'));var crypto=require('crypto');var jsforce=require(_0x8a7c('0xd'));var deskjs=require(_0x8a7c('0xe'));var toCsv=require(_0x8a7c('0x8'));var querystring=require(_0x8a7c('0xf'));var Papa=require(_0x8a7c('0x10'));var Redis=require(_0x8a7c('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8a7c('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x8a7c('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x8a7c('0x14'));var licenseUtil=require(_0x8a7c('0x15'));var db=require(_0x8a7c('0x16'))['db'];function respondWithStatusCode(_0x583a8f,_0x267e9c){_0x267e9c=_0x267e9c||0xcc;return function(_0x243127){if(_0x243127){return _0x583a8f[_0x8a7c('0x17')](_0x267e9c);}return _0x583a8f['status'](_0x267e9c)[_0x8a7c('0x18')]();};}function respondWithResult(_0x117e6f,_0x2f9139){_0x2f9139=_0x2f9139||0xc8;return function(_0x4610c7){if(_0x4610c7){return _0x117e6f[_0x8a7c('0x19')](_0x2f9139)[_0x8a7c('0x1a')](_0x4610c7);}};}function respondWithFilteredResult(_0x4af2f2,_0x33dded){return function(_0x55cfeb){if(_0x55cfeb){var _0x156a02=typeof _0x33dded[_0x8a7c('0x1b')]===_0x8a7c('0x1c')&&typeof _0x33dded['limit']===_0x8a7c('0x1c');var _0x33a58d=_0x55cfeb[_0x8a7c('0x1d')];var _0x3f38c0=_0x156a02?0x0:_0x33dded['offset'];var _0x2ab92e=_0x156a02?_0x55cfeb[_0x8a7c('0x1d')]:_0x33dded[_0x8a7c('0x1b')]+_0x33dded[_0x8a7c('0x1e')];var _0xc89dc1;if(_0x2ab92e>=_0x33a58d){_0x2ab92e=_0x33a58d;_0xc89dc1=0xc8;}else{_0xc89dc1=0xce;}_0x4af2f2['status'](_0xc89dc1);return _0x4af2f2['set'](_0x8a7c('0x1f'),_0x3f38c0+'-'+_0x2ab92e+'/'+_0x33a58d)['json'](_0x55cfeb);}return null;};}function patchUpdates(_0x2dac64){return function(_0x1f49cc){try{jsonpatch[_0x8a7c('0x20')](_0x1f49cc,_0x2dac64,!![]);}catch(_0x564af1){return BPromise[_0x8a7c('0x21')](_0x564af1);}return _0x1f49cc[_0x8a7c('0x22')]();};}function saveUpdates(_0x1f1738,_0x55cdd7){return function(_0x39d301){if(_0x39d301){return _0x39d301[_0x8a7c('0x23')](_0x1f1738)[_0x8a7c('0x24')](function(_0x13bfc5){return _0x13bfc5;});}return null;};}function removeEntity(_0x591967,_0x536c0f){return function(_0x116a1b){if(_0x116a1b){return _0x116a1b[_0x8a7c('0x25')]()[_0x8a7c('0x24')](function(){_0x591967[_0x8a7c('0x19')](0xcc)[_0x8a7c('0x18')]();});}};}function handleEntityNotFound(_0x1c738d,_0x4972c3){return function(_0x13b4c7){if(!_0x13b4c7){_0x1c738d[_0x8a7c('0x17')](0x194);}return _0x13b4c7;};}function handleError(_0x41c010,_0x4e3c92){_0x4e3c92=_0x4e3c92||0x1f4;return function(_0x3efbf8){logger['error'](_0x3efbf8[_0x8a7c('0x26')]);if(_0x3efbf8[_0x8a7c('0x27')]){delete _0x3efbf8['name'];}_0x41c010[_0x8a7c('0x19')](_0x4e3c92)[_0x8a7c('0x28')](_0x3efbf8);};}exports['index']=function(_0x3ac236,_0x299db7){var _0x1996f7={},_0x446eff={},_0x13d41f={'count':0x0,'rows':[]};var _0x545c01=_[_0x8a7c('0x29')](db[_0x8a7c('0x2a')]['rawAttributes'],function(_0x24bdb2){return{'name':_0x24bdb2[_0x8a7c('0x2b')],'type':_0x24bdb2['type'][_0x8a7c('0x2c')]};});_0x446eff[_0x8a7c('0x2d')]=_[_0x8a7c('0x29')](_0x545c01,_0x8a7c('0x27'));_0x446eff[_0x8a7c('0x2e')]=_['keys'](_0x3ac236[_0x8a7c('0x2e')]);_0x446eff[_0x8a7c('0x2f')]=_['intersection'](_0x446eff['model'],_0x446eff[_0x8a7c('0x2e')]);_0x1996f7[_0x8a7c('0x30')]=_['intersection'](_0x446eff[_0x8a7c('0x2d')],qs[_0x8a7c('0x31')](_0x3ac236[_0x8a7c('0x2e')][_0x8a7c('0x31')]));_0x1996f7[_0x8a7c('0x30')]=_0x1996f7[_0x8a7c('0x30')]['length']?_0x1996f7[_0x8a7c('0x30')]:_0x446eff[_0x8a7c('0x2d')];if(!_0x3ac236['query'][_0x8a7c('0x32')](_0x8a7c('0x33'))){_0x1996f7[_0x8a7c('0x1e')]=qs['limit'](_0x3ac236[_0x8a7c('0x2e')][_0x8a7c('0x1e')]);_0x1996f7[_0x8a7c('0x1b')]=qs[_0x8a7c('0x1b')](_0x3ac236[_0x8a7c('0x2e')][_0x8a7c('0x1b')]);}_0x1996f7[_0x8a7c('0x34')]=qs[_0x8a7c('0x35')](_0x3ac236['query'][_0x8a7c('0x35')]);_0x1996f7[_0x8a7c('0x36')]=qs[_0x8a7c('0x2f')](_[_0x8a7c('0x37')](_0x3ac236[_0x8a7c('0x2e')],_0x446eff[_0x8a7c('0x2f')]),_0x545c01);if(_0x3ac236[_0x8a7c('0x2e')][_0x8a7c('0x38')]){_0x1996f7[_0x8a7c('0x36')]=_[_0x8a7c('0x39')](_0x1996f7[_0x8a7c('0x36')],{'$or':_['map'](_0x545c01,function(_0x3ce013){if(_0x3ce013[_0x8a7c('0x3a')]!==_0x8a7c('0x3b')){var _0x4b9bd2={};_0x4b9bd2[_0x3ce013[_0x8a7c('0x27')]]={'$like':'%'+_0x3ac236[_0x8a7c('0x2e')][_0x8a7c('0x38')]+'%'};return _0x4b9bd2;}})});}_0x1996f7=_['merge']({},_0x1996f7,_0x3ac236[_0x8a7c('0x3c')]);var _0x10342d={'where':_0x1996f7[_0x8a7c('0x36')]};return db[_0x8a7c('0x2a')][_0x8a7c('0x1d')](_0x10342d)[_0x8a7c('0x24')](function(_0x335150){_0x13d41f['count']=_0x335150;if(_0x3ac236[_0x8a7c('0x2e')]['includeAll']){_0x1996f7[_0x8a7c('0x3d')]=[{'all':!![]}];}return db[_0x8a7c('0x2a')][_0x8a7c('0x3e')](_0x1996f7);})[_0x8a7c('0x24')](function(_0x26e12e){_0x13d41f[_0x8a7c('0x3f')]=_0x26e12e;return _0x13d41f;})['then'](respondWithFilteredResult(_0x299db7,_0x1996f7))[_0x8a7c('0x40')](handleError(_0x299db7,null));};exports[_0x8a7c('0x41')]=function(_0x291186,_0xaa8359){var _0xb311a4={'raw':!![],'where':{'id':_0x291186[_0x8a7c('0x42')]['id']}},_0x2f00f4={};_0x2f00f4[_0x8a7c('0x2d')]=_[_0x8a7c('0x43')](db[_0x8a7c('0x2a')][_0x8a7c('0x44')]);_0x2f00f4[_0x8a7c('0x2e')]=_[_0x8a7c('0x43')](_0x291186[_0x8a7c('0x2e')]);_0x2f00f4[_0x8a7c('0x2f')]=_['intersection'](_0x2f00f4['model'],_0x2f00f4['query']);_0xb311a4[_0x8a7c('0x30')]=_[_0x8a7c('0x45')](_0x2f00f4['model'],qs[_0x8a7c('0x31')](_0x291186['query'][_0x8a7c('0x31')]));_0xb311a4[_0x8a7c('0x30')]=_0xb311a4[_0x8a7c('0x30')][_0x8a7c('0x46')]?_0xb311a4[_0x8a7c('0x30')]:_0x2f00f4[_0x8a7c('0x2d')];if(_0x291186[_0x8a7c('0x2e')]['includeAll']){_0xb311a4[_0x8a7c('0x3d')]=[{'all':!![]}];}_0xb311a4=_[_0x8a7c('0x39')]({},_0xb311a4,_0x291186[_0x8a7c('0x3c')]);return db['SmsTransferReport'][_0x8a7c('0x47')](_0xb311a4)[_0x8a7c('0x24')](handleEntityNotFound(_0xaa8359,null))[_0x8a7c('0x24')](respondWithResult(_0xaa8359,null))[_0x8a7c('0x40')](handleError(_0xaa8359,null));};exports[_0x8a7c('0x48')]=function(_0x4f4ab2,_0x39d70f){return db[_0x8a7c('0x2a')][_0x8a7c('0x48')](_0x4f4ab2[_0x8a7c('0x49')],{})[_0x8a7c('0x24')](respondWithResult(_0x39d70f,0xc9))[_0x8a7c('0x40')](handleError(_0x39d70f,null));};exports[_0x8a7c('0x23')]=function(_0xed38d7,_0x129a2d){if(_0xed38d7['body']['id']){delete _0xed38d7[_0x8a7c('0x49')]['id'];}return db['SmsTransferReport']['find']({'where':{'id':_0xed38d7[_0x8a7c('0x42')]['id']}})[_0x8a7c('0x24')](handleEntityNotFound(_0x129a2d,null))[_0x8a7c('0x24')](saveUpdates(_0xed38d7['body'],null))[_0x8a7c('0x24')](respondWithResult(_0x129a2d,null))['catch'](handleError(_0x129a2d,null));};exports[_0x8a7c('0x25')]=function(_0x405506,_0x2b5998){return db[_0x8a7c('0x2a')][_0x8a7c('0x47')]({'where':{'id':_0x405506[_0x8a7c('0x42')]['id']}})[_0x8a7c('0x24')](handleEntityNotFound(_0x2b5998,null))[_0x8a7c('0x24')](removeEntity(_0x2b5998,null))[_0x8a7c('0x40')](handleError(_0x2b5998,null));};exports['describe']=function(_0x2cd397,_0x5aeec9){return db[_0x8a7c('0x2a')][_0x8a7c('0x4a')]()['then'](respondWithResult(_0x5aeec9,null))[_0x8a7c('0x40')](handleError(_0x5aeec9,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index d793260..c8ae5bc 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 _0x6f72=['../../config/environment','exports','SmsTransferReport','report_sms_transfer','util','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x2bb74c,_0x3eaed4){var _0x37d650=function(_0x44ef25){while(--_0x44ef25){_0x2bb74c['push'](_0x2bb74c['shift']());}};_0x37d650(++_0x3eaed4);}(_0x6f72,0xae));var _0x26f7=function(_0x398117,_0x1ce6a0){_0x398117=_0x398117-0x0;var _0x4d49f3=_0x6f72[_0x398117];return _0x4d49f3;};'use strict';var _=require('lodash');var util=require(_0x26f7('0x0'));var logger=require(_0x26f7('0x1'))(_0x26f7('0x2'));var moment=require('moment');var BPromise=require(_0x26f7('0x3'));var rp=require(_0x26f7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x26f7('0x5'));var config=require(_0x26f7('0x6'));var attributes=require('./smsTransferReport.attributes');module[_0x26f7('0x7')]=function(_0x50719f,_0x29465a){return _0x50719f['define'](_0x26f7('0x8'),attributes,{'tableName':_0x26f7('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x5997=['../../config/logger','moment','request-promise','path','rimraf','exports','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash'];(function(_0x4d9443,_0xe0d01f){var _0x350586=function(_0x1e8783){while(--_0x1e8783){_0x4d9443['push'](_0x4d9443['shift']());}};_0x350586(++_0xe0d01f);}(_0x5997,0x6d));var _0x7599=function(_0x9c2208,_0x5230ef){_0x9c2208=_0x9c2208-0x0;var _0x415faf=_0x5997[_0x9c2208];return _0x415faf;};'use strict';var _=require(_0x7599('0x0'));var util=require('util');var logger=require(_0x7599('0x1'))('api');var moment=require(_0x7599('0x2'));var BPromise=require('bluebird');var rp=require(_0x7599('0x3'));var fs=require('fs');var path=require(_0x7599('0x4'));var rimraf=require(_0x7599('0x5'));var config=require('../../config/environment');var attributes=require('./smsTransferReport.attributes');module[_0x7599('0x6')]=function(_0x33ddec,_0x5c99f4){return _0x33ddec[_0x7599('0x7')](_0x7599('0x8'),attributes,{'tableName':_0x7599('0x9'),'paranoid':![],'indexes':[{'name':_0x7599('0xa'),'fields':[_0x7599('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index a68e0fa..5d45495 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 _0x46cb=['stringify','error','code','SmsTransferReport,\x20%s,\x20%s','message','result','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SmsTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x47a57f,_0x5e3b5b){var _0x3a6fa8=function(_0x8d49a5){while(--_0x8d49a5){_0x47a57f['push'](_0x47a57f['shift']());}};_0x3a6fa8(++_0x5e3b5b);}(_0x46cb,0xd6));var _0xb46c=function(_0x2f1172,_0x5f5b26){_0x2f1172=_0x2f1172-0x0;var _0x58e374=_0x46cb[_0x2f1172];return _0x58e374;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xb46c('0x0'));var rs=require(_0xb46c('0x1'));var fs=require('fs');var Redis=require(_0xb46c('0x2'));var db=require(_0xb46c('0x3'))['db'];var utils=require(_0xb46c('0x4'));var logger=require(_0xb46c('0x5'))(_0xb46c('0x6'));var config=require(_0xb46c('0x7'));var jayson=require(_0xb46c('0x8'));var client=jayson[_0xb46c('0x9')][_0xb46c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4603b8,_0x2e138d,_0x2771fe){return new BPromise(function(_0x5dfe97,_0x1c58e2){return client[_0xb46c('0xb')](_0x4603b8,_0x2771fe)[_0xb46c('0xc')](function(_0x19a47e){logger[_0xb46c('0xd')]('SmsTransferReport,\x20%s,\x20%s',_0x2e138d,'request\x20sent');logger['debug'](_0xb46c('0xe'),_0x2e138d,_0xb46c('0xf'),JSON[_0xb46c('0x10')](_0x19a47e));if(_0x19a47e[_0xb46c('0x11')]){if(_0x19a47e[_0xb46c('0x11')][_0xb46c('0x12')]===0x1f4){logger['error'](_0xb46c('0x13'),_0x2e138d,_0x19a47e['error'][_0xb46c('0x14')]);return _0x1c58e2(_0x19a47e[_0xb46c('0x11')]['message']);}logger[_0xb46c('0x11')](_0xb46c('0x13'),_0x2e138d,_0x19a47e[_0xb46c('0x11')]['message']);return _0x5dfe97(_0x19a47e[_0xb46c('0x11')][_0xb46c('0x14')]);}else{logger['info'](_0xb46c('0x13'),_0x2e138d,_0xb46c('0xf'));_0x5dfe97(_0x19a47e[_0xb46c('0x15')][_0xb46c('0x14')]);}})[_0xb46c('0x16')](function(_0x41f6b4){logger[_0xb46c('0x11')](_0xb46c('0x13'),_0x2e138d,_0x41f6b4);_0x1c58e2(_0x41f6b4);});});} \ No newline at end of file +var _0x47c7=['request\x20sent','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','SmsTransferReport,\x20%s,\x20%s'];(function(_0x1ddd14,_0x2f303c){var _0x4077d6=function(_0x509b6f){while(--_0x509b6f){_0x1ddd14['push'](_0x1ddd14['shift']());}};_0x4077d6(++_0x2f303c);}(_0x47c7,0x1ab));var _0x747c=function(_0x223461,_0x2bca70){_0x223461=_0x223461-0x0;var _0x4dbe0a=_0x47c7[_0x223461];return _0x4dbe0a;};'use strict';var _=require(_0x747c('0x0'));var util=require('util');var moment=require(_0x747c('0x1'));var BPromise=require(_0x747c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x747c('0x3'));var db=require(_0x747c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x747c('0x5'))(_0x747c('0x6'));var config=require(_0x747c('0x7'));var jayson=require(_0x747c('0x8'));var client=jayson['client'][_0x747c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4eb6bc,_0xfc4504,_0x24206f){return new BPromise(function(_0x10b9f0,_0x21e0f1){return client[_0x747c('0xa')](_0x4eb6bc,_0x24206f)['then'](function(_0x47eac8){logger[_0x747c('0xb')](_0x747c('0xc'),_0xfc4504,_0x747c('0xd'));logger['debug'](_0x747c('0xe'),_0xfc4504,_0x747c('0xd'),JSON[_0x747c('0xf')](_0x47eac8));if(_0x47eac8['error']){if(_0x47eac8[_0x747c('0x10')]['code']===0x1f4){logger['error'](_0x747c('0xc'),_0xfc4504,_0x47eac8[_0x747c('0x10')][_0x747c('0x11')]);return _0x21e0f1(_0x47eac8[_0x747c('0x10')][_0x747c('0x11')]);}logger[_0x747c('0x10')](_0x747c('0xc'),_0xfc4504,_0x47eac8[_0x747c('0x10')][_0x747c('0x11')]);return _0x10b9f0(_0x47eac8[_0x747c('0x10')]['message']);}else{logger['info'](_0x747c('0xc'),_0xfc4504,_0x747c('0xd'));_0x10b9f0(_0x47eac8[_0x747c('0x12')]['message']);}})[_0x747c('0x13')](function(_0x1887d6){logger[_0x747c('0x10')](_0x747c('0xc'),_0xfc4504,_0x1887d6);_0x21e0f1(_0x1887d6);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 1e4ce83..c104da5 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 _0xe239=['download','diskStorage','join','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s','basename','now','extname','single','file','create','put','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./sound.controller','get','isAuthenticated','index','/:id','show','/:id/download'];(function(_0x13bdb8,_0x288e1d){var _0x1c5ad5=function(_0x40af78){while(--_0x40af78){_0x13bdb8['push'](_0x13bdb8['shift']());}};_0x1c5ad5(++_0x288e1d);}(_0xe239,0x145));var _0x9e23=function(_0x3d6d87,_0x93d79){_0x3d6d87=_0x3d6d87-0x0;var _0x26ac8a=_0xe239[_0x3d6d87];return _0x26ac8a;};'use strict';var multer=require(_0x9e23('0x0'));var util=require('util');var path=require(_0x9e23('0x1'));var timeout=require(_0x9e23('0x2'));var express=require(_0x9e23('0x3'));var router=express[_0x9e23('0x4')]();var fs_extra=require(_0x9e23('0x5'));var auth=require(_0x9e23('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9e23('0x7'));var controller=require(_0x9e23('0x8'));router[_0x9e23('0x9')]('/',auth[_0x9e23('0xa')](),controller[_0x9e23('0xb')]);router[_0x9e23('0x9')](_0x9e23('0xc'),auth[_0x9e23('0xa')](),controller[_0x9e23('0xd')]);router[_0x9e23('0x9')](_0x9e23('0xe'),auth['isAuthenticated'](),controller[_0x9e23('0xf')]);var upload=multer({'storage':multer[_0x9e23('0x10')]({'destination':function(_0x1fe64b,_0x4b8465,_0x5ac607){_0x5ac607(null,path[_0x9e23('0x11')](config[_0x9e23('0x12')],_0x9e23('0x13')));},'filename':function(_0x2938d5,_0x9e2e0a,_0x276d6a){_0x9e2e0a[_0x9e23('0x14')]=_0x9e2e0a[_0x9e23('0x14')][_0x9e23('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x276d6a(null,util[_0x9e23('0x16')](_0x9e23('0x17'),path[_0x9e23('0x18')](_0x9e2e0a[_0x9e23('0x14')],path['extname'](_0x9e2e0a[_0x9e23('0x14')])),Date[_0x9e23('0x19')](),path[_0x9e23('0x1a')](_0x9e2e0a[_0x9e23('0x14')])));}})});router['post']('/',upload[_0x9e23('0x1b')](_0x9e23('0x1c')),controller[_0x9e23('0x1d')]);router[_0x9e23('0x1e')](_0x9e23('0xc'),auth['isAuthenticated'](),controller[_0x9e23('0x1f')]);router[_0x9e23('0x20')](_0x9e23('0xc'),auth[_0x9e23('0xa')](),controller[_0x9e23('0x20')]);module[_0x9e23('0x21')]=router; \ No newline at end of file +var _0x723e=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./sound.controller','index','/:id','isAuthenticated','get','join','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s','extname','now','post','file','put','delete','exports','multer'];(function(_0x4a2fed,_0x50e41e){var _0x15c598=function(_0x202a98){while(--_0x202a98){_0x4a2fed['push'](_0x4a2fed['shift']());}};_0x15c598(++_0x50e41e);}(_0x723e,0x6b));var _0xe723=function(_0x5ac5e8,_0xc333d2){_0x5ac5e8=_0x5ac5e8-0x0;var _0x5eb1ff=_0x723e[_0x5ac5e8];return _0x5eb1ff;};'use strict';var multer=require(_0xe723('0x0'));var util=require(_0xe723('0x1'));var path=require(_0xe723('0x2'));var timeout=require(_0xe723('0x3'));var express=require(_0xe723('0x4'));var router=express['Router']();var fs_extra=require(_0xe723('0x5'));var auth=require(_0xe723('0x6'));var interaction=require(_0xe723('0x7'));var config=require('../../config/environment');var controller=require(_0xe723('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xe723('0x9')]);router['get'](_0xe723('0xa'),auth[_0xe723('0xb')](),controller['show']);router[_0xe723('0xc')]('/:id/download',auth['isAuthenticated'](),controller['download']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x399ed7,_0x257c06,_0x1367e4){_0x1367e4(null,path[_0xe723('0xd')](config[_0xe723('0xe')],_0xe723('0xf')));},'filename':function(_0x20764f,_0x4a3cde,_0x3d6993){_0x4a3cde['originalname']=_0x4a3cde[_0xe723('0x10')][_0xe723('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3d6993(null,util[_0xe723('0x12')](_0xe723('0x13'),path['basename'](_0x4a3cde['originalname'],path[_0xe723('0x14')](_0x4a3cde[_0xe723('0x10')])),Date[_0xe723('0x15')](),path['extname'](_0x4a3cde[_0xe723('0x10')])));}})});router[_0xe723('0x16')]('/',upload['single'](_0xe723('0x17')),controller['create']);router[_0xe723('0x18')]('/:id',auth[_0xe723('0xb')](),controller['update']);router['delete'](_0xe723('0xa'),auth['isAuthenticated'](),controller[_0xe723('0x19')]);module[_0xe723('0x1a')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 0a8cd79..98da4fa 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 _0xb310=['exports','STRING','name','FLOAT','BIGINT','INTEGER','sequelize'];(function(_0x197c1e,_0x507a50){var _0x207bec=function(_0x560a19){while(--_0x560a19){_0x197c1e['push'](_0x197c1e['shift']());}};_0x207bec(++_0x507a50);}(_0xb310,0x1bf));var _0x0b31=function(_0x15b0dd,_0x2778ca){_0x15b0dd=_0x15b0dd-0x0;var _0x74ee95=_0xb310[_0x15b0dd];return _0x74ee95;};'use strict';var Sequelize=require(_0x0b31('0x0'));module[_0x0b31('0x1')]={'name':{'type':Sequelize[_0x0b31('0x2')],'unique':_0x0b31('0x3'),'allowNull':![]},'save_name':{'type':Sequelize[_0x0b31('0x2')]},'display_name':{'type':Sequelize[_0x0b31('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0x0b31('0x2')]},'original_format':{'type':Sequelize[_0x0b31('0x2')]},'original_duration':{'type':Sequelize[_0x0b31('0x4')]},'original_sampleCount':{'type':Sequelize[_0x0b31('0x5')]},'original_channelCount':{'type':Sequelize[_0x0b31('0x6')]},'original_bitRate':{'type':Sequelize[_0x0b31('0x5')]},'original_sampleRate':{'type':Sequelize[_0x0b31('0x6')]},'converted_format':{'type':Sequelize[_0x0b31('0x2')]},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0x0b31('0x5')]},'converted_channelCount':{'type':Sequelize[_0x0b31('0x6')]},'converted_bitRate':{'type':Sequelize[_0x0b31('0x5')]},'converted_sampleRate':{'type':Sequelize[_0x0b31('0x6')]}}; \ No newline at end of file +var _0xd158=['FLOAT','BIGINT','INTEGER','exports','name','STRING'];(function(_0x4b3306,_0x1244d9){var _0x454de2=function(_0x36d4a3){while(--_0x36d4a3){_0x4b3306['push'](_0x4b3306['shift']());}};_0x454de2(++_0x1244d9);}(_0xd158,0xa5));var _0x8d15=function(_0x364492,_0x58bbb6){_0x364492=_0x364492-0x0;var _0x4fddc9=_0xd158[_0x364492];return _0x4fddc9;};'use strict';var Sequelize=require('sequelize');module[_0x8d15('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x8d15('0x1'),'allowNull':![]},'save_name':{'type':Sequelize[_0x8d15('0x2')]},'display_name':{'type':Sequelize[_0x8d15('0x2')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0x8d15('0x2')]},'original_duration':{'type':Sequelize[_0x8d15('0x3')]},'original_sampleCount':{'type':Sequelize[_0x8d15('0x4')]},'original_channelCount':{'type':Sequelize[_0x8d15('0x5')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0x8d15('0x5')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize[_0x8d15('0x3')]},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index e6f712a..34109b8 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 _0x6390=['request-promise','bluebird','util','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','then','Sounds','destroy','name','send','index','Sound','rawAttributes','fieldName','type','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','include','find','params','save_name','converted_format','join','server/files/sounds/converted','ValidationError','Sound\x20not\x20found','download','root','format','%s.%s','create','basename','file','originalname','filename','extname','wav','Sound\x20upload\x20filepath:\x20%s','info','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','error','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','pick','delete','server/files/sounds/original','original_format','eml-format','zip-dir','fast-json-patch'];(function(_0x337748,_0x402b05){var _0x3bb03f=function(_0x2fcdf4){while(--_0x2fcdf4){_0x337748['push'](_0x337748['shift']());}};_0x3bb03f(++_0x402b05);}(_0x6390,0x171));var _0x0639=function(_0x17f122,_0xbc796f){_0x17f122=_0x17f122-0x0;var _0x431bd8=_0x6390[_0x17f122];return _0x431bd8;};'use strict';var emlformat=require(_0x0639('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0639('0x1'));var jsonpatch=require(_0x0639('0x2'));var rp=require(_0x0639('0x3'));var moment=require('moment');var BPromise=require(_0x0639('0x4'));var Mustache=require('mustache');var util=require(_0x0639('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0639('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0639('0x7'));var squel=require('squel');var crypto=require(_0x0639('0x8'));var jsforce=require(_0x0639('0x9'));var deskjs=require(_0x0639('0xa'));var toCsv=require(_0x0639('0xb'));var querystring=require(_0x0639('0xc'));var Papa=require(_0x0639('0xd'));var Redis=require('ioredis');var authService=require(_0x0639('0xe'));var qs=require(_0x0639('0xf'));var as=require(_0x0639('0x10'));var hardwareService=require(_0x0639('0x11'));var logger=require(_0x0639('0x12'))(_0x0639('0x13'));var utils=require('../../config/utils');var config=require(_0x0639('0x14'));var licenseUtil=require(_0x0639('0x15'));var db=require(_0x0639('0x16'))['db'];function respondWithStatusCode(_0x46590b,_0x10b1b9){_0x10b1b9=_0x10b1b9||0xcc;return function(_0x176318){if(_0x176318){return _0x46590b[_0x0639('0x17')](_0x10b1b9);}return _0x46590b['status'](_0x10b1b9)[_0x0639('0x18')]();};}function respondWithResult(_0x2b73b3,_0xedf765){_0xedf765=_0xedf765||0xc8;return function(_0x3779c5){if(_0x3779c5){return _0x2b73b3[_0x0639('0x19')](_0xedf765)[_0x0639('0x1a')](_0x3779c5);}};}function respondWithFilteredResult(_0x22d6be,_0x46a973){return function(_0x2264ef){if(_0x2264ef){var _0x3cf374=typeof _0x46a973[_0x0639('0x1b')]==='undefined'&&typeof _0x46a973[_0x0639('0x1c')]===_0x0639('0x1d');var _0x348047=_0x2264ef[_0x0639('0x1e')];var _0x1ddeb8=_0x3cf374?0x0:_0x46a973['offset'];var _0x429b39=_0x3cf374?_0x2264ef['count']:_0x46a973['offset']+_0x46a973['limit'];var _0x20cc8b;if(_0x429b39>=_0x348047){_0x429b39=_0x348047;_0x20cc8b=0xc8;}else{_0x20cc8b=0xce;}_0x22d6be[_0x0639('0x19')](_0x20cc8b);return _0x22d6be[_0x0639('0x1f')](_0x0639('0x20'),_0x1ddeb8+'-'+_0x429b39+'/'+_0x348047)[_0x0639('0x1a')](_0x2264ef);}return null;};}function patchUpdates(_0x52bfaf){return function(_0x3b652b){try{jsonpatch[_0x0639('0x21')](_0x3b652b,_0x52bfaf,!![]);}catch(_0x27eb0b){return BPromise['reject'](_0x27eb0b);}return _0x3b652b[_0x0639('0x22')]();};}function saveUpdates(_0x381c91,_0x4b27a2){return function(_0x58d4f7){if(_0x58d4f7){return _0x58d4f7['update'](_0x381c91)[_0x0639('0x23')](function(_0x4c6330){return _0x4c6330;});}return null;};}function removeEntity(_0x565a39,_0x5402cd){return function(_0x29fabb){if(_0x29fabb){return _0x29fabb['destroy']()[_0x0639('0x23')](function(){var _0x30d2e2=_0x29fabb['get']({'plain':!![]});var _0x5e17a5=_0x0639('0x24');return db['UserProfileResource'][_0x0639('0x25')]({'where':{'type':_0x5e17a5,'resourceId':_0x30d2e2['id']}})[_0x0639('0x23')](function(){return _0x29fabb;});})['then'](function(){_0x565a39[_0x0639('0x19')](0xcc)[_0x0639('0x18')]();});}};}function handleEntityNotFound(_0x4c6bc9,_0x35411b){return function(_0x31e5de){if(!_0x31e5de){_0x4c6bc9[_0x0639('0x17')](0x194);}return _0x31e5de;};}function handleError(_0x42de8b,_0x19a89d){_0x19a89d=_0x19a89d||0x1f4;return function(_0x234944){logger['error'](_0x234944['stack']);if(_0x234944[_0x0639('0x26')]){delete _0x234944['name'];}_0x42de8b['status'](_0x19a89d)[_0x0639('0x27')](_0x234944);};}exports[_0x0639('0x28')]=function(_0x317283,_0xadef48){var _0x169b8a={},_0x14d84c={},_0x28fdea={'count':0x0,'rows':[]};var _0x525799=_['map'](db[_0x0639('0x29')][_0x0639('0x2a')],function(_0x3e0b62){return{'name':_0x3e0b62[_0x0639('0x2b')],'type':_0x3e0b62[_0x0639('0x2c')]['key']};});_0x14d84c[_0x0639('0x2d')]=_[_0x0639('0x2e')](_0x525799,_0x0639('0x26'));_0x14d84c[_0x0639('0x2f')]=_[_0x0639('0x30')](_0x317283['query']);_0x14d84c[_0x0639('0x31')]=_['intersection'](_0x14d84c[_0x0639('0x2d')],_0x14d84c['query']);_0x169b8a[_0x0639('0x32')]=_[_0x0639('0x33')](_0x14d84c[_0x0639('0x2d')],qs[_0x0639('0x34')](_0x317283[_0x0639('0x2f')][_0x0639('0x34')]));_0x169b8a['attributes']=_0x169b8a[_0x0639('0x32')][_0x0639('0x35')]?_0x169b8a[_0x0639('0x32')]:_0x14d84c[_0x0639('0x2d')];if(!_0x317283[_0x0639('0x2f')][_0x0639('0x36')]('nolimit')){_0x169b8a[_0x0639('0x1c')]=qs[_0x0639('0x1c')](_0x317283[_0x0639('0x2f')]['limit']);_0x169b8a[_0x0639('0x1b')]=qs[_0x0639('0x1b')](_0x317283[_0x0639('0x2f')][_0x0639('0x1b')]);}_0x169b8a[_0x0639('0x37')]=qs[_0x0639('0x38')](_0x317283[_0x0639('0x2f')][_0x0639('0x38')]);_0x169b8a[_0x0639('0x39')]=qs[_0x0639('0x31')](_['pick'](_0x317283[_0x0639('0x2f')],_0x14d84c[_0x0639('0x31')]),_0x525799);if(_0x317283[_0x0639('0x2f')][_0x0639('0x3a')]){_0x169b8a[_0x0639('0x39')]=_[_0x0639('0x3b')](_0x169b8a[_0x0639('0x39')],{'$or':_[_0x0639('0x2e')](_0x525799,function(_0x41bfab){if(_0x41bfab['type']!==_0x0639('0x3c')){var _0x3061ff={};_0x3061ff[_0x41bfab[_0x0639('0x26')]]={'$like':'%'+_0x317283['query'][_0x0639('0x3a')]+'%'};return _0x3061ff;}})});}_0x169b8a=_['merge']({},_0x169b8a,_0x317283[_0x0639('0x3d')]);var _0x32c745={'where':_0x169b8a[_0x0639('0x39')]};return db['Sound']['count'](_0x32c745)[_0x0639('0x23')](function(_0x5830e4){_0x28fdea['count']=_0x5830e4;if(_0x317283[_0x0639('0x2f')][_0x0639('0x3e')]){_0x169b8a['include']=[{'all':!![]}];}return db[_0x0639('0x29')][_0x0639('0x3f')](_0x169b8a);})[_0x0639('0x23')](function(_0x590f6d){_0x28fdea[_0x0639('0x40')]=_0x590f6d;return _0x28fdea;})[_0x0639('0x23')](respondWithFilteredResult(_0xadef48,_0x169b8a))[_0x0639('0x41')](handleError(_0xadef48,null));};exports['show']=function(_0x176243,_0x355939){var _0x5eeff2={'raw':!![],'where':{'id':_0x176243['params']['id']}},_0x31e00d={};_0x31e00d[_0x0639('0x2d')]=_[_0x0639('0x30')](db[_0x0639('0x29')][_0x0639('0x2a')]);_0x31e00d[_0x0639('0x2f')]=_[_0x0639('0x30')](_0x176243['query']);_0x31e00d[_0x0639('0x31')]=_[_0x0639('0x33')](_0x31e00d[_0x0639('0x2d')],_0x31e00d[_0x0639('0x2f')]);_0x5eeff2[_0x0639('0x32')]=_[_0x0639('0x33')](_0x31e00d[_0x0639('0x2d')],qs['fields'](_0x176243[_0x0639('0x2f')][_0x0639('0x34')]));_0x5eeff2[_0x0639('0x32')]=_0x5eeff2[_0x0639('0x32')][_0x0639('0x35')]?_0x5eeff2[_0x0639('0x32')]:_0x31e00d[_0x0639('0x2d')];if(_0x176243['query'][_0x0639('0x3e')]){_0x5eeff2[_0x0639('0x42')]=[{'all':!![]}];}_0x5eeff2=_['merge']({},_0x5eeff2,_0x176243['options']);return db[_0x0639('0x29')][_0x0639('0x43')](_0x5eeff2)['then'](handleEntityNotFound(_0x355939,null))['then'](respondWithResult(_0x355939,null))[_0x0639('0x41')](handleError(_0x355939,null));};exports['download']=function(_0x47659e,_0xc77383,_0x344126){return db[_0x0639('0x29')]['find']({'where':{'id':_0x47659e[_0x0639('0x44')]['id']},'attributes':[_0x0639('0x26'),_0x0639('0x45'),_0x0639('0x46')],'raw':!![]})[_0x0639('0x23')](handleEntityNotFound(_0xc77383,null))[_0x0639('0x23')](function(_0xf35dd9){if(_0xf35dd9){if(!fs['existsSync'](path[_0x0639('0x47')](config['root'],_0x0639('0x48'),_0xf35dd9[_0x0639('0x45')]+'.'+_0xf35dd9[_0x0639('0x46')]))){throw new db['Sequelize'][(_0x0639('0x49'))](_0x0639('0x4a'));}return _0xc77383[_0x0639('0x4b')](path[_0x0639('0x47')](config[_0x0639('0x4c')],_0x0639('0x48'),util[_0x0639('0x4d')](_0x0639('0x4e'),_0xf35dd9[_0x0639('0x45')],_0xf35dd9[_0x0639('0x46')])),util[_0x0639('0x4d')](_0x0639('0x4e'),_0xf35dd9[_0x0639('0x26')],_0xf35dd9[_0x0639('0x46')]));}return null;})[_0x0639('0x41')](handleError(_0xc77383,null));};exports[_0x0639('0x4f')]=function(_0x4c54b4,_0x367e8f,_0x499af8){var _0x4de965={'name':path[_0x0639('0x50')](_0x4c54b4[_0x0639('0x51')]['originalname'],path['extname'](_0x4c54b4[_0x0639('0x51')][_0x0639('0x52')])),'save_name':path['basename'](_0x4c54b4[_0x0639('0x51')][_0x0639('0x53')],path[_0x0639('0x54')](_0x4c54b4['file'][_0x0639('0x53')])),'original_format':path['extname'](_0x4c54b4['file']['originalname'])['substring'](0x1),'converted_format':_0x0639('0x55')};var _0x39a7c7=path[_0x0639('0x47')](config[_0x0639('0x4c')],'server/files/sounds/original',_0x4c54b4[_0x0639('0x51')][_0x0639('0x53')]);var _0x301623=path[_0x0639('0x47')](config[_0x0639('0x4c')],_0x0639('0x48'),util[_0x0639('0x4d')](_0x0639('0x4e'),path[_0x0639('0x50')](_0x4c54b4[_0x0639('0x51')][_0x0639('0x53')],path[_0x0639('0x54')](_0x4c54b4[_0x0639('0x51')][_0x0639('0x53')])),_0x4de965[_0x0639('0x46')]));logger['info'](_0x0639('0x56'),_0x39a7c7);logger[_0x0639('0x57')](_0x0639('0x58'),_0x301623);try{fs[_0x0639('0x59')](_0x39a7c7,parseInt(_0x0639('0x5a'),0x8));var _0x67a5ce=sox[_0x0639('0x5b')](_0x39a7c7,_0x301623,{'sampleRate':0x1f40,'format':_0x0639('0x55'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x67a5ce['on'](_0x0639('0x5c'),function(_0x1eade7){fs[_0x0639('0x5d')](_0x39a7c7);_0x367e8f[_0x0639('0x19')](0x1f4)[_0x0639('0x27')](_0x1eade7);});_0x67a5ce['on'](_0x0639('0x5e'),function(_0x41f67e){_0x4de965[_0x0639('0x5f')]=isNaN(_0x41f67e[_0x0639('0x60')])?null:_0x41f67e[_0x0639('0x60')]*0x3e8;_0x4de965[_0x0639('0x61')]=isNaN(_0x41f67e[_0x0639('0x62')])?null:_0x41f67e[_0x0639('0x62')];_0x4de965[_0x0639('0x63')]=isNaN(_0x41f67e[_0x0639('0x64')])?null:_0x41f67e[_0x0639('0x64')];_0x4de965[_0x0639('0x65')]=isNaN(_0x41f67e[_0x0639('0x66')])?null:_0x41f67e[_0x0639('0x66')];_0x4de965[_0x0639('0x67')]=isNaN(_0x41f67e[_0x0639('0x68')])?null:_0x41f67e[_0x0639('0x68')];});_0x67a5ce['on'](_0x0639('0x69'),function(_0x1522eb){_0x4de965[_0x0639('0x6a')]=isNaN(_0x1522eb[_0x0639('0x60')])?null:_0x1522eb['duration']*0x3e8;_0x4de965[_0x0639('0x6b')]=isNaN(_0x1522eb[_0x0639('0x62')])?null:_0x1522eb[_0x0639('0x62')];_0x4de965[_0x0639('0x6c')]=isNaN(_0x1522eb[_0x0639('0x64')])?null:_0x1522eb[_0x0639('0x64')];_0x4de965[_0x0639('0x6d')]=isNaN(_0x1522eb[_0x0639('0x66')])?null:_0x1522eb[_0x0639('0x66')];_0x4de965[_0x0639('0x6e')]=isNaN(_0x1522eb[_0x0639('0x68')])?null:_0x1522eb[_0x0639('0x68')];});_0x67a5ce['on']('end',function(){fs[_0x0639('0x59')](_0x301623,parseInt(_0x0639('0x5a'),0x8));return db['Sound'][_0x0639('0x4f')](_0x4de965)[_0x0639('0x23')](function(_0x4230e5){var _0x5dbea1={'role':_0x4c54b4[_0x0639('0x6f')][_0x0639('0x70')],'userProfileId':_0x4c54b4[_0x0639('0x6f')][_0x0639('0x71')]};if(!_0x5dbea1)throw new Error(_0x0639('0x72'));if(_0x5dbea1[_0x0639('0x70')]==='user'){var _0x2c2b7b=_0x4230e5[_0x0639('0x73')]({'plain':!![]});return db['UserProfileSection'][_0x0639('0x43')]({'where':{'name':_0x0639('0x24'),'userProfileId':_0x5dbea1[_0x0639('0x71')]},'raw':!![]})[_0x0639('0x23')](function(_0x4741be){if(_0x4741be&&_0x4741be[_0x0639('0x74')]===0x0){return db[_0x0639('0x75')][_0x0639('0x4f')]({'name':_0x2c2b7b[_0x0639('0x26')],'resourceId':_0x2c2b7b['id'],'type':_0x4741be[_0x0639('0x26')],'sectionId':_0x4741be['id']},{})['then'](function(){return _0x4230e5;});}else{return _0x4230e5;}})[_0x0639('0x41')](function(_0x29544f){logger['error'](_0x0639('0x76'),_0x29544f);throw _0x29544f;});}return _0x4230e5;})[_0x0639('0x23')](respondWithResult(_0x367e8f,null))['catch'](handleError(_0x367e8f,null));});_0x67a5ce['start']();}catch(_0x47f529){_0x367e8f['status'](0x1f4)[_0x0639('0x27')](_0x47f529);}};exports[_0x0639('0x77')]=function(_0x2dc981,_0x3c33d4,_0x18a170){return db[_0x0639('0x29')][_0x0639('0x43')]({'where':{'id':_0x2dc981[_0x0639('0x44')]['id']}})[_0x0639('0x23')](handleEntityNotFound(_0x3c33d4,null))[_0x0639('0x23')](saveUpdates(_[_0x0639('0x78')](_0x2dc981[_0x0639('0x6f')],[_0x0639('0x26'),'description']),null))[_0x0639('0x23')](respondWithResult(_0x3c33d4,null))[_0x0639('0x41')](handleError(_0x3c33d4,null));};exports[_0x0639('0x79')]=function(_0x5e1046,_0x4c303c,_0x1ce20c){return db[_0x0639('0x29')][_0x0639('0x43')]({'where':{'id':_0x5e1046[_0x0639('0x44')]['id']}})[_0x0639('0x23')](function(_0x2b2749){if(_0x2b2749){return _0x2b2749[_0x0639('0x25')]();}})['then'](function(_0x34e43c){var _0x232327=path[_0x0639('0x47')](config['root'],_0x0639('0x7a'),util['format']('%s.%s',_0x34e43c[_0x0639('0x45')],_0x34e43c[_0x0639('0x7b')]));var _0x4c6bb4=path[_0x0639('0x47')](config['root'],_0x0639('0x48'),util[_0x0639('0x4d')](_0x0639('0x4e'),_0x34e43c[_0x0639('0x45')],_0x34e43c[_0x0639('0x46')]));fs[_0x0639('0x5d')](_0x232327);fs[_0x0639('0x5d')](_0x4c6bb4);return _0x34e43c;})['then'](function(_0x1a3d08){if(_0x1a3d08){return _0x4c303c[_0x0639('0x19')](0xcc)['end']();}})[_0x0639('0x23')](handleEntityNotFound(_0x4c303c,null))[_0x0639('0x41')](handleError(_0x4c303c,null));}; \ No newline at end of file +var _0x07ee=['format','%s.%s','file','originalname','extname','basename','filename','substring','wav','root','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','0777','transcode','unlinkSync','send','src','original_duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','duration','converted_channelCount','converted_bitRate','converted_sampleRate','chmodSync','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','Sounds','autoAssociation','start','description','server/files/sounds/original','original_format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','Content-Range','reject','update','then','destroy','get','UserProfileResource','sendStatus','error','stack','name','index','Sound','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','options','include','findAll','rows','catch','show','params','fields','download','find','save_name','existsSync','server/files/sounds/converted','converted_format','Sequelize','ValidationError','Sound\x20not\x20found','join'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x07ee,0x1b1));var _0xe07e=function(_0x5d80de,_0x2cf15d){_0x5d80de=_0x5d80de-0x0;var _0x1c7556=_0x07ee[_0x5d80de];return _0x1c7556;};'use strict';var emlformat=require(_0xe07e('0x0'));var rimraf=require(_0xe07e('0x1'));var zipdir=require(_0xe07e('0x2'));var jsonpatch=require(_0xe07e('0x3'));var rp=require(_0xe07e('0x4'));var moment=require('moment');var BPromise=require(_0xe07e('0x5'));var Mustache=require(_0xe07e('0x6'));var util=require('util');var path=require(_0xe07e('0x7'));var sox=require(_0xe07e('0x8'));var csv=require(_0xe07e('0x9'));var ejs=require(_0xe07e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe07e('0xb'));var squel=require(_0xe07e('0xc'));var crypto=require(_0xe07e('0xd'));var jsforce=require(_0xe07e('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xe07e('0x9'));var querystring=require(_0xe07e('0xf'));var Papa=require(_0xe07e('0x10'));var Redis=require(_0xe07e('0x11'));var authService=require(_0xe07e('0x12'));var qs=require(_0xe07e('0x13'));var as=require(_0xe07e('0x14'));var hardwareService=require(_0xe07e('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xe07e('0x16'));var config=require(_0xe07e('0x17'));var licenseUtil=require(_0xe07e('0x18'));var db=require(_0xe07e('0x19'))['db'];function respondWithStatusCode(_0x4bf10b,_0x199402){_0x199402=_0x199402||0xcc;return function(_0x242414){if(_0x242414){return _0x4bf10b['sendStatus'](_0x199402);}return _0x4bf10b[_0xe07e('0x1a')](_0x199402)[_0xe07e('0x1b')]();};}function respondWithResult(_0x2ba8be,_0x4fef36){_0x4fef36=_0x4fef36||0xc8;return function(_0x5d4a95){if(_0x5d4a95){return _0x2ba8be[_0xe07e('0x1a')](_0x4fef36)[_0xe07e('0x1c')](_0x5d4a95);}};}function respondWithFilteredResult(_0x35aef5,_0x353393){return function(_0x495c65){if(_0x495c65){var _0x186678=typeof _0x353393[_0xe07e('0x1d')]===_0xe07e('0x1e')&&typeof _0x353393['limit']===_0xe07e('0x1e');var _0x29b3a0=_0x495c65[_0xe07e('0x1f')];var _0x585851=_0x186678?0x0:_0x353393['offset'];var _0x3cd515=_0x186678?_0x495c65[_0xe07e('0x1f')]:_0x353393[_0xe07e('0x1d')]+_0x353393[_0xe07e('0x20')];var _0x251585;if(_0x3cd515>=_0x29b3a0){_0x3cd515=_0x29b3a0;_0x251585=0xc8;}else{_0x251585=0xce;}_0x35aef5['status'](_0x251585);return _0x35aef5['set'](_0xe07e('0x21'),_0x585851+'-'+_0x3cd515+'/'+_0x29b3a0)[_0xe07e('0x1c')](_0x495c65);}return null;};}function patchUpdates(_0x2cfc59){return function(_0x40ace5){try{jsonpatch['apply'](_0x40ace5,_0x2cfc59,!![]);}catch(_0x3c3dcf){return BPromise[_0xe07e('0x22')](_0x3c3dcf);}return _0x40ace5['save']();};}function saveUpdates(_0x218f15,_0x30ff48){return function(_0x23e042){if(_0x23e042){return _0x23e042[_0xe07e('0x23')](_0x218f15)[_0xe07e('0x24')](function(_0x380d7d){return _0x380d7d;});}return null;};}function removeEntity(_0x38f6a8,_0x15a4aa){return function(_0xd90d6){if(_0xd90d6){return _0xd90d6[_0xe07e('0x25')]()[_0xe07e('0x24')](function(){var _0x286570=_0xd90d6[_0xe07e('0x26')]({'plain':!![]});var _0x2ad858='Sounds';return db[_0xe07e('0x27')][_0xe07e('0x25')]({'where':{'type':_0x2ad858,'resourceId':_0x286570['id']}})[_0xe07e('0x24')](function(){return _0xd90d6;});})[_0xe07e('0x24')](function(){_0x38f6a8['status'](0xcc)[_0xe07e('0x1b')]();});}};}function handleEntityNotFound(_0x4c3770,_0x361344){return function(_0x4f65b6){if(!_0x4f65b6){_0x4c3770[_0xe07e('0x28')](0x194);}return _0x4f65b6;};}function handleError(_0x3ed70a,_0x47499c){_0x47499c=_0x47499c||0x1f4;return function(_0x594c53){logger[_0xe07e('0x29')](_0x594c53[_0xe07e('0x2a')]);if(_0x594c53[_0xe07e('0x2b')]){delete _0x594c53['name'];}_0x3ed70a['status'](_0x47499c)['send'](_0x594c53);};}exports[_0xe07e('0x2c')]=function(_0x432f3c,_0x3417b2){var _0x8f1ccc={},_0x405fcd={},_0x3798e5={'count':0x0,'rows':[]};var _0xddfc43=_['map'](db[_0xe07e('0x2d')][_0xe07e('0x2e')],function(_0x56fe02){return{'name':_0x56fe02['fieldName'],'type':_0x56fe02[_0xe07e('0x2f')][_0xe07e('0x30')]};});_0x405fcd['model']=_['map'](_0xddfc43,_0xe07e('0x2b'));_0x405fcd[_0xe07e('0x31')]=_[_0xe07e('0x32')](_0x432f3c[_0xe07e('0x31')]);_0x405fcd[_0xe07e('0x33')]=_[_0xe07e('0x34')](_0x405fcd[_0xe07e('0x35')],_0x405fcd[_0xe07e('0x31')]);_0x8f1ccc[_0xe07e('0x36')]=_[_0xe07e('0x34')](_0x405fcd[_0xe07e('0x35')],qs['fields'](_0x432f3c[_0xe07e('0x31')]['fields']));_0x8f1ccc[_0xe07e('0x36')]=_0x8f1ccc['attributes'][_0xe07e('0x37')]?_0x8f1ccc[_0xe07e('0x36')]:_0x405fcd[_0xe07e('0x35')];if(!_0x432f3c['query'][_0xe07e('0x38')](_0xe07e('0x39'))){_0x8f1ccc['limit']=qs[_0xe07e('0x20')](_0x432f3c['query'][_0xe07e('0x20')]);_0x8f1ccc['offset']=qs['offset'](_0x432f3c['query']['offset']);}_0x8f1ccc['order']=qs[_0xe07e('0x3a')](_0x432f3c[_0xe07e('0x31')]['sort']);_0x8f1ccc[_0xe07e('0x3b')]=qs[_0xe07e('0x33')](_[_0xe07e('0x3c')](_0x432f3c[_0xe07e('0x31')],_0x405fcd[_0xe07e('0x33')]),_0xddfc43);if(_0x432f3c[_0xe07e('0x31')][_0xe07e('0x3d')]){_0x8f1ccc[_0xe07e('0x3b')]=_[_0xe07e('0x3e')](_0x8f1ccc[_0xe07e('0x3b')],{'$or':_[_0xe07e('0x3f')](_0xddfc43,function(_0x2087f9){if(_0x2087f9[_0xe07e('0x2f')]!==_0xe07e('0x40')){var _0x3aee96={};_0x3aee96[_0x2087f9[_0xe07e('0x2b')]]={'$like':'%'+_0x432f3c[_0xe07e('0x31')][_0xe07e('0x3d')]+'%'};return _0x3aee96;}})});}_0x8f1ccc=_[_0xe07e('0x3e')]({},_0x8f1ccc,_0x432f3c[_0xe07e('0x41')]);var _0x1022b6={'where':_0x8f1ccc[_0xe07e('0x3b')]};return db[_0xe07e('0x2d')]['count'](_0x1022b6)[_0xe07e('0x24')](function(_0x22f7db){_0x3798e5[_0xe07e('0x1f')]=_0x22f7db;if(_0x432f3c[_0xe07e('0x31')]['includeAll']){_0x8f1ccc[_0xe07e('0x42')]=[{'all':!![]}];}return db[_0xe07e('0x2d')][_0xe07e('0x43')](_0x8f1ccc);})[_0xe07e('0x24')](function(_0x29bec8){_0x3798e5[_0xe07e('0x44')]=_0x29bec8;return _0x3798e5;})[_0xe07e('0x24')](respondWithFilteredResult(_0x3417b2,_0x8f1ccc))[_0xe07e('0x45')](handleError(_0x3417b2,null));};exports[_0xe07e('0x46')]=function(_0x403679,_0x575e37){var _0x4514ce={'raw':!![],'where':{'id':_0x403679[_0xe07e('0x47')]['id']}},_0x1d20b1={};_0x1d20b1[_0xe07e('0x35')]=_[_0xe07e('0x32')](db['Sound'][_0xe07e('0x2e')]);_0x1d20b1['query']=_[_0xe07e('0x32')](_0x403679[_0xe07e('0x31')]);_0x1d20b1[_0xe07e('0x33')]=_[_0xe07e('0x34')](_0x1d20b1[_0xe07e('0x35')],_0x1d20b1['query']);_0x4514ce['attributes']=_[_0xe07e('0x34')](_0x1d20b1[_0xe07e('0x35')],qs[_0xe07e('0x48')](_0x403679[_0xe07e('0x31')][_0xe07e('0x48')]));_0x4514ce[_0xe07e('0x36')]=_0x4514ce[_0xe07e('0x36')]['length']?_0x4514ce[_0xe07e('0x36')]:_0x1d20b1[_0xe07e('0x35')];if(_0x403679[_0xe07e('0x31')]['includeAll']){_0x4514ce[_0xe07e('0x42')]=[{'all':!![]}];}_0x4514ce=_['merge']({},_0x4514ce,_0x403679[_0xe07e('0x41')]);return db[_0xe07e('0x2d')]['find'](_0x4514ce)[_0xe07e('0x24')](handleEntityNotFound(_0x575e37,null))['then'](respondWithResult(_0x575e37,null))[_0xe07e('0x45')](handleError(_0x575e37,null));};exports[_0xe07e('0x49')]=function(_0x4158e8,_0x1b06cf,_0x7ede03){return db[_0xe07e('0x2d')][_0xe07e('0x4a')]({'where':{'id':_0x4158e8[_0xe07e('0x47')]['id']},'attributes':[_0xe07e('0x2b'),_0xe07e('0x4b'),'converted_format'],'raw':!![]})[_0xe07e('0x24')](handleEntityNotFound(_0x1b06cf,null))[_0xe07e('0x24')](function(_0x4467da){if(_0x4467da){if(!fs[_0xe07e('0x4c')](path['join'](config['root'],_0xe07e('0x4d'),_0x4467da['save_name']+'.'+_0x4467da[_0xe07e('0x4e')]))){throw new db[(_0xe07e('0x4f'))][(_0xe07e('0x50'))](_0xe07e('0x51'));}return _0x1b06cf[_0xe07e('0x49')](path[_0xe07e('0x52')](config['root'],_0xe07e('0x4d'),util[_0xe07e('0x53')]('%s.%s',_0x4467da[_0xe07e('0x4b')],_0x4467da[_0xe07e('0x4e')])),util[_0xe07e('0x53')](_0xe07e('0x54'),_0x4467da['name'],_0x4467da[_0xe07e('0x4e')]));}return null;})[_0xe07e('0x45')](handleError(_0x1b06cf,null));};exports['create']=function(_0x4a1f23,_0x4c5de6,_0x2473a4){var _0x467f17={'name':path['basename'](_0x4a1f23[_0xe07e('0x55')][_0xe07e('0x56')],path[_0xe07e('0x57')](_0x4a1f23[_0xe07e('0x55')][_0xe07e('0x56')])),'save_name':path[_0xe07e('0x58')](_0x4a1f23[_0xe07e('0x55')]['filename'],path[_0xe07e('0x57')](_0x4a1f23[_0xe07e('0x55')][_0xe07e('0x59')])),'original_format':path[_0xe07e('0x57')](_0x4a1f23['file'][_0xe07e('0x56')])[_0xe07e('0x5a')](0x1),'converted_format':_0xe07e('0x5b')};var _0x2d558a=path[_0xe07e('0x52')](config[_0xe07e('0x5c')],'server/files/sounds/original',_0x4a1f23[_0xe07e('0x55')]['filename']);var _0x2708e6=path[_0xe07e('0x52')](config[_0xe07e('0x5c')],_0xe07e('0x4d'),util[_0xe07e('0x53')](_0xe07e('0x54'),path[_0xe07e('0x58')](_0x4a1f23[_0xe07e('0x55')][_0xe07e('0x59')],path[_0xe07e('0x57')](_0x4a1f23[_0xe07e('0x55')][_0xe07e('0x59')])),_0x467f17['converted_format']));logger[_0xe07e('0x5d')](_0xe07e('0x5e'),_0x2d558a);logger[_0xe07e('0x5d')](_0xe07e('0x5f'),_0x2708e6);try{fs['chmodSync'](_0x2d558a,parseInt(_0xe07e('0x60'),0x8));var _0x37dcc8=sox[_0xe07e('0x61')](_0x2d558a,_0x2708e6,{'sampleRate':0x1f40,'format':_0xe07e('0x5b'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x37dcc8['on'](_0xe07e('0x29'),function(_0x15c4e2){fs[_0xe07e('0x62')](_0x2d558a);_0x4c5de6[_0xe07e('0x1a')](0x1f4)[_0xe07e('0x63')](_0x15c4e2);});_0x37dcc8['on'](_0xe07e('0x64'),function(_0xa14d56){_0x467f17[_0xe07e('0x65')]=isNaN(_0xa14d56['duration'])?null:_0xa14d56['duration']*0x3e8;_0x467f17[_0xe07e('0x66')]=isNaN(_0xa14d56[_0xe07e('0x67')])?null:_0xa14d56[_0xe07e('0x67')];_0x467f17[_0xe07e('0x68')]=isNaN(_0xa14d56[_0xe07e('0x69')])?null:_0xa14d56['channelCount'];_0x467f17[_0xe07e('0x6a')]=isNaN(_0xa14d56[_0xe07e('0x6b')])?null:_0xa14d56[_0xe07e('0x6b')];_0x467f17[_0xe07e('0x6c')]=isNaN(_0xa14d56['sampleRate'])?null:_0xa14d56[_0xe07e('0x6d')];});_0x37dcc8['on'](_0xe07e('0x6e'),function(_0x5ef35b){_0x467f17[_0xe07e('0x6f')]=isNaN(_0x5ef35b[_0xe07e('0x70')])?null:_0x5ef35b[_0xe07e('0x70')]*0x3e8;_0x467f17['converted_sampleCount']=isNaN(_0x5ef35b[_0xe07e('0x67')])?null:_0x5ef35b['sampleCount'];_0x467f17[_0xe07e('0x71')]=isNaN(_0x5ef35b['channelCount'])?null:_0x5ef35b[_0xe07e('0x69')];_0x467f17[_0xe07e('0x72')]=isNaN(_0x5ef35b['bitRate'])?null:_0x5ef35b[_0xe07e('0x6b')];_0x467f17[_0xe07e('0x73')]=isNaN(_0x5ef35b[_0xe07e('0x6d')])?null:_0x5ef35b[_0xe07e('0x6d')];});_0x37dcc8['on']('end',function(){fs[_0xe07e('0x74')](_0x2708e6,parseInt(_0xe07e('0x60'),0x8));return db[_0xe07e('0x2d')][_0xe07e('0x75')](_0x467f17)['then'](function(_0x2957df){var _0x3d5b6b={'role':_0x4a1f23[_0xe07e('0x76')]['role'],'userProfileId':_0x4a1f23[_0xe07e('0x76')]['userProfileId']};if(!_0x3d5b6b)throw new Error(_0xe07e('0x77'));if(_0x3d5b6b[_0xe07e('0x78')]===_0xe07e('0x79')){var _0x2d8b29=_0x2957df[_0xe07e('0x26')]({'plain':!![]});return db[_0xe07e('0x7a')][_0xe07e('0x4a')]({'where':{'name':_0xe07e('0x7b'),'userProfileId':_0x3d5b6b['userProfileId']},'raw':!![]})[_0xe07e('0x24')](function(_0x315137){if(_0x315137&&_0x315137[_0xe07e('0x7c')]===0x0){return db[_0xe07e('0x27')][_0xe07e('0x75')]({'name':_0x2d8b29[_0xe07e('0x2b')],'resourceId':_0x2d8b29['id'],'type':_0x315137[_0xe07e('0x2b')],'sectionId':_0x315137['id']},{})[_0xe07e('0x24')](function(){return _0x2957df;});}else{return _0x2957df;}})[_0xe07e('0x45')](function(_0x1bcf20){logger[_0xe07e('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1bcf20);throw _0x1bcf20;});}return _0x2957df;})[_0xe07e('0x24')](respondWithResult(_0x4c5de6,null))[_0xe07e('0x45')](handleError(_0x4c5de6,null));});_0x37dcc8[_0xe07e('0x7d')]();}catch(_0x1a87e8){_0x4c5de6['status'](0x1f4)[_0xe07e('0x63')](_0x1a87e8);}};exports[_0xe07e('0x23')]=function(_0x974da8,_0x27499b,_0x2a6a56){return db['Sound']['find']({'where':{'id':_0x974da8['params']['id']}})[_0xe07e('0x24')](handleEntityNotFound(_0x27499b,null))[_0xe07e('0x24')](saveUpdates(_['pick'](_0x974da8['body'],[_0xe07e('0x2b'),_0xe07e('0x7e')]),null))[_0xe07e('0x24')](respondWithResult(_0x27499b,null))[_0xe07e('0x45')](handleError(_0x27499b,null));};exports['delete']=function(_0x28816c,_0x3284a8,_0x567137){return db[_0xe07e('0x2d')]['find']({'where':{'id':_0x28816c[_0xe07e('0x47')]['id']}})['then'](function(_0x26caf1){if(_0x26caf1){return _0x26caf1[_0xe07e('0x25')]();}})['then'](function(_0x56644a){var _0x3057f6=path[_0xe07e('0x52')](config[_0xe07e('0x5c')],_0xe07e('0x7f'),util[_0xe07e('0x53')](_0xe07e('0x54'),_0x56644a['save_name'],_0x56644a[_0xe07e('0x80')]));var _0x5b279f=path[_0xe07e('0x52')](config[_0xe07e('0x5c')],'server/files/sounds/converted',util[_0xe07e('0x53')](_0xe07e('0x54'),_0x56644a[_0xe07e('0x4b')],_0x56644a['converted_format']));fs[_0xe07e('0x62')](_0x3057f6);fs[_0xe07e('0x62')](_0x5b279f);return _0x56644a;})['then'](function(_0x2fbdcc){if(_0x2fbdcc){return _0x3284a8[_0xe07e('0x1a')](0xcc)[_0xe07e('0x1b')]();}})['then'](handleEntityNotFound(_0x3284a8,null))[_0xe07e('0x45')](handleError(_0x3284a8,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index c013543..427f538 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 _0x415a=['bluebird','request-promise','path','rimraf','../../config/environment','./sound.attributes','define','Sound','tools_sounds','lodash','util','../../config/logger','api','moment'];(function(_0xfe1e45,_0x5d1e81){var _0x57a0f2=function(_0x581c89){while(--_0x581c89){_0xfe1e45['push'](_0xfe1e45['shift']());}};_0x57a0f2(++_0x5d1e81);}(_0x415a,0x19f));var _0xa415=function(_0x774a73,_0x2891fe){_0x774a73=_0x774a73-0x0;var _0x2b4bb1=_0x415a[_0x774a73];return _0x2b4bb1;};'use strict';var _=require(_0xa415('0x0'));var util=require(_0xa415('0x1'));var logger=require(_0xa415('0x2'))(_0xa415('0x3'));var moment=require(_0xa415('0x4'));var BPromise=require(_0xa415('0x5'));var rp=require(_0xa415('0x6'));var fs=require('fs');var path=require(_0xa415('0x7'));var rimraf=require(_0xa415('0x8'));var config=require(_0xa415('0x9'));var attributes=require(_0xa415('0xa'));module['exports']=function(_0x384922,_0x4e0933){return _0x384922[_0xa415('0xb')](_0xa415('0xc'),attributes,{'tableName':_0xa415('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6319=['util','../../config/logger','api','moment','request-promise','path','rimraf','./sound.attributes','exports','define','Sound','tools_sounds','lodash'];(function(_0x1aae57,_0x8735c8){var _0x1b6293=function(_0xb90c69){while(--_0xb90c69){_0x1aae57['push'](_0x1aae57['shift']());}};_0x1b6293(++_0x8735c8);}(_0x6319,0x12a));var _0x9631=function(_0x62584a,_0x1655f7){_0x62584a=_0x62584a-0x0;var _0xc932c8=_0x6319[_0x62584a];return _0xc932c8;};'use strict';var _=require(_0x9631('0x0'));var util=require(_0x9631('0x1'));var logger=require(_0x9631('0x2'))(_0x9631('0x3'));var moment=require(_0x9631('0x4'));var BPromise=require('bluebird');var rp=require(_0x9631('0x5'));var fs=require('fs');var path=require(_0x9631('0x6'));var rimraf=require(_0x9631('0x7'));var config=require('../../config/environment');var attributes=require(_0x9631('0x8'));module[_0x9631('0x9')]=function(_0x36e9c7,_0x38691f){return _0x36e9c7[_0x9631('0xa')](_0x9631('0xb'),attributes,{'tableName':_0x9631('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/sound/sound.rpc.js b/server/api/sound/sound.rpc.js index 5043953..0f12f55 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 _0xd1cd=['include','map','model','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','then','Sound,\x20%s,\x20%s','request\x20sent','debug','code','error','message','info','result','catch','ShowSound','Sound','find','options','where','attributes'];(function(_0x39b171,_0x2db684){var _0x1fd234=function(_0x3cfb03){while(--_0x3cfb03){_0x39b171['push'](_0x39b171['shift']());}};_0x1fd234(++_0x2db684);}(_0xd1cd,0xbe));var _0xdd1c=function(_0x5546a4,_0x251c3b){_0x5546a4=_0x5546a4-0x0;var _0x572076=_0xd1cd[_0x5546a4];return _0x572076;};'use strict';var _=require(_0xdd1c('0x0'));var util=require(_0xdd1c('0x1'));var moment=require(_0xdd1c('0x2'));var BPromise=require('bluebird');var rs=require(_0xdd1c('0x3'));var fs=require('fs');var Redis=require(_0xdd1c('0x4'));var db=require(_0xdd1c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xdd1c('0x6'))('rpc');var config=require(_0xdd1c('0x7'));var jayson=require(_0xdd1c('0x8'));var client=jayson[_0xdd1c('0x9')][_0xdd1c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59ae25,_0x11c861,_0x144dc7){return new BPromise(function(_0x4bad4e,_0x5bdf7f){return client['request'](_0x59ae25,_0x144dc7)[_0xdd1c('0xb')](function(_0x506439){logger['info'](_0xdd1c('0xc'),_0x11c861,_0xdd1c('0xd'));logger[_0xdd1c('0xe')]('Sound,\x20%s,\x20%s,\x20%s',_0x11c861,_0xdd1c('0xd'),JSON['stringify'](_0x506439));if(_0x506439['error']){if(_0x506439['error'][_0xdd1c('0xf')]===0x1f4){logger[_0xdd1c('0x10')](_0xdd1c('0xc'),_0x11c861,_0x506439['error']['message']);return _0x5bdf7f(_0x506439[_0xdd1c('0x10')][_0xdd1c('0x11')]);}logger['error'](_0xdd1c('0xc'),_0x11c861,_0x506439[_0xdd1c('0x10')][_0xdd1c('0x11')]);return _0x4bad4e(_0x506439[_0xdd1c('0x10')]['message']);}else{logger[_0xdd1c('0x12')]('Sound,\x20%s,\x20%s',_0x11c861,_0xdd1c('0xd'));_0x4bad4e(_0x506439[_0xdd1c('0x13')][_0xdd1c('0x11')]);}})[_0xdd1c('0x14')](function(_0x33f15b){logger['error'](_0xdd1c('0xc'),_0x11c861,_0x33f15b);_0x5bdf7f(_0x33f15b);});});}exports[_0xdd1c('0x15')]=function(_0xf825c7){var _0x2d2bfc=this;return new Promise(function(_0x303bb0,_0x136130){return db[_0xdd1c('0x16')][_0xdd1c('0x17')]({'raw':_0xf825c7['options']?_0xf825c7[_0xdd1c('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0xf825c7[_0xdd1c('0x18')]?_0xf825c7[_0xdd1c('0x18')][_0xdd1c('0x19')]||null:null,'attributes':_0xf825c7[_0xdd1c('0x18')]?_0xf825c7[_0xdd1c('0x18')][_0xdd1c('0x1a')]||null:null,'include':_0xf825c7[_0xdd1c('0x18')]?_0xf825c7['options'][_0xdd1c('0x1b')]?_[_0xdd1c('0x1c')](_0xf825c7[_0xdd1c('0x18')][_0xdd1c('0x1b')],function(_0x25b65e){return{'model':db[_0x25b65e[_0xdd1c('0x1d')]],'as':_0x25b65e['as'],'attributes':_0x25b65e[_0xdd1c('0x1a')],'include':_0x25b65e[_0xdd1c('0x1b')]?_[_0xdd1c('0x1c')](_0x25b65e[_0xdd1c('0x1b')],function(_0x442884){return{'model':db[_0x442884[_0xdd1c('0x1d')]],'as':_0x442884['as'],'attributes':_0x442884[_0xdd1c('0x1a')],'include':_0x442884[_0xdd1c('0x1b')]?_[_0xdd1c('0x1c')](_0x442884[_0xdd1c('0x1b')],function(_0x400fe6){return{'model':db[_0x400fe6[_0xdd1c('0x1d')]],'as':_0x400fe6['as'],'attributes':_0x400fe6['attributes']};}):[]};}):[]};}):[]:[]})[_0xdd1c('0xb')](function(_0x32cb51){logger['info'](_0xdd1c('0x15'),_0xf825c7);logger['debug']('ShowSound',_0xf825c7,JSON[_0xdd1c('0x1e')](_0x32cb51));_0x303bb0(_0x32cb51);})['catch'](function(_0x700864){logger['error'](_0xdd1c('0x15'),_0x700864[_0xdd1c('0x11')],_0xf825c7);_0x136130(_0x2d2bfc['error'](0x1f4,_0x700864[_0xdd1c('0x11')]));});});}; \ No newline at end of file +var _0xdfc2=['map','include','model','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Sound,\x20%s,\x20%s','request\x20sent','debug','message','error','catch','ShowSound','find','options','attributes'];(function(_0x44ad1a,_0x2d0d8f){var _0x112cb5=function(_0xaeaba5){while(--_0xaeaba5){_0x44ad1a['push'](_0x44ad1a['shift']());}};_0x112cb5(++_0x2d0d8f);}(_0xdfc2,0xec));var _0x2dfc=function(_0x2f940d,_0x397991){_0x2f940d=_0x2f940d-0x0;var _0x2c32df=_0xdfc2[_0x2f940d];return _0x2c32df;};'use strict';var _=require(_0x2dfc('0x0'));var util=require(_0x2dfc('0x1'));var moment=require(_0x2dfc('0x2'));var BPromise=require(_0x2dfc('0x3'));var rs=require(_0x2dfc('0x4'));var fs=require('fs');var Redis=require(_0x2dfc('0x5'));var db=require(_0x2dfc('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x2dfc('0x7'))(_0x2dfc('0x8'));var config=require(_0x2dfc('0x9'));var jayson=require(_0x2dfc('0xa'));var client=jayson[_0x2dfc('0xb')][_0x2dfc('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1e209f,_0x31945d,_0x624a11){return new BPromise(function(_0x2ea0ff,_0x13d19f){return client[_0x2dfc('0xd')](_0x1e209f,_0x624a11)['then'](function(_0x3af64c){logger[_0x2dfc('0xe')](_0x2dfc('0xf'),_0x31945d,_0x2dfc('0x10'));logger[_0x2dfc('0x11')]('Sound,\x20%s,\x20%s,\x20%s',_0x31945d,_0x2dfc('0x10'),JSON['stringify'](_0x3af64c));if(_0x3af64c['error']){if(_0x3af64c['error']['code']===0x1f4){logger['error'](_0x2dfc('0xf'),_0x31945d,_0x3af64c['error'][_0x2dfc('0x12')]);return _0x13d19f(_0x3af64c['error'][_0x2dfc('0x12')]);}logger[_0x2dfc('0x13')](_0x2dfc('0xf'),_0x31945d,_0x3af64c[_0x2dfc('0x13')][_0x2dfc('0x12')]);return _0x2ea0ff(_0x3af64c['error'][_0x2dfc('0x12')]);}else{logger[_0x2dfc('0xe')]('Sound,\x20%s,\x20%s',_0x31945d,_0x2dfc('0x10'));_0x2ea0ff(_0x3af64c['result']['message']);}})[_0x2dfc('0x14')](function(_0x17a3c2){logger[_0x2dfc('0x13')]('Sound,\x20%s,\x20%s',_0x31945d,_0x17a3c2);_0x13d19f(_0x17a3c2);});});}exports[_0x2dfc('0x15')]=function(_0x13a023){var _0x46857d=this;return new Promise(function(_0x52a314,_0x2ffc48){return db['Sound'][_0x2dfc('0x16')]({'raw':_0x13a023[_0x2dfc('0x17')]?_0x13a023[_0x2dfc('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x13a023[_0x2dfc('0x17')]?_0x13a023[_0x2dfc('0x17')]['where']||null:null,'attributes':_0x13a023[_0x2dfc('0x17')]?_0x13a023[_0x2dfc('0x17')][_0x2dfc('0x18')]||null:null,'include':_0x13a023['options']?_0x13a023['options']['include']?_[_0x2dfc('0x19')](_0x13a023[_0x2dfc('0x17')][_0x2dfc('0x1a')],function(_0x4103a7){return{'model':db[_0x4103a7[_0x2dfc('0x1b')]],'as':_0x4103a7['as'],'attributes':_0x4103a7[_0x2dfc('0x18')],'include':_0x4103a7[_0x2dfc('0x1a')]?_[_0x2dfc('0x19')](_0x4103a7[_0x2dfc('0x1a')],function(_0x1c376d){return{'model':db[_0x1c376d[_0x2dfc('0x1b')]],'as':_0x1c376d['as'],'attributes':_0x1c376d[_0x2dfc('0x18')],'include':_0x1c376d[_0x2dfc('0x1a')]?_[_0x2dfc('0x19')](_0x1c376d['include'],function(_0x5909e4){return{'model':db[_0x5909e4[_0x2dfc('0x1b')]],'as':_0x5909e4['as'],'attributes':_0x5909e4[_0x2dfc('0x18')]};}):[]};}):[]};}):[]:[]})[_0x2dfc('0x1c')](function(_0x22023d){logger[_0x2dfc('0xe')]('ShowSound',_0x13a023);logger[_0x2dfc('0x11')]('ShowSound',_0x13a023,JSON['stringify'](_0x22023d));_0x52a314(_0x22023d);})[_0x2dfc('0x14')](function(_0x447de5){logger['error'](_0x2dfc('0x15'),_0x447de5['message'],_0x13a023);_0x2ffc48(_0x46857d['error'](0x1f4,_0x447de5[_0x2dfc('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 5574523..98027cc 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 _0x2032=['exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete'];(function(_0xd9ad81,_0x511fdf){var _0x4ba037=function(_0x4a65af){while(--_0x4a65af){_0xd9ad81['push'](_0xd9ad81['shift']());}};_0x4ba037(++_0x511fdf);}(_0x2032,0xd9));var _0x2203=function(_0x39b27b,_0x25eaf1){_0x39b27b=_0x39b27b-0x0;var _0xae5ba5=_0x2032[_0x39b27b];return _0xae5ba5;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2203('0xe')]('/:id',auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);router[_0x2203('0x10')]('/:id',auth[_0x2203('0x9')](),controller['destroy']);module[_0x2203('0x11')]=router; \ No newline at end of file +var _0xb7e7=['exports','multer','path','express','fs-extra','../../components/interaction/service','../../config/environment','./squareMessage.controller','index','get','/:id','show','post','isAuthenticated','create','put','delete','destroy'];(function(_0x360be7,_0x2f49fc){var _0x1d2410=function(_0x3cb704){while(--_0x3cb704){_0x360be7['push'](_0x360be7['shift']());}};_0x1d2410(++_0x2f49fc);}(_0xb7e7,0x121));var _0x7b7e=function(_0x1ae5ab,_0xc5d441){_0x1ae5ab=_0x1ae5ab-0x0;var _0x1ce001=_0xb7e7[_0x1ae5ab];return _0x1ce001;};'use strict';var multer=require(_0x7b7e('0x0'));var util=require('util');var path=require(_0x7b7e('0x1'));var timeout=require('connect-timeout');var express=require(_0x7b7e('0x2'));var router=express['Router']();var fs_extra=require(_0x7b7e('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var controller=require(_0x7b7e('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x7b7e('0x7')]);router[_0x7b7e('0x8')](_0x7b7e('0x9'),auth['isAuthenticated'](),controller[_0x7b7e('0xa')]);router[_0x7b7e('0xb')]('/',auth[_0x7b7e('0xc')](),controller[_0x7b7e('0xd')]);router[_0x7b7e('0xe')](_0x7b7e('0x9'),auth[_0x7b7e('0xc')](),controller['update']);router[_0x7b7e('0xf')](_0x7b7e('0x9'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x10')]);module[_0x7b7e('0x11')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 0fa0c45..89e5045 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 _0x088f=['exports','TEXT','medium','ENUM','STRING'];(function(_0x65410f,_0xb68be6){var _0x16a74c=function(_0x2bdec2){while(--_0x2bdec2){_0x65410f['push'](_0x65410f['shift']());}};_0x16a74c(++_0xb68be6);}(_0x088f,0x69));var _0xf088=function(_0x59d553,_0x31b885){_0x59d553=_0x59d553-0x0;var _0x495cea=_0x088f[_0x59d553];return _0x495cea;};'use strict';var Sequelize=require('sequelize');module[_0xf088('0x0')]={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize[_0xf088('0x1')](_0xf088('0x2')),'allowNull':![]},'direction':{'type':Sequelize[_0xf088('0x3')]('in','out'),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize[_0xf088('0x4')]},'providerResponse':{'type':Sequelize[_0xf088('0x1')]}}; \ No newline at end of file +var _0x0945=['exports','STRING','TEXT','medium','ENUM'];(function(_0x585107,_0x247e52){var _0x8dcb04=function(_0x2b0f64){while(--_0x2b0f64){_0x585107['push'](_0x585107['shift']());}};_0x8dcb04(++_0x247e52);}(_0x0945,0x1db));var _0x5094=function(_0x2678d6,_0x4e2001){_0x2678d6=_0x2678d6-0x0;var _0x475503=_0x0945[_0x2678d6];return _0x475503;};'use strict';var Sequelize=require('sequelize');module[_0x5094('0x0')]={'uniqueid':{'type':Sequelize[_0x5094('0x1')]},'body':{'type':Sequelize[_0x5094('0x2')](_0x5094('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0x5094('0x4')]('in','out'),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize[_0x5094('0x1')]},'providerResponse':{'type':Sequelize[_0x5094('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 7022c6a..18e9cf8 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 _0xd945=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','limit','undefined','count','offset','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','map','SquareMessage','rawAttributes','fieldName','type','key','query','keys','model','attributes','intersection','fields','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','length','find','catch','create','body','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x232ec0,_0x45fdd0){var _0x356705=function(_0x4099ea){while(--_0x4099ea){_0x232ec0['push'](_0x232ec0['shift']());}};_0x356705(++_0x45fdd0);}(_0xd945,0x84));var _0x5d94=function(_0x4d2353,_0x3c8161){_0x4d2353=_0x4d2353-0x0;var _0x1a455b=_0xd945[_0x4d2353];return _0x1a455b;};'use strict';var emlformat=require(_0x5d94('0x0'));var rimraf=require(_0x5d94('0x1'));var zipdir=require(_0x5d94('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5d94('0x3'));var moment=require(_0x5d94('0x4'));var BPromise=require(_0x5d94('0x5'));var Mustache=require(_0x5d94('0x6'));var util=require(_0x5d94('0x7'));var path=require('path');var sox=require(_0x5d94('0x8'));var csv=require(_0x5d94('0x9'));var ejs=require(_0x5d94('0xa'));var fs=require('fs');var fs_extra=require(_0x5d94('0xb'));var _=require(_0x5d94('0xc'));var squel=require('squel');var crypto=require(_0x5d94('0xd'));var jsforce=require(_0x5d94('0xe'));var deskjs=require(_0x5d94('0xf'));var toCsv=require('to-csv');var querystring=require(_0x5d94('0x10'));var Papa=require(_0x5d94('0x11'));var Redis=require(_0x5d94('0x12'));var authService=require(_0x5d94('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x5d94('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5d94('0x15'))(_0x5d94('0x16'));var utils=require(_0x5d94('0x17'));var config=require(_0x5d94('0x18'));var licenseUtil=require(_0x5d94('0x19'));var db=require(_0x5d94('0x1a'))['db'];function respondWithStatusCode(_0x3451fc,_0x42641b){_0x42641b=_0x42641b||0xcc;return function(_0x1aed99){if(_0x1aed99){return _0x3451fc[_0x5d94('0x1b')](_0x42641b);}return _0x3451fc['status'](_0x42641b)[_0x5d94('0x1c')]();};}function respondWithResult(_0x47616b,_0x592b93){_0x592b93=_0x592b93||0xc8;return function(_0x1d8291){if(_0x1d8291){return _0x47616b[_0x5d94('0x1d')](_0x592b93)[_0x5d94('0x1e')](_0x1d8291);}};}function respondWithFilteredResult(_0x10867c,_0x1a0011){return function(_0x452a88){if(_0x452a88){var _0x5c4d65=typeof _0x1a0011['offset']==='undefined'&&typeof _0x1a0011[_0x5d94('0x1f')]===_0x5d94('0x20');var _0x1ef529=_0x452a88[_0x5d94('0x21')];var _0x12c238=_0x5c4d65?0x0:_0x1a0011['offset'];var _0x322380=_0x5c4d65?_0x452a88[_0x5d94('0x21')]:_0x1a0011[_0x5d94('0x22')]+_0x1a0011[_0x5d94('0x1f')];var _0x176f5c;if(_0x322380>=_0x1ef529){_0x322380=_0x1ef529;_0x176f5c=0xc8;}else{_0x176f5c=0xce;}_0x10867c[_0x5d94('0x1d')](_0x176f5c);return _0x10867c[_0x5d94('0x23')](_0x5d94('0x24'),_0x12c238+'-'+_0x322380+'/'+_0x1ef529)[_0x5d94('0x1e')](_0x452a88);}return null;};}function patchUpdates(_0x141783){return function(_0x1e9524){try{jsonpatch[_0x5d94('0x25')](_0x1e9524,_0x141783,!![]);}catch(_0xe21853){return BPromise['reject'](_0xe21853);}return _0x1e9524[_0x5d94('0x26')]();};}function saveUpdates(_0x255e3f,_0x15f9b4){return function(_0x2a643f){if(_0x2a643f){return _0x2a643f[_0x5d94('0x27')](_0x255e3f)[_0x5d94('0x28')](function(_0xd0fbf0){return _0xd0fbf0;});}return null;};}function removeEntity(_0x100832,_0x2f12d9){return function(_0x40c0a6){if(_0x40c0a6){return _0x40c0a6[_0x5d94('0x29')]()[_0x5d94('0x28')](function(){_0x100832[_0x5d94('0x1d')](0xcc)[_0x5d94('0x1c')]();});}};}function handleEntityNotFound(_0x1c1344,_0x478c39){return function(_0x374c3f){if(!_0x374c3f){_0x1c1344[_0x5d94('0x1b')](0x194);}return _0x374c3f;};}function handleError(_0x3c8cc2,_0x390e01){_0x390e01=_0x390e01||0x1f4;return function(_0x3241a7){logger[_0x5d94('0x2a')](_0x3241a7[_0x5d94('0x2b')]);if(_0x3241a7[_0x5d94('0x2c')]){delete _0x3241a7[_0x5d94('0x2c')];}_0x3c8cc2[_0x5d94('0x1d')](_0x390e01)[_0x5d94('0x2d')](_0x3241a7);};}exports['index']=function(_0x5a117f,_0xbf0bc6){var _0x54d4df={},_0x19ef72={},_0x43ef7f={'count':0x0,'rows':[]};var _0x1bdfc5=_[_0x5d94('0x2e')](db[_0x5d94('0x2f')][_0x5d94('0x30')],function(_0x124b59){return{'name':_0x124b59[_0x5d94('0x31')],'type':_0x124b59[_0x5d94('0x32')][_0x5d94('0x33')]};});_0x19ef72['model']=_['map'](_0x1bdfc5,_0x5d94('0x2c'));_0x19ef72[_0x5d94('0x34')]=_[_0x5d94('0x35')](_0x5a117f['query']);_0x19ef72['filters']=_['intersection'](_0x19ef72[_0x5d94('0x36')],_0x19ef72['query']);_0x54d4df[_0x5d94('0x37')]=_[_0x5d94('0x38')](_0x19ef72[_0x5d94('0x36')],qs[_0x5d94('0x39')](_0x5a117f[_0x5d94('0x34')][_0x5d94('0x39')]));_0x54d4df[_0x5d94('0x37')]=_0x54d4df[_0x5d94('0x37')]['length']?_0x54d4df[_0x5d94('0x37')]:_0x19ef72[_0x5d94('0x36')];if(!_0x5a117f[_0x5d94('0x34')][_0x5d94('0x3a')]('nolimit')){_0x54d4df['limit']=qs[_0x5d94('0x1f')](_0x5a117f['query']['limit']);_0x54d4df[_0x5d94('0x22')]=qs[_0x5d94('0x22')](_0x5a117f['query']['offset']);}_0x54d4df[_0x5d94('0x3b')]=qs[_0x5d94('0x3c')](_0x5a117f['query'][_0x5d94('0x3c')]);_0x54d4df[_0x5d94('0x3d')]=qs[_0x5d94('0x3e')](_[_0x5d94('0x3f')](_0x5a117f[_0x5d94('0x34')],_0x19ef72[_0x5d94('0x3e')]),_0x1bdfc5);if(_0x5a117f[_0x5d94('0x34')][_0x5d94('0x40')]){_0x54d4df[_0x5d94('0x3d')]=_[_0x5d94('0x41')](_0x54d4df['where'],{'$or':_[_0x5d94('0x2e')](_0x1bdfc5,function(_0x26614b){if(_0x26614b[_0x5d94('0x32')]!==_0x5d94('0x42')){var _0x4aa034={};_0x4aa034[_0x26614b[_0x5d94('0x2c')]]={'$like':'%'+_0x5a117f[_0x5d94('0x34')]['filter']+'%'};return _0x4aa034;}})});}_0x54d4df=_['merge']({},_0x54d4df,_0x5a117f[_0x5d94('0x43')]);var _0x36747e={'where':_0x54d4df[_0x5d94('0x3d')]};return db[_0x5d94('0x2f')][_0x5d94('0x21')](_0x36747e)['then'](function(_0x3798ce){_0x43ef7f[_0x5d94('0x21')]=_0x3798ce;if(_0x5a117f[_0x5d94('0x34')][_0x5d94('0x44')]){_0x54d4df['include']=[{'all':!![]}];}return db[_0x5d94('0x2f')][_0x5d94('0x45')](_0x54d4df);})[_0x5d94('0x28')](function(_0x4b9b02){_0x43ef7f[_0x5d94('0x46')]=_0x4b9b02;return _0x43ef7f;})['then'](respondWithFilteredResult(_0xbf0bc6,_0x54d4df))['catch'](handleError(_0xbf0bc6,null));};exports['show']=function(_0x21e186,_0x2bfb5d){var _0x11203e={'raw':!![],'where':{'id':_0x21e186['params']['id']}},_0x1822ad={};_0x1822ad[_0x5d94('0x36')]=_[_0x5d94('0x35')](db['SquareMessage']['rawAttributes']);_0x1822ad[_0x5d94('0x34')]=_[_0x5d94('0x35')](_0x21e186['query']);_0x1822ad[_0x5d94('0x3e')]=_['intersection'](_0x1822ad[_0x5d94('0x36')],_0x1822ad['query']);_0x11203e[_0x5d94('0x37')]=_[_0x5d94('0x38')](_0x1822ad[_0x5d94('0x36')],qs[_0x5d94('0x39')](_0x21e186[_0x5d94('0x34')][_0x5d94('0x39')]));_0x11203e['attributes']=_0x11203e[_0x5d94('0x37')][_0x5d94('0x47')]?_0x11203e[_0x5d94('0x37')]:_0x1822ad[_0x5d94('0x36')];if(_0x21e186['query'][_0x5d94('0x44')]){_0x11203e['include']=[{'all':!![]}];}_0x11203e=_['merge']({},_0x11203e,_0x21e186[_0x5d94('0x43')]);return db[_0x5d94('0x2f')][_0x5d94('0x48')](_0x11203e)[_0x5d94('0x28')](handleEntityNotFound(_0x2bfb5d,null))[_0x5d94('0x28')](respondWithResult(_0x2bfb5d,null))[_0x5d94('0x49')](handleError(_0x2bfb5d,null));};exports['create']=function(_0x486e1a,_0x25d315){return db[_0x5d94('0x2f')][_0x5d94('0x4a')](_0x486e1a[_0x5d94('0x4b')],{})[_0x5d94('0x28')](respondWithResult(_0x25d315,0xc9))[_0x5d94('0x49')](handleError(_0x25d315,null));};exports[_0x5d94('0x27')]=function(_0x5ce78c,_0x45a6c9){if(_0x5ce78c[_0x5d94('0x4b')]['id']){delete _0x5ce78c['body']['id'];}return db[_0x5d94('0x2f')][_0x5d94('0x48')]({'where':{'id':_0x5ce78c[_0x5d94('0x4c')]['id']}})[_0x5d94('0x28')](handleEntityNotFound(_0x45a6c9,null))[_0x5d94('0x28')](saveUpdates(_0x5ce78c[_0x5d94('0x4b')],null))[_0x5d94('0x28')](respondWithResult(_0x45a6c9,null))[_0x5d94('0x49')](handleError(_0x45a6c9,null));};exports['destroy']=function(_0x4f851b,_0x1ffcdf){return db[_0x5d94('0x2f')][_0x5d94('0x48')]({'where':{'id':_0x4f851b[_0x5d94('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1ffcdf,null))[_0x5d94('0x28')](removeEntity(_0x1ffcdf,null))[_0x5d94('0x49')](handleError(_0x1ffcdf,null));}; \ No newline at end of file +var _0x6a18=['json','apply','reject','save','then','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','keys','query','intersection','attributes','fields','length','nolimit','order','where','filters','pick','filter','type','merge','options','SquareMessage','include','findAll','rows','catch','params','includeAll','create','body','update','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range'];(function(_0xe69b4c,_0x2e1999){var _0x289d9f=function(_0x271626){while(--_0x271626){_0xe69b4c['push'](_0xe69b4c['shift']());}};_0x289d9f(++_0x2e1999);}(_0x6a18,0x114));var _0x86a1=function(_0x15b45a,_0x601d09){_0x15b45a=_0x15b45a-0x0;var _0x2c1a77=_0x6a18[_0x15b45a];return _0x2c1a77;};'use strict';var emlformat=require(_0x86a1('0x0'));var rimraf=require(_0x86a1('0x1'));var zipdir=require(_0x86a1('0x2'));var jsonpatch=require(_0x86a1('0x3'));var rp=require(_0x86a1('0x4'));var moment=require(_0x86a1('0x5'));var BPromise=require(_0x86a1('0x6'));var Mustache=require(_0x86a1('0x7'));var util=require('util');var path=require('path');var sox=require(_0x86a1('0x8'));var csv=require(_0x86a1('0x9'));var ejs=require(_0x86a1('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x86a1('0xb'));var squel=require(_0x86a1('0xc'));var crypto=require(_0x86a1('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x86a1('0xe'));var toCsv=require(_0x86a1('0x9'));var querystring=require(_0x86a1('0xf'));var Papa=require(_0x86a1('0x10'));var Redis=require(_0x86a1('0x11'));var authService=require(_0x86a1('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x86a1('0x13'));var hardwareService=require(_0x86a1('0x14'));var logger=require(_0x86a1('0x15'))(_0x86a1('0x16'));var utils=require(_0x86a1('0x17'));var config=require(_0x86a1('0x18'));var licenseUtil=require(_0x86a1('0x19'));var db=require(_0x86a1('0x1a'))['db'];function respondWithStatusCode(_0x5de3e9,_0x3dcc21){_0x3dcc21=_0x3dcc21||0xcc;return function(_0x1a23c){if(_0x1a23c){return _0x5de3e9[_0x86a1('0x1b')](_0x3dcc21);}return _0x5de3e9['status'](_0x3dcc21)[_0x86a1('0x1c')]();};}function respondWithResult(_0x32e1ad,_0x1b9467){_0x1b9467=_0x1b9467||0xc8;return function(_0x2b0a2d){if(_0x2b0a2d){return _0x32e1ad[_0x86a1('0x1d')](_0x1b9467)['json'](_0x2b0a2d);}};}function respondWithFilteredResult(_0x4655e2,_0xd3df77){return function(_0x510ab8){if(_0x510ab8){var _0x3d2ef3=typeof _0xd3df77[_0x86a1('0x1e')]===_0x86a1('0x1f')&&typeof _0xd3df77[_0x86a1('0x20')]===_0x86a1('0x1f');var _0x44b912=_0x510ab8[_0x86a1('0x21')];var _0x55633a=_0x3d2ef3?0x0:_0xd3df77['offset'];var _0x4c3470=_0x3d2ef3?_0x510ab8[_0x86a1('0x21')]:_0xd3df77[_0x86a1('0x1e')]+_0xd3df77['limit'];var _0x126a4d;if(_0x4c3470>=_0x44b912){_0x4c3470=_0x44b912;_0x126a4d=0xc8;}else{_0x126a4d=0xce;}_0x4655e2[_0x86a1('0x1d')](_0x126a4d);return _0x4655e2[_0x86a1('0x22')](_0x86a1('0x23'),_0x55633a+'-'+_0x4c3470+'/'+_0x44b912)[_0x86a1('0x24')](_0x510ab8);}return null;};}function patchUpdates(_0x54478a){return function(_0x4c5863){try{jsonpatch[_0x86a1('0x25')](_0x4c5863,_0x54478a,!![]);}catch(_0x23d735){return BPromise[_0x86a1('0x26')](_0x23d735);}return _0x4c5863[_0x86a1('0x27')]();};}function saveUpdates(_0x586098,_0x28704e){return function(_0x23791a){if(_0x23791a){return _0x23791a['update'](_0x586098)[_0x86a1('0x28')](function(_0x20f19e){return _0x20f19e;});}return null;};}function removeEntity(_0x401e87,_0x2dab93){return function(_0x405961){if(_0x405961){return _0x405961['destroy']()[_0x86a1('0x28')](function(){_0x401e87[_0x86a1('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x527d6f,_0x269889){return function(_0x38c4cb){if(!_0x38c4cb){_0x527d6f['sendStatus'](0x194);}return _0x38c4cb;};}function handleError(_0x11ab67,_0x3b218f){_0x3b218f=_0x3b218f||0x1f4;return function(_0x183654){logger[_0x86a1('0x29')](_0x183654[_0x86a1('0x2a')]);if(_0x183654[_0x86a1('0x2b')]){delete _0x183654['name'];}_0x11ab67[_0x86a1('0x1d')](_0x3b218f)[_0x86a1('0x2c')](_0x183654);};}exports[_0x86a1('0x2d')]=function(_0x2676f5,_0x2d1916){var _0x2fc88e={},_0x2976e4={},_0x2f9cdc={'count':0x0,'rows':[]};var _0x294a42=_[_0x86a1('0x2e')](db['SquareMessage'][_0x86a1('0x2f')],function(_0x3d7f9b){return{'name':_0x3d7f9b[_0x86a1('0x30')],'type':_0x3d7f9b['type'][_0x86a1('0x31')]};});_0x2976e4[_0x86a1('0x32')]=_[_0x86a1('0x2e')](_0x294a42,_0x86a1('0x2b'));_0x2976e4['query']=_[_0x86a1('0x33')](_0x2676f5[_0x86a1('0x34')]);_0x2976e4['filters']=_[_0x86a1('0x35')](_0x2976e4[_0x86a1('0x32')],_0x2976e4[_0x86a1('0x34')]);_0x2fc88e[_0x86a1('0x36')]=_[_0x86a1('0x35')](_0x2976e4['model'],qs[_0x86a1('0x37')](_0x2676f5['query'][_0x86a1('0x37')]));_0x2fc88e['attributes']=_0x2fc88e[_0x86a1('0x36')][_0x86a1('0x38')]?_0x2fc88e[_0x86a1('0x36')]:_0x2976e4[_0x86a1('0x32')];if(!_0x2676f5['query']['hasOwnProperty'](_0x86a1('0x39'))){_0x2fc88e[_0x86a1('0x20')]=qs[_0x86a1('0x20')](_0x2676f5['query'][_0x86a1('0x20')]);_0x2fc88e['offset']=qs[_0x86a1('0x1e')](_0x2676f5[_0x86a1('0x34')][_0x86a1('0x1e')]);}_0x2fc88e[_0x86a1('0x3a')]=qs['sort'](_0x2676f5[_0x86a1('0x34')]['sort']);_0x2fc88e[_0x86a1('0x3b')]=qs[_0x86a1('0x3c')](_[_0x86a1('0x3d')](_0x2676f5[_0x86a1('0x34')],_0x2976e4[_0x86a1('0x3c')]),_0x294a42);if(_0x2676f5[_0x86a1('0x34')][_0x86a1('0x3e')]){_0x2fc88e['where']=_['merge'](_0x2fc88e[_0x86a1('0x3b')],{'$or':_[_0x86a1('0x2e')](_0x294a42,function(_0x211e1c){if(_0x211e1c[_0x86a1('0x3f')]!=='VIRTUAL'){var _0x57b2a0={};_0x57b2a0[_0x211e1c['name']]={'$like':'%'+_0x2676f5[_0x86a1('0x34')][_0x86a1('0x3e')]+'%'};return _0x57b2a0;}})});}_0x2fc88e=_[_0x86a1('0x40')]({},_0x2fc88e,_0x2676f5[_0x86a1('0x41')]);var _0xfdd98={'where':_0x2fc88e[_0x86a1('0x3b')]};return db[_0x86a1('0x42')][_0x86a1('0x21')](_0xfdd98)['then'](function(_0x28d0b0){_0x2f9cdc[_0x86a1('0x21')]=_0x28d0b0;if(_0x2676f5['query']['includeAll']){_0x2fc88e[_0x86a1('0x43')]=[{'all':!![]}];}return db[_0x86a1('0x42')][_0x86a1('0x44')](_0x2fc88e);})[_0x86a1('0x28')](function(_0x43c56c){_0x2f9cdc[_0x86a1('0x45')]=_0x43c56c;return _0x2f9cdc;})['then'](respondWithFilteredResult(_0x2d1916,_0x2fc88e))[_0x86a1('0x46')](handleError(_0x2d1916,null));};exports['show']=function(_0x14366a,_0x1be5f0){var _0x6a3bd5={'raw':!![],'where':{'id':_0x14366a[_0x86a1('0x47')]['id']}},_0x3e589e={};_0x3e589e[_0x86a1('0x32')]=_[_0x86a1('0x33')](db[_0x86a1('0x42')][_0x86a1('0x2f')]);_0x3e589e[_0x86a1('0x34')]=_[_0x86a1('0x33')](_0x14366a[_0x86a1('0x34')]);_0x3e589e[_0x86a1('0x3c')]=_[_0x86a1('0x35')](_0x3e589e['model'],_0x3e589e[_0x86a1('0x34')]);_0x6a3bd5[_0x86a1('0x36')]=_['intersection'](_0x3e589e[_0x86a1('0x32')],qs['fields'](_0x14366a['query'][_0x86a1('0x37')]));_0x6a3bd5['attributes']=_0x6a3bd5[_0x86a1('0x36')][_0x86a1('0x38')]?_0x6a3bd5[_0x86a1('0x36')]:_0x3e589e['model'];if(_0x14366a[_0x86a1('0x34')][_0x86a1('0x48')]){_0x6a3bd5[_0x86a1('0x43')]=[{'all':!![]}];}_0x6a3bd5=_['merge']({},_0x6a3bd5,_0x14366a[_0x86a1('0x41')]);return db['SquareMessage']['find'](_0x6a3bd5)[_0x86a1('0x28')](handleEntityNotFound(_0x1be5f0,null))[_0x86a1('0x28')](respondWithResult(_0x1be5f0,null))[_0x86a1('0x46')](handleError(_0x1be5f0,null));};exports[_0x86a1('0x49')]=function(_0x45001e,_0x2bc185){return db[_0x86a1('0x42')][_0x86a1('0x49')](_0x45001e[_0x86a1('0x4a')],{})['then'](respondWithResult(_0x2bc185,0xc9))[_0x86a1('0x46')](handleError(_0x2bc185,null));};exports[_0x86a1('0x4b')]=function(_0x211df9,_0x45ab34){if(_0x211df9[_0x86a1('0x4a')]['id']){delete _0x211df9[_0x86a1('0x4a')]['id'];}return db[_0x86a1('0x42')][_0x86a1('0x4c')]({'where':{'id':_0x211df9['params']['id']}})['then'](handleEntityNotFound(_0x45ab34,null))['then'](saveUpdates(_0x211df9[_0x86a1('0x4a')],null))[_0x86a1('0x28')](respondWithResult(_0x45ab34,null))['catch'](handleError(_0x45ab34,null));};exports[_0x86a1('0x4d')]=function(_0x4470d2,_0x3fc84a){return db[_0x86a1('0x42')][_0x86a1('0x4c')]({'where':{'id':_0x4470d2[_0x86a1('0x47')]['id']}})[_0x86a1('0x28')](handleEntityNotFound(_0x3fc84a,null))[_0x86a1('0x28')](removeEntity(_0x3fc84a,null))[_0x86a1('0x46')](handleError(_0x3fc84a,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index a03e127..019f6ad 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 _0x5ea1=['lodash','bluebird','request-promise','rimraf','../../config/environment','./squareMessage.attributes','exports','square_messages'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0x5ea1,0xa8));var _0x15ea=function(_0xb07ee3,_0x1229e1){_0xb07ee3=_0xb07ee3-0x0;var _0x3b9903=_0x5ea1[_0xb07ee3];return _0x3b9903;};'use strict';var _=require(_0x15ea('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x15ea('0x1'));var rp=require(_0x15ea('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x15ea('0x3'));var config=require(_0x15ea('0x4'));var attributes=require(_0x15ea('0x5'));module[_0x15ea('0x6')]=function(_0x5b3658,_0x1f5430){return _0x5b3658['define']('SquareMessage',attributes,{'tableName':_0x15ea('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2185=['util','api','request-promise','path','../../config/environment','./squareMessage.attributes','exports','SquareMessage','square_messages','lodash'];(function(_0x1e7e86,_0x3098b5){var _0x205437=function(_0x4bf7da){while(--_0x4bf7da){_0x1e7e86['push'](_0x1e7e86['shift']());}};_0x205437(++_0x3098b5);}(_0x2185,0x171));var _0x5218=function(_0x3dcb26,_0x5e582c){_0x3dcb26=_0x3dcb26-0x0;var _0x54497c=_0x2185[_0x3dcb26];return _0x54497c;};'use strict';var _=require(_0x5218('0x0'));var util=require(_0x5218('0x1'));var logger=require('../../config/logger')(_0x5218('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5218('0x3'));var fs=require('fs');var path=require(_0x5218('0x4'));var rimraf=require('rimraf');var config=require(_0x5218('0x5'));var attributes=require(_0x5218('0x6'));module[_0x5218('0x7')]=function(_0x13a259,_0x1231d2){return _0x13a259['define'](_0x5218('0x8'),attributes,{'tableName':_0x5218('0x9'),'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 f6fe969..574a727 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 _0x8d4c=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','SquareMessage','create','body','options','raw','debug','CreateSquareMessage','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x4efc72,_0x43c8a3){var _0x88ffb9=function(_0x4994da){while(--_0x4994da){_0x4efc72['push'](_0x4efc72['shift']());}};_0x88ffb9(++_0x43c8a3);}(_0x8d4c,0x1e6));var _0xc8d4=function(_0x16d24f,_0x4686a5){_0x16d24f=_0x16d24f-0x0;var _0x3beec6=_0x8d4c[_0x16d24f];return _0x3beec6;};'use strict';var _=require(_0xc8d4('0x0'));var util=require(_0xc8d4('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc8d4('0x2'));var fs=require('fs');var Redis=require(_0xc8d4('0x3'));var db=require(_0xc8d4('0x4'))['db'];var utils=require(_0xc8d4('0x5'));var logger=require(_0xc8d4('0x6'))(_0xc8d4('0x7'));var config=require(_0xc8d4('0x8'));var jayson=require(_0xc8d4('0x9'));var client=jayson[_0xc8d4('0xa')][_0xc8d4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x25e004,_0x14d240,_0x42631d){return new BPromise(function(_0x3dc022,_0x4f5bc4){return client[_0xc8d4('0xc')](_0x25e004,_0x42631d)[_0xc8d4('0xd')](function(_0x30f107){logger[_0xc8d4('0xe')](_0xc8d4('0xf'),_0x14d240,_0xc8d4('0x10'));logger['debug']('SquareMessage,\x20%s,\x20%s,\x20%s',_0x14d240,_0xc8d4('0x10'),JSON[_0xc8d4('0x11')](_0x30f107));if(_0x30f107[_0xc8d4('0x12')]){if(_0x30f107[_0xc8d4('0x12')]['code']===0x1f4){logger['error'](_0xc8d4('0xf'),_0x14d240,_0x30f107[_0xc8d4('0x12')]['message']);return _0x4f5bc4(_0x30f107[_0xc8d4('0x12')][_0xc8d4('0x13')]);}logger['error'](_0xc8d4('0xf'),_0x14d240,_0x30f107[_0xc8d4('0x12')][_0xc8d4('0x13')]);return _0x3dc022(_0x30f107[_0xc8d4('0x12')][_0xc8d4('0x13')]);}else{logger[_0xc8d4('0xe')](_0xc8d4('0xf'),_0x14d240,'request\x20sent');_0x3dc022(_0x30f107[_0xc8d4('0x14')]['message']);}})[_0xc8d4('0x15')](function(_0x419b68){logger[_0xc8d4('0x12')](_0xc8d4('0xf'),_0x14d240,_0x419b68);_0x4f5bc4(_0x419b68);});});}exports['CreateSquareMessage']=function(_0x18f0f3){var _0x4b68b4=this;return new Promise(function(_0x2a3706,_0x2df86a){return db[_0xc8d4('0x16')][_0xc8d4('0x17')](_0x18f0f3[_0xc8d4('0x18')],{'raw':_0x18f0f3[_0xc8d4('0x19')]?_0x18f0f3[_0xc8d4('0x19')][_0xc8d4('0x1a')]===undefined?!![]:![]:!![]})[_0xc8d4('0xd')](function(_0x757b4c){logger['info']('CreateSquareMessage',_0x18f0f3);logger[_0xc8d4('0x1b')](_0xc8d4('0x1c'),_0x18f0f3,JSON['stringify'](_0x757b4c));_0x2a3706(_0x757b4c);})['catch'](function(_0xb82a45){logger[_0xc8d4('0x12')]('CreateSquareMessage',_0xb82a45[_0xc8d4('0x13')],_0x18f0f3);_0x2df86a(_0x4b68b4[_0xc8d4('0x12')](0x1f4,_0xb82a45['message']));});});}; \ No newline at end of file +var _0x7057=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateSquareMessage','SquareMessage','create','body','options','raw','then','lodash','util'];(function(_0x3b0fe9,_0x2872ec){var _0x3185af=function(_0x3a6058){while(--_0x3a6058){_0x3b0fe9['push'](_0x3b0fe9['shift']());}};_0x3185af(++_0x2872ec);}(_0x7057,0xd7));var _0x7705=function(_0x3f6b1b,_0x58d3d6){_0x3f6b1b=_0x3f6b1b-0x0;var _0x4a3d2b=_0x7057[_0x3f6b1b];return _0x4a3d2b;};'use strict';var _=require(_0x7705('0x0'));var util=require(_0x7705('0x1'));var moment=require(_0x7705('0x2'));var BPromise=require(_0x7705('0x3'));var rs=require(_0x7705('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7705('0x5'))['db'];var utils=require(_0x7705('0x6'));var logger=require(_0x7705('0x7'))(_0x7705('0x8'));var config=require(_0x7705('0x9'));var jayson=require(_0x7705('0xa'));var client=jayson[_0x7705('0xb')][_0x7705('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2389e8,_0x5380e1,_0x1fbd35){return new BPromise(function(_0x2e7068,_0x5cde27){return client[_0x7705('0xd')](_0x2389e8,_0x1fbd35)['then'](function(_0x5e2021){logger[_0x7705('0xe')](_0x7705('0xf'),_0x5380e1,_0x7705('0x10'));logger[_0x7705('0x11')](_0x7705('0x12'),_0x5380e1,_0x7705('0x10'),JSON[_0x7705('0x13')](_0x5e2021));if(_0x5e2021['error']){if(_0x5e2021[_0x7705('0x14')]['code']===0x1f4){logger[_0x7705('0x14')](_0x7705('0xf'),_0x5380e1,_0x5e2021['error'][_0x7705('0x15')]);return _0x5cde27(_0x5e2021['error'][_0x7705('0x15')]);}logger[_0x7705('0x14')]('SquareMessage,\x20%s,\x20%s',_0x5380e1,_0x5e2021[_0x7705('0x14')]['message']);return _0x2e7068(_0x5e2021[_0x7705('0x14')][_0x7705('0x15')]);}else{logger['info'](_0x7705('0xf'),_0x5380e1,'request\x20sent');_0x2e7068(_0x5e2021[_0x7705('0x16')][_0x7705('0x15')]);}})[_0x7705('0x17')](function(_0x52a6ea){logger['error'](_0x7705('0xf'),_0x5380e1,_0x52a6ea);_0x5cde27(_0x52a6ea);});});}exports[_0x7705('0x18')]=function(_0x285260){var _0x36307f=this;return new Promise(function(_0x3eade1,_0xb10873){return db[_0x7705('0x19')][_0x7705('0x1a')](_0x285260[_0x7705('0x1b')],{'raw':_0x285260[_0x7705('0x1c')]?_0x285260['options'][_0x7705('0x1d')]===undefined?!![]:![]:!![]})[_0x7705('0x1e')](function(_0x4420da){logger['info'](_0x7705('0x18'),_0x285260);logger[_0x7705('0x11')](_0x7705('0x18'),_0x285260,JSON['stringify'](_0x4420da));_0x3eade1(_0x4420da);})['catch'](function(_0x30e7e2){logger['error'](_0x7705('0x18'),_0x30e7e2[_0x7705('0x15')],_0x285260);_0xb10873(_0x36307f[_0x7705('0x14')](0x1f4,_0x30e7e2[_0x7705('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 6c634b7..6e297a7 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 _0xa4a2=['show','/:id/test','15s','test','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x5519cb,_0x2706bc){var _0xdfc901=function(_0x3a42fa){while(--_0x3a42fa){_0x5519cb['push'](_0x5519cb['shift']());}};_0xdfc901(++_0x2706bc);}(_0xa4a2,0x1a3));var _0x2a4a=function(_0xa929c8,_0x25a5c2){_0xa929c8=_0xa929c8-0x0;var _0x1b527c=_0xa4a2[_0xa929c8];return _0x1b527c;};'use strict';var multer=require('multer');var util=require(_0x2a4a('0x0'));var path=require(_0x2a4a('0x1'));var timeout=require(_0x2a4a('0x2'));var express=require(_0x2a4a('0x3'));var router=express[_0x2a4a('0x4')]();var fs_extra=require(_0x2a4a('0x5'));var auth=require(_0x2a4a('0x6'));var interaction=require(_0x2a4a('0x7'));var config=require(_0x2a4a('0x8'));var controller=require('./squareOdbc.controller');router[_0x2a4a('0x9')]('/',auth[_0x2a4a('0xa')](),controller[_0x2a4a('0xb')]);router['get'](_0x2a4a('0xc'),auth[_0x2a4a('0xa')](),controller[_0x2a4a('0xd')]);router[_0x2a4a('0x9')](_0x2a4a('0xe'),auth[_0x2a4a('0xa')](),timeout(_0x2a4a('0xf')),controller[_0x2a4a('0x10')]);router[_0x2a4a('0x11')]('/',auth[_0x2a4a('0xa')](),controller[_0x2a4a('0x12')]);router[_0x2a4a('0x13')](_0x2a4a('0xc'),auth[_0x2a4a('0xa')](),controller[_0x2a4a('0x14')]);router[_0x2a4a('0x15')]('/:id',auth[_0x2a4a('0xa')](),controller[_0x2a4a('0x16')]);module[_0x2a4a('0x17')]=router; \ No newline at end of file +var _0x1000=['post','put','delete','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','/:id/test','15s'];(function(_0x3ed25d,_0x6c37b2){var _0x5e0998=function(_0x3e53a4){while(--_0x3e53a4){_0x3ed25d['push'](_0x3ed25d['shift']());}};_0x5e0998(++_0x6c37b2);}(_0x1000,0x113));var _0x0100=function(_0x40e139,_0x4a5f95){_0x40e139=_0x40e139-0x0;var _0x3005bf=_0x1000[_0x40e139];return _0x3005bf;};'use strict';var multer=require(_0x0100('0x0'));var util=require(_0x0100('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0100('0x2'));var router=express['Router']();var fs_extra=require(_0x0100('0x3'));var auth=require(_0x0100('0x4'));var interaction=require(_0x0100('0x5'));var config=require(_0x0100('0x6'));var controller=require('./squareOdbc.controller');router[_0x0100('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x0100('0x7')](_0x0100('0x8'),auth[_0x0100('0x9')](),controller[_0x0100('0xa')]);router[_0x0100('0x7')](_0x0100('0xb'),auth['isAuthenticated'](),timeout(_0x0100('0xc')),controller['test']);router[_0x0100('0xd')]('/',auth[_0x0100('0x9')](),controller['create']);router[_0x0100('0xe')](_0x0100('0x8'),auth[_0x0100('0x9')](),controller['update']);router[_0x0100('0xf')]('/:id',auth[_0x0100('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 02e6b20..453c01e 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 _0x6092=['sequelize','exports','STRING','name'];(function(_0x5578a,_0x34a644){var _0xbc231a=function(_0x58cc0b){while(--_0x58cc0b){_0x5578a['push'](_0x5578a['shift']());}};_0xbc231a(++_0x34a644);}(_0x6092,0x1e8));var _0x2609=function(_0x37b318,_0x562b3d){_0x37b318=_0x37b318-0x0;var _0x46eac4=_0x6092[_0x37b318];return _0x46eac4;};'use strict';var Sequelize=require(_0x2609('0x0'));module[_0x2609('0x1')]={'name':{'type':Sequelize[_0x2609('0x2')],'unique':_0x2609('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0x2609('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1291=['name','sequelize','STRING'];(function(_0x563887,_0x3cdb5e){var _0x317d47=function(_0x2636d4){while(--_0x2636d4){_0x563887['push'](_0x563887['shift']());}};_0x317d47(++_0x3cdb5e);}(_0x1291,0x103));var _0x1129=function(_0x86edec,_0x31353c){_0x86edec=_0x86edec-0x0;var _0x1b1ac1=_0x1291[_0x86edec];return _0x1b1ac1;};'use strict';var Sequelize=require(_0x1129('0x0'));module['exports']={'name':{'type':Sequelize[_0x1129('0x1')],'unique':_0x1129('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0x1129('0x1')]},'description':{'type':Sequelize[_0x1129('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 5b25b3f..0031ee0 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 _0x8d54=['order','sort','filter','where','merge','type','VIRTUAL','include','rows','catch','show','params','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ODBC','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','dsn','openSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../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','apply','save','update','then','get','destroy','error','stack','name','send','map','SquareOdbc','rawAttributes','fieldName','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x8d54,0x73));var _0x48d5=function(_0xfafe54,_0x23c9a6){_0xfafe54=_0xfafe54-0x0;var _0x4ab8e6=_0x8d54[_0xfafe54];return _0x4ab8e6;};'use strict';var emlformat=require(_0x48d5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x48d5('0x1'));var jsonpatch=require(_0x48d5('0x2'));var rp=require(_0x48d5('0x3'));var moment=require(_0x48d5('0x4'));var BPromise=require(_0x48d5('0x5'));var Mustache=require(_0x48d5('0x6'));var util=require(_0x48d5('0x7'));var path=require('path');var sox=require(_0x48d5('0x8'));var csv=require(_0x48d5('0x9'));var ejs=require(_0x48d5('0xa'));var fs=require('fs');var fs_extra=require(_0x48d5('0xb'));var _=require(_0x48d5('0xc'));var squel=require(_0x48d5('0xd'));var crypto=require('crypto');var jsforce=require(_0x48d5('0xe'));var deskjs=require(_0x48d5('0xf'));var toCsv=require(_0x48d5('0x9'));var querystring=require(_0x48d5('0x10'));var Papa=require(_0x48d5('0x11'));var Redis=require(_0x48d5('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x48d5('0x13'));var as=require(_0x48d5('0x14'));var hardwareService=require(_0x48d5('0x15'));var logger=require(_0x48d5('0x16'))(_0x48d5('0x17'));var utils=require(_0x48d5('0x18'));var config=require(_0x48d5('0x19'));var licenseUtil=require(_0x48d5('0x1a'));var db=require(_0x48d5('0x1b'))['db'];function respondWithStatusCode(_0x792e78,_0x39eea7){_0x39eea7=_0x39eea7||0xcc;return function(_0x1bb4ed){if(_0x1bb4ed){return _0x792e78[_0x48d5('0x1c')](_0x39eea7);}return _0x792e78[_0x48d5('0x1d')](_0x39eea7)[_0x48d5('0x1e')]();};}function respondWithResult(_0x260662,_0x379536){_0x379536=_0x379536||0xc8;return function(_0x2463d6){if(_0x2463d6){return _0x260662[_0x48d5('0x1d')](_0x379536)['json'](_0x2463d6);}};}function respondWithFilteredResult(_0xbfb053,_0x7ba073){return function(_0x2a08ef){if(_0x2a08ef){var _0x2b0142=typeof _0x7ba073['offset']==='undefined'&&typeof _0x7ba073['limit']===_0x48d5('0x1f');var _0x44b484=_0x2a08ef[_0x48d5('0x20')];var _0x234821=_0x2b0142?0x0:_0x7ba073[_0x48d5('0x21')];var _0x5b354c=_0x2b0142?_0x2a08ef[_0x48d5('0x20')]:_0x7ba073[_0x48d5('0x21')]+_0x7ba073[_0x48d5('0x22')];var _0x238d28;if(_0x5b354c>=_0x44b484){_0x5b354c=_0x44b484;_0x238d28=0xc8;}else{_0x238d28=0xce;}_0xbfb053['status'](_0x238d28);return _0xbfb053[_0x48d5('0x23')]('Content-Range',_0x234821+'-'+_0x5b354c+'/'+_0x44b484)['json'](_0x2a08ef);}return null;};}function patchUpdates(_0x184954){return function(_0x4eb68b){try{jsonpatch[_0x48d5('0x24')](_0x4eb68b,_0x184954,!![]);}catch(_0x4abc9e){return BPromise['reject'](_0x4abc9e);}return _0x4eb68b[_0x48d5('0x25')]();};}function saveUpdates(_0x88a8aa,_0x47306a){return function(_0x360926){if(_0x360926){return _0x360926[_0x48d5('0x26')](_0x88a8aa)[_0x48d5('0x27')](function(_0x1fe27b){return _0x1fe27b;});}return null;};}function removeEntity(_0x4146a1,_0x33aef9){return function(_0x4b0d3c){if(_0x4b0d3c){return _0x4b0d3c['destroy']()[_0x48d5('0x27')](function(){var _0x581841=_0x4b0d3c[_0x48d5('0x28')]({'plain':!![]});var _0x2195a8='ODBC';return db['UserProfileResource'][_0x48d5('0x29')]({'where':{'type':_0x2195a8,'resourceId':_0x581841['id']}})[_0x48d5('0x27')](function(){return _0x4b0d3c;});})['then'](function(){_0x4146a1[_0x48d5('0x1d')](0xcc)[_0x48d5('0x1e')]();});}};}function handleEntityNotFound(_0x4fc9a7,_0x282f0f){return function(_0x346cb8){if(!_0x346cb8){_0x4fc9a7[_0x48d5('0x1c')](0x194);}return _0x346cb8;};}function handleError(_0x45e497,_0x5cb55b){_0x5cb55b=_0x5cb55b||0x1f4;return function(_0x13b22d){logger[_0x48d5('0x2a')](_0x13b22d[_0x48d5('0x2b')]);if(_0x13b22d[_0x48d5('0x2c')]){delete _0x13b22d[_0x48d5('0x2c')];}_0x45e497['status'](_0x5cb55b)[_0x48d5('0x2d')](_0x13b22d);};}exports['index']=function(_0x3a99a4,_0x79bb06){var _0x396076={},_0x386f9a={},_0xaecc83={'count':0x0,'rows':[]};var _0x1739b2=_[_0x48d5('0x2e')](db[_0x48d5('0x2f')][_0x48d5('0x30')],function(_0x5ba6be){return{'name':_0x5ba6be[_0x48d5('0x31')],'type':_0x5ba6be['type'][_0x48d5('0x32')]};});_0x386f9a[_0x48d5('0x33')]=_[_0x48d5('0x2e')](_0x1739b2,'name');_0x386f9a['query']=_[_0x48d5('0x34')](_0x3a99a4[_0x48d5('0x35')]);_0x386f9a[_0x48d5('0x36')]=_[_0x48d5('0x37')](_0x386f9a[_0x48d5('0x33')],_0x386f9a[_0x48d5('0x35')]);_0x396076['attributes']=_[_0x48d5('0x37')](_0x386f9a['model'],qs[_0x48d5('0x38')](_0x3a99a4[_0x48d5('0x35')]['fields']));_0x396076[_0x48d5('0x39')]=_0x396076['attributes'][_0x48d5('0x3a')]?_0x396076['attributes']:_0x386f9a[_0x48d5('0x33')];if(!_0x3a99a4[_0x48d5('0x35')][_0x48d5('0x3b')](_0x48d5('0x3c'))){_0x396076[_0x48d5('0x22')]=qs[_0x48d5('0x22')](_0x3a99a4[_0x48d5('0x35')][_0x48d5('0x22')]);_0x396076[_0x48d5('0x21')]=qs['offset'](_0x3a99a4[_0x48d5('0x35')]['offset']);}_0x396076[_0x48d5('0x3d')]=qs['sort'](_0x3a99a4[_0x48d5('0x35')][_0x48d5('0x3e')]);_0x396076['where']=qs[_0x48d5('0x36')](_['pick'](_0x3a99a4[_0x48d5('0x35')],_0x386f9a[_0x48d5('0x36')]),_0x1739b2);if(_0x3a99a4['query'][_0x48d5('0x3f')]){_0x396076[_0x48d5('0x40')]=_[_0x48d5('0x41')](_0x396076[_0x48d5('0x40')],{'$or':_[_0x48d5('0x2e')](_0x1739b2,function(_0x53162e){if(_0x53162e[_0x48d5('0x42')]!==_0x48d5('0x43')){var _0x89b6ca={};_0x89b6ca[_0x53162e[_0x48d5('0x2c')]]={'$like':'%'+_0x3a99a4[_0x48d5('0x35')][_0x48d5('0x3f')]+'%'};return _0x89b6ca;}})});}_0x396076=_['merge']({},_0x396076,_0x3a99a4['options']);var _0x2bffa4={'where':_0x396076[_0x48d5('0x40')]};return db['SquareOdbc'][_0x48d5('0x20')](_0x2bffa4)[_0x48d5('0x27')](function(_0x413083){_0xaecc83[_0x48d5('0x20')]=_0x413083;if(_0x3a99a4['query']['includeAll']){_0x396076[_0x48d5('0x44')]=[{'all':!![]}];}return db[_0x48d5('0x2f')]['findAll'](_0x396076);})[_0x48d5('0x27')](function(_0x2a26a0){_0xaecc83[_0x48d5('0x45')]=_0x2a26a0;return _0xaecc83;})[_0x48d5('0x27')](respondWithFilteredResult(_0x79bb06,_0x396076))[_0x48d5('0x46')](handleError(_0x79bb06,null));};exports[_0x48d5('0x47')]=function(_0x361bb5,_0x4e3651){var _0x29588a={'raw':!![],'where':{'id':_0x361bb5[_0x48d5('0x48')]['id']}},_0x170671={};_0x170671[_0x48d5('0x33')]=_[_0x48d5('0x34')](db[_0x48d5('0x2f')][_0x48d5('0x30')]);_0x170671[_0x48d5('0x35')]=_[_0x48d5('0x34')](_0x361bb5['query']);_0x170671['filters']=_[_0x48d5('0x37')](_0x170671[_0x48d5('0x33')],_0x170671[_0x48d5('0x35')]);_0x29588a[_0x48d5('0x39')]=_[_0x48d5('0x37')](_0x170671[_0x48d5('0x33')],qs[_0x48d5('0x38')](_0x361bb5['query'][_0x48d5('0x38')]));_0x29588a[_0x48d5('0x39')]=_0x29588a[_0x48d5('0x39')]['length']?_0x29588a[_0x48d5('0x39')]:_0x170671[_0x48d5('0x33')];if(_0x361bb5['query']['includeAll']){_0x29588a[_0x48d5('0x44')]=[{'all':!![]}];}_0x29588a=_['merge']({},_0x29588a,_0x361bb5[_0x48d5('0x49')]);return db['SquareOdbc'][_0x48d5('0x4a')](_0x29588a)[_0x48d5('0x27')](handleEntityNotFound(_0x4e3651,null))[_0x48d5('0x27')](respondWithResult(_0x4e3651,null))['catch'](handleError(_0x4e3651,null));};exports['create']=function(_0x5be59d,_0x3f2a39){return db[_0x48d5('0x2f')][_0x48d5('0x4b')](_0x5be59d['body'],{})[_0x48d5('0x27')](function(_0x3a9a17){var _0x4d9151=_0x5be59d[_0x48d5('0x4c')][_0x48d5('0x28')]({'plain':!![]});if(!_0x4d9151)throw new Error(_0x48d5('0x4d'));if(_0x4d9151[_0x48d5('0x4e')]==='user'){var _0x2c1f7d=_0x3a9a17[_0x48d5('0x28')]({'plain':!![]});var _0x4e9eba=_0x48d5('0x4f');return db[_0x48d5('0x50')][_0x48d5('0x4a')]({'where':{'name':_0x4e9eba,'userProfileId':_0x4d9151[_0x48d5('0x51')]},'raw':!![]})[_0x48d5('0x27')](function(_0x19d512){if(_0x19d512&&_0x19d512[_0x48d5('0x52')]===0x0){return db[_0x48d5('0x53')]['create']({'name':_0x2c1f7d[_0x48d5('0x2c')],'resourceId':_0x2c1f7d['id'],'type':_0x19d512[_0x48d5('0x2c')],'sectionId':_0x19d512['id']},{})[_0x48d5('0x27')](function(){return _0x3a9a17;});}else{return _0x3a9a17;}})[_0x48d5('0x46')](function(_0x26250a){logger[_0x48d5('0x2a')](_0x48d5('0x54'),_0x26250a);throw _0x26250a;});}return _0x3a9a17;})[_0x48d5('0x27')](respondWithResult(_0x3f2a39,0xc9))[_0x48d5('0x46')](handleError(_0x3f2a39,null));};exports['update']=function(_0x27e4b3,_0x3fb51f){if(_0x27e4b3['body']['id']){delete _0x27e4b3[_0x48d5('0x55')]['id'];}return db[_0x48d5('0x2f')][_0x48d5('0x4a')]({'where':{'id':_0x27e4b3[_0x48d5('0x48')]['id']}})[_0x48d5('0x27')](handleEntityNotFound(_0x3fb51f,null))[_0x48d5('0x27')](saveUpdates(_0x27e4b3[_0x48d5('0x55')],null))[_0x48d5('0x27')](respondWithResult(_0x3fb51f,null))[_0x48d5('0x46')](handleError(_0x3fb51f,null));};exports[_0x48d5('0x29')]=function(_0x3c652d,_0x4ca4cd){return db['SquareOdbc']['find']({'where':{'id':_0x3c652d[_0x48d5('0x48')]['id']}})[_0x48d5('0x27')](handleEntityNotFound(_0x4ca4cd,null))[_0x48d5('0x27')](removeEntity(_0x4ca4cd,null))[_0x48d5('0x46')](handleError(_0x4ca4cd,null));};exports['test']=function(_0x6db36c,_0x169a45,_0x495406){var _0x3f40ca;return db[_0x48d5('0x2f')][_0x48d5('0x4a')]({'where':{'id':_0x6db36c[_0x48d5('0x48')]['id']},'attributes':['id',_0x48d5('0x56')]})[_0x48d5('0x27')](handleEntityNotFound(_0x169a45,null))[_0x48d5('0x27')](function(_0x55e289){if(_0x55e289){var _0x263c71=require('odbc')();_0x263c71[_0x48d5('0x57')](_0x55e289[_0x48d5('0x56')]);_0x263c71['closeSync']();return _0x55e289;}})[_0x48d5('0x27')](respondWithResult(_0x169a45,null))[_0x48d5('0x46')](handleError(_0x169a45,null));}; \ No newline at end of file +var _0x4487=['../../components/auth/service','../../components/parsers/qs','../../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','save','update','then','get','ODBC','UserProfileResource','name','send','map','SquareOdbc','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','test','dsn','odbc','openSync','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis'];(function(_0x4a9120,_0x48aca7){var _0x207e4b=function(_0x15ad64){while(--_0x15ad64){_0x4a9120['push'](_0x4a9120['shift']());}};_0x207e4b(++_0x48aca7);}(_0x4487,0x1f3));var _0x7448=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x4487[_0x42cae2];return _0x5f256f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7448('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7448('0x1'));var rp=require(_0x7448('0x2'));var moment=require(_0x7448('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x7448('0x4'));var util=require(_0x7448('0x5'));var path=require(_0x7448('0x6'));var sox=require(_0x7448('0x7'));var csv=require(_0x7448('0x8'));var ejs=require(_0x7448('0x9'));var fs=require('fs');var fs_extra=require(_0x7448('0xa'));var _=require(_0x7448('0xb'));var squel=require(_0x7448('0xc'));var crypto=require(_0x7448('0xd'));var jsforce=require(_0x7448('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x7448('0x8'));var querystring=require('querystring');var Papa=require(_0x7448('0xf'));var Redis=require(_0x7448('0x10'));var authService=require(_0x7448('0x11'));var qs=require(_0x7448('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7448('0x13'));var logger=require(_0x7448('0x14'))(_0x7448('0x15'));var utils=require(_0x7448('0x16'));var config=require(_0x7448('0x17'));var licenseUtil=require(_0x7448('0x18'));var db=require(_0x7448('0x19'))['db'];function respondWithStatusCode(_0x168615,_0x5aad96){_0x5aad96=_0x5aad96||0xcc;return function(_0x50a2ca){if(_0x50a2ca){return _0x168615[_0x7448('0x1a')](_0x5aad96);}return _0x168615['status'](_0x5aad96)[_0x7448('0x1b')]();};}function respondWithResult(_0x22dbb7,_0x302895){_0x302895=_0x302895||0xc8;return function(_0x3d4062){if(_0x3d4062){return _0x22dbb7[_0x7448('0x1c')](_0x302895)['json'](_0x3d4062);}};}function respondWithFilteredResult(_0x2359e3,_0x2c64a7){return function(_0x89f1cd){if(_0x89f1cd){var _0x369770=typeof _0x2c64a7[_0x7448('0x1d')]===_0x7448('0x1e')&&typeof _0x2c64a7[_0x7448('0x1f')]===_0x7448('0x1e');var _0x275785=_0x89f1cd[_0x7448('0x20')];var _0x395d2e=_0x369770?0x0:_0x2c64a7[_0x7448('0x1d')];var _0x508b7f=_0x369770?_0x89f1cd[_0x7448('0x20')]:_0x2c64a7[_0x7448('0x1d')]+_0x2c64a7[_0x7448('0x1f')];var _0x557052;if(_0x508b7f>=_0x275785){_0x508b7f=_0x275785;_0x557052=0xc8;}else{_0x557052=0xce;}_0x2359e3[_0x7448('0x1c')](_0x557052);return _0x2359e3[_0x7448('0x21')](_0x7448('0x22'),_0x395d2e+'-'+_0x508b7f+'/'+_0x275785)[_0x7448('0x23')](_0x89f1cd);}return null;};}function patchUpdates(_0x5e3b6c){return function(_0x462d15){try{jsonpatch[_0x7448('0x24')](_0x462d15,_0x5e3b6c,!![]);}catch(_0xa8f5d6){return BPromise['reject'](_0xa8f5d6);}return _0x462d15[_0x7448('0x25')]();};}function saveUpdates(_0x47bfb3,_0x2edc12){return function(_0x255a32){if(_0x255a32){return _0x255a32[_0x7448('0x26')](_0x47bfb3)[_0x7448('0x27')](function(_0x45c42a){return _0x45c42a;});}return null;};}function removeEntity(_0x1783cb,_0x277094){return function(_0x181c5e){if(_0x181c5e){return _0x181c5e['destroy']()['then'](function(){var _0x42822c=_0x181c5e[_0x7448('0x28')]({'plain':!![]});var _0x4a43da=_0x7448('0x29');return db[_0x7448('0x2a')]['destroy']({'where':{'type':_0x4a43da,'resourceId':_0x42822c['id']}})[_0x7448('0x27')](function(){return _0x181c5e;});})[_0x7448('0x27')](function(){_0x1783cb[_0x7448('0x1c')](0xcc)[_0x7448('0x1b')]();});}};}function handleEntityNotFound(_0x28b39b,_0x358e8a){return function(_0x38c05b){if(!_0x38c05b){_0x28b39b[_0x7448('0x1a')](0x194);}return _0x38c05b;};}function handleError(_0x4ea62b,_0x59b8f2){_0x59b8f2=_0x59b8f2||0x1f4;return function(_0x48318c){logger['error'](_0x48318c['stack']);if(_0x48318c['name']){delete _0x48318c[_0x7448('0x2b')];}_0x4ea62b[_0x7448('0x1c')](_0x59b8f2)[_0x7448('0x2c')](_0x48318c);};}exports['index']=function(_0x4266f9,_0x32ba96){var _0x1b4457={},_0x1c188a={},_0x1b54ed={'count':0x0,'rows':[]};var _0x40347a=_[_0x7448('0x2d')](db[_0x7448('0x2e')][_0x7448('0x2f')],function(_0x3b02c1){return{'name':_0x3b02c1[_0x7448('0x30')],'type':_0x3b02c1[_0x7448('0x31')][_0x7448('0x32')]};});_0x1c188a[_0x7448('0x33')]=_[_0x7448('0x2d')](_0x40347a,_0x7448('0x2b'));_0x1c188a[_0x7448('0x34')]=_[_0x7448('0x35')](_0x4266f9[_0x7448('0x34')]);_0x1c188a[_0x7448('0x36')]=_[_0x7448('0x37')](_0x1c188a['model'],_0x1c188a[_0x7448('0x34')]);_0x1b4457[_0x7448('0x38')]=_[_0x7448('0x37')](_0x1c188a[_0x7448('0x33')],qs[_0x7448('0x39')](_0x4266f9[_0x7448('0x34')][_0x7448('0x39')]));_0x1b4457[_0x7448('0x38')]=_0x1b4457[_0x7448('0x38')]['length']?_0x1b4457[_0x7448('0x38')]:_0x1c188a[_0x7448('0x33')];if(!_0x4266f9[_0x7448('0x34')][_0x7448('0x3a')]('nolimit')){_0x1b4457[_0x7448('0x1f')]=qs[_0x7448('0x1f')](_0x4266f9[_0x7448('0x34')][_0x7448('0x1f')]);_0x1b4457[_0x7448('0x1d')]=qs[_0x7448('0x1d')](_0x4266f9[_0x7448('0x34')]['offset']);}_0x1b4457['order']=qs['sort'](_0x4266f9['query'][_0x7448('0x3b')]);_0x1b4457[_0x7448('0x3c')]=qs[_0x7448('0x36')](_[_0x7448('0x3d')](_0x4266f9[_0x7448('0x34')],_0x1c188a[_0x7448('0x36')]),_0x40347a);if(_0x4266f9[_0x7448('0x34')][_0x7448('0x3e')]){_0x1b4457[_0x7448('0x3c')]=_[_0x7448('0x3f')](_0x1b4457[_0x7448('0x3c')],{'$or':_[_0x7448('0x2d')](_0x40347a,function(_0x1ebae4){if(_0x1ebae4[_0x7448('0x31')]!==_0x7448('0x40')){var _0x4df15b={};_0x4df15b[_0x1ebae4['name']]={'$like':'%'+_0x4266f9['query'][_0x7448('0x3e')]+'%'};return _0x4df15b;}})});}_0x1b4457=_['merge']({},_0x1b4457,_0x4266f9[_0x7448('0x41')]);var _0x124ce6={'where':_0x1b4457[_0x7448('0x3c')]};return db[_0x7448('0x2e')]['count'](_0x124ce6)[_0x7448('0x27')](function(_0x3458c2){_0x1b54ed[_0x7448('0x20')]=_0x3458c2;if(_0x4266f9['query'][_0x7448('0x42')]){_0x1b4457[_0x7448('0x43')]=[{'all':!![]}];}return db[_0x7448('0x2e')][_0x7448('0x44')](_0x1b4457);})['then'](function(_0x5a6ae2){_0x1b54ed[_0x7448('0x45')]=_0x5a6ae2;return _0x1b54ed;})[_0x7448('0x27')](respondWithFilteredResult(_0x32ba96,_0x1b4457))[_0x7448('0x46')](handleError(_0x32ba96,null));};exports[_0x7448('0x47')]=function(_0x13d828,_0x11cf94){var _0x3a245c={'raw':!![],'where':{'id':_0x13d828[_0x7448('0x48')]['id']}},_0x23e052={};_0x23e052['model']=_[_0x7448('0x35')](db['SquareOdbc'][_0x7448('0x2f')]);_0x23e052['query']=_[_0x7448('0x35')](_0x13d828[_0x7448('0x34')]);_0x23e052[_0x7448('0x36')]=_['intersection'](_0x23e052[_0x7448('0x33')],_0x23e052[_0x7448('0x34')]);_0x3a245c['attributes']=_[_0x7448('0x37')](_0x23e052[_0x7448('0x33')],qs[_0x7448('0x39')](_0x13d828[_0x7448('0x34')][_0x7448('0x39')]));_0x3a245c[_0x7448('0x38')]=_0x3a245c[_0x7448('0x38')][_0x7448('0x49')]?_0x3a245c[_0x7448('0x38')]:_0x23e052[_0x7448('0x33')];if(_0x13d828[_0x7448('0x34')][_0x7448('0x42')]){_0x3a245c[_0x7448('0x43')]=[{'all':!![]}];}_0x3a245c=_[_0x7448('0x3f')]({},_0x3a245c,_0x13d828['options']);return db[_0x7448('0x2e')][_0x7448('0x4a')](_0x3a245c)[_0x7448('0x27')](handleEntityNotFound(_0x11cf94,null))[_0x7448('0x27')](respondWithResult(_0x11cf94,null))[_0x7448('0x46')](handleError(_0x11cf94,null));};exports['create']=function(_0x592973,_0x54ec29){return db[_0x7448('0x2e')][_0x7448('0x4b')](_0x592973[_0x7448('0x4c')],{})[_0x7448('0x27')](function(_0x489a4e){var _0x468f6c=_0x592973[_0x7448('0x4d')][_0x7448('0x28')]({'plain':!![]});if(!_0x468f6c)throw new Error(_0x7448('0x4e'));if(_0x468f6c['role']===_0x7448('0x4d')){var _0x293df1=_0x489a4e[_0x7448('0x28')]({'plain':!![]});var _0x5536f2='ODBC';return db['UserProfileSection'][_0x7448('0x4a')]({'where':{'name':_0x5536f2,'userProfileId':_0x468f6c['userProfileId']},'raw':!![]})[_0x7448('0x27')](function(_0xb43eca){if(_0xb43eca&&_0xb43eca[_0x7448('0x4f')]===0x0){return db[_0x7448('0x2a')][_0x7448('0x4b')]({'name':_0x293df1[_0x7448('0x2b')],'resourceId':_0x293df1['id'],'type':_0xb43eca['name'],'sectionId':_0xb43eca['id']},{})[_0x7448('0x27')](function(){return _0x489a4e;});}else{return _0x489a4e;}})[_0x7448('0x46')](function(_0x20e16f){logger[_0x7448('0x50')](_0x7448('0x51'),_0x20e16f);throw _0x20e16f;});}return _0x489a4e;})['then'](respondWithResult(_0x54ec29,0xc9))[_0x7448('0x46')](handleError(_0x54ec29,null));};exports[_0x7448('0x26')]=function(_0x1116d1,_0x14acab){if(_0x1116d1['body']['id']){delete _0x1116d1[_0x7448('0x4c')]['id'];}return db[_0x7448('0x2e')][_0x7448('0x4a')]({'where':{'id':_0x1116d1[_0x7448('0x48')]['id']}})['then'](handleEntityNotFound(_0x14acab,null))[_0x7448('0x27')](saveUpdates(_0x1116d1['body'],null))['then'](respondWithResult(_0x14acab,null))[_0x7448('0x46')](handleError(_0x14acab,null));};exports['destroy']=function(_0x49ce4c,_0x471bac){return db[_0x7448('0x2e')][_0x7448('0x4a')]({'where':{'id':_0x49ce4c[_0x7448('0x48')]['id']}})[_0x7448('0x27')](handleEntityNotFound(_0x471bac,null))[_0x7448('0x27')](removeEntity(_0x471bac,null))['catch'](handleError(_0x471bac,null));};exports[_0x7448('0x52')]=function(_0x56b5b5,_0x11cf8d,_0x13deaa){var _0x1eba8b;return db['SquareOdbc']['find']({'where':{'id':_0x56b5b5[_0x7448('0x48')]['id']},'attributes':['id',_0x7448('0x53')]})[_0x7448('0x27')](handleEntityNotFound(_0x11cf8d,null))[_0x7448('0x27')](function(_0x5a8a62){if(_0x5a8a62){var _0x4b5245=require(_0x7448('0x54'))();_0x4b5245[_0x7448('0x55')](_0x5a8a62[_0x7448('0x53')]);_0x4b5245['closeSync']();return _0x5a8a62;}})['then'](respondWithResult(_0x11cf8d,null))[_0x7448('0x46')](handleError(_0x11cf8d,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 461edb0..31a8e6d 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 _0x6003=['../../config/environment','define','SquareOdbc','square_odbc','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x15af0f,_0x5454ce){var _0x2bd1cb=function(_0x593818){while(--_0x593818){_0x15af0f['push'](_0x15af0f['shift']());}};_0x2bd1cb(++_0x5454ce);}(_0x6003,0x72));var _0x3600=function(_0x3a4ace,_0x2b7b0a){_0x3a4ace=_0x3a4ace-0x0;var _0x1939ae=_0x6003[_0x3a4ace];return _0x1939ae;};'use strict';var _=require(_0x3600('0x0'));var util=require(_0x3600('0x1'));var logger=require(_0x3600('0x2'))('api');var moment=require(_0x3600('0x3'));var BPromise=require(_0x3600('0x4'));var rp=require(_0x3600('0x5'));var fs=require('fs');var path=require(_0x3600('0x6'));var rimraf=require('rimraf');var config=require(_0x3600('0x7'));var attributes=require('./squareOdbc.attributes');module['exports']=function(_0x25a266,_0x2b9e06){return _0x25a266[_0x3600('0x8')](_0x3600('0x9'),attributes,{'tableName':_0x3600('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaa92=['./squareOdbc.attributes','exports','SquareOdbc','square_odbc','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0xaa92,0x100));var _0x2aa9=function(_0x34bc94,_0x74f0fd){_0x34bc94=_0x34bc94-0x0;var _0xee41e7=_0xaa92[_0x34bc94];return _0xee41e7;};'use strict';var _=require('lodash');var util=require(_0x2aa9('0x0'));var logger=require(_0x2aa9('0x1'))(_0x2aa9('0x2'));var moment=require(_0x2aa9('0x3'));var BPromise=require('bluebird');var rp=require(_0x2aa9('0x4'));var fs=require('fs');var path=require(_0x2aa9('0x5'));var rimraf=require(_0x2aa9('0x6'));var config=require(_0x2aa9('0x7'));var attributes=require(_0x2aa9('0x8'));module[_0x2aa9('0x9')]=function(_0x5d5076,_0x5f17b7){return _0x5d5076['define'](_0x2aa9('0xa'),attributes,{'tableName':_0x2aa9('0xb'),'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 9d6dc72..e07cd3a 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 _0x48ae=['find','options','where','attributes','map','include','model','catch','lodash','moment','bluebird','randomstring','../../config/utils','rpc','jayson/promise','http','request','info','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SquareOdbc,\x20%s,\x20%s','result','ShowSquareOdbc','SquareOdbc'];(function(_0x11ea6a,_0xc19308){var _0x3ba5c2=function(_0x152eef){while(--_0x152eef){_0x11ea6a['push'](_0x11ea6a['shift']());}};_0x3ba5c2(++_0xc19308);}(_0x48ae,0x147));var _0xe48a=function(_0x37be08,_0x1185ab){_0x37be08=_0x37be08-0x0;var _0xde1424=_0x48ae[_0x37be08];return _0xde1424;};'use strict';var _=require(_0xe48a('0x0'));var util=require('util');var moment=require(_0xe48a('0x1'));var BPromise=require(_0xe48a('0x2'));var rs=require(_0xe48a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe48a('0x4'));var logger=require('../../config/logger')(_0xe48a('0x5'));var config=require('../../config/environment');var jayson=require(_0xe48a('0x6'));var client=jayson['client'][_0xe48a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1c2bf2,_0x2e4179,_0x5b173e){return new BPromise(function(_0x458a1c,_0x4ae12f){return client[_0xe48a('0x8')](_0x1c2bf2,_0x5b173e)['then'](function(_0x40d29a){logger[_0xe48a('0x9')]('SquareOdbc,\x20%s,\x20%s',_0x2e4179,_0xe48a('0xa'));logger[_0xe48a('0xb')](_0xe48a('0xc'),_0x2e4179,_0xe48a('0xa'),JSON[_0xe48a('0xd')](_0x40d29a));if(_0x40d29a[_0xe48a('0xe')]){if(_0x40d29a[_0xe48a('0xe')][_0xe48a('0xf')]===0x1f4){logger[_0xe48a('0xe')]('SquareOdbc,\x20%s,\x20%s',_0x2e4179,_0x40d29a[_0xe48a('0xe')][_0xe48a('0x10')]);return _0x4ae12f(_0x40d29a[_0xe48a('0xe')][_0xe48a('0x10')]);}logger[_0xe48a('0xe')](_0xe48a('0x11'),_0x2e4179,_0x40d29a[_0xe48a('0xe')][_0xe48a('0x10')]);return _0x458a1c(_0x40d29a[_0xe48a('0xe')][_0xe48a('0x10')]);}else{logger[_0xe48a('0x9')](_0xe48a('0x11'),_0x2e4179,'request\x20sent');_0x458a1c(_0x40d29a[_0xe48a('0x12')][_0xe48a('0x10')]);}})['catch'](function(_0x4b76fe){logger['error']('SquareOdbc,\x20%s,\x20%s',_0x2e4179,_0x4b76fe);_0x4ae12f(_0x4b76fe);});});}exports[_0xe48a('0x13')]=function(_0x32a9e6){var _0x233263=this;return new Promise(function(_0xb69424,_0x18171b){return db[_0xe48a('0x14')][_0xe48a('0x15')]({'raw':_0x32a9e6[_0xe48a('0x16')]?_0x32a9e6[_0xe48a('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x32a9e6[_0xe48a('0x16')]?_0x32a9e6[_0xe48a('0x16')][_0xe48a('0x17')]||null:null,'attributes':_0x32a9e6['options']?_0x32a9e6[_0xe48a('0x16')][_0xe48a('0x18')]||null:null,'include':_0x32a9e6[_0xe48a('0x16')]?_0x32a9e6['options']['include']?_[_0xe48a('0x19')](_0x32a9e6[_0xe48a('0x16')][_0xe48a('0x1a')],function(_0x294669){return{'model':db[_0x294669[_0xe48a('0x1b')]],'as':_0x294669['as'],'attributes':_0x294669['attributes'],'include':_0x294669[_0xe48a('0x1a')]?_[_0xe48a('0x19')](_0x294669['include'],function(_0x2aea5e){return{'model':db[_0x2aea5e[_0xe48a('0x1b')]],'as':_0x2aea5e['as'],'attributes':_0x2aea5e[_0xe48a('0x18')],'include':_0x2aea5e['include']?_[_0xe48a('0x19')](_0x2aea5e['include'],function(_0x3f1619){return{'model':db[_0x3f1619[_0xe48a('0x1b')]],'as':_0x3f1619['as'],'attributes':_0x3f1619[_0xe48a('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x38baf2){logger[_0xe48a('0x9')](_0xe48a('0x13'),_0x32a9e6);logger[_0xe48a('0xb')](_0xe48a('0x13'),_0x32a9e6,JSON[_0xe48a('0xd')](_0x38baf2));_0xb69424(_0x38baf2);})[_0xe48a('0x1c')](function(_0x206ed8){logger['error'](_0xe48a('0x13'),_0x206ed8[_0xe48a('0x10')],_0x32a9e6);_0x18171b(_0x233263[_0xe48a('0xe')](0x1f4,_0x206ed8[_0xe48a('0x10')]));});});}; \ No newline at end of file +var _0x2256=['info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','ShowSquareOdbc','SquareOdbc','find','raw','options','where','attributes','map','include','model','catch','lodash','util','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x4c176f,_0x596b41){var _0x30ff66=function(_0x22c62d){while(--_0x22c62d){_0x4c176f['push'](_0x4c176f['shift']());}};_0x30ff66(++_0x596b41);}(_0x2256,0x1e6));var _0x6225=function(_0xcc5058,_0x1944c9){_0xcc5058=_0xcc5058-0x0;var _0x2c2cd2=_0x2256[_0xcc5058];return _0x2c2cd2;};'use strict';var _=require(_0x6225('0x0'));var util=require(_0x6225('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6225('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6225('0x3'))('rpc');var config=require(_0x6225('0x4'));var jayson=require(_0x6225('0x5'));var client=jayson[_0x6225('0x6')][_0x6225('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x371c5c,_0x44e7c9,_0x294438){return new BPromise(function(_0xba9478,_0x43bde9){return client[_0x6225('0x8')](_0x371c5c,_0x294438)[_0x6225('0x9')](function(_0x293ea1){logger[_0x6225('0xa')](_0x6225('0xb'),_0x44e7c9,_0x6225('0xc'));logger[_0x6225('0xd')](_0x6225('0xe'),_0x44e7c9,_0x6225('0xc'),JSON[_0x6225('0xf')](_0x293ea1));if(_0x293ea1['error']){if(_0x293ea1[_0x6225('0x10')][_0x6225('0x11')]===0x1f4){logger[_0x6225('0x10')](_0x6225('0xb'),_0x44e7c9,_0x293ea1['error'][_0x6225('0x12')]);return _0x43bde9(_0x293ea1['error'][_0x6225('0x12')]);}logger[_0x6225('0x10')](_0x6225('0xb'),_0x44e7c9,_0x293ea1[_0x6225('0x10')][_0x6225('0x12')]);return _0xba9478(_0x293ea1[_0x6225('0x10')][_0x6225('0x12')]);}else{logger[_0x6225('0xa')](_0x6225('0xb'),_0x44e7c9,'request\x20sent');_0xba9478(_0x293ea1[_0x6225('0x13')][_0x6225('0x12')]);}})['catch'](function(_0x337bc2){logger[_0x6225('0x10')](_0x6225('0xb'),_0x44e7c9,_0x337bc2);_0x43bde9(_0x337bc2);});});}exports[_0x6225('0x14')]=function(_0x3c1436){var _0x243535=this;return new Promise(function(_0x527d9b,_0x593447){return db[_0x6225('0x15')][_0x6225('0x16')]({'raw':_0x3c1436['options']?_0x3c1436['options'][_0x6225('0x17')]===undefined?!![]:![]:!![],'where':_0x3c1436[_0x6225('0x18')]?_0x3c1436['options'][_0x6225('0x19')]||null:null,'attributes':_0x3c1436['options']?_0x3c1436['options'][_0x6225('0x1a')]||null:null,'include':_0x3c1436[_0x6225('0x18')]?_0x3c1436[_0x6225('0x18')]['include']?_[_0x6225('0x1b')](_0x3c1436[_0x6225('0x18')][_0x6225('0x1c')],function(_0x13b0c5){return{'model':db[_0x13b0c5['model']],'as':_0x13b0c5['as'],'attributes':_0x13b0c5[_0x6225('0x1a')],'include':_0x13b0c5[_0x6225('0x1c')]?_['map'](_0x13b0c5[_0x6225('0x1c')],function(_0x45e477){return{'model':db[_0x45e477[_0x6225('0x1d')]],'as':_0x45e477['as'],'attributes':_0x45e477['attributes'],'include':_0x45e477[_0x6225('0x1c')]?_[_0x6225('0x1b')](_0x45e477[_0x6225('0x1c')],function(_0x5e7b7b){return{'model':db[_0x5e7b7b[_0x6225('0x1d')]],'as':_0x5e7b7b['as'],'attributes':_0x5e7b7b['attributes']};}):[]};}):[]};}):[]:[]})[_0x6225('0x9')](function(_0x35292b){logger[_0x6225('0xa')](_0x6225('0x14'),_0x3c1436);logger[_0x6225('0xd')](_0x6225('0x14'),_0x3c1436,JSON['stringify'](_0x35292b));_0x527d9b(_0x35292b);})[_0x6225('0x1e')](function(_0x561173){logger['error'](_0x6225('0x14'),_0x561173[_0x6225('0x12')],_0x3c1436);_0x593447(_0x243535[_0x6225('0x10')](0x1f4,_0x561173[_0x6225('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index a304230..ea18910 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 _0xaf30=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index','/:id','show','/:id/users','getUsers','post','create','update','delete','destroy','exports','util','connect-timeout'];(function(_0x1a82a4,_0x242160){var _0x4613a4=function(_0x4bdc1a){while(--_0x4bdc1a){_0x1a82a4['push'](_0x1a82a4['shift']());}};_0x4613a4(++_0x242160);}(_0xaf30,0xd0));var _0x0af3=function(_0x2605dc,_0x50cf7e){_0x2605dc=_0x2605dc-0x0;var _0x4568c9=_0xaf30[_0x2605dc];return _0x4568c9;};'use strict';var multer=require('multer');var util=require(_0x0af3('0x0'));var path=require('path');var timeout=require(_0x0af3('0x1'));var express=require(_0x0af3('0x2'));var router=express[_0x0af3('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0af3('0x4'));var interaction=require(_0x0af3('0x5'));var config=require(_0x0af3('0x6'));var controller=require(_0x0af3('0x7'));router[_0x0af3('0x8')]('/',auth[_0x0af3('0x9')](),controller[_0x0af3('0xa')]);router[_0x0af3('0x8')](_0x0af3('0xb'),auth[_0x0af3('0x9')](),controller[_0x0af3('0xc')]);router[_0x0af3('0x8')](_0x0af3('0xd'),auth[_0x0af3('0x9')](),controller[_0x0af3('0xe')]);router[_0x0af3('0xf')]('/',auth[_0x0af3('0x9')](),controller[_0x0af3('0x10')]);router[_0x0af3('0xf')](_0x0af3('0xd'),auth['isAuthenticated'](),controller['addUsers']);router['put'](_0x0af3('0xb'),auth[_0x0af3('0x9')](),controller[_0x0af3('0x11')]);router[_0x0af3('0x12')](_0x0af3('0xb'),auth['isAuthenticated'](),controller[_0x0af3('0x13')]);router[_0x0af3('0x12')](_0x0af3('0xd'),auth['isAuthenticated'](),controller['removeUsers']);module[_0x0af3('0x14')]=router; \ No newline at end of file +var _0x15da=['/:id','update','delete','removeUsers','exports','util','path','Router','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index','show','/:id/users','getUsers','post','create','addUsers','put'];(function(_0x44366b,_0x5330d7){var _0x1ab354=function(_0x50ef6a){while(--_0x50ef6a){_0x44366b['push'](_0x44366b['shift']());}};_0x1ab354(++_0x5330d7);}(_0x15da,0x98));var _0xa15d=function(_0x43139e,_0x762629){_0x43139e=_0x43139e-0x0;var _0x2bc838=_0x15da[_0x43139e];return _0x2bc838;};'use strict';var multer=require('multer');var util=require(_0xa15d('0x0'));var path=require(_0xa15d('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa15d('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xa15d('0x3'));var config=require(_0xa15d('0x4'));var controller=require(_0xa15d('0x5'));router[_0xa15d('0x6')]('/',auth[_0xa15d('0x7')](),controller[_0xa15d('0x8')]);router[_0xa15d('0x6')]('/:id',auth[_0xa15d('0x7')](),controller[_0xa15d('0x9')]);router[_0xa15d('0x6')](_0xa15d('0xa'),auth[_0xa15d('0x7')](),controller[_0xa15d('0xb')]);router[_0xa15d('0xc')]('/',auth[_0xa15d('0x7')](),controller[_0xa15d('0xd')]);router[_0xa15d('0xc')]('/:id/users',auth[_0xa15d('0x7')](),controller[_0xa15d('0xe')]);router[_0xa15d('0xf')](_0xa15d('0x10'),auth[_0xa15d('0x7')](),controller[_0xa15d('0x11')]);router['delete']('/:id',auth[_0xa15d('0x7')](),controller['destroy']);router[_0xa15d('0x12')]('/:id/users',auth['isAuthenticated'](),controller[_0xa15d('0x13')]);module[_0xa15d('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 9306da1..2473980 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 _0x74d3=['getDataValue','toString','utf8','production','DATE','sequelize','exports','STRING','BLOB','long'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x74d3,0x159));var _0x374d=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0x74d3[_0x4ff09b];return _0x3f5c2e;};'use strict';var Sequelize=require(_0x374d('0x0'));module[_0x374d('0x1')]={'name':{'type':Sequelize[_0x374d('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x374d('0x2')]},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0x374d('0x3')](_0x374d('0x4')),'get':function(){if(this[_0x374d('0x5')]('preproduction')){return this[_0x374d('0x5')]('preproduction')[_0x374d('0x6')](_0x374d('0x7'));}}},'production':{'type':Sequelize[_0x374d('0x3')]('long'),'get':function(){if(this[_0x374d('0x5')](_0x374d('0x8'))){return this[_0x374d('0x5')]('production')['toString'](_0x374d('0x7'));}}},'savedAt':{'type':Sequelize[_0x374d('0x9')]},'publishedAt':{'type':Sequelize[_0x374d('0x9')]}}; \ No newline at end of file +var _0x2317=['toString','DATE','exports','STRING','TEXT','BLOB','getDataValue','preproduction','utf8','long','production'];(function(_0x31873d,_0x1f0849){var _0x516992=function(_0x434dfd){while(--_0x434dfd){_0x31873d['push'](_0x31873d['shift']());}};_0x516992(++_0x1f0849);}(_0x2317,0x16d));var _0x7231=function(_0x354970,_0x1187f4){_0x354970=_0x354970-0x0;var _0x54e9d2=_0x2317[_0x354970];return _0x54e9d2;};'use strict';var Sequelize=require('sequelize');module[_0x7231('0x0')]={'name':{'type':Sequelize[_0x7231('0x1')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x7231('0x1')]},'notes':{'type':Sequelize[_0x7231('0x2')]},'preproduction':{'type':Sequelize[_0x7231('0x3')]('long'),'get':function(){if(this[_0x7231('0x4')]('preproduction')){return this[_0x7231('0x4')](_0x7231('0x5'))['toString'](_0x7231('0x6'));}}},'production':{'type':Sequelize[_0x7231('0x3')](_0x7231('0x7')),'get':function(){if(this[_0x7231('0x4')]('production')){return this[_0x7231('0x4')](_0x7231('0x8'))[_0x7231('0x9')](_0x7231('0x6'));}}},'savedAt':{'type':Sequelize['DATE']},'publishedAt':{'type':Sequelize[_0x7231('0xa')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 7312eb1..40de793 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 _0xf27b=['Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','addUsers','ids','omit','removeUsers','userSquareProject:remove','emit','getUsers','User','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','destroy','SquareProjects','UserProfileResource','then','error','stack','name','send','index','map','SquareProject','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','length','find','create','user'];(function(_0x431979,_0x2b3eb6){var _0x731032=function(_0x5929a8){while(--_0x5929a8){_0x431979['push'](_0x431979['shift']());}};_0x731032(++_0x2b3eb6);}(_0xf27b,0x19c));var _0xbf27=function(_0x56a871,_0x18b7fe){_0x56a871=_0x56a871-0x0;var _0x124954=_0xf27b[_0x56a871];return _0x124954;};'use strict';var emlformat=require(_0xbf27('0x0'));var rimraf=require(_0xbf27('0x1'));var zipdir=require(_0xbf27('0x2'));var jsonpatch=require(_0xbf27('0x3'));var rp=require(_0xbf27('0x4'));var moment=require(_0xbf27('0x5'));var BPromise=require(_0xbf27('0x6'));var Mustache=require(_0xbf27('0x7'));var util=require(_0xbf27('0x8'));var path=require(_0xbf27('0x9'));var sox=require(_0xbf27('0xa'));var csv=require(_0xbf27('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbf27('0xc'));var squel=require(_0xbf27('0xd'));var crypto=require(_0xbf27('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xbf27('0xf'));var toCsv=require(_0xbf27('0xb'));var querystring=require(_0xbf27('0x10'));var Papa=require(_0xbf27('0x11'));var Redis=require(_0xbf27('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xbf27('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xbf27('0x14'));var config=require(_0xbf27('0x15'));var licenseUtil=require(_0xbf27('0x16'));var db=require('../../mysqldb')['db'];config[_0xbf27('0x17')]=_[_0xbf27('0x18')](config['redis'],{'host':_0xbf27('0x19'),'port':0x18eb});var socket=require(_0xbf27('0x1a'))(new Redis(config[_0xbf27('0x17')]));require(_0xbf27('0x1b'))[_0xbf27('0x1c')](socket);function respondWithStatusCode(_0x4fcc0d,_0x15e1a3){_0x15e1a3=_0x15e1a3||0xcc;return function(_0x2c3481){if(_0x2c3481){return _0x4fcc0d[_0xbf27('0x1d')](_0x15e1a3);}return _0x4fcc0d['status'](_0x15e1a3)[_0xbf27('0x1e')]();};}function respondWithResult(_0x4c4ee1,_0x347f6e){_0x347f6e=_0x347f6e||0xc8;return function(_0x2de75f){if(_0x2de75f){return _0x4c4ee1[_0xbf27('0x1f')](_0x347f6e)[_0xbf27('0x20')](_0x2de75f);}};}function respondWithFilteredResult(_0x41dfac,_0x6bf1e6){return function(_0xd06853){if(_0xd06853){var _0x3825e5=typeof _0x6bf1e6[_0xbf27('0x21')]===_0xbf27('0x22')&&typeof _0x6bf1e6[_0xbf27('0x23')]===_0xbf27('0x22');var _0x2afcd1=_0xd06853[_0xbf27('0x24')];var _0x1ccfde=_0x3825e5?0x0:_0x6bf1e6[_0xbf27('0x21')];var _0x79220f=_0x3825e5?_0xd06853[_0xbf27('0x24')]:_0x6bf1e6[_0xbf27('0x21')]+_0x6bf1e6[_0xbf27('0x23')];var _0xdf02d3;if(_0x79220f>=_0x2afcd1){_0x79220f=_0x2afcd1;_0xdf02d3=0xc8;}else{_0xdf02d3=0xce;}_0x41dfac['status'](_0xdf02d3);return _0x41dfac[_0xbf27('0x25')](_0xbf27('0x26'),_0x1ccfde+'-'+_0x79220f+'/'+_0x2afcd1)[_0xbf27('0x20')](_0xd06853);}return null;};}function patchUpdates(_0x205f79){return function(_0x536ec8){try{jsonpatch['apply'](_0x536ec8,_0x205f79,!![]);}catch(_0x3eb177){return BPromise[_0xbf27('0x27')](_0x3eb177);}return _0x536ec8[_0xbf27('0x28')]();};}function saveUpdates(_0x551076,_0x55fa9b){return function(_0x4ce198){if(_0x4ce198){return _0x4ce198['update'](_0x551076)['then'](function(_0x23b85b){return _0x23b85b;});}return null;};}function removeEntity(_0x4d8c6a,_0x982a39){return function(_0x237a6f){if(_0x237a6f){return _0x237a6f[_0xbf27('0x29')]()['then'](function(){var _0x9018fa=_0x237a6f['get']({'plain':!![]});var _0x32451f=_0xbf27('0x2a');return db[_0xbf27('0x2b')][_0xbf27('0x29')]({'where':{'type':_0x32451f,'resourceId':_0x9018fa['id']}})['then'](function(){return _0x237a6f;});})[_0xbf27('0x2c')](function(){_0x4d8c6a[_0xbf27('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x391514,_0x401ae4){return function(_0x2159c4){if(!_0x2159c4){_0x391514[_0xbf27('0x1d')](0x194);}return _0x2159c4;};}function handleError(_0x1fe74c,_0x4badd1){_0x4badd1=_0x4badd1||0x1f4;return function(_0x59731a){logger[_0xbf27('0x2d')](_0x59731a[_0xbf27('0x2e')]);if(_0x59731a[_0xbf27('0x2f')]){delete _0x59731a[_0xbf27('0x2f')];}_0x1fe74c['status'](_0x4badd1)[_0xbf27('0x30')](_0x59731a);};}exports[_0xbf27('0x31')]=function(_0x38e168,_0x2c63a0){var _0x8b6d9f={},_0x22030d={},_0x1e2280={'count':0x0,'rows':[]};var _0x362f05=_[_0xbf27('0x32')](db[_0xbf27('0x33')][_0xbf27('0x34')],function(_0x5a960f){return{'name':_0x5a960f[_0xbf27('0x35')],'type':_0x5a960f[_0xbf27('0x36')][_0xbf27('0x37')]};});_0x22030d[_0xbf27('0x38')]=_[_0xbf27('0x32')](_0x362f05,_0xbf27('0x2f'));_0x22030d[_0xbf27('0x39')]=_[_0xbf27('0x3a')](_0x38e168[_0xbf27('0x39')]);_0x22030d[_0xbf27('0x3b')]=_[_0xbf27('0x3c')](_0x22030d[_0xbf27('0x38')],_0x22030d[_0xbf27('0x39')]);_0x8b6d9f['attributes']=_[_0xbf27('0x3c')](_0x22030d[_0xbf27('0x38')],qs['fields'](_0x38e168[_0xbf27('0x39')][_0xbf27('0x3d')]));_0x8b6d9f[_0xbf27('0x3e')]=_0x8b6d9f[_0xbf27('0x3e')]['length']?_0x8b6d9f[_0xbf27('0x3e')]:_0x22030d['model'];if(!_0x38e168['query'][_0xbf27('0x3f')](_0xbf27('0x40'))){_0x8b6d9f[_0xbf27('0x23')]=qs[_0xbf27('0x23')](_0x38e168[_0xbf27('0x39')]['limit']);_0x8b6d9f[_0xbf27('0x21')]=qs[_0xbf27('0x21')](_0x38e168[_0xbf27('0x39')]['offset']);}_0x8b6d9f[_0xbf27('0x41')]=qs[_0xbf27('0x42')](_0x38e168[_0xbf27('0x39')][_0xbf27('0x42')]);_0x8b6d9f[_0xbf27('0x43')]=qs['filters'](_[_0xbf27('0x44')](_0x38e168[_0xbf27('0x39')],_0x22030d[_0xbf27('0x3b')]),_0x362f05);if(_0x38e168[_0xbf27('0x39')][_0xbf27('0x45')]){_0x8b6d9f[_0xbf27('0x43')]=_[_0xbf27('0x46')](_0x8b6d9f['where'],{'$or':_['map'](_0x362f05,function(_0x539f0c){if(_0x539f0c[_0xbf27('0x36')]!==_0xbf27('0x47')){var _0xb2194={};_0xb2194[_0x539f0c['name']]={'$like':'%'+_0x38e168[_0xbf27('0x39')]['filter']+'%'};return _0xb2194;}})});}_0x8b6d9f=_[_0xbf27('0x46')]({},_0x8b6d9f,_0x38e168[_0xbf27('0x48')]);var _0x34460c={'where':_0x8b6d9f[_0xbf27('0x43')]};return db[_0xbf27('0x33')][_0xbf27('0x24')](_0x34460c)[_0xbf27('0x2c')](function(_0x168ae6){_0x1e2280[_0xbf27('0x24')]=_0x168ae6;if(_0x38e168['query'][_0xbf27('0x49')]){_0x8b6d9f[_0xbf27('0x4a')]=[{'all':!![]}];}return db[_0xbf27('0x33')][_0xbf27('0x4b')](_0x8b6d9f);})['then'](function(_0x524593){_0x1e2280['rows']=_0x524593;return _0x1e2280;})[_0xbf27('0x2c')](respondWithFilteredResult(_0x2c63a0,_0x8b6d9f))[_0xbf27('0x4c')](handleError(_0x2c63a0,null));};exports[_0xbf27('0x4d')]=function(_0x2d6c33,_0x9d4773){var _0x267dee={'raw':![],'where':{'id':_0x2d6c33[_0xbf27('0x4e')]['id']}},_0xe76b4d={};_0xe76b4d[_0xbf27('0x38')]=_['keys'](db[_0xbf27('0x33')][_0xbf27('0x34')]);_0xe76b4d[_0xbf27('0x39')]=_[_0xbf27('0x3a')](_0x2d6c33[_0xbf27('0x39')]);_0xe76b4d['filters']=_[_0xbf27('0x3c')](_0xe76b4d['model'],_0xe76b4d[_0xbf27('0x39')]);_0x267dee[_0xbf27('0x3e')]=_['intersection'](_0xe76b4d[_0xbf27('0x38')],qs[_0xbf27('0x3d')](_0x2d6c33[_0xbf27('0x39')][_0xbf27('0x3d')]));_0x267dee['attributes']=_0x267dee[_0xbf27('0x3e')][_0xbf27('0x4f')]?_0x267dee[_0xbf27('0x3e')]:_0xe76b4d['model'];if(_0x2d6c33[_0xbf27('0x39')][_0xbf27('0x49')]){_0x267dee[_0xbf27('0x4a')]=[{'all':!![]}];}_0x267dee=_[_0xbf27('0x46')]({},_0x267dee,_0x2d6c33[_0xbf27('0x48')]);return db[_0xbf27('0x33')][_0xbf27('0x50')](_0x267dee)['then'](handleEntityNotFound(_0x9d4773,null))['then'](respondWithResult(_0x9d4773,null))[_0xbf27('0x4c')](handleError(_0x9d4773,null));};exports[_0xbf27('0x51')]=function(_0x925288,_0x3d6c34){return db[_0xbf27('0x33')][_0xbf27('0x51')](_0x925288['body'],{})[_0xbf27('0x2c')](function(_0x4f9bf2){var _0x9781a0=_0x925288[_0xbf27('0x52')]['get']({'plain':!![]});if(!_0x9781a0)throw new Error(_0xbf27('0x53'));if(_0x9781a0['role']==='user'){var _0x4c57c7=_0x4f9bf2[_0xbf27('0x54')]({'plain':!![]});var _0xaf6348=_0xbf27('0x2a');return db[_0xbf27('0x55')][_0xbf27('0x50')]({'where':{'name':_0xaf6348,'userProfileId':_0x9781a0[_0xbf27('0x56')]},'raw':!![]})['then'](function(_0x1ecffb){if(_0x1ecffb&&_0x1ecffb[_0xbf27('0x57')]===0x0){return db[_0xbf27('0x2b')][_0xbf27('0x51')]({'name':_0x4c57c7[_0xbf27('0x2f')],'resourceId':_0x4c57c7['id'],'type':_0x1ecffb['name'],'sectionId':_0x1ecffb['id']},{})[_0xbf27('0x2c')](function(){return _0x4f9bf2;});}else{return _0x4f9bf2;}})[_0xbf27('0x4c')](function(_0x1e0f83){logger[_0xbf27('0x2d')](_0xbf27('0x58'),_0x1e0f83);throw _0x1e0f83;});}return _0x4f9bf2;})[_0xbf27('0x2c')](respondWithResult(_0x3d6c34,0xc9))[_0xbf27('0x4c')](handleError(_0x3d6c34,null));};exports[_0xbf27('0x59')]=function(_0x10fd06,_0x2e1ba3){if(_0x10fd06[_0xbf27('0x5a')]['id']){delete _0x10fd06[_0xbf27('0x5a')]['id'];}return db['SquareProject'][_0xbf27('0x50')]({'where':{'id':_0x10fd06[_0xbf27('0x4e')]['id']}})[_0xbf27('0x2c')](handleEntityNotFound(_0x2e1ba3,null))['then'](saveUpdates(_0x10fd06['body'],null))[_0xbf27('0x2c')](respondWithResult(_0x2e1ba3,null))[_0xbf27('0x4c')](handleError(_0x2e1ba3,null));};exports[_0xbf27('0x29')]=function(_0x11c0d3,_0x579ddb){return db[_0xbf27('0x33')][_0xbf27('0x50')]({'where':{'id':_0x11c0d3[_0xbf27('0x4e')]['id']}})[_0xbf27('0x2c')](handleEntityNotFound(_0x579ddb,null))[_0xbf27('0x2c')](removeEntity(_0x579ddb,null))[_0xbf27('0x4c')](handleError(_0x579ddb,null));};exports[_0xbf27('0x5b')]=function(_0xca092a,_0x2b9dcb,_0x388b85){return db['SquareProject'][_0xbf27('0x50')]({'where':{'id':_0xca092a[_0xbf27('0x4e')]['id']}})[_0xbf27('0x2c')](handleEntityNotFound(_0x2b9dcb,null))[_0xbf27('0x2c')](function(_0x2f30a1){if(_0x2f30a1){return _0x2f30a1['addUsers'](_0xca092a[_0xbf27('0x5a')][_0xbf27('0x5c')],_[_0xbf27('0x5d')](_0xca092a[_0xbf27('0x5a')],[_0xbf27('0x5c'),'id'])||{});}})['then'](respondWithResult(_0x2b9dcb,null))['catch'](handleError(_0x2b9dcb,null));};exports[_0xbf27('0x5e')]=function(_0x3b3df7,_0x1c0db2,_0x2f0f5a){return db[_0xbf27('0x33')][_0xbf27('0x50')]({'where':{'id':_0x3b3df7[_0xbf27('0x4e')]['id']}})[_0xbf27('0x2c')](handleEntityNotFound(_0x1c0db2,null))[_0xbf27('0x2c')](function(_0x3babae){if(_0x3babae){return _0x3babae[_0xbf27('0x5e')](_0x3b3df7['query']['ids'])['then'](function(){if(_['isArray'](_0x3b3df7['query'][_0xbf27('0x5c')])){for(var _0x2c1aeb=0x0;_0x2c1aeb<_0x3b3df7[_0xbf27('0x39')][_0xbf27('0x5c')]['length'];_0x2c1aeb+=0x1){socket['emit'](_0xbf27('0x5f'),{'UserId':Number(_0x3b3df7[_0xbf27('0x39')][_0xbf27('0x5c')][_0x2c1aeb]),'SquareProjectId':Number(_0x3b3df7[_0xbf27('0x4e')]['id'])});}}else{socket[_0xbf27('0x60')](_0xbf27('0x5f'),{'UserId':Number(_0x3b3df7[_0xbf27('0x39')][_0xbf27('0x5c')]),'SquareProjectId':Number(_0x3b3df7['params']['id'])});}});}})[_0xbf27('0x2c')](respondWithStatusCode(_0x1c0db2,null))[_0xbf27('0x4c')](handleError(_0x1c0db2,null));};exports[_0xbf27('0x61')]=function(_0x5a5772,_0x5a73ad,_0xfcd544){var _0x5839bf={};var _0x5b9efb={};var _0x400054;var _0x5334bb;return db['SquareProject']['findOne']({'where':{'id':_0x5a5772['params']['id']}})[_0xbf27('0x2c')](handleEntityNotFound(_0x5a73ad,null))[_0xbf27('0x2c')](function(_0x5cd48c){if(_0x5cd48c){_0x400054=_0x5cd48c;_0x5b9efb[_0xbf27('0x38')]=_['keys'](db[_0xbf27('0x62')]['rawAttributes']);_0x5b9efb['query']=_[_0xbf27('0x3a')](_0x5a5772[_0xbf27('0x39')]);_0x5b9efb[_0xbf27('0x3b')]=_[_0xbf27('0x3c')](_0x5b9efb[_0xbf27('0x38')],_0x5b9efb[_0xbf27('0x39')]);_0x5839bf[_0xbf27('0x3e')]=_[_0xbf27('0x3c')](_0x5b9efb[_0xbf27('0x38')],qs[_0xbf27('0x3d')](_0x5a5772[_0xbf27('0x39')]['fields']));_0x5839bf[_0xbf27('0x3e')]=_0x5839bf['attributes'][_0xbf27('0x4f')]?_0x5839bf[_0xbf27('0x3e')]:_0x5b9efb[_0xbf27('0x38')];_0x5839bf[_0xbf27('0x41')]=qs[_0xbf27('0x42')](_0x5a5772[_0xbf27('0x39')][_0xbf27('0x42')]);_0x5839bf[_0xbf27('0x43')]=qs[_0xbf27('0x3b')](_['pick'](_0x5a5772[_0xbf27('0x39')],_0x5b9efb[_0xbf27('0x3b')]));if(_0x5a5772[_0xbf27('0x39')][_0xbf27('0x45')]){_0x5839bf[_0xbf27('0x43')]=_['merge'](_0x5839bf[_0xbf27('0x43')],{'$or':_['map'](_0x5839bf[_0xbf27('0x3e')],function(_0x391329){var _0x4fd9c0={};_0x4fd9c0[_0x391329]={'$like':'%'+_0x5a5772[_0xbf27('0x39')][_0xbf27('0x45')]+'%'};return _0x4fd9c0;})});}_0x5839bf=_[_0xbf27('0x46')]({},_0x5839bf,_0x5a5772['options']);return _0x400054[_0xbf27('0x61')](_0x5839bf);}})[_0xbf27('0x2c')](function(_0x578f5a){if(_0x578f5a){_0x5334bb=_0x578f5a[_0xbf27('0x4f')];if(!_0x5a5772[_0xbf27('0x39')][_0xbf27('0x3f')](_0xbf27('0x40'))){_0x5839bf[_0xbf27('0x23')]=qs[_0xbf27('0x23')](_0x5a5772[_0xbf27('0x39')][_0xbf27('0x23')]);_0x5839bf[_0xbf27('0x21')]=qs[_0xbf27('0x21')](_0x5a5772[_0xbf27('0x39')]['offset']);}return _0x400054[_0xbf27('0x61')](_0x5839bf);}})['then'](function(_0x2ad43d){if(_0x2ad43d){return _0x2ad43d?{'count':_0x5334bb,'rows':_0x2ad43d}:null;}})[_0xbf27('0x2c')](respondWithResult(_0x5a73ad,null))[_0xbf27('0x4c')](handleError(_0x5a73ad,null));}; \ No newline at end of file +var _0x30c6=['create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','addUsers','ids','omit','removeUsers','isArray','emit','userSquareProject:remove','getUsers','findOne','sort','filter','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./squareProject.socket','sendStatus','status','end','json','undefined','count','set','apply','reject','save','update','then','get','SquareProjects','UserProfileResource','destroy','error','stack','name','send','index','SquareProject','rawAttributes','fieldName','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','order','where','pick','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','length'];(function(_0x560238,_0x9cc05){var _0x40ef6f=function(_0x7e2b72){while(--_0x7e2b72){_0x560238['push'](_0x560238['shift']());}};_0x40ef6f(++_0x9cc05);}(_0x30c6,0x13b));var _0x630c=function(_0x29e097,_0x204fb5){_0x29e097=_0x29e097-0x0;var _0x24c620=_0x30c6[_0x29e097];return _0x24c620;};'use strict';var emlformat=require(_0x630c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x630c('0x1'));var jsonpatch=require(_0x630c('0x2'));var rp=require(_0x630c('0x3'));var moment=require(_0x630c('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x630c('0x5'));var path=require('path');var sox=require(_0x630c('0x6'));var csv=require('to-csv');var ejs=require(_0x630c('0x7'));var fs=require('fs');var fs_extra=require(_0x630c('0x8'));var _=require('lodash');var squel=require(_0x630c('0x9'));var crypto=require(_0x630c('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x630c('0xb'));var toCsv=require(_0x630c('0xc'));var querystring=require(_0x630c('0xd'));var Papa=require(_0x630c('0xe'));var Redis=require(_0x630c('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x630c('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x630c('0x11'));var utils=require('../../config/utils');var config=require(_0x630c('0x12'));var licenseUtil=require(_0x630c('0x13'));var db=require(_0x630c('0x14'))['db'];config['redis']=_[_0x630c('0x15')](config[_0x630c('0x16')],{'host':_0x630c('0x17'),'port':0x18eb});var socket=require(_0x630c('0x18'))(new Redis(config['redis']));require(_0x630c('0x19'))['register'](socket);function respondWithStatusCode(_0x116141,_0x5587a2){_0x5587a2=_0x5587a2||0xcc;return function(_0x244495){if(_0x244495){return _0x116141[_0x630c('0x1a')](_0x5587a2);}return _0x116141[_0x630c('0x1b')](_0x5587a2)[_0x630c('0x1c')]();};}function respondWithResult(_0x1cbfc9,_0x42f523){_0x42f523=_0x42f523||0xc8;return function(_0x4ee9cf){if(_0x4ee9cf){return _0x1cbfc9[_0x630c('0x1b')](_0x42f523)[_0x630c('0x1d')](_0x4ee9cf);}};}function respondWithFilteredResult(_0x47255c,_0x176185){return function(_0x5f13a7){if(_0x5f13a7){var _0x59bddb=typeof _0x176185['offset']===_0x630c('0x1e')&&typeof _0x176185['limit']==='undefined';var _0x691c43=_0x5f13a7[_0x630c('0x1f')];var _0x14830f=_0x59bddb?0x0:_0x176185['offset'];var _0x1d8681=_0x59bddb?_0x5f13a7[_0x630c('0x1f')]:_0x176185['offset']+_0x176185['limit'];var _0x6a311e;if(_0x1d8681>=_0x691c43){_0x1d8681=_0x691c43;_0x6a311e=0xc8;}else{_0x6a311e=0xce;}_0x47255c['status'](_0x6a311e);return _0x47255c[_0x630c('0x20')]('Content-Range',_0x14830f+'-'+_0x1d8681+'/'+_0x691c43)['json'](_0x5f13a7);}return null;};}function patchUpdates(_0x185dd7){return function(_0x40190a){try{jsonpatch[_0x630c('0x21')](_0x40190a,_0x185dd7,!![]);}catch(_0x280498){return BPromise[_0x630c('0x22')](_0x280498);}return _0x40190a[_0x630c('0x23')]();};}function saveUpdates(_0x5abd63,_0x4521e7){return function(_0x6760c6){if(_0x6760c6){return _0x6760c6[_0x630c('0x24')](_0x5abd63)['then'](function(_0x2dab07){return _0x2dab07;});}return null;};}function removeEntity(_0x37b2f0,_0x71f12f){return function(_0x47b6cb){if(_0x47b6cb){return _0x47b6cb['destroy']()[_0x630c('0x25')](function(){var _0x142846=_0x47b6cb[_0x630c('0x26')]({'plain':!![]});var _0x5c56d9=_0x630c('0x27');return db[_0x630c('0x28')][_0x630c('0x29')]({'where':{'type':_0x5c56d9,'resourceId':_0x142846['id']}})[_0x630c('0x25')](function(){return _0x47b6cb;});})[_0x630c('0x25')](function(){_0x37b2f0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x567500,_0xddd567){return function(_0x2f5256){if(!_0x2f5256){_0x567500[_0x630c('0x1a')](0x194);}return _0x2f5256;};}function handleError(_0x1011c4,_0x246916){_0x246916=_0x246916||0x1f4;return function(_0x3d366b){logger[_0x630c('0x2a')](_0x3d366b[_0x630c('0x2b')]);if(_0x3d366b[_0x630c('0x2c')]){delete _0x3d366b[_0x630c('0x2c')];}_0x1011c4[_0x630c('0x1b')](_0x246916)[_0x630c('0x2d')](_0x3d366b);};}exports[_0x630c('0x2e')]=function(_0x3ed6cd,_0x6b93b8){var _0x3bab49={},_0x66e89e={},_0x5a52da={'count':0x0,'rows':[]};var _0x63ac=_['map'](db[_0x630c('0x2f')][_0x630c('0x30')],function(_0x2d6a6f){return{'name':_0x2d6a6f[_0x630c('0x31')],'type':_0x2d6a6f['type'][_0x630c('0x32')]};});_0x66e89e[_0x630c('0x33')]=_[_0x630c('0x34')](_0x63ac,_0x630c('0x2c'));_0x66e89e[_0x630c('0x35')]=_['keys'](_0x3ed6cd['query']);_0x66e89e[_0x630c('0x36')]=_[_0x630c('0x37')](_0x66e89e[_0x630c('0x33')],_0x66e89e[_0x630c('0x35')]);_0x3bab49[_0x630c('0x38')]=_[_0x630c('0x37')](_0x66e89e[_0x630c('0x33')],qs[_0x630c('0x39')](_0x3ed6cd[_0x630c('0x35')]['fields']));_0x3bab49[_0x630c('0x38')]=_0x3bab49[_0x630c('0x38')]['length']?_0x3bab49['attributes']:_0x66e89e['model'];if(!_0x3ed6cd[_0x630c('0x35')][_0x630c('0x3a')](_0x630c('0x3b'))){_0x3bab49['limit']=qs[_0x630c('0x3c')](_0x3ed6cd[_0x630c('0x35')]['limit']);_0x3bab49['offset']=qs['offset'](_0x3ed6cd['query'][_0x630c('0x3d')]);}_0x3bab49[_0x630c('0x3e')]=qs['sort'](_0x3ed6cd[_0x630c('0x35')]['sort']);_0x3bab49[_0x630c('0x3f')]=qs[_0x630c('0x36')](_[_0x630c('0x40')](_0x3ed6cd[_0x630c('0x35')],_0x66e89e[_0x630c('0x36')]),_0x63ac);if(_0x3ed6cd[_0x630c('0x35')]['filter']){_0x3bab49['where']=_[_0x630c('0x41')](_0x3bab49[_0x630c('0x3f')],{'$or':_[_0x630c('0x34')](_0x63ac,function(_0xc6b03f){if(_0xc6b03f[_0x630c('0x42')]!==_0x630c('0x43')){var _0x5b15a5={};_0x5b15a5[_0xc6b03f[_0x630c('0x2c')]]={'$like':'%'+_0x3ed6cd[_0x630c('0x35')]['filter']+'%'};return _0x5b15a5;}})});}_0x3bab49=_[_0x630c('0x41')]({},_0x3bab49,_0x3ed6cd[_0x630c('0x44')]);var _0x32d95c={'where':_0x3bab49[_0x630c('0x3f')]};return db[_0x630c('0x2f')][_0x630c('0x1f')](_0x32d95c)[_0x630c('0x25')](function(_0xbbf4aa){_0x5a52da['count']=_0xbbf4aa;if(_0x3ed6cd[_0x630c('0x35')][_0x630c('0x45')]){_0x3bab49[_0x630c('0x46')]=[{'all':!![]}];}return db[_0x630c('0x2f')][_0x630c('0x47')](_0x3bab49);})[_0x630c('0x25')](function(_0x1b54f3){_0x5a52da['rows']=_0x1b54f3;return _0x5a52da;})['then'](respondWithFilteredResult(_0x6b93b8,_0x3bab49))[_0x630c('0x48')](handleError(_0x6b93b8,null));};exports[_0x630c('0x49')]=function(_0xfbf58d,_0x31beba){var _0x3b2254={'raw':![],'where':{'id':_0xfbf58d[_0x630c('0x4a')]['id']}},_0x1e0725={};_0x1e0725[_0x630c('0x33')]=_[_0x630c('0x4b')](db[_0x630c('0x2f')][_0x630c('0x30')]);_0x1e0725[_0x630c('0x35')]=_[_0x630c('0x4b')](_0xfbf58d[_0x630c('0x35')]);_0x1e0725[_0x630c('0x36')]=_[_0x630c('0x37')](_0x1e0725[_0x630c('0x33')],_0x1e0725[_0x630c('0x35')]);_0x3b2254[_0x630c('0x38')]=_[_0x630c('0x37')](_0x1e0725['model'],qs[_0x630c('0x39')](_0xfbf58d[_0x630c('0x35')][_0x630c('0x39')]));_0x3b2254[_0x630c('0x38')]=_0x3b2254[_0x630c('0x38')][_0x630c('0x4c')]?_0x3b2254[_0x630c('0x38')]:_0x1e0725[_0x630c('0x33')];if(_0xfbf58d[_0x630c('0x35')][_0x630c('0x45')]){_0x3b2254[_0x630c('0x46')]=[{'all':!![]}];}_0x3b2254=_['merge']({},_0x3b2254,_0xfbf58d[_0x630c('0x44')]);return db[_0x630c('0x2f')]['find'](_0x3b2254)[_0x630c('0x25')](handleEntityNotFound(_0x31beba,null))[_0x630c('0x25')](respondWithResult(_0x31beba,null))[_0x630c('0x48')](handleError(_0x31beba,null));};exports[_0x630c('0x4d')]=function(_0x23597f,_0x426bcb){return db['SquareProject'][_0x630c('0x4d')](_0x23597f['body'],{})['then'](function(_0x2427c1){var _0x4c75aa=_0x23597f[_0x630c('0x4e')][_0x630c('0x26')]({'plain':!![]});if(!_0x4c75aa)throw new Error(_0x630c('0x4f'));if(_0x4c75aa[_0x630c('0x50')]==='user'){var _0xb5907a=_0x2427c1[_0x630c('0x26')]({'plain':!![]});var _0x313135=_0x630c('0x27');return db[_0x630c('0x51')]['find']({'where':{'name':_0x313135,'userProfileId':_0x4c75aa[_0x630c('0x52')]},'raw':!![]})[_0x630c('0x25')](function(_0x38516a){if(_0x38516a&&_0x38516a[_0x630c('0x53')]===0x0){return db[_0x630c('0x28')][_0x630c('0x4d')]({'name':_0xb5907a[_0x630c('0x2c')],'resourceId':_0xb5907a['id'],'type':_0x38516a[_0x630c('0x2c')],'sectionId':_0x38516a['id']},{})['then'](function(){return _0x2427c1;});}else{return _0x2427c1;}})['catch'](function(_0x3e5352){logger['error'](_0x630c('0x54'),_0x3e5352);throw _0x3e5352;});}return _0x2427c1;})[_0x630c('0x25')](respondWithResult(_0x426bcb,0xc9))[_0x630c('0x48')](handleError(_0x426bcb,null));};exports[_0x630c('0x24')]=function(_0x256cec,_0x2fd02a){if(_0x256cec['body']['id']){delete _0x256cec[_0x630c('0x55')]['id'];}return db['SquareProject'][_0x630c('0x56')]({'where':{'id':_0x256cec[_0x630c('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2fd02a,null))[_0x630c('0x25')](saveUpdates(_0x256cec[_0x630c('0x55')],null))['then'](respondWithResult(_0x2fd02a,null))[_0x630c('0x48')](handleError(_0x2fd02a,null));};exports[_0x630c('0x29')]=function(_0x4c5346,_0xfc87ff){return db[_0x630c('0x2f')][_0x630c('0x56')]({'where':{'id':_0x4c5346[_0x630c('0x4a')]['id']}})[_0x630c('0x25')](handleEntityNotFound(_0xfc87ff,null))[_0x630c('0x25')](removeEntity(_0xfc87ff,null))[_0x630c('0x48')](handleError(_0xfc87ff,null));};exports[_0x630c('0x57')]=function(_0x1cbe4f,_0x3c1a98,_0x56c78c){return db[_0x630c('0x2f')][_0x630c('0x56')]({'where':{'id':_0x1cbe4f[_0x630c('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3c1a98,null))['then'](function(_0x1c2564){if(_0x1c2564){return _0x1c2564[_0x630c('0x57')](_0x1cbe4f[_0x630c('0x55')][_0x630c('0x58')],_[_0x630c('0x59')](_0x1cbe4f[_0x630c('0x55')],['ids','id'])||{});}})[_0x630c('0x25')](respondWithResult(_0x3c1a98,null))['catch'](handleError(_0x3c1a98,null));};exports[_0x630c('0x5a')]=function(_0x42b922,_0x54f7eb,_0x4173c8){return db[_0x630c('0x2f')][_0x630c('0x56')]({'where':{'id':_0x42b922[_0x630c('0x4a')]['id']}})[_0x630c('0x25')](handleEntityNotFound(_0x54f7eb,null))['then'](function(_0x5803a8){if(_0x5803a8){return _0x5803a8[_0x630c('0x5a')](_0x42b922[_0x630c('0x35')][_0x630c('0x58')])[_0x630c('0x25')](function(){if(_[_0x630c('0x5b')](_0x42b922[_0x630c('0x35')][_0x630c('0x58')])){for(var _0x3d641a=0x0;_0x3d641a<_0x42b922[_0x630c('0x35')][_0x630c('0x58')]['length'];_0x3d641a+=0x1){socket[_0x630c('0x5c')](_0x630c('0x5d'),{'UserId':Number(_0x42b922['query']['ids'][_0x3d641a]),'SquareProjectId':Number(_0x42b922[_0x630c('0x4a')]['id'])});}}else{socket[_0x630c('0x5c')]('userSquareProject:remove',{'UserId':Number(_0x42b922[_0x630c('0x35')][_0x630c('0x58')]),'SquareProjectId':Number(_0x42b922['params']['id'])});}});}})[_0x630c('0x25')](respondWithStatusCode(_0x54f7eb,null))['catch'](handleError(_0x54f7eb,null));};exports[_0x630c('0x5e')]=function(_0x289967,_0xd5ead5,_0x3cc208){var _0x308940={};var _0x735858={};var _0x251c81;var _0x5ba9d4;return db[_0x630c('0x2f')][_0x630c('0x5f')]({'where':{'id':_0x289967[_0x630c('0x4a')]['id']}})[_0x630c('0x25')](handleEntityNotFound(_0xd5ead5,null))[_0x630c('0x25')](function(_0x1dea9a){if(_0x1dea9a){_0x251c81=_0x1dea9a;_0x735858[_0x630c('0x33')]=_['keys'](db['User']['rawAttributes']);_0x735858[_0x630c('0x35')]=_[_0x630c('0x4b')](_0x289967['query']);_0x735858[_0x630c('0x36')]=_[_0x630c('0x37')](_0x735858[_0x630c('0x33')],_0x735858[_0x630c('0x35')]);_0x308940[_0x630c('0x38')]=_[_0x630c('0x37')](_0x735858[_0x630c('0x33')],qs[_0x630c('0x39')](_0x289967['query'][_0x630c('0x39')]));_0x308940[_0x630c('0x38')]=_0x308940[_0x630c('0x38')]['length']?_0x308940[_0x630c('0x38')]:_0x735858[_0x630c('0x33')];_0x308940[_0x630c('0x3e')]=qs['sort'](_0x289967[_0x630c('0x35')][_0x630c('0x60')]);_0x308940['where']=qs[_0x630c('0x36')](_['pick'](_0x289967[_0x630c('0x35')],_0x735858[_0x630c('0x36')]));if(_0x289967['query'][_0x630c('0x61')]){_0x308940['where']=_['merge'](_0x308940['where'],{'$or':_[_0x630c('0x34')](_0x308940[_0x630c('0x38')],function(_0x32c7a5){var _0x860b68={};_0x860b68[_0x32c7a5]={'$like':'%'+_0x289967[_0x630c('0x35')][_0x630c('0x61')]+'%'};return _0x860b68;})});}_0x308940=_['merge']({},_0x308940,_0x289967[_0x630c('0x44')]);return _0x251c81[_0x630c('0x5e')](_0x308940);}})['then'](function(_0x21f33f){if(_0x21f33f){_0x5ba9d4=_0x21f33f[_0x630c('0x4c')];if(!_0x289967[_0x630c('0x35')][_0x630c('0x3a')]('nolimit')){_0x308940['limit']=qs[_0x630c('0x3c')](_0x289967['query'][_0x630c('0x3c')]);_0x308940[_0x630c('0x3d')]=qs[_0x630c('0x3d')](_0x289967[_0x630c('0x35')]['offset']);}return _0x251c81[_0x630c('0x5e')](_0x308940);}})[_0x630c('0x25')](function(_0x366615){if(_0x366615){return _0x366615?{'count':_0x5ba9d4,'rows':_0x366615}:null;}})[_0x630c('0x25')](respondWithResult(_0xd5ead5,null))[_0x630c('0x48')](handleError(_0xd5ead5,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 7e6cf45..41ce031 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 _0x6688=['SquareProject','setMaxListeners','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x584928,_0x1ce73f){var _0x4811c9=function(_0x114fe5){while(--_0x114fe5){_0x584928['push'](_0x584928['shift']());}};_0x4811c9(++_0x1ce73f);}(_0x6688,0xe7));var _0x8668=function(_0x222667,_0xe1696a){_0x222667=_0x222667-0x0;var _0x1dd77e=_0x6688[_0x222667];return _0x1dd77e;};'use strict';var EventEmitter=require(_0x8668('0x0'));var SquareProject=require('../../mysqldb')['db'][_0x8668('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x8668('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8668('0x3'),'afterDestroy':_0x8668('0x4')};function emitEvent(_0x5a1845){return function(_0x224313,_0x56594f,_0x290a30){SquareProjectEvents[_0x8668('0x5')](_0x5a1845+':'+_0x224313['id'],_0x224313);SquareProjectEvents[_0x8668('0x5')](_0x5a1845,_0x224313);_0x290a30(null);};}for(var e in events){if(events[_0x8668('0x6')](e)){var event=events[e];SquareProject[_0x8668('0x7')](e,emitEvent(event));}}module['exports']=SquareProjectEvents; \ No newline at end of file +var _0xe1b4=['save','update','remove','emit','hasOwnProperty','hook','exports','events','SquareProject'];(function(_0x4389b3,_0x19aaeb){var _0x463840=function(_0x5e5f15){while(--_0x5e5f15){_0x4389b3['push'](_0x4389b3['shift']());}};_0x463840(++_0x19aaeb);}(_0xe1b4,0x178));var _0x4e1b=function(_0x428dbd,_0x30eeb5){_0x428dbd=_0x428dbd-0x0;var _0xc411d8=_0xe1b4[_0x428dbd];return _0xc411d8;};'use strict';var EventEmitter=require(_0x4e1b('0x0'));var SquareProject=require('../../mysqldb')['db'][_0x4e1b('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4e1b('0x2'),'afterUpdate':_0x4e1b('0x3'),'afterDestroy':_0x4e1b('0x4')};function emitEvent(_0x32aeac){return function(_0x36e205,_0x38704d,_0x303e06){SquareProjectEvents['emit'](_0x32aeac+':'+_0x36e205['id'],_0x36e205);SquareProjectEvents[_0x4e1b('0x5')](_0x32aeac,_0x36e205);_0x303e06(null);};}for(var e in events){if(events[_0x4e1b('0x6')](e)){var event=events[e];SquareProject[_0x4e1b('0x7')](e,emitEvent(event));}}module[_0x4e1b('0x8')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index d505d84..776627c 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 _0xa75a=['exports','SquareProject','changed','preproduction','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','util','../../config/logger','api','bluebird','request-promise','../../config/environment','./squareProject.attributes'];(function(_0x347a6f,_0x23557d){var _0x1f5bb0=function(_0x113763){while(--_0x113763){_0x347a6f['push'](_0x347a6f['shift']());}};_0x1f5bb0(++_0x23557d);}(_0xa75a,0xe9));var _0xaa75=function(_0x15294d,_0x4f6a0d){_0x15294d=_0x15294d-0x0;var _0x4f6dab=_0xa75a[_0x15294d];return _0x4f6dab;};'use strict';var _=require('lodash');var util=require(_0xaa75('0x0'));var logger=require(_0xaa75('0x1'))(_0xaa75('0x2'));var moment=require('moment');var BPromise=require(_0xaa75('0x3'));var rp=require(_0xaa75('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xaa75('0x5'));var attributes=require(_0xaa75('0x6'));module[_0xaa75('0x7')]=function(_0x308351,_0x776d26){return _0x308351['define'](_0xaa75('0x8'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x417c81,_0xe4fd55,_0x2f2fa0){if(_0x417c81[_0xaa75('0x9')](_0xaa75('0xa'))){_0x417c81['savedAt']=moment()[_0xaa75('0xb')](_0xaa75('0xc'));}if(_0x417c81[_0xaa75('0x9')](_0xaa75('0xd'))){_0x417c81[_0xaa75('0xe')]=moment()[_0xaa75('0xb')]('YYYY-MM-DD\x20HH:mm:ss');}_0x2f2fa0(null,_0x417c81);}}});}; \ No newline at end of file +var _0x961e=['square_projects','changed','preproduction','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','lodash','util','../../config/logger','api','moment','path','../../config/environment','./squareProject.attributes','exports','define','SquareProject'];(function(_0x38a7b8,_0xc596d9){var _0x1769d1=function(_0x30a8e4){while(--_0x30a8e4){_0x38a7b8['push'](_0x38a7b8['shift']());}};_0x1769d1(++_0xc596d9);}(_0x961e,0x1ed));var _0xe961=function(_0x5bd506,_0x47606a){_0x5bd506=_0x5bd506-0x0;var _0x188e73=_0x961e[_0x5bd506];return _0x188e73;};'use strict';var _=require(_0xe961('0x0'));var util=require(_0xe961('0x1'));var logger=require(_0xe961('0x2'))(_0xe961('0x3'));var moment=require(_0xe961('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe961('0x5'));var rimraf=require('rimraf');var config=require(_0xe961('0x6'));var attributes=require(_0xe961('0x7'));module[_0xe961('0x8')]=function(_0x33fef4,_0x279095){return _0x33fef4[_0xe961('0x9')](_0xe961('0xa'),attributes,{'tableName':_0xe961('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2ec5b9,_0x507bf6,_0x256e6a){if(_0x2ec5b9[_0xe961('0xc')](_0xe961('0xd'))){_0x2ec5b9['savedAt']=moment()[_0xe961('0xe')](_0xe961('0xf'));}if(_0x2ec5b9['changed'](_0xe961('0x10'))){_0x2ec5b9[_0xe961('0x11')]=moment()[_0xe961('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x256e6a(null,_0x2ec5b9);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 1f066e3..7d710c7 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 _0xf77c=['options','raw','where','attributes','include','model','map','ShowSquareProject','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','./squareProject.socket','register','then','info','request\x20sent','debug','stringify','error','SquareProject,\x20%s,\x20%s','message','result','catch'];(function(_0x19721a,_0x42e5cc){var _0x8b58e8=function(_0x9554b6){while(--_0x9554b6){_0x19721a['push'](_0x19721a['shift']());}};_0x8b58e8(++_0x42e5cc);}(_0xf77c,0x1a0));var _0xcf77=function(_0x18cf50,_0x3d88f9){_0x18cf50=_0x18cf50-0x0;var _0x408c31=_0xf77c[_0x18cf50];return _0x408c31;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xcf77('0x0'));var BPromise=require(_0xcf77('0x1'));var rs=require(_0xcf77('0x2'));var fs=require('fs');var Redis=require(_0xcf77('0x3'));var db=require(_0xcf77('0x4'))['db'];var utils=require(_0xcf77('0x5'));var logger=require(_0xcf77('0x6'))(_0xcf77('0x7'));var config=require('../../config/environment');var jayson=require(_0xcf77('0x8'));var client=jayson[_0xcf77('0x9')][_0xcf77('0xa')]({'port':0x232a});config[_0xcf77('0xb')]=_[_0xcf77('0xc')](config[_0xcf77('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xcf77('0xd'))(new Redis(config[_0xcf77('0xb')]));require(_0xcf77('0xe'))[_0xcf77('0xf')](socket);function respondWithRpcPromise(_0x305d14,_0x251ea8,_0x17f47f){return new BPromise(function(_0x33d533,_0x3b585a){return client['request'](_0x305d14,_0x17f47f)[_0xcf77('0x10')](function(_0x370d1f){logger[_0xcf77('0x11')]('SquareProject,\x20%s,\x20%s',_0x251ea8,_0xcf77('0x12'));logger[_0xcf77('0x13')]('SquareProject,\x20%s,\x20%s,\x20%s',_0x251ea8,_0xcf77('0x12'),JSON[_0xcf77('0x14')](_0x370d1f));if(_0x370d1f[_0xcf77('0x15')]){if(_0x370d1f[_0xcf77('0x15')]['code']===0x1f4){logger[_0xcf77('0x15')](_0xcf77('0x16'),_0x251ea8,_0x370d1f[_0xcf77('0x15')][_0xcf77('0x17')]);return _0x3b585a(_0x370d1f[_0xcf77('0x15')][_0xcf77('0x17')]);}logger[_0xcf77('0x15')](_0xcf77('0x16'),_0x251ea8,_0x370d1f['error'][_0xcf77('0x17')]);return _0x33d533(_0x370d1f[_0xcf77('0x15')][_0xcf77('0x17')]);}else{logger[_0xcf77('0x11')](_0xcf77('0x16'),_0x251ea8,'request\x20sent');_0x33d533(_0x370d1f[_0xcf77('0x18')][_0xcf77('0x17')]);}})[_0xcf77('0x19')](function(_0x526d26){logger[_0xcf77('0x15')](_0xcf77('0x16'),_0x251ea8,_0x526d26);_0x3b585a(_0x526d26);});});}exports['ShowSquareProject']=function(_0x1c69c7){var _0x466c6c=this;return new Promise(function(_0x39d81c,_0x39980d){return db['SquareProject']['find']({'raw':_0x1c69c7[_0xcf77('0x1a')]?_0x1c69c7[_0xcf77('0x1a')][_0xcf77('0x1b')]===undefined?!![]:![]:!![],'where':_0x1c69c7[_0xcf77('0x1a')]?_0x1c69c7['options'][_0xcf77('0x1c')]||null:null,'attributes':_0x1c69c7['options']?_0x1c69c7[_0xcf77('0x1a')][_0xcf77('0x1d')]||null:null,'include':_0x1c69c7[_0xcf77('0x1a')]?_0x1c69c7[_0xcf77('0x1a')][_0xcf77('0x1e')]?_['map'](_0x1c69c7[_0xcf77('0x1a')]['include'],function(_0x5ebb69){return{'model':db[_0x5ebb69[_0xcf77('0x1f')]],'as':_0x5ebb69['as'],'attributes':_0x5ebb69[_0xcf77('0x1d')],'include':_0x5ebb69['include']?_[_0xcf77('0x20')](_0x5ebb69['include'],function(_0x25209d){return{'model':db[_0x25209d['model']],'as':_0x25209d['as'],'attributes':_0x25209d[_0xcf77('0x1d')],'include':_0x25209d['include']?_[_0xcf77('0x20')](_0x25209d[_0xcf77('0x1e')],function(_0x18c5f3){return{'model':db[_0x18c5f3[_0xcf77('0x1f')]],'as':_0x18c5f3['as'],'attributes':_0x18c5f3[_0xcf77('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xcf77('0x10')](function(_0x6c85f2){logger[_0xcf77('0x11')]('ShowSquareProject',_0x1c69c7);logger[_0xcf77('0x13')](_0xcf77('0x21'),_0x1c69c7,JSON[_0xcf77('0x14')](_0x6c85f2));_0x39d81c(_0x6c85f2);})[_0xcf77('0x19')](function(_0x2fc6ec){logger['error'](_0xcf77('0x21'),_0x2fc6ec['message'],_0x1c69c7);_0x39980d(_0x466c6c[_0xcf77('0x15')](0x1f4,_0x2fc6ec[_0xcf77('0x17')]));});});}; \ No newline at end of file +var _0xcfc8=['options','include','model','attributes','map','ShowSquareProject','debug','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','socket.io-emitter','redis','./squareProject.socket','register','request','then','info','SquareProject,\x20%s,\x20%s','request\x20sent','error','message','catch','SquareProject','find'];(function(_0x284c03,_0x3fb8aa){var _0x48d021=function(_0x519066){while(--_0x519066){_0x284c03['push'](_0x284c03['shift']());}};_0x48d021(++_0x3fb8aa);}(_0xcfc8,0x147));var _0x8cfc=function(_0x15ef22,_0x5b0145){_0x15ef22=_0x15ef22-0x0;var _0x1f7b3d=_0xcfc8[_0x15ef22];return _0x1f7b3d;};'use strict';var _=require(_0x8cfc('0x0'));var util=require(_0x8cfc('0x1'));var moment=require(_0x8cfc('0x2'));var BPromise=require(_0x8cfc('0x3'));var rs=require(_0x8cfc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8cfc('0x5'))['db'];var utils=require(_0x8cfc('0x6'));var logger=require(_0x8cfc('0x7'))('rpc');var config=require(_0x8cfc('0x8'));var jayson=require(_0x8cfc('0x9'));var client=jayson[_0x8cfc('0xa')]['http']({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x8cfc('0xb'))(new Redis(config[_0x8cfc('0xc')]));require(_0x8cfc('0xd'))[_0x8cfc('0xe')](socket);function respondWithRpcPromise(_0x36901b,_0x15c608,_0x2efeb0){return new BPromise(function(_0x573fd7,_0x1dd357){return client[_0x8cfc('0xf')](_0x36901b,_0x2efeb0)[_0x8cfc('0x10')](function(_0x247c42){logger[_0x8cfc('0x11')](_0x8cfc('0x12'),_0x15c608,'request\x20sent');logger['debug']('SquareProject,\x20%s,\x20%s,\x20%s',_0x15c608,_0x8cfc('0x13'),JSON['stringify'](_0x247c42));if(_0x247c42['error']){if(_0x247c42['error']['code']===0x1f4){logger[_0x8cfc('0x14')]('SquareProject,\x20%s,\x20%s',_0x15c608,_0x247c42[_0x8cfc('0x14')][_0x8cfc('0x15')]);return _0x1dd357(_0x247c42[_0x8cfc('0x14')][_0x8cfc('0x15')]);}logger['error'](_0x8cfc('0x12'),_0x15c608,_0x247c42[_0x8cfc('0x14')][_0x8cfc('0x15')]);return _0x573fd7(_0x247c42[_0x8cfc('0x14')]['message']);}else{logger['info'](_0x8cfc('0x12'),_0x15c608,_0x8cfc('0x13'));_0x573fd7(_0x247c42['result'][_0x8cfc('0x15')]);}})[_0x8cfc('0x16')](function(_0xe031c8){logger[_0x8cfc('0x14')](_0x8cfc('0x12'),_0x15c608,_0xe031c8);_0x1dd357(_0xe031c8);});});}exports['ShowSquareProject']=function(_0x482677){var _0x30b3f8=this;return new Promise(function(_0x1e6b58,_0x301449){return db[_0x8cfc('0x17')][_0x8cfc('0x18')]({'raw':_0x482677[_0x8cfc('0x19')]?_0x482677[_0x8cfc('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x482677[_0x8cfc('0x19')]?_0x482677[_0x8cfc('0x19')]['where']||null:null,'attributes':_0x482677[_0x8cfc('0x19')]?_0x482677[_0x8cfc('0x19')]['attributes']||null:null,'include':_0x482677['options']?_0x482677['options'][_0x8cfc('0x1a')]?_['map'](_0x482677[_0x8cfc('0x19')][_0x8cfc('0x1a')],function(_0x3d689c){return{'model':db[_0x3d689c[_0x8cfc('0x1b')]],'as':_0x3d689c['as'],'attributes':_0x3d689c[_0x8cfc('0x1c')],'include':_0x3d689c[_0x8cfc('0x1a')]?_[_0x8cfc('0x1d')](_0x3d689c['include'],function(_0x124acd){return{'model':db[_0x124acd[_0x8cfc('0x1b')]],'as':_0x124acd['as'],'attributes':_0x124acd[_0x8cfc('0x1c')],'include':_0x124acd[_0x8cfc('0x1a')]?_[_0x8cfc('0x1d')](_0x124acd[_0x8cfc('0x1a')],function(_0x15cb67){return{'model':db[_0x15cb67[_0x8cfc('0x1b')]],'as':_0x15cb67['as'],'attributes':_0x15cb67[_0x8cfc('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xda4408){logger[_0x8cfc('0x11')](_0x8cfc('0x1e'),_0x482677);logger[_0x8cfc('0x1f')](_0x8cfc('0x1e'),_0x482677,JSON['stringify'](_0xda4408));_0x1e6b58(_0xda4408);})['catch'](function(_0x261fc8){logger[_0x8cfc('0x14')](_0x8cfc('0x1e'),_0x261fc8[_0x8cfc('0x15')],_0x482677);_0x301449(_0x30b3f8[_0x8cfc('0x14')](0x1f4,_0x261fc8[_0x8cfc('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 7e4ef99..ea39fcf 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 _0x48e1=['remove','update','removeListener','register','length','squareProject:','./squareProject.events','save'];(function(_0x9a29ea,_0x5b8b29){var _0x11f261=function(_0x397dea){while(--_0x397dea){_0x9a29ea['push'](_0x9a29ea['shift']());}};_0x11f261(++_0x5b8b29);}(_0x48e1,0x1de));var _0x148e=function(_0x1021ac,_0x59704f){_0x1021ac=_0x1021ac-0x0;var _0x3d0289=_0x48e1[_0x1021ac];return _0x3d0289;};'use strict';var SquareProjectEvents=require(_0x148e('0x0'));var events=[_0x148e('0x1'),_0x148e('0x2'),_0x148e('0x3')];function createListener(_0x59f1dc,_0x36d34d){return function(_0x1ac099){_0x36d34d['emit'](_0x59f1dc,_0x1ac099);};}function removeListener(_0x50d515,_0x1f80e){return function(){SquareProjectEvents[_0x148e('0x4')](_0x50d515,_0x1f80e);};}exports[_0x148e('0x5')]=function(_0x31a95d){for(var _0x5935ef=0x0,_0x59381e=events[_0x148e('0x6')];_0x5935ef<_0x59381e;_0x5935ef++){var _0x45c27f=events[_0x5935ef];var _0x824dc1=createListener(_0x148e('0x7')+_0x45c27f,_0x31a95d);SquareProjectEvents['on'](_0x45c27f,_0x824dc1);}}; \ No newline at end of file +var _0x4e34=['removeListener','register','./squareProject.events','save','remove','emit'];(function(_0x47d55d,_0x2a9376){var _0x10c3a8=function(_0x3f3cb0){while(--_0x3f3cb0){_0x47d55d['push'](_0x47d55d['shift']());}};_0x10c3a8(++_0x2a9376);}(_0x4e34,0x1f4));var _0x44e3=function(_0x28483c,_0x9db657){_0x28483c=_0x28483c-0x0;var _0x3a5f18=_0x4e34[_0x28483c];return _0x3a5f18;};'use strict';var SquareProjectEvents=require(_0x44e3('0x0'));var events=[_0x44e3('0x1'),_0x44e3('0x2'),'update'];function createListener(_0x3debba,_0x249506){return function(_0x2d68fe){_0x249506[_0x44e3('0x3')](_0x3debba,_0x2d68fe);};}function removeListener(_0x42ab47,_0xc396ee){return function(){SquareProjectEvents[_0x44e3('0x4')](_0x42ab47,_0xc396ee);};}exports[_0x44e3('0x5')]=function(_0x40539d){for(var _0x446fa8=0x0,_0x2cf763=events['length'];_0x446fa8<_0x2cf763;_0x446fa8++){var _0x5e8ef9=events[_0x446fa8];var _0x29c24b=createListener('squareProject:'+_0x5e8ef9,_0x40539d);SquareProjectEvents['on'](_0x5e8ef9,_0x29c24b);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 939059b..bb6b76c 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 _0x326f=['multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','/:id','show','download','post','create','put','delete','exports'];(function(_0x233f8d,_0x2bbfc4){var _0x5d08f3=function(_0x236564){while(--_0x236564){_0x233f8d['push'](_0x233f8d['shift']());}};_0x5d08f3(++_0x2bbfc4);}(_0x326f,0xd1));var _0xf326=function(_0x183129,_0x2786be){_0x183129=_0x183129-0x0;var _0x23aed7=_0x326f[_0x183129];return _0x23aed7;};'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/download',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 _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(_0x2cc7f2,_0x546901){var _0x395840=function(_0x22912b){while(--_0x22912b){_0x2cc7f2['push'](_0x2cc7f2['shift']());}};_0x395840(++_0x546901);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0x7fbe[_0x1e7b16];return _0x37fadc;};'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 9ac27ec..469903a 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 _0x326f=['getDataValue','sequelize','STRING','VIRTUAL'];(function(_0x24d711,_0x3cdb28){var _0x3491b4=function(_0xd5957e){while(--_0xd5957e){_0x24d711['push'](_0x24d711['shift']());}};_0x3491b4(++_0x3cdb28);}(_0x326f,0xd1));var _0xf326=function(_0x4dccbf,_0xe67667){_0x4dccbf=_0x4dccbf-0x0;var _0xbf83f6=_0x326f[_0x4dccbf];return _0xbf83f6;};'use strict';var Sequelize=require(_0xf326('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xf326('0x1')]},'calleridname':{'type':Sequelize[_0xf326('0x1')]},'context':{'type':Sequelize[_0xf326('0x1')]},'extension':{'type':Sequelize[_0xf326('0x1')]},'priority':{'type':Sequelize[_0xf326('0x1')]},'accountcode':{'type':Sequelize[_0xf326('0x1')]},'dnid':{'type':Sequelize[_0xf326('0x1')]},'projectName':{'type':Sequelize[_0xf326('0x1')]},'saveName':{'type':Sequelize[_0xf326('0x1')]},'filename':{'type':Sequelize[_0xf326('0x1')]},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0xf326('0x2')],'get':function(){var _0x3851eb='';var _0x165f95=this[_0xf326('0x3')]('savePath');if(_0x165f95){_0x3851eb=_0x165f95['substring'](_0x165f95['lastIndexOf']('.'));}return _0x3851eb;}}}; \ No newline at end of file +var _0x5d17=['getDataValue','savePath','substring','sequelize','exports','STRING','VIRTUAL'];(function(_0x4a9ac9,_0x508ea8){var _0x58a125=function(_0x1df184){while(--_0x1df184){_0x4a9ac9['push'](_0x4a9ac9['shift']());}};_0x58a125(++_0x508ea8);}(_0x5d17,0x114));var _0x75d1=function(_0x1293fa,_0x446d6b){_0x1293fa=_0x1293fa-0x0;var _0x1dd054=_0x5d17[_0x1293fa];return _0x1dd054;};'use strict';var Sequelize=require(_0x75d1('0x0'));module[_0x75d1('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x75d1('0x2')]},'context':{'type':Sequelize[_0x75d1('0x2')]},'extension':{'type':Sequelize[_0x75d1('0x2')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x75d1('0x2')]},'dnid':{'type':Sequelize[_0x75d1('0x2')]},'projectName':{'type':Sequelize[_0x75d1('0x2')]},'saveName':{'type':Sequelize[_0x75d1('0x2')]},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize[_0x75d1('0x2')]},'format':{'type':Sequelize[_0x75d1('0x3')],'get':function(){var _0x5c957a='';var _0x1ee61b=this[_0x75d1('0x4')](_0x75d1('0x5'));if(_0x1ee61b){_0x5c957a=_0x1ee61b[_0x75d1('0x6')](_0x1ee61b['lastIndexOf']('.'));}return _0x5c957a;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 3e445ff..d8902c0 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 _0x9caa=['VIRTUAL','options','includeAll','include','SquareRecording','findAll','rows','params','keys','find','catch','create','body','update','download','../../components/encryptor','savePath','%s.cypher','decryptFile','secrets','recording','existsSync','Sequelize','ValidationError','SquareRecording\x20not\x20found','unlink','message','Not\x20found','isNil','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','info','unlinkSync','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','fieldName','type','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','map'];(function(_0x5edc5d,_0x127a44){var _0x41333d=function(_0x42aca6){while(--_0x42aca6){_0x5edc5d['push'](_0x5edc5d['shift']());}};_0x41333d(++_0x127a44);}(_0x9caa,0xe4));var _0xa9ca=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9caa[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa9ca('0x0'));var zipdir=require(_0xa9ca('0x1'));var jsonpatch=require(_0xa9ca('0x2'));var rp=require(_0xa9ca('0x3'));var moment=require(_0xa9ca('0x4'));var BPromise=require(_0xa9ca('0x5'));var Mustache=require('mustache');var util=require(_0xa9ca('0x6'));var path=require(_0xa9ca('0x7'));var sox=require('sox');var csv=require(_0xa9ca('0x8'));var ejs=require(_0xa9ca('0x9'));var fs=require('fs');var fs_extra=require(_0xa9ca('0xa'));var _=require(_0xa9ca('0xb'));var squel=require(_0xa9ca('0xc'));var crypto=require(_0xa9ca('0xd'));var jsforce=require(_0xa9ca('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa9ca('0x8'));var querystring=require('querystring');var Papa=require(_0xa9ca('0xf'));var Redis=require(_0xa9ca('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa9ca('0x11'));var hardwareService=require(_0xa9ca('0x12'));var logger=require(_0xa9ca('0x13'))('api');var utils=require(_0xa9ca('0x14'));var config=require(_0xa9ca('0x15'));var licenseUtil=require(_0xa9ca('0x16'));var db=require(_0xa9ca('0x17'))['db'];function respondWithStatusCode(_0x198f8d,_0xf9a9f2){_0xf9a9f2=_0xf9a9f2||0xcc;return function(_0x48d72e){if(_0x48d72e){return _0x198f8d['sendStatus'](_0xf9a9f2);}return _0x198f8d[_0xa9ca('0x18')](_0xf9a9f2)[_0xa9ca('0x19')]();};}function respondWithResult(_0x5c3500,_0x26b13b){_0x26b13b=_0x26b13b||0xc8;return function(_0xd047ad){if(_0xd047ad){return _0x5c3500['status'](_0x26b13b)[_0xa9ca('0x1a')](_0xd047ad);}};}function respondWithFilteredResult(_0x43a41f,_0x53d276){return function(_0x1c5f19){if(_0x1c5f19){var _0x316b92=typeof _0x53d276[_0xa9ca('0x1b')]===_0xa9ca('0x1c')&&typeof _0x53d276[_0xa9ca('0x1d')]===_0xa9ca('0x1c');var _0x24041d=_0x1c5f19[_0xa9ca('0x1e')];var _0xd2c573=_0x316b92?0x0:_0x53d276['offset'];var _0x1d0576=_0x316b92?_0x1c5f19['count']:_0x53d276['offset']+_0x53d276[_0xa9ca('0x1d')];var _0x1efd9c;if(_0x1d0576>=_0x24041d){_0x1d0576=_0x24041d;_0x1efd9c=0xc8;}else{_0x1efd9c=0xce;}_0x43a41f[_0xa9ca('0x18')](_0x1efd9c);return _0x43a41f[_0xa9ca('0x1f')](_0xa9ca('0x20'),_0xd2c573+'-'+_0x1d0576+'/'+_0x24041d)[_0xa9ca('0x1a')](_0x1c5f19);}return null;};}function patchUpdates(_0x2a3a4c){return function(_0x27d5d7){try{jsonpatch[_0xa9ca('0x21')](_0x27d5d7,_0x2a3a4c,!![]);}catch(_0x516874){return BPromise[_0xa9ca('0x22')](_0x516874);}return _0x27d5d7[_0xa9ca('0x23')]();};}function saveUpdates(_0x5927dc,_0x5b1ac9){return function(_0x59d865){if(_0x59d865){return _0x59d865['update'](_0x5927dc)[_0xa9ca('0x24')](function(_0x97059f){return _0x97059f;});}return null;};}function removeEntity(_0x149705,_0x204934){return function(_0x56ef1d){if(_0x56ef1d){return _0x56ef1d[_0xa9ca('0x25')]()[_0xa9ca('0x24')](function(){_0x149705[_0xa9ca('0x18')](0xcc)[_0xa9ca('0x19')]();});}};}function handleEntityNotFound(_0xac1636,_0x3a76f3){return function(_0x3c0f9d){if(!_0x3c0f9d){_0xac1636[_0xa9ca('0x26')](0x194);}return _0x3c0f9d;};}function handleError(_0x5d6d99,_0xdf500d){_0xdf500d=_0xdf500d||0x1f4;return function(_0x24ee19){logger[_0xa9ca('0x27')](_0x24ee19[_0xa9ca('0x28')]);if(_0x24ee19['name']){delete _0x24ee19[_0xa9ca('0x29')];}_0x5d6d99['status'](_0xdf500d)[_0xa9ca('0x2a')](_0x24ee19);};}exports['index']=function(_0x6ad711,_0x43e3d1){var _0x15fa67={},_0x91e4c8={},_0x25c935={'count':0x0,'rows':[]};var _0x241695=_['map'](db['SquareRecording']['rawAttributes'],function(_0x370a2e){return{'name':_0x370a2e[_0xa9ca('0x2b')],'type':_0x370a2e[_0xa9ca('0x2c')]['key']};});_0x91e4c8['model']=_['map'](_0x241695,_0xa9ca('0x29'));_0x91e4c8[_0xa9ca('0x2d')]=_['keys'](_0x6ad711[_0xa9ca('0x2d')]);_0x91e4c8[_0xa9ca('0x2e')]=_[_0xa9ca('0x2f')](_0x91e4c8[_0xa9ca('0x30')],_0x91e4c8[_0xa9ca('0x2d')]);_0x15fa67[_0xa9ca('0x31')]=_[_0xa9ca('0x2f')](_0x91e4c8[_0xa9ca('0x30')],qs['fields'](_0x6ad711[_0xa9ca('0x2d')][_0xa9ca('0x32')]));_0x15fa67[_0xa9ca('0x31')]=_0x15fa67['attributes'][_0xa9ca('0x33')]?_0x15fa67[_0xa9ca('0x31')]:_0x91e4c8['model'];if(!_0x6ad711[_0xa9ca('0x2d')]['hasOwnProperty'](_0xa9ca('0x34'))){_0x15fa67['limit']=qs[_0xa9ca('0x1d')](_0x6ad711[_0xa9ca('0x2d')]['limit']);_0x15fa67[_0xa9ca('0x1b')]=qs['offset'](_0x6ad711['query'][_0xa9ca('0x1b')]);}_0x15fa67[_0xa9ca('0x35')]=qs[_0xa9ca('0x36')](_0x6ad711[_0xa9ca('0x2d')]['sort']);_0x15fa67[_0xa9ca('0x37')]=qs[_0xa9ca('0x2e')](_[_0xa9ca('0x38')](_0x6ad711[_0xa9ca('0x2d')],_0x91e4c8[_0xa9ca('0x2e')]),_0x241695);if(_0x6ad711[_0xa9ca('0x2d')][_0xa9ca('0x39')]){_0x15fa67['where']=_[_0xa9ca('0x3a')](_0x15fa67['where'],{'$or':_[_0xa9ca('0x3b')](_0x241695,function(_0x388683){if(_0x388683[_0xa9ca('0x2c')]!==_0xa9ca('0x3c')){var _0x535b11={};_0x535b11[_0x388683['name']]={'$like':'%'+_0x6ad711['query']['filter']+'%'};return _0x535b11;}})});}_0x15fa67=_['merge']({},_0x15fa67,_0x6ad711[_0xa9ca('0x3d')]);var _0x202911={'where':_0x15fa67[_0xa9ca('0x37')]};return db['SquareRecording'][_0xa9ca('0x1e')](_0x202911)['then'](function(_0x34fab3){_0x25c935[_0xa9ca('0x1e')]=_0x34fab3;if(_0x6ad711[_0xa9ca('0x2d')][_0xa9ca('0x3e')]){_0x15fa67[_0xa9ca('0x3f')]=[{'all':!![]}];}return db[_0xa9ca('0x40')][_0xa9ca('0x41')](_0x15fa67);})[_0xa9ca('0x24')](function(_0x1516ac){_0x25c935[_0xa9ca('0x42')]=_0x1516ac;return _0x25c935;})[_0xa9ca('0x24')](respondWithFilteredResult(_0x43e3d1,_0x15fa67))['catch'](handleError(_0x43e3d1,null));};exports['show']=function(_0x3dda05,_0x554adb){var _0x1e4a2a={'raw':!![],'where':{'id':_0x3dda05[_0xa9ca('0x43')]['id']}},_0x482a19={};_0x482a19[_0xa9ca('0x30')]=_[_0xa9ca('0x44')](db[_0xa9ca('0x40')]['rawAttributes']);_0x482a19[_0xa9ca('0x2d')]=_[_0xa9ca('0x44')](_0x3dda05['query']);_0x482a19[_0xa9ca('0x2e')]=_[_0xa9ca('0x2f')](_0x482a19[_0xa9ca('0x30')],_0x482a19['query']);_0x1e4a2a[_0xa9ca('0x31')]=_['intersection'](_0x482a19[_0xa9ca('0x30')],qs[_0xa9ca('0x32')](_0x3dda05[_0xa9ca('0x2d')]['fields']));_0x1e4a2a['attributes']=_0x1e4a2a[_0xa9ca('0x31')][_0xa9ca('0x33')]?_0x1e4a2a[_0xa9ca('0x31')]:_0x482a19[_0xa9ca('0x30')];if(_0x3dda05[_0xa9ca('0x2d')][_0xa9ca('0x3e')]){_0x1e4a2a[_0xa9ca('0x3f')]=[{'all':!![]}];}_0x1e4a2a=_[_0xa9ca('0x3a')]({},_0x1e4a2a,_0x3dda05[_0xa9ca('0x3d')]);return db[_0xa9ca('0x40')][_0xa9ca('0x45')](_0x1e4a2a)[_0xa9ca('0x24')](handleEntityNotFound(_0x554adb,null))[_0xa9ca('0x24')](respondWithResult(_0x554adb,null))[_0xa9ca('0x46')](handleError(_0x554adb,null));};exports[_0xa9ca('0x47')]=function(_0x487684,_0x216bab){return db[_0xa9ca('0x40')][_0xa9ca('0x47')](_0x487684[_0xa9ca('0x48')],{})['then'](respondWithResult(_0x216bab,0xc9))[_0xa9ca('0x46')](handleError(_0x216bab,null));};exports[_0xa9ca('0x49')]=function(_0x18475b,_0x281386){if(_0x18475b[_0xa9ca('0x48')]['id']){delete _0x18475b['body']['id'];}return db['SquareRecording']['find']({'where':{'id':_0x18475b[_0xa9ca('0x43')]['id']}})['then'](handleEntityNotFound(_0x281386,null))[_0xa9ca('0x24')](saveUpdates(_0x18475b['body'],null))[_0xa9ca('0x24')](respondWithResult(_0x281386,null))[_0xa9ca('0x46')](handleError(_0x281386,null));};exports[_0xa9ca('0x4a')]=function(_0x3c3c52,_0x34d1fc,_0x11dd00){var _0x1919b5=require(_0xa9ca('0x4b'));var _0x476494=![];var _0x9a7c5b={};if(_0x3c3c52[_0xa9ca('0x2d')][_0xa9ca('0x2c')]&&_0x3c3c52['query'][_0xa9ca('0x2c')]==='uniqueid'){_0x9a7c5b['uniqueid']=_0x3c3c52[_0xa9ca('0x43')]['id'];}else{_0x9a7c5b['id']=_0x3c3c52[_0xa9ca('0x43')]['id'];}return db[_0xa9ca('0x40')][_0xa9ca('0x45')]({'where':_0x9a7c5b,'attributes':['id',_0xa9ca('0x4c'),'filename'],'raw':!![]})[_0xa9ca('0x24')](handleEntityNotFound(_0x34d1fc,null))[_0xa9ca('0x24')](function(_0x2d97b6){if(_0x2d97b6){var _0x1c84ec=_0x2d97b6[_0xa9ca('0x4c')];var _0xa89d9d=util['format'](_0xa9ca('0x4d'),_0x1c84ec);if(fs['existsSync'](_0xa89d9d)){_0x476494=!![];return _0x1919b5[_0xa9ca('0x4e')](_0xa89d9d,_0x1c84ec,config[_0xa9ca('0x4f')][_0xa9ca('0x50')])[_0xa9ca('0x24')](function(){return _0x2d97b6;});}return _0x2d97b6;}})['then'](function(_0x38e64f){if(_0x38e64f){var _0x3f19dc=_0x38e64f['savePath'];if(!fs[_0xa9ca('0x51')](_0x3f19dc)){throw new db[(_0xa9ca('0x52'))][(_0xa9ca('0x53'))](_0xa9ca('0x54'));}if(_0x38e64f['filename']){return _0x34d1fc[_0xa9ca('0x4a')](_0x3f19dc,_0x38e64f['filename']+path['extname'](_0x3f19dc),function(){if(_0x476494){fs[_0xa9ca('0x55')](_0x3f19dc);}});}else{return _0x34d1fc[_0xa9ca('0x4a')](_0x3f19dc,function(_0x4fa778){if(_0x476494){fs[_0xa9ca('0x55')](_0x3f19dc);}});}}})[_0xa9ca('0x46')](function(_0x43a17d){if(_0x43a17d[_0xa9ca('0x56')]===_0xa9ca('0x54')){_0x34d1fc['status'](0x194)[_0xa9ca('0x2a')](_0xa9ca('0x57'));}else{return handleError(_0x34d1fc,null);}});};exports[_0xa9ca('0x25')]=function(_0x4e697d,_0x557d54){return db[_0xa9ca('0x40')][_0xa9ca('0x45')]({'where':{'id':_0x4e697d[_0xa9ca('0x43')]['id']}})['then'](function(_0x232870){if(_[_0xa9ca('0x58')](_0x232870)){throw new ReferenceError(_0xa9ca('0x59'));}return _0x232870;})[_0xa9ca('0x24')](function(_0x2405b3){var _0x5f26f4=_0x2405b3[_0xa9ca('0x4c')];logger['info'](_0xa9ca('0x5a'),_0x5f26f4);if(!_[_0xa9ca('0x58')](_0x2405b3[_0xa9ca('0x4c')])&&fs[_0xa9ca('0x51')](_0x5f26f4)){logger['info'](_0xa9ca('0x5b')+_0x5f26f4+_0xa9ca('0x5c'));fs['unlinkSync'](_0x5f26f4);}_0x5f26f4=_0x5f26f4+_0xa9ca('0x5d');if(!_[_0xa9ca('0x58')](_0x2405b3['savePath'])&&fs[_0xa9ca('0x51')](_0x5f26f4)){logger[_0xa9ca('0x5e')](_0xa9ca('0x5b')+_0x5f26f4+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xa9ca('0x5f')](_0x5f26f4);}return _0x2405b3;})[_0xa9ca('0x24')](function(_0x5f150f){if(!_0x5f150f)throw new InternalError();return _0x5f150f[_0xa9ca('0x25')]();})['then'](function(){_0x557d54[_0xa9ca('0x18')](0xcc)[_0xa9ca('0x19')]();})[_0xa9ca('0x46')](handleError(_0x557d54,null));}; \ No newline at end of file +var _0xb0e1=['File:\x20\x22','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','rimraf','fast-json-patch','request-promise','moment','mustache','path','ejs','fs-extra','squel','jsforce','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','error','stack','name','send','map','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','pick','filter','where','merge','VIRTUAL','options','SquareRecording','includeAll','include','rows','catch','show','params','find','create','body','update','download','../../components/encryptor','uniqueid','filename','savePath','format','existsSync','decryptFile','Sequelize','ValidationError','SquareRecording\x20not\x20found','extname','unlink','message','Not\x20found','destroy','info','cancellazione\x20fisica\x20documento\x20%s','isNil'];(function(_0x10ea62,_0x51c8c6){var _0x1ce155=function(_0x370ca2){while(--_0x370ca2){_0x10ea62['push'](_0x10ea62['shift']());}};_0x1ce155(++_0x51c8c6);}(_0xb0e1,0x174));var _0x1b0e=function(_0x3a4f73,_0x59af83){_0x3a4f73=_0x3a4f73-0x0;var _0x550eb8=_0xb0e1[_0x3a4f73];return _0x550eb8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1b0e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1b0e('0x1'));var rp=require(_0x1b0e('0x2'));var moment=require(_0x1b0e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1b0e('0x4'));var util=require('util');var path=require(_0x1b0e('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1b0e('0x6'));var fs=require('fs');var fs_extra=require(_0x1b0e('0x7'));var _=require('lodash');var squel=require(_0x1b0e('0x8'));var crypto=require('crypto');var jsforce=require(_0x1b0e('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x1b0e('0xa'));var querystring=require('querystring');var Papa=require(_0x1b0e('0xb'));var Redis=require('ioredis');var authService=require(_0x1b0e('0xc'));var qs=require(_0x1b0e('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1b0e('0xe'));var logger=require('../../config/logger')(_0x1b0e('0xf'));var utils=require('../../config/utils');var config=require(_0x1b0e('0x10'));var licenseUtil=require(_0x1b0e('0x11'));var db=require(_0x1b0e('0x12'))['db'];function respondWithStatusCode(_0x5b4b94,_0x4fe9ad){_0x4fe9ad=_0x4fe9ad||0xcc;return function(_0x5e30be){if(_0x5e30be){return _0x5b4b94[_0x1b0e('0x13')](_0x4fe9ad);}return _0x5b4b94[_0x1b0e('0x14')](_0x4fe9ad)[_0x1b0e('0x15')]();};}function respondWithResult(_0x56c4c4,_0x4021d3){_0x4021d3=_0x4021d3||0xc8;return function(_0x5ea1fc){if(_0x5ea1fc){return _0x56c4c4[_0x1b0e('0x14')](_0x4021d3)[_0x1b0e('0x16')](_0x5ea1fc);}};}function respondWithFilteredResult(_0x48db5a,_0x5da8ca){return function(_0x57fc30){if(_0x57fc30){var _0x5149bb=typeof _0x5da8ca['offset']===_0x1b0e('0x17')&&typeof _0x5da8ca['limit']===_0x1b0e('0x17');var _0x5b4057=_0x57fc30[_0x1b0e('0x18')];var _0xb00021=_0x5149bb?0x0:_0x5da8ca[_0x1b0e('0x19')];var _0xbb1e2=_0x5149bb?_0x57fc30[_0x1b0e('0x18')]:_0x5da8ca[_0x1b0e('0x19')]+_0x5da8ca[_0x1b0e('0x1a')];var _0x341af7;if(_0xbb1e2>=_0x5b4057){_0xbb1e2=_0x5b4057;_0x341af7=0xc8;}else{_0x341af7=0xce;}_0x48db5a[_0x1b0e('0x14')](_0x341af7);return _0x48db5a[_0x1b0e('0x1b')](_0x1b0e('0x1c'),_0xb00021+'-'+_0xbb1e2+'/'+_0x5b4057)[_0x1b0e('0x16')](_0x57fc30);}return null;};}function patchUpdates(_0xb01f19){return function(_0x3fe003){try{jsonpatch['apply'](_0x3fe003,_0xb01f19,!![]);}catch(_0x5a020f){return BPromise[_0x1b0e('0x1d')](_0x5a020f);}return _0x3fe003[_0x1b0e('0x1e')]();};}function saveUpdates(_0x56aafe,_0x8f419d){return function(_0x2a047b){if(_0x2a047b){return _0x2a047b['update'](_0x56aafe)[_0x1b0e('0x1f')](function(_0x503c84){return _0x503c84;});}return null;};}function removeEntity(_0x3967b2,_0x201902){return function(_0x4948d1){if(_0x4948d1){return _0x4948d1['destroy']()[_0x1b0e('0x1f')](function(){_0x3967b2[_0x1b0e('0x14')](0xcc)[_0x1b0e('0x15')]();});}};}function handleEntityNotFound(_0x166eb9,_0x35b9eb){return function(_0x4d6681){if(!_0x4d6681){_0x166eb9[_0x1b0e('0x13')](0x194);}return _0x4d6681;};}function handleError(_0x254d61,_0x2f018b){_0x2f018b=_0x2f018b||0x1f4;return function(_0x538266){logger[_0x1b0e('0x20')](_0x538266[_0x1b0e('0x21')]);if(_0x538266[_0x1b0e('0x22')]){delete _0x538266[_0x1b0e('0x22')];}_0x254d61[_0x1b0e('0x14')](_0x2f018b)[_0x1b0e('0x23')](_0x538266);};}exports['index']=function(_0x4074a4,_0x59629b){var _0x3c2254={},_0x3bb98a={},_0x3e2b5e={'count':0x0,'rows':[]};var _0x1cf638=_[_0x1b0e('0x24')](db['SquareRecording'][_0x1b0e('0x25')],function(_0x5c7576){return{'name':_0x5c7576[_0x1b0e('0x26')],'type':_0x5c7576[_0x1b0e('0x27')][_0x1b0e('0x28')]};});_0x3bb98a['model']=_[_0x1b0e('0x24')](_0x1cf638,_0x1b0e('0x22'));_0x3bb98a[_0x1b0e('0x29')]=_[_0x1b0e('0x2a')](_0x4074a4[_0x1b0e('0x29')]);_0x3bb98a[_0x1b0e('0x2b')]=_['intersection'](_0x3bb98a[_0x1b0e('0x2c')],_0x3bb98a[_0x1b0e('0x29')]);_0x3c2254[_0x1b0e('0x2d')]=_[_0x1b0e('0x2e')](_0x3bb98a['model'],qs[_0x1b0e('0x2f')](_0x4074a4[_0x1b0e('0x29')][_0x1b0e('0x2f')]));_0x3c2254['attributes']=_0x3c2254['attributes'][_0x1b0e('0x30')]?_0x3c2254[_0x1b0e('0x2d')]:_0x3bb98a[_0x1b0e('0x2c')];if(!_0x4074a4[_0x1b0e('0x29')][_0x1b0e('0x31')](_0x1b0e('0x32'))){_0x3c2254[_0x1b0e('0x1a')]=qs['limit'](_0x4074a4[_0x1b0e('0x29')][_0x1b0e('0x1a')]);_0x3c2254['offset']=qs[_0x1b0e('0x19')](_0x4074a4['query']['offset']);}_0x3c2254[_0x1b0e('0x33')]=qs['sort'](_0x4074a4['query']['sort']);_0x3c2254['where']=qs[_0x1b0e('0x2b')](_[_0x1b0e('0x34')](_0x4074a4['query'],_0x3bb98a[_0x1b0e('0x2b')]),_0x1cf638);if(_0x4074a4[_0x1b0e('0x29')][_0x1b0e('0x35')]){_0x3c2254[_0x1b0e('0x36')]=_[_0x1b0e('0x37')](_0x3c2254[_0x1b0e('0x36')],{'$or':_[_0x1b0e('0x24')](_0x1cf638,function(_0xeb072){if(_0xeb072['type']!==_0x1b0e('0x38')){var _0xf2eef7={};_0xf2eef7[_0xeb072[_0x1b0e('0x22')]]={'$like':'%'+_0x4074a4['query'][_0x1b0e('0x35')]+'%'};return _0xf2eef7;}})});}_0x3c2254=_[_0x1b0e('0x37')]({},_0x3c2254,_0x4074a4[_0x1b0e('0x39')]);var _0xe1740c={'where':_0x3c2254[_0x1b0e('0x36')]};return db[_0x1b0e('0x3a')][_0x1b0e('0x18')](_0xe1740c)['then'](function(_0x1530bc){_0x3e2b5e[_0x1b0e('0x18')]=_0x1530bc;if(_0x4074a4[_0x1b0e('0x29')][_0x1b0e('0x3b')]){_0x3c2254[_0x1b0e('0x3c')]=[{'all':!![]}];}return db['SquareRecording']['findAll'](_0x3c2254);})['then'](function(_0x453903){_0x3e2b5e[_0x1b0e('0x3d')]=_0x453903;return _0x3e2b5e;})['then'](respondWithFilteredResult(_0x59629b,_0x3c2254))[_0x1b0e('0x3e')](handleError(_0x59629b,null));};exports[_0x1b0e('0x3f')]=function(_0x5885e1,_0x47a570){var _0x31d082={'raw':!![],'where':{'id':_0x5885e1[_0x1b0e('0x40')]['id']}},_0x243afd={};_0x243afd[_0x1b0e('0x2c')]=_[_0x1b0e('0x2a')](db[_0x1b0e('0x3a')][_0x1b0e('0x25')]);_0x243afd[_0x1b0e('0x29')]=_[_0x1b0e('0x2a')](_0x5885e1[_0x1b0e('0x29')]);_0x243afd['filters']=_[_0x1b0e('0x2e')](_0x243afd[_0x1b0e('0x2c')],_0x243afd[_0x1b0e('0x29')]);_0x31d082[_0x1b0e('0x2d')]=_[_0x1b0e('0x2e')](_0x243afd[_0x1b0e('0x2c')],qs[_0x1b0e('0x2f')](_0x5885e1['query']['fields']));_0x31d082[_0x1b0e('0x2d')]=_0x31d082[_0x1b0e('0x2d')]['length']?_0x31d082[_0x1b0e('0x2d')]:_0x243afd[_0x1b0e('0x2c')];if(_0x5885e1[_0x1b0e('0x29')][_0x1b0e('0x3b')]){_0x31d082[_0x1b0e('0x3c')]=[{'all':!![]}];}_0x31d082=_[_0x1b0e('0x37')]({},_0x31d082,_0x5885e1[_0x1b0e('0x39')]);return db[_0x1b0e('0x3a')][_0x1b0e('0x41')](_0x31d082)[_0x1b0e('0x1f')](handleEntityNotFound(_0x47a570,null))[_0x1b0e('0x1f')](respondWithResult(_0x47a570,null))[_0x1b0e('0x3e')](handleError(_0x47a570,null));};exports[_0x1b0e('0x42')]=function(_0x66ee0f,_0x506e82){return db[_0x1b0e('0x3a')][_0x1b0e('0x42')](_0x66ee0f[_0x1b0e('0x43')],{})[_0x1b0e('0x1f')](respondWithResult(_0x506e82,0xc9))[_0x1b0e('0x3e')](handleError(_0x506e82,null));};exports[_0x1b0e('0x44')]=function(_0x40de16,_0x5a151e){if(_0x40de16[_0x1b0e('0x43')]['id']){delete _0x40de16[_0x1b0e('0x43')]['id'];}return db[_0x1b0e('0x3a')][_0x1b0e('0x41')]({'where':{'id':_0x40de16[_0x1b0e('0x40')]['id']}})[_0x1b0e('0x1f')](handleEntityNotFound(_0x5a151e,null))[_0x1b0e('0x1f')](saveUpdates(_0x40de16[_0x1b0e('0x43')],null))[_0x1b0e('0x1f')](respondWithResult(_0x5a151e,null))['catch'](handleError(_0x5a151e,null));};exports[_0x1b0e('0x45')]=function(_0x2b8aa6,_0x5b595a,_0x1b531d){var _0x4dfebb=require(_0x1b0e('0x46'));var _0x1977cc=![];var _0x5a2c92={};if(_0x2b8aa6[_0x1b0e('0x29')][_0x1b0e('0x27')]&&_0x2b8aa6[_0x1b0e('0x29')][_0x1b0e('0x27')]===_0x1b0e('0x47')){_0x5a2c92[_0x1b0e('0x47')]=_0x2b8aa6[_0x1b0e('0x40')]['id'];}else{_0x5a2c92['id']=_0x2b8aa6[_0x1b0e('0x40')]['id'];}return db[_0x1b0e('0x3a')][_0x1b0e('0x41')]({'where':_0x5a2c92,'attributes':['id','savePath',_0x1b0e('0x48')],'raw':!![]})['then'](handleEntityNotFound(_0x5b595a,null))[_0x1b0e('0x1f')](function(_0x509bdc){if(_0x509bdc){var _0xbdc96b=_0x509bdc[_0x1b0e('0x49')];var _0x579038=util[_0x1b0e('0x4a')]('%s.cypher',_0xbdc96b);if(fs[_0x1b0e('0x4b')](_0x579038)){_0x1977cc=!![];return _0x4dfebb[_0x1b0e('0x4c')](_0x579038,_0xbdc96b,config['secrets']['recording'])[_0x1b0e('0x1f')](function(){return _0x509bdc;});}return _0x509bdc;}})[_0x1b0e('0x1f')](function(_0x4abd9b){if(_0x4abd9b){var _0x2f9a73=_0x4abd9b[_0x1b0e('0x49')];if(!fs[_0x1b0e('0x4b')](_0x2f9a73)){throw new db[(_0x1b0e('0x4d'))][(_0x1b0e('0x4e'))](_0x1b0e('0x4f'));}if(_0x4abd9b[_0x1b0e('0x48')]){return _0x5b595a[_0x1b0e('0x45')](_0x2f9a73,_0x4abd9b[_0x1b0e('0x48')]+path[_0x1b0e('0x50')](_0x2f9a73),function(){if(_0x1977cc){fs['unlink'](_0x2f9a73);}});}else{return _0x5b595a[_0x1b0e('0x45')](_0x2f9a73,function(_0x5b8208){if(_0x1977cc){fs[_0x1b0e('0x51')](_0x2f9a73);}});}}})['catch'](function(_0x1ed04b){if(_0x1ed04b[_0x1b0e('0x52')]===_0x1b0e('0x4f')){_0x5b595a[_0x1b0e('0x14')](0x194)[_0x1b0e('0x23')](_0x1b0e('0x53'));}else{return handleError(_0x5b595a,null);}});};exports[_0x1b0e('0x54')]=function(_0x1e387d,_0x5ecb73){return db[_0x1b0e('0x3a')][_0x1b0e('0x41')]({'where':{'id':_0x1e387d[_0x1b0e('0x40')]['id']}})[_0x1b0e('0x1f')](function(_0x310976){if(_['isNil'](_0x310976)){throw new ReferenceError('Entity\x20not\x20found');}return _0x310976;})[_0x1b0e('0x1f')](function(_0x56daf4){var _0xaea307=_0x56daf4[_0x1b0e('0x49')];logger[_0x1b0e('0x55')](_0x1b0e('0x56'),_0xaea307);if(!_[_0x1b0e('0x57')](_0x56daf4[_0x1b0e('0x49')])&&fs['existsSync'](_0xaea307)){logger['info'](_0x1b0e('0x58')+_0xaea307+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0xaea307);}_0xaea307=_0xaea307+_0x1b0e('0x59');if(!_[_0x1b0e('0x57')](_0x56daf4[_0x1b0e('0x49')])&&fs['existsSync'](_0xaea307)){logger[_0x1b0e('0x55')]('File:\x20\x22'+_0xaea307+_0x1b0e('0x5a'));fs[_0x1b0e('0x5b')](_0xaea307);}return _0x56daf4;})[_0x1b0e('0x1f')](function(_0x2b043e){if(!_0x2b043e)throw new InternalError();return _0x2b043e[_0x1b0e('0x54')]();})[_0x1b0e('0x1f')](function(){_0x5ecb73[_0x1b0e('0x14')](0xcc)[_0x1b0e('0x15')]();})['catch'](handleError(_0x5ecb73,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 3d2fd03..b57f948 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 _0x7409=['rimraf','../../config/environment','./squareRecording.attributes','exports','define','SquareRecording','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x460d45,_0x14a515){var _0x1694da=function(_0x3831c7){while(--_0x3831c7){_0x460d45['push'](_0x460d45['shift']());}};_0x1694da(++_0x14a515);}(_0x7409,0x6e));var _0x9740=function(_0xd050c6,_0x58ffb4){_0xd050c6=_0xd050c6-0x0;var _0x7278a=_0x7409[_0xd050c6];return _0x7278a;};'use strict';var _=require(_0x9740('0x0'));var util=require(_0x9740('0x1'));var logger=require('../../config/logger')(_0x9740('0x2'));var moment=require(_0x9740('0x3'));var BPromise=require(_0x9740('0x4'));var rp=require(_0x9740('0x5'));var fs=require('fs');var path=require(_0x9740('0x6'));var rimraf=require(_0x9740('0x7'));var config=require(_0x9740('0x8'));var attributes=require(_0x9740('0x9'));module[_0x9740('0xa')]=function(_0x547490,_0x19865c){return _0x547490[_0x9740('0xb')](_0x9740('0xc'),attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe451=['../../config/environment','exports','SquareRecording','square_recordings','../../config/logger','request-promise','path','rimraf'];(function(_0x42ea7e,_0x5075d2){var _0x567e8c=function(_0x503bea){while(--_0x503bea){_0x42ea7e['push'](_0x42ea7e['shift']());}};_0x567e8c(++_0x5075d2);}(_0xe451,0xec));var _0x1e45=function(_0x2069a6,_0x1bb4e1){_0x2069a6=_0x2069a6-0x0;var _0x22a791=_0xe451[_0x2069a6];return _0x22a791;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1e45('0x0'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1e45('0x1'));var fs=require('fs');var path=require(_0x1e45('0x2'));var rimraf=require(_0x1e45('0x3'));var config=require(_0x1e45('0x4'));var attributes=require('./squareRecording.attributes');module[_0x1e45('0x5')]=function(_0x1a163c,_0x115f88){return _0x1a163c['define'](_0x1e45('0x6'),attributes,{'tableName':_0x1e45('0x7'),'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 2a293b6..c4536f1 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 _0x88ad=['error','code','SquareRecording,\x20%s,\x20%s','message','result','catch','CreateSquareRecording','SquareRecording','create','options','raw','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','info','request\x20sent','debug','stringify'];(function(_0x30e167,_0x24d5a7){var _0x54a401=function(_0x4737d5){while(--_0x4737d5){_0x30e167['push'](_0x30e167['shift']());}};_0x54a401(++_0x24d5a7);}(_0x88ad,0x137));var _0xd88a=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x88ad[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0xd88a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd88a('0x1'));var fs=require('fs');var Redis=require(_0xd88a('0x2'));var db=require(_0xd88a('0x3'))['db'];var utils=require(_0xd88a('0x4'));var logger=require(_0xd88a('0x5'))(_0xd88a('0x6'));var config=require(_0xd88a('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x279d3f,_0x3fb1af,_0x1598b1){return new BPromise(function(_0x35b4fd,_0x598b03){return client[_0xd88a('0x8')](_0x279d3f,_0x1598b1)[_0xd88a('0x9')](function(_0x3b560b){logger[_0xd88a('0xa')]('SquareRecording,\x20%s,\x20%s',_0x3fb1af,_0xd88a('0xb'));logger[_0xd88a('0xc')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0x3fb1af,'request\x20sent',JSON[_0xd88a('0xd')](_0x3b560b));if(_0x3b560b['error']){if(_0x3b560b[_0xd88a('0xe')][_0xd88a('0xf')]===0x1f4){logger['error'](_0xd88a('0x10'),_0x3fb1af,_0x3b560b[_0xd88a('0xe')][_0xd88a('0x11')]);return _0x598b03(_0x3b560b[_0xd88a('0xe')][_0xd88a('0x11')]);}logger[_0xd88a('0xe')](_0xd88a('0x10'),_0x3fb1af,_0x3b560b[_0xd88a('0xe')]['message']);return _0x35b4fd(_0x3b560b[_0xd88a('0xe')][_0xd88a('0x11')]);}else{logger[_0xd88a('0xa')](_0xd88a('0x10'),_0x3fb1af,_0xd88a('0xb'));_0x35b4fd(_0x3b560b[_0xd88a('0x12')][_0xd88a('0x11')]);}})[_0xd88a('0x13')](function(_0x5138ab){logger[_0xd88a('0xe')](_0xd88a('0x10'),_0x3fb1af,_0x5138ab);_0x598b03(_0x5138ab);});});}exports[_0xd88a('0x14')]=function(_0x588713){var _0x15f7fd=this;return new Promise(function(_0x17413a,_0x4761c5){return db[_0xd88a('0x15')][_0xd88a('0x16')](_0x588713['body'],{'raw':_0x588713[_0xd88a('0x17')]?_0x588713['options'][_0xd88a('0x18')]===undefined?!![]:![]:!![]})[_0xd88a('0x9')](function(_0x145e4f){logger[_0xd88a('0xa')](_0xd88a('0x14'),_0x588713);logger[_0xd88a('0xc')]('CreateSquareRecording',_0x588713,JSON[_0xd88a('0xd')](_0x145e4f));_0x17413a(_0x145e4f);})[_0xd88a('0x13')](function(_0x102679){logger['error']('CreateSquareRecording',_0x102679[_0xd88a('0x11')],_0x588713);_0x4761c5(_0x15f7fd['error'](0x1f4,_0x102679[_0xd88a('0x11')]));});});}; \ No newline at end of file +var _0xba4d=['body','options','raw','lodash','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareRecording','SquareRecording','create'];(function(_0x35e534,_0x1652a9){var _0x4ea57f=function(_0xd8fae){while(--_0xd8fae){_0x35e534['push'](_0x35e534['shift']());}};_0x4ea57f(++_0x1652a9);}(_0xba4d,0xeb));var _0xdba4=function(_0x39bc44,_0x1d4373){_0x39bc44=_0x39bc44-0x0;var _0x2916d8=_0xba4d[_0x39bc44];return _0x2916d8;};'use strict';var _=require(_0xdba4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdba4('0x1'));var db=require(_0xdba4('0x2'))['db'];var utils=require(_0xdba4('0x3'));var logger=require(_0xdba4('0x4'))(_0xdba4('0x5'));var config=require(_0xdba4('0x6'));var jayson=require(_0xdba4('0x7'));var client=jayson[_0xdba4('0x8')][_0xdba4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1acfb5,_0x9c5bcb,_0x1236f4){return new BPromise(function(_0x47edf0,_0x462b0a){return client[_0xdba4('0xa')](_0x1acfb5,_0x1236f4)[_0xdba4('0xb')](function(_0x388b35){logger[_0xdba4('0xc')](_0xdba4('0xd'),_0x9c5bcb,_0xdba4('0xe'));logger[_0xdba4('0xf')](_0xdba4('0x10'),_0x9c5bcb,'request\x20sent',JSON[_0xdba4('0x11')](_0x388b35));if(_0x388b35[_0xdba4('0x12')]){if(_0x388b35[_0xdba4('0x12')][_0xdba4('0x13')]===0x1f4){logger[_0xdba4('0x12')](_0xdba4('0xd'),_0x9c5bcb,_0x388b35['error'][_0xdba4('0x14')]);return _0x462b0a(_0x388b35['error']['message']);}logger[_0xdba4('0x12')](_0xdba4('0xd'),_0x9c5bcb,_0x388b35['error'][_0xdba4('0x14')]);return _0x47edf0(_0x388b35['error'][_0xdba4('0x14')]);}else{logger['info'](_0xdba4('0xd'),_0x9c5bcb,_0xdba4('0xe'));_0x47edf0(_0x388b35[_0xdba4('0x15')][_0xdba4('0x14')]);}})[_0xdba4('0x16')](function(_0x3dfd8e){logger[_0xdba4('0x12')]('SquareRecording,\x20%s,\x20%s',_0x9c5bcb,_0x3dfd8e);_0x462b0a(_0x3dfd8e);});});}exports[_0xdba4('0x17')]=function(_0x4089a5){var _0x4c3f3d=this;return new Promise(function(_0x44e0cc,_0x2a6727){return db[_0xdba4('0x18')][_0xdba4('0x19')](_0x4089a5[_0xdba4('0x1a')],{'raw':_0x4089a5[_0xdba4('0x1b')]?_0x4089a5[_0xdba4('0x1b')][_0xdba4('0x1c')]===undefined?!![]:![]:!![]})[_0xdba4('0xb')](function(_0x449f6f){logger[_0xdba4('0xc')]('CreateSquareRecording',_0x4089a5);logger[_0xdba4('0xf')](_0xdba4('0x17'),_0x4089a5,JSON['stringify'](_0x449f6f));_0x44e0cc(_0x449f6f);})[_0xdba4('0x16')](function(_0x290f0b){logger[_0xdba4('0x12')]('CreateSquareRecording',_0x290f0b[_0xdba4('0x14')],_0x4089a5);_0x2a6727(_0x4c3f3d[_0xdba4('0x12')](0x1f4,_0x290f0b[_0xdba4('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 65475ea..abe6348 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 _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(_0x536755,_0x3bfa50){var _0x2b9dde=function(_0xe1efcc){while(--_0xe1efcc){_0x536755['push'](_0x536755['shift']());}};_0x2b9dde(++_0x3bfa50);}(_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 +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(_0x58fd70,_0x3eb9b4){var _0x1ef5dd=function(_0x37c535){while(--_0x37c535){_0x58fd70['push'](_0x58fd70['shift']());}};_0x1ef5dd(++_0x3eb9b4);}(_0xbaf0,0x12a));var _0x0baf=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xbaf0[_0x3947c9];return _0x2e7871;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['describe']);router[_0x0baf('0x9')]('/:id',auth[_0x0baf('0xa')](),controller[_0x0baf('0xd')]);router[_0x0baf('0xe')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x10')](_0x0baf('0x11'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')](_0x0baf('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x0baf('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 2c5428a..a489eb1 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 _0x8149=['DATE','sequelize','exports','STRING'];(function(_0x399178,_0x3ecc26){var _0x4ccc64=function(_0x3f97df){while(--_0x3f97df){_0x399178['push'](_0x399178['shift']());}};_0x4ccc64(++_0x3ecc26);}(_0x8149,0x149));var _0x9814=function(_0x48d26a,_0x2487be){_0x48d26a=_0x48d26a-0x0;var _0x52087c=_0x8149[_0x48d26a];return _0x52087c;};'use strict';var Sequelize=require(_0x9814('0x0'));module[_0x9814('0x1')]={'network':{'type':Sequelize[_0x9814('0x2')]},'network_script':{'type':Sequelize[_0x9814('0x2')]},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x9814('0x2')]},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x9814('0x2')]},'uniqueid':{'type':Sequelize[_0x9814('0x2')]},'version':{'type':Sequelize[_0x9814('0x2')]},'callerid':{'type':Sequelize[_0x9814('0x2')]},'calleridname':{'type':Sequelize[_0x9814('0x2')]},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize[_0x9814('0x2')]},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x9814('0x2')]},'rdnis':{'type':Sequelize[_0x9814('0x2')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x9814('0x2')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x9814('0x2')]},'threadid':{'type':Sequelize[_0x9814('0x2')]},'project_name':{'type':Sequelize[_0x9814('0x2')]},'joinAt':{'type':Sequelize[_0x9814('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x6e1d=['sequelize','exports','STRING','DATE','BOOLEAN'];(function(_0x2f4f45,_0x47aa32){var _0xe820c4=function(_0x3e89ce){while(--_0x3e89ce){_0x2f4f45['push'](_0x2f4f45['shift']());}};_0xe820c4(++_0x47aa32);}(_0x6e1d,0xfa));var _0xd6e1=function(_0x58dc25,_0x49b9d5){_0x58dc25=_0x58dc25-0x0;var _0x21b0a7=_0x6e1d[_0x58dc25];return _0x21b0a7;};'use strict';var Sequelize=require(_0xd6e1('0x0'));module[_0xd6e1('0x1')]={'network':{'type':Sequelize[_0xd6e1('0x2')]},'network_script':{'type':Sequelize[_0xd6e1('0x2')]},'request':{'type':Sequelize[_0xd6e1('0x2')]},'channel':{'type':Sequelize[_0xd6e1('0x2')]},'language':{'type':Sequelize[_0xd6e1('0x2')]},'type':{'type':Sequelize[_0xd6e1('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize[_0xd6e1('0x2')]},'callerid':{'type':Sequelize[_0xd6e1('0x2')]},'calleridname':{'type':Sequelize[_0xd6e1('0x2')]},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0xd6e1('0x2')]},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize[_0xd6e1('0x2')]},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize[_0xd6e1('0x2')]},'context':{'type':Sequelize[_0xd6e1('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xd6e1('0x2')]},'enhanced':{'type':Sequelize[_0xd6e1('0x2')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0xd6e1('0x2')]},'project_name':{'type':Sequelize[_0xd6e1('0x2')]},'joinAt':{'type':Sequelize[_0xd6e1('0x3')]},'leaveAt':{'type':Sequelize[_0xd6e1('0x3')]},'bot':{'type':Sequelize[_0xd6e1('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index ee60212..52757a8 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 _0x7fcf=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','SquareReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','length','includeAll','create','body','find','params','describe','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0x557dc4,_0x2c86c6){var _0x51e824=function(_0x2a13f9){while(--_0x2a13f9){_0x557dc4['push'](_0x557dc4['shift']());}};_0x51e824(++_0x2c86c6);}(_0x7fcf,0x16e));var _0xf7fc=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0x7fcf[_0x411add];return _0x238242;};'use strict';var emlformat=require(_0xf7fc('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf7fc('0x1'));var rp=require('request-promise');var moment=require(_0xf7fc('0x2'));var BPromise=require(_0xf7fc('0x3'));var Mustache=require(_0xf7fc('0x4'));var util=require(_0xf7fc('0x5'));var path=require(_0xf7fc('0x6'));var sox=require(_0xf7fc('0x7'));var csv=require(_0xf7fc('0x8'));var ejs=require(_0xf7fc('0x9'));var fs=require('fs');var fs_extra=require(_0xf7fc('0xa'));var _=require('lodash');var squel=require(_0xf7fc('0xb'));var crypto=require(_0xf7fc('0xc'));var jsforce=require(_0xf7fc('0xd'));var deskjs=require(_0xf7fc('0xe'));var toCsv=require(_0xf7fc('0x8'));var querystring=require('querystring');var Papa=require(_0xf7fc('0xf'));var Redis=require('ioredis');var authService=require(_0xf7fc('0x10'));var qs=require(_0xf7fc('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf7fc('0x12'));var logger=require('../../config/logger')(_0xf7fc('0x13'));var utils=require(_0xf7fc('0x14'));var config=require(_0xf7fc('0x15'));var licenseUtil=require(_0xf7fc('0x16'));var db=require(_0xf7fc('0x17'))['db'];function respondWithStatusCode(_0x14e577,_0x258341){_0x258341=_0x258341||0xcc;return function(_0x42f368){if(_0x42f368){return _0x14e577[_0xf7fc('0x18')](_0x258341);}return _0x14e577[_0xf7fc('0x19')](_0x258341)[_0xf7fc('0x1a')]();};}function respondWithResult(_0x3200c0,_0x212846){_0x212846=_0x212846||0xc8;return function(_0x31232f){if(_0x31232f){return _0x3200c0['status'](_0x212846)[_0xf7fc('0x1b')](_0x31232f);}};}function respondWithFilteredResult(_0x4a6436,_0x105e89){return function(_0x40bc70){if(_0x40bc70){var _0x54f0ac=typeof _0x105e89[_0xf7fc('0x1c')]===_0xf7fc('0x1d')&&typeof _0x105e89[_0xf7fc('0x1e')]===_0xf7fc('0x1d');var _0x1c0efd=_0x40bc70['count'];var _0x43b30f=_0x54f0ac?0x0:_0x105e89['offset'];var _0x1ba3a2=_0x54f0ac?_0x40bc70[_0xf7fc('0x1f')]:_0x105e89[_0xf7fc('0x1c')]+_0x105e89[_0xf7fc('0x1e')];var _0x360fe3;if(_0x1ba3a2>=_0x1c0efd){_0x1ba3a2=_0x1c0efd;_0x360fe3=0xc8;}else{_0x360fe3=0xce;}_0x4a6436['status'](_0x360fe3);return _0x4a6436['set'](_0xf7fc('0x20'),_0x43b30f+'-'+_0x1ba3a2+'/'+_0x1c0efd)[_0xf7fc('0x1b')](_0x40bc70);}return null;};}function patchUpdates(_0x1ed0da){return function(_0x3b5ca7){try{jsonpatch[_0xf7fc('0x21')](_0x3b5ca7,_0x1ed0da,!![]);}catch(_0x27281e){return BPromise[_0xf7fc('0x22')](_0x27281e);}return _0x3b5ca7[_0xf7fc('0x23')]();};}function saveUpdates(_0xbcb77,_0x155add){return function(_0x5692b7){if(_0x5692b7){return _0x5692b7[_0xf7fc('0x24')](_0xbcb77)[_0xf7fc('0x25')](function(_0x242c45){return _0x242c45;});}return null;};}function removeEntity(_0x216306,_0x276d6c){return function(_0x17d381){if(_0x17d381){return _0x17d381[_0xf7fc('0x26')]()[_0xf7fc('0x25')](function(){_0x216306[_0xf7fc('0x19')](0xcc)[_0xf7fc('0x1a')]();});}};}function handleEntityNotFound(_0x4a6768,_0x58366c){return function(_0x31d6fb){if(!_0x31d6fb){_0x4a6768['sendStatus'](0x194);}return _0x31d6fb;};}function handleError(_0x68c5af,_0x8b1f23){_0x8b1f23=_0x8b1f23||0x1f4;return function(_0x28c3cc){logger[_0xf7fc('0x27')](_0x28c3cc[_0xf7fc('0x28')]);if(_0x28c3cc[_0xf7fc('0x29')]){delete _0x28c3cc['name'];}_0x68c5af[_0xf7fc('0x19')](_0x8b1f23)[_0xf7fc('0x2a')](_0x28c3cc);};}exports['index']=function(_0x2fb919,_0x62a9f){var _0x83e2df={},_0x5e4a9c={},_0x545d5d={'count':0x0,'rows':[]};var _0x428af1=_[_0xf7fc('0x2b')](db[_0xf7fc('0x2c')][_0xf7fc('0x2d')],function(_0x1663b1){return{'name':_0x1663b1['fieldName'],'type':_0x1663b1[_0xf7fc('0x2e')][_0xf7fc('0x2f')]};});_0x5e4a9c[_0xf7fc('0x30')]=_['map'](_0x428af1,_0xf7fc('0x29'));_0x5e4a9c[_0xf7fc('0x31')]=_[_0xf7fc('0x32')](_0x2fb919[_0xf7fc('0x31')]);_0x5e4a9c[_0xf7fc('0x33')]=_[_0xf7fc('0x34')](_0x5e4a9c[_0xf7fc('0x30')],_0x5e4a9c[_0xf7fc('0x31')]);_0x83e2df[_0xf7fc('0x35')]=_[_0xf7fc('0x34')](_0x5e4a9c[_0xf7fc('0x30')],qs[_0xf7fc('0x36')](_0x2fb919[_0xf7fc('0x31')][_0xf7fc('0x36')]));_0x83e2df[_0xf7fc('0x35')]=_0x83e2df['attributes']['length']?_0x83e2df['attributes']:_0x5e4a9c[_0xf7fc('0x30')];if(!_0x2fb919[_0xf7fc('0x31')][_0xf7fc('0x37')](_0xf7fc('0x38'))){_0x83e2df['limit']=qs[_0xf7fc('0x1e')](_0x2fb919['query'][_0xf7fc('0x1e')]);_0x83e2df[_0xf7fc('0x1c')]=qs['offset'](_0x2fb919['query'][_0xf7fc('0x1c')]);}_0x83e2df[_0xf7fc('0x39')]=qs[_0xf7fc('0x3a')](_0x2fb919[_0xf7fc('0x31')]['sort']);_0x83e2df[_0xf7fc('0x3b')]=qs[_0xf7fc('0x33')](_[_0xf7fc('0x3c')](_0x2fb919[_0xf7fc('0x31')],_0x5e4a9c[_0xf7fc('0x33')]),_0x428af1);if(_0x2fb919[_0xf7fc('0x31')][_0xf7fc('0x3d')]){_0x83e2df[_0xf7fc('0x3b')]=_[_0xf7fc('0x3e')](_0x83e2df[_0xf7fc('0x3b')],{'$or':_[_0xf7fc('0x2b')](_0x428af1,function(_0x2dd97d){if(_0x2dd97d[_0xf7fc('0x2e')]!==_0xf7fc('0x3f')){var _0x39670d={};_0x39670d[_0x2dd97d[_0xf7fc('0x29')]]={'$like':'%'+_0x2fb919['query']['filter']+'%'};return _0x39670d;}})});}_0x83e2df=_[_0xf7fc('0x3e')]({},_0x83e2df,_0x2fb919[_0xf7fc('0x40')]);var _0x436c65={'where':_0x83e2df[_0xf7fc('0x3b')]};return db[_0xf7fc('0x2c')]['count'](_0x436c65)['then'](function(_0x1f5e75){_0x545d5d[_0xf7fc('0x1f')]=_0x1f5e75;if(_0x2fb919['query']['includeAll']){_0x83e2df[_0xf7fc('0x41')]=[{'all':!![]}];}return db[_0xf7fc('0x2c')][_0xf7fc('0x42')](_0x83e2df);})[_0xf7fc('0x25')](function(_0x28023a){_0x545d5d[_0xf7fc('0x43')]=_0x28023a;return _0x545d5d;})['then'](respondWithFilteredResult(_0x62a9f,_0x83e2df))[_0xf7fc('0x44')](handleError(_0x62a9f,null));};exports[_0xf7fc('0x45')]=function(_0x5de1fa,_0x646615){var _0x392009={'raw':!![],'where':{'id':_0x5de1fa['params']['id']}},_0x35dc18={};_0x35dc18[_0xf7fc('0x30')]=_[_0xf7fc('0x32')](db[_0xf7fc('0x2c')][_0xf7fc('0x2d')]);_0x35dc18[_0xf7fc('0x31')]=_[_0xf7fc('0x32')](_0x5de1fa[_0xf7fc('0x31')]);_0x35dc18['filters']=_[_0xf7fc('0x34')](_0x35dc18[_0xf7fc('0x30')],_0x35dc18['query']);_0x392009[_0xf7fc('0x35')]=_[_0xf7fc('0x34')](_0x35dc18[_0xf7fc('0x30')],qs['fields'](_0x5de1fa[_0xf7fc('0x31')][_0xf7fc('0x36')]));_0x392009[_0xf7fc('0x35')]=_0x392009['attributes'][_0xf7fc('0x46')]?_0x392009['attributes']:_0x35dc18[_0xf7fc('0x30')];if(_0x5de1fa[_0xf7fc('0x31')][_0xf7fc('0x47')]){_0x392009['include']=[{'all':!![]}];}_0x392009=_[_0xf7fc('0x3e')]({},_0x392009,_0x5de1fa['options']);return db[_0xf7fc('0x2c')]['find'](_0x392009)[_0xf7fc('0x25')](handleEntityNotFound(_0x646615,null))[_0xf7fc('0x25')](respondWithResult(_0x646615,null))['catch'](handleError(_0x646615,null));};exports[_0xf7fc('0x48')]=function(_0x4f0f64,_0x1522df){return db['SquareReport'][_0xf7fc('0x48')](_0x4f0f64['body'],{})[_0xf7fc('0x25')](respondWithResult(_0x1522df,0xc9))[_0xf7fc('0x44')](handleError(_0x1522df,null));};exports[_0xf7fc('0x24')]=function(_0x4455cb,_0x20ff06){if(_0x4455cb[_0xf7fc('0x49')]['id']){delete _0x4455cb[_0xf7fc('0x49')]['id'];}return db[_0xf7fc('0x2c')][_0xf7fc('0x4a')]({'where':{'id':_0x4455cb[_0xf7fc('0x4b')]['id']}})[_0xf7fc('0x25')](handleEntityNotFound(_0x20ff06,null))[_0xf7fc('0x25')](saveUpdates(_0x4455cb[_0xf7fc('0x49')],null))[_0xf7fc('0x25')](respondWithResult(_0x20ff06,null))[_0xf7fc('0x44')](handleError(_0x20ff06,null));};exports[_0xf7fc('0x26')]=function(_0xaae22e,_0x3cc675){return db[_0xf7fc('0x2c')]['find']({'where':{'id':_0xaae22e[_0xf7fc('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3cc675,null))[_0xf7fc('0x25')](removeEntity(_0x3cc675,null))[_0xf7fc('0x44')](handleError(_0x3cc675,null));};exports[_0xf7fc('0x4c')]=function(_0x3a1765,_0x5f5b16){return db[_0xf7fc('0x2c')][_0xf7fc('0x4c')]()['then'](respondWithResult(_0x5f5b16,null))[_0xf7fc('0x44')](handleError(_0x5f5b16,null));}; \ No newline at end of file +var _0x80fe=['offset','limit','count','set','Content-Range','reject','save','update','then','destroy','error','name','send','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','SquareReport','includeAll','include','rows','show','params','rawAttributes','options','find','catch','create','body','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status'];(function(_0x187d8a,_0x2ae39f){var _0xcac785=function(_0x52b4ad){while(--_0x52b4ad){_0x187d8a['push'](_0x187d8a['shift']());}};_0xcac785(++_0x2ae39f);}(_0x80fe,0x10a));var _0xe80f=function(_0x114094,_0x413d3f){_0x114094=_0x114094-0x0;var _0x10a923=_0x80fe[_0x114094];return _0x10a923;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe80f('0x0'));var jsonpatch=require(_0xe80f('0x1'));var rp=require(_0xe80f('0x2'));var moment=require(_0xe80f('0x3'));var BPromise=require(_0xe80f('0x4'));var Mustache=require(_0xe80f('0x5'));var util=require(_0xe80f('0x6'));var path=require('path');var sox=require(_0xe80f('0x7'));var csv=require(_0xe80f('0x8'));var ejs=require(_0xe80f('0x9'));var fs=require('fs');var fs_extra=require(_0xe80f('0xa'));var _=require('lodash');var squel=require(_0xe80f('0xb'));var crypto=require(_0xe80f('0xc'));var jsforce=require(_0xe80f('0xd'));var deskjs=require(_0xe80f('0xe'));var toCsv=require(_0xe80f('0x8'));var querystring=require(_0xe80f('0xf'));var Papa=require(_0xe80f('0x10'));var Redis=require(_0xe80f('0x11'));var authService=require(_0xe80f('0x12'));var qs=require(_0xe80f('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe80f('0x14'));var logger=require(_0xe80f('0x15'))(_0xe80f('0x16'));var utils=require(_0xe80f('0x17'));var config=require(_0xe80f('0x18'));var licenseUtil=require(_0xe80f('0x19'));var db=require(_0xe80f('0x1a'))['db'];function respondWithStatusCode(_0x1aea88,_0x53c177){_0x53c177=_0x53c177||0xcc;return function(_0x2c01c2){if(_0x2c01c2){return _0x1aea88[_0xe80f('0x1b')](_0x53c177);}return _0x1aea88['status'](_0x53c177)[_0xe80f('0x1c')]();};}function respondWithResult(_0x590408,_0x390178){_0x390178=_0x390178||0xc8;return function(_0x18431e){if(_0x18431e){return _0x590408[_0xe80f('0x1d')](_0x390178)['json'](_0x18431e);}};}function respondWithFilteredResult(_0x34865b,_0x4974d1){return function(_0x21f788){if(_0x21f788){var _0x1fd910=typeof _0x4974d1[_0xe80f('0x1e')]==='undefined'&&typeof _0x4974d1[_0xe80f('0x1f')]==='undefined';var _0x598783=_0x21f788[_0xe80f('0x20')];var _0x3620bb=_0x1fd910?0x0:_0x4974d1[_0xe80f('0x1e')];var _0x21652f=_0x1fd910?_0x21f788[_0xe80f('0x20')]:_0x4974d1[_0xe80f('0x1e')]+_0x4974d1[_0xe80f('0x1f')];var _0x25ad0f;if(_0x21652f>=_0x598783){_0x21652f=_0x598783;_0x25ad0f=0xc8;}else{_0x25ad0f=0xce;}_0x34865b['status'](_0x25ad0f);return _0x34865b[_0xe80f('0x21')](_0xe80f('0x22'),_0x3620bb+'-'+_0x21652f+'/'+_0x598783)['json'](_0x21f788);}return null;};}function patchUpdates(_0x278fa5){return function(_0x3efe22){try{jsonpatch['apply'](_0x3efe22,_0x278fa5,!![]);}catch(_0x3eaef9){return BPromise[_0xe80f('0x23')](_0x3eaef9);}return _0x3efe22[_0xe80f('0x24')]();};}function saveUpdates(_0x478bf6,_0x5d5373){return function(_0x1ea8a1){if(_0x1ea8a1){return _0x1ea8a1[_0xe80f('0x25')](_0x478bf6)[_0xe80f('0x26')](function(_0x40c20e){return _0x40c20e;});}return null;};}function removeEntity(_0x5e7486,_0x504414){return function(_0x2af10b){if(_0x2af10b){return _0x2af10b[_0xe80f('0x27')]()[_0xe80f('0x26')](function(){_0x5e7486[_0xe80f('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41dff3,_0x2d6581){return function(_0xe3e25c){if(!_0xe3e25c){_0x41dff3[_0xe80f('0x1b')](0x194);}return _0xe3e25c;};}function handleError(_0x2eb531,_0x52d4ea){_0x52d4ea=_0x52d4ea||0x1f4;return function(_0x5ab8cd){logger[_0xe80f('0x28')](_0x5ab8cd['stack']);if(_0x5ab8cd[_0xe80f('0x29')]){delete _0x5ab8cd[_0xe80f('0x29')];}_0x2eb531['status'](_0x52d4ea)[_0xe80f('0x2a')](_0x5ab8cd);};}exports['index']=function(_0x599739,_0x4a8e51){var _0x9e357c={},_0x57580a={},_0x33e127={'count':0x0,'rows':[]};var _0x3937e8=_['map'](db['SquareReport']['rawAttributes'],function(_0x1062e5){return{'name':_0x1062e5['fieldName'],'type':_0x1062e5[_0xe80f('0x2b')][_0xe80f('0x2c')]};});_0x57580a[_0xe80f('0x2d')]=_[_0xe80f('0x2e')](_0x3937e8,_0xe80f('0x29'));_0x57580a[_0xe80f('0x2f')]=_[_0xe80f('0x30')](_0x599739[_0xe80f('0x2f')]);_0x57580a[_0xe80f('0x31')]=_[_0xe80f('0x32')](_0x57580a[_0xe80f('0x2d')],_0x57580a[_0xe80f('0x2f')]);_0x9e357c[_0xe80f('0x33')]=_[_0xe80f('0x32')](_0x57580a[_0xe80f('0x2d')],qs[_0xe80f('0x34')](_0x599739['query'][_0xe80f('0x34')]));_0x9e357c[_0xe80f('0x33')]=_0x9e357c[_0xe80f('0x33')][_0xe80f('0x35')]?_0x9e357c[_0xe80f('0x33')]:_0x57580a[_0xe80f('0x2d')];if(!_0x599739[_0xe80f('0x2f')][_0xe80f('0x36')](_0xe80f('0x37'))){_0x9e357c[_0xe80f('0x1f')]=qs[_0xe80f('0x1f')](_0x599739['query'][_0xe80f('0x1f')]);_0x9e357c['offset']=qs[_0xe80f('0x1e')](_0x599739[_0xe80f('0x2f')][_0xe80f('0x1e')]);}_0x9e357c['order']=qs[_0xe80f('0x38')](_0x599739[_0xe80f('0x2f')]['sort']);_0x9e357c[_0xe80f('0x39')]=qs[_0xe80f('0x31')](_[_0xe80f('0x3a')](_0x599739['query'],_0x57580a[_0xe80f('0x31')]),_0x3937e8);if(_0x599739[_0xe80f('0x2f')][_0xe80f('0x3b')]){_0x9e357c['where']=_[_0xe80f('0x3c')](_0x9e357c[_0xe80f('0x39')],{'$or':_[_0xe80f('0x2e')](_0x3937e8,function(_0x5431dc){if(_0x5431dc['type']!=='VIRTUAL'){var _0x1dae0b={};_0x1dae0b[_0x5431dc[_0xe80f('0x29')]]={'$like':'%'+_0x599739[_0xe80f('0x2f')][_0xe80f('0x3b')]+'%'};return _0x1dae0b;}})});}_0x9e357c=_[_0xe80f('0x3c')]({},_0x9e357c,_0x599739['options']);var _0x522539={'where':_0x9e357c[_0xe80f('0x39')]};return db[_0xe80f('0x3d')][_0xe80f('0x20')](_0x522539)['then'](function(_0x206e88){_0x33e127[_0xe80f('0x20')]=_0x206e88;if(_0x599739[_0xe80f('0x2f')][_0xe80f('0x3e')]){_0x9e357c[_0xe80f('0x3f')]=[{'all':!![]}];}return db['SquareReport']['findAll'](_0x9e357c);})[_0xe80f('0x26')](function(_0x20d589){_0x33e127[_0xe80f('0x40')]=_0x20d589;return _0x33e127;})[_0xe80f('0x26')](respondWithFilteredResult(_0x4a8e51,_0x9e357c))['catch'](handleError(_0x4a8e51,null));};exports[_0xe80f('0x41')]=function(_0xf5df4,_0x5b0158){var _0xbe1393={'raw':!![],'where':{'id':_0xf5df4[_0xe80f('0x42')]['id']}},_0x2e242d={};_0x2e242d['model']=_[_0xe80f('0x30')](db[_0xe80f('0x3d')][_0xe80f('0x43')]);_0x2e242d[_0xe80f('0x2f')]=_[_0xe80f('0x30')](_0xf5df4[_0xe80f('0x2f')]);_0x2e242d['filters']=_[_0xe80f('0x32')](_0x2e242d['model'],_0x2e242d['query']);_0xbe1393['attributes']=_['intersection'](_0x2e242d[_0xe80f('0x2d')],qs['fields'](_0xf5df4[_0xe80f('0x2f')]['fields']));_0xbe1393['attributes']=_0xbe1393[_0xe80f('0x33')][_0xe80f('0x35')]?_0xbe1393['attributes']:_0x2e242d[_0xe80f('0x2d')];if(_0xf5df4[_0xe80f('0x2f')][_0xe80f('0x3e')]){_0xbe1393[_0xe80f('0x3f')]=[{'all':!![]}];}_0xbe1393=_['merge']({},_0xbe1393,_0xf5df4[_0xe80f('0x44')]);return db[_0xe80f('0x3d')][_0xe80f('0x45')](_0xbe1393)['then'](handleEntityNotFound(_0x5b0158,null))[_0xe80f('0x26')](respondWithResult(_0x5b0158,null))[_0xe80f('0x46')](handleError(_0x5b0158,null));};exports[_0xe80f('0x47')]=function(_0xd83417,_0x4bc314){return db[_0xe80f('0x3d')][_0xe80f('0x47')](_0xd83417[_0xe80f('0x48')],{})[_0xe80f('0x26')](respondWithResult(_0x4bc314,0xc9))['catch'](handleError(_0x4bc314,null));};exports['update']=function(_0x45e01d,_0x5e53f0){if(_0x45e01d[_0xe80f('0x48')]['id']){delete _0x45e01d[_0xe80f('0x48')]['id'];}return db[_0xe80f('0x3d')]['find']({'where':{'id':_0x45e01d[_0xe80f('0x42')]['id']}})['then'](handleEntityNotFound(_0x5e53f0,null))[_0xe80f('0x26')](saveUpdates(_0x45e01d[_0xe80f('0x48')],null))[_0xe80f('0x26')](respondWithResult(_0x5e53f0,null))[_0xe80f('0x46')](handleError(_0x5e53f0,null));};exports['destroy']=function(_0x14efcc,_0x5e69d8){return db[_0xe80f('0x3d')][_0xe80f('0x45')]({'where':{'id':_0x14efcc[_0xe80f('0x42')]['id']}})[_0xe80f('0x26')](handleEntityNotFound(_0x5e69d8,null))[_0xe80f('0x26')](removeEntity(_0x5e69d8,null))[_0xe80f('0x46')](handleError(_0x5e69d8,null));};exports[_0xe80f('0x49')]=function(_0x2b41c3,_0xbc3fe8){return db[_0xe80f('0x3d')][_0xe80f('0x49')]()[_0xe80f('0x26')](respondWithResult(_0xbc3fe8,null))[_0xe80f('0x46')](handleError(_0xbc3fe8,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 3499957..fc68e9f 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 _0xae52=['uniqueid','leaveAt','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./squareReport.attributes','exports','SquareReport','report_square','uid_pname'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xae52,0x14c));var _0x2ae5=function(_0x3e3bee,_0x4f91fe){_0x3e3bee=_0x3e3bee-0x0;var _0x3ae14c=_0xae52[_0x3e3bee];return _0x3ae14c;};'use strict';var _=require(_0x2ae5('0x0'));var util=require('util');var logger=require(_0x2ae5('0x1'))(_0x2ae5('0x2'));var moment=require(_0x2ae5('0x3'));var BPromise=require(_0x2ae5('0x4'));var rp=require(_0x2ae5('0x5'));var fs=require('fs');var path=require(_0x2ae5('0x6'));var rimraf=require('rimraf');var config=require(_0x2ae5('0x7'));var attributes=require(_0x2ae5('0x8'));module[_0x2ae5('0x9')]=function(_0x5748ee,_0x18de56){return _0x5748ee['define'](_0x2ae5('0xa'),attributes,{'tableName':_0x2ae5('0xb'),'paranoid':![],'indexes':[{'name':_0x2ae5('0xc'),'fields':[_0x2ae5('0xd'),'project_name']},{'name':_0x2ae5('0xe'),'fields':[_0x2ae5('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1c04=['SquareReport','uid_pname','project_name','leaveAt','lodash','util','../../config/logger','moment','request-promise','rimraf','./squareReport.attributes'];(function(_0x240261,_0x4fe66c){var _0x45c332=function(_0x4f367a){while(--_0x4f367a){_0x240261['push'](_0x240261['shift']());}};_0x45c332(++_0x4fe66c);}(_0x1c04,0x1dd));var _0x41c0=function(_0x5a3f3a,_0x3ae10e){_0x5a3f3a=_0x5a3f3a-0x0;var _0x5a6216=_0x1c04[_0x5a3f3a];return _0x5a6216;};'use strict';var _=require(_0x41c0('0x0'));var util=require(_0x41c0('0x1'));var logger=require(_0x41c0('0x2'))('api');var moment=require(_0x41c0('0x3'));var BPromise=require('bluebird');var rp=require(_0x41c0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x41c0('0x5'));var config=require('../../config/environment');var attributes=require(_0x41c0('0x6'));module['exports']=function(_0x658646,_0x140794){return _0x658646['define'](_0x41c0('0x7'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0x41c0('0x8'),'fields':['uniqueid',_0x41c0('0x9')]},{'name':_0x41c0('0xa'),'fields':['leaveAt']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index e114188..7e6d0b9 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 _0x7974=['catch','CreateSquareReport','create','body','options','raw','UpdateSquareReport','SquareReport','update','where','attributes','limit','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x1d5804,_0x3c49ea){var _0x482044=function(_0x43ec36){while(--_0x43ec36){_0x1d5804['push'](_0x1d5804['shift']());}};_0x482044(++_0x3c49ea);}(_0x7974,0x14c));var _0x4797=function(_0xa8883,_0x1f107f){_0xa8883=_0xa8883-0x0;var _0x479426=_0x7974[_0xa8883];return _0x479426;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4797('0x0'));var BPromise=require(_0x4797('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4797('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x4797('0x3'));var logger=require(_0x4797('0x4'))(_0x4797('0x5'));var config=require(_0x4797('0x6'));var jayson=require(_0x4797('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x32b80d,_0x33efc3,_0x253ad7){return new BPromise(function(_0x249c1e,_0x51a1a9){return client[_0x4797('0x8')](_0x32b80d,_0x253ad7)[_0x4797('0x9')](function(_0x447adc){logger[_0x4797('0xa')](_0x4797('0xb'),_0x33efc3,_0x4797('0xc'));logger[_0x4797('0xd')](_0x4797('0xe'),_0x33efc3,'request\x20sent',JSON[_0x4797('0xf')](_0x447adc));if(_0x447adc[_0x4797('0x10')]){if(_0x447adc[_0x4797('0x10')][_0x4797('0x11')]===0x1f4){logger[_0x4797('0x10')](_0x4797('0xb'),_0x33efc3,_0x447adc[_0x4797('0x10')][_0x4797('0x12')]);return _0x51a1a9(_0x447adc[_0x4797('0x10')]['message']);}logger[_0x4797('0x10')](_0x4797('0xb'),_0x33efc3,_0x447adc['error'][_0x4797('0x12')]);return _0x249c1e(_0x447adc['error'][_0x4797('0x12')]);}else{logger[_0x4797('0xa')]('SquareReport,\x20%s,\x20%s',_0x33efc3,_0x4797('0xc'));_0x249c1e(_0x447adc[_0x4797('0x13')][_0x4797('0x12')]);}})[_0x4797('0x14')](function(_0x1697fc){logger[_0x4797('0x10')](_0x4797('0xb'),_0x33efc3,_0x1697fc);_0x51a1a9(_0x1697fc);});});}exports[_0x4797('0x15')]=function(_0x23808c){var _0x320173=this;return new Promise(function(_0x363c0f,_0x2a6eba){return db['SquareReport'][_0x4797('0x16')](_0x23808c[_0x4797('0x17')],{'raw':_0x23808c['options']?_0x23808c[_0x4797('0x18')][_0x4797('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x455f2c){logger['info']('CreateSquareReport',_0x23808c);logger[_0x4797('0xd')](_0x4797('0x15'),_0x23808c,JSON[_0x4797('0xf')](_0x455f2c));_0x363c0f(_0x455f2c);})[_0x4797('0x14')](function(_0x4a24c6){logger['error']('CreateSquareReport',_0x4a24c6[_0x4797('0x12')],_0x23808c);_0x2a6eba(_0x320173['error'](0x1f4,_0x4a24c6[_0x4797('0x12')]));});});};exports[_0x4797('0x1a')]=function(_0x488067){var _0x4a4da6=this;return new Promise(function(_0x3d1e37,_0xc9fb22){return db[_0x4797('0x1b')][_0x4797('0x1c')](_0x488067[_0x4797('0x17')],{'raw':_0x488067[_0x4797('0x18')]?_0x488067['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x488067['options']?_0x488067[_0x4797('0x18')][_0x4797('0x1d')]||null:null,'attributes':_0x488067[_0x4797('0x18')]?_0x488067[_0x4797('0x18')][_0x4797('0x1e')]||null:null,'limit':_0x488067['options']?_0x488067[_0x4797('0x18')][_0x4797('0x1f')]||null:null})['then'](function(_0x2f198a){logger[_0x4797('0xa')](_0x4797('0x1a'),_0x488067);logger[_0x4797('0xd')](_0x4797('0x1a'),_0x488067,JSON[_0x4797('0xf')](_0x2f198a));_0x3d1e37(_0x2f198a);})[_0x4797('0x14')](function(_0x3d8474){logger['error'](_0x4797('0x1a'),_0x3d8474[_0x4797('0x12')],_0x488067);_0xc9fb22(_0x4a4da6['error'](0x1f4,_0x3d8474[_0x4797('0x12')]));});});}; \ No newline at end of file +var _0x6354=['debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SquareReport,\x20%s,\x20%s','result','SquareReport','create','body','options','raw','CreateSquareReport','catch','UpdateSquareReport','update','where','attributes','limit','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','request','info'];(function(_0x506d89,_0x41f9c0){var _0x3d408d=function(_0x3d5119){while(--_0x3d5119){_0x506d89['push'](_0x506d89['shift']());}};_0x3d408d(++_0x41f9c0);}(_0x6354,0xed));var _0x4635=function(_0x54fb55,_0x140bb3){_0x54fb55=_0x54fb55-0x0;var _0x54f136=_0x6354[_0x54fb55];return _0x54f136;};'use strict';var _=require(_0x4635('0x0'));var util=require('util');var moment=require(_0x4635('0x1'));var BPromise=require(_0x4635('0x2'));var rs=require(_0x4635('0x3'));var fs=require('fs');var Redis=require(_0x4635('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4635('0x5'))(_0x4635('0x6'));var config=require(_0x4635('0x7'));var jayson=require(_0x4635('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2bb2bd,_0x2ee4b2,_0x32059d){return new BPromise(function(_0x2a812b,_0x44f157){return client[_0x4635('0x9')](_0x2bb2bd,_0x32059d)['then'](function(_0x47f38d){logger[_0x4635('0xa')]('SquareReport,\x20%s,\x20%s',_0x2ee4b2,'request\x20sent');logger[_0x4635('0xb')](_0x4635('0xc'),_0x2ee4b2,'request\x20sent',JSON[_0x4635('0xd')](_0x47f38d));if(_0x47f38d[_0x4635('0xe')]){if(_0x47f38d[_0x4635('0xe')][_0x4635('0xf')]===0x1f4){logger[_0x4635('0xe')]('SquareReport,\x20%s,\x20%s',_0x2ee4b2,_0x47f38d[_0x4635('0xe')][_0x4635('0x10')]);return _0x44f157(_0x47f38d[_0x4635('0xe')][_0x4635('0x10')]);}logger['error'](_0x4635('0x11'),_0x2ee4b2,_0x47f38d['error'][_0x4635('0x10')]);return _0x2a812b(_0x47f38d[_0x4635('0xe')]['message']);}else{logger[_0x4635('0xa')]('SquareReport,\x20%s,\x20%s',_0x2ee4b2,'request\x20sent');_0x2a812b(_0x47f38d[_0x4635('0x12')][_0x4635('0x10')]);}})['catch'](function(_0x22f468){logger[_0x4635('0xe')]('SquareReport,\x20%s,\x20%s',_0x2ee4b2,_0x22f468);_0x44f157(_0x22f468);});});}exports['CreateSquareReport']=function(_0x2053a5){var _0x5a170e=this;return new Promise(function(_0x362aaa,_0x4e18c5){return db[_0x4635('0x13')][_0x4635('0x14')](_0x2053a5[_0x4635('0x15')],{'raw':_0x2053a5[_0x4635('0x16')]?_0x2053a5[_0x4635('0x16')][_0x4635('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x4f9753){logger['info'](_0x4635('0x18'),_0x2053a5);logger[_0x4635('0xb')]('CreateSquareReport',_0x2053a5,JSON[_0x4635('0xd')](_0x4f9753));_0x362aaa(_0x4f9753);})[_0x4635('0x19')](function(_0x3b8cd0){logger[_0x4635('0xe')](_0x4635('0x18'),_0x3b8cd0[_0x4635('0x10')],_0x2053a5);_0x4e18c5(_0x5a170e[_0x4635('0xe')](0x1f4,_0x3b8cd0[_0x4635('0x10')]));});});};exports[_0x4635('0x1a')]=function(_0x5b1fbd){var _0x12e625=this;return new Promise(function(_0x46a375,_0x3d2fc4){return db['SquareReport'][_0x4635('0x1b')](_0x5b1fbd[_0x4635('0x15')],{'raw':_0x5b1fbd[_0x4635('0x16')]?_0x5b1fbd['options'][_0x4635('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5b1fbd[_0x4635('0x16')]?_0x5b1fbd[_0x4635('0x16')][_0x4635('0x1c')]||null:null,'attributes':_0x5b1fbd[_0x4635('0x16')]?_0x5b1fbd[_0x4635('0x16')][_0x4635('0x1d')]||null:null,'limit':_0x5b1fbd['options']?_0x5b1fbd[_0x4635('0x16')][_0x4635('0x1e')]||null:null})['then'](function(_0x325cb0){logger[_0x4635('0xa')]('UpdateSquareReport',_0x5b1fbd);logger[_0x4635('0xb')](_0x4635('0x1a'),_0x5b1fbd,JSON['stringify'](_0x325cb0));_0x46a375(_0x325cb0);})['catch'](function(_0x407a88){logger[_0x4635('0xe')](_0x4635('0x1a'),_0x407a88['message'],_0x5b1fbd);_0x3d2fc4(_0x12e625[_0x4635('0xe')](0x1f4,_0x407a88[_0x4635('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 3f83350..09c1356 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 _0x0418=['show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','get','isAuthenticated','index','/describe','/:id'];(function(_0x4ca1b8,_0x9faad5){var _0x49b9e4=function(_0x360bcd){while(--_0x360bcd){_0x4ca1b8['push'](_0x4ca1b8['shift']());}};_0x49b9e4(++_0x9faad5);}(_0x0418,0x8c));var _0x8041=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x0418[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x8041('0x0'));var util=require(_0x8041('0x1'));var path=require(_0x8041('0x2'));var timeout=require(_0x8041('0x3'));var express=require(_0x8041('0x4'));var router=express[_0x8041('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8041('0x6'));var controller=require('./squareReportDetail.controller');router[_0x8041('0x7')]('/',auth[_0x8041('0x8')](),controller[_0x8041('0x9')]);router[_0x8041('0x7')](_0x8041('0xa'),auth[_0x8041('0x8')](),controller['describe']);router[_0x8041('0x7')](_0x8041('0xb'),auth[_0x8041('0x8')](),controller[_0x8041('0xc')]);router[_0x8041('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x8041('0xe')]('/:id',auth[_0x8041('0x8')](),controller[_0x8041('0xf')]);router[_0x8041('0x10')](_0x8041('0xb'),auth[_0x8041('0x8')](),controller[_0x8041('0x11')]);module[_0x8041('0x12')]=router; \ No newline at end of file +var _0x88bf=['Router','../../components/auth/service','../../config/environment','get','index','isAuthenticated','describe','/:id','post','exports'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x88bf,0x64));var _0xf88b=function(_0x46ab02,_0x46f430){_0x46ab02=_0x46ab02-0x0;var _0x39d9a4=_0x88bf[_0x46ab02];return _0x39d9a4;};'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[_0xf88b('0x0')]();var fs_extra=require('fs-extra');var auth=require(_0xf88b('0x1'));var interaction=require('../../components/interaction/service');var config=require(_0xf88b('0x2'));var controller=require('./squareReportDetail.controller');router[_0xf88b('0x3')]('/',auth['isAuthenticated'](),controller[_0xf88b('0x4')]);router[_0xf88b('0x3')]('/describe',auth[_0xf88b('0x5')](),controller[_0xf88b('0x6')]);router['get'](_0xf88b('0x7'),auth['isAuthenticated'](),controller['show']);router[_0xf88b('0x8')]('/',auth[_0xf88b('0x5')](),controller['create']);router['put'](_0xf88b('0x7'),auth[_0xf88b('0x5')](),controller['update']);router['delete'](_0xf88b('0x7'),auth[_0xf88b('0x5')](),controller['destroy']);module[_0xf88b('0x9')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index ddb0b3a..6b6029a 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 _0x96eb=['STRING','TEXT'];(function(_0xdcef9f,_0x5e9723){var _0x2f6a0f=function(_0x2be681){while(--_0x2be681){_0xdcef9f['push'](_0xdcef9f['shift']());}};_0x2f6a0f(++_0x5e9723);}(_0x96eb,0x1c4));var _0xb96e=function(_0x22990a,_0x1e1aaf){_0x22990a=_0x22990a-0x0;var _0x32c420=_0x96eb[_0x22990a];return _0x32c420;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xb96e('0x0')]},'node':{'type':Sequelize[_0xb96e('0x0')]},'application':{'type':Sequelize[_0xb96e('0x0')]},'data':{'type':Sequelize[_0xb96e('0x1')]},'project_name':{'type':Sequelize[_0xb96e('0x0')]},'callerid':{'type':Sequelize[_0xb96e('0x0')]}}; \ No newline at end of file +var _0x2cd5=['STRING','TEXT','exports'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0x2cd5,0x9b));var _0x52cd=function(_0x214ca5,_0x4ff70c){_0x214ca5=_0x214ca5-0x0;var _0x2d5156=_0x2cd5[_0x214ca5];return _0x2d5156;};'use strict';var Sequelize=require('sequelize');module[_0x52cd('0x0')]={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize[_0x52cd('0x1')]},'application':{'type':Sequelize[_0x52cd('0x1')]},'data':{'type':Sequelize[_0x52cd('0x2')]},'project_name':{'type':Sequelize[_0x52cd('0x1')]},'callerid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 1a9e17a..eef350e 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 _0x8e29=['json','offset','count','limit','set','apply','reject','update','then','destroy','end','error','stack','name','send','SquareDetailsReport','rawAttributes','fieldName','key','model','keys','query','filters','attributes','fields','length','hasOwnProperty','sort','where','pick','merge','map','type','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','intersection','find','create','body','describe','eml-format','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','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'];(function(_0x5c1cdc,_0x322014){var _0x2e8317=function(_0x2e9dfa){while(--_0x2e9dfa){_0x5c1cdc['push'](_0x5c1cdc['shift']());}};_0x2e8317(++_0x322014);}(_0x8e29,0x10d));var _0x98e2=function(_0x29e16e,_0x28959a){_0x29e16e=_0x29e16e-0x0;var _0x52b749=_0x8e29[_0x29e16e];return _0x52b749;};'use strict';var emlformat=require(_0x98e2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x98e2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x98e2('0x2'));var BPromise=require(_0x98e2('0x3'));var Mustache=require(_0x98e2('0x4'));var util=require(_0x98e2('0x5'));var path=require(_0x98e2('0x6'));var sox=require(_0x98e2('0x7'));var csv=require(_0x98e2('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x98e2('0x9'));var _=require(_0x98e2('0xa'));var squel=require(_0x98e2('0xb'));var crypto=require(_0x98e2('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x98e2('0xd'));var toCsv=require('to-csv');var querystring=require(_0x98e2('0xe'));var Papa=require('papaparse');var Redis=require(_0x98e2('0xf'));var authService=require(_0x98e2('0x10'));var qs=require(_0x98e2('0x11'));var as=require(_0x98e2('0x12'));var hardwareService=require(_0x98e2('0x13'));var logger=require(_0x98e2('0x14'))('api');var utils=require(_0x98e2('0x15'));var config=require(_0x98e2('0x16'));var licenseUtil=require(_0x98e2('0x17'));var db=require(_0x98e2('0x18'))['db'];function respondWithStatusCode(_0x339eb1,_0x2db7ba){_0x2db7ba=_0x2db7ba||0xcc;return function(_0x198d1e){if(_0x198d1e){return _0x339eb1[_0x98e2('0x19')](_0x2db7ba);}return _0x339eb1[_0x98e2('0x1a')](_0x2db7ba)['end']();};}function respondWithResult(_0x29e583,_0x296615){_0x296615=_0x296615||0xc8;return function(_0xb161cb){if(_0xb161cb){return _0x29e583['status'](_0x296615)[_0x98e2('0x1b')](_0xb161cb);}};}function respondWithFilteredResult(_0x2d1569,_0x16f02b){return function(_0x4dcd13){if(_0x4dcd13){var _0x183ea6=typeof _0x16f02b[_0x98e2('0x1c')]==='undefined'&&typeof _0x16f02b['limit']==='undefined';var _0x48fff3=_0x4dcd13['count'];var _0x40f46c=_0x183ea6?0x0:_0x16f02b[_0x98e2('0x1c')];var _0x30507=_0x183ea6?_0x4dcd13[_0x98e2('0x1d')]:_0x16f02b[_0x98e2('0x1c')]+_0x16f02b[_0x98e2('0x1e')];var _0x181fc8;if(_0x30507>=_0x48fff3){_0x30507=_0x48fff3;_0x181fc8=0xc8;}else{_0x181fc8=0xce;}_0x2d1569[_0x98e2('0x1a')](_0x181fc8);return _0x2d1569[_0x98e2('0x1f')]('Content-Range',_0x40f46c+'-'+_0x30507+'/'+_0x48fff3)['json'](_0x4dcd13);}return null;};}function patchUpdates(_0x3b12fa){return function(_0x42567f){try{jsonpatch[_0x98e2('0x20')](_0x42567f,_0x3b12fa,!![]);}catch(_0x49e8a2){return BPromise[_0x98e2('0x21')](_0x49e8a2);}return _0x42567f['save']();};}function saveUpdates(_0x454c29,_0x536ae1){return function(_0xa30bf7){if(_0xa30bf7){return _0xa30bf7[_0x98e2('0x22')](_0x454c29)[_0x98e2('0x23')](function(_0x227570){return _0x227570;});}return null;};}function removeEntity(_0x5e8077,_0x3c0414){return function(_0xbd909a){if(_0xbd909a){return _0xbd909a[_0x98e2('0x24')]()['then'](function(){_0x5e8077[_0x98e2('0x1a')](0xcc)[_0x98e2('0x25')]();});}};}function handleEntityNotFound(_0x2f6377,_0x334447){return function(_0x472e49){if(!_0x472e49){_0x2f6377['sendStatus'](0x194);}return _0x472e49;};}function handleError(_0x1bc3be,_0x540cbe){_0x540cbe=_0x540cbe||0x1f4;return function(_0x12f70c){logger[_0x98e2('0x26')](_0x12f70c[_0x98e2('0x27')]);if(_0x12f70c[_0x98e2('0x28')]){delete _0x12f70c[_0x98e2('0x28')];}_0x1bc3be['status'](_0x540cbe)[_0x98e2('0x29')](_0x12f70c);};}exports['index']=function(_0x40afaf,_0x42a150){var _0x471101={},_0x47d6df={},_0x8407e4={'count':0x0,'rows':[]};var _0x48fd4d=_['map'](db[_0x98e2('0x2a')][_0x98e2('0x2b')],function(_0x450821){return{'name':_0x450821[_0x98e2('0x2c')],'type':_0x450821['type'][_0x98e2('0x2d')]};});_0x47d6df[_0x98e2('0x2e')]=_['map'](_0x48fd4d,_0x98e2('0x28'));_0x47d6df['query']=_[_0x98e2('0x2f')](_0x40afaf[_0x98e2('0x30')]);_0x47d6df[_0x98e2('0x31')]=_['intersection'](_0x47d6df[_0x98e2('0x2e')],_0x47d6df['query']);_0x471101[_0x98e2('0x32')]=_['intersection'](_0x47d6df[_0x98e2('0x2e')],qs[_0x98e2('0x33')](_0x40afaf[_0x98e2('0x30')]['fields']));_0x471101[_0x98e2('0x32')]=_0x471101['attributes'][_0x98e2('0x34')]?_0x471101[_0x98e2('0x32')]:_0x47d6df[_0x98e2('0x2e')];if(!_0x40afaf[_0x98e2('0x30')][_0x98e2('0x35')]('nolimit')){_0x471101[_0x98e2('0x1e')]=qs[_0x98e2('0x1e')](_0x40afaf[_0x98e2('0x30')][_0x98e2('0x1e')]);_0x471101[_0x98e2('0x1c')]=qs[_0x98e2('0x1c')](_0x40afaf[_0x98e2('0x30')][_0x98e2('0x1c')]);}_0x471101['order']=qs[_0x98e2('0x36')](_0x40afaf['query'][_0x98e2('0x36')]);_0x471101[_0x98e2('0x37')]=qs[_0x98e2('0x31')](_[_0x98e2('0x38')](_0x40afaf['query'],_0x47d6df[_0x98e2('0x31')]),_0x48fd4d);if(_0x40afaf[_0x98e2('0x30')]['filter']){_0x471101[_0x98e2('0x37')]=_[_0x98e2('0x39')](_0x471101['where'],{'$or':_[_0x98e2('0x3a')](_0x48fd4d,function(_0x1bed45){if(_0x1bed45[_0x98e2('0x3b')]!==_0x98e2('0x3c')){var _0x4e8021={};_0x4e8021[_0x1bed45[_0x98e2('0x28')]]={'$like':'%'+_0x40afaf[_0x98e2('0x30')][_0x98e2('0x3d')]+'%'};return _0x4e8021;}})});}_0x471101=_['merge']({},_0x471101,_0x40afaf[_0x98e2('0x3e')]);var _0x56e40f={'where':_0x471101['where']};return db[_0x98e2('0x2a')][_0x98e2('0x1d')](_0x56e40f)[_0x98e2('0x23')](function(_0x436570){_0x8407e4['count']=_0x436570;if(_0x40afaf[_0x98e2('0x30')]['includeAll']){_0x471101[_0x98e2('0x3f')]=[{'all':!![]}];}return db[_0x98e2('0x2a')][_0x98e2('0x40')](_0x471101);})[_0x98e2('0x23')](function(_0x3fd3cd){_0x8407e4[_0x98e2('0x41')]=_0x3fd3cd;return _0x8407e4;})[_0x98e2('0x23')](respondWithFilteredResult(_0x42a150,_0x471101))[_0x98e2('0x42')](handleError(_0x42a150,null));};exports[_0x98e2('0x43')]=function(_0x39c47d,_0x12d7b2){var _0x5befa2={'raw':!![],'where':{'id':_0x39c47d[_0x98e2('0x44')]['id']}},_0xdbc8dc={};_0xdbc8dc['model']=_[_0x98e2('0x2f')](db[_0x98e2('0x2a')][_0x98e2('0x2b')]);_0xdbc8dc[_0x98e2('0x30')]=_['keys'](_0x39c47d[_0x98e2('0x30')]);_0xdbc8dc['filters']=_[_0x98e2('0x45')](_0xdbc8dc[_0x98e2('0x2e')],_0xdbc8dc[_0x98e2('0x30')]);_0x5befa2[_0x98e2('0x32')]=_[_0x98e2('0x45')](_0xdbc8dc[_0x98e2('0x2e')],qs['fields'](_0x39c47d[_0x98e2('0x30')][_0x98e2('0x33')]));_0x5befa2[_0x98e2('0x32')]=_0x5befa2[_0x98e2('0x32')][_0x98e2('0x34')]?_0x5befa2[_0x98e2('0x32')]:_0xdbc8dc['model'];if(_0x39c47d['query']['includeAll']){_0x5befa2[_0x98e2('0x3f')]=[{'all':!![]}];}_0x5befa2=_[_0x98e2('0x39')]({},_0x5befa2,_0x39c47d[_0x98e2('0x3e')]);return db[_0x98e2('0x2a')][_0x98e2('0x46')](_0x5befa2)[_0x98e2('0x23')](handleEntityNotFound(_0x12d7b2,null))[_0x98e2('0x23')](respondWithResult(_0x12d7b2,null))[_0x98e2('0x42')](handleError(_0x12d7b2,null));};exports[_0x98e2('0x47')]=function(_0x2c613a,_0x44e7a9){return db[_0x98e2('0x2a')][_0x98e2('0x47')](_0x2c613a['body'],{})[_0x98e2('0x23')](respondWithResult(_0x44e7a9,0xc9))['catch'](handleError(_0x44e7a9,null));};exports[_0x98e2('0x22')]=function(_0x1bf0ed,_0x1009f2){if(_0x1bf0ed[_0x98e2('0x48')]['id']){delete _0x1bf0ed[_0x98e2('0x48')]['id'];}return db[_0x98e2('0x2a')][_0x98e2('0x46')]({'where':{'id':_0x1bf0ed[_0x98e2('0x44')]['id']}})[_0x98e2('0x23')](handleEntityNotFound(_0x1009f2,null))[_0x98e2('0x23')](saveUpdates(_0x1bf0ed[_0x98e2('0x48')],null))[_0x98e2('0x23')](respondWithResult(_0x1009f2,null))[_0x98e2('0x42')](handleError(_0x1009f2,null));};exports['destroy']=function(_0x4db04a,_0x544366){return db[_0x98e2('0x2a')][_0x98e2('0x46')]({'where':{'id':_0x4db04a[_0x98e2('0x44')]['id']}})[_0x98e2('0x23')](handleEntityNotFound(_0x544366,null))[_0x98e2('0x23')](removeEntity(_0x544366,null))[_0x98e2('0x42')](handleError(_0x544366,null));};exports['describe']=function(_0x55749d,_0xa68d94){return db[_0x98e2('0x2a')][_0x98e2('0x49')]()[_0x98e2('0x23')](respondWithResult(_0xa68d94,null))[_0x98e2('0x42')](handleError(_0xa68d94,null));}; \ No newline at end of file +var _0x567d=['index','SquareDetailsReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','includeAll','findAll','rows','catch','show','length','options','find','create','body','update','params','describe','rimraf','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../mysqldb','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','then','destroy','sendStatus','error','name','send'];(function(_0x43d11d,_0xccff91){var _0x38cd08=function(_0x131ae2){while(--_0x131ae2){_0x43d11d['push'](_0x43d11d['shift']());}};_0x38cd08(++_0xccff91);}(_0x567d,0x17c));var _0xd567=function(_0x3ad746,_0x5275b6){_0x3ad746=_0x3ad746-0x0;var _0x5d73e4=_0x567d[_0x3ad746];return _0x5d73e4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd567('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd567('0x1'));var moment=require(_0xd567('0x2'));var BPromise=require(_0xd567('0x3'));var Mustache=require('mustache');var util=require(_0xd567('0x4'));var path=require(_0xd567('0x5'));var sox=require('sox');var csv=require(_0xd567('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd567('0x7'));var _=require(_0xd567('0x8'));var squel=require(_0xd567('0x9'));var crypto=require(_0xd567('0xa'));var jsforce=require(_0xd567('0xb'));var deskjs=require(_0xd567('0xc'));var toCsv=require(_0xd567('0x6'));var querystring=require(_0xd567('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd567('0xe'));var as=require(_0xd567('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd567('0x10'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xd567('0x11'))['db'];function respondWithStatusCode(_0x5e69f7,_0x41c2c6){_0x41c2c6=_0x41c2c6||0xcc;return function(_0xc1c059){if(_0xc1c059){return _0x5e69f7['sendStatus'](_0x41c2c6);}return _0x5e69f7[_0xd567('0x12')](_0x41c2c6)['end']();};}function respondWithResult(_0xc3b65b,_0x686f87){_0x686f87=_0x686f87||0xc8;return function(_0x27a0da){if(_0x27a0da){return _0xc3b65b[_0xd567('0x12')](_0x686f87)[_0xd567('0x13')](_0x27a0da);}};}function respondWithFilteredResult(_0xbb72f7,_0x851e58){return function(_0xf3fdf4){if(_0xf3fdf4){var _0x5a89f4=typeof _0x851e58[_0xd567('0x14')]==='undefined'&&typeof _0x851e58[_0xd567('0x15')]===_0xd567('0x16');var _0x26fddb=_0xf3fdf4['count'];var _0x1d530f=_0x5a89f4?0x0:_0x851e58[_0xd567('0x14')];var _0x21cb86=_0x5a89f4?_0xf3fdf4[_0xd567('0x17')]:_0x851e58['offset']+_0x851e58[_0xd567('0x15')];var _0x3de837;if(_0x21cb86>=_0x26fddb){_0x21cb86=_0x26fddb;_0x3de837=0xc8;}else{_0x3de837=0xce;}_0xbb72f7[_0xd567('0x12')](_0x3de837);return _0xbb72f7[_0xd567('0x18')](_0xd567('0x19'),_0x1d530f+'-'+_0x21cb86+'/'+_0x26fddb)[_0xd567('0x13')](_0xf3fdf4);}return null;};}function patchUpdates(_0x47afb1){return function(_0x5f368f){try{jsonpatch[_0xd567('0x1a')](_0x5f368f,_0x47afb1,!![]);}catch(_0x5a3245){return BPromise['reject'](_0x5a3245);}return _0x5f368f[_0xd567('0x1b')]();};}function saveUpdates(_0x522dc8,_0xd3c152){return function(_0x46c34a){if(_0x46c34a){return _0x46c34a['update'](_0x522dc8)[_0xd567('0x1c')](function(_0x69ef16){return _0x69ef16;});}return null;};}function removeEntity(_0x1b9d09,_0x1e4299){return function(_0x26365e){if(_0x26365e){return _0x26365e[_0xd567('0x1d')]()[_0xd567('0x1c')](function(){_0x1b9d09['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3190d8,_0x4bb2a3){return function(_0x4ddc1b){if(!_0x4ddc1b){_0x3190d8[_0xd567('0x1e')](0x194);}return _0x4ddc1b;};}function handleError(_0x3153f5,_0x15ea4e){_0x15ea4e=_0x15ea4e||0x1f4;return function(_0x526707){logger[_0xd567('0x1f')](_0x526707['stack']);if(_0x526707[_0xd567('0x20')]){delete _0x526707[_0xd567('0x20')];}_0x3153f5['status'](_0x15ea4e)[_0xd567('0x21')](_0x526707);};}exports[_0xd567('0x22')]=function(_0x2fc374,_0x2be844){var _0x103f3a={},_0x4d8fe6={},_0x391d2c={'count':0x0,'rows':[]};var _0xf7ac70=_['map'](db[_0xd567('0x23')][_0xd567('0x24')],function(_0x4a9a8c){return{'name':_0x4a9a8c[_0xd567('0x25')],'type':_0x4a9a8c[_0xd567('0x26')]['key']};});_0x4d8fe6[_0xd567('0x27')]=_['map'](_0xf7ac70,'name');_0x4d8fe6[_0xd567('0x28')]=_[_0xd567('0x29')](_0x2fc374['query']);_0x4d8fe6[_0xd567('0x2a')]=_[_0xd567('0x2b')](_0x4d8fe6[_0xd567('0x27')],_0x4d8fe6[_0xd567('0x28')]);_0x103f3a[_0xd567('0x2c')]=_[_0xd567('0x2b')](_0x4d8fe6[_0xd567('0x27')],qs[_0xd567('0x2d')](_0x2fc374['query'][_0xd567('0x2d')]));_0x103f3a['attributes']=_0x103f3a[_0xd567('0x2c')]['length']?_0x103f3a[_0xd567('0x2c')]:_0x4d8fe6[_0xd567('0x27')];if(!_0x2fc374['query'][_0xd567('0x2e')](_0xd567('0x2f'))){_0x103f3a[_0xd567('0x15')]=qs[_0xd567('0x15')](_0x2fc374[_0xd567('0x28')]['limit']);_0x103f3a['offset']=qs[_0xd567('0x14')](_0x2fc374[_0xd567('0x28')][_0xd567('0x14')]);}_0x103f3a[_0xd567('0x30')]=qs[_0xd567('0x31')](_0x2fc374[_0xd567('0x28')][_0xd567('0x31')]);_0x103f3a[_0xd567('0x32')]=qs['filters'](_[_0xd567('0x33')](_0x2fc374[_0xd567('0x28')],_0x4d8fe6[_0xd567('0x2a')]),_0xf7ac70);if(_0x2fc374[_0xd567('0x28')][_0xd567('0x34')]){_0x103f3a[_0xd567('0x32')]=_[_0xd567('0x35')](_0x103f3a[_0xd567('0x32')],{'$or':_[_0xd567('0x36')](_0xf7ac70,function(_0x43143a){if(_0x43143a[_0xd567('0x26')]!==_0xd567('0x37')){var _0x40e4d5={};_0x40e4d5[_0x43143a[_0xd567('0x20')]]={'$like':'%'+_0x2fc374[_0xd567('0x28')]['filter']+'%'};return _0x40e4d5;}})});}_0x103f3a=_[_0xd567('0x35')]({},_0x103f3a,_0x2fc374['options']);var _0x25ccd7={'where':_0x103f3a[_0xd567('0x32')]};return db[_0xd567('0x23')]['count'](_0x25ccd7)[_0xd567('0x1c')](function(_0x3c8503){_0x391d2c[_0xd567('0x17')]=_0x3c8503;if(_0x2fc374[_0xd567('0x28')][_0xd567('0x38')]){_0x103f3a['include']=[{'all':!![]}];}return db['SquareDetailsReport'][_0xd567('0x39')](_0x103f3a);})[_0xd567('0x1c')](function(_0x5962d8){_0x391d2c[_0xd567('0x3a')]=_0x5962d8;return _0x391d2c;})['then'](respondWithFilteredResult(_0x2be844,_0x103f3a))[_0xd567('0x3b')](handleError(_0x2be844,null));};exports[_0xd567('0x3c')]=function(_0x116644,_0x71778){var _0x2f3eb6={'raw':!![],'where':{'id':_0x116644['params']['id']}},_0x2bd7bd={};_0x2bd7bd['model']=_[_0xd567('0x29')](db['SquareDetailsReport'][_0xd567('0x24')]);_0x2bd7bd['query']=_[_0xd567('0x29')](_0x116644['query']);_0x2bd7bd['filters']=_['intersection'](_0x2bd7bd[_0xd567('0x27')],_0x2bd7bd[_0xd567('0x28')]);_0x2f3eb6[_0xd567('0x2c')]=_[_0xd567('0x2b')](_0x2bd7bd[_0xd567('0x27')],qs[_0xd567('0x2d')](_0x116644['query'][_0xd567('0x2d')]));_0x2f3eb6[_0xd567('0x2c')]=_0x2f3eb6['attributes'][_0xd567('0x3d')]?_0x2f3eb6[_0xd567('0x2c')]:_0x2bd7bd[_0xd567('0x27')];if(_0x116644[_0xd567('0x28')]['includeAll']){_0x2f3eb6['include']=[{'all':!![]}];}_0x2f3eb6=_[_0xd567('0x35')]({},_0x2f3eb6,_0x116644[_0xd567('0x3e')]);return db[_0xd567('0x23')][_0xd567('0x3f')](_0x2f3eb6)[_0xd567('0x1c')](handleEntityNotFound(_0x71778,null))[_0xd567('0x1c')](respondWithResult(_0x71778,null))['catch'](handleError(_0x71778,null));};exports[_0xd567('0x40')]=function(_0x516604,_0x14a5e2){return db['SquareDetailsReport'][_0xd567('0x40')](_0x516604[_0xd567('0x41')],{})[_0xd567('0x1c')](respondWithResult(_0x14a5e2,0xc9))[_0xd567('0x3b')](handleError(_0x14a5e2,null));};exports[_0xd567('0x42')]=function(_0x9e487,_0x1e9e1e){if(_0x9e487[_0xd567('0x41')]['id']){delete _0x9e487['body']['id'];}return db[_0xd567('0x23')][_0xd567('0x3f')]({'where':{'id':_0x9e487[_0xd567('0x43')]['id']}})[_0xd567('0x1c')](handleEntityNotFound(_0x1e9e1e,null))[_0xd567('0x1c')](saveUpdates(_0x9e487[_0xd567('0x41')],null))[_0xd567('0x1c')](respondWithResult(_0x1e9e1e,null))[_0xd567('0x3b')](handleError(_0x1e9e1e,null));};exports[_0xd567('0x1d')]=function(_0x4ab806,_0x38cf0a){return db[_0xd567('0x23')][_0xd567('0x3f')]({'where':{'id':_0x4ab806[_0xd567('0x43')]['id']}})[_0xd567('0x1c')](handleEntityNotFound(_0x38cf0a,null))[_0xd567('0x1c')](removeEntity(_0x38cf0a,null))['catch'](handleError(_0x38cf0a,null));};exports[_0xd567('0x44')]=function(_0x9350b2,_0x2c611c){return db[_0xd567('0x23')]['describe']()[_0xd567('0x1c')](respondWithResult(_0x2c611c,null))[_0xd567('0x3b')](handleError(_0x2c611c,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 8a63fb4..6d4b063 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 _0x5e66=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./squareReportDetail.attributes','exports','define','SquareDetailsReport'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x5e66,0x1b0));var _0x65e6=function(_0x5b93aa,_0x10b918){_0x5b93aa=_0x5b93aa-0x0;var _0x425bbf=_0x5e66[_0x5b93aa];return _0x425bbf;};'use strict';var _=require(_0x65e6('0x0'));var util=require(_0x65e6('0x1'));var logger=require(_0x65e6('0x2'))(_0x65e6('0x3'));var moment=require(_0x65e6('0x4'));var BPromise=require(_0x65e6('0x5'));var rp=require(_0x65e6('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x65e6('0x7'));var attributes=require(_0x65e6('0x8'));module[_0x65e6('0x9')]=function(_0x43baa9,_0x562827){return _0x43baa9[_0x65e6('0xa')](_0x65e6('0xb'),attributes,{'tableName':'report_square_details','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2891=['lodash','util','../../config/logger','moment','request-promise','path','SquareDetailsReport','report_square_details'];(function(_0x3bd608,_0x4983d3){var _0x538339=function(_0x3f23fd){while(--_0x3f23fd){_0x3bd608['push'](_0x3bd608['shift']());}};_0x538339(++_0x4983d3);}(_0x2891,0xf8));var _0x1289=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x2891[_0x4243a3];return _0x1b2a33;};'use strict';var _=require(_0x1289('0x0'));var util=require(_0x1289('0x1'));var logger=require(_0x1289('0x2'))('api');var moment=require(_0x1289('0x3'));var BPromise=require('bluebird');var rp=require(_0x1289('0x4'));var fs=require('fs');var path=require(_0x1289('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./squareReportDetail.attributes');module['exports']=function(_0x2c4de9,_0x35f688){return _0x2c4de9['define'](_0x1289('0x6'),attributes,{'tableName':_0x1289('0x7'),'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 7aa031f..335e5a8 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 _0x5b12=['../../config/utils','rpc','client','request','then','info','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareDetailsReport,\x20%s,\x20%s','message','catch','CreateSquareDetailsReport','SquareDetailsReport','options','raw','lodash','util','moment','randomstring','../../mysqldb'];(function(_0x2e4c40,_0x50219a){var _0xe0743=function(_0xcec537){while(--_0xcec537){_0x2e4c40['push'](_0x2e4c40['shift']());}};_0xe0743(++_0x50219a);}(_0x5b12,0xa3));var _0x25b1=function(_0x348b07,_0x419704){_0x348b07=_0x348b07-0x0;var _0x20ac52=_0x5b12[_0x348b07];return _0x20ac52;};'use strict';var _=require(_0x25b1('0x0'));var util=require(_0x25b1('0x1'));var moment=require(_0x25b1('0x2'));var BPromise=require('bluebird');var rs=require(_0x25b1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x25b1('0x4'))['db'];var utils=require(_0x25b1('0x5'));var logger=require('../../config/logger')(_0x25b1('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x25b1('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5bb95b,_0x1f715d,_0x28c980){return new BPromise(function(_0x451c66,_0x2a46e0){return client[_0x25b1('0x8')](_0x5bb95b,_0x28c980)[_0x25b1('0x9')](function(_0x3346ed){logger[_0x25b1('0xa')]('SquareDetailsReport,\x20%s,\x20%s',_0x1f715d,_0x25b1('0xb'));logger[_0x25b1('0xc')](_0x25b1('0xd'),_0x1f715d,_0x25b1('0xb'),JSON[_0x25b1('0xe')](_0x3346ed));if(_0x3346ed[_0x25b1('0xf')]){if(_0x3346ed[_0x25b1('0xf')][_0x25b1('0x10')]===0x1f4){logger[_0x25b1('0xf')](_0x25b1('0x11'),_0x1f715d,_0x3346ed[_0x25b1('0xf')][_0x25b1('0x12')]);return _0x2a46e0(_0x3346ed[_0x25b1('0xf')][_0x25b1('0x12')]);}logger[_0x25b1('0xf')](_0x25b1('0x11'),_0x1f715d,_0x3346ed['error'][_0x25b1('0x12')]);return _0x451c66(_0x3346ed[_0x25b1('0xf')]['message']);}else{logger[_0x25b1('0xa')](_0x25b1('0x11'),_0x1f715d,_0x25b1('0xb'));_0x451c66(_0x3346ed['result']['message']);}})[_0x25b1('0x13')](function(_0x573ec2){logger[_0x25b1('0xf')](_0x25b1('0x11'),_0x1f715d,_0x573ec2);_0x2a46e0(_0x573ec2);});});}exports[_0x25b1('0x14')]=function(_0x27ccc9){var _0x1f78c2=this;return new Promise(function(_0x2a7d14,_0x17024a){return db[_0x25b1('0x15')]['create'](_0x27ccc9['body'],{'raw':_0x27ccc9[_0x25b1('0x16')]?_0x27ccc9['options'][_0x25b1('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x3bfd7d){logger['info'](_0x25b1('0x14'),_0x27ccc9);logger['debug'](_0x25b1('0x14'),_0x27ccc9,JSON['stringify'](_0x3bfd7d));_0x2a7d14(_0x3bfd7d);})['catch'](function(_0x565cfd){logger[_0x25b1('0xf')](_0x25b1('0x14'),_0x565cfd['message'],_0x27ccc9);_0x17024a(_0x1f78c2[_0x25b1('0xf')](0x1f4,_0x565cfd[_0x25b1('0x12')]));});});}; \ No newline at end of file +var _0xb6fa=['result','catch','CreateSquareDetailsReport','SquareDetailsReport','create','options','raw','debug','lodash','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x41e991,_0x4667a8){var _0x1bdc85=function(_0x154eab){while(--_0x154eab){_0x41e991['push'](_0x41e991['shift']());}};_0x1bdc85(++_0x4667a8);}(_0xb6fa,0x1c2));var _0xab6f=function(_0x20a558,_0x160e0e){_0x20a558=_0x20a558-0x0;var _0x53d3f7=_0xb6fa[_0x20a558];return _0x53d3f7;};'use strict';var _=require(_0xab6f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xab6f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xab6f('0x2'))['db'];var utils=require(_0xab6f('0x3'));var logger=require('../../config/logger')(_0xab6f('0x4'));var config=require(_0xab6f('0x5'));var jayson=require(_0xab6f('0x6'));var client=jayson[_0xab6f('0x7')][_0xab6f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x895acc,_0x16b84e,_0x1b4da9){return new BPromise(function(_0x46b0f6,_0x85cb19){return client[_0xab6f('0x9')](_0x895acc,_0x1b4da9)[_0xab6f('0xa')](function(_0x199f2d){logger[_0xab6f('0xb')](_0xab6f('0xc'),_0x16b84e,_0xab6f('0xd'));logger['debug']('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x16b84e,_0xab6f('0xd'),JSON[_0xab6f('0xe')](_0x199f2d));if(_0x199f2d['error']){if(_0x199f2d[_0xab6f('0xf')][_0xab6f('0x10')]===0x1f4){logger[_0xab6f('0xf')](_0xab6f('0xc'),_0x16b84e,_0x199f2d[_0xab6f('0xf')][_0xab6f('0x11')]);return _0x85cb19(_0x199f2d[_0xab6f('0xf')]['message']);}logger[_0xab6f('0xf')](_0xab6f('0xc'),_0x16b84e,_0x199f2d[_0xab6f('0xf')]['message']);return _0x46b0f6(_0x199f2d[_0xab6f('0xf')]['message']);}else{logger['info'](_0xab6f('0xc'),_0x16b84e,'request\x20sent');_0x46b0f6(_0x199f2d[_0xab6f('0x12')][_0xab6f('0x11')]);}})[_0xab6f('0x13')](function(_0x59b934){logger[_0xab6f('0xf')]('SquareDetailsReport,\x20%s,\x20%s',_0x16b84e,_0x59b934);_0x85cb19(_0x59b934);});});}exports[_0xab6f('0x14')]=function(_0x439b73){var _0x3e616c=this;return new Promise(function(_0x2f75c1,_0xbb7af){return db[_0xab6f('0x15')][_0xab6f('0x16')](_0x439b73['body'],{'raw':_0x439b73[_0xab6f('0x17')]?_0x439b73[_0xab6f('0x17')][_0xab6f('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x43eda0){logger[_0xab6f('0xb')](_0xab6f('0x14'),_0x439b73);logger[_0xab6f('0x19')](_0xab6f('0x14'),_0x439b73,JSON[_0xab6f('0xe')](_0x43eda0));_0x2f75c1(_0x43eda0);})['catch'](function(_0x4dc7c1){logger[_0xab6f('0xf')](_0xab6f('0x14'),_0x4dc7c1[_0xab6f('0x11')],_0x439b73);_0xbb7af(_0x3e616c[_0xab6f('0xf')](0x1f4,_0x4dc7c1[_0xab6f('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 5ea76f9..e0930f0 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 _0x0dd8=['index','/process/:pid/kill','isAuthenticated','killProcess','exports','express','Router','../../components/auth/service','./system.controller','get'];(function(_0x220b7e,_0x2eed81){var _0x4ac073=function(_0x2d1cdc){while(--_0x2d1cdc){_0x220b7e['push'](_0x220b7e['shift']());}};_0x4ac073(++_0x2eed81);}(_0x0dd8,0x73));var _0x80dd=function(_0x492202,_0x2528f2){_0x492202=_0x492202-0x0;var _0x34fed5=_0x0dd8[_0x492202];return _0x34fed5;};'use strict';var express=require(_0x80dd('0x0'));var router=express[_0x80dd('0x1')]();var auth=require(_0x80dd('0x2'));var controller=require(_0x80dd('0x3'));router[_0x80dd('0x4')]('/',auth['isAuthenticated'](),controller[_0x80dd('0x5')]);router['get'](_0x80dd('0x6'),auth[_0x80dd('0x7')](),controller[_0x80dd('0x8')]);module[_0x80dd('0x9')]=router; \ No newline at end of file +var _0x0386=['express','Router','../../components/auth/service','index','/process/:pid/kill','killProcess'];(function(_0x4715d2,_0x3371b2){var _0x141811=function(_0x520bc6){while(--_0x520bc6){_0x4715d2['push'](_0x4715d2['shift']());}};_0x141811(++_0x3371b2);}(_0x0386,0x1ce));var _0x6038=function(_0x3da887,_0x536787){_0x3da887=_0x3da887-0x0;var _0x59769a=_0x0386[_0x3da887];return _0x59769a;};'use strict';var express=require(_0x6038('0x0'));var router=express[_0x6038('0x1')]();var auth=require(_0x6038('0x2'));var controller=require('./system.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x6038('0x3')]);router['get'](_0x6038('0x4'),auth['isAuthenticated'](),controller[_0x6038('0x5')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 2b0d5f8..41cad78 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 _0xd06f=['killProcess','systeminformation','child_process','api','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send','index','then','json','catch','components/import/cm','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','pid','SIGINT','format'];(function(_0x46022d,_0x121f32){var _0xbfa35a=function(_0x4a27a8){while(--_0x4a27a8){_0x46022d['push'](_0x46022d['shift']());}};_0xbfa35a(++_0x121f32);}(_0xd06f,0x15f));var _0xfd06=function(_0x323419,_0x2a6172){_0x323419=_0x323419-0x0;var _0x4c0be7=_0xd06f[_0x323419];return _0x4c0be7;};'use strict';var info=require(_0xfd06('0x0'));var exec=require(_0xfd06('0x1'))['exec'];var logger=require('../../config/logger')(_0xfd06('0x2'));var util=require('util');var BPromise=require('bluebird');var _=require(_0xfd06('0x3'));function handleError(_0x288497,_0x4f350e,_0x40d5f5){_0x4f350e=_0x4f350e||0x1f4;return function(_0x53cc78){logger[_0xfd06('0x4')](_0xfd06('0x5'),_0x40d5f5,_0x4f350e,util[_0xfd06('0x6')](_0x53cc78,{'showHidden':![],'depth':null}));delete _0x53cc78[_0xfd06('0x7')];_0x288497[_0xfd06('0x8')](_0x4f350e)[_0xfd06('0x9')](_0x53cc78);};}exports[_0xfd06('0xa')]=function(_0x435118,_0x4ef86c){return info['getAllData']()[_0xfd06('0xb')](function(_0x2f475f){return _0x4ef86c[_0xfd06('0x8')](0xc8)[_0xfd06('0xc')](_0x2f475f);})[_0xfd06('0xd')](function(_0x142e6c){return _0x4ef86c[_0xfd06('0x8')](0x1f4)[_0xfd06('0xc')](_0x142e6c);});};exports['killProcess']=function(_0x27b9dc,_0x2692bd){var _0x2b211c=[_0xfd06('0xe')];return new BPromise(function(_0x2bcffd,_0x5ca079){return exec(util['format'](_0xfd06('0xf'),_0x27b9dc[_0xfd06('0x10')]['pid']),function(_0x1cf64a,_0xf9cf82,_0x211540){if(_0x1cf64a){return _0x5ca079(_0x1cf64a);}return _0x2bcffd(_0xf9cf82);});})[_0xfd06('0xb')](function(_0x12a325){var _0xfb8832=![];var _0x1145dd=_0x12a325[_0xfd06('0x11')](/\n/);for(var _0x5cd1bb=0x0,_0x3184a5=_0x2b211c[_0xfd06('0x12')];_0x5cd1bb<_0x3184a5,_0xfb8832===![];_0x5cd1bb+=0x1){if(_0x12a325[_0xfd06('0x13')](_0x2b211c[_0x5cd1bb])>=0x0){_0xfb8832=!![];}}if(!_0xfb8832){throw new Error(util['format'](_0xfd06('0x14'),_0x27b9dc['params'][_0xfd06('0x15')]));}process['kill'](_0x27b9dc[_0xfd06('0x10')][_0xfd06('0x15')],_0xfd06('0x16'));return _0x2692bd[_0xfd06('0x8')](0xc8)['json']({'message':util[_0xfd06('0x17')]('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x27b9dc[_0xfd06('0x10')][_0xfd06('0x15')])});})['catch'](handleError(_0x2692bd,null,_0xfd06('0x18')));}; \ No newline at end of file +var _0x8637=['send','getAllData','json','catch','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','then','split','length','indexOf','kill','SIGINT','killProcess','systeminformation','child_process','exec','../../config/logger','api','util','bluebird','lodash','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status'];(function(_0x30a791,_0x48660e){var _0x18a8c8=function(_0x5ad83f){while(--_0x5ad83f){_0x30a791['push'](_0x30a791['shift']());}};_0x18a8c8(++_0x48660e);}(_0x8637,0x80));var _0x7863=function(_0x23f61f,_0x45cd83){_0x23f61f=_0x23f61f-0x0;var _0x5c4ae6=_0x8637[_0x23f61f];return _0x5c4ae6;};'use strict';var info=require(_0x7863('0x0'));var exec=require(_0x7863('0x1'))[_0x7863('0x2')];var logger=require(_0x7863('0x3'))(_0x7863('0x4'));var util=require(_0x7863('0x5'));var BPromise=require(_0x7863('0x6'));var _=require(_0x7863('0x7'));function handleError(_0xe0f2e8,_0x32cb12,_0x58bb71){_0x32cb12=_0x32cb12||0x1f4;return function(_0x3003d0){logger['error'](_0x7863('0x8'),_0x58bb71,_0x32cb12,util[_0x7863('0x9')](_0x3003d0,{'showHidden':![],'depth':null}));delete _0x3003d0[_0x7863('0xa')];_0xe0f2e8[_0x7863('0xb')](_0x32cb12)[_0x7863('0xc')](_0x3003d0);};}exports['index']=function(_0x463f2f,_0x532635){return info[_0x7863('0xd')]()['then'](function(_0x2615d8){return _0x532635[_0x7863('0xb')](0xc8)[_0x7863('0xe')](_0x2615d8);})[_0x7863('0xf')](function(_0x264dc1){return _0x532635['status'](0x1f4)[_0x7863('0xe')](_0x264dc1);});};exports['killProcess']=function(_0x561fc6,_0x24276e){var _0x2e30f0=[_0x7863('0x10')];return new BPromise(function(_0x67a71,_0x1249ad){return exec(util[_0x7863('0x11')](_0x7863('0x12'),_0x561fc6[_0x7863('0x13')][_0x7863('0x14')]),function(_0x51520f,_0x11237d,_0x4e8938){if(_0x51520f){return _0x1249ad(_0x51520f);}return _0x67a71(_0x11237d);});})[_0x7863('0x15')](function(_0x49ace4){var _0x3fdfb7=![];var _0x109bda=_0x49ace4[_0x7863('0x16')](/\n/);for(var _0x3323e3=0x0,_0x29967a=_0x2e30f0[_0x7863('0x17')];_0x3323e3<_0x29967a,_0x3fdfb7===![];_0x3323e3+=0x1){if(_0x49ace4[_0x7863('0x18')](_0x2e30f0[_0x3323e3])>=0x0){_0x3fdfb7=!![];}}if(!_0x3fdfb7){throw new Error(util[_0x7863('0x11')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x561fc6['params']['pid']));}process[_0x7863('0x19')](_0x561fc6[_0x7863('0x13')][_0x7863('0x14')],_0x7863('0x1a'));return _0x24276e[_0x7863('0xb')](0xc8)[_0x7863('0xe')]({'message':util[_0x7863('0x11')]('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x561fc6[_0x7863('0x13')][_0x7863('0x14')])});})[_0x7863('0xf')](handleError(_0x24276e,null,_0x7863('0x1b')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 1fedc36..9cf7cc8 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 _0x251f=['isAuthenticated','get','show','post','create','put','update','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','./tag.controller'];(function(_0x1ca4cc,_0x402c23){var _0x108010=function(_0x4c5082){while(--_0x4c5082){_0x1ca4cc['push'](_0x1ca4cc['shift']());}};_0x108010(++_0x402c23);}(_0x251f,0xbe));var _0xf251=function(_0x96f74c,_0xfc30a4){_0x96f74c=_0x96f74c-0x0;var _0x379222=_0x251f[_0x96f74c];return _0x379222;};'use strict';var multer=require(_0xf251('0x0'));var util=require(_0xf251('0x1'));var path=require(_0xf251('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf251('0x3')]();var fs_extra=require(_0xf251('0x4'));var auth=require(_0xf251('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf251('0x6'));var controller=require(_0xf251('0x7'));router['get']('/',auth[_0xf251('0x8')](),controller['index']);router[_0xf251('0x9')]('/:id',auth[_0xf251('0x8')](),controller[_0xf251('0xa')]);router[_0xf251('0xb')]('/',auth[_0xf251('0x8')](),controller[_0xf251('0xc')]);router[_0xf251('0xd')]('/:id',auth[_0xf251('0x8')](),controller[_0xf251('0xe')]);router[_0xf251('0xf')]('/:id',auth[_0xf251('0x8')](),controller[_0xf251('0x10')]);module[_0xf251('0x11')]=router; \ No newline at end of file +var _0x7aa0=['exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','index','/:id','show','post','isAuthenticated','create','put','update','destroy'];(function(_0x46d208,_0x3654d0){var _0x3bc42f=function(_0x4722bf){while(--_0x4722bf){_0x46d208['push'](_0x46d208['shift']());}};_0x3bc42f(++_0x3654d0);}(_0x7aa0,0xa1));var _0x07aa=function(_0x39a8e5,_0xc7c9ef){_0x39a8e5=_0x39a8e5-0x0;var _0x22a593=_0x7aa0[_0x39a8e5];return _0x22a593;};'use strict';var multer=require(_0x07aa('0x0'));var util=require(_0x07aa('0x1'));var path=require(_0x07aa('0x2'));var timeout=require(_0x07aa('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x07aa('0x4'));var auth=require(_0x07aa('0x5'));var interaction=require(_0x07aa('0x6'));var config=require(_0x07aa('0x7'));var controller=require(_0x07aa('0x8'));router[_0x07aa('0x9')]('/',auth['isAuthenticated'](),controller[_0x07aa('0xa')]);router['get'](_0x07aa('0xb'),auth['isAuthenticated'](),controller[_0x07aa('0xc')]);router[_0x07aa('0xd')]('/',auth[_0x07aa('0xe')](),controller[_0x07aa('0xf')]);router[_0x07aa('0x10')](_0x07aa('0xb'),auth[_0x07aa('0xe')](),controller[_0x07aa('0x11')]);router['delete'](_0x07aa('0xb'),auth['isAuthenticated'](),controller[_0x07aa('0x12')]);module[_0x07aa('0x13')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index a36afcf..7fa623f 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 _0x85f8=['sequelize','exports','STRING','name','#0091EA'];(function(_0x46cf00,_0x457a43){var _0x3974dc=function(_0x4b5d0a){while(--_0x4b5d0a){_0x46cf00['push'](_0x46cf00['shift']());}};_0x3974dc(++_0x457a43);}(_0x85f8,0xd7));var _0x885f=function(_0x21a59c,_0x103ebe){_0x21a59c=_0x21a59c-0x0;var _0x1f39da=_0x85f8[_0x21a59c];return _0x1f39da;};'use strict';var Sequelize=require(_0x885f('0x0'));module[_0x885f('0x1')]={'name':{'type':Sequelize[_0x885f('0x2')],'unique':_0x885f('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x885f('0x2')],'defaultValue':_0x885f('0x4')},'description':{'type':Sequelize[_0x885f('0x2')]}}; \ No newline at end of file +var _0xf089=['exports','STRING','#0091EA'];(function(_0x4ae625,_0xf396d0){var _0x31accf=function(_0x3ded6b){while(--_0x3ded6b){_0x4ae625['push'](_0x4ae625['shift']());}};_0x31accf(++_0xf396d0);}(_0xf089,0xba));var _0x9f08=function(_0x5d6353,_0x509fac){_0x5d6353=_0x5d6353-0x0;var _0x4124bb=_0xf089[_0x5d6353];return _0x4124bb;};'use strict';var Sequelize=require('sequelize');module[_0x9f08('0x0')]={'name':{'type':Sequelize[_0x9f08('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x9f08('0x1')],'defaultValue':_0x9f08('0x2')},'description':{'type':Sequelize[_0x9f08('0x1')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 58d84ff..8cabe2d 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 _0x4d9e=['papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','json','offset','undefined','limit','count','status','Content-Range','apply','reject','save','update','then','Tags','UserProfileResource','sendStatus','error','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','Tag','includeAll','include','findAll','rows','catch','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','eml-format','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring'];(function(_0x44a573,_0x1e6efc){var _0x4babc6=function(_0x5495aa){while(--_0x5495aa){_0x44a573['push'](_0x44a573['shift']());}};_0x4babc6(++_0x1e6efc);}(_0x4d9e,0x18c));var _0xe4d9=function(_0x5d384b,_0x4fccf3){_0x5d384b=_0x5d384b-0x0;var _0xea82ac=_0x4d9e[_0x5d384b];return _0xea82ac;};'use strict';var emlformat=require(_0xe4d9('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe4d9('0x1'));var rp=require('request-promise');var moment=require(_0xe4d9('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xe4d9('0x3'));var util=require(_0xe4d9('0x4'));var path=require('path');var sox=require(_0xe4d9('0x5'));var csv=require(_0xe4d9('0x6'));var ejs=require(_0xe4d9('0x7'));var fs=require('fs');var fs_extra=require(_0xe4d9('0x8'));var _=require(_0xe4d9('0x9'));var squel=require(_0xe4d9('0xa'));var crypto=require('crypto');var jsforce=require(_0xe4d9('0xb'));var deskjs=require(_0xe4d9('0xc'));var toCsv=require(_0xe4d9('0x6'));var querystring=require(_0xe4d9('0xd'));var Papa=require(_0xe4d9('0xe'));var Redis=require(_0xe4d9('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xe4d9('0x10'));var as=require(_0xe4d9('0x11'));var hardwareService=require(_0xe4d9('0x12'));var logger=require(_0xe4d9('0x13'))(_0xe4d9('0x14'));var utils=require(_0xe4d9('0x15'));var config=require(_0xe4d9('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x580c50,_0x4e0d15){_0x4e0d15=_0x4e0d15||0xcc;return function(_0x564383){if(_0x564383){return _0x580c50['sendStatus'](_0x4e0d15);}return _0x580c50['status'](_0x4e0d15)['end']();};}function respondWithResult(_0x15c0eb,_0x3238d4){_0x3238d4=_0x3238d4||0xc8;return function(_0x3f884c){if(_0x3f884c){return _0x15c0eb['status'](_0x3238d4)[_0xe4d9('0x17')](_0x3f884c);}};}function respondWithFilteredResult(_0x3f6ce4,_0xe4f133){return function(_0x4283f7){if(_0x4283f7){var _0x58d0cf=typeof _0xe4f133[_0xe4d9('0x18')]===_0xe4d9('0x19')&&typeof _0xe4f133[_0xe4d9('0x1a')]==='undefined';var _0x4d2afd=_0x4283f7[_0xe4d9('0x1b')];var _0x112315=_0x58d0cf?0x0:_0xe4f133['offset'];var _0x2e1490=_0x58d0cf?_0x4283f7['count']:_0xe4f133[_0xe4d9('0x18')]+_0xe4f133[_0xe4d9('0x1a')];var _0x1ea096;if(_0x2e1490>=_0x4d2afd){_0x2e1490=_0x4d2afd;_0x1ea096=0xc8;}else{_0x1ea096=0xce;}_0x3f6ce4[_0xe4d9('0x1c')](_0x1ea096);return _0x3f6ce4['set'](_0xe4d9('0x1d'),_0x112315+'-'+_0x2e1490+'/'+_0x4d2afd)[_0xe4d9('0x17')](_0x4283f7);}return null;};}function patchUpdates(_0x151220){return function(_0x171224){try{jsonpatch[_0xe4d9('0x1e')](_0x171224,_0x151220,!![]);}catch(_0x1146fc){return BPromise[_0xe4d9('0x1f')](_0x1146fc);}return _0x171224[_0xe4d9('0x20')]();};}function saveUpdates(_0x562bab,_0x4fed7f){return function(_0x44f1aa){if(_0x44f1aa){return _0x44f1aa[_0xe4d9('0x21')](_0x562bab)['then'](function(_0x189dad){return _0x189dad;});}return null;};}function removeEntity(_0x50d377,_0x14f3d7){return function(_0x125320){if(_0x125320){return _0x125320['destroy']()[_0xe4d9('0x22')](function(){var _0x32e7da=_0x125320['get']({'plain':!![]});var _0xc5be1b=_0xe4d9('0x23');return db[_0xe4d9('0x24')]['destroy']({'where':{'type':_0xc5be1b,'resourceId':_0x32e7da['id']}})['then'](function(){return _0x125320;});})[_0xe4d9('0x22')](function(){_0x50d377[_0xe4d9('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5dddd2,_0x4954b5){return function(_0x529e2b){if(!_0x529e2b){_0x5dddd2[_0xe4d9('0x25')](0x194);}return _0x529e2b;};}function handleError(_0x48d481,_0x40ffd0){_0x40ffd0=_0x40ffd0||0x1f4;return function(_0x1f3d90){logger[_0xe4d9('0x26')](_0x1f3d90['stack']);if(_0x1f3d90[_0xe4d9('0x27')]){delete _0x1f3d90[_0xe4d9('0x27')];}_0x48d481[_0xe4d9('0x1c')](_0x40ffd0)[_0xe4d9('0x28')](_0x1f3d90);};}exports[_0xe4d9('0x29')]=function(_0x1904d1,_0x21b7a9){var _0x449cb8={},_0x1fb637={},_0x3e6ea7={'count':0x0,'rows':[]};var _0x519c18=_[_0xe4d9('0x2a')](db['Tag'][_0xe4d9('0x2b')],function(_0x349be3){return{'name':_0x349be3[_0xe4d9('0x2c')],'type':_0x349be3[_0xe4d9('0x2d')][_0xe4d9('0x2e')]};});_0x1fb637[_0xe4d9('0x2f')]=_['map'](_0x519c18,'name');_0x1fb637['query']=_[_0xe4d9('0x30')](_0x1904d1[_0xe4d9('0x31')]);_0x1fb637[_0xe4d9('0x32')]=_['intersection'](_0x1fb637['model'],_0x1fb637['query']);_0x449cb8['attributes']=_[_0xe4d9('0x33')](_0x1fb637[_0xe4d9('0x2f')],qs['fields'](_0x1904d1[_0xe4d9('0x31')][_0xe4d9('0x34')]));_0x449cb8['attributes']=_0x449cb8[_0xe4d9('0x35')][_0xe4d9('0x36')]?_0x449cb8[_0xe4d9('0x35')]:_0x1fb637[_0xe4d9('0x2f')];if(!_0x1904d1[_0xe4d9('0x31')][_0xe4d9('0x37')](_0xe4d9('0x38'))){_0x449cb8[_0xe4d9('0x1a')]=qs[_0xe4d9('0x1a')](_0x1904d1[_0xe4d9('0x31')][_0xe4d9('0x1a')]);_0x449cb8[_0xe4d9('0x18')]=qs[_0xe4d9('0x18')](_0x1904d1[_0xe4d9('0x31')]['offset']);}_0x449cb8[_0xe4d9('0x39')]=qs[_0xe4d9('0x3a')](_0x1904d1[_0xe4d9('0x31')][_0xe4d9('0x3a')]);_0x449cb8[_0xe4d9('0x3b')]=qs[_0xe4d9('0x32')](_[_0xe4d9('0x3c')](_0x1904d1[_0xe4d9('0x31')],_0x1fb637[_0xe4d9('0x32')]),_0x519c18);if(_0x1904d1['query']['filter']){_0x449cb8['where']=_[_0xe4d9('0x3d')](_0x449cb8[_0xe4d9('0x3b')],{'$or':_[_0xe4d9('0x2a')](_0x519c18,function(_0x2770a2){if(_0x2770a2[_0xe4d9('0x2d')]!==_0xe4d9('0x3e')){var _0x392cdd={};_0x392cdd[_0x2770a2['name']]={'$like':'%'+_0x1904d1['query']['filter']+'%'};return _0x392cdd;}})});}_0x449cb8=_[_0xe4d9('0x3d')]({},_0x449cb8,_0x1904d1[_0xe4d9('0x3f')]);var _0x5a908b={'where':_0x449cb8[_0xe4d9('0x3b')]};return db[_0xe4d9('0x40')][_0xe4d9('0x1b')](_0x5a908b)[_0xe4d9('0x22')](function(_0x5d0476){_0x3e6ea7[_0xe4d9('0x1b')]=_0x5d0476;if(_0x1904d1[_0xe4d9('0x31')][_0xe4d9('0x41')]){_0x449cb8[_0xe4d9('0x42')]=[{'all':!![]}];}return db[_0xe4d9('0x40')][_0xe4d9('0x43')](_0x449cb8);})[_0xe4d9('0x22')](function(_0x3e9653){_0x3e6ea7[_0xe4d9('0x44')]=_0x3e9653;return _0x3e6ea7;})[_0xe4d9('0x22')](respondWithFilteredResult(_0x21b7a9,_0x449cb8))[_0xe4d9('0x45')](handleError(_0x21b7a9,null));};exports['show']=function(_0x429be,_0x449230){var _0x4857fe={'raw':!![],'where':{'id':_0x429be[_0xe4d9('0x46')]['id']}},_0x2b7e25={};_0x2b7e25['model']=_[_0xe4d9('0x30')](db[_0xe4d9('0x40')][_0xe4d9('0x2b')]);_0x2b7e25[_0xe4d9('0x31')]=_[_0xe4d9('0x30')](_0x429be[_0xe4d9('0x31')]);_0x2b7e25[_0xe4d9('0x32')]=_[_0xe4d9('0x33')](_0x2b7e25[_0xe4d9('0x2f')],_0x2b7e25[_0xe4d9('0x31')]);_0x4857fe['attributes']=_[_0xe4d9('0x33')](_0x2b7e25[_0xe4d9('0x2f')],qs[_0xe4d9('0x34')](_0x429be['query'][_0xe4d9('0x34')]));_0x4857fe[_0xe4d9('0x35')]=_0x4857fe[_0xe4d9('0x35')][_0xe4d9('0x36')]?_0x4857fe[_0xe4d9('0x35')]:_0x2b7e25[_0xe4d9('0x2f')];if(_0x429be[_0xe4d9('0x31')]['includeAll']){_0x4857fe[_0xe4d9('0x42')]=[{'all':!![]}];}_0x4857fe=_[_0xe4d9('0x3d')]({},_0x4857fe,_0x429be[_0xe4d9('0x3f')]);return db[_0xe4d9('0x40')][_0xe4d9('0x47')](_0x4857fe)[_0xe4d9('0x22')](handleEntityNotFound(_0x449230,null))['then'](respondWithResult(_0x449230,null))[_0xe4d9('0x45')](handleError(_0x449230,null));};exports[_0xe4d9('0x48')]=function(_0x87f230,_0x38468c){return db[_0xe4d9('0x40')][_0xe4d9('0x48')](_0x87f230['body'],{})[_0xe4d9('0x22')](function(_0x29e038){var _0x53e7c4=_0x87f230[_0xe4d9('0x49')]['get']({'plain':!![]});if(!_0x53e7c4)throw new Error(_0xe4d9('0x4a'));if(_0x53e7c4[_0xe4d9('0x4b')]==='user'){var _0x657961=_0x29e038['get']({'plain':!![]});var _0x27a5e4=_0xe4d9('0x23');return db[_0xe4d9('0x4c')]['find']({'where':{'name':_0x27a5e4,'userProfileId':_0x53e7c4[_0xe4d9('0x4d')]},'raw':!![]})[_0xe4d9('0x22')](function(_0x4d5ff9){if(_0x4d5ff9&&_0x4d5ff9[_0xe4d9('0x4e')]===0x0){return db[_0xe4d9('0x24')][_0xe4d9('0x48')]({'name':_0x657961[_0xe4d9('0x27')],'resourceId':_0x657961['id'],'type':_0x4d5ff9['name'],'sectionId':_0x4d5ff9['id']},{})['then'](function(){return _0x29e038;});}else{return _0x29e038;}})[_0xe4d9('0x45')](function(_0x40674d){logger[_0xe4d9('0x26')](_0xe4d9('0x4f'),_0x40674d);throw _0x40674d;});}return _0x29e038;})[_0xe4d9('0x22')](respondWithResult(_0x38468c,0xc9))[_0xe4d9('0x45')](handleError(_0x38468c,null));};exports['update']=function(_0x5a57ad,_0x2c5500){if(_0x5a57ad[_0xe4d9('0x50')]['id']){delete _0x5a57ad[_0xe4d9('0x50')]['id'];}return db[_0xe4d9('0x40')][_0xe4d9('0x47')]({'where':{'id':_0x5a57ad[_0xe4d9('0x46')]['id']}})['then'](handleEntityNotFound(_0x2c5500,null))[_0xe4d9('0x22')](saveUpdates(_0x5a57ad[_0xe4d9('0x50')],null))[_0xe4d9('0x22')](respondWithResult(_0x2c5500,null))['catch'](handleError(_0x2c5500,null));};exports[_0xe4d9('0x51')]=function(_0x2b6d70,_0x281fda){return db['Tag'][_0xe4d9('0x47')]({'where':{'id':_0x2b6d70['params']['id']}})[_0xe4d9('0x22')](handleEntityNotFound(_0x281fda,null))[_0xe4d9('0x22')](removeEntity(_0x281fda,null))[_0xe4d9('0x45')](handleError(_0x281fda,null));}; \ No newline at end of file +var _0x579c=['sendStatus','name','send','index','map','Tag','rawAttributes','key','query','keys','intersection','attributes','model','fields','hasOwnProperty','order','sort','filters','pick','filter','where','merge','type','VIRTUAL','options','includeAll','findAll','rows','show','params','length','include','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','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','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','Tags','UserProfileResource'];(function(_0x282b3b,_0x33d4f8){var _0x3aaba1=function(_0x1bd4eb){while(--_0x1bd4eb){_0x282b3b['push'](_0x282b3b['shift']());}};_0x3aaba1(++_0x33d4f8);}(_0x579c,0xda));var _0xc579=function(_0x455ee1,_0x43b4f4){_0x455ee1=_0x455ee1-0x0;var _0x2097aa=_0x579c[_0x455ee1];return _0x2097aa;};'use strict';var emlformat=require(_0xc579('0x0'));var rimraf=require(_0xc579('0x1'));var zipdir=require(_0xc579('0x2'));var jsonpatch=require(_0xc579('0x3'));var rp=require(_0xc579('0x4'));var moment=require('moment');var BPromise=require(_0xc579('0x5'));var Mustache=require('mustache');var util=require(_0xc579('0x6'));var path=require(_0xc579('0x7'));var sox=require(_0xc579('0x8'));var csv=require(_0xc579('0x9'));var ejs=require(_0xc579('0xa'));var fs=require('fs');var fs_extra=require(_0xc579('0xb'));var _=require(_0xc579('0xc'));var squel=require('squel');var crypto=require(_0xc579('0xd'));var jsforce=require(_0xc579('0xe'));var deskjs=require(_0xc579('0xf'));var toCsv=require(_0xc579('0x9'));var querystring=require(_0xc579('0x10'));var Papa=require(_0xc579('0x11'));var Redis=require(_0xc579('0x12'));var authService=require(_0xc579('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xc579('0x14'));var hardwareService=require(_0xc579('0x15'));var logger=require(_0xc579('0x16'))(_0xc579('0x17'));var utils=require(_0xc579('0x18'));var config=require(_0xc579('0x19'));var licenseUtil=require(_0xc579('0x1a'));var db=require(_0xc579('0x1b'))['db'];function respondWithStatusCode(_0x421812,_0x441028){_0x441028=_0x441028||0xcc;return function(_0x448d51){if(_0x448d51){return _0x421812['sendStatus'](_0x441028);}return _0x421812[_0xc579('0x1c')](_0x441028)['end']();};}function respondWithResult(_0xf5400e,_0x59243e){_0x59243e=_0x59243e||0xc8;return function(_0x424e15){if(_0x424e15){return _0xf5400e['status'](_0x59243e)[_0xc579('0x1d')](_0x424e15);}};}function respondWithFilteredResult(_0x4b3635,_0x349e82){return function(_0x115276){if(_0x115276){var _0x567de5=typeof _0x349e82['offset']===_0xc579('0x1e')&&typeof _0x349e82[_0xc579('0x1f')]===_0xc579('0x1e');var _0x414ee7=_0x115276[_0xc579('0x20')];var _0x33d341=_0x567de5?0x0:_0x349e82[_0xc579('0x21')];var _0x3da8a1=_0x567de5?_0x115276[_0xc579('0x20')]:_0x349e82[_0xc579('0x21')]+_0x349e82['limit'];var _0x463f5e;if(_0x3da8a1>=_0x414ee7){_0x3da8a1=_0x414ee7;_0x463f5e=0xc8;}else{_0x463f5e=0xce;}_0x4b3635[_0xc579('0x1c')](_0x463f5e);return _0x4b3635['set'](_0xc579('0x22'),_0x33d341+'-'+_0x3da8a1+'/'+_0x414ee7)[_0xc579('0x1d')](_0x115276);}return null;};}function patchUpdates(_0x14fcdd){return function(_0x6501bc){try{jsonpatch[_0xc579('0x23')](_0x6501bc,_0x14fcdd,!![]);}catch(_0x4417e1){return BPromise[_0xc579('0x24')](_0x4417e1);}return _0x6501bc[_0xc579('0x25')]();};}function saveUpdates(_0x55781e,_0x92657f){return function(_0xad4889){if(_0xad4889){return _0xad4889[_0xc579('0x26')](_0x55781e)[_0xc579('0x27')](function(_0x1da86e){return _0x1da86e;});}return null;};}function removeEntity(_0x565a1b,_0x3634f2){return function(_0x3cf83f){if(_0x3cf83f){return _0x3cf83f[_0xc579('0x28')]()['then'](function(){var _0x45e1ac=_0x3cf83f['get']({'plain':!![]});var _0x4610c2=_0xc579('0x29');return db[_0xc579('0x2a')]['destroy']({'where':{'type':_0x4610c2,'resourceId':_0x45e1ac['id']}})[_0xc579('0x27')](function(){return _0x3cf83f;});})['then'](function(){_0x565a1b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x540d90,_0x3f7363){return function(_0xfdbb73){if(!_0xfdbb73){_0x540d90[_0xc579('0x2b')](0x194);}return _0xfdbb73;};}function handleError(_0x206e39,_0x194477){_0x194477=_0x194477||0x1f4;return function(_0x45fef4){logger['error'](_0x45fef4['stack']);if(_0x45fef4[_0xc579('0x2c')]){delete _0x45fef4['name'];}_0x206e39[_0xc579('0x1c')](_0x194477)[_0xc579('0x2d')](_0x45fef4);};}exports[_0xc579('0x2e')]=function(_0x3fe96b,_0x1ad8f7){var _0x156bf5={},_0x45e6a3={},_0x133d08={'count':0x0,'rows':[]};var _0x49b48f=_[_0xc579('0x2f')](db[_0xc579('0x30')][_0xc579('0x31')],function(_0x333fa4){return{'name':_0x333fa4['fieldName'],'type':_0x333fa4['type'][_0xc579('0x32')]};});_0x45e6a3['model']=_[_0xc579('0x2f')](_0x49b48f,_0xc579('0x2c'));_0x45e6a3[_0xc579('0x33')]=_[_0xc579('0x34')](_0x3fe96b[_0xc579('0x33')]);_0x45e6a3['filters']=_[_0xc579('0x35')](_0x45e6a3['model'],_0x45e6a3[_0xc579('0x33')]);_0x156bf5[_0xc579('0x36')]=_['intersection'](_0x45e6a3[_0xc579('0x37')],qs[_0xc579('0x38')](_0x3fe96b['query']['fields']));_0x156bf5[_0xc579('0x36')]=_0x156bf5[_0xc579('0x36')]['length']?_0x156bf5[_0xc579('0x36')]:_0x45e6a3[_0xc579('0x37')];if(!_0x3fe96b['query'][_0xc579('0x39')]('nolimit')){_0x156bf5[_0xc579('0x1f')]=qs[_0xc579('0x1f')](_0x3fe96b['query'][_0xc579('0x1f')]);_0x156bf5[_0xc579('0x21')]=qs[_0xc579('0x21')](_0x3fe96b[_0xc579('0x33')][_0xc579('0x21')]);}_0x156bf5[_0xc579('0x3a')]=qs['sort'](_0x3fe96b[_0xc579('0x33')][_0xc579('0x3b')]);_0x156bf5['where']=qs[_0xc579('0x3c')](_[_0xc579('0x3d')](_0x3fe96b[_0xc579('0x33')],_0x45e6a3[_0xc579('0x3c')]),_0x49b48f);if(_0x3fe96b['query'][_0xc579('0x3e')]){_0x156bf5[_0xc579('0x3f')]=_[_0xc579('0x40')](_0x156bf5['where'],{'$or':_['map'](_0x49b48f,function(_0x5c9d54){if(_0x5c9d54[_0xc579('0x41')]!==_0xc579('0x42')){var _0x3349e0={};_0x3349e0[_0x5c9d54[_0xc579('0x2c')]]={'$like':'%'+_0x3fe96b[_0xc579('0x33')][_0xc579('0x3e')]+'%'};return _0x3349e0;}})});}_0x156bf5=_['merge']({},_0x156bf5,_0x3fe96b[_0xc579('0x43')]);var _0x53ab02={'where':_0x156bf5[_0xc579('0x3f')]};return db[_0xc579('0x30')][_0xc579('0x20')](_0x53ab02)[_0xc579('0x27')](function(_0x3d8f24){_0x133d08[_0xc579('0x20')]=_0x3d8f24;if(_0x3fe96b[_0xc579('0x33')][_0xc579('0x44')]){_0x156bf5['include']=[{'all':!![]}];}return db[_0xc579('0x30')][_0xc579('0x45')](_0x156bf5);})[_0xc579('0x27')](function(_0x2449e6){_0x133d08[_0xc579('0x46')]=_0x2449e6;return _0x133d08;})[_0xc579('0x27')](respondWithFilteredResult(_0x1ad8f7,_0x156bf5))['catch'](handleError(_0x1ad8f7,null));};exports[_0xc579('0x47')]=function(_0x290493,_0x194f95){var _0x4cf801={'raw':!![],'where':{'id':_0x290493[_0xc579('0x48')]['id']}},_0x3e66c0={};_0x3e66c0[_0xc579('0x37')]=_['keys'](db[_0xc579('0x30')]['rawAttributes']);_0x3e66c0[_0xc579('0x33')]=_[_0xc579('0x34')](_0x290493[_0xc579('0x33')]);_0x3e66c0['filters']=_[_0xc579('0x35')](_0x3e66c0[_0xc579('0x37')],_0x3e66c0['query']);_0x4cf801['attributes']=_[_0xc579('0x35')](_0x3e66c0[_0xc579('0x37')],qs[_0xc579('0x38')](_0x290493[_0xc579('0x33')]['fields']));_0x4cf801['attributes']=_0x4cf801[_0xc579('0x36')][_0xc579('0x49')]?_0x4cf801[_0xc579('0x36')]:_0x3e66c0[_0xc579('0x37')];if(_0x290493['query'][_0xc579('0x44')]){_0x4cf801[_0xc579('0x4a')]=[{'all':!![]}];}_0x4cf801=_['merge']({},_0x4cf801,_0x290493[_0xc579('0x43')]);return db['Tag']['find'](_0x4cf801)['then'](handleEntityNotFound(_0x194f95,null))[_0xc579('0x27')](respondWithResult(_0x194f95,null))[_0xc579('0x4b')](handleError(_0x194f95,null));};exports[_0xc579('0x4c')]=function(_0x90a0d3,_0x1f9d15){return db['Tag'][_0xc579('0x4c')](_0x90a0d3[_0xc579('0x4d')],{})[_0xc579('0x27')](function(_0x5c726d){var _0x5cdead=_0x90a0d3[_0xc579('0x4e')][_0xc579('0x4f')]({'plain':!![]});if(!_0x5cdead)throw new Error(_0xc579('0x50'));if(_0x5cdead[_0xc579('0x51')]===_0xc579('0x4e')){var _0xe1a1d7=_0x5c726d[_0xc579('0x4f')]({'plain':!![]});var _0x5431ba='Tags';return db[_0xc579('0x52')][_0xc579('0x53')]({'where':{'name':_0x5431ba,'userProfileId':_0x5cdead['userProfileId']},'raw':!![]})[_0xc579('0x27')](function(_0x4de789){if(_0x4de789&&_0x4de789[_0xc579('0x54')]===0x0){return db[_0xc579('0x2a')][_0xc579('0x4c')]({'name':_0xe1a1d7[_0xc579('0x2c')],'resourceId':_0xe1a1d7['id'],'type':_0x4de789[_0xc579('0x2c')],'sectionId':_0x4de789['id']},{})[_0xc579('0x27')](function(){return _0x5c726d;});}else{return _0x5c726d;}})['catch'](function(_0x563970){logger[_0xc579('0x55')](_0xc579('0x56'),_0x563970);throw _0x563970;});}return _0x5c726d;})['then'](respondWithResult(_0x1f9d15,0xc9))[_0xc579('0x4b')](handleError(_0x1f9d15,null));};exports['update']=function(_0x241fb2,_0x1b0931){if(_0x241fb2[_0xc579('0x4d')]['id']){delete _0x241fb2[_0xc579('0x4d')]['id'];}return db['Tag']['find']({'where':{'id':_0x241fb2[_0xc579('0x48')]['id']}})['then'](handleEntityNotFound(_0x1b0931,null))[_0xc579('0x27')](saveUpdates(_0x241fb2[_0xc579('0x4d')],null))[_0xc579('0x27')](respondWithResult(_0x1b0931,null))['catch'](handleError(_0x1b0931,null));};exports[_0xc579('0x28')]=function(_0x43b067,_0x4a2701){return db[_0xc579('0x30')][_0xc579('0x53')]({'where':{'id':_0x43b067[_0xc579('0x48')]['id']}})[_0xc579('0x27')](handleEntityNotFound(_0x4a2701,null))[_0xc579('0x27')](removeEntity(_0x4a2701,null))['catch'](handleError(_0x4a2701,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 516bc8d..bfc99b1 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 _0xe29d=['./tag.attributes','Tag','tools_tags','lodash','../../config/logger','api','request-promise','rimraf','../../config/environment'];(function(_0x48a96f,_0x530059){var _0x3ff3ef=function(_0x286059){while(--_0x286059){_0x48a96f['push'](_0x48a96f['shift']());}};_0x3ff3ef(++_0x530059);}(_0xe29d,0x66));var _0xde29=function(_0x22ea23,_0x5ac0a8){_0x22ea23=_0x22ea23-0x0;var _0x3c7450=_0xe29d[_0x22ea23];return _0x3c7450;};'use strict';var _=require(_0xde29('0x0'));var util=require('util');var logger=require(_0xde29('0x1'))(_0xde29('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xde29('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xde29('0x4'));var config=require(_0xde29('0x5'));var attributes=require(_0xde29('0x6'));module['exports']=function(_0x151eb8,_0x17cc46){return _0x151eb8['define'](_0xde29('0x7'),attributes,{'tableName':_0xde29('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdd51=['define','Tag','lodash','util','bluebird','request-promise','path','../../config/environment','./tag.attributes','exports'];(function(_0x2b0981,_0x14da19){var _0x7f997f=function(_0x45cd83){while(--_0x45cd83){_0x2b0981['push'](_0x2b0981['shift']());}};_0x7f997f(++_0x14da19);}(_0xdd51,0xca));var _0x1dd5=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xdd51[_0xae7c2f];return _0x5d7001;};'use strict';var _=require(_0x1dd5('0x0'));var util=require(_0x1dd5('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x1dd5('0x2'));var rp=require(_0x1dd5('0x3'));var fs=require('fs');var path=require(_0x1dd5('0x4'));var rimraf=require('rimraf');var config=require(_0x1dd5('0x5'));var attributes=require(_0x1dd5('0x6'));module[_0x1dd5('0x7')]=function(_0x4aa37d,_0x35ecd9){return _0x4aa37d[_0x1dd5('0x8')](_0x1dd5('0x9'),attributes,{'tableName':'tools_tags','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 a7c6372..1c14a44 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 _0x2dae=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird'];(function(_0x5840dd,_0x3436a6){var _0x6fa495=function(_0x35fc3b){while(--_0x35fc3b){_0x5840dd['push'](_0x5840dd['shift']());}};_0x6fa495(++_0x3436a6);}(_0x2dae,0xc3));var _0xe2da=function(_0x231dda,_0x5b04cc){_0x231dda=_0x231dda-0x0;var _0x3f88cb=_0x2dae[_0x231dda];return _0x3f88cb;};'use strict';var _=require(_0xe2da('0x0'));var util=require('util');var moment=require(_0xe2da('0x1'));var BPromise=require(_0xe2da('0x2'));var rs=require(_0xe2da('0x3'));var fs=require('fs');var Redis=require(_0xe2da('0x4'));var db=require(_0xe2da('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe2da('0x6'))(_0xe2da('0x7'));var config=require(_0xe2da('0x8'));var jayson=require(_0xe2da('0x9'));var client=jayson['client'][_0xe2da('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x89c70b,_0x34cc98,_0x2efbd8){return new BPromise(function(_0x238da3,_0x1c71ea){return client[_0xe2da('0xb')](_0x89c70b,_0x2efbd8)[_0xe2da('0xc')](function(_0x68aa40){logger['info'](_0xe2da('0xd'),_0x34cc98,_0xe2da('0xe'));logger[_0xe2da('0xf')](_0xe2da('0x10'),_0x34cc98,_0xe2da('0xe'),JSON[_0xe2da('0x11')](_0x68aa40));if(_0x68aa40[_0xe2da('0x12')]){if(_0x68aa40[_0xe2da('0x12')]['code']===0x1f4){logger[_0xe2da('0x12')]('Tag,\x20%s,\x20%s',_0x34cc98,_0x68aa40[_0xe2da('0x12')][_0xe2da('0x13')]);return _0x1c71ea(_0x68aa40[_0xe2da('0x12')][_0xe2da('0x13')]);}logger[_0xe2da('0x12')](_0xe2da('0xd'),_0x34cc98,_0x68aa40[_0xe2da('0x12')]['message']);return _0x238da3(_0x68aa40[_0xe2da('0x12')]['message']);}else{logger['info'](_0xe2da('0xd'),_0x34cc98,_0xe2da('0xe'));_0x238da3(_0x68aa40[_0xe2da('0x14')]['message']);}})[_0xe2da('0x15')](function(_0x2c0353){logger[_0xe2da('0x12')](_0xe2da('0xd'),_0x34cc98,_0x2c0353);_0x1c71ea(_0x2c0353);});});} \ No newline at end of file +var _0xf0ba=['rpc','jayson/promise','then','info','request\x20sent','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','Tag,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xf0ba,0x1ed));var _0xaf0b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf0ba[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xaf0b('0x0'));var util=require(_0xaf0b('0x1'));var moment=require(_0xaf0b('0x2'));var BPromise=require(_0xaf0b('0x3'));var rs=require(_0xaf0b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaf0b('0x5'))['db'];var utils=require(_0xaf0b('0x6'));var logger=require('../../config/logger')(_0xaf0b('0x7'));var config=require('../../config/environment');var jayson=require(_0xaf0b('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x53b32d,_0x1d260e,_0x17b6d5){return new BPromise(function(_0x3439d5,_0xd67a9){return client['request'](_0x53b32d,_0x17b6d5)[_0xaf0b('0x9')](function(_0x4242b1){logger[_0xaf0b('0xa')]('Tag,\x20%s,\x20%s',_0x1d260e,_0xaf0b('0xb'));logger['debug'](_0xaf0b('0xc'),_0x1d260e,_0xaf0b('0xb'),JSON[_0xaf0b('0xd')](_0x4242b1));if(_0x4242b1['error']){if(_0x4242b1[_0xaf0b('0xe')][_0xaf0b('0xf')]===0x1f4){logger[_0xaf0b('0xe')](_0xaf0b('0x10'),_0x1d260e,_0x4242b1[_0xaf0b('0xe')][_0xaf0b('0x11')]);return _0xd67a9(_0x4242b1['error'][_0xaf0b('0x11')]);}logger[_0xaf0b('0xe')](_0xaf0b('0x10'),_0x1d260e,_0x4242b1[_0xaf0b('0xe')]['message']);return _0x3439d5(_0x4242b1[_0xaf0b('0xe')][_0xaf0b('0x11')]);}else{logger[_0xaf0b('0xa')](_0xaf0b('0x10'),_0x1d260e,_0xaf0b('0xb'));_0x3439d5(_0x4242b1[_0xaf0b('0x12')][_0xaf0b('0x11')]);}})[_0xaf0b('0x13')](function(_0x4885da){logger[_0xaf0b('0xe')]('Tag,\x20%s,\x20%s',_0x1d260e,_0x4885da);_0xd67a9(_0x4885da);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 2b6708e..3e0e95f 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(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'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(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'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 1ecb18e..e7baae8 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 _0x2032=['name','exports','STRING'];(function(_0x55e916,_0x30fe3e){var _0x471762=function(_0x11c061){while(--_0x11c061){_0x55e916['push'](_0x55e916['shift']());}};_0x471762(++_0x30fe3e);}(_0x2032,0xd9));var _0x2203=function(_0x5e92ec,_0x150a90){_0x5e92ec=_0x5e92ec-0x0;var _0x5670cd=_0x2032[_0x5e92ec];return _0x5670cd;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'name':{'type':Sequelize[_0x2203('0x1')],'allowNull':![],'unique':_0x2203('0x2')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe706=['STRING','sequelize','exports'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0xe706,0xa3));var _0x6e70=function(_0x1843b3,_0x10995a){_0x1843b3=_0x1843b3-0x0;var _0x3c7de0=_0xe706[_0x1843b3];return _0x3c7de0;};'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 bdd7a0e..99fae79 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 _0xc689=['desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','./team.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','get','Teams','UserProfileResource','destroy','sendStatus','error','stack','name','send','index','map','Team','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','length','nolimit','order','sort','filters','pick','where','VIRTUAL','merge','options','findAll','rows','catch','show','params','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','getQueues','findOne','isValidChannel','ValidationError','Unknown\x20channel','capitalize','channel','toLowerCase','Queue','Queues','addQueues','add','ids','removeQueues','Sequelize','remove','addAgents','Voice','Chat','Mail','Sms','Fax','Openchannel','Whatsapp','sequelize','transaction','through','penalty','TeamVoiceQueue','findOrCreate','Queue:save','QueueId','User','interface','UserVoiceQueueRt','upsert','isNil','SIP/%s','voicePause','all','TeamVoicePrefix','VoicePrefixId','spread','removeAgents','parse','emit','Queue:remove','UserVoicePrefix','getAgents','filter','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc689,0x195));var _0x9c68=function(_0x34f545,_0x2bd2ee){_0x34f545=_0x34f545-0x0;var _0x1ff6b8=_0xc689[_0x34f545];return _0x1ff6b8;};'use strict';var emlformat=require(_0x9c68('0x0'));var rimraf=require(_0x9c68('0x1'));var zipdir=require(_0x9c68('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9c68('0x3'));var moment=require('moment');var BPromise=require(_0x9c68('0x4'));var Mustache=require(_0x9c68('0x5'));var util=require(_0x9c68('0x6'));var path=require(_0x9c68('0x7'));var sox=require(_0x9c68('0x8'));var csv=require(_0x9c68('0x9'));var ejs=require(_0x9c68('0xa'));var fs=require('fs');var fs_extra=require(_0x9c68('0xb'));var _=require('lodash');var squel=require(_0x9c68('0xc'));var crypto=require(_0x9c68('0xd'));var jsforce=require(_0x9c68('0xe'));var deskjs=require(_0x9c68('0xf'));var toCsv=require(_0x9c68('0x9'));var querystring=require(_0x9c68('0x10'));var Papa=require(_0x9c68('0x11'));var Redis=require('ioredis');var authService=require(_0x9c68('0x12'));var qs=require(_0x9c68('0x13'));var as=require(_0x9c68('0x14'));var hardwareService=require(_0x9c68('0x15'));var logger=require(_0x9c68('0x16'))(_0x9c68('0x17'));var utils=require(_0x9c68('0x18'));var config=require(_0x9c68('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x9c68('0x1a'))['db'];config['redis']=_[_0x9c68('0x1b')](config[_0x9c68('0x1c')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9c68('0x1c')]));require(_0x9c68('0x1d'))[_0x9c68('0x1e')](socket);function respondWithStatusCode(_0x94bbef,_0x513329){_0x513329=_0x513329||0xcc;return function(_0x22cc5a){if(_0x22cc5a){return _0x94bbef['sendStatus'](_0x513329);}return _0x94bbef[_0x9c68('0x1f')](_0x513329)[_0x9c68('0x20')]();};}function respondWithResult(_0x4efef2,_0x4416cd){_0x4416cd=_0x4416cd||0xc8;return function(_0x4fefea){if(_0x4fefea){return _0x4efef2[_0x9c68('0x1f')](_0x4416cd)[_0x9c68('0x21')](_0x4fefea);}};}function respondWithFilteredResult(_0x3f8744,_0x5490c7){return function(_0x232a1c){if(_0x232a1c){var _0x1b223c=typeof _0x5490c7[_0x9c68('0x22')]===_0x9c68('0x23')&&typeof _0x5490c7[_0x9c68('0x24')]===_0x9c68('0x23');var _0x244046=_0x232a1c['count'];var _0x42cbfd=_0x1b223c?0x0:_0x5490c7[_0x9c68('0x22')];var _0x291f63=_0x1b223c?_0x232a1c[_0x9c68('0x25')]:_0x5490c7['offset']+_0x5490c7['limit'];var _0x2786dc;if(_0x291f63>=_0x244046){_0x291f63=_0x244046;_0x2786dc=0xc8;}else{_0x2786dc=0xce;}_0x3f8744[_0x9c68('0x1f')](_0x2786dc);return _0x3f8744[_0x9c68('0x26')](_0x9c68('0x27'),_0x42cbfd+'-'+_0x291f63+'/'+_0x244046)[_0x9c68('0x21')](_0x232a1c);}return null;};}function patchUpdates(_0xebdd2e){return function(_0x36db76){try{jsonpatch[_0x9c68('0x28')](_0x36db76,_0xebdd2e,!![]);}catch(_0x14a229){return BPromise['reject'](_0x14a229);}return _0x36db76['save']();};}function saveUpdates(_0x5c3973,_0x49e96c){return function(_0xab66b6){if(_0xab66b6){return _0xab66b6[_0x9c68('0x29')](_0x5c3973)[_0x9c68('0x2a')](function(_0x2ba3f4){return _0x2ba3f4;});}return null;};}function removeEntity(_0x2d4780,_0x12534c){return function(_0x19d5a1){if(_0x19d5a1){return _0x19d5a1['destroy']()[_0x9c68('0x2a')](function(){var _0x2bcb71=_0x19d5a1[_0x9c68('0x2b')]({'plain':!![]});var _0x240dc8=_0x9c68('0x2c');return db[_0x9c68('0x2d')][_0x9c68('0x2e')]({'where':{'type':_0x240dc8,'resourceId':_0x2bcb71['id']}})[_0x9c68('0x2a')](function(){return _0x19d5a1;});})[_0x9c68('0x2a')](function(){_0x2d4780[_0x9c68('0x1f')](0xcc)[_0x9c68('0x20')]();});}};}function handleEntityNotFound(_0x5c8c58,_0x52463b){return function(_0x3f6167){if(!_0x3f6167){_0x5c8c58[_0x9c68('0x2f')](0x194);}return _0x3f6167;};}function handleError(_0x21fe41,_0x5ee246){_0x5ee246=_0x5ee246||0x1f4;return function(_0x5a5377){logger[_0x9c68('0x30')](_0x5a5377[_0x9c68('0x31')]);if(_0x5a5377[_0x9c68('0x32')]){delete _0x5a5377['name'];}_0x21fe41[_0x9c68('0x1f')](_0x5ee246)[_0x9c68('0x33')](_0x5a5377);};}exports[_0x9c68('0x34')]=function(_0x100d8c,_0x1e8d53){var _0x5c99e1={},_0xb31ca2={},_0x5e8f4b={'count':0x0,'rows':[]};var _0x3e8690=_[_0x9c68('0x35')](db[_0x9c68('0x36')][_0x9c68('0x37')],function(_0x31ad46){return{'name':_0x31ad46[_0x9c68('0x38')],'type':_0x31ad46[_0x9c68('0x39')]['key']};});_0xb31ca2['model']=_[_0x9c68('0x35')](_0x3e8690,_0x9c68('0x32'));_0xb31ca2[_0x9c68('0x3a')]=_[_0x9c68('0x3b')](_0x100d8c['query']);_0xb31ca2['filters']=_[_0x9c68('0x3c')](_0xb31ca2[_0x9c68('0x3d')],_0xb31ca2[_0x9c68('0x3a')]);_0x5c99e1[_0x9c68('0x3e')]=_['intersection'](_0xb31ca2['model'],qs[_0x9c68('0x3f')](_0x100d8c[_0x9c68('0x3a')]['fields']));_0x5c99e1[_0x9c68('0x3e')]=_0x5c99e1[_0x9c68('0x3e')][_0x9c68('0x40')]?_0x5c99e1['attributes']:_0xb31ca2[_0x9c68('0x3d')];if(!_0x100d8c[_0x9c68('0x3a')]['hasOwnProperty'](_0x9c68('0x41'))){_0x5c99e1[_0x9c68('0x24')]=qs[_0x9c68('0x24')](_0x100d8c[_0x9c68('0x3a')][_0x9c68('0x24')]);_0x5c99e1[_0x9c68('0x22')]=qs[_0x9c68('0x22')](_0x100d8c[_0x9c68('0x3a')][_0x9c68('0x22')]);}_0x5c99e1[_0x9c68('0x42')]=qs[_0x9c68('0x43')](_0x100d8c[_0x9c68('0x3a')][_0x9c68('0x43')]);_0x5c99e1['where']=qs[_0x9c68('0x44')](_[_0x9c68('0x45')](_0x100d8c[_0x9c68('0x3a')],_0xb31ca2['filters']),_0x3e8690);if(_0x100d8c[_0x9c68('0x3a')]['filter']){_0x5c99e1[_0x9c68('0x46')]=_['merge'](_0x5c99e1[_0x9c68('0x46')],{'$or':_['map'](_0x3e8690,function(_0x527569){if(_0x527569[_0x9c68('0x39')]!==_0x9c68('0x47')){var _0x5a731e={};_0x5a731e[_0x527569['name']]={'$like':'%'+_0x100d8c[_0x9c68('0x3a')]['filter']+'%'};return _0x5a731e;}})});}_0x5c99e1=_[_0x9c68('0x48')]({},_0x5c99e1,_0x100d8c[_0x9c68('0x49')]);var _0x599f6a={'where':_0x5c99e1['where']};return db['Team'][_0x9c68('0x25')](_0x599f6a)[_0x9c68('0x2a')](function(_0x1c2ec2){_0x5e8f4b['count']=_0x1c2ec2;if(_0x100d8c[_0x9c68('0x3a')]['includeAll']){_0x5c99e1['include']=[{'all':!![]}];}return db[_0x9c68('0x36')][_0x9c68('0x4a')](_0x5c99e1);})[_0x9c68('0x2a')](function(_0x5932c0){_0x5e8f4b[_0x9c68('0x4b')]=_0x5932c0;return _0x5e8f4b;})[_0x9c68('0x2a')](respondWithFilteredResult(_0x1e8d53,_0x5c99e1))[_0x9c68('0x4c')](handleError(_0x1e8d53,null));};exports[_0x9c68('0x4d')]=function(_0x1f26ca,_0x1d5376){var _0x2719d7={'raw':![],'where':{'id':_0x1f26ca[_0x9c68('0x4e')]['id']}},_0x1d7be8={};_0x1d7be8['model']=_[_0x9c68('0x3b')](db[_0x9c68('0x36')][_0x9c68('0x37')]);_0x1d7be8[_0x9c68('0x3a')]=_['keys'](_0x1f26ca['query']);_0x1d7be8['filters']=_[_0x9c68('0x3c')](_0x1d7be8[_0x9c68('0x3d')],_0x1d7be8[_0x9c68('0x3a')]);_0x2719d7[_0x9c68('0x3e')]=_[_0x9c68('0x3c')](_0x1d7be8[_0x9c68('0x3d')],qs['fields'](_0x1f26ca[_0x9c68('0x3a')][_0x9c68('0x3f')]));_0x2719d7[_0x9c68('0x3e')]=_0x2719d7[_0x9c68('0x3e')][_0x9c68('0x40')]?_0x2719d7[_0x9c68('0x3e')]:_0x1d7be8['model'];if(_0x1f26ca[_0x9c68('0x3a')][_0x9c68('0x4f')]){_0x2719d7['include']=[{'all':!![]}];}_0x2719d7=_[_0x9c68('0x48')]({},_0x2719d7,_0x1f26ca[_0x9c68('0x49')]);return db[_0x9c68('0x36')][_0x9c68('0x50')](_0x2719d7)[_0x9c68('0x2a')](handleEntityNotFound(_0x1d5376,null))[_0x9c68('0x2a')](respondWithResult(_0x1d5376,null))['catch'](handleError(_0x1d5376,null));};exports[_0x9c68('0x51')]=function(_0x41ab76,_0x3f2dbe){return db['Team'][_0x9c68('0x51')](_0x41ab76[_0x9c68('0x52')],{})[_0x9c68('0x2a')](function(_0x1259a8){var _0xdf7859=_0x41ab76[_0x9c68('0x53')][_0x9c68('0x2b')]({'plain':!![]});if(!_0xdf7859)throw new Error(_0x9c68('0x54'));if(_0xdf7859[_0x9c68('0x55')]==='user'){var _0x1432ce=_0x1259a8['get']({'plain':!![]});var _0x5ce0b9=_0x9c68('0x2c');return db[_0x9c68('0x56')]['find']({'where':{'name':_0x5ce0b9,'userProfileId':_0xdf7859[_0x9c68('0x57')]},'raw':!![]})[_0x9c68('0x2a')](function(_0x133ea8){if(_0x133ea8&&_0x133ea8[_0x9c68('0x58')]===0x0){return db[_0x9c68('0x2d')][_0x9c68('0x51')]({'name':_0x1432ce[_0x9c68('0x32')],'resourceId':_0x1432ce['id'],'type':_0x133ea8[_0x9c68('0x32')],'sectionId':_0x133ea8['id']},{})[_0x9c68('0x2a')](function(){return _0x1259a8;});}else{return _0x1259a8;}})[_0x9c68('0x4c')](function(_0x2e5a1f){logger[_0x9c68('0x30')](_0x9c68('0x59'),_0x2e5a1f);throw _0x2e5a1f;});}return _0x1259a8;})[_0x9c68('0x2a')](respondWithResult(_0x3f2dbe,0xc9))[_0x9c68('0x4c')](handleError(_0x3f2dbe,null));};exports[_0x9c68('0x29')]=function(_0x6d6874,_0x28438e){if(_0x6d6874[_0x9c68('0x52')]['id']){delete _0x6d6874[_0x9c68('0x52')]['id'];}return db[_0x9c68('0x36')][_0x9c68('0x50')]({'where':{'id':_0x6d6874[_0x9c68('0x4e')]['id']}})[_0x9c68('0x2a')](handleEntityNotFound(_0x28438e,null))[_0x9c68('0x2a')](saveUpdates(_0x6d6874[_0x9c68('0x52')],null))['then'](respondWithResult(_0x28438e,null))['catch'](handleError(_0x28438e,null));};exports[_0x9c68('0x2e')]=function(_0xcccdb8,_0x2a396b){return db['Team']['find']({'where':{'id':_0xcccdb8[_0x9c68('0x4e')]['id']}})[_0x9c68('0x2a')](handleEntityNotFound(_0x2a396b,null))[_0x9c68('0x2a')](removeEntity(_0x2a396b,null))[_0x9c68('0x4c')](handleError(_0x2a396b,null));};exports[_0x9c68('0x5a')]=function(_0x511e6b,_0x4348d2,_0x2558f7){return db['Team'][_0x9c68('0x5b')]({'where':{'id':_0x511e6b[_0x9c68('0x4e')]['id']}})[_0x9c68('0x2a')](handleEntityNotFound(_0x4348d2,null))[_0x9c68('0x2a')](function(_0x4dd20a){if(!_0x511e6b[_0x9c68('0x3a')]['channel']||!utils[_0x9c68('0x5c')](_0x511e6b[_0x9c68('0x3a')]['channel'])){throw new db['Sequelize'][(_0x9c68('0x5d'))](_0x9c68('0x5e'));}var _0x58b441={};var _0x5c854f={};_0x5c854f[_0x9c68('0x3d')]=_[_0x9c68('0x3b')](db[_[_0x9c68('0x5f')](_0x511e6b[_0x9c68('0x3a')][_0x9c68('0x60')][_0x9c68('0x61')]())+_0x9c68('0x62')][_0x9c68('0x37')]);_0x5c854f[_0x9c68('0x3a')]=_['keys'](_0x511e6b['query']);_0x5c854f[_0x9c68('0x44')]=_[_0x9c68('0x3c')](_0x5c854f['model'],_0x5c854f[_0x9c68('0x3a')]);_0x58b441[_0x9c68('0x3e')]=_[_0x9c68('0x3c')](_0x5c854f[_0x9c68('0x3d')],qs[_0x9c68('0x3f')](_0x511e6b['query']['fields']));_0x58b441['attributes']=_0x58b441[_0x9c68('0x3e')]['length']?_0x58b441['attributes']:_0x5c854f[_0x9c68('0x3d')];_0x58b441[_0x9c68('0x24')]=qs[_0x9c68('0x24')](_0x511e6b['query']['limit']);_0x58b441[_0x9c68('0x22')]=qs['offset'](_0x511e6b['query'][_0x9c68('0x22')]);_0x58b441[_0x9c68('0x42')]=qs['sort'](_0x511e6b[_0x9c68('0x3a')][_0x9c68('0x43')]);_0x58b441[_0x9c68('0x46')]=qs[_0x9c68('0x44')](_[_0x9c68('0x45')](_0x511e6b['query'],_0x5c854f[_0x9c68('0x44')]));_0x58b441=_[_0x9c68('0x48')]({},_0x58b441,_0x511e6b[_0x9c68('0x49')]);return _0x4dd20a[_0x9c68('0x2b')+_[_0x9c68('0x5f')](_0x511e6b[_0x9c68('0x3a')][_0x9c68('0x60')][_0x9c68('0x61')]())+_0x9c68('0x63')](_0x58b441);})[_0x9c68('0x2a')](respondWithResult(_0x4348d2,null))['catch'](handleError(_0x4348d2,null));};exports[_0x9c68('0x64')]=function(_0x14cd4c,_0x5b27b1,_0x35bc76){return db[_0x9c68('0x36')][_0x9c68('0x5b')]({'where':{'id':_0x14cd4c['params']['id']}})[_0x9c68('0x2a')](function(_0x1c1c25){if(_0x1c1c25){if(!_0x14cd4c['body'][_0x9c68('0x60')]||!utils[_0x9c68('0x5c')](_0x14cd4c['body']['channel'])){throw new db['Sequelize']['ValidationError'](_0x9c68('0x5e'));}return _0x1c1c25[_0x9c68('0x65')+_['capitalize'](_0x14cd4c[_0x9c68('0x52')][_0x9c68('0x60')][_0x9c68('0x61')]())+_0x9c68('0x63')](_0x14cd4c[_0x9c68('0x52')][_0x9c68('0x66')]);}return null;})['then'](handleEntityNotFound(_0x5b27b1,null))[_0x9c68('0x2a')](respondWithStatusCode(_0x5b27b1,null))[_0x9c68('0x4c')](handleError(_0x5b27b1,null));};exports[_0x9c68('0x67')]=function(_0x49ba37,_0x3ac3ff,_0x3b92df){return db[_0x9c68('0x36')][_0x9c68('0x5b')]({'where':{'id':_0x49ba37[_0x9c68('0x4e')]['id']}})[_0x9c68('0x2a')](function(_0x46e20d){if(_0x46e20d){if(!_0x49ba37[_0x9c68('0x3a')][_0x9c68('0x60')]||!utils[_0x9c68('0x5c')](_0x49ba37[_0x9c68('0x3a')][_0x9c68('0x60')])){throw new db[(_0x9c68('0x68'))][(_0x9c68('0x5d'))](_0x9c68('0x5e'));}return _0x46e20d[_0x9c68('0x69')+_[_0x9c68('0x5f')](_0x49ba37[_0x9c68('0x3a')][_0x9c68('0x60')][_0x9c68('0x61')]())+_0x9c68('0x63')](_0x49ba37['query'][_0x9c68('0x66')]);}return null;})[_0x9c68('0x2a')](handleEntityNotFound(_0x3ac3ff,null))['then'](respondWithStatusCode(_0x3ac3ff,null))['catch'](handleError(_0x3ac3ff,null));};exports[_0x9c68('0x6a')]=function(_0x91f7e8,_0x491c17){return db[_0x9c68('0x36')][_0x9c68('0x50')]({'where':{'id':_0x91f7e8[_0x9c68('0x4e')]['id']}})[_0x9c68('0x2a')](handleEntityNotFound(_0x491c17,null))[_0x9c68('0x2a')](function(_0x3e5fb3){if(_0x3e5fb3){var _0x27ce5c=[_0x9c68('0x6b'),_0x9c68('0x6c'),_0x9c68('0x6d'),_0x9c68('0x6e'),_0x9c68('0x6f'),_0x9c68('0x70'),_0x9c68('0x71')];return db[_0x9c68('0x72')][_0x9c68('0x73')](function(_0x13222f){var _0x31ca03=_['map'](_0x27ce5c,function(_0x41b32c){var _0x1ae23d={'attributes':['id',_0x9c68('0x32')]};if(_0x41b32c==='Voice'){_0x1ae23d[_0x9c68('0x74')]={'attributes':[_0x9c68('0x75')]};}return _0x3e5fb3[_0x9c68('0x2b')+_0x41b32c+_0x9c68('0x63')](_0x1ae23d)[_0x9c68('0x2a')](function(_0x2318cb){var _0x452e6c=_[_0x9c68('0x35')](_0x2318cb,function(_0x134c66){var _0x3ac2f5=_[_0x9c68('0x35')](_0x91f7e8['body'][_0x9c68('0x66')],function(_0x53a71b){var _0x47923d={'where':{'UserId':_0x53a71b,[_0x41b32c+'QueueId']:_0x134c66['id']},'transaction':_0x13222f};if(_0x41b32c===_0x9c68('0x6b')){_0x47923d[_0x9c68('0x1b')]={'penalty':_0x134c66[_0x9c68('0x76')][_0x9c68('0x75')]};}return db['User'+_0x41b32c+_0x9c68('0x62')][_0x9c68('0x77')](_0x47923d)[_0x9c68('0x2a')](function(){socket['emit'](_0x9c68('0x53')+_0x41b32c+_0x9c68('0x78'),{'UserId':_0x53a71b,[_0x41b32c+_0x9c68('0x79')]:_0x134c66['id']});if(_0x41b32c!==_0x9c68('0x6b'))return;return db[_0x9c68('0x7a')]['findAll']({'where':{'id':_0x91f7e8[_0x9c68('0x52')][_0x9c68('0x66')],'online':0x1},'attributes':['id',_0x9c68('0x32'),'online','voicePause',_0x9c68('0x7b')],'raw':!![]})['then'](function(_0x2388d2){var _0xce6d05=_[_0x9c68('0x35')](_0x2388d2,function(_0xf7cfe4){return db[_0x9c68('0x7c')][_0x9c68('0x7d')]({'membername':_0xf7cfe4['name'],'UserId':_0xf7cfe4['id'],'queue_name':_0x134c66[_0x9c68('0x32')],'VoiceQueueId':_0x134c66['id'],'interface':_[_0x9c68('0x7e')](_0xf7cfe4[_0x9c68('0x7b')])?util['format'](_0x9c68('0x7f'),_0xf7cfe4[_0x9c68('0x32')]):_0xf7cfe4[_0x9c68('0x7b')],'paused':_0xf7cfe4[_0x9c68('0x80')]||![],'penalty':_0x134c66[_0x9c68('0x76')][_0x9c68('0x75')]},{'transaction':_0x13222f});});return Promise[_0x9c68('0x81')](_0xce6d05);});});});return Promise[_0x9c68('0x81')](_0x3ac2f5);});return Promise[_0x9c68('0x81')](_0x452e6c);})[_0x9c68('0x2a')](function(){var _0x18d5d6=JSON['parse']('['+_0x91f7e8[_0x9c68('0x52')]['ids']+']');db[_0x9c68('0x82')][_0x9c68('0x5b')]({'where':{'teamId':_0x91f7e8[_0x9c68('0x4e')]['id']}})[_0x9c68('0x2a')](function(_0x1d77b5){if(_0x1d77b5){for(var _0x57a35f=0x0;_0x57a35f<_0x18d5d6[_0x9c68('0x40')];_0x57a35f++){var _0x3c82e7=_0x18d5d6[_0x57a35f];db['UserVoicePrefix'][_0x9c68('0x7d')]({'UserId':_0x3c82e7,'VoicePrefixId':_0x1d77b5[_0x9c68('0x83')]});}}});});});return Promise[_0x9c68('0x81')](_0x31ca03)[_0x9c68('0x2a')](function(){return _0x3e5fb3[_0x9c68('0x6a')](_0x91f7e8[_0x9c68('0x52')]['ids'],{'transaction':_0x13222f})[_0x9c68('0x84')](function(_0x18b006){return _0x18b006;});});});}})[_0x9c68('0x2a')](respondWithResult(_0x491c17,null))['catch'](handleError(_0x491c17,null));};exports[_0x9c68('0x85')]=function(_0x1aebc7,_0x24a14f){return db['Team'][_0x9c68('0x50')]({'where':{'id':_0x1aebc7[_0x9c68('0x4e')]['id']}})[_0x9c68('0x2a')](handleEntityNotFound(_0x24a14f,null))[_0x9c68('0x2a')](function(_0x3d895e){if(_0x3d895e){var _0x48252f=['Voice','Chat',_0x9c68('0x6d'),_0x9c68('0x6e'),_0x9c68('0x6f'),'Openchannel','Whatsapp'];return db[_0x9c68('0x72')][_0x9c68('0x73')](function(_0x3ab630){var _0x429711=_[_0x9c68('0x35')](_0x48252f,function(_0x18a0dc){var _0x3cf09e={'attributes':['id',_0x9c68('0x32')]};return _0x3d895e[_0x9c68('0x2b')+_0x18a0dc+_0x9c68('0x63')](_0x3cf09e)['then'](function(_0x350511){var _0x25f625=_[_0x9c68('0x35')](_0x350511,function(_0x4a85b5){return _0x4a85b5[_0x9c68('0x85')](_0x1aebc7['query'][_0x9c68('0x66')],{'transaction':_0x3ab630})[_0x9c68('0x2a')](function(){var _0x92b8f6=JSON[_0x9c68('0x86')]('['+_0x1aebc7['query'][_0x9c68('0x66')]+']');var _0x543f3c=_[_0x9c68('0x35')](_0x92b8f6,function(_0x276178){socket[_0x9c68('0x87')]('user'+_0x18a0dc+_0x9c68('0x88'),{'UserId':Number(_0x276178),[_0x18a0dc+_0x9c68('0x79')]:_0x4a85b5['id']});if(_0x18a0dc!==_0x9c68('0x6b'))return;return db[_0x9c68('0x7c')][_0x9c68('0x2e')]({'where':{'VoiceQueueId':_0x4a85b5['id'],'UserId':_0x276178},'transaction':_0x3ab630});});return Promise[_0x9c68('0x81')](_0x543f3c);});});return Promise['all'](_0x25f625);});});return Promise['all'](_0x429711)[_0x9c68('0x2a')](function(){return _0x3d895e[_0x9c68('0x85')](_0x1aebc7[_0x9c68('0x3a')][_0x9c68('0x66')],{'transaction':_0x3ab630});})[_0x9c68('0x2a')](function(){var _0x5563b5=JSON[_0x9c68('0x86')]('['+_0x1aebc7[_0x9c68('0x3a')][_0x9c68('0x66')]+']');db[_0x9c68('0x82')][_0x9c68('0x5b')]({'where':{'teamId':_0x1aebc7[_0x9c68('0x4e')]['id']}})['then'](function(_0x38d0ee){if(_0x38d0ee){for(var _0x52078e=0x0;_0x52078e<_0x5563b5['length'];_0x52078e++){var _0x192425=_0x5563b5[_0x52078e];db[_0x9c68('0x89')][_0x9c68('0x2e')]({'where':{'UserId':_0x192425,'VoicePrefixId':_0x38d0ee[_0x9c68('0x83')]}});}}});});});}})[_0x9c68('0x2a')](respondWithStatusCode(_0x24a14f,null))[_0x9c68('0x4c')](handleError(_0x24a14f,null));};exports[_0x9c68('0x8a')]=function(_0x457e29,_0x4ab75f,_0x23fa41){var _0x5433c9={};var _0x183c05={};var _0x220e58;var _0x4db8c6;return db[_0x9c68('0x36')][_0x9c68('0x5b')]({'where':{'id':_0x457e29[_0x9c68('0x4e')]['id']}})[_0x9c68('0x2a')](handleEntityNotFound(_0x4ab75f,null))[_0x9c68('0x2a')](function(_0x5cbafa){if(_0x5cbafa){_0x220e58=_0x5cbafa;_0x183c05[_0x9c68('0x3d')]=_['keys'](db[_0x9c68('0x7a')][_0x9c68('0x37')]);_0x183c05[_0x9c68('0x3a')]=_[_0x9c68('0x3b')](_0x457e29[_0x9c68('0x3a')]);_0x183c05['filters']=_[_0x9c68('0x3c')](_0x183c05[_0x9c68('0x3d')],_0x183c05[_0x9c68('0x3a')]);_0x5433c9[_0x9c68('0x3e')]=_[_0x9c68('0x3c')](_0x183c05[_0x9c68('0x3d')],qs[_0x9c68('0x3f')](_0x457e29[_0x9c68('0x3a')][_0x9c68('0x3f')]));_0x5433c9[_0x9c68('0x3e')]=_0x5433c9['attributes']['length']?_0x5433c9[_0x9c68('0x3e')]:_0x183c05[_0x9c68('0x3d')];_0x5433c9[_0x9c68('0x42')]=qs['sort'](_0x457e29[_0x9c68('0x3a')][_0x9c68('0x43')]);_0x5433c9[_0x9c68('0x46')]=qs[_0x9c68('0x44')](_[_0x9c68('0x45')](_0x457e29[_0x9c68('0x3a')],_0x183c05[_0x9c68('0x44')]));if(_0x457e29[_0x9c68('0x3a')]['filter']){_0x5433c9[_0x9c68('0x46')]=_[_0x9c68('0x48')](_0x5433c9[_0x9c68('0x46')],{'$or':_[_0x9c68('0x35')](_0x5433c9[_0x9c68('0x3e')],function(_0x5caef7){var _0xcc81b7={};_0xcc81b7[_0x5caef7]={'$like':'%'+_0x457e29[_0x9c68('0x3a')][_0x9c68('0x8b')]+'%'};return _0xcc81b7;})});}_0x5433c9=_['merge']({},_0x5433c9,_0x457e29['options']);return _0x220e58[_0x9c68('0x8a')](_0x5433c9);}})[_0x9c68('0x2a')](function(_0x4fc470){if(_0x4fc470){_0x4db8c6=_0x4fc470[_0x9c68('0x40')];if(!_0x457e29[_0x9c68('0x3a')]['hasOwnProperty']('nolimit')){_0x5433c9[_0x9c68('0x24')]=qs[_0x9c68('0x24')](_0x457e29[_0x9c68('0x3a')][_0x9c68('0x24')]);_0x5433c9['offset']=qs['offset'](_0x457e29[_0x9c68('0x3a')][_0x9c68('0x22')]);}return _0x220e58[_0x9c68('0x8a')](_0x5433c9);}})[_0x9c68('0x2a')](function(_0x4b0b45){if(_0x4b0b45){return _0x4b0b45?{'count':_0x4db8c6,'rows':_0x4b0b45}:null;}})['then'](respondWithResult(_0x4ab75f,null))[_0x9c68('0x4c')](handleError(_0x4ab75f,null));}; \ No newline at end of file +var _0x3606=['Sms','sequelize','transaction','penalty','TeamVoiceQueue','User','findOrCreate','emit','online','voicePause','UserVoiceQueueRt','upsert','isNil','interface','SIP/%s','all','parse','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','removeAgents','Chat','Fax','Whatsapp','Queue:remove','QueueId','getAgents','eml-format','rimraf','moment','mustache','util','sox','ejs','fs-extra','lodash','crypto','jsforce','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','../../mysqldb','defaults','redis','socket.io-emitter','./team.socket','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','Teams','UserProfileResource','stack','name','send','map','Team','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','params','length','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getQueues','channel','isValidChannel','ValidationError','capitalize','Queue','toLowerCase','findOne','Unknown\x20channel','add','Queues','removeQueues','Sequelize','remove','ids','addAgents','Voice','Mail'];(function(_0x3b6708,_0x5c398b){var _0x2fb1bf=function(_0x28d737){while(--_0x28d737){_0x3b6708['push'](_0x3b6708['shift']());}};_0x2fb1bf(++_0x5c398b);}(_0x3606,0x127));var _0x6360=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3606[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x6360('0x0'));var rimraf=require(_0x6360('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6360('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x6360('0x3'));var util=require(_0x6360('0x4'));var path=require('path');var sox=require(_0x6360('0x5'));var csv=require('to-csv');var ejs=require(_0x6360('0x6'));var fs=require('fs');var fs_extra=require(_0x6360('0x7'));var _=require(_0x6360('0x8'));var squel=require('squel');var crypto=require(_0x6360('0x9'));var jsforce=require(_0x6360('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x6360('0xb'));var querystring=require(_0x6360('0xc'));var Papa=require(_0x6360('0xd'));var Redis=require(_0x6360('0xe'));var authService=require(_0x6360('0xf'));var qs=require(_0x6360('0x10'));var as=require(_0x6360('0x11'));var hardwareService=require(_0x6360('0x12'));var logger=require(_0x6360('0x13'))(_0x6360('0x14'));var utils=require('../../config/utils');var config=require(_0x6360('0x15'));var licenseUtil=require(_0x6360('0x16'));var db=require(_0x6360('0x17'))['db'];config['redis']=_[_0x6360('0x18')](config[_0x6360('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x6360('0x1a'))(new Redis(config[_0x6360('0x19')]));require(_0x6360('0x1b'))['register'](socket);function respondWithStatusCode(_0x2d960b,_0x3fed33){_0x3fed33=_0x3fed33||0xcc;return function(_0x154378){if(_0x154378){return _0x2d960b[_0x6360('0x1c')](_0x3fed33);}return _0x2d960b['status'](_0x3fed33)[_0x6360('0x1d')]();};}function respondWithResult(_0xcd7f91,_0x9a774e){_0x9a774e=_0x9a774e||0xc8;return function(_0x57b795){if(_0x57b795){return _0xcd7f91[_0x6360('0x1e')](_0x9a774e)[_0x6360('0x1f')](_0x57b795);}};}function respondWithFilteredResult(_0x337c72,_0x567d57){return function(_0x261f47){if(_0x261f47){var _0x4700c4=typeof _0x567d57[_0x6360('0x20')]===_0x6360('0x21')&&typeof _0x567d57[_0x6360('0x22')]===_0x6360('0x21');var _0x219f7e=_0x261f47[_0x6360('0x23')];var _0x238f71=_0x4700c4?0x0:_0x567d57[_0x6360('0x20')];var _0x11efd2=_0x4700c4?_0x261f47['count']:_0x567d57[_0x6360('0x20')]+_0x567d57[_0x6360('0x22')];var _0x445637;if(_0x11efd2>=_0x219f7e){_0x11efd2=_0x219f7e;_0x445637=0xc8;}else{_0x445637=0xce;}_0x337c72[_0x6360('0x1e')](_0x445637);return _0x337c72[_0x6360('0x24')](_0x6360('0x25'),_0x238f71+'-'+_0x11efd2+'/'+_0x219f7e)[_0x6360('0x1f')](_0x261f47);}return null;};}function patchUpdates(_0x394b06){return function(_0x5d2b02){try{jsonpatch[_0x6360('0x26')](_0x5d2b02,_0x394b06,!![]);}catch(_0x1af4cc){return BPromise[_0x6360('0x27')](_0x1af4cc);}return _0x5d2b02['save']();};}function saveUpdates(_0x23debe,_0x1c6248){return function(_0x576a6c){if(_0x576a6c){return _0x576a6c[_0x6360('0x28')](_0x23debe)[_0x6360('0x29')](function(_0x3365ff){return _0x3365ff;});}return null;};}function removeEntity(_0x43bccb,_0xe3dae6){return function(_0x42042c){if(_0x42042c){return _0x42042c[_0x6360('0x2a')]()[_0x6360('0x29')](function(){var _0x141df9=_0x42042c['get']({'plain':!![]});var _0x16f9b1=_0x6360('0x2b');return db[_0x6360('0x2c')]['destroy']({'where':{'type':_0x16f9b1,'resourceId':_0x141df9['id']}})[_0x6360('0x29')](function(){return _0x42042c;});})[_0x6360('0x29')](function(){_0x43bccb['status'](0xcc)[_0x6360('0x1d')]();});}};}function handleEntityNotFound(_0x4317be,_0x10fed9){return function(_0x5f30f3){if(!_0x5f30f3){_0x4317be[_0x6360('0x1c')](0x194);}return _0x5f30f3;};}function handleError(_0x238f5c,_0x44ad9d){_0x44ad9d=_0x44ad9d||0x1f4;return function(_0x2cbc27){logger['error'](_0x2cbc27[_0x6360('0x2d')]);if(_0x2cbc27[_0x6360('0x2e')]){delete _0x2cbc27[_0x6360('0x2e')];}_0x238f5c[_0x6360('0x1e')](_0x44ad9d)[_0x6360('0x2f')](_0x2cbc27);};}exports['index']=function(_0x54ea10,_0x38252d){var _0x5efc43={},_0x135f64={},_0x20095c={'count':0x0,'rows':[]};var _0x2218dc=_[_0x6360('0x30')](db[_0x6360('0x31')][_0x6360('0x32')],function(_0x5b2d7e){return{'name':_0x5b2d7e[_0x6360('0x33')],'type':_0x5b2d7e[_0x6360('0x34')]['key']};});_0x135f64[_0x6360('0x35')]=_['map'](_0x2218dc,_0x6360('0x2e'));_0x135f64[_0x6360('0x36')]=_[_0x6360('0x37')](_0x54ea10[_0x6360('0x36')]);_0x135f64[_0x6360('0x38')]=_[_0x6360('0x39')](_0x135f64[_0x6360('0x35')],_0x135f64[_0x6360('0x36')]);_0x5efc43[_0x6360('0x3a')]=_[_0x6360('0x39')](_0x135f64[_0x6360('0x35')],qs['fields'](_0x54ea10[_0x6360('0x36')][_0x6360('0x3b')]));_0x5efc43['attributes']=_0x5efc43[_0x6360('0x3a')]['length']?_0x5efc43[_0x6360('0x3a')]:_0x135f64[_0x6360('0x35')];if(!_0x54ea10['query'][_0x6360('0x3c')](_0x6360('0x3d'))){_0x5efc43[_0x6360('0x22')]=qs[_0x6360('0x22')](_0x54ea10[_0x6360('0x36')][_0x6360('0x22')]);_0x5efc43['offset']=qs[_0x6360('0x20')](_0x54ea10['query'][_0x6360('0x20')]);}_0x5efc43[_0x6360('0x3e')]=qs[_0x6360('0x3f')](_0x54ea10['query'][_0x6360('0x3f')]);_0x5efc43[_0x6360('0x40')]=qs[_0x6360('0x38')](_[_0x6360('0x41')](_0x54ea10[_0x6360('0x36')],_0x135f64[_0x6360('0x38')]),_0x2218dc);if(_0x54ea10[_0x6360('0x36')][_0x6360('0x42')]){_0x5efc43['where']=_[_0x6360('0x43')](_0x5efc43[_0x6360('0x40')],{'$or':_[_0x6360('0x30')](_0x2218dc,function(_0x1916a1){if(_0x1916a1[_0x6360('0x34')]!==_0x6360('0x44')){var _0x23ff9b={};_0x23ff9b[_0x1916a1['name']]={'$like':'%'+_0x54ea10[_0x6360('0x36')][_0x6360('0x42')]+'%'};return _0x23ff9b;}})});}_0x5efc43=_[_0x6360('0x43')]({},_0x5efc43,_0x54ea10[_0x6360('0x45')]);var _0x2f61eb={'where':_0x5efc43[_0x6360('0x40')]};return db[_0x6360('0x31')][_0x6360('0x23')](_0x2f61eb)[_0x6360('0x29')](function(_0x3649c5){_0x20095c[_0x6360('0x23')]=_0x3649c5;if(_0x54ea10[_0x6360('0x36')]['includeAll']){_0x5efc43[_0x6360('0x46')]=[{'all':!![]}];}return db[_0x6360('0x31')][_0x6360('0x47')](_0x5efc43);})['then'](function(_0x5d04db){_0x20095c['rows']=_0x5d04db;return _0x20095c;})[_0x6360('0x29')](respondWithFilteredResult(_0x38252d,_0x5efc43))[_0x6360('0x48')](handleError(_0x38252d,null));};exports[_0x6360('0x49')]=function(_0x5a667e,_0x12a271){var _0x2d32eb={'raw':![],'where':{'id':_0x5a667e[_0x6360('0x4a')]['id']}},_0x1dbf2c={};_0x1dbf2c['model']=_[_0x6360('0x37')](db['Team'][_0x6360('0x32')]);_0x1dbf2c[_0x6360('0x36')]=_[_0x6360('0x37')](_0x5a667e['query']);_0x1dbf2c[_0x6360('0x38')]=_[_0x6360('0x39')](_0x1dbf2c[_0x6360('0x35')],_0x1dbf2c['query']);_0x2d32eb[_0x6360('0x3a')]=_['intersection'](_0x1dbf2c[_0x6360('0x35')],qs['fields'](_0x5a667e[_0x6360('0x36')][_0x6360('0x3b')]));_0x2d32eb[_0x6360('0x3a')]=_0x2d32eb[_0x6360('0x3a')][_0x6360('0x4b')]?_0x2d32eb['attributes']:_0x1dbf2c[_0x6360('0x35')];if(_0x5a667e['query'][_0x6360('0x4c')]){_0x2d32eb[_0x6360('0x46')]=[{'all':!![]}];}_0x2d32eb=_['merge']({},_0x2d32eb,_0x5a667e[_0x6360('0x45')]);return db[_0x6360('0x31')][_0x6360('0x4d')](_0x2d32eb)[_0x6360('0x29')](handleEntityNotFound(_0x12a271,null))[_0x6360('0x29')](respondWithResult(_0x12a271,null))['catch'](handleError(_0x12a271,null));};exports['create']=function(_0x562b02,_0x5a58d8){return db[_0x6360('0x31')][_0x6360('0x4e')](_0x562b02[_0x6360('0x4f')],{})[_0x6360('0x29')](function(_0x36ce1e){var _0x51845e=_0x562b02[_0x6360('0x50')][_0x6360('0x51')]({'plain':!![]});if(!_0x51845e)throw new Error(_0x6360('0x52'));if(_0x51845e[_0x6360('0x53')]===_0x6360('0x50')){var _0x356ac9=_0x36ce1e[_0x6360('0x51')]({'plain':!![]});var _0x325271=_0x6360('0x2b');return db[_0x6360('0x54')][_0x6360('0x4d')]({'where':{'name':_0x325271,'userProfileId':_0x51845e[_0x6360('0x55')]},'raw':!![]})[_0x6360('0x29')](function(_0x104ca3){if(_0x104ca3&&_0x104ca3[_0x6360('0x56')]===0x0){return db[_0x6360('0x2c')][_0x6360('0x4e')]({'name':_0x356ac9['name'],'resourceId':_0x356ac9['id'],'type':_0x104ca3[_0x6360('0x2e')],'sectionId':_0x104ca3['id']},{})['then'](function(){return _0x36ce1e;});}else{return _0x36ce1e;}})[_0x6360('0x48')](function(_0x2bd2a4){logger[_0x6360('0x57')](_0x6360('0x58'),_0x2bd2a4);throw _0x2bd2a4;});}return _0x36ce1e;})['then'](respondWithResult(_0x5a58d8,0xc9))[_0x6360('0x48')](handleError(_0x5a58d8,null));};exports['update']=function(_0x501d8c,_0x137c98){if(_0x501d8c['body']['id']){delete _0x501d8c['body']['id'];}return db['Team']['find']({'where':{'id':_0x501d8c[_0x6360('0x4a')]['id']}})[_0x6360('0x29')](handleEntityNotFound(_0x137c98,null))[_0x6360('0x29')](saveUpdates(_0x501d8c[_0x6360('0x4f')],null))[_0x6360('0x29')](respondWithResult(_0x137c98,null))[_0x6360('0x48')](handleError(_0x137c98,null));};exports['destroy']=function(_0x56cf1d,_0x1799f7){return db[_0x6360('0x31')][_0x6360('0x4d')]({'where':{'id':_0x56cf1d[_0x6360('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1799f7,null))['then'](removeEntity(_0x1799f7,null))[_0x6360('0x48')](handleError(_0x1799f7,null));};exports[_0x6360('0x59')]=function(_0x3132c0,_0x422b0e,_0x131140){return db[_0x6360('0x31')]['findOne']({'where':{'id':_0x3132c0[_0x6360('0x4a')]['id']}})[_0x6360('0x29')](handleEntityNotFound(_0x422b0e,null))[_0x6360('0x29')](function(_0x4bfaa4){if(!_0x3132c0[_0x6360('0x36')][_0x6360('0x5a')]||!utils[_0x6360('0x5b')](_0x3132c0['query']['channel'])){throw new db['Sequelize'][(_0x6360('0x5c'))]('Unknown\x20channel');}var _0x5120fa={};var _0x5b623c={};_0x5b623c[_0x6360('0x35')]=_[_0x6360('0x37')](db[_[_0x6360('0x5d')](_0x3132c0[_0x6360('0x36')][_0x6360('0x5a')]['toLowerCase']())+_0x6360('0x5e')]['rawAttributes']);_0x5b623c['query']=_[_0x6360('0x37')](_0x3132c0['query']);_0x5b623c['filters']=_[_0x6360('0x39')](_0x5b623c[_0x6360('0x35')],_0x5b623c[_0x6360('0x36')]);_0x5120fa[_0x6360('0x3a')]=_[_0x6360('0x39')](_0x5b623c[_0x6360('0x35')],qs[_0x6360('0x3b')](_0x3132c0[_0x6360('0x36')]['fields']));_0x5120fa[_0x6360('0x3a')]=_0x5120fa[_0x6360('0x3a')][_0x6360('0x4b')]?_0x5120fa['attributes']:_0x5b623c[_0x6360('0x35')];_0x5120fa[_0x6360('0x22')]=qs['limit'](_0x3132c0[_0x6360('0x36')][_0x6360('0x22')]);_0x5120fa[_0x6360('0x20')]=qs[_0x6360('0x20')](_0x3132c0[_0x6360('0x36')]['offset']);_0x5120fa['order']=qs[_0x6360('0x3f')](_0x3132c0[_0x6360('0x36')][_0x6360('0x3f')]);_0x5120fa[_0x6360('0x40')]=qs['filters'](_[_0x6360('0x41')](_0x3132c0[_0x6360('0x36')],_0x5b623c['filters']));_0x5120fa=_[_0x6360('0x43')]({},_0x5120fa,_0x3132c0[_0x6360('0x45')]);return _0x4bfaa4['get'+_[_0x6360('0x5d')](_0x3132c0['query'][_0x6360('0x5a')][_0x6360('0x5f')]())+'Queues'](_0x5120fa);})[_0x6360('0x29')](respondWithResult(_0x422b0e,null))[_0x6360('0x48')](handleError(_0x422b0e,null));};exports['addQueues']=function(_0xac39b,_0x1ed0bf,_0x574fd0){return db[_0x6360('0x31')][_0x6360('0x60')]({'where':{'id':_0xac39b[_0x6360('0x4a')]['id']}})['then'](function(_0x4302e8){if(_0x4302e8){if(!_0xac39b[_0x6360('0x4f')]['channel']||!utils[_0x6360('0x5b')](_0xac39b[_0x6360('0x4f')][_0x6360('0x5a')])){throw new db['Sequelize'][(_0x6360('0x5c'))](_0x6360('0x61'));}return _0x4302e8[_0x6360('0x62')+_[_0x6360('0x5d')](_0xac39b[_0x6360('0x4f')][_0x6360('0x5a')]['toLowerCase']())+_0x6360('0x63')](_0xac39b[_0x6360('0x4f')]['ids']);}return null;})[_0x6360('0x29')](handleEntityNotFound(_0x1ed0bf,null))[_0x6360('0x29')](respondWithStatusCode(_0x1ed0bf,null))['catch'](handleError(_0x1ed0bf,null));};exports[_0x6360('0x64')]=function(_0x2a9af5,_0x292242,_0x429496){return db[_0x6360('0x31')][_0x6360('0x60')]({'where':{'id':_0x2a9af5[_0x6360('0x4a')]['id']}})[_0x6360('0x29')](function(_0x2b8155){if(_0x2b8155){if(!_0x2a9af5[_0x6360('0x36')]['channel']||!utils[_0x6360('0x5b')](_0x2a9af5[_0x6360('0x36')]['channel'])){throw new db[(_0x6360('0x65'))][(_0x6360('0x5c'))](_0x6360('0x61'));}return _0x2b8155[_0x6360('0x66')+_[_0x6360('0x5d')](_0x2a9af5[_0x6360('0x36')][_0x6360('0x5a')][_0x6360('0x5f')]())+_0x6360('0x63')](_0x2a9af5[_0x6360('0x36')][_0x6360('0x67')]);}return null;})[_0x6360('0x29')](handleEntityNotFound(_0x292242,null))[_0x6360('0x29')](respondWithStatusCode(_0x292242,null))[_0x6360('0x48')](handleError(_0x292242,null));};exports[_0x6360('0x68')]=function(_0x214b91,_0x5cd8d6){return db[_0x6360('0x31')][_0x6360('0x4d')]({'where':{'id':_0x214b91[_0x6360('0x4a')]['id']}})[_0x6360('0x29')](handleEntityNotFound(_0x5cd8d6,null))['then'](function(_0x344c8e){if(_0x344c8e){var _0x4e8b8e=[_0x6360('0x69'),'Chat',_0x6360('0x6a'),_0x6360('0x6b'),'Fax','Openchannel','Whatsapp'];return db[_0x6360('0x6c')][_0x6360('0x6d')](function(_0x2d96f7){var _0x3e3182=_[_0x6360('0x30')](_0x4e8b8e,function(_0xa41cb){var _0x2d4c78={'attributes':['id',_0x6360('0x2e')]};if(_0xa41cb===_0x6360('0x69')){_0x2d4c78['through']={'attributes':[_0x6360('0x6e')]};}return _0x344c8e[_0x6360('0x51')+_0xa41cb+_0x6360('0x63')](_0x2d4c78)['then'](function(_0x39e588){var _0x540354=_[_0x6360('0x30')](_0x39e588,function(_0x3ff342){var _0x315560=_[_0x6360('0x30')](_0x214b91[_0x6360('0x4f')][_0x6360('0x67')],function(_0x3325ca){var _0x3912f7={'where':{'UserId':_0x3325ca,[_0xa41cb+'QueueId']:_0x3ff342['id']},'transaction':_0x2d96f7};if(_0xa41cb===_0x6360('0x69')){_0x3912f7[_0x6360('0x18')]={'penalty':_0x3ff342[_0x6360('0x6f')][_0x6360('0x6e')]};}return db[_0x6360('0x70')+_0xa41cb+_0x6360('0x5e')][_0x6360('0x71')](_0x3912f7)[_0x6360('0x29')](function(){socket[_0x6360('0x72')](_0x6360('0x50')+_0xa41cb+'Queue:save',{'UserId':_0x3325ca,[_0xa41cb+'QueueId']:_0x3ff342['id']});if(_0xa41cb!==_0x6360('0x69'))return;return db[_0x6360('0x70')][_0x6360('0x47')]({'where':{'id':_0x214b91[_0x6360('0x4f')][_0x6360('0x67')],'online':0x1},'attributes':['id',_0x6360('0x2e'),_0x6360('0x73'),_0x6360('0x74'),'interface'],'raw':!![]})['then'](function(_0xf6a98b){var _0x2238b6=_[_0x6360('0x30')](_0xf6a98b,function(_0x5cbedd){return db[_0x6360('0x75')][_0x6360('0x76')]({'membername':_0x5cbedd[_0x6360('0x2e')],'UserId':_0x5cbedd['id'],'queue_name':_0x3ff342[_0x6360('0x2e')],'VoiceQueueId':_0x3ff342['id'],'interface':_[_0x6360('0x77')](_0x5cbedd[_0x6360('0x78')])?util['format'](_0x6360('0x79'),_0x5cbedd[_0x6360('0x2e')]):_0x5cbedd[_0x6360('0x78')],'paused':_0x5cbedd['voicePause']||![],'penalty':_0x3ff342[_0x6360('0x6f')][_0x6360('0x6e')]},{'transaction':_0x2d96f7});});return Promise['all'](_0x2238b6);});});});return Promise[_0x6360('0x7a')](_0x315560);});return Promise[_0x6360('0x7a')](_0x540354);})['then'](function(){var _0x3610f7=JSON[_0x6360('0x7b')]('['+_0x214b91[_0x6360('0x4f')][_0x6360('0x67')]+']');db[_0x6360('0x7c')][_0x6360('0x60')]({'where':{'teamId':_0x214b91['params']['id']}})[_0x6360('0x29')](function(_0x1e066c){if(_0x1e066c){for(var _0x528a96=0x0;_0x528a96<_0x3610f7[_0x6360('0x4b')];_0x528a96++){var _0x2c2665=_0x3610f7[_0x528a96];db[_0x6360('0x7d')][_0x6360('0x76')]({'UserId':_0x2c2665,'VoicePrefixId':_0x1e066c[_0x6360('0x7e')]});}}});});});return Promise[_0x6360('0x7a')](_0x3e3182)[_0x6360('0x29')](function(){return _0x344c8e[_0x6360('0x68')](_0x214b91[_0x6360('0x4f')][_0x6360('0x67')],{'transaction':_0x2d96f7})['spread'](function(_0x39c88a){return _0x39c88a;});});});}})[_0x6360('0x29')](respondWithResult(_0x5cd8d6,null))[_0x6360('0x48')](handleError(_0x5cd8d6,null));};exports[_0x6360('0x7f')]=function(_0x4fbcc4,_0x3f61f0){return db[_0x6360('0x31')][_0x6360('0x4d')]({'where':{'id':_0x4fbcc4['params']['id']}})[_0x6360('0x29')](handleEntityNotFound(_0x3f61f0,null))[_0x6360('0x29')](function(_0x5449f8){if(_0x5449f8){var _0x20f05c=[_0x6360('0x69'),_0x6360('0x80'),_0x6360('0x6a'),_0x6360('0x6b'),_0x6360('0x81'),'Openchannel',_0x6360('0x82')];return db[_0x6360('0x6c')][_0x6360('0x6d')](function(_0x125be9){var _0x5b969e=_['map'](_0x20f05c,function(_0x78f490){var _0x4ecd39={'attributes':['id',_0x6360('0x2e')]};return _0x5449f8[_0x6360('0x51')+_0x78f490+'Queues'](_0x4ecd39)[_0x6360('0x29')](function(_0x1d19fd){var _0x50b2fa=_['map'](_0x1d19fd,function(_0x54e1ec){return _0x54e1ec[_0x6360('0x7f')](_0x4fbcc4[_0x6360('0x36')][_0x6360('0x67')],{'transaction':_0x125be9})['then'](function(){var _0x372296=JSON[_0x6360('0x7b')]('['+_0x4fbcc4['query']['ids']+']');var _0xb40e3b=_[_0x6360('0x30')](_0x372296,function(_0x5062d6){socket['emit']('user'+_0x78f490+_0x6360('0x83'),{'UserId':Number(_0x5062d6),[_0x78f490+_0x6360('0x84')]:_0x54e1ec['id']});if(_0x78f490!==_0x6360('0x69'))return;return db[_0x6360('0x75')]['destroy']({'where':{'VoiceQueueId':_0x54e1ec['id'],'UserId':_0x5062d6},'transaction':_0x125be9});});return Promise[_0x6360('0x7a')](_0xb40e3b);});});return Promise['all'](_0x50b2fa);});});return Promise[_0x6360('0x7a')](_0x5b969e)[_0x6360('0x29')](function(){return _0x5449f8[_0x6360('0x7f')](_0x4fbcc4[_0x6360('0x36')]['ids'],{'transaction':_0x125be9});})[_0x6360('0x29')](function(){var _0x1a82fb=JSON[_0x6360('0x7b')]('['+_0x4fbcc4[_0x6360('0x36')][_0x6360('0x67')]+']');db[_0x6360('0x7c')]['findOne']({'where':{'teamId':_0x4fbcc4[_0x6360('0x4a')]['id']}})[_0x6360('0x29')](function(_0x265857){if(_0x265857){for(var _0x1b022a=0x0;_0x1b022a<_0x1a82fb[_0x6360('0x4b')];_0x1b022a++){var _0x2c6570=_0x1a82fb[_0x1b022a];db[_0x6360('0x7d')][_0x6360('0x2a')]({'where':{'UserId':_0x2c6570,'VoicePrefixId':_0x265857[_0x6360('0x7e')]}});}}});});});}})[_0x6360('0x29')](respondWithStatusCode(_0x3f61f0,null))['catch'](handleError(_0x3f61f0,null));};exports[_0x6360('0x85')]=function(_0x211ed5,_0x251e5f,_0x5c856f){var _0x39e1ad={};var _0x1a4491={};var _0xdd3fad;var _0x888da1;return db[_0x6360('0x31')]['findOne']({'where':{'id':_0x211ed5[_0x6360('0x4a')]['id']}})['then'](handleEntityNotFound(_0x251e5f,null))[_0x6360('0x29')](function(_0x5e0f14){if(_0x5e0f14){_0xdd3fad=_0x5e0f14;_0x1a4491[_0x6360('0x35')]=_['keys'](db[_0x6360('0x70')]['rawAttributes']);_0x1a4491[_0x6360('0x36')]=_[_0x6360('0x37')](_0x211ed5[_0x6360('0x36')]);_0x1a4491['filters']=_[_0x6360('0x39')](_0x1a4491[_0x6360('0x35')],_0x1a4491[_0x6360('0x36')]);_0x39e1ad['attributes']=_[_0x6360('0x39')](_0x1a4491['model'],qs[_0x6360('0x3b')](_0x211ed5['query']['fields']));_0x39e1ad['attributes']=_0x39e1ad[_0x6360('0x3a')][_0x6360('0x4b')]?_0x39e1ad[_0x6360('0x3a')]:_0x1a4491[_0x6360('0x35')];_0x39e1ad[_0x6360('0x3e')]=qs[_0x6360('0x3f')](_0x211ed5['query'][_0x6360('0x3f')]);_0x39e1ad[_0x6360('0x40')]=qs[_0x6360('0x38')](_[_0x6360('0x41')](_0x211ed5[_0x6360('0x36')],_0x1a4491['filters']));if(_0x211ed5[_0x6360('0x36')]['filter']){_0x39e1ad[_0x6360('0x40')]=_[_0x6360('0x43')](_0x39e1ad[_0x6360('0x40')],{'$or':_[_0x6360('0x30')](_0x39e1ad[_0x6360('0x3a')],function(_0x3d2cef){var _0x245e54={};_0x245e54[_0x3d2cef]={'$like':'%'+_0x211ed5[_0x6360('0x36')][_0x6360('0x42')]+'%'};return _0x245e54;})});}_0x39e1ad=_[_0x6360('0x43')]({},_0x39e1ad,_0x211ed5[_0x6360('0x45')]);return _0xdd3fad[_0x6360('0x85')](_0x39e1ad);}})['then'](function(_0x44b069){if(_0x44b069){_0x888da1=_0x44b069[_0x6360('0x4b')];if(!_0x211ed5[_0x6360('0x36')][_0x6360('0x3c')](_0x6360('0x3d'))){_0x39e1ad[_0x6360('0x22')]=qs[_0x6360('0x22')](_0x211ed5[_0x6360('0x36')][_0x6360('0x22')]);_0x39e1ad['offset']=qs[_0x6360('0x20')](_0x211ed5['query']['offset']);}return _0xdd3fad[_0x6360('0x85')](_0x39e1ad);}})[_0x6360('0x29')](function(_0x4597ec){if(_0x4597ec){return _0x4597ec?{'count':_0x888da1,'rows':_0x4597ec}:null;}})[_0x6360('0x29')](respondWithResult(_0x251e5f,null))[_0x6360('0x48')](handleError(_0x251e5f,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index c79bb1f..489226e 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 _0x0de2=['hook','exports','events','Team','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0x0de2,0x13d));var _0x20de=function(_0x49e0e5,_0x1f1f6b){_0x49e0e5=_0x49e0e5-0x0;var _0x249c90=_0x0de2[_0x49e0e5];return _0x249c90;};'use strict';var EventEmitter=require(_0x20de('0x0'));var Team=require('../../mysqldb')['db'][_0x20de('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0x20de('0x2')](0x0);var events={'afterCreate':_0x20de('0x3'),'afterUpdate':'update','afterDestroy':_0x20de('0x4')};function emitEvent(_0x26f4e5){return function(_0x410d39,_0x40b658,_0x567602){TeamEvents[_0x20de('0x5')](_0x26f4e5+':'+_0x410d39['id'],_0x410d39);TeamEvents[_0x20de('0x5')](_0x26f4e5,_0x410d39);_0x567602(null);};}for(var e in events){if(events[_0x20de('0x6')](e)){var event=events[e];Team[_0x20de('0x7')](e,emitEvent(event));}}module[_0x20de('0x8')]=TeamEvents; \ No newline at end of file +var _0x2c63=['../../mysqldb','Team','setMaxListeners','update','remove','emit','hook','exports'];(function(_0x10027e,_0x3aa522){var _0x1a3f71=function(_0x49e84d){while(--_0x49e84d){_0x10027e['push'](_0x10027e['shift']());}};_0x1a3f71(++_0x3aa522);}(_0x2c63,0x1c8));var _0x32c6=function(_0x311909,_0x414bf7){_0x311909=_0x311909-0x0;var _0x8d3163=_0x2c63[_0x311909];return _0x8d3163;};'use strict';var EventEmitter=require('events');var Team=require(_0x32c6('0x0'))['db'][_0x32c6('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0x32c6('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x32c6('0x3'),'afterDestroy':_0x32c6('0x4')};function emitEvent(_0x4a278e){return function(_0x242209,_0x491832,_0x47fab8){TeamEvents['emit'](_0x4a278e+':'+_0x242209['id'],_0x242209);TeamEvents[_0x32c6('0x5')](_0x4a278e,_0x242209);_0x47fab8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0x32c6('0x6')](e,emitEvent(event));}}module[_0x32c6('0x7')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 39ddd05..a6228b3 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 _0x41f2=['lodash','api','moment','bluebird','request-promise','path','rimraf','./team.attributes','exports','Team'];(function(_0x4c3b11,_0x1c2581){var _0x17dbbd=function(_0x144f8b){while(--_0x144f8b){_0x4c3b11['push'](_0x4c3b11['shift']());}};_0x17dbbd(++_0x1c2581);}(_0x41f2,0x186));var _0x241f=function(_0x34335b,_0x4e0088){_0x34335b=_0x34335b-0x0;var _0x51c066=_0x41f2[_0x34335b];return _0x51c066;};'use strict';var _=require(_0x241f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x241f('0x1'));var moment=require(_0x241f('0x2'));var BPromise=require(_0x241f('0x3'));var rp=require(_0x241f('0x4'));var fs=require('fs');var path=require(_0x241f('0x5'));var rimraf=require(_0x241f('0x6'));var config=require('../../config/environment');var attributes=require(_0x241f('0x7'));module[_0x241f('0x8')]=function(_0x4547b9,_0x451516){return _0x4547b9['define'](_0x241f('0x9'),attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x50db=['exports','define','Team','teams','util','../../config/logger','api','bluebird','request-promise','../../config/environment','./team.attributes'];(function(_0x1af18b,_0x298a98){var _0x412c86=function(_0x5e4eca){while(--_0x5e4eca){_0x1af18b['push'](_0x1af18b['shift']());}};_0x412c86(++_0x298a98);}(_0x50db,0x67));var _0xb50d=function(_0x1ed1b4,_0x313805){_0x1ed1b4=_0x1ed1b4-0x0;var _0x23713a=_0x50db[_0x1ed1b4];return _0x23713a;};'use strict';var _=require('lodash');var util=require(_0xb50d('0x0'));var logger=require(_0xb50d('0x1'))(_0xb50d('0x2'));var moment=require('moment');var BPromise=require(_0xb50d('0x3'));var rp=require(_0xb50d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb50d('0x5'));var attributes=require(_0xb50d('0x6'));module[_0xb50d('0x7')]=function(_0x1ffedc,_0x4b80d8){return _0x1ffedc[_0xb50d('0x8')](_0xb50d('0x9'),attributes,{'tableName':_0xb50d('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 46693d9..3bd1867 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 _0x0682=['socket.io-emitter','./team.socket','register','then','info','request\x20sent','debug','error','code','Team,\x20%s,\x20%s','message','result','catch','lodash','randomstring','ioredis','../../config/environment','jayson/promise','client','http','defaults','redis','localhost'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0682,0x10a));var _0x2068=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0682[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2068('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2068('0x1'));var fs=require('fs');var Redis=require(_0x2068('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x2068('0x3'));var jayson=require(_0x2068('0x4'));var client=jayson[_0x2068('0x5')][_0x2068('0x6')]({'port':0x232a});config['redis']=_[_0x2068('0x7')](config[_0x2068('0x8')],{'host':_0x2068('0x9'),'port':0x18eb});var socket=require(_0x2068('0xa'))(new Redis(config['redis']));require(_0x2068('0xb'))[_0x2068('0xc')](socket);function respondWithRpcPromise(_0x35ec97,_0x2c64da,_0x70b4cb){return new BPromise(function(_0x1b3836,_0x420ff8){return client['request'](_0x35ec97,_0x70b4cb)[_0x2068('0xd')](function(_0xf28911){logger[_0x2068('0xe')]('Team,\x20%s,\x20%s',_0x2c64da,_0x2068('0xf'));logger[_0x2068('0x10')]('Team,\x20%s,\x20%s,\x20%s',_0x2c64da,'request\x20sent',JSON['stringify'](_0xf28911));if(_0xf28911[_0x2068('0x11')]){if(_0xf28911[_0x2068('0x11')][_0x2068('0x12')]===0x1f4){logger[_0x2068('0x11')](_0x2068('0x13'),_0x2c64da,_0xf28911[_0x2068('0x11')][_0x2068('0x14')]);return _0x420ff8(_0xf28911[_0x2068('0x11')][_0x2068('0x14')]);}logger[_0x2068('0x11')](_0x2068('0x13'),_0x2c64da,_0xf28911[_0x2068('0x11')][_0x2068('0x14')]);return _0x1b3836(_0xf28911[_0x2068('0x11')][_0x2068('0x14')]);}else{logger[_0x2068('0xe')](_0x2068('0x13'),_0x2c64da,_0x2068('0xf'));_0x1b3836(_0xf28911[_0x2068('0x15')][_0x2068('0x14')]);}})[_0x2068('0x16')](function(_0x25c7a4){logger['error'](_0x2068('0x13'),_0x2c64da,_0x25c7a4);_0x420ff8(_0x25c7a4);});});} \ No newline at end of file +var _0xfb26=['result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','./team.socket','request','info','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','Team,\x20%s,\x20%s','message'];(function(_0x3f8282,_0x11b607){var _0x50f918=function(_0x3a37de){while(--_0x3a37de){_0x3f8282['push'](_0x3f8282['shift']());}};_0x50f918(++_0x11b607);}(_0xfb26,0xda));var _0x6fb2=function(_0x206f02,_0x36f322){_0x206f02=_0x206f02-0x0;var _0x8a2663=_0xfb26[_0x206f02];return _0x8a2663;};'use strict';var _=require(_0x6fb2('0x0'));var util=require('util');var moment=require(_0x6fb2('0x1'));var BPromise=require(_0x6fb2('0x2'));var rs=require(_0x6fb2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6fb2('0x4'))['db'];var utils=require(_0x6fb2('0x5'));var logger=require(_0x6fb2('0x6'))(_0x6fb2('0x7'));var config=require('../../config/environment');var jayson=require(_0x6fb2('0x8'));var client=jayson[_0x6fb2('0x9')][_0x6fb2('0xa')]({'port':0x232a});config[_0x6fb2('0xb')]=_[_0x6fb2('0xc')](config[_0x6fb2('0xb')],{'host':_0x6fb2('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6fb2('0xb')]));require(_0x6fb2('0xe'))['register'](socket);function respondWithRpcPromise(_0x29be62,_0x55622d,_0x49fc79){return new BPromise(function(_0x4393bf,_0x29dd6b){return client[_0x6fb2('0xf')](_0x29be62,_0x49fc79)['then'](function(_0x3b5718){logger[_0x6fb2('0x10')]('Team,\x20%s,\x20%s',_0x55622d,_0x6fb2('0x11'));logger[_0x6fb2('0x12')](_0x6fb2('0x13'),_0x55622d,'request\x20sent',JSON[_0x6fb2('0x14')](_0x3b5718));if(_0x3b5718[_0x6fb2('0x15')]){if(_0x3b5718[_0x6fb2('0x15')][_0x6fb2('0x16')]===0x1f4){logger['error'](_0x6fb2('0x17'),_0x55622d,_0x3b5718[_0x6fb2('0x15')][_0x6fb2('0x18')]);return _0x29dd6b(_0x3b5718['error']['message']);}logger[_0x6fb2('0x15')]('Team,\x20%s,\x20%s',_0x55622d,_0x3b5718[_0x6fb2('0x15')][_0x6fb2('0x18')]);return _0x4393bf(_0x3b5718['error'][_0x6fb2('0x18')]);}else{logger[_0x6fb2('0x10')]('Team,\x20%s,\x20%s',_0x55622d,'request\x20sent');_0x4393bf(_0x3b5718[_0x6fb2('0x19')]['message']);}})[_0x6fb2('0x1a')](function(_0x17a3ae){logger['error']('Team,\x20%s,\x20%s',_0x55622d,_0x17a3ae);_0x29dd6b(_0x17a3ae);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 7bb9e18..d10ad9a 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 _0x1120=['./team.events','save','remove','emit','removeListener','register','length','team:'];(function(_0x324012,_0x23f45f){var _0x435cf2=function(_0x378a82){while(--_0x378a82){_0x324012['push'](_0x324012['shift']());}};_0x435cf2(++_0x23f45f);}(_0x1120,0x140));var _0x0112=function(_0x3e7e96,_0x5683ca){_0x3e7e96=_0x3e7e96-0x0;var _0x13f6f0=_0x1120[_0x3e7e96];return _0x13f6f0;};'use strict';var TeamEvents=require(_0x0112('0x0'));var events=[_0x0112('0x1'),_0x0112('0x2'),'update'];function createListener(_0x5dd0ed,_0x5190bd){return function(_0x54a1d2){_0x5190bd[_0x0112('0x3')](_0x5dd0ed,_0x54a1d2);};}function removeListener(_0x395145,_0x1d9e34){return function(){TeamEvents[_0x0112('0x4')](_0x395145,_0x1d9e34);};}exports[_0x0112('0x5')]=function(_0x10fdca){for(var _0x408230=0x0,_0x40ad0d=events[_0x0112('0x6')];_0x408230<_0x40ad0d;_0x408230++){var _0x444422=events[_0x408230];var _0x2fd18c=createListener(_0x0112('0x7')+_0x444422,_0x10fdca);TeamEvents['on'](_0x444422,_0x2fd18c);}}; \ No newline at end of file +var _0xfc81=['register','length','team:','save','remove','update','removeListener'];(function(_0x3daa8c,_0x388a87){var _0x2b1bd7=function(_0xdb2963){while(--_0xdb2963){_0x3daa8c['push'](_0x3daa8c['shift']());}};_0x2b1bd7(++_0x388a87);}(_0xfc81,0x88));var _0x1fc8=function(_0x2e0443,_0x7e5974){_0x2e0443=_0x2e0443-0x0;var _0x52d450=_0xfc81[_0x2e0443];return _0x52d450;};'use strict';var TeamEvents=require('./team.events');var events=[_0x1fc8('0x0'),_0x1fc8('0x1'),_0x1fc8('0x2')];function createListener(_0x3e3f5d,_0x1a43ea){return function(_0x393e67){_0x1a43ea['emit'](_0x3e3f5d,_0x393e67);};}function removeListener(_0xfa84e6,_0x52e561){return function(){TeamEvents[_0x1fc8('0x3')](_0xfa84e6,_0x52e561);};}exports[_0x1fc8('0x4')]=function(_0xf6e38a){for(var _0x392f22=0x0,_0x1aebc1=events[_0x1fc8('0x5')];_0x392f22<_0x1aebc1;_0x392f22++){var _0x2c5cdf=events[_0x392f22];var _0xfbbb27=createListener(_0x1fc8('0x6')+_0x2c5cdf,_0xf6e38a);TeamEvents['on'](_0x2c5cdf,_0xfbbb27);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/index.js b/server/api/teamVoicePrefix/index.js index 3b0d63a..3ba2de9 100644 --- a/server/api/teamVoicePrefix/index.js +++ b/server/api/teamVoicePrefix/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(_0x5dea52,_0x95e1b8){var _0x4e07ad=function(_0x50264b){while(--_0x50264b){_0x5dea52['push'](_0x5dea52['shift']());}};_0x4e07ad(++_0x95e1b8);}(_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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x1c34e7,_0x33f9a8){var _0x378cb1=function(_0x10b5e3){while(--_0x10b5e3){_0x1c34e7['push'](_0x1c34e7['shift']());}};_0x378cb1(++_0x33f9a8);}(_0x9c44,0x178));var _0x49c4=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x9c44[_0x1caf6a];return _0x1bf493;};'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/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 7174248..65900c8 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 _0xb701=['exports','INTEGER'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0xb701,0x144));var _0x1b70=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xb701[_0x46698a];return _0x356db0;};'use strict';var Sequelize=require('sequelize');module[_0x1b70('0x0')]={'TeamId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0x1b70('0x1')]}}; \ No newline at end of file +var _0xdadd=['sequelize','INTEGER'];(function(_0x10dc5d,_0x4b62cc){var _0x2c1e6f=function(_0x5f7307){while(--_0x5f7307){_0x10dc5d['push'](_0x10dc5d['shift']());}};_0x2c1e6f(++_0x4b62cc);}(_0xdadd,0x1c8));var _0xddad=function(_0x3e7bb8,_0x11f26c){_0x3e7bb8=_0x3e7bb8-0x0;var _0x160bf4=_0xdadd[_0x3e7bb8];return _0x160bf4;};'use strict';var Sequelize=require(_0xddad('0x0'));module['exports']={'TeamId':{'type':Sequelize[_0xddad('0x1')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index 2fea540..14e6343 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 _0x39aa=['moment','bluebird','request-promise','path','rimraf','define','TeamVoicePrefix','team_has_voice_prefixes','lodash','util','api'];(function(_0xef21fc,_0x5d7b70){var _0x56365b=function(_0x16af01){while(--_0x16af01){_0xef21fc['push'](_0xef21fc['shift']());}};_0x56365b(++_0x5d7b70);}(_0x39aa,0x11b));var _0xa39a=function(_0x13647c,_0x4822a7){_0x13647c=_0x13647c-0x0;var _0x341ecb=_0x39aa[_0x13647c];return _0x341ecb;};'use strict';var _=require(_0xa39a('0x0'));var util=require(_0xa39a('0x1'));var logger=require('../../config/logger')(_0xa39a('0x2'));var moment=require(_0xa39a('0x3'));var BPromise=require(_0xa39a('0x4'));var rp=require(_0xa39a('0x5'));var fs=require('fs');var path=require(_0xa39a('0x6'));var rimraf=require(_0xa39a('0x7'));var config=require('../../config/environment');var attributes=require('./teamVoicePrefix.attributes');module['exports']=function(_0x3dba2c,_0x911d67){return _0x3dba2c[_0xa39a('0x8')](_0xa39a('0x9'),attributes,{'tableName':_0xa39a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbaf0=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./teamVoicePrefix.attributes','exports','define','TeamVoicePrefix','team_has_voice_prefixes','util'];(function(_0x30987c,_0x5dd7ae){var _0x3acb1f=function(_0x1ed7b8){while(--_0x1ed7b8){_0x30987c['push'](_0x30987c['shift']());}};_0x3acb1f(++_0x5dd7ae);}(_0xbaf0,0x12a));var _0x0baf=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xbaf0[_0x3947c9];return _0x2e7871;};'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':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.rpc.js b/server/api/teamVoicePrefix/teamVoicePrefix.rpc.js index 06fa97e..cff09ab 100644 --- a/server/api/teamVoicePrefix/teamVoicePrefix.rpc.js +++ b/server/api/teamVoicePrefix/teamVoicePrefix.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x73df=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','request','then','TeamVoicePrefix,\x20%s,\x20%s','request\x20sent','debug','TeamVoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0x73df,0x154));var _0xf73d=function(_0x4cb6c9,_0x35808c){_0x4cb6c9=_0x4cb6c9-0x0;var _0x1fe48c=_0x73df[_0x4cb6c9];return _0x1fe48c;};'use strict';var _=require('lodash');var util=require(_0xf73d('0x0'));var moment=require('moment');var BPromise=require(_0xf73d('0x1'));var rs=require(_0xf73d('0x2'));var fs=require('fs');var Redis=require(_0xf73d('0x3'));var db=require(_0xf73d('0x4'))['db'];var utils=require(_0xf73d('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xf73d('0x6'));var jayson=require(_0xf73d('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2292e7,_0x3c5613,_0x498fab){return new BPromise(function(_0x3c8ddb,_0x1aba95){return client[_0xf73d('0x8')](_0x2292e7,_0x498fab)[_0xf73d('0x9')](function(_0x3fbd5e){logger['info'](_0xf73d('0xa'),_0x3c5613,_0xf73d('0xb'));logger[_0xf73d('0xc')](_0xf73d('0xd'),_0x3c5613,_0xf73d('0xb'),JSON[_0xf73d('0xe')](_0x3fbd5e));if(_0x3fbd5e[_0xf73d('0xf')]){if(_0x3fbd5e[_0xf73d('0xf')][_0xf73d('0x10')]===0x1f4){logger['error']('TeamVoicePrefix,\x20%s,\x20%s',_0x3c5613,_0x3fbd5e[_0xf73d('0xf')][_0xf73d('0x11')]);return _0x1aba95(_0x3fbd5e[_0xf73d('0xf')][_0xf73d('0x11')]);}logger[_0xf73d('0xf')]('TeamVoicePrefix,\x20%s,\x20%s',_0x3c5613,_0x3fbd5e[_0xf73d('0xf')][_0xf73d('0x11')]);return _0x3c8ddb(_0x3fbd5e['error']['message']);}else{logger[_0xf73d('0x12')](_0xf73d('0xa'),_0x3c5613,_0xf73d('0xb'));_0x3c8ddb(_0x3fbd5e[_0xf73d('0x13')][_0xf73d('0x11')]);}})['catch'](function(_0x6b0c17){logger['error']('TeamVoicePrefix,\x20%s,\x20%s',_0x3c5613,_0x6b0c17);_0x1aba95(_0x6b0c17);});});} \ No newline at end of file +var _0x5ca7=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','TeamVoicePrefix,\x20%s,\x20%s','debug','TeamVoicePrefix,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x5389f1,_0x1341f2){var _0x5b9f42=function(_0x4d072a){while(--_0x4d072a){_0x5389f1['push'](_0x5389f1['shift']());}};_0x5b9f42(++_0x1341f2);}(_0x5ca7,0x78));var _0x75ca=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x5ca7[_0xc6be3a];return _0x56a310;};'use strict';var _=require(_0x75ca('0x0'));var util=require(_0x75ca('0x1'));var moment=require(_0x75ca('0x2'));var BPromise=require('bluebird');var rs=require(_0x75ca('0x3'));var fs=require('fs');var Redis=require(_0x75ca('0x4'));var db=require(_0x75ca('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x75ca('0x6'))(_0x75ca('0x7'));var config=require(_0x75ca('0x8'));var jayson=require(_0x75ca('0x9'));var client=jayson['client'][_0x75ca('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5c9c72,_0x5f5c8f,_0x22dd55){return new BPromise(function(_0x310f70,_0x3399b9){return client[_0x75ca('0xb')](_0x5c9c72,_0x22dd55)[_0x75ca('0xc')](function(_0x2721e5){logger[_0x75ca('0xd')](_0x75ca('0xe'),_0x5f5c8f,'request\x20sent');logger[_0x75ca('0xf')](_0x75ca('0x10'),_0x5f5c8f,_0x75ca('0x11'),JSON[_0x75ca('0x12')](_0x2721e5));if(_0x2721e5[_0x75ca('0x13')]){if(_0x2721e5[_0x75ca('0x13')][_0x75ca('0x14')]===0x1f4){logger[_0x75ca('0x13')](_0x75ca('0xe'),_0x5f5c8f,_0x2721e5[_0x75ca('0x13')]['message']);return _0x3399b9(_0x2721e5[_0x75ca('0x13')][_0x75ca('0x15')]);}logger[_0x75ca('0x13')]('TeamVoicePrefix,\x20%s,\x20%s',_0x5f5c8f,_0x2721e5[_0x75ca('0x13')][_0x75ca('0x15')]);return _0x310f70(_0x2721e5[_0x75ca('0x13')][_0x75ca('0x15')]);}else{logger[_0x75ca('0xd')](_0x75ca('0xe'),_0x5f5c8f,_0x75ca('0x11'));_0x310f70(_0x2721e5[_0x75ca('0x16')][_0x75ca('0x15')]);}})[_0x75ca('0x17')](function(_0x4dccde){logger[_0x75ca('0x13')](_0x75ca('0xe'),_0x5f5c8f,_0x4dccde);_0x3399b9(_0x4dccde);});});} \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index be48d5f..7011974 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0xf1d26c,_0x1463d0){var _0x11c159=function(_0x3f71e8){while(--_0x3f71e8){_0xf1d26c['push'](_0xf1d26c['shift']());}};_0x11c159(++_0x1463d0);}(_0x9c44,0x178));var _0x49c4=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x9c44[_0xdea41a];return _0x15d0d8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x3baa35,_0x2dbcff){var _0x3f2572=function(_0x5d5013){while(--_0x5d5013){_0x3baa35['push'](_0x3baa35['shift']());}};_0x3f2572(++_0x2dbcff);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 4a99497..370f8c5 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 _0x2f45=['sequelize','exports','INTEGER'];(function(_0x4ea444,_0x56dde4){var _0x52b1e0=function(_0x53c37c){while(--_0x53c37c){_0x4ea444['push'](_0x4ea444['shift']());}};_0x52b1e0(++_0x56dde4);}(_0x2f45,0x189));var _0x52f4=function(_0x103e5a,_0x1ed691){_0x103e5a=_0x103e5a-0x0;var _0x3807b7=_0x2f45[_0x103e5a];return _0x3807b7;};'use strict';var Sequelize=require(_0x52f4('0x0'));module[_0x52f4('0x1')]={'penalty':{'type':Sequelize[_0x52f4('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xea1b=['sequelize','exports','INTEGER'];(function(_0x47b15f,_0x103e93){var _0x55bf25=function(_0x51fe7f){while(--_0x51fe7f){_0x47b15f['push'](_0x47b15f['shift']());}};_0x55bf25(++_0x103e93);}(_0xea1b,0xd8));var _0xbea1=function(_0x2281e0,_0x45320b){_0x2281e0=_0x2281e0-0x0;var _0x353c51=_0xea1b[_0x2281e0];return _0x353c51;};'use strict';var Sequelize=require(_0xbea1('0x0'));module[_0xbea1('0x1')]={'penalty':{'type':Sequelize[_0xbea1('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.model.js b/server/api/teamVoiceQueue/teamVoiceQueue.model.js index 20d29d0..e6ddc06 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 _0xa4de=['../../config/environment','./teamVoiceQueue.attributes','exports','define','team_has_voice_queues','lodash','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x302e21,_0xa5e9f1){var _0x4eda5e=function(_0x534473){while(--_0x534473){_0x302e21['push'](_0x302e21['shift']());}};_0x4eda5e(++_0xa5e9f1);}(_0xa4de,0x10d));var _0xea4d=function(_0x323fce,_0x5abf8b){_0x323fce=_0x323fce-0x0;var _0x3c5c40=_0xa4de[_0x323fce];return _0x3c5c40;};'use strict';var _=require(_0xea4d('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xea4d('0x1'));var moment=require(_0xea4d('0x2'));var BPromise=require(_0xea4d('0x3'));var rp=require(_0xea4d('0x4'));var fs=require('fs');var path=require(_0xea4d('0x5'));var rimraf=require(_0xea4d('0x6'));var config=require(_0xea4d('0x7'));var attributes=require(_0xea4d('0x8'));module[_0xea4d('0x9')]=function(_0x24d5fe,_0x604a6a){return _0x24d5fe[_0xea4d('0xa')]('TeamVoiceQueue',attributes,{'tableName':_0xea4d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3098=['./teamVoiceQueue.attributes','exports','define','team_has_voice_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2b8b01,_0x347164){var _0x32064a=function(_0x137c3e){while(--_0x137c3e){_0x2b8b01['push'](_0x2b8b01['shift']());}};_0x32064a(++_0x347164);}(_0x3098,0x86));var _0x8309=function(_0x96f74c,_0xfc30a4){_0x96f74c=_0x96f74c-0x0;var _0x379222=_0x3098[_0x96f74c];return _0x379222;};'use strict';var _=require(_0x8309('0x0'));var util=require(_0x8309('0x1'));var logger=require(_0x8309('0x2'))(_0x8309('0x3'));var moment=require('moment');var BPromise=require(_0x8309('0x4'));var rp=require(_0x8309('0x5'));var fs=require('fs');var path=require(_0x8309('0x6'));var rimraf=require(_0x8309('0x7'));var config=require(_0x8309('0x8'));var attributes=require(_0x8309('0x9'));module[_0x8309('0xa')]=function(_0x2ddf0b,_0x2aa50b){return _0x2ddf0b[_0x8309('0xb')]('TeamVoiceQueue',attributes,{'tableName':_0x8309('0xc'),'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 2c40cd8..756cd6c 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 _0x9b60=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','error'];(function(_0x39e283,_0x247e6b){var _0x7de89f=function(_0x2f8c50){while(--_0x2f8c50){_0x39e283['push'](_0x39e283['shift']());}};_0x7de89f(++_0x247e6b);}(_0x9b60,0x174));var _0x09b6=function(_0x11fb30,_0x58580a){_0x11fb30=_0x11fb30-0x0;var _0x554658=_0x9b60[_0x11fb30];return _0x554658;};'use strict';var _=require(_0x09b6('0x0'));var util=require(_0x09b6('0x1'));var moment=require(_0x09b6('0x2'));var BPromise=require(_0x09b6('0x3'));var rs=require(_0x09b6('0x4'));var fs=require('fs');var Redis=require(_0x09b6('0x5'));var db=require(_0x09b6('0x6'))['db'];var utils=require(_0x09b6('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x09b6('0x8'));var jayson=require(_0x09b6('0x9'));var client=jayson[_0x09b6('0xa')][_0x09b6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xaead4f,_0x2de4fb,_0x46e103){return new BPromise(function(_0x19f574,_0x3c9222){return client[_0x09b6('0xc')](_0xaead4f,_0x46e103)[_0x09b6('0xd')](function(_0x3df9d2){logger[_0x09b6('0xe')](_0x09b6('0xf'),_0x2de4fb,'request\x20sent');logger[_0x09b6('0x10')](_0x09b6('0x11'),_0x2de4fb,'request\x20sent',JSON['stringify'](_0x3df9d2));if(_0x3df9d2[_0x09b6('0x12')]){if(_0x3df9d2[_0x09b6('0x12')][_0x09b6('0x13')]===0x1f4){logger[_0x09b6('0x12')](_0x09b6('0xf'),_0x2de4fb,_0x3df9d2['error'][_0x09b6('0x14')]);return _0x3c9222(_0x3df9d2[_0x09b6('0x12')][_0x09b6('0x14')]);}logger['error']('TeamVoiceQueue,\x20%s,\x20%s',_0x2de4fb,_0x3df9d2['error'][_0x09b6('0x14')]);return _0x19f574(_0x3df9d2[_0x09b6('0x12')][_0x09b6('0x14')]);}else{logger[_0x09b6('0xe')](_0x09b6('0xf'),_0x2de4fb,'request\x20sent');_0x19f574(_0x3df9d2[_0x09b6('0x15')][_0x09b6('0x14')]);}})[_0x09b6('0x16')](function(_0x81d1ce){logger[_0x09b6('0x12')]('TeamVoiceQueue,\x20%s,\x20%s',_0x2de4fb,_0x81d1ce);_0x3c9222(_0x81d1ce);});});} \ No newline at end of file +var _0xa20e=['ioredis','../../config/utils','../../config/logger','client','request','then','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x24f161,_0x215df5){var _0x311704=function(_0x51c001){while(--_0x51c001){_0x24f161['push'](_0x24f161['shift']());}};_0x311704(++_0x215df5);}(_0xa20e,0x1ca));var _0xea20=function(_0x1b1f04,_0xc66e12){_0x1b1f04=_0x1b1f04-0x0;var _0x1c0109=_0xa20e[_0x1b1f04];return _0x1c0109;};'use strict';var _=require(_0xea20('0x0'));var util=require('util');var moment=require(_0xea20('0x1'));var BPromise=require(_0xea20('0x2'));var rs=require(_0xea20('0x3'));var fs=require('fs');var Redis=require(_0xea20('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xea20('0x5'));var logger=require(_0xea20('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xea20('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cd3dc,_0x32d1b0,_0x5d8942){return new BPromise(function(_0x450bd9,_0x2965a6){return client[_0xea20('0x8')](_0x1cd3dc,_0x5d8942)[_0xea20('0x9')](function(_0x4806d1){logger['info'](_0xea20('0xa'),_0x32d1b0,_0xea20('0xb'));logger[_0xea20('0xc')](_0xea20('0xd'),_0x32d1b0,'request\x20sent',JSON[_0xea20('0xe')](_0x4806d1));if(_0x4806d1[_0xea20('0xf')]){if(_0x4806d1['error'][_0xea20('0x10')]===0x1f4){logger['error'](_0xea20('0xa'),_0x32d1b0,_0x4806d1['error'][_0xea20('0x11')]);return _0x2965a6(_0x4806d1[_0xea20('0xf')][_0xea20('0x11')]);}logger[_0xea20('0xf')](_0xea20('0xa'),_0x32d1b0,_0x4806d1[_0xea20('0xf')]['message']);return _0x450bd9(_0x4806d1['error'][_0xea20('0x11')]);}else{logger[_0xea20('0x12')](_0xea20('0xa'),_0x32d1b0,_0xea20('0xb'));_0x450bd9(_0x4806d1[_0xea20('0x13')][_0xea20('0x11')]);}})[_0xea20('0x14')](function(_0x15c21f){logger[_0xea20('0xf')]('TeamVoiceQueue,\x20%s,\x20%s',_0x32d1b0,_0x15c21f);_0x2965a6(_0x15c21f);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 375d6d5..c696d5d 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 _0xe3b3=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe3b3,0x1b3));var _0x3e3b=function(_0x2dd0d3,_0x5a99fb){_0x2dd0d3=_0x2dd0d3-0x0;var _0x440d6f=_0xe3b3[_0x2dd0d3];return _0x440d6f;};'use strict';var multer=require(_0x3e3b('0x0'));var util=require(_0x3e3b('0x1'));var path=require(_0x3e3b('0x2'));var timeout=require(_0x3e3b('0x3'));var express=require(_0x3e3b('0x4'));var router=express[_0x3e3b('0x5')]();var fs_extra=require(_0x3e3b('0x6'));var auth=require(_0x3e3b('0x7'));var interaction=require(_0x3e3b('0x8'));var config=require(_0x3e3b('0x9'));var controller=require('./template.controller');router[_0x3e3b('0xa')]('/',auth[_0x3e3b('0xb')](),controller[_0x3e3b('0xc')]);router['get'](_0x3e3b('0xd'),auth[_0x3e3b('0xb')](),controller[_0x3e3b('0xe')]);router[_0x3e3b('0xf')]('/',auth[_0x3e3b('0xb')](),controller[_0x3e3b('0x10')]);router[_0x3e3b('0x11')](_0x3e3b('0xd'),auth[_0x3e3b('0xb')](),controller['update']);router[_0x3e3b('0x12')]('/:id',auth[_0x3e3b('0xb')](),controller[_0x3e3b('0x13')]);module[_0x3e3b('0x14')]=router; \ No newline at end of file +var _0xab00=['./template.controller','get','isAuthenticated','index','/:id','show','post','create','destroy','multer','util','path','express','Router','fs-extra','../../components/interaction/service'];(function(_0x18b485,_0xf838c0){var _0x580f6d=function(_0x17317e){while(--_0x17317e){_0x18b485['push'](_0x18b485['shift']());}};_0x580f6d(++_0xf838c0);}(_0xab00,0x1b9));var _0x0ab0=function(_0x4aa3f5,_0x4f515a){_0x4aa3f5=_0x4aa3f5-0x0;var _0x1bdc82=_0xab00[_0x4aa3f5];return _0x1bdc82;};'use strict';var multer=require(_0x0ab0('0x0'));var util=require(_0x0ab0('0x1'));var path=require(_0x0ab0('0x2'));var timeout=require('connect-timeout');var express=require(_0x0ab0('0x3'));var router=express[_0x0ab0('0x4')]();var fs_extra=require(_0x0ab0('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0ab0('0x6'));var config=require('../../config/environment');var controller=require(_0x0ab0('0x7'));router[_0x0ab0('0x8')]('/',auth[_0x0ab0('0x9')](),controller[_0x0ab0('0xa')]);router[_0x0ab0('0x8')](_0x0ab0('0xb'),auth['isAuthenticated'](),controller[_0x0ab0('0xc')]);router[_0x0ab0('0xd')]('/',auth['isAuthenticated'](),controller[_0x0ab0('0xe')]);router['put'](_0x0ab0('0xb'),auth[_0x0ab0('0x9')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x0ab0('0xf')]);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 b46b54d..fbd3984 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 _0x0d7e=['STRING','TEXT'];(function(_0x5f06e1,_0x3c5950){var _0x40156c=function(_0x67201d){while(--_0x67201d){_0x5f06e1['push'](_0x5f06e1['shift']());}};_0x40156c(++_0x3c5950);}(_0x0d7e,0x192));var _0xe0d7=function(_0x242df9,_0x3b0ecf){_0x242df9=_0x242df9-0x0;var _0x4d3d02=_0x0d7e[_0x242df9];return _0x4d3d02;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe0d7('0x0')]},'description':{'type':Sequelize[_0xe0d7('0x0')]},'html':{'type':Sequelize[_0xe0d7('0x1')]}}; \ No newline at end of file +var _0x02a2=['TEXT','sequelize','exports','STRING'];(function(_0x1f0213,_0x3c3c9e){var _0x2048c4=function(_0x26d0c6){while(--_0x26d0c6){_0x1f0213['push'](_0x1f0213['shift']());}};_0x2048c4(++_0x3c3c9e);}(_0x02a2,0xc1));var _0x202a=function(_0x2abde0,_0x34c56e){_0x2abde0=_0x2abde0-0x0;var _0x33d1e6=_0x02a2[_0x2abde0];return _0x33d1e6;};'use strict';var Sequelize=require(_0x202a('0x0'));module[_0x202a('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x202a('0x2')]},'html':{'type':Sequelize[_0x202a('0x3')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index fdbfc6f..92a0647 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 _0xa2c0=['catch','error','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','apply','reject','save','update','destroy','get','Templates','UserProfileResource','then','sendStatus','stack','name','index','map','Template','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','VIRTUAL','length','includeAll','include','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation'];(function(_0x32d181,_0x2fa52b){var _0x5e1f1d=function(_0x24225f){while(--_0x24225f){_0x32d181['push'](_0x32d181['shift']());}};_0x5e1f1d(++_0x2fa52b);}(_0xa2c0,0x193));var _0x0a2c=function(_0x266daf,_0x3fc687){_0x266daf=_0x266daf-0x0;var _0x2f4b44=_0xa2c0[_0x266daf];return _0x2f4b44;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0a2c('0x0'));var zipdir=require(_0x0a2c('0x1'));var jsonpatch=require(_0x0a2c('0x2'));var rp=require(_0x0a2c('0x3'));var moment=require(_0x0a2c('0x4'));var BPromise=require(_0x0a2c('0x5'));var Mustache=require(_0x0a2c('0x6'));var util=require(_0x0a2c('0x7'));var path=require(_0x0a2c('0x8'));var sox=require('sox');var csv=require(_0x0a2c('0x9'));var ejs=require(_0x0a2c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0a2c('0xb'));var squel=require(_0x0a2c('0xc'));var crypto=require('crypto');var jsforce=require(_0x0a2c('0xd'));var deskjs=require(_0x0a2c('0xe'));var toCsv=require(_0x0a2c('0x9'));var querystring=require(_0x0a2c('0xf'));var Papa=require(_0x0a2c('0x10'));var Redis=require(_0x0a2c('0x11'));var authService=require(_0x0a2c('0x12'));var qs=require(_0x0a2c('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0a2c('0x14'));var logger=require('../../config/logger')(_0x0a2c('0x15'));var utils=require(_0x0a2c('0x16'));var config=require(_0x0a2c('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x0a2c('0x18'))['db'];function respondWithStatusCode(_0x21a2ec,_0x3bc995){_0x3bc995=_0x3bc995||0xcc;return function(_0x32a42c){if(_0x32a42c){return _0x21a2ec['sendStatus'](_0x3bc995);}return _0x21a2ec[_0x0a2c('0x19')](_0x3bc995)[_0x0a2c('0x1a')]();};}function respondWithResult(_0x33e388,_0x530c0e){_0x530c0e=_0x530c0e||0xc8;return function(_0x973e5a){if(_0x973e5a){return _0x33e388['status'](_0x530c0e)[_0x0a2c('0x1b')](_0x973e5a);}};}function respondWithFilteredResult(_0x3c67f9,_0x454c82){return function(_0x48c0ae){if(_0x48c0ae){var _0x4574a5=typeof _0x454c82[_0x0a2c('0x1c')]===_0x0a2c('0x1d')&&typeof _0x454c82[_0x0a2c('0x1e')]==='undefined';var _0x1bf5da=_0x48c0ae[_0x0a2c('0x1f')];var _0x3fe844=_0x4574a5?0x0:_0x454c82[_0x0a2c('0x1c')];var _0x2274e1=_0x4574a5?_0x48c0ae[_0x0a2c('0x1f')]:_0x454c82['offset']+_0x454c82[_0x0a2c('0x1e')];var _0x5cd111;if(_0x2274e1>=_0x1bf5da){_0x2274e1=_0x1bf5da;_0x5cd111=0xc8;}else{_0x5cd111=0xce;}_0x3c67f9['status'](_0x5cd111);return _0x3c67f9['set']('Content-Range',_0x3fe844+'-'+_0x2274e1+'/'+_0x1bf5da)[_0x0a2c('0x1b')](_0x48c0ae);}return null;};}function patchUpdates(_0x41f713){return function(_0xb81edb){try{jsonpatch[_0x0a2c('0x20')](_0xb81edb,_0x41f713,!![]);}catch(_0x5b29ec){return BPromise[_0x0a2c('0x21')](_0x5b29ec);}return _0xb81edb[_0x0a2c('0x22')]();};}function saveUpdates(_0x3ee20f,_0xec5011){return function(_0x423e14){if(_0x423e14){return _0x423e14[_0x0a2c('0x23')](_0x3ee20f)['then'](function(_0x3b2691){return _0x3b2691;});}return null;};}function removeEntity(_0x221966,_0x221eeb){return function(_0x20014b){if(_0x20014b){return _0x20014b[_0x0a2c('0x24')]()['then'](function(){var _0x3a89a3=_0x20014b[_0x0a2c('0x25')]({'plain':!![]});var _0x51df64=_0x0a2c('0x26');return db[_0x0a2c('0x27')]['destroy']({'where':{'type':_0x51df64,'resourceId':_0x3a89a3['id']}})[_0x0a2c('0x28')](function(){return _0x20014b;});})['then'](function(){_0x221966[_0x0a2c('0x19')](0xcc)[_0x0a2c('0x1a')]();});}};}function handleEntityNotFound(_0x2fb612,_0x427cdb){return function(_0x40638f){if(!_0x40638f){_0x2fb612[_0x0a2c('0x29')](0x194);}return _0x40638f;};}function handleError(_0x1d6260,_0x3db5f6){_0x3db5f6=_0x3db5f6||0x1f4;return function(_0x1846e4){logger['error'](_0x1846e4[_0x0a2c('0x2a')]);if(_0x1846e4[_0x0a2c('0x2b')]){delete _0x1846e4[_0x0a2c('0x2b')];}_0x1d6260[_0x0a2c('0x19')](_0x3db5f6)['send'](_0x1846e4);};}exports[_0x0a2c('0x2c')]=function(_0x37417f,_0x12958f){var _0x339085={},_0x2e2000={},_0x29b5a8={'count':0x0,'rows':[]};var _0x2d67e8=_[_0x0a2c('0x2d')](db[_0x0a2c('0x2e')][_0x0a2c('0x2f')],function(_0x3a86e1){return{'name':_0x3a86e1[_0x0a2c('0x30')],'type':_0x3a86e1[_0x0a2c('0x31')][_0x0a2c('0x32')]};});_0x2e2000[_0x0a2c('0x33')]=_[_0x0a2c('0x2d')](_0x2d67e8,_0x0a2c('0x2b'));_0x2e2000[_0x0a2c('0x34')]=_[_0x0a2c('0x35')](_0x37417f[_0x0a2c('0x34')]);_0x2e2000['filters']=_[_0x0a2c('0x36')](_0x2e2000[_0x0a2c('0x33')],_0x2e2000['query']);_0x339085[_0x0a2c('0x37')]=_[_0x0a2c('0x36')](_0x2e2000[_0x0a2c('0x33')],qs[_0x0a2c('0x38')](_0x37417f[_0x0a2c('0x34')]['fields']));_0x339085[_0x0a2c('0x37')]=_0x339085[_0x0a2c('0x37')]['length']?_0x339085['attributes']:_0x2e2000[_0x0a2c('0x33')];if(!_0x37417f[_0x0a2c('0x34')][_0x0a2c('0x39')](_0x0a2c('0x3a'))){_0x339085['limit']=qs['limit'](_0x37417f[_0x0a2c('0x34')][_0x0a2c('0x1e')]);_0x339085['offset']=qs[_0x0a2c('0x1c')](_0x37417f[_0x0a2c('0x34')][_0x0a2c('0x1c')]);}_0x339085['order']=qs[_0x0a2c('0x3b')](_0x37417f[_0x0a2c('0x34')][_0x0a2c('0x3b')]);_0x339085[_0x0a2c('0x3c')]=qs[_0x0a2c('0x3d')](_[_0x0a2c('0x3e')](_0x37417f[_0x0a2c('0x34')],_0x2e2000[_0x0a2c('0x3d')]),_0x2d67e8);if(_0x37417f[_0x0a2c('0x34')][_0x0a2c('0x3f')]){_0x339085[_0x0a2c('0x3c')]=_['merge'](_0x339085[_0x0a2c('0x3c')],{'$or':_[_0x0a2c('0x2d')](_0x2d67e8,function(_0x3af6c7){if(_0x3af6c7[_0x0a2c('0x31')]!==_0x0a2c('0x40')){var _0x1be5de={};_0x1be5de[_0x3af6c7[_0x0a2c('0x2b')]]={'$like':'%'+_0x37417f['query'][_0x0a2c('0x3f')]+'%'};return _0x1be5de;}})});}_0x339085=_['merge']({},_0x339085,_0x37417f['options']);var _0x170867={'where':_0x339085['where']};return db['Template']['count'](_0x170867)[_0x0a2c('0x28')](function(_0x1a2472){_0x29b5a8[_0x0a2c('0x1f')]=_0x1a2472;if(_0x37417f['query']['includeAll']){_0x339085['include']=[{'all':!![]}];}return db[_0x0a2c('0x2e')]['findAll'](_0x339085);})[_0x0a2c('0x28')](function(_0x277c83){_0x29b5a8['rows']=_0x277c83;return _0x29b5a8;})['then'](respondWithFilteredResult(_0x12958f,_0x339085))['catch'](handleError(_0x12958f,null));};exports['show']=function(_0x2c923e,_0x5f0c02){var _0x1482e2={'raw':!![],'where':{'id':_0x2c923e['params']['id']}},_0x4944b6={};_0x4944b6[_0x0a2c('0x33')]=_[_0x0a2c('0x35')](db[_0x0a2c('0x2e')][_0x0a2c('0x2f')]);_0x4944b6['query']=_['keys'](_0x2c923e[_0x0a2c('0x34')]);_0x4944b6['filters']=_[_0x0a2c('0x36')](_0x4944b6['model'],_0x4944b6[_0x0a2c('0x34')]);_0x1482e2['attributes']=_['intersection'](_0x4944b6[_0x0a2c('0x33')],qs[_0x0a2c('0x38')](_0x2c923e['query'][_0x0a2c('0x38')]));_0x1482e2[_0x0a2c('0x37')]=_0x1482e2[_0x0a2c('0x37')][_0x0a2c('0x41')]?_0x1482e2[_0x0a2c('0x37')]:_0x4944b6['model'];if(_0x2c923e[_0x0a2c('0x34')][_0x0a2c('0x42')]){_0x1482e2[_0x0a2c('0x43')]=[{'all':!![]}];}_0x1482e2=_[_0x0a2c('0x44')]({},_0x1482e2,_0x2c923e[_0x0a2c('0x45')]);return db[_0x0a2c('0x2e')][_0x0a2c('0x46')](_0x1482e2)[_0x0a2c('0x28')](handleEntityNotFound(_0x5f0c02,null))[_0x0a2c('0x28')](respondWithResult(_0x5f0c02,null))['catch'](handleError(_0x5f0c02,null));};exports[_0x0a2c('0x47')]=function(_0x12f95c,_0x8ab60e){return db[_0x0a2c('0x2e')]['create'](_0x12f95c[_0x0a2c('0x48')],{})['then'](function(_0x4a459b){var _0x367343=_0x12f95c[_0x0a2c('0x49')][_0x0a2c('0x25')]({'plain':!![]});if(!_0x367343)throw new Error(_0x0a2c('0x4a'));if(_0x367343['role']===_0x0a2c('0x49')){var _0x16d4af=_0x4a459b[_0x0a2c('0x25')]({'plain':!![]});var _0x31d9d5=_0x0a2c('0x26');return db['UserProfileSection'][_0x0a2c('0x46')]({'where':{'name':_0x31d9d5,'userProfileId':_0x367343[_0x0a2c('0x4b')]},'raw':!![]})[_0x0a2c('0x28')](function(_0x1c6ebd){if(_0x1c6ebd&&_0x1c6ebd[_0x0a2c('0x4c')]===0x0){return db[_0x0a2c('0x27')][_0x0a2c('0x47')]({'name':_0x16d4af[_0x0a2c('0x2b')],'resourceId':_0x16d4af['id'],'type':_0x1c6ebd[_0x0a2c('0x2b')],'sectionId':_0x1c6ebd['id']},{})[_0x0a2c('0x28')](function(){return _0x4a459b;});}else{return _0x4a459b;}})[_0x0a2c('0x4d')](function(_0x580620){logger[_0x0a2c('0x4e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x580620);throw _0x580620;});}return _0x4a459b;})['then'](respondWithResult(_0x8ab60e,0xc9))[_0x0a2c('0x4d')](handleError(_0x8ab60e,null));};exports['update']=function(_0x331358,_0x159c51){if(_0x331358[_0x0a2c('0x48')]['id']){delete _0x331358[_0x0a2c('0x48')]['id'];}return db['Template'][_0x0a2c('0x46')]({'where':{'id':_0x331358['params']['id']}})[_0x0a2c('0x28')](handleEntityNotFound(_0x159c51,null))[_0x0a2c('0x28')](saveUpdates(_0x331358[_0x0a2c('0x48')],null))[_0x0a2c('0x28')](respondWithResult(_0x159c51,null))['catch'](handleError(_0x159c51,null));};exports[_0x0a2c('0x24')]=function(_0x1af163,_0x541cbf){return db[_0x0a2c('0x2e')]['find']({'where':{'id':_0x1af163[_0x0a2c('0x4f')]['id']}})[_0x0a2c('0x28')](handleEntityNotFound(_0x541cbf,null))[_0x0a2c('0x28')](removeEntity(_0x541cbf,null))[_0x0a2c('0x4d')](handleError(_0x541cbf,null));}; \ No newline at end of file +var _0x27ed=['body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','get','Templates','end','stack','name','send','index','map','Template','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','rows','show','params','find','catch','create'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0x27ed,0xae));var _0xd27e=function(_0x388edf,_0x12d6d2){_0x388edf=_0x388edf-0x0;var _0xffe643=_0x27ed[_0x388edf];return _0xffe643;};'use strict';var emlformat=require(_0xd27e('0x0'));var rimraf=require(_0xd27e('0x1'));var zipdir=require(_0xd27e('0x2'));var jsonpatch=require(_0xd27e('0x3'));var rp=require(_0xd27e('0x4'));var moment=require('moment');var BPromise=require(_0xd27e('0x5'));var Mustache=require(_0xd27e('0x6'));var util=require(_0xd27e('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xd27e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd27e('0x9'));var squel=require(_0xd27e('0xa'));var crypto=require(_0xd27e('0xb'));var jsforce=require(_0xd27e('0xc'));var deskjs=require(_0xd27e('0xd'));var toCsv=require(_0xd27e('0x8'));var querystring=require(_0xd27e('0xe'));var Papa=require(_0xd27e('0xf'));var Redis=require(_0xd27e('0x10'));var authService=require(_0xd27e('0x11'));var qs=require(_0xd27e('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd27e('0x13'));var utils=require('../../config/utils');var config=require(_0xd27e('0x14'));var licenseUtil=require(_0xd27e('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a02cc,_0x25493c){_0x25493c=_0x25493c||0xcc;return function(_0x5ea393){if(_0x5ea393){return _0x1a02cc[_0xd27e('0x16')](_0x25493c);}return _0x1a02cc[_0xd27e('0x17')](_0x25493c)['end']();};}function respondWithResult(_0x14d855,_0x2c589c){_0x2c589c=_0x2c589c||0xc8;return function(_0x53d6d9){if(_0x53d6d9){return _0x14d855[_0xd27e('0x17')](_0x2c589c)[_0xd27e('0x18')](_0x53d6d9);}};}function respondWithFilteredResult(_0x3c2cdd,_0x36c099){return function(_0x53f123){if(_0x53f123){var _0x39f4ba=typeof _0x36c099[_0xd27e('0x19')]===_0xd27e('0x1a')&&typeof _0x36c099[_0xd27e('0x1b')]===_0xd27e('0x1a');var _0x1205f8=_0x53f123['count'];var _0x5b62b7=_0x39f4ba?0x0:_0x36c099['offset'];var _0x433117=_0x39f4ba?_0x53f123[_0xd27e('0x1c')]:_0x36c099[_0xd27e('0x19')]+_0x36c099['limit'];var _0x311b96;if(_0x433117>=_0x1205f8){_0x433117=_0x1205f8;_0x311b96=0xc8;}else{_0x311b96=0xce;}_0x3c2cdd[_0xd27e('0x17')](_0x311b96);return _0x3c2cdd[_0xd27e('0x1d')](_0xd27e('0x1e'),_0x5b62b7+'-'+_0x433117+'/'+_0x1205f8)['json'](_0x53f123);}return null;};}function patchUpdates(_0x21cdef){return function(_0x21dd09){try{jsonpatch[_0xd27e('0x1f')](_0x21dd09,_0x21cdef,!![]);}catch(_0x421cd5){return BPromise[_0xd27e('0x20')](_0x421cd5);}return _0x21dd09[_0xd27e('0x21')]();};}function saveUpdates(_0x44a157,_0x69ada6){return function(_0x3ce496){if(_0x3ce496){return _0x3ce496['update'](_0x44a157)[_0xd27e('0x22')](function(_0x1f9c6f){return _0x1f9c6f;});}return null;};}function removeEntity(_0x355089,_0x2e159d){return function(_0x40db2e){if(_0x40db2e){return _0x40db2e[_0xd27e('0x23')]()[_0xd27e('0x22')](function(){var _0x9f290e=_0x40db2e[_0xd27e('0x24')]({'plain':!![]});var _0x22149c=_0xd27e('0x25');return db['UserProfileResource'][_0xd27e('0x23')]({'where':{'type':_0x22149c,'resourceId':_0x9f290e['id']}})[_0xd27e('0x22')](function(){return _0x40db2e;});})[_0xd27e('0x22')](function(){_0x355089[_0xd27e('0x17')](0xcc)[_0xd27e('0x26')]();});}};}function handleEntityNotFound(_0x4b9abe,_0x2828da){return function(_0x104801){if(!_0x104801){_0x4b9abe[_0xd27e('0x16')](0x194);}return _0x104801;};}function handleError(_0x2237f9,_0x10a305){_0x10a305=_0x10a305||0x1f4;return function(_0x4e7707){logger['error'](_0x4e7707[_0xd27e('0x27')]);if(_0x4e7707[_0xd27e('0x28')]){delete _0x4e7707['name'];}_0x2237f9[_0xd27e('0x17')](_0x10a305)[_0xd27e('0x29')](_0x4e7707);};}exports[_0xd27e('0x2a')]=function(_0x356e3b,_0x2db35e){var _0x288c4c={},_0x5ba130={},_0x33589f={'count':0x0,'rows':[]};var _0xca9ca1=_[_0xd27e('0x2b')](db[_0xd27e('0x2c')]['rawAttributes'],function(_0x73b99b){return{'name':_0x73b99b[_0xd27e('0x2d')],'type':_0x73b99b[_0xd27e('0x2e')][_0xd27e('0x2f')]};});_0x5ba130[_0xd27e('0x30')]=_[_0xd27e('0x2b')](_0xca9ca1,_0xd27e('0x28'));_0x5ba130[_0xd27e('0x31')]=_[_0xd27e('0x32')](_0x356e3b[_0xd27e('0x31')]);_0x5ba130[_0xd27e('0x33')]=_['intersection'](_0x5ba130['model'],_0x5ba130[_0xd27e('0x31')]);_0x288c4c[_0xd27e('0x34')]=_[_0xd27e('0x35')](_0x5ba130['model'],qs[_0xd27e('0x36')](_0x356e3b[_0xd27e('0x31')][_0xd27e('0x36')]));_0x288c4c[_0xd27e('0x34')]=_0x288c4c[_0xd27e('0x34')][_0xd27e('0x37')]?_0x288c4c[_0xd27e('0x34')]:_0x5ba130[_0xd27e('0x30')];if(!_0x356e3b[_0xd27e('0x31')][_0xd27e('0x38')](_0xd27e('0x39'))){_0x288c4c[_0xd27e('0x1b')]=qs[_0xd27e('0x1b')](_0x356e3b[_0xd27e('0x31')][_0xd27e('0x1b')]);_0x288c4c[_0xd27e('0x19')]=qs['offset'](_0x356e3b[_0xd27e('0x31')][_0xd27e('0x19')]);}_0x288c4c['order']=qs['sort'](_0x356e3b['query'][_0xd27e('0x3a')]);_0x288c4c[_0xd27e('0x3b')]=qs[_0xd27e('0x33')](_[_0xd27e('0x3c')](_0x356e3b[_0xd27e('0x31')],_0x5ba130[_0xd27e('0x33')]),_0xca9ca1);if(_0x356e3b['query'][_0xd27e('0x3d')]){_0x288c4c[_0xd27e('0x3b')]=_[_0xd27e('0x3e')](_0x288c4c['where'],{'$or':_['map'](_0xca9ca1,function(_0x4b1604){if(_0x4b1604['type']!=='VIRTUAL'){var _0xd9e530={};_0xd9e530[_0x4b1604[_0xd27e('0x28')]]={'$like':'%'+_0x356e3b['query'][_0xd27e('0x3d')]+'%'};return _0xd9e530;}})});}_0x288c4c=_[_0xd27e('0x3e')]({},_0x288c4c,_0x356e3b[_0xd27e('0x3f')]);var _0x3fc2e7={'where':_0x288c4c[_0xd27e('0x3b')]};return db[_0xd27e('0x2c')]['count'](_0x3fc2e7)[_0xd27e('0x22')](function(_0x52eadb){_0x33589f['count']=_0x52eadb;if(_0x356e3b['query'][_0xd27e('0x40')]){_0x288c4c[_0xd27e('0x41')]=[{'all':!![]}];}return db[_0xd27e('0x2c')]['findAll'](_0x288c4c);})['then'](function(_0xd9d0c3){_0x33589f[_0xd27e('0x42')]=_0xd9d0c3;return _0x33589f;})[_0xd27e('0x22')](respondWithFilteredResult(_0x2db35e,_0x288c4c))['catch'](handleError(_0x2db35e,null));};exports[_0xd27e('0x43')]=function(_0x494fab,_0x5ad1d9){var _0x516797={'raw':!![],'where':{'id':_0x494fab[_0xd27e('0x44')]['id']}},_0x12640f={};_0x12640f['model']=_[_0xd27e('0x32')](db[_0xd27e('0x2c')]['rawAttributes']);_0x12640f[_0xd27e('0x31')]=_[_0xd27e('0x32')](_0x494fab[_0xd27e('0x31')]);_0x12640f['filters']=_[_0xd27e('0x35')](_0x12640f[_0xd27e('0x30')],_0x12640f['query']);_0x516797[_0xd27e('0x34')]=_[_0xd27e('0x35')](_0x12640f[_0xd27e('0x30')],qs['fields'](_0x494fab['query']['fields']));_0x516797[_0xd27e('0x34')]=_0x516797[_0xd27e('0x34')][_0xd27e('0x37')]?_0x516797[_0xd27e('0x34')]:_0x12640f[_0xd27e('0x30')];if(_0x494fab['query']['includeAll']){_0x516797[_0xd27e('0x41')]=[{'all':!![]}];}_0x516797=_[_0xd27e('0x3e')]({},_0x516797,_0x494fab[_0xd27e('0x3f')]);return db[_0xd27e('0x2c')][_0xd27e('0x45')](_0x516797)['then'](handleEntityNotFound(_0x5ad1d9,null))['then'](respondWithResult(_0x5ad1d9,null))[_0xd27e('0x46')](handleError(_0x5ad1d9,null));};exports[_0xd27e('0x47')]=function(_0x203f19,_0xe0545e){return db[_0xd27e('0x2c')][_0xd27e('0x47')](_0x203f19[_0xd27e('0x48')],{})[_0xd27e('0x22')](function(_0x145de0){var _0x34bd02=_0x203f19[_0xd27e('0x49')][_0xd27e('0x24')]({'plain':!![]});if(!_0x34bd02)throw new Error(_0xd27e('0x4a'));if(_0x34bd02[_0xd27e('0x4b')]===_0xd27e('0x49')){var _0x15f318=_0x145de0[_0xd27e('0x24')]({'plain':!![]});var _0x22e888='Templates';return db[_0xd27e('0x4c')]['find']({'where':{'name':_0x22e888,'userProfileId':_0x34bd02['userProfileId']},'raw':!![]})[_0xd27e('0x22')](function(_0x327b09){if(_0x327b09&&_0x327b09[_0xd27e('0x4d')]===0x0){return db[_0xd27e('0x4e')][_0xd27e('0x47')]({'name':_0x15f318[_0xd27e('0x28')],'resourceId':_0x15f318['id'],'type':_0x327b09[_0xd27e('0x28')],'sectionId':_0x327b09['id']},{})[_0xd27e('0x22')](function(){return _0x145de0;});}else{return _0x145de0;}})[_0xd27e('0x46')](function(_0x592d86){logger[_0xd27e('0x4f')](_0xd27e('0x50'),_0x592d86);throw _0x592d86;});}return _0x145de0;})[_0xd27e('0x22')](respondWithResult(_0xe0545e,0xc9))[_0xd27e('0x46')](handleError(_0xe0545e,null));};exports[_0xd27e('0x51')]=function(_0x50ce54,_0x13b431){if(_0x50ce54[_0xd27e('0x48')]['id']){delete _0x50ce54[_0xd27e('0x48')]['id'];}return db[_0xd27e('0x2c')][_0xd27e('0x45')]({'where':{'id':_0x50ce54[_0xd27e('0x44')]['id']}})[_0xd27e('0x22')](handleEntityNotFound(_0x13b431,null))[_0xd27e('0x22')](saveUpdates(_0x50ce54['body'],null))[_0xd27e('0x22')](respondWithResult(_0x13b431,null))[_0xd27e('0x46')](handleError(_0x13b431,null));};exports[_0xd27e('0x23')]=function(_0x3ba9a5,_0xe1dd5e){return db['Template'][_0xd27e('0x45')]({'where':{'id':_0x3ba9a5[_0xd27e('0x44')]['id']}})[_0xd27e('0x22')](handleEntityNotFound(_0xe1dd5e,null))[_0xd27e('0x22')](removeEntity(_0xe1dd5e,null))[_0xd27e('0x46')](handleError(_0xe1dd5e,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 1f3552d..964f128 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 _0x0ad1=['lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./template.attributes','exports','define','Template','tools_templates'];(function(_0x1d02f3,_0x31b27d){var _0xec4ab5=function(_0xeea761){while(--_0xeea761){_0x1d02f3['push'](_0x1d02f3['shift']());}};_0xec4ab5(++_0x31b27d);}(_0x0ad1,0x1d4));var _0x10ad=function(_0x4f85a0,_0x115d01){_0x4f85a0=_0x4f85a0-0x0;var _0x1f0ea5=_0x0ad1[_0x4f85a0];return _0x1f0ea5;};'use strict';var _=require(_0x10ad('0x0'));var util=require(_0x10ad('0x1'));var logger=require(_0x10ad('0x2'))('api');var moment=require(_0x10ad('0x3'));var BPromise=require(_0x10ad('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x10ad('0x5'));var rimraf=require(_0x10ad('0x6'));var config=require(_0x10ad('0x7'));var attributes=require(_0x10ad('0x8'));module[_0x10ad('0x9')]=function(_0x45d065,_0x1363d8){return _0x45d065[_0x10ad('0xa')](_0x10ad('0xb'),attributes,{'tableName':_0x10ad('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdd21=['tools_templates','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','./template.attributes','exports','define','Template'];(function(_0x2f6ba7,_0x56b8d0){var _0x309075=function(_0x411aea){while(--_0x411aea){_0x2f6ba7['push'](_0x2f6ba7['shift']());}};_0x309075(++_0x56b8d0);}(_0xdd21,0x145));var _0x1dd2=function(_0x458bd0,_0x5f54ad){_0x458bd0=_0x458bd0-0x0;var _0x1f5916=_0xdd21[_0x458bd0];return _0x1f5916;};'use strict';var _=require(_0x1dd2('0x0'));var util=require('util');var logger=require(_0x1dd2('0x1'))(_0x1dd2('0x2'));var moment=require('moment');var BPromise=require(_0x1dd2('0x3'));var rp=require(_0x1dd2('0x4'));var fs=require('fs');var path=require(_0x1dd2('0x5'));var rimraf=require(_0x1dd2('0x6'));var config=require('../../config/environment');var attributes=require(_0x1dd2('0x7'));module[_0x1dd2('0x8')]=function(_0x4645e8,_0x4e9dae){return _0x4645e8[_0x1dd2('0x9')](_0x1dd2('0xa'),attributes,{'tableName':_0x1dd2('0xb'),'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 4185f21..be3f2a4 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 _0x6c3f=['Template','findAll','options','raw','where','attributes','include','model','map','GetTemplate','debug','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','then','info','Template,\x20%s,\x20%s','request\x20sent','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x1d4db1,_0x188283){var _0x1dc5ea=function(_0x5163b6){while(--_0x5163b6){_0x1d4db1['push'](_0x1d4db1['shift']());}};_0x1dc5ea(++_0x188283);}(_0x6c3f,0x68));var _0xf6c3=function(_0x287cc3,_0x2e4f31){_0x287cc3=_0x287cc3-0x0;var _0x4d1ade=_0x6c3f[_0x287cc3];return _0x4d1ade;};'use strict';var _=require('lodash');var util=require(_0xf6c3('0x0'));var moment=require(_0xf6c3('0x1'));var BPromise=require('bluebird');var rs=require(_0xf6c3('0x2'));var fs=require('fs');var Redis=require(_0xf6c3('0x3'));var db=require(_0xf6c3('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf6c3('0x5'))(_0xf6c3('0x6'));var config=require(_0xf6c3('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xf6c3('0x8')][_0xf6c3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2fd35e,_0x30fb13,_0x1e1aa2){return new BPromise(function(_0x351132,_0x1903c3){return client['request'](_0x2fd35e,_0x1e1aa2)[_0xf6c3('0xa')](function(_0xbc7d9a){logger[_0xf6c3('0xb')](_0xf6c3('0xc'),_0x30fb13,_0xf6c3('0xd'));logger['debug'](_0xf6c3('0xe'),_0x30fb13,_0xf6c3('0xd'),JSON[_0xf6c3('0xf')](_0xbc7d9a));if(_0xbc7d9a[_0xf6c3('0x10')]){if(_0xbc7d9a[_0xf6c3('0x10')][_0xf6c3('0x11')]===0x1f4){logger['error'](_0xf6c3('0xc'),_0x30fb13,_0xbc7d9a[_0xf6c3('0x10')][_0xf6c3('0x12')]);return _0x1903c3(_0xbc7d9a['error'][_0xf6c3('0x12')]);}logger[_0xf6c3('0x10')](_0xf6c3('0xc'),_0x30fb13,_0xbc7d9a[_0xf6c3('0x10')]['message']);return _0x351132(_0xbc7d9a[_0xf6c3('0x10')]['message']);}else{logger[_0xf6c3('0xb')](_0xf6c3('0xc'),_0x30fb13,_0xf6c3('0xd'));_0x351132(_0xbc7d9a['result']['message']);}})[_0xf6c3('0x13')](function(_0xbb6179){logger[_0xf6c3('0x10')]('Template,\x20%s,\x20%s',_0x30fb13,_0xbb6179);_0x1903c3(_0xbb6179);});});}exports['GetTemplate']=function(_0x57ee57){var _0x4e1137=this;return new Promise(function(_0x2c1704,_0x293570){return db[_0xf6c3('0x14')][_0xf6c3('0x15')]({'raw':_0x57ee57[_0xf6c3('0x16')]?_0x57ee57[_0xf6c3('0x16')][_0xf6c3('0x17')]===undefined?!![]:![]:!![],'where':_0x57ee57[_0xf6c3('0x16')]?_0x57ee57['options'][_0xf6c3('0x18')]||null:null,'attributes':_0x57ee57['options']?_0x57ee57[_0xf6c3('0x16')][_0xf6c3('0x19')]||null:null,'limit':_0x57ee57['options']?_0x57ee57['options']['limit']||null:null,'include':_0x57ee57['options']?_0x57ee57[_0xf6c3('0x16')][_0xf6c3('0x1a')]?_['map'](_0x57ee57[_0xf6c3('0x16')]['include'],function(_0x52023b){return{'model':db[_0x52023b[_0xf6c3('0x1b')]],'as':_0x52023b['as'],'attributes':_0x52023b[_0xf6c3('0x19')],'include':_0x52023b[_0xf6c3('0x1a')]?_['map'](_0x52023b[_0xf6c3('0x1a')],function(_0x231464){return{'model':db[_0x231464[_0xf6c3('0x1b')]],'as':_0x231464['as'],'attributes':_0x231464['attributes'],'include':_0x231464[_0xf6c3('0x1a')]?_[_0xf6c3('0x1c')](_0x231464[_0xf6c3('0x1a')],function(_0x2e9e07){return{'model':db[_0x2e9e07[_0xf6c3('0x1b')]],'as':_0x2e9e07['as'],'attributes':_0x2e9e07[_0xf6c3('0x19')]};}):[]};}):[]};}):[]:[]})[_0xf6c3('0xa')](function(_0xdf32cb){logger[_0xf6c3('0xb')](_0xf6c3('0x1d'),_0x57ee57);logger[_0xf6c3('0x1e')]('GetTemplate',_0x57ee57,JSON['stringify'](_0xdf32cb));_0x2c1704(_0xdf32cb);})[_0xf6c3('0x13')](function(_0xd6346b){logger[_0xf6c3('0x10')](_0xf6c3('0x1d'),_0xd6346b[_0xf6c3('0x12')],_0x57ee57);_0x293570(_0x4e1137[_0xf6c3('0x10')](0x1f4,_0xd6346b[_0xf6c3('0x12')]));});});}; \ No newline at end of file +var _0xf08d=['stringify','error','code','message','result','catch','GetTemplate','Template','findAll','options','raw','attributes','limit','map','include','model','debug','lodash','util','moment','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Template,\x20%s,\x20%s','request\x20sent','Template,\x20%s,\x20%s,\x20%s'];(function(_0x2b27ba,_0xcae1cd){var _0x28a88e=function(_0x3caacb){while(--_0x3caacb){_0x2b27ba['push'](_0x2b27ba['shift']());}};_0x28a88e(++_0xcae1cd);}(_0xf08d,0x6e));var _0xdf08=function(_0x5e6980,_0x4e3ba1){_0x5e6980=_0x5e6980-0x0;var _0x47209a=_0xf08d[_0x5e6980];return _0x47209a;};'use strict';var _=require(_0xdf08('0x0'));var util=require(_0xdf08('0x1'));var moment=require(_0xdf08('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('../../config/utils');var logger=require('../../config/logger')(_0xdf08('0x3'));var config=require(_0xdf08('0x4'));var jayson=require(_0xdf08('0x5'));var client=jayson[_0xdf08('0x6')][_0xdf08('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xc214c4,_0x279e79,_0x234626){return new BPromise(function(_0x5af973,_0x5957a6){return client[_0xdf08('0x8')](_0xc214c4,_0x234626)[_0xdf08('0x9')](function(_0x2db776){logger[_0xdf08('0xa')](_0xdf08('0xb'),_0x279e79,_0xdf08('0xc'));logger['debug'](_0xdf08('0xd'),_0x279e79,_0xdf08('0xc'),JSON[_0xdf08('0xe')](_0x2db776));if(_0x2db776[_0xdf08('0xf')]){if(_0x2db776['error'][_0xdf08('0x10')]===0x1f4){logger[_0xdf08('0xf')]('Template,\x20%s,\x20%s',_0x279e79,_0x2db776[_0xdf08('0xf')]['message']);return _0x5957a6(_0x2db776[_0xdf08('0xf')][_0xdf08('0x11')]);}logger[_0xdf08('0xf')](_0xdf08('0xb'),_0x279e79,_0x2db776[_0xdf08('0xf')][_0xdf08('0x11')]);return _0x5af973(_0x2db776[_0xdf08('0xf')]['message']);}else{logger[_0xdf08('0xa')](_0xdf08('0xb'),_0x279e79,_0xdf08('0xc'));_0x5af973(_0x2db776[_0xdf08('0x12')][_0xdf08('0x11')]);}})[_0xdf08('0x13')](function(_0x3c06d8){logger['error'](_0xdf08('0xb'),_0x279e79,_0x3c06d8);_0x5957a6(_0x3c06d8);});});}exports[_0xdf08('0x14')]=function(_0x5a2357){var _0x35f6f9=this;return new Promise(function(_0x446c0e,_0x48b747){return db[_0xdf08('0x15')][_0xdf08('0x16')]({'raw':_0x5a2357['options']?_0x5a2357[_0xdf08('0x17')][_0xdf08('0x18')]===undefined?!![]:![]:!![],'where':_0x5a2357[_0xdf08('0x17')]?_0x5a2357['options']['where']||null:null,'attributes':_0x5a2357[_0xdf08('0x17')]?_0x5a2357[_0xdf08('0x17')][_0xdf08('0x19')]||null:null,'limit':_0x5a2357[_0xdf08('0x17')]?_0x5a2357[_0xdf08('0x17')][_0xdf08('0x1a')]||null:null,'include':_0x5a2357[_0xdf08('0x17')]?_0x5a2357[_0xdf08('0x17')]['include']?_[_0xdf08('0x1b')](_0x5a2357[_0xdf08('0x17')][_0xdf08('0x1c')],function(_0x1ead16){return{'model':db[_0x1ead16['model']],'as':_0x1ead16['as'],'attributes':_0x1ead16['attributes'],'include':_0x1ead16[_0xdf08('0x1c')]?_[_0xdf08('0x1b')](_0x1ead16[_0xdf08('0x1c')],function(_0x574f24){return{'model':db[_0x574f24[_0xdf08('0x1d')]],'as':_0x574f24['as'],'attributes':_0x574f24[_0xdf08('0x19')],'include':_0x574f24[_0xdf08('0x1c')]?_[_0xdf08('0x1b')](_0x574f24['include'],function(_0x1c918c){return{'model':db[_0x1c918c[_0xdf08('0x1d')]],'as':_0x1c918c['as'],'attributes':_0x1c918c[_0xdf08('0x19')]};}):[]};}):[]};}):[]:[]})[_0xdf08('0x9')](function(_0x48d797){logger[_0xdf08('0xa')]('GetTemplate',_0x5a2357);logger[_0xdf08('0x1e')](_0xdf08('0x14'),_0x5a2357,JSON[_0xdf08('0xe')](_0x48d797));_0x446c0e(_0x48d797);})[_0xdf08('0x13')](function(_0x18a0bf){logger['error'](_0xdf08('0x14'),_0x18a0bf[_0xdf08('0x11')],_0x5a2357);_0x48b747(_0x35f6f9[_0xdf08('0xf')](0x1f4,_0x18a0bf['message']));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index c4b63ee..5797004 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 _0xb1fa=['isAuthenticated','show','/:id/all_conditions','/:id/any_conditions','getAnyConditions','create','post','/:id/actions','addAction','/:id','update','delete','destroy','exports','path','express','./trigger.controller','get'];(function(_0x3cecdb,_0x1043f9){var _0x1dbc2c=function(_0x46a85a){while(--_0x46a85a){_0x3cecdb['push'](_0x3cecdb['shift']());}};_0x1dbc2c(++_0x1043f9);}(_0xb1fa,0x9e));var _0xab1f=function(_0x3ef3c5,_0x504ad2){_0x3ef3c5=_0x3ef3c5-0x0;var _0x4863f1=_0xb1fa[_0x3ef3c5];return _0x4863f1;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xab1f('0x0'));var timeout=require('connect-timeout');var express=require(_0xab1f('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xab1f('0x2'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xab1f('0x3')]('/:id',auth[_0xab1f('0x4')](),controller[_0xab1f('0x5')]);router['get'](_0xab1f('0x6'),auth['isAuthenticated'](),controller['getAllConditions']);router[_0xab1f('0x3')](_0xab1f('0x7'),auth[_0xab1f('0x4')](),controller[_0xab1f('0x8')]);router[_0xab1f('0x3')]('/:id/actions',auth[_0xab1f('0x4')](),controller['getActions']);router['post']('/',auth[_0xab1f('0x4')](),controller[_0xab1f('0x9')]);router['post']('/:id/all_conditions',auth[_0xab1f('0x4')](),controller['addAllCondition']);router[_0xab1f('0xa')](_0xab1f('0x7'),auth[_0xab1f('0x4')](),controller['addAnyCondition']);router[_0xab1f('0xa')](_0xab1f('0xb'),auth[_0xab1f('0x4')](),controller[_0xab1f('0xc')]);router['put'](_0xab1f('0xd'),auth['isAuthenticated'](),controller[_0xab1f('0xe')]);router[_0xab1f('0xf')](_0xab1f('0xd'),auth['isAuthenticated'](),controller[_0xab1f('0x10')]);module[_0xab1f('0x11')]=router; \ No newline at end of file +var _0xabc1=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./trigger.controller','get','index','isAuthenticated','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','post','create','addAnyCondition','addAction','put','/:id','update','delete','exports','multer'];(function(_0x467d11,_0xe893d8){var _0x569198=function(_0x7ff953){while(--_0x7ff953){_0x467d11['push'](_0x467d11['shift']());}};_0x569198(++_0xe893d8);}(_0xabc1,0x13e));var _0x1abc=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xabc1[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x1abc('0x0'));var util=require(_0x1abc('0x1'));var path=require(_0x1abc('0x2'));var timeout=require(_0x1abc('0x3'));var express=require(_0x1abc('0x4'));var router=express[_0x1abc('0x5')]();var fs_extra=require(_0x1abc('0x6'));var auth=require(_0x1abc('0x7'));var interaction=require(_0x1abc('0x8'));var config=require('../../config/environment');var controller=require(_0x1abc('0x9'));router[_0x1abc('0xa')]('/',auth['isAuthenticated'](),controller[_0x1abc('0xb')]);router[_0x1abc('0xa')]('/:id',auth[_0x1abc('0xc')](),controller[_0x1abc('0xd')]);router[_0x1abc('0xa')](_0x1abc('0xe'),auth[_0x1abc('0xc')](),controller[_0x1abc('0xf')]);router['get'](_0x1abc('0x10'),auth['isAuthenticated'](),controller[_0x1abc('0x11')]);router[_0x1abc('0xa')](_0x1abc('0x12'),auth[_0x1abc('0xc')](),controller[_0x1abc('0x13')]);router[_0x1abc('0x14')]('/',auth[_0x1abc('0xc')](),controller[_0x1abc('0x15')]);router[_0x1abc('0x14')]('/:id/all_conditions',auth[_0x1abc('0xc')](),controller['addAllCondition']);router[_0x1abc('0x14')]('/:id/any_conditions',auth[_0x1abc('0xc')](),controller[_0x1abc('0x16')]);router[_0x1abc('0x14')](_0x1abc('0x12'),auth['isAuthenticated'](),controller[_0x1abc('0x17')]);router[_0x1abc('0x18')](_0x1abc('0x19'),auth[_0x1abc('0xc')](),controller[_0x1abc('0x1a')]);router[_0x1abc('0x1b')](_0x1abc('0x19'),auth['isAuthenticated'](),controller['destroy']);module[_0x1abc('0x1c')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index b46e24a..b0f3ebd 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 _0xb20d=['STRING','BOOLEAN','sequelize'];(function(_0x35fc62,_0x21fd86){var _0x24faf8=function(_0x21431f){while(--_0x21431f){_0x35fc62['push'](_0x35fc62['shift']());}};_0x24faf8(++_0x21fd86);}(_0xb20d,0xc5));var _0xdb20=function(_0x3466a7,_0x5345ea){_0x3466a7=_0x3466a7-0x0;var _0x5dac4c=_0xb20d[_0x3466a7];return _0x5dac4c;};'use strict';var Sequelize=require(_0xdb20('0x0'));module['exports']={'name':{'type':Sequelize[_0xdb20('0x1')]},'channel':{'type':Sequelize[_0xdb20('0x1')]},'description':{'type':Sequelize[_0xdb20('0x1')]},'status':{'type':Sequelize[_0xdb20('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xb243=['STRING','BOOLEAN','sequelize','exports'];(function(_0x33f7b6,_0x8ce322){var _0x2cec9f=function(_0x3a8e0d){while(--_0x3a8e0d){_0x33f7b6['push'](_0x33f7b6['shift']());}};_0x2cec9f(++_0x8ce322);}(_0xb243,0x1b6));var _0x3b24=function(_0x4e726e,_0x2a5e74){_0x4e726e=_0x4e726e-0x0;var _0x4f0388=_0xb243[_0x4e726e];return _0x4f0388;};'use strict';var Sequelize=require(_0x3b24('0x0'));module[_0x3b24('0x1')]={'name':{'type':Sequelize[_0x3b24('0x2')]},'channel':{'type':Sequelize[_0x3b24('0x2')]},'description':{'type':Sequelize[_0x3b24('0x2')]},'status':{'type':Sequelize[_0x3b24('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index 7b60388..c75a5ee 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 _0xd53d=['body','user','role','Triggers','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','addAnyCondition','TriggerAnyId','Condition','getAllConditions','order','getAnyConditions','findOne','addAction','TriggerId','Action','getActions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','sendStatus','status','end','json','undefined','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','error','stack','name','send','index','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','type','VIRTUAL','filter','merge','options','Trigger','count','includeAll','include','rows','catch','show','params','find','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd53d,0xd2));var _0xdd53=function(_0x111c83,_0x279c44){_0x111c83=_0x111c83-0x0;var _0x4a5c7d=_0xd53d[_0x111c83];return _0x4a5c7d;};'use strict';var emlformat=require(_0xdd53('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdd53('0x1'));var jsonpatch=require(_0xdd53('0x2'));var rp=require(_0xdd53('0x3'));var moment=require(_0xdd53('0x4'));var BPromise=require(_0xdd53('0x5'));var Mustache=require(_0xdd53('0x6'));var util=require(_0xdd53('0x7'));var path=require(_0xdd53('0x8'));var sox=require(_0xdd53('0x9'));var csv=require(_0xdd53('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdd53('0xb'));var _=require(_0xdd53('0xc'));var squel=require(_0xdd53('0xd'));var crypto=require(_0xdd53('0xe'));var jsforce=require(_0xdd53('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xdd53('0xa'));var querystring=require(_0xdd53('0x10'));var Papa=require('papaparse');var Redis=require(_0xdd53('0x11'));var authService=require(_0xdd53('0x12'));var qs=require(_0xdd53('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xdd53('0x14'))('api');var utils=require(_0xdd53('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4f6526,_0x49f20d){_0x49f20d=_0x49f20d||0xcc;return function(_0xf5ecd7){if(_0xf5ecd7){return _0x4f6526[_0xdd53('0x16')](_0x49f20d);}return _0x4f6526[_0xdd53('0x17')](_0x49f20d)[_0xdd53('0x18')]();};}function respondWithResult(_0x2f70ce,_0x4a5c55){_0x4a5c55=_0x4a5c55||0xc8;return function(_0x540051){if(_0x540051){return _0x2f70ce['status'](_0x4a5c55)[_0xdd53('0x19')](_0x540051);}};}function respondWithFilteredResult(_0x448d5d,_0x257535){return function(_0x2d90dd){if(_0x2d90dd){var _0x234642=typeof _0x257535['offset']===_0xdd53('0x1a')&&typeof _0x257535['limit']===_0xdd53('0x1a');var _0xc4bcac=_0x2d90dd['count'];var _0xee86d8=_0x234642?0x0:_0x257535[_0xdd53('0x1b')];var _0x2cfa36=_0x234642?_0x2d90dd['count']:_0x257535[_0xdd53('0x1b')]+_0x257535['limit'];var _0x4e9a1c;if(_0x2cfa36>=_0xc4bcac){_0x2cfa36=_0xc4bcac;_0x4e9a1c=0xc8;}else{_0x4e9a1c=0xce;}_0x448d5d[_0xdd53('0x17')](_0x4e9a1c);return _0x448d5d[_0xdd53('0x1c')](_0xdd53('0x1d'),_0xee86d8+'-'+_0x2cfa36+'/'+_0xc4bcac)['json'](_0x2d90dd);}return null;};}function patchUpdates(_0x192698){return function(_0x25da0f){try{jsonpatch[_0xdd53('0x1e')](_0x25da0f,_0x192698,!![]);}catch(_0x5b9f95){return BPromise[_0xdd53('0x1f')](_0x5b9f95);}return _0x25da0f[_0xdd53('0x20')]();};}function saveUpdates(_0xa843cb,_0x454818){return function(_0x25019c){if(_0x25019c){return _0x25019c[_0xdd53('0x21')](_0xa843cb)[_0xdd53('0x22')](function(_0x5b3f3d){return _0x5b3f3d;});}return null;};}function removeEntity(_0x48d95c,_0x3f9115){return function(_0x310175){if(_0x310175){return _0x310175[_0xdd53('0x23')]()[_0xdd53('0x22')](function(){var _0xcbaf7c=_0x310175[_0xdd53('0x24')]({'plain':!![]});var _0x330a5b='Triggers';return db['UserProfileResource'][_0xdd53('0x23')]({'where':{'type':_0x330a5b,'resourceId':_0xcbaf7c['id']}})[_0xdd53('0x22')](function(){return _0x310175;});})[_0xdd53('0x22')](function(){_0x48d95c[_0xdd53('0x17')](0xcc)[_0xdd53('0x18')]();});}};}function handleEntityNotFound(_0x29405d,_0x2b77f4){return function(_0x3fac43){if(!_0x3fac43){_0x29405d[_0xdd53('0x16')](0x194);}return _0x3fac43;};}function handleError(_0x4ebdb2,_0x54223d){_0x54223d=_0x54223d||0x1f4;return function(_0x1e7f97){logger[_0xdd53('0x25')](_0x1e7f97[_0xdd53('0x26')]);if(_0x1e7f97[_0xdd53('0x27')]){delete _0x1e7f97[_0xdd53('0x27')];}_0x4ebdb2[_0xdd53('0x17')](_0x54223d)[_0xdd53('0x28')](_0x1e7f97);};}exports[_0xdd53('0x29')]=function(_0x299ebc,_0xae3b7){var _0x420638={},_0x231540={},_0x420c5c={'count':0x0,'rows':[]};var _0x2ac553=_['map'](db['Trigger'][_0xdd53('0x2a')],function(_0x4dcbac){return{'name':_0x4dcbac[_0xdd53('0x2b')],'type':_0x4dcbac['type'][_0xdd53('0x2c')]};});_0x231540[_0xdd53('0x2d')]=_[_0xdd53('0x2e')](_0x2ac553,_0xdd53('0x27'));_0x231540[_0xdd53('0x2f')]=_[_0xdd53('0x30')](_0x299ebc[_0xdd53('0x2f')]);_0x231540[_0xdd53('0x31')]=_[_0xdd53('0x32')](_0x231540['model'],_0x231540['query']);_0x420638[_0xdd53('0x33')]=_['intersection'](_0x231540[_0xdd53('0x2d')],qs[_0xdd53('0x34')](_0x299ebc[_0xdd53('0x2f')]['fields']));_0x420638['attributes']=_0x420638[_0xdd53('0x33')][_0xdd53('0x35')]?_0x420638['attributes']:_0x231540[_0xdd53('0x2d')];if(!_0x299ebc[_0xdd53('0x2f')][_0xdd53('0x36')](_0xdd53('0x37'))){_0x420638[_0xdd53('0x38')]=qs['limit'](_0x299ebc[_0xdd53('0x2f')][_0xdd53('0x38')]);_0x420638[_0xdd53('0x1b')]=qs['offset'](_0x299ebc[_0xdd53('0x2f')][_0xdd53('0x1b')]);}_0x420638['order']=qs['sort'](_0x299ebc[_0xdd53('0x2f')][_0xdd53('0x39')]);_0x420638[_0xdd53('0x3a')]=qs[_0xdd53('0x31')](_[_0xdd53('0x3b')](_0x299ebc['query'],_0x231540[_0xdd53('0x31')]),_0x2ac553);if(_0x299ebc['query']['filter']){_0x420638[_0xdd53('0x3a')]=_['merge'](_0x420638[_0xdd53('0x3a')],{'$or':_[_0xdd53('0x2e')](_0x2ac553,function(_0x18061a){if(_0x18061a[_0xdd53('0x3c')]!==_0xdd53('0x3d')){var _0x2c0b23={};_0x2c0b23[_0x18061a[_0xdd53('0x27')]]={'$like':'%'+_0x299ebc[_0xdd53('0x2f')][_0xdd53('0x3e')]+'%'};return _0x2c0b23;}})});}_0x420638=_[_0xdd53('0x3f')]({},_0x420638,_0x299ebc[_0xdd53('0x40')]);var _0x2c37cb={'where':_0x420638[_0xdd53('0x3a')]};return db[_0xdd53('0x41')][_0xdd53('0x42')](_0x2c37cb)[_0xdd53('0x22')](function(_0x4b7c58){_0x420c5c[_0xdd53('0x42')]=_0x4b7c58;if(_0x299ebc[_0xdd53('0x2f')][_0xdd53('0x43')]){_0x420638[_0xdd53('0x44')]=[{'all':!![]}];}return db[_0xdd53('0x41')]['findAll'](_0x420638);})[_0xdd53('0x22')](function(_0x1c3556){_0x420c5c[_0xdd53('0x45')]=_0x1c3556;return _0x420c5c;})[_0xdd53('0x22')](respondWithFilteredResult(_0xae3b7,_0x420638))[_0xdd53('0x46')](handleError(_0xae3b7,null));};exports[_0xdd53('0x47')]=function(_0x515af9,_0xd01183){var _0x2f8b10={'raw':![],'where':{'id':_0x515af9[_0xdd53('0x48')]['id']}},_0x4ce1ed={};_0x4ce1ed['model']=_['keys'](db[_0xdd53('0x41')][_0xdd53('0x2a')]);_0x4ce1ed['query']=_[_0xdd53('0x30')](_0x515af9[_0xdd53('0x2f')]);_0x4ce1ed['filters']=_[_0xdd53('0x32')](_0x4ce1ed['model'],_0x4ce1ed[_0xdd53('0x2f')]);_0x2f8b10[_0xdd53('0x33')]=_[_0xdd53('0x32')](_0x4ce1ed['model'],qs[_0xdd53('0x34')](_0x515af9[_0xdd53('0x2f')]['fields']));_0x2f8b10[_0xdd53('0x33')]=_0x2f8b10[_0xdd53('0x33')][_0xdd53('0x35')]?_0x2f8b10[_0xdd53('0x33')]:_0x4ce1ed[_0xdd53('0x2d')];if(_0x515af9[_0xdd53('0x2f')]['includeAll']){_0x2f8b10[_0xdd53('0x44')]=[{'all':!![]}];}_0x2f8b10=_[_0xdd53('0x3f')]({},_0x2f8b10,_0x515af9[_0xdd53('0x40')]);return db[_0xdd53('0x41')][_0xdd53('0x49')](_0x2f8b10)[_0xdd53('0x22')](handleEntityNotFound(_0xd01183,null))['then'](respondWithResult(_0xd01183,null))[_0xdd53('0x46')](handleError(_0xd01183,null));};exports[_0xdd53('0x4a')]=function(_0x3de265,_0x1ea3ff){return db[_0xdd53('0x41')][_0xdd53('0x4a')](_0x3de265[_0xdd53('0x4b')],{})[_0xdd53('0x22')](function(_0x2e0b0d){var _0x86cb48=_0x3de265[_0xdd53('0x4c')][_0xdd53('0x24')]({'plain':!![]});if(!_0x86cb48)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x86cb48[_0xdd53('0x4d')]===_0xdd53('0x4c')){var _0x1a1c56=_0x2e0b0d[_0xdd53('0x24')]({'plain':!![]});var _0x378eb7=_0xdd53('0x4e');return db['UserProfileSection']['find']({'where':{'name':_0x378eb7,'userProfileId':_0x86cb48[_0xdd53('0x4f')]},'raw':!![]})[_0xdd53('0x22')](function(_0x498eab){if(_0x498eab&&_0x498eab[_0xdd53('0x50')]===0x0){return db[_0xdd53('0x51')][_0xdd53('0x4a')]({'name':_0x1a1c56[_0xdd53('0x27')],'resourceId':_0x1a1c56['id'],'type':_0x498eab[_0xdd53('0x27')],'sectionId':_0x498eab['id']},{})[_0xdd53('0x22')](function(){return _0x2e0b0d;});}else{return _0x2e0b0d;}})[_0xdd53('0x46')](function(_0x82569){logger[_0xdd53('0x25')](_0xdd53('0x52'),_0x82569);throw _0x82569;});}return _0x2e0b0d;})[_0xdd53('0x22')](respondWithResult(_0x1ea3ff,0xc9))[_0xdd53('0x46')](handleError(_0x1ea3ff,null));};exports['update']=function(_0x19a881,_0x24e663){if(_0x19a881[_0xdd53('0x4b')]['id']){delete _0x19a881[_0xdd53('0x4b')]['id'];}return db[_0xdd53('0x41')]['find']({'where':{'id':_0x19a881[_0xdd53('0x48')]['id']}})[_0xdd53('0x22')](handleEntityNotFound(_0x24e663,null))[_0xdd53('0x22')](saveUpdates(_0x19a881['body'],null))[_0xdd53('0x22')](respondWithResult(_0x24e663,null))[_0xdd53('0x46')](handleError(_0x24e663,null));};exports[_0xdd53('0x23')]=function(_0x22dd9d,_0x3556f0){return db[_0xdd53('0x41')][_0xdd53('0x49')]({'where':{'id':_0x22dd9d[_0xdd53('0x48')]['id']}})[_0xdd53('0x22')](handleEntityNotFound(_0x3556f0,null))['then'](removeEntity(_0x3556f0,null))[_0xdd53('0x46')](handleError(_0x3556f0,null));};exports[_0xdd53('0x53')]=function(_0x4f6909,_0x14c1d6,_0x41f99c){if(_0x4f6909[_0xdd53('0x4b')]['id']){delete _0x4f6909[_0xdd53('0x4b')]['id'];}return db[_0xdd53('0x41')][_0xdd53('0x49')]({'where':{'id':_0x4f6909[_0xdd53('0x48')]['id']}})[_0xdd53('0x22')](handleEntityNotFound(_0x14c1d6,null))[_0xdd53('0x22')](function(_0x461271){if(_0x461271){_0x4f6909[_0xdd53('0x4b')]['TriggerAllId']=_0x461271['id'];return db['Condition']['create'](_0x4f6909['body']);}})[_0xdd53('0x22')](respondWithResult(_0x14c1d6,null))[_0xdd53('0x46')](handleError(_0x14c1d6,null));};exports[_0xdd53('0x54')]=function(_0x1815fd,_0x1c12c8,_0x2c02c5){if(_0x1815fd[_0xdd53('0x4b')]['id']){delete _0x1815fd[_0xdd53('0x4b')]['id'];}return db[_0xdd53('0x41')][_0xdd53('0x49')]({'where':{'id':_0x1815fd[_0xdd53('0x48')]['id']}})[_0xdd53('0x22')](handleEntityNotFound(_0x1c12c8,null))['then'](function(_0x503df8){if(_0x503df8){_0x1815fd[_0xdd53('0x4b')][_0xdd53('0x55')]=_0x503df8['id'];return db[_0xdd53('0x56')][_0xdd53('0x4a')](_0x1815fd[_0xdd53('0x4b')]);}})[_0xdd53('0x22')](respondWithResult(_0x1c12c8,null))[_0xdd53('0x46')](handleError(_0x1c12c8,null));};exports[_0xdd53('0x57')]=function(_0x434f3b,_0x47e7c2,_0x5962f5){var _0x1dcc5e={};var _0x5887a2={};var _0xde6ecd;var _0x1336d3;return db['Trigger']['findOne']({'where':{'id':_0x434f3b[_0xdd53('0x48')]['id']}})['then'](handleEntityNotFound(_0x47e7c2,null))[_0xdd53('0x22')](function(_0x1d3820){if(_0x1d3820){_0xde6ecd=_0x1d3820;_0x5887a2[_0xdd53('0x2d')]=_[_0xdd53('0x30')](db[_0xdd53('0x56')][_0xdd53('0x2a')]);_0x5887a2[_0xdd53('0x2f')]=_[_0xdd53('0x30')](_0x434f3b['query']);_0x5887a2[_0xdd53('0x31')]=_[_0xdd53('0x32')](_0x5887a2[_0xdd53('0x2d')],_0x5887a2[_0xdd53('0x2f')]);_0x1dcc5e[_0xdd53('0x33')]=_[_0xdd53('0x32')](_0x5887a2[_0xdd53('0x2d')],qs[_0xdd53('0x34')](_0x434f3b[_0xdd53('0x2f')]['fields']));_0x1dcc5e['attributes']=_0x1dcc5e[_0xdd53('0x33')]['length']?_0x1dcc5e[_0xdd53('0x33')]:_0x5887a2[_0xdd53('0x2d')];_0x1dcc5e[_0xdd53('0x58')]=qs[_0xdd53('0x39')](_0x434f3b[_0xdd53('0x2f')][_0xdd53('0x39')]);_0x1dcc5e[_0xdd53('0x3a')]=qs[_0xdd53('0x31')](_[_0xdd53('0x3b')](_0x434f3b[_0xdd53('0x2f')],_0x5887a2[_0xdd53('0x31')]));if(_0x434f3b[_0xdd53('0x2f')][_0xdd53('0x3e')]){_0x1dcc5e[_0xdd53('0x3a')]=_[_0xdd53('0x3f')](_0x1dcc5e[_0xdd53('0x3a')],{'$or':_['map'](_0x1dcc5e[_0xdd53('0x33')],function(_0x2673f8){var _0x9ce47a={};_0x9ce47a[_0x2673f8]={'$like':'%'+_0x434f3b[_0xdd53('0x2f')][_0xdd53('0x3e')]+'%'};return _0x9ce47a;})});}_0x1dcc5e=_[_0xdd53('0x3f')]({},_0x1dcc5e,_0x434f3b[_0xdd53('0x40')]);return _0xde6ecd['getAllConditions'](_0x1dcc5e);}})[_0xdd53('0x22')](function(_0x26aa3d){if(_0x26aa3d){_0x1336d3=_0x26aa3d[_0xdd53('0x35')];if(!_0x434f3b[_0xdd53('0x2f')][_0xdd53('0x36')](_0xdd53('0x37'))){_0x1dcc5e[_0xdd53('0x38')]=qs[_0xdd53('0x38')](_0x434f3b[_0xdd53('0x2f')]['limit']);_0x1dcc5e[_0xdd53('0x1b')]=qs[_0xdd53('0x1b')](_0x434f3b[_0xdd53('0x2f')]['offset']);}return _0xde6ecd[_0xdd53('0x57')](_0x1dcc5e);}})[_0xdd53('0x22')](function(_0x305426){if(_0x305426){return _0x305426?{'count':_0x1336d3,'rows':_0x305426}:null;}})['then'](respondWithResult(_0x47e7c2,null))['catch'](handleError(_0x47e7c2,null));};exports[_0xdd53('0x59')]=function(_0x22e13d,_0x521be1,_0x5714cb){var _0x2c5904={};var _0x270cca={};var _0x47883f;var _0x254c3a;return db[_0xdd53('0x41')][_0xdd53('0x5a')]({'where':{'id':_0x22e13d[_0xdd53('0x48')]['id']}})['then'](handleEntityNotFound(_0x521be1,null))['then'](function(_0x100d0c){if(_0x100d0c){_0x47883f=_0x100d0c;_0x270cca['model']=_[_0xdd53('0x30')](db[_0xdd53('0x56')][_0xdd53('0x2a')]);_0x270cca[_0xdd53('0x2f')]=_['keys'](_0x22e13d[_0xdd53('0x2f')]);_0x270cca[_0xdd53('0x31')]=_[_0xdd53('0x32')](_0x270cca[_0xdd53('0x2d')],_0x270cca[_0xdd53('0x2f')]);_0x2c5904[_0xdd53('0x33')]=_[_0xdd53('0x32')](_0x270cca['model'],qs['fields'](_0x22e13d[_0xdd53('0x2f')][_0xdd53('0x34')]));_0x2c5904[_0xdd53('0x33')]=_0x2c5904[_0xdd53('0x33')][_0xdd53('0x35')]?_0x2c5904[_0xdd53('0x33')]:_0x270cca[_0xdd53('0x2d')];_0x2c5904[_0xdd53('0x58')]=qs[_0xdd53('0x39')](_0x22e13d['query'][_0xdd53('0x39')]);_0x2c5904[_0xdd53('0x3a')]=qs[_0xdd53('0x31')](_['pick'](_0x22e13d[_0xdd53('0x2f')],_0x270cca[_0xdd53('0x31')]));if(_0x22e13d[_0xdd53('0x2f')]['filter']){_0x2c5904[_0xdd53('0x3a')]=_[_0xdd53('0x3f')](_0x2c5904[_0xdd53('0x3a')],{'$or':_[_0xdd53('0x2e')](_0x2c5904['attributes'],function(_0x195e6a){var _0x1df4ab={};_0x1df4ab[_0x195e6a]={'$like':'%'+_0x22e13d[_0xdd53('0x2f')]['filter']+'%'};return _0x1df4ab;})});}_0x2c5904=_[_0xdd53('0x3f')]({},_0x2c5904,_0x22e13d['options']);return _0x47883f[_0xdd53('0x59')](_0x2c5904);}})[_0xdd53('0x22')](function(_0x2c92ad){if(_0x2c92ad){_0x254c3a=_0x2c92ad[_0xdd53('0x35')];if(!_0x22e13d['query'][_0xdd53('0x36')]('nolimit')){_0x2c5904[_0xdd53('0x38')]=qs['limit'](_0x22e13d[_0xdd53('0x2f')][_0xdd53('0x38')]);_0x2c5904[_0xdd53('0x1b')]=qs[_0xdd53('0x1b')](_0x22e13d[_0xdd53('0x2f')][_0xdd53('0x1b')]);}return _0x47883f['getAnyConditions'](_0x2c5904);}})[_0xdd53('0x22')](function(_0x531b53){if(_0x531b53){return _0x531b53?{'count':_0x254c3a,'rows':_0x531b53}:null;}})[_0xdd53('0x22')](respondWithResult(_0x521be1,null))[_0xdd53('0x46')](handleError(_0x521be1,null));};exports[_0xdd53('0x5b')]=function(_0x384eff,_0x1a4533,_0xd737e7){if(_0x384eff[_0xdd53('0x4b')]['id']){delete _0x384eff[_0xdd53('0x4b')]['id'];}return db[_0xdd53('0x41')]['find']({'where':{'id':_0x384eff['params']['id']}})[_0xdd53('0x22')](handleEntityNotFound(_0x1a4533,null))['then'](function(_0x219722){if(_0x219722){_0x384eff[_0xdd53('0x4b')][_0xdd53('0x5c')]=_0x219722['id'];return db[_0xdd53('0x5d')][_0xdd53('0x4a')](_0x384eff[_0xdd53('0x4b')]);}})['then'](respondWithResult(_0x1a4533,null))['catch'](handleError(_0x1a4533,null));};exports[_0xdd53('0x5e')]=function(_0x399d32,_0x754085,_0x56081f){var _0x524030={};var _0x199a96={};var _0x5d0b72;var _0x3c57d7;return db[_0xdd53('0x41')]['findOne']({'where':{'id':_0x399d32[_0xdd53('0x48')]['id']}})[_0xdd53('0x22')](handleEntityNotFound(_0x754085,null))['then'](function(_0x237384){if(_0x237384){_0x5d0b72=_0x237384;_0x199a96['model']=_['keys'](db['Action'][_0xdd53('0x2a')]);_0x199a96[_0xdd53('0x2f')]=_['keys'](_0x399d32[_0xdd53('0x2f')]);_0x199a96[_0xdd53('0x31')]=_['intersection'](_0x199a96['model'],_0x199a96['query']);_0x524030[_0xdd53('0x33')]=_[_0xdd53('0x32')](_0x199a96[_0xdd53('0x2d')],qs['fields'](_0x399d32[_0xdd53('0x2f')][_0xdd53('0x34')]));_0x524030['attributes']=_0x524030[_0xdd53('0x33')][_0xdd53('0x35')]?_0x524030[_0xdd53('0x33')]:_0x199a96['model'];_0x524030[_0xdd53('0x58')]=qs[_0xdd53('0x39')](_0x399d32[_0xdd53('0x2f')][_0xdd53('0x39')]);_0x524030[_0xdd53('0x3a')]=qs[_0xdd53('0x31')](_['pick'](_0x399d32['query'],_0x199a96['filters']));if(_0x399d32[_0xdd53('0x2f')]['filter']){_0x524030['where']=_[_0xdd53('0x3f')](_0x524030[_0xdd53('0x3a')],{'$or':_[_0xdd53('0x2e')](_0x524030['attributes'],function(_0x4d3b84){var _0x396d7b={};_0x396d7b[_0x4d3b84]={'$like':'%'+_0x399d32['query'][_0xdd53('0x3e')]+'%'};return _0x396d7b;})});}_0x524030=_[_0xdd53('0x3f')]({},_0x524030,_0x399d32[_0xdd53('0x40')]);return _0x5d0b72[_0xdd53('0x5e')](_0x524030);}})[_0xdd53('0x22')](function(_0x3b1894){if(_0x3b1894){_0x3c57d7=_0x3b1894[_0xdd53('0x35')];if(!_0x399d32['query'][_0xdd53('0x36')](_0xdd53('0x37'))){_0x524030[_0xdd53('0x38')]=qs[_0xdd53('0x38')](_0x399d32['query'][_0xdd53('0x38')]);_0x524030['offset']=qs[_0xdd53('0x1b')](_0x399d32[_0xdd53('0x2f')][_0xdd53('0x1b')]);}return _0x5d0b72[_0xdd53('0x5e')](_0x524030);}})['then'](function(_0x5a2fb7){if(_0x5a2fb7){return _0x5a2fb7?{'count':_0x3c57d7,'rows':_0x5a2fb7}:null;}})[_0xdd53('0x22')](respondWithResult(_0x754085,null))[_0xdd53('0x46')](handleError(_0x754085,null));}; \ No newline at end of file +var _0xa925=['nolimit','order','where','pick','filter','merge','options','rows','show','params','keys','rawAttributes','includeAll','include','find','catch','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne','sort','hasOwnProperty','getAnyConditions','addAction','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','ejs','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','sendStatus','status','json','offset','count','limit','set','Content-Range','apply','reject','save','then','destroy','get','Triggers','UserProfileResource','end','error','name','send','index','Trigger','fieldName','type','key','map','query','filters','intersection','model','attributes','fields','length'];(function(_0x2785c1,_0x112dd7){var _0xce8107=function(_0x4af51a){while(--_0x4af51a){_0x2785c1['push'](_0x2785c1['shift']());}};_0xce8107(++_0x112dd7);}(_0xa925,0x1aa));var _0x5a92=function(_0x174ef5,_0x256e8e){_0x174ef5=_0x174ef5-0x0;var _0x1cc379=_0xa925[_0x174ef5];return _0x1cc379;};'use strict';var emlformat=require(_0x5a92('0x0'));var rimraf=require(_0x5a92('0x1'));var zipdir=require(_0x5a92('0x2'));var jsonpatch=require(_0x5a92('0x3'));var rp=require('request-promise');var moment=require(_0x5a92('0x4'));var BPromise=require(_0x5a92('0x5'));var Mustache=require(_0x5a92('0x6'));var util=require('util');var path=require(_0x5a92('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5a92('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5a92('0x9'));var crypto=require(_0x5a92('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x5a92('0xb'));var toCsv=require(_0x5a92('0xc'));var querystring=require(_0x5a92('0xd'));var Papa=require(_0x5a92('0xe'));var Redis=require(_0x5a92('0xf'));var authService=require(_0x5a92('0x10'));var qs=require(_0x5a92('0x11'));var as=require(_0x5a92('0x12'));var hardwareService=require(_0x5a92('0x13'));var logger=require(_0x5a92('0x14'))(_0x5a92('0x15'));var utils=require(_0x5a92('0x16'));var config=require(_0x5a92('0x17'));var licenseUtil=require(_0x5a92('0x18'));var db=require(_0x5a92('0x19'))['db'];function respondWithStatusCode(_0x156509,_0x2fb61f){_0x2fb61f=_0x2fb61f||0xcc;return function(_0x19dd2d){if(_0x19dd2d){return _0x156509[_0x5a92('0x1a')](_0x2fb61f);}return _0x156509[_0x5a92('0x1b')](_0x2fb61f)['end']();};}function respondWithResult(_0xaab199,_0x5d0908){_0x5d0908=_0x5d0908||0xc8;return function(_0x4aa554){if(_0x4aa554){return _0xaab199[_0x5a92('0x1b')](_0x5d0908)[_0x5a92('0x1c')](_0x4aa554);}};}function respondWithFilteredResult(_0x16f34c,_0x1bf911){return function(_0x3b7c38){if(_0x3b7c38){var _0x3753dc=typeof _0x1bf911[_0x5a92('0x1d')]==='undefined'&&typeof _0x1bf911['limit']==='undefined';var _0x357f35=_0x3b7c38['count'];var _0x47bd31=_0x3753dc?0x0:_0x1bf911[_0x5a92('0x1d')];var _0x4421bf=_0x3753dc?_0x3b7c38[_0x5a92('0x1e')]:_0x1bf911[_0x5a92('0x1d')]+_0x1bf911[_0x5a92('0x1f')];var _0x2aa944;if(_0x4421bf>=_0x357f35){_0x4421bf=_0x357f35;_0x2aa944=0xc8;}else{_0x2aa944=0xce;}_0x16f34c['status'](_0x2aa944);return _0x16f34c[_0x5a92('0x20')](_0x5a92('0x21'),_0x47bd31+'-'+_0x4421bf+'/'+_0x357f35)[_0x5a92('0x1c')](_0x3b7c38);}return null;};}function patchUpdates(_0x14e66e){return function(_0x28a909){try{jsonpatch[_0x5a92('0x22')](_0x28a909,_0x14e66e,!![]);}catch(_0x458cfc){return BPromise[_0x5a92('0x23')](_0x458cfc);}return _0x28a909[_0x5a92('0x24')]();};}function saveUpdates(_0x2a7863,_0x3d6644){return function(_0x5dc615){if(_0x5dc615){return _0x5dc615['update'](_0x2a7863)[_0x5a92('0x25')](function(_0x2476d5){return _0x2476d5;});}return null;};}function removeEntity(_0x56482d,_0x2c6840){return function(_0x3080b2){if(_0x3080b2){return _0x3080b2[_0x5a92('0x26')]()[_0x5a92('0x25')](function(){var _0x5ba382=_0x3080b2[_0x5a92('0x27')]({'plain':!![]});var _0x3bd846=_0x5a92('0x28');return db[_0x5a92('0x29')]['destroy']({'where':{'type':_0x3bd846,'resourceId':_0x5ba382['id']}})[_0x5a92('0x25')](function(){return _0x3080b2;});})['then'](function(){_0x56482d[_0x5a92('0x1b')](0xcc)[_0x5a92('0x2a')]();});}};}function handleEntityNotFound(_0x4c0153,_0x26ff9c){return function(_0x378ce2){if(!_0x378ce2){_0x4c0153[_0x5a92('0x1a')](0x194);}return _0x378ce2;};}function handleError(_0x8c46a0,_0x32c958){_0x32c958=_0x32c958||0x1f4;return function(_0x87425f){logger[_0x5a92('0x2b')](_0x87425f['stack']);if(_0x87425f[_0x5a92('0x2c')]){delete _0x87425f['name'];}_0x8c46a0[_0x5a92('0x1b')](_0x32c958)[_0x5a92('0x2d')](_0x87425f);};}exports[_0x5a92('0x2e')]=function(_0x4b1bbd,_0x4bb510){var _0x5a343b={},_0x3c3530={},_0x549545={'count':0x0,'rows':[]};var _0x5b3560=_['map'](db[_0x5a92('0x2f')]['rawAttributes'],function(_0x8bdc09){return{'name':_0x8bdc09[_0x5a92('0x30')],'type':_0x8bdc09[_0x5a92('0x31')][_0x5a92('0x32')]};});_0x3c3530['model']=_[_0x5a92('0x33')](_0x5b3560,_0x5a92('0x2c'));_0x3c3530[_0x5a92('0x34')]=_['keys'](_0x4b1bbd[_0x5a92('0x34')]);_0x3c3530[_0x5a92('0x35')]=_[_0x5a92('0x36')](_0x3c3530[_0x5a92('0x37')],_0x3c3530[_0x5a92('0x34')]);_0x5a343b[_0x5a92('0x38')]=_[_0x5a92('0x36')](_0x3c3530[_0x5a92('0x37')],qs[_0x5a92('0x39')](_0x4b1bbd[_0x5a92('0x34')][_0x5a92('0x39')]));_0x5a343b[_0x5a92('0x38')]=_0x5a343b[_0x5a92('0x38')][_0x5a92('0x3a')]?_0x5a343b[_0x5a92('0x38')]:_0x3c3530[_0x5a92('0x37')];if(!_0x4b1bbd[_0x5a92('0x34')]['hasOwnProperty'](_0x5a92('0x3b'))){_0x5a343b[_0x5a92('0x1f')]=qs[_0x5a92('0x1f')](_0x4b1bbd[_0x5a92('0x34')][_0x5a92('0x1f')]);_0x5a343b['offset']=qs[_0x5a92('0x1d')](_0x4b1bbd[_0x5a92('0x34')][_0x5a92('0x1d')]);}_0x5a343b[_0x5a92('0x3c')]=qs['sort'](_0x4b1bbd['query']['sort']);_0x5a343b[_0x5a92('0x3d')]=qs[_0x5a92('0x35')](_[_0x5a92('0x3e')](_0x4b1bbd[_0x5a92('0x34')],_0x3c3530[_0x5a92('0x35')]),_0x5b3560);if(_0x4b1bbd[_0x5a92('0x34')][_0x5a92('0x3f')]){_0x5a343b['where']=_['merge'](_0x5a343b[_0x5a92('0x3d')],{'$or':_[_0x5a92('0x33')](_0x5b3560,function(_0x35a24a){if(_0x35a24a['type']!=='VIRTUAL'){var _0x10599e={};_0x10599e[_0x35a24a[_0x5a92('0x2c')]]={'$like':'%'+_0x4b1bbd[_0x5a92('0x34')][_0x5a92('0x3f')]+'%'};return _0x10599e;}})});}_0x5a343b=_[_0x5a92('0x40')]({},_0x5a343b,_0x4b1bbd[_0x5a92('0x41')]);var _0x5de4a6={'where':_0x5a343b['where']};return db['Trigger'][_0x5a92('0x1e')](_0x5de4a6)['then'](function(_0xbf6ab1){_0x549545[_0x5a92('0x1e')]=_0xbf6ab1;if(_0x4b1bbd[_0x5a92('0x34')]['includeAll']){_0x5a343b['include']=[{'all':!![]}];}return db[_0x5a92('0x2f')]['findAll'](_0x5a343b);})['then'](function(_0x49a928){_0x549545[_0x5a92('0x42')]=_0x49a928;return _0x549545;})[_0x5a92('0x25')](respondWithFilteredResult(_0x4bb510,_0x5a343b))['catch'](handleError(_0x4bb510,null));};exports[_0x5a92('0x43')]=function(_0x4e704b,_0x17be01){var _0x429141={'raw':![],'where':{'id':_0x4e704b[_0x5a92('0x44')]['id']}},_0x306863={};_0x306863['model']=_[_0x5a92('0x45')](db[_0x5a92('0x2f')][_0x5a92('0x46')]);_0x306863[_0x5a92('0x34')]=_['keys'](_0x4e704b[_0x5a92('0x34')]);_0x306863[_0x5a92('0x35')]=_[_0x5a92('0x36')](_0x306863[_0x5a92('0x37')],_0x306863[_0x5a92('0x34')]);_0x429141[_0x5a92('0x38')]=_[_0x5a92('0x36')](_0x306863[_0x5a92('0x37')],qs[_0x5a92('0x39')](_0x4e704b[_0x5a92('0x34')][_0x5a92('0x39')]));_0x429141[_0x5a92('0x38')]=_0x429141[_0x5a92('0x38')][_0x5a92('0x3a')]?_0x429141[_0x5a92('0x38')]:_0x306863[_0x5a92('0x37')];if(_0x4e704b[_0x5a92('0x34')][_0x5a92('0x47')]){_0x429141[_0x5a92('0x48')]=[{'all':!![]}];}_0x429141=_[_0x5a92('0x40')]({},_0x429141,_0x4e704b[_0x5a92('0x41')]);return db[_0x5a92('0x2f')][_0x5a92('0x49')](_0x429141)[_0x5a92('0x25')](handleEntityNotFound(_0x17be01,null))['then'](respondWithResult(_0x17be01,null))[_0x5a92('0x4a')](handleError(_0x17be01,null));};exports[_0x5a92('0x4b')]=function(_0x3cd64f,_0x289df3){return db[_0x5a92('0x2f')][_0x5a92('0x4b')](_0x3cd64f[_0x5a92('0x4c')],{})[_0x5a92('0x25')](function(_0x3d7636){var _0x5c5c51=_0x3cd64f[_0x5a92('0x4d')]['get']({'plain':!![]});if(!_0x5c5c51)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5c5c51[_0x5a92('0x4e')]===_0x5a92('0x4d')){var _0x1988ab=_0x3d7636[_0x5a92('0x27')]({'plain':!![]});var _0xe9679e=_0x5a92('0x28');return db[_0x5a92('0x4f')][_0x5a92('0x49')]({'where':{'name':_0xe9679e,'userProfileId':_0x5c5c51[_0x5a92('0x50')]},'raw':!![]})['then'](function(_0xc8cb15){if(_0xc8cb15&&_0xc8cb15[_0x5a92('0x51')]===0x0){return db['UserProfileResource']['create']({'name':_0x1988ab[_0x5a92('0x2c')],'resourceId':_0x1988ab['id'],'type':_0xc8cb15[_0x5a92('0x2c')],'sectionId':_0xc8cb15['id']},{})[_0x5a92('0x25')](function(){return _0x3d7636;});}else{return _0x3d7636;}})['catch'](function(_0x40788f){logger[_0x5a92('0x2b')](_0x5a92('0x52'),_0x40788f);throw _0x40788f;});}return _0x3d7636;})['then'](respondWithResult(_0x289df3,0xc9))[_0x5a92('0x4a')](handleError(_0x289df3,null));};exports[_0x5a92('0x53')]=function(_0x488e39,_0x2b6c89){if(_0x488e39[_0x5a92('0x4c')]['id']){delete _0x488e39['body']['id'];}return db[_0x5a92('0x2f')][_0x5a92('0x49')]({'where':{'id':_0x488e39[_0x5a92('0x44')]['id']}})[_0x5a92('0x25')](handleEntityNotFound(_0x2b6c89,null))['then'](saveUpdates(_0x488e39['body'],null))[_0x5a92('0x25')](respondWithResult(_0x2b6c89,null))['catch'](handleError(_0x2b6c89,null));};exports['destroy']=function(_0x434c1f,_0x4c0ee9){return db[_0x5a92('0x2f')]['find']({'where':{'id':_0x434c1f['params']['id']}})['then'](handleEntityNotFound(_0x4c0ee9,null))['then'](removeEntity(_0x4c0ee9,null))[_0x5a92('0x4a')](handleError(_0x4c0ee9,null));};exports[_0x5a92('0x54')]=function(_0x4fa5af,_0x4b2cfb,_0x3c8373){if(_0x4fa5af[_0x5a92('0x4c')]['id']){delete _0x4fa5af[_0x5a92('0x4c')]['id'];}return db['Trigger'][_0x5a92('0x49')]({'where':{'id':_0x4fa5af[_0x5a92('0x44')]['id']}})[_0x5a92('0x25')](handleEntityNotFound(_0x4b2cfb,null))[_0x5a92('0x25')](function(_0xeb6902){if(_0xeb6902){_0x4fa5af[_0x5a92('0x4c')][_0x5a92('0x55')]=_0xeb6902['id'];return db[_0x5a92('0x56')][_0x5a92('0x4b')](_0x4fa5af[_0x5a92('0x4c')]);}})[_0x5a92('0x25')](respondWithResult(_0x4b2cfb,null))[_0x5a92('0x4a')](handleError(_0x4b2cfb,null));};exports[_0x5a92('0x57')]=function(_0x237536,_0x17a18b,_0x55eff7){if(_0x237536['body']['id']){delete _0x237536['body']['id'];}return db[_0x5a92('0x2f')]['find']({'where':{'id':_0x237536[_0x5a92('0x44')]['id']}})['then'](handleEntityNotFound(_0x17a18b,null))[_0x5a92('0x25')](function(_0x1b1ea1){if(_0x1b1ea1){_0x237536['body'][_0x5a92('0x58')]=_0x1b1ea1['id'];return db['Condition'][_0x5a92('0x4b')](_0x237536[_0x5a92('0x4c')]);}})[_0x5a92('0x25')](respondWithResult(_0x17a18b,null))[_0x5a92('0x4a')](handleError(_0x17a18b,null));};exports[_0x5a92('0x59')]=function(_0x3f1806,_0x44cde9,_0x27eae1){var _0x418b97={};var _0x5274da={};var _0xf5c296;var _0x1fc2a5;return db[_0x5a92('0x2f')][_0x5a92('0x5a')]({'where':{'id':_0x3f1806[_0x5a92('0x44')]['id']}})[_0x5a92('0x25')](handleEntityNotFound(_0x44cde9,null))[_0x5a92('0x25')](function(_0x4976f9){if(_0x4976f9){_0xf5c296=_0x4976f9;_0x5274da[_0x5a92('0x37')]=_[_0x5a92('0x45')](db[_0x5a92('0x56')][_0x5a92('0x46')]);_0x5274da['query']=_[_0x5a92('0x45')](_0x3f1806[_0x5a92('0x34')]);_0x5274da[_0x5a92('0x35')]=_[_0x5a92('0x36')](_0x5274da[_0x5a92('0x37')],_0x5274da[_0x5a92('0x34')]);_0x418b97['attributes']=_[_0x5a92('0x36')](_0x5274da[_0x5a92('0x37')],qs[_0x5a92('0x39')](_0x3f1806[_0x5a92('0x34')][_0x5a92('0x39')]));_0x418b97[_0x5a92('0x38')]=_0x418b97[_0x5a92('0x38')][_0x5a92('0x3a')]?_0x418b97[_0x5a92('0x38')]:_0x5274da[_0x5a92('0x37')];_0x418b97[_0x5a92('0x3c')]=qs['sort'](_0x3f1806[_0x5a92('0x34')][_0x5a92('0x5b')]);_0x418b97['where']=qs[_0x5a92('0x35')](_[_0x5a92('0x3e')](_0x3f1806['query'],_0x5274da[_0x5a92('0x35')]));if(_0x3f1806[_0x5a92('0x34')]['filter']){_0x418b97[_0x5a92('0x3d')]=_[_0x5a92('0x40')](_0x418b97[_0x5a92('0x3d')],{'$or':_['map'](_0x418b97[_0x5a92('0x38')],function(_0x5b146c){var _0x15dad3={};_0x15dad3[_0x5b146c]={'$like':'%'+_0x3f1806['query']['filter']+'%'};return _0x15dad3;})});}_0x418b97=_[_0x5a92('0x40')]({},_0x418b97,_0x3f1806[_0x5a92('0x41')]);return _0xf5c296[_0x5a92('0x59')](_0x418b97);}})[_0x5a92('0x25')](function(_0x466b73){if(_0x466b73){_0x1fc2a5=_0x466b73[_0x5a92('0x3a')];if(!_0x3f1806[_0x5a92('0x34')][_0x5a92('0x5c')](_0x5a92('0x3b'))){_0x418b97[_0x5a92('0x1f')]=qs[_0x5a92('0x1f')](_0x3f1806[_0x5a92('0x34')][_0x5a92('0x1f')]);_0x418b97['offset']=qs[_0x5a92('0x1d')](_0x3f1806[_0x5a92('0x34')][_0x5a92('0x1d')]);}return _0xf5c296['getAllConditions'](_0x418b97);}})[_0x5a92('0x25')](function(_0x58b83e){if(_0x58b83e){return _0x58b83e?{'count':_0x1fc2a5,'rows':_0x58b83e}:null;}})[_0x5a92('0x25')](respondWithResult(_0x44cde9,null))['catch'](handleError(_0x44cde9,null));};exports[_0x5a92('0x5d')]=function(_0x34447d,_0x506740,_0x62496c){var _0x3bb925={};var _0x46cc35={};var _0x2cf488;var _0xaf72b0;return db[_0x5a92('0x2f')][_0x5a92('0x5a')]({'where':{'id':_0x34447d[_0x5a92('0x44')]['id']}})[_0x5a92('0x25')](handleEntityNotFound(_0x506740,null))[_0x5a92('0x25')](function(_0x16195f){if(_0x16195f){_0x2cf488=_0x16195f;_0x46cc35[_0x5a92('0x37')]=_[_0x5a92('0x45')](db[_0x5a92('0x56')][_0x5a92('0x46')]);_0x46cc35[_0x5a92('0x34')]=_[_0x5a92('0x45')](_0x34447d[_0x5a92('0x34')]);_0x46cc35['filters']=_[_0x5a92('0x36')](_0x46cc35[_0x5a92('0x37')],_0x46cc35[_0x5a92('0x34')]);_0x3bb925['attributes']=_['intersection'](_0x46cc35[_0x5a92('0x37')],qs[_0x5a92('0x39')](_0x34447d['query'][_0x5a92('0x39')]));_0x3bb925[_0x5a92('0x38')]=_0x3bb925['attributes'][_0x5a92('0x3a')]?_0x3bb925['attributes']:_0x46cc35[_0x5a92('0x37')];_0x3bb925['order']=qs[_0x5a92('0x5b')](_0x34447d[_0x5a92('0x34')][_0x5a92('0x5b')]);_0x3bb925[_0x5a92('0x3d')]=qs['filters'](_[_0x5a92('0x3e')](_0x34447d[_0x5a92('0x34')],_0x46cc35[_0x5a92('0x35')]));if(_0x34447d[_0x5a92('0x34')][_0x5a92('0x3f')]){_0x3bb925[_0x5a92('0x3d')]=_['merge'](_0x3bb925['where'],{'$or':_['map'](_0x3bb925[_0x5a92('0x38')],function(_0x1922ea){var _0x797bfd={};_0x797bfd[_0x1922ea]={'$like':'%'+_0x34447d[_0x5a92('0x34')][_0x5a92('0x3f')]+'%'};return _0x797bfd;})});}_0x3bb925=_['merge']({},_0x3bb925,_0x34447d[_0x5a92('0x41')]);return _0x2cf488[_0x5a92('0x5d')](_0x3bb925);}})['then'](function(_0x1b7be0){if(_0x1b7be0){_0xaf72b0=_0x1b7be0[_0x5a92('0x3a')];if(!_0x34447d[_0x5a92('0x34')]['hasOwnProperty'](_0x5a92('0x3b'))){_0x3bb925[_0x5a92('0x1f')]=qs[_0x5a92('0x1f')](_0x34447d[_0x5a92('0x34')][_0x5a92('0x1f')]);_0x3bb925[_0x5a92('0x1d')]=qs[_0x5a92('0x1d')](_0x34447d[_0x5a92('0x34')][_0x5a92('0x1d')]);}return _0x2cf488[_0x5a92('0x5d')](_0x3bb925);}})[_0x5a92('0x25')](function(_0x2e6116){if(_0x2e6116){return _0x2e6116?{'count':_0xaf72b0,'rows':_0x2e6116}:null;}})[_0x5a92('0x25')](respondWithResult(_0x506740,null))[_0x5a92('0x4a')](handleError(_0x506740,null));};exports[_0x5a92('0x5e')]=function(_0x1a140b,_0x5533d6,_0x1bd3bf){if(_0x1a140b[_0x5a92('0x4c')]['id']){delete _0x1a140b[_0x5a92('0x4c')]['id'];}return db['Trigger']['find']({'where':{'id':_0x1a140b['params']['id']}})[_0x5a92('0x25')](handleEntityNotFound(_0x5533d6,null))[_0x5a92('0x25')](function(_0x56569a){if(_0x56569a){_0x1a140b[_0x5a92('0x4c')]['TriggerId']=_0x56569a['id'];return db[_0x5a92('0x5f')][_0x5a92('0x4b')](_0x1a140b[_0x5a92('0x4c')]);}})[_0x5a92('0x25')](respondWithResult(_0x5533d6,null))['catch'](handleError(_0x5533d6,null));};exports[_0x5a92('0x60')]=function(_0x28f899,_0x14ad76,_0xea0287){var _0x5c1cb4={};var _0x3186eb={};var _0x52c10d;var _0x4e1986;return db['Trigger'][_0x5a92('0x5a')]({'where':{'id':_0x28f899['params']['id']}})[_0x5a92('0x25')](handleEntityNotFound(_0x14ad76,null))[_0x5a92('0x25')](function(_0x1badf4){if(_0x1badf4){_0x52c10d=_0x1badf4;_0x3186eb[_0x5a92('0x37')]=_['keys'](db[_0x5a92('0x5f')]['rawAttributes']);_0x3186eb[_0x5a92('0x34')]=_[_0x5a92('0x45')](_0x28f899[_0x5a92('0x34')]);_0x3186eb[_0x5a92('0x35')]=_[_0x5a92('0x36')](_0x3186eb[_0x5a92('0x37')],_0x3186eb['query']);_0x5c1cb4[_0x5a92('0x38')]=_['intersection'](_0x3186eb[_0x5a92('0x37')],qs['fields'](_0x28f899[_0x5a92('0x34')]['fields']));_0x5c1cb4[_0x5a92('0x38')]=_0x5c1cb4[_0x5a92('0x38')][_0x5a92('0x3a')]?_0x5c1cb4[_0x5a92('0x38')]:_0x3186eb[_0x5a92('0x37')];_0x5c1cb4[_0x5a92('0x3c')]=qs[_0x5a92('0x5b')](_0x28f899[_0x5a92('0x34')]['sort']);_0x5c1cb4[_0x5a92('0x3d')]=qs[_0x5a92('0x35')](_[_0x5a92('0x3e')](_0x28f899[_0x5a92('0x34')],_0x3186eb[_0x5a92('0x35')]));if(_0x28f899['query'][_0x5a92('0x3f')]){_0x5c1cb4[_0x5a92('0x3d')]=_[_0x5a92('0x40')](_0x5c1cb4[_0x5a92('0x3d')],{'$or':_[_0x5a92('0x33')](_0x5c1cb4['attributes'],function(_0x25539c){var _0x20689e={};_0x20689e[_0x25539c]={'$like':'%'+_0x28f899['query'][_0x5a92('0x3f')]+'%'};return _0x20689e;})});}_0x5c1cb4=_['merge']({},_0x5c1cb4,_0x28f899[_0x5a92('0x41')]);return _0x52c10d[_0x5a92('0x60')](_0x5c1cb4);}})[_0x5a92('0x25')](function(_0x2d3132){if(_0x2d3132){_0x4e1986=_0x2d3132[_0x5a92('0x3a')];if(!_0x28f899[_0x5a92('0x34')][_0x5a92('0x5c')](_0x5a92('0x3b'))){_0x5c1cb4[_0x5a92('0x1f')]=qs[_0x5a92('0x1f')](_0x28f899['query'][_0x5a92('0x1f')]);_0x5c1cb4[_0x5a92('0x1d')]=qs[_0x5a92('0x1d')](_0x28f899[_0x5a92('0x34')][_0x5a92('0x1d')]);}return _0x52c10d[_0x5a92('0x60')](_0x5c1cb4);}})['then'](function(_0x30cdaf){if(_0x30cdaf){return _0x30cdaf?{'count':_0x4e1986,'rows':_0x30cdaf}:null;}})[_0x5a92('0x25')](respondWithResult(_0x14ad76,null))[_0x5a92('0x4a')](handleError(_0x14ad76,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 7792129..b9d070e 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 _0xa74a=['path','rimraf','../../config/environment','define','Trigger','tools_triggers','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x5179d3,_0x6e0e2){var _0x3401a4=function(_0x5ba281){while(--_0x5ba281){_0x5179d3['push'](_0x5179d3['shift']());}};_0x3401a4(++_0x6e0e2);}(_0xa74a,0x66));var _0xaa74=function(_0x2f6e43,_0x1f9724){_0x2f6e43=_0x2f6e43-0x0;var _0x4baf0d=_0xa74a[_0x2f6e43];return _0x4baf0d;};'use strict';var _=require(_0xaa74('0x0'));var util=require(_0xaa74('0x1'));var logger=require(_0xaa74('0x2'))(_0xaa74('0x3'));var moment=require(_0xaa74('0x4'));var BPromise=require(_0xaa74('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaa74('0x6'));var rimraf=require(_0xaa74('0x7'));var config=require(_0xaa74('0x8'));var attributes=require('./trigger.attributes');module['exports']=function(_0x24eee1,_0x44250c){return _0x24eee1[_0xaa74('0x9')](_0xaa74('0xa'),attributes,{'tableName':_0xaa74('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8e63=['exports','define','Trigger','tools_triggers','util','moment','bluebird','request-promise','../../config/environment','./trigger.attributes'];(function(_0x34bcf6,_0x2cc521){var _0x54adc9=function(_0x2a8f15){while(--_0x2a8f15){_0x34bcf6['push'](_0x34bcf6['shift']());}};_0x54adc9(++_0x2cc521);}(_0x8e63,0x7c));var _0x38e6=function(_0x1183c0,_0x19d724){_0x1183c0=_0x1183c0-0x0;var _0x199e8e=_0x8e63[_0x1183c0];return _0x199e8e;};'use strict';var _=require('lodash');var util=require(_0x38e6('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x38e6('0x1'));var BPromise=require(_0x38e6('0x2'));var rp=require(_0x38e6('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x38e6('0x4'));var attributes=require(_0x38e6('0x5'));module[_0x38e6('0x6')]=function(_0x5af45e,_0x3048c0){return _0x5af45e[_0x38e6('0x7')](_0x38e6('0x8'),attributes,{'tableName':_0x38e6('0x9'),'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 0b88575..2317971 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 _0x2256=['include','model','then','info','find','ShowTrigger','lodash','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','request\x20sent','debug','stringify','error','code','Trigger,\x20%s,\x20%s','message','result','catch','GetTrigger','Trigger','findAll','options','raw','where','attributes','map'];(function(_0x3221cd,_0x4a4a4a){var _0x21a689=function(_0x375599){while(--_0x375599){_0x3221cd['push'](_0x3221cd['shift']());}};_0x21a689(++_0x4a4a4a);}(_0x2256,0x166));var _0x6225=function(_0x1ffba8,_0x228e72){_0x1ffba8=_0x1ffba8-0x0;var _0x285818=_0x2256[_0x1ffba8];return _0x285818;};'use strict';var _=require(_0x6225('0x0'));var util=require('util');var moment=require(_0x6225('0x1'));var BPromise=require(_0x6225('0x2'));var rs=require(_0x6225('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6225('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6225('0x5'));var config=require(_0x6225('0x6'));var jayson=require(_0x6225('0x7'));var client=jayson[_0x6225('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5e0fe4,_0x48cada,_0x131ff8){return new BPromise(function(_0x42336e,_0x21949e){return client['request'](_0x5e0fe4,_0x131ff8)['then'](function(_0x2fe29e){logger['info']('Trigger,\x20%s,\x20%s',_0x48cada,_0x6225('0x9'));logger[_0x6225('0xa')]('Trigger,\x20%s,\x20%s,\x20%s',_0x48cada,_0x6225('0x9'),JSON[_0x6225('0xb')](_0x2fe29e));if(_0x2fe29e[_0x6225('0xc')]){if(_0x2fe29e[_0x6225('0xc')][_0x6225('0xd')]===0x1f4){logger['error'](_0x6225('0xe'),_0x48cada,_0x2fe29e[_0x6225('0xc')][_0x6225('0xf')]);return _0x21949e(_0x2fe29e[_0x6225('0xc')]['message']);}logger[_0x6225('0xc')](_0x6225('0xe'),_0x48cada,_0x2fe29e[_0x6225('0xc')][_0x6225('0xf')]);return _0x42336e(_0x2fe29e[_0x6225('0xc')][_0x6225('0xf')]);}else{logger['info'](_0x6225('0xe'),_0x48cada,_0x6225('0x9'));_0x42336e(_0x2fe29e[_0x6225('0x10')][_0x6225('0xf')]);}})[_0x6225('0x11')](function(_0x3dca74){logger['error']('Trigger,\x20%s,\x20%s',_0x48cada,_0x3dca74);_0x21949e(_0x3dca74);});});}exports[_0x6225('0x12')]=function(_0x3a53ba){var _0x1518a9=this;return new Promise(function(_0x4f3b12,_0x1edaf8){return db[_0x6225('0x13')][_0x6225('0x14')]({'raw':_0x3a53ba[_0x6225('0x15')]?_0x3a53ba[_0x6225('0x15')][_0x6225('0x16')]===undefined?!![]:![]:!![],'where':_0x3a53ba[_0x6225('0x15')]?_0x3a53ba['options'][_0x6225('0x17')]||null:null,'attributes':_0x3a53ba[_0x6225('0x15')]?_0x3a53ba['options'][_0x6225('0x18')]||null:null,'limit':_0x3a53ba[_0x6225('0x15')]?_0x3a53ba[_0x6225('0x15')]['limit']||null:null,'include':_0x3a53ba['options']?_0x3a53ba[_0x6225('0x15')]['include']?_[_0x6225('0x19')](_0x3a53ba['options'][_0x6225('0x1a')],function(_0x58f3fa){return{'model':db[_0x58f3fa['model']],'as':_0x58f3fa['as'],'attributes':_0x58f3fa['attributes'],'include':_0x58f3fa[_0x6225('0x1a')]?_[_0x6225('0x19')](_0x58f3fa[_0x6225('0x1a')],function(_0x4568c1){return{'model':db[_0x4568c1[_0x6225('0x1b')]],'as':_0x4568c1['as'],'attributes':_0x4568c1['attributes'],'include':_0x4568c1[_0x6225('0x1a')]?_['map'](_0x4568c1[_0x6225('0x1a')],function(_0x2e1c0e){return{'model':db[_0x2e1c0e[_0x6225('0x1b')]],'as':_0x2e1c0e['as'],'attributes':_0x2e1c0e[_0x6225('0x18')]};}):[]};}):[]};}):[]:[]})[_0x6225('0x1c')](function(_0x1372f3){logger[_0x6225('0x1d')]('GetTrigger',_0x3a53ba);logger[_0x6225('0xa')](_0x6225('0x12'),_0x3a53ba,JSON['stringify'](_0x1372f3));_0x4f3b12(_0x1372f3);})[_0x6225('0x11')](function(_0x28ea8c){logger['error']('GetTrigger',_0x28ea8c[_0x6225('0xf')],_0x3a53ba);_0x1edaf8(_0x1518a9[_0x6225('0xc')](0x1f4,_0x28ea8c['message']));});});};exports['ShowTrigger']=function(_0x5078a0){var _0x410291=this;return new Promise(function(_0xe9ecbe,_0x156f59){return db[_0x6225('0x13')][_0x6225('0x1e')]({'raw':_0x5078a0[_0x6225('0x15')]?_0x5078a0[_0x6225('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x5078a0[_0x6225('0x15')]?_0x5078a0[_0x6225('0x15')][_0x6225('0x17')]||null:null,'attributes':_0x5078a0[_0x6225('0x15')]?_0x5078a0['options'][_0x6225('0x18')]||null:null,'include':_0x5078a0['options']?_0x5078a0[_0x6225('0x15')][_0x6225('0x1a')]?_[_0x6225('0x19')](_0x5078a0[_0x6225('0x15')][_0x6225('0x1a')],function(_0x2d66d4){return{'model':db[_0x2d66d4[_0x6225('0x1b')]],'as':_0x2d66d4['as'],'attributes':_0x2d66d4[_0x6225('0x18')],'include':_0x2d66d4[_0x6225('0x1a')]?_[_0x6225('0x19')](_0x2d66d4[_0x6225('0x1a')],function(_0x50d0fe){return{'model':db[_0x50d0fe[_0x6225('0x1b')]],'as':_0x50d0fe['as'],'attributes':_0x50d0fe[_0x6225('0x18')],'include':_0x50d0fe['include']?_[_0x6225('0x19')](_0x50d0fe['include'],function(_0x5a50bf){return{'model':db[_0x5a50bf[_0x6225('0x1b')]],'as':_0x5a50bf['as'],'attributes':_0x5a50bf[_0x6225('0x18')]};}):[]};}):[]};}):[]:[]})[_0x6225('0x1c')](function(_0x54e02f){logger['info']('ShowTrigger',_0x5078a0);logger[_0x6225('0xa')](_0x6225('0x1f'),_0x5078a0,JSON['stringify'](_0x54e02f));_0xe9ecbe(_0x54e02f);})[_0x6225('0x11')](function(_0x1bfd36){logger[_0x6225('0xc')](_0x6225('0x1f'),_0x1bfd36[_0x6225('0xf')],_0x5078a0);_0x156f59(_0x410291[_0x6225('0xc')](0x1f4,_0x1bfd36['message']));});});}; \ No newline at end of file +var _0x1f43=['error','message','info','result','GetTrigger','findAll','options','raw','where','limit','include','map','attributes','model','catch','ShowTrigger','Trigger','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','then','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x6dcfe7,_0x44b8e8){var _0x6d0996=function(_0x79d45d){while(--_0x79d45d){_0x6dcfe7['push'](_0x6dcfe7['shift']());}};_0x6d0996(++_0x44b8e8);}(_0x1f43,0x111));var _0x31f4=function(_0x2896c8,_0xc4fe3b){_0x2896c8=_0x2896c8-0x0;var _0x3f18e5=_0x1f43[_0x2896c8];return _0x3f18e5;};'use strict';var _=require('lodash');var util=require(_0x31f4('0x0'));var moment=require(_0x31f4('0x1'));var BPromise=require(_0x31f4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x31f4('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x31f4('0x4'));var logger=require(_0x31f4('0x5'))('rpc');var config=require(_0x31f4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x31f4('0x7')][_0x31f4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4d8de0,_0x5bead0,_0x53258e){return new BPromise(function(_0x312cc4,_0x372cd5){return client['request'](_0x4d8de0,_0x53258e)[_0x31f4('0x9')](function(_0x15e5f3){logger['info'](_0x31f4('0xa'),_0x5bead0,_0x31f4('0xb'));logger[_0x31f4('0xc')](_0x31f4('0xd'),_0x5bead0,'request\x20sent',JSON[_0x31f4('0xe')](_0x15e5f3));if(_0x15e5f3[_0x31f4('0xf')]){if(_0x15e5f3[_0x31f4('0xf')]['code']===0x1f4){logger[_0x31f4('0xf')](_0x31f4('0xa'),_0x5bead0,_0x15e5f3[_0x31f4('0xf')][_0x31f4('0x10')]);return _0x372cd5(_0x15e5f3[_0x31f4('0xf')][_0x31f4('0x10')]);}logger[_0x31f4('0xf')](_0x31f4('0xa'),_0x5bead0,_0x15e5f3[_0x31f4('0xf')][_0x31f4('0x10')]);return _0x312cc4(_0x15e5f3[_0x31f4('0xf')][_0x31f4('0x10')]);}else{logger[_0x31f4('0x11')](_0x31f4('0xa'),_0x5bead0,_0x31f4('0xb'));_0x312cc4(_0x15e5f3[_0x31f4('0x12')][_0x31f4('0x10')]);}})['catch'](function(_0x4b0261){logger[_0x31f4('0xf')](_0x31f4('0xa'),_0x5bead0,_0x4b0261);_0x372cd5(_0x4b0261);});});}exports[_0x31f4('0x13')]=function(_0x29684e){var _0x478d41=this;return new Promise(function(_0x2da9f1,_0x1d1f27){return db['Trigger'][_0x31f4('0x14')]({'raw':_0x29684e[_0x31f4('0x15')]?_0x29684e[_0x31f4('0x15')][_0x31f4('0x16')]===undefined?!![]:![]:!![],'where':_0x29684e['options']?_0x29684e[_0x31f4('0x15')][_0x31f4('0x17')]||null:null,'attributes':_0x29684e[_0x31f4('0x15')]?_0x29684e[_0x31f4('0x15')]['attributes']||null:null,'limit':_0x29684e['options']?_0x29684e[_0x31f4('0x15')][_0x31f4('0x18')]||null:null,'include':_0x29684e[_0x31f4('0x15')]?_0x29684e[_0x31f4('0x15')][_0x31f4('0x19')]?_[_0x31f4('0x1a')](_0x29684e['options'][_0x31f4('0x19')],function(_0x5c343e){return{'model':db[_0x5c343e['model']],'as':_0x5c343e['as'],'attributes':_0x5c343e[_0x31f4('0x1b')],'include':_0x5c343e[_0x31f4('0x19')]?_[_0x31f4('0x1a')](_0x5c343e[_0x31f4('0x19')],function(_0x2e0b78){return{'model':db[_0x2e0b78[_0x31f4('0x1c')]],'as':_0x2e0b78['as'],'attributes':_0x2e0b78[_0x31f4('0x1b')],'include':_0x2e0b78[_0x31f4('0x19')]?_[_0x31f4('0x1a')](_0x2e0b78['include'],function(_0x3491f6){return{'model':db[_0x3491f6[_0x31f4('0x1c')]],'as':_0x3491f6['as'],'attributes':_0x3491f6[_0x31f4('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x31f4('0x9')](function(_0x11e15f){logger[_0x31f4('0x11')](_0x31f4('0x13'),_0x29684e);logger['debug']('GetTrigger',_0x29684e,JSON[_0x31f4('0xe')](_0x11e15f));_0x2da9f1(_0x11e15f);})[_0x31f4('0x1d')](function(_0x39b275){logger[_0x31f4('0xf')](_0x31f4('0x13'),_0x39b275[_0x31f4('0x10')],_0x29684e);_0x1d1f27(_0x478d41[_0x31f4('0xf')](0x1f4,_0x39b275[_0x31f4('0x10')]));});});};exports[_0x31f4('0x1e')]=function(_0x30998f){var _0x16d4b5=this;return new Promise(function(_0x172b88,_0x22bbe6){return db[_0x31f4('0x1f')]['find']({'raw':_0x30998f[_0x31f4('0x15')]?_0x30998f[_0x31f4('0x15')][_0x31f4('0x16')]===undefined?!![]:![]:!![],'where':_0x30998f[_0x31f4('0x15')]?_0x30998f['options'][_0x31f4('0x17')]||null:null,'attributes':_0x30998f[_0x31f4('0x15')]?_0x30998f[_0x31f4('0x15')][_0x31f4('0x1b')]||null:null,'include':_0x30998f[_0x31f4('0x15')]?_0x30998f[_0x31f4('0x15')]['include']?_[_0x31f4('0x1a')](_0x30998f[_0x31f4('0x15')][_0x31f4('0x19')],function(_0xc291fb){return{'model':db[_0xc291fb[_0x31f4('0x1c')]],'as':_0xc291fb['as'],'attributes':_0xc291fb['attributes'],'include':_0xc291fb[_0x31f4('0x19')]?_[_0x31f4('0x1a')](_0xc291fb[_0x31f4('0x19')],function(_0x557ead){return{'model':db[_0x557ead[_0x31f4('0x1c')]],'as':_0x557ead['as'],'attributes':_0x557ead[_0x31f4('0x1b')],'include':_0x557ead[_0x31f4('0x19')]?_[_0x31f4('0x1a')](_0x557ead[_0x31f4('0x19')],function(_0x40908b){return{'model':db[_0x40908b[_0x31f4('0x1c')]],'as':_0x40908b['as'],'attributes':_0x40908b[_0x31f4('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x31f4('0x9')](function(_0x53852b){logger[_0x31f4('0x11')](_0x31f4('0x1e'),_0x30998f);logger[_0x31f4('0xc')]('ShowTrigger',_0x30998f,JSON[_0x31f4('0xe')](_0x53852b));_0x172b88(_0x53852b);})[_0x31f4('0x1d')](function(_0xc91c32){logger[_0x31f4('0xf')](_0x31f4('0x1e'),_0xc91c32[_0x31f4('0x10')],_0x30998f);_0x22bbe6(_0x16d4b5[_0x31f4('0xf')](0x1f4,_0xc91c32['message']));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 4f579ec..5a96c32 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 _0xa4fe=['connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','index','/:id','isAuthenticated','show','post','/:id/clone','clone','put','update','delete','exports','util'];(function(_0x159dde,_0x5c7c54){var _0x906871=function(_0x380b46){while(--_0x380b46){_0x159dde['push'](_0x159dde['shift']());}};_0x906871(++_0x5c7c54);}(_0xa4fe,0xc5));var _0xea4f=function(_0x5bfaf0,_0x2b69e1){_0x5bfaf0=_0x5bfaf0-0x0;var _0x2253a3=_0xa4fe[_0x5bfaf0];return _0x2253a3;};'use strict';var multer=require('multer');var util=require(_0xea4f('0x0'));var path=require('path');var timeout=require(_0xea4f('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xea4f('0x2'));var auth=require(_0xea4f('0x3'));var interaction=require(_0xea4f('0x4'));var config=require(_0xea4f('0x5'));var controller=require(_0xea4f('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xea4f('0x7')]);router['get'](_0xea4f('0x8'),auth[_0xea4f('0x9')](),controller[_0xea4f('0xa')]);router[_0xea4f('0xb')](_0xea4f('0xc'),auth[_0xea4f('0x9')](),controller[_0xea4f('0xd')]);router[_0xea4f('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0xea4f('0xe')]('/:id',auth[_0xea4f('0x9')](),controller[_0xea4f('0xf')]);router[_0xea4f('0x10')](_0xea4f('0x8'),auth['isAuthenticated'](),controller['destroy']);module[_0xea4f('0x11')]=router; \ No newline at end of file +var _0x66b0=['path','connect-timeout','Router','../../components/auth/service','./trunk.controller','get','isAuthenticated','/:id','post','/:id/clone','clone','update','delete','exports','util'];(function(_0x4337ca,_0xbb98f1){var _0x21dbde=function(_0x599290){while(--_0x599290){_0x4337ca['push'](_0x4337ca['shift']());}};_0x21dbde(++_0xbb98f1);}(_0x66b0,0xe0));var _0x066b=function(_0x2133b0,_0x3dab77){_0x2133b0=_0x2133b0-0x0;var _0x1c6751=_0x66b0[_0x2133b0];return _0x1c6751;};'use strict';var multer=require('multer');var util=require(_0x066b('0x0'));var path=require(_0x066b('0x1'));var timeout=require(_0x066b('0x2'));var express=require('express');var router=express[_0x066b('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x066b('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x066b('0x5'));router[_0x066b('0x6')]('/',auth[_0x066b('0x7')](),controller['index']);router['get'](_0x066b('0x8'),auth[_0x066b('0x7')](),controller['show']);router[_0x066b('0x9')](_0x066b('0xa'),auth[_0x066b('0x7')](),controller[_0x066b('0xb')]);router['post']('/',auth[_0x066b('0x7')](),controller['create']);router['put'](_0x066b('0x8'),auth[_0x066b('0x7')](),controller[_0x066b('0xc')]);router[_0x066b('0xd')](_0x066b('0x8'),auth[_0x066b('0x7')](),controller['destroy']);module[_0x066b('0xe')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index fbd3b99..7dd4c0a 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 _0xb4e0=['peer','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','STRING','setDataValue','transport','join','getDataValue','split','rfc2833','info','inband','yes','nonat','update','outgoing','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','INTEGER','always','accept','refuse','originate','uas','pai','fingerprint','certificate','actpass','dynamic','update,nonat','BOOLEAN','exports','name','ENUM','friend','user'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb4e0,0x1bd));var _0x0b4e=function(_0x562209,_0x53da55){_0x562209=_0x562209-0x0;var _0x4308f9=_0xb4e0[_0x562209];return _0x4308f9;};'use strict';var Sequelize=require('sequelize');module[_0x0b4e('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x0b4e('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x0b4e('0x2')](_0x0b4e('0x3'),_0x0b4e('0x4'),_0x0b4e('0x5')),'allowNull':![],'defaultValue':_0x0b4e('0x3')},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize[_0x0b4e('0x2')]('ALLOWED_NOT_SCREENED',_0x0b4e('0x6'),_0x0b4e('0x7'),_0x0b4e('0x8'),_0x0b4e('0x9'),_0x0b4e('0xa'),_0x0b4e('0xb'),_0x0b4e('0xc'))},'deny':{'type':Sequelize[_0x0b4e('0xd')]},'permit':{'type':Sequelize[_0x0b4e('0xd')]},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize[_0x0b4e('0xd')]},'transport':{'type':Sequelize[_0x0b4e('0xd')],'defaultValue':'udp','set':function(_0x8abd95){this[_0x0b4e('0xe')](_0x0b4e('0xf'),_0x8abd95?_0x8abd95[_0x0b4e('0x10')](','):null);},'get':function(){return this[_0x0b4e('0x11')](_0x0b4e('0xf'))?this['getDataValue'](_0x0b4e('0xf'))[_0x0b4e('0x12')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize['ENUM'](_0x0b4e('0x13'),_0x0b4e('0x14'),'shortinfo',_0x0b4e('0x15'),'auto'),'defaultValue':_0x0b4e('0x13')},'directmedia':{'type':Sequelize[_0x0b4e('0x2')](_0x0b4e('0x16'),'no',_0x0b4e('0x17'),_0x0b4e('0x18'),_0x0b4e('0x19')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x0b4e('0x2')](_0x0b4e('0x16'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x0b4e('0xd')]},'directmediadeny':{'type':Sequelize[_0x0b4e('0xd')]},'nat':{'type':Sequelize[_0x0b4e('0xd')],'defaultValue':'force_rport,comedia','set':function(_0x189d77){this[_0x0b4e('0xe')]('nat',_0x189d77?_0x189d77[_0x0b4e('0x10')](','):null);},'get':function(){return this[_0x0b4e('0x11')](_0x0b4e('0x1a'))?this[_0x0b4e('0x11')](_0x0b4e('0x1a'))[_0x0b4e('0x12')](','):null;},'comment':_0x0b4e('0x1b')},'callgroup':{'type':Sequelize[_0x0b4e('0xd')]},'namedcallgroup':{'type':Sequelize[_0x0b4e('0xd')]},'pickupgroup':{'type':Sequelize[_0x0b4e('0xd')]},'namedpickupgroup':{'type':Sequelize[_0x0b4e('0xd')]},'language':{'type':Sequelize[_0x0b4e('0xd')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x0b4e('0xd')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x0b4e('0xd')],'defaultValue':_0x0b4e('0x1c')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0b4e('0x1d'),'set':function(_0x1032af){this['setDataValue'](_0x0b4e('0x1e'),_0x1032af?_0x1032af[_0x0b4e('0x10')](';'):_0x0b4e('0x1d'));},'get':function(){return this[_0x0b4e('0x11')](_0x0b4e('0x1e'))?this['getDataValue'](_0x0b4e('0x1e'))['split'](';'):null;},'comment':_0x0b4e('0x1f')},'autoframing':{'type':Sequelize['ENUM'](_0x0b4e('0x16'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0x0b4e('0x20'),'set':function(_0x254f9c){this['setDataValue']('insecure',_0x254f9c?_0x254f9c[_0x0b4e('0x10')](','):null);},'get':function(){return this[_0x0b4e('0x11')](_0x0b4e('0x21'))?this[_0x0b4e('0x11')](_0x0b4e('0x21'))[_0x0b4e('0x12')](','):null;},'comment':_0x0b4e('0x22')},'trustrpid':{'type':Sequelize[_0x0b4e('0x2')]('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x0b4e('0x2')](_0x0b4e('0x16'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x0b4e('0x2')](_0x0b4e('0x16'),'no',_0x0b4e('0x23'))},'promiscredir':{'type':Sequelize[_0x0b4e('0x2')]('yes','no')},'useclientcode':{'type':Sequelize['ENUM'](_0x0b4e('0x16'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0x0b4e('0xd')]},'callerid':{'type':Sequelize[_0x0b4e('0xd')],'defaultValue':_0x0b4e('0x24')},'amaflags':{'type':Sequelize[_0x0b4e('0xd')]},'callcounter':{'type':Sequelize[_0x0b4e('0x2')](_0x0b4e('0x16'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x0b4e('0x25')](0xb)},'allowoverlap':{'type':Sequelize[_0x0b4e('0x2')](_0x0b4e('0x16'),'no')},'allowsubscribe':{'type':Sequelize[_0x0b4e('0x2')]('yes','no')},'allowtransfer':{'type':Sequelize[_0x0b4e('0x2')](_0x0b4e('0x16'),'no')},'ignoresdpversion':{'type':Sequelize[_0x0b4e('0x2')]('yes','no')},'subscribecontext':{'type':Sequelize[_0x0b4e('0xd')]},'template':{'type':Sequelize[_0x0b4e('0xd')]},'videosupport':{'type':Sequelize[_0x0b4e('0x2')](_0x0b4e('0x16'),'no',_0x0b4e('0x26')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x0b4e('0x25')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x0b4e('0x2')](_0x0b4e('0x16'),'no')},'mailbox':{'type':Sequelize[_0x0b4e('0xd')]},'session_timers':{'type':Sequelize[_0x0b4e('0x2')](_0x0b4e('0x27'),_0x0b4e('0x28'),_0x0b4e('0x29'))},'session_expires':{'type':Sequelize[_0x0b4e('0x25')](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize['ENUM']('uac',_0x0b4e('0x2a')),'defaultValue':_0x0b4e('0x2a')},'t38pt_usertpsource':{'type':Sequelize[_0x0b4e('0xd')]},'regexten':{'type':Sequelize[_0x0b4e('0xd')]},'fromdomain':{'type':Sequelize[_0x0b4e('0xd')]},'fromuser':{'type':Sequelize[_0x0b4e('0xd')]},'port':{'type':Sequelize[_0x0b4e('0x25')](0x5)},'qualify':{'type':Sequelize['ENUM'](_0x0b4e('0x16'),'no'),'defaultValue':_0x0b4e('0x16')},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0x0b4e('0xd')]},'defaultuser':{'type':Sequelize[_0x0b4e('0xd')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x0b4e('0x25')](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize['ENUM'](_0x0b4e('0x16'),'no',_0x0b4e('0x2b')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x0b4e('0xd')]},'callbackextension':{'type':Sequelize[_0x0b4e('0xd')]},'timert1':{'type':Sequelize[_0x0b4e('0x25')](0xb)},'timerb':{'type':Sequelize[_0x0b4e('0x25')](0xb)},'qualifyfreq':{'type':Sequelize[_0x0b4e('0x25')](0xb)},'contactpermit':{'type':Sequelize[_0x0b4e('0xd')]},'contactdeny':{'type':Sequelize[_0x0b4e('0xd')]},'contactacl':{'type':Sequelize[_0x0b4e('0xd')]},'unsolicited_mailbox':{'type':Sequelize[_0x0b4e('0xd')]},'use_q850_reason':{'type':Sequelize[_0x0b4e('0xd')]},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize[_0x0b4e('0x2')]('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x0b4e('0x2')](_0x0b4e('0x16'),'no')},'force_avp':{'type':Sequelize['ENUM']('yes','no')},'icesupport':{'type':Sequelize[_0x0b4e('0x2')](_0x0b4e('0x16'),'no')},'dtlsenable':{'type':Sequelize[_0x0b4e('0x2')](_0x0b4e('0x16'),'no')},'dtlsverify':{'type':Sequelize[_0x0b4e('0x2')](_0x0b4e('0x16'),'no',_0x0b4e('0x2c'),_0x0b4e('0x2d'))},'dtlsrekey':{'type':Sequelize[_0x0b4e('0x25')](0xb)},'dtlscertfile':{'type':Sequelize[_0x0b4e('0xd')]},'dtlsprivatekey':{'type':Sequelize[_0x0b4e('0xd')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0x0b4e('0xd')]},'dtlscapath':{'type':Sequelize[_0x0b4e('0xd')]},'dtlssetup':{'type':Sequelize[_0x0b4e('0x2')]('active','passive',_0x0b4e('0x2e')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x0b4e('0xd')]},'usereqphone':{'type':Sequelize[_0x0b4e('0x2')](_0x0b4e('0x16'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x0b4e('0xd')]},'recordofffeature':{'type':Sequelize[_0x0b4e('0xd')]},'call_limit':{'type':Sequelize[_0x0b4e('0x25')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x0b4e('0x2')](_0x0b4e('0x16'),'no')},'subscribemwi':{'type':Sequelize[_0x0b4e('0x2')](_0x0b4e('0x16'),'no')},'vmexten':{'type':Sequelize[_0x0b4e('0xd')]},'mohinterpret':{'type':Sequelize[_0x0b4e('0xd')]},'mohsuggest':{'type':Sequelize[_0x0b4e('0xd')]},'parkinglot':{'type':Sequelize[_0x0b4e('0xd')]},'description':{'type':Sequelize[_0x0b4e('0xd')]},'host':{'type':Sequelize[_0x0b4e('0xd')],'defaultValue':_0x0b4e('0x2f')},'canreinvite':{'type':Sequelize[_0x0b4e('0x2')](_0x0b4e('0x16'),'no',_0x0b4e('0x17'),_0x0b4e('0x18'),_0x0b4e('0x30')),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize[_0x0b4e('0xd')]},'active':{'type':Sequelize[_0x0b4e('0x31')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x0b4e('0xd')],'defaultValue':'no'}}; \ No newline at end of file +var _0x109c=['nonat','outgoing','nat','join','split','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','always','accept','refuse','uac','uas','fingerprint','passive','actpass','dynamic','update','BOOLEAN','STRING','ENUM','friend','user','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','transport','getDataValue','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes'];(function(_0x429e7e,_0x5ae693){var _0x22c7d7=function(_0x1d4c77){while(--_0x1d4c77){_0x429e7e['push'](_0x429e7e['shift']());}};_0x22c7d7(++_0x5ae693);}(_0x109c,0x139));var _0xc109=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x109c[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xc109('0x0')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xc109('0x1')](_0xc109('0x2'),_0xc109('0x3'),_0xc109('0x4')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0xc109('0x0')],'allowNull':![],'defaultValue':_0xc109('0x5')},'callingpres':{'type':Sequelize[_0xc109('0x1')](_0xc109('0x6'),'ALLOWED_PASSED_SCREEN',_0xc109('0x7'),_0xc109('0x8'),_0xc109('0x9'),'PROHIB_PASSED_SCREEN',_0xc109('0xa'),_0xc109('0xb'))},'deny':{'type':Sequelize[_0xc109('0x0')]},'permit':{'type':Sequelize[_0xc109('0x0')]},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize[_0xc109('0x0')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize[_0xc109('0x0')],'defaultValue':_0xc109('0xc'),'set':function(_0x4d9574){this[_0xc109('0xd')](_0xc109('0xe'),_0x4d9574?_0x4d9574['join'](','):null);},'get':function(){return this[_0xc109('0xf')](_0xc109('0xe'))?this['getDataValue'](_0xc109('0xe'))['split'](','):null;},'comment':_0xc109('0x10')},'dtmfmode':{'type':Sequelize[_0xc109('0x1')](_0xc109('0x11'),_0xc109('0x12'),_0xc109('0x13'),_0xc109('0x14'),_0xc109('0x15')),'defaultValue':_0xc109('0x11')},'directmedia':{'type':Sequelize[_0xc109('0x1')](_0xc109('0x16'),'no',_0xc109('0x17'),'update',_0xc109('0x18')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0xc109('0x16'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xc109('0x0')]},'directmediadeny':{'type':Sequelize[_0xc109('0x0')]},'nat':{'type':Sequelize[_0xc109('0x0')],'defaultValue':'force_rport,comedia','set':function(_0x33dcad){this['setDataValue'](_0xc109('0x19'),_0x33dcad?_0x33dcad[_0xc109('0x1a')](','):null);},'get':function(){return this[_0xc109('0xf')](_0xc109('0x19'))?this[_0xc109('0xf')](_0xc109('0x19'))[_0xc109('0x1b')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0xc109('0x0')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0xc109('0x0')]},'language':{'type':Sequelize[_0xc109('0x0')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':_0xc109('0x1c')},'allow':{'type':Sequelize[_0xc109('0x0')],'allowNull':![],'defaultValue':_0xc109('0x1d'),'set':function(_0x536af3){this[_0xc109('0xd')](_0xc109('0x1e'),_0x536af3?_0x536af3[_0xc109('0x1a')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0xc109('0xf')](_0xc109('0x1e'))?this[_0xc109('0xf')](_0xc109('0x1e'))[_0xc109('0x1b')](';'):null;},'comment':_0xc109('0x1f')},'autoframing':{'type':Sequelize[_0xc109('0x1')](_0xc109('0x16'),'no')},'insecure':{'type':Sequelize[_0xc109('0x0')],'defaultValue':_0xc109('0x20'),'set':function(_0x1afc30){this[_0xc109('0xd')](_0xc109('0x21'),_0x1afc30?_0x1afc30['join'](','):null);},'get':function(){return this[_0xc109('0xf')](_0xc109('0x21'))?this[_0xc109('0xf')](_0xc109('0x21'))[_0xc109('0x1b')](','):null;},'comment':_0xc109('0x22')},'trustrpid':{'type':Sequelize['ENUM'](_0xc109('0x16'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0xc109('0x16'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xc109('0x1')](_0xc109('0x16'),'no',_0xc109('0x23'))},'promiscredir':{'type':Sequelize[_0xc109('0x1')](_0xc109('0x16'),'no')},'useclientcode':{'type':Sequelize[_0xc109('0x1')](_0xc109('0x16'),'no')},'accountcode':{'type':Sequelize[_0xc109('0x24')](0xb)},'setvar':{'type':Sequelize[_0xc109('0x0')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0xc109('0x0')]},'callcounter':{'type':Sequelize[_0xc109('0x1')](_0xc109('0x16'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0xc109('0x24')](0xb)},'allowoverlap':{'type':Sequelize['ENUM']('yes','no')},'allowsubscribe':{'type':Sequelize['ENUM']('yes','no')},'allowtransfer':{'type':Sequelize[_0xc109('0x1')](_0xc109('0x16'),'no')},'ignoresdpversion':{'type':Sequelize[_0xc109('0x1')](_0xc109('0x16'),'no')},'subscribecontext':{'type':Sequelize[_0xc109('0x0')]},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize[_0xc109('0x1')](_0xc109('0x16'),'no',_0xc109('0x25')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xc109('0x24')](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM']('yes','no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize['ENUM'](_0xc109('0x26'),_0xc109('0x27'),'originate')},'session_expires':{'type':Sequelize[_0xc109('0x24')](0xb)},'session_minse':{'type':Sequelize[_0xc109('0x24')](0xb)},'session_refresher':{'type':Sequelize[_0xc109('0x1')](_0xc109('0x28'),_0xc109('0x29')),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize[_0xc109('0x0')]},'port':{'type':Sequelize[_0xc109('0x24')](0x5)},'qualify':{'type':Sequelize[_0xc109('0x1')](_0xc109('0x16'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0xc109('0x24')](0xb)},'defaultip':{'type':Sequelize[_0xc109('0x0')]},'defaultuser':{'type':Sequelize[_0xc109('0x0')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0xc109('0x24')](0xb)},'sendrpid':{'type':Sequelize[_0xc109('0x1')](_0xc109('0x16'),'no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xc109('0x0')]},'callbackextension':{'type':Sequelize[_0xc109('0x0')]},'timert1':{'type':Sequelize[_0xc109('0x24')](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize[_0xc109('0x24')](0xb)},'contactpermit':{'type':Sequelize[_0xc109('0x0')]},'contactdeny':{'type':Sequelize[_0xc109('0x0')]},'contactacl':{'type':Sequelize[_0xc109('0x0')]},'unsolicited_mailbox':{'type':Sequelize[_0xc109('0x0')]},'use_q850_reason':{'type':Sequelize[_0xc109('0x0')]},'maxforwards':{'type':Sequelize[_0xc109('0x24')](0xb)},'encryption':{'type':Sequelize[_0xc109('0x1')](_0xc109('0x16'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xc109('0x1')](_0xc109('0x16'),'no')},'force_avp':{'type':Sequelize[_0xc109('0x1')](_0xc109('0x16'),'no')},'icesupport':{'type':Sequelize[_0xc109('0x1')]('yes','no')},'dtlsenable':{'type':Sequelize[_0xc109('0x1')](_0xc109('0x16'),'no')},'dtlsverify':{'type':Sequelize['ENUM'](_0xc109('0x16'),'no',_0xc109('0x2a'),'certificate')},'dtlsrekey':{'type':Sequelize[_0xc109('0x24')](0xb)},'dtlscertfile':{'type':Sequelize[_0xc109('0x0')]},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0xc109('0x0')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0xc109('0x1')]('active',_0xc109('0x2b'),_0xc109('0x2c')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize['ENUM'](_0xc109('0x16'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xc109('0x0')]},'recordofffeature':{'type':Sequelize[_0xc109('0x0')]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xc109('0x1')](_0xc109('0x16'),'no')},'subscribemwi':{'type':Sequelize[_0xc109('0x1')](_0xc109('0x16'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0xc109('0x0')]},'mohsuggest':{'type':Sequelize[_0xc109('0x0')]},'parkinglot':{'type':Sequelize[_0xc109('0x0')]},'description':{'type':Sequelize[_0xc109('0x0')]},'host':{'type':Sequelize[_0xc109('0x0')],'defaultValue':_0xc109('0x2d')},'canreinvite':{'type':Sequelize[_0xc109('0x1')]('yes','no','nonat',_0xc109('0x2e'),'update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize[_0xc109('0x0')]},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xc109('0x2f')],'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 d22bde8..9ed4730 100644 --- a/server/api/trunk/trunk.controller.js +++ b/server/api/trunk/trunk.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6aa7=['sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','params','length','includeAll','clone','find','get','createdAt','body','omit','updatedAt','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','root','server/files/templates/trunk.ejs','render','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','autoAssociation','update','utf8','server/files/templates/registry.ejs','writeFileSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','http','then','Trunk,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','Trunks','UserProfileResource','stack','name','index','map','Trunk','rawAttributes','fieldName','type','model','query','keys','attributes','intersection','fields','order'];(function(_0x72fefb,_0x37ab29){var _0x166cb1=function(_0x493636){while(--_0x493636){_0x72fefb['push'](_0x72fefb['shift']());}};_0x166cb1(++_0x37ab29);}(_0x6aa7,0x178));var _0x76aa=function(_0x159a42,_0x5e3877){_0x159a42=_0x159a42-0x0;var _0x58838f=_0x6aa7[_0x159a42];return _0x58838f;};'use strict';var emlformat=require(_0x76aa('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x76aa('0x1'));var jsonpatch=require(_0x76aa('0x2'));var rp=require(_0x76aa('0x3'));var moment=require(_0x76aa('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x76aa('0x5'));var util=require(_0x76aa('0x6'));var path=require(_0x76aa('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x76aa('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x76aa('0x9'));var squel=require(_0x76aa('0xa'));var crypto=require(_0x76aa('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x76aa('0xc'));var toCsv=require(_0x76aa('0xd'));var querystring=require(_0x76aa('0xe'));var Papa=require('papaparse');var Redis=require(_0x76aa('0xf'));var authService=require(_0x76aa('0x10'));var qs=require(_0x76aa('0x11'));var as=require(_0x76aa('0x12'));var hardwareService=require(_0x76aa('0x13'));var logger=require(_0x76aa('0x14'))(_0x76aa('0x15'));var utils=require(_0x76aa('0x16'));var config=require(_0x76aa('0x17'));var licenseUtil=require(_0x76aa('0x18'));var db=require('../../mysqldb')['db'];var jayson=require(_0x76aa('0x19'));var client=jayson['client'][_0x76aa('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x12dde0,_0x3f8f6b,_0x8e44ed,_0x10432c){return new BPromise(function(_0x4e309f,_0x5f5b59){var _0x2b3b4f=_0x10432c||client;return _0x2b3b4f['request'](_0x12dde0,_0x8e44ed)[_0x76aa('0x1b')](function(_0x319bf1){logger['info'](_0x76aa('0x1c'),_0x3f8f6b,'request\x20sent');logger[_0x76aa('0x1d')]('Trunk,\x20%s,\x20%s,\x20%s',_0x3f8f6b,_0x76aa('0x1e'),JSON[_0x76aa('0x1f')](_0x319bf1));if(_0x319bf1[_0x76aa('0x20')]){if(_0x319bf1[_0x76aa('0x20')][_0x76aa('0x21')]===0x1f4){logger[_0x76aa('0x20')]('Trunk,\x20%s,\x20%s',_0x3f8f6b,_0x319bf1['error'][_0x76aa('0x22')]);return _0x5f5b59(_0x319bf1[_0x76aa('0x20')][_0x76aa('0x22')]);}logger[_0x76aa('0x20')](_0x76aa('0x1c'),_0x3f8f6b,_0x319bf1[_0x76aa('0x20')][_0x76aa('0x22')]);return _0x4e309f(_0x319bf1[_0x76aa('0x20')][_0x76aa('0x22')]);}else{logger['info'](_0x76aa('0x1c'),_0x3f8f6b,_0x76aa('0x1e'));_0x4e309f(_0x319bf1[_0x76aa('0x23')]['message']);}})[_0x76aa('0x24')](function(_0x189cb6){logger[_0x76aa('0x20')](_0x76aa('0x1c'),_0x3f8f6b,_0x189cb6);_0x5f5b59(_0x189cb6);});});}function respondWithStatusCode(_0x29c50c,_0xc1044c){_0xc1044c=_0xc1044c||0xcc;return function(_0x3cd039){if(_0x3cd039){return _0x29c50c[_0x76aa('0x25')](_0xc1044c);}return _0x29c50c[_0x76aa('0x26')](_0xc1044c)[_0x76aa('0x27')]();};}function respondWithResult(_0x37f1ab,_0x26b75e){_0x26b75e=_0x26b75e||0xc8;return function(_0x3599a9){if(_0x3599a9){return _0x37f1ab['status'](_0x26b75e)[_0x76aa('0x28')](_0x3599a9);}};}function respondWithFilteredResult(_0x1d6d15,_0x25c614){return function(_0x2e7ab4){if(_0x2e7ab4){var _0xa1e6=typeof _0x25c614[_0x76aa('0x29')]===_0x76aa('0x2a')&&typeof _0x25c614[_0x76aa('0x2b')]===_0x76aa('0x2a');var _0x1bdc3d=_0x2e7ab4['count'];var _0x3fcb7f=_0xa1e6?0x0:_0x25c614['offset'];var _0x994550=_0xa1e6?_0x2e7ab4[_0x76aa('0x2c')]:_0x25c614[_0x76aa('0x29')]+_0x25c614[_0x76aa('0x2b')];var _0x1eecd9;if(_0x994550>=_0x1bdc3d){_0x994550=_0x1bdc3d;_0x1eecd9=0xc8;}else{_0x1eecd9=0xce;}_0x1d6d15[_0x76aa('0x26')](_0x1eecd9);return _0x1d6d15[_0x76aa('0x2d')](_0x76aa('0x2e'),_0x3fcb7f+'-'+_0x994550+'/'+_0x1bdc3d)[_0x76aa('0x28')](_0x2e7ab4);}return null;};}function patchUpdates(_0x3ea05a){return function(_0x5edcd8){try{jsonpatch[_0x76aa('0x2f')](_0x5edcd8,_0x3ea05a,!![]);}catch(_0x5532c7){return BPromise[_0x76aa('0x30')](_0x5532c7);}return _0x5edcd8[_0x76aa('0x31')]();};}function saveUpdates(_0x458ac3,_0x38ecd1){return function(_0x35a705){if(_0x35a705){return _0x35a705['update'](_0x458ac3)[_0x76aa('0x1b')](function(_0x25a11f){return _0x25a11f;});}return null;};}function removeEntity(_0x5a0f72,_0x2ee338){return function(_0x58d860){if(_0x58d860){return _0x58d860[_0x76aa('0x32')]()['then'](function(){var _0x8479a3=_0x58d860['get']({'plain':!![]});var _0x58f135=_0x76aa('0x33');return db[_0x76aa('0x34')][_0x76aa('0x32')]({'where':{'type':_0x58f135,'resourceId':_0x8479a3['id']}})[_0x76aa('0x1b')](function(){return _0x58d860;});})['then'](function(){_0x5a0f72['status'](0xcc)[_0x76aa('0x27')]();});}};}function handleEntityNotFound(_0x1c7b6f,_0x58127c){return function(_0x23e2fd){if(!_0x23e2fd){_0x1c7b6f[_0x76aa('0x25')](0x194);}return _0x23e2fd;};}function handleError(_0x5b57d8,_0x9ce5f4){_0x9ce5f4=_0x9ce5f4||0x1f4;return function(_0x5c77f1){logger['error'](_0x5c77f1[_0x76aa('0x35')]);if(_0x5c77f1[_0x76aa('0x36')]){delete _0x5c77f1[_0x76aa('0x36')];}_0x5b57d8[_0x76aa('0x26')](_0x9ce5f4)['send'](_0x5c77f1);};}exports[_0x76aa('0x37')]=function(_0x1c22f7,_0x2eea79){var _0x4e131a={},_0x113770={},_0x1638db={'count':0x0,'rows':[]};var _0x2f7726=_[_0x76aa('0x38')](db[_0x76aa('0x39')][_0x76aa('0x3a')],function(_0x878903){return{'name':_0x878903[_0x76aa('0x3b')],'type':_0x878903[_0x76aa('0x3c')]['key']};});_0x113770[_0x76aa('0x3d')]=_[_0x76aa('0x38')](_0x2f7726,_0x76aa('0x36'));_0x113770[_0x76aa('0x3e')]=_[_0x76aa('0x3f')](_0x1c22f7[_0x76aa('0x3e')]);_0x113770['filters']=_['intersection'](_0x113770[_0x76aa('0x3d')],_0x113770[_0x76aa('0x3e')]);_0x4e131a[_0x76aa('0x40')]=_[_0x76aa('0x41')](_0x113770['model'],qs[_0x76aa('0x42')](_0x1c22f7[_0x76aa('0x3e')][_0x76aa('0x42')]));_0x4e131a[_0x76aa('0x40')]=_0x4e131a[_0x76aa('0x40')]['length']?_0x4e131a[_0x76aa('0x40')]:_0x113770['model'];if(!_0x1c22f7[_0x76aa('0x3e')]['hasOwnProperty']('nolimit')){_0x4e131a['limit']=qs[_0x76aa('0x2b')](_0x1c22f7['query']['limit']);_0x4e131a['offset']=qs[_0x76aa('0x29')](_0x1c22f7[_0x76aa('0x3e')][_0x76aa('0x29')]);}_0x4e131a[_0x76aa('0x43')]=qs[_0x76aa('0x44')](_0x1c22f7['query'][_0x76aa('0x44')]);_0x4e131a[_0x76aa('0x45')]=qs[_0x76aa('0x46')](_[_0x76aa('0x47')](_0x1c22f7[_0x76aa('0x3e')],_0x113770['filters']),_0x2f7726);if(_0x1c22f7[_0x76aa('0x3e')][_0x76aa('0x48')]){_0x4e131a['where']=_[_0x76aa('0x49')](_0x4e131a['where'],{'$or':_[_0x76aa('0x38')](_0x2f7726,function(_0x24ea05){if(_0x24ea05[_0x76aa('0x3c')]!==_0x76aa('0x4a')){var _0x2d0bc4={};_0x2d0bc4[_0x24ea05[_0x76aa('0x36')]]={'$like':'%'+_0x1c22f7[_0x76aa('0x3e')][_0x76aa('0x48')]+'%'};return _0x2d0bc4;}})});}_0x4e131a=_[_0x76aa('0x49')]({},_0x4e131a,_0x1c22f7[_0x76aa('0x4b')]);var _0x5e4967={'where':_0x4e131a[_0x76aa('0x45')]};return db['Trunk'][_0x76aa('0x2c')](_0x5e4967)[_0x76aa('0x1b')](function(_0x5e95f5){_0x1638db[_0x76aa('0x2c')]=_0x5e95f5;if(_0x1c22f7['query']['includeAll']){_0x4e131a[_0x76aa('0x4c')]=[{'all':!![]}];}return db['Trunk'][_0x76aa('0x4d')](_0x4e131a);})[_0x76aa('0x1b')](function(_0x4315b3){_0x1638db[_0x76aa('0x4e')]=_0x4315b3;return _0x1638db;})[_0x76aa('0x1b')](respondWithFilteredResult(_0x2eea79,_0x4e131a))[_0x76aa('0x24')](handleError(_0x2eea79,null));};exports['show']=function(_0x564546,_0x2fcf8f){var _0x1eafb2={'raw':![],'where':{'id':_0x564546[_0x76aa('0x4f')]['id']}},_0x1708d4={};_0x1708d4[_0x76aa('0x3d')]=_[_0x76aa('0x3f')](db['Trunk'][_0x76aa('0x3a')]);_0x1708d4[_0x76aa('0x3e')]=_[_0x76aa('0x3f')](_0x564546['query']);_0x1708d4[_0x76aa('0x46')]=_['intersection'](_0x1708d4[_0x76aa('0x3d')],_0x1708d4['query']);_0x1eafb2[_0x76aa('0x40')]=_[_0x76aa('0x41')](_0x1708d4[_0x76aa('0x3d')],qs[_0x76aa('0x42')](_0x564546[_0x76aa('0x3e')][_0x76aa('0x42')]));_0x1eafb2[_0x76aa('0x40')]=_0x1eafb2['attributes'][_0x76aa('0x50')]?_0x1eafb2['attributes']:_0x1708d4[_0x76aa('0x3d')];if(_0x564546[_0x76aa('0x3e')][_0x76aa('0x51')]){_0x1eafb2[_0x76aa('0x4c')]=[{'all':!![]}];}_0x1eafb2=_[_0x76aa('0x49')]({},_0x1eafb2,_0x564546[_0x76aa('0x4b')]);return db[_0x76aa('0x39')]['find'](_0x1eafb2)[_0x76aa('0x1b')](handleEntityNotFound(_0x2fcf8f,null))[_0x76aa('0x1b')](respondWithResult(_0x2fcf8f,null))[_0x76aa('0x24')](handleError(_0x2fcf8f,null));};exports[_0x76aa('0x52')]=function(_0x5c742c,_0xb9401b){var _0x163440={'where':{'id':_0x5c742c[_0x76aa('0x4f')]['id']}},_0x8dc601={};_0x8dc601[_0x76aa('0x3d')]=_[_0x76aa('0x3f')](db['Trunk'][_0x76aa('0x3a')]);_0x163440[_0x76aa('0x40')]=_[_0x76aa('0x41')](_0x8dc601[_0x76aa('0x3d')],qs[_0x76aa('0x42')](_0x5c742c[_0x76aa('0x3e')][_0x76aa('0x42')]));_0x163440['attributes']=_0x163440['attributes'][_0x76aa('0x50')]?_0x163440[_0x76aa('0x40')]:_0x8dc601['model'];if(_0x5c742c[_0x76aa('0x3e')][_0x76aa('0x51')]){_0x163440['include']=[{'all':!![]}];}_0x163440=_[_0x76aa('0x49')]({},_0x163440,_0x5c742c[_0x76aa('0x4b')]);return db[_0x76aa('0x39')][_0x76aa('0x53')](_0x163440)[_0x76aa('0x1b')](handleEntityNotFound(_0xb9401b,null))[_0x76aa('0x1b')](function(_0x3376ec){if(_0x3376ec){var _0x30573a=_0x3376ec[_0x76aa('0x54')]({'plain':!![]});_0x30573a=qs['omit'](_0x30573a,['id',_0x76aa('0x55'),'updatedAt']);_0x5c742c[_0x76aa('0x56')]=_[_0x76aa('0x57')](_0x5c742c[_0x76aa('0x56')],['id',_0x76aa('0x55'),_0x76aa('0x58')]);return db[_0x76aa('0x39')][_0x76aa('0x59')](_[_0x76aa('0x49')](_0x30573a,_0x5c742c[_0x76aa('0x56')]),{'include':_0x5c742c['query'][_0x76aa('0x51')]?[{'all':!![]}]:undefined})[_0x76aa('0x1b')](function(_0x5c542b){var _0xe5957d=_0x5c742c[_0x76aa('0x5a')][_0x76aa('0x54')]({'plain':!![]});if(!_0xe5957d)throw new Error(_0x76aa('0x5b'));if(_0xe5957d[_0x76aa('0x5c')]==='user'){var _0x364d05=_0x5c542b['get']({'plain':!![]});var _0x35bd2b=_0x76aa('0x33');return db[_0x76aa('0x5d')][_0x76aa('0x53')]({'where':{'name':_0x35bd2b,'userProfileId':_0xe5957d[_0x76aa('0x5e')]},'raw':!![]})[_0x76aa('0x1b')](function(_0x2bfb46){if(_0x2bfb46&&_0x2bfb46['autoAssociation']===0x0){return db[_0x76aa('0x34')][_0x76aa('0x59')]({'name':_0x364d05['name'],'resourceId':_0x364d05['id'],'type':_0x2bfb46['name'],'sectionId':_0x2bfb46['id']},{})[_0x76aa('0x1b')](function(){return _0x5c542b;});}else{return _0x5c542b;}})[_0x76aa('0x24')](function(_0x5295a7){logger[_0x76aa('0x20')](_0x76aa('0x5f'),_0x5295a7);throw _0x5295a7;});}return _0x5c542b;});}})[_0x76aa('0x1b')](respondWithResult(_0xb9401b,0xc9))['catch'](handleError(_0xb9401b,null));};exports[_0x76aa('0x59')]=function(_0x47f733,_0xf31e1f,_0x1178e5){var _0x2315cf;return db[_0x76aa('0x39')]['create'](_0x47f733['body'],{'raw':!![]})[_0x76aa('0x1b')](function(_0x4dfeb3){_0x2315cf=_0x4dfeb3;return db[_0x76aa('0x39')][_0x76aa('0x4d')]({'raw':!![]});})[_0x76aa('0x1b')](function(_0x43a2af){var _0x2dd320=fs[_0x76aa('0x60')](path[_0x76aa('0x61')](config[_0x76aa('0x62')],_0x76aa('0x63')),'utf8');var _0x7d02e7=fs[_0x76aa('0x60')](path[_0x76aa('0x61')](config[_0x76aa('0x62')],'server/files/templates/registry.ejs'),'utf8');var _0x557c11=ejs[_0x76aa('0x64')](_0x2dd320,{'trunks':_0x43a2af||[]});fs['writeFileSync'](_0x76aa('0x65'),_0x557c11);if(_0x2315cf[_0x76aa('0x66')]){var _0x38faff=ejs[_0x76aa('0x64')](_0x7d02e7,{'trunks':_0x43a2af||[]});fs['writeFileSync'](_0x76aa('0x67'),_0x38faff);}})['then'](function(){return respondWithRpcPromise(_0x76aa('0x68'),_0x76aa('0x59'),{'module':_0x76aa('0x69')});})[_0x76aa('0x1b')](function(){var _0x1037fb=_0x47f733['user'][_0x76aa('0x54')]({'plain':!![]});if(!_0x1037fb)throw new Error(_0x76aa('0x5b'));if(_0x1037fb[_0x76aa('0x5c')]===_0x76aa('0x5a')){var _0x32c1de=_0x2315cf[_0x76aa('0x54')]({'plain':!![]});return db[_0x76aa('0x5d')][_0x76aa('0x53')]({'where':{'name':'Trunks','userProfileId':_0x1037fb[_0x76aa('0x5e')]},'raw':!![]})[_0x76aa('0x1b')](function(_0x48136a){if(_0x48136a&&_0x48136a[_0x76aa('0x6a')]===0x0){return db[_0x76aa('0x34')][_0x76aa('0x59')]({'name':_0x32c1de[_0x76aa('0x36')],'resourceId':_0x32c1de['id'],'type':_0x48136a[_0x76aa('0x36')],'sectionId':_0x48136a['id']},{})[_0x76aa('0x1b')](function(){return _0x2315cf;});}else{return _0x2315cf;}})[_0x76aa('0x24')](function(_0x5dc923){logger[_0x76aa('0x20')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5dc923);throw _0x5dc923;});}return _0x2315cf;})['then'](respondWithResult(_0xf31e1f,0xc9))[_0x76aa('0x24')](handleError(_0xf31e1f,null));};exports[_0x76aa('0x6b')]=function(_0x5d8947,_0x5d1de1,_0x36da4d){var _0x14b5a2;return db[_0x76aa('0x39')]['find']({'where':{'id':_0x5d8947['params']['id']}})[_0x76aa('0x1b')](handleEntityNotFound(_0x5d1de1,null))[_0x76aa('0x1b')](saveUpdates(_0x5d8947[_0x76aa('0x56')],null))['then'](function(_0xb70589){if(_0xb70589){_0x14b5a2=_0xb70589;return db['Trunk'][_0x76aa('0x4d')]({'raw':!![]});}})[_0x76aa('0x1b')](function(_0x383290){if(_0x383290){var _0x325ffa=fs[_0x76aa('0x60')](path['join'](config['root'],_0x76aa('0x63')),_0x76aa('0x6c'));var _0x19ebb7=fs['readFileSync'](path[_0x76aa('0x61')](config[_0x76aa('0x62')],_0x76aa('0x6d')),_0x76aa('0x6c'));var _0x303b78=ejs['render'](_0x325ffa,{'trunks':_0x383290||[]});fs[_0x76aa('0x6e')]('/etc/asterisk/sip_xcally_trunks.conf',_0x303b78);var _0x213f7f=ejs[_0x76aa('0x64')](_0x19ebb7,{'trunks':_0x383290||[]});fs[_0x76aa('0x6e')](_0x76aa('0x67'),_0x213f7f);return respondWithRpcPromise(_0x76aa('0x68'),_0x76aa('0x6b'),{'module':'chan_sip.so'});}return null;})['then'](function(_0x547411){if(_0x547411){return _0x14b5a2;}})['then'](respondWithResult(_0x5d1de1,null))['catch'](handleError(_0x5d1de1,null));};exports[_0x76aa('0x32')]=function(_0x22f44f,_0x52c5be,_0x5c2c91){var _0x4f01e9;return db[_0x76aa('0x39')][_0x76aa('0x53')]({'where':{'id':_0x22f44f[_0x76aa('0x4f')]['id']}})['then'](handleEntityNotFound(_0x52c5be,null))['then'](removeEntity(_0x52c5be,null))[_0x76aa('0x1b')](function(){return db[_0x76aa('0x39')][_0x76aa('0x4d')]({'raw':!![]});})[_0x76aa('0x1b')](function(_0x354c7b){var _0x55e526=fs['readFileSync'](path[_0x76aa('0x61')](config['root'],'server/files/templates/trunk.ejs'),'utf8');var _0x4673e6=fs[_0x76aa('0x60')](path['join'](config[_0x76aa('0x62')],_0x76aa('0x6d')),'utf8');var _0x22063f=ejs[_0x76aa('0x64')](_0x55e526,{'trunks':_0x354c7b});var _0x11d91f=ejs[_0x76aa('0x64')](_0x4673e6,{'trunks':_0x354c7b});fs[_0x76aa('0x6e')](_0x76aa('0x65'),_0x22063f);fs[_0x76aa('0x6e')](_0x76aa('0x67'),_0x11d91f);return respondWithRpcPromise(_0x76aa('0x68'),'destroy',{'module':_0x76aa('0x69')});})[_0x76aa('0x24')](handleError(_0x52c5be,null));}; \ No newline at end of file +var _0xb821=['model','map','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','Trunk','includeAll','findAll','intersection','length','include','find','params','get','omit','createdAt','updatedAt','body','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','server/files/templates/trunk.ejs','utf8','join','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','UserProfileSection','root','rimraf','zip-dir','moment','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s','stringify','code','Trunk,\x20%s,\x20%s','error','message','info','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','Trunks','name','send','index','rawAttributes','fieldName','key'];(function(_0x34f0be,_0x14b4db){var _0x537a5d=function(_0x502916){while(--_0x502916){_0x34f0be['push'](_0x34f0be['shift']());}};_0x537a5d(++_0x14b4db);}(_0xb821,0xa7));var _0x1b82=function(_0x368c25,_0x39e865){_0x368c25=_0x368c25-0x0;var _0xebec25=_0xb821[_0x368c25];return _0xebec25;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1b82('0x0'));var zipdir=require(_0x1b82('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1b82('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1b82('0x3'));var path=require(_0x1b82('0x4'));var sox=require(_0x1b82('0x5'));var csv=require(_0x1b82('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1b82('0x7'));var _=require(_0x1b82('0x8'));var squel=require(_0x1b82('0x9'));var crypto=require(_0x1b82('0xa'));var jsforce=require(_0x1b82('0xb'));var deskjs=require(_0x1b82('0xc'));var toCsv=require(_0x1b82('0x6'));var querystring=require(_0x1b82('0xd'));var Papa=require(_0x1b82('0xe'));var Redis=require('ioredis');var authService=require(_0x1b82('0xf'));var qs=require(_0x1b82('0x10'));var as=require(_0x1b82('0x11'));var hardwareService=require(_0x1b82('0x12'));var logger=require(_0x1b82('0x13'))(_0x1b82('0x14'));var utils=require(_0x1b82('0x15'));var config=require(_0x1b82('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x1b82('0x17'))['db'];var jayson=require(_0x1b82('0x18'));var client=jayson[_0x1b82('0x19')][_0x1b82('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x50aed7,_0x1a6285,_0x5767aa,_0x54915f){return new BPromise(function(_0x1e553a,_0x4bf75b){var _0x1cffd1=_0x54915f||client;return _0x1cffd1[_0x1b82('0x1b')](_0x50aed7,_0x5767aa)['then'](function(_0x46c2cf){logger['info']('Trunk,\x20%s,\x20%s',_0x1a6285,_0x1b82('0x1c'));logger['debug'](_0x1b82('0x1d'),_0x1a6285,_0x1b82('0x1c'),JSON[_0x1b82('0x1e')](_0x46c2cf));if(_0x46c2cf['error']){if(_0x46c2cf['error'][_0x1b82('0x1f')]===0x1f4){logger['error'](_0x1b82('0x20'),_0x1a6285,_0x46c2cf[_0x1b82('0x21')][_0x1b82('0x22')]);return _0x4bf75b(_0x46c2cf['error'][_0x1b82('0x22')]);}logger[_0x1b82('0x21')](_0x1b82('0x20'),_0x1a6285,_0x46c2cf[_0x1b82('0x21')][_0x1b82('0x22')]);return _0x1e553a(_0x46c2cf['error'][_0x1b82('0x22')]);}else{logger[_0x1b82('0x23')](_0x1b82('0x20'),_0x1a6285,_0x1b82('0x1c'));_0x1e553a(_0x46c2cf[_0x1b82('0x24')][_0x1b82('0x22')]);}})[_0x1b82('0x25')](function(_0x486e92){logger[_0x1b82('0x21')](_0x1b82('0x20'),_0x1a6285,_0x486e92);_0x4bf75b(_0x486e92);});});}function respondWithStatusCode(_0x5b8d09,_0x561d78){_0x561d78=_0x561d78||0xcc;return function(_0x225b81){if(_0x225b81){return _0x5b8d09[_0x1b82('0x26')](_0x561d78);}return _0x5b8d09['status'](_0x561d78)[_0x1b82('0x27')]();};}function respondWithResult(_0x4db690,_0x5cd458){_0x5cd458=_0x5cd458||0xc8;return function(_0x5f556b){if(_0x5f556b){return _0x4db690[_0x1b82('0x28')](_0x5cd458)[_0x1b82('0x29')](_0x5f556b);}};}function respondWithFilteredResult(_0xfd00d1,_0x257b79){return function(_0x548a3b){if(_0x548a3b){var _0x222483=typeof _0x257b79[_0x1b82('0x2a')]===_0x1b82('0x2b')&&typeof _0x257b79[_0x1b82('0x2c')]===_0x1b82('0x2b');var _0x1b8b6f=_0x548a3b[_0x1b82('0x2d')];var _0x21ea34=_0x222483?0x0:_0x257b79[_0x1b82('0x2a')];var _0x1f9c6b=_0x222483?_0x548a3b[_0x1b82('0x2d')]:_0x257b79[_0x1b82('0x2a')]+_0x257b79[_0x1b82('0x2c')];var _0x5ea890;if(_0x1f9c6b>=_0x1b8b6f){_0x1f9c6b=_0x1b8b6f;_0x5ea890=0xc8;}else{_0x5ea890=0xce;}_0xfd00d1[_0x1b82('0x28')](_0x5ea890);return _0xfd00d1[_0x1b82('0x2e')](_0x1b82('0x2f'),_0x21ea34+'-'+_0x1f9c6b+'/'+_0x1b8b6f)[_0x1b82('0x29')](_0x548a3b);}return null;};}function patchUpdates(_0x18e4ff){return function(_0x115ce7){try{jsonpatch[_0x1b82('0x30')](_0x115ce7,_0x18e4ff,!![]);}catch(_0x46575f){return BPromise[_0x1b82('0x31')](_0x46575f);}return _0x115ce7[_0x1b82('0x32')]();};}function saveUpdates(_0x501ab0,_0x225c06){return function(_0x29a31e){if(_0x29a31e){return _0x29a31e[_0x1b82('0x33')](_0x501ab0)[_0x1b82('0x34')](function(_0x5b7b18){return _0x5b7b18;});}return null;};}function removeEntity(_0x474218,_0xbf65a){return function(_0x544bd5){if(_0x544bd5){return _0x544bd5[_0x1b82('0x35')]()[_0x1b82('0x34')](function(){var _0x365c3c=_0x544bd5['get']({'plain':!![]});var _0x5efb8e=_0x1b82('0x36');return db['UserProfileResource']['destroy']({'where':{'type':_0x5efb8e,'resourceId':_0x365c3c['id']}})[_0x1b82('0x34')](function(){return _0x544bd5;});})[_0x1b82('0x34')](function(){_0x474218[_0x1b82('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x42a64e,_0x366db3){return function(_0xea774a){if(!_0xea774a){_0x42a64e[_0x1b82('0x26')](0x194);}return _0xea774a;};}function handleError(_0x4dd64a,_0x42c1c4){_0x42c1c4=_0x42c1c4||0x1f4;return function(_0x1cd7de){logger[_0x1b82('0x21')](_0x1cd7de['stack']);if(_0x1cd7de['name']){delete _0x1cd7de[_0x1b82('0x37')];}_0x4dd64a['status'](_0x42c1c4)[_0x1b82('0x38')](_0x1cd7de);};}exports[_0x1b82('0x39')]=function(_0x286b4b,_0x348880){var _0x1255db={},_0x3ab35c={},_0x39fe4a={'count':0x0,'rows':[]};var _0x1368df=_['map'](db['Trunk'][_0x1b82('0x3a')],function(_0x5f4baf){return{'name':_0x5f4baf[_0x1b82('0x3b')],'type':_0x5f4baf['type'][_0x1b82('0x3c')]};});_0x3ab35c[_0x1b82('0x3d')]=_[_0x1b82('0x3e')](_0x1368df,_0x1b82('0x37'));_0x3ab35c[_0x1b82('0x3f')]=_[_0x1b82('0x40')](_0x286b4b['query']);_0x3ab35c[_0x1b82('0x41')]=_['intersection'](_0x3ab35c[_0x1b82('0x3d')],_0x3ab35c['query']);_0x1255db[_0x1b82('0x42')]=_['intersection'](_0x3ab35c['model'],qs[_0x1b82('0x43')](_0x286b4b[_0x1b82('0x3f')][_0x1b82('0x43')]));_0x1255db[_0x1b82('0x42')]=_0x1255db[_0x1b82('0x42')]['length']?_0x1255db[_0x1b82('0x42')]:_0x3ab35c['model'];if(!_0x286b4b[_0x1b82('0x3f')][_0x1b82('0x44')](_0x1b82('0x45'))){_0x1255db[_0x1b82('0x2c')]=qs[_0x1b82('0x2c')](_0x286b4b['query'][_0x1b82('0x2c')]);_0x1255db['offset']=qs[_0x1b82('0x2a')](_0x286b4b[_0x1b82('0x3f')]['offset']);}_0x1255db[_0x1b82('0x46')]=qs[_0x1b82('0x47')](_0x286b4b[_0x1b82('0x3f')][_0x1b82('0x47')]);_0x1255db[_0x1b82('0x48')]=qs[_0x1b82('0x41')](_[_0x1b82('0x49')](_0x286b4b['query'],_0x3ab35c[_0x1b82('0x41')]),_0x1368df);if(_0x286b4b['query'][_0x1b82('0x4a')]){_0x1255db[_0x1b82('0x48')]=_[_0x1b82('0x4b')](_0x1255db[_0x1b82('0x48')],{'$or':_[_0x1b82('0x3e')](_0x1368df,function(_0x1d24d6){if(_0x1d24d6[_0x1b82('0x4c')]!==_0x1b82('0x4d')){var _0x192ce3={};_0x192ce3[_0x1d24d6[_0x1b82('0x37')]]={'$like':'%'+_0x286b4b[_0x1b82('0x3f')][_0x1b82('0x4a')]+'%'};return _0x192ce3;}})});}_0x1255db=_[_0x1b82('0x4b')]({},_0x1255db,_0x286b4b[_0x1b82('0x4e')]);var _0x4fb92f={'where':_0x1255db['where']};return db[_0x1b82('0x4f')]['count'](_0x4fb92f)[_0x1b82('0x34')](function(_0x3df0af){_0x39fe4a[_0x1b82('0x2d')]=_0x3df0af;if(_0x286b4b['query'][_0x1b82('0x50')]){_0x1255db['include']=[{'all':!![]}];}return db['Trunk'][_0x1b82('0x51')](_0x1255db);})[_0x1b82('0x34')](function(_0x242324){_0x39fe4a['rows']=_0x242324;return _0x39fe4a;})[_0x1b82('0x34')](respondWithFilteredResult(_0x348880,_0x1255db))[_0x1b82('0x25')](handleError(_0x348880,null));};exports['show']=function(_0x5ca898,_0x106282){var _0x2e676a={'raw':![],'where':{'id':_0x5ca898['params']['id']}},_0x2dc53e={};_0x2dc53e[_0x1b82('0x3d')]=_[_0x1b82('0x40')](db[_0x1b82('0x4f')][_0x1b82('0x3a')]);_0x2dc53e[_0x1b82('0x3f')]=_[_0x1b82('0x40')](_0x5ca898['query']);_0x2dc53e[_0x1b82('0x41')]=_['intersection'](_0x2dc53e[_0x1b82('0x3d')],_0x2dc53e[_0x1b82('0x3f')]);_0x2e676a['attributes']=_[_0x1b82('0x52')](_0x2dc53e['model'],qs[_0x1b82('0x43')](_0x5ca898[_0x1b82('0x3f')][_0x1b82('0x43')]));_0x2e676a[_0x1b82('0x42')]=_0x2e676a[_0x1b82('0x42')][_0x1b82('0x53')]?_0x2e676a['attributes']:_0x2dc53e['model'];if(_0x5ca898[_0x1b82('0x3f')][_0x1b82('0x50')]){_0x2e676a[_0x1b82('0x54')]=[{'all':!![]}];}_0x2e676a=_[_0x1b82('0x4b')]({},_0x2e676a,_0x5ca898[_0x1b82('0x4e')]);return db[_0x1b82('0x4f')][_0x1b82('0x55')](_0x2e676a)[_0x1b82('0x34')](handleEntityNotFound(_0x106282,null))['then'](respondWithResult(_0x106282,null))['catch'](handleError(_0x106282,null));};exports['clone']=function(_0x2658b5,_0x2a95d2){var _0x207f1c={'where':{'id':_0x2658b5[_0x1b82('0x56')]['id']}},_0x27ad80={};_0x27ad80[_0x1b82('0x3d')]=_[_0x1b82('0x40')](db['Trunk'][_0x1b82('0x3a')]);_0x207f1c[_0x1b82('0x42')]=_[_0x1b82('0x52')](_0x27ad80[_0x1b82('0x3d')],qs[_0x1b82('0x43')](_0x2658b5[_0x1b82('0x3f')][_0x1b82('0x43')]));_0x207f1c[_0x1b82('0x42')]=_0x207f1c['attributes'][_0x1b82('0x53')]?_0x207f1c[_0x1b82('0x42')]:_0x27ad80[_0x1b82('0x3d')];if(_0x2658b5[_0x1b82('0x3f')][_0x1b82('0x50')]){_0x207f1c['include']=[{'all':!![]}];}_0x207f1c=_['merge']({},_0x207f1c,_0x2658b5[_0x1b82('0x4e')]);return db[_0x1b82('0x4f')][_0x1b82('0x55')](_0x207f1c)[_0x1b82('0x34')](handleEntityNotFound(_0x2a95d2,null))['then'](function(_0x170905){if(_0x170905){var _0x352603=_0x170905[_0x1b82('0x57')]({'plain':!![]});_0x352603=qs[_0x1b82('0x58')](_0x352603,['id',_0x1b82('0x59'),_0x1b82('0x5a')]);_0x2658b5[_0x1b82('0x5b')]=_[_0x1b82('0x58')](_0x2658b5[_0x1b82('0x5b')],['id',_0x1b82('0x59'),'updatedAt']);return db[_0x1b82('0x4f')][_0x1b82('0x5c')](_['merge'](_0x352603,_0x2658b5[_0x1b82('0x5b')]),{'include':_0x2658b5[_0x1b82('0x3f')][_0x1b82('0x50')]?[{'all':!![]}]:undefined})[_0x1b82('0x34')](function(_0x4b26c4){var _0x30f13a=_0x2658b5[_0x1b82('0x5d')][_0x1b82('0x57')]({'plain':!![]});if(!_0x30f13a)throw new Error(_0x1b82('0x5e'));if(_0x30f13a[_0x1b82('0x5f')]===_0x1b82('0x5d')){var _0x4e8fa2=_0x4b26c4[_0x1b82('0x57')]({'plain':!![]});var _0x5267c3=_0x1b82('0x36');return db['UserProfileSection'][_0x1b82('0x55')]({'where':{'name':_0x5267c3,'userProfileId':_0x30f13a[_0x1b82('0x60')]},'raw':!![]})[_0x1b82('0x34')](function(_0x2db0fe){if(_0x2db0fe&&_0x2db0fe[_0x1b82('0x61')]===0x0){return db[_0x1b82('0x62')][_0x1b82('0x5c')]({'name':_0x4e8fa2['name'],'resourceId':_0x4e8fa2['id'],'type':_0x2db0fe[_0x1b82('0x37')],'sectionId':_0x2db0fe['id']},{})[_0x1b82('0x34')](function(){return _0x4b26c4;});}else{return _0x4b26c4;}})[_0x1b82('0x25')](function(_0x2de10c){logger[_0x1b82('0x21')](_0x1b82('0x63'),_0x2de10c);throw _0x2de10c;});}return _0x4b26c4;});}})[_0x1b82('0x34')](respondWithResult(_0x2a95d2,0xc9))[_0x1b82('0x25')](handleError(_0x2a95d2,null));};exports[_0x1b82('0x5c')]=function(_0x3f7690,_0x1873de,_0xe31cbc){var _0x1ef92c;return db['Trunk'][_0x1b82('0x5c')](_0x3f7690[_0x1b82('0x5b')],{'raw':!![]})[_0x1b82('0x34')](function(_0x4a229e){_0x1ef92c=_0x4a229e;return db[_0x1b82('0x4f')][_0x1b82('0x51')]({'raw':!![]});})['then'](function(_0x3bf106){var _0x5cc386=fs[_0x1b82('0x64')](path['join'](config['root'],_0x1b82('0x65')),_0x1b82('0x66'));var _0x3b4088=fs[_0x1b82('0x64')](path[_0x1b82('0x67')](config['root'],_0x1b82('0x68')),'utf8');var _0x143689=ejs[_0x1b82('0x69')](_0x5cc386,{'trunks':_0x3bf106||[]});fs[_0x1b82('0x6a')](_0x1b82('0x6b'),_0x143689);if(_0x1ef92c[_0x1b82('0x6c')]){var _0x29c42e=ejs[_0x1b82('0x69')](_0x3b4088,{'trunks':_0x3bf106||[]});fs[_0x1b82('0x6a')](_0x1b82('0x6d'),_0x29c42e);}})[_0x1b82('0x34')](function(){return respondWithRpcPromise(_0x1b82('0x6e'),'create',{'module':_0x1b82('0x6f')});})['then'](function(){var _0x4c2e52=_0x3f7690[_0x1b82('0x5d')][_0x1b82('0x57')]({'plain':!![]});if(!_0x4c2e52)throw new Error(_0x1b82('0x5e'));if(_0x4c2e52[_0x1b82('0x5f')]===_0x1b82('0x5d')){var _0x1dd3a1=_0x1ef92c[_0x1b82('0x57')]({'plain':!![]});return db[_0x1b82('0x70')][_0x1b82('0x55')]({'where':{'name':_0x1b82('0x36'),'userProfileId':_0x4c2e52['userProfileId']},'raw':!![]})[_0x1b82('0x34')](function(_0x4d496b){if(_0x4d496b&&_0x4d496b[_0x1b82('0x61')]===0x0){return db['UserProfileResource'][_0x1b82('0x5c')]({'name':_0x1dd3a1[_0x1b82('0x37')],'resourceId':_0x1dd3a1['id'],'type':_0x4d496b[_0x1b82('0x37')],'sectionId':_0x4d496b['id']},{})[_0x1b82('0x34')](function(){return _0x1ef92c;});}else{return _0x1ef92c;}})[_0x1b82('0x25')](function(_0x49a202){logger[_0x1b82('0x21')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x49a202);throw _0x49a202;});}return _0x1ef92c;})['then'](respondWithResult(_0x1873de,0xc9))[_0x1b82('0x25')](handleError(_0x1873de,null));};exports[_0x1b82('0x33')]=function(_0x1a4826,_0x4d986c,_0x2e9191){var _0x52f16e;return db[_0x1b82('0x4f')]['find']({'where':{'id':_0x1a4826[_0x1b82('0x56')]['id']}})[_0x1b82('0x34')](handleEntityNotFound(_0x4d986c,null))[_0x1b82('0x34')](saveUpdates(_0x1a4826[_0x1b82('0x5b')],null))['then'](function(_0x46cae4){if(_0x46cae4){_0x52f16e=_0x46cae4;return db['Trunk'][_0x1b82('0x51')]({'raw':!![]});}})[_0x1b82('0x34')](function(_0x1095fb){if(_0x1095fb){var _0x185fce=fs[_0x1b82('0x64')](path['join'](config[_0x1b82('0x71')],'server/files/templates/trunk.ejs'),_0x1b82('0x66'));var _0x5ce247=fs[_0x1b82('0x64')](path[_0x1b82('0x67')](config[_0x1b82('0x71')],'server/files/templates/registry.ejs'),_0x1b82('0x66'));var _0x31a56e=ejs[_0x1b82('0x69')](_0x185fce,{'trunks':_0x1095fb||[]});fs['writeFileSync'](_0x1b82('0x6b'),_0x31a56e);var _0x396272=ejs[_0x1b82('0x69')](_0x5ce247,{'trunks':_0x1095fb||[]});fs[_0x1b82('0x6a')](_0x1b82('0x6d'),_0x396272);return respondWithRpcPromise('Reload',_0x1b82('0x33'),{'module':'chan_sip.so'});}return null;})['then'](function(_0x2759ac){if(_0x2759ac){return _0x52f16e;}})['then'](respondWithResult(_0x4d986c,null))[_0x1b82('0x25')](handleError(_0x4d986c,null));};exports[_0x1b82('0x35')]=function(_0x5f349f,_0x3e17b0,_0x391207){var _0x553ac5;return db['Trunk']['find']({'where':{'id':_0x5f349f['params']['id']}})[_0x1b82('0x34')](handleEntityNotFound(_0x3e17b0,null))[_0x1b82('0x34')](removeEntity(_0x3e17b0,null))[_0x1b82('0x34')](function(){return db['Trunk'][_0x1b82('0x51')]({'raw':!![]});})['then'](function(_0x7d95b6){var _0x372c3b=fs[_0x1b82('0x64')](path[_0x1b82('0x67')](config['root'],_0x1b82('0x65')),_0x1b82('0x66'));var _0x14510c=fs[_0x1b82('0x64')](path[_0x1b82('0x67')](config[_0x1b82('0x71')],_0x1b82('0x68')),'utf8');var _0x58e180=ejs[_0x1b82('0x69')](_0x372c3b,{'trunks':_0x7d95b6});var _0x531d3f=ejs['render'](_0x14510c,{'trunks':_0x7d95b6});fs[_0x1b82('0x6a')](_0x1b82('0x6b'),_0x58e180);fs[_0x1b82('0x6a')]('/etc/asterisk/sip_xcally_registers.conf',_0x531d3f);return respondWithRpcPromise(_0x1b82('0x6e'),'destroy',{'module':_0x1b82('0x6f')});})[_0x1b82('0x25')](handleError(_0x3e17b0,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index ac2d5fd..4f0eaed 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 _0x32fb=['path','rimraf','../../config/environment','./trunk.attributes','exports','define','tools_trunks','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x253e1f,_0xd247f0){var _0x1adb58=function(_0x523236){while(--_0x523236){_0x253e1f['push'](_0x253e1f['shift']());}};_0x1adb58(++_0xd247f0);}(_0x32fb,0xfe));var _0xb32f=function(_0x1801b0,_0x387cbe){_0x1801b0=_0x1801b0-0x0;var _0x21a7a2=_0x32fb[_0x1801b0];return _0x21a7a2;};'use strict';var _=require(_0xb32f('0x0'));var util=require(_0xb32f('0x1'));var logger=require(_0xb32f('0x2'))(_0xb32f('0x3'));var moment=require(_0xb32f('0x4'));var BPromise=require(_0xb32f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb32f('0x6'));var rimraf=require(_0xb32f('0x7'));var config=require(_0xb32f('0x8'));var attributes=require(_0xb32f('0x9'));module[_0xb32f('0xa')]=function(_0x443b4d,_0x49dd83){return _0x443b4d[_0xb32f('0xb')]('Trunk',attributes,{'tableName':_0xb32f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf05f=['api','moment','path','rimraf','./trunk.attributes','exports','define','Trunk','util','../../config/logger'];(function(_0x587909,_0x34b68f){var _0x112453=function(_0x3ddb97){while(--_0x3ddb97){_0x587909['push'](_0x587909['shift']());}};_0x112453(++_0x34b68f);}(_0xf05f,0x13e));var _0xff05=function(_0x92fd5e,_0x4ca56d){_0x92fd5e=_0x92fd5e-0x0;var _0x5d44db=_0xf05f[_0x92fd5e];return _0x5d44db;};'use strict';var _=require('lodash');var util=require(_0xff05('0x0'));var logger=require(_0xff05('0x1'))(_0xff05('0x2'));var moment=require(_0xff05('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xff05('0x4'));var rimraf=require(_0xff05('0x5'));var config=require('../../config/environment');var attributes=require(_0xff05('0x6'));module[_0xff05('0x7')]=function(_0x4f439e,_0x3ff196){return _0x4f439e[_0xff05('0x8')](_0xff05('0x9'),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 b1418bf..b467eb7 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 _0x70aa=['code','Trunk,\x20%s,\x20%s','message','request\x20sent','result','catch','GetTrunk','Trunk','findAll','options','raw','where','limit','map','include','model','attributes','then','debug','find','ShowTrunk','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Trunk,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4847cf,_0x3616b5){var _0x375aad=function(_0x3a6ce8){while(--_0x3a6ce8){_0x4847cf['push'](_0x4847cf['shift']());}};_0x375aad(++_0x3616b5);}(_0x70aa,0xce));var _0xa70a=function(_0x4c05da,_0x414720){_0x4c05da=_0x4c05da-0x0;var _0x1614db=_0x70aa[_0x4c05da];return _0x1614db;};'use strict';var _=require('lodash');var util=require(_0xa70a('0x0'));var moment=require(_0xa70a('0x1'));var BPromise=require(_0xa70a('0x2'));var rs=require(_0xa70a('0x3'));var fs=require('fs');var Redis=require(_0xa70a('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa70a('0x5'))(_0xa70a('0x6'));var config=require(_0xa70a('0x7'));var jayson=require(_0xa70a('0x8'));var client=jayson[_0xa70a('0x9')][_0xa70a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x222a3b,_0x4a6b26,_0x113e87){return new BPromise(function(_0x5daf08,_0x571285){return client[_0xa70a('0xb')](_0x222a3b,_0x113e87)['then'](function(_0xc2df0f){logger[_0xa70a('0xc')]('Trunk,\x20%s,\x20%s',_0x4a6b26,'request\x20sent');logger['debug'](_0xa70a('0xd'),_0x4a6b26,'request\x20sent',JSON[_0xa70a('0xe')](_0xc2df0f));if(_0xc2df0f[_0xa70a('0xf')]){if(_0xc2df0f[_0xa70a('0xf')][_0xa70a('0x10')]===0x1f4){logger[_0xa70a('0xf')](_0xa70a('0x11'),_0x4a6b26,_0xc2df0f[_0xa70a('0xf')][_0xa70a('0x12')]);return _0x571285(_0xc2df0f[_0xa70a('0xf')][_0xa70a('0x12')]);}logger[_0xa70a('0xf')](_0xa70a('0x11'),_0x4a6b26,_0xc2df0f[_0xa70a('0xf')][_0xa70a('0x12')]);return _0x5daf08(_0xc2df0f[_0xa70a('0xf')][_0xa70a('0x12')]);}else{logger['info'](_0xa70a('0x11'),_0x4a6b26,_0xa70a('0x13'));_0x5daf08(_0xc2df0f[_0xa70a('0x14')][_0xa70a('0x12')]);}})[_0xa70a('0x15')](function(_0x49bcfe){logger[_0xa70a('0xf')]('Trunk,\x20%s,\x20%s',_0x4a6b26,_0x49bcfe);_0x571285(_0x49bcfe);});});}exports[_0xa70a('0x16')]=function(_0x590702){var _0x4471e7=this;return new Promise(function(_0x102e16,_0x3065fb){return db[_0xa70a('0x17')][_0xa70a('0x18')]({'raw':_0x590702[_0xa70a('0x19')]?_0x590702['options'][_0xa70a('0x1a')]===undefined?!![]:![]:!![],'where':_0x590702[_0xa70a('0x19')]?_0x590702['options'][_0xa70a('0x1b')]||null:null,'attributes':_0x590702[_0xa70a('0x19')]?_0x590702[_0xa70a('0x19')]['attributes']||null:null,'limit':_0x590702['options']?_0x590702[_0xa70a('0x19')][_0xa70a('0x1c')]||null:null,'include':_0x590702[_0xa70a('0x19')]?_0x590702[_0xa70a('0x19')]['include']?_[_0xa70a('0x1d')](_0x590702['options'][_0xa70a('0x1e')],function(_0x411b4d){return{'model':db[_0x411b4d[_0xa70a('0x1f')]],'as':_0x411b4d['as'],'attributes':_0x411b4d[_0xa70a('0x20')],'include':_0x411b4d[_0xa70a('0x1e')]?_[_0xa70a('0x1d')](_0x411b4d['include'],function(_0x19a02a){return{'model':db[_0x19a02a[_0xa70a('0x1f')]],'as':_0x19a02a['as'],'attributes':_0x19a02a[_0xa70a('0x20')],'include':_0x19a02a['include']?_[_0xa70a('0x1d')](_0x19a02a[_0xa70a('0x1e')],function(_0x534aeb){return{'model':db[_0x534aeb[_0xa70a('0x1f')]],'as':_0x534aeb['as'],'attributes':_0x534aeb['attributes']};}):[]};}):[]};}):[]:[]})[_0xa70a('0x21')](function(_0x36930d){logger[_0xa70a('0xc')](_0xa70a('0x16'),_0x590702);logger[_0xa70a('0x22')](_0xa70a('0x16'),_0x590702,JSON[_0xa70a('0xe')](_0x36930d));_0x102e16(_0x36930d);})[_0xa70a('0x15')](function(_0x52e886){logger[_0xa70a('0xf')]('GetTrunk',_0x52e886['message'],_0x590702);_0x3065fb(_0x4471e7[_0xa70a('0xf')](0x1f4,_0x52e886[_0xa70a('0x12')]));});});};exports['ShowTrunk']=function(_0x45a442){var _0xa9c01e=this;return new Promise(function(_0x570ed8,_0x2426cf){return db[_0xa70a('0x17')][_0xa70a('0x23')]({'raw':_0x45a442[_0xa70a('0x19')]?_0x45a442[_0xa70a('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x45a442['options']?_0x45a442['options'][_0xa70a('0x1b')]||null:null,'attributes':_0x45a442['options']?_0x45a442[_0xa70a('0x19')][_0xa70a('0x20')]||null:null,'include':_0x45a442[_0xa70a('0x19')]?_0x45a442[_0xa70a('0x19')][_0xa70a('0x1e')]?_['map'](_0x45a442[_0xa70a('0x19')][_0xa70a('0x1e')],function(_0x166f78){return{'model':db[_0x166f78[_0xa70a('0x1f')]],'as':_0x166f78['as'],'attributes':_0x166f78[_0xa70a('0x20')],'include':_0x166f78['include']?_[_0xa70a('0x1d')](_0x166f78[_0xa70a('0x1e')],function(_0x675346){return{'model':db[_0x675346['model']],'as':_0x675346['as'],'attributes':_0x675346['attributes'],'include':_0x675346[_0xa70a('0x1e')]?_['map'](_0x675346[_0xa70a('0x1e')],function(_0x4df703){return{'model':db[_0x4df703['model']],'as':_0x4df703['as'],'attributes':_0x4df703[_0xa70a('0x20')]};}):[]};}):[]};}):[]:[]})[_0xa70a('0x21')](function(_0x811360){logger['info'](_0xa70a('0x24'),_0x45a442);logger[_0xa70a('0x22')]('ShowTrunk',_0x45a442,JSON[_0xa70a('0xe')](_0x811360));_0x570ed8(_0x811360);})[_0xa70a('0x15')](function(_0x570424){logger[_0xa70a('0xf')](_0xa70a('0x24'),_0x570424['message'],_0x45a442);_0x2426cf(_0xa9c01e[_0xa70a('0xf')](0x1f4,_0x570424['message']));});});}; \ No newline at end of file +var _0x9223=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetTrunk','Trunk','findAll','options','raw','where','attributes','limit','map','include','model','debug','ShowTrunk','find','lodash'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0x9223,0x13a));var _0x3922=function(_0x39e164,_0x2cb93b){_0x39e164=_0x39e164-0x0;var _0x13fa6b=_0x9223[_0x39e164];return _0x13fa6b;};'use strict';var _=require(_0x3922('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3922('0x1'));var rs=require(_0x3922('0x2'));var fs=require('fs');var Redis=require(_0x3922('0x3'));var db=require(_0x3922('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3922('0x5'))(_0x3922('0x6'));var config=require(_0x3922('0x7'));var jayson=require(_0x3922('0x8'));var client=jayson[_0x3922('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4813eb,_0x5d736e,_0x9f0aa2){return new BPromise(function(_0x12fa2a,_0xa1d1c2){return client[_0x3922('0xa')](_0x4813eb,_0x9f0aa2)[_0x3922('0xb')](function(_0x306832){logger[_0x3922('0xc')](_0x3922('0xd'),_0x5d736e,_0x3922('0xe'));logger['debug']('Trunk,\x20%s,\x20%s,\x20%s',_0x5d736e,_0x3922('0xe'),JSON[_0x3922('0xf')](_0x306832));if(_0x306832[_0x3922('0x10')]){if(_0x306832[_0x3922('0x10')][_0x3922('0x11')]===0x1f4){logger[_0x3922('0x10')](_0x3922('0xd'),_0x5d736e,_0x306832[_0x3922('0x10')][_0x3922('0x12')]);return _0xa1d1c2(_0x306832[_0x3922('0x10')][_0x3922('0x12')]);}logger[_0x3922('0x10')](_0x3922('0xd'),_0x5d736e,_0x306832[_0x3922('0x10')][_0x3922('0x12')]);return _0x12fa2a(_0x306832[_0x3922('0x10')][_0x3922('0x12')]);}else{logger[_0x3922('0xc')](_0x3922('0xd'),_0x5d736e,'request\x20sent');_0x12fa2a(_0x306832[_0x3922('0x13')][_0x3922('0x12')]);}})[_0x3922('0x14')](function(_0x5da034){logger[_0x3922('0x10')](_0x3922('0xd'),_0x5d736e,_0x5da034);_0xa1d1c2(_0x5da034);});});}exports[_0x3922('0x15')]=function(_0x50c8f8){var _0x46575d=this;return new Promise(function(_0xd19508,_0x2827f3){return db[_0x3922('0x16')][_0x3922('0x17')]({'raw':_0x50c8f8[_0x3922('0x18')]?_0x50c8f8[_0x3922('0x18')][_0x3922('0x19')]===undefined?!![]:![]:!![],'where':_0x50c8f8[_0x3922('0x18')]?_0x50c8f8['options'][_0x3922('0x1a')]||null:null,'attributes':_0x50c8f8[_0x3922('0x18')]?_0x50c8f8['options'][_0x3922('0x1b')]||null:null,'limit':_0x50c8f8[_0x3922('0x18')]?_0x50c8f8['options'][_0x3922('0x1c')]||null:null,'include':_0x50c8f8['options']?_0x50c8f8['options']['include']?_[_0x3922('0x1d')](_0x50c8f8[_0x3922('0x18')][_0x3922('0x1e')],function(_0x1f0c4b){return{'model':db[_0x1f0c4b[_0x3922('0x1f')]],'as':_0x1f0c4b['as'],'attributes':_0x1f0c4b['attributes'],'include':_0x1f0c4b[_0x3922('0x1e')]?_[_0x3922('0x1d')](_0x1f0c4b[_0x3922('0x1e')],function(_0x23c2e8){return{'model':db[_0x23c2e8[_0x3922('0x1f')]],'as':_0x23c2e8['as'],'attributes':_0x23c2e8['attributes'],'include':_0x23c2e8[_0x3922('0x1e')]?_[_0x3922('0x1d')](_0x23c2e8[_0x3922('0x1e')],function(_0x1bbc6c){return{'model':db[_0x1bbc6c[_0x3922('0x1f')]],'as':_0x1bbc6c['as'],'attributes':_0x1bbc6c[_0x3922('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x3922('0xb')](function(_0x5a416a){logger[_0x3922('0xc')](_0x3922('0x15'),_0x50c8f8);logger[_0x3922('0x20')]('GetTrunk',_0x50c8f8,JSON[_0x3922('0xf')](_0x5a416a));_0xd19508(_0x5a416a);})[_0x3922('0x14')](function(_0x4e42e6){logger[_0x3922('0x10')](_0x3922('0x15'),_0x4e42e6[_0x3922('0x12')],_0x50c8f8);_0x2827f3(_0x46575d['error'](0x1f4,_0x4e42e6[_0x3922('0x12')]));});});};exports[_0x3922('0x21')]=function(_0x499b7c){var _0x3c5c48=this;return new Promise(function(_0x526075,_0x46f7d6){return db[_0x3922('0x16')][_0x3922('0x22')]({'raw':_0x499b7c[_0x3922('0x18')]?_0x499b7c[_0x3922('0x18')][_0x3922('0x19')]===undefined?!![]:![]:!![],'where':_0x499b7c[_0x3922('0x18')]?_0x499b7c[_0x3922('0x18')][_0x3922('0x1a')]||null:null,'attributes':_0x499b7c['options']?_0x499b7c[_0x3922('0x18')][_0x3922('0x1b')]||null:null,'include':_0x499b7c[_0x3922('0x18')]?_0x499b7c[_0x3922('0x18')][_0x3922('0x1e')]?_[_0x3922('0x1d')](_0x499b7c[_0x3922('0x18')][_0x3922('0x1e')],function(_0x4b5fe8){return{'model':db[_0x4b5fe8[_0x3922('0x1f')]],'as':_0x4b5fe8['as'],'attributes':_0x4b5fe8['attributes'],'include':_0x4b5fe8[_0x3922('0x1e')]?_[_0x3922('0x1d')](_0x4b5fe8[_0x3922('0x1e')],function(_0x5e90c4){return{'model':db[_0x5e90c4[_0x3922('0x1f')]],'as':_0x5e90c4['as'],'attributes':_0x5e90c4[_0x3922('0x1b')],'include':_0x5e90c4[_0x3922('0x1e')]?_[_0x3922('0x1d')](_0x5e90c4[_0x3922('0x1e')],function(_0x31d603){return{'model':db[_0x31d603[_0x3922('0x1f')]],'as':_0x31d603['as'],'attributes':_0x31d603[_0x3922('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x3922('0xb')](function(_0x4dcba6){logger['info'](_0x3922('0x21'),_0x499b7c);logger[_0x3922('0x20')]('ShowTrunk',_0x499b7c,JSON[_0x3922('0xf')](_0x4dcba6));_0x526075(_0x4dcba6);})[_0x3922('0x14')](function(_0x117fcd){logger[_0x3922('0x10')](_0x3922('0x21'),_0x117fcd['message'],_0x499b7c);_0x46f7d6(_0x3c5c48[_0x3922('0x10')](0x1f4,_0x117fcd['message']));});});}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index a1f19ce..c186d41 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 _0x2360=['addAvatar','/:id/login','/:id/logout','pause','/:id/unpause','unpause','addTeams','addChatInteractions','addMailInteractions','/:id/fax_interactions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','addSquareProjects','createApiKey','update','put','/:id/password','changePassword','delete','removeQueues','removeTeams','destroy','/:id/chat_interactions','removeMailInteractions','removeFaxInteractions','/:id/sms_interactions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./user.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/open_tabs','getVoiceQueuesRt','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','/:id/teams','/:id/lists','getLists','/:id/agents','getAgents','getVoicePrefixes','/:id/fax_accounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post','/:id/contacts','addContacts','create','/create_many','/:id/queues','diskStorage','join','root','%s-%s','now','originalname','/:id/avatar','single'];(function(_0x50e8ae,_0x39549c){var _0x3e6c4c=function(_0x53cb29){while(--_0x53cb29){_0x50e8ae['push'](_0x50e8ae['shift']());}};_0x3e6c4c(++_0x39549c);}(_0x2360,0x16d));var _0x0236=function(_0x4778d5,_0x46e8e7){_0x4778d5=_0x4778d5-0x0;var _0x5337cf=_0x2360[_0x4778d5];return _0x5337cf;};'use strict';var multer=require(_0x0236('0x0'));var util=require(_0x0236('0x1'));var path=require(_0x0236('0x2'));var timeout=require('connect-timeout');var express=require(_0x0236('0x3'));var router=express[_0x0236('0x4')]();var fs_extra=require(_0x0236('0x5'));var auth=require(_0x0236('0x6'));var interaction=require(_0x0236('0x7'));var config=require('../../config/environment');var controller=require(_0x0236('0x8'));router['get']('/',auth[_0x0236('0x9')](),controller[_0x0236('0xa')]);router[_0x0236('0xb')](_0x0236('0xc'),auth[_0x0236('0x9')](),controller[_0x0236('0xd')]);router[_0x0236('0xb')]('/whoami',auth['isAuthenticated'](),controller['whoami']);router[_0x0236('0xb')]('/presence',auth[_0x0236('0x9')](),controller['getPresence']);router[_0x0236('0xb')](_0x0236('0xe'),auth[_0x0236('0x9')](),controller[_0x0236('0xf')]);router[_0x0236('0xb')]('/:id/avatar',controller['getAvatar']);router[_0x0236('0xb')](_0x0236('0x10'),auth[_0x0236('0x9')](),controller['getOpenTabs']);router[_0x0236('0xb')]('/:id/contacts',auth[_0x0236('0x9')](),controller['getContacts']);router[_0x0236('0xb')]('/:id/queues',auth[_0x0236('0x9')](),controller['getQueues']);router[_0x0236('0xb')]('/:id/queues_rt',auth[_0x0236('0x9')](),controller[_0x0236('0x11')]);router[_0x0236('0xb')]('/:id/groups',auth[_0x0236('0x9')](),controller[_0x0236('0x12')]);router['get'](_0x0236('0x13'),auth[_0x0236('0x9')](),controller[_0x0236('0x14')]);router[_0x0236('0xb')](_0x0236('0x15'),auth[_0x0236('0x9')](),controller[_0x0236('0x16')]);router[_0x0236('0xb')](_0x0236('0x17'),auth[_0x0236('0x9')](),controller[_0x0236('0x18')]);router['get']('/:id/openchannel/interactions',auth['isAuthenticated'](),controller[_0x0236('0x19')]);router['get'](_0x0236('0x1a'),auth[_0x0236('0x9')](),controller[_0x0236('0x1b')]);router[_0x0236('0xb')](_0x0236('0x1c'),auth[_0x0236('0x9')](),controller['getSmsInteractions']);router[_0x0236('0xb')](_0x0236('0x1d'),auth[_0x0236('0x9')](),controller[_0x0236('0x1e')]);router['get'](_0x0236('0x1f'),auth[_0x0236('0x9')](),controller['getWhatsappInteractions']);router[_0x0236('0xb')](_0x0236('0x20'),auth[_0x0236('0x9')](),controller['getTeams']);router[_0x0236('0xb')](_0x0236('0x21'),auth['isAuthenticated'](),controller[_0x0236('0x22')]);router['get'](_0x0236('0x23'),auth[_0x0236('0x9')](),controller[_0x0236('0x24')]);router[_0x0236('0xb')]('/:id/prefixes',auth[_0x0236('0x9')](),controller[_0x0236('0x25')]);router[_0x0236('0xb')](_0x0236('0x26'),auth[_0x0236('0x9')](),controller['getFaxAccounts']);router[_0x0236('0xb')](_0x0236('0x27'),auth[_0x0236('0x9')](),controller[_0x0236('0x28')]);router[_0x0236('0xb')](_0x0236('0x29'),auth[_0x0236('0x9')](),controller[_0x0236('0x2a')]);router[_0x0236('0xb')](_0x0236('0x2b'),auth[_0x0236('0x9')](),controller['getSmsAccounts']);router[_0x0236('0xb')](_0x0236('0x2c'),auth[_0x0236('0x9')](),controller[_0x0236('0x2d')]);router[_0x0236('0xb')](_0x0236('0x2e'),auth['isAuthenticated'](),controller[_0x0236('0x2f')]);router[_0x0236('0xb')](_0x0236('0x30'),auth[_0x0236('0x9')](),controller['getSquareProjects']);router[_0x0236('0xb')](_0x0236('0x31'),auth[_0x0236('0x9')](),controller[_0x0236('0x32')]);router[_0x0236('0xb')](_0x0236('0x33'),auth[_0x0236('0x9')](),controller[_0x0236('0x34')]);router[_0x0236('0x35')](_0x0236('0x36'),auth[_0x0236('0x9')](),controller[_0x0236('0x37')]);router[_0x0236('0x35')]('/',auth[_0x0236('0x9')](),controller[_0x0236('0x38')]);router[_0x0236('0x35')](_0x0236('0x39'),auth['isAuthenticated'](),controller['bulkCreate']);router[_0x0236('0x35')](_0x0236('0x3a'),auth[_0x0236('0x9')](),controller['addQueues']);var upload=multer({'storage':multer[_0x0236('0x3b')]({'destination':function(_0x3cde48,_0x4bf7ee,_0x5d280d){_0x5d280d(null,path[_0x0236('0x3c')](config[_0x0236('0x3d')],'server/files/images/'));},'filename':function(_0x187503,_0x215e97,_0x48cf2b){_0x48cf2b(null,util['format'](_0x0236('0x3e'),Date[_0x0236('0x3f')](),_0x215e97[_0x0236('0x40')]));}})});router[_0x0236('0x35')](_0x0236('0x41'),upload[_0x0236('0x42')]('file'),controller[_0x0236('0x43')]);router[_0x0236('0x35')](_0x0236('0x44'),auth[_0x0236('0x9')](),controller['login']);router[_0x0236('0x35')](_0x0236('0x45'),auth['isAuthenticated'](),controller['logout']);router['post']('/:id/pause',auth[_0x0236('0x9')](),controller[_0x0236('0x46')]);router[_0x0236('0x35')](_0x0236('0x47'),auth['isAuthenticated'](),controller[_0x0236('0x48')]);router['post']('/:id/teams',auth[_0x0236('0x9')](),controller[_0x0236('0x49')]);router[_0x0236('0x35')]('/:id/chat_interactions',auth['isAuthenticated'](),controller[_0x0236('0x4a')]);router[_0x0236('0x35')]('/:id/mail_interactions',auth['isAuthenticated'](),controller[_0x0236('0x4b')]);router[_0x0236('0x35')](_0x0236('0x4c'),auth[_0x0236('0x9')](),controller['addFaxInteractions']);router[_0x0236('0x35')]('/:id/sms_interactions',auth[_0x0236('0x9')](),controller['addSmsInteractions']);router[_0x0236('0x35')](_0x0236('0x4d'),auth[_0x0236('0x9')](),controller[_0x0236('0x4e')]);router[_0x0236('0x35')](_0x0236('0x4f'),auth[_0x0236('0x9')](),controller['addWhatsappInteractions']);router[_0x0236('0x35')]('/:id/fax_accounts',auth['isAuthenticated'](),controller[_0x0236('0x50')]);router[_0x0236('0x35')]('/:id/mail_accounts',auth[_0x0236('0x9')](),controller[_0x0236('0x51')]);router[_0x0236('0x35')](_0x0236('0x29'),auth[_0x0236('0x9')](),controller[_0x0236('0x52')]);router[_0x0236('0x35')](_0x0236('0x2b'),auth[_0x0236('0x9')](),controller[_0x0236('0x53')]);router['post'](_0x0236('0x2c'),auth[_0x0236('0x9')](),controller[_0x0236('0x54')]);router[_0x0236('0x35')](_0x0236('0x2e'),auth[_0x0236('0x9')](),controller[_0x0236('0x55')]);router[_0x0236('0x35')](_0x0236('0x30'),auth['isAuthenticated'](),controller[_0x0236('0x56')]);router[_0x0236('0x35')]('/:id/api_key',auth[_0x0236('0x9')](),controller[_0x0236('0x57')]);router['put'](_0x0236('0xe'),auth['isAuthenticated'](),controller[_0x0236('0x58')]);router[_0x0236('0x59')](_0x0236('0x5a'),auth['isAuthenticated'](),controller[_0x0236('0x5b')]);router[_0x0236('0x5c')](_0x0236('0x3a'),auth[_0x0236('0x9')](),controller[_0x0236('0x5d')]);router[_0x0236('0x5c')](_0x0236('0x20'),auth[_0x0236('0x9')](),controller[_0x0236('0x5e')]);router[_0x0236('0x5c')](_0x0236('0xe'),auth[_0x0236('0x9')](),controller[_0x0236('0x5f')]);router[_0x0236('0x5c')](_0x0236('0x60'),auth[_0x0236('0x9')](),controller['removeChatInteractions']);router[_0x0236('0x5c')]('/:id/mail_interactions',auth[_0x0236('0x9')](),controller[_0x0236('0x61')]);router[_0x0236('0x5c')](_0x0236('0x4c'),auth[_0x0236('0x9')](),controller[_0x0236('0x62')]);router['delete'](_0x0236('0x63'),auth[_0x0236('0x9')](),controller['removeSmsInteractions']);router['delete'](_0x0236('0x4d'),auth['isAuthenticated'](),controller[_0x0236('0x64')]);router[_0x0236('0x5c')](_0x0236('0x4f'),auth['isAuthenticated'](),controller[_0x0236('0x65')]);router[_0x0236('0x5c')](_0x0236('0x26'),auth['isAuthenticated'](),controller[_0x0236('0x66')]);router[_0x0236('0x5c')](_0x0236('0x27'),auth['isAuthenticated'](),controller['removeMailAccounts']);router['delete'](_0x0236('0x29'),auth[_0x0236('0x9')](),controller[_0x0236('0x67')]);router[_0x0236('0x5c')](_0x0236('0x2b'),auth[_0x0236('0x9')](),controller[_0x0236('0x68')]);router[_0x0236('0x5c')](_0x0236('0x2c'),auth[_0x0236('0x9')](),controller[_0x0236('0x69')]);router[_0x0236('0x5c')](_0x0236('0x2e'),auth[_0x0236('0x9')](),controller[_0x0236('0x6a')]);router[_0x0236('0x5c')](_0x0236('0x30'),auth['isAuthenticated'](),controller[_0x0236('0x6b')]);router[_0x0236('0x5c')](_0x0236('0x33'),auth['isAuthenticated'](),controller['removeApiKey']);module['exports']=router; \ No newline at end of file +var _0xf847=['removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','removeApiKey','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','get','isAuthenticated','index','describe','/whoami','whoami','getPresence','/:id','show','getAvatar','/:id/open_tabs','getOpenTabs','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','getAgents','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','/:id/scheduled_calls','/:id/api_key','getApiKey','post','create','/create_many','/:id/queues','diskStorage','join','root','server/files/images/','%s-%s','now','originalname','/:id/avatar','login','/:id/logout','logout','pause','/:id/unpause','unpause','/:id/chat_interactions','addChatInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addFaxAccounts','addMailAccounts','addChatWebsites','addWhatsappAccounts','addSquareProjects','createApiKey','put','/:id/password','changePassword','removeQueues','delete','removeTeams','destroy','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts'];(function(_0x1047b8,_0x51a603){var _0x304a8c=function(_0x46a549){while(--_0x46a549){_0x1047b8['push'](_0x1047b8['shift']());}};_0x304a8c(++_0x51a603);}(_0xf847,0xdd));var _0x7f84=function(_0x516b8,_0x531549){_0x516b8=_0x516b8-0x0;var _0x600afa=_0xf847[_0x516b8];return _0x600afa;};'use strict';var multer=require(_0x7f84('0x0'));var util=require(_0x7f84('0x1'));var path=require(_0x7f84('0x2'));var timeout=require(_0x7f84('0x3'));var express=require(_0x7f84('0x4'));var router=express['Router']();var fs_extra=require(_0x7f84('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x7f84('0x6'));var config=require('../../config/environment');var controller=require('./user.controller');router[_0x7f84('0x7')]('/',auth[_0x7f84('0x8')](),controller[_0x7f84('0x9')]);router[_0x7f84('0x7')]('/describe',auth[_0x7f84('0x8')](),controller[_0x7f84('0xa')]);router[_0x7f84('0x7')](_0x7f84('0xb'),auth[_0x7f84('0x8')](),controller[_0x7f84('0xc')]);router[_0x7f84('0x7')]('/presence',auth[_0x7f84('0x8')](),controller[_0x7f84('0xd')]);router[_0x7f84('0x7')](_0x7f84('0xe'),auth[_0x7f84('0x8')](),controller[_0x7f84('0xf')]);router['get']('/:id/avatar',controller[_0x7f84('0x10')]);router['get'](_0x7f84('0x11'),auth[_0x7f84('0x8')](),controller[_0x7f84('0x12')]);router[_0x7f84('0x7')]('/:id/contacts',auth[_0x7f84('0x8')](),controller['getContacts']);router[_0x7f84('0x7')]('/:id/queues',auth[_0x7f84('0x8')](),controller['getQueues']);router[_0x7f84('0x7')]('/:id/queues_rt',auth[_0x7f84('0x8')](),controller[_0x7f84('0x13')]);router[_0x7f84('0x7')](_0x7f84('0x14'),auth[_0x7f84('0x8')](),controller[_0x7f84('0x15')]);router[_0x7f84('0x7')](_0x7f84('0x16'),auth[_0x7f84('0x8')](),controller['getRecordings']);router[_0x7f84('0x7')]('/:id/screen_recordings',auth[_0x7f84('0x8')](),controller[_0x7f84('0x17')]);router['get'](_0x7f84('0x18'),auth[_0x7f84('0x8')](),controller[_0x7f84('0x19')]);router[_0x7f84('0x7')](_0x7f84('0x1a'),auth[_0x7f84('0x8')](),controller[_0x7f84('0x1b')]);router[_0x7f84('0x7')]('/:id/mail/interactions',auth[_0x7f84('0x8')](),controller['getMailInteractions']);router['get'](_0x7f84('0x1c'),auth[_0x7f84('0x8')](),controller[_0x7f84('0x1d')]);router['get'](_0x7f84('0x1e'),auth[_0x7f84('0x8')](),controller[_0x7f84('0x1f')]);router[_0x7f84('0x7')](_0x7f84('0x20'),auth[_0x7f84('0x8')](),controller['getWhatsappInteractions']);router[_0x7f84('0x7')](_0x7f84('0x21'),auth[_0x7f84('0x8')](),controller[_0x7f84('0x22')]);router[_0x7f84('0x7')](_0x7f84('0x23'),auth['isAuthenticated'](),controller[_0x7f84('0x24')]);router[_0x7f84('0x7')](_0x7f84('0x25'),auth['isAuthenticated'](),controller[_0x7f84('0x26')]);router[_0x7f84('0x7')]('/:id/prefixes',auth['isAuthenticated'](),controller[_0x7f84('0x27')]);router[_0x7f84('0x7')](_0x7f84('0x28'),auth[_0x7f84('0x8')](),controller[_0x7f84('0x29')]);router[_0x7f84('0x7')](_0x7f84('0x2a'),auth[_0x7f84('0x8')](),controller[_0x7f84('0x2b')]);router[_0x7f84('0x7')](_0x7f84('0x2c'),auth[_0x7f84('0x8')](),controller[_0x7f84('0x2d')]);router[_0x7f84('0x7')](_0x7f84('0x2e'),auth[_0x7f84('0x8')](),controller['getSmsAccounts']);router[_0x7f84('0x7')](_0x7f84('0x2f'),auth[_0x7f84('0x8')](),controller[_0x7f84('0x30')]);router[_0x7f84('0x7')](_0x7f84('0x31'),auth[_0x7f84('0x8')](),controller[_0x7f84('0x32')]);router['get'](_0x7f84('0x33'),auth[_0x7f84('0x8')](),controller['getSquareProjects']);router[_0x7f84('0x7')](_0x7f84('0x34'),auth[_0x7f84('0x8')](),controller['getScheduledCalls']);router[_0x7f84('0x7')](_0x7f84('0x35'),auth['isAuthenticated'](),controller[_0x7f84('0x36')]);router[_0x7f84('0x37')]('/:id/contacts',auth[_0x7f84('0x8')](),controller['addContacts']);router['post']('/',auth[_0x7f84('0x8')](),controller[_0x7f84('0x38')]);router[_0x7f84('0x37')](_0x7f84('0x39'),auth[_0x7f84('0x8')](),controller['bulkCreate']);router['post'](_0x7f84('0x3a'),auth[_0x7f84('0x8')](),controller['addQueues']);var upload=multer({'storage':multer[_0x7f84('0x3b')]({'destination':function(_0x670c2a,_0x1034a5,_0x43c908){_0x43c908(null,path[_0x7f84('0x3c')](config[_0x7f84('0x3d')],_0x7f84('0x3e')));},'filename':function(_0x27a499,_0x3df9fa,_0x148045){_0x148045(null,util['format'](_0x7f84('0x3f'),Date[_0x7f84('0x40')](),_0x3df9fa[_0x7f84('0x41')]));}})});router[_0x7f84('0x37')](_0x7f84('0x42'),upload['single']('file'),controller['addAvatar']);router['post']('/:id/login',auth['isAuthenticated'](),controller[_0x7f84('0x43')]);router['post'](_0x7f84('0x44'),auth[_0x7f84('0x8')](),controller[_0x7f84('0x45')]);router['post']('/:id/pause',auth['isAuthenticated'](),controller[_0x7f84('0x46')]);router[_0x7f84('0x37')](_0x7f84('0x47'),auth[_0x7f84('0x8')](),controller[_0x7f84('0x48')]);router[_0x7f84('0x37')](_0x7f84('0x21'),auth[_0x7f84('0x8')](),controller['addTeams']);router[_0x7f84('0x37')](_0x7f84('0x49'),auth[_0x7f84('0x8')](),controller[_0x7f84('0x4a')]);router[_0x7f84('0x37')]('/:id/mail_interactions',auth['isAuthenticated'](),controller['addMailInteractions']);router[_0x7f84('0x37')](_0x7f84('0x4b'),auth['isAuthenticated'](),controller[_0x7f84('0x4c')]);router[_0x7f84('0x37')](_0x7f84('0x4d'),auth[_0x7f84('0x8')](),controller[_0x7f84('0x4e')]);router['post'](_0x7f84('0x4f'),auth[_0x7f84('0x8')](),controller[_0x7f84('0x50')]);router['post'](_0x7f84('0x51'),auth[_0x7f84('0x8')](),controller['addWhatsappInteractions']);router['post']('/:id/fax_accounts',auth[_0x7f84('0x8')](),controller[_0x7f84('0x52')]);router[_0x7f84('0x37')](_0x7f84('0x2a'),auth[_0x7f84('0x8')](),controller[_0x7f84('0x53')]);router[_0x7f84('0x37')](_0x7f84('0x2c'),auth[_0x7f84('0x8')](),controller['addOpenchannelAccounts']);router[_0x7f84('0x37')](_0x7f84('0x2e'),auth[_0x7f84('0x8')](),controller['addSmsAccounts']);router[_0x7f84('0x37')](_0x7f84('0x2f'),auth['isAuthenticated'](),controller[_0x7f84('0x54')]);router['post'](_0x7f84('0x31'),auth['isAuthenticated'](),controller[_0x7f84('0x55')]);router[_0x7f84('0x37')](_0x7f84('0x33'),auth['isAuthenticated'](),controller[_0x7f84('0x56')]);router[_0x7f84('0x37')](_0x7f84('0x35'),auth['isAuthenticated'](),controller[_0x7f84('0x57')]);router[_0x7f84('0x58')](_0x7f84('0xe'),auth[_0x7f84('0x8')](),controller['update']);router[_0x7f84('0x58')](_0x7f84('0x59'),auth[_0x7f84('0x8')](),controller[_0x7f84('0x5a')]);router['delete'](_0x7f84('0x3a'),auth[_0x7f84('0x8')](),controller[_0x7f84('0x5b')]);router[_0x7f84('0x5c')](_0x7f84('0x21'),auth[_0x7f84('0x8')](),controller[_0x7f84('0x5d')]);router['delete'](_0x7f84('0xe'),auth[_0x7f84('0x8')](),controller[_0x7f84('0x5e')]);router[_0x7f84('0x5c')](_0x7f84('0x49'),auth['isAuthenticated'](),controller[_0x7f84('0x5f')]);router[_0x7f84('0x5c')]('/:id/mail_interactions',auth[_0x7f84('0x8')](),controller[_0x7f84('0x60')]);router[_0x7f84('0x5c')](_0x7f84('0x4b'),auth[_0x7f84('0x8')](),controller[_0x7f84('0x61')]);router['delete'](_0x7f84('0x4d'),auth[_0x7f84('0x8')](),controller[_0x7f84('0x62')]);router[_0x7f84('0x5c')](_0x7f84('0x4f'),auth[_0x7f84('0x8')](),controller[_0x7f84('0x63')]);router['delete']('/:id/whatsapp_interactions',auth[_0x7f84('0x8')](),controller[_0x7f84('0x64')]);router['delete'](_0x7f84('0x28'),auth[_0x7f84('0x8')](),controller[_0x7f84('0x65')]);router[_0x7f84('0x5c')](_0x7f84('0x2a'),auth[_0x7f84('0x8')](),controller[_0x7f84('0x66')]);router[_0x7f84('0x5c')](_0x7f84('0x2c'),auth[_0x7f84('0x8')](),controller['removeOpenchannelAccounts']);router[_0x7f84('0x5c')](_0x7f84('0x2e'),auth['isAuthenticated'](),controller[_0x7f84('0x67')]);router[_0x7f84('0x5c')](_0x7f84('0x2f'),auth['isAuthenticated'](),controller[_0x7f84('0x68')]);router[_0x7f84('0x5c')](_0x7f84('0x31'),auth[_0x7f84('0x8')](),controller[_0x7f84('0x69')]);router['delete'](_0x7f84('0x33'),auth[_0x7f84('0x8')](),controller[_0x7f84('0x6a')]);router[_0x7f84('0x5c')](_0x7f84('0x35'),auth[_0x7f84('0x8')](),controller[_0x7f84('0x6b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index c3ce4ce..55fa2b9 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 _0xcaaf=['permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blocked','blockedAt','loginAttempts','UNSIGNED','sequelize','util','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','format','getDataValue','email','toLowerCase','ENUM','admin','user','agent','telephone','local','INTEGER','internal','accountcode','\x22%s\x22\x20<%s>','BOOLEAN','DATE','DEFAULT\x20PAUSE','dynamic','friend','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB','udp','transport','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','nonat','update','outgoing','force_rport,comedia','nat','split','all','ulaw;alaw;gsm','allow','insecure','never','\x22\x22\x20<>','refuse','originate','uac','uas','fingerprint','certificate','passive','actpass','update,nonat','TEXT','showWebBar','isArray','avpf','force_avp','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','rtcp_mux','wss','encryption','icesupport','/etc/pki/tls/private/motion.key'];(function(_0x259654,_0x179858){var _0x1b1411=function(_0x43e05f){while(--_0x43e05f){_0x259654['push'](_0x259654['shift']());}};_0x1b1411(++_0x179858);}(_0xcaaf,0x66));var _0xfcaa=function(_0x3db4e9,_0x47e6ec){_0x3db4e9=_0x3db4e9-0x0;var _0x18601c=_0xcaaf[_0x3db4e9];return _0x18601c;};'use strict';var Sequelize=require(_0xfcaa('0x0'));var moment=require('moment');var util=require(_0xfcaa('0x1'));var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':![],'unique':_0xfcaa('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x4b8844){this[_0xfcaa('0x4')]('name',_0x4b8844);this['setDataValue'](_0xfcaa('0x5'),_0x4b8844);},'comment':_0xfcaa('0x6')},'fullname':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':![],'set':function(_0x28a6b6){this[_0xfcaa('0x4')](_0xfcaa('0x7'),_0x28a6b6);this[_0xfcaa('0x4')]('callerid',util[_0xfcaa('0x8')]('\x22%s\x22\x20<%s>',_0x28a6b6,this[_0xfcaa('0x9')]('internal')));}},'alias':{'type':Sequelize[_0xfcaa('0x2')]},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0x345e39){if(_0x345e39){this['setDataValue'](_0xfcaa('0xa'),_0x345e39[_0xfcaa('0xb')]());}}},'role':{'type':Sequelize[_0xfcaa('0xc')](_0xfcaa('0xd'),_0xfcaa('0xe'),_0xfcaa('0xf'),_0xfcaa('0x10')),'allowNull':![]},'password':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':_0xfcaa('0x11')},'internal':{'type':Sequelize[_0xfcaa('0x12')](0xb),'allowNull':![],'unique':_0xfcaa('0x13'),'set':function(_0x46181e){this['setDataValue'](_0xfcaa('0x13'),_0x46181e);this[_0xfcaa('0x4')](_0xfcaa('0x14'),_0x46181e);this[_0xfcaa('0x4')]('callerid',util[_0xfcaa('0x8')](_0xfcaa('0x15'),this[_0xfcaa('0x9')]('fullname'),_0x46181e));}},'salt':{'type':Sequelize[_0xfcaa('0x2')]},'phone':{'type':Sequelize[_0xfcaa('0x2')]},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize[_0xfcaa('0x2')]},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xfcaa('0x2')]},'country':{'type':Sequelize[_0xfcaa('0x2')]},'online':{'type':Sequelize[_0xfcaa('0x16')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0xfcaa('0x17')]},'voicePause':{'type':Sequelize[_0xfcaa('0x16')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xfcaa('0x16')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0xfcaa('0x16')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xfcaa('0x16')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xfcaa('0x16')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0xfcaa('0x16')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xfcaa('0x2')],'defaultValue':_0xfcaa('0x18')},'lastPauseAt':{'type':Sequelize[_0xfcaa('0x17')]},'chatCapacity':{'type':Sequelize[_0xfcaa('0x12')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xfcaa('0x12')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xfcaa('0x12')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xfcaa('0x12')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xfcaa('0x12')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xfcaa('0x12')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xfcaa('0x16')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xfcaa('0x12')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xfcaa('0x12')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xfcaa('0x12')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0xfcaa('0x16')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0xfcaa('0x16')],'defaultValue':![]},'description':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':!![]},'host':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':!![],'defaultValue':_0xfcaa('0x19')},'ipaddr':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':!![]},'port':{'type':Sequelize[_0xfcaa('0x12')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xfcaa('0x12')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize['STRING'],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize['ENUM'](_0xfcaa('0x1a'),_0xfcaa('0xe'),'peer'),'allowNull':!![],'defaultValue':_0xfcaa('0x1a')},'context':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize[_0xfcaa('0xc')]('ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN',_0xfcaa('0x1b'),_0xfcaa('0x1c'),_0xfcaa('0x1d'),_0xfcaa('0x1e'),'PROHIB_FAILED_SCREEN',_0xfcaa('0x1f')),'allowNull':!![]},'deny':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':!![]},'transport':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':!![],'defaultValue':_0xfcaa('0x20'),'set':function(_0x2b2a2d){this['setDataValue'](_0xfcaa('0x21'),_0x2b2a2d?_0x2b2a2d[_0xfcaa('0x22')](','):null);},'get':function(){return this[_0xfcaa('0x9')](_0xfcaa('0x21'))?this['getDataValue'](_0xfcaa('0x21'))['split'](','):null;},'comment':_0xfcaa('0x23')},'dtmfmode':{'type':Sequelize['ENUM'](_0xfcaa('0x24'),_0xfcaa('0x25'),_0xfcaa('0x26'),_0xfcaa('0x27'),_0xfcaa('0x28')),'allowNull':!![],'defaultValue':_0xfcaa('0x24')},'directmedia':{'type':Sequelize['ENUM'](_0xfcaa('0x29'),'no',_0xfcaa('0x2a'),_0xfcaa('0x2b'),_0xfcaa('0x2c')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xfcaa('0xc')](_0xfcaa('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':!![]},'nat':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':!![],'defaultValue':_0xfcaa('0x2d'),'set':function(_0x37b7b4){this[_0xfcaa('0x4')](_0xfcaa('0x2e'),_0x37b7b4?_0x37b7b4[_0xfcaa('0x22')](','):null);},'get':function(){return this['getDataValue']('nat')?this[_0xfcaa('0x9')]('nat')[_0xfcaa('0x2f')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0xfcaa('0x2')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0xfcaa('0x2')]},'namedpickupgroup':{'type':Sequelize[_0xfcaa('0x2')]},'language':{'type':Sequelize[_0xfcaa('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xfcaa('0x2')]},'disallow':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':![],'defaultValue':_0xfcaa('0x30')},'allow':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':![],'defaultValue':_0xfcaa('0x31'),'set':function(_0x572ae3){this[_0xfcaa('0x4')](_0xfcaa('0x32'),_0x572ae3?_0x572ae3[_0xfcaa('0x22')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0xfcaa('0x9')](_0xfcaa('0x32'))?this[_0xfcaa('0x9')](_0xfcaa('0x32'))[_0xfcaa('0x2f')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize[_0xfcaa('0xc')](_0xfcaa('0x29'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':!![],'set':function(_0x3c7424){this[_0xfcaa('0x4')]('insecure',_0x3c7424?_0x3c7424['join'](','):null);},'get':function(){return this[_0xfcaa('0x9')](_0xfcaa('0x33'))?this['getDataValue'](_0xfcaa('0x33'))[_0xfcaa('0x2f')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0xfcaa('0xc')](_0xfcaa('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xfcaa('0xc')](_0xfcaa('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0xfcaa('0x29'),'no',_0xfcaa('0x34')),'allowNull':!![]},'promiscredir':{'type':Sequelize['ENUM'](_0xfcaa('0x29'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0xfcaa('0xc')](_0xfcaa('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0xfcaa('0x12')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xfcaa('0x35')},'amaflags':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xfcaa('0xc')](_0xfcaa('0x29'),'no'),'allowNull':!![],'defaultValue':_0xfcaa('0x29')},'busylevel':{'type':Sequelize[_0xfcaa('0x12')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0xfcaa('0xc')]('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xfcaa('0xc')]('yes','no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xfcaa('0xc')]('yes','no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xfcaa('0xc')]('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xfcaa('0xc')](_0xfcaa('0x29'),'no','always'),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xfcaa('0x12')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xfcaa('0xc')](_0xfcaa('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0xfcaa('0xc')]('accept',_0xfcaa('0x36'),_0xfcaa('0x37')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xfcaa('0x12')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0xfcaa('0x12')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xfcaa('0xc')](_0xfcaa('0x38'),_0xfcaa('0x39')),'allowNull':!![],'defaultValue':_0xfcaa('0x39')},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize['STRING'],'allowNull':!![]},'fromdomain':{'type':Sequelize['STRING'],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0xfcaa('0x29'),'no'),'allowNull':!![],'defaultValue':_0xfcaa('0x29')},'keepalive':{'type':Sequelize[_0xfcaa('0x12')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xfcaa('0x12')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xfcaa('0x12')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xfcaa('0x12')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0xfcaa('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING'],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':!![]},'timert1':{'type':Sequelize[_0xfcaa('0x12')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xfcaa('0x12')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xfcaa('0xc')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xfcaa('0xc')](_0xfcaa('0x29'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xfcaa('0xc')](_0xfcaa('0x29'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0xfcaa('0x29'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xfcaa('0xc')]('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xfcaa('0xc')](_0xfcaa('0x29'),'no',_0xfcaa('0x3a'),_0xfcaa('0x3b')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xfcaa('0xc')]('active',_0xfcaa('0x3c'),_0xfcaa('0x3d')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0xfcaa('0xc')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xfcaa('0x12')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0xfcaa('0xc')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize['ENUM'](_0xfcaa('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xfcaa('0xc')](_0xfcaa('0x29'),'no',_0xfcaa('0x2a'),_0xfcaa('0x2b'),_0xfcaa('0x3e')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xfcaa('0x16')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize['DATE']},'passwordResetAt':{'type':Sequelize[_0xfcaa('0x17')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0xfcaa('0x3f')]},'showWebBar':{'type':Sequelize[_0xfcaa('0x12')],'defaultValue':0x0,'set':function(_0x30beba){this[_0xfcaa('0x4')](_0xfcaa('0x40'),_0x30beba);var _0x8b1f43=this['get']({'plain':!![]});switch(_0x30beba){case 0x0:case 0x1:var _0x4f324b=_0x8b1f43[_0xfcaa('0x21')]?_[_0xfcaa('0x41')](_0x8b1f43['transport'])?_0x8b1f43[_0xfcaa('0x21')]['join']():_0x8b1f43[_0xfcaa('0x21')]:_0xfcaa('0x20');if(_0x4f324b==='wss'){_0x4f324b=_0xfcaa('0x20');}this[_0xfcaa('0x4')]('transport',_0x4f324b);this[_0xfcaa('0x4')]('encryption','no');this[_0xfcaa('0x4')](_0xfcaa('0x42'),null);this['setDataValue'](_0xfcaa('0x43'),null);this[_0xfcaa('0x4')]('icesupport',null);this[_0xfcaa('0x4')](_0xfcaa('0x44'),null);this[_0xfcaa('0x4')](_0xfcaa('0x45'),null);this[_0xfcaa('0x4')](_0xfcaa('0x46'),null);this[_0xfcaa('0x4')](_0xfcaa('0x47'),null);this[_0xfcaa('0x4')](_0xfcaa('0x48'),null);this['setDataValue'](_0xfcaa('0x49'),'no');break;case 0x2:this[_0xfcaa('0x4')](_0xfcaa('0x21'),_0xfcaa('0x4a'));this[_0xfcaa('0x4')](_0xfcaa('0x4b'),_0xfcaa('0x29'));this[_0xfcaa('0x4')](_0xfcaa('0x42'),_0xfcaa('0x29'));this['setDataValue'](_0xfcaa('0x43'),_0xfcaa('0x29'));this[_0xfcaa('0x4')](_0xfcaa('0x4c'),_0xfcaa('0x29'));this[_0xfcaa('0x4')](_0xfcaa('0x44'),_0xfcaa('0x29'));this[_0xfcaa('0x4')](_0xfcaa('0x45'),'no');this[_0xfcaa('0x4')]('dtlssetup','actpass');this[_0xfcaa('0x4')](_0xfcaa('0x47'),_0x8b1f43[_0xfcaa('0x47')]||'/etc/pki/tls/certs/motion.crt');this[_0xfcaa('0x4')](_0xfcaa('0x48'),_0x8b1f43[_0xfcaa('0x48')]||_0xfcaa('0x4d'));this[_0xfcaa('0x4')](_0xfcaa('0x49'),_0xfcaa('0x29'));break;default:}}},'permissions':{'type':Sequelize[_0xfcaa('0x3f')],'set':function(_0x21d202){this[_0xfcaa('0x4')](_0xfcaa('0x4e'),_0x21d202?_0x21d202['join'](','):[]);},'get':function(){return this[_0xfcaa('0x9')](_0xfcaa('0x4e'))?_[_0xfcaa('0x4f')](this[_0xfcaa('0x9')](_0xfcaa('0x4e'))[_0xfcaa('0x2f')](','),function(_0x235f91){return parseInt(_0x235f91,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xfcaa('0x2')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0xfcaa('0x2')]},'phoneBarBusyNumber':{'type':Sequelize[_0xfcaa('0x2')]},'phoneBarUnconditional':{'type':Sequelize[_0xfcaa('0x16')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xfcaa('0x16')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xfcaa('0x16')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xfcaa('0x16')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xfcaa('0x16')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xfcaa('0x16')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize['STRING'],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xfcaa('0xc')](_0xfcaa('0x29'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xfcaa('0x16')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xfcaa('0x2')]},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xfcaa('0x16')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0xfcaa('0x50')],'get':function(){return this[_0xfcaa('0x9')](_0xfcaa('0x51'))?this[_0xfcaa('0x9')](_0xfcaa('0x51')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xfcaa('0x16')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xfcaa('0x16')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xfcaa('0x16')],'defaultValue':![]},'interface':{'type':Sequelize[_0xfcaa('0x2')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xfcaa('0x16')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xfcaa('0x16')],'defaultValue':![],'set':function(_0x434cbf){if(typeof _0x434cbf===_0xfcaa('0x52')){var _0x204fe4=_0x434cbf==='1'?!![]:_0x434cbf==='0'?![]:_0x434cbf===_0xfcaa('0x53')?!![]:_0x434cbf===_0xfcaa('0x54')?![]:![];this[_0xfcaa('0x4')](_0xfcaa('0x55'),_0x204fe4);}else{this[_0xfcaa('0x4')](_0xfcaa('0x55'),_0x434cbf);}}},'blocked':{'type':Sequelize[_0xfcaa('0x16')],'defaultValue':![],'set':function(_0x51747a){this[_0xfcaa('0x4')](_0xfcaa('0x56'),_0x51747a);if(_0x51747a===!![]){this[_0xfcaa('0x4')](_0xfcaa('0x57'),moment());this[_0xfcaa('0x4')](_0xfcaa('0x58'),0x0);}else{this[_0xfcaa('0x4')](_0xfcaa('0x57'),null);}}},'blockedAt':{'type':Sequelize[_0xfcaa('0x17')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0xfcaa('0x12')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xfcaa('0x16')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0xfcaa('0x16')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0xfcaa('0x12')](0x5)[_0xfcaa('0x59')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xfcaa('0x16')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xfcaa('0x16')],'defaultValue':!![]}}; \ No newline at end of file +var _0xaaee=['rtcp_mux','wss','dtlsverify','/etc/pki/tls/certs/motion.crt','TEXT','permissions','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','loginAttempts','blockedAt','UNSIGNED','sequelize','moment','util','lodash','exports','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','STRING','fullname','format','\x22%s\x22\x20<%s>','internal','email','toLowerCase','admin','user','agent','telephone','INTEGER','accountcode','callerid','getDataValue','BOOLEAN','DATE','DEFAULT\x20PAUSE','dynamic','ENUM','peer','friend','from-sip','ALLOWED_NOT_SCREENED','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]','info','shortinfo','inband','auto','rfc2833','nonat','outgoing','nat','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','yes','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always','accept','refuse','originate','uas','fingerprint','certificate','active','passive','actpass','update','update,nonat','showWebBar','isArray','encryption','avpf','force_avp','icesupport','dtlsenable','dtlssetup','dtlscertfile','dtlsprivatekey'];(function(_0x3e3051,_0x21bbdc){var _0x19f2cd=function(_0x4412c3){while(--_0x4412c3){_0x3e3051['push'](_0x3e3051['shift']());}};_0x19f2cd(++_0x21bbdc);}(_0xaaee,0x132));var _0xeaae=function(_0x2f7b15,_0x387cd3){_0x2f7b15=_0x2f7b15-0x0;var _0x8b2e71=_0xaaee[_0x2f7b15];return _0x8b2e71;};'use strict';var Sequelize=require(_0xeaae('0x0'));var moment=require(_0xeaae('0x1'));var util=require(_0xeaae('0x2'));var _=require(_0xeaae('0x3'));module[_0xeaae('0x4')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xeaae('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x2778d9){this[_0xeaae('0x6')](_0xeaae('0x5'),_0x2778d9);this[_0xeaae('0x6')](_0xeaae('0x7'),_0x2778d9);},'comment':_0xeaae('0x8')},'fullname':{'type':Sequelize[_0xeaae('0x9')],'allowNull':![],'set':function(_0x113fa9){this[_0xeaae('0x6')](_0xeaae('0xa'),_0x113fa9);this[_0xeaae('0x6')]('callerid',util[_0xeaae('0xb')](_0xeaae('0xc'),_0x113fa9,this['getDataValue'](_0xeaae('0xd'))));}},'alias':{'type':Sequelize[_0xeaae('0x9')]},'email':{'type':Sequelize[_0xeaae('0x9')],'allowNull':![],'unique':_0xeaae('0xe'),'validate':{'isEmail':!![]},'set':function(_0x484be3){if(_0x484be3){this['setDataValue'](_0xeaae('0xe'),_0x484be3[_0xeaae('0xf')]());}}},'role':{'type':Sequelize['ENUM'](_0xeaae('0x10'),_0xeaae('0x11'),_0xeaae('0x12'),_0xeaae('0x13')),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0xeaae('0x9')],'defaultValue':'local'},'internal':{'type':Sequelize[_0xeaae('0x14')](0xb),'allowNull':![],'unique':_0xeaae('0xd'),'set':function(_0x415a90){this[_0xeaae('0x6')](_0xeaae('0xd'),_0x415a90);this[_0xeaae('0x6')](_0xeaae('0x15'),_0x415a90);this[_0xeaae('0x6')](_0xeaae('0x16'),util[_0xeaae('0xb')](_0xeaae('0xc'),this[_0xeaae('0x17')](_0xeaae('0xa')),_0x415a90));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xeaae('0x9')]},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize[_0xeaae('0x9')]},'zipcode':{'type':Sequelize[_0xeaae('0x9')]},'userpic':{'type':Sequelize[_0xeaae('0x9')]},'city':{'type':Sequelize[_0xeaae('0x9')]},'country':{'type':Sequelize[_0xeaae('0x9')]},'online':{'type':Sequelize[_0xeaae('0x18')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0xeaae('0x19')]},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xeaae('0x18')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0xeaae('0x18')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xeaae('0x18')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xeaae('0x18')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0xeaae('0x18')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0xeaae('0x18')],'defaultValue':![]},'pauseType':{'type':Sequelize['STRING'],'defaultValue':_0xeaae('0x1a')},'lastPauseAt':{'type':Sequelize[_0xeaae('0x19')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xeaae('0x14')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xeaae('0x14')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xeaae('0x14')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xeaae('0x14')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xeaae('0x18')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xeaae('0x14')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xeaae('0x14')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xeaae('0x18')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0xeaae('0x18')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0xeaae('0x18')],'defaultValue':![]},'description':{'type':Sequelize[_0xeaae('0x9')],'allowNull':!![]},'host':{'type':Sequelize[_0xeaae('0x9')],'allowNull':!![],'defaultValue':_0xeaae('0x1b')},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize[_0xeaae('0x14')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xeaae('0x14')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize[_0xeaae('0x9')],'allowNull':!![]},'useragent':{'type':Sequelize[_0xeaae('0x9')],'allowNull':!![]},'lastms':{'type':Sequelize[_0xeaae('0x14')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xeaae('0x1c')]('friend',_0xeaae('0x11'),_0xeaae('0x1d')),'allowNull':!![],'defaultValue':_0xeaae('0x1e')},'context':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xeaae('0x1f')},'callingpres':{'type':Sequelize[_0xeaae('0x1c')](_0xeaae('0x20'),_0xeaae('0x21'),_0xeaae('0x22'),'ALLOWED',_0xeaae('0x23'),_0xeaae('0x24'),'PROHIB_FAILED_SCREEN',_0xeaae('0x25')),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0xeaae('0x9')],'allowNull':!![]},'secret':{'type':Sequelize['STRING'],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xeaae('0x9')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xeaae('0x9')],'allowNull':!![]},'transport':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xeaae('0x26'),'set':function(_0x2bd911){this[_0xeaae('0x6')](_0xeaae('0x27'),_0x2bd911?_0x2bd911['join'](','):null);},'get':function(){return this[_0xeaae('0x17')](_0xeaae('0x27'))?this['getDataValue']('transport')[_0xeaae('0x28')](','):null;},'comment':_0xeaae('0x29')},'dtmfmode':{'type':Sequelize[_0xeaae('0x1c')]('rfc2833',_0xeaae('0x2a'),_0xeaae('0x2b'),_0xeaae('0x2c'),_0xeaae('0x2d')),'allowNull':!![],'defaultValue':_0xeaae('0x2e')},'directmedia':{'type':Sequelize[_0xeaae('0x1c')]('yes','no',_0xeaae('0x2f'),'update',_0xeaae('0x30')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xeaae('0x1c')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xeaae('0x9')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xeaae('0x9')],'allowNull':!![]},'nat':{'type':Sequelize[_0xeaae('0x9')],'allowNull':!![],'defaultValue':'force_rport,comedia','set':function(_0x3d4302){this[_0xeaae('0x6')](_0xeaae('0x31'),_0x3d4302?_0x3d4302[_0xeaae('0x32')](','):null);},'get':function(){return this[_0xeaae('0x17')](_0xeaae('0x31'))?this[_0xeaae('0x17')]('nat')[_0xeaae('0x28')](','):null;},'comment':_0xeaae('0x33')},'callgroup':{'type':Sequelize[_0xeaae('0x9')]},'namedcallgroup':{'type':Sequelize[_0xeaae('0x9')]},'pickupgroup':{'type':Sequelize[_0xeaae('0x9')]},'namedpickupgroup':{'type':Sequelize[_0xeaae('0x9')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize[_0xeaae('0x9')],'allowNull':![],'defaultValue':_0xeaae('0x34')},'allow':{'type':Sequelize[_0xeaae('0x9')],'allowNull':![],'defaultValue':_0xeaae('0x35'),'set':function(_0x13ef63){this[_0xeaae('0x6')](_0xeaae('0x36'),_0x13ef63?_0x13ef63[_0xeaae('0x32')](';'):_0xeaae('0x35'));},'get':function(){return this['getDataValue'](_0xeaae('0x36'))?this['getDataValue'](_0xeaae('0x36'))[_0xeaae('0x28')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize['ENUM'](_0xeaae('0x37'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xeaae('0x9')],'allowNull':!![],'set':function(_0x4d88b2){this['setDataValue'](_0xeaae('0x38'),_0x4d88b2?_0x4d88b2[_0xeaae('0x32')](','):null);},'get':function(){return this[_0xeaae('0x17')](_0xeaae('0x38'))?this[_0xeaae('0x17')](_0xeaae('0x38'))['split'](','):null;},'comment':_0xeaae('0x39')},'trustrpid':{'type':Sequelize['ENUM'](_0xeaae('0x37'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xeaae('0x1c')](_0xeaae('0x37'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xeaae('0x1c')]('yes','no',_0xeaae('0x3a')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0xeaae('0x1c')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize[_0xeaae('0x9')],'allowNull':!![],'defaultValue':_0xeaae('0x3b')},'amaflags':{'type':Sequelize[_0xeaae('0x9')],'allowNull':!![]},'callcounter':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':_0xeaae('0x37')},'busylevel':{'type':Sequelize[_0xeaae('0x14')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0xeaae('0x1c')](_0xeaae('0x37'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xeaae('0x1c')](_0xeaae('0x37'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xeaae('0x1c')](_0xeaae('0x37'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xeaae('0x1c')](_0xeaae('0x37'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xeaae('0x9')],'allowNull':!![]},'template':{'type':Sequelize[_0xeaae('0x9')],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM'](_0xeaae('0x37'),'no',_0xeaae('0x3c')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xeaae('0x14')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xeaae('0x1c')](_0xeaae('0x37'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'session_timers':{'type':Sequelize[_0xeaae('0x1c')](_0xeaae('0x3d'),_0xeaae('0x3e'),_0xeaae('0x3f')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xeaae('0x14')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0xeaae('0x14')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xeaae('0x1c')]('uac',_0xeaae('0x40')),'allowNull':!![],'defaultValue':_0xeaae('0x40')},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize['STRING'],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xeaae('0x9')],'allowNull':!![]},'fromuser':{'type':Sequelize['STRING'],'allowNull':!![]},'qualify':{'type':Sequelize[_0xeaae('0x1c')]('yes','no'),'allowNull':!![],'defaultValue':_0xeaae('0x37')},'keepalive':{'type':Sequelize[_0xeaae('0x14')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xeaae('0x9')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xeaae('0x9')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xeaae('0x14')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xeaae('0x14')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xeaae('0x14')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xeaae('0x1c')](_0xeaae('0x37'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xeaae('0x9')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0xeaae('0x9')],'allowNull':!![]},'timert1':{'type':Sequelize[_0xeaae('0x14')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xeaae('0x14')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0xeaae('0x9')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xeaae('0x9')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xeaae('0x9')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xeaae('0x9')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xeaae('0x9')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0xeaae('0x14')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xeaae('0x1c')](_0xeaae('0x37'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xeaae('0x1c')](_0xeaae('0x37'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0xeaae('0x37'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xeaae('0x1c')]('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xeaae('0x1c')](_0xeaae('0x37'),'no',_0xeaae('0x41'),_0xeaae('0x42')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0xeaae('0x14')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xeaae('0x9')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xeaae('0x9')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xeaae('0x9')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xeaae('0x9')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xeaae('0x1c')](_0xeaae('0x43'),_0xeaae('0x44'),_0xeaae('0x45')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM'](_0xeaae('0x37'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xeaae('0x9')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xeaae('0x9')],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xeaae('0x1c')](_0xeaae('0x37'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xeaae('0x9')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xeaae('0x9')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0xeaae('0x9')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xeaae('0x9')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xeaae('0x1c')](_0xeaae('0x37'),'no',_0xeaae('0x2f'),_0xeaae('0x46'),_0xeaae('0x47')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xeaae('0x18')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xeaae('0x9')]},'resetPasswordExpires':{'type':Sequelize[_0xeaae('0x19')]},'passwordResetAt':{'type':Sequelize['DATE'],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize[_0xeaae('0x14')],'defaultValue':0x0,'set':function(_0x18ab9a){this[_0xeaae('0x6')](_0xeaae('0x48'),_0x18ab9a);var _0x264f50=this['get']({'plain':!![]});switch(_0x18ab9a){case 0x0:case 0x1:var _0x28270b=_0x264f50[_0xeaae('0x27')]?_[_0xeaae('0x49')](_0x264f50[_0xeaae('0x27')])?_0x264f50[_0xeaae('0x27')][_0xeaae('0x32')]():_0x264f50[_0xeaae('0x27')]:_0xeaae('0x26');if(_0x28270b==='wss'){_0x28270b=_0xeaae('0x26');}this[_0xeaae('0x6')](_0xeaae('0x27'),_0x28270b);this[_0xeaae('0x6')](_0xeaae('0x4a'),'no');this[_0xeaae('0x6')](_0xeaae('0x4b'),null);this[_0xeaae('0x6')](_0xeaae('0x4c'),null);this[_0xeaae('0x6')](_0xeaae('0x4d'),null);this[_0xeaae('0x6')](_0xeaae('0x4e'),null);this[_0xeaae('0x6')]('dtlsverify',null);this[_0xeaae('0x6')](_0xeaae('0x4f'),null);this[_0xeaae('0x6')](_0xeaae('0x50'),null);this[_0xeaae('0x6')](_0xeaae('0x51'),null);this[_0xeaae('0x6')](_0xeaae('0x52'),'no');break;case 0x2:this[_0xeaae('0x6')](_0xeaae('0x27'),_0xeaae('0x53'));this[_0xeaae('0x6')](_0xeaae('0x4a'),'yes');this[_0xeaae('0x6')](_0xeaae('0x4b'),_0xeaae('0x37'));this[_0xeaae('0x6')](_0xeaae('0x4c'),_0xeaae('0x37'));this['setDataValue'](_0xeaae('0x4d'),_0xeaae('0x37'));this[_0xeaae('0x6')](_0xeaae('0x4e'),_0xeaae('0x37'));this['setDataValue'](_0xeaae('0x54'),'no');this[_0xeaae('0x6')](_0xeaae('0x4f'),_0xeaae('0x45'));this[_0xeaae('0x6')]('dtlscertfile',_0x264f50[_0xeaae('0x50')]||_0xeaae('0x55'));this[_0xeaae('0x6')](_0xeaae('0x51'),_0x264f50[_0xeaae('0x51')]||'/etc/pki/tls/private/motion.key');this[_0xeaae('0x6')](_0xeaae('0x52'),_0xeaae('0x37'));break;default:}}},'permissions':{'type':Sequelize[_0xeaae('0x56')],'set':function(_0x2babf4){this['setDataValue'](_0xeaae('0x57'),_0x2babf4?_0x2babf4[_0xeaae('0x32')](','):[]);},'get':function(){return this['getDataValue'](_0xeaae('0x57'))?_['map'](this[_0xeaae('0x17')](_0xeaae('0x57'))[_0xeaae('0x28')](','),function(_0x2dc6d6){return parseInt(_0x2dc6d6,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xeaae('0x9')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0xeaae('0x9')]},'phoneBarBusyNumber':{'type':Sequelize['STRING']},'phoneBarUnconditional':{'type':Sequelize[_0xeaae('0x18')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xeaae('0x18')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xeaae('0x18')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xeaae('0x18')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xeaae('0x18')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xeaae('0x14')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize['STRING'],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0xeaae('0x14')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xeaae('0x1c')](_0xeaae('0x37'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xeaae('0x18')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xeaae('0x9')]},'phoneBarEnableJaws':{'type':Sequelize[_0xeaae('0x18')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xeaae('0x18')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0xeaae('0x58')],'get':function(){return this[_0xeaae('0x17')](_0xeaae('0x59'))?this['getDataValue'](_0xeaae('0x59')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xeaae('0x18')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xeaae('0x18')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xeaae('0x18')],'defaultValue':![]},'interface':{'type':Sequelize[_0xeaae('0x9')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xeaae('0x18')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xeaae('0x9')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xeaae('0x18')],'defaultValue':![],'set':function(_0x5a16c9){if(typeof _0x5a16c9===_0xeaae('0x5a')){var _0x4b94ae=_0x5a16c9==='1'?!![]:_0x5a16c9==='0'?![]:_0x5a16c9===_0xeaae('0x5b')?!![]:_0x5a16c9===_0xeaae('0x5c')?![]:![];this[_0xeaae('0x6')](_0xeaae('0x5d'),_0x4b94ae);}else{this[_0xeaae('0x6')](_0xeaae('0x5d'),_0x5a16c9);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x3bad81){this[_0xeaae('0x6')]('blocked',_0x3bad81);if(_0x3bad81===!![]){this[_0xeaae('0x6')]('blockedAt',moment());this[_0xeaae('0x6')](_0xeaae('0x5e'),0x0);}else{this['setDataValue'](_0xeaae('0x5f'),null);}}},'blockedAt':{'type':Sequelize[_0xeaae('0x19')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0xeaae('0x14')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xeaae('0x18')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0xeaae('0x18')],'defaultValue':!![]},'wssPort':{'type':Sequelize['INTEGER'](0x5)[_0xeaae('0x60')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 90c07eb..e1d966d 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 _0xf23c=['addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','isArray','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','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','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','getFaxAccounts','addFaxAccounts','removeFaxAccounts','getMailAccounts','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','getWhatsappAccounts','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','getScheduledCalls','$or','$gt','$lt','$lte','$ne','$eq','$not','$between','$notBetween','$in','$notLike','$notILike','$like','$overlap','$contains','$contained','$any','firstName','lastName','phone','CmContact','Contact','dialActive','CmHopper','getApiKey','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','nonce','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','whoami','send','Unable\x20to\x20retrieve\x20the\x20current\x20user','getPresence','resolve','teams','queues','inbound','lower','col','toString','asc','desc','substring','uniqBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','client','request','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','unknown','unavailable','ringing','voiceStatus','busy','slice','charAt','toUpperCase','SELECT','select','field','InteractionId','_interactions','ui.UserId\x20=\x20?','OpenTabs','moment','bluebird','util','path','lodash','squel','jayson/promise','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','socket.io-emitter','redis','./user.socket','register','defaults','localhost','http','then','info','User,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','status','end','offset','undefined','limit','count','set','json','update','role','admin','Users','user','Agents','agent','Telephones','telephone','filter','ignore','map','value','includes','find','name','UserProfileResource','destroy','sendStatus','stack','index','User','type','key','salt','where','query','includeAll','include','attributes','findAll','rows','openTabs','push','chat','dataValues','sms','fax','mail','whatsapp','catch','show','params','model','keys','rawAttributes','filters','intersection','fields','length','merge','options','openchannel','all','body','describe','addContacts','omit','ids','Setting','findById','securePassword','validatePasswordPattern','password','max','internal','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','from','VoiceMail','fullname','email','permissions','101','102','103','113','104','105','106','107','109','100','111','114','115','create','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','checkUserLimits','settingsEnabled','userProfileId','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','some','each','isEmpty','compact','oldPassword','newPassword','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','Sequelize','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordHistory','previousPasswords','updatePasswordsHistory','addQueues','online','loginInPause','voicePause','interface','isValidChannel','capitalize','Queues','spread','toLowerCase','QueueId','emit','Queue:save','voice','VoiceQueue','get','SIP/%s','UserVoiceQueueRt','channel','Unknown\x20channel','remove','Queue:remove','addAvatar','userpic','file','filename','getAvatar','join','root','server/files/images/logos/default_profile.png','download','existsSync','server/files/images/','getOpenTabs','ChatOpenTabs','CHAT','FaxOpenTabs','FAX','createdAt','OpenchannelOpenTabs','MailOpenTabs','MAIL','SmsOpenTabs','SMS','WhatsappOpenTabs','WHATSAPP','getContacts','findOne','order','sort','pick','hasOwnProperty','Tag','Tags','tag','getQueues','Queue','Unknown\x20role','nolimit','getVoiceQueuesRt','getGroups','ChatGroup','getRecordings','UserId','getScreenRecordings','ScreenRecording','getChatInteractions','OpenchannelInteraction','getOpenchannelInteractions','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','FaxInteraction','WhatsappInteraction','getWhatsappInteractions','format','LOCAL/%s@from-sip/n','intrf','connection','remoteAddress','getVoiceQueues','upsert','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','getChannels','LOGIN','device','PAUSE','LOGININPAUSE','bulkCreate','concat','isMiddleware','logout','QueuePause','pause','updateAttributes','DEFAULT\x20PAUSE','unpause','mailPause','chatPause','faxPause','smsPause','pauseType','manual','%s%s','Pause','Team','getTeams','addTeams','Voice','getChatQueues','getMailQueues','setDataValue','Mail','getSmsQueues','Sms','getWhatsappQueues','Whatsapp','getOpenchannelQueues','Openchannel','flatten','transaction','addAgent','penalty','getDataValue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','removeTeams','getFaxQueues','Fax','removeAgent','getLists','getAgents','values','You\x20can\x27t\x20delete\x20yourself'];(function(_0x5e0aee,_0xbd2b5){var _0x1a491c=function(_0x45df96){while(--_0x45df96){_0x5e0aee['push'](_0x5e0aee['shift']());}};_0x1a491c(++_0xbd2b5);}(_0xf23c,0x77));var _0xcf23=function(_0x54a9e3,_0x4a3813){_0x54a9e3=_0x54a9e3-0x0;var _0x247cce=_0xf23c[_0x54a9e3];return _0x247cce;};'use strict';var moment=require(_0xcf23('0x0'));var BPromise=require(_0xcf23('0x1'));var util=require(_0xcf23('0x2'));var path=require(_0xcf23('0x3'));var fs=require('fs');var _=require(_0xcf23('0x4'));var squel=require(_0xcf23('0x5'));var jayson=require(_0xcf23('0x6'));var Redis=require(_0xcf23('0x7'));var authService=require(_0xcf23('0x8'));var qs=require(_0xcf23('0x9'));var logger=require(_0xcf23('0xa'))(_0xcf23('0xb'));var utils=require(_0xcf23('0xc'));var config=require(_0xcf23('0xd'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var socket=require(_0xcf23('0xe'))(new Redis(config[_0xcf23('0xf')]));require(_0xcf23('0x10'))[_0xcf23('0x11')](socket);config[_0xcf23('0xf')]=_[_0xcf23('0x12')](config[_0xcf23('0xf')],{'host':_0xcf23('0x13'),'port':0x18eb});var client=jayson['client'][_0xcf23('0x14')]({'port':0x232a});var values;function respondWithRpcPromise(_0x3a72d3,_0x1163b0,_0x12157b,_0x4a480c){return new BPromise(function(_0x599160,_0x3e6dad){var _0x3e4c4d=_0x4a480c||client;return _0x3e4c4d['request'](_0x3a72d3,_0x12157b)[_0xcf23('0x15')](function(_0x28c071){logger[_0xcf23('0x16')](_0xcf23('0x17'),_0x1163b0,_0xcf23('0x18'));logger[_0xcf23('0x19')]('User,\x20%s,\x20%s,\x20%s',_0x1163b0,_0xcf23('0x18'),JSON[_0xcf23('0x1a')](_0x28c071));if(_0x28c071[_0xcf23('0x1b')]){if(_0x28c071[_0xcf23('0x1b')][_0xcf23('0x1c')]===0x1f4){logger[_0xcf23('0x1b')](_0xcf23('0x17'),_0x1163b0,_0x28c071[_0xcf23('0x1b')][_0xcf23('0x1d')]);return _0x3e6dad(_0x28c071[_0xcf23('0x1b')][_0xcf23('0x1d')]);}logger[_0xcf23('0x1b')]('User,\x20%s,\x20%s',_0x1163b0,_0x28c071['error'][_0xcf23('0x1d')]);return _0x599160(_0x28c071[_0xcf23('0x1b')][_0xcf23('0x1d')]);}else{logger['info'](_0xcf23('0x17'),_0x1163b0,_0xcf23('0x18'));_0x599160(_0x28c071[_0xcf23('0x1e')][_0xcf23('0x1d')]);}})['catch'](function(_0x4f015b){logger[_0xcf23('0x1b')](_0xcf23('0x17'),_0x1163b0,_0x4f015b);_0x3e6dad(_0x4f015b);});});}function respondWithStatusCode(_0x279bc5,_0x56c29e){_0x56c29e=_0x56c29e||0xcc;return function(_0x321806){if(_0x321806){return _0x279bc5['sendStatus'](_0x56c29e);}return _0x279bc5[_0xcf23('0x1f')](_0x56c29e)[_0xcf23('0x20')]();};}function respondWithResult(_0x59ca88,_0x58809f){_0x58809f=_0x58809f||0xc8;return function(_0x2e9170){if(_0x2e9170){return _0x59ca88[_0xcf23('0x1f')](_0x58809f)['json'](_0x2e9170);}};}function respondWithFilteredResult(_0x3ebe7e,_0x11cc7d){return function(_0x25a660){if(_0x25a660){var _0x10fa11=typeof _0x11cc7d[_0xcf23('0x21')]===_0xcf23('0x22')&&typeof _0x11cc7d[_0xcf23('0x23')]==='undefined';var _0x76b919=_0x25a660[_0xcf23('0x24')];var _0x13aa31=_0x10fa11?0x0:_0x11cc7d[_0xcf23('0x21')];var _0x376f09=_0x10fa11?_0x25a660['count']:_0x11cc7d[_0xcf23('0x21')]+_0x11cc7d[_0xcf23('0x23')];var _0x540e74;if(_0x376f09>=_0x76b919){_0x376f09=_0x76b919;_0x540e74=0xc8;}else{_0x540e74=0xce;}_0x3ebe7e[_0xcf23('0x1f')](_0x540e74);return _0x3ebe7e[_0xcf23('0x25')]('Content-Range',_0x13aa31+'-'+_0x376f09+'/'+_0x76b919)[_0xcf23('0x26')](_0x25a660);}return null;};}function saveUpdates(_0x7ab256){return function(_0x545396){if(_0x545396){return _0x545396[_0xcf23('0x27')](_0x7ab256)[_0xcf23('0x15')](function(_0x37f7c0){return _0x37f7c0;});}return null;};}function removeEntity(_0x40984e){return function(_0x1dcfe3){if(_0x1dcfe3){return _0x1dcfe3['destroy']()[_0xcf23('0x15')](function(){var _0x2b9882=_0x1dcfe3['get']({'plain':!![]});if(_0x2b9882[_0xcf23('0x28')]===_0xcf23('0x29'))return;var _0x152c2=[{'name':_0xcf23('0x2a'),'value':_0xcf23('0x2b'),'ignore':!![]},{'name':_0xcf23('0x2c'),'value':_0xcf23('0x2d'),'ignore':![]},{'name':_0xcf23('0x2e'),'value':_0xcf23('0x2f'),'ignore':![]}];var _0x80ce31=_(_0x152c2)[_0xcf23('0x30')](_0xcf23('0x31'))[_0xcf23('0x32')]('value')[_0xcf23('0x33')]();if(_[_0xcf23('0x34')](_0x80ce31,_0x2b9882[_0xcf23('0x28')])){return;}var _0x391177=_[_0xcf23('0x35')](_0x152c2,[_0xcf23('0x33'),_0x2b9882['role']])[_0xcf23('0x36')];return db[_0xcf23('0x37')][_0xcf23('0x38')]({'where':{'type':_0x391177,'resourceId':_0x2b9882['id']}})[_0xcf23('0x15')](function(){return _0x1dcfe3;});})[_0xcf23('0x15')](function(){_0x40984e[_0xcf23('0x1f')](0xcc)[_0xcf23('0x20')]();});}};}function handleEntityNotFound(_0x51bac1){return function(_0x2dfea7){if(!_0x2dfea7){_0x51bac1[_0xcf23('0x39')](0x194);}return _0x2dfea7;};}function handleError(_0x438bab,_0x2eaadb){_0x2eaadb=_0x2eaadb||0x1f4;return function(_0x1e6f6b){logger[_0xcf23('0x1b')](_0x1e6f6b[_0xcf23('0x3a')]);if(_0x1e6f6b[_0xcf23('0x36')]){delete _0x1e6f6b[_0xcf23('0x36')];}_0x438bab['status'](_0x2eaadb)['send'](_0x1e6f6b);};}exports[_0xcf23('0x3b')]=function(_0x4b7d39,_0x5cb5bd){var _0x5b7830={},_0x535b30={'count':0x0,'rows':[]};var _0x5115e0=_(db[_0xcf23('0x3c')]['rawAttributes'])[_0xcf23('0x32')](function(_0x2f8e60){return{'name':_0x2f8e60['fieldName'],'type':_0x2f8e60[_0xcf23('0x3d')][_0xcf23('0x3e')]};})['filter'](function(_0x5541b0){return!_['includes'](['password',_0xcf23('0x3f')],_0x5541b0['name']);})[_0xcf23('0x33')]();_0x5b7830=qs['getOptions'](_0x5115e0,_0x4b7d39);var _0x3a1a7c={'where':_0x5b7830[_0xcf23('0x40')]};return db[_0xcf23('0x3c')][_0xcf23('0x24')](_0x3a1a7c)['then'](function(_0x319bdc){_0x535b30[_0xcf23('0x24')]=_0x319bdc;if(_0x4b7d39[_0xcf23('0x41')][_0xcf23('0x42')]){_0x5b7830[_0xcf23('0x43')]=[{'all':!![]}];}if(!_[_0xcf23('0x34')](_0x5b7830[_0xcf23('0x44')],'id')){_0x5b7830[_0xcf23('0x44')]['push']('id');}return db[_0xcf23('0x3c')][_0xcf23('0x45')](_0x5b7830);})[_0xcf23('0x15')](function(_0x563235){_0x535b30[_0xcf23('0x46')]=_0x563235;if(_0x4b7d39[_0xcf23('0x41')][_0xcf23('0x47')]==='true'){var _0x3caa08=[];for(var _0x33662b=0x0;_0x33662b<_0x535b30[_0xcf23('0x46')]['length'];_0x33662b++){_0x3caa08[_0xcf23('0x48')](get_open_tabs(_0xcf23('0x49'),_0x535b30[_0xcf23('0x46')][_0x33662b][_0xcf23('0x4a')]));_0x3caa08[_0xcf23('0x48')](get_open_tabs(_0xcf23('0x4b'),_0x535b30[_0xcf23('0x46')][_0x33662b]['dataValues']));_0x3caa08[_0xcf23('0x48')](get_open_tabs(_0xcf23('0x4c'),_0x535b30[_0xcf23('0x46')][_0x33662b][_0xcf23('0x4a')]));_0x3caa08[_0xcf23('0x48')](get_open_tabs(_0xcf23('0x4d'),_0x535b30[_0xcf23('0x46')][_0x33662b][_0xcf23('0x4a')]));_0x3caa08[_0xcf23('0x48')](get_open_tabs('openchannel',_0x535b30[_0xcf23('0x46')][_0x33662b]['dataValues']));_0x3caa08[_0xcf23('0x48')](get_open_tabs(_0xcf23('0x4e'),_0x535b30[_0xcf23('0x46')][_0x33662b][_0xcf23('0x4a')]));}return BPromise['all'](_0x3caa08)[_0xcf23('0x15')](function(_0x3e8a9b){return _0x535b30;});}else{return _0x535b30;}})['then'](respondWithFilteredResult(_0x5cb5bd,_0x5b7830))[_0xcf23('0x4f')](handleError(_0x5cb5bd,null));};exports[_0xcf23('0x50')]=function(_0x19189d,_0x5a38f1){var _0x15865b={'raw':![],'where':{'id':_0x19189d[_0xcf23('0x51')]['id']}},_0x26a414={};_0x26a414[_0xcf23('0x52')]=_['differenceBy'](_[_0xcf23('0x53')](db['User'][_0xcf23('0x54')]),['password',_0xcf23('0x3f')]);_0x26a414['query']=_[_0xcf23('0x53')](_0x19189d['query']);_0x26a414[_0xcf23('0x55')]=_[_0xcf23('0x56')](_0x26a414[_0xcf23('0x52')],_0x26a414['query']);_0x15865b['attributes']=_[_0xcf23('0x56')](_0x26a414[_0xcf23('0x52')],qs[_0xcf23('0x57')](_0x19189d[_0xcf23('0x41')][_0xcf23('0x57')]));_0x15865b[_0xcf23('0x44')]=_0x15865b[_0xcf23('0x44')][_0xcf23('0x58')]?_0x15865b[_0xcf23('0x44')]:_0x26a414[_0xcf23('0x52')];if(_0x19189d[_0xcf23('0x41')][_0xcf23('0x42')]){_0x15865b['include']=[{'all':!![]}];}_0x15865b=_[_0xcf23('0x59')]({},_0x15865b,_0x19189d[_0xcf23('0x5a')]);if(!_[_0xcf23('0x34')](_0x15865b[_0xcf23('0x44')],'id')){_0x15865b['attributes'][_0xcf23('0x48')]('id');}return db[_0xcf23('0x3c')][_0xcf23('0x35')](_0x15865b)[_0xcf23('0x15')](handleEntityNotFound(_0x5a38f1,null))[_0xcf23('0x15')](function(_0x3c2bd5){var _0x1217ec=[];values=_0x3c2bd5;if(_0x19189d[_0xcf23('0x41')][_0xcf23('0x47')]==='true'){_0x1217ec[_0xcf23('0x48')](get_open_tabs('chat',_0x3c2bd5[_0xcf23('0x4a')]));_0x1217ec['push'](get_open_tabs('sms',_0x3c2bd5[_0xcf23('0x4a')]));_0x1217ec[_0xcf23('0x48')](get_open_tabs(_0xcf23('0x5b'),_0x3c2bd5[_0xcf23('0x4a')]));_0x1217ec['push'](get_open_tabs('whatsapp',_0x3c2bd5[_0xcf23('0x4a')]));_0x1217ec[_0xcf23('0x48')](get_open_tabs('fax',_0x3c2bd5[_0xcf23('0x4a')]));_0x1217ec['push'](get_open_tabs('mail',_0x3c2bd5[_0xcf23('0x4a')]));return BPromise[_0xcf23('0x5c')](_0x1217ec);}else{return values;}})[_0xcf23('0x15')](function(_0x4c71fa){return values;})[_0xcf23('0x15')](respondWithResult(_0x5a38f1,null))[_0xcf23('0x4f')](handleError(_0x5a38f1,null));};exports[_0xcf23('0x27')]=function(_0x1c88c4,_0x17b869){if(_0x1c88c4['body']['id']){delete _0x1c88c4[_0xcf23('0x5d')]['id'];}delete _0x1c88c4[_0xcf23('0x5d')][_0xcf23('0x28')];return db[_0xcf23('0x3c')][_0xcf23('0x35')]({'where':{'id':_0x1c88c4[_0xcf23('0x51')]['id']}})[_0xcf23('0x15')](handleEntityNotFound(_0x17b869,null))['then'](saveUpdates(_0x1c88c4[_0xcf23('0x5d')],null))[_0xcf23('0x15')](respondWithResult(_0x17b869,null))[_0xcf23('0x4f')](handleError(_0x17b869,null));};exports['describe']=function(_0x24315a,_0xaa5dc4){return db[_0xcf23('0x3c')][_0xcf23('0x5e')]()[_0xcf23('0x15')](respondWithResult(_0xaa5dc4,null))[_0xcf23('0x4f')](handleError(_0xaa5dc4,null));};exports[_0xcf23('0x5f')]=function(_0x449e46,_0x2a0f0a){return db[_0xcf23('0x3c')][_0xcf23('0x35')]({'where':{'id':_0x449e46[_0xcf23('0x51')]['id']}})[_0xcf23('0x15')](handleEntityNotFound(_0x2a0f0a,null))['then'](function(_0x58ba36){if(_0x58ba36){return _0x58ba36[_0xcf23('0x5f')](_0x449e46[_0xcf23('0x5d')]['ids'],_[_0xcf23('0x60')](_0x449e46[_0xcf23('0x5d')],[_0xcf23('0x61'),'id'])||{});}})[_0xcf23('0x15')](respondWithResult(_0x2a0f0a,null))[_0xcf23('0x4f')](handleError(_0x2a0f0a,null));};function validateUser(_0x22a81e){return new BPromise(function(_0x3c8551,_0x5b24bb){if(_0x22a81e['internal'])return _0x3c8551(_0x22a81e);return db[_0xcf23('0x62')][_0xcf23('0x63')](0x1)[_0xcf23('0x15')](function(_0x4560a3){if(_0x4560a3[_0xcf23('0x64')])authService[_0xcf23('0x65')](_0x22a81e[_0xcf23('0x66')]);db[_0xcf23('0x3c')][_0xcf23('0x67')](_0xcf23('0x68'))[_0xcf23('0x15')](function(_0x589158){if(_[_0xcf23('0x69')](_0x589158)){_0x22a81e[_0xcf23('0x68')]=_0x4560a3[_0xcf23('0x6a')]||0x1;return;}if(_[_0xcf23('0x69')](_0x4560a3['min_internal'])||_0x4560a3['min_internal']===_0x589158){_0x22a81e[_0xcf23('0x68')]=_0x589158+0x1;return;}if(_0x4560a3['min_internal']>_0x589158){_0x22a81e[_0xcf23('0x68')]=_0x4560a3[_0xcf23('0x6a')];return;}return db[_0xcf23('0x6b')][_0xcf23('0x41')](_0xcf23('0x6c'),{'type':db[_0xcf23('0x6b')][_0xcf23('0x6d')]['SELECT']})[_0xcf23('0x15')](function(_0xd94e58){if(_0xd94e58&&_0xd94e58[_0xcf23('0x58')]){for(var _0x387734=0x0,_0x32525f=_0xd94e58[_0xcf23('0x58')];_0x387734<_0x32525f&&_[_0xcf23('0x69')](_0x22a81e[_0xcf23('0x68')]);_0x387734++){if(_0x4560a3['min_internal']<=_0xd94e58[_0x387734]['from']){_0x22a81e[_0xcf23('0x68')]=_0xd94e58[_0x387734][_0xcf23('0x6e')];}else if(_0x4560a3[_0xcf23('0x6a')]>_0xd94e58[_0x387734][_0xcf23('0x6e')]&&_0x4560a3[_0xcf23('0x6a')]<=_0xd94e58[_0x387734]['to']){_0x22a81e[_0xcf23('0x68')]=_0x4560a3[_0xcf23('0x6a')];}}}if(_[_0xcf23('0x69')](_0x22a81e[_0xcf23('0x68')])){_0x22a81e[_0xcf23('0x68')]=_0x589158+0x1;}return _0x3c8551(_0x22a81e);});});})[_0xcf23('0x4f')](function(_0x1b09a2){_0x5b24bb(_0x1b09a2);});});}function updateUser(_0x5ad70f){return new BPromise(function(_0x1a5078,_0xb4a276){try{if(_0x5ad70f['voicemail']){_0x5ad70f['mailbox']=_0x5ad70f[_0xcf23('0x68')];_0x5ad70f[_0xcf23('0x6f')]={'mailbox':_0x5ad70f[_0xcf23('0x68')],'password':_0x5ad70f[_0xcf23('0x66')],'fullname':_0x5ad70f[_0xcf23('0x70')],'email':_0x5ad70f[_0xcf23('0x71')]};}if(_0x5ad70f[_0xcf23('0x28')]==='agent'){if(!_0x5ad70f[_0xcf23('0x72')])_0x5ad70f['permissions']=[_0xcf23('0x73'),_0xcf23('0x74'),_0xcf23('0x75'),_0xcf23('0x76'),'110',_0xcf23('0x77'),_0xcf23('0x78'),_0xcf23('0x79'),_0xcf23('0x7a'),'108',_0xcf23('0x7b'),_0xcf23('0x7c'),_0xcf23('0x7d'),_0xcf23('0x7e'),_0xcf23('0x7f')];}_0x1a5078(_0x5ad70f);}catch(_0x48480d){_0xb4a276(_0x48480d);}});}exports[_0xcf23('0x80')]=function(_0x49a09b,_0x309d21){if(_0x49a09b['user'][_0xcf23('0x28')]===_0xcf23('0x2d'))throw new Error(_0xcf23('0x81'));if(_0x49a09b[_0xcf23('0x5d')][_0xcf23('0x28')]===_0xcf23('0x2b')&&_0x49a09b[_0xcf23('0x2b')][_0xcf23('0x28')]!=='admin'){throw new Error(_0xcf23('0x82'));}if(_0x49a09b[_0xcf23('0x5d')]['role']===_0xcf23('0x29')&&_0x49a09b['user'][_0xcf23('0x28')]!=='admin'){throw new Error(_0xcf23('0x83'));}return licenseUtil[_0xcf23('0x84')]([_0x49a09b[_0xcf23('0x5d')]])[_0xcf23('0x15')](function(){return validateUser(_0x49a09b[_0xcf23('0x5d')]);})[_0xcf23('0x15')](function(_0x5c33c4){return updateUser(_0x5c33c4)[_0xcf23('0x15')](function(_0x359f43){if(_0x359f43[_0xcf23('0x28')]===_0xcf23('0x29')){_0x359f43[_0xcf23('0x85')]=_0x49a09b[_0xcf23('0x2b')][_0xcf23('0x85')];delete _0x359f43[_0xcf23('0x86')];}return _0x359f43;});})[_0xcf23('0x15')](function(_0x3a0470){return db['User']['create'](_0x3a0470,{'include':[{'model':db[_0xcf23('0x6f')],'as':_0xcf23('0x6f')}]});})[_0xcf23('0x15')](function(_0xe27dd8){if(_0x49a09b[_0xcf23('0x5d')][_0xcf23('0x28')]===_0xcf23('0x2b'))return _0xe27dd8;if(_0x49a09b[_0xcf23('0x2b')][_0xcf23('0x28')]!==_0xcf23('0x2b'))return _0xe27dd8;return db[_0xcf23('0x87')]['find']({'where':{'name':_0xe27dd8[_0xcf23('0x28')]===_0xcf23('0x2d')?_0xcf23('0x2c'):_0xcf23('0x2e'),'userProfileId':_0x49a09b[_0xcf23('0x2b')][_0xcf23('0x86')]},'raw':!![]})['then'](function(_0x10e3b0){if(!_0x10e3b0||_0x10e3b0[_0xcf23('0x88')]!=0x0)return _0xe27dd8;return db[_0xcf23('0x37')][_0xcf23('0x80')]({'name':_0xe27dd8[_0xcf23('0x36')],'resourceId':_0xe27dd8['id'],'type':_0x10e3b0[_0xcf23('0x36')],'sectionId':_0x10e3b0['id']},{})[_0xcf23('0x15')](function(){return _0xe27dd8;});})[_0xcf23('0x4f')](function(_0x2b218e){logger[_0xcf23('0x1b')](_0xcf23('0x89'),_0x2b218e);throw _0x2b218e;});})[_0xcf23('0x15')](respondWithResult(_0x309d21,0xc9))[_0xcf23('0x4f')](handleError(_0x309d21,null));};exports['bulkCreate']=function(_0x450757,_0x9a2a17){var _0xef5d95=_0x450757[_0xcf23('0x5d')];var _0x181db3=[];if(_0x450757['user']['role']==='agent')throw new Error('Unauthorized');if(_[_0xcf23('0x8a')](_0xef5d95,[_0xcf23('0x28'),_0xcf23('0x2b')])&&_0x450757['user'][_0xcf23('0x28')]!==_0xcf23('0x29')){throw new Error(_0xcf23('0x82'));}if(_['some'](_0xef5d95,[_0xcf23('0x28'),_0xcf23('0x29')])&&_0x450757['user'][_0xcf23('0x28')]!==_0xcf23('0x29')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator');}return licenseUtil[_0xcf23('0x84')](_0xef5d95)[_0xcf23('0x15')](function(){return validateUser(_0xef5d95[0x0]);})[_0xcf23('0x15')](function(){for(var _0x23fdd9=0x1;_0x23fdd9<_0xef5d95[_0xcf23('0x58')];_0x23fdd9++){var _0x366e77=_0xef5d95[_0x23fdd9-0x1][_0xcf23('0x68')];if(!_0xef5d95[_0x23fdd9][_0xcf23('0x68')])_0xef5d95[_0x23fdd9][_0xcf23('0x68')]=_0x366e77+0x1;_0x181db3['push'](validateUser(_0xef5d95[_0x23fdd9]));}return BPromise[_0xcf23('0x5c')](_0x181db3);})[_0xcf23('0x15')](function(){_0x181db3=[];for(var _0x2ee917=0x0;_0x2ee917<_0xef5d95['length'];_0x2ee917++){_0x181db3[_0xcf23('0x48')](updateUser(_0xef5d95[_0x2ee917]));}return BPromise[_0xcf23('0x5c')](_0x181db3);})['then'](function(){return BPromise[_0xcf23('0x8b')](_0xef5d95,function(_0x2e89e8){return db[_0xcf23('0x3c')][_0xcf23('0x80')](_0x2e89e8,{'include':[{'model':db[_0xcf23('0x6f')],'as':'VoiceMail'}]})['then'](function(_0x1185c8){_0x2e89e8['id']=_0x1185c8['id'];return _0x2e89e8;});});})[_0xcf23('0x15')](function(_0x4873ec){if(_0x450757[_0xcf23('0x5d')][_0xcf23('0x28')]==='user')return _0x4873ec;if(_0x450757[_0xcf23('0x2b')][_0xcf23('0x28')]!==_0xcf23('0x2b'))return _0x4873ec;var _0xe1c784=_[_0xcf23('0x8a')](_0x4873ec,function(_0xd05752){return _0xd05752[_0xcf23('0x28')]===_0xcf23('0x2d')||_0xd05752[_0xcf23('0x28')]===_0xcf23('0x2f');});if(!_0xe1c784)return _0x4873ec;return db['UserProfileSection'][_0xcf23('0x45')]({'where':{'name':{'$or':[_0xcf23('0x2c'),_0xcf23('0x2e')]},'userProfileId':_0x450757[_0xcf23('0x2b')][_0xcf23('0x86')]},'raw':!![]})['then'](function(_0x2953c5){if(_[_0xcf23('0x8c')](_0x2953c5)||!_[_0xcf23('0x8a')](_0x2953c5,['autoAssociation',0x0]))return _0x4873ec;_0x181db3=[];var _0x120b8a=_(_0x2953c5)[_0xcf23('0x32')](function(_0x36ab03){if(_0x36ab03[_0xcf23('0x88')]===0x1)return;return _0x36ab03[_0xcf23('0x36')]===_0xcf23('0x2c')?_0xcf23('0x2d'):_0xcf23('0x2f');})[_0xcf23('0x8d')]()['value']();for(var _0x210593=0x0;_0x210593<_0x4873ec[_0xcf23('0x58')];_0x210593++){if(!_[_0xcf23('0x34')](_0x120b8a,_0x4873ec[_0x210593]['role']))return;var _0x1583d0=_0x4873ec[_0x210593][_0xcf23('0x28')]===_0xcf23('0x2d')?'Agents':_0xcf23('0x2e');_0x181db3[_0xcf23('0x48')](db[_0xcf23('0x37')][_0xcf23('0x80')]({'name':_0x4873ec[_0x210593][_0xcf23('0x36')],'resourceId':_0x4873ec[_0x210593]['id'],'type':_0x1583d0,'sectionId':_[_0xcf23('0x35')](_0x2953c5,[_0xcf23('0x36'),_0x1583d0])['id']},{}));}return BPromise[_0xcf23('0x5c')](_0x181db3);});})[_0xcf23('0x15')](respondWithResult(_0x9a2a17,0xc9))[_0xcf23('0x4f')](handleError(_0x9a2a17,null));};exports['changePassword']=function(_0xcdc55c,_0x17e054){if(_0xcdc55c[_0xcf23('0x5d')]['id']){delete _0xcdc55c[_0xcf23('0x5d')]['id'];}return db['User'][_0xcf23('0x35')]({'where':{'id':_0xcdc55c['params']['id']}})[_0xcf23('0x15')](function(_0x5e5709){if(!_0x5e5709)return null;if(_0x5e5709['id']===_0xcdc55c[_0xcf23('0x2b')]['id']){if(!_0xcdc55c[_0xcf23('0x5d')][_0xcf23('0x8e')]||!_0xcdc55c[_0xcf23('0x5d')][_0xcf23('0x8f')]){throw new db['Sequelize'][(_0xcf23('0x90'))](_0xcf23('0x91'));}if(!_0x5e5709[_0xcf23('0x92')](_0xcdc55c[_0xcf23('0x5d')][_0xcf23('0x8e')])){throw new db[(_0xcf23('0x93'))][(_0xcf23('0x90'))]('Wrong\x20credentials');}if(_0xcdc55c[_0xcf23('0x5d')][_0xcf23('0x8e')]===_0xcdc55c[_0xcf23('0x5d')][_0xcf23('0x8f')]){throw new db[(_0xcf23('0x93'))]['ValidationError'](_0xcf23('0x94'));}}else if(_0xcdc55c[_0xcf23('0x2b')][_0xcf23('0x28')]===_0xcf23('0x29')){if(!_0xcdc55c['body'][_0xcf23('0x8f')]){throw new db[(_0xcf23('0x93'))]['ValidationError']('Invalid\x20body\x20format.\x20Use\x20newPassword');}}else if(_0xcdc55c['user']['role']===_0xcf23('0x2b')){if(!_0xcdc55c[_0xcf23('0x5d')][_0xcf23('0x8f')]){throw new db[(_0xcf23('0x93'))][(_0xcf23('0x90'))](_0xcf23('0x95'));}if(_0x5e5709['role']!==_0xcf23('0x2d')){throw new db[(_0xcf23('0x93'))][(_0xcf23('0x90'))](_0xcf23('0x81'));}}else{throw new db[(_0xcf23('0x93'))][(_0xcf23('0x90'))](_0xcf23('0x81'));}return _0x5e5709;})[_0xcf23('0x15')](handleEntityNotFound(_0x17e054,null))[_0xcf23('0x15')](function(_0x3a902f){return db[_0xcf23('0x62')]['findOne']({'attributes':['id',_0xcf23('0x64'),_0xcf23('0x96'),_0xcf23('0x97')]})[_0xcf23('0x15')](function(_0x1aaf29){if(_0x1aaf29[_0xcf23('0x64')])authService[_0xcf23('0x65')](_0xcdc55c['body'][_0xcf23('0x8f')]);if(!_0x1aaf29[_0xcf23('0x96')]||!_0x3a902f['previousPasswords'])return _0x3a902f;authService[_0xcf23('0x98')](_0xcdc55c['body'][_0xcf23('0x8f')],_0x3a902f[_0xcf23('0x99')],_0x1aaf29[_0xcf23('0x97')]);return _0x3a902f;})[_0xcf23('0x15')](saveUpdates({'password':_0xcdc55c['body']['newPassword'],'passwordResetAt':_0xcdc55c[_0xcf23('0x2b')]['id']==_0xcdc55c[_0xcf23('0x51')]['id']?moment():null,'previousPasswords':authService[_0xcf23('0x9a')](_0xcdc55c['body']['newPassword'],_0x3a902f[_0xcf23('0x99')])},null));})[_0xcf23('0x15')](respondWithResult(_0x17e054,null))[_0xcf23('0x4f')](handleError(_0x17e054,null));};exports[_0xcf23('0x9b')]=function(_0x2ddfa4,_0xf30170){var _0x317f8a=_0x2ddfa4[_0xcf23('0x5d')]['channel'];return db[_0xcf23('0x3c')][_0xcf23('0x35')]({'where':{'id':_0x2ddfa4[_0xcf23('0x51')]['id']},'attributes':['id',_0xcf23('0x36'),_0xcf23('0x28'),_0xcf23('0x9c'),_0xcf23('0x9d'),_0xcf23('0x9e'),_0xcf23('0x9f')]})[_0xcf23('0x15')](handleEntityNotFound(_0xf30170,null))[_0xcf23('0x15')](function(_0x5174d4){if(_0x5174d4){if(!utils[_0xcf23('0xa0')](_0x317f8a)){throw new db['Sequelize'][(_0xcf23('0x90'))]('Unknown\x20channel');}return _0x5174d4['add'+_[_0xcf23('0xa1')](_0x317f8a['toLowerCase']())+_0xcf23('0xa2')](_0x2ddfa4[_0xcf23('0x5d')][_0xcf23('0x61')],{'penalty':_0x2ddfa4[_0xcf23('0x5d')]['penalty']||0x0})[_0xcf23('0xa3')](function(_0x43da70){for(var _0x5cb9d9=0x0;_0x5cb9d9<_0x2ddfa4[_0xcf23('0x5d')]['ids'][_0xcf23('0x58')];_0x5cb9d9+=0x1){var _0x115448={'UserId':Number(_0x2ddfa4[_0xcf23('0x51')]['id'])};_0x115448[_[_0xcf23('0xa1')](_0x317f8a[_0xcf23('0xa4')]())+_0xcf23('0xa5')]=Number(_0x2ddfa4[_0xcf23('0x5d')][_0xcf23('0x61')][_0x5cb9d9]);socket[_0xcf23('0xa6')](_0xcf23('0x2b')+_[_0xcf23('0xa1')](_0x317f8a[_0xcf23('0xa4')]())+_0xcf23('0xa7'),_0x115448);}return _0x43da70;})[_0xcf23('0x15')](function(){if(_0x317f8a===_0xcf23('0xa8')){return db[_0xcf23('0xa9')][_0xcf23('0x45')]({'where':{'id':_0x2ddfa4[_0xcf23('0x5d')][_0xcf23('0x61')]||[]},'raw':!![],'attributes':['id','name']});}})[_0xcf23('0x15')](function(_0x1f765e){var _0x3f83ff=_0x5174d4[_0xcf23('0xaa')]({'plain':!![]});var _0x1cf39e=[];if(_0x317f8a===_0xcf23('0xa8')&&_0x3f83ff['role']===_0xcf23('0x2d')&&_0x3f83ff[_0xcf23('0x9c')]){for(var _0x69d467=0x0;_0x69d467<_0x1f765e[_0xcf23('0x58')];_0x69d467+=0x1){_0x1cf39e[_0xcf23('0x48')]({'membername':_0x3f83ff[_0xcf23('0x36')],'UserId':_0x3f83ff['id'],'queue_name':_0x1f765e[_0x69d467]['name'],'VoiceQueueId':_0x1f765e[_0x69d467]['id'],'interface':_[_0xcf23('0x69')](_0x3f83ff[_0xcf23('0x9f')])?util['format'](_0xcf23('0xab'),_0x3f83ff[_0xcf23('0x36')]):_0x3f83ff['interface'],'paused':_0x3f83ff[_0xcf23('0x9e')]||![],'penalty':_0x2ddfa4[_0xcf23('0x5d')]['penalty']||0x0});}return BPromise['each'](_0x1cf39e,function(_0x47de81){return db[_0xcf23('0xac')]['upsert'](_0x47de81);});}return _0x5174d4;});}})[_0xcf23('0x15')](respondWithStatusCode(_0xf30170,null))['catch'](handleError(_0xf30170,null));};exports['removeQueues']=function(_0x2b9085,_0x1e1dd1){var _0x2936d6;return db[_0xcf23('0x3c')]['find']({'where':{'id':_0x2b9085[_0xcf23('0x51')]['id']},'attributes':['id',_0xcf23('0x36'),_0xcf23('0x28')]})[_0xcf23('0x15')](handleEntityNotFound(_0x1e1dd1,null))['then'](function(_0x345e62){if(_0x345e62){_0x2936d6=_0x345e62;if(!_0x2b9085['query']['channel']||!utils[_0xcf23('0xa0')](_0x2b9085[_0xcf23('0x41')][_0xcf23('0xad')])){throw new db[(_0xcf23('0x93'))][(_0xcf23('0x90'))](_0xcf23('0xae'));}return _0x345e62[_0xcf23('0xaf')+_[_0xcf23('0xa1')](_0x2b9085[_0xcf23('0x41')][_0xcf23('0xad')][_0xcf23('0xa4')]())+_0xcf23('0xa2')](_0x2b9085[_0xcf23('0x41')]['ids']);}})[_0xcf23('0x15')](function(_0x37f045){if(_['isArray'](_0x2b9085[_0xcf23('0x41')]['ids'])){for(var _0x1db1f3=0x0;_0x1db1f3<_0x2b9085['query'][_0xcf23('0x61')][_0xcf23('0x58')];_0x1db1f3+=0x1){var _0x856e76={'UserId':Number(_0x2b9085[_0xcf23('0x51')]['id'])};_0x856e76[_[_0xcf23('0xa1')](_0x2b9085['query'][_0xcf23('0xad')][_0xcf23('0xa4')]())+_0xcf23('0xa5')]=Number(_0x2b9085['query'][_0xcf23('0x61')][_0x1db1f3]);socket[_0xcf23('0xa6')]('user'+_[_0xcf23('0xa1')](_0x2b9085[_0xcf23('0x41')][_0xcf23('0xad')][_0xcf23('0xa4')]())+'Queue:remove',_0x856e76);}}else{var _0x856e76={'UserId':Number(_0x2b9085[_0xcf23('0x51')]['id'])};_0x856e76[_[_0xcf23('0xa1')](_0x2b9085[_0xcf23('0x41')]['channel'][_0xcf23('0xa4')]())+_0xcf23('0xa5')]=Number(_0x2b9085[_0xcf23('0x41')][_0xcf23('0x61')]);socket[_0xcf23('0xa6')]('user'+_[_0xcf23('0xa1')](_0x2b9085[_0xcf23('0x41')][_0xcf23('0xad')]['toLowerCase']())+_0xcf23('0xb0'),_0x856e76);}return _0x37f045;})['then'](function(){if(_0x2b9085[_0xcf23('0x41')][_0xcf23('0xad')]===_0xcf23('0xa8')){return db[_0xcf23('0xac')][_0xcf23('0x38')]({'where':{'UserId':_0x2b9085[_0xcf23('0x51')]['id'],'VoiceQueueId':_0x2b9085['query']['ids']},'individualHooks':!![]})[_0xcf23('0x15')](function(){return _0x2936d6;});}return _0x2936d6;})['then'](respondWithStatusCode(_0x1e1dd1,null))[_0xcf23('0x4f')](handleError(_0x1e1dd1,null));};exports[_0xcf23('0xb1')]=function(_0x71b321,_0x53ab9a){_0x71b321['body'][_0xcf23('0xb2')]=_0x71b321[_0xcf23('0xb3')][_0xcf23('0xb4')];return db[_0xcf23('0x3c')][_0xcf23('0x35')]({'where':{'id':_0x71b321['params']['id']}})[_0xcf23('0x15')](handleEntityNotFound(_0x53ab9a,null))[_0xcf23('0x15')](saveUpdates(_0x71b321[_0xcf23('0x5d')],null))[_0xcf23('0x15')](respondWithResult(_0x53ab9a,null))['catch'](handleError(_0x53ab9a,null));};exports[_0xcf23('0xb5')]=function(_0x2942ae,_0x17332a){var _0x739c83=path[_0xcf23('0xb6')](config[_0xcf23('0xb7')],_0xcf23('0xb8'));return db[_0xcf23('0x3c')][_0xcf23('0x35')]({'where':{'id':_0x2942ae['params']['id']},'attributes':['id','userpic'],'raw':!![]})['then'](handleEntityNotFound(_0x17332a,null))[_0xcf23('0x15')](function(_0x372c89){if(_0x372c89){if(_['isNil'](_0x372c89[_0xcf23('0xb2')])){return _0x17332a[_0xcf23('0xb9')](_0x739c83);}else{if(!fs[_0xcf23('0xba')](path['join'](config[_0xcf23('0xb7')],'server/files/images/',_0x372c89[_0xcf23('0xb2')]))){return _0x17332a['download'](_0x739c83);}return _0x17332a[_0xcf23('0xb9')](path['join'](config[_0xcf23('0xb7')],_0xcf23('0xbb'),_0x372c89['userpic']));}}})[_0xcf23('0x4f')](handleError(_0x17332a,null));};exports[_0xcf23('0xbc')]=function(_0x15cde3,_0x377882){return db['User'][_0xcf23('0x35')]({'where':{'id':_0x15cde3[_0xcf23('0x51')]['id']},'attributes':['id']})[_0xcf23('0x15')](handleEntityNotFound(_0x377882,null))['then'](function(_0x54a59a){var _0x1e2bb3=[];values=_0x54a59a[_0xcf23('0x4a')];_0x1e2bb3['push'](get_open_tabs(_0xcf23('0x49'),_0x54a59a[_0xcf23('0x4a')]));_0x1e2bb3[_0xcf23('0x48')](get_open_tabs(_0xcf23('0x4b'),_0x54a59a[_0xcf23('0x4a')]));_0x1e2bb3[_0xcf23('0x48')](get_open_tabs(_0xcf23('0x5b'),_0x54a59a[_0xcf23('0x4a')]));_0x1e2bb3['push'](get_open_tabs('whatsapp',_0x54a59a['dataValues']));_0x1e2bb3[_0xcf23('0x48')](get_open_tabs(_0xcf23('0x4c'),_0x54a59a[_0xcf23('0x4a')]));_0x1e2bb3['push'](get_open_tabs(_0xcf23('0x4d'),_0x54a59a[_0xcf23('0x4a')]));return BPromise[_0xcf23('0x5c')](_0x1e2bb3);})[_0xcf23('0x15')](function(_0x1752cc){var _0x2cdac9=[];if(_0x1752cc){for(var _0x3b6588=0x0;_0x3b6588=_0x275b79){_0x29bb41=_0x275b79;_0x395eab=0xc8;}else{_0x395eab=0xce;}_0x49cd41[_0x99ad('0x1d')](_0x395eab);return _0x49cd41[_0x99ad('0x24')](_0x99ad('0x25'),_0x5954c0+'-'+_0x29bb41+'/'+_0x275b79)[_0x99ad('0x1f')](_0xa8578a);}return null;};}function saveUpdates(_0x33ba41){return function(_0x44997c){if(_0x44997c){return _0x44997c[_0x99ad('0x26')](_0x33ba41)[_0x99ad('0x27')](function(_0x30049a){return _0x30049a;});}return null;};}function removeEntity(_0x2d0482){return function(_0x280ed3){if(_0x280ed3){return _0x280ed3['destroy']()['then'](function(){var _0x231fff=_0x280ed3[_0x99ad('0x28')]({'plain':!![]});if(_0x231fff['role']===_0x99ad('0x29'))return;var _0x4fa8c2=[{'name':_0x99ad('0x2a'),'value':_0x99ad('0x2b'),'ignore':!![]},{'name':_0x99ad('0x2c'),'value':_0x99ad('0x2d'),'ignore':![]},{'name':_0x99ad('0x2e'),'value':'telephone','ignore':![]}];var _0xdad3d7=_(_0x4fa8c2)[_0x99ad('0x2f')](_0x99ad('0x30'))[_0x99ad('0x31')](_0x99ad('0x32'))['value']();if(_[_0x99ad('0x33')](_0xdad3d7,_0x231fff[_0x99ad('0x34')])){return;}var _0x5a07dc=_[_0x99ad('0x35')](_0x4fa8c2,[_0x99ad('0x32'),_0x231fff[_0x99ad('0x34')]])['name'];return db[_0x99ad('0x36')][_0x99ad('0x37')]({'where':{'type':_0x5a07dc,'resourceId':_0x231fff['id']}})[_0x99ad('0x27')](function(){return _0x280ed3;});})[_0x99ad('0x27')](function(){_0x2d0482[_0x99ad('0x1d')](0xcc)[_0x99ad('0x1e')]();});}};}function handleEntityNotFound(_0xe1b166){return function(_0x35b0c9){if(!_0x35b0c9){_0xe1b166['sendStatus'](0x194);}return _0x35b0c9;};}function handleError(_0xea1278,_0x58eb35){_0x58eb35=_0x58eb35||0x1f4;return function(_0x5757c5){logger[_0x99ad('0x19')](_0x5757c5[_0x99ad('0x38')]);if(_0x5757c5[_0x99ad('0x39')]){delete _0x5757c5[_0x99ad('0x39')];}_0xea1278[_0x99ad('0x1d')](_0x58eb35)[_0x99ad('0x3a')](_0x5757c5);};}exports[_0x99ad('0x3b')]=function(_0x5e7209,_0x5ab495){var _0x10aaa8={},_0x10eaeb={'count':0x0,'rows':[]};var _0x1e8422=_(db[_0x99ad('0x3c')][_0x99ad('0x3d')])[_0x99ad('0x31')](function(_0x63b0a6){return{'name':_0x63b0a6[_0x99ad('0x3e')],'type':_0x63b0a6[_0x99ad('0x3f')][_0x99ad('0x40')]};})[_0x99ad('0x2f')](function(_0x15719d){return!_['includes']([_0x99ad('0x41'),'salt'],_0x15719d[_0x99ad('0x39')]);})['value']();_0x10aaa8=qs['getOptions'](_0x1e8422,_0x5e7209);var _0x2b355b={'where':_0x10aaa8[_0x99ad('0x42')]};return db[_0x99ad('0x3c')][_0x99ad('0x23')](_0x2b355b)[_0x99ad('0x27')](function(_0x9766fd){_0x10eaeb[_0x99ad('0x23')]=_0x9766fd;if(_0x5e7209[_0x99ad('0x43')][_0x99ad('0x44')]){_0x10aaa8['include']=[{'all':!![]}];}if(!_[_0x99ad('0x33')](_0x10aaa8[_0x99ad('0x45')],'id')){_0x10aaa8[_0x99ad('0x45')][_0x99ad('0x46')]('id');}return db[_0x99ad('0x3c')]['findAll'](_0x10aaa8);})[_0x99ad('0x27')](function(_0x3ddaeb){_0x10eaeb[_0x99ad('0x47')]=_0x3ddaeb;if(_0x5e7209[_0x99ad('0x43')][_0x99ad('0x48')]===_0x99ad('0x49')){var _0x185480=[];for(var _0x19632c=0x0;_0x19632c<_0x10eaeb[_0x99ad('0x47')]['length'];_0x19632c++){_0x185480[_0x99ad('0x46')](get_open_tabs(_0x99ad('0x4a'),_0x10eaeb[_0x99ad('0x47')][_0x19632c][_0x99ad('0x4b')]));_0x185480[_0x99ad('0x46')](get_open_tabs(_0x99ad('0x4c'),_0x10eaeb[_0x99ad('0x47')][_0x19632c][_0x99ad('0x4b')]));_0x185480[_0x99ad('0x46')](get_open_tabs(_0x99ad('0x4d'),_0x10eaeb[_0x99ad('0x47')][_0x19632c]['dataValues']));_0x185480[_0x99ad('0x46')](get_open_tabs(_0x99ad('0x4e'),_0x10eaeb[_0x99ad('0x47')][_0x19632c][_0x99ad('0x4b')]));_0x185480[_0x99ad('0x46')](get_open_tabs(_0x99ad('0x4f'),_0x10eaeb[_0x99ad('0x47')][_0x19632c]['dataValues']));_0x185480[_0x99ad('0x46')](get_open_tabs('whatsapp',_0x10eaeb['rows'][_0x19632c][_0x99ad('0x4b')]));}return BPromise[_0x99ad('0x50')](_0x185480)[_0x99ad('0x27')](function(_0x5967ef){return _0x10eaeb;});}else{return _0x10eaeb;}})[_0x99ad('0x27')](respondWithFilteredResult(_0x5ab495,_0x10aaa8))[_0x99ad('0x1c')](handleError(_0x5ab495,null));};exports['show']=function(_0x301758,_0x43d694){var _0x3fdfd3={'raw':![],'where':{'id':_0x301758[_0x99ad('0x51')]['id']}},_0x13cb76={};_0x13cb76[_0x99ad('0x52')]=_[_0x99ad('0x53')](_['keys'](db[_0x99ad('0x3c')][_0x99ad('0x3d')]),[_0x99ad('0x41'),_0x99ad('0x54')]);_0x13cb76[_0x99ad('0x43')]=_[_0x99ad('0x55')](_0x301758[_0x99ad('0x43')]);_0x13cb76['filters']=_[_0x99ad('0x56')](_0x13cb76[_0x99ad('0x52')],_0x13cb76['query']);_0x3fdfd3['attributes']=_[_0x99ad('0x56')](_0x13cb76[_0x99ad('0x52')],qs[_0x99ad('0x57')](_0x301758[_0x99ad('0x43')][_0x99ad('0x57')]));_0x3fdfd3[_0x99ad('0x45')]=_0x3fdfd3['attributes']['length']?_0x3fdfd3[_0x99ad('0x45')]:_0x13cb76[_0x99ad('0x52')];if(_0x301758[_0x99ad('0x43')]['includeAll']){_0x3fdfd3[_0x99ad('0x58')]=[{'all':!![]}];}_0x3fdfd3=_[_0x99ad('0x59')]({},_0x3fdfd3,_0x301758[_0x99ad('0x5a')]);if(!_[_0x99ad('0x33')](_0x3fdfd3[_0x99ad('0x45')],'id')){_0x3fdfd3[_0x99ad('0x45')][_0x99ad('0x46')]('id');}return db[_0x99ad('0x3c')][_0x99ad('0x35')](_0x3fdfd3)['then'](handleEntityNotFound(_0x43d694,null))['then'](function(_0xd626c){var _0x3c6702=[];values=_0xd626c;if(_0x301758['query'][_0x99ad('0x48')]==='true'){_0x3c6702['push'](get_open_tabs('chat',_0xd626c[_0x99ad('0x4b')]));_0x3c6702[_0x99ad('0x46')](get_open_tabs(_0x99ad('0x4c'),_0xd626c[_0x99ad('0x4b')]));_0x3c6702[_0x99ad('0x46')](get_open_tabs('openchannel',_0xd626c[_0x99ad('0x4b')]));_0x3c6702['push'](get_open_tabs(_0x99ad('0x5b'),_0xd626c[_0x99ad('0x4b')]));_0x3c6702[_0x99ad('0x46')](get_open_tabs('fax',_0xd626c[_0x99ad('0x4b')]));_0x3c6702[_0x99ad('0x46')](get_open_tabs(_0x99ad('0x4e'),_0xd626c['dataValues']));return BPromise[_0x99ad('0x50')](_0x3c6702);}else{return values;}})[_0x99ad('0x27')](function(_0x57256b){return values;})[_0x99ad('0x27')](respondWithResult(_0x43d694,null))[_0x99ad('0x1c')](handleError(_0x43d694,null));};exports[_0x99ad('0x26')]=function(_0x53598b,_0x26e7f9){if(_0x53598b['body']['id']){delete _0x53598b[_0x99ad('0x5c')]['id'];}delete _0x53598b[_0x99ad('0x5c')][_0x99ad('0x34')];return db[_0x99ad('0x3c')][_0x99ad('0x35')]({'where':{'id':_0x53598b[_0x99ad('0x51')]['id']}})['then'](handleEntityNotFound(_0x26e7f9,null))['then'](saveUpdates(_0x53598b[_0x99ad('0x5c')],null))[_0x99ad('0x27')](respondWithResult(_0x26e7f9,null))['catch'](handleError(_0x26e7f9,null));};exports[_0x99ad('0x5d')]=function(_0x53ffc3,_0x5ea1ac){return db[_0x99ad('0x3c')][_0x99ad('0x5d')]()[_0x99ad('0x27')](respondWithResult(_0x5ea1ac,null))[_0x99ad('0x1c')](handleError(_0x5ea1ac,null));};exports['addContacts']=function(_0x42b5eb,_0x33ddac){return db['User'][_0x99ad('0x35')]({'where':{'id':_0x42b5eb[_0x99ad('0x51')]['id']}})['then'](handleEntityNotFound(_0x33ddac,null))[_0x99ad('0x27')](function(_0x395e56){if(_0x395e56){return _0x395e56[_0x99ad('0x5e')](_0x42b5eb['body']['ids'],_[_0x99ad('0x5f')](_0x42b5eb[_0x99ad('0x5c')],[_0x99ad('0x60'),'id'])||{});}})[_0x99ad('0x27')](respondWithResult(_0x33ddac,null))[_0x99ad('0x1c')](handleError(_0x33ddac,null));};function validateUser(_0x51cc9a){return new BPromise(function(_0x3cf245,_0xc95b46){if(_0x51cc9a[_0x99ad('0x61')])return _0x3cf245(_0x51cc9a);return db['Setting'][_0x99ad('0x62')](0x1)[_0x99ad('0x27')](function(_0x3983b4){if(_0x3983b4[_0x99ad('0x63')])authService[_0x99ad('0x64')](_0x51cc9a[_0x99ad('0x41')]);db['User'][_0x99ad('0x65')](_0x99ad('0x61'))['then'](function(_0x3b699f){if(_['isNil'](_0x3b699f)){_0x51cc9a['internal']=_0x3983b4[_0x99ad('0x66')]||0x1;return;}if(_[_0x99ad('0x67')](_0x3983b4[_0x99ad('0x66')])||_0x3983b4['min_internal']===_0x3b699f){_0x51cc9a['internal']=_0x3b699f+0x1;return;}if(_0x3983b4[_0x99ad('0x66')]>_0x3b699f){_0x51cc9a[_0x99ad('0x61')]=_0x3983b4[_0x99ad('0x66')];return;}return db[_0x99ad('0x68')][_0x99ad('0x43')](_0x99ad('0x69'),{'type':db[_0x99ad('0x68')]['QueryTypes'][_0x99ad('0x6a')]})[_0x99ad('0x27')](function(_0x47a595){if(_0x47a595&&_0x47a595[_0x99ad('0x6b')]){for(var _0x5127ce=0x0,_0x315b28=_0x47a595[_0x99ad('0x6b')];_0x5127ce<_0x315b28&&_[_0x99ad('0x67')](_0x51cc9a[_0x99ad('0x61')]);_0x5127ce++){if(_0x3983b4[_0x99ad('0x66')]<=_0x47a595[_0x5127ce][_0x99ad('0x6c')]){_0x51cc9a[_0x99ad('0x61')]=_0x47a595[_0x5127ce][_0x99ad('0x6c')];}else if(_0x3983b4[_0x99ad('0x66')]>_0x47a595[_0x5127ce]['from']&&_0x3983b4[_0x99ad('0x66')]<=_0x47a595[_0x5127ce]['to']){_0x51cc9a[_0x99ad('0x61')]=_0x3983b4[_0x99ad('0x66')];}}}if(_[_0x99ad('0x67')](_0x51cc9a[_0x99ad('0x61')])){_0x51cc9a['internal']=_0x3b699f+0x1;}return _0x3cf245(_0x51cc9a);});});})[_0x99ad('0x1c')](function(_0x30846f){_0xc95b46(_0x30846f);});});}function updateUser(_0x1087c7){return new BPromise(function(_0x3a8c29,_0x4b011e){try{if(_0x1087c7[_0x99ad('0x6d')]){_0x1087c7['mailbox']=_0x1087c7[_0x99ad('0x61')];_0x1087c7[_0x99ad('0x6e')]={'mailbox':_0x1087c7[_0x99ad('0x61')],'password':_0x1087c7[_0x99ad('0x41')],'fullname':_0x1087c7['fullname'],'email':_0x1087c7['email']};}if(_0x1087c7[_0x99ad('0x34')]==='agent'){if(!_0x1087c7[_0x99ad('0x6f')])_0x1087c7[_0x99ad('0x6f')]=['101',_0x99ad('0x70'),'103','113',_0x99ad('0x71'),_0x99ad('0x72'),_0x99ad('0x73'),_0x99ad('0x74'),'107',_0x99ad('0x75'),'109',_0x99ad('0x76'),_0x99ad('0x77'),_0x99ad('0x78'),_0x99ad('0x79')];}_0x3a8c29(_0x1087c7);}catch(_0x288cb6){_0x4b011e(_0x288cb6);}});}exports[_0x99ad('0x7a')]=function(_0x2da645,_0x42e665){if(_0x2da645[_0x99ad('0x2b')][_0x99ad('0x34')]===_0x99ad('0x2d'))throw new Error(_0x99ad('0x7b'));if(_0x2da645[_0x99ad('0x5c')][_0x99ad('0x34')]===_0x99ad('0x2b')&&_0x2da645[_0x99ad('0x2b')][_0x99ad('0x34')]!==_0x99ad('0x29')){throw new Error(_0x99ad('0x7c'));}if(_0x2da645[_0x99ad('0x5c')][_0x99ad('0x34')]===_0x99ad('0x29')&&_0x2da645[_0x99ad('0x2b')]['role']!=='admin'){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator');}return licenseUtil['checkUserLimits']([_0x2da645[_0x99ad('0x5c')]])[_0x99ad('0x27')](function(){return validateUser(_0x2da645[_0x99ad('0x5c')]);})[_0x99ad('0x27')](function(_0x46751a){return updateUser(_0x46751a)[_0x99ad('0x27')](function(_0x4dd6a4){if(_0x4dd6a4[_0x99ad('0x34')]===_0x99ad('0x29')){_0x4dd6a4[_0x99ad('0x7d')]=_0x2da645[_0x99ad('0x2b')][_0x99ad('0x7d')];delete _0x4dd6a4[_0x99ad('0x7e')];}return _0x4dd6a4;});})[_0x99ad('0x27')](function(_0x2b2faf){return db[_0x99ad('0x3c')]['create'](_0x2b2faf,{'include':[{'model':db[_0x99ad('0x6e')],'as':'VoiceMail'}]});})['then'](function(_0xe9c975){if(_0x2da645[_0x99ad('0x5c')][_0x99ad('0x34')]===_0x99ad('0x2b'))return _0xe9c975;if(_0x2da645[_0x99ad('0x2b')][_0x99ad('0x34')]!==_0x99ad('0x2b'))return _0xe9c975;return db[_0x99ad('0x7f')]['find']({'where':{'name':_0xe9c975['role']==='agent'?_0x99ad('0x2c'):_0x99ad('0x2e'),'userProfileId':_0x2da645['user']['userProfileId']},'raw':!![]})[_0x99ad('0x27')](function(_0x2bd0bc){if(!_0x2bd0bc||_0x2bd0bc[_0x99ad('0x80')]!=0x0)return _0xe9c975;return db[_0x99ad('0x36')][_0x99ad('0x7a')]({'name':_0xe9c975[_0x99ad('0x39')],'resourceId':_0xe9c975['id'],'type':_0x2bd0bc[_0x99ad('0x39')],'sectionId':_0x2bd0bc['id']},{})[_0x99ad('0x27')](function(){return _0xe9c975;});})[_0x99ad('0x1c')](function(_0x3d70dc){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3d70dc);throw _0x3d70dc;});})[_0x99ad('0x27')](respondWithResult(_0x42e665,0xc9))[_0x99ad('0x1c')](handleError(_0x42e665,null));};exports['bulkCreate']=function(_0x18dc53,_0x439881){var _0x2e0577=_0x18dc53[_0x99ad('0x5c')];var _0x265aad=[];if(_0x18dc53['user'][_0x99ad('0x34')]===_0x99ad('0x2d'))throw new Error(_0x99ad('0x7b'));if(_[_0x99ad('0x81')](_0x2e0577,['role',_0x99ad('0x2b')])&&_0x18dc53[_0x99ad('0x2b')][_0x99ad('0x34')]!==_0x99ad('0x29')){throw new Error(_0x99ad('0x7c'));}if(_[_0x99ad('0x81')](_0x2e0577,[_0x99ad('0x34'),_0x99ad('0x29')])&&_0x18dc53[_0x99ad('0x2b')][_0x99ad('0x34')]!=='admin'){throw new Error(_0x99ad('0x82'));}return licenseUtil['checkUserLimits'](_0x2e0577)[_0x99ad('0x27')](function(){return validateUser(_0x2e0577[0x0]);})[_0x99ad('0x27')](function(){for(var _0x4f3419=0x1;_0x4f3419<_0x2e0577['length'];_0x4f3419++){var _0x9f49f0=_0x2e0577[_0x4f3419-0x1][_0x99ad('0x61')];if(!_0x2e0577[_0x4f3419][_0x99ad('0x61')])_0x2e0577[_0x4f3419][_0x99ad('0x61')]=_0x9f49f0+0x1;_0x265aad[_0x99ad('0x46')](validateUser(_0x2e0577[_0x4f3419]));}return BPromise[_0x99ad('0x50')](_0x265aad);})['then'](function(){_0x265aad=[];for(var _0x5323d0=0x0;_0x5323d0<_0x2e0577[_0x99ad('0x6b')];_0x5323d0++){_0x265aad[_0x99ad('0x46')](updateUser(_0x2e0577[_0x5323d0]));}return BPromise[_0x99ad('0x50')](_0x265aad);})['then'](function(){return BPromise[_0x99ad('0x83')](_0x2e0577,function(_0x2bdc53){return db[_0x99ad('0x3c')][_0x99ad('0x7a')](_0x2bdc53,{'include':[{'model':db['VoiceMail'],'as':_0x99ad('0x6e')}]})[_0x99ad('0x27')](function(_0x5322f0){_0x2bdc53['id']=_0x5322f0['id'];return _0x2bdc53;});});})[_0x99ad('0x27')](function(_0x1a78df){if(_0x18dc53['body']['role']===_0x99ad('0x2b'))return _0x1a78df;if(_0x18dc53['user'][_0x99ad('0x34')]!==_0x99ad('0x2b'))return _0x1a78df;var _0x245206=_['some'](_0x1a78df,function(_0x26a08e){return _0x26a08e[_0x99ad('0x34')]===_0x99ad('0x2d')||_0x26a08e[_0x99ad('0x34')]===_0x99ad('0x84');});if(!_0x245206)return _0x1a78df;return db[_0x99ad('0x7f')][_0x99ad('0x85')]({'where':{'name':{'$or':['Agents',_0x99ad('0x2e')]},'userProfileId':_0x18dc53[_0x99ad('0x2b')][_0x99ad('0x7e')]},'raw':!![]})[_0x99ad('0x27')](function(_0x5afffb){if(_[_0x99ad('0x86')](_0x5afffb)||!_[_0x99ad('0x81')](_0x5afffb,[_0x99ad('0x80'),0x0]))return _0x1a78df;_0x265aad=[];var _0x82cc8=_(_0x5afffb)[_0x99ad('0x31')](function(_0x279e08){if(_0x279e08['autoAssociation']===0x1)return;return _0x279e08['name']===_0x99ad('0x2c')?_0x99ad('0x2d'):_0x99ad('0x84');})[_0x99ad('0x87')]()[_0x99ad('0x32')]();for(var _0x16f3dc=0x0;_0x16f3dc<_0x1a78df[_0x99ad('0x6b')];_0x16f3dc++){if(!_[_0x99ad('0x33')](_0x82cc8,_0x1a78df[_0x16f3dc][_0x99ad('0x34')]))return;var _0x1e975a=_0x1a78df[_0x16f3dc]['role']===_0x99ad('0x2d')?'Agents':'Telephones';_0x265aad['push'](db['UserProfileResource']['create']({'name':_0x1a78df[_0x16f3dc][_0x99ad('0x39')],'resourceId':_0x1a78df[_0x16f3dc]['id'],'type':_0x1e975a,'sectionId':_[_0x99ad('0x35')](_0x5afffb,[_0x99ad('0x39'),_0x1e975a])['id']},{}));}return BPromise['all'](_0x265aad);});})['then'](respondWithResult(_0x439881,0xc9))[_0x99ad('0x1c')](handleError(_0x439881,null));};exports[_0x99ad('0x88')]=function(_0x4c93b2,_0x4b58fb){if(_0x4c93b2['body']['id']){delete _0x4c93b2[_0x99ad('0x5c')]['id'];}return db[_0x99ad('0x3c')]['find']({'where':{'id':_0x4c93b2[_0x99ad('0x51')]['id']}})[_0x99ad('0x27')](function(_0x5e71d6){if(!_0x5e71d6)return null;if(_0x5e71d6['id']===_0x4c93b2[_0x99ad('0x2b')]['id']){if(!_0x4c93b2[_0x99ad('0x5c')][_0x99ad('0x89')]||!_0x4c93b2[_0x99ad('0x5c')]['newPassword']){throw new db[(_0x99ad('0x8a'))][(_0x99ad('0x8b'))]('Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword');}if(!_0x5e71d6[_0x99ad('0x8c')](_0x4c93b2[_0x99ad('0x5c')][_0x99ad('0x89')])){throw new db['Sequelize'][(_0x99ad('0x8b'))](_0x99ad('0x8d'));}if(_0x4c93b2[_0x99ad('0x5c')]['oldPassword']===_0x4c93b2[_0x99ad('0x5c')][_0x99ad('0x8e')]){throw new db[(_0x99ad('0x8a'))][(_0x99ad('0x8b'))](_0x99ad('0x8f'));}}else if(_0x4c93b2[_0x99ad('0x2b')][_0x99ad('0x34')]===_0x99ad('0x29')){if(!_0x4c93b2[_0x99ad('0x5c')]['newPassword']){throw new db['Sequelize']['ValidationError'](_0x99ad('0x90'));}}else if(_0x4c93b2['user'][_0x99ad('0x34')]===_0x99ad('0x2b')){if(!_0x4c93b2[_0x99ad('0x5c')][_0x99ad('0x8e')]){throw new db[(_0x99ad('0x8a'))][(_0x99ad('0x8b'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0x5e71d6[_0x99ad('0x34')]!==_0x99ad('0x2d')){throw new db[(_0x99ad('0x8a'))][(_0x99ad('0x8b'))]('Unauthorized');}}else{throw new db['Sequelize'][(_0x99ad('0x8b'))]('Unauthorized');}return _0x5e71d6;})[_0x99ad('0x27')](handleEntityNotFound(_0x4b58fb,null))[_0x99ad('0x27')](function(_0x35a01a){return db[_0x99ad('0x91')][_0x99ad('0x92')]({'attributes':['id',_0x99ad('0x63'),_0x99ad('0x93'),_0x99ad('0x94')]})[_0x99ad('0x27')](function(_0xfb1264){if(_0xfb1264[_0x99ad('0x63')])authService['validatePasswordPattern'](_0x4c93b2[_0x99ad('0x5c')][_0x99ad('0x8e')]);if(!_0xfb1264[_0x99ad('0x93')]||!_0x35a01a['previousPasswords'])return _0x35a01a;authService['validatePasswordHistory'](_0x4c93b2[_0x99ad('0x5c')][_0x99ad('0x8e')],_0x35a01a[_0x99ad('0x95')],_0xfb1264['passwordHistoryLimit']);return _0x35a01a;})[_0x99ad('0x27')](saveUpdates({'password':_0x4c93b2[_0x99ad('0x5c')][_0x99ad('0x8e')],'passwordResetAt':_0x4c93b2['user']['id']==_0x4c93b2[_0x99ad('0x51')]['id']?moment():null,'previousPasswords':authService['updatePasswordsHistory'](_0x4c93b2[_0x99ad('0x5c')]['newPassword'],_0x35a01a[_0x99ad('0x95')])},null));})[_0x99ad('0x27')](respondWithResult(_0x4b58fb,null))[_0x99ad('0x1c')](handleError(_0x4b58fb,null));};exports['addQueues']=function(_0x5977e7,_0x22f5a6){var _0x1c4249=_0x5977e7[_0x99ad('0x5c')]['channel'];return db[_0x99ad('0x3c')]['find']({'where':{'id':_0x5977e7[_0x99ad('0x51')]['id']},'attributes':['id',_0x99ad('0x39'),'role',_0x99ad('0x96'),_0x99ad('0x97'),'voicePause',_0x99ad('0x98')]})[_0x99ad('0x27')](handleEntityNotFound(_0x22f5a6,null))['then'](function(_0x316875){if(_0x316875){if(!utils[_0x99ad('0x99')](_0x1c4249)){throw new db['Sequelize'][(_0x99ad('0x8b'))](_0x99ad('0x9a'));}return _0x316875[_0x99ad('0x9b')+_[_0x99ad('0x9c')](_0x1c4249['toLowerCase']())+_0x99ad('0x9d')](_0x5977e7[_0x99ad('0x5c')][_0x99ad('0x60')],{'penalty':_0x5977e7[_0x99ad('0x5c')]['penalty']||0x0})[_0x99ad('0x9e')](function(_0x287a7c){for(var _0x41d494=0x0;_0x41d494<_0x5977e7[_0x99ad('0x5c')][_0x99ad('0x60')]['length'];_0x41d494+=0x1){var _0x115672={'UserId':Number(_0x5977e7['params']['id'])};_0x115672[_[_0x99ad('0x9c')](_0x1c4249[_0x99ad('0x9f')]())+'QueueId']=Number(_0x5977e7[_0x99ad('0x5c')][_0x99ad('0x60')][_0x41d494]);socket[_0x99ad('0xa0')](_0x99ad('0x2b')+_[_0x99ad('0x9c')](_0x1c4249['toLowerCase']())+_0x99ad('0xa1'),_0x115672);}return _0x287a7c;})['then'](function(){if(_0x1c4249===_0x99ad('0xa2')){return db[_0x99ad('0xa3')]['findAll']({'where':{'id':_0x5977e7[_0x99ad('0x5c')][_0x99ad('0x60')]||[]},'raw':!![],'attributes':['id','name']});}})[_0x99ad('0x27')](function(_0x42bc9c){var _0x2f4fdc=_0x316875[_0x99ad('0x28')]({'plain':!![]});var _0x13471d=[];if(_0x1c4249===_0x99ad('0xa2')&&_0x2f4fdc['role']===_0x99ad('0x2d')&&_0x2f4fdc['online']){for(var _0x5e0b0a=0x0;_0x5e0b0a<_0x42bc9c[_0x99ad('0x6b')];_0x5e0b0a+=0x1){_0x13471d[_0x99ad('0x46')]({'membername':_0x2f4fdc[_0x99ad('0x39')],'UserId':_0x2f4fdc['id'],'queue_name':_0x42bc9c[_0x5e0b0a][_0x99ad('0x39')],'VoiceQueueId':_0x42bc9c[_0x5e0b0a]['id'],'interface':_['isNil'](_0x2f4fdc['interface'])?util[_0x99ad('0xa4')]('SIP/%s',_0x2f4fdc['name']):_0x2f4fdc[_0x99ad('0x98')],'paused':_0x2f4fdc[_0x99ad('0xa5')]||![],'penalty':_0x5977e7[_0x99ad('0x5c')][_0x99ad('0xa6')]||0x0});}return BPromise[_0x99ad('0x83')](_0x13471d,function(_0x4fc200){return db['UserVoiceQueueRt'][_0x99ad('0xa7')](_0x4fc200);});}return _0x316875;});}})['then'](respondWithStatusCode(_0x22f5a6,null))[_0x99ad('0x1c')](handleError(_0x22f5a6,null));};exports[_0x99ad('0xa8')]=function(_0x180ee7,_0x58e5ed){var _0x336f09;return db[_0x99ad('0x3c')][_0x99ad('0x35')]({'where':{'id':_0x180ee7[_0x99ad('0x51')]['id']},'attributes':['id',_0x99ad('0x39'),_0x99ad('0x34')]})[_0x99ad('0x27')](handleEntityNotFound(_0x58e5ed,null))[_0x99ad('0x27')](function(_0x56fb5b){if(_0x56fb5b){_0x336f09=_0x56fb5b;if(!_0x180ee7[_0x99ad('0x43')][_0x99ad('0xa9')]||!utils[_0x99ad('0x99')](_0x180ee7['query'][_0x99ad('0xa9')])){throw new db[(_0x99ad('0x8a'))]['ValidationError']('Unknown\x20channel');}return _0x56fb5b['remove'+_['capitalize'](_0x180ee7[_0x99ad('0x43')][_0x99ad('0xa9')][_0x99ad('0x9f')]())+_0x99ad('0x9d')](_0x180ee7[_0x99ad('0x43')][_0x99ad('0x60')]);}})[_0x99ad('0x27')](function(_0x2be59b){if(_[_0x99ad('0xaa')](_0x180ee7['query'][_0x99ad('0x60')])){for(var _0x1f58a7=0x0;_0x1f58a7<_0x180ee7['query'][_0x99ad('0x60')][_0x99ad('0x6b')];_0x1f58a7+=0x1){var _0x1b5428={'UserId':Number(_0x180ee7[_0x99ad('0x51')]['id'])};_0x1b5428[_['capitalize'](_0x180ee7[_0x99ad('0x43')][_0x99ad('0xa9')][_0x99ad('0x9f')]())+_0x99ad('0xab')]=Number(_0x180ee7[_0x99ad('0x43')]['ids'][_0x1f58a7]);socket['emit']('user'+_[_0x99ad('0x9c')](_0x180ee7[_0x99ad('0x43')][_0x99ad('0xa9')][_0x99ad('0x9f')]())+'Queue:remove',_0x1b5428);}}else{var _0x1b5428={'UserId':Number(_0x180ee7[_0x99ad('0x51')]['id'])};_0x1b5428[_[_0x99ad('0x9c')](_0x180ee7[_0x99ad('0x43')][_0x99ad('0xa9')][_0x99ad('0x9f')]())+_0x99ad('0xab')]=Number(_0x180ee7[_0x99ad('0x43')]['ids']);socket['emit'](_0x99ad('0x2b')+_[_0x99ad('0x9c')](_0x180ee7[_0x99ad('0x43')]['channel'][_0x99ad('0x9f')]())+_0x99ad('0xac'),_0x1b5428);}return _0x2be59b;})[_0x99ad('0x27')](function(){if(_0x180ee7[_0x99ad('0x43')]['channel']===_0x99ad('0xa2')){return db[_0x99ad('0xad')][_0x99ad('0x37')]({'where':{'UserId':_0x180ee7['params']['id'],'VoiceQueueId':_0x180ee7[_0x99ad('0x43')][_0x99ad('0x60')]},'individualHooks':!![]})[_0x99ad('0x27')](function(){return _0x336f09;});}return _0x336f09;})[_0x99ad('0x27')](respondWithStatusCode(_0x58e5ed,null))[_0x99ad('0x1c')](handleError(_0x58e5ed,null));};exports[_0x99ad('0xae')]=function(_0x2fb9a8,_0x456876){_0x2fb9a8[_0x99ad('0x5c')][_0x99ad('0xaf')]=_0x2fb9a8[_0x99ad('0xb0')][_0x99ad('0xb1')];return db[_0x99ad('0x3c')][_0x99ad('0x35')]({'where':{'id':_0x2fb9a8[_0x99ad('0x51')]['id']}})[_0x99ad('0x27')](handleEntityNotFound(_0x456876,null))[_0x99ad('0x27')](saveUpdates(_0x2fb9a8[_0x99ad('0x5c')],null))['then'](respondWithResult(_0x456876,null))[_0x99ad('0x1c')](handleError(_0x456876,null));};exports[_0x99ad('0xb2')]=function(_0x2b4018,_0x139bcd){var _0xb943d7=path[_0x99ad('0xb3')](config['root'],'server/files/images/logos/default_profile.png');return db[_0x99ad('0x3c')][_0x99ad('0x35')]({'where':{'id':_0x2b4018[_0x99ad('0x51')]['id']},'attributes':['id',_0x99ad('0xaf')],'raw':!![]})[_0x99ad('0x27')](handleEntityNotFound(_0x139bcd,null))['then'](function(_0x529af2){if(_0x529af2){if(_[_0x99ad('0x67')](_0x529af2[_0x99ad('0xaf')])){return _0x139bcd['download'](_0xb943d7);}else{if(!fs['existsSync'](path[_0x99ad('0xb3')](config[_0x99ad('0xb4')],_0x99ad('0xb5'),_0x529af2[_0x99ad('0xaf')]))){return _0x139bcd[_0x99ad('0xb6')](_0xb943d7);}return _0x139bcd['download'](path['join'](config[_0x99ad('0xb4')],_0x99ad('0xb5'),_0x529af2[_0x99ad('0xaf')]));}}})[_0x99ad('0x1c')](handleError(_0x139bcd,null));};exports[_0x99ad('0xb7')]=function(_0x2f031f,_0x7d7400){return db[_0x99ad('0x3c')][_0x99ad('0x35')]({'where':{'id':_0x2f031f[_0x99ad('0x51')]['id']},'attributes':['id']})[_0x99ad('0x27')](handleEntityNotFound(_0x7d7400,null))[_0x99ad('0x27')](function(_0x4beab9){var _0x30e196=[];values=_0x4beab9[_0x99ad('0x4b')];_0x30e196['push'](get_open_tabs(_0x99ad('0x4a'),_0x4beab9[_0x99ad('0x4b')]));_0x30e196[_0x99ad('0x46')](get_open_tabs(_0x99ad('0x4c'),_0x4beab9['dataValues']));_0x30e196[_0x99ad('0x46')](get_open_tabs(_0x99ad('0x4f'),_0x4beab9[_0x99ad('0x4b')]));_0x30e196['push'](get_open_tabs(_0x99ad('0x5b'),_0x4beab9[_0x99ad('0x4b')]));_0x30e196[_0x99ad('0x46')](get_open_tabs(_0x99ad('0x4d'),_0x4beab9[_0x99ad('0x4b')]));_0x30e196[_0x99ad('0x46')](get_open_tabs(_0x99ad('0x4e'),_0x4beab9[_0x99ad('0x4b')]));return BPromise['all'](_0x30e196);})[_0x99ad('0x27')](function(_0x5df27c){var _0xc05a26=[];if(_0x5df27c){for(var _0x422198=0x0;_0x422198=_0x57630b[_0xd8ad('0x4f')]){throw new Error(_0xd8ad('0x50'));}})[_0xd8ad('0xf')](function(){if(_0x12baf0){return db[_0xd8ad('0x40')]['destroy']({'where':{'membername':_0x12baf0[_0xd8ad('0x33')]},'individualHooks':!![]});}})['then'](function(){if(_0x12baf0){return _0x12baf0[_0xd8ad('0x51')]({'raw':!![]});}})['then'](function(_0x1fe36b){if(_0x12baf0){if(_0x1fe36b){var _0x5906d3=[];_0x3294a0=_0x1fe36b;if(_0x3294a0[_0xd8ad('0x2f')]){for(var _0x25e713=0x0;_0x25e713<_0x3294a0[_0xd8ad('0x2f')];_0x25e713++){_0x5906d3[_0xd8ad('0x32')](db[_0xd8ad('0x40')][_0xd8ad('0x52')]({'membername':_0x12baf0[_0xd8ad('0x33')],'UserId':_0x12baf0['id'],'queue_name':_0x3294a0[_0x25e713][_0xd8ad('0x33')],'VoiceQueueId':_0x3294a0[_0x25e713]['id'],'interface':_0x58b7f1,'paused':_0x12baf0['loginInPause']||![],'penalty':_0x3294a0[_0x25e713][_0xd8ad('0x53')]||0x0}));}return BPromise[_0xd8ad('0x4a')](_0x5906d3);}}}})[_0xd8ad('0xf')](function(){if(_0x12baf0){return db[_0xd8ad('0x41')][_0xd8ad('0x2b')]({'where':{'membername':_0x12baf0[_0xd8ad('0x33')],'exitAt':null}});}})[_0xd8ad('0xf')](function(_0xd9ec46){if(_0x12baf0){if(_0xd9ec46&&_0xd9ec46[_0xd8ad('0x2f')]){var _0x2925b8=[];_0xd9ec46[_0xd8ad('0x31')](function(_0x5931e6){_0x2925b8[_0xd8ad('0x32')](_0x5931e6[_0xd8ad('0x3a')]({'exitAt':moment()['format'](_0xd8ad('0x2e'))}));});return BPromise['all'](_0x2925b8);}}})['then'](function(_0x298f14){if(_0x12baf0){var _0xa93204=[];var _0x4c3e3a=[];var _0x275fd6=utils[_0xd8ad('0x30')]();var _0xb0f1d5={'membername':_0x12baf0[_0xd8ad('0x33')],'interface':_0x58b7f1,'enterAt':moment()['format'](_0xd8ad('0x2e')),'role':_0x12baf0[_0xd8ad('0x28')],'internal':_0x12baf0[_0xd8ad('0x29')]};_0x275fd6[_0xd8ad('0x31')](function(_0x158a74){_0xa93204['push'](_[_0xd8ad('0x54')]({'channel':_0x158a74,'type':_0xd8ad('0x55'),'data1':_0xd8ad('0x56'),'data2':_0x58b7f1},_0xb0f1d5));if(_0x12baf0[_0xd8ad('0x57')]){_0x4c3e3a[_0xd8ad('0x32')](_[_0xd8ad('0x54')]({'channel':_0x158a74,'type':_0xd8ad('0x2c'),'data1':_0xd8ad('0x58')},_0xb0f1d5));}});return db[_0xd8ad('0x41')][_0xd8ad('0x39')](_0xa93204[_0xd8ad('0x59')](_0x4c3e3a),{'individualHooks':!![]});}})[_0xd8ad('0xf')](function(){if(_0x12baf0){return _0x12baf0['update']({'online':!![],'lastLoginAt':moment()[_0xd8ad('0x2d')](_0xd8ad('0x2e')),'voicePause':_0x12baf0[_0xd8ad('0x57')]||![],'mailPause':_0x12baf0[_0xd8ad('0x57')]||![],'chatPause':_0x12baf0[_0xd8ad('0x57')]||![],'faxPause':_0x12baf0['loginInPause']||![],'smsPause':_0x12baf0[_0xd8ad('0x57')]||![],'openchannelPause':_0x12baf0['loginInPause']||![],'pauseType':_0x12baf0[_0xd8ad('0x57')]?_0xd8ad('0x58'):null,'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0x58b7f1});}})[_0xd8ad('0xf')](function(_0x2ba899){_0x3fe942(_0x2ba899);})[_0xd8ad('0x19')](function(_0x4ac604){_0x400a3a(_0x4743ad['error'](0x1f4,_0x4ac604['message']));});});}; \ No newline at end of file +var _0x1eff=['defaults','socket.io-emitter','./user.socket','register','then','info','User,\x20%s,\x20%s','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','GetUser','findAll','options','attributes','limit','include','map','model','ShowUser','find','raw','where','PauseUser','User','name','role','interface','UserVoiceQueueRt','update','MemberReport','PAUSE','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','getChannels','forEach','SIP/%s','body','type','DEFAULT\x20PAUSE','internal','bulkCreate','catch','UnpauseUser','findOne','channel','Unknown\x20channel','voice','sms','whatsapp','system','set','%s%s','Pause','push','all','LogoutUser','destroy','phone','loginInPause','count','agent','getLicense','agents','getVoiceQueues','upsert','merge','LOGININPAUSE','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x1eff,0x19e));var _0xf1ef=function(_0x4fc753,_0x521905){_0x4fc753=_0x4fc753-0x0;var _0x2a1dca=_0x1eff[_0x4fc753];return _0x2a1dca;};'use strict';var _=require('lodash');var util=require(_0xf1ef('0x0'));var moment=require(_0xf1ef('0x1'));var BPromise=require(_0xf1ef('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf1ef('0x3'));var db=require(_0xf1ef('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf1ef('0x5'))(_0xf1ef('0x6'));var config=require('../../config/environment');var jayson=require(_0xf1ef('0x7'));var client=jayson[_0xf1ef('0x8')][_0xf1ef('0x9')]({'port':0x232a});config[_0xf1ef('0xa')]=_[_0xf1ef('0xb')](config[_0xf1ef('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xf1ef('0xc'))(new Redis(config[_0xf1ef('0xa')]));require(_0xf1ef('0xd'))[_0xf1ef('0xe')](socket);function respondWithRpcPromise(_0x436494,_0xb082f,_0xeccc2b){return new BPromise(function(_0x3db288,_0x5f282b){return client['request'](_0x436494,_0xeccc2b)[_0xf1ef('0xf')](function(_0x497fd0){logger[_0xf1ef('0x10')](_0xf1ef('0x11'),_0xb082f,'request\x20sent');logger[_0xf1ef('0x12')](_0xf1ef('0x13'),_0xb082f,'request\x20sent',JSON[_0xf1ef('0x14')](_0x497fd0));if(_0x497fd0['error']){if(_0x497fd0[_0xf1ef('0x15')][_0xf1ef('0x16')]===0x1f4){logger[_0xf1ef('0x15')]('User,\x20%s,\x20%s',_0xb082f,_0x497fd0['error']['message']);return _0x5f282b(_0x497fd0['error'][_0xf1ef('0x17')]);}logger[_0xf1ef('0x15')](_0xf1ef('0x11'),_0xb082f,_0x497fd0[_0xf1ef('0x15')][_0xf1ef('0x17')]);return _0x3db288(_0x497fd0['error']['message']);}else{logger[_0xf1ef('0x10')]('User,\x20%s,\x20%s',_0xb082f,_0xf1ef('0x18'));_0x3db288(_0x497fd0[_0xf1ef('0x19')]['message']);}})['catch'](function(_0x5749cd){logger[_0xf1ef('0x15')](_0xf1ef('0x11'),_0xb082f,_0x5749cd);_0x5f282b(_0x5749cd);});});}exports[_0xf1ef('0x1a')]=function(_0x22fb7e){var _0x3d40c4=this;return new Promise(function(_0x2648f4,_0x4df947){return db['User'][_0xf1ef('0x1b')]({'raw':_0x22fb7e[_0xf1ef('0x1c')]?_0x22fb7e[_0xf1ef('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x22fb7e[_0xf1ef('0x1c')]?_0x22fb7e[_0xf1ef('0x1c')]['where']||null:null,'attributes':_0x22fb7e[_0xf1ef('0x1c')]?_0x22fb7e['options'][_0xf1ef('0x1d')]||null:null,'limit':_0x22fb7e[_0xf1ef('0x1c')]?_0x22fb7e[_0xf1ef('0x1c')][_0xf1ef('0x1e')]||null:null,'include':_0x22fb7e[_0xf1ef('0x1c')]?_0x22fb7e[_0xf1ef('0x1c')][_0xf1ef('0x1f')]?_[_0xf1ef('0x20')](_0x22fb7e[_0xf1ef('0x1c')][_0xf1ef('0x1f')],function(_0x50f798){return{'model':db[_0x50f798[_0xf1ef('0x21')]],'as':_0x50f798['as'],'attributes':_0x50f798['attributes'],'include':_0x50f798['include']?_[_0xf1ef('0x20')](_0x50f798['include'],function(_0xb0e93f){return{'model':db[_0xb0e93f['model']],'as':_0xb0e93f['as'],'attributes':_0xb0e93f[_0xf1ef('0x1d')],'include':_0xb0e93f['include']?_[_0xf1ef('0x20')](_0xb0e93f[_0xf1ef('0x1f')],function(_0xd51a8f){return{'model':db[_0xd51a8f['model']],'as':_0xd51a8f['as'],'attributes':_0xd51a8f[_0xf1ef('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xf1ef('0xf')](function(_0xe9f07b){logger[_0xf1ef('0x10')](_0xf1ef('0x1a'),_0x22fb7e);logger['debug'](_0xf1ef('0x1a'),_0x22fb7e,JSON[_0xf1ef('0x14')](_0xe9f07b));_0x2648f4(_0xe9f07b);})['catch'](function(_0x255de1){logger[_0xf1ef('0x15')](_0xf1ef('0x1a'),_0x255de1[_0xf1ef('0x17')],_0x22fb7e);_0x4df947(_0x3d40c4['error'](0x1f4,_0x255de1['message']));});});};exports[_0xf1ef('0x22')]=function(_0x3259f){var _0x3d11f0=this;return new Promise(function(_0x34cab3,_0x2014fc){return db['User'][_0xf1ef('0x23')]({'raw':_0x3259f[_0xf1ef('0x1c')]?_0x3259f['options'][_0xf1ef('0x24')]===undefined?!![]:![]:!![],'where':_0x3259f[_0xf1ef('0x1c')]?_0x3259f[_0xf1ef('0x1c')][_0xf1ef('0x25')]||null:null,'attributes':_0x3259f[_0xf1ef('0x1c')]?_0x3259f[_0xf1ef('0x1c')][_0xf1ef('0x1d')]||null:null,'include':_0x3259f[_0xf1ef('0x1c')]?_0x3259f[_0xf1ef('0x1c')][_0xf1ef('0x1f')]?_[_0xf1ef('0x20')](_0x3259f[_0xf1ef('0x1c')][_0xf1ef('0x1f')],function(_0x4e5d67){return{'model':db[_0x4e5d67[_0xf1ef('0x21')]],'as':_0x4e5d67['as'],'attributes':_0x4e5d67[_0xf1ef('0x1d')],'include':_0x4e5d67[_0xf1ef('0x1f')]?_[_0xf1ef('0x20')](_0x4e5d67[_0xf1ef('0x1f')],function(_0x37397f){return{'model':db[_0x37397f[_0xf1ef('0x21')]],'as':_0x37397f['as'],'attributes':_0x37397f[_0xf1ef('0x1d')],'include':_0x37397f[_0xf1ef('0x1f')]?_[_0xf1ef('0x20')](_0x37397f['include'],function(_0x13f66b){return{'model':db[_0x13f66b[_0xf1ef('0x21')]],'as':_0x13f66b['as'],'attributes':_0x13f66b[_0xf1ef('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xf1ef('0xf')](function(_0x221676){logger[_0xf1ef('0x10')](_0xf1ef('0x22'),_0x3259f);logger[_0xf1ef('0x12')](_0xf1ef('0x22'),_0x3259f,JSON[_0xf1ef('0x14')](_0x221676));_0x34cab3(_0x221676);})['catch'](function(_0x11dd38){logger[_0xf1ef('0x15')]('ShowUser',_0x11dd38[_0xf1ef('0x17')],_0x3259f);_0x2014fc(_0x3d11f0[_0xf1ef('0x15')](0x1f4,_0x11dd38['message']));});});};exports[_0xf1ef('0x26')]=function(_0x4168ef){var _0x130aa1=this;return new Promise(function(_0x2f296a,_0x166ca8){var _0x40e38f;return db[_0xf1ef('0x27')][_0xf1ef('0x23')]({'where':_0x4168ef['options'][_0xf1ef('0x25')]||{},'attributes':['id',_0xf1ef('0x28'),_0xf1ef('0x29'),'internal',_0xf1ef('0x2a')]})[_0xf1ef('0xf')](function(_0xe7c2c6){if(_0xe7c2c6){_0x40e38f=_0xe7c2c6;return db[_0xf1ef('0x2b')][_0xf1ef('0x2c')]({'paused':0x1},{'where':{'UserId':_0x40e38f['id']},'individualHooks':!![]});}})[_0xf1ef('0xf')](function(){if(_0x40e38f){return db[_0xf1ef('0x2d')][_0xf1ef('0x1b')]({'where':{'membername':_0x40e38f[_0xf1ef('0x28')],'type':_0xf1ef('0x2e'),'exitAt':null}});}})[_0xf1ef('0xf')](function(_0x3ab85f){if(_0x40e38f){if(_0x3ab85f&&_0x3ab85f[_0xf1ef('0x2f')]){var _0x54c6c7=moment()[_0xf1ef('0x30')](_0xf1ef('0x31'));for(var _0xe6d210=0x0,_0x42e05c=_0x3ab85f[_0xf1ef('0x2f')];_0xe6d210<_0x42e05c;_0xe6d210++){_0x3ab85f[_0xe6d210][_0xf1ef('0x32')]({'exitAt':_0x54c6c7});}}}})['then'](function(){if(_0x40e38f){var _0x21c01c=[];var _0x45130c=utils[_0xf1ef('0x33')]();_0x45130c[_0xf1ef('0x34')](function(_0x2c7069){_0x21c01c['push']({'channel':_0x2c7069,'membername':_0x40e38f[_0xf1ef('0x28')],'interface':_['isNil'](_0x40e38f[_0xf1ef('0x2a')])?util[_0xf1ef('0x30')](_0xf1ef('0x35'),_0x40e38f['name']):_0x40e38f[_0xf1ef('0x2a')],'type':_0xf1ef('0x2e'),'enterAt':moment()[_0xf1ef('0x30')](_0xf1ef('0x31')),'data1':_0x4168ef[_0xf1ef('0x36')][_0xf1ef('0x37')]||_0xf1ef('0x38'),'role':_0x40e38f[_0xf1ef('0x29')],'internal':_0x40e38f[_0xf1ef('0x39')],'uniqueid':_0x4168ef['body']['uniqueid']||null});});return db[_0xf1ef('0x2d')][_0xf1ef('0x3a')](_0x21c01c,{'individualHooks':!![]});}})[_0xf1ef('0xf')](function(){if(_0x40e38f){return _0x40e38f[_0xf1ef('0x2c')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x4168ef[_0xf1ef('0x36')][_0xf1ef('0x37')]||_0xf1ef('0x38'),'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});}})[_0xf1ef('0xf')](function(_0x2dd8ba){_0x2f296a(_0x2dd8ba);})[_0xf1ef('0x3b')](function(_0xd7f04f){_0x166ca8(_0x130aa1[_0xf1ef('0x15')](0x1f4,_0xd7f04f[_0xf1ef('0x17')]));});});};exports[_0xf1ef('0x3c')]=function(_0x114673){var _0x20da5c=this;return new Promise(function(_0x12611c,_0x302965){var _0x531a6f;return db[_0xf1ef('0x27')][_0xf1ef('0x3d')]({'where':_0x114673[_0xf1ef('0x1c')][_0xf1ef('0x25')]||{},'attributes':['id',_0xf1ef('0x28')]})[_0xf1ef('0xf')](function(_0x3fdd95){if(_0x3fdd95){_0x531a6f=_0x3fdd95;if(_0x114673[_0xf1ef('0x36')][_0xf1ef('0x3e')]&&!utils['isValidChannel'](_0x114673[_0xf1ef('0x36')][_0xf1ef('0x3e')])){throw new Error(_0xf1ef('0x3f'));}switch(_0x114673[_0xf1ef('0x36')][_0xf1ef('0x3e')]){case _0xf1ef('0x40'):return db[_0xf1ef('0x2b')][_0xf1ef('0x2c')]({'paused':0x0},{'where':{'UserId':_0x531a6f['id']}})['then'](function(){return db['MemberReport'][_0xf1ef('0x23')]({'where':{'channel':_0x114673[_0xf1ef('0x36')][_0xf1ef('0x3e')],'membername':_0x531a6f['name'],'type':_0xf1ef('0x2e'),'exitAt':null}});})['then'](function(_0x19a8c6){if(_0x19a8c6){return _0x19a8c6[_0xf1ef('0x2c')]({'exitAt':moment()[_0xf1ef('0x30')](_0xf1ef('0x31')),'data2':'system'},{'individualHooks':!![]});}return null;})['then'](function(){return _0x531a6f[_0xf1ef('0x2c')]({'voicePause':![]});});case'mail':case'chat':case'fax':case _0xf1ef('0x41'):case'openchannel':case _0xf1ef('0x42'):return db[_0xf1ef('0x2d')][_0xf1ef('0x23')]({'where':{'channel':_0x114673[_0xf1ef('0x36')][_0xf1ef('0x3e')],'membername':_0x531a6f['name'],'type':_0xf1ef('0x2e'),'exitAt':null}})[_0xf1ef('0xf')](function(_0x2664f1){return _0x2664f1['update']({'exitAt':moment()['format'](_0xf1ef('0x31')),'data2':_0xf1ef('0x43')},{'individualHooks':!![]});})[_0xf1ef('0xf')](function(){var _0x5c8305={};_[_0xf1ef('0x44')](_0x5c8305,util[_0xf1ef('0x30')](_0xf1ef('0x45'),_0x114673[_0xf1ef('0x36')]['channel'],_0xf1ef('0x46')),![]);return _0x531a6f[_0xf1ef('0x2c')](_0x5c8305);});default:return db[_0xf1ef('0x2b')][_0xf1ef('0x2c')]({'paused':0x0},{'where':{'UserId':_0x531a6f['id']}})[_0xf1ef('0xf')](function(){return db[_0xf1ef('0x2d')][_0xf1ef('0x1b')]({'where':{'membername':_0x531a6f[_0xf1ef('0x28')],'type':_0xf1ef('0x2e'),'exitAt':null}});})['then'](function(_0x4de56f){var _0x2aa3d1=[];_0x4de56f['forEach'](function(_0x27ca15){_0x2aa3d1[_0xf1ef('0x47')](_0x27ca15[_0xf1ef('0x2c')]({'exitAt':moment()['format'](_0xf1ef('0x31')),'data2':_0xf1ef('0x43')}));});return BPromise[_0xf1ef('0x48')](_0x2aa3d1);})['then'](function(){return _0x531a6f[_0xf1ef('0x2c')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0xf1ef('0xf')](function(_0x4a5877){_0x12611c(_0x4a5877);})[_0xf1ef('0x3b')](function(_0x25e526){_0x302965(_0x20da5c[_0xf1ef('0x15')](0x1f4,_0x25e526[_0xf1ef('0x17')]));});});};exports[_0xf1ef('0x49')]=function(_0xdc7be){var _0x7e13b6=this;return new Promise(function(_0x5cb690,_0x12ba91){var _0x4eca01;return db['User']['findOne']({'where':_0xdc7be['options']['where']||{},'attributes':['id','name']})[_0xf1ef('0xf')](function(_0x12d744){if(_0x12d744){_0x4eca01=_0x12d744;return db[_0xf1ef('0x2b')][_0xf1ef('0x4a')]({'where':{'membername':_0x4eca01[_0xf1ef('0x28')]},'individualHooks':!![]});}})['then'](function(){if(_0x4eca01){return db['MemberReport'][_0xf1ef('0x1b')]({'where':{'membername':_0x4eca01[_0xf1ef('0x28')],'exitAt':null}});}})[_0xf1ef('0xf')](function(_0x4bc47f){if(_0x4eca01){if(_0x4bc47f&&_0x4bc47f[_0xf1ef('0x2f')]){var _0x294661=[];_0x4bc47f[_0xf1ef('0x34')](function(_0x5a0f67){_0x294661[_0xf1ef('0x47')](_0x5a0f67[_0xf1ef('0x2c')]({'exitAt':moment()[_0xf1ef('0x30')](_0xf1ef('0x31'))}));});return BPromise[_0xf1ef('0x48')](_0x294661);}}})['then'](function(){if(_0x4eca01){return _0x4eca01[_0xf1ef('0x2c')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xf1ef('0xf')](function(_0x17ee41){_0x5cb690(_0x17ee41);})[_0xf1ef('0x3b')](function(_0x55147b){_0x12ba91(_0x7e13b6['error'](0x1f4,_0x55147b[_0xf1ef('0x17')]));});});};exports['LoginUser']=function(_0xd77ed6){var _0x253a60=this;return new Promise(function(_0x48573e,_0x24fc57){var _0x4d3f5f;var _0x55a9f3;var _0x26a56a;var _0x3059d4;return db[_0xf1ef('0x27')][_0xf1ef('0x3d')]({'where':_0xd77ed6[_0xf1ef('0x1c')]['where']||{},'attributes':['id',_0xf1ef('0x28'),'role','mobile',_0xf1ef('0x4b'),_0xf1ef('0x39'),_0xf1ef('0x4c'),'interface']})[_0xf1ef('0xf')](function(_0x546b5f){if(_0x546b5f){_0x4d3f5f=_0x546b5f;_0x3059d4=_0xd77ed6['body'][_0xf1ef('0x2a')]?_0xd77ed6[_0xf1ef('0x36')][_0xf1ef('0x2a')]:util[_0xf1ef('0x30')](_0xf1ef('0x35'),_0x4d3f5f[_0xf1ef('0x28')]);return db[_0xf1ef('0x27')][_0xf1ef('0x4d')]({'where':{'role':_0xf1ef('0x4e'),'online':!![],'id':{'$ne':_0x4d3f5f['id']}}});}})['then'](function(_0x48aced){if(_0x48aced){_0x26a56a=_0x48aced;return require('../../config/license/util')[_0xf1ef('0x4f')]();}})[_0xf1ef('0xf')](function(_0xa7ebb9){if(_0xa7ebb9&&_0xa7ebb9[_0xf1ef('0x50')]&&_0x26a56a>=_0xa7ebb9['agents']){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})['then'](function(){if(_0x4d3f5f){return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0x4d3f5f[_0xf1ef('0x28')]},'individualHooks':!![]});}})['then'](function(){if(_0x4d3f5f){return _0x4d3f5f[_0xf1ef('0x51')]({'raw':!![]});}})['then'](function(_0x52e759){if(_0x4d3f5f){if(_0x52e759){var _0x1ff922=[];_0x55a9f3=_0x52e759;if(_0x55a9f3['length']){for(var _0x404d21=0x0;_0x404d21<_0x55a9f3[_0xf1ef('0x2f')];_0x404d21++){_0x1ff922[_0xf1ef('0x47')](db[_0xf1ef('0x2b')][_0xf1ef('0x52')]({'membername':_0x4d3f5f['name'],'UserId':_0x4d3f5f['id'],'queue_name':_0x55a9f3[_0x404d21]['name'],'VoiceQueueId':_0x55a9f3[_0x404d21]['id'],'interface':_0x3059d4,'paused':_0x4d3f5f[_0xf1ef('0x4c')]||![],'penalty':_0x55a9f3[_0x404d21]['UserVoiceQueue.penalty']||0x0}));}return BPromise['all'](_0x1ff922);}}}})['then'](function(){if(_0x4d3f5f){return db['MemberReport']['findAll']({'where':{'membername':_0x4d3f5f[_0xf1ef('0x28')],'exitAt':null}});}})[_0xf1ef('0xf')](function(_0x2d7fe7){if(_0x4d3f5f){if(_0x2d7fe7&&_0x2d7fe7[_0xf1ef('0x2f')]){var _0x4d720f=[];_0x2d7fe7[_0xf1ef('0x34')](function(_0x38fa3e){_0x4d720f['push'](_0x38fa3e[_0xf1ef('0x2c')]({'exitAt':moment()[_0xf1ef('0x30')](_0xf1ef('0x31'))}));});return BPromise[_0xf1ef('0x48')](_0x4d720f);}}})[_0xf1ef('0xf')](function(_0x3345b1){if(_0x4d3f5f){var _0x1cdedc=[];var _0x368b92=[];var _0x2deca3=utils[_0xf1ef('0x33')]();var _0x49ade5={'membername':_0x4d3f5f[_0xf1ef('0x28')],'interface':_0x3059d4,'enterAt':moment()[_0xf1ef('0x30')](_0xf1ef('0x31')),'role':_0x4d3f5f[_0xf1ef('0x29')],'internal':_0x4d3f5f[_0xf1ef('0x39')]};_0x2deca3[_0xf1ef('0x34')](function(_0x12b11c){_0x1cdedc[_0xf1ef('0x47')](_[_0xf1ef('0x53')]({'channel':_0x12b11c,'type':'LOGIN','data1':'callysquare','data2':_0x3059d4},_0x49ade5));if(_0x4d3f5f['loginInPause']){_0x368b92[_0xf1ef('0x47')](_[_0xf1ef('0x53')]({'channel':_0x12b11c,'type':'PAUSE','data1':_0xf1ef('0x54')},_0x49ade5));}});return db[_0xf1ef('0x2d')][_0xf1ef('0x3a')](_0x1cdedc['concat'](_0x368b92),{'individualHooks':!![]});}})[_0xf1ef('0xf')](function(){if(_0x4d3f5f){return _0x4d3f5f[_0xf1ef('0x2c')]({'online':!![],'lastLoginAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x4d3f5f[_0xf1ef('0x4c')]||![],'mailPause':_0x4d3f5f['loginInPause']||![],'chatPause':_0x4d3f5f[_0xf1ef('0x4c')]||![],'faxPause':_0x4d3f5f[_0xf1ef('0x4c')]||![],'smsPause':_0x4d3f5f['loginInPause']||![],'openchannelPause':_0x4d3f5f[_0xf1ef('0x4c')]||![],'pauseType':_0x4d3f5f['loginInPause']?_0xf1ef('0x54'):null,'lastPauseAt':moment()[_0xf1ef('0x30')](_0xf1ef('0x31')),'interface':_0x3059d4});}})['then'](function(_0x57c4d7){_0x48573e(_0x57c4d7);})[_0xf1ef('0x3b')](function(_0x351d80){_0x24fc57(_0x253a60['error'](0x1f4,_0x351d80['message']));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 4df591f..a9d76f5 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 _0x163b=['emit','length','save','update'];(function(_0x211632,_0x378e2e){var _0x5a1da1=function(_0x44aff2){while(--_0x44aff2){_0x211632['push'](_0x211632['shift']());}};_0x5a1da1(++_0x378e2e);}(_0x163b,0x136));var _0xb163=function(_0x1edc53,_0x4c096c){_0x1edc53=_0x1edc53-0x0;var _0x4cfe99=_0x163b[_0x1edc53];return _0x4cfe99;};'use strict';var UserEvents=require('./user.events');var events=[_0xb163('0x0'),'remove',_0xb163('0x1')];function createListener(_0x5b00ef,_0x471b4a){return function(_0x5efe0b){_0x471b4a[_0xb163('0x2')](_0x5b00ef,_0x5efe0b);};}function removeListener(_0x3418b7,_0x37e161){return function(){UserEvents['removeListener'](_0x3418b7,_0x37e161);};}exports['register']=function(_0x4959bb){for(var _0x32cb1a=0x0,_0x1a5c8b=events[_0xb163('0x3')];_0x32cb1a<_0x1a5c8b;_0x32cb1a++){var _0x466046=events[_0x32cb1a];var _0x782446=createListener('user:'+_0x466046,_0x4959bb);UserEvents['on'](_0x466046,_0x782446);}}; \ No newline at end of file +var _0xe58a=['register','length','user:','./user.events','save','remove','update','emit','removeListener'];(function(_0x34126a,_0x389914){var _0x4c1ff9=function(_0x1daa9e){while(--_0x1daa9e){_0x34126a['push'](_0x34126a['shift']());}};_0x4c1ff9(++_0x389914);}(_0xe58a,0x17d));var _0xae58=function(_0xdc3ad9,_0x2e1613){_0xdc3ad9=_0xdc3ad9-0x0;var _0x3be308=_0xe58a[_0xdc3ad9];return _0x3be308;};'use strict';var UserEvents=require(_0xae58('0x0'));var events=[_0xae58('0x1'),_0xae58('0x2'),_0xae58('0x3')];function createListener(_0x52c4ad,_0x765939){return function(_0x49ee3f){_0x765939[_0xae58('0x4')](_0x52c4ad,_0x49ee3f);};}function removeListener(_0x551656,_0x1c077a){return function(){UserEvents[_0xae58('0x5')](_0x551656,_0x1c077a);};}exports[_0xae58('0x6')]=function(_0x5765de){for(var _0x3399ec=0x0,_0x232a34=events[_0xae58('0x7')];_0x3399ec<_0x232a34;_0x3399ec++){var _0x1c8605=events[_0x3399ec];var _0x5eaeab=createListener(_0xae58('0x8')+_0x1c8605,_0x5765de);UserEvents['on'](_0x1c8605,_0x5eaeab);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index cbb0d2a..c950884 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x2f4c65,_0x586cce){var _0x11b5c1=function(_0x2d904d){while(--_0x2d904d){_0x2f4c65['push'](_0x2f4c65['shift']());}};_0x11b5c1(++_0x586cce);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x3aaa88,_0x4196b0){var _0x41d7ec=function(_0xc5ff9a){while(--_0xc5ff9a){_0x3aaa88['push'](_0x3aaa88['shift']());}};_0x41d7ec(++_0x4196b0);}(_0x70e0,0x17b));var _0x070e=function(_0x1adc6e,_0x4b96ac){_0x1adc6e=_0x1adc6e-0x0;var _0x4e8541=_0x70e0[_0x1adc6e];return _0x4e8541;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 2b9cb0a..229b52c 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 _0xe5e0=['sequelize','exports','INTEGER'];(function(_0x4acd4c,_0x4fd04d){var _0x2d5582=function(_0x50aebe){while(--_0x50aebe){_0x4acd4c['push'](_0x4acd4c['shift']());}};_0x2d5582(++_0x4fd04d);}(_0xe5e0,0x123));var _0x0e5e=function(_0x2baf68,_0x103dcb){_0x2baf68=_0x2baf68-0x0;var _0xe67f70=_0xe5e0[_0x2baf68];return _0xe67f70;};'use strict';var Sequelize=require(_0x0e5e('0x0'));module[_0x0e5e('0x1')]={'penalty':{'type':Sequelize[_0x0e5e('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x5c34=['sequelize','exports','INTEGER'];(function(_0x589eab,_0xc40cd1){var _0xe66536=function(_0x389604){while(--_0x389604){_0x589eab['push'](_0x589eab['shift']());}};_0xe66536(++_0xc40cd1);}(_0x5c34,0x129));var _0x45c3=function(_0x151b12,_0x32ff51){_0x151b12=_0x151b12-0x0;var _0x51557e=_0x5c34[_0x151b12];return _0x51557e;};'use strict';var Sequelize=require(_0x45c3('0x0'));module[_0x45c3('0x1')]={'penalty':{'type':Sequelize[_0x45c3('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js index 7216610..90bf74e 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 _0xb7aa=['user_has_chat_queues','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','exports','define','UserChatQueue'];(function(_0x34c25f,_0x251723){var _0x69717c=function(_0x2ae2e6){while(--_0x2ae2e6){_0x34c25f['push'](_0x34c25f['shift']());}};_0x69717c(++_0x251723);}(_0xb7aa,0xf1));var _0xab7a=function(_0x10ad76,_0x4fc94a){_0x10ad76=_0x10ad76-0x0;var _0x1ced1a=_0xb7aa[_0x10ad76];return _0x1ced1a;};'use strict';var _=require(_0xab7a('0x0'));var util=require(_0xab7a('0x1'));var logger=require(_0xab7a('0x2'))(_0xab7a('0x3'));var moment=require(_0xab7a('0x4'));var BPromise=require(_0xab7a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xab7a('0x6'));var rimraf=require('rimraf');var config=require(_0xab7a('0x7'));var attributes=require('./userChatQueue.attributes');module[_0xab7a('0x8')]=function(_0x4b5487,_0x50b83e){return _0x4b5487[_0xab7a('0x9')](_0xab7a('0xa'),attributes,{'tableName':_0xab7a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4ddf=['../../config/environment','./userChatQueue.attributes','exports','UserChatQueue','user_has_chat_queues','lodash','moment','bluebird','request-promise','rimraf'];(function(_0x3acd53,_0x386518){var _0x185888=function(_0x2f71c5){while(--_0x2f71c5){_0x3acd53['push'](_0x3acd53['shift']());}};_0x185888(++_0x386518);}(_0x4ddf,0xa5));var _0xf4dd=function(_0x50e4f1,_0x46fe9a){_0x50e4f1=_0x50e4f1-0x0;var _0x4564b2=_0x4ddf[_0x50e4f1];return _0x4564b2;};'use strict';var _=require(_0xf4dd('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xf4dd('0x1'));var BPromise=require(_0xf4dd('0x2'));var rp=require(_0xf4dd('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf4dd('0x4'));var config=require(_0xf4dd('0x5'));var attributes=require(_0xf4dd('0x6'));module[_0xf4dd('0x7')]=function(_0x4300f7,_0x4455c8){return _0x4300f7['define'](_0xf4dd('0x8'),attributes,{'tableName':_0xf4dd('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.rpc.js b/server/api/userChatQueue/userChatQueue.rpc.js index 745462a..e2bd9dc 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 _0x6673=['info','result','lodash','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','request','then','UserChatQueue,\x20%s,\x20%s','request\x20sent','UserChatQueue,\x20%s,\x20%s,\x20%s','error','message'];(function(_0x11cbb5,_0x390441){var _0x54b8d3=function(_0x162ca2){while(--_0x162ca2){_0x11cbb5['push'](_0x11cbb5['shift']());}};_0x54b8d3(++_0x390441);}(_0x6673,0x1c4));var _0x3667=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x6673[_0x2d7f0e];return _0x110b07;};'use strict';var _=require(_0x3667('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3667('0x1'));var rs=require(_0x3667('0x2'));var fs=require('fs');var Redis=require(_0x3667('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3667('0x4'))(_0x3667('0x5'));var config=require(_0x3667('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3667('0x7')][_0x3667('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1a27f2,_0x5871e8,_0x2b2697){return new BPromise(function(_0x3aeb1a,_0x5d534e){return client[_0x3667('0x9')](_0x1a27f2,_0x2b2697)[_0x3667('0xa')](function(_0x4b620f){logger['info'](_0x3667('0xb'),_0x5871e8,_0x3667('0xc'));logger['debug'](_0x3667('0xd'),_0x5871e8,_0x3667('0xc'),JSON['stringify'](_0x4b620f));if(_0x4b620f[_0x3667('0xe')]){if(_0x4b620f[_0x3667('0xe')]['code']===0x1f4){logger['error'](_0x3667('0xb'),_0x5871e8,_0x4b620f[_0x3667('0xe')][_0x3667('0xf')]);return _0x5d534e(_0x4b620f[_0x3667('0xe')][_0x3667('0xf')]);}logger['error'](_0x3667('0xb'),_0x5871e8,_0x4b620f[_0x3667('0xe')]['message']);return _0x3aeb1a(_0x4b620f[_0x3667('0xe')][_0x3667('0xf')]);}else{logger[_0x3667('0x10')](_0x3667('0xb'),_0x5871e8,'request\x20sent');_0x3aeb1a(_0x4b620f[_0x3667('0x11')]['message']);}})['catch'](function(_0x12570d){logger[_0x3667('0xe')](_0x3667('0xb'),_0x5871e8,_0x12570d);_0x5d534e(_0x12570d);});});} \ No newline at end of file +var _0xf387=['request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserChatQueue,\x20%s,\x20%s','message','util','moment','randomstring','../../mysqldb','../../config/utils','client','http','request','info'];(function(_0x1825df,_0x32b6f0){var _0x524ca7=function(_0x5e4a61){while(--_0x5e4a61){_0x1825df['push'](_0x1825df['shift']());}};_0x524ca7(++_0x32b6f0);}(_0xf387,0x6e));var _0x7f38=function(_0x1fad27,_0x22308d){_0x1fad27=_0x1fad27-0x0;var _0x20c263=_0xf387[_0x1fad27];return _0x20c263;};'use strict';var _=require('lodash');var util=require(_0x7f38('0x0'));var moment=require(_0x7f38('0x1'));var BPromise=require('bluebird');var rs=require(_0x7f38('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7f38('0x3'))['db'];var utils=require(_0x7f38('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7f38('0x5')][_0x7f38('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x484ae0,_0xe12168,_0x18b918){return new BPromise(function(_0x478c8c,_0x3f221d){return client[_0x7f38('0x7')](_0x484ae0,_0x18b918)['then'](function(_0x391f17){logger[_0x7f38('0x8')]('UserChatQueue,\x20%s,\x20%s',_0xe12168,_0x7f38('0x9'));logger[_0x7f38('0xa')](_0x7f38('0xb'),_0xe12168,_0x7f38('0x9'),JSON[_0x7f38('0xc')](_0x391f17));if(_0x391f17['error']){if(_0x391f17[_0x7f38('0xd')][_0x7f38('0xe')]===0x1f4){logger[_0x7f38('0xd')](_0x7f38('0xf'),_0xe12168,_0x391f17['error'][_0x7f38('0x10')]);return _0x3f221d(_0x391f17['error'][_0x7f38('0x10')]);}logger['error'](_0x7f38('0xf'),_0xe12168,_0x391f17['error'][_0x7f38('0x10')]);return _0x478c8c(_0x391f17[_0x7f38('0xd')]['message']);}else{logger[_0x7f38('0x8')](_0x7f38('0xf'),_0xe12168,'request\x20sent');_0x478c8c(_0x391f17['result'][_0x7f38('0x10')]);}})['catch'](function(_0x1da562){logger[_0x7f38('0xd')](_0x7f38('0xf'),_0xe12168,_0x1da562);_0x3f221d(_0x1da562);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index d383db3..46edaca 100644 --- a/server/api/userFaxQueue/index.js +++ b/server/api/userFaxQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x1f9d1f,_0x19595b){var _0x8d6f77=function(_0x12ba31){while(--_0x12ba31){_0x1f9d1f['push'](_0x1f9d1f['shift']());}};_0x8d6f77(++_0x19595b);}(_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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x8f4cfa,_0x113aa0){var _0x324f00=function(_0x4e1f4c){while(--_0x4e1f4c){_0x8f4cfa['push'](_0x8f4cfa['shift']());}};_0x324f00(++_0x113aa0);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2f48cd,_0x46a75a){_0x2f48cd=_0x2f48cd-0x0;var _0x193ae2=_0xcb91[_0x2f48cd];return _0x193ae2;};'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 0581012..791d358 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 _0xeeee=['STRING','sequelize','INTEGER'];(function(_0x5ef55a,_0x2a03b1){var _0x20ae40=function(_0x46ce81){while(--_0x46ce81){_0x5ef55a['push'](_0x5ef55a['shift']());}};_0x20ae40(++_0x2a03b1);}(_0xeeee,0x190));var _0xeeee=function(_0x439649,_0x146aa5){_0x439649=_0x439649-0x0;var _0xdabc09=_0xeeee[_0x439649];return _0xdabc09;};'use strict';var Sequelize=require(_0xeeee('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xeeee('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xeeee('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xeeee('0x2')]}}; \ No newline at end of file +var _0xf9fb=['STRING','exports','INTEGER'];(function(_0x1bd5b1,_0x59fb72){var _0x631508=function(_0x52d852){while(--_0x52d852){_0x1bd5b1['push'](_0x1bd5b1['shift']());}};_0x631508(++_0x59fb72);}(_0xf9fb,0x133));var _0xbf9f=function(_0x3a39cd,_0x4e95e5){_0x3a39cd=_0x3a39cd-0x0;var _0x3e10a6=_0xf9fb[_0x3a39cd];return _0x3e10a6;};'use strict';var Sequelize=require('sequelize');module[_0xbf9f('0x0')]={'penalty':{'type':Sequelize[_0xbf9f('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize[_0xbf9f('0x2')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index a2365c0..486c00e 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 _0xb0af=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./userFaxQueue.attributes','exports','UserFaxQueue','user_has_fax_queues','lodash'];(function(_0x4ed520,_0x21be63){var _0x4415a6=function(_0x14b151){while(--_0x14b151){_0x4ed520['push'](_0x4ed520['shift']());}};_0x4415a6(++_0x21be63);}(_0xb0af,0xc2));var _0xfb0a=function(_0x657ba0,_0x793539){_0x657ba0=_0x657ba0-0x0;var _0x141b6e=_0xb0af[_0x657ba0];return _0x141b6e;};'use strict';var _=require(_0xfb0a('0x0'));var util=require(_0xfb0a('0x1'));var logger=require(_0xfb0a('0x2'))(_0xfb0a('0x3'));var moment=require(_0xfb0a('0x4'));var BPromise=require(_0xfb0a('0x5'));var rp=require(_0xfb0a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfb0a('0x7'));var config=require(_0xfb0a('0x8'));var attributes=require(_0xfb0a('0x9'));module[_0xfb0a('0xa')]=function(_0x2ebe23,_0x41c75e){return _0x2ebe23['define'](_0xfb0a('0xb'),attributes,{'tableName':_0xfb0a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf409=['rimraf','../../config/environment','./userFaxQueue.attributes','exports','define','UserFaxQueue','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x1b934,_0x5adf7b){var _0x3ee0df=function(_0x3495a4){while(--_0x3495a4){_0x1b934['push'](_0x1b934['shift']());}};_0x3ee0df(++_0x5adf7b);}(_0xf409,0x1e2));var _0x9f40=function(_0x13ce0c,_0x3f2a0d){_0x13ce0c=_0x13ce0c-0x0;var _0x4388fb=_0xf409[_0x13ce0c];return _0x4388fb;};'use strict';var _=require(_0x9f40('0x0'));var util=require(_0x9f40('0x1'));var logger=require(_0x9f40('0x2'))(_0x9f40('0x3'));var moment=require(_0x9f40('0x4'));var BPromise=require(_0x9f40('0x5'));var rp=require(_0x9f40('0x6'));var fs=require('fs');var path=require(_0x9f40('0x7'));var rimraf=require(_0x9f40('0x8'));var config=require(_0x9f40('0x9'));var attributes=require(_0x9f40('0xa'));module[_0x9f40('0xb')]=function(_0x538ceb,_0x4f5d47){return _0x538ceb[_0x9f40('0xc')](_0x9f40('0xd'),attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.rpc.js b/server/api/userFaxQueue/userFaxQueue.rpc.js index bfcdc24..fe4dec0 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 _0x9795=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','UserFaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x68918f,_0x530067){var _0x3b8f6b=function(_0x59045c){while(--_0x59045c){_0x68918f['push'](_0x68918f['shift']());}};_0x3b8f6b(++_0x530067);}(_0x9795,0x1e8));var _0x5979=function(_0x31bc26,_0xd78fcd){_0x31bc26=_0x31bc26-0x0;var _0x27b72c=_0x9795[_0x31bc26];return _0x27b72c;};'use strict';var _=require(_0x5979('0x0'));var util=require(_0x5979('0x1'));var moment=require(_0x5979('0x2'));var BPromise=require(_0x5979('0x3'));var rs=require(_0x5979('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5979('0x5'))['db'];var utils=require(_0x5979('0x6'));var logger=require(_0x5979('0x7'))(_0x5979('0x8'));var config=require('../../config/environment');var jayson=require(_0x5979('0x9'));var client=jayson['client'][_0x5979('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x49d560,_0x4dfe6c,_0x33369e){return new BPromise(function(_0x101807,_0x40e29b){return client[_0x5979('0xb')](_0x49d560,_0x33369e)[_0x5979('0xc')](function(_0x207ea5){logger[_0x5979('0xd')](_0x5979('0xe'),_0x4dfe6c,'request\x20sent');logger['debug'](_0x5979('0xf'),_0x4dfe6c,_0x5979('0x10'),JSON['stringify'](_0x207ea5));if(_0x207ea5[_0x5979('0x11')]){if(_0x207ea5['error'][_0x5979('0x12')]===0x1f4){logger[_0x5979('0x11')](_0x5979('0xe'),_0x4dfe6c,_0x207ea5[_0x5979('0x11')][_0x5979('0x13')]);return _0x40e29b(_0x207ea5[_0x5979('0x11')][_0x5979('0x13')]);}logger[_0x5979('0x11')](_0x5979('0xe'),_0x4dfe6c,_0x207ea5[_0x5979('0x11')]['message']);return _0x101807(_0x207ea5[_0x5979('0x11')][_0x5979('0x13')]);}else{logger[_0x5979('0xd')](_0x5979('0xe'),_0x4dfe6c,_0x5979('0x10'));_0x101807(_0x207ea5[_0x5979('0x14')][_0x5979('0x13')]);}})[_0x5979('0x15')](function(_0x336d07){logger[_0x5979('0x11')]('UserFaxQueue,\x20%s,\x20%s',_0x4dfe6c,_0x336d07);_0x40e29b(_0x336d07);});});} \ No newline at end of file +var _0xc1b9=['http','then','info','request\x20sent','stringify','error','code','message','UserFaxQueue,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client'];(function(_0x592750,_0x10d485){var _0x5bdeae=function(_0x2a3dd9){while(--_0x2a3dd9){_0x592750['push'](_0x592750['shift']());}};_0x5bdeae(++_0x10d485);}(_0xc1b9,0x107));var _0x9c1b=function(_0x225f50,_0x48a77d){_0x225f50=_0x225f50-0x0;var _0x19d003=_0xc1b9[_0x225f50];return _0x19d003;};'use strict';var _=require(_0x9c1b('0x0'));var util=require(_0x9c1b('0x1'));var moment=require(_0x9c1b('0x2'));var BPromise=require(_0x9c1b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9c1b('0x4'));var db=require(_0x9c1b('0x5'))['db'];var utils=require(_0x9c1b('0x6'));var logger=require(_0x9c1b('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9c1b('0x8'));var client=jayson[_0x9c1b('0x9')][_0x9c1b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xed901,_0x181d9e,_0x54ffad){return new BPromise(function(_0x1f1778,_0xacd9c){return client['request'](_0xed901,_0x54ffad)[_0x9c1b('0xb')](function(_0x35221d){logger[_0x9c1b('0xc')]('UserFaxQueue,\x20%s,\x20%s',_0x181d9e,'request\x20sent');logger['debug']('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x181d9e,_0x9c1b('0xd'),JSON[_0x9c1b('0xe')](_0x35221d));if(_0x35221d[_0x9c1b('0xf')]){if(_0x35221d[_0x9c1b('0xf')][_0x9c1b('0x10')]===0x1f4){logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x181d9e,_0x35221d[_0x9c1b('0xf')][_0x9c1b('0x11')]);return _0xacd9c(_0x35221d[_0x9c1b('0xf')][_0x9c1b('0x11')]);}logger[_0x9c1b('0xf')](_0x9c1b('0x12'),_0x181d9e,_0x35221d[_0x9c1b('0xf')][_0x9c1b('0x11')]);return _0x1f1778(_0x35221d[_0x9c1b('0xf')][_0x9c1b('0x11')]);}else{logger[_0x9c1b('0xc')](_0x9c1b('0x12'),_0x181d9e,_0x9c1b('0xd'));_0x1f1778(_0x35221d[_0x9c1b('0x13')][_0x9c1b('0x11')]);}})[_0x9c1b('0x14')](function(_0x2d97da){logger[_0x9c1b('0xf')](_0x9c1b('0x12'),_0x181d9e,_0x2d97da);_0xacd9c(_0x2d97da);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 4852839..54e3c19 100644 --- a/server/api/userMailQueue/index.js +++ b/server/api/userMailQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x5290ac,_0xeb37c6){var _0x9346ae=function(_0x37a945){while(--_0x37a945){_0x5290ac['push'](_0x5290ac['shift']());}};_0x9346ae(++_0xeb37c6);}(_0xe706,0xa3));var _0x6e70=function(_0x536755,_0x3bfa50){_0x536755=_0x536755-0x0;var _0x2b9dde=_0xe706[_0x536755];return _0x2b9dde;};'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(_0x5ae177,_0x1c168c){var _0x156788=function(_0x29e16e){while(--_0x29e16e){_0x5ae177['push'](_0x5ae177['shift']());}};_0x156788(++_0x1c168c);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1b64dd,_0x2cf769){_0x1b64dd=_0x1b64dd-0x0;var _0xeb464c=_0xcb91[_0x1b64dd];return _0xeb464c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 22e2f21..673da43 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 _0xcb57=['exports','sequelize'];(function(_0x4c3a36,_0xdba60f){var _0x40f945=function(_0x4efdb2){while(--_0x4efdb2){_0x4c3a36['push'](_0x4c3a36['shift']());}};_0x40f945(++_0xdba60f);}(_0xcb57,0xa1));var _0x7cb5=function(_0x1da527,_0x2dc953){_0x1da527=_0x1da527-0x0;var _0x40fc7c=_0xcb57[_0x1da527];return _0x40fc7c;};'use strict';var Sequelize=require(_0x7cb5('0x0'));module[_0x7cb5('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x3c4b=['INTEGER','sequelize','exports'];(function(_0x5a77e9,_0x5d387a){var _0x4b3923=function(_0x4e372d){while(--_0x4e372d){_0x5a77e9['push'](_0x5a77e9['shift']());}};_0x4b3923(++_0x5d387a);}(_0x3c4b,0x151));var _0xb3c4=function(_0x2128d0,_0x389071){_0x2128d0=_0x2128d0-0x0;var _0x5eb53e=_0x3c4b[_0x2128d0];return _0x5eb53e;};'use strict';var Sequelize=require(_0xb3c4('0x0'));module[_0xb3c4('0x1')]={'penalty':{'type':Sequelize[_0xb3c4('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 cfe1a8a..95b6c3d 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 _0x7dee=['lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./userMailQueue.attributes','exports','user_has_mail_queues'];(function(_0x5683b0,_0x4233ea){var _0x2757e8=function(_0x1ef768){while(--_0x1ef768){_0x5683b0['push'](_0x5683b0['shift']());}};_0x2757e8(++_0x4233ea);}(_0x7dee,0x118));var _0xe7de=function(_0x4023d9,_0x2986bb){_0x4023d9=_0x4023d9-0x0;var _0x526cb2=_0x7dee[_0x4023d9];return _0x526cb2;};'use strict';var _=require(_0xe7de('0x0'));var util=require(_0xe7de('0x1'));var logger=require(_0xe7de('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe7de('0x3'));var fs=require('fs');var path=require(_0xe7de('0x4'));var rimraf=require(_0xe7de('0x5'));var config=require(_0xe7de('0x6'));var attributes=require(_0xe7de('0x7'));module[_0xe7de('0x8')]=function(_0x3ca425,_0x45f11c){return _0x3ca425['define']('UserMailQueue',attributes,{'tableName':_0xe7de('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfa27=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue','lodash','util','../../config/logger','api'];(function(_0x58cacf,_0x1e8dc8){var _0x2f57f0=function(_0x40afc0){while(--_0x40afc0){_0x58cacf['push'](_0x58cacf['shift']());}};_0x2f57f0(++_0x1e8dc8);}(_0xfa27,0x1bc));var _0x7fa2=function(_0x317f96,_0x1e0613){_0x317f96=_0x317f96-0x0;var _0x302940=_0xfa27[_0x317f96];return _0x302940;};'use strict';var _=require(_0x7fa2('0x0'));var util=require(_0x7fa2('0x1'));var logger=require(_0x7fa2('0x2'))(_0x7fa2('0x3'));var moment=require(_0x7fa2('0x4'));var BPromise=require(_0x7fa2('0x5'));var rp=require(_0x7fa2('0x6'));var fs=require('fs');var path=require(_0x7fa2('0x7'));var rimraf=require(_0x7fa2('0x8'));var config=require(_0x7fa2('0x9'));var attributes=require(_0x7fa2('0xa'));module[_0x7fa2('0xb')]=function(_0x229a77,_0x2723aa){return _0x229a77[_0x7fa2('0xc')](_0x7fa2('0xd'),attributes,{'tableName':'user_has_mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.rpc.js b/server/api/userMailQueue/userMailQueue.rpc.js index 3bf42be..efc3cb6 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(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x008c,0x188));var _0xc008=function(_0x585199,_0x10d223){_0x585199=_0x585199-0x0;var _0x4f5eaf=_0x008c[_0x585199];return _0x4f5eaf;};'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 _0x7217=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserMailQueue,\x20%s,\x20%s','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0x7217,0x19e));var _0x7721=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0x7217[_0x521929];return _0x632436;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('UserMailQueue,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('UserMailQueue,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index 19f2a31..66335f9 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 _0x50e2=['../../config/environment','./userNotification.controller','post','isAuthenticated','sendUserNotification','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x2d79e9,_0xf787e1){var _0xd0befa=function(_0x26acb9){while(--_0x26acb9){_0x2d79e9['push'](_0x2d79e9['shift']());}};_0xd0befa(++_0xf787e1);}(_0x50e2,0x1d9));var _0x250e=function(_0x1e0d60,_0x503460){_0x1e0d60=_0x1e0d60-0x0;var _0x5b9564=_0x50e2[_0x1e0d60];return _0x5b9564;};'use strict';var multer=require(_0x250e('0x0'));var util=require(_0x250e('0x1'));var path=require('path');var timeout=require(_0x250e('0x2'));var express=require(_0x250e('0x3'));var router=express[_0x250e('0x4')]();var fs_extra=require(_0x250e('0x5'));var auth=require(_0x250e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x250e('0x7'));var controller=require(_0x250e('0x8'));router[_0x250e('0x9')]('/',auth[_0x250e('0xa')](),controller[_0x250e('0xb')]);module['exports']=router; \ No newline at end of file +var _0xe0da=['exports','multer','connect-timeout','express','Router','../../config/environment','./userNotification.controller','post','isAuthenticated','sendUserNotification'];(function(_0x2261ce,_0x9ed8b6){var _0x524640=function(_0x3cbb90){while(--_0x3cbb90){_0x2261ce['push'](_0x2261ce['shift']());}};_0x524640(++_0x9ed8b6);}(_0xe0da,0x14b));var _0xae0d=function(_0x3b29cf,_0x3f56f1){_0x3b29cf=_0x3b29cf-0x0;var _0xdfa8e7=_0xe0da[_0x3b29cf];return _0xdfa8e7;};'use strict';var multer=require(_0xae0d('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xae0d('0x1'));var express=require(_0xae0d('0x2'));var router=express[_0xae0d('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xae0d('0x4'));var controller=require(_0xae0d('0x5'));router[_0xae0d('0x6')]('/',auth[_0xae0d('0x7')](),controller[_0xae0d('0x8')]);module[_0xae0d('0x9')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 4b743c7..bcb0015 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 _0x3060=['exports','TEXT','STRING','BOOLEAN'];(function(_0x1943d2,_0x586cc8){var _0x3f4100=function(_0x4d0ead){while(--_0x4d0ead){_0x1943d2['push'](_0x1943d2['shift']());}};_0x3f4100(++_0x586cc8);}(_0x3060,0xfc));var _0x0306=function(_0x51a0a9,_0x569499){_0x51a0a9=_0x51a0a9-0x0;var _0x4bd20c=_0x3060[_0x51a0a9];return _0x4bd20c;};'use strict';var Sequelize=require('sequelize');module[_0x0306('0x0')]={'body':{'type':Sequelize[_0x0306('0x1')]},'senderName':{'type':Sequelize[_0x0306('0x2')]},'recipientsId':{'type':Sequelize[_0x0306('0x1')]},'recipientsDescription':{'type':Sequelize[_0x0306('0x2')]},'beep':{'type':Sequelize[_0x0306('0x3')]}}; \ No newline at end of file +var _0xf596=['exports','TEXT'];(function(_0x138af1,_0x3221bf){var _0x1bc73c=function(_0x13a0cc){while(--_0x13a0cc){_0x138af1['push'](_0x138af1['shift']());}};_0x1bc73c(++_0x3221bf);}(_0xf596,0x140));var _0x6f59=function(_0x120763,_0x398e01){_0x120763=_0x120763-0x0;var _0x2c9e32=_0xf596[_0x120763];return _0x2c9e32;};'use strict';var Sequelize=require('sequelize');module[_0x6f59('0x0')]={'body':{'type':Sequelize[_0x6f59('0x1')]},'senderName':{'type':Sequelize['STRING']},'recipientsId':{'type':Sequelize[_0x6f59('0x1')]},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize['BOOLEAN']}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index f5c0156..9815e91 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 _0xcf68=['includes','queue','replace','forEach','push','all','union','getAgents','rimraf','zip-dir','mustache','util','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','register','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','update','then','destroy','error','name','send','body','hasOwnProperty','text','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','TemplateId','view','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','voicequeue','team','user','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','recipientsId','sortBy','join','transaction','UserNotification','create','recipient','emit','userNotification:send','catch','Template','findOne','html','render','startCase','model','User','ids'];(function(_0x34560d,_0x65474c){var _0x69891=function(_0x4e7b09){while(--_0x4e7b09){_0x34560d['push'](_0x34560d['shift']());}};_0x69891(++_0x65474c);}(_0xcf68,0xc2));var _0x8cf6=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0xcf68[_0x4a747d];return _0x3a5b5c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8cf6('0x0'));var zipdir=require(_0x8cf6('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8cf6('0x2'));var util=require(_0x8cf6('0x3'));var path=require(_0x8cf6('0x4'));var sox=require('sox');var csv=require(_0x8cf6('0x5'));var ejs=require(_0x8cf6('0x6'));var fs=require('fs');var fs_extra=require(_0x8cf6('0x7'));var _=require('lodash');var squel=require(_0x8cf6('0x8'));var crypto=require('crypto');var jsforce=require(_0x8cf6('0x9'));var deskjs=require(_0x8cf6('0xa'));var toCsv=require(_0x8cf6('0x5'));var querystring=require('querystring');var Papa=require(_0x8cf6('0xb'));var Redis=require(_0x8cf6('0xc'));var authService=require(_0x8cf6('0xd'));var qs=require(_0x8cf6('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x8cf6('0xf'))(_0x8cf6('0x10'));var utils=require('../../config/utils');var config=require(_0x8cf6('0x11'));var licenseUtil=require(_0x8cf6('0x12'));var db=require('../../mysqldb')['db'];config[_0x8cf6('0x13')]=_[_0x8cf6('0x14')](config[_0x8cf6('0x13')],{'host':'localhost','port':0x18eb});var socket=require(_0x8cf6('0x15'))(new Redis(config[_0x8cf6('0x13')]));require('./userNotification.socket')[_0x8cf6('0x16')](socket);function respondWithStatusCode(_0xa780c2,_0x25c577){_0x25c577=_0x25c577||0xcc;return function(_0x23b8ad){if(_0x23b8ad){return _0xa780c2[_0x8cf6('0x17')](_0x25c577);}return _0xa780c2[_0x8cf6('0x18')](_0x25c577)[_0x8cf6('0x19')]();};}function respondWithResult(_0x58a996,_0x30e2b4){_0x30e2b4=_0x30e2b4||0xc8;return function(_0x32b6e2){if(_0x32b6e2){return _0x58a996[_0x8cf6('0x18')](_0x30e2b4)[_0x8cf6('0x1a')](_0x32b6e2);}};}function respondWithFilteredResult(_0x1ad598,_0x3de35f){return function(_0x228bce){if(_0x228bce){var _0x3f67d8=typeof _0x3de35f['offset']==='undefined'&&typeof _0x3de35f[_0x8cf6('0x1b')]===_0x8cf6('0x1c');var _0x1fbd0e=_0x228bce[_0x8cf6('0x1d')];var _0x2e5a2e=_0x3f67d8?0x0:_0x3de35f[_0x8cf6('0x1e')];var _0x4e5b8c=_0x3f67d8?_0x228bce[_0x8cf6('0x1d')]:_0x3de35f[_0x8cf6('0x1e')]+_0x3de35f[_0x8cf6('0x1b')];var _0x1ee6ac;if(_0x4e5b8c>=_0x1fbd0e){_0x4e5b8c=_0x1fbd0e;_0x1ee6ac=0xc8;}else{_0x1ee6ac=0xce;}_0x1ad598['status'](_0x1ee6ac);return _0x1ad598[_0x8cf6('0x1f')](_0x8cf6('0x20'),_0x2e5a2e+'-'+_0x4e5b8c+'/'+_0x1fbd0e)[_0x8cf6('0x1a')](_0x228bce);}return null;};}function patchUpdates(_0x5eb698){return function(_0x312bfa){try{jsonpatch[_0x8cf6('0x21')](_0x312bfa,_0x5eb698,!![]);}catch(_0x850a10){return BPromise['reject'](_0x850a10);}return _0x312bfa['save']();};}function saveUpdates(_0x3c2794,_0x2f3c84){return function(_0x5e8a98){if(_0x5e8a98){return _0x5e8a98[_0x8cf6('0x22')](_0x3c2794)[_0x8cf6('0x23')](function(_0x35bd71){return _0x35bd71;});}return null;};}function removeEntity(_0x5b7f15,_0x313367){return function(_0x249084){if(_0x249084){return _0x249084[_0x8cf6('0x24')]()['then'](function(){_0x5b7f15['status'](0xcc)[_0x8cf6('0x19')]();});}};}function handleEntityNotFound(_0x234ed7,_0x2eb058){return function(_0x385df9){if(!_0x385df9){_0x234ed7['sendStatus'](0x194);}return _0x385df9;};}function handleError(_0x5e0481,_0xad2e33){_0xad2e33=_0xad2e33||0x1f4;return function(_0x5976ff){logger[_0x8cf6('0x25')](_0x5976ff['stack']);if(_0x5976ff[_0x8cf6('0x26')]){delete _0x5976ff[_0x8cf6('0x26')];}_0x5e0481[_0x8cf6('0x18')](_0xad2e33)[_0x8cf6('0x27')](_0x5976ff);};}exports['sendUserNotification']=function(_0x27c46a,_0x29f80c,_0x150c52){if(!_0x27c46a[_0x8cf6('0x28')][_0x8cf6('0x29')](_0x8cf6('0x2a'))&&!_0x27c46a[_0x8cf6('0x28')][_0x8cf6('0x29')]('TemplateId')){throw new db[(_0x8cf6('0x2b'))][(_0x8cf6('0x2c'))](_0x8cf6('0x2d'));}else{if(_0x27c46a[_0x8cf6('0x28')][_0x8cf6('0x29')](_0x8cf6('0x2e'))&&!_0x27c46a[_0x8cf6('0x28')][_0x8cf6('0x29')](_0x8cf6('0x2f'))){throw new db[(_0x8cf6('0x2b'))][(_0x8cf6('0x2c'))](_0x8cf6('0x30'));}if(!_0x27c46a[_0x8cf6('0x28')][_0x8cf6('0x29')](_0x8cf6('0x31'))){throw new db[(_0x8cf6('0x2b'))]['ValidationError'](_0x8cf6('0x32'));}else{try{var _0x1ecf14=JSON[_0x8cf6('0x33')](_0x27c46a['body']['recipients']);}catch(_0x1f6556){logger[_0x8cf6('0x25')](_0x1f6556);throw new db[(_0x8cf6('0x2b'))][(_0x8cf6('0x2c'))](_0x8cf6('0x34'));}var _0xa05594=[_0x8cf6('0x35'),_0x8cf6('0x36'),_0x8cf6('0x37'),'openchannelqueue','smsqueue',_0x8cf6('0x38'),'whatsappqueue',_0x8cf6('0x39'),_0x8cf6('0x3a')];if(_['some'](_0x1ecf14,function(_0x227082){return!_['includes'](_0xa05594,_0x227082['model'][_0x8cf6('0x3b')]());})){throw new db[(_0x8cf6('0x2b'))][(_0x8cf6('0x2c'))](_0x8cf6('0x3c'));}}}var _0x163a20={};_0x163a20[_0x8cf6('0x3d')]=_0x27c46a[_0x8cf6('0x28')][_0x8cf6('0x29')](_0x8cf6('0x3d'))?_0x27c46a[_0x8cf6('0x28')][_0x8cf6('0x3d')]:_0x27c46a[_0x8cf6('0x3a')][_0x8cf6('0x3e')];_0x163a20[_0x8cf6('0x3f')]=_[_0x8cf6('0x40')](_0x27c46a[_0x8cf6('0x28')]['recipientsDescription'])?null:_0x27c46a[_0x8cf6('0x28')][_0x8cf6('0x3f')];_0x163a20[_0x8cf6('0x41')]=_0x27c46a['body'][_0x8cf6('0x41')]||![];_0x163a20[_0x8cf6('0x42')]=_0x27c46a[_0x8cf6('0x3a')]['id'];return getContent(_0x27c46a[_0x8cf6('0x28')])[_0x8cf6('0x23')](function(_0x4b9e6c){_0x163a20[_0x8cf6('0x28')]=_0x4b9e6c;return getRecipients(_0x1ecf14);})[_0x8cf6('0x23')](function(_0xe480e4){_0x163a20[_0x8cf6('0x43')]=_[_0x8cf6('0x44')](_0xe480e4)[_0x8cf6('0x45')](',');return db['sequelize'][_0x8cf6('0x46')](function(_0x4e76d7){return db[_0x8cf6('0x47')][_0x8cf6('0x48')](_0x163a20,{'raw':!![],'transaction':_0x4e76d7})[_0x8cf6('0x23')](function(_0x1ff58f){var _0x4a8f2b={'sender':_0x163a20[_0x8cf6('0x3d')],'description':_0x163a20['recipientsDescription'],'content':_0x163a20['body'],'beep':_0x163a20[_0x8cf6('0x41')]};_0xe480e4['forEach'](function(_0x25ce8e){_0x4a8f2b[_0x8cf6('0x49')]=_0x25ce8e;socket[_0x8cf6('0x4a')](_0x8cf6('0x4b'),_0x4a8f2b);});return _0x1ff58f;});});})[_0x8cf6('0x23')](respondWithResult(_0x29f80c,0xc9))[_0x8cf6('0x4c')](handleError(_0x29f80c,null));};function getContent(_0x2b4bde){return new BPromise(function(_0xaa0d6,_0x35572d){if(_0x2b4bde['text']){_0xaa0d6(_0x2b4bde[_0x8cf6('0x2a')]);return;}return db[_0x8cf6('0x4d')][_0x8cf6('0x4e')]({'attributes':[_0x8cf6('0x4f')],'where':{'id':_0x2b4bde[_0x8cf6('0x2e')]},'raw':!![]})[_0x8cf6('0x23')](function(_0x58dc59){if(!_0x58dc59)throw new db[(_0x8cf6('0x2b'))][(_0x8cf6('0x2c'))]('Invalid\x20\x27TemplateId\x27\x20parameter');var _0x2f2a24=Mustache[_0x8cf6('0x50')](_0x58dc59['html'],_0x2b4bde[_0x8cf6('0x2f')]);_0xaa0d6(_0x2f2a24);})[_0x8cf6('0x4c')](function(_0x2d9d23){_0x35572d(_0x2d9d23);});});}function getRecipients(_0x33d698){return new BPromise(function(_0xe034aa,_0x25e56e){var _0x9985d8=[];var _0x178690=[];_0x33d698['forEach'](function(_0x4c4d84){var _0x25a0a3=_[_0x8cf6('0x51')](_0x4c4d84[_0x8cf6('0x52')][_0x8cf6('0x3b')]());if(_0x25a0a3===_0x8cf6('0x53')){_0x9985d8=_['union'](_0x9985d8,_0x4c4d84[_0x8cf6('0x54')]);}else{if(_[_0x8cf6('0x55')](_0x25a0a3,_0x8cf6('0x56')))_0x25a0a3=_0x25a0a3[_0x8cf6('0x57')](_0x8cf6('0x56'),'Queue');_0x4c4d84[_0x8cf6('0x54')][_0x8cf6('0x58')](function(_0x6be1b7){_0x178690[_0x8cf6('0x59')](getAgents(_0x25a0a3,_0x6be1b7));});}});return BPromise[_0x8cf6('0x5a')](_0x178690)['then'](function(_0x4ac3fb){_0x9985d8=_[_0x8cf6('0x5b')](_0x9985d8,_['flatten'](_0x4ac3fb));_0xe034aa(_0x9985d8);})['catch'](function(_0x18c1ed){_0x25e56e(_0x18c1ed);});});}function getAgents(_0x4821cc,_0x5eed35){return new BPromise(function(_0x492d76,_0x5a6a29){return db[_0x4821cc]['findOne']({'where':{'id':_0x5eed35}})[_0x8cf6('0x23')](function(_0x5a9baf){return _0x5a9baf[_0x8cf6('0x5c')]({'attributes':['id'],'raw':!![]})['then'](function(_0x36f408){var _0xc36e5=_['map'](_0x36f408,'id');_0x492d76(_0xc36e5);});})[_0x8cf6('0x4c')](function(_0x462346){_0x5a6a29(_0x462346);});});} \ No newline at end of file +var _0x3c29=['union','ids','queue','replace','Queue','push','all','flatten','findOne','map','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./userNotification.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','stack','name','sendUserNotification','hasOwnProperty','text','body','TemplateId','Sequelize','ValidationError','view','Missing\x20\x27view\x27\x20parameter','recipients','error','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','team','user','some','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','isEmpty','beep','SenderId','then','recipientsId','sortBy','join','sequelize','transaction','UserNotification','recipientsDescription','forEach','emit','userNotification:send','Template','html','catch','startCase','User'];(function(_0x159917,_0x2d94b7){var _0x107724=function(_0x2ffbf1){while(--_0x2ffbf1){_0x159917['push'](_0x159917['shift']());}};_0x107724(++_0x2d94b7);}(_0x3c29,0x6e));var _0x93c2=function(_0x310101,_0x564f86){_0x310101=_0x310101-0x0;var _0xdb5f93=_0x3c29[_0x310101];return _0xdb5f93;};'use strict';var emlformat=require(_0x93c2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x93c2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x93c2('0x2'));var moment=require('moment');var BPromise=require(_0x93c2('0x3'));var Mustache=require(_0x93c2('0x4'));var util=require(_0x93c2('0x5'));var path=require(_0x93c2('0x6'));var sox=require('sox');var csv=require(_0x93c2('0x7'));var ejs=require(_0x93c2('0x8'));var fs=require('fs');var fs_extra=require(_0x93c2('0x9'));var _=require(_0x93c2('0xa'));var squel=require(_0x93c2('0xb'));var crypto=require(_0x93c2('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x93c2('0x7'));var querystring=require('querystring');var Papa=require(_0x93c2('0xd'));var Redis=require('ioredis');var authService=require(_0x93c2('0xe'));var qs=require(_0x93c2('0xf'));var as=require(_0x93c2('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x93c2('0x11'));var utils=require(_0x93c2('0x12'));var config=require(_0x93c2('0x13'));var licenseUtil=require(_0x93c2('0x14'));var db=require(_0x93c2('0x15'))['db'];config['redis']=_[_0x93c2('0x16')](config[_0x93c2('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x93c2('0x18'))(new Redis(config[_0x93c2('0x17')]));require(_0x93c2('0x19'))[_0x93c2('0x1a')](socket);function respondWithStatusCode(_0xfea317,_0x5c2916){_0x5c2916=_0x5c2916||0xcc;return function(_0x56703d){if(_0x56703d){return _0xfea317[_0x93c2('0x1b')](_0x5c2916);}return _0xfea317[_0x93c2('0x1c')](_0x5c2916)[_0x93c2('0x1d')]();};}function respondWithResult(_0x2dc961,_0x196c64){_0x196c64=_0x196c64||0xc8;return function(_0x53d6be){if(_0x53d6be){return _0x2dc961[_0x93c2('0x1c')](_0x196c64)[_0x93c2('0x1e')](_0x53d6be);}};}function respondWithFilteredResult(_0x17264f,_0x312d2c){return function(_0x4f8068){if(_0x4f8068){var _0x2cdcd3=typeof _0x312d2c[_0x93c2('0x1f')]===_0x93c2('0x20')&&typeof _0x312d2c[_0x93c2('0x21')]===_0x93c2('0x20');var _0x2eaded=_0x4f8068[_0x93c2('0x22')];var _0x564df1=_0x2cdcd3?0x0:_0x312d2c['offset'];var _0xc6285c=_0x2cdcd3?_0x4f8068[_0x93c2('0x22')]:_0x312d2c[_0x93c2('0x1f')]+_0x312d2c[_0x93c2('0x21')];var _0x1b0d03;if(_0xc6285c>=_0x2eaded){_0xc6285c=_0x2eaded;_0x1b0d03=0xc8;}else{_0x1b0d03=0xce;}_0x17264f[_0x93c2('0x1c')](_0x1b0d03);return _0x17264f[_0x93c2('0x23')](_0x93c2('0x24'),_0x564df1+'-'+_0xc6285c+'/'+_0x2eaded)[_0x93c2('0x1e')](_0x4f8068);}return null;};}function patchUpdates(_0x5890d4){return function(_0x4f9eb6){try{jsonpatch[_0x93c2('0x25')](_0x4f9eb6,_0x5890d4,!![]);}catch(_0x4346fb){return BPromise[_0x93c2('0x26')](_0x4346fb);}return _0x4f9eb6[_0x93c2('0x27')]();};}function saveUpdates(_0x2274da,_0x304762){return function(_0x3d2507){if(_0x3d2507){return _0x3d2507[_0x93c2('0x28')](_0x2274da)['then'](function(_0x1246b4){return _0x1246b4;});}return null;};}function removeEntity(_0x9fbe19,_0x2239d1){return function(_0x423f31){if(_0x423f31){return _0x423f31[_0x93c2('0x29')]()['then'](function(){_0x9fbe19[_0x93c2('0x1c')](0xcc)[_0x93c2('0x1d')]();});}};}function handleEntityNotFound(_0x572f31,_0x45114a){return function(_0x5bd197){if(!_0x5bd197){_0x572f31[_0x93c2('0x1b')](0x194);}return _0x5bd197;};}function handleError(_0x1560a7,_0x36b52f){_0x36b52f=_0x36b52f||0x1f4;return function(_0x4eff95){logger['error'](_0x4eff95[_0x93c2('0x2a')]);if(_0x4eff95[_0x93c2('0x2b')]){delete _0x4eff95[_0x93c2('0x2b')];}_0x1560a7[_0x93c2('0x1c')](_0x36b52f)['send'](_0x4eff95);};}exports[_0x93c2('0x2c')]=function(_0x53c07f,_0x5d1961,_0x313bdc){if(!_0x53c07f['body'][_0x93c2('0x2d')](_0x93c2('0x2e'))&&!_0x53c07f[_0x93c2('0x2f')][_0x93c2('0x2d')](_0x93c2('0x30'))){throw new db[(_0x93c2('0x31'))][(_0x93c2('0x32'))]('Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27');}else{if(_0x53c07f[_0x93c2('0x2f')][_0x93c2('0x2d')](_0x93c2('0x30'))&&!_0x53c07f[_0x93c2('0x2f')][_0x93c2('0x2d')](_0x93c2('0x33'))){throw new db['Sequelize'][(_0x93c2('0x32'))](_0x93c2('0x34'));}if(!_0x53c07f[_0x93c2('0x2f')][_0x93c2('0x2d')](_0x93c2('0x35'))){throw new db[(_0x93c2('0x31'))][(_0x93c2('0x32'))]('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0x252519=JSON['parse'](_0x53c07f['body']['recipients']);}catch(_0xc50167){logger[_0x93c2('0x36')](_0xc50167);throw new db[(_0x93c2('0x31'))]['ValidationError'](_0x93c2('0x37'));}var _0x57f6c6=[_0x93c2('0x38'),_0x93c2('0x39'),'mailqueue',_0x93c2('0x3a'),_0x93c2('0x3b'),_0x93c2('0x3c'),_0x93c2('0x3d'),_0x93c2('0x3e'),_0x93c2('0x3f')];if(_[_0x93c2('0x40')](_0x252519,function(_0x57a23d){return!_[_0x93c2('0x41')](_0x57f6c6,_0x57a23d[_0x93c2('0x42')][_0x93c2('0x43')]());})){throw new db[(_0x93c2('0x31'))]['ValidationError'](_0x93c2('0x44'));}}}var _0x6dc7a4={};_0x6dc7a4['senderName']=_0x53c07f[_0x93c2('0x2f')][_0x93c2('0x2d')](_0x93c2('0x45'))?_0x53c07f[_0x93c2('0x2f')][_0x93c2('0x45')]:_0x53c07f['user'][_0x93c2('0x46')];_0x6dc7a4['recipientsDescription']=_[_0x93c2('0x47')](_0x53c07f['body']['recipientsDescription'])?null:_0x53c07f['body']['recipientsDescription'];_0x6dc7a4[_0x93c2('0x48')]=_0x53c07f[_0x93c2('0x2f')][_0x93c2('0x48')]||![];_0x6dc7a4[_0x93c2('0x49')]=_0x53c07f[_0x93c2('0x3f')]['id'];return getContent(_0x53c07f[_0x93c2('0x2f')])[_0x93c2('0x4a')](function(_0x164cd7){_0x6dc7a4[_0x93c2('0x2f')]=_0x164cd7;return getRecipients(_0x252519);})[_0x93c2('0x4a')](function(_0x19524f){_0x6dc7a4[_0x93c2('0x4b')]=_[_0x93c2('0x4c')](_0x19524f)[_0x93c2('0x4d')](',');return db[_0x93c2('0x4e')][_0x93c2('0x4f')](function(_0x21d649){return db[_0x93c2('0x50')]['create'](_0x6dc7a4,{'raw':!![],'transaction':_0x21d649})[_0x93c2('0x4a')](function(_0xec8cd3){var _0x270c95={'sender':_0x6dc7a4['senderName'],'description':_0x6dc7a4[_0x93c2('0x51')],'content':_0x6dc7a4[_0x93c2('0x2f')],'beep':_0x6dc7a4[_0x93c2('0x48')]};_0x19524f[_0x93c2('0x52')](function(_0x290773){_0x270c95['recipient']=_0x290773;socket[_0x93c2('0x53')](_0x93c2('0x54'),_0x270c95);});return _0xec8cd3;});});})['then'](respondWithResult(_0x5d1961,0xc9))['catch'](handleError(_0x5d1961,null));};function getContent(_0x59735d){return new BPromise(function(_0x54a035,_0x3bcdb7){if(_0x59735d[_0x93c2('0x2e')]){_0x54a035(_0x59735d['text']);return;}return db[_0x93c2('0x55')]['findOne']({'attributes':[_0x93c2('0x56')],'where':{'id':_0x59735d[_0x93c2('0x30')]},'raw':!![]})['then'](function(_0x4baa8b){if(!_0x4baa8b)throw new db[(_0x93c2('0x31'))][(_0x93c2('0x32'))]('Invalid\x20\x27TemplateId\x27\x20parameter');var _0x40b346=Mustache['render'](_0x4baa8b[_0x93c2('0x56')],_0x59735d[_0x93c2('0x33')]);_0x54a035(_0x40b346);})[_0x93c2('0x57')](function(_0x422634){_0x3bcdb7(_0x422634);});});}function getRecipients(_0x28537d){return new BPromise(function(_0x1ba088,_0x2b8652){var _0x468a81=[];var _0x12564a=[];_0x28537d[_0x93c2('0x52')](function(_0x529ba6){var _0x16e5a0=_[_0x93c2('0x58')](_0x529ba6['model'][_0x93c2('0x43')]());if(_0x16e5a0===_0x93c2('0x59')){_0x468a81=_[_0x93c2('0x5a')](_0x468a81,_0x529ba6[_0x93c2('0x5b')]);}else{if(_['includes'](_0x16e5a0,_0x93c2('0x5c')))_0x16e5a0=_0x16e5a0[_0x93c2('0x5d')](_0x93c2('0x5c'),_0x93c2('0x5e'));_0x529ba6[_0x93c2('0x5b')]['forEach'](function(_0x6c5fdd){_0x12564a[_0x93c2('0x5f')](getAgents(_0x16e5a0,_0x6c5fdd));});}});return BPromise[_0x93c2('0x60')](_0x12564a)[_0x93c2('0x4a')](function(_0x15b02c){_0x468a81=_['union'](_0x468a81,_[_0x93c2('0x61')](_0x15b02c));_0x1ba088(_0x468a81);})[_0x93c2('0x57')](function(_0x2c9fb0){_0x2b8652(_0x2c9fb0);});});}function getAgents(_0x2ea9b2,_0x2e5e09){return new BPromise(function(_0xc43a66,_0x1a1302){return db[_0x2ea9b2][_0x93c2('0x62')]({'where':{'id':_0x2e5e09}})[_0x93c2('0x4a')](function(_0x31ae2a){return _0x31ae2a['getAgents']({'attributes':['id'],'raw':!![]})[_0x93c2('0x4a')](function(_0x3f35ba){var _0x40a3c0=_[_0x93c2('0x63')](_0x3f35ba,'id');_0xc43a66(_0x40a3c0);});})[_0x93c2('0x57')](function(_0x57fd20){_0x1a1302(_0x57fd20);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index aab4bc9..4d04181 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 _0xbaec=['events','../../mysqldb','UserNotification','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports'];(function(_0xadd417,_0x207028){var _0x5c79e7=function(_0xa07df0){while(--_0xa07df0){_0xadd417['push'](_0xadd417['shift']());}};_0x5c79e7(++_0x207028);}(_0xbaec,0x122));var _0xcbae=function(_0x24c135,_0xdb4450){_0x24c135=_0x24c135-0x0;var _0x290c66=_0xbaec[_0x24c135];return _0x290c66;};'use strict';var EventEmitter=require(_0xcbae('0x0'));var UserNotification=require(_0xcbae('0x1'))['db'][_0xcbae('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xcbae('0x3')](0x0);var events={'afterCreate':_0xcbae('0x4'),'afterUpdate':_0xcbae('0x5'),'afterDestroy':'remove'};function emitEvent(_0x33eddf){return function(_0x41c4b2,_0x115fc2,_0x5278fc){UserNotificationEvents['emit'](_0x33eddf+':'+_0x41c4b2['id'],_0x41c4b2);UserNotificationEvents[_0xcbae('0x6')](_0x33eddf,_0x41c4b2);_0x5278fc(null);};}for(var e in events){if(events[_0xcbae('0x7')](e)){var event=events[e];UserNotification[_0xcbae('0x8')](e,emitEvent(event));}}module[_0xcbae('0x9')]=UserNotificationEvents; \ No newline at end of file +var _0x1bff=['save','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x1bff,0x186));var _0xf1bf=function(_0x3c81b5,_0x3f5ed7){_0x3c81b5=_0x3c81b5-0x0;var _0x5888c4=_0x1bff[_0x3c81b5];return _0x5888c4;};'use strict';var EventEmitter=require(_0xf1bf('0x0'));var UserNotification=require(_0xf1bf('0x1'))['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf1bf('0x2'),'afterUpdate':'update','afterDestroy':_0xf1bf('0x3')};function emitEvent(_0x4e3582){return function(_0x2a47e4,_0x21af77,_0x2c888d){UserNotificationEvents[_0xf1bf('0x4')](_0x4e3582+':'+_0x2a47e4['id'],_0x2a47e4);UserNotificationEvents[_0xf1bf('0x4')](_0x4e3582,_0x2a47e4);_0x2c888d(null);};}for(var e in events){if(events[_0xf1bf('0x5')](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module[_0xf1bf('0x6')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 0243501..f9620fd 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 _0x131e=['request-promise','path','rimraf','./userNotification.attributes','exports','define','api','moment','bluebird'];(function(_0x30bf70,_0xa26b27){var _0x1cb57e=function(_0x3c1f62){while(--_0x3c1f62){_0x30bf70['push'](_0x30bf70['shift']());}};_0x1cb57e(++_0xa26b27);}(_0x131e,0x1ec));var _0xe131=function(_0xadc531,_0x3ea75a){_0xadc531=_0xadc531-0x0;var _0x5f06bc=_0x131e[_0xadc531];return _0x5f06bc;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xe131('0x0'));var moment=require(_0xe131('0x1'));var BPromise=require(_0xe131('0x2'));var rp=require(_0xe131('0x3'));var fs=require('fs');var path=require(_0xe131('0x4'));var rimraf=require(_0xe131('0x5'));var config=require('../../config/environment');var attributes=require(_0xe131('0x6'));module[_0xe131('0x7')]=function(_0x2de969,_0x1eb0df){return _0x2de969[_0xe131('0x8')]('UserNotification',attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x3fcf=['UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userNotification.attributes','exports','define'];(function(_0x1095ee,_0x33d632){var _0x3bb2fe=function(_0x267e8f){while(--_0x267e8f){_0x1095ee['push'](_0x1095ee['shift']());}};_0x3bb2fe(++_0x33d632);}(_0x3fcf,0x84));var _0xf3fc=function(_0x29b46b,_0x3396d6){_0x29b46b=_0x29b46b-0x0;var _0x1e88d4=_0x3fcf[_0x29b46b];return _0x1e88d4;};'use strict';var _=require('lodash');var util=require(_0xf3fc('0x0'));var logger=require(_0xf3fc('0x1'))(_0xf3fc('0x2'));var moment=require(_0xf3fc('0x3'));var BPromise=require(_0xf3fc('0x4'));var rp=require(_0xf3fc('0x5'));var fs=require('fs');var path=require(_0xf3fc('0x6'));var rimraf=require(_0xf3fc('0x7'));var config=require(_0xf3fc('0x8'));var attributes=require(_0xf3fc('0x9'));module[_0xf3fc('0xa')]=function(_0x4819dc,_0x3a6648){return _0x4819dc[_0xf3fc('0xb')](_0xf3fc('0xc'),attributes,{'tableName':_0xf3fc('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf3fc('0xe'),'collate':_0xf3fc('0xf')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index e9631e6..df33222 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 _0x1a64=['socket.io-emitter','./userNotification.socket','register','request','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','redis','defaults','localhost'];(function(_0x1064bc,_0x206f12){var _0x5edc45=function(_0x5087bd){while(--_0x5087bd){_0x1064bc['push'](_0x1064bc['shift']());}};_0x5edc45(++_0x206f12);}(_0x1a64,0x1df));var _0x41a6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1a64[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x41a6('0x0'));var util=require(_0x41a6('0x1'));var moment=require(_0x41a6('0x2'));var BPromise=require(_0x41a6('0x3'));var rs=require(_0x41a6('0x4'));var fs=require('fs');var Redis=require(_0x41a6('0x5'));var db=require(_0x41a6('0x6'))['db'];var utils=require(_0x41a6('0x7'));var logger=require(_0x41a6('0x8'))(_0x41a6('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x41a6('0xa')]({'port':0x232a});config[_0x41a6('0xb')]=_[_0x41a6('0xc')](config[_0x41a6('0xb')],{'host':_0x41a6('0xd'),'port':0x18eb});var socket=require(_0x41a6('0xe'))(new Redis(config[_0x41a6('0xb')]));require(_0x41a6('0xf'))[_0x41a6('0x10')](socket);function respondWithRpcPromise(_0x293a6e,_0x5bc5f6,_0x59d2d7){return new BPromise(function(_0x2617b2,_0x7a1fbb){return client[_0x41a6('0x11')](_0x293a6e,_0x59d2d7)['then'](function(_0x32716e){logger['info'](_0x41a6('0x12'),_0x5bc5f6,_0x41a6('0x13'));logger[_0x41a6('0x14')](_0x41a6('0x15'),_0x5bc5f6,_0x41a6('0x13'),JSON[_0x41a6('0x16')](_0x32716e));if(_0x32716e[_0x41a6('0x17')]){if(_0x32716e[_0x41a6('0x17')][_0x41a6('0x18')]===0x1f4){logger[_0x41a6('0x17')]('UserNotification,\x20%s,\x20%s',_0x5bc5f6,_0x32716e[_0x41a6('0x17')][_0x41a6('0x19')]);return _0x7a1fbb(_0x32716e[_0x41a6('0x17')]['message']);}logger['error']('UserNotification,\x20%s,\x20%s',_0x5bc5f6,_0x32716e[_0x41a6('0x17')][_0x41a6('0x19')]);return _0x2617b2(_0x32716e['error'][_0x41a6('0x19')]);}else{logger[_0x41a6('0x1a')](_0x41a6('0x12'),_0x5bc5f6,_0x41a6('0x13'));_0x2617b2(_0x32716e[_0x41a6('0x1b')][_0x41a6('0x19')]);}})[_0x41a6('0x1c')](function(_0x2a2464){logger[_0x41a6('0x17')](_0x41a6('0x12'),_0x5bc5f6,_0x2a2464);_0x7a1fbb(_0x2a2464);});});} \ No newline at end of file +var _0x2522=['register','request','then','info','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./userNotification.socket'];(function(_0x388c32,_0x471012){var _0xbd7321=function(_0x54c89e){while(--_0x54c89e){_0x388c32['push'](_0x388c32['shift']());}};_0xbd7321(++_0x471012);}(_0x2522,0x8a));var _0x2252=function(_0x1123b7,_0x30915f){_0x1123b7=_0x1123b7-0x0;var _0x3b4a64=_0x2522[_0x1123b7];return _0x3b4a64;};'use strict';var _=require(_0x2252('0x0'));var util=require(_0x2252('0x1'));var moment=require('moment');var BPromise=require(_0x2252('0x2'));var rs=require(_0x2252('0x3'));var fs=require('fs');var Redis=require(_0x2252('0x4'));var db=require(_0x2252('0x5'))['db'];var utils=require(_0x2252('0x6'));var logger=require(_0x2252('0x7'))(_0x2252('0x8'));var config=require(_0x2252('0x9'));var jayson=require(_0x2252('0xa'));var client=jayson[_0x2252('0xb')]['http']({'port':0x232a});config['redis']=_[_0x2252('0xc')](config[_0x2252('0xd')],{'host':_0x2252('0xe'),'port':0x18eb});var socket=require(_0x2252('0xf'))(new Redis(config[_0x2252('0xd')]));require(_0x2252('0x10'))[_0x2252('0x11')](socket);function respondWithRpcPromise(_0x158f42,_0xee27bb,_0x525018){return new BPromise(function(_0x2a7e82,_0x39b20a){return client[_0x2252('0x12')](_0x158f42,_0x525018)[_0x2252('0x13')](function(_0x2e5288){logger[_0x2252('0x14')](_0x2252('0x15'),_0xee27bb,_0x2252('0x16'));logger[_0x2252('0x17')](_0x2252('0x18'),_0xee27bb,_0x2252('0x16'),JSON[_0x2252('0x19')](_0x2e5288));if(_0x2e5288[_0x2252('0x1a')]){if(_0x2e5288[_0x2252('0x1a')][_0x2252('0x1b')]===0x1f4){logger[_0x2252('0x1a')](_0x2252('0x15'),_0xee27bb,_0x2e5288[_0x2252('0x1a')]['message']);return _0x39b20a(_0x2e5288[_0x2252('0x1a')]['message']);}logger['error']('UserNotification,\x20%s,\x20%s',_0xee27bb,_0x2e5288[_0x2252('0x1a')]['message']);return _0x2a7e82(_0x2e5288[_0x2252('0x1a')][_0x2252('0x1c')]);}else{logger[_0x2252('0x14')]('UserNotification,\x20%s,\x20%s',_0xee27bb,'request\x20sent');_0x2a7e82(_0x2e5288[_0x2252('0x1d')][_0x2252('0x1c')]);}})[_0x2252('0x1e')](function(_0x58e360){logger['error'](_0x2252('0x15'),_0xee27bb,_0x58e360);_0x39b20a(_0x58e360);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index f946644..8eca2e1 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 _0x5c9c=['save','remove','emit','removeListener','register','length','userNotification:','./userNotification.events'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x5c9c,0x1e7));var _0xc5c9=function(_0x34cb0c,_0x151c10){_0x34cb0c=_0x34cb0c-0x0;var _0x35a815=_0x5c9c[_0x34cb0c];return _0x35a815;};'use strict';var UserNotificationEvents=require(_0xc5c9('0x0'));var events=[_0xc5c9('0x1'),_0xc5c9('0x2'),'update'];function createListener(_0x4c23e1,_0x1778a0){return function(_0x253d1c){_0x1778a0[_0xc5c9('0x3')](_0x4c23e1,_0x253d1c);};}function removeListener(_0x3f7049,_0x35a832){return function(){UserNotificationEvents[_0xc5c9('0x4')](_0x3f7049,_0x35a832);};}exports[_0xc5c9('0x5')]=function(_0x2c6e1b){for(var _0x5a8280=0x0,_0x48b98c=events[_0xc5c9('0x6')];_0x5a8280<_0x48b98c;_0x5a8280++){var _0x557d70=events[_0x5a8280];var _0x41ea88=createListener(_0xc5c9('0x7')+_0x557d70,_0x2c6e1b);UserNotificationEvents['on'](_0x557d70,_0x41ea88);}}; \ No newline at end of file +var _0x1a10=['remove','emit','removeListener','length','userNotification:','./userNotification.events'];(function(_0x59bd2f,_0x2758f3){var _0x353d59=function(_0x591259){while(--_0x591259){_0x59bd2f['push'](_0x59bd2f['shift']());}};_0x353d59(++_0x2758f3);}(_0x1a10,0x11f));var _0x01a1=function(_0x2d1e52,_0x3f4ee2){_0x2d1e52=_0x2d1e52-0x0;var _0x55be10=_0x1a10[_0x2d1e52];return _0x55be10;};'use strict';var UserNotificationEvents=require(_0x01a1('0x0'));var events=['save',_0x01a1('0x1'),'update'];function createListener(_0x2d6ec1,_0x2af9d0){return function(_0x4c9e8a){_0x2af9d0[_0x01a1('0x2')](_0x2d6ec1,_0x4c9e8a);};}function removeListener(_0xe87c51,_0x168d15){return function(){UserNotificationEvents[_0x01a1('0x3')](_0xe87c51,_0x168d15);};}exports['register']=function(_0xd460cb){for(var _0x42dd19=0x0,_0x10cd99=events[_0x01a1('0x4')];_0x42dd19<_0x10cd99;_0x42dd19++){var _0x34fe3f=events[_0x42dd19];var _0x3470b3=createListener(_0x01a1('0x5')+_0x34fe3f,_0xd460cb);UserNotificationEvents['on'](_0x34fe3f,_0x3470b3);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 33bf04e..522a6d9 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x35ebae,_0x4f86c4){var _0x1924cf=function(_0x5788fe){while(--_0x5788fe){_0x35ebae['push'](_0x35ebae['shift']());}};_0x1924cf(++_0x4f86c4);}(_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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x1846a5,_0x83090c){var _0x42d6f4=function(_0x13af02){while(--_0x13af02){_0x1846a5['push'](_0x1846a5['shift']());}};_0x42d6f4(++_0x83090c);}(_0x70e0,0x17b));var _0x070e=function(_0x3f7a93,_0x5eb792){_0x3f7a93=_0x3f7a93-0x0;var _0x23d74e=_0x70e0[_0x3f7a93];return _0x23d74e;};'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/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 158cabb..f9c2c2d 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 _0x90ae=['INTEGER','sequelize'];(function(_0x149378,_0x35d644){var _0x3e4df6=function(_0x4363e8){while(--_0x4363e8){_0x149378['push'](_0x149378['shift']());}};_0x3e4df6(++_0x35d644);}(_0x90ae,0x13f));var _0xe90a=function(_0x3872e1,_0x129f95){_0x3872e1=_0x3872e1-0x0;var _0x434ba8=_0x90ae[_0x3872e1];return _0x434ba8;};'use strict';var Sequelize=require(_0xe90a('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xe90a('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xbe2a=['exports','INTEGER','sequelize'];(function(_0x4427a5,_0xb6e274){var _0x13e75a=function(_0x5150c0){while(--_0x5150c0){_0x4427a5['push'](_0x4427a5['shift']());}};_0x13e75a(++_0xb6e274);}(_0xbe2a,0x1d9));var _0xabe2=function(_0x1ec64b,_0x29880c){_0x1ec64b=_0x1ec64b-0x0;var _0x33cc55=_0xbe2a[_0x1ec64b];return _0x33cc55;};'use strict';var Sequelize=require(_0xabe2('0x0'));module[_0xabe2('0x1')]={'penalty':{'type':Sequelize[_0xabe2('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index 5285c52..549f90b 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 _0xf353=['define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','api','bluebird','request-promise','path','../../config/environment','./userOpenchannelQueue.attributes','exports'];(function(_0x32f376,_0x2c8523){var _0x55ba12=function(_0x271438){while(--_0x271438){_0x32f376['push'](_0x32f376['shift']());}};_0x55ba12(++_0x2c8523);}(_0xf353,0x183));var _0x3f35=function(_0x1bffb1,_0x33de07){_0x1bffb1=_0x1bffb1-0x0;var _0x14aace=_0xf353[_0x1bffb1];return _0x14aace;};'use strict';var _=require(_0x3f35('0x0'));var util=require(_0x3f35('0x1'));var logger=require('../../config/logger')(_0x3f35('0x2'));var moment=require('moment');var BPromise=require(_0x3f35('0x3'));var rp=require(_0x3f35('0x4'));var fs=require('fs');var path=require(_0x3f35('0x5'));var rimraf=require('rimraf');var config=require(_0x3f35('0x6'));var attributes=require(_0x3f35('0x7'));module[_0x3f35('0x8')]=function(_0x19ed15,_0x106251){return _0x19ed15[_0x3f35('0x9')](_0x3f35('0xa'),attributes,{'tableName':_0x3f35('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd4a0=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util'];(function(_0x22cad8,_0x348d20){var _0x5de04e=function(_0x4135fd){while(--_0x4135fd){_0x22cad8['push'](_0x22cad8['shift']());}};_0x5de04e(++_0x348d20);}(_0xd4a0,0x19e));var _0x0d4a=function(_0xeefd50,_0x32776f){_0xeefd50=_0xeefd50-0x0;var _0xbfd07=_0xd4a0[_0xeefd50];return _0xbfd07;};'use strict';var _=require(_0x0d4a('0x0'));var util=require(_0x0d4a('0x1'));var logger=require(_0x0d4a('0x2'))('api');var moment=require(_0x0d4a('0x3'));var BPromise=require(_0x0d4a('0x4'));var rp=require(_0x0d4a('0x5'));var fs=require('fs');var path=require(_0x0d4a('0x6'));var rimraf=require(_0x0d4a('0x7'));var config=require(_0x0d4a('0x8'));var attributes=require('./userOpenchannelQueue.attributes');module[_0x0d4a('0x9')]=function(_0x5e6a16,_0x5262f5){return _0x5e6a16[_0x0d4a('0xa')](_0x0d4a('0xb'),attributes,{'tableName':_0x0d4a('0xc'),'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 c82a151..5d4885d 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 _0x917e=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird'];(function(_0x528497,_0x147e87){var _0x392d59=function(_0x47d9ec){while(--_0x47d9ec){_0x528497['push'](_0x528497['shift']());}};_0x392d59(++_0x147e87);}(_0x917e,0xce));var _0xe917=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x917e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe917('0x0'));var util=require(_0xe917('0x1'));var moment=require(_0xe917('0x2'));var BPromise=require(_0xe917('0x3'));var rs=require(_0xe917('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe917('0x5'))['db'];var utils=require(_0xe917('0x6'));var logger=require(_0xe917('0x7'))(_0xe917('0x8'));var config=require(_0xe917('0x9'));var jayson=require(_0xe917('0xa'));var client=jayson[_0xe917('0xb')][_0xe917('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x6cef7c,_0x378df6,_0x135c84){return new BPromise(function(_0x33f221,_0x530ee2){return client['request'](_0x6cef7c,_0x135c84)['then'](function(_0x2c74d8){logger[_0xe917('0xd')](_0xe917('0xe'),_0x378df6,_0xe917('0xf'));logger['debug']('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x378df6,_0xe917('0xf'),JSON[_0xe917('0x10')](_0x2c74d8));if(_0x2c74d8[_0xe917('0x11')]){if(_0x2c74d8[_0xe917('0x11')][_0xe917('0x12')]===0x1f4){logger['error'](_0xe917('0xe'),_0x378df6,_0x2c74d8[_0xe917('0x11')][_0xe917('0x13')]);return _0x530ee2(_0x2c74d8['error'][_0xe917('0x13')]);}logger[_0xe917('0x11')](_0xe917('0xe'),_0x378df6,_0x2c74d8['error'][_0xe917('0x13')]);return _0x33f221(_0x2c74d8[_0xe917('0x11')][_0xe917('0x13')]);}else{logger[_0xe917('0xd')](_0xe917('0xe'),_0x378df6,_0xe917('0xf'));_0x33f221(_0x2c74d8[_0xe917('0x14')][_0xe917('0x13')]);}})['catch'](function(_0x3c6c74){logger['error'](_0xe917('0xe'),_0x378df6,_0x3c6c74);_0x530ee2(_0x3c6c74);});});} \ No newline at end of file +var _0x2c50=['client','http','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','moment','bluebird','ioredis','../../config/utils','../../config/environment','jayson/promise'];(function(_0x577e78,_0x5b4e98){var _0x276c16=function(_0xe15791){while(--_0xe15791){_0x577e78['push'](_0x577e78['shift']());}};_0x276c16(++_0x5b4e98);}(_0x2c50,0x77));var _0x02c5=function(_0xd7b0a4,_0x53c7d3){_0xd7b0a4=_0xd7b0a4-0x0;var _0x184e9e=_0x2c50[_0xd7b0a4];return _0x184e9e;};'use strict';var _=require('lodash');var util=require(_0x02c5('0x0'));var moment=require(_0x02c5('0x1'));var BPromise=require(_0x02c5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x02c5('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x02c5('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x02c5('0x5'));var jayson=require(_0x02c5('0x6'));var client=jayson[_0x02c5('0x7')][_0x02c5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x8f1295,_0x105a83,_0x31ca46){return new BPromise(function(_0x306a9c,_0x3b52c5){return client[_0x02c5('0x9')](_0x8f1295,_0x31ca46)[_0x02c5('0xa')](function(_0x4ed6ad){logger[_0x02c5('0xb')](_0x02c5('0xc'),_0x105a83,_0x02c5('0xd'));logger[_0x02c5('0xe')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x105a83,'request\x20sent',JSON[_0x02c5('0xf')](_0x4ed6ad));if(_0x4ed6ad[_0x02c5('0x10')]){if(_0x4ed6ad['error'][_0x02c5('0x11')]===0x1f4){logger[_0x02c5('0x10')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x105a83,_0x4ed6ad[_0x02c5('0x10')]['message']);return _0x3b52c5(_0x4ed6ad['error'][_0x02c5('0x12')]);}logger[_0x02c5('0x10')](_0x02c5('0xc'),_0x105a83,_0x4ed6ad[_0x02c5('0x10')][_0x02c5('0x12')]);return _0x306a9c(_0x4ed6ad['error'][_0x02c5('0x12')]);}else{logger['info'](_0x02c5('0xc'),_0x105a83,_0x02c5('0xd'));_0x306a9c(_0x4ed6ad[_0x02c5('0x13')]['message']);}})[_0x02c5('0x14')](function(_0x5c499e){logger[_0x02c5('0x10')](_0x02c5('0xc'),_0x105a83,_0x5c499e);_0x3b52c5(_0x5c499e);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index ccaf21e..c8257c4 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 _0x045f=['/:id','show','/:id/sections','getSections','/:id/resources','getResources','post','create','/:id/clone','clone','addResources','destroy','removeSections','delete','removeResources','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./userProfile.controller','get','isAuthenticated','/describe','describe'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x045f,0x1d2));var _0xf045=function(_0x4e1ef7,_0x349fa5){_0x4e1ef7=_0x4e1ef7-0x0;var _0x20f191=_0x045f[_0x4e1ef7];return _0x20f191;};'use strict';var multer=require(_0xf045('0x0'));var util=require(_0xf045('0x1'));var path=require(_0xf045('0x2'));var timeout=require(_0xf045('0x3'));var express=require(_0xf045('0x4'));var router=express[_0xf045('0x5')]();var fs_extra=require(_0xf045('0x6'));var auth=require(_0xf045('0x7'));var interaction=require(_0xf045('0x8'));var config=require('../../config/environment');var controller=require(_0xf045('0x9'));router[_0xf045('0xa')]('/',auth[_0xf045('0xb')](),controller['index']);router['get'](_0xf045('0xc'),auth[_0xf045('0xb')](),controller[_0xf045('0xd')]);router[_0xf045('0xa')](_0xf045('0xe'),auth[_0xf045('0xb')](),controller[_0xf045('0xf')]);router[_0xf045('0xa')](_0xf045('0x10'),auth['isAuthenticated'](),controller[_0xf045('0x11')]);router['get'](_0xf045('0x12'),auth[_0xf045('0xb')](),controller[_0xf045('0x13')]);router[_0xf045('0x14')]('/',auth[_0xf045('0xb')](),controller[_0xf045('0x15')]);router[_0xf045('0x14')](_0xf045('0x16'),auth[_0xf045('0xb')](),controller[_0xf045('0x17')]);router['post']('/:id/sections',auth[_0xf045('0xb')](),controller['addSections']);router[_0xf045('0x14')](_0xf045('0x12'),auth[_0xf045('0xb')](),controller[_0xf045('0x18')]);router['put'](_0xf045('0xe'),auth[_0xf045('0xb')](),controller['update']);router['delete']('/:id',auth[_0xf045('0xb')](),controller[_0xf045('0x19')]);router['delete'](_0xf045('0x10'),auth['isAuthenticated'](),controller[_0xf045('0x1a')]);router[_0xf045('0x1b')](_0xf045('0x12'),auth['isAuthenticated'](),controller[_0xf045('0x1c')]);module[_0xf045('0x1d')]=router; \ No newline at end of file +var _0x6910=['getSections','/:id/resources','/:id/clone','clone','post','addSections','addResources','put','/:id','update','delete','removeSections','removeResources','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','get','isAuthenticated','index','show','/:id/sections'];(function(_0x15a8f4,_0x176404){var _0x2eab90=function(_0x4f53db){while(--_0x4f53db){_0x15a8f4['push'](_0x15a8f4['shift']());}};_0x2eab90(++_0x176404);}(_0x6910,0xfd));var _0x0691=function(_0x48b00c,_0x16690b){_0x48b00c=_0x48b00c-0x0;var _0x55d181=_0x6910[_0x48b00c];return _0x55d181;};'use strict';var multer=require(_0x0691('0x0'));var util=require('util');var path=require(_0x0691('0x1'));var timeout=require(_0x0691('0x2'));var express=require(_0x0691('0x3'));var router=express['Router']();var fs_extra=require(_0x0691('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0691('0x5'));var config=require('../../config/environment');var controller=require('./userProfile.controller');router[_0x0691('0x6')]('/',auth[_0x0691('0x7')](),controller[_0x0691('0x8')]);router[_0x0691('0x6')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x0691('0x6')]('/:id',auth[_0x0691('0x7')](),controller[_0x0691('0x9')]);router[_0x0691('0x6')](_0x0691('0xa'),auth[_0x0691('0x7')](),controller[_0x0691('0xb')]);router[_0x0691('0x6')](_0x0691('0xc'),auth['isAuthenticated'](),controller['getResources']);router['post']('/',auth[_0x0691('0x7')](),controller['create']);router['post'](_0x0691('0xd'),auth[_0x0691('0x7')](),controller[_0x0691('0xe')]);router[_0x0691('0xf')](_0x0691('0xa'),auth['isAuthenticated'](),controller[_0x0691('0x10')]);router[_0x0691('0xf')](_0x0691('0xc'),auth[_0x0691('0x7')](),controller[_0x0691('0x11')]);router[_0x0691('0x12')](_0x0691('0x13'),auth[_0x0691('0x7')](),controller[_0x0691('0x14')]);router[_0x0691('0x15')]('/:id',auth[_0x0691('0x7')](),controller['destroy']);router['delete'](_0x0691('0xa'),auth[_0x0691('0x7')](),controller[_0x0691('0x16')]);router[_0x0691('0x15')](_0x0691('0xc'),auth[_0x0691('0x7')](),controller[_0x0691('0x17')]);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 9ef1ac7..217c688 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 _0x459d=['BOOLEAN','sequelize','exports','STRING','setDataValue','crudPermissions','join','getDataValue','split'];(function(_0x460877,_0xb97270){var _0x299be0=function(_0x321cca){while(--_0x321cca){_0x460877['push'](_0x460877['shift']());}};_0x299be0(++_0xb97270);}(_0x459d,0xfd));var _0xd459=function(_0xb5b44,_0x228f44){_0xb5b44=_0xb5b44-0x0;var _0x12c297=_0x459d[_0xb5b44];return _0x12c297;};'use strict';var Sequelize=require(_0xd459('0x0'));module[_0xd459('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0xd459('0x2')],'set':function(_0x2ba4ac){this[_0xd459('0x3')](_0xd459('0x4'),_0x2ba4ac?_0x2ba4ac[_0xd459('0x5')](''):[]);},'get':function(){return this[_0xd459('0x6')](_0xd459('0x4'))?this[_0xd459('0x6')](_0xd459('0x4'))[_0xd459('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xd459('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xd459('0x8')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xd459('0x8')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xd459('0x8')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xd459('0x8')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xd459('0x8')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xd459('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xd459('0x8')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0xb513=['sequelize','exports','STRING','crudPermissions','join','getDataValue','split','BOOLEAN'];(function(_0x52a6e3,_0x4a73b4){var _0x8910d0=function(_0x57e5ef){while(--_0x57e5ef){_0x52a6e3['push'](_0x52a6e3['shift']());}};_0x8910d0(++_0x4a73b4);}(_0xb513,0x118));var _0x3b51=function(_0x3d4ef1,_0x5a957c){_0x3d4ef1=_0x3d4ef1-0x0;var _0x409423=_0xb513[_0x3d4ef1];return _0x409423;};'use strict';var Sequelize=require(_0x3b51('0x0'));module[_0x3b51('0x1')]={'name':{'type':Sequelize[_0x3b51('0x2')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x4d1a6f){this['setDataValue'](_0x3b51('0x3'),_0x4d1a6f?_0x4d1a6f[_0x3b51('0x4')](''):[]);},'get':function(){return this[_0x3b51('0x5')](_0x3b51('0x3'))?this[_0x3b51('0x5')](_0x3b51('0x3'))[_0x3b51('0x6')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x3b51('0x7')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x3b51('0x7')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x3b51('0x7')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x3b51('0x7')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x3b51('0x7')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x3b51('0x7')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 2cdeb8e..636b00d 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 _0x94d4=['filters','intersection','query','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','include','catch','show','params','options','find','create','body','clone','get','createdAt','updatedAt','omit','transaction','includeAll','UserProfileSection','each','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','describe','addSections','sequelize','ids','includes','isEmpty','subsections','enabled','push','findOne','Dashboard','findAll','forEach','resourceId','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','defaults','redis','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','error','stack','name','index','map','UserProfile','rawAttributes','fieldName','type','model','keys'];(function(_0x1d5ccd,_0x1f7b5c){var _0x3130dc=function(_0x5b24a9){while(--_0x5b24a9){_0x1d5ccd['push'](_0x1d5ccd['shift']());}};_0x3130dc(++_0x1f7b5c);}(_0x94d4,0xa5));var _0x494d=function(_0x24a233,_0x5bcca4){_0x24a233=_0x24a233-0x0;var _0x4a577f=_0x94d4[_0x24a233];return _0x4a577f;};'use strict';var emlformat=require(_0x494d('0x0'));var rimraf=require(_0x494d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x494d('0x2'));var rp=require(_0x494d('0x3'));var moment=require(_0x494d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x494d('0x5'));var util=require(_0x494d('0x6'));var path=require(_0x494d('0x7'));var sox=require(_0x494d('0x8'));var csv=require(_0x494d('0x9'));var ejs=require(_0x494d('0xa'));var fs=require('fs');var fs_extra=require(_0x494d('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x494d('0xc'));var deskjs=require(_0x494d('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x494d('0xe'));var Redis=require(_0x494d('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x494d('0x10'));var as=require(_0x494d('0x11'));var hardwareService=require(_0x494d('0x12'));var logger=require(_0x494d('0x13'))('api');var utils=require(_0x494d('0x14'));var config=require(_0x494d('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0x494d('0x16')](config[_0x494d('0x17')],{'host':_0x494d('0x18'),'port':0x18eb});var socket=require(_0x494d('0x19'))(new Redis(config[_0x494d('0x17')]));require(_0x494d('0x1a'))[_0x494d('0x1b')](socket);function respondWithStatusCode(_0x1529ca,_0x2fe493){_0x2fe493=_0x2fe493||0xcc;return function(_0x441d77){if(_0x441d77){return _0x1529ca[_0x494d('0x1c')](_0x2fe493);}return _0x1529ca['status'](_0x2fe493)[_0x494d('0x1d')]();};}function respondWithResult(_0x215a65,_0x2a2917){_0x2a2917=_0x2a2917||0xc8;return function(_0x3012e3){if(_0x3012e3){return _0x215a65[_0x494d('0x1e')](_0x2a2917)[_0x494d('0x1f')](_0x3012e3);}};}function respondWithFilteredResult(_0x15c2d9,_0x43f41b){return function(_0x4301fc){if(_0x4301fc){var _0x1552bb=typeof _0x43f41b[_0x494d('0x20')]===_0x494d('0x21')&&typeof _0x43f41b[_0x494d('0x22')]===_0x494d('0x21');var _0x20dd3d=_0x4301fc[_0x494d('0x23')];var _0x134632=_0x1552bb?0x0:_0x43f41b['offset'];var _0x2be3b5=_0x1552bb?_0x4301fc[_0x494d('0x23')]:_0x43f41b[_0x494d('0x20')]+_0x43f41b[_0x494d('0x22')];var _0x4c2731;if(_0x2be3b5>=_0x20dd3d){_0x2be3b5=_0x20dd3d;_0x4c2731=0xc8;}else{_0x4c2731=0xce;}_0x15c2d9['status'](_0x4c2731);return _0x15c2d9[_0x494d('0x24')](_0x494d('0x25'),_0x134632+'-'+_0x2be3b5+'/'+_0x20dd3d)['json'](_0x4301fc);}return null;};}function patchUpdates(_0x5703f5){return function(_0x1b029b){try{jsonpatch['apply'](_0x1b029b,_0x5703f5,!![]);}catch(_0x1dec57){return BPromise['reject'](_0x1dec57);}return _0x1b029b[_0x494d('0x26')]();};}function saveUpdates(_0x29220e,_0x49120d){return function(_0x2fdb5b){if(_0x2fdb5b){return _0x2fdb5b[_0x494d('0x27')](_0x29220e)[_0x494d('0x28')](function(_0x2ab88b){return _0x2ab88b;});}return null;};}function removeEntity(_0x1120c9,_0x575f07){return function(_0x17d65a){if(_0x17d65a){return _0x17d65a[_0x494d('0x29')]()['then'](function(){_0x1120c9['status'](0xcc)[_0x494d('0x1d')]();});}};}function handleEntityNotFound(_0x43a3a5,_0x37253a){return function(_0x2c025d){if(!_0x2c025d){_0x43a3a5[_0x494d('0x1c')](0x194);}return _0x2c025d;};}function handleError(_0x3a181b,_0x1a2ccd){_0x1a2ccd=_0x1a2ccd||0x1f4;return function(_0x347c58){logger[_0x494d('0x2a')](_0x347c58[_0x494d('0x2b')]);if(_0x347c58[_0x494d('0x2c')]){delete _0x347c58[_0x494d('0x2c')];}_0x3a181b[_0x494d('0x1e')](_0x1a2ccd)['send'](_0x347c58);};}exports[_0x494d('0x2d')]=function(_0xa78384,_0x3606c9){var _0x18dfae={},_0x2636ce={},_0x25328a={'count':0x0,'rows':[]};var _0x29ccfd=_[_0x494d('0x2e')](db[_0x494d('0x2f')][_0x494d('0x30')],function(_0x4ceaf6){return{'name':_0x4ceaf6[_0x494d('0x31')],'type':_0x4ceaf6[_0x494d('0x32')]['key']};});_0x2636ce[_0x494d('0x33')]=_[_0x494d('0x2e')](_0x29ccfd,'name');_0x2636ce['query']=_[_0x494d('0x34')](_0xa78384['query']);_0x2636ce[_0x494d('0x35')]=_[_0x494d('0x36')](_0x2636ce[_0x494d('0x33')],_0x2636ce[_0x494d('0x37')]);_0x18dfae['attributes']=_['intersection'](_0x2636ce[_0x494d('0x33')],qs[_0x494d('0x38')](_0xa78384[_0x494d('0x37')]['fields']));_0x18dfae['attributes']=_0x18dfae[_0x494d('0x39')][_0x494d('0x3a')]?_0x18dfae['attributes']:_0x2636ce[_0x494d('0x33')];if(!_0xa78384[_0x494d('0x37')][_0x494d('0x3b')]('nolimit')){_0x18dfae['limit']=qs['limit'](_0xa78384[_0x494d('0x37')]['limit']);_0x18dfae['offset']=qs[_0x494d('0x20')](_0xa78384[_0x494d('0x37')][_0x494d('0x20')]);}_0x18dfae[_0x494d('0x3c')]=qs[_0x494d('0x3d')](_0xa78384['query'][_0x494d('0x3d')]);_0x18dfae[_0x494d('0x3e')]=qs[_0x494d('0x35')](_[_0x494d('0x3f')](_0xa78384[_0x494d('0x37')],_0x2636ce['filters']),_0x29ccfd);if(_0xa78384[_0x494d('0x37')][_0x494d('0x40')]){_0x18dfae['where']=_[_0x494d('0x41')](_0x18dfae[_0x494d('0x3e')],{'$or':_[_0x494d('0x2e')](_0x29ccfd,function(_0x4b89b1){if(_0x4b89b1[_0x494d('0x32')]!==_0x494d('0x42')){var _0x58eade={};_0x58eade[_0x4b89b1[_0x494d('0x2c')]]={'$like':'%'+_0xa78384[_0x494d('0x37')][_0x494d('0x40')]+'%'};return _0x58eade;}})});}_0x18dfae=_['merge']({},_0x18dfae,_0xa78384['options']);var _0x2e4454={'where':_0x18dfae['where']};return db[_0x494d('0x2f')][_0x494d('0x23')](_0x2e4454)[_0x494d('0x28')](function(_0x5ce269){_0x25328a[_0x494d('0x23')]=_0x5ce269;if(_0xa78384[_0x494d('0x37')]['includeAll']){_0x18dfae[_0x494d('0x43')]=[{'all':!![]}];}return db[_0x494d('0x2f')]['findAll'](_0x18dfae);})[_0x494d('0x28')](function(_0x410b46){_0x25328a['rows']=_0x410b46;return _0x25328a;})[_0x494d('0x28')](respondWithFilteredResult(_0x3606c9,_0x18dfae))[_0x494d('0x44')](handleError(_0x3606c9,null));};exports[_0x494d('0x45')]=function(_0x368d18,_0x5dddf2){var _0x20d92f={'raw':![],'where':{'id':_0x368d18[_0x494d('0x46')]['id']}},_0x22898f={};_0x22898f[_0x494d('0x33')]=_['keys'](db['UserProfile'][_0x494d('0x30')]);_0x22898f[_0x494d('0x37')]=_['keys'](_0x368d18[_0x494d('0x37')]);_0x22898f[_0x494d('0x35')]=_[_0x494d('0x36')](_0x22898f['model'],_0x22898f['query']);_0x20d92f[_0x494d('0x39')]=_[_0x494d('0x36')](_0x22898f[_0x494d('0x33')],qs[_0x494d('0x38')](_0x368d18[_0x494d('0x37')][_0x494d('0x38')]));_0x20d92f[_0x494d('0x39')]=_0x20d92f[_0x494d('0x39')][_0x494d('0x3a')]?_0x20d92f[_0x494d('0x39')]:_0x22898f[_0x494d('0x33')];if(_0x368d18[_0x494d('0x37')]['includeAll']){_0x20d92f[_0x494d('0x43')]=[{'all':!![]}];}_0x20d92f=_[_0x494d('0x41')]({},_0x20d92f,_0x368d18[_0x494d('0x47')]);return db[_0x494d('0x2f')][_0x494d('0x48')](_0x20d92f)[_0x494d('0x28')](handleEntityNotFound(_0x5dddf2,null))[_0x494d('0x28')](respondWithResult(_0x5dddf2,null))[_0x494d('0x44')](handleError(_0x5dddf2,null));};exports['create']=function(_0x20170d,_0x3149d1){return db[_0x494d('0x2f')][_0x494d('0x49')](_0x20170d[_0x494d('0x4a')],{})['then'](respondWithResult(_0x3149d1,0xc9))['catch'](handleError(_0x3149d1,null));};exports[_0x494d('0x4b')]=function(_0x57f392,_0x3d7bf3){var _0x44b2ea={'where':{'id':_0x57f392[_0x494d('0x46')]['id']}},_0x287209={};_0x287209['model']=_[_0x494d('0x34')](db[_0x494d('0x2f')]['rawAttributes']);_0x44b2ea[_0x494d('0x39')]=_[_0x494d('0x36')](_0x287209[_0x494d('0x33')],qs[_0x494d('0x38')](_0x57f392[_0x494d('0x37')][_0x494d('0x38')]));_0x44b2ea[_0x494d('0x39')]=_0x44b2ea[_0x494d('0x39')]['length']?_0x44b2ea['attributes']:_0x287209[_0x494d('0x33')];if(_0x57f392['query']['includeAll']){_0x44b2ea[_0x494d('0x43')]=[{'all':!![]}];}_0x44b2ea=_[_0x494d('0x41')]({},_0x44b2ea,_0x57f392[_0x494d('0x47')]);return db[_0x494d('0x2f')][_0x494d('0x48')](_0x44b2ea)[_0x494d('0x28')](handleEntityNotFound(_0x3d7bf3,null))['then'](function(_0xdd869e){if(_0xdd869e){var _0x215880=_0xdd869e[_0x494d('0x4c')]({'plain':!![]});_0x215880=qs['omit'](_0x215880,['id',_0x494d('0x4d'),_0x494d('0x4e'),'crudPermissions']);_0x57f392[_0x494d('0x4a')]=_[_0x494d('0x4f')](_0x57f392[_0x494d('0x4a')],['id',_0x494d('0x4d'),'updatedAt']);return db['sequelize'][_0x494d('0x50')](function(_0x37e7a5){return db[_0x494d('0x2f')][_0x494d('0x49')](_['merge'](_0x215880,_0x57f392[_0x494d('0x4a')]),{'include':_0x57f392[_0x494d('0x37')][_0x494d('0x51')]?[{'all':!![]}]:undefined,'transaction':_0x37e7a5})['then'](function(_0x421198){var _0x4a7b05=_0x421198[_0x494d('0x4c')]({'plain':!![]});return db[_0x494d('0x52')]['findAll']({'where':{'userProfileId':_0x57f392[_0x494d('0x46')]['id']},'raw':!![]})[_0x494d('0x28')](function(_0x429aaf){if(_0x429aaf){return BPromise[_0x494d('0x53')](_0x429aaf,function(_0x4ce59d){return new BPromise(function(_0x58e128,_0x3beb37){if(_0x4ce59d[_0x494d('0x54')]===null||_0x4ce59d[_0x494d('0x54')]===0x1)_0x58e128(null);return db[_0x494d('0x55')]['findAll']({'where':{'sectionId':_0x4ce59d['id']},'raw':!![]})[_0x494d('0x28')](function(_0x8304b5){var _0x3c9edf=_[_0x494d('0x2e')](_0x8304b5,function(_0x19e952){return qs[_0x494d('0x4f')](_0x19e952,['id',_0x494d('0x4d'),_0x494d('0x4e'),_0x494d('0x56')]);});_0x58e128(_0x3c9edf);})[_0x494d('0x44')](function(_0x459f56){_0x3beb37(_0x459f56);});})[_0x494d('0x28')](function(_0x285b2d){var _0x30f2a0=qs[_0x494d('0x4f')](_0x4ce59d,['id',_0x494d('0x4d'),'updatedAt']);_0x30f2a0[_0x494d('0x57')]=_0x4a7b05['id'];if(_0x285b2d)_0x30f2a0[_0x494d('0x58')]=_0x285b2d;return _0x30f2a0;})[_0x494d('0x28')](function(_0x1658c2){return db[_0x494d('0x52')]['create'](_0x1658c2,{'include':[{'model':db['UserProfileResource'],'as':_0x494d('0x58')}],'raw':!![],'transaction':_0x37e7a5});});})[_0x494d('0x28')](function(){return _0x4a7b05;});}});});});}})['then'](respondWithResult(_0x3d7bf3,0xc9))[_0x494d('0x44')](handleError(_0x3d7bf3,null));};exports['update']=function(_0x553fcf,_0x3ac507){if(_0x553fcf[_0x494d('0x4a')]['id']){delete _0x553fcf[_0x494d('0x4a')]['id'];}return db[_0x494d('0x2f')]['find']({'where':{'id':_0x553fcf['params']['id']}})['then'](handleEntityNotFound(_0x3ac507,null))['then'](saveUpdates(_0x553fcf[_0x494d('0x4a')],null))['then'](respondWithResult(_0x3ac507,null))[_0x494d('0x44')](handleError(_0x3ac507,null));};exports[_0x494d('0x29')]=function(_0x28b296,_0xc7ab69){return db[_0x494d('0x2f')]['find']({'where':{'id':_0x28b296[_0x494d('0x46')]['id']}})[_0x494d('0x28')](handleEntityNotFound(_0xc7ab69,null))[_0x494d('0x28')](removeEntity(_0xc7ab69,null))['catch'](handleError(_0xc7ab69,null));};exports[_0x494d('0x59')]=function(_0x526a0f,_0x253149){return db['UserProfile'][_0x494d('0x59')]()['then'](respondWithResult(_0x253149,null))[_0x494d('0x44')](handleError(_0x253149,null));};exports[_0x494d('0x5a')]=function(_0x2fb5b8,_0x41085c){var _0xdfa927=_0x2fb5b8[_0x494d('0x4a')];return db[_0x494d('0x2f')][_0x494d('0x48')]({'where':{'id':_0x2fb5b8['params']['id']}})['then'](handleEntityNotFound(_0x41085c,null))[_0x494d('0x28')](function(_0x17129e){if(_0x17129e){return db[_0x494d('0x5b')][_0x494d('0x50')](function(_0x198cb0){return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0x2fb5b8[_0x494d('0x46')]['id'],'sectionId':_['map'](_0xdfa927,function(_0x4da065){return _0x4da065['sectionId'];})},'transaction':_0x198cb0})[_0x494d('0x28')](function(){var _0x16acbc=_[_0x494d('0x2e')](_0xdfa927,function(_0x1fbd44){_0x1fbd44[_0x494d('0x57')]=_0x2fb5b8[_0x494d('0x46')]['id'];return _0x1fbd44;});var _0x119a06=[];return BPromise[_0x494d('0x53')](_0x16acbc,function(_0xc1c7a1){return db[_0x494d('0x52')][_0x494d('0x49')](_0xc1c7a1,{'include':[{'model':db[_0x494d('0x55')],'as':_0x494d('0x58')}],'raw':!![],'transaction':_0x198cb0})[_0x494d('0x28')](function(_0x3c890d){_0x119a06['push'](_0x3c890d[_0x494d('0x4c')]({'plain':!![]}));});})[_0x494d('0x28')](function(){return _0x119a06;});});});}})[_0x494d('0x28')](function(_0x509d6c){return _0x509d6c;})[_0x494d('0x28')](respondWithResult(_0x41085c,null))[_0x494d('0x44')](handleError(_0x41085c,null));};exports['removeSections']=function(_0x12437,_0x423852){var _0x1898c8;return db[_0x494d('0x2f')][_0x494d('0x48')]({'where':{'id':_0x12437[_0x494d('0x46')]['id']},'attributes':['id','name']})[_0x494d('0x28')](handleEntityNotFound(_0x423852,null))[_0x494d('0x28')](function(_0x2fa6fb){if(_0x2fa6fb){_0x1898c8=_0x2fa6fb;return db[_0x494d('0x52')]['destroy']({'where':{'userProfileId':_0x12437['params']['id'],'sectionId':_0x12437[_0x494d('0x37')][_0x494d('0x5c')]}});}})[_0x494d('0x28')](function(){return _0x1898c8;})[_0x494d('0x28')](respondWithStatusCode(_0x423852,null))[_0x494d('0x44')](handleError(_0x423852,null));};exports['getSections']=function(_0x46a1c0,_0x55e16b){var _0x2f71ec=[];var _0x1b0234=[];return db[_0x494d('0x52')]['findAll']({'where':{'userProfileId':_0x46a1c0[_0x494d('0x46')]['id']},'raw':!![]})[_0x494d('0x28')](function(_0x348e5e){_0x2f71ec=_['filter'](_0x348e5e,function(_0xebd321){return _0xebd321['enabled']===0x1||_[_0x494d('0x5d')]([0x3eb,0x709],_0xebd321['sectionId']);});if(!_[_0x494d('0x5e')](_0x2f71ec)){return _[_0x494d('0x2e')](_0x2f71ec,function(_0xf2ad4b){return _0xf2ad4b[_0x494d('0x56')];});}else{return;}})[_0x494d('0x28')](function(_0xb02d9e){if(_0xb02d9e)_0x1b0234=_0xb02d9e;if(_['includes'](_0x1b0234,0x64)){var _0xc95605=_[_0x494d('0x48')](_0x2f71ec,{'sectionId':0x64});return hasDefaultDashboard(_0xc95605)[_0x494d('0x28')](function(_0x31c1db){return _[_0x494d('0x2e')](_0x2f71ec,function(_0x49231f){if(_0x49231f[_0x494d('0x56')]===0x64){_0x49231f[_0x494d('0x5f')]=_0x31c1db;}return _0x49231f;});});}else{return;}})[_0x494d('0x28')](function(_0x358645){if(_0x358645)_0x2f71ec=_0x358645;if(_[_0x494d('0x5d')](_0x1b0234,0x3eb)){var _0xae8cfe=_[_0x494d('0x48')](_0x2f71ec,{'sectionId':0x3eb});return getCustomDashboards(_0xae8cfe)[_0x494d('0x28')](function(_0x12d588){return _[_0x494d('0x2e')](_0x2f71ec,function(_0x30b982){if(_0xae8cfe[_0x494d('0x60')]){if(_0x30b982[_0x494d('0x56')]===0x3eb){_0x30b982[_0x494d('0x5f')]=_0x12d588;}}else{if(_0x30b982[_0x494d('0x56')]===0x64){_0x30b982[_0x494d('0x5f')]=_0x12d588;}}return _0x30b982;});});}else{return;}})['then'](function(_0x4e7be5){if(_0x4e7be5)_0x2f71ec=_0x4e7be5;if(_[_0x494d('0x5d')](_0x1b0234,0x709)){var _0x4bb4ed=_[_0x494d('0x48')](_0x2f71ec,{'sectionId':0x709});return getPlugins(_0x4bb4ed)[_0x494d('0x28')](function(_0x50b979){if(_0x4bb4ed[_0x494d('0x60')]){return _['map'](_0x2f71ec,function(_0x3c8d25){if(_0x3c8d25[_0x494d('0x56')]===0x709){_0x3c8d25[_0x494d('0x5f')]=_0x50b979;}return _0x3c8d25;});}else{var _0x13872c={'sectionId':0x76c,'enabled':0x1,'subsections':_0x50b979};var _0x2abd98=_[_0x494d('0x2e')](_0x2f71ec);_0x2abd98[_0x494d('0x61')](_0x13872c);return _0x2abd98;}});}else{return;}})[_0x494d('0x28')](function(_0x454910){if(_0x454910)_0x2f71ec=_0x454910;return _['filter'](_0x2f71ec,['enabled',0x1]);})[_0x494d('0x28')](respondWithResult(_0x55e16b,null))[_0x494d('0x44')](handleError(_0x55e16b,null));};function hasDefaultDashboard(_0x577be6){var _0x3b47d5=[0x65];return new BPromise(function(_0x3ff3a3,_0x9961d8){try{if(_0x577be6[_0x494d('0x54')]){_0x3ff3a3(_0x3b47d5);}else{return db[_0x494d('0x55')][_0x494d('0x62')]({'where':{'sectionId':_0x577be6['id']},'raw':!![]})['then'](function(_0x217d4a){_0x217d4a?_0x3ff3a3(_0x3b47d5):_0x3ff3a3();});}}catch(_0x23a2a4){_0x9961d8(_0x23a2a4);}});}function getCustomDashboards(_0x216a91){var _0x33f6f0=[];return new BPromise(function(_0x147282,_0x29561b){try{if(_0x216a91['autoAssociation']){return db[_0x494d('0x63')][_0x494d('0x64')]({'raw':!![]})[_0x494d('0x28')](function(_0x24cda3){_0x24cda3[_0x494d('0x65')](function(_0x270994){_0x33f6f0['push'](_0x270994['id']+0x1869f);});_0x147282(_0x33f6f0);});}else{return db[_0x494d('0x55')][_0x494d('0x64')]({'where':{'sectionId':_0x216a91['id']},'raw':!![]})[_0x494d('0x28')](function(_0x3e5e42){_0x3e5e42[_0x494d('0x65')](function(_0x5cdefc){_0x33f6f0[_0x494d('0x61')](_0x5cdefc[_0x494d('0x66')]+0x1869f);});_0x147282(_0x33f6f0);});}}catch(_0x225298){_0x29561b(_0x225298);}});}function getPlugins(_0x3b9bcb){var _0x49e82e=[];return new BPromise(function(_0x3a21b8,_0x4d69a7){try{if(_0x3b9bcb[_0x494d('0x54')]){return db['Plugin']['findAll']({'raw':!![]})[_0x494d('0x28')](function(_0x484818){_0x484818[_0x494d('0x65')](function(_0x5eb6f6){_0x49e82e['push'](_0x5eb6f6['id']+0x15b38);});_0x3a21b8(_0x49e82e);});}else{return db[_0x494d('0x55')][_0x494d('0x64')]({'where':{'sectionId':_0x3b9bcb['id']},'raw':!![]})[_0x494d('0x28')](function(_0x1a8578){_0x1a8578[_0x494d('0x65')](function(_0x39b01d){_0x49e82e[_0x494d('0x61')](_0x39b01d['resourceId']+0x15b38);});_0x3a21b8(_0x49e82e);});}}catch(_0x514b2f){_0x4d69a7(_0x514b2f);}});}exports['addResources']=function(_0x1d11fb,_0x16cf49){return db[_0x494d('0x2f')][_0x494d('0x48')]({'where':{'id':_0x1d11fb[_0x494d('0x46')]['id']}})[_0x494d('0x28')](handleEntityNotFound(_0x16cf49,null))[_0x494d('0x28')](function(_0x3cb70e){if(_0x3cb70e){return db[_0x494d('0x5b')][_0x494d('0x50')](function(_0x19b1b0){return db[_0x494d('0x52')][_0x494d('0x64')]({'where':{'userProfileId':_0x1d11fb[_0x494d('0x46')]['id']},'attributes':['id'],'raw':!![]})[_0x494d('0x28')](function(_0x5c05aa){if(_0x5c05aa){return db['UserProfileSection'][_0x494d('0x29')]({'where':{'userProfileId':_0x1d11fb[_0x494d('0x46')]['id'],'id':_[_0x494d('0x2e')](_0x5c05aa,function(_0x179d7b){return _0x179d7b['id'];})},'transaction':_0x19b1b0});}})[_0x494d('0x28')](function(_0x44ac65){var _0x12a8dc=_[_0x494d('0x2e')](_0x1d11fb['body'],function(_0x2b3e8f){_0x2b3e8f['userProfileId']=_0x1d11fb[_0x494d('0x46')]['id'];return _0x2b3e8f;});return db[_0x494d('0x52')]['bulkCreate'](_0x12a8dc,{'raw':!![],'transaction':_0x19b1b0});})['then'](function(_0x37f457){var _0x405bbb=_[_0x494d('0x40')](_['map'](_0x37f457,function(_0x52d84f){return _0x52d84f['get']({'plain':!![]});}),{'includeAll':![]});if(_0x405bbb){return db[_0x494d('0x52')]['findAll']({'where':{'userProfileId':_0x1d11fb['params']['id'],'sectionId':_[_0x494d('0x2e')](_0x405bbb,function(_0x494214){return _0x494214[_0x494d('0x56')];})},'attributes':['id',_0x494d('0x56')],'raw':!![]})[_0x494d('0x28')](function(_0x54b907){var _0x323f95=_[_0x494d('0x2e')](_0x1d11fb[_0x494d('0x4a')],function(_0xc65657){_0xc65657[_0x494d('0x57')]=_0x1d11fb[_0x494d('0x46')]['id'];return _0xc65657;});return db['UserProfileResource'][_0x494d('0x67')](_0x323f95,{'raw':!![],'transaction':_0x19b1b0});});}})[_0x494d('0x44')](handleError(_0x16cf49,null));});}})[_0x494d('0x28')](function(_0x38d807){var _0x1bf142=_['map'](_0x38d807,function(_0x3aa0d9){return _0x3aa0d9[_0x494d('0x4c')]({'plain':!![]});});})[_0x494d('0x28')](respondWithResult(_0x16cf49,null))[_0x494d('0x44')](handleError(_0x16cf49,null));};exports[_0x494d('0x68')]=function(_0x1cfffc,_0xbb2a53,_0x859443){return db['UserProfile'][_0x494d('0x48')]({'where':{'id':_0x1cfffc['params']['id']}})[_0x494d('0x28')](handleEntityNotFound(_0xbb2a53,null))['then'](function(_0x5c5a1b){if(_0x5c5a1b){return _0x5c5a1b[_0x494d('0x68')](_0x1cfffc[_0x494d('0x37')][_0x494d('0x5c')]);}})[_0x494d('0x28')](respondWithStatusCode(_0xbb2a53,null))[_0x494d('0x44')](handleError(_0xbb2a53,null));};exports[_0x494d('0x69')]=function(_0x23a0b7,_0x4a628f){var _0xe2d013={};if(!_0x23a0b7['query'][_0x494d('0x6a')])throw new Error(_0x494d('0x6b'));if(!_0x23a0b7['query']['hasOwnProperty']('nolimit')){_0xe2d013[_0x494d('0x22')]=qs[_0x494d('0x22')](_0x23a0b7[_0x494d('0x37')][_0x494d('0x22')]);_0xe2d013[_0x494d('0x20')]=qs[_0x494d('0x20')](_0x23a0b7[_0x494d('0x37')][_0x494d('0x20')]);}return db[_0x494d('0x2f')][_0x494d('0x48')]({'where':{'id':_0x23a0b7[_0x494d('0x46')]['id']}})[_0x494d('0x28')](function(_0x1c6397){if(!_0x1c6397)throw new Error(_0x494d('0x6c')+_0x23a0b7['params']['id']);return db[_0x494d('0x2f')]['getResources'](_0x23a0b7);})[_0x494d('0x28')](respondWithFilteredResult(_0x4a628f,_0xe2d013))[_0x494d('0x44')](handleError(_0x4a628f,null));}; \ No newline at end of file +var _0xd05a=['path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','name','index','map','UserProfile','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','rows','catch','show','params','includeAll','find','create','body','clone','get','omit','createdAt','updatedAt','crudPermissions','transaction','each','autoAssociation','UserProfileResource','findAll','userProfileId','UserProfileSection','Resources','describe','sequelize','sectionId','push','removeSections','ids','getSections','enabled','includes','isEmpty','subsections','findOne','Dashboard','forEach','Plugin','resourceId','addResources','bulkCreate','getResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','rimraf','zip-dir','mustache','util'];(function(_0x31ebd9,_0x3b1ea0){var _0x3766d7=function(_0x3fb501){while(--_0x3fb501){_0x31ebd9['push'](_0x31ebd9['shift']());}};_0x3766d7(++_0x3b1ea0);}(_0xd05a,0x143));var _0xad05=function(_0x25b3d5,_0x4f0a26){_0x25b3d5=_0x25b3d5-0x0;var _0x130bd9=_0xd05a[_0x25b3d5];return _0x130bd9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xad05('0x0'));var zipdir=require(_0xad05('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xad05('0x2'));var util=require(_0xad05('0x3'));var path=require(_0xad05('0x4'));var sox=require(_0xad05('0x5'));var csv=require(_0xad05('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xad05('0x7'));var squel=require(_0xad05('0x8'));var crypto=require(_0xad05('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xad05('0xa'));var toCsv=require(_0xad05('0x6'));var querystring=require(_0xad05('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xad05('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0xad05('0xd'));var hardwareService=require(_0xad05('0xe'));var logger=require(_0xad05('0xf'))(_0xad05('0x10'));var utils=require(_0xad05('0x11'));var config=require(_0xad05('0x12'));var licenseUtil=require(_0xad05('0x13'));var db=require(_0xad05('0x14'))['db'];config[_0xad05('0x15')]=_[_0xad05('0x16')](config['redis'],{'host':_0xad05('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xad05('0x15')]));require('./userProfile.socket')[_0xad05('0x18')](socket);function respondWithStatusCode(_0x24da60,_0x44a508){_0x44a508=_0x44a508||0xcc;return function(_0x50609d){if(_0x50609d){return _0x24da60[_0xad05('0x19')](_0x44a508);}return _0x24da60['status'](_0x44a508)[_0xad05('0x1a')]();};}function respondWithResult(_0x2bf8e9,_0x29c296){_0x29c296=_0x29c296||0xc8;return function(_0x3d7eda){if(_0x3d7eda){return _0x2bf8e9[_0xad05('0x1b')](_0x29c296)[_0xad05('0x1c')](_0x3d7eda);}};}function respondWithFilteredResult(_0x534b28,_0x30d013){return function(_0x6c363b){if(_0x6c363b){var _0x9dc4d3=typeof _0x30d013[_0xad05('0x1d')]===_0xad05('0x1e')&&typeof _0x30d013[_0xad05('0x1f')]===_0xad05('0x1e');var _0x4578af=_0x6c363b[_0xad05('0x20')];var _0x2a7e2f=_0x9dc4d3?0x0:_0x30d013[_0xad05('0x1d')];var _0x530ce3=_0x9dc4d3?_0x6c363b[_0xad05('0x20')]:_0x30d013[_0xad05('0x1d')]+_0x30d013[_0xad05('0x1f')];var _0x5e6354;if(_0x530ce3>=_0x4578af){_0x530ce3=_0x4578af;_0x5e6354=0xc8;}else{_0x5e6354=0xce;}_0x534b28[_0xad05('0x1b')](_0x5e6354);return _0x534b28['set'](_0xad05('0x21'),_0x2a7e2f+'-'+_0x530ce3+'/'+_0x4578af)[_0xad05('0x1c')](_0x6c363b);}return null;};}function patchUpdates(_0x46a3be){return function(_0x37ddb5){try{jsonpatch[_0xad05('0x22')](_0x37ddb5,_0x46a3be,!![]);}catch(_0x1fdc81){return BPromise[_0xad05('0x23')](_0x1fdc81);}return _0x37ddb5[_0xad05('0x24')]();};}function saveUpdates(_0x33c97e,_0x422698){return function(_0x545637){if(_0x545637){return _0x545637[_0xad05('0x25')](_0x33c97e)[_0xad05('0x26')](function(_0x2a4620){return _0x2a4620;});}return null;};}function removeEntity(_0x2b515d,_0x48d25f){return function(_0x391bf0){if(_0x391bf0){return _0x391bf0[_0xad05('0x27')]()[_0xad05('0x26')](function(){_0x2b515d[_0xad05('0x1b')](0xcc)[_0xad05('0x1a')]();});}};}function handleEntityNotFound(_0x206abc,_0x44d8d4){return function(_0x5c04f3){if(!_0x5c04f3){_0x206abc['sendStatus'](0x194);}return _0x5c04f3;};}function handleError(_0x264287,_0x32953a){_0x32953a=_0x32953a||0x1f4;return function(_0x91ed1d){logger['error'](_0x91ed1d['stack']);if(_0x91ed1d[_0xad05('0x28')]){delete _0x91ed1d[_0xad05('0x28')];}_0x264287[_0xad05('0x1b')](_0x32953a)['send'](_0x91ed1d);};}exports[_0xad05('0x29')]=function(_0xcfea8c,_0x594ea3){var _0x206a17={},_0x19b9f1={},_0x203158={'count':0x0,'rows':[]};var _0x36face=_[_0xad05('0x2a')](db[_0xad05('0x2b')][_0xad05('0x2c')],function(_0x5ea097){return{'name':_0x5ea097[_0xad05('0x2d')],'type':_0x5ea097[_0xad05('0x2e')]['key']};});_0x19b9f1[_0xad05('0x2f')]=_[_0xad05('0x2a')](_0x36face,'name');_0x19b9f1[_0xad05('0x30')]=_[_0xad05('0x31')](_0xcfea8c[_0xad05('0x30')]);_0x19b9f1[_0xad05('0x32')]=_[_0xad05('0x33')](_0x19b9f1[_0xad05('0x2f')],_0x19b9f1[_0xad05('0x30')]);_0x206a17[_0xad05('0x34')]=_[_0xad05('0x33')](_0x19b9f1[_0xad05('0x2f')],qs[_0xad05('0x35')](_0xcfea8c['query']['fields']));_0x206a17['attributes']=_0x206a17['attributes'][_0xad05('0x36')]?_0x206a17[_0xad05('0x34')]:_0x19b9f1[_0xad05('0x2f')];if(!_0xcfea8c[_0xad05('0x30')]['hasOwnProperty'](_0xad05('0x37'))){_0x206a17[_0xad05('0x1f')]=qs[_0xad05('0x1f')](_0xcfea8c[_0xad05('0x30')]['limit']);_0x206a17[_0xad05('0x1d')]=qs['offset'](_0xcfea8c[_0xad05('0x30')][_0xad05('0x1d')]);}_0x206a17[_0xad05('0x38')]=qs['sort'](_0xcfea8c[_0xad05('0x30')][_0xad05('0x39')]);_0x206a17[_0xad05('0x3a')]=qs[_0xad05('0x32')](_[_0xad05('0x3b')](_0xcfea8c[_0xad05('0x30')],_0x19b9f1[_0xad05('0x32')]),_0x36face);if(_0xcfea8c[_0xad05('0x30')]['filter']){_0x206a17[_0xad05('0x3a')]=_[_0xad05('0x3c')](_0x206a17[_0xad05('0x3a')],{'$or':_[_0xad05('0x2a')](_0x36face,function(_0x4655cb){if(_0x4655cb[_0xad05('0x2e')]!==_0xad05('0x3d')){var _0x1ccfde={};_0x1ccfde[_0x4655cb[_0xad05('0x28')]]={'$like':'%'+_0xcfea8c['query'][_0xad05('0x3e')]+'%'};return _0x1ccfde;}})});}_0x206a17=_[_0xad05('0x3c')]({},_0x206a17,_0xcfea8c[_0xad05('0x3f')]);var _0x26bd70={'where':_0x206a17[_0xad05('0x3a')]};return db[_0xad05('0x2b')][_0xad05('0x20')](_0x26bd70)[_0xad05('0x26')](function(_0x4cfcf0){_0x203158[_0xad05('0x20')]=_0x4cfcf0;if(_0xcfea8c[_0xad05('0x30')]['includeAll']){_0x206a17[_0xad05('0x40')]=[{'all':!![]}];}return db[_0xad05('0x2b')]['findAll'](_0x206a17);})[_0xad05('0x26')](function(_0x21007b){_0x203158[_0xad05('0x41')]=_0x21007b;return _0x203158;})['then'](respondWithFilteredResult(_0x594ea3,_0x206a17))[_0xad05('0x42')](handleError(_0x594ea3,null));};exports[_0xad05('0x43')]=function(_0x14fc94,_0x41fbd0){var _0x513ecb={'raw':![],'where':{'id':_0x14fc94[_0xad05('0x44')]['id']}},_0x26c338={};_0x26c338[_0xad05('0x2f')]=_[_0xad05('0x31')](db[_0xad05('0x2b')]['rawAttributes']);_0x26c338[_0xad05('0x30')]=_[_0xad05('0x31')](_0x14fc94[_0xad05('0x30')]);_0x26c338['filters']=_[_0xad05('0x33')](_0x26c338[_0xad05('0x2f')],_0x26c338[_0xad05('0x30')]);_0x513ecb[_0xad05('0x34')]=_[_0xad05('0x33')](_0x26c338[_0xad05('0x2f')],qs[_0xad05('0x35')](_0x14fc94['query'][_0xad05('0x35')]));_0x513ecb['attributes']=_0x513ecb[_0xad05('0x34')][_0xad05('0x36')]?_0x513ecb[_0xad05('0x34')]:_0x26c338[_0xad05('0x2f')];if(_0x14fc94[_0xad05('0x30')][_0xad05('0x45')]){_0x513ecb[_0xad05('0x40')]=[{'all':!![]}];}_0x513ecb=_[_0xad05('0x3c')]({},_0x513ecb,_0x14fc94[_0xad05('0x3f')]);return db[_0xad05('0x2b')][_0xad05('0x46')](_0x513ecb)[_0xad05('0x26')](handleEntityNotFound(_0x41fbd0,null))[_0xad05('0x26')](respondWithResult(_0x41fbd0,null))[_0xad05('0x42')](handleError(_0x41fbd0,null));};exports[_0xad05('0x47')]=function(_0x56d036,_0x3e61a4){return db[_0xad05('0x2b')][_0xad05('0x47')](_0x56d036[_0xad05('0x48')],{})[_0xad05('0x26')](respondWithResult(_0x3e61a4,0xc9))['catch'](handleError(_0x3e61a4,null));};exports[_0xad05('0x49')]=function(_0x540a4f,_0x5b7d80){var _0x2164e7={'where':{'id':_0x540a4f[_0xad05('0x44')]['id']}},_0x4ceb17={};_0x4ceb17['model']=_['keys'](db['UserProfile'][_0xad05('0x2c')]);_0x2164e7['attributes']=_[_0xad05('0x33')](_0x4ceb17[_0xad05('0x2f')],qs[_0xad05('0x35')](_0x540a4f['query'][_0xad05('0x35')]));_0x2164e7[_0xad05('0x34')]=_0x2164e7['attributes'][_0xad05('0x36')]?_0x2164e7[_0xad05('0x34')]:_0x4ceb17['model'];if(_0x540a4f[_0xad05('0x30')]['includeAll']){_0x2164e7['include']=[{'all':!![]}];}_0x2164e7=_[_0xad05('0x3c')]({},_0x2164e7,_0x540a4f[_0xad05('0x3f')]);return db[_0xad05('0x2b')][_0xad05('0x46')](_0x2164e7)[_0xad05('0x26')](handleEntityNotFound(_0x5b7d80,null))[_0xad05('0x26')](function(_0x1cc306){if(_0x1cc306){var _0x21883b=_0x1cc306[_0xad05('0x4a')]({'plain':!![]});_0x21883b=qs[_0xad05('0x4b')](_0x21883b,['id',_0xad05('0x4c'),_0xad05('0x4d'),_0xad05('0x4e')]);_0x540a4f['body']=_[_0xad05('0x4b')](_0x540a4f[_0xad05('0x48')],['id','createdAt',_0xad05('0x4d')]);return db['sequelize'][_0xad05('0x4f')](function(_0xd4d00f){return db[_0xad05('0x2b')][_0xad05('0x47')](_[_0xad05('0x3c')](_0x21883b,_0x540a4f['body']),{'include':_0x540a4f['query'][_0xad05('0x45')]?[{'all':!![]}]:undefined,'transaction':_0xd4d00f})[_0xad05('0x26')](function(_0x4fcdd5){var _0x2604f1=_0x4fcdd5[_0xad05('0x4a')]({'plain':!![]});return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x540a4f[_0xad05('0x44')]['id']},'raw':!![]})[_0xad05('0x26')](function(_0x59c8c5){if(_0x59c8c5){return BPromise[_0xad05('0x50')](_0x59c8c5,function(_0x670d2d){return new BPromise(function(_0x1e10e8,_0x49c73a){if(_0x670d2d[_0xad05('0x51')]===null||_0x670d2d[_0xad05('0x51')]===0x1)_0x1e10e8(null);return db[_0xad05('0x52')][_0xad05('0x53')]({'where':{'sectionId':_0x670d2d['id']},'raw':!![]})[_0xad05('0x26')](function(_0x39ea3f){var _0x350e6f=_[_0xad05('0x2a')](_0x39ea3f,function(_0x44f659){return qs[_0xad05('0x4b')](_0x44f659,['id',_0xad05('0x4c'),_0xad05('0x4d'),'sectionId']);});_0x1e10e8(_0x350e6f);})[_0xad05('0x42')](function(_0x4b4907){_0x49c73a(_0x4b4907);});})[_0xad05('0x26')](function(_0x2f80da){var _0x251256=qs[_0xad05('0x4b')](_0x670d2d,['id',_0xad05('0x4c'),_0xad05('0x4d')]);_0x251256[_0xad05('0x54')]=_0x2604f1['id'];if(_0x2f80da)_0x251256['Resources']=_0x2f80da;return _0x251256;})[_0xad05('0x26')](function(_0x5071ed){return db[_0xad05('0x55')][_0xad05('0x47')](_0x5071ed,{'include':[{'model':db['UserProfileResource'],'as':_0xad05('0x56')}],'raw':!![],'transaction':_0xd4d00f});});})[_0xad05('0x26')](function(){return _0x2604f1;});}});});});}})[_0xad05('0x26')](respondWithResult(_0x5b7d80,0xc9))['catch'](handleError(_0x5b7d80,null));};exports[_0xad05('0x25')]=function(_0x292c9b,_0x3d4ce9){if(_0x292c9b['body']['id']){delete _0x292c9b[_0xad05('0x48')]['id'];}return db['UserProfile'][_0xad05('0x46')]({'where':{'id':_0x292c9b[_0xad05('0x44')]['id']}})[_0xad05('0x26')](handleEntityNotFound(_0x3d4ce9,null))['then'](saveUpdates(_0x292c9b[_0xad05('0x48')],null))['then'](respondWithResult(_0x3d4ce9,null))[_0xad05('0x42')](handleError(_0x3d4ce9,null));};exports[_0xad05('0x27')]=function(_0x3fe887,_0x2ac74a){return db['UserProfile'][_0xad05('0x46')]({'where':{'id':_0x3fe887[_0xad05('0x44')]['id']}})[_0xad05('0x26')](handleEntityNotFound(_0x2ac74a,null))[_0xad05('0x26')](removeEntity(_0x2ac74a,null))['catch'](handleError(_0x2ac74a,null));};exports[_0xad05('0x57')]=function(_0x3df464,_0x4f6e91){return db['UserProfile']['describe']()[_0xad05('0x26')](respondWithResult(_0x4f6e91,null))['catch'](handleError(_0x4f6e91,null));};exports['addSections']=function(_0x51f805,_0x5abf6b){var _0x278d1e=_0x51f805['body'];return db[_0xad05('0x2b')]['find']({'where':{'id':_0x51f805[_0xad05('0x44')]['id']}})[_0xad05('0x26')](handleEntityNotFound(_0x5abf6b,null))['then'](function(_0x2d1d83){if(_0x2d1d83){return db[_0xad05('0x58')][_0xad05('0x4f')](function(_0x1b1508){return db[_0xad05('0x55')][_0xad05('0x27')]({'where':{'userProfileId':_0x51f805['params']['id'],'sectionId':_[_0xad05('0x2a')](_0x278d1e,function(_0x3fd5b0){return _0x3fd5b0[_0xad05('0x59')];})},'transaction':_0x1b1508})['then'](function(){var _0x29a0f4=_['map'](_0x278d1e,function(_0x5b5a13){_0x5b5a13[_0xad05('0x54')]=_0x51f805[_0xad05('0x44')]['id'];return _0x5b5a13;});var _0x1786b4=[];return BPromise[_0xad05('0x50')](_0x29a0f4,function(_0x3200a9){return db[_0xad05('0x55')][_0xad05('0x47')](_0x3200a9,{'include':[{'model':db[_0xad05('0x52')],'as':'Resources'}],'raw':!![],'transaction':_0x1b1508})[_0xad05('0x26')](function(_0x4f1117){_0x1786b4[_0xad05('0x5a')](_0x4f1117[_0xad05('0x4a')]({'plain':!![]}));});})[_0xad05('0x26')](function(){return _0x1786b4;});});});}})[_0xad05('0x26')](function(_0xfdec36){return _0xfdec36;})[_0xad05('0x26')](respondWithResult(_0x5abf6b,null))[_0xad05('0x42')](handleError(_0x5abf6b,null));};exports[_0xad05('0x5b')]=function(_0xb79167,_0x5814e9){var _0x47680d;return db[_0xad05('0x2b')]['find']({'where':{'id':_0xb79167[_0xad05('0x44')]['id']},'attributes':['id',_0xad05('0x28')]})[_0xad05('0x26')](handleEntityNotFound(_0x5814e9,null))[_0xad05('0x26')](function(_0x35e985){if(_0x35e985){_0x47680d=_0x35e985;return db[_0xad05('0x55')][_0xad05('0x27')]({'where':{'userProfileId':_0xb79167['params']['id'],'sectionId':_0xb79167[_0xad05('0x30')][_0xad05('0x5c')]}});}})[_0xad05('0x26')](function(){return _0x47680d;})[_0xad05('0x26')](respondWithStatusCode(_0x5814e9,null))[_0xad05('0x42')](handleError(_0x5814e9,null));};exports[_0xad05('0x5d')]=function(_0x17b4e1,_0x4410c6){var _0x233870=[];var _0x39d656=[];return db[_0xad05('0x55')][_0xad05('0x53')]({'where':{'userProfileId':_0x17b4e1[_0xad05('0x44')]['id']},'raw':!![]})[_0xad05('0x26')](function(_0x318c5d){_0x233870=_[_0xad05('0x3e')](_0x318c5d,function(_0x5e117e){return _0x5e117e[_0xad05('0x5e')]===0x1||_[_0xad05('0x5f')]([0x3eb,0x709],_0x5e117e[_0xad05('0x59')]);});if(!_[_0xad05('0x60')](_0x233870)){return _[_0xad05('0x2a')](_0x233870,function(_0x19086f){return _0x19086f['sectionId'];});}else{return;}})[_0xad05('0x26')](function(_0x4152c2){if(_0x4152c2)_0x39d656=_0x4152c2;if(_[_0xad05('0x5f')](_0x39d656,0x64)){var _0x2682dc=_[_0xad05('0x46')](_0x233870,{'sectionId':0x64});return hasDefaultDashboard(_0x2682dc)[_0xad05('0x26')](function(_0xdd7134){return _[_0xad05('0x2a')](_0x233870,function(_0xd95d11){if(_0xd95d11[_0xad05('0x59')]===0x64){_0xd95d11[_0xad05('0x61')]=_0xdd7134;}return _0xd95d11;});});}else{return;}})['then'](function(_0x26bd2c){if(_0x26bd2c)_0x233870=_0x26bd2c;if(_[_0xad05('0x5f')](_0x39d656,0x3eb)){var _0x82dd58=_['find'](_0x233870,{'sectionId':0x3eb});return getCustomDashboards(_0x82dd58)[_0xad05('0x26')](function(_0x290a89){return _[_0xad05('0x2a')](_0x233870,function(_0x191b77){if(_0x82dd58['enabled']){if(_0x191b77[_0xad05('0x59')]===0x3eb){_0x191b77[_0xad05('0x61')]=_0x290a89;}}else{if(_0x191b77[_0xad05('0x59')]===0x64){_0x191b77[_0xad05('0x61')]=_0x290a89;}}return _0x191b77;});});}else{return;}})[_0xad05('0x26')](function(_0x2ac7fa){if(_0x2ac7fa)_0x233870=_0x2ac7fa;if(_[_0xad05('0x5f')](_0x39d656,0x709)){var _0x18fff1=_[_0xad05('0x46')](_0x233870,{'sectionId':0x709});return getPlugins(_0x18fff1)[_0xad05('0x26')](function(_0x374226){if(_0x18fff1[_0xad05('0x5e')]){return _['map'](_0x233870,function(_0x2fd57f){if(_0x2fd57f['sectionId']===0x709){_0x2fd57f[_0xad05('0x61')]=_0x374226;}return _0x2fd57f;});}else{var _0x68f303={'sectionId':0x76c,'enabled':0x1,'subsections':_0x374226};var _0x5d9ad3=_[_0xad05('0x2a')](_0x233870);_0x5d9ad3[_0xad05('0x5a')](_0x68f303);return _0x5d9ad3;}});}else{return;}})[_0xad05('0x26')](function(_0x33813e){if(_0x33813e)_0x233870=_0x33813e;return _['filter'](_0x233870,[_0xad05('0x5e'),0x1]);})[_0xad05('0x26')](respondWithResult(_0x4410c6,null))[_0xad05('0x42')](handleError(_0x4410c6,null));};function hasDefaultDashboard(_0x415ce5){var _0x8dbb9a=[0x65];return new BPromise(function(_0x494eae,_0x120ee1){try{if(_0x415ce5[_0xad05('0x51')]){_0x494eae(_0x8dbb9a);}else{return db[_0xad05('0x52')][_0xad05('0x62')]({'where':{'sectionId':_0x415ce5['id']},'raw':!![]})[_0xad05('0x26')](function(_0xecffd2){_0xecffd2?_0x494eae(_0x8dbb9a):_0x494eae();});}}catch(_0x5a9f98){_0x120ee1(_0x5a9f98);}});}function getCustomDashboards(_0x521ee0){var _0x58ed8b=[];return new BPromise(function(_0x597a77,_0x15434a){try{if(_0x521ee0[_0xad05('0x51')]){return db[_0xad05('0x63')][_0xad05('0x53')]({'raw':!![]})[_0xad05('0x26')](function(_0x389c7a){_0x389c7a[_0xad05('0x64')](function(_0xb536f4){_0x58ed8b[_0xad05('0x5a')](_0xb536f4['id']+0x1869f);});_0x597a77(_0x58ed8b);});}else{return db['UserProfileResource'][_0xad05('0x53')]({'where':{'sectionId':_0x521ee0['id']},'raw':!![]})[_0xad05('0x26')](function(_0x42ec49){_0x42ec49[_0xad05('0x64')](function(_0x8a615f){_0x58ed8b[_0xad05('0x5a')](_0x8a615f['resourceId']+0x1869f);});_0x597a77(_0x58ed8b);});}}catch(_0x346ba1){_0x15434a(_0x346ba1);}});}function getPlugins(_0x172302){var _0x2d4e76=[];return new BPromise(function(_0x32dfa7,_0x105930){try{if(_0x172302['autoAssociation']){return db[_0xad05('0x65')][_0xad05('0x53')]({'raw':!![]})['then'](function(_0xd7b3b1){_0xd7b3b1[_0xad05('0x64')](function(_0x37b99c){_0x2d4e76[_0xad05('0x5a')](_0x37b99c['id']+0x15b38);});_0x32dfa7(_0x2d4e76);});}else{return db[_0xad05('0x52')]['findAll']({'where':{'sectionId':_0x172302['id']},'raw':!![]})['then'](function(_0x4b0105){_0x4b0105['forEach'](function(_0x510b99){_0x2d4e76[_0xad05('0x5a')](_0x510b99[_0xad05('0x66')]+0x15b38);});_0x32dfa7(_0x2d4e76);});}}catch(_0x5a63ad){_0x105930(_0x5a63ad);}});}exports[_0xad05('0x67')]=function(_0x29059a,_0x4088bc){return db[_0xad05('0x2b')][_0xad05('0x46')]({'where':{'id':_0x29059a['params']['id']}})[_0xad05('0x26')](handleEntityNotFound(_0x4088bc,null))[_0xad05('0x26')](function(_0x495df8){if(_0x495df8){return db['sequelize'][_0xad05('0x4f')](function(_0x5c4531){return db[_0xad05('0x55')][_0xad05('0x53')]({'where':{'userProfileId':_0x29059a[_0xad05('0x44')]['id']},'attributes':['id'],'raw':!![]})[_0xad05('0x26')](function(_0x13cc9b){if(_0x13cc9b){return db['UserProfileSection'][_0xad05('0x27')]({'where':{'userProfileId':_0x29059a[_0xad05('0x44')]['id'],'id':_['map'](_0x13cc9b,function(_0x41057f){return _0x41057f['id'];})},'transaction':_0x5c4531});}})[_0xad05('0x26')](function(_0x163d5f){var _0x204239=_[_0xad05('0x2a')](_0x29059a[_0xad05('0x48')],function(_0x39f7ec){_0x39f7ec[_0xad05('0x54')]=_0x29059a[_0xad05('0x44')]['id'];return _0x39f7ec;});return db[_0xad05('0x55')]['bulkCreate'](_0x204239,{'raw':!![],'transaction':_0x5c4531});})[_0xad05('0x26')](function(_0x310dfc){var _0x305676=_[_0xad05('0x3e')](_['map'](_0x310dfc,function(_0x13244d){return _0x13244d[_0xad05('0x4a')]({'plain':!![]});}),{'includeAll':![]});if(_0x305676){return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x29059a[_0xad05('0x44')]['id'],'sectionId':_[_0xad05('0x2a')](_0x305676,function(_0x110376){return _0x110376['sectionId'];})},'attributes':['id','sectionId'],'raw':!![]})[_0xad05('0x26')](function(_0x103d73){var _0x606772=_[_0xad05('0x2a')](_0x29059a[_0xad05('0x48')],function(_0x2cefda){_0x2cefda[_0xad05('0x54')]=_0x29059a['params']['id'];return _0x2cefda;});return db['UserProfileResource'][_0xad05('0x68')](_0x606772,{'raw':!![],'transaction':_0x5c4531});});}})[_0xad05('0x42')](handleError(_0x4088bc,null));});}})[_0xad05('0x26')](function(_0x206ac8){var _0x5f5062=_[_0xad05('0x2a')](_0x206ac8,function(_0xa11296){return _0xa11296['get']({'plain':!![]});});})[_0xad05('0x26')](respondWithResult(_0x4088bc,null))['catch'](handleError(_0x4088bc,null));};exports['removeResources']=function(_0x86a5a7,_0x405905,_0x17d2a1){return db[_0xad05('0x2b')][_0xad05('0x46')]({'where':{'id':_0x86a5a7[_0xad05('0x44')]['id']}})[_0xad05('0x26')](handleEntityNotFound(_0x405905,null))[_0xad05('0x26')](function(_0x5e7a7e){if(_0x5e7a7e){return _0x5e7a7e['removeResources'](_0x86a5a7[_0xad05('0x30')][_0xad05('0x5c')]);}})[_0xad05('0x26')](respondWithStatusCode(_0x405905,null))[_0xad05('0x42')](handleError(_0x405905,null));};exports[_0xad05('0x69')]=function(_0x6df81e,_0xd561e4){var _0x3f0536={};if(!_0x6df81e[_0xad05('0x30')][_0xad05('0x6a')])throw new Error(_0xad05('0x6b'));if(!_0x6df81e['query']['hasOwnProperty']('nolimit')){_0x3f0536[_0xad05('0x1f')]=qs[_0xad05('0x1f')](_0x6df81e[_0xad05('0x30')][_0xad05('0x1f')]);_0x3f0536['offset']=qs[_0xad05('0x1d')](_0x6df81e[_0xad05('0x30')][_0xad05('0x1d')]);}return db[_0xad05('0x2b')][_0xad05('0x46')]({'where':{'id':_0x6df81e[_0xad05('0x44')]['id']}})[_0xad05('0x26')](function(_0x8a656){if(!_0x8a656)throw new Error(_0xad05('0x6c')+_0x6df81e['params']['id']);return db[_0xad05('0x2b')][_0xad05('0x69')](_0x6df81e);})[_0xad05('0x26')](respondWithFilteredResult(_0xd561e4,_0x3f0536))['catch'](handleError(_0xd561e4,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 2bb23d1..a6ad85c 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 _0x1b65=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserProfile','setMaxListeners'];(function(_0x54535a,_0x52b3b3){var _0x3201b6=function(_0x567b58){while(--_0x567b58){_0x54535a['push'](_0x54535a['shift']());}};_0x3201b6(++_0x52b3b3);}(_0x1b65,0x1b4));var _0x51b6=function(_0x46b966,_0x4a484f){_0x46b966=_0x46b966-0x0;var _0x22cf2d=_0x1b65[_0x46b966];return _0x22cf2d;};'use strict';var EventEmitter=require(_0x51b6('0x0'));var UserProfile=require(_0x51b6('0x1'))['db'][_0x51b6('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x51b6('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x51b6('0x4'),'afterDestroy':_0x51b6('0x5')};function emitEvent(_0x3c6f36){return function(_0x2d5762,_0x1a1c26,_0x1ba2e9){UserProfileEvents[_0x51b6('0x6')](_0x3c6f36+':'+_0x2d5762['id'],_0x2d5762);UserProfileEvents['emit'](_0x3c6f36,_0x2d5762);_0x1ba2e9(null);};}for(var e in events){if(events[_0x51b6('0x7')](e)){var event=events[e];UserProfile[_0x51b6('0x8')](e,emitEvent(event));}}module[_0x51b6('0x9')]=UserProfileEvents; \ No newline at end of file +var _0xc1c6=['../../mysqldb','UserProfile','save','remove','emit','hasOwnProperty','exports','events'];(function(_0x3c560a,_0x1c46d4){var _0x22e9be=function(_0xd72419){while(--_0xd72419){_0x3c560a['push'](_0x3c560a['shift']());}};_0x22e9be(++_0x1c46d4);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x2c31d7,_0x226c98){_0x2c31d7=_0x2c31d7-0x0;var _0x4d67e7=_0xc1c6[_0x2c31d7];return _0x4d67e7;};'use strict';var EventEmitter=require(_0x6c1c('0x0'));var UserProfile=require(_0x6c1c('0x1'))['db'][_0x6c1c('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6c1c('0x3'),'afterUpdate':'update','afterDestroy':_0x6c1c('0x4')};function emitEvent(_0x40ff59){return function(_0x265d2c,_0x59f799,_0x56ed6f){UserProfileEvents[_0x6c1c('0x5')](_0x40ff59+':'+_0x265d2c['id'],_0x265d2c);UserProfileEvents['emit'](_0x40ff59,_0x265d2c);_0x56ed6f(null);};}for(var e in events){if(events[_0x6c1c('0x6')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0x6c1c('0x7')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 9aa1a61..caa9421 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 _0x7ee1=['User','telephone','VoiceQueues','VoiceQueue','inbound','QueueCampaigns','queue','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','users','agents','telephones','Users','admin','user','Telephones','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','FreshdeskAccount','sugarcrmaccounts','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','Dashboard','Interval','Pause','scheduler','Schedule','sounds','tags','templates','Template','Trigger','trunks','Trunk','variables','Variable','plugins','Plugin','extractedreports','Reports','AnalyticMetric','charAt','toUpperCase','slice','Sequelize','QueryTypes','select','ui.','InteractionId','ui.createdAt','from','user_has_','where','ui.UserId\x20=\x20?','query','toString','OpenTabs','define','user_profiles','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','UserProfileSection','find','params','ignore','union','length','push','autoAssociation','all','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','offset','order','sort','merge','key','VIRTUAL','foreignKey','forEach','options','include','default','reportId','DefaultReports','custom','rows','count','includeAll','Tag','Tags','color','tag','openTabs','true','chat','dataValues','sms','openchannel','whatsapp','lodash','exports','filter','field','value','findAll','then','catch','model','associatedResources','map','resolve','UserProfileResource','AnalyticExtractedReport','resourceId','type','toLowerCase','squareprojects','childModel','SquareProject','odbc','SquareOdbc','squarerecordings','SquareRecording','parentSections','name','projectName','projects','JscriptyProject','CmContact','ListId','lists','CmList','globalcustomfields','CmCustomField','ChatQueue','ChatWebsite','faxqueues','faxaccounts','FaxAccount','inboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceRecording','Agents','membername','role','agent'];(function(_0x5a27e8,_0x492a2f){var _0x4e38f7=function(_0x2a4048){while(--_0x2a4048){_0x5a27e8['push'](_0x5a27e8['shift']());}};_0x4e38f7(++_0x492a2f);}(_0x7ee1,0x8d));var _0x17ee=function(_0x16bb3d,_0x449b71){_0x16bb3d=_0x16bb3d-0x0;var _0x28de6d=_0x7ee1[_0x16bb3d];return _0x28de6d;};'use strict';var _=require(_0x17ee('0x0'));var attributes=require('./userProfile.attributes');var qs=require('../../components/parsers/qs');var squel=require('squel');module[_0x17ee('0x1')]=function(_0x31a2fe){var _0x1790ff=_0x31a2fe['models'];function _0x1602fd(_0x1811e4,_0x10f7a8){return new Promise(function(_0x2f9ebc,_0x5c0617){if(!_0x10f7a8)return _0x2f9ebc(null);var _0x52b1db=_0x10f7a8[_0x17ee('0x2')]?{[_0x10f7a8['filter'][_0x17ee('0x3')]]:_0x10f7a8['filter'][_0x17ee('0x4')]}:undefined;return _0x1790ff[_0x1811e4][_0x17ee('0x5')]({'where':_0x52b1db,'raw':!![]})[_0x17ee('0x6')](function(_0x4af369){_0x10f7a8['associatedResources']=_['map'](_0x4af369,'id');_0x2f9ebc(_0x10f7a8);})[_0x17ee('0x7')](function(_0x4ee1e0){_0x5c0617(_0x4ee1e0);});});}function _0x155964(_0x378a78,_0x3068b2){return new Promise(function(_0x3d4f0f,_0x57fae0){var _0x1acde5=_0x378a78['filter']?{[_0x378a78[_0x17ee('0x2')][_0x17ee('0x3')]]:_0x378a78[_0x17ee('0x2')][_0x17ee('0x4')]}:undefined;return _0x1790ff[_0x378a78[_0x17ee('0x8')]][_0x17ee('0x5')]({'where':_0x1acde5,'raw':!![]})[_0x17ee('0x6')](function(_0x54434e){_0x3068b2[_0x17ee('0x9')]=_[_0x17ee('0xa')](_0x54434e,function(_0x329af2){return _0x329af2['name'];});_0x3d4f0f(_0x3068b2);})['catch'](function(_0x551c5f){_0x57fae0(_0x551c5f);});});}function _0x4d4593(_0x2fe0ac,_0x2382ce,_0x1b87c3){if(!_0x2382ce)return Promise[_0x17ee('0xb')](null);return new Promise(function(_0x443f81,_0x236d18){return _0x1790ff[_0x17ee('0xc')]['findAll']({'where':{'sectionId':_0x2382ce['id']},'raw':!![]})[_0x17ee('0x6')](function(_0x1118a3){if(_0x2fe0ac[_0x17ee('0x3')]&&_0x2fe0ac[_0x17ee('0x3')]!=='id'){_0x2382ce[_0x17ee('0x9')]=_['map'](_0x1118a3,function(_0x393720){return _0x393720[_0x2fe0ac['field']];});}else{if(_0x1b87c3===_0x17ee('0xd')){_0x2382ce['associatedResources']=_[_0x17ee('0xa')](_0x1118a3,function(_0x343f1b){return{'id':_0x343f1b[_0x17ee('0xe')],'type':_0x343f1b[_0x17ee('0xf')]};});}else{_0x2382ce[_0x17ee('0x9')]=_[_0x17ee('0xa')](_0x1118a3,function(_0x44548f){return _0x44548f[_0x17ee('0xe')];});}}_0x443f81(_0x2382ce);})[_0x17ee('0x7')](function(_0x1f3d6d){_0x236d18(_0x1f3d6d);});});}function _0x37fe4e(_0x4d2d91,_0x4b7bfe){var _0x2118a6={'parentSections':[]};switch(_0x4d2d91[_0x17ee('0x10')]()){case _0x17ee('0x11'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x13');break;case _0x17ee('0x14'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x15');break;case _0x17ee('0x16'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x17');_0x2118a6[_0x17ee('0x18')]=[{'name':'SquareProjects','field':_0x17ee('0x19'),'foreignKey':_0x17ee('0x1a')}];break;case _0x17ee('0x1b'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x1c');break;case'contacts':_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x1d');_0x2118a6[_0x17ee('0x18')]=[{'name':'Lists','field':'id','foreignKey':_0x17ee('0x1e')}];break;case _0x17ee('0x1f'):_0x2118a6['childModel']=_0x17ee('0x20');break;case'companies':_0x2118a6[_0x17ee('0x12')]='CmCompany';break;case _0x17ee('0x21'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x22');break;case'chatqueues':_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x23');break;case'chatwebsites':_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x24');break;case _0x17ee('0x25'):_0x2118a6['childModel']='FaxQueue';break;case _0x17ee('0x26'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x27');break;case _0x17ee('0x28'):case'internalroutes':case'outboundroutes':_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x29');break;case _0x17ee('0x2a'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x2b');break;case _0x17ee('0x2c'):_0x2118a6[_0x17ee('0x12')]='VoiceMail';break;case'voicerecordings':_0x2118a6['childModel']=_0x17ee('0x2d');_0x2118a6['parentSections']=[{'name':_0x17ee('0x2e'),'field':_0x17ee('0x19'),'foreignKey':_0x17ee('0x2f'),'model':'User','filter':{'field':_0x17ee('0x30'),'value':[_0x17ee('0x31')]}},{'name':'Telephones','field':'name','foreignKey':_0x17ee('0x2f'),'model':_0x17ee('0x32'),'filter':{'field':_0x17ee('0x30'),'value':[_0x17ee('0x33')]}},{'name':_0x17ee('0x34'),'field':'name','foreignKey':'queue','model':_0x17ee('0x35'),'filter':{'field':_0x17ee('0xf'),'value':[_0x17ee('0x36')]}},{'name':_0x17ee('0x37'),'field':_0x17ee('0x19'),'foreignKey':_0x17ee('0x38'),'model':'VoiceQueue','filter':{'field':'type','value':[_0x17ee('0x39')]}}];break;case _0x17ee('0x3a'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x3b');break;case _0x17ee('0x3c'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x3d');break;case _0x17ee('0x3e'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x3f');break;case'ivrcampaigns':_0x2118a6['childModel']='Campaign';break;case _0x17ee('0x40'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x41');break;case _0x17ee('0x42'):_0x2118a6['childModel']=_0x17ee('0x43');break;case _0x17ee('0x44'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x45');break;case'openchannelqueues':_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x46');break;case _0x17ee('0x47'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x48');break;case _0x17ee('0x49'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x4a');break;case'smsaccounts':_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x4b');break;case _0x17ee('0x4c'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x4d');break;case _0x17ee('0x4e'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x4f');break;case _0x17ee('0x50'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x51');break;case _0x17ee('0x52'):case'queuecampaigns':_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x35');if(_0x4b7bfe){_0x2118a6['parentSections']=[{'name':'VoiceQueues'},{'name':'QueueCampaigns'}];}break;case _0x17ee('0x53'):case _0x17ee('0x54'):case _0x17ee('0x55'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x32');if(_0x4b7bfe){_0x2118a6['parentSections']=[{'name':_0x17ee('0x56'),'filter':{'field':_0x17ee('0x30'),'value':[_0x17ee('0x57'),_0x17ee('0x58')]},'ignore':!![]},{'name':_0x17ee('0x2e')},{'name':_0x17ee('0x59')}];}break;case _0x17ee('0x5a'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x5b');break;case _0x17ee('0x5c'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x5d');break;case'freshdeskaccounts':_0x2118a6['childModel']=_0x17ee('0x5e');break;case _0x17ee('0x5f'):_0x2118a6['childModel']='SugarcrmAccount';break;case _0x17ee('0x60'):_0x2118a6['childModel']=_0x17ee('0x61');break;case _0x17ee('0x62'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x63');break;case _0x17ee('0x64'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x32');break;case _0x17ee('0x65'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x66');break;case _0x17ee('0x67'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x68');break;case'customdashboards':_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x69');break;case'intervals':_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x6a');break;case'pauses':_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x6b');break;case _0x17ee('0x6c'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x6d');break;case _0x17ee('0x6e'):_0x2118a6[_0x17ee('0x12')]='Sound';break;case _0x17ee('0x6f'):_0x2118a6['childModel']='Tag';break;case _0x17ee('0x70'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x71');break;case'triggers':_0x2118a6['childModel']=_0x17ee('0x72');break;case _0x17ee('0x73'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x74');break;case _0x17ee('0x75'):_0x2118a6[_0x17ee('0x12')]=_0x17ee('0x76');break;case _0x17ee('0x77'):_0x2118a6['childModel']=_0x17ee('0x78');break;case _0x17ee('0x79'):_0x2118a6['childModel']='AnalyticExtractedReport';_0x2118a6[_0x17ee('0x18')]=[{'name':_0x17ee('0x7a'),'field':'id','foreignKey':'reportId'}];break;case'metrics':_0x2118a6['childModel']=_0x17ee('0x7b');break;}return _0x2118a6;}function _0x1f860d(_0x1fbaec,_0x4a00db){var _0x3b5284=_0x1fbaec[_0x17ee('0x7c')](0x0)[_0x17ee('0x7d')]()+_0x1fbaec[_0x17ee('0x7e')](0x1);var _0x499e21={'type':_0x1790ff[_0x17ee('0x7f')][_0x17ee('0x80')]['SELECT'],'raw':!![]};return new Promise(function(_0x431b6a,_0x13e9e3){var _0x280036=squel[_0x17ee('0x81')]()[_0x17ee('0x3')](_0x17ee('0x82')+_0x3b5284+_0x17ee('0x83'),'id')[_0x17ee('0x3')](_0x17ee('0x84'))[_0x17ee('0x85')](_0x17ee('0x86')+_0x1fbaec+'_interactions','ui')[_0x17ee('0x87')](_0x17ee('0x88'),_0x4a00db['id']);return _0x1790ff['sequelize'][_0x17ee('0x89')](_0x280036[_0x17ee('0x8a')](),_0x499e21)[_0x17ee('0x6')](function(_0x5c2658){_0x4a00db[_0x3b5284+_0x17ee('0x8b')]=_0x5c2658;_0x431b6a(_0x5c2658);})[_0x17ee('0x7')](function(_0x2d72c2){_0x13e9e3(_0x2d72c2);});});}return _0x31a2fe[_0x17ee('0x8c')]('UserProfile',attributes,{'tableName':_0x17ee('0x8d'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x42a6b4){var _0x59d907={'raw':![],'where':{}};var _0xc0a30f={};var _0x135c29={'count':0x0,'rows':[]};var _0x16cd1b=_0x42a6b4[_0x17ee('0x89')][_0x17ee('0x8e')];var _0x13d99b=_0x42a6b4[_0x17ee('0x89')][_0x17ee('0x8f')]||![];var _0x38087a=_0x37fe4e(_0x16cd1b,_0x13d99b);if(!_0x38087a[_0x17ee('0x12')])throw new Error(_0x17ee('0x90')+_0x16cd1b+'\x27');var _0x5f35b6=[{'name':_0x16cd1b}];if(!_[_0x17ee('0x91')](_0x38087a['parentSections']))_0x5f35b6=_0x38087a[_0x17ee('0x18')];var _0x38fd73=[];for(var _0x97b640=0x0;_0x97b640<_0x5f35b6['length'];_0x97b640++){_0x38fd73['push'](_0x1790ff[_0x17ee('0x92')][_0x17ee('0x93')]({'where':{'userProfileId':_0x42a6b4[_0x17ee('0x94')]['id'],'name':_0x5f35b6[_0x97b640][_0x17ee('0x19')]},'raw':!![]}));}return Promise['all'](_0x38fd73)[_0x17ee('0x6')](function(_0x597697){var _0x5b2baa=_[_0x17ee('0x2')](_0x597697,function(_0x3f3b42){return _0x3f3b42?_0x3f3b42:undefined;});var _0x49cc91=_['filter'](_0x5f35b6,[_0x17ee('0x95'),!![]]);var _0x32ac7a=_['isEmpty'](_0x5b2baa)&&_[_0x17ee('0x91')](_0x49cc91)?null:_[_0x17ee('0x96')](_0x49cc91,_0x5b2baa);if(!_0x32ac7a)return null;var _0x1477ef=[];for(var _0x442d0f=0x0;_0x442d0f<_0x32ac7a[_0x17ee('0x97')];_0x442d0f++){var _0x57e7e7=_[_0x17ee('0x93')](_0x5f35b6,function(_0x504467){return _0x32ac7a[_0x442d0f]?_0x504467[_0x17ee('0x19')]===_0x32ac7a[_0x442d0f][_0x17ee('0x19')]:null;});if(_0x57e7e7){if(_0x32ac7a[_0x442d0f][_0x17ee('0x95')]){_0x1477ef[_0x17ee('0x98')](_0x1602fd(_0x38087a[_0x17ee('0x12')],_0x32ac7a[_0x442d0f]));}else{if(!_0x32ac7a[_0x442d0f][_0x17ee('0x99')]){_0x1477ef[_0x17ee('0x98')](_0x4d4593(_0x57e7e7,_0x32ac7a[_0x442d0f],_0x38087a[_0x17ee('0x12')]));}else{if(_0x57e7e7[_0x17ee('0x8')]){_0x1477ef[_0x17ee('0x98')](_0x155964(_0x57e7e7,_0x32ac7a[_0x442d0f]));}}}}}return Promise[_0x17ee('0x9a')](_0x1477ef);})['then'](function(_0x457d01){var _0x402e70=_0x457d01;var _0x1600c7=null;if(_0x402e70){_0x1600c7=_0x402e70[_0x17ee('0x97')]===0x1?_0x402e70[0x0]:null;}if(!_0x1600c7&&!_0x402e70)return _0x135c29;var _0x24ce05=_0x1790ff[_0x38087a[_0x17ee('0x12')]]['rawAttributes'];_0xc0a30f[_0x17ee('0x8')]=_[_0x17ee('0x9b')](_0x24ce05);_0xc0a30f['query']=_[_0x17ee('0x9b')](_0x42a6b4[_0x17ee('0x89')]);_0xc0a30f[_0x17ee('0x9c')]=_[_0x17ee('0x9d')](_0xc0a30f[_0x17ee('0x8')],_0xc0a30f[_0x17ee('0x89')]);_0x59d907['attributes']=_['intersection'](_0xc0a30f[_0x17ee('0x8')],qs['fields'](_0x42a6b4[_0x17ee('0x89')][_0x17ee('0x9e')]));_0x59d907['attributes']=_0x59d907['attributes'][_0x17ee('0x97')]?_0x59d907[_0x17ee('0x9f')]:_0xc0a30f[_0x17ee('0x8')];if(!_0x42a6b4['query'][_0x17ee('0xa0')](_0x17ee('0xa1'))){_0x59d907[_0x17ee('0xa2')]=qs[_0x17ee('0xa2')](_0x42a6b4['query'][_0x17ee('0xa2')]);_0x59d907[_0x17ee('0xa3')]=qs[_0x17ee('0xa3')](_0x42a6b4[_0x17ee('0x89')][_0x17ee('0xa3')]);}_0x59d907[_0x17ee('0xa4')]=qs[_0x17ee('0xa5')](_0x42a6b4[_0x17ee('0x89')][_0x17ee('0xa5')]);_0x59d907[_0x17ee('0x87')]=qs[_0x17ee('0x9c')](_['pick'](_0x42a6b4[_0x17ee('0x89')],_0xc0a30f[_0x17ee('0x9c')]));if(_0x42a6b4[_0x17ee('0x89')][_0x17ee('0x2')]){_0x59d907[_0x17ee('0x87')]=_[_0x17ee('0xa6')](_0x59d907[_0x17ee('0x87')],{'$or':_['map'](_0x24ce05,function(_0x1bfe00){if(_0x1bfe00[_0x17ee('0xf')][_0x17ee('0xa7')]!==_0x17ee('0xa8')){var _0x212fdf={};_0x212fdf[_0x1bfe00[_0x17ee('0x3')]]={'$like':'%'+_0x42a6b4['query'][_0x17ee('0x2')]+'%'};return _0x212fdf;}})});}var _0x3c6536=[];var _0x40f002=null;var _0x1acd22={};if(_0x1600c7){_0x40f002=_[_0x17ee('0x93')](_0x5f35b6,[_0x17ee('0x19'),_0x1600c7['name']]);if(_0x40f002[_0x17ee('0x3')]){_0x1acd22={};if(_0x38087a[_0x17ee('0x12')]===_0x17ee('0xd')){_0x1acd22[_0x40f002[_0x17ee('0xa9')]]=_[_0x17ee('0xa')](_0x1600c7[_0x17ee('0x9')],'id');}else{_0x1acd22[_0x40f002[_0x17ee('0xa9')]]=_0x1600c7[_0x17ee('0x9')];}_0x3c6536[_0x17ee('0x98')](_0x1acd22);}else{_0x59d907[_0x17ee('0x87')]['id']=_0x1600c7[_0x17ee('0x9')];}}else{for(var _0xedd714=0x0;_0xedd714<_0x402e70['length'];_0xedd714++){_0x40f002=_[_0x17ee('0x93')](_0x5f35b6,[_0x17ee('0x19'),_0x402e70[_0xedd714]['name']]);if(_0x40f002[_0x17ee('0x3')]){_0x1acd22={};_0x1acd22[_0x40f002[_0x17ee('0xa9')]]=_0x402e70[_0xedd714][_0x17ee('0x9')];_0x3c6536['push'](_0x1acd22);}else{if(!_0x59d907[_0x17ee('0x87')]['id'])_0x59d907[_0x17ee('0x87')]['id']=[];_0x402e70[_0xedd714][_0x17ee('0x9')][_0x17ee('0xaa')](function(_0x1012b6){_0x59d907[_0x17ee('0x87')]['id'][_0x17ee('0x98')](_0x1012b6);});}}}if(!_['isEmpty'](_0x3c6536)){_0x59d907[_0x17ee('0x87')]=_[_0x17ee('0xa6')](_0x59d907[_0x17ee('0x87')],{'$and':{'$or':_0x3c6536}});}_0x59d907=_['merge']({},_0x59d907,_0x42a6b4[_0x17ee('0xab')]);if(_0x1600c7&&!_0x1600c7[_0x17ee('0x99')]&&_0x38087a[_0x17ee('0x12')]===_0x17ee('0xd')){if(_0x42a6b4[_0x17ee('0x89')]['includeAll']){_0x59d907[_0x17ee('0xac')]=[{'all':!![]}];}return _0x1790ff[_0x38087a['childModel']][_0x17ee('0x5')](_0x59d907)[_0x17ee('0x6')](function(_0x3571a8){var _0x17e2f3=[];_0x3571a8[_0x17ee('0xaa')](function(_0x26d5ba){var _0x26ef1f;switch(_0x26d5ba['reportType']){case _0x17ee('0xad'):_0x26ef1f=_[_0x17ee('0x93')](_0x1600c7[_0x17ee('0x9')],function(_0x14a66f){return _0x14a66f['id']===_0x26d5ba[_0x17ee('0xae')]&&_0x14a66f['type']===_0x17ee('0xaf');});break;case _0x17ee('0xb0'):_0x26ef1f=_['find'](_0x1600c7[_0x17ee('0x9')],function(_0x25a4b9){return _0x25a4b9['id']===_0x26d5ba[_0x17ee('0xae')]&&_0x25a4b9[_0x17ee('0xf')]==='CustomReports';});break;}if(_0x26ef1f)_0x17e2f3[_0x17ee('0x98')](_0x26d5ba);});_0x135c29['count']=_0x17e2f3[_0x17ee('0x97')];_0x135c29[_0x17ee('0xb1')]=_0x17e2f3;return _0x135c29;});}else{return _0x1790ff[_0x38087a[_0x17ee('0x12')]][_0x17ee('0xb2')]({'where':_0x59d907[_0x17ee('0x87')]})[_0x17ee('0x6')](function(_0x4e89ee){_0x135c29[_0x17ee('0xb2')]=_0x4e89ee;if(_0x42a6b4[_0x17ee('0x89')][_0x17ee('0xb3')]){if(_0x38087a[_0x17ee('0x12')]===_0x17ee('0x1d')){_0x59d907[_0x17ee('0xac')]=[{'model':_0x1790ff[_0x17ee('0xb4')],'as':_0x17ee('0xb5'),'attributes':['id',_0x17ee('0x19'),_0x17ee('0xb6')],'required':_0x42a6b4[_0x17ee('0x89')][_0x17ee('0xb7')]?!![]:![]},{'model':_0x1790ff[_0x17ee('0xb4')],'as':'ThroughTags','attributes':['id','name',_0x17ee('0xb6')],'through':_0x42a6b4[_0x17ee('0x89')][_0x17ee('0xb7')]?{'attributes':[],'where':{'TagId':_0x42a6b4[_0x17ee('0x89')][_0x17ee('0xb7')]||undefined}}:{},'required':_0x42a6b4['query'][_0x17ee('0xb7')]?!![]:![]}];}else{_0x59d907[_0x17ee('0xac')]=[{'all':!![]}];}}return _0x1790ff[_0x38087a[_0x17ee('0x12')]][_0x17ee('0x5')](_0x59d907);})[_0x17ee('0x6')](function(_0x2bdf47){_0x135c29[_0x17ee('0xb1')]=_0x2bdf47;if(_0x16cd1b===_0x17ee('0x2e')&&_0x42a6b4[_0x17ee('0x89')][_0x17ee('0xb8')]===_0x17ee('0xb9')){var _0x50daad=[];for(var _0x3801b6=0x0;_0x3801b6<_0x135c29[_0x17ee('0xb1')]['length'];_0x3801b6++){_0x50daad[_0x17ee('0x98')](_0x1f860d(_0x17ee('0xba'),_0x135c29['rows'][_0x3801b6][_0x17ee('0xbb')]));_0x50daad['push'](_0x1f860d(_0x17ee('0xbc'),_0x135c29[_0x17ee('0xb1')][_0x3801b6][_0x17ee('0xbb')]));_0x50daad[_0x17ee('0x98')](_0x1f860d('fax',_0x135c29[_0x17ee('0xb1')][_0x3801b6][_0x17ee('0xbb')]));_0x50daad[_0x17ee('0x98')](_0x1f860d('mail',_0x135c29[_0x17ee('0xb1')][_0x3801b6]['dataValues']));_0x50daad[_0x17ee('0x98')](_0x1f860d(_0x17ee('0xbd'),_0x135c29[_0x17ee('0xb1')][_0x3801b6][_0x17ee('0xbb')]));_0x50daad['push'](_0x1f860d(_0x17ee('0xbe'),_0x135c29[_0x17ee('0xb1')][_0x3801b6][_0x17ee('0xbb')]));}return Promise[_0x17ee('0x9a')](_0x50daad)[_0x17ee('0x6')](function(){return _0x135c29;});}return _0x135c29;});}});}}});}; \ No newline at end of file +var _0x1261=['FaxQueue','faxaccounts','inboundroutes','internalroutes','outboundroutes','contexts','VoiceContext','voicemails','voicerecordings','VoiceRecording','membername','User','agent','Telephones','role','telephone','VoiceQueues','VoiceQueue','inbound','QueueCampaigns','queue','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','VoicePrefix','ivrcampaigns','Campaign','MailQueue','mailaccounts','MailAccount','mailsubstatuses','OpenchannelQueue','OpenchannelAccount','smsqueues','SmsAccount','whatsappqueues','WhatsappQueue','teams','Team','queuecampaigns','users','telephones','Users','admin','Agents','ZendeskAccount','SalesforceAccount','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','CannedAnswer','Disposition','customdashboards','intervals','Interval','pauses','Pause','scheduler','Sound','tags','Tag','templates','Template','triggers','Trigger','trunks','Trunk','variables','Variable','plugins','Plugin','reportId','metrics','AnalyticMetric','charAt','toUpperCase','slice','Sequelize','QueryTypes','SELECT','select','ui.','ui.createdAt','user_has_','where','ui.UserId\x20=\x20?','query','toString','OpenTabs','define','UserProfile','user_profiles','section','mergeResources','isEmpty','length','push','UserProfileSection','params','all','ignore','find','autoAssociation','rawAttributes','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','order','sort','pick','merge','key','VIRTUAL','foreignKey','options','includeAll','include','forEach','reportType','default','custom','count','Tags','tag','ThroughTags','color','rows','true','chat','dataValues','sms','fax','whatsapp','./userProfile.attributes','../../components/parsers/qs','squel','exports','models','filter','field','value','findAll','then','associatedResources','map','catch','model','name','AnalyticExtractedReport','type','squareprojects','childModel','SquareProject','odbc','SquareOdbc','squarerecordings','parentSections','SquareProjects','JscriptyProject','CmContact','Lists','lists','CmList','CmCustomField','chatqueues','chatwebsites','faxqueues'];(function(_0xfec9d0,_0x12ce18){var _0x5769d1=function(_0x142242){while(--_0x142242){_0xfec9d0['push'](_0xfec9d0['shift']());}};_0x5769d1(++_0x12ce18);}(_0x1261,0x144));var _0x1126=function(_0x38dbb5,_0x427be1){_0x38dbb5=_0x38dbb5-0x0;var _0x34bd46=_0x1261[_0x38dbb5];return _0x34bd46;};'use strict';var _=require('lodash');var attributes=require(_0x1126('0x0'));var qs=require(_0x1126('0x1'));var squel=require(_0x1126('0x2'));module[_0x1126('0x3')]=function(_0x39b786){var _0x350f3a=_0x39b786[_0x1126('0x4')];function _0x4245ca(_0x21a480,_0x75a851){return new Promise(function(_0x5a2189,_0x5c68c8){if(!_0x75a851)return _0x5a2189(null);var _0x40ba58=_0x75a851[_0x1126('0x5')]?{[_0x75a851['filter'][_0x1126('0x6')]]:_0x75a851[_0x1126('0x5')][_0x1126('0x7')]}:undefined;return _0x350f3a[_0x21a480][_0x1126('0x8')]({'where':_0x40ba58,'raw':!![]})[_0x1126('0x9')](function(_0x59cfa1){_0x75a851[_0x1126('0xa')]=_[_0x1126('0xb')](_0x59cfa1,'id');_0x5a2189(_0x75a851);})[_0x1126('0xc')](function(_0x5e72e2){_0x5c68c8(_0x5e72e2);});});}function _0x34571c(_0x5d581b,_0x52ef15){return new Promise(function(_0x15c071,_0x561b93){var _0x15e89b=_0x5d581b[_0x1126('0x5')]?{[_0x5d581b[_0x1126('0x5')][_0x1126('0x6')]]:_0x5d581b[_0x1126('0x5')][_0x1126('0x7')]}:undefined;return _0x350f3a[_0x5d581b[_0x1126('0xd')]][_0x1126('0x8')]({'where':_0x15e89b,'raw':!![]})[_0x1126('0x9')](function(_0x53a8f0){_0x52ef15['associatedResources']=_[_0x1126('0xb')](_0x53a8f0,function(_0x154e20){return _0x154e20[_0x1126('0xe')];});_0x15c071(_0x52ef15);})['catch'](function(_0x45149c){_0x561b93(_0x45149c);});});}function _0x4794a7(_0x35fe9f,_0x42f379,_0x257b5f){if(!_0x42f379)return Promise['resolve'](null);return new Promise(function(_0x245cd7,_0x1695f6){return _0x350f3a['UserProfileResource']['findAll']({'where':{'sectionId':_0x42f379['id']},'raw':!![]})[_0x1126('0x9')](function(_0x2b2487){if(_0x35fe9f['field']&&_0x35fe9f['field']!=='id'){_0x42f379[_0x1126('0xa')]=_['map'](_0x2b2487,function(_0x22ed37){return _0x22ed37[_0x35fe9f[_0x1126('0x6')]];});}else{if(_0x257b5f===_0x1126('0xf')){_0x42f379['associatedResources']=_[_0x1126('0xb')](_0x2b2487,function(_0x49d209){return{'id':_0x49d209['resourceId'],'type':_0x49d209[_0x1126('0x10')]};});}else{_0x42f379[_0x1126('0xa')]=_[_0x1126('0xb')](_0x2b2487,function(_0x36d254){return _0x36d254['resourceId'];});}}_0x245cd7(_0x42f379);})[_0x1126('0xc')](function(_0x477e6a){_0x1695f6(_0x477e6a);});});}function _0x48a08d(_0x2175fa,_0x59cd8e){var _0x529dd9={'parentSections':[]};switch(_0x2175fa['toLowerCase']()){case _0x1126('0x11'):_0x529dd9[_0x1126('0x12')]=_0x1126('0x13');break;case _0x1126('0x14'):_0x529dd9[_0x1126('0x12')]=_0x1126('0x15');break;case _0x1126('0x16'):_0x529dd9[_0x1126('0x12')]='SquareRecording';_0x529dd9[_0x1126('0x17')]=[{'name':_0x1126('0x18'),'field':_0x1126('0xe'),'foreignKey':'projectName'}];break;case'projects':_0x529dd9[_0x1126('0x12')]=_0x1126('0x19');break;case'contacts':_0x529dd9[_0x1126('0x12')]=_0x1126('0x1a');_0x529dd9['parentSections']=[{'name':_0x1126('0x1b'),'field':'id','foreignKey':'ListId'}];break;case _0x1126('0x1c'):_0x529dd9['childModel']=_0x1126('0x1d');break;case'companies':_0x529dd9[_0x1126('0x12')]='CmCompany';break;case'globalcustomfields':_0x529dd9['childModel']=_0x1126('0x1e');break;case _0x1126('0x1f'):_0x529dd9[_0x1126('0x12')]='ChatQueue';break;case _0x1126('0x20'):_0x529dd9[_0x1126('0x12')]='ChatWebsite';break;case _0x1126('0x21'):_0x529dd9[_0x1126('0x12')]=_0x1126('0x22');break;case _0x1126('0x23'):_0x529dd9['childModel']='FaxAccount';break;case _0x1126('0x24'):case _0x1126('0x25'):case _0x1126('0x26'):_0x529dd9[_0x1126('0x12')]='VoiceExtension';break;case _0x1126('0x27'):_0x529dd9[_0x1126('0x12')]=_0x1126('0x28');break;case _0x1126('0x29'):_0x529dd9[_0x1126('0x12')]='VoiceMail';break;case _0x1126('0x2a'):_0x529dd9[_0x1126('0x12')]=_0x1126('0x2b');_0x529dd9[_0x1126('0x17')]=[{'name':'Agents','field':'name','foreignKey':_0x1126('0x2c'),'model':_0x1126('0x2d'),'filter':{'field':'role','value':[_0x1126('0x2e')]}},{'name':_0x1126('0x2f'),'field':_0x1126('0xe'),'foreignKey':'membername','model':'User','filter':{'field':_0x1126('0x30'),'value':[_0x1126('0x31')]}},{'name':_0x1126('0x32'),'field':_0x1126('0xe'),'foreignKey':'queue','model':_0x1126('0x33'),'filter':{'field':'type','value':[_0x1126('0x34')]}},{'name':_0x1126('0x35'),'field':_0x1126('0xe'),'foreignKey':_0x1126('0x36'),'model':_0x1126('0x33'),'filter':{'field':'type','value':[_0x1126('0x37')]}}];break;case _0x1126('0x38'):_0x529dd9[_0x1126('0x12')]=_0x1126('0x39');break;case _0x1126('0x3a'):_0x529dd9[_0x1126('0x12')]=_0x1126('0x3b');break;case'voiceprefixes':_0x529dd9[_0x1126('0x12')]=_0x1126('0x3c');break;case _0x1126('0x3d'):_0x529dd9[_0x1126('0x12')]=_0x1126('0x3e');break;case'mailqueues':_0x529dd9['childModel']=_0x1126('0x3f');break;case _0x1126('0x40'):_0x529dd9[_0x1126('0x12')]=_0x1126('0x41');break;case _0x1126('0x42'):_0x529dd9[_0x1126('0x12')]='MailSubstatus';break;case'openchannelqueues':_0x529dd9['childModel']=_0x1126('0x43');break;case'openchannelaccounts':_0x529dd9[_0x1126('0x12')]=_0x1126('0x44');break;case _0x1126('0x45'):_0x529dd9[_0x1126('0x12')]='SmsQueue';break;case'smsaccounts':_0x529dd9[_0x1126('0x12')]=_0x1126('0x46');break;case _0x1126('0x47'):_0x529dd9['childModel']=_0x1126('0x48');break;case'whatsappaccounts':_0x529dd9[_0x1126('0x12')]='WhatsappAccount';break;case _0x1126('0x49'):_0x529dd9[_0x1126('0x12')]=_0x1126('0x4a');break;case'voicequeues':case _0x1126('0x4b'):_0x529dd9[_0x1126('0x12')]=_0x1126('0x33');if(_0x59cd8e){_0x529dd9['parentSections']=[{'name':'VoiceQueues'},{'name':'QueueCampaigns'}];}break;case _0x1126('0x4c'):case'agents':case _0x1126('0x4d'):_0x529dd9['childModel']=_0x1126('0x2d');if(_0x59cd8e){_0x529dd9[_0x1126('0x17')]=[{'name':_0x1126('0x4e'),'filter':{'field':_0x1126('0x30'),'value':[_0x1126('0x4f'),'user']},'ignore':!![]},{'name':_0x1126('0x50')},{'name':_0x1126('0x2f')}];}break;case'zendeskaccounts':_0x529dd9[_0x1126('0x12')]=_0x1126('0x51');break;case'salesforceaccounts':_0x529dd9[_0x1126('0x12')]=_0x1126('0x52');break;case'freshdeskaccounts':_0x529dd9[_0x1126('0x12')]=_0x1126('0x53');break;case _0x1126('0x54'):_0x529dd9['childModel']=_0x1126('0x55');break;case _0x1126('0x56'):_0x529dd9[_0x1126('0x12')]=_0x1126('0x57');break;case _0x1126('0x58'):_0x529dd9[_0x1126('0x12')]=_0x1126('0x59');break;case _0x1126('0x5a'):_0x529dd9['childModel']=_0x1126('0x2d');break;case'cannedanswers':_0x529dd9[_0x1126('0x12')]=_0x1126('0x5b');break;case'dispositions':_0x529dd9['childModel']=_0x1126('0x5c');break;case _0x1126('0x5d'):_0x529dd9[_0x1126('0x12')]='Dashboard';break;case _0x1126('0x5e'):_0x529dd9[_0x1126('0x12')]=_0x1126('0x5f');break;case _0x1126('0x60'):_0x529dd9['childModel']=_0x1126('0x61');break;case _0x1126('0x62'):_0x529dd9['childModel']='Schedule';break;case'sounds':_0x529dd9['childModel']=_0x1126('0x63');break;case _0x1126('0x64'):_0x529dd9['childModel']=_0x1126('0x65');break;case _0x1126('0x66'):_0x529dd9[_0x1126('0x12')]=_0x1126('0x67');break;case _0x1126('0x68'):_0x529dd9['childModel']=_0x1126('0x69');break;case _0x1126('0x6a'):_0x529dd9['childModel']=_0x1126('0x6b');break;case _0x1126('0x6c'):_0x529dd9[_0x1126('0x12')]=_0x1126('0x6d');break;case _0x1126('0x6e'):_0x529dd9['childModel']=_0x1126('0x6f');break;case'extractedreports':_0x529dd9[_0x1126('0x12')]=_0x1126('0xf');_0x529dd9[_0x1126('0x17')]=[{'name':'Reports','field':'id','foreignKey':_0x1126('0x70')}];break;case _0x1126('0x71'):_0x529dd9['childModel']=_0x1126('0x72');break;}return _0x529dd9;}function _0x25038f(_0x9bad53,_0x5a5340){var _0x2fe6dc=_0x9bad53[_0x1126('0x73')](0x0)[_0x1126('0x74')]()+_0x9bad53[_0x1126('0x75')](0x1);var _0x128c94={'type':_0x350f3a[_0x1126('0x76')][_0x1126('0x77')][_0x1126('0x78')],'raw':!![]};return new Promise(function(_0x47e53d,_0x2b23e3){var _0x2db45e=squel[_0x1126('0x79')]()[_0x1126('0x6')](_0x1126('0x7a')+_0x2fe6dc+'InteractionId','id')[_0x1126('0x6')](_0x1126('0x7b'))['from'](_0x1126('0x7c')+_0x9bad53+'_interactions','ui')[_0x1126('0x7d')](_0x1126('0x7e'),_0x5a5340['id']);return _0x350f3a['sequelize'][_0x1126('0x7f')](_0x2db45e[_0x1126('0x80')](),_0x128c94)[_0x1126('0x9')](function(_0x592960){_0x5a5340[_0x2fe6dc+_0x1126('0x81')]=_0x592960;_0x47e53d(_0x592960);})['catch'](function(_0x558b6e){_0x2b23e3(_0x558b6e);});});}return _0x39b786[_0x1126('0x82')](_0x1126('0x83'),attributes,{'tableName':_0x1126('0x84'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x1230e9){var _0x3a76ec={'raw':![],'where':{}};var _0x1b4ebf={};var _0x1a0e26={'count':0x0,'rows':[]};var _0x5036d4=_0x1230e9[_0x1126('0x7f')][_0x1126('0x85')];var _0x116867=_0x1230e9[_0x1126('0x7f')][_0x1126('0x86')]||![];var _0x3cd788=_0x48a08d(_0x5036d4,_0x116867);if(!_0x3cd788['childModel'])throw new Error('Invalid\x20section\x20\x27'+_0x5036d4+'\x27');var _0x16a343=[{'name':_0x5036d4}];if(!_[_0x1126('0x87')](_0x3cd788['parentSections']))_0x16a343=_0x3cd788['parentSections'];var _0x5e9260=[];for(var _0x51a28d=0x0;_0x51a28d<_0x16a343[_0x1126('0x88')];_0x51a28d++){_0x5e9260[_0x1126('0x89')](_0x350f3a[_0x1126('0x8a')]['find']({'where':{'userProfileId':_0x1230e9[_0x1126('0x8b')]['id'],'name':_0x16a343[_0x51a28d][_0x1126('0xe')]},'raw':!![]}));}return Promise[_0x1126('0x8c')](_0x5e9260)[_0x1126('0x9')](function(_0x22d403){var _0x3f007b=_[_0x1126('0x5')](_0x22d403,function(_0x49a0a3){return _0x49a0a3?_0x49a0a3:undefined;});var _0x339aa6=_[_0x1126('0x5')](_0x16a343,[_0x1126('0x8d'),!![]]);var _0xd8171c=_[_0x1126('0x87')](_0x3f007b)&&_['isEmpty'](_0x339aa6)?null:_['union'](_0x339aa6,_0x3f007b);if(!_0xd8171c)return null;var _0x15cf3d=[];for(var _0x2643d7=0x0;_0x2643d7<_0xd8171c['length'];_0x2643d7++){var _0x3bf25d=_[_0x1126('0x8e')](_0x16a343,function(_0x366675){return _0xd8171c[_0x2643d7]?_0x366675[_0x1126('0xe')]===_0xd8171c[_0x2643d7][_0x1126('0xe')]:null;});if(_0x3bf25d){if(_0xd8171c[_0x2643d7][_0x1126('0x8d')]){_0x15cf3d[_0x1126('0x89')](_0x4245ca(_0x3cd788[_0x1126('0x12')],_0xd8171c[_0x2643d7]));}else{if(!_0xd8171c[_0x2643d7][_0x1126('0x8f')]){_0x15cf3d[_0x1126('0x89')](_0x4794a7(_0x3bf25d,_0xd8171c[_0x2643d7],_0x3cd788[_0x1126('0x12')]));}else{if(_0x3bf25d[_0x1126('0xd')]){_0x15cf3d[_0x1126('0x89')](_0x34571c(_0x3bf25d,_0xd8171c[_0x2643d7]));}}}}}return Promise['all'](_0x15cf3d);})[_0x1126('0x9')](function(_0x274343){var _0x2b61ae=_0x274343;var _0x53ea9a=null;if(_0x2b61ae){_0x53ea9a=_0x2b61ae['length']===0x1?_0x2b61ae[0x0]:null;}if(!_0x53ea9a&&!_0x2b61ae)return _0x1a0e26;var _0xe22fd2=_0x350f3a[_0x3cd788[_0x1126('0x12')]][_0x1126('0x90')];_0x1b4ebf[_0x1126('0xd')]=_['keys'](_0xe22fd2);_0x1b4ebf['query']=_['keys'](_0x1230e9[_0x1126('0x7f')]);_0x1b4ebf[_0x1126('0x91')]=_[_0x1126('0x92')](_0x1b4ebf[_0x1126('0xd')],_0x1b4ebf['query']);_0x3a76ec[_0x1126('0x93')]=_['intersection'](_0x1b4ebf[_0x1126('0xd')],qs[_0x1126('0x94')](_0x1230e9[_0x1126('0x7f')][_0x1126('0x94')]));_0x3a76ec[_0x1126('0x93')]=_0x3a76ec[_0x1126('0x93')][_0x1126('0x88')]?_0x3a76ec['attributes']:_0x1b4ebf[_0x1126('0xd')];if(!_0x1230e9['query'][_0x1126('0x95')](_0x1126('0x96'))){_0x3a76ec['limit']=qs[_0x1126('0x97')](_0x1230e9[_0x1126('0x7f')]['limit']);_0x3a76ec[_0x1126('0x98')]=qs[_0x1126('0x98')](_0x1230e9['query']['offset']);}_0x3a76ec[_0x1126('0x99')]=qs[_0x1126('0x9a')](_0x1230e9[_0x1126('0x7f')]['sort']);_0x3a76ec['where']=qs['filters'](_[_0x1126('0x9b')](_0x1230e9['query'],_0x1b4ebf['filters']));if(_0x1230e9[_0x1126('0x7f')]['filter']){_0x3a76ec[_0x1126('0x7d')]=_[_0x1126('0x9c')](_0x3a76ec['where'],{'$or':_[_0x1126('0xb')](_0xe22fd2,function(_0x375728){if(_0x375728[_0x1126('0x10')][_0x1126('0x9d')]!==_0x1126('0x9e')){var _0x5e9872={};_0x5e9872[_0x375728[_0x1126('0x6')]]={'$like':'%'+_0x1230e9[_0x1126('0x7f')]['filter']+'%'};return _0x5e9872;}})});}var _0xd182b1=[];var _0x2d6fcf=null;var _0x2c0908={};if(_0x53ea9a){_0x2d6fcf=_[_0x1126('0x8e')](_0x16a343,[_0x1126('0xe'),_0x53ea9a[_0x1126('0xe')]]);if(_0x2d6fcf[_0x1126('0x6')]){_0x2c0908={};if(_0x3cd788[_0x1126('0x12')]===_0x1126('0xf')){_0x2c0908[_0x2d6fcf[_0x1126('0x9f')]]=_[_0x1126('0xb')](_0x53ea9a[_0x1126('0xa')],'id');}else{_0x2c0908[_0x2d6fcf[_0x1126('0x9f')]]=_0x53ea9a[_0x1126('0xa')];}_0xd182b1[_0x1126('0x89')](_0x2c0908);}else{_0x3a76ec[_0x1126('0x7d')]['id']=_0x53ea9a['associatedResources'];}}else{for(var _0x31cfb5=0x0;_0x31cfb5<_0x2b61ae[_0x1126('0x88')];_0x31cfb5++){_0x2d6fcf=_[_0x1126('0x8e')](_0x16a343,[_0x1126('0xe'),_0x2b61ae[_0x31cfb5][_0x1126('0xe')]]);if(_0x2d6fcf['field']){_0x2c0908={};_0x2c0908[_0x2d6fcf[_0x1126('0x9f')]]=_0x2b61ae[_0x31cfb5]['associatedResources'];_0xd182b1['push'](_0x2c0908);}else{if(!_0x3a76ec[_0x1126('0x7d')]['id'])_0x3a76ec[_0x1126('0x7d')]['id']=[];_0x2b61ae[_0x31cfb5]['associatedResources']['forEach'](function(_0xaada05){_0x3a76ec[_0x1126('0x7d')]['id'][_0x1126('0x89')](_0xaada05);});}}}if(!_[_0x1126('0x87')](_0xd182b1)){_0x3a76ec[_0x1126('0x7d')]=_[_0x1126('0x9c')](_0x3a76ec[_0x1126('0x7d')],{'$and':{'$or':_0xd182b1}});}_0x3a76ec=_[_0x1126('0x9c')]({},_0x3a76ec,_0x1230e9[_0x1126('0xa0')]);if(_0x53ea9a&&!_0x53ea9a['autoAssociation']&&_0x3cd788[_0x1126('0x12')]===_0x1126('0xf')){if(_0x1230e9[_0x1126('0x7f')][_0x1126('0xa1')]){_0x3a76ec[_0x1126('0xa2')]=[{'all':!![]}];}return _0x350f3a[_0x3cd788[_0x1126('0x12')]]['findAll'](_0x3a76ec)[_0x1126('0x9')](function(_0x2cc4c8){var _0x194b3c=[];_0x2cc4c8[_0x1126('0xa3')](function(_0x12cdc6){var _0x1796eb;switch(_0x12cdc6[_0x1126('0xa4')]){case _0x1126('0xa5'):_0x1796eb=_[_0x1126('0x8e')](_0x53ea9a[_0x1126('0xa')],function(_0x5d6edb){return _0x5d6edb['id']===_0x12cdc6['reportId']&&_0x5d6edb[_0x1126('0x10')]==='DefaultReports';});break;case _0x1126('0xa6'):_0x1796eb=_['find'](_0x53ea9a[_0x1126('0xa')],function(_0x5059d3){return _0x5059d3['id']===_0x12cdc6[_0x1126('0x70')]&&_0x5059d3['type']==='CustomReports';});break;}if(_0x1796eb)_0x194b3c['push'](_0x12cdc6);});_0x1a0e26[_0x1126('0xa7')]=_0x194b3c[_0x1126('0x88')];_0x1a0e26['rows']=_0x194b3c;return _0x1a0e26;});}else{return _0x350f3a[_0x3cd788['childModel']][_0x1126('0xa7')]({'where':_0x3a76ec[_0x1126('0x7d')]})[_0x1126('0x9')](function(_0x5dfb8f){_0x1a0e26['count']=_0x5dfb8f;if(_0x1230e9[_0x1126('0x7f')]['includeAll']){if(_0x3cd788[_0x1126('0x12')]===_0x1126('0x1a')){_0x3a76ec[_0x1126('0xa2')]=[{'model':_0x350f3a[_0x1126('0x65')],'as':_0x1126('0xa8'),'attributes':['id','name','color'],'required':_0x1230e9[_0x1126('0x7f')][_0x1126('0xa9')]?!![]:![]},{'model':_0x350f3a[_0x1126('0x65')],'as':_0x1126('0xaa'),'attributes':['id',_0x1126('0xe'),_0x1126('0xab')],'through':_0x1230e9[_0x1126('0x7f')][_0x1126('0xa9')]?{'attributes':[],'where':{'TagId':_0x1230e9[_0x1126('0x7f')][_0x1126('0xa9')]||undefined}}:{},'required':_0x1230e9[_0x1126('0x7f')]['tag']?!![]:![]}];}else{_0x3a76ec[_0x1126('0xa2')]=[{'all':!![]}];}}return _0x350f3a[_0x3cd788['childModel']][_0x1126('0x8')](_0x3a76ec);})['then'](function(_0x4256e6){_0x1a0e26[_0x1126('0xac')]=_0x4256e6;if(_0x5036d4===_0x1126('0x50')&&_0x1230e9[_0x1126('0x7f')]['openTabs']===_0x1126('0xad')){var _0x834360=[];for(var _0x4b5d46=0x0;_0x4b5d46<_0x1a0e26['rows'][_0x1126('0x88')];_0x4b5d46++){_0x834360[_0x1126('0x89')](_0x25038f(_0x1126('0xae'),_0x1a0e26['rows'][_0x4b5d46][_0x1126('0xaf')]));_0x834360['push'](_0x25038f(_0x1126('0xb0'),_0x1a0e26[_0x1126('0xac')][_0x4b5d46]['dataValues']));_0x834360[_0x1126('0x89')](_0x25038f(_0x1126('0xb1'),_0x1a0e26[_0x1126('0xac')][_0x4b5d46][_0x1126('0xaf')]));_0x834360[_0x1126('0x89')](_0x25038f('mail',_0x1a0e26[_0x1126('0xac')][_0x4b5d46][_0x1126('0xaf')]));_0x834360[_0x1126('0x89')](_0x25038f('openchannel',_0x1a0e26['rows'][_0x4b5d46]['dataValues']));_0x834360[_0x1126('0x89')](_0x25038f(_0x1126('0xb2'),_0x1a0e26[_0x1126('0xac')][_0x4b5d46][_0x1126('0xaf')]));}return Promise['all'](_0x834360)[_0x1126('0x9')](function(){return _0x1a0e26;});}return _0x1a0e26;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 3fc89de..60ae860 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 _0x2d72=['stringify','error','code','message','info','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./userProfile.socket','register','request','then','UserProfile,\x20%s,\x20%s','debug','UserProfile,\x20%s,\x20%s,\x20%s'];(function(_0x4df9e5,_0x4a2442){var _0x36167a=function(_0x426b11){while(--_0x426b11){_0x4df9e5['push'](_0x4df9e5['shift']());}};_0x36167a(++_0x4a2442);}(_0x2d72,0xa8));var _0x22d7=function(_0x435723,_0x5b7d82){_0x435723=_0x435723-0x0;var _0x318b18=_0x2d72[_0x435723];return _0x318b18;};'use strict';var _=require(_0x22d7('0x0'));var util=require(_0x22d7('0x1'));var moment=require(_0x22d7('0x2'));var BPromise=require(_0x22d7('0x3'));var rs=require(_0x22d7('0x4'));var fs=require('fs');var Redis=require(_0x22d7('0x5'));var db=require(_0x22d7('0x6'))['db'];var utils=require(_0x22d7('0x7'));var logger=require(_0x22d7('0x8'))(_0x22d7('0x9'));var config=require(_0x22d7('0xa'));var jayson=require(_0x22d7('0xb'));var client=jayson[_0x22d7('0xc')][_0x22d7('0xd')]({'port':0x232a});config['redis']=_[_0x22d7('0xe')](config[_0x22d7('0xf')],{'host':'localhost','port':0x18eb});var socket=require(_0x22d7('0x10'))(new Redis(config[_0x22d7('0xf')]));require(_0x22d7('0x11'))[_0x22d7('0x12')](socket);function respondWithRpcPromise(_0x49f7e1,_0x5f56eb,_0x1810b8){return new BPromise(function(_0x257c85,_0x233c0b){return client[_0x22d7('0x13')](_0x49f7e1,_0x1810b8)[_0x22d7('0x14')](function(_0x4db5dd){logger['info'](_0x22d7('0x15'),_0x5f56eb,'request\x20sent');logger[_0x22d7('0x16')](_0x22d7('0x17'),_0x5f56eb,'request\x20sent',JSON[_0x22d7('0x18')](_0x4db5dd));if(_0x4db5dd[_0x22d7('0x19')]){if(_0x4db5dd[_0x22d7('0x19')][_0x22d7('0x1a')]===0x1f4){logger[_0x22d7('0x19')](_0x22d7('0x15'),_0x5f56eb,_0x4db5dd[_0x22d7('0x19')][_0x22d7('0x1b')]);return _0x233c0b(_0x4db5dd['error'][_0x22d7('0x1b')]);}logger[_0x22d7('0x19')](_0x22d7('0x15'),_0x5f56eb,_0x4db5dd['error']['message']);return _0x257c85(_0x4db5dd['error'][_0x22d7('0x1b')]);}else{logger[_0x22d7('0x1c')](_0x22d7('0x15'),_0x5f56eb,_0x22d7('0x1d'));_0x257c85(_0x4db5dd[_0x22d7('0x1e')]['message']);}})[_0x22d7('0x1f')](function(_0x75affd){logger[_0x22d7('0x19')]('UserProfile,\x20%s,\x20%s',_0x5f56eb,_0x75affd);_0x233c0b(_0x75affd);});});} \ No newline at end of file +var _0x2272=['jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x50fca0,_0x1d1d58){var _0x2c7892=function(_0x58c5ee){while(--_0x58c5ee){_0x50fca0['push'](_0x50fca0['shift']());}};_0x2c7892(++_0x1d1d58);}(_0x2272,0xd8));var _0x2227=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x2272[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x2227('0x0'));var util=require(_0x2227('0x1'));var moment=require(_0x2227('0x2'));var BPromise=require(_0x2227('0x3'));var rs=require(_0x2227('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2227('0x5'))['db'];var utils=require(_0x2227('0x6'));var logger=require(_0x2227('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2227('0x8'));var client=jayson[_0x2227('0x9')][_0x2227('0xa')]({'port':0x232a});config[_0x2227('0xb')]=_[_0x2227('0xc')](config[_0x2227('0xb')],{'host':_0x2227('0xd'),'port':0x18eb});var socket=require(_0x2227('0xe'))(new Redis(config[_0x2227('0xb')]));require(_0x2227('0xf'))['register'](socket);function respondWithRpcPromise(_0x799370,_0x5c1cba,_0x2f66ca){return new BPromise(function(_0x2d1c39,_0x164735){return client[_0x2227('0x10')](_0x799370,_0x2f66ca)[_0x2227('0x11')](function(_0x51ed54){logger[_0x2227('0x12')](_0x2227('0x13'),_0x5c1cba,_0x2227('0x14'));logger[_0x2227('0x15')](_0x2227('0x16'),_0x5c1cba,_0x2227('0x14'),JSON['stringify'](_0x51ed54));if(_0x51ed54['error']){if(_0x51ed54['error'][_0x2227('0x17')]===0x1f4){logger['error'](_0x2227('0x13'),_0x5c1cba,_0x51ed54[_0x2227('0x18')]['message']);return _0x164735(_0x51ed54[_0x2227('0x18')][_0x2227('0x19')]);}logger[_0x2227('0x18')](_0x2227('0x13'),_0x5c1cba,_0x51ed54[_0x2227('0x18')][_0x2227('0x19')]);return _0x2d1c39(_0x51ed54['error'][_0x2227('0x19')]);}else{logger[_0x2227('0x12')](_0x2227('0x13'),_0x5c1cba,'request\x20sent');_0x2d1c39(_0x51ed54[_0x2227('0x1a')][_0x2227('0x19')]);}})[_0x2227('0x1b')](function(_0x2482ba){logger[_0x2227('0x18')](_0x2227('0x13'),_0x5c1cba,_0x2482ba);_0x164735(_0x2482ba);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 00c033d..4f577c0 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 _0x7e2b=['removeListener','register','length','userProfile:','save','remove','update','emit'];(function(_0x4b784d,_0x5efb2f){var _0x2cdeaf=function(_0x106242){while(--_0x106242){_0x4b784d['push'](_0x4b784d['shift']());}};_0x2cdeaf(++_0x5efb2f);}(_0x7e2b,0x15c));var _0xb7e2=function(_0x509d2e,_0x307fde){_0x509d2e=_0x509d2e-0x0;var _0x292a85=_0x7e2b[_0x509d2e];return _0x292a85;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0xb7e2('0x0'),_0xb7e2('0x1'),_0xb7e2('0x2')];function createListener(_0x373610,_0x8dba09){return function(_0x2bc37e){_0x8dba09[_0xb7e2('0x3')](_0x373610,_0x2bc37e);};}function removeListener(_0x19207d,_0x42dfaf){return function(){UserProfileEvents[_0xb7e2('0x4')](_0x19207d,_0x42dfaf);};}exports[_0xb7e2('0x5')]=function(_0x4ea9a2){for(var _0x1ae8da=0x0,_0xf3f94f=events[_0xb7e2('0x6')];_0x1ae8da<_0xf3f94f;_0x1ae8da++){var _0x1fdd87=events[_0x1ae8da];var _0x56fe3d=createListener(_0xb7e2('0x7')+_0x1fdd87,_0x4ea9a2);UserProfileEvents['on'](_0x1fdd87,_0x56fe3d);}}; \ No newline at end of file +var _0xb4f3=['removeListener','register','userProfile:','./userProfile.events','save','emit'];(function(_0x1c45f9,_0x1fb92f){var _0xa0ccd2=function(_0x2cbc2b){while(--_0x2cbc2b){_0x1c45f9['push'](_0x1c45f9['shift']());}};_0xa0ccd2(++_0x1fb92f);}(_0xb4f3,0xe1));var _0x3b4f=function(_0x1d1d91,_0x1050d6){_0x1d1d91=_0x1d1d91-0x0;var _0x1fde23=_0xb4f3[_0x1d1d91];return _0x1fde23;};'use strict';var UserProfileEvents=require(_0x3b4f('0x0'));var events=[_0x3b4f('0x1'),'remove','update'];function createListener(_0x355744,_0x46ca93){return function(_0x4ef3ee){_0x46ca93[_0x3b4f('0x2')](_0x355744,_0x4ef3ee);};}function removeListener(_0x3d6f1a,_0x2563c4){return function(){UserProfileEvents[_0x3b4f('0x3')](_0x3d6f1a,_0x2563c4);};}exports[_0x3b4f('0x4')]=function(_0x463cb7){for(var _0x26bd6f=0x0,_0x22d491=events['length'];_0x26bd6f<_0x22d491;_0x26bd6f++){var _0x55f2f4=events[_0x26bd6f];var _0x128e72=createListener(_0x3b4f('0x5')+_0x55f2f4,_0x463cb7);UserProfileEvents['on'](_0x55f2f4,_0x128e72);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index d5f9feb..3dedad8 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 _0x4c19=['/:id','show','post','create','put','delete','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./userProfileResource.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x2e750b,_0x466bbb){var _0xf09152=function(_0x20c8ec){while(--_0x20c8ec){_0x2e750b['push'](_0x2e750b['shift']());}};_0xf09152(++_0x466bbb);}(_0x4c19,0x1e1));var _0x94c1=function(_0x284cae,_0x740c45){_0x284cae=_0x284cae-0x0;var _0x15c5b7=_0x4c19[_0x284cae];return _0x15c5b7;};'use strict';var multer=require(_0x94c1('0x0'));var util=require('util');var path=require(_0x94c1('0x1'));var timeout=require(_0x94c1('0x2'));var express=require(_0x94c1('0x3'));var router=express[_0x94c1('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x94c1('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x94c1('0x6'));var controller=require(_0x94c1('0x7'));router[_0x94c1('0x8')]('/',auth[_0x94c1('0x9')](),controller[_0x94c1('0xa')]);router[_0x94c1('0x8')](_0x94c1('0xb'),auth[_0x94c1('0x9')](),controller[_0x94c1('0xc')]);router['get'](_0x94c1('0xd'),auth[_0x94c1('0x9')](),controller[_0x94c1('0xe')]);router[_0x94c1('0xf')]('/',auth[_0x94c1('0x9')](),controller[_0x94c1('0x10')]);router[_0x94c1('0x11')](_0x94c1('0xd'),auth[_0x94c1('0x9')](),controller['update']);router[_0x94c1('0x12')](_0x94c1('0xd'),auth[_0x94c1('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xf812=['isAuthenticated','index','/describe','describe','/:id','post','create','put','delete','destroy','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get'];(function(_0x4b31dc,_0x4e21f4){var _0x1bdbb8=function(_0x469d8c){while(--_0x469d8c){_0x4b31dc['push'](_0x4b31dc['shift']());}};_0x1bdbb8(++_0x4e21f4);}(_0xf812,0xc8));var _0x2f81=function(_0x2c8938,_0x183d38){_0x2c8938=_0x2c8938-0x0;var _0x3f42fe=_0xf812[_0x2c8938];return _0x3f42fe;};'use strict';var multer=require('multer');var util=require(_0x2f81('0x0'));var path=require(_0x2f81('0x1'));var timeout=require('connect-timeout');var express=require(_0x2f81('0x2'));var router=express[_0x2f81('0x3')]();var fs_extra=require(_0x2f81('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2f81('0x5'));var config=require(_0x2f81('0x6'));var controller=require(_0x2f81('0x7'));router[_0x2f81('0x8')]('/',auth[_0x2f81('0x9')](),controller[_0x2f81('0xa')]);router['get'](_0x2f81('0xb'),auth['isAuthenticated'](),controller[_0x2f81('0xc')]);router['get'](_0x2f81('0xd'),auth[_0x2f81('0x9')](),controller['show']);router[_0x2f81('0xe')]('/',auth[_0x2f81('0x9')](),controller[_0x2f81('0xf')]);router[_0x2f81('0x10')]('/:id',auth[_0x2f81('0x9')](),controller['update']);router[_0x2f81('0x11')](_0x2f81('0xd'),auth['isAuthenticated'](),controller[_0x2f81('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 914da62..de128be 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 _0xd460=['STRING','INTEGER','sequelize'];(function(_0x24e9fc,_0x443210){var _0x3df5fc=function(_0x381bc0){while(--_0x381bc0){_0x24e9fc['push'](_0x24e9fc['shift']());}};_0x3df5fc(++_0x443210);}(_0xd460,0xbf));var _0x0d46=function(_0x45cb89,_0x99520e){_0x45cb89=_0x45cb89-0x0;var _0x5948c1=_0xd460[_0x45cb89];return _0x5948c1;};'use strict';var Sequelize=require(_0x0d46('0x0'));module['exports']={'name':{'type':Sequelize[_0x0d46('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x0d46('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x0d46('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xcaac=['sequelize','STRING','INTEGER'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xcaac,0xfc));var _0xccaa=function(_0x580178,_0x49692e){_0x580178=_0x580178-0x0;var _0x4310d1=_0xcaac[_0x580178];return _0x4310d1;};'use strict';var Sequelize=require(_0xccaa('0x0'));module['exports']={'name':{'type':Sequelize[_0xccaa('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0xccaa('0x2')],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 012a14b..0b770e4 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 _0xc4aa=['sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','UserProfileResource','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','keys','rawAttributes','create','body','find','describe','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'];(function(_0x339129,_0x86dcc6){var _0x1570df=function(_0x3b537e){while(--_0x3b537e){_0x339129['push'](_0x339129['shift']());}};_0x1570df(++_0x86dcc6);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0xc4aa[_0x255d5b];return _0x3e141a;};'use strict';var emlformat=require(_0xac4a('0x0'));var rimraf=require(_0xac4a('0x1'));var zipdir=require(_0xac4a('0x2'));var jsonpatch=require(_0xac4a('0x3'));var rp=require(_0xac4a('0x4'));var moment=require(_0xac4a('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xac4a('0x6'));var sox=require(_0xac4a('0x7'));var csv=require(_0xac4a('0x8'));var ejs=require(_0xac4a('0x9'));var fs=require('fs');var fs_extra=require(_0xac4a('0xa'));var _=require(_0xac4a('0xb'));var squel=require(_0xac4a('0xc'));var crypto=require(_0xac4a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xac4a('0x8'));var querystring=require(_0xac4a('0xe'));var Papa=require(_0xac4a('0xf'));var Redis=require('ioredis');var authService=require(_0xac4a('0x10'));var qs=require(_0xac4a('0x11'));var as=require(_0xac4a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac4a('0x13'))('api');var utils=require(_0xac4a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xac4a('0x15'));var db=require(_0xac4a('0x16'))['db'];function respondWithStatusCode(_0x24291d,_0x5e16aa){_0x5e16aa=_0x5e16aa||0xcc;return function(_0x21a79){if(_0x21a79){return _0x24291d[_0xac4a('0x17')](_0x5e16aa);}return _0x24291d[_0xac4a('0x18')](_0x5e16aa)[_0xac4a('0x19')]();};}function respondWithResult(_0x1b4313,_0x3b71c0){_0x3b71c0=_0x3b71c0||0xc8;return function(_0x34bc01){if(_0x34bc01){return _0x1b4313[_0xac4a('0x18')](_0x3b71c0)[_0xac4a('0x1a')](_0x34bc01);}};}function respondWithFilteredResult(_0x42c7fc,_0x11e101){return function(_0x26dbb8){if(_0x26dbb8){var _0x4a2119=typeof _0x11e101[_0xac4a('0x1b')]===_0xac4a('0x1c')&&typeof _0x11e101[_0xac4a('0x1d')]===_0xac4a('0x1c');var _0x3e88e3=_0x26dbb8[_0xac4a('0x1e')];var _0x28e304=_0x4a2119?0x0:_0x11e101[_0xac4a('0x1b')];var _0x546c5d=_0x4a2119?_0x26dbb8['count']:_0x11e101[_0xac4a('0x1b')]+_0x11e101[_0xac4a('0x1d')];var _0x39b691;if(_0x546c5d>=_0x3e88e3){_0x546c5d=_0x3e88e3;_0x39b691=0xc8;}else{_0x39b691=0xce;}_0x42c7fc['status'](_0x39b691);return _0x42c7fc[_0xac4a('0x1f')](_0xac4a('0x20'),_0x28e304+'-'+_0x546c5d+'/'+_0x3e88e3)[_0xac4a('0x1a')](_0x26dbb8);}return null;};}function patchUpdates(_0x3a3cdb){return function(_0x123694){try{jsonpatch[_0xac4a('0x21')](_0x123694,_0x3a3cdb,!![]);}catch(_0xe38996){return BPromise[_0xac4a('0x22')](_0xe38996);}return _0x123694['save']();};}function saveUpdates(_0x3d8f0a,_0x3204ad){return function(_0x599787){if(_0x599787){return _0x599787[_0xac4a('0x23')](_0x3d8f0a)[_0xac4a('0x24')](function(_0x3eacd3){return _0x3eacd3;});}return null;};}function removeEntity(_0x947d8e,_0x4d2d6c){return function(_0x1b7998){if(_0x1b7998){return _0x1b7998[_0xac4a('0x25')]()[_0xac4a('0x24')](function(){_0x947d8e[_0xac4a('0x18')](0xcc)[_0xac4a('0x19')]();});}};}function handleEntityNotFound(_0x2b0dc2,_0x222507){return function(_0x36054a){if(!_0x36054a){_0x2b0dc2[_0xac4a('0x17')](0x194);}return _0x36054a;};}function handleError(_0x3bc318,_0x1d0539){_0x1d0539=_0x1d0539||0x1f4;return function(_0x215a31){logger[_0xac4a('0x26')](_0x215a31[_0xac4a('0x27')]);if(_0x215a31[_0xac4a('0x28')]){delete _0x215a31[_0xac4a('0x28')];}_0x3bc318['status'](_0x1d0539)[_0xac4a('0x29')](_0x215a31);};}exports[_0xac4a('0x2a')]=function(_0x42a33c,_0x2772fe){var _0x116700={},_0x4a5a9e={},_0x47f49c={'count':0x0,'rows':[]};var _0xdb7e=_[_0xac4a('0x2b')](db[_0xac4a('0x2c')]['rawAttributes'],function(_0x4bda1f){return{'name':_0x4bda1f[_0xac4a('0x2d')],'type':_0x4bda1f[_0xac4a('0x2e')][_0xac4a('0x2f')]};});_0x4a5a9e[_0xac4a('0x30')]=_[_0xac4a('0x2b')](_0xdb7e,'name');_0x4a5a9e[_0xac4a('0x31')]=_['keys'](_0x42a33c[_0xac4a('0x31')]);_0x4a5a9e['filters']=_[_0xac4a('0x32')](_0x4a5a9e[_0xac4a('0x30')],_0x4a5a9e[_0xac4a('0x31')]);_0x116700[_0xac4a('0x33')]=_[_0xac4a('0x32')](_0x4a5a9e[_0xac4a('0x30')],qs[_0xac4a('0x34')](_0x42a33c[_0xac4a('0x31')][_0xac4a('0x34')]));_0x116700[_0xac4a('0x33')]=_0x116700[_0xac4a('0x33')][_0xac4a('0x35')]?_0x116700[_0xac4a('0x33')]:_0x4a5a9e[_0xac4a('0x30')];if(!_0x42a33c['query'][_0xac4a('0x36')](_0xac4a('0x37'))){_0x116700['limit']=qs[_0xac4a('0x1d')](_0x42a33c[_0xac4a('0x31')]['limit']);_0x116700['offset']=qs[_0xac4a('0x1b')](_0x42a33c[_0xac4a('0x31')][_0xac4a('0x1b')]);}_0x116700[_0xac4a('0x38')]=qs['sort'](_0x42a33c[_0xac4a('0x31')][_0xac4a('0x39')]);_0x116700['where']=qs[_0xac4a('0x3a')](_[_0xac4a('0x3b')](_0x42a33c[_0xac4a('0x31')],_0x4a5a9e['filters']),_0xdb7e);if(_0x42a33c[_0xac4a('0x31')][_0xac4a('0x3c')]){_0x116700[_0xac4a('0x3d')]=_['merge'](_0x116700[_0xac4a('0x3d')],{'$or':_[_0xac4a('0x2b')](_0xdb7e,function(_0x4b9faf){if(_0x4b9faf['type']!==_0xac4a('0x3e')){var _0x5e0926={};_0x5e0926[_0x4b9faf['name']]={'$like':'%'+_0x42a33c['query']['filter']+'%'};return _0x5e0926;}})});}_0x116700=_[_0xac4a('0x3f')]({},_0x116700,_0x42a33c[_0xac4a('0x40')]);var _0x37834b={'where':_0x116700[_0xac4a('0x3d')]};return db[_0xac4a('0x2c')][_0xac4a('0x1e')](_0x37834b)[_0xac4a('0x24')](function(_0x2b16f0){_0x47f49c[_0xac4a('0x1e')]=_0x2b16f0;if(_0x42a33c[_0xac4a('0x31')][_0xac4a('0x41')]){_0x116700[_0xac4a('0x42')]=[{'all':!![]}];}return db['UserProfileResource']['findAll'](_0x116700);})['then'](function(_0x1e1cc5){_0x47f49c[_0xac4a('0x43')]=_0x1e1cc5;return _0x47f49c;})[_0xac4a('0x24')](respondWithFilteredResult(_0x2772fe,_0x116700))[_0xac4a('0x44')](handleError(_0x2772fe,null));};exports[_0xac4a('0x45')]=function(_0x411543,_0x8febf0){var _0x3441f2={'raw':![],'where':{'id':_0x411543[_0xac4a('0x46')]['id']}},_0x3e9973={};_0x3e9973['model']=_[_0xac4a('0x47')](db[_0xac4a('0x2c')][_0xac4a('0x48')]);_0x3e9973[_0xac4a('0x31')]=_[_0xac4a('0x47')](_0x411543['query']);_0x3e9973[_0xac4a('0x3a')]=_[_0xac4a('0x32')](_0x3e9973['model'],_0x3e9973[_0xac4a('0x31')]);_0x3441f2['attributes']=_[_0xac4a('0x32')](_0x3e9973[_0xac4a('0x30')],qs[_0xac4a('0x34')](_0x411543[_0xac4a('0x31')][_0xac4a('0x34')]));_0x3441f2[_0xac4a('0x33')]=_0x3441f2[_0xac4a('0x33')][_0xac4a('0x35')]?_0x3441f2[_0xac4a('0x33')]:_0x3e9973[_0xac4a('0x30')];if(_0x411543[_0xac4a('0x31')][_0xac4a('0x41')]){_0x3441f2['include']=[{'all':!![]}];}_0x3441f2=_[_0xac4a('0x3f')]({},_0x3441f2,_0x411543[_0xac4a('0x40')]);return db[_0xac4a('0x2c')]['find'](_0x3441f2)[_0xac4a('0x24')](handleEntityNotFound(_0x8febf0,null))[_0xac4a('0x24')](respondWithResult(_0x8febf0,null))['catch'](handleError(_0x8febf0,null));};exports[_0xac4a('0x49')]=function(_0x5a7f6e,_0x244950){return db[_0xac4a('0x2c')][_0xac4a('0x49')](_0x5a7f6e['body'],{})['then'](respondWithResult(_0x244950,0xc9))[_0xac4a('0x44')](handleError(_0x244950,null));};exports['update']=function(_0x18ae96,_0x566258){if(_0x18ae96[_0xac4a('0x4a')]['id']){delete _0x18ae96['body']['id'];}return db[_0xac4a('0x2c')][_0xac4a('0x4b')]({'where':{'id':_0x18ae96[_0xac4a('0x46')]['id']}})[_0xac4a('0x24')](handleEntityNotFound(_0x566258,null))['then'](saveUpdates(_0x18ae96[_0xac4a('0x4a')],null))[_0xac4a('0x24')](respondWithResult(_0x566258,null))[_0xac4a('0x44')](handleError(_0x566258,null));};exports[_0xac4a('0x25')]=function(_0x2f30e2,_0x138876){return db[_0xac4a('0x2c')]['find']({'where':{'id':_0x2f30e2[_0xac4a('0x46')]['id']}})[_0xac4a('0x24')](handleEntityNotFound(_0x138876,null))['then'](removeEntity(_0x138876,null))[_0xac4a('0x44')](handleError(_0x138876,null));};exports[_0xac4a('0x4c')]=function(_0x26e716,_0x3ac36e){return db['UserProfileResource'][_0xac4a('0x4c')]()[_0xac4a('0x24')](respondWithResult(_0x3ac36e,null))[_0xac4a('0x44')](handleError(_0x3ac36e,null));}; \ No newline at end of file +var _0xef0f=['json','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','UserProfileResource','key','model','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','params','keys','rawAttributes','find','create','body','catch','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range'];(function(_0x44106f,_0x1adbec){var _0x2e33e7=function(_0x34f33e){while(--_0x34f33e){_0x44106f['push'](_0x44106f['shift']());}};_0x2e33e7(++_0x1adbec);}(_0xef0f,0x168));var _0xfef0=function(_0x187810,_0x5e1a88){_0x187810=_0x187810-0x0;var _0x58078d=_0xef0f[_0x187810];return _0x58078d;};'use strict';var emlformat=require(_0xfef0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfef0('0x1'));var jsonpatch=require(_0xfef0('0x2'));var rp=require(_0xfef0('0x3'));var moment=require('moment');var BPromise=require(_0xfef0('0x4'));var Mustache=require(_0xfef0('0x5'));var util=require(_0xfef0('0x6'));var path=require('path');var sox=require(_0xfef0('0x7'));var csv=require(_0xfef0('0x8'));var ejs=require(_0xfef0('0x9'));var fs=require('fs');var fs_extra=require(_0xfef0('0xa'));var _=require(_0xfef0('0xb'));var squel=require(_0xfef0('0xc'));var crypto=require('crypto');var jsforce=require(_0xfef0('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xfef0('0x8'));var querystring=require(_0xfef0('0xe'));var Papa=require(_0xfef0('0xf'));var Redis=require(_0xfef0('0x10'));var authService=require(_0xfef0('0x11'));var qs=require(_0xfef0('0x12'));var as=require(_0xfef0('0x13'));var hardwareService=require(_0xfef0('0x14'));var logger=require(_0xfef0('0x15'))(_0xfef0('0x16'));var utils=require(_0xfef0('0x17'));var config=require(_0xfef0('0x18'));var licenseUtil=require(_0xfef0('0x19'));var db=require(_0xfef0('0x1a'))['db'];function respondWithStatusCode(_0x546c7a,_0x3135ab){_0x3135ab=_0x3135ab||0xcc;return function(_0x2f4e23){if(_0x2f4e23){return _0x546c7a[_0xfef0('0x1b')](_0x3135ab);}return _0x546c7a[_0xfef0('0x1c')](_0x3135ab)[_0xfef0('0x1d')]();};}function respondWithResult(_0x45599a,_0xa9f040){_0xa9f040=_0xa9f040||0xc8;return function(_0x573ae7){if(_0x573ae7){return _0x45599a[_0xfef0('0x1c')](_0xa9f040)['json'](_0x573ae7);}};}function respondWithFilteredResult(_0x4b5bcf,_0x5acdd0){return function(_0x118b8d){if(_0x118b8d){var _0x284b6d=typeof _0x5acdd0[_0xfef0('0x1e')]===_0xfef0('0x1f')&&typeof _0x5acdd0[_0xfef0('0x20')]===_0xfef0('0x1f');var _0x155833=_0x118b8d[_0xfef0('0x21')];var _0x581459=_0x284b6d?0x0:_0x5acdd0[_0xfef0('0x1e')];var _0x1642cd=_0x284b6d?_0x118b8d[_0xfef0('0x21')]:_0x5acdd0[_0xfef0('0x1e')]+_0x5acdd0[_0xfef0('0x20')];var _0x55912f;if(_0x1642cd>=_0x155833){_0x1642cd=_0x155833;_0x55912f=0xc8;}else{_0x55912f=0xce;}_0x4b5bcf[_0xfef0('0x1c')](_0x55912f);return _0x4b5bcf['set'](_0xfef0('0x22'),_0x581459+'-'+_0x1642cd+'/'+_0x155833)[_0xfef0('0x23')](_0x118b8d);}return null;};}function patchUpdates(_0x28dee1){return function(_0x48408a){try{jsonpatch[_0xfef0('0x24')](_0x48408a,_0x28dee1,!![]);}catch(_0x4c304d){return BPromise[_0xfef0('0x25')](_0x4c304d);}return _0x48408a[_0xfef0('0x26')]();};}function saveUpdates(_0x52b93b,_0x4897af){return function(_0x4b8b22){if(_0x4b8b22){return _0x4b8b22[_0xfef0('0x27')](_0x52b93b)['then'](function(_0x1f9970){return _0x1f9970;});}return null;};}function removeEntity(_0x46b34a,_0x1a8d66){return function(_0x4483f2){if(_0x4483f2){return _0x4483f2[_0xfef0('0x28')]()[_0xfef0('0x29')](function(){_0x46b34a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x316e20,_0x1ffaa4){return function(_0x924f6e){if(!_0x924f6e){_0x316e20[_0xfef0('0x1b')](0x194);}return _0x924f6e;};}function handleError(_0xab231c,_0xf60f2){_0xf60f2=_0xf60f2||0x1f4;return function(_0x5df04f){logger[_0xfef0('0x2a')](_0x5df04f[_0xfef0('0x2b')]);if(_0x5df04f['name']){delete _0x5df04f[_0xfef0('0x2c')];}_0xab231c[_0xfef0('0x1c')](_0xf60f2)[_0xfef0('0x2d')](_0x5df04f);};}exports[_0xfef0('0x2e')]=function(_0x37921f,_0x1ac4a3){var _0x3e3c4c={},_0x3e026a={},_0x26cb9a={'count':0x0,'rows':[]};var _0x213a91=_[_0xfef0('0x2f')](db[_0xfef0('0x30')]['rawAttributes'],function(_0x445625){return{'name':_0x445625['fieldName'],'type':_0x445625['type'][_0xfef0('0x31')]};});_0x3e026a[_0xfef0('0x32')]=_['map'](_0x213a91,'name');_0x3e026a['query']=_['keys'](_0x37921f['query']);_0x3e026a[_0xfef0('0x33')]=_[_0xfef0('0x34')](_0x3e026a[_0xfef0('0x32')],_0x3e026a['query']);_0x3e3c4c['attributes']=_['intersection'](_0x3e026a[_0xfef0('0x32')],qs['fields'](_0x37921f[_0xfef0('0x35')][_0xfef0('0x36')]));_0x3e3c4c[_0xfef0('0x37')]=_0x3e3c4c['attributes'][_0xfef0('0x38')]?_0x3e3c4c['attributes']:_0x3e026a[_0xfef0('0x32')];if(!_0x37921f[_0xfef0('0x35')][_0xfef0('0x39')](_0xfef0('0x3a'))){_0x3e3c4c[_0xfef0('0x20')]=qs[_0xfef0('0x20')](_0x37921f[_0xfef0('0x35')][_0xfef0('0x20')]);_0x3e3c4c['offset']=qs[_0xfef0('0x1e')](_0x37921f[_0xfef0('0x35')][_0xfef0('0x1e')]);}_0x3e3c4c[_0xfef0('0x3b')]=qs[_0xfef0('0x3c')](_0x37921f[_0xfef0('0x35')][_0xfef0('0x3c')]);_0x3e3c4c[_0xfef0('0x3d')]=qs[_0xfef0('0x33')](_[_0xfef0('0x3e')](_0x37921f[_0xfef0('0x35')],_0x3e026a[_0xfef0('0x33')]),_0x213a91);if(_0x37921f[_0xfef0('0x35')]['filter']){_0x3e3c4c[_0xfef0('0x3d')]=_['merge'](_0x3e3c4c[_0xfef0('0x3d')],{'$or':_[_0xfef0('0x2f')](_0x213a91,function(_0x1ddce6){if(_0x1ddce6['type']!==_0xfef0('0x3f')){var _0x29469e={};_0x29469e[_0x1ddce6[_0xfef0('0x2c')]]={'$like':'%'+_0x37921f['query'][_0xfef0('0x40')]+'%'};return _0x29469e;}})});}_0x3e3c4c=_[_0xfef0('0x41')]({},_0x3e3c4c,_0x37921f[_0xfef0('0x42')]);var _0x5577f4={'where':_0x3e3c4c[_0xfef0('0x3d')]};return db['UserProfileResource']['count'](_0x5577f4)[_0xfef0('0x29')](function(_0x547a5d){_0x26cb9a['count']=_0x547a5d;if(_0x37921f[_0xfef0('0x35')][_0xfef0('0x43')]){_0x3e3c4c[_0xfef0('0x44')]=[{'all':!![]}];}return db[_0xfef0('0x30')][_0xfef0('0x45')](_0x3e3c4c);})[_0xfef0('0x29')](function(_0x4dd8f8){_0x26cb9a[_0xfef0('0x46')]=_0x4dd8f8;return _0x26cb9a;})[_0xfef0('0x29')](respondWithFilteredResult(_0x1ac4a3,_0x3e3c4c))['catch'](handleError(_0x1ac4a3,null));};exports['show']=function(_0x1d554e,_0x5dc824){var _0x1fc518={'raw':![],'where':{'id':_0x1d554e[_0xfef0('0x47')]['id']}},_0x22c940={};_0x22c940[_0xfef0('0x32')]=_[_0xfef0('0x48')](db[_0xfef0('0x30')][_0xfef0('0x49')]);_0x22c940[_0xfef0('0x35')]=_['keys'](_0x1d554e[_0xfef0('0x35')]);_0x22c940['filters']=_['intersection'](_0x22c940[_0xfef0('0x32')],_0x22c940[_0xfef0('0x35')]);_0x1fc518['attributes']=_[_0xfef0('0x34')](_0x22c940['model'],qs[_0xfef0('0x36')](_0x1d554e[_0xfef0('0x35')][_0xfef0('0x36')]));_0x1fc518[_0xfef0('0x37')]=_0x1fc518['attributes'][_0xfef0('0x38')]?_0x1fc518[_0xfef0('0x37')]:_0x22c940['model'];if(_0x1d554e['query'][_0xfef0('0x43')]){_0x1fc518['include']=[{'all':!![]}];}_0x1fc518=_[_0xfef0('0x41')]({},_0x1fc518,_0x1d554e[_0xfef0('0x42')]);return db[_0xfef0('0x30')][_0xfef0('0x4a')](_0x1fc518)[_0xfef0('0x29')](handleEntityNotFound(_0x5dc824,null))[_0xfef0('0x29')](respondWithResult(_0x5dc824,null))['catch'](handleError(_0x5dc824,null));};exports[_0xfef0('0x4b')]=function(_0x559a28,_0x5a417e){return db[_0xfef0('0x30')][_0xfef0('0x4b')](_0x559a28[_0xfef0('0x4c')],{})['then'](respondWithResult(_0x5a417e,0xc9))[_0xfef0('0x4d')](handleError(_0x5a417e,null));};exports['update']=function(_0x5dd26b,_0x51f207){if(_0x5dd26b[_0xfef0('0x4c')]['id']){delete _0x5dd26b[_0xfef0('0x4c')]['id'];}return db[_0xfef0('0x30')][_0xfef0('0x4a')]({'where':{'id':_0x5dd26b[_0xfef0('0x47')]['id']}})[_0xfef0('0x29')](handleEntityNotFound(_0x51f207,null))[_0xfef0('0x29')](saveUpdates(_0x5dd26b[_0xfef0('0x4c')],null))[_0xfef0('0x29')](respondWithResult(_0x51f207,null))['catch'](handleError(_0x51f207,null));};exports['destroy']=function(_0x2bebec,_0x18e5ba){return db[_0xfef0('0x30')][_0xfef0('0x4a')]({'where':{'id':_0x2bebec[_0xfef0('0x47')]['id']}})[_0xfef0('0x29')](handleEntityNotFound(_0x18e5ba,null))[_0xfef0('0x29')](removeEntity(_0x18e5ba,null))[_0xfef0('0x4d')](handleError(_0x18e5ba,null));};exports['describe']=function(_0x2466e7,_0x19e449){return db[_0xfef0('0x30')][_0xfef0('0x4e')]()[_0xfef0('0x29')](respondWithResult(_0x19e449,null))['catch'](handleError(_0x19e449,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 2b490c7..b6f6fa5 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 _0x56b9=['rimraf','../../config/environment','./userProfileResource.attributes','exports','define','UserProfileResource','user_profile_has_resources','resourceId','sectionId','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0xe5b8ad,_0x4eb804){var _0x4c9ee4=function(_0x2ff588){while(--_0x2ff588){_0xe5b8ad['push'](_0xe5b8ad['shift']());}};_0x4c9ee4(++_0x4eb804);}(_0x56b9,0xf9));var _0x956b=function(_0x542a9b,_0x351513){_0x542a9b=_0x542a9b-0x0;var _0x4d5032=_0x56b9[_0x542a9b];return _0x4d5032;};'use strict';var _=require(_0x956b('0x0'));var util=require(_0x956b('0x1'));var logger=require(_0x956b('0x2'))(_0x956b('0x3'));var moment=require(_0x956b('0x4'));var BPromise=require(_0x956b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x956b('0x6'));var rimraf=require(_0x956b('0x7'));var config=require(_0x956b('0x8'));var attributes=require(_0x956b('0x9'));module[_0x956b('0xa')]=function(_0x47418b,_0x50af2f){return _0x47418b[_0x956b('0xb')](_0x956b('0xc'),attributes,{'tableName':_0x956b('0xd'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x956b('0xe'),_0x956b('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc68c=['request-promise','path','../../config/environment','./userProfileResource.attributes','exports','define','UserProfileResource','user_profile_has_resources','compositeIndex','resourceId','sectionId','lodash','../../config/logger','api','moment','bluebird'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc68c,0xdb));var _0xcc68=function(_0xd49350,_0x4d2c6b){_0xd49350=_0xd49350-0x0;var _0xc28712=_0xc68c[_0xd49350];return _0xc28712;};'use strict';var _=require(_0xcc68('0x0'));var util=require('util');var logger=require(_0xcc68('0x1'))(_0xcc68('0x2'));var moment=require(_0xcc68('0x3'));var BPromise=require(_0xcc68('0x4'));var rp=require(_0xcc68('0x5'));var fs=require('fs');var path=require(_0xcc68('0x6'));var rimraf=require('rimraf');var config=require(_0xcc68('0x7'));var attributes=require(_0xcc68('0x8'));module[_0xcc68('0x9')]=function(_0x285995,_0x595c83){return _0x285995[_0xcc68('0xa')](_0xcc68('0xb'),attributes,{'tableName':_0xcc68('0xc'),'paranoid':![],'indexes':[{'name':_0xcc68('0xd'),'fields':[_0xcc68('0xe'),_0xcc68('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 4463e4c..2387abc 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 _0xfd4d=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','info','request\x20sent','debug','error','UserProfileResource,\x20%s,\x20%s','message','result','lodash','moment','randomstring','ioredis'];(function(_0x434783,_0xff395d){var _0x13efcf=function(_0x235dac){while(--_0x235dac){_0x434783['push'](_0x434783['shift']());}};_0x13efcf(++_0xff395d);}(_0xfd4d,0x18c));var _0xdfd4=function(_0x5e7ace,_0x43eefa){_0x5e7ace=_0x5e7ace-0x0;var _0x1e9f5c=_0xfd4d[_0x5e7ace];return _0x1e9f5c;};'use strict';var _=require(_0xdfd4('0x0'));var util=require('util');var moment=require(_0xdfd4('0x1'));var BPromise=require('bluebird');var rs=require(_0xdfd4('0x2'));var fs=require('fs');var Redis=require(_0xdfd4('0x3'));var db=require(_0xdfd4('0x4'))['db'];var utils=require(_0xdfd4('0x5'));var logger=require(_0xdfd4('0x6'))('rpc');var config=require(_0xdfd4('0x7'));var jayson=require(_0xdfd4('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c571e,_0xc9fdb3,_0xd5d591){return new BPromise(function(_0x5d2820,_0x4a5bb6){return client['request'](_0x2c571e,_0xd5d591)['then'](function(_0x4140b9){logger[_0xdfd4('0x9')]('UserProfileResource,\x20%s,\x20%s',_0xc9fdb3,_0xdfd4('0xa'));logger[_0xdfd4('0xb')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0xc9fdb3,_0xdfd4('0xa'),JSON['stringify'](_0x4140b9));if(_0x4140b9[_0xdfd4('0xc')]){if(_0x4140b9[_0xdfd4('0xc')]['code']===0x1f4){logger[_0xdfd4('0xc')](_0xdfd4('0xd'),_0xc9fdb3,_0x4140b9['error']['message']);return _0x4a5bb6(_0x4140b9['error'][_0xdfd4('0xe')]);}logger['error']('UserProfileResource,\x20%s,\x20%s',_0xc9fdb3,_0x4140b9[_0xdfd4('0xc')][_0xdfd4('0xe')]);return _0x5d2820(_0x4140b9[_0xdfd4('0xc')][_0xdfd4('0xe')]);}else{logger[_0xdfd4('0x9')]('UserProfileResource,\x20%s,\x20%s',_0xc9fdb3,_0xdfd4('0xa'));_0x5d2820(_0x4140b9[_0xdfd4('0xf')][_0xdfd4('0xe')]);}})['catch'](function(_0x3dfdf5){logger[_0xdfd4('0xc')]('UserProfileResource,\x20%s,\x20%s',_0xc9fdb3,_0x3dfdf5);_0x4a5bb6(_0x3dfdf5);});});} \ No newline at end of file +var _0x202d=['error','code','message','catch','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4caab0,_0x2a6b37){var _0x39df7d=function(_0x521e79){while(--_0x521e79){_0x4caab0['push'](_0x4caab0['shift']());}};_0x39df7d(++_0x2a6b37);}(_0x202d,0x16d));var _0xd202=function(_0x4a467d,_0x4712c2){_0x4a467d=_0x4a467d-0x0;var _0x1ef269=_0x202d[_0x4a467d];return _0x1ef269;};'use strict';var _=require('lodash');var util=require(_0xd202('0x0'));var moment=require('moment');var BPromise=require(_0xd202('0x1'));var rs=require(_0xd202('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd202('0x3'))['db'];var utils=require(_0xd202('0x4'));var logger=require(_0xd202('0x5'))(_0xd202('0x6'));var config=require('../../config/environment');var jayson=require(_0xd202('0x7'));var client=jayson[_0xd202('0x8')][_0xd202('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x15aa3f,_0x1d71c2,_0x22303a){return new BPromise(function(_0x29a5fe,_0x240083){return client['request'](_0x15aa3f,_0x22303a)['then'](function(_0x4745be){logger['info'](_0xd202('0xa'),_0x1d71c2,_0xd202('0xb'));logger[_0xd202('0xc')](_0xd202('0xd'),_0x1d71c2,_0xd202('0xb'),JSON[_0xd202('0xe')](_0x4745be));if(_0x4745be['error']){if(_0x4745be[_0xd202('0xf')][_0xd202('0x10')]===0x1f4){logger[_0xd202('0xf')](_0xd202('0xa'),_0x1d71c2,_0x4745be['error']['message']);return _0x240083(_0x4745be[_0xd202('0xf')][_0xd202('0x11')]);}logger[_0xd202('0xf')](_0xd202('0xa'),_0x1d71c2,_0x4745be['error'][_0xd202('0x11')]);return _0x29a5fe(_0x4745be[_0xd202('0xf')]['message']);}else{logger['info'](_0xd202('0xa'),_0x1d71c2,_0xd202('0xb'));_0x29a5fe(_0x4745be['result']['message']);}})[_0xd202('0x12')](function(_0x9086b2){logger[_0xd202('0xf')]('UserProfileResource,\x20%s,\x20%s',_0x1d71c2,_0x9086b2);_0x240083(_0x9086b2);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index c46c783..063b9b9 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 _0xbfcf=['../../config/environment','get','isAuthenticated','describe','post','create','put','/:id','update','delete','destroy','util','path','express','fs-extra','../../components/auth/service'];(function(_0x5ac5fa,_0x5ef3f7){var _0x45049e=function(_0x10efca){while(--_0x10efca){_0x5ac5fa['push'](_0x5ac5fa['shift']());}};_0x45049e(++_0x5ef3f7);}(_0xbfcf,0x18b));var _0xfbfc=function(_0x48e1ec,_0x35f468){_0x48e1ec=_0x48e1ec-0x0;var _0x3b33eb=_0xbfcf[_0x48e1ec];return _0x3b33eb;};'use strict';var multer=require('multer');var util=require(_0xfbfc('0x0'));var path=require(_0xfbfc('0x1'));var timeout=require('connect-timeout');var express=require(_0xfbfc('0x2'));var router=express['Router']();var fs_extra=require(_0xfbfc('0x3'));var auth=require(_0xfbfc('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xfbfc('0x5'));var controller=require('./userProfileSection.controller');router[_0xfbfc('0x6')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth[_0xfbfc('0x7')](),controller[_0xfbfc('0x8')]);router['get']('/:id',auth[_0xfbfc('0x7')](),controller['show']);router[_0xfbfc('0x9')]('/',auth[_0xfbfc('0x7')](),controller[_0xfbfc('0xa')]);router[_0xfbfc('0xb')](_0xfbfc('0xc'),auth[_0xfbfc('0x7')](),controller[_0xfbfc('0xd')]);router[_0xfbfc('0xe')]('/:id',auth[_0xfbfc('0x7')](),controller[_0xfbfc('0xf')]);module['exports']=router; \ No newline at end of file +var _0x178a=['./userProfileSection.controller','isAuthenticated','get','/describe','describe','/:id','show','post','create','delete','destroy','exports','util','path','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x3069e1,_0x47191f){var _0x74d188=function(_0x5e72a4){while(--_0x5e72a4){_0x3069e1['push'](_0x3069e1['shift']());}};_0x74d188(++_0x47191f);}(_0x178a,0xe4));var _0xa178=function(_0x177652,_0x2936fb){_0x177652=_0x177652-0x0;var _0x208ca9=_0x178a[_0x177652];return _0x208ca9;};'use strict';var multer=require('multer');var util=require(_0xa178('0x0'));var path=require(_0xa178('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa178('0x2')]();var fs_extra=require(_0xa178('0x3'));var auth=require(_0xa178('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xa178('0x5'));var controller=require(_0xa178('0x6'));router['get']('/',auth[_0xa178('0x7')](),controller['index']);router[_0xa178('0x8')](_0xa178('0x9'),auth['isAuthenticated'](),controller[_0xa178('0xa')]);router[_0xa178('0x8')](_0xa178('0xb'),auth[_0xa178('0x7')](),controller[_0xa178('0xc')]);router[_0xa178('0xd')]('/',auth['isAuthenticated'](),controller[_0xa178('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xa178('0xf')](_0xa178('0xb'),auth['isAuthenticated'](),controller[_0xa178('0x10')]);module[_0xa178('0x11')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 6481ba8..d6c8c83 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 _0xb62e=['STRING','BOOLEAN','setDataValue','crudPermissions','getDataValue','split','sequelize','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb62e,0x1de));var _0xeb62=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xb62e[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require(_0xeb62('0x0'));module[_0xeb62('0x1')]={'name':{'type':Sequelize[_0xeb62('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0xeb62('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0xeb62('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xeb62('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xeb62('0x2')],'set':function(_0x929329){this[_0xeb62('0x4')](_0xeb62('0x5'),_0x929329?_0x929329['join'](''):[]);},'get':function(){return this[_0xeb62('0x6')](_0xeb62('0x5'))?this[_0xeb62('0x6')]('crudPermissions')[_0xeb62('0x7')](''):[];}}}; \ No newline at end of file +var _0x93e9=['crudPermissions','join','getDataValue','split','sequelize','exports','STRING','INTEGER','BOOLEAN','setDataValue'];(function(_0x102aca,_0x399fa0){var _0x5d5890=function(_0x571c83){while(--_0x571c83){_0x102aca['push'](_0x102aca['shift']());}};_0x5d5890(++_0x399fa0);}(_0x93e9,0xcc));var _0x993e=function(_0x25344e,_0x41b2f1){_0x25344e=_0x25344e-0x0;var _0x3bf737=_0x93e9[_0x25344e];return _0x3bf737;};'use strict';var Sequelize=require(_0x993e('0x0'));module[_0x993e('0x1')]={'name':{'type':Sequelize[_0x993e('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0x993e('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x993e('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0x993e('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x993e('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x55f739){this[_0x993e('0x5')](_0x993e('0x6'),_0x55f739?_0x55f739[_0x993e('0x7')](''):[]);},'get':function(){return this[_0x993e('0x8')](_0x993e('0x6'))?this[_0x993e('0x8')](_0x993e('0x6'))[_0x993e('0x9')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index dbd0e41..b8f81a5 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 _0x1fa1=['count','set','Content-Range','apply','save','update','destroy','error','stack','name','send','index','map','UserProfileSection','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','findAll','then','rows','params','length','include','options','create','body','find','catch','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined'];(function(_0x407883,_0xb548f){var _0x183ca2=function(_0x48f454){while(--_0x48f454){_0x407883['push'](_0x407883['shift']());}};_0x183ca2(++_0xb548f);}(_0x1fa1,0x10a));var _0x11fa=function(_0x919bbb,_0x55ef48){_0x919bbb=_0x919bbb-0x0;var _0x40971a=_0x1fa1[_0x919bbb];return _0x40971a;};'use strict';var emlformat=require(_0x11fa('0x0'));var rimraf=require(_0x11fa('0x1'));var zipdir=require(_0x11fa('0x2'));var jsonpatch=require(_0x11fa('0x3'));var rp=require(_0x11fa('0x4'));var moment=require('moment');var BPromise=require(_0x11fa('0x5'));var Mustache=require(_0x11fa('0x6'));var util=require(_0x11fa('0x7'));var path=require('path');var sox=require(_0x11fa('0x8'));var csv=require(_0x11fa('0x9'));var ejs=require(_0x11fa('0xa'));var fs=require('fs');var fs_extra=require(_0x11fa('0xb'));var _=require(_0x11fa('0xc'));var squel=require('squel');var crypto=require(_0x11fa('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x11fa('0xe'));var Papa=require(_0x11fa('0xf'));var Redis=require(_0x11fa('0x10'));var authService=require(_0x11fa('0x11'));var qs=require(_0x11fa('0x12'));var as=require(_0x11fa('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x11fa('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x11fa('0x15'));var licenseUtil=require(_0x11fa('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x985803,_0x115e47){_0x115e47=_0x115e47||0xcc;return function(_0x31ada8){if(_0x31ada8){return _0x985803[_0x11fa('0x17')](_0x115e47);}return _0x985803[_0x11fa('0x18')](_0x115e47)[_0x11fa('0x19')]();};}function respondWithResult(_0xaa880f,_0x3c0577){_0x3c0577=_0x3c0577||0xc8;return function(_0x20d606){if(_0x20d606){return _0xaa880f[_0x11fa('0x18')](_0x3c0577)[_0x11fa('0x1a')](_0x20d606);}};}function respondWithFilteredResult(_0x283552,_0x4825a6){return function(_0x5033a7){if(_0x5033a7){var _0xbeb381=typeof _0x4825a6[_0x11fa('0x1b')]==='undefined'&&typeof _0x4825a6[_0x11fa('0x1c')]===_0x11fa('0x1d');var _0x2f6dd5=_0x5033a7['count'];var _0x354121=_0xbeb381?0x0:_0x4825a6[_0x11fa('0x1b')];var _0x403c76=_0xbeb381?_0x5033a7[_0x11fa('0x1e')]:_0x4825a6[_0x11fa('0x1b')]+_0x4825a6[_0x11fa('0x1c')];var _0x27d985;if(_0x403c76>=_0x2f6dd5){_0x403c76=_0x2f6dd5;_0x27d985=0xc8;}else{_0x27d985=0xce;}_0x283552[_0x11fa('0x18')](_0x27d985);return _0x283552[_0x11fa('0x1f')](_0x11fa('0x20'),_0x354121+'-'+_0x403c76+'/'+_0x2f6dd5)[_0x11fa('0x1a')](_0x5033a7);}return null;};}function patchUpdates(_0x2548ee){return function(_0x43f3ef){try{jsonpatch[_0x11fa('0x21')](_0x43f3ef,_0x2548ee,!![]);}catch(_0x344ca3){return BPromise['reject'](_0x344ca3);}return _0x43f3ef[_0x11fa('0x22')]();};}function saveUpdates(_0x58510a,_0x4786d6){return function(_0x128017){if(_0x128017){return _0x128017[_0x11fa('0x23')](_0x58510a)['then'](function(_0x53618a){return _0x53618a;});}return null;};}function removeEntity(_0x34fcf3,_0x18f711){return function(_0x6a7513){if(_0x6a7513){return _0x6a7513[_0x11fa('0x24')]()['then'](function(){_0x34fcf3[_0x11fa('0x18')](0xcc)[_0x11fa('0x19')]();});}};}function handleEntityNotFound(_0x55a84b,_0x6b453b){return function(_0x100a7c){if(!_0x100a7c){_0x55a84b[_0x11fa('0x17')](0x194);}return _0x100a7c;};}function handleError(_0x31347e,_0x349bee){_0x349bee=_0x349bee||0x1f4;return function(_0x7d3b71){logger[_0x11fa('0x25')](_0x7d3b71[_0x11fa('0x26')]);if(_0x7d3b71[_0x11fa('0x27')]){delete _0x7d3b71[_0x11fa('0x27')];}_0x31347e[_0x11fa('0x18')](_0x349bee)[_0x11fa('0x28')](_0x7d3b71);};}exports[_0x11fa('0x29')]=function(_0x4e6edc,_0x2adc85){var _0x10873f={},_0x1f063a={},_0x2fc701={'count':0x0,'rows':[]};var _0x427eb5=_[_0x11fa('0x2a')](db[_0x11fa('0x2b')][_0x11fa('0x2c')],function(_0x3eaef6){return{'name':_0x3eaef6['fieldName'],'type':_0x3eaef6[_0x11fa('0x2d')]['key']};});_0x1f063a[_0x11fa('0x2e')]=_['map'](_0x427eb5,_0x11fa('0x27'));_0x1f063a[_0x11fa('0x2f')]=_[_0x11fa('0x30')](_0x4e6edc[_0x11fa('0x2f')]);_0x1f063a[_0x11fa('0x31')]=_[_0x11fa('0x32')](_0x1f063a[_0x11fa('0x2e')],_0x1f063a[_0x11fa('0x2f')]);_0x10873f[_0x11fa('0x33')]=_[_0x11fa('0x32')](_0x1f063a['model'],qs['fields'](_0x4e6edc[_0x11fa('0x2f')][_0x11fa('0x34')]));_0x10873f['attributes']=_0x10873f[_0x11fa('0x33')]['length']?_0x10873f['attributes']:_0x1f063a['model'];if(!_0x4e6edc[_0x11fa('0x2f')][_0x11fa('0x35')](_0x11fa('0x36'))){_0x10873f['limit']=qs[_0x11fa('0x1c')](_0x4e6edc[_0x11fa('0x2f')][_0x11fa('0x1c')]);_0x10873f[_0x11fa('0x1b')]=qs[_0x11fa('0x1b')](_0x4e6edc[_0x11fa('0x2f')][_0x11fa('0x1b')]);}_0x10873f[_0x11fa('0x37')]=qs[_0x11fa('0x38')](_0x4e6edc['query']['sort']);_0x10873f['where']=qs[_0x11fa('0x31')](_[_0x11fa('0x39')](_0x4e6edc['query'],_0x1f063a[_0x11fa('0x31')]),_0x427eb5);if(_0x4e6edc[_0x11fa('0x2f')][_0x11fa('0x3a')]){_0x10873f['where']=_[_0x11fa('0x3b')](_0x10873f[_0x11fa('0x3c')],{'$or':_[_0x11fa('0x2a')](_0x427eb5,function(_0x2f6160){if(_0x2f6160['type']!==_0x11fa('0x3d')){var _0x5629c3={};_0x5629c3[_0x2f6160[_0x11fa('0x27')]]={'$like':'%'+_0x4e6edc[_0x11fa('0x2f')][_0x11fa('0x3a')]+'%'};return _0x5629c3;}})});}_0x10873f=_[_0x11fa('0x3b')]({},_0x10873f,_0x4e6edc['options']);var _0x4402df={'where':_0x10873f[_0x11fa('0x3c')]};return db[_0x11fa('0x2b')][_0x11fa('0x1e')](_0x4402df)['then'](function(_0x2b7f92){_0x2fc701[_0x11fa('0x1e')]=_0x2b7f92;if(_0x4e6edc[_0x11fa('0x2f')]['includeAll']){_0x10873f['include']=[{'all':!![]}];}return db[_0x11fa('0x2b')][_0x11fa('0x3e')](_0x10873f);})[_0x11fa('0x3f')](function(_0x361cc6){_0x2fc701[_0x11fa('0x40')]=_0x361cc6;return _0x2fc701;})[_0x11fa('0x3f')](respondWithFilteredResult(_0x2adc85,_0x10873f))['catch'](handleError(_0x2adc85,null));};exports['show']=function(_0x11e74b,_0x4bbae4){var _0x36260f={'raw':![],'where':{'id':_0x11e74b[_0x11fa('0x41')]['id']}},_0x42efbb={};_0x42efbb['model']=_[_0x11fa('0x30')](db['UserProfileSection']['rawAttributes']);_0x42efbb[_0x11fa('0x2f')]=_[_0x11fa('0x30')](_0x11e74b['query']);_0x42efbb[_0x11fa('0x31')]=_['intersection'](_0x42efbb['model'],_0x42efbb[_0x11fa('0x2f')]);_0x36260f[_0x11fa('0x33')]=_['intersection'](_0x42efbb['model'],qs[_0x11fa('0x34')](_0x11e74b[_0x11fa('0x2f')][_0x11fa('0x34')]));_0x36260f[_0x11fa('0x33')]=_0x36260f[_0x11fa('0x33')][_0x11fa('0x42')]?_0x36260f[_0x11fa('0x33')]:_0x42efbb[_0x11fa('0x2e')];if(_0x11e74b[_0x11fa('0x2f')]['includeAll']){_0x36260f[_0x11fa('0x43')]=[{'all':!![]}];}_0x36260f=_[_0x11fa('0x3b')]({},_0x36260f,_0x11e74b[_0x11fa('0x44')]);return db['UserProfileSection']['find'](_0x36260f)[_0x11fa('0x3f')](handleEntityNotFound(_0x4bbae4,null))['then'](respondWithResult(_0x4bbae4,null))['catch'](handleError(_0x4bbae4,null));};exports[_0x11fa('0x45')]=function(_0x2d5d96,_0x47384b){return db[_0x11fa('0x2b')][_0x11fa('0x45')](_0x2d5d96[_0x11fa('0x46')],{})[_0x11fa('0x3f')](respondWithResult(_0x47384b,0xc9))['catch'](handleError(_0x47384b,null));};exports['update']=function(_0x1b58b0,_0x5de03b){if(_0x1b58b0[_0x11fa('0x46')]['id']){delete _0x1b58b0[_0x11fa('0x46')]['id'];}return db[_0x11fa('0x2b')][_0x11fa('0x47')]({'where':{'id':_0x1b58b0[_0x11fa('0x41')]['id']}})['then'](handleEntityNotFound(_0x5de03b,null))[_0x11fa('0x3f')](saveUpdates(_0x1b58b0[_0x11fa('0x46')],null))[_0x11fa('0x3f')](respondWithResult(_0x5de03b,null))[_0x11fa('0x48')](handleError(_0x5de03b,null));};exports[_0x11fa('0x24')]=function(_0x4c9d37,_0xc979e8){return db[_0x11fa('0x2b')][_0x11fa('0x47')]({'where':{'id':_0x4c9d37[_0x11fa('0x41')]['id']}})[_0x11fa('0x3f')](handleEntityNotFound(_0xc979e8,null))[_0x11fa('0x3f')](removeEntity(_0xc979e8,null))['catch'](handleError(_0xc979e8,null));};exports[_0x11fa('0x49')]=function(_0x361fe4,_0x1349c4){return db[_0x11fa('0x2b')]['describe']()[_0x11fa('0x3f')](respondWithResult(_0x1349c4,null))['catch'](handleError(_0x1349c4,null));}; \ No newline at end of file +var _0x2493=['util','path','sox','to-csv','ejs','fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','apply','error','stack','name','send','UserProfileSection','type','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','offset','order','sort','where','filter','merge','VIRTUAL','then','includeAll','findAll','show','params','rawAttributes','options','create','body','catch','update','find','destroy','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x2493,0x88));var _0x3249=function(_0x1bb01c,_0x5497e4){_0x1bb01c=_0x1bb01c-0x0;var _0x2957db=_0x2493[_0x1bb01c];return _0x2957db;};'use strict';var emlformat=require(_0x3249('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3249('0x1'));var rp=require(_0x3249('0x2'));var moment=require(_0x3249('0x3'));var BPromise=require(_0x3249('0x4'));var Mustache=require(_0x3249('0x5'));var util=require(_0x3249('0x6'));var path=require(_0x3249('0x7'));var sox=require(_0x3249('0x8'));var csv=require(_0x3249('0x9'));var ejs=require(_0x3249('0xa'));var fs=require('fs');var fs_extra=require(_0x3249('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x3249('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3249('0xd'));var toCsv=require(_0x3249('0x9'));var querystring=require(_0x3249('0xe'));var Papa=require(_0x3249('0xf'));var Redis=require(_0x3249('0x10'));var authService=require(_0x3249('0x11'));var qs=require(_0x3249('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3249('0x13'))(_0x3249('0x14'));var utils=require('../../config/utils');var config=require(_0x3249('0x15'));var licenseUtil=require(_0x3249('0x16'));var db=require(_0x3249('0x17'))['db'];function respondWithStatusCode(_0x36d237,_0x1f0610){_0x1f0610=_0x1f0610||0xcc;return function(_0x5bd359){if(_0x5bd359){return _0x36d237[_0x3249('0x18')](_0x1f0610);}return _0x36d237[_0x3249('0x19')](_0x1f0610)[_0x3249('0x1a')]();};}function respondWithResult(_0xf61dfe,_0x310ac8){_0x310ac8=_0x310ac8||0xc8;return function(_0x5b45de){if(_0x5b45de){return _0xf61dfe[_0x3249('0x19')](_0x310ac8)[_0x3249('0x1b')](_0x5b45de);}};}function respondWithFilteredResult(_0x3d37d7,_0x567f32){return function(_0x55f2ee){if(_0x55f2ee){var _0x246dd2=typeof _0x567f32['offset']===_0x3249('0x1c')&&typeof _0x567f32[_0x3249('0x1d')]===_0x3249('0x1c');var _0x25089e=_0x55f2ee['count'];var _0x570573=_0x246dd2?0x0:_0x567f32['offset'];var _0xb0f281=_0x246dd2?_0x55f2ee[_0x3249('0x1e')]:_0x567f32['offset']+_0x567f32[_0x3249('0x1d')];var _0x5a5c06;if(_0xb0f281>=_0x25089e){_0xb0f281=_0x25089e;_0x5a5c06=0xc8;}else{_0x5a5c06=0xce;}_0x3d37d7[_0x3249('0x19')](_0x5a5c06);return _0x3d37d7[_0x3249('0x1f')](_0x3249('0x20'),_0x570573+'-'+_0xb0f281+'/'+_0x25089e)[_0x3249('0x1b')](_0x55f2ee);}return null;};}function patchUpdates(_0x3371b4){return function(_0x38a8b8){try{jsonpatch[_0x3249('0x21')](_0x38a8b8,_0x3371b4,!![]);}catch(_0x43c021){return BPromise['reject'](_0x43c021);}return _0x38a8b8['save']();};}function saveUpdates(_0xcdd7e7,_0x202e01){return function(_0xe84e9f){if(_0xe84e9f){return _0xe84e9f['update'](_0xcdd7e7)['then'](function(_0xe227fb){return _0xe227fb;});}return null;};}function removeEntity(_0x58ae8c,_0x509034){return function(_0x212937){if(_0x212937){return _0x212937['destroy']()['then'](function(){_0x58ae8c[_0x3249('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3dc1e2,_0x1833a2){return function(_0x523a49){if(!_0x523a49){_0x3dc1e2[_0x3249('0x18')](0x194);}return _0x523a49;};}function handleError(_0x331e28,_0x12ec42){_0x12ec42=_0x12ec42||0x1f4;return function(_0xa94509){logger[_0x3249('0x22')](_0xa94509[_0x3249('0x23')]);if(_0xa94509['name']){delete _0xa94509[_0x3249('0x24')];}_0x331e28[_0x3249('0x19')](_0x12ec42)[_0x3249('0x25')](_0xa94509);};}exports['index']=function(_0x3d0d16,_0x2f1e14){var _0x4aea3b={},_0x3785ae={},_0x4c3346={'count':0x0,'rows':[]};var _0x2b06ca=_['map'](db[_0x3249('0x26')]['rawAttributes'],function(_0x2f13e8){return{'name':_0x2f13e8['fieldName'],'type':_0x2f13e8[_0x3249('0x27')]['key']};});_0x3785ae[_0x3249('0x28')]=_[_0x3249('0x29')](_0x2b06ca,'name');_0x3785ae['query']=_[_0x3249('0x2a')](_0x3d0d16[_0x3249('0x2b')]);_0x3785ae[_0x3249('0x2c')]=_[_0x3249('0x2d')](_0x3785ae[_0x3249('0x28')],_0x3785ae[_0x3249('0x2b')]);_0x4aea3b[_0x3249('0x2e')]=_[_0x3249('0x2d')](_0x3785ae[_0x3249('0x28')],qs[_0x3249('0x2f')](_0x3d0d16[_0x3249('0x2b')][_0x3249('0x2f')]));_0x4aea3b['attributes']=_0x4aea3b[_0x3249('0x2e')][_0x3249('0x30')]?_0x4aea3b['attributes']:_0x3785ae[_0x3249('0x28')];if(!_0x3d0d16['query'][_0x3249('0x31')]('nolimit')){_0x4aea3b['limit']=qs[_0x3249('0x1d')](_0x3d0d16[_0x3249('0x2b')][_0x3249('0x1d')]);_0x4aea3b[_0x3249('0x32')]=qs[_0x3249('0x32')](_0x3d0d16[_0x3249('0x2b')][_0x3249('0x32')]);}_0x4aea3b[_0x3249('0x33')]=qs[_0x3249('0x34')](_0x3d0d16[_0x3249('0x2b')][_0x3249('0x34')]);_0x4aea3b[_0x3249('0x35')]=qs[_0x3249('0x2c')](_['pick'](_0x3d0d16['query'],_0x3785ae['filters']),_0x2b06ca);if(_0x3d0d16[_0x3249('0x2b')][_0x3249('0x36')]){_0x4aea3b[_0x3249('0x35')]=_[_0x3249('0x37')](_0x4aea3b['where'],{'$or':_['map'](_0x2b06ca,function(_0x1ccfb9){if(_0x1ccfb9['type']!==_0x3249('0x38')){var _0x2f0aeb={};_0x2f0aeb[_0x1ccfb9[_0x3249('0x24')]]={'$like':'%'+_0x3d0d16[_0x3249('0x2b')][_0x3249('0x36')]+'%'};return _0x2f0aeb;}})});}_0x4aea3b=_[_0x3249('0x37')]({},_0x4aea3b,_0x3d0d16['options']);var _0x11102a={'where':_0x4aea3b['where']};return db[_0x3249('0x26')]['count'](_0x11102a)[_0x3249('0x39')](function(_0x919124){_0x4c3346[_0x3249('0x1e')]=_0x919124;if(_0x3d0d16[_0x3249('0x2b')][_0x3249('0x3a')]){_0x4aea3b['include']=[{'all':!![]}];}return db['UserProfileSection'][_0x3249('0x3b')](_0x4aea3b);})[_0x3249('0x39')](function(_0x3f6cee){_0x4c3346['rows']=_0x3f6cee;return _0x4c3346;})[_0x3249('0x39')](respondWithFilteredResult(_0x2f1e14,_0x4aea3b))['catch'](handleError(_0x2f1e14,null));};exports[_0x3249('0x3c')]=function(_0x1462af,_0x2e8d3f){var _0x3b50fb={'raw':![],'where':{'id':_0x1462af[_0x3249('0x3d')]['id']}},_0x3a48a0={};_0x3a48a0[_0x3249('0x28')]=_[_0x3249('0x2a')](db[_0x3249('0x26')][_0x3249('0x3e')]);_0x3a48a0['query']=_[_0x3249('0x2a')](_0x1462af[_0x3249('0x2b')]);_0x3a48a0[_0x3249('0x2c')]=_[_0x3249('0x2d')](_0x3a48a0[_0x3249('0x28')],_0x3a48a0[_0x3249('0x2b')]);_0x3b50fb[_0x3249('0x2e')]=_['intersection'](_0x3a48a0[_0x3249('0x28')],qs['fields'](_0x1462af[_0x3249('0x2b')][_0x3249('0x2f')]));_0x3b50fb[_0x3249('0x2e')]=_0x3b50fb['attributes'][_0x3249('0x30')]?_0x3b50fb[_0x3249('0x2e')]:_0x3a48a0[_0x3249('0x28')];if(_0x1462af[_0x3249('0x2b')][_0x3249('0x3a')]){_0x3b50fb['include']=[{'all':!![]}];}_0x3b50fb=_[_0x3249('0x37')]({},_0x3b50fb,_0x1462af[_0x3249('0x3f')]);return db[_0x3249('0x26')]['find'](_0x3b50fb)[_0x3249('0x39')](handleEntityNotFound(_0x2e8d3f,null))[_0x3249('0x39')](respondWithResult(_0x2e8d3f,null))['catch'](handleError(_0x2e8d3f,null));};exports[_0x3249('0x40')]=function(_0x3ac248,_0x2a544c){return db[_0x3249('0x26')][_0x3249('0x40')](_0x3ac248[_0x3249('0x41')],{})['then'](respondWithResult(_0x2a544c,0xc9))[_0x3249('0x42')](handleError(_0x2a544c,null));};exports[_0x3249('0x43')]=function(_0x511f98,_0x5c0b86){if(_0x511f98['body']['id']){delete _0x511f98[_0x3249('0x41')]['id'];}return db['UserProfileSection'][_0x3249('0x44')]({'where':{'id':_0x511f98['params']['id']}})[_0x3249('0x39')](handleEntityNotFound(_0x5c0b86,null))['then'](saveUpdates(_0x511f98[_0x3249('0x41')],null))[_0x3249('0x39')](respondWithResult(_0x5c0b86,null))[_0x3249('0x42')](handleError(_0x5c0b86,null));};exports[_0x3249('0x45')]=function(_0x22e6c3,_0x42a91c){return db[_0x3249('0x26')][_0x3249('0x44')]({'where':{'id':_0x22e6c3[_0x3249('0x3d')]['id']}})[_0x3249('0x39')](handleEntityNotFound(_0x42a91c,null))[_0x3249('0x39')](removeEntity(_0x42a91c,null))[_0x3249('0x42')](handleError(_0x42a91c,null));};exports[_0x3249('0x46')]=function(_0x56fada,_0x18a5fc){return db[_0x3249('0x26')][_0x3249('0x46')]()[_0x3249('0x39')](respondWithResult(_0x18a5fc,null))[_0x3249('0x42')](handleError(_0x18a5fc,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index d03836d..08e291f 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 _0xeaf5=['./userProfileSection.attributes','exports','define','UserProfileSection','compositeIndex','userProfileId','lodash','../../config/logger','api','bluebird','request-promise','path'];(function(_0x3ce4a5,_0x50bc4b){var _0x3f5809=function(_0x2f5b78){while(--_0x2f5b78){_0x3ce4a5['push'](_0x3ce4a5['shift']());}};_0x3f5809(++_0x50bc4b);}(_0xeaf5,0x19e));var _0x5eaf=function(_0x47643e,_0x337374){_0x47643e=_0x47643e-0x0;var _0x2aa5db=_0xeaf5[_0x47643e];return _0x2aa5db;};'use strict';var _=require(_0x5eaf('0x0'));var util=require('util');var logger=require(_0x5eaf('0x1'))(_0x5eaf('0x2'));var moment=require('moment');var BPromise=require(_0x5eaf('0x3'));var rp=require(_0x5eaf('0x4'));var fs=require('fs');var path=require(_0x5eaf('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5eaf('0x6'));module[_0x5eaf('0x7')]=function(_0x1fdbea,_0x5924a9){return _0x1fdbea[_0x5eaf('0x8')](_0x5eaf('0x9'),attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':_0x5eaf('0xa'),'fields':['sectionId',_0x5eaf('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7795=['../../config/logger','api','moment','bluebird','path','../../config/environment','./userProfileSection.attributes','exports','define','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','userProfileId','lodash'];(function(_0x2947c1,_0x1fd617){var _0x2e8fc9=function(_0x24a228){while(--_0x24a228){_0x2947c1['push'](_0x2947c1['shift']());}};_0x2e8fc9(++_0x1fd617);}(_0x7795,0x149));var _0x5779=function(_0x595b9d,_0x14f96f){_0x595b9d=_0x595b9d-0x0;var _0xaa046d=_0x7795[_0x595b9d];return _0xaa046d;};'use strict';var _=require(_0x5779('0x0'));var util=require('util');var logger=require(_0x5779('0x1'))(_0x5779('0x2'));var moment=require(_0x5779('0x3'));var BPromise=require(_0x5779('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5779('0x5'));var rimraf=require('rimraf');var config=require(_0x5779('0x6'));var attributes=require(_0x5779('0x7'));module[_0x5779('0x8')]=function(_0x8066bd,_0x189283){return _0x8066bd[_0x5779('0x9')](_0x5779('0xa'),attributes,{'tableName':_0x5779('0xb'),'paranoid':![],'indexes':[{'name':_0x5779('0xc'),'fields':[_0x5779('0xd'),_0x5779('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index d127ba7..dee8ade 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 _0x1a3f=['message','info','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x28a4b8,_0x48eb0f){var _0x21c4b6=function(_0xd36144){while(--_0xd36144){_0x28a4b8['push'](_0x28a4b8['shift']());}};_0x21c4b6(++_0x48eb0f);}(_0x1a3f,0x100));var _0xf1a3=function(_0x3e3a9a,_0x130a99){_0x3e3a9a=_0x3e3a9a-0x0;var _0x14d76a=_0x1a3f[_0x3e3a9a];return _0x14d76a;};'use strict';var _=require(_0xf1a3('0x0'));var util=require('util');var moment=require(_0xf1a3('0x1'));var BPromise=require(_0xf1a3('0x2'));var rs=require(_0xf1a3('0x3'));var fs=require('fs');var Redis=require(_0xf1a3('0x4'));var db=require(_0xf1a3('0x5'))['db'];var utils=require(_0xf1a3('0x6'));var logger=require(_0xf1a3('0x7'))(_0xf1a3('0x8'));var config=require(_0xf1a3('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf1a3('0xa')][_0xf1a3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1fbec8,_0x522b9d,_0x1822b9){return new BPromise(function(_0x62543f,_0x9943b5){return client['request'](_0x1fbec8,_0x1822b9)[_0xf1a3('0xc')](function(_0x40206c){logger['info'](_0xf1a3('0xd'),_0x522b9d,_0xf1a3('0xe'));logger[_0xf1a3('0xf')](_0xf1a3('0x10'),_0x522b9d,'request\x20sent',JSON[_0xf1a3('0x11')](_0x40206c));if(_0x40206c[_0xf1a3('0x12')]){if(_0x40206c[_0xf1a3('0x12')][_0xf1a3('0x13')]===0x1f4){logger[_0xf1a3('0x12')](_0xf1a3('0xd'),_0x522b9d,_0x40206c[_0xf1a3('0x12')][_0xf1a3('0x14')]);return _0x9943b5(_0x40206c[_0xf1a3('0x12')][_0xf1a3('0x14')]);}logger[_0xf1a3('0x12')]('UserProfileSection,\x20%s,\x20%s',_0x522b9d,_0x40206c[_0xf1a3('0x12')]['message']);return _0x62543f(_0x40206c[_0xf1a3('0x12')]['message']);}else{logger[_0xf1a3('0x15')](_0xf1a3('0xd'),_0x522b9d,_0xf1a3('0xe'));_0x62543f(_0x40206c['result'][_0xf1a3('0x14')]);}})[_0xf1a3('0x16')](function(_0x2ff964){logger['error']('UserProfileSection,\x20%s,\x20%s',_0x522b9d,_0x2ff964);_0x9943b5(_0x2ff964);});});} \ No newline at end of file +var _0xf831=['util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch'];(function(_0x40afa6,_0x122003){var _0x329ad4=function(_0x2e0aa4){while(--_0x2e0aa4){_0x40afa6['push'](_0x40afa6['shift']());}};_0x329ad4(++_0x122003);}(_0xf831,0x72));var _0x1f83=function(_0x4d0b1b,_0xfd4766){_0x4d0b1b=_0x4d0b1b-0x0;var _0x448b60=_0xf831[_0x4d0b1b];return _0x448b60;};'use strict';var _=require('lodash');var util=require(_0x1f83('0x0'));var moment=require(_0x1f83('0x1'));var BPromise=require('bluebird');var rs=require(_0x1f83('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1f83('0x3'));var logger=require(_0x1f83('0x4'))(_0x1f83('0x5'));var config=require(_0x1f83('0x6'));var jayson=require(_0x1f83('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4d8d48,_0x3af70f,_0x42a04d){return new BPromise(function(_0x43dc5a,_0x1dc8ea){return client[_0x1f83('0x8')](_0x4d8d48,_0x42a04d)['then'](function(_0x53d164){logger['info'](_0x1f83('0x9'),_0x3af70f,_0x1f83('0xa'));logger[_0x1f83('0xb')](_0x1f83('0xc'),_0x3af70f,'request\x20sent',JSON['stringify'](_0x53d164));if(_0x53d164[_0x1f83('0xd')]){if(_0x53d164['error'][_0x1f83('0xe')]===0x1f4){logger[_0x1f83('0xd')](_0x1f83('0x9'),_0x3af70f,_0x53d164[_0x1f83('0xd')][_0x1f83('0xf')]);return _0x1dc8ea(_0x53d164['error'][_0x1f83('0xf')]);}logger[_0x1f83('0xd')](_0x1f83('0x9'),_0x3af70f,_0x53d164[_0x1f83('0xd')][_0x1f83('0xf')]);return _0x43dc5a(_0x53d164['error'][_0x1f83('0xf')]);}else{logger[_0x1f83('0x10')](_0x1f83('0x9'),_0x3af70f,_0x1f83('0xa'));_0x43dc5a(_0x53d164[_0x1f83('0x11')][_0x1f83('0xf')]);}})[_0x1f83('0x12')](function(_0x1d2866){logger[_0x1f83('0xd')](_0x1f83('0x9'),_0x3af70f,_0x1d2866);_0x1dc8ea(_0x1d2866);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 282c74b..0c99460 100644 --- a/server/api/userSmsQueue/index.js +++ b/server/api/userSmsQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x4fe5d3,_0x1bc54f){var _0x254c45=function(_0x5496b2){while(--_0x5496b2){_0x4fe5d3['push'](_0x4fe5d3['shift']());}};_0x254c45(++_0x1bc54f);}(_0x70e0,0x17b));var _0x070e=function(_0x282195,_0x4b49d9){_0x282195=_0x282195-0x0;var _0x1e9aa2=_0x70e0[_0x282195];return _0x1e9aa2;};'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(_0x36d221,_0x268765){var _0x15cb44=function(_0x317c54){while(--_0x317c54){_0x36d221['push'](_0x36d221['shift']());}};_0x15cb44(++_0x268765);}(_0x9c44,0x178));var _0x49c4=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x9c44[_0x16b9ed];return _0x66b1f8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 163fe7a..4f90e66 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 _0xd2eb=['INTEGER','sequelize'];(function(_0x4dc8da,_0x5b3d42){var _0x59d829=function(_0x1af72e){while(--_0x1af72e){_0x4dc8da['push'](_0x4dc8da['shift']());}};_0x59d829(++_0x5b3d42);}(_0xd2eb,0x1b5));var _0xbd2e=function(_0x5bed83,_0x28927e){_0x5bed83=_0x5bed83-0x0;var _0x3d28d3=_0xd2eb[_0x5bed83];return _0x3d28d3;};'use strict';var Sequelize=require(_0xbd2e('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xbd2e('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x0ffd=['exports','INTEGER','sequelize'];(function(_0x485a04,_0x2849a4){var _0x2ace20=function(_0x1be575){while(--_0x1be575){_0x485a04['push'](_0x485a04['shift']());}};_0x2ace20(++_0x2849a4);}(_0x0ffd,0xa4));var _0xd0ff=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0x0ffd[_0x3054be];return _0x3df150;};'use strict';var Sequelize=require(_0xd0ff('0x0'));module[_0xd0ff('0x1')]={'penalty':{'type':Sequelize[_0xd0ff('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index b29ad6c..98dabe3 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 _0xf40b=['request-promise','path','rimraf','../../config/environment','./userSmsQueue.attributes','define','UserSmsQueue','user_has_sms_queues','util','../../config/logger','api','moment'];(function(_0x1d3d9b,_0x4cd482){var _0x138fad=function(_0x496bdc){while(--_0x496bdc){_0x1d3d9b['push'](_0x1d3d9b['shift']());}};_0x138fad(++_0x4cd482);}(_0xf40b,0xb0));var _0xbf40=function(_0x2ff75c,_0x2d7c8c){_0x2ff75c=_0x2ff75c-0x0;var _0x41b448=_0xf40b[_0x2ff75c];return _0x41b448;};'use strict';var _=require('lodash');var util=require(_0xbf40('0x0'));var logger=require(_0xbf40('0x1'))(_0xbf40('0x2'));var moment=require(_0xbf40('0x3'));var BPromise=require('bluebird');var rp=require(_0xbf40('0x4'));var fs=require('fs');var path=require(_0xbf40('0x5'));var rimraf=require(_0xbf40('0x6'));var config=require(_0xbf40('0x7'));var attributes=require(_0xbf40('0x8'));module['exports']=function(_0x2e74b5,_0xbe1c47){return _0x2e74b5[_0xbf40('0x9')](_0xbf40('0xa'),attributes,{'tableName':_0xbf40('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9582=['bluebird','path','rimraf','../../config/environment','./userSmsQueue.attributes','exports','define','UserSmsQueue','user_has_sms_queues','lodash','util','../../config/logger','api','moment'];(function(_0x430a40,_0x133017){var _0x2fcbdd=function(_0x1c7a25){while(--_0x1c7a25){_0x430a40['push'](_0x430a40['shift']());}};_0x2fcbdd(++_0x133017);}(_0x9582,0x95));var _0x2958=function(_0x4f5243,_0x192883){_0x4f5243=_0x4f5243-0x0;var _0x266cc0=_0x9582[_0x4f5243];return _0x266cc0;};'use strict';var _=require(_0x2958('0x0'));var util=require(_0x2958('0x1'));var logger=require(_0x2958('0x2'))(_0x2958('0x3'));var moment=require(_0x2958('0x4'));var BPromise=require(_0x2958('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2958('0x6'));var rimraf=require(_0x2958('0x7'));var config=require(_0x2958('0x8'));var attributes=require(_0x2958('0x9'));module[_0x2958('0xa')]=function(_0xbde128,_0x88ffaa){return _0xbde128[_0x2958('0xb')](_0x2958('0xc'),attributes,{'tableName':_0x2958('0xd'),'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 c50ef01..2e5ead1 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 _0xb7db=['error','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s'];(function(_0x541c3b,_0x1019c6){var _0x2ab34b=function(_0x42b30e){while(--_0x42b30e){_0x541c3b['push'](_0x541c3b['shift']());}};_0x2ab34b(++_0x1019c6);}(_0xb7db,0x114));var _0xbb7d=function(_0x125526,_0x4e8254){_0x125526=_0x125526-0x0;var _0x81a07e=_0xb7db[_0x125526];return _0x81a07e;};'use strict';var _=require(_0xbb7d('0x0'));var util=require(_0xbb7d('0x1'));var moment=require(_0xbb7d('0x2'));var BPromise=require(_0xbb7d('0x3'));var rs=require(_0xbb7d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb7d('0x5'))['db'];var utils=require(_0xbb7d('0x6'));var logger=require(_0xbb7d('0x7'))(_0xbb7d('0x8'));var config=require(_0xbb7d('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xbb7d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3f29b6,_0x28b414,_0x2903ca){return new BPromise(function(_0x4ad3fb,_0x46ffdf){return client[_0xbb7d('0xb')](_0x3f29b6,_0x2903ca)[_0xbb7d('0xc')](function(_0x5b9e44){logger[_0xbb7d('0xd')](_0xbb7d('0xe'),_0x28b414,_0xbb7d('0xf'));logger[_0xbb7d('0x10')](_0xbb7d('0x11'),_0x28b414,_0xbb7d('0xf'),JSON['stringify'](_0x5b9e44));if(_0x5b9e44[_0xbb7d('0x12')]){if(_0x5b9e44[_0xbb7d('0x12')]['code']===0x1f4){logger[_0xbb7d('0x12')](_0xbb7d('0xe'),_0x28b414,_0x5b9e44[_0xbb7d('0x12')]['message']);return _0x46ffdf(_0x5b9e44[_0xbb7d('0x12')][_0xbb7d('0x13')]);}logger[_0xbb7d('0x12')](_0xbb7d('0xe'),_0x28b414,_0x5b9e44[_0xbb7d('0x12')]['message']);return _0x4ad3fb(_0x5b9e44['error'][_0xbb7d('0x13')]);}else{logger[_0xbb7d('0xd')](_0xbb7d('0xe'),_0x28b414,_0xbb7d('0xf'));_0x4ad3fb(_0x5b9e44[_0xbb7d('0x14')]['message']);}})['catch'](function(_0x33661d){logger[_0xbb7d('0x12')](_0xbb7d('0xe'),_0x28b414,_0x33661d);_0x46ffdf(_0x33661d);});});} \ No newline at end of file +var _0x0218=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','debug','stringify','error','code','message','UserSmsQueue,\x20%s,\x20%s','request\x20sent','catch'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x0218,0xc6));var _0x8021=function(_0xe16645,_0x91e47c){_0xe16645=_0xe16645-0x0;var _0x27f758=_0x0218[_0xe16645];return _0x27f758;};'use strict';var _=require(_0x8021('0x0'));var util=require(_0x8021('0x1'));var moment=require('moment');var BPromise=require(_0x8021('0x2'));var rs=require(_0x8021('0x3'));var fs=require('fs');var Redis=require(_0x8021('0x4'));var db=require(_0x8021('0x5'))['db'];var utils=require(_0x8021('0x6'));var logger=require('../../config/logger')(_0x8021('0x7'));var config=require(_0x8021('0x8'));var jayson=require(_0x8021('0x9'));var client=jayson[_0x8021('0xa')][_0x8021('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x56b7e4,_0x4596e3,_0x147e78){return new BPromise(function(_0x3add3e,_0x19f2df){return client[_0x8021('0xc')](_0x56b7e4,_0x147e78)['then'](function(_0x141220){logger[_0x8021('0xd')]('UserSmsQueue,\x20%s,\x20%s',_0x4596e3,'request\x20sent');logger[_0x8021('0xe')]('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x4596e3,'request\x20sent',JSON[_0x8021('0xf')](_0x141220));if(_0x141220[_0x8021('0x10')]){if(_0x141220[_0x8021('0x10')][_0x8021('0x11')]===0x1f4){logger[_0x8021('0x10')]('UserSmsQueue,\x20%s,\x20%s',_0x4596e3,_0x141220[_0x8021('0x10')][_0x8021('0x12')]);return _0x19f2df(_0x141220[_0x8021('0x10')][_0x8021('0x12')]);}logger['error']('UserSmsQueue,\x20%s,\x20%s',_0x4596e3,_0x141220[_0x8021('0x10')]['message']);return _0x3add3e(_0x141220[_0x8021('0x10')][_0x8021('0x12')]);}else{logger['info'](_0x8021('0x13'),_0x4596e3,_0x8021('0x14'));_0x3add3e(_0x141220['result'][_0x8021('0x12')]);}})[_0x8021('0x15')](function(_0xd4f32a){logger['error']('UserSmsQueue,\x20%s,\x20%s',_0x4596e3,_0xd4f32a);_0x19f2df(_0xd4f32a);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/index.js b/server/api/userVoicePrefix/index.js index 4552e97..d121c30 100644 --- a/server/api/userVoicePrefix/index.js +++ b/server/api/userVoicePrefix/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(_0x3e7aa0,_0x58b6e6){var _0x51345e=function(_0x1a0df7){while(--_0x1a0df7){_0x3e7aa0['push'](_0x3e7aa0['shift']());}};_0x51345e(++_0x58b6e6);}(_0xe706,0xa3));var _0x6e70=function(_0x32b30c,_0x4c5567){_0x32b30c=_0x32b30c-0x0;var _0x59bc79=_0xe706[_0x32b30c];return _0x59bc79;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x231522,_0x2ec5df){var _0x349f51=function(_0x234c9f){while(--_0x234c9f){_0x231522['push'](_0x231522['shift']());}};_0x349f51(++_0x2ec5df);}(_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/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index 932f31c..c2407a6 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 _0x0083=['INTEGER','sequelize','exports'];(function(_0x34cc9f,_0x4d891a){var _0x1991d3=function(_0x47284b){while(--_0x47284b){_0x34cc9f['push'](_0x34cc9f['shift']());}};_0x1991d3(++_0x4d891a);}(_0x0083,0x91));var _0x3008=function(_0x5bac50,_0x540d00){_0x5bac50=_0x5bac50-0x0;var _0x28afd5=_0x0083[_0x5bac50];return _0x28afd5;};'use strict';var Sequelize=require(_0x3008('0x0'));module[_0x3008('0x1')]={'UserId':{'type':Sequelize[_0x3008('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x3008('0x2')]}}; \ No newline at end of file +var _0x91cf=['exports'];(function(_0x2a2032,_0x4838cd){var _0x1b9a39=function(_0xfb6911){while(--_0xfb6911){_0x2a2032['push'](_0x2a2032['shift']());}};_0x1b9a39(++_0x4838cd);}(_0x91cf,0x7c));var _0xf91c=function(_0x466aeb,_0x3a35bf){_0x466aeb=_0x466aeb-0x0;var _0x57818e=_0x91cf[_0x466aeb];return _0x57818e;};'use strict';var Sequelize=require('sequelize');module[_0xf91c('0x0')]={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index e697bf3..eddfbca 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(_0x3c2c39,_0x1f3aac){var _0x1ad730=function(_0x169396){while(--_0x169396){_0x3c2c39['push'](_0x3c2c39['shift']());}};_0x1ad730(++_0x1f3aac);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'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(_0x435471,_0x275205){var _0x39a70d=function(_0x2c225b){while(--_0x2c225b){_0x435471['push'](_0x435471['shift']());}};_0x39a70d(++_0x275205);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'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/userVoicePrefix/userVoicePrefix.rpc.js b/server/api/userVoicePrefix/userVoicePrefix.rpc.js index ea50006..ac53ece 100644 --- a/server/api/userVoicePrefix/userVoicePrefix.rpc.js +++ b/server/api/userVoicePrefix/userVoicePrefix.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x11a4=['request\x20sent','debug','UserVoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','info','UserVoicePrefix,\x20%s,\x20%s'];(function(_0x5f0c76,_0x44b266){var _0x308606=function(_0x14bc96){while(--_0x14bc96){_0x5f0c76['push'](_0x5f0c76['shift']());}};_0x308606(++_0x44b266);}(_0x11a4,0x1d7));var _0x411a=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x11a4[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x411a('0x0'));var util=require(_0x411a('0x1'));var moment=require(_0x411a('0x2'));var BPromise=require(_0x411a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x411a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x411a('0x5'));var logger=require('../../config/logger')(_0x411a('0x6'));var config=require(_0x411a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x411a('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xacad10,_0x3f5968,_0x1ec106){return new BPromise(function(_0x259dac,_0x1530d1){return client[_0x411a('0x9')](_0xacad10,_0x1ec106)[_0x411a('0xa')](function(_0xcdc0ed){logger[_0x411a('0xb')](_0x411a('0xc'),_0x3f5968,_0x411a('0xd'));logger[_0x411a('0xe')](_0x411a('0xf'),_0x3f5968,'request\x20sent',JSON[_0x411a('0x10')](_0xcdc0ed));if(_0xcdc0ed[_0x411a('0x11')]){if(_0xcdc0ed[_0x411a('0x11')][_0x411a('0x12')]===0x1f4){logger[_0x411a('0x11')](_0x411a('0xc'),_0x3f5968,_0xcdc0ed['error'][_0x411a('0x13')]);return _0x1530d1(_0xcdc0ed[_0x411a('0x11')][_0x411a('0x13')]);}logger['error']('UserVoicePrefix,\x20%s,\x20%s',_0x3f5968,_0xcdc0ed[_0x411a('0x11')][_0x411a('0x13')]);return _0x259dac(_0xcdc0ed[_0x411a('0x11')]['message']);}else{logger[_0x411a('0xb')](_0x411a('0xc'),_0x3f5968,'request\x20sent');_0x259dac(_0xcdc0ed[_0x411a('0x14')][_0x411a('0x13')]);}})[_0x411a('0x15')](function(_0x59df42){logger[_0x411a('0x11')](_0x411a('0xc'),_0x3f5968,_0x59df42);_0x1530d1(_0x59df42);});});} \ No newline at end of file +var _0x62f5=['request\x20sent','debug','UserVoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','UserVoicePrefix,\x20%s,\x20%s'];(function(_0x1f6187,_0x4ec52c){var _0x386fae=function(_0x35b746){while(--_0x35b746){_0x1f6187['push'](_0x1f6187['shift']());}};_0x386fae(++_0x4ec52c);}(_0x62f5,0x7b));var _0x562f=function(_0x5ad6d0,_0x2c3efd){_0x5ad6d0=_0x5ad6d0-0x0;var _0x361670=_0x62f5[_0x5ad6d0];return _0x361670;};'use strict';var _=require(_0x562f('0x0'));var util=require(_0x562f('0x1'));var moment=require('moment');var BPromise=require(_0x562f('0x2'));var rs=require(_0x562f('0x3'));var fs=require('fs');var Redis=require(_0x562f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x562f('0x5'));var logger=require(_0x562f('0x6'))(_0x562f('0x7'));var config=require(_0x562f('0x8'));var jayson=require(_0x562f('0x9'));var client=jayson['client'][_0x562f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x24dbda,_0x5ede60,_0x91c573){return new BPromise(function(_0x3635aa,_0x4fcd9b){return client[_0x562f('0xb')](_0x24dbda,_0x91c573)[_0x562f('0xc')](function(_0x2f5d51){logger[_0x562f('0xd')](_0x562f('0xe'),_0x5ede60,_0x562f('0xf'));logger[_0x562f('0x10')](_0x562f('0x11'),_0x5ede60,_0x562f('0xf'),JSON[_0x562f('0x12')](_0x2f5d51));if(_0x2f5d51[_0x562f('0x13')]){if(_0x2f5d51[_0x562f('0x13')]['code']===0x1f4){logger['error']('UserVoicePrefix,\x20%s,\x20%s',_0x5ede60,_0x2f5d51[_0x562f('0x13')][_0x562f('0x14')]);return _0x4fcd9b(_0x2f5d51[_0x562f('0x13')]['message']);}logger['error'](_0x562f('0xe'),_0x5ede60,_0x2f5d51[_0x562f('0x13')]['message']);return _0x3635aa(_0x2f5d51[_0x562f('0x13')]['message']);}else{logger[_0x562f('0xd')](_0x562f('0xe'),_0x5ede60,_0x562f('0xf'));_0x3635aa(_0x2f5d51[_0x562f('0x15')][_0x562f('0x14')]);}})[_0x562f('0x16')](function(_0x366aeb){logger['error']('UserVoicePrefix,\x20%s,\x20%s',_0x5ede60,_0x366aeb);_0x4fcd9b(_0x366aeb);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueue/index.js b/server/api/userVoiceQueue/index.js index 06bda3b..bb6294a 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(_0x2eefdc,_0x331c51){var _0x501d09=function(_0x52bef4){while(--_0x52bef4){_0x2eefdc['push'](_0x2eefdc['shift']());}};_0x501d09(++_0x331c51);}(_0x70e0,0x17b));var _0x070e=function(_0x18f1af,_0x49bcae){_0x18f1af=_0x18f1af-0x0;var _0x319901=_0x70e0[_0x18f1af];return _0x319901;};'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(_0x80582e,_0x37130a){var _0x262b9a=function(_0x263111){while(--_0x263111){_0x80582e['push'](_0x80582e['shift']());}};_0x262b9a(++_0x37130a);}(_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/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index d8b5a0a..4941274 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 _0x824b=['INTEGER'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x824b,0x10e));var _0xb824=function(_0x1a1d54,_0x4f60b1){_0x1a1d54=_0x1a1d54-0x0;var _0x593ddf=_0x824b[_0x1a1d54];return _0x593ddf;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0xb824('0x0')],'defaultValue':0x0}}; \ No newline at end of file +var _0x0caf=['sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0caf,0x8a));var _0xf0ca=function(_0x5723f4,_0xef5de4){_0x5723f4=_0x5723f4-0x0;var _0x4909ad=_0x0caf[_0x5723f4];return _0x4909ad;};'use strict';var Sequelize=require(_0xf0ca('0x0'));module[_0xf0ca('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'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 483fddc..d3d8a96 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 _0x96ee=['api','moment','path','rimraf','../../config/environment','exports','user_has_voice_queues','../../config/logger'];(function(_0x24930c,_0xf01ff1){var _0x3ff362=function(_0x36f83b){while(--_0x36f83b){_0x24930c['push'](_0x24930c['shift']());}};_0x3ff362(++_0xf01ff1);}(_0x96ee,0x177));var _0xe96e=function(_0x2deac4,_0xc27a2b){_0x2deac4=_0x2deac4-0x0;var _0x1c0bda=_0x96ee[_0x2deac4];return _0x1c0bda;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe96e('0x0'))(_0xe96e('0x1'));var moment=require(_0xe96e('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe96e('0x3'));var rimraf=require(_0xe96e('0x4'));var config=require(_0xe96e('0x5'));var attributes=require('./userVoiceQueue.attributes');module[_0xe96e('0x6')]=function(_0x383de3,_0x4b9128){return _0x383de3['define']('UserVoiceQueue',attributes,{'tableName':_0xe96e('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x540a=['api','moment','bluebird','request-promise','path','./userVoiceQueue.attributes','exports','UserVoiceQueue','user_has_voice_queues','lodash','util','../../config/logger'];(function(_0x4df6f9,_0x44bd65){var _0x4b1a73=function(_0xf5adb7){while(--_0xf5adb7){_0x4df6f9['push'](_0x4df6f9['shift']());}};_0x4b1a73(++_0x44bd65);}(_0x540a,0x17d));var _0xa540=function(_0x4bffe7,_0x96d09f){_0x4bffe7=_0x4bffe7-0x0;var _0x470090=_0x540a[_0x4bffe7];return _0x470090;};'use strict';var _=require(_0xa540('0x0'));var util=require(_0xa540('0x1'));var logger=require(_0xa540('0x2'))(_0xa540('0x3'));var moment=require(_0xa540('0x4'));var BPromise=require(_0xa540('0x5'));var rp=require(_0xa540('0x6'));var fs=require('fs');var path=require(_0xa540('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa540('0x8'));module[_0xa540('0x9')]=function(_0x1d25a0,_0x412e42){return _0x1d25a0['define'](_0xa540('0xa'),attributes,{'tableName':_0xa540('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.rpc.js b/server/api/userVoiceQueue/userVoiceQueue.rpc.js index 7336142..a55a23a 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 _0x7448=['message','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','catch','util','moment','../../config/utils','../../config/logger','jayson/promise','http','request','info','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3c3978,_0xbfd82d){var _0x31bfee=function(_0x336c34){while(--_0x336c34){_0x3c3978['push'](_0x3c3978['shift']());}};_0x31bfee(++_0xbfd82d);}(_0x7448,0x7b));var _0x8744=function(_0x2aead8,_0x13bd4a){_0x2aead8=_0x2aead8-0x0;var _0x291f35=_0x7448[_0x2aead8];return _0x291f35;};'use strict';var _=require('lodash');var util=require(_0x8744('0x0'));var moment=require(_0x8744('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8744('0x2'));var logger=require(_0x8744('0x3'))('rpc');var config=require('../../config/environment');var jayson=require(_0x8744('0x4'));var client=jayson['client'][_0x8744('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x2a39a4,_0x49a619,_0x1869cb){return new BPromise(function(_0xa06c98,_0x401e35){return client[_0x8744('0x6')](_0x2a39a4,_0x1869cb)['then'](function(_0xfc32fb){logger[_0x8744('0x7')]('UserVoiceQueue,\x20%s,\x20%s',_0x49a619,'request\x20sent');logger[_0x8744('0x8')](_0x8744('0x9'),_0x49a619,'request\x20sent',JSON[_0x8744('0xa')](_0xfc32fb));if(_0xfc32fb['error']){if(_0xfc32fb[_0x8744('0xb')][_0x8744('0xc')]===0x1f4){logger[_0x8744('0xb')]('UserVoiceQueue,\x20%s,\x20%s',_0x49a619,_0xfc32fb[_0x8744('0xb')][_0x8744('0xd')]);return _0x401e35(_0xfc32fb[_0x8744('0xb')][_0x8744('0xd')]);}logger['error'](_0x8744('0xe'),_0x49a619,_0xfc32fb[_0x8744('0xb')][_0x8744('0xd')]);return _0xa06c98(_0xfc32fb[_0x8744('0xb')][_0x8744('0xd')]);}else{logger[_0x8744('0x7')](_0x8744('0xe'),_0x49a619,_0x8744('0xf'));_0xa06c98(_0xfc32fb['result'][_0x8744('0xd')]);}})[_0x8744('0x10')](function(_0x44fb9c){logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0x49a619,_0x44fb9c);_0x401e35(_0x44fb9c);});});} \ No newline at end of file +var _0xaadd=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x3ee4d1,_0x35cbfd){var _0x24b28a=function(_0x5a60d4){while(--_0x5a60d4){_0x3ee4d1['push'](_0x3ee4d1['shift']());}};_0x24b28a(++_0x35cbfd);}(_0xaadd,0xba));var _0xdaad=function(_0xe775be,_0x4822af){_0xe775be=_0xe775be-0x0;var _0x49e73c=_0xaadd[_0xe775be];return _0x49e73c;};'use strict';var _=require(_0xdaad('0x0'));var util=require(_0xdaad('0x1'));var moment=require(_0xdaad('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdaad('0x3'));var db=require(_0xdaad('0x4'))['db'];var utils=require(_0xdaad('0x5'));var logger=require(_0xdaad('0x6'))(_0xdaad('0x7'));var config=require(_0xdaad('0x8'));var jayson=require(_0xdaad('0x9'));var client=jayson[_0xdaad('0xa')][_0xdaad('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x510f41,_0x34e441,_0x39e9b5){return new BPromise(function(_0x2b1dbf,_0x15ba10){return client['request'](_0x510f41,_0x39e9b5)['then'](function(_0x3baed3){logger[_0xdaad('0xc')](_0xdaad('0xd'),_0x34e441,_0xdaad('0xe'));logger[_0xdaad('0xf')]('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x34e441,_0xdaad('0xe'),JSON[_0xdaad('0x10')](_0x3baed3));if(_0x3baed3['error']){if(_0x3baed3[_0xdaad('0x11')][_0xdaad('0x12')]===0x1f4){logger[_0xdaad('0x11')](_0xdaad('0xd'),_0x34e441,_0x3baed3[_0xdaad('0x11')][_0xdaad('0x13')]);return _0x15ba10(_0x3baed3[_0xdaad('0x11')][_0xdaad('0x13')]);}logger[_0xdaad('0x11')](_0xdaad('0xd'),_0x34e441,_0x3baed3[_0xdaad('0x11')][_0xdaad('0x13')]);return _0x2b1dbf(_0x3baed3[_0xdaad('0x11')][_0xdaad('0x13')]);}else{logger[_0xdaad('0xc')](_0xdaad('0xd'),_0x34e441,_0xdaad('0xe'));_0x2b1dbf(_0x3baed3['result']['message']);}})[_0xdaad('0x14')](function(_0x48f67f){logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0x34e441,_0x48f67f);_0x15ba10(_0x48f67f);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 3252c4e..82edd2f 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x193a6e,_0x45dd00){var _0x599a9b=function(_0x37a9e2){while(--_0x37a9e2){_0x193a6e['push'](_0x193a6e['shift']());}};_0x599a9b(++_0x45dd00);}(_0x9c44,0x178));var _0x49c4=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x9c44[_0x18ab2a];return _0x16dcee;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x58dcbd,_0x3cdfb2){var _0x3e0a9f=function(_0x2d8996){while(--_0x2d8996){_0x58dcbd['push'](_0x58dcbd['shift']());}};_0x3e0a9f(++_0x3cdfb2);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x41d02a,_0x355e19){_0x41d02a=_0x41d02a-0x0;var _0x4c3983=_0xcb91[_0x41d02a];return _0x4c3983;};'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/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index ec9d658..0b741fe 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 _0xe4bd=['exports','Required\x20by\x20Asterisk','STRING','INTEGER','queue_interface','sequelize'];(function(_0x45e4fc,_0x514e62){var _0x593204=function(_0x4e2d70){while(--_0x4e2d70){_0x45e4fc['push'](_0x45e4fc['shift']());}};_0x593204(++_0x514e62);}(_0xe4bd,0x89));var _0xde4b=function(_0x408963,_0x38dd19){_0x408963=_0x408963-0x0;var _0x3162e2=_0xe4bd[_0x408963];return _0x3162e2;};'use strict';var Sequelize=require(_0xde4b('0x0'));module[_0xde4b('0x1')]={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0xde4b('0x2')},'membername':{'type':Sequelize[_0xde4b('0x3')],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0xde4b('0x3')],'allowNull':![],'unique':'queue_interface','comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize[_0xde4b('0x4')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xde4b('0x5'),'comment':_0xde4b('0x2')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0xde4b('0x2')},'paused':{'type':Sequelize[_0xde4b('0x4')](0xb),'defaultValue':0x0,'comment':_0xde4b('0x2')}}; \ No newline at end of file +var _0xc4ad=['sequelize','INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface'];(function(_0x27a24c,_0x3ece9c){var _0x1f3d2a=function(_0x4e393d){while(--_0x4e393d){_0x27a24c['push'](_0x27a24c['shift']());}};_0x1f3d2a(++_0x3ece9c);}(_0xc4ad,0xd2));var _0xdc4a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc4ad[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xdc4a('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xdc4a('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xdc4a('0x2')},'membername':{'type':Sequelize[_0xdc4a('0x3')],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize[_0xdc4a('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xdc4a('0x3')],'allowNull':![],'unique':'queue_interface','comment':_0xdc4a('0x2')},'VoiceQueueId':{'type':Sequelize[_0xdc4a('0x1')],'allowNull':![]},'interface':{'type':Sequelize[_0xdc4a('0x3')],'allowNull':![],'unique':_0xdc4a('0x4'),'comment':_0xdc4a('0x2')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0xdc4a('0x2')},'paused':{'type':Sequelize[_0xdc4a('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 b51f5f2..5e8cd77 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 _0xe347=['events','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x3fa787,_0x42e177){var _0x38aebe=function(_0x490b12){while(--_0x490b12){_0x3fa787['push'](_0x3fa787['shift']());}};_0x38aebe(++_0x42e177);}(_0xe347,0x1a0));var _0x7e34=function(_0x560485,_0x244601){_0x560485=_0x560485-0x0;var _0x3e7f69=_0xe347[_0x560485];return _0x3e7f69;};'use strict';var EventEmitter=require(_0x7e34('0x0'));var UserVoiceQueueRt=require('../../mysqldb')['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x7e34('0x1')](0x0);var events={'afterCreate':_0x7e34('0x2'),'afterUpdate':_0x7e34('0x3'),'afterDestroy':'remove'};function emitEvent(_0x59254f){return function(_0x38d949,_0x3cd627,_0x761ab4){UserVoiceQueueRtEvents[_0x7e34('0x4')](_0x59254f+':'+_0x38d949['id'],_0x38d949);UserVoiceQueueRtEvents[_0x7e34('0x4')](_0x59254f,_0x38d949);_0x761ab4(null);};}for(var e in events){if(events[_0x7e34('0x5')](e)){var event=events[e];UserVoiceQueueRt[_0x7e34('0x6')](e,emitEvent(event));}}module[_0x7e34('0x7')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x6257=['UserVoiceQueueRt','update','emit','hasOwnProperty','exports'];(function(_0x29c336,_0x730487){var _0x34dd1f=function(_0x488b4d){while(--_0x488b4d){_0x29c336['push'](_0x29c336['shift']());}};_0x34dd1f(++_0x730487);}(_0x6257,0xbe));var _0x7625=function(_0x1ba68a,_0x184e43){_0x1ba68a=_0x1ba68a-0x0;var _0x486169=_0x6257[_0x1ba68a];return _0x486169;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require('../../mysqldb')['db'][_0x7625('0x0')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x7625('0x1'),'afterDestroy':'remove'};function emitEvent(_0x2fc2f4){return function(_0x31459e,_0x561aa6,_0x3a9a3f){UserVoiceQueueRtEvents['emit'](_0x2fc2f4+':'+_0x31459e['id'],_0x31459e);UserVoiceQueueRtEvents[_0x7625('0x2')](_0x2fc2f4,_0x31459e);_0x3a9a3f(null);};}for(var e in events){if(events[_0x7625('0x3')](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module[_0x7625('0x4')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index 5feb13b..3e0a074 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 _0x52f4=['UserVoiceQueueRt','user_has_voice_queues_rt','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./userVoiceQueueRt.attributes','exports','define'];(function(_0x32c5bc,_0x2afe0c){var _0x8c5cf6=function(_0xc89ba8){while(--_0xc89ba8){_0x32c5bc['push'](_0x32c5bc['shift']());}};_0x8c5cf6(++_0x2afe0c);}(_0x52f4,0x1b2));var _0x452f=function(_0x270157,_0x49598e){_0x270157=_0x270157-0x0;var _0x4323cf=_0x52f4[_0x270157];return _0x4323cf;};'use strict';var _=require('lodash');var util=require(_0x452f('0x0'));var logger=require(_0x452f('0x1'))('api');var moment=require(_0x452f('0x2'));var BPromise=require(_0x452f('0x3'));var rp=require(_0x452f('0x4'));var fs=require('fs');var path=require(_0x452f('0x5'));var rimraf=require('rimraf');var config=require(_0x452f('0x6'));var attributes=require(_0x452f('0x7'));module[_0x452f('0x8')]=function(_0x3e4737,_0x481f2e){return _0x3e4737[_0x452f('0x9')](_0x452f('0xa'),attributes,{'tableName':_0x452f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5a6e=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','user_has_voice_queues_rt','lodash'];(function(_0x162048,_0x411f1b){var _0x2339bf=function(_0x4101a2){while(--_0x4101a2){_0x162048['push'](_0x162048['shift']());}};_0x2339bf(++_0x411f1b);}(_0x5a6e,0x1d8));var _0xe5a6=function(_0x285c85,_0x132c21){_0x285c85=_0x285c85-0x0;var _0x2f81cd=_0x5a6e[_0x285c85];return _0x2f81cd;};'use strict';var _=require(_0xe5a6('0x0'));var util=require('util');var logger=require(_0xe5a6('0x1'))('api');var moment=require(_0xe5a6('0x2'));var BPromise=require(_0xe5a6('0x3'));var rp=require(_0xe5a6('0x4'));var fs=require('fs');var path=require(_0xe5a6('0x5'));var rimraf=require(_0xe5a6('0x6'));var config=require(_0xe5a6('0x7'));var attributes=require('./userVoiceQueueRt.attributes');module[_0xe5a6('0x8')]=function(_0x16406e,_0x201fe3){return _0x16406e[_0xe5a6('0x9')]('UserVoiceQueueRt',attributes,{'tableName':_0xe5a6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js index 0122f04..5bc5fca 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 _0x1085=['GetVoiceQueueRtPauses','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','request','then','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','findAll','options','raw','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null'];(function(_0x293fd,_0x32d447){var _0x5329bb=function(_0x204352){while(--_0x204352){_0x293fd['push'](_0x293fd['shift']());}};_0x5329bb(++_0x32d447);}(_0x1085,0x131));var _0x5108=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1085[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x5108('0x0'));var moment=require(_0x5108('0x1'));var BPromise=require(_0x5108('0x2'));var rs=require(_0x5108('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5108('0x4'))['db'];var utils=require(_0x5108('0x5'));var logger=require(_0x5108('0x6'))(_0x5108('0x7'));var config=require(_0x5108('0x8'));var jayson=require(_0x5108('0x9'));var client=jayson[_0x5108('0xa')][_0x5108('0xb')]({'port':0x232a});config[_0x5108('0xc')]=_['defaults'](config[_0x5108('0xc')],{'host':_0x5108('0xd'),'port':0x18eb});var socket=require(_0x5108('0xe'))(new Redis(config[_0x5108('0xc')]));require(_0x5108('0xf'))[_0x5108('0x10')](socket);function respondWithRpcPromise(_0x3c1da9,_0x2726ba,_0x5082cf){return new BPromise(function(_0x58d945,_0x5b5ba1){return client[_0x5108('0x11')](_0x3c1da9,_0x5082cf)[_0x5108('0x12')](function(_0x2d4bf2){logger['info'](_0x5108('0x13'),_0x2726ba,_0x5108('0x14'));logger[_0x5108('0x15')](_0x5108('0x16'),_0x2726ba,_0x5108('0x14'),JSON[_0x5108('0x17')](_0x2d4bf2));if(_0x2d4bf2[_0x5108('0x18')]){if(_0x2d4bf2[_0x5108('0x18')]['code']===0x1f4){logger[_0x5108('0x18')](_0x5108('0x13'),_0x2726ba,_0x2d4bf2[_0x5108('0x18')][_0x5108('0x19')]);return _0x5b5ba1(_0x2d4bf2[_0x5108('0x18')][_0x5108('0x19')]);}logger[_0x5108('0x18')](_0x5108('0x13'),_0x2726ba,_0x2d4bf2['error'][_0x5108('0x19')]);return _0x58d945(_0x2d4bf2[_0x5108('0x18')][_0x5108('0x19')]);}else{logger[_0x5108('0x1a')](_0x5108('0x13'),_0x2726ba,_0x5108('0x14'));_0x58d945(_0x2d4bf2[_0x5108('0x1b')][_0x5108('0x19')]);}})[_0x5108('0x1c')](function(_0x29e791){logger[_0x5108('0x18')](_0x5108('0x13'),_0x2726ba,_0x29e791);_0x5b5ba1(_0x29e791);});});}exports['GetVoiceQueueRtPauses']=function(_0xc665ef){var _0x3fd698=this;return new Promise(function(_0x33dcd4,_0x28714d){return db['UserVoiceQueueRt'][_0x5108('0x1d')]({'raw':_0xc665ef['options']?_0xc665ef[_0x5108('0x1e')][_0x5108('0x1f')]===undefined?!![]:![]:!![],'where':_0xc665ef['options']?_0xc665ef['options'][_0x5108('0x20')]||null:null,'attributes':[[db[_0x5108('0x21')]['fn'](_0x5108('0x22'),db['sequelize']['fn']('IF',db['sequelize'][_0x5108('0x23')](_0x5108('0x24')))),'outboundQueuePauses']]})[_0x5108('0x12')](function(_0x597e95){logger[_0x5108('0x1a')]('GetVoiceQueueRtPauses',_0xc665ef);logger[_0x5108('0x15')](_0x5108('0x25'),_0xc665ef,JSON[_0x5108('0x17')](_0x597e95));_0x33dcd4(_0x597e95);})[_0x5108('0x1c')](function(_0x2f2558){logger[_0x5108('0x18')]('GetVoiceQueueRtPauses',_0x2f2558[_0x5108('0x19')],_0xc665ef);_0x28714d(_0x3fd698[_0x5108('0x18')](0x1f4,_0x2f2558[_0x5108('0x19')]));});});}; \ No newline at end of file +var _0x5c1a=['UserVoiceQueueRt','findAll','options','raw','sequelize','COUNT','literal','outboundQueuePauses','lodash','util','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','redis','localhost','register','request','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetVoiceQueueRtPauses'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5c1a,0x1ca));var _0xa5c1=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x5c1a[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xa5c1('0x0'));var util=require(_0xa5c1('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa5c1('0x2'));var db=require(_0xa5c1('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa5c1('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa5c1('0x5'));var client=jayson[_0xa5c1('0x6')][_0xa5c1('0x7')]({'port':0x232a});config[_0xa5c1('0x8')]=_['defaults'](config[_0xa5c1('0x8')],{'host':_0xa5c1('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./userVoiceQueueRt.socket')[_0xa5c1('0xa')](socket);function respondWithRpcPromise(_0x1f0ad3,_0x3c723e,_0x3917c0){return new BPromise(function(_0x596506,_0x44e17b){return client[_0xa5c1('0xb')](_0x1f0ad3,_0x3917c0)['then'](function(_0x5567c9){logger[_0xa5c1('0xc')](_0xa5c1('0xd'),_0x3c723e,_0xa5c1('0xe'));logger[_0xa5c1('0xf')](_0xa5c1('0x10'),_0x3c723e,_0xa5c1('0xe'),JSON[_0xa5c1('0x11')](_0x5567c9));if(_0x5567c9[_0xa5c1('0x12')]){if(_0x5567c9['error']['code']===0x1f4){logger[_0xa5c1('0x12')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x3c723e,_0x5567c9[_0xa5c1('0x12')][_0xa5c1('0x13')]);return _0x44e17b(_0x5567c9[_0xa5c1('0x12')][_0xa5c1('0x13')]);}logger[_0xa5c1('0x12')](_0xa5c1('0xd'),_0x3c723e,_0x5567c9[_0xa5c1('0x12')][_0xa5c1('0x13')]);return _0x596506(_0x5567c9[_0xa5c1('0x12')][_0xa5c1('0x13')]);}else{logger[_0xa5c1('0xc')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x3c723e,_0xa5c1('0xe'));_0x596506(_0x5567c9[_0xa5c1('0x14')]['message']);}})['catch'](function(_0x45e7b5){logger[_0xa5c1('0x12')](_0xa5c1('0xd'),_0x3c723e,_0x45e7b5);_0x44e17b(_0x45e7b5);});});}exports[_0xa5c1('0x15')]=function(_0x4e2708){var _0x3cd316=this;return new Promise(function(_0x378a3f,_0x40765d){return db[_0xa5c1('0x16')][_0xa5c1('0x17')]({'raw':_0x4e2708[_0xa5c1('0x18')]?_0x4e2708['options'][_0xa5c1('0x19')]===undefined?!![]:![]:!![],'where':_0x4e2708[_0xa5c1('0x18')]?_0x4e2708['options']['where']||null:null,'attributes':[[db[_0xa5c1('0x1a')]['fn'](_0xa5c1('0x1b'),db[_0xa5c1('0x1a')]['fn']('IF',db[_0xa5c1('0x1a')][_0xa5c1('0x1c')]('`paused`\x20=\x201,\x201,\x20null'))),_0xa5c1('0x1d')]]})['then'](function(_0x5a5804){logger[_0xa5c1('0xc')]('GetVoiceQueueRtPauses',_0x4e2708);logger['debug'](_0xa5c1('0x15'),_0x4e2708,JSON[_0xa5c1('0x11')](_0x5a5804));_0x378a3f(_0x5a5804);})['catch'](function(_0x1e381f){logger['error'](_0xa5c1('0x15'),_0x1e381f[_0xa5c1('0x13')],_0x4e2708);_0x40765d(_0x3cd316[_0xa5c1('0x12')](0x1f4,_0x1e381f['message']));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index c4b4a59..c923342 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 _0xa786=['userVoiceQueueRt:','./userVoiceQueueRt.events','save','remove','emit','removeListener','register','length'];(function(_0x240261,_0x4fe66c){var _0x45c332=function(_0x4f367a){while(--_0x4f367a){_0x240261['push'](_0x240261['shift']());}};_0x45c332(++_0x4fe66c);}(_0xa786,0x71));var _0x6a78=function(_0x49cdfa,_0x5441bd){_0x49cdfa=_0x49cdfa-0x0;var _0x568128=_0xa786[_0x49cdfa];return _0x568128;};'use strict';var UserVoiceQueueRtEvents=require(_0x6a78('0x0'));var events=[_0x6a78('0x1'),_0x6a78('0x2'),'update'];function createListener(_0x30bd42,_0x49c803){return function(_0x5edaa9){_0x49c803[_0x6a78('0x3')](_0x30bd42,_0x5edaa9);};}function removeListener(_0x2b0fed,_0x3b3608){return function(){UserVoiceQueueRtEvents[_0x6a78('0x4')](_0x2b0fed,_0x3b3608);};}exports[_0x6a78('0x5')]=function(_0x112e35){for(var _0x386861=0x0,_0x4dd11b=events[_0x6a78('0x6')];_0x386861<_0x4dd11b;_0x386861++){var _0x103f4a=events[_0x386861];var _0x23ebbd=createListener(_0x6a78('0x7')+_0x103f4a,_0x112e35);UserVoiceQueueRtEvents['on'](_0x103f4a,_0x23ebbd);}}; \ No newline at end of file +var _0xce22=['removeListener','register','userVoiceQueueRt:','./userVoiceQueueRt.events','save','remove','update'];(function(_0xe9867,_0x57ff74){var _0x50af16=function(_0x4151db){while(--_0x4151db){_0xe9867['push'](_0xe9867['shift']());}};_0x50af16(++_0x57ff74);}(_0xce22,0xea));var _0x2ce2=function(_0x372b26,_0x2031d1){_0x372b26=_0x372b26-0x0;var _0x49f08f=_0xce22[_0x372b26];return _0x49f08f;};'use strict';var UserVoiceQueueRtEvents=require(_0x2ce2('0x0'));var events=[_0x2ce2('0x1'),_0x2ce2('0x2'),_0x2ce2('0x3')];function createListener(_0x3a106f,_0x47de4a){return function(_0xd7b953){_0x47de4a['emit'](_0x3a106f,_0xd7b953);};}function removeListener(_0x26b273,_0x1801be){return function(){UserVoiceQueueRtEvents[_0x2ce2('0x4')](_0x26b273,_0x1801be);};}exports[_0x2ce2('0x5')]=function(_0x25110e){for(var _0x29f060=0x0,_0x6515b5=events['length'];_0x29f060<_0x6515b5;_0x29f060++){var _0x225737=events[_0x29f060];var _0x111f56=createListener(_0x2ce2('0x6')+_0x225737,_0x25110e);UserVoiceQueueRtEvents['on'](_0x225737,_0x111f56);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 73146b2..e3a3d52 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(_0x44d4db,_0x5a1467){var _0x514651=function(_0x420aa7){while(--_0x420aa7){_0x44d4db['push'](_0x44d4db['shift']());}};_0x514651(++_0x5a1467);}(_0x70e0,0x17b));var _0x070e=function(_0x2b28cf,_0x1a5947){_0x2b28cf=_0x2b28cf-0x0;var _0x46468b=_0x70e0[_0x2b28cf];return _0x46468b;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x1b9edd,_0x66b166){var _0x4907c4=function(_0x538091){while(--_0x538091){_0x1b9edd['push'](_0x1b9edd['shift']());}};_0x4907c4(++_0x66b166);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 30262b0..2dae742 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 _0xeff9=['sequelize'];(function(_0x515be2,_0x51b3ff){var _0x514679=function(_0x562c51){while(--_0x562c51){_0x515be2['push'](_0x515be2['shift']());}};_0x514679(++_0x51b3ff);}(_0xeff9,0x9c));var _0x9eff=function(_0x425c30,_0x4c6c0a){_0x425c30=_0x425c30-0x0;var _0x5a2ef6=_0xeff9[_0x425c30];return _0x5a2ef6;};'use strict';var Sequelize=require(_0x9eff('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x1141=['INTEGER','sequelize'];(function(_0x1c6664,_0x45566e){var _0x33124b=function(_0x2c04bb){while(--_0x2c04bb){_0x1c6664['push'](_0x1c6664['shift']());}};_0x33124b(++_0x45566e);}(_0x1141,0xb1));var _0x1114=function(_0x1c30bf,_0x247c31){_0x1c30bf=_0x1c30bf-0x0;var _0x255b5e=_0x1141[_0x1c30bf];return _0x255b5e;};'use strict';var Sequelize=require(_0x1114('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x1114('0x1')],'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 c529947..64b8c6e 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 _0x20db=['api','moment','bluebird','request-promise','path','../../config/environment','./userWhatsappQueue.attributes','user_has_whatsapp_queues','lodash'];(function(_0x4da733,_0x498bfe){var _0x29c9b9=function(_0x3e12b5){while(--_0x3e12b5){_0x4da733['push'](_0x4da733['shift']());}};_0x29c9b9(++_0x498bfe);}(_0x20db,0x6b));var _0xb20d=function(_0x476918,_0x2ce58b){_0x476918=_0x476918-0x0;var _0x45472c=_0x20db[_0x476918];return _0x45472c;};'use strict';var _=require(_0xb20d('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb20d('0x1'));var moment=require(_0xb20d('0x2'));var BPromise=require(_0xb20d('0x3'));var rp=require(_0xb20d('0x4'));var fs=require('fs');var path=require(_0xb20d('0x5'));var rimraf=require('rimraf');var config=require(_0xb20d('0x6'));var attributes=require(_0xb20d('0x7'));module['exports']=function(_0x59265b,_0x4ae546){return _0x59265b['define']('UserWhatsappQueue',attributes,{'tableName':_0xb20d('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x99fc=['rimraf','../../config/environment','./userWhatsappQueue.attributes','exports','UserWhatsappQueue','user_has_whatsapp_queues','lodash','util','../../config/logger','api','moment','path'];(function(_0x3371c8,_0x2d8a6f){var _0x41b3c7=function(_0x2f9440){while(--_0x2f9440){_0x3371c8['push'](_0x3371c8['shift']());}};_0x41b3c7(++_0x2d8a6f);}(_0x99fc,0x16e));var _0xc99f=function(_0xe4dfb5,_0x58a25e){_0xe4dfb5=_0xe4dfb5-0x0;var _0x51d4aa=_0x99fc[_0xe4dfb5];return _0x51d4aa;};'use strict';var _=require(_0xc99f('0x0'));var util=require(_0xc99f('0x1'));var logger=require(_0xc99f('0x2'))(_0xc99f('0x3'));var moment=require(_0xc99f('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc99f('0x5'));var rimraf=require(_0xc99f('0x6'));var config=require(_0xc99f('0x7'));var attributes=require(_0xc99f('0x8'));module[_0xc99f('0x9')]=function(_0x5438aa,_0x1d4849){return _0x5438aa['define'](_0xc99f('0xa'),attributes,{'tableName':_0xc99f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js b/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js index e96ba87..2158b36 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 _0x9025=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch'];(function(_0x40adf5,_0x341a98){var _0x249f13=function(_0x39baa0){while(--_0x39baa0){_0x40adf5['push'](_0x40adf5['shift']());}};_0x249f13(++_0x341a98);}(_0x9025,0x1c8));var _0x5902=function(_0x1b61ec,_0xd28837){_0x1b61ec=_0x1b61ec-0x0;var _0x997d8a=_0x9025[_0x1b61ec];return _0x997d8a;};'use strict';var _=require(_0x5902('0x0'));var util=require(_0x5902('0x1'));var moment=require(_0x5902('0x2'));var BPromise=require(_0x5902('0x3'));var rs=require(_0x5902('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5902('0x5'))['db'];var utils=require(_0x5902('0x6'));var logger=require(_0x5902('0x7'))('rpc');var config=require(_0x5902('0x8'));var jayson=require(_0x5902('0x9'));var client=jayson[_0x5902('0xa')][_0x5902('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x219036,_0x4ec8e3,_0x2bbdc8){return new BPromise(function(_0x52e2f7,_0x549dfb){return client[_0x5902('0xc')](_0x219036,_0x2bbdc8)[_0x5902('0xd')](function(_0x2d5b7d){logger['info'](_0x5902('0xe'),_0x4ec8e3,_0x5902('0xf'));logger[_0x5902('0x10')]('UserWhatsappQueue,\x20%s,\x20%s,\x20%s',_0x4ec8e3,_0x5902('0xf'),JSON[_0x5902('0x11')](_0x2d5b7d));if(_0x2d5b7d[_0x5902('0x12')]){if(_0x2d5b7d[_0x5902('0x12')][_0x5902('0x13')]===0x1f4){logger[_0x5902('0x12')](_0x5902('0xe'),_0x4ec8e3,_0x2d5b7d[_0x5902('0x12')]['message']);return _0x549dfb(_0x2d5b7d[_0x5902('0x12')][_0x5902('0x14')]);}logger[_0x5902('0x12')]('UserWhatsappQueue,\x20%s,\x20%s',_0x4ec8e3,_0x2d5b7d[_0x5902('0x12')]['message']);return _0x52e2f7(_0x2d5b7d['error']['message']);}else{logger[_0x5902('0x15')](_0x5902('0xe'),_0x4ec8e3,'request\x20sent');_0x52e2f7(_0x2d5b7d[_0x5902('0x16')]['message']);}})[_0x5902('0x17')](function(_0x1a663d){logger[_0x5902('0x12')](_0x5902('0xe'),_0x4ec8e3,_0x1a663d);_0x549dfb(_0x1a663d);});});} \ No newline at end of file +var _0xc0f5=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','UserWhatsappQueue,\x20%s,\x20%s','message','catch','lodash'];(function(_0x4207f4,_0x1f778b){var _0x29a621=function(_0xa6f5b7){while(--_0xa6f5b7){_0x4207f4['push'](_0x4207f4['shift']());}};_0x29a621(++_0x1f778b);}(_0xc0f5,0xe5));var _0x5c0f=function(_0x50d16c,_0x2ccf7a){_0x50d16c=_0x50d16c-0x0;var _0x17971f=_0xc0f5[_0x50d16c];return _0x17971f;};'use strict';var _=require(_0x5c0f('0x0'));var util=require(_0x5c0f('0x1'));var moment=require(_0x5c0f('0x2'));var BPromise=require('bluebird');var rs=require(_0x5c0f('0x3'));var fs=require('fs');var Redis=require(_0x5c0f('0x4'));var db=require(_0x5c0f('0x5'))['db'];var utils=require(_0x5c0f('0x6'));var logger=require(_0x5c0f('0x7'))(_0x5c0f('0x8'));var config=require(_0x5c0f('0x9'));var jayson=require(_0x5c0f('0xa'));var client=jayson[_0x5c0f('0xb')][_0x5c0f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x14c0a9,_0x398217,_0x46a480){return new BPromise(function(_0x20f420,_0x2c53b6){return client['request'](_0x14c0a9,_0x46a480)['then'](function(_0x333e63){logger[_0x5c0f('0xd')]('UserWhatsappQueue,\x20%s,\x20%s',_0x398217,_0x5c0f('0xe'));logger[_0x5c0f('0xf')](_0x5c0f('0x10'),_0x398217,_0x5c0f('0xe'),JSON[_0x5c0f('0x11')](_0x333e63));if(_0x333e63['error']){if(_0x333e63['error'][_0x5c0f('0x12')]===0x1f4){logger[_0x5c0f('0x13')](_0x5c0f('0x14'),_0x398217,_0x333e63['error']['message']);return _0x2c53b6(_0x333e63[_0x5c0f('0x13')][_0x5c0f('0x15')]);}logger[_0x5c0f('0x13')](_0x5c0f('0x14'),_0x398217,_0x333e63['error'][_0x5c0f('0x15')]);return _0x20f420(_0x333e63[_0x5c0f('0x13')][_0x5c0f('0x15')]);}else{logger[_0x5c0f('0xd')]('UserWhatsappQueue,\x20%s,\x20%s',_0x398217,_0x5c0f('0xe'));_0x20f420(_0x333e63['result'][_0x5c0f('0x15')]);}})[_0x5c0f('0x16')](function(_0x2c5863){logger[_0x5c0f('0x13')]('UserWhatsappQueue,\x20%s,\x20%s',_0x398217,_0x2c5863);_0x2c53b6(_0x2c5863);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index ab33ce6..b5f436c 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 _0xb332=['../../components/auth/service','../../config/environment','get','isAuthenticated','index','show','create','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','Router'];(function(_0x5a4670,_0x26110d){var _0x332b26=function(_0xaf9f30){while(--_0xaf9f30){_0x5a4670['push'](_0x5a4670['shift']());}};_0x332b26(++_0x26110d);}(_0xb332,0xd9));var _0x2b33=function(_0x183256,_0x1a596d){_0x183256=_0x183256-0x0;var _0x5394a2=_0xb332[_0x183256];return _0x5394a2;};'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('./variable.controller');router[_0x2b33('0x6')]('/',auth[_0x2b33('0x7')](),controller[_0x2b33('0x8')]);router[_0x2b33('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x2b33('0x9')]);router['post']('/',auth[_0x2b33('0x7')](),controller[_0x2b33('0xa')]);router[_0x2b33('0xb')](_0x2b33('0xc'),auth['isAuthenticated'](),controller[_0x2b33('0xd')]);router[_0x2b33('0xe')](_0x2b33('0xc'),auth[_0x2b33('0x7')](),controller[_0x2b33('0xf')]);module[_0x2b33('0x10')]=router; \ No newline at end of file +var _0x4853=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy','util','connect-timeout','express'];(function(_0x5466ab,_0x227b13){var _0x40751a=function(_0x477f9e){while(--_0x477f9e){_0x5466ab['push'](_0x5466ab['shift']());}};_0x40751a(++_0x227b13);}(_0x4853,0x11d));var _0x3485=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x4853[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require('multer');var util=require(_0x3485('0x0'));var path=require('path');var timeout=require(_0x3485('0x1'));var express=require(_0x3485('0x2'));var router=express[_0x3485('0x3')]();var fs_extra=require(_0x3485('0x4'));var auth=require(_0x3485('0x5'));var interaction=require(_0x3485('0x6'));var config=require('../../config/environment');var controller=require('./variable.controller');router['get']('/',auth[_0x3485('0x7')](),controller[_0x3485('0x8')]);router[_0x3485('0x9')](_0x3485('0xa'),auth[_0x3485('0x7')](),controller[_0x3485('0xb')]);router[_0x3485('0xc')]('/',auth['isAuthenticated'](),controller[_0x3485('0xd')]);router[_0x3485('0xe')](_0x3485('0xa'),auth[_0x3485('0x7')](),controller[_0x3485('0xf')]);router[_0x3485('0x10')](_0x3485('0xa'),auth[_0x3485('0x7')](),controller[_0x3485('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 8b119bb..f76e225 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 _0x7412=['STRING','sequelize','exports'];(function(_0x2d8e1e,_0x50ab38){var _0x534e88=function(_0x36ed7a){while(--_0x36ed7a){_0x2d8e1e['push'](_0x2d8e1e['shift']());}};_0x534e88(++_0x50ab38);}(_0x7412,0x73));var _0x2741=function(_0x576170,_0x1712ae){_0x576170=_0x576170-0x0;var _0x397c70=_0x7412[_0x576170];return _0x397c70;};'use strict';var Sequelize=require(_0x2741('0x0'));module[_0x2741('0x1')]={'name':{'type':Sequelize[_0x2741('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x2741('0x2')]}}; \ No newline at end of file +var _0x8fd3=['exports','STRING','name'];(function(_0x59c63d,_0x1b923f){var _0x148287=function(_0x3e456c){while(--_0x3e456c){_0x59c63d['push'](_0x59c63d['shift']());}};_0x148287(++_0x1b923f);}(_0x8fd3,0x1d7));var _0x38fd=function(_0x1c62ef,_0x34ce50){_0x1c62ef=_0x1c62ef-0x0;var _0x1e4d54=_0x8fd3[_0x1c62ef];return _0x1e4d54;};'use strict';var Sequelize=require('sequelize');module[_0x38fd('0x0')]={'name':{'type':Sequelize[_0x38fd('0x1')],'unique':_0x38fd('0x2'),'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 4d21713..9b987f5 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 _0x870f=['offset','undefined','count','limit','Content-Range','apply','reject','then','destroy','get','Variables','UserProfileResource','error','stack','name','send','index','Variable','rawAttributes','fieldName','key','model','map','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','where','filter','merge','type','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','sendStatus','end','status','json'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x870f,0xcf));var _0xf870=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x870f[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require(_0xf870('0x0'));var rimraf=require(_0xf870('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf870('0x2'));var rp=require(_0xf870('0x3'));var moment=require('moment');var BPromise=require(_0xf870('0x4'));var Mustache=require(_0xf870('0x5'));var util=require(_0xf870('0x6'));var path=require('path');var sox=require(_0xf870('0x7'));var csv=require(_0xf870('0x8'));var ejs=require(_0xf870('0x9'));var fs=require('fs');var fs_extra=require(_0xf870('0xa'));var _=require(_0xf870('0xb'));var squel=require('squel');var crypto=require(_0xf870('0xc'));var jsforce=require(_0xf870('0xd'));var deskjs=require(_0xf870('0xe'));var toCsv=require(_0xf870('0x8'));var querystring=require('querystring');var Papa=require(_0xf870('0xf'));var Redis=require(_0xf870('0x10'));var authService=require(_0xf870('0x11'));var qs=require(_0xf870('0x12'));var as=require(_0xf870('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf870('0x14'))(_0xf870('0x15'));var utils=require(_0xf870('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2e6405,_0xeccbab){_0xeccbab=_0xeccbab||0xcc;return function(_0x2afe43){if(_0x2afe43){return _0x2e6405[_0xf870('0x17')](_0xeccbab);}return _0x2e6405['status'](_0xeccbab)[_0xf870('0x18')]();};}function respondWithResult(_0x4fb340,_0x1c06b3){_0x1c06b3=_0x1c06b3||0xc8;return function(_0x1937ed){if(_0x1937ed){return _0x4fb340[_0xf870('0x19')](_0x1c06b3)[_0xf870('0x1a')](_0x1937ed);}};}function respondWithFilteredResult(_0x1a2bab,_0xdfe1f1){return function(_0x441550){if(_0x441550){var _0x6ffd60=typeof _0xdfe1f1[_0xf870('0x1b')]===_0xf870('0x1c')&&typeof _0xdfe1f1['limit']===_0xf870('0x1c');var _0x4d9495=_0x441550[_0xf870('0x1d')];var _0x2d427d=_0x6ffd60?0x0:_0xdfe1f1[_0xf870('0x1b')];var _0x40274f=_0x6ffd60?_0x441550[_0xf870('0x1d')]:_0xdfe1f1[_0xf870('0x1b')]+_0xdfe1f1[_0xf870('0x1e')];var _0xb9234c;if(_0x40274f>=_0x4d9495){_0x40274f=_0x4d9495;_0xb9234c=0xc8;}else{_0xb9234c=0xce;}_0x1a2bab[_0xf870('0x19')](_0xb9234c);return _0x1a2bab['set'](_0xf870('0x1f'),_0x2d427d+'-'+_0x40274f+'/'+_0x4d9495)[_0xf870('0x1a')](_0x441550);}return null;};}function patchUpdates(_0x2af458){return function(_0x419c5e){try{jsonpatch[_0xf870('0x20')](_0x419c5e,_0x2af458,!![]);}catch(_0x2210c4){return BPromise[_0xf870('0x21')](_0x2210c4);}return _0x419c5e['save']();};}function saveUpdates(_0xe2ad3f,_0x58bae1){return function(_0x373117){if(_0x373117){return _0x373117['update'](_0xe2ad3f)[_0xf870('0x22')](function(_0x564cc8){return _0x564cc8;});}return null;};}function removeEntity(_0x36110b,_0x2cb569){return function(_0x3bcfc7){if(_0x3bcfc7){return _0x3bcfc7[_0xf870('0x23')]()[_0xf870('0x22')](function(){var _0x531d0d=_0x3bcfc7[_0xf870('0x24')]({'plain':!![]});var _0x1a94c1=_0xf870('0x25');return db[_0xf870('0x26')][_0xf870('0x23')]({'where':{'type':_0x1a94c1,'resourceId':_0x531d0d['id']}})[_0xf870('0x22')](function(){return _0x3bcfc7;});})[_0xf870('0x22')](function(){_0x36110b[_0xf870('0x19')](0xcc)[_0xf870('0x18')]();});}};}function handleEntityNotFound(_0x5aac14,_0xbf2193){return function(_0x18c876){if(!_0x18c876){_0x5aac14[_0xf870('0x17')](0x194);}return _0x18c876;};}function handleError(_0x24d3ff,_0x3a935d){_0x3a935d=_0x3a935d||0x1f4;return function(_0x544440){logger[_0xf870('0x27')](_0x544440[_0xf870('0x28')]);if(_0x544440[_0xf870('0x29')]){delete _0x544440[_0xf870('0x29')];}_0x24d3ff[_0xf870('0x19')](_0x3a935d)[_0xf870('0x2a')](_0x544440);};}exports[_0xf870('0x2b')]=function(_0x53e74a,_0x46d03b){var _0x2ff682={},_0x26b39e={},_0x4c74ca={'count':0x0,'rows':[]};var _0x57f6d2=_['map'](db[_0xf870('0x2c')][_0xf870('0x2d')],function(_0x147a60){return{'name':_0x147a60[_0xf870('0x2e')],'type':_0x147a60['type'][_0xf870('0x2f')]};});_0x26b39e[_0xf870('0x30')]=_[_0xf870('0x31')](_0x57f6d2,_0xf870('0x29'));_0x26b39e['query']=_[_0xf870('0x32')](_0x53e74a[_0xf870('0x33')]);_0x26b39e[_0xf870('0x34')]=_[_0xf870('0x35')](_0x26b39e['model'],_0x26b39e[_0xf870('0x33')]);_0x2ff682[_0xf870('0x36')]=_[_0xf870('0x35')](_0x26b39e[_0xf870('0x30')],qs[_0xf870('0x37')](_0x53e74a[_0xf870('0x33')]['fields']));_0x2ff682[_0xf870('0x36')]=_0x2ff682[_0xf870('0x36')][_0xf870('0x38')]?_0x2ff682[_0xf870('0x36')]:_0x26b39e[_0xf870('0x30')];if(!_0x53e74a[_0xf870('0x33')]['hasOwnProperty'](_0xf870('0x39'))){_0x2ff682[_0xf870('0x1e')]=qs[_0xf870('0x1e')](_0x53e74a['query'][_0xf870('0x1e')]);_0x2ff682['offset']=qs[_0xf870('0x1b')](_0x53e74a[_0xf870('0x33')][_0xf870('0x1b')]);}_0x2ff682['order']=qs[_0xf870('0x3a')](_0x53e74a[_0xf870('0x33')][_0xf870('0x3a')]);_0x2ff682[_0xf870('0x3b')]=qs[_0xf870('0x34')](_['pick'](_0x53e74a[_0xf870('0x33')],_0x26b39e['filters']),_0x57f6d2);if(_0x53e74a[_0xf870('0x33')][_0xf870('0x3c')]){_0x2ff682['where']=_[_0xf870('0x3d')](_0x2ff682[_0xf870('0x3b')],{'$or':_[_0xf870('0x31')](_0x57f6d2,function(_0x173806){if(_0x173806[_0xf870('0x3e')]!=='VIRTUAL'){var _0x36e144={};_0x36e144[_0x173806['name']]={'$like':'%'+_0x53e74a[_0xf870('0x33')][_0xf870('0x3c')]+'%'};return _0x36e144;}})});}_0x2ff682=_[_0xf870('0x3d')]({},_0x2ff682,_0x53e74a[_0xf870('0x3f')]);var _0x52e677={'where':_0x2ff682[_0xf870('0x3b')]};return db['Variable'][_0xf870('0x1d')](_0x52e677)[_0xf870('0x22')](function(_0x5d82c3){_0x4c74ca[_0xf870('0x1d')]=_0x5d82c3;if(_0x53e74a['query'][_0xf870('0x40')]){_0x2ff682[_0xf870('0x41')]=[{'all':!![]}];}return db[_0xf870('0x2c')][_0xf870('0x42')](_0x2ff682);})[_0xf870('0x22')](function(_0x3ba0e8){_0x4c74ca[_0xf870('0x43')]=_0x3ba0e8;return _0x4c74ca;})['then'](respondWithFilteredResult(_0x46d03b,_0x2ff682))[_0xf870('0x44')](handleError(_0x46d03b,null));};exports[_0xf870('0x45')]=function(_0x166141,_0x497840){var _0x38d029={'raw':!![],'where':{'id':_0x166141[_0xf870('0x46')]['id']}},_0x2ab829={};_0x2ab829['model']=_[_0xf870('0x32')](db[_0xf870('0x2c')]['rawAttributes']);_0x2ab829['query']=_[_0xf870('0x32')](_0x166141[_0xf870('0x33')]);_0x2ab829[_0xf870('0x34')]=_['intersection'](_0x2ab829['model'],_0x2ab829[_0xf870('0x33')]);_0x38d029[_0xf870('0x36')]=_[_0xf870('0x35')](_0x2ab829[_0xf870('0x30')],qs[_0xf870('0x37')](_0x166141['query']['fields']));_0x38d029[_0xf870('0x36')]=_0x38d029[_0xf870('0x36')][_0xf870('0x38')]?_0x38d029['attributes']:_0x2ab829['model'];if(_0x166141['query'][_0xf870('0x40')]){_0x38d029[_0xf870('0x41')]=[{'all':!![]}];}_0x38d029=_['merge']({},_0x38d029,_0x166141[_0xf870('0x3f')]);return db[_0xf870('0x2c')][_0xf870('0x47')](_0x38d029)[_0xf870('0x22')](handleEntityNotFound(_0x497840,null))['then'](respondWithResult(_0x497840,null))[_0xf870('0x44')](handleError(_0x497840,null));};exports[_0xf870('0x48')]=function(_0x2ea51c,_0x54ffac){return db[_0xf870('0x2c')][_0xf870('0x48')](_0x2ea51c[_0xf870('0x49')],{})[_0xf870('0x22')](function(_0x3727bb){var _0x1569b9=_0x2ea51c['user'][_0xf870('0x24')]({'plain':!![]});if(!_0x1569b9)throw new Error(_0xf870('0x4a'));if(_0x1569b9[_0xf870('0x4b')]==='user'){var _0xeef87b=_0x3727bb[_0xf870('0x24')]({'plain':!![]});var _0x19e7bf='Variables';return db['UserProfileSection']['find']({'where':{'name':_0x19e7bf,'userProfileId':_0x1569b9[_0xf870('0x4c')]},'raw':!![]})['then'](function(_0x482d75){if(_0x482d75&&_0x482d75[_0xf870('0x4d')]===0x0){return db['UserProfileResource']['create']({'name':_0xeef87b[_0xf870('0x29')],'resourceId':_0xeef87b['id'],'type':_0x482d75['name'],'sectionId':_0x482d75['id']},{})[_0xf870('0x22')](function(){return _0x3727bb;});}else{return _0x3727bb;}})[_0xf870('0x44')](function(_0x441b7b){logger[_0xf870('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x441b7b);throw _0x441b7b;});}return _0x3727bb;})[_0xf870('0x22')](respondWithResult(_0x54ffac,0xc9))['catch'](handleError(_0x54ffac,null));};exports['update']=function(_0x29c2df,_0x476222){if(_0x29c2df[_0xf870('0x49')]['id']){delete _0x29c2df['body']['id'];}return db['Variable'][_0xf870('0x47')]({'where':{'id':_0x29c2df[_0xf870('0x46')]['id']}})[_0xf870('0x22')](handleEntityNotFound(_0x476222,null))[_0xf870('0x22')](saveUpdates(_0x29c2df[_0xf870('0x49')],null))[_0xf870('0x22')](respondWithResult(_0x476222,null))[_0xf870('0x44')](handleError(_0x476222,null));};exports['destroy']=function(_0x22912b,_0x16a8fc){return db[_0xf870('0x2c')][_0xf870('0x47')]({'where':{'id':_0x22912b[_0xf870('0x46')]['id']}})[_0xf870('0x22')](handleEntityNotFound(_0x16a8fc,null))[_0xf870('0x22')](removeEntity(_0x16a8fc,null))[_0xf870('0x44')](handleError(_0x16a8fc,null));}; \ No newline at end of file +var _0x89ed=['count','set','Content-Range','apply','reject','save','update','destroy','then','get','Variables','UserProfileResource','end','error','stack','name','map','Variable','rawAttributes','fieldName','type','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','merge','VIRTUAL','filter','include','findAll','rows','params','options','catch','create','user','autoAssociation','body','find','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','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit'];(function(_0x6bb11a,_0x7b4fb){var _0x46914b=function(_0x1d9d04){while(--_0x1d9d04){_0x6bb11a['push'](_0x6bb11a['shift']());}};_0x46914b(++_0x7b4fb);}(_0x89ed,0xc8));var _0xd89e=function(_0xd0cf3c,_0x4cd35a){_0xd0cf3c=_0xd0cf3c-0x0;var _0x1400b6=_0x89ed[_0xd0cf3c];return _0x1400b6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd89e('0x0'));var zipdir=require(_0xd89e('0x1'));var jsonpatch=require(_0xd89e('0x2'));var rp=require(_0xd89e('0x3'));var moment=require(_0xd89e('0x4'));var BPromise=require(_0xd89e('0x5'));var Mustache=require(_0xd89e('0x6'));var util=require('util');var path=require('path');var sox=require(_0xd89e('0x7'));var csv=require(_0xd89e('0x8'));var ejs=require(_0xd89e('0x9'));var fs=require('fs');var fs_extra=require(_0xd89e('0xa'));var _=require(_0xd89e('0xb'));var squel=require(_0xd89e('0xc'));var crypto=require(_0xd89e('0xd'));var jsforce=require(_0xd89e('0xe'));var deskjs=require(_0xd89e('0xf'));var toCsv=require(_0xd89e('0x8'));var querystring=require('querystring');var Papa=require(_0xd89e('0x10'));var Redis=require(_0xd89e('0x11'));var authService=require(_0xd89e('0x12'));var qs=require(_0xd89e('0x13'));var as=require(_0xd89e('0x14'));var hardwareService=require(_0xd89e('0x15'));var logger=require(_0xd89e('0x16'))('api');var utils=require('../../config/utils');var config=require(_0xd89e('0x17'));var licenseUtil=require(_0xd89e('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4cd47b,_0x383ca2){_0x383ca2=_0x383ca2||0xcc;return function(_0x985225){if(_0x985225){return _0x4cd47b[_0xd89e('0x19')](_0x383ca2);}return _0x4cd47b[_0xd89e('0x1a')](_0x383ca2)['end']();};}function respondWithResult(_0xda8771,_0x2f79c3){_0x2f79c3=_0x2f79c3||0xc8;return function(_0x1ac6c9){if(_0x1ac6c9){return _0xda8771['status'](_0x2f79c3)[_0xd89e('0x1b')](_0x1ac6c9);}};}function respondWithFilteredResult(_0x1d83c8,_0x281af2){return function(_0x106bc2){if(_0x106bc2){var _0x1ae689=typeof _0x281af2[_0xd89e('0x1c')]===_0xd89e('0x1d')&&typeof _0x281af2[_0xd89e('0x1e')]===_0xd89e('0x1d');var _0x25452f=_0x106bc2[_0xd89e('0x1f')];var _0x262284=_0x1ae689?0x0:_0x281af2[_0xd89e('0x1c')];var _0x8ff2bf=_0x1ae689?_0x106bc2[_0xd89e('0x1f')]:_0x281af2['offset']+_0x281af2[_0xd89e('0x1e')];var _0x3f4038;if(_0x8ff2bf>=_0x25452f){_0x8ff2bf=_0x25452f;_0x3f4038=0xc8;}else{_0x3f4038=0xce;}_0x1d83c8[_0xd89e('0x1a')](_0x3f4038);return _0x1d83c8[_0xd89e('0x20')](_0xd89e('0x21'),_0x262284+'-'+_0x8ff2bf+'/'+_0x25452f)['json'](_0x106bc2);}return null;};}function patchUpdates(_0x28180d){return function(_0x346c2a){try{jsonpatch[_0xd89e('0x22')](_0x346c2a,_0x28180d,!![]);}catch(_0x1c4fad){return BPromise[_0xd89e('0x23')](_0x1c4fad);}return _0x346c2a[_0xd89e('0x24')]();};}function saveUpdates(_0x4712a5,_0x532538){return function(_0x21b726){if(_0x21b726){return _0x21b726[_0xd89e('0x25')](_0x4712a5)['then'](function(_0xa70dc5){return _0xa70dc5;});}return null;};}function removeEntity(_0x6e1b59,_0xf9bc0b){return function(_0x3321d6){if(_0x3321d6){return _0x3321d6[_0xd89e('0x26')]()[_0xd89e('0x27')](function(){var _0x3003b8=_0x3321d6[_0xd89e('0x28')]({'plain':!![]});var _0x3edd47=_0xd89e('0x29');return db[_0xd89e('0x2a')][_0xd89e('0x26')]({'where':{'type':_0x3edd47,'resourceId':_0x3003b8['id']}})[_0xd89e('0x27')](function(){return _0x3321d6;});})['then'](function(){_0x6e1b59[_0xd89e('0x1a')](0xcc)[_0xd89e('0x2b')]();});}};}function handleEntityNotFound(_0x1ee667,_0x211e3b){return function(_0x54095c){if(!_0x54095c){_0x1ee667[_0xd89e('0x19')](0x194);}return _0x54095c;};}function handleError(_0x287685,_0x1db62d){_0x1db62d=_0x1db62d||0x1f4;return function(_0x4e73f3){logger[_0xd89e('0x2c')](_0x4e73f3[_0xd89e('0x2d')]);if(_0x4e73f3[_0xd89e('0x2e')]){delete _0x4e73f3[_0xd89e('0x2e')];}_0x287685['status'](_0x1db62d)['send'](_0x4e73f3);};}exports['index']=function(_0x38d20d,_0x15d01b){var _0x318f7a={},_0x335e38={},_0x2b6ee0={'count':0x0,'rows':[]};var _0x29330c=_[_0xd89e('0x2f')](db[_0xd89e('0x30')][_0xd89e('0x31')],function(_0x16a04b){return{'name':_0x16a04b[_0xd89e('0x32')],'type':_0x16a04b[_0xd89e('0x33')]['key']};});_0x335e38[_0xd89e('0x34')]=_[_0xd89e('0x2f')](_0x29330c,_0xd89e('0x2e'));_0x335e38['query']=_[_0xd89e('0x35')](_0x38d20d[_0xd89e('0x36')]);_0x335e38['filters']=_[_0xd89e('0x37')](_0x335e38[_0xd89e('0x34')],_0x335e38[_0xd89e('0x36')]);_0x318f7a[_0xd89e('0x38')]=_[_0xd89e('0x37')](_0x335e38[_0xd89e('0x34')],qs[_0xd89e('0x39')](_0x38d20d[_0xd89e('0x36')][_0xd89e('0x39')]));_0x318f7a[_0xd89e('0x38')]=_0x318f7a[_0xd89e('0x38')]['length']?_0x318f7a[_0xd89e('0x38')]:_0x335e38[_0xd89e('0x34')];if(!_0x38d20d['query'][_0xd89e('0x3a')](_0xd89e('0x3b'))){_0x318f7a[_0xd89e('0x1e')]=qs[_0xd89e('0x1e')](_0x38d20d[_0xd89e('0x36')][_0xd89e('0x1e')]);_0x318f7a['offset']=qs[_0xd89e('0x1c')](_0x38d20d['query'][_0xd89e('0x1c')]);}_0x318f7a['order']=qs[_0xd89e('0x3c')](_0x38d20d['query'][_0xd89e('0x3c')]);_0x318f7a[_0xd89e('0x3d')]=qs['filters'](_['pick'](_0x38d20d[_0xd89e('0x36')],_0x335e38[_0xd89e('0x3e')]),_0x29330c);if(_0x38d20d['query']['filter']){_0x318f7a[_0xd89e('0x3d')]=_[_0xd89e('0x3f')](_0x318f7a[_0xd89e('0x3d')],{'$or':_['map'](_0x29330c,function(_0x3765a1){if(_0x3765a1[_0xd89e('0x33')]!==_0xd89e('0x40')){var _0x4c0c47={};_0x4c0c47[_0x3765a1[_0xd89e('0x2e')]]={'$like':'%'+_0x38d20d[_0xd89e('0x36')][_0xd89e('0x41')]+'%'};return _0x4c0c47;}})});}_0x318f7a=_[_0xd89e('0x3f')]({},_0x318f7a,_0x38d20d['options']);var _0x3a3690={'where':_0x318f7a[_0xd89e('0x3d')]};return db[_0xd89e('0x30')]['count'](_0x3a3690)[_0xd89e('0x27')](function(_0x432549){_0x2b6ee0[_0xd89e('0x1f')]=_0x432549;if(_0x38d20d['query']['includeAll']){_0x318f7a[_0xd89e('0x42')]=[{'all':!![]}];}return db[_0xd89e('0x30')][_0xd89e('0x43')](_0x318f7a);})[_0xd89e('0x27')](function(_0x4e40f3){_0x2b6ee0[_0xd89e('0x44')]=_0x4e40f3;return _0x2b6ee0;})[_0xd89e('0x27')](respondWithFilteredResult(_0x15d01b,_0x318f7a))['catch'](handleError(_0x15d01b,null));};exports['show']=function(_0x2d6020,_0x5dde3c){var _0x5b6bcf={'raw':!![],'where':{'id':_0x2d6020[_0xd89e('0x45')]['id']}},_0x5f24ae={};_0x5f24ae[_0xd89e('0x34')]=_[_0xd89e('0x35')](db[_0xd89e('0x30')][_0xd89e('0x31')]);_0x5f24ae[_0xd89e('0x36')]=_[_0xd89e('0x35')](_0x2d6020[_0xd89e('0x36')]);_0x5f24ae[_0xd89e('0x3e')]=_[_0xd89e('0x37')](_0x5f24ae[_0xd89e('0x34')],_0x5f24ae['query']);_0x5b6bcf[_0xd89e('0x38')]=_[_0xd89e('0x37')](_0x5f24ae[_0xd89e('0x34')],qs['fields'](_0x2d6020[_0xd89e('0x36')][_0xd89e('0x39')]));_0x5b6bcf[_0xd89e('0x38')]=_0x5b6bcf[_0xd89e('0x38')]['length']?_0x5b6bcf[_0xd89e('0x38')]:_0x5f24ae[_0xd89e('0x34')];if(_0x2d6020[_0xd89e('0x36')]['includeAll']){_0x5b6bcf[_0xd89e('0x42')]=[{'all':!![]}];}_0x5b6bcf=_['merge']({},_0x5b6bcf,_0x2d6020[_0xd89e('0x46')]);return db['Variable']['find'](_0x5b6bcf)['then'](handleEntityNotFound(_0x5dde3c,null))['then'](respondWithResult(_0x5dde3c,null))[_0xd89e('0x47')](handleError(_0x5dde3c,null));};exports['create']=function(_0x46e5d2,_0x379741){return db[_0xd89e('0x30')][_0xd89e('0x48')](_0x46e5d2['body'],{})[_0xd89e('0x27')](function(_0xcd5016){var _0x1d24d8=_0x46e5d2['user'][_0xd89e('0x28')]({'plain':!![]});if(!_0x1d24d8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1d24d8['role']===_0xd89e('0x49')){var _0x43d192=_0xcd5016[_0xd89e('0x28')]({'plain':!![]});var _0x4d6881=_0xd89e('0x29');return db['UserProfileSection']['find']({'where':{'name':_0x4d6881,'userProfileId':_0x1d24d8['userProfileId']},'raw':!![]})['then'](function(_0x3acdee){if(_0x3acdee&&_0x3acdee[_0xd89e('0x4a')]===0x0){return db[_0xd89e('0x2a')][_0xd89e('0x48')]({'name':_0x43d192[_0xd89e('0x2e')],'resourceId':_0x43d192['id'],'type':_0x3acdee['name'],'sectionId':_0x3acdee['id']},{})['then'](function(){return _0xcd5016;});}else{return _0xcd5016;}})[_0xd89e('0x47')](function(_0x1e83c2){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1e83c2);throw _0x1e83c2;});}return _0xcd5016;})[_0xd89e('0x27')](respondWithResult(_0x379741,0xc9))[_0xd89e('0x47')](handleError(_0x379741,null));};exports['update']=function(_0x13f07c,_0x48bb92){if(_0x13f07c[_0xd89e('0x4b')]['id']){delete _0x13f07c['body']['id'];}return db[_0xd89e('0x30')][_0xd89e('0x4c')]({'where':{'id':_0x13f07c[_0xd89e('0x45')]['id']}})[_0xd89e('0x27')](handleEntityNotFound(_0x48bb92,null))['then'](saveUpdates(_0x13f07c['body'],null))['then'](respondWithResult(_0x48bb92,null))['catch'](handleError(_0x48bb92,null));};exports['destroy']=function(_0x164f30,_0x4b6f24){return db[_0xd89e('0x30')][_0xd89e('0x4c')]({'where':{'id':_0x164f30['params']['id']}})[_0xd89e('0x27')](handleEntityNotFound(_0x4b6f24,null))[_0xd89e('0x27')](removeEntity(_0x4b6f24,null))[_0xd89e('0x47')](handleError(_0x4b6f24,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 706f3b3..c739a6b 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 _0xd640=['bluebird','path','rimraf','./variable.attributes','exports','define','Variable','util','../../config/logger','api'];(function(_0x31e584,_0x4d9f7f){var _0x5686d0=function(_0x1f9e99){while(--_0x1f9e99){_0x31e584['push'](_0x31e584['shift']());}};_0x5686d0(++_0x4d9f7f);}(_0xd640,0x13d));var _0x0d64=function(_0x1921b5,_0x37d78b){_0x1921b5=_0x1921b5-0x0;var _0x1a7a24=_0xd640[_0x1921b5];return _0x1a7a24;};'use strict';var _=require('lodash');var util=require(_0x0d64('0x0'));var logger=require(_0x0d64('0x1'))(_0x0d64('0x2'));var moment=require('moment');var BPromise=require(_0x0d64('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0d64('0x4'));var rimraf=require(_0x0d64('0x5'));var config=require('../../config/environment');var attributes=require(_0x0d64('0x6'));module[_0x0d64('0x7')]=function(_0x1e15aa,_0x3037e3){return _0x1e15aa[_0x0d64('0x8')](_0x0d64('0x9'),attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe30a=['api','bluebird','request-promise','path','rimraf','../../config/environment','define','Variable','tools_variables','lodash','util'];(function(_0x38608d,_0x4c341b){var _0x30170a=function(_0x98feef){while(--_0x98feef){_0x38608d['push'](_0x38608d['shift']());}};_0x30170a(++_0x4c341b);}(_0xe30a,0x1ab));var _0xae30=function(_0xde3fa0,_0x3b5095){_0xde3fa0=_0xde3fa0-0x0;var _0x159c96=_0xe30a[_0xde3fa0];return _0x159c96;};'use strict';var _=require(_0xae30('0x0'));var util=require(_0xae30('0x1'));var logger=require('../../config/logger')(_0xae30('0x2'));var moment=require('moment');var BPromise=require(_0xae30('0x3'));var rp=require(_0xae30('0x4'));var fs=require('fs');var path=require(_0xae30('0x5'));var rimraf=require(_0xae30('0x6'));var config=require(_0xae30('0x7'));var attributes=require('./variable.attributes');module['exports']=function(_0x4a88ad,_0xbd1092){return _0x4a88ad[_0xae30('0x8')](_0xae30('0x9'),attributes,{'tableName':_0xae30('0xa'),'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 9a4dbdb..f0400bc 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 _0x55ca=['options','where','attributes','include','map','model','lodash','util','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ShowVariable','Variable','find'];(function(_0x1951de,_0x173387){var _0x418584=function(_0xfaf379){while(--_0xfaf379){_0x1951de['push'](_0x1951de['shift']());}};_0x418584(++_0x173387);}(_0x55ca,0x126));var _0xa55c=function(_0x305c8f,_0xc5f7fb){_0x305c8f=_0x305c8f-0x0;var _0x5ddc30=_0x55ca[_0x305c8f];return _0x5ddc30;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa55c('0x2'));var db=require(_0xa55c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa55c('0x4'))(_0xa55c('0x5'));var config=require(_0xa55c('0x6'));var jayson=require(_0xa55c('0x7'));var client=jayson[_0xa55c('0x8')][_0xa55c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36b623,_0x4d0624,_0x2121fd){return new BPromise(function(_0x2537f0,_0x57e069){return client[_0xa55c('0xa')](_0x36b623,_0x2121fd)[_0xa55c('0xb')](function(_0x52a3bc){logger['info'](_0xa55c('0xc'),_0x4d0624,_0xa55c('0xd'));logger[_0xa55c('0xe')](_0xa55c('0xf'),_0x4d0624,_0xa55c('0xd'),JSON[_0xa55c('0x10')](_0x52a3bc));if(_0x52a3bc[_0xa55c('0x11')]){if(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x12')]===0x1f4){logger[_0xa55c('0x11')]('Variable,\x20%s,\x20%s',_0x4d0624,_0x52a3bc['error'][_0xa55c('0x13')]);return _0x57e069(_0x52a3bc['error']['message']);}logger['error'](_0xa55c('0xc'),_0x4d0624,_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);return _0x2537f0(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);}else{logger[_0xa55c('0x14')]('Variable,\x20%s,\x20%s',_0x4d0624,_0xa55c('0xd'));_0x2537f0(_0x52a3bc[_0xa55c('0x15')][_0xa55c('0x13')]);}})[_0xa55c('0x16')](function(_0x1c4cfd){logger[_0xa55c('0x11')](_0xa55c('0xc'),_0x4d0624,_0x1c4cfd);_0x57e069(_0x1c4cfd);});});}exports[_0xa55c('0x17')]=function(_0x24783b){var _0x4cee3c=this;return new Promise(function(_0x3d4c9e,_0x104a99){return db[_0xa55c('0x18')][_0xa55c('0x19')]({'raw':_0x24783b[_0xa55c('0x1a')]?_0x24783b[_0xa55c('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x24783b['options']?_0x24783b[_0xa55c('0x1a')][_0xa55c('0x1b')]||null:null,'attributes':_0x24783b[_0xa55c('0x1a')]?_0x24783b['options'][_0xa55c('0x1c')]||null:null,'include':_0x24783b[_0xa55c('0x1a')]?_0x24783b['options'][_0xa55c('0x1d')]?_[_0xa55c('0x1e')](_0x24783b[_0xa55c('0x1a')][_0xa55c('0x1d')],function(_0x234372){return{'model':db[_0x234372['model']],'as':_0x234372['as'],'attributes':_0x234372[_0xa55c('0x1c')],'include':_0x234372['include']?_['map'](_0x234372['include'],function(_0x19ae88){return{'model':db[_0x19ae88['model']],'as':_0x19ae88['as'],'attributes':_0x19ae88[_0xa55c('0x1c')],'include':_0x19ae88[_0xa55c('0x1d')]?_[_0xa55c('0x1e')](_0x19ae88[_0xa55c('0x1d')],function(_0x2313a9){return{'model':db[_0x2313a9[_0xa55c('0x1f')]],'as':_0x2313a9['as'],'attributes':_0x2313a9[_0xa55c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa55c('0xb')](function(_0x192df2){logger[_0xa55c('0x14')](_0xa55c('0x17'),_0x24783b);logger['debug'](_0xa55c('0x17'),_0x24783b,JSON[_0xa55c('0x10')](_0x192df2));_0x3d4c9e(_0x192df2);})[_0xa55c('0x16')](function(_0x906caa){logger['error'](_0xa55c('0x17'),_0x906caa[_0xa55c('0x13')],_0x24783b);_0x104a99(_0x4cee3c[_0xa55c('0x11')](0x1f4,_0x906caa[_0xa55c('0x13')]));});});}; \ No newline at end of file +var _0x7fbe=['stringify','error','code','message','result','catch','Variable','find','options','where','attributes','include','map','model','info','ShowVariable','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s'];(function(_0x2bc828,_0x4e686f){var _0x5d5656=function(_0x297b33){while(--_0x297b33){_0x2bc828['push'](_0x2bc828['shift']());}};_0x5d5656(++_0x4e686f);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x17325e,_0x5863f2){_0x17325e=_0x17325e-0x0;var _0x51062a=_0x7fbe[_0x17325e];return _0x51062a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7fb('0x0'));var BPromise=require(_0xe7fb('0x1'));var rs=require(_0xe7fb('0x2'));var fs=require('fs');var Redis=require(_0xe7fb('0x3'));var db=require(_0xe7fb('0x4'))['db'];var utils=require(_0xe7fb('0x5'));var logger=require(_0xe7fb('0x6'))(_0xe7fb('0x7'));var config=require(_0xe7fb('0x8'));var jayson=require(_0xe7fb('0x9'));var client=jayson[_0xe7fb('0xa')][_0xe7fb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24cd67,_0x1f943f,_0x5ad75b){return new BPromise(function(_0x213ebc,_0x228f6b){return client[_0xe7fb('0xc')](_0x24cd67,_0x5ad75b)[_0xe7fb('0xd')](function(_0x4ba197){logger['info'](_0xe7fb('0xe'),_0x1f943f,_0xe7fb('0xf'));logger[_0xe7fb('0x10')](_0xe7fb('0x11'),_0x1f943f,_0xe7fb('0xf'),JSON[_0xe7fb('0x12')](_0x4ba197));if(_0x4ba197[_0xe7fb('0x13')]){if(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x14')]===0x1f4){logger[_0xe7fb('0x13')](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);return _0x228f6b(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')]['message']);return _0x213ebc(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}else{logger['info'](_0xe7fb('0xe'),_0x1f943f,'request\x20sent');_0x213ebc(_0x4ba197[_0xe7fb('0x16')][_0xe7fb('0x15')]);}})[_0xe7fb('0x17')](function(_0x17e8a8){logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x17e8a8);_0x228f6b(_0x17e8a8);});});}exports['ShowVariable']=function(_0x293a47){var _0x546463=this;return new Promise(function(_0x1e77fd,_0x4708f7){return db[_0xe7fb('0x18')][_0xe7fb('0x19')]({'raw':_0x293a47['options']?_0x293a47[_0xe7fb('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x293a47[_0xe7fb('0x1a')]?_0x293a47['options'][_0xe7fb('0x1b')]||null:null,'attributes':_0x293a47['options']?_0x293a47[_0xe7fb('0x1a')][_0xe7fb('0x1c')]||null:null,'include':_0x293a47['options']?_0x293a47[_0xe7fb('0x1a')][_0xe7fb('0x1d')]?_[_0xe7fb('0x1e')](_0x293a47['options'][_0xe7fb('0x1d')],function(_0x469ead){return{'model':db[_0x469ead['model']],'as':_0x469ead['as'],'attributes':_0x469ead['attributes'],'include':_0x469ead['include']?_[_0xe7fb('0x1e')](_0x469ead['include'],function(_0x49b219){return{'model':db[_0x49b219[_0xe7fb('0x1f')]],'as':_0x49b219['as'],'attributes':_0x49b219[_0xe7fb('0x1c')],'include':_0x49b219[_0xe7fb('0x1d')]?_['map'](_0x49b219[_0xe7fb('0x1d')],function(_0x2b69c4){return{'model':db[_0x2b69c4[_0xe7fb('0x1f')]],'as':_0x2b69c4['as'],'attributes':_0x2b69c4[_0xe7fb('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xe7fb('0xd')](function(_0x16237a){logger[_0xe7fb('0x20')]('ShowVariable',_0x293a47);logger['debug'](_0xe7fb('0x21'),_0x293a47,JSON[_0xe7fb('0x12')](_0x16237a));_0x1e77fd(_0x16237a);})[_0xe7fb('0x17')](function(_0x4fd290){logger[_0xe7fb('0x13')](_0xe7fb('0x21'),_0x4fd290[_0xe7fb('0x15')],_0x293a47);_0x4708f7(_0x546463[_0xe7fb('0x13')](0x1f4,_0x4fd290[_0xe7fb('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index a986e7b..c8f15ba 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 _0x33a1=['migrations','express','Router','../../components/auth/service','./version.controller','get','index','/fetch','isAuthenticated','canUpdate','/reset','reset','pull','/restart','restart','/migrations'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x33a1,0x1f1));var _0x133a=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x33a1[_0x4565bf];return _0x5610ba;};'use strict';var express=require(_0x133a('0x0'));var router=express[_0x133a('0x1')]();var auth=require(_0x133a('0x2'));var controller=require(_0x133a('0x3'));router[_0x133a('0x4')]('/',controller[_0x133a('0x5')]);router[_0x133a('0x4')](_0x133a('0x6'),auth[_0x133a('0x7')](),auth[_0x133a('0x8')](),controller['fetch']);router[_0x133a('0x4')](_0x133a('0x9'),auth[_0x133a('0x7')](),auth[_0x133a('0x8')](),controller[_0x133a('0xa')]);router[_0x133a('0x4')]('/pull',auth[_0x133a('0x7')](),auth['canUpdate'](),controller[_0x133a('0xb')]);router[_0x133a('0x4')](_0x133a('0xc'),auth[_0x133a('0x7')](),controller[_0x133a('0xd')]);router['get'](_0x133a('0xe'),controller[_0x133a('0xf')]);module['exports']=router; \ No newline at end of file +var _0x2143=['isAuthenticated','canUpdate','fetch','/reset','reset','/pull','pull','/migrations','migrations','Router','./version.controller','get','index'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0x2143,0x71));var _0x3214=function(_0x4841da,_0x1a5d31){_0x4841da=_0x4841da-0x0;var _0x8befd1=_0x2143[_0x4841da];return _0x8befd1;};'use strict';var express=require('express');var router=express[_0x3214('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x3214('0x1'));router[_0x3214('0x2')]('/',controller[_0x3214('0x3')]);router['get']('/fetch',auth[_0x3214('0x4')](),auth[_0x3214('0x5')](),controller[_0x3214('0x6')]);router[_0x3214('0x2')](_0x3214('0x7'),auth['isAuthenticated'](),auth[_0x3214('0x5')](),controller[_0x3214('0x8')]);router[_0x3214('0x2')](_0x3214('0x9'),auth[_0x3214('0x4')](),auth[_0x3214('0x5')](),controller[_0x3214('0xa')]);router[_0x3214('0x2')]('/restart',auth[_0x3214('0x4')](),controller['restart']);router[_0x3214('0x2')](_0x3214('0xb'),controller[_0x3214('0xc')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 9c84846..f2244ad 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 _0x78ef=['reset','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','replace','.js','length','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','join','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','pkginfo','compare-versions','child_process','exec','../../mysqldb','../../config/pm2','update','root','index','version','query','latest','tags','exports','2.0.0','json','status','fetch','origin','master','error','info','git\x20fetch','git\x20fetch\x20origin\x20master'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0x78ef,0x79));var _0xf78e=function(_0xa16f5e,_0x54b144){_0xa16f5e=_0xa16f5e-0x0;var _0x2c9964=_0x78ef[_0xa16f5e];return _0x2c9964;};'use strict';var Umzug=require(_0xf78e('0x0'));var path=require(_0xf78e('0x1'));var fs=require('fs');var _=require('lodash');var pkginfo=require(_0xf78e('0x2'))(module,'version');var compareVersions=require(_0xf78e('0x3'));var exec=require(_0xf78e('0x4'))[_0xf78e('0x5')];var db=require(_0xf78e('0x6'))['db'];var config=require('../../config/environment');var pm2=require(_0xf78e('0x7'));var logger=require('../../config/logger')(_0xf78e('0x8'));var git=require('simple-git')(config[_0xf78e('0x9')]);exports[_0xf78e('0xa')]=function(_0x203b4a,_0x566eac){var _0x41d4ea={'current':module['exports'][_0xf78e('0xb')],'phonebar':0x2};if(_0x203b4a[_0xf78e('0xc')]&&_0x203b4a[_0xf78e('0xc')][_0xf78e('0xd')]){return git['fetch']()[_0xf78e('0xe')](function(_0x4acbd2,_0x3701fa){_0x41d4ea[_0xf78e('0xd')]=(_0x4acbd2?module[_0xf78e('0xf')][_0xf78e('0xb')]:_0x3701fa[_0xf78e('0xd')])||_0xf78e('0x10');return _0x566eac['status'](0xc8)[_0xf78e('0x11')](_0x41d4ea);});}else{return _0x566eac[_0xf78e('0x12')](0xc8)[_0xf78e('0x11')](_0x41d4ea);}};exports[_0xf78e('0x13')]=function(_0x3f7de1,_0x41e8ff){return git[_0xf78e('0x13')]([_0xf78e('0x14'),_0xf78e('0x15')],function(_0x3731fc){if(_0x3731fc){logger[_0xf78e('0x16')](_0x3731fc);return _0x41e8ff[_0xf78e('0x12')](0x1f4)[_0xf78e('0x11')](_0x3731fc);}logger[_0xf78e('0x17')](_0xf78e('0x18'));return _0x41e8ff['status'](0xc8)[_0xf78e('0x11')]({'output':_0xf78e('0x19')});});};exports[_0xf78e('0x1a')]=function(_0x15d27b,_0x4624cd){return git[_0xf78e('0x1a')](['--hard','FETCH_HEAD'],function(_0x1ddfe2){if(_0x1ddfe2){logger[_0xf78e('0x16')](_0x1ddfe2);return _0x4624cd[_0xf78e('0x12')](0x1f4)[_0xf78e('0x11')](_0x1ddfe2);}logger[_0xf78e('0x17')](_0xf78e('0x1b'));return _0x4624cd['status'](0xc8)[_0xf78e('0x11')]({'output':_0xf78e('0x1c')});});};exports[_0xf78e('0x1d')]=function(_0x5e0a4d,_0x55fb4b){exec(_0xf78e('0x1e'),function(_0x107492,_0x4acf5e,_0x36594b){logger[_0xf78e('0x17')](_0x4acf5e);logger[_0xf78e('0x17')](_0x36594b);if(_0x107492){logger[_0xf78e('0x16')](_0x107492);return _0x55fb4b[_0xf78e('0x12')](0x1f4)[_0xf78e('0x11')](_0x107492);}return _0x55fb4b[_0xf78e('0x12')](0xc8)[_0xf78e('0x11')]({'output':_0x4acf5e});});};exports[_0xf78e('0x1f')]=function(_0x24c279,_0x44b3c8){return pm2[_0xf78e('0x1f')](_0xf78e('0x20'))['then'](function(_0x5bc73){logger[_0xf78e('0x17')](_0xf78e('0x21'),_0x5bc73);return _0x44b3c8['status'](0xc8)['json']({'output':_0xf78e('0x22')});})[_0xf78e('0x23')](function(_0x573a12){logger[_0xf78e('0x16')](_0x573a12);return _0x44b3c8[_0xf78e('0x12')](0x1f4)[_0xf78e('0x11')](_0x573a12);});};exports[_0xf78e('0x24')]=function(_0xb5dc11,_0x295277){var _0x517a29=fs[_0xf78e('0x25')](path['join'](config[_0xf78e('0x9')],'server',_0xf78e('0x24')));var _0x4741e0=[];for(var _0x20d41f=0x0;_0x20d41f<_0x517a29['length'];_0x20d41f++){var _0x45c144=_0x517a29[_0x20d41f][_0xf78e('0x26')](_0xf78e('0x27'),'');if(compareVersions(module[_0xf78e('0xf')][_0xf78e('0xb')],_0x45c144)===-0x1){_0x4741e0['push'](_0x45c144);}}if(_0x4741e0[_0xf78e('0x28')]){var _0xba5eb9=_0x4741e0['sort'](compareVersions);var _0x470c45=new Umzug({'storage':_0xf78e('0x29'),'storageOptions':{'model':db[_0xf78e('0x2a')],'modelName':'Migration','columnName':_0xf78e('0xb')},'migrations':{'params':[db['sequelize'][_0xf78e('0x2b')](),db[_0xf78e('0x29')][_0xf78e('0x2c')],function(){throw new Error(_0xf78e('0x2d'));}],'path':path[_0xf78e('0x2e')](config[_0xf78e('0x9')],'server',_0xf78e('0x24')),'pattern':/\.js$/}});_0x470c45['up']({'migrations':_['map'](_0xba5eb9,function(_0x5e60f9){return _0x5e60f9+'.js';})})['then'](function(){return _0x295277[_0xf78e('0x12')](0xc8)[_0xf78e('0x11')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0xf78e('0xf')]['version']+'\x20to\x20'+_['last'](_0xba5eb9),'migrations':_[_0xf78e('0x2e')](_0xba5eb9)});})[_0xf78e('0x23')](function(_0x4d6986){if(_0x4d6986 instanceof db[_0xf78e('0x29')][_0xf78e('0x2f')]){return _0x295277[_0xf78e('0x12')](0xc8)[_0xf78e('0x11')]({'output':_0xf78e('0x30')});}else{return _0x295277[_0xf78e('0x12')](0x1f4)[_0xf78e('0x11')](_0x4d6986);}});}else{return _0x295277['status'](0xc8)[_0xf78e('0x11')]({'output':_0xf78e('0x30')});}}; \ No newline at end of file +var _0x84d8=['Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','simple-git','index','exports','query','latest','fetch','tags','2.0.0','status','json','master','error','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','info','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','migrations','readdirSync','join','server','length','replace','.js','push','sort','sequelize','Migration'];(function(_0x52bb4e,_0x23c932){var _0x3df19c=function(_0x3f54bd){while(--_0x3f54bd){_0x52bb4e['push'](_0x52bb4e['shift']());}};_0x3df19c(++_0x23c932);}(_0x84d8,0xa7));var _0x884d=function(_0x57ac7c,_0x13eb14){_0x57ac7c=_0x57ac7c-0x0;var _0x52d72c=_0x84d8[_0x57ac7c];return _0x52d72c;};'use strict';var Umzug=require(_0x884d('0x0'));var path=require(_0x884d('0x1'));var fs=require('fs');var _=require(_0x884d('0x2'));var pkginfo=require(_0x884d('0x3'))(module,_0x884d('0x4'));var compareVersions=require(_0x884d('0x5'));var exec=require(_0x884d('0x6'))[_0x884d('0x7')];var db=require(_0x884d('0x8'))['db'];var config=require(_0x884d('0x9'));var pm2=require(_0x884d('0xa'));var logger=require(_0x884d('0xb'))('update');var git=require(_0x884d('0xc'))(config['root']);exports[_0x884d('0xd')]=function(_0x76c4e1,_0x2f8d5c){var _0x3649b5={'current':module[_0x884d('0xe')][_0x884d('0x4')],'phonebar':0x2};if(_0x76c4e1[_0x884d('0xf')]&&_0x76c4e1[_0x884d('0xf')][_0x884d('0x10')]){return git[_0x884d('0x11')]()[_0x884d('0x12')](function(_0x28227b,_0x44283b){_0x3649b5[_0x884d('0x10')]=(_0x28227b?module[_0x884d('0xe')][_0x884d('0x4')]:_0x44283b[_0x884d('0x10')])||_0x884d('0x13');return _0x2f8d5c['status'](0xc8)['json'](_0x3649b5);});}else{return _0x2f8d5c[_0x884d('0x14')](0xc8)[_0x884d('0x15')](_0x3649b5);}};exports['fetch']=function(_0x4bebb5,_0x5820bb){return git['fetch'](['origin',_0x884d('0x16')],function(_0x2ff807){if(_0x2ff807){logger[_0x884d('0x17')](_0x2ff807);return _0x5820bb[_0x884d('0x14')](0x1f4)[_0x884d('0x15')](_0x2ff807);}logger['info'](_0x884d('0x18'));return _0x5820bb['status'](0xc8)[_0x884d('0x15')]({'output':_0x884d('0x19')});});};exports[_0x884d('0x1a')]=function(_0x563480,_0x1f3219){return git[_0x884d('0x1a')]([_0x884d('0x1b'),_0x884d('0x1c')],function(_0x381a63){if(_0x381a63){logger[_0x884d('0x17')](_0x381a63);return _0x1f3219[_0x884d('0x14')](0x1f4)['json'](_0x381a63);}logger[_0x884d('0x1d')](_0x884d('0x1e'));return _0x1f3219[_0x884d('0x14')](0xc8)[_0x884d('0x15')]({'output':_0x884d('0x1f')});});};exports[_0x884d('0x20')]=function(_0x583722,_0x172bfc){exec('npm\x20install\x20--production',function(_0x5f1490,_0x1e6842,_0x3aec57){logger[_0x884d('0x1d')](_0x1e6842);logger[_0x884d('0x1d')](_0x3aec57);if(_0x5f1490){logger[_0x884d('0x17')](_0x5f1490);return _0x172bfc['status'](0x1f4)[_0x884d('0x15')](_0x5f1490);}return _0x172bfc[_0x884d('0x14')](0xc8)[_0x884d('0x15')]({'output':_0x1e6842});});};exports[_0x884d('0x21')]=function(_0xd95f40,_0x352fe5){return pm2[_0x884d('0x21')](_0x884d('0x22'))[_0x884d('0x23')](function(_0x5a26d0){logger[_0x884d('0x1d')](_0x884d('0x24'),_0x5a26d0);return _0x352fe5[_0x884d('0x14')](0xc8)[_0x884d('0x15')]({'output':_0x884d('0x25')});})['catch'](function(_0x23a464){logger['error'](_0x23a464);return _0x352fe5[_0x884d('0x14')](0x1f4)['json'](_0x23a464);});};exports[_0x884d('0x26')]=function(_0x2f49ab,_0x44cdaf){var _0x704491=fs[_0x884d('0x27')](path[_0x884d('0x28')](config['root'],_0x884d('0x29'),_0x884d('0x26')));var _0x149b3f=[];for(var _0x437a6e=0x0;_0x437a6e<_0x704491[_0x884d('0x2a')];_0x437a6e++){var _0x510b4b=_0x704491[_0x437a6e][_0x884d('0x2b')](_0x884d('0x2c'),'');if(compareVersions(module['exports'][_0x884d('0x4')],_0x510b4b)===-0x1){_0x149b3f[_0x884d('0x2d')](_0x510b4b);}}if(_0x149b3f[_0x884d('0x2a')]){var _0x4d892f=_0x149b3f[_0x884d('0x2e')](compareVersions);var _0x4f1e73=new Umzug({'storage':_0x884d('0x2f'),'storageOptions':{'model':db[_0x884d('0x30')],'modelName':'Migration','columnName':_0x884d('0x4')},'migrations':{'params':[db[_0x884d('0x2f')]['getQueryInterface'](),db[_0x884d('0x2f')]['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[_0x884d('0x28')](config['root'],_0x884d('0x29'),'migrations'),'pattern':/\.js$/}});_0x4f1e73['up']({'migrations':_['map'](_0x4d892f,function(_0x2f0c29){return _0x2f0c29+_0x884d('0x2c');})})[_0x884d('0x23')](function(){return _0x44cdaf[_0x884d('0x14')](0xc8)[_0x884d('0x15')]({'output':_0x884d('0x31')+module[_0x884d('0xe')][_0x884d('0x4')]+_0x884d('0x32')+_[_0x884d('0x33')](_0x4d892f),'migrations':_['join'](_0x4d892f)});})['catch'](function(_0x3c4244){if(_0x3c4244 instanceof db[_0x884d('0x2f')][_0x884d('0x34')]){return _0x44cdaf[_0x884d('0x14')](0xc8)[_0x884d('0x15')]({'output':_0x884d('0x35')});}else{return _0x44cdaf[_0x884d('0x14')](0x1f4)[_0x884d('0x15')](_0x3c4244);}});}else{return _0x44cdaf['status'](0xc8)['json']({'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 36bbd2c..f1ba26d 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 _0x39be=['isAuthenticated','describe','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','./voiceAgentReport.controller','get','/describe'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x39be,0x19a));var _0xe39b=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x39be[_0x3bf83f];return _0x22c4a9;};'use strict';var multer=require(_0xe39b('0x0'));var util=require(_0xe39b('0x1'));var path=require(_0xe39b('0x2'));var timeout=require('connect-timeout');var express=require(_0xe39b('0x3'));var router=express[_0xe39b('0x4')]();var fs_extra=require(_0xe39b('0x5'));var auth=require(_0xe39b('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe39b('0x7'));router[_0xe39b('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe39b('0x8')](_0xe39b('0x9'),auth[_0xe39b('0xa')](),controller[_0xe39b('0xb')]);router['get']('/:id',auth[_0xe39b('0xa')](),controller[_0xe39b('0xc')]);router[_0xe39b('0xd')]('/',auth[_0xe39b('0xa')](),controller[_0xe39b('0xe')]);router[_0xe39b('0xf')](_0xe39b('0x10'),auth[_0xe39b('0xa')](),controller[_0xe39b('0x11')]);router[_0xe39b('0x12')](_0xe39b('0x10'),auth[_0xe39b('0xa')](),controller[_0xe39b('0x13')]);module[_0xe39b('0x14')]=router; \ No newline at end of file +var _0xbca9=['put','update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','/describe','isAuthenticated','describe','/:id','post','create'];(function(_0x1688f6,_0x9ab079){var _0x144c86=function(_0x3e979e){while(--_0x3e979e){_0x1688f6['push'](_0x1688f6['shift']());}};_0x144c86(++_0x9ab079);}(_0xbca9,0x7d));var _0x9bca=function(_0x2c8a05,_0x294a27){_0x2c8a05=_0x2c8a05-0x0;var _0xbe0636=_0xbca9[_0x2c8a05];return _0xbe0636;};'use strict';var multer=require('multer');var util=require(_0x9bca('0x0'));var path=require(_0x9bca('0x1'));var timeout=require('connect-timeout');var express=require(_0x9bca('0x2'));var router=express[_0x9bca('0x3')]();var fs_extra=require(_0x9bca('0x4'));var auth=require(_0x9bca('0x5'));var interaction=require(_0x9bca('0x6'));var config=require('../../config/environment');var controller=require('./voiceAgentReport.controller');router[_0x9bca('0x7')]('/',auth['isAuthenticated'](),controller[_0x9bca('0x8')]);router[_0x9bca('0x7')](_0x9bca('0x9'),auth[_0x9bca('0xa')](),controller[_0x9bca('0xb')]);router[_0x9bca('0x7')](_0x9bca('0xc'),auth[_0x9bca('0xa')](),controller['show']);router[_0x9bca('0xd')]('/',auth[_0x9bca('0xa')](),controller[_0x9bca('0xe')]);router[_0x9bca('0xf')](_0x9bca('0xc'),auth[_0x9bca('0xa')](),controller[_0x9bca('0x10')]);router[_0x9bca('0x11')](_0x9bca('0xc'),auth[_0x9bca('0xa')](),controller[_0x9bca('0x12')]);module[_0x9bca('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 3cadc3f..8f55d0d 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 _0xa478=['BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE','INTEGER'];(function(_0x1e36a8,_0x2a4821){var _0x167625=function(_0x16898a){while(--_0x16898a){_0x1e36a8['push'](_0x1e36a8['shift']());}};_0x167625(++_0x2a4821);}(_0xa478,0x136));var _0x8a47=function(_0x3c9e74,_0x4334c5){_0x3c9e74=_0x3c9e74-0x0;var _0x4fea21=_0xa478[_0x3c9e74];return _0x4fea21;};'use strict';var Sequelize=require(_0x8a47('0x0'));module[_0x8a47('0x1')]={'type':{'type':Sequelize[_0x8a47('0x2')]},'uniqueid':{'type':Sequelize[_0x8a47('0x2')]},'calleridnum':{'type':Sequelize[_0x8a47('0x2')]},'calleridname':{'type':Sequelize[_0x8a47('0x2')]},'queue':{'type':Sequelize[_0x8a47('0x2')]},'interface':{'type':Sequelize[_0x8a47('0x2')]},'membername':{'type':Sequelize[_0x8a47('0x2')]},'agentcalledAt':{'type':Sequelize[_0x8a47('0x3')]},'agentconnectAt':{'type':Sequelize[_0x8a47('0x3')]},'agentcompleteAt':{'type':Sequelize[_0x8a47('0x3')]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize[_0x8a47('0x3')]},'holdtime':{'type':Sequelize[_0x8a47('0x4')]},'agentcomplete':{'type':Sequelize[_0x8a47('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x8a47('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0x8a47('0x4')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x8a47('0x4')]},'reason':{'type':Sequelize[_0x8a47('0x2')]},'lastevent':{'type':Sequelize[_0x8a47('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x8a47('0x4')]},'channelstatedesc':{'type':Sequelize[_0x8a47('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x8a47('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x8a47('0x2')]},'context':{'type':Sequelize[_0x8a47('0x2')]},'exten':{'type':Sequelize[_0x8a47('0x2')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x8a47('0x2')]},'destcalleridnum':{'type':Sequelize[_0x8a47('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x8a47('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x8a47('0x2')]},'destlanguage':{'type':Sequelize[_0x8a47('0x2')]},'destaccountcode':{'type':Sequelize[_0x8a47('0x2')]},'destcontext':{'type':Sequelize[_0x8a47('0x2')]},'destexten':{'type':Sequelize[_0x8a47('0x2')]},'destpriority':{'type':Sequelize[_0x8a47('0x2')]},'destuniqueid':{'type':Sequelize[_0x8a47('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x8a47('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0x8a47('0x2')]},'transfer':{'type':Sequelize[_0x8a47('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x8a47('0x2')],'comment':_0x8a47('0x6')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x8a47('0x2')]},'agententerreason':{'type':Sequelize[_0x8a47('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x6146=['sequelize','STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED'];(function(_0x249662,_0x531a21){var _0x532ab5=function(_0xe92d4d){while(--_0xe92d4d){_0x249662['push'](_0x249662['shift']());}};_0x532ab5(++_0x531a21);}(_0x6146,0xba));var _0x6614=function(_0x74d38f,_0x3e0076){_0x74d38f=_0x74d38f-0x0;var _0x4ae1ba=_0x6146[_0x74d38f];return _0x4ae1ba;};'use strict';var Sequelize=require(_0x6614('0x0'));module['exports']={'type':{'type':Sequelize[_0x6614('0x1')]},'uniqueid':{'type':Sequelize[_0x6614('0x1')]},'calleridnum':{'type':Sequelize[_0x6614('0x1')]},'calleridname':{'type':Sequelize[_0x6614('0x1')]},'queue':{'type':Sequelize[_0x6614('0x1')]},'interface':{'type':Sequelize[_0x6614('0x1')]},'membername':{'type':Sequelize[_0x6614('0x1')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x6614('0x2')]},'agentcompleteAt':{'type':Sequelize[_0x6614('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0x6614('0x2')]},'agentdumpAt':{'type':Sequelize[_0x6614('0x2')]},'holdtime':{'type':Sequelize[_0x6614('0x3')]},'agentcomplete':{'type':Sequelize[_0x6614('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x6614('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x6614('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x6614('0x3')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x6614('0x3')]},'reason':{'type':Sequelize[_0x6614('0x1')]},'lastevent':{'type':Sequelize[_0x6614('0x1')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x6614('0x3')]},'channelstatedesc':{'type':Sequelize[_0x6614('0x1')]},'connectedlinenum':{'type':Sequelize[_0x6614('0x1')]},'connectedlinename':{'type':Sequelize[_0x6614('0x1')]},'language':{'type':Sequelize[_0x6614('0x1')]},'accountcode':{'type':Sequelize[_0x6614('0x1')]},'context':{'type':Sequelize[_0x6614('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x6614('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x6614('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x6614('0x1')]},'destcalleridnum':{'type':Sequelize[_0x6614('0x1')]},'destcalleridname':{'type':Sequelize[_0x6614('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x6614('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x6614('0x1')]},'destlanguage':{'type':Sequelize[_0x6614('0x1')]},'destaccountcode':{'type':Sequelize[_0x6614('0x1')]},'destcontext':{'type':Sequelize[_0x6614('0x1')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x6614('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x6614('0x1')]},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x6614('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x6614('0x1')],'comment':_0x6614('0x5')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x6614('0x1')]},'agententerreason':{'type':Sequelize[_0x6614('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index 21dc326..b5f1e5e 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(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'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(_0x2080a3,_0x48acfa){var _0x8d7d17=function(_0x2dbc06){while(--_0x2dbc06){_0x2080a3['push'](_0x2080a3['shift']());}};_0x8d7d17(++_0x48acfa);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xa9e0[_0x3c4737];return _0x2bb926;};'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 5bfccdb..55f3e0b 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 _0x56a4=['rimraf','../../config/environment','./voiceAgentReport.attributes','exports','report_agent','uniqueid','destuniqueid','lodash','util','api','moment','path'];(function(_0x3b0319,_0x4b163e){var _0xca86b4=function(_0x59e59d){while(--_0x59e59d){_0x3b0319['push'](_0x3b0319['shift']());}};_0xca86b4(++_0x4b163e);}(_0x56a4,0x11b));var _0x456a=function(_0x4a2266,_0x53e92f){_0x4a2266=_0x4a2266-0x0;var _0x1d7b9f=_0x56a4[_0x4a2266];return _0x1d7b9f;};'use strict';var _=require(_0x456a('0x0'));var util=require(_0x456a('0x1'));var logger=require('../../config/logger')(_0x456a('0x2'));var moment=require(_0x456a('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x456a('0x4'));var rimraf=require(_0x456a('0x5'));var config=require(_0x456a('0x6'));var attributes=require(_0x456a('0x7'));module[_0x456a('0x8')]=function(_0x4b8eec,_0x3b0145){return _0x4b8eec['define']('VoiceAgentReport',attributes,{'tableName':_0x456a('0x9'),'paranoid':![],'indexes':[{'fields':[_0x456a('0xa'),_0x456a('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0e85=['report_agent','uniqueid','destuniqueid','lodash','util','api','moment','rimraf','./voiceAgentReport.attributes','exports','VoiceAgentReport'];(function(_0xefd4ca,_0xa06a7){var _0x3c93d8=function(_0x28f9c4){while(--_0x28f9c4){_0xefd4ca['push'](_0xefd4ca['shift']());}};_0x3c93d8(++_0xa06a7);}(_0x0e85,0x7c));var _0x50e8=function(_0x26f702,_0x3919bf){_0x26f702=_0x26f702-0x0;var _0x11417d=_0x0e85[_0x26f702];return _0x11417d;};'use strict';var _=require(_0x50e8('0x0'));var util=require(_0x50e8('0x1'));var logger=require('../../config/logger')(_0x50e8('0x2'));var moment=require(_0x50e8('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x50e8('0x4'));var config=require('../../config/environment');var attributes=require(_0x50e8('0x5'));module[_0x50e8('0x6')]=function(_0xe3151e,_0xfde42){return _0xe3151e['define'](_0x50e8('0x7'),attributes,{'tableName':_0x50e8('0x8'),'paranoid':![],'indexes':[{'fields':[_0x50e8('0x9'),_0x50e8('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 609b316..ca389ec 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 _0x019d=['info','CreateVoiceAgentReport','debug','UpdateVoiceAgentReport','update','where','attributes','limit','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','VoiceAgentReport','create','body','options','raw'];(function(_0x5234cd,_0x30a04d){var _0x4e77df=function(_0x431bf3){while(--_0x431bf3){_0x5234cd['push'](_0x5234cd['shift']());}};_0x4e77df(++_0x30a04d);}(_0x019d,0x1c2));var _0xd019=function(_0x1b2564,_0x309b72){_0x1b2564=_0x1b2564-0x0;var _0x4c543e=_0x019d[_0x1b2564];return _0x4c543e;};'use strict';var _=require(_0xd019('0x0'));var util=require('util');var moment=require(_0xd019('0x1'));var BPromise=require('bluebird');var rs=require(_0xd019('0x2'));var fs=require('fs');var Redis=require(_0xd019('0x3'));var db=require(_0xd019('0x4'))['db'];var utils=require(_0xd019('0x5'));var logger=require('../../config/logger')(_0xd019('0x6'));var config=require(_0xd019('0x7'));var jayson=require(_0xd019('0x8'));var client=jayson[_0xd019('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x7c3b4a,_0x3f1b2f,_0x3314d7){return new BPromise(function(_0x16ee31,_0x5cfc2c){return client[_0xd019('0xa')](_0x7c3b4a,_0x3314d7)[_0xd019('0xb')](function(_0x46fbfd){logger['info'](_0xd019('0xc'),_0x3f1b2f,_0xd019('0xd'));logger['debug'](_0xd019('0xe'),_0x3f1b2f,_0xd019('0xd'),JSON[_0xd019('0xf')](_0x46fbfd));if(_0x46fbfd[_0xd019('0x10')]){if(_0x46fbfd[_0xd019('0x10')][_0xd019('0x11')]===0x1f4){logger['error'](_0xd019('0xc'),_0x3f1b2f,_0x46fbfd[_0xd019('0x10')]['message']);return _0x5cfc2c(_0x46fbfd['error'][_0xd019('0x12')]);}logger[_0xd019('0x10')](_0xd019('0xc'),_0x3f1b2f,_0x46fbfd[_0xd019('0x10')][_0xd019('0x12')]);return _0x16ee31(_0x46fbfd[_0xd019('0x10')][_0xd019('0x12')]);}else{logger['info']('VoiceAgentReport,\x20%s,\x20%s',_0x3f1b2f,'request\x20sent');_0x16ee31(_0x46fbfd[_0xd019('0x13')][_0xd019('0x12')]);}})[_0xd019('0x14')](function(_0x1f208a){logger['error'](_0xd019('0xc'),_0x3f1b2f,_0x1f208a);_0x5cfc2c(_0x1f208a);});});}exports['CreateVoiceAgentReport']=function(_0x1595a1){var _0x4bb876=this;return new Promise(function(_0x1117de,_0x4a4115){return db[_0xd019('0x15')][_0xd019('0x16')](_0x1595a1[_0xd019('0x17')],{'raw':_0x1595a1[_0xd019('0x18')]?_0x1595a1[_0xd019('0x18')][_0xd019('0x19')]===undefined?!![]:![]:!![]})[_0xd019('0xb')](function(_0x5bcefc){logger[_0xd019('0x1a')](_0xd019('0x1b'),_0x1595a1);logger[_0xd019('0x1c')](_0xd019('0x1b'),_0x1595a1,JSON['stringify'](_0x5bcefc));_0x1117de(_0x5bcefc);})['catch'](function(_0x2372a4){logger[_0xd019('0x10')]('CreateVoiceAgentReport',_0x2372a4[_0xd019('0x12')],_0x1595a1);_0x4a4115(_0x4bb876['error'](0x1f4,_0x2372a4[_0xd019('0x12')]));});});};exports[_0xd019('0x1d')]=function(_0x4d2284){var _0x42cc58=this;return new Promise(function(_0x19500d,_0x40a082){return db[_0xd019('0x15')][_0xd019('0x1e')](_0x4d2284[_0xd019('0x17')],{'raw':_0x4d2284[_0xd019('0x18')]?_0x4d2284[_0xd019('0x18')][_0xd019('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4d2284[_0xd019('0x18')]?_0x4d2284[_0xd019('0x18')][_0xd019('0x1f')]||null:null,'attributes':_0x4d2284[_0xd019('0x18')]?_0x4d2284[_0xd019('0x18')][_0xd019('0x20')]||null:null,'limit':_0x4d2284[_0xd019('0x18')]?_0x4d2284[_0xd019('0x18')][_0xd019('0x21')]||null:null})['then'](function(_0x36e848){logger[_0xd019('0x1a')](_0xd019('0x1d'),_0x4d2284);logger[_0xd019('0x1c')](_0xd019('0x1d'),_0x4d2284,JSON['stringify'](_0x36e848));_0x19500d(_0x36e848);})[_0xd019('0x14')](function(_0x36d5b6){logger[_0xd019('0x10')](_0xd019('0x1d'),_0x36d5b6[_0xd019('0x12')],_0x4d2284);_0x40a082(_0x42cc58[_0xd019('0x10')](0x1f4,_0x36d5b6[_0xd019('0x12')]));});});}; \ No newline at end of file +var _0xacb8=['body','options','debug','UpdateVoiceAgentReport','update','raw','where','attributes','limit','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent','VoiceAgentReport,\x20%s,\x20%s,\x20%s','error','VoiceAgentReport,\x20%s,\x20%s','message','info','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create'];(function(_0x592eeb,_0x10ef82){var _0x3ea777=function(_0x4ca4f7){while(--_0x4ca4f7){_0x592eeb['push'](_0x592eeb['shift']());}};_0x3ea777(++_0x10ef82);}(_0xacb8,0xb3));var _0x8acb=function(_0x443f1c,_0x196e24){_0x443f1c=_0x443f1c-0x0;var _0x15e894=_0xacb8[_0x443f1c];return _0x15e894;};'use strict';var _=require(_0x8acb('0x0'));var util=require(_0x8acb('0x1'));var moment=require(_0x8acb('0x2'));var BPromise=require(_0x8acb('0x3'));var rs=require(_0x8acb('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8acb('0x5'))['db'];var utils=require(_0x8acb('0x6'));var logger=require(_0x8acb('0x7'))(_0x8acb('0x8'));var config=require(_0x8acb('0x9'));var jayson=require(_0x8acb('0xa'));var client=jayson['client'][_0x8acb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x30bea9,_0x4c5da0,_0x564314){return new BPromise(function(_0x53ee96,_0x32aa8f){return client[_0x8acb('0xc')](_0x30bea9,_0x564314)[_0x8acb('0xd')](function(_0x2742c6){logger['info']('VoiceAgentReport,\x20%s,\x20%s',_0x4c5da0,_0x8acb('0xe'));logger['debug'](_0x8acb('0xf'),_0x4c5da0,_0x8acb('0xe'),JSON['stringify'](_0x2742c6));if(_0x2742c6[_0x8acb('0x10')]){if(_0x2742c6[_0x8acb('0x10')]['code']===0x1f4){logger[_0x8acb('0x10')]('VoiceAgentReport,\x20%s,\x20%s',_0x4c5da0,_0x2742c6[_0x8acb('0x10')]['message']);return _0x32aa8f(_0x2742c6[_0x8acb('0x10')]['message']);}logger['error'](_0x8acb('0x11'),_0x4c5da0,_0x2742c6['error']['message']);return _0x53ee96(_0x2742c6[_0x8acb('0x10')][_0x8acb('0x12')]);}else{logger[_0x8acb('0x13')](_0x8acb('0x11'),_0x4c5da0,_0x8acb('0xe'));_0x53ee96(_0x2742c6[_0x8acb('0x14')][_0x8acb('0x12')]);}})[_0x8acb('0x15')](function(_0x11eb38){logger[_0x8acb('0x10')](_0x8acb('0x11'),_0x4c5da0,_0x11eb38);_0x32aa8f(_0x11eb38);});});}exports[_0x8acb('0x16')]=function(_0x41fab6){var _0xc142ea=this;return new Promise(function(_0xcaf87,_0x5799a9){return db[_0x8acb('0x17')][_0x8acb('0x18')](_0x41fab6[_0x8acb('0x19')],{'raw':_0x41fab6[_0x8acb('0x1a')]?_0x41fab6[_0x8acb('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x8acb('0xd')](function(_0x2024d4){logger[_0x8acb('0x13')]('CreateVoiceAgentReport',_0x41fab6);logger[_0x8acb('0x1b')]('CreateVoiceAgentReport',_0x41fab6,JSON['stringify'](_0x2024d4));_0xcaf87(_0x2024d4);})[_0x8acb('0x15')](function(_0x31d033){logger[_0x8acb('0x10')](_0x8acb('0x16'),_0x31d033['message'],_0x41fab6);_0x5799a9(_0xc142ea[_0x8acb('0x10')](0x1f4,_0x31d033['message']));});});};exports[_0x8acb('0x1c')]=function(_0x10abe6){var _0x1ea423=this;return new Promise(function(_0x2ff3ef,_0x53ab61){return db[_0x8acb('0x17')][_0x8acb('0x1d')](_0x10abe6[_0x8acb('0x19')],{'raw':_0x10abe6[_0x8acb('0x1a')]?_0x10abe6[_0x8acb('0x1a')][_0x8acb('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x10abe6[_0x8acb('0x1a')]?_0x10abe6[_0x8acb('0x1a')][_0x8acb('0x1f')]||null:null,'attributes':_0x10abe6[_0x8acb('0x1a')]?_0x10abe6['options'][_0x8acb('0x20')]||null:null,'limit':_0x10abe6[_0x8acb('0x1a')]?_0x10abe6[_0x8acb('0x1a')][_0x8acb('0x21')]||null:null})[_0x8acb('0xd')](function(_0xeb1898){logger[_0x8acb('0x13')](_0x8acb('0x1c'),_0x10abe6);logger['debug'](_0x8acb('0x1c'),_0x10abe6,JSON['stringify'](_0xeb1898));_0x2ff3ef(_0xeb1898);})[_0x8acb('0x15')](function(_0x548dc5){logger[_0x8acb('0x10')]('UpdateVoiceAgentReport',_0x548dc5['message'],_0x10abe6);_0x53ab61(_0x1ea423[_0x8acb('0x10')](0x1f4,_0x548dc5[_0x8acb('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 028bf3f..c5f0b2a 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 _0xf006=['post','create','put','update','destroy','exports','path','connect-timeout','Router','../../components/auth/service','./voiceCallReport.controller','get','isAuthenticated','describe','/:id','show'];(function(_0x1aba25,_0x1faed1){var _0x47d997=function(_0x4f9e11){while(--_0x4f9e11){_0x1aba25['push'](_0x1aba25['shift']());}};_0x47d997(++_0x1faed1);}(_0xf006,0x146));var _0x6f00=function(_0x4194c1,_0xd86227){_0x4194c1=_0x4194c1-0x0;var _0x71ed3a=_0xf006[_0x4194c1];return _0x71ed3a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6f00('0x0'));var timeout=require(_0x6f00('0x1'));var express=require('express');var router=express[_0x6f00('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x6f00('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6f00('0x4'));router[_0x6f00('0x5')]('/',auth[_0x6f00('0x6')](),controller['index']);router[_0x6f00('0x5')]('/describe',auth[_0x6f00('0x6')](),controller[_0x6f00('0x7')]);router[_0x6f00('0x5')](_0x6f00('0x8'),auth[_0x6f00('0x6')](),controller[_0x6f00('0x9')]);router[_0x6f00('0xa')]('/',auth[_0x6f00('0x6')](),controller[_0x6f00('0xb')]);router[_0x6f00('0xc')](_0x6f00('0x8'),auth[_0x6f00('0x6')](),controller[_0x6f00('0xd')]);router['delete'](_0x6f00('0x8'),auth[_0x6f00('0x6')](),controller[_0x6f00('0xe')]);module[_0x6f00('0xf')]=router; \ No newline at end of file +var _0x24ca=['delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','index','/describe','/:id','post','create','put','update'];(function(_0x26da89,_0x264785){var _0xc95b7b=function(_0x230e5b){while(--_0x230e5b){_0x26da89['push'](_0x26da89['shift']());}};_0xc95b7b(++_0x264785);}(_0x24ca,0x1bc));var _0xa24c=function(_0x544099,_0x372b30){_0x544099=_0x544099-0x0;var _0x20ab09=_0x24ca[_0x544099];return _0x20ab09;};'use strict';var multer=require(_0xa24c('0x0'));var util=require('util');var path=require(_0xa24c('0x1'));var timeout=require(_0xa24c('0x2'));var express=require(_0xa24c('0x3'));var router=express['Router']();var fs_extra=require(_0xa24c('0x4'));var auth=require(_0xa24c('0x5'));var interaction=require(_0xa24c('0x6'));var config=require(_0xa24c('0x7'));var controller=require(_0xa24c('0x8'));router[_0xa24c('0x9')]('/',auth[_0xa24c('0xa')](),controller[_0xa24c('0xb')]);router[_0xa24c('0x9')](_0xa24c('0xc'),auth[_0xa24c('0xa')](),controller['describe']);router[_0xa24c('0x9')](_0xa24c('0xd'),auth[_0xa24c('0xa')](),controller['show']);router[_0xa24c('0xe')]('/',auth[_0xa24c('0xa')](),controller[_0xa24c('0xf')]);router[_0xa24c('0x10')](_0xa24c('0xd'),auth[_0xa24c('0xa')](),controller[_0xa24c('0x11')]);router[_0xa24c('0x12')](_0xa24c('0xd'),auth['isAuthenticated'](),controller[_0xa24c('0x13')]);module[_0xa24c('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index ef2779d..e9fb3e0 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 _0x4628=['STRING','TEXT','DATE','INTEGER','exports','inbound','outbound','outbound-fax','dialer'];(function(_0xf51c06,_0x388e5b){var _0x1d5420=function(_0x5e077b){while(--_0x5e077b){_0xf51c06['push'](_0xf51c06['shift']());}};_0x1d5420(++_0x388e5b);}(_0x4628,0x70));var _0x8462=function(_0x4f56c1,_0x28bd7d){_0x4f56c1=_0x4f56c1-0x0;var _0x4503e4=_0x4628[_0x4f56c1];return _0x4503e4;};'use strict';var Sequelize=require('sequelize');module[_0x8462('0x0')]={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0x8462('0x1'),'internal',_0x8462('0x2'),'inbound-fax',_0x8462('0x3'),_0x8462('0x4'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize[_0x8462('0x5')]},'destination':{'type':Sequelize[_0x8462('0x5')]},'destinationcontext':{'type':Sequelize[_0x8462('0x5')]},'callerid':{'type':Sequelize[_0x8462('0x5')]},'channel':{'type':Sequelize[_0x8462('0x5')]},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0x8462('0x5')]},'lastdata':{'type':Sequelize[_0x8462('0x6')]},'starttime':{'type':Sequelize[_0x8462('0x7')]},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize['DATE']},'duration':{'type':Sequelize[_0x8462('0x8')]},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x8462('0x8')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x8462('0x5')]},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x8462('0x5')]},'userThirdDisposition':{'type':Sequelize[_0x8462('0x5')]},'note':{'type':Sequelize[_0x8462('0x5')]},'prefix':{'type':Sequelize[_0x8462('0x5')]},'routeid':{'type':Sequelize[_0x8462('0x8')]},'sipcallid':{'type':Sequelize[_0x8462('0x5')]}}; \ No newline at end of file +var _0x4796=['DATE','INTEGER','sequelize','exports','inbound','outbound','inbound-fax','dialer','STRING','TEXT'];(function(_0x18b165,_0x40a7ea){var _0x1d8e19=function(_0x49d432){while(--_0x49d432){_0x18b165['push'](_0x18b165['shift']());}};_0x1d8e19(++_0x40a7ea);}(_0x4796,0x70));var _0x6479=function(_0x13b329,_0x5f2ca7){_0x13b329=_0x13b329-0x0;var _0x2c01bb=_0x4796[_0x13b329];return _0x2c01bb;};'use strict';var Sequelize=require(_0x6479('0x0'));module[_0x6479('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0x6479('0x2'),'internal',_0x6479('0x3'),_0x6479('0x4'),'outbound-fax',_0x6479('0x5'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x6479('0x6')]},'source':{'type':Sequelize[_0x6479('0x6')]},'destination':{'type':Sequelize[_0x6479('0x6')]},'destinationcontext':{'type':Sequelize[_0x6479('0x6')]},'callerid':{'type':Sequelize[_0x6479('0x6')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0x6479('0x6')]},'lastdata':{'type':Sequelize[_0x6479('0x7')]},'starttime':{'type':Sequelize[_0x6479('0x8')]},'systemanswertime':{'type':Sequelize[_0x6479('0x8')]},'answertime':{'type':Sequelize[_0x6479('0x8')]},'endtime':{'type':Sequelize[_0x6479('0x8')]},'duration':{'type':Sequelize[_0x6479('0x9')]},'billableseconds':{'type':Sequelize[_0x6479('0x9')]},'mohtime':{'type':Sequelize[_0x6479('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x6479('0x6')]},'userfield':{'type':Sequelize[_0x6479('0x6')]},'userDisposition':{'type':Sequelize[_0x6479('0x6')]},'userSecondDisposition':{'type':Sequelize[_0x6479('0x6')]},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x6479('0x6')]},'routeid':{'type':Sequelize[_0x6479('0x9')]},'sipcallid':{'type':Sequelize[_0x6479('0x6')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 32a2c5a..74ec0df 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 _0x2ef3=['pick','filter','merge','options','VoiceCallReport','then','includeAll','include','fullname','alias','User','findAll','rows','catch','show','params','keys','find','create','destroy','describe','body','uniqueid','user','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0x2ef3,0xba));var _0x32ef=function(_0x1f0484,_0x41fd24){_0x1f0484=_0x1f0484-0x0;var _0x445d6b=_0x2ef3[_0x1f0484];return _0x445d6b;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a5106,_0x49d590){_0x49d590=_0x49d590||0xcc;return function(_0x3e98df){if(_0x3e98df){return _0x1a5106[_0x32ef('0x18')](_0x49d590);}return _0x1a5106['status'](_0x49d590)['end']();};}function respondWithResult(_0x19ce1,_0x4d8009){_0x4d8009=_0x4d8009||0xc8;return function(_0x326fce){if(_0x326fce){return _0x19ce1[_0x32ef('0x19')](_0x4d8009)[_0x32ef('0x1a')](_0x326fce);}};}function respondWithFilteredResult(_0x54c7f5,_0x57aff1){return function(_0x55bf0b){if(_0x55bf0b){var _0x531e30=typeof _0x57aff1[_0x32ef('0x1b')]===_0x32ef('0x1c')&&typeof _0x57aff1[_0x32ef('0x1d')]==='undefined';var _0x5d559b=_0x55bf0b[_0x32ef('0x1e')];var _0x1a9476=_0x531e30?0x0:_0x57aff1[_0x32ef('0x1b')];var _0x57863c=_0x531e30?_0x55bf0b[_0x32ef('0x1e')]:_0x57aff1[_0x32ef('0x1b')]+_0x57aff1['limit'];var _0x304505;if(_0x57863c>=_0x5d559b){_0x57863c=_0x5d559b;_0x304505=0xc8;}else{_0x304505=0xce;}_0x54c7f5[_0x32ef('0x19')](_0x304505);return _0x54c7f5[_0x32ef('0x1f')](_0x32ef('0x20'),_0x1a9476+'-'+_0x57863c+'/'+_0x5d559b)[_0x32ef('0x1a')](_0x55bf0b);}return null;};}function patchUpdates(_0x3aec05){return function(_0x4de441){try{jsonpatch[_0x32ef('0x21')](_0x4de441,_0x3aec05,!![]);}catch(_0x5cc3ef){return BPromise[_0x32ef('0x22')](_0x5cc3ef);}return _0x4de441[_0x32ef('0x23')]();};}function saveUpdates(_0x49f2d8,_0x1af371){return function(_0x97780){if(_0x97780){return _0x97780[_0x32ef('0x24')](_0x49f2d8)['then'](function(_0x57f5e5){return _0x57f5e5;});}return null;};}function removeEntity(_0x22f2d7,_0xb30fab){return function(_0x225feb){if(_0x225feb){return _0x225feb['destroy']()['then'](function(){_0x22f2d7[_0x32ef('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a412,_0x278495){return function(_0x14d4b3){if(!_0x14d4b3){_0x51a412[_0x32ef('0x18')](0x194);}return _0x14d4b3;};}function handleError(_0x1dbe98,_0x15ce54){_0x15ce54=_0x15ce54||0x1f4;return function(_0x234175){logger[_0x32ef('0x25')](_0x234175[_0x32ef('0x26')]);if(_0x234175[_0x32ef('0x27')]){delete _0x234175[_0x32ef('0x27')];}_0x1dbe98[_0x32ef('0x19')](_0x15ce54)[_0x32ef('0x28')](_0x234175);};}exports['index']=function(_0xd65fde,_0x2f5d06){var _0x5a04cd={},_0x12de1a={},_0x3c569d={'count':0x0,'rows':[]};var _0x30b250=_[_0x32ef('0x29')](db['VoiceCallReport'][_0x32ef('0x2a')],function(_0x22bf86){return{'name':_0x22bf86[_0x32ef('0x2b')],'type':_0x22bf86[_0x32ef('0x2c')][_0x32ef('0x2d')]};});_0x12de1a[_0x32ef('0x2e')]=_[_0x32ef('0x29')](_0x30b250,'name');_0x12de1a[_0x32ef('0x2f')]=_['keys'](_0xd65fde[_0x32ef('0x2f')]);_0x12de1a[_0x32ef('0x30')]=_['intersection'](_0x12de1a[_0x32ef('0x2e')],_0x12de1a[_0x32ef('0x2f')]);_0x5a04cd[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x12de1a[_0x32ef('0x2e')],qs['fields'](_0xd65fde['query'][_0x32ef('0x33')]));_0x5a04cd['attributes']=_0x5a04cd[_0x32ef('0x31')][_0x32ef('0x34')]?_0x5a04cd[_0x32ef('0x31')]:_0x12de1a[_0x32ef('0x2e')];if(!_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x35')]('nolimit')){_0x5a04cd['limit']=qs['limit'](_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x1d')]);_0x5a04cd[_0x32ef('0x1b')]=qs['offset'](_0xd65fde['query'][_0x32ef('0x1b')]);}_0x5a04cd[_0x32ef('0x36')]=qs[_0x32ef('0x37')](_0xd65fde['query']['sort']);_0x5a04cd[_0x32ef('0x38')]=qs[_0x32ef('0x30')](_[_0x32ef('0x39')](_0xd65fde[_0x32ef('0x2f')],_0x12de1a[_0x32ef('0x30')]),_0x30b250);if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]){_0x5a04cd[_0x32ef('0x38')]=_[_0x32ef('0x3b')](_0x5a04cd['where'],{'$or':_[_0x32ef('0x29')](_0x30b250,function(_0x36e374){if(_0x36e374[_0x32ef('0x2c')]!=='VIRTUAL'){var _0x365125={};_0x365125[_0x36e374[_0x32ef('0x27')]]={'$like':'%'+_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]+'%'};return _0x365125;}})});}_0x5a04cd=_[_0x32ef('0x3b')]({},_0x5a04cd,_0xd65fde[_0x32ef('0x3c')]);var _0x256c40={'where':_0x5a04cd[_0x32ef('0x38')]};return db[_0x32ef('0x3d')][_0x32ef('0x1e')](_0x256c40)[_0x32ef('0x3e')](function(_0x4615b4){_0x3c569d['count']=_0x4615b4;if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5a04cd[_0x32ef('0x40')]=[{'attributes':['id',_0x32ef('0x27'),_0x32ef('0x41'),_0x32ef('0x42')],'model':db[_0x32ef('0x43')],'as':'User'}];}return db['VoiceCallReport'][_0x32ef('0x44')](_0x5a04cd);})[_0x32ef('0x3e')](function(_0x2a33dd){_0x3c569d[_0x32ef('0x45')]=_0x2a33dd;return _0x3c569d;})['then'](respondWithFilteredResult(_0x2f5d06,_0x5a04cd))[_0x32ef('0x46')](handleError(_0x2f5d06,null));};exports[_0x32ef('0x47')]=function(_0x5d2f06,_0x4744ba){var _0x4bc5bc={'raw':!![],'where':{'id':_0x5d2f06[_0x32ef('0x48')]['id']}},_0xcb3c08={};_0xcb3c08[_0x32ef('0x2e')]=_[_0x32ef('0x49')](db[_0x32ef('0x3d')][_0x32ef('0x2a')]);_0xcb3c08[_0x32ef('0x2f')]=_[_0x32ef('0x49')](_0x5d2f06[_0x32ef('0x2f')]);_0xcb3c08[_0x32ef('0x30')]=_['intersection'](_0xcb3c08[_0x32ef('0x2e')],_0xcb3c08['query']);_0x4bc5bc[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0xcb3c08[_0x32ef('0x2e')],qs['fields'](_0x5d2f06[_0x32ef('0x2f')][_0x32ef('0x33')]));_0x4bc5bc[_0x32ef('0x31')]=_0x4bc5bc[_0x32ef('0x31')][_0x32ef('0x34')]?_0x4bc5bc[_0x32ef('0x31')]:_0xcb3c08[_0x32ef('0x2e')];if(_0x5d2f06['query']['includeAll']){_0x4bc5bc[_0x32ef('0x40')]=[{'all':!![]}];}_0x4bc5bc=_[_0x32ef('0x3b')]({},_0x4bc5bc,_0x5d2f06[_0x32ef('0x3c')]);return db[_0x32ef('0x3d')][_0x32ef('0x4a')](_0x4bc5bc)[_0x32ef('0x3e')](handleEntityNotFound(_0x4744ba,null))[_0x32ef('0x3e')](respondWithResult(_0x4744ba,null))[_0x32ef('0x46')](handleError(_0x4744ba,null));};exports[_0x32ef('0x4b')]=function(_0x1ebedf,_0x35a294){return db[_0x32ef('0x3d')][_0x32ef('0x4b')](_0x1ebedf['body'],{})[_0x32ef('0x3e')](respondWithResult(_0x35a294,0xc9))[_0x32ef('0x46')](handleError(_0x35a294,null));};exports[_0x32ef('0x4c')]=function(_0xd42609,_0x1cc9f3){return db[_0x32ef('0x3d')][_0x32ef('0x4a')]({'where':{'id':_0xd42609[_0x32ef('0x48')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x1cc9f3,null))[_0x32ef('0x3e')](removeEntity(_0x1cc9f3,null))[_0x32ef('0x46')](handleError(_0x1cc9f3,null));};exports[_0x32ef('0x4d')]=function(_0x272377,_0x326445){return db[_0x32ef('0x3d')][_0x32ef('0x4d')]()[_0x32ef('0x3e')](respondWithResult(_0x326445,null))[_0x32ef('0x46')](handleError(_0x326445,null));};exports['update']=function(_0x515ac9,_0x179c2f){if(_0x515ac9[_0x32ef('0x4e')][_0x32ef('0x4f')]){delete _0x515ac9[_0x32ef('0x4e')][_0x32ef('0x4f')];}return db[_0x32ef('0x3d')][_0x32ef('0x4a')]({'where':{'uniqueid':_0x515ac9[_0x32ef('0x48')]['id'],'UserId':{'$or':[null,_0x515ac9[_0x32ef('0x50')]['id']]}}})[_0x32ef('0x3e')](handleEntityNotFound(_0x179c2f,null))[_0x32ef('0x3e')](saveUpdates(_0x515ac9['body'],null))[_0x32ef('0x3e')](respondWithResult(_0x179c2f,null))[_0x32ef('0x46')](handleError(_0x179c2f,null));}; \ No newline at end of file +var _0x0b0e=['bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','undefined','offset','limit','set','json','apply','reject','save','then','destroy','error','stack','name','index','map','VoiceCallReport','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','merge','where','VIRTUAL','options','count','includeAll','fullname','alias','User','findAll','rows','params','find','create','body','catch','describe','update','uniqueid','user','eml-format','zip-dir','request-promise','moment'];(function(_0x36928c,_0x3e6743){var _0x3e956f=function(_0x5546d0){while(--_0x5546d0){_0x36928c['push'](_0x36928c['shift']());}};_0x3e956f(++_0x3e6743);}(_0x0b0e,0x187));var _0xe0b0=function(_0x5d0207,_0x4000c4){_0x5d0207=_0x5d0207-0x0;var _0xf3e249=_0x0b0e[_0x5d0207];return _0xf3e249;};'use strict';var emlformat=require(_0xe0b0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe0b0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe0b0('0x2'));var moment=require(_0xe0b0('0x3'));var BPromise=require(_0xe0b0('0x4'));var Mustache=require(_0xe0b0('0x5'));var util=require(_0xe0b0('0x6'));var path=require(_0xe0b0('0x7'));var sox=require(_0xe0b0('0x8'));var csv=require(_0xe0b0('0x9'));var ejs=require(_0xe0b0('0xa'));var fs=require('fs');var fs_extra=require(_0xe0b0('0xb'));var _=require(_0xe0b0('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe0b0('0xd'));var deskjs=require(_0xe0b0('0xe'));var toCsv=require(_0xe0b0('0x9'));var querystring=require(_0xe0b0('0xf'));var Papa=require('papaparse');var Redis=require(_0xe0b0('0x10'));var authService=require(_0xe0b0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe0b0('0x12'));var hardwareService=require(_0xe0b0('0x13'));var logger=require('../../config/logger')(_0xe0b0('0x14'));var utils=require(_0xe0b0('0x15'));var config=require(_0xe0b0('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe0b0('0x17'))['db'];function respondWithStatusCode(_0x1c358a,_0x3cc19a){_0x3cc19a=_0x3cc19a||0xcc;return function(_0x45f914){if(_0x45f914){return _0x1c358a[_0xe0b0('0x18')](_0x3cc19a);}return _0x1c358a['status'](_0x3cc19a)[_0xe0b0('0x19')]();};}function respondWithResult(_0x154de6,_0x743318){_0x743318=_0x743318||0xc8;return function(_0x24babd){if(_0x24babd){return _0x154de6[_0xe0b0('0x1a')](_0x743318)['json'](_0x24babd);}};}function respondWithFilteredResult(_0x41a7e2,_0x5adb01){return function(_0x35cb40){if(_0x35cb40){var _0xadee6e=typeof _0x5adb01['offset']===_0xe0b0('0x1b')&&typeof _0x5adb01['limit']===_0xe0b0('0x1b');var _0x100204=_0x35cb40['count'];var _0x54a3eb=_0xadee6e?0x0:_0x5adb01[_0xe0b0('0x1c')];var _0x50a441=_0xadee6e?_0x35cb40['count']:_0x5adb01['offset']+_0x5adb01[_0xe0b0('0x1d')];var _0x50fa4a;if(_0x50a441>=_0x100204){_0x50a441=_0x100204;_0x50fa4a=0xc8;}else{_0x50fa4a=0xce;}_0x41a7e2['status'](_0x50fa4a);return _0x41a7e2[_0xe0b0('0x1e')]('Content-Range',_0x54a3eb+'-'+_0x50a441+'/'+_0x100204)[_0xe0b0('0x1f')](_0x35cb40);}return null;};}function patchUpdates(_0x5dba2f){return function(_0x2c84cc){try{jsonpatch[_0xe0b0('0x20')](_0x2c84cc,_0x5dba2f,!![]);}catch(_0x3e10b3){return BPromise[_0xe0b0('0x21')](_0x3e10b3);}return _0x2c84cc[_0xe0b0('0x22')]();};}function saveUpdates(_0x58b804,_0x4cae54){return function(_0x2fa820){if(_0x2fa820){return _0x2fa820['update'](_0x58b804)[_0xe0b0('0x23')](function(_0x31b5f8){return _0x31b5f8;});}return null;};}function removeEntity(_0x513e63,_0x170ad8){return function(_0x503883){if(_0x503883){return _0x503883[_0xe0b0('0x24')]()['then'](function(){_0x513e63[_0xe0b0('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e5c88,_0x4de537){return function(_0x4700cc){if(!_0x4700cc){_0x3e5c88['sendStatus'](0x194);}return _0x4700cc;};}function handleError(_0x3c221d,_0x5c5317){_0x5c5317=_0x5c5317||0x1f4;return function(_0x362aba){logger[_0xe0b0('0x25')](_0x362aba[_0xe0b0('0x26')]);if(_0x362aba[_0xe0b0('0x27')]){delete _0x362aba[_0xe0b0('0x27')];}_0x3c221d[_0xe0b0('0x1a')](_0x5c5317)['send'](_0x362aba);};}exports[_0xe0b0('0x28')]=function(_0x1b8aa8,_0x5b7a64){var _0x15e13b={},_0x419b1f={},_0x36d137={'count':0x0,'rows':[]};var _0x1d5759=_[_0xe0b0('0x29')](db[_0xe0b0('0x2a')][_0xe0b0('0x2b')],function(_0x4fb3b7){return{'name':_0x4fb3b7[_0xe0b0('0x2c')],'type':_0x4fb3b7[_0xe0b0('0x2d')]['key']};});_0x419b1f['model']=_[_0xe0b0('0x29')](_0x1d5759,_0xe0b0('0x27'));_0x419b1f[_0xe0b0('0x2e')]=_[_0xe0b0('0x2f')](_0x1b8aa8[_0xe0b0('0x2e')]);_0x419b1f['filters']=_[_0xe0b0('0x30')](_0x419b1f[_0xe0b0('0x31')],_0x419b1f[_0xe0b0('0x2e')]);_0x15e13b[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x419b1f['model'],qs[_0xe0b0('0x33')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x33')]));_0x15e13b[_0xe0b0('0x32')]=_0x15e13b[_0xe0b0('0x32')][_0xe0b0('0x34')]?_0x15e13b[_0xe0b0('0x32')]:_0x419b1f[_0xe0b0('0x31')];if(!_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x35')](_0xe0b0('0x36'))){_0x15e13b[_0xe0b0('0x1d')]=qs[_0xe0b0('0x1d')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1d')]);_0x15e13b['offset']=qs[_0xe0b0('0x1c')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1c')]);}_0x15e13b[_0xe0b0('0x37')]=qs[_0xe0b0('0x38')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x38')]);_0x15e13b['where']=qs['filters'](_['pick'](_0x1b8aa8['query'],_0x419b1f[_0xe0b0('0x39')]),_0x1d5759);if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]){_0x15e13b['where']=_[_0xe0b0('0x3b')](_0x15e13b[_0xe0b0('0x3c')],{'$or':_[_0xe0b0('0x29')](_0x1d5759,function(_0x297c64){if(_0x297c64['type']!==_0xe0b0('0x3d')){var _0xfbb61d={};_0xfbb61d[_0x297c64[_0xe0b0('0x27')]]={'$like':'%'+_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]+'%'};return _0xfbb61d;}})});}_0x15e13b=_[_0xe0b0('0x3b')]({},_0x15e13b,_0x1b8aa8[_0xe0b0('0x3e')]);var _0x115a69={'where':_0x15e13b[_0xe0b0('0x3c')]};return db['VoiceCallReport'][_0xe0b0('0x3f')](_0x115a69)['then'](function(_0x34178d){_0x36d137[_0xe0b0('0x3f')]=_0x34178d;if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x15e13b['include']=[{'attributes':['id',_0xe0b0('0x27'),_0xe0b0('0x41'),_0xe0b0('0x42')],'model':db[_0xe0b0('0x43')],'as':_0xe0b0('0x43')}];}return db[_0xe0b0('0x2a')][_0xe0b0('0x44')](_0x15e13b);})[_0xe0b0('0x23')](function(_0x52ffe4){_0x36d137[_0xe0b0('0x45')]=_0x52ffe4;return _0x36d137;})[_0xe0b0('0x23')](respondWithFilteredResult(_0x5b7a64,_0x15e13b))['catch'](handleError(_0x5b7a64,null));};exports['show']=function(_0x327fb4,_0x247f8d){var _0x56e7df={'raw':!![],'where':{'id':_0x327fb4[_0xe0b0('0x46')]['id']}},_0x18a59d={};_0x18a59d[_0xe0b0('0x31')]=_[_0xe0b0('0x2f')](db[_0xe0b0('0x2a')]['rawAttributes']);_0x18a59d['query']=_['keys'](_0x327fb4[_0xe0b0('0x2e')]);_0x18a59d[_0xe0b0('0x39')]=_['intersection'](_0x18a59d[_0xe0b0('0x31')],_0x18a59d[_0xe0b0('0x2e')]);_0x56e7df[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x18a59d[_0xe0b0('0x31')],qs['fields'](_0x327fb4['query'][_0xe0b0('0x33')]));_0x56e7df[_0xe0b0('0x32')]=_0x56e7df[_0xe0b0('0x32')][_0xe0b0('0x34')]?_0x56e7df[_0xe0b0('0x32')]:_0x18a59d['model'];if(_0x327fb4[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x56e7df['include']=[{'all':!![]}];}_0x56e7df=_['merge']({},_0x56e7df,_0x327fb4['options']);return db[_0xe0b0('0x2a')][_0xe0b0('0x47')](_0x56e7df)[_0xe0b0('0x23')](handleEntityNotFound(_0x247f8d,null))[_0xe0b0('0x23')](respondWithResult(_0x247f8d,null))['catch'](handleError(_0x247f8d,null));};exports[_0xe0b0('0x48')]=function(_0x87d8f3,_0x483f12){return db['VoiceCallReport'][_0xe0b0('0x48')](_0x87d8f3[_0xe0b0('0x49')],{})['then'](respondWithResult(_0x483f12,0xc9))[_0xe0b0('0x4a')](handleError(_0x483f12,null));};exports[_0xe0b0('0x24')]=function(_0x504284,_0x5cb2b6){return db[_0xe0b0('0x2a')]['find']({'where':{'id':_0x504284[_0xe0b0('0x46')]['id']}})[_0xe0b0('0x23')](handleEntityNotFound(_0x5cb2b6,null))[_0xe0b0('0x23')](removeEntity(_0x5cb2b6,null))[_0xe0b0('0x4a')](handleError(_0x5cb2b6,null));};exports[_0xe0b0('0x4b')]=function(_0xf9e694,_0x5f5486){return db['VoiceCallReport'][_0xe0b0('0x4b')]()['then'](respondWithResult(_0x5f5486,null))['catch'](handleError(_0x5f5486,null));};exports[_0xe0b0('0x4c')]=function(_0x222174,_0x54cf7b){if(_0x222174['body'][_0xe0b0('0x4d')]){delete _0x222174[_0xe0b0('0x49')][_0xe0b0('0x4d')];}return db[_0xe0b0('0x2a')][_0xe0b0('0x47')]({'where':{'uniqueid':_0x222174[_0xe0b0('0x46')]['id'],'UserId':{'$or':[null,_0x222174[_0xe0b0('0x4e')]['id']]}}})['then'](handleEntityNotFound(_0x54cf7b,null))[_0xe0b0('0x23')](saveUpdates(_0x222174['body'],null))[_0xe0b0('0x23')](respondWithResult(_0x54cf7b,null))['catch'](handleError(_0x54cf7b,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 112b778..15351db 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 _0x7ea8=['api','moment','request-promise','path','rimraf','exports','define','VoiceCallReport','report_call','uniqueid','lodash','util','../../config/logger'];(function(_0x424678,_0x117a3e){var _0x227c46=function(_0x1c5092){while(--_0x1c5092){_0x424678['push'](_0x424678['shift']());}};_0x227c46(++_0x117a3e);}(_0x7ea8,0x1d1));var _0x87ea=function(_0x1abfed,_0x41b1f4){_0x1abfed=_0x1abfed-0x0;var _0x474770=_0x7ea8[_0x1abfed];return _0x474770;};'use strict';var _=require(_0x87ea('0x0'));var util=require(_0x87ea('0x1'));var logger=require(_0x87ea('0x2'))(_0x87ea('0x3'));var moment=require(_0x87ea('0x4'));var BPromise=require('bluebird');var rp=require(_0x87ea('0x5'));var fs=require('fs');var path=require(_0x87ea('0x6'));var rimraf=require(_0x87ea('0x7'));var config=require('../../config/environment');var attributes=require('./voiceCallReport.attributes');module[_0x87ea('0x8')]=function(_0x1927e0,_0x70dccf){return _0x1927e0[_0x87ea('0x9')](_0x87ea('0xa'),attributes,{'tableName':_0x87ea('0xb'),'paranoid':![],'indexes':[{'fields':[_0x87ea('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf351=['exports','define','VoiceCallReport','report_call','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceCallReport.attributes'];(function(_0x4bc4db,_0x43e85e){var _0x34277f=function(_0x5d82d5){while(--_0x5d82d5){_0x4bc4db['push'](_0x4bc4db['shift']());}};_0x34277f(++_0x43e85e);}(_0xf351,0x1a5));var _0x1f35=function(_0x12254f,_0x100cfe){_0x12254f=_0x12254f-0x0;var _0x3a4fa2=_0xf351[_0x12254f];return _0x3a4fa2;};'use strict';var _=require(_0x1f35('0x0'));var util=require(_0x1f35('0x1'));var logger=require(_0x1f35('0x2'))(_0x1f35('0x3'));var moment=require(_0x1f35('0x4'));var BPromise=require(_0x1f35('0x5'));var rp=require(_0x1f35('0x6'));var fs=require('fs');var path=require(_0x1f35('0x7'));var rimraf=require(_0x1f35('0x8'));var config=require(_0x1f35('0x9'));var attributes=require(_0x1f35('0xa'));module[_0x1f35('0xb')]=function(_0x5a6185,_0xbe2a37){return _0x5a6185[_0x1f35('0xc')](_0x1f35('0xd'),attributes,{'tableName':_0x1f35('0xe'),'paranoid':![],'indexes':[{'fields':[_0x1f35('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index bfe9457..254f568 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 _0xe23c=['model','stringify','CreateVoiceCallReport','create','UpdateVoiceCallReport','update','body','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','then','info','VoiceCallReport,\x20%s,\x20%s','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','GetVoiceCallReport','VoiceCallReport','options','raw','where','attributes','limit','include','map'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xe23c,0x1c3));var _0xce23=function(_0x1d8119,_0xc98f17){_0x1d8119=_0x1d8119-0x0;var _0x3e30f6=_0xe23c[_0x1d8119];return _0x3e30f6;};'use strict';var _=require(_0xce23('0x0'));var util=require(_0xce23('0x1'));var moment=require(_0xce23('0x2'));var BPromise=require(_0xce23('0x3'));var rs=require(_0xce23('0x4'));var fs=require('fs');var Redis=require(_0xce23('0x5'));var db=require(_0xce23('0x6'))['db'];var utils=require(_0xce23('0x7'));var logger=require(_0xce23('0x8'))(_0xce23('0x9'));var config=require('../../config/environment');var jayson=require(_0xce23('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x52b01d,_0x1e8042,_0x215a7d){return new BPromise(function(_0x13f1b4,_0x55358b){return client['request'](_0x52b01d,_0x215a7d)[_0xce23('0xb')](function(_0x2870b5){logger[_0xce23('0xc')](_0xce23('0xd'),_0x1e8042,'request\x20sent');logger[_0xce23('0xe')](_0xce23('0xf'),_0x1e8042,_0xce23('0x10'),JSON['stringify'](_0x2870b5));if(_0x2870b5['error']){if(_0x2870b5[_0xce23('0x11')][_0xce23('0x12')]===0x1f4){logger[_0xce23('0x11')](_0xce23('0xd'),_0x1e8042,_0x2870b5[_0xce23('0x11')]['message']);return _0x55358b(_0x2870b5[_0xce23('0x11')][_0xce23('0x13')]);}logger[_0xce23('0x11')](_0xce23('0xd'),_0x1e8042,_0x2870b5['error']['message']);return _0x13f1b4(_0x2870b5[_0xce23('0x11')][_0xce23('0x13')]);}else{logger[_0xce23('0xc')]('VoiceCallReport,\x20%s,\x20%s',_0x1e8042,_0xce23('0x10'));_0x13f1b4(_0x2870b5['result']['message']);}})[_0xce23('0x14')](function(_0x25fb5a){logger[_0xce23('0x11')](_0xce23('0xd'),_0x1e8042,_0x25fb5a);_0x55358b(_0x25fb5a);});});}exports[_0xce23('0x15')]=function(_0x2aeb31){var _0x4caefd=this;return new Promise(function(_0x4a0779,_0x508110){return db[_0xce23('0x16')]['findAll']({'raw':_0x2aeb31[_0xce23('0x17')]?_0x2aeb31[_0xce23('0x17')][_0xce23('0x18')]===undefined?!![]:![]:!![],'where':_0x2aeb31[_0xce23('0x17')]?_0x2aeb31['options'][_0xce23('0x19')]||null:null,'attributes':_0x2aeb31[_0xce23('0x17')]?_0x2aeb31['options'][_0xce23('0x1a')]||null:null,'limit':_0x2aeb31[_0xce23('0x17')]?_0x2aeb31[_0xce23('0x17')][_0xce23('0x1b')]||null:null,'include':_0x2aeb31[_0xce23('0x17')]?_0x2aeb31[_0xce23('0x17')][_0xce23('0x1c')]?_[_0xce23('0x1d')](_0x2aeb31[_0xce23('0x17')]['include'],function(_0x285b28){return{'model':db[_0x285b28[_0xce23('0x1e')]],'as':_0x285b28['as'],'attributes':_0x285b28[_0xce23('0x1a')],'include':_0x285b28[_0xce23('0x1c')]?_[_0xce23('0x1d')](_0x285b28[_0xce23('0x1c')],function(_0x4032ef){return{'model':db[_0x4032ef['model']],'as':_0x4032ef['as'],'attributes':_0x4032ef[_0xce23('0x1a')],'include':_0x4032ef[_0xce23('0x1c')]?_[_0xce23('0x1d')](_0x4032ef[_0xce23('0x1c')],function(_0x4c0be0){return{'model':db[_0x4c0be0[_0xce23('0x1e')]],'as':_0x4c0be0['as'],'attributes':_0x4c0be0[_0xce23('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x52b892){logger[_0xce23('0xc')](_0xce23('0x15'),_0x2aeb31);logger[_0xce23('0xe')](_0xce23('0x15'),_0x2aeb31,JSON[_0xce23('0x1f')](_0x52b892));_0x4a0779(_0x52b892);})[_0xce23('0x14')](function(_0x80f4d7){logger[_0xce23('0x11')]('GetVoiceCallReport',_0x80f4d7['message'],_0x2aeb31);_0x508110(_0x4caefd[_0xce23('0x11')](0x1f4,_0x80f4d7[_0xce23('0x13')]));});});};exports[_0xce23('0x20')]=function(_0x1f7e1d){var _0x55d987=this;return new Promise(function(_0x306278,_0x259c04){return db[_0xce23('0x16')][_0xce23('0x21')](_0x1f7e1d['body'],{'raw':_0x1f7e1d['options']?_0x1f7e1d['options'][_0xce23('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x111847){logger['info'](_0xce23('0x20'),_0x1f7e1d);logger['debug'](_0xce23('0x20'),_0x1f7e1d,JSON['stringify'](_0x111847));_0x306278(_0x111847);})['catch'](function(_0x36f795){logger[_0xce23('0x11')](_0xce23('0x20'),_0x36f795[_0xce23('0x13')],_0x1f7e1d);_0x259c04(_0x55d987[_0xce23('0x11')](0x1f4,_0x36f795[_0xce23('0x13')]));});});};exports[_0xce23('0x22')]=function(_0x58149e){var _0x3a7d31=this;return new Promise(function(_0x1b570f,_0x18cc29){return db['VoiceCallReport'][_0xce23('0x23')](_0x58149e[_0xce23('0x24')],{'raw':_0x58149e[_0xce23('0x17')]?_0x58149e[_0xce23('0x17')][_0xce23('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x58149e[_0xce23('0x17')]?_0x58149e[_0xce23('0x17')]['where']||null:null,'attributes':_0x58149e['options']?_0x58149e['options']['attributes']||null:null,'limit':_0x58149e[_0xce23('0x17')]?_0x58149e[_0xce23('0x17')][_0xce23('0x1b')]||null:null})['then'](function(_0x4b6460){logger[_0xce23('0xc')]('UpdateVoiceCallReport',_0x58149e);logger[_0xce23('0xe')](_0xce23('0x22'),_0x58149e,JSON[_0xce23('0x1f')](_0x4b6460));_0x1b570f(_0x4b6460);})[_0xce23('0x14')](function(_0x16c80e){logger['error']('UpdateVoiceCallReport',_0x16c80e[_0xce23('0x13')],_0x58149e);_0x18cc29(_0x3a7d31[_0xce23('0x11')](0x1f4,_0x16c80e[_0xce23('0x13')]));});});}; \ No newline at end of file +var _0x1eca=['catch','update','body','where','UpdateVoiceCallReport','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','VoiceCallReport,\x20%s,\x20%s,\x20%s','error','message','result','GetVoiceCallReport','VoiceCallReport','options','raw','attributes','limit','include','map','model','debug','stringify','CreateVoiceCallReport','create'];(function(_0x36eea8,_0x16025c){var _0x56d6b0=function(_0xd0f60f){while(--_0xd0f60f){_0x36eea8['push'](_0x36eea8['shift']());}};_0x56d6b0(++_0x16025c);}(_0x1eca,0x10f));var _0xa1ec=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1eca[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa1ec('0x0'));var util=require(_0xa1ec('0x1'));var moment=require('moment');var BPromise=require(_0xa1ec('0x2'));var rs=require(_0xa1ec('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa1ec('0x4'));var logger=require(_0xa1ec('0x5'))(_0xa1ec('0x6'));var config=require(_0xa1ec('0x7'));var jayson=require(_0xa1ec('0x8'));var client=jayson[_0xa1ec('0x9')][_0xa1ec('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x289a3c,_0x2bdfee,_0x4c13d9){return new BPromise(function(_0x4f276a,_0x170394){return client[_0xa1ec('0xb')](_0x289a3c,_0x4c13d9)[_0xa1ec('0xc')](function(_0x5e1a1d){logger[_0xa1ec('0xd')](_0xa1ec('0xe'),_0x2bdfee,_0xa1ec('0xf'));logger['debug'](_0xa1ec('0x10'),_0x2bdfee,_0xa1ec('0xf'),JSON['stringify'](_0x5e1a1d));if(_0x5e1a1d[_0xa1ec('0x11')]){if(_0x5e1a1d[_0xa1ec('0x11')]['code']===0x1f4){logger[_0xa1ec('0x11')](_0xa1ec('0xe'),_0x2bdfee,_0x5e1a1d[_0xa1ec('0x11')][_0xa1ec('0x12')]);return _0x170394(_0x5e1a1d['error']['message']);}logger[_0xa1ec('0x11')]('VoiceCallReport,\x20%s,\x20%s',_0x2bdfee,_0x5e1a1d[_0xa1ec('0x11')][_0xa1ec('0x12')]);return _0x4f276a(_0x5e1a1d[_0xa1ec('0x11')][_0xa1ec('0x12')]);}else{logger[_0xa1ec('0xd')](_0xa1ec('0xe'),_0x2bdfee,_0xa1ec('0xf'));_0x4f276a(_0x5e1a1d[_0xa1ec('0x13')][_0xa1ec('0x12')]);}})['catch'](function(_0x3715cb){logger[_0xa1ec('0x11')](_0xa1ec('0xe'),_0x2bdfee,_0x3715cb);_0x170394(_0x3715cb);});});}exports[_0xa1ec('0x14')]=function(_0x471fb0){var _0x127f66=this;return new Promise(function(_0x25d903,_0x1e9fa1){return db[_0xa1ec('0x15')]['findAll']({'raw':_0x471fb0[_0xa1ec('0x16')]?_0x471fb0[_0xa1ec('0x16')][_0xa1ec('0x17')]===undefined?!![]:![]:!![],'where':_0x471fb0[_0xa1ec('0x16')]?_0x471fb0['options']['where']||null:null,'attributes':_0x471fb0['options']?_0x471fb0['options'][_0xa1ec('0x18')]||null:null,'limit':_0x471fb0['options']?_0x471fb0[_0xa1ec('0x16')][_0xa1ec('0x19')]||null:null,'include':_0x471fb0[_0xa1ec('0x16')]?_0x471fb0['options'][_0xa1ec('0x1a')]?_[_0xa1ec('0x1b')](_0x471fb0['options']['include'],function(_0x3cb48c){return{'model':db[_0x3cb48c[_0xa1ec('0x1c')]],'as':_0x3cb48c['as'],'attributes':_0x3cb48c[_0xa1ec('0x18')],'include':_0x3cb48c[_0xa1ec('0x1a')]?_['map'](_0x3cb48c[_0xa1ec('0x1a')],function(_0x5d901e){return{'model':db[_0x5d901e['model']],'as':_0x5d901e['as'],'attributes':_0x5d901e[_0xa1ec('0x18')],'include':_0x5d901e['include']?_[_0xa1ec('0x1b')](_0x5d901e[_0xa1ec('0x1a')],function(_0x17834d){return{'model':db[_0x17834d[_0xa1ec('0x1c')]],'as':_0x17834d['as'],'attributes':_0x17834d[_0xa1ec('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2ea0da){logger[_0xa1ec('0xd')](_0xa1ec('0x14'),_0x471fb0);logger[_0xa1ec('0x1d')](_0xa1ec('0x14'),_0x471fb0,JSON[_0xa1ec('0x1e')](_0x2ea0da));_0x25d903(_0x2ea0da);})['catch'](function(_0x456ce8){logger['error'](_0xa1ec('0x14'),_0x456ce8[_0xa1ec('0x12')],_0x471fb0);_0x1e9fa1(_0x127f66['error'](0x1f4,_0x456ce8[_0xa1ec('0x12')]));});});};exports[_0xa1ec('0x1f')]=function(_0x364798){var _0x4cecc4=this;return new Promise(function(_0x213a8c,_0x2ece20){return db['VoiceCallReport'][_0xa1ec('0x20')](_0x364798['body'],{'raw':_0x364798[_0xa1ec('0x16')]?_0x364798[_0xa1ec('0x16')][_0xa1ec('0x17')]===undefined?!![]:![]:!![]})[_0xa1ec('0xc')](function(_0x3b704c){logger[_0xa1ec('0xd')](_0xa1ec('0x1f'),_0x364798);logger['debug'](_0xa1ec('0x1f'),_0x364798,JSON[_0xa1ec('0x1e')](_0x3b704c));_0x213a8c(_0x3b704c);})[_0xa1ec('0x21')](function(_0x5bd60f){logger['error'](_0xa1ec('0x1f'),_0x5bd60f['message'],_0x364798);_0x2ece20(_0x4cecc4[_0xa1ec('0x11')](0x1f4,_0x5bd60f[_0xa1ec('0x12')]));});});};exports['UpdateVoiceCallReport']=function(_0x20752c){var _0x4a1b10=this;return new Promise(function(_0xc3bd2b,_0x30d2b2){return db[_0xa1ec('0x15')][_0xa1ec('0x22')](_0x20752c[_0xa1ec('0x23')],{'raw':_0x20752c[_0xa1ec('0x16')]?_0x20752c[_0xa1ec('0x16')][_0xa1ec('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x20752c[_0xa1ec('0x16')]?_0x20752c[_0xa1ec('0x16')][_0xa1ec('0x24')]||null:null,'attributes':_0x20752c['options']?_0x20752c[_0xa1ec('0x16')][_0xa1ec('0x18')]||null:null,'limit':_0x20752c[_0xa1ec('0x16')]?_0x20752c[_0xa1ec('0x16')][_0xa1ec('0x19')]||null:null})[_0xa1ec('0xc')](function(_0x42814c){logger[_0xa1ec('0xd')](_0xa1ec('0x25'),_0x20752c);logger['debug'](_0xa1ec('0x25'),_0x20752c,JSON['stringify'](_0x42814c));_0xc3bd2b(_0x42814c);})[_0xa1ec('0x21')](function(_0x283b28){logger['error']('UpdateVoiceCallReport',_0x283b28[_0xa1ec('0x12')],_0x20752c);_0x30d2b2(_0x4a1b10[_0xa1ec('0x11')](0x1f4,_0x283b28[_0xa1ec('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index ffbb7f0..44dc740 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 _0x8237=['show','post','create','put','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/:id'];(function(_0x5d30b4,_0x199248){var _0x1acfb8=function(_0x3544b2){while(--_0x3544b2){_0x5d30b4['push'](_0x5d30b4['shift']());}};_0x1acfb8(++_0x199248);}(_0x8237,0x127));var _0x7823=function(_0x44d057,_0x26a1eb){_0x44d057=_0x44d057-0x0;var _0x54fe4f=_0x8237[_0x44d057];return _0x54fe4f;};'use strict';var multer=require(_0x7823('0x0'));var util=require('util');var path=require(_0x7823('0x1'));var timeout=require(_0x7823('0x2'));var express=require(_0x7823('0x3'));var router=express[_0x7823('0x4')]();var fs_extra=require(_0x7823('0x5'));var auth=require(_0x7823('0x6'));var interaction=require(_0x7823('0x7'));var config=require('../../config/environment');var controller=require('./voiceChanSpy.controller');router[_0x7823('0x8')]('/',auth[_0x7823('0x9')](),controller['index']);router[_0x7823('0x8')](_0x7823('0xa'),auth[_0x7823('0x9')](),controller[_0x7823('0xb')]);router[_0x7823('0xc')]('/',auth[_0x7823('0x9')](),controller[_0x7823('0xd')]);router[_0x7823('0xe')](_0x7823('0xa'),auth[_0x7823('0x9')](),controller[_0x7823('0xf')]);router[_0x7823('0x10')]('/:id',auth[_0x7823('0x9')](),controller['destroy']);module[_0x7823('0x11')]=router; \ No newline at end of file +var _0x56d8=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./voiceChanSpy.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','multer'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x56d8,0x77));var _0x856d=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0x56d8[_0xaa0309];return _0x5de7ce;};'use strict';var multer=require(_0x856d('0x0'));var util=require(_0x856d('0x1'));var path=require(_0x856d('0x2'));var timeout=require(_0x856d('0x3'));var express=require(_0x856d('0x4'));var router=express[_0x856d('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x856d('0x6'));var interaction=require(_0x856d('0x7'));var config=require('../../config/environment');var controller=require(_0x856d('0x8'));router[_0x856d('0x9')]('/',auth[_0x856d('0xa')](),controller['index']);router[_0x856d('0x9')](_0x856d('0xb'),auth['isAuthenticated'](),controller[_0x856d('0xc')]);router[_0x856d('0xd')]('/',auth[_0x856d('0xa')](),controller[_0x856d('0xe')]);router[_0x856d('0xf')](_0x856d('0xb'),auth[_0x856d('0xa')](),controller[_0x856d('0x10')]);router[_0x856d('0x11')](_0x856d('0xb'),auth[_0x856d('0xa')](),controller[_0x856d('0x12')]);module[_0x856d('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 741b972..eab33de 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 _0x54a9=['STRING','name','options','join','getDataValue','BOOLEAN','sequelize','exports'];(function(_0x5817e6,_0x44a2d0){var _0x51916a=function(_0x1a56e3){while(--_0x1a56e3){_0x5817e6['push'](_0x5817e6['shift']());}};_0x51916a(++_0x44a2d0);}(_0x54a9,0x136));var _0x954a=function(_0x144945,_0xd1d8e9){_0x144945=_0x144945-0x0;var _0x58f717=_0x54a9[_0x144945];return _0x58f717;};'use strict';var Sequelize=require(_0x954a('0x0'));module[_0x954a('0x1')]={'name':{'type':Sequelize[_0x954a('0x2')]},'prefix':{'type':Sequelize[_0x954a('0x2')],'unique':_0x954a('0x3'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x1cacce){this['setDataValue'](_0x954a('0x4'),_0x1cacce?_0x1cacce[_0x954a('0x5')](''):[]);},'get':function(){return this[_0x954a('0x6')](_0x954a('0x4'))?this['getDataValue'](_0x954a('0x4'))['split'](''):[];}},'auth':{'type':Sequelize[_0x954a('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0x954a('0x2')]},'record':{'type':Sequelize[_0x954a('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x954a('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x625c=['options','split','BOOLEAN','sequelize','exports','STRING','join','getDataValue'];(function(_0x12e3d2,_0x77a0e0){var _0x2e632c=function(_0x52d273){while(--_0x52d273){_0x12e3d2['push'](_0x12e3d2['shift']());}};_0x2e632c(++_0x77a0e0);}(_0x625c,0x73));var _0xc625=function(_0x4cd12b,_0xe805d){_0x4cd12b=_0x4cd12b-0x0;var _0x43cfc4=_0x625c[_0x4cd12b];return _0x43cfc4;};'use strict';var Sequelize=require(_0xc625('0x0'));module[_0xc625('0x1')]={'name':{'type':Sequelize[_0xc625('0x2')]},'prefix':{'type':Sequelize[_0xc625('0x2')],'unique':'name','allowNull':![]},'options':{'type':Sequelize[_0xc625('0x2')],'set':function(_0x5b99f8){this['setDataValue']('options',_0x5b99f8?_0x5b99f8[_0xc625('0x3')](''):[]);},'get':function(){return this[_0xc625('0x4')]('options')?this['getDataValue'](_0xc625('0x5'))[_0xc625('0x6')](''):[];}},'auth':{'type':Sequelize[_0xc625('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0xc625('0x2')]},'record':{'type':Sequelize[_0xc625('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xc625('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 0d4af46..4fc7f09 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 _0xbdb7=['../../mysqldb','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','save','update','UserProfileResource','then','sendStatus','error','stack','name','send','index','VoiceChanSpy','rawAttributes','fieldName','map','query','filters','intersection','model','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','keys','fields','include','find','create','body','role','user','get','ChanSpies','UserProfileSection','userProfileId','autoAssociation','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x517a99,_0x381cdc){var _0x3a106b=function(_0x51c64f){while(--_0x51c64f){_0x517a99['push'](_0x517a99['shift']());}};_0x3a106b(++_0x381cdc);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x4766f2,_0x38b8a1){_0x4766f2=_0x4766f2-0x0;var _0xe746c2=_0xbdb7[_0x4766f2];return _0xe746c2;};'use strict';var emlformat=require(_0x7bdb('0x0'));var rimraf=require(_0x7bdb('0x1'));var zipdir=require(_0x7bdb('0x2'));var jsonpatch=require(_0x7bdb('0x3'));var rp=require(_0x7bdb('0x4'));var moment=require(_0x7bdb('0x5'));var BPromise=require(_0x7bdb('0x6'));var Mustache=require(_0x7bdb('0x7'));var util=require(_0x7bdb('0x8'));var path=require('path');var sox=require(_0x7bdb('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7bdb('0xa'));var _=require(_0x7bdb('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7bdb('0xc'));var deskjs=require(_0x7bdb('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7bdb('0xe'));var Redis=require(_0x7bdb('0xf'));var authService=require(_0x7bdb('0x10'));var qs=require(_0x7bdb('0x11'));var as=require(_0x7bdb('0x12'));var hardwareService=require(_0x7bdb('0x13'));var logger=require(_0x7bdb('0x14'))(_0x7bdb('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x7bdb('0x16'))['db'];function respondWithStatusCode(_0x25e3cb,_0x496613){_0x496613=_0x496613||0xcc;return function(_0x8d74ff){if(_0x8d74ff){return _0x25e3cb['sendStatus'](_0x496613);}return _0x25e3cb['status'](_0x496613)[_0x7bdb('0x17')]();};}function respondWithResult(_0x46dd4a,_0x4fd91a){_0x4fd91a=_0x4fd91a||0xc8;return function(_0x50eeca){if(_0x50eeca){return _0x46dd4a['status'](_0x4fd91a)[_0x7bdb('0x18')](_0x50eeca);}};}function respondWithFilteredResult(_0x195b2e,_0xe9919f){return function(_0x25d417){if(_0x25d417){var _0x31c909=typeof _0xe9919f[_0x7bdb('0x19')]===_0x7bdb('0x1a')&&typeof _0xe9919f[_0x7bdb('0x1b')]==='undefined';var _0x1c5750=_0x25d417[_0x7bdb('0x1c')];var _0x5723f4=_0x31c909?0x0:_0xe9919f[_0x7bdb('0x19')];var _0x4ffd4b=_0x31c909?_0x25d417[_0x7bdb('0x1c')]:_0xe9919f[_0x7bdb('0x19')]+_0xe9919f['limit'];var _0x3e5f8e;if(_0x4ffd4b>=_0x1c5750){_0x4ffd4b=_0x1c5750;_0x3e5f8e=0xc8;}else{_0x3e5f8e=0xce;}_0x195b2e[_0x7bdb('0x1d')](_0x3e5f8e);return _0x195b2e[_0x7bdb('0x1e')](_0x7bdb('0x1f'),_0x5723f4+'-'+_0x4ffd4b+'/'+_0x1c5750)[_0x7bdb('0x18')](_0x25d417);}return null;};}function patchUpdates(_0x5bfc35){return function(_0x49f353){try{jsonpatch[_0x7bdb('0x20')](_0x49f353,_0x5bfc35,!![]);}catch(_0xcb25f2){return BPromise['reject'](_0xcb25f2);}return _0x49f353[_0x7bdb('0x21')]();};}function saveUpdates(_0x118ea1,_0x346c72){return function(_0x3f53e7){if(_0x3f53e7){return _0x3f53e7[_0x7bdb('0x22')](_0x118ea1)['then'](function(_0x1d37ac){return _0x1d37ac;});}return null;};}function removeEntity(_0xdad53d,_0x40c447){return function(_0x3a456f){if(_0x3a456f){return _0x3a456f['destroy']()['then'](function(){var _0x3c423f=_0x3a456f['get']({'plain':!![]});var _0x47abaf='ChanSpies';return db[_0x7bdb('0x23')]['destroy']({'where':{'type':_0x47abaf,'resourceId':_0x3c423f['id']}})[_0x7bdb('0x24')](function(){return _0x3a456f;});})[_0x7bdb('0x24')](function(){_0xdad53d[_0x7bdb('0x1d')](0xcc)[_0x7bdb('0x17')]();});}};}function handleEntityNotFound(_0x2a494e,_0x523869){return function(_0x10e818){if(!_0x10e818){_0x2a494e[_0x7bdb('0x25')](0x194);}return _0x10e818;};}function handleError(_0x399b62,_0xe1141d){_0xe1141d=_0xe1141d||0x1f4;return function(_0x371e8a){logger[_0x7bdb('0x26')](_0x371e8a[_0x7bdb('0x27')]);if(_0x371e8a[_0x7bdb('0x28')]){delete _0x371e8a[_0x7bdb('0x28')];}_0x399b62[_0x7bdb('0x1d')](_0xe1141d)[_0x7bdb('0x29')](_0x371e8a);};}exports[_0x7bdb('0x2a')]=function(_0x5b386d,_0x388a45){var _0x23fc3a={},_0x8f7672={},_0x9f5c1={'count':0x0,'rows':[]};var _0x29eac5=_['map'](db[_0x7bdb('0x2b')][_0x7bdb('0x2c')],function(_0x9ac56){return{'name':_0x9ac56[_0x7bdb('0x2d')],'type':_0x9ac56['type']['key']};});_0x8f7672['model']=_[_0x7bdb('0x2e')](_0x29eac5,'name');_0x8f7672[_0x7bdb('0x2f')]=_['keys'](_0x5b386d[_0x7bdb('0x2f')]);_0x8f7672[_0x7bdb('0x30')]=_[_0x7bdb('0x31')](_0x8f7672['model'],_0x8f7672[_0x7bdb('0x2f')]);_0x23fc3a['attributes']=_['intersection'](_0x8f7672[_0x7bdb('0x32')],qs['fields'](_0x5b386d[_0x7bdb('0x2f')]['fields']));_0x23fc3a['attributes']=_0x23fc3a[_0x7bdb('0x33')][_0x7bdb('0x34')]?_0x23fc3a[_0x7bdb('0x33')]:_0x8f7672[_0x7bdb('0x32')];if(!_0x5b386d[_0x7bdb('0x2f')][_0x7bdb('0x35')]('nolimit')){_0x23fc3a[_0x7bdb('0x1b')]=qs[_0x7bdb('0x1b')](_0x5b386d[_0x7bdb('0x2f')][_0x7bdb('0x1b')]);_0x23fc3a[_0x7bdb('0x19')]=qs[_0x7bdb('0x19')](_0x5b386d[_0x7bdb('0x2f')][_0x7bdb('0x19')]);}_0x23fc3a[_0x7bdb('0x36')]=qs['sort'](_0x5b386d['query'][_0x7bdb('0x37')]);_0x23fc3a[_0x7bdb('0x38')]=qs[_0x7bdb('0x30')](_[_0x7bdb('0x39')](_0x5b386d[_0x7bdb('0x2f')],_0x8f7672['filters']),_0x29eac5);if(_0x5b386d['query'][_0x7bdb('0x3a')]){_0x23fc3a['where']=_[_0x7bdb('0x3b')](_0x23fc3a['where'],{'$or':_[_0x7bdb('0x2e')](_0x29eac5,function(_0x5d1826){if(_0x5d1826['type']!==_0x7bdb('0x3c')){var _0x2d578e={};_0x2d578e[_0x5d1826[_0x7bdb('0x28')]]={'$like':'%'+_0x5b386d[_0x7bdb('0x2f')][_0x7bdb('0x3a')]+'%'};return _0x2d578e;}})});}_0x23fc3a=_[_0x7bdb('0x3b')]({},_0x23fc3a,_0x5b386d[_0x7bdb('0x3d')]);var _0x501aff={'where':_0x23fc3a['where']};return db[_0x7bdb('0x2b')][_0x7bdb('0x1c')](_0x501aff)[_0x7bdb('0x24')](function(_0x3509e4){_0x9f5c1[_0x7bdb('0x1c')]=_0x3509e4;if(_0x5b386d[_0x7bdb('0x2f')][_0x7bdb('0x3e')]){_0x23fc3a['include']=[{'all':!![]}];}return db['VoiceChanSpy'][_0x7bdb('0x3f')](_0x23fc3a);})[_0x7bdb('0x24')](function(_0x4636f8){_0x9f5c1[_0x7bdb('0x40')]=_0x4636f8;return _0x9f5c1;})['then'](respondWithFilteredResult(_0x388a45,_0x23fc3a))[_0x7bdb('0x41')](handleError(_0x388a45,null));};exports['show']=function(_0x37029b,_0x27de25){var _0x218361={'raw':![],'where':{'id':_0x37029b[_0x7bdb('0x42')]['id']}},_0x264f3a={};_0x264f3a[_0x7bdb('0x32')]=_[_0x7bdb('0x43')](db[_0x7bdb('0x2b')][_0x7bdb('0x2c')]);_0x264f3a['query']=_[_0x7bdb('0x43')](_0x37029b[_0x7bdb('0x2f')]);_0x264f3a['filters']=_[_0x7bdb('0x31')](_0x264f3a['model'],_0x264f3a[_0x7bdb('0x2f')]);_0x218361[_0x7bdb('0x33')]=_[_0x7bdb('0x31')](_0x264f3a[_0x7bdb('0x32')],qs[_0x7bdb('0x44')](_0x37029b['query'][_0x7bdb('0x44')]));_0x218361[_0x7bdb('0x33')]=_0x218361[_0x7bdb('0x33')][_0x7bdb('0x34')]?_0x218361[_0x7bdb('0x33')]:_0x264f3a['model'];if(_0x37029b[_0x7bdb('0x2f')][_0x7bdb('0x3e')]){_0x218361[_0x7bdb('0x45')]=[{'all':!![]}];}_0x218361=_[_0x7bdb('0x3b')]({},_0x218361,_0x37029b[_0x7bdb('0x3d')]);return db[_0x7bdb('0x2b')][_0x7bdb('0x46')](_0x218361)[_0x7bdb('0x24')](handleEntityNotFound(_0x27de25,null))[_0x7bdb('0x24')](respondWithResult(_0x27de25,null))[_0x7bdb('0x41')](handleError(_0x27de25,null));};exports['create']=function(_0x189cf8,_0x58c4bc){return db['VoiceChanSpy'][_0x7bdb('0x47')](_0x189cf8[_0x7bdb('0x48')],{})['then'](function(_0x37780a){var _0x186809=_0x189cf8['user']['get']({'plain':!![]});if(!_0x186809)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x186809[_0x7bdb('0x49')]===_0x7bdb('0x4a')){var _0x2fab74=_0x37780a[_0x7bdb('0x4b')]({'plain':!![]});var _0x33687b=_0x7bdb('0x4c');return db[_0x7bdb('0x4d')][_0x7bdb('0x46')]({'where':{'name':_0x33687b,'userProfileId':_0x186809[_0x7bdb('0x4e')]},'raw':!![]})[_0x7bdb('0x24')](function(_0x5a8d4a){if(_0x5a8d4a&&_0x5a8d4a[_0x7bdb('0x4f')]===0x0){return db['UserProfileResource'][_0x7bdb('0x47')]({'name':_0x2fab74[_0x7bdb('0x28')],'resourceId':_0x2fab74['id'],'type':_0x5a8d4a[_0x7bdb('0x28')],'sectionId':_0x5a8d4a['id']},{})[_0x7bdb('0x24')](function(){return _0x37780a;});}else{return _0x37780a;}})['catch'](function(_0x258f29){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x258f29);throw _0x258f29;});}return _0x37780a;})[_0x7bdb('0x24')](respondWithResult(_0x58c4bc,0xc9))[_0x7bdb('0x41')](handleError(_0x58c4bc,null));};exports['update']=function(_0x4e17f3,_0x49bb3f){if(_0x4e17f3[_0x7bdb('0x48')]['id']){delete _0x4e17f3['body']['id'];}return db['VoiceChanSpy'][_0x7bdb('0x46')]({'where':{'id':_0x4e17f3[_0x7bdb('0x42')]['id']}})[_0x7bdb('0x24')](handleEntityNotFound(_0x49bb3f,null))[_0x7bdb('0x24')](saveUpdates(_0x4e17f3['body'],null))[_0x7bdb('0x24')](respondWithResult(_0x49bb3f,null))['catch'](handleError(_0x49bb3f,null));};exports[_0x7bdb('0x50')]=function(_0x7f2d89,_0x82f990){return db[_0x7bdb('0x2b')][_0x7bdb('0x46')]({'where':{'id':_0x7f2d89[_0x7bdb('0x42')]['id']}})['then'](handleEntityNotFound(_0x82f990,null))[_0x7bdb('0x24')](removeEntity(_0x82f990,null))[_0x7bdb('0x41')](handleError(_0x82f990,null));}; \ No newline at end of file +var _0xc820=['mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','offset','limit','undefined','Content-Range','apply','save','update','then','destroy','get','ChanSpies','sendStatus','stack','map','VoiceChanSpy','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','name','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x36f98e,_0x18c494){var _0x437cd6=function(_0x2cde8e){while(--_0x2cde8e){_0x36f98e['push'](_0x36f98e['shift']());}};_0x437cd6(++_0x18c494);}(_0xc820,0x13f));var _0x0c82=function(_0x599a3e,_0x312a16){_0x599a3e=_0x599a3e-0x0;var _0xf64414=_0xc820[_0x599a3e];return _0xf64414;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0c82('0x0'));var zipdir=require(_0x0c82('0x1'));var jsonpatch=require(_0x0c82('0x2'));var rp=require(_0x0c82('0x3'));var moment=require(_0x0c82('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0c82('0x5'));var util=require('util');var path=require(_0x0c82('0x6'));var sox=require(_0x0c82('0x7'));var csv=require(_0x0c82('0x8'));var ejs=require(_0x0c82('0x9'));var fs=require('fs');var fs_extra=require(_0x0c82('0xa'));var _=require(_0x0c82('0xb'));var squel=require(_0x0c82('0xc'));var crypto=require(_0x0c82('0xd'));var jsforce=require(_0x0c82('0xe'));var deskjs=require(_0x0c82('0xf'));var toCsv=require(_0x0c82('0x8'));var querystring=require(_0x0c82('0x10'));var Papa=require(_0x0c82('0x11'));var Redis=require(_0x0c82('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x0c82('0x13'));var as=require(_0x0c82('0x14'));var hardwareService=require(_0x0c82('0x15'));var logger=require(_0x0c82('0x16'))(_0x0c82('0x17'));var utils=require(_0x0c82('0x18'));var config=require(_0x0c82('0x19'));var licenseUtil=require(_0x0c82('0x1a'));var db=require(_0x0c82('0x1b'))['db'];function respondWithStatusCode(_0x1e8188,_0x505706){_0x505706=_0x505706||0xcc;return function(_0xc9a01b){if(_0xc9a01b){return _0x1e8188['sendStatus'](_0x505706);}return _0x1e8188['status'](_0x505706)[_0x0c82('0x1c')]();};}function respondWithResult(_0x9074e7,_0x3e1ff8){_0x3e1ff8=_0x3e1ff8||0xc8;return function(_0x1bf511){if(_0x1bf511){return _0x9074e7[_0x0c82('0x1d')](_0x3e1ff8)['json'](_0x1bf511);}};}function respondWithFilteredResult(_0x4610e5,_0x17376c){return function(_0x693427){if(_0x693427){var _0x54caf2=typeof _0x17376c[_0x0c82('0x1e')]==='undefined'&&typeof _0x17376c[_0x0c82('0x1f')]===_0x0c82('0x20');var _0xc12162=_0x693427['count'];var _0x53d28f=_0x54caf2?0x0:_0x17376c[_0x0c82('0x1e')];var _0x3dbfd1=_0x54caf2?_0x693427['count']:_0x17376c[_0x0c82('0x1e')]+_0x17376c['limit'];var _0x2f8ecb;if(_0x3dbfd1>=_0xc12162){_0x3dbfd1=_0xc12162;_0x2f8ecb=0xc8;}else{_0x2f8ecb=0xce;}_0x4610e5[_0x0c82('0x1d')](_0x2f8ecb);return _0x4610e5['set'](_0x0c82('0x21'),_0x53d28f+'-'+_0x3dbfd1+'/'+_0xc12162)['json'](_0x693427);}return null;};}function patchUpdates(_0x3ec9aa){return function(_0x55e106){try{jsonpatch[_0x0c82('0x22')](_0x55e106,_0x3ec9aa,!![]);}catch(_0x13a61d){return BPromise['reject'](_0x13a61d);}return _0x55e106[_0x0c82('0x23')]();};}function saveUpdates(_0x1eb3d3,_0x8a6e02){return function(_0x4a4a04){if(_0x4a4a04){return _0x4a4a04[_0x0c82('0x24')](_0x1eb3d3)[_0x0c82('0x25')](function(_0xaa834){return _0xaa834;});}return null;};}function removeEntity(_0x1d2691,_0x514993){return function(_0x2bcc7f){if(_0x2bcc7f){return _0x2bcc7f[_0x0c82('0x26')]()[_0x0c82('0x25')](function(){var _0x1de4ec=_0x2bcc7f[_0x0c82('0x27')]({'plain':!![]});var _0x1ba2bd=_0x0c82('0x28');return db['UserProfileResource'][_0x0c82('0x26')]({'where':{'type':_0x1ba2bd,'resourceId':_0x1de4ec['id']}})[_0x0c82('0x25')](function(){return _0x2bcc7f;});})['then'](function(){_0x1d2691[_0x0c82('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51bfc3,_0xde34d0){return function(_0x491d69){if(!_0x491d69){_0x51bfc3[_0x0c82('0x29')](0x194);}return _0x491d69;};}function handleError(_0x46490d,_0x38b976){_0x38b976=_0x38b976||0x1f4;return function(_0x16e074){logger['error'](_0x16e074[_0x0c82('0x2a')]);if(_0x16e074['name']){delete _0x16e074['name'];}_0x46490d[_0x0c82('0x1d')](_0x38b976)['send'](_0x16e074);};}exports['index']=function(_0x1ca7ee,_0x5048ea){var _0x57442c={},_0x566e08={},_0x3054e5={'count':0x0,'rows':[]};var _0x3c3f8e=_[_0x0c82('0x2b')](db[_0x0c82('0x2c')][_0x0c82('0x2d')],function(_0x109e2b){return{'name':_0x109e2b[_0x0c82('0x2e')],'type':_0x109e2b[_0x0c82('0x2f')][_0x0c82('0x30')]};});_0x566e08[_0x0c82('0x31')]=_[_0x0c82('0x2b')](_0x3c3f8e,'name');_0x566e08['query']=_[_0x0c82('0x32')](_0x1ca7ee[_0x0c82('0x33')]);_0x566e08[_0x0c82('0x34')]=_[_0x0c82('0x35')](_0x566e08[_0x0c82('0x31')],_0x566e08[_0x0c82('0x33')]);_0x57442c[_0x0c82('0x36')]=_['intersection'](_0x566e08[_0x0c82('0x31')],qs[_0x0c82('0x37')](_0x1ca7ee['query'][_0x0c82('0x37')]));_0x57442c['attributes']=_0x57442c['attributes'][_0x0c82('0x38')]?_0x57442c['attributes']:_0x566e08['model'];if(!_0x1ca7ee[_0x0c82('0x33')][_0x0c82('0x39')](_0x0c82('0x3a'))){_0x57442c[_0x0c82('0x1f')]=qs[_0x0c82('0x1f')](_0x1ca7ee[_0x0c82('0x33')]['limit']);_0x57442c['offset']=qs[_0x0c82('0x1e')](_0x1ca7ee[_0x0c82('0x33')][_0x0c82('0x1e')]);}_0x57442c['order']=qs[_0x0c82('0x3b')](_0x1ca7ee[_0x0c82('0x33')]['sort']);_0x57442c[_0x0c82('0x3c')]=qs[_0x0c82('0x34')](_['pick'](_0x1ca7ee[_0x0c82('0x33')],_0x566e08[_0x0c82('0x34')]),_0x3c3f8e);if(_0x1ca7ee[_0x0c82('0x33')][_0x0c82('0x3d')]){_0x57442c['where']=_[_0x0c82('0x3e')](_0x57442c[_0x0c82('0x3c')],{'$or':_[_0x0c82('0x2b')](_0x3c3f8e,function(_0x26c83f){if(_0x26c83f[_0x0c82('0x2f')]!==_0x0c82('0x3f')){var _0x46c789={};_0x46c789[_0x26c83f['name']]={'$like':'%'+_0x1ca7ee[_0x0c82('0x33')][_0x0c82('0x3d')]+'%'};return _0x46c789;}})});}_0x57442c=_['merge']({},_0x57442c,_0x1ca7ee[_0x0c82('0x40')]);var _0x321082={'where':_0x57442c[_0x0c82('0x3c')]};return db[_0x0c82('0x2c')]['count'](_0x321082)['then'](function(_0x40c796){_0x3054e5['count']=_0x40c796;if(_0x1ca7ee[_0x0c82('0x33')][_0x0c82('0x41')]){_0x57442c[_0x0c82('0x42')]=[{'all':!![]}];}return db['VoiceChanSpy']['findAll'](_0x57442c);})[_0x0c82('0x25')](function(_0x161077){_0x3054e5[_0x0c82('0x43')]=_0x161077;return _0x3054e5;})[_0x0c82('0x25')](respondWithFilteredResult(_0x5048ea,_0x57442c))[_0x0c82('0x44')](handleError(_0x5048ea,null));};exports['show']=function(_0x5bb184,_0x3e524c){var _0x50612a={'raw':![],'where':{'id':_0x5bb184['params']['id']}},_0x543184={};_0x543184[_0x0c82('0x31')]=_[_0x0c82('0x32')](db['VoiceChanSpy'][_0x0c82('0x2d')]);_0x543184[_0x0c82('0x33')]=_[_0x0c82('0x32')](_0x5bb184['query']);_0x543184['filters']=_[_0x0c82('0x35')](_0x543184['model'],_0x543184[_0x0c82('0x33')]);_0x50612a[_0x0c82('0x36')]=_[_0x0c82('0x35')](_0x543184[_0x0c82('0x31')],qs[_0x0c82('0x37')](_0x5bb184[_0x0c82('0x33')][_0x0c82('0x37')]));_0x50612a[_0x0c82('0x36')]=_0x50612a[_0x0c82('0x36')][_0x0c82('0x38')]?_0x50612a[_0x0c82('0x36')]:_0x543184['model'];if(_0x5bb184['query'][_0x0c82('0x41')]){_0x50612a[_0x0c82('0x42')]=[{'all':!![]}];}_0x50612a=_[_0x0c82('0x3e')]({},_0x50612a,_0x5bb184['options']);return db[_0x0c82('0x2c')][_0x0c82('0x45')](_0x50612a)[_0x0c82('0x25')](handleEntityNotFound(_0x3e524c,null))['then'](respondWithResult(_0x3e524c,null))['catch'](handleError(_0x3e524c,null));};exports[_0x0c82('0x46')]=function(_0x3d87d0,_0x4e789d){return db[_0x0c82('0x2c')]['create'](_0x3d87d0[_0x0c82('0x47')],{})[_0x0c82('0x25')](function(_0x54bf35){var _0xb8019a=_0x3d87d0[_0x0c82('0x48')][_0x0c82('0x27')]({'plain':!![]});if(!_0xb8019a)throw new Error(_0x0c82('0x49'));if(_0xb8019a[_0x0c82('0x4a')]===_0x0c82('0x48')){var _0x4bf459=_0x54bf35['get']({'plain':!![]});var _0x7d9138=_0x0c82('0x28');return db[_0x0c82('0x4b')][_0x0c82('0x45')]({'where':{'name':_0x7d9138,'userProfileId':_0xb8019a[_0x0c82('0x4c')]},'raw':!![]})[_0x0c82('0x25')](function(_0x29f8fe){if(_0x29f8fe&&_0x29f8fe['autoAssociation']===0x0){return db['UserProfileResource'][_0x0c82('0x46')]({'name':_0x4bf459['name'],'resourceId':_0x4bf459['id'],'type':_0x29f8fe[_0x0c82('0x4d')],'sectionId':_0x29f8fe['id']},{})[_0x0c82('0x25')](function(){return _0x54bf35;});}else{return _0x54bf35;}})['catch'](function(_0x367726){logger[_0x0c82('0x4e')](_0x0c82('0x4f'),_0x367726);throw _0x367726;});}return _0x54bf35;})[_0x0c82('0x25')](respondWithResult(_0x4e789d,0xc9))['catch'](handleError(_0x4e789d,null));};exports[_0x0c82('0x24')]=function(_0x2e7fe5,_0x401a3c){if(_0x2e7fe5[_0x0c82('0x47')]['id']){delete _0x2e7fe5[_0x0c82('0x47')]['id'];}return db['VoiceChanSpy'][_0x0c82('0x45')]({'where':{'id':_0x2e7fe5[_0x0c82('0x50')]['id']}})[_0x0c82('0x25')](handleEntityNotFound(_0x401a3c,null))[_0x0c82('0x25')](saveUpdates(_0x2e7fe5[_0x0c82('0x47')],null))[_0x0c82('0x25')](respondWithResult(_0x401a3c,null))[_0x0c82('0x44')](handleError(_0x401a3c,null));};exports[_0x0c82('0x26')]=function(_0x500e80,_0x3c21f5){return db[_0x0c82('0x2c')][_0x0c82('0x45')]({'where':{'id':_0x500e80[_0x0c82('0x50')]['id']}})[_0x0c82('0x25')](handleEntityNotFound(_0x3c21f5,null))[_0x0c82('0x25')](removeEntity(_0x3c21f5,null))[_0x0c82('0x44')](handleError(_0x3c21f5,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 7cfbfb6..9e21585 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 _0x5512=['define','VoiceChanSpy','voice_chanspy','then','VoiceExtension','bulkCreate','destroy','util','bluebird','context','format','%s%s','prefix','system','Set','CDR(type)=%s','chanspy','merge','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','password','push','SIP/%s,%s','name','options','join','record','StopMixMonitor','length','concat','internal','User','findAll','agent','catch','exports','models'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0x5512,0xf1));var _0x2551=function(_0x1a7085,_0x5da85f){_0x1a7085=_0x1a7085-0x0;var _0x390d7d=_0x5512[_0x1a7085];return _0x390d7d;};'use strict';var _=require('lodash');var util=require(_0x2551('0x0'));var BPromise=require(_0x2551('0x1'));var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x10b999,_0x2a7415,_0x16391c){var _0x338609=0x1;var _0x168105=[];var _0x2c338a={'context':_0x2a7415[_0x2551('0x2')]||'from-sip','exten':util[_0x2551('0x3')](_0x2551('0x4'),_0x10b999[_0x2551('0x5')],_0x16391c),'type':_0x2551('0x6'),'isApp':![],'ChanSpyId':_0x10b999['id'],'UserId':_0x2a7415['id']};_0x168105['push'](_['merge']({'app':_0x2551('0x7'),'appdata':util[_0x2551('0x3')](_0x2551('0x8'),_0x2551('0x9')),'priority':_0x338609++},_0x2c338a));if(_0x10b999['record']){_0x168105['push'](_[_0x2551('0xa')]({'app':'MixMonitor','appdata':util[_0x2551('0x3')](_0x2551('0xb'),_0x10b999[_0x2551('0xc')]),'priority':_0x338609++},_0x2c338a));}if(_0x10b999[_0x2551('0xd')]){_0x168105['push'](_[_0x2551('0xa')]({'app':_0x2551('0xe'),'appdata':_0x10b999[_0x2551('0xf')],'priority':_0x338609++},_0x2c338a));}_0x168105[_0x2551('0x10')](_[_0x2551('0xa')]({'app':'ChanSpy','appdata':util[_0x2551('0x3')](_0x2551('0x11'),_0x2a7415[_0x2551('0x12')],_0x10b999[_0x2551('0x13')]?_0x10b999[_0x2551('0x13')][_0x2551('0x14')](''):''),'priority':_0x338609++},_0x2c338a));if(_0x10b999[_0x2551('0x15')]){_0x168105[_0x2551('0x10')](_[_0x2551('0xa')]({'app':_0x2551('0x16'),'priority':_0x338609++},_0x2c338a));}return _0x168105;};var getChanSpyApplications=function(_0x5a998b,_0x296dcc){var _0xe9be4b=[];for(var _0x5c03e0=0x0,_0x160b38=0x1;_0x5c03e0<_0x296dcc[_0x2551('0x17')];_0x5c03e0++,_0x160b38=0x1){_0xe9be4b=_0xe9be4b[_0x2551('0x18')](getUserApplications(_0x5a998b,_0x296dcc[_0x5c03e0],_0x296dcc[_0x5c03e0][_0x2551('0x19')]));if(_0x296dcc[_0x5c03e0][_0x2551('0x19')]!=_0x296dcc[_0x5c03e0][_0x2551('0x12')]){_0xe9be4b=_0xe9be4b[_0x2551('0x18')](getUserApplications(_0x5a998b,_0x296dcc[_0x5c03e0],_0x296dcc[_0x5c03e0]['name']));}}return _0xe9be4b;};var getChanSpyPromise=function(_0x31a740,_0x2c5107){return new BPromise(function(_0x577294,_0x39c9dd){return _0x31a740[_0x2551('0x1a')][_0x2551('0x1b')]({'attributes':['id',_0x2551('0x12'),_0x2551('0x19')],'where':{'role':_0x2551('0x1c'),'chanspy':!![]},'raw':!![]})['then'](function(_0x5625f8){if(_0x5625f8){return _0x577294(getChanSpyApplications(_0x2c5107,_0x5625f8));}return _0x577294([]);})[_0x2551('0x1d')](function(_0xd482ba){_0x39c9dd(_0xd482ba);});});};module[_0x2551('0x1e')]=function(_0x2a6534,_0x5d4054){var _0x2bb394=_0x2a6534[_0x2551('0x1f')];return _0x2a6534[_0x2551('0x20')](_0x2551('0x21'),attributes,{'tableName':_0x2551('0x22'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x149cea,_0x1b00cf,_0x381142){return getChanSpyPromise(_0x2bb394,_0x149cea)[_0x2551('0x23')](function(_0x35938e){if(_0x35938e&&_0x35938e['length']){return _0x2bb394[_0x2551('0x24')][_0x2551('0x25')](_0x35938e);}})[_0x2551('0x23')](function(){_0x381142();})[_0x2551('0x1d')](function(_0x31a31d){_0x381142(_0x31a31d);});},'afterUpdate':function(_0x36a2f4,_0x12c3d2,_0xdb6e89){return _0x2bb394[_0x2551('0x24')][_0x2551('0x26')]({'where':{'ChanSpyId':_0x36a2f4['id']}})[_0x2551('0x23')](function(){return getChanSpyPromise(_0x2bb394,_0x36a2f4);})[_0x2551('0x23')](function(_0x30c4c7){if(_0x30c4c7&&_0x30c4c7[_0x2551('0x17')]){return _0x2bb394[_0x2551('0x24')]['bulkCreate'](_0x30c4c7);}})[_0x2551('0x23')](function(){_0xdb6e89();})['catch'](function(_0x13b94c){_0xdb6e89(_0x13b94c);});},'afterDestroy':function(_0xc93f6d,_0x41133b,_0x385232){return _0x2bb394[_0x2551('0x24')][_0x2551('0x26')]({'where':{'ChanSpyId':_0xc93f6d['id']}})[_0x2551('0x23')](function(){_0x385232();})[_0x2551('0x1d')](function(_0x2ec5e0){_0x385232(_0x2ec5e0);});}}});}; \ No newline at end of file +var _0x6f8f=['findAll','agent','then','exports','define','VoiceChanSpy','voice_chanspy','VoiceExtension','bulkCreate','catch','destroy','lodash','util','bluebird','./voiceChanSpy.attributes','context','from-sip','format','%s%s','system','push','merge','chanspy','record','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','SIP/%s,%s','name','options','length','concat','internal','User'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6f8f,0x1df));var _0xf6f8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6f8f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf6f8('0x0'));var util=require(_0xf6f8('0x1'));var BPromise=require(_0xf6f8('0x2'));var attributes=require(_0xf6f8('0x3'));var getUserApplications=function(_0x44d2fa,_0x909a29,_0x4c8152){var _0x4487ab=0x1;var _0x33b94f=[];var _0x4b3de1={'context':_0x909a29[_0xf6f8('0x4')]||_0xf6f8('0x5'),'exten':util[_0xf6f8('0x6')](_0xf6f8('0x7'),_0x44d2fa['prefix'],_0x4c8152),'type':_0xf6f8('0x8'),'isApp':![],'ChanSpyId':_0x44d2fa['id'],'UserId':_0x909a29['id']};_0x33b94f[_0xf6f8('0x9')](_[_0xf6f8('0xa')]({'app':'Set','appdata':util[_0xf6f8('0x6')]('CDR(type)=%s',_0xf6f8('0xb')),'priority':_0x4487ab++},_0x4b3de1));if(_0x44d2fa[_0xf6f8('0xc')]){_0x33b94f[_0xf6f8('0x9')](_[_0xf6f8('0xa')]({'app':_0xf6f8('0xd'),'appdata':util[_0xf6f8('0x6')](_0xf6f8('0xe'),_0x44d2fa[_0xf6f8('0xf')]),'priority':_0x4487ab++},_0x4b3de1));}if(_0x44d2fa[_0xf6f8('0x10')]){_0x33b94f['push'](_['merge']({'app':_0xf6f8('0x11'),'appdata':_0x44d2fa['password'],'priority':_0x4487ab++},_0x4b3de1));}_0x33b94f[_0xf6f8('0x9')](_[_0xf6f8('0xa')]({'app':'ChanSpy','appdata':util[_0xf6f8('0x6')](_0xf6f8('0x12'),_0x909a29[_0xf6f8('0x13')],_0x44d2fa['options']?_0x44d2fa[_0xf6f8('0x14')]['join'](''):''),'priority':_0x4487ab++},_0x4b3de1));if(_0x44d2fa[_0xf6f8('0xc')]){_0x33b94f[_0xf6f8('0x9')](_['merge']({'app':'StopMixMonitor','priority':_0x4487ab++},_0x4b3de1));}return _0x33b94f;};var getChanSpyApplications=function(_0x24624a,_0x158447){var _0x109deb=[];for(var _0x454979=0x0,_0x237610=0x1;_0x454979<_0x158447[_0xf6f8('0x15')];_0x454979++,_0x237610=0x1){_0x109deb=_0x109deb[_0xf6f8('0x16')](getUserApplications(_0x24624a,_0x158447[_0x454979],_0x158447[_0x454979][_0xf6f8('0x17')]));if(_0x158447[_0x454979]['internal']!=_0x158447[_0x454979][_0xf6f8('0x13')]){_0x109deb=_0x109deb[_0xf6f8('0x16')](getUserApplications(_0x24624a,_0x158447[_0x454979],_0x158447[_0x454979][_0xf6f8('0x13')]));}}return _0x109deb;};var getChanSpyPromise=function(_0x5753af,_0x490ce0){return new BPromise(function(_0x36f0f6,_0x3af55d){return _0x5753af[_0xf6f8('0x18')][_0xf6f8('0x19')]({'attributes':['id',_0xf6f8('0x13'),'internal'],'where':{'role':_0xf6f8('0x1a'),'chanspy':!![]},'raw':!![]})[_0xf6f8('0x1b')](function(_0x2222ca){if(_0x2222ca){return _0x36f0f6(getChanSpyApplications(_0x490ce0,_0x2222ca));}return _0x36f0f6([]);})['catch'](function(_0x22a09f){_0x3af55d(_0x22a09f);});});};module[_0xf6f8('0x1c')]=function(_0x1d99e0,_0x2463f1){var _0x4efc65=_0x1d99e0['models'];return _0x1d99e0[_0xf6f8('0x1d')](_0xf6f8('0x1e'),attributes,{'tableName':_0xf6f8('0x1f'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x550ff5,_0x118f4e,_0x18e267){return getChanSpyPromise(_0x4efc65,_0x550ff5)[_0xf6f8('0x1b')](function(_0x53aa55){if(_0x53aa55&&_0x53aa55[_0xf6f8('0x15')]){return _0x4efc65[_0xf6f8('0x20')][_0xf6f8('0x21')](_0x53aa55);}})[_0xf6f8('0x1b')](function(){_0x18e267();})[_0xf6f8('0x22')](function(_0x65bc8d){_0x18e267(_0x65bc8d);});},'afterUpdate':function(_0x538afd,_0x2b48b3,_0x55f98b){return _0x4efc65[_0xf6f8('0x20')][_0xf6f8('0x23')]({'where':{'ChanSpyId':_0x538afd['id']}})[_0xf6f8('0x1b')](function(){return getChanSpyPromise(_0x4efc65,_0x538afd);})[_0xf6f8('0x1b')](function(_0x52d74c){if(_0x52d74c&&_0x52d74c[_0xf6f8('0x15')]){return _0x4efc65[_0xf6f8('0x20')][_0xf6f8('0x21')](_0x52d74c);}})[_0xf6f8('0x1b')](function(){_0x55f98b();})[_0xf6f8('0x22')](function(_0x7af44c){_0x55f98b(_0x7af44c);});},'afterDestroy':function(_0xe91cee,_0x472ac1,_0x615eaa){return _0x4efc65[_0xf6f8('0x20')][_0xf6f8('0x23')]({'where':{'ChanSpyId':_0xe91cee['id']}})[_0xf6f8('0x1b')](function(){_0x615eaa();})['catch'](function(_0xb5cfd6){_0x615eaa(_0xb5cfd6);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index c749fa5..debf2f0 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 _0xb688=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','error','code','message','result','catch'];(function(_0x245fa6,_0x2f7ff8){var _0x225660=function(_0x48cf4b){while(--_0x48cf4b){_0x245fa6['push'](_0x245fa6['shift']());}};_0x225660(++_0x2f7ff8);}(_0xb688,0xcf));var _0x8b68=function(_0x495034,_0x480d0d){_0x495034=_0x495034-0x0;var _0x22b228=_0xb688[_0x495034];return _0x22b228;};'use strict';var _=require('lodash');var util=require(_0x8b68('0x0'));var moment=require(_0x8b68('0x1'));var BPromise=require(_0x8b68('0x2'));var rs=require(_0x8b68('0x3'));var fs=require('fs');var Redis=require(_0x8b68('0x4'));var db=require(_0x8b68('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8b68('0x6'))(_0x8b68('0x7'));var config=require(_0x8b68('0x8'));var jayson=require(_0x8b68('0x9'));var client=jayson['client'][_0x8b68('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x57ee56,_0x37677d,_0x2bbffd){return new BPromise(function(_0x130892,_0xa5571b){return client[_0x8b68('0xb')](_0x57ee56,_0x2bbffd)[_0x8b68('0xc')](function(_0x261753){logger[_0x8b68('0xd')](_0x8b68('0xe'),_0x37677d,_0x8b68('0xf'));logger[_0x8b68('0x10')](_0x8b68('0x11'),_0x37677d,_0x8b68('0xf'),JSON['stringify'](_0x261753));if(_0x261753[_0x8b68('0x12')]){if(_0x261753[_0x8b68('0x12')][_0x8b68('0x13')]===0x1f4){logger[_0x8b68('0x12')](_0x8b68('0xe'),_0x37677d,_0x261753[_0x8b68('0x12')][_0x8b68('0x14')]);return _0xa5571b(_0x261753[_0x8b68('0x12')][_0x8b68('0x14')]);}logger['error'](_0x8b68('0xe'),_0x37677d,_0x261753['error']['message']);return _0x130892(_0x261753[_0x8b68('0x12')][_0x8b68('0x14')]);}else{logger[_0x8b68('0xd')]('VoiceChanSpy,\x20%s,\x20%s',_0x37677d,'request\x20sent');_0x130892(_0x261753[_0x8b68('0x15')]['message']);}})[_0x8b68('0x16')](function(_0xb44923){logger[_0x8b68('0x12')](_0x8b68('0xe'),_0x37677d,_0xb44923);_0xa5571b(_0xb44923);});});} \ No newline at end of file +var _0xc36d=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','VoiceChanSpy,\x20%s,\x20%s','message','lodash'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0xc36d,0x7d));var _0xdc36=function(_0x3f9ac2,_0x1b670b){_0x3f9ac2=_0x3f9ac2-0x0;var _0xe6a436=_0xc36d[_0x3f9ac2];return _0xe6a436;};'use strict';var _=require(_0xdc36('0x0'));var util=require(_0xdc36('0x1'));var moment=require(_0xdc36('0x2'));var BPromise=require(_0xdc36('0x3'));var rs=require(_0xdc36('0x4'));var fs=require('fs');var Redis=require(_0xdc36('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xdc36('0x6'));var logger=require(_0xdc36('0x7'))('rpc');var config=require(_0xdc36('0x8'));var jayson=require(_0xdc36('0x9'));var client=jayson[_0xdc36('0xa')][_0xdc36('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x6e4753,_0x571311,_0x20ba02){return new BPromise(function(_0x456897,_0x2a0087){return client[_0xdc36('0xc')](_0x6e4753,_0x20ba02)['then'](function(_0x20d00a){logger[_0xdc36('0xd')]('VoiceChanSpy,\x20%s,\x20%s',_0x571311,_0xdc36('0xe'));logger[_0xdc36('0xf')](_0xdc36('0x10'),_0x571311,'request\x20sent',JSON[_0xdc36('0x11')](_0x20d00a));if(_0x20d00a[_0xdc36('0x12')]){if(_0x20d00a['error']['code']===0x1f4){logger[_0xdc36('0x12')](_0xdc36('0x13'),_0x571311,_0x20d00a[_0xdc36('0x12')][_0xdc36('0x14')]);return _0x2a0087(_0x20d00a['error'][_0xdc36('0x14')]);}logger[_0xdc36('0x12')](_0xdc36('0x13'),_0x571311,_0x20d00a[_0xdc36('0x12')][_0xdc36('0x14')]);return _0x456897(_0x20d00a[_0xdc36('0x12')][_0xdc36('0x14')]);}else{logger[_0xdc36('0xd')]('VoiceChanSpy,\x20%s,\x20%s',_0x571311,_0xdc36('0xe'));_0x456897(_0x20d00a['result']['message']);}})['catch'](function(_0x64f61e){logger[_0xdc36('0x12')]('VoiceChanSpy,\x20%s,\x20%s',_0x571311,_0x64f61e);_0x2a0087(_0x64f61e);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 0cc457a..b79e1d6 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 _0x8388=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','create','put','/:id','update','delete','destroy','util','path','express','Router'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8388,0x10a));var _0x8838=function(_0x764874,_0x3ed544){_0x764874=_0x764874-0x0;var _0x29f9d5=_0x8388[_0x764874];return _0x29f9d5;};'use strict';var multer=require('multer');var util=require(_0x8838('0x0'));var path=require(_0x8838('0x1'));var timeout=require('connect-timeout');var express=require(_0x8838('0x2'));var router=express[_0x8838('0x3')]();var fs_extra=require(_0x8838('0x4'));var auth=require(_0x8838('0x5'));var interaction=require(_0x8838('0x6'));var config=require(_0x8838('0x7'));var controller=require('./voiceContext.controller');router[_0x8838('0x8')]('/',auth[_0x8838('0x9')](),controller[_0x8838('0xa')]);router[_0x8838('0x8')]('/:id',auth[_0x8838('0x9')](),controller[_0x8838('0xb')]);router['post']('/',auth[_0x8838('0x9')](),controller[_0x8838('0xc')]);router[_0x8838('0xd')](_0x8838('0xe'),auth[_0x8838('0x9')](),controller[_0x8838('0xf')]);router[_0x8838('0x10')](_0x8838('0xe'),auth['isAuthenticated'](),controller[_0x8838('0x11')]);module['exports']=router; \ No newline at end of file +var _0xf73d=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','get','isAuthenticated','index','/:id','post','create','update','destroy','exports'];(function(_0x4542b7,_0x45b947){var _0x226db6=function(_0x55e4c8){while(--_0x55e4c8){_0x4542b7['push'](_0x4542b7['shift']());}};_0x226db6(++_0x45b947);}(_0xf73d,0x1e0));var _0xdf73=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xf73d[_0x3ab51d];return _0x29a04e;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xdf73('0x0'));var router=express['Router']();var fs_extra=require(_0xdf73('0x1'));var auth=require(_0xdf73('0x2'));var interaction=require(_0xdf73('0x3'));var config=require(_0xdf73('0x4'));var controller=require(_0xdf73('0x5'));router[_0xdf73('0x6')]('/',auth[_0xdf73('0x7')](),controller[_0xdf73('0x8')]);router[_0xdf73('0x6')](_0xdf73('0x9'),auth[_0xdf73('0x7')](),controller['show']);router[_0xdf73('0xa')]('/',auth['isAuthenticated'](),controller[_0xdf73('0xb')]);router['put'](_0xdf73('0x9'),auth['isAuthenticated'](),controller[_0xdf73('0xc')]);router['delete']('/:id',auth[_0xdf73('0x7')](),controller[_0xdf73('0xd')]);module[_0xdf73('0xe')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index f9d4bde..45d02a8 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 _0x4ce4=['STRING','exports','name'];(function(_0x1ffdd3,_0x7b3e5a){var _0x2d145f=function(_0x3d80ff){while(--_0x3d80ff){_0x1ffdd3['push'](_0x1ffdd3['shift']());}};_0x2d145f(++_0x7b3e5a);}(_0x4ce4,0x1de));var _0x44ce=function(_0x3d1244,_0x156028){_0x3d1244=_0x3d1244-0x0;var _0x5d6372=_0x4ce4[_0x3d1244];return _0x5d6372;};'use strict';var Sequelize=require('sequelize');module[_0x44ce('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x44ce('0x1')},'description':{'type':Sequelize[_0x44ce('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file +var _0x7aa7=['BOOLEAN','sequelize','exports','STRING','name'];(function(_0x479590,_0x10f8ea){var _0x371956=function(_0x293579){while(--_0x293579){_0x479590['push'](_0x479590['shift']());}};_0x371956(++_0x10f8ea);}(_0x7aa7,0xdd));var _0x77aa=function(_0x5017ed,_0x9dd3e1){_0x5017ed=_0x5017ed-0x0;var _0x5975ad=_0x7aa7[_0x5017ed];return _0x5975ad;};'use strict';var Sequelize=require(_0x77aa('0x0'));module[_0x77aa('0x1')]={'name':{'type':Sequelize[_0x77aa('0x2')],'unique':_0x77aa('0x3')},'description':{'type':Sequelize[_0x77aa('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x77aa('0x4')],'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 02b8fb5..f4ce30f 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 _0x49bf=['to-csv','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','client','http','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','error','code','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','destroy','get','Contexts','UserProfileResource','stack','name','send','VoiceContext','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','include','findAll','rows','show','params','create','body','join','root','server/files/templates/context.ejs','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','utf8','render','Reload','readFileSync','chan_sip.so','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x49bf,0xbc));var _0xf49b=function(_0xdfa9ee,_0x1f718f){_0xdfa9ee=_0xdfa9ee-0x0;var _0x47fe79=_0x49bf[_0xdfa9ee];return _0x47fe79;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf49b('0x0'));var zipdir=require(_0xf49b('0x1'));var jsonpatch=require(_0xf49b('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf49b('0x3'));var Mustache=require(_0xf49b('0x4'));var util=require(_0xf49b('0x5'));var path=require(_0xf49b('0x6'));var sox=require(_0xf49b('0x7'));var csv=require(_0xf49b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf49b('0x9'));var _=require('lodash');var squel=require(_0xf49b('0xa'));var crypto=require(_0xf49b('0xb'));var jsforce=require(_0xf49b('0xc'));var deskjs=require(_0xf49b('0xd'));var toCsv=require(_0xf49b('0x8'));var querystring=require('querystring');var Papa=require(_0xf49b('0xe'));var Redis=require('ioredis');var authService=require(_0xf49b('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xf49b('0x10'));var hardwareService=require(_0xf49b('0x11'));var logger=require('../../config/logger')(_0xf49b('0x12'));var utils=require(_0xf49b('0x13'));var config=require(_0xf49b('0x14'));var licenseUtil=require(_0xf49b('0x15'));var db=require('../../mysqldb')['db'];var jayson=require(_0xf49b('0x16'));var client=jayson[_0xf49b('0x17')][_0xf49b('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x224d70,_0x31dfca,_0x509ff3,_0xbc305){return new BPromise(function(_0x2db6f5,_0x1972ca){var _0x3bb7b9=_0xbc305||client;return _0x3bb7b9['request'](_0x224d70,_0x509ff3)[_0xf49b('0x19')](function(_0x80d758){logger[_0xf49b('0x1a')](_0xf49b('0x1b'),_0x31dfca,_0xf49b('0x1c'));logger['debug'](_0xf49b('0x1d'),_0x31dfca,_0xf49b('0x1c'),JSON['stringify'](_0x80d758));if(_0x80d758[_0xf49b('0x1e')]){if(_0x80d758['error'][_0xf49b('0x1f')]===0x1f4){logger[_0xf49b('0x1e')](_0xf49b('0x1b'),_0x31dfca,_0x80d758[_0xf49b('0x1e')]['message']);return _0x1972ca(_0x80d758['error'][_0xf49b('0x20')]);}logger[_0xf49b('0x1e')](_0xf49b('0x1b'),_0x31dfca,_0x80d758['error'][_0xf49b('0x20')]);return _0x2db6f5(_0x80d758[_0xf49b('0x1e')]['message']);}else{logger[_0xf49b('0x1a')](_0xf49b('0x1b'),_0x31dfca,_0xf49b('0x1c'));_0x2db6f5(_0x80d758['result']['message']);}})[_0xf49b('0x21')](function(_0x38246c){logger[_0xf49b('0x1e')](_0xf49b('0x1b'),_0x31dfca,_0x38246c);_0x1972ca(_0x38246c);});});}function respondWithStatusCode(_0x4f12a7,_0x5d43d0){_0x5d43d0=_0x5d43d0||0xcc;return function(_0x276e53){if(_0x276e53){return _0x4f12a7[_0xf49b('0x22')](_0x5d43d0);}return _0x4f12a7[_0xf49b('0x23')](_0x5d43d0)[_0xf49b('0x24')]();};}function respondWithResult(_0x2da350,_0x3c2eb6){_0x3c2eb6=_0x3c2eb6||0xc8;return function(_0x1860f3){if(_0x1860f3){return _0x2da350[_0xf49b('0x23')](_0x3c2eb6)[_0xf49b('0x25')](_0x1860f3);}};}function respondWithFilteredResult(_0x76aad2,_0x4f3a72){return function(_0x24c75e){if(_0x24c75e){var _0x5579ab=typeof _0x4f3a72[_0xf49b('0x26')]===_0xf49b('0x27')&&typeof _0x4f3a72[_0xf49b('0x28')]===_0xf49b('0x27');var _0x3ee62a=_0x24c75e[_0xf49b('0x29')];var _0x380afc=_0x5579ab?0x0:_0x4f3a72['offset'];var _0x4c23ef=_0x5579ab?_0x24c75e[_0xf49b('0x29')]:_0x4f3a72[_0xf49b('0x26')]+_0x4f3a72[_0xf49b('0x28')];var _0x24052e;if(_0x4c23ef>=_0x3ee62a){_0x4c23ef=_0x3ee62a;_0x24052e=0xc8;}else{_0x24052e=0xce;}_0x76aad2[_0xf49b('0x23')](_0x24052e);return _0x76aad2[_0xf49b('0x2a')]('Content-Range',_0x380afc+'-'+_0x4c23ef+'/'+_0x3ee62a)['json'](_0x24c75e);}return null;};}function patchUpdates(_0x33cd98){return function(_0x38922e){try{jsonpatch[_0xf49b('0x2b')](_0x38922e,_0x33cd98,!![]);}catch(_0x12989e){return BPromise[_0xf49b('0x2c')](_0x12989e);}return _0x38922e['save']();};}function saveUpdates(_0x50b4a5,_0x9df3c3){return function(_0x1ee916){if(_0x1ee916){return _0x1ee916[_0xf49b('0x2d')](_0x50b4a5)[_0xf49b('0x19')](function(_0x52bf7e){return _0x52bf7e;});}return null;};}function removeEntity(_0x5c1613,_0x401e42){return function(_0x1d7f8e){if(_0x1d7f8e){return _0x1d7f8e[_0xf49b('0x2e')]()[_0xf49b('0x19')](function(){var _0x3ad60c=_0x1d7f8e[_0xf49b('0x2f')]({'plain':!![]});var _0x2cb9ab=_0xf49b('0x30');return db[_0xf49b('0x31')]['destroy']({'where':{'type':_0x2cb9ab,'resourceId':_0x3ad60c['id']}})['then'](function(){return _0x1d7f8e;});})[_0xf49b('0x19')](function(){_0x5c1613[_0xf49b('0x23')](0xcc)[_0xf49b('0x24')]();});}};}function handleEntityNotFound(_0x22c2b2,_0x52f054){return function(_0x545373){if(!_0x545373){_0x22c2b2[_0xf49b('0x22')](0x194);}return _0x545373;};}function handleError(_0x12b2e8,_0x2691bb){_0x2691bb=_0x2691bb||0x1f4;return function(_0xba3dc9){logger[_0xf49b('0x1e')](_0xba3dc9[_0xf49b('0x32')]);if(_0xba3dc9[_0xf49b('0x33')]){delete _0xba3dc9['name'];}_0x12b2e8[_0xf49b('0x23')](_0x2691bb)[_0xf49b('0x34')](_0xba3dc9);};}exports['index']=function(_0x17942e,_0x3815fe){var _0x49c592={},_0x29a6b6={},_0x4762ba={'count':0x0,'rows':[]};var _0x214f8e=_['map'](db[_0xf49b('0x35')][_0xf49b('0x36')],function(_0x1d9ca8){return{'name':_0x1d9ca8[_0xf49b('0x37')],'type':_0x1d9ca8[_0xf49b('0x38')][_0xf49b('0x39')]};});_0x29a6b6[_0xf49b('0x3a')]=_[_0xf49b('0x3b')](_0x214f8e,_0xf49b('0x33'));_0x29a6b6[_0xf49b('0x3c')]=_[_0xf49b('0x3d')](_0x17942e[_0xf49b('0x3c')]);_0x29a6b6[_0xf49b('0x3e')]=_[_0xf49b('0x3f')](_0x29a6b6[_0xf49b('0x3a')],_0x29a6b6[_0xf49b('0x3c')]);_0x49c592[_0xf49b('0x40')]=_[_0xf49b('0x3f')](_0x29a6b6['model'],qs[_0xf49b('0x41')](_0x17942e[_0xf49b('0x3c')][_0xf49b('0x41')]));_0x49c592[_0xf49b('0x40')]=_0x49c592[_0xf49b('0x40')][_0xf49b('0x42')]?_0x49c592['attributes']:_0x29a6b6[_0xf49b('0x3a')];if(!_0x17942e[_0xf49b('0x3c')][_0xf49b('0x43')](_0xf49b('0x44'))){_0x49c592['limit']=qs[_0xf49b('0x28')](_0x17942e[_0xf49b('0x3c')][_0xf49b('0x28')]);_0x49c592['offset']=qs[_0xf49b('0x26')](_0x17942e[_0xf49b('0x3c')]['offset']);}_0x49c592['order']=qs[_0xf49b('0x45')](_0x17942e['query'][_0xf49b('0x45')]);_0x49c592[_0xf49b('0x46')]=qs['filters'](_['pick'](_0x17942e[_0xf49b('0x3c')],_0x29a6b6[_0xf49b('0x3e')]),_0x214f8e);if(_0x17942e[_0xf49b('0x3c')][_0xf49b('0x47')]){_0x49c592[_0xf49b('0x46')]=_[_0xf49b('0x48')](_0x49c592[_0xf49b('0x46')],{'$or':_[_0xf49b('0x3b')](_0x214f8e,function(_0x4959a3){if(_0x4959a3[_0xf49b('0x38')]!=='VIRTUAL'){var _0x408767={};_0x408767[_0x4959a3[_0xf49b('0x33')]]={'$like':'%'+_0x17942e[_0xf49b('0x3c')][_0xf49b('0x47')]+'%'};return _0x408767;}})});}_0x49c592=_[_0xf49b('0x48')]({},_0x49c592,_0x17942e[_0xf49b('0x49')]);var _0x34af08={'where':_0x49c592[_0xf49b('0x46')]};return db['VoiceContext'][_0xf49b('0x29')](_0x34af08)[_0xf49b('0x19')](function(_0x31f561){_0x4762ba[_0xf49b('0x29')]=_0x31f561;if(_0x17942e['query']['includeAll']){_0x49c592[_0xf49b('0x4a')]=[{'all':!![]}];}return db[_0xf49b('0x35')][_0xf49b('0x4b')](_0x49c592);})[_0xf49b('0x19')](function(_0x151c02){_0x4762ba[_0xf49b('0x4c')]=_0x151c02;return _0x4762ba;})['then'](respondWithFilteredResult(_0x3815fe,_0x49c592))[_0xf49b('0x21')](handleError(_0x3815fe,null));};exports[_0xf49b('0x4d')]=function(_0x421d05,_0x589548){var _0x177ab0={'raw':![],'where':{'id':_0x421d05[_0xf49b('0x4e')]['id']}},_0x223cbf={};_0x223cbf[_0xf49b('0x3a')]=_[_0xf49b('0x3d')](db['VoiceContext']['rawAttributes']);_0x223cbf[_0xf49b('0x3c')]=_['keys'](_0x421d05[_0xf49b('0x3c')]);_0x223cbf[_0xf49b('0x3e')]=_['intersection'](_0x223cbf[_0xf49b('0x3a')],_0x223cbf[_0xf49b('0x3c')]);_0x177ab0[_0xf49b('0x40')]=_[_0xf49b('0x3f')](_0x223cbf[_0xf49b('0x3a')],qs[_0xf49b('0x41')](_0x421d05[_0xf49b('0x3c')]['fields']));_0x177ab0['attributes']=_0x177ab0[_0xf49b('0x40')][_0xf49b('0x42')]?_0x177ab0['attributes']:_0x223cbf[_0xf49b('0x3a')];if(_0x421d05[_0xf49b('0x3c')]['includeAll']){_0x177ab0[_0xf49b('0x4a')]=[{'all':!![]}];}_0x177ab0=_['merge']({},_0x177ab0,_0x421d05[_0xf49b('0x49')]);return db[_0xf49b('0x35')]['find'](_0x177ab0)[_0xf49b('0x19')](handleEntityNotFound(_0x589548,null))[_0xf49b('0x19')](respondWithResult(_0x589548,null))['catch'](handleError(_0x589548,null));};exports['create']=function(_0x1608a2,_0x28bfcb,_0x190eaa){var _0x47a9cf;return db[_0xf49b('0x35')][_0xf49b('0x4f')](_0x1608a2[_0xf49b('0x50')],{'raw':!![]})['then'](function(_0x178022){_0x47a9cf=_0x178022;return db[_0xf49b('0x35')][_0xf49b('0x4b')]({'raw':!![]});})[_0xf49b('0x19')](function(_0xf22a76){var _0x15f842=fs['readFileSync'](path[_0xf49b('0x51')](config[_0xf49b('0x52')],_0xf49b('0x53')),'utf8');var _0x27c96e=ejs['render'](_0x15f842,{'contexts':_0xf22a76||[]});fs[_0xf49b('0x54')](_0xf49b('0x55'),_0x27c96e);})[_0xf49b('0x19')](function(){return respondWithRpcPromise('Reload',_0xf49b('0x4f'),{'module':'chan_sip.so'});})['then'](function(){var _0xdb4d8b=_0x1608a2[_0xf49b('0x56')]['get']({'plain':!![]});if(!_0xdb4d8b)throw new Error(_0xf49b('0x57'));if(_0xdb4d8b['role']==='user'){var _0x3a628d=_0x47a9cf[_0xf49b('0x2f')]({'plain':!![]});return db[_0xf49b('0x58')][_0xf49b('0x59')]({'where':{'name':_0xf49b('0x30'),'userProfileId':_0xdb4d8b[_0xf49b('0x5a')]},'raw':!![]})['then'](function(_0x30a2b0){if(_0x30a2b0&&_0x30a2b0[_0xf49b('0x5b')]===0x0){return db[_0xf49b('0x31')][_0xf49b('0x4f')]({'name':_0x3a628d[_0xf49b('0x33')],'resourceId':_0x3a628d['id'],'type':_0x30a2b0['name'],'sectionId':_0x30a2b0['id']},{})[_0xf49b('0x19')](function(){return _0x47a9cf;});}else{return _0x47a9cf;}})[_0xf49b('0x21')](function(_0x40c4d4){logger[_0xf49b('0x1e')](_0xf49b('0x5c'),_0x40c4d4);throw _0x40c4d4;});}return _0x47a9cf;})[_0xf49b('0x19')](respondWithResult(_0x28bfcb,0xc9))[_0xf49b('0x21')](handleError(_0x28bfcb,null));};exports[_0xf49b('0x2d')]=function(_0x1fc01d,_0x5d58fb,_0x56481f){var _0x562522;return db[_0xf49b('0x35')][_0xf49b('0x59')]({'where':{'id':_0x1fc01d[_0xf49b('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5d58fb,null))[_0xf49b('0x19')](saveUpdates(_0x1fc01d[_0xf49b('0x50')],null))[_0xf49b('0x19')](function(_0x4446d9){if(_0x4446d9){_0x562522=_0x4446d9;return db[_0xf49b('0x35')]['findAll']({'raw':!![]});}})[_0xf49b('0x19')](function(_0x4b4fa7){var _0x49e2f2=fs['readFileSync'](path[_0xf49b('0x51')](config[_0xf49b('0x52')],_0xf49b('0x53')),_0xf49b('0x5d'));var _0x33fc0b=ejs[_0xf49b('0x5e')](_0x49e2f2,{'contexts':_0x4b4fa7||[]});fs[_0xf49b('0x54')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x33fc0b);})[_0xf49b('0x19')](function(){return respondWithRpcPromise(_0xf49b('0x5f'),_0xf49b('0x2d'),{'module':'chan_sip.so'});})[_0xf49b('0x19')](function(){return _0x562522;})[_0xf49b('0x19')](respondWithResult(_0x5d58fb,null))[_0xf49b('0x21')](handleError(_0x5d58fb,null));};exports[_0xf49b('0x2e')]=function(_0x950bbe,_0x2be198,_0x49fd35){var _0x131f57;return db[_0xf49b('0x35')]['find']({'where':{'id':_0x950bbe['params']['id']}})[_0xf49b('0x19')](handleEntityNotFound(_0x2be198,null))[_0xf49b('0x19')](removeEntity(_0x2be198,null))['then'](function(){return db['VoiceContext'][_0xf49b('0x4b')]({'raw':!![]});})[_0xf49b('0x19')](function(_0x2020ac){var _0x3fa4de=fs[_0xf49b('0x60')](path[_0xf49b('0x51')](config[_0xf49b('0x52')],_0xf49b('0x53')),'utf8');var _0x2fcd52=ejs[_0xf49b('0x5e')](_0x3fa4de,{'contexts':_0x2020ac});fs[_0xf49b('0x54')](_0xf49b('0x55'),_0x2fcd52);return respondWithRpcPromise(_0xf49b('0x5f'),'destroy',{'module':_0xf49b('0x61')});})[_0xf49b('0x21')](handleError(_0x2be198,null));}; \ No newline at end of file +var _0xb9af=['../../config/environment','../../config/license/util','jayson/promise','client','http','request','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','error','code','VoiceContext,\x20%s,\x20%s','message','info','result','catch','status','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','get','Contexts','UserProfileResource','sendStatus','stack','name','send','map','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','VoiceContext','includeAll','rows','show','include','create','findAll','root','utf8','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','body','readFileSync','join','server/files/templates/context.ejs','destroy','render','writeFileSync','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils'];(function(_0x7275e9,_0x321fa5){var _0x17b99d=function(_0x54af41){while(--_0x54af41){_0x7275e9['push'](_0x7275e9['shift']());}};_0x17b99d(++_0x321fa5);}(_0xb9af,0x119));var _0xfb9a=function(_0x868bf8,_0x290a75){_0x868bf8=_0x868bf8-0x0;var _0x57b04b=_0xb9af[_0x868bf8];return _0x57b04b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xfb9a('0x0'));var jsonpatch=require(_0xfb9a('0x1'));var rp=require(_0xfb9a('0x2'));var moment=require(_0xfb9a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xfb9a('0x4'));var util=require(_0xfb9a('0x5'));var path=require(_0xfb9a('0x6'));var sox=require(_0xfb9a('0x7'));var csv=require(_0xfb9a('0x8'));var ejs=require(_0xfb9a('0x9'));var fs=require('fs');var fs_extra=require(_0xfb9a('0xa'));var _=require(_0xfb9a('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xfb9a('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xfb9a('0x8'));var querystring=require(_0xfb9a('0xd'));var Papa=require(_0xfb9a('0xe'));var Redis=require(_0xfb9a('0xf'));var authService=require(_0xfb9a('0x10'));var qs=require(_0xfb9a('0x11'));var as=require(_0xfb9a('0x12'));var hardwareService=require(_0xfb9a('0x13'));var logger=require(_0xfb9a('0x14'))('api');var utils=require(_0xfb9a('0x15'));var config=require(_0xfb9a('0x16'));var licenseUtil=require(_0xfb9a('0x17'));var db=require('../../mysqldb')['db'];var jayson=require(_0xfb9a('0x18'));var client=jayson[_0xfb9a('0x19')][_0xfb9a('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x524f2d,_0x479226,_0x327bb0,_0xd68823){return new BPromise(function(_0x46432b,_0x4a9374){var _0x3e216a=_0xd68823||client;return _0x3e216a[_0xfb9a('0x1b')](_0x524f2d,_0x327bb0)['then'](function(_0x18370d){logger['info']('VoiceContext,\x20%s,\x20%s',_0x479226,_0xfb9a('0x1c'));logger[_0xfb9a('0x1d')](_0xfb9a('0x1e'),_0x479226,'request\x20sent',JSON['stringify'](_0x18370d));if(_0x18370d[_0xfb9a('0x1f')]){if(_0x18370d[_0xfb9a('0x1f')][_0xfb9a('0x20')]===0x1f4){logger[_0xfb9a('0x1f')](_0xfb9a('0x21'),_0x479226,_0x18370d['error']['message']);return _0x4a9374(_0x18370d[_0xfb9a('0x1f')]['message']);}logger['error'](_0xfb9a('0x21'),_0x479226,_0x18370d[_0xfb9a('0x1f')][_0xfb9a('0x22')]);return _0x46432b(_0x18370d[_0xfb9a('0x1f')][_0xfb9a('0x22')]);}else{logger[_0xfb9a('0x23')](_0xfb9a('0x21'),_0x479226,_0xfb9a('0x1c'));_0x46432b(_0x18370d[_0xfb9a('0x24')][_0xfb9a('0x22')]);}})[_0xfb9a('0x25')](function(_0x20b13f){logger[_0xfb9a('0x1f')](_0xfb9a('0x21'),_0x479226,_0x20b13f);_0x4a9374(_0x20b13f);});});}function respondWithStatusCode(_0x49e9c8,_0x33128f){_0x33128f=_0x33128f||0xcc;return function(_0x4ff223){if(_0x4ff223){return _0x49e9c8['sendStatus'](_0x33128f);}return _0x49e9c8[_0xfb9a('0x26')](_0x33128f)['end']();};}function respondWithResult(_0x37e121,_0x389171){_0x389171=_0x389171||0xc8;return function(_0x43efa9){if(_0x43efa9){return _0x37e121[_0xfb9a('0x26')](_0x389171)['json'](_0x43efa9);}};}function respondWithFilteredResult(_0x425c9e,_0x5e6772){return function(_0x57d27f){if(_0x57d27f){var _0x6ad25=typeof _0x5e6772[_0xfb9a('0x27')]===_0xfb9a('0x28')&&typeof _0x5e6772[_0xfb9a('0x29')]===_0xfb9a('0x28');var _0x46a232=_0x57d27f['count'];var _0x16dfc4=_0x6ad25?0x0:_0x5e6772[_0xfb9a('0x27')];var _0x4ae815=_0x6ad25?_0x57d27f[_0xfb9a('0x2a')]:_0x5e6772[_0xfb9a('0x27')]+_0x5e6772[_0xfb9a('0x29')];var _0xc150a3;if(_0x4ae815>=_0x46a232){_0x4ae815=_0x46a232;_0xc150a3=0xc8;}else{_0xc150a3=0xce;}_0x425c9e['status'](_0xc150a3);return _0x425c9e[_0xfb9a('0x2b')](_0xfb9a('0x2c'),_0x16dfc4+'-'+_0x4ae815+'/'+_0x46a232)[_0xfb9a('0x2d')](_0x57d27f);}return null;};}function patchUpdates(_0x34a5b7){return function(_0x33db9b){try{jsonpatch['apply'](_0x33db9b,_0x34a5b7,!![]);}catch(_0xd4de07){return BPromise[_0xfb9a('0x2e')](_0xd4de07);}return _0x33db9b[_0xfb9a('0x2f')]();};}function saveUpdates(_0x12dd7d,_0x2a902e){return function(_0x4c1353){if(_0x4c1353){return _0x4c1353[_0xfb9a('0x30')](_0x12dd7d)[_0xfb9a('0x31')](function(_0x47bb21){return _0x47bb21;});}return null;};}function removeEntity(_0x1bfe9f,_0x2fd5ff){return function(_0x809a27){if(_0x809a27){return _0x809a27['destroy']()[_0xfb9a('0x31')](function(){var _0xe267a8=_0x809a27[_0xfb9a('0x32')]({'plain':!![]});var _0xfb9577=_0xfb9a('0x33');return db[_0xfb9a('0x34')]['destroy']({'where':{'type':_0xfb9577,'resourceId':_0xe267a8['id']}})[_0xfb9a('0x31')](function(){return _0x809a27;});})[_0xfb9a('0x31')](function(){_0x1bfe9f[_0xfb9a('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a8448,_0x33fb68){return function(_0x22e9f6){if(!_0x22e9f6){_0x4a8448[_0xfb9a('0x35')](0x194);}return _0x22e9f6;};}function handleError(_0x2e9400,_0x10ca95){_0x10ca95=_0x10ca95||0x1f4;return function(_0x4070ce){logger[_0xfb9a('0x1f')](_0x4070ce[_0xfb9a('0x36')]);if(_0x4070ce[_0xfb9a('0x37')]){delete _0x4070ce['name'];}_0x2e9400[_0xfb9a('0x26')](_0x10ca95)[_0xfb9a('0x38')](_0x4070ce);};}exports['index']=function(_0x333662,_0x53fac5){var _0x59e959={},_0x4c6390={},_0x53fdeb={'count':0x0,'rows':[]};var _0x33591a=_[_0xfb9a('0x39')](db['VoiceContext']['rawAttributes'],function(_0x54c284){return{'name':_0x54c284['fieldName'],'type':_0x54c284[_0xfb9a('0x3a')][_0xfb9a('0x3b')]};});_0x4c6390[_0xfb9a('0x3c')]=_['map'](_0x33591a,_0xfb9a('0x37'));_0x4c6390[_0xfb9a('0x3d')]=_['keys'](_0x333662['query']);_0x4c6390[_0xfb9a('0x3e')]=_['intersection'](_0x4c6390[_0xfb9a('0x3c')],_0x4c6390['query']);_0x59e959[_0xfb9a('0x3f')]=_[_0xfb9a('0x40')](_0x4c6390['model'],qs[_0xfb9a('0x41')](_0x333662['query'][_0xfb9a('0x41')]));_0x59e959[_0xfb9a('0x3f')]=_0x59e959['attributes'][_0xfb9a('0x42')]?_0x59e959[_0xfb9a('0x3f')]:_0x4c6390[_0xfb9a('0x3c')];if(!_0x333662[_0xfb9a('0x3d')][_0xfb9a('0x43')]('nolimit')){_0x59e959[_0xfb9a('0x29')]=qs[_0xfb9a('0x29')](_0x333662['query'][_0xfb9a('0x29')]);_0x59e959[_0xfb9a('0x27')]=qs[_0xfb9a('0x27')](_0x333662[_0xfb9a('0x3d')][_0xfb9a('0x27')]);}_0x59e959[_0xfb9a('0x44')]=qs['sort'](_0x333662[_0xfb9a('0x3d')][_0xfb9a('0x45')]);_0x59e959[_0xfb9a('0x46')]=qs[_0xfb9a('0x3e')](_['pick'](_0x333662[_0xfb9a('0x3d')],_0x4c6390[_0xfb9a('0x3e')]),_0x33591a);if(_0x333662[_0xfb9a('0x3d')][_0xfb9a('0x47')]){_0x59e959[_0xfb9a('0x46')]=_[_0xfb9a('0x48')](_0x59e959[_0xfb9a('0x46')],{'$or':_[_0xfb9a('0x39')](_0x33591a,function(_0x3198c1){if(_0x3198c1[_0xfb9a('0x3a')]!==_0xfb9a('0x49')){var _0x5114c8={};_0x5114c8[_0x3198c1[_0xfb9a('0x37')]]={'$like':'%'+_0x333662[_0xfb9a('0x3d')][_0xfb9a('0x47')]+'%'};return _0x5114c8;}})});}_0x59e959=_[_0xfb9a('0x48')]({},_0x59e959,_0x333662[_0xfb9a('0x4a')]);var _0xcaaae5={'where':_0x59e959[_0xfb9a('0x46')]};return db[_0xfb9a('0x4b')]['count'](_0xcaaae5)[_0xfb9a('0x31')](function(_0x1cbae4){_0x53fdeb['count']=_0x1cbae4;if(_0x333662['query'][_0xfb9a('0x4c')]){_0x59e959['include']=[{'all':!![]}];}return db[_0xfb9a('0x4b')]['findAll'](_0x59e959);})['then'](function(_0x3193a2){_0x53fdeb[_0xfb9a('0x4d')]=_0x3193a2;return _0x53fdeb;})[_0xfb9a('0x31')](respondWithFilteredResult(_0x53fac5,_0x59e959))[_0xfb9a('0x25')](handleError(_0x53fac5,null));};exports[_0xfb9a('0x4e')]=function(_0x86dac,_0x5b9faa){var _0x21370d={'raw':![],'where':{'id':_0x86dac['params']['id']}},_0x524734={};_0x524734[_0xfb9a('0x3c')]=_['keys'](db[_0xfb9a('0x4b')]['rawAttributes']);_0x524734[_0xfb9a('0x3d')]=_['keys'](_0x86dac[_0xfb9a('0x3d')]);_0x524734['filters']=_[_0xfb9a('0x40')](_0x524734['model'],_0x524734[_0xfb9a('0x3d')]);_0x21370d[_0xfb9a('0x3f')]=_[_0xfb9a('0x40')](_0x524734['model'],qs[_0xfb9a('0x41')](_0x86dac[_0xfb9a('0x3d')][_0xfb9a('0x41')]));_0x21370d[_0xfb9a('0x3f')]=_0x21370d[_0xfb9a('0x3f')][_0xfb9a('0x42')]?_0x21370d[_0xfb9a('0x3f')]:_0x524734[_0xfb9a('0x3c')];if(_0x86dac['query']['includeAll']){_0x21370d[_0xfb9a('0x4f')]=[{'all':!![]}];}_0x21370d=_[_0xfb9a('0x48')]({},_0x21370d,_0x86dac[_0xfb9a('0x4a')]);return db[_0xfb9a('0x4b')]['find'](_0x21370d)['then'](handleEntityNotFound(_0x5b9faa,null))[_0xfb9a('0x31')](respondWithResult(_0x5b9faa,null))['catch'](handleError(_0x5b9faa,null));};exports[_0xfb9a('0x50')]=function(_0x16493b,_0x111990,_0x372d4a){var _0x51a7e3;return db['VoiceContext'][_0xfb9a('0x50')](_0x16493b['body'],{'raw':!![]})['then'](function(_0x57c2fa){_0x51a7e3=_0x57c2fa;return db['VoiceContext'][_0xfb9a('0x51')]({'raw':!![]});})[_0xfb9a('0x31')](function(_0x59b4ff){var _0xa560b2=fs['readFileSync'](path['join'](config[_0xfb9a('0x52')],'server/files/templates/context.ejs'),_0xfb9a('0x53'));var _0xe8c17e=ejs['render'](_0xa560b2,{'contexts':_0x59b4ff||[]});fs['writeFileSync'](_0xfb9a('0x54'),_0xe8c17e);})['then'](function(){return respondWithRpcPromise(_0xfb9a('0x55'),_0xfb9a('0x50'),{'module':_0xfb9a('0x56')});})['then'](function(){var _0x50a4f9=_0x16493b[_0xfb9a('0x57')][_0xfb9a('0x32')]({'plain':!![]});if(!_0x50a4f9)throw new Error(_0xfb9a('0x58'));if(_0x50a4f9[_0xfb9a('0x59')]===_0xfb9a('0x57')){var _0x43e0ac=_0x51a7e3[_0xfb9a('0x32')]({'plain':!![]});return db[_0xfb9a('0x5a')][_0xfb9a('0x5b')]({'where':{'name':_0xfb9a('0x33'),'userProfileId':_0x50a4f9['userProfileId']},'raw':!![]})[_0xfb9a('0x31')](function(_0x541da1){if(_0x541da1&&_0x541da1['autoAssociation']===0x0){return db[_0xfb9a('0x34')][_0xfb9a('0x50')]({'name':_0x43e0ac[_0xfb9a('0x37')],'resourceId':_0x43e0ac['id'],'type':_0x541da1[_0xfb9a('0x37')],'sectionId':_0x541da1['id']},{})['then'](function(){return _0x51a7e3;});}else{return _0x51a7e3;}})[_0xfb9a('0x25')](function(_0x1a8382){logger[_0xfb9a('0x1f')](_0xfb9a('0x5c'),_0x1a8382);throw _0x1a8382;});}return _0x51a7e3;})[_0xfb9a('0x31')](respondWithResult(_0x111990,0xc9))[_0xfb9a('0x25')](handleError(_0x111990,null));};exports[_0xfb9a('0x30')]=function(_0x276c44,_0x56bfe9,_0x5f4997){var _0x43b568;return db[_0xfb9a('0x4b')][_0xfb9a('0x5b')]({'where':{'id':_0x276c44[_0xfb9a('0x5d')]['id']}})[_0xfb9a('0x31')](handleEntityNotFound(_0x56bfe9,null))[_0xfb9a('0x31')](saveUpdates(_0x276c44[_0xfb9a('0x5e')],null))[_0xfb9a('0x31')](function(_0x3cf647){if(_0x3cf647){_0x43b568=_0x3cf647;return db[_0xfb9a('0x4b')][_0xfb9a('0x51')]({'raw':!![]});}})[_0xfb9a('0x31')](function(_0x5bbbb6){var _0x21ccc4=fs[_0xfb9a('0x5f')](path[_0xfb9a('0x60')](config[_0xfb9a('0x52')],_0xfb9a('0x61')),_0xfb9a('0x53'));var _0x476957=ejs['render'](_0x21ccc4,{'contexts':_0x5bbbb6||[]});fs['writeFileSync']('/etc/asterisk/extensions_xcally_contexts.conf',_0x476957);})[_0xfb9a('0x31')](function(){return respondWithRpcPromise('Reload','update',{'module':_0xfb9a('0x56')});})[_0xfb9a('0x31')](function(){return _0x43b568;})['then'](respondWithResult(_0x56bfe9,null))[_0xfb9a('0x25')](handleError(_0x56bfe9,null));};exports[_0xfb9a('0x62')]=function(_0x282d99,_0x5cc65a,_0x220625){var _0x19a9aa;return db[_0xfb9a('0x4b')][_0xfb9a('0x5b')]({'where':{'id':_0x282d99[_0xfb9a('0x5d')]['id']}})[_0xfb9a('0x31')](handleEntityNotFound(_0x5cc65a,null))[_0xfb9a('0x31')](removeEntity(_0x5cc65a,null))['then'](function(){return db[_0xfb9a('0x4b')][_0xfb9a('0x51')]({'raw':!![]});})[_0xfb9a('0x31')](function(_0x22c256){var _0xe90a88=fs[_0xfb9a('0x5f')](path[_0xfb9a('0x60')](config[_0xfb9a('0x52')],_0xfb9a('0x61')),'utf8');var _0x1eaba2=ejs[_0xfb9a('0x63')](_0xe90a88,{'contexts':_0x22c256});fs[_0xfb9a('0x64')](_0xfb9a('0x54'),_0x1eaba2);return respondWithRpcPromise(_0xfb9a('0x55'),'destroy',{'module':_0xfb9a('0x56')});})['catch'](handleError(_0x5cc65a,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 1d377be..1dae405 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 _0x7896=['VoiceContext','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceContext.attributes','exports','define'];(function(_0x4c5c43,_0x5d90f0){var _0x55c60d=function(_0x49cff8){while(--_0x49cff8){_0x4c5c43['push'](_0x4c5c43['shift']());}};_0x55c60d(++_0x5d90f0);}(_0x7896,0x127));var _0x6789=function(_0x552804,_0x3c3d1e){_0x552804=_0x552804-0x0;var _0x32be66=_0x7896[_0x552804];return _0x32be66;};'use strict';var _=require(_0x6789('0x0'));var util=require(_0x6789('0x1'));var logger=require(_0x6789('0x2'))(_0x6789('0x3'));var moment=require(_0x6789('0x4'));var BPromise=require(_0x6789('0x5'));var rp=require(_0x6789('0x6'));var fs=require('fs');var path=require(_0x6789('0x7'));var rimraf=require(_0x6789('0x8'));var config=require(_0x6789('0x9'));var attributes=require(_0x6789('0xa'));module[_0x6789('0xb')]=function(_0x571fb4,_0x407ef2){return _0x571fb4[_0x6789('0xc')](_0x6789('0xd'),attributes,{'tableName':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x434b=['exports','define','VoiceContext','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./voiceContext.attributes'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x434b,0x17f));var _0xb434=function(_0xdefbc3,_0x1ea49a){_0xdefbc3=_0xdefbc3-0x0;var _0x367798=_0x434b[_0xdefbc3];return _0x367798;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb434('0x0'))(_0xb434('0x1'));var moment=require('moment');var BPromise=require(_0xb434('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb434('0x3'));var rimraf=require(_0xb434('0x4'));var config=require(_0xb434('0x5'));var attributes=require(_0xb434('0x6'));module[_0xb434('0x7')]=function(_0x2c9f74,_0x1073e4){return _0x2c9f74[_0xb434('0x8')](_0xb434('0x9'),attributes,{'tableName':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.rpc.js b/server/api/voiceContext/voiceContext.rpc.js index 3d3c88f..8a65a97 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 _0xdc91=['client','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x14c552,_0x3e74a3){var _0x44f347=function(_0x423fe3){while(--_0x423fe3){_0x14c552['push'](_0x14c552['shift']());}};_0x44f347(++_0x3e74a3);}(_0xdc91,0x8b));var _0x1dc9=function(_0x4dda9c,_0x34c3c2){_0x4dda9c=_0x4dda9c-0x0;var _0x4f27c3=_0xdc91[_0x4dda9c];return _0x4f27c3;};'use strict';var _=require(_0x1dc9('0x0'));var util=require(_0x1dc9('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1dc9('0x2'))['db'];var utils=require(_0x1dc9('0x3'));var logger=require(_0x1dc9('0x4'))(_0x1dc9('0x5'));var config=require(_0x1dc9('0x6'));var jayson=require(_0x1dc9('0x7'));var client=jayson[_0x1dc9('0x8')][_0x1dc9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5ac058,_0x2c6e6c,_0x25a752){return new BPromise(function(_0x316995,_0x3d1772){return client[_0x1dc9('0xa')](_0x5ac058,_0x25a752)[_0x1dc9('0xb')](function(_0x43c405){logger[_0x1dc9('0xc')](_0x1dc9('0xd'),_0x2c6e6c,_0x1dc9('0xe'));logger['debug'](_0x1dc9('0xf'),_0x2c6e6c,'request\x20sent',JSON[_0x1dc9('0x10')](_0x43c405));if(_0x43c405['error']){if(_0x43c405[_0x1dc9('0x11')][_0x1dc9('0x12')]===0x1f4){logger[_0x1dc9('0x11')](_0x1dc9('0xd'),_0x2c6e6c,_0x43c405['error'][_0x1dc9('0x13')]);return _0x3d1772(_0x43c405[_0x1dc9('0x11')]['message']);}logger[_0x1dc9('0x11')](_0x1dc9('0xd'),_0x2c6e6c,_0x43c405['error']['message']);return _0x316995(_0x43c405[_0x1dc9('0x11')][_0x1dc9('0x13')]);}else{logger[_0x1dc9('0xc')](_0x1dc9('0xd'),_0x2c6e6c,'request\x20sent');_0x316995(_0x43c405['result'][_0x1dc9('0x13')]);}})[_0x1dc9('0x14')](function(_0x5cccb9){logger[_0x1dc9('0x11')](_0x1dc9('0xd'),_0x2c6e6c,_0x5cccb9);_0x3d1772(_0x5cccb9);});});} \ No newline at end of file +var _0x3495=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x1f8ebc,_0x16c7fe){var _0x171007=function(_0x8c09bf){while(--_0x8c09bf){_0x1f8ebc['push'](_0x1f8ebc['shift']());}};_0x171007(++_0x16c7fe);}(_0x3495,0x1de));var _0x5349=function(_0x1646d6,_0x2aa063){_0x1646d6=_0x1646d6-0x0;var _0x2efdf5=_0x3495[_0x1646d6];return _0x2efdf5;};'use strict';var _=require(_0x5349('0x0'));var util=require(_0x5349('0x1'));var moment=require(_0x5349('0x2'));var BPromise=require(_0x5349('0x3'));var rs=require(_0x5349('0x4'));var fs=require('fs');var Redis=require(_0x5349('0x5'));var db=require(_0x5349('0x6'))['db'];var utils=require(_0x5349('0x7'));var logger=require(_0x5349('0x8'))('rpc');var config=require(_0x5349('0x9'));var jayson=require(_0x5349('0xa'));var client=jayson['client'][_0x5349('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x538385,_0x6fb5dc,_0x529323){return new BPromise(function(_0x393873,_0x583cee){return client[_0x5349('0xc')](_0x538385,_0x529323)[_0x5349('0xd')](function(_0x22a3d3){logger[_0x5349('0xe')](_0x5349('0xf'),_0x6fb5dc,_0x5349('0x10'));logger[_0x5349('0x11')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x6fb5dc,_0x5349('0x10'),JSON['stringify'](_0x22a3d3));if(_0x22a3d3[_0x5349('0x12')]){if(_0x22a3d3[_0x5349('0x12')][_0x5349('0x13')]===0x1f4){logger[_0x5349('0x12')](_0x5349('0xf'),_0x6fb5dc,_0x22a3d3[_0x5349('0x12')][_0x5349('0x14')]);return _0x583cee(_0x22a3d3[_0x5349('0x12')][_0x5349('0x14')]);}logger[_0x5349('0x12')]('VoiceContext,\x20%s,\x20%s',_0x6fb5dc,_0x22a3d3[_0x5349('0x12')][_0x5349('0x14')]);return _0x393873(_0x22a3d3['error'][_0x5349('0x14')]);}else{logger[_0x5349('0xe')](_0x5349('0xf'),_0x6fb5dc,'request\x20sent');_0x393873(_0x22a3d3['result']['message']);}})[_0x5349('0x15')](function(_0x5c873d){logger[_0x5349('0x12')]('VoiceContext,\x20%s,\x20%s',_0x6fb5dc,_0x5c873d);_0x583cee(_0x5c873d);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 705db09..53ec7cd 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 _0xcb6a=['delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','isAuthenticated','get','/describe','describe','/:id','post','update'];(function(_0x4f1f72,_0x299df8){var _0x5a084e=function(_0x3d3cf3){while(--_0x3d3cf3){_0x4f1f72['push'](_0x4f1f72['shift']());}};_0x5a084e(++_0x299df8);}(_0xcb6a,0x16a));var _0xacb6=function(_0x725b8e,_0xc22b48){_0x725b8e=_0x725b8e-0x0;var _0x43ac45=_0xcb6a[_0x725b8e];return _0x43ac45;};'use strict';var multer=require(_0xacb6('0x0'));var util=require(_0xacb6('0x1'));var path=require(_0xacb6('0x2'));var timeout=require(_0xacb6('0x3'));var express=require('express');var router=express[_0xacb6('0x4')]();var fs_extra=require(_0xacb6('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xacb6('0x6'));var config=require(_0xacb6('0x7'));var controller=require(_0xacb6('0x8'));router['get']('/',auth[_0xacb6('0x9')](),controller['index']);router[_0xacb6('0xa')](_0xacb6('0xb'),auth[_0xacb6('0x9')](),controller[_0xacb6('0xc')]);router[_0xacb6('0xa')](_0xacb6('0xd'),auth[_0xacb6('0x9')](),controller['show']);router[_0xacb6('0xe')]('/',auth[_0xacb6('0x9')](),controller['create']);router['put'](_0xacb6('0xd'),auth[_0xacb6('0x9')](),controller[_0xacb6('0xf')]);router[_0xacb6('0x10')](_0xacb6('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0xacb6('0x11')]=router; \ No newline at end of file +var _0x6652=['isAuthenticated','index','get','/describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceDialReport.controller'];(function(_0x1f1e31,_0x27b5c3){var _0x229b56=function(_0x16db77){while(--_0x16db77){_0x1f1e31['push'](_0x1f1e31['shift']());}};_0x229b56(++_0x27b5c3);}(_0x6652,0xf3));var _0x2665=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x6652[_0x46aff0];return _0x9d78cf;};'use strict';var multer=require(_0x2665('0x0'));var util=require(_0x2665('0x1'));var path=require(_0x2665('0x2'));var timeout=require(_0x2665('0x3'));var express=require(_0x2665('0x4'));var router=express[_0x2665('0x5')]();var fs_extra=require(_0x2665('0x6'));var auth=require(_0x2665('0x7'));var interaction=require(_0x2665('0x8'));var config=require('../../config/environment');var controller=require(_0x2665('0x9'));router['get']('/',auth[_0x2665('0xa')](),controller[_0x2665('0xb')]);router[_0x2665('0xc')](_0x2665('0xd'),auth[_0x2665('0xa')](),controller['describe']);router['get'](_0x2665('0xe'),auth[_0x2665('0xa')](),controller[_0x2665('0xf')]);router[_0x2665('0x10')]('/',auth[_0x2665('0xa')](),controller[_0x2665('0x11')]);router[_0x2665('0x12')](_0x2665('0xe'),auth[_0x2665('0xa')](),controller[_0x2665('0x13')]);router[_0x2665('0x14')](_0x2665('0xe'),auth[_0x2665('0xa')](),controller[_0x2665('0x15')]);module[_0x2665('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 6918fc5..21e2d67 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 _0x008c=['INTEGER','DATE','sequelize','exports','STRING'];(function(_0xfeb90d,_0x35ae46){var _0x4666ab=function(_0x3b4cf7){while(--_0x3b4cf7){_0xfeb90d['push'](_0xfeb90d['shift']());}};_0x4666ab(++_0x35ae46);}(_0x008c,0x188));var _0xc008=function(_0x5c27b6,_0x4a3c28){_0x5c27b6=_0x5c27b6-0x0;var _0x284ce4=_0x008c[_0x5c27b6];return _0x284ce4;};'use strict';var Sequelize=require(_0xc008('0x0'));module[_0xc008('0x1')]={'privilege':{'type':Sequelize[_0xc008('0x2')]},'channel':{'type':Sequelize[_0xc008('0x2')]},'channelstate':{'type':Sequelize[_0xc008('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xc008('0x2')]},'calleridname':{'type':Sequelize[_0xc008('0x2')]},'connectedlinenum':{'type':Sequelize[_0xc008('0x2')]},'connectedlinename':{'type':Sequelize[_0xc008('0x2')]},'language':{'type':Sequelize[_0xc008('0x2')]},'accountcode':{'type':Sequelize[_0xc008('0x2')]},'context':{'type':Sequelize[_0xc008('0x2')]},'exten':{'type':Sequelize[_0xc008('0x2')]},'priority':{'type':Sequelize[_0xc008('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xc008('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xc008('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xc008('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xc008('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xc008('0x2')]},'destexten':{'type':Sequelize[_0xc008('0x2')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0xc008('0x2')]},'destlinkedid':{'type':Sequelize[_0xc008('0x2')]},'dialstring':{'type':Sequelize[_0xc008('0x2')]},'dialstatus':{'type':Sequelize[_0xc008('0x2')]},'starttime':{'type':Sequelize[_0xc008('0x4')]},'answertime':{'type':Sequelize[_0xc008('0x4')]},'endtime':{'type':Sequelize[_0xc008('0x4')]},'lastevent':{'type':Sequelize['STRING'],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0xc008('0x3')]},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0xc008('0x3')]},'billableseconds':{'type':Sequelize[_0xc008('0x3')]}}; \ No newline at end of file +var _0xa41a=['exports','STRING','INTEGER','DATE','called,connect,complete','sequelize'];(function(_0x46b213,_0x2d5208){var _0x4942eb=function(_0x47a946){while(--_0x47a946){_0x46b213['push'](_0x46b213['shift']());}};_0x4942eb(++_0x2d5208);}(_0xa41a,0x6b));var _0xaa41=function(_0x31bf92,_0x2b1fdc){_0x31bf92=_0x31bf92-0x0;var _0x2d4a30=_0xa41a[_0x31bf92];return _0x2d4a30;};'use strict';var Sequelize=require(_0xaa41('0x0'));module[_0xaa41('0x1')]={'privilege':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xaa41('0x2')]},'channelstate':{'type':Sequelize[_0xaa41('0x3')]},'channelstatedesc':{'type':Sequelize[_0xaa41('0x2')]},'calleridnum':{'type':Sequelize[_0xaa41('0x2')]},'calleridname':{'type':Sequelize[_0xaa41('0x2')]},'connectedlinenum':{'type':Sequelize[_0xaa41('0x2')]},'connectedlinename':{'type':Sequelize[_0xaa41('0x2')]},'language':{'type':Sequelize[_0xaa41('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xaa41('0x2')]},'exten':{'type':Sequelize[_0xaa41('0x2')]},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xaa41('0x2')]},'destchannel':{'type':Sequelize[_0xaa41('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xaa41('0x2')]},'destcalleridnum':{'type':Sequelize[_0xaa41('0x2')]},'destcalleridname':{'type':Sequelize[_0xaa41('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xaa41('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xaa41('0x2')]},'destlanguage':{'type':Sequelize[_0xaa41('0x2')]},'destaccountcode':{'type':Sequelize[_0xaa41('0x2')]},'destcontext':{'type':Sequelize[_0xaa41('0x2')]},'destexten':{'type':Sequelize[_0xaa41('0x2')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0xaa41('0x2')]},'destlinkedid':{'type':Sequelize[_0xaa41('0x2')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xaa41('0x4')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xaa41('0x4')]},'lastevent':{'type':Sequelize[_0xaa41('0x2')],'comment':_0xaa41('0x5')},'routeId':{'type':Sequelize[_0xaa41('0x3')]},'duration':{'type':Sequelize[_0xaa41('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0xaa41('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index c2e9172..6e9c701 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 _0x7086=['key','query','filters','attributes','intersection','model','fields','hasOwnProperty','order','sort','where','pick','merge','options','includeAll','include','findAll','catch','show','keys','length','find','create','body','destroy','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','end','error','stack','name','send','index','map','VoiceDialReport','fieldName','type'];(function(_0x20634c,_0x5534fc){var _0x5d8936=function(_0x6b45f2){while(--_0x6b45f2){_0x20634c['push'](_0x20634c['shift']());}};_0x5d8936(++_0x5534fc);}(_0x7086,0x102));var _0x6708=function(_0x20e26d,_0x25e45d){_0x20e26d=_0x20e26d-0x0;var _0x1d7173=_0x7086[_0x20e26d];return _0x1d7173;};'use strict';var emlformat=require(_0x6708('0x0'));var rimraf=require(_0x6708('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6708('0x2'));var rp=require(_0x6708('0x3'));var moment=require(_0x6708('0x4'));var BPromise=require(_0x6708('0x5'));var Mustache=require(_0x6708('0x6'));var util=require(_0x6708('0x7'));var path=require(_0x6708('0x8'));var sox=require(_0x6708('0x9'));var csv=require('to-csv');var ejs=require(_0x6708('0xa'));var fs=require('fs');var fs_extra=require(_0x6708('0xb'));var _=require(_0x6708('0xc'));var squel=require(_0x6708('0xd'));var crypto=require('crypto');var jsforce=require(_0x6708('0xe'));var deskjs=require(_0x6708('0xf'));var toCsv=require('to-csv');var querystring=require(_0x6708('0x10'));var Papa=require(_0x6708('0x11'));var Redis=require(_0x6708('0x12'));var authService=require(_0x6708('0x13'));var qs=require(_0x6708('0x14'));var as=require(_0x6708('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6708('0x16'))(_0x6708('0x17'));var utils=require(_0x6708('0x18'));var config=require(_0x6708('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x6708('0x1a'))['db'];function respondWithStatusCode(_0x168e8c,_0x2b42bc){_0x2b42bc=_0x2b42bc||0xcc;return function(_0x74e8d){if(_0x74e8d){return _0x168e8c[_0x6708('0x1b')](_0x2b42bc);}return _0x168e8c['status'](_0x2b42bc)['end']();};}function respondWithResult(_0x166e55,_0xd4a569){_0xd4a569=_0xd4a569||0xc8;return function(_0x22bb07){if(_0x22bb07){return _0x166e55[_0x6708('0x1c')](_0xd4a569)[_0x6708('0x1d')](_0x22bb07);}};}function respondWithFilteredResult(_0x17c145,_0x5efc6f){return function(_0x487d51){if(_0x487d51){var _0x5d8939=typeof _0x5efc6f[_0x6708('0x1e')]==='undefined'&&typeof _0x5efc6f['limit']===_0x6708('0x1f');var _0x2d4633=_0x487d51[_0x6708('0x20')];var _0x4328ed=_0x5d8939?0x0:_0x5efc6f['offset'];var _0x5a13e2=_0x5d8939?_0x487d51[_0x6708('0x20')]:_0x5efc6f[_0x6708('0x1e')]+_0x5efc6f[_0x6708('0x21')];var _0x483eb3;if(_0x5a13e2>=_0x2d4633){_0x5a13e2=_0x2d4633;_0x483eb3=0xc8;}else{_0x483eb3=0xce;}_0x17c145[_0x6708('0x1c')](_0x483eb3);return _0x17c145[_0x6708('0x22')](_0x6708('0x23'),_0x4328ed+'-'+_0x5a13e2+'/'+_0x2d4633)['json'](_0x487d51);}return null;};}function patchUpdates(_0x11b3f3){return function(_0x1408d1){try{jsonpatch[_0x6708('0x24')](_0x1408d1,_0x11b3f3,!![]);}catch(_0x29aa06){return BPromise[_0x6708('0x25')](_0x29aa06);}return _0x1408d1['save']();};}function saveUpdates(_0x2fc690,_0xcbe622){return function(_0x687ea2){if(_0x687ea2){return _0x687ea2[_0x6708('0x26')](_0x2fc690)[_0x6708('0x27')](function(_0xf42c19){return _0xf42c19;});}return null;};}function removeEntity(_0x5a1142,_0x55399f){return function(_0x39c398){if(_0x39c398){return _0x39c398['destroy']()['then'](function(){_0x5a1142[_0x6708('0x1c')](0xcc)[_0x6708('0x28')]();});}};}function handleEntityNotFound(_0x2335b3,_0x731706){return function(_0x3939b3){if(!_0x3939b3){_0x2335b3[_0x6708('0x1b')](0x194);}return _0x3939b3;};}function handleError(_0x236378,_0x1eb7bb){_0x1eb7bb=_0x1eb7bb||0x1f4;return function(_0x433138){logger[_0x6708('0x29')](_0x433138[_0x6708('0x2a')]);if(_0x433138[_0x6708('0x2b')]){delete _0x433138[_0x6708('0x2b')];}_0x236378['status'](_0x1eb7bb)[_0x6708('0x2c')](_0x433138);};}exports[_0x6708('0x2d')]=function(_0x3c410b,_0x13cf41){var _0x3c509b={},_0x49246d={},_0x430d52={'count':0x0,'rows':[]};var _0x254f25=_[_0x6708('0x2e')](db[_0x6708('0x2f')]['rawAttributes'],function(_0x1a4689){return{'name':_0x1a4689[_0x6708('0x30')],'type':_0x1a4689[_0x6708('0x31')][_0x6708('0x32')]};});_0x49246d['model']=_[_0x6708('0x2e')](_0x254f25,_0x6708('0x2b'));_0x49246d[_0x6708('0x33')]=_['keys'](_0x3c410b[_0x6708('0x33')]);_0x49246d[_0x6708('0x34')]=_['intersection'](_0x49246d['model'],_0x49246d[_0x6708('0x33')]);_0x3c509b[_0x6708('0x35')]=_[_0x6708('0x36')](_0x49246d[_0x6708('0x37')],qs['fields'](_0x3c410b[_0x6708('0x33')][_0x6708('0x38')]));_0x3c509b['attributes']=_0x3c509b['attributes']['length']?_0x3c509b['attributes']:_0x49246d[_0x6708('0x37')];if(!_0x3c410b[_0x6708('0x33')][_0x6708('0x39')]('nolimit')){_0x3c509b['limit']=qs['limit'](_0x3c410b['query'][_0x6708('0x21')]);_0x3c509b[_0x6708('0x1e')]=qs['offset'](_0x3c410b[_0x6708('0x33')][_0x6708('0x1e')]);}_0x3c509b[_0x6708('0x3a')]=qs['sort'](_0x3c410b['query'][_0x6708('0x3b')]);_0x3c509b[_0x6708('0x3c')]=qs[_0x6708('0x34')](_[_0x6708('0x3d')](_0x3c410b[_0x6708('0x33')],_0x49246d[_0x6708('0x34')]),_0x254f25);if(_0x3c410b[_0x6708('0x33')]['filter']){_0x3c509b[_0x6708('0x3c')]=_['merge'](_0x3c509b[_0x6708('0x3c')],{'$or':_['map'](_0x254f25,function(_0x4fe278){if(_0x4fe278['type']!=='VIRTUAL'){var _0x2ca233={};_0x2ca233[_0x4fe278[_0x6708('0x2b')]]={'$like':'%'+_0x3c410b[_0x6708('0x33')]['filter']+'%'};return _0x2ca233;}})});}_0x3c509b=_[_0x6708('0x3e')]({},_0x3c509b,_0x3c410b[_0x6708('0x3f')]);var _0x9ca96f={'where':_0x3c509b[_0x6708('0x3c')]};return db['VoiceDialReport'][_0x6708('0x20')](_0x9ca96f)[_0x6708('0x27')](function(_0x3d82e5){_0x430d52['count']=_0x3d82e5;if(_0x3c410b['query'][_0x6708('0x40')]){_0x3c509b[_0x6708('0x41')]=[{'all':!![]}];}return db[_0x6708('0x2f')][_0x6708('0x42')](_0x3c509b);})[_0x6708('0x27')](function(_0x888d1a){_0x430d52['rows']=_0x888d1a;return _0x430d52;})[_0x6708('0x27')](respondWithFilteredResult(_0x13cf41,_0x3c509b))[_0x6708('0x43')](handleError(_0x13cf41,null));};exports[_0x6708('0x44')]=function(_0x1928c2,_0x31543e){var _0x30710d={'raw':!![],'where':{'id':_0x1928c2['params']['id']}},_0x28e147={};_0x28e147[_0x6708('0x37')]=_[_0x6708('0x45')](db[_0x6708('0x2f')]['rawAttributes']);_0x28e147['query']=_[_0x6708('0x45')](_0x1928c2[_0x6708('0x33')]);_0x28e147['filters']=_[_0x6708('0x36')](_0x28e147['model'],_0x28e147['query']);_0x30710d[_0x6708('0x35')]=_[_0x6708('0x36')](_0x28e147[_0x6708('0x37')],qs[_0x6708('0x38')](_0x1928c2[_0x6708('0x33')][_0x6708('0x38')]));_0x30710d['attributes']=_0x30710d[_0x6708('0x35')][_0x6708('0x46')]?_0x30710d['attributes']:_0x28e147[_0x6708('0x37')];if(_0x1928c2[_0x6708('0x33')]['includeAll']){_0x30710d[_0x6708('0x41')]=[{'all':!![]}];}_0x30710d=_[_0x6708('0x3e')]({},_0x30710d,_0x1928c2['options']);return db[_0x6708('0x2f')][_0x6708('0x47')](_0x30710d)[_0x6708('0x27')](handleEntityNotFound(_0x31543e,null))[_0x6708('0x27')](respondWithResult(_0x31543e,null))[_0x6708('0x43')](handleError(_0x31543e,null));};exports[_0x6708('0x48')]=function(_0xd5f68c,_0xbd0fc8){return db[_0x6708('0x2f')]['create'](_0xd5f68c['body'],{})['then'](respondWithResult(_0xbd0fc8,0xc9))[_0x6708('0x43')](handleError(_0xbd0fc8,null));};exports[_0x6708('0x26')]=function(_0x18a289,_0x3a4534){if(_0x18a289[_0x6708('0x49')]['id']){delete _0x18a289['body']['id'];}return db['VoiceDialReport'][_0x6708('0x47')]({'where':{'id':_0x18a289['params']['id']}})['then'](handleEntityNotFound(_0x3a4534,null))[_0x6708('0x27')](saveUpdates(_0x18a289[_0x6708('0x49')],null))[_0x6708('0x27')](respondWithResult(_0x3a4534,null))[_0x6708('0x43')](handleError(_0x3a4534,null));};exports[_0x6708('0x4a')]=function(_0x4d9965,_0x5ceb52){return db[_0x6708('0x2f')][_0x6708('0x47')]({'where':{'id':_0x4d9965[_0x6708('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5ceb52,null))[_0x6708('0x27')](removeEntity(_0x5ceb52,null))[_0x6708('0x43')](handleError(_0x5ceb52,null));};exports[_0x6708('0x4c')]=function(_0x4fa3b6,_0x359387){return db[_0x6708('0x2f')][_0x6708('0x4c')]()[_0x6708('0x27')](respondWithResult(_0x359387,null))['catch'](handleError(_0x359387,null));}; \ No newline at end of file +var _0x772b=['where','pick','filters','filter','options','VoiceDialReport','includeAll','include','findAll','catch','keys','length','merge','find','create','body','params','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','update','then','error','stack','name','index','map','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','sort'];(function(_0x3e2ec5,_0x3cb631){var _0x5a9873=function(_0x1c8424){while(--_0x1c8424){_0x3e2ec5['push'](_0x3e2ec5['shift']());}};_0x5a9873(++_0x3cb631);}(_0x772b,0x13f));var _0xb772=function(_0x263326,_0x40df72){_0x263326=_0x263326-0x0;var _0x32424d=_0x772b[_0x263326];return _0x32424d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb772('0x0'));var zipdir=require(_0xb772('0x1'));var jsonpatch=require(_0xb772('0x2'));var rp=require(_0xb772('0x3'));var moment=require(_0xb772('0x4'));var BPromise=require(_0xb772('0x5'));var Mustache=require(_0xb772('0x6'));var util=require(_0xb772('0x7'));var path=require('path');var sox=require(_0xb772('0x8'));var csv=require('to-csv');var ejs=require(_0xb772('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb772('0xa'));var squel=require(_0xb772('0xb'));var crypto=require(_0xb772('0xc'));var jsforce=require(_0xb772('0xd'));var deskjs=require(_0xb772('0xe'));var toCsv=require(_0xb772('0xf'));var querystring=require(_0xb772('0x10'));var Papa=require(_0xb772('0x11'));var Redis=require('ioredis');var authService=require(_0xb772('0x12'));var qs=require(_0xb772('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb772('0x14'));var logger=require(_0xb772('0x15'))(_0xb772('0x16'));var utils=require(_0xb772('0x17'));var config=require(_0xb772('0x18'));var licenseUtil=require(_0xb772('0x19'));var db=require(_0xb772('0x1a'))['db'];function respondWithStatusCode(_0x716c3c,_0x17962b){_0x17962b=_0x17962b||0xcc;return function(_0x47b60a){if(_0x47b60a){return _0x716c3c[_0xb772('0x1b')](_0x17962b);}return _0x716c3c[_0xb772('0x1c')](_0x17962b)[_0xb772('0x1d')]();};}function respondWithResult(_0x2b14cd,_0x298ad3){_0x298ad3=_0x298ad3||0xc8;return function(_0x4b1167){if(_0x4b1167){return _0x2b14cd['status'](_0x298ad3)[_0xb772('0x1e')](_0x4b1167);}};}function respondWithFilteredResult(_0x546ca0,_0x349da1){return function(_0x28b30e){if(_0x28b30e){var _0x50f86b=typeof _0x349da1['offset']===_0xb772('0x1f')&&typeof _0x349da1[_0xb772('0x20')]==='undefined';var _0x36e905=_0x28b30e[_0xb772('0x21')];var _0x1d2269=_0x50f86b?0x0:_0x349da1[_0xb772('0x22')];var _0x312e04=_0x50f86b?_0x28b30e[_0xb772('0x21')]:_0x349da1[_0xb772('0x22')]+_0x349da1[_0xb772('0x20')];var _0x47c349;if(_0x312e04>=_0x36e905){_0x312e04=_0x36e905;_0x47c349=0xc8;}else{_0x47c349=0xce;}_0x546ca0[_0xb772('0x1c')](_0x47c349);return _0x546ca0[_0xb772('0x23')](_0xb772('0x24'),_0x1d2269+'-'+_0x312e04+'/'+_0x36e905)['json'](_0x28b30e);}return null;};}function patchUpdates(_0x3948e8){return function(_0x5a8e94){try{jsonpatch['apply'](_0x5a8e94,_0x3948e8,!![]);}catch(_0x5b6a03){return BPromise[_0xb772('0x25')](_0x5b6a03);}return _0x5a8e94['save']();};}function saveUpdates(_0x4c9b2f,_0x1df11b){return function(_0x5a036f){if(_0x5a036f){return _0x5a036f[_0xb772('0x26')](_0x4c9b2f)[_0xb772('0x27')](function(_0xd2b806){return _0xd2b806;});}return null;};}function removeEntity(_0x2d2061,_0x280823){return function(_0xfb5fa8){if(_0xfb5fa8){return _0xfb5fa8['destroy']()['then'](function(){_0x2d2061[_0xb772('0x1c')](0xcc)[_0xb772('0x1d')]();});}};}function handleEntityNotFound(_0x42b6a2,_0x3a0745){return function(_0x3ae0a1){if(!_0x3ae0a1){_0x42b6a2[_0xb772('0x1b')](0x194);}return _0x3ae0a1;};}function handleError(_0x2d0523,_0x3999d0){_0x3999d0=_0x3999d0||0x1f4;return function(_0x3d4d89){logger[_0xb772('0x28')](_0x3d4d89[_0xb772('0x29')]);if(_0x3d4d89[_0xb772('0x2a')]){delete _0x3d4d89['name'];}_0x2d0523['status'](_0x3999d0)['send'](_0x3d4d89);};}exports[_0xb772('0x2b')]=function(_0x2601fe,_0x5e2b2e){var _0x6b73e8={},_0x1881e5={},_0x12e4d4={'count':0x0,'rows':[]};var _0x45518b=_[_0xb772('0x2c')](db['VoiceDialReport'][_0xb772('0x2d')],function(_0x431e3f){return{'name':_0x431e3f[_0xb772('0x2e')],'type':_0x431e3f[_0xb772('0x2f')]['key']};});_0x1881e5[_0xb772('0x30')]=_[_0xb772('0x2c')](_0x45518b,'name');_0x1881e5[_0xb772('0x31')]=_['keys'](_0x2601fe['query']);_0x1881e5['filters']=_[_0xb772('0x32')](_0x1881e5['model'],_0x1881e5[_0xb772('0x31')]);_0x6b73e8[_0xb772('0x33')]=_[_0xb772('0x32')](_0x1881e5[_0xb772('0x30')],qs[_0xb772('0x34')](_0x2601fe[_0xb772('0x31')][_0xb772('0x34')]));_0x6b73e8[_0xb772('0x33')]=_0x6b73e8['attributes']['length']?_0x6b73e8[_0xb772('0x33')]:_0x1881e5[_0xb772('0x30')];if(!_0x2601fe[_0xb772('0x31')][_0xb772('0x35')](_0xb772('0x36'))){_0x6b73e8['limit']=qs[_0xb772('0x20')](_0x2601fe[_0xb772('0x31')][_0xb772('0x20')]);_0x6b73e8['offset']=qs[_0xb772('0x22')](_0x2601fe[_0xb772('0x31')][_0xb772('0x22')]);}_0x6b73e8['order']=qs[_0xb772('0x37')](_0x2601fe[_0xb772('0x31')]['sort']);_0x6b73e8[_0xb772('0x38')]=qs['filters'](_[_0xb772('0x39')](_0x2601fe[_0xb772('0x31')],_0x1881e5[_0xb772('0x3a')]),_0x45518b);if(_0x2601fe[_0xb772('0x31')][_0xb772('0x3b')]){_0x6b73e8[_0xb772('0x38')]=_['merge'](_0x6b73e8[_0xb772('0x38')],{'$or':_[_0xb772('0x2c')](_0x45518b,function(_0x49c544){if(_0x49c544[_0xb772('0x2f')]!=='VIRTUAL'){var _0x29714f={};_0x29714f[_0x49c544[_0xb772('0x2a')]]={'$like':'%'+_0x2601fe['query'][_0xb772('0x3b')]+'%'};return _0x29714f;}})});}_0x6b73e8=_['merge']({},_0x6b73e8,_0x2601fe[_0xb772('0x3c')]);var _0x449b2f={'where':_0x6b73e8['where']};return db[_0xb772('0x3d')]['count'](_0x449b2f)['then'](function(_0x570fa1){_0x12e4d4['count']=_0x570fa1;if(_0x2601fe['query'][_0xb772('0x3e')]){_0x6b73e8[_0xb772('0x3f')]=[{'all':!![]}];}return db[_0xb772('0x3d')][_0xb772('0x40')](_0x6b73e8);})[_0xb772('0x27')](function(_0x5c2ddc){_0x12e4d4['rows']=_0x5c2ddc;return _0x12e4d4;})[_0xb772('0x27')](respondWithFilteredResult(_0x5e2b2e,_0x6b73e8))[_0xb772('0x41')](handleError(_0x5e2b2e,null));};exports['show']=function(_0x226bb6,_0x386b81){var _0x51aa5e={'raw':!![],'where':{'id':_0x226bb6['params']['id']}},_0x5a01a9={};_0x5a01a9[_0xb772('0x30')]=_['keys'](db[_0xb772('0x3d')][_0xb772('0x2d')]);_0x5a01a9[_0xb772('0x31')]=_[_0xb772('0x42')](_0x226bb6[_0xb772('0x31')]);_0x5a01a9[_0xb772('0x3a')]=_['intersection'](_0x5a01a9['model'],_0x5a01a9[_0xb772('0x31')]);_0x51aa5e[_0xb772('0x33')]=_[_0xb772('0x32')](_0x5a01a9[_0xb772('0x30')],qs[_0xb772('0x34')](_0x226bb6[_0xb772('0x31')][_0xb772('0x34')]));_0x51aa5e['attributes']=_0x51aa5e[_0xb772('0x33')][_0xb772('0x43')]?_0x51aa5e['attributes']:_0x5a01a9['model'];if(_0x226bb6[_0xb772('0x31')][_0xb772('0x3e')]){_0x51aa5e['include']=[{'all':!![]}];}_0x51aa5e=_[_0xb772('0x44')]({},_0x51aa5e,_0x226bb6['options']);return db[_0xb772('0x3d')][_0xb772('0x45')](_0x51aa5e)['then'](handleEntityNotFound(_0x386b81,null))[_0xb772('0x27')](respondWithResult(_0x386b81,null))['catch'](handleError(_0x386b81,null));};exports['create']=function(_0x270931,_0x2ab8f7){return db[_0xb772('0x3d')][_0xb772('0x46')](_0x270931[_0xb772('0x47')],{})['then'](respondWithResult(_0x2ab8f7,0xc9))[_0xb772('0x41')](handleError(_0x2ab8f7,null));};exports[_0xb772('0x26')]=function(_0x185c61,_0x25a5d8){if(_0x185c61[_0xb772('0x47')]['id']){delete _0x185c61['body']['id'];}return db[_0xb772('0x3d')][_0xb772('0x45')]({'where':{'id':_0x185c61[_0xb772('0x48')]['id']}})[_0xb772('0x27')](handleEntityNotFound(_0x25a5d8,null))[_0xb772('0x27')](saveUpdates(_0x185c61[_0xb772('0x47')],null))[_0xb772('0x27')](respondWithResult(_0x25a5d8,null))[_0xb772('0x41')](handleError(_0x25a5d8,null));};exports[_0xb772('0x49')]=function(_0x25fd2a,_0x13af84){return db[_0xb772('0x3d')][_0xb772('0x45')]({'where':{'id':_0x25fd2a[_0xb772('0x48')]['id']}})['then'](handleEntityNotFound(_0x13af84,null))[_0xb772('0x27')](removeEntity(_0x13af84,null))[_0xb772('0x41')](handleError(_0x13af84,null));};exports[_0xb772('0x4a')]=function(_0x325ea3,_0x16b37a){return db[_0xb772('0x3d')][_0xb772('0x4a')]()[_0xb772('0x27')](respondWithResult(_0x16b37a,null))[_0xb772('0x41')](handleError(_0x16b37a,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 469a7d3..3807442 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 _0x3967=['api','moment','bluebird','path','../../config/environment','./voiceDialReport.attributes','exports','define','VoiceDialReport','lodash','util','../../config/logger'];(function(_0x184759,_0x1cc38a){var _0xf26d5f=function(_0x1010c8){while(--_0x1010c8){_0x184759['push'](_0x184759['shift']());}};_0xf26d5f(++_0x1cc38a);}(_0x3967,0x159));var _0x7396=function(_0x4f34d8,_0x40f022){_0x4f34d8=_0x4f34d8-0x0;var _0xc97536=_0x3967[_0x4f34d8];return _0xc97536;};'use strict';var _=require(_0x7396('0x0'));var util=require(_0x7396('0x1'));var logger=require(_0x7396('0x2'))(_0x7396('0x3'));var moment=require(_0x7396('0x4'));var BPromise=require(_0x7396('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7396('0x6'));var rimraf=require('rimraf');var config=require(_0x7396('0x7'));var attributes=require(_0x7396('0x8'));module[_0x7396('0x9')]=function(_0x353883,_0x57085a){return _0x353883[_0x7396('0xa')](_0x7396('0xb'),attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x5736=['exports','define','VoiceDialReport','report_dial','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceDialReport.attributes'];(function(_0x5d3035,_0x35b16a){var _0x1fba1a=function(_0x474556){while(--_0x474556){_0x5d3035['push'](_0x5d3035['shift']());}};_0x1fba1a(++_0x35b16a);}(_0x5736,0x95));var _0x6573=function(_0x1bb554,_0x5496b5){_0x1bb554=_0x1bb554-0x0;var _0x2c17c6=_0x5736[_0x1bb554];return _0x2c17c6;};'use strict';var _=require(_0x6573('0x0'));var util=require(_0x6573('0x1'));var logger=require(_0x6573('0x2'))(_0x6573('0x3'));var moment=require(_0x6573('0x4'));var BPromise=require(_0x6573('0x5'));var rp=require(_0x6573('0x6'));var fs=require('fs');var path=require(_0x6573('0x7'));var rimraf=require(_0x6573('0x8'));var config=require(_0x6573('0x9'));var attributes=require(_0x6573('0xa'));module[_0x6573('0xb')]=function(_0x5ce730,_0x566227){return _0x5ce730[_0x6573('0xc')](_0x6573('0xd'),attributes,{'tableName':_0x6573('0xe'),'paranoid':![],'indexes':[{'fields':[_0x6573('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 1d0cf92..a59be0d 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 _0x8fe6=['ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateVoiceDialReport','VoiceDialReport','options','UpdateVoiceDialReport','update','body','raw','attributes','limit','catch','lodash','util','bluebird','randomstring'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x8fe6,0x113));var _0x68fe=function(_0x5224b9,_0x195fcb){_0x5224b9=_0x5224b9-0x0;var _0x363bcc=_0x8fe6[_0x5224b9];return _0x363bcc;};'use strict';var _=require(_0x68fe('0x0'));var util=require(_0x68fe('0x1'));var moment=require('moment');var BPromise=require(_0x68fe('0x2'));var rs=require(_0x68fe('0x3'));var fs=require('fs');var Redis=require(_0x68fe('0x4'));var db=require(_0x68fe('0x5'))['db'];var utils=require(_0x68fe('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x68fe('0x7'));var jayson=require(_0x68fe('0x8'));var client=jayson[_0x68fe('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x401323,_0x5f5b92,_0x14ffa9){return new BPromise(function(_0x54ebee,_0x8123f3){return client['request'](_0x401323,_0x14ffa9)[_0x68fe('0xa')](function(_0x328cd0){logger[_0x68fe('0xb')](_0x68fe('0xc'),_0x5f5b92,_0x68fe('0xd'));logger[_0x68fe('0xe')](_0x68fe('0xf'),_0x5f5b92,_0x68fe('0xd'),JSON[_0x68fe('0x10')](_0x328cd0));if(_0x328cd0[_0x68fe('0x11')]){if(_0x328cd0['error'][_0x68fe('0x12')]===0x1f4){logger[_0x68fe('0x11')](_0x68fe('0xc'),_0x5f5b92,_0x328cd0[_0x68fe('0x11')]['message']);return _0x8123f3(_0x328cd0[_0x68fe('0x11')][_0x68fe('0x13')]);}logger['error'](_0x68fe('0xc'),_0x5f5b92,_0x328cd0[_0x68fe('0x11')][_0x68fe('0x13')]);return _0x54ebee(_0x328cd0[_0x68fe('0x11')]['message']);}else{logger[_0x68fe('0xb')](_0x68fe('0xc'),_0x5f5b92,_0x68fe('0xd'));_0x54ebee(_0x328cd0[_0x68fe('0x14')][_0x68fe('0x13')]);}})['catch'](function(_0x12a631){logger[_0x68fe('0x11')](_0x68fe('0xc'),_0x5f5b92,_0x12a631);_0x8123f3(_0x12a631);});});}exports[_0x68fe('0x15')]=function(_0x2e6c98){var _0x527ed0=this;return new Promise(function(_0x36e1e7,_0x32df63){return db[_0x68fe('0x16')]['create'](_0x2e6c98['body'],{'raw':_0x2e6c98[_0x68fe('0x17')]?_0x2e6c98[_0x68fe('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x68fe('0xa')](function(_0x3a6172){logger['info'](_0x68fe('0x15'),_0x2e6c98);logger[_0x68fe('0xe')](_0x68fe('0x15'),_0x2e6c98,JSON[_0x68fe('0x10')](_0x3a6172));_0x36e1e7(_0x3a6172);})['catch'](function(_0x36f788){logger['error']('CreateVoiceDialReport',_0x36f788['message'],_0x2e6c98);_0x32df63(_0x527ed0[_0x68fe('0x11')](0x1f4,_0x36f788[_0x68fe('0x13')]));});});};exports[_0x68fe('0x18')]=function(_0x727d1){var _0x1b89a3=this;return new Promise(function(_0x28e354,_0x24619a){return db[_0x68fe('0x16')][_0x68fe('0x19')](_0x727d1[_0x68fe('0x1a')],{'raw':_0x727d1[_0x68fe('0x17')]?_0x727d1[_0x68fe('0x17')][_0x68fe('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x727d1[_0x68fe('0x17')]?_0x727d1['options']['where']||null:null,'attributes':_0x727d1['options']?_0x727d1[_0x68fe('0x17')][_0x68fe('0x1c')]||null:null,'limit':_0x727d1['options']?_0x727d1[_0x68fe('0x17')][_0x68fe('0x1d')]||null:null})[_0x68fe('0xa')](function(_0x3a7b0e){logger[_0x68fe('0xb')](_0x68fe('0x18'),_0x727d1);logger[_0x68fe('0xe')]('UpdateVoiceDialReport',_0x727d1,JSON[_0x68fe('0x10')](_0x3a7b0e));_0x28e354(_0x3a7b0e);})[_0x68fe('0x1e')](function(_0x4ac1eb){logger[_0x68fe('0x11')](_0x68fe('0x18'),_0x4ac1eb[_0x68fe('0x13')],_0x727d1);_0x24619a(_0x1b89a3['error'](0x1f4,_0x4ac1eb[_0x68fe('0x13')]));});});}; \ No newline at end of file +var _0xafbb=['VoiceDialReport,\x20%s,\x20%s','request\x20sent','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','CreateVoiceDialReport','VoiceDialReport','create','options','debug','UpdateVoiceDialReport','update','where','attributes','limit','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xafbb,0x1cd));var _0xbafb=function(_0x17e4ba,_0x1d6162){_0x17e4ba=_0x17e4ba-0x0;var _0x429c31=_0xafbb[_0x17e4ba];return _0x429c31;};'use strict';var _=require(_0xbafb('0x0'));var util=require(_0xbafb('0x1'));var moment=require(_0xbafb('0x2'));var BPromise=require('bluebird');var rs=require(_0xbafb('0x3'));var fs=require('fs');var Redis=require(_0xbafb('0x4'));var db=require(_0xbafb('0x5'))['db'];var utils=require(_0xbafb('0x6'));var logger=require(_0xbafb('0x7'))(_0xbafb('0x8'));var config=require(_0xbafb('0x9'));var jayson=require(_0xbafb('0xa'));var client=jayson[_0xbafb('0xb')][_0xbafb('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x35b0f7,_0x33be16,_0x25d35b){return new BPromise(function(_0x2b93a6,_0x2b095e){return client[_0xbafb('0xd')](_0x35b0f7,_0x25d35b)[_0xbafb('0xe')](function(_0x3bdb05){logger['info'](_0xbafb('0xf'),_0x33be16,_0xbafb('0x10'));logger['debug'](_0xbafb('0x11'),_0x33be16,'request\x20sent',JSON[_0xbafb('0x12')](_0x3bdb05));if(_0x3bdb05[_0xbafb('0x13')]){if(_0x3bdb05[_0xbafb('0x13')][_0xbafb('0x14')]===0x1f4){logger[_0xbafb('0x13')]('VoiceDialReport,\x20%s,\x20%s',_0x33be16,_0x3bdb05[_0xbafb('0x13')]['message']);return _0x2b095e(_0x3bdb05[_0xbafb('0x13')][_0xbafb('0x15')]);}logger[_0xbafb('0x13')]('VoiceDialReport,\x20%s,\x20%s',_0x33be16,_0x3bdb05[_0xbafb('0x13')][_0xbafb('0x15')]);return _0x2b93a6(_0x3bdb05['error'][_0xbafb('0x15')]);}else{logger[_0xbafb('0x16')]('VoiceDialReport,\x20%s,\x20%s',_0x33be16,_0xbafb('0x10'));_0x2b93a6(_0x3bdb05['result'][_0xbafb('0x15')]);}})[_0xbafb('0x17')](function(_0x2acc7b){logger[_0xbafb('0x13')]('VoiceDialReport,\x20%s,\x20%s',_0x33be16,_0x2acc7b);_0x2b095e(_0x2acc7b);});});}exports[_0xbafb('0x18')]=function(_0x54f434){var _0x53954c=this;return new Promise(function(_0x1a6f00,_0x4a2454){return db[_0xbafb('0x19')][_0xbafb('0x1a')](_0x54f434['body'],{'raw':_0x54f434['options']?_0x54f434[_0xbafb('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0xbafb('0xe')](function(_0x2b67c4){logger[_0xbafb('0x16')]('CreateVoiceDialReport',_0x54f434);logger[_0xbafb('0x1c')](_0xbafb('0x18'),_0x54f434,JSON[_0xbafb('0x12')](_0x2b67c4));_0x1a6f00(_0x2b67c4);})['catch'](function(_0x53ef82){logger[_0xbafb('0x13')](_0xbafb('0x18'),_0x53ef82[_0xbafb('0x15')],_0x54f434);_0x4a2454(_0x53954c['error'](0x1f4,_0x53ef82[_0xbafb('0x15')]));});});};exports[_0xbafb('0x1d')]=function(_0x207254){var _0x3b5311=this;return new Promise(function(_0x5d1a02,_0x39fcd5){return db[_0xbafb('0x19')][_0xbafb('0x1e')](_0x207254['body'],{'raw':_0x207254['options']?_0x207254[_0xbafb('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x207254[_0xbafb('0x1b')]?_0x207254[_0xbafb('0x1b')][_0xbafb('0x1f')]||null:null,'attributes':_0x207254[_0xbafb('0x1b')]?_0x207254[_0xbafb('0x1b')][_0xbafb('0x20')]||null:null,'limit':_0x207254['options']?_0x207254[_0xbafb('0x1b')][_0xbafb('0x21')]||null:null})['then'](function(_0x5809b7){logger[_0xbafb('0x16')](_0xbafb('0x1d'),_0x207254);logger[_0xbafb('0x1c')](_0xbafb('0x1d'),_0x207254,JSON[_0xbafb('0x12')](_0x5809b7));_0x5d1a02(_0x5809b7);})[_0xbafb('0x17')](function(_0x1aa631){logger[_0xbafb('0x13')](_0xbafb('0x1d'),_0x1aa631[_0xbafb('0x15')],_0x207254);_0x39fcd5(_0x3b5311[_0xbafb('0x13')](0x1f4,_0x1aa631[_0xbafb('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 926acb3..46ec047 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 _0x92d2=['get','isAuthenticated','show','create','post','addApplications','put','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x36c0bc,_0x599030){var _0x44f6c8=function(_0x5796c1){while(--_0x5796c1){_0x36c0bc['push'](_0x36c0bc['shift']());}};_0x44f6c8(++_0x599030);}(_0x92d2,0xf4));var _0x292d=function(_0x200b5e,_0x45a8a7){_0x200b5e=_0x200b5e-0x0;var _0x10a69b=_0x92d2[_0x200b5e];return _0x10a69b;};'use strict';var multer=require(_0x292d('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x292d('0x1'));var express=require(_0x292d('0x2'));var router=express[_0x292d('0x3')]();var fs_extra=require(_0x292d('0x4'));var auth=require(_0x292d('0x5'));var interaction=require(_0x292d('0x6'));var config=require(_0x292d('0x7'));var controller=require('./voiceExtension.controller');router[_0x292d('0x8')]('/',auth[_0x292d('0x9')](),controller['index']);router['get']('/:id',auth[_0x292d('0x9')](),controller[_0x292d('0xa')]);router['post']('/',auth[_0x292d('0x9')](),controller[_0x292d('0xb')]);router[_0x292d('0xc')]('/:id/applications',auth[_0x292d('0x9')](),controller[_0x292d('0xd')]);router[_0x292d('0xe')]('/:id',auth[_0x292d('0x9')](),controller['update']);router[_0x292d('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x292d('0x10')]);module[_0x292d('0x11')]=router; \ No newline at end of file +var _0x75db=['delete','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','post','create','addApplications','put','/:id','update'];(function(_0x5341ff,_0x1de6df){var _0x53be58=function(_0x4da0da){while(--_0x4da0da){_0x5341ff['push'](_0x5341ff['shift']());}};_0x53be58(++_0x1de6df);}(_0x75db,0x11a));var _0xb75d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x75db[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xb75d('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xb75d('0x1'));var express=require(_0xb75d('0x2'));var router=express[_0xb75d('0x3')]();var fs_extra=require(_0xb75d('0x4'));var auth=require(_0xb75d('0x5'));var interaction=require(_0xb75d('0x6'));var config=require(_0xb75d('0x7'));var controller=require('./voiceExtension.controller');router['get']('/',auth[_0xb75d('0x8')](),controller[_0xb75d('0x9')]);router[_0xb75d('0xa')]('/:id',auth[_0xb75d('0x8')](),controller[_0xb75d('0xb')]);router[_0xb75d('0xc')]('/',auth[_0xb75d('0x8')](),controller[_0xb75d('0xd')]);router[_0xb75d('0xc')]('/:id/applications',auth[_0xb75d('0x8')](),controller[_0xb75d('0xe')]);router[_0xb75d('0xf')](_0xb75d('0x10'),auth[_0xb75d('0x8')](),controller[_0xb75d('0x11')]);router[_0xb75d('0x12')]('/:id',auth[_0xb75d('0x8')](),controller[_0xb75d('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index 4506190..fc3b38e 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 _0xf31e=['ENUM','inbound','outbound','inbound-fax','outbound-fax','system','*,*,*,*','INTEGER','BOOLEAN','wav','getDataValue','sequelize','exports','compositeIndex','STRING','NoOp'];(function(_0x38e442,_0x13d85e){var _0x450a29=function(_0x3aa7b7){while(--_0x3aa7b7){_0x38e442['push'](_0x38e442['shift']());}};_0x450a29(++_0x13d85e);}(_0xf31e,0x17b));var _0xef31=function(_0x4f3a01,_0xcc5226){_0x4f3a01=_0x4f3a01-0x0;var _0x21f1c2=_0xf31e[_0x4f3a01];return _0x21f1c2;};'use strict';var Sequelize=require(_0xef31('0x0'));module[_0xef31('0x1')]={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xef31('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xef31('0x2')},'priority':{'type':Sequelize[_0xef31('0x3')],'allowNull':![],'defaultValue':'1','unique':_0xef31('0x2')},'tag':{'type':Sequelize[_0xef31('0x3')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xef31('0x3')],'allowNull':![],'defaultValue':_0xef31('0x4')},'appdata':{'type':Sequelize[_0xef31('0x3')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xef31('0x5')](_0xef31('0x6'),_0xef31('0x7'),'internal',_0xef31('0x8'),_0xef31('0x9'),_0xef31('0xa'),'any'),'allowNull':![]},'description':{'type':Sequelize[_0xef31('0x3')]},'interval':{'type':Sequelize[_0xef31('0x3')],'allowNull':![],'defaultValue':_0xef31('0xb')},'IntervalId':{'type':Sequelize[_0xef31('0xc')]},'isApp':{'type':Sequelize[_0xef31('0xd')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize['STRING'],'defaultValue':null},'callerID':{'type':Sequelize[_0xef31('0x3')],'allowNull':!![]},'record':{'type':Sequelize[_0xef31('0xd')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xef31('0xc')]},'recordingFormat':{'type':Sequelize[_0xef31('0x3')],'defaultValue':_0xef31('0xe')},'answer':{'type':Sequelize[_0xef31('0xd')],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x409564){return this[_0xef31('0xf')]('exten');}},'alias':{'type':Sequelize[_0xef31('0x3')],'allowNull':!![]}}; \ No newline at end of file +var _0x56ff=['outbound-fax','system','*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','exten','sequelize','exports','STRING','compositeIndex','ENUM','inbound','internal'];(function(_0xbaaecc,_0x480485){var _0x47d763=function(_0x29b5bc){while(--_0x29b5bc){_0xbaaecc['push'](_0xbaaecc['shift']());}};_0x47d763(++_0x480485);}(_0x56ff,0xf8));var _0xf56f=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x56ff[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xf56f('0x0'));module[_0xf56f('0x1')]={'context':{'type':Sequelize[_0xf56f('0x2')],'allowNull':![],'unique':_0xf56f('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xf56f('0x2')],'allowNull':![],'unique':_0xf56f('0x3')},'priority':{'type':Sequelize[_0xf56f('0x2')],'allowNull':![],'defaultValue':'1','unique':_0xf56f('0x3')},'tag':{'type':Sequelize[_0xf56f('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xf56f('0x2')],'allowNull':![],'defaultValue':'NoOp'},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xf56f('0x4')](_0xf56f('0x5'),'outbound',_0xf56f('0x6'),'inbound-fax',_0xf56f('0x7'),_0xf56f('0x8'),'any'),'allowNull':![]},'description':{'type':Sequelize[_0xf56f('0x2')]},'interval':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xf56f('0x9')},'IntervalId':{'type':Sequelize[_0xf56f('0xa')]},'isApp':{'type':Sequelize[_0xf56f('0xb')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xf56f('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0xf56f('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0xf56f('0xb')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xf56f('0xa')]},'recordingFormat':{'type':Sequelize[_0xf56f('0x2')],'defaultValue':_0xf56f('0xc')},'answer':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'name':{'type':Sequelize[_0xf56f('0xd')],'get':function(_0x5452c9){return this['getDataValue'](_0xf56f('0xe'));}},'alias':{'type':Sequelize[_0xf56f('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index c09d5f7..09d5a9f 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 _0x9b99=['transaction','VoiceExtensionId','isApp','rewriteDial','toLowerCase','createRouting','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','get','InboundRoutes','OutboundRoutes','outbound','internal','filter','ignore','value','type','find','UserProfileResource','destroy','end','error','stack','name','send','index','rawAttributes','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','VoiceExtension','includeAll','include','findAll','rows','catch','show','params','create','body','startsWith','exten','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','inbound','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','description','cutdigits','mandatoryDisposition','addApplications','findOne','sequelize'];(function(_0x5e9a69,_0x40c0ec){var _0x5979c8=function(_0x293da2){while(--_0x293da2){_0x5e9a69['push'](_0x5e9a69['shift']());}};_0x5979c8(++_0x40c0ec);}(_0x9b99,0xf5));var _0x99b9=function(_0x4eb677,_0x2845a3){_0x4eb677=_0x4eb677-0x0;var _0x35e7bc=_0x9b99[_0x4eb677];return _0x35e7bc;};'use strict';var emlformat=require(_0x99b9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x99b9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x99b9('0x2'));var moment=require(_0x99b9('0x3'));var BPromise=require(_0x99b9('0x4'));var Mustache=require(_0x99b9('0x5'));var util=require(_0x99b9('0x6'));var path=require(_0x99b9('0x7'));var sox=require(_0x99b9('0x8'));var csv=require('to-csv');var ejs=require(_0x99b9('0x9'));var fs=require('fs');var fs_extra=require(_0x99b9('0xa'));var _=require(_0x99b9('0xb'));var squel=require(_0x99b9('0xc'));var crypto=require(_0x99b9('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x99b9('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x99b9('0xf'));var Redis=require(_0x99b9('0x10'));var authService=require(_0x99b9('0x11'));var qs=require(_0x99b9('0x12'));var as=require(_0x99b9('0x13'));var hardwareService=require(_0x99b9('0x14'));var logger=require('../../config/logger')(_0x99b9('0x15'));var utils=require(_0x99b9('0x16'));var config=require(_0x99b9('0x17'));var licenseUtil=require(_0x99b9('0x18'));var db=require(_0x99b9('0x19'))['db'];config['redis']=_[_0x99b9('0x1a')](config[_0x99b9('0x1b')],{'host':_0x99b9('0x1c'),'port':0x18eb});var socket=require(_0x99b9('0x1d'))(new Redis(config[_0x99b9('0x1b')]));require(_0x99b9('0x1e'))[_0x99b9('0x1f')](socket);function respondWithStatusCode(_0x4f316a,_0x829a47){_0x829a47=_0x829a47||0xcc;return function(_0x2db51c){if(_0x2db51c){return _0x4f316a[_0x99b9('0x20')](_0x829a47);}return _0x4f316a[_0x99b9('0x21')](_0x829a47)['end']();};}function respondWithResult(_0x1df3e4,_0x14ccbe){_0x14ccbe=_0x14ccbe||0xc8;return function(_0x2c35a6){if(_0x2c35a6){return _0x1df3e4['status'](_0x14ccbe)[_0x99b9('0x22')](_0x2c35a6);}};}function respondWithFilteredResult(_0x1b7de6,_0x4b2346){return function(_0x4b9d09){if(_0x4b9d09){var _0x1289ea=typeof _0x4b2346[_0x99b9('0x23')]==='undefined'&&typeof _0x4b2346[_0x99b9('0x24')]===_0x99b9('0x25');var _0x10e31a=_0x4b9d09[_0x99b9('0x26')];var _0x39fccf=_0x1289ea?0x0:_0x4b2346[_0x99b9('0x23')];var _0x3084c1=_0x1289ea?_0x4b9d09['count']:_0x4b2346['offset']+_0x4b2346['limit'];var _0x3ab4da;if(_0x3084c1>=_0x10e31a){_0x3084c1=_0x10e31a;_0x3ab4da=0xc8;}else{_0x3ab4da=0xce;}_0x1b7de6[_0x99b9('0x21')](_0x3ab4da);return _0x1b7de6[_0x99b9('0x27')](_0x99b9('0x28'),_0x39fccf+'-'+_0x3084c1+'/'+_0x10e31a)[_0x99b9('0x22')](_0x4b9d09);}return null;};}function patchUpdates(_0x57f92d){return function(_0x4a830e){try{jsonpatch[_0x99b9('0x29')](_0x4a830e,_0x57f92d,!![]);}catch(_0x2b55e8){return BPromise[_0x99b9('0x2a')](_0x2b55e8);}return _0x4a830e['save']();};}function saveUpdates(_0x3af63a,_0x270833){return function(_0xae2f48){if(_0xae2f48){return _0xae2f48[_0x99b9('0x2b')](_0x3af63a)['then'](function(_0x15f51c){return _0x15f51c;});}return null;};}function removeEntity(_0x17672f,_0x565ae6){return function(_0x15726c){if(_0x15726c){return _0x15726c['destroy']()[_0x99b9('0x2c')](function(){var _0x491e8b=_0x15726c[_0x99b9('0x2d')]({'plain':!![]});var _0x519ef0=[{'name':_0x99b9('0x2e'),'value':'inbound','ignore':![]},{'name':_0x99b9('0x2f'),'value':_0x99b9('0x30'),'ignore':![]},{'name':'InternalRoutes','value':_0x99b9('0x31'),'ignore':![]}];var _0x422a2c=_(_0x519ef0)[_0x99b9('0x32')](_0x99b9('0x33'))['map'](_0x99b9('0x34'))[_0x99b9('0x34')]();if(_['includes'](_0x422a2c,_0x491e8b[_0x99b9('0x35')])){return;}var _0x457c35=_[_0x99b9('0x36')](_0x519ef0,['value',_0x491e8b[_0x99b9('0x35')]])['name'];return db[_0x99b9('0x37')][_0x99b9('0x38')]({'where':{'type':_0x457c35,'resourceId':_0x491e8b['id']}})['then'](function(){return _0x15726c;});})[_0x99b9('0x2c')](function(){_0x17672f[_0x99b9('0x21')](0xcc)[_0x99b9('0x39')]();});}};}function handleEntityNotFound(_0x37efb7,_0x5766dc){return function(_0x132f95){if(!_0x132f95){_0x37efb7[_0x99b9('0x20')](0x194);}return _0x132f95;};}function handleError(_0x46fa88,_0x1a2165){_0x1a2165=_0x1a2165||0x1f4;return function(_0x2a8ead){logger[_0x99b9('0x3a')](_0x2a8ead[_0x99b9('0x3b')]);if(_0x2a8ead[_0x99b9('0x3c')]){delete _0x2a8ead[_0x99b9('0x3c')];}_0x46fa88[_0x99b9('0x21')](_0x1a2165)[_0x99b9('0x3d')](_0x2a8ead);};}exports[_0x99b9('0x3e')]=function(_0x20e31c,_0x262333){var _0x260654={},_0x264cb4={},_0x85516c={'count':0x0,'rows':[]};var _0x4b1123=_['map'](db['VoiceExtension'][_0x99b9('0x3f')],function(_0x11e229){return{'name':_0x11e229['fieldName'],'type':_0x11e229[_0x99b9('0x35')][_0x99b9('0x40')]};});_0x264cb4[_0x99b9('0x41')]=_[_0x99b9('0x42')](_0x4b1123,'name');_0x264cb4[_0x99b9('0x43')]=_[_0x99b9('0x44')](_0x20e31c[_0x99b9('0x43')]);_0x264cb4[_0x99b9('0x45')]=_[_0x99b9('0x46')](_0x264cb4['model'],_0x264cb4['query']);_0x260654['attributes']=_[_0x99b9('0x46')](_0x264cb4[_0x99b9('0x41')],qs[_0x99b9('0x47')](_0x20e31c['query'][_0x99b9('0x47')]));_0x260654['attributes']=_0x260654[_0x99b9('0x48')][_0x99b9('0x49')]?_0x260654['attributes']:_0x264cb4['model'];if(!_0x20e31c['query'][_0x99b9('0x4a')](_0x99b9('0x4b'))){_0x260654[_0x99b9('0x24')]=qs[_0x99b9('0x24')](_0x20e31c['query'][_0x99b9('0x24')]);_0x260654[_0x99b9('0x23')]=qs['offset'](_0x20e31c[_0x99b9('0x43')][_0x99b9('0x23')]);}_0x260654[_0x99b9('0x4c')]=qs[_0x99b9('0x4d')](_0x20e31c[_0x99b9('0x43')]['sort']);_0x260654[_0x99b9('0x4e')]=qs[_0x99b9('0x45')](_[_0x99b9('0x4f')](_0x20e31c[_0x99b9('0x43')],_0x264cb4['filters']),_0x4b1123);if(_0x20e31c['query'][_0x99b9('0x32')]){_0x260654['where']=_[_0x99b9('0x50')](_0x260654['where'],{'$or':_[_0x99b9('0x42')](_0x4b1123,function(_0x1e5f18){if(_0x1e5f18['type']!==_0x99b9('0x51')){var _0x1bc7a8={};_0x1bc7a8[_0x1e5f18[_0x99b9('0x3c')]]={'$like':'%'+_0x20e31c[_0x99b9('0x43')]['filter']+'%'};return _0x1bc7a8;}})});}_0x260654=_[_0x99b9('0x50')]({},_0x260654,_0x20e31c[_0x99b9('0x52')]);var _0x2abf1b={'where':_0x260654[_0x99b9('0x4e')]};return db[_0x99b9('0x53')][_0x99b9('0x26')](_0x2abf1b)[_0x99b9('0x2c')](function(_0x3e46f8){_0x85516c[_0x99b9('0x26')]=_0x3e46f8;if(_0x20e31c[_0x99b9('0x43')][_0x99b9('0x54')]){_0x260654[_0x99b9('0x55')]=[{'all':!![]}];}return db[_0x99b9('0x53')][_0x99b9('0x56')](_0x260654);})[_0x99b9('0x2c')](function(_0x3e106e){_0x85516c[_0x99b9('0x57')]=_0x3e106e;return _0x85516c;})['then'](respondWithFilteredResult(_0x262333,_0x260654))[_0x99b9('0x58')](handleError(_0x262333,null));};exports[_0x99b9('0x59')]=function(_0x4b0447,_0x2498fc){var _0x1c4a33={'raw':![],'where':{'id':_0x4b0447[_0x99b9('0x5a')]['id']}},_0x130d48={};_0x130d48[_0x99b9('0x41')]=_['keys'](db[_0x99b9('0x53')][_0x99b9('0x3f')]);_0x130d48[_0x99b9('0x43')]=_[_0x99b9('0x44')](_0x4b0447['query']);_0x130d48['filters']=_['intersection'](_0x130d48[_0x99b9('0x41')],_0x130d48[_0x99b9('0x43')]);_0x1c4a33[_0x99b9('0x48')]=_[_0x99b9('0x46')](_0x130d48[_0x99b9('0x41')],qs[_0x99b9('0x47')](_0x4b0447['query'][_0x99b9('0x47')]));_0x1c4a33['attributes']=_0x1c4a33[_0x99b9('0x48')][_0x99b9('0x49')]?_0x1c4a33[_0x99b9('0x48')]:_0x130d48[_0x99b9('0x41')];if(_0x4b0447[_0x99b9('0x43')][_0x99b9('0x54')]){_0x1c4a33[_0x99b9('0x55')]=[{'all':!![]}];}_0x1c4a33=_['merge']({},_0x1c4a33,_0x4b0447[_0x99b9('0x52')]);return db[_0x99b9('0x53')][_0x99b9('0x36')](_0x1c4a33)[_0x99b9('0x2c')](handleEntityNotFound(_0x2498fc,null))[_0x99b9('0x2c')](respondWithResult(_0x2498fc,null))['catch'](handleError(_0x2498fc,null));};exports[_0x99b9('0x38')]=function(_0x1f5dc6,_0x1264f1){return db[_0x99b9('0x53')]['find']({'where':{'id':_0x1f5dc6[_0x99b9('0x5a')]['id']}})[_0x99b9('0x2c')](handleEntityNotFound(_0x1264f1,null))['then'](removeEntity(_0x1264f1,null))[_0x99b9('0x58')](handleError(_0x1264f1,null));};exports[_0x99b9('0x5b')]=function(_0xa8d3f5,_0x403fb6){if(_0xa8d3f5[_0x99b9('0x5c')][_0x99b9('0x35')]===_0x99b9('0x30')&&!_[_0x99b9('0x5d')](_0xa8d3f5[_0x99b9('0x5c')][_0x99b9('0x5e')],'_')){_0xa8d3f5[_0x99b9('0x5c')][_0x99b9('0x5e')]='_'['concat'](_0xa8d3f5[_0x99b9('0x5c')]['exten']);}return db['VoiceExtension'][_0x99b9('0x5b')](_0xa8d3f5[_0x99b9('0x5c')],{'raw':![]})[_0x99b9('0x2c')](function(_0x2ded25){var _0x2676ca=_0xa8d3f5['user'][_0x99b9('0x2d')]({'plain':!![]});if(!_0x2676ca)throw new Error(_0x99b9('0x5f'));if(_0x2676ca[_0x99b9('0x60')]==='user'){var _0x3d886f=_0x2ded25[_0x99b9('0x2d')]({'plain':!![]});var _0x8a061a=[{'name':'InboundRoutes','value':_0x99b9('0x61')},{'name':'OutboundRoutes','value':'outbound'},{'name':'InternalRoutes','value':'internal'}];var _0x1bccd3=_[_0x99b9('0x36')](_0x8a061a,['value',_0x3d886f['type']])[_0x99b9('0x3c')];return db[_0x99b9('0x62')][_0x99b9('0x36')]({'where':{'name':_0x1bccd3,'userProfileId':_0x2676ca[_0x99b9('0x63')]},'raw':!![]})['then'](function(_0x571bf0){if(_0x571bf0&&_0x571bf0[_0x99b9('0x64')]===0x0){return db['UserProfileResource'][_0x99b9('0x5b')]({'name':_0x3d886f[_0x99b9('0x3c')],'resourceId':_0x3d886f['id'],'type':_0x571bf0[_0x99b9('0x3c')],'sectionId':_0x571bf0['id']},{})[_0x99b9('0x2c')](function(){return _0x2ded25;});}else{return _0x2ded25;}})[_0x99b9('0x58')](function(_0x3bdda3){logger[_0x99b9('0x3a')](_0x99b9('0x65'),_0x3bdda3);throw _0x3bdda3;});}return _0x2ded25;})[_0x99b9('0x2c')](respondWithResult(_0x403fb6,0xc9))[_0x99b9('0x58')](handleError(_0x403fb6,null));};exports[_0x99b9('0x2b')]=function(_0x50afb0,_0x52de7e){if(_0x50afb0[_0x99b9('0x5c')]['id']){delete _0x50afb0[_0x99b9('0x5c')]['id'];}return db[_0x99b9('0x53')][_0x99b9('0x36')]({'where':{'id':_0x50afb0[_0x99b9('0x5a')]['id']}})[_0x99b9('0x2c')](handleEntityNotFound(_0x52de7e,null))['then'](function(_0x57c567){if(_0x57c567){return db[_0x99b9('0x53')][_0x99b9('0x2b')](_['pick'](_0x50afb0[_0x99b9('0x5c')],[_0x99b9('0x5e'),_0x99b9('0x66'),_0x99b9('0x67'),'recordingFormat',_0x99b9('0x68'),_0x99b9('0x69'),'alias']),{'where':{'context':_0x57c567[_0x99b9('0x66')],'exten':_0x57c567[_0x99b9('0x5e')]},'individualHooks':!![]})[_0x99b9('0x2c')](function(_0x4784dc){return _0x4784dc;});}return null;})[_0x99b9('0x2c')](respondWithStatusCode(_0x52de7e,null))[_0x99b9('0x58')](handleError(_0x52de7e,null));};exports[_0x99b9('0x6a')]=function(_0x3b1cc1,_0x5bd77a){return db[_0x99b9('0x53')][_0x99b9('0x6b')]({'where':{'id':_0x3b1cc1[_0x99b9('0x5a')]['id']}})[_0x99b9('0x2c')](function(_0x15ca61){if(_0x15ca61){return db[_0x99b9('0x6c')][_0x99b9('0x6d')](function(_0x5ced22){return db[_0x99b9('0x53')][_0x99b9('0x38')]({'where':{'VoiceExtensionId':_0x3b1cc1[_0x99b9('0x5a')]['id']},'transaction':_0x5ced22})['then'](function(){var _0x2e5f4a=_[_0x99b9('0x42')](_0x3b1cc1[_0x99b9('0x5c')],function(_0x1456da){_0x1456da[_0x99b9('0x6e')]=_0x3b1cc1[_0x99b9('0x5a')]['id'];_0x1456da[_0x99b9('0x6f')]=!![];return _0x1456da;});var _0x130767=_0x3b1cc1['query']['rewriteDial']&&_0x3b1cc1[_0x99b9('0x43')][_0x99b9('0x70')][_0x99b9('0x71')]()==='true'?!![]:![];return _0x15ca61[_0x99b9('0x72')](_0x2e5f4a,_0x130767);})[_0x99b9('0x2c')](function(_0x11eb46){return db[_0x99b9('0x53')][_0x99b9('0x73')](_0x11eb46,{'transaction':_0x5ced22});});})[_0x99b9('0x2c')](function(){return db[_0x99b9('0x53')][_0x99b9('0x74')]({'where':{'isApp':!![],'VoiceExtensionId':_0x3b1cc1[_0x99b9('0x5a')]['id']},'order':_0x99b9('0x75')});});}})[_0x99b9('0x2c')](respondWithResult(_0x5bd77a,null))[_0x99b9('0x58')](handleError(_0x5bd77a,null));}; \ No newline at end of file +var _0x4bf4=['includeAll','findAll','rows','show','params','length','merge','catch','create','body','outbound','startsWith','exten','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','inbound','InternalRoutes','internal','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','pick','context','description','recordingFormat','cutdigits','alias','addApplications','sequelize','transaction','isApp','rewriteDial','toLowerCase','true','createRouting','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','eml-format','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','sendStatus','status','end','offset','limit','undefined','count','set','json','reject','save','update','then','destroy','get','InboundRoutes','OutboundRoutes','map','value','includes','type','find','name','error','stack','send','index','VoiceExtension','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','filter','VIRTUAL','options'];(function(_0x57eee0,_0x5a7bd2){var _0x161f31=function(_0x25f3fc){while(--_0x25f3fc){_0x57eee0['push'](_0x57eee0['shift']());}};_0x161f31(++_0x5a7bd2);}(_0x4bf4,0x9b));var _0x44bf=function(_0x4762a2,_0x5c7cf6){_0x4762a2=_0x4762a2-0x0;var _0x4a6965=_0x4bf4[_0x4762a2];return _0x4a6965;};'use strict';var emlformat=require(_0x44bf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x44bf('0x1'));var jsonpatch=require(_0x44bf('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x44bf('0x3'));var Mustache=require(_0x44bf('0x4'));var util=require('util');var path=require(_0x44bf('0x5'));var sox=require(_0x44bf('0x6'));var csv=require(_0x44bf('0x7'));var ejs=require(_0x44bf('0x8'));var fs=require('fs');var fs_extra=require(_0x44bf('0x9'));var _=require(_0x44bf('0xa'));var squel=require(_0x44bf('0xb'));var crypto=require(_0x44bf('0xc'));var jsforce=require(_0x44bf('0xd'));var deskjs=require(_0x44bf('0xe'));var toCsv=require(_0x44bf('0x7'));var querystring=require(_0x44bf('0xf'));var Papa=require(_0x44bf('0x10'));var Redis=require('ioredis');var authService=require(_0x44bf('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x44bf('0x12'));var hardwareService=require(_0x44bf('0x13'));var logger=require('../../config/logger')(_0x44bf('0x14'));var utils=require(_0x44bf('0x15'));var config=require(_0x44bf('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x44bf('0x17')]=_[_0x44bf('0x18')](config[_0x44bf('0x17')],{'host':_0x44bf('0x19'),'port':0x18eb});var socket=require(_0x44bf('0x1a'))(new Redis(config[_0x44bf('0x17')]));require(_0x44bf('0x1b'))['register'](socket);function respondWithStatusCode(_0x1136ca,_0x411db8){_0x411db8=_0x411db8||0xcc;return function(_0x4d1046){if(_0x4d1046){return _0x1136ca[_0x44bf('0x1c')](_0x411db8);}return _0x1136ca[_0x44bf('0x1d')](_0x411db8)[_0x44bf('0x1e')]();};}function respondWithResult(_0x285718,_0x50375e){_0x50375e=_0x50375e||0xc8;return function(_0x491d3d){if(_0x491d3d){return _0x285718[_0x44bf('0x1d')](_0x50375e)['json'](_0x491d3d);}};}function respondWithFilteredResult(_0x2e4fe9,_0xef61bf){return function(_0x547f7f){if(_0x547f7f){var _0xee3f0a=typeof _0xef61bf[_0x44bf('0x1f')]==='undefined'&&typeof _0xef61bf[_0x44bf('0x20')]===_0x44bf('0x21');var _0x4ab8fb=_0x547f7f[_0x44bf('0x22')];var _0x8612e0=_0xee3f0a?0x0:_0xef61bf[_0x44bf('0x1f')];var _0xaf4d58=_0xee3f0a?_0x547f7f[_0x44bf('0x22')]:_0xef61bf[_0x44bf('0x1f')]+_0xef61bf['limit'];var _0x3594bd;if(_0xaf4d58>=_0x4ab8fb){_0xaf4d58=_0x4ab8fb;_0x3594bd=0xc8;}else{_0x3594bd=0xce;}_0x2e4fe9[_0x44bf('0x1d')](_0x3594bd);return _0x2e4fe9[_0x44bf('0x23')]('Content-Range',_0x8612e0+'-'+_0xaf4d58+'/'+_0x4ab8fb)[_0x44bf('0x24')](_0x547f7f);}return null;};}function patchUpdates(_0x335b2d){return function(_0x215aea){try{jsonpatch['apply'](_0x215aea,_0x335b2d,!![]);}catch(_0x529000){return BPromise[_0x44bf('0x25')](_0x529000);}return _0x215aea[_0x44bf('0x26')]();};}function saveUpdates(_0x4e3387,_0x32e1cd){return function(_0xf7fa64){if(_0xf7fa64){return _0xf7fa64[_0x44bf('0x27')](_0x4e3387)[_0x44bf('0x28')](function(_0x490707){return _0x490707;});}return null;};}function removeEntity(_0x5b194e,_0x4d8889){return function(_0xcee031){if(_0xcee031){return _0xcee031[_0x44bf('0x29')]()[_0x44bf('0x28')](function(){var _0x2f1714=_0xcee031[_0x44bf('0x2a')]({'plain':!![]});var _0x5b2892=[{'name':_0x44bf('0x2b'),'value':'inbound','ignore':![]},{'name':_0x44bf('0x2c'),'value':'outbound','ignore':![]},{'name':'InternalRoutes','value':'internal','ignore':![]}];var _0x3a743c=_(_0x5b2892)['filter']('ignore')[_0x44bf('0x2d')](_0x44bf('0x2e'))[_0x44bf('0x2e')]();if(_[_0x44bf('0x2f')](_0x3a743c,_0x2f1714[_0x44bf('0x30')])){return;}var _0x219a35=_[_0x44bf('0x31')](_0x5b2892,[_0x44bf('0x2e'),_0x2f1714['type']])[_0x44bf('0x32')];return db['UserProfileResource'][_0x44bf('0x29')]({'where':{'type':_0x219a35,'resourceId':_0x2f1714['id']}})[_0x44bf('0x28')](function(){return _0xcee031;});})[_0x44bf('0x28')](function(){_0x5b194e[_0x44bf('0x1d')](0xcc)[_0x44bf('0x1e')]();});}};}function handleEntityNotFound(_0x452701,_0x4a270c){return function(_0x3ade9c){if(!_0x3ade9c){_0x452701['sendStatus'](0x194);}return _0x3ade9c;};}function handleError(_0x2506e5,_0x417d58){_0x417d58=_0x417d58||0x1f4;return function(_0x33e42d){logger[_0x44bf('0x33')](_0x33e42d[_0x44bf('0x34')]);if(_0x33e42d[_0x44bf('0x32')]){delete _0x33e42d['name'];}_0x2506e5['status'](_0x417d58)[_0x44bf('0x35')](_0x33e42d);};}exports[_0x44bf('0x36')]=function(_0x18dedd,_0x2af6bb){var _0x5af8e3={},_0x1d6ba4={},_0x3cbaff={'count':0x0,'rows':[]};var _0x290865=_[_0x44bf('0x2d')](db[_0x44bf('0x37')][_0x44bf('0x38')],function(_0x1054ba){return{'name':_0x1054ba[_0x44bf('0x39')],'type':_0x1054ba[_0x44bf('0x30')][_0x44bf('0x3a')]};});_0x1d6ba4[_0x44bf('0x3b')]=_[_0x44bf('0x2d')](_0x290865,'name');_0x1d6ba4[_0x44bf('0x3c')]=_[_0x44bf('0x3d')](_0x18dedd['query']);_0x1d6ba4[_0x44bf('0x3e')]=_['intersection'](_0x1d6ba4[_0x44bf('0x3b')],_0x1d6ba4[_0x44bf('0x3c')]);_0x5af8e3['attributes']=_[_0x44bf('0x3f')](_0x1d6ba4[_0x44bf('0x3b')],qs[_0x44bf('0x40')](_0x18dedd[_0x44bf('0x3c')][_0x44bf('0x40')]));_0x5af8e3[_0x44bf('0x41')]=_0x5af8e3[_0x44bf('0x41')]['length']?_0x5af8e3['attributes']:_0x1d6ba4[_0x44bf('0x3b')];if(!_0x18dedd[_0x44bf('0x3c')][_0x44bf('0x42')]('nolimit')){_0x5af8e3[_0x44bf('0x20')]=qs[_0x44bf('0x20')](_0x18dedd[_0x44bf('0x3c')][_0x44bf('0x20')]);_0x5af8e3[_0x44bf('0x1f')]=qs['offset'](_0x18dedd[_0x44bf('0x3c')][_0x44bf('0x1f')]);}_0x5af8e3[_0x44bf('0x43')]=qs[_0x44bf('0x44')](_0x18dedd[_0x44bf('0x3c')][_0x44bf('0x44')]);_0x5af8e3[_0x44bf('0x45')]=qs[_0x44bf('0x3e')](_['pick'](_0x18dedd[_0x44bf('0x3c')],_0x1d6ba4[_0x44bf('0x3e')]),_0x290865);if(_0x18dedd[_0x44bf('0x3c')][_0x44bf('0x46')]){_0x5af8e3[_0x44bf('0x45')]=_['merge'](_0x5af8e3['where'],{'$or':_[_0x44bf('0x2d')](_0x290865,function(_0x42cf12){if(_0x42cf12['type']!==_0x44bf('0x47')){var _0x45fbc9={};_0x45fbc9[_0x42cf12[_0x44bf('0x32')]]={'$like':'%'+_0x18dedd[_0x44bf('0x3c')]['filter']+'%'};return _0x45fbc9;}})});}_0x5af8e3=_['merge']({},_0x5af8e3,_0x18dedd[_0x44bf('0x48')]);var _0x59039f={'where':_0x5af8e3[_0x44bf('0x45')]};return db[_0x44bf('0x37')][_0x44bf('0x22')](_0x59039f)[_0x44bf('0x28')](function(_0x89a70b){_0x3cbaff[_0x44bf('0x22')]=_0x89a70b;if(_0x18dedd[_0x44bf('0x3c')][_0x44bf('0x49')]){_0x5af8e3['include']=[{'all':!![]}];}return db[_0x44bf('0x37')][_0x44bf('0x4a')](_0x5af8e3);})[_0x44bf('0x28')](function(_0x4c615b){_0x3cbaff[_0x44bf('0x4b')]=_0x4c615b;return _0x3cbaff;})[_0x44bf('0x28')](respondWithFilteredResult(_0x2af6bb,_0x5af8e3))['catch'](handleError(_0x2af6bb,null));};exports[_0x44bf('0x4c')]=function(_0x3f59aa,_0x5e4779){var _0x467bc6={'raw':![],'where':{'id':_0x3f59aa[_0x44bf('0x4d')]['id']}},_0x43b98f={};_0x43b98f['model']=_[_0x44bf('0x3d')](db['VoiceExtension'][_0x44bf('0x38')]);_0x43b98f[_0x44bf('0x3c')]=_['keys'](_0x3f59aa[_0x44bf('0x3c')]);_0x43b98f[_0x44bf('0x3e')]=_[_0x44bf('0x3f')](_0x43b98f[_0x44bf('0x3b')],_0x43b98f['query']);_0x467bc6[_0x44bf('0x41')]=_['intersection'](_0x43b98f[_0x44bf('0x3b')],qs[_0x44bf('0x40')](_0x3f59aa['query']['fields']));_0x467bc6[_0x44bf('0x41')]=_0x467bc6[_0x44bf('0x41')][_0x44bf('0x4e')]?_0x467bc6['attributes']:_0x43b98f[_0x44bf('0x3b')];if(_0x3f59aa['query'][_0x44bf('0x49')]){_0x467bc6['include']=[{'all':!![]}];}_0x467bc6=_[_0x44bf('0x4f')]({},_0x467bc6,_0x3f59aa[_0x44bf('0x48')]);return db[_0x44bf('0x37')][_0x44bf('0x31')](_0x467bc6)[_0x44bf('0x28')](handleEntityNotFound(_0x5e4779,null))[_0x44bf('0x28')](respondWithResult(_0x5e4779,null))[_0x44bf('0x50')](handleError(_0x5e4779,null));};exports[_0x44bf('0x29')]=function(_0x4ea5f0,_0x5ba121){return db[_0x44bf('0x37')][_0x44bf('0x31')]({'where':{'id':_0x4ea5f0[_0x44bf('0x4d')]['id']}})[_0x44bf('0x28')](handleEntityNotFound(_0x5ba121,null))['then'](removeEntity(_0x5ba121,null))['catch'](handleError(_0x5ba121,null));};exports[_0x44bf('0x51')]=function(_0x122aa5,_0x1b1ffd){if(_0x122aa5[_0x44bf('0x52')][_0x44bf('0x30')]===_0x44bf('0x53')&&!_[_0x44bf('0x54')](_0x122aa5['body'][_0x44bf('0x55')],'_')){_0x122aa5[_0x44bf('0x52')]['exten']='_'[_0x44bf('0x56')](_0x122aa5[_0x44bf('0x52')]['exten']);}return db[_0x44bf('0x37')][_0x44bf('0x51')](_0x122aa5['body'],{'raw':![]})['then'](function(_0x13031b){var _0x346c02=_0x122aa5[_0x44bf('0x57')][_0x44bf('0x2a')]({'plain':!![]});if(!_0x346c02)throw new Error(_0x44bf('0x58'));if(_0x346c02[_0x44bf('0x59')]===_0x44bf('0x57')){var _0x30e7c6=_0x13031b[_0x44bf('0x2a')]({'plain':!![]});var _0x5b8d95=[{'name':_0x44bf('0x2b'),'value':_0x44bf('0x5a')},{'name':_0x44bf('0x2c'),'value':'outbound'},{'name':_0x44bf('0x5b'),'value':_0x44bf('0x5c')}];var _0x2aa309=_['find'](_0x5b8d95,[_0x44bf('0x2e'),_0x30e7c6[_0x44bf('0x30')]])[_0x44bf('0x32')];return db[_0x44bf('0x5d')][_0x44bf('0x31')]({'where':{'name':_0x2aa309,'userProfileId':_0x346c02[_0x44bf('0x5e')]},'raw':!![]})[_0x44bf('0x28')](function(_0x3600b2){if(_0x3600b2&&_0x3600b2['autoAssociation']===0x0){return db[_0x44bf('0x5f')]['create']({'name':_0x30e7c6[_0x44bf('0x32')],'resourceId':_0x30e7c6['id'],'type':_0x3600b2[_0x44bf('0x32')],'sectionId':_0x3600b2['id']},{})[_0x44bf('0x28')](function(){return _0x13031b;});}else{return _0x13031b;}})[_0x44bf('0x50')](function(_0x200918){logger[_0x44bf('0x33')](_0x44bf('0x60'),_0x200918);throw _0x200918;});}return _0x13031b;})['then'](respondWithResult(_0x1b1ffd,0xc9))[_0x44bf('0x50')](handleError(_0x1b1ffd,null));};exports[_0x44bf('0x27')]=function(_0x57739a,_0x319b28){if(_0x57739a[_0x44bf('0x52')]['id']){delete _0x57739a[_0x44bf('0x52')]['id'];}return db[_0x44bf('0x37')][_0x44bf('0x31')]({'where':{'id':_0x57739a['params']['id']}})['then'](handleEntityNotFound(_0x319b28,null))[_0x44bf('0x28')](function(_0x3539a3){if(_0x3539a3){return db[_0x44bf('0x37')][_0x44bf('0x27')](_[_0x44bf('0x61')](_0x57739a[_0x44bf('0x52')],[_0x44bf('0x55'),_0x44bf('0x62'),_0x44bf('0x63'),_0x44bf('0x64'),_0x44bf('0x65'),'mandatoryDisposition',_0x44bf('0x66')]),{'where':{'context':_0x3539a3[_0x44bf('0x62')],'exten':_0x3539a3[_0x44bf('0x55')]},'individualHooks':!![]})[_0x44bf('0x28')](function(_0x3270aa){return _0x3270aa;});}return null;})[_0x44bf('0x28')](respondWithStatusCode(_0x319b28,null))['catch'](handleError(_0x319b28,null));};exports[_0x44bf('0x67')]=function(_0x121a47,_0x24ce4e){return db[_0x44bf('0x37')]['findOne']({'where':{'id':_0x121a47[_0x44bf('0x4d')]['id']}})[_0x44bf('0x28')](function(_0x3259af){if(_0x3259af){return db[_0x44bf('0x68')][_0x44bf('0x69')](function(_0x29ad2d){return db[_0x44bf('0x37')][_0x44bf('0x29')]({'where':{'VoiceExtensionId':_0x121a47['params']['id']},'transaction':_0x29ad2d})[_0x44bf('0x28')](function(){var _0x58e0a0=_['map'](_0x121a47[_0x44bf('0x52')],function(_0x2e0261){_0x2e0261['VoiceExtensionId']=_0x121a47['params']['id'];_0x2e0261[_0x44bf('0x6a')]=!![];return _0x2e0261;});var _0x45f772=_0x121a47[_0x44bf('0x3c')][_0x44bf('0x6b')]&&_0x121a47['query'][_0x44bf('0x6b')][_0x44bf('0x6c')]()===_0x44bf('0x6d')?!![]:![];return _0x3259af[_0x44bf('0x6e')](_0x58e0a0,_0x45f772);})['then'](function(_0xe633d3){return db[_0x44bf('0x37')][_0x44bf('0x6f')](_0xe633d3,{'transaction':_0x29ad2d});});})[_0x44bf('0x28')](function(){return db[_0x44bf('0x37')][_0x44bf('0x70')]({'where':{'isApp':!![],'VoiceExtensionId':_0x121a47[_0x44bf('0x4d')]['id']},'order':_0x44bf('0x71')});});}})['then'](respondWithResult(_0x24ce4e,null))[_0x44bf('0x50')](handleError(_0x24ce4e,null));}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index a06fc55..2b104e8 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 _0x219c=['hasOwnProperty','hook','exports','../../mysqldb','VoiceExtension','setMaxListeners','save','update','remove','emit'];(function(_0x4ced92,_0x3c8d70){var _0x2beb57=function(_0x5e4e39){while(--_0x5e4e39){_0x4ced92['push'](_0x4ced92['shift']());}};_0x2beb57(++_0x3c8d70);}(_0x219c,0x17f));var _0xc219=function(_0x353bef,_0x49fa1d){_0x353bef=_0x353bef-0x0;var _0x5c2da7=_0x219c[_0x353bef];return _0x5c2da7;};'use strict';var EventEmitter=require('events');var VoiceExtension=require(_0xc219('0x0'))['db'][_0xc219('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xc219('0x2')](0x0);var events={'afterCreate':_0xc219('0x3'),'afterUpdate':_0xc219('0x4'),'afterDestroy':_0xc219('0x5')};function emitEvent(_0x3a2ccc){return function(_0x38be2c,_0x1a5bfa,_0x2cc184){VoiceExtensionEvents[_0xc219('0x6')](_0x3a2ccc+':'+_0x38be2c['id'],_0x38be2c);VoiceExtensionEvents['emit'](_0x3a2ccc,_0x38be2c);_0x2cc184(null);};}for(var e in events){if(events[_0xc219('0x7')](e)){var event=events[e];VoiceExtension[_0xc219('0x8')](e,emitEvent(event));}}module[_0xc219('0x9')]=VoiceExtensionEvents; \ No newline at end of file +var _0xd006=['hook','exports','events','../../mysqldb','save','update','remove','emit'];(function(_0x56fd3d,_0x2ca892){var _0x2bd554=function(_0x55d692){while(--_0x55d692){_0x56fd3d['push'](_0x56fd3d['shift']());}};_0x2bd554(++_0x2ca892);}(_0xd006,0xd2));var _0x6d00=function(_0x3a8dc1,_0x2f03b8){_0x3a8dc1=_0x3a8dc1-0x0;var _0x4b3595=_0xd006[_0x3a8dc1];return _0x4b3595;};'use strict';var EventEmitter=require(_0x6d00('0x0'));var VoiceExtension=require(_0x6d00('0x1'))['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6d00('0x2'),'afterUpdate':_0x6d00('0x3'),'afterDestroy':_0x6d00('0x4')};function emitEvent(_0x8024c2){return function(_0x4f20f1,_0x5b6177,_0x30b872){VoiceExtensionEvents[_0x6d00('0x5')](_0x8024c2+':'+_0x4f20f1['id'],_0x4f20f1);VoiceExtensionEvents['emit'](_0x8024c2,_0x4f20f1);_0x30b872(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0x6d00('0x6')](e,emitEvent(event));}}module[_0x6d00('0x7')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 936a239..4c6c5ca 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 _0x4a1e=['appdata','priority','last','catch','voice_extensions','then','concat','Hangup','util','lodash','./voiceExtension.attributes','models','Set','CDR(type)=','type','context','exten','NoOp','CDR(routeAlias)=','alias','inbound','CDR(routeid)=','push','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','No\x20alias\x20set','CDR(destination)=','cutdigits','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','XCALLY-MOTION-ANSWER=0','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','trunk','timeout','options','url','split','length','name','param','phone','prefix','${EXTEN:','SIP','U(xcally-mixmonitor-context)','replace','join','isEmpty','Interval','findAll','interval','IntervalId','*,*,*,*','intervals','filter','toLowerCase','tag','CDR(tag)=','callerID','NoOp(No\x20number\x20available)','answer','playback','includes','app','appType','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice','GotoIfTime',',${EXTEN},','outboundDial'];(function(_0x2ba740,_0x62a305){var _0x358bda=function(_0x16cc07){while(--_0x16cc07){_0x2ba740['push'](_0x2ba740['shift']());}};_0x358bda(++_0x62a305);}(_0x4a1e,0x150));var _0xe4a1=function(_0x49fcfb,_0x504dec){_0x49fcfb=_0x49fcfb-0x0;var _0x964926=_0x4a1e[_0x49fcfb];return _0x964926;};'use strict';var util=require(_0xe4a1('0x0'));var _=require(_0xe4a1('0x1'));var attributes=require(_0xe4a1('0x2'));module['exports']=function(_0x45ea04){var _0x1db28c=_0x45ea04[_0xe4a1('0x3')];function _0x24e3ab(_0x28f648){var _0xe8b181=0x2;var _0x3bd8b0=[{'type':_0x28f648['type'],'app':_0xe4a1('0x4'),'appdata':_0xe4a1('0x5')+_0x28f648[_0xe4a1('0x6')],'context':_0x28f648[_0xe4a1('0x7')],'exten':_0x28f648[_0xe4a1('0x8')],'priority':_0xe8b181++,'VoiceExtensionId':_0x28f648['id']},{'type':_0x28f648[_0xe4a1('0x6')],'app':_0x28f648['alias']?_0xe4a1('0x4'):_0xe4a1('0x9'),'appdata':_0x28f648['alias']?_0xe4a1('0xa')+_0x28f648[_0xe4a1('0xb')]:'No\x20alias\x20set','context':_0x28f648[_0xe4a1('0x7')],'exten':_0x28f648[_0xe4a1('0x8')],'priority':_0xe8b181++,'VoiceExtensionId':_0x28f648['id']}];if(_0x28f648[_0xe4a1('0x6')]===_0xe4a1('0xc')){_0x3bd8b0['push']({'type':_0xe4a1('0xc'),'app':_0xe4a1('0x4'),'appdata':_0xe4a1('0xd')+_0x28f648['id'],'context':_0x28f648[_0xe4a1('0x7')],'exten':_0x28f648[_0xe4a1('0x8')],'priority':_0xe8b181++,'VoiceExtensionId':_0x28f648['id']});}_0x3bd8b0[_0xe4a1('0xe')]({'type':_0x28f648[_0xe4a1('0x6')],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=0','context':_0x28f648[_0xe4a1('0x7')],'exten':_0x28f648[_0xe4a1('0x8')],'priority':_0xe8b181++,'VoiceExtensionId':_0x28f648['id']},{'type':_0x28f648[_0xe4a1('0x6')],'app':_0xe4a1('0x4'),'appdata':_0xe4a1('0xf'),'context':_0x28f648[_0xe4a1('0x7')],'exten':_0x28f648[_0xe4a1('0x8')],'priority':_0xe8b181++,'VoiceExtensionId':_0x28f648['id']},{'type':_0x28f648[_0xe4a1('0x6')],'app':_0xe4a1('0x4'),'appdata':_0xe4a1('0x10'),'context':_0x28f648[_0xe4a1('0x7')],'exten':_0x28f648['exten'],'priority':_0xe8b181++,'VoiceExtensionId':_0x28f648['id']});return _0x3bd8b0;}function _0x129c89(_0x3f35b7){var _0x327742=0x2;var _0x3aa8c1=[{'type':'outbound','app':_0xe4a1('0x4'),'appdata':'CDR(type)=outbound','context':_0x3f35b7[_0xe4a1('0x7')],'exten':_0x3f35b7['exten'],'priority':_0x327742++,'VoiceExtensionId':_0x3f35b7['id']},{'type':_0xe4a1('0x11'),'app':_0x3f35b7[_0xe4a1('0xb')]?_0xe4a1('0x4'):_0xe4a1('0x9'),'appdata':_0x3f35b7['alias']?_0xe4a1('0xa')+_0x3f35b7['alias']:_0xe4a1('0x12'),'context':_0x3f35b7[_0xe4a1('0x7')],'exten':_0x3f35b7[_0xe4a1('0x8')],'priority':_0x327742++,'VoiceExtensionId':_0x3f35b7['id']},{'type':_0xe4a1('0x11'),'app':_0xe4a1('0x4'),'appdata':_0xe4a1('0x13')+(_0x3f35b7[_0xe4a1('0x14')]?'${EXTEN:'+_0x3f35b7['cutdigits']+'}':_0xe4a1('0x15')),'context':_0x3f35b7['context'],'exten':_0x3f35b7['exten'],'priority':_0x327742++,'VoiceExtensionId':_0x3f35b7['id']},{'type':_0xe4a1('0x11'),'app':_0xe4a1('0x4'),'appdata':_0xe4a1('0xd')+_0x3f35b7['id'],'context':_0x3f35b7[_0xe4a1('0x7')],'exten':_0x3f35b7['exten'],'priority':_0x327742++,'VoiceExtensionId':_0x3f35b7['id']},{'type':'outbound','app':_0xe4a1('0x16'),'appdata':_0xe4a1('0x17')+(_0x327742+0x2)+_0xe4a1('0x18')+(_0x327742+0x1)+')','context':_0x3f35b7[_0xe4a1('0x7')],'exten':_0x3f35b7['exten'],'priority':_0x327742++,'VoiceExtensionId':_0x3f35b7['id']},{'type':'outbound','app':'Set','appdata':_0x3f35b7[_0xe4a1('0x14')]?_0xe4a1('0x19')+_0x3f35b7['cutdigits']+'}':_0xe4a1('0x1a'),'context':_0x3f35b7[_0xe4a1('0x7')],'exten':_0x3f35b7[_0xe4a1('0x8')],'priority':_0x327742++,'VoiceExtensionId':_0x3f35b7['id']},{'type':_0xe4a1('0x11'),'app':_0xe4a1('0x4'),'appdata':_0xe4a1('0x1b'),'context':_0x3f35b7[_0xe4a1('0x7')],'exten':_0x3f35b7[_0xe4a1('0x8')],'priority':_0x327742++,'VoiceExtensionId':_0x3f35b7['id']},{'type':_0xe4a1('0x11'),'app':_0xe4a1('0x4'),'appdata':_0xe4a1('0xf'),'context':_0x3f35b7[_0xe4a1('0x7')],'exten':_0x3f35b7[_0xe4a1('0x8')],'priority':_0x327742++,'VoiceExtensionId':_0x3f35b7['id']},{'type':_0xe4a1('0x11'),'app':_0xe4a1('0x4'),'appdata':'MONITOR_OPTIONS=ab','context':_0x3f35b7[_0xe4a1('0x7')],'exten':_0x3f35b7[_0xe4a1('0x8')],'priority':_0x327742++,'VoiceExtensionId':_0x3f35b7['id']},{'type':_0xe4a1('0x11'),'app':_0xe4a1('0x4'),'appdata':_0xe4a1('0x1c')+_0x3f35b7['id'],'context':_0x3f35b7['context'],'exten':_0x3f35b7[_0xe4a1('0x8')],'priority':_0x327742++,'VoiceExtensionId':_0x3f35b7['id']}];if(_0x3f35b7[_0xe4a1('0x1d')](_0xe4a1('0x1e'))&&_0x3f35b7['recordingFormat']!==_0xe4a1('0x1f')){_0x3aa8c1[_0xe4a1('0xe')]({'type':_0xe4a1('0x11'),'app':_0xe4a1('0x4'),'appdata':_0xe4a1('0x20'),'context':_0x3f35b7['context'],'exten':_0x3f35b7['exten'],'priority':_0x327742++,'VoiceExtensionId':_0x3f35b7['id']},{'type':_0xe4a1('0x11'),'app':_0xe4a1('0x4'),'appdata':_0xe4a1('0x21')+_0x3f35b7[_0xe4a1('0x1e')]||'wav','context':_0x3f35b7[_0xe4a1('0x7')],'exten':_0x3f35b7['exten'],'priority':_0x327742++,'VoiceExtensionId':_0x3f35b7['id']});}return _0x3aa8c1;}function _0xa4da1d(_0x1b4909){var _0x5fa5f9=[{'name':_0xe4a1('0x22'),'param':0x0},{'name':_0xe4a1('0x23'),'param':0x1},{'name':_0xe4a1('0x24'),'param':0x2},{'name':_0xe4a1('0x25'),'param':0x3}];var _0x58d836={};var _0x4ca725=_0x1b4909[_0xe4a1('0x26')](',');var _0x156901=[];for(var _0x454186=0x0;_0x454186<_0x5fa5f9[_0xe4a1('0x27')];_0x454186++){switch(_0x5fa5f9[_0x454186][_0xe4a1('0x28')]){case'trunk':_0x58d836[_0xe4a1('0x22')]=_0x4ca725[_0x5fa5f9[_0x454186][_0xe4a1('0x29')]][_0xe4a1('0x26')]('/')[0x1];_0x58d836[_0xe4a1('0x2a')]=_0x4ca725[_0x5fa5f9[_0x454186][_0xe4a1('0x29')]][_0xe4a1('0x26')]('/')[0x2];_0x58d836[_0xe4a1('0x2b')]=_0x58d836[_0xe4a1('0x2a')]?_0x58d836[_0xe4a1('0x2a')][_0xe4a1('0x26')]('$')[0x0]:undefined;_0x58d836[_0xe4a1('0x2a')]=route[_0xe4a1('0x14')]?(_0x58d836[_0xe4a1('0x2b')]||'')+_0xe4a1('0x2c')+route[_0xe4a1('0x14')]+'}':(_0x58d836['prefix']||'')+_0xe4a1('0x15');_0x156901[_0x5fa5f9[_0x454186][_0xe4a1('0x29')]]=[_0xe4a1('0x2d'),_0x58d836[_0xe4a1('0x22')],_0x58d836[_0xe4a1('0x2a')]]['join']('/');break;case _0xe4a1('0x24'):_0x58d836['options']=_0x4ca725[_0x5fa5f9[_0x454186][_0xe4a1('0x29')]];if(route[_0xe4a1('0x1e')]!==_0xe4a1('0x1f')){if(_0x58d836[_0xe4a1('0x24')]['indexOf'](_0xe4a1('0x2e'))<0x0){_0x58d836[_0xe4a1('0x24')]+='U(xcally-mixmonitor-context)';}}else{_0x58d836['options']=_0x58d836[_0xe4a1('0x24')][_0xe4a1('0x2f')](_0xe4a1('0x2e'),'');}_0x156901[_0x5fa5f9[_0x454186]['param']]=_0x58d836[_0xe4a1('0x24')];break;default:_0x156901[_0x5fa5f9[_0x454186]['param']]=_0x4ca725[_0x5fa5f9[_0x454186][_0xe4a1('0x29')]];}}return _0x156901[_0xe4a1('0x30')](',');}function _0x4cb81e(_0x36426f,_0x141ced,_0x32daff,_0x2a491d){return new Promise(function(_0x4f56ef,_0x34c93f){var _0x51c0fe=[];if(_[_0xe4a1('0x31')](_0x141ced))return _0x4f56ef(_0x51c0fe);_0x1db28c[_0xe4a1('0x32')][_0xe4a1('0x33')]({'attributes':['id',_0xe4a1('0x34'),_0xe4a1('0x35')],'raw':!![]})['then'](function(_0x120958){for(var _0x36cd2a=0x0,_0x5e4b10=0x0;_0x36cd2a<_0x141ced[_0xe4a1('0x27')];_0x36cd2a++,_0x5e4b10=0x0){var _0x1f9b98=_0x141ced[_0x36cd2a];var _0x349fb5=[];var _0x399f98=[];if(_0x1f9b98[_0xe4a1('0x34')]!==_0xe4a1('0x36')){_0x1f9b98['intervals']=[_0x1f9b98[_0xe4a1('0x34')]];}else{_0x1f9b98[_0xe4a1('0x37')]=_0x1f9b98[_0xe4a1('0x35')]?_['map'](_[_0xe4a1('0x38')](_0x120958,{'IntervalId':_0x1f9b98[_0xe4a1('0x35')]}),_0xe4a1('0x34')):[];}_0x1f9b98[_0xe4a1('0x7')]=_0x36426f[_0xe4a1('0x7')];_0x1f9b98[_0xe4a1('0x8')]=_0x36426f[_0xe4a1('0x8')];if(_0x1f9b98[_0xe4a1('0x6')])_0x1f9b98[_0xe4a1('0x6')]=_0x1f9b98[_0xe4a1('0x6')][_0xe4a1('0x39')]();if(_0x36426f[_0xe4a1('0x6')]===_0xe4a1('0x11')){if(_0x1f9b98[_0xe4a1('0x1d')](_0xe4a1('0x3a'))&&_0x1f9b98[_0xe4a1('0x3a')]&&_0x1f9b98[_0xe4a1('0x3a')]!=='--'){_0x349fb5[_0xe4a1('0xe')]({'type':_0x1f9b98[_0xe4a1('0x6')][_0xe4a1('0x39')](),'app':_0xe4a1('0x4'),'appdata':_0xe4a1('0x3b')+_0x1f9b98[_0xe4a1('0x3a')],'context':_0x36426f[_0xe4a1('0x7')],'exten':_0x36426f[_0xe4a1('0x8')],'priority':_0x1f9b98[_0xe4a1('0x37')][_0xe4a1('0x27')]+_0x32daff+_0x5e4b10++,'VoiceExtensionId':_0x36426f['id']});}_0x349fb5[_0xe4a1('0xe')]({'type':_0x1f9b98[_0xe4a1('0x6')][_0xe4a1('0x39')](),'app':_0xe4a1('0x16'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0x1f9b98[_0xe4a1('0x3c')]?'Set(CALLERID(all)='+_0x1f9b98['callerID']+')':_0xe4a1('0x3d')),'context':_0x36426f[_0xe4a1('0x7')],'exten':_0x36426f['exten'],'priority':_0x1f9b98['intervals'][_0xe4a1('0x27')]+_0x32daff+_0x5e4b10++,'VoiceExtensionId':_0x36426f['id']});}else{if(_0x1f9b98['hasOwnProperty'](_0xe4a1('0x3e'))){if(['queue',_0xe4a1('0x3f')][_0xe4a1('0x40')](_0x1f9b98[_0xe4a1('0x41')][_0xe4a1('0x39')]())&&_0x1f9b98[_0xe4a1('0x42')]!=='custom'){if(_0x1f9b98['answer']){_0x349fb5[_0xe4a1('0xe')]({'type':_0x1f9b98[_0xe4a1('0x6')][_0xe4a1('0x39')](),'app':_0xe4a1('0x16'),'appdata':_0xe4a1('0x43'),'context':_0x36426f[_0xe4a1('0x7')],'exten':_0x36426f[_0xe4a1('0x8')],'priority':_0x1f9b98['intervals']['length']+_0x32daff+_0x5e4b10++,'VoiceExtensionId':_0x36426f['id']});_0x349fb5[_0xe4a1('0xe')]({'type':_0x1f9b98[_0xe4a1('0x6')][_0xe4a1('0x39')](),'app':'Set','appdata':_0xe4a1('0x44'),'context':_0x36426f[_0xe4a1('0x7')],'exten':_0x36426f['exten'],'priority':_0x1f9b98[_0xe4a1('0x37')][_0xe4a1('0x27')]+_0x32daff+_0x5e4b10++,'VoiceExtensionId':_0x36426f['id']});}else{_0x349fb5['push']({'type':_0x1f9b98['type'][_0xe4a1('0x39')](),'app':'ExecIf','appdata':_0xe4a1('0x45'),'context':_0x36426f['context'],'exten':_0x36426f[_0xe4a1('0x8')],'priority':_0x1f9b98['intervals']['length']+_0x32daff+_0x5e4b10++,'VoiceExtensionId':_0x36426f['id']});_0x349fb5[_0xe4a1('0xe')]({'type':_0x1f9b98[_0xe4a1('0x6')]['toLowerCase'](),'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x36426f[_0xe4a1('0x7')],'exten':_0x36426f['exten'],'priority':_0x1f9b98['intervals']['length']+_0x32daff+_0x5e4b10++,'VoiceExtensionId':_0x36426f['id']});}}}}for(var _0x2995d1=0x0;_0x2995d1<_0x1f9b98[_0xe4a1('0x37')][_0xe4a1('0x27')];_0x2995d1++){var _0x78445e=_0x32daff+_0x1f9b98['intervals']['length'];var _0x39158d=_0x2995d1===_0x1f9b98[_0xe4a1('0x37')][_0xe4a1('0x27')]-0x1?_0x32daff+_0x349fb5[_0xe4a1('0x27')]+_0x399f98['length']+0x2:_0x32daff+_0x2995d1+0x1;_0x349fb5[_0xe4a1('0x46')](_0x2995d1,0x0,{'type':_0x36426f[_0xe4a1('0x6')],'app':_0xe4a1('0x47'),'appdata':_0x1f9b98[_0xe4a1('0x37')][_0x2995d1]+'?'+_0x36426f['context']+_0xe4a1('0x48')+_0x78445e+':'+_0x36426f['context']+_0xe4a1('0x48')+_0x39158d,'exten':_0x36426f[_0xe4a1('0x8')],'context':_0x36426f[_0xe4a1('0x7')],'priority':_0x32daff+_0x2995d1,'VoiceExtensionId':_0x36426f['id']});}if(_0x2a491d&&_0x1f9b98['appType']===_0xe4a1('0x49'))_0x1f9b98['appdata']=_0xa4da1d(_0x1f9b98[_0xe4a1('0x4a')]);_0x1f9b98[_0xe4a1('0x4b')]=_0x349fb5[_0xe4a1('0x27')]?_[_0xe4a1('0x4c')](_0x349fb5)['priority']+0x1:_0x32daff;_0x51c0fe=_['concat'](_0x51c0fe,_0x349fb5,[_0x1f9b98],_0x399f98);_0x32daff=_[_0xe4a1('0x4c')](_0x51c0fe)[_0xe4a1('0x4b')]+0x1;}return _0x4f56ef(_0x51c0fe);})[_0xe4a1('0x4d')](function(_0x2e94a2){_0x34c93f(_0x2e94a2);});});}return _0x45ea04['define']('VoiceExtension',attributes,{'tableName':_0xe4a1('0x4e'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x401cfd,_0xf9b01a){var _0x39ad2f=this;var _0x5efa2f=_0x39ad2f[_0xe4a1('0x6')]===_0xe4a1('0x11')?_0x129c89(_0x39ad2f):_0x24e3ab(_0x39ad2f);return _0x4cb81e(_0x39ad2f,_0x401cfd,_['last'](_0x5efa2f)[_0xe4a1('0x4b')]+0x1,_0xf9b01a)[_0xe4a1('0x4f')](function(_0x3bbd01){var _0x3f6602=_[_0xe4a1('0x50')](_0x5efa2f,_0x3bbd01);_0x3f6602[_0xe4a1('0xe')]({'type':_0x39ad2f[_0xe4a1('0x6')],'app':_0xe4a1('0x51'),'exten':_0x39ad2f[_0xe4a1('0x8')],'context':_0x39ad2f[_0xe4a1('0x7')],'priority':_[_0xe4a1('0x4c')](_0x3f6602)['priority']+0x1,'VoiceExtensionId':_0x39ad2f['id']});return _0x3f6602;});}}});}; \ No newline at end of file +var _0xf447=['GotoIfTime',',${EXTEN},','appdata','priority','concat','last','catch','VoiceExtension','voice_extensions','util','lodash','./voiceExtension.attributes','type','Set','CDR(type)=','exten','alias','CDR(routeAlias)=','No\x20alias\x20set','inbound','CDR(routeid)=','context','push','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','CDR(destination)=','${EXTEN:','cutdigits','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','outboundrouteid=','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','options','url','length','name','param','split','prefix','phone','${EXTEN}','SIP','join','none','U(xcally-mixmonitor-context)','isEmpty','Interval','interval','IntervalId','then','intervals','map','tag','toLowerCase','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','NoOp(No\x20number\x20available)','hasOwnProperty','answer','playback','includes','app','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice'];(function(_0x425704,_0x50aa0c){var _0x542b3b=function(_0x27642a){while(--_0x27642a){_0x425704['push'](_0x425704['shift']());}};_0x542b3b(++_0x50aa0c);}(_0xf447,0xa1));var _0x7f44=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0xf447[_0x12fc8d];return _0x3f9d04;};'use strict';var util=require(_0x7f44('0x0'));var _=require(_0x7f44('0x1'));var attributes=require(_0x7f44('0x2'));module['exports']=function(_0x3fb5d7){var _0x221657=_0x3fb5d7['models'];function _0xb7b199(_0x529553){var _0x48d651=0x2;var _0x212aaf=[{'type':_0x529553[_0x7f44('0x3')],'app':_0x7f44('0x4'),'appdata':_0x7f44('0x5')+_0x529553[_0x7f44('0x3')],'context':_0x529553['context'],'exten':_0x529553[_0x7f44('0x6')],'priority':_0x48d651++,'VoiceExtensionId':_0x529553['id']},{'type':_0x529553[_0x7f44('0x3')],'app':_0x529553['alias']?'Set':'NoOp','appdata':_0x529553[_0x7f44('0x7')]?_0x7f44('0x8')+_0x529553[_0x7f44('0x7')]:_0x7f44('0x9'),'context':_0x529553['context'],'exten':_0x529553[_0x7f44('0x6')],'priority':_0x48d651++,'VoiceExtensionId':_0x529553['id']}];if(_0x529553[_0x7f44('0x3')]===_0x7f44('0xa')){_0x212aaf['push']({'type':_0x7f44('0xa'),'app':_0x7f44('0x4'),'appdata':_0x7f44('0xb')+_0x529553['id'],'context':_0x529553[_0x7f44('0xc')],'exten':_0x529553[_0x7f44('0x6')],'priority':_0x48d651++,'VoiceExtensionId':_0x529553['id']});}_0x212aaf[_0x7f44('0xd')]({'type':_0x529553['type'],'app':_0x7f44('0x4'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x529553[_0x7f44('0xc')],'exten':_0x529553['exten'],'priority':_0x48d651++,'VoiceExtensionId':_0x529553['id']},{'type':_0x529553[_0x7f44('0x3')],'app':_0x7f44('0x4'),'appdata':_0x7f44('0xe'),'context':_0x529553[_0x7f44('0xc')],'exten':_0x529553[_0x7f44('0x6')],'priority':_0x48d651++,'VoiceExtensionId':_0x529553['id']},{'type':_0x529553['type'],'app':_0x7f44('0x4'),'appdata':_0x7f44('0xf'),'context':_0x529553[_0x7f44('0xc')],'exten':_0x529553['exten'],'priority':_0x48d651++,'VoiceExtensionId':_0x529553['id']});return _0x212aaf;}function _0x1c152c(_0x484398){var _0x519f00=0x2;var _0x4c7fe5=[{'type':_0x7f44('0x10'),'app':_0x7f44('0x4'),'appdata':_0x7f44('0x11'),'context':_0x484398[_0x7f44('0xc')],'exten':_0x484398[_0x7f44('0x6')],'priority':_0x519f00++,'VoiceExtensionId':_0x484398['id']},{'type':_0x7f44('0x10'),'app':_0x484398[_0x7f44('0x7')]?'Set':'NoOp','appdata':_0x484398[_0x7f44('0x7')]?_0x7f44('0x8')+_0x484398[_0x7f44('0x7')]:'No\x20alias\x20set','context':_0x484398[_0x7f44('0xc')],'exten':_0x484398[_0x7f44('0x6')],'priority':_0x519f00++,'VoiceExtensionId':_0x484398['id']},{'type':_0x7f44('0x10'),'app':_0x7f44('0x4'),'appdata':_0x7f44('0x12')+(_0x484398['cutdigits']?_0x7f44('0x13')+_0x484398[_0x7f44('0x14')]+'}':'${EXTEN}'),'context':_0x484398[_0x7f44('0xc')],'exten':_0x484398[_0x7f44('0x6')],'priority':_0x519f00++,'VoiceExtensionId':_0x484398['id']},{'type':'outbound','app':_0x7f44('0x4'),'appdata':_0x7f44('0xb')+_0x484398['id'],'context':_0x484398[_0x7f44('0xc')],'exten':_0x484398['exten'],'priority':_0x519f00++,'VoiceExtensionId':_0x484398['id']},{'type':_0x7f44('0x10'),'app':_0x7f44('0x15'),'appdata':_0x7f44('0x16')+(_0x519f00+0x2)+_0x7f44('0x17')+(_0x519f00+0x1)+')','context':_0x484398[_0x7f44('0xc')],'exten':_0x484398[_0x7f44('0x6')],'priority':_0x519f00++,'VoiceExtensionId':_0x484398['id']},{'type':_0x7f44('0x10'),'app':_0x7f44('0x4'),'appdata':_0x484398[_0x7f44('0x14')]?'CDR(prefix)=${EXTEN:0:'+_0x484398['cutdigits']+'}':'CDR(prefix)=noprefix','context':_0x484398[_0x7f44('0xc')],'exten':_0x484398[_0x7f44('0x6')],'priority':_0x519f00++,'VoiceExtensionId':_0x484398['id']},{'type':_0x7f44('0x10'),'app':_0x7f44('0x4'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x484398[_0x7f44('0xc')],'exten':_0x484398['exten'],'priority':_0x519f00++,'VoiceExtensionId':_0x484398['id']},{'type':_0x7f44('0x10'),'app':'Set','appdata':_0x7f44('0xe'),'context':_0x484398['context'],'exten':_0x484398[_0x7f44('0x6')],'priority':_0x519f00++,'VoiceExtensionId':_0x484398['id']},{'type':_0x7f44('0x10'),'app':_0x7f44('0x4'),'appdata':'MONITOR_OPTIONS=ab','context':_0x484398['context'],'exten':_0x484398['exten'],'priority':_0x519f00++,'VoiceExtensionId':_0x484398['id']},{'type':_0x7f44('0x10'),'app':'Set','appdata':_0x7f44('0x18')+_0x484398['id'],'context':_0x484398[_0x7f44('0xc')],'exten':_0x484398['exten'],'priority':_0x519f00++,'VoiceExtensionId':_0x484398['id']}];if(_0x484398['hasOwnProperty'](_0x7f44('0x19'))&&_0x484398[_0x7f44('0x19')]!=='none'){_0x4c7fe5[_0x7f44('0xd')]({'type':_0x7f44('0x10'),'app':'Set','appdata':_0x7f44('0x1a'),'context':_0x484398[_0x7f44('0xc')],'exten':_0x484398[_0x7f44('0x6')],'priority':_0x519f00++,'VoiceExtensionId':_0x484398['id']},{'type':_0x7f44('0x10'),'app':_0x7f44('0x4'),'appdata':_0x7f44('0x1b')+_0x484398[_0x7f44('0x19')]||_0x7f44('0x1c'),'context':_0x484398['context'],'exten':_0x484398[_0x7f44('0x6')],'priority':_0x519f00++,'VoiceExtensionId':_0x484398['id']});}return _0x4c7fe5;}function _0x716b12(_0x493819){var _0x57fa5e=[{'name':_0x7f44('0x1d'),'param':0x0},{'name':'timeout','param':0x1},{'name':_0x7f44('0x1e'),'param':0x2},{'name':_0x7f44('0x1f'),'param':0x3}];var _0x59eb77={};var _0x7b808d=_0x493819['split'](',');var _0x14b15a=[];for(var _0x19d2bd=0x0;_0x19d2bd<_0x57fa5e[_0x7f44('0x20')];_0x19d2bd++){switch(_0x57fa5e[_0x19d2bd][_0x7f44('0x21')]){case'trunk':_0x59eb77[_0x7f44('0x1d')]=_0x7b808d[_0x57fa5e[_0x19d2bd][_0x7f44('0x22')]][_0x7f44('0x23')]('/')[0x1];_0x59eb77['phone']=_0x7b808d[_0x57fa5e[_0x19d2bd][_0x7f44('0x22')]]['split']('/')[0x2];_0x59eb77[_0x7f44('0x24')]=_0x59eb77[_0x7f44('0x25')]?_0x59eb77[_0x7f44('0x25')][_0x7f44('0x23')]('$')[0x0]:undefined;_0x59eb77[_0x7f44('0x25')]=route[_0x7f44('0x14')]?(_0x59eb77[_0x7f44('0x24')]||'')+'${EXTEN:'+route['cutdigits']+'}':(_0x59eb77[_0x7f44('0x24')]||'')+_0x7f44('0x26');_0x14b15a[_0x57fa5e[_0x19d2bd]['param']]=[_0x7f44('0x27'),_0x59eb77[_0x7f44('0x1d')],_0x59eb77[_0x7f44('0x25')]][_0x7f44('0x28')]('/');break;case _0x7f44('0x1e'):_0x59eb77[_0x7f44('0x1e')]=_0x7b808d[_0x57fa5e[_0x19d2bd][_0x7f44('0x22')]];if(route['recordingFormat']!==_0x7f44('0x29')){if(_0x59eb77['options']['indexOf'](_0x7f44('0x2a'))<0x0){_0x59eb77['options']+=_0x7f44('0x2a');}}else{_0x59eb77[_0x7f44('0x1e')]=_0x59eb77[_0x7f44('0x1e')]['replace'](_0x7f44('0x2a'),'');}_0x14b15a[_0x57fa5e[_0x19d2bd][_0x7f44('0x22')]]=_0x59eb77[_0x7f44('0x1e')];break;default:_0x14b15a[_0x57fa5e[_0x19d2bd]['param']]=_0x7b808d[_0x57fa5e[_0x19d2bd][_0x7f44('0x22')]];}}return _0x14b15a['join'](',');}function _0x40c9c5(_0x32988d,_0x5ae4e2,_0x4cf368,_0x1b8957){return new Promise(function(_0x41fc11,_0x92502e){var _0xf583a1=[];if(_[_0x7f44('0x2b')](_0x5ae4e2))return _0x41fc11(_0xf583a1);_0x221657[_0x7f44('0x2c')]['findAll']({'attributes':['id',_0x7f44('0x2d'),_0x7f44('0x2e')],'raw':!![]})[_0x7f44('0x2f')](function(_0x2933cf){for(var _0x1eaed0=0x0,_0x543df6=0x0;_0x1eaed0<_0x5ae4e2[_0x7f44('0x20')];_0x1eaed0++,_0x543df6=0x0){var _0x2db916=_0x5ae4e2[_0x1eaed0];var _0x42cca7=[];var _0x57756e=[];if(_0x2db916[_0x7f44('0x2d')]!=='*,*,*,*'){_0x2db916[_0x7f44('0x30')]=[_0x2db916[_0x7f44('0x2d')]];}else{_0x2db916['intervals']=_0x2db916[_0x7f44('0x2e')]?_[_0x7f44('0x31')](_['filter'](_0x2933cf,{'IntervalId':_0x2db916[_0x7f44('0x2e')]}),_0x7f44('0x2d')):[];}_0x2db916[_0x7f44('0xc')]=_0x32988d['context'];_0x2db916[_0x7f44('0x6')]=_0x32988d[_0x7f44('0x6')];if(_0x2db916[_0x7f44('0x3')])_0x2db916['type']=_0x2db916['type']['toLowerCase']();if(_0x32988d[_0x7f44('0x3')]===_0x7f44('0x10')){if(_0x2db916['hasOwnProperty']('tag')&&_0x2db916[_0x7f44('0x32')]&&_0x2db916['tag']!=='--'){_0x42cca7[_0x7f44('0xd')]({'type':_0x2db916[_0x7f44('0x3')][_0x7f44('0x33')](),'app':_0x7f44('0x4'),'appdata':_0x7f44('0x34')+_0x2db916[_0x7f44('0x32')],'context':_0x32988d[_0x7f44('0xc')],'exten':_0x32988d['exten'],'priority':_0x2db916[_0x7f44('0x30')][_0x7f44('0x20')]+_0x4cf368+_0x543df6++,'VoiceExtensionId':_0x32988d['id']});}_0x42cca7['push']({'type':_0x2db916['type']['toLowerCase'](),'app':_0x7f44('0x15'),'appdata':_0x7f44('0x35')+(_0x2db916[_0x7f44('0x36')]?'Set(CALLERID(all)='+_0x2db916[_0x7f44('0x36')]+')':_0x7f44('0x37')),'context':_0x32988d[_0x7f44('0xc')],'exten':_0x32988d[_0x7f44('0x6')],'priority':_0x2db916[_0x7f44('0x30')][_0x7f44('0x20')]+_0x4cf368+_0x543df6++,'VoiceExtensionId':_0x32988d['id']});}else{if(_0x2db916[_0x7f44('0x38')](_0x7f44('0x39'))){if(['queue',_0x7f44('0x3a')][_0x7f44('0x3b')](_0x2db916[_0x7f44('0x3c')][_0x7f44('0x33')]())&&_0x2db916['appType']!==_0x7f44('0x3d')){if(_0x2db916[_0x7f44('0x39')]){_0x42cca7['push']({'type':_0x2db916[_0x7f44('0x3')]['toLowerCase'](),'app':_0x7f44('0x15'),'appdata':_0x7f44('0x3e'),'context':_0x32988d[_0x7f44('0xc')],'exten':_0x32988d['exten'],'priority':_0x2db916['intervals'][_0x7f44('0x20')]+_0x4cf368+_0x543df6++,'VoiceExtensionId':_0x32988d['id']});_0x42cca7[_0x7f44('0xd')]({'type':_0x2db916[_0x7f44('0x3')][_0x7f44('0x33')](),'app':_0x7f44('0x4'),'appdata':_0x7f44('0x3f'),'context':_0x32988d[_0x7f44('0xc')],'exten':_0x32988d[_0x7f44('0x6')],'priority':_0x2db916[_0x7f44('0x30')][_0x7f44('0x20')]+_0x4cf368+_0x543df6++,'VoiceExtensionId':_0x32988d['id']});}else{_0x42cca7['push']({'type':_0x2db916[_0x7f44('0x3')]['toLowerCase'](),'app':_0x7f44('0x15'),'appdata':_0x7f44('0x40'),'context':_0x32988d['context'],'exten':_0x32988d[_0x7f44('0x6')],'priority':_0x2db916[_0x7f44('0x30')]['length']+_0x4cf368+_0x543df6++,'VoiceExtensionId':_0x32988d['id']});_0x42cca7[_0x7f44('0xd')]({'type':_0x2db916[_0x7f44('0x3')][_0x7f44('0x33')](),'app':'Set','appdata':_0x7f44('0x41'),'context':_0x32988d[_0x7f44('0xc')],'exten':_0x32988d['exten'],'priority':_0x2db916['intervals'][_0x7f44('0x20')]+_0x4cf368+_0x543df6++,'VoiceExtensionId':_0x32988d['id']});}}}}for(var _0x389698=0x0;_0x389698<_0x2db916[_0x7f44('0x30')][_0x7f44('0x20')];_0x389698++){var _0x2671b2=_0x4cf368+_0x2db916[_0x7f44('0x30')][_0x7f44('0x20')];var _0x194369=_0x389698===_0x2db916[_0x7f44('0x30')][_0x7f44('0x20')]-0x1?_0x4cf368+_0x42cca7[_0x7f44('0x20')]+_0x57756e[_0x7f44('0x20')]+0x2:_0x4cf368+_0x389698+0x1;_0x42cca7[_0x7f44('0x42')](_0x389698,0x0,{'type':_0x32988d[_0x7f44('0x3')],'app':_0x7f44('0x43'),'appdata':_0x2db916[_0x7f44('0x30')][_0x389698]+'?'+_0x32988d[_0x7f44('0xc')]+',${EXTEN},'+_0x2671b2+':'+_0x32988d['context']+_0x7f44('0x44')+_0x194369,'exten':_0x32988d['exten'],'context':_0x32988d[_0x7f44('0xc')],'priority':_0x4cf368+_0x389698,'VoiceExtensionId':_0x32988d['id']});}if(_0x1b8957&&_0x2db916['appType']==='outboundDial')_0x2db916[_0x7f44('0x45')]=_0x716b12(_0x2db916[_0x7f44('0x45')]);_0x2db916[_0x7f44('0x46')]=_0x42cca7[_0x7f44('0x20')]?_['last'](_0x42cca7)[_0x7f44('0x46')]+0x1:_0x4cf368;_0xf583a1=_[_0x7f44('0x47')](_0xf583a1,_0x42cca7,[_0x2db916],_0x57756e);_0x4cf368=_[_0x7f44('0x48')](_0xf583a1)['priority']+0x1;}return _0x41fc11(_0xf583a1);})[_0x7f44('0x49')](function(_0x31c452){_0x92502e(_0x31c452);});});}return _0x3fb5d7['define'](_0x7f44('0x4a'),attributes,{'tableName':_0x7f44('0x4b'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x2d8880,_0x50e9c9){var _0x5f3081=this;var _0x54adce=_0x5f3081['type']===_0x7f44('0x10')?_0x1c152c(_0x5f3081):_0xb7b199(_0x5f3081);return _0x40c9c5(_0x5f3081,_0x2d8880,_['last'](_0x54adce)['priority']+0x1,_0x50e9c9)[_0x7f44('0x2f')](function(_0x1ef245){var _0x16e4b7=_[_0x7f44('0x47')](_0x54adce,_0x1ef245);_0x16e4b7[_0x7f44('0xd')]({'type':_0x5f3081[_0x7f44('0x3')],'app':'Hangup','exten':_0x5f3081[_0x7f44('0x6')],'context':_0x5f3081[_0x7f44('0xc')],'priority':_[_0x7f44('0x48')](_0x16e4b7)[_0x7f44('0x46')]+0x1,'VoiceExtensionId':_0x5f3081['id']});return _0x16e4b7;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index f64eff3..f867601 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 _0xc92f=['then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','attributes','include','map','model','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','redis','socket.io-emitter','./voiceExtension.socket','request'];(function(_0x2063ef,_0x3fbc1b){var _0x2f69d8=function(_0x282672){while(--_0x282672){_0x2063ef['push'](_0x2063ef['shift']());}};_0x2f69d8(++_0x3fbc1b);}(_0xc92f,0xf3));var _0xfc92=function(_0x6dc196,_0x5b921c){_0x6dc196=_0x6dc196-0x0;var _0x2972dd=_0xc92f[_0x6dc196];return _0x2972dd;};'use strict';var _=require(_0xfc92('0x0'));var util=require(_0xfc92('0x1'));var moment=require('moment');var BPromise=require(_0xfc92('0x2'));var rs=require(_0xfc92('0x3'));var fs=require('fs');var Redis=require(_0xfc92('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xfc92('0x5'));var logger=require(_0xfc92('0x6'))(_0xfc92('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xfc92('0x8')]['http']({'port':0x232a});config[_0xfc92('0x9')]=_['defaults'](config[_0xfc92('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xfc92('0xa'))(new Redis(config[_0xfc92('0x9')]));require(_0xfc92('0xb'))['register'](socket);function respondWithRpcPromise(_0x18a53b,_0x379756,_0x213ed0){return new BPromise(function(_0x552eab,_0x66d993){return client[_0xfc92('0xc')](_0x18a53b,_0x213ed0)[_0xfc92('0xd')](function(_0x5dee97){logger[_0xfc92('0xe')](_0xfc92('0xf'),_0x379756,_0xfc92('0x10'));logger[_0xfc92('0x11')](_0xfc92('0x12'),_0x379756,_0xfc92('0x10'),JSON[_0xfc92('0x13')](_0x5dee97));if(_0x5dee97[_0xfc92('0x14')]){if(_0x5dee97['error']['code']===0x1f4){logger['error'](_0xfc92('0xf'),_0x379756,_0x5dee97[_0xfc92('0x14')]['message']);return _0x66d993(_0x5dee97[_0xfc92('0x14')][_0xfc92('0x15')]);}logger[_0xfc92('0x14')](_0xfc92('0xf'),_0x379756,_0x5dee97[_0xfc92('0x14')][_0xfc92('0x15')]);return _0x552eab(_0x5dee97['error'][_0xfc92('0x15')]);}else{logger[_0xfc92('0xe')](_0xfc92('0xf'),_0x379756,_0xfc92('0x10'));_0x552eab(_0x5dee97['result']['message']);}})[_0xfc92('0x16')](function(_0x328345){logger['error'](_0xfc92('0xf'),_0x379756,_0x328345);_0x66d993(_0x328345);});});}exports[_0xfc92('0x17')]=function(_0x597ea2){var _0x1f0b90=this;return new Promise(function(_0x5ec474,_0x376551){return db[_0xfc92('0x18')][_0xfc92('0x19')]({'raw':_0x597ea2[_0xfc92('0x1a')]?_0x597ea2[_0xfc92('0x1a')][_0xfc92('0x1b')]===undefined?!![]:![]:!![],'where':_0x597ea2['options']?_0x597ea2[_0xfc92('0x1a')]['where']||null:null,'attributes':_0x597ea2[_0xfc92('0x1a')]?_0x597ea2[_0xfc92('0x1a')][_0xfc92('0x1c')]||null:null,'limit':_0x597ea2['options']?_0x597ea2['options']['limit']||null:null,'include':_0x597ea2['options']?_0x597ea2[_0xfc92('0x1a')][_0xfc92('0x1d')]?_[_0xfc92('0x1e')](_0x597ea2[_0xfc92('0x1a')][_0xfc92('0x1d')],function(_0xa43f14){return{'model':db[_0xa43f14[_0xfc92('0x1f')]],'as':_0xa43f14['as'],'attributes':_0xa43f14[_0xfc92('0x1c')],'include':_0xa43f14['include']?_[_0xfc92('0x1e')](_0xa43f14[_0xfc92('0x1d')],function(_0x35cea1){return{'model':db[_0x35cea1['model']],'as':_0x35cea1['as'],'attributes':_0x35cea1[_0xfc92('0x1c')],'include':_0x35cea1[_0xfc92('0x1d')]?_['map'](_0x35cea1['include'],function(_0x25de92){return{'model':db[_0x25de92[_0xfc92('0x1f')]],'as':_0x25de92['as'],'attributes':_0x25de92['attributes']};}):[]};}):[]};}):[]:[]})[_0xfc92('0xd')](function(_0x4d62fe){logger[_0xfc92('0xe')](_0xfc92('0x17'),_0x597ea2);logger['debug'](_0xfc92('0x17'),_0x597ea2,JSON[_0xfc92('0x13')](_0x4d62fe));_0x5ec474(_0x4d62fe);})[_0xfc92('0x16')](function(_0x3adb82){logger[_0xfc92('0x14')](_0xfc92('0x17'),_0x3adb82[_0xfc92('0x15')],_0x597ea2);_0x376551(_0x1f0b90[_0xfc92('0x14')](0x1f4,_0x3adb82[_0xfc92('0x15')]));});});}; \ No newline at end of file +var _0xfd87=['options','raw','where','limit','include','model','attributes','map','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','register','request','info','VoiceExtension,\x20%s,\x20%s','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetVoiceExtension','VoiceExtension','findAll'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0xfd87,0x80));var _0x7fd8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfd87[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7fd8('0x0'));var util=require(_0x7fd8('0x1'));var moment=require(_0x7fd8('0x2'));var BPromise=require(_0x7fd8('0x3'));var rs=require(_0x7fd8('0x4'));var fs=require('fs');var Redis=require(_0x7fd8('0x5'));var db=require(_0x7fd8('0x6'))['db'];var utils=require(_0x7fd8('0x7'));var logger=require(_0x7fd8('0x8'))(_0x7fd8('0x9'));var config=require(_0x7fd8('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x7fd8('0xb')][_0x7fd8('0xc')]({'port':0x232a});config['redis']=_[_0x7fd8('0xd')](config[_0x7fd8('0xe')],{'host':_0x7fd8('0xf'),'port':0x18eb});var socket=require(_0x7fd8('0x10'))(new Redis(config[_0x7fd8('0xe')]));require('./voiceExtension.socket')[_0x7fd8('0x11')](socket);function respondWithRpcPromise(_0x18e3ea,_0x1b8863,_0x596d03){return new BPromise(function(_0x5486fc,_0x4948d0){return client[_0x7fd8('0x12')](_0x18e3ea,_0x596d03)['then'](function(_0x4749df){logger[_0x7fd8('0x13')](_0x7fd8('0x14'),_0x1b8863,'request\x20sent');logger[_0x7fd8('0x15')](_0x7fd8('0x16'),_0x1b8863,_0x7fd8('0x17'),JSON[_0x7fd8('0x18')](_0x4749df));if(_0x4749df[_0x7fd8('0x19')]){if(_0x4749df['error'][_0x7fd8('0x1a')]===0x1f4){logger[_0x7fd8('0x19')](_0x7fd8('0x14'),_0x1b8863,_0x4749df[_0x7fd8('0x19')][_0x7fd8('0x1b')]);return _0x4948d0(_0x4749df[_0x7fd8('0x19')][_0x7fd8('0x1b')]);}logger[_0x7fd8('0x19')](_0x7fd8('0x14'),_0x1b8863,_0x4749df[_0x7fd8('0x19')][_0x7fd8('0x1b')]);return _0x5486fc(_0x4749df['error']['message']);}else{logger['info'](_0x7fd8('0x14'),_0x1b8863,_0x7fd8('0x17'));_0x5486fc(_0x4749df['result'][_0x7fd8('0x1b')]);}})[_0x7fd8('0x1c')](function(_0x40b134){logger[_0x7fd8('0x19')](_0x7fd8('0x14'),_0x1b8863,_0x40b134);_0x4948d0(_0x40b134);});});}exports[_0x7fd8('0x1d')]=function(_0x2edf31){var _0x4539b6=this;return new Promise(function(_0x4b5d0a,_0x34bc09){return db[_0x7fd8('0x1e')][_0x7fd8('0x1f')]({'raw':_0x2edf31[_0x7fd8('0x20')]?_0x2edf31[_0x7fd8('0x20')][_0x7fd8('0x21')]===undefined?!![]:![]:!![],'where':_0x2edf31['options']?_0x2edf31[_0x7fd8('0x20')][_0x7fd8('0x22')]||null:null,'attributes':_0x2edf31[_0x7fd8('0x20')]?_0x2edf31[_0x7fd8('0x20')]['attributes']||null:null,'limit':_0x2edf31[_0x7fd8('0x20')]?_0x2edf31[_0x7fd8('0x20')][_0x7fd8('0x23')]||null:null,'include':_0x2edf31[_0x7fd8('0x20')]?_0x2edf31[_0x7fd8('0x20')]['include']?_['map'](_0x2edf31[_0x7fd8('0x20')][_0x7fd8('0x24')],function(_0xa273a7){return{'model':db[_0xa273a7[_0x7fd8('0x25')]],'as':_0xa273a7['as'],'attributes':_0xa273a7[_0x7fd8('0x26')],'include':_0xa273a7['include']?_[_0x7fd8('0x27')](_0xa273a7[_0x7fd8('0x24')],function(_0xda5f2a){return{'model':db[_0xda5f2a[_0x7fd8('0x25')]],'as':_0xda5f2a['as'],'attributes':_0xda5f2a[_0x7fd8('0x26')],'include':_0xda5f2a['include']?_['map'](_0xda5f2a[_0x7fd8('0x24')],function(_0x2bd721){return{'model':db[_0x2bd721[_0x7fd8('0x25')]],'as':_0x2bd721['as'],'attributes':_0x2bd721[_0x7fd8('0x26')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4fc63a){logger[_0x7fd8('0x13')]('GetVoiceExtension',_0x2edf31);logger[_0x7fd8('0x15')](_0x7fd8('0x1d'),_0x2edf31,JSON[_0x7fd8('0x18')](_0x4fc63a));_0x4b5d0a(_0x4fc63a);})['catch'](function(_0x28e28e){logger['error'](_0x7fd8('0x1d'),_0x28e28e[_0x7fd8('0x1b')],_0x2edf31);_0x34bc09(_0x4539b6[_0x7fd8('0x19')](0x1f4,_0x28e28e[_0x7fd8('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index cbb6741..71f0885 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 _0x326f=['update','emit','removeListener','register','length','./voiceExtension.events'];(function(_0x4b1b32,_0x9d0982){var _0x218dc1=function(_0x4d16f7){while(--_0x4d16f7){_0x4b1b32['push'](_0x4b1b32['shift']());}};_0x218dc1(++_0x9d0982);}(_0x326f,0xd1));var _0xf326=function(_0x48d669,_0x5a1b87){_0x48d669=_0x48d669-0x0;var _0xdaaaeb=_0x326f[_0x48d669];return _0xdaaaeb;};'use strict';var VoiceExtensionEvents=require(_0xf326('0x0'));var events=['save','remove',_0xf326('0x1')];function createListener(_0x330ddb,_0x22aabf){return function(_0x408257){_0x22aabf[_0xf326('0x2')](_0x330ddb,_0x408257);};}function removeListener(_0x120a26,_0x9445c6){return function(){VoiceExtensionEvents[_0xf326('0x3')](_0x120a26,_0x9445c6);};}exports[_0xf326('0x4')]=function(_0x3ace29){for(var _0x4c2249=0x0,_0x3c254d=events[_0xf326('0x5')];_0x4c2249<_0x3c254d;_0x4c2249++){var _0x165f95=events[_0x4c2249];var _0x1e7b8a=createListener('voiceExtension:'+_0x165f95,_0x3ace29);VoiceExtensionEvents['on'](_0x165f95,_0x1e7b8a);}}; \ No newline at end of file +var _0x814b=['removeListener','register','length','voiceExtension:','./voiceExtension.events','save','remove','update','emit'];(function(_0x427352,_0x1bce61){var _0x23e0e6=function(_0x2a42a9){while(--_0x2a42a9){_0x427352['push'](_0x427352['shift']());}};_0x23e0e6(++_0x1bce61);}(_0x814b,0x1a2));var _0xb814=function(_0xa5d9f9,_0x17c6bf){_0xa5d9f9=_0xa5d9f9-0x0;var _0x40e9f6=_0x814b[_0xa5d9f9];return _0x40e9f6;};'use strict';var VoiceExtensionEvents=require(_0xb814('0x0'));var events=[_0xb814('0x1'),_0xb814('0x2'),_0xb814('0x3')];function createListener(_0xfbb64b,_0x477725){return function(_0x4a98af){_0x477725[_0xb814('0x4')](_0xfbb64b,_0x4a98af);};}function removeListener(_0x3e1e9,_0x258866){return function(){VoiceExtensionEvents[_0xb814('0x5')](_0x3e1e9,_0x258866);};}exports[_0xb814('0x6')]=function(_0x322a70){for(var _0x53e507=0x0,_0x3b0829=events[_0xb814('0x7')];_0x53e507<_0x3b0829;_0x53e507++){var _0x5c8539=events[_0x53e507];var _0x271af9=createListener(_0xb814('0x8')+_0x5c8539,_0x322a70);VoiceExtensionEvents['on'](_0x5c8539,_0x271af9);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 2735dd6..ee16035 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 _0x6d11=['put','update','delete','destroy','multer','util','path','express','fs-extra','../../components/auth/service','./voiceMail.controller','get','isAuthenticated','index','/:id','getMessages','post'];(function(_0x2a6754,_0x277259){var _0x17feda=function(_0x5745be){while(--_0x5745be){_0x2a6754['push'](_0x2a6754['shift']());}};_0x17feda(++_0x277259);}(_0x6d11,0xbf));var _0x16d1=function(_0x1744d1,_0xb5208d){_0x1744d1=_0x1744d1-0x0;var _0x30b57d=_0x6d11[_0x1744d1];return _0x30b57d;};'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 +var _0x7b84=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','index','/:id','show','/:id/messages','getMessages','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x4dd108,_0x2a2c48){var _0x431884=function(_0x50d29c){while(--_0x50d29c){_0x4dd108['push'](_0x4dd108['shift']());}};_0x431884(++_0x2a2c48);}(_0x7b84,0x17c));var _0x47b8=function(_0x228c78,_0x125802){_0x228c78=_0x228c78-0x0;var _0x568cce=_0x7b84[_0x228c78];return _0x568cce;};'use strict';var multer=require(_0x47b8('0x0'));var util=require(_0x47b8('0x1'));var path=require(_0x47b8('0x2'));var timeout=require(_0x47b8('0x3'));var express=require(_0x47b8('0x4'));var router=express[_0x47b8('0x5')]();var fs_extra=require(_0x47b8('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x47b8('0x7'));var config=require(_0x47b8('0x8'));var controller=require(_0x47b8('0x9'));router[_0x47b8('0xa')]('/',auth[_0x47b8('0xb')](),controller[_0x47b8('0xc')]);router['get'](_0x47b8('0xd'),auth[_0x47b8('0xb')](),controller[_0x47b8('0xe')]);router[_0x47b8('0xa')](_0x47b8('0xf'),auth[_0x47b8('0xb')](),controller[_0x47b8('0x10')]);router[_0x47b8('0x11')]('/',auth[_0x47b8('0xb')](),controller[_0x47b8('0x12')]);router[_0x47b8('0x13')](_0x47b8('0xd'),auth[_0x47b8('0xb')](),controller[_0x47b8('0x14')]);router[_0x47b8('0x15')](_0x47b8('0xd'),auth[_0x47b8('0xb')](),controller[_0x47b8('0x16')]);module[_0x47b8('0x17')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index a41db20..8bc013c 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 _0xd553=['from-voicemail','contest_mailbox','email','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','getDataValue','fullname','mailbox','sequelize','exports','STRING'];(function(_0x37ee83,_0x331b5e){var _0x3aa1f4=function(_0x5ac27d){while(--_0x5ac27d){_0x37ee83['push'](_0x37ee83['shift']());}};_0x3aa1f4(++_0x331b5e);}(_0xd553,0x8d));var _0x3d55=function(_0x434804,_0x415f68){_0x434804=_0x434804-0x0;var _0x573fc8=_0xd553[_0x434804];return _0x573fc8;};'use strict';var Sequelize=require(_0x3d55('0x0'));module[_0x3d55('0x1')]={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x3d55('0x2')],'defaultValue':_0x3d55('0x3'),'unique':_0x3d55('0x4')},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':_0x3d55('0x4')},'password':{'type':Sequelize[_0x3d55('0x2')]},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x3d55('0x2')],'validate':{'isEmail':!![]},'set':function(_0xd103ad){this['setDataValue'](_0x3d55('0x5'),typeof _0xd103ad==='string'&&_0xd103ad[_0x3d55('0x6')]()?_0xd103ad[_0x3d55('0x6')]():null);}},'pager':{'type':Sequelize[_0x3d55('0x2')]},'tz':{'type':Sequelize[_0x3d55('0x2')],'defaultValue':_0x3d55('0x7')},'attach':{'type':Sequelize[_0x3d55('0x8')]('yes','no'),'defaultValue':_0x3d55('0x9'),'allowNull':![]},'saycid':{'type':Sequelize[_0x3d55('0x8')](_0x3d55('0x9'),'no'),'defaultValue':_0x3d55('0x9'),'allowNull':![]},'dialout':{'type':Sequelize[_0x3d55('0x2')]},'callback':{'type':Sequelize[_0x3d55('0x2')]},'review':{'type':Sequelize[_0x3d55('0x8')](_0x3d55('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0x3d55('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0x3d55('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x3d55('0x8')](_0x3d55('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x3d55('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x3d55('0x8')](_0x3d55('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x3d55('0x8')](_0x3d55('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x3d55('0x8')]('yes','no'),'defaultValue':_0x3d55('0x9'),'allowNull':![]},'forcename':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x3d55('0x8')](_0x3d55('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x3d55('0x8')]('yes','no'),'defaultValue':_0x3d55('0x9'),'allowNull':![]},'stamp':{'type':_0x3d55('0xb')},'emailsubject':{'type':Sequelize[_0x3d55('0x2')]},'emailbody':{'type':Sequelize[_0x3d55('0x2')]},'maxsecs':{'type':Sequelize[_0x3d55('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x3d55('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x3d55('0xd')](_0x3d55('0xe'))+'\x20-\x20'+this['getDataValue'](_0x3d55('0xf'));}}}; \ No newline at end of file +var _0xdbea=['exports','STRING','from-voicemail','contest_mailbox','setDataValue','email','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue'];(function(_0x2f27f8,_0x54b9fe){var _0x2174be=function(_0x39daa1){while(--_0x39daa1){_0x2f27f8['push'](_0x2f27f8['shift']());}};_0x2174be(++_0x54b9fe);}(_0xdbea,0x78));var _0xadbe=function(_0x3355c3,_0xdcbed3){_0x3355c3=_0x3355c3-0x0;var _0x5785c3=_0xdbea[_0x3355c3];return _0x5785c3;};'use strict';var Sequelize=require('sequelize');module[_0xadbe('0x0')]={'customer_id':{'type':Sequelize[_0xadbe('0x1')]},'context':{'type':Sequelize['STRING'],'defaultValue':_0xadbe('0x2'),'unique':_0xadbe('0x3')},'mailbox':{'type':Sequelize[_0xadbe('0x1')],'defaultValue':'','allowNull':![],'unique':_0xadbe('0x3')},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xadbe('0x1')],'validate':{'isEmail':!![]},'set':function(_0x3a38e9){this[_0xadbe('0x4')](_0xadbe('0x5'),typeof _0x3a38e9==='string'&&_0x3a38e9[_0xadbe('0x6')]()?_0x3a38e9[_0xadbe('0x6')]():null);}},'pager':{'type':Sequelize[_0xadbe('0x1')]},'tz':{'type':Sequelize[_0xadbe('0x1')],'defaultValue':_0xadbe('0x7')},'attach':{'type':Sequelize[_0xadbe('0x8')](_0xadbe('0x9'),'no'),'defaultValue':_0xadbe('0x9'),'allowNull':![]},'saycid':{'type':Sequelize[_0xadbe('0x8')](_0xadbe('0x9'),'no'),'defaultValue':_0xadbe('0x9'),'allowNull':![]},'dialout':{'type':Sequelize[_0xadbe('0x1')]},'callback':{'type':Sequelize[_0xadbe('0x1')]},'review':{'type':Sequelize['ENUM'](_0xadbe('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xadbe('0x8')](_0xadbe('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xadbe('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xadbe('0x8')](_0xadbe('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xadbe('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xadbe('0x8')](_0xadbe('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xadbe('0x8')](_0xadbe('0x9'),'no'),'defaultValue':_0xadbe('0x9'),'allowNull':![]},'forcename':{'type':Sequelize[_0xadbe('0x8')](_0xadbe('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM'](_0xadbe('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xadbe('0x8')]('yes','no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0xadbe('0xb')},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize[_0xadbe('0x1')]},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xadbe('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xadbe('0xd')],'get':function(){return this[_0xadbe('0xe')]('fullname')+'\x20-\x20'+this[_0xadbe('0xe')]('mailbox');}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 8bc8bf8..53f8316 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 _0xbee3=['map','fieldName','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','type','VIRTUAL','options','VoiceMail','includeAll','include','findAll','rows','catch','rawAttributes','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','findOne','nolimit','order','mailbox','findAndCountAll','rimraf','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','end','error','stack','name','send','index'];(function(_0x691d5a,_0x85170f){var _0x3ab17b=function(_0x46f9c6){while(--_0x46f9c6){_0x691d5a['push'](_0x691d5a['shift']());}};_0x3ab17b(++_0x85170f);}(_0xbee3,0xd5));var _0x3bee=function(_0x4215d3,_0x5b5586){_0x4215d3=_0x4215d3-0x0;var _0x29873e=_0xbee3[_0x4215d3];return _0x29873e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3bee('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3bee('0x1'));var moment=require(_0x3bee('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x3bee('0x3'));var util=require(_0x3bee('0x4'));var path=require(_0x3bee('0x5'));var sox=require('sox');var csv=require(_0x3bee('0x6'));var ejs=require(_0x3bee('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3bee('0x8'));var squel=require(_0x3bee('0x9'));var crypto=require(_0x3bee('0xa'));var jsforce=require(_0x3bee('0xb'));var deskjs=require(_0x3bee('0xc'));var toCsv=require(_0x3bee('0x6'));var querystring=require(_0x3bee('0xd'));var Papa=require('papaparse');var Redis=require(_0x3bee('0xe'));var authService=require(_0x3bee('0xf'));var qs=require(_0x3bee('0x10'));var as=require(_0x3bee('0x11'));var hardwareService=require(_0x3bee('0x12'));var logger=require(_0x3bee('0x13'))('api');var utils=require(_0x3bee('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x3bee('0x15'));var db=require(_0x3bee('0x16'))['db'];function respondWithStatusCode(_0x407526,_0x6950d0){_0x6950d0=_0x6950d0||0xcc;return function(_0x410124){if(_0x410124){return _0x407526[_0x3bee('0x17')](_0x6950d0);}return _0x407526[_0x3bee('0x18')](_0x6950d0)['end']();};}function respondWithResult(_0xad01f9,_0x33504d){_0x33504d=_0x33504d||0xc8;return function(_0x31ac52){if(_0x31ac52){return _0xad01f9[_0x3bee('0x18')](_0x33504d)[_0x3bee('0x19')](_0x31ac52);}};}function respondWithFilteredResult(_0x5b9473,_0x558436){return function(_0x346767){if(_0x346767){var _0x515397=typeof _0x558436[_0x3bee('0x1a')]===_0x3bee('0x1b')&&typeof _0x558436['limit']==='undefined';var _0x1582a4=_0x346767[_0x3bee('0x1c')];var _0xfdba3b=_0x515397?0x0:_0x558436[_0x3bee('0x1a')];var _0x49095a=_0x515397?_0x346767[_0x3bee('0x1c')]:_0x558436[_0x3bee('0x1a')]+_0x558436[_0x3bee('0x1d')];var _0x49b32d;if(_0x49095a>=_0x1582a4){_0x49095a=_0x1582a4;_0x49b32d=0xc8;}else{_0x49b32d=0xce;}_0x5b9473[_0x3bee('0x18')](_0x49b32d);return _0x5b9473[_0x3bee('0x1e')](_0x3bee('0x1f'),_0xfdba3b+'-'+_0x49095a+'/'+_0x1582a4)['json'](_0x346767);}return null;};}function patchUpdates(_0x4f36af){return function(_0x1afd0f){try{jsonpatch[_0x3bee('0x20')](_0x1afd0f,_0x4f36af,!![]);}catch(_0x57aba4){return BPromise[_0x3bee('0x21')](_0x57aba4);}return _0x1afd0f[_0x3bee('0x22')]();};}function saveUpdates(_0x2eea75,_0x179e62){return function(_0x28c248){if(_0x28c248){return _0x28c248[_0x3bee('0x23')](_0x2eea75)[_0x3bee('0x24')](function(_0x582fa9){return _0x582fa9;});}return null;};}function removeEntity(_0x8ae4ca,_0x1ed0c1){return function(_0x1fed5a){if(_0x1fed5a){return _0x1fed5a[_0x3bee('0x25')]()['then'](function(){var _0x45249c=_0x1fed5a[_0x3bee('0x26')]({'plain':!![]});var _0x1e0111='Voicemails';return db['UserProfileResource'][_0x3bee('0x25')]({'where':{'type':_0x1e0111,'resourceId':_0x45249c['id']}})[_0x3bee('0x24')](function(){return _0x1fed5a;});})['then'](function(){_0x8ae4ca[_0x3bee('0x18')](0xcc)[_0x3bee('0x27')]();});}};}function handleEntityNotFound(_0x2e666a,_0x5b1eec){return function(_0x1984c4){if(!_0x1984c4){_0x2e666a[_0x3bee('0x17')](0x194);}return _0x1984c4;};}function handleError(_0x150766,_0x4f2066){_0x4f2066=_0x4f2066||0x1f4;return function(_0x239fa4){logger[_0x3bee('0x28')](_0x239fa4[_0x3bee('0x29')]);if(_0x239fa4['name']){delete _0x239fa4[_0x3bee('0x2a')];}_0x150766[_0x3bee('0x18')](_0x4f2066)[_0x3bee('0x2b')](_0x239fa4);};}exports[_0x3bee('0x2c')]=function(_0x3433aa,_0x559c2b){var _0x564e45={},_0x3fbc8c={},_0x1e1529={'count':0x0,'rows':[]};var _0x10bae0=_[_0x3bee('0x2d')](db['VoiceMail']['rawAttributes'],function(_0x38f93c){return{'name':_0x38f93c[_0x3bee('0x2e')],'type':_0x38f93c['type']['key']};});_0x3fbc8c[_0x3bee('0x2f')]=_[_0x3bee('0x2d')](_0x10bae0,_0x3bee('0x2a'));_0x3fbc8c[_0x3bee('0x30')]=_[_0x3bee('0x31')](_0x3433aa[_0x3bee('0x30')]);_0x3fbc8c[_0x3bee('0x32')]=_[_0x3bee('0x33')](_0x3fbc8c[_0x3bee('0x2f')],_0x3fbc8c[_0x3bee('0x30')]);_0x564e45['attributes']=_['intersection'](_0x3fbc8c[_0x3bee('0x2f')],qs['fields'](_0x3433aa['query'][_0x3bee('0x34')]));_0x564e45[_0x3bee('0x35')]=_0x564e45[_0x3bee('0x35')][_0x3bee('0x36')]?_0x564e45[_0x3bee('0x35')]:_0x3fbc8c[_0x3bee('0x2f')];if(!_0x3433aa[_0x3bee('0x30')][_0x3bee('0x37')]('nolimit')){_0x564e45[_0x3bee('0x1d')]=qs[_0x3bee('0x1d')](_0x3433aa['query'][_0x3bee('0x1d')]);_0x564e45[_0x3bee('0x1a')]=qs[_0x3bee('0x1a')](_0x3433aa[_0x3bee('0x30')][_0x3bee('0x1a')]);}_0x564e45['order']=qs['sort'](_0x3433aa[_0x3bee('0x30')][_0x3bee('0x38')]);_0x564e45[_0x3bee('0x39')]=qs[_0x3bee('0x32')](_[_0x3bee('0x3a')](_0x3433aa[_0x3bee('0x30')],_0x3fbc8c[_0x3bee('0x32')]),_0x10bae0);if(_0x3433aa[_0x3bee('0x30')][_0x3bee('0x3b')]){_0x564e45[_0x3bee('0x39')]=_[_0x3bee('0x3c')](_0x564e45[_0x3bee('0x39')],{'$or':_['map'](_0x10bae0,function(_0xaceed4){if(_0xaceed4[_0x3bee('0x3d')]!==_0x3bee('0x3e')){var _0x45cf81={};_0x45cf81[_0xaceed4[_0x3bee('0x2a')]]={'$like':'%'+_0x3433aa[_0x3bee('0x30')][_0x3bee('0x3b')]+'%'};return _0x45cf81;}})});}_0x564e45=_[_0x3bee('0x3c')]({},_0x564e45,_0x3433aa[_0x3bee('0x3f')]);var _0x12ba6f={'where':_0x564e45[_0x3bee('0x39')]};return db[_0x3bee('0x40')][_0x3bee('0x1c')](_0x12ba6f)['then'](function(_0x2b773d){_0x1e1529[_0x3bee('0x1c')]=_0x2b773d;if(_0x3433aa[_0x3bee('0x30')][_0x3bee('0x41')]){_0x564e45[_0x3bee('0x42')]=[{'all':!![]}];}return db[_0x3bee('0x40')][_0x3bee('0x43')](_0x564e45);})[_0x3bee('0x24')](function(_0x5d9e1b){_0x1e1529[_0x3bee('0x44')]=_0x5d9e1b;return _0x1e1529;})[_0x3bee('0x24')](respondWithFilteredResult(_0x559c2b,_0x564e45))[_0x3bee('0x45')](handleError(_0x559c2b,null));};exports['show']=function(_0x4567f2,_0x57113b){var _0x2b1677={'raw':!![],'where':{'id':_0x4567f2['params']['id']}},_0x48325e={};_0x48325e[_0x3bee('0x2f')]=_[_0x3bee('0x31')](db[_0x3bee('0x40')][_0x3bee('0x46')]);_0x48325e[_0x3bee('0x30')]=_['keys'](_0x4567f2['query']);_0x48325e[_0x3bee('0x32')]=_['intersection'](_0x48325e[_0x3bee('0x2f')],_0x48325e['query']);_0x2b1677[_0x3bee('0x35')]=_['intersection'](_0x48325e[_0x3bee('0x2f')],qs[_0x3bee('0x34')](_0x4567f2[_0x3bee('0x30')][_0x3bee('0x34')]));_0x2b1677['attributes']=_0x2b1677['attributes'][_0x3bee('0x36')]?_0x2b1677['attributes']:_0x48325e['model'];if(_0x4567f2['query'][_0x3bee('0x41')]){_0x2b1677['include']=[{'all':!![]}];}_0x2b1677=_[_0x3bee('0x3c')]({},_0x2b1677,_0x4567f2[_0x3bee('0x3f')]);return db[_0x3bee('0x40')]['find'](_0x2b1677)[_0x3bee('0x24')](handleEntityNotFound(_0x57113b,null))['then'](respondWithResult(_0x57113b,null))[_0x3bee('0x45')](handleError(_0x57113b,null));};exports['create']=function(_0x26ccd7,_0x16b096){return db[_0x3bee('0x40')]['create'](_0x26ccd7[_0x3bee('0x47')],{})[_0x3bee('0x24')](function(_0x477de2){var _0x504382=_0x26ccd7['user'][_0x3bee('0x26')]({'plain':!![]});if(!_0x504382)throw new Error(_0x3bee('0x48'));if(_0x504382[_0x3bee('0x49')]===_0x3bee('0x4a')){var _0x3b5d7a=_0x477de2[_0x3bee('0x26')]({'plain':!![]});var _0x4005a3='Voicemails';return db[_0x3bee('0x4b')][_0x3bee('0x4c')]({'where':{'name':_0x4005a3,'userProfileId':_0x504382['userProfileId']},'raw':!![]})['then'](function(_0x3730c5){if(_0x3730c5&&_0x3730c5['autoAssociation']===0x0){return db[_0x3bee('0x4d')][_0x3bee('0x4e')]({'name':_0x3b5d7a[_0x3bee('0x2a')],'resourceId':_0x3b5d7a['id'],'type':_0x3730c5['name'],'sectionId':_0x3730c5['id']},{})[_0x3bee('0x24')](function(){return _0x477de2;});}else{return _0x477de2;}})[_0x3bee('0x45')](function(_0x127cb8){logger['error'](_0x3bee('0x4f'),_0x127cb8);throw _0x127cb8;});}return _0x477de2;})[_0x3bee('0x24')](respondWithResult(_0x16b096,0xc9))['catch'](handleError(_0x16b096,null));};exports[_0x3bee('0x23')]=function(_0x14940e,_0x53c881){if(_0x14940e[_0x3bee('0x47')]['id']){delete _0x14940e[_0x3bee('0x47')]['id'];}return db[_0x3bee('0x40')][_0x3bee('0x4c')]({'where':{'id':_0x14940e[_0x3bee('0x50')]['id']}})[_0x3bee('0x24')](handleEntityNotFound(_0x53c881,null))[_0x3bee('0x24')](saveUpdates(_0x14940e[_0x3bee('0x47')],null))['then'](respondWithResult(_0x53c881,null))['catch'](handleError(_0x53c881,null));};exports[_0x3bee('0x25')]=function(_0x5e13e8,_0x38b82a){return db[_0x3bee('0x40')][_0x3bee('0x4c')]({'where':{'id':_0x5e13e8['params']['id']}})[_0x3bee('0x24')](handleEntityNotFound(_0x38b82a,null))[_0x3bee('0x24')](removeEntity(_0x38b82a,null))[_0x3bee('0x45')](handleError(_0x38b82a,null));};exports['getMessages']=function(_0x19cbb8,_0x52a327,_0x3cb900){return db[_0x3bee('0x40')][_0x3bee('0x51')]({'where':{'id':_0x19cbb8['params']['id']}})[_0x3bee('0x24')](handleEntityNotFound(_0x52a327,null))[_0x3bee('0x24')](function(_0x282300){var _0x526551;var _0x5d95a7={},_0xb9f53e={};_0xb9f53e[_0x3bee('0x2f')]=_[_0x3bee('0x31')](db['VoiceMailMessage']['rawAttributes']);_0xb9f53e[_0x3bee('0x30')]=_['keys'](_0x19cbb8['query']);_0xb9f53e[_0x3bee('0x32')]=_[_0x3bee('0x33')](_0xb9f53e[_0x3bee('0x2f')],_0xb9f53e['query']);_0x5d95a7['attributes']=_[_0x3bee('0x33')](_0xb9f53e[_0x3bee('0x2f')],qs['fields'](_0x19cbb8[_0x3bee('0x30')]['fields']));_0x5d95a7[_0x3bee('0x35')]=_0x5d95a7[_0x3bee('0x35')][_0x3bee('0x36')]?_0x5d95a7[_0x3bee('0x35')]:_0xb9f53e[_0x3bee('0x2f')];if(!_0x19cbb8[_0x3bee('0x30')][_0x3bee('0x37')](_0x3bee('0x52'))){_0x5d95a7[_0x3bee('0x1d')]=qs[_0x3bee('0x1d')](_0x19cbb8[_0x3bee('0x30')]['limit']);_0x5d95a7['offset']=qs['offset'](_0x19cbb8[_0x3bee('0x30')][_0x3bee('0x1a')]);}_0x5d95a7[_0x3bee('0x53')]=qs[_0x3bee('0x38')](_0x19cbb8['query'][_0x3bee('0x38')]);_0x5d95a7[_0x3bee('0x39')]=qs['filters'](_['pick'](_0x19cbb8[_0x3bee('0x30')],_0xb9f53e[_0x3bee('0x32')]));if(_0x19cbb8[_0x3bee('0x30')]['filter']){_0x5d95a7[_0x3bee('0x39')]=_[_0x3bee('0x3c')](_0x5d95a7[_0x3bee('0x39')],{'$or':_['map'](_0x5d95a7[_0x3bee('0x35')],function(_0x412e0d){var _0x1bfb3a={};_0x1bfb3a[_0x412e0d]={'$like':'%'+_0x19cbb8[_0x3bee('0x30')]['filter']+'%'};return _0x1bfb3a;})});}_0x5d95a7['where']=_[_0x3bee('0x3c')](_0x5d95a7[_0x3bee('0x39')],{'mailboxuser':_0x282300[_0x3bee('0x54')]});_0x5d95a7=_[_0x3bee('0x3c')]({},_0x5d95a7,_0x19cbb8[_0x3bee('0x3f')]);return db['VoiceMailMessage'][_0x3bee('0x55')](_0x5d95a7)['then'](respondWithFilteredResult(_0x52a327,_0x5d95a7));})[_0x3bee('0x45')](handleError(_0x52a327,null));}; \ No newline at end of file +var _0xeffd=['create','body','user','get','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMessages','findOne','VoiceMailMessage','nolimit','order','pick','mailbox','findAndCountAll','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','limit','set','Content-Range','json','reject','update','then','destroy','Voicemails','UserProfileResource','error','stack','name','send','index','map','VoiceMail','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','filter','type','merge','count','includeAll','include','findAll','catch','show','params','rawAttributes','options','find'];(function(_0x2e4374,_0x1255b7){var _0x2749aa=function(_0x30a652){while(--_0x30a652){_0x2e4374['push'](_0x2e4374['shift']());}};_0x2749aa(++_0x1255b7);}(_0xeffd,0x6b));var _0xdeff=function(_0x37c45c,_0x1cde02){_0x37c45c=_0x37c45c-0x0;var _0x53ece5=_0xeffd[_0x37c45c];return _0x53ece5;};'use strict';var emlformat=require(_0xdeff('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdeff('0x1'));var jsonpatch=require(_0xdeff('0x2'));var rp=require(_0xdeff('0x3'));var moment=require(_0xdeff('0x4'));var BPromise=require(_0xdeff('0x5'));var Mustache=require(_0xdeff('0x6'));var util=require(_0xdeff('0x7'));var path=require(_0xdeff('0x8'));var sox=require(_0xdeff('0x9'));var csv=require(_0xdeff('0xa'));var ejs=require(_0xdeff('0xb'));var fs=require('fs');var fs_extra=require(_0xdeff('0xc'));var _=require(_0xdeff('0xd'));var squel=require(_0xdeff('0xe'));var crypto=require(_0xdeff('0xf'));var jsforce=require(_0xdeff('0x10'));var deskjs=require(_0xdeff('0x11'));var toCsv=require('to-csv');var querystring=require(_0xdeff('0x12'));var Papa=require(_0xdeff('0x13'));var Redis=require(_0xdeff('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xdeff('0x15'));var as=require(_0xdeff('0x16'));var hardwareService=require(_0xdeff('0x17'));var logger=require(_0xdeff('0x18'))(_0xdeff('0x19'));var utils=require(_0xdeff('0x1a'));var config=require(_0xdeff('0x1b'));var licenseUtil=require(_0xdeff('0x1c'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x461699,_0x116bf9){_0x116bf9=_0x116bf9||0xcc;return function(_0x4952f2){if(_0x4952f2){return _0x461699[_0xdeff('0x1d')](_0x116bf9);}return _0x461699['status'](_0x116bf9)['end']();};}function respondWithResult(_0x3e56a1,_0x47410f){_0x47410f=_0x47410f||0xc8;return function(_0x1585e8){if(_0x1585e8){return _0x3e56a1[_0xdeff('0x1e')](_0x47410f)['json'](_0x1585e8);}};}function respondWithFilteredResult(_0x826132,_0x314ded){return function(_0xea6c4){if(_0xea6c4){var _0x391633=typeof _0x314ded[_0xdeff('0x1f')]===_0xdeff('0x20')&&typeof _0x314ded['limit']==='undefined';var _0x7440af=_0xea6c4['count'];var _0x5c9837=_0x391633?0x0:_0x314ded[_0xdeff('0x1f')];var _0x369e13=_0x391633?_0xea6c4['count']:_0x314ded[_0xdeff('0x1f')]+_0x314ded[_0xdeff('0x21')];var _0x1ab1fa;if(_0x369e13>=_0x7440af){_0x369e13=_0x7440af;_0x1ab1fa=0xc8;}else{_0x1ab1fa=0xce;}_0x826132[_0xdeff('0x1e')](_0x1ab1fa);return _0x826132[_0xdeff('0x22')](_0xdeff('0x23'),_0x5c9837+'-'+_0x369e13+'/'+_0x7440af)[_0xdeff('0x24')](_0xea6c4);}return null;};}function patchUpdates(_0x919c93){return function(_0x488faa){try{jsonpatch['apply'](_0x488faa,_0x919c93,!![]);}catch(_0x56cb84){return BPromise[_0xdeff('0x25')](_0x56cb84);}return _0x488faa['save']();};}function saveUpdates(_0x189627,_0x91c0b4){return function(_0x543653){if(_0x543653){return _0x543653[_0xdeff('0x26')](_0x189627)[_0xdeff('0x27')](function(_0x4eb2a8){return _0x4eb2a8;});}return null;};}function removeEntity(_0x5dbe96,_0x3b2554){return function(_0x15c425){if(_0x15c425){return _0x15c425[_0xdeff('0x28')]()[_0xdeff('0x27')](function(){var _0x32add9=_0x15c425['get']({'plain':!![]});var _0xb08f19=_0xdeff('0x29');return db[_0xdeff('0x2a')][_0xdeff('0x28')]({'where':{'type':_0xb08f19,'resourceId':_0x32add9['id']}})[_0xdeff('0x27')](function(){return _0x15c425;});})[_0xdeff('0x27')](function(){_0x5dbe96[_0xdeff('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x31bb72,_0x1a546c){return function(_0x53b168){if(!_0x53b168){_0x31bb72['sendStatus'](0x194);}return _0x53b168;};}function handleError(_0x830be4,_0x2ea8e9){_0x2ea8e9=_0x2ea8e9||0x1f4;return function(_0x16b2d0){logger[_0xdeff('0x2b')](_0x16b2d0[_0xdeff('0x2c')]);if(_0x16b2d0[_0xdeff('0x2d')]){delete _0x16b2d0[_0xdeff('0x2d')];}_0x830be4['status'](_0x2ea8e9)[_0xdeff('0x2e')](_0x16b2d0);};}exports[_0xdeff('0x2f')]=function(_0x34e258,_0x5045b8){var _0x59f7a0={},_0x346743={},_0x505e3f={'count':0x0,'rows':[]};var _0x69842a=_[_0xdeff('0x30')](db[_0xdeff('0x31')]['rawAttributes'],function(_0x189a51){return{'name':_0x189a51['fieldName'],'type':_0x189a51['type'][_0xdeff('0x32')]};});_0x346743[_0xdeff('0x33')]=_[_0xdeff('0x30')](_0x69842a,_0xdeff('0x2d'));_0x346743['query']=_[_0xdeff('0x34')](_0x34e258[_0xdeff('0x35')]);_0x346743[_0xdeff('0x36')]=_[_0xdeff('0x37')](_0x346743[_0xdeff('0x33')],_0x346743[_0xdeff('0x35')]);_0x59f7a0[_0xdeff('0x38')]=_['intersection'](_0x346743[_0xdeff('0x33')],qs['fields'](_0x34e258[_0xdeff('0x35')][_0xdeff('0x39')]));_0x59f7a0[_0xdeff('0x38')]=_0x59f7a0[_0xdeff('0x38')][_0xdeff('0x3a')]?_0x59f7a0[_0xdeff('0x38')]:_0x346743['model'];if(!_0x34e258[_0xdeff('0x35')][_0xdeff('0x3b')]('nolimit')){_0x59f7a0[_0xdeff('0x21')]=qs[_0xdeff('0x21')](_0x34e258[_0xdeff('0x35')][_0xdeff('0x21')]);_0x59f7a0[_0xdeff('0x1f')]=qs[_0xdeff('0x1f')](_0x34e258[_0xdeff('0x35')][_0xdeff('0x1f')]);}_0x59f7a0['order']=qs[_0xdeff('0x3c')](_0x34e258['query'][_0xdeff('0x3c')]);_0x59f7a0[_0xdeff('0x3d')]=qs[_0xdeff('0x36')](_['pick'](_0x34e258[_0xdeff('0x35')],_0x346743[_0xdeff('0x36')]),_0x69842a);if(_0x34e258[_0xdeff('0x35')][_0xdeff('0x3e')]){_0x59f7a0[_0xdeff('0x3d')]=_['merge'](_0x59f7a0[_0xdeff('0x3d')],{'$or':_['map'](_0x69842a,function(_0x393d75){if(_0x393d75[_0xdeff('0x3f')]!=='VIRTUAL'){var _0x30609b={};_0x30609b[_0x393d75[_0xdeff('0x2d')]]={'$like':'%'+_0x34e258[_0xdeff('0x35')][_0xdeff('0x3e')]+'%'};return _0x30609b;}})});}_0x59f7a0=_[_0xdeff('0x40')]({},_0x59f7a0,_0x34e258['options']);var _0x3d8a33={'where':_0x59f7a0[_0xdeff('0x3d')]};return db[_0xdeff('0x31')][_0xdeff('0x41')](_0x3d8a33)[_0xdeff('0x27')](function(_0x5dfbb3){_0x505e3f['count']=_0x5dfbb3;if(_0x34e258[_0xdeff('0x35')][_0xdeff('0x42')]){_0x59f7a0[_0xdeff('0x43')]=[{'all':!![]}];}return db[_0xdeff('0x31')][_0xdeff('0x44')](_0x59f7a0);})[_0xdeff('0x27')](function(_0x2cd68a){_0x505e3f['rows']=_0x2cd68a;return _0x505e3f;})[_0xdeff('0x27')](respondWithFilteredResult(_0x5045b8,_0x59f7a0))[_0xdeff('0x45')](handleError(_0x5045b8,null));};exports[_0xdeff('0x46')]=function(_0x54fa5b,_0x1c3532){var _0x2c5eee={'raw':!![],'where':{'id':_0x54fa5b[_0xdeff('0x47')]['id']}},_0x14dc7b={};_0x14dc7b['model']=_[_0xdeff('0x34')](db[_0xdeff('0x31')][_0xdeff('0x48')]);_0x14dc7b[_0xdeff('0x35')]=_[_0xdeff('0x34')](_0x54fa5b[_0xdeff('0x35')]);_0x14dc7b[_0xdeff('0x36')]=_[_0xdeff('0x37')](_0x14dc7b['model'],_0x14dc7b[_0xdeff('0x35')]);_0x2c5eee[_0xdeff('0x38')]=_[_0xdeff('0x37')](_0x14dc7b[_0xdeff('0x33')],qs[_0xdeff('0x39')](_0x54fa5b['query'][_0xdeff('0x39')]));_0x2c5eee[_0xdeff('0x38')]=_0x2c5eee[_0xdeff('0x38')][_0xdeff('0x3a')]?_0x2c5eee[_0xdeff('0x38')]:_0x14dc7b['model'];if(_0x54fa5b[_0xdeff('0x35')]['includeAll']){_0x2c5eee[_0xdeff('0x43')]=[{'all':!![]}];}_0x2c5eee=_[_0xdeff('0x40')]({},_0x2c5eee,_0x54fa5b[_0xdeff('0x49')]);return db[_0xdeff('0x31')][_0xdeff('0x4a')](_0x2c5eee)[_0xdeff('0x27')](handleEntityNotFound(_0x1c3532,null))['then'](respondWithResult(_0x1c3532,null))['catch'](handleError(_0x1c3532,null));};exports[_0xdeff('0x4b')]=function(_0xf91a72,_0x3dc206){return db['VoiceMail']['create'](_0xf91a72[_0xdeff('0x4c')],{})[_0xdeff('0x27')](function(_0x497d9f){var _0x23f17d=_0xf91a72[_0xdeff('0x4d')][_0xdeff('0x4e')]({'plain':!![]});if(!_0x23f17d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x23f17d[_0xdeff('0x4f')]===_0xdeff('0x4d')){var _0x1ca376=_0x497d9f['get']({'plain':!![]});var _0xce8379=_0xdeff('0x29');return db[_0xdeff('0x50')][_0xdeff('0x4a')]({'where':{'name':_0xce8379,'userProfileId':_0x23f17d[_0xdeff('0x51')]},'raw':!![]})[_0xdeff('0x27')](function(_0x2c7fa4){if(_0x2c7fa4&&_0x2c7fa4['autoAssociation']===0x0){return db[_0xdeff('0x2a')][_0xdeff('0x4b')]({'name':_0x1ca376['name'],'resourceId':_0x1ca376['id'],'type':_0x2c7fa4[_0xdeff('0x2d')],'sectionId':_0x2c7fa4['id']},{})[_0xdeff('0x27')](function(){return _0x497d9f;});}else{return _0x497d9f;}})[_0xdeff('0x45')](function(_0x33482b){logger[_0xdeff('0x2b')](_0xdeff('0x52'),_0x33482b);throw _0x33482b;});}return _0x497d9f;})[_0xdeff('0x27')](respondWithResult(_0x3dc206,0xc9))[_0xdeff('0x45')](handleError(_0x3dc206,null));};exports['update']=function(_0x1b7eb3,_0x3a518d){if(_0x1b7eb3[_0xdeff('0x4c')]['id']){delete _0x1b7eb3['body']['id'];}return db['VoiceMail'][_0xdeff('0x4a')]({'where':{'id':_0x1b7eb3[_0xdeff('0x47')]['id']}})[_0xdeff('0x27')](handleEntityNotFound(_0x3a518d,null))[_0xdeff('0x27')](saveUpdates(_0x1b7eb3[_0xdeff('0x4c')],null))[_0xdeff('0x27')](respondWithResult(_0x3a518d,null))['catch'](handleError(_0x3a518d,null));};exports['destroy']=function(_0x38338b,_0x1cc2c1){return db['VoiceMail']['find']({'where':{'id':_0x38338b[_0xdeff('0x47')]['id']}})[_0xdeff('0x27')](handleEntityNotFound(_0x1cc2c1,null))['then'](removeEntity(_0x1cc2c1,null))[_0xdeff('0x45')](handleError(_0x1cc2c1,null));};exports[_0xdeff('0x53')]=function(_0x577fa8,_0x14fa7f,_0xe731d8){return db['VoiceMail'][_0xdeff('0x54')]({'where':{'id':_0x577fa8[_0xdeff('0x47')]['id']}})['then'](handleEntityNotFound(_0x14fa7f,null))[_0xdeff('0x27')](function(_0x152187){var _0x2a83ac;var _0x592ea6={},_0x47e86d={};_0x47e86d[_0xdeff('0x33')]=_['keys'](db[_0xdeff('0x55')][_0xdeff('0x48')]);_0x47e86d[_0xdeff('0x35')]=_[_0xdeff('0x34')](_0x577fa8[_0xdeff('0x35')]);_0x47e86d['filters']=_['intersection'](_0x47e86d[_0xdeff('0x33')],_0x47e86d[_0xdeff('0x35')]);_0x592ea6[_0xdeff('0x38')]=_[_0xdeff('0x37')](_0x47e86d[_0xdeff('0x33')],qs[_0xdeff('0x39')](_0x577fa8['query'][_0xdeff('0x39')]));_0x592ea6['attributes']=_0x592ea6[_0xdeff('0x38')][_0xdeff('0x3a')]?_0x592ea6[_0xdeff('0x38')]:_0x47e86d[_0xdeff('0x33')];if(!_0x577fa8[_0xdeff('0x35')][_0xdeff('0x3b')](_0xdeff('0x56'))){_0x592ea6[_0xdeff('0x21')]=qs[_0xdeff('0x21')](_0x577fa8['query'][_0xdeff('0x21')]);_0x592ea6['offset']=qs[_0xdeff('0x1f')](_0x577fa8[_0xdeff('0x35')]['offset']);}_0x592ea6[_0xdeff('0x57')]=qs['sort'](_0x577fa8[_0xdeff('0x35')]['sort']);_0x592ea6['where']=qs[_0xdeff('0x36')](_[_0xdeff('0x58')](_0x577fa8['query'],_0x47e86d[_0xdeff('0x36')]));if(_0x577fa8[_0xdeff('0x35')][_0xdeff('0x3e')]){_0x592ea6[_0xdeff('0x3d')]=_[_0xdeff('0x40')](_0x592ea6[_0xdeff('0x3d')],{'$or':_[_0xdeff('0x30')](_0x592ea6[_0xdeff('0x38')],function(_0x46046a){var _0x517ca7={};_0x517ca7[_0x46046a]={'$like':'%'+_0x577fa8[_0xdeff('0x35')][_0xdeff('0x3e')]+'%'};return _0x517ca7;})});}_0x592ea6['where']=_['merge'](_0x592ea6[_0xdeff('0x3d')],{'mailboxuser':_0x152187[_0xdeff('0x59')]});_0x592ea6=_['merge']({},_0x592ea6,_0x577fa8[_0xdeff('0x49')]);return db[_0xdeff('0x55')][_0xdeff('0x5a')](_0x592ea6)[_0xdeff('0x27')](respondWithFilteredResult(_0x14fa7f,_0x592ea6));})[_0xdeff('0x45')](handleError(_0x14fa7f,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index c4aa045..0facd66 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 _0xa593=['rimraf','../../config/environment','exports','define','VoiceMail','voice_voicemail','mailbox_context','mailbox','context','lodash','api','moment','request-promise','path'];(function(_0x20e9f6,_0x289e34){var _0x436892=function(_0x183951){while(--_0x183951){_0x20e9f6['push'](_0x20e9f6['shift']());}};_0x436892(++_0x289e34);}(_0xa593,0x175));var _0x3a59=function(_0x332f1f,_0xf3c368){_0x332f1f=_0x332f1f-0x0;var _0x285c90=_0xa593[_0x332f1f];return _0x285c90;};'use strict';var _=require(_0x3a59('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3a59('0x1'));var moment=require(_0x3a59('0x2'));var BPromise=require('bluebird');var rp=require(_0x3a59('0x3'));var fs=require('fs');var path=require(_0x3a59('0x4'));var rimraf=require(_0x3a59('0x5'));var config=require(_0x3a59('0x6'));var attributes=require('./voiceMail.attributes');module[_0x3a59('0x7')]=function(_0x342ec9,_0x45248b){return _0x342ec9[_0x3a59('0x8')](_0x3a59('0x9'),attributes,{'tableName':_0x3a59('0xa'),'paranoid':![],'indexes':[{'name':_0x3a59('0xb'),'fields':[_0x3a59('0xc'),_0x3a59('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4fc4=['util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceMail.attributes','exports','define','VoiceMail','voice_voicemail','mailbox_context','context','lodash'];(function(_0x541ea6,_0x51cab6){var _0x3c3e84=function(_0xc06bed){while(--_0xc06bed){_0x541ea6['push'](_0x541ea6['shift']());}};_0x3c3e84(++_0x51cab6);}(_0x4fc4,0x95));var _0x44fc=function(_0x2455c3,_0x223c1d){_0x2455c3=_0x2455c3-0x0;var _0x3c2f3f=_0x4fc4[_0x2455c3];return _0x3c2f3f;};'use strict';var _=require(_0x44fc('0x0'));var util=require(_0x44fc('0x1'));var logger=require('../../config/logger')(_0x44fc('0x2'));var moment=require(_0x44fc('0x3'));var BPromise=require(_0x44fc('0x4'));var rp=require(_0x44fc('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x44fc('0x6'));var config=require(_0x44fc('0x7'));var attributes=require(_0x44fc('0x8'));module[_0x44fc('0x9')]=function(_0x287514,_0x351f90){return _0x287514[_0x44fc('0xa')](_0x44fc('0xb'),attributes,{'tableName':_0x44fc('0xc'),'paranoid':![],'indexes':[{'name':_0x44fc('0xd'),'fields':['mailbox',_0x44fc('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index e2952b3..774238b 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 _0xafb6=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis'];(function(_0x4f7aa9,_0x9a1220){var _0x9a3936=function(_0xca32e0){while(--_0xca32e0){_0x4f7aa9['push'](_0x4f7aa9['shift']());}};_0x9a3936(++_0x9a1220);}(_0xafb6,0xcb));var _0x6afb=function(_0xf83277,_0x55487e){_0xf83277=_0xf83277-0x0;var _0x361e0e=_0xafb6[_0xf83277];return _0x361e0e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6afb('0x0'));var BPromise=require(_0x6afb('0x1'));var rs=require(_0x6afb('0x2'));var fs=require('fs');var Redis=require(_0x6afb('0x3'));var db=require(_0x6afb('0x4'))['db'];var utils=require(_0x6afb('0x5'));var logger=require(_0x6afb('0x6'))('rpc');var config=require(_0x6afb('0x7'));var jayson=require(_0x6afb('0x8'));var client=jayson[_0x6afb('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2fa104,_0x2e707d,_0x51ff3b){return new BPromise(function(_0x5cb9b8,_0x2e108d){return client[_0x6afb('0xa')](_0x2fa104,_0x51ff3b)[_0x6afb('0xb')](function(_0x773f65){logger[_0x6afb('0xc')](_0x6afb('0xd'),_0x2e707d,_0x6afb('0xe'));logger[_0x6afb('0xf')](_0x6afb('0x10'),_0x2e707d,_0x6afb('0xe'),JSON[_0x6afb('0x11')](_0x773f65));if(_0x773f65['error']){if(_0x773f65[_0x6afb('0x12')][_0x6afb('0x13')]===0x1f4){logger[_0x6afb('0x12')](_0x6afb('0xd'),_0x2e707d,_0x773f65[_0x6afb('0x12')][_0x6afb('0x14')]);return _0x2e108d(_0x773f65[_0x6afb('0x12')][_0x6afb('0x14')]);}logger[_0x6afb('0x12')]('VoiceMail,\x20%s,\x20%s',_0x2e707d,_0x773f65['error'][_0x6afb('0x14')]);return _0x5cb9b8(_0x773f65['error']['message']);}else{logger[_0x6afb('0xc')](_0x6afb('0xd'),_0x2e707d,_0x6afb('0xe'));_0x5cb9b8(_0x773f65[_0x6afb('0x15')][_0x6afb('0x14')]);}})[_0x6afb('0x16')](function(_0x3b9047){logger[_0x6afb('0x12')](_0x6afb('0xd'),_0x2e707d,_0x3b9047);_0x2e108d(_0x3b9047);});});} \ No newline at end of file +var _0xb975=['client','request','then','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise'];(function(_0x139ca8,_0x4fa54a){var _0x3721e4=function(_0x48e479){while(--_0x48e479){_0x139ca8['push'](_0x139ca8['shift']());}};_0x3721e4(++_0x4fa54a);}(_0xb975,0x1f1));var _0x5b97=function(_0x3bab09,_0x217c29){_0x3bab09=_0x3bab09-0x0;var _0x164376=_0xb975[_0x3bab09];return _0x164376;};'use strict';var _=require(_0x5b97('0x0'));var util=require(_0x5b97('0x1'));var moment=require(_0x5b97('0x2'));var BPromise=require(_0x5b97('0x3'));var rs=require(_0x5b97('0x4'));var fs=require('fs');var Redis=require(_0x5b97('0x5'));var db=require(_0x5b97('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x5b97('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5b97('0x8'));var client=jayson[_0x5b97('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x255ea7,_0x294024,_0x5f00c5){return new BPromise(function(_0x3985cb,_0x2b944d){return client[_0x5b97('0xa')](_0x255ea7,_0x5f00c5)[_0x5b97('0xb')](function(_0x2e550a){logger['info'](_0x5b97('0xc'),_0x294024,_0x5b97('0xd'));logger[_0x5b97('0xe')](_0x5b97('0xf'),_0x294024,'request\x20sent',JSON[_0x5b97('0x10')](_0x2e550a));if(_0x2e550a['error']){if(_0x2e550a[_0x5b97('0x11')][_0x5b97('0x12')]===0x1f4){logger[_0x5b97('0x11')]('VoiceMail,\x20%s,\x20%s',_0x294024,_0x2e550a[_0x5b97('0x11')][_0x5b97('0x13')]);return _0x2b944d(_0x2e550a[_0x5b97('0x11')]['message']);}logger[_0x5b97('0x11')](_0x5b97('0xc'),_0x294024,_0x2e550a[_0x5b97('0x11')][_0x5b97('0x13')]);return _0x3985cb(_0x2e550a[_0x5b97('0x11')]['message']);}else{logger[_0x5b97('0x14')](_0x5b97('0xc'),_0x294024,_0x5b97('0xd'));_0x3985cb(_0x2e550a[_0x5b97('0x15')][_0x5b97('0x13')]);}})[_0x5b97('0x16')](function(_0xc21df5){logger[_0x5b97('0x11')](_0x5b97('0xc'),_0x294024,_0xc21df5);_0x2b944d(_0xc21df5);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index ffef918..ddd18d1 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 _0x87be=['update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','/:id','download','post','create','put'];(function(_0x35387d,_0x1ba72f){var _0x3aba56=function(_0x42cd08){while(--_0x42cd08){_0x35387d['push'](_0x35387d['shift']());}};_0x3aba56(++_0x1ba72f);}(_0x87be,0x11a));var _0xe87b=function(_0x544123,_0x48d2c9){_0x544123=_0x544123-0x0;var _0x34dcd4=_0x87be[_0x544123];return _0x34dcd4;};'use strict';var multer=require(_0xe87b('0x0'));var util=require(_0xe87b('0x1'));var path=require(_0xe87b('0x2'));var timeout=require(_0xe87b('0x3'));var express=require(_0xe87b('0x4'));var router=express[_0xe87b('0x5')]();var fs_extra=require(_0xe87b('0x6'));var auth=require(_0xe87b('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xe87b('0x8'));var controller=require(_0xe87b('0x9'));router[_0xe87b('0xa')]('/',auth[_0xe87b('0xb')](),controller[_0xe87b('0xc')]);router[_0xe87b('0xa')](_0xe87b('0xd'),auth[_0xe87b('0xb')](),controller['show']);router[_0xe87b('0xa')]('/:id/download',auth[_0xe87b('0xb')](),controller[_0xe87b('0xe')]);router[_0xe87b('0xf')]('/',auth['isAuthenticated'](),controller[_0xe87b('0x10')]);router[_0xe87b('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xe87b('0x12')]);router[_0xe87b('0x13')](_0xe87b('0xd'),auth[_0xe87b('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xfb2a=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','/:id','isAuthenticated','show','/:id/download','download','post','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x2dac8f,_0xf41811){var _0x41438b=function(_0x21c8ee){while(--_0x21c8ee){_0x2dac8f['push'](_0x2dac8f['shift']());}};_0x41438b(++_0xf41811);}(_0xfb2a,0x97));var _0xafb2=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xfb2a[_0x465028];return _0xb783d4;};'use strict';var multer=require(_0xafb2('0x0'));var util=require(_0xafb2('0x1'));var path=require(_0xafb2('0x2'));var timeout=require(_0xafb2('0x3'));var express=require(_0xafb2('0x4'));var router=express[_0xafb2('0x5')]();var fs_extra=require(_0xafb2('0x6'));var auth=require(_0xafb2('0x7'));var interaction=require(_0xafb2('0x8'));var config=require('../../config/environment');var controller=require('./voiceMailMessage.controller');router[_0xafb2('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xafb2('0xa'),auth[_0xafb2('0xb')](),controller[_0xafb2('0xc')]);router[_0xafb2('0x9')](_0xafb2('0xd'),auth[_0xafb2('0xb')](),controller[_0xafb2('0xe')]);router[_0xafb2('0xf')]('/',auth[_0xafb2('0xb')](),controller[_0xafb2('0x10')]);router[_0xafb2('0x11')](_0xafb2('0xa'),auth['isAuthenticated'](),controller[_0xafb2('0x12')]);router[_0xafb2('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xafb2('0x14')]);module[_0xafb2('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 2be6040..6724d4e 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 _0xe4c5=['getDataValue','INTEGER','STRING','long','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize'];(function(_0x190ab6,_0x24a680){var _0x5ccdef=function(_0x5b33b2){while(--_0x5b33b2){_0x190ab6['push'](_0x190ab6['shift']());}};_0x5ccdef(++_0x24a680);}(_0xe4c5,0xbf));var _0x5e4c=function(_0x39ab2c,_0x50e361){_0x39ab2c=_0x39ab2c-0x0;var _0x25cb13=_0xe4c5[_0x39ab2c];return _0x25cb13;};'use strict';var Sequelize=require(_0x5e4c('0x0'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x56414e){return this[_0x5e4c('0x1')]('id');}},'msgnum':{'type':Sequelize[_0x5e4c('0x2')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x5e4c('0x3')],'defaultValue':''},'context':{'type':Sequelize[_0x5e4c('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x5e4c('0x3')],'defaultValue':''},'callerid':{'type':Sequelize[_0x5e4c('0x3')],'defaultValue':''},'origtime':{'type':Sequelize[_0x5e4c('0x3')],'defaultValue':''},'duration':{'type':Sequelize[_0x5e4c('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x5e4c('0x3')],'defaultValue':''},'recording':{'type':Sequelize['BLOB'](_0x5e4c('0x4')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0x5e4c('0x3')],'defaultValue':''},'stamp':{'type':_0x5e4c('0x5'),'defaultValue':Sequelize[_0x5e4c('0x6')](_0x5e4c('0x7'))}}; \ No newline at end of file +var _0x642f=['VIRTUAL','getDataValue','STRING','BLOB','long','TIMESTAMP','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports'];(function(_0x8dc04d,_0xaa7559){var _0x2f5f28=function(_0xdd2d1d){while(--_0xdd2d1d){_0x8dc04d['push'](_0x8dc04d['shift']());}};_0x2f5f28(++_0xaa7559);}(_0x642f,0x127));var _0xf642=function(_0x3224e1,_0x4f6fb0){_0x3224e1=_0x3224e1-0x0;var _0x40afe6=_0x642f[_0x3224e1];return _0x40afe6;};'use strict';var Sequelize=require(_0xf642('0x0'));module[_0xf642('0x1')]={'name':{'type':Sequelize[_0xf642('0x2')],'get':function(_0x1d511e){return this[_0xf642('0x3')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xf642('0x4')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xf642('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0xf642('0x4')],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize[_0xf642('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xf642('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0xf642('0x5')](_0xf642('0x6')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0xf642('0x4')],'defaultValue':''},'stamp':{'type':_0xf642('0x7'),'defaultValue':Sequelize['literal'](_0xf642('0x8'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index db049f0..06994bc 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 _0x2312=['../../config/license/util','sendStatus','status','end','offset','undefined','count','set','Content-Range','json','reject','save','then','destroy','error','stack','name','send','index','VoiceMailMessage','rawAttributes','type','model','differenceBy','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','include','find','create','update','body','params','download','recording','msg_id','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment'];(function(_0x5bc4e2,_0x427ff9){var _0x4c93f9=function(_0x1e8546){while(--_0x1e8546){_0x5bc4e2['push'](_0x5bc4e2['shift']());}};_0x4c93f9(++_0x427ff9);}(_0x2312,0x199));var _0x2231=function(_0x4d0405,_0x249611){_0x4d0405=_0x4d0405-0x0;var _0x558715=_0x2312[_0x4d0405];return _0x558715;};'use strict';var emlformat=require(_0x2231('0x0'));var rimraf=require(_0x2231('0x1'));var zipdir=require(_0x2231('0x2'));var jsonpatch=require(_0x2231('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2231('0x4'));var Mustache=require('mustache');var util=require(_0x2231('0x5'));var path=require(_0x2231('0x6'));var sox=require(_0x2231('0x7'));var csv=require(_0x2231('0x8'));var ejs=require(_0x2231('0x9'));var fs=require('fs');var fs_extra=require(_0x2231('0xa'));var _=require(_0x2231('0xb'));var squel=require(_0x2231('0xc'));var crypto=require(_0x2231('0xd'));var jsforce=require(_0x2231('0xe'));var deskjs=require(_0x2231('0xf'));var toCsv=require(_0x2231('0x8'));var querystring=require(_0x2231('0x10'));var Papa=require(_0x2231('0x11'));var Redis=require(_0x2231('0x12'));var authService=require(_0x2231('0x13'));var qs=require(_0x2231('0x14'));var as=require(_0x2231('0x15'));var hardwareService=require(_0x2231('0x16'));var logger=require(_0x2231('0x17'))('api');var utils=require(_0x2231('0x18'));var config=require(_0x2231('0x19'));var licenseUtil=require(_0x2231('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x17589a,_0x194a1d){_0x194a1d=_0x194a1d||0xcc;return function(_0x1db33c){if(_0x1db33c){return _0x17589a[_0x2231('0x1b')](_0x194a1d);}return _0x17589a[_0x2231('0x1c')](_0x194a1d)[_0x2231('0x1d')]();};}function respondWithResult(_0x38a5c7,_0x32ec91){_0x32ec91=_0x32ec91||0xc8;return function(_0x50da87){if(_0x50da87){return _0x38a5c7['status'](_0x32ec91)['json'](_0x50da87);}};}function respondWithFilteredResult(_0x5c89aa,_0x2da0db){return function(_0x101ad6){if(_0x101ad6){var _0x26f155=typeof _0x2da0db[_0x2231('0x1e')]===_0x2231('0x1f')&&typeof _0x2da0db['limit']===_0x2231('0x1f');var _0x52641d=_0x101ad6[_0x2231('0x20')];var _0x5ac0ba=_0x26f155?0x0:_0x2da0db[_0x2231('0x1e')];var _0x3c48d3=_0x26f155?_0x101ad6[_0x2231('0x20')]:_0x2da0db['offset']+_0x2da0db['limit'];var _0x2514fa;if(_0x3c48d3>=_0x52641d){_0x3c48d3=_0x52641d;_0x2514fa=0xc8;}else{_0x2514fa=0xce;}_0x5c89aa['status'](_0x2514fa);return _0x5c89aa[_0x2231('0x21')](_0x2231('0x22'),_0x5ac0ba+'-'+_0x3c48d3+'/'+_0x52641d)[_0x2231('0x23')](_0x101ad6);}return null;};}function patchUpdates(_0x1dd5d8){return function(_0x162aba){try{jsonpatch['apply'](_0x162aba,_0x1dd5d8,!![]);}catch(_0x224320){return BPromise[_0x2231('0x24')](_0x224320);}return _0x162aba[_0x2231('0x25')]();};}function saveUpdates(_0x574d91,_0x2f2fdb){return function(_0x2a6385){if(_0x2a6385){return _0x2a6385['update'](_0x574d91)[_0x2231('0x26')](function(_0x5369be){return _0x5369be;});}return null;};}function removeEntity(_0x2ca8a6,_0x5c49c1){return function(_0x369f4c){if(_0x369f4c){return _0x369f4c[_0x2231('0x27')]()[_0x2231('0x26')](function(){_0x2ca8a6['status'](0xcc)[_0x2231('0x1d')]();});}};}function handleEntityNotFound(_0x582797,_0x5aa150){return function(_0x52ebb9){if(!_0x52ebb9){_0x582797['sendStatus'](0x194);}return _0x52ebb9;};}function handleError(_0xc4ecc7,_0x45b071){_0x45b071=_0x45b071||0x1f4;return function(_0x33be7c){logger[_0x2231('0x28')](_0x33be7c[_0x2231('0x29')]);if(_0x33be7c[_0x2231('0x2a')]){delete _0x33be7c[_0x2231('0x2a')];}_0xc4ecc7[_0x2231('0x1c')](_0x45b071)[_0x2231('0x2b')](_0x33be7c);};}exports[_0x2231('0x2c')]=function(_0x4d1cd7,_0x4a2537){var _0x24644d={},_0x50226d={},_0x45177e={'count':0x0,'rows':[]};var _0x430f47=_['map'](db[_0x2231('0x2d')][_0x2231('0x2e')],function(_0x12c292){return{'name':_0x12c292['fieldName'],'type':_0x12c292[_0x2231('0x2f')]['key']};});_0x50226d[_0x2231('0x30')]=_[_0x2231('0x31')](_[_0x2231('0x32')](_0x430f47,_0x2231('0x2a')),['name']);_0x50226d[_0x2231('0x33')]=_[_0x2231('0x34')](_0x4d1cd7[_0x2231('0x33')]);_0x50226d[_0x2231('0x35')]=_[_0x2231('0x36')](_0x50226d['model'],_0x50226d[_0x2231('0x33')]);_0x24644d[_0x2231('0x37')]=_[_0x2231('0x36')](_0x50226d[_0x2231('0x30')],qs[_0x2231('0x38')](_0x4d1cd7[_0x2231('0x33')][_0x2231('0x38')]));_0x24644d[_0x2231('0x37')]=_0x24644d[_0x2231('0x37')][_0x2231('0x39')]?_0x24644d[_0x2231('0x37')]:_0x50226d[_0x2231('0x30')];if(!_0x4d1cd7[_0x2231('0x33')][_0x2231('0x3a')](_0x2231('0x3b'))){_0x24644d[_0x2231('0x3c')]=qs[_0x2231('0x3c')](_0x4d1cd7['query'][_0x2231('0x3c')]);_0x24644d[_0x2231('0x1e')]=qs[_0x2231('0x1e')](_0x4d1cd7['query'][_0x2231('0x1e')]);}_0x24644d['order']=qs[_0x2231('0x3d')](_0x4d1cd7[_0x2231('0x33')][_0x2231('0x3d')]);_0x24644d[_0x2231('0x3e')]=qs['filters'](_['pick'](_0x4d1cd7[_0x2231('0x33')],_0x50226d[_0x2231('0x35')]),_0x430f47);if(_0x4d1cd7[_0x2231('0x33')][_0x2231('0x3f')]){_0x24644d[_0x2231('0x3e')]=_[_0x2231('0x40')](_0x24644d[_0x2231('0x3e')],{'$or':_[_0x2231('0x32')](_0x430f47,function(_0x208005){if(_0x208005[_0x2231('0x2f')]!==_0x2231('0x41')){var _0x5aa6af={};_0x5aa6af[_0x208005['name']]={'$like':'%'+_0x4d1cd7[_0x2231('0x33')]['filter']+'%'};return _0x5aa6af;}})});}_0x24644d=_['merge']({},_0x24644d,_0x4d1cd7[_0x2231('0x42')]);var _0x21f0c7={'where':_0x24644d[_0x2231('0x3e')]};return db[_0x2231('0x2d')]['count'](_0x21f0c7)['then'](function(_0x44dc39){_0x45177e['count']=_0x44dc39;if(_0x4d1cd7[_0x2231('0x33')][_0x2231('0x43')]){_0x24644d['include']=[{'all':!![]}];}return db[_0x2231('0x2d')][_0x2231('0x44')](_0x24644d);})[_0x2231('0x26')](function(_0x509c26){_0x45177e[_0x2231('0x45')]=_0x509c26;return _0x45177e;})[_0x2231('0x26')](respondWithFilteredResult(_0x4a2537,_0x24644d))[_0x2231('0x46')](handleError(_0x4a2537,null));};exports[_0x2231('0x47')]=function(_0x19fb42,_0x360c36){var _0x4737fc={'raw':!![],'where':{'id':_0x19fb42['params']['id']}},_0x10e3f2={};_0x10e3f2[_0x2231('0x30')]=_[_0x2231('0x34')](db[_0x2231('0x2d')][_0x2231('0x2e')]);_0x10e3f2[_0x2231('0x33')]=_['keys'](_0x19fb42[_0x2231('0x33')]);_0x10e3f2['filters']=_['intersection'](_0x10e3f2[_0x2231('0x30')],_0x10e3f2[_0x2231('0x33')]);_0x4737fc[_0x2231('0x37')]=_[_0x2231('0x36')](_0x10e3f2[_0x2231('0x30')],qs['fields'](_0x19fb42[_0x2231('0x33')]['fields']));_0x4737fc[_0x2231('0x37')]=_0x4737fc['attributes'][_0x2231('0x39')]?_0x4737fc[_0x2231('0x37')]:_0x10e3f2[_0x2231('0x30')];if(_0x19fb42[_0x2231('0x33')][_0x2231('0x43')]){_0x4737fc[_0x2231('0x48')]=[{'all':!![]}];}_0x4737fc=_[_0x2231('0x40')]({},_0x4737fc,_0x19fb42[_0x2231('0x42')]);return db[_0x2231('0x2d')][_0x2231('0x49')](_0x4737fc)[_0x2231('0x26')](handleEntityNotFound(_0x360c36,null))[_0x2231('0x26')](respondWithResult(_0x360c36,null))[_0x2231('0x46')](handleError(_0x360c36,null));};exports['create']=function(_0x2daf65,_0x34e527){return db['VoiceMailMessage'][_0x2231('0x4a')](_0x2daf65['body'],{})['then'](respondWithResult(_0x34e527,0xc9))[_0x2231('0x46')](handleError(_0x34e527,null));};exports[_0x2231('0x4b')]=function(_0x58955d,_0x2b4e6f){if(_0x58955d[_0x2231('0x4c')]['id']){delete _0x58955d[_0x2231('0x4c')]['id'];}return db[_0x2231('0x2d')][_0x2231('0x49')]({'where':{'id':_0x58955d[_0x2231('0x4d')]['id']}})[_0x2231('0x26')](handleEntityNotFound(_0x2b4e6f,null))[_0x2231('0x26')](saveUpdates(_0x58955d[_0x2231('0x4c')],null))[_0x2231('0x26')](respondWithResult(_0x2b4e6f,null))[_0x2231('0x46')](handleError(_0x2b4e6f,null));};exports[_0x2231('0x27')]=function(_0xb8911b,_0x5dad06){return db[_0x2231('0x2d')]['find']({'where':{'id':_0xb8911b['params']['id']}})['then'](handleEntityNotFound(_0x5dad06,null))[_0x2231('0x26')](removeEntity(_0x5dad06,null))[_0x2231('0x46')](handleError(_0x5dad06,null));};exports[_0x2231('0x4e')]=function(_0x24a4f9,_0x4555ba,_0x4c23cb){return db['VoiceMailMessage'][_0x2231('0x49')]({'where':{'id':_0x24a4f9['params']['id']},'attributes':['id',_0x2231('0x4f'),_0x2231('0x50')]})[_0x2231('0x26')](handleEntityNotFound(_0x4555ba,null))[_0x2231('0x26')](function(_0x2081a7){if(_0x2081a7){if(!_0x2081a7['recording']){throw new db['Sequelize'][(_0x2231('0x51'))](_0x2231('0x52'));}var _0x47fc3a={'Content-Type':_0x2231('0x53'),'Content-Disposition':_0x2231('0x54')};if(_0x2081a7[_0x2231('0x50')]){_0x47fc3a[_0x2231('0x55')]=_0x2231('0x56')+_0x2081a7[_0x2231('0x50')]+'.wav\x22';}_0x4555ba['set'](_0x47fc3a);return _0x4555ba[_0x2231('0x2b')](new Buffer(_0x2081a7[_0x2231('0x4f')]));}})[_0x2231('0x46')](handleError(_0x4555ba,null));}; \ No newline at end of file +var _0x9649=['attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','VoiceMailMessage','findAll','rows','catch','show','params','find','create','body','destroy','recording','msg_id','Sequelize','ValidationError','audio/wav','attachment;\x20filename=\x22','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','error','stack','name','send','index','rawAttributes','key','map','query','keys','filters','intersection','model'];(function(_0x5f2ca6,_0x5f2c80){var _0x506f73=function(_0x453e9d){while(--_0x453e9d){_0x5f2ca6['push'](_0x5f2ca6['shift']());}};_0x506f73(++_0x5f2c80);}(_0x9649,0x1c1));var _0x9964=function(_0x33e1d5,_0x4899b5){_0x33e1d5=_0x33e1d5-0x0;var _0x9e9a44=_0x9649[_0x33e1d5];return _0x9e9a44;};'use strict';var emlformat=require(_0x9964('0x0'));var rimraf=require(_0x9964('0x1'));var zipdir=require(_0x9964('0x2'));var jsonpatch=require(_0x9964('0x3'));var rp=require(_0x9964('0x4'));var moment=require(_0x9964('0x5'));var BPromise=require(_0x9964('0x6'));var Mustache=require(_0x9964('0x7'));var util=require(_0x9964('0x8'));var path=require(_0x9964('0x9'));var sox=require(_0x9964('0xa'));var csv=require(_0x9964('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9964('0xc'));var squel=require(_0x9964('0xd'));var crypto=require(_0x9964('0xe'));var jsforce=require(_0x9964('0xf'));var deskjs=require(_0x9964('0x10'));var toCsv=require(_0x9964('0xb'));var querystring=require(_0x9964('0x11'));var Papa=require(_0x9964('0x12'));var Redis=require(_0x9964('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9964('0x14'));var hardwareService=require(_0x9964('0x15'));var logger=require(_0x9964('0x16'))(_0x9964('0x17'));var utils=require(_0x9964('0x18'));var config=require(_0x9964('0x19'));var licenseUtil=require(_0x9964('0x1a'));var db=require(_0x9964('0x1b'))['db'];function respondWithStatusCode(_0x56b485,_0x2f1e33){_0x2f1e33=_0x2f1e33||0xcc;return function(_0x5c2ce3){if(_0x5c2ce3){return _0x56b485[_0x9964('0x1c')](_0x2f1e33);}return _0x56b485[_0x9964('0x1d')](_0x2f1e33)[_0x9964('0x1e')]();};}function respondWithResult(_0x54c30c,_0x40fc1a){_0x40fc1a=_0x40fc1a||0xc8;return function(_0x253288){if(_0x253288){return _0x54c30c[_0x9964('0x1d')](_0x40fc1a)[_0x9964('0x1f')](_0x253288);}};}function respondWithFilteredResult(_0x3ce459,_0x1d6c8e){return function(_0xe19b78){if(_0xe19b78){var _0x429e1b=typeof _0x1d6c8e['offset']===_0x9964('0x20')&&typeof _0x1d6c8e[_0x9964('0x21')]===_0x9964('0x20');var _0x549397=_0xe19b78[_0x9964('0x22')];var _0x1fa836=_0x429e1b?0x0:_0x1d6c8e[_0x9964('0x23')];var _0x22c629=_0x429e1b?_0xe19b78[_0x9964('0x22')]:_0x1d6c8e[_0x9964('0x23')]+_0x1d6c8e[_0x9964('0x21')];var _0x5193ee;if(_0x22c629>=_0x549397){_0x22c629=_0x549397;_0x5193ee=0xc8;}else{_0x5193ee=0xce;}_0x3ce459[_0x9964('0x1d')](_0x5193ee);return _0x3ce459[_0x9964('0x24')]('Content-Range',_0x1fa836+'-'+_0x22c629+'/'+_0x549397)['json'](_0xe19b78);}return null;};}function patchUpdates(_0x451665){return function(_0x283c46){try{jsonpatch[_0x9964('0x25')](_0x283c46,_0x451665,!![]);}catch(_0x16c810){return BPromise[_0x9964('0x26')](_0x16c810);}return _0x283c46[_0x9964('0x27')]();};}function saveUpdates(_0x2ac38e,_0x3aa878){return function(_0x3c0571){if(_0x3c0571){return _0x3c0571[_0x9964('0x28')](_0x2ac38e)[_0x9964('0x29')](function(_0x309453){return _0x309453;});}return null;};}function removeEntity(_0x49bd5b,_0x1bd495){return function(_0x3ed031){if(_0x3ed031){return _0x3ed031['destroy']()[_0x9964('0x29')](function(){_0x49bd5b[_0x9964('0x1d')](0xcc)[_0x9964('0x1e')]();});}};}function handleEntityNotFound(_0x5a0e25,_0x36fed6){return function(_0x58f498){if(!_0x58f498){_0x5a0e25[_0x9964('0x1c')](0x194);}return _0x58f498;};}function handleError(_0x3bd415,_0x4654c5){_0x4654c5=_0x4654c5||0x1f4;return function(_0x17bd7d){logger[_0x9964('0x2a')](_0x17bd7d[_0x9964('0x2b')]);if(_0x17bd7d['name']){delete _0x17bd7d[_0x9964('0x2c')];}_0x3bd415[_0x9964('0x1d')](_0x4654c5)[_0x9964('0x2d')](_0x17bd7d);};}exports[_0x9964('0x2e')]=function(_0x1145e6,_0x5d98f8){var _0x27f867={},_0x1de0c2={},_0x532f53={'count':0x0,'rows':[]};var _0x1d9db0=_['map'](db['VoiceMailMessage'][_0x9964('0x2f')],function(_0xa07599){return{'name':_0xa07599['fieldName'],'type':_0xa07599['type'][_0x9964('0x30')]};});_0x1de0c2['model']=_['differenceBy'](_[_0x9964('0x31')](_0x1d9db0,'name'),[_0x9964('0x2c')]);_0x1de0c2[_0x9964('0x32')]=_[_0x9964('0x33')](_0x1145e6[_0x9964('0x32')]);_0x1de0c2[_0x9964('0x34')]=_[_0x9964('0x35')](_0x1de0c2[_0x9964('0x36')],_0x1de0c2['query']);_0x27f867[_0x9964('0x37')]=_['intersection'](_0x1de0c2['model'],qs[_0x9964('0x38')](_0x1145e6[_0x9964('0x32')][_0x9964('0x38')]));_0x27f867[_0x9964('0x37')]=_0x27f867[_0x9964('0x37')][_0x9964('0x39')]?_0x27f867[_0x9964('0x37')]:_0x1de0c2['model'];if(!_0x1145e6[_0x9964('0x32')]['hasOwnProperty'](_0x9964('0x3a'))){_0x27f867[_0x9964('0x21')]=qs[_0x9964('0x21')](_0x1145e6['query'][_0x9964('0x21')]);_0x27f867[_0x9964('0x23')]=qs['offset'](_0x1145e6[_0x9964('0x32')][_0x9964('0x23')]);}_0x27f867[_0x9964('0x3b')]=qs[_0x9964('0x3c')](_0x1145e6[_0x9964('0x32')][_0x9964('0x3c')]);_0x27f867[_0x9964('0x3d')]=qs[_0x9964('0x34')](_['pick'](_0x1145e6[_0x9964('0x32')],_0x1de0c2[_0x9964('0x34')]),_0x1d9db0);if(_0x1145e6[_0x9964('0x32')][_0x9964('0x3e')]){_0x27f867[_0x9964('0x3d')]=_[_0x9964('0x3f')](_0x27f867[_0x9964('0x3d')],{'$or':_['map'](_0x1d9db0,function(_0x5ee909){if(_0x5ee909['type']!==_0x9964('0x40')){var _0x151962={};_0x151962[_0x5ee909[_0x9964('0x2c')]]={'$like':'%'+_0x1145e6[_0x9964('0x32')]['filter']+'%'};return _0x151962;}})});}_0x27f867=_['merge']({},_0x27f867,_0x1145e6[_0x9964('0x41')]);var _0x1ad461={'where':_0x27f867['where']};return db['VoiceMailMessage'][_0x9964('0x22')](_0x1ad461)[_0x9964('0x29')](function(_0x5eaa53){_0x532f53[_0x9964('0x22')]=_0x5eaa53;if(_0x1145e6[_0x9964('0x32')][_0x9964('0x42')]){_0x27f867[_0x9964('0x43')]=[{'all':!![]}];}return db[_0x9964('0x44')][_0x9964('0x45')](_0x27f867);})[_0x9964('0x29')](function(_0x21b6e2){_0x532f53[_0x9964('0x46')]=_0x21b6e2;return _0x532f53;})[_0x9964('0x29')](respondWithFilteredResult(_0x5d98f8,_0x27f867))[_0x9964('0x47')](handleError(_0x5d98f8,null));};exports[_0x9964('0x48')]=function(_0x37f3de,_0x7704d2){var _0x95be52={'raw':!![],'where':{'id':_0x37f3de[_0x9964('0x49')]['id']}},_0xe22519={};_0xe22519['model']=_[_0x9964('0x33')](db['VoiceMailMessage']['rawAttributes']);_0xe22519[_0x9964('0x32')]=_[_0x9964('0x33')](_0x37f3de[_0x9964('0x32')]);_0xe22519[_0x9964('0x34')]=_[_0x9964('0x35')](_0xe22519[_0x9964('0x36')],_0xe22519[_0x9964('0x32')]);_0x95be52['attributes']=_[_0x9964('0x35')](_0xe22519['model'],qs['fields'](_0x37f3de[_0x9964('0x32')][_0x9964('0x38')]));_0x95be52['attributes']=_0x95be52[_0x9964('0x37')]['length']?_0x95be52['attributes']:_0xe22519[_0x9964('0x36')];if(_0x37f3de[_0x9964('0x32')]['includeAll']){_0x95be52['include']=[{'all':!![]}];}_0x95be52=_[_0x9964('0x3f')]({},_0x95be52,_0x37f3de['options']);return db['VoiceMailMessage'][_0x9964('0x4a')](_0x95be52)[_0x9964('0x29')](handleEntityNotFound(_0x7704d2,null))[_0x9964('0x29')](respondWithResult(_0x7704d2,null))[_0x9964('0x47')](handleError(_0x7704d2,null));};exports[_0x9964('0x4b')]=function(_0x3790b7,_0x54470b){return db[_0x9964('0x44')][_0x9964('0x4b')](_0x3790b7[_0x9964('0x4c')],{})[_0x9964('0x29')](respondWithResult(_0x54470b,0xc9))[_0x9964('0x47')](handleError(_0x54470b,null));};exports['update']=function(_0x22467f,_0xc2c17a){if(_0x22467f['body']['id']){delete _0x22467f[_0x9964('0x4c')]['id'];}return db['VoiceMailMessage'][_0x9964('0x4a')]({'where':{'id':_0x22467f[_0x9964('0x49')]['id']}})['then'](handleEntityNotFound(_0xc2c17a,null))[_0x9964('0x29')](saveUpdates(_0x22467f[_0x9964('0x4c')],null))[_0x9964('0x29')](respondWithResult(_0xc2c17a,null))[_0x9964('0x47')](handleError(_0xc2c17a,null));};exports[_0x9964('0x4d')]=function(_0x38ffce,_0x25258e){return db['VoiceMailMessage']['find']({'where':{'id':_0x38ffce[_0x9964('0x49')]['id']}})[_0x9964('0x29')](handleEntityNotFound(_0x25258e,null))[_0x9964('0x29')](removeEntity(_0x25258e,null))[_0x9964('0x47')](handleError(_0x25258e,null));};exports['download']=function(_0x55db0f,_0x3695cc,_0x5d8fba){return db[_0x9964('0x44')][_0x9964('0x4a')]({'where':{'id':_0x55db0f[_0x9964('0x49')]['id']},'attributes':['id',_0x9964('0x4e'),_0x9964('0x4f')]})[_0x9964('0x29')](handleEntityNotFound(_0x3695cc,null))[_0x9964('0x29')](function(_0xb8bd58){if(_0xb8bd58){if(!_0xb8bd58['recording']){throw new db[(_0x9964('0x50'))][(_0x9964('0x51'))]('VoiceMailMessage\x20not\x20found');}var _0x3cbf26={'Content-Type':_0x9964('0x52'),'Content-Disposition':'attachment'};if(_0xb8bd58[_0x9964('0x4f')]){_0x3cbf26['Content-Disposition']=_0x9964('0x53')+_0xb8bd58[_0x9964('0x4f')]+'.wav\x22';}_0x3695cc[_0x9964('0x24')](_0x3cbf26);return _0x3695cc[_0x9964('0x2d')](new Buffer(_0xb8bd58[_0x9964('0x4e')]));}})[_0x9964('0x47')](handleError(_0x3695cc,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 57ce888..2c683e2 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 _0x987e=['voice_voicemail_messages','dir','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceMailMessage.attributes','exports','define'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0x987e,0x188));var _0xe987=function(_0x1738d6,_0x5de579){_0x1738d6=_0x1738d6-0x0;var _0x1a1187=_0x987e[_0x1738d6];return _0x1a1187;};'use strict';var _=require(_0xe987('0x0'));var util=require('util');var logger=require(_0xe987('0x1'))(_0xe987('0x2'));var moment=require(_0xe987('0x3'));var BPromise=require('bluebird');var rp=require(_0xe987('0x4'));var fs=require('fs');var path=require(_0xe987('0x5'));var rimraf=require(_0xe987('0x6'));var config=require(_0xe987('0x7'));var attributes=require(_0xe987('0x8'));module[_0xe987('0x9')]=function(_0x3c23c4,_0x5aa71c){return _0x3c23c4[_0xe987('0xa')]('VoiceMailMessage',attributes,{'tableName':_0xe987('0xb'),'paranoid':![],'indexes':[{'name':_0xe987('0xc'),'fields':[_0xe987('0xc')]}],'timestamps':![]});}; \ No newline at end of file +var _0xd251=['dir','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','VoiceMailMessage'];(function(_0x535963,_0x326515){var _0x3975f6=function(_0x2e624f){while(--_0x2e624f){_0x535963['push'](_0x535963['shift']());}};_0x3975f6(++_0x326515);}(_0xd251,0x1c9));var _0x1d25=function(_0x13fbb1,_0x32ccad){_0x13fbb1=_0x13fbb1-0x0;var _0x4d8d28=_0xd251[_0x13fbb1];return _0x4d8d28;};'use strict';var _=require(_0x1d25('0x0'));var util=require(_0x1d25('0x1'));var logger=require(_0x1d25('0x2'))('api');var moment=require('moment');var BPromise=require(_0x1d25('0x3'));var rp=require(_0x1d25('0x4'));var fs=require('fs');var path=require(_0x1d25('0x5'));var rimraf=require(_0x1d25('0x6'));var config=require(_0x1d25('0x7'));var attributes=require('./voiceMailMessage.attributes');module[_0x1d25('0x8')]=function(_0x461757,_0x219ced){return _0x461757[_0x1d25('0x9')](_0x1d25('0xa'),attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':_0x1d25('0xb'),'fields':[_0x1d25('0xb')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index c5e8447..33c1db7 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 _0x4424=['then','info','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VoiceMailMessage,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','client','http','request'];(function(_0xfd0305,_0x30ea99){var _0x3abc6f=function(_0x5afaf9){while(--_0x5afaf9){_0xfd0305['push'](_0xfd0305['shift']());}};_0x3abc6f(++_0x30ea99);}(_0x4424,0x19b));var _0x4442=function(_0x22d50a,_0x45a4f5){_0x22d50a=_0x22d50a-0x0;var _0x2bc774=_0x4424[_0x22d50a];return _0x2bc774;};'use strict';var _=require(_0x4442('0x0'));var util=require(_0x4442('0x1'));var moment=require(_0x4442('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4442('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4442('0x4'));var logger=require(_0x4442('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4442('0x6')][_0x4442('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x8f47b3,_0x15c7e7,_0x4ad63f){return new BPromise(function(_0x400f0e,_0x21ed97){return client[_0x4442('0x8')](_0x8f47b3,_0x4ad63f)[_0x4442('0x9')](function(_0x509431){logger[_0x4442('0xa')]('VoiceMailMessage,\x20%s,\x20%s',_0x15c7e7,'request\x20sent');logger[_0x4442('0xb')](_0x4442('0xc'),_0x15c7e7,_0x4442('0xd'),JSON[_0x4442('0xe')](_0x509431));if(_0x509431[_0x4442('0xf')]){if(_0x509431['error'][_0x4442('0x10')]===0x1f4){logger[_0x4442('0xf')](_0x4442('0x11'),_0x15c7e7,_0x509431[_0x4442('0xf')][_0x4442('0x12')]);return _0x21ed97(_0x509431[_0x4442('0xf')]['message']);}logger[_0x4442('0xf')](_0x4442('0x11'),_0x15c7e7,_0x509431[_0x4442('0xf')][_0x4442('0x12')]);return _0x400f0e(_0x509431[_0x4442('0xf')][_0x4442('0x12')]);}else{logger[_0x4442('0xa')](_0x4442('0x11'),_0x15c7e7,'request\x20sent');_0x400f0e(_0x509431[_0x4442('0x13')][_0x4442('0x12')]);}})[_0x4442('0x14')](function(_0x58d7a5){logger[_0x4442('0xf')]('VoiceMailMessage,\x20%s,\x20%s',_0x15c7e7,_0x58d7a5);_0x21ed97(_0x58d7a5);});});} \ No newline at end of file +var _0x88da=['bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','stringify','error','message','VoiceMailMessage,\x20%s,\x20%s','catch','lodash','util','moment'];(function(_0x2e30d3,_0x4d45b1){var _0x77fe0a=function(_0xd158cf){while(--_0xd158cf){_0x2e30d3['push'](_0x2e30d3['shift']());}};_0x77fe0a(++_0x4d45b1);}(_0x88da,0x1b2));var _0xa88d=function(_0x54a42c,_0x37bfaf){_0x54a42c=_0x54a42c-0x0;var _0x27303b=_0x88da[_0x54a42c];return _0x27303b;};'use strict';var _=require(_0xa88d('0x0'));var util=require(_0xa88d('0x1'));var moment=require(_0xa88d('0x2'));var BPromise=require(_0xa88d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa88d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa88d('0x5'));var logger=require(_0xa88d('0x6'))('rpc');var config=require(_0xa88d('0x7'));var jayson=require(_0xa88d('0x8'));var client=jayson[_0xa88d('0x9')][_0xa88d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1a85f4,_0x1d03b7,_0x5495cf){return new BPromise(function(_0x1cfa89,_0x2faa1e){return client['request'](_0x1a85f4,_0x5495cf)[_0xa88d('0xb')](function(_0x1e4b01){logger[_0xa88d('0xc')]('VoiceMailMessage,\x20%s,\x20%s',_0x1d03b7,_0xa88d('0xd'));logger['debug']('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x1d03b7,_0xa88d('0xd'),JSON[_0xa88d('0xe')](_0x1e4b01));if(_0x1e4b01[_0xa88d('0xf')]){if(_0x1e4b01['error']['code']===0x1f4){logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x1d03b7,_0x1e4b01['error'][_0xa88d('0x10')]);return _0x2faa1e(_0x1e4b01[_0xa88d('0xf')][_0xa88d('0x10')]);}logger['error'](_0xa88d('0x11'),_0x1d03b7,_0x1e4b01[_0xa88d('0xf')][_0xa88d('0x10')]);return _0x1cfa89(_0x1e4b01[_0xa88d('0xf')][_0xa88d('0x10')]);}else{logger[_0xa88d('0xc')](_0xa88d('0x11'),_0x1d03b7,'request\x20sent');_0x1cfa89(_0x1e4b01['result'][_0xa88d('0x10')]);}})[_0xa88d('0x12')](function(_0x2436f2){logger[_0xa88d('0xf')](_0xa88d('0x11'),_0x1d03b7,_0x2436f2);_0x2faa1e(_0x2436f2);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index f278af8..a9f9ea8 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 _0x02af=['post','create','addSound','delete','/:id/sounds/:id2','removeSound','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceMusicOnHold.controller','get','isAuthenticated','index','/:id','show','/:id/sounds','getSounds'];(function(_0x49a661,_0x26a4ab){var _0x45cfb1=function(_0x56b6d1){while(--_0x56b6d1){_0x49a661['push'](_0x49a661['shift']());}};_0x45cfb1(++_0x26a4ab);}(_0x02af,0xf8));var _0xf02a=function(_0x56eb56,_0x262b73){_0x56eb56=_0x56eb56-0x0;var _0x39b485=_0x02af[_0x56eb56];return _0x39b485;};'use strict';var multer=require(_0xf02a('0x0'));var util=require(_0xf02a('0x1'));var path=require(_0xf02a('0x2'));var timeout=require(_0xf02a('0x3'));var express=require(_0xf02a('0x4'));var router=express['Router']();var fs_extra=require(_0xf02a('0x5'));var auth=require(_0xf02a('0x6'));var interaction=require(_0xf02a('0x7'));var config=require('../../config/environment');var controller=require(_0xf02a('0x8'));router[_0xf02a('0x9')]('/',auth[_0xf02a('0xa')](),controller[_0xf02a('0xb')]);router['get'](_0xf02a('0xc'),auth[_0xf02a('0xa')](),controller[_0xf02a('0xd')]);router[_0xf02a('0x9')](_0xf02a('0xe'),auth[_0xf02a('0xa')](),controller[_0xf02a('0xf')]);router[_0xf02a('0x10')]('/',auth[_0xf02a('0xa')](),controller[_0xf02a('0x11')]);router['post'](_0xf02a('0xe'),auth[_0xf02a('0xa')](),controller[_0xf02a('0x12')]);router['put']('/:id',auth[_0xf02a('0xa')](),controller['update']);router[_0xf02a('0x13')](_0xf02a('0xc'),auth[_0xf02a('0xa')](),controller['destroy']);router['delete'](_0xf02a('0x14'),auth['isAuthenticated'](),controller[_0xf02a('0x15')]);module['exports']=router; \ No newline at end of file +var _0x87bf=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','/:id','show','/:id/sounds','isAuthenticated','getSounds','post','put','update','delete','destroy','removeSound','exports','multer','util'];(function(_0x215c84,_0x54ff9d){var _0x524d4c=function(_0x368415){while(--_0x368415){_0x215c84['push'](_0x215c84['shift']());}};_0x524d4c(++_0x54ff9d);}(_0x87bf,0x9f));var _0xf87b=function(_0x434543,_0x2fd498){_0x434543=_0x434543-0x0;var _0x3e6749=_0x87bf[_0x434543];return _0x3e6749;};'use strict';var multer=require(_0xf87b('0x0'));var util=require(_0xf87b('0x1'));var path=require(_0xf87b('0x2'));var timeout=require('connect-timeout');var express=require(_0xf87b('0x3'));var router=express[_0xf87b('0x4')]();var fs_extra=require(_0xf87b('0x5'));var auth=require(_0xf87b('0x6'));var interaction=require(_0xf87b('0x7'));var config=require(_0xf87b('0x8'));var controller=require(_0xf87b('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xf87b('0xa')](_0xf87b('0xb'),auth['isAuthenticated'](),controller[_0xf87b('0xc')]);router[_0xf87b('0xa')](_0xf87b('0xd'),auth[_0xf87b('0xe')](),controller[_0xf87b('0xf')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xf87b('0x10')](_0xf87b('0xd'),auth[_0xf87b('0xe')](),controller['addSound']);router[_0xf87b('0x11')](_0xf87b('0xb'),auth['isAuthenticated'](),controller[_0xf87b('0x12')]);router[_0xf87b('0x13')](_0xf87b('0xb'),auth['isAuthenticated'](),controller[_0xf87b('0x14')]);router[_0xf87b('0x13')]('/:id/sounds/:id2',auth['isAuthenticated'](),controller[_0xf87b('0x15')]);module[_0xf87b('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 938c648..8e3d82a 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 _0x4528=['alpha','TIMESTAMP','sequelize','exports','STRING','name','ENUM','custom','files','mp3nb','quietmp3'];(function(_0x378692,_0x1a78e2){var _0x51f225=function(_0x3859ad){while(--_0x3859ad){_0x378692['push'](_0x378692['shift']());}};_0x51f225(++_0x1a78e2);}(_0x4528,0x1c5));var _0x8452=function(_0x1a3a2d,_0x42f18e){_0x1a3a2d=_0x1a3a2d-0x0;var _0xa58e4a=_0x4528[_0x1a3a2d];return _0xa58e4a;};'use strict';var Sequelize=require(_0x8452('0x0'));module[_0x8452('0x1')]={'name':{'type':Sequelize[_0x8452('0x2')],'allowNull':![],'unique':_0x8452('0x3')},'mode':{'type':Sequelize[_0x8452('0x4')](_0x8452('0x5'),_0x8452('0x6'),_0x8452('0x7'),'quietmp3nb',_0x8452('0x8'),'mp3'),'allowNull':!![],'defaultValue':_0x8452('0x6')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0x8452('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0x8452('0x2')],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x8452('0x9')},'format':{'type':Sequelize[_0x8452('0x2')],'allowNull':!![]},'stamp':{'type':_0x8452('0xa')},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file +var _0x7e95=['TIMESTAMP','BOOLEAN','exports','STRING','name','custom','files','mp3nb','quietmp3nb','mp3','alpha'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0x7e95,0x86));var _0x57e9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7e95[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x57e9('0x0')]={'name':{'type':Sequelize[_0x57e9('0x1')],'allowNull':![],'unique':_0x57e9('0x2')},'mode':{'type':Sequelize['ENUM'](_0x57e9('0x3'),_0x57e9('0x4'),_0x57e9('0x5'),_0x57e9('0x6'),'quietmp3',_0x57e9('0x7')),'allowNull':!![],'defaultValue':_0x57e9('0x4')},'directory':{'type':Sequelize[_0x57e9('0x1')],'allowNull':!![]},'application':{'type':Sequelize[_0x57e9('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0x57e9('0x1')],'allowNull':!![]},'sort':{'type':Sequelize[_0x57e9('0x1')],'allowNull':!![],'defaultValue':_0x57e9('0x8')},'format':{'type':Sequelize[_0x57e9('0x1')],'allowNull':!![]},'stamp':{'type':_0x57e9('0x9')},'defaultEntry':{'type':Sequelize[_0x57e9('0xa')],'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 88ff6fc..4430bc6 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 _0xbd29=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','apply','reject','save','update','then','get','UserProfileResource','destroy','end','error','stack','name','send','map','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','VoiceMusicOnHold','includeAll','include','findAll','catch','show','params','keys','body','find','create','sequelize','mode','files','join','root','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','transaction','rmdirSync','Sequelize','ValidationError','addSound','save_name','converted_format','createdAt','server/files/sounds/converted','format','basename','extname','server/files/moh','symlinkSync','removeSound','findOne','id2','Sound','unlinkSync','%s.%s','message','getSounds','order','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger'];(function(_0x2eb79e,_0x112902){var _0x3929d7=function(_0x16da18){while(--_0x16da18){_0x2eb79e['push'](_0x2eb79e['shift']());}};_0x3929d7(++_0x112902);}(_0xbd29,0x1c1));var _0x9bd2=function(_0x1ea1fd,_0x5b9453){_0x1ea1fd=_0x1ea1fd-0x0;var _0x561c3a=_0xbd29[_0x1ea1fd];return _0x561c3a;};'use strict';var emlformat=require(_0x9bd2('0x0'));var rimraf=require(_0x9bd2('0x1'));var zipdir=require(_0x9bd2('0x2'));var jsonpatch=require(_0x9bd2('0x3'));var rp=require(_0x9bd2('0x4'));var moment=require(_0x9bd2('0x5'));var BPromise=require(_0x9bd2('0x6'));var Mustache=require(_0x9bd2('0x7'));var util=require('util');var path=require(_0x9bd2('0x8'));var sox=require(_0x9bd2('0x9'));var csv=require('to-csv');var ejs=require(_0x9bd2('0xa'));var fs=require('fs');var fs_extra=require(_0x9bd2('0xb'));var _=require(_0x9bd2('0xc'));var squel=require('squel');var crypto=require(_0x9bd2('0xd'));var jsforce=require(_0x9bd2('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x9bd2('0xf'));var querystring=require(_0x9bd2('0x10'));var Papa=require(_0x9bd2('0x11'));var Redis=require(_0x9bd2('0x12'));var authService=require(_0x9bd2('0x13'));var qs=require(_0x9bd2('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9bd2('0x15'));var logger=require(_0x9bd2('0x16'))(_0x9bd2('0x17'));var utils=require(_0x9bd2('0x18'));var config=require(_0x9bd2('0x19'));var licenseUtil=require(_0x9bd2('0x1a'));var db=require(_0x9bd2('0x1b'))['db'];function respondWithStatusCode(_0x25fdc1,_0x490e3d){_0x490e3d=_0x490e3d||0xcc;return function(_0x2a3db4){if(_0x2a3db4){return _0x25fdc1[_0x9bd2('0x1c')](_0x490e3d);}return _0x25fdc1[_0x9bd2('0x1d')](_0x490e3d)['end']();};}function respondWithResult(_0x127a4b,_0x53cd54){_0x53cd54=_0x53cd54||0xc8;return function(_0x4d426f){if(_0x4d426f){return _0x127a4b[_0x9bd2('0x1d')](_0x53cd54)[_0x9bd2('0x1e')](_0x4d426f);}};}function respondWithFilteredResult(_0x4d2133,_0x240409){return function(_0x569a0e){if(_0x569a0e){var _0x4188a9=typeof _0x240409[_0x9bd2('0x1f')]===_0x9bd2('0x20')&&typeof _0x240409[_0x9bd2('0x21')]===_0x9bd2('0x20');var _0x2b3509=_0x569a0e[_0x9bd2('0x22')];var _0x35a75a=_0x4188a9?0x0:_0x240409[_0x9bd2('0x1f')];var _0x1eb278=_0x4188a9?_0x569a0e['count']:_0x240409[_0x9bd2('0x1f')]+_0x240409[_0x9bd2('0x21')];var _0x2b27dd;if(_0x1eb278>=_0x2b3509){_0x1eb278=_0x2b3509;_0x2b27dd=0xc8;}else{_0x2b27dd=0xce;}_0x4d2133[_0x9bd2('0x1d')](_0x2b27dd);return _0x4d2133['set']('Content-Range',_0x35a75a+'-'+_0x1eb278+'/'+_0x2b3509)[_0x9bd2('0x1e')](_0x569a0e);}return null;};}function patchUpdates(_0xd391f2){return function(_0x2d8008){try{jsonpatch[_0x9bd2('0x23')](_0x2d8008,_0xd391f2,!![]);}catch(_0x828236){return BPromise[_0x9bd2('0x24')](_0x828236);}return _0x2d8008[_0x9bd2('0x25')]();};}function saveUpdates(_0x3c46be,_0x27b3fd){return function(_0x17d1ab){if(_0x17d1ab){return _0x17d1ab[_0x9bd2('0x26')](_0x3c46be)[_0x9bd2('0x27')](function(_0x1fb5d4){return _0x1fb5d4;});}return null;};}function removeEntity(_0x2ba5de,_0x64200f){return function(_0x29c339){if(_0x29c339){return _0x29c339['destroy']()[_0x9bd2('0x27')](function(){var _0x52ce56=_0x29c339[_0x9bd2('0x28')]({'plain':!![]});var _0xa1f12d='MusicOnHolds';return db[_0x9bd2('0x29')][_0x9bd2('0x2a')]({'where':{'type':_0xa1f12d,'resourceId':_0x52ce56['id']}})[_0x9bd2('0x27')](function(){return _0x29c339;});})[_0x9bd2('0x27')](function(){_0x2ba5de['status'](0xcc)[_0x9bd2('0x2b')]();});}};}function handleEntityNotFound(_0x1cbe7f,_0x132ec9){return function(_0x56b1e3){if(!_0x56b1e3){_0x1cbe7f[_0x9bd2('0x1c')](0x194);}return _0x56b1e3;};}function handleError(_0x4afc6c,_0x5b06b3){_0x5b06b3=_0x5b06b3||0x1f4;return function(_0xd73407){logger[_0x9bd2('0x2c')](_0xd73407[_0x9bd2('0x2d')]);if(_0xd73407[_0x9bd2('0x2e')]){delete _0xd73407['name'];}_0x4afc6c[_0x9bd2('0x1d')](_0x5b06b3)[_0x9bd2('0x2f')](_0xd73407);};}exports['index']=function(_0x24d7c4,_0x17e780){var _0x46b643={},_0x454e8e={},_0x544ffd={'count':0x0,'rows':[]};var _0x19fed0=_[_0x9bd2('0x30')](db['VoiceMusicOnHold'][_0x9bd2('0x31')],function(_0x4420c4){return{'name':_0x4420c4[_0x9bd2('0x32')],'type':_0x4420c4[_0x9bd2('0x33')]['key']};});_0x454e8e[_0x9bd2('0x34')]=_['map'](_0x19fed0,_0x9bd2('0x2e'));_0x454e8e[_0x9bd2('0x35')]=_['keys'](_0x24d7c4[_0x9bd2('0x35')]);_0x454e8e[_0x9bd2('0x36')]=_[_0x9bd2('0x37')](_0x454e8e['model'],_0x454e8e['query']);_0x46b643['attributes']=_[_0x9bd2('0x37')](_0x454e8e[_0x9bd2('0x34')],qs[_0x9bd2('0x38')](_0x24d7c4[_0x9bd2('0x35')]['fields']));_0x46b643[_0x9bd2('0x39')]=_0x46b643['attributes'][_0x9bd2('0x3a')]?_0x46b643[_0x9bd2('0x39')]:_0x454e8e['model'];if(!_0x24d7c4[_0x9bd2('0x35')][_0x9bd2('0x3b')]('nolimit')){_0x46b643[_0x9bd2('0x21')]=qs['limit'](_0x24d7c4[_0x9bd2('0x35')][_0x9bd2('0x21')]);_0x46b643['offset']=qs['offset'](_0x24d7c4[_0x9bd2('0x35')]['offset']);}_0x46b643['order']=qs[_0x9bd2('0x3c')](_0x24d7c4[_0x9bd2('0x35')][_0x9bd2('0x3c')]);delete _0x24d7c4[_0x9bd2('0x35')]['sort'];_0x46b643[_0x9bd2('0x3d')]=qs['filters'](_[_0x9bd2('0x3e')](_0x24d7c4[_0x9bd2('0x35')],_0x454e8e[_0x9bd2('0x36')]),_0x19fed0);if(_0x24d7c4[_0x9bd2('0x35')][_0x9bd2('0x3f')]){_0x46b643['where']=_[_0x9bd2('0x40')](_0x46b643['where'],{'$or':_['map'](_0x19fed0,function(_0x589ea5){if(_0x589ea5[_0x9bd2('0x33')]!==_0x9bd2('0x41')){var _0x3e4d5b={};_0x3e4d5b[_0x589ea5[_0x9bd2('0x2e')]]={'$like':'%'+_0x24d7c4[_0x9bd2('0x35')][_0x9bd2('0x3f')]+'%'};return _0x3e4d5b;}})});}_0x46b643=_['merge']({},_0x46b643,_0x24d7c4[_0x9bd2('0x42')]);var _0x4752a7={'where':_0x46b643['where']};return db[_0x9bd2('0x43')]['count'](_0x4752a7)['then'](function(_0x50b385){_0x544ffd[_0x9bd2('0x22')]=_0x50b385;if(_0x24d7c4[_0x9bd2('0x35')][_0x9bd2('0x44')]){_0x46b643[_0x9bd2('0x45')]=[{'all':!![]}];}return db[_0x9bd2('0x43')][_0x9bd2('0x46')](_0x46b643);})['then'](function(_0x592475){_0x544ffd['rows']=_0x592475;return _0x544ffd;})['then'](respondWithFilteredResult(_0x17e780,_0x46b643))[_0x9bd2('0x47')](handleError(_0x17e780,null));};exports[_0x9bd2('0x48')]=function(_0x1af66f,_0x340ba4){var _0x13dcef={'raw':![],'where':{'id':_0x1af66f[_0x9bd2('0x49')]['id']}},_0x1568f5={};_0x1568f5[_0x9bd2('0x34')]=_['keys'](db[_0x9bd2('0x43')][_0x9bd2('0x31')]);_0x1568f5[_0x9bd2('0x35')]=_[_0x9bd2('0x4a')](_0x1af66f[_0x9bd2('0x35')]);_0x1568f5['filters']=_[_0x9bd2('0x37')](_0x1568f5[_0x9bd2('0x34')],_0x1568f5[_0x9bd2('0x35')]);_0x13dcef['attributes']=_['intersection'](_0x1568f5['model'],qs[_0x9bd2('0x38')](_0x1af66f['query'][_0x9bd2('0x38')]));_0x13dcef['attributes']=_0x13dcef['attributes'][_0x9bd2('0x3a')]?_0x13dcef[_0x9bd2('0x39')]:_0x1568f5[_0x9bd2('0x34')];if(_0x1af66f[_0x9bd2('0x35')]['includeAll']){_0x13dcef['include']=[{'all':!![]}];}_0x13dcef=_[_0x9bd2('0x40')]({},_0x13dcef,_0x1af66f['options']);return db[_0x9bd2('0x43')]['find'](_0x13dcef)[_0x9bd2('0x27')](handleEntityNotFound(_0x340ba4,null))[_0x9bd2('0x27')](respondWithResult(_0x340ba4,null))['catch'](handleError(_0x340ba4,null));};exports[_0x9bd2('0x26')]=function(_0xcdd530,_0x5be82b){if(_0xcdd530[_0x9bd2('0x4b')]['id']){delete _0xcdd530[_0x9bd2('0x4b')]['id'];}return db[_0x9bd2('0x43')][_0x9bd2('0x4c')]({'where':{'id':_0xcdd530[_0x9bd2('0x49')]['id']}})[_0x9bd2('0x27')](handleEntityNotFound(_0x5be82b,null))[_0x9bd2('0x27')](saveUpdates(_0xcdd530[_0x9bd2('0x4b')],null))[_0x9bd2('0x27')](respondWithResult(_0x5be82b,null))[_0x9bd2('0x47')](handleError(_0x5be82b,null));};exports[_0x9bd2('0x4d')]=function(_0x2bbcd8,_0x12f622,_0x273155){return db[_0x9bd2('0x4e')]['transaction'](function(_0x15b119){if(_0x2bbcd8[_0x9bd2('0x4b')][_0x9bd2('0x4f')]===_0x9bd2('0x50')){_0x2bbcd8[_0x9bd2('0x4b')]['directory']=path[_0x9bd2('0x51')](config[_0x9bd2('0x52')],'server/files/moh',_0x2bbcd8[_0x9bd2('0x4b')][_0x9bd2('0x2e')]);}return db[_0x9bd2('0x43')][_0x9bd2('0x4d')](_0x2bbcd8[_0x9bd2('0x4b')],{'transaction':_0x15b119})[_0x9bd2('0x27')](function(_0x545dde){if(_0x2bbcd8['body']['mode']===_0x9bd2('0x50')){fs[_0x9bd2('0x53')](_0x545dde[_0x9bd2('0x54')],parseInt(_0x9bd2('0x55'),0x8));}var _0x528c24=_0x2bbcd8[_0x9bd2('0x56')]['get']({'plain':!![]});if(!_0x528c24)throw new Error(_0x9bd2('0x57'));if(_0x528c24[_0x9bd2('0x58')]==='user'){var _0xc54afa=_0x545dde[_0x9bd2('0x28')]({'plain':!![]});return db[_0x9bd2('0x59')][_0x9bd2('0x4c')]({'where':{'name':_0x9bd2('0x5a'),'userProfileId':_0x528c24[_0x9bd2('0x5b')]},'raw':!![]})[_0x9bd2('0x27')](function(_0x3ebffd){if(_0x3ebffd&&_0x3ebffd[_0x9bd2('0x5c')]===0x0){return db['UserProfileResource'][_0x9bd2('0x4d')]({'name':_0xc54afa[_0x9bd2('0x2e')],'resourceId':_0xc54afa['id'],'type':_0x3ebffd['name'],'sectionId':_0x3ebffd['id']},{})[_0x9bd2('0x27')](function(){return _0x545dde;});}else{return _0x545dde;}})[_0x9bd2('0x47')](function(_0x488551){logger[_0x9bd2('0x2c')](_0x9bd2('0x5d'),_0x488551);});}return _0x545dde;});})['then'](respondWithResult(_0x12f622,0xc9))['catch'](handleError(_0x12f622,null));};exports['destroy']=function(_0x828fc7,_0x17e4d2,_0x42e9f4){var _0x3e4eab;return db[_0x9bd2('0x43')][_0x9bd2('0x4c')]({'where':{'id':_0x828fc7[_0x9bd2('0x49')]['id']}})[_0x9bd2('0x27')](function(_0x5d394c){if(_0x5d394c){return db['sequelize'][_0x9bd2('0x5e')](function(_0x29ed7b){return _0x5d394c[_0x9bd2('0x2a')]({'transaction':_0x29ed7b,'raw':!![]})['then'](function(_0x3a1968){if(_0x3a1968[_0x9bd2('0x54')]){fs['readdirSync'](_0x3a1968[_0x9bd2('0x54')])['forEach'](function(_0x566118){fs['unlinkSync'](path['join'](_0x3a1968['directory'],_0x566118));});fs[_0x9bd2('0x5f')](_0x3a1968[_0x9bd2('0x54')]);}return _0x3a1968;});})[_0x9bd2('0x47')](function(_0x54176d){throw new db[(_0x9bd2('0x60'))][(_0x9bd2('0x61'))](_0x54176d['message']);});}})[_0x9bd2('0x27')](handleEntityNotFound(_0x17e4d2,null))[_0x9bd2('0x27')](removeEntity(_0x17e4d2,null))[_0x9bd2('0x47')](handleError(_0x17e4d2,null));};exports[_0x9bd2('0x62')]=function(_0x23e685,_0x4803c2,_0x1791be){return db[_0x9bd2('0x4e')][_0x9bd2('0x5e')](function(_0x239d2e){var _0x5a1ceb;return db[_0x9bd2('0x43')][_0x9bd2('0x4c')]({'where':{'id':_0x23e685[_0x9bd2('0x49')]['id']}})[_0x9bd2('0x27')](function(_0x5e0756){if(_0x5e0756){_0x5a1ceb=_0x5e0756;return _0x5e0756[_0x9bd2('0x62')](_0x23e685[_0x9bd2('0x4b')]['id'],{'transaction':_0x239d2e});}})[_0x9bd2('0x27')](function(_0x47848c){if(_0x47848c){return db['Sound']['findOne']({'where':{'id':_0x23e685[_0x9bd2('0x4b')]['id']},'attributes':['id',_0x9bd2('0x2e'),_0x9bd2('0x63'),_0x9bd2('0x64'),_0x9bd2('0x65')],'raw':!![]});}})[_0x9bd2('0x27')](function(_0xfb1908){if(_0xfb1908){var _0x5cc7b2=path[_0x9bd2('0x51')](config[_0x9bd2('0x52')],_0x9bd2('0x66'),util[_0x9bd2('0x67')]('%s.%s',path[_0x9bd2('0x68')](_0xfb1908['save_name'],path[_0x9bd2('0x69')](_0xfb1908['save_name'])),_0xfb1908[_0x9bd2('0x64')]));var _0xb25dce=path[_0x9bd2('0x51')](config[_0x9bd2('0x52')],_0x9bd2('0x6a'),_0x5a1ceb[_0x9bd2('0x2e')],util[_0x9bd2('0x67')]('%s.%s',_0xfb1908['name'],_0xfb1908[_0x9bd2('0x64')]));fs[_0x9bd2('0x6b')](_0x5cc7b2,_0xb25dce);return _0xfb1908;}})['catch'](function(_0x3bcfa7){throw new db[(_0x9bd2('0x60'))][(_0x9bd2('0x61'))](_0x3bcfa7['message']);});})['then'](handleEntityNotFound(_0x4803c2,null))['then'](respondWithResult(_0x4803c2,0xc9))[_0x9bd2('0x47')](handleError(_0x4803c2,null));};exports[_0x9bd2('0x6c')]=function(_0x4cc3c7,_0x1f021b,_0x544792){return db['sequelize']['transaction'](function(_0x3e9702){var _0x387232;return db[_0x9bd2('0x43')][_0x9bd2('0x6d')]({'where':{'id':_0x4cc3c7[_0x9bd2('0x49')]['id']}})[_0x9bd2('0x27')](handleEntityNotFound(_0x1f021b,null))[_0x9bd2('0x27')](function(_0x428651){if(_0x428651){_0x387232=_0x428651;return _0x428651[_0x9bd2('0x6c')](_0x4cc3c7['params'][_0x9bd2('0x6e')]);}})[_0x9bd2('0x27')](function(_0xb5686d){if(_0xb5686d){return db[_0x9bd2('0x6f')]['findOne']({'where':{'id':_0x4cc3c7['params'][_0x9bd2('0x6e')]},'attributes':['id','name',_0x9bd2('0x63'),_0x9bd2('0x64'),_0x9bd2('0x65')],'raw':!![]});}})[_0x9bd2('0x27')](function(_0x55427f){if(_0x55427f){fs[_0x9bd2('0x70')](path[_0x9bd2('0x51')](_0x387232[_0x9bd2('0x54')],util[_0x9bd2('0x67')](_0x9bd2('0x71'),_0x55427f[_0x9bd2('0x2e')],_0x55427f[_0x9bd2('0x64')])));return _0x55427f;}})[_0x9bd2('0x47')](function(_0x36294a){throw new db['Sequelize'][(_0x9bd2('0x61'))](_0x36294a[_0x9bd2('0x72')]);});})[_0x9bd2('0x27')](handleEntityNotFound(_0x1f021b,null))['then'](respondWithStatusCode(_0x1f021b,0xcc))['catch'](handleError(_0x1f021b,null));};exports[_0x9bd2('0x73')]=function(_0x122844,_0x33e572,_0x366f9a){var _0x1775af={};var _0x3a1b70={};var _0xe9ffdf;var _0x508c59;return db['VoiceMusicOnHold'][_0x9bd2('0x6d')]({'where':{'id':_0x122844[_0x9bd2('0x49')]['id']}})['then'](handleEntityNotFound(_0x33e572,null))[_0x9bd2('0x27')](function(_0x25b63a){if(_0x25b63a){_0xe9ffdf=_0x25b63a;_0x3a1b70['model']=_[_0x9bd2('0x4a')](db[_0x9bd2('0x6f')][_0x9bd2('0x31')]);_0x3a1b70[_0x9bd2('0x35')]=_[_0x9bd2('0x4a')](_0x122844[_0x9bd2('0x35')]);_0x3a1b70[_0x9bd2('0x36')]=_[_0x9bd2('0x37')](_0x3a1b70[_0x9bd2('0x34')],_0x3a1b70['query']);_0x1775af[_0x9bd2('0x39')]=_[_0x9bd2('0x37')](_0x3a1b70['model'],qs['fields'](_0x122844[_0x9bd2('0x35')][_0x9bd2('0x38')]));_0x1775af[_0x9bd2('0x39')]=_0x1775af[_0x9bd2('0x39')][_0x9bd2('0x3a')]?_0x1775af[_0x9bd2('0x39')]:_0x3a1b70[_0x9bd2('0x34')];_0x1775af[_0x9bd2('0x74')]=qs['sort'](_0x122844[_0x9bd2('0x35')][_0x9bd2('0x3c')]);_0x1775af[_0x9bd2('0x3d')]=qs[_0x9bd2('0x36')](_[_0x9bd2('0x3e')](_0x122844[_0x9bd2('0x35')],_0x3a1b70[_0x9bd2('0x36')]));if(_0x122844[_0x9bd2('0x35')][_0x9bd2('0x3f')]){_0x1775af['where']=_['merge'](_0x1775af[_0x9bd2('0x3d')],{'$or':_[_0x9bd2('0x30')](_0x1775af[_0x9bd2('0x39')],function(_0x354bac){var _0x20132e={};_0x20132e[_0x354bac]={'$like':'%'+_0x122844[_0x9bd2('0x35')]['filter']+'%'};return _0x20132e;})});}_0x1775af=_[_0x9bd2('0x40')]({},_0x1775af,_0x122844[_0x9bd2('0x42')]);return _0xe9ffdf[_0x9bd2('0x73')](_0x1775af);}})[_0x9bd2('0x27')](function(_0x2902fb){if(_0x2902fb){_0x508c59=_0x2902fb[_0x9bd2('0x3a')];if(!_0x122844[_0x9bd2('0x35')][_0x9bd2('0x3b')](_0x9bd2('0x75'))){_0x1775af[_0x9bd2('0x21')]=qs[_0x9bd2('0x21')](_0x122844[_0x9bd2('0x35')][_0x9bd2('0x21')]);_0x1775af[_0x9bd2('0x1f')]=qs[_0x9bd2('0x1f')](_0x122844['query'][_0x9bd2('0x1f')]);}return _0xe9ffdf[_0x9bd2('0x73')](_0x1775af);}})['then'](function(_0x386de0){if(_0x386de0){return _0x386de0?{'count':_0x508c59,'rows':_0x386de0}:null;}})[_0x9bd2('0x27')](respondWithResult(_0x33e572,null))[_0x9bd2('0x47')](handleError(_0x33e572,null));}; \ No newline at end of file +var _0x8bf6=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','get','MusicOnHolds','UserProfileResource','stack','name','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','VoiceMusicOnHold','includeAll','include','findAll','catch','show','params','find','body','create','sequelize','transaction','files','directory','join','server/files/moh','mode','mkdirSync','0777','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','forEach','unlinkSync','rmdirSync','ValidationError','addSound','Sound','converted_format','createdAt','root','server/files/sounds/converted','%s.%s','basename','save_name','extname','format','message','removeSound','findOne','id2','Sequelize','getSounds','order'];(function(_0x4c7a5b,_0x453a23){var _0x3121f2=function(_0x4518e5){while(--_0x4518e5){_0x4c7a5b['push'](_0x4c7a5b['shift']());}};_0x3121f2(++_0x453a23);}(_0x8bf6,0x70));var _0x68bf=function(_0x594802,_0x572fbc){_0x594802=_0x594802-0x0;var _0x4901d9=_0x8bf6[_0x594802];return _0x4901d9;};'use strict';var emlformat=require(_0x68bf('0x0'));var rimraf=require(_0x68bf('0x1'));var zipdir=require(_0x68bf('0x2'));var jsonpatch=require(_0x68bf('0x3'));var rp=require('request-promise');var moment=require(_0x68bf('0x4'));var BPromise=require(_0x68bf('0x5'));var Mustache=require(_0x68bf('0x6'));var util=require('util');var path=require('path');var sox=require(_0x68bf('0x7'));var csv=require(_0x68bf('0x8'));var ejs=require(_0x68bf('0x9'));var fs=require('fs');var fs_extra=require(_0x68bf('0xa'));var _=require('lodash');var squel=require(_0x68bf('0xb'));var crypto=require(_0x68bf('0xc'));var jsforce=require(_0x68bf('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x68bf('0x8'));var querystring=require('querystring');var Papa=require(_0x68bf('0xe'));var Redis=require('ioredis');var authService=require(_0x68bf('0xf'));var qs=require(_0x68bf('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x68bf('0x11'));var logger=require(_0x68bf('0x12'))('api');var utils=require(_0x68bf('0x13'));var config=require(_0x68bf('0x14'));var licenseUtil=require(_0x68bf('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x58fd04,_0x28b00b){_0x28b00b=_0x28b00b||0xcc;return function(_0x1c5f2){if(_0x1c5f2){return _0x58fd04[_0x68bf('0x16')](_0x28b00b);}return _0x58fd04[_0x68bf('0x17')](_0x28b00b)[_0x68bf('0x18')]();};}function respondWithResult(_0x1cf9cc,_0x2a736f){_0x2a736f=_0x2a736f||0xc8;return function(_0x1cee04){if(_0x1cee04){return _0x1cf9cc[_0x68bf('0x17')](_0x2a736f)[_0x68bf('0x19')](_0x1cee04);}};}function respondWithFilteredResult(_0x5ce530,_0x1298f5){return function(_0xd6ece8){if(_0xd6ece8){var _0x59a807=typeof _0x1298f5[_0x68bf('0x1a')]==='undefined'&&typeof _0x1298f5[_0x68bf('0x1b')]===_0x68bf('0x1c');var _0x2e4eb8=_0xd6ece8[_0x68bf('0x1d')];var _0x5955ad=_0x59a807?0x0:_0x1298f5[_0x68bf('0x1a')];var _0x1ae362=_0x59a807?_0xd6ece8[_0x68bf('0x1d')]:_0x1298f5[_0x68bf('0x1a')]+_0x1298f5[_0x68bf('0x1b')];var _0x3be94a;if(_0x1ae362>=_0x2e4eb8){_0x1ae362=_0x2e4eb8;_0x3be94a=0xc8;}else{_0x3be94a=0xce;}_0x5ce530['status'](_0x3be94a);return _0x5ce530['set'](_0x68bf('0x1e'),_0x5955ad+'-'+_0x1ae362+'/'+_0x2e4eb8)[_0x68bf('0x19')](_0xd6ece8);}return null;};}function patchUpdates(_0x21563f){return function(_0x4fdd48){try{jsonpatch[_0x68bf('0x1f')](_0x4fdd48,_0x21563f,!![]);}catch(_0x252f84){return BPromise[_0x68bf('0x20')](_0x252f84);}return _0x4fdd48[_0x68bf('0x21')]();};}function saveUpdates(_0x40a015,_0x4cf5f3){return function(_0x23b4ae){if(_0x23b4ae){return _0x23b4ae[_0x68bf('0x22')](_0x40a015)[_0x68bf('0x23')](function(_0x5d0fcc){return _0x5d0fcc;});}return null;};}function removeEntity(_0x1f6709,_0x557f1b){return function(_0x3425ea){if(_0x3425ea){return _0x3425ea[_0x68bf('0x24')]()[_0x68bf('0x23')](function(){var _0x4999aa=_0x3425ea[_0x68bf('0x25')]({'plain':!![]});var _0x51b375=_0x68bf('0x26');return db[_0x68bf('0x27')][_0x68bf('0x24')]({'where':{'type':_0x51b375,'resourceId':_0x4999aa['id']}})[_0x68bf('0x23')](function(){return _0x3425ea;});})[_0x68bf('0x23')](function(){_0x1f6709[_0x68bf('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x128f30,_0x238819){return function(_0x30a9b3){if(!_0x30a9b3){_0x128f30['sendStatus'](0x194);}return _0x30a9b3;};}function handleError(_0x515978,_0xcacdd5){_0xcacdd5=_0xcacdd5||0x1f4;return function(_0x1c7d7b){logger['error'](_0x1c7d7b[_0x68bf('0x28')]);if(_0x1c7d7b[_0x68bf('0x29')]){delete _0x1c7d7b[_0x68bf('0x29')];}_0x515978['status'](_0xcacdd5)['send'](_0x1c7d7b);};}exports[_0x68bf('0x2a')]=function(_0x1cffd6,_0x7711da){var _0x1f363a={},_0x122125={},_0x35dd39={'count':0x0,'rows':[]};var _0x14b54a=_[_0x68bf('0x2b')](db['VoiceMusicOnHold'][_0x68bf('0x2c')],function(_0x13c4b2){return{'name':_0x13c4b2[_0x68bf('0x2d')],'type':_0x13c4b2[_0x68bf('0x2e')]['key']};});_0x122125[_0x68bf('0x2f')]=_[_0x68bf('0x2b')](_0x14b54a,_0x68bf('0x29'));_0x122125[_0x68bf('0x30')]=_[_0x68bf('0x31')](_0x1cffd6[_0x68bf('0x30')]);_0x122125[_0x68bf('0x32')]=_[_0x68bf('0x33')](_0x122125[_0x68bf('0x2f')],_0x122125['query']);_0x1f363a[_0x68bf('0x34')]=_[_0x68bf('0x33')](_0x122125[_0x68bf('0x2f')],qs[_0x68bf('0x35')](_0x1cffd6['query'][_0x68bf('0x35')]));_0x1f363a[_0x68bf('0x34')]=_0x1f363a[_0x68bf('0x34')][_0x68bf('0x36')]?_0x1f363a[_0x68bf('0x34')]:_0x122125[_0x68bf('0x2f')];if(!_0x1cffd6[_0x68bf('0x30')][_0x68bf('0x37')](_0x68bf('0x38'))){_0x1f363a[_0x68bf('0x1b')]=qs[_0x68bf('0x1b')](_0x1cffd6[_0x68bf('0x30')][_0x68bf('0x1b')]);_0x1f363a[_0x68bf('0x1a')]=qs['offset'](_0x1cffd6[_0x68bf('0x30')][_0x68bf('0x1a')]);}_0x1f363a['order']=qs['sort'](_0x1cffd6[_0x68bf('0x30')]['sort']);delete _0x1cffd6['query'][_0x68bf('0x39')];_0x1f363a[_0x68bf('0x3a')]=qs[_0x68bf('0x32')](_[_0x68bf('0x3b')](_0x1cffd6[_0x68bf('0x30')],_0x122125[_0x68bf('0x32')]),_0x14b54a);if(_0x1cffd6[_0x68bf('0x30')][_0x68bf('0x3c')]){_0x1f363a[_0x68bf('0x3a')]=_[_0x68bf('0x3d')](_0x1f363a[_0x68bf('0x3a')],{'$or':_['map'](_0x14b54a,function(_0x51092b){if(_0x51092b[_0x68bf('0x2e')]!=='VIRTUAL'){var _0x534541={};_0x534541[_0x51092b[_0x68bf('0x29')]]={'$like':'%'+_0x1cffd6['query']['filter']+'%'};return _0x534541;}})});}_0x1f363a=_['merge']({},_0x1f363a,_0x1cffd6[_0x68bf('0x3e')]);var _0x6e7644={'where':_0x1f363a[_0x68bf('0x3a')]};return db[_0x68bf('0x3f')][_0x68bf('0x1d')](_0x6e7644)['then'](function(_0x3b48f5){_0x35dd39[_0x68bf('0x1d')]=_0x3b48f5;if(_0x1cffd6['query'][_0x68bf('0x40')]){_0x1f363a[_0x68bf('0x41')]=[{'all':!![]}];}return db[_0x68bf('0x3f')][_0x68bf('0x42')](_0x1f363a);})[_0x68bf('0x23')](function(_0x53395a){_0x35dd39['rows']=_0x53395a;return _0x35dd39;})[_0x68bf('0x23')](respondWithFilteredResult(_0x7711da,_0x1f363a))[_0x68bf('0x43')](handleError(_0x7711da,null));};exports[_0x68bf('0x44')]=function(_0x1ad2d5,_0x404ef2){var _0x5adb5e={'raw':![],'where':{'id':_0x1ad2d5[_0x68bf('0x45')]['id']}},_0x81cb41={};_0x81cb41[_0x68bf('0x2f')]=_[_0x68bf('0x31')](db[_0x68bf('0x3f')][_0x68bf('0x2c')]);_0x81cb41['query']=_[_0x68bf('0x31')](_0x1ad2d5['query']);_0x81cb41[_0x68bf('0x32')]=_[_0x68bf('0x33')](_0x81cb41[_0x68bf('0x2f')],_0x81cb41[_0x68bf('0x30')]);_0x5adb5e[_0x68bf('0x34')]=_[_0x68bf('0x33')](_0x81cb41[_0x68bf('0x2f')],qs[_0x68bf('0x35')](_0x1ad2d5['query'][_0x68bf('0x35')]));_0x5adb5e[_0x68bf('0x34')]=_0x5adb5e[_0x68bf('0x34')]['length']?_0x5adb5e[_0x68bf('0x34')]:_0x81cb41['model'];if(_0x1ad2d5[_0x68bf('0x30')][_0x68bf('0x40')]){_0x5adb5e[_0x68bf('0x41')]=[{'all':!![]}];}_0x5adb5e=_[_0x68bf('0x3d')]({},_0x5adb5e,_0x1ad2d5[_0x68bf('0x3e')]);return db['VoiceMusicOnHold'][_0x68bf('0x46')](_0x5adb5e)[_0x68bf('0x23')](handleEntityNotFound(_0x404ef2,null))[_0x68bf('0x23')](respondWithResult(_0x404ef2,null))[_0x68bf('0x43')](handleError(_0x404ef2,null));};exports[_0x68bf('0x22')]=function(_0x3ca997,_0x230d5a){if(_0x3ca997['body']['id']){delete _0x3ca997[_0x68bf('0x47')]['id'];}return db[_0x68bf('0x3f')][_0x68bf('0x46')]({'where':{'id':_0x3ca997[_0x68bf('0x45')]['id']}})[_0x68bf('0x23')](handleEntityNotFound(_0x230d5a,null))[_0x68bf('0x23')](saveUpdates(_0x3ca997[_0x68bf('0x47')],null))['then'](respondWithResult(_0x230d5a,null))[_0x68bf('0x43')](handleError(_0x230d5a,null));};exports[_0x68bf('0x48')]=function(_0x43ea1d,_0x154c2d,_0x58fba3){return db[_0x68bf('0x49')][_0x68bf('0x4a')](function(_0x533e64){if(_0x43ea1d[_0x68bf('0x47')]['mode']===_0x68bf('0x4b')){_0x43ea1d['body'][_0x68bf('0x4c')]=path[_0x68bf('0x4d')](config['root'],_0x68bf('0x4e'),_0x43ea1d['body'][_0x68bf('0x29')]);}return db[_0x68bf('0x3f')][_0x68bf('0x48')](_0x43ea1d[_0x68bf('0x47')],{'transaction':_0x533e64})[_0x68bf('0x23')](function(_0x4c91d9){if(_0x43ea1d[_0x68bf('0x47')][_0x68bf('0x4f')]===_0x68bf('0x4b')){fs[_0x68bf('0x50')](_0x4c91d9[_0x68bf('0x4c')],parseInt(_0x68bf('0x51'),0x8));}var _0x590913=_0x43ea1d['user'][_0x68bf('0x25')]({'plain':!![]});if(!_0x590913)throw new Error(_0x68bf('0x52'));if(_0x590913[_0x68bf('0x53')]===_0x68bf('0x54')){var _0x13523f=_0x4c91d9[_0x68bf('0x25')]({'plain':!![]});return db[_0x68bf('0x55')]['find']({'where':{'name':'MusicOnHolds','userProfileId':_0x590913[_0x68bf('0x56')]},'raw':!![]})[_0x68bf('0x23')](function(_0x71fab1){if(_0x71fab1&&_0x71fab1[_0x68bf('0x57')]===0x0){return db['UserProfileResource'][_0x68bf('0x48')]({'name':_0x13523f['name'],'resourceId':_0x13523f['id'],'type':_0x71fab1[_0x68bf('0x29')],'sectionId':_0x71fab1['id']},{})[_0x68bf('0x23')](function(){return _0x4c91d9;});}else{return _0x4c91d9;}})[_0x68bf('0x43')](function(_0x28f317){logger[_0x68bf('0x58')](_0x68bf('0x59'),_0x28f317);});}return _0x4c91d9;});})['then'](respondWithResult(_0x154c2d,0xc9))[_0x68bf('0x43')](handleError(_0x154c2d,null));};exports[_0x68bf('0x24')]=function(_0x20ceeb,_0x3a0f27,_0x55a00c){var _0x478ffd;return db[_0x68bf('0x3f')]['find']({'where':{'id':_0x20ceeb[_0x68bf('0x45')]['id']}})[_0x68bf('0x23')](function(_0x3a0aa9){if(_0x3a0aa9){return db[_0x68bf('0x49')][_0x68bf('0x4a')](function(_0x2c5137){return _0x3a0aa9['destroy']({'transaction':_0x2c5137,'raw':!![]})[_0x68bf('0x23')](function(_0x146829){if(_0x146829[_0x68bf('0x4c')]){fs['readdirSync'](_0x146829[_0x68bf('0x4c')])[_0x68bf('0x5a')](function(_0x1024b7){fs[_0x68bf('0x5b')](path['join'](_0x146829['directory'],_0x1024b7));});fs[_0x68bf('0x5c')](_0x146829[_0x68bf('0x4c')]);}return _0x146829;});})[_0x68bf('0x43')](function(_0x18b53b){throw new db['Sequelize'][(_0x68bf('0x5d'))](_0x18b53b['message']);});}})['then'](handleEntityNotFound(_0x3a0f27,null))[_0x68bf('0x23')](removeEntity(_0x3a0f27,null))[_0x68bf('0x43')](handleError(_0x3a0f27,null));};exports[_0x68bf('0x5e')]=function(_0x2b245a,_0x401a5d,_0x269a77){return db[_0x68bf('0x49')][_0x68bf('0x4a')](function(_0x701748){var _0x1e1e3b;return db[_0x68bf('0x3f')][_0x68bf('0x46')]({'where':{'id':_0x2b245a[_0x68bf('0x45')]['id']}})[_0x68bf('0x23')](function(_0x5f4c63){if(_0x5f4c63){_0x1e1e3b=_0x5f4c63;return _0x5f4c63['addSound'](_0x2b245a[_0x68bf('0x47')]['id'],{'transaction':_0x701748});}})[_0x68bf('0x23')](function(_0x4246b5){if(_0x4246b5){return db[_0x68bf('0x5f')]['findOne']({'where':{'id':_0x2b245a['body']['id']},'attributes':['id',_0x68bf('0x29'),'save_name',_0x68bf('0x60'),_0x68bf('0x61')],'raw':!![]});}})['then'](function(_0x4e97f4){if(_0x4e97f4){var _0x6a1b69=path[_0x68bf('0x4d')](config[_0x68bf('0x62')],_0x68bf('0x63'),util['format'](_0x68bf('0x64'),path[_0x68bf('0x65')](_0x4e97f4[_0x68bf('0x66')],path[_0x68bf('0x67')](_0x4e97f4[_0x68bf('0x66')])),_0x4e97f4['converted_format']));var _0x11c30f=path[_0x68bf('0x4d')](config['root'],'server/files/moh',_0x1e1e3b[_0x68bf('0x29')],util[_0x68bf('0x68')](_0x68bf('0x64'),_0x4e97f4[_0x68bf('0x29')],_0x4e97f4[_0x68bf('0x60')]));fs['symlinkSync'](_0x6a1b69,_0x11c30f);return _0x4e97f4;}})[_0x68bf('0x43')](function(_0x21b2c5){throw new db['Sequelize'][(_0x68bf('0x5d'))](_0x21b2c5[_0x68bf('0x69')]);});})[_0x68bf('0x23')](handleEntityNotFound(_0x401a5d,null))['then'](respondWithResult(_0x401a5d,0xc9))[_0x68bf('0x43')](handleError(_0x401a5d,null));};exports[_0x68bf('0x6a')]=function(_0x338570,_0x260284,_0x5a1171){return db[_0x68bf('0x49')][_0x68bf('0x4a')](function(_0x132362){var _0x833c0d;return db[_0x68bf('0x3f')][_0x68bf('0x6b')]({'where':{'id':_0x338570[_0x68bf('0x45')]['id']}})[_0x68bf('0x23')](handleEntityNotFound(_0x260284,null))[_0x68bf('0x23')](function(_0x58ecb7){if(_0x58ecb7){_0x833c0d=_0x58ecb7;return _0x58ecb7[_0x68bf('0x6a')](_0x338570[_0x68bf('0x45')][_0x68bf('0x6c')]);}})[_0x68bf('0x23')](function(_0x8251d2){if(_0x8251d2){return db[_0x68bf('0x5f')][_0x68bf('0x6b')]({'where':{'id':_0x338570[_0x68bf('0x45')][_0x68bf('0x6c')]},'attributes':['id',_0x68bf('0x29'),_0x68bf('0x66'),'converted_format',_0x68bf('0x61')],'raw':!![]});}})[_0x68bf('0x23')](function(_0x1b6c0b){if(_0x1b6c0b){fs['unlinkSync'](path[_0x68bf('0x4d')](_0x833c0d[_0x68bf('0x4c')],util[_0x68bf('0x68')](_0x68bf('0x64'),_0x1b6c0b[_0x68bf('0x29')],_0x1b6c0b[_0x68bf('0x60')])));return _0x1b6c0b;}})[_0x68bf('0x43')](function(_0x598a9a){throw new db[(_0x68bf('0x6d'))][(_0x68bf('0x5d'))](_0x598a9a[_0x68bf('0x69')]);});})[_0x68bf('0x23')](handleEntityNotFound(_0x260284,null))[_0x68bf('0x23')](respondWithStatusCode(_0x260284,0xcc))[_0x68bf('0x43')](handleError(_0x260284,null));};exports[_0x68bf('0x6e')]=function(_0x5d31fd,_0x10dc13,_0x4d3dfa){var _0x2dc6bc={};var _0x4b349b={};var _0x13c3bd;var _0x3686af;return db[_0x68bf('0x3f')][_0x68bf('0x6b')]({'where':{'id':_0x5d31fd['params']['id']}})[_0x68bf('0x23')](handleEntityNotFound(_0x10dc13,null))[_0x68bf('0x23')](function(_0x443da4){if(_0x443da4){_0x13c3bd=_0x443da4;_0x4b349b['model']=_[_0x68bf('0x31')](db[_0x68bf('0x5f')][_0x68bf('0x2c')]);_0x4b349b['query']=_[_0x68bf('0x31')](_0x5d31fd['query']);_0x4b349b[_0x68bf('0x32')]=_[_0x68bf('0x33')](_0x4b349b[_0x68bf('0x2f')],_0x4b349b['query']);_0x2dc6bc['attributes']=_[_0x68bf('0x33')](_0x4b349b[_0x68bf('0x2f')],qs[_0x68bf('0x35')](_0x5d31fd[_0x68bf('0x30')][_0x68bf('0x35')]));_0x2dc6bc[_0x68bf('0x34')]=_0x2dc6bc['attributes'][_0x68bf('0x36')]?_0x2dc6bc['attributes']:_0x4b349b[_0x68bf('0x2f')];_0x2dc6bc[_0x68bf('0x6f')]=qs[_0x68bf('0x39')](_0x5d31fd[_0x68bf('0x30')][_0x68bf('0x39')]);_0x2dc6bc[_0x68bf('0x3a')]=qs[_0x68bf('0x32')](_['pick'](_0x5d31fd[_0x68bf('0x30')],_0x4b349b[_0x68bf('0x32')]));if(_0x5d31fd[_0x68bf('0x30')][_0x68bf('0x3c')]){_0x2dc6bc[_0x68bf('0x3a')]=_[_0x68bf('0x3d')](_0x2dc6bc[_0x68bf('0x3a')],{'$or':_[_0x68bf('0x2b')](_0x2dc6bc[_0x68bf('0x34')],function(_0x381c15){var _0x54b72d={};_0x54b72d[_0x381c15]={'$like':'%'+_0x5d31fd['query'][_0x68bf('0x3c')]+'%'};return _0x54b72d;})});}_0x2dc6bc=_['merge']({},_0x2dc6bc,_0x5d31fd[_0x68bf('0x3e')]);return _0x13c3bd[_0x68bf('0x6e')](_0x2dc6bc);}})[_0x68bf('0x23')](function(_0x19f820){if(_0x19f820){_0x3686af=_0x19f820[_0x68bf('0x36')];if(!_0x5d31fd[_0x68bf('0x30')][_0x68bf('0x37')](_0x68bf('0x38'))){_0x2dc6bc[_0x68bf('0x1b')]=qs[_0x68bf('0x1b')](_0x5d31fd[_0x68bf('0x30')]['limit']);_0x2dc6bc['offset']=qs[_0x68bf('0x1a')](_0x5d31fd['query'][_0x68bf('0x1a')]);}return _0x13c3bd[_0x68bf('0x6e')](_0x2dc6bc);}})[_0x68bf('0x23')](function(_0x329993){if(_0x329993){return _0x329993?{'count':_0x3686af,'rows':_0x329993}:null;}})[_0x68bf('0x23')](respondWithResult(_0x10dc13,null))[_0x68bf('0x43')](handleError(_0x10dc13,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index d6927d0..bc454a0 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 _0xc72c=['voice_musiconhold','../../config/logger','api','bluebird','request-promise','path','rimraf','./voiceMusicOnHold.attributes','define','VoiceMusicOnHold'];(function(_0xe37727,_0x54ffae){var _0x295c23=function(_0x4ed0bf){while(--_0x4ed0bf){_0xe37727['push'](_0xe37727['shift']());}};_0x295c23(++_0x54ffae);}(_0xc72c,0xfb));var _0xcc72=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0xc72c[_0x32f7d7];return _0x133d09;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xcc72('0x0'))(_0xcc72('0x1'));var moment=require('moment');var BPromise=require(_0xcc72('0x2'));var rp=require(_0xcc72('0x3'));var fs=require('fs');var path=require(_0xcc72('0x4'));var rimraf=require(_0xcc72('0x5'));var config=require('../../config/environment');var attributes=require(_0xcc72('0x6'));module['exports']=function(_0x192800,_0x14c052){return _0x192800[_0xcc72('0x7')](_0xcc72('0x8'),attributes,{'tableName':_0xcc72('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x276b=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold','lodash','util'];(function(_0x297b1c,_0x303ab9){var _0x21c2dd=function(_0x4ee51a){while(--_0x4ee51a){_0x297b1c['push'](_0x297b1c['shift']());}};_0x21c2dd(++_0x303ab9);}(_0x276b,0x108));var _0xb276=function(_0xbee109,_0x848f63){_0xbee109=_0xbee109-0x0;var _0x5860e4=_0x276b[_0xbee109];return _0x5860e4;};'use strict';var _=require(_0xb276('0x0'));var util=require(_0xb276('0x1'));var logger=require(_0xb276('0x2'))(_0xb276('0x3'));var moment=require(_0xb276('0x4'));var BPromise=require(_0xb276('0x5'));var rp=require(_0xb276('0x6'));var fs=require('fs');var path=require(_0xb276('0x7'));var rimraf=require('rimraf');var config=require(_0xb276('0x8'));var attributes=require(_0xb276('0x9'));module[_0xb276('0xa')]=function(_0x3ec225,_0x41d61a){return _0x3ec225[_0xb276('0xb')](_0xb276('0xc'),attributes,{'tableName':_0xb276('0xd'),'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 f2fb4ea..05a84bb 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 _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(_0x158637,_0x202b9b){var _0x309c6b=function(_0x1a359f){while(--_0x1a359f){_0x158637['push'](_0x158637['shift']());}};_0x309c6b(++_0x202b9b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'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 _0xe706=['http','request','then','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x32f9bb,_0x4778be){var _0x51ecce=function(_0x5c5282){while(--_0x5c5282){_0x32f9bb['push'](_0x32f9bb['shift']());}};_0x51ecce(++_0x4778be);}(_0xe706,0xa3));var _0x6e70=function(_0x15624a,_0x62a80b){_0x15624a=_0x15624a-0x0;var _0x42b811=_0xe706[_0x15624a];return _0x42b811;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e70('0x3'));var fs=require('fs');var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var utils=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var jayson=require(_0x6e70('0xa'));var client=jayson[_0x6e70('0xb')][_0x6e70('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){return client[_0x6e70('0xd')](_0x36357b,_0x45a2d4)[_0x6e70('0xe')](function(_0x25e61c){logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,_0x6e70('0x11'));logger[_0x6e70('0x12')](_0x6e70('0x13'),_0x293ce7,_0x6e70('0x11'),JSON['stringify'](_0x25e61c));if(_0x25e61c['error']){if(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x15')]===0x1f4){logger[_0x6e70('0x14')](_0x6e70('0x10'),_0x293ce7,_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);return _0x3c4843(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);}logger['error']('VoiceMusicOnHold,\x20%s,\x20%s',_0x293ce7,_0x25e61c['error'][_0x6e70('0x16')]);return _0x188ed3(_0x25e61c['error']['message']);}else{logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,'request\x20sent');_0x188ed3(_0x25e61c[_0x6e70('0x17')]['message']);}})[_0x6e70('0x18')](function(_0x161f23){logger['error']('VoiceMusicOnHold,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 20c0b86..f8b96a0 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 _0x6a88=['post','create','update','/:id','destroy','delete','removeTeams','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','describe','show','getAgents','/:id/teams','getTeams'];(function(_0x47fd36,_0x41535d){var _0x21a0fc=function(_0x44c07c){while(--_0x44c07c){_0x47fd36['push'](_0x47fd36['shift']());}};_0x21a0fc(++_0x41535d);}(_0x6a88,0xa9));var _0x86a8=function(_0x2b7f56,_0x41bc7d){_0x2b7f56=_0x2b7f56-0x0;var _0x36896d=_0x6a88[_0x2b7f56];return _0x36896d;};'use strict';var multer=require(_0x86a8('0x0'));var util=require(_0x86a8('0x1'));var path=require(_0x86a8('0x2'));var timeout=require(_0x86a8('0x3'));var express=require(_0x86a8('0x4'));var router=express[_0x86a8('0x5')]();var fs_extra=require(_0x86a8('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x86a8('0x7'));var config=require('../../config/environment');var controller=require('./voicePrefix.controller');router[_0x86a8('0x8')]('/',auth[_0x86a8('0x9')](),controller['index']);router[_0x86a8('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x86a8('0xa')]);router[_0x86a8('0x8')]('/:id',auth[_0x86a8('0x9')](),controller[_0x86a8('0xb')]);router['get']('/:id/users',auth[_0x86a8('0x9')](),controller[_0x86a8('0xc')]);router[_0x86a8('0x8')](_0x86a8('0xd'),auth[_0x86a8('0x9')](),controller[_0x86a8('0xe')]);router[_0x86a8('0xf')]('/',auth[_0x86a8('0x9')](),controller[_0x86a8('0x10')]);router[_0x86a8('0xf')]('/:id/users',auth[_0x86a8('0x9')](),controller['addAgents']);router['post'](_0x86a8('0xd'),auth[_0x86a8('0x9')](),controller['addTeams']);router['put']('/:id',auth[_0x86a8('0x9')](),controller[_0x86a8('0x11')]);router['delete'](_0x86a8('0x12'),auth[_0x86a8('0x9')](),controller[_0x86a8('0x13')]);router[_0x86a8('0x14')]('/:id/users',auth[_0x86a8('0x9')](),controller['removeAgents']);router[_0x86a8('0x14')](_0x86a8('0xd'),auth[_0x86a8('0x9')](),controller[_0x86a8('0x15')]);module[_0x86a8('0x16')]=router; \ No newline at end of file +var _0xf2a5=['post','create','addAgents','addTeams','put','update','destroy','delete','removeAgents','removeTeams','exports','util','path','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','isAuthenticated','index','/describe','describe','get','/:id','show','/:id/users','getAgents','/:id/teams'];(function(_0x7f3b4d,_0x144c7f){var _0xf3292b=function(_0x534845){while(--_0x534845){_0x7f3b4d['push'](_0x7f3b4d['shift']());}};_0xf3292b(++_0x144c7f);}(_0xf2a5,0xc8));var _0x5f2a=function(_0x11faf6,_0x1c132d){_0x11faf6=_0x11faf6-0x0;var _0x24724c=_0xf2a5[_0x11faf6];return _0x24724c;};'use strict';var multer=require('multer');var util=require(_0x5f2a('0x0'));var path=require(_0x5f2a('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x5f2a('0x2'));var interaction=require(_0x5f2a('0x3'));var config=require(_0x5f2a('0x4'));var controller=require(_0x5f2a('0x5'));router['get']('/',auth[_0x5f2a('0x6')](),controller[_0x5f2a('0x7')]);router['get'](_0x5f2a('0x8'),auth[_0x5f2a('0x6')](),controller[_0x5f2a('0x9')]);router[_0x5f2a('0xa')](_0x5f2a('0xb'),auth[_0x5f2a('0x6')](),controller[_0x5f2a('0xc')]);router[_0x5f2a('0xa')](_0x5f2a('0xd'),auth['isAuthenticated'](),controller[_0x5f2a('0xe')]);router[_0x5f2a('0xa')](_0x5f2a('0xf'),auth[_0x5f2a('0x6')](),controller['getTeams']);router[_0x5f2a('0x10')]('/',auth[_0x5f2a('0x6')](),controller[_0x5f2a('0x11')]);router[_0x5f2a('0x10')](_0x5f2a('0xd'),auth[_0x5f2a('0x6')](),controller[_0x5f2a('0x12')]);router[_0x5f2a('0x10')]('/:id/teams',auth['isAuthenticated'](),controller[_0x5f2a('0x13')]);router[_0x5f2a('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x5f2a('0x15')]);router['delete'](_0x5f2a('0xb'),auth[_0x5f2a('0x6')](),controller[_0x5f2a('0x16')]);router[_0x5f2a('0x17')](_0x5f2a('0xd'),auth[_0x5f2a('0x6')](),controller[_0x5f2a('0x18')]);router[_0x5f2a('0x17')](_0x5f2a('0xf'),auth[_0x5f2a('0x6')](),controller[_0x5f2a('0x19')]);module[_0x5f2a('0x1a')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 17f2129..6f35e75 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 _0xccc5=['VIRTUAL','system-','getDataValue','name','INTEGER','sequelize','exports','STRING'];(function(_0x5c3242,_0x3ce7a2){var _0x15d9f3=function(_0x26c242){while(--_0x26c242){_0x5c3242['push'](_0x5c3242['shift']());}};_0x15d9f3(++_0x3ce7a2);}(_0xccc5,0x1ad));var _0x5ccc=function(_0xc8a931,_0x260690){_0xc8a931=_0xc8a931-0x0;var _0x28bd27=_0xccc5[_0xc8a931];return _0x28bd27;};'use strict';var Sequelize=require(_0x5ccc('0x0'));module[_0x5ccc('0x1')]={'name':{'type':Sequelize[_0x5ccc('0x2')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0x5ccc('0x3')],'get':function(_0x5e52fe){return _0x5ccc('0x4')+this[_0x5ccc('0x5')](_0x5ccc('0x6'))+'-';}},'description':{'type':Sequelize[_0x5ccc('0x2')]},'callerIdAll':{'type':Sequelize[_0x5ccc('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0x5ccc('0x7')]}}; \ No newline at end of file +var _0xa562=['INTEGER','sequelize','exports','STRING','name','VIRTUAL','system-'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xa562,0x1d6));var _0x2a56=function(_0x1c3e42,_0x1a4fe9){_0x1c3e42=_0x1c3e42-0x0;var _0x348fdc=_0xa562[_0x1c3e42];return _0x348fdc;};'use strict';var Sequelize=require(_0x2a56('0x0'));module[_0x2a56('0x1')]={'name':{'type':Sequelize[_0x2a56('0x2')],'allowNull':![],'unique':_0x2a56('0x3')},'prefix':{'type':Sequelize[_0x2a56('0x4')],'get':function(_0x5c7acc){return _0x2a56('0x5')+this['getDataValue'](_0x2a56('0x3'))+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize[_0x2a56('0x6')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index edd9fdc..2abe1de 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 _0xfff0=['moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./voicePrefix.socket','register','status','json','offset','undefined','limit','set','apply','reject','update','then','destroy','get','VoicePrefixes','UserProfileResource','end','sendStatus','error','stack','name','index','map','VoicePrefix','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','count','include','findAll','rows','show','params','includeAll','options','find','catch','describe','create','sequelize','body','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','app','description','Voice\x20Prefix\x20Extension','priority','appdata','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','prefix','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','${EXTEN:','charAt','system-','transaction','findById','addAgents','ids','spread','userVoicePrefix:save','removeAgents','isArray','emit','userVoicePrefix:remove','findOne','User','getAgents','getTeams','Team','addTeams','Agents','online','voicePause','interface','flatMap','each','upsert','UserVoicePrefix','findOrCreate','select','field','tq.TeamId','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','every','TeamId','all','value','removeTeams','isEmpty','rimraf','zip-dir','fast-json-patch'];(function(_0x2eae90,_0x3b09f2){var _0x27fce6=function(_0x30c5c7){while(--_0x30c5c7){_0x2eae90['push'](_0x2eae90['shift']());}};_0x27fce6(++_0x3b09f2);}(_0xfff0,0x139));var _0x0fff=function(_0x2dcdba,_0x32dbfd){_0x2dcdba=_0x2dcdba-0x0;var _0x67968c=_0xfff0[_0x2dcdba];return _0x67968c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0fff('0x0'));var zipdir=require(_0x0fff('0x1'));var jsonpatch=require(_0x0fff('0x2'));var rp=require('request-promise');var moment=require(_0x0fff('0x3'));var BPromise=require(_0x0fff('0x4'));var Mustache=require(_0x0fff('0x5'));var util=require('util');var path=require(_0x0fff('0x6'));var sox=require(_0x0fff('0x7'));var csv=require('to-csv');var ejs=require(_0x0fff('0x8'));var fs=require('fs');var fs_extra=require(_0x0fff('0x9'));var _=require(_0x0fff('0xa'));var squel=require('squel');var crypto=require(_0x0fff('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x0fff('0xc'));var toCsv=require('to-csv');var querystring=require(_0x0fff('0xd'));var Papa=require(_0x0fff('0xe'));var Redis=require('ioredis');var authService=require(_0x0fff('0xf'));var qs=require(_0x0fff('0x10'));var as=require(_0x0fff('0x11'));var hardwareService=require(_0x0fff('0x12'));var logger=require(_0x0fff('0x13'))(_0x0fff('0x14'));var utils=require(_0x0fff('0x15'));var config=require(_0x0fff('0x16'));var licenseUtil=require(_0x0fff('0x17'));var db=require(_0x0fff('0x18'))['db'];config[_0x0fff('0x19')]=_['defaults'](config[_0x0fff('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x0fff('0x1a'))(new Redis(config[_0x0fff('0x19')]));require(_0x0fff('0x1b'))[_0x0fff('0x1c')](socket);function respondWithStatusCode(_0x55e5fa,_0x53bde9){_0x53bde9=_0x53bde9||0xcc;return function(_0x1daf30){if(_0x1daf30){return _0x55e5fa['sendStatus'](_0x53bde9);}return _0x55e5fa['status'](_0x53bde9)['end']();};}function respondWithResult(_0x1fb430,_0x41e2e7){_0x41e2e7=_0x41e2e7||0xc8;return function(_0x5eab2e){if(_0x5eab2e){return _0x1fb430[_0x0fff('0x1d')](_0x41e2e7)[_0x0fff('0x1e')](_0x5eab2e);}};}function respondWithFilteredResult(_0x540a67,_0x528071){return function(_0x48f36d){if(_0x48f36d){var _0x2337f=typeof _0x528071[_0x0fff('0x1f')]===_0x0fff('0x20')&&typeof _0x528071[_0x0fff('0x21')]===_0x0fff('0x20');var _0xe89b4a=_0x48f36d['count'];var _0x44a54a=_0x2337f?0x0:_0x528071[_0x0fff('0x1f')];var _0x48e6f9=_0x2337f?_0x48f36d['count']:_0x528071['offset']+_0x528071[_0x0fff('0x21')];var _0x330e29;if(_0x48e6f9>=_0xe89b4a){_0x48e6f9=_0xe89b4a;_0x330e29=0xc8;}else{_0x330e29=0xce;}_0x540a67[_0x0fff('0x1d')](_0x330e29);return _0x540a67[_0x0fff('0x22')]('Content-Range',_0x44a54a+'-'+_0x48e6f9+'/'+_0xe89b4a)[_0x0fff('0x1e')](_0x48f36d);}return null;};}function patchUpdates(_0x2f8665){return function(_0x29d703){try{jsonpatch[_0x0fff('0x23')](_0x29d703,_0x2f8665,!![]);}catch(_0x16e7f4){return BPromise[_0x0fff('0x24')](_0x16e7f4);}return _0x29d703['save']();};}function saveUpdates(_0x6a116c,_0x29f702){return function(_0x37e090){if(_0x37e090){return _0x37e090[_0x0fff('0x25')](_0x6a116c)[_0x0fff('0x26')](function(_0x23d9f8){return _0x23d9f8;});}return null;};}function removeEntity(_0x482e1e,_0x2c9725){return function(_0x87b3a6){if(_0x87b3a6){return _0x87b3a6[_0x0fff('0x27')]()[_0x0fff('0x26')](function(){var _0x36d268=_0x87b3a6[_0x0fff('0x28')]({'plain':!![]});var _0x27bd76=_0x0fff('0x29');return db[_0x0fff('0x2a')][_0x0fff('0x27')]({'where':{'type':_0x27bd76,'resourceId':_0x36d268['id']}})[_0x0fff('0x26')](function(){return _0x87b3a6;});})[_0x0fff('0x26')](function(){_0x482e1e['status'](0xcc)[_0x0fff('0x2b')]();});}};}function handleEntityNotFound(_0x2d1800,_0x17ab6f){return function(_0x42441e){if(!_0x42441e){_0x2d1800[_0x0fff('0x2c')](0x194);}return _0x42441e;};}function handleError(_0x125844,_0x47dde0){_0x47dde0=_0x47dde0||0x1f4;return function(_0x31f9a4){logger[_0x0fff('0x2d')](_0x31f9a4[_0x0fff('0x2e')]);if(_0x31f9a4['name']){delete _0x31f9a4[_0x0fff('0x2f')];}_0x125844[_0x0fff('0x1d')](_0x47dde0)['send'](_0x31f9a4);};}exports[_0x0fff('0x30')]=function(_0x433de6,_0x15bb46){var _0x15ae24={},_0x25ab2a={},_0x263e9e={'count':0x0,'rows':[]};var _0x1da352=_[_0x0fff('0x31')](db[_0x0fff('0x32')][_0x0fff('0x33')],function(_0x58469b){return{'name':_0x58469b[_0x0fff('0x34')],'type':_0x58469b[_0x0fff('0x35')][_0x0fff('0x36')]};});_0x25ab2a[_0x0fff('0x37')]=_[_0x0fff('0x31')](_0x1da352,'name');_0x25ab2a['query']=_[_0x0fff('0x38')](_0x433de6[_0x0fff('0x39')]);_0x25ab2a[_0x0fff('0x3a')]=_[_0x0fff('0x3b')](_0x25ab2a['model'],_0x25ab2a[_0x0fff('0x39')]);_0x15ae24[_0x0fff('0x3c')]=_[_0x0fff('0x3b')](_0x25ab2a[_0x0fff('0x37')],qs['fields'](_0x433de6[_0x0fff('0x39')][_0x0fff('0x3d')]));_0x15ae24[_0x0fff('0x3c')]=_0x15ae24[_0x0fff('0x3c')][_0x0fff('0x3e')]?_0x15ae24[_0x0fff('0x3c')]:_0x25ab2a[_0x0fff('0x37')];if(!_0x433de6[_0x0fff('0x39')][_0x0fff('0x3f')](_0x0fff('0x40'))){_0x15ae24[_0x0fff('0x21')]=qs[_0x0fff('0x21')](_0x433de6['query'][_0x0fff('0x21')]);_0x15ae24[_0x0fff('0x1f')]=qs[_0x0fff('0x1f')](_0x433de6[_0x0fff('0x39')][_0x0fff('0x1f')]);}_0x15ae24[_0x0fff('0x41')]=qs['sort'](_0x433de6[_0x0fff('0x39')][_0x0fff('0x42')]);_0x15ae24[_0x0fff('0x43')]=qs[_0x0fff('0x3a')](_[_0x0fff('0x44')](_0x433de6[_0x0fff('0x39')],_0x25ab2a[_0x0fff('0x3a')]),_0x1da352);if(_0x433de6[_0x0fff('0x39')][_0x0fff('0x45')]){_0x15ae24['where']=_[_0x0fff('0x46')](_0x15ae24['where'],{'$or':_[_0x0fff('0x31')](_0x1da352,function(_0x30f329){if(_0x30f329[_0x0fff('0x35')]!=='VIRTUAL'){var _0x5d4c24={};_0x5d4c24[_0x30f329[_0x0fff('0x2f')]]={'$like':'%'+_0x433de6[_0x0fff('0x39')][_0x0fff('0x45')]+'%'};return _0x5d4c24;}})});}_0x15ae24=_['merge']({},_0x15ae24,_0x433de6['options']);var _0x4668b3={'where':_0x15ae24['where']};return db[_0x0fff('0x32')][_0x0fff('0x47')](_0x4668b3)[_0x0fff('0x26')](function(_0x309d75){_0x263e9e[_0x0fff('0x47')]=_0x309d75;if(_0x433de6[_0x0fff('0x39')]['includeAll']){_0x15ae24[_0x0fff('0x48')]=[{'all':!![]}];}return db[_0x0fff('0x32')][_0x0fff('0x49')](_0x15ae24);})[_0x0fff('0x26')](function(_0x7157e5){_0x263e9e[_0x0fff('0x4a')]=_0x7157e5;return _0x263e9e;})[_0x0fff('0x26')](respondWithFilteredResult(_0x15bb46,_0x15ae24))['catch'](handleError(_0x15bb46,null));};exports[_0x0fff('0x4b')]=function(_0x244a27,_0x101b3a){var _0x56a121={'raw':![],'where':{'id':_0x244a27[_0x0fff('0x4c')]['id']}},_0x2de540={};_0x2de540[_0x0fff('0x37')]=_[_0x0fff('0x38')](db[_0x0fff('0x32')][_0x0fff('0x33')]);_0x2de540[_0x0fff('0x39')]=_[_0x0fff('0x38')](_0x244a27[_0x0fff('0x39')]);_0x2de540[_0x0fff('0x3a')]=_[_0x0fff('0x3b')](_0x2de540['model'],_0x2de540[_0x0fff('0x39')]);_0x56a121[_0x0fff('0x3c')]=_['intersection'](_0x2de540[_0x0fff('0x37')],qs[_0x0fff('0x3d')](_0x244a27[_0x0fff('0x39')]['fields']));_0x56a121['attributes']=_0x56a121[_0x0fff('0x3c')]['length']?_0x56a121['attributes']:_0x2de540[_0x0fff('0x37')];if(_0x244a27[_0x0fff('0x39')][_0x0fff('0x4d')]){_0x56a121[_0x0fff('0x48')]=[{'all':!![]}];}_0x56a121=_[_0x0fff('0x46')]({},_0x56a121,_0x244a27[_0x0fff('0x4e')]);return db['VoicePrefix'][_0x0fff('0x4f')](_0x56a121)[_0x0fff('0x26')](handleEntityNotFound(_0x101b3a,null))[_0x0fff('0x26')](respondWithResult(_0x101b3a,null))[_0x0fff('0x50')](handleError(_0x101b3a,null));};exports[_0x0fff('0x27')]=function(_0x2c725c,_0x5d1739){return db[_0x0fff('0x32')][_0x0fff('0x4f')]({'where':{'id':_0x2c725c['params']['id']}})[_0x0fff('0x26')](handleEntityNotFound(_0x5d1739,null))['then'](removeEntity(_0x5d1739,null))['catch'](handleError(_0x5d1739,null));};exports['describe']=function(_0x218e1c,_0x30967c){return db[_0x0fff('0x32')][_0x0fff('0x51')]()[_0x0fff('0x26')](respondWithResult(_0x30967c,null))['catch'](handleError(_0x30967c,null));};exports[_0x0fff('0x52')]=function(_0x2c765f,_0x2cbe43){var _0x3b6c98;return db[_0x0fff('0x53')]['transaction'](function(_0x3b401c){return db[_0x0fff('0x32')][_0x0fff('0x52')](_0x2c765f[_0x0fff('0x54')],{'transaction':_0x3b401c})[_0x0fff('0x26')](function(_0x2e8242){_0x3b6c98=_0x2e8242[_0x0fff('0x28')]({'plain':!![]});return db[_0x0fff('0x55')][_0x0fff('0x4f')]({'where':{'id':_0x3b6c98[_0x0fff('0x56')]},'raw':!![]})[_0x0fff('0x26')](function(_0x38168e){return createVoicePrefixExtensions(_0x3b6c98,_0x38168e,_0x3b401c);});});})[_0x0fff('0x26')](function(){var _0x2608be=_0x2c765f[_0x0fff('0x57')][_0x0fff('0x28')]({'plain':!![]});if(!_0x2608be)throw new Error(_0x0fff('0x58'));if(_0x2608be[_0x0fff('0x59')]===_0x0fff('0x57')){var _0x398513=_0x3b6c98;return db[_0x0fff('0x5a')]['find']({'where':{'name':_0x0fff('0x29'),'userProfileId':_0x2608be[_0x0fff('0x5b')]},'raw':!![]})[_0x0fff('0x26')](function(_0x2744b4){if(_0x2744b4&&_0x2744b4['autoAssociation']===0x0){return db[_0x0fff('0x2a')]['create']({'name':_0x398513[_0x0fff('0x2f')],'resourceId':_0x398513['id'],'type':_0x2744b4[_0x0fff('0x2f')],'sectionId':_0x2744b4['id']},{})[_0x0fff('0x26')](function(){return _0x3b6c98;});}else{return _0x3b6c98;}})[_0x0fff('0x50')](function(_0x4bf865){logger[_0x0fff('0x2d')](_0x0fff('0x5c'),_0x4bf865);throw _0x4bf865;});}return _0x3b6c98;})[_0x0fff('0x26')](respondWithResult(_0x2cbe43,null))[_0x0fff('0x50')](handleError(_0x2cbe43,null));};function Extension(_0x4cf619,_0x5ba7e7,_0x449da4,_0x40b8f0){this[_0x0fff('0x5d')]=_0x0fff('0x5e');this[_0x0fff('0x5f')]=_0x4cf619;this[_0x0fff('0x60')]=_0x449da4;this['type']='system';this[_0x0fff('0x61')]=_0x0fff('0x62');this[_0x0fff('0x63')]=_0x5ba7e7;this[_0x0fff('0x64')]=_0x40b8f0;}function createVoicePrefixExtensions(_0x28403f,_0x6a37c9,_0x33eb07){return new BPromise(function(_0x40e5ec,_0x5f2fcc){var _0x12fe95=new Extension(formatPrefixName(_0x28403f['prefix']),0x1,_0x0fff('0x65'),_0x0fff('0x66'));_0x12fe95[_0x0fff('0x67')]=_0x28403f['id'];return db['VoiceExtension']['create'](_0x12fe95,{'transaction':_0x33eb07})[_0x0fff('0x26')](function(_0x504212){var _0x140a35=_0x504212[_0x0fff('0x28')]({'plain':!![]});var _0x452160=_[_0x0fff('0x31')](addVoicePrefixExtensions(_0x28403f,_0x6a37c9),function(_0x4e3a31){_0x4e3a31[_0x0fff('0x56')]=_0x140a35['id'];_0x4e3a31[_0x0fff('0x67')]=_0x28403f['id'];return _0x4e3a31;});return db['VoiceExtension'][_0x0fff('0x68')](_0x452160,{'transaction':_0x33eb07})[_0x0fff('0x26')](function(_0x1111c8){if(!_0x1111c8){return _0x5f2fcc('Extensions\x20creation\x20failed');}else{return _0x40e5ec(_0x1111c8);}})[_0x0fff('0x50')](function(_0x1dc3d6){return _0x5f2fcc(_0x1dc3d6);});});;});};function addVoicePrefixExtensions(_0x1414af,_0x383d78){var _0x3bb183=[];var _0xf4fb1e=formatPrefixName(_0x1414af[_0x0fff('0x69')]);_0x3bb183[_0x0fff('0x6a')](new Extension(_0xf4fb1e,0x2,_0x0fff('0x6b'),_0x0fff('0x6c')+_0x1414af[_0x0fff('0x2f')]));if(_0x1414af[_0x0fff('0x6d')]){_0x3bb183['push'](new Extension(_0xf4fb1e,0x3,'Set',_0x0fff('0x6e')+_0x1414af['callerIdAll']));}else{_0x3bb183['push'](new Extension(_0xf4fb1e,0x3,_0x0fff('0x65'),_0x0fff('0x6f')));}_0x3bb183[_0x0fff('0x6a')](new Extension(_0xf4fb1e,0x4,'goto',_0x383d78['context']+','+_0x0fff('0x70')+(0x8+_0x1414af[_0x0fff('0x2f')][_0x0fff('0x3e')])+'}'+','+0x1));return _0x3bb183;}function formatPrefixName(_0x2586c6){var _0x5af278='_';for(var _0x2f865a=0x0;_0x2f865a<_0x2586c6[_0x0fff('0x3e')];_0x2f865a++){if(_0x2586c6[_0x0fff('0x71')](_0x2f865a)=='-'){_0x5af278+=_0x2586c6[_0x0fff('0x71')](_0x2f865a);}else{_0x5af278+='['+_0x2586c6['charAt'](_0x2f865a)+']';}}_0x5af278+='.';return _0x5af278;}exports[_0x0fff('0x25')]=function(_0x1858fb,_0x4c08c3,_0x51fbf5){var _0x33ed23=_0x1858fb[_0x0fff('0x54')];_0x33ed23[_0x0fff('0x69')]=_0x0fff('0x72')+_0x33ed23[_0x0fff('0x2f')]+'-';return db['sequelize'][_0x0fff('0x73')](function(_0x7b040){return db[_0x0fff('0x32')][_0x0fff('0x25')](_0x33ed23,{'where':{'id':_0x33ed23['id']},'transaction':_0x7b040})[_0x0fff('0x26')](function(){return db['VoiceExtension']['destroy']({'where':{'VoicePrefixId':_0x33ed23['id']},'transaction':_0x7b040})[_0x0fff('0x26')](function(){return db['VoiceExtension'][_0x0fff('0x4f')]({'where':{'id':_0x33ed23[_0x0fff('0x56')]},'raw':!![]})[_0x0fff('0x26')](function(_0x712db4){return createVoicePrefixExtensions(_0x33ed23,_0x712db4,_0x7b040);});});});})[_0x0fff('0x26')](function(){return db['VoicePrefix'][_0x0fff('0x74')](_0x33ed23['id']);})[_0x0fff('0x26')](respondWithResult(_0x4c08c3,null))[_0x0fff('0x50')](handleError(_0x4c08c3,null));};exports[_0x0fff('0x75')]=function(_0x31ff4e,_0x15ab8e,_0x38e2e9){return db[_0x0fff('0x32')][_0x0fff('0x4f')]({'where':{'id':_0x31ff4e[_0x0fff('0x4c')]['id']}})[_0x0fff('0x26')](handleEntityNotFound(_0x15ab8e,null))['then'](function(_0x134012){if(_0x134012){return _0x134012[_0x0fff('0x75')](_0x31ff4e['body'][_0x0fff('0x76')],_['omit'](_0x31ff4e[_0x0fff('0x54')],[_0x0fff('0x76'),'id'])||{})[_0x0fff('0x77')](function(_0x8799c2){for(var _0x13d90e=0x0;_0x13d90e<_0x31ff4e['body'][_0x0fff('0x76')][_0x0fff('0x3e')];_0x13d90e+=0x1){socket['emit'](_0x0fff('0x78'),{'UserId':Number(_0x31ff4e[_0x0fff('0x54')][_0x0fff('0x76')][_0x13d90e]),'VoicePrefixId':Number(_0x31ff4e['params']['id'])});}return _0x8799c2;});}})[_0x0fff('0x26')](respondWithResult(_0x15ab8e,null))[_0x0fff('0x50')](handleError(_0x15ab8e,null));};exports['removeAgents']=function(_0x567544,_0x404b97,_0x49711a){return db['VoicePrefix'][_0x0fff('0x4f')]({'where':{'id':_0x567544[_0x0fff('0x4c')]['id']}})[_0x0fff('0x26')](handleEntityNotFound(_0x404b97,null))['then'](function(_0x4f7282){if(_0x4f7282){return _0x4f7282[_0x0fff('0x79')](_0x567544['query'][_0x0fff('0x76')])[_0x0fff('0x26')](function(){if(_[_0x0fff('0x7a')](_0x567544[_0x0fff('0x39')][_0x0fff('0x76')])){for(var _0x1e940c=0x0;_0x1e940c<_0x567544[_0x0fff('0x39')]['ids'][_0x0fff('0x3e')];_0x1e940c+=0x1){socket[_0x0fff('0x7b')](_0x0fff('0x7c'),{'UserId':Number(_0x567544[_0x0fff('0x39')][_0x0fff('0x76')][_0x1e940c]),'VoicePrefixId':Number(_0x567544[_0x0fff('0x4c')]['id'])});}}else{socket['emit'](_0x0fff('0x7c'),{'UserId':Number(_0x567544['query'][_0x0fff('0x76')]),'VoicePrefixId':Number(_0x567544[_0x0fff('0x4c')]['id'])});}});}})[_0x0fff('0x26')](respondWithStatusCode(_0x404b97,null))[_0x0fff('0x50')](handleError(_0x404b97,null));};exports['getAgents']=function(_0x4fc7c7,_0x34dd99,_0x5baf7f){var _0x3d820e={};var _0x125b12={};var _0x5093fc;var _0x5b04f2;return db[_0x0fff('0x32')][_0x0fff('0x7d')]({'where':{'id':_0x4fc7c7[_0x0fff('0x4c')]['id']}})[_0x0fff('0x26')](handleEntityNotFound(_0x34dd99,null))['then'](function(_0x407f0a){if(_0x407f0a){_0x5093fc=_0x407f0a;_0x125b12['model']=_[_0x0fff('0x38')](db[_0x0fff('0x7e')][_0x0fff('0x33')]);_0x125b12['query']=_['keys'](_0x4fc7c7['query']);_0x125b12[_0x0fff('0x3a')]=_['intersection'](_0x125b12[_0x0fff('0x37')],_0x125b12[_0x0fff('0x39')]);_0x3d820e[_0x0fff('0x3c')]=_[_0x0fff('0x3b')](_0x125b12[_0x0fff('0x37')],qs[_0x0fff('0x3d')](_0x4fc7c7[_0x0fff('0x39')][_0x0fff('0x3d')]));_0x3d820e[_0x0fff('0x3c')]=_0x3d820e[_0x0fff('0x3c')][_0x0fff('0x3e')]?_0x3d820e['attributes']:_0x125b12[_0x0fff('0x37')];_0x3d820e[_0x0fff('0x41')]=qs[_0x0fff('0x42')](_0x4fc7c7[_0x0fff('0x39')][_0x0fff('0x42')]);_0x3d820e['where']=qs[_0x0fff('0x3a')](_[_0x0fff('0x44')](_0x4fc7c7['query'],_0x125b12[_0x0fff('0x3a')]));if(_0x4fc7c7[_0x0fff('0x39')][_0x0fff('0x45')]){_0x3d820e[_0x0fff('0x43')]=_[_0x0fff('0x46')](_0x3d820e[_0x0fff('0x43')],{'$or':_[_0x0fff('0x31')](_0x3d820e[_0x0fff('0x3c')],function(_0x40c4f3){var _0x1c059b={};_0x1c059b[_0x40c4f3]={'$like':'%'+_0x4fc7c7['query'][_0x0fff('0x45')]+'%'};return _0x1c059b;})});}_0x3d820e=_[_0x0fff('0x46')]({},_0x3d820e,_0x4fc7c7[_0x0fff('0x4e')]);return _0x5093fc[_0x0fff('0x7f')](_0x3d820e);}})[_0x0fff('0x26')](function(_0x2fdf96){if(_0x2fdf96){_0x5b04f2=_0x2fdf96[_0x0fff('0x3e')];if(!_0x4fc7c7['query'][_0x0fff('0x3f')]('nolimit')){_0x3d820e[_0x0fff('0x21')]=qs[_0x0fff('0x21')](_0x4fc7c7[_0x0fff('0x39')][_0x0fff('0x21')]);_0x3d820e[_0x0fff('0x1f')]=qs['offset'](_0x4fc7c7[_0x0fff('0x39')]['offset']);}return _0x5093fc['getAgents'](_0x3d820e);}})[_0x0fff('0x26')](function(_0x173b44){if(_0x173b44){return _0x173b44?{'count':_0x5b04f2,'rows':_0x173b44}:null;}})[_0x0fff('0x26')](respondWithResult(_0x34dd99,null))[_0x0fff('0x50')](handleError(_0x34dd99,null));};exports[_0x0fff('0x80')]=function(_0x3995b9,_0x5bc4e1,_0x50f95c){var _0x5b637e={};var _0x1bd02a={};var _0x41b755;var _0x4012aa;return db[_0x0fff('0x32')][_0x0fff('0x7d')]({'where':{'id':_0x3995b9[_0x0fff('0x4c')]['id']}})[_0x0fff('0x26')](handleEntityNotFound(_0x5bc4e1,null))[_0x0fff('0x26')](function(_0xed7e93){if(_0xed7e93){_0x41b755=_0xed7e93;_0x1bd02a[_0x0fff('0x37')]=_[_0x0fff('0x38')](db[_0x0fff('0x81')][_0x0fff('0x33')]);_0x1bd02a[_0x0fff('0x39')]=_[_0x0fff('0x38')](_0x3995b9[_0x0fff('0x39')]);_0x1bd02a[_0x0fff('0x3a')]=_['intersection'](_0x1bd02a[_0x0fff('0x37')],_0x1bd02a[_0x0fff('0x39')]);_0x5b637e[_0x0fff('0x3c')]=_[_0x0fff('0x3b')](_0x1bd02a[_0x0fff('0x37')],qs[_0x0fff('0x3d')](_0x3995b9[_0x0fff('0x39')]['fields']));_0x5b637e[_0x0fff('0x3c')]=_0x5b637e[_0x0fff('0x3c')]['length']?_0x5b637e[_0x0fff('0x3c')]:_0x1bd02a['model'];_0x5b637e[_0x0fff('0x41')]=qs[_0x0fff('0x42')](_0x3995b9['query']['sort']);_0x5b637e['where']=qs[_0x0fff('0x3a')](_['pick'](_0x3995b9['query'],_0x1bd02a['filters']));if(_0x3995b9['query'][_0x0fff('0x45')]){_0x5b637e['where']=_[_0x0fff('0x46')](_0x5b637e['where'],{'$or':_[_0x0fff('0x31')](_0x5b637e['attributes'],function(_0x465dde){var _0x9ca531={};_0x9ca531[_0x465dde]={'$like':'%'+_0x3995b9['query']['filter']+'%'};return _0x9ca531;})});}_0x5b637e=_[_0x0fff('0x46')]({},_0x5b637e,_0x3995b9[_0x0fff('0x4e')]);return _0x41b755[_0x0fff('0x80')](_0x5b637e);}})[_0x0fff('0x26')](function(_0x675250){if(_0x675250){_0x4012aa=_0x675250[_0x0fff('0x3e')];if(!_0x3995b9[_0x0fff('0x39')]['hasOwnProperty'](_0x0fff('0x40'))){_0x5b637e[_0x0fff('0x21')]=qs[_0x0fff('0x21')](_0x3995b9[_0x0fff('0x39')]['limit']);_0x5b637e[_0x0fff('0x1f')]=qs[_0x0fff('0x1f')](_0x3995b9[_0x0fff('0x39')]['offset']);}return _0x41b755['getTeams'](_0x5b637e);}})[_0x0fff('0x26')](function(_0x37b5b4){if(_0x37b5b4){return _0x37b5b4?{'count':_0x4012aa,'rows':_0x37b5b4}:null;}})['then'](respondWithResult(_0x5bc4e1,null))[_0x0fff('0x50')](handleError(_0x5bc4e1,null));};exports[_0x0fff('0x82')]=function(_0x4ab665,_0x2ab827,_0x2a2af9){var _0x2ca40b=_0x4ab665['body']['ids'];var _0x2eeee9;return db[_0x0fff('0x81')]['findAll']({'where':{'id':_0x2ca40b},'attributes':['id'],'include':[{'model':db[_0x0fff('0x7e')],'as':_0x0fff('0x83'),'attributes':['id',_0x0fff('0x2f'),_0x0fff('0x84'),_0x0fff('0x85'),_0x0fff('0x86')],'raw':!![]}]})[_0x0fff('0x26')](function(_0x1b500a){if(_0x1b500a){_0x2eeee9=_0x1b500a;var _0x327b5=_[_0x0fff('0x87')](_0x1b500a,function(_0x10aa61){var _0xc99224=_0x10aa61['get']({'plain':!![]});return _0xc99224[_0x0fff('0x83')];});return db['VoicePrefix'][_0x0fff('0x4f')]({'where':{'id':_0x4ab665['params']['id']}})[_0x0fff('0x26')](function(_0x5336){return db[_0x0fff('0x53')][_0x0fff('0x73')](function(_0x42fbff){return _0x5336[_0x0fff('0x82')](_0x2ca40b,{'transaction':_0x42fbff})['then'](function(){return BPromise[_0x0fff('0x88')](_0x2eeee9,function(_0x39565f){return db['TeamVoicePrefix'][_0x0fff('0x89')]({'TeamId':_0x39565f['id'],'VoicePrefixId':_0x4ab665['params']['id']},{'transaction':_0x42fbff});});})['then'](function(){return BPromise[_0x0fff('0x88')](_0x327b5,function(_0x2e38c3){return db[_0x0fff('0x8a')][_0x0fff('0x8b')]({'where':{'UserId':_0x2e38c3['id'],'VoicePrefixId':_0x4ab665[_0x0fff('0x4c')]['id']},'transaction':_0x42fbff});});})[_0x0fff('0x26')](function(){_0x327b5['forEach'](function(_0xe02ca6){socket[_0x0fff('0x7b')](_0x0fff('0x78'),{'UserId':_0xe02ca6['id'],'VoicePrefixId':_0x5336['id']});});});});});}})[_0x0fff('0x26')](respondWithStatusCode(_0x2ab827,null))[_0x0fff('0x50')](handleError(_0x2ab827,null));};exports['removeTeams']=function(_0x25e9f2,_0xf73eb6,_0x87df03){return db[_0x0fff('0x81')][_0x0fff('0x49')]({'where':{'id':_0x25e9f2[_0x0fff('0x39')][_0x0fff('0x76')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x0fff('0x26')](handleEntityNotFound(_0xf73eb6,null))['then'](function(_0x2d206c){var _0x5ed120=_['map'](_0x2d206c,'id');var _0x592341=[];var _0x2e1625=[];var _0x128fe1=squel[_0x0fff('0x8c')]();_0x128fe1[_0x0fff('0x8d')](_0x0fff('0x8e'))['from'](_0x0fff('0x8f'),'tq')[_0x0fff('0x90')](_0x0fff('0x91'),'ut',_0x0fff('0x92'))[_0x0fff('0x43')](_0x0fff('0x93'),_0x25e9f2[_0x0fff('0x4c')]['id']);for(var _0x115445=0x0;_0x115445<_0x2d206c['length'];_0x115445+=0x1){let _0x596074=_0x2d206c[_0x115445];for(var _0x1f1946=0x0;_0x1f1946<_0x596074[_0x0fff('0x83')][_0x0fff('0x3e')];_0x1f1946+=0x1){let _0x47ff09=_0x596074[_0x0fff('0x83')][_0x1f1946];var _0x2ae986=_0x128fe1[_0x0fff('0x94')]();_0x2ae986['where'](_0x0fff('0x95'),_0x47ff09['id']);_0x2e1625[_0x0fff('0x6a')](db[_0x0fff('0x53')][_0x0fff('0x39')](_0x2ae986[_0x0fff('0x96')](),{'type':db[_0x0fff('0x53')][_0x0fff('0x97')]['SELECT']})['then'](function(_0x4a70ee){if(_0x4a70ee[_0x0fff('0x3e')]===0x1){return _0x47ff09['id'];}else{var _0x425412=_[_0x0fff('0x98')](_[_0x0fff('0x31')](_0x4a70ee,_0x0fff('0x99')),function(_0x41afce){return _['includes'](_0x5ed120,_0x41afce);});if(_0x425412){return _0x47ff09['id'];}}}));}}return BPromise[_0x0fff('0x9a')](_0x2e1625)[_0x0fff('0x26')](function(_0x7928f7){_0x592341=_(_0x592341)['union'](_0x7928f7)['compact']()[_0x0fff('0x9b')]();return db['VoicePrefix'][_0x0fff('0x4f')]({'where':{'id':_0x25e9f2[_0x0fff('0x4c')]['id']}})['then'](function(_0x1bf39f){return db[_0x0fff('0x53')]['transaction'](function(_0xb6faf){return _0x1bf39f[_0x0fff('0x9c')](_0x25e9f2[_0x0fff('0x39')][_0x0fff('0x76')],{'transaction':_0xb6faf})[_0x0fff('0x26')](function(){if(!_[_0x0fff('0x9d')](_0x592341)){return _0x1bf39f['removeAgents'](_0x592341,{'transaction':_0xb6faf});}})[_0x0fff('0x26')](function(){_0x592341['forEach'](function(_0xf72b2b){socket['emit'](_0x0fff('0x7c'),{'UserId':_0xf72b2b,'VoicePrefixId':_0x1bf39f['id']});});});});});});})['then'](respondWithStatusCode(_0xf73eb6,null))[_0x0fff('0x50')](handleError(_0xf73eb6,null));}; \ No newline at end of file +var _0x236c=['User','getAgents','getTeams','Team','pick','addTeams','findAll','Agents','online','interface','flatMap','each','TeamVoicePrefix','UserVoicePrefix','findOrCreate','forEach','removeTeams','select','team_has_voice_prefixes','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','TeamId','includes','all','union','compact','value','isEmpty','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','socket.io-emitter','redis','./voicePrefix.socket','register','status','end','undefined','count','offset','limit','set','json','apply','reject','save','update','then','UserProfileResource','sendStatus','stack','name','send','index','map','VoicePrefix','rawAttributes','fieldName','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','filter','where','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','find','destroy','params','describe','create','sequelize','transaction','get','VoiceExtension','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','context','exten','system','description','Voice\x20Prefix\x20Extension','appdata','prefix','NoOp','Voice\x20Prefix','bulkCreate','push','Set','CDR(prefix)=','callerIdAll','No\x20callerid\x20available','goto','${EXTEN:','charAt','body','system-','findById','addAgents','ids','omit','spread','removeAgents','isArray','emit','userVoicePrefix:remove','findOne'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x236c,0x155));var _0xc236=function(_0x32cbcb,_0x488e84){_0x32cbcb=_0x32cbcb-0x0;var _0x1a521c=_0x236c[_0x32cbcb];return _0x1a521c;};'use strict';var emlformat=require(_0xc236('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc236('0x1'));var jsonpatch=require(_0xc236('0x2'));var rp=require(_0xc236('0x3'));var moment=require(_0xc236('0x4'));var BPromise=require(_0xc236('0x5'));var Mustache=require('mustache');var util=require(_0xc236('0x6'));var path=require(_0xc236('0x7'));var sox=require(_0xc236('0x8'));var csv=require(_0xc236('0x9'));var ejs=require(_0xc236('0xa'));var fs=require('fs');var fs_extra=require(_0xc236('0xb'));var _=require('lodash');var squel=require(_0xc236('0xc'));var crypto=require(_0xc236('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc236('0xe'));var Papa=require('papaparse');var Redis=require(_0xc236('0xf'));var authService=require(_0xc236('0x10'));var qs=require(_0xc236('0x11'));var as=require(_0xc236('0x12'));var hardwareService=require(_0xc236('0x13'));var logger=require('../../config/logger')(_0xc236('0x14'));var utils=require(_0xc236('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xc236('0x16'));var db=require(_0xc236('0x17'))['db'];config['redis']=_[_0xc236('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xc236('0x19'))(new Redis(config[_0xc236('0x1a')]));require(_0xc236('0x1b'))[_0xc236('0x1c')](socket);function respondWithStatusCode(_0x5052db,_0x13a42b){_0x13a42b=_0x13a42b||0xcc;return function(_0x55b188){if(_0x55b188){return _0x5052db['sendStatus'](_0x13a42b);}return _0x5052db[_0xc236('0x1d')](_0x13a42b)[_0xc236('0x1e')]();};}function respondWithResult(_0x443a46,_0x1aeafc){_0x1aeafc=_0x1aeafc||0xc8;return function(_0x267913){if(_0x267913){return _0x443a46['status'](_0x1aeafc)['json'](_0x267913);}};}function respondWithFilteredResult(_0x57355b,_0x3f5884){return function(_0x76f45){if(_0x76f45){var _0x11ec65=typeof _0x3f5884['offset']===_0xc236('0x1f')&&typeof _0x3f5884['limit']==='undefined';var _0x1eafba=_0x76f45[_0xc236('0x20')];var _0x3a6183=_0x11ec65?0x0:_0x3f5884[_0xc236('0x21')];var _0x2b6d3f=_0x11ec65?_0x76f45[_0xc236('0x20')]:_0x3f5884[_0xc236('0x21')]+_0x3f5884[_0xc236('0x22')];var _0x54ffac;if(_0x2b6d3f>=_0x1eafba){_0x2b6d3f=_0x1eafba;_0x54ffac=0xc8;}else{_0x54ffac=0xce;}_0x57355b[_0xc236('0x1d')](_0x54ffac);return _0x57355b[_0xc236('0x23')]('Content-Range',_0x3a6183+'-'+_0x2b6d3f+'/'+_0x1eafba)[_0xc236('0x24')](_0x76f45);}return null;};}function patchUpdates(_0x34d73a){return function(_0x3bd41b){try{jsonpatch[_0xc236('0x25')](_0x3bd41b,_0x34d73a,!![]);}catch(_0x27afba){return BPromise[_0xc236('0x26')](_0x27afba);}return _0x3bd41b[_0xc236('0x27')]();};}function saveUpdates(_0xf921e6,_0x1d65e2){return function(_0x3b4059){if(_0x3b4059){return _0x3b4059[_0xc236('0x28')](_0xf921e6)['then'](function(_0x308cd6){return _0x308cd6;});}return null;};}function removeEntity(_0x21d78f,_0x356042){return function(_0x9017ec){if(_0x9017ec){return _0x9017ec['destroy']()[_0xc236('0x29')](function(){var _0x5da4b2=_0x9017ec['get']({'plain':!![]});var _0x15ead8='VoicePrefixes';return db[_0xc236('0x2a')]['destroy']({'where':{'type':_0x15ead8,'resourceId':_0x5da4b2['id']}})[_0xc236('0x29')](function(){return _0x9017ec;});})['then'](function(){_0x21d78f[_0xc236('0x1d')](0xcc)[_0xc236('0x1e')]();});}};}function handleEntityNotFound(_0x4f5175,_0x5a61b5){return function(_0x265c8d){if(!_0x265c8d){_0x4f5175[_0xc236('0x2b')](0x194);}return _0x265c8d;};}function handleError(_0x1f4995,_0x6ad83f){_0x6ad83f=_0x6ad83f||0x1f4;return function(_0x5f3891){logger['error'](_0x5f3891[_0xc236('0x2c')]);if(_0x5f3891['name']){delete _0x5f3891[_0xc236('0x2d')];}_0x1f4995['status'](_0x6ad83f)[_0xc236('0x2e')](_0x5f3891);};}exports[_0xc236('0x2f')]=function(_0x57c99e,_0x5a5ec3){var _0x2537f9={},_0x3053a3={},_0xbda858={'count':0x0,'rows':[]};var _0x2f64bd=_[_0xc236('0x30')](db[_0xc236('0x31')][_0xc236('0x32')],function(_0x22a2ca){return{'name':_0x22a2ca[_0xc236('0x33')],'type':_0x22a2ca['type']['key']};});_0x3053a3['model']=_[_0xc236('0x30')](_0x2f64bd,_0xc236('0x2d'));_0x3053a3[_0xc236('0x34')]=_[_0xc236('0x35')](_0x57c99e[_0xc236('0x34')]);_0x3053a3[_0xc236('0x36')]=_[_0xc236('0x37')](_0x3053a3['model'],_0x3053a3[_0xc236('0x34')]);_0x2537f9[_0xc236('0x38')]=_[_0xc236('0x37')](_0x3053a3['model'],qs[_0xc236('0x39')](_0x57c99e[_0xc236('0x34')][_0xc236('0x39')]));_0x2537f9[_0xc236('0x38')]=_0x2537f9['attributes'][_0xc236('0x3a')]?_0x2537f9[_0xc236('0x38')]:_0x3053a3[_0xc236('0x3b')];if(!_0x57c99e[_0xc236('0x34')][_0xc236('0x3c')](_0xc236('0x3d'))){_0x2537f9[_0xc236('0x22')]=qs[_0xc236('0x22')](_0x57c99e[_0xc236('0x34')][_0xc236('0x22')]);_0x2537f9[_0xc236('0x21')]=qs[_0xc236('0x21')](_0x57c99e[_0xc236('0x34')][_0xc236('0x21')]);}_0x2537f9[_0xc236('0x3e')]=qs[_0xc236('0x3f')](_0x57c99e[_0xc236('0x34')]['sort']);_0x2537f9['where']=qs['filters'](_['pick'](_0x57c99e[_0xc236('0x34')],_0x3053a3['filters']),_0x2f64bd);if(_0x57c99e[_0xc236('0x34')][_0xc236('0x40')]){_0x2537f9[_0xc236('0x41')]=_[_0xc236('0x42')](_0x2537f9[_0xc236('0x41')],{'$or':_[_0xc236('0x30')](_0x2f64bd,function(_0x427de1){if(_0x427de1[_0xc236('0x43')]!==_0xc236('0x44')){var _0x12a270={};_0x12a270[_0x427de1[_0xc236('0x2d')]]={'$like':'%'+_0x57c99e[_0xc236('0x34')][_0xc236('0x40')]+'%'};return _0x12a270;}})});}_0x2537f9=_[_0xc236('0x42')]({},_0x2537f9,_0x57c99e[_0xc236('0x45')]);var _0x594ffc={'where':_0x2537f9[_0xc236('0x41')]};return db[_0xc236('0x31')]['count'](_0x594ffc)[_0xc236('0x29')](function(_0x5b0bc5){_0xbda858[_0xc236('0x20')]=_0x5b0bc5;if(_0x57c99e['query'][_0xc236('0x46')]){_0x2537f9[_0xc236('0x47')]=[{'all':!![]}];}return db[_0xc236('0x31')]['findAll'](_0x2537f9);})[_0xc236('0x29')](function(_0x429e08){_0xbda858[_0xc236('0x48')]=_0x429e08;return _0xbda858;})['then'](respondWithFilteredResult(_0x5a5ec3,_0x2537f9))[_0xc236('0x49')](handleError(_0x5a5ec3,null));};exports[_0xc236('0x4a')]=function(_0x317431,_0x408312){var _0xc35ef9={'raw':![],'where':{'id':_0x317431['params']['id']}},_0x3235b0={};_0x3235b0[_0xc236('0x3b')]=_['keys'](db[_0xc236('0x31')][_0xc236('0x32')]);_0x3235b0[_0xc236('0x34')]=_[_0xc236('0x35')](_0x317431[_0xc236('0x34')]);_0x3235b0[_0xc236('0x36')]=_[_0xc236('0x37')](_0x3235b0['model'],_0x3235b0[_0xc236('0x34')]);_0xc35ef9['attributes']=_[_0xc236('0x37')](_0x3235b0[_0xc236('0x3b')],qs['fields'](_0x317431[_0xc236('0x34')][_0xc236('0x39')]));_0xc35ef9[_0xc236('0x38')]=_0xc35ef9[_0xc236('0x38')][_0xc236('0x3a')]?_0xc35ef9[_0xc236('0x38')]:_0x3235b0[_0xc236('0x3b')];if(_0x317431['query']['includeAll']){_0xc35ef9[_0xc236('0x47')]=[{'all':!![]}];}_0xc35ef9=_[_0xc236('0x42')]({},_0xc35ef9,_0x317431['options']);return db[_0xc236('0x31')][_0xc236('0x4b')](_0xc35ef9)[_0xc236('0x29')](handleEntityNotFound(_0x408312,null))[_0xc236('0x29')](respondWithResult(_0x408312,null))[_0xc236('0x49')](handleError(_0x408312,null));};exports[_0xc236('0x4c')]=function(_0x300523,_0x14a83d){return db[_0xc236('0x31')]['find']({'where':{'id':_0x300523[_0xc236('0x4d')]['id']}})[_0xc236('0x29')](handleEntityNotFound(_0x14a83d,null))[_0xc236('0x29')](removeEntity(_0x14a83d,null))[_0xc236('0x49')](handleError(_0x14a83d,null));};exports[_0xc236('0x4e')]=function(_0x28e6b4,_0x3ea045){return db['VoicePrefix'][_0xc236('0x4e')]()[_0xc236('0x29')](respondWithResult(_0x3ea045,null))[_0xc236('0x49')](handleError(_0x3ea045,null));};exports[_0xc236('0x4f')]=function(_0x4860d8,_0xa34c01){var _0x3e6da6;return db[_0xc236('0x50')][_0xc236('0x51')](function(_0x9d81c8){return db['VoicePrefix'][_0xc236('0x4f')](_0x4860d8['body'],{'transaction':_0x9d81c8})[_0xc236('0x29')](function(_0x93904b){_0x3e6da6=_0x93904b[_0xc236('0x52')]({'plain':!![]});return db[_0xc236('0x53')][_0xc236('0x4b')]({'where':{'id':_0x3e6da6['VoiceExtensionId']},'raw':!![]})['then'](function(_0x3bee67){return createVoicePrefixExtensions(_0x3e6da6,_0x3bee67,_0x9d81c8);});});})[_0xc236('0x29')](function(){var _0x205d09=_0x4860d8[_0xc236('0x54')][_0xc236('0x52')]({'plain':!![]});if(!_0x205d09)throw new Error(_0xc236('0x55'));if(_0x205d09[_0xc236('0x56')]===_0xc236('0x54')){var _0x24af08=_0x3e6da6;return db[_0xc236('0x57')]['find']({'where':{'name':'VoicePrefixes','userProfileId':_0x205d09[_0xc236('0x58')]},'raw':!![]})[_0xc236('0x29')](function(_0x8e19c6){if(_0x8e19c6&&_0x8e19c6[_0xc236('0x59')]===0x0){return db['UserProfileResource'][_0xc236('0x4f')]({'name':_0x24af08[_0xc236('0x2d')],'resourceId':_0x24af08['id'],'type':_0x8e19c6['name'],'sectionId':_0x8e19c6['id']},{})[_0xc236('0x29')](function(){return _0x3e6da6;});}else{return _0x3e6da6;}})[_0xc236('0x49')](function(_0x445f03){logger[_0xc236('0x5a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x445f03);throw _0x445f03;});}return _0x3e6da6;})[_0xc236('0x29')](respondWithResult(_0xa34c01,null))[_0xc236('0x49')](handleError(_0xa34c01,null));};function Extension(_0x35955c,_0x2602f8,_0x41a160,_0x1edbae){this[_0xc236('0x5b')]='from-sip';this[_0xc236('0x5c')]=_0x35955c;this['app']=_0x41a160;this[_0xc236('0x43')]=_0xc236('0x5d');this[_0xc236('0x5e')]=_0xc236('0x5f');this['priority']=_0x2602f8;this[_0xc236('0x60')]=_0x1edbae;}function createVoicePrefixExtensions(_0x3f1a5f,_0x379e99,_0x4ed4fc){return new BPromise(function(_0x175d5d,_0x2bc7f0){var _0x2ecad1=new Extension(formatPrefixName(_0x3f1a5f[_0xc236('0x61')]),0x1,_0xc236('0x62'),_0xc236('0x63'));_0x2ecad1['VoicePrefixId']=_0x3f1a5f['id'];return db['VoiceExtension'][_0xc236('0x4f')](_0x2ecad1,{'transaction':_0x4ed4fc})[_0xc236('0x29')](function(_0x125f9a){var _0x1e9ad8=_0x125f9a[_0xc236('0x52')]({'plain':!![]});var _0x4649a3=_[_0xc236('0x30')](addVoicePrefixExtensions(_0x3f1a5f,_0x379e99),function(_0x553f58){_0x553f58['VoiceExtensionId']=_0x1e9ad8['id'];_0x553f58['VoicePrefixId']=_0x3f1a5f['id'];return _0x553f58;});return db[_0xc236('0x53')][_0xc236('0x64')](_0x4649a3,{'transaction':_0x4ed4fc})[_0xc236('0x29')](function(_0x2d6b00){if(!_0x2d6b00){return _0x2bc7f0('Extensions\x20creation\x20failed');}else{return _0x175d5d(_0x2d6b00);}})['catch'](function(_0x506910){return _0x2bc7f0(_0x506910);});});;});};function addVoicePrefixExtensions(_0x528d3d,_0x145e86){var _0x5df2ba=[];var _0x20a1eb=formatPrefixName(_0x528d3d['prefix']);_0x5df2ba[_0xc236('0x65')](new Extension(_0x20a1eb,0x2,_0xc236('0x66'),_0xc236('0x67')+_0x528d3d[_0xc236('0x2d')]));if(_0x528d3d[_0xc236('0x68')]){_0x5df2ba[_0xc236('0x65')](new Extension(_0x20a1eb,0x3,_0xc236('0x66'),'PREFIX-CALLERIDALL='+_0x528d3d[_0xc236('0x68')]));}else{_0x5df2ba['push'](new Extension(_0x20a1eb,0x3,_0xc236('0x62'),_0xc236('0x69')));}_0x5df2ba[_0xc236('0x65')](new Extension(_0x20a1eb,0x4,_0xc236('0x6a'),_0x145e86[_0xc236('0x5b')]+','+_0xc236('0x6b')+(0x8+_0x528d3d['name'][_0xc236('0x3a')])+'}'+','+0x1));return _0x5df2ba;}function formatPrefixName(_0x94f65d){var _0x4bb0c6='_';for(var _0x2fb86f=0x0;_0x2fb86f<_0x94f65d[_0xc236('0x3a')];_0x2fb86f++){if(_0x94f65d[_0xc236('0x6c')](_0x2fb86f)=='-'){_0x4bb0c6+=_0x94f65d['charAt'](_0x2fb86f);}else{_0x4bb0c6+='['+_0x94f65d[_0xc236('0x6c')](_0x2fb86f)+']';}}_0x4bb0c6+='.';return _0x4bb0c6;}exports[_0xc236('0x28')]=function(_0x5897a1,_0x2c8f89,_0x340f7c){var _0x1c07d7=_0x5897a1[_0xc236('0x6d')];_0x1c07d7[_0xc236('0x61')]=_0xc236('0x6e')+_0x1c07d7[_0xc236('0x2d')]+'-';return db[_0xc236('0x50')][_0xc236('0x51')](function(_0x5d627d){return db[_0xc236('0x31')][_0xc236('0x28')](_0x1c07d7,{'where':{'id':_0x1c07d7['id']},'transaction':_0x5d627d})[_0xc236('0x29')](function(){return db['VoiceExtension'][_0xc236('0x4c')]({'where':{'VoicePrefixId':_0x1c07d7['id']},'transaction':_0x5d627d})[_0xc236('0x29')](function(){return db[_0xc236('0x53')][_0xc236('0x4b')]({'where':{'id':_0x1c07d7['VoiceExtensionId']},'raw':!![]})[_0xc236('0x29')](function(_0x4a433e){return createVoicePrefixExtensions(_0x1c07d7,_0x4a433e,_0x5d627d);});});});})[_0xc236('0x29')](function(){return db['VoicePrefix'][_0xc236('0x6f')](_0x1c07d7['id']);})[_0xc236('0x29')](respondWithResult(_0x2c8f89,null))['catch'](handleError(_0x2c8f89,null));};exports['addAgents']=function(_0x4ec6d1,_0x930527,_0x4e9624){return db[_0xc236('0x31')][_0xc236('0x4b')]({'where':{'id':_0x4ec6d1['params']['id']}})[_0xc236('0x29')](handleEntityNotFound(_0x930527,null))[_0xc236('0x29')](function(_0x4d7e8d){if(_0x4d7e8d){return _0x4d7e8d[_0xc236('0x70')](_0x4ec6d1[_0xc236('0x6d')][_0xc236('0x71')],_[_0xc236('0x72')](_0x4ec6d1['body'],[_0xc236('0x71'),'id'])||{})[_0xc236('0x73')](function(_0x14cbad){for(var _0x1a27c9=0x0;_0x1a27c9<_0x4ec6d1[_0xc236('0x6d')][_0xc236('0x71')][_0xc236('0x3a')];_0x1a27c9+=0x1){socket['emit']('userVoicePrefix:save',{'UserId':Number(_0x4ec6d1[_0xc236('0x6d')][_0xc236('0x71')][_0x1a27c9]),'VoicePrefixId':Number(_0x4ec6d1[_0xc236('0x4d')]['id'])});}return _0x14cbad;});}})[_0xc236('0x29')](respondWithResult(_0x930527,null))[_0xc236('0x49')](handleError(_0x930527,null));};exports[_0xc236('0x74')]=function(_0x8967c,_0x1c6923,_0x4df1a5){return db['VoicePrefix'][_0xc236('0x4b')]({'where':{'id':_0x8967c['params']['id']}})[_0xc236('0x29')](handleEntityNotFound(_0x1c6923,null))[_0xc236('0x29')](function(_0x25d982){if(_0x25d982){return _0x25d982['removeAgents'](_0x8967c[_0xc236('0x34')]['ids'])[_0xc236('0x29')](function(){if(_[_0xc236('0x75')](_0x8967c[_0xc236('0x34')][_0xc236('0x71')])){for(var _0x48cf03=0x0;_0x48cf03<_0x8967c[_0xc236('0x34')][_0xc236('0x71')]['length'];_0x48cf03+=0x1){socket[_0xc236('0x76')](_0xc236('0x77'),{'UserId':Number(_0x8967c[_0xc236('0x34')][_0xc236('0x71')][_0x48cf03]),'VoicePrefixId':Number(_0x8967c[_0xc236('0x4d')]['id'])});}}else{socket[_0xc236('0x76')](_0xc236('0x77'),{'UserId':Number(_0x8967c['query'][_0xc236('0x71')]),'VoicePrefixId':Number(_0x8967c[_0xc236('0x4d')]['id'])});}});}})[_0xc236('0x29')](respondWithStatusCode(_0x1c6923,null))[_0xc236('0x49')](handleError(_0x1c6923,null));};exports['getAgents']=function(_0x3646c6,_0x1ee8d0,_0x50d1c6){var _0x40fd6d={};var _0x593b62={};var _0x25f91e;var _0xfc94e8;return db['VoicePrefix'][_0xc236('0x78')]({'where':{'id':_0x3646c6[_0xc236('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1ee8d0,null))['then'](function(_0x2a9308){if(_0x2a9308){_0x25f91e=_0x2a9308;_0x593b62[_0xc236('0x3b')]=_[_0xc236('0x35')](db[_0xc236('0x79')][_0xc236('0x32')]);_0x593b62[_0xc236('0x34')]=_['keys'](_0x3646c6[_0xc236('0x34')]);_0x593b62[_0xc236('0x36')]=_[_0xc236('0x37')](_0x593b62[_0xc236('0x3b')],_0x593b62['query']);_0x40fd6d[_0xc236('0x38')]=_[_0xc236('0x37')](_0x593b62[_0xc236('0x3b')],qs[_0xc236('0x39')](_0x3646c6[_0xc236('0x34')]['fields']));_0x40fd6d['attributes']=_0x40fd6d[_0xc236('0x38')]['length']?_0x40fd6d[_0xc236('0x38')]:_0x593b62[_0xc236('0x3b')];_0x40fd6d[_0xc236('0x3e')]=qs[_0xc236('0x3f')](_0x3646c6['query'][_0xc236('0x3f')]);_0x40fd6d['where']=qs[_0xc236('0x36')](_['pick'](_0x3646c6[_0xc236('0x34')],_0x593b62[_0xc236('0x36')]));if(_0x3646c6[_0xc236('0x34')][_0xc236('0x40')]){_0x40fd6d[_0xc236('0x41')]=_[_0xc236('0x42')](_0x40fd6d[_0xc236('0x41')],{'$or':_[_0xc236('0x30')](_0x40fd6d[_0xc236('0x38')],function(_0x577ace){var _0x4849a6={};_0x4849a6[_0x577ace]={'$like':'%'+_0x3646c6[_0xc236('0x34')][_0xc236('0x40')]+'%'};return _0x4849a6;})});}_0x40fd6d=_[_0xc236('0x42')]({},_0x40fd6d,_0x3646c6[_0xc236('0x45')]);return _0x25f91e[_0xc236('0x7a')](_0x40fd6d);}})[_0xc236('0x29')](function(_0x557ad9){if(_0x557ad9){_0xfc94e8=_0x557ad9[_0xc236('0x3a')];if(!_0x3646c6[_0xc236('0x34')][_0xc236('0x3c')](_0xc236('0x3d'))){_0x40fd6d[_0xc236('0x22')]=qs[_0xc236('0x22')](_0x3646c6[_0xc236('0x34')][_0xc236('0x22')]);_0x40fd6d[_0xc236('0x21')]=qs[_0xc236('0x21')](_0x3646c6[_0xc236('0x34')][_0xc236('0x21')]);}return _0x25f91e[_0xc236('0x7a')](_0x40fd6d);}})[_0xc236('0x29')](function(_0x475c8f){if(_0x475c8f){return _0x475c8f?{'count':_0xfc94e8,'rows':_0x475c8f}:null;}})['then'](respondWithResult(_0x1ee8d0,null))[_0xc236('0x49')](handleError(_0x1ee8d0,null));};exports[_0xc236('0x7b')]=function(_0x17080e,_0x1070a3,_0x2bc6ed){var _0x4ed695={};var _0x424b51={};var _0x7bbb2c;var _0x1a938e;return db['VoicePrefix'][_0xc236('0x78')]({'where':{'id':_0x17080e['params']['id']}})['then'](handleEntityNotFound(_0x1070a3,null))[_0xc236('0x29')](function(_0x436845){if(_0x436845){_0x7bbb2c=_0x436845;_0x424b51[_0xc236('0x3b')]=_[_0xc236('0x35')](db[_0xc236('0x7c')]['rawAttributes']);_0x424b51[_0xc236('0x34')]=_[_0xc236('0x35')](_0x17080e[_0xc236('0x34')]);_0x424b51[_0xc236('0x36')]=_[_0xc236('0x37')](_0x424b51['model'],_0x424b51['query']);_0x4ed695[_0xc236('0x38')]=_[_0xc236('0x37')](_0x424b51[_0xc236('0x3b')],qs[_0xc236('0x39')](_0x17080e['query'][_0xc236('0x39')]));_0x4ed695[_0xc236('0x38')]=_0x4ed695[_0xc236('0x38')][_0xc236('0x3a')]?_0x4ed695[_0xc236('0x38')]:_0x424b51['model'];_0x4ed695[_0xc236('0x3e')]=qs[_0xc236('0x3f')](_0x17080e[_0xc236('0x34')][_0xc236('0x3f')]);_0x4ed695[_0xc236('0x41')]=qs['filters'](_[_0xc236('0x7d')](_0x17080e[_0xc236('0x34')],_0x424b51['filters']));if(_0x17080e[_0xc236('0x34')][_0xc236('0x40')]){_0x4ed695[_0xc236('0x41')]=_[_0xc236('0x42')](_0x4ed695[_0xc236('0x41')],{'$or':_['map'](_0x4ed695[_0xc236('0x38')],function(_0x182750){var _0x32f936={};_0x32f936[_0x182750]={'$like':'%'+_0x17080e[_0xc236('0x34')][_0xc236('0x40')]+'%'};return _0x32f936;})});}_0x4ed695=_[_0xc236('0x42')]({},_0x4ed695,_0x17080e['options']);return _0x7bbb2c[_0xc236('0x7b')](_0x4ed695);}})['then'](function(_0x391ad3){if(_0x391ad3){_0x1a938e=_0x391ad3['length'];if(!_0x17080e[_0xc236('0x34')]['hasOwnProperty'](_0xc236('0x3d'))){_0x4ed695['limit']=qs[_0xc236('0x22')](_0x17080e[_0xc236('0x34')][_0xc236('0x22')]);_0x4ed695[_0xc236('0x21')]=qs[_0xc236('0x21')](_0x17080e[_0xc236('0x34')]['offset']);}return _0x7bbb2c[_0xc236('0x7b')](_0x4ed695);}})[_0xc236('0x29')](function(_0x32d1cc){if(_0x32d1cc){return _0x32d1cc?{'count':_0x1a938e,'rows':_0x32d1cc}:null;}})[_0xc236('0x29')](respondWithResult(_0x1070a3,null))[_0xc236('0x49')](handleError(_0x1070a3,null));};exports[_0xc236('0x7e')]=function(_0x424875,_0x14177d,_0x30e7b3){var _0x23fc57=_0x424875[_0xc236('0x6d')][_0xc236('0x71')];var _0x2bed4b;return db[_0xc236('0x7c')][_0xc236('0x7f')]({'where':{'id':_0x23fc57},'attributes':['id'],'include':[{'model':db[_0xc236('0x79')],'as':_0xc236('0x80'),'attributes':['id',_0xc236('0x2d'),_0xc236('0x81'),'voicePause',_0xc236('0x82')],'raw':!![]}]})[_0xc236('0x29')](function(_0x210989){if(_0x210989){_0x2bed4b=_0x210989;var _0x5164e5=_[_0xc236('0x83')](_0x210989,function(_0x32765e){var _0x4f9faf=_0x32765e[_0xc236('0x52')]({'plain':!![]});return _0x4f9faf[_0xc236('0x80')];});return db['VoicePrefix'][_0xc236('0x4b')]({'where':{'id':_0x424875[_0xc236('0x4d')]['id']}})[_0xc236('0x29')](function(_0xfb7a98){return db['sequelize'][_0xc236('0x51')](function(_0x53287f){return _0xfb7a98[_0xc236('0x7e')](_0x23fc57,{'transaction':_0x53287f})[_0xc236('0x29')](function(){return BPromise[_0xc236('0x84')](_0x2bed4b,function(_0x2900ed){return db[_0xc236('0x85')]['upsert']({'TeamId':_0x2900ed['id'],'VoicePrefixId':_0x424875[_0xc236('0x4d')]['id']},{'transaction':_0x53287f});});})[_0xc236('0x29')](function(){return BPromise[_0xc236('0x84')](_0x5164e5,function(_0x29131a){return db[_0xc236('0x86')][_0xc236('0x87')]({'where':{'UserId':_0x29131a['id'],'VoicePrefixId':_0x424875[_0xc236('0x4d')]['id']},'transaction':_0x53287f});});})[_0xc236('0x29')](function(){_0x5164e5[_0xc236('0x88')](function(_0x833f85){socket[_0xc236('0x76')]('userVoicePrefix:save',{'UserId':_0x833f85['id'],'VoicePrefixId':_0xfb7a98['id']});});});});});}})['then'](respondWithStatusCode(_0x14177d,null))[_0xc236('0x49')](handleError(_0x14177d,null));};exports[_0xc236('0x89')]=function(_0x2207a8,_0x36fd37,_0x2494d9){return db[_0xc236('0x7c')][_0xc236('0x7f')]({'where':{'id':_0x2207a8[_0xc236('0x34')][_0xc236('0x71')]},'attributes':['id'],'include':[{'model':db[_0xc236('0x79')],'as':_0xc236('0x80'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x36fd37,null))[_0xc236('0x29')](function(_0x1669c4){var _0x29ae97=_[_0xc236('0x30')](_0x1669c4,'id');var _0x2a8f63=[];var _0x38aecf=[];var _0x2b46e4=squel[_0xc236('0x8a')]();_0x2b46e4['field']('tq.TeamId')['from'](_0xc236('0x8b'),'tq')['join'](_0xc236('0x8c'),'ut',_0xc236('0x8d'))[_0xc236('0x41')](_0xc236('0x8e'),_0x2207a8[_0xc236('0x4d')]['id']);for(var _0x43216e=0x0;_0x43216e<_0x1669c4[_0xc236('0x3a')];_0x43216e+=0x1){let _0x49d232=_0x1669c4[_0x43216e];for(var _0x870908=0x0;_0x870908<_0x49d232[_0xc236('0x80')][_0xc236('0x3a')];_0x870908+=0x1){let _0x364d8d=_0x49d232[_0xc236('0x80')][_0x870908];var _0x53cd27=_0x2b46e4[_0xc236('0x8f')]();_0x53cd27[_0xc236('0x41')](_0xc236('0x90'),_0x364d8d['id']);_0x38aecf[_0xc236('0x65')](db[_0xc236('0x50')][_0xc236('0x34')](_0x53cd27[_0xc236('0x91')](),{'type':db[_0xc236('0x50')][_0xc236('0x92')]['SELECT']})[_0xc236('0x29')](function(_0x281d3c){if(_0x281d3c[_0xc236('0x3a')]===0x1){return _0x364d8d['id'];}else{var _0x33cdb2=_['every'](_[_0xc236('0x30')](_0x281d3c,_0xc236('0x93')),function(_0x5ca99c){return _[_0xc236('0x94')](_0x29ae97,_0x5ca99c);});if(_0x33cdb2){return _0x364d8d['id'];}}}));}}return BPromise[_0xc236('0x95')](_0x38aecf)[_0xc236('0x29')](function(_0x32658a){_0x2a8f63=_(_0x2a8f63)[_0xc236('0x96')](_0x32658a)[_0xc236('0x97')]()[_0xc236('0x98')]();return db[_0xc236('0x31')]['find']({'where':{'id':_0x2207a8[_0xc236('0x4d')]['id']}})[_0xc236('0x29')](function(_0x26c461){return db[_0xc236('0x50')][_0xc236('0x51')](function(_0x57a83b){return _0x26c461[_0xc236('0x89')](_0x2207a8['query'][_0xc236('0x71')],{'transaction':_0x57a83b})[_0xc236('0x29')](function(){if(!_[_0xc236('0x99')](_0x2a8f63)){return _0x26c461[_0xc236('0x74')](_0x2a8f63,{'transaction':_0x57a83b});}})[_0xc236('0x29')](function(){_0x2a8f63[_0xc236('0x88')](function(_0x2e4215){socket[_0xc236('0x76')](_0xc236('0x77'),{'UserId':_0x2e4215,'VoicePrefixId':_0x26c461['id']});});});});});});})[_0xc236('0x29')](respondWithStatusCode(_0x36fd37,null))[_0xc236('0x49')](handleError(_0x36fd37,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 626c4af..0621997 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 _0x5aed=['save','emit','hasOwnProperty','exports','../../mysqldb','VoicePrefix','setMaxListeners'];(function(_0x397776,_0x247746){var _0x3b45d3=function(_0x2920fd){while(--_0x2920fd){_0x397776['push'](_0x397776['shift']());}};_0x3b45d3(++_0x247746);}(_0x5aed,0x7b));var _0xd5ae=function(_0x4e17d2,_0x1626e6){_0x4e17d2=_0x4e17d2-0x0;var _0x35724d=_0x5aed[_0x4e17d2];return _0x35724d;};'use strict';var EventEmitter=require('events');var VoicePrefix=require(_0xd5ae('0x0'))['db'][_0xd5ae('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xd5ae('0x2')](0x0);var events={'afterCreate':_0xd5ae('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4faee6){return function(_0x14457b,_0x44b601,_0x1e275d){VoicePrefixEvents[_0xd5ae('0x4')](_0x4faee6+':'+_0x14457b['id'],_0x14457b);VoicePrefixEvents[_0xd5ae('0x4')](_0x4faee6,_0x14457b);_0x1e275d(null);};}for(var e in events){if(events[_0xd5ae('0x5')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module[_0xd5ae('0x6')]=VoicePrefixEvents; \ No newline at end of file +var _0x0a29=['hasOwnProperty','exports','../../mysqldb','setMaxListeners','update','remove','emit'];(function(_0x51b8c7,_0x16bcc3){var _0x500cba=function(_0x2ac7d7){while(--_0x2ac7d7){_0x51b8c7['push'](_0x51b8c7['shift']());}};_0x500cba(++_0x16bcc3);}(_0x0a29,0xd4));var _0x90a2=function(_0xec8a0c,_0x712a40){_0xec8a0c=_0xec8a0c-0x0;var _0x41617=_0x0a29[_0xec8a0c];return _0x41617;};'use strict';var EventEmitter=require('events');var VoicePrefix=require(_0x90a2('0x0'))['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x90a2('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x90a2('0x2'),'afterDestroy':_0x90a2('0x3')};function emitEvent(_0xe7a674){return function(_0x1f8124,_0x42b75e,_0x1fe4ef){VoicePrefixEvents[_0x90a2('0x4')](_0xe7a674+':'+_0x1f8124['id'],_0x1f8124);VoicePrefixEvents[_0x90a2('0x4')](_0xe7a674,_0x1f8124);_0x1fe4ef(null);};}for(var e in events){if(events[_0x90a2('0x5')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module[_0x90a2('0x6')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 4a9d6ac..f54ab03 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 _0x84c3=['moment','bluebird','request-promise','path','rimraf','./voicePrefix.attributes','exports','VoicePrefix','voice_prefixes','lodash','../../config/logger','api'];(function(_0x5187d3,_0x26314a){var _0x17ebe8=function(_0x472234){while(--_0x472234){_0x5187d3['push'](_0x5187d3['shift']());}};_0x17ebe8(++_0x26314a);}(_0x84c3,0x1dd));var _0x384c=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0x84c3[_0x376b45];return _0x2341b3;};'use strict';var _=require(_0x384c('0x0'));var util=require('util');var logger=require(_0x384c('0x1'))(_0x384c('0x2'));var moment=require(_0x384c('0x3'));var BPromise=require(_0x384c('0x4'));var rp=require(_0x384c('0x5'));var fs=require('fs');var path=require(_0x384c('0x6'));var rimraf=require(_0x384c('0x7'));var config=require('../../config/environment');var attributes=require(_0x384c('0x8'));module[_0x384c('0x9')]=function(_0x2c69fd,_0x1d81d3){return _0x2c69fd['define'](_0x384c('0xa'),attributes,{'tableName':_0x384c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xba09=['../../config/environment','./voicePrefix.attributes','exports','VoicePrefix','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xba09,0xcc));var _0x9ba0=function(_0x2114e3,_0x2c3028){_0x2114e3=_0x2114e3-0x0;var _0x6bff25=_0xba09[_0x2114e3];return _0x6bff25;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9ba0('0x0'))('api');var moment=require(_0x9ba0('0x1'));var BPromise=require(_0x9ba0('0x2'));var rp=require(_0x9ba0('0x3'));var fs=require('fs');var path=require(_0x9ba0('0x4'));var rimraf=require(_0x9ba0('0x5'));var config=require(_0x9ba0('0x6'));var attributes=require(_0x9ba0('0x7'));module[_0x9ba0('0x8')]=function(_0x379f6c,_0x511584){return _0x379f6c['define'](_0x9ba0('0x9'),attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.rpc.js b/server/api/voicePrefix/voicePrefix.rpc.js index fe756f2..d7294bb 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 _0xaaee=['redis','defaults','localhost','./voicePrefix.socket','then','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0xa20764,_0x2a9180){var _0x2db9e6=function(_0x5b30e1){while(--_0x5b30e1){_0xa20764['push'](_0xa20764['shift']());}};_0x2db9e6(++_0x2a9180);}(_0xaaee,0x132));var _0xeaae=function(_0xd1fb6,_0x34f64c){_0xd1fb6=_0xd1fb6-0x0;var _0x4eebc0=_0xaaee[_0xd1fb6];return _0x4eebc0;};'use strict';var _=require(_0xeaae('0x0'));var util=require(_0xeaae('0x1'));var moment=require(_0xeaae('0x2'));var BPromise=require(_0xeaae('0x3'));var rs=require(_0xeaae('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xeaae('0x5'))['db'];var utils=require(_0xeaae('0x6'));var logger=require(_0xeaae('0x7'))(_0xeaae('0x8'));var config=require(_0xeaae('0x9'));var jayson=require(_0xeaae('0xa'));var client=jayson[_0xeaae('0xb')][_0xeaae('0xc')]({'port':0x232a});config[_0xeaae('0xd')]=_[_0xeaae('0xe')](config[_0xeaae('0xd')],{'host':_0xeaae('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xeaae('0xd')]));require(_0xeaae('0x10'))['register'](socket);function respondWithRpcPromise(_0x149943,_0x295a9a,_0xc3570c){return new BPromise(function(_0x435340,_0x484be3){return client['request'](_0x149943,_0xc3570c)[_0xeaae('0x11')](function(_0x465002){logger['info'](_0xeaae('0x12'),_0x295a9a,_0xeaae('0x13'));logger[_0xeaae('0x14')](_0xeaae('0x15'),_0x295a9a,'request\x20sent',JSON[_0xeaae('0x16')](_0x465002));if(_0x465002['error']){if(_0x465002[_0xeaae('0x17')][_0xeaae('0x18')]===0x1f4){logger[_0xeaae('0x17')](_0xeaae('0x12'),_0x295a9a,_0x465002[_0xeaae('0x17')][_0xeaae('0x19')]);return _0x484be3(_0x465002[_0xeaae('0x17')][_0xeaae('0x19')]);}logger[_0xeaae('0x17')](_0xeaae('0x12'),_0x295a9a,_0x465002[_0xeaae('0x17')][_0xeaae('0x19')]);return _0x435340(_0x465002[_0xeaae('0x17')]['message']);}else{logger[_0xeaae('0x1a')]('VoicePrefix,\x20%s,\x20%s',_0x295a9a,_0xeaae('0x13'));_0x435340(_0x465002[_0xeaae('0x1b')][_0xeaae('0x19')]);}})[_0xeaae('0x1c')](function(_0x5ec06e){logger[_0xeaae('0x17')](_0xeaae('0x12'),_0x295a9a,_0x5ec06e);_0x484be3(_0x5ec06e);});});} \ No newline at end of file +var _0x2272=['jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','request','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x413e01,_0x58ac57){var _0x5c3566=function(_0xd9396b){while(--_0xd9396b){_0x413e01['push'](_0x413e01['shift']());}};_0x5c3566(++_0x58ac57);}(_0x2272,0xd8));var _0x2227=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2272[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x2227('0x0'));var util=require(_0x2227('0x1'));var moment=require(_0x2227('0x2'));var BPromise=require(_0x2227('0x3'));var rs=require(_0x2227('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2227('0x5'))['db'];var utils=require(_0x2227('0x6'));var logger=require(_0x2227('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2227('0x8'));var client=jayson[_0x2227('0x9')][_0x2227('0xa')]({'port':0x232a});config[_0x2227('0xb')]=_[_0x2227('0xc')](config[_0x2227('0xb')],{'host':_0x2227('0xd'),'port':0x18eb});var socket=require(_0x2227('0xe'))(new Redis(config[_0x2227('0xb')]));require(_0x2227('0xf'))['register'](socket);function respondWithRpcPromise(_0x799370,_0x5c1cba,_0x2f66ca){return new BPromise(function(_0x2d1c39,_0x164735){return client[_0x2227('0x10')](_0x799370,_0x2f66ca)[_0x2227('0x11')](function(_0x51ed54){logger[_0x2227('0x12')](_0x2227('0x13'),_0x5c1cba,_0x2227('0x14'));logger[_0x2227('0x15')](_0x2227('0x16'),_0x5c1cba,_0x2227('0x14'),JSON['stringify'](_0x51ed54));if(_0x51ed54['error']){if(_0x51ed54['error'][_0x2227('0x17')]===0x1f4){logger['error'](_0x2227('0x13'),_0x5c1cba,_0x51ed54[_0x2227('0x18')]['message']);return _0x164735(_0x51ed54[_0x2227('0x18')][_0x2227('0x19')]);}logger[_0x2227('0x18')](_0x2227('0x13'),_0x5c1cba,_0x51ed54[_0x2227('0x18')][_0x2227('0x19')]);return _0x2d1c39(_0x51ed54['error'][_0x2227('0x19')]);}else{logger[_0x2227('0x12')](_0x2227('0x13'),_0x5c1cba,'request\x20sent');_0x2d1c39(_0x51ed54[_0x2227('0x1a')][_0x2227('0x19')]);}})[_0x2227('0x1b')](function(_0x2482ba){logger[_0x2227('0x18')](_0x2227('0x13'),_0x5c1cba,_0x2482ba);_0x164735(_0x2482ba);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 35b00f2..ac5ae71 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 _0x902b=['register','./voicePrefix.events','remove','update','emit'];(function(_0x4dae94,_0x577429){var _0x10504f=function(_0x206a65){while(--_0x206a65){_0x4dae94['push'](_0x4dae94['shift']());}};_0x10504f(++_0x577429);}(_0x902b,0x6a));var _0xb902=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0x902b[_0x2aec52];return _0x3b8835;};'use strict';var VoicePrefixEvents=require(_0xb902('0x0'));var events=['save',_0xb902('0x1'),_0xb902('0x2')];function createListener(_0x26d7c7,_0x20a412){return function(_0xa2acb9){_0x20a412[_0xb902('0x3')](_0x26d7c7,_0xa2acb9);};}function removeListener(_0x492bd4,_0x1af7b5){return function(){VoicePrefixEvents['removeListener'](_0x492bd4,_0x1af7b5);};}exports[_0xb902('0x4')]=function(_0x5d38bb){for(var _0x157e14=0x0,_0x5e7240=events['length'];_0x157e14<_0x5e7240;_0x157e14++){var _0x5b0b74=events[_0x157e14];var _0x55331d=createListener('voicePrefix:'+_0x5b0b74,_0x5d38bb);VoicePrefixEvents['on'](_0x5b0b74,_0x55331d);}}; \ No newline at end of file +var _0x6ff1=['./voicePrefix.events','save','remove','update','removeListener','register','voicePrefix:'];(function(_0x50cd41,_0x4874a7){var _0x399475=function(_0x1946da){while(--_0x1946da){_0x50cd41['push'](_0x50cd41['shift']());}};_0x399475(++_0x4874a7);}(_0x6ff1,0x10a));var _0x16ff=function(_0x57cb21,_0x54f809){_0x57cb21=_0x57cb21-0x0;var _0x4c0c53=_0x6ff1[_0x57cb21];return _0x4c0c53;};'use strict';var VoicePrefixEvents=require(_0x16ff('0x0'));var events=[_0x16ff('0x1'),_0x16ff('0x2'),_0x16ff('0x3')];function createListener(_0x4e4d9c,_0x50cd8a){return function(_0x1402f0){_0x50cd8a['emit'](_0x4e4d9c,_0x1402f0);};}function removeListener(_0x1db386,_0x2bf329){return function(){VoicePrefixEvents[_0x16ff('0x4')](_0x1db386,_0x2bf329);};}exports[_0x16ff('0x5')]=function(_0x5325dd){for(var _0x4f3752=0x0,_0x560612=events['length'];_0x4f3752<_0x560612;_0x4f3752++){var _0x133612=events[_0x4f3752];var _0x218c28=createListener(_0x16ff('0x6')+_0x133612,_0x5325dd);VoicePrefixEvents['on'](_0x133612,_0x218c28);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 280567a..c58f523 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 _0x23e5=['/:id/lists','getBlackLists','post','create','/:id/clone','clone','addTeams','addAgents','addLists','/:id/blacklists','/:id','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceQueue.controller','get','isAuthenticated','index','show','getHoppers','/:id/hopper_histories','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/teams','getTeams','/:id/users','/:id/members','getMembers'];(function(_0x252140,_0x2bf6cb){var _0x3889b0=function(_0x4ae3c5){while(--_0x4ae3c5){_0x252140['push'](_0x252140['shift']());}};_0x3889b0(++_0x2bf6cb);}(_0x23e5,0x1d6));var _0x523e=function(_0x877ea5,_0x4f9928){_0x877ea5=_0x877ea5-0x0;var _0x772191=_0x23e5[_0x877ea5];return _0x772191;};'use strict';var multer=require(_0x523e('0x0'));var util=require(_0x523e('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x523e('0x2'));var router=express[_0x523e('0x3')]();var fs_extra=require(_0x523e('0x4'));var auth=require(_0x523e('0x5'));var interaction=require(_0x523e('0x6'));var config=require('../../config/environment');var controller=require(_0x523e('0x7'));router[_0x523e('0x8')]('/',auth[_0x523e('0x9')](),controller[_0x523e('0xa')]);router['get']('/:id',auth[_0x523e('0x9')](),controller[_0x523e('0xb')]);router['get']('/:id/hoppers',auth[_0x523e('0x9')](),controller[_0x523e('0xc')]);router[_0x523e('0x8')](_0x523e('0xd'),auth[_0x523e('0x9')](),controller['getHopperHistories']);router['get']('/:id/hopper_finals',auth[_0x523e('0x9')](),controller[_0x523e('0xe')]);router[_0x523e('0x8')](_0x523e('0xf'),auth[_0x523e('0x9')](),controller[_0x523e('0x10')]);router[_0x523e('0x8')](_0x523e('0x11'),auth[_0x523e('0x9')](),controller[_0x523e('0x12')]);router[_0x523e('0x8')](_0x523e('0x13'),auth[_0x523e('0x9')](),controller['getAgents']);router[_0x523e('0x8')](_0x523e('0x14'),auth[_0x523e('0x9')](),controller[_0x523e('0x15')]);router['get'](_0x523e('0x16'),auth[_0x523e('0x9')](),controller['getLists']);router['get']('/:id/blacklists',auth[_0x523e('0x9')](),controller[_0x523e('0x17')]);router[_0x523e('0x18')]('/',auth['isAuthenticated'](),controller[_0x523e('0x19')]);router[_0x523e('0x18')](_0x523e('0x1a'),auth[_0x523e('0x9')](),controller[_0x523e('0x1b')]);router[_0x523e('0x18')](_0x523e('0x11'),auth['isAuthenticated'](),controller[_0x523e('0x1c')]);router[_0x523e('0x18')]('/:id/users',auth['isAuthenticated'](),controller[_0x523e('0x1d')]);router[_0x523e('0x18')](_0x523e('0x16'),auth[_0x523e('0x9')](),controller[_0x523e('0x1e')]);router['post'](_0x523e('0x1f'),auth[_0x523e('0x9')](),controller['addBlackLists']);router['put'](_0x523e('0x20'),auth[_0x523e('0x9')](),controller[_0x523e('0x21')]);router[_0x523e('0x22')](_0x523e('0x20'),auth[_0x523e('0x9')](),controller[_0x523e('0x23')]);router[_0x523e('0x22')]('/:id/teams',auth[_0x523e('0x9')](),controller[_0x523e('0x24')]);router[_0x523e('0x22')]('/:id/users',auth[_0x523e('0x9')](),controller[_0x523e('0x25')]);router[_0x523e('0x22')](_0x523e('0x16'),auth['isAuthenticated'](),controller[_0x523e('0x26')]);router[_0x523e('0x22')](_0x523e('0x1f'),auth[_0x523e('0x9')](),controller[_0x523e('0x27')]);module[_0x523e('0x28')]=router; \ No newline at end of file +var _0xfdf1=['addBlackLists','put','update','destroy','delete','removeLists','removeBlackLists','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','/:id','isAuthenticated','show','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addAgents'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0xfdf1,0x14f));var _0x1fdf=function(_0x4ef377,_0x41ecf0){_0x4ef377=_0x4ef377-0x0;var _0x4daa20=_0xfdf1[_0x4ef377];return _0x4daa20;};'use strict';var multer=require(_0x1fdf('0x0'));var util=require(_0x1fdf('0x1'));var path=require('path');var timeout=require(_0x1fdf('0x2'));var express=require(_0x1fdf('0x3'));var router=express[_0x1fdf('0x4')]();var fs_extra=require(_0x1fdf('0x5'));var auth=require(_0x1fdf('0x6'));var interaction=require(_0x1fdf('0x7'));var config=require(_0x1fdf('0x8'));var controller=require(_0x1fdf('0x9'));router[_0x1fdf('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1fdf('0xa')](_0x1fdf('0xb'),auth[_0x1fdf('0xc')](),controller[_0x1fdf('0xd')]);router[_0x1fdf('0xa')]('/:id/hoppers',auth[_0x1fdf('0xc')](),controller['getHoppers']);router[_0x1fdf('0xa')](_0x1fdf('0xe'),auth[_0x1fdf('0xc')](),controller[_0x1fdf('0xf')]);router[_0x1fdf('0xa')](_0x1fdf('0x10'),auth[_0x1fdf('0xc')](),controller[_0x1fdf('0x11')]);router[_0x1fdf('0xa')]('/:id/hopper_black',auth[_0x1fdf('0xc')](),controller[_0x1fdf('0x12')]);router['get'](_0x1fdf('0x13'),auth[_0x1fdf('0xc')](),controller[_0x1fdf('0x14')]);router[_0x1fdf('0xa')](_0x1fdf('0x15'),auth[_0x1fdf('0xc')](),controller[_0x1fdf('0x16')]);router[_0x1fdf('0xa')](_0x1fdf('0x17'),auth['isAuthenticated'](),controller[_0x1fdf('0x18')]);router[_0x1fdf('0xa')](_0x1fdf('0x19'),auth['isAuthenticated'](),controller[_0x1fdf('0x1a')]);router[_0x1fdf('0xa')](_0x1fdf('0x1b'),auth[_0x1fdf('0xc')](),controller[_0x1fdf('0x1c')]);router[_0x1fdf('0x1d')]('/',auth[_0x1fdf('0xc')](),controller[_0x1fdf('0x1e')]);router[_0x1fdf('0x1d')](_0x1fdf('0x1f'),auth['isAuthenticated'](),controller[_0x1fdf('0x20')]);router[_0x1fdf('0x1d')](_0x1fdf('0x13'),auth[_0x1fdf('0xc')](),controller['addTeams']);router[_0x1fdf('0x1d')]('/:id/users',auth[_0x1fdf('0xc')](),controller[_0x1fdf('0x21')]);router['post'](_0x1fdf('0x19'),auth[_0x1fdf('0xc')](),controller['addLists']);router[_0x1fdf('0x1d')](_0x1fdf('0x1b'),auth[_0x1fdf('0xc')](),controller[_0x1fdf('0x22')]);router[_0x1fdf('0x23')]('/:id',auth[_0x1fdf('0xc')](),controller[_0x1fdf('0x24')]);router['delete'](_0x1fdf('0xb'),auth[_0x1fdf('0xc')](),controller[_0x1fdf('0x25')]);router['delete'](_0x1fdf('0x13'),auth[_0x1fdf('0xc')](),controller['removeTeams']);router[_0x1fdf('0x26')](_0x1fdf('0x15'),auth[_0x1fdf('0xc')](),controller['removeAgents']);router[_0x1fdf('0x26')]('/:id/lists',auth['isAuthenticated'](),controller[_0x1fdf('0x27')]);router[_0x1fdf('0x26')](_0x1fdf('0x1b'),auth[_0x1fdf('0xc')](),controller[_0x1fdf('0x28')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index fe7b70f..5e8f29c 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 _0xb6a6=['tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','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)','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','exports','STRING','name','ENUM','outbound','inbound','default','ringall','leastrecent','fewestcalls','random','rrmemory','linear','setDataValue','getDataValue','type','dialMethod','strategy','booked','roundrobin','progressive','power','INTEGER','yes','all','TEXT','join','periodic_announce','split','joinempty','leavewhenempty','BOOLEAN','wrapuptime','preview','predictive','Dial\x20Method.','Max\x209999\x20channels,\x200\x20means\x20unlimited.','UNSIGNED','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'];(function(_0x59162a,_0x10e547){var _0x35e50d=function(_0x578425){while(--_0x578425){_0x59162a['push'](_0x59162a['shift']());}};_0x35e50d(++_0x10e547);}(_0xb6a6,0x1ed));var _0x6b6a=function(_0x3120b0,_0x5e67fe){_0x3120b0=_0x3120b0-0x0;var _0x1b368a=_0xb6a6[_0x3120b0];return _0x1b368a;};'use strict';var Sequelize=require('sequelize');module[_0x6b6a('0x0')]={'name':{'type':Sequelize[_0x6b6a('0x1')],'allowNull':![],'unique':_0x6b6a('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x6b6a('0x3')]('inbound',_0x6b6a('0x4')),'allowNull':![],'defaultValue':_0x6b6a('0x5')},'musiconhold':{'type':Sequelize[_0x6b6a('0x1')],'defaultValue':_0x6b6a('0x6')},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0x6b6a('0x7'),_0x6b6a('0x8'),_0x6b6a('0x9'),_0x6b6a('0xa'),_0x6b6a('0xb'),_0x6b6a('0xc'),'wrandom','rrordered'),'allowNull':![],'defaultValue':_0x6b6a('0x7'),'set':function(_0x23f217){this[_0x6b6a('0xd')]('strategy',_0x23f217?_0x23f217:_0x6b6a('0xb'));},'get':function(){var _0x4fb0ee=this[_0x6b6a('0xe')](_0x6b6a('0xf'));var _0x25a90f=this[_0x6b6a('0xe')](_0x6b6a('0x10'));var _0x4458ea=this[_0x6b6a('0xe')](_0x6b6a('0x11'));if(_0x4fb0ee==='inbound'){return _0x4458ea;}if(_0x25a90f===_0x6b6a('0x12')&&_0x4458ea===_0x6b6a('0xb')||_0x25a90f===_0x6b6a('0x12')&&_0x4458ea===_0x6b6a('0x13')){return _0x4458ea;}if(_0x25a90f===_0x6b6a('0x14')||_0x25a90f==='predictive'||_0x25a90f===_0x6b6a('0x15')){return _0x4458ea;}return null;}},'servicelevel':{'type':Sequelize[_0x6b6a('0x16')](0xb),'defaultValue':0x0},'context':{'type':Sequelize['STRING'],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x6b6a('0x16')](0xb)},'timeout':{'type':Sequelize[_0x6b6a('0x16')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x6b6a('0x16')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x6b6a('0x1')]},'weight':{'type':Sequelize[_0x6b6a('0x16')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x6b6a('0x16')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0x6b6a('0x17'),'no'),'defaultValue':'yes'},'autopause':{'type':Sequelize[_0x6b6a('0x3')](_0x6b6a('0x17'),'no',_0x6b6a('0x18')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x6b6a('0x16')](0xb)},'autopausebusy':{'type':Sequelize[_0x6b6a('0x3')]('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x6b6a('0x3')](_0x6b6a('0x17'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x6b6a('0x3')]('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x6b6a('0x3')]('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x6b6a('0x3')](_0x6b6a('0x17'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x6b6a('0x3')](_0x6b6a('0x17'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x6b6a('0x1')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x6b6a('0x1')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x6b6a('0x16')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x6b6a('0x16')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x6b6a('0x3')](_0x6b6a('0x17'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0x6b6a('0x17'),'no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize[_0x6b6a('0x3')]('yes','no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x6b6a('0x3')](_0x6b6a('0x17'),'no')},'announce_position_limit':{'type':Sequelize[_0x6b6a('0x16')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x6b6a('0x3')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x6b6a('0x1')]},'queue_youarenext':{'type':Sequelize[_0x6b6a('0x1')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x6b6a('0x1')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x6b6a('0x1')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x6b6a('0x1')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x6b6a('0x1')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x6b6a('0x1')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x6b6a('0x1')],'defaultValue':null},'queue_thankyou':{'type':Sequelize['STRING'],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize[_0x6b6a('0x1')]},'queue_quantity2':{'type':Sequelize[_0x6b6a('0x1')]},'queue_periodic_announce':{'type':Sequelize[_0x6b6a('0x1')]},'queue_less_than':{'type':Sequelize[_0x6b6a('0x1')]},'periodic_announce':{'type':Sequelize[_0x6b6a('0x19')],'set':function(_0x4e1ed6){this['setDataValue']('periodic_announce',_0x4e1ed6?_0x4e1ed6[_0x6b6a('0x1a')](','):[]);},'get':function(){return this[_0x6b6a('0xe')](_0x6b6a('0x1b'))?this[_0x6b6a('0xe')](_0x6b6a('0x1b'))[_0x6b6a('0x1c')](','):[];}},'joinempty':{'type':Sequelize[_0x6b6a('0x1')],'defaultValue':_0x6b6a('0x17'),'set':function(_0x5cbabb){this['setDataValue'](_0x6b6a('0x1d'),_0x5cbabb?_0x5cbabb[_0x6b6a('0x1a')](','):undefined);},'get':function(){return this[_0x6b6a('0xe')](_0x6b6a('0x1d'))?this[_0x6b6a('0xe')](_0x6b6a('0x1d'))['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x6b6a('0x1')],'defaultValue':'no','set':function(_0xebb758){this[_0x6b6a('0xd')](_0x6b6a('0x1e'),_0xebb758?_0xebb758[_0x6b6a('0x1a')](','):undefined);},'get':function(){return this['getDataValue'](_0x6b6a('0x1e'))?this['getDataValue'](_0x6b6a('0x1e'))[_0x6b6a('0x1c')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x6b6a('0x3')](_0x6b6a('0x17'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x6b6a('0x3')](_0x6b6a('0x17'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM'](_0x6b6a('0x17'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize[_0x6b6a('0x1f')],'defaultValue':0x0,'set':function(_0x2d3aeb){this[_0x6b6a('0xd')]('acw',_0x2d3aeb);if(_0x2d3aeb){if(this[_0x6b6a('0xe')](_0x6b6a('0x20'))<0x2){this[_0x6b6a('0xd')]('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize[_0x6b6a('0x16')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize[_0x6b6a('0x3')](_0x6b6a('0x21'),'progressive',_0x6b6a('0x15'),_0x6b6a('0x22'),_0x6b6a('0x12')),'defaultValue':_0x6b6a('0x14'),'comment':_0x6b6a('0x23')},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x6b6a('0x24')},'dialLimitQueue':{'type':Sequelize[_0x6b6a('0x16')](0x4)[_0x6b6a('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize[_0x6b6a('0x26')](0x2)[_0x6b6a('0x25')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x6b6a('0x27')},'dialPredictiveOptimization':{'type':Sequelize['ENUM'](_0x6b6a('0x28'),_0x6b6a('0x29')),'defaultValue':_0x6b6a('0x29'),'comment':_0x6b6a('0x2a')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x6b6a('0x26')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x6b6a('0x2b')},'dialPredictiveInterval':{'type':Sequelize[_0x6b6a('0x16')](0x3)[_0x6b6a('0x25')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x6b6a('0x2c')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x6b6a('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x6b6a('0x16')](0x3)[_0x6b6a('0x25')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6b6a('0x2d')},'dialQueueOptions':{'type':Sequelize[_0x6b6a('0x1')],'defaultValue':_0x6b6a('0x2e'),'comment':_0x6b6a('0x2f')},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x6b6a('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize[_0x6b6a('0x1')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x6b6a('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x6b6a('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6b6a('0x30')},'dialBusyMaxRetry':{'type':Sequelize[_0x6b6a('0x16')](0x3)[_0x6b6a('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6b6a('0x31')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x6b6a('0x32')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x6b6a('0x16')](0x5)[_0x6b6a('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6b6a('0x33')},'dialGlobalMaxRetry':{'type':Sequelize[_0x6b6a('0x16')](0x3)[_0x6b6a('0x25')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x6b6a('0x34')},'dialTimezone':{'type':Sequelize[_0x6b6a('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize[_0x6b6a('0x1')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x6b6a('0x3')](_0x6b6a('0x35'),_0x6b6a('0x36'),_0x6b6a('0x37')),'defaultValue':_0x6b6a('0x35')},'dialAMDActive':{'type':Sequelize[_0x6b6a('0x1f')],'defaultValue':0x0,'comment':_0x6b6a('0x38')},'dialAMDInitialSilence':{'type':Sequelize[_0x6b6a('0x16')](0x9)[_0x6b6a('0x25')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x6b6a('0x25')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x6b6a('0x16')](0x9)[_0x6b6a('0x25')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x6b6a('0x39')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x6b6a('0x16')](0x9)[_0x6b6a('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x6b6a('0x16')](0x9)[_0x6b6a('0x25')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x6b6a('0x3a')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x6b6a('0x16')](0x9)[_0x6b6a('0x25')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x6b6a('0x3b')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x6b6a('0x16')](0x9)[_0x6b6a('0x25')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x6b6a('0x16')](0x5)[_0x6b6a('0x25')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x6b6a('0x3c')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x6b6a('0x16')](0x9)[_0x6b6a('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x6b6a('0x3d')},'dialRecallMeTimeout':{'type':Sequelize[_0x6b6a('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x6b6a('0x3e')},'dialRecallInQueue':{'type':Sequelize[_0x6b6a('0x1f')],'defaultValue':0x0,'comment':_0x6b6a('0x3f')},'dialOrderByScheduledAt':{'type':Sequelize[_0x6b6a('0x3')](_0x6b6a('0x40'),_0x6b6a('0x41')),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':_0x6b6a('0x42')},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x6b6a('0x1f')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x6b6a('0x16')](0x3)[_0x6b6a('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x6b6a('0x43')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x6b6a('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6b6a('0x44')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x6b6a('0x16')](0x5)[_0x6b6a('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x6b6a('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6b6a('0x45')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6b6a('0x46')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x6b6a('0x16')](0x3)[_0x6b6a('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x6b6a('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6b6a('0x47')},'dialMachineMaxRetry':{'type':Sequelize[_0x6b6a('0x16')](0x3)[_0x6b6a('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6b6a('0x48')},'dialMachineRetryFrequency':{'type':Sequelize[_0x6b6a('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6b6a('0x49')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x6b6a('0x16')](0x3)[_0x6b6a('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6b6a('0x4a')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x6b6a('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x6b6a('0x1f')],'defaultValue':![],'comment':_0x6b6a('0x4b'),'set':function(_0x525d1e){if(!_0x525d1e)this[_0x6b6a('0xd')]('mandatoryDispositionPauseId',null);this[_0x6b6a('0xd')](_0x6b6a('0x4c'),_0x525d1e);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x6b6a('0x16')](0x3)[_0x6b6a('0x25')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file +var _0x7c22=['Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','always','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)','Active/Disactive\x20Recall\x20In\x20Queue','ASC','DESC','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\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)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','name','ENUM','outbound','inbound','STRING','ringall','fewestcalls','random','linear','wrandom','rrordered','rrmemory','getDataValue','type','dialMethod','booked','roundrobin','predictive','INTEGER','yes','all','TEXT','setDataValue','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','preview','power','progressive','Dial\x20Method.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'];(function(_0x18013c,_0x525967){var _0x3eeaad=function(_0x5880fa){while(--_0x5880fa){_0x18013c['push'](_0x18013c['shift']());}};_0x3eeaad(++_0x525967);}(_0x7c22,0x6c));var _0x27c2=function(_0x34f77c,_0x56b02d){_0x34f77c=_0x34f77c-0x0;var _0x1546ff=_0x7c22[_0x34f77c];return _0x1546ff;};'use strict';var Sequelize=require(_0x27c2('0x0'));module[_0x27c2('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x27c2('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x27c2('0x3')]('inbound',_0x27c2('0x4')),'allowNull':![],'defaultValue':_0x27c2('0x5')},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':'default'},'announce':{'type':Sequelize[_0x27c2('0x6')],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0x27c2('0x7'),'leastrecent',_0x27c2('0x8'),_0x27c2('0x9'),'rrmemory',_0x27c2('0xa'),_0x27c2('0xb'),_0x27c2('0xc')),'allowNull':![],'defaultValue':_0x27c2('0x7'),'set':function(_0x298bb7){this['setDataValue']('strategy',_0x298bb7?_0x298bb7:_0x27c2('0xd'));},'get':function(){var _0x3552e6=this[_0x27c2('0xe')](_0x27c2('0xf'));var _0x56c4c4=this[_0x27c2('0xe')](_0x27c2('0x10'));var _0x212f1c=this['getDataValue']('strategy');if(_0x3552e6===_0x27c2('0x5')){return _0x212f1c;}if(_0x56c4c4===_0x27c2('0x11')&&_0x212f1c===_0x27c2('0xd')||_0x56c4c4===_0x27c2('0x11')&&_0x212f1c===_0x27c2('0x12')){return _0x212f1c;}if(_0x56c4c4==='progressive'||_0x56c4c4===_0x27c2('0x13')||_0x56c4c4==='power'){return _0x212f1c;}return null;}},'servicelevel':{'type':Sequelize[_0x27c2('0x14')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x27c2('0x6')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x27c2('0x14')](0xb)},'timeout':{'type':Sequelize[_0x27c2('0x14')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x27c2('0x6')]},'weight':{'type':Sequelize[_0x27c2('0x14')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x27c2('0x14')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x27c2('0x3')](_0x27c2('0x15'),'no'),'defaultValue':_0x27c2('0x15')},'autopause':{'type':Sequelize[_0x27c2('0x3')](_0x27c2('0x15'),'no',_0x27c2('0x16')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize[_0x27c2('0x3')](_0x27c2('0x15'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x27c2('0x3')](_0x27c2('0x15'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM'](_0x27c2('0x15'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x27c2('0x3')](_0x27c2('0x15'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x27c2('0x3')](_0x27c2('0x15'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x27c2('0x3')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x27c2('0x6')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x27c2('0x6')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x27c2('0x14')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x27c2('0x14')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x27c2('0x14')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x27c2('0x3')](_0x27c2('0x15'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x27c2('0x3')]('yes','no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize[_0x27c2('0x3')](_0x27c2('0x15'),'no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x27c2('0x6')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x27c2('0x3')](_0x27c2('0x15'),'no')},'announce_position_limit':{'type':Sequelize[_0x27c2('0x14')](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x27c2('0x6')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x27c2('0x6')]},'queue_youarenext':{'type':Sequelize[_0x27c2('0x6')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x27c2('0x6')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x27c2('0x6')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x27c2('0x6')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x27c2('0x6')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x27c2('0x6')],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x27c2('0x6')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x27c2('0x6')]},'queue_quantity1':{'type':Sequelize[_0x27c2('0x6')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize[_0x27c2('0x6')]},'queue_less_than':{'type':Sequelize[_0x27c2('0x6')]},'periodic_announce':{'type':Sequelize[_0x27c2('0x17')],'set':function(_0x5d397b){this[_0x27c2('0x18')](_0x27c2('0x19'),_0x5d397b?_0x5d397b[_0x27c2('0x1a')](','):[]);},'get':function(){return this[_0x27c2('0xe')](_0x27c2('0x19'))?this[_0x27c2('0xe')]('periodic_announce')[_0x27c2('0x1b')](','):[];}},'joinempty':{'type':Sequelize[_0x27c2('0x6')],'defaultValue':_0x27c2('0x15'),'set':function(_0x524de2){this[_0x27c2('0x18')](_0x27c2('0x1c'),_0x524de2?_0x524de2[_0x27c2('0x1a')](','):undefined);},'get':function(){return this[_0x27c2('0xe')]('joinempty')?this[_0x27c2('0xe')](_0x27c2('0x1c'))[_0x27c2('0x1b')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x27c2('0x6')],'defaultValue':'no','set':function(_0x39f795){this[_0x27c2('0x18')](_0x27c2('0x1d'),_0x39f795?_0x39f795[_0x27c2('0x1a')](','):undefined);},'get':function(){return this[_0x27c2('0xe')]('leavewhenempty')?this[_0x27c2('0xe')](_0x27c2('0x1d'))[_0x27c2('0x1b')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x27c2('0x3')](_0x27c2('0x15'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0x27c2('0x15'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x27c2('0x14')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x27c2('0x3')](_0x27c2('0x15'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x27c2('0x6')]},'acw':{'type':Sequelize[_0x27c2('0x1e')],'defaultValue':0x0,'set':function(_0x97ef60){this[_0x27c2('0x18')](_0x27c2('0x1f'),_0x97ef60);if(_0x97ef60){if(this[_0x27c2('0xe')](_0x27c2('0x20'))<0x2){this['setDataValue'](_0x27c2('0x20'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x27c2('0x14')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x27c2('0x21')},'dialMethod':{'type':Sequelize[_0x27c2('0x3')](_0x27c2('0x22'),'progressive',_0x27c2('0x23'),_0x27c2('0x13'),_0x27c2('0x11')),'defaultValue':_0x27c2('0x24'),'comment':_0x27c2('0x25')},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)[_0x27c2('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize[_0x27c2('0x14')](0x4)[_0x27c2('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x27c2('0x27')},'dialPowerLevel':{'type':Sequelize[_0x27c2('0x28')](0x2)[_0x27c2('0x26')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x27c2('0x29')},'dialPredictiveOptimization':{'type':Sequelize['ENUM'](_0x27c2('0x2a'),_0x27c2('0x2b')),'defaultValue':'dropRate','comment':_0x27c2('0x2c')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x27c2('0x28')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x27c2('0x2d')},'dialPredictiveInterval':{'type':Sequelize[_0x27c2('0x14')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x27c2('0x2e')},'dialOriginateCallerIdName':{'type':Sequelize[_0x27c2('0x6')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x27c2('0x6')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x27c2('0x26')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x27c2('0x2f')},'dialQueueOptions':{'type':Sequelize[_0x27c2('0x6')],'defaultValue':_0x27c2('0x30'),'comment':_0x27c2('0x31')},'dialQueueTimeout':{'type':Sequelize[_0x27c2('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize[_0x27c2('0x6')],'comment':_0x27c2('0x32')},'dialCongestionMaxRetry':{'type':Sequelize[_0x27c2('0x14')](0x3)[_0x27c2('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x27c2('0x14')](0x5)[_0x27c2('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x27c2('0x33')},'dialBusyMaxRetry':{'type':Sequelize[_0x27c2('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x27c2('0x34')},'dialBusyRetryFrequency':{'type':Sequelize[_0x27c2('0x14')](0x5)[_0x27c2('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x27c2('0x26')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x27c2('0x14')](0x5)[_0x27c2('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x27c2('0x35')},'dialGlobalMaxRetry':{'type':Sequelize[_0x27c2('0x14')](0x3)[_0x27c2('0x26')],'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[_0x27c2('0x6')],'defaultValue':_0x27c2('0x36')},'dialPrefix':{'type':Sequelize[_0x27c2('0x6')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x27c2('0x3')](_0x27c2('0x37'),'never','onlyIfOpen'),'defaultValue':_0x27c2('0x37')},'dialAMDActive':{'type':Sequelize[_0x27c2('0x1e')],'defaultValue':0x0,'comment':_0x27c2('0x38')},'dialAMDInitialSilence':{'type':Sequelize[_0x27c2('0x14')](0x9)[_0x27c2('0x26')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x27c2('0x14')](0x9)[_0x27c2('0x26')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x27c2('0x39')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x27c2('0x14')](0x9)[_0x27c2('0x26')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x27c2('0x3a')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x27c2('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x27c2('0x3b')},'dialAMDMinWordLength':{'type':Sequelize[_0x27c2('0x14')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x27c2('0x3c')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x27c2('0x14')](0x9)[_0x27c2('0x26')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x27c2('0x14')](0x9)[_0x27c2('0x26')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x27c2('0x3d')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x27c2('0x14')](0x5)[_0x27c2('0x26')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x27c2('0x3e')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x27c2('0x14')](0x9)[_0x27c2('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize[_0x27c2('0x14')](0x5)[_0x27c2('0x26')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize[_0x27c2('0x1e')],'defaultValue':0x0,'comment':_0x27c2('0x3f')},'dialOrderByScheduledAt':{'type':Sequelize[_0x27c2('0x3')]('DESC',_0x27c2('0x40')),'defaultValue':_0x27c2('0x41')},'dialQueueProject2':{'type':Sequelize[_0x27c2('0x6')],'comment':_0x27c2('0x32')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x27c2('0x1e')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x27c2('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x27c2('0x14')](0x3)[_0x27c2('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x27c2('0x42')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x27c2('0x14')](0x3)[_0x27c2('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x27c2('0x43')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x27c2('0x14')](0x5)[_0x27c2('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x27c2('0x14')](0x3)[_0x27c2('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x27c2('0x14')](0x3)[_0x27c2('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x27c2('0x44')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x27c2('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x27c2('0x45')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x27c2('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x27c2('0x46')},'dialMachineRetryFrequency':{'type':Sequelize[_0x27c2('0x14')](0x5)[_0x27c2('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x27c2('0x47')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x27c2('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x27c2('0x14')](0x5)[_0x27c2('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x27c2('0x48')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x27c2('0x14')],'allowNull':!![],'comment':_0x27c2('0x49')},'mandatoryDisposition':{'type':Sequelize[_0x27c2('0x1e')],'defaultValue':![],'comment':_0x27c2('0x4a'),'set':function(_0x528802){if(!_0x528802)this[_0x27c2('0x18')](_0x27c2('0x4b'),null);this['setDataValue'](_0x27c2('0x4c'),_0x528802);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x27c2('0x14')](0x3)[_0x27c2('0x26')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x27c2('0x14')](0x3)[_0x27c2('0x26')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 15e701f..f656c0b 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 _0x9c74=['path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./voiceQueue.socket','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','get','VoiceQueues','inbound','QueueCampaigns','outbound','filter','ignore','map','includes','type','value','name','UserProfileResource','error','stack','index','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','merge','VIRTUAL','options','where','VoiceQueue','includeAll','include','findAll','rows','catch','show','rawAttributes','create','body','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','find','createdAt','findOne','nolimit','VoiceQueueId','CmHopper','getHopperHistories','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','voicePause','interface','flatMap','Agents','penalty','sequelize','transaction','TeamVoiceQueue','upsert','UserVoiceQueue','findOrCreate','each','UserVoiceQueueRt','isNil','emit','removeTeams','ids','User','select','field','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','union','removeAgents','forEach','addAgents','omit','spread','userVoiceQueue:save','online','isEmpty','SIP/%s','isArray','userVoiceQueue:remove','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ListId','updatedAt','NOW()','CmListId','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','ContactId','removeLists','getBlackLists','addBlackLists','removeBlackLists','eml-format','rimraf','fast-json-patch','request-promise','mustache'];(function(_0x3a607e,_0x54d530){var _0x37b106=function(_0x1becae){while(--_0x1becae){_0x3a607e['push'](_0x3a607e['shift']());}};_0x37b106(++_0x54d530);}(_0x9c74,0x16b));var _0x49c7=function(_0x36b5be,_0x25cbb9){_0x36b5be=_0x36b5be-0x0;var _0x186b09=_0x9c74[_0x36b5be];return _0x186b09;};'use strict';var emlformat=require(_0x49c7('0x0'));var rimraf=require(_0x49c7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x49c7('0x2'));var rp=require(_0x49c7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x49c7('0x4'));var util=require('util');var path=require(_0x49c7('0x5'));var sox=require('sox');var csv=require(_0x49c7('0x6'));var ejs=require(_0x49c7('0x7'));var fs=require('fs');var fs_extra=require(_0x49c7('0x8'));var _=require(_0x49c7('0x9'));var squel=require('squel');var crypto=require(_0x49c7('0xa'));var jsforce=require(_0x49c7('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x49c7('0x6'));var querystring=require(_0x49c7('0xc'));var Papa=require(_0x49c7('0xd'));var Redis=require(_0x49c7('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x49c7('0xf'));var as=require(_0x49c7('0x10'));var hardwareService=require(_0x49c7('0x11'));var logger=require('../../config/logger')(_0x49c7('0x12'));var utils=require(_0x49c7('0x13'));var config=require(_0x49c7('0x14'));var licenseUtil=require(_0x49c7('0x15'));var db=require(_0x49c7('0x16'))['db'];config[_0x49c7('0x17')]=_[_0x49c7('0x18')](config[_0x49c7('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x49c7('0x19'))(new Redis(config[_0x49c7('0x17')]));require(_0x49c7('0x1a'))['register'](socket);function respondWithStatusCode(_0x437cca,_0x3a529c){_0x3a529c=_0x3a529c||0xcc;return function(_0x2cd517){if(_0x2cd517){return _0x437cca[_0x49c7('0x1b')](_0x3a529c);}return _0x437cca['status'](_0x3a529c)[_0x49c7('0x1c')]();};}function respondWithResult(_0x3467ff,_0x5b9d9a){_0x5b9d9a=_0x5b9d9a||0xc8;return function(_0x49b765){if(_0x49b765){return _0x3467ff[_0x49c7('0x1d')](_0x5b9d9a)[_0x49c7('0x1e')](_0x49b765);}};}function respondWithFilteredResult(_0x42d2c1,_0x536cdd){return function(_0x9dcff2){if(_0x9dcff2){var _0x1adb0e=typeof _0x536cdd[_0x49c7('0x1f')]===_0x49c7('0x20')&&typeof _0x536cdd['limit']===_0x49c7('0x20');var _0x4adf2a=_0x9dcff2[_0x49c7('0x21')];var _0x4e5d0c=_0x1adb0e?0x0:_0x536cdd[_0x49c7('0x1f')];var _0x4f555c=_0x1adb0e?_0x9dcff2[_0x49c7('0x21')]:_0x536cdd[_0x49c7('0x1f')]+_0x536cdd[_0x49c7('0x22')];var _0x448ac3;if(_0x4f555c>=_0x4adf2a){_0x4f555c=_0x4adf2a;_0x448ac3=0xc8;}else{_0x448ac3=0xce;}_0x42d2c1[_0x49c7('0x1d')](_0x448ac3);return _0x42d2c1[_0x49c7('0x23')](_0x49c7('0x24'),_0x4e5d0c+'-'+_0x4f555c+'/'+_0x4adf2a)[_0x49c7('0x1e')](_0x9dcff2);}return null;};}function patchUpdates(_0x4b2713){return function(_0x5c9281){try{jsonpatch['apply'](_0x5c9281,_0x4b2713,!![]);}catch(_0x995e71){return BPromise[_0x49c7('0x25')](_0x995e71);}return _0x5c9281[_0x49c7('0x26')]();};}function saveUpdates(_0x358bee,_0x271682){return function(_0x3d1590){if(_0x3d1590){return _0x3d1590[_0x49c7('0x27')](_0x358bee)[_0x49c7('0x28')](function(_0x1612b0){return _0x1612b0;});}return null;};}function removeEntity(_0xe3f8a6,_0x3c1785){return function(_0x5967c6){if(_0x5967c6){return _0x5967c6[_0x49c7('0x29')]()[_0x49c7('0x28')](function(){var _0x228ebf=_0x5967c6[_0x49c7('0x2a')]({'plain':!![]});var _0x275c06=[{'name':_0x49c7('0x2b'),'value':_0x49c7('0x2c'),'ignore':![]},{'name':_0x49c7('0x2d'),'value':_0x49c7('0x2e'),'ignore':![]}];var _0x62d1e6=_(_0x275c06)[_0x49c7('0x2f')](_0x49c7('0x30'))[_0x49c7('0x31')]('value')['value']();if(_[_0x49c7('0x32')](_0x62d1e6,_0x228ebf[_0x49c7('0x33')])){return;}var _0xba6903=_['find'](_0x275c06,[_0x49c7('0x34'),_0x228ebf[_0x49c7('0x33')]])[_0x49c7('0x35')];return db[_0x49c7('0x36')][_0x49c7('0x29')]({'where':{'type':_0xba6903,'resourceId':_0x228ebf['id']}})[_0x49c7('0x28')](function(){return _0x5967c6;});})[_0x49c7('0x28')](function(){_0xe3f8a6[_0x49c7('0x1d')](0xcc)[_0x49c7('0x1c')]();});}};}function handleEntityNotFound(_0xbb779f,_0x579346){return function(_0x55b68d){if(!_0x55b68d){_0xbb779f[_0x49c7('0x1b')](0x194);}return _0x55b68d;};}function handleError(_0x15aac4,_0x5b8d33){_0x5b8d33=_0x5b8d33||0x1f4;return function(_0xb2961f){logger[_0x49c7('0x37')](_0xb2961f[_0x49c7('0x38')]);if(_0xb2961f['name']){delete _0xb2961f[_0x49c7('0x35')];}_0x15aac4[_0x49c7('0x1d')](_0x5b8d33)['send'](_0xb2961f);};}exports[_0x49c7('0x39')]=function(_0x22e276,_0x54edb1){var _0x5c21e5={},_0x4129db={},_0x3ed28c={'count':0x0,'rows':[]};var _0x49b016=_['map'](db['VoiceQueue']['rawAttributes'],function(_0x1d086e){return{'name':_0x1d086e[_0x49c7('0x3a')],'type':_0x1d086e[_0x49c7('0x33')][_0x49c7('0x3b')]};});_0x4129db[_0x49c7('0x3c')]=_[_0x49c7('0x31')](_0x49b016,_0x49c7('0x35'));_0x4129db[_0x49c7('0x3d')]=_[_0x49c7('0x3e')](_0x22e276[_0x49c7('0x3d')]);_0x4129db[_0x49c7('0x3f')]=_[_0x49c7('0x40')](_0x4129db[_0x49c7('0x3c')],_0x4129db[_0x49c7('0x3d')]);_0x5c21e5[_0x49c7('0x41')]=_[_0x49c7('0x40')](_0x4129db[_0x49c7('0x3c')],qs['fields'](_0x22e276[_0x49c7('0x3d')][_0x49c7('0x42')]));_0x5c21e5[_0x49c7('0x41')]=_0x5c21e5[_0x49c7('0x41')][_0x49c7('0x43')]?_0x5c21e5[_0x49c7('0x41')]:_0x4129db[_0x49c7('0x3c')];if(!_0x22e276[_0x49c7('0x3d')][_0x49c7('0x44')]('nolimit')){_0x5c21e5[_0x49c7('0x22')]=qs[_0x49c7('0x22')](_0x22e276[_0x49c7('0x3d')]['limit']);_0x5c21e5[_0x49c7('0x1f')]=qs[_0x49c7('0x1f')](_0x22e276[_0x49c7('0x3d')]['offset']);}_0x5c21e5[_0x49c7('0x45')]=qs['sort'](_0x22e276[_0x49c7('0x3d')][_0x49c7('0x46')]);_0x5c21e5['where']=qs[_0x49c7('0x3f')](_[_0x49c7('0x47')](_0x22e276['query'],_0x4129db[_0x49c7('0x3f')]),_0x49b016);if(_0x22e276['query'][_0x49c7('0x2f')]){_0x5c21e5['where']=_[_0x49c7('0x48')](_0x5c21e5['where'],{'$or':_[_0x49c7('0x31')](_0x49b016,function(_0xfebd4c){if(_0xfebd4c[_0x49c7('0x33')]!==_0x49c7('0x49')){var _0x5824f2={};_0x5824f2[_0xfebd4c[_0x49c7('0x35')]]={'$like':'%'+_0x22e276[_0x49c7('0x3d')][_0x49c7('0x2f')]+'%'};return _0x5824f2;}})});}_0x5c21e5=_[_0x49c7('0x48')]({},_0x5c21e5,_0x22e276[_0x49c7('0x4a')]);var _0x18a540={'where':_0x5c21e5[_0x49c7('0x4b')]};return db[_0x49c7('0x4c')][_0x49c7('0x21')](_0x18a540)[_0x49c7('0x28')](function(_0x2e69b6){_0x3ed28c['count']=_0x2e69b6;if(_0x22e276[_0x49c7('0x3d')][_0x49c7('0x4d')]){_0x5c21e5[_0x49c7('0x4e')]=[{'all':!![]}];}return db['VoiceQueue'][_0x49c7('0x4f')](_0x5c21e5);})['then'](function(_0x1b9ab8){_0x3ed28c[_0x49c7('0x50')]=_0x1b9ab8;return _0x3ed28c;})[_0x49c7('0x28')](respondWithFilteredResult(_0x54edb1,_0x5c21e5))[_0x49c7('0x51')](handleError(_0x54edb1,null));};exports[_0x49c7('0x52')]=function(_0x32f1b4,_0x188699){var _0x3660f9={'raw':![],'where':{'id':_0x32f1b4['params']['id']}},_0x599061={};_0x599061[_0x49c7('0x3c')]=_[_0x49c7('0x3e')](db[_0x49c7('0x4c')][_0x49c7('0x53')]);_0x599061['query']=_[_0x49c7('0x3e')](_0x32f1b4[_0x49c7('0x3d')]);_0x599061[_0x49c7('0x3f')]=_[_0x49c7('0x40')](_0x599061[_0x49c7('0x3c')],_0x599061[_0x49c7('0x3d')]);_0x3660f9['attributes']=_[_0x49c7('0x40')](_0x599061[_0x49c7('0x3c')],qs[_0x49c7('0x42')](_0x32f1b4[_0x49c7('0x3d')][_0x49c7('0x42')]));_0x3660f9[_0x49c7('0x41')]=_0x3660f9[_0x49c7('0x41')]['length']?_0x3660f9[_0x49c7('0x41')]:_0x599061[_0x49c7('0x3c')];if(_0x32f1b4[_0x49c7('0x3d')]['includeAll']){_0x3660f9[_0x49c7('0x4e')]=[{'all':!![]}];}_0x3660f9=_[_0x49c7('0x48')]({},_0x3660f9,_0x32f1b4['options']);return db[_0x49c7('0x4c')]['find'](_0x3660f9)[_0x49c7('0x28')](handleEntityNotFound(_0x188699,null))[_0x49c7('0x28')](respondWithResult(_0x188699,null))[_0x49c7('0x51')](handleError(_0x188699,null));};exports['create']=function(_0x471546,_0x56ba24){return db[_0x49c7('0x4c')][_0x49c7('0x54')](_0x471546[_0x49c7('0x55')],{})['then'](function(_0x47145e){var _0x380532=_0x471546['user'][_0x49c7('0x2a')]({'plain':!![]});if(!_0x380532)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x380532[_0x49c7('0x56')]===_0x49c7('0x57')){var _0x2f4732=_0x47145e[_0x49c7('0x2a')]({'plain':!![]});var _0x152658=[{'name':_0x49c7('0x2b'),'value':_0x49c7('0x2c')},{'name':_0x49c7('0x2d'),'value':_0x49c7('0x2e')}];var _0x3e2cd3=_['find'](_0x152658,[_0x49c7('0x34'),_0x2f4732[_0x49c7('0x33')]])[_0x49c7('0x35')];return db['UserProfileSection']['find']({'where':{'name':_0x3e2cd3,'userProfileId':_0x380532[_0x49c7('0x58')]},'raw':!![]})[_0x49c7('0x28')](function(_0x1e8cca){if(_0x1e8cca&&_0x1e8cca[_0x49c7('0x59')]===0x0){return db[_0x49c7('0x36')][_0x49c7('0x54')]({'name':_0x2f4732[_0x49c7('0x35')],'resourceId':_0x2f4732['id'],'type':_0x1e8cca[_0x49c7('0x35')],'sectionId':_0x1e8cca['id']},{})['then'](function(){return _0x47145e;});}else{return _0x47145e;}})['catch'](function(_0x586c21){logger['error'](_0x49c7('0x5a'),_0x586c21);throw _0x586c21;});}return _0x47145e;})[_0x49c7('0x28')](respondWithResult(_0x56ba24,0xc9))[_0x49c7('0x51')](handleError(_0x56ba24,null));};exports[_0x49c7('0x5b')]=function(_0x251f5f,_0x5c7b08){var _0x5f0c5c={'where':{'id':_0x251f5f[_0x49c7('0x5c')]['id']}},_0x129ecb={};_0x129ecb[_0x49c7('0x3c')]=_[_0x49c7('0x3e')](db['VoiceQueue'][_0x49c7('0x53')]);_0x5f0c5c['attributes']=_['intersection'](_0x129ecb[_0x49c7('0x3c')],qs['fields'](_0x251f5f[_0x49c7('0x3d')][_0x49c7('0x42')]));_0x5f0c5c[_0x49c7('0x41')]=_0x5f0c5c['attributes']['length']?_0x5f0c5c[_0x49c7('0x41')]:_0x129ecb[_0x49c7('0x3c')];if(_0x251f5f[_0x49c7('0x3d')][_0x49c7('0x4d')]){_0x5f0c5c[_0x49c7('0x4e')]=[{'all':!![]}];}_0x5f0c5c=_['merge']({},_0x5f0c5c,_0x251f5f[_0x49c7('0x4a')]);return db[_0x49c7('0x4c')][_0x49c7('0x5d')](_0x5f0c5c)[_0x49c7('0x28')](handleEntityNotFound(_0x5c7b08,null))[_0x49c7('0x28')](function(_0x417184){if(_0x417184){var _0x584cbb=_0x417184[_0x49c7('0x2a')]({'plain':!![]});_0x584cbb=qs['omit'](_0x584cbb,['id',_0x49c7('0x5e'),'updatedAt']);_0x251f5f[_0x49c7('0x55')]=_['omit'](_0x251f5f[_0x49c7('0x55')],['id',_0x49c7('0x5e'),'updatedAt']);return db[_0x49c7('0x4c')][_0x49c7('0x54')](_[_0x49c7('0x48')](_0x584cbb,_0x251f5f[_0x49c7('0x55')]),{'include':_0x251f5f['query']['includeAll']?[{'all':!![]}]:undefined})[_0x49c7('0x28')](function(_0x34bdf3){var _0x207cee=_0x251f5f[_0x49c7('0x57')][_0x49c7('0x2a')]({'plain':!![]});if(!_0x207cee)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x207cee[_0x49c7('0x56')]===_0x49c7('0x57')){var _0xb44630=_0x34bdf3[_0x49c7('0x2a')]({'plain':!![]});var _0x5e5ba7=[{'name':_0x49c7('0x2b'),'value':_0x49c7('0x2c')},{'name':'QueueCampaigns','value':_0x49c7('0x2e')}];var _0x5f7d12=_[_0x49c7('0x5d')](_0x5e5ba7,[_0x49c7('0x34'),_0xb44630[_0x49c7('0x33')]])[_0x49c7('0x35')];return db['UserProfileSection'][_0x49c7('0x5d')]({'where':{'name':_0x5f7d12,'userProfileId':_0x207cee[_0x49c7('0x58')]},'raw':!![]})[_0x49c7('0x28')](function(_0x41af3e){if(_0x41af3e&&_0x41af3e[_0x49c7('0x59')]===0x0){return db[_0x49c7('0x36')][_0x49c7('0x54')]({'name':_0xb44630['name'],'resourceId':_0xb44630['id'],'type':_0x41af3e[_0x49c7('0x35')],'sectionId':_0x41af3e['id']},{})[_0x49c7('0x28')](function(){return _0x34bdf3;});}else{return _0x34bdf3;}})['catch'](function(_0x3e0e0b){logger[_0x49c7('0x37')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3e0e0b);throw _0x3e0e0b;});}return _0x34bdf3;});}})[_0x49c7('0x28')](respondWithResult(_0x5c7b08,0xc9))[_0x49c7('0x51')](handleError(_0x5c7b08,null));};exports[_0x49c7('0x27')]=function(_0x146d30,_0x21f202){if(_0x146d30[_0x49c7('0x55')]['id']){delete _0x146d30[_0x49c7('0x55')]['id'];}return db[_0x49c7('0x4c')][_0x49c7('0x5d')]({'where':{'id':_0x146d30[_0x49c7('0x5c')]['id']}})[_0x49c7('0x28')](handleEntityNotFound(_0x21f202,null))[_0x49c7('0x28')](saveUpdates(_0x146d30[_0x49c7('0x55')],null))[_0x49c7('0x28')](respondWithResult(_0x21f202,null))[_0x49c7('0x51')](handleError(_0x21f202,null));};exports[_0x49c7('0x29')]=function(_0x308d9c,_0x27a013){return db[_0x49c7('0x4c')][_0x49c7('0x5d')]({'where':{'id':_0x308d9c[_0x49c7('0x5c')]['id']}})[_0x49c7('0x28')](handleEntityNotFound(_0x27a013,null))[_0x49c7('0x28')](removeEntity(_0x27a013,null))[_0x49c7('0x51')](handleError(_0x27a013,null));};exports['getHoppers']=function(_0xb256e2,_0x52816b,_0x26374d){var _0x3fcb02={'raw':![],'where':{}};var _0x335913={};var _0x39ed90={'count':0x0,'rows':[]};return db[_0x49c7('0x4c')][_0x49c7('0x5f')]({'where':{'id':_0xb256e2['params']['id']}})['then'](handleEntityNotFound(_0x52816b,null))[_0x49c7('0x28')](function(_0x27f641){if(_0x27f641){_0x335913[_0x49c7('0x3c')]=_[_0x49c7('0x3e')](db['CmHopper'][_0x49c7('0x53')]);_0x335913['query']=_['keys'](_0xb256e2[_0x49c7('0x3d')]);_0x335913[_0x49c7('0x3f')]=_[_0x49c7('0x40')](_0x335913[_0x49c7('0x3c')],_0x335913[_0x49c7('0x3d')]);_0x3fcb02[_0x49c7('0x41')]=_[_0x49c7('0x40')](_0x335913[_0x49c7('0x3c')],qs['fields'](_0xb256e2[_0x49c7('0x3d')][_0x49c7('0x42')]));_0x3fcb02['attributes']=_0x3fcb02[_0x49c7('0x41')][_0x49c7('0x43')]?_0x3fcb02[_0x49c7('0x41')]:_0x335913['model'];if(!_0xb256e2[_0x49c7('0x3d')]['hasOwnProperty'](_0x49c7('0x60'))){_0x3fcb02['limit']=qs['limit'](_0xb256e2[_0x49c7('0x3d')][_0x49c7('0x22')]);_0x3fcb02[_0x49c7('0x1f')]=qs[_0x49c7('0x1f')](_0xb256e2['query'][_0x49c7('0x1f')]);}_0x3fcb02['order']=qs[_0x49c7('0x46')](_0xb256e2[_0x49c7('0x3d')][_0x49c7('0x46')]);_0x3fcb02['where']=qs[_0x49c7('0x3f')](_[_0x49c7('0x47')](_0xb256e2[_0x49c7('0x3d')],_0x335913['filters']));_0x3fcb02[_0x49c7('0x4b')][_0x49c7('0x61')]=_0x27f641['id'];if(_0xb256e2[_0x49c7('0x3d')][_0x49c7('0x2f')]){_0x3fcb02[_0x49c7('0x4b')]=_[_0x49c7('0x48')](_0x3fcb02[_0x49c7('0x4b')],{'$or':_[_0x49c7('0x31')](_0x3fcb02[_0x49c7('0x41')],function(_0x2f0596){var _0x23e2d={};_0x23e2d[_0x2f0596]={'$like':'%'+_0xb256e2[_0x49c7('0x3d')]['filter']+'%'};return _0x23e2d;})});}_0x3fcb02=_[_0x49c7('0x48')]({},_0x3fcb02,_0xb256e2[_0x49c7('0x4a')]);return db[_0x49c7('0x62')][_0x49c7('0x21')]({'where':_0x3fcb02['where']})[_0x49c7('0x28')](function(_0x323a1b){_0x39ed90['count']=_0x323a1b;if(_0xb256e2['query']['includeAll']){_0x3fcb02['include']=[{'all':!![]}];}return db[_0x49c7('0x62')]['findAll'](_0x3fcb02);})['then'](function(_0x4e13e5){_0x39ed90[_0x49c7('0x50')]=_0x4e13e5;return _0x39ed90;});}})['then'](respondWithFilteredResult(_0x52816b,_0x3fcb02))[_0x49c7('0x51')](handleError(_0x52816b,null));};exports[_0x49c7('0x63')]=function(_0x31a8b7,_0x49f0a2,_0x2ebe8d){var _0x3f80ad={'raw':!![],'where':{}};var _0x545b0c={};var _0xd14a46={'count':0x0,'rows':[]};return db[_0x49c7('0x4c')][_0x49c7('0x5f')]({'where':{'id':_0x31a8b7[_0x49c7('0x5c')]['id']}})[_0x49c7('0x28')](handleEntityNotFound(_0x49f0a2,null))['then'](function(_0x2c584a){if(_0x2c584a){_0x545b0c[_0x49c7('0x3c')]=_[_0x49c7('0x3e')](db[_0x49c7('0x64')]['rawAttributes']);_0x545b0c[_0x49c7('0x3d')]=_[_0x49c7('0x3e')](_0x31a8b7['query']);_0x545b0c['filters']=_['intersection'](_0x545b0c[_0x49c7('0x3c')],_0x545b0c[_0x49c7('0x3d')]);_0x3f80ad[_0x49c7('0x41')]=_[_0x49c7('0x40')](_0x545b0c['model'],qs['fields'](_0x31a8b7[_0x49c7('0x3d')][_0x49c7('0x42')]));_0x3f80ad['attributes']=_0x3f80ad[_0x49c7('0x41')][_0x49c7('0x43')]?_0x3f80ad[_0x49c7('0x41')]:_0x545b0c['model'];if(!_0x31a8b7['query']['hasOwnProperty'](_0x49c7('0x60'))){_0x3f80ad[_0x49c7('0x22')]=qs[_0x49c7('0x22')](_0x31a8b7[_0x49c7('0x3d')][_0x49c7('0x22')]);_0x3f80ad[_0x49c7('0x1f')]=qs[_0x49c7('0x1f')](_0x31a8b7[_0x49c7('0x3d')][_0x49c7('0x1f')]);}_0x3f80ad[_0x49c7('0x45')]=qs[_0x49c7('0x46')](_0x31a8b7[_0x49c7('0x3d')][_0x49c7('0x46')]);_0x3f80ad[_0x49c7('0x4b')]=qs['filters'](_[_0x49c7('0x47')](_0x31a8b7[_0x49c7('0x3d')],_0x545b0c[_0x49c7('0x3f')]));_0x3f80ad[_0x49c7('0x4b')][_0x49c7('0x61')]=_0x2c584a['id'];if(_0x31a8b7[_0x49c7('0x3d')][_0x49c7('0x2f')]){_0x3f80ad[_0x49c7('0x4b')]=_[_0x49c7('0x48')](_0x3f80ad['where'],{'$or':_[_0x49c7('0x31')](_0x3f80ad['attributes'],function(_0x478518){var _0x452fcc={};_0x452fcc[_0x478518]={'$like':'%'+_0x31a8b7[_0x49c7('0x3d')]['filter']+'%'};return _0x452fcc;})});}_0x3f80ad=_[_0x49c7('0x48')]({},_0x3f80ad,_0x31a8b7[_0x49c7('0x4a')]);return db[_0x49c7('0x64')][_0x49c7('0x21')]({'where':_0x3f80ad[_0x49c7('0x4b')]})[_0x49c7('0x28')](function(_0x492a6a){_0xd14a46[_0x49c7('0x21')]=_0x492a6a;if(_0x31a8b7[_0x49c7('0x3d')][_0x49c7('0x4d')]){_0x3f80ad[_0x49c7('0x4e')]=[{'all':!![]}];}return db[_0x49c7('0x64')][_0x49c7('0x4f')](_0x3f80ad);})[_0x49c7('0x28')](function(_0x4a363e){_0xd14a46[_0x49c7('0x50')]=_0x4a363e;return _0xd14a46;});}})[_0x49c7('0x28')](respondWithFilteredResult(_0x49f0a2,_0x3f80ad))[_0x49c7('0x51')](handleError(_0x49f0a2,null));};exports['getHopperFinals']=function(_0x57b99e,_0x2f43be,_0x5c1a1b){var _0x9e3166={'raw':!![],'where':{}};var _0x1d72e2={};var _0x422d89={'count':0x0,'rows':[]};return db[_0x49c7('0x4c')]['findOne']({'where':{'id':_0x57b99e[_0x49c7('0x5c')]['id']}})[_0x49c7('0x28')](handleEntityNotFound(_0x2f43be,null))[_0x49c7('0x28')](function(_0x28aa2f){if(_0x28aa2f){_0x1d72e2['model']=_['keys'](db[_0x49c7('0x65')][_0x49c7('0x53')]);_0x1d72e2[_0x49c7('0x3d')]=_[_0x49c7('0x3e')](_0x57b99e['query']);_0x1d72e2[_0x49c7('0x3f')]=_['intersection'](_0x1d72e2['model'],_0x1d72e2[_0x49c7('0x3d')]);_0x9e3166[_0x49c7('0x41')]=_['intersection'](_0x1d72e2[_0x49c7('0x3c')],qs[_0x49c7('0x42')](_0x57b99e[_0x49c7('0x3d')][_0x49c7('0x42')]));_0x9e3166[_0x49c7('0x41')]=_0x9e3166[_0x49c7('0x41')]['length']?_0x9e3166[_0x49c7('0x41')]:_0x1d72e2[_0x49c7('0x3c')];if(!_0x57b99e[_0x49c7('0x3d')][_0x49c7('0x44')](_0x49c7('0x60'))){_0x9e3166[_0x49c7('0x22')]=qs[_0x49c7('0x22')](_0x57b99e['query'][_0x49c7('0x22')]);_0x9e3166[_0x49c7('0x1f')]=qs[_0x49c7('0x1f')](_0x57b99e['query']['offset']);}_0x9e3166[_0x49c7('0x45')]=qs['sort'](_0x57b99e[_0x49c7('0x3d')][_0x49c7('0x46')]);_0x9e3166[_0x49c7('0x4b')]=qs[_0x49c7('0x3f')](_[_0x49c7('0x47')](_0x57b99e[_0x49c7('0x3d')],_0x1d72e2['filters']));_0x9e3166[_0x49c7('0x4b')]['VoiceQueueId']=_0x28aa2f['id'];if(_0x57b99e['query'][_0x49c7('0x2f')]){_0x9e3166['where']=_['merge'](_0x9e3166[_0x49c7('0x4b')],{'$or':_[_0x49c7('0x31')](_0x9e3166[_0x49c7('0x41')],function(_0x1f77c0){var _0x46b434={};_0x46b434[_0x1f77c0]={'$like':'%'+_0x57b99e['query'][_0x49c7('0x2f')]+'%'};return _0x46b434;})});}_0x9e3166=_[_0x49c7('0x48')]({},_0x9e3166,_0x57b99e[_0x49c7('0x4a')]);return db[_0x49c7('0x65')][_0x49c7('0x21')]({'where':_0x9e3166[_0x49c7('0x4b')]})[_0x49c7('0x28')](function(_0x2f5d13){_0x422d89[_0x49c7('0x21')]=_0x2f5d13;if(_0x57b99e[_0x49c7('0x3d')][_0x49c7('0x4d')]){_0x9e3166[_0x49c7('0x4e')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x49c7('0x4f')](_0x9e3166);})[_0x49c7('0x28')](function(_0x5b0e44){_0x422d89[_0x49c7('0x50')]=_0x5b0e44;return _0x422d89;});}})[_0x49c7('0x28')](respondWithFilteredResult(_0x2f43be,_0x9e3166))[_0x49c7('0x51')](handleError(_0x2f43be,null));};exports[_0x49c7('0x66')]=function(_0x3de67a,_0x589805,_0x21c602){var _0x3081be={'raw':!![],'where':{}};var _0x1380a9={};var _0x1972bd={'count':0x0,'rows':[]};return db[_0x49c7('0x4c')][_0x49c7('0x5f')]({'where':{'id':_0x3de67a[_0x49c7('0x5c')]['id']}})['then'](handleEntityNotFound(_0x589805,null))[_0x49c7('0x28')](function(_0x12745a){if(_0x12745a){_0x1380a9[_0x49c7('0x3c')]=_['keys'](db['CmHopperBlack'][_0x49c7('0x53')]);_0x1380a9[_0x49c7('0x3d')]=_['keys'](_0x3de67a['query']);_0x1380a9[_0x49c7('0x3f')]=_[_0x49c7('0x40')](_0x1380a9['model'],_0x1380a9[_0x49c7('0x3d')]);_0x3081be[_0x49c7('0x41')]=_[_0x49c7('0x40')](_0x1380a9[_0x49c7('0x3c')],qs[_0x49c7('0x42')](_0x3de67a['query'][_0x49c7('0x42')]));_0x3081be[_0x49c7('0x41')]=_0x3081be[_0x49c7('0x41')][_0x49c7('0x43')]?_0x3081be['attributes']:_0x1380a9['model'];if(!_0x3de67a[_0x49c7('0x3d')][_0x49c7('0x44')](_0x49c7('0x60'))){_0x3081be['limit']=qs[_0x49c7('0x22')](_0x3de67a[_0x49c7('0x3d')][_0x49c7('0x22')]);_0x3081be[_0x49c7('0x1f')]=qs[_0x49c7('0x1f')](_0x3de67a[_0x49c7('0x3d')][_0x49c7('0x1f')]);}_0x3081be['order']=qs[_0x49c7('0x46')](_0x3de67a[_0x49c7('0x3d')][_0x49c7('0x46')]);_0x3081be[_0x49c7('0x4b')]=qs['filters'](_['pick'](_0x3de67a[_0x49c7('0x3d')],_0x1380a9['filters']));_0x3081be['where'][_0x49c7('0x61')]=_0x12745a['id'];if(_0x3de67a[_0x49c7('0x3d')][_0x49c7('0x2f')]){_0x3081be['where']=_[_0x49c7('0x48')](_0x3081be[_0x49c7('0x4b')],{'$or':_[_0x49c7('0x31')](_0x3081be[_0x49c7('0x41')],function(_0x4a8a2e){var _0x43b303={};_0x43b303[_0x4a8a2e]={'$like':'%'+_0x3de67a['query']['filter']+'%'};return _0x43b303;})});}_0x3081be=_['merge']({},_0x3081be,_0x3de67a[_0x49c7('0x4a')]);return db[_0x49c7('0x67')][_0x49c7('0x21')]({'where':_0x3081be[_0x49c7('0x4b')]})['then'](function(_0x108710){_0x1972bd['count']=_0x108710;if(_0x3de67a[_0x49c7('0x3d')]['includeAll']){_0x3081be[_0x49c7('0x4e')]=[{'all':!![]}];}return db[_0x49c7('0x67')][_0x49c7('0x4f')](_0x3081be);})['then'](function(_0x11380c){_0x1972bd[_0x49c7('0x50')]=_0x11380c;return _0x1972bd;});}})[_0x49c7('0x28')](respondWithFilteredResult(_0x589805,_0x3081be))['catch'](handleError(_0x589805,null));};exports[_0x49c7('0x68')]=function(_0x22f337,_0x2995d1,_0x32e19c){var _0x47a093={};var _0x23e313={};var _0x2c74d5;var _0x4486f5;return db['VoiceQueue'][_0x49c7('0x5f')]({'where':{'id':_0x22f337[_0x49c7('0x5c')]['id']}})['then'](handleEntityNotFound(_0x2995d1,null))['then'](function(_0x113c9c){if(_0x113c9c){_0x2c74d5=_0x113c9c;_0x23e313[_0x49c7('0x3c')]=_[_0x49c7('0x3e')](db[_0x49c7('0x69')][_0x49c7('0x53')]);_0x23e313['query']=_[_0x49c7('0x3e')](_0x22f337[_0x49c7('0x3d')]);_0x23e313[_0x49c7('0x3f')]=_['intersection'](_0x23e313['model'],_0x23e313[_0x49c7('0x3d')]);_0x47a093['attributes']=_[_0x49c7('0x40')](_0x23e313[_0x49c7('0x3c')],qs[_0x49c7('0x42')](_0x22f337[_0x49c7('0x3d')][_0x49c7('0x42')]));_0x47a093[_0x49c7('0x41')]=_0x47a093[_0x49c7('0x41')][_0x49c7('0x43')]?_0x47a093['attributes']:_0x23e313[_0x49c7('0x3c')];_0x47a093[_0x49c7('0x45')]=qs['sort'](_0x22f337['query'][_0x49c7('0x46')]);_0x47a093[_0x49c7('0x4b')]=qs[_0x49c7('0x3f')](_['pick'](_0x22f337[_0x49c7('0x3d')],_0x23e313['filters']));if(_0x22f337[_0x49c7('0x3d')]['filter']){_0x47a093['where']=_['merge'](_0x47a093[_0x49c7('0x4b')],{'$or':_['map'](_0x47a093['attributes'],function(_0xfcce1d){var _0x3f46d6={};_0x3f46d6[_0xfcce1d]={'$like':'%'+_0x22f337[_0x49c7('0x3d')][_0x49c7('0x2f')]+'%'};return _0x3f46d6;})});}_0x47a093=_[_0x49c7('0x48')]({},_0x47a093,_0x22f337[_0x49c7('0x4a')]);return _0x2c74d5[_0x49c7('0x68')](_0x47a093);}})['then'](function(_0x18c1a2){if(_0x18c1a2){_0x4486f5=_0x18c1a2['length'];if(!_0x22f337[_0x49c7('0x3d')]['hasOwnProperty'](_0x49c7('0x60'))){_0x47a093[_0x49c7('0x22')]=qs[_0x49c7('0x22')](_0x22f337[_0x49c7('0x3d')][_0x49c7('0x22')]);_0x47a093[_0x49c7('0x1f')]=qs[_0x49c7('0x1f')](_0x22f337[_0x49c7('0x3d')]['offset']);}return _0x2c74d5[_0x49c7('0x68')](_0x47a093);}})['then'](function(_0x1941ac){if(_0x1941ac){return _0x1941ac?{'count':_0x4486f5,'rows':_0x1941ac}:null;}})[_0x49c7('0x28')](respondWithResult(_0x2995d1,null))[_0x49c7('0x51')](handleError(_0x2995d1,null));};exports[_0x49c7('0x6a')]=function(_0xb7d008,_0x596a06,_0x2ab32b){var _0x14061a=_0xb7d008[_0x49c7('0x55')][_0x49c7('0x6b')];var _0x393d3f=_[_0x49c7('0x31')](_0x14061a,'id');return db['Team']['findAll']({'where':{'id':_0x393d3f},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id','name','online',_0x49c7('0x6c'),_0x49c7('0x6d')],'raw':!![]}]})['then'](function(_0x4c045d){if(_0x4c045d){var _0x5d6a71=_[_0x49c7('0x6e')](_0x4c045d,function(_0x26e69d){var _0x458fd7=_0x26e69d[_0x49c7('0x2a')]({'plain':!![]});_0x458fd7[_0x49c7('0x6f')]['forEach'](function(_0xa2e841){_0xa2e841[_0x49c7('0x70')]=_[_0x49c7('0x5d')](_0x14061a,{'id':_0x458fd7['id']})[_0x49c7('0x70')];});return _0x458fd7[_0x49c7('0x6f')];});return db[_0x49c7('0x4c')][_0x49c7('0x5d')]({'where':{'id':_0xb7d008[_0x49c7('0x5c')]['id']}})[_0x49c7('0x28')](function(_0x47f7b3){return db[_0x49c7('0x71')][_0x49c7('0x72')](function(_0x3a12e8){return _0x47f7b3[_0x49c7('0x6a')](_0x393d3f,{'transaction':_0x3a12e8})[_0x49c7('0x28')](function(){return BPromise['each'](_0x14061a,function(_0x15a9f2){return db[_0x49c7('0x73')][_0x49c7('0x74')]({'TeamId':_0x15a9f2['id'],'VoiceQueueId':_0xb7d008[_0x49c7('0x5c')]['id'],'penalty':_0x15a9f2[_0x49c7('0x70')]},{'transaction':_0x3a12e8});});})['then'](function(){return BPromise['each'](_0x5d6a71,function(_0x2240e8){return db[_0x49c7('0x75')][_0x49c7('0x76')]({'where':{'UserId':_0x2240e8['id'],'VoiceQueueId':_0xb7d008[_0x49c7('0x5c')]['id']},'defaults':{'penalty':_0x2240e8[_0x49c7('0x70')]},'transaction':_0x3a12e8});});})['then'](function(){return BPromise[_0x49c7('0x77')](_[_0x49c7('0x2f')](_0x5d6a71,{'online':!![]}),function(_0x1e5bc5){return db[_0x49c7('0x78')][_0x49c7('0x74')]({'membername':_0x1e5bc5[_0x49c7('0x35')],'UserId':_0x1e5bc5['id'],'queue_name':_0x47f7b3[_0x49c7('0x35')],'VoiceQueueId':_0x47f7b3['id'],'interface':_[_0x49c7('0x79')](_0x1e5bc5['interface'])?util['format']('SIP/%s',_0x1e5bc5['name']):_0x1e5bc5['interface'],'paused':_0x1e5bc5[_0x49c7('0x6c')]||![],'penalty':_0x1e5bc5[_0x49c7('0x70')]},{'transaction':_0x3a12e8});});})[_0x49c7('0x28')](function(){_0x5d6a71['forEach'](function(_0x8fc33a){socket[_0x49c7('0x7a')]('userVoiceQueue:save',{'UserId':_0x8fc33a['id'],'VoiceQueueId':_0x47f7b3['id']});});});});});}})[_0x49c7('0x28')](respondWithStatusCode(_0x596a06,null))[_0x49c7('0x51')](handleError(_0x596a06,null));};exports[_0x49c7('0x7b')]=function(_0x5c3419,_0x3282d,_0x3e6bd8){return db[_0x49c7('0x69')][_0x49c7('0x4f')]({'where':{'id':_0x5c3419[_0x49c7('0x3d')][_0x49c7('0x7c')]},'attributes':['id'],'include':[{'model':db[_0x49c7('0x7d')],'as':_0x49c7('0x6f'),'attributes':['id'],'raw':!![]}]})[_0x49c7('0x28')](handleEntityNotFound(_0x3282d,null))[_0x49c7('0x28')](function(_0x1446e1){var _0x567bd5=_['map'](_0x1446e1,'id');var _0x5de837=[];var _0x1f5a65=[];var _0x5f9881=squel[_0x49c7('0x7e')]();_0x5f9881[_0x49c7('0x7f')]('tq.TeamId')[_0x49c7('0x80')](_0x49c7('0x81'),'tq')[_0x49c7('0x82')](_0x49c7('0x83'),'ut',_0x49c7('0x84'))[_0x49c7('0x4b')](_0x49c7('0x85'),_0x5c3419[_0x49c7('0x5c')]['id']);for(var _0xeaa4f1=0x0;_0xeaa4f1<_0x1446e1[_0x49c7('0x43')];_0xeaa4f1+=0x1){let _0x28e4f8=_0x1446e1[_0xeaa4f1];for(var _0x2ccb93=0x0;_0x2ccb93<_0x28e4f8['Agents'][_0x49c7('0x43')];_0x2ccb93+=0x1){let _0x391bd3=_0x28e4f8['Agents'][_0x2ccb93];var _0x318ad0=_0x5f9881[_0x49c7('0x5b')]();_0x318ad0['where'](_0x49c7('0x86'),_0x391bd3['id']);_0x1f5a65[_0x49c7('0x87')](db[_0x49c7('0x71')][_0x49c7('0x3d')](_0x318ad0[_0x49c7('0x88')](),{'type':db[_0x49c7('0x71')][_0x49c7('0x89')][_0x49c7('0x8a')]})[_0x49c7('0x28')](function(_0x25bb7b){if(_0x25bb7b[_0x49c7('0x43')]===0x1){return _0x391bd3['id'];}else{var _0x489a5e=_[_0x49c7('0x8b')](_[_0x49c7('0x31')](_0x25bb7b,_0x49c7('0x8c')),function(_0xe2717d){return _[_0x49c7('0x32')](_0x567bd5,_0xe2717d);});if(_0x489a5e){return _0x391bd3['id'];}}}));}}return BPromise[_0x49c7('0x8d')](_0x1f5a65)[_0x49c7('0x28')](function(_0x2a9667){_0x5de837=_(_0x5de837)[_0x49c7('0x8e')](_0x2a9667)['compact']()[_0x49c7('0x34')]();return db[_0x49c7('0x4c')][_0x49c7('0x5d')]({'where':{'id':_0x5c3419[_0x49c7('0x5c')]['id']}})[_0x49c7('0x28')](function(_0x47fd16){return db[_0x49c7('0x71')][_0x49c7('0x72')](function(_0x40e34c){return _0x47fd16[_0x49c7('0x7b')](_0x5c3419[_0x49c7('0x3d')][_0x49c7('0x7c')],{'transaction':_0x40e34c})[_0x49c7('0x28')](function(){if(!_['isEmpty'](_0x5de837)){return _0x47fd16[_0x49c7('0x8f')](_0x5de837,{'transaction':_0x40e34c})[_0x49c7('0x28')](function(){return db[_0x49c7('0x78')][_0x49c7('0x29')]({'where':{'VoiceQueueId':_0x5c3419[_0x49c7('0x5c')]['id'],'UserId':_0x5de837},'transaction':_0x40e34c});});}})[_0x49c7('0x28')](function(){_0x5de837[_0x49c7('0x90')](function(_0x518f37){socket[_0x49c7('0x7a')]('userVoiceQueue:remove',{'UserId':_0x518f37,'VoiceQueueId':_0x47fd16['id']});});});});});});})[_0x49c7('0x28')](respondWithStatusCode(_0x3282d,null))['catch'](handleError(_0x3282d,null));};exports[_0x49c7('0x91')]=function(_0x3f6d53,_0x5448c4,_0x43b590){var _0x473ee0,_0x41cc00;return db[_0x49c7('0x4c')][_0x49c7('0x5d')]({'where':{'id':_0x3f6d53[_0x49c7('0x5c')]['id']}})[_0x49c7('0x28')](handleEntityNotFound(_0x5448c4,null))[_0x49c7('0x28')](function(_0x44e245){if(_0x44e245){_0x41cc00=_0x44e245;return _0x44e245['addAgents'](_0x3f6d53['body'][_0x49c7('0x7c')],_[_0x49c7('0x92')](_0x3f6d53[_0x49c7('0x55')],[_0x49c7('0x7c'),'id'])||{})[_0x49c7('0x93')](function(_0x230d10){for(var _0x76e069=0x0;_0x76e069<_0x3f6d53[_0x49c7('0x55')][_0x49c7('0x7c')]['length'];_0x76e069+=0x1){socket[_0x49c7('0x7a')](_0x49c7('0x94'),{'UserId':Number(_0x3f6d53[_0x49c7('0x55')]['ids'][_0x76e069]),'VoiceQueueId':Number(_0x3f6d53[_0x49c7('0x5c')]['id'])});}return _0x230d10;});}})[_0x49c7('0x28')](function(_0x323775){_0x473ee0=_0x323775||[];if(_0x41cc00){return db[_0x49c7('0x7d')]['findAll']({'where':{'id':_0x3f6d53['body'][_0x49c7('0x7c')]},'attributes':['id',_0x49c7('0x35'),_0x49c7('0x95'),_0x49c7('0x6c'),_0x49c7('0x6d')],'raw':!![]});}})[_0x49c7('0x28')](function(_0x506b87){if(!_[_0x49c7('0x96')](_0x506b87)){var _0x5f50e4=[];for(var _0x81f165=0x0;_0x81f165<_0x506b87[_0x49c7('0x43')];_0x81f165++){if(_0x506b87[_0x81f165][_0x49c7('0x95')]){_0x5f50e4[_0x49c7('0x87')](db[_0x49c7('0x78')]['upsert']({'membername':_0x506b87[_0x81f165]['name'],'UserId':_0x506b87[_0x81f165]['id'],'queue_name':_0x41cc00[_0x49c7('0x35')],'VoiceQueueId':_0x41cc00['id'],'interface':_[_0x49c7('0x79')](_0x506b87[_0x81f165][_0x49c7('0x6d')])?util['format'](_0x49c7('0x97'),_0x506b87[_0x81f165][_0x49c7('0x35')]):_0x506b87[_0x81f165][_0x49c7('0x6d')],'paused':_0x506b87[_0x81f165][_0x49c7('0x6c')]||![],'penalty':_0x3f6d53[_0x49c7('0x55')][_0x49c7('0x70')]||0x0}));}}return BPromise[_0x49c7('0x8d')](_0x5f50e4);}})[_0x49c7('0x28')](function(){return _0x473ee0;})[_0x49c7('0x28')](respondWithResult(_0x5448c4,null))['catch'](handleError(_0x5448c4,null));};exports['removeAgents']=function(_0x262bf8,_0x2b69f1,_0x57c1bb){return db['VoiceQueue'][_0x49c7('0x5d')]({'where':{'id':_0x262bf8[_0x49c7('0x5c')]['id']}})[_0x49c7('0x28')](handleEntityNotFound(_0x2b69f1,null))[_0x49c7('0x28')](function(_0x163b19){if(_0x163b19){return _0x163b19[_0x49c7('0x8f')](_0x262bf8[_0x49c7('0x3d')]['ids'])[_0x49c7('0x28')](function(){if(_[_0x49c7('0x98')](_0x262bf8['query'][_0x49c7('0x7c')])){for(var _0x3fde54=0x0;_0x3fde54<_0x262bf8['query'][_0x49c7('0x7c')]['length'];_0x3fde54+=0x1){socket[_0x49c7('0x7a')](_0x49c7('0x99'),{'UserId':Number(_0x262bf8[_0x49c7('0x3d')][_0x49c7('0x7c')][_0x3fde54]),'VoiceQueueId':Number(_0x262bf8[_0x49c7('0x5c')]['id'])});}}else{socket['emit']('userVoiceQueue:remove',{'UserId':Number(_0x262bf8[_0x49c7('0x3d')]['ids']),'VoiceQueueId':Number(_0x262bf8[_0x49c7('0x5c')]['id'])});}});}})[_0x49c7('0x28')](function(_0x4dbc8d){return db['UserVoiceQueueRt'][_0x49c7('0x29')]({'where':{'VoiceQueueId':_0x262bf8[_0x49c7('0x5c')]['id'],'UserId':_0x262bf8[_0x49c7('0x3d')][_0x49c7('0x7c')]}})[_0x49c7('0x28')](function(){return _0x4dbc8d;});})['then'](respondWithStatusCode(_0x2b69f1,null))['catch'](handleError(_0x2b69f1,null));};exports[_0x49c7('0x9a')]=function(_0x520975,_0x4b6d4b,_0x27879a){var _0x2f3d85={};var _0x69118b={};var _0x1eebcb;var _0x36ad0f;return db[_0x49c7('0x4c')][_0x49c7('0x5f')]({'where':{'id':_0x520975[_0x49c7('0x5c')]['id']}})[_0x49c7('0x28')](handleEntityNotFound(_0x4b6d4b,null))[_0x49c7('0x28')](function(_0x50c4e2){if(_0x50c4e2){_0x1eebcb=_0x50c4e2;_0x69118b[_0x49c7('0x3c')]=_[_0x49c7('0x3e')](db['User'][_0x49c7('0x53')]);_0x69118b[_0x49c7('0x3d')]=_[_0x49c7('0x3e')](_0x520975[_0x49c7('0x3d')]);_0x69118b['filters']=_[_0x49c7('0x40')](_0x69118b[_0x49c7('0x3c')],_0x69118b[_0x49c7('0x3d')]);_0x2f3d85[_0x49c7('0x41')]=_[_0x49c7('0x40')](_0x69118b['model'],qs[_0x49c7('0x42')](_0x520975['query'][_0x49c7('0x42')]));_0x2f3d85[_0x49c7('0x41')]=_0x2f3d85[_0x49c7('0x41')][_0x49c7('0x43')]?_0x2f3d85['attributes']:_0x69118b[_0x49c7('0x3c')];_0x2f3d85[_0x49c7('0x45')]=qs[_0x49c7('0x46')](_0x520975[_0x49c7('0x3d')][_0x49c7('0x46')]);_0x2f3d85[_0x49c7('0x4b')]=qs[_0x49c7('0x3f')](_[_0x49c7('0x47')](_0x520975[_0x49c7('0x3d')],_0x69118b[_0x49c7('0x3f')]));if(_0x520975[_0x49c7('0x3d')][_0x49c7('0x2f')]){_0x2f3d85[_0x49c7('0x4b')]=_[_0x49c7('0x48')](_0x2f3d85[_0x49c7('0x4b')],{'$or':_[_0x49c7('0x31')](_0x2f3d85[_0x49c7('0x41')],function(_0x388df4){var _0x21a425={};_0x21a425[_0x388df4]={'$like':'%'+_0x520975[_0x49c7('0x3d')][_0x49c7('0x2f')]+'%'};return _0x21a425;})});}_0x2f3d85=_[_0x49c7('0x48')]({},_0x2f3d85,_0x520975['options']);return _0x1eebcb[_0x49c7('0x9a')](_0x2f3d85);}})[_0x49c7('0x28')](function(_0x1e0112){if(_0x1e0112){_0x36ad0f=_0x1e0112[_0x49c7('0x43')];if(!_0x520975[_0x49c7('0x3d')][_0x49c7('0x44')](_0x49c7('0x60'))){_0x2f3d85[_0x49c7('0x22')]=qs['limit'](_0x520975[_0x49c7('0x3d')]['limit']);_0x2f3d85[_0x49c7('0x1f')]=qs[_0x49c7('0x1f')](_0x520975[_0x49c7('0x3d')][_0x49c7('0x1f')]);}return _0x1eebcb[_0x49c7('0x9a')](_0x2f3d85);}})['then'](function(_0x492657){if(_0x492657){return _0x492657?{'count':_0x36ad0f,'rows':_0x492657}:null;}})[_0x49c7('0x28')](respondWithResult(_0x4b6d4b,null))['catch'](handleError(_0x4b6d4b,null));};exports[_0x49c7('0x9b')]=function(_0x2af302,_0x40ce41,_0xee7bef){var _0x3ad329={};var _0x1085ff={};var _0xef0321;var _0x5bae62;return db[_0x49c7('0x4c')][_0x49c7('0x5f')]({'where':{'id':_0x2af302['params']['id']}})['then'](handleEntityNotFound(_0x40ce41,null))[_0x49c7('0x28')](function(_0x5c813d){if(_0x5c813d){_0xef0321=_0x5c813d;_0x1085ff['model']=_[_0x49c7('0x3e')](db[_0x49c7('0x78')][_0x49c7('0x53')]);_0x1085ff['query']=_[_0x49c7('0x3e')](_0x2af302[_0x49c7('0x3d')]);_0x1085ff[_0x49c7('0x3f')]=_['intersection'](_0x1085ff['model'],_0x1085ff[_0x49c7('0x3d')]);_0x3ad329[_0x49c7('0x41')]=_[_0x49c7('0x40')](_0x1085ff['model'],qs[_0x49c7('0x42')](_0x2af302[_0x49c7('0x3d')][_0x49c7('0x42')]));_0x3ad329[_0x49c7('0x41')]=_0x3ad329[_0x49c7('0x41')][_0x49c7('0x43')]?_0x3ad329[_0x49c7('0x41')]:_0x1085ff['model'];_0x3ad329[_0x49c7('0x45')]=qs[_0x49c7('0x46')](_0x2af302[_0x49c7('0x3d')][_0x49c7('0x46')]);_0x3ad329[_0x49c7('0x4b')]=qs['filters'](_[_0x49c7('0x47')](_0x2af302[_0x49c7('0x3d')],_0x1085ff[_0x49c7('0x3f')]));if(_0x2af302[_0x49c7('0x3d')][_0x49c7('0x2f')]){_0x3ad329[_0x49c7('0x4b')]=_[_0x49c7('0x48')](_0x3ad329[_0x49c7('0x4b')],{'$or':_['map'](_0x3ad329[_0x49c7('0x41')],function(_0xadf684){var _0x3c597a={};_0x3c597a[_0xadf684]={'$like':'%'+_0x2af302[_0x49c7('0x3d')][_0x49c7('0x2f')]+'%'};return _0x3c597a;})});}_0x3ad329=_[_0x49c7('0x48')]({},_0x3ad329,_0x2af302[_0x49c7('0x4a')]);return _0xef0321[_0x49c7('0x9b')](_0x3ad329);}})[_0x49c7('0x28')](function(_0x1b4887){if(_0x1b4887){_0x5bae62=_0x1b4887[_0x49c7('0x43')];if(!_0x2af302[_0x49c7('0x3d')][_0x49c7('0x44')]('nolimit')){_0x3ad329[_0x49c7('0x22')]=qs[_0x49c7('0x22')](_0x2af302[_0x49c7('0x3d')]['limit']);_0x3ad329[_0x49c7('0x1f')]=qs['offset'](_0x2af302[_0x49c7('0x3d')][_0x49c7('0x1f')]);}return _0xef0321[_0x49c7('0x9b')](_0x3ad329);}})[_0x49c7('0x28')](function(_0x50e9db){return _0x50e9db?{'count':_0x5bae62,'rows':_0x50e9db}:null;})['then'](respondWithResult(_0x40ce41,null))[_0x49c7('0x51')](handleError(_0x40ce41,null));};exports[_0x49c7('0x9c')]=function(_0x5f5882,_0x36c27b,_0xb030f6){var _0x1a5bd5={};var _0x5cd97f={};var _0x4fbb95;var _0x1a4f95;return db[_0x49c7('0x4c')][_0x49c7('0x5f')]({'where':{'id':_0x5f5882[_0x49c7('0x5c')]['id']}})[_0x49c7('0x28')](handleEntityNotFound(_0x36c27b,null))[_0x49c7('0x28')](function(_0x12a198){if(_0x12a198){_0x4fbb95=_0x12a198;_0x5cd97f['model']=_[_0x49c7('0x3e')](db[_0x49c7('0x9d')]['rawAttributes']);_0x5cd97f['query']=_[_0x49c7('0x3e')](_0x5f5882[_0x49c7('0x3d')]);_0x5cd97f['filters']=_[_0x49c7('0x40')](_0x5cd97f[_0x49c7('0x3c')],_0x5cd97f[_0x49c7('0x3d')]);_0x1a5bd5[_0x49c7('0x41')]=_['intersection'](_0x5cd97f['model'],qs[_0x49c7('0x42')](_0x5f5882[_0x49c7('0x3d')][_0x49c7('0x42')]));_0x1a5bd5[_0x49c7('0x41')]=_0x1a5bd5[_0x49c7('0x41')][_0x49c7('0x43')]?_0x1a5bd5[_0x49c7('0x41')]:_0x5cd97f[_0x49c7('0x3c')];_0x1a5bd5[_0x49c7('0x45')]=qs[_0x49c7('0x46')](_0x5f5882[_0x49c7('0x3d')][_0x49c7('0x46')]);_0x1a5bd5[_0x49c7('0x4b')]=qs[_0x49c7('0x3f')](_['pick'](_0x5f5882[_0x49c7('0x3d')],_0x5cd97f[_0x49c7('0x3f')]));if(_0x5f5882['query'][_0x49c7('0x2f')]){_0x1a5bd5[_0x49c7('0x4b')]=_['merge'](_0x1a5bd5[_0x49c7('0x4b')],{'$or':_[_0x49c7('0x31')](_0x1a5bd5['attributes'],function(_0x562c06){var _0x5923a9={};_0x5923a9[_0x562c06]={'$like':'%'+_0x5f5882[_0x49c7('0x3d')][_0x49c7('0x2f')]+'%'};return _0x5923a9;})});}_0x1a5bd5=_[_0x49c7('0x48')]({},_0x1a5bd5,_0x5f5882[_0x49c7('0x4a')]);return _0x4fbb95[_0x49c7('0x9c')](_0x1a5bd5);}})['then'](function(_0x746fa5){if(_0x746fa5){_0x1a4f95=_0x746fa5[_0x49c7('0x43')];if(!_0x5f5882[_0x49c7('0x3d')][_0x49c7('0x44')]('nolimit')){_0x1a5bd5[_0x49c7('0x22')]=qs[_0x49c7('0x22')](_0x5f5882[_0x49c7('0x3d')][_0x49c7('0x22')]);_0x1a5bd5[_0x49c7('0x1f')]=qs[_0x49c7('0x1f')](_0x5f5882[_0x49c7('0x3d')][_0x49c7('0x1f')]);}return _0x4fbb95[_0x49c7('0x9c')](_0x1a5bd5);}})[_0x49c7('0x28')](function(_0x5cd0c1){if(_0x5cd0c1){return _0x5cd0c1?{'count':_0x1a4f95,'rows':_0x5cd0c1}:null;}})['then'](respondWithResult(_0x36c27b,null))[_0x49c7('0x51')](handleError(_0x36c27b,null));};exports[_0x49c7('0x9e')]=function(_0x3a165e,_0x53331a,_0x51e9f1){var _0x527d40,_0x924aab;return db[_0x49c7('0x4c')][_0x49c7('0x5d')]({'where':{'id':_0x3a165e[_0x49c7('0x5c')]['id']}})[_0x49c7('0x28')](handleEntityNotFound(_0x53331a,null))[_0x49c7('0x28')](function(_0x1b213b){if(_0x1b213b){_0x924aab=_0x1b213b;return _0x1b213b['addLists'](_0x3a165e[_0x49c7('0x55')][_0x49c7('0x7c')],_[_0x49c7('0x92')](_0x3a165e[_0x49c7('0x55')],[_0x49c7('0x7c'),'id'])||{});}return null;})[_0x49c7('0x93')](function(_0x56decb){var _0x4f9b65;_0x527d40=_0x56decb||[];var _0xa29122=[];if(_0x56decb){for(var _0x3f0cef=0x0;_0x3f0cef<_0x56decb[_0x49c7('0x43')];_0x3f0cef+=0x1){var _0x5df559=_0x56decb[_0x3f0cef][_0x49c7('0x2a')]({'plain':!![]});_0x924aab[_0x49c7('0x9f')]=_0x3a165e[_0x49c7('0x55')][_0x49c7('0x9f')]?_0x3a165e[_0x49c7('0x55')][_0x49c7('0x9f')]:_0x924aab[_0x49c7('0x9f')];switch(_0x924aab[_0x49c7('0x9f')]){case _0x49c7('0xa0'):_0x4f9b65=squel[_0x49c7('0xa1')]()[_0x49c7('0xa2')](_0x49c7('0xa3'))[_0x49c7('0xa4')]([_0x49c7('0xa5'),_0x49c7('0xa6'),'ContactId',_0x49c7('0xa7'),'VoiceQueueId',_0x49c7('0x5e'),_0x49c7('0xa8')],squel[_0x49c7('0x7e')]()[_0x49c7('0x7f')]('phone',_0x49c7('0xa5'))[_0x49c7('0x7f')](_0x49c7('0xa9'),'scheduledAt')[_0x49c7('0x7f')]('id','ContactId')[_0x49c7('0x7f')](_0x5df559[_0x49c7('0xaa')][_0x49c7('0x88')](),_0x49c7('0xa7'))[_0x49c7('0x7f')](_0x3a165e[_0x49c7('0x5c')]['id'][_0x49c7('0x88')](),_0x49c7('0x61'))[_0x49c7('0x7f')]('NOW()',_0x49c7('0x5e'))[_0x49c7('0x7f')]('NOW()','updatedAt')[_0x49c7('0x80')](_0x49c7('0xab'))[_0x49c7('0x4b')](_0x49c7('0xac'))['where'](_0x49c7('0xad'),_0x5df559[_0x49c7('0xaa')][_0x49c7('0x88')]())[_0x49c7('0x4b')](_0x49c7('0xae'))[_0x49c7('0x4b')]('phone\x20NOT\x20IN\x20(?)',squel['select']()['field'](_0x49c7('0xaf'))[_0x49c7('0x80')](_0x49c7('0xb0'))[_0x49c7('0x4b')](_0x49c7('0x85'),_0x3a165e['params']['id'][_0x49c7('0x88')]()))[_0x49c7('0x4b')](_0x49c7('0xb1'),squel[_0x49c7('0x7e')]()[_0x49c7('0x7f')](_0x49c7('0xb2'))['from'](_0x49c7('0xa3'))[_0x49c7('0x4b')](_0x49c7('0x85'),_0x3a165e[_0x49c7('0x5c')]['id']['toString']())))['toString']();break;case'onlyIfOpen':_0x4f9b65=squel[_0x49c7('0xa1')]()['into'](_0x49c7('0xa3'))['fromQuery']([_0x49c7('0xa5'),_0x49c7('0xa6'),_0x49c7('0xb3'),_0x49c7('0xa7'),_0x49c7('0x61'),_0x49c7('0x5e'),_0x49c7('0xa8')],squel[_0x49c7('0x7e')]()[_0x49c7('0x7f')](_0x49c7('0xa5'),_0x49c7('0xa5'))[_0x49c7('0x7f')]('NOW()',_0x49c7('0xa6'))[_0x49c7('0x7f')]('id','ContactId')[_0x49c7('0x7f')](_0x5df559[_0x49c7('0xaa')][_0x49c7('0x88')](),'ListId')[_0x49c7('0x7f')](_0x3a165e[_0x49c7('0x5c')]['id'][_0x49c7('0x88')](),_0x49c7('0x61'))['field']('NOW()',_0x49c7('0x5e'))[_0x49c7('0x7f')]('NOW()',_0x49c7('0xa8'))['from'](_0x49c7('0xab'))['where']('deletedAt\x20IS\x20NULL')[_0x49c7('0x4b')](_0x49c7('0xad'),_0x5df559['CmListId'][_0x49c7('0x88')]())['where'](_0x49c7('0xae'))[_0x49c7('0x4b')](_0x49c7('0xb1'),squel[_0x49c7('0x7e')]()[_0x49c7('0x7f')](_0x49c7('0xb2'))[_0x49c7('0x80')](_0x49c7('0xa3'))[_0x49c7('0x4b')]('VoiceQueueId\x20=\x20?',_0x3a165e['params']['id'][_0x49c7('0x88')]())))[_0x49c7('0x88')]();break;default:_0x4f9b65=squel['insert']()[_0x49c7('0xa2')](_0x49c7('0xa3'))[_0x49c7('0xa4')]([_0x49c7('0xa5'),_0x49c7('0xa6'),_0x49c7('0xb3'),'ListId',_0x49c7('0x61'),_0x49c7('0x5e'),_0x49c7('0xa8')],squel[_0x49c7('0x7e')]()[_0x49c7('0x7f')](_0x49c7('0xa5'),_0x49c7('0xa5'))[_0x49c7('0x7f')](_0x49c7('0xa9'),'scheduledAt')['field']('id',_0x49c7('0xb3'))[_0x49c7('0x7f')](_0x5df559[_0x49c7('0xaa')][_0x49c7('0x88')](),'ListId')[_0x49c7('0x7f')](_0x3a165e['params']['id'][_0x49c7('0x88')](),'VoiceQueueId')[_0x49c7('0x7f')](_0x49c7('0xa9'),_0x49c7('0x5e'))[_0x49c7('0x7f')]('NOW()',_0x49c7('0xa8'))[_0x49c7('0x80')](_0x49c7('0xab'))[_0x49c7('0x4b')](_0x49c7('0xac'))[_0x49c7('0x4b')](_0x49c7('0xad'),_0x5df559[_0x49c7('0xaa')][_0x49c7('0x88')]())[_0x49c7('0x4b')](_0x49c7('0xae')))[_0x49c7('0x88')]();}_0xa29122[_0x49c7('0x87')](db['sequelize'][_0x49c7('0x3d')](_0x4f9b65));}return BPromise[_0x49c7('0x8d')](_0xa29122);}})['then'](function(){return _0x527d40;})['then'](respondWithResult(_0x53331a,null))[_0x49c7('0x51')](handleError(_0x53331a,null));};exports['removeLists']=function(_0x5a4a35,_0x804b0a,_0xd2cef4){return db[_0x49c7('0x4c')][_0x49c7('0x5d')]({'where':{'id':_0x5a4a35[_0x49c7('0x5c')]['id']}})['then'](handleEntityNotFound(_0x804b0a,null))[_0x49c7('0x28')](function(_0x1f6e85){if(_0x1f6e85){return _0x1f6e85[_0x49c7('0xb4')](_0x5a4a35[_0x49c7('0x3d')][_0x49c7('0x7c')]);}})[_0x49c7('0x28')](function(_0x2213a6){if(_0x2213a6){return db['CmHopper'][_0x49c7('0x29')]({'where':{'ListId':_0x5a4a35[_0x49c7('0x3d')][_0x49c7('0x7c')],'VoiceQueueId':_0x5a4a35['params']['id']}})[_0x49c7('0x28')](function(){return _0x2213a6;});}})[_0x49c7('0x28')](respondWithStatusCode(_0x804b0a,null))[_0x49c7('0x51')](handleError(_0x804b0a,null));};exports['getBlackLists']=function(_0x3844e4,_0x269933,_0x5c5145){var _0x1115bb={};var _0x37d2c9={};var _0x17574e;var _0x313d97;return db[_0x49c7('0x4c')][_0x49c7('0x5f')]({'where':{'id':_0x3844e4[_0x49c7('0x5c')]['id']}})['then'](handleEntityNotFound(_0x269933,null))[_0x49c7('0x28')](function(_0x2360b6){if(_0x2360b6){_0x17574e=_0x2360b6;_0x37d2c9['model']=_[_0x49c7('0x3e')](db[_0x49c7('0x9d')][_0x49c7('0x53')]);_0x37d2c9[_0x49c7('0x3d')]=_[_0x49c7('0x3e')](_0x3844e4[_0x49c7('0x3d')]);_0x37d2c9['filters']=_[_0x49c7('0x40')](_0x37d2c9[_0x49c7('0x3c')],_0x37d2c9[_0x49c7('0x3d')]);_0x1115bb[_0x49c7('0x41')]=_[_0x49c7('0x40')](_0x37d2c9['model'],qs[_0x49c7('0x42')](_0x3844e4[_0x49c7('0x3d')][_0x49c7('0x42')]));_0x1115bb[_0x49c7('0x41')]=_0x1115bb[_0x49c7('0x41')][_0x49c7('0x43')]?_0x1115bb[_0x49c7('0x41')]:_0x37d2c9[_0x49c7('0x3c')];_0x1115bb[_0x49c7('0x45')]=qs[_0x49c7('0x46')](_0x3844e4[_0x49c7('0x3d')]['sort']);_0x1115bb[_0x49c7('0x4b')]=qs['filters'](_[_0x49c7('0x47')](_0x3844e4['query'],_0x37d2c9[_0x49c7('0x3f')]));if(_0x3844e4[_0x49c7('0x3d')][_0x49c7('0x2f')]){_0x1115bb[_0x49c7('0x4b')]=_['merge'](_0x1115bb[_0x49c7('0x4b')],{'$or':_[_0x49c7('0x31')](_0x1115bb[_0x49c7('0x41')],function(_0x575ead){var _0x5c3376={};_0x5c3376[_0x575ead]={'$like':'%'+_0x3844e4['query'][_0x49c7('0x2f')]+'%'};return _0x5c3376;})});}_0x1115bb=_[_0x49c7('0x48')]({},_0x1115bb,_0x3844e4[_0x49c7('0x4a')]);return _0x17574e['getBlackLists'](_0x1115bb);}})[_0x49c7('0x28')](function(_0x3b5bc2){if(_0x3b5bc2){_0x313d97=_0x3b5bc2[_0x49c7('0x43')];if(!_0x3844e4[_0x49c7('0x3d')][_0x49c7('0x44')](_0x49c7('0x60'))){_0x1115bb[_0x49c7('0x22')]=qs[_0x49c7('0x22')](_0x3844e4['query']['limit']);_0x1115bb[_0x49c7('0x1f')]=qs[_0x49c7('0x1f')](_0x3844e4['query'][_0x49c7('0x1f')]);}return _0x17574e[_0x49c7('0xb5')](_0x1115bb);}})[_0x49c7('0x28')](function(_0x502bae){if(_0x502bae){return _0x502bae?{'count':_0x313d97,'rows':_0x502bae}:null;}})[_0x49c7('0x28')](respondWithResult(_0x269933,null))[_0x49c7('0x51')](handleError(_0x269933,null));};exports[_0x49c7('0xb6')]=function(_0x28aafd,_0x48304d,_0x56766e){var _0x53351f,_0x3a3540;return db['VoiceQueue']['find']({'where':{'id':_0x28aafd[_0x49c7('0x5c')]['id']}})[_0x49c7('0x28')](handleEntityNotFound(_0x48304d,null))[_0x49c7('0x28')](function(_0xf3eab4){if(_0xf3eab4){_0x3a3540=_0xf3eab4;return _0xf3eab4[_0x49c7('0xb6')](_0x28aafd[_0x49c7('0x55')][_0x49c7('0x7c')],_[_0x49c7('0x92')](_0x28aafd[_0x49c7('0x55')],[_0x49c7('0x7c'),'id'])||{});}return null;})[_0x49c7('0x93')](function(_0x35c1af){var _0x36f336;_0x53351f=_0x35c1af||[];var _0x20b2d0=[];if(_0x35c1af){for(var _0x5e723e=0x0;_0x5e723e<_0x35c1af[_0x49c7('0x43')];_0x5e723e+=0x1){var _0x51fd4e=_0x35c1af[_0x5e723e][_0x49c7('0x2a')]({'plain':!![]});_0x36f336=squel[_0x49c7('0xa1')]()[_0x49c7('0xa2')]('cm_hopper_black')['fromQuery']([_0x49c7('0xa5'),_0x49c7('0xb3'),_0x49c7('0xa7'),_0x49c7('0x61'),'createdAt',_0x49c7('0xa8')],squel['select']()[_0x49c7('0x7f')](_0x49c7('0xa5'),_0x49c7('0xa5'))[_0x49c7('0x7f')]('id',_0x49c7('0xb3'))[_0x49c7('0x7f')](_0x51fd4e['CmListId'][_0x49c7('0x88')](),_0x49c7('0xa7'))[_0x49c7('0x7f')](_0x28aafd['params']['id'][_0x49c7('0x88')](),_0x49c7('0x61'))[_0x49c7('0x7f')](_0x49c7('0xa9'),_0x49c7('0x5e'))['field'](_0x49c7('0xa9'),_0x49c7('0xa8'))[_0x49c7('0x80')](_0x49c7('0xab'))[_0x49c7('0x4b')](_0x49c7('0xac'))[_0x49c7('0x4b')](_0x49c7('0xad'),_0x51fd4e[_0x49c7('0xaa')]['toString']())[_0x49c7('0x4b')]('phone\x20IS\x20NOT\x20NULL'))[_0x49c7('0x88')]();_0x20b2d0[_0x49c7('0x87')](db['sequelize']['query'](_0x36f336));}return BPromise['all'](_0x20b2d0);}})[_0x49c7('0x28')](function(){return _0x53351f;})[_0x49c7('0x28')](respondWithResult(_0x48304d,null))[_0x49c7('0x51')](handleError(_0x48304d,null));};exports[_0x49c7('0xb7')]=function(_0x20a891,_0x46de12,_0x2e8339){return db['VoiceQueue'][_0x49c7('0x5d')]({'where':{'id':_0x20a891[_0x49c7('0x5c')]['id']}})[_0x49c7('0x28')](handleEntityNotFound(_0x46de12,null))['then'](function(_0x3481dd){if(_0x3481dd){return _0x3481dd[_0x49c7('0xb7')](_0x20a891['query'][_0x49c7('0x7c')]);}})[_0x49c7('0x28')](function(_0x12f1f4){if(_0x12f1f4){return db[_0x49c7('0x67')]['destroy']({'where':{'ListId':_0x20a891[_0x49c7('0x3d')][_0x49c7('0x7c')],'VoiceQueueId':_0x20a891[_0x49c7('0x5c')]['id']}})[_0x49c7('0x28')](function(){return _0x12f1f4;});}})[_0x49c7('0x28')](respondWithStatusCode(_0x46de12,null))[_0x49c7('0x51')](handleError(_0x46de12,null));}; \ No newline at end of file +var _0x97dc=['length','model','hasOwnProperty','sort','where','pick','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','inbound','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','getHoppers','findOne','nolimit','order','VoiceQueueId','CmHopper','getHopperHistories','CmHopperHistory','findAll','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','Team','teams','Agents','voicePause','interface','flatMap','forEach','penalty','sequelize','transaction','addTeams','each','TeamVoiceQueue','upsert','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','isNil','format','SIP/%s','emit','removeTeams','ids','User','select','tq.TeamId','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','push','QueryTypes','SELECT','compact','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','spread','userVoiceQueue:save','online','isArray','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','field','NOW()','ListId','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','toString','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','onlyIfOpen','COALESCE(phone,\x27\x27)','all','removeLists','getBlackLists','addBlackLists','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','./voiceQueue.socket','register','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','reject','save','update','then','destroy','VoiceQueues','QueueCampaigns','outbound','filter','ignore','map','value','includes','type','find','name','UserProfileResource','error','send','index','VoiceQueue','rawAttributes','fieldName','key','query','keys','filters','intersection','attributes','fields'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x97dc,0x76));var _0xc97d=function(_0x355488,_0x55d26a){_0x355488=_0x355488-0x0;var _0x4eaf2e=_0x97dc[_0x355488];return _0x4eaf2e;};'use strict';var emlformat=require(_0xc97d('0x0'));var rimraf=require(_0xc97d('0x1'));var zipdir=require(_0xc97d('0x2'));var jsonpatch=require(_0xc97d('0x3'));var rp=require(_0xc97d('0x4'));var moment=require(_0xc97d('0x5'));var BPromise=require(_0xc97d('0x6'));var Mustache=require(_0xc97d('0x7'));var util=require(_0xc97d('0x8'));var path=require(_0xc97d('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc97d('0xa'));var _=require(_0xc97d('0xb'));var squel=require(_0xc97d('0xc'));var crypto=require(_0xc97d('0xd'));var jsforce=require(_0xc97d('0xe'));var deskjs=require(_0xc97d('0xf'));var toCsv=require(_0xc97d('0x10'));var querystring=require('querystring');var Papa=require(_0xc97d('0x11'));var Redis=require(_0xc97d('0x12'));var authService=require(_0xc97d('0x13'));var qs=require(_0xc97d('0x14'));var as=require(_0xc97d('0x15'));var hardwareService=require(_0xc97d('0x16'));var logger=require(_0xc97d('0x17'))(_0xc97d('0x18'));var utils=require(_0xc97d('0x19'));var config=require(_0xc97d('0x1a'));var licenseUtil=require(_0xc97d('0x1b'));var db=require('../../mysqldb')['db'];config[_0xc97d('0x1c')]=_[_0xc97d('0x1d')](config[_0xc97d('0x1c')],{'host':_0xc97d('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xc97d('0x1f'))[_0xc97d('0x20')](socket);function respondWithStatusCode(_0x5bd47a,_0x5692d9){_0x5692d9=_0x5692d9||0xcc;return function(_0xb2c3fd){if(_0xb2c3fd){return _0x5bd47a[_0xc97d('0x21')](_0x5692d9);}return _0x5bd47a['status'](_0x5692d9)[_0xc97d('0x22')]();};}function respondWithResult(_0x5573d0,_0x11d217){_0x11d217=_0x11d217||0xc8;return function(_0x394c77){if(_0x394c77){return _0x5573d0[_0xc97d('0x23')](_0x11d217)[_0xc97d('0x24')](_0x394c77);}};}function respondWithFilteredResult(_0x361faa,_0x38f106){return function(_0x274e6d){if(_0x274e6d){var _0x1448f0=typeof _0x38f106[_0xc97d('0x25')]===_0xc97d('0x26')&&typeof _0x38f106['limit']===_0xc97d('0x26');var _0x46fbc7=_0x274e6d[_0xc97d('0x27')];var _0x32d52f=_0x1448f0?0x0:_0x38f106[_0xc97d('0x25')];var _0x5a4a27=_0x1448f0?_0x274e6d[_0xc97d('0x27')]:_0x38f106['offset']+_0x38f106[_0xc97d('0x28')];var _0x35d961;if(_0x5a4a27>=_0x46fbc7){_0x5a4a27=_0x46fbc7;_0x35d961=0xc8;}else{_0x35d961=0xce;}_0x361faa[_0xc97d('0x23')](_0x35d961);return _0x361faa['set'](_0xc97d('0x29'),_0x32d52f+'-'+_0x5a4a27+'/'+_0x46fbc7)[_0xc97d('0x24')](_0x274e6d);}return null;};}function patchUpdates(_0xf70ff3){return function(_0x25927e){try{jsonpatch['apply'](_0x25927e,_0xf70ff3,!![]);}catch(_0x5995b7){return BPromise[_0xc97d('0x2a')](_0x5995b7);}return _0x25927e[_0xc97d('0x2b')]();};}function saveUpdates(_0x33297e,_0x2df7dc){return function(_0x4cdd7b){if(_0x4cdd7b){return _0x4cdd7b[_0xc97d('0x2c')](_0x33297e)[_0xc97d('0x2d')](function(_0x1a3e2e){return _0x1a3e2e;});}return null;};}function removeEntity(_0x5ae5bb,_0x3f15ba){return function(_0xf4a061){if(_0xf4a061){return _0xf4a061[_0xc97d('0x2e')]()['then'](function(){var _0x4bcd88=_0xf4a061['get']({'plain':!![]});var _0x44b7de=[{'name':_0xc97d('0x2f'),'value':'inbound','ignore':![]},{'name':_0xc97d('0x30'),'value':_0xc97d('0x31'),'ignore':![]}];var _0x5cf705=_(_0x44b7de)[_0xc97d('0x32')](_0xc97d('0x33'))[_0xc97d('0x34')]('value')[_0xc97d('0x35')]();if(_[_0xc97d('0x36')](_0x5cf705,_0x4bcd88[_0xc97d('0x37')])){return;}var _0x4b81a9=_[_0xc97d('0x38')](_0x44b7de,[_0xc97d('0x35'),_0x4bcd88[_0xc97d('0x37')]])[_0xc97d('0x39')];return db[_0xc97d('0x3a')]['destroy']({'where':{'type':_0x4b81a9,'resourceId':_0x4bcd88['id']}})[_0xc97d('0x2d')](function(){return _0xf4a061;});})[_0xc97d('0x2d')](function(){_0x5ae5bb[_0xc97d('0x23')](0xcc)[_0xc97d('0x22')]();});}};}function handleEntityNotFound(_0x5740fc,_0x1c6531){return function(_0x588cd4){if(!_0x588cd4){_0x5740fc[_0xc97d('0x21')](0x194);}return _0x588cd4;};}function handleError(_0x460ef8,_0x1a5e2d){_0x1a5e2d=_0x1a5e2d||0x1f4;return function(_0xfc7c44){logger[_0xc97d('0x3b')](_0xfc7c44['stack']);if(_0xfc7c44[_0xc97d('0x39')]){delete _0xfc7c44[_0xc97d('0x39')];}_0x460ef8[_0xc97d('0x23')](_0x1a5e2d)[_0xc97d('0x3c')](_0xfc7c44);};}exports[_0xc97d('0x3d')]=function(_0x6f868b,_0x4a9dea){var _0x5a5916={},_0x3ed0d0={},_0x5831d9={'count':0x0,'rows':[]};var _0x2b4a5c=_[_0xc97d('0x34')](db[_0xc97d('0x3e')][_0xc97d('0x3f')],function(_0x23d903){return{'name':_0x23d903[_0xc97d('0x40')],'type':_0x23d903[_0xc97d('0x37')][_0xc97d('0x41')]};});_0x3ed0d0['model']=_['map'](_0x2b4a5c,_0xc97d('0x39'));_0x3ed0d0[_0xc97d('0x42')]=_[_0xc97d('0x43')](_0x6f868b[_0xc97d('0x42')]);_0x3ed0d0[_0xc97d('0x44')]=_[_0xc97d('0x45')](_0x3ed0d0['model'],_0x3ed0d0[_0xc97d('0x42')]);_0x5a5916[_0xc97d('0x46')]=_[_0xc97d('0x45')](_0x3ed0d0['model'],qs['fields'](_0x6f868b[_0xc97d('0x42')][_0xc97d('0x47')]));_0x5a5916['attributes']=_0x5a5916['attributes'][_0xc97d('0x48')]?_0x5a5916[_0xc97d('0x46')]:_0x3ed0d0[_0xc97d('0x49')];if(!_0x6f868b[_0xc97d('0x42')][_0xc97d('0x4a')]('nolimit')){_0x5a5916[_0xc97d('0x28')]=qs[_0xc97d('0x28')](_0x6f868b[_0xc97d('0x42')][_0xc97d('0x28')]);_0x5a5916[_0xc97d('0x25')]=qs[_0xc97d('0x25')](_0x6f868b[_0xc97d('0x42')][_0xc97d('0x25')]);}_0x5a5916['order']=qs[_0xc97d('0x4b')](_0x6f868b[_0xc97d('0x42')][_0xc97d('0x4b')]);_0x5a5916[_0xc97d('0x4c')]=qs[_0xc97d('0x44')](_[_0xc97d('0x4d')](_0x6f868b[_0xc97d('0x42')],_0x3ed0d0[_0xc97d('0x44')]),_0x2b4a5c);if(_0x6f868b[_0xc97d('0x42')][_0xc97d('0x32')]){_0x5a5916[_0xc97d('0x4c')]=_[_0xc97d('0x4e')](_0x5a5916['where'],{'$or':_['map'](_0x2b4a5c,function(_0x374847){if(_0x374847[_0xc97d('0x37')]!==_0xc97d('0x4f')){var _0x4f05f2={};_0x4f05f2[_0x374847['name']]={'$like':'%'+_0x6f868b[_0xc97d('0x42')][_0xc97d('0x32')]+'%'};return _0x4f05f2;}})});}_0x5a5916=_['merge']({},_0x5a5916,_0x6f868b[_0xc97d('0x50')]);var _0x52204c={'where':_0x5a5916[_0xc97d('0x4c')]};return db[_0xc97d('0x3e')][_0xc97d('0x27')](_0x52204c)['then'](function(_0x2f5aa4){_0x5831d9['count']=_0x2f5aa4;if(_0x6f868b[_0xc97d('0x42')][_0xc97d('0x51')]){_0x5a5916[_0xc97d('0x52')]=[{'all':!![]}];}return db[_0xc97d('0x3e')]['findAll'](_0x5a5916);})[_0xc97d('0x2d')](function(_0x576642){_0x5831d9[_0xc97d('0x53')]=_0x576642;return _0x5831d9;})[_0xc97d('0x2d')](respondWithFilteredResult(_0x4a9dea,_0x5a5916))[_0xc97d('0x54')](handleError(_0x4a9dea,null));};exports[_0xc97d('0x55')]=function(_0x3ba64a,_0x11bab7){var _0x3601b0={'raw':![],'where':{'id':_0x3ba64a[_0xc97d('0x56')]['id']}},_0x4db533={};_0x4db533[_0xc97d('0x49')]=_[_0xc97d('0x43')](db[_0xc97d('0x3e')]['rawAttributes']);_0x4db533['query']=_[_0xc97d('0x43')](_0x3ba64a[_0xc97d('0x42')]);_0x4db533['filters']=_[_0xc97d('0x45')](_0x4db533[_0xc97d('0x49')],_0x4db533[_0xc97d('0x42')]);_0x3601b0[_0xc97d('0x46')]=_['intersection'](_0x4db533['model'],qs[_0xc97d('0x47')](_0x3ba64a[_0xc97d('0x42')][_0xc97d('0x47')]));_0x3601b0[_0xc97d('0x46')]=_0x3601b0[_0xc97d('0x46')][_0xc97d('0x48')]?_0x3601b0[_0xc97d('0x46')]:_0x4db533[_0xc97d('0x49')];if(_0x3ba64a[_0xc97d('0x42')][_0xc97d('0x51')]){_0x3601b0['include']=[{'all':!![]}];}_0x3601b0=_[_0xc97d('0x4e')]({},_0x3601b0,_0x3ba64a[_0xc97d('0x50')]);return db[_0xc97d('0x3e')][_0xc97d('0x38')](_0x3601b0)[_0xc97d('0x2d')](handleEntityNotFound(_0x11bab7,null))['then'](respondWithResult(_0x11bab7,null))[_0xc97d('0x54')](handleError(_0x11bab7,null));};exports[_0xc97d('0x57')]=function(_0x850587,_0x371b6b){return db[_0xc97d('0x3e')]['create'](_0x850587[_0xc97d('0x58')],{})[_0xc97d('0x2d')](function(_0xff52ba){var _0x13473b=_0x850587[_0xc97d('0x59')]['get']({'plain':!![]});if(!_0x13473b)throw new Error(_0xc97d('0x5a'));if(_0x13473b[_0xc97d('0x5b')]==='user'){var _0xf5936a=_0xff52ba[_0xc97d('0x5c')]({'plain':!![]});var _0x10a847=[{'name':'VoiceQueues','value':_0xc97d('0x5d')},{'name':_0xc97d('0x30'),'value':_0xc97d('0x31')}];var _0x3c42eb=_['find'](_0x10a847,['value',_0xf5936a[_0xc97d('0x37')]])[_0xc97d('0x39')];return db[_0xc97d('0x5e')][_0xc97d('0x38')]({'where':{'name':_0x3c42eb,'userProfileId':_0x13473b[_0xc97d('0x5f')]},'raw':!![]})[_0xc97d('0x2d')](function(_0x245e72){if(_0x245e72&&_0x245e72[_0xc97d('0x60')]===0x0){return db['UserProfileResource'][_0xc97d('0x57')]({'name':_0xf5936a[_0xc97d('0x39')],'resourceId':_0xf5936a['id'],'type':_0x245e72['name'],'sectionId':_0x245e72['id']},{})[_0xc97d('0x2d')](function(){return _0xff52ba;});}else{return _0xff52ba;}})[_0xc97d('0x54')](function(_0x5d5333){logger[_0xc97d('0x3b')](_0xc97d('0x61'),_0x5d5333);throw _0x5d5333;});}return _0xff52ba;})['then'](respondWithResult(_0x371b6b,0xc9))[_0xc97d('0x54')](handleError(_0x371b6b,null));};exports[_0xc97d('0x62')]=function(_0x310e76,_0x1cee60){var _0x3b424a={'where':{'id':_0x310e76[_0xc97d('0x56')]['id']}},_0x4a139b={};_0x4a139b[_0xc97d('0x49')]=_[_0xc97d('0x43')](db[_0xc97d('0x3e')][_0xc97d('0x3f')]);_0x3b424a[_0xc97d('0x46')]=_['intersection'](_0x4a139b[_0xc97d('0x49')],qs[_0xc97d('0x47')](_0x310e76['query'][_0xc97d('0x47')]));_0x3b424a[_0xc97d('0x46')]=_0x3b424a[_0xc97d('0x46')]['length']?_0x3b424a[_0xc97d('0x46')]:_0x4a139b[_0xc97d('0x49')];if(_0x310e76[_0xc97d('0x42')][_0xc97d('0x51')]){_0x3b424a[_0xc97d('0x52')]=[{'all':!![]}];}_0x3b424a=_['merge']({},_0x3b424a,_0x310e76[_0xc97d('0x50')]);return db[_0xc97d('0x3e')][_0xc97d('0x38')](_0x3b424a)[_0xc97d('0x2d')](handleEntityNotFound(_0x1cee60,null))[_0xc97d('0x2d')](function(_0x55e39c){if(_0x55e39c){var _0x37cc52=_0x55e39c['get']({'plain':!![]});_0x37cc52=qs[_0xc97d('0x63')](_0x37cc52,['id',_0xc97d('0x64'),'updatedAt']);_0x310e76['body']=_[_0xc97d('0x63')](_0x310e76[_0xc97d('0x58')],['id','createdAt',_0xc97d('0x65')]);return db[_0xc97d('0x3e')]['create'](_['merge'](_0x37cc52,_0x310e76[_0xc97d('0x58')]),{'include':_0x310e76[_0xc97d('0x42')]['includeAll']?[{'all':!![]}]:undefined})[_0xc97d('0x2d')](function(_0x4a712e){var _0x234d1a=_0x310e76[_0xc97d('0x59')]['get']({'plain':!![]});if(!_0x234d1a)throw new Error(_0xc97d('0x5a'));if(_0x234d1a[_0xc97d('0x5b')]===_0xc97d('0x59')){var _0x23ae70=_0x4a712e['get']({'plain':!![]});var _0x583446=[{'name':_0xc97d('0x2f'),'value':'inbound'},{'name':'QueueCampaigns','value':_0xc97d('0x31')}];var _0x17d450=_[_0xc97d('0x38')](_0x583446,[_0xc97d('0x35'),_0x23ae70[_0xc97d('0x37')]])[_0xc97d('0x39')];return db[_0xc97d('0x5e')]['find']({'where':{'name':_0x17d450,'userProfileId':_0x234d1a[_0xc97d('0x5f')]},'raw':!![]})['then'](function(_0x12232d){if(_0x12232d&&_0x12232d[_0xc97d('0x60')]===0x0){return db[_0xc97d('0x3a')][_0xc97d('0x57')]({'name':_0x23ae70[_0xc97d('0x39')],'resourceId':_0x23ae70['id'],'type':_0x12232d[_0xc97d('0x39')],'sectionId':_0x12232d['id']},{})[_0xc97d('0x2d')](function(){return _0x4a712e;});}else{return _0x4a712e;}})[_0xc97d('0x54')](function(_0x4fb871){logger[_0xc97d('0x3b')](_0xc97d('0x61'),_0x4fb871);throw _0x4fb871;});}return _0x4a712e;});}})['then'](respondWithResult(_0x1cee60,0xc9))[_0xc97d('0x54')](handleError(_0x1cee60,null));};exports[_0xc97d('0x2c')]=function(_0xfc8e84,_0x2a41fa){if(_0xfc8e84['body']['id']){delete _0xfc8e84[_0xc97d('0x58')]['id'];}return db[_0xc97d('0x3e')][_0xc97d('0x38')]({'where':{'id':_0xfc8e84[_0xc97d('0x56')]['id']}})['then'](handleEntityNotFound(_0x2a41fa,null))['then'](saveUpdates(_0xfc8e84[_0xc97d('0x58')],null))['then'](respondWithResult(_0x2a41fa,null))['catch'](handleError(_0x2a41fa,null));};exports[_0xc97d('0x2e')]=function(_0x8d938a,_0x223582){return db[_0xc97d('0x3e')][_0xc97d('0x38')]({'where':{'id':_0x8d938a[_0xc97d('0x56')]['id']}})[_0xc97d('0x2d')](handleEntityNotFound(_0x223582,null))[_0xc97d('0x2d')](removeEntity(_0x223582,null))[_0xc97d('0x54')](handleError(_0x223582,null));};exports[_0xc97d('0x66')]=function(_0x1f32d6,_0x5ac9fb,_0x4ce3a7){var _0xc14615={'raw':![],'where':{}};var _0x34a22d={};var _0x51ff3f={'count':0x0,'rows':[]};return db[_0xc97d('0x3e')][_0xc97d('0x67')]({'where':{'id':_0x1f32d6[_0xc97d('0x56')]['id']}})['then'](handleEntityNotFound(_0x5ac9fb,null))['then'](function(_0x44575e){if(_0x44575e){_0x34a22d['model']=_['keys'](db['CmHopper']['rawAttributes']);_0x34a22d[_0xc97d('0x42')]=_[_0xc97d('0x43')](_0x1f32d6[_0xc97d('0x42')]);_0x34a22d[_0xc97d('0x44')]=_[_0xc97d('0x45')](_0x34a22d['model'],_0x34a22d[_0xc97d('0x42')]);_0xc14615[_0xc97d('0x46')]=_['intersection'](_0x34a22d['model'],qs[_0xc97d('0x47')](_0x1f32d6['query'][_0xc97d('0x47')]));_0xc14615['attributes']=_0xc14615[_0xc97d('0x46')][_0xc97d('0x48')]?_0xc14615[_0xc97d('0x46')]:_0x34a22d['model'];if(!_0x1f32d6[_0xc97d('0x42')]['hasOwnProperty'](_0xc97d('0x68'))){_0xc14615[_0xc97d('0x28')]=qs[_0xc97d('0x28')](_0x1f32d6[_0xc97d('0x42')][_0xc97d('0x28')]);_0xc14615['offset']=qs['offset'](_0x1f32d6[_0xc97d('0x42')][_0xc97d('0x25')]);}_0xc14615[_0xc97d('0x69')]=qs['sort'](_0x1f32d6['query']['sort']);_0xc14615[_0xc97d('0x4c')]=qs['filters'](_[_0xc97d('0x4d')](_0x1f32d6[_0xc97d('0x42')],_0x34a22d[_0xc97d('0x44')]));_0xc14615['where'][_0xc97d('0x6a')]=_0x44575e['id'];if(_0x1f32d6[_0xc97d('0x42')][_0xc97d('0x32')]){_0xc14615[_0xc97d('0x4c')]=_[_0xc97d('0x4e')](_0xc14615[_0xc97d('0x4c')],{'$or':_[_0xc97d('0x34')](_0xc14615[_0xc97d('0x46')],function(_0x2abbfe){var _0xe9a8e8={};_0xe9a8e8[_0x2abbfe]={'$like':'%'+_0x1f32d6[_0xc97d('0x42')][_0xc97d('0x32')]+'%'};return _0xe9a8e8;})});}_0xc14615=_['merge']({},_0xc14615,_0x1f32d6[_0xc97d('0x50')]);return db[_0xc97d('0x6b')][_0xc97d('0x27')]({'where':_0xc14615[_0xc97d('0x4c')]})['then'](function(_0x505a36){_0x51ff3f[_0xc97d('0x27')]=_0x505a36;if(_0x1f32d6[_0xc97d('0x42')][_0xc97d('0x51')]){_0xc14615[_0xc97d('0x52')]=[{'all':!![]}];}return db[_0xc97d('0x6b')]['findAll'](_0xc14615);})[_0xc97d('0x2d')](function(_0x366ce1){_0x51ff3f[_0xc97d('0x53')]=_0x366ce1;return _0x51ff3f;});}})['then'](respondWithFilteredResult(_0x5ac9fb,_0xc14615))['catch'](handleError(_0x5ac9fb,null));};exports[_0xc97d('0x6c')]=function(_0xf13c65,_0x4aeba5,_0x22c0b7){var _0x3e36f3={'raw':!![],'where':{}};var _0x14ce64={};var _0xb88da2={'count':0x0,'rows':[]};return db[_0xc97d('0x3e')][_0xc97d('0x67')]({'where':{'id':_0xf13c65[_0xc97d('0x56')]['id']}})[_0xc97d('0x2d')](handleEntityNotFound(_0x4aeba5,null))[_0xc97d('0x2d')](function(_0xe5be56){if(_0xe5be56){_0x14ce64[_0xc97d('0x49')]=_[_0xc97d('0x43')](db[_0xc97d('0x6d')]['rawAttributes']);_0x14ce64[_0xc97d('0x42')]=_['keys'](_0xf13c65[_0xc97d('0x42')]);_0x14ce64[_0xc97d('0x44')]=_[_0xc97d('0x45')](_0x14ce64[_0xc97d('0x49')],_0x14ce64['query']);_0x3e36f3[_0xc97d('0x46')]=_[_0xc97d('0x45')](_0x14ce64[_0xc97d('0x49')],qs['fields'](_0xf13c65[_0xc97d('0x42')][_0xc97d('0x47')]));_0x3e36f3[_0xc97d('0x46')]=_0x3e36f3[_0xc97d('0x46')][_0xc97d('0x48')]?_0x3e36f3['attributes']:_0x14ce64[_0xc97d('0x49')];if(!_0xf13c65['query'][_0xc97d('0x4a')]('nolimit')){_0x3e36f3[_0xc97d('0x28')]=qs['limit'](_0xf13c65[_0xc97d('0x42')][_0xc97d('0x28')]);_0x3e36f3['offset']=qs['offset'](_0xf13c65[_0xc97d('0x42')][_0xc97d('0x25')]);}_0x3e36f3[_0xc97d('0x69')]=qs[_0xc97d('0x4b')](_0xf13c65[_0xc97d('0x42')]['sort']);_0x3e36f3[_0xc97d('0x4c')]=qs[_0xc97d('0x44')](_[_0xc97d('0x4d')](_0xf13c65['query'],_0x14ce64[_0xc97d('0x44')]));_0x3e36f3[_0xc97d('0x4c')][_0xc97d('0x6a')]=_0xe5be56['id'];if(_0xf13c65[_0xc97d('0x42')][_0xc97d('0x32')]){_0x3e36f3[_0xc97d('0x4c')]=_[_0xc97d('0x4e')](_0x3e36f3[_0xc97d('0x4c')],{'$or':_['map'](_0x3e36f3[_0xc97d('0x46')],function(_0x5511be){var _0x16973e={};_0x16973e[_0x5511be]={'$like':'%'+_0xf13c65[_0xc97d('0x42')][_0xc97d('0x32')]+'%'};return _0x16973e;})});}_0x3e36f3=_[_0xc97d('0x4e')]({},_0x3e36f3,_0xf13c65[_0xc97d('0x50')]);return db[_0xc97d('0x6d')][_0xc97d('0x27')]({'where':_0x3e36f3['where']})['then'](function(_0x6cc3a4){_0xb88da2[_0xc97d('0x27')]=_0x6cc3a4;if(_0xf13c65[_0xc97d('0x42')][_0xc97d('0x51')]){_0x3e36f3['include']=[{'all':!![]}];}return db[_0xc97d('0x6d')][_0xc97d('0x6e')](_0x3e36f3);})[_0xc97d('0x2d')](function(_0x5ac3f0){_0xb88da2['rows']=_0x5ac3f0;return _0xb88da2;});}})[_0xc97d('0x2d')](respondWithFilteredResult(_0x4aeba5,_0x3e36f3))['catch'](handleError(_0x4aeba5,null));};exports[_0xc97d('0x6f')]=function(_0x27d281,_0x4a363f,_0x31be3b){var _0x44f477={'raw':!![],'where':{}};var _0x2d3eba={};var _0x1a2670={'count':0x0,'rows':[]};return db[_0xc97d('0x3e')][_0xc97d('0x67')]({'where':{'id':_0x27d281['params']['id']}})[_0xc97d('0x2d')](handleEntityNotFound(_0x4a363f,null))['then'](function(_0x3269cf){if(_0x3269cf){_0x2d3eba['model']=_[_0xc97d('0x43')](db['CmHopperFinal'][_0xc97d('0x3f')]);_0x2d3eba['query']=_[_0xc97d('0x43')](_0x27d281[_0xc97d('0x42')]);_0x2d3eba['filters']=_['intersection'](_0x2d3eba[_0xc97d('0x49')],_0x2d3eba['query']);_0x44f477[_0xc97d('0x46')]=_[_0xc97d('0x45')](_0x2d3eba[_0xc97d('0x49')],qs['fields'](_0x27d281[_0xc97d('0x42')][_0xc97d('0x47')]));_0x44f477[_0xc97d('0x46')]=_0x44f477['attributes'][_0xc97d('0x48')]?_0x44f477[_0xc97d('0x46')]:_0x2d3eba[_0xc97d('0x49')];if(!_0x27d281[_0xc97d('0x42')][_0xc97d('0x4a')]('nolimit')){_0x44f477[_0xc97d('0x28')]=qs['limit'](_0x27d281[_0xc97d('0x42')][_0xc97d('0x28')]);_0x44f477[_0xc97d('0x25')]=qs['offset'](_0x27d281[_0xc97d('0x42')][_0xc97d('0x25')]);}_0x44f477[_0xc97d('0x69')]=qs[_0xc97d('0x4b')](_0x27d281[_0xc97d('0x42')]['sort']);_0x44f477[_0xc97d('0x4c')]=qs[_0xc97d('0x44')](_[_0xc97d('0x4d')](_0x27d281['query'],_0x2d3eba[_0xc97d('0x44')]));_0x44f477[_0xc97d('0x4c')][_0xc97d('0x6a')]=_0x3269cf['id'];if(_0x27d281[_0xc97d('0x42')]['filter']){_0x44f477[_0xc97d('0x4c')]=_['merge'](_0x44f477['where'],{'$or':_['map'](_0x44f477[_0xc97d('0x46')],function(_0x4e8be4){var _0x32c382={};_0x32c382[_0x4e8be4]={'$like':'%'+_0x27d281[_0xc97d('0x42')][_0xc97d('0x32')]+'%'};return _0x32c382;})});}_0x44f477=_['merge']({},_0x44f477,_0x27d281[_0xc97d('0x50')]);return db[_0xc97d('0x70')][_0xc97d('0x27')]({'where':_0x44f477[_0xc97d('0x4c')]})[_0xc97d('0x2d')](function(_0x4eb682){_0x1a2670[_0xc97d('0x27')]=_0x4eb682;if(_0x27d281[_0xc97d('0x42')]['includeAll']){_0x44f477[_0xc97d('0x52')]=[{'all':!![]}];}return db['CmHopperFinal'][_0xc97d('0x6e')](_0x44f477);})[_0xc97d('0x2d')](function(_0x1fb3ac){_0x1a2670[_0xc97d('0x53')]=_0x1fb3ac;return _0x1a2670;});}})[_0xc97d('0x2d')](respondWithFilteredResult(_0x4a363f,_0x44f477))[_0xc97d('0x54')](handleError(_0x4a363f,null));};exports[_0xc97d('0x71')]=function(_0x20971b,_0x11a914,_0x299cc3){var _0x4c8e3c={'raw':!![],'where':{}};var _0x5395e2={};var _0x18dbc1={'count':0x0,'rows':[]};return db[_0xc97d('0x3e')][_0xc97d('0x67')]({'where':{'id':_0x20971b[_0xc97d('0x56')]['id']}})['then'](handleEntityNotFound(_0x11a914,null))[_0xc97d('0x2d')](function(_0x258e1f){if(_0x258e1f){_0x5395e2[_0xc97d('0x49')]=_[_0xc97d('0x43')](db['CmHopperBlack'][_0xc97d('0x3f')]);_0x5395e2['query']=_['keys'](_0x20971b[_0xc97d('0x42')]);_0x5395e2[_0xc97d('0x44')]=_['intersection'](_0x5395e2['model'],_0x5395e2[_0xc97d('0x42')]);_0x4c8e3c['attributes']=_['intersection'](_0x5395e2[_0xc97d('0x49')],qs[_0xc97d('0x47')](_0x20971b['query']['fields']));_0x4c8e3c[_0xc97d('0x46')]=_0x4c8e3c[_0xc97d('0x46')][_0xc97d('0x48')]?_0x4c8e3c[_0xc97d('0x46')]:_0x5395e2[_0xc97d('0x49')];if(!_0x20971b[_0xc97d('0x42')][_0xc97d('0x4a')](_0xc97d('0x68'))){_0x4c8e3c['limit']=qs['limit'](_0x20971b['query'][_0xc97d('0x28')]);_0x4c8e3c['offset']=qs[_0xc97d('0x25')](_0x20971b[_0xc97d('0x42')][_0xc97d('0x25')]);}_0x4c8e3c[_0xc97d('0x69')]=qs[_0xc97d('0x4b')](_0x20971b[_0xc97d('0x42')][_0xc97d('0x4b')]);_0x4c8e3c[_0xc97d('0x4c')]=qs[_0xc97d('0x44')](_['pick'](_0x20971b['query'],_0x5395e2[_0xc97d('0x44')]));_0x4c8e3c[_0xc97d('0x4c')]['VoiceQueueId']=_0x258e1f['id'];if(_0x20971b[_0xc97d('0x42')]['filter']){_0x4c8e3c[_0xc97d('0x4c')]=_['merge'](_0x4c8e3c[_0xc97d('0x4c')],{'$or':_[_0xc97d('0x34')](_0x4c8e3c['attributes'],function(_0x5c7bb1){var _0x36a68f={};_0x36a68f[_0x5c7bb1]={'$like':'%'+_0x20971b[_0xc97d('0x42')]['filter']+'%'};return _0x36a68f;})});}_0x4c8e3c=_[_0xc97d('0x4e')]({},_0x4c8e3c,_0x20971b['options']);return db[_0xc97d('0x72')][_0xc97d('0x27')]({'where':_0x4c8e3c['where']})[_0xc97d('0x2d')](function(_0x151ad6){_0x18dbc1[_0xc97d('0x27')]=_0x151ad6;if(_0x20971b['query'][_0xc97d('0x51')]){_0x4c8e3c[_0xc97d('0x52')]=[{'all':!![]}];}return db[_0xc97d('0x72')][_0xc97d('0x6e')](_0x4c8e3c);})[_0xc97d('0x2d')](function(_0x3c30c8){_0x18dbc1[_0xc97d('0x53')]=_0x3c30c8;return _0x18dbc1;});}})[_0xc97d('0x2d')](respondWithFilteredResult(_0x11a914,_0x4c8e3c))[_0xc97d('0x54')](handleError(_0x11a914,null));};exports['getTeams']=function(_0x1ac0c7,_0x2dba5a,_0x4957cb){var _0x1a9d37={};var _0x151157={};var _0x11d1f7;var _0x29fd91;return db[_0xc97d('0x3e')][_0xc97d('0x67')]({'where':{'id':_0x1ac0c7[_0xc97d('0x56')]['id']}})[_0xc97d('0x2d')](handleEntityNotFound(_0x2dba5a,null))['then'](function(_0xe6ec5b){if(_0xe6ec5b){_0x11d1f7=_0xe6ec5b;_0x151157[_0xc97d('0x49')]=_[_0xc97d('0x43')](db[_0xc97d('0x73')][_0xc97d('0x3f')]);_0x151157['query']=_[_0xc97d('0x43')](_0x1ac0c7[_0xc97d('0x42')]);_0x151157[_0xc97d('0x44')]=_['intersection'](_0x151157['model'],_0x151157['query']);_0x1a9d37[_0xc97d('0x46')]=_[_0xc97d('0x45')](_0x151157[_0xc97d('0x49')],qs['fields'](_0x1ac0c7[_0xc97d('0x42')][_0xc97d('0x47')]));_0x1a9d37[_0xc97d('0x46')]=_0x1a9d37[_0xc97d('0x46')][_0xc97d('0x48')]?_0x1a9d37[_0xc97d('0x46')]:_0x151157[_0xc97d('0x49')];_0x1a9d37[_0xc97d('0x69')]=qs[_0xc97d('0x4b')](_0x1ac0c7['query']['sort']);_0x1a9d37[_0xc97d('0x4c')]=qs[_0xc97d('0x44')](_[_0xc97d('0x4d')](_0x1ac0c7['query'],_0x151157[_0xc97d('0x44')]));if(_0x1ac0c7[_0xc97d('0x42')]['filter']){_0x1a9d37[_0xc97d('0x4c')]=_[_0xc97d('0x4e')](_0x1a9d37[_0xc97d('0x4c')],{'$or':_[_0xc97d('0x34')](_0x1a9d37[_0xc97d('0x46')],function(_0x5aa42f){var _0x367bfe={};_0x367bfe[_0x5aa42f]={'$like':'%'+_0x1ac0c7[_0xc97d('0x42')][_0xc97d('0x32')]+'%'};return _0x367bfe;})});}_0x1a9d37=_[_0xc97d('0x4e')]({},_0x1a9d37,_0x1ac0c7[_0xc97d('0x50')]);return _0x11d1f7['getTeams'](_0x1a9d37);}})[_0xc97d('0x2d')](function(_0x1a61b1){if(_0x1a61b1){_0x29fd91=_0x1a61b1['length'];if(!_0x1ac0c7['query'][_0xc97d('0x4a')]('nolimit')){_0x1a9d37[_0xc97d('0x28')]=qs[_0xc97d('0x28')](_0x1ac0c7[_0xc97d('0x42')][_0xc97d('0x28')]);_0x1a9d37['offset']=qs['offset'](_0x1ac0c7['query'][_0xc97d('0x25')]);}return _0x11d1f7['getTeams'](_0x1a9d37);}})[_0xc97d('0x2d')](function(_0xe1ddf2){if(_0xe1ddf2){return _0xe1ddf2?{'count':_0x29fd91,'rows':_0xe1ddf2}:null;}})[_0xc97d('0x2d')](respondWithResult(_0x2dba5a,null))['catch'](handleError(_0x2dba5a,null));};exports['addTeams']=function(_0x3984ba,_0x5c53e7,_0x5de529){var _0x5f0e31=_0x3984ba[_0xc97d('0x58')][_0xc97d('0x74')];var _0x3aad64=_[_0xc97d('0x34')](_0x5f0e31,'id');return db['Team']['findAll']({'where':{'id':_0x3aad64},'attributes':['id'],'include':[{'model':db['User'],'as':_0xc97d('0x75'),'attributes':['id',_0xc97d('0x39'),'online',_0xc97d('0x76'),_0xc97d('0x77')],'raw':!![]}]})[_0xc97d('0x2d')](function(_0x193e3c){if(_0x193e3c){var _0x391b48=_[_0xc97d('0x78')](_0x193e3c,function(_0x2af3f7){var _0x4ca9a6=_0x2af3f7[_0xc97d('0x5c')]({'plain':!![]});_0x4ca9a6['Agents'][_0xc97d('0x79')](function(_0x32a897){_0x32a897['penalty']=_[_0xc97d('0x38')](_0x5f0e31,{'id':_0x4ca9a6['id']})[_0xc97d('0x7a')];});return _0x4ca9a6['Agents'];});return db[_0xc97d('0x3e')][_0xc97d('0x38')]({'where':{'id':_0x3984ba[_0xc97d('0x56')]['id']}})[_0xc97d('0x2d')](function(_0x337cf2){return db[_0xc97d('0x7b')][_0xc97d('0x7c')](function(_0x14cf2e){return _0x337cf2[_0xc97d('0x7d')](_0x3aad64,{'transaction':_0x14cf2e})[_0xc97d('0x2d')](function(){return BPromise[_0xc97d('0x7e')](_0x5f0e31,function(_0xc9767e){return db[_0xc97d('0x7f')][_0xc97d('0x80')]({'TeamId':_0xc9767e['id'],'VoiceQueueId':_0x3984ba[_0xc97d('0x56')]['id'],'penalty':_0xc9767e[_0xc97d('0x7a')]},{'transaction':_0x14cf2e});});})[_0xc97d('0x2d')](function(){return BPromise[_0xc97d('0x7e')](_0x391b48,function(_0x2929d1){return db[_0xc97d('0x81')][_0xc97d('0x82')]({'where':{'UserId':_0x2929d1['id'],'VoiceQueueId':_0x3984ba[_0xc97d('0x56')]['id']},'defaults':{'penalty':_0x2929d1[_0xc97d('0x7a')]},'transaction':_0x14cf2e});});})['then'](function(){return BPromise[_0xc97d('0x7e')](_[_0xc97d('0x32')](_0x391b48,{'online':!![]}),function(_0x5ea198){return db[_0xc97d('0x83')][_0xc97d('0x80')]({'membername':_0x5ea198['name'],'UserId':_0x5ea198['id'],'queue_name':_0x337cf2[_0xc97d('0x39')],'VoiceQueueId':_0x337cf2['id'],'interface':_[_0xc97d('0x84')](_0x5ea198['interface'])?util[_0xc97d('0x85')](_0xc97d('0x86'),_0x5ea198[_0xc97d('0x39')]):_0x5ea198[_0xc97d('0x77')],'paused':_0x5ea198[_0xc97d('0x76')]||![],'penalty':_0x5ea198['penalty']},{'transaction':_0x14cf2e});});})[_0xc97d('0x2d')](function(){_0x391b48[_0xc97d('0x79')](function(_0x11b716){socket[_0xc97d('0x87')]('userVoiceQueue:save',{'UserId':_0x11b716['id'],'VoiceQueueId':_0x337cf2['id']});});});});});}})[_0xc97d('0x2d')](respondWithStatusCode(_0x5c53e7,null))[_0xc97d('0x54')](handleError(_0x5c53e7,null));};exports[_0xc97d('0x88')]=function(_0xb7395c,_0x5f2cd4,_0x4420fa){return db[_0xc97d('0x73')][_0xc97d('0x6e')]({'where':{'id':_0xb7395c[_0xc97d('0x42')][_0xc97d('0x89')]},'attributes':['id'],'include':[{'model':db[_0xc97d('0x8a')],'as':_0xc97d('0x75'),'attributes':['id'],'raw':!![]}]})[_0xc97d('0x2d')](handleEntityNotFound(_0x5f2cd4,null))[_0xc97d('0x2d')](function(_0x55594c){var _0x11e252=_[_0xc97d('0x34')](_0x55594c,'id');var _0x4bb7d4=[];var _0x58dea6=[];var _0x157ed9=squel[_0xc97d('0x8b')]();_0x157ed9['field'](_0xc97d('0x8c'))['from'](_0xc97d('0x8d'),'tq')[_0xc97d('0x8e')](_0xc97d('0x8f'),'ut',_0xc97d('0x90'))[_0xc97d('0x4c')](_0xc97d('0x91'),_0xb7395c[_0xc97d('0x56')]['id']);for(var _0x9fca23=0x0;_0x9fca23<_0x55594c[_0xc97d('0x48')];_0x9fca23+=0x1){let _0x3ba89a=_0x55594c[_0x9fca23];for(var _0x1a9fbc=0x0;_0x1a9fbc<_0x3ba89a[_0xc97d('0x75')][_0xc97d('0x48')];_0x1a9fbc+=0x1){let _0x504beb=_0x3ba89a[_0xc97d('0x75')][_0x1a9fbc];var _0x46ad16=_0x157ed9[_0xc97d('0x62')]();_0x46ad16[_0xc97d('0x4c')]('ut.UserId\x20=\x20?',_0x504beb['id']);_0x58dea6[_0xc97d('0x92')](db['sequelize'][_0xc97d('0x42')](_0x46ad16['toString'](),{'type':db[_0xc97d('0x7b')][_0xc97d('0x93')][_0xc97d('0x94')]})[_0xc97d('0x2d')](function(_0x558684){if(_0x558684[_0xc97d('0x48')]===0x1){return _0x504beb['id'];}else{var _0x7a9cf2=_['every'](_[_0xc97d('0x34')](_0x558684,'TeamId'),function(_0x578fbe){return _[_0xc97d('0x36')](_0x11e252,_0x578fbe);});if(_0x7a9cf2){return _0x504beb['id'];}}}));}}return BPromise['all'](_0x58dea6)['then'](function(_0x273a4d){_0x4bb7d4=_(_0x4bb7d4)['union'](_0x273a4d)[_0xc97d('0x95')]()['value']();return db[_0xc97d('0x3e')][_0xc97d('0x38')]({'where':{'id':_0xb7395c['params']['id']}})[_0xc97d('0x2d')](function(_0x3c9da1){return db['sequelize'][_0xc97d('0x7c')](function(_0x31ba6a){return _0x3c9da1[_0xc97d('0x88')](_0xb7395c[_0xc97d('0x42')][_0xc97d('0x89')],{'transaction':_0x31ba6a})[_0xc97d('0x2d')](function(){if(!_[_0xc97d('0x96')](_0x4bb7d4)){return _0x3c9da1[_0xc97d('0x97')](_0x4bb7d4,{'transaction':_0x31ba6a})['then'](function(){return db[_0xc97d('0x83')][_0xc97d('0x2e')]({'where':{'VoiceQueueId':_0xb7395c['params']['id'],'UserId':_0x4bb7d4},'transaction':_0x31ba6a});});}})[_0xc97d('0x2d')](function(){_0x4bb7d4['forEach'](function(_0x178cc9){socket[_0xc97d('0x87')](_0xc97d('0x98'),{'UserId':_0x178cc9,'VoiceQueueId':_0x3c9da1['id']});});});});});});})[_0xc97d('0x2d')](respondWithStatusCode(_0x5f2cd4,null))[_0xc97d('0x54')](handleError(_0x5f2cd4,null));};exports[_0xc97d('0x99')]=function(_0x11c1a1,_0x11a8a3,_0x8d046d){var _0x2ad2d6,_0x1484cb;return db['VoiceQueue']['find']({'where':{'id':_0x11c1a1['params']['id']}})['then'](handleEntityNotFound(_0x11a8a3,null))['then'](function(_0x1ad742){if(_0x1ad742){_0x1484cb=_0x1ad742;return _0x1ad742[_0xc97d('0x99')](_0x11c1a1[_0xc97d('0x58')][_0xc97d('0x89')],_['omit'](_0x11c1a1[_0xc97d('0x58')],['ids','id'])||{})[_0xc97d('0x9a')](function(_0xf87e6e){for(var _0x554e57=0x0;_0x554e57<_0x11c1a1[_0xc97d('0x58')][_0xc97d('0x89')][_0xc97d('0x48')];_0x554e57+=0x1){socket[_0xc97d('0x87')](_0xc97d('0x9b'),{'UserId':Number(_0x11c1a1[_0xc97d('0x58')]['ids'][_0x554e57]),'VoiceQueueId':Number(_0x11c1a1['params']['id'])});}return _0xf87e6e;});}})['then'](function(_0x3b95a1){_0x2ad2d6=_0x3b95a1||[];if(_0x1484cb){return db[_0xc97d('0x8a')][_0xc97d('0x6e')]({'where':{'id':_0x11c1a1[_0xc97d('0x58')]['ids']},'attributes':['id',_0xc97d('0x39'),_0xc97d('0x9c'),_0xc97d('0x76'),_0xc97d('0x77')],'raw':!![]});}})['then'](function(_0x55eaa8){if(!_[_0xc97d('0x96')](_0x55eaa8)){var _0x22de71=[];for(var _0x52c854=0x0;_0x52c854<_0x55eaa8[_0xc97d('0x48')];_0x52c854++){if(_0x55eaa8[_0x52c854][_0xc97d('0x9c')]){_0x22de71[_0xc97d('0x92')](db[_0xc97d('0x83')][_0xc97d('0x80')]({'membername':_0x55eaa8[_0x52c854]['name'],'UserId':_0x55eaa8[_0x52c854]['id'],'queue_name':_0x1484cb[_0xc97d('0x39')],'VoiceQueueId':_0x1484cb['id'],'interface':_[_0xc97d('0x84')](_0x55eaa8[_0x52c854][_0xc97d('0x77')])?util[_0xc97d('0x85')](_0xc97d('0x86'),_0x55eaa8[_0x52c854]['name']):_0x55eaa8[_0x52c854][_0xc97d('0x77')],'paused':_0x55eaa8[_0x52c854][_0xc97d('0x76')]||![],'penalty':_0x11c1a1[_0xc97d('0x58')]['penalty']||0x0}));}}return BPromise['all'](_0x22de71);}})['then'](function(){return _0x2ad2d6;})['then'](respondWithResult(_0x11a8a3,null))['catch'](handleError(_0x11a8a3,null));};exports['removeAgents']=function(_0x21bc03,_0x664469,_0xe87a44){return db['VoiceQueue'][_0xc97d('0x38')]({'where':{'id':_0x21bc03[_0xc97d('0x56')]['id']}})[_0xc97d('0x2d')](handleEntityNotFound(_0x664469,null))['then'](function(_0x277c5a){if(_0x277c5a){return _0x277c5a[_0xc97d('0x97')](_0x21bc03['query'][_0xc97d('0x89')])[_0xc97d('0x2d')](function(){if(_[_0xc97d('0x9d')](_0x21bc03[_0xc97d('0x42')][_0xc97d('0x89')])){for(var _0x1f2521=0x0;_0x1f2521<_0x21bc03['query'][_0xc97d('0x89')][_0xc97d('0x48')];_0x1f2521+=0x1){socket[_0xc97d('0x87')](_0xc97d('0x98'),{'UserId':Number(_0x21bc03['query'][_0xc97d('0x89')][_0x1f2521]),'VoiceQueueId':Number(_0x21bc03['params']['id'])});}}else{socket['emit']('userVoiceQueue:remove',{'UserId':Number(_0x21bc03[_0xc97d('0x42')][_0xc97d('0x89')]),'VoiceQueueId':Number(_0x21bc03[_0xc97d('0x56')]['id'])});}});}})[_0xc97d('0x2d')](function(_0x424191){return db[_0xc97d('0x83')]['destroy']({'where':{'VoiceQueueId':_0x21bc03['params']['id'],'UserId':_0x21bc03[_0xc97d('0x42')][_0xc97d('0x89')]}})[_0xc97d('0x2d')](function(){return _0x424191;});})['then'](respondWithStatusCode(_0x664469,null))['catch'](handleError(_0x664469,null));};exports['getAgents']=function(_0x11bfaa,_0x384f46,_0x11cc09){var _0x55aeca={};var _0x5100b8={};var _0x2eea6d;var _0x26e590;return db[_0xc97d('0x3e')][_0xc97d('0x67')]({'where':{'id':_0x11bfaa[_0xc97d('0x56')]['id']}})[_0xc97d('0x2d')](handleEntityNotFound(_0x384f46,null))[_0xc97d('0x2d')](function(_0x225d40){if(_0x225d40){_0x2eea6d=_0x225d40;_0x5100b8[_0xc97d('0x49')]=_[_0xc97d('0x43')](db[_0xc97d('0x8a')][_0xc97d('0x3f')]);_0x5100b8['query']=_[_0xc97d('0x43')](_0x11bfaa[_0xc97d('0x42')]);_0x5100b8[_0xc97d('0x44')]=_['intersection'](_0x5100b8[_0xc97d('0x49')],_0x5100b8[_0xc97d('0x42')]);_0x55aeca[_0xc97d('0x46')]=_[_0xc97d('0x45')](_0x5100b8[_0xc97d('0x49')],qs['fields'](_0x11bfaa[_0xc97d('0x42')][_0xc97d('0x47')]));_0x55aeca['attributes']=_0x55aeca[_0xc97d('0x46')][_0xc97d('0x48')]?_0x55aeca[_0xc97d('0x46')]:_0x5100b8['model'];_0x55aeca[_0xc97d('0x69')]=qs[_0xc97d('0x4b')](_0x11bfaa[_0xc97d('0x42')][_0xc97d('0x4b')]);_0x55aeca[_0xc97d('0x4c')]=qs[_0xc97d('0x44')](_[_0xc97d('0x4d')](_0x11bfaa[_0xc97d('0x42')],_0x5100b8[_0xc97d('0x44')]));if(_0x11bfaa[_0xc97d('0x42')]['filter']){_0x55aeca[_0xc97d('0x4c')]=_['merge'](_0x55aeca['where'],{'$or':_[_0xc97d('0x34')](_0x55aeca[_0xc97d('0x46')],function(_0x5a731c){var _0x3dc51c={};_0x3dc51c[_0x5a731c]={'$like':'%'+_0x11bfaa['query'][_0xc97d('0x32')]+'%'};return _0x3dc51c;})});}_0x55aeca=_[_0xc97d('0x4e')]({},_0x55aeca,_0x11bfaa[_0xc97d('0x50')]);return _0x2eea6d[_0xc97d('0x9e')](_0x55aeca);}})[_0xc97d('0x2d')](function(_0x29507a){if(_0x29507a){_0x26e590=_0x29507a[_0xc97d('0x48')];if(!_0x11bfaa[_0xc97d('0x42')][_0xc97d('0x4a')](_0xc97d('0x68'))){_0x55aeca[_0xc97d('0x28')]=qs[_0xc97d('0x28')](_0x11bfaa[_0xc97d('0x42')][_0xc97d('0x28')]);_0x55aeca[_0xc97d('0x25')]=qs[_0xc97d('0x25')](_0x11bfaa[_0xc97d('0x42')][_0xc97d('0x25')]);}return _0x2eea6d[_0xc97d('0x9e')](_0x55aeca);}})[_0xc97d('0x2d')](function(_0x50140a){if(_0x50140a){return _0x50140a?{'count':_0x26e590,'rows':_0x50140a}:null;}})['then'](respondWithResult(_0x384f46,null))[_0xc97d('0x54')](handleError(_0x384f46,null));};exports[_0xc97d('0x9f')]=function(_0x1a2665,_0x37f4ef,_0x4c287c){var _0x124e44={};var _0x3b665c={};var _0x428060;var _0x1b4455;return db[_0xc97d('0x3e')][_0xc97d('0x67')]({'where':{'id':_0x1a2665['params']['id']}})['then'](handleEntityNotFound(_0x37f4ef,null))[_0xc97d('0x2d')](function(_0x2c3da9){if(_0x2c3da9){_0x428060=_0x2c3da9;_0x3b665c['model']=_[_0xc97d('0x43')](db['UserVoiceQueueRt'][_0xc97d('0x3f')]);_0x3b665c[_0xc97d('0x42')]=_[_0xc97d('0x43')](_0x1a2665[_0xc97d('0x42')]);_0x3b665c[_0xc97d('0x44')]=_[_0xc97d('0x45')](_0x3b665c['model'],_0x3b665c['query']);_0x124e44['attributes']=_[_0xc97d('0x45')](_0x3b665c[_0xc97d('0x49')],qs[_0xc97d('0x47')](_0x1a2665[_0xc97d('0x42')]['fields']));_0x124e44[_0xc97d('0x46')]=_0x124e44['attributes'][_0xc97d('0x48')]?_0x124e44['attributes']:_0x3b665c[_0xc97d('0x49')];_0x124e44[_0xc97d('0x69')]=qs[_0xc97d('0x4b')](_0x1a2665['query']['sort']);_0x124e44[_0xc97d('0x4c')]=qs[_0xc97d('0x44')](_['pick'](_0x1a2665[_0xc97d('0x42')],_0x3b665c[_0xc97d('0x44')]));if(_0x1a2665[_0xc97d('0x42')][_0xc97d('0x32')]){_0x124e44[_0xc97d('0x4c')]=_[_0xc97d('0x4e')](_0x124e44[_0xc97d('0x4c')],{'$or':_[_0xc97d('0x34')](_0x124e44[_0xc97d('0x46')],function(_0x4b4b28){var _0x565e59={};_0x565e59[_0x4b4b28]={'$like':'%'+_0x1a2665[_0xc97d('0x42')][_0xc97d('0x32')]+'%'};return _0x565e59;})});}_0x124e44=_[_0xc97d('0x4e')]({},_0x124e44,_0x1a2665[_0xc97d('0x50')]);return _0x428060[_0xc97d('0x9f')](_0x124e44);}})[_0xc97d('0x2d')](function(_0x226b2f){if(_0x226b2f){_0x1b4455=_0x226b2f['length'];if(!_0x1a2665['query'][_0xc97d('0x4a')]('nolimit')){_0x124e44[_0xc97d('0x28')]=qs[_0xc97d('0x28')](_0x1a2665[_0xc97d('0x42')][_0xc97d('0x28')]);_0x124e44[_0xc97d('0x25')]=qs[_0xc97d('0x25')](_0x1a2665[_0xc97d('0x42')][_0xc97d('0x25')]);}return _0x428060['getMembers'](_0x124e44);}})[_0xc97d('0x2d')](function(_0x18a20f){return _0x18a20f?{'count':_0x1b4455,'rows':_0x18a20f}:null;})[_0xc97d('0x2d')](respondWithResult(_0x37f4ef,null))[_0xc97d('0x54')](handleError(_0x37f4ef,null));};exports[_0xc97d('0xa0')]=function(_0x34b5a7,_0x148bc1,_0x3fee19){var _0x3a9e73={};var _0x42932b={};var _0x409f72;var _0x3a82c7;return db[_0xc97d('0x3e')][_0xc97d('0x67')]({'where':{'id':_0x34b5a7[_0xc97d('0x56')]['id']}})[_0xc97d('0x2d')](handleEntityNotFound(_0x148bc1,null))[_0xc97d('0x2d')](function(_0x5802a5){if(_0x5802a5){_0x409f72=_0x5802a5;_0x42932b[_0xc97d('0x49')]=_[_0xc97d('0x43')](db[_0xc97d('0xa1')][_0xc97d('0x3f')]);_0x42932b[_0xc97d('0x42')]=_['keys'](_0x34b5a7[_0xc97d('0x42')]);_0x42932b[_0xc97d('0x44')]=_[_0xc97d('0x45')](_0x42932b[_0xc97d('0x49')],_0x42932b[_0xc97d('0x42')]);_0x3a9e73['attributes']=_['intersection'](_0x42932b[_0xc97d('0x49')],qs[_0xc97d('0x47')](_0x34b5a7[_0xc97d('0x42')][_0xc97d('0x47')]));_0x3a9e73[_0xc97d('0x46')]=_0x3a9e73[_0xc97d('0x46')][_0xc97d('0x48')]?_0x3a9e73[_0xc97d('0x46')]:_0x42932b[_0xc97d('0x49')];_0x3a9e73[_0xc97d('0x69')]=qs[_0xc97d('0x4b')](_0x34b5a7[_0xc97d('0x42')]['sort']);_0x3a9e73[_0xc97d('0x4c')]=qs[_0xc97d('0x44')](_[_0xc97d('0x4d')](_0x34b5a7['query'],_0x42932b[_0xc97d('0x44')]));if(_0x34b5a7[_0xc97d('0x42')][_0xc97d('0x32')]){_0x3a9e73[_0xc97d('0x4c')]=_[_0xc97d('0x4e')](_0x3a9e73['where'],{'$or':_[_0xc97d('0x34')](_0x3a9e73[_0xc97d('0x46')],function(_0x3a746c){var _0x563edf={};_0x563edf[_0x3a746c]={'$like':'%'+_0x34b5a7['query'][_0xc97d('0x32')]+'%'};return _0x563edf;})});}_0x3a9e73=_['merge']({},_0x3a9e73,_0x34b5a7[_0xc97d('0x50')]);return _0x409f72[_0xc97d('0xa0')](_0x3a9e73);}})[_0xc97d('0x2d')](function(_0x472c95){if(_0x472c95){_0x3a82c7=_0x472c95[_0xc97d('0x48')];if(!_0x34b5a7[_0xc97d('0x42')][_0xc97d('0x4a')](_0xc97d('0x68'))){_0x3a9e73[_0xc97d('0x28')]=qs[_0xc97d('0x28')](_0x34b5a7['query'][_0xc97d('0x28')]);_0x3a9e73[_0xc97d('0x25')]=qs[_0xc97d('0x25')](_0x34b5a7[_0xc97d('0x42')][_0xc97d('0x25')]);}return _0x409f72[_0xc97d('0xa0')](_0x3a9e73);}})['then'](function(_0xe761){if(_0xe761){return _0xe761?{'count':_0x3a82c7,'rows':_0xe761}:null;}})['then'](respondWithResult(_0x148bc1,null))[_0xc97d('0x54')](handleError(_0x148bc1,null));};exports[_0xc97d('0xa2')]=function(_0x174493,_0x2f1d82,_0x109374){var _0x532c79,_0x2b571d;return db[_0xc97d('0x3e')][_0xc97d('0x38')]({'where':{'id':_0x174493['params']['id']}})[_0xc97d('0x2d')](handleEntityNotFound(_0x2f1d82,null))['then'](function(_0x56363c){if(_0x56363c){_0x2b571d=_0x56363c;return _0x56363c[_0xc97d('0xa2')](_0x174493[_0xc97d('0x58')][_0xc97d('0x89')],_[_0xc97d('0x63')](_0x174493['body'],[_0xc97d('0x89'),'id'])||{});}return null;})[_0xc97d('0x9a')](function(_0x39de0e){var _0x518911;_0x532c79=_0x39de0e||[];var _0xc08b59=[];if(_0x39de0e){for(var _0x53f18b=0x0;_0x53f18b<_0x39de0e[_0xc97d('0x48')];_0x53f18b+=0x1){var _0xfa38cd=_0x39de0e[_0x53f18b][_0xc97d('0x5c')]({'plain':!![]});_0x2b571d[_0xc97d('0xa3')]=_0x174493[_0xc97d('0x58')][_0xc97d('0xa3')]?_0x174493[_0xc97d('0x58')]['dialCheckDuplicateType']:_0x2b571d[_0xc97d('0xa3')];switch(_0x2b571d['dialCheckDuplicateType']){case'always':_0x518911=squel[_0xc97d('0xa4')]()[_0xc97d('0xa5')](_0xc97d('0xa6'))[_0xc97d('0xa7')]([_0xc97d('0xa8'),_0xc97d('0xa9'),_0xc97d('0xaa'),'ListId',_0xc97d('0x6a'),_0xc97d('0x64'),_0xc97d('0x65')],squel[_0xc97d('0x8b')]()[_0xc97d('0xab')]('phone',_0xc97d('0xa8'))[_0xc97d('0xab')](_0xc97d('0xac'),_0xc97d('0xa9'))[_0xc97d('0xab')]('id','ContactId')[_0xc97d('0xab')](_0xfa38cd['CmListId']['toString'](),_0xc97d('0xad'))[_0xc97d('0xab')](_0x174493[_0xc97d('0x56')]['id']['toString'](),_0xc97d('0x6a'))['field'](_0xc97d('0xac'),_0xc97d('0x64'))[_0xc97d('0xab')](_0xc97d('0xac'),'updatedAt')[_0xc97d('0xae')](_0xc97d('0xaf'))[_0xc97d('0x4c')](_0xc97d('0xb0'))[_0xc97d('0x4c')](_0xc97d('0xb1'),_0xfa38cd[_0xc97d('0xb2')][_0xc97d('0xb3')]())['where'](_0xc97d('0xb4'))[_0xc97d('0x4c')](_0xc97d('0xb5'),squel['select']()[_0xc97d('0xab')](_0xc97d('0xb6'))[_0xc97d('0xae')]('cm_hopper_final')[_0xc97d('0x4c')](_0xc97d('0x91'),_0x174493[_0xc97d('0x56')]['id']['toString']()))[_0xc97d('0x4c')](_0xc97d('0xb5'),squel['select']()[_0xc97d('0xab')]('COALESCE(phone,\x27\x27)')[_0xc97d('0xae')](_0xc97d('0xa6'))[_0xc97d('0x4c')]('VoiceQueueId\x20=\x20?',_0x174493[_0xc97d('0x56')]['id'][_0xc97d('0xb3')]())))['toString']();break;case _0xc97d('0xb7'):_0x518911=squel[_0xc97d('0xa4')]()[_0xc97d('0xa5')](_0xc97d('0xa6'))['fromQuery']([_0xc97d('0xa8'),_0xc97d('0xa9'),_0xc97d('0xaa'),'ListId',_0xc97d('0x6a'),_0xc97d('0x64'),_0xc97d('0x65')],squel[_0xc97d('0x8b')]()[_0xc97d('0xab')](_0xc97d('0xa8'),_0xc97d('0xa8'))['field']('NOW()',_0xc97d('0xa9'))['field']('id',_0xc97d('0xaa'))[_0xc97d('0xab')](_0xfa38cd[_0xc97d('0xb2')]['toString'](),_0xc97d('0xad'))[_0xc97d('0xab')](_0x174493[_0xc97d('0x56')]['id']['toString'](),_0xc97d('0x6a'))[_0xc97d('0xab')]('NOW()','createdAt')['field'](_0xc97d('0xac'),_0xc97d('0x65'))['from'](_0xc97d('0xaf'))[_0xc97d('0x4c')](_0xc97d('0xb0'))[_0xc97d('0x4c')]('ListId\x20=\x20?',_0xfa38cd['CmListId']['toString']())[_0xc97d('0x4c')](_0xc97d('0xb4'))[_0xc97d('0x4c')](_0xc97d('0xb5'),squel[_0xc97d('0x8b')]()[_0xc97d('0xab')](_0xc97d('0xb8'))[_0xc97d('0xae')]('cm_hopper')[_0xc97d('0x4c')](_0xc97d('0x91'),_0x174493[_0xc97d('0x56')]['id'][_0xc97d('0xb3')]())))[_0xc97d('0xb3')]();break;default:_0x518911=squel[_0xc97d('0xa4')]()['into']('cm_hopper')[_0xc97d('0xa7')]([_0xc97d('0xa8'),_0xc97d('0xa9'),_0xc97d('0xaa'),_0xc97d('0xad'),_0xc97d('0x6a'),'createdAt',_0xc97d('0x65')],squel[_0xc97d('0x8b')]()[_0xc97d('0xab')](_0xc97d('0xa8'),_0xc97d('0xa8'))[_0xc97d('0xab')](_0xc97d('0xac'),'scheduledAt')['field']('id',_0xc97d('0xaa'))[_0xc97d('0xab')](_0xfa38cd[_0xc97d('0xb2')][_0xc97d('0xb3')](),_0xc97d('0xad'))['field'](_0x174493[_0xc97d('0x56')]['id']['toString'](),'VoiceQueueId')['field'](_0xc97d('0xac'),_0xc97d('0x64'))[_0xc97d('0xab')](_0xc97d('0xac'),_0xc97d('0x65'))[_0xc97d('0xae')](_0xc97d('0xaf'))['where'](_0xc97d('0xb0'))[_0xc97d('0x4c')](_0xc97d('0xb1'),_0xfa38cd[_0xc97d('0xb2')][_0xc97d('0xb3')]())[_0xc97d('0x4c')](_0xc97d('0xb4')))['toString']();}_0xc08b59['push'](db[_0xc97d('0x7b')][_0xc97d('0x42')](_0x518911));}return BPromise[_0xc97d('0xb9')](_0xc08b59);}})['then'](function(){return _0x532c79;})[_0xc97d('0x2d')](respondWithResult(_0x2f1d82,null))[_0xc97d('0x54')](handleError(_0x2f1d82,null));};exports[_0xc97d('0xba')]=function(_0x5d5512,_0x5dde55,_0x418cb1){return db[_0xc97d('0x3e')][_0xc97d('0x38')]({'where':{'id':_0x5d5512[_0xc97d('0x56')]['id']}})[_0xc97d('0x2d')](handleEntityNotFound(_0x5dde55,null))[_0xc97d('0x2d')](function(_0x379073){if(_0x379073){return _0x379073['removeLists'](_0x5d5512[_0xc97d('0x42')][_0xc97d('0x89')]);}})[_0xc97d('0x2d')](function(_0x59fd45){if(_0x59fd45){return db[_0xc97d('0x6b')][_0xc97d('0x2e')]({'where':{'ListId':_0x5d5512[_0xc97d('0x42')]['ids'],'VoiceQueueId':_0x5d5512[_0xc97d('0x56')]['id']}})[_0xc97d('0x2d')](function(){return _0x59fd45;});}})['then'](respondWithStatusCode(_0x5dde55,null))[_0xc97d('0x54')](handleError(_0x5dde55,null));};exports[_0xc97d('0xbb')]=function(_0x3a8259,_0x5206f6,_0x553ca6){var _0x1543ef={};var _0x4640c9={};var _0x2b8df9;var _0x348c95;return db[_0xc97d('0x3e')]['findOne']({'where':{'id':_0x3a8259[_0xc97d('0x56')]['id']}})[_0xc97d('0x2d')](handleEntityNotFound(_0x5206f6,null))[_0xc97d('0x2d')](function(_0x536b12){if(_0x536b12){_0x2b8df9=_0x536b12;_0x4640c9[_0xc97d('0x49')]=_[_0xc97d('0x43')](db[_0xc97d('0xa1')][_0xc97d('0x3f')]);_0x4640c9['query']=_[_0xc97d('0x43')](_0x3a8259[_0xc97d('0x42')]);_0x4640c9['filters']=_['intersection'](_0x4640c9[_0xc97d('0x49')],_0x4640c9[_0xc97d('0x42')]);_0x1543ef[_0xc97d('0x46')]=_['intersection'](_0x4640c9['model'],qs['fields'](_0x3a8259['query'][_0xc97d('0x47')]));_0x1543ef[_0xc97d('0x46')]=_0x1543ef['attributes']['length']?_0x1543ef[_0xc97d('0x46')]:_0x4640c9[_0xc97d('0x49')];_0x1543ef['order']=qs[_0xc97d('0x4b')](_0x3a8259[_0xc97d('0x42')]['sort']);_0x1543ef[_0xc97d('0x4c')]=qs[_0xc97d('0x44')](_[_0xc97d('0x4d')](_0x3a8259[_0xc97d('0x42')],_0x4640c9['filters']));if(_0x3a8259[_0xc97d('0x42')][_0xc97d('0x32')]){_0x1543ef['where']=_[_0xc97d('0x4e')](_0x1543ef[_0xc97d('0x4c')],{'$or':_['map'](_0x1543ef['attributes'],function(_0x402d93){var _0x342b47={};_0x342b47[_0x402d93]={'$like':'%'+_0x3a8259[_0xc97d('0x42')][_0xc97d('0x32')]+'%'};return _0x342b47;})});}_0x1543ef=_['merge']({},_0x1543ef,_0x3a8259[_0xc97d('0x50')]);return _0x2b8df9[_0xc97d('0xbb')](_0x1543ef);}})[_0xc97d('0x2d')](function(_0x1495e4){if(_0x1495e4){_0x348c95=_0x1495e4[_0xc97d('0x48')];if(!_0x3a8259['query'][_0xc97d('0x4a')](_0xc97d('0x68'))){_0x1543ef['limit']=qs[_0xc97d('0x28')](_0x3a8259[_0xc97d('0x42')][_0xc97d('0x28')]);_0x1543ef[_0xc97d('0x25')]=qs[_0xc97d('0x25')](_0x3a8259[_0xc97d('0x42')]['offset']);}return _0x2b8df9['getBlackLists'](_0x1543ef);}})[_0xc97d('0x2d')](function(_0x5313b8){if(_0x5313b8){return _0x5313b8?{'count':_0x348c95,'rows':_0x5313b8}:null;}})[_0xc97d('0x2d')](respondWithResult(_0x5206f6,null))['catch'](handleError(_0x5206f6,null));};exports['addBlackLists']=function(_0x293be0,_0x582cef,_0x2cbebf){var _0x311598,_0x33726a;return db['VoiceQueue'][_0xc97d('0x38')]({'where':{'id':_0x293be0['params']['id']}})[_0xc97d('0x2d')](handleEntityNotFound(_0x582cef,null))[_0xc97d('0x2d')](function(_0x54a944){if(_0x54a944){_0x33726a=_0x54a944;return _0x54a944[_0xc97d('0xbc')](_0x293be0[_0xc97d('0x58')][_0xc97d('0x89')],_[_0xc97d('0x63')](_0x293be0[_0xc97d('0x58')],[_0xc97d('0x89'),'id'])||{});}return null;})['spread'](function(_0x5656b3){var _0x54bbc0;_0x311598=_0x5656b3||[];var _0x4f7d3f=[];if(_0x5656b3){for(var _0x257041=0x0;_0x257041<_0x5656b3[_0xc97d('0x48')];_0x257041+=0x1){var _0x449456=_0x5656b3[_0x257041][_0xc97d('0x5c')]({'plain':!![]});_0x54bbc0=squel[_0xc97d('0xa4')]()[_0xc97d('0xa5')]('cm_hopper_black')['fromQuery'](['phone',_0xc97d('0xaa'),_0xc97d('0xad'),'VoiceQueueId',_0xc97d('0x64'),_0xc97d('0x65')],squel[_0xc97d('0x8b')]()[_0xc97d('0xab')](_0xc97d('0xa8'),_0xc97d('0xa8'))[_0xc97d('0xab')]('id','ContactId')[_0xc97d('0xab')](_0x449456[_0xc97d('0xb2')][_0xc97d('0xb3')](),'ListId')['field'](_0x293be0[_0xc97d('0x56')]['id'][_0xc97d('0xb3')](),'VoiceQueueId')[_0xc97d('0xab')](_0xc97d('0xac'),_0xc97d('0x64'))['field'](_0xc97d('0xac'),'updatedAt')[_0xc97d('0xae')](_0xc97d('0xaf'))['where'](_0xc97d('0xb0'))[_0xc97d('0x4c')]('ListId\x20=\x20?',_0x449456['CmListId'][_0xc97d('0xb3')]())[_0xc97d('0x4c')](_0xc97d('0xb4')))[_0xc97d('0xb3')]();_0x4f7d3f[_0xc97d('0x92')](db[_0xc97d('0x7b')]['query'](_0x54bbc0));}return BPromise['all'](_0x4f7d3f);}})[_0xc97d('0x2d')](function(){return _0x311598;})['then'](respondWithResult(_0x582cef,null))[_0xc97d('0x54')](handleError(_0x582cef,null));};exports[_0xc97d('0xbd')]=function(_0x4a9044,_0x4c64e3,_0x5d75cc){return db[_0xc97d('0x3e')][_0xc97d('0x38')]({'where':{'id':_0x4a9044[_0xc97d('0x56')]['id']}})['then'](handleEntityNotFound(_0x4c64e3,null))['then'](function(_0x35beeb){if(_0x35beeb){return _0x35beeb[_0xc97d('0xbd')](_0x4a9044[_0xc97d('0x42')]['ids']);}})[_0xc97d('0x2d')](function(_0x2e6ea5){if(_0x2e6ea5){return db[_0xc97d('0x72')][_0xc97d('0x2e')]({'where':{'ListId':_0x4a9044[_0xc97d('0x42')][_0xc97d('0x89')],'VoiceQueueId':_0x4a9044[_0xc97d('0x56')]['id']}})[_0xc97d('0x2d')](function(){return _0x2e6ea5;});}})[_0xc97d('0x2d')](respondWithStatusCode(_0x4c64e3,null))[_0xc97d('0x54')](handleError(_0x4c64e3,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index d5e7a86..fb84cc2 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 _0x0ea4=['events','../../mysqldb','save','update','remove','emit','hook','exports'];(function(_0x4b1c2d,_0x573b7c){var _0x4c3d88=function(_0x43c984){while(--_0x43c984){_0x4b1c2d['push'](_0x4b1c2d['shift']());}};_0x4c3d88(++_0x573b7c);}(_0x0ea4,0x178));var _0x40ea=function(_0x4317b3,_0x4c636b){_0x4317b3=_0x4317b3-0x0;var _0x22d01a=_0x0ea4[_0x4317b3];return _0x22d01a;};'use strict';var EventEmitter=require(_0x40ea('0x0'));var VoiceQueue=require(_0x40ea('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x40ea('0x2'),'afterUpdate':_0x40ea('0x3'),'afterDestroy':_0x40ea('0x4')};function emitEvent(_0x34bbb5){return function(_0x1dd3f9,_0x4e6d9c,_0x261ffe){VoiceQueueEvents[_0x40ea('0x5')](_0x34bbb5+':'+_0x1dd3f9['id'],_0x1dd3f9);VoiceQueueEvents[_0x40ea('0x5')](_0x34bbb5,_0x1dd3f9);_0x261ffe(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0x40ea('0x6')](e,emitEvent(event));}}module[_0x40ea('0x7')]=VoiceQueueEvents; \ No newline at end of file +var _0x9c3d=['setMaxListeners','save','update','remove','emit','hook','exports','events','../../mysqldb','VoiceQueue'];(function(_0x5dd9f1,_0x256448){var _0x25558f=function(_0x471100){while(--_0x471100){_0x5dd9f1['push'](_0x5dd9f1['shift']());}};_0x25558f(++_0x256448);}(_0x9c3d,0x1d3));var _0xd9c3=function(_0xcf2382,_0x1da16e){_0xcf2382=_0xcf2382-0x0;var _0x1ade36=_0x9c3d[_0xcf2382];return _0x1ade36;};'use strict';var EventEmitter=require(_0xd9c3('0x0'));var VoiceQueue=require(_0xd9c3('0x1'))['db'][_0xd9c3('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xd9c3('0x3')](0x0);var events={'afterCreate':_0xd9c3('0x4'),'afterUpdate':_0xd9c3('0x5'),'afterDestroy':_0xd9c3('0x6')};function emitEvent(_0x553f7c){return function(_0xce2311,_0x3223b5,_0x4a7c1e){VoiceQueueEvents['emit'](_0x553f7c+':'+_0xce2311['id'],_0xce2311);VoiceQueueEvents[_0xd9c3('0x7')](_0x553f7c,_0xce2311);_0x4a7c1e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0xd9c3('0x8')](e,emitEvent(event));}}module[_0xd9c3('0x9')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index e2b641d..5ac9299 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 _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voiceQueue.attributes','exports','VoiceQueue','util'];(function(_0x2bf689,_0x423eeb){var _0xaa44e0=function(_0x188003){while(--_0x188003){_0x2bf689['push'](_0x2bf689['shift']());}};_0xaa44e0(++_0x423eeb);}(_0xedd9,0xfc));var _0x9edd=function(_0x1c6dbe,_0x21ccab){_0x1c6dbe=_0x1c6dbe-0x0;var _0xa2d66=_0xedd9[_0x1c6dbe];return _0xa2d66;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));module[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return _0x268f9e['define'](_0x9edd('0xa'),attributes,{'tableName':'voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x008c=['define','voice_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports'];(function(_0x27ab58,_0x48c638){var _0x3daff0=function(_0x7e2522){while(--_0x7e2522){_0x27ab58['push'](_0x27ab58['shift']());}};_0x3daff0(++_0x48c638);}(_0x008c,0x188));var _0xc008=function(_0x1c72ac,_0x380a0e){_0x1c72ac=_0x1c72ac-0x0;var _0x274e46=_0x008c[_0x1c72ac];return _0x274e46;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('VoiceQueue',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index dd778a1..6192308 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 _0x45eb=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','request','then','VoiceQueue,\x20%s,\x20%s','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetVoiceQueue','VoiceQueue','options','where','limit','include','map','model','attributes','info','ShowVoiceQueue','find','raw','lodash','util','moment','bluebird'];(function(_0x224519,_0x12da79){var _0x52dc95=function(_0x44ad52){while(--_0x44ad52){_0x224519['push'](_0x224519['shift']());}};_0x52dc95(++_0x12da79);}(_0x45eb,0xd3));var _0xb45e=function(_0x583c10,_0x220d88){_0x583c10=_0x583c10-0x0;var _0x40553d=_0x45eb[_0x583c10];return _0x40553d;};'use strict';var _=require(_0xb45e('0x0'));var util=require(_0xb45e('0x1'));var moment=require(_0xb45e('0x2'));var BPromise=require(_0xb45e('0x3'));var rs=require(_0xb45e('0x4'));var fs=require('fs');var Redis=require(_0xb45e('0x5'));var db=require(_0xb45e('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xb45e('0x7'))(_0xb45e('0x8'));var config=require(_0xb45e('0x9'));var jayson=require(_0xb45e('0xa'));var client=jayson['client'][_0xb45e('0xb')]({'port':0x232a});config['redis']=_[_0xb45e('0xc')](config[_0xb45e('0xd')],{'host':_0xb45e('0xe'),'port':0x18eb});var socket=require(_0xb45e('0xf'))(new Redis(config['redis']));require(_0xb45e('0x10'))[_0xb45e('0x11')](socket);function respondWithRpcPromise(_0x2058c3,_0x209f0f,_0x1b3981){return new BPromise(function(_0x50776b,_0x381651){return client[_0xb45e('0x12')](_0x2058c3,_0x1b3981)[_0xb45e('0x13')](function(_0x336c1d){logger['info'](_0xb45e('0x14'),_0x209f0f,'request\x20sent');logger[_0xb45e('0x15')](_0xb45e('0x16'),_0x209f0f,_0xb45e('0x17'),JSON[_0xb45e('0x18')](_0x336c1d));if(_0x336c1d['error']){if(_0x336c1d[_0xb45e('0x19')][_0xb45e('0x1a')]===0x1f4){logger[_0xb45e('0x19')](_0xb45e('0x14'),_0x209f0f,_0x336c1d[_0xb45e('0x19')][_0xb45e('0x1b')]);return _0x381651(_0x336c1d['error'][_0xb45e('0x1b')]);}logger['error'](_0xb45e('0x14'),_0x209f0f,_0x336c1d['error'][_0xb45e('0x1b')]);return _0x50776b(_0x336c1d[_0xb45e('0x19')][_0xb45e('0x1b')]);}else{logger['info'](_0xb45e('0x14'),_0x209f0f,_0xb45e('0x17'));_0x50776b(_0x336c1d[_0xb45e('0x1c')][_0xb45e('0x1b')]);}})[_0xb45e('0x1d')](function(_0x1105a6){logger[_0xb45e('0x19')]('VoiceQueue,\x20%s,\x20%s',_0x209f0f,_0x1105a6);_0x381651(_0x1105a6);});});}exports[_0xb45e('0x1e')]=function(_0x41e738){var _0x44ef15=this;return new Promise(function(_0x23118d,_0x4dbfd0){return db[_0xb45e('0x1f')]['findAll']({'raw':_0x41e738[_0xb45e('0x20')]?_0x41e738[_0xb45e('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x41e738['options']?_0x41e738[_0xb45e('0x20')][_0xb45e('0x21')]||null:null,'attributes':_0x41e738[_0xb45e('0x20')]?_0x41e738[_0xb45e('0x20')]['attributes']||null:null,'limit':_0x41e738[_0xb45e('0x20')]?_0x41e738[_0xb45e('0x20')][_0xb45e('0x22')]||null:null,'include':_0x41e738[_0xb45e('0x20')]?_0x41e738[_0xb45e('0x20')][_0xb45e('0x23')]?_[_0xb45e('0x24')](_0x41e738['options'][_0xb45e('0x23')],function(_0x307bcd){return{'model':db[_0x307bcd[_0xb45e('0x25')]],'as':_0x307bcd['as'],'attributes':_0x307bcd[_0xb45e('0x26')],'include':_0x307bcd['include']?_[_0xb45e('0x24')](_0x307bcd[_0xb45e('0x23')],function(_0x29a188){return{'model':db[_0x29a188[_0xb45e('0x25')]],'as':_0x29a188['as'],'attributes':_0x29a188[_0xb45e('0x26')],'include':_0x29a188[_0xb45e('0x23')]?_[_0xb45e('0x24')](_0x29a188[_0xb45e('0x23')],function(_0x2ca95f){return{'model':db[_0x2ca95f[_0xb45e('0x25')]],'as':_0x2ca95f['as'],'attributes':_0x2ca95f[_0xb45e('0x26')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x42e4e1){logger[_0xb45e('0x27')]('GetVoiceQueue',_0x41e738);logger[_0xb45e('0x15')](_0xb45e('0x1e'),_0x41e738,JSON[_0xb45e('0x18')](_0x42e4e1));_0x23118d(_0x42e4e1);})[_0xb45e('0x1d')](function(_0x389bd1){logger[_0xb45e('0x19')]('GetVoiceQueue',_0x389bd1[_0xb45e('0x1b')],_0x41e738);_0x4dbfd0(_0x44ef15[_0xb45e('0x19')](0x1f4,_0x389bd1[_0xb45e('0x1b')]));});});};exports[_0xb45e('0x28')]=function(_0x56dde1){var _0x56f0b9=this;return new Promise(function(_0x2ca6d1,_0x526587){return db['VoiceQueue'][_0xb45e('0x29')]({'raw':_0x56dde1['options']?_0x56dde1[_0xb45e('0x20')][_0xb45e('0x2a')]===undefined?!![]:![]:!![],'where':_0x56dde1[_0xb45e('0x20')]?_0x56dde1[_0xb45e('0x20')][_0xb45e('0x21')]||null:null,'attributes':_0x56dde1[_0xb45e('0x20')]?_0x56dde1['options']['attributes']||null:null,'include':_0x56dde1['options']?_0x56dde1[_0xb45e('0x20')][_0xb45e('0x23')]?_[_0xb45e('0x24')](_0x56dde1[_0xb45e('0x20')]['include'],function(_0x559bb0){return{'model':db[_0x559bb0[_0xb45e('0x25')]],'as':_0x559bb0['as'],'attributes':_0x559bb0[_0xb45e('0x26')],'include':_0x559bb0[_0xb45e('0x23')]?_[_0xb45e('0x24')](_0x559bb0[_0xb45e('0x23')],function(_0x12a79c){return{'model':db[_0x12a79c[_0xb45e('0x25')]],'as':_0x12a79c['as'],'attributes':_0x12a79c[_0xb45e('0x26')],'include':_0x12a79c['include']?_['map'](_0x12a79c['include'],function(_0x5bf040){return{'model':db[_0x5bf040[_0xb45e('0x25')]],'as':_0x5bf040['as'],'attributes':_0x5bf040['attributes']};}):[]};}):[]};}):[]:[]})[_0xb45e('0x13')](function(_0x7582fb){logger[_0xb45e('0x27')]('ShowVoiceQueue',_0x56dde1);logger['debug'](_0xb45e('0x28'),_0x56dde1,JSON['stringify'](_0x7582fb));_0x2ca6d1(_0x7582fb);})[_0xb45e('0x1d')](function(_0x2d5568){logger[_0xb45e('0x19')]('ShowVoiceQueue',_0x2d5568['message'],_0x56dde1);_0x526587(_0x56f0b9[_0xb45e('0x19')](0x1f4,_0x2d5568[_0xb45e('0x1b')]));});});}; \ No newline at end of file +var _0xbb3c=['raw','options','where','attributes','limit','include','map','model','stringify','ShowVoiceQueue','VoiceQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','localhost','./voiceQueue.socket','register','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetVoiceQueue'];(function(_0x374418,_0x37ab48){var _0x41d6a2=function(_0x2dc92d){while(--_0x2dc92d){_0x374418['push'](_0x374418['shift']());}};_0x41d6a2(++_0x37ab48);}(_0xbb3c,0x16b));var _0xcbb3=function(_0x2b6316,_0x1dd4f1){_0x2b6316=_0x2b6316-0x0;var _0x4421de=_0xbb3c[_0x2b6316];return _0x4421de;};'use strict';var _=require(_0xcbb3('0x0'));var util=require(_0xcbb3('0x1'));var moment=require(_0xcbb3('0x2'));var BPromise=require(_0xcbb3('0x3'));var rs=require(_0xcbb3('0x4'));var fs=require('fs');var Redis=require(_0xcbb3('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xcbb3('0x6'));var logger=require(_0xcbb3('0x7'))(_0xcbb3('0x8'));var config=require(_0xcbb3('0x9'));var jayson=require(_0xcbb3('0xa'));var client=jayson['client']['http']({'port':0x232a});config[_0xcbb3('0xb')]=_['defaults'](config[_0xcbb3('0xb')],{'host':_0xcbb3('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcbb3('0xb')]));require(_0xcbb3('0xd'))[_0xcbb3('0xe')](socket);function respondWithRpcPromise(_0x51b20c,_0xe3746f,_0x2d14aa){return new BPromise(function(_0x30f950,_0xbe35cb){return client['request'](_0x51b20c,_0x2d14aa)[_0xcbb3('0xf')](function(_0x383b94){logger[_0xcbb3('0x10')](_0xcbb3('0x11'),_0xe3746f,_0xcbb3('0x12'));logger[_0xcbb3('0x13')](_0xcbb3('0x14'),_0xe3746f,_0xcbb3('0x12'),JSON['stringify'](_0x383b94));if(_0x383b94[_0xcbb3('0x15')]){if(_0x383b94['error'][_0xcbb3('0x16')]===0x1f4){logger[_0xcbb3('0x15')](_0xcbb3('0x11'),_0xe3746f,_0x383b94['error'][_0xcbb3('0x17')]);return _0xbe35cb(_0x383b94[_0xcbb3('0x15')][_0xcbb3('0x17')]);}logger['error'](_0xcbb3('0x11'),_0xe3746f,_0x383b94[_0xcbb3('0x15')][_0xcbb3('0x17')]);return _0x30f950(_0x383b94[_0xcbb3('0x15')][_0xcbb3('0x17')]);}else{logger[_0xcbb3('0x10')](_0xcbb3('0x11'),_0xe3746f,_0xcbb3('0x12'));_0x30f950(_0x383b94[_0xcbb3('0x18')][_0xcbb3('0x17')]);}})[_0xcbb3('0x19')](function(_0x3cc830){logger['error'](_0xcbb3('0x11'),_0xe3746f,_0x3cc830);_0xbe35cb(_0x3cc830);});});}exports[_0xcbb3('0x1a')]=function(_0x40216a){var _0x49af26=this;return new Promise(function(_0x3b723e,_0x33885f){return db['VoiceQueue']['findAll']({'raw':_0x40216a['options']?_0x40216a['options'][_0xcbb3('0x1b')]===undefined?!![]:![]:!![],'where':_0x40216a[_0xcbb3('0x1c')]?_0x40216a[_0xcbb3('0x1c')][_0xcbb3('0x1d')]||null:null,'attributes':_0x40216a[_0xcbb3('0x1c')]?_0x40216a[_0xcbb3('0x1c')][_0xcbb3('0x1e')]||null:null,'limit':_0x40216a[_0xcbb3('0x1c')]?_0x40216a[_0xcbb3('0x1c')][_0xcbb3('0x1f')]||null:null,'include':_0x40216a[_0xcbb3('0x1c')]?_0x40216a[_0xcbb3('0x1c')][_0xcbb3('0x20')]?_[_0xcbb3('0x21')](_0x40216a[_0xcbb3('0x1c')][_0xcbb3('0x20')],function(_0x37eef3){return{'model':db[_0x37eef3[_0xcbb3('0x22')]],'as':_0x37eef3['as'],'attributes':_0x37eef3['attributes'],'include':_0x37eef3[_0xcbb3('0x20')]?_[_0xcbb3('0x21')](_0x37eef3[_0xcbb3('0x20')],function(_0x574d66){return{'model':db[_0x574d66[_0xcbb3('0x22')]],'as':_0x574d66['as'],'attributes':_0x574d66[_0xcbb3('0x1e')],'include':_0x574d66[_0xcbb3('0x20')]?_[_0xcbb3('0x21')](_0x574d66[_0xcbb3('0x20')],function(_0x493a63){return{'model':db[_0x493a63[_0xcbb3('0x22')]],'as':_0x493a63['as'],'attributes':_0x493a63[_0xcbb3('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xcbb3('0xf')](function(_0x10ef03){logger[_0xcbb3('0x10')](_0xcbb3('0x1a'),_0x40216a);logger[_0xcbb3('0x13')](_0xcbb3('0x1a'),_0x40216a,JSON[_0xcbb3('0x23')](_0x10ef03));_0x3b723e(_0x10ef03);})[_0xcbb3('0x19')](function(_0x35d5ac){logger[_0xcbb3('0x15')]('GetVoiceQueue',_0x35d5ac[_0xcbb3('0x17')],_0x40216a);_0x33885f(_0x49af26['error'](0x1f4,_0x35d5ac[_0xcbb3('0x17')]));});});};exports[_0xcbb3('0x24')]=function(_0x31df3f){var _0x3fc52f=this;return new Promise(function(_0xf731b1,_0x6f66b8){return db[_0xcbb3('0x25')][_0xcbb3('0x26')]({'raw':_0x31df3f[_0xcbb3('0x1c')]?_0x31df3f[_0xcbb3('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x31df3f[_0xcbb3('0x1c')]?_0x31df3f['options']['where']||null:null,'attributes':_0x31df3f[_0xcbb3('0x1c')]?_0x31df3f[_0xcbb3('0x1c')]['attributes']||null:null,'include':_0x31df3f['options']?_0x31df3f[_0xcbb3('0x1c')]['include']?_[_0xcbb3('0x21')](_0x31df3f['options']['include'],function(_0x4c1027){return{'model':db[_0x4c1027[_0xcbb3('0x22')]],'as':_0x4c1027['as'],'attributes':_0x4c1027[_0xcbb3('0x1e')],'include':_0x4c1027['include']?_[_0xcbb3('0x21')](_0x4c1027[_0xcbb3('0x20')],function(_0x21b5fa){return{'model':db[_0x21b5fa[_0xcbb3('0x22')]],'as':_0x21b5fa['as'],'attributes':_0x21b5fa['attributes'],'include':_0x21b5fa[_0xcbb3('0x20')]?_[_0xcbb3('0x21')](_0x21b5fa[_0xcbb3('0x20')],function(_0x3f0ae5){return{'model':db[_0x3f0ae5[_0xcbb3('0x22')]],'as':_0x3f0ae5['as'],'attributes':_0x3f0ae5[_0xcbb3('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4255a6){logger[_0xcbb3('0x10')](_0xcbb3('0x24'),_0x31df3f);logger[_0xcbb3('0x13')](_0xcbb3('0x24'),_0x31df3f,JSON['stringify'](_0x4255a6));_0xf731b1(_0x4255a6);})[_0xcbb3('0x19')](function(_0x3a29ab){logger['error'](_0xcbb3('0x24'),_0x3a29ab[_0xcbb3('0x17')],_0x31df3f);_0x6f66b8(_0x3fc52f[_0xcbb3('0x15')](0x1f4,_0x3a29ab['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 8904cd4..a88b37c 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 _0x16fa=['update','emit','removeListener','register','length','voiceQueue:','./voiceQueue.events','save','remove'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x16fa,0x138));var _0xa16f=function(_0x1fc18b,_0x13d27d){_0x1fc18b=_0x1fc18b-0x0;var _0x16a351=_0x16fa[_0x1fc18b];return _0x16a351;};'use strict';var VoiceQueueEvents=require(_0xa16f('0x0'));var events=[_0xa16f('0x1'),_0xa16f('0x2'),_0xa16f('0x3')];function createListener(_0x2d6433,_0x578aef){return function(_0x3a0159){_0x578aef[_0xa16f('0x4')](_0x2d6433,_0x3a0159);};}function removeListener(_0x580da2,_0x25f3e3){return function(){VoiceQueueEvents[_0xa16f('0x5')](_0x580da2,_0x25f3e3);};}exports[_0xa16f('0x6')]=function(_0x17ee4f){for(var _0x434be2=0x0,_0x13cb42=events[_0xa16f('0x7')];_0x434be2<_0x13cb42;_0x434be2++){var _0x2a5f53=events[_0x434be2];var _0x28a46b=createListener(_0xa16f('0x8')+_0x2a5f53,_0x17ee4f);VoiceQueueEvents['on'](_0x2a5f53,_0x28a46b);}}; \ No newline at end of file +var _0xb88a=['save','remove','update','emit','removeListener','register','length','voiceQueue:','./voiceQueue.events'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xb88a,0x8f));var _0xab88=function(_0x10de99,_0xdd42d){_0x10de99=_0x10de99-0x0;var _0x8550e5=_0xb88a[_0x10de99];return _0x8550e5;};'use strict';var VoiceQueueEvents=require(_0xab88('0x0'));var events=[_0xab88('0x1'),_0xab88('0x2'),_0xab88('0x3')];function createListener(_0x34fc81,_0x259364){return function(_0x41c17b){_0x259364[_0xab88('0x4')](_0x34fc81,_0x41c17b);};}function removeListener(_0x3e3ec4,_0x4ad474){return function(){VoiceQueueEvents[_0xab88('0x5')](_0x3e3ec4,_0x4ad474);};}exports[_0xab88('0x6')]=function(_0x4eff7c){for(var _0x2f7d42=0x0,_0x3d9558=events[_0xab88('0x7')];_0x2f7d42<_0x3d9558;_0x2f7d42++){var _0x28b84a=events[_0x2f7d42];var _0x5a36cf=createListener(_0xab88('0x8')+_0x28b84a,_0x4eff7c);VoiceQueueEvents['on'](_0x28b84a,_0x5a36cf);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index b083b7f..29f1a24 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 _0x9211=['/describe','isAuthenticated','getVoiceQueuesReport','show','post','/:id','update','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','index','get'];(function(_0x5a5de4,_0x39a14d){var _0x4d631e=function(_0x47dc5a){while(--_0x47dc5a){_0x5a5de4['push'](_0x5a5de4['shift']());}};_0x4d631e(++_0x39a14d);}(_0x9211,0x149));var _0x1921=function(_0x198541,_0x2e1dea){_0x198541=_0x198541-0x0;var _0x24c19a=_0x9211[_0x198541];return _0x24c19a;};'use strict';var multer=require(_0x1921('0x0'));var util=require(_0x1921('0x1'));var path=require(_0x1921('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1921('0x3')]();var fs_extra=require(_0x1921('0x4'));var auth=require(_0x1921('0x5'));var interaction=require(_0x1921('0x6'));var config=require(_0x1921('0x7'));var controller=require(_0x1921('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x1921('0x9')]);router[_0x1921('0xa')](_0x1921('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x1921('0xa')]('/index',auth[_0x1921('0xc')](),controller[_0x1921('0xd')]);router[_0x1921('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x1921('0xe')]);router[_0x1921('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x1921('0x10'),auth[_0x1921('0xc')](),controller[_0x1921('0x11')]);router['delete'](_0x1921('0x10'),auth[_0x1921('0xc')](),controller[_0x1921('0x12')]);module[_0x1921('0x13')]=router; \ No newline at end of file +var _0xc532=['show','post','create','update','delete','destroy','multer','path','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x1e1fe9,_0x216dd9){var _0x4eeb06=function(_0x3c69c2){while(--_0x3c69c2){_0x1e1fe9['push'](_0x1e1fe9['shift']());}};_0x4eeb06(++_0x216dd9);}(_0xc532,0x1ec));var _0x2c53=function(_0x584f8a,_0x1d4604){_0x584f8a=_0x584f8a-0x0;var _0x214665=_0xc532[_0x584f8a];return _0x214665;};'use strict';var multer=require(_0x2c53('0x0'));var util=require('util');var path=require(_0x2c53('0x1'));var timeout=require('connect-timeout');var express=require(_0x2c53('0x2'));var router=express[_0x2c53('0x3')]();var fs_extra=require(_0x2c53('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2c53('0x5'));var config=require('../../config/environment');var controller=require('./voiceQueueReport.controller');router[_0x2c53('0x6')]('/',auth[_0x2c53('0x7')](),controller[_0x2c53('0x8')]);router[_0x2c53('0x6')](_0x2c53('0x9'),auth['isAuthenticated'](),controller[_0x2c53('0xa')]);router[_0x2c53('0x6')]('/index',auth[_0x2c53('0x7')](),controller['getVoiceQueuesReport']);router[_0x2c53('0x6')](_0x2c53('0xb'),auth['isAuthenticated'](),controller[_0x2c53('0xc')]);router[_0x2c53('0xd')]('/',auth[_0x2c53('0x7')](),controller[_0x2c53('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x2c53('0xf')]);router[_0x2c53('0x10')](_0x2c53('0xb'),auth[_0x2c53('0x7')](),controller[_0x2c53('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index d379cdb..d566307 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 _0xe353=['diff','seconds','setDataValue','queuecallerleaveAt','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x35acf3,_0x1f383b){var _0x3d024d=function(_0x3839a9){while(--_0x3839a9){_0x35acf3['push'](_0x35acf3['shift']());}};_0x3d024d(++_0x1f383b);}(_0xe353,0xd7));var _0x3e35=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0xe353[_0x1a36a5];return _0x746243;};'use strict';var Sequelize=require(_0x3e35('0x0'));var moment=require(_0x3e35('0x1'));module[_0x3e35('0x2')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x3e35('0x3')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x3e35('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0x3e35('0x4')]},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x1d59a1){var _0x198322=moment(_0x1d59a1);var _0x4c6eb3=moment(this[_0x3e35('0x5')](_0x3e35('0x6')))[_0x3e35('0x7')](_0x3e35('0x8'));var _0x5c50f2=_0x198322[_0x3e35('0x9')](_0x4c6eb3,_0x3e35('0xa'));this[_0x3e35('0xb')](_0x3e35('0xc'),_0x1d59a1);this['setDataValue']('holdtime',_0x5c50f2||null);}},'position':{'type':Sequelize[_0x3e35('0xd')]},'count':{'type':Sequelize[_0x3e35('0xd')]},'queuecallerabandon':{'type':Sequelize[_0x3e35('0xe')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x3e35('0x4')]},'queuecallercomplete':{'type':Sequelize[_0x3e35('0xe')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x3e35('0x4')]},'queuecallerexit':{'type':Sequelize[_0x3e35('0xe')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x3e35('0x4')]},'queuecallerexitreason':{'type':Sequelize[_0x3e35('0x3')],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize[_0x3e35('0xd')]},'channel':{'type':Sequelize[_0x3e35('0x3')]},'connectedlinenum':{'type':Sequelize[_0x3e35('0x3')]},'connectedlinename':{'type':Sequelize[_0x3e35('0x3')]},'accountcode':{'type':Sequelize[_0x3e35('0x3')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize[_0x3e35('0xd')]},'mohtime':{'type':Sequelize[_0x3e35('0xd')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x3e35('0xe')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x3e35('0xe')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x3e35('0x3')],'comment':_0x3e35('0xf')},'transferexten':{'type':Sequelize[_0x3e35('0x3')]},'transferuniqueid':{'type':Sequelize[_0x3e35('0x3')]},'disposition':{'type':Sequelize[_0x3e35('0x3')]},'secondDisposition':{'type':Sequelize[_0x3e35('0x3')]},'thirdDisposition':{'type':Sequelize[_0x3e35('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0x3e35('0xd')],'defaultValue':0x0}}; \ No newline at end of file +var _0x6cd9=['holdtime','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','INTEGER','sequelize','moment','STRING','DATE','getDataValue','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','queuecallerleaveAt'];(function(_0x239890,_0x3a98e5){var _0x177d3e=function(_0x4b66ce){while(--_0x4b66ce){_0x239890['push'](_0x239890['shift']());}};_0x177d3e(++_0x3a98e5);}(_0x6cd9,0x1f3));var _0x96cd=function(_0x46c886,_0x20f323){_0x46c886=_0x46c886-0x0;var _0x234d9c=_0x6cd9[_0x46c886];return _0x234d9c;};'use strict';var Sequelize=require(_0x96cd('0x0'));var moment=require(_0x96cd('0x1'));module['exports']={'type':{'type':Sequelize[_0x96cd('0x2')]},'uniqueid':{'type':Sequelize[_0x96cd('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x96cd('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0x96cd('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0x96cd('0x3')],'set':function(_0x45763a){var _0x40d257=moment(_0x45763a);var _0x480c92=moment(this[_0x96cd('0x4')]('queuecallerjoinAt'))[_0x96cd('0x5')](_0x96cd('0x6'));var _0x42452e=_0x40d257[_0x96cd('0x7')](_0x480c92,_0x96cd('0x8'));this[_0x96cd('0x9')](_0x96cd('0xa'),_0x45763a);this[_0x96cd('0x9')](_0x96cd('0xb'),_0x42452e||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize[_0x96cd('0xc')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x96cd('0x3')]},'queuecallercomplete':{'type':Sequelize[_0x96cd('0xc')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x96cd('0x3')]},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x96cd('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0x96cd('0x2')],'comment':_0x96cd('0xd')},'originalposition':{'type':Sequelize[_0x96cd('0xe')]},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x96cd('0x2')]},'connectedlinename':{'type':Sequelize[_0x96cd('0x2')]},'accountcode':{'type':Sequelize[_0x96cd('0x2')]},'context':{'type':Sequelize[_0x96cd('0x2')]},'exten':{'type':Sequelize[_0x96cd('0x2')]},'priority':{'type':Sequelize[_0x96cd('0x2')]},'holdtime':{'type':Sequelize[_0x96cd('0xe')]},'mohtime':{'type':Sequelize[_0x96cd('0xe')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x96cd('0xc')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x96cd('0xc')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x96cd('0x2')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x96cd('0x2')]},'disposition':{'type':Sequelize[_0x96cd('0x2')]},'secondDisposition':{'type':Sequelize[_0x96cd('0x2')]},'thirdDisposition':{'type':Sequelize[_0x96cd('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0x96cd('0xe')],'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 48c0cdf..65e96bb 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 _0x6923=['length','includeAll','find','create','body','params','describe','hasOwnProperty','order','getVoiceQueuesReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','sort','pick','filter','merge','VIRTUAL','options','where','VoiceQueueReport','include','findAll','rows','catch'];(function(_0x234219,_0x4780e1){var _0x48c92a=function(_0x6c67d0){while(--_0x6c67d0){_0x234219['push'](_0x234219['shift']());}};_0x48c92a(++_0x4780e1);}(_0x6923,0x1b3));var _0x3692=function(_0x2f27c0,_0x1bd063){_0x2f27c0=_0x2f27c0-0x0;var _0x1b95ae=_0x6923[_0x2f27c0];return _0x1b95ae;};'use strict';var emlformat=require(_0x3692('0x0'));var rimraf=require(_0x3692('0x1'));var zipdir=require(_0x3692('0x2'));var jsonpatch=require(_0x3692('0x3'));var rp=require(_0x3692('0x4'));var moment=require('moment');var BPromise=require(_0x3692('0x5'));var Mustache=require(_0x3692('0x6'));var util=require(_0x3692('0x7'));var path=require('path');var sox=require(_0x3692('0x8'));var csv=require(_0x3692('0x9'));var ejs=require(_0x3692('0xa'));var fs=require('fs');var fs_extra=require(_0x3692('0xb'));var _=require(_0x3692('0xc'));var squel=require(_0x3692('0xd'));var crypto=require(_0x3692('0xe'));var jsforce=require(_0x3692('0xf'));var deskjs=require(_0x3692('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3692('0x11'));var Redis=require(_0x3692('0x12'));var authService=require(_0x3692('0x13'));var qs=require(_0x3692('0x14'));var as=require(_0x3692('0x15'));var hardwareService=require(_0x3692('0x16'));var logger=require(_0x3692('0x17'))('api');var utils=require(_0x3692('0x18'));var config=require(_0x3692('0x19'));var licenseUtil=require(_0x3692('0x1a'));var db=require(_0x3692('0x1b'))['db'];config['redis']=_[_0x3692('0x1c')](config[_0x3692('0x1d')],{'host':_0x3692('0x1e'),'port':0x18eb});var socket=require(_0x3692('0x1f'))(new Redis(config[_0x3692('0x1d')]));require('./voiceQueueReport.socket')['register'](socket);function respondWithStatusCode(_0x45a4ba,_0x591540){_0x591540=_0x591540||0xcc;return function(_0x3487ad){if(_0x3487ad){return _0x45a4ba[_0x3692('0x20')](_0x591540);}return _0x45a4ba[_0x3692('0x21')](_0x591540)[_0x3692('0x22')]();};}function respondWithResult(_0x18fe37,_0x21a059){_0x21a059=_0x21a059||0xc8;return function(_0x49bc38){if(_0x49bc38){return _0x18fe37['status'](_0x21a059)['json'](_0x49bc38);}};}function respondWithFilteredResult(_0x1029cc,_0x27bda9){return function(_0x505b6f){if(_0x505b6f){var _0x474b2a=typeof _0x27bda9[_0x3692('0x23')]===_0x3692('0x24')&&typeof _0x27bda9['limit']===_0x3692('0x24');var _0x1eb92d=_0x505b6f[_0x3692('0x25')];var _0xe1a4b3=_0x474b2a?0x0:_0x27bda9['offset'];var _0x5f5f0b=_0x474b2a?_0x505b6f[_0x3692('0x25')]:_0x27bda9['offset']+_0x27bda9[_0x3692('0x26')];var _0x2d3d33;if(_0x5f5f0b>=_0x1eb92d){_0x5f5f0b=_0x1eb92d;_0x2d3d33=0xc8;}else{_0x2d3d33=0xce;}_0x1029cc[_0x3692('0x21')](_0x2d3d33);return _0x1029cc[_0x3692('0x27')](_0x3692('0x28'),_0xe1a4b3+'-'+_0x5f5f0b+'/'+_0x1eb92d)['json'](_0x505b6f);}return null;};}function patchUpdates(_0x586f7d){return function(_0xcd426d){try{jsonpatch[_0x3692('0x29')](_0xcd426d,_0x586f7d,!![]);}catch(_0x95e8a){return BPromise[_0x3692('0x2a')](_0x95e8a);}return _0xcd426d[_0x3692('0x2b')]();};}function saveUpdates(_0x454add,_0x36d78b){return function(_0x21f26c){if(_0x21f26c){return _0x21f26c[_0x3692('0x2c')](_0x454add)['then'](function(_0x5cbdbb){return _0x5cbdbb;});}return null;};}function removeEntity(_0x5efc46,_0x2203ab){return function(_0x1ba7b5){if(_0x1ba7b5){return _0x1ba7b5[_0x3692('0x2d')]()[_0x3692('0x2e')](function(){_0x5efc46['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c6aef,_0x5e2e14){return function(_0x59437f){if(!_0x59437f){_0x1c6aef[_0x3692('0x20')](0x194);}return _0x59437f;};}function handleError(_0x6cab72,_0x48c4ea){_0x48c4ea=_0x48c4ea||0x1f4;return function(_0x323786){logger['error'](_0x323786[_0x3692('0x2f')]);if(_0x323786['name']){delete _0x323786[_0x3692('0x30')];}_0x6cab72[_0x3692('0x21')](_0x48c4ea)[_0x3692('0x31')](_0x323786);};}exports[_0x3692('0x32')]=function(_0x243df6,_0x172143){var _0x4e698b={},_0x19602e={},_0x478ceb={'count':0x0,'rows':[]};var _0x263691=_[_0x3692('0x33')](db['VoiceQueueReport'][_0x3692('0x34')],function(_0x1575ac){return{'name':_0x1575ac['fieldName'],'type':_0x1575ac[_0x3692('0x35')][_0x3692('0x36')]};});_0x19602e[_0x3692('0x37')]=_[_0x3692('0x33')](_0x263691,_0x3692('0x30'));_0x19602e[_0x3692('0x38')]=_[_0x3692('0x39')](_0x243df6[_0x3692('0x38')]);_0x19602e[_0x3692('0x3a')]=_[_0x3692('0x3b')](_0x19602e['model'],_0x19602e['query']);_0x4e698b[_0x3692('0x3c')]=_[_0x3692('0x3b')](_0x19602e[_0x3692('0x37')],qs[_0x3692('0x3d')](_0x243df6[_0x3692('0x38')][_0x3692('0x3d')]));_0x4e698b[_0x3692('0x3c')]=_0x4e698b[_0x3692('0x3c')]['length']?_0x4e698b[_0x3692('0x3c')]:_0x19602e[_0x3692('0x37')];if(!_0x243df6[_0x3692('0x38')]['hasOwnProperty'](_0x3692('0x3e'))){_0x4e698b[_0x3692('0x26')]=qs[_0x3692('0x26')](_0x243df6[_0x3692('0x38')][_0x3692('0x26')]);_0x4e698b[_0x3692('0x23')]=qs[_0x3692('0x23')](_0x243df6[_0x3692('0x38')][_0x3692('0x23')]);}_0x4e698b['order']=qs[_0x3692('0x3f')](_0x243df6[_0x3692('0x38')][_0x3692('0x3f')]);_0x4e698b['where']=qs[_0x3692('0x3a')](_[_0x3692('0x40')](_0x243df6[_0x3692('0x38')],_0x19602e[_0x3692('0x3a')]),_0x263691);if(_0x243df6[_0x3692('0x38')][_0x3692('0x41')]){_0x4e698b['where']=_[_0x3692('0x42')](_0x4e698b['where'],{'$or':_[_0x3692('0x33')](_0x263691,function(_0x1243ea){if(_0x1243ea[_0x3692('0x35')]!==_0x3692('0x43')){var _0x522cc2={};_0x522cc2[_0x1243ea[_0x3692('0x30')]]={'$like':'%'+_0x243df6[_0x3692('0x38')]['filter']+'%'};return _0x522cc2;}})});}_0x4e698b=_[_0x3692('0x42')]({},_0x4e698b,_0x243df6[_0x3692('0x44')]);var _0x1729fe={'where':_0x4e698b[_0x3692('0x45')]};return db[_0x3692('0x46')][_0x3692('0x25')](_0x1729fe)[_0x3692('0x2e')](function(_0x10564b){_0x478ceb['count']=_0x10564b;if(_0x243df6[_0x3692('0x38')]['includeAll']){_0x4e698b[_0x3692('0x47')]=[{'all':!![]}];}return db[_0x3692('0x46')][_0x3692('0x48')](_0x4e698b);})[_0x3692('0x2e')](function(_0x5e4644){_0x478ceb[_0x3692('0x49')]=_0x5e4644;return _0x478ceb;})[_0x3692('0x2e')](respondWithFilteredResult(_0x172143,_0x4e698b))[_0x3692('0x4a')](handleError(_0x172143,null));};exports['show']=function(_0x31bd5b,_0x381ef6){var _0x59a933={'raw':![],'where':{'id':_0x31bd5b['params']['id']}},_0x1bbbc6={};_0x1bbbc6[_0x3692('0x37')]=_['keys'](db[_0x3692('0x46')][_0x3692('0x34')]);_0x1bbbc6[_0x3692('0x38')]=_['keys'](_0x31bd5b[_0x3692('0x38')]);_0x1bbbc6[_0x3692('0x3a')]=_[_0x3692('0x3b')](_0x1bbbc6['model'],_0x1bbbc6[_0x3692('0x38')]);_0x59a933[_0x3692('0x3c')]=_[_0x3692('0x3b')](_0x1bbbc6[_0x3692('0x37')],qs['fields'](_0x31bd5b[_0x3692('0x38')]['fields']));_0x59a933['attributes']=_0x59a933['attributes'][_0x3692('0x4b')]?_0x59a933[_0x3692('0x3c')]:_0x1bbbc6['model'];if(_0x31bd5b[_0x3692('0x38')][_0x3692('0x4c')]){_0x59a933['include']=[{'all':!![]}];}_0x59a933=_[_0x3692('0x42')]({},_0x59a933,_0x31bd5b['options']);return db[_0x3692('0x46')][_0x3692('0x4d')](_0x59a933)[_0x3692('0x2e')](handleEntityNotFound(_0x381ef6,null))[_0x3692('0x2e')](respondWithResult(_0x381ef6,null))[_0x3692('0x4a')](handleError(_0x381ef6,null));};exports[_0x3692('0x4e')]=function(_0x2a36d7,_0x40ba4e){return db[_0x3692('0x46')][_0x3692('0x4e')](_0x2a36d7[_0x3692('0x4f')],{})['then'](respondWithResult(_0x40ba4e,0xc9))[_0x3692('0x4a')](handleError(_0x40ba4e,null));};exports[_0x3692('0x2c')]=function(_0x1c2c39,_0x56d11e){if(_0x1c2c39['body']['id']){delete _0x1c2c39[_0x3692('0x4f')]['id'];}return db['VoiceQueueReport'][_0x3692('0x4d')]({'where':{'id':_0x1c2c39[_0x3692('0x50')]['id']}})[_0x3692('0x2e')](handleEntityNotFound(_0x56d11e,null))[_0x3692('0x2e')](saveUpdates(_0x1c2c39[_0x3692('0x4f')],null))['then'](respondWithResult(_0x56d11e,null))[_0x3692('0x4a')](handleError(_0x56d11e,null));};exports[_0x3692('0x2d')]=function(_0x4301c9,_0x4eab31){return db['VoiceQueueReport'][_0x3692('0x4d')]({'where':{'id':_0x4301c9[_0x3692('0x50')]['id']}})[_0x3692('0x2e')](handleEntityNotFound(_0x4eab31,null))['then'](removeEntity(_0x4eab31,null))['catch'](handleError(_0x4eab31,null));};exports[_0x3692('0x51')]=function(_0x12d383,_0x5162e9){return db[_0x3692('0x46')][_0x3692('0x51')]()['then'](respondWithResult(_0x5162e9,null))[_0x3692('0x4a')](handleError(_0x5162e9,null));};exports['getVoiceQueuesReport']=function(_0x31dd95,_0x43df25){var _0x3874d5={},_0x31d5ce={},_0x5b14dd={'count':0x0,'rows':[]};_0x31d5ce['model']=_[_0x3692('0x39')](db[_0x3692('0x46')]['rawAttributes']);_0x31d5ce[_0x3692('0x38')]=_['keys'](_0x31dd95[_0x3692('0x38')]);_0x31d5ce[_0x3692('0x3a')]=_['intersection'](_0x31d5ce[_0x3692('0x37')],_0x31d5ce['query']);_0x3874d5[_0x3692('0x3c')]=_[_0x3692('0x3b')](_0x31d5ce[_0x3692('0x37')],qs[_0x3692('0x3d')](_0x31dd95[_0x3692('0x38')][_0x3692('0x3d')]));_0x3874d5[_0x3692('0x3c')]=_0x3874d5[_0x3692('0x3c')][_0x3692('0x4b')]?_0x3874d5[_0x3692('0x3c')]:_0x31d5ce[_0x3692('0x37')];if(!_0x31dd95[_0x3692('0x38')][_0x3692('0x52')](_0x3692('0x3e'))){_0x3874d5[_0x3692('0x26')]=qs[_0x3692('0x26')](_0x31dd95[_0x3692('0x38')]['limit']);_0x3874d5[_0x3692('0x23')]=qs[_0x3692('0x23')](_0x31dd95[_0x3692('0x38')][_0x3692('0x23')]);}_0x3874d5[_0x3692('0x53')]=qs['sort'](_0x31dd95['query']['sort']);_0x3874d5[_0x3692('0x45')]=qs[_0x3692('0x3a')](_[_0x3692('0x40')](_0x31dd95['query'],_0x31d5ce['filters']));if(_0x31dd95[_0x3692('0x38')][_0x3692('0x41')]){_0x3874d5['where']=_['merge'](_0x3874d5['where'],{'$or':_[_0x3692('0x33')](_0x3874d5[_0x3692('0x3c')],function(_0x328894){var _0x5c66d3={};_0x5c66d3[_0x328894]={'$like':'%'+_0x31dd95[_0x3692('0x38')]['filter']+'%'};return _0x5c66d3;})});}_0x3874d5=_['merge']({},_0x3874d5,_0x31dd95[_0x3692('0x44')]);var _0x5e6560={'where':_0x3874d5[_0x3692('0x45')]};return db['VoiceQueueReport'][_0x3692('0x25')](_0x5e6560)[_0x3692('0x2e')](function(_0x3f8fd4){_0x5b14dd[_0x3692('0x25')]=_0x3f8fd4;if(_0x31dd95[_0x3692('0x38')][_0x3692('0x4c')]){_0x3874d5[_0x3692('0x47')]=[{'all':!![]}];}return db[_0x3692('0x46')]['findAll'](_0x3874d5);})[_0x3692('0x2e')](function(_0x44d29e){_0x5b14dd[_0x3692('0x49')]=_0x44d29e;return _0x5b14dd;})[_0x3692('0x2e')](respondWithFilteredResult(_0x43df25,_0x3874d5,_0x3692('0x54')))['catch'](handleError(_0x43df25,null,_0x3692('0x54')));}; \ No newline at end of file +var _0xa7d5=['length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','getVoiceQueuesReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','crypto','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','map','VoiceQueueReport','type','key','model','query','filters','intersection','attributes','fields'];(function(_0x56ebe6,_0x5cd53b){var _0x2f5cf9=function(_0x3516af){while(--_0x3516af){_0x56ebe6['push'](_0x56ebe6['shift']());}};_0x2f5cf9(++_0x5cd53b);}(_0xa7d5,0xff));var _0x5a7d=function(_0x3dc727,_0x129aa5){_0x3dc727=_0x3dc727-0x0;var _0xc6fd01=_0xa7d5[_0x3dc727];return _0xc6fd01;};'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(_0x5a7d('0x6'));var Mustache=require(_0x5a7d('0x7'));var util=require('util');var path=require(_0x5a7d('0x8'));var sox=require(_0x5a7d('0x9'));var csv=require(_0x5a7d('0xa'));var ejs=require(_0x5a7d('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x5a7d('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5a7d('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5a7d('0xd'));var authService=require(_0x5a7d('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5a7d('0xf'));var logger=require('../../config/logger')('api');var utils=require(_0x5a7d('0x10'));var config=require(_0x5a7d('0x11'));var licenseUtil=require(_0x5a7d('0x12'));var db=require(_0x5a7d('0x13'))['db'];config[_0x5a7d('0x14')]=_[_0x5a7d('0x15')](config[_0x5a7d('0x14')],{'host':'localhost','port':0x18eb});var socket=require(_0x5a7d('0x16'))(new Redis(config[_0x5a7d('0x14')]));require('./voiceQueueReport.socket')[_0x5a7d('0x17')](socket);function respondWithStatusCode(_0x2a8538,_0x2a40f2){_0x2a40f2=_0x2a40f2||0xcc;return function(_0x9af783){if(_0x9af783){return _0x2a8538['sendStatus'](_0x2a40f2);}return _0x2a8538[_0x5a7d('0x18')](_0x2a40f2)[_0x5a7d('0x19')]();};}function respondWithResult(_0x5c6921,_0x377f1c){_0x377f1c=_0x377f1c||0xc8;return function(_0x5b034d){if(_0x5b034d){return _0x5c6921[_0x5a7d('0x18')](_0x377f1c)[_0x5a7d('0x1a')](_0x5b034d);}};}function respondWithFilteredResult(_0x5aaf11,_0x4e3b2c){return function(_0x13faf8){if(_0x13faf8){var _0xe24d8e=typeof _0x4e3b2c[_0x5a7d('0x1b')]===_0x5a7d('0x1c')&&typeof _0x4e3b2c['limit']===_0x5a7d('0x1c');var _0xcfe838=_0x13faf8[_0x5a7d('0x1d')];var _0x12010c=_0xe24d8e?0x0:_0x4e3b2c[_0x5a7d('0x1b')];var _0x237319=_0xe24d8e?_0x13faf8['count']:_0x4e3b2c[_0x5a7d('0x1b')]+_0x4e3b2c['limit'];var _0xde47f8;if(_0x237319>=_0xcfe838){_0x237319=_0xcfe838;_0xde47f8=0xc8;}else{_0xde47f8=0xce;}_0x5aaf11[_0x5a7d('0x18')](_0xde47f8);return _0x5aaf11[_0x5a7d('0x1e')](_0x5a7d('0x1f'),_0x12010c+'-'+_0x237319+'/'+_0xcfe838)['json'](_0x13faf8);}return null;};}function patchUpdates(_0x5bdcd1){return function(_0x502d8b){try{jsonpatch[_0x5a7d('0x20')](_0x502d8b,_0x5bdcd1,!![]);}catch(_0x30a7cd){return BPromise[_0x5a7d('0x21')](_0x30a7cd);}return _0x502d8b[_0x5a7d('0x22')]();};}function saveUpdates(_0xc0a67d,_0x585590){return function(_0x3de8d3){if(_0x3de8d3){return _0x3de8d3[_0x5a7d('0x23')](_0xc0a67d)[_0x5a7d('0x24')](function(_0x544ee4){return _0x544ee4;});}return null;};}function removeEntity(_0x26560b,_0xd4fbad){return function(_0x215b2f){if(_0x215b2f){return _0x215b2f['destroy']()[_0x5a7d('0x24')](function(){_0x26560b[_0x5a7d('0x18')](0xcc)[_0x5a7d('0x19')]();});}};}function handleEntityNotFound(_0x466413,_0x47fa40){return function(_0x2d15ce){if(!_0x2d15ce){_0x466413[_0x5a7d('0x25')](0x194);}return _0x2d15ce;};}function handleError(_0x2b5474,_0x4073ca){_0x4073ca=_0x4073ca||0x1f4;return function(_0x49e8df){logger[_0x5a7d('0x26')](_0x49e8df[_0x5a7d('0x27')]);if(_0x49e8df['name']){delete _0x49e8df[_0x5a7d('0x28')];}_0x2b5474[_0x5a7d('0x18')](_0x4073ca)[_0x5a7d('0x29')](_0x49e8df);};}exports[_0x5a7d('0x2a')]=function(_0x34b24b,_0x1147e1){var _0x4fb615={},_0x1add37={},_0x2899da={'count':0x0,'rows':[]};var _0x3c7183=_[_0x5a7d('0x2b')](db[_0x5a7d('0x2c')]['rawAttributes'],function(_0x5e6a2c){return{'name':_0x5e6a2c['fieldName'],'type':_0x5e6a2c[_0x5a7d('0x2d')][_0x5a7d('0x2e')]};});_0x1add37[_0x5a7d('0x2f')]=_[_0x5a7d('0x2b')](_0x3c7183,_0x5a7d('0x28'));_0x1add37['query']=_['keys'](_0x34b24b[_0x5a7d('0x30')]);_0x1add37[_0x5a7d('0x31')]=_[_0x5a7d('0x32')](_0x1add37[_0x5a7d('0x2f')],_0x1add37[_0x5a7d('0x30')]);_0x4fb615[_0x5a7d('0x33')]=_[_0x5a7d('0x32')](_0x1add37[_0x5a7d('0x2f')],qs[_0x5a7d('0x34')](_0x34b24b[_0x5a7d('0x30')]['fields']));_0x4fb615['attributes']=_0x4fb615[_0x5a7d('0x33')][_0x5a7d('0x35')]?_0x4fb615[_0x5a7d('0x33')]:_0x1add37[_0x5a7d('0x2f')];if(!_0x34b24b[_0x5a7d('0x30')][_0x5a7d('0x36')](_0x5a7d('0x37'))){_0x4fb615[_0x5a7d('0x38')]=qs['limit'](_0x34b24b['query'][_0x5a7d('0x38')]);_0x4fb615[_0x5a7d('0x1b')]=qs['offset'](_0x34b24b['query'][_0x5a7d('0x1b')]);}_0x4fb615[_0x5a7d('0x39')]=qs['sort'](_0x34b24b['query'][_0x5a7d('0x3a')]);_0x4fb615[_0x5a7d('0x3b')]=qs[_0x5a7d('0x31')](_['pick'](_0x34b24b[_0x5a7d('0x30')],_0x1add37[_0x5a7d('0x31')]),_0x3c7183);if(_0x34b24b[_0x5a7d('0x30')][_0x5a7d('0x3c')]){_0x4fb615[_0x5a7d('0x3b')]=_[_0x5a7d('0x3d')](_0x4fb615[_0x5a7d('0x3b')],{'$or':_[_0x5a7d('0x2b')](_0x3c7183,function(_0x390f26){if(_0x390f26[_0x5a7d('0x2d')]!==_0x5a7d('0x3e')){var _0x1e7924={};_0x1e7924[_0x390f26[_0x5a7d('0x28')]]={'$like':'%'+_0x34b24b[_0x5a7d('0x30')][_0x5a7d('0x3c')]+'%'};return _0x1e7924;}})});}_0x4fb615=_['merge']({},_0x4fb615,_0x34b24b[_0x5a7d('0x3f')]);var _0x317f59={'where':_0x4fb615[_0x5a7d('0x3b')]};return db[_0x5a7d('0x2c')][_0x5a7d('0x1d')](_0x317f59)[_0x5a7d('0x24')](function(_0x3d96a5){_0x2899da[_0x5a7d('0x1d')]=_0x3d96a5;if(_0x34b24b['query'][_0x5a7d('0x40')]){_0x4fb615[_0x5a7d('0x41')]=[{'all':!![]}];}return db[_0x5a7d('0x2c')][_0x5a7d('0x42')](_0x4fb615);})[_0x5a7d('0x24')](function(_0x210acd){_0x2899da[_0x5a7d('0x43')]=_0x210acd;return _0x2899da;})[_0x5a7d('0x24')](respondWithFilteredResult(_0x1147e1,_0x4fb615))[_0x5a7d('0x44')](handleError(_0x1147e1,null));};exports[_0x5a7d('0x45')]=function(_0xb14a00,_0x2469aa){var _0x54ac3c={'raw':![],'where':{'id':_0xb14a00[_0x5a7d('0x46')]['id']}},_0x550dfa={};_0x550dfa['model']=_[_0x5a7d('0x47')](db[_0x5a7d('0x2c')]['rawAttributes']);_0x550dfa[_0x5a7d('0x30')]=_['keys'](_0xb14a00[_0x5a7d('0x30')]);_0x550dfa[_0x5a7d('0x31')]=_[_0x5a7d('0x32')](_0x550dfa[_0x5a7d('0x2f')],_0x550dfa[_0x5a7d('0x30')]);_0x54ac3c[_0x5a7d('0x33')]=_[_0x5a7d('0x32')](_0x550dfa[_0x5a7d('0x2f')],qs[_0x5a7d('0x34')](_0xb14a00['query'][_0x5a7d('0x34')]));_0x54ac3c[_0x5a7d('0x33')]=_0x54ac3c[_0x5a7d('0x33')][_0x5a7d('0x35')]?_0x54ac3c[_0x5a7d('0x33')]:_0x550dfa[_0x5a7d('0x2f')];if(_0xb14a00[_0x5a7d('0x30')]['includeAll']){_0x54ac3c[_0x5a7d('0x41')]=[{'all':!![]}];}_0x54ac3c=_[_0x5a7d('0x3d')]({},_0x54ac3c,_0xb14a00[_0x5a7d('0x3f')]);return db[_0x5a7d('0x2c')][_0x5a7d('0x48')](_0x54ac3c)[_0x5a7d('0x24')](handleEntityNotFound(_0x2469aa,null))[_0x5a7d('0x24')](respondWithResult(_0x2469aa,null))['catch'](handleError(_0x2469aa,null));};exports['create']=function(_0x44f510,_0x423642){return db['VoiceQueueReport'][_0x5a7d('0x49')](_0x44f510['body'],{})[_0x5a7d('0x24')](respondWithResult(_0x423642,0xc9))[_0x5a7d('0x44')](handleError(_0x423642,null));};exports['update']=function(_0x483d3e,_0x4f90fc){if(_0x483d3e[_0x5a7d('0x4a')]['id']){delete _0x483d3e[_0x5a7d('0x4a')]['id'];}return db[_0x5a7d('0x2c')]['find']({'where':{'id':_0x483d3e[_0x5a7d('0x46')]['id']}})['then'](handleEntityNotFound(_0x4f90fc,null))[_0x5a7d('0x24')](saveUpdates(_0x483d3e[_0x5a7d('0x4a')],null))[_0x5a7d('0x24')](respondWithResult(_0x4f90fc,null))[_0x5a7d('0x44')](handleError(_0x4f90fc,null));};exports['destroy']=function(_0x2579f5,_0x4c1342){return db['VoiceQueueReport']['find']({'where':{'id':_0x2579f5[_0x5a7d('0x46')]['id']}})[_0x5a7d('0x24')](handleEntityNotFound(_0x4c1342,null))['then'](removeEntity(_0x4c1342,null))['catch'](handleError(_0x4c1342,null));};exports[_0x5a7d('0x4b')]=function(_0x3dca68,_0x2ebd6d){return db[_0x5a7d('0x2c')][_0x5a7d('0x4b')]()[_0x5a7d('0x24')](respondWithResult(_0x2ebd6d,null))[_0x5a7d('0x44')](handleError(_0x2ebd6d,null));};exports[_0x5a7d('0x4c')]=function(_0x13e25d,_0x2ee80f){var _0x17a696={},_0x4e58c5={},_0x5cd8d4={'count':0x0,'rows':[]};_0x4e58c5[_0x5a7d('0x2f')]=_[_0x5a7d('0x47')](db[_0x5a7d('0x2c')]['rawAttributes']);_0x4e58c5[_0x5a7d('0x30')]=_['keys'](_0x13e25d[_0x5a7d('0x30')]);_0x4e58c5[_0x5a7d('0x31')]=_[_0x5a7d('0x32')](_0x4e58c5[_0x5a7d('0x2f')],_0x4e58c5['query']);_0x17a696[_0x5a7d('0x33')]=_[_0x5a7d('0x32')](_0x4e58c5['model'],qs[_0x5a7d('0x34')](_0x13e25d[_0x5a7d('0x30')][_0x5a7d('0x34')]));_0x17a696['attributes']=_0x17a696[_0x5a7d('0x33')]['length']?_0x17a696['attributes']:_0x4e58c5[_0x5a7d('0x2f')];if(!_0x13e25d[_0x5a7d('0x30')][_0x5a7d('0x36')]('nolimit')){_0x17a696[_0x5a7d('0x38')]=qs['limit'](_0x13e25d[_0x5a7d('0x30')]['limit']);_0x17a696['offset']=qs[_0x5a7d('0x1b')](_0x13e25d['query'][_0x5a7d('0x1b')]);}_0x17a696[_0x5a7d('0x39')]=qs['sort'](_0x13e25d['query']['sort']);_0x17a696['where']=qs[_0x5a7d('0x31')](_['pick'](_0x13e25d['query'],_0x4e58c5[_0x5a7d('0x31')]));if(_0x13e25d['query'][_0x5a7d('0x3c')]){_0x17a696['where']=_[_0x5a7d('0x3d')](_0x17a696[_0x5a7d('0x3b')],{'$or':_[_0x5a7d('0x2b')](_0x17a696['attributes'],function(_0x3f89bd){var _0x53fc7c={};_0x53fc7c[_0x3f89bd]={'$like':'%'+_0x13e25d[_0x5a7d('0x30')][_0x5a7d('0x3c')]+'%'};return _0x53fc7c;})});}_0x17a696=_['merge']({},_0x17a696,_0x13e25d[_0x5a7d('0x3f')]);var _0x21d456={'where':_0x17a696['where']};return db[_0x5a7d('0x2c')][_0x5a7d('0x1d')](_0x21d456)['then'](function(_0x1142ad){_0x5cd8d4[_0x5a7d('0x1d')]=_0x1142ad;if(_0x13e25d[_0x5a7d('0x30')][_0x5a7d('0x40')]){_0x17a696[_0x5a7d('0x41')]=[{'all':!![]}];}return db[_0x5a7d('0x2c')][_0x5a7d('0x42')](_0x17a696);})[_0x5a7d('0x24')](function(_0x174948){_0x5cd8d4[_0x5a7d('0x43')]=_0x174948;return _0x5cd8d4;})[_0x5a7d('0x24')](respondWithFilteredResult(_0x2ee80f,_0x17a696,_0x5a7d('0x4c')))[_0x5a7d('0x44')](handleError(_0x2ee80f,null,_0x5a7d('0x4c')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 905ad6d..65e73f5 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 _0x628c=['events','../../mysqldb','VoiceQueueReport','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x5b26cb,_0x527ab0){var _0x563d12=function(_0x472b38){while(--_0x472b38){_0x5b26cb['push'](_0x5b26cb['shift']());}};_0x563d12(++_0x527ab0);}(_0x628c,0x10e));var _0xc628=function(_0x5d72da,_0xb7ce32){_0x5d72da=_0x5d72da-0x0;var _0x43ebe7=_0x628c[_0x5d72da];return _0x43ebe7;};'use strict';var EventEmitter=require(_0xc628('0x0'));var VoiceQueueReport=require(_0xc628('0x1'))['db'][_0xc628('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc628('0x3'),'afterUpdate':_0xc628('0x4'),'afterDestroy':_0xc628('0x5')};function emitEvent(_0x265a78){return function(_0x26d0c4,_0x4a994c,_0x44f098){VoiceQueueReportEvents[_0xc628('0x6')](_0x265a78+':'+_0x26d0c4['id'],_0x26d0c4);VoiceQueueReportEvents['emit'](_0x265a78,_0x26d0c4);_0x44f098(null);};}for(var e in events){if(events[_0xc628('0x7')](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module[_0xc628('0x8')]=VoiceQueueReportEvents; \ No newline at end of file +var _0x7657=['update','remove','emit','hasOwnProperty','hook','exports','events','VoiceQueueReport','setMaxListeners','save'];(function(_0x2f7790,_0x26dccc){var _0x42a939=function(_0x102bf3){while(--_0x102bf3){_0x2f7790['push'](_0x2f7790['shift']());}};_0x42a939(++_0x26dccc);}(_0x7657,0x150));var _0x7765=function(_0x1a6c89,_0x2d6332){_0x1a6c89=_0x1a6c89-0x0;var _0x2b70c1=_0x7657[_0x1a6c89];return _0x2b70c1;};'use strict';var EventEmitter=require(_0x7765('0x0'));var VoiceQueueReport=require('../../mysqldb')['db'][_0x7765('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x7765('0x2')](0x0);var events={'afterCreate':_0x7765('0x3'),'afterUpdate':_0x7765('0x4'),'afterDestroy':_0x7765('0x5')};function emitEvent(_0x4027c1){return function(_0x2bbbee,_0x43bc49,_0x5759c9){VoiceQueueReportEvents[_0x7765('0x6')](_0x4027c1+':'+_0x2bbbee['id'],_0x2bbbee);VoiceQueueReportEvents[_0x7765('0x6')](_0x4027c1,_0x2bbbee);_0x5759c9(null);};}for(var e in events){if(events[_0x7765('0x7')](e)){var event=events[e];VoiceQueueReport[_0x7765('0x8')](e,emitEvent(event));}}module[_0x7765('0x9')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 5ce66b6..d7d1d24 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 _0xf41a=['path','rimraf','../../config/environment','./voiceQueueReport.attributes','exports','define','report_queue','uniqueid','lodash','../../config/logger','api','moment','request-promise'];(function(_0x246ec8,_0x52a0df){var _0x441003=function(_0x18d070){while(--_0x18d070){_0x246ec8['push'](_0x246ec8['shift']());}};_0x441003(++_0x52a0df);}(_0xf41a,0x14d));var _0xaf41=function(_0x42cf3b,_0x3bb5d7){_0x42cf3b=_0x42cf3b-0x0;var _0x416c2d=_0xf41a[_0x42cf3b];return _0x416c2d;};'use strict';var _=require(_0xaf41('0x0'));var util=require('util');var logger=require(_0xaf41('0x1'))(_0xaf41('0x2'));var moment=require(_0xaf41('0x3'));var BPromise=require('bluebird');var rp=require(_0xaf41('0x4'));var fs=require('fs');var path=require(_0xaf41('0x5'));var rimraf=require(_0xaf41('0x6'));var config=require(_0xaf41('0x7'));var attributes=require(_0xaf41('0x8'));module[_0xaf41('0x9')]=function(_0x3855b3,_0x1374a3){return _0x3855b3[_0xaf41('0xa')]('VoiceQueueReport',attributes,{'tableName':_0xaf41('0xb'),'paranoid':![],'indexes':[{'fields':[_0xaf41('0xc')]},{'fields':['calleridnum']}],'timestamps':!![]});}; \ No newline at end of file +var _0x6b43=['request-promise','path','../../config/environment','./voiceQueueReport.attributes','exports','define','VoiceQueueReport','report_queue','uniqueid','util','../../config/logger','api','moment','bluebird'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x6b43,0x12f));var _0x36b4=function(_0x52872a,_0x65faec){_0x52872a=_0x52872a-0x0;var _0x1a785a=_0x6b43[_0x52872a];return _0x1a785a;};'use strict';var _=require('lodash');var util=require(_0x36b4('0x0'));var logger=require(_0x36b4('0x1'))(_0x36b4('0x2'));var moment=require(_0x36b4('0x3'));var BPromise=require(_0x36b4('0x4'));var rp=require(_0x36b4('0x5'));var fs=require('fs');var path=require(_0x36b4('0x6'));var rimraf=require('rimraf');var config=require(_0x36b4('0x7'));var attributes=require(_0x36b4('0x8'));module[_0x36b4('0x9')]=function(_0x516461,_0x22ff33){return _0x516461[_0x36b4('0xa')](_0x36b4('0xb'),attributes,{'tableName':_0x36b4('0xc'),'paranoid':![],'indexes':[{'fields':[_0x36b4('0xd')]},{'fields':['calleridnum']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 3dd3370..ca21a38 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 _0x6940=['error','code','message','result','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','where','attributes','limit','include','model','map','catch','CreateVoiceQueueReport','create','body','UpdateVoiceQueueReport','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','./voiceQueueReport.socket','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1e00e2,_0x53ef11){var _0x343019=function(_0x28b313){while(--_0x28b313){_0x1e00e2['push'](_0x1e00e2['shift']());}};_0x343019(++_0x53ef11);}(_0x6940,0x6c));var _0x0694=function(_0x5e7ecd,_0x216998){_0x5e7ecd=_0x5e7ecd-0x0;var _0x3afb7d=_0x6940[_0x5e7ecd];return _0x3afb7d;};'use strict';var _=require('lodash');var util=require(_0x0694('0x0'));var moment=require('moment');var BPromise=require(_0x0694('0x1'));var rs=require(_0x0694('0x2'));var fs=require('fs');var Redis=require(_0x0694('0x3'));var db=require(_0x0694('0x4'))['db'];var utils=require(_0x0694('0x5'));var logger=require(_0x0694('0x6'))(_0x0694('0x7'));var config=require('../../config/environment');var jayson=require(_0x0694('0x8'));var client=jayson[_0x0694('0x9')][_0x0694('0xa')]({'port':0x232a});config['redis']=_[_0x0694('0xb')](config[_0x0694('0xc')],{'host':_0x0694('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0694('0xc')]));require(_0x0694('0xe'))[_0x0694('0xf')](socket);function respondWithRpcPromise(_0x28662e,_0x35a1f4,_0x18ea77){return new BPromise(function(_0x2669b4,_0x5de7b6){return client[_0x0694('0x10')](_0x28662e,_0x18ea77)[_0x0694('0x11')](function(_0x47d9dc){logger[_0x0694('0x12')](_0x0694('0x13'),_0x35a1f4,_0x0694('0x14'));logger[_0x0694('0x15')](_0x0694('0x16'),_0x35a1f4,_0x0694('0x14'),JSON[_0x0694('0x17')](_0x47d9dc));if(_0x47d9dc[_0x0694('0x18')]){if(_0x47d9dc[_0x0694('0x18')][_0x0694('0x19')]===0x1f4){logger[_0x0694('0x18')](_0x0694('0x13'),_0x35a1f4,_0x47d9dc[_0x0694('0x18')][_0x0694('0x1a')]);return _0x5de7b6(_0x47d9dc[_0x0694('0x18')][_0x0694('0x1a')]);}logger[_0x0694('0x18')](_0x0694('0x13'),_0x35a1f4,_0x47d9dc[_0x0694('0x18')][_0x0694('0x1a')]);return _0x2669b4(_0x47d9dc[_0x0694('0x18')][_0x0694('0x1a')]);}else{logger[_0x0694('0x12')](_0x0694('0x13'),_0x35a1f4,'request\x20sent');_0x2669b4(_0x47d9dc[_0x0694('0x1b')]['message']);}})['catch'](function(_0x55f88d){logger[_0x0694('0x18')](_0x0694('0x13'),_0x35a1f4,_0x55f88d);_0x5de7b6(_0x55f88d);});});}exports[_0x0694('0x1c')]=function(_0x344ad5){var _0x3117bf=this;return new Promise(function(_0x4595af,_0x1bfcb1){return db[_0x0694('0x1d')][_0x0694('0x1e')]({'raw':_0x344ad5[_0x0694('0x1f')]?_0x344ad5[_0x0694('0x1f')][_0x0694('0x20')]===undefined?!![]:![]:!![],'where':_0x344ad5[_0x0694('0x1f')]?_0x344ad5[_0x0694('0x1f')][_0x0694('0x21')]||null:null,'attributes':_0x344ad5[_0x0694('0x1f')]?_0x344ad5[_0x0694('0x1f')][_0x0694('0x22')]||null:null,'limit':_0x344ad5['options']?_0x344ad5[_0x0694('0x1f')][_0x0694('0x23')]||null:null,'include':_0x344ad5['options']?_0x344ad5[_0x0694('0x1f')][_0x0694('0x24')]?_['map'](_0x344ad5[_0x0694('0x1f')][_0x0694('0x24')],function(_0x2bebfa){return{'model':db[_0x2bebfa[_0x0694('0x25')]],'as':_0x2bebfa['as'],'attributes':_0x2bebfa[_0x0694('0x22')],'include':_0x2bebfa[_0x0694('0x24')]?_[_0x0694('0x26')](_0x2bebfa[_0x0694('0x24')],function(_0x53bb5b){return{'model':db[_0x53bb5b[_0x0694('0x25')]],'as':_0x53bb5b['as'],'attributes':_0x53bb5b[_0x0694('0x22')],'include':_0x53bb5b['include']?_[_0x0694('0x26')](_0x53bb5b['include'],function(_0x32e2f5){return{'model':db[_0x32e2f5[_0x0694('0x25')]],'as':_0x32e2f5['as'],'attributes':_0x32e2f5[_0x0694('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2ac128){logger['info'](_0x0694('0x1c'),_0x344ad5);logger[_0x0694('0x15')](_0x0694('0x1c'),_0x344ad5,JSON['stringify'](_0x2ac128));_0x4595af(_0x2ac128);})[_0x0694('0x27')](function(_0x14d602){logger['error'](_0x0694('0x1c'),_0x14d602[_0x0694('0x1a')],_0x344ad5);_0x1bfcb1(_0x3117bf[_0x0694('0x18')](0x1f4,_0x14d602[_0x0694('0x1a')]));});});};exports[_0x0694('0x28')]=function(_0x1a99b0){var _0x1e10f9=this;return new Promise(function(_0x34bfa1,_0x29912a){return db[_0x0694('0x1d')][_0x0694('0x29')](_0x1a99b0[_0x0694('0x2a')],{'raw':_0x1a99b0[_0x0694('0x1f')]?_0x1a99b0['options'][_0x0694('0x20')]===undefined?!![]:![]:!![]})[_0x0694('0x11')](function(_0x5eb83a){logger['info']('CreateVoiceQueueReport',_0x1a99b0);logger['debug'](_0x0694('0x28'),_0x1a99b0,JSON['stringify'](_0x5eb83a));_0x34bfa1(_0x5eb83a);})[_0x0694('0x27')](function(_0x377770){logger[_0x0694('0x18')]('CreateVoiceQueueReport',_0x377770['message'],_0x1a99b0);_0x29912a(_0x1e10f9[_0x0694('0x18')](0x1f4,_0x377770[_0x0694('0x1a')]));});});};exports[_0x0694('0x2b')]=function(_0x2b375d){var _0x2a417b=this;return new Promise(function(_0x4a58df,_0x4a4f74){return db['VoiceQueueReport']['update'](_0x2b375d[_0x0694('0x2a')],{'raw':_0x2b375d['options']?_0x2b375d['options'][_0x0694('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2b375d[_0x0694('0x1f')]?_0x2b375d['options']['where']||null:null,'attributes':_0x2b375d[_0x0694('0x1f')]?_0x2b375d[_0x0694('0x1f')][_0x0694('0x22')]||null:null,'limit':_0x2b375d[_0x0694('0x1f')]?_0x2b375d[_0x0694('0x1f')]['limit']||null:null})['then'](function(_0x587631){logger[_0x0694('0x12')](_0x0694('0x2b'),_0x2b375d);logger[_0x0694('0x15')]('UpdateVoiceQueueReport',_0x2b375d,JSON[_0x0694('0x17')](_0x587631));_0x4a58df(_0x587631);})[_0x0694('0x27')](function(_0xa2039f){logger[_0x0694('0x18')]('UpdateVoiceQueueReport',_0xa2039f[_0x0694('0x1a')],_0x2b375d);_0x4a4f74(_0x2a417b[_0x0694('0x18')](0x1f4,_0xa2039f[_0x0694('0x1a')]));});});}; \ No newline at end of file +var _0x421d=['body','raw','UpdateVoiceQueueReport','lodash','moment','ioredis','../../mysqldb','rpc','../../config/environment','client','http','redis','socket.io-emitter','request','then','VoiceQueueReport,\x20%s,\x20%s','VoiceQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetVoiceQueueReport','findAll','options','where','attributes','limit','include','model','map','debug','CreateVoiceQueueReport','VoiceQueueReport','create','info','update'];(function(_0x1957a8,_0x3c1aee){var _0x54fa6b=function(_0x4ca820){while(--_0x4ca820){_0x1957a8['push'](_0x1957a8['shift']());}};_0x54fa6b(++_0x3c1aee);}(_0x421d,0x1b0));var _0xd421=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x421d[_0x5608a3];return _0x1ed50a;};'use strict';var _=require(_0xd421('0x0'));var util=require('util');var moment=require(_0xd421('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd421('0x2'));var db=require(_0xd421('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd421('0x4'));var config=require(_0xd421('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xd421('0x6')][_0xd421('0x7')]({'port':0x232a});config['redis']=_['defaults'](config[_0xd421('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xd421('0x9'))(new Redis(config[_0xd421('0x8')]));require('./voiceQueueReport.socket')['register'](socket);function respondWithRpcPromise(_0x2c9cfa,_0x125a00,_0x3dfce5){return new BPromise(function(_0x599f3f,_0xf097dd){return client[_0xd421('0xa')](_0x2c9cfa,_0x3dfce5)[_0xd421('0xb')](function(_0x500618){logger['info'](_0xd421('0xc'),_0x125a00,'request\x20sent');logger['debug'](_0xd421('0xd'),_0x125a00,_0xd421('0xe'),JSON[_0xd421('0xf')](_0x500618));if(_0x500618[_0xd421('0x10')]){if(_0x500618[_0xd421('0x10')][_0xd421('0x11')]===0x1f4){logger['error'](_0xd421('0xc'),_0x125a00,_0x500618[_0xd421('0x10')][_0xd421('0x12')]);return _0xf097dd(_0x500618[_0xd421('0x10')][_0xd421('0x12')]);}logger[_0xd421('0x10')](_0xd421('0xc'),_0x125a00,_0x500618['error'][_0xd421('0x12')]);return _0x599f3f(_0x500618[_0xd421('0x10')]['message']);}else{logger['info'](_0xd421('0xc'),_0x125a00,_0xd421('0xe'));_0x599f3f(_0x500618[_0xd421('0x13')][_0xd421('0x12')]);}})[_0xd421('0x14')](function(_0x4e29f3){logger['error'](_0xd421('0xc'),_0x125a00,_0x4e29f3);_0xf097dd(_0x4e29f3);});});}exports[_0xd421('0x15')]=function(_0x2d4cb5){var _0x51716d=this;return new Promise(function(_0x10019f,_0x314c5e){return db['VoiceQueueReport'][_0xd421('0x16')]({'raw':_0x2d4cb5['options']?_0x2d4cb5[_0xd421('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x2d4cb5[_0xd421('0x17')]?_0x2d4cb5[_0xd421('0x17')][_0xd421('0x18')]||null:null,'attributes':_0x2d4cb5['options']?_0x2d4cb5[_0xd421('0x17')][_0xd421('0x19')]||null:null,'limit':_0x2d4cb5[_0xd421('0x17')]?_0x2d4cb5['options'][_0xd421('0x1a')]||null:null,'include':_0x2d4cb5[_0xd421('0x17')]?_0x2d4cb5[_0xd421('0x17')][_0xd421('0x1b')]?_['map'](_0x2d4cb5[_0xd421('0x17')][_0xd421('0x1b')],function(_0x599de3){return{'model':db[_0x599de3[_0xd421('0x1c')]],'as':_0x599de3['as'],'attributes':_0x599de3[_0xd421('0x19')],'include':_0x599de3[_0xd421('0x1b')]?_[_0xd421('0x1d')](_0x599de3[_0xd421('0x1b')],function(_0x192333){return{'model':db[_0x192333[_0xd421('0x1c')]],'as':_0x192333['as'],'attributes':_0x192333[_0xd421('0x19')],'include':_0x192333[_0xd421('0x1b')]?_[_0xd421('0x1d')](_0x192333[_0xd421('0x1b')],function(_0x19366a){return{'model':db[_0x19366a[_0xd421('0x1c')]],'as':_0x19366a['as'],'attributes':_0x19366a[_0xd421('0x19')]};}):[]};}):[]};}):[]:[]})[_0xd421('0xb')](function(_0x259c98){logger['info'](_0xd421('0x15'),_0x2d4cb5);logger[_0xd421('0x1e')]('GetVoiceQueueReport',_0x2d4cb5,JSON['stringify'](_0x259c98));_0x10019f(_0x259c98);})[_0xd421('0x14')](function(_0x59c34d){logger[_0xd421('0x10')](_0xd421('0x15'),_0x59c34d['message'],_0x2d4cb5);_0x314c5e(_0x51716d[_0xd421('0x10')](0x1f4,_0x59c34d[_0xd421('0x12')]));});});};exports[_0xd421('0x1f')]=function(_0x390a28){var _0x1ac784=this;return new Promise(function(_0x1e04d0,_0x38db7a){return db[_0xd421('0x20')][_0xd421('0x21')](_0x390a28['body'],{'raw':_0x390a28[_0xd421('0x17')]?_0x390a28[_0xd421('0x17')]['raw']===undefined?!![]:![]:!![]})[_0xd421('0xb')](function(_0x2b6354){logger[_0xd421('0x22')](_0xd421('0x1f'),_0x390a28);logger[_0xd421('0x1e')](_0xd421('0x1f'),_0x390a28,JSON[_0xd421('0xf')](_0x2b6354));_0x1e04d0(_0x2b6354);})[_0xd421('0x14')](function(_0x3c76cb){logger['error'](_0xd421('0x1f'),_0x3c76cb[_0xd421('0x12')],_0x390a28);_0x38db7a(_0x1ac784[_0xd421('0x10')](0x1f4,_0x3c76cb[_0xd421('0x12')]));});});};exports['UpdateVoiceQueueReport']=function(_0x5c2e53){var _0x29349a=this;return new Promise(function(_0x3ea93f,_0x385c18){return db['VoiceQueueReport'][_0xd421('0x23')](_0x5c2e53[_0xd421('0x24')],{'raw':_0x5c2e53[_0xd421('0x17')]?_0x5c2e53[_0xd421('0x17')][_0xd421('0x25')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5c2e53[_0xd421('0x17')]?_0x5c2e53[_0xd421('0x17')][_0xd421('0x18')]||null:null,'attributes':_0x5c2e53[_0xd421('0x17')]?_0x5c2e53[_0xd421('0x17')][_0xd421('0x19')]||null:null,'limit':_0x5c2e53[_0xd421('0x17')]?_0x5c2e53[_0xd421('0x17')]['limit']||null:null})[_0xd421('0xb')](function(_0x4caf57){logger[_0xd421('0x22')](_0xd421('0x26'),_0x5c2e53);logger[_0xd421('0x1e')]('UpdateVoiceQueueReport',_0x5c2e53,JSON[_0xd421('0xf')](_0x4caf57));_0x3ea93f(_0x4caf57);})[_0xd421('0x14')](function(_0x59990a){logger[_0xd421('0x10')](_0xd421('0x26'),_0x59990a[_0xd421('0x12')],_0x5c2e53);_0x385c18(_0x29349a[_0xd421('0x10')](0x1f4,_0x59990a[_0xd421('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 2bb0a66..d26bbe7 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 _0x45c9=['save','update','emit','register','length'];(function(_0x2f45ea,_0x15c656){var _0x485a84=function(_0x4a1fe3){while(--_0x4a1fe3){_0x2f45ea['push'](_0x2f45ea['shift']());}};_0x485a84(++_0x15c656);}(_0x45c9,0x96));var _0x945c=function(_0x268876,_0x36ae04){_0x268876=_0x268876-0x0;var _0x18d29b=_0x45c9[_0x268876];return _0x18d29b;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0x945c('0x0'),'remove',_0x945c('0x1')];function createListener(_0x10b538,_0x236555){return function(_0xeb0fa7){_0x236555[_0x945c('0x2')](_0x10b538,_0xeb0fa7);};}function removeListener(_0x4fe60a,_0x2dc67c){return function(){VoiceQueueReportEvents['removeListener'](_0x4fe60a,_0x2dc67c);};}exports[_0x945c('0x3')]=function(_0x2e1a4f){for(var _0x46a887=0x0,_0x3c5c07=events[_0x945c('0x4')];_0x46a887<_0x3c5c07;_0x46a887++){var _0x9a988b=events[_0x46a887];var _0x4253bf=createListener('voiceQueueReport:'+_0x9a988b,_0x2e1a4f);VoiceQueueReportEvents['on'](_0x9a988b,_0x4253bf);}}; \ No newline at end of file +var _0x21d1=['voiceQueueReport:','./voiceQueueReport.events','save','remove','update','removeListener','register','length'];(function(_0x221ba2,_0x79208){var _0x47d08e=function(_0xaf14ee){while(--_0xaf14ee){_0x221ba2['push'](_0x221ba2['shift']());}};_0x47d08e(++_0x79208);}(_0x21d1,0x1c9));var _0x121d=function(_0x3871aa,_0x18b185){_0x3871aa=_0x3871aa-0x0;var _0x26452b=_0x21d1[_0x3871aa];return _0x26452b;};'use strict';var VoiceQueueReportEvents=require(_0x121d('0x0'));var events=[_0x121d('0x1'),_0x121d('0x2'),_0x121d('0x3')];function createListener(_0x438b9b,_0x14fd65){return function(_0x550ab5){_0x14fd65['emit'](_0x438b9b,_0x550ab5);};}function removeListener(_0x20b991,_0x19c637){return function(){VoiceQueueReportEvents[_0x121d('0x4')](_0x20b991,_0x19c637);};}exports[_0x121d('0x5')]=function(_0x2f3987){for(var _0x4c47ee=0x0,_0x226625=events[_0x121d('0x6')];_0x4c47ee<_0x226625;_0x4c47ee++){var _0x47b50b=events[_0x4c47ee];var _0x2d4d7e=createListener(_0x121d('0x7')+_0x47b50b,_0x2f3987);VoiceQueueReportEvents['on'](_0x47b50b,_0x2d4d7e);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 5c2c18f..1506605 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 _0x674a=['index','show','post','put','/:id','update','delete','destroy','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x31a938,_0x4daec6){var _0x1bf341=function(_0x514261){while(--_0x514261){_0x31a938['push'](_0x31a938['shift']());}};_0x1bf341(++_0x4daec6);}(_0x674a,0x1a0));var _0xa674=function(_0x575a54,_0x457ab0){_0x575a54=_0x575a54-0x0;var _0x55c768=_0x674a[_0x575a54];return _0x55c768;};'use strict';var multer=require(_0xa674('0x0'));var util=require('util');var path=require(_0xa674('0x1'));var timeout=require(_0xa674('0x2'));var express=require(_0xa674('0x3'));var router=express['Router']();var fs_extra=require(_0xa674('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa674('0x5'));var config=require(_0xa674('0x6'));var controller=require('./voiceQueuesLog.controller');router[_0xa674('0x7')]('/',auth[_0xa674('0x8')](),controller[_0xa674('0x9')]);router[_0xa674('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xa674('0xa')]);router[_0xa674('0xb')]('/',auth[_0xa674('0x8')](),controller['create']);router[_0xa674('0xc')](_0xa674('0xd'),auth[_0xa674('0x8')](),controller[_0xa674('0xe')]);router[_0xa674('0xf')](_0xa674('0xd'),auth[_0xa674('0x8')](),controller[_0xa674('0x10')]);module['exports']=router; \ No newline at end of file +var _0x26c2=['Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports','connect-timeout','express'];(function(_0x28ba6f,_0x372f1e){var _0x2f68ae=function(_0x59ce47){while(--_0x59ce47){_0x28ba6f['push'](_0x28ba6f['shift']());}};_0x2f68ae(++_0x372f1e);}(_0x26c2,0x130));var _0x226c=function(_0xd9679,_0x2f035c){_0xd9679=_0xd9679-0x0;var _0x10a4c3=_0x26c2[_0xd9679];return _0x10a4c3;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x226c('0x0'));var express=require(_0x226c('0x1'));var router=express[_0x226c('0x2')]();var fs_extra=require(_0x226c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x226c('0x4'));var config=require(_0x226c('0x5'));var controller=require('./voiceQueuesLog.controller');router[_0x226c('0x6')]('/',auth[_0x226c('0x7')](),controller[_0x226c('0x8')]);router[_0x226c('0x6')](_0x226c('0x9'),auth['isAuthenticated'](),controller[_0x226c('0xa')]);router[_0x226c('0xb')]('/',auth[_0x226c('0x7')](),controller[_0x226c('0xc')]);router[_0x226c('0xd')]('/:id',auth[_0x226c('0x7')](),controller[_0x226c('0xe')]);router['delete']('/:id',auth[_0x226c('0x7')](),controller[_0x226c('0xf')]);module[_0x226c('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 4b9586a..e865fac 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 _0xc4bd=['exports','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','sequelize','moment'];(function(_0x435095,_0x498dd7){var _0x1d2e49=function(_0x54b02e){while(--_0x54b02e){_0x435095['push'](_0x435095['shift']());}};_0x1d2e49(++_0x498dd7);}(_0xc4bd,0x75));var _0xdc4b=function(_0x39bbe5,_0x317585){_0x39bbe5=_0x39bbe5-0x0;var _0x255bee=_0xc4bd[_0x39bbe5];return _0x255bee;};'use strict';var Sequelize=require(_0xdc4b('0x0'));var moment=require(_0xdc4b('0x1'));module[_0xdc4b('0x2')]={'time':{'type':Sequelize[_0xdc4b('0x3')]},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xdc4b('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xdc4b('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xdc4b('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xdc4b('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xdc4b('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xdc4b('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xdc4b('0x4')],'allowNull':![],'defaultValue':moment()[_0xdc4b('0x5')](_0xdc4b('0x6'))}}; \ No newline at end of file +var _0xbc2f=['YYYY-MM-DD\x20HH:mm:ss','moment','exports','STRING','DATE'];(function(_0x5138e0,_0x24fbbc){var _0x18e57b=function(_0x5eda17){while(--_0x5eda17){_0x5138e0['push'](_0x5138e0['shift']());}};_0x18e57b(++_0x24fbbc);}(_0xbc2f,0x1a0));var _0xfbc2=function(_0x529b2a,_0x1cee17){_0x529b2a=_0x529b2a-0x0;var _0x35ddec=_0xbc2f[_0x529b2a];return _0x35ddec;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xfbc2('0x0'));module[_0xfbc2('0x1')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0xfbc2('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xfbc2('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xfbc2('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xfbc2('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xfbc2('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xfbc2('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xfbc2('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xfbc2('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xfbc2('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xfbc2('0x3')],'allowNull':![],'defaultValue':moment()['format'](_0xfbc2('0x4'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index a122fa4..4b15a1a 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 _0x0d67=['filter','merge','options','includeAll','include','show','params','find','create','catch','update','body','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','limit','count','offset','set','Content-Range','json','apply','reject','save','then','error','stack','name','send','index','map','VoiceQueuesLog','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','type','VIRTUAL'];(function(_0x4f3ea9,_0x1508b4){var _0xa26803=function(_0x14aff0){while(--_0x14aff0){_0x4f3ea9['push'](_0x4f3ea9['shift']());}};_0xa26803(++_0x1508b4);}(_0x0d67,0x145));var _0x70d6=function(_0x313df3,_0x4fca45){_0x313df3=_0x313df3-0x0;var _0x241d59=_0x0d67[_0x313df3];return _0x241d59;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x70d6('0x0'));var zipdir=require(_0x70d6('0x1'));var jsonpatch=require(_0x70d6('0x2'));var rp=require(_0x70d6('0x3'));var moment=require(_0x70d6('0x4'));var BPromise=require(_0x70d6('0x5'));var Mustache=require('mustache');var util=require(_0x70d6('0x6'));var path=require(_0x70d6('0x7'));var sox=require(_0x70d6('0x8'));var csv=require('to-csv');var ejs=require(_0x70d6('0x9'));var fs=require('fs');var fs_extra=require(_0x70d6('0xa'));var _=require(_0x70d6('0xb'));var squel=require(_0x70d6('0xc'));var crypto=require(_0x70d6('0xd'));var jsforce=require(_0x70d6('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x70d6('0xf'));var querystring=require(_0x70d6('0x10'));var Papa=require(_0x70d6('0x11'));var Redis=require(_0x70d6('0x12'));var authService=require(_0x70d6('0x13'));var qs=require(_0x70d6('0x14'));var as=require(_0x70d6('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x70d6('0x16'))(_0x70d6('0x17'));var utils=require(_0x70d6('0x18'));var config=require(_0x70d6('0x19'));var licenseUtil=require(_0x70d6('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4f28d4,_0x23fd22){_0x23fd22=_0x23fd22||0xcc;return function(_0x557885){if(_0x557885){return _0x4f28d4[_0x70d6('0x1b')](_0x23fd22);}return _0x4f28d4['status'](_0x23fd22)[_0x70d6('0x1c')]();};}function respondWithResult(_0x53063d,_0x326c0e){_0x326c0e=_0x326c0e||0xc8;return function(_0x2b1a9c){if(_0x2b1a9c){return _0x53063d[_0x70d6('0x1d')](_0x326c0e)['json'](_0x2b1a9c);}};}function respondWithFilteredResult(_0xbc926a,_0x5a8dee){return function(_0xd0d863){if(_0xd0d863){var _0x57b534=typeof _0x5a8dee['offset']==='undefined'&&typeof _0x5a8dee[_0x70d6('0x1e')]==='undefined';var _0x16b2f8=_0xd0d863[_0x70d6('0x1f')];var _0x390a0b=_0x57b534?0x0:_0x5a8dee[_0x70d6('0x20')];var _0x3c1673=_0x57b534?_0xd0d863[_0x70d6('0x1f')]:_0x5a8dee[_0x70d6('0x20')]+_0x5a8dee['limit'];var _0x37f7f4;if(_0x3c1673>=_0x16b2f8){_0x3c1673=_0x16b2f8;_0x37f7f4=0xc8;}else{_0x37f7f4=0xce;}_0xbc926a[_0x70d6('0x1d')](_0x37f7f4);return _0xbc926a[_0x70d6('0x21')](_0x70d6('0x22'),_0x390a0b+'-'+_0x3c1673+'/'+_0x16b2f8)[_0x70d6('0x23')](_0xd0d863);}return null;};}function patchUpdates(_0x412f19){return function(_0x33ce74){try{jsonpatch[_0x70d6('0x24')](_0x33ce74,_0x412f19,!![]);}catch(_0x593743){return BPromise[_0x70d6('0x25')](_0x593743);}return _0x33ce74[_0x70d6('0x26')]();};}function saveUpdates(_0x406fcb,_0x5ecc53){return function(_0x1c8eec){if(_0x1c8eec){return _0x1c8eec['update'](_0x406fcb)[_0x70d6('0x27')](function(_0x358da0){return _0x358da0;});}return null;};}function removeEntity(_0x2947f2,_0x438187){return function(_0x2ed685){if(_0x2ed685){return _0x2ed685['destroy']()[_0x70d6('0x27')](function(){_0x2947f2[_0x70d6('0x1d')](0xcc)[_0x70d6('0x1c')]();});}};}function handleEntityNotFound(_0x54df1b,_0x43d18a){return function(_0x1a4341){if(!_0x1a4341){_0x54df1b['sendStatus'](0x194);}return _0x1a4341;};}function handleError(_0x216ded,_0x4fa6cd){_0x4fa6cd=_0x4fa6cd||0x1f4;return function(_0x139fc4){logger[_0x70d6('0x28')](_0x139fc4[_0x70d6('0x29')]);if(_0x139fc4[_0x70d6('0x2a')]){delete _0x139fc4[_0x70d6('0x2a')];}_0x216ded['status'](_0x4fa6cd)[_0x70d6('0x2b')](_0x139fc4);};}exports[_0x70d6('0x2c')]=function(_0x825fd2,_0x1f9bf7){var _0x5797f1={},_0x5e15b6={},_0x23d9f5={'count':0x0,'rows':[]};var _0xdb6240=_[_0x70d6('0x2d')](db[_0x70d6('0x2e')][_0x70d6('0x2f')],function(_0x3afa4b){return{'name':_0x3afa4b[_0x70d6('0x30')],'type':_0x3afa4b['type'][_0x70d6('0x31')]};});_0x5e15b6[_0x70d6('0x32')]=_['map'](_0xdb6240,_0x70d6('0x2a'));_0x5e15b6[_0x70d6('0x33')]=_[_0x70d6('0x34')](_0x825fd2['query']);_0x5e15b6[_0x70d6('0x35')]=_[_0x70d6('0x36')](_0x5e15b6['model'],_0x5e15b6[_0x70d6('0x33')]);_0x5797f1[_0x70d6('0x37')]=_[_0x70d6('0x36')](_0x5e15b6['model'],qs['fields'](_0x825fd2['query'][_0x70d6('0x38')]));_0x5797f1[_0x70d6('0x37')]=_0x5797f1[_0x70d6('0x37')][_0x70d6('0x39')]?_0x5797f1[_0x70d6('0x37')]:_0x5e15b6['model'];if(!_0x825fd2[_0x70d6('0x33')][_0x70d6('0x3a')](_0x70d6('0x3b'))){_0x5797f1['limit']=qs[_0x70d6('0x1e')](_0x825fd2[_0x70d6('0x33')][_0x70d6('0x1e')]);_0x5797f1[_0x70d6('0x20')]=qs['offset'](_0x825fd2[_0x70d6('0x33')][_0x70d6('0x20')]);}_0x5797f1['order']=qs[_0x70d6('0x3c')](_0x825fd2[_0x70d6('0x33')][_0x70d6('0x3c')]);_0x5797f1[_0x70d6('0x3d')]=qs[_0x70d6('0x35')](_[_0x70d6('0x3e')](_0x825fd2[_0x70d6('0x33')],_0x5e15b6[_0x70d6('0x35')]),_0xdb6240);if(_0x825fd2['query']['filter']){_0x5797f1[_0x70d6('0x3d')]=_['merge'](_0x5797f1[_0x70d6('0x3d')],{'$or':_[_0x70d6('0x2d')](_0xdb6240,function(_0x111e69){if(_0x111e69[_0x70d6('0x3f')]!==_0x70d6('0x40')){var _0x583d86={};_0x583d86[_0x111e69[_0x70d6('0x2a')]]={'$like':'%'+_0x825fd2[_0x70d6('0x33')][_0x70d6('0x41')]+'%'};return _0x583d86;}})});}_0x5797f1=_[_0x70d6('0x42')]({},_0x5797f1,_0x825fd2[_0x70d6('0x43')]);var _0x2c99f4={'where':_0x5797f1['where']};return db[_0x70d6('0x2e')][_0x70d6('0x1f')](_0x2c99f4)[_0x70d6('0x27')](function(_0x23158e){_0x23d9f5[_0x70d6('0x1f')]=_0x23158e;if(_0x825fd2[_0x70d6('0x33')][_0x70d6('0x44')]){_0x5797f1[_0x70d6('0x45')]=[{'all':!![]}];}return db[_0x70d6('0x2e')]['findAll'](_0x5797f1);})[_0x70d6('0x27')](function(_0x3518bc){_0x23d9f5['rows']=_0x3518bc;return _0x23d9f5;})['then'](respondWithFilteredResult(_0x1f9bf7,_0x5797f1))['catch'](handleError(_0x1f9bf7,null));};exports[_0x70d6('0x46')]=function(_0x3205ec,_0x35565f){var _0x25d5eb={'raw':!![],'where':{'id':_0x3205ec[_0x70d6('0x47')]['id']}},_0x4fc38c={};_0x4fc38c['model']=_[_0x70d6('0x34')](db['VoiceQueuesLog']['rawAttributes']);_0x4fc38c[_0x70d6('0x33')]=_[_0x70d6('0x34')](_0x3205ec[_0x70d6('0x33')]);_0x4fc38c['filters']=_['intersection'](_0x4fc38c[_0x70d6('0x32')],_0x4fc38c['query']);_0x25d5eb[_0x70d6('0x37')]=_['intersection'](_0x4fc38c[_0x70d6('0x32')],qs[_0x70d6('0x38')](_0x3205ec[_0x70d6('0x33')][_0x70d6('0x38')]));_0x25d5eb['attributes']=_0x25d5eb[_0x70d6('0x37')]['length']?_0x25d5eb[_0x70d6('0x37')]:_0x4fc38c['model'];if(_0x3205ec[_0x70d6('0x33')][_0x70d6('0x44')]){_0x25d5eb[_0x70d6('0x45')]=[{'all':!![]}];}_0x25d5eb=_[_0x70d6('0x42')]({},_0x25d5eb,_0x3205ec['options']);return db['VoiceQueuesLog'][_0x70d6('0x48')](_0x25d5eb)['then'](handleEntityNotFound(_0x35565f,null))['then'](respondWithResult(_0x35565f,null))['catch'](handleError(_0x35565f,null));};exports[_0x70d6('0x49')]=function(_0x2fcfba,_0x3e4f4b){return db[_0x70d6('0x2e')][_0x70d6('0x49')](_0x2fcfba['body'],{})[_0x70d6('0x27')](respondWithResult(_0x3e4f4b,0xc9))[_0x70d6('0x4a')](handleError(_0x3e4f4b,null));};exports[_0x70d6('0x4b')]=function(_0x1e8434,_0x5aaaca){if(_0x1e8434['body']['id']){delete _0x1e8434[_0x70d6('0x4c')]['id'];}return db[_0x70d6('0x2e')][_0x70d6('0x48')]({'where':{'id':_0x1e8434[_0x70d6('0x47')]['id']}})['then'](handleEntityNotFound(_0x5aaaca,null))[_0x70d6('0x27')](saveUpdates(_0x1e8434[_0x70d6('0x4c')],null))['then'](respondWithResult(_0x5aaaca,null))[_0x70d6('0x4a')](handleError(_0x5aaaca,null));};exports[_0x70d6('0x4d')]=function(_0x3a7159,_0x181f1c){return db[_0x70d6('0x2e')]['find']({'where':{'id':_0x3a7159[_0x70d6('0x47')]['id']}})[_0x70d6('0x27')](handleEntityNotFound(_0x181f1c,null))['then'](removeEntity(_0x181f1c,null))['catch'](handleError(_0x181f1c,null));}; \ No newline at end of file +var _0xc5e2=['sendStatus','end','json','offset','undefined','count','limit','set','Content-Range','apply','update','then','destroy','error','stack','name','status','index','map','VoiceQueuesLog','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','rawAttributes','options','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb'];(function(_0x55a914,_0x13a716){var _0x59ce39=function(_0x54801d){while(--_0x54801d){_0x55a914['push'](_0x55a914['shift']());}};_0x59ce39(++_0x13a716);}(_0xc5e2,0x1ed));var _0x2c5e=function(_0x432516,_0x394339){_0x432516=_0x432516-0x0;var _0x4f52c9=_0xc5e2[_0x432516];return _0x4f52c9;};'use strict';var emlformat=require(_0x2c5e('0x0'));var rimraf=require(_0x2c5e('0x1'));var zipdir=require(_0x2c5e('0x2'));var jsonpatch=require(_0x2c5e('0x3'));var rp=require(_0x2c5e('0x4'));var moment=require(_0x2c5e('0x5'));var BPromise=require(_0x2c5e('0x6'));var Mustache=require(_0x2c5e('0x7'));var util=require('util');var path=require(_0x2c5e('0x8'));var sox=require(_0x2c5e('0x9'));var csv=require('to-csv');var ejs=require(_0x2c5e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2c5e('0xb'));var squel=require(_0x2c5e('0xc'));var crypto=require(_0x2c5e('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x2c5e('0xe'));var toCsv=require(_0x2c5e('0xf'));var querystring=require(_0x2c5e('0x10'));var Papa=require('papaparse');var Redis=require(_0x2c5e('0x11'));var authService=require(_0x2c5e('0x12'));var qs=require(_0x2c5e('0x13'));var as=require(_0x2c5e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2c5e('0x15'))(_0x2c5e('0x16'));var utils=require(_0x2c5e('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2c5e('0x18'))['db'];function respondWithStatusCode(_0x125e3d,_0xbad963){_0xbad963=_0xbad963||0xcc;return function(_0x405e6c){if(_0x405e6c){return _0x125e3d[_0x2c5e('0x19')](_0xbad963);}return _0x125e3d['status'](_0xbad963)[_0x2c5e('0x1a')]();};}function respondWithResult(_0x3e0771,_0x5ee79f){_0x5ee79f=_0x5ee79f||0xc8;return function(_0x22cecc){if(_0x22cecc){return _0x3e0771['status'](_0x5ee79f)[_0x2c5e('0x1b')](_0x22cecc);}};}function respondWithFilteredResult(_0x37fade,_0x509a6e){return function(_0x578137){if(_0x578137){var _0x5001a6=typeof _0x509a6e[_0x2c5e('0x1c')]===_0x2c5e('0x1d')&&typeof _0x509a6e['limit']===_0x2c5e('0x1d');var _0x298f11=_0x578137[_0x2c5e('0x1e')];var _0x578074=_0x5001a6?0x0:_0x509a6e[_0x2c5e('0x1c')];var _0x4f49ed=_0x5001a6?_0x578137[_0x2c5e('0x1e')]:_0x509a6e[_0x2c5e('0x1c')]+_0x509a6e[_0x2c5e('0x1f')];var _0x590b3c;if(_0x4f49ed>=_0x298f11){_0x4f49ed=_0x298f11;_0x590b3c=0xc8;}else{_0x590b3c=0xce;}_0x37fade['status'](_0x590b3c);return _0x37fade[_0x2c5e('0x20')](_0x2c5e('0x21'),_0x578074+'-'+_0x4f49ed+'/'+_0x298f11)[_0x2c5e('0x1b')](_0x578137);}return null;};}function patchUpdates(_0x27aab2){return function(_0x161d11){try{jsonpatch[_0x2c5e('0x22')](_0x161d11,_0x27aab2,!![]);}catch(_0x2f45f){return BPromise['reject'](_0x2f45f);}return _0x161d11['save']();};}function saveUpdates(_0x319f2e,_0x705c84){return function(_0x3656fe){if(_0x3656fe){return _0x3656fe[_0x2c5e('0x23')](_0x319f2e)[_0x2c5e('0x24')](function(_0x2d8d7b){return _0x2d8d7b;});}return null;};}function removeEntity(_0xa2fabd,_0x1b1676){return function(_0x2af009){if(_0x2af009){return _0x2af009[_0x2c5e('0x25')]()[_0x2c5e('0x24')](function(){_0xa2fabd['status'](0xcc)[_0x2c5e('0x1a')]();});}};}function handleEntityNotFound(_0x1c38b2,_0x303e64){return function(_0xf45bce){if(!_0xf45bce){_0x1c38b2['sendStatus'](0x194);}return _0xf45bce;};}function handleError(_0x46c2bb,_0x4b9155){_0x4b9155=_0x4b9155||0x1f4;return function(_0x25823e){logger[_0x2c5e('0x26')](_0x25823e[_0x2c5e('0x27')]);if(_0x25823e[_0x2c5e('0x28')]){delete _0x25823e['name'];}_0x46c2bb[_0x2c5e('0x29')](_0x4b9155)['send'](_0x25823e);};}exports[_0x2c5e('0x2a')]=function(_0x2cbf4,_0x2a9ad2){var _0x4782b8={},_0x54138b={},_0xd52739={'count':0x0,'rows':[]};var _0x1d5ff6=_[_0x2c5e('0x2b')](db[_0x2c5e('0x2c')]['rawAttributes'],function(_0x2f5e29){return{'name':_0x2f5e29[_0x2c5e('0x2d')],'type':_0x2f5e29[_0x2c5e('0x2e')][_0x2c5e('0x2f')]};});_0x54138b[_0x2c5e('0x30')]=_['map'](_0x1d5ff6,_0x2c5e('0x28'));_0x54138b[_0x2c5e('0x31')]=_[_0x2c5e('0x32')](_0x2cbf4[_0x2c5e('0x31')]);_0x54138b[_0x2c5e('0x33')]=_[_0x2c5e('0x34')](_0x54138b[_0x2c5e('0x30')],_0x54138b['query']);_0x4782b8[_0x2c5e('0x35')]=_[_0x2c5e('0x34')](_0x54138b[_0x2c5e('0x30')],qs['fields'](_0x2cbf4[_0x2c5e('0x31')][_0x2c5e('0x36')]));_0x4782b8[_0x2c5e('0x35')]=_0x4782b8['attributes'][_0x2c5e('0x37')]?_0x4782b8[_0x2c5e('0x35')]:_0x54138b[_0x2c5e('0x30')];if(!_0x2cbf4[_0x2c5e('0x31')][_0x2c5e('0x38')](_0x2c5e('0x39'))){_0x4782b8['limit']=qs[_0x2c5e('0x1f')](_0x2cbf4['query']['limit']);_0x4782b8['offset']=qs[_0x2c5e('0x1c')](_0x2cbf4[_0x2c5e('0x31')]['offset']);}_0x4782b8[_0x2c5e('0x3a')]=qs['sort'](_0x2cbf4[_0x2c5e('0x31')][_0x2c5e('0x3b')]);_0x4782b8[_0x2c5e('0x3c')]=qs['filters'](_['pick'](_0x2cbf4[_0x2c5e('0x31')],_0x54138b[_0x2c5e('0x33')]),_0x1d5ff6);if(_0x2cbf4[_0x2c5e('0x31')]['filter']){_0x4782b8[_0x2c5e('0x3c')]=_[_0x2c5e('0x3d')](_0x4782b8[_0x2c5e('0x3c')],{'$or':_[_0x2c5e('0x2b')](_0x1d5ff6,function(_0x15f2af){if(_0x15f2af[_0x2c5e('0x2e')]!==_0x2c5e('0x3e')){var _0x5f5760={};_0x5f5760[_0x15f2af['name']]={'$like':'%'+_0x2cbf4[_0x2c5e('0x31')]['filter']+'%'};return _0x5f5760;}})});}_0x4782b8=_[_0x2c5e('0x3d')]({},_0x4782b8,_0x2cbf4['options']);var _0x4cbdfd={'where':_0x4782b8[_0x2c5e('0x3c')]};return db['VoiceQueuesLog'][_0x2c5e('0x1e')](_0x4cbdfd)[_0x2c5e('0x24')](function(_0x68b223){_0xd52739['count']=_0x68b223;if(_0x2cbf4[_0x2c5e('0x31')][_0x2c5e('0x3f')]){_0x4782b8[_0x2c5e('0x40')]=[{'all':!![]}];}return db[_0x2c5e('0x2c')][_0x2c5e('0x41')](_0x4782b8);})[_0x2c5e('0x24')](function(_0x5961a6){_0xd52739['rows']=_0x5961a6;return _0xd52739;})[_0x2c5e('0x24')](respondWithFilteredResult(_0x2a9ad2,_0x4782b8))[_0x2c5e('0x42')](handleError(_0x2a9ad2,null));};exports[_0x2c5e('0x43')]=function(_0x4aca98,_0x3df10b){var _0x2eddf8={'raw':!![],'where':{'id':_0x4aca98[_0x2c5e('0x44')]['id']}},_0x4bc41b={};_0x4bc41b[_0x2c5e('0x30')]=_['keys'](db[_0x2c5e('0x2c')][_0x2c5e('0x45')]);_0x4bc41b['query']=_[_0x2c5e('0x32')](_0x4aca98['query']);_0x4bc41b[_0x2c5e('0x33')]=_['intersection'](_0x4bc41b[_0x2c5e('0x30')],_0x4bc41b[_0x2c5e('0x31')]);_0x2eddf8[_0x2c5e('0x35')]=_['intersection'](_0x4bc41b[_0x2c5e('0x30')],qs[_0x2c5e('0x36')](_0x4aca98[_0x2c5e('0x31')][_0x2c5e('0x36')]));_0x2eddf8[_0x2c5e('0x35')]=_0x2eddf8[_0x2c5e('0x35')][_0x2c5e('0x37')]?_0x2eddf8[_0x2c5e('0x35')]:_0x4bc41b[_0x2c5e('0x30')];if(_0x4aca98[_0x2c5e('0x31')][_0x2c5e('0x3f')]){_0x2eddf8['include']=[{'all':!![]}];}_0x2eddf8=_['merge']({},_0x2eddf8,_0x4aca98[_0x2c5e('0x46')]);return db['VoiceQueuesLog']['find'](_0x2eddf8)['then'](handleEntityNotFound(_0x3df10b,null))[_0x2c5e('0x24')](respondWithResult(_0x3df10b,null))[_0x2c5e('0x42')](handleError(_0x3df10b,null));};exports[_0x2c5e('0x47')]=function(_0x5d9e62,_0x685a05){return db[_0x2c5e('0x2c')][_0x2c5e('0x47')](_0x5d9e62[_0x2c5e('0x48')],{})['then'](respondWithResult(_0x685a05,0xc9))[_0x2c5e('0x42')](handleError(_0x685a05,null));};exports[_0x2c5e('0x23')]=function(_0x52acba,_0x3e6fa9){if(_0x52acba['body']['id']){delete _0x52acba['body']['id'];}return db['VoiceQueuesLog'][_0x2c5e('0x49')]({'where':{'id':_0x52acba['params']['id']}})[_0x2c5e('0x24')](handleEntityNotFound(_0x3e6fa9,null))[_0x2c5e('0x24')](saveUpdates(_0x52acba[_0x2c5e('0x48')],null))[_0x2c5e('0x24')](respondWithResult(_0x3e6fa9,null))[_0x2c5e('0x42')](handleError(_0x3e6fa9,null));};exports[_0x2c5e('0x25')]=function(_0x287d8c,_0x3b4709){return db[_0x2c5e('0x2c')][_0x2c5e('0x49')]({'where':{'id':_0x287d8c[_0x2c5e('0x44')]['id']}})['then'](handleEntityNotFound(_0x3b4709,null))[_0x2c5e('0x24')](removeEntity(_0x3b4709,null))[_0x2c5e('0x42')](handleError(_0x3b4709,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index a565f92..b869ce7 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 _0x393e=['VoiceQueuesLog','voice_queues_log','event_dtm','event','dtm','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','define'];(function(_0x2a4a1c,_0x5e944d){var _0x454433=function(_0x3d88ec){while(--_0x3d88ec){_0x2a4a1c['push'](_0x2a4a1c['shift']());}};_0x454433(++_0x5e944d);}(_0x393e,0x105));var _0xe393=function(_0x35885a,_0x42fed7){_0x35885a=_0x35885a-0x0;var _0xe86249=_0x393e[_0x35885a];return _0xe86249;};'use strict';var _=require(_0xe393('0x0'));var util=require(_0xe393('0x1'));var logger=require(_0xe393('0x2'))('api');var moment=require('moment');var BPromise=require(_0xe393('0x3'));var rp=require(_0xe393('0x4'));var fs=require('fs');var path=require(_0xe393('0x5'));var rimraf=require(_0xe393('0x6'));var config=require(_0xe393('0x7'));var attributes=require(_0xe393('0x8'));module[_0xe393('0x9')]=function(_0x5a5dde,_0xb59a16){return _0x5a5dde[_0xe393('0xa')](_0xe393('0xb'),attributes,{'tableName':_0xe393('0xc'),'paranoid':![],'indexes':[{'name':_0xe393('0xd'),'fields':[_0xe393('0xe'),_0xe393('0xf')]}],'timestamps':![]});}; \ No newline at end of file +var _0x5f7b=['define','VoiceQueuesLog','event_dtm','event','dtm','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueuesLog.attributes'];(function(_0x2d138a,_0x38524c){var _0x1c13e9=function(_0x342d00){while(--_0x342d00){_0x2d138a['push'](_0x2d138a['shift']());}};_0x1c13e9(++_0x38524c);}(_0x5f7b,0x104));var _0xb5f7=function(_0x2aea9e,_0x1f587f){_0x2aea9e=_0x2aea9e-0x0;var _0x430b92=_0x5f7b[_0x2aea9e];return _0x430b92;};'use strict';var _=require(_0xb5f7('0x0'));var util=require(_0xb5f7('0x1'));var logger=require(_0xb5f7('0x2'))('api');var moment=require(_0xb5f7('0x3'));var BPromise=require(_0xb5f7('0x4'));var rp=require(_0xb5f7('0x5'));var fs=require('fs');var path=require(_0xb5f7('0x6'));var rimraf=require(_0xb5f7('0x7'));var config=require(_0xb5f7('0x8'));var attributes=require(_0xb5f7('0x9'));module['exports']=function(_0x3007ac,_0xf37959){return _0x3007ac[_0xb5f7('0xa')](_0xb5f7('0xb'),attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':_0xb5f7('0xc'),'fields':[_0xb5f7('0xd'),_0xb5f7('0xe')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 09077aa..c6ded7c 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 _0x345e=['request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','VoiceQueuesLog,\x20%s,\x20%s'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0x345e,0x168));var _0xe345=function(_0x505099,_0xb10ee1){_0x505099=_0x505099-0x0;var _0x577eba=_0x345e[_0x505099];return _0x577eba;};'use strict';var _=require(_0xe345('0x0'));var util=require(_0xe345('0x1'));var moment=require('moment');var BPromise=require(_0xe345('0x2'));var rs=require(_0xe345('0x3'));var fs=require('fs');var Redis=require(_0xe345('0x4'));var db=require(_0xe345('0x5'))['db'];var utils=require(_0xe345('0x6'));var logger=require(_0xe345('0x7'))(_0xe345('0x8'));var config=require(_0xe345('0x9'));var jayson=require(_0xe345('0xa'));var client=jayson['client'][_0xe345('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x38cc87,_0x27fc55,_0x246b2f){return new BPromise(function(_0x24f14f,_0x18f9a3){return client['request'](_0x38cc87,_0x246b2f)['then'](function(_0x41bd55){logger[_0xe345('0xc')](_0xe345('0xd'),_0x27fc55,_0xe345('0xe'));logger[_0xe345('0xf')](_0xe345('0x10'),_0x27fc55,_0xe345('0xe'),JSON[_0xe345('0x11')](_0x41bd55));if(_0x41bd55[_0xe345('0x12')]){if(_0x41bd55[_0xe345('0x12')]['code']===0x1f4){logger[_0xe345('0x12')](_0xe345('0xd'),_0x27fc55,_0x41bd55['error']['message']);return _0x18f9a3(_0x41bd55[_0xe345('0x12')]['message']);}logger[_0xe345('0x12')]('VoiceQueuesLog,\x20%s,\x20%s',_0x27fc55,_0x41bd55['error'][_0xe345('0x13')]);return _0x24f14f(_0x41bd55[_0xe345('0x12')][_0xe345('0x13')]);}else{logger[_0xe345('0xc')](_0xe345('0xd'),_0x27fc55,_0xe345('0xe'));_0x24f14f(_0x41bd55[_0xe345('0x14')][_0xe345('0x13')]);}})[_0xe345('0x15')](function(_0x1f983c){logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0x27fc55,_0x1f983c);_0x18f9a3(_0x1f983c);});});} \ No newline at end of file +var _0x50c3=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','lodash','util','moment'];(function(_0x147232,_0xf9894d){var _0x3ef0e8=function(_0x5893fe){while(--_0x5893fe){_0x147232['push'](_0x147232['shift']());}};_0x3ef0e8(++_0xf9894d);}(_0x50c3,0x81));var _0x350c=function(_0x345fbb,_0x44d54a){_0x345fbb=_0x345fbb-0x0;var _0xa0e3de=_0x50c3[_0x345fbb];return _0xa0e3de;};'use strict';var _=require(_0x350c('0x0'));var util=require(_0x350c('0x1'));var moment=require(_0x350c('0x2'));var BPromise=require(_0x350c('0x3'));var rs=require(_0x350c('0x4'));var fs=require('fs');var Redis=require(_0x350c('0x5'));var db=require(_0x350c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x350c('0x7'))(_0x350c('0x8'));var config=require(_0x350c('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x350c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4028b2,_0x737ae1,_0x1f1500){return new BPromise(function(_0x1b9758,_0x3bc4c7){return client[_0x350c('0xb')](_0x4028b2,_0x1f1500)[_0x350c('0xc')](function(_0x40fb2c){logger['info'](_0x350c('0xd'),_0x737ae1,_0x350c('0xe'));logger[_0x350c('0xf')]('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x737ae1,'request\x20sent',JSON['stringify'](_0x40fb2c));if(_0x40fb2c[_0x350c('0x10')]){if(_0x40fb2c[_0x350c('0x10')][_0x350c('0x11')]===0x1f4){logger['error'](_0x350c('0xd'),_0x737ae1,_0x40fb2c[_0x350c('0x10')][_0x350c('0x12')]);return _0x3bc4c7(_0x40fb2c[_0x350c('0x10')][_0x350c('0x12')]);}logger['error'](_0x350c('0xd'),_0x737ae1,_0x40fb2c['error'][_0x350c('0x12')]);return _0x1b9758(_0x40fb2c['error'][_0x350c('0x12')]);}else{logger[_0x350c('0x13')](_0x350c('0xd'),_0x737ae1,_0x350c('0xe'));_0x1b9758(_0x40fb2c[_0x350c('0x14')][_0x350c('0x12')]);}})[_0x350c('0x15')](function(_0x123a48){logger[_0x350c('0x10')](_0x350c('0xd'),_0x737ae1,_0x123a48);_0x3bc4c7(_0x123a48);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index f92d40b..26a2dab 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 _0x03e0=['isAuthenticated','index','get','/describe','/:id','/:id/download','/:id/downloads','downloads','/:id/transcribe','post','create','runTranscribe','put','delete','destroy','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller'];(function(_0x29d6e4,_0x409686){var _0x1cf540=function(_0x4eff2c){while(--_0x4eff2c){_0x29d6e4['push'](_0x29d6e4['shift']());}};_0x1cf540(++_0x409686);}(_0x03e0,0x1bf));var _0x003e=function(_0x1fb3f2,_0x1eacf4){_0x1fb3f2=_0x1fb3f2-0x0;var _0x220105=_0x03e0[_0x1fb3f2];return _0x220105;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x003e('0x0'));var timeout=require(_0x003e('0x1'));var express=require(_0x003e('0x2'));var router=express[_0x003e('0x3')]();var fs_extra=require(_0x003e('0x4'));var auth=require(_0x003e('0x5'));var interaction=require(_0x003e('0x6'));var config=require(_0x003e('0x7'));var controller=require(_0x003e('0x8'));router['get']('/',auth[_0x003e('0x9')](),controller[_0x003e('0xa')]);router[_0x003e('0xb')](_0x003e('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x003e('0xb')](_0x003e('0xd'),auth[_0x003e('0x9')](),controller['show']);router[_0x003e('0xb')](_0x003e('0xe'),auth[_0x003e('0x9')](),controller['download']);router['get'](_0x003e('0xf'),controller[_0x003e('0x10')]);router['get'](_0x003e('0x11'),auth[_0x003e('0x9')](),controller['downloadTranscribe']);router[_0x003e('0x12')]('/',auth[_0x003e('0x9')](),controller[_0x003e('0x13')]);router[_0x003e('0x12')](_0x003e('0x11'),auth[_0x003e('0x9')](),controller[_0x003e('0x14')]);router[_0x003e('0x15')](_0x003e('0xd'),auth[_0x003e('0x9')](),controller['update']);router[_0x003e('0x16')](_0x003e('0xd'),auth[_0x003e('0x9')](),controller[_0x003e('0x17')]);module['exports']=router; \ No newline at end of file +var _0xa17e=['../../config/environment','./voiceRecording.controller','get','index','/describe','isAuthenticated','describe','/:id','show','download','/:id/downloads','/:id/transcribe','downloadTranscribe','create','post','runTranscribe','put','delete','destroy','exports','multer','connect-timeout','fs-extra','../../components/interaction/service'];(function(_0x381589,_0x27a707){var _0x2a075d=function(_0x4ea19d){while(--_0x4ea19d){_0x381589['push'](_0x381589['shift']());}};_0x2a075d(++_0x27a707);}(_0xa17e,0x14c));var _0xea17=function(_0x1cc768,_0x5c2ce7){_0x1cc768=_0x1cc768-0x0;var _0x4d3b6e=_0xa17e[_0x1cc768];return _0x4d3b6e;};'use strict';var multer=require(_0xea17('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xea17('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xea17('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xea17('0x3'));var config=require(_0xea17('0x4'));var controller=require(_0xea17('0x5'));router[_0xea17('0x6')]('/',auth['isAuthenticated'](),controller[_0xea17('0x7')]);router[_0xea17('0x6')](_0xea17('0x8'),auth[_0xea17('0x9')](),controller[_0xea17('0xa')]);router[_0xea17('0x6')](_0xea17('0xb'),auth[_0xea17('0x9')](),controller[_0xea17('0xc')]);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0xea17('0xd')]);router[_0xea17('0x6')](_0xea17('0xe'),controller['downloads']);router[_0xea17('0x6')](_0xea17('0xf'),auth[_0xea17('0x9')](),controller[_0xea17('0x10')]);router['post']('/',auth[_0xea17('0x9')](),controller[_0xea17('0x11')]);router[_0xea17('0x12')]('/:id/transcribe',auth[_0xea17('0x9')](),controller[_0xea17('0x13')]);router[_0xea17('0x14')](_0xea17('0xb'),auth[_0xea17('0x9')](),controller['update']);router[_0xea17('0x15')](_0xea17('0xb'),auth[_0xea17('0x9')](),controller[_0xea17('0x16')]);module[_0xea17('0x17')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 5d6cdfd..2f21f73 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(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa9e0[_0x4ea69d];return _0x5318e0;};'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(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'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 4d8bd12..81a0e5e 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 _0x855e=['reject','then','destroy','sendStatus','error','stack','name','send','index','map','VoiceRecording','rawAttributes','fieldName','key','model','differenceBy','format','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','type','filter','options','includeAll','include','findAll','catch','show','params','merge','find','create','body','update','download','../../components/encryptor','uniqueid','value','existsSync','decryptFile','secrets','recording','VoiceRecording\x20not\x20found','extname','unlink','message','Not\x20found','downloads','sequelize','MD5','$and','push','Sequelize','filename','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','listBuckets','createBucket','upload','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJobName','transcribeName','TranscriptionJob','transcribeStatus','runTranscribe','findOne','%s.cypher','ValidationError','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','runSentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','IN_PROGRESS','tempSentiment','updateAttributes','writeFile','fileText','root','/server/files/transcribes/transcribe_','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','aws-sdk','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','apply'];(function(_0x3ed127,_0x21cd4b){var _0x36b744=function(_0x146d60){while(--_0x146d60){_0x3ed127['push'](_0x3ed127['shift']());}};_0x36b744(++_0x21cd4b);}(_0x855e,0x78));var _0xe855=function(_0x203c05,_0x584521){_0x203c05=_0x203c05-0x0;var _0x43a504=_0x855e[_0x203c05];return _0x43a504;};'use strict';var emlformat=require(_0xe855('0x0'));var rimraf=require(_0xe855('0x1'));var zipdir=require(_0xe855('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe855('0x3'));var moment=require(_0xe855('0x4'));var BPromise=require(_0xe855('0x5'));var Mustache=require(_0xe855('0x6'));var util=require(_0xe855('0x7'));var path=require('path');var sox=require(_0xe855('0x8'));var csv=require(_0xe855('0x9'));var ejs=require(_0xe855('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xe855('0xb'));var crypto=require(_0xe855('0xc'));var jsforce=require(_0xe855('0xd'));var deskjs=require(_0xe855('0xe'));var toCsv=require(_0xe855('0x9'));var querystring=require(_0xe855('0xf'));var Papa=require(_0xe855('0x10'));var AWS=require(_0xe855('0x11'));var uuidv4=require(_0xe855('0x12'));var Redis=require(_0xe855('0x13'));var authService=require(_0xe855('0x14'));var qs=require(_0xe855('0x15'));var as=require(_0xe855('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe855('0x17'))(_0xe855('0x18'));var utils=require('../../config/utils');var config=require(_0xe855('0x19'));var licenseUtil=require(_0xe855('0x1a'));var db=require(_0xe855('0x1b'))['db'];function respondWithStatusCode(_0x140b2b,_0x5f4725){_0x5f4725=_0x5f4725||0xcc;return function(_0x28432d){if(_0x28432d){return _0x140b2b['sendStatus'](_0x5f4725);}return _0x140b2b[_0xe855('0x1c')](_0x5f4725)[_0xe855('0x1d')]();};}function respondWithResult(_0x25263c,_0x5c38db){_0x5c38db=_0x5c38db||0xc8;return function(_0x4c0a54){if(_0x4c0a54){return _0x25263c[_0xe855('0x1c')](_0x5c38db)[_0xe855('0x1e')](_0x4c0a54);}};}function respondWithFilteredResult(_0x5b09f9,_0x37a866){return function(_0x9c12f8){if(_0x9c12f8){var _0x45a0b9=typeof _0x37a866[_0xe855('0x1f')]==='undefined'&&typeof _0x37a866[_0xe855('0x20')]===_0xe855('0x21');var _0x1e0b6f=_0x9c12f8['count'];var _0x4d98c1=_0x45a0b9?0x0:_0x37a866[_0xe855('0x1f')];var _0x385564=_0x45a0b9?_0x9c12f8[_0xe855('0x22')]:_0x37a866[_0xe855('0x1f')]+_0x37a866[_0xe855('0x20')];var _0x591677;if(_0x385564>=_0x1e0b6f){_0x385564=_0x1e0b6f;_0x591677=0xc8;}else{_0x591677=0xce;}_0x5b09f9['status'](_0x591677);return _0x5b09f9[_0xe855('0x23')](_0xe855('0x24'),_0x4d98c1+'-'+_0x385564+'/'+_0x1e0b6f)[_0xe855('0x1e')](_0x9c12f8);}return null;};}function patchUpdates(_0x935741){return function(_0x92e805){try{jsonpatch[_0xe855('0x25')](_0x92e805,_0x935741,!![]);}catch(_0x24d34f){return BPromise[_0xe855('0x26')](_0x24d34f);}return _0x92e805['save']();};}function saveUpdates(_0x1b0000,_0x12cb09){return function(_0x419025){if(_0x419025){return _0x419025['update'](_0x1b0000)[_0xe855('0x27')](function(_0x48a8ac){return _0x48a8ac;});}return null;};}function removeEntity(_0x29f00e,_0x134c3f){return function(_0x5dee59){if(_0x5dee59){return _0x5dee59[_0xe855('0x28')]()[_0xe855('0x27')](function(){_0x29f00e[_0xe855('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x482ef4,_0x1ad1f5){return function(_0x17d729){if(!_0x17d729){_0x482ef4[_0xe855('0x29')](0x194);}return _0x17d729;};}function handleError(_0x3b0211,_0x3cf077){_0x3cf077=_0x3cf077||0x1f4;return function(_0x3fcd2c){logger[_0xe855('0x2a')](_0x3fcd2c[_0xe855('0x2b')]);if(_0x3fcd2c['name']){delete _0x3fcd2c[_0xe855('0x2c')];}_0x3b0211[_0xe855('0x1c')](_0x3cf077)[_0xe855('0x2d')](_0x3fcd2c);};}exports[_0xe855('0x2e')]=function(_0x369844,_0x4b0a62){var _0x3c1418={},_0x449957={},_0x10aeaf={'count':0x0,'rows':[]};var _0x280bcd=_[_0xe855('0x2f')](db[_0xe855('0x30')][_0xe855('0x31')],function(_0x9eb663){return{'name':_0x9eb663[_0xe855('0x32')],'type':_0x9eb663['type'][_0xe855('0x33')]};});_0x449957[_0xe855('0x34')]=_[_0xe855('0x35')](_[_0xe855('0x2f')](_0x280bcd,'name'),[_0xe855('0x36')]);_0x449957[_0xe855('0x37')]=_[_0xe855('0x38')](_0x369844[_0xe855('0x37')]);_0x449957[_0xe855('0x39')]=_[_0xe855('0x3a')](_0x449957['model'],_0x449957[_0xe855('0x37')]);_0x3c1418[_0xe855('0x3b')]=_['intersection'](_0x449957[_0xe855('0x34')],qs[_0xe855('0x3c')](_0x369844[_0xe855('0x37')][_0xe855('0x3c')]));_0x3c1418[_0xe855('0x3b')]=_0x3c1418[_0xe855('0x3b')][_0xe855('0x3d')]?_0x3c1418[_0xe855('0x3b')]:_0x449957[_0xe855('0x34')];if(!_0x369844[_0xe855('0x37')][_0xe855('0x3e')](_0xe855('0x3f'))){_0x3c1418['limit']=qs[_0xe855('0x20')](_0x369844['query']['limit']);_0x3c1418['offset']=qs[_0xe855('0x1f')](_0x369844[_0xe855('0x37')][_0xe855('0x1f')]);}_0x3c1418[_0xe855('0x40')]=qs[_0xe855('0x41')](_0x369844['query'][_0xe855('0x41')]);_0x3c1418['where']=qs[_0xe855('0x39')](_['pick'](_0x369844[_0xe855('0x37')],_0x449957[_0xe855('0x39')]),_0x280bcd);if(_0x369844[_0xe855('0x37')]['filter']){_0x3c1418[_0xe855('0x42')]=_['merge'](_0x3c1418[_0xe855('0x42')],{'$or':_[_0xe855('0x2f')](_0x280bcd,function(_0x4fcf82){if(_0x4fcf82[_0xe855('0x43')]!=='VIRTUAL'){var _0x38001a={};_0x38001a[_0x4fcf82['name']]={'$like':'%'+_0x369844[_0xe855('0x37')][_0xe855('0x44')]+'%'};return _0x38001a;}})});}_0x3c1418=_['merge']({},_0x3c1418,_0x369844[_0xe855('0x45')]);var _0x2f1887={'where':_0x3c1418[_0xe855('0x42')]};return db[_0xe855('0x30')][_0xe855('0x22')](_0x2f1887)[_0xe855('0x27')](function(_0x42c410){_0x10aeaf[_0xe855('0x22')]=_0x42c410;if(_0x369844[_0xe855('0x37')][_0xe855('0x46')]){_0x3c1418[_0xe855('0x47')]=[{'all':!![]}];}return db[_0xe855('0x30')][_0xe855('0x48')](_0x3c1418);})[_0xe855('0x27')](function(_0x271780){_0x10aeaf['rows']=_0x271780;return _0x10aeaf;})[_0xe855('0x27')](respondWithFilteredResult(_0x4b0a62,_0x3c1418))[_0xe855('0x49')](handleError(_0x4b0a62,null));};exports[_0xe855('0x4a')]=function(_0x2a3797,_0x3e2fb0){var _0x16a24c={'raw':![],'where':{'id':_0x2a3797[_0xe855('0x4b')]['id']}},_0xc30ea6={};_0xc30ea6[_0xe855('0x34')]=_[_0xe855('0x38')](db[_0xe855('0x30')][_0xe855('0x31')]);_0xc30ea6[_0xe855('0x37')]=_[_0xe855('0x38')](_0x2a3797['query']);_0xc30ea6[_0xe855('0x39')]=_['intersection'](_0xc30ea6[_0xe855('0x34')],_0xc30ea6[_0xe855('0x37')]);_0x16a24c[_0xe855('0x3b')]=_['intersection'](_0xc30ea6[_0xe855('0x34')],qs[_0xe855('0x3c')](_0x2a3797[_0xe855('0x37')]['fields']));_0x16a24c['attributes']=_0x16a24c[_0xe855('0x3b')][_0xe855('0x3d')]?_0x16a24c[_0xe855('0x3b')]:_0xc30ea6[_0xe855('0x34')];if(_0x2a3797[_0xe855('0x37')][_0xe855('0x46')]){_0x16a24c[_0xe855('0x47')]=[{'all':!![]}];}_0x16a24c=_[_0xe855('0x4c')]({},_0x16a24c,_0x2a3797[_0xe855('0x45')]);return db[_0xe855('0x30')][_0xe855('0x4d')](_0x16a24c)[_0xe855('0x27')](handleEntityNotFound(_0x3e2fb0,null))[_0xe855('0x27')](respondWithResult(_0x3e2fb0,null))[_0xe855('0x49')](handleError(_0x3e2fb0,null));};exports[_0xe855('0x4e')]=function(_0x3003e0,_0x29beee){return db[_0xe855('0x30')]['create'](_0x3003e0[_0xe855('0x4f')],{})[_0xe855('0x27')](respondWithResult(_0x29beee,0xc9))['catch'](handleError(_0x29beee,null));};exports[_0xe855('0x50')]=function(_0xb0a368,_0x5a3301){if(_0xb0a368[_0xe855('0x4f')]['id']){delete _0xb0a368[_0xe855('0x4f')]['id'];}return db[_0xe855('0x30')][_0xe855('0x4d')]({'where':{'id':_0xb0a368[_0xe855('0x4b')]['id']}})[_0xe855('0x27')](handleEntityNotFound(_0x5a3301,null))['then'](saveUpdates(_0xb0a368[_0xe855('0x4f')],null))['then'](respondWithResult(_0x5a3301,null))['catch'](handleError(_0x5a3301,null));};exports['describe']=function(_0x4c3270,_0x3529f0){return db[_0xe855('0x30')]['describe']()[_0xe855('0x27')](respondWithResult(_0x3529f0,null))['catch'](handleError(_0x3529f0,null));};exports[_0xe855('0x51')]=function(_0x53bc51,_0x439a02,_0x5c5d51){var _0x294834=require(_0xe855('0x52'));var _0x257e51=![];var _0x5c8f98={};if(_0x53bc51[_0xe855('0x37')]['type']&&_0x53bc51[_0xe855('0x37')]['type']===_0xe855('0x53')){_0x5c8f98[_0xe855('0x53')]=_0x53bc51[_0xe855('0x4b')]['id'];}else{_0x5c8f98['id']=_0x53bc51[_0xe855('0x4b')]['id'];}return db[_0xe855('0x30')][_0xe855('0x4d')]({'where':_0x5c8f98,'attributes':['id',_0xe855('0x54')],'raw':!![]})[_0xe855('0x27')](handleEntityNotFound(_0x439a02,null))['then'](function(_0x1cbe58){if(_0x1cbe58){var _0x2dcb30=_0x1cbe58[_0xe855('0x54')];var _0x798ae8=util[_0xe855('0x36')]('%s.cypher',_0x2dcb30);if(fs[_0xe855('0x55')](_0x798ae8)){_0x257e51=!![];return _0x294834[_0xe855('0x56')](_0x798ae8,_0x2dcb30,config[_0xe855('0x57')][_0xe855('0x58')])[_0xe855('0x27')](function(){return _0x1cbe58;});}return _0x1cbe58;}})['then'](function(_0x65cedf){if(_0x65cedf){var _0x6b1731=_0x65cedf[_0xe855('0x54')];if(!fs[_0xe855('0x55')](_0x6b1731)){throw new db['Sequelize']['ValidationError'](_0xe855('0x59'));}if(_0x65cedf['filename']){return _0x439a02[_0xe855('0x51')](_0x6b1731,_0x65cedf['filename']+path[_0xe855('0x5a')](_0x6b1731),function(){if(_0x257e51){fs[_0xe855('0x5b')](_0x6b1731);}});}else{return _0x439a02[_0xe855('0x51')](_0x6b1731,function(_0x1ff7b4){if(_0x257e51){fs['unlink'](_0x6b1731);}});}}})[_0xe855('0x49')](function(_0x2dbfb7){if(_0x2dbfb7[_0xe855('0x5c')]===_0xe855('0x59')){_0x439a02[_0xe855('0x1c')](0x194)[_0xe855('0x2d')](_0xe855('0x5d'));}else{return handleError(_0x439a02,null);}});};exports[_0xe855('0x5e')]=function(_0x47aa11,_0x50d060,_0x783867){var _0xf721ec=require('../../components/encryptor');var _0x7d63e=![];var _0x4eba43={'$and':[db[_0xe855('0x5f')][_0xe855('0x42')](db['sequelize']['fn'](_0xe855('0x60'),db['sequelize']['col'](_0xe855('0x53'))),_0x47aa11[_0xe855('0x37')]['token'])]};if(_0x47aa11[_0xe855('0x37')][_0xe855('0x43')]&&_0x47aa11[_0xe855('0x37')][_0xe855('0x43')]===_0xe855('0x53')){_0x4eba43[_0xe855('0x61')]['push']({'uniqueid':_0x47aa11['params']['id']});}else{_0x4eba43[_0xe855('0x61')][_0xe855('0x62')]({'id':_0x47aa11[_0xe855('0x4b')]['id']});}return db[_0xe855('0x30')][_0xe855('0x4d')]({'where':_0x4eba43,'attributes':['id','value'],'raw':!![]})[_0xe855('0x27')](handleEntityNotFound(_0x50d060,null))[_0xe855('0x27')](function(_0x1f735f){if(_0x1f735f){var _0x2004ef=util[_0xe855('0x36')]('%s.cypher',_0x1f735f[_0xe855('0x54')]);if(fs[_0xe855('0x55')](_0x2004ef)){_0x7d63e=!![];return _0xf721ec[_0xe855('0x56')](_0x2004ef,_0x1f735f['value'],config[_0xe855('0x57')]['recording'])[_0xe855('0x27')](function(){return _0x1f735f;});}return _0x1f735f;}})['then'](function(_0x570bfc){if(_0x570bfc){if(!fs[_0xe855('0x55')](_0x570bfc['value'])){throw new db[(_0xe855('0x63'))]['ValidationError'](_0xe855('0x59'));}if(_0x570bfc[_0xe855('0x64')]){return _0x50d060['download'](_0x570bfc[_0xe855('0x54')],_0x570bfc['filename']+path['extname'](_0x570bfc[_0xe855('0x54')]),function(){if(_0x7d63e){fs[_0xe855('0x5b')](_0x570bfc[_0xe855('0x54')]);}});}else{return _0x50d060[_0xe855('0x51')](_0x570bfc[_0xe855('0x54')],function(_0x23e8de){if(_0x7d63e){fs[_0xe855('0x5b')](_0x570bfc[_0xe855('0x54')]);}});}}})[_0xe855('0x49')](handleError(_0x50d060,null));};exports[_0xe855('0x28')]=function(_0x35b936,_0x468556){return db[_0xe855('0x30')][_0xe855('0x4d')]({'where':{'id':_0x35b936[_0xe855('0x4b')]['id']}})[_0xe855('0x27')](function(_0x3e6a5b){if(_[_0xe855('0x65')](_0x3e6a5b)){throw new ReferenceError(_0xe855('0x66'));}return _0x3e6a5b;})[_0xe855('0x27')](function(_0x228ed7){var _0x74fed3=_0x228ed7[_0xe855('0x54')];logger[_0xe855('0x67')](_0xe855('0x68'),_0x74fed3);if(!_['isNil'](_0x228ed7['value'])&&fs[_0xe855('0x55')](_0x74fed3)){logger[_0xe855('0x67')](_0xe855('0x69')+_0x74fed3+_0xe855('0x6a'));fs['unlinkSync'](_0x74fed3);}_0x74fed3=_0x74fed3+_0xe855('0x6b');if(!_['isNil'](_0x228ed7['value'])&&fs[_0xe855('0x55')](_0x74fed3)){logger[_0xe855('0x67')](_0xe855('0x69')+_0x74fed3+_0xe855('0x6a'));fs[_0xe855('0x6c')](_0x74fed3);}return _0x228ed7;})[_0xe855('0x27')](function(_0x1d3d27){if(!_0x1d3d27)throw new InternalError();return _0x1d3d27[_0xe855('0x28')]();})['then'](function(){_0x468556[_0xe855('0x1c')](0xcc)['end']();})[_0xe855('0x49')](handleError(_0x468556,null));};function getBucketslist(_0x4091d0,_0x4e803a,_0x561c68){return new Promise(function(_0x41a4bf,_0x39ea87){var _0x658b0d=new AWS['S3']({'accessKeyId':_0x4e803a,'secretAccessKey':_0x4091d0,'region':_0x561c68});_0x658b0d[_0xe855('0x6d')]({},function(_0x183718,_0x328cb0){if(_0x183718){return _0x39ea87(_0x183718);}else{return _0x41a4bf(_0x328cb0);}});});}function createBucket(_0x5987cd,_0x43d54f,_0x524ec6,_0x2aa2f8){return new Promise(function(_0x1aa154,_0x485363){var _0x50c13b=new AWS['S3']({'accessKeyId':_0x43d54f,'secretAccessKey':_0x5987cd,'region':_0x524ec6});_0x50c13b[_0xe855('0x6e')]({'Bucket':_0x2aa2f8},function(_0x20241b,_0x24eba8){if(_0x20241b){return _0x485363(_0x20241b);}else{return _0x1aa154(_0x24eba8);}});});}function uploadFile(_0x2430ba,_0x5d0b22,_0x1ff3e2,_0x32e71d,_0x2ac3a4,_0x3b65aa){return new Promise(function(_0x69de53,_0x17ba20){var _0x47155e=new AWS['S3']({'accessKeyId':_0x5d0b22,'secretAccessKey':_0x2430ba,'region':_0x1ff3e2});_0x47155e[_0xe855('0x6f')]({'Bucket':_0x32e71d,'Key':_0x2ac3a4,'Body':_0x3b65aa},function(_0x3a64db,_0x86b3d6){if(_0x3a64db){return _0x17ba20(_0x3a64db);}else{return _0x69de53(_0x86b3d6);}});});}function startTranscribe(_0x763309,_0x53e7a6,_0x3a48cc,_0x4f4b5f,_0x37914a,_0x4db09f){return new Promise(function(_0x521e71,_0x51e606){var _0x31167b=new AWS['TranscribeService']({'accessKeyId':_0x53e7a6,'secretAccessKey':_0x763309,'region':_0x3a48cc});_0x31167b[_0xe855('0x70')]({'TranscriptionJobName':_0x4f4b5f,'LanguageCode':_0x37914a,'Media':{'MediaFileUri':_0x4db09f}},function(_0x26f586,_0x3b5308){if(_0x26f586){return _0x51e606(_0x26f586);}else{return _0x521e71(_0x3b5308);}});});}function transcribe(_0x4e2582,_0x290dc1,_0x4579fb,_0x4a5fd6,_0x2cbd32,_0xc4a564,_0x4ec205){return new Promise(function(_0x8ad7a3,_0x4e9838){var _0x12d410={};logger[_0xe855('0x67')](util[_0xe855('0x36')](_0xe855('0x71'),_0x4e2582,_0x2cbd32));return uploadFile(_0x290dc1,_0x4579fb,_0x4a5fd6,_0x2cbd32,path[_0xe855('0x72')](_0xc4a564),fs['readFileSync'](_0xc4a564))['then'](function(_0x469702){logger['info'](util[_0xe855('0x36')](_0xe855('0x73'),_0x4e2582,_0x2cbd32,_0x469702[_0xe855('0x74')]));_0x12d410[_0xe855('0x75')]=_0x469702[_0xe855('0x76')];_0x12d410[_0xe855('0x77')]=_0x469702[_0xe855('0x74')];logger['info'](util[_0xe855('0x36')](_0xe855('0x78'),_0x4e2582));return startTranscribe(_0x290dc1,_0x4579fb,_0x4a5fd6,uuidv4(),_0x4ec205,_0x469702[_0xe855('0x74')]);})[_0xe855('0x27')](function(_0x4c04b0){logger[_0xe855('0x67')](util[_0xe855('0x36')](_0xe855('0x79'),_0x4e2582,_0x4c04b0['TranscriptionJob'][_0xe855('0x7a')]));_0x12d410[_0xe855('0x7b')]=_0x4c04b0[_0xe855('0x7c')][_0xe855('0x7a')];_0x12d410[_0xe855('0x7d')]=_0x4c04b0[_0xe855('0x7c')]['TranscriptionJobStatus'];return _0x8ad7a3(_0x12d410);})[_0xe855('0x49')](function(_0x511420){return _0x4e9838(_0x511420);});});}exports[_0xe855('0x7e')]=function(_0x356d8e,_0x17a51d,_0x357212){var _0x13d89b;var _0x54c200;var _0x3cfc0a;var _0x42993f=require('../../components/encryptor');return db['VoiceRecording'][_0xe855('0x7f')]({'where':{'id':_0x356d8e[_0xe855('0x4b')]['id']}})['then'](function(_0x137296){if(_0x137296){var _0x2ac1fa=util[_0xe855('0x36')](_0xe855('0x80'),_0x137296['value']);if(fs[_0xe855('0x55')](_0x2ac1fa)){cypher=!![];return _0x42993f[_0xe855('0x56')](_0x2ac1fa,_0x137296[_0xe855('0x54')],config[_0xe855('0x57')][_0xe855('0x58')])[_0xe855('0x27')](function(){return _0x137296;});}return _0x137296;}})[_0xe855('0x27')](function(_0x58613b){if(!_0x58613b){throw new db['Sequelize'][(_0xe855('0x81'))](_0xe855('0x82'));}_0x54c200=_0x58613b;return db[_0xe855('0x83')]['findOne']({'where':{'id':0x1}});})[_0xe855('0x27')](handleEntityNotFound(_0x17a51d,null))[_0xe855('0x27')](function(_0x112745){if(_0x112745){_0x13d89b=_0x112745;if(!_0x13d89b[_0xe855('0x84')]||!_0x13d89b[_0xe855('0x85')]||!_0x13d89b[_0xe855('0x86')]||!_0x13d89b[_0xe855('0x87')]||!_0x13d89b[_0xe855('0x75')]){throw new db[(_0xe855('0x63'))][(_0xe855('0x81'))](_0xe855('0x88'));}if(_0x356d8e['body'][_0xe855('0x89')]&&(!_0x13d89b['sentiment']||!_0x13d89b[_0xe855('0x8a')]||!_0x13d89b[_0xe855('0x8b')]||!_0x13d89b['language']||!_0x13d89b[_0xe855('0x75')])){throw new db[(_0xe855('0x63'))]['ValidationError'](_0xe855('0x8c'));}return db[_0xe855('0x8d')][_0xe855('0x7f')]({'where':{'id':_0x13d89b['transcribeAccountId']}});}})[_0xe855('0x27')](function(_0x2833ec){if(!_0x2833ec){throw new db[(_0xe855('0x63'))][(_0xe855('0x81'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x2833ec[_0xe855('0x8e')]||!_0x2833ec[_0xe855('0x8f')]){throw new db[(_0xe855('0x63'))][(_0xe855('0x81'))](_0xe855('0x90'));}_0x3cfc0a=_0x2833ec;return getBucketslist(_0x3cfc0a[_0xe855('0x8e')],_0x3cfc0a[_0xe855('0x8f')],_0x13d89b[_0xe855('0x86')]);})[_0xe855('0x27')](function(_0x394984){if(_0x394984&&_0x394984[_0xe855('0x91')]){var _0x54e8fe=_['find'](_0x394984['Buckets'],function(_0x55d999){return _0x55d999[_0xe855('0x92')]===_0x13d89b['bucket'];});if(!_0x54e8fe){logger[_0xe855('0x67')](util[_0xe855('0x36')](_0xe855('0x93'),_0x356d8e['params']['id'],_0x13d89b[_0xe855('0x75')]));return createBucket(_0x3cfc0a['data1'],_0x3cfc0a[_0xe855('0x8f')],_0x13d89b[_0xe855('0x86')],_0x13d89b['bucket']);}logger['info'](util[_0xe855('0x36')](_0xe855('0x94'),_0x356d8e[_0xe855('0x4b')]['id'],_0x13d89b[_0xe855('0x75')]));return;}})['then'](function(_0x33ffba){if(_0x54c200[_0xe855('0x7d')]===_0xe855('0x95')){return transcribe(_0x356d8e[_0xe855('0x4b')]['id'],_0x3cfc0a[_0xe855('0x8e')],_0x3cfc0a['data2'],_0x13d89b[_0xe855('0x86')],_0x13d89b[_0xe855('0x75')],_0x54c200[_0xe855('0x54')],_0x13d89b[_0xe855('0x87')]);}else{logger['info'](util['format']('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0x356d8e[_0xe855('0x4b')]['id']));return{'transcribeStatus':_0xe855('0x96')};}})[_0xe855('0x27')](function(_0x122376){if(_0x122376){_0x122376[_0xe855('0x97')]=_0x356d8e[_0xe855('0x4f')]['runSentiment'];return _0x54c200[_0xe855('0x98')](_0x122376);}})[_0xe855('0x27')](respondWithResult(_0x17a51d,null))[_0xe855('0x49')](handleError(_0x17a51d,null));};function writeFile(_0x2298f7,_0x53d719){return new Promise(function(_0x38640b,_0x5c8edc){fs[_0xe855('0x99')](_0x53d719,_0x2298f7,function(_0x5932aa,_0x39b737){if(_0x5932aa){return _0x5c8edc(_0x5932aa);}else{return _0x38640b(_0x39b737);}});});}exports['downloadTranscribe']=function(_0x946f6e,_0x20c7e1,_0x326646){return db['VoiceRecording']['findOne']({'where':{'id':_0x946f6e[_0xe855('0x4b')]['id']}})[_0xe855('0x27')](handleEntityNotFound(_0x20c7e1))[_0xe855('0x27')](function(_0x22dcdb){if(_0x22dcdb&&_0x22dcdb[_0xe855('0x9a')]){var _0x4b97c7=_0x22dcdb[_0xe855('0x9a')];var _0xbf79=config[_0xe855('0x9b')]+_0xe855('0x9c')+_0x22dcdb['id']+'.txt';if(fs[_0xe855('0x55')](_0xbf79)){return _0xbf79;}return writeFile(_0x4b97c7,_0xbf79)[_0xe855('0x27')](function(){return _0xbf79;});}else{throw new db[(_0xe855('0x63'))][(_0xe855('0x81'))](_0xe855('0x9d'));}})[_0xe855('0x27')](function(_0x4c962c){return _0x20c7e1[_0xe855('0x51')](_0x4c962c);})[_0xe855('0x49')](handleError(_0x20c7e1));}; \ No newline at end of file +var _0xd8a1=['../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','type','model','differenceBy','map','format','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','merge','where','VIRTUAL','filter','options','includeAll','include','VoiceRecording','rows','catch','params','find','create','body','describe','download','../../components/encryptor','value','%s.cypher','decryptFile','recording','existsSync','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','downloads','sequelize','MD5','col','uniqueid','push','secrets','isNil','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','listBuckets','createBucket','upload','TranscribeService','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','Location','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','transcribeRegion','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','sentimentRegion','language','CloudProvider','Cloud\x20Provider\x20not\x20available','data2','Cloud\x20Provider\x20not\x20configured','data1','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','tempSentiment','updateAttributes','writeFile','fileText','.txt','rimraf','zip-dir','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','uuid/v4','ioredis','../../components/auth/service'];(function(_0xba7753,_0x25c9bf){var _0x5ad2e0=function(_0x2d6ebf){while(--_0x2d6ebf){_0xba7753['push'](_0xba7753['shift']());}};_0x5ad2e0(++_0x25c9bf);}(_0xd8a1,0x1a5));var _0x1d8a=function(_0xe7abe5,_0x1550de){_0xe7abe5=_0xe7abe5-0x0;var _0x23286b=_0xd8a1[_0xe7abe5];return _0x23286b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1d8a('0x0'));var zipdir=require(_0x1d8a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1d8a('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x1d8a('0x3'));var util=require(_0x1d8a('0x4'));var path=require(_0x1d8a('0x5'));var sox=require('sox');var csv=require(_0x1d8a('0x6'));var ejs=require(_0x1d8a('0x7'));var fs=require('fs');var fs_extra=require(_0x1d8a('0x8'));var _=require(_0x1d8a('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1d8a('0xa'));var deskjs=require(_0x1d8a('0xb'));var toCsv=require(_0x1d8a('0x6'));var querystring=require(_0x1d8a('0xc'));var Papa=require(_0x1d8a('0xd'));var AWS=require('aws-sdk');var uuidv4=require(_0x1d8a('0xe'));var Redis=require(_0x1d8a('0xf'));var authService=require(_0x1d8a('0x10'));var qs=require(_0x1d8a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1d8a('0x12'))(_0x1d8a('0x13'));var utils=require(_0x1d8a('0x14'));var config=require(_0x1d8a('0x15'));var licenseUtil=require(_0x1d8a('0x16'));var db=require(_0x1d8a('0x17'))['db'];function respondWithStatusCode(_0x1a9b08,_0xadc1f6){_0xadc1f6=_0xadc1f6||0xcc;return function(_0x5dd32f){if(_0x5dd32f){return _0x1a9b08[_0x1d8a('0x18')](_0xadc1f6);}return _0x1a9b08[_0x1d8a('0x19')](_0xadc1f6)[_0x1d8a('0x1a')]();};}function respondWithResult(_0x2cecc1,_0x2dead7){_0x2dead7=_0x2dead7||0xc8;return function(_0x21f5d3){if(_0x21f5d3){return _0x2cecc1[_0x1d8a('0x19')](_0x2dead7)[_0x1d8a('0x1b')](_0x21f5d3);}};}function respondWithFilteredResult(_0x365df5,_0x4e0f65){return function(_0x3a2ced){if(_0x3a2ced){var _0x63eb0c=typeof _0x4e0f65[_0x1d8a('0x1c')]==='undefined'&&typeof _0x4e0f65[_0x1d8a('0x1d')]===_0x1d8a('0x1e');var _0x8baad9=_0x3a2ced[_0x1d8a('0x1f')];var _0x251050=_0x63eb0c?0x0:_0x4e0f65[_0x1d8a('0x1c')];var _0x2eb372=_0x63eb0c?_0x3a2ced[_0x1d8a('0x1f')]:_0x4e0f65[_0x1d8a('0x1c')]+_0x4e0f65[_0x1d8a('0x1d')];var _0x506751;if(_0x2eb372>=_0x8baad9){_0x2eb372=_0x8baad9;_0x506751=0xc8;}else{_0x506751=0xce;}_0x365df5['status'](_0x506751);return _0x365df5[_0x1d8a('0x20')](_0x1d8a('0x21'),_0x251050+'-'+_0x2eb372+'/'+_0x8baad9)[_0x1d8a('0x1b')](_0x3a2ced);}return null;};}function patchUpdates(_0x227ecd){return function(_0x19271b){try{jsonpatch[_0x1d8a('0x22')](_0x19271b,_0x227ecd,!![]);}catch(_0x4c5f7a){return BPromise['reject'](_0x4c5f7a);}return _0x19271b[_0x1d8a('0x23')]();};}function saveUpdates(_0x718dbf,_0x4b387d){return function(_0x3447c6){if(_0x3447c6){return _0x3447c6[_0x1d8a('0x24')](_0x718dbf)[_0x1d8a('0x25')](function(_0x5eeaf0){return _0x5eeaf0;});}return null;};}function removeEntity(_0xa672e5,_0x3d6037){return function(_0x2840ec){if(_0x2840ec){return _0x2840ec[_0x1d8a('0x26')]()[_0x1d8a('0x25')](function(){_0xa672e5[_0x1d8a('0x19')](0xcc)[_0x1d8a('0x1a')]();});}};}function handleEntityNotFound(_0x5cb13e,_0xfeb0e3){return function(_0x20c633){if(!_0x20c633){_0x5cb13e[_0x1d8a('0x18')](0x194);}return _0x20c633;};}function handleError(_0x3d9c3c,_0x9f28ed){_0x9f28ed=_0x9f28ed||0x1f4;return function(_0x3b4fe5){logger[_0x1d8a('0x27')](_0x3b4fe5[_0x1d8a('0x28')]);if(_0x3b4fe5[_0x1d8a('0x29')]){delete _0x3b4fe5[_0x1d8a('0x29')];}_0x3d9c3c[_0x1d8a('0x19')](_0x9f28ed)[_0x1d8a('0x2a')](_0x3b4fe5);};}exports[_0x1d8a('0x2b')]=function(_0xae61d9,_0x508fb4){var _0x46ca54={},_0x4d73ce={},_0x3cb8d0={'count':0x0,'rows':[]};var _0x432ccd=_['map'](db['VoiceRecording'][_0x1d8a('0x2c')],function(_0x5de222){return{'name':_0x5de222[_0x1d8a('0x2d')],'type':_0x5de222[_0x1d8a('0x2e')]['key']};});_0x4d73ce[_0x1d8a('0x2f')]=_[_0x1d8a('0x30')](_[_0x1d8a('0x31')](_0x432ccd,_0x1d8a('0x29')),[_0x1d8a('0x32')]);_0x4d73ce['query']=_[_0x1d8a('0x33')](_0xae61d9[_0x1d8a('0x34')]);_0x4d73ce[_0x1d8a('0x35')]=_[_0x1d8a('0x36')](_0x4d73ce[_0x1d8a('0x2f')],_0x4d73ce['query']);_0x46ca54[_0x1d8a('0x37')]=_['intersection'](_0x4d73ce[_0x1d8a('0x2f')],qs[_0x1d8a('0x38')](_0xae61d9[_0x1d8a('0x34')][_0x1d8a('0x38')]));_0x46ca54['attributes']=_0x46ca54[_0x1d8a('0x37')][_0x1d8a('0x39')]?_0x46ca54[_0x1d8a('0x37')]:_0x4d73ce['model'];if(!_0xae61d9[_0x1d8a('0x34')][_0x1d8a('0x3a')](_0x1d8a('0x3b'))){_0x46ca54[_0x1d8a('0x1d')]=qs[_0x1d8a('0x1d')](_0xae61d9['query'][_0x1d8a('0x1d')]);_0x46ca54[_0x1d8a('0x1c')]=qs['offset'](_0xae61d9[_0x1d8a('0x34')][_0x1d8a('0x1c')]);}_0x46ca54['order']=qs[_0x1d8a('0x3c')](_0xae61d9[_0x1d8a('0x34')]['sort']);_0x46ca54['where']=qs['filters'](_['pick'](_0xae61d9['query'],_0x4d73ce[_0x1d8a('0x35')]),_0x432ccd);if(_0xae61d9[_0x1d8a('0x34')]['filter']){_0x46ca54['where']=_[_0x1d8a('0x3d')](_0x46ca54[_0x1d8a('0x3e')],{'$or':_[_0x1d8a('0x31')](_0x432ccd,function(_0x317260){if(_0x317260['type']!==_0x1d8a('0x3f')){var _0x4bec1b={};_0x4bec1b[_0x317260[_0x1d8a('0x29')]]={'$like':'%'+_0xae61d9[_0x1d8a('0x34')][_0x1d8a('0x40')]+'%'};return _0x4bec1b;}})});}_0x46ca54=_['merge']({},_0x46ca54,_0xae61d9[_0x1d8a('0x41')]);var _0x22cd7b={'where':_0x46ca54[_0x1d8a('0x3e')]};return db['VoiceRecording'][_0x1d8a('0x1f')](_0x22cd7b)[_0x1d8a('0x25')](function(_0x1d0d18){_0x3cb8d0['count']=_0x1d0d18;if(_0xae61d9[_0x1d8a('0x34')][_0x1d8a('0x42')]){_0x46ca54[_0x1d8a('0x43')]=[{'all':!![]}];}return db[_0x1d8a('0x44')]['findAll'](_0x46ca54);})[_0x1d8a('0x25')](function(_0x1a22ff){_0x3cb8d0[_0x1d8a('0x45')]=_0x1a22ff;return _0x3cb8d0;})[_0x1d8a('0x25')](respondWithFilteredResult(_0x508fb4,_0x46ca54))[_0x1d8a('0x46')](handleError(_0x508fb4,null));};exports['show']=function(_0x10b711,_0x55c916){var _0x12ef2d={'raw':![],'where':{'id':_0x10b711[_0x1d8a('0x47')]['id']}},_0x149339={};_0x149339['model']=_[_0x1d8a('0x33')](db[_0x1d8a('0x44')]['rawAttributes']);_0x149339[_0x1d8a('0x34')]=_[_0x1d8a('0x33')](_0x10b711['query']);_0x149339[_0x1d8a('0x35')]=_[_0x1d8a('0x36')](_0x149339['model'],_0x149339[_0x1d8a('0x34')]);_0x12ef2d[_0x1d8a('0x37')]=_[_0x1d8a('0x36')](_0x149339['model'],qs[_0x1d8a('0x38')](_0x10b711[_0x1d8a('0x34')][_0x1d8a('0x38')]));_0x12ef2d[_0x1d8a('0x37')]=_0x12ef2d[_0x1d8a('0x37')][_0x1d8a('0x39')]?_0x12ef2d[_0x1d8a('0x37')]:_0x149339[_0x1d8a('0x2f')];if(_0x10b711[_0x1d8a('0x34')][_0x1d8a('0x42')]){_0x12ef2d[_0x1d8a('0x43')]=[{'all':!![]}];}_0x12ef2d=_[_0x1d8a('0x3d')]({},_0x12ef2d,_0x10b711[_0x1d8a('0x41')]);return db[_0x1d8a('0x44')][_0x1d8a('0x48')](_0x12ef2d)[_0x1d8a('0x25')](handleEntityNotFound(_0x55c916,null))['then'](respondWithResult(_0x55c916,null))[_0x1d8a('0x46')](handleError(_0x55c916,null));};exports[_0x1d8a('0x49')]=function(_0x55a9b0,_0x57730c){return db[_0x1d8a('0x44')][_0x1d8a('0x49')](_0x55a9b0[_0x1d8a('0x4a')],{})['then'](respondWithResult(_0x57730c,0xc9))[_0x1d8a('0x46')](handleError(_0x57730c,null));};exports[_0x1d8a('0x24')]=function(_0x1614eb,_0x523f48){if(_0x1614eb[_0x1d8a('0x4a')]['id']){delete _0x1614eb['body']['id'];}return db[_0x1d8a('0x44')][_0x1d8a('0x48')]({'where':{'id':_0x1614eb['params']['id']}})[_0x1d8a('0x25')](handleEntityNotFound(_0x523f48,null))['then'](saveUpdates(_0x1614eb[_0x1d8a('0x4a')],null))[_0x1d8a('0x25')](respondWithResult(_0x523f48,null))[_0x1d8a('0x46')](handleError(_0x523f48,null));};exports['describe']=function(_0x451d26,_0x24abec){return db['VoiceRecording'][_0x1d8a('0x4b')]()[_0x1d8a('0x25')](respondWithResult(_0x24abec,null))[_0x1d8a('0x46')](handleError(_0x24abec,null));};exports[_0x1d8a('0x4c')]=function(_0x541da6,_0x493837,_0x26f3ed){var _0x2b408f=require(_0x1d8a('0x4d'));var _0x2cc245=![];var _0x38a146={};if(_0x541da6[_0x1d8a('0x34')][_0x1d8a('0x2e')]&&_0x541da6[_0x1d8a('0x34')][_0x1d8a('0x2e')]==='uniqueid'){_0x38a146['uniqueid']=_0x541da6[_0x1d8a('0x47')]['id'];}else{_0x38a146['id']=_0x541da6[_0x1d8a('0x47')]['id'];}return db['VoiceRecording']['find']({'where':_0x38a146,'attributes':['id',_0x1d8a('0x4e')],'raw':!![]})['then'](handleEntityNotFound(_0x493837,null))[_0x1d8a('0x25')](function(_0x423047){if(_0x423047){var _0x13dd95=_0x423047[_0x1d8a('0x4e')];var _0x34faa0=util[_0x1d8a('0x32')](_0x1d8a('0x4f'),_0x13dd95);if(fs['existsSync'](_0x34faa0)){_0x2cc245=!![];return _0x2b408f[_0x1d8a('0x50')](_0x34faa0,_0x13dd95,config['secrets'][_0x1d8a('0x51')])[_0x1d8a('0x25')](function(){return _0x423047;});}return _0x423047;}})[_0x1d8a('0x25')](function(_0x2cb817){if(_0x2cb817){var _0x33b42a=_0x2cb817[_0x1d8a('0x4e')];if(!fs[_0x1d8a('0x52')](_0x33b42a)){throw new db[(_0x1d8a('0x53'))][(_0x1d8a('0x54'))](_0x1d8a('0x55'));}if(_0x2cb817[_0x1d8a('0x56')]){return _0x493837[_0x1d8a('0x4c')](_0x33b42a,_0x2cb817['filename']+path[_0x1d8a('0x57')](_0x33b42a),function(){if(_0x2cc245){fs[_0x1d8a('0x58')](_0x33b42a);}});}else{return _0x493837[_0x1d8a('0x4c')](_0x33b42a,function(_0x3923a7){if(_0x2cc245){fs[_0x1d8a('0x58')](_0x33b42a);}});}}})['catch'](function(_0x3e1cd9){if(_0x3e1cd9['message']===_0x1d8a('0x55')){_0x493837[_0x1d8a('0x19')](0x194)[_0x1d8a('0x2a')]('Not\x20found');}else{return handleError(_0x493837,null);}});};exports[_0x1d8a('0x59')]=function(_0x47a2a3,_0x209907,_0x5aa363){var _0x22abf9=require(_0x1d8a('0x4d'));var _0x58b71c=![];var _0x107c02={'$and':[db[_0x1d8a('0x5a')][_0x1d8a('0x3e')](db['sequelize']['fn'](_0x1d8a('0x5b'),db[_0x1d8a('0x5a')][_0x1d8a('0x5c')]('uniqueid')),_0x47a2a3[_0x1d8a('0x34')]['token'])]};if(_0x47a2a3['query'][_0x1d8a('0x2e')]&&_0x47a2a3[_0x1d8a('0x34')][_0x1d8a('0x2e')]===_0x1d8a('0x5d')){_0x107c02['$and'][_0x1d8a('0x5e')]({'uniqueid':_0x47a2a3['params']['id']});}else{_0x107c02['$and'][_0x1d8a('0x5e')]({'id':_0x47a2a3[_0x1d8a('0x47')]['id']});}return db[_0x1d8a('0x44')]['find']({'where':_0x107c02,'attributes':['id',_0x1d8a('0x4e')],'raw':!![]})[_0x1d8a('0x25')](handleEntityNotFound(_0x209907,null))[_0x1d8a('0x25')](function(_0x4ad145){if(_0x4ad145){var _0x293678=util[_0x1d8a('0x32')](_0x1d8a('0x4f'),_0x4ad145[_0x1d8a('0x4e')]);if(fs['existsSync'](_0x293678)){_0x58b71c=!![];return _0x22abf9[_0x1d8a('0x50')](_0x293678,_0x4ad145[_0x1d8a('0x4e')],config[_0x1d8a('0x5f')][_0x1d8a('0x51')])[_0x1d8a('0x25')](function(){return _0x4ad145;});}return _0x4ad145;}})['then'](function(_0x397f2a){if(_0x397f2a){if(!fs['existsSync'](_0x397f2a['value'])){throw new db[(_0x1d8a('0x53'))][(_0x1d8a('0x54'))](_0x1d8a('0x55'));}if(_0x397f2a[_0x1d8a('0x56')]){return _0x209907[_0x1d8a('0x4c')](_0x397f2a['value'],_0x397f2a[_0x1d8a('0x56')]+path[_0x1d8a('0x57')](_0x397f2a[_0x1d8a('0x4e')]),function(){if(_0x58b71c){fs['unlink'](_0x397f2a[_0x1d8a('0x4e')]);}});}else{return _0x209907['download'](_0x397f2a[_0x1d8a('0x4e')],function(_0xc7a1b9){if(_0x58b71c){fs[_0x1d8a('0x58')](_0x397f2a[_0x1d8a('0x4e')]);}});}}})[_0x1d8a('0x46')](handleError(_0x209907,null));};exports['destroy']=function(_0x45951a,_0x318efd){return db['VoiceRecording'][_0x1d8a('0x48')]({'where':{'id':_0x45951a[_0x1d8a('0x47')]['id']}})[_0x1d8a('0x25')](function(_0x202b5a){if(_[_0x1d8a('0x60')](_0x202b5a)){throw new ReferenceError(_0x1d8a('0x61'));}return _0x202b5a;})['then'](function(_0x6ff0b1){var _0x301cd9=_0x6ff0b1[_0x1d8a('0x4e')];logger['info'](_0x1d8a('0x62'),_0x301cd9);if(!_['isNil'](_0x6ff0b1['value'])&&fs[_0x1d8a('0x52')](_0x301cd9)){logger[_0x1d8a('0x63')]('File:\x20\x22'+_0x301cd9+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x301cd9);}_0x301cd9=_0x301cd9+'.cypher';if(!_['isNil'](_0x6ff0b1[_0x1d8a('0x4e')])&&fs[_0x1d8a('0x52')](_0x301cd9)){logger[_0x1d8a('0x63')](_0x1d8a('0x64')+_0x301cd9+_0x1d8a('0x65'));fs[_0x1d8a('0x66')](_0x301cd9);}return _0x6ff0b1;})['then'](function(_0x168d7a){if(!_0x168d7a)throw new InternalError();return _0x168d7a[_0x1d8a('0x26')]();})['then'](function(){_0x318efd[_0x1d8a('0x19')](0xcc)[_0x1d8a('0x1a')]();})[_0x1d8a('0x46')](handleError(_0x318efd,null));};function getBucketslist(_0x13f904,_0x297ff9,_0x3aab27){return new Promise(function(_0x103c64,_0x28878d){var _0x201aad=new AWS['S3']({'accessKeyId':_0x297ff9,'secretAccessKey':_0x13f904,'region':_0x3aab27});_0x201aad[_0x1d8a('0x67')]({},function(_0x10dd5c,_0x3f5002){if(_0x10dd5c){return _0x28878d(_0x10dd5c);}else{return _0x103c64(_0x3f5002);}});});}function createBucket(_0x249959,_0x2b53ab,_0x18baef,_0x1fbfff){return new Promise(function(_0xbd4b7c,_0x541fb5){var _0x1092a4=new AWS['S3']({'accessKeyId':_0x2b53ab,'secretAccessKey':_0x249959,'region':_0x18baef});_0x1092a4[_0x1d8a('0x68')]({'Bucket':_0x1fbfff},function(_0x96b71e,_0x2da5aa){if(_0x96b71e){return _0x541fb5(_0x96b71e);}else{return _0xbd4b7c(_0x2da5aa);}});});}function uploadFile(_0x7052f8,_0x4719e8,_0xa2dd25,_0x3a4e84,_0x3d8b46,_0x376ddc){return new Promise(function(_0xe2bdb4,_0x2a89fd){var _0x155455=new AWS['S3']({'accessKeyId':_0x4719e8,'secretAccessKey':_0x7052f8,'region':_0xa2dd25});_0x155455[_0x1d8a('0x69')]({'Bucket':_0x3a4e84,'Key':_0x3d8b46,'Body':_0x376ddc},function(_0x122981,_0x2af019){if(_0x122981){return _0x2a89fd(_0x122981);}else{return _0xe2bdb4(_0x2af019);}});});}function startTranscribe(_0x134977,_0x1275b8,_0x352f9d,_0x1746e6,_0x544d76,_0xd6ff05){return new Promise(function(_0x23e268,_0x203221){var _0x330487=new AWS[(_0x1d8a('0x6a'))]({'accessKeyId':_0x1275b8,'secretAccessKey':_0x134977,'region':_0x352f9d});_0x330487['startTranscriptionJob']({'TranscriptionJobName':_0x1746e6,'LanguageCode':_0x544d76,'Media':{'MediaFileUri':_0xd6ff05}},function(_0x5d7dd8,_0xdfd439){if(_0x5d7dd8){return _0x203221(_0x5d7dd8);}else{return _0x23e268(_0xdfd439);}});});}function transcribe(_0xa9714c,_0x3a8c2f,_0x270fbd,_0x5648dc,_0x1673fe,_0x5bda27,_0x3c5045){return new Promise(function(_0x1ae123,_0xeec63e){var _0x4a6e7e={};logger[_0x1d8a('0x63')](util[_0x1d8a('0x32')](_0x1d8a('0x6b'),_0xa9714c,_0x1673fe));return uploadFile(_0x3a8c2f,_0x270fbd,_0x5648dc,_0x1673fe,path[_0x1d8a('0x6c')](_0x5bda27),fs[_0x1d8a('0x6d')](_0x5bda27))[_0x1d8a('0x25')](function(_0x194a66){logger[_0x1d8a('0x63')](util[_0x1d8a('0x32')]('[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)',_0xa9714c,_0x1673fe,_0x194a66['Location']));_0x4a6e7e[_0x1d8a('0x6e')]=_0x194a66[_0x1d8a('0x6f')];_0x4a6e7e[_0x1d8a('0x70')]=_0x194a66['Location'];logger[_0x1d8a('0x63')](util['format'](_0x1d8a('0x71'),_0xa9714c));return startTranscribe(_0x3a8c2f,_0x270fbd,_0x5648dc,uuidv4(),_0x3c5045,_0x194a66[_0x1d8a('0x72')]);})[_0x1d8a('0x25')](function(_0x150ecd){logger[_0x1d8a('0x63')](util['format']('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0xa9714c,_0x150ecd[_0x1d8a('0x73')][_0x1d8a('0x74')]));_0x4a6e7e[_0x1d8a('0x75')]=_0x150ecd['TranscriptionJob'][_0x1d8a('0x74')];_0x4a6e7e[_0x1d8a('0x76')]=_0x150ecd['TranscriptionJob']['TranscriptionJobStatus'];return _0x1ae123(_0x4a6e7e);})[_0x1d8a('0x46')](function(_0x26109c){return _0xeec63e(_0x26109c);});});}exports[_0x1d8a('0x77')]=function(_0x5bd731,_0x1fc749,_0x3190fd){var _0x4e3b83;var _0x449721;var _0x46c5d1;var _0x4b8471=require(_0x1d8a('0x4d'));return db[_0x1d8a('0x44')][_0x1d8a('0x78')]({'where':{'id':_0x5bd731[_0x1d8a('0x47')]['id']}})[_0x1d8a('0x25')](function(_0x1e7125){if(_0x1e7125){var _0x213129=util[_0x1d8a('0x32')](_0x1d8a('0x4f'),_0x1e7125[_0x1d8a('0x4e')]);if(fs[_0x1d8a('0x52')](_0x213129)){cypher=!![];return _0x4b8471[_0x1d8a('0x50')](_0x213129,_0x1e7125[_0x1d8a('0x4e')],config[_0x1d8a('0x5f')]['recording'])[_0x1d8a('0x25')](function(){return _0x1e7125;});}return _0x1e7125;}})[_0x1d8a('0x25')](function(_0x35001a){if(!_0x35001a){throw new db['Sequelize'][(_0x1d8a('0x54'))](_0x1d8a('0x79'));}_0x449721=_0x35001a;return db[_0x1d8a('0x7a')][_0x1d8a('0x78')]({'where':{'id':0x1}});})[_0x1d8a('0x25')](handleEntityNotFound(_0x1fc749,null))[_0x1d8a('0x25')](function(_0x2bc9a9){if(_0x2bc9a9){_0x4e3b83=_0x2bc9a9;if(!_0x4e3b83[_0x1d8a('0x7b')]||!_0x4e3b83[_0x1d8a('0x7c')]||!_0x4e3b83[_0x1d8a('0x7d')]||!_0x4e3b83['language']||!_0x4e3b83['bucket']){throw new db[(_0x1d8a('0x53'))][(_0x1d8a('0x54'))](_0x1d8a('0x7e'));}if(_0x5bd731[_0x1d8a('0x4a')][_0x1d8a('0x7f')]&&(!_0x4e3b83[_0x1d8a('0x80')]||!_0x4e3b83[_0x1d8a('0x81')]||!_0x4e3b83[_0x1d8a('0x82')]||!_0x4e3b83[_0x1d8a('0x83')]||!_0x4e3b83[_0x1d8a('0x6e')])){throw new db[(_0x1d8a('0x53'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20configured');}return db[_0x1d8a('0x84')][_0x1d8a('0x78')]({'where':{'id':_0x4e3b83['transcribeAccountId']}});}})[_0x1d8a('0x25')](function(_0x50cda9){if(!_0x50cda9){throw new db[(_0x1d8a('0x53'))][(_0x1d8a('0x54'))](_0x1d8a('0x85'));}if(!_0x50cda9['data1']||!_0x50cda9[_0x1d8a('0x86')]){throw new db[(_0x1d8a('0x53'))][(_0x1d8a('0x54'))](_0x1d8a('0x87'));}_0x46c5d1=_0x50cda9;return getBucketslist(_0x46c5d1[_0x1d8a('0x88')],_0x46c5d1[_0x1d8a('0x86')],_0x4e3b83['transcribeRegion']);})[_0x1d8a('0x25')](function(_0x44d0ff){if(_0x44d0ff&&_0x44d0ff[_0x1d8a('0x89')]){var _0x285b63=_[_0x1d8a('0x48')](_0x44d0ff['Buckets'],function(_0x3ee615){return _0x3ee615[_0x1d8a('0x8a')]===_0x4e3b83[_0x1d8a('0x6e')];});if(!_0x285b63){logger['info'](util['format'](_0x1d8a('0x8b'),_0x5bd731[_0x1d8a('0x47')]['id'],_0x4e3b83[_0x1d8a('0x6e')]));return createBucket(_0x46c5d1[_0x1d8a('0x88')],_0x46c5d1[_0x1d8a('0x86')],_0x4e3b83[_0x1d8a('0x7d')],_0x4e3b83['bucket']);}logger['info'](util['format'](_0x1d8a('0x8c'),_0x5bd731[_0x1d8a('0x47')]['id'],_0x4e3b83[_0x1d8a('0x6e')]));return;}})[_0x1d8a('0x25')](function(_0x468dfe){if(_0x449721[_0x1d8a('0x76')]==='NEW'){return transcribe(_0x5bd731[_0x1d8a('0x47')]['id'],_0x46c5d1['data1'],_0x46c5d1['data2'],_0x4e3b83[_0x1d8a('0x7d')],_0x4e3b83['bucket'],_0x449721[_0x1d8a('0x4e')],_0x4e3b83[_0x1d8a('0x83')]);}else{logger[_0x1d8a('0x63')](util[_0x1d8a('0x32')]('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0x5bd731['params']['id']));return{'transcribeStatus':'IN_PROGRESS'};}})[_0x1d8a('0x25')](function(_0x348281){if(_0x348281){_0x348281[_0x1d8a('0x8d')]=_0x5bd731['body'][_0x1d8a('0x7f')];return _0x449721[_0x1d8a('0x8e')](_0x348281);}})[_0x1d8a('0x25')](respondWithResult(_0x1fc749,null))[_0x1d8a('0x46')](handleError(_0x1fc749,null));};function writeFile(_0x2f1045,_0x5135c3){return new Promise(function(_0x33b822,_0x181d47){fs[_0x1d8a('0x8f')](_0x5135c3,_0x2f1045,function(_0x26250b,_0x11cb0b){if(_0x26250b){return _0x181d47(_0x26250b);}else{return _0x33b822(_0x11cb0b);}});});}exports['downloadTranscribe']=function(_0x5664d2,_0x59bf4a,_0x4732fe){return db[_0x1d8a('0x44')][_0x1d8a('0x78')]({'where':{'id':_0x5664d2[_0x1d8a('0x47')]['id']}})['then'](handleEntityNotFound(_0x59bf4a))[_0x1d8a('0x25')](function(_0x1fb473){if(_0x1fb473&&_0x1fb473[_0x1d8a('0x90')]){var _0x2b6d20=_0x1fb473[_0x1d8a('0x90')];var _0x29c6c1=config['root']+'/server/files/transcribes/transcribe_'+_0x1fb473['id']+_0x1d8a('0x91');if(fs[_0x1d8a('0x52')](_0x29c6c1)){return _0x29c6c1;}return writeFile(_0x2b6d20,_0x29c6c1)[_0x1d8a('0x25')](function(){return _0x29c6c1;});}else{throw new db[(_0x1d8a('0x53'))][(_0x1d8a('0x54'))]('Transcript\x20not\x20available');}})['then'](function(_0x35b457){return _0x59bf4a[_0x1d8a('0x4c')](_0x35b457);})[_0x1d8a('0x46')](handleError(_0x59bf4a));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index c6db6e6..044a465 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 _0xf609=['../../config/environment','./voiceRecording.attributes','define','VoiceRecording','voice_recordings','uniqueid','util','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x61151d,_0x1eaadf){var _0x57752d=function(_0x1ac48a){while(--_0x1ac48a){_0x61151d['push'](_0x61151d['shift']());}};_0x57752d(++_0x1eaadf);}(_0xf609,0x1c2));var _0x9f60=function(_0x9971b3,_0x5c8ec1){_0x9971b3=_0x9971b3-0x0;var _0x48199a=_0xf609[_0x9971b3];return _0x48199a;};'use strict';var _=require('lodash');var util=require(_0x9f60('0x0'));var logger=require(_0x9f60('0x1'))('api');var moment=require('moment');var BPromise=require(_0x9f60('0x2'));var rp=require(_0x9f60('0x3'));var fs=require('fs');var path=require(_0x9f60('0x4'));var rimraf=require(_0x9f60('0x5'));var config=require(_0x9f60('0x6'));var attributes=require(_0x9f60('0x7'));module['exports']=function(_0x5a3c6f,_0x4ec770){return _0x5a3c6f[_0x9f60('0x8')](_0x9f60('0x9'),attributes,{'tableName':_0x9f60('0xa'),'paranoid':![],'indexes':[{'name':_0x9f60('0xb'),'fields':[_0x9f60('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfe4a=['uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./voiceRecording.attributes','exports','define','VoiceRecording'];(function(_0xc753fe,_0x21130b){var _0x2c633a=function(_0x48e99e){while(--_0x48e99e){_0xc753fe['push'](_0xc753fe['shift']());}};_0x2c633a(++_0x21130b);}(_0xfe4a,0x10b));var _0xafe4=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0xfe4a[_0x36eaaa];return _0x461349;};'use strict';var _=require(_0xafe4('0x0'));var util=require(_0xafe4('0x1'));var logger=require(_0xafe4('0x2'))(_0xafe4('0x3'));var moment=require(_0xafe4('0x4'));var BPromise=require(_0xafe4('0x5'));var rp=require(_0xafe4('0x6'));var fs=require('fs');var path=require(_0xafe4('0x7'));var rimraf=require('rimraf');var config=require(_0xafe4('0x8'));var attributes=require(_0xafe4('0x9'));module[_0xafe4('0xa')]=function(_0xc7b0c9,_0x50583f){return _0xc7b0c9[_0xafe4('0xb')](_0xafe4('0xc'),attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':_0xafe4('0xd'),'fields':[_0xafe4('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index eb582a1..10e30f7 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 _0xacf4=['limit','debug','stringify','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','existsSync','value','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','error','message','result','catch','UpdateVoiceRecording','VoiceRecording','update','body','options','raw','where','attributes'];(function(_0x11732d,_0x4c580c){var _0x4e3e46=function(_0x571fe1){while(--_0x571fe1){_0x11732d['push'](_0x11732d['shift']());}};_0x4e3e46(++_0x4c580c);}(_0xacf4,0xe7));var _0x4acf=function(_0xca5dcc,_0x31af8e){_0xca5dcc=_0xca5dcc-0x0;var _0xcb17f9=_0xacf4[_0xca5dcc];return _0xcb17f9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4acf('0x0'));var BPromise=require(_0x4acf('0x1'));var rs=require(_0x4acf('0x2'));var fs=require('fs');var Redis=require(_0x4acf('0x3'));var db=require(_0x4acf('0x4'))['db'];var utils=require(_0x4acf('0x5'));var logger=require(_0x4acf('0x6'))('rpc');var config=require(_0x4acf('0x7'));var jayson=require(_0x4acf('0x8'));var client=jayson['client'][_0x4acf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2ba08a,_0x649ad2,_0x45a5a4){return new BPromise(function(_0x25d345,_0x50f5f4){return client['request'](_0x2ba08a,_0x45a5a4)[_0x4acf('0xa')](function(_0x59f559){logger[_0x4acf('0xb')](_0x4acf('0xc'),_0x649ad2,_0x4acf('0xd'));logger['debug'](_0x4acf('0xe'),_0x649ad2,_0x4acf('0xd'),JSON['stringify'](_0x59f559));if(_0x59f559['error']){if(_0x59f559[_0x4acf('0xf')]['code']===0x1f4){logger['error'](_0x4acf('0xc'),_0x649ad2,_0x59f559[_0x4acf('0xf')][_0x4acf('0x10')]);return _0x50f5f4(_0x59f559[_0x4acf('0xf')][_0x4acf('0x10')]);}logger[_0x4acf('0xf')](_0x4acf('0xc'),_0x649ad2,_0x59f559[_0x4acf('0xf')][_0x4acf('0x10')]);return _0x25d345(_0x59f559[_0x4acf('0xf')][_0x4acf('0x10')]);}else{logger['info'](_0x4acf('0xc'),_0x649ad2,'request\x20sent');_0x25d345(_0x59f559[_0x4acf('0x11')][_0x4acf('0x10')]);}})[_0x4acf('0x12')](function(_0x5d934a){logger['error'](_0x4acf('0xc'),_0x649ad2,_0x5d934a);_0x50f5f4(_0x5d934a);});});}exports[_0x4acf('0x13')]=function(_0x240c00){var _0x4b1d93=this;return new Promise(function(_0x2a678b,_0x137302){return db[_0x4acf('0x14')][_0x4acf('0x15')](_0x240c00[_0x4acf('0x16')],{'raw':_0x240c00[_0x4acf('0x17')]?_0x240c00[_0x4acf('0x17')][_0x4acf('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x240c00[_0x4acf('0x17')]?_0x240c00[_0x4acf('0x17')][_0x4acf('0x19')]||null:null,'attributes':_0x240c00['options']?_0x240c00[_0x4acf('0x17')][_0x4acf('0x1a')]||null:null,'limit':_0x240c00['options']?_0x240c00[_0x4acf('0x17')][_0x4acf('0x1b')]||null:null})['then'](function(_0x3b26ac){logger[_0x4acf('0xb')](_0x4acf('0x13'),_0x240c00);logger[_0x4acf('0x1c')]('UpdateVoiceRecording',_0x240c00,JSON[_0x4acf('0x1d')](_0x3b26ac));_0x2a678b(_0x3b26ac);})[_0x4acf('0x12')](function(_0x57e595){logger[_0x4acf('0xf')](_0x4acf('0x13'),_0x57e595['message'],_0x240c00);_0x137302(_0x4b1d93[_0x4acf('0xf')](0x1f4,_0x57e595[_0x4acf('0x10')]));});});};exports[_0x4acf('0x1e')]=function(_0x16458f){var _0x571a30=this;return new Promise(function(_0x50236d,_0x17a756){var _0x3f548a=require(_0x4acf('0x1f'));var _0x42c90c;return db[_0x4acf('0x20')][_0x4acf('0x21')]({'attributes':['id',_0x4acf('0x22')],'where':{'id':0x1},'raw':!![]})[_0x4acf('0xa')](function(_0x382c41){_0x42c90c=_0x382c41;return db[_0x4acf('0x14')]['create'](_0x16458f[_0x4acf('0x16')]);})[_0x4acf('0xa')](function(_0xd027c7){if(_0x42c90c[_0x4acf('0x22')]&&fs[_0x4acf('0x23')](_0xd027c7[_0x4acf('0x24')])){var _0x27384c=util['format'](_0x4acf('0x25'),_0xd027c7[_0x4acf('0x24')]);return _0x3f548a[_0x4acf('0x26')](_0xd027c7['value'],_0x27384c,config[_0x4acf('0x27')][_0x4acf('0x28')])[_0x4acf('0xa')](function(){fs[_0x4acf('0x29')](_0xd027c7['value']);logger[_0x4acf('0xb')](_0x4acf('0x2a'));return _0xd027c7;});}return _0xd027c7;})[_0x4acf('0xa')](function(_0x5e2332){logger[_0x4acf('0xb')](_0x4acf('0x1e'),_0x16458f);logger[_0x4acf('0x1c')](_0x4acf('0x1e'),_0x16458f,JSON[_0x4acf('0x1d')](_0x5e2332));_0x50236d(_0x5e2332);})[_0x4acf('0x12')](function(_0x490880){logger[_0x4acf('0xf')](_0x4acf('0x1e'),_0x490880['message'],_0x16458f);_0x17a756(_0x571a30[_0x4acf('0xf')](0x1f4,_0x490880['message']));});});}; \ No newline at end of file +var _0x7046=['info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateVoiceRecording','update','body','options','raw','attributes','limit','then','CreateVoiceRecording','../../components/encryptor','Setting','findOne','value','format','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x1a58ea,_0xc3a156){var _0x2d66ef=function(_0x2bb539){while(--_0x2bb539){_0x1a58ea['push'](_0x1a58ea['shift']());}};_0x2d66ef(++_0xc3a156);}(_0x7046,0x144));var _0x6704=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x7046[_0x8c43de];return _0xa6591b;};'use strict';var _=require(_0x6704('0x0'));var util=require(_0x6704('0x1'));var moment=require(_0x6704('0x2'));var BPromise=require(_0x6704('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6704('0x4'));var db=require(_0x6704('0x5'))['db'];var utils=require(_0x6704('0x6'));var logger=require('../../config/logger')(_0x6704('0x7'));var config=require(_0x6704('0x8'));var jayson=require(_0x6704('0x9'));var client=jayson[_0x6704('0xa')][_0x6704('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4badf8,_0x5ced8,_0x49b8b6){return new BPromise(function(_0x56b1ff,_0x390ace){return client['request'](_0x4badf8,_0x49b8b6)['then'](function(_0x3ca599){logger[_0x6704('0xc')](_0x6704('0xd'),_0x5ced8,_0x6704('0xe'));logger[_0x6704('0xf')](_0x6704('0x10'),_0x5ced8,_0x6704('0xe'),JSON[_0x6704('0x11')](_0x3ca599));if(_0x3ca599['error']){if(_0x3ca599[_0x6704('0x12')][_0x6704('0x13')]===0x1f4){logger['error'](_0x6704('0xd'),_0x5ced8,_0x3ca599[_0x6704('0x12')][_0x6704('0x14')]);return _0x390ace(_0x3ca599[_0x6704('0x12')][_0x6704('0x14')]);}logger[_0x6704('0x12')](_0x6704('0xd'),_0x5ced8,_0x3ca599[_0x6704('0x12')][_0x6704('0x14')]);return _0x56b1ff(_0x3ca599['error'][_0x6704('0x14')]);}else{logger[_0x6704('0xc')](_0x6704('0xd'),_0x5ced8,'request\x20sent');_0x56b1ff(_0x3ca599[_0x6704('0x15')][_0x6704('0x14')]);}})[_0x6704('0x16')](function(_0x29fa46){logger[_0x6704('0x12')]('VoiceRecording,\x20%s,\x20%s',_0x5ced8,_0x29fa46);_0x390ace(_0x29fa46);});});}exports[_0x6704('0x17')]=function(_0x31d732){var _0x135f4b=this;return new Promise(function(_0xe49450,_0x344ed9){return db['VoiceRecording'][_0x6704('0x18')](_0x31d732[_0x6704('0x19')],{'raw':_0x31d732[_0x6704('0x1a')]?_0x31d732[_0x6704('0x1a')][_0x6704('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x31d732[_0x6704('0x1a')]?_0x31d732[_0x6704('0x1a')]['where']||null:null,'attributes':_0x31d732[_0x6704('0x1a')]?_0x31d732[_0x6704('0x1a')][_0x6704('0x1c')]||null:null,'limit':_0x31d732['options']?_0x31d732['options'][_0x6704('0x1d')]||null:null})[_0x6704('0x1e')](function(_0x3cd12e){logger[_0x6704('0xc')](_0x6704('0x17'),_0x31d732);logger['debug'](_0x6704('0x17'),_0x31d732,JSON[_0x6704('0x11')](_0x3cd12e));_0xe49450(_0x3cd12e);})[_0x6704('0x16')](function(_0x348fcb){logger[_0x6704('0x12')](_0x6704('0x17'),_0x348fcb[_0x6704('0x14')],_0x31d732);_0x344ed9(_0x135f4b[_0x6704('0x12')](0x1f4,_0x348fcb[_0x6704('0x14')]));});});};exports[_0x6704('0x1f')]=function(_0x36bea4){var _0x1bdfee=this;return new Promise(function(_0x118d93,_0x4979ec){var _0x5ac014=require(_0x6704('0x20'));var _0xf875dc;return db[_0x6704('0x21')][_0x6704('0x22')]({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})[_0x6704('0x1e')](function(_0x18cd98){_0xf875dc=_0x18cd98;return db['VoiceRecording']['create'](_0x36bea4[_0x6704('0x19')]);})['then'](function(_0x812ba2){if(_0xf875dc['callRecordingEncryption']&&fs['existsSync'](_0x812ba2[_0x6704('0x23')])){var _0x115514=util[_0x6704('0x24')]('%s.cypher',_0x812ba2[_0x6704('0x23')]);return _0x5ac014[_0x6704('0x25')](_0x812ba2[_0x6704('0x23')],_0x115514,config[_0x6704('0x26')][_0x6704('0x27')])[_0x6704('0x1e')](function(){fs[_0x6704('0x28')](_0x812ba2[_0x6704('0x23')]);logger[_0x6704('0xc')](_0x6704('0x29'));return _0x812ba2;});}return _0x812ba2;})[_0x6704('0x1e')](function(_0x454885){logger[_0x6704('0xc')](_0x6704('0x1f'),_0x36bea4);logger[_0x6704('0xf')](_0x6704('0x1f'),_0x36bea4,JSON[_0x6704('0x11')](_0x454885));_0x118d93(_0x454885);})[_0x6704('0x16')](function(_0x219494){logger[_0x6704('0x12')](_0x6704('0x1f'),_0x219494[_0x6704('0x14')],_0x36bea4);_0x4979ec(_0x1bdfee[_0x6704('0x12')](0x1f4,_0x219494[_0x6704('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index fa9504e..6eec69d 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 _0x20bd=['exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','create','put','/:id','update','delete','destroy'];(function(_0x153153,_0xe72b25){var _0x22241e=function(_0xadf4f7){while(--_0xadf4f7){_0x153153['push'](_0x153153['shift']());}};_0x22241e(++_0xe72b25);}(_0x20bd,0x133));var _0xd20b=function(_0x127ce8,_0x203388){_0x127ce8=_0x127ce8-0x0;var _0x35738e=_0x20bd[_0x127ce8];return _0x35738e;};'use strict';var multer=require(_0xd20b('0x0'));var util=require('util');var path=require(_0xd20b('0x1'));var timeout=require(_0xd20b('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xd20b('0x3'));var auth=require(_0xd20b('0x4'));var interaction=require(_0xd20b('0x5'));var config=require(_0xd20b('0x6'));var controller=require('./voiceTransferReport.controller');router[_0xd20b('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xd20b('0x7')]('/:id',auth[_0xd20b('0x8')](),controller[_0xd20b('0x9')]);router['post']('/',auth[_0xd20b('0x8')](),controller[_0xd20b('0xa')]);router[_0xd20b('0xb')](_0xd20b('0xc'),auth['isAuthenticated'](),controller[_0xd20b('0xd')]);router[_0xd20b('0xe')]('/:id',auth[_0xd20b('0x8')](),controller[_0xd20b('0xf')]);module[_0xd20b('0x10')]=router; \ No newline at end of file +var _0x960c=['/describe','describe','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated'];(function(_0x1666a8,_0x17e631){var _0x5afe29=function(_0x2a5d29){while(--_0x2a5d29){_0x1666a8['push'](_0x1666a8['shift']());}};_0x5afe29(++_0x17e631);}(_0x960c,0x163));var _0xc960=function(_0x463d7b,_0x40d928){_0x463d7b=_0x463d7b-0x0;var _0x1273c0=_0x960c[_0x463d7b];return _0x1273c0;};'use strict';var multer=require(_0xc960('0x0'));var util=require(_0xc960('0x1'));var path=require(_0xc960('0x2'));var timeout=require(_0xc960('0x3'));var express=require(_0xc960('0x4'));var router=express[_0xc960('0x5')]();var fs_extra=require(_0xc960('0x6'));var auth=require(_0xc960('0x7'));var interaction=require(_0xc960('0x8'));var config=require(_0xc960('0x9'));var controller=require(_0xc960('0xa'));router[_0xc960('0xb')]('/',auth[_0xc960('0xc')](),controller['index']);router[_0xc960('0xb')](_0xc960('0xd'),auth['isAuthenticated'](),controller[_0xc960('0xe')]);router[_0xc960('0xb')](_0xc960('0xf'),auth['isAuthenticated'](),controller[_0xc960('0x10')]);router[_0xc960('0x11')]('/',auth[_0xc960('0xc')](),controller[_0xc960('0x12')]);router[_0xc960('0x13')]('/:id',auth[_0xc960('0xc')](),controller[_0xc960('0x14')]);router['delete']('/:id',auth[_0xc960('0xc')](),controller[_0xc960('0x15')]);module[_0xc960('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 9be11a1..2c75ad0 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 _0x20bd=['STRING','sequelize','moment','exports','ENUM','blind','attended'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x20bd,0x1b3));var _0xd20b=function(_0x4258ad,_0x59ba32){_0x4258ad=_0x4258ad-0x0;var _0x52267a=_0x20bd[_0x4258ad];return _0x52267a;};'use strict';var Sequelize=require(_0xd20b('0x0'));var moment=require(_0xd20b('0x1'));module[_0xd20b('0x2')]={'type':{'type':Sequelize[_0xd20b('0x3')](_0xd20b('0x4'),_0xd20b('0x5'))},'result':{'type':Sequelize[_0xd20b('0x6')]},'transfererchannel':{'type':Sequelize[_0xd20b('0x6')]},'transferercalleridnum':{'type':Sequelize[_0xd20b('0x6')]},'transferercalleridname':{'type':Sequelize[_0xd20b('0x6')]},'transfererconnectedlinenum':{'type':Sequelize[_0xd20b('0x6')]},'transfererconnectedlinename':{'type':Sequelize[_0xd20b('0x6')]},'transfereraccountcode':{'type':Sequelize[_0xd20b('0x6')]},'transferercontext':{'type':Sequelize[_0xd20b('0x6')]},'transfererexten':{'type':Sequelize[_0xd20b('0x6')]},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize[_0xd20b('0x6')]},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize[_0xd20b('0x6')]},'transfereeaccountcode':{'type':Sequelize[_0xd20b('0x6')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0xd20b('0x6')]},'transfereelinkedid':{'type':Sequelize[_0xd20b('0x6')]},'isexternal':{'type':Sequelize[_0xd20b('0x3')]('Yes','No')},'context':{'type':Sequelize[_0xd20b('0x6')]},'extension':{'type':Sequelize[_0xd20b('0x6')]}}; \ No newline at end of file +var _0xec55=['blind','attended','STRING','Yes','sequelize','moment','exports','ENUM'];(function(_0x13baed,_0x1b3a1d){var _0x17dabf=function(_0x48fbcc){while(--_0x48fbcc){_0x13baed['push'](_0x13baed['shift']());}};_0x17dabf(++_0x1b3a1d);}(_0xec55,0x164));var _0x5ec5=function(_0x27c201,_0xd947bf){_0x27c201=_0x27c201-0x0;var _0x3cabde=_0xec55[_0x27c201];return _0x3cabde;};'use strict';var Sequelize=require(_0x5ec5('0x0'));var moment=require(_0x5ec5('0x1'));module[_0x5ec5('0x2')]={'type':{'type':Sequelize[_0x5ec5('0x3')](_0x5ec5('0x4'),_0x5ec5('0x5'))},'result':{'type':Sequelize[_0x5ec5('0x6')]},'transfererchannel':{'type':Sequelize[_0x5ec5('0x6')]},'transferercalleridnum':{'type':Sequelize[_0x5ec5('0x6')]},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize[_0x5ec5('0x6')]},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0x5ec5('0x6')]},'transferercontext':{'type':Sequelize[_0x5ec5('0x6')]},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize[_0x5ec5('0x6')]},'transfereechannel':{'type':Sequelize[_0x5ec5('0x6')]},'transfereecalleridnum':{'type':Sequelize[_0x5ec5('0x6')]},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize[_0x5ec5('0x6')]},'transfereeconnectedlinename':{'type':Sequelize[_0x5ec5('0x6')]},'transfereeaccountcode':{'type':Sequelize[_0x5ec5('0x6')]},'transfereecontext':{'type':Sequelize[_0x5ec5('0x6')]},'transfereeexten':{'type':Sequelize['STRING']},'transfereelinkedid':{'type':Sequelize[_0x5ec5('0x6')]},'isexternal':{'type':Sequelize['ENUM'](_0x5ec5('0x7'),'No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x5ec5('0x6')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index e8e1c89..0c066da 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 _0x13e6=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','error','name','index','map','VoiceTransferReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','papaparse','ioredis'];(function(_0xa4928c,_0x16b89c){var _0x27cc29=function(_0x14b819){while(--_0x14b819){_0xa4928c['push'](_0xa4928c['shift']());}};_0x27cc29(++_0x16b89c);}(_0x13e6,0x11c));var _0x613e=function(_0x1946f6,_0x3d23c0){_0x1946f6=_0x1946f6-0x0;var _0x22e9cb=_0x13e6[_0x1946f6];return _0x22e9cb;};'use strict';var emlformat=require(_0x613e('0x0'));var rimraf=require(_0x613e('0x1'));var zipdir=require(_0x613e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x613e('0x3'));var BPromise=require(_0x613e('0x4'));var Mustache=require(_0x613e('0x5'));var util=require(_0x613e('0x6'));var path=require(_0x613e('0x7'));var sox=require(_0x613e('0x8'));var csv=require(_0x613e('0x9'));var ejs=require(_0x613e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x613e('0xb'));var squel=require(_0x613e('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x613e('0xd'));var toCsv=require(_0x613e('0x9'));var querystring=require('querystring');var Papa=require(_0x613e('0xe'));var Redis=require(_0x613e('0xf'));var authService=require(_0x613e('0x10'));var qs=require(_0x613e('0x11'));var as=require(_0x613e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x613e('0x13'))(_0x613e('0x14'));var utils=require(_0x613e('0x15'));var config=require(_0x613e('0x16'));var licenseUtil=require(_0x613e('0x17'));var db=require(_0x613e('0x18'))['db'];function respondWithStatusCode(_0x2fb831,_0x387a63){_0x387a63=_0x387a63||0xcc;return function(_0xb8ec0e){if(_0xb8ec0e){return _0x2fb831[_0x613e('0x19')](_0x387a63);}return _0x2fb831[_0x613e('0x1a')](_0x387a63)[_0x613e('0x1b')]();};}function respondWithResult(_0x216c07,_0x4eae49){_0x4eae49=_0x4eae49||0xc8;return function(_0xc5f3b6){if(_0xc5f3b6){return _0x216c07[_0x613e('0x1a')](_0x4eae49)[_0x613e('0x1c')](_0xc5f3b6);}};}function respondWithFilteredResult(_0x23c60e,_0x9f3414){return function(_0x3fd6d7){if(_0x3fd6d7){var _0x4d3cd7=typeof _0x9f3414[_0x613e('0x1d')]===_0x613e('0x1e')&&typeof _0x9f3414[_0x613e('0x1f')]===_0x613e('0x1e');var _0x6a580d=_0x3fd6d7['count'];var _0x1db96b=_0x4d3cd7?0x0:_0x9f3414[_0x613e('0x1d')];var _0x12cc8b=_0x4d3cd7?_0x3fd6d7[_0x613e('0x20')]:_0x9f3414[_0x613e('0x1d')]+_0x9f3414['limit'];var _0x27e518;if(_0x12cc8b>=_0x6a580d){_0x12cc8b=_0x6a580d;_0x27e518=0xc8;}else{_0x27e518=0xce;}_0x23c60e[_0x613e('0x1a')](_0x27e518);return _0x23c60e[_0x613e('0x21')]('Content-Range',_0x1db96b+'-'+_0x12cc8b+'/'+_0x6a580d)[_0x613e('0x1c')](_0x3fd6d7);}return null;};}function patchUpdates(_0x34a783){return function(_0x25a346){try{jsonpatch['apply'](_0x25a346,_0x34a783,!![]);}catch(_0x24c27c){return BPromise[_0x613e('0x22')](_0x24c27c);}return _0x25a346[_0x613e('0x23')]();};}function saveUpdates(_0xa60502,_0x5294c0){return function(_0x3cc3ea){if(_0x3cc3ea){return _0x3cc3ea[_0x613e('0x24')](_0xa60502)[_0x613e('0x25')](function(_0x39d07b){return _0x39d07b;});}return null;};}function removeEntity(_0x185c18,_0x402d0e){return function(_0xf2d6dd){if(_0xf2d6dd){return _0xf2d6dd[_0x613e('0x26')]()[_0x613e('0x25')](function(){_0x185c18['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x15d1cd,_0x386bcc){return function(_0x307674){if(!_0x307674){_0x15d1cd['sendStatus'](0x194);}return _0x307674;};}function handleError(_0x5d966d,_0x3a88d6){_0x3a88d6=_0x3a88d6||0x1f4;return function(_0x48f79b){logger[_0x613e('0x27')](_0x48f79b['stack']);if(_0x48f79b['name']){delete _0x48f79b[_0x613e('0x28')];}_0x5d966d[_0x613e('0x1a')](_0x3a88d6)['send'](_0x48f79b);};}exports[_0x613e('0x29')]=function(_0x3d7f9d,_0x40a105){var _0x476072={},_0x536365={},_0x490f53={'count':0x0,'rows':[]};var _0x2e56bf=_[_0x613e('0x2a')](db[_0x613e('0x2b')][_0x613e('0x2c')],function(_0x24723d){return{'name':_0x24723d[_0x613e('0x2d')],'type':_0x24723d[_0x613e('0x2e')][_0x613e('0x2f')]};});_0x536365['model']=_[_0x613e('0x2a')](_0x2e56bf,_0x613e('0x28'));_0x536365[_0x613e('0x30')]=_[_0x613e('0x31')](_0x3d7f9d['query']);_0x536365[_0x613e('0x32')]=_[_0x613e('0x33')](_0x536365['model'],_0x536365['query']);_0x476072[_0x613e('0x34')]=_[_0x613e('0x33')](_0x536365[_0x613e('0x35')],qs['fields'](_0x3d7f9d[_0x613e('0x30')][_0x613e('0x36')]));_0x476072[_0x613e('0x34')]=_0x476072[_0x613e('0x34')][_0x613e('0x37')]?_0x476072[_0x613e('0x34')]:_0x536365[_0x613e('0x35')];if(!_0x3d7f9d['query'][_0x613e('0x38')]('nolimit')){_0x476072['limit']=qs[_0x613e('0x1f')](_0x3d7f9d[_0x613e('0x30')][_0x613e('0x1f')]);_0x476072[_0x613e('0x1d')]=qs['offset'](_0x3d7f9d[_0x613e('0x30')][_0x613e('0x1d')]);}_0x476072[_0x613e('0x39')]=qs['sort'](_0x3d7f9d['query'][_0x613e('0x3a')]);_0x476072['where']=qs[_0x613e('0x32')](_['pick'](_0x3d7f9d[_0x613e('0x30')],_0x536365['filters']),_0x2e56bf);if(_0x3d7f9d[_0x613e('0x30')]['filter']){_0x476072[_0x613e('0x3b')]=_[_0x613e('0x3c')](_0x476072[_0x613e('0x3b')],{'$or':_[_0x613e('0x2a')](_0x2e56bf,function(_0x3968fa){if(_0x3968fa[_0x613e('0x2e')]!==_0x613e('0x3d')){var _0x271aeb={};_0x271aeb[_0x3968fa[_0x613e('0x28')]]={'$like':'%'+_0x3d7f9d[_0x613e('0x30')][_0x613e('0x3e')]+'%'};return _0x271aeb;}})});}_0x476072=_['merge']({},_0x476072,_0x3d7f9d[_0x613e('0x3f')]);var _0x128a3b={'where':_0x476072[_0x613e('0x3b')]};return db[_0x613e('0x2b')][_0x613e('0x20')](_0x128a3b)['then'](function(_0x40144f){_0x490f53[_0x613e('0x20')]=_0x40144f;if(_0x3d7f9d['query'][_0x613e('0x40')]){_0x476072[_0x613e('0x41')]=[{'all':!![]}];}return db[_0x613e('0x2b')][_0x613e('0x42')](_0x476072);})[_0x613e('0x25')](function(_0x30af44){_0x490f53[_0x613e('0x43')]=_0x30af44;return _0x490f53;})['then'](respondWithFilteredResult(_0x40a105,_0x476072))[_0x613e('0x44')](handleError(_0x40a105,null));};exports[_0x613e('0x45')]=function(_0x53251f,_0x930105){var _0x3c12da={'raw':!![],'where':{'id':_0x53251f[_0x613e('0x46')]['id']}},_0x32ee73={};_0x32ee73[_0x613e('0x35')]=_[_0x613e('0x31')](db[_0x613e('0x2b')][_0x613e('0x2c')]);_0x32ee73[_0x613e('0x30')]=_['keys'](_0x53251f['query']);_0x32ee73[_0x613e('0x32')]=_[_0x613e('0x33')](_0x32ee73[_0x613e('0x35')],_0x32ee73[_0x613e('0x30')]);_0x3c12da[_0x613e('0x34')]=_['intersection'](_0x32ee73[_0x613e('0x35')],qs[_0x613e('0x36')](_0x53251f['query'][_0x613e('0x36')]));_0x3c12da[_0x613e('0x34')]=_0x3c12da[_0x613e('0x34')][_0x613e('0x37')]?_0x3c12da[_0x613e('0x34')]:_0x32ee73[_0x613e('0x35')];if(_0x53251f[_0x613e('0x30')][_0x613e('0x40')]){_0x3c12da[_0x613e('0x41')]=[{'all':!![]}];}_0x3c12da=_['merge']({},_0x3c12da,_0x53251f[_0x613e('0x3f')]);return db[_0x613e('0x2b')][_0x613e('0x47')](_0x3c12da)[_0x613e('0x25')](handleEntityNotFound(_0x930105,null))[_0x613e('0x25')](respondWithResult(_0x930105,null))['catch'](handleError(_0x930105,null));};exports[_0x613e('0x48')]=function(_0x4e1af4,_0x279fe3){return db[_0x613e('0x2b')]['create'](_0x4e1af4[_0x613e('0x49')],{})[_0x613e('0x25')](respondWithResult(_0x279fe3,0xc9))['catch'](handleError(_0x279fe3,null));};exports['update']=function(_0x25a01b,_0x41b647){if(_0x25a01b[_0x613e('0x49')]['id']){delete _0x25a01b[_0x613e('0x49')]['id'];}return db[_0x613e('0x2b')][_0x613e('0x47')]({'where':{'id':_0x25a01b['params']['id']}})[_0x613e('0x25')](handleEntityNotFound(_0x41b647,null))['then'](saveUpdates(_0x25a01b[_0x613e('0x49')],null))[_0x613e('0x25')](respondWithResult(_0x41b647,null))[_0x613e('0x44')](handleError(_0x41b647,null));};exports[_0x613e('0x26')]=function(_0x20c2f9,_0x39872a){return db[_0x613e('0x2b')][_0x613e('0x47')]({'where':{'id':_0x20c2f9[_0x613e('0x46')]['id']}})['then'](handleEntityNotFound(_0x39872a,null))[_0x613e('0x25')](removeEntity(_0x39872a,null))[_0x613e('0x44')](handleError(_0x39872a,null));};exports['describe']=function(_0x2109ee,_0x1196f5){return db[_0x613e('0x2b')][_0x613e('0x4a')]()[_0x613e('0x25')](respondWithResult(_0x1196f5,null))['catch'](handleError(_0x1196f5,null));}; \ No newline at end of file +var _0x2600=['merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','VoiceTransferReport','key','query','keys','intersection','attributes','model','fields','length','nolimit','order','sort','filters','pick','filter','where'];(function(_0x4b2271,_0x190a7c){var _0x58696c=function(_0x481a1){while(--_0x481a1){_0x4b2271['push'](_0x4b2271['shift']());}};_0x58696c(++_0x190a7c);}(_0x2600,0x19a));var _0x0260=function(_0x2125a1,_0x2e5d4f){_0x2125a1=_0x2125a1-0x0;var _0x4017e9=_0x2600[_0x2125a1];return _0x4017e9;};'use strict';var emlformat=require(_0x0260('0x0'));var rimraf=require(_0x0260('0x1'));var zipdir=require(_0x0260('0x2'));var jsonpatch=require(_0x0260('0x3'));var rp=require(_0x0260('0x4'));var moment=require(_0x0260('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0260('0x6'));var util=require(_0x0260('0x7'));var path=require(_0x0260('0x8'));var sox=require(_0x0260('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0260('0xa'));var _=require(_0x0260('0xb'));var squel=require(_0x0260('0xc'));var crypto=require('crypto');var jsforce=require(_0x0260('0xd'));var deskjs=require(_0x0260('0xe'));var toCsv=require(_0x0260('0xf'));var querystring=require(_0x0260('0x10'));var Papa=require('papaparse');var Redis=require(_0x0260('0x11'));var authService=require(_0x0260('0x12'));var qs=require(_0x0260('0x13'));var as=require(_0x0260('0x14'));var hardwareService=require(_0x0260('0x15'));var logger=require(_0x0260('0x16'))(_0x0260('0x17'));var utils=require(_0x0260('0x18'));var config=require(_0x0260('0x19'));var licenseUtil=require(_0x0260('0x1a'));var db=require(_0x0260('0x1b'))['db'];function respondWithStatusCode(_0x79e1ce,_0x190339){_0x190339=_0x190339||0xcc;return function(_0x4220f8){if(_0x4220f8){return _0x79e1ce['sendStatus'](_0x190339);}return _0x79e1ce[_0x0260('0x1c')](_0x190339)[_0x0260('0x1d')]();};}function respondWithResult(_0x1ff73f,_0x49105e){_0x49105e=_0x49105e||0xc8;return function(_0x5e6003){if(_0x5e6003){return _0x1ff73f[_0x0260('0x1c')](_0x49105e)[_0x0260('0x1e')](_0x5e6003);}};}function respondWithFilteredResult(_0x54eb94,_0x4fc08b){return function(_0x53b18b){if(_0x53b18b){var _0x4bf9fe=typeof _0x4fc08b[_0x0260('0x1f')]===_0x0260('0x20')&&typeof _0x4fc08b[_0x0260('0x21')]===_0x0260('0x20');var _0x34fc3b=_0x53b18b[_0x0260('0x22')];var _0x5a09de=_0x4bf9fe?0x0:_0x4fc08b['offset'];var _0x38570b=_0x4bf9fe?_0x53b18b[_0x0260('0x22')]:_0x4fc08b[_0x0260('0x1f')]+_0x4fc08b[_0x0260('0x21')];var _0x554d4c;if(_0x38570b>=_0x34fc3b){_0x38570b=_0x34fc3b;_0x554d4c=0xc8;}else{_0x554d4c=0xce;}_0x54eb94[_0x0260('0x1c')](_0x554d4c);return _0x54eb94[_0x0260('0x23')](_0x0260('0x24'),_0x5a09de+'-'+_0x38570b+'/'+_0x34fc3b)['json'](_0x53b18b);}return null;};}function patchUpdates(_0x5ad5f2){return function(_0x45e1ab){try{jsonpatch[_0x0260('0x25')](_0x45e1ab,_0x5ad5f2,!![]);}catch(_0xacc22a){return BPromise[_0x0260('0x26')](_0xacc22a);}return _0x45e1ab[_0x0260('0x27')]();};}function saveUpdates(_0xd28df2,_0x269313){return function(_0x289867){if(_0x289867){return _0x289867[_0x0260('0x28')](_0xd28df2)[_0x0260('0x29')](function(_0x1d7b18){return _0x1d7b18;});}return null;};}function removeEntity(_0x325258,_0x2baa90){return function(_0x144647){if(_0x144647){return _0x144647[_0x0260('0x2a')]()[_0x0260('0x29')](function(){_0x325258['status'](0xcc)[_0x0260('0x1d')]();});}};}function handleEntityNotFound(_0x346d86,_0xa0faba){return function(_0x35a239){if(!_0x35a239){_0x346d86['sendStatus'](0x194);}return _0x35a239;};}function handleError(_0x57930d,_0x2642c6){_0x2642c6=_0x2642c6||0x1f4;return function(_0x1448d2){logger[_0x0260('0x2b')](_0x1448d2[_0x0260('0x2c')]);if(_0x1448d2[_0x0260('0x2d')]){delete _0x1448d2[_0x0260('0x2d')];}_0x57930d['status'](_0x2642c6)['send'](_0x1448d2);};}exports[_0x0260('0x2e')]=function(_0x3159a0,_0xa9ea58){var _0x2ab62d={},_0x10003d={},_0x53c684={'count':0x0,'rows':[]};var _0x10c6ae=_[_0x0260('0x2f')](db[_0x0260('0x30')]['rawAttributes'],function(_0x505ee5){return{'name':_0x505ee5['fieldName'],'type':_0x505ee5['type'][_0x0260('0x31')]};});_0x10003d['model']=_[_0x0260('0x2f')](_0x10c6ae,'name');_0x10003d[_0x0260('0x32')]=_[_0x0260('0x33')](_0x3159a0[_0x0260('0x32')]);_0x10003d['filters']=_[_0x0260('0x34')](_0x10003d['model'],_0x10003d['query']);_0x2ab62d[_0x0260('0x35')]=_[_0x0260('0x34')](_0x10003d[_0x0260('0x36')],qs['fields'](_0x3159a0[_0x0260('0x32')][_0x0260('0x37')]));_0x2ab62d[_0x0260('0x35')]=_0x2ab62d[_0x0260('0x35')][_0x0260('0x38')]?_0x2ab62d[_0x0260('0x35')]:_0x10003d[_0x0260('0x36')];if(!_0x3159a0['query']['hasOwnProperty'](_0x0260('0x39'))){_0x2ab62d['limit']=qs[_0x0260('0x21')](_0x3159a0[_0x0260('0x32')]['limit']);_0x2ab62d['offset']=qs[_0x0260('0x1f')](_0x3159a0['query'][_0x0260('0x1f')]);}_0x2ab62d[_0x0260('0x3a')]=qs[_0x0260('0x3b')](_0x3159a0['query'][_0x0260('0x3b')]);_0x2ab62d['where']=qs[_0x0260('0x3c')](_[_0x0260('0x3d')](_0x3159a0[_0x0260('0x32')],_0x10003d[_0x0260('0x3c')]),_0x10c6ae);if(_0x3159a0['query'][_0x0260('0x3e')]){_0x2ab62d[_0x0260('0x3f')]=_[_0x0260('0x40')](_0x2ab62d[_0x0260('0x3f')],{'$or':_[_0x0260('0x2f')](_0x10c6ae,function(_0x3f2a77){if(_0x3f2a77[_0x0260('0x41')]!==_0x0260('0x42')){var _0x27ad82={};_0x27ad82[_0x3f2a77['name']]={'$like':'%'+_0x3159a0[_0x0260('0x32')][_0x0260('0x3e')]+'%'};return _0x27ad82;}})});}_0x2ab62d=_[_0x0260('0x40')]({},_0x2ab62d,_0x3159a0[_0x0260('0x43')]);var _0x54dba9={'where':_0x2ab62d[_0x0260('0x3f')]};return db[_0x0260('0x30')][_0x0260('0x22')](_0x54dba9)['then'](function(_0x15b60f){_0x53c684[_0x0260('0x22')]=_0x15b60f;if(_0x3159a0[_0x0260('0x32')][_0x0260('0x44')]){_0x2ab62d[_0x0260('0x45')]=[{'all':!![]}];}return db[_0x0260('0x30')][_0x0260('0x46')](_0x2ab62d);})['then'](function(_0x5b5473){_0x53c684[_0x0260('0x47')]=_0x5b5473;return _0x53c684;})[_0x0260('0x29')](respondWithFilteredResult(_0xa9ea58,_0x2ab62d))[_0x0260('0x48')](handleError(_0xa9ea58,null));};exports[_0x0260('0x49')]=function(_0x2f99e1,_0x5a1561){var _0x35531b={'raw':!![],'where':{'id':_0x2f99e1[_0x0260('0x4a')]['id']}},_0x15f826={};_0x15f826['model']=_[_0x0260('0x33')](db['VoiceTransferReport']['rawAttributes']);_0x15f826['query']=_[_0x0260('0x33')](_0x2f99e1[_0x0260('0x32')]);_0x15f826[_0x0260('0x3c')]=_[_0x0260('0x34')](_0x15f826['model'],_0x15f826[_0x0260('0x32')]);_0x35531b[_0x0260('0x35')]=_['intersection'](_0x15f826[_0x0260('0x36')],qs[_0x0260('0x37')](_0x2f99e1[_0x0260('0x32')][_0x0260('0x37')]));_0x35531b['attributes']=_0x35531b['attributes'][_0x0260('0x38')]?_0x35531b[_0x0260('0x35')]:_0x15f826[_0x0260('0x36')];if(_0x2f99e1[_0x0260('0x32')][_0x0260('0x44')]){_0x35531b[_0x0260('0x45')]=[{'all':!![]}];}_0x35531b=_[_0x0260('0x40')]({},_0x35531b,_0x2f99e1[_0x0260('0x43')]);return db[_0x0260('0x30')][_0x0260('0x4b')](_0x35531b)[_0x0260('0x29')](handleEntityNotFound(_0x5a1561,null))[_0x0260('0x29')](respondWithResult(_0x5a1561,null))[_0x0260('0x48')](handleError(_0x5a1561,null));};exports[_0x0260('0x4c')]=function(_0x34442c,_0x12ea76){return db['VoiceTransferReport'][_0x0260('0x4c')](_0x34442c['body'],{})[_0x0260('0x29')](respondWithResult(_0x12ea76,0xc9))[_0x0260('0x48')](handleError(_0x12ea76,null));};exports[_0x0260('0x28')]=function(_0x77f9,_0x2b0d9f){if(_0x77f9['body']['id']){delete _0x77f9[_0x0260('0x4d')]['id'];}return db['VoiceTransferReport'][_0x0260('0x4b')]({'where':{'id':_0x77f9['params']['id']}})['then'](handleEntityNotFound(_0x2b0d9f,null))[_0x0260('0x29')](saveUpdates(_0x77f9[_0x0260('0x4d')],null))['then'](respondWithResult(_0x2b0d9f,null))['catch'](handleError(_0x2b0d9f,null));};exports[_0x0260('0x2a')]=function(_0x47b7ed,_0x2a2a1e){return db[_0x0260('0x30')][_0x0260('0x4b')]({'where':{'id':_0x47b7ed['params']['id']}})[_0x0260('0x29')](handleEntityNotFound(_0x2a2a1e,null))['then'](removeEntity(_0x2a2a1e,null))[_0x0260('0x48')](handleError(_0x2a2a1e,null));};exports['describe']=function(_0x3153c2,_0x492457){return db[_0x0260('0x30')][_0x0260('0x4e')]()[_0x0260('0x29')](respondWithResult(_0x492457,null))['catch'](handleError(_0x492457,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 4a6929f..c8767d9 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 _0x1419=['VoiceTransferReport','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceTransferReport.attributes','exports'];(function(_0x439f72,_0x135301){var _0x32008c=function(_0x5afc04){while(--_0x5afc04){_0x439f72['push'](_0x439f72['shift']());}};_0x32008c(++_0x135301);}(_0x1419,0x182));var _0x9141=function(_0x24bf46,_0x265c00){_0x24bf46=_0x24bf46-0x0;var _0x3dcdca=_0x1419[_0x24bf46];return _0x3dcdca;};'use strict';var _=require('lodash');var util=require(_0x9141('0x0'));var logger=require(_0x9141('0x1'))('api');var moment=require(_0x9141('0x2'));var BPromise=require(_0x9141('0x3'));var rp=require(_0x9141('0x4'));var fs=require('fs');var path=require(_0x9141('0x5'));var rimraf=require(_0x9141('0x6'));var config=require(_0x9141('0x7'));var attributes=require(_0x9141('0x8'));module[_0x9141('0x9')]=function(_0x37e112,_0x34a54d){return _0x37e112['define'](_0x9141('0xa'),attributes,{'tableName':'report_call_transfer','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x72a0=['lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceTransferReport.attributes','VoiceTransferReport','report_call_transfer'];(function(_0x511b76,_0x4727fa){var _0x5424ff=function(_0x24b7c0){while(--_0x24b7c0){_0x511b76['push'](_0x511b76['shift']());}};_0x5424ff(++_0x4727fa);}(_0x72a0,0x1b8));var _0x072a=function(_0x1b13e3,_0xd2b9c8){_0x1b13e3=_0x1b13e3-0x0;var _0x1e9ab9=_0x72a0[_0x1b13e3];return _0x1e9ab9;};'use strict';var _=require(_0x072a('0x0'));var util=require(_0x072a('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x072a('0x2'));var BPromise=require(_0x072a('0x3'));var rp=require(_0x072a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x072a('0x5'));var config=require(_0x072a('0x6'));var attributes=require(_0x072a('0x7'));module['exports']=function(_0x3dad5a,_0x401e56){return _0x3dad5a['define'](_0x072a('0x8'),attributes,{'tableName':_0x072a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.rpc.js b/server/api/voiceTransferReport/voiceTransferReport.rpc.js index 147a475..d49db2f 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 _0xbd52=['VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xbd52,0x15b));var _0x2bd5=function(_0x256b67,_0x14e47b){_0x256b67=_0x256b67-0x0;var _0x3e2d99=_0xbd52[_0x256b67];return _0x3e2d99;};'use strict';var _=require(_0x2bd5('0x0'));var util=require(_0x2bd5('0x1'));var moment=require(_0x2bd5('0x2'));var BPromise=require(_0x2bd5('0x3'));var rs=require(_0x2bd5('0x4'));var fs=require('fs');var Redis=require(_0x2bd5('0x5'));var db=require(_0x2bd5('0x6'))['db'];var utils=require(_0x2bd5('0x7'));var logger=require('../../config/logger')(_0x2bd5('0x8'));var config=require('../../config/environment');var jayson=require(_0x2bd5('0x9'));var client=jayson[_0x2bd5('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1646b8,_0x4ca19c,_0x4b9728){return new BPromise(function(_0x547201,_0x2d9927){return client[_0x2bd5('0xb')](_0x1646b8,_0x4b9728)[_0x2bd5('0xc')](function(_0x275f88){logger[_0x2bd5('0xd')](_0x2bd5('0xe'),_0x4ca19c,_0x2bd5('0xf'));logger[_0x2bd5('0x10')](_0x2bd5('0x11'),_0x4ca19c,_0x2bd5('0xf'),JSON[_0x2bd5('0x12')](_0x275f88));if(_0x275f88['error']){if(_0x275f88[_0x2bd5('0x13')]['code']===0x1f4){logger[_0x2bd5('0x13')]('VoiceTransferReport,\x20%s,\x20%s',_0x4ca19c,_0x275f88[_0x2bd5('0x13')]['message']);return _0x2d9927(_0x275f88[_0x2bd5('0x13')]['message']);}logger[_0x2bd5('0x13')](_0x2bd5('0xe'),_0x4ca19c,_0x275f88[_0x2bd5('0x13')][_0x2bd5('0x14')]);return _0x547201(_0x275f88[_0x2bd5('0x13')][_0x2bd5('0x14')]);}else{logger[_0x2bd5('0xd')](_0x2bd5('0xe'),_0x4ca19c,'request\x20sent');_0x547201(_0x275f88[_0x2bd5('0x15')][_0x2bd5('0x14')]);}})[_0x2bd5('0x16')](function(_0x1e1624){logger['error'](_0x2bd5('0xe'),_0x4ca19c,_0x1e1624);_0x2d9927(_0x1e1624);});});}exports[_0x2bd5('0x17')]=function(_0xbfe321){var _0x58d7ba=this;return new Promise(function(_0x7fd31b,_0xe4cb28){return db[_0x2bd5('0x18')][_0x2bd5('0x19')](_0xbfe321['body'],{'raw':_0xbfe321[_0x2bd5('0x1a')]?_0xbfe321[_0x2bd5('0x1a')][_0x2bd5('0x1b')]===undefined?!![]:![]:!![]})[_0x2bd5('0xc')](function(_0xf48d2){logger['info'](_0x2bd5('0x17'),_0xbfe321);logger[_0x2bd5('0x10')](_0x2bd5('0x17'),_0xbfe321,JSON[_0x2bd5('0x12')](_0xf48d2));_0x7fd31b(_0xf48d2);})['catch'](function(_0x1eb49b){logger[_0x2bd5('0x13')]('CreateVoiceTransferReport',_0x1eb49b[_0x2bd5('0x14')],_0xbfe321);_0xe4cb28(_0x58d7ba[_0x2bd5('0x13')](0x1f4,_0x1eb49b[_0x2bd5('0x14')]));});});}; \ No newline at end of file +var _0x106f=['code','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','then','debug','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4a73dd,_0x58e46c){var _0x279e6b=function(_0x25254b){while(--_0x25254b){_0x4a73dd['push'](_0x4a73dd['shift']());}};_0x279e6b(++_0x58e46c);}(_0x106f,0x9d));var _0xf106=function(_0x5237ba,_0x41febe){_0x5237ba=_0x5237ba-0x0;var _0x50951d=_0x106f[_0x5237ba];return _0x50951d;};'use strict';var _=require(_0xf106('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf106('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf106('0x2'));var db=require(_0xf106('0x3'))['db'];var utils=require(_0xf106('0x4'));var logger=require(_0xf106('0x5'))(_0xf106('0x6'));var config=require(_0xf106('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xf106('0x8')][_0xf106('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x537dcb,_0x2428a1,_0x4ee979){return new BPromise(function(_0x559073,_0x297edb){return client[_0xf106('0xa')](_0x537dcb,_0x4ee979)['then'](function(_0xb22071){logger[_0xf106('0xb')](_0xf106('0xc'),_0x2428a1,_0xf106('0xd'));logger['debug'](_0xf106('0xe'),_0x2428a1,_0xf106('0xd'),JSON[_0xf106('0xf')](_0xb22071));if(_0xb22071['error']){if(_0xb22071[_0xf106('0x10')][_0xf106('0x11')]===0x1f4){logger['error']('VoiceTransferReport,\x20%s,\x20%s',_0x2428a1,_0xb22071[_0xf106('0x10')][_0xf106('0x12')]);return _0x297edb(_0xb22071[_0xf106('0x10')]['message']);}logger[_0xf106('0x10')](_0xf106('0xc'),_0x2428a1,_0xb22071['error'][_0xf106('0x12')]);return _0x559073(_0xb22071[_0xf106('0x10')][_0xf106('0x12')]);}else{logger['info'](_0xf106('0xc'),_0x2428a1,_0xf106('0xd'));_0x559073(_0xb22071[_0xf106('0x13')][_0xf106('0x12')]);}})[_0xf106('0x14')](function(_0x1aaf0d){logger[_0xf106('0x10')]('VoiceTransferReport,\x20%s,\x20%s',_0x2428a1,_0x1aaf0d);_0x297edb(_0x1aaf0d);});});}exports[_0xf106('0x15')]=function(_0x395de7){var _0x3e07e9=this;return new Promise(function(_0x201d73,_0x297970){return db[_0xf106('0x16')][_0xf106('0x17')](_0x395de7[_0xf106('0x18')],{'raw':_0x395de7[_0xf106('0x19')]?_0x395de7[_0xf106('0x19')][_0xf106('0x1a')]===undefined?!![]:![]:!![]})[_0xf106('0x1b')](function(_0x4a9836){logger[_0xf106('0xb')](_0xf106('0x15'),_0x395de7);logger[_0xf106('0x1c')](_0xf106('0x15'),_0x395de7,JSON[_0xf106('0xf')](_0x4a9836));_0x201d73(_0x4a9836);})['catch'](function(_0x1fefe5){logger[_0xf106('0x10')]('CreateVoiceTransferReport',_0x1fefe5['message'],_0x395de7);_0x297970(_0x3e07e9[_0xf106('0x10')](0x1f4,_0x1fefe5['message']));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 43e3d50..550210e 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 _0x9d33=['canUpdate','answer','hold','/unhold','unhold','/calls','calls','/transfer','transfer','exports','Router','../../components/auth/service','./webbar.controller','post','/originate','isAuthenticated','originate','/hangup','hangup','/answer'];(function(_0x15cda6,_0x264c74){var _0x369d55=function(_0x2a5c92){while(--_0x2a5c92){_0x15cda6['push'](_0x15cda6['shift']());}};_0x369d55(++_0x264c74);}(_0x9d33,0xfa));var _0x39d3=function(_0x44efb7,_0x5eb1e0){_0x44efb7=_0x44efb7-0x0;var _0x5e9880=_0x9d33[_0x44efb7];return _0x5e9880;};'use strict';var express=require('express');var router=express[_0x39d3('0x0')]();var auth=require(_0x39d3('0x1'));var controller=require(_0x39d3('0x2'));router[_0x39d3('0x3')](_0x39d3('0x4'),auth[_0x39d3('0x5')](),auth['canUpdate'](),controller[_0x39d3('0x6')]);router[_0x39d3('0x3')](_0x39d3('0x7'),auth[_0x39d3('0x5')](),auth['canUpdate'](),controller[_0x39d3('0x8')]);router[_0x39d3('0x3')](_0x39d3('0x9'),auth[_0x39d3('0x5')](),auth[_0x39d3('0xa')](),controller[_0x39d3('0xb')]);router[_0x39d3('0x3')]('/hold',auth[_0x39d3('0x5')](),auth['canUpdate'](),controller[_0x39d3('0xc')]);router[_0x39d3('0x3')](_0x39d3('0xd'),auth[_0x39d3('0x5')](),auth[_0x39d3('0xa')](),controller[_0x39d3('0xe')]);router[_0x39d3('0x3')](_0x39d3('0xf'),auth[_0x39d3('0x5')](),auth['canUpdate'](),controller[_0x39d3('0x10')]);router['post'](_0x39d3('0x11'),auth[_0x39d3('0x5')](),auth[_0x39d3('0xa')](),controller[_0x39d3('0x12')]);module[_0x39d3('0x13')]=router; \ No newline at end of file +var _0x91ad=['/transfer','transfer','exports','express','./webbar.controller','post','isAuthenticated','canUpdate','originate','/hangup','hangup','/answer','/hold','hold','/unhold','unhold','/calls','calls'];(function(_0x2c5e67,_0x33ac64){var _0x1a8581=function(_0x516a33){while(--_0x516a33){_0x2c5e67['push'](_0x2c5e67['shift']());}};_0x1a8581(++_0x33ac64);}(_0x91ad,0x93));var _0xd91a=function(_0x3ce6f5,_0x29c4ae){_0x3ce6f5=_0x3ce6f5-0x0;var _0x2844a6=_0x91ad[_0x3ce6f5];return _0x2844a6;};'use strict';var express=require(_0xd91a('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0xd91a('0x1'));router[_0xd91a('0x2')]('/originate',auth[_0xd91a('0x3')](),auth[_0xd91a('0x4')](),controller[_0xd91a('0x5')]);router[_0xd91a('0x2')](_0xd91a('0x6'),auth[_0xd91a('0x3')](),auth['canUpdate'](),controller[_0xd91a('0x7')]);router[_0xd91a('0x2')](_0xd91a('0x8'),auth['isAuthenticated'](),auth[_0xd91a('0x4')](),controller['answer']);router[_0xd91a('0x2')](_0xd91a('0x9'),auth[_0xd91a('0x3')](),auth[_0xd91a('0x4')](),controller[_0xd91a('0xa')]);router[_0xd91a('0x2')](_0xd91a('0xb'),auth[_0xd91a('0x3')](),auth[_0xd91a('0x4')](),controller[_0xd91a('0xc')]);router['post'](_0xd91a('0xd'),auth[_0xd91a('0x3')](),auth[_0xd91a('0x4')](),controller[_0xd91a('0xe')]);router[_0xd91a('0x2')](_0xd91a('0xf'),auth[_0xd91a('0x3')](),auth['canUpdate'](),controller[_0xd91a('0x10')]);module[_0xd91a('0x11')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index e6c4c7c..9db8a23 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 _0xcffe=['transfer','transfer\x20fired:','webbar:transfer','path','lodash','../../mysqldb','../../config/environment','util','bluebird','jayson/promise','client','http','../../config/logger','redis','defaults','localhost','socket.io-emitter','validate','userId\x20is\x20required','string','callNumber\x20is\x20required','number','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','log','handleError:','error','stack','name','status','send','NotFound','then','code','message','result','catch','User','filter','rows','sessionId','length','sessionId\x20','\x20not\x20found!','originate\x20fired:','body','json','userId','callNumber','entityFound:','format','webbar:originate','originate\x20executed!','hangup','hangup\x20fired:','user:%s','webbar:hangup','hangup\x20executed!','answer\x20fired:','webbar:answer','answer\x20executed!','hold','unhold','unhold\x20executed!','calls\x20fired:','VoiceChannels','all'];(function(_0x290490,_0x2e9ccf){var _0xb3ebf9=function(_0x558f39){while(--_0x558f39){_0x290490['push'](_0x290490['shift']());}};_0xb3ebf9(++_0x2e9ccf);}(_0xcffe,0x1a1));var _0xecff=function(_0x1ae78f,_0x122ed2){_0x1ae78f=_0x1ae78f-0x0;var _0x5baf80=_0xcffe[_0x1ae78f];return _0x5baf80;};'use strict';var path=require(_0xecff('0x0'));var fs=require('fs');var _=require(_0xecff('0x1'));var db=require(_0xecff('0x2'))['db'];var config=require(_0xecff('0x3'));var util=require(_0xecff('0x4'));var BPromise=require(_0xecff('0x5'));var jayson=require(_0xecff('0x6'));var amiClient=jayson[_0xecff('0x7')][_0xecff('0x8')]({'port':0x232a});var logger=require(_0xecff('0x9'))('webbarapi');var Redis=require('ioredis');config[_0xecff('0xa')]=_[_0xecff('0xb')](config[_0xecff('0xa')],{'host':_0xecff('0xc'),'port':0x18eb});var io=require(_0xecff('0xd'))(new Redis(config[_0xecff('0xa')]));var Schema=require(_0xecff('0xe'));var originateValidation=new Schema({'userId':{'type':'number','required':[!![],_0xecff('0xf')]},'callNumber':{'type':_0xecff('0x10'),'required':[!![],_0xecff('0x11')]},'callerId':{'type':_0xecff('0x10')},'callbackUrl':{'type':_0xecff('0x10')}});var hangupValidation=new Schema({'userId':{'type':'number','required':[!![],_0xecff('0xf')]},'sessionId':{'type':_0xecff('0x10'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xecff('0x12'),'required':[!![],_0xecff('0xf')]},'sessionId':{'type':_0xecff('0x10'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0xecff('0x12'),'required':[!![],_0xecff('0xf')]},'sessionId':{'type':_0xecff('0x10'),'required':[!![],_0xecff('0x13')]},'transferNumber':{'type':_0xecff('0x10'),'required':[!![],_0xecff('0x14')]}});var holdValidation=new Schema({'userId':{'type':_0xecff('0x12'),'required':[!![],_0xecff('0xf')]},'sessionId':{'type':_0xecff('0x10'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xecff('0x10'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0xecff('0x12'),'required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':_0xecff('0x12'),'required':[!![],_0xecff('0xf')]}});function emit(_0x3a7623,_0x596b09,_0x52b62f){logger[_0xecff('0x15')](_0x3a7623,_0x596b09,JSON[_0xecff('0x16')](_0x52b62f));io['to'](_0x3a7623)['emit'](_0x596b09,_0x52b62f);}function handleError(_0x42d6c1){return function(_0x3adc81){console[_0xecff('0x17')](_0xecff('0x18'),_0x3adc81,_0x3adc81 instanceof RangeError);logger[_0xecff('0x19')](_0x3adc81[_0xecff('0x1a')]);if(_0x3adc81 instanceof RangeError){if(_0x3adc81['name']){delete _0x3adc81[_0xecff('0x1b')];}_0x42d6c1[_0xecff('0x1c')](0x194)[_0xecff('0x1d')](_0x3adc81);}else{if(_0x3adc81[_0xecff('0x1b')]){delete _0x3adc81['name'];}_0x42d6c1[_0xecff('0x1c')](0x1f4)[_0xecff('0x1d')](_0x3adc81);}};}function checkError(){return function(_0x393acf){if(!_0x393acf){throw new RangeError(_0xecff('0x1e'));}return _0x393acf;};}function respondWithRpcPromise(_0x284458,_0x2402e0){return new BPromise(function(_0x494754,_0x14378d){var _0x520d6d=amiClient;return _0x520d6d['request'](_0x284458,_0x2402e0)[_0xecff('0x1f')](function(_0x4fdc8e){if(_0x4fdc8e[_0xecff('0x19')]){if(_0x4fdc8e['error'][_0xecff('0x20')]===0x1f4){return _0x14378d(_0x4fdc8e['error'][_0xecff('0x21')]);}return _0x494754(_0x4fdc8e[_0xecff('0x19')]['message']);}else{_0x494754(_0x4fdc8e[_0xecff('0x22')]);}})[_0xecff('0x23')](function(_0x393312){_0x14378d(_0x393312);});});}function getAgent(_0x3cadb9){return db[_0xecff('0x24')]['findOne']({'where':{'id':_0x3cadb9,'role':'agent'}})[_0xecff('0x1f')](checkError());}function getAgentCheckSession(_0x484415,_0x1281d8){return new BPromise(function(_0x3ef198,_0x49a224){var _0x1dfeb6=respondWithRpcPromise('VoiceChannels');var _0x4e7afa=getAgent(_0x484415);Promise['all']([_0x1dfeb6,_0x4e7afa])[_0xecff('0x1f')](function(_0xabe5da){var _0x230d04=_0xabe5da[0x0];var _0x1e3175=_0xabe5da[0x1];var _0x5e70f3=_[_0xecff('0x25')](_0x230d04[_0xecff('0x26')],function(_0x1926a5){return _0x1926a5['UserId']==_0x1e3175['id']&&_0x1926a5[_0xecff('0x27')]==_0x1281d8;});if(_0x5e70f3[_0xecff('0x28')]==0x1){_0x3ef198(_0x1e3175);}else{_0x49a224(new RangeError(_0xecff('0x29')+_0x1281d8+_0xecff('0x2a')));}});});}exports['originate']=function(_0x7e7a6c,_0x350297){logger['info'](_0xecff('0x2b'),_0x7e7a6c[_0xecff('0x2c')]);var _0xaa3c9a=originateValidation[_0xecff('0xe')](_0x7e7a6c['body']);if(_0xaa3c9a[_0xecff('0x28')]>0x0){return _0x350297[_0xecff('0x1c')](0x190)[_0xecff('0x2d')](_0xaa3c9a);}var _0x55c232=_0x7e7a6c[_0xecff('0x2c')][_0xecff('0x2e')];var _0x16ef80=_0x7e7a6c[_0xecff('0x2c')][_0xecff('0x2f')];var _0x20db12=_0x7e7a6c['body']['callerId'];var _0x4dd43c=_0x7e7a6c[_0xecff('0x2c')]['callbackUrl'];return getAgent(_0x55c232)[_0xecff('0x1f')](function(_0x21411b){logger['info'](_0xecff('0x30'),_0x21411b[_0xecff('0x1b')]);emit(util[_0xecff('0x31')]('user:%s',_0x21411b[_0xecff('0x1b')]),_0xecff('0x32'),{'callNumber':_0x16ef80,'callerId':_0x20db12,'callbackUrl':_0x4dd43c});return _0x350297[_0xecff('0x1c')](0xc8)['json']({'error':![],'message':_0xecff('0x33')});})[_0xecff('0x23')](handleError(_0x350297));};exports[_0xecff('0x34')]=function(_0x13a525,_0x317037){logger[_0xecff('0x15')](_0xecff('0x35'),_0x13a525[_0xecff('0x2c')]);var _0x6d3916=hangupValidation[_0xecff('0xe')](_0x13a525[_0xecff('0x2c')]);if(_0x6d3916['length']>0x0){return _0x317037[_0xecff('0x1c')](0x190)[_0xecff('0x2d')](_0x6d3916);}var _0x199019=_0x13a525[_0xecff('0x2c')][_0xecff('0x2e')];var _0x19626e=_0x13a525[_0xecff('0x2c')][_0xecff('0x27')];return getAgent(_0x199019)['then'](function(_0x28141f){logger['info'](_0xecff('0x30'),_0x28141f[_0xecff('0x1b')]);emit(util[_0xecff('0x31')](_0xecff('0x36'),_0x28141f[_0xecff('0x1b')]),_0xecff('0x37'),{'sessionId':_0x19626e});return _0x317037[_0xecff('0x1c')](0xc8)['json']({'error':![],'message':_0xecff('0x38')});})[_0xecff('0x23')](handleError(_0x317037));};exports['answer']=function(_0x4d4c7b,_0x3a7ebc){logger[_0xecff('0x15')](_0xecff('0x39'),_0x4d4c7b[_0xecff('0x2c')]);var _0x47084b=answerValidation[_0xecff('0xe')](_0x4d4c7b['body']);if(_0x47084b[_0xecff('0x28')]>0x0){return _0x3a7ebc[_0xecff('0x1c')](0x190)['json'](_0x47084b);}var _0x8b0f59=_0x4d4c7b[_0xecff('0x2c')][_0xecff('0x2e')];var _0x4402a0=_0x4d4c7b[_0xecff('0x2c')][_0xecff('0x27')];return getAgent(_0x8b0f59)['then'](function(_0x310593){logger[_0xecff('0x15')](_0xecff('0x30'),_0x310593['name']);emit(util[_0xecff('0x31')](_0xecff('0x36'),_0x310593[_0xecff('0x1b')]),_0xecff('0x3a'),{'sessionId':_0x4402a0});return _0x3a7ebc['status'](0xc8)[_0xecff('0x2d')]({'error':![],'message':_0xecff('0x3b')});})['catch'](handleError(_0x3a7ebc));};exports[_0xecff('0x3c')]=function(_0x1d2ac3,_0x4ba9e3){logger[_0xecff('0x15')]('hold\x20fired:',_0x1d2ac3[_0xecff('0x2c')]);var _0x3692c9=holdValidation[_0xecff('0xe')](_0x1d2ac3[_0xecff('0x2c')]);if(_0x3692c9[_0xecff('0x28')]>0x0){return _0x4ba9e3[_0xecff('0x1c')](0x190)['json'](_0x3692c9);}var _0x596eb8=_0x1d2ac3[_0xecff('0x2c')][_0xecff('0x2e')];var _0x1aae95=_0x1d2ac3[_0xecff('0x2c')][_0xecff('0x27')];return getAgent(_0x596eb8)[_0xecff('0x1f')](function(_0x36c50f){logger[_0xecff('0x15')]('entityFound:',_0x36c50f[_0xecff('0x1b')]);emit(util[_0xecff('0x31')]('user:%s',_0x36c50f[_0xecff('0x1b')]),'webbar:hold',{'sessionId':_0x1aae95});return _0x4ba9e3[_0xecff('0x1c')](0xc8)[_0xecff('0x2d')]({'error':![],'message':'hold\x20executed!'});})[_0xecff('0x23')](handleError(_0x4ba9e3));};exports[_0xecff('0x3d')]=function(_0x3e79f9,_0x188d08){logger[_0xecff('0x15')]('unhold\x20fired:',_0x3e79f9['body']);var _0x198ad6=unholdValidation[_0xecff('0xe')](_0x3e79f9[_0xecff('0x2c')]);if(_0x198ad6[_0xecff('0x28')]>0x0){return _0x188d08[_0xecff('0x1c')](0x190)[_0xecff('0x2d')](_0x198ad6);}var _0x339d3d=_0x3e79f9[_0xecff('0x2c')][_0xecff('0x2e')];var _0x4f9060=_0x3e79f9[_0xecff('0x2c')]['sessionId'];return getAgent(_0x339d3d)[_0xecff('0x1f')](function(_0x1ae9e3){logger[_0xecff('0x15')]('entityFound:',_0x1ae9e3[_0xecff('0x1b')]);emit(util['format'](_0xecff('0x36'),_0x1ae9e3['name']),'webbar:unhold',{'sessionId':_0x4f9060});return _0x188d08[_0xecff('0x1c')](0xc8)['json']({'error':![],'message':_0xecff('0x3e')});})[_0xecff('0x23')](handleError(_0x188d08));};exports['calls']=function(_0x2d0ed7,_0x3bdf47){logger[_0xecff('0x15')](_0xecff('0x3f'),_0x3bdf47[_0xecff('0x2c')]);var _0x162938=callsValidation[_0xecff('0xe')](_0x2d0ed7[_0xecff('0x2c')]);if(_0x162938['length']>0x0){return _0x3bdf47[_0xecff('0x1c')](0x190)[_0xecff('0x2d')](_0x162938);}var _0x18ead4=_0x2d0ed7[_0xecff('0x2c')][_0xecff('0x2e')];var _0x12d549=respondWithRpcPromise(_0xecff('0x40'));var _0x33bcb1=getAgent(_0x18ead4);return Promise[_0xecff('0x41')]([_0x12d549,_0x33bcb1])[_0xecff('0x1f')](function(_0xa48ffb){var _0x10939a=_0xa48ffb[0x0];var _0x3f8e22=_0xa48ffb[0x1];var _0x88882b=_['filter'](_0x10939a['rows'],function(_0x13ec0f){return _0x13ec0f['UserId']==_0x3f8e22['id'];});return _0x3bdf47['status'](0xc8)[_0xecff('0x2d')]({'count':_0x88882b[_0xecff('0x28')],'rows':_0x88882b});})[_0xecff('0x23')](handleError(_0x3bdf47));};exports['conference']=function(_0x161190,_0x1eabd0){logger[_0xecff('0x15')]('conference\x20fired:',_0x161190[_0xecff('0x2c')]);var _0x56eefb=conferenceValidation['validate'](_0x161190[_0xecff('0x2c')]);if(_0x56eefb[_0xecff('0x28')]>0x0){return _0x1eabd0[_0xecff('0x1c')](0x190)[_0xecff('0x2d')](_0x56eefb);}var _0x303a=_0x161190[_0xecff('0x2c')][_0xecff('0x2e')];return getAgent(_0x303a)[_0xecff('0x1f')](function(_0x345ceb){logger[_0xecff('0x15')](_0xecff('0x30'),_0x345ceb[_0xecff('0x1b')]);emit(util[_0xecff('0x31')](_0xecff('0x36'),_0x345ceb['name']),'webbar:conference');return _0x1eabd0[_0xecff('0x1c')](0xc8)[_0xecff('0x2d')]({'error':![],'message':'conference\x20executed!'});})[_0xecff('0x23')](handleError(_0x1eabd0));};exports[_0xecff('0x42')]=function(_0x59857d,_0x148c69){logger[_0xecff('0x15')](_0xecff('0x43'),_0x59857d[_0xecff('0x2c')]);var _0x20e8ab=transferValidation[_0xecff('0xe')](_0x59857d['body']);if(_0x20e8ab[_0xecff('0x28')]>0x0){return _0x148c69[_0xecff('0x1c')](0x190)[_0xecff('0x2d')](_0x20e8ab);}var _0x3c333c=_0x59857d[_0xecff('0x2c')]['userId'];var _0x31cd2d=_0x59857d[_0xecff('0x2c')][_0xecff('0x27')];var _0x3e54b8=_0x59857d['body']['transferNumber'];return getAgent(_0x3c333c)['then'](function(_0x3882cf){logger[_0xecff('0x15')](_0xecff('0x30'),_0x3882cf['name']);emit(util[_0xecff('0x31')]('user:%s',_0x3882cf[_0xecff('0x1b')]),_0xecff('0x44'),{'sessionId':_0x31cd2d,'transferNumber':_0x3e54b8});return _0x148c69[_0xecff('0x1c')](0xc8)[_0xecff('0x2d')]({'error':![],'message':'transfer\x20executed!'});})[_0xecff('0x23')](handleError(_0x148c69));}; \ No newline at end of file +var _0x4b1f=['originate','info','originate\x20fired:','body','validate','userId','callNumber','callerId','entityFound:','format','user:%s','originate\x20executed!','hangup','hangup\x20fired:','webbar:hangup','json','hangup\x20executed!','webbar:answer','answer\x20executed!','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls\x20fired:','filter','rows','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transferNumber','webbar:transfer','path','lodash','../../config/environment','util','bluebird','client','http','../../config/logger','redis','defaults','localhost','socket.io-emitter','userId\x20is\x20required','callNumber\x20is\x20required','number','string','sessionId\x20is\x20required','transferNumber\x20is\x20required','stringify','emit','log','handleError:','error','stack','name','status','send','NotFound','request','then','result','catch','User','agent','all','UserId','sessionId','length','sessionId\x20'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4b1f,0x195));var _0xf4b1=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0x4b1f[_0x5f309e];return _0x487b5e;};'use strict';var path=require(_0xf4b1('0x0'));var fs=require('fs');var _=require(_0xf4b1('0x1'));var db=require('../../mysqldb')['db'];var config=require(_0xf4b1('0x2'));var util=require(_0xf4b1('0x3'));var BPromise=require(_0xf4b1('0x4'));var jayson=require('jayson/promise');var amiClient=jayson[_0xf4b1('0x5')][_0xf4b1('0x6')]({'port':0x232a});var logger=require(_0xf4b1('0x7'))('webbarapi');var Redis=require('ioredis');config[_0xf4b1('0x8')]=_[_0xf4b1('0x9')](config[_0xf4b1('0x8')],{'host':_0xf4b1('0xa'),'port':0x18eb});var io=require(_0xf4b1('0xb'))(new Redis(config['redis']));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':'number','required':[!![],_0xf4b1('0xc')]},'callNumber':{'type':'string','required':[!![],_0xf4b1('0xd')]},'callerId':{'type':'string'},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':_0xf4b1('0xe'),'required':[!![],_0xf4b1('0xc')]},'sessionId':{'type':_0xf4b1('0xf'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xf4b1('0xe'),'required':[!![],_0xf4b1('0xc')]},'sessionId':{'type':_0xf4b1('0xf'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0xf4b1('0xe'),'required':[!![],_0xf4b1('0xc')]},'sessionId':{'type':_0xf4b1('0xf'),'required':[!![],_0xf4b1('0x10')]},'transferNumber':{'type':_0xf4b1('0xf'),'required':[!![],_0xf4b1('0x11')]}});var holdValidation=new Schema({'userId':{'type':_0xf4b1('0xe'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xf4b1('0xe'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var callsValidation=new Schema({'userId':{'type':_0xf4b1('0xe'),'required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':'number','required':[!![],_0xf4b1('0xc')]}});function emit(_0x4968f4,_0x5e7206,_0x554517){logger['info'](_0x4968f4,_0x5e7206,JSON[_0xf4b1('0x12')](_0x554517));io['to'](_0x4968f4)[_0xf4b1('0x13')](_0x5e7206,_0x554517);}function handleError(_0x534fd8){return function(_0x3b378e){console[_0xf4b1('0x14')](_0xf4b1('0x15'),_0x3b378e,_0x3b378e instanceof RangeError);logger[_0xf4b1('0x16')](_0x3b378e[_0xf4b1('0x17')]);if(_0x3b378e instanceof RangeError){if(_0x3b378e[_0xf4b1('0x18')]){delete _0x3b378e['name'];}_0x534fd8[_0xf4b1('0x19')](0x194)[_0xf4b1('0x1a')](_0x3b378e);}else{if(_0x3b378e['name']){delete _0x3b378e[_0xf4b1('0x18')];}_0x534fd8[_0xf4b1('0x19')](0x1f4)['send'](_0x3b378e);}};}function checkError(){return function(_0x13892d){if(!_0x13892d){throw new RangeError(_0xf4b1('0x1b'));}return _0x13892d;};}function respondWithRpcPromise(_0xbfab1e,_0x466739){return new BPromise(function(_0x5c50e8,_0x20013c){var _0x29b8c1=amiClient;return _0x29b8c1[_0xf4b1('0x1c')](_0xbfab1e,_0x466739)[_0xf4b1('0x1d')](function(_0x58376d){if(_0x58376d[_0xf4b1('0x16')]){if(_0x58376d[_0xf4b1('0x16')]['code']===0x1f4){return _0x20013c(_0x58376d[_0xf4b1('0x16')]['message']);}return _0x5c50e8(_0x58376d[_0xf4b1('0x16')]['message']);}else{_0x5c50e8(_0x58376d[_0xf4b1('0x1e')]);}})[_0xf4b1('0x1f')](function(_0x2e803d){_0x20013c(_0x2e803d);});});}function getAgent(_0x5a0285){return db[_0xf4b1('0x20')]['findOne']({'where':{'id':_0x5a0285,'role':_0xf4b1('0x21')}})['then'](checkError());}function getAgentCheckSession(_0x29493b,_0x447ae7){return new BPromise(function(_0x5d28af,_0x22353e){var _0x23693b=respondWithRpcPromise('VoiceChannels');var _0x125bf4=getAgent(_0x29493b);Promise[_0xf4b1('0x22')]([_0x23693b,_0x125bf4])[_0xf4b1('0x1d')](function(_0x11ffb3){var _0x3046dc=_0x11ffb3[0x0];var _0x36243e=_0x11ffb3[0x1];var _0x2f830c=_['filter'](_0x3046dc['rows'],function(_0x31c13c){return _0x31c13c[_0xf4b1('0x23')]==_0x36243e['id']&&_0x31c13c[_0xf4b1('0x24')]==_0x447ae7;});if(_0x2f830c[_0xf4b1('0x25')]==0x1){_0x5d28af(_0x36243e);}else{_0x22353e(new RangeError(_0xf4b1('0x26')+_0x447ae7+'\x20not\x20found!'));}});});}exports[_0xf4b1('0x27')]=function(_0xa08452,_0xa6bdd7){logger[_0xf4b1('0x28')](_0xf4b1('0x29'),_0xa08452[_0xf4b1('0x2a')]);var _0x186dd3=originateValidation[_0xf4b1('0x2b')](_0xa08452['body']);if(_0x186dd3[_0xf4b1('0x25')]>0x0){return _0xa6bdd7['status'](0x190)['json'](_0x186dd3);}var _0x48f672=_0xa08452[_0xf4b1('0x2a')][_0xf4b1('0x2c')];var _0x75f753=_0xa08452[_0xf4b1('0x2a')][_0xf4b1('0x2d')];var _0x2ddbc8=_0xa08452[_0xf4b1('0x2a')][_0xf4b1('0x2e')];var _0x55a5a6=_0xa08452[_0xf4b1('0x2a')]['callbackUrl'];return getAgent(_0x48f672)[_0xf4b1('0x1d')](function(_0x303290){logger['info'](_0xf4b1('0x2f'),_0x303290[_0xf4b1('0x18')]);emit(util[_0xf4b1('0x30')](_0xf4b1('0x31'),_0x303290[_0xf4b1('0x18')]),'webbar:originate',{'callNumber':_0x75f753,'callerId':_0x2ddbc8,'callbackUrl':_0x55a5a6});return _0xa6bdd7[_0xf4b1('0x19')](0xc8)['json']({'error':![],'message':_0xf4b1('0x32')});})['catch'](handleError(_0xa6bdd7));};exports[_0xf4b1('0x33')]=function(_0x366621,_0xfe587f){logger['info'](_0xf4b1('0x34'),_0x366621[_0xf4b1('0x2a')]);var _0x207020=hangupValidation[_0xf4b1('0x2b')](_0x366621[_0xf4b1('0x2a')]);if(_0x207020[_0xf4b1('0x25')]>0x0){return _0xfe587f[_0xf4b1('0x19')](0x190)['json'](_0x207020);}var _0x393da0=_0x366621[_0xf4b1('0x2a')][_0xf4b1('0x2c')];var _0x3553c3=_0x366621[_0xf4b1('0x2a')][_0xf4b1('0x24')];return getAgent(_0x393da0)['then'](function(_0x33879b){logger[_0xf4b1('0x28')]('entityFound:',_0x33879b['name']);emit(util[_0xf4b1('0x30')](_0xf4b1('0x31'),_0x33879b[_0xf4b1('0x18')]),_0xf4b1('0x35'),{'sessionId':_0x3553c3});return _0xfe587f[_0xf4b1('0x19')](0xc8)[_0xf4b1('0x36')]({'error':![],'message':_0xf4b1('0x37')});})[_0xf4b1('0x1f')](handleError(_0xfe587f));};exports['answer']=function(_0x3a4383,_0x5e9da4){logger['info']('answer\x20fired:',_0x3a4383[_0xf4b1('0x2a')]);var _0x3feed5=answerValidation[_0xf4b1('0x2b')](_0x3a4383['body']);if(_0x3feed5[_0xf4b1('0x25')]>0x0){return _0x5e9da4[_0xf4b1('0x19')](0x190)[_0xf4b1('0x36')](_0x3feed5);}var _0x5597d5=_0x3a4383[_0xf4b1('0x2a')][_0xf4b1('0x2c')];var _0x1f856c=_0x3a4383['body'][_0xf4b1('0x24')];return getAgent(_0x5597d5)['then'](function(_0x2e4f2a){logger[_0xf4b1('0x28')](_0xf4b1('0x2f'),_0x2e4f2a['name']);emit(util[_0xf4b1('0x30')](_0xf4b1('0x31'),_0x2e4f2a['name']),_0xf4b1('0x38'),{'sessionId':_0x1f856c});return _0x5e9da4[_0xf4b1('0x19')](0xc8)[_0xf4b1('0x36')]({'error':![],'message':_0xf4b1('0x39')});})['catch'](handleError(_0x5e9da4));};exports['hold']=function(_0x14cdc6,_0x1638a6){logger['info'](_0xf4b1('0x3a'),_0x14cdc6['body']);var _0x202381=holdValidation['validate'](_0x14cdc6[_0xf4b1('0x2a')]);if(_0x202381[_0xf4b1('0x25')]>0x0){return _0x1638a6['status'](0x190)[_0xf4b1('0x36')](_0x202381);}var _0x104819=_0x14cdc6[_0xf4b1('0x2a')][_0xf4b1('0x2c')];var _0x2f4c27=_0x14cdc6[_0xf4b1('0x2a')][_0xf4b1('0x24')];return getAgent(_0x104819)[_0xf4b1('0x1d')](function(_0x4e6e04){logger['info'](_0xf4b1('0x2f'),_0x4e6e04[_0xf4b1('0x18')]);emit(util['format'](_0xf4b1('0x31'),_0x4e6e04[_0xf4b1('0x18')]),_0xf4b1('0x3b'),{'sessionId':_0x2f4c27});return _0x1638a6[_0xf4b1('0x19')](0xc8)[_0xf4b1('0x36')]({'error':![],'message':_0xf4b1('0x3c')});})[_0xf4b1('0x1f')](handleError(_0x1638a6));};exports[_0xf4b1('0x3d')]=function(_0x29c3c1,_0x2bca13){logger[_0xf4b1('0x28')](_0xf4b1('0x3e'),_0x29c3c1[_0xf4b1('0x2a')]);var _0x1bf70f=unholdValidation[_0xf4b1('0x2b')](_0x29c3c1[_0xf4b1('0x2a')]);if(_0x1bf70f[_0xf4b1('0x25')]>0x0){return _0x2bca13[_0xf4b1('0x19')](0x190)[_0xf4b1('0x36')](_0x1bf70f);}var _0x3a1362=_0x29c3c1[_0xf4b1('0x2a')][_0xf4b1('0x2c')];var _0x38efcd=_0x29c3c1[_0xf4b1('0x2a')][_0xf4b1('0x24')];return getAgent(_0x3a1362)[_0xf4b1('0x1d')](function(_0x755ecb){logger[_0xf4b1('0x28')]('entityFound:',_0x755ecb[_0xf4b1('0x18')]);emit(util['format']('user:%s',_0x755ecb[_0xf4b1('0x18')]),_0xf4b1('0x3f'),{'sessionId':_0x38efcd});return _0x2bca13['status'](0xc8)[_0xf4b1('0x36')]({'error':![],'message':_0xf4b1('0x40')});})[_0xf4b1('0x1f')](handleError(_0x2bca13));};exports['calls']=function(_0x59b8e8,_0x1fc659){logger[_0xf4b1('0x28')](_0xf4b1('0x41'),_0x1fc659[_0xf4b1('0x2a')]);var _0x402e6c=callsValidation[_0xf4b1('0x2b')](_0x59b8e8[_0xf4b1('0x2a')]);if(_0x402e6c[_0xf4b1('0x25')]>0x0){return _0x1fc659[_0xf4b1('0x19')](0x190)[_0xf4b1('0x36')](_0x402e6c);}var _0x1fec6d=_0x59b8e8[_0xf4b1('0x2a')][_0xf4b1('0x2c')];var _0x24d0a6=respondWithRpcPromise('VoiceChannels');var _0x193bab=getAgent(_0x1fec6d);return Promise[_0xf4b1('0x22')]([_0x24d0a6,_0x193bab])[_0xf4b1('0x1d')](function(_0x427126){var _0xb53593=_0x427126[0x0];var _0x43d373=_0x427126[0x1];var _0xe7b6a3=_[_0xf4b1('0x42')](_0xb53593[_0xf4b1('0x43')],function(_0x47abe5){return _0x47abe5[_0xf4b1('0x23')]==_0x43d373['id'];});return _0x1fc659[_0xf4b1('0x19')](0xc8)[_0xf4b1('0x36')]({'count':_0xe7b6a3['length'],'rows':_0xe7b6a3});})['catch'](handleError(_0x1fc659));};exports[_0xf4b1('0x44')]=function(_0x1cc591,_0x4db29b){logger[_0xf4b1('0x28')](_0xf4b1('0x45'),_0x1cc591[_0xf4b1('0x2a')]);var _0x22d27f=conferenceValidation[_0xf4b1('0x2b')](_0x1cc591[_0xf4b1('0x2a')]);if(_0x22d27f[_0xf4b1('0x25')]>0x0){return _0x4db29b[_0xf4b1('0x19')](0x190)[_0xf4b1('0x36')](_0x22d27f);}var _0x36cf63=_0x1cc591[_0xf4b1('0x2a')]['userId'];return getAgent(_0x36cf63)[_0xf4b1('0x1d')](function(_0x350d07){logger['info'](_0xf4b1('0x2f'),_0x350d07[_0xf4b1('0x18')]);emit(util[_0xf4b1('0x30')]('user:%s',_0x350d07[_0xf4b1('0x18')]),_0xf4b1('0x46'));return _0x4db29b['status'](0xc8)['json']({'error':![],'message':_0xf4b1('0x47')});})['catch'](handleError(_0x4db29b));};exports['transfer']=function(_0x2de44d,_0x844121){logger['info']('transfer\x20fired:',_0x2de44d[_0xf4b1('0x2a')]);var _0x17eb9e=transferValidation['validate'](_0x2de44d[_0xf4b1('0x2a')]);if(_0x17eb9e[_0xf4b1('0x25')]>0x0){return _0x844121[_0xf4b1('0x19')](0x190)[_0xf4b1('0x36')](_0x17eb9e);}var _0xe82df1=_0x2de44d[_0xf4b1('0x2a')][_0xf4b1('0x2c')];var _0x55341b=_0x2de44d[_0xf4b1('0x2a')][_0xf4b1('0x24')];var _0xca5281=_0x2de44d[_0xf4b1('0x2a')][_0xf4b1('0x48')];return getAgent(_0xe82df1)[_0xf4b1('0x1d')](function(_0xe9ac5){logger['info']('entityFound:',_0xe9ac5[_0xf4b1('0x18')]);emit(util[_0xf4b1('0x30')]('user:%s',_0xe9ac5[_0xf4b1('0x18')]),_0xf4b1('0x49'),{'sessionId':_0x55341b,'transferNumber':_0xca5281});return _0x844121[_0xf4b1('0x19')](0xc8)[_0xf4b1('0x36')]({'error':![],'message':'transfer\x20executed!'});})[_0xf4b1('0x1f')](handleError(_0x844121));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 3fc351f..1b5ea0f 100644 --- a/server/api/whatsappAccount/index.js +++ b/server/api/whatsappAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc6ac=['index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/users','/:id/applications','create','post','addDisposition','addAgents','addApplications','/:id/notify','notify','send','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated'];(function(_0x3dbccb,_0x126d36){var _0x3e90e7=function(_0x43298f){while(--_0x43298f){_0x3dbccb['push'](_0x3dbccb['shift']());}};_0x3e90e7(++_0x126d36);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x36bb09,_0x4ca925){_0x36bb09=_0x36bb09-0x0;var _0x5799de=_0xc6ac[_0x36bb09];return _0x5799de;};'use strict';var multer=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var path=require(_0xcc6a('0x2'));var timeout=require(_0xcc6a('0x3'));var express=require(_0xcc6a('0x4'));var router=express[_0xcc6a('0x5')]();var fs_extra=require(_0xcc6a('0x6'));var auth=require(_0xcc6a('0x7'));var interaction=require(_0xcc6a('0x8'));var config=require(_0xcc6a('0x9'));var controller=require(_0xcc6a('0xa'));router[_0xcc6a('0xb')]('/',auth[_0xcc6a('0xc')](),controller[_0xcc6a('0xd')]);router['get'](_0xcc6a('0xe'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0xf')]);router['get'](_0xcc6a('0x10'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x11')]);router[_0xcc6a('0xb')](_0xcc6a('0x12'),auth['isAuthenticated'](),controller[_0xcc6a('0x13')]);router[_0xcc6a('0xb')](_0xcc6a('0x14'),auth['isAuthenticated'](),controller[_0xcc6a('0x15')]);router[_0xcc6a('0xb')](_0xcc6a('0x16'),auth['isAuthenticated'](),controller['getAgents']);router[_0xcc6a('0xb')](_0xcc6a('0x17'),auth[_0xcc6a('0xc')](),controller['getApplications']);router['post']('/',auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x18')]);router[_0xcc6a('0x19')](_0xcc6a('0x12'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x1a')]);router[_0xcc6a('0x19')](_0xcc6a('0x14'),auth['isAuthenticated'](),controller['addAnswer']);router['post'](_0xcc6a('0x16'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x1b')]);router[_0xcc6a('0x19')](_0xcc6a('0x17'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x1c')]);router[_0xcc6a('0x19')](_0xcc6a('0x1d'),controller[_0xcc6a('0x1e')]);router[_0xcc6a('0x19')]('/:id/send',auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x1f')]);router[_0xcc6a('0x20')](_0xcc6a('0x10'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x21')]);router[_0xcc6a('0x22')](_0xcc6a('0x10'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x23')]);router[_0xcc6a('0x22')](_0xcc6a('0x12'),auth['isAuthenticated'](),controller[_0xcc6a('0x24')]);router[_0xcc6a('0x22')](_0xcc6a('0x14'),auth['isAuthenticated'](),controller[_0xcc6a('0x25')]);router[_0xcc6a('0x22')](_0xcc6a('0x16'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x26')]);module[_0xcc6a('0x27')]=router; \ No newline at end of file +var _0x524e=['index','/describe','describe','/:id','isAuthenticated','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/users','/:id/applications','getApplications','post','addDisposition','addAnswer','addApplications','/:id/notify','notify','/:id/send','put','update','delete','destroy','removeAnswers','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get'];(function(_0x5d9999,_0x3f0321){var _0x1d15ed=function(_0x41b573){while(--_0x41b573){_0x5d9999['push'](_0x5d9999['shift']());}};_0x1d15ed(++_0x3f0321);}(_0x524e,0x15e));var _0xe524=function(_0xb5752,_0x2d91d2){_0xb5752=_0xb5752-0x0;var _0x2dcd24=_0x524e[_0xb5752];return _0x2dcd24;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe524('0x0'));var timeout=require(_0xe524('0x1'));var express=require(_0xe524('0x2'));var router=express[_0xe524('0x3')]();var fs_extra=require(_0xe524('0x4'));var auth=require(_0xe524('0x5'));var interaction=require(_0xe524('0x6'));var config=require(_0xe524('0x7'));var controller=require(_0xe524('0x8'));router[_0xe524('0x9')]('/',auth['isAuthenticated'](),controller[_0xe524('0xa')]);router[_0xe524('0x9')](_0xe524('0xb'),auth['isAuthenticated'](),controller[_0xe524('0xc')]);router[_0xe524('0x9')](_0xe524('0xd'),auth[_0xe524('0xe')](),controller[_0xe524('0xf')]);router[_0xe524('0x9')](_0xe524('0x10'),auth[_0xe524('0xe')](),controller[_0xe524('0x11')]);router[_0xe524('0x9')](_0xe524('0x12'),auth[_0xe524('0xe')](),controller[_0xe524('0x13')]);router[_0xe524('0x9')](_0xe524('0x14'),auth[_0xe524('0xe')](),controller['getAgents']);router['get'](_0xe524('0x15'),auth[_0xe524('0xe')](),controller[_0xe524('0x16')]);router[_0xe524('0x17')]('/',auth[_0xe524('0xe')](),controller['create']);router[_0xe524('0x17')]('/:id/dispositions',auth[_0xe524('0xe')](),controller[_0xe524('0x18')]);router['post'](_0xe524('0x12'),auth['isAuthenticated'](),controller[_0xe524('0x19')]);router['post'](_0xe524('0x14'),auth['isAuthenticated'](),controller['addAgents']);router['post'](_0xe524('0x15'),auth['isAuthenticated'](),controller[_0xe524('0x1a')]);router[_0xe524('0x17')](_0xe524('0x1b'),controller[_0xe524('0x1c')]);router['post'](_0xe524('0x1d'),auth[_0xe524('0xe')](),controller['send']);router[_0xe524('0x1e')](_0xe524('0xd'),auth[_0xe524('0xe')](),controller[_0xe524('0x1f')]);router[_0xe524('0x20')](_0xe524('0xd'),auth[_0xe524('0xe')](),controller[_0xe524('0x21')]);router[_0xe524('0x20')]('/:id/dispositions',auth[_0xe524('0xe')](),controller['removeDispositions']);router['delete'](_0xe524('0x12'),auth[_0xe524('0xe')](),controller[_0xe524('0x22')]);router[_0xe524('0x20')]('/:id/users',auth[_0xe524('0xe')](),controller['removeAgents']);module[_0xe524('0x23')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index a346920..933f32b 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 _0x367a=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','generate','ENUM','twilio','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'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x367a,0x74));var _0xa367=function(_0x4e39b2,_0x59fc8d){_0x4e39b2=_0x4e39b2-0x0;var _0x426c75=_0x367a[_0x4e39b2];return _0x426c75;};'use strict';var Sequelize=require(_0xa367('0x0'));var rs=require(_0xa367('0x1'));module[_0xa367('0x2')]={'name':{'type':Sequelize[_0xa367('0x3')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0xa367('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0xa367('0x3')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xa367('0x4')]();}},'phone':{'type':Sequelize[_0xa367('0x3')]},'type':{'type':Sequelize[_0xa367('0x5')](_0xa367('0x6'))},'accountSid':{'type':Sequelize[_0xa367('0x3')]},'authToken':{'type':Sequelize[_0xa367('0x3')]},'notificationTemplate':{'type':Sequelize[_0xa367('0x7')],'defaultValue':function(){return _0xa367('0x8');}},'notificationSound':{'type':Sequelize[_0xa367('0x9')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xa367('0x9')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xa367('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xa367('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa367('0xa')],'comment':_0xa367('0xb')},'mandatoryDisposition':{'type':Sequelize[_0xa367('0x9')],'defaultValue':![],'comment':_0xa367('0xc'),'set':function(_0x4d8517){if(!_0x4d8517){this[_0xa367('0xd')](_0xa367('0xe'),null);}this[_0xa367('0xd')](_0xa367('0xf'),_0x4d8517);}},'description':{'type':Sequelize[_0xa367('0x3')]}}; \ No newline at end of file +var _0xb816=['exports','STRING','name','ENUM','twilio','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','mandatoryDispositionPauseId','mandatoryDisposition','randomstring'];(function(_0x30dda9,_0x5bd716){var _0x523f33=function(_0x3d53b3){while(--_0x3d53b3){_0x30dda9['push'](_0x30dda9['shift']());}};_0x523f33(++_0x5bd716);}(_0xb816,0x86));var _0x6b81=function(_0x48634d,_0x581961){_0x48634d=_0x48634d-0x0;var _0x14ed18=_0xb816[_0x48634d];return _0x14ed18;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x6b81('0x0'));module[_0x6b81('0x1')]={'name':{'type':Sequelize[_0x6b81('0x2')],'unique':_0x6b81('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x6b81('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x6b81('0x2')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0x6b81('0x2')]},'type':{'type':Sequelize[_0x6b81('0x4')](_0x6b81('0x5'))},'accountSid':{'type':Sequelize[_0x6b81('0x2')]},'authToken':{'type':Sequelize[_0x6b81('0x2')]},'notificationTemplate':{'type':Sequelize[_0x6b81('0x6')],'defaultValue':function(){return _0x6b81('0x7');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x6b81('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x6b81('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x6b81('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x6b81('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x6b81('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x6b81('0xa')},'mandatoryDisposition':{'type':Sequelize[_0x6b81('0x8')],'defaultValue':![],'comment':_0x6b81('0xb'),'set':function(_0x1735ce){if(!_0x1735ce){this[_0x6b81('0xc')](_0x6b81('0xd'),null);}this['setDataValue'](_0x6b81('0xe'),_0x1735ce);}},'description':{'type':Sequelize[_0x6b81('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index a0f4542..7904d76 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 _0x068d=['rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','redis','defaults','socket.io-emitter','./whatsappAccount.socket','register','http','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','limit','count','offset','set','Content-Range','apply','reject','save','destroy','get','UserProfileResource','name','index','mandatoryDispositionPause','WhatsappAccount','fieldName','type','key','model','map','query','filters','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','pick','filter','VIRTUAL','merge','where','includeAll','findAll','rows','show','params','Pause','keys','fields','include','find','create','body','user','role','WhatsappAccounts','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','WhatsappAccountId','getDispositions','findOne','Disposition','removeDispositions','ids','CannedAnswer','rawAttributes','options','removeAnswers','addAgents','userWhatsappAccount:save','removeAgents','isArray','emit','userWhatsappAccount:remove','getAgents','User','sequelize','transaction','WhatsappApplication','getApplications','whatsapp','Applications','account','applications','orderBy','asc','CmContact','describe','Sequelize','ValidationError','updatedAt','difference','createdAt','CompanyId','ListId','mobile','twilio','from','From','replace','whatsapp:','Body','messageId','MessageSid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','Contacts','WhatsappInteraction','interaction','autoclose','*,*,*,*','created','WhatsappMessage','ContactId','AttachmentId','UserId','agent','Start','startRouting','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','Content-Type','send','\x0a','to\x20is\x20mandatory','List','DESC','out','Messages','spread','dataValues'];(function(_0x443e0c,_0x51ca0e){var _0x963c7e=function(_0x1e1b9f){while(--_0x1e1b9f){_0x443e0c['push'](_0x443e0c['shift']());}};_0x963c7e(++_0x51ca0e);}(_0x068d,0x166));var _0xd068=function(_0x552a31,_0x2283ca){_0x552a31=_0x552a31-0x0;var _0x1e2940=_0x068d[_0x552a31];return _0x1e2940;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd068('0x0'));var zipdir=require(_0xd068('0x1'));var jsonpatch=require(_0xd068('0x2'));var rp=require('request-promise');var moment=require(_0xd068('0x3'));var BPromise=require(_0xd068('0x4'));var Mustache=require(_0xd068('0x5'));var util=require(_0xd068('0x6'));var path=require(_0xd068('0x7'));var sox=require(_0xd068('0x8'));var csv=require(_0xd068('0x9'));var ejs=require(_0xd068('0xa'));var fs=require('fs');var fs_extra=require(_0xd068('0xb'));var _=require(_0xd068('0xc'));var squel=require(_0xd068('0xd'));var crypto=require('crypto');var jsforce=require(_0xd068('0xe'));var deskjs=require(_0xd068('0xf'));var toCsv=require(_0xd068('0x9'));var querystring=require(_0xd068('0x10'));var Papa=require(_0xd068('0x11'));var Redis=require(_0xd068('0x12'));var authService=require(_0xd068('0x13'));var qs=require(_0xd068('0x14'));var as=require(_0xd068('0x15'));var hardwareService=require(_0xd068('0x16'));var logger=require('../../config/logger')(_0xd068('0x17'));var utils=require(_0xd068('0x18'));var config=require(_0xd068('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xd068('0x1a')]=_[_0xd068('0x1b')](config[_0xd068('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xd068('0x1c'))(new Redis(config[_0xd068('0x1a')]));require(_0xd068('0x1d'))[_0xd068('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xd068('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x53ece2,_0x5e2df4,_0x2afda6,_0xcbbeaa){return new BPromise(function(_0x268394,_0x58f4b8){var _0x666e97=_0xcbbeaa||client;return _0x666e97[_0xd068('0x20')](_0x53ece2,_0x2afda6)[_0xd068('0x21')](function(_0x1b2062){logger[_0xd068('0x22')](_0xd068('0x23'),_0x5e2df4,_0xd068('0x24'));logger[_0xd068('0x25')](_0xd068('0x26'),_0x5e2df4,'request\x20sent',JSON['stringify'](_0x1b2062));if(_0x1b2062[_0xd068('0x27')]){if(_0x1b2062[_0xd068('0x27')][_0xd068('0x28')]===0x1f4){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x5e2df4,_0x1b2062[_0xd068('0x27')]['message']);return _0x58f4b8(_0x1b2062[_0xd068('0x27')][_0xd068('0x29')]);}logger[_0xd068('0x27')]('WhatsappAccount,\x20%s,\x20%s',_0x5e2df4,_0x1b2062[_0xd068('0x27')][_0xd068('0x29')]);return _0x268394(_0x1b2062[_0xd068('0x27')]['message']);}else{logger[_0xd068('0x22')](_0xd068('0x23'),_0x5e2df4,_0xd068('0x24'));_0x268394(_0x1b2062[_0xd068('0x2a')][_0xd068('0x29')]);}})[_0xd068('0x2b')](function(_0x5ed0ab){logger[_0xd068('0x27')]('WhatsappAccount,\x20%s,\x20%s',_0x5e2df4,_0x5ed0ab);_0x58f4b8(_0x5ed0ab);});});}function respondWithStatusCode(_0x51fd55,_0x10b129){_0x10b129=_0x10b129||0xcc;return function(_0x5ca05a){if(_0x5ca05a){return _0x51fd55[_0xd068('0x2c')](_0x10b129);}return _0x51fd55[_0xd068('0x2d')](_0x10b129)[_0xd068('0x2e')]();};}function respondWithResult(_0x459ed4,_0x4eb958){_0x4eb958=_0x4eb958||0xc8;return function(_0x3784de){if(_0x3784de){return _0x459ed4[_0xd068('0x2d')](_0x4eb958)[_0xd068('0x2f')](_0x3784de);}};}function respondWithFilteredResult(_0x3958f6,_0x544b29){return function(_0x16c213){if(_0x16c213){var _0x545479=typeof _0x544b29['offset']==='undefined'&&typeof _0x544b29[_0xd068('0x30')]==='undefined';var _0x271453=_0x16c213[_0xd068('0x31')];var _0x128887=_0x545479?0x0:_0x544b29[_0xd068('0x32')];var _0x118707=_0x545479?_0x16c213['count']:_0x544b29[_0xd068('0x32')]+_0x544b29[_0xd068('0x30')];var _0x571dfa;if(_0x118707>=_0x271453){_0x118707=_0x271453;_0x571dfa=0xc8;}else{_0x571dfa=0xce;}_0x3958f6[_0xd068('0x2d')](_0x571dfa);return _0x3958f6[_0xd068('0x33')](_0xd068('0x34'),_0x128887+'-'+_0x118707+'/'+_0x271453)[_0xd068('0x2f')](_0x16c213);}return null;};}function patchUpdates(_0x345ed8){return function(_0x12e390){try{jsonpatch[_0xd068('0x35')](_0x12e390,_0x345ed8,!![]);}catch(_0x5cba9f){return BPromise[_0xd068('0x36')](_0x5cba9f);}return _0x12e390[_0xd068('0x37')]();};}function saveUpdates(_0x2cab2d,_0x579a25){return function(_0x1a4961){if(_0x1a4961){return _0x1a4961['update'](_0x2cab2d)['then'](function(_0x33d9c1){return _0x33d9c1;});}return null;};}function removeEntity(_0x39c087,_0x20576c){return function(_0x59d36c){if(_0x59d36c){return _0x59d36c[_0xd068('0x38')]()['then'](function(){var _0x56d8fb=_0x59d36c[_0xd068('0x39')]({'plain':!![]});var _0x4bcf6b='WhatsappAccounts';return db[_0xd068('0x3a')][_0xd068('0x38')]({'where':{'type':_0x4bcf6b,'resourceId':_0x56d8fb['id']}})['then'](function(){return _0x59d36c;});})[_0xd068('0x21')](function(){_0x39c087[_0xd068('0x2d')](0xcc)[_0xd068('0x2e')]();});}};}function handleEntityNotFound(_0x3722c2,_0x382726){return function(_0x5a0ec0){if(!_0x5a0ec0){_0x3722c2[_0xd068('0x2c')](0x194);}return _0x5a0ec0;};}function handleError(_0x4b161d,_0x5a8403){_0x5a8403=_0x5a8403||0x1f4;return function(_0x19dfbb){logger[_0xd068('0x27')](_0x19dfbb['stack']);if(_0x19dfbb['name']){delete _0x19dfbb[_0xd068('0x3b')];}_0x4b161d['status'](_0x5a8403)['send'](_0x19dfbb);};}exports[_0xd068('0x3c')]=function(_0x22369e,_0x3db80b){var _0x5dfe6c={'include':[{'model':db['Pause'],'as':_0xd068('0x3d')}]},_0x209ec3={},_0x13fac6={'count':0x0,'rows':[]};var _0x456021=_['map'](db[_0xd068('0x3e')]['rawAttributes'],function(_0x561658){return{'name':_0x561658[_0xd068('0x3f')],'type':_0x561658[_0xd068('0x40')][_0xd068('0x41')]};});_0x209ec3[_0xd068('0x42')]=_[_0xd068('0x43')](_0x456021,_0xd068('0x3b'));_0x209ec3[_0xd068('0x44')]=_['keys'](_0x22369e['query']);_0x209ec3[_0xd068('0x45')]=_['intersection'](_0x209ec3[_0xd068('0x42')],_0x209ec3[_0xd068('0x44')]);_0x5dfe6c[_0xd068('0x46')]=_[_0xd068('0x47')](_0x209ec3['model'],qs['fields'](_0x22369e[_0xd068('0x44')]['fields']));_0x5dfe6c[_0xd068('0x46')]=_0x5dfe6c['attributes'][_0xd068('0x48')]?_0x5dfe6c[_0xd068('0x46')]:_0x209ec3[_0xd068('0x42')];if(!_0x22369e['query'][_0xd068('0x49')](_0xd068('0x4a'))){_0x5dfe6c['limit']=qs['limit'](_0x22369e[_0xd068('0x44')][_0xd068('0x30')]);_0x5dfe6c[_0xd068('0x32')]=qs[_0xd068('0x32')](_0x22369e[_0xd068('0x44')][_0xd068('0x32')]);}_0x5dfe6c[_0xd068('0x4b')]=qs['sort'](_0x22369e[_0xd068('0x44')][_0xd068('0x4c')]);_0x5dfe6c['where']=qs[_0xd068('0x45')](_[_0xd068('0x4d')](_0x22369e[_0xd068('0x44')],_0x209ec3[_0xd068('0x45')]),_0x456021);if(_0x22369e[_0xd068('0x44')][_0xd068('0x4e')]){_0x5dfe6c['where']=_['merge'](_0x5dfe6c['where'],{'$or':_[_0xd068('0x43')](_0x456021,function(_0x1d638d){if(_0x1d638d[_0xd068('0x40')]!==_0xd068('0x4f')){var _0x4dbfa9={};_0x4dbfa9[_0x1d638d[_0xd068('0x3b')]]={'$like':'%'+_0x22369e[_0xd068('0x44')]['filter']+'%'};return _0x4dbfa9;}})});}_0x5dfe6c=_[_0xd068('0x50')]({},_0x5dfe6c,_0x22369e['options']);var _0x72f2cd={'where':_0x5dfe6c[_0xd068('0x51')]};return db[_0xd068('0x3e')][_0xd068('0x31')](_0x72f2cd)[_0xd068('0x21')](function(_0x317069){_0x13fac6[_0xd068('0x31')]=_0x317069;if(_0x22369e[_0xd068('0x44')][_0xd068('0x52')]){_0x5dfe6c['include']=[{'all':!![]}];}return db[_0xd068('0x3e')][_0xd068('0x53')](_0x5dfe6c);})[_0xd068('0x21')](function(_0xca222){_0x13fac6[_0xd068('0x54')]=_0xca222;return _0x13fac6;})['then'](respondWithFilteredResult(_0x3db80b,_0x5dfe6c))[_0xd068('0x2b')](handleError(_0x3db80b,null));};exports[_0xd068('0x55')]=function(_0x2d6878,_0x1150e9){var _0x270131={'raw':![],'where':{'id':_0x2d6878[_0xd068('0x56')]['id']},'include':[{'model':db[_0xd068('0x57')],'as':_0xd068('0x3d')}]},_0x57a81a={};_0x57a81a[_0xd068('0x42')]=_[_0xd068('0x58')](db['WhatsappAccount']['rawAttributes']);_0x57a81a[_0xd068('0x44')]=_['keys'](_0x2d6878[_0xd068('0x44')]);_0x57a81a[_0xd068('0x45')]=_[_0xd068('0x47')](_0x57a81a[_0xd068('0x42')],_0x57a81a['query']);_0x270131['attributes']=_[_0xd068('0x47')](_0x57a81a['model'],qs[_0xd068('0x59')](_0x2d6878[_0xd068('0x44')][_0xd068('0x59')]));_0x270131['attributes']=_0x270131['attributes']['length']?_0x270131['attributes']:_0x57a81a[_0xd068('0x42')];if(_0x2d6878[_0xd068('0x44')]['includeAll']){_0x270131[_0xd068('0x5a')]=[{'all':!![]}];}_0x270131=_[_0xd068('0x50')]({},_0x270131,_0x2d6878['options']);return db[_0xd068('0x3e')][_0xd068('0x5b')](_0x270131)[_0xd068('0x21')](handleEntityNotFound(_0x1150e9,null))[_0xd068('0x21')](respondWithResult(_0x1150e9,null))[_0xd068('0x2b')](handleError(_0x1150e9,null));};exports[_0xd068('0x5c')]=function(_0x2d08b6,_0x4f5a41){return db['WhatsappAccount'][_0xd068('0x5c')](_0x2d08b6[_0xd068('0x5d')],{})[_0xd068('0x21')](function(_0x401a23){var _0x3f0e24=_0x2d08b6[_0xd068('0x5e')][_0xd068('0x39')]({'plain':!![]});if(!_0x3f0e24)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3f0e24[_0xd068('0x5f')]===_0xd068('0x5e')){var _0x582a7d=_0x401a23[_0xd068('0x39')]({'plain':!![]});var _0x2ce50b=_0xd068('0x60');return db[_0xd068('0x61')][_0xd068('0x5b')]({'where':{'name':_0x2ce50b,'userProfileId':_0x3f0e24[_0xd068('0x62')]},'raw':!![]})[_0xd068('0x21')](function(_0x5617a9){if(_0x5617a9&&_0x5617a9[_0xd068('0x63')]===0x0){return db['UserProfileResource'][_0xd068('0x5c')]({'name':_0x582a7d[_0xd068('0x3b')],'resourceId':_0x582a7d['id'],'type':_0x5617a9['name'],'sectionId':_0x5617a9['id']},{})['then'](function(){return _0x401a23;});}else{return _0x401a23;}})[_0xd068('0x2b')](function(_0x1bacfd){logger[_0xd068('0x27')](_0xd068('0x64'),_0x1bacfd);throw _0x1bacfd;});}return _0x401a23;})[_0xd068('0x21')](respondWithResult(_0x4f5a41,0xc9))[_0xd068('0x2b')](handleError(_0x4f5a41,null));};exports['update']=function(_0x215f6c,_0x4b08b2){if(_0x215f6c[_0xd068('0x5d')]['id']){delete _0x215f6c[_0xd068('0x5d')]['id'];}return db[_0xd068('0x3e')][_0xd068('0x5b')]({'where':{'id':_0x215f6c[_0xd068('0x56')]['id']},'include':[{'model':db['Pause'],'as':_0xd068('0x3d')}]})[_0xd068('0x21')](handleEntityNotFound(_0x4b08b2,null))[_0xd068('0x21')](saveUpdates(_0x215f6c[_0xd068('0x5d')],null))[_0xd068('0x21')](respondWithResult(_0x4b08b2,null))['catch'](handleError(_0x4b08b2,null));};exports[_0xd068('0x38')]=function(_0x27dd64,_0x56db83){return db['WhatsappAccount'][_0xd068('0x5b')]({'where':{'id':_0x27dd64[_0xd068('0x56')]['id']}})[_0xd068('0x21')](handleEntityNotFound(_0x56db83,null))[_0xd068('0x21')](removeEntity(_0x56db83,null))[_0xd068('0x2b')](handleError(_0x56db83,null));};exports['describe']=function(_0x1df435,_0x5b92c0){return db[_0xd068('0x3e')]['describe']()[_0xd068('0x21')](respondWithResult(_0x5b92c0,null))[_0xd068('0x2b')](handleError(_0x5b92c0,null));};exports['addDisposition']=function(_0x4001ed,_0x320d1b,_0x4898cd){if(_0x4001ed['body']['id']){delete _0x4001ed[_0xd068('0x5d')]['id'];}return db[_0xd068('0x3e')][_0xd068('0x5b')]({'where':{'id':_0x4001ed[_0xd068('0x56')]['id']}})[_0xd068('0x21')](handleEntityNotFound(_0x320d1b,null))[_0xd068('0x21')](function(_0x599def){if(_0x599def){_0x4001ed[_0xd068('0x5d')][_0xd068('0x65')]=_0x599def['id'];return db['Disposition'][_0xd068('0x5c')](_0x4001ed[_0xd068('0x5d')]);}})['then'](respondWithResult(_0x320d1b,null))[_0xd068('0x2b')](handleError(_0x320d1b,null));};exports[_0xd068('0x66')]=function(_0x8fb13,_0x2c9950,_0xe508bf){var _0x34d6d4={'raw':![],'where':{}};var _0x3bffd3={};var _0x12b41e={'count':0x0,'rows':[]};return db[_0xd068('0x3e')][_0xd068('0x67')]({'where':{'id':_0x8fb13['params']['id']}})[_0xd068('0x21')](handleEntityNotFound(_0x2c9950,null))['then'](function(_0x506ac0){if(_0x506ac0){_0x3bffd3['model']=_[_0xd068('0x58')](db[_0xd068('0x68')]['rawAttributes']);_0x3bffd3[_0xd068('0x44')]=_['keys'](_0x8fb13[_0xd068('0x44')]);_0x3bffd3[_0xd068('0x45')]=_[_0xd068('0x47')](_0x3bffd3['model'],_0x3bffd3[_0xd068('0x44')]);_0x34d6d4[_0xd068('0x46')]=_[_0xd068('0x47')](_0x3bffd3[_0xd068('0x42')],qs[_0xd068('0x59')](_0x8fb13['query'][_0xd068('0x59')]));_0x34d6d4[_0xd068('0x46')]=_0x34d6d4['attributes']['length']?_0x34d6d4[_0xd068('0x46')]:_0x3bffd3[_0xd068('0x42')];if(!_0x8fb13[_0xd068('0x44')][_0xd068('0x49')](_0xd068('0x4a'))){_0x34d6d4['limit']=qs[_0xd068('0x30')](_0x8fb13[_0xd068('0x44')][_0xd068('0x30')]);_0x34d6d4[_0xd068('0x32')]=qs['offset'](_0x8fb13[_0xd068('0x44')]['offset']);}_0x34d6d4[_0xd068('0x4b')]=qs[_0xd068('0x4c')](_0x8fb13['query'][_0xd068('0x4c')]);_0x34d6d4[_0xd068('0x51')]=qs[_0xd068('0x45')](_[_0xd068('0x4d')](_0x8fb13['query'],_0x3bffd3['filters']));_0x34d6d4['where'][_0xd068('0x65')]=_0x506ac0['id'];if(_0x8fb13[_0xd068('0x44')][_0xd068('0x4e')]){_0x34d6d4[_0xd068('0x51')]=_['merge'](_0x34d6d4[_0xd068('0x51')],{'$or':_[_0xd068('0x43')](_0x34d6d4['attributes'],function(_0x598d3b){var _0x10dd7d={};_0x10dd7d[_0x598d3b]={'$like':'%'+_0x8fb13[_0xd068('0x44')]['filter']+'%'};return _0x10dd7d;})});}_0x34d6d4=_[_0xd068('0x50')]({},_0x34d6d4,_0x8fb13['options']);return db[_0xd068('0x68')][_0xd068('0x31')]({'where':_0x34d6d4[_0xd068('0x51')]})[_0xd068('0x21')](function(_0x582268){_0x12b41e[_0xd068('0x31')]=_0x582268;if(_0x8fb13[_0xd068('0x44')][_0xd068('0x52')]){_0x34d6d4[_0xd068('0x5a')]=[{'all':!![]}];}return db[_0xd068('0x68')]['findAll'](_0x34d6d4);})['then'](function(_0x2eda80){_0x12b41e[_0xd068('0x54')]=_0x2eda80;return _0x12b41e;});}})[_0xd068('0x21')](respondWithFilteredResult(_0x2c9950,_0x34d6d4))[_0xd068('0x2b')](handleError(_0x2c9950,null));};exports[_0xd068('0x69')]=function(_0x49b7a7,_0xf22914,_0x16249c){return db[_0xd068('0x3e')][_0xd068('0x5b')]({'where':{'id':_0x49b7a7[_0xd068('0x56')]['id']}})[_0xd068('0x21')](handleEntityNotFound(_0xf22914,null))[_0xd068('0x21')](function(_0x209fff){if(_0x209fff){return _0x209fff[_0xd068('0x69')](_0x49b7a7[_0xd068('0x44')][_0xd068('0x6a')]);}})['then'](respondWithStatusCode(_0xf22914,null))[_0xd068('0x2b')](handleError(_0xf22914,null));};exports['addAnswer']=function(_0x24cf70,_0x5c707,_0x5dfccd){if(_0x24cf70['body']['id']){delete _0x24cf70[_0xd068('0x5d')]['id'];}return db[_0xd068('0x3e')]['find']({'where':{'id':_0x24cf70[_0xd068('0x56')]['id']}})[_0xd068('0x21')](handleEntityNotFound(_0x5c707,null))[_0xd068('0x21')](function(_0x2a84c6){if(_0x2a84c6){_0x24cf70[_0xd068('0x5d')][_0xd068('0x65')]=_0x2a84c6['id'];return db[_0xd068('0x6b')][_0xd068('0x5c')](_0x24cf70[_0xd068('0x5d')]);}})[_0xd068('0x21')](respondWithResult(_0x5c707,null))[_0xd068('0x2b')](handleError(_0x5c707,null));};exports['getAnswers']=function(_0x323d02,_0xe329a4,_0x4540c4){var _0x12593d={'raw':![],'where':{}};var _0x3ccc09={};var _0x23c5b1={'count':0x0,'rows':[]};return db[_0xd068('0x3e')][_0xd068('0x67')]({'where':{'id':_0x323d02[_0xd068('0x56')]['id']}})[_0xd068('0x21')](handleEntityNotFound(_0xe329a4,null))['then'](function(_0x5069aa){if(_0x5069aa){_0x3ccc09['model']=_[_0xd068('0x58')](db['CannedAnswer'][_0xd068('0x6c')]);_0x3ccc09[_0xd068('0x44')]=_[_0xd068('0x58')](_0x323d02[_0xd068('0x44')]);_0x3ccc09[_0xd068('0x45')]=_[_0xd068('0x47')](_0x3ccc09[_0xd068('0x42')],_0x3ccc09['query']);_0x12593d[_0xd068('0x46')]=_[_0xd068('0x47')](_0x3ccc09['model'],qs[_0xd068('0x59')](_0x323d02['query'][_0xd068('0x59')]));_0x12593d[_0xd068('0x46')]=_0x12593d[_0xd068('0x46')][_0xd068('0x48')]?_0x12593d[_0xd068('0x46')]:_0x3ccc09['model'];if(!_0x323d02[_0xd068('0x44')]['hasOwnProperty'](_0xd068('0x4a'))){_0x12593d['limit']=qs[_0xd068('0x30')](_0x323d02['query']['limit']);_0x12593d[_0xd068('0x32')]=qs[_0xd068('0x32')](_0x323d02['query'][_0xd068('0x32')]);}_0x12593d[_0xd068('0x4b')]=qs[_0xd068('0x4c')](_0x323d02[_0xd068('0x44')][_0xd068('0x4c')]);_0x12593d[_0xd068('0x51')]=qs['filters'](_['pick'](_0x323d02[_0xd068('0x44')],_0x3ccc09[_0xd068('0x45')]));_0x12593d[_0xd068('0x51')][_0xd068('0x65')]=_0x5069aa['id'];if(_0x323d02[_0xd068('0x44')]['filter']){_0x12593d['where']=_['merge'](_0x12593d[_0xd068('0x51')],{'$or':_[_0xd068('0x43')](_0x12593d[_0xd068('0x46')],function(_0x28ea44){var _0x392fa2={};_0x392fa2[_0x28ea44]={'$like':'%'+_0x323d02['query']['filter']+'%'};return _0x392fa2;})});}_0x12593d=_['merge']({},_0x12593d,_0x323d02[_0xd068('0x6d')]);return db[_0xd068('0x6b')][_0xd068('0x31')]({'where':_0x12593d[_0xd068('0x51')]})[_0xd068('0x21')](function(_0x9dc0c4){_0x23c5b1[_0xd068('0x31')]=_0x9dc0c4;if(_0x323d02[_0xd068('0x44')]['includeAll']){_0x12593d[_0xd068('0x5a')]=[{'all':!![]}];}return db['CannedAnswer'][_0xd068('0x53')](_0x12593d);})[_0xd068('0x21')](function(_0xc6419a){_0x23c5b1['rows']=_0xc6419a;return _0x23c5b1;});}})[_0xd068('0x21')](respondWithFilteredResult(_0xe329a4,_0x12593d))[_0xd068('0x2b')](handleError(_0xe329a4,null));};exports[_0xd068('0x6e')]=function(_0x4f70f5,_0x4f3edc,_0x12b671){return db[_0xd068('0x3e')][_0xd068('0x5b')]({'where':{'id':_0x4f70f5['params']['id']}})[_0xd068('0x21')](handleEntityNotFound(_0x4f3edc,null))['then'](function(_0x1d58f3){if(_0x1d58f3){return _0x1d58f3[_0xd068('0x6e')](_0x4f70f5[_0xd068('0x44')][_0xd068('0x6a')]);}})[_0xd068('0x21')](respondWithStatusCode(_0x4f3edc,null))[_0xd068('0x2b')](handleError(_0x4f3edc,null));};exports[_0xd068('0x6f')]=function(_0x5e5f58,_0x460d99,_0x25e7a2){return db[_0xd068('0x3e')][_0xd068('0x5b')]({'where':{'id':_0x5e5f58['params']['id']}})[_0xd068('0x21')](handleEntityNotFound(_0x460d99,null))['then'](function(_0x3a5c31){if(_0x3a5c31){return _0x3a5c31[_0xd068('0x6f')](_0x5e5f58[_0xd068('0x5d')][_0xd068('0x6a')],_['omit'](_0x5e5f58[_0xd068('0x5d')],[_0xd068('0x6a'),'id'])||{})['spread'](function(_0xe0114){for(var _0x2c55bc=0x0;_0x2c55bc<_0x5e5f58[_0xd068('0x5d')]['ids']['length'];_0x2c55bc+=0x1){socket['emit'](_0xd068('0x70'),{'UserId':Number(_0x5e5f58[_0xd068('0x5d')]['ids'][_0x2c55bc]),'WhatsappAccountId':Number(_0x5e5f58[_0xd068('0x56')]['id'])});}return _0xe0114;});}})[_0xd068('0x21')](respondWithResult(_0x460d99,null))['catch'](handleError(_0x460d99,null));};exports[_0xd068('0x71')]=function(_0x9c9e83,_0x2ac527,_0x461661){return db[_0xd068('0x3e')][_0xd068('0x5b')]({'where':{'id':_0x9c9e83[_0xd068('0x56')]['id']}})[_0xd068('0x21')](handleEntityNotFound(_0x2ac527,null))[_0xd068('0x21')](function(_0x76cb30){if(_0x76cb30){return _0x76cb30[_0xd068('0x71')](_0x9c9e83[_0xd068('0x44')][_0xd068('0x6a')])['then'](function(){if(_[_0xd068('0x72')](_0x9c9e83[_0xd068('0x44')]['ids'])){for(var _0x2017be=0x0;_0x2017be<_0x9c9e83['query'][_0xd068('0x6a')][_0xd068('0x48')];_0x2017be+=0x1){socket[_0xd068('0x73')](_0xd068('0x74'),{'UserId':Number(_0x9c9e83['query']['ids'][_0x2017be]),'WhatsappAccountId':Number(_0x9c9e83[_0xd068('0x56')]['id'])});}}else{socket[_0xd068('0x73')](_0xd068('0x74'),{'UserId':Number(_0x9c9e83[_0xd068('0x44')][_0xd068('0x6a')]),'WhatsappAccountId':Number(_0x9c9e83[_0xd068('0x56')]['id'])});}});}})[_0xd068('0x21')](respondWithStatusCode(_0x2ac527,null))['catch'](handleError(_0x2ac527,null));};exports[_0xd068('0x75')]=function(_0x1fc6ad,_0x276051,_0x15d19d){var _0xb04ec1={};var _0x43292b={};var _0x39a40d;var _0x5dbaf9;return db['WhatsappAccount']['findOne']({'where':{'id':_0x1fc6ad[_0xd068('0x56')]['id']}})[_0xd068('0x21')](handleEntityNotFound(_0x276051,null))[_0xd068('0x21')](function(_0x112a64){if(_0x112a64){_0x39a40d=_0x112a64;_0x43292b['model']=_[_0xd068('0x58')](db[_0xd068('0x76')][_0xd068('0x6c')]);_0x43292b[_0xd068('0x44')]=_[_0xd068('0x58')](_0x1fc6ad[_0xd068('0x44')]);_0x43292b[_0xd068('0x45')]=_[_0xd068('0x47')](_0x43292b[_0xd068('0x42')],_0x43292b[_0xd068('0x44')]);_0xb04ec1[_0xd068('0x46')]=_['intersection'](_0x43292b[_0xd068('0x42')],qs[_0xd068('0x59')](_0x1fc6ad[_0xd068('0x44')][_0xd068('0x59')]));_0xb04ec1[_0xd068('0x46')]=_0xb04ec1['attributes']['length']?_0xb04ec1[_0xd068('0x46')]:_0x43292b[_0xd068('0x42')];_0xb04ec1[_0xd068('0x4b')]=qs[_0xd068('0x4c')](_0x1fc6ad[_0xd068('0x44')][_0xd068('0x4c')]);_0xb04ec1[_0xd068('0x51')]=qs['filters'](_[_0xd068('0x4d')](_0x1fc6ad[_0xd068('0x44')],_0x43292b[_0xd068('0x45')]));if(_0x1fc6ad[_0xd068('0x44')][_0xd068('0x4e')]){_0xb04ec1[_0xd068('0x51')]=_[_0xd068('0x50')](_0xb04ec1[_0xd068('0x51')],{'$or':_[_0xd068('0x43')](_0xb04ec1[_0xd068('0x46')],function(_0x13a0d5){var _0x35894b={};_0x35894b[_0x13a0d5]={'$like':'%'+_0x1fc6ad['query']['filter']+'%'};return _0x35894b;})});}_0xb04ec1=_[_0xd068('0x50')]({},_0xb04ec1,_0x1fc6ad[_0xd068('0x6d')]);return _0x39a40d[_0xd068('0x75')](_0xb04ec1);}})[_0xd068('0x21')](function(_0x22b0f2){if(_0x22b0f2){_0x5dbaf9=_0x22b0f2[_0xd068('0x48')];if(!_0x1fc6ad[_0xd068('0x44')][_0xd068('0x49')]('nolimit')){_0xb04ec1[_0xd068('0x30')]=qs[_0xd068('0x30')](_0x1fc6ad['query'][_0xd068('0x30')]);_0xb04ec1[_0xd068('0x32')]=qs[_0xd068('0x32')](_0x1fc6ad[_0xd068('0x44')]['offset']);}return _0x39a40d[_0xd068('0x75')](_0xb04ec1);}})[_0xd068('0x21')](function(_0x371645){if(_0x371645){return _0x371645?{'count':_0x5dbaf9,'rows':_0x371645}:null;}})[_0xd068('0x21')](respondWithResult(_0x276051,null))[_0xd068('0x2b')](handleError(_0x276051,null));};exports['addApplications']=function(_0xb605d,_0x11516d,_0x5f105a){return db[_0xd068('0x3e')][_0xd068('0x67')]({'where':{'id':_0xb605d[_0xd068('0x56')]['id']}})[_0xd068('0x21')](handleEntityNotFound(_0x11516d,null))[_0xd068('0x21')](function(_0x39797c){if(_0x39797c){return db[_0xd068('0x77')][_0xd068('0x78')](function(_0x2e1ab3){return db[_0xd068('0x79')][_0xd068('0x38')]({'where':{'WhatsappAccountId':_0xb605d['params']['id']},'transaction':_0x2e1ab3})[_0xd068('0x21')](function(_0x1817c6){var _0x1d54ee=_[_0xd068('0x43')](_0xb605d[_0xd068('0x5d')],function(_0x39d308){_0x39d308['WhatsappAccountId']=_0xb605d['params']['id'];return _0x39d308;});return db[_0xd068('0x79')]['bulkCreate'](_0x1d54ee,{'transaction':_0x2e1ab3});});})['then'](function(){return db[_0xd068('0x79')]['findAndCountAll']({'where':{'WhatsappAccountId':_0xb605d[_0xd068('0x56')]['id']},'order':'priority'});});}})[_0xd068('0x21')](respondWithResult(_0x11516d,null))[_0xd068('0x2b')](handleError(_0x11516d,null));};exports[_0xd068('0x7a')]=function(_0xe24be0,_0x132545,_0x3868bc){var _0x3ce4b2={};var _0x432143={};var _0xbefdd7;var _0x456a6c;return db[_0xd068('0x3e')]['findOne']({'where':{'id':_0xe24be0['params']['id']}})[_0xd068('0x21')](handleEntityNotFound(_0x132545,null))[_0xd068('0x21')](function(_0x18d564){if(_0x18d564){_0xbefdd7=_0x18d564;_0x432143['model']=_[_0xd068('0x58')](db[_0xd068('0x79')][_0xd068('0x6c')]);_0x432143[_0xd068('0x44')]=_[_0xd068('0x58')](_0xe24be0[_0xd068('0x44')]);_0x432143[_0xd068('0x45')]=_[_0xd068('0x47')](_0x432143[_0xd068('0x42')],_0x432143['query']);_0x3ce4b2['attributes']=_[_0xd068('0x47')](_0x432143[_0xd068('0x42')],qs['fields'](_0xe24be0[_0xd068('0x44')][_0xd068('0x59')]));_0x3ce4b2['attributes']=_0x3ce4b2[_0xd068('0x46')][_0xd068('0x48')]?_0x3ce4b2['attributes']:_0x432143[_0xd068('0x42')];_0x3ce4b2[_0xd068('0x4b')]=qs[_0xd068('0x4c')](_0xe24be0[_0xd068('0x44')][_0xd068('0x4c')]);_0x3ce4b2[_0xd068('0x51')]=qs[_0xd068('0x45')](_[_0xd068('0x4d')](_0xe24be0['query'],_0x432143[_0xd068('0x45')]));if(_0xe24be0['query'][_0xd068('0x4e')]){_0x3ce4b2[_0xd068('0x51')]=_[_0xd068('0x50')](_0x3ce4b2[_0xd068('0x51')],{'$or':_[_0xd068('0x43')](_0x3ce4b2[_0xd068('0x46')],function(_0x11d823){var _0x249ff9={};_0x249ff9[_0x11d823]={'$like':'%'+_0xe24be0[_0xd068('0x44')][_0xd068('0x4e')]+'%'};return _0x249ff9;})});}_0x3ce4b2=_[_0xd068('0x50')]({},_0x3ce4b2,_0xe24be0[_0xd068('0x6d')]);return _0xbefdd7[_0xd068('0x7a')](_0x3ce4b2);}})[_0xd068('0x21')](function(_0x50c9fc){if(_0x50c9fc){_0x456a6c=_0x50c9fc[_0xd068('0x48')];if(!_0xe24be0[_0xd068('0x44')][_0xd068('0x49')](_0xd068('0x4a'))){_0x3ce4b2['limit']=qs[_0xd068('0x30')](_0xe24be0[_0xd068('0x44')][_0xd068('0x30')]);_0x3ce4b2['offset']=qs['offset'](_0xe24be0[_0xd068('0x44')][_0xd068('0x32')]);}return _0xbefdd7['getApplications'](_0x3ce4b2);}})['then'](function(_0x11de22){if(_0x11de22){return _0x11de22?{'count':_0x456a6c,'rows':_0x11de22}:null;}})[_0xd068('0x21')](respondWithResult(_0x132545,null))['catch'](handleError(_0x132545,null));};exports['notify']=function(_0x281eb8,_0x511a42,_0x321ea0){var _0x2d8ab0={'channel':_0xd068('0x7b')};var _0x2baf31=[];var _0x3e982b=[];var _0x3d8d14={};return db['WhatsappAccount']['find']({'where':{'id':_0x281eb8[_0xd068('0x56')]['id']},'include':[{'model':db['WhatsappApplication'],'as':_0xd068('0x7c')}]})[_0xd068('0x21')](handleEntityNotFound(_0x511a42,null))[_0xd068('0x21')](function(_0x17c5cf){_0x2d8ab0[_0xd068('0x7d')]=_0x17c5cf;_0x2d8ab0[_0xd068('0x7e')]=_[_0xd068('0x7f')](_0x17c5cf[_0xd068('0x7c')],['priority'],[_0xd068('0x80')]);if(_0x2d8ab0[_0xd068('0x7d')][_0xd068('0x7c')]){delete _0x2d8ab0[_0xd068('0x7d')][_0xd068('0x7c')];}return db[_0xd068('0x81')][_0xd068('0x82')]();})[_0xd068('0x21')](function(_0x3ff966){if(!_0x3ff966){throw new db[(_0xd068('0x83'))][(_0xd068('0x84'))]('no\x20available\x20attributes');}_0x2baf31=_['difference'](_[_0xd068('0x58')](_0x3ff966),['createdAt',_0xd068('0x85')]);_0x3e982b=_[_0xd068('0x86')](_[_0xd068('0x58')](_0x3ff966),[_0xd068('0x87'),_0xd068('0x85'),_0xd068('0x88'),_0xd068('0x89')]);_0x2d8ab0[_0xd068('0x5d')]={'mapKey':_0xd068('0x8a')};if(_0x2d8ab0['account']['type']&&_0x2d8ab0['account'][_0xd068('0x40')]===_0xd068('0x8b')){_0x2d8ab0[_0xd068('0x5d')][_0xd068('0x8c')]=_0x281eb8[_0xd068('0x5d')][_0xd068('0x8d')][_0xd068('0x8e')](_0xd068('0x8f'),'');_0x2d8ab0[_0xd068('0x5d')][_0xd068('0x5d')]=_0x281eb8[_0xd068('0x5d')][_0xd068('0x90')];_0x2d8ab0[_0xd068('0x5d')][_0xd068('0x91')]=_0x281eb8['body'][_0xd068('0x92')];}if(_0x2d8ab0[_0xd068('0x5d')]['id']){delete _0x2d8ab0[_0xd068('0x5d')]['id'];}if(_[_0xd068('0x93')](_0x2d8ab0[_0xd068('0x5d')][_0xd068('0x8c')])){throw new db[(_0xd068('0x83'))][(_0xd068('0x84'))](_0xd068('0x94'));}if(_[_0xd068('0x93')](_0x2d8ab0['body']['body'])||_0x2d8ab0['body'][_0xd068('0x5d')]===''){throw new db['Sequelize']['ValidationError'](_0xd068('0x95'));}if(_['isNil'](_0x2d8ab0[_0xd068('0x5d')][_0xd068('0x96')])){throw new db[(_0xd068('0x83'))][(_0xd068('0x84'))](_0xd068('0x97')+_0x3e982b);}if(!_[_0xd068('0x98')](_0x3e982b,_0x2d8ab0[_0xd068('0x5d')]['mapKey'])){throw new db[(_0xd068('0x83'))][(_0xd068('0x84'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3e982b);}_0x3d8d14[_0x2d8ab0[_0xd068('0x5d')][_0xd068('0x96')]]=_0x2d8ab0[_0xd068('0x5d')]['from'];return db[_0xd068('0x99')]['find']({'where':{'id':_0x2d8ab0['account']['ListId']},'include':[{'model':db[_0xd068('0x81')],'as':_0xd068('0x9a'),'where':_0x3d8d14,'limit':0x1,'order':[['updatedAt','DESC']]}]});})[_0xd068('0x21')](handleEntityNotFound(_0x511a42,null))[_0xd068('0x21')](function(_0x2f4351){if(_0x2f4351){_0x2d8ab0['list']=_['omit'](_0x2f4351,[_0xd068('0x9a')]);if(_0x2f4351[_0xd068('0x9a')]['length']){return _0x2f4351[_0xd068('0x9a')][0x0];}var _0xcdf26e=_[_0xd068('0x1b')](_0x2d8ab0[_0xd068('0x5d')],{'firstName':_0x2d8ab0[_0xd068('0x5d')][_0xd068('0x8c')],'ListId':_0x2f4351['id']});_0xcdf26e[_0x2d8ab0[_0xd068('0x5d')][_0xd068('0x96')]]=_0x2d8ab0[_0xd068('0x5d')]['from'];return db[_0xd068('0x81')][_0xd068('0x5c')](_0xcdf26e,{'fields':_0x2baf31,'raw':!![]});}})[_0xd068('0x21')](handleEntityNotFound(_0x511a42,null))[_0xd068('0x21')](function(_0x5bcaa2){if(_0x5bcaa2){_0x2d8ab0['contact']=_0x5bcaa2;var _0x34610a={'ContactId':_0x5bcaa2['id'],'phone':_0x2d8ab0[_0xd068('0x5d')][_0xd068('0x8c')],'WhatsappAccountId':_0x281eb8[_0xd068('0x56')]['id']};var _0x4ce929={'ContactId':_0x5bcaa2['id'],'WhatsappAccountId':_0x281eb8[_0xd068('0x56')]['id'],'closed':![]};return db[_0xd068('0x9b')][_0xd068('0x5b')]({'where':_0x4ce929})[_0xd068('0x21')](function(_0x599cb2){if(_0x599cb2){return[_0x599cb2,![]];}return db['WhatsappInteraction'][_0xd068('0x5c')](_0x34610a)[_0xd068('0x21')](function(_0x45dc9c){return[_0x45dc9c,!![]];});});}})['spread'](function(_0x3207d6,_0x55e68b){_0x2d8ab0[_0xd068('0x9c')]=_0x3207d6['get']({'plain':!![]});_0x2d8ab0[_0xd068('0x9c')]['created']=![];if(_0x55e68b){if(_0x2d8ab0[_0xd068('0x7d')][_0xd068('0x9d')]){_0x2d8ab0[_0xd068('0x7e')]['push']({'id':0x0,'priority':_0x2d8ab0[_0xd068('0x7e')][_0xd068('0x48')]+0x1,'app':'close','appdata':'unmanaged','interval':_0xd068('0x9e')});}_0x2d8ab0['interaction'][_0xd068('0x9f')]=!![];}return db[_0xd068('0xa0')][_0xd068('0x5c')]({'phone':_0x2d8ab0[_0xd068('0x5d')][_0xd068('0x8c')],'messageId':_0x2d8ab0[_0xd068('0x5d')][_0xd068('0x91')],'body':_0x2d8ab0[_0xd068('0x5d')][_0xd068('0x5d')],'WhatsappAccountId':_0x281eb8[_0xd068('0x56')]['id'],'WhatsappInteractionId':_0x3207d6['id'],'direction':'in','ContactId':_0x3207d6[_0xd068('0xa1')],'AttachmentId':_0x2d8ab0[_0xd068('0x5d')][_0xd068('0xa2')]});})[_0xd068('0x21')](function(_0x5ecd78){_0x2d8ab0[_0xd068('0x29')]=_0x5ecd78;if(_0x2d8ab0[_0xd068('0x9c')]['UserId']){return db['User'][_0xd068('0x5b')]({'attributes':['id',_0xd068('0x3b')],'where':{'id':_0x2d8ab0[_0xd068('0x9c')][_0xd068('0xa3')]}})['then'](function(_0x207b0c){if(_0x207b0c){_0x2d8ab0['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0xd068('0xa4'),'appdata':_0x207b0c['name']+','+(_0x2d8ab0[_0xd068('0x7d')]['waitForTheAssignedAgent']||0xa),'interval':_0xd068('0x9e')});}return respondWithRpcPromise(_0xd068('0xa5'),_0xd068('0xa6'),_0x2d8ab0);});}return respondWithRpcPromise(_0xd068('0xa5'),'startRouting',_0x2d8ab0);})['then'](function(_0x1f7088){if(_0x1f7088){var _0x2fd44c=0xc8;var _0xffdfe1='receiveMessage';logger['info'](_0xd068('0x26'),_0xffdfe1,_0x2fd44c,'entity\x20found');logger[_0xd068('0x25')](_0xd068('0xa7'),_0xffdfe1,_0x2fd44c,_0xd068('0xa8'),JSON['stringify'](_0x1f7088));if(_0x2d8ab0['account']['type']==='twilio'){return _0x511a42[_0xd068('0x2d')](_0x2fd44c)[_0xd068('0x33')](_0xd068('0xa9'),'text/xml')[_0xd068('0xaa')](_0xd068('0xab'));}else{return _0x511a42[_0xd068('0x2d')](_0x2fd44c)[_0xd068('0x2f')](_0x1f7088);}}})[_0xd068('0x2b')](handleError(_0x511a42,null));};exports[_0xd068('0xaa')]=function(_0x2c6ae2,_0x5f40a4,_0xead275){var _0x5a9648,_0x1222c1,_0x4b1272;if(_['isNil'](_0x2c6ae2[_0xd068('0x5d')][_0xd068('0x5d')])||_0x2c6ae2[_0xd068('0x5d')][_0xd068('0x5d')]===''){throw new db[(_0xd068('0x83'))][(_0xd068('0x84'))](_0xd068('0x95'));}if(_[_0xd068('0x93')](_0x2c6ae2[_0xd068('0x5d')]['to'])){throw new db[(_0xd068('0x83'))][(_0xd068('0x84'))](_0xd068('0xac'));}_0x5a9648=_0x2c6ae2[_0xd068('0x5d')]['to'];return db['WhatsappAccount'][_0xd068('0x5b')]({'where':{'id':_0x2c6ae2[_0xd068('0x56')]['id']},'include':[{'model':db[_0xd068('0x99')],'as':_0xd068('0xad'),'include':[{'model':db[_0xd068('0x81')],'as':_0xd068('0x9a'),'where':{'mobile':_0x5a9648},'limit':0x1,'order':[[_0xd068('0x85'),_0xd068('0xae')]]}]}]})['then'](handleEntityNotFound(_0x5f40a4,null))[_0xd068('0x21')](function(_0xc92b5a){if(_0xc92b5a&&_0xc92b5a[_0xd068('0xad')]){_0x1222c1=_0xc92b5a[_0xd068('0x39')]({'plain':!![]});if(_0x1222c1[_0xd068('0xad')]&&_0x1222c1[_0xd068('0xad')][_0xd068('0x9a')][_0xd068('0x48')]){return _0x1222c1[_0xd068('0xad')][_0xd068('0x9a')][0x0];}return db[_0xd068('0x81')][_0xd068('0x5c')](_[_0xd068('0x1b')](_0x2c6ae2[_0xd068('0x5d')],{'firstName':_0x5a9648,'mobile':_0x5a9648,'phone':_0x5a9648,'ListId':_0x1222c1[_0xd068('0x89')]}));}})[_0xd068('0x21')](handleEntityNotFound(_0x5f40a4,null))[_0xd068('0x21')](function(_0x5af1ff){if(_0x5af1ff){_0x4b1272=_0x5af1ff;return db[_0xd068('0x9b')][_0xd068('0x5b')]({'where':{'ContactId':_0x4b1272['id'],'closed':![],'WhatsappAccountId':_0x1222c1['id']}})[_0xd068('0x21')](function(_0x3c1056){if(_0x3c1056){return[_0x3c1056,![]];}return db[_0xd068('0x9b')]['create']({'UserId':_0x2c6ae2[_0xd068('0x5e')]['id'],'ContactId':_0x4b1272['id'],'WhatsappAccountId':_0x1222c1['id'],'phone':_0x5a9648,'firstMsgDirection':_0xd068('0xaf'),'Messages':[_[_0xd068('0x50')](_0x2c6ae2[_0xd068('0x5d')],{'read':![],'body':_0x2c6ae2['body']['body'],'phone':_0x5a9648,'WhatsappAccountId':_0x1222c1['id'],'UserId':_0x2c6ae2[_0xd068('0x5e')]['id'],'ContactId':_0x4b1272['id']})]},{'include':[{'model':db[_0xd068('0xa0')],'as':_0xd068('0xb0')}]})[_0xd068('0x21')](function(_0xe373dd){return[_0xe373dd,!![]];});});}})[_0xd068('0xb1')](function(_0x356545,_0x279131){if(_0x279131){return _0x356545;}return db[_0xd068('0xa0')][_0xd068('0x5c')](_['merge'](_0x2c6ae2['body'],{'read':![],'body':_0x2c6ae2['body'][_0xd068('0x5d')],'phone':_0x5a9648,'WhatsappAccountId':_0x1222c1['id'],'WhatsappInteractionId':_0x356545['id'],'UserId':_0x2c6ae2[_0xd068('0x5e')]['id'],'ContactId':_0x4b1272['id']}))[_0xd068('0x21')](function(_0x56d0c6){_0x356545[_0xd068('0xb2')][_0xd068('0xb0')]=[];_0x356545[_0xd068('0xb2')][_0xd068('0xb0')]['push'](_0x56d0c6[_0xd068('0xb2')]);return _0x356545;});})[_0xd068('0x21')](respondWithResult(_0x5f40a4,null))[_0xd068('0x2b')](handleError(_0x5f40a4,null));}; \ No newline at end of file +var _0x8b0e=['whatsapp:','Body','messageId','MessageSid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','ListId','Contacts','list','WhatsappInteraction','spread','interaction','autoclose','push','unmanaged','*,*,*,*','created','WhatsappMessage','ContactId','AttachmentId','UserId','unshift','Start','startRouting','WhatsappAccount,\x20%s,\x20%s,\x20%s','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','Content-Type','\x0a','List','DESC','Messages','dataValues','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','defaults','redis','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','client','http','request','then','info','WhatsappAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','get','WhatsappAccounts','UserProfileResource','end','stack','name','send','Pause','mandatoryDispositionPause','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','WhatsappAccount','includeAll','include','findAll','rows','show','params','options','find','create','user','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','WhatsappAccountId','Disposition','getDispositions','findOne','order','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','addAgents','omit','emit','removeAgents','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','transaction','WhatsappApplication','findAndCountAll','priority','getApplications','Applications','account','applications','orderBy','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','mobile','from','From','replace'];(function(_0x5b5264,_0x2c45fa){var _0x111db4=function(_0x3392f7){while(--_0x3392f7){_0x5b5264['push'](_0x5b5264['shift']());}};_0x111db4(++_0x2c45fa);}(_0x8b0e,0x192));var _0xe8b0=function(_0x4b630,_0x151f86){_0x4b630=_0x4b630-0x0;var _0x24f855=_0x8b0e[_0x4b630];return _0x24f855;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe8b0('0x0'));var zipdir=require(_0xe8b0('0x1'));var jsonpatch=require(_0xe8b0('0x2'));var rp=require('request-promise');var moment=require(_0xe8b0('0x3'));var BPromise=require(_0xe8b0('0x4'));var Mustache=require(_0xe8b0('0x5'));var util=require('util');var path=require(_0xe8b0('0x6'));var sox=require(_0xe8b0('0x7'));var csv=require(_0xe8b0('0x8'));var ejs=require(_0xe8b0('0x9'));var fs=require('fs');var fs_extra=require(_0xe8b0('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe8b0('0xb'));var deskjs=require(_0xe8b0('0xc'));var toCsv=require('to-csv');var querystring=require(_0xe8b0('0xd'));var Papa=require(_0xe8b0('0xe'));var Redis=require(_0xe8b0('0xf'));var authService=require(_0xe8b0('0x10'));var qs=require(_0xe8b0('0x11'));var as=require(_0xe8b0('0x12'));var hardwareService=require(_0xe8b0('0x13'));var logger=require(_0xe8b0('0x14'))(_0xe8b0('0x15'));var utils=require('../../config/utils');var config=require(_0xe8b0('0x16'));var licenseUtil=require(_0xe8b0('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xe8b0('0x18')](config[_0xe8b0('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xe8b0('0x1a'))(new Redis(config[_0xe8b0('0x19')]));require(_0xe8b0('0x1b'))[_0xe8b0('0x1c')](socket);var jayson=require(_0xe8b0('0x1d'));var client=jayson[_0xe8b0('0x1e')][_0xe8b0('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x2bd406,_0x4bc197,_0x2a8275,_0x22b9ba){return new BPromise(function(_0xf5c9bf,_0x1c9678){var _0x436ac9=_0x22b9ba||client;return _0x436ac9[_0xe8b0('0x20')](_0x2bd406,_0x2a8275)[_0xe8b0('0x21')](function(_0x4e0127){logger[_0xe8b0('0x22')](_0xe8b0('0x23'),_0x4bc197,'request\x20sent');logger[_0xe8b0('0x24')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x4bc197,_0xe8b0('0x25'),JSON[_0xe8b0('0x26')](_0x4e0127));if(_0x4e0127[_0xe8b0('0x27')]){if(_0x4e0127[_0xe8b0('0x27')]['code']===0x1f4){logger[_0xe8b0('0x27')](_0xe8b0('0x23'),_0x4bc197,_0x4e0127[_0xe8b0('0x27')][_0xe8b0('0x28')]);return _0x1c9678(_0x4e0127['error'][_0xe8b0('0x28')]);}logger[_0xe8b0('0x27')](_0xe8b0('0x23'),_0x4bc197,_0x4e0127[_0xe8b0('0x27')]['message']);return _0xf5c9bf(_0x4e0127[_0xe8b0('0x27')]['message']);}else{logger['info'](_0xe8b0('0x23'),_0x4bc197,_0xe8b0('0x25'));_0xf5c9bf(_0x4e0127[_0xe8b0('0x29')]['message']);}})[_0xe8b0('0x2a')](function(_0x1370f7){logger[_0xe8b0('0x27')](_0xe8b0('0x23'),_0x4bc197,_0x1370f7);_0x1c9678(_0x1370f7);});});}function respondWithStatusCode(_0x5c601a,_0x1ca9b8){_0x1ca9b8=_0x1ca9b8||0xcc;return function(_0xe243){if(_0xe243){return _0x5c601a[_0xe8b0('0x2b')](_0x1ca9b8);}return _0x5c601a[_0xe8b0('0x2c')](_0x1ca9b8)['end']();};}function respondWithResult(_0x44c342,_0x3ddd02){_0x3ddd02=_0x3ddd02||0xc8;return function(_0x1f80b2){if(_0x1f80b2){return _0x44c342[_0xe8b0('0x2c')](_0x3ddd02)[_0xe8b0('0x2d')](_0x1f80b2);}};}function respondWithFilteredResult(_0x4bb124,_0x282bce){return function(_0x272d8c){if(_0x272d8c){var _0x55eb5c=typeof _0x282bce['offset']===_0xe8b0('0x2e')&&typeof _0x282bce[_0xe8b0('0x2f')]===_0xe8b0('0x2e');var _0x4eda6a=_0x272d8c[_0xe8b0('0x30')];var _0x4017f2=_0x55eb5c?0x0:_0x282bce['offset'];var _0x298812=_0x55eb5c?_0x272d8c['count']:_0x282bce[_0xe8b0('0x31')]+_0x282bce[_0xe8b0('0x2f')];var _0xf44e16;if(_0x298812>=_0x4eda6a){_0x298812=_0x4eda6a;_0xf44e16=0xc8;}else{_0xf44e16=0xce;}_0x4bb124['status'](_0xf44e16);return _0x4bb124[_0xe8b0('0x32')](_0xe8b0('0x33'),_0x4017f2+'-'+_0x298812+'/'+_0x4eda6a)[_0xe8b0('0x2d')](_0x272d8c);}return null;};}function patchUpdates(_0x1c49b5){return function(_0x2365ea){try{jsonpatch[_0xe8b0('0x34')](_0x2365ea,_0x1c49b5,!![]);}catch(_0x4c7ad5){return BPromise[_0xe8b0('0x35')](_0x4c7ad5);}return _0x2365ea[_0xe8b0('0x36')]();};}function saveUpdates(_0x147f2e,_0x6492fa){return function(_0x15841d){if(_0x15841d){return _0x15841d[_0xe8b0('0x37')](_0x147f2e)[_0xe8b0('0x21')](function(_0x1879de){return _0x1879de;});}return null;};}function removeEntity(_0x1769fb,_0x1aa02c){return function(_0x565804){if(_0x565804){return _0x565804[_0xe8b0('0x38')]()[_0xe8b0('0x21')](function(){var _0x203f13=_0x565804[_0xe8b0('0x39')]({'plain':!![]});var _0x50aaa9=_0xe8b0('0x3a');return db[_0xe8b0('0x3b')][_0xe8b0('0x38')]({'where':{'type':_0x50aaa9,'resourceId':_0x203f13['id']}})[_0xe8b0('0x21')](function(){return _0x565804;});})[_0xe8b0('0x21')](function(){_0x1769fb[_0xe8b0('0x2c')](0xcc)[_0xe8b0('0x3c')]();});}};}function handleEntityNotFound(_0x2baf89,_0x31e7fd){return function(_0x14e087){if(!_0x14e087){_0x2baf89[_0xe8b0('0x2b')](0x194);}return _0x14e087;};}function handleError(_0x39f82b,_0x466c7d){_0x466c7d=_0x466c7d||0x1f4;return function(_0x49cb01){logger['error'](_0x49cb01[_0xe8b0('0x3d')]);if(_0x49cb01[_0xe8b0('0x3e')]){delete _0x49cb01[_0xe8b0('0x3e')];}_0x39f82b[_0xe8b0('0x2c')](_0x466c7d)[_0xe8b0('0x3f')](_0x49cb01);};}exports['index']=function(_0x46eaa3,_0x2d063b){var _0x423069={'include':[{'model':db[_0xe8b0('0x40')],'as':_0xe8b0('0x41')}]},_0x1093bf={},_0x148f6f={'count':0x0,'rows':[]};var _0x1cc3b7=_['map'](db['WhatsappAccount'][_0xe8b0('0x42')],function(_0x3fad9a){return{'name':_0x3fad9a[_0xe8b0('0x43')],'type':_0x3fad9a[_0xe8b0('0x44')][_0xe8b0('0x45')]};});_0x1093bf[_0xe8b0('0x46')]=_[_0xe8b0('0x47')](_0x1cc3b7,_0xe8b0('0x3e'));_0x1093bf['query']=_[_0xe8b0('0x48')](_0x46eaa3[_0xe8b0('0x49')]);_0x1093bf[_0xe8b0('0x4a')]=_[_0xe8b0('0x4b')](_0x1093bf[_0xe8b0('0x46')],_0x1093bf[_0xe8b0('0x49')]);_0x423069[_0xe8b0('0x4c')]=_['intersection'](_0x1093bf[_0xe8b0('0x46')],qs[_0xe8b0('0x4d')](_0x46eaa3[_0xe8b0('0x49')][_0xe8b0('0x4d')]));_0x423069[_0xe8b0('0x4c')]=_0x423069['attributes'][_0xe8b0('0x4e')]?_0x423069[_0xe8b0('0x4c')]:_0x1093bf[_0xe8b0('0x46')];if(!_0x46eaa3['query'][_0xe8b0('0x4f')](_0xe8b0('0x50'))){_0x423069['limit']=qs[_0xe8b0('0x2f')](_0x46eaa3[_0xe8b0('0x49')][_0xe8b0('0x2f')]);_0x423069[_0xe8b0('0x31')]=qs['offset'](_0x46eaa3['query'][_0xe8b0('0x31')]);}_0x423069['order']=qs[_0xe8b0('0x51')](_0x46eaa3[_0xe8b0('0x49')][_0xe8b0('0x51')]);_0x423069[_0xe8b0('0x52')]=qs[_0xe8b0('0x4a')](_[_0xe8b0('0x53')](_0x46eaa3[_0xe8b0('0x49')],_0x1093bf[_0xe8b0('0x4a')]),_0x1cc3b7);if(_0x46eaa3[_0xe8b0('0x49')][_0xe8b0('0x54')]){_0x423069['where']=_[_0xe8b0('0x55')](_0x423069[_0xe8b0('0x52')],{'$or':_[_0xe8b0('0x47')](_0x1cc3b7,function(_0x583c35){if(_0x583c35['type']!=='VIRTUAL'){var _0x18ed48={};_0x18ed48[_0x583c35[_0xe8b0('0x3e')]]={'$like':'%'+_0x46eaa3[_0xe8b0('0x49')][_0xe8b0('0x54')]+'%'};return _0x18ed48;}})});}_0x423069=_[_0xe8b0('0x55')]({},_0x423069,_0x46eaa3['options']);var _0x80797={'where':_0x423069[_0xe8b0('0x52')]};return db[_0xe8b0('0x56')][_0xe8b0('0x30')](_0x80797)[_0xe8b0('0x21')](function(_0x2ae31e){_0x148f6f[_0xe8b0('0x30')]=_0x2ae31e;if(_0x46eaa3[_0xe8b0('0x49')][_0xe8b0('0x57')]){_0x423069[_0xe8b0('0x58')]=[{'all':!![]}];}return db[_0xe8b0('0x56')][_0xe8b0('0x59')](_0x423069);})['then'](function(_0x2dc2bb){_0x148f6f[_0xe8b0('0x5a')]=_0x2dc2bb;return _0x148f6f;})[_0xe8b0('0x21')](respondWithFilteredResult(_0x2d063b,_0x423069))[_0xe8b0('0x2a')](handleError(_0x2d063b,null));};exports[_0xe8b0('0x5b')]=function(_0x1b0203,_0x568f3a){var _0x5678d0={'raw':![],'where':{'id':_0x1b0203[_0xe8b0('0x5c')]['id']},'include':[{'model':db[_0xe8b0('0x40')],'as':_0xe8b0('0x41')}]},_0x2cb305={};_0x2cb305[_0xe8b0('0x46')]=_['keys'](db['WhatsappAccount'][_0xe8b0('0x42')]);_0x2cb305[_0xe8b0('0x49')]=_[_0xe8b0('0x48')](_0x1b0203[_0xe8b0('0x49')]);_0x2cb305[_0xe8b0('0x4a')]=_[_0xe8b0('0x4b')](_0x2cb305[_0xe8b0('0x46')],_0x2cb305['query']);_0x5678d0['attributes']=_[_0xe8b0('0x4b')](_0x2cb305[_0xe8b0('0x46')],qs[_0xe8b0('0x4d')](_0x1b0203[_0xe8b0('0x49')]['fields']));_0x5678d0[_0xe8b0('0x4c')]=_0x5678d0['attributes']['length']?_0x5678d0[_0xe8b0('0x4c')]:_0x2cb305[_0xe8b0('0x46')];if(_0x1b0203['query'][_0xe8b0('0x57')]){_0x5678d0[_0xe8b0('0x58')]=[{'all':!![]}];}_0x5678d0=_[_0xe8b0('0x55')]({},_0x5678d0,_0x1b0203[_0xe8b0('0x5d')]);return db['WhatsappAccount'][_0xe8b0('0x5e')](_0x5678d0)[_0xe8b0('0x21')](handleEntityNotFound(_0x568f3a,null))[_0xe8b0('0x21')](respondWithResult(_0x568f3a,null))['catch'](handleError(_0x568f3a,null));};exports[_0xe8b0('0x5f')]=function(_0x2d4035,_0x1261ea){return db[_0xe8b0('0x56')][_0xe8b0('0x5f')](_0x2d4035['body'],{})['then'](function(_0x1eef4b){var _0x2acf6d=_0x2d4035[_0xe8b0('0x60')][_0xe8b0('0x39')]({'plain':!![]});if(!_0x2acf6d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2acf6d[_0xe8b0('0x61')]===_0xe8b0('0x60')){var _0x22d4aa=_0x1eef4b[_0xe8b0('0x39')]({'plain':!![]});var _0x3c1980='WhatsappAccounts';return db['UserProfileSection']['find']({'where':{'name':_0x3c1980,'userProfileId':_0x2acf6d['userProfileId']},'raw':!![]})[_0xe8b0('0x21')](function(_0x37b00b){if(_0x37b00b&&_0x37b00b['autoAssociation']===0x0){return db[_0xe8b0('0x3b')][_0xe8b0('0x5f')]({'name':_0x22d4aa[_0xe8b0('0x3e')],'resourceId':_0x22d4aa['id'],'type':_0x37b00b[_0xe8b0('0x3e')],'sectionId':_0x37b00b['id']},{})[_0xe8b0('0x21')](function(){return _0x1eef4b;});}else{return _0x1eef4b;}})['catch'](function(_0x94468b){logger['error'](_0xe8b0('0x62'),_0x94468b);throw _0x94468b;});}return _0x1eef4b;})['then'](respondWithResult(_0x1261ea,0xc9))[_0xe8b0('0x2a')](handleError(_0x1261ea,null));};exports[_0xe8b0('0x37')]=function(_0x2d3aea,_0x174a51){if(_0x2d3aea[_0xe8b0('0x63')]['id']){delete _0x2d3aea[_0xe8b0('0x63')]['id'];}return db['WhatsappAccount'][_0xe8b0('0x5e')]({'where':{'id':_0x2d3aea['params']['id']},'include':[{'model':db[_0xe8b0('0x40')],'as':_0xe8b0('0x41')}]})[_0xe8b0('0x21')](handleEntityNotFound(_0x174a51,null))[_0xe8b0('0x21')](saveUpdates(_0x2d3aea[_0xe8b0('0x63')],null))[_0xe8b0('0x21')](respondWithResult(_0x174a51,null))[_0xe8b0('0x2a')](handleError(_0x174a51,null));};exports[_0xe8b0('0x38')]=function(_0x4ede05,_0xfe2348){return db[_0xe8b0('0x56')][_0xe8b0('0x5e')]({'where':{'id':_0x4ede05[_0xe8b0('0x5c')]['id']}})[_0xe8b0('0x21')](handleEntityNotFound(_0xfe2348,null))[_0xe8b0('0x21')](removeEntity(_0xfe2348,null))[_0xe8b0('0x2a')](handleError(_0xfe2348,null));};exports[_0xe8b0('0x64')]=function(_0x3d8f60,_0x42e56e){return db['WhatsappAccount'][_0xe8b0('0x64')]()[_0xe8b0('0x21')](respondWithResult(_0x42e56e,null))[_0xe8b0('0x2a')](handleError(_0x42e56e,null));};exports['addDisposition']=function(_0x249944,_0x5e3b5f,_0x31e04a){if(_0x249944[_0xe8b0('0x63')]['id']){delete _0x249944['body']['id'];}return db['WhatsappAccount']['find']({'where':{'id':_0x249944[_0xe8b0('0x5c')]['id']}})[_0xe8b0('0x21')](handleEntityNotFound(_0x5e3b5f,null))[_0xe8b0('0x21')](function(_0x952cb5){if(_0x952cb5){_0x249944['body'][_0xe8b0('0x65')]=_0x952cb5['id'];return db[_0xe8b0('0x66')]['create'](_0x249944[_0xe8b0('0x63')]);}})['then'](respondWithResult(_0x5e3b5f,null))[_0xe8b0('0x2a')](handleError(_0x5e3b5f,null));};exports[_0xe8b0('0x67')]=function(_0xca920f,_0x14f82a,_0x3b07d5){var _0x2b19df={'raw':![],'where':{}};var _0x4dc437={};var _0x1f1da9={'count':0x0,'rows':[]};return db[_0xe8b0('0x56')][_0xe8b0('0x68')]({'where':{'id':_0xca920f[_0xe8b0('0x5c')]['id']}})['then'](handleEntityNotFound(_0x14f82a,null))[_0xe8b0('0x21')](function(_0x125c88){if(_0x125c88){_0x4dc437[_0xe8b0('0x46')]=_[_0xe8b0('0x48')](db['Disposition'][_0xe8b0('0x42')]);_0x4dc437['query']=_['keys'](_0xca920f[_0xe8b0('0x49')]);_0x4dc437[_0xe8b0('0x4a')]=_['intersection'](_0x4dc437[_0xe8b0('0x46')],_0x4dc437['query']);_0x2b19df[_0xe8b0('0x4c')]=_[_0xe8b0('0x4b')](_0x4dc437['model'],qs[_0xe8b0('0x4d')](_0xca920f['query'][_0xe8b0('0x4d')]));_0x2b19df[_0xe8b0('0x4c')]=_0x2b19df[_0xe8b0('0x4c')]['length']?_0x2b19df['attributes']:_0x4dc437[_0xe8b0('0x46')];if(!_0xca920f[_0xe8b0('0x49')][_0xe8b0('0x4f')]('nolimit')){_0x2b19df['limit']=qs['limit'](_0xca920f[_0xe8b0('0x49')]['limit']);_0x2b19df[_0xe8b0('0x31')]=qs[_0xe8b0('0x31')](_0xca920f[_0xe8b0('0x49')][_0xe8b0('0x31')]);}_0x2b19df[_0xe8b0('0x69')]=qs['sort'](_0xca920f[_0xe8b0('0x49')]['sort']);_0x2b19df[_0xe8b0('0x52')]=qs[_0xe8b0('0x4a')](_[_0xe8b0('0x53')](_0xca920f[_0xe8b0('0x49')],_0x4dc437[_0xe8b0('0x4a')]));_0x2b19df[_0xe8b0('0x52')]['WhatsappAccountId']=_0x125c88['id'];if(_0xca920f['query'][_0xe8b0('0x54')]){_0x2b19df[_0xe8b0('0x52')]=_[_0xe8b0('0x55')](_0x2b19df['where'],{'$or':_[_0xe8b0('0x47')](_0x2b19df[_0xe8b0('0x4c')],function(_0x575523){var _0x14af3e={};_0x14af3e[_0x575523]={'$like':'%'+_0xca920f['query'][_0xe8b0('0x54')]+'%'};return _0x14af3e;})});}_0x2b19df=_[_0xe8b0('0x55')]({},_0x2b19df,_0xca920f[_0xe8b0('0x5d')]);return db['Disposition'][_0xe8b0('0x30')]({'where':_0x2b19df['where']})[_0xe8b0('0x21')](function(_0x12558b){_0x1f1da9['count']=_0x12558b;if(_0xca920f['query'][_0xe8b0('0x57')]){_0x2b19df[_0xe8b0('0x58')]=[{'all':!![]}];}return db[_0xe8b0('0x66')][_0xe8b0('0x59')](_0x2b19df);})[_0xe8b0('0x21')](function(_0x4e0891){_0x1f1da9[_0xe8b0('0x5a')]=_0x4e0891;return _0x1f1da9;});}})[_0xe8b0('0x21')](respondWithFilteredResult(_0x14f82a,_0x2b19df))[_0xe8b0('0x2a')](handleError(_0x14f82a,null));};exports[_0xe8b0('0x6a')]=function(_0x402c3a,_0x3f20d4,_0x45831d){return db[_0xe8b0('0x56')][_0xe8b0('0x5e')]({'where':{'id':_0x402c3a[_0xe8b0('0x5c')]['id']}})[_0xe8b0('0x21')](handleEntityNotFound(_0x3f20d4,null))['then'](function(_0x4c54a9){if(_0x4c54a9){return _0x4c54a9[_0xe8b0('0x6a')](_0x402c3a[_0xe8b0('0x49')][_0xe8b0('0x6b')]);}})[_0xe8b0('0x21')](respondWithStatusCode(_0x3f20d4,null))[_0xe8b0('0x2a')](handleError(_0x3f20d4,null));};exports['addAnswer']=function(_0xa6917a,_0x3f72e5,_0x379b82){if(_0xa6917a[_0xe8b0('0x63')]['id']){delete _0xa6917a['body']['id'];}return db[_0xe8b0('0x56')]['find']({'where':{'id':_0xa6917a[_0xe8b0('0x5c')]['id']}})[_0xe8b0('0x21')](handleEntityNotFound(_0x3f72e5,null))[_0xe8b0('0x21')](function(_0x441c2e){if(_0x441c2e){_0xa6917a[_0xe8b0('0x63')][_0xe8b0('0x65')]=_0x441c2e['id'];return db[_0xe8b0('0x6c')][_0xe8b0('0x5f')](_0xa6917a[_0xe8b0('0x63')]);}})[_0xe8b0('0x21')](respondWithResult(_0x3f72e5,null))[_0xe8b0('0x2a')](handleError(_0x3f72e5,null));};exports[_0xe8b0('0x6d')]=function(_0x2f9166,_0x190a18,_0x148295){var _0x3cd99b={'raw':![],'where':{}};var _0x5d8fc6={};var _0x5f0d90={'count':0x0,'rows':[]};return db[_0xe8b0('0x56')][_0xe8b0('0x68')]({'where':{'id':_0x2f9166[_0xe8b0('0x5c')]['id']}})[_0xe8b0('0x21')](handleEntityNotFound(_0x190a18,null))[_0xe8b0('0x21')](function(_0x34dc8b){if(_0x34dc8b){_0x5d8fc6[_0xe8b0('0x46')]=_[_0xe8b0('0x48')](db['CannedAnswer'][_0xe8b0('0x42')]);_0x5d8fc6[_0xe8b0('0x49')]=_[_0xe8b0('0x48')](_0x2f9166[_0xe8b0('0x49')]);_0x5d8fc6[_0xe8b0('0x4a')]=_['intersection'](_0x5d8fc6[_0xe8b0('0x46')],_0x5d8fc6['query']);_0x3cd99b[_0xe8b0('0x4c')]=_[_0xe8b0('0x4b')](_0x5d8fc6[_0xe8b0('0x46')],qs[_0xe8b0('0x4d')](_0x2f9166[_0xe8b0('0x49')][_0xe8b0('0x4d')]));_0x3cd99b['attributes']=_0x3cd99b['attributes'][_0xe8b0('0x4e')]?_0x3cd99b[_0xe8b0('0x4c')]:_0x5d8fc6[_0xe8b0('0x46')];if(!_0x2f9166[_0xe8b0('0x49')][_0xe8b0('0x4f')](_0xe8b0('0x50'))){_0x3cd99b[_0xe8b0('0x2f')]=qs[_0xe8b0('0x2f')](_0x2f9166[_0xe8b0('0x49')][_0xe8b0('0x2f')]);_0x3cd99b[_0xe8b0('0x31')]=qs['offset'](_0x2f9166[_0xe8b0('0x49')][_0xe8b0('0x31')]);}_0x3cd99b['order']=qs[_0xe8b0('0x51')](_0x2f9166[_0xe8b0('0x49')][_0xe8b0('0x51')]);_0x3cd99b[_0xe8b0('0x52')]=qs['filters'](_['pick'](_0x2f9166[_0xe8b0('0x49')],_0x5d8fc6['filters']));_0x3cd99b[_0xe8b0('0x52')][_0xe8b0('0x65')]=_0x34dc8b['id'];if(_0x2f9166[_0xe8b0('0x49')][_0xe8b0('0x54')]){_0x3cd99b['where']=_[_0xe8b0('0x55')](_0x3cd99b[_0xe8b0('0x52')],{'$or':_[_0xe8b0('0x47')](_0x3cd99b['attributes'],function(_0x457c87){var _0x17c234={};_0x17c234[_0x457c87]={'$like':'%'+_0x2f9166[_0xe8b0('0x49')]['filter']+'%'};return _0x17c234;})});}_0x3cd99b=_['merge']({},_0x3cd99b,_0x2f9166[_0xe8b0('0x5d')]);return db[_0xe8b0('0x6c')]['count']({'where':_0x3cd99b[_0xe8b0('0x52')]})[_0xe8b0('0x21')](function(_0x5a1320){_0x5f0d90[_0xe8b0('0x30')]=_0x5a1320;if(_0x2f9166[_0xe8b0('0x49')]['includeAll']){_0x3cd99b['include']=[{'all':!![]}];}return db[_0xe8b0('0x6c')][_0xe8b0('0x59')](_0x3cd99b);})[_0xe8b0('0x21')](function(_0x400da4){_0x5f0d90['rows']=_0x400da4;return _0x5f0d90;});}})['then'](respondWithFilteredResult(_0x190a18,_0x3cd99b))[_0xe8b0('0x2a')](handleError(_0x190a18,null));};exports[_0xe8b0('0x6e')]=function(_0x2f042b,_0x125ddd,_0x405e27){return db['WhatsappAccount'][_0xe8b0('0x5e')]({'where':{'id':_0x2f042b[_0xe8b0('0x5c')]['id']}})[_0xe8b0('0x21')](handleEntityNotFound(_0x125ddd,null))[_0xe8b0('0x21')](function(_0x5a5026){if(_0x5a5026){return _0x5a5026[_0xe8b0('0x6e')](_0x2f042b[_0xe8b0('0x49')][_0xe8b0('0x6b')]);}})[_0xe8b0('0x21')](respondWithStatusCode(_0x125ddd,null))[_0xe8b0('0x2a')](handleError(_0x125ddd,null));};exports[_0xe8b0('0x6f')]=function(_0x237fa8,_0x156897,_0x15df8e){return db[_0xe8b0('0x56')][_0xe8b0('0x5e')]({'where':{'id':_0x237fa8[_0xe8b0('0x5c')]['id']}})[_0xe8b0('0x21')](handleEntityNotFound(_0x156897,null))['then'](function(_0x5a1d1e){if(_0x5a1d1e){return _0x5a1d1e[_0xe8b0('0x6f')](_0x237fa8['body'][_0xe8b0('0x6b')],_[_0xe8b0('0x70')](_0x237fa8['body'],[_0xe8b0('0x6b'),'id'])||{})['spread'](function(_0x4c8a07){for(var _0xd1b1f7=0x0;_0xd1b1f7<_0x237fa8[_0xe8b0('0x63')][_0xe8b0('0x6b')][_0xe8b0('0x4e')];_0xd1b1f7+=0x1){socket[_0xe8b0('0x71')]('userWhatsappAccount:save',{'UserId':Number(_0x237fa8[_0xe8b0('0x63')][_0xe8b0('0x6b')][_0xd1b1f7]),'WhatsappAccountId':Number(_0x237fa8[_0xe8b0('0x5c')]['id'])});}return _0x4c8a07;});}})[_0xe8b0('0x21')](respondWithResult(_0x156897,null))[_0xe8b0('0x2a')](handleError(_0x156897,null));};exports[_0xe8b0('0x72')]=function(_0x28b0c8,_0x10cdc0,_0x5c08ae){return db[_0xe8b0('0x56')]['find']({'where':{'id':_0x28b0c8[_0xe8b0('0x5c')]['id']}})['then'](handleEntityNotFound(_0x10cdc0,null))['then'](function(_0x30b047){if(_0x30b047){return _0x30b047['removeAgents'](_0x28b0c8[_0xe8b0('0x49')][_0xe8b0('0x6b')])[_0xe8b0('0x21')](function(){if(_['isArray'](_0x28b0c8['query'][_0xe8b0('0x6b')])){for(var _0x12da60=0x0;_0x12da60<_0x28b0c8[_0xe8b0('0x49')][_0xe8b0('0x6b')][_0xe8b0('0x4e')];_0x12da60+=0x1){socket['emit'](_0xe8b0('0x73'),{'UserId':Number(_0x28b0c8[_0xe8b0('0x49')][_0xe8b0('0x6b')][_0x12da60]),'WhatsappAccountId':Number(_0x28b0c8[_0xe8b0('0x5c')]['id'])});}}else{socket[_0xe8b0('0x71')](_0xe8b0('0x73'),{'UserId':Number(_0x28b0c8[_0xe8b0('0x49')][_0xe8b0('0x6b')]),'WhatsappAccountId':Number(_0x28b0c8[_0xe8b0('0x5c')]['id'])});}});}})['then'](respondWithStatusCode(_0x10cdc0,null))[_0xe8b0('0x2a')](handleError(_0x10cdc0,null));};exports[_0xe8b0('0x74')]=function(_0xdeb2ea,_0x2c29a1,_0x14a455){var _0x11a94e={};var _0x224b9d={};var _0x5b8682;var _0x47c23d;return db[_0xe8b0('0x56')]['findOne']({'where':{'id':_0xdeb2ea['params']['id']}})[_0xe8b0('0x21')](handleEntityNotFound(_0x2c29a1,null))[_0xe8b0('0x21')](function(_0x25d50c){if(_0x25d50c){_0x5b8682=_0x25d50c;_0x224b9d['model']=_[_0xe8b0('0x48')](db[_0xe8b0('0x75')]['rawAttributes']);_0x224b9d[_0xe8b0('0x49')]=_[_0xe8b0('0x48')](_0xdeb2ea[_0xe8b0('0x49')]);_0x224b9d['filters']=_[_0xe8b0('0x4b')](_0x224b9d['model'],_0x224b9d[_0xe8b0('0x49')]);_0x11a94e[_0xe8b0('0x4c')]=_[_0xe8b0('0x4b')](_0x224b9d[_0xe8b0('0x46')],qs['fields'](_0xdeb2ea[_0xe8b0('0x49')][_0xe8b0('0x4d')]));_0x11a94e[_0xe8b0('0x4c')]=_0x11a94e[_0xe8b0('0x4c')][_0xe8b0('0x4e')]?_0x11a94e[_0xe8b0('0x4c')]:_0x224b9d[_0xe8b0('0x46')];_0x11a94e[_0xe8b0('0x69')]=qs[_0xe8b0('0x51')](_0xdeb2ea[_0xe8b0('0x49')]['sort']);_0x11a94e[_0xe8b0('0x52')]=qs[_0xe8b0('0x4a')](_[_0xe8b0('0x53')](_0xdeb2ea[_0xe8b0('0x49')],_0x224b9d[_0xe8b0('0x4a')]));if(_0xdeb2ea[_0xe8b0('0x49')]['filter']){_0x11a94e['where']=_[_0xe8b0('0x55')](_0x11a94e['where'],{'$or':_[_0xe8b0('0x47')](_0x11a94e[_0xe8b0('0x4c')],function(_0x45144e){var _0x109131={};_0x109131[_0x45144e]={'$like':'%'+_0xdeb2ea[_0xe8b0('0x49')][_0xe8b0('0x54')]+'%'};return _0x109131;})});}_0x11a94e=_['merge']({},_0x11a94e,_0xdeb2ea['options']);return _0x5b8682[_0xe8b0('0x74')](_0x11a94e);}})['then'](function(_0xe6e631){if(_0xe6e631){_0x47c23d=_0xe6e631['length'];if(!_0xdeb2ea['query'][_0xe8b0('0x4f')]('nolimit')){_0x11a94e['limit']=qs['limit'](_0xdeb2ea[_0xe8b0('0x49')][_0xe8b0('0x2f')]);_0x11a94e[_0xe8b0('0x31')]=qs['offset'](_0xdeb2ea['query'][_0xe8b0('0x31')]);}return _0x5b8682['getAgents'](_0x11a94e);}})[_0xe8b0('0x21')](function(_0x55ffd6){if(_0x55ffd6){return _0x55ffd6?{'count':_0x47c23d,'rows':_0x55ffd6}:null;}})['then'](respondWithResult(_0x2c29a1,null))['catch'](handleError(_0x2c29a1,null));};exports[_0xe8b0('0x76')]=function(_0xd0f8d2,_0x2a80c1,_0x524d20){return db[_0xe8b0('0x56')][_0xe8b0('0x68')]({'where':{'id':_0xd0f8d2['params']['id']}})[_0xe8b0('0x21')](handleEntityNotFound(_0x2a80c1,null))[_0xe8b0('0x21')](function(_0x3808fa){if(_0x3808fa){return db[_0xe8b0('0x77')][_0xe8b0('0x78')](function(_0x146f07){return db[_0xe8b0('0x79')][_0xe8b0('0x38')]({'where':{'WhatsappAccountId':_0xd0f8d2[_0xe8b0('0x5c')]['id']},'transaction':_0x146f07})['then'](function(_0x16ef38){var _0x48a9ff=_[_0xe8b0('0x47')](_0xd0f8d2[_0xe8b0('0x63')],function(_0x474791){_0x474791[_0xe8b0('0x65')]=_0xd0f8d2[_0xe8b0('0x5c')]['id'];return _0x474791;});return db[_0xe8b0('0x79')]['bulkCreate'](_0x48a9ff,{'transaction':_0x146f07});});})[_0xe8b0('0x21')](function(){return db[_0xe8b0('0x79')][_0xe8b0('0x7a')]({'where':{'WhatsappAccountId':_0xd0f8d2[_0xe8b0('0x5c')]['id']},'order':_0xe8b0('0x7b')});});}})['then'](respondWithResult(_0x2a80c1,null))[_0xe8b0('0x2a')](handleError(_0x2a80c1,null));};exports[_0xe8b0('0x7c')]=function(_0x4d1047,_0x557994,_0x652a72){var _0x1b55ca={};var _0x2d71f3={};var _0x44dd67;var _0x568c4a;return db[_0xe8b0('0x56')][_0xe8b0('0x68')]({'where':{'id':_0x4d1047['params']['id']}})['then'](handleEntityNotFound(_0x557994,null))[_0xe8b0('0x21')](function(_0x406965){if(_0x406965){_0x44dd67=_0x406965;_0x2d71f3[_0xe8b0('0x46')]=_['keys'](db[_0xe8b0('0x79')][_0xe8b0('0x42')]);_0x2d71f3[_0xe8b0('0x49')]=_[_0xe8b0('0x48')](_0x4d1047[_0xe8b0('0x49')]);_0x2d71f3[_0xe8b0('0x4a')]=_['intersection'](_0x2d71f3[_0xe8b0('0x46')],_0x2d71f3[_0xe8b0('0x49')]);_0x1b55ca[_0xe8b0('0x4c')]=_['intersection'](_0x2d71f3['model'],qs[_0xe8b0('0x4d')](_0x4d1047[_0xe8b0('0x49')][_0xe8b0('0x4d')]));_0x1b55ca[_0xe8b0('0x4c')]=_0x1b55ca['attributes']['length']?_0x1b55ca[_0xe8b0('0x4c')]:_0x2d71f3[_0xe8b0('0x46')];_0x1b55ca[_0xe8b0('0x69')]=qs[_0xe8b0('0x51')](_0x4d1047[_0xe8b0('0x49')][_0xe8b0('0x51')]);_0x1b55ca[_0xe8b0('0x52')]=qs[_0xe8b0('0x4a')](_['pick'](_0x4d1047[_0xe8b0('0x49')],_0x2d71f3[_0xe8b0('0x4a')]));if(_0x4d1047[_0xe8b0('0x49')][_0xe8b0('0x54')]){_0x1b55ca['where']=_[_0xe8b0('0x55')](_0x1b55ca['where'],{'$or':_['map'](_0x1b55ca[_0xe8b0('0x4c')],function(_0x1495f6){var _0x5daa74={};_0x5daa74[_0x1495f6]={'$like':'%'+_0x4d1047[_0xe8b0('0x49')][_0xe8b0('0x54')]+'%'};return _0x5daa74;})});}_0x1b55ca=_['merge']({},_0x1b55ca,_0x4d1047[_0xe8b0('0x5d')]);return _0x44dd67[_0xe8b0('0x7c')](_0x1b55ca);}})[_0xe8b0('0x21')](function(_0x3597c6){if(_0x3597c6){_0x568c4a=_0x3597c6[_0xe8b0('0x4e')];if(!_0x4d1047[_0xe8b0('0x49')][_0xe8b0('0x4f')](_0xe8b0('0x50'))){_0x1b55ca[_0xe8b0('0x2f')]=qs[_0xe8b0('0x2f')](_0x4d1047[_0xe8b0('0x49')][_0xe8b0('0x2f')]);_0x1b55ca['offset']=qs[_0xe8b0('0x31')](_0x4d1047[_0xe8b0('0x49')][_0xe8b0('0x31')]);}return _0x44dd67[_0xe8b0('0x7c')](_0x1b55ca);}})['then'](function(_0x47c41e){if(_0x47c41e){return _0x47c41e?{'count':_0x568c4a,'rows':_0x47c41e}:null;}})['then'](respondWithResult(_0x557994,null))['catch'](handleError(_0x557994,null));};exports['notify']=function(_0x326e63,_0x260b77,_0x395c68){var _0x3d8364={'channel':'whatsapp'};var _0x4ca60e=[];var _0x42175f=[];var _0x18c5b4={};return db[_0xe8b0('0x56')][_0xe8b0('0x5e')]({'where':{'id':_0x326e63[_0xe8b0('0x5c')]['id']},'include':[{'model':db[_0xe8b0('0x79')],'as':_0xe8b0('0x7d')}]})[_0xe8b0('0x21')](handleEntityNotFound(_0x260b77,null))[_0xe8b0('0x21')](function(_0x31fc7a){_0x3d8364[_0xe8b0('0x7e')]=_0x31fc7a;_0x3d8364[_0xe8b0('0x7f')]=_[_0xe8b0('0x80')](_0x31fc7a[_0xe8b0('0x7d')],[_0xe8b0('0x7b')],[_0xe8b0('0x81')]);if(_0x3d8364[_0xe8b0('0x7e')][_0xe8b0('0x7d')]){delete _0x3d8364[_0xe8b0('0x7e')][_0xe8b0('0x7d')];}return db[_0xe8b0('0x82')][_0xe8b0('0x64')]();})[_0xe8b0('0x21')](function(_0x24841f){if(!_0x24841f){throw new db[(_0xe8b0('0x83'))][(_0xe8b0('0x84'))](_0xe8b0('0x85'));}_0x4ca60e=_['difference'](_[_0xe8b0('0x48')](_0x24841f),[_0xe8b0('0x86'),_0xe8b0('0x87')]);_0x42175f=_[_0xe8b0('0x88')](_[_0xe8b0('0x48')](_0x24841f),[_0xe8b0('0x86'),'updatedAt','CompanyId','ListId']);_0x3d8364['body']={'mapKey':_0xe8b0('0x89')};if(_0x3d8364[_0xe8b0('0x7e')]['type']&&_0x3d8364[_0xe8b0('0x7e')][_0xe8b0('0x44')]==='twilio'){_0x3d8364[_0xe8b0('0x63')][_0xe8b0('0x8a')]=_0x326e63[_0xe8b0('0x63')][_0xe8b0('0x8b')][_0xe8b0('0x8c')](_0xe8b0('0x8d'),'');_0x3d8364[_0xe8b0('0x63')][_0xe8b0('0x63')]=_0x326e63[_0xe8b0('0x63')][_0xe8b0('0x8e')];_0x3d8364[_0xe8b0('0x63')][_0xe8b0('0x8f')]=_0x326e63[_0xe8b0('0x63')][_0xe8b0('0x90')];}if(_0x3d8364[_0xe8b0('0x63')]['id']){delete _0x3d8364[_0xe8b0('0x63')]['id'];}if(_[_0xe8b0('0x91')](_0x3d8364[_0xe8b0('0x63')][_0xe8b0('0x8a')])){throw new db['Sequelize'][(_0xe8b0('0x84'))](_0xe8b0('0x92'));}if(_[_0xe8b0('0x91')](_0x3d8364[_0xe8b0('0x63')][_0xe8b0('0x63')])||_0x3d8364[_0xe8b0('0x63')][_0xe8b0('0x63')]===''){throw new db[(_0xe8b0('0x83'))][(_0xe8b0('0x84'))](_0xe8b0('0x93'));}if(_['isNil'](_0x3d8364[_0xe8b0('0x63')][_0xe8b0('0x94')])){throw new db[(_0xe8b0('0x83'))]['ValidationError'](_0xe8b0('0x95')+_0x42175f);}if(!_[_0xe8b0('0x96')](_0x42175f,_0x3d8364[_0xe8b0('0x63')][_0xe8b0('0x94')])){throw new db['Sequelize']['ValidationError'](_0xe8b0('0x97')+_0x42175f);}_0x18c5b4[_0x3d8364[_0xe8b0('0x63')]['mapKey']]=_0x3d8364[_0xe8b0('0x63')][_0xe8b0('0x8a')];return db[_0xe8b0('0x98')][_0xe8b0('0x5e')]({'where':{'id':_0x3d8364['account'][_0xe8b0('0x99')]},'include':[{'model':db[_0xe8b0('0x82')],'as':_0xe8b0('0x9a'),'where':_0x18c5b4,'limit':0x1,'order':[[_0xe8b0('0x87'),'DESC']]}]});})['then'](handleEntityNotFound(_0x260b77,null))[_0xe8b0('0x21')](function(_0x287ed6){if(_0x287ed6){_0x3d8364[_0xe8b0('0x9b')]=_[_0xe8b0('0x70')](_0x287ed6,['Contacts']);if(_0x287ed6[_0xe8b0('0x9a')][_0xe8b0('0x4e')]){return _0x287ed6['Contacts'][0x0];}var _0x2ab059=_[_0xe8b0('0x18')](_0x3d8364[_0xe8b0('0x63')],{'firstName':_0x3d8364[_0xe8b0('0x63')][_0xe8b0('0x8a')],'ListId':_0x287ed6['id']});_0x2ab059[_0x3d8364[_0xe8b0('0x63')][_0xe8b0('0x94')]]=_0x3d8364[_0xe8b0('0x63')]['from'];return db[_0xe8b0('0x82')][_0xe8b0('0x5f')](_0x2ab059,{'fields':_0x4ca60e,'raw':!![]});}})[_0xe8b0('0x21')](handleEntityNotFound(_0x260b77,null))[_0xe8b0('0x21')](function(_0x4df0a1){if(_0x4df0a1){_0x3d8364['contact']=_0x4df0a1;var _0x4de502={'ContactId':_0x4df0a1['id'],'phone':_0x3d8364['body'][_0xe8b0('0x8a')],'WhatsappAccountId':_0x326e63['params']['id']};var _0xa1c163={'ContactId':_0x4df0a1['id'],'WhatsappAccountId':_0x326e63['params']['id'],'closed':![]};return db['WhatsappInteraction']['find']({'where':_0xa1c163})['then'](function(_0x38ffaf){if(_0x38ffaf){return[_0x38ffaf,![]];}return db[_0xe8b0('0x9c')][_0xe8b0('0x5f')](_0x4de502)[_0xe8b0('0x21')](function(_0x47cc29){return[_0x47cc29,!![]];});});}})[_0xe8b0('0x9d')](function(_0x1c98c9,_0x20839c){_0x3d8364[_0xe8b0('0x9e')]=_0x1c98c9['get']({'plain':!![]});_0x3d8364[_0xe8b0('0x9e')]['created']=![];if(_0x20839c){if(_0x3d8364[_0xe8b0('0x7e')][_0xe8b0('0x9f')]){_0x3d8364['applications'][_0xe8b0('0xa0')]({'id':0x0,'priority':_0x3d8364['applications'][_0xe8b0('0x4e')]+0x1,'app':'close','appdata':_0xe8b0('0xa1'),'interval':_0xe8b0('0xa2')});}_0x3d8364[_0xe8b0('0x9e')][_0xe8b0('0xa3')]=!![];}return db[_0xe8b0('0xa4')][_0xe8b0('0x5f')]({'phone':_0x3d8364[_0xe8b0('0x63')][_0xe8b0('0x8a')],'messageId':_0x3d8364['body'][_0xe8b0('0x8f')],'body':_0x3d8364['body'][_0xe8b0('0x63')],'WhatsappAccountId':_0x326e63[_0xe8b0('0x5c')]['id'],'WhatsappInteractionId':_0x1c98c9['id'],'direction':'in','ContactId':_0x1c98c9[_0xe8b0('0xa5')],'AttachmentId':_0x3d8364[_0xe8b0('0x63')][_0xe8b0('0xa6')]});})[_0xe8b0('0x21')](function(_0x111b64){_0x3d8364[_0xe8b0('0x28')]=_0x111b64;if(_0x3d8364['interaction'][_0xe8b0('0xa7')]){return db[_0xe8b0('0x75')]['find']({'attributes':['id',_0xe8b0('0x3e')],'where':{'id':_0x3d8364[_0xe8b0('0x9e')][_0xe8b0('0xa7')]}})[_0xe8b0('0x21')](function(_0x10ee66){if(_0x10ee66){_0x3d8364[_0xe8b0('0x7f')][_0xe8b0('0xa8')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x10ee66[_0xe8b0('0x3e')]+','+(_0x3d8364['account']['waitForTheAssignedAgent']||0xa),'interval':_0xe8b0('0xa2')});}return respondWithRpcPromise('Start','startRouting',_0x3d8364);});}return respondWithRpcPromise(_0xe8b0('0xa9'),_0xe8b0('0xaa'),_0x3d8364);})[_0xe8b0('0x21')](function(_0x57a2ce){if(_0x57a2ce){var _0x48db2a=0xc8;var _0x335d7a='receiveMessage';logger['info'](_0xe8b0('0xab'),_0x335d7a,_0x48db2a,_0xe8b0('0xac'));logger[_0xe8b0('0x24')](_0xe8b0('0xad'),_0x335d7a,_0x48db2a,_0xe8b0('0xac'),JSON[_0xe8b0('0x26')](_0x57a2ce));if(_0x3d8364['account'][_0xe8b0('0x44')]===_0xe8b0('0xae')){return _0x260b77[_0xe8b0('0x2c')](_0x48db2a)[_0xe8b0('0x32')](_0xe8b0('0xaf'),'text/xml')[_0xe8b0('0x3f')](_0xe8b0('0xb0'));}else{return _0x260b77[_0xe8b0('0x2c')](_0x48db2a)[_0xe8b0('0x2d')](_0x57a2ce);}}})[_0xe8b0('0x2a')](handleError(_0x260b77,null));};exports[_0xe8b0('0x3f')]=function(_0x3e60b8,_0x3f3a43,_0x12552b){var _0x27d82d,_0x12d8d3,_0xc04d21;if(_[_0xe8b0('0x91')](_0x3e60b8[_0xe8b0('0x63')][_0xe8b0('0x63')])||_0x3e60b8[_0xe8b0('0x63')][_0xe8b0('0x63')]===''){throw new db[(_0xe8b0('0x83'))][(_0xe8b0('0x84'))](_0xe8b0('0x93'));}if(_[_0xe8b0('0x91')](_0x3e60b8[_0xe8b0('0x63')]['to'])){throw new db[(_0xe8b0('0x83'))][(_0xe8b0('0x84'))]('to\x20is\x20mandatory');}_0x27d82d=_0x3e60b8[_0xe8b0('0x63')]['to'];return db[_0xe8b0('0x56')][_0xe8b0('0x5e')]({'where':{'id':_0x3e60b8[_0xe8b0('0x5c')]['id']},'include':[{'model':db['CmList'],'as':_0xe8b0('0xb1'),'include':[{'model':db[_0xe8b0('0x82')],'as':'Contacts','where':{'mobile':_0x27d82d},'limit':0x1,'order':[[_0xe8b0('0x87'),_0xe8b0('0xb2')]]}]}]})[_0xe8b0('0x21')](handleEntityNotFound(_0x3f3a43,null))[_0xe8b0('0x21')](function(_0x28dc26){if(_0x28dc26&&_0x28dc26[_0xe8b0('0xb1')]){_0x12d8d3=_0x28dc26[_0xe8b0('0x39')]({'plain':!![]});if(_0x12d8d3[_0xe8b0('0xb1')]&&_0x12d8d3[_0xe8b0('0xb1')][_0xe8b0('0x9a')][_0xe8b0('0x4e')]){return _0x12d8d3[_0xe8b0('0xb1')][_0xe8b0('0x9a')][0x0];}return db[_0xe8b0('0x82')]['create'](_['defaults'](_0x3e60b8['body'],{'firstName':_0x27d82d,'mobile':_0x27d82d,'phone':_0x27d82d,'ListId':_0x12d8d3[_0xe8b0('0x99')]}));}})['then'](handleEntityNotFound(_0x3f3a43,null))[_0xe8b0('0x21')](function(_0x1d8db3){if(_0x1d8db3){_0xc04d21=_0x1d8db3;return db[_0xe8b0('0x9c')][_0xe8b0('0x5e')]({'where':{'ContactId':_0xc04d21['id'],'closed':![],'WhatsappAccountId':_0x12d8d3['id']}})[_0xe8b0('0x21')](function(_0xed9f53){if(_0xed9f53){return[_0xed9f53,![]];}return db['WhatsappInteraction']['create']({'UserId':_0x3e60b8['user']['id'],'ContactId':_0xc04d21['id'],'WhatsappAccountId':_0x12d8d3['id'],'phone':_0x27d82d,'firstMsgDirection':'out','Messages':[_[_0xe8b0('0x55')](_0x3e60b8[_0xe8b0('0x63')],{'read':![],'body':_0x3e60b8[_0xe8b0('0x63')]['body'],'phone':_0x27d82d,'WhatsappAccountId':_0x12d8d3['id'],'UserId':_0x3e60b8[_0xe8b0('0x60')]['id'],'ContactId':_0xc04d21['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':_0xe8b0('0xb3')}]})[_0xe8b0('0x21')](function(_0x124d27){return[_0x124d27,!![]];});});}})[_0xe8b0('0x9d')](function(_0x9b2307,_0xd28820){if(_0xd28820){return _0x9b2307;}return db[_0xe8b0('0xa4')][_0xe8b0('0x5f')](_['merge'](_0x3e60b8['body'],{'read':![],'body':_0x3e60b8['body']['body'],'phone':_0x27d82d,'WhatsappAccountId':_0x12d8d3['id'],'WhatsappInteractionId':_0x9b2307['id'],'UserId':_0x3e60b8[_0xe8b0('0x60')]['id'],'ContactId':_0xc04d21['id']}))[_0xe8b0('0x21')](function(_0x2c3f70){_0x9b2307[_0xe8b0('0xb4')][_0xe8b0('0xb3')]=[];_0x9b2307['dataValues'][_0xe8b0('0xb3')][_0xe8b0('0xa0')](_0x2c3f70['dataValues']);return _0x9b2307;});})[_0xe8b0('0x21')](respondWithResult(_0x3f3a43,null))[_0xe8b0('0x2a')](handleError(_0x3f3a43,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 4e779ad..ccb4f6f 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 _0xd58b=['../../mysqldb','WhatsappAccount','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x503790,_0x525c78){var _0x388092=function(_0x2ab2b8){while(--_0x2ab2b8){_0x503790['push'](_0x503790['shift']());}};_0x388092(++_0x525c78);}(_0xd58b,0x183));var _0xbd58=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xd58b[_0x4a9fb1];return _0x348672;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require(_0xbd58('0x0'))['db'][_0xbd58('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xbd58('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xbd58('0x3'),'afterDestroy':_0xbd58('0x4')};function emitEvent(_0x4b19c1){return function(_0xcbe7aa,_0x1eb28b,_0x25a067){WhatsappAccountEvents[_0xbd58('0x5')](_0x4b19c1+':'+_0xcbe7aa['id'],_0xcbe7aa);WhatsappAccountEvents[_0xbd58('0x5')](_0x4b19c1,_0xcbe7aa);_0x25a067(null);};}for(var e in events){if(events[_0xbd58('0x6')](e)){var event=events[e];WhatsappAccount[_0xbd58('0x7')](e,emitEvent(event));}}module[_0xbd58('0x8')]=WhatsappAccountEvents; \ No newline at end of file +var _0x7f76=['hasOwnProperty','hook','events','../../mysqldb','save','update','emit'];(function(_0x575783,_0x4f66f6){var _0x1aeae0=function(_0x3e05cb){while(--_0x3e05cb){_0x575783['push'](_0x575783['shift']());}};_0x1aeae0(++_0x4f66f6);}(_0x7f76,0x72));var _0x67f7=function(_0x256f94,_0x17b546){_0x256f94=_0x256f94-0x0;var _0x3ecc67=_0x7f76[_0x256f94];return _0x3ecc67;};'use strict';var EventEmitter=require(_0x67f7('0x0'));var WhatsappAccount=require(_0x67f7('0x1'))['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x67f7('0x2'),'afterUpdate':_0x67f7('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3b775f){return function(_0x2ee9de,_0x2423df,_0x210a56){WhatsappAccountEvents[_0x67f7('0x4')](_0x3b775f+':'+_0x2ee9de['id'],_0x2ee9de);WhatsappAccountEvents['emit'](_0x3b775f,_0x2ee9de);_0x210a56(null);};}for(var e in events){if(events[_0x67f7('0x5')](e)){var event=events[e];WhatsappAccount[_0x67f7('0x6')](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index ddec996..272387d 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 _0x0f62=['moment','bluebird','request-promise','rimraf','./whatsappAccount.attributes','exports','define','whatsapp_accounts','util','../../config/logger','api'];(function(_0x2ac701,_0x561e2a){var _0x2bcda8=function(_0x2d4764){while(--_0x2d4764){_0x2ac701['push'](_0x2ac701['shift']());}};_0x2bcda8(++_0x561e2a);}(_0x0f62,0x81));var _0x20f6=function(_0x4f34d1,_0x15d0b8){_0x4f34d1=_0x4f34d1-0x0;var _0x3106a4=_0x0f62[_0x4f34d1];return _0x3106a4;};'use strict';var _=require('lodash');var util=require(_0x20f6('0x0'));var logger=require(_0x20f6('0x1'))(_0x20f6('0x2'));var moment=require(_0x20f6('0x3'));var BPromise=require(_0x20f6('0x4'));var rp=require(_0x20f6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x20f6('0x6'));var config=require('../../config/environment');var attributes=require(_0x20f6('0x7'));module[_0x20f6('0x8')]=function(_0x19aa73,_0x235485){return _0x19aa73[_0x20f6('0x9')]('WhatsappAccount',attributes,{'tableName':_0x20f6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x97fa=['bluebird','request-promise','path','rimraf','exports','WhatsappAccount','whatsapp_accounts','lodash','../../config/logger','api','moment'];(function(_0x1192a9,_0x2d53fd){var _0x5b1491=function(_0x26808e){while(--_0x26808e){_0x1192a9['push'](_0x1192a9['shift']());}};_0x5b1491(++_0x2d53fd);}(_0x97fa,0xcd));var _0xa97f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x97fa[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa97f('0x0'));var util=require('util');var logger=require(_0xa97f('0x1'))(_0xa97f('0x2'));var moment=require(_0xa97f('0x3'));var BPromise=require(_0xa97f('0x4'));var rp=require(_0xa97f('0x5'));var fs=require('fs');var path=require(_0xa97f('0x6'));var rimraf=require(_0xa97f('0x7'));var config=require('../../config/environment');var attributes=require('./whatsappAccount.attributes');module[_0xa97f('0x8')]=function(_0x57b4f2,_0x354389){return _0x57b4f2['define'](_0xa97f('0x9'),attributes,{'tableName':_0xa97f('0xa'),'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 1bad9af..18ac9f6 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 _0x0ed8=['map','stringify','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','register','request','then','info','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','WhatsappAccount,\x20%s,\x20%s','result','catch','ShowWhatsappAccount','WhatsappAccount','options','where','include','model','attributes'];(function(_0x4a2186,_0xcfd40f){var _0x1b8999=function(_0x89f53a){while(--_0x89f53a){_0x4a2186['push'](_0x4a2186['shift']());}};_0x1b8999(++_0xcfd40f);}(_0x0ed8,0x11a));var _0x80ed=function(_0x15e048,_0x585cec){_0x15e048=_0x15e048-0x0;var _0x30b8be=_0x0ed8[_0x15e048];return _0x30b8be;};'use strict';var _=require('lodash');var util=require(_0x80ed('0x0'));var moment=require(_0x80ed('0x1'));var BPromise=require(_0x80ed('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x80ed('0x3'));var db=require(_0x80ed('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x80ed('0x5'))(_0x80ed('0x6'));var config=require(_0x80ed('0x7'));var jayson=require(_0x80ed('0x8'));var client=jayson[_0x80ed('0x9')][_0x80ed('0xa')]({'port':0x232a});config[_0x80ed('0xb')]=_[_0x80ed('0xc')](config[_0x80ed('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./whatsappAccount.socket')[_0x80ed('0xd')](socket);function respondWithRpcPromise(_0x219abb,_0x5cee66,_0x5b29cc){return new BPromise(function(_0x422031,_0x52b7f2){return client[_0x80ed('0xe')](_0x219abb,_0x5b29cc)[_0x80ed('0xf')](function(_0x2ec2ac){logger[_0x80ed('0x10')]('WhatsappAccount,\x20%s,\x20%s',_0x5cee66,'request\x20sent');logger[_0x80ed('0x11')](_0x80ed('0x12'),_0x5cee66,_0x80ed('0x13'),JSON['stringify'](_0x2ec2ac));if(_0x2ec2ac[_0x80ed('0x14')]){if(_0x2ec2ac[_0x80ed('0x14')][_0x80ed('0x15')]===0x1f4){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x5cee66,_0x2ec2ac[_0x80ed('0x14')]['message']);return _0x52b7f2(_0x2ec2ac['error'][_0x80ed('0x16')]);}logger[_0x80ed('0x14')]('WhatsappAccount,\x20%s,\x20%s',_0x5cee66,_0x2ec2ac['error']['message']);return _0x422031(_0x2ec2ac['error'][_0x80ed('0x16')]);}else{logger[_0x80ed('0x10')](_0x80ed('0x17'),_0x5cee66,'request\x20sent');_0x422031(_0x2ec2ac[_0x80ed('0x18')]['message']);}})[_0x80ed('0x19')](function(_0x386f5c){logger[_0x80ed('0x14')](_0x80ed('0x17'),_0x5cee66,_0x386f5c);_0x52b7f2(_0x386f5c);});});}exports[_0x80ed('0x1a')]=function(_0x39ce64){var _0x379db2=this;return new Promise(function(_0x4b676c,_0x4a678e){return db[_0x80ed('0x1b')]['find']({'raw':_0x39ce64[_0x80ed('0x1c')]?_0x39ce64[_0x80ed('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x39ce64[_0x80ed('0x1c')]?_0x39ce64['options'][_0x80ed('0x1d')]||null:null,'attributes':_0x39ce64[_0x80ed('0x1c')]?_0x39ce64[_0x80ed('0x1c')]['attributes']||null:null,'include':_0x39ce64[_0x80ed('0x1c')]?_0x39ce64[_0x80ed('0x1c')]['include']?_['map'](_0x39ce64[_0x80ed('0x1c')][_0x80ed('0x1e')],function(_0x4c6c0d){return{'model':db[_0x4c6c0d[_0x80ed('0x1f')]],'as':_0x4c6c0d['as'],'attributes':_0x4c6c0d[_0x80ed('0x20')],'include':_0x4c6c0d['include']?_[_0x80ed('0x21')](_0x4c6c0d[_0x80ed('0x1e')],function(_0x80655f){return{'model':db[_0x80655f['model']],'as':_0x80655f['as'],'attributes':_0x80655f[_0x80ed('0x20')],'include':_0x80655f[_0x80ed('0x1e')]?_['map'](_0x80655f['include'],function(_0x44217e){return{'model':db[_0x44217e[_0x80ed('0x1f')]],'as':_0x44217e['as'],'attributes':_0x44217e[_0x80ed('0x20')]};}):[]};}):[]};}):[]:[]})[_0x80ed('0xf')](function(_0xa89957){logger[_0x80ed('0x10')](_0x80ed('0x1a'),_0x39ce64);logger[_0x80ed('0x11')](_0x80ed('0x1a'),_0x39ce64,JSON[_0x80ed('0x22')](_0xa89957));_0x4b676c(_0xa89957);})[_0x80ed('0x19')](function(_0x5851bb){logger[_0x80ed('0x14')](_0x80ed('0x1a'),_0x5851bb[_0x80ed('0x16')],_0x39ce64);_0x4a678e(_0x379db2[_0x80ed('0x14')](0x1f4,_0x5851bb['message']));});});}; \ No newline at end of file +var _0x7174=['ShowWhatsappAccount','find','options','where','include','model','attributes','map','then','info','stringify','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','redis','defaults','socket.io-emitter','./whatsappAccount.socket','register','request','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','message','result'];(function(_0x46018d,_0x22c693){var _0x9fa6b4=function(_0x4f0478){while(--_0x4f0478){_0x46018d['push'](_0x46018d['shift']());}};_0x9fa6b4(++_0x22c693);}(_0x7174,0x182));var _0x4717=function(_0x22f9df,_0x111d4b){_0x22f9df=_0x22f9df-0x0;var _0x3e05cb=_0x7174[_0x22f9df];return _0x3e05cb;};'use strict';var _=require(_0x4717('0x0'));var util=require(_0x4717('0x1'));var moment=require('moment');var BPromise=require(_0x4717('0x2'));var rs=require(_0x4717('0x3'));var fs=require('fs');var Redis=require(_0x4717('0x4'));var db=require(_0x4717('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4717('0x6'))('rpc');var config=require(_0x4717('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4717('0x8')]['http']({'port':0x232a});config[_0x4717('0x9')]=_[_0x4717('0xa')](config[_0x4717('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x4717('0xb'))(new Redis(config[_0x4717('0x9')]));require(_0x4717('0xc'))[_0x4717('0xd')](socket);function respondWithRpcPromise(_0x283ef7,_0xdce1eb,_0x13a4d0){return new BPromise(function(_0x106c92,_0x58dbfe){return client[_0x4717('0xe')](_0x283ef7,_0x13a4d0)['then'](function(_0x41e5e7){logger['info'](_0x4717('0xf'),_0xdce1eb,_0x4717('0x10'));logger[_0x4717('0x11')](_0x4717('0x12'),_0xdce1eb,_0x4717('0x10'),JSON['stringify'](_0x41e5e7));if(_0x41e5e7[_0x4717('0x13')]){if(_0x41e5e7[_0x4717('0x13')]['code']===0x1f4){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0xdce1eb,_0x41e5e7[_0x4717('0x13')][_0x4717('0x14')]);return _0x58dbfe(_0x41e5e7[_0x4717('0x13')][_0x4717('0x14')]);}logger[_0x4717('0x13')](_0x4717('0xf'),_0xdce1eb,_0x41e5e7['error'][_0x4717('0x14')]);return _0x106c92(_0x41e5e7[_0x4717('0x13')][_0x4717('0x14')]);}else{logger['info'](_0x4717('0xf'),_0xdce1eb,'request\x20sent');_0x106c92(_0x41e5e7[_0x4717('0x15')][_0x4717('0x14')]);}})['catch'](function(_0x523539){logger['error'](_0x4717('0xf'),_0xdce1eb,_0x523539);_0x58dbfe(_0x523539);});});}exports[_0x4717('0x16')]=function(_0x57b14f){var _0x1d03c4=this;return new Promise(function(_0x5c48eb,_0x141cdf){return db['WhatsappAccount'][_0x4717('0x17')]({'raw':_0x57b14f[_0x4717('0x18')]?_0x57b14f[_0x4717('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x57b14f[_0x4717('0x18')]?_0x57b14f['options'][_0x4717('0x19')]||null:null,'attributes':_0x57b14f['options']?_0x57b14f[_0x4717('0x18')]['attributes']||null:null,'include':_0x57b14f[_0x4717('0x18')]?_0x57b14f[_0x4717('0x18')]['include']?_['map'](_0x57b14f[_0x4717('0x18')][_0x4717('0x1a')],function(_0x5c0386){return{'model':db[_0x5c0386[_0x4717('0x1b')]],'as':_0x5c0386['as'],'attributes':_0x5c0386[_0x4717('0x1c')],'include':_0x5c0386[_0x4717('0x1a')]?_[_0x4717('0x1d')](_0x5c0386['include'],function(_0x59bc41){return{'model':db[_0x59bc41[_0x4717('0x1b')]],'as':_0x59bc41['as'],'attributes':_0x59bc41['attributes'],'include':_0x59bc41['include']?_[_0x4717('0x1d')](_0x59bc41[_0x4717('0x1a')],function(_0x35ba94){return{'model':db[_0x35ba94['model']],'as':_0x35ba94['as'],'attributes':_0x35ba94[_0x4717('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x4717('0x1e')](function(_0x29fd0a){logger[_0x4717('0x1f')](_0x4717('0x16'),_0x57b14f);logger['debug']('ShowWhatsappAccount',_0x57b14f,JSON[_0x4717('0x20')](_0x29fd0a));_0x5c48eb(_0x29fd0a);})[_0x4717('0x21')](function(_0x3138cd){logger[_0x4717('0x13')]('ShowWhatsappAccount',_0x3138cd[_0x4717('0x14')],_0x57b14f);_0x141cdf(_0x1d03c4[_0x4717('0x13')](0x1f4,_0x3138cd['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 01f0359..483b51d 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 _0xb928=['removeListener','register','length','save','remove','update','emit'];(function(_0x41d548,_0x2804b2){var _0xe4620f=function(_0x2b076e){while(--_0x2b076e){_0x41d548['push'](_0x41d548['shift']());}};_0xe4620f(++_0x2804b2);}(_0xb928,0x192));var _0x8b92=function(_0x24875d,_0x4fb24d){_0x24875d=_0x24875d-0x0;var _0x181471=_0xb928[_0x24875d];return _0x181471;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=[_0x8b92('0x0'),_0x8b92('0x1'),_0x8b92('0x2')];function createListener(_0x197e28,_0x3ad4c5){return function(_0x4c619e){_0x3ad4c5[_0x8b92('0x3')](_0x197e28,_0x4c619e);};}function removeListener(_0x5e4fa8,_0x4cf32d){return function(){WhatsappAccountEvents[_0x8b92('0x4')](_0x5e4fa8,_0x4cf32d);};}exports[_0x8b92('0x5')]=function(_0xd0e670){for(var _0x40742c=0x0,_0x1837ce=events[_0x8b92('0x6')];_0x40742c<_0x1837ce;_0x40742c++){var _0x29287e=events[_0x40742c];var _0x2f3a67=createListener('whatsappAccount:'+_0x29287e,_0xd0e670);WhatsappAccountEvents['on'](_0x29287e,_0x2f3a67);}}; \ No newline at end of file +var _0x5b2f=['length','./whatsappAccount.events','save','remove','update','emit','removeListener','register'];(function(_0x14f636,_0x1bde31){var _0x1411f1=function(_0x181cfc){while(--_0x181cfc){_0x14f636['push'](_0x14f636['shift']());}};_0x1411f1(++_0x1bde31);}(_0x5b2f,0x161));var _0xf5b2=function(_0x328bd3,_0x9cf5a5){_0x328bd3=_0x328bd3-0x0;var _0x458149=_0x5b2f[_0x328bd3];return _0x458149;};'use strict';var WhatsappAccountEvents=require(_0xf5b2('0x0'));var events=[_0xf5b2('0x1'),_0xf5b2('0x2'),_0xf5b2('0x3')];function createListener(_0x429ca3,_0x15f940){return function(_0x4eeb69){_0x15f940[_0xf5b2('0x4')](_0x429ca3,_0x4eeb69);};}function removeListener(_0x1ec8e7,_0x2262ea){return function(){WhatsappAccountEvents[_0xf5b2('0x5')](_0x1ec8e7,_0x2262ea);};}exports[_0xf5b2('0x6')]=function(_0x83c89e){for(var _0x1adf47=0x0,_0x148658=events[_0xf5b2('0x7')];_0x1adf47<_0x148658;_0x1adf47++){var _0x55a8a1=events[_0x1adf47];var _0x368fd6=createListener('whatsappAccount:'+_0x55a8a1,_0x83c89e);WhatsappAccountEvents['on'](_0x55a8a1,_0x368fd6);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index d704648..b36e031 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 _0x783e=['multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','create','update','delete','destroy'];(function(_0x32c96e,_0x360866){var _0x45b218=function(_0x3d8003){while(--_0x3d8003){_0x32c96e['push'](_0x32c96e['shift']());}};_0x45b218(++_0x360866);}(_0x783e,0x140));var _0xe783=function(_0x331578,_0x4fa307){_0x331578=_0x331578-0x0;var _0x30c0ec=_0x783e[_0x331578];return _0x30c0ec;};'use strict';var multer=require(_0xe783('0x0'));var util=require(_0xe783('0x1'));var path=require(_0xe783('0x2'));var timeout=require(_0xe783('0x3'));var express=require(_0xe783('0x4'));var router=express['Router']();var fs_extra=require(_0xe783('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe783('0x6'));var config=require(_0xe783('0x7'));var controller=require('./whatsappApplication.controller');router[_0xe783('0x8')]('/',auth['isAuthenticated'](),controller[_0xe783('0x9')]);router[_0xe783('0x8')](_0xe783('0xa'),auth[_0xe783('0xb')](),controller['show']);router['post']('/',auth[_0xe783('0xb')](),controller[_0xe783('0xc')]);router['put']('/:id',auth[_0xe783('0xb')](),controller[_0xe783('0xd')]);router[_0xe783('0xe')](_0xe783('0xa'),auth[_0xe783('0xb')](),controller[_0xe783('0xf')]);module['exports']=router; \ No newline at end of file +var _0xcc7f=['delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','isAuthenticated','index','get','/:id','post','create','put','update'];(function(_0x3b1c1d,_0x55f622){var _0x59f9a1=function(_0x1806f9){while(--_0x1806f9){_0x3b1c1d['push'](_0x3b1c1d['shift']());}};_0x59f9a1(++_0x55f622);}(_0xcc7f,0x11b));var _0xfcc7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcc7f[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xfcc7('0x0'));var path=require(_0xfcc7('0x1'));var timeout=require('connect-timeout');var express=require(_0xfcc7('0x2'));var router=express[_0xfcc7('0x3')]();var fs_extra=require(_0xfcc7('0x4'));var auth=require(_0xfcc7('0x5'));var interaction=require(_0xfcc7('0x6'));var config=require(_0xfcc7('0x7'));var controller=require(_0xfcc7('0x8'));router['get']('/',auth[_0xfcc7('0x9')](),controller[_0xfcc7('0xa')]);router[_0xfcc7('0xb')](_0xfcc7('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xfcc7('0xd')]('/',auth[_0xfcc7('0x9')](),controller[_0xfcc7('0xe')]);router[_0xfcc7('0xf')](_0xfcc7('0xc'),auth['isAuthenticated'](),controller[_0xfcc7('0x10')]);router[_0xfcc7('0x11')]('/:id',auth[_0xfcc7('0x9')](),controller[_0xfcc7('0x12')]);module[_0xfcc7('0x13')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index d83e067..fb29981 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 _0x576b=['noop','TEXT','*,*,*,*','exports','INTEGER','STRING'];(function(_0x5f571a,_0x438086){var _0x31a570=function(_0x5dd4e3){while(--_0x5dd4e3){_0x5f571a['push'](_0x5f571a['shift']());}};_0x31a570(++_0x438086);}(_0x576b,0xdb));var _0xb576=function(_0x4d2658,_0x376562){_0x4d2658=_0x4d2658-0x0;var _0x5a5f39=_0x576b[_0x4d2658];return _0x5a5f39;};'use strict';var Sequelize=require('sequelize');module[_0xb576('0x0')]={'priority':{'type':Sequelize[_0xb576('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xb576('0x2')],'allowNull':![],'defaultValue':_0xb576('0x3')},'appdata':{'type':Sequelize[_0xb576('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xb576('0x2')],'defaultValue':_0xb576('0x5')}}; \ No newline at end of file +var _0x0d94=['sequelize','INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0x1714a3,_0x1fc437){var _0x3d52fa=function(_0x2180af){while(--_0x2180af){_0x1714a3['push'](_0x1714a3['shift']());}};_0x3d52fa(++_0x1fc437);}(_0x0d94,0xc0));var _0x40d9=function(_0x52287e,_0x23d482){_0x52287e=_0x52287e-0x0;var _0x310844=_0x0d94[_0x52287e];return _0x310844;};'use strict';var Sequelize=require(_0x40d9('0x0'));module['exports']={'priority':{'type':Sequelize[_0x40d9('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x40d9('0x2')],'allowNull':![],'defaultValue':_0x40d9('0x3')},'appdata':{'type':Sequelize[_0x40d9('0x4')]()},'description':{'type':Sequelize[_0x40d9('0x2')]},'interval':{'type':Sequelize[_0x40d9('0x2')],'defaultValue':_0x40d9('0x5')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index 5517759..0af5501 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 _0x6050=['rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','fs-extra','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','name','send','index','map','WhatsappApplication'];(function(_0x4bf6d5,_0x5368a4){var _0x4f08d8=function(_0x41417a){while(--_0x41417a){_0x4bf6d5['push'](_0x4bf6d5['shift']());}};_0x4f08d8(++_0x5368a4);}(_0x6050,0x196));var _0x0605=function(_0x345e1b,_0x309fb8){_0x345e1b=_0x345e1b-0x0;var _0x256c78=_0x6050[_0x345e1b];return _0x256c78;};'use strict';var emlformat=require(_0x0605('0x0'));var rimraf=require(_0x0605('0x1'));var zipdir=require(_0x0605('0x2'));var jsonpatch=require(_0x0605('0x3'));var rp=require(_0x0605('0x4'));var moment=require(_0x0605('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0605('0x6'));var util=require(_0x0605('0x7'));var path=require(_0x0605('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0605('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0605('0xa'));var deskjs=require(_0x0605('0xb'));var toCsv=require(_0x0605('0xc'));var querystring=require(_0x0605('0xd'));var Papa=require(_0x0605('0xe'));var Redis=require('ioredis');var authService=require(_0x0605('0xf'));var qs=require(_0x0605('0x10'));var as=require(_0x0605('0x11'));var hardwareService=require(_0x0605('0x12'));var logger=require(_0x0605('0x13'))(_0x0605('0x14'));var utils=require(_0x0605('0x15'));var config=require(_0x0605('0x16'));var licenseUtil=require(_0x0605('0x17'));var db=require(_0x0605('0x18'))['db'];function respondWithStatusCode(_0xd22e35,_0x39e288){_0x39e288=_0x39e288||0xcc;return function(_0x34c9e6){if(_0x34c9e6){return _0xd22e35[_0x0605('0x19')](_0x39e288);}return _0xd22e35[_0x0605('0x1a')](_0x39e288)[_0x0605('0x1b')]();};}function respondWithResult(_0x169a70,_0x65a20b){_0x65a20b=_0x65a20b||0xc8;return function(_0x1b944f){if(_0x1b944f){return _0x169a70['status'](_0x65a20b)[_0x0605('0x1c')](_0x1b944f);}};}function respondWithFilteredResult(_0x1a802b,_0x4993ab){return function(_0x5ce56a){if(_0x5ce56a){var _0x4eefe9=typeof _0x4993ab[_0x0605('0x1d')]===_0x0605('0x1e')&&typeof _0x4993ab[_0x0605('0x1f')]===_0x0605('0x1e');var _0xefc557=_0x5ce56a[_0x0605('0x20')];var _0x2b7b5a=_0x4eefe9?0x0:_0x4993ab[_0x0605('0x1d')];var _0x193520=_0x4eefe9?_0x5ce56a[_0x0605('0x20')]:_0x4993ab[_0x0605('0x1d')]+_0x4993ab[_0x0605('0x1f')];var _0x2e2204;if(_0x193520>=_0xefc557){_0x193520=_0xefc557;_0x2e2204=0xc8;}else{_0x2e2204=0xce;}_0x1a802b[_0x0605('0x1a')](_0x2e2204);return _0x1a802b['set'](_0x0605('0x21'),_0x2b7b5a+'-'+_0x193520+'/'+_0xefc557)[_0x0605('0x1c')](_0x5ce56a);}return null;};}function patchUpdates(_0x430f28){return function(_0x443326){try{jsonpatch[_0x0605('0x22')](_0x443326,_0x430f28,!![]);}catch(_0x90b2e1){return BPromise[_0x0605('0x23')](_0x90b2e1);}return _0x443326[_0x0605('0x24')]();};}function saveUpdates(_0x226ef5,_0x5b0d44){return function(_0xc334b8){if(_0xc334b8){return _0xc334b8['update'](_0x226ef5)[_0x0605('0x25')](function(_0x118e9c){return _0x118e9c;});}return null;};}function removeEntity(_0x110098,_0xf182c4){return function(_0x10c575){if(_0x10c575){return _0x10c575[_0x0605('0x26')]()[_0x0605('0x25')](function(){_0x110098[_0x0605('0x1a')](0xcc)[_0x0605('0x1b')]();});}};}function handleEntityNotFound(_0x2896d7,_0x9f2833){return function(_0x1c3722){if(!_0x1c3722){_0x2896d7['sendStatus'](0x194);}return _0x1c3722;};}function handleError(_0x6bc204,_0x3c8e36){_0x3c8e36=_0x3c8e36||0x1f4;return function(_0x4b1e0c){logger['error'](_0x4b1e0c['stack']);if(_0x4b1e0c[_0x0605('0x27')]){delete _0x4b1e0c[_0x0605('0x27')];}_0x6bc204[_0x0605('0x1a')](_0x3c8e36)[_0x0605('0x28')](_0x4b1e0c);};}exports[_0x0605('0x29')]=function(_0x4554df,_0x4e32ef){var _0x34f25d={},_0x5daef6={},_0xa836f2={'count':0x0,'rows':[]};var _0x3640b9=_[_0x0605('0x2a')](db[_0x0605('0x2b')][_0x0605('0x2c')],function(_0x352dd6){return{'name':_0x352dd6['fieldName'],'type':_0x352dd6[_0x0605('0x2d')][_0x0605('0x2e')]};});_0x5daef6[_0x0605('0x2f')]=_[_0x0605('0x2a')](_0x3640b9,_0x0605('0x27'));_0x5daef6[_0x0605('0x30')]=_[_0x0605('0x31')](_0x4554df[_0x0605('0x30')]);_0x5daef6[_0x0605('0x32')]=_[_0x0605('0x33')](_0x5daef6[_0x0605('0x2f')],_0x5daef6[_0x0605('0x30')]);_0x34f25d[_0x0605('0x34')]=_[_0x0605('0x33')](_0x5daef6[_0x0605('0x2f')],qs[_0x0605('0x35')](_0x4554df[_0x0605('0x30')][_0x0605('0x35')]));_0x34f25d[_0x0605('0x34')]=_0x34f25d[_0x0605('0x34')][_0x0605('0x36')]?_0x34f25d[_0x0605('0x34')]:_0x5daef6[_0x0605('0x2f')];if(!_0x4554df[_0x0605('0x30')][_0x0605('0x37')](_0x0605('0x38'))){_0x34f25d[_0x0605('0x1f')]=qs['limit'](_0x4554df[_0x0605('0x30')][_0x0605('0x1f')]);_0x34f25d['offset']=qs[_0x0605('0x1d')](_0x4554df[_0x0605('0x30')]['offset']);}_0x34f25d[_0x0605('0x39')]=qs[_0x0605('0x3a')](_0x4554df[_0x0605('0x30')][_0x0605('0x3a')]);_0x34f25d[_0x0605('0x3b')]=qs[_0x0605('0x32')](_['pick'](_0x4554df['query'],_0x5daef6[_0x0605('0x32')]),_0x3640b9);if(_0x4554df[_0x0605('0x30')][_0x0605('0x3c')]){_0x34f25d['where']=_[_0x0605('0x3d')](_0x34f25d['where'],{'$or':_[_0x0605('0x2a')](_0x3640b9,function(_0x1e98f6){if(_0x1e98f6[_0x0605('0x2d')]!==_0x0605('0x3e')){var _0x42f7ce={};_0x42f7ce[_0x1e98f6[_0x0605('0x27')]]={'$like':'%'+_0x4554df[_0x0605('0x30')][_0x0605('0x3c')]+'%'};return _0x42f7ce;}})});}_0x34f25d=_[_0x0605('0x3d')]({},_0x34f25d,_0x4554df[_0x0605('0x3f')]);var _0x57aa15={'where':_0x34f25d[_0x0605('0x3b')]};return db['WhatsappApplication'][_0x0605('0x20')](_0x57aa15)[_0x0605('0x25')](function(_0x45787e){_0xa836f2['count']=_0x45787e;if(_0x4554df['query'][_0x0605('0x40')]){_0x34f25d['include']=[{'all':!![]}];}return db[_0x0605('0x2b')][_0x0605('0x41')](_0x34f25d);})[_0x0605('0x25')](function(_0x3de34a){_0xa836f2[_0x0605('0x42')]=_0x3de34a;return _0xa836f2;})[_0x0605('0x25')](respondWithFilteredResult(_0x4e32ef,_0x34f25d))[_0x0605('0x43')](handleError(_0x4e32ef,null));};exports[_0x0605('0x44')]=function(_0x3fa553,_0x10bb36){var _0x18d3ce={'raw':!![],'where':{'id':_0x3fa553[_0x0605('0x45')]['id']}},_0x3616a3={};_0x3616a3['model']=_['keys'](db[_0x0605('0x2b')]['rawAttributes']);_0x3616a3[_0x0605('0x30')]=_[_0x0605('0x31')](_0x3fa553['query']);_0x3616a3[_0x0605('0x32')]=_[_0x0605('0x33')](_0x3616a3['model'],_0x3616a3[_0x0605('0x30')]);_0x18d3ce[_0x0605('0x34')]=_['intersection'](_0x3616a3[_0x0605('0x2f')],qs[_0x0605('0x35')](_0x3fa553['query'][_0x0605('0x35')]));_0x18d3ce['attributes']=_0x18d3ce['attributes'][_0x0605('0x36')]?_0x18d3ce[_0x0605('0x34')]:_0x3616a3[_0x0605('0x2f')];if(_0x3fa553[_0x0605('0x30')][_0x0605('0x40')]){_0x18d3ce[_0x0605('0x46')]=[{'all':!![]}];}_0x18d3ce=_[_0x0605('0x3d')]({},_0x18d3ce,_0x3fa553[_0x0605('0x3f')]);return db['WhatsappApplication'][_0x0605('0x47')](_0x18d3ce)[_0x0605('0x25')](handleEntityNotFound(_0x10bb36,null))[_0x0605('0x25')](respondWithResult(_0x10bb36,null))['catch'](handleError(_0x10bb36,null));};exports[_0x0605('0x48')]=function(_0x1fb70b,_0x45cc1a){return db[_0x0605('0x2b')][_0x0605('0x48')](_0x1fb70b[_0x0605('0x49')],{})[_0x0605('0x25')](respondWithResult(_0x45cc1a,0xc9))[_0x0605('0x43')](handleError(_0x45cc1a,null));};exports[_0x0605('0x4a')]=function(_0x4bc55e,_0x3c597c){if(_0x4bc55e[_0x0605('0x49')]['id']){delete _0x4bc55e[_0x0605('0x49')]['id'];}return db[_0x0605('0x2b')][_0x0605('0x47')]({'where':{'id':_0x4bc55e[_0x0605('0x45')]['id']}})[_0x0605('0x25')](handleEntityNotFound(_0x3c597c,null))[_0x0605('0x25')](saveUpdates(_0x4bc55e[_0x0605('0x49')],null))[_0x0605('0x25')](respondWithResult(_0x3c597c,null))['catch'](handleError(_0x3c597c,null));};exports['destroy']=function(_0x4876c7,_0x2687a8){return db[_0x0605('0x2b')][_0x0605('0x47')]({'where':{'id':_0x4876c7[_0x0605('0x45')]['id']}})[_0x0605('0x25')](handleEntityNotFound(_0x2687a8,null))[_0x0605('0x25')](removeEntity(_0x2687a8,null))['catch'](handleError(_0x2687a8,null));}; \ No newline at end of file +var _0xf846=['sendStatus','end','json','undefined','limit','count','offset','status','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','WhatsappApplication','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x508438,_0x5ef19d){var _0x541024=function(_0x573032){while(--_0x573032){_0x508438['push'](_0x508438['shift']());}};_0x541024(++_0x5ef19d);}(_0xf846,0x85));var _0x6f84=function(_0x34951a,_0x1f28b2){_0x34951a=_0x34951a-0x0;var _0x3019cf=_0xf846[_0x34951a];return _0x3019cf;};'use strict';var emlformat=require(_0x6f84('0x0'));var rimraf=require(_0x6f84('0x1'));var zipdir=require(_0x6f84('0x2'));var jsonpatch=require(_0x6f84('0x3'));var rp=require('request-promise');var moment=require(_0x6f84('0x4'));var BPromise=require(_0x6f84('0x5'));var Mustache=require(_0x6f84('0x6'));var util=require(_0x6f84('0x7'));var path=require('path');var sox=require(_0x6f84('0x8'));var csv=require(_0x6f84('0x9'));var ejs=require(_0x6f84('0xa'));var fs=require('fs');var fs_extra=require(_0x6f84('0xb'));var _=require(_0x6f84('0xc'));var squel=require(_0x6f84('0xd'));var crypto=require('crypto');var jsforce=require(_0x6f84('0xe'));var deskjs=require(_0x6f84('0xf'));var toCsv=require(_0x6f84('0x9'));var querystring=require('querystring');var Papa=require(_0x6f84('0x10'));var Redis=require(_0x6f84('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x6f84('0x12'));var as=require(_0x6f84('0x13'));var hardwareService=require(_0x6f84('0x14'));var logger=require(_0x6f84('0x15'))(_0x6f84('0x16'));var utils=require(_0x6f84('0x17'));var config=require(_0x6f84('0x18'));var licenseUtil=require(_0x6f84('0x19'));var db=require(_0x6f84('0x1a'))['db'];function respondWithStatusCode(_0x3c2810,_0x1fc892){_0x1fc892=_0x1fc892||0xcc;return function(_0x502d4e){if(_0x502d4e){return _0x3c2810[_0x6f84('0x1b')](_0x1fc892);}return _0x3c2810['status'](_0x1fc892)[_0x6f84('0x1c')]();};}function respondWithResult(_0x342271,_0x505456){_0x505456=_0x505456||0xc8;return function(_0x400ec0){if(_0x400ec0){return _0x342271['status'](_0x505456)[_0x6f84('0x1d')](_0x400ec0);}};}function respondWithFilteredResult(_0x4a1844,_0x528782){return function(_0x4e77a0){if(_0x4e77a0){var _0x9c62fc=typeof _0x528782['offset']===_0x6f84('0x1e')&&typeof _0x528782[_0x6f84('0x1f')]===_0x6f84('0x1e');var _0x4290c5=_0x4e77a0[_0x6f84('0x20')];var _0x2abc28=_0x9c62fc?0x0:_0x528782['offset'];var _0x2b91ad=_0x9c62fc?_0x4e77a0['count']:_0x528782[_0x6f84('0x21')]+_0x528782[_0x6f84('0x1f')];var _0x3712d0;if(_0x2b91ad>=_0x4290c5){_0x2b91ad=_0x4290c5;_0x3712d0=0xc8;}else{_0x3712d0=0xce;}_0x4a1844[_0x6f84('0x22')](_0x3712d0);return _0x4a1844[_0x6f84('0x23')](_0x6f84('0x24'),_0x2abc28+'-'+_0x2b91ad+'/'+_0x4290c5)[_0x6f84('0x1d')](_0x4e77a0);}return null;};}function patchUpdates(_0x56dd3a){return function(_0x545ed6){try{jsonpatch[_0x6f84('0x25')](_0x545ed6,_0x56dd3a,!![]);}catch(_0x584feb){return BPromise[_0x6f84('0x26')](_0x584feb);}return _0x545ed6[_0x6f84('0x27')]();};}function saveUpdates(_0x307361,_0x158220){return function(_0x3465e3){if(_0x3465e3){return _0x3465e3[_0x6f84('0x28')](_0x307361)[_0x6f84('0x29')](function(_0x364972){return _0x364972;});}return null;};}function removeEntity(_0x145604,_0x512320){return function(_0x12a642){if(_0x12a642){return _0x12a642['destroy']()[_0x6f84('0x29')](function(){_0x145604[_0x6f84('0x22')](0xcc)[_0x6f84('0x1c')]();});}};}function handleEntityNotFound(_0x430fb7,_0x3627e8){return function(_0x30014e){if(!_0x30014e){_0x430fb7[_0x6f84('0x1b')](0x194);}return _0x30014e;};}function handleError(_0x9bd17d,_0x3a1327){_0x3a1327=_0x3a1327||0x1f4;return function(_0x31badd){logger[_0x6f84('0x2a')](_0x31badd[_0x6f84('0x2b')]);if(_0x31badd[_0x6f84('0x2c')]){delete _0x31badd[_0x6f84('0x2c')];}_0x9bd17d[_0x6f84('0x22')](_0x3a1327)[_0x6f84('0x2d')](_0x31badd);};}exports[_0x6f84('0x2e')]=function(_0x4fa5da,_0x16cab0){var _0x425d16={},_0x13d6f1={},_0x4a4a4f={'count':0x0,'rows':[]};var _0x4d3469=_[_0x6f84('0x2f')](db[_0x6f84('0x30')]['rawAttributes'],function(_0x261b49){return{'name':_0x261b49[_0x6f84('0x31')],'type':_0x261b49[_0x6f84('0x32')][_0x6f84('0x33')]};});_0x13d6f1['model']=_[_0x6f84('0x2f')](_0x4d3469,_0x6f84('0x2c'));_0x13d6f1[_0x6f84('0x34')]=_[_0x6f84('0x35')](_0x4fa5da['query']);_0x13d6f1[_0x6f84('0x36')]=_[_0x6f84('0x37')](_0x13d6f1[_0x6f84('0x38')],_0x13d6f1[_0x6f84('0x34')]);_0x425d16[_0x6f84('0x39')]=_[_0x6f84('0x37')](_0x13d6f1[_0x6f84('0x38')],qs[_0x6f84('0x3a')](_0x4fa5da[_0x6f84('0x34')][_0x6f84('0x3a')]));_0x425d16[_0x6f84('0x39')]=_0x425d16['attributes'][_0x6f84('0x3b')]?_0x425d16[_0x6f84('0x39')]:_0x13d6f1[_0x6f84('0x38')];if(!_0x4fa5da[_0x6f84('0x34')][_0x6f84('0x3c')]('nolimit')){_0x425d16[_0x6f84('0x1f')]=qs['limit'](_0x4fa5da[_0x6f84('0x34')][_0x6f84('0x1f')]);_0x425d16[_0x6f84('0x21')]=qs[_0x6f84('0x21')](_0x4fa5da[_0x6f84('0x34')][_0x6f84('0x21')]);}_0x425d16[_0x6f84('0x3d')]=qs[_0x6f84('0x3e')](_0x4fa5da[_0x6f84('0x34')][_0x6f84('0x3e')]);_0x425d16[_0x6f84('0x3f')]=qs[_0x6f84('0x36')](_[_0x6f84('0x40')](_0x4fa5da[_0x6f84('0x34')],_0x13d6f1[_0x6f84('0x36')]),_0x4d3469);if(_0x4fa5da[_0x6f84('0x34')][_0x6f84('0x41')]){_0x425d16['where']=_[_0x6f84('0x42')](_0x425d16[_0x6f84('0x3f')],{'$or':_['map'](_0x4d3469,function(_0x9dd9c5){if(_0x9dd9c5[_0x6f84('0x32')]!=='VIRTUAL'){var _0x18d750={};_0x18d750[_0x9dd9c5[_0x6f84('0x2c')]]={'$like':'%'+_0x4fa5da['query']['filter']+'%'};return _0x18d750;}})});}_0x425d16=_[_0x6f84('0x42')]({},_0x425d16,_0x4fa5da[_0x6f84('0x43')]);var _0x4d07d3={'where':_0x425d16['where']};return db[_0x6f84('0x30')][_0x6f84('0x20')](_0x4d07d3)[_0x6f84('0x29')](function(_0x1197d9){_0x4a4a4f[_0x6f84('0x20')]=_0x1197d9;if(_0x4fa5da['query'][_0x6f84('0x44')]){_0x425d16[_0x6f84('0x45')]=[{'all':!![]}];}return db[_0x6f84('0x30')][_0x6f84('0x46')](_0x425d16);})[_0x6f84('0x29')](function(_0x298716){_0x4a4a4f[_0x6f84('0x47')]=_0x298716;return _0x4a4a4f;})[_0x6f84('0x29')](respondWithFilteredResult(_0x16cab0,_0x425d16))['catch'](handleError(_0x16cab0,null));};exports[_0x6f84('0x48')]=function(_0x58e2f6,_0x12c8f3){var _0x452ef3={'raw':!![],'where':{'id':_0x58e2f6[_0x6f84('0x49')]['id']}},_0x26efdc={};_0x26efdc['model']=_[_0x6f84('0x35')](db[_0x6f84('0x30')][_0x6f84('0x4a')]);_0x26efdc['query']=_[_0x6f84('0x35')](_0x58e2f6[_0x6f84('0x34')]);_0x26efdc[_0x6f84('0x36')]=_['intersection'](_0x26efdc[_0x6f84('0x38')],_0x26efdc[_0x6f84('0x34')]);_0x452ef3[_0x6f84('0x39')]=_['intersection'](_0x26efdc['model'],qs['fields'](_0x58e2f6['query']['fields']));_0x452ef3[_0x6f84('0x39')]=_0x452ef3[_0x6f84('0x39')][_0x6f84('0x3b')]?_0x452ef3[_0x6f84('0x39')]:_0x26efdc[_0x6f84('0x38')];if(_0x58e2f6[_0x6f84('0x34')][_0x6f84('0x44')]){_0x452ef3[_0x6f84('0x45')]=[{'all':!![]}];}_0x452ef3=_['merge']({},_0x452ef3,_0x58e2f6[_0x6f84('0x43')]);return db[_0x6f84('0x30')][_0x6f84('0x4b')](_0x452ef3)[_0x6f84('0x29')](handleEntityNotFound(_0x12c8f3,null))[_0x6f84('0x29')](respondWithResult(_0x12c8f3,null))[_0x6f84('0x4c')](handleError(_0x12c8f3,null));};exports[_0x6f84('0x4d')]=function(_0x17659b,_0x13dba5){return db[_0x6f84('0x30')]['create'](_0x17659b[_0x6f84('0x4e')],{})[_0x6f84('0x29')](respondWithResult(_0x13dba5,0xc9))[_0x6f84('0x4c')](handleError(_0x13dba5,null));};exports[_0x6f84('0x28')]=function(_0x6065a6,_0x10b882){if(_0x6065a6['body']['id']){delete _0x6065a6[_0x6f84('0x4e')]['id'];}return db[_0x6f84('0x30')][_0x6f84('0x4b')]({'where':{'id':_0x6065a6[_0x6f84('0x49')]['id']}})[_0x6f84('0x29')](handleEntityNotFound(_0x10b882,null))[_0x6f84('0x29')](saveUpdates(_0x6065a6[_0x6f84('0x4e')],null))[_0x6f84('0x29')](respondWithResult(_0x10b882,null))[_0x6f84('0x4c')](handleError(_0x10b882,null));};exports[_0x6f84('0x4f')]=function(_0x36938e,_0x42e801){return db['WhatsappApplication'][_0x6f84('0x4b')]({'where':{'id':_0x36938e[_0x6f84('0x49')]['id']}})[_0x6f84('0x29')](handleEntityNotFound(_0x42e801,null))[_0x6f84('0x29')](removeEntity(_0x42e801,null))[_0x6f84('0x4c')](handleError(_0x42e801,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 00726c1..f812957 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 _0xed1f=['request-promise','path','rimraf','../../config/environment','./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xed1f,0x6a));var _0xfed1=function(_0x9dfc10,_0x19c2d5){_0x9dfc10=_0x9dfc10-0x0;var _0x4f938a=_0xed1f[_0x9dfc10];return _0x4f938a;};'use strict';var _=require(_0xfed1('0x0'));var util=require(_0xfed1('0x1'));var logger=require(_0xfed1('0x2'))(_0xfed1('0x3'));var moment=require(_0xfed1('0x4'));var BPromise=require(_0xfed1('0x5'));var rp=require(_0xfed1('0x6'));var fs=require('fs');var path=require(_0xfed1('0x7'));var rimraf=require(_0xfed1('0x8'));var config=require(_0xfed1('0x9'));var attributes=require(_0xfed1('0xa'));module[_0xfed1('0xb')]=function(_0x3d6706,_0x42751d){return _0x3d6706[_0xfed1('0xc')](_0xfed1('0xd'),attributes,{'tableName':_0xfed1('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xfed1('0xf'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x8c32=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x4c172f,_0x4cf52){var _0x4f7eed=function(_0x1316c2){while(--_0x1316c2){_0x4c172f['push'](_0x4c172f['shift']());}};_0x4f7eed(++_0x4cf52);}(_0x8c32,0x130));var _0x28c3=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x8c32[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x28c3('0x0'));var util=require(_0x28c3('0x1'));var logger=require(_0x28c3('0x2'))(_0x28c3('0x3'));var moment=require(_0x28c3('0x4'));var BPromise=require(_0x28c3('0x5'));var rp=require(_0x28c3('0x6'));var fs=require('fs');var path=require(_0x28c3('0x7'));var rimraf=require(_0x28c3('0x8'));var config=require(_0x28c3('0x9'));var attributes=require(_0x28c3('0xa'));module[_0x28c3('0xb')]=function(_0x537b4f,_0x2861c9){return _0x537b4f[_0x28c3('0xc')](_0x28c3('0xd'),attributes,{'tableName':_0x28c3('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x28c3('0xf'),'collate':_0x28c3('0x10')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 3d5b432..ca9d4ad 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 _0x55ca=['rpc','../../config/environment','jayson/promise','client','http','request','then','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','ioredis','../../mysqldb','../../config/logger'];(function(_0xaa5994,_0x382c42){var _0x171099=function(_0x2969af){while(--_0x2969af){_0xaa5994['push'](_0xaa5994['shift']());}};_0x171099(++_0x382c42);}(_0x55ca,0x126));var _0xa55c=function(_0xfd5f37,_0x24a79c){_0xfd5f37=_0xfd5f37-0x0;var _0x11bd01=_0x55ca[_0xfd5f37];return _0x11bd01;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa55c('0x2'));var db=require(_0xa55c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa55c('0x4'))(_0xa55c('0x5'));var config=require(_0xa55c('0x6'));var jayson=require(_0xa55c('0x7'));var client=jayson[_0xa55c('0x8')][_0xa55c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36b623,_0x4d0624,_0x2121fd){return new BPromise(function(_0x2537f0,_0x57e069){return client[_0xa55c('0xa')](_0x36b623,_0x2121fd)[_0xa55c('0xb')](function(_0x52a3bc){logger['info'](_0xa55c('0xc'),_0x4d0624,_0xa55c('0xd'));logger[_0xa55c('0xe')](_0xa55c('0xf'),_0x4d0624,_0xa55c('0xd'),JSON[_0xa55c('0x10')](_0x52a3bc));if(_0x52a3bc[_0xa55c('0x11')]){if(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x12')]===0x1f4){logger[_0xa55c('0x11')]('WhatsappApplication,\x20%s,\x20%s',_0x4d0624,_0x52a3bc['error'][_0xa55c('0x13')]);return _0x57e069(_0x52a3bc['error']['message']);}logger['error'](_0xa55c('0xc'),_0x4d0624,_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);return _0x2537f0(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);}else{logger[_0xa55c('0x14')]('WhatsappApplication,\x20%s,\x20%s',_0x4d0624,_0xa55c('0xd'));_0x2537f0(_0x52a3bc[_0xa55c('0x15')][_0xa55c('0x13')]);}})[_0xa55c('0x16')](function(_0x1c4cfd){logger[_0xa55c('0x11')](_0xa55c('0xc'),_0x4d0624,_0x1c4cfd);_0x57e069(_0x1c4cfd);});});} \ No newline at end of file +var _0xa8a8=['stringify','error','code','WhatsappApplication,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug'];(function(_0x17c04f,_0x2cf720){var _0x3af082=function(_0x42da63){while(--_0x42da63){_0x17c04f['push'](_0x17c04f['shift']());}};_0x3af082(++_0x2cf720);}(_0xa8a8,0xec));var _0x8a8a=function(_0x22fcd9,_0x45f342){_0x22fcd9=_0x22fcd9-0x0;var _0x4e14cd=_0xa8a8[_0x22fcd9];return _0x4e14cd;};'use strict';var _=require(_0x8a8a('0x0'));var util=require(_0x8a8a('0x1'));var moment=require(_0x8a8a('0x2'));var BPromise=require(_0x8a8a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8a8a('0x4'));var db=require(_0x8a8a('0x5'))['db'];var utils=require(_0x8a8a('0x6'));var logger=require(_0x8a8a('0x7'))(_0x8a8a('0x8'));var config=require(_0x8a8a('0x9'));var jayson=require(_0x8a8a('0xa'));var client=jayson[_0x8a8a('0xb')][_0x8a8a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x315fe9,_0x1d7121,_0x8e7aa0){return new BPromise(function(_0x4225b9,_0xecaa6f){return client[_0x8a8a('0xd')](_0x315fe9,_0x8e7aa0)['then'](function(_0x576ef9){logger[_0x8a8a('0xe')]('WhatsappApplication,\x20%s,\x20%s',_0x1d7121,_0x8a8a('0xf'));logger[_0x8a8a('0x10')]('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0x1d7121,_0x8a8a('0xf'),JSON[_0x8a8a('0x11')](_0x576ef9));if(_0x576ef9[_0x8a8a('0x12')]){if(_0x576ef9['error'][_0x8a8a('0x13')]===0x1f4){logger[_0x8a8a('0x12')](_0x8a8a('0x14'),_0x1d7121,_0x576ef9[_0x8a8a('0x12')]['message']);return _0xecaa6f(_0x576ef9[_0x8a8a('0x12')]['message']);}logger[_0x8a8a('0x12')](_0x8a8a('0x14'),_0x1d7121,_0x576ef9[_0x8a8a('0x12')][_0x8a8a('0x15')]);return _0x4225b9(_0x576ef9[_0x8a8a('0x12')][_0x8a8a('0x15')]);}else{logger[_0x8a8a('0xe')]('WhatsappApplication,\x20%s,\x20%s',_0x1d7121,_0x8a8a('0xf'));_0x4225b9(_0x576ef9['result'][_0x8a8a('0x15')]);}})[_0x8a8a('0x16')](function(_0x46a4f4){logger[_0x8a8a('0x12')](_0x8a8a('0x14'),_0x1d7121,_0x46a4f4);_0xecaa6f(_0x46a4f4);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index edb1ddc..57c3e10 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 _0x4351=['whatsappinteraction:destroy','destroy','removeTags','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','index','/:id','show','/:id/messages','getMessages','download','post','/:id/tags','whatsappinteraction:addtags','put','tracked','whatsapp','whatsappinteraction:update','update','delete'];(function(_0x5e90d4,_0x4c5748){var _0x117c7e=function(_0x4afd35){while(--_0x4afd35){_0x5e90d4['push'](_0x5e90d4['shift']());}};_0x117c7e(++_0x4c5748);}(_0x4351,0x1b5));var _0x1435=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0x4351[_0x47b58b];return _0x46bebe;};'use strict';var multer=require(_0x1435('0x0'));var util=require(_0x1435('0x1'));var path=require(_0x1435('0x2'));var timeout=require(_0x1435('0x3'));var express=require(_0x1435('0x4'));var router=express[_0x1435('0x5')]();var fs_extra=require(_0x1435('0x6'));var auth=require(_0x1435('0x7'));var interaction=require(_0x1435('0x8'));var config=require(_0x1435('0x9'));var controller=require(_0x1435('0xa'));router[_0x1435('0xb')]('/',auth[_0x1435('0xc')](),controller[_0x1435('0xd')]);router[_0x1435('0xb')]('/describe',auth[_0x1435('0xc')](),controller['describe']);router['get'](_0x1435('0xe'),auth[_0x1435('0xc')](),controller[_0x1435('0xf')]);router[_0x1435('0xb')](_0x1435('0x10'),auth['isAuthenticated'](),controller[_0x1435('0x11')]);router[_0x1435('0xb')]('/:id/download',auth['isAuthenticated'](),controller[_0x1435('0x12')]);router['post']('/',auth[_0x1435('0xc')](),controller['create']);router[_0x1435('0x13')]('/:id/messages',auth['isAuthenticated'](),controller['addMessage']);router[_0x1435('0x13')](_0x1435('0x14'),auth[_0x1435('0xc')](),interaction['tracked']('whatsapp',_0x1435('0x15')),controller['addTags']);router[_0x1435('0x16')](_0x1435('0xe'),auth[_0x1435('0xc')](),interaction[_0x1435('0x17')](_0x1435('0x18'),_0x1435('0x19')),controller[_0x1435('0x1a')]);router[_0x1435('0x1b')](_0x1435('0xe'),auth[_0x1435('0xc')](),interaction[_0x1435('0x17')](_0x1435('0x18'),_0x1435('0x1c')),controller[_0x1435('0x1d')]);router[_0x1435('0x1b')]('/:id/tags',auth[_0x1435('0xc')](),controller[_0x1435('0x1e')]);module['exports']=router; \ No newline at end of file +var _0x3eea=['/:id/download','create','post','addMessage','/:id/tags','tracked','whatsapp','addTags','put','whatsappinteraction:update','update','delete','whatsappinteraction:destroy','destroy','removeTags','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/messages','getMessages'];(function(_0x4ae1bc,_0x4cd286){var _0x30d8c2=function(_0x5aa02b){while(--_0x5aa02b){_0x4ae1bc['push'](_0x4ae1bc['shift']());}};_0x30d8c2(++_0x4cd286);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x19812a,_0x236183){_0x19812a=_0x19812a-0x0;var _0x12cac4=_0x3eea[_0x19812a];return _0x12cac4;};'use strict';var multer=require(_0xa3ee('0x0'));var util=require('util');var path=require(_0xa3ee('0x1'));var timeout=require(_0xa3ee('0x2'));var express=require(_0xa3ee('0x3'));var router=express[_0xa3ee('0x4')]();var fs_extra=require(_0xa3ee('0x5'));var auth=require(_0xa3ee('0x6'));var interaction=require(_0xa3ee('0x7'));var config=require(_0xa3ee('0x8'));var controller=require(_0xa3ee('0x9'));router[_0xa3ee('0xa')]('/',auth[_0xa3ee('0xb')](),controller['index']);router['get'](_0xa3ee('0xc'),auth['isAuthenticated'](),controller[_0xa3ee('0xd')]);router['get'](_0xa3ee('0xe'),auth['isAuthenticated'](),controller[_0xa3ee('0xf')]);router['get'](_0xa3ee('0x10'),auth[_0xa3ee('0xb')](),controller[_0xa3ee('0x11')]);router['get'](_0xa3ee('0x12'),auth[_0xa3ee('0xb')](),controller['download']);router['post']('/',auth[_0xa3ee('0xb')](),controller[_0xa3ee('0x13')]);router[_0xa3ee('0x14')](_0xa3ee('0x10'),auth['isAuthenticated'](),controller[_0xa3ee('0x15')]);router['post'](_0xa3ee('0x16'),auth[_0xa3ee('0xb')](),interaction[_0xa3ee('0x17')](_0xa3ee('0x18'),'whatsappinteraction:addtags'),controller[_0xa3ee('0x19')]);router[_0xa3ee('0x1a')]('/:id',auth['isAuthenticated'](),interaction['tracked'](_0xa3ee('0x18'),_0xa3ee('0x1b')),controller[_0xa3ee('0x1c')]);router[_0xa3ee('0x1d')]('/:id',auth[_0xa3ee('0xb')](),interaction[_0xa3ee('0x17')](_0xa3ee('0x18'),_0xa3ee('0x1e')),controller[_0xa3ee('0x1f')]);router['delete'](_0xa3ee('0x16'),auth[_0xa3ee('0xb')](),controller[_0xa3ee('0x20')]);module[_0xa3ee('0x21')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 790e601..a3a8bb6 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 _0x1561=['out','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0xb4f45e,_0x12a099){var _0x4795cd=function(_0x4dfd66){while(--_0x4dfd66){_0xb4f45e['push'](_0xb4f45e['shift']());}};_0x4795cd(++_0x12a099);}(_0x1561,0x1bd));var _0x1156=function(_0x4af285,_0x22dd16){_0x4af285=_0x4af285-0x0;var _0x1939ff=_0x1561[_0x4af285];return _0x1939ff;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x1156('0x0')]={'closed':{'type':Sequelize[_0x1156('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x1156('0x2')]},'disposition':{'type':Sequelize[_0x1156('0x3')]},'secondDisposition':{'type':Sequelize[_0x1156('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x1156('0x3')]},'phone':{'type':Sequelize[_0x1156('0x3')]},'read1stAt':{'type':Sequelize[_0x1156('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x1156('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x1156('0x2')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x1156('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x1156('0x1')],'defaultValue':![]}}; \ No newline at end of file +var _0x68f5=['out','BOOLEAN','sequelize','moment','exports','DATE','STRING','ENUM'];(function(_0x483888,_0x2ff778){var _0x4be161=function(_0x1c1915){while(--_0x1c1915){_0x483888['push'](_0x483888['shift']());}};_0x4be161(++_0x2ff778);}(_0x68f5,0x11a));var _0x568f=function(_0x208d90,_0x49b474){_0x208d90=_0x208d90-0x0;var _0x3141be=_0x68f5[_0x208d90];return _0x3141be;};'use strict';var Sequelize=require(_0x568f('0x0'));var moment=require(_0x568f('0x1'));module[_0x568f('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x568f('0x3')]},'disposition':{'type':Sequelize[_0x568f('0x4')]},'secondDisposition':{'type':Sequelize[_0x568f('0x4')]},'thirdDisposition':{'type':Sequelize[_0x568f('0x4')]},'note':{'type':Sequelize[_0x568f('0x4')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x568f('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x568f('0x5')]('in',_0x568f('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x568f('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x568f('0x7')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index a74092e..61341be 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 _0xf185=['../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','status','end','json','undefined','limit','count','offset','set','save','then','destroy','sendStatus','stack','send','Users','map','fullname','TagIds','Tags','split','push','index','WhatsappInteraction','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','order','sort','where','pick','select','field','name','color','from','tools_tags','u.fullname','ui.WhatsappInteractionId','user_has_whatsapp_interactions','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','expr','search','parseSearch','sqlOperator','length','conditions','find','unreadMessages','value','having','`\x20>\x200','Contact','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','text','start','body','type','keys','some','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','isEmpty','t.id\x20IN\x20?','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','WhatsappAccountId','sequelize','toString','keyBy','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.lastName','Contact.email','c.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','groupBy','WhatsappInteractionId','all','rows','catch','show','params','includeAll','merge','options','create','update','describe','WhatsappMessage','addMessage','ids','getMessages','findOne','hasOwnProperty','nolimit','format','YYYY-MM-DD\x20HH:mm:ss','include','findAll','addTags','omit','spread','emit','removeTags','download','unix','join','server','files','root','attachments','transcript-%d-%s.zip','CmContact','firstName','lastName','secret','WhatsappAccount','Account','Owner','mkdirSync','Whatsapp','N.A.','closed','Messages','Attachment','basename','existsSync','createWriteStream','direction','out','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../components/export/pdf','api','../../config/utils','../../config/environment'];(function(_0x39f97c,_0x1afe73){var _0x4342e3=function(_0x51d771){while(--_0x51d771){_0x39f97c['push'](_0x39f97c['shift']());}};_0x4342e3(++_0x1afe73);}(_0xf185,0x1be));var _0x5f18=function(_0x5e6f46,_0x5de343){_0x5e6f46=_0x5e6f46-0x0;var _0x2c86f6=_0xf185[_0x5e6f46];return _0x2c86f6;};'use strict';var emlformat=require(_0x5f18('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5f18('0x1'));var jsonpatch=require(_0x5f18('0x2'));var rp=require(_0x5f18('0x3'));var moment=require(_0x5f18('0x4'));var BPromise=require(_0x5f18('0x5'));var Mustache=require(_0x5f18('0x6'));var util=require('util');var path=require(_0x5f18('0x7'));var sox=require(_0x5f18('0x8'));var csv=require(_0x5f18('0x9'));var ejs=require(_0x5f18('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5f18('0xb'));var squel=require(_0x5f18('0xc'));var crypto=require('crypto');var jsforce=require(_0x5f18('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x5f18('0x9'));var querystring=require(_0x5f18('0xe'));var Papa=require('papaparse');var Redis=require(_0x5f18('0xf'));var authService=require(_0x5f18('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x5f18('0x11'));var pdf=require(_0x5f18('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5f18('0x13'));var utils=require(_0x5f18('0x14'));var config=require(_0x5f18('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x5f18('0x16'))['db'];config[_0x5f18('0x17')]=_[_0x5f18('0x18')](config[_0x5f18('0x17')],{'host':_0x5f18('0x19'),'port':0x18eb});var socket=require(_0x5f18('0x1a'))(new Redis(config[_0x5f18('0x17')]));require(_0x5f18('0x1b'))[_0x5f18('0x1c')](socket);function respondWithStatusCode(_0x4a8150,_0x28e6ad){_0x28e6ad=_0x28e6ad||0xcc;return function(_0x51dbc3){if(_0x51dbc3){return _0x4a8150['sendStatus'](_0x28e6ad);}return _0x4a8150[_0x5f18('0x1d')](_0x28e6ad)[_0x5f18('0x1e')]();};}function respondWithResult(_0x12b0c1,_0x418048){_0x418048=_0x418048||0xc8;return function(_0x337ec1){if(_0x337ec1){return _0x12b0c1['status'](_0x418048)[_0x5f18('0x1f')](_0x337ec1);}};}function respondWithFilteredResult(_0x45cc93,_0x110916){return function(_0x2a0bb2){if(_0x2a0bb2){var _0x1d3aac=typeof _0x110916['offset']===_0x5f18('0x20')&&typeof _0x110916[_0x5f18('0x21')]===_0x5f18('0x20');var _0x53d6a4=_0x2a0bb2[_0x5f18('0x22')];var _0x14a1c2=_0x1d3aac?0x0:_0x110916['offset'];var _0x5f1562=_0x1d3aac?_0x2a0bb2[_0x5f18('0x22')]:_0x110916[_0x5f18('0x23')]+_0x110916[_0x5f18('0x21')];var _0x265093;if(_0x5f1562>=_0x53d6a4){_0x5f1562=_0x53d6a4;_0x265093=0xc8;}else{_0x265093=0xce;}_0x45cc93[_0x5f18('0x1d')](_0x265093);return _0x45cc93[_0x5f18('0x24')]('Content-Range',_0x14a1c2+'-'+_0x5f1562+'/'+_0x53d6a4)['json'](_0x2a0bb2);}return null;};}function patchUpdates(_0x36509a){return function(_0x8b8dad){try{jsonpatch['apply'](_0x8b8dad,_0x36509a,!![]);}catch(_0x29552c){return BPromise['reject'](_0x29552c);}return _0x8b8dad[_0x5f18('0x25')]();};}function saveUpdates(_0x50519a,_0x531821){return function(_0x384f55){if(_0x384f55){return _0x384f55['update'](_0x50519a)[_0x5f18('0x26')](function(_0x4a2357){return _0x4a2357;});}return null;};}function removeEntity(_0x394161,_0x463710){return function(_0x34b180){if(_0x34b180){return _0x34b180[_0x5f18('0x27')]()['then'](function(){_0x394161[_0x5f18('0x1d')](0xcc)[_0x5f18('0x1e')]();});}};}function handleEntityNotFound(_0xbbdb71,_0x20c580){return function(_0xd1340b){if(!_0xd1340b){_0xbbdb71[_0x5f18('0x28')](0x194);}return _0xd1340b;};}function handleError(_0x195f55,_0x15f5d8){_0x15f5d8=_0x15f5d8||0x1f4;return function(_0x37e766){logger['error'](_0x37e766[_0x5f18('0x29')]);if(_0x37e766['name']){delete _0x37e766['name'];}_0x195f55[_0x5f18('0x1d')](_0x15f5d8)[_0x5f18('0x2a')](_0x37e766);};}function getInteractionUsers(_0x172a4d,_0x5a4078){return new BPromise(function(_0x56617c,_0x14b545){try{if(_0x5a4078[_0x172a4d['id']]){_0x172a4d[_0x5f18('0x2b')]=_[_0x5f18('0x2c')](_0x5a4078[_0x172a4d['id']],function(_0x487b0e){return{'id':_0x487b0e['id'],'fullname':_0x487b0e[_0x5f18('0x2d')]};});}}catch(_0x262dbb){_0x14b545(_0x262dbb);}_0x56617c(_0x172a4d);});}function getInteractionTags(_0x449616,_0x5c7014){return new BPromise(function(_0x357954,_0x1d72a7){try{if(_0x449616[_0x5f18('0x2e')]){_0x449616[_0x5f18('0x2f')]=[];_0x449616['TagIds'][_0x5f18('0x30')](',')['forEach'](function(_0x2ac062){_0x449616[_0x5f18('0x2f')][_0x5f18('0x31')](_0x5c7014[_0x2ac062]);});}delete _0x449616[_0x5f18('0x2e')];}catch(_0x22afbb){_0x1d72a7(_0x22afbb);}_0x357954(_0x449616);});}function updateWhatsappInteraction(_0x6ff34e,_0x3d1083,_0x15962e){return new BPromise(function(_0x5b6aaa,_0x276548){return getInteractionUsers(_0x6ff34e,_0x15962e)['then'](function(_0x186e65){return getInteractionTags(_0x186e65,_0x3d1083);})[_0x5f18('0x26')](function(_0x224b45){_0x5b6aaa(_0x224b45);})['catch'](function(_0x52d55d){_0x276548(_0x52d55d);});});}exports[_0x5f18('0x32')]=function(_0x2dc1ef,_0x24fa0f){var _0x34a15b={},_0xece6e8={},_0x2fd94a={'count':0x0,'rows':[]};var _0x483217=_[_0x5f18('0x2c')](db[_0x5f18('0x33')][_0x5f18('0x34')],function(_0x501b28){return{'name':_0x501b28[_0x5f18('0x35')],'type':_0x501b28['type']['key']};});_0xece6e8[_0x5f18('0x36')]=_[_0x5f18('0x2c')](_0x483217,'name');_0xece6e8[_0x5f18('0x37')]=_['keys'](_0x2dc1ef[_0x5f18('0x37')]);_0xece6e8[_0x5f18('0x38')]=_[_0x5f18('0x39')](_0xece6e8[_0x5f18('0x36')],_0xece6e8['query']);_0x34a15b[_0x5f18('0x3a')]=_[_0x5f18('0x39')](_0xece6e8[_0x5f18('0x36')],qs['fields'](_0x2dc1ef[_0x5f18('0x37')][_0x5f18('0x3b')]));_0x34a15b[_0x5f18('0x3a')]=_0x34a15b[_0x5f18('0x3a')]['length']?_0x34a15b[_0x5f18('0x3a')]:_0xece6e8[_0x5f18('0x36')];if(!_0x2dc1ef[_0x5f18('0x37')]['hasOwnProperty']('nolimit')){_0x34a15b[_0x5f18('0x21')]=qs[_0x5f18('0x21')](_0x2dc1ef[_0x5f18('0x37')][_0x5f18('0x21')]);_0x34a15b[_0x5f18('0x23')]=qs['offset'](_0x2dc1ef[_0x5f18('0x37')][_0x5f18('0x23')]);}_0x34a15b[_0x5f18('0x3c')]=qs[_0x5f18('0x3d')](_0x2dc1ef['query'][_0x5f18('0x3d')]);_0x34a15b[_0x5f18('0x3e')]=qs[_0x5f18('0x38')](_[_0x5f18('0x3f')](_0x2dc1ef[_0x5f18('0x37')],_0xece6e8[_0x5f18('0x38')]),_0x483217);var _0x4bd555=[];var _0xf468cf=squel[_0x5f18('0x40')]()[_0x5f18('0x41')]('id')[_0x5f18('0x41')](_0x5f18('0x42'))[_0x5f18('0x41')](_0x5f18('0x43'))[_0x5f18('0x44')](_0x5f18('0x45'));var _0x364455=squel[_0x5f18('0x40')]()['field']('u.id')[_0x5f18('0x41')](_0x5f18('0x46'))[_0x5f18('0x41')](_0x5f18('0x47'))['from'](_0x5f18('0x48'),'ui')['left_join'](_0x5f18('0x49'),'u',_0x5f18('0x4a'));var _0x4869b7=squel[_0x5f18('0x40')]()[_0x5f18('0x44')](_0x5f18('0x4b'),'i')[_0x5f18('0x4c')](_0x5f18('0x4d'),'c',_0x5f18('0x4e'))[_0x5f18('0x4c')]('users','o',_0x5f18('0x4f'))[_0x5f18('0x4c')](_0x5f18('0x50'),'a',_0x5f18('0x51'))[_0x5f18('0x4c')](_0x5f18('0x52'),'me','me.WhatsappInteractionId\x20=\x20i.id')['left_join'](_0x5f18('0x53'),'it',_0x5f18('0x54'))[_0x5f18('0x4c')](_0x5f18('0x45'),'t','t.id\x20=\x20it.TagId');var _0x129e6b=squel[_0x5f18('0x55')]();var _0x173e70=[];var _0xac94f=squel[_0x5f18('0x55')]();var _0x3ff73d;if(_0x2dc1ef[_0x5f18('0x37')][_0x5f18('0x56')]){_0x3ff73d=as[_0x5f18('0x57')](_0x2dc1ef[_0x5f18('0x37')]['search']);var _0x1f45b3=_0x3ff73d[_0x5f18('0x58')];for(var _0x31b989=0x0;_0x31b989<_0x3ff73d['conditions'][_0x5f18('0x59')];_0x31b989++){var _0x5381b9=_0x3ff73d[_0x5f18('0x5a')][_0x31b989];var _0x154cbd='i';var _0x4b12a0=_[_0x5f18('0x5b')](_0x483217,[_0x5f18('0x42'),_0x5381b9[_0x5f18('0x41')]]);if(!_0x4b12a0){switch(_0x5381b9[_0x5f18('0x41')]){case _0x5f18('0x5c'):if(_0x5381b9[_0x5f18('0x5d')]==0x1){_0x4869b7[_0x5f18('0x5e')]('`'+_0x5381b9['field']+'`\x20=\x200');}else{_0x4869b7[_0x5f18('0x5e')]('`'+_0x5381b9[_0x5f18('0x41')]+_0x5f18('0x5f'));}break;case _0x5f18('0x60'):if(_0x5381b9['operator']===_0x5f18('0x61')){if(_0x5381b9[_0x5f18('0x5d')][_0x5f18('0x30')]('\x20')[_0x5f18('0x59')]>0x1){_0x129e6b[_0x1f45b3](_0x5f18('0x62'),qs['getFullTextValue'](_0x5381b9[_0x5f18('0x5d')]),null);}else{var _0x1e792d='%'+_0x5381b9['value']+'%';_0x129e6b[_0x1f45b3](_0x5f18('0x63'),_0x1e792d,_0x1e792d,_0x1e792d);}}else{_0x4b12a0=_[_0x5f18('0x5b')](_0x483217,[_0x5f18('0x42'),_0x5f18('0x64')]);_0x5381b9[_0x5f18('0x41')]=_0x5f18('0x64');_0x34f2ff=as['buildExpression'](_0x154cbd,_0x4b12a0['type'],_0x5381b9);_0x129e6b[_0x1f45b3](_0x34f2ff['text'],_0x34f2ff['value']['start'],_0x34f2ff[_0x5f18('0x5d')][_0x5f18('0x1e')]);}break;case _0x5f18('0x65'):var _0x1a8d76=_0x5381b9[_0x5f18('0x5d')][_0x5f18('0x30')](',')[_0x5f18('0x2c')](function(_0x68555f){return Number(_0x68555f);});_0x1a8d76[_0x5f18('0x66')](function(_0x56ae82){_0xac94f['or'](_0x5f18('0x67'),'%,'+_0x56ae82+',%');});_0x173e70=_[_0x5f18('0x68')](_0x173e70,_0x1a8d76);break;case _0x5f18('0x69'):if(_0x5381b9['operator']===_0x5f18('0x61')){_0x129e6b[_0x1f45b3](_0x5f18('0x6a'),'%'+_0x5381b9[_0x5f18('0x5d')]+'%',null);}else{_0x4b12a0=_[_0x5f18('0x5b')](_0x483217,[_0x5f18('0x42'),_0x5f18('0x6b')]);_0x5381b9[_0x5f18('0x41')]=_0x5f18('0x6b');_0x34f2ff=as[_0x5f18('0x6c')](_0x154cbd,_0x4b12a0['type'],_0x5381b9);_0x129e6b[_0x1f45b3](_0x34f2ff[_0x5f18('0x6d')],_0x34f2ff[_0x5f18('0x5d')][_0x5f18('0x6e')],_0x34f2ff['value'][_0x5f18('0x1e')]);}break;case _0x5f18('0x6f'):_0x34f2ff=as['buildExpression']('me',null,_0x5381b9);_0x129e6b[_0x1f45b3](_0x34f2ff[_0x5f18('0x6d')],_0x34f2ff[_0x5f18('0x5d')][_0x5f18('0x6e')],_0x34f2ff[_0x5f18('0x5d')][_0x5f18('0x1e')]);break;}}else{var _0x34f2ff=as[_0x5f18('0x6c')](_0x154cbd,_0x4b12a0[_0x5f18('0x70')],_0x5381b9);_0x129e6b[_0x1f45b3](_0x34f2ff[_0x5f18('0x6d')],_0x34f2ff[_0x5f18('0x5d')][_0x5f18('0x6e')],_0x34f2ff[_0x5f18('0x5d')][_0x5f18('0x1e')]);}}}else{var _0x2394e1=_(_0x2dc1ef[_0x5f18('0x37')])[_0x5f18('0x71')]()['map'](function(_0x48536b){return _[_0x5f18('0x72')](_0x483217,[_0x5f18('0x42'),_0x48536b])?_0x48536b:undefined;})['compact']()[_0x5f18('0x5d')]();if(!_['isEmpty'](_0x2394e1)){_0x2394e1['forEach'](function(_0x289215){if(_0x289215==='WhatsappAccountId'){_0x4869b7['where'](_0x5f18('0x73'),[][_0x5f18('0x74')](_0x2dc1ef[_0x5f18('0x37')][_0x289215]));}else if(_0x289215===_0x5f18('0x75')){var _0x3f696b=JSON[_0x5f18('0x76')](_0x2dc1ef['query'][_0x289215])[_0x5f18('0x77')];var _0xf8fdf8=JSON[_0x5f18('0x76')](_0x2dc1ef[_0x5f18('0x37')][_0x289215])[_0x5f18('0x78')];_0x4869b7[_0x5f18('0x3e')](_0x5f18('0x79'),_0x3f696b,_0xf8fdf8);}else{if(_0x2dc1ef[_0x5f18('0x37')][_0x289215]==='null'){_0x4869b7[_0x5f18('0x3e')]('i.'+_0x289215+_0x5f18('0x7a'));}else{_0x4869b7[_0x5f18('0x3e')]('i.'+_0x289215+_0x5f18('0x7b'),_0x2dc1ef[_0x5f18('0x37')][_0x289215]);}}});}if(_0x2dc1ef[_0x5f18('0x37')][_0x5f18('0x7c')]){if(_0x2dc1ef[_0x5f18('0x37')][_0x5f18('0x7c')]==0x1){_0x4869b7['having'](_0x5f18('0x7d'));}else{_0x4869b7[_0x5f18('0x5e')](_0x5f18('0x7e'));}}if(_0x2dc1ef['query'][_0x5f18('0x7f')]){_0x173e70=_[_0x5f18('0x80')](_0x2dc1ef[_0x5f18('0x37')]['tag'])?_0x2dc1ef[_0x5f18('0x37')][_0x5f18('0x7f')]:new Array(_0x2dc1ef[_0x5f18('0x37')][_0x5f18('0x7f')]);_0x173e70[_0x5f18('0x66')](function(_0x2e3025){_0xac94f['or'](_0x5f18('0x67'),'%,'+_0x2e3025+',%');});}if(_0x2dc1ef[_0x5f18('0x37')]['filter']){var _0x31c1e9=_0x2dc1ef[_0x5f18('0x37')][_0x5f18('0x81')]['replace']('\x5c','\x5c\x5c')[_0x5f18('0x82')](/'/g,'\x27\x27');if(qs[_0x5f18('0x83')](_0x31c1e9)){_0x129e6b['or']('i.id\x20LIKE\x20?',_0x31c1e9+'%')['or'](_0x5f18('0x84'),_0x31c1e9+'%');}else{_0x129e6b['or'](_0x5f18('0x85'),qs['getFullTextValue'](_0x31c1e9))['or'](_0x5f18('0x86'),_0x31c1e9+'%');}}}_0x4869b7[_0x5f18('0x3e')](_0x129e6b);_0x4869b7[_0x5f18('0x87')](_0x5f18('0x88'));var _0x483d03={'type':db['Sequelize'][_0x5f18('0x89')][_0x5f18('0x8a')],'raw':!![]};var _0x3132f8=_0x4869b7[_0x5f18('0x8b')]();_0x3132f8[_0x5f18('0x41')](_0x5f18('0x88'));_0x3132f8[_0x5f18('0x41')](_0x5f18('0x8c'),_0x5f18('0x5c'));if(_0x34a15b[_0x5f18('0x3c')]){_0x34a15b[_0x5f18('0x3c')][_0x5f18('0x66')](function(_0x2c7966){var _0x472188=_0x2c7966[0x0]===_0x5f18('0x8d')?_0x2c7966[0x0]:'i.'+_0x2c7966[0x0];_0x4869b7[_0x5f18('0x3c')](_0x472188,_0x2c7966[0x1]===_0x5f18('0x8e')?![]:!![]);});}if(!_[_0x5f18('0x8f')](_0x173e70)){_0x4869b7['having'](_0xac94f);_0x3132f8[_0x5f18('0x3e')](_0x5f18('0x90'),_0x173e70);}BPromise[_0x5f18('0x91')]()[_0x5f18('0x26')](function(){if(!_0x3ff73d){if(_0x2dc1ef['query']['WhatsappAccountId'])return;_0x3132f8[_0x5f18('0x3e')](_0x5f18('0x92'));_0x4869b7['where'](_0x5f18('0x92'));return;}if(_0x2dc1ef[_0x5f18('0x93')][_0x5f18('0x94')]!==_0x5f18('0x95'))return;return _0x2dc1ef[_0x5f18('0x93')][_0x5f18('0x96')]({'attributes':['id'],'raw':!![]})['then'](function(_0x4d5766){if(_[_0x5f18('0x8f')](_0x4d5766)){_0x3132f8['where'](_0x5f18('0x97'));_0x4869b7['where'](_0x5f18('0x97'));}else{_0x3132f8[_0x5f18('0x3e')](_0x5f18('0x73'),_[_0x5f18('0x2c')](_0x4d5766,'id'));_0x4869b7[_0x5f18('0x3e')]('i.WhatsappAccountId\x20IN\x20?',_[_0x5f18('0x2c')](_0x4d5766,'id'));}});})[_0x5f18('0x26')](function(){if(_0x2dc1ef[_0x5f18('0x93')][_0x5f18('0x94')]===_0x5f18('0x95')&&!_0x3ff73d&&!_0x2dc1ef[_0x5f18('0x37')][_0x5f18('0x98')])return[];return db[_0x5f18('0x99')][_0x5f18('0x37')](_0x3132f8[_0x5f18('0x9a')](),_0x483d03);})[_0x5f18('0x26')](function(_0x4c59c4){_0x2fd94a[_0x5f18('0x22')]=_0x4c59c4[_0x5f18('0x59')];if(_0x2fd94a['count']===0x0)return[];return db['sequelize'][_0x5f18('0x37')](_0xf468cf[_0x5f18('0x9a')](),_0x483d03)[_0x5f18('0x26')](function(_0x557e17){_0x4bd555=_[_0x5f18('0x9b')](_0x557e17,'id');_0x483d03=_['merge'](_0x483d03,{'model':db[_0x5f18('0x33')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2dc1ef[_0x5f18('0x37')][_0x5f18('0x3b')]){_0x34a15b['attributes'][_0x5f18('0x66')](function(_0x18376e){_0x4869b7[_0x5f18('0x41')]('i.'+_0x18376e);});}else{_0x4869b7[_0x5f18('0x41')](_0x5f18('0x8c'),_0x5f18('0x5c'));_0x4869b7[_0x5f18('0x41')](_0x5f18('0x9c'),_0x5f18('0x9d'));_0x4869b7[_0x5f18('0x41')]('a.mandatoryDisposition',_0x5f18('0x9e'));_0x4869b7['field'](_0x5f18('0x9f'),_0x5f18('0x8d'));_0x4869b7[_0x5f18('0x41')](_0x5f18('0xa0'));_0x4869b7[_0x5f18('0x41')]('c.firstName','Contact.firstName');_0x4869b7[_0x5f18('0x41')](_0x5f18('0xa1'),'Contact.lastName');_0x4869b7[_0x5f18('0x41')]('c.email',_0x5f18('0xa2'));_0x4869b7[_0x5f18('0x41')](_0x5f18('0xa3'),'Contact.phone');_0x4869b7[_0x5f18('0x41')](_0x5f18('0xa4'),_0x5f18('0xa5'));_0x4869b7[_0x5f18('0x41')]('c.fax',_0x5f18('0xa6'));_0x4869b7[_0x5f18('0x41')](_0x5f18('0xa7'),_0x5f18('0xa8'));_0x4869b7[_0x5f18('0x41')]('o.internal',_0x5f18('0xa9'));_0x4869b7[_0x5f18('0x41')](_0x5f18('0xaa'),'TagIds');}if(_0x34a15b[_0x5f18('0x21')])_0x4869b7[_0x5f18('0x21')](_0x34a15b[_0x5f18('0x21')]);if(_0x34a15b[_0x5f18('0x23')])_0x4869b7[_0x5f18('0x23')](_0x34a15b[_0x5f18('0x23')]);return db[_0x5f18('0x99')][_0x5f18('0x37')](_0x4869b7[_0x5f18('0x9a')](),_0x483d03);})[_0x5f18('0x26')](function(_0x36911d){if(_0x36911d[_0x5f18('0x59')]>0x0)_0x364455[_0x5f18('0x3e')](_0x5f18('0xab'),_['map'](_0x36911d,'id'));return db[_0x5f18('0x99')][_0x5f18('0x37')](_0x364455[_0x5f18('0x9a')](),_0x483d03)[_0x5f18('0x26')](function(_0x51937d){var _0x2a958c=_[_0x5f18('0xac')](_0x51937d,_0x5f18('0xad'));var _0x3471ac=[];_0x36911d[_0x5f18('0x66')](function(_0xd25cd0){_0x3471ac['push'](updateWhatsappInteraction(_0xd25cd0,_0x4bd555,_0x2a958c));});return BPromise[_0x5f18('0xae')](_0x3471ac);});});})[_0x5f18('0x26')](function(_0x55feec){_0x2fd94a[_0x5f18('0xaf')]=_0x55feec;return _0x2fd94a;})[_0x5f18('0x26')](respondWithFilteredResult(_0x24fa0f,_0x34a15b))[_0x5f18('0xb0')](handleError(_0x24fa0f,null));};exports[_0x5f18('0xb1')]=function(_0x4c8186,_0x18487f){var _0xc212e7={'raw':![],'where':{'id':_0x4c8186[_0x5f18('0xb2')]['id']}},_0x59b1ba={};_0x59b1ba[_0x5f18('0x36')]=_[_0x5f18('0x71')](db[_0x5f18('0x33')]['rawAttributes']);_0x59b1ba[_0x5f18('0x37')]=_[_0x5f18('0x71')](_0x4c8186['query']);_0x59b1ba['filters']=_['intersection'](_0x59b1ba[_0x5f18('0x36')],_0x59b1ba['query']);_0xc212e7[_0x5f18('0x3a')]=_[_0x5f18('0x39')](_0x59b1ba[_0x5f18('0x36')],qs[_0x5f18('0x3b')](_0x4c8186[_0x5f18('0x37')]['fields']));_0xc212e7[_0x5f18('0x3a')]=_0xc212e7[_0x5f18('0x3a')][_0x5f18('0x59')]?_0xc212e7[_0x5f18('0x3a')]:_0x59b1ba['model'];if(_0x4c8186['query'][_0x5f18('0xb3')]){_0xc212e7['include']=[{'all':!![]}];}_0xc212e7=_[_0x5f18('0xb4')]({},_0xc212e7,_0x4c8186[_0x5f18('0xb5')]);return db[_0x5f18('0x33')][_0x5f18('0x5b')](_0xc212e7)['then'](handleEntityNotFound(_0x18487f,null))[_0x5f18('0x26')](respondWithResult(_0x18487f,null))[_0x5f18('0xb0')](handleError(_0x18487f,null));};exports[_0x5f18('0xb6')]=function(_0x2ca02d,_0x4c1616){return db[_0x5f18('0x33')]['create'](_0x2ca02d[_0x5f18('0x6f')],{})['then'](respondWithResult(_0x4c1616,0xc9))['catch'](handleError(_0x4c1616,null));};exports[_0x5f18('0xb7')]=function(_0x336ab0,_0x56154f){if(_0x336ab0[_0x5f18('0x6f')]['id']){delete _0x336ab0[_0x5f18('0x6f')]['id'];}return db[_0x5f18('0x33')][_0x5f18('0x5b')]({'where':{'id':_0x336ab0[_0x5f18('0xb2')]['id']}})[_0x5f18('0x26')](handleEntityNotFound(_0x56154f,null))[_0x5f18('0x26')](saveUpdates(_0x336ab0[_0x5f18('0x6f')],null))[_0x5f18('0x26')](respondWithResult(_0x56154f,null))[_0x5f18('0xb0')](handleError(_0x56154f,null));};exports['destroy']=function(_0x180945,_0x41032d){return db[_0x5f18('0x33')][_0x5f18('0x5b')]({'where':{'id':_0x180945[_0x5f18('0xb2')]['id']}})[_0x5f18('0x26')](handleEntityNotFound(_0x41032d,null))[_0x5f18('0x26')](removeEntity(_0x41032d,null))['catch'](handleError(_0x41032d,null));};exports[_0x5f18('0xb8')]=function(_0xf51216,_0x5e9765){return db[_0x5f18('0x33')][_0x5f18('0xb8')]()['then'](respondWithResult(_0x5e9765,null))[_0x5f18('0xb0')](handleError(_0x5e9765,null));};exports['addMessage']=function(_0x319c4e,_0x2b4e5b,_0x36904c){return db[_0x5f18('0xb9')][_0x5f18('0x5b')]({'where':{'id':_0x319c4e['params']['id']}})[_0x5f18('0x26')](handleEntityNotFound(_0x2b4e5b,null))[_0x5f18('0x26')](function(_0x467e18){if(_0x467e18){return _0x467e18[_0x5f18('0xba')](_0x319c4e['body'][_0x5f18('0xbb')],_['omit'](_0x319c4e[_0x5f18('0x6f')],['ids','id'])||{});}})[_0x5f18('0x26')](respondWithResult(_0x2b4e5b,null))['catch'](handleError(_0x2b4e5b,null));};exports[_0x5f18('0xbc')]=function(_0x4e21b2,_0x4a0cb0,_0x6d129a){var _0x119000={'raw':![],'where':{}};var _0x9e3ed3={};var _0x1080b3={'count':0x0,'rows':[]};return db[_0x5f18('0x33')][_0x5f18('0xbd')]({'where':{'id':_0x4e21b2[_0x5f18('0xb2')]['id']}})['then'](handleEntityNotFound(_0x4a0cb0,null))[_0x5f18('0x26')](function(_0x2518bf){if(_0x2518bf){_0x9e3ed3[_0x5f18('0x36')]=_[_0x5f18('0x71')](db[_0x5f18('0xb9')][_0x5f18('0x34')]);_0x9e3ed3[_0x5f18('0x37')]=_[_0x5f18('0x71')](_0x4e21b2[_0x5f18('0x37')]);_0x9e3ed3['filters']=_['intersection'](_0x9e3ed3[_0x5f18('0x36')],_0x9e3ed3[_0x5f18('0x37')]);_0x119000[_0x5f18('0x3a')]=_[_0x5f18('0x39')](_0x9e3ed3[_0x5f18('0x36')],qs['fields'](_0x4e21b2['query'][_0x5f18('0x3b')]));_0x119000[_0x5f18('0x3a')]=_0x119000[_0x5f18('0x3a')][_0x5f18('0x59')]?_0x119000['attributes']:_0x9e3ed3['model'];if(!_0x4e21b2[_0x5f18('0x37')][_0x5f18('0xbe')](_0x5f18('0xbf'))){_0x119000[_0x5f18('0x21')]=qs['limit'](_0x4e21b2[_0x5f18('0x37')][_0x5f18('0x21')]);_0x119000[_0x5f18('0x23')]=qs['offset'](_0x4e21b2['query'][_0x5f18('0x23')]);}_0x119000[_0x5f18('0x3c')]=qs['sort'](_0x4e21b2[_0x5f18('0x37')][_0x5f18('0x3d')]);_0x119000[_0x5f18('0x3e')]=qs[_0x5f18('0x38')](_[_0x5f18('0x3f')](_0x4e21b2[_0x5f18('0x37')],_0x9e3ed3['filters']));_0x119000['where'][_0x5f18('0xad')]=_0x2518bf['id'];if(_0x4e21b2['query'][_0x5f18('0x81')]){_0x119000[_0x5f18('0x3e')]=_['merge'](_0x119000[_0x5f18('0x3e')],{'$or':_[_0x5f18('0x2c')](_0x119000[_0x5f18('0x3a')],function(_0x5efc1c){var _0x58e0dc={};_0x58e0dc[_0x5efc1c]={'$like':'%'+_0x4e21b2[_0x5f18('0x37')][_0x5f18('0x81')]+'%'};return _0x58e0dc;})});}if(_0x4e21b2['query']['$gte']){var _0x16f810=_0x4e21b2[_0x5f18('0x37')][_0x5f18('0x77')]['split'](',');var _0x489656={};_0x489656[_0x16f810[0x0]]={'$gte':moment(_0x16f810[0x1])[_0x5f18('0xc0')](_0x5f18('0xc1'))};_0x119000['where']=_[_0x5f18('0xb4')](_0x119000['where'],_0x489656);}_0x119000=_['merge']({},_0x119000,_0x4e21b2[_0x5f18('0xb5')]);return db[_0x5f18('0xb9')][_0x5f18('0x22')]({'where':_0x119000[_0x5f18('0x3e')]})[_0x5f18('0x26')](function(_0x356296){_0x1080b3[_0x5f18('0x22')]=_0x356296;if(_0x4e21b2[_0x5f18('0x37')][_0x5f18('0xb3')]){_0x119000[_0x5f18('0xc2')]=[{'all':!![]}];}return db[_0x5f18('0xb9')][_0x5f18('0xc3')](_0x119000);})[_0x5f18('0x26')](function(_0x35b218){_0x1080b3[_0x5f18('0xaf')]=_0x35b218;return _0x1080b3;});}})[_0x5f18('0x26')](respondWithFilteredResult(_0x4a0cb0,_0x119000))['catch'](handleError(_0x4a0cb0,null));};exports[_0x5f18('0xc4')]=function(_0x1eb032,_0x28704d,_0x43db6e){return db[_0x5f18('0x33')][_0x5f18('0x5b')]({'where':{'id':_0x1eb032[_0x5f18('0xb2')]['id']}})[_0x5f18('0x26')](handleEntityNotFound(_0x28704d,null))['then'](function(_0x1eabd5){if(_0x1eabd5){return _0x1eabd5['setTags'](_0x1eb032[_0x5f18('0x6f')][_0x5f18('0xbb')],_[_0x5f18('0xc5')](_0x1eb032[_0x5f18('0x6f')],['ids','id'])||{})[_0x5f18('0xc6')](function(){return db[_0x5f18('0x65')][_0x5f18('0xc3')]({'attributes':['id',_0x5f18('0x42'),'color'],'where':{'id':_0x1eb032[_0x5f18('0x6f')][_0x5f18('0xbb')]}});})[_0x5f18('0x26')](function(_0x397d2d){socket[_0x5f18('0xc7')]('whatsappInteractionTags:save',{'id':Number(_0x1eb032[_0x5f18('0xb2')]['id']),'tags':_0x397d2d||[]});return{'id':Number(_0x1eb032[_0x5f18('0xb2')]['id']),'tags':_0x397d2d||[]};});}})[_0x5f18('0x26')](respondWithResult(_0x28704d,null))[_0x5f18('0xb0')](handleError(_0x28704d,null));};exports['removeTags']=function(_0x5e7b92,_0x369340,_0x3d02b3){return db[_0x5f18('0x33')][_0x5f18('0x5b')]({'where':{'id':_0x5e7b92[_0x5f18('0xb2')]['id']}})['then'](handleEntityNotFound(_0x369340,null))[_0x5f18('0x26')](function(_0xd57bb5){if(_0xd57bb5){return _0xd57bb5[_0x5f18('0xc8')](_0x5e7b92[_0x5f18('0x37')][_0x5f18('0xbb')]);}})[_0x5f18('0x26')](respondWithStatusCode(_0x369340,null))['catch'](handleError(_0x369340,null));};exports[_0x5f18('0xc9')]=function(_0x1126ce,_0x37cb4c){var _0x3c82d6=moment()[_0x5f18('0xca')]()[_0x5f18('0x9a')]();var _0x52d20f=path[_0x5f18('0xcb')](config['root'],_0x5f18('0xcc'),_0x5f18('0xcd'),'tmp');var _0x351cca=path[_0x5f18('0xcb')](config[_0x5f18('0xce')],_0x5f18('0xcc'),'files',_0x5f18('0xcf'));var _0x4db7f1=path[_0x5f18('0xcb')](_0x52d20f,_0x3c82d6);var _0x24c39f=util[_0x5f18('0xc0')](_0x5f18('0xd0'),_0x1126ce[_0x5f18('0xb2')]['id'],_0x3c82d6);var _0x45dcc0=path[_0x5f18('0xcb')](_0x52d20f,_0x24c39f);var _0x446dc7=[];_0x446dc7[_0x5f18('0x31')]({'model':db[_0x5f18('0x69')],'as':_0x5f18('0x69'),'attributes':['id',_0x5f18('0x2d')],'raw':!![]});_0x446dc7[_0x5f18('0x31')]({'model':db[_0x5f18('0xd1')],'as':'Contact','attributes':['id',_0x5f18('0xd2'),_0x5f18('0xd3')],'raw':!![]});if(_0x1126ce['query']['attachments']){_0x446dc7[_0x5f18('0x31')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x1d5414=[{'model':db['WhatsappMessage'],'as':'Messages','attributes':['id',_0x5f18('0x6f'),'createdAt','direction',_0x5f18('0xd4'),_0x5f18('0x7c')],'include':_0x446dc7}];_0x1d5414['push']({'model':db[_0x5f18('0xd5')],'as':_0x5f18('0xd6'),'attributes':['id',_0x5f18('0x42')]});_0x1d5414[_0x5f18('0x31')]({'model':db[_0x5f18('0x69')],'as':_0x5f18('0xd7'),'attributes':['id',_0x5f18('0x2d')]});return db[_0x5f18('0x33')][_0x5f18('0x5b')]({'where':{'id':_0x1126ce[_0x5f18('0xb2')]['id']},'include':_0x1d5414})[_0x5f18('0x26')](handleEntityNotFound(_0x37cb4c,null))['then'](function(_0x19e834){if(_0x19e834){var _0x371748=_0x19e834['get']({'plain':!![]});fs[_0x5f18('0xd8')](_0x4db7f1);var _0x5bd2e2={'channel':_0x5f18('0xd9'),'account':_0x371748['Account'][_0x5f18('0x42')],'agent':_0x371748[_0x5f18('0xd7')]?_0x371748[_0x5f18('0xd7')][_0x5f18('0x2d')]:_0x5f18('0xda'),'createdAt':moment(_0x371748['createdAt'])[_0x5f18('0xc0')](_0x5f18('0xc1'))[_0x5f18('0x9a')](),'closedAt':_0x371748[_0x5f18('0xdb')]?moment(_0x371748['closedAt'])[_0x5f18('0xc0')](_0x5f18('0xc1'))[_0x5f18('0x9a')]():'','disposition':_0x371748['disposition'],'messages':_(_0x371748[_0x5f18('0xdc')])['filter']({'secret':![]})[_0x5f18('0x2c')](function(_0x4346e4){if(_0x4346e4[_0x5f18('0xdd')]){var _0x1f0095=path[_0x5f18('0xcb')](_0x351cca,_0x4346e4[_0x5f18('0xdd')][_0x5f18('0xde')]);if(fs[_0x5f18('0xdf')](_0x1f0095)){fs['createReadStream'](_0x1f0095)['pipe'](fs[_0x5f18('0xe0')](path[_0x5f18('0xcb')](_0x4db7f1,_0x4346e4['Attachment'][_0x5f18('0xde')])));}}return{'date':moment(_0x4346e4[_0x5f18('0x75')])[_0x5f18('0xc0')](_0x5f18('0xc1'))[_0x5f18('0x9a')](),'sender':_0x4346e4[_0x5f18('0xe1')]==='out'?_0x4346e4[_0x5f18('0x69')]?_0x4346e4['User'][_0x5f18('0x2d')]:'System':_0x4346e4[_0x5f18('0x60')][_0x5f18('0xd2')]+(_0x4346e4['Contact'][_0x5f18('0xd3')]?'\x20'+_0x4346e4['Contact']['lastName']:''),'body':_0x4346e4['Attachment']?_0x4346e4[_0x5f18('0xdd')][_0x5f18('0xde')]:_0x4346e4['body'],'direction':_0x4346e4[_0x5f18('0xe1')]===_0x5f18('0xe2')?'A':'C','secret':_0x4346e4[_0x5f18('0xd4')],'read':_0x4346e4[_0x5f18('0x7c')],'attachment':_0x4346e4[_0x5f18('0xdd')]};})[_0x5f18('0x5d')]()};return ejs[_0x5f18('0xe3')](path['join'](config['root'],_0x5f18('0xcc'),_0x5f18('0xe4'),_0x5f18('0xe5')),{'interaction':_0x5bd2e2})[_0x5f18('0x26')](function(_0x30e69d){var _0x43ede0=path[_0x5f18('0xcb')](_0x4db7f1,_0x5f18('0xe6')+_0x371748['id']+'-'+_0x3c82d6+_0x5f18('0xe7'));var _0x1f0f8b={'path':_0x43ede0,'channel':_0x5f18('0xd9'),'interactionId':_0x371748['id']};return pdf[_0x5f18('0xe8')](_0x30e69d,_0x1f0f8b);})['then'](function(){return new BPromise(function(_0x388463,_0x522d05){zipdir(_0x4db7f1,{'saveTo':_0x45dcc0},function(_0x3cfad3,_0x2c2a6f){if(_0x3cfad3)return _0x522d05(_0x3cfad3);return _0x388463(_0x2c2a6f);});})['then'](function(){return new BPromise(function(_0xc33ae5,_0x278617){rimraf(_0x4db7f1,function(_0x239af3){if(_0x239af3)_0x278617(_0x239af3);return _0xc33ae5();});});})[_0x5f18('0x26')](function(){return _0x37cb4c[_0x5f18('0xc9')](_0x45dcc0,_0x24c39f,function(_0x4e0538){if(_0x4e0538){console[_0x5f18('0xe9')]('err',_0x4e0538);}else{fs['unlinkSync'](_0x45dcc0);}});});});}else{return _0x37cb4c[_0x5f18('0x28')](0xc8);}})['catch'](handleError(_0x37cb4c,null));}; \ No newline at end of file +var _0x64b0=['buildExpression','text','body','some','compact','isEmpty','WhatsappAccountId','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','Sequelize','QueryTypes','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','DESC','t.id\x20IN\x20?','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','role','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','i.WhatsappAccountId\x20IN\x20?','sequelize','toString','keyBy','merge','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.lastName','Contact.lastName','c.email','Contact.email','Contact.mobile','Contact.fax','o.fullname','Owner.internal','ui.WhatsappInteractionId\x20IN\x20?','groupBy','WhatsappInteractionId','rows','params','includeAll','include','options','create','update','describe','WhatsappMessage','ids','omit','getMessages','findOne','nolimit','format','findAll','addTags','emit','removeTags','download','join','root','server','files','tmp','transcript-%d-%s.zip','CmContact','firstName','lastName','attachments','Attachment','Messages','direction','WhatsappAccount','Owner','get','Whatsapp','Account','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','disposition','basename','existsSync','createReadStream','pipe','createWriteStream','out','System','secret','renderFile','downloadInteraction.ejs','transcript-','.pdf','log','err','unlinkSync','eml-format','rimraf','zip-dir','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./whatsappInteraction.socket','sendStatus','status','end','json','undefined','limit','count','offset','set','then','destroy','error','stack','name','send','Users','map','fullname','TagIds','Tags','forEach','push','catch','WhatsappInteraction','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','select','field','color','tools_tags','u.id','u.fullname','ui.WhatsappInteractionId','from','left_join','users','u.id\x20=\x20ui.UserId','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','it.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','conditions','find','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','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId'];(function(_0x21602f,_0x390717){var _0xef0d76=function(_0x50de8a){while(--_0x50de8a){_0x21602f['push'](_0x21602f['shift']());}};_0xef0d76(++_0x390717);}(_0x64b0,0x74));var _0x064b=function(_0x2cc248,_0x1ada66){_0x2cc248=_0x2cc248-0x0;var _0x350356=_0x64b0[_0x2cc248];return _0x350356;};'use strict';var emlformat=require(_0x064b('0x0'));var rimraf=require(_0x064b('0x1'));var zipdir=require(_0x064b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x064b('0x3'));var BPromise=require(_0x064b('0x4'));var Mustache=require('mustache');var util=require(_0x064b('0x5'));var path=require(_0x064b('0x6'));var sox=require('sox');var csv=require(_0x064b('0x7'));var ejs=require(_0x064b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x064b('0x9'));var squel=require(_0x064b('0xa'));var crypto=require(_0x064b('0xb'));var jsforce=require(_0x064b('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x064b('0x7'));var querystring=require(_0x064b('0xd'));var Papa=require(_0x064b('0xe'));var Redis=require(_0x064b('0xf'));var authService=require(_0x064b('0x10'));var qs=require(_0x064b('0x11'));var as=require(_0x064b('0x12'));var pdf=require(_0x064b('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x064b('0x14'))('api');var utils=require(_0x064b('0x15'));var config=require(_0x064b('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x064b('0x17'))['db'];config[_0x064b('0x18')]=_[_0x064b('0x19')](config[_0x064b('0x18')],{'host':_0x064b('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x064b('0x18')]));require(_0x064b('0x1b'))['register'](socket);function respondWithStatusCode(_0x1e08f3,_0x1d4c21){_0x1d4c21=_0x1d4c21||0xcc;return function(_0x3460d4){if(_0x3460d4){return _0x1e08f3[_0x064b('0x1c')](_0x1d4c21);}return _0x1e08f3[_0x064b('0x1d')](_0x1d4c21)[_0x064b('0x1e')]();};}function respondWithResult(_0x1e4bc4,_0x26f750){_0x26f750=_0x26f750||0xc8;return function(_0x57a3fd){if(_0x57a3fd){return _0x1e4bc4[_0x064b('0x1d')](_0x26f750)[_0x064b('0x1f')](_0x57a3fd);}};}function respondWithFilteredResult(_0x28484e,_0x3bdfa8){return function(_0x4397fe){if(_0x4397fe){var _0x43225d=typeof _0x3bdfa8['offset']===_0x064b('0x20')&&typeof _0x3bdfa8[_0x064b('0x21')]===_0x064b('0x20');var _0x3c729e=_0x4397fe[_0x064b('0x22')];var _0xfe27d=_0x43225d?0x0:_0x3bdfa8[_0x064b('0x23')];var _0x374dfc=_0x43225d?_0x4397fe['count']:_0x3bdfa8['offset']+_0x3bdfa8['limit'];var _0x5cd81c;if(_0x374dfc>=_0x3c729e){_0x374dfc=_0x3c729e;_0x5cd81c=0xc8;}else{_0x5cd81c=0xce;}_0x28484e[_0x064b('0x1d')](_0x5cd81c);return _0x28484e[_0x064b('0x24')]('Content-Range',_0xfe27d+'-'+_0x374dfc+'/'+_0x3c729e)['json'](_0x4397fe);}return null;};}function patchUpdates(_0x6f6beb){return function(_0x2d976e){try{jsonpatch['apply'](_0x2d976e,_0x6f6beb,!![]);}catch(_0x33e15d){return BPromise['reject'](_0x33e15d);}return _0x2d976e['save']();};}function saveUpdates(_0x51658d,_0x595941){return function(_0x4fd9c2){if(_0x4fd9c2){return _0x4fd9c2['update'](_0x51658d)[_0x064b('0x25')](function(_0x257c9d){return _0x257c9d;});}return null;};}function removeEntity(_0x7389f5,_0x2f03ad){return function(_0x382c34){if(_0x382c34){return _0x382c34[_0x064b('0x26')]()[_0x064b('0x25')](function(){_0x7389f5[_0x064b('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0xdb6370,_0x37b0c8){return function(_0x5e8aad){if(!_0x5e8aad){_0xdb6370[_0x064b('0x1c')](0x194);}return _0x5e8aad;};}function handleError(_0x50276a,_0x4e6758){_0x4e6758=_0x4e6758||0x1f4;return function(_0x8fcc2d){logger[_0x064b('0x27')](_0x8fcc2d[_0x064b('0x28')]);if(_0x8fcc2d['name']){delete _0x8fcc2d[_0x064b('0x29')];}_0x50276a[_0x064b('0x1d')](_0x4e6758)[_0x064b('0x2a')](_0x8fcc2d);};}function getInteractionUsers(_0x64f0ca,_0x1c285e){return new BPromise(function(_0x40ed97,_0xf52819){try{if(_0x1c285e[_0x64f0ca['id']]){_0x64f0ca[_0x064b('0x2b')]=_[_0x064b('0x2c')](_0x1c285e[_0x64f0ca['id']],function(_0x1755bc){return{'id':_0x1755bc['id'],'fullname':_0x1755bc[_0x064b('0x2d')]};});}}catch(_0x3204d1){_0xf52819(_0x3204d1);}_0x40ed97(_0x64f0ca);});}function getInteractionTags(_0x194e4e,_0x9ae0b2){return new BPromise(function(_0x18d2b5,_0x558077){try{if(_0x194e4e[_0x064b('0x2e')]){_0x194e4e[_0x064b('0x2f')]=[];_0x194e4e[_0x064b('0x2e')]['split'](',')[_0x064b('0x30')](function(_0x1605be){_0x194e4e[_0x064b('0x2f')][_0x064b('0x31')](_0x9ae0b2[_0x1605be]);});}delete _0x194e4e[_0x064b('0x2e')];}catch(_0x35a5d4){_0x558077(_0x35a5d4);}_0x18d2b5(_0x194e4e);});}function updateWhatsappInteraction(_0x43bee9,_0x1add87,_0x271976){return new BPromise(function(_0xad57bb,_0x4e73da){return getInteractionUsers(_0x43bee9,_0x271976)['then'](function(_0x23cfe2){return getInteractionTags(_0x23cfe2,_0x1add87);})[_0x064b('0x25')](function(_0xbb918a){_0xad57bb(_0xbb918a);})[_0x064b('0x32')](function(_0x5a1307){_0x4e73da(_0x5a1307);});});}exports['index']=function(_0xc3c3a0,_0x2b86e1){var _0x5333fd={},_0xd70b0={},_0x31a175={'count':0x0,'rows':[]};var _0x185bd0=_[_0x064b('0x2c')](db[_0x064b('0x33')][_0x064b('0x34')],function(_0x5997fe){return{'name':_0x5997fe[_0x064b('0x35')],'type':_0x5997fe[_0x064b('0x36')][_0x064b('0x37')]};});_0xd70b0[_0x064b('0x38')]=_['map'](_0x185bd0,_0x064b('0x29'));_0xd70b0[_0x064b('0x39')]=_[_0x064b('0x3a')](_0xc3c3a0[_0x064b('0x39')]);_0xd70b0['filters']=_[_0x064b('0x3b')](_0xd70b0[_0x064b('0x38')],_0xd70b0[_0x064b('0x39')]);_0x5333fd[_0x064b('0x3c')]=_['intersection'](_0xd70b0[_0x064b('0x38')],qs[_0x064b('0x3d')](_0xc3c3a0[_0x064b('0x39')][_0x064b('0x3d')]));_0x5333fd[_0x064b('0x3c')]=_0x5333fd[_0x064b('0x3c')][_0x064b('0x3e')]?_0x5333fd['attributes']:_0xd70b0[_0x064b('0x38')];if(!_0xc3c3a0[_0x064b('0x39')][_0x064b('0x3f')]('nolimit')){_0x5333fd[_0x064b('0x21')]=qs[_0x064b('0x21')](_0xc3c3a0[_0x064b('0x39')][_0x064b('0x21')]);_0x5333fd[_0x064b('0x23')]=qs[_0x064b('0x23')](_0xc3c3a0[_0x064b('0x39')][_0x064b('0x23')]);}_0x5333fd[_0x064b('0x40')]=qs[_0x064b('0x41')](_0xc3c3a0[_0x064b('0x39')][_0x064b('0x41')]);_0x5333fd[_0x064b('0x42')]=qs[_0x064b('0x43')](_[_0x064b('0x44')](_0xc3c3a0[_0x064b('0x39')],_0xd70b0['filters']),_0x185bd0);var _0x40ca72=[];var _0x1e37ef=squel[_0x064b('0x45')]()['field']('id')['field'](_0x064b('0x29'))[_0x064b('0x46')](_0x064b('0x47'))['from'](_0x064b('0x48'));var _0x3fe6b0=squel[_0x064b('0x45')]()[_0x064b('0x46')](_0x064b('0x49'))[_0x064b('0x46')](_0x064b('0x4a'))[_0x064b('0x46')](_0x064b('0x4b'))[_0x064b('0x4c')]('user_has_whatsapp_interactions','ui')[_0x064b('0x4d')](_0x064b('0x4e'),'u',_0x064b('0x4f'));var _0x42ca55=squel['select']()['from']('whatsapp_interactions','i')['left_join']('cm_contacts','c',_0x064b('0x50'))[_0x064b('0x4d')](_0x064b('0x4e'),'o',_0x064b('0x51'))['left_join'](_0x064b('0x52'),'a',_0x064b('0x53'))['left_join'](_0x064b('0x54'),'me',_0x064b('0x55'))[_0x064b('0x4d')]('whatsapp_interaction_has_tags','it',_0x064b('0x56'))[_0x064b('0x4d')]('tools_tags','t',_0x064b('0x57'));var _0x11790a=squel[_0x064b('0x58')]();var _0x56139b=[];var _0xef4421=squel[_0x064b('0x58')]();var _0x31b019;if(_0xc3c3a0[_0x064b('0x39')]['search']){_0x31b019=as[_0x064b('0x59')](_0xc3c3a0[_0x064b('0x39')][_0x064b('0x5a')]);var _0x3fad5a=_0x31b019[_0x064b('0x5b')];for(var _0x3791df=0x0;_0x3791df<_0x31b019[_0x064b('0x5c')][_0x064b('0x3e')];_0x3791df++){var _0x53a20e=_0x31b019['conditions'][_0x3791df];var _0x4b5ffd='i';var _0x2d6d90=_[_0x064b('0x5d')](_0x185bd0,['name',_0x53a20e[_0x064b('0x46')]]);if(!_0x2d6d90){switch(_0x53a20e['field']){case'unreadMessages':if(_0x53a20e[_0x064b('0x5e')]==0x1){_0x42ca55[_0x064b('0x5f')]('`'+_0x53a20e[_0x064b('0x46')]+'`\x20=\x200');}else{_0x42ca55[_0x064b('0x5f')]('`'+_0x53a20e[_0x064b('0x46')]+_0x064b('0x60'));}break;case _0x064b('0x61'):if(_0x53a20e[_0x064b('0x62')]===_0x064b('0x63')){if(_0x53a20e['value'][_0x064b('0x64')]('\x20')[_0x064b('0x3e')]>0x1){_0x11790a[_0x3fad5a](_0x064b('0x65'),qs[_0x064b('0x66')](_0x53a20e[_0x064b('0x5e')]),null);}else{var _0x1a2bf3='%'+_0x53a20e[_0x064b('0x5e')]+'%';_0x11790a[_0x3fad5a](_0x064b('0x67'),_0x1a2bf3,_0x1a2bf3,_0x1a2bf3);}}else{_0x2d6d90=_['find'](_0x185bd0,[_0x064b('0x29'),'ContactId']);_0x53a20e['field']=_0x064b('0x68');_0x4301f6=as['buildExpression'](_0x4b5ffd,_0x2d6d90[_0x064b('0x36')],_0x53a20e);_0x11790a[_0x3fad5a](_0x4301f6['text'],_0x4301f6[_0x064b('0x5e')][_0x064b('0x69')],_0x4301f6['value'][_0x064b('0x1e')]);}break;case _0x064b('0x6a'):var _0x41223c=_0x53a20e[_0x064b('0x5e')][_0x064b('0x64')](',')[_0x064b('0x2c')](function(_0x323e21){return Number(_0x323e21);});_0x41223c[_0x064b('0x30')](function(_0x10ec62){_0xef4421['or'](_0x064b('0x6b'),'%,'+_0x10ec62+',%');});_0x56139b=_['union'](_0x56139b,_0x41223c);break;case _0x064b('0x6c'):if(_0x53a20e[_0x064b('0x62')]==='$substring'){_0x11790a[_0x3fad5a](_0x064b('0x6d'),'%'+_0x53a20e[_0x064b('0x5e')]+'%',null);}else{_0x2d6d90=_['find'](_0x185bd0,['name','UserId']);_0x53a20e['field']=_0x064b('0x6e');_0x4301f6=as[_0x064b('0x6f')](_0x4b5ffd,_0x2d6d90[_0x064b('0x36')],_0x53a20e);_0x11790a[_0x3fad5a](_0x4301f6[_0x064b('0x70')],_0x4301f6[_0x064b('0x5e')][_0x064b('0x69')],_0x4301f6['value'][_0x064b('0x1e')]);}break;case _0x064b('0x71'):_0x4301f6=as[_0x064b('0x6f')]('me',null,_0x53a20e);_0x11790a[_0x3fad5a](_0x4301f6[_0x064b('0x70')],_0x4301f6[_0x064b('0x5e')][_0x064b('0x69')],_0x4301f6[_0x064b('0x5e')]['end']);break;}}else{var _0x4301f6=as[_0x064b('0x6f')](_0x4b5ffd,_0x2d6d90['type'],_0x53a20e);_0x11790a[_0x3fad5a](_0x4301f6[_0x064b('0x70')],_0x4301f6['value'][_0x064b('0x69')],_0x4301f6['value']['end']);}}}else{var _0x2a815f=_(_0xc3c3a0[_0x064b('0x39')])[_0x064b('0x3a')]()['map'](function(_0x202234){return _[_0x064b('0x72')](_0x185bd0,[_0x064b('0x29'),_0x202234])?_0x202234:undefined;})[_0x064b('0x73')]()['value']();if(!_[_0x064b('0x74')](_0x2a815f)){_0x2a815f[_0x064b('0x30')](function(_0x46f2f0){if(_0x46f2f0===_0x064b('0x75')){_0x42ca55['where']('i.WhatsappAccountId\x20IN\x20?',[][_0x064b('0x76')](_0xc3c3a0[_0x064b('0x39')][_0x46f2f0]));}else if(_0x46f2f0===_0x064b('0x77')){var _0x528b14=JSON[_0x064b('0x78')](_0xc3c3a0[_0x064b('0x39')][_0x46f2f0])[_0x064b('0x79')];var _0x1d222c=JSON[_0x064b('0x78')](_0xc3c3a0[_0x064b('0x39')][_0x46f2f0])[_0x064b('0x7a')];_0x42ca55[_0x064b('0x42')](_0x064b('0x7b'),_0x528b14,_0x1d222c);}else{if(_0xc3c3a0[_0x064b('0x39')][_0x46f2f0]===_0x064b('0x7c')){_0x42ca55[_0x064b('0x42')]('i.'+_0x46f2f0+'\x20IS\x20NULL');}else{_0x42ca55[_0x064b('0x42')]('i.'+_0x46f2f0+'\x20=\x20?',_0xc3c3a0['query'][_0x46f2f0]);}}});}if(_0xc3c3a0['query'][_0x064b('0x7d')]){if(_0xc3c3a0[_0x064b('0x39')][_0x064b('0x7d')]==0x1){_0x42ca55['having'](_0x064b('0x7e'));}else{_0x42ca55[_0x064b('0x5f')](_0x064b('0x7f'));}}if(_0xc3c3a0[_0x064b('0x39')][_0x064b('0x80')]){_0x56139b=_['isArray'](_0xc3c3a0[_0x064b('0x39')]['tag'])?_0xc3c3a0[_0x064b('0x39')]['tag']:new Array(_0xc3c3a0[_0x064b('0x39')]['tag']);_0x56139b[_0x064b('0x30')](function(_0x2c2255){_0xef4421['or'](_0x064b('0x6b'),'%,'+_0x2c2255+',%');});}if(_0xc3c3a0[_0x064b('0x39')][_0x064b('0x81')]){var _0x2147c5=_0xc3c3a0[_0x064b('0x39')][_0x064b('0x81')][_0x064b('0x82')]('\x5c','\x5c\x5c')[_0x064b('0x82')](/'/g,'\x27\x27');if(qs[_0x064b('0x83')](_0x2147c5)){_0x11790a['or']('i.id\x20LIKE\x20?',_0x2147c5+'%')['or']('i.phone\x20LIKE\x20?',_0x2147c5+'%');}else{_0x11790a['or'](_0x064b('0x84'),qs['getFullTextValue'](_0x2147c5))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x2147c5+'%');}}}_0x42ca55[_0x064b('0x42')](_0x11790a);_0x42ca55[_0x064b('0x85')]('i.id');var _0x5be73c={'type':db[_0x064b('0x86')][_0x064b('0x87')]['SELECT'],'raw':!![]};var _0x27f81e=_0x42ca55[_0x064b('0x88')]();_0x27f81e[_0x064b('0x46')](_0x064b('0x89'));_0x27f81e['field'](_0x064b('0x8a'),_0x064b('0x8b'));if(_0x5333fd['order']){_0x5333fd[_0x064b('0x40')][_0x064b('0x30')](function(_0x16a5a8){var _0x36083f=_0x16a5a8[0x0]===_0x064b('0x8c')?_0x16a5a8[0x0]:'i.'+_0x16a5a8[0x0];_0x42ca55[_0x064b('0x40')](_0x36083f,_0x16a5a8[0x1]===_0x064b('0x8d')?![]:!![]);});}if(!_['isEmpty'](_0x56139b)){_0x42ca55['having'](_0xef4421);_0x27f81e[_0x064b('0x42')](_0x064b('0x8e'),_0x56139b);}BPromise[_0x064b('0x8f')]()[_0x064b('0x25')](function(){if(!_0x31b019){if(_0xc3c3a0[_0x064b('0x39')][_0x064b('0x75')])return;_0x27f81e['where'](_0x064b('0x90'));_0x42ca55[_0x064b('0x42')]('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');return;}if(_0xc3c3a0['user'][_0x064b('0x91')]!==_0x064b('0x92'))return;return _0xc3c3a0['user'][_0x064b('0x93')]({'attributes':['id'],'raw':!![]})[_0x064b('0x25')](function(_0x420f8a){if(_[_0x064b('0x74')](_0x420f8a)){_0x27f81e[_0x064b('0x42')]('i.WhatsappAccountId\x20IS\x20NULL');_0x42ca55[_0x064b('0x42')](_0x064b('0x94'));}else{_0x27f81e['where'](_0x064b('0x95'),_[_0x064b('0x2c')](_0x420f8a,'id'));_0x42ca55[_0x064b('0x42')](_0x064b('0x95'),_[_0x064b('0x2c')](_0x420f8a,'id'));}});})[_0x064b('0x25')](function(){if(_0xc3c3a0['user'][_0x064b('0x91')]===_0x064b('0x92')&&!_0x31b019&&!_0xc3c3a0[_0x064b('0x39')]['WhatsappAccountId'])return[];return db[_0x064b('0x96')][_0x064b('0x39')](_0x27f81e[_0x064b('0x97')](),_0x5be73c);})[_0x064b('0x25')](function(_0x6071c6){_0x31a175[_0x064b('0x22')]=_0x6071c6['length'];if(_0x31a175['count']===0x0)return[];return db[_0x064b('0x96')]['query'](_0x1e37ef['toString'](),_0x5be73c)[_0x064b('0x25')](function(_0x387c08){_0x40ca72=_[_0x064b('0x98')](_0x387c08,'id');_0x5be73c=_[_0x064b('0x99')](_0x5be73c,{'model':db[_0x064b('0x33')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xc3c3a0[_0x064b('0x39')]['fields']){_0x5333fd[_0x064b('0x3c')][_0x064b('0x30')](function(_0x2d4157){_0x42ca55['field']('i.'+_0x2d4157);});}else{_0x42ca55[_0x064b('0x46')](_0x064b('0x8a'),_0x064b('0x8b'));_0x42ca55[_0x064b('0x46')]('a.key',_0x064b('0x9a'));_0x42ca55[_0x064b('0x46')](_0x064b('0x9b'),_0x064b('0x9c'));_0x42ca55[_0x064b('0x46')](_0x064b('0x9d'),_0x064b('0x8c'));_0x42ca55[_0x064b('0x46')](_0x064b('0x9e'));_0x42ca55[_0x064b('0x46')]('c.firstName','Contact.firstName');_0x42ca55[_0x064b('0x46')](_0x064b('0x9f'),_0x064b('0xa0'));_0x42ca55['field'](_0x064b('0xa1'),_0x064b('0xa2'));_0x42ca55['field']('c.phone','Contact.phone');_0x42ca55['field']('c.mobile',_0x064b('0xa3'));_0x42ca55[_0x064b('0x46')]('c.fax',_0x064b('0xa4'));_0x42ca55['field'](_0x064b('0xa5'),'Owner.fullname');_0x42ca55[_0x064b('0x46')]('o.internal',_0x064b('0xa6'));_0x42ca55[_0x064b('0x46')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x064b('0x2e'));}if(_0x5333fd[_0x064b('0x21')])_0x42ca55[_0x064b('0x21')](_0x5333fd['limit']);if(_0x5333fd[_0x064b('0x23')])_0x42ca55['offset'](_0x5333fd[_0x064b('0x23')]);return db[_0x064b('0x96')][_0x064b('0x39')](_0x42ca55[_0x064b('0x97')](),_0x5be73c);})[_0x064b('0x25')](function(_0x3ae0ad){if(_0x3ae0ad[_0x064b('0x3e')]>0x0)_0x3fe6b0['where'](_0x064b('0xa7'),_['map'](_0x3ae0ad,'id'));return db[_0x064b('0x96')][_0x064b('0x39')](_0x3fe6b0[_0x064b('0x97')](),_0x5be73c)['then'](function(_0x414f27){var _0x2de49b=_[_0x064b('0xa8')](_0x414f27,_0x064b('0xa9'));var _0x3cfa8d=[];_0x3ae0ad[_0x064b('0x30')](function(_0x4ff8e3){_0x3cfa8d[_0x064b('0x31')](updateWhatsappInteraction(_0x4ff8e3,_0x40ca72,_0x2de49b));});return BPromise['all'](_0x3cfa8d);});});})[_0x064b('0x25')](function(_0x15f806){_0x31a175[_0x064b('0xaa')]=_0x15f806;return _0x31a175;})[_0x064b('0x25')](respondWithFilteredResult(_0x2b86e1,_0x5333fd))[_0x064b('0x32')](handleError(_0x2b86e1,null));};exports['show']=function(_0x1275cf,_0x263da7){var _0x4a436b={'raw':![],'where':{'id':_0x1275cf[_0x064b('0xab')]['id']}},_0x1b6a9e={};_0x1b6a9e[_0x064b('0x38')]=_[_0x064b('0x3a')](db['WhatsappInteraction'][_0x064b('0x34')]);_0x1b6a9e[_0x064b('0x39')]=_['keys'](_0x1275cf[_0x064b('0x39')]);_0x1b6a9e[_0x064b('0x43')]=_['intersection'](_0x1b6a9e[_0x064b('0x38')],_0x1b6a9e[_0x064b('0x39')]);_0x4a436b['attributes']=_['intersection'](_0x1b6a9e[_0x064b('0x38')],qs['fields'](_0x1275cf['query'][_0x064b('0x3d')]));_0x4a436b['attributes']=_0x4a436b[_0x064b('0x3c')][_0x064b('0x3e')]?_0x4a436b[_0x064b('0x3c')]:_0x1b6a9e['model'];if(_0x1275cf[_0x064b('0x39')][_0x064b('0xac')]){_0x4a436b[_0x064b('0xad')]=[{'all':!![]}];}_0x4a436b=_[_0x064b('0x99')]({},_0x4a436b,_0x1275cf[_0x064b('0xae')]);return db[_0x064b('0x33')][_0x064b('0x5d')](_0x4a436b)[_0x064b('0x25')](handleEntityNotFound(_0x263da7,null))[_0x064b('0x25')](respondWithResult(_0x263da7,null))[_0x064b('0x32')](handleError(_0x263da7,null));};exports[_0x064b('0xaf')]=function(_0x2678a9,_0x105644){return db[_0x064b('0x33')]['create'](_0x2678a9['body'],{})['then'](respondWithResult(_0x105644,0xc9))[_0x064b('0x32')](handleError(_0x105644,null));};exports[_0x064b('0xb0')]=function(_0x35567c,_0x508af9){if(_0x35567c[_0x064b('0x71')]['id']){delete _0x35567c[_0x064b('0x71')]['id'];}return db[_0x064b('0x33')][_0x064b('0x5d')]({'where':{'id':_0x35567c[_0x064b('0xab')]['id']}})[_0x064b('0x25')](handleEntityNotFound(_0x508af9,null))[_0x064b('0x25')](saveUpdates(_0x35567c[_0x064b('0x71')],null))[_0x064b('0x25')](respondWithResult(_0x508af9,null))[_0x064b('0x32')](handleError(_0x508af9,null));};exports[_0x064b('0x26')]=function(_0x4c87b7,_0x3430aa){return db['WhatsappInteraction'][_0x064b('0x5d')]({'where':{'id':_0x4c87b7[_0x064b('0xab')]['id']}})[_0x064b('0x25')](handleEntityNotFound(_0x3430aa,null))['then'](removeEntity(_0x3430aa,null))[_0x064b('0x32')](handleError(_0x3430aa,null));};exports[_0x064b('0xb1')]=function(_0x587fd7,_0xaf467d){return db[_0x064b('0x33')][_0x064b('0xb1')]()[_0x064b('0x25')](respondWithResult(_0xaf467d,null))[_0x064b('0x32')](handleError(_0xaf467d,null));};exports['addMessage']=function(_0x5409f7,_0x1a4dd2,_0x29b395){return db[_0x064b('0xb2')][_0x064b('0x5d')]({'where':{'id':_0x5409f7[_0x064b('0xab')]['id']}})['then'](handleEntityNotFound(_0x1a4dd2,null))[_0x064b('0x25')](function(_0x5468f6){if(_0x5468f6){return _0x5468f6['addMessage'](_0x5409f7[_0x064b('0x71')][_0x064b('0xb3')],_[_0x064b('0xb4')](_0x5409f7[_0x064b('0x71')],[_0x064b('0xb3'),'id'])||{});}})['then'](respondWithResult(_0x1a4dd2,null))[_0x064b('0x32')](handleError(_0x1a4dd2,null));};exports[_0x064b('0xb5')]=function(_0xd1918c,_0x5d55f0,_0x2442f6){var _0x3517c6={'raw':![],'where':{}};var _0x589605={};var _0x21d7ba={'count':0x0,'rows':[]};return db['WhatsappInteraction'][_0x064b('0xb6')]({'where':{'id':_0xd1918c[_0x064b('0xab')]['id']}})['then'](handleEntityNotFound(_0x5d55f0,null))[_0x064b('0x25')](function(_0x1534dd){if(_0x1534dd){_0x589605[_0x064b('0x38')]=_[_0x064b('0x3a')](db['WhatsappMessage'][_0x064b('0x34')]);_0x589605[_0x064b('0x39')]=_[_0x064b('0x3a')](_0xd1918c[_0x064b('0x39')]);_0x589605[_0x064b('0x43')]=_[_0x064b('0x3b')](_0x589605[_0x064b('0x38')],_0x589605[_0x064b('0x39')]);_0x3517c6[_0x064b('0x3c')]=_[_0x064b('0x3b')](_0x589605[_0x064b('0x38')],qs['fields'](_0xd1918c[_0x064b('0x39')][_0x064b('0x3d')]));_0x3517c6[_0x064b('0x3c')]=_0x3517c6['attributes'][_0x064b('0x3e')]?_0x3517c6[_0x064b('0x3c')]:_0x589605['model'];if(!_0xd1918c['query'][_0x064b('0x3f')](_0x064b('0xb7'))){_0x3517c6[_0x064b('0x21')]=qs[_0x064b('0x21')](_0xd1918c['query'][_0x064b('0x21')]);_0x3517c6[_0x064b('0x23')]=qs[_0x064b('0x23')](_0xd1918c[_0x064b('0x39')]['offset']);}_0x3517c6['order']=qs['sort'](_0xd1918c[_0x064b('0x39')][_0x064b('0x41')]);_0x3517c6[_0x064b('0x42')]=qs['filters'](_['pick'](_0xd1918c[_0x064b('0x39')],_0x589605[_0x064b('0x43')]));_0x3517c6[_0x064b('0x42')][_0x064b('0xa9')]=_0x1534dd['id'];if(_0xd1918c[_0x064b('0x39')][_0x064b('0x81')]){_0x3517c6[_0x064b('0x42')]=_[_0x064b('0x99')](_0x3517c6[_0x064b('0x42')],{'$or':_[_0x064b('0x2c')](_0x3517c6[_0x064b('0x3c')],function(_0x49f806){var _0x2ef57f={};_0x2ef57f[_0x49f806]={'$like':'%'+_0xd1918c['query'][_0x064b('0x81')]+'%'};return _0x2ef57f;})});}if(_0xd1918c[_0x064b('0x39')][_0x064b('0x79')]){var _0x278bba=_0xd1918c[_0x064b('0x39')][_0x064b('0x79')][_0x064b('0x64')](',');var _0x27df2f={};_0x27df2f[_0x278bba[0x0]]={'$gte':moment(_0x278bba[0x1])[_0x064b('0xb8')]('YYYY-MM-DD\x20HH:mm:ss')};_0x3517c6[_0x064b('0x42')]=_[_0x064b('0x99')](_0x3517c6[_0x064b('0x42')],_0x27df2f);}_0x3517c6=_['merge']({},_0x3517c6,_0xd1918c[_0x064b('0xae')]);return db[_0x064b('0xb2')][_0x064b('0x22')]({'where':_0x3517c6['where']})[_0x064b('0x25')](function(_0x1790a0){_0x21d7ba[_0x064b('0x22')]=_0x1790a0;if(_0xd1918c[_0x064b('0x39')][_0x064b('0xac')]){_0x3517c6['include']=[{'all':!![]}];}return db[_0x064b('0xb2')][_0x064b('0xb9')](_0x3517c6);})[_0x064b('0x25')](function(_0x51be49){_0x21d7ba['rows']=_0x51be49;return _0x21d7ba;});}})[_0x064b('0x25')](respondWithFilteredResult(_0x5d55f0,_0x3517c6))[_0x064b('0x32')](handleError(_0x5d55f0,null));};exports[_0x064b('0xba')]=function(_0x2421c8,_0x54cb50,_0x49da5b){return db['WhatsappInteraction'][_0x064b('0x5d')]({'where':{'id':_0x2421c8[_0x064b('0xab')]['id']}})[_0x064b('0x25')](handleEntityNotFound(_0x54cb50,null))['then'](function(_0x2510cb){if(_0x2510cb){return _0x2510cb['setTags'](_0x2421c8[_0x064b('0x71')][_0x064b('0xb3')],_[_0x064b('0xb4')](_0x2421c8[_0x064b('0x71')],[_0x064b('0xb3'),'id'])||{})['spread'](function(){return db[_0x064b('0x6a')][_0x064b('0xb9')]({'attributes':['id',_0x064b('0x29'),_0x064b('0x47')],'where':{'id':_0x2421c8[_0x064b('0x71')][_0x064b('0xb3')]}});})[_0x064b('0x25')](function(_0xe735e2){socket[_0x064b('0xbb')]('whatsappInteractionTags:save',{'id':Number(_0x2421c8['params']['id']),'tags':_0xe735e2||[]});return{'id':Number(_0x2421c8['params']['id']),'tags':_0xe735e2||[]};});}})[_0x064b('0x25')](respondWithResult(_0x54cb50,null))['catch'](handleError(_0x54cb50,null));};exports[_0x064b('0xbc')]=function(_0xf77e12,_0x44b06e,_0x35cf2d){return db['WhatsappInteraction']['find']({'where':{'id':_0xf77e12['params']['id']}})[_0x064b('0x25')](handleEntityNotFound(_0x44b06e,null))[_0x064b('0x25')](function(_0x9dea6d){if(_0x9dea6d){return _0x9dea6d[_0x064b('0xbc')](_0xf77e12[_0x064b('0x39')]['ids']);}})[_0x064b('0x25')](respondWithStatusCode(_0x44b06e,null))['catch'](handleError(_0x44b06e,null));};exports[_0x064b('0xbd')]=function(_0x4efd6b,_0x52ef60){var _0x23c6a1=moment()['unix']()['toString']();var _0x1fb539=path[_0x064b('0xbe')](config[_0x064b('0xbf')],_0x064b('0xc0'),_0x064b('0xc1'),_0x064b('0xc2'));var _0x3d878f=path[_0x064b('0xbe')](config[_0x064b('0xbf')],_0x064b('0xc0'),_0x064b('0xc1'),'attachments');var _0x2341f1=path[_0x064b('0xbe')](_0x1fb539,_0x23c6a1);var _0x5f5d75=util['format'](_0x064b('0xc3'),_0x4efd6b['params']['id'],_0x23c6a1);var _0x413828=path['join'](_0x1fb539,_0x5f5d75);var _0x423a9c=[];_0x423a9c['push']({'model':db['User'],'as':'User','attributes':['id',_0x064b('0x2d')],'raw':!![]});_0x423a9c['push']({'model':db[_0x064b('0xc4')],'as':_0x064b('0x61'),'attributes':['id',_0x064b('0xc5'),_0x064b('0xc6')],'raw':!![]});if(_0x4efd6b[_0x064b('0x39')][_0x064b('0xc7')]){_0x423a9c['push']({'model':db['Attachment'],'as':_0x064b('0xc8'),'raw':!![]});}var _0x32c8e5=[{'model':db[_0x064b('0xb2')],'as':_0x064b('0xc9'),'attributes':['id',_0x064b('0x71'),_0x064b('0x77'),_0x064b('0xca'),'secret','read'],'include':_0x423a9c}];_0x32c8e5[_0x064b('0x31')]({'model':db[_0x064b('0xcb')],'as':'Account','attributes':['id',_0x064b('0x29')]});_0x32c8e5['push']({'model':db[_0x064b('0x6c')],'as':_0x064b('0xcc'),'attributes':['id',_0x064b('0x2d')]});return db['WhatsappInteraction'][_0x064b('0x5d')]({'where':{'id':_0x4efd6b[_0x064b('0xab')]['id']},'include':_0x32c8e5})['then'](handleEntityNotFound(_0x52ef60,null))[_0x064b('0x25')](function(_0x5186a3){if(_0x5186a3){var _0x204407=_0x5186a3[_0x064b('0xcd')]({'plain':!![]});fs['mkdirSync'](_0x2341f1);var _0x595d5d={'channel':_0x064b('0xce'),'account':_0x204407[_0x064b('0xcf')][_0x064b('0x29')],'agent':_0x204407['Owner']?_0x204407[_0x064b('0xcc')][_0x064b('0x2d')]:'N.A.','createdAt':moment(_0x204407[_0x064b('0x77')])[_0x064b('0xb8')](_0x064b('0xd0'))[_0x064b('0x97')](),'closedAt':_0x204407[_0x064b('0xd1')]?moment(_0x204407[_0x064b('0xd2')])[_0x064b('0xb8')]('YYYY-MM-DD\x20HH:mm:ss')[_0x064b('0x97')]():'','disposition':_0x204407[_0x064b('0xd3')],'messages':_(_0x204407['Messages'])[_0x064b('0x81')]({'secret':![]})[_0x064b('0x2c')](function(_0x29cd1a){if(_0x29cd1a[_0x064b('0xc8')]){var _0x2478c2=path['join'](_0x3d878f,_0x29cd1a['Attachment'][_0x064b('0xd4')]);if(fs[_0x064b('0xd5')](_0x2478c2)){fs[_0x064b('0xd6')](_0x2478c2)[_0x064b('0xd7')](fs[_0x064b('0xd8')](path[_0x064b('0xbe')](_0x2341f1,_0x29cd1a[_0x064b('0xc8')][_0x064b('0xd4')])));}}return{'date':moment(_0x29cd1a[_0x064b('0x77')])[_0x064b('0xb8')](_0x064b('0xd0'))[_0x064b('0x97')](),'sender':_0x29cd1a['direction']===_0x064b('0xd9')?_0x29cd1a[_0x064b('0x6c')]?_0x29cd1a[_0x064b('0x6c')][_0x064b('0x2d')]:_0x064b('0xda'):_0x29cd1a[_0x064b('0x61')][_0x064b('0xc5')]+(_0x29cd1a[_0x064b('0x61')][_0x064b('0xc6')]?'\x20'+_0x29cd1a[_0x064b('0x61')][_0x064b('0xc6')]:''),'body':_0x29cd1a[_0x064b('0xc8')]?_0x29cd1a[_0x064b('0xc8')][_0x064b('0xd4')]:_0x29cd1a[_0x064b('0x71')],'direction':_0x29cd1a[_0x064b('0xca')]===_0x064b('0xd9')?'A':'C','secret':_0x29cd1a[_0x064b('0xdb')],'read':_0x29cd1a[_0x064b('0x7d')],'attachment':_0x29cd1a['Attachment']};})[_0x064b('0x5e')]()};return ejs[_0x064b('0xdc')](path[_0x064b('0xbe')](config['root'],_0x064b('0xc0'),'views',_0x064b('0xdd')),{'interaction':_0x595d5d})[_0x064b('0x25')](function(_0xc9b97){var _0xc1d07=path[_0x064b('0xbe')](_0x2341f1,_0x064b('0xde')+_0x204407['id']+'-'+_0x23c6a1+_0x064b('0xdf'));var _0x31ade5={'path':_0xc1d07,'channel':_0x064b('0xce'),'interactionId':_0x204407['id']};return pdf['createPdfFromHTML'](_0xc9b97,_0x31ade5);})[_0x064b('0x25')](function(){return new BPromise(function(_0x2145d2,_0x4f05cf){zipdir(_0x2341f1,{'saveTo':_0x413828},function(_0x3bd21b,_0x411580){if(_0x3bd21b)return _0x4f05cf(_0x3bd21b);return _0x2145d2(_0x411580);});})['then'](function(){return new BPromise(function(_0x518880,_0x53aeba){rimraf(_0x2341f1,function(_0x5c51fa){if(_0x5c51fa)_0x53aeba(_0x5c51fa);return _0x518880();});});})[_0x064b('0x25')](function(){return _0x52ef60[_0x064b('0xbd')](_0x413828,_0x5f5d75,function(_0x24b99a){if(_0x24b99a){console[_0x064b('0xe0')](_0x064b('0xe1'),_0x24b99a);}else{fs[_0x064b('0xe2')](_0x413828);}});});});}else{return _0x52ef60[_0x064b('0x1c')](0xc8);}})['catch'](handleError(_0x52ef60,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 7683038..9bc7637 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 _0x2e21=['remove','getUsers','then','setDataValue','Users','unreadMessages','length','emit','catch','hook','events','../../mysqldb','WhatsappInteraction','WhatsappMessage','save','update'];(function(_0x12a554,_0x3d7ef8){var _0x244ba0=function(_0x5eb5ff){while(--_0x5eb5ff){_0x12a554['push'](_0x12a554['shift']());}};_0x244ba0(++_0x3d7ef8);}(_0x2e21,0xba));var _0x12e2=function(_0x4d5250,_0x2a8c80){_0x4d5250=_0x4d5250-0x0;var _0x547f14=_0x2e21[_0x4d5250];return _0x547f14;};'use strict';var EventEmitter=require(_0x12e2('0x0'));var WhatsappInteraction=require(_0x12e2('0x1'))['db'][_0x12e2('0x2')];var WhatsappMessage=require('../../mysqldb')['db'][_0x12e2('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x12e2('0x4'),'afterUpdate':_0x12e2('0x5'),'afterDestroy':_0x12e2('0x6')};function emitEvent(_0x1f77c5){return function(_0x359ce9,_0x46287a,_0x1f4783){_0x359ce9[_0x12e2('0x7')]({'attributes':['id'],'raw':!![]})[_0x12e2('0x8')](function(_0x2a7059){_0x359ce9[_0x12e2('0x9')](_0x12e2('0xa'),_0x2a7059['map'](function(_0x26abc1){return{'id':_0x26abc1['id']};}));return WhatsappMessage['findAll']({'where':{'WhatsappInteractionId':_0x359ce9['id'],'direction':'in','read':![]},'raw':!![]});})[_0x12e2('0x8')](function(_0x57c018){_0x359ce9[_0x12e2('0x9')](_0x12e2('0xb'),_0x57c018[_0x12e2('0xc')]);WhatsappInteractionEvents['emit'](_0x1f77c5+':'+_0x359ce9['id'],_0x359ce9);WhatsappInteractionEvents[_0x12e2('0xd')](_0x1f77c5,_0x359ce9);_0x1f4783(null);})[_0x12e2('0xe')](_0x1f4783(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction[_0x12e2('0xf')](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents; \ No newline at end of file +var _0x2e54=['hook','events','../../mysqldb','WhatsappMessage','setMaxListeners','save','update','remove','getUsers','Users','findAll','then','setDataValue','unreadMessages','length','emit','hasOwnProperty'];(function(_0x8fa4bc,_0x5cd2af){var _0x35b6a7=function(_0x357c25){while(--_0x357c25){_0x8fa4bc['push'](_0x8fa4bc['shift']());}};_0x35b6a7(++_0x5cd2af);}(_0x2e54,0x1dd));var _0x42e5=function(_0x344e81,_0x8c0fc3){_0x344e81=_0x344e81-0x0;var _0x50c6ca=_0x2e54[_0x344e81];return _0x50c6ca;};'use strict';var EventEmitter=require(_0x42e5('0x0'));var WhatsappInteraction=require('../../mysqldb')['db']['WhatsappInteraction'];var WhatsappMessage=require(_0x42e5('0x1'))['db'][_0x42e5('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x42e5('0x3')](0x0);var events={'afterCreate':_0x42e5('0x4'),'afterUpdate':_0x42e5('0x5'),'afterDestroy':_0x42e5('0x6')};function emitEvent(_0x42736b){return function(_0x528772,_0x171302,_0x455f48){_0x528772[_0x42e5('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x2af5bb){_0x528772['setDataValue'](_0x42e5('0x8'),_0x2af5bb['map'](function(_0x3a8494){return{'id':_0x3a8494['id']};}));return WhatsappMessage[_0x42e5('0x9')]({'where':{'WhatsappInteractionId':_0x528772['id'],'direction':'in','read':![]},'raw':!![]});})[_0x42e5('0xa')](function(_0x15f9f1){_0x528772[_0x42e5('0xb')](_0x42e5('0xc'),_0x15f9f1[_0x42e5('0xd')]);WhatsappInteractionEvents[_0x42e5('0xe')](_0x42736b+':'+_0x528772['id'],_0x528772);WhatsappInteractionEvents[_0x42e5('0xe')](_0x42736b,_0x528772);_0x455f48(null);})['catch'](_0x455f48(null));};}for(var e in events){if(events[_0x42e5('0xf')](e)){var event=events[e];WhatsappInteraction[_0x42e5('0x10')](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 874d0e6..de2c8da 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 _0x50bf=['moment','request-promise','path','../../config/environment','exports','define','WhatsappInteraction','format','YYYY-MM-DD\x20HH:mm:ss','util','api'];(function(_0x2a183,_0x30f0f1){var _0x37da6f=function(_0x46625f){while(--_0x46625f){_0x2a183['push'](_0x2a183['shift']());}};_0x37da6f(++_0x30f0f1);}(_0x50bf,0x106));var _0xf50b=function(_0x156703,_0x39c77f){_0x156703=_0x156703-0x0;var _0x4c5c3f=_0x50bf[_0x156703];return _0x4c5c3f;};'use strict';var _=require('lodash');var util=require(_0xf50b('0x0'));var logger=require('../../config/logger')(_0xf50b('0x1'));var moment=require(_0xf50b('0x2'));var BPromise=require('bluebird');var rp=require(_0xf50b('0x3'));var fs=require('fs');var path=require(_0xf50b('0x4'));var rimraf=require('rimraf');var config=require(_0xf50b('0x5'));var attributes=require('./whatsappInteraction.attributes');module[_0xf50b('0x6')]=function(_0x5e2290,_0x455b74){return _0x5e2290[_0xf50b('0x7')](_0xf50b('0x8'),attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x13d59c,_0x155d4d,_0x49ea71){if(_0x13d59c['changed']('closed')){_0x13d59c['closedAt']=moment()[_0xf50b('0x9')](_0xf50b('0xa'));}_0x49ea71(null,_0x13d59c);}}});}; \ No newline at end of file +var _0x34a4=['./whatsappInteraction.attributes','exports','WhatsappInteraction','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3a3cb8,_0x4b1190){var _0xefd863=function(_0xe18708){while(--_0xe18708){_0x3a3cb8['push'](_0x3a3cb8['shift']());}};_0xefd863(++_0x4b1190);}(_0x34a4,0x1d3));var _0x434a=function(_0x23e33d,_0x31c8c8){_0x23e33d=_0x23e33d-0x0;var _0x818fc=_0x34a4[_0x23e33d];return _0x818fc;};'use strict';var _=require(_0x434a('0x0'));var util=require('util');var logger=require(_0x434a('0x1'))(_0x434a('0x2'));var moment=require(_0x434a('0x3'));var BPromise=require(_0x434a('0x4'));var rp=require(_0x434a('0x5'));var fs=require('fs');var path=require(_0x434a('0x6'));var rimraf=require(_0x434a('0x7'));var config=require(_0x434a('0x8'));var attributes=require(_0x434a('0x9'));module[_0x434a('0xa')]=function(_0x227a96,_0x283ee2){return _0x227a96['define'](_0x434a('0xb'),attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4bd027,_0x35c994,_0x2aef47){if(_0x4bd027[_0x434a('0xc')](_0x434a('0xd'))){_0x4bd027[_0x434a('0xe')]=moment()[_0x434a('0xf')](_0x434a('0x10'));}_0x2aef47(null,_0x4bd027);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index d5c44a0..997d23f 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 _0x41f1=['where','addTags','omit','AddTags','util','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','http','defaults','redis','localhost','./whatsappInteraction.socket','register','then','info','debug','request\x20sent','stringify','error','code','WhatsappInteraction,\x20%s,\x20%s','message','result','UpdateWhatsappInteraction','body','options','raw','attributes','limit','catch','AddTagsToWhatsappInteraction','WhatsappInteraction','find'];(function(_0x316d2a,_0x1ab4f3){var _0x2941c8=function(_0x2d1f75){while(--_0x2d1f75){_0x316d2a['push'](_0x316d2a['shift']());}};_0x2941c8(++_0x1ab4f3);}(_0x41f1,0x1d8));var _0x141f=function(_0x2ecd91,_0x1f21e8){_0x2ecd91=_0x2ecd91-0x0;var _0x3bf737=_0x41f1[_0x2ecd91];return _0x3bf737;};'use strict';var _=require('lodash');var util=require(_0x141f('0x0'));var moment=require('moment');var BPromise=require(_0x141f('0x1'));var rs=require(_0x141f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x141f('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x141f('0x4'))('rpc');var config=require(_0x141f('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0x141f('0x6')]({'port':0x232a});config['redis']=_[_0x141f('0x7')](config[_0x141f('0x8')],{'host':_0x141f('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x141f('0x8')]));require(_0x141f('0xa'))[_0x141f('0xb')](socket);function respondWithRpcPromise(_0x837e4d,_0x322cd5,_0x3b927c){return new BPromise(function(_0x17b3db,_0x3c168e){return client['request'](_0x837e4d,_0x3b927c)[_0x141f('0xc')](function(_0x5e2b22){logger[_0x141f('0xd')]('WhatsappInteraction,\x20%s,\x20%s',_0x322cd5,'request\x20sent');logger[_0x141f('0xe')]('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x322cd5,_0x141f('0xf'),JSON[_0x141f('0x10')](_0x5e2b22));if(_0x5e2b22['error']){if(_0x5e2b22[_0x141f('0x11')][_0x141f('0x12')]===0x1f4){logger[_0x141f('0x11')](_0x141f('0x13'),_0x322cd5,_0x5e2b22['error'][_0x141f('0x14')]);return _0x3c168e(_0x5e2b22['error'][_0x141f('0x14')]);}logger[_0x141f('0x11')](_0x141f('0x13'),_0x322cd5,_0x5e2b22[_0x141f('0x11')][_0x141f('0x14')]);return _0x17b3db(_0x5e2b22[_0x141f('0x11')][_0x141f('0x14')]);}else{logger['info'](_0x141f('0x13'),_0x322cd5,_0x141f('0xf'));_0x17b3db(_0x5e2b22[_0x141f('0x15')][_0x141f('0x14')]);}})['catch'](function(_0x1b30f9){logger['error'](_0x141f('0x13'),_0x322cd5,_0x1b30f9);_0x3c168e(_0x1b30f9);});});}exports[_0x141f('0x16')]=function(_0x5e610d){var _0x5c7202=this;return new Promise(function(_0x5afdc5,_0x1161f3){return db['WhatsappInteraction']['update'](_0x5e610d[_0x141f('0x17')],{'raw':_0x5e610d[_0x141f('0x18')]?_0x5e610d[_0x141f('0x18')][_0x141f('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5e610d[_0x141f('0x18')]?_0x5e610d[_0x141f('0x18')]['where']||null:null,'attributes':_0x5e610d['options']?_0x5e610d[_0x141f('0x18')][_0x141f('0x1a')]||null:null,'limit':_0x5e610d[_0x141f('0x18')]?_0x5e610d[_0x141f('0x18')][_0x141f('0x1b')]||null:null})[_0x141f('0xc')](function(_0x2ac8e2){logger['info'](_0x141f('0x16'),_0x5e610d);logger['debug'](_0x141f('0x16'),_0x5e610d,JSON[_0x141f('0x10')](_0x2ac8e2));_0x5afdc5(_0x2ac8e2);})[_0x141f('0x1c')](function(_0x1f4c4f){logger[_0x141f('0x11')](_0x141f('0x16'),_0x1f4c4f[_0x141f('0x14')],_0x5e610d);_0x1161f3(_0x5c7202[_0x141f('0x11')](0x1f4,_0x1f4c4f[_0x141f('0x14')]));});});};exports[_0x141f('0x1d')]=function(_0x1ae163){return new Promise(function(_0x37c8ba,_0x244f25){return db[_0x141f('0x1e')][_0x141f('0x1f')]({'where':_0x1ae163[_0x141f('0x18')]?_0x1ae163[_0x141f('0x18')][_0x141f('0x20')]||null:null})['then'](function(_0xd61f1e){if(_0xd61f1e){return _0xd61f1e[_0x141f('0x21')](_0x1ae163[_0x141f('0x17')]['ids'],_[_0x141f('0x22')](_0x1ae163[_0x141f('0x17')],['ids','id'])||{});}})['spread'](function(_0x14dd77){logger['info'](_0x141f('0x23'),_0x1ae163);logger[_0x141f('0xe')]('AddTags',_0x1ae163,JSON[_0x141f('0x10')](_0x14dd77));_0x37c8ba(_0x14dd77);})[_0x141f('0x1c')](function(_0x570fa7){logger[_0x141f('0x11')](_0x141f('0x23'),_0x570fa7[_0x141f('0x14')],_0x1ae163);_0x244f25(_this[_0x141f('0x11')](0x1f4,_0x570fa7[_0x141f('0x14')]));});});}; \ No newline at end of file +var _0xe35f=['addTags','ids','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','defaults','localhost','socket.io-emitter','register','request','then','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','catch','WhatsappInteraction,\x20%s,\x20%s','UpdateWhatsappInteraction','WhatsappInteraction','update','raw','options','where','attributes','limit','stringify','AddTagsToWhatsappInteraction','find'];(function(_0x451959,_0x18c7a5){var _0x490269=function(_0x40cf17){while(--_0x40cf17){_0x451959['push'](_0x451959['shift']());}};_0x490269(++_0x18c7a5);}(_0xe35f,0x79));var _0xfe35=function(_0x2d067e,_0x3fef12){_0x2d067e=_0x2d067e-0x0;var _0x27fd86=_0xe35f[_0x2d067e];return _0x27fd86;};'use strict';var _=require(_0xfe35('0x0'));var util=require(_0xfe35('0x1'));var moment=require(_0xfe35('0x2'));var BPromise=require('bluebird');var rs=require(_0xfe35('0x3'));var fs=require('fs');var Redis=require(_0xfe35('0x4'));var db=require(_0xfe35('0x5'))['db'];var utils=require(_0xfe35('0x6'));var logger=require(_0xfe35('0x7'))('rpc');var config=require(_0xfe35('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xfe35('0x9')]['http']({'port':0x232a});config['redis']=_[_0xfe35('0xa')](config['redis'],{'host':_0xfe35('0xb'),'port':0x18eb});var socket=require(_0xfe35('0xc'))(new Redis(config['redis']));require('./whatsappInteraction.socket')[_0xfe35('0xd')](socket);function respondWithRpcPromise(_0x3843db,_0x344b86,_0x4c7dd7){return new BPromise(function(_0x40cd41,_0x3e3196){return client[_0xfe35('0xe')](_0x3843db,_0x4c7dd7)[_0xfe35('0xf')](function(_0x32316e){logger['info']('WhatsappInteraction,\x20%s,\x20%s',_0x344b86,'request\x20sent');logger[_0xfe35('0x10')](_0xfe35('0x11'),_0x344b86,_0xfe35('0x12'),JSON['stringify'](_0x32316e));if(_0x32316e['error']){if(_0x32316e['error']['code']===0x1f4){logger[_0xfe35('0x13')]('WhatsappInteraction,\x20%s,\x20%s',_0x344b86,_0x32316e['error'][_0xfe35('0x14')]);return _0x3e3196(_0x32316e['error'][_0xfe35('0x14')]);}logger['error']('WhatsappInteraction,\x20%s,\x20%s',_0x344b86,_0x32316e[_0xfe35('0x13')]['message']);return _0x40cd41(_0x32316e[_0xfe35('0x13')][_0xfe35('0x14')]);}else{logger[_0xfe35('0x15')]('WhatsappInteraction,\x20%s,\x20%s',_0x344b86,_0xfe35('0x12'));_0x40cd41(_0x32316e['result'][_0xfe35('0x14')]);}})[_0xfe35('0x16')](function(_0x1af81a){logger[_0xfe35('0x13')](_0xfe35('0x17'),_0x344b86,_0x1af81a);_0x3e3196(_0x1af81a);});});}exports[_0xfe35('0x18')]=function(_0x21fe80){var _0x1ee41e=this;return new Promise(function(_0x1ff1c6,_0x4c0665){return db[_0xfe35('0x19')][_0xfe35('0x1a')](_0x21fe80['body'],{'raw':_0x21fe80['options']?_0x21fe80['options'][_0xfe35('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x21fe80[_0xfe35('0x1c')]?_0x21fe80[_0xfe35('0x1c')][_0xfe35('0x1d')]||null:null,'attributes':_0x21fe80[_0xfe35('0x1c')]?_0x21fe80[_0xfe35('0x1c')][_0xfe35('0x1e')]||null:null,'limit':_0x21fe80[_0xfe35('0x1c')]?_0x21fe80['options'][_0xfe35('0x1f')]||null:null})['then'](function(_0x2b8d22){logger[_0xfe35('0x15')](_0xfe35('0x18'),_0x21fe80);logger[_0xfe35('0x10')](_0xfe35('0x18'),_0x21fe80,JSON[_0xfe35('0x20')](_0x2b8d22));_0x1ff1c6(_0x2b8d22);})[_0xfe35('0x16')](function(_0x23fa32){logger[_0xfe35('0x13')](_0xfe35('0x18'),_0x23fa32['message'],_0x21fe80);_0x4c0665(_0x1ee41e[_0xfe35('0x13')](0x1f4,_0x23fa32[_0xfe35('0x14')]));});});};exports[_0xfe35('0x21')]=function(_0x59f0c5){return new Promise(function(_0x4747eb,_0x16be26){return db[_0xfe35('0x19')][_0xfe35('0x22')]({'where':_0x59f0c5['options']?_0x59f0c5[_0xfe35('0x1c')][_0xfe35('0x1d')]||null:null})['then'](function(_0xada1dc){if(_0xada1dc){return _0xada1dc[_0xfe35('0x23')](_0x59f0c5['body'][_0xfe35('0x24')],_['omit'](_0x59f0c5['body'],['ids','id'])||{});}})[_0xfe35('0x25')](function(_0x4d1338){logger['info']('AddTags',_0x59f0c5);logger[_0xfe35('0x10')](_0xfe35('0x26'),_0x59f0c5,JSON[_0xfe35('0x20')](_0x4d1338));_0x4747eb(_0x4d1338);})[_0xfe35('0x16')](function(_0x30cfd5){logger[_0xfe35('0x13')](_0xfe35('0x26'),_0x30cfd5[_0xfe35('0x14')],_0x59f0c5);_0x16be26(_this[_0xfe35('0x13')](0x1f4,_0x30cfd5[_0xfe35('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 3eae2bb..0efac62 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 _0x05d0=['removeListener','length','whatsappInteraction:','./whatsappInteraction.events','save','remove','update'];(function(_0x51f900,_0x5d309f){var _0x24d395=function(_0x44b664){while(--_0x44b664){_0x51f900['push'](_0x51f900['shift']());}};_0x24d395(++_0x5d309f);}(_0x05d0,0x13e));var _0x005d=function(_0x26e0d9,_0x3bbeff){_0x26e0d9=_0x26e0d9-0x0;var _0x3ed4bb=_0x05d0[_0x26e0d9];return _0x3ed4bb;};'use strict';var WhatsappInteractionEvents=require(_0x005d('0x0'));var events=[_0x005d('0x1'),_0x005d('0x2'),_0x005d('0x3')];function createListener(_0x1adfac,_0x5cea6d){return function(_0x1fd255){_0x5cea6d['emit'](_0x1adfac,_0x1fd255);};}function removeListener(_0x1dc9e6,_0x29c0c4){return function(){WhatsappInteractionEvents[_0x005d('0x4')](_0x1dc9e6,_0x29c0c4);};}exports['register']=function(_0x239efa){for(var _0x20203d=0x0,_0xbb7bd0=events[_0x005d('0x5')];_0x20203d<_0xbb7bd0;_0x20203d++){var _0x10feea=events[_0x20203d];var _0x4ba251=createListener(_0x005d('0x6')+_0x10feea,_0x239efa);WhatsappInteractionEvents['on'](_0x10feea,_0x4ba251);}}; \ No newline at end of file +var _0x4c27=['removeListener','register','length','save','remove','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4c27,0x14d));var _0x74c2=function(_0x21892b,_0x437127){_0x21892b=_0x21892b-0x0;var _0x21865b=_0x4c27[_0x21892b];return _0x21865b;};'use strict';var WhatsappInteractionEvents=require('./whatsappInteraction.events');var events=[_0x74c2('0x0'),_0x74c2('0x1'),'update'];function createListener(_0x59bcc1,_0xf013d7){return function(_0x4cb14c){_0xf013d7[_0x74c2('0x2')](_0x59bcc1,_0x4cb14c);};}function removeListener(_0xa2cefc,_0x2ee53){return function(){WhatsappInteractionEvents[_0x74c2('0x3')](_0xa2cefc,_0x2ee53);};}exports[_0x74c2('0x4')]=function(_0x3f4c67){for(var _0x35e875=0x0,_0x439442=events[_0x74c2('0x5')];_0x35e875<_0x439442;_0x35e875++){var _0x5225b0=events[_0x35e875];var _0x1eece9=createListener('whatsappInteraction:'+_0x5225b0,_0x3f4c67);WhatsappInteractionEvents['on'](_0x5225b0,_0x1eece9);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index caa857b..a4630a3 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 _0x9913=['/describe','/:id','show','post','tracked','whatsapp','whatsappmessage:create','create','/:id/status','status','put','/:id/reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappMessage.controller','isAuthenticated','index','get'];(function(_0x53a58a,_0x474bd3){var _0x2df429=function(_0x44de92){while(--_0x44de92){_0x53a58a['push'](_0x53a58a['shift']());}};_0x2df429(++_0x474bd3);}(_0x9913,0x127));var _0x3991=function(_0x514260,_0x1891e1){_0x514260=_0x514260-0x0;var _0x4ac81b=_0x9913[_0x514260];return _0x4ac81b;};'use strict';var multer=require(_0x3991('0x0'));var util=require(_0x3991('0x1'));var path=require(_0x3991('0x2'));var timeout=require(_0x3991('0x3'));var express=require(_0x3991('0x4'));var router=express[_0x3991('0x5')]();var fs_extra=require(_0x3991('0x6'));var auth=require(_0x3991('0x7'));var interaction=require(_0x3991('0x8'));var config=require('../../config/environment');var controller=require(_0x3991('0x9'));router['get']('/',auth[_0x3991('0xa')](),controller[_0x3991('0xb')]);router[_0x3991('0xc')](_0x3991('0xd'),auth[_0x3991('0xa')](),controller['describe']);router[_0x3991('0xc')](_0x3991('0xe'),auth[_0x3991('0xa')](),controller[_0x3991('0xf')]);router[_0x3991('0x10')]('/',auth[_0x3991('0xa')](),interaction[_0x3991('0x11')](_0x3991('0x12'),_0x3991('0x13')),controller[_0x3991('0x14')]);router['post'](_0x3991('0x15'),controller[_0x3991('0x16')]);router[_0x3991('0x17')](_0x3991('0xe'),auth[_0x3991('0xa')](),controller['update']);router[_0x3991('0x17')]('/:id/accept',auth[_0x3991('0xa')](),controller['accept']);router[_0x3991('0x17')](_0x3991('0x18'),auth[_0x3991('0xa')](),controller['reject']);router[_0x3991('0x19')](_0x3991('0xe'),auth['isAuthenticated'](),controller[_0x3991('0x1a')]);module[_0x3991('0x1b')]=router; \ No newline at end of file +var _0xa437=['path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','whatsapp','whatsappmessage:create','create','/:id/status','status','update','/:id/accept','accept','reject','delete','exports','multer','util'];(function(_0x279794,_0x194939){var _0x3ea364=function(_0x2cea71){while(--_0x2cea71){_0x279794['push'](_0x279794['shift']());}};_0x3ea364(++_0x194939);}(_0xa437,0x142));var _0x7a43=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa437[_0xf0bcac];return _0x4e4c65;};'use strict';var multer=require(_0x7a43('0x0'));var util=require(_0x7a43('0x1'));var path=require(_0x7a43('0x2'));var timeout=require('connect-timeout');var express=require(_0x7a43('0x3'));var router=express['Router']();var fs_extra=require(_0x7a43('0x4'));var auth=require(_0x7a43('0x5'));var interaction=require(_0x7a43('0x6'));var config=require('../../config/environment');var controller=require(_0x7a43('0x7'));router[_0x7a43('0x8')]('/',auth[_0x7a43('0x9')](),controller[_0x7a43('0xa')]);router[_0x7a43('0x8')](_0x7a43('0xb'),auth['isAuthenticated'](),controller[_0x7a43('0xc')]);router[_0x7a43('0x8')](_0x7a43('0xd'),auth['isAuthenticated'](),controller[_0x7a43('0xe')]);router[_0x7a43('0xf')]('/',auth[_0x7a43('0x9')](),interaction['tracked'](_0x7a43('0x10'),_0x7a43('0x11')),controller[_0x7a43('0x12')]);router['post'](_0x7a43('0x13'),controller[_0x7a43('0x14')]);router['put'](_0x7a43('0xd'),auth[_0x7a43('0x9')](),controller[_0x7a43('0x15')]);router['put'](_0x7a43('0x16'),auth[_0x7a43('0x9')](),controller[_0x7a43('0x17')]);router['put']('/:id/reject',auth[_0x7a43('0x9')](),controller[_0x7a43('0x18')]);router[_0x7a43('0x19')]('/:id',auth[_0x7a43('0x9')](),controller['destroy']);module[_0x7a43('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 053fbe6..9a0b0c2 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 _0xe5e7=['out','STRING','DATE','TEXT','medium','BOOLEAN','ENUM'];(function(_0x4cccd5,_0x2c1054){var _0x5f62b9=function(_0x37310e){while(--_0x37310e){_0x4cccd5['push'](_0x4cccd5['shift']());}};_0x5f62b9(++_0x2c1054);}(_0xe5e7,0x10d));var _0x7e5e=function(_0x2f0340,_0x506e25){_0x2f0340=_0x2f0340-0x0;var _0xe5a7c0=_0xe5e7[_0x2f0340];return _0xe5a7c0;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x7e5e('0x0')](_0x7e5e('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x7e5e('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x7e5e('0x3')]('in',_0x7e5e('0x4')),'defaultValue':_0x7e5e('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0x7e5e('0x5')](0xbe)},'phone':{'type':Sequelize[_0x7e5e('0x5')]},'readAt':{'type':Sequelize[_0x7e5e('0x6')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x7e5e('0x0')]}}; \ No newline at end of file +var _0xa8b1=['medium','BOOLEAN','ENUM','out','STRING','DATE','sequelize','TEXT'];(function(_0x32214a,_0x24fb09){var _0x1ce1a5=function(_0x58a5ea){while(--_0x58a5ea){_0x32214a['push'](_0x32214a['shift']());}};_0x1ce1a5(++_0x24fb09);}(_0xa8b1,0xae));var _0x1a8b=function(_0xaa600e,_0x5cb705){_0xaa600e=_0xaa600e-0x0;var _0x224ea6=_0xa8b1[_0xaa600e];return _0x224ea6;};'use strict';var Sequelize=require(_0x1a8b('0x0'));module['exports']={'body':{'type':Sequelize[_0x1a8b('0x1')](_0x1a8b('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x1a8b('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x1a8b('0x4')]('in',_0x1a8b('0x5')),'defaultValue':_0x1a8b('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x1a8b('0x6')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x1a8b('0x7')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0x1a8b('0x6')]},'providerResponse':{'type':Sequelize[_0x1a8b('0x1')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index ae20625..e294b86 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 _0xb30b=['status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','WhatsappMessage','params','keys','rawAttributes','find','create','body','describe','accept','whatsapp','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','WhatsappInteraction','isNil','read1stAt','format','[WHATSAPPMESSAGE: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','SELECT','contact','User','agent','fullname','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','../../config/logger','whatsapp-interactions','WhatsappInteractionId','interaction','null','RejectMessage','rejectMessage','Sequelize','QueryTypes','WhatsappAccount','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','twilio','MessageSid','messageId','MessageStatus','read','WhatsappAccount,\x20%s,\x20%s,\x20%s','inspect','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','jayson/promise','client','http','request','then','info','WhatsappMessage,\x20%s,\x20%s','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus'];(function(_0x1a0dae,_0x5a23e8){var _0x2a27d2=function(_0x4cdca5){while(--_0x4cdca5){_0x1a0dae['push'](_0x1a0dae['shift']());}};_0x2a27d2(++_0x5a23e8);}(_0xb30b,0xf4));var _0xbb30=function(_0x1d2f43,_0x4d8001){_0x1d2f43=_0x1d2f43-0x0;var _0x582740=_0xb30b[_0x1d2f43];return _0x582740;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbb30('0x0'));var zipdir=require(_0xbb30('0x1'));var jsonpatch=require(_0xbb30('0x2'));var rp=require(_0xbb30('0x3'));var moment=require(_0xbb30('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xbb30('0x5'));var util=require(_0xbb30('0x6'));var path=require(_0xbb30('0x7'));var sox=require(_0xbb30('0x8'));var csv=require(_0xbb30('0x9'));var ejs=require(_0xbb30('0xa'));var fs=require('fs');var fs_extra=require(_0xbb30('0xb'));var _=require(_0xbb30('0xc'));var squel=require(_0xbb30('0xd'));var crypto=require(_0xbb30('0xe'));var jsforce=require(_0xbb30('0xf'));var deskjs=require(_0xbb30('0x10'));var toCsv=require('to-csv');var querystring=require(_0xbb30('0x11'));var Papa=require(_0xbb30('0x12'));var Redis=require(_0xbb30('0x13'));var authService=require(_0xbb30('0x14'));var qs=require(_0xbb30('0x15'));var as=require(_0xbb30('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xbb30('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xbb30('0x18'));var db=require('../../mysqldb')['db'];config[_0xbb30('0x19')]=_[_0xbb30('0x1a')](config[_0xbb30('0x19')],{'host':_0xbb30('0x1b'),'port':0x18eb});var socket=require(_0xbb30('0x1c'))(new Redis(config[_0xbb30('0x19')]));require(_0xbb30('0x1d'))['register'](socket);var jayson=require(_0xbb30('0x1e'));var client=jayson[_0xbb30('0x1f')]['http']({'port':0x232c});var client9002=jayson[_0xbb30('0x1f')][_0xbb30('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x237a74,_0x976ba2,_0x5d056e,_0x27ef90){return new BPromise(function(_0x1e6258,_0x562dd4){var _0x4b2957=_0x27ef90||client;return _0x4b2957[_0xbb30('0x21')](_0x237a74,_0x5d056e)[_0xbb30('0x22')](function(_0x8ab462){logger[_0xbb30('0x23')](_0xbb30('0x24'),_0x976ba2,'request\x20sent');logger[_0xbb30('0x25')](_0xbb30('0x26'),_0x976ba2,_0xbb30('0x27'),JSON[_0xbb30('0x28')](_0x8ab462));if(_0x8ab462[_0xbb30('0x29')]){if(_0x8ab462[_0xbb30('0x29')]['code']===0x1f4){logger[_0xbb30('0x29')]('WhatsappMessage,\x20%s,\x20%s',_0x976ba2,_0x8ab462[_0xbb30('0x29')][_0xbb30('0x2a')]);return _0x562dd4(_0x8ab462['error'][_0xbb30('0x2a')]);}logger[_0xbb30('0x29')]('WhatsappMessage,\x20%s,\x20%s',_0x976ba2,_0x8ab462[_0xbb30('0x29')]['message']);return _0x1e6258(_0x8ab462[_0xbb30('0x29')][_0xbb30('0x2a')]);}else{logger['info'](_0xbb30('0x24'),_0x976ba2,'request\x20sent');_0x1e6258(_0x8ab462[_0xbb30('0x2b')]['message']);}})[_0xbb30('0x2c')](function(_0x249827){logger[_0xbb30('0x29')]('WhatsappMessage,\x20%s,\x20%s',_0x976ba2,_0x249827);_0x562dd4(_0x249827);});});}function respondWithStatusCode(_0x516558,_0x2befd9){_0x2befd9=_0x2befd9||0xcc;return function(_0x478dc4){if(_0x478dc4){return _0x516558[_0xbb30('0x2d')](_0x2befd9);}return _0x516558[_0xbb30('0x2e')](_0x2befd9)[_0xbb30('0x2f')]();};}function respondWithResult(_0x16dc60,_0x2c8aa2){_0x2c8aa2=_0x2c8aa2||0xc8;return function(_0x31e5d0){if(_0x31e5d0){return _0x16dc60[_0xbb30('0x2e')](_0x2c8aa2)[_0xbb30('0x30')](_0x31e5d0);}};}function respondWithFilteredResult(_0x29e332,_0x45d537){return function(_0x5a1c86){if(_0x5a1c86){var _0x2f3a6a=typeof _0x45d537[_0xbb30('0x31')]===_0xbb30('0x32')&&typeof _0x45d537[_0xbb30('0x33')]===_0xbb30('0x32');var _0x22e729=_0x5a1c86[_0xbb30('0x34')];var _0x2691fa=_0x2f3a6a?0x0:_0x45d537[_0xbb30('0x31')];var _0x232937=_0x2f3a6a?_0x5a1c86[_0xbb30('0x34')]:_0x45d537[_0xbb30('0x31')]+_0x45d537[_0xbb30('0x33')];var _0x33c6ad;if(_0x232937>=_0x22e729){_0x232937=_0x22e729;_0x33c6ad=0xc8;}else{_0x33c6ad=0xce;}_0x29e332[_0xbb30('0x2e')](_0x33c6ad);return _0x29e332[_0xbb30('0x35')](_0xbb30('0x36'),_0x2691fa+'-'+_0x232937+'/'+_0x22e729)[_0xbb30('0x30')](_0x5a1c86);}return null;};}function patchUpdates(_0xc56200){return function(_0x4c607d){try{jsonpatch[_0xbb30('0x37')](_0x4c607d,_0xc56200,!![]);}catch(_0x6d5ca9){return BPromise[_0xbb30('0x38')](_0x6d5ca9);}return _0x4c607d[_0xbb30('0x39')]();};}function saveUpdates(_0xb11b5b,_0x27572a){return function(_0x2cac8c){if(_0x2cac8c){return _0x2cac8c[_0xbb30('0x3a')](_0xb11b5b)['then'](function(_0x1fe0ad){return _0x1fe0ad;});}return null;};}function removeEntity(_0x24eec9,_0x2e8462){return function(_0x2c98cb){if(_0x2c98cb){return _0x2c98cb[_0xbb30('0x3b')]()[_0xbb30('0x22')](function(){_0x24eec9['status'](0xcc)[_0xbb30('0x2f')]();});}};}function handleEntityNotFound(_0x48b1bc,_0x5049ae){return function(_0x1d6f87){if(!_0x1d6f87){_0x48b1bc[_0xbb30('0x2d')](0x194);}return _0x1d6f87;};}function handleError(_0x5ad396,_0x17b4a0){_0x17b4a0=_0x17b4a0||0x1f4;return function(_0x2eafae){logger[_0xbb30('0x29')](_0x2eafae[_0xbb30('0x3c')]);if(_0x2eafae[_0xbb30('0x3d')]){delete _0x2eafae[_0xbb30('0x3d')];}_0x5ad396[_0xbb30('0x2e')](_0x17b4a0)[_0xbb30('0x3e')](_0x2eafae);};}exports[_0xbb30('0x3f')]=function(_0x3b8045,_0x153ded){var _0xeda9e={},_0xaa751b={},_0x114a2d={'count':0x0,'rows':[]};var _0x11459d=_[_0xbb30('0x40')](db['WhatsappMessage']['rawAttributes'],function(_0x4bdd1c){return{'name':_0x4bdd1c[_0xbb30('0x41')],'type':_0x4bdd1c[_0xbb30('0x42')][_0xbb30('0x43')]};});_0xaa751b[_0xbb30('0x44')]=_['map'](_0x11459d,_0xbb30('0x3d'));_0xaa751b[_0xbb30('0x45')]=_['keys'](_0x3b8045['query']);_0xaa751b[_0xbb30('0x46')]=_[_0xbb30('0x47')](_0xaa751b[_0xbb30('0x44')],_0xaa751b['query']);_0xeda9e['attributes']=_['intersection'](_0xaa751b[_0xbb30('0x44')],qs['fields'](_0x3b8045[_0xbb30('0x45')][_0xbb30('0x48')]));_0xeda9e['attributes']=_0xeda9e[_0xbb30('0x49')][_0xbb30('0x4a')]?_0xeda9e[_0xbb30('0x49')]:_0xaa751b[_0xbb30('0x44')];if(!_0x3b8045[_0xbb30('0x45')][_0xbb30('0x4b')](_0xbb30('0x4c'))){_0xeda9e[_0xbb30('0x33')]=qs[_0xbb30('0x33')](_0x3b8045['query'][_0xbb30('0x33')]);_0xeda9e[_0xbb30('0x31')]=qs[_0xbb30('0x31')](_0x3b8045[_0xbb30('0x45')][_0xbb30('0x31')]);}_0xeda9e['order']=qs[_0xbb30('0x4d')](_0x3b8045[_0xbb30('0x45')]['sort']);_0xeda9e['where']=qs[_0xbb30('0x46')](_[_0xbb30('0x4e')](_0x3b8045['query'],_0xaa751b['filters']),_0x11459d);if(_0x3b8045[_0xbb30('0x45')][_0xbb30('0x4f')]){_0xeda9e[_0xbb30('0x50')]=_[_0xbb30('0x51')](_0xeda9e['where'],{'$or':_['map'](_0x11459d,function(_0x1f8186){if(_0x1f8186[_0xbb30('0x42')]!==_0xbb30('0x52')){var _0x53f36f={};_0x53f36f[_0x1f8186[_0xbb30('0x3d')]]={'$like':'%'+_0x3b8045[_0xbb30('0x45')]['filter']+'%'};return _0x53f36f;}})});}_0xeda9e=_['merge']({},_0xeda9e,_0x3b8045[_0xbb30('0x53')]);var _0x5d8d8d={'where':_0xeda9e['where']};return db['WhatsappMessage'][_0xbb30('0x34')](_0x5d8d8d)['then'](function(_0x4eb1fe){_0x114a2d[_0xbb30('0x34')]=_0x4eb1fe;if(_0x3b8045[_0xbb30('0x45')][_0xbb30('0x54')]){_0xeda9e[_0xbb30('0x55')]=[{'all':!![]}];}return db[_0xbb30('0x56')]['findAll'](_0xeda9e);})[_0xbb30('0x22')](function(_0x28845a){_0x114a2d['rows']=_0x28845a;return _0x114a2d;})['then'](respondWithFilteredResult(_0x153ded,_0xeda9e))[_0xbb30('0x2c')](handleError(_0x153ded,null));};exports['show']=function(_0x47d3aa,_0x3b70c4){var _0x16259f={'raw':!![],'where':{'id':_0x47d3aa[_0xbb30('0x57')]['id']}},_0x114490={};_0x114490[_0xbb30('0x44')]=_[_0xbb30('0x58')](db['WhatsappMessage'][_0xbb30('0x59')]);_0x114490[_0xbb30('0x45')]=_[_0xbb30('0x58')](_0x47d3aa['query']);_0x114490[_0xbb30('0x46')]=_[_0xbb30('0x47')](_0x114490[_0xbb30('0x44')],_0x114490[_0xbb30('0x45')]);_0x16259f['attributes']=_[_0xbb30('0x47')](_0x114490['model'],qs[_0xbb30('0x48')](_0x47d3aa['query'][_0xbb30('0x48')]));_0x16259f['attributes']=_0x16259f[_0xbb30('0x49')][_0xbb30('0x4a')]?_0x16259f[_0xbb30('0x49')]:_0x114490['model'];if(_0x47d3aa[_0xbb30('0x45')][_0xbb30('0x54')]){_0x16259f['include']=[{'all':!![]}];}_0x16259f=_[_0xbb30('0x51')]({},_0x16259f,_0x47d3aa['options']);return db[_0xbb30('0x56')][_0xbb30('0x5a')](_0x16259f)[_0xbb30('0x22')](handleEntityNotFound(_0x3b70c4,null))[_0xbb30('0x22')](respondWithResult(_0x3b70c4,null))['catch'](handleError(_0x3b70c4,null));};exports[_0xbb30('0x5b')]=function(_0x35078d,_0x53a32e){return db[_0xbb30('0x56')][_0xbb30('0x5b')](_0x35078d['body'],{})[_0xbb30('0x22')](respondWithResult(_0x53a32e,0xc9))['catch'](handleError(_0x53a32e,null));};exports[_0xbb30('0x3a')]=function(_0x2b197f,_0x2d0249){if(_0x2b197f[_0xbb30('0x5c')]['id']){delete _0x2b197f[_0xbb30('0x5c')]['id'];}return db[_0xbb30('0x56')][_0xbb30('0x5a')]({'where':{'id':_0x2b197f[_0xbb30('0x57')]['id']}})[_0xbb30('0x22')](handleEntityNotFound(_0x2d0249,null))['then'](saveUpdates(_0x2b197f[_0xbb30('0x5c')],null))[_0xbb30('0x22')](respondWithResult(_0x2d0249,null))[_0xbb30('0x2c')](handleError(_0x2d0249,null));};exports['destroy']=function(_0x1286e0,_0x29d9a6){return db['WhatsappMessage'][_0xbb30('0x5a')]({'where':{'id':_0x1286e0['params']['id']}})[_0xbb30('0x22')](handleEntityNotFound(_0x29d9a6,null))['then'](removeEntity(_0x29d9a6,null))[_0xbb30('0x2c')](handleError(_0x29d9a6,null));};exports[_0xbb30('0x5d')]=function(_0x9637d,_0xc01a6e){return db[_0xbb30('0x56')][_0xbb30('0x5d')]()[_0xbb30('0x22')](respondWithResult(_0xc01a6e,null))[_0xbb30('0x2c')](handleError(_0xc01a6e,null));};var interaction_log=require('../../config/logger')('whatsapp-interactions');exports[_0xbb30('0x5e')]=function(_0x2f7b8e,_0xca90eb,_0x482669){var _0x4ac160={'agent':{},'channel':_0xbb30('0x5f')};if(_0x2f7b8e[_0xbb30('0x5c')]['id']){delete _0x2f7b8e[_0xbb30('0x5c')]['id'];}_0x2f7b8e['body']['read']=!![];_0x2f7b8e['body'][_0xbb30('0x60')]=moment()['format'](_0xbb30('0x61'));_0x2f7b8e['body']['UserId']=_0x2f7b8e['body'][_0xbb30('0x62')]||_0x2f7b8e[_0xbb30('0x63')]['id'];_0x4ac160['agent']['id']=_0x2f7b8e['body'][_0xbb30('0x62')];return db[_0xbb30('0x56')]['find']({'where':{'id':_0x2f7b8e[_0xbb30('0x57')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0xca90eb,null))['then'](saveUpdates(_0x2f7b8e['body'],null))[_0xbb30('0x22')](function(_0x12b7e7){if(_0x12b7e7){_0x4ac160[_0xbb30('0x2a')]=_0x12b7e7[_0xbb30('0x64')]({'plain':!![]});return db[_0xbb30('0x65')][_0xbb30('0x5a')]({'where':{'id':_0x12b7e7['WhatsappInteractionId']}});}return null;})['then'](handleEntityNotFound(_0xca90eb,null))['then'](function(_0x439f82){if(_0x439f82){return _0x439f82[_0xbb30('0x3a')]({'UserId':_0x2f7b8e['body'][_0xbb30('0x62')],'read1stAt':_[_0xbb30('0x66')](_0x439f82[_0xbb30('0x67')])?moment()[_0xbb30('0x68')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xbb30('0x22')](function(_0x51708c){if(_0x51708c){_0x4ac160['interaction']=_0x51708c[_0xbb30('0x64')]({'plain':!![]});interaction_log['info'](_0xbb30('0x69'),_0x2f7b8e[_0xbb30('0x63')]['id'],_0x2f7b8e[_0xbb30('0x63')][_0xbb30('0x3d')],_0x2f7b8e[_0xbb30('0x63')][_0xbb30('0x6a')],_0x4ac160['interaction']['id'],_0x2f7b8e[_0xbb30('0x5c')]?JSON['stringify'](_0x2f7b8e[_0xbb30('0x5c')]):'null');return respondWithRpcPromise(_0xbb30('0x6b'),_0xbb30('0x6c'),_0x4ac160);}return null;})['then'](function(_0x955e09){var _0x25edf0=_0xbb30('0x6d')+_0x955e09['message'][_0xbb30('0x6e')];return db[_0xbb30('0x6f')][_0xbb30('0x45')](_0x25edf0,{'type':db['Sequelize']['QueryTypes'][_0xbb30('0x70')],'raw':!![]})['then'](function(_0x2125a9){return _0x2125a9;});})[_0xbb30('0x22')](function(_0x2763a9){if(_0x2763a9){_0x4ac160[_0xbb30('0x2a')][_0xbb30('0x71')]=_0x2763a9[0x0];if(!_0x2f7b8e['body'][_0xbb30('0x62')])return;return db[_0xbb30('0x72')][_0xbb30('0x5a')]({'where':{'id':_0x2f7b8e['body']['UserId'],'role':_0xbb30('0x73')},'attributes':['id','name',_0xbb30('0x74'),_0xbb30('0x75'),_0xbb30('0x76')],'raw':!![]});}return null;})[_0xbb30('0x22')](function(_0x1d63d2){if(!_0x1d63d2)return null;_0x4ac160[_0xbb30('0x2a')][_0xbb30('0x73')]=_0x1d63d2;return _0x4ac160;})['then'](function(_0x8cb2ca){if(_0x8cb2ca){if(_0x2f7b8e[_0xbb30('0x5c')][_0xbb30('0x77')]){_0x4ac160[_0xbb30('0x2a')][_0xbb30('0x78')]=util[_0xbb30('0x68')](_0xbb30('0x79'),_0x2f7b8e[_0xbb30('0x63')][_0xbb30('0x3d')]);_0x4ac160[_0xbb30('0x2a')]['channel']=_0x4ac160[_0xbb30('0x7a')];_0x4ac160[_0xbb30('0x2a')]['motionChannel']=_0x4ac160[_0xbb30('0x7a')];_0x4ac160[_0xbb30('0x2a')][_0xbb30('0x7b')]=_0xbb30('0x5e');return respondWithRpcPromise(_0xbb30('0x7c'),_0xbb30('0x7c'),{'event':_0xbb30('0x7d'),'message':_0x4ac160[_0xbb30('0x2a')]},client9002)[_0xbb30('0x22')](function(){return _0x4ac160;});}return _0x4ac160;}return null;})[_0xbb30('0x22')](respondWithResult(_0xca90eb,null))[_0xbb30('0x2c')](handleError(_0xca90eb,null));};var interaction_log=require(_0xbb30('0x7e'))(_0xbb30('0x7f'));exports[_0xbb30('0x38')]=function(_0x380498,_0x4e75a5,_0x2081ee){var _0x5d3e53={'agent':{},'channel':_0xbb30('0x5f')};if(_0x380498[_0xbb30('0x5c')]['id']){delete _0x380498['body']['id'];}_0x380498[_0xbb30('0x5c')][_0xbb30('0x62')]=_0x380498[_0xbb30('0x5c')]['UserId']||_0x380498['user']['id'];_0x5d3e53['agent']['id']=_0x380498[_0xbb30('0x5c')][_0xbb30('0x62')];return db[_0xbb30('0x56')][_0xbb30('0x5a')]({'where':{'id':_0x380498[_0xbb30('0x57')]['id'],'UserId':null}})[_0xbb30('0x22')](handleEntityNotFound(_0x4e75a5,null))['then'](function(_0x3a1ce2){if(_0x3a1ce2){_0x5d3e53[_0xbb30('0x2a')]=_0x3a1ce2[_0xbb30('0x64')]({'plain':!![]});return db['WhatsappInteraction'][_0xbb30('0x5a')]({'where':{'id':_0x3a1ce2[_0xbb30('0x80')]}});}return null;})[_0xbb30('0x22')](handleEntityNotFound(_0x4e75a5,null))['then'](function(_0x46b0e3){if(_0x46b0e3){_0x5d3e53[_0xbb30('0x81')]=_0x46b0e3['get']({'plain':!![]});interaction_log['info']('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x380498[_0xbb30('0x63')]['id'],_0x380498[_0xbb30('0x63')][_0xbb30('0x3d')],_0x380498[_0xbb30('0x63')][_0xbb30('0x6a')],_0x5d3e53[_0xbb30('0x81')]['id'],_0x380498[_0xbb30('0x5c')]?JSON[_0xbb30('0x28')](_0x380498['body']):_0xbb30('0x82'));return respondWithRpcPromise(_0xbb30('0x83'),_0xbb30('0x84'),_0x5d3e53);}return null;})[_0xbb30('0x22')](function(_0x4e6789){var _0x36ad43=_0xbb30('0x6d')+_0x4e6789['message'][_0xbb30('0x6e')];return db['sequelize'][_0xbb30('0x45')](_0x36ad43,{'type':db[_0xbb30('0x85')][_0xbb30('0x86')][_0xbb30('0x70')],'raw':!![]})[_0xbb30('0x22')](function(_0x1db9d8){return _0x1db9d8;});})[_0xbb30('0x22')](function(_0x4731d7){if(_0x4731d7){_0x5d3e53['message'][_0xbb30('0x71')]=_0x4731d7[0x0];if(!_0x380498[_0xbb30('0x5c')][_0xbb30('0x62')])return;return db[_0xbb30('0x72')][_0xbb30('0x5a')]({'where':{'id':_0x380498['body'][_0xbb30('0x62')],'role':_0xbb30('0x73')},'attributes':['id',_0xbb30('0x3d'),_0xbb30('0x74'),_0xbb30('0x75'),_0xbb30('0x76')],'raw':!![]});}return null;})[_0xbb30('0x22')](function(_0x2873ea){if(!_0x2873ea)return null;_0x5d3e53[_0xbb30('0x2a')][_0xbb30('0x73')]=_0x2873ea;return _0x5d3e53;})[_0xbb30('0x22')](function(_0x59bd5f){if(_0x59bd5f){_0x59bd5f['message']['interface']=util['format']('SIP/%s',_0x380498[_0xbb30('0x63')][_0xbb30('0x3d')]);_0x59bd5f[_0xbb30('0x2a')][_0xbb30('0x7a')]=_0x5d3e53[_0xbb30('0x7a')];_0x59bd5f[_0xbb30('0x2a')]['motionChannel']=_0x5d3e53['channel'];_0x59bd5f[_0xbb30('0x2a')]['event']=_0xbb30('0x38');respondWithRpcPromise(_0xbb30('0x7c'),_0xbb30('0x7c'),{'event':'rejectmessage','message':_0x59bd5f[_0xbb30('0x2a')]},client9002);return _0x5d3e53;}return null;})[_0xbb30('0x22')](respondWithResult(_0x4e75a5,null))[_0xbb30('0x2c')](handleError(_0x4e75a5,null));};exports['status']=function(_0x418c59,_0x2c4951,_0x3b22ab){if(_0x418c59[_0xbb30('0x5c')]['id']){delete _0x418c59['body']['id'];}var _0x549bc6;return db[_0xbb30('0x56')][_0xbb30('0x5a')]({'where':{'id':_0x418c59[_0xbb30('0x57')]['id']}})[_0xbb30('0x22')](handleEntityNotFound(_0x2c4951,null))[_0xbb30('0x22')](function(_0x552427){if(_0x552427){_0x549bc6=_0x552427;return db[_0xbb30('0x87')]['find']({'where':{'id':_0x552427['WhatsappAccountId']}});}})[_0xbb30('0x22')](handleEntityNotFound(_0x2c4951,null))[_0xbb30('0x22')](function(_0x571dba){if(_0x571dba){logger[_0xbb30('0x25')](_0xbb30('0x88'),_0xbb30('0x2e'),_0xbb30('0x89'),_0x571dba['type'],util['inspect'](_0x418c59[_0xbb30('0x5c')],{'showHidden':![],'depth':null}));switch(_0x571dba[_0xbb30('0x42')]){case _0xbb30('0x8a'):if(_0x418c59[_0xbb30('0x5c')][_0xbb30('0x8b')]&&_0x418c59[_0xbb30('0x5c')][_0xbb30('0x8b')]===_0x549bc6[_0xbb30('0x8c')]&&_0x418c59[_0xbb30('0x5c')][_0xbb30('0x8d')]&&_0x418c59['body'][_0xbb30('0x8d')]===_0xbb30('0x8e')){return _0x549bc6['update']({'read':!![]});}else{logger[_0xbb30('0x29')](_0xbb30('0x8f'),_0xbb30('0x2e'),'twilio',util[_0xbb30('0x90')](_0x418c59['body'],{'showHidden':![],'depth':null}));}break;}return _0x549bc6;}})['then'](respondWithResult(_0x2c4951,null))[_0xbb30('0x2c')](handleError(_0x2c4951,null));}; \ No newline at end of file +var _0xcb04=['mustache','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','jayson/promise','client','http','request','info','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','WhatsappMessage,\x20%s,\x20%s','result','catch','sendStatus','end','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','index','map','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','hasOwnProperty','order','sort','where','pick','merge','filter','WhatsappMessage','include','findAll','rows','params','fields','length','includeAll','find','body','describe','../../config/logger','whatsapp-interactions','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','WhatsappInteraction','WhatsappInteractionId','read1stAt','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','User','agent','fullname','email','internal','interface','channel','motionChannel','event','EventManager','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','QueryTypes','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','request-promise','moment','bluebird'];(function(_0x467f4e,_0x2b2d7f){var _0x6f736a=function(_0x75a7bc){while(--_0x75a7bc){_0x467f4e['push'](_0x467f4e['shift']());}};_0x6f736a(++_0x2b2d7f);}(_0xcb04,0x7c));var _0x4cb0=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xcb04[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x4cb0('0x0'));var rimraf=require(_0x4cb0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4cb0('0x2'));var rp=require(_0x4cb0('0x3'));var moment=require(_0x4cb0('0x4'));var BPromise=require(_0x4cb0('0x5'));var Mustache=require(_0x4cb0('0x6'));var util=require('util');var path=require(_0x4cb0('0x7'));var sox=require(_0x4cb0('0x8'));var csv=require(_0x4cb0('0x9'));var ejs=require(_0x4cb0('0xa'));var fs=require('fs');var fs_extra=require(_0x4cb0('0xb'));var _=require(_0x4cb0('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4cb0('0xd'));var toCsv=require('to-csv');var querystring=require(_0x4cb0('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4cb0('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x4cb0('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4cb0('0x11'));var utils=require('../../config/utils');var config=require(_0x4cb0('0x12'));var licenseUtil=require(_0x4cb0('0x13'));var db=require(_0x4cb0('0x14'))['db'];config[_0x4cb0('0x15')]=_['defaults'](config[_0x4cb0('0x15')],{'host':_0x4cb0('0x16'),'port':0x18eb});var socket=require(_0x4cb0('0x17'))(new Redis(config[_0x4cb0('0x15')]));require('./whatsappMessage.socket')['register'](socket);var jayson=require(_0x4cb0('0x18'));var client=jayson[_0x4cb0('0x19')][_0x4cb0('0x1a')]({'port':0x232c});var client9002=jayson[_0x4cb0('0x19')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1d27ea,_0x10e384,_0x1df76e,_0xec86d2){return new BPromise(function(_0x2d4ab3,_0x51eebf){var _0x2d4695=_0xec86d2||client;return _0x2d4695[_0x4cb0('0x1b')](_0x1d27ea,_0x1df76e)['then'](function(_0x2c7e4b){logger[_0x4cb0('0x1c')]('WhatsappMessage,\x20%s,\x20%s',_0x10e384,_0x4cb0('0x1d'));logger[_0x4cb0('0x1e')](_0x4cb0('0x1f'),_0x10e384,_0x4cb0('0x1d'),JSON[_0x4cb0('0x20')](_0x2c7e4b));if(_0x2c7e4b[_0x4cb0('0x21')]){if(_0x2c7e4b[_0x4cb0('0x21')][_0x4cb0('0x22')]===0x1f4){logger[_0x4cb0('0x21')]('WhatsappMessage,\x20%s,\x20%s',_0x10e384,_0x2c7e4b[_0x4cb0('0x21')][_0x4cb0('0x23')]);return _0x51eebf(_0x2c7e4b['error']['message']);}logger[_0x4cb0('0x21')]('WhatsappMessage,\x20%s,\x20%s',_0x10e384,_0x2c7e4b[_0x4cb0('0x21')]['message']);return _0x2d4ab3(_0x2c7e4b[_0x4cb0('0x21')][_0x4cb0('0x23')]);}else{logger['info'](_0x4cb0('0x24'),_0x10e384,_0x4cb0('0x1d'));_0x2d4ab3(_0x2c7e4b[_0x4cb0('0x25')][_0x4cb0('0x23')]);}})[_0x4cb0('0x26')](function(_0x5a8a2c){logger[_0x4cb0('0x21')](_0x4cb0('0x24'),_0x10e384,_0x5a8a2c);_0x51eebf(_0x5a8a2c);});});}function respondWithStatusCode(_0x4e08d4,_0x85b2c9){_0x85b2c9=_0x85b2c9||0xcc;return function(_0x3cd8a9){if(_0x3cd8a9){return _0x4e08d4[_0x4cb0('0x27')](_0x85b2c9);}return _0x4e08d4['status'](_0x85b2c9)[_0x4cb0('0x28')]();};}function respondWithResult(_0x7dc9c9,_0x17c7f7){_0x17c7f7=_0x17c7f7||0xc8;return function(_0x56291d){if(_0x56291d){return _0x7dc9c9[_0x4cb0('0x29')](_0x17c7f7)['json'](_0x56291d);}};}function respondWithFilteredResult(_0x337da9,_0xc6843a){return function(_0x375cc3){if(_0x375cc3){var _0x8a572c=typeof _0xc6843a['offset']===_0x4cb0('0x2a')&&typeof _0xc6843a[_0x4cb0('0x2b')]===_0x4cb0('0x2a');var _0x1db6c6=_0x375cc3[_0x4cb0('0x2c')];var _0x2d0fb4=_0x8a572c?0x0:_0xc6843a[_0x4cb0('0x2d')];var _0x227f83=_0x8a572c?_0x375cc3[_0x4cb0('0x2c')]:_0xc6843a[_0x4cb0('0x2d')]+_0xc6843a[_0x4cb0('0x2b')];var _0x114252;if(_0x227f83>=_0x1db6c6){_0x227f83=_0x1db6c6;_0x114252=0xc8;}else{_0x114252=0xce;}_0x337da9[_0x4cb0('0x29')](_0x114252);return _0x337da9[_0x4cb0('0x2e')](_0x4cb0('0x2f'),_0x2d0fb4+'-'+_0x227f83+'/'+_0x1db6c6)[_0x4cb0('0x30')](_0x375cc3);}return null;};}function patchUpdates(_0x88bce1){return function(_0x520637){try{jsonpatch[_0x4cb0('0x31')](_0x520637,_0x88bce1,!![]);}catch(_0x42b2ea){return BPromise[_0x4cb0('0x32')](_0x42b2ea);}return _0x520637[_0x4cb0('0x33')]();};}function saveUpdates(_0x52e918,_0x750a8e){return function(_0x486ba2){if(_0x486ba2){return _0x486ba2[_0x4cb0('0x34')](_0x52e918)[_0x4cb0('0x35')](function(_0x21df92){return _0x21df92;});}return null;};}function removeEntity(_0x123f13,_0x126eec){return function(_0x3910b1){if(_0x3910b1){return _0x3910b1[_0x4cb0('0x36')]()[_0x4cb0('0x35')](function(){_0x123f13[_0x4cb0('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c2c4c,_0x309fa4){return function(_0x3f0d19){if(!_0x3f0d19){_0x4c2c4c[_0x4cb0('0x27')](0x194);}return _0x3f0d19;};}function handleError(_0x265f7c,_0x369444){_0x369444=_0x369444||0x1f4;return function(_0x4ec599){logger[_0x4cb0('0x21')](_0x4ec599[_0x4cb0('0x37')]);if(_0x4ec599[_0x4cb0('0x38')]){delete _0x4ec599[_0x4cb0('0x38')];}_0x265f7c[_0x4cb0('0x29')](_0x369444)[_0x4cb0('0x39')](_0x4ec599);};}exports[_0x4cb0('0x3a')]=function(_0x1fe5fe,_0x26330a){var _0x398870={},_0xc132aa={},_0x2ac068={'count':0x0,'rows':[]};var _0x4fa651=_[_0x4cb0('0x3b')](db['WhatsappMessage'][_0x4cb0('0x3c')],function(_0xa89e0b){return{'name':_0xa89e0b['fieldName'],'type':_0xa89e0b[_0x4cb0('0x3d')][_0x4cb0('0x3e')]};});_0xc132aa['model']=_[_0x4cb0('0x3b')](_0x4fa651,_0x4cb0('0x38'));_0xc132aa[_0x4cb0('0x3f')]=_[_0x4cb0('0x40')](_0x1fe5fe[_0x4cb0('0x3f')]);_0xc132aa[_0x4cb0('0x41')]=_[_0x4cb0('0x42')](_0xc132aa[_0x4cb0('0x43')],_0xc132aa['query']);_0x398870[_0x4cb0('0x44')]=_[_0x4cb0('0x42')](_0xc132aa[_0x4cb0('0x43')],qs['fields'](_0x1fe5fe[_0x4cb0('0x3f')]['fields']));_0x398870[_0x4cb0('0x44')]=_0x398870['attributes']['length']?_0x398870[_0x4cb0('0x44')]:_0xc132aa[_0x4cb0('0x43')];if(!_0x1fe5fe[_0x4cb0('0x3f')][_0x4cb0('0x45')]('nolimit')){_0x398870[_0x4cb0('0x2b')]=qs['limit'](_0x1fe5fe['query'][_0x4cb0('0x2b')]);_0x398870[_0x4cb0('0x2d')]=qs['offset'](_0x1fe5fe[_0x4cb0('0x3f')][_0x4cb0('0x2d')]);}_0x398870[_0x4cb0('0x46')]=qs[_0x4cb0('0x47')](_0x1fe5fe[_0x4cb0('0x3f')][_0x4cb0('0x47')]);_0x398870[_0x4cb0('0x48')]=qs[_0x4cb0('0x41')](_[_0x4cb0('0x49')](_0x1fe5fe['query'],_0xc132aa[_0x4cb0('0x41')]),_0x4fa651);if(_0x1fe5fe['query']['filter']){_0x398870[_0x4cb0('0x48')]=_[_0x4cb0('0x4a')](_0x398870[_0x4cb0('0x48')],{'$or':_[_0x4cb0('0x3b')](_0x4fa651,function(_0x3f48f8){if(_0x3f48f8[_0x4cb0('0x3d')]!=='VIRTUAL'){var _0x7a3456={};_0x7a3456[_0x3f48f8['name']]={'$like':'%'+_0x1fe5fe[_0x4cb0('0x3f')][_0x4cb0('0x4b')]+'%'};return _0x7a3456;}})});}_0x398870=_['merge']({},_0x398870,_0x1fe5fe['options']);var _0x527666={'where':_0x398870['where']};return db[_0x4cb0('0x4c')]['count'](_0x527666)[_0x4cb0('0x35')](function(_0x2ec350){_0x2ac068[_0x4cb0('0x2c')]=_0x2ec350;if(_0x1fe5fe['query']['includeAll']){_0x398870[_0x4cb0('0x4d')]=[{'all':!![]}];}return db[_0x4cb0('0x4c')][_0x4cb0('0x4e')](_0x398870);})[_0x4cb0('0x35')](function(_0x3602b1){_0x2ac068[_0x4cb0('0x4f')]=_0x3602b1;return _0x2ac068;})[_0x4cb0('0x35')](respondWithFilteredResult(_0x26330a,_0x398870))['catch'](handleError(_0x26330a,null));};exports['show']=function(_0x282ed3,_0x154fe8){var _0x26e98a={'raw':!![],'where':{'id':_0x282ed3[_0x4cb0('0x50')]['id']}},_0x12f017={};_0x12f017[_0x4cb0('0x43')]=_[_0x4cb0('0x40')](db[_0x4cb0('0x4c')][_0x4cb0('0x3c')]);_0x12f017[_0x4cb0('0x3f')]=_[_0x4cb0('0x40')](_0x282ed3[_0x4cb0('0x3f')]);_0x12f017['filters']=_['intersection'](_0x12f017['model'],_0x12f017[_0x4cb0('0x3f')]);_0x26e98a[_0x4cb0('0x44')]=_[_0x4cb0('0x42')](_0x12f017[_0x4cb0('0x43')],qs[_0x4cb0('0x51')](_0x282ed3[_0x4cb0('0x3f')][_0x4cb0('0x51')]));_0x26e98a[_0x4cb0('0x44')]=_0x26e98a[_0x4cb0('0x44')][_0x4cb0('0x52')]?_0x26e98a['attributes']:_0x12f017[_0x4cb0('0x43')];if(_0x282ed3[_0x4cb0('0x3f')][_0x4cb0('0x53')]){_0x26e98a[_0x4cb0('0x4d')]=[{'all':!![]}];}_0x26e98a=_[_0x4cb0('0x4a')]({},_0x26e98a,_0x282ed3['options']);return db[_0x4cb0('0x4c')][_0x4cb0('0x54')](_0x26e98a)[_0x4cb0('0x35')](handleEntityNotFound(_0x154fe8,null))[_0x4cb0('0x35')](respondWithResult(_0x154fe8,null))['catch'](handleError(_0x154fe8,null));};exports['create']=function(_0x56ee22,_0xf78056){return db['WhatsappMessage']['create'](_0x56ee22['body'],{})[_0x4cb0('0x35')](respondWithResult(_0xf78056,0xc9))[_0x4cb0('0x26')](handleError(_0xf78056,null));};exports[_0x4cb0('0x34')]=function(_0x51b0c7,_0x458828){if(_0x51b0c7[_0x4cb0('0x55')]['id']){delete _0x51b0c7[_0x4cb0('0x55')]['id'];}return db['WhatsappMessage'][_0x4cb0('0x54')]({'where':{'id':_0x51b0c7[_0x4cb0('0x50')]['id']}})[_0x4cb0('0x35')](handleEntityNotFound(_0x458828,null))[_0x4cb0('0x35')](saveUpdates(_0x51b0c7[_0x4cb0('0x55')],null))[_0x4cb0('0x35')](respondWithResult(_0x458828,null))[_0x4cb0('0x26')](handleError(_0x458828,null));};exports['destroy']=function(_0x7ce3d6,_0x537650){return db[_0x4cb0('0x4c')][_0x4cb0('0x54')]({'where':{'id':_0x7ce3d6[_0x4cb0('0x50')]['id']}})[_0x4cb0('0x35')](handleEntityNotFound(_0x537650,null))[_0x4cb0('0x35')](removeEntity(_0x537650,null))[_0x4cb0('0x26')](handleError(_0x537650,null));};exports[_0x4cb0('0x56')]=function(_0x564bab,_0x16bf90){return db[_0x4cb0('0x4c')][_0x4cb0('0x56')]()[_0x4cb0('0x35')](respondWithResult(_0x16bf90,null))[_0x4cb0('0x26')](handleError(_0x16bf90,null));};var interaction_log=require(_0x4cb0('0x57'))(_0x4cb0('0x58'));exports['accept']=function(_0x142c0e,_0x1959a0,_0x3949fb){var _0x56af64={'agent':{},'channel':'whatsapp'};if(_0x142c0e[_0x4cb0('0x55')]['id']){delete _0x142c0e[_0x4cb0('0x55')]['id'];}_0x142c0e['body'][_0x4cb0('0x59')]=!![];_0x142c0e[_0x4cb0('0x55')][_0x4cb0('0x5a')]=moment()[_0x4cb0('0x5b')](_0x4cb0('0x5c'));_0x142c0e[_0x4cb0('0x55')][_0x4cb0('0x5d')]=_0x142c0e[_0x4cb0('0x55')][_0x4cb0('0x5d')]||_0x142c0e[_0x4cb0('0x5e')]['id'];_0x56af64['agent']['id']=_0x142c0e[_0x4cb0('0x55')][_0x4cb0('0x5d')];return db[_0x4cb0('0x4c')]['find']({'where':{'id':_0x142c0e[_0x4cb0('0x50')]['id'],'UserId':null}})[_0x4cb0('0x35')](handleEntityNotFound(_0x1959a0,null))['then'](saveUpdates(_0x142c0e[_0x4cb0('0x55')],null))['then'](function(_0x2ed9ed){if(_0x2ed9ed){_0x56af64[_0x4cb0('0x23')]=_0x2ed9ed[_0x4cb0('0x5f')]({'plain':!![]});return db[_0x4cb0('0x60')]['find']({'where':{'id':_0x2ed9ed[_0x4cb0('0x61')]}});}return null;})[_0x4cb0('0x35')](handleEntityNotFound(_0x1959a0,null))[_0x4cb0('0x35')](function(_0x2bb80d){if(_0x2bb80d){return _0x2bb80d[_0x4cb0('0x34')]({'UserId':_0x142c0e[_0x4cb0('0x55')][_0x4cb0('0x5d')],'read1stAt':_['isNil'](_0x2bb80d[_0x4cb0('0x62')])?moment()[_0x4cb0('0x5b')](_0x4cb0('0x5c')):undefined});}return null;})[_0x4cb0('0x35')](function(_0xf03614){if(_0xf03614){_0x56af64[_0x4cb0('0x63')]=_0xf03614[_0x4cb0('0x5f')]({'plain':!![]});interaction_log['info'](_0x4cb0('0x64'),_0x142c0e[_0x4cb0('0x5e')]['id'],_0x142c0e['user'][_0x4cb0('0x38')],_0x142c0e[_0x4cb0('0x5e')][_0x4cb0('0x65')],_0x56af64[_0x4cb0('0x63')]['id'],_0x142c0e[_0x4cb0('0x55')]?JSON[_0x4cb0('0x20')](_0x142c0e[_0x4cb0('0x55')]):'null');return respondWithRpcPromise(_0x4cb0('0x66'),'acceptMessage',_0x56af64);}return null;})[_0x4cb0('0x35')](function(_0x36f515){var _0x39edbc=_0x4cb0('0x67')+_0x36f515[_0x4cb0('0x23')][_0x4cb0('0x68')];return db[_0x4cb0('0x69')]['query'](_0x39edbc,{'type':db[_0x4cb0('0x6a')]['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x28102a){return _0x28102a;});})['then'](function(_0x4c1e45){if(_0x4c1e45){_0x56af64[_0x4cb0('0x23')]['contact']=_0x4c1e45[0x0];if(!_0x142c0e[_0x4cb0('0x55')][_0x4cb0('0x5d')])return;return db[_0x4cb0('0x6b')][_0x4cb0('0x54')]({'where':{'id':_0x142c0e['body'][_0x4cb0('0x5d')],'role':_0x4cb0('0x6c')},'attributes':['id',_0x4cb0('0x38'),_0x4cb0('0x6d'),_0x4cb0('0x6e'),_0x4cb0('0x6f')],'raw':!![]});}return null;})[_0x4cb0('0x35')](function(_0x3fe522){if(!_0x3fe522)return null;_0x56af64[_0x4cb0('0x23')][_0x4cb0('0x6c')]=_0x3fe522;return _0x56af64;})[_0x4cb0('0x35')](function(_0x18921c){if(_0x18921c){if(_0x142c0e[_0x4cb0('0x55')]['manual']){_0x56af64[_0x4cb0('0x23')][_0x4cb0('0x70')]=util[_0x4cb0('0x5b')]('SIP/%s',_0x142c0e[_0x4cb0('0x5e')][_0x4cb0('0x38')]);_0x56af64[_0x4cb0('0x23')]['channel']=_0x56af64[_0x4cb0('0x71')];_0x56af64[_0x4cb0('0x23')][_0x4cb0('0x72')]=_0x56af64[_0x4cb0('0x71')];_0x56af64['message'][_0x4cb0('0x73')]='accept';return respondWithRpcPromise(_0x4cb0('0x74'),_0x4cb0('0x74'),{'event':'acceptmessage','message':_0x56af64['message']},client9002)[_0x4cb0('0x35')](function(){return _0x56af64;});}return _0x56af64;}return null;})[_0x4cb0('0x35')](respondWithResult(_0x1959a0,null))[_0x4cb0('0x26')](handleError(_0x1959a0,null));};var interaction_log=require(_0x4cb0('0x57'))(_0x4cb0('0x58'));exports['reject']=function(_0x4497a0,_0x17709c,_0x3480b5){var _0x54c293={'agent':{},'channel':'whatsapp'};if(_0x4497a0['body']['id']){delete _0x4497a0[_0x4cb0('0x55')]['id'];}_0x4497a0[_0x4cb0('0x55')][_0x4cb0('0x5d')]=_0x4497a0[_0x4cb0('0x55')][_0x4cb0('0x5d')]||_0x4497a0[_0x4cb0('0x5e')]['id'];_0x54c293[_0x4cb0('0x6c')]['id']=_0x4497a0['body'][_0x4cb0('0x5d')];return db['WhatsappMessage'][_0x4cb0('0x54')]({'where':{'id':_0x4497a0[_0x4cb0('0x50')]['id'],'UserId':null}})[_0x4cb0('0x35')](handleEntityNotFound(_0x17709c,null))[_0x4cb0('0x35')](function(_0x2a74ac){if(_0x2a74ac){_0x54c293[_0x4cb0('0x23')]=_0x2a74ac['get']({'plain':!![]});return db[_0x4cb0('0x60')][_0x4cb0('0x54')]({'where':{'id':_0x2a74ac[_0x4cb0('0x61')]}});}return null;})['then'](handleEntityNotFound(_0x17709c,null))['then'](function(_0x533871){if(_0x533871){_0x54c293[_0x4cb0('0x63')]=_0x533871[_0x4cb0('0x5f')]({'plain':!![]});interaction_log['info'](_0x4cb0('0x75'),_0x4497a0[_0x4cb0('0x5e')]['id'],_0x4497a0[_0x4cb0('0x5e')]['name'],_0x4497a0[_0x4cb0('0x5e')]['role'],_0x54c293[_0x4cb0('0x63')]['id'],_0x4497a0['body']?JSON[_0x4cb0('0x20')](_0x4497a0['body']):'null');return respondWithRpcPromise(_0x4cb0('0x76'),'rejectMessage',_0x54c293);}return null;})['then'](function(_0x1b27fe){var _0x48a299=_0x4cb0('0x67')+_0x1b27fe['message'][_0x4cb0('0x68')];return db[_0x4cb0('0x69')][_0x4cb0('0x3f')](_0x48a299,{'type':db['Sequelize'][_0x4cb0('0x77')]['SELECT'],'raw':!![]})[_0x4cb0('0x35')](function(_0x4224bd){return _0x4224bd;});})['then'](function(_0x103869){if(_0x103869){_0x54c293['message']['contact']=_0x103869[0x0];if(!_0x4497a0[_0x4cb0('0x55')][_0x4cb0('0x5d')])return;return db[_0x4cb0('0x6b')][_0x4cb0('0x54')]({'where':{'id':_0x4497a0['body'][_0x4cb0('0x5d')],'role':'agent'},'attributes':['id','name',_0x4cb0('0x6d'),'email','internal'],'raw':!![]});}return null;})[_0x4cb0('0x35')](function(_0x55be63){if(!_0x55be63)return null;_0x54c293[_0x4cb0('0x23')]['agent']=_0x55be63;return _0x54c293;})[_0x4cb0('0x35')](function(_0x4b6c1f){if(_0x4b6c1f){_0x4b6c1f[_0x4cb0('0x23')][_0x4cb0('0x70')]=util[_0x4cb0('0x5b')]('SIP/%s',_0x4497a0['user'][_0x4cb0('0x38')]);_0x4b6c1f[_0x4cb0('0x23')]['channel']=_0x54c293[_0x4cb0('0x71')];_0x4b6c1f[_0x4cb0('0x23')][_0x4cb0('0x72')]=_0x54c293['channel'];_0x4b6c1f[_0x4cb0('0x23')][_0x4cb0('0x73')]='reject';respondWithRpcPromise('EventManager',_0x4cb0('0x74'),{'event':_0x4cb0('0x78'),'message':_0x4b6c1f[_0x4cb0('0x23')]},client9002);return _0x54c293;}return null;})['then'](respondWithResult(_0x17709c,null))[_0x4cb0('0x26')](handleError(_0x17709c,null));};exports[_0x4cb0('0x29')]=function(_0x2e1f8c,_0x3e9283,_0x1f37fc){if(_0x2e1f8c[_0x4cb0('0x55')]['id']){delete _0x2e1f8c[_0x4cb0('0x55')]['id'];}var _0x550536;return db[_0x4cb0('0x4c')]['find']({'where':{'id':_0x2e1f8c[_0x4cb0('0x50')]['id']}})[_0x4cb0('0x35')](handleEntityNotFound(_0x3e9283,null))['then'](function(_0x374ccd){if(_0x374ccd){_0x550536=_0x374ccd;return db[_0x4cb0('0x79')][_0x4cb0('0x54')]({'where':{'id':_0x374ccd[_0x4cb0('0x7a')]}});}})[_0x4cb0('0x35')](handleEntityNotFound(_0x3e9283,null))[_0x4cb0('0x35')](function(_0x5e0d18){if(_0x5e0d18){logger[_0x4cb0('0x1e')]('WhatsppMessage,\x20%s,\x20%s,\x20%s',_0x4cb0('0x29'),_0x4cb0('0x7b'),_0x5e0d18['type'],util[_0x4cb0('0x7c')](_0x2e1f8c[_0x4cb0('0x55')],{'showHidden':![],'depth':null}));switch(_0x5e0d18[_0x4cb0('0x3d')]){case _0x4cb0('0x7d'):if(_0x2e1f8c[_0x4cb0('0x55')][_0x4cb0('0x7e')]&&_0x2e1f8c['body'][_0x4cb0('0x7e')]===_0x550536[_0x4cb0('0x7f')]&&_0x2e1f8c['body'][_0x4cb0('0x80')]&&_0x2e1f8c[_0x4cb0('0x55')][_0x4cb0('0x80')]==='read'){return _0x550536[_0x4cb0('0x34')]({'read':!![]});}else{logger[_0x4cb0('0x21')](_0x4cb0('0x81'),_0x4cb0('0x29'),_0x4cb0('0x7d'),util[_0x4cb0('0x7c')](_0x2e1f8c[_0x4cb0('0x55')],{'showHidden':![],'depth':null}));}break;}return _0x550536;}})[_0x4cb0('0x35')](respondWithResult(_0x3e9283,null))[_0x4cb0('0x26')](handleError(_0x3e9283,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 48d098c..762fd0a 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 _0xf290=['update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners'];(function(_0x50809f,_0x308353){var _0x59fa49=function(_0x1f24b8){while(--_0x1f24b8){_0x50809f['push'](_0x50809f['shift']());}};_0x59fa49(++_0x308353);}(_0xf290,0xde));var _0x0f29=function(_0x2bcb75,_0x5789a7){_0x2bcb75=_0x2bcb75-0x0;var _0x175345=_0xf290[_0x2bcb75];return _0x175345;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require(_0x0f29('0x0'))['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x0f29('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0f29('0x2'),'afterDestroy':_0x0f29('0x3')};function emitEvent(_0x38f5b5){return function(_0x28b644,_0xfdab92,_0x5984ba){WhatsappMessageEvents[_0x0f29('0x4')](_0x38f5b5+':'+_0x28b644['id'],_0x28b644);WhatsappMessageEvents['emit'](_0x38f5b5,_0x28b644);_0x5984ba(null);};}for(var e in events){if(events[_0x0f29('0x5')](e)){var event=events[e];WhatsappMessage[_0x0f29('0x6')](e,emitEvent(event));}}module[_0x0f29('0x7')]=WhatsappMessageEvents; \ No newline at end of file +var _0x9434=['events','../../mysqldb','WhatsappMessage','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x450253,_0x14caa1){var _0x404757=function(_0x50ecbc){while(--_0x50ecbc){_0x450253['push'](_0x450253['shift']());}};_0x404757(++_0x14caa1);}(_0x9434,0x168));var _0x4943=function(_0x310ccf,_0xb9528){_0x310ccf=_0x310ccf-0x0;var _0xbd1e1f=_0x9434[_0x310ccf];return _0xbd1e1f;};'use strict';var EventEmitter=require(_0x4943('0x0'));var WhatsappMessage=require(_0x4943('0x1'))['db'][_0x4943('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x4943('0x3')](0x0);var events={'afterCreate':_0x4943('0x4'),'afterUpdate':_0x4943('0x5'),'afterDestroy':'remove'};function emitEvent(_0x1159f9){return function(_0xda4cba,_0x5117c7,_0x2ce3d9){WhatsappMessageEvents[_0x4943('0x6')](_0x1159f9+':'+_0xda4cba['id'],_0xda4cba);WhatsappMessageEvents['emit'](_0x1159f9,_0xda4cba);_0x2ce3d9(null);};}for(var e in events){if(events[_0x4943('0x7')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index ead70d5..cfc6006 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 _0xb767=['define','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','direction','toLowerCase','out','isNil','UserId','findOne','createdAt','catch','secret','WhatsappAccount','WhatsappAccountId','type','twilio','phone','authToken','messages','whatsapp:','remote','/api/whatsapp/messages/','token','then','sid','update','error','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','finally','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','request-promise','rimraf','./whatsappMessage.attributes','exports'];(function(_0x1e2321,_0x3ae1c5){var _0x1d346d=function(_0x24f171){while(--_0x24f171){_0x1e2321['push'](_0x1e2321['shift']());}};_0x1d346d(++_0x3ae1c5);}(_0xb767,0x160));var _0x7b76=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xb767[_0x42cae2];return _0x5f256f;};'use strict';var _=require('lodash');var util=require(_0x7b76('0x0'));var logger=require(_0x7b76('0x1'))('api');var moment=require(_0x7b76('0x2'));var BPromise=require(_0x7b76('0x3'));var rp=require(_0x7b76('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b76('0x5'));var config=require('../../config/environment');var attributes=require(_0x7b76('0x6'));module[_0x7b76('0x7')]=function(_0x355e86,_0x33c134){return _0x355e86[_0x7b76('0x8')]('WhatsappMessage',attributes,{'tableName':_0x7b76('0x9'),'paranoid':![],'indexes':[{'name':_0x7b76('0xa'),'fields':[_0x7b76('0xa')]},{'name':_0x7b76('0xb'),'fields':[_0x7b76('0xc')],'type':_0x7b76('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5bccca,_0x4b55c4,_0x78dfd7){var _0x4586a5=_0x355e86['models'];var _0xd76f29=_0x5bccca['get']({'plain':!![]});if(_0xd76f29[_0x7b76('0xe')][_0x7b76('0xf')]()==='in'||_0xd76f29['direction'][_0x7b76('0xf')]()===_0x7b76('0x10')&&!_0xd76f29['secret']&&!_[_0x7b76('0x11')](_0xd76f29[_0x7b76('0x12')])){_0x4586a5['WhatsappInteraction'][_0x7b76('0x13')]({'where':{'id':_0xd76f29['WhatsappInteractionId']}})['then'](function(_0x58f88b){if(_0x58f88b){_0x58f88b['update']({'lastMsgAt':_0xd76f29[_0x7b76('0x14')],'lastMsgDirection':_0xd76f29[_0x7b76('0xe')][_0x7b76('0xf')]()});}})[_0x7b76('0x15')](function(_0x453a63){console['error'](_0x453a63);});}if(_0xd76f29[_0x7b76('0xe')]==='out'&&!_0xd76f29[_0x7b76('0x16')]){var _0xc80c82;_0x4586a5[_0x7b76('0x17')]['find']({'where':{'id':_0xd76f29[_0x7b76('0x18')]},'raw':!![]})['then'](function(_0x2ef642){_0xc80c82=_0x2ef642;if(_0xc80c82&&_0xc80c82[_0x7b76('0x19')]){switch(_0xc80c82[_0x7b76('0x19')]){case _0x7b76('0x1a'):var _0x2a6a9f=require(_0x7b76('0x1a'));if(_0xc80c82['accountSid']&&_0xc80c82['authToken']&&_0xc80c82[_0x7b76('0x1b')]){var _0x1ac11d=new _0x2a6a9f(_0xc80c82['accountSid'],_0xc80c82[_0x7b76('0x1c')]);_0x1ac11d[_0x7b76('0x1d')]['create']({'body':_0xd76f29[_0x7b76('0xc')],'to':'whatsapp:'+_0xd76f29['phone'],'from':_0x7b76('0x1e')+_0xc80c82['phone'],'statusCallback':_0xc80c82[_0x7b76('0x1f')]+_0x7b76('0x20')+_0xd76f29['id']+'/status?token='+_0xc80c82[_0x7b76('0x21')]})[_0x7b76('0x22')](function(_0x3b3757){if(_0x3b3757[_0x7b76('0x23')]){return _0x5bccca[_0x7b76('0x24')]({'messageId':_0x3b3757[_0x7b76('0x23')]});}})[_0x7b76('0x15')](function(_0x520fb4){logger[_0x7b76('0x25')](_0x7b76('0x26'),_0x7b76('0x27'),_0x7b76('0x1a'),util[_0x7b76('0x28')](_0x520fb4,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x7b76('0x26'),'afterCreate',_0x7b76('0x1a'),_0x7b76('0x29'));}break;}}})[_0x7b76('0x2a')](function(){_0x78dfd7();});}else{_0x78dfd7();}}},'charset':_0x7b76('0x2b'),'collate':_0x7b76('0x2c')});}; \ No newline at end of file +var _0x9e58=['define','messageId','fti_whatsapp_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','isNil','UserId','WhatsappInteraction','WhatsappInteractionId','then','update','createdAt','catch','error','secret','WhatsappAccount','WhatsappAccountId','twilio','accountSid','authToken','create','phone','whatsapp:','/api/whatsapp/messages/','/status?token=','token','sid','afterCreate','WhatsappMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','finally','utf8mb4','utf8mb4_unicode_ci','util','api','moment','bluebird','path','./whatsappMessage.attributes','exports'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0x9e58,0x80));var _0x89e5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9e58[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x89e5('0x0'));var logger=require('../../config/logger')(_0x89e5('0x1'));var moment=require(_0x89e5('0x2'));var BPromise=require(_0x89e5('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x89e5('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x89e5('0x5'));module[_0x89e5('0x6')]=function(_0x4bd8ea,_0x3a17cb){return _0x4bd8ea[_0x89e5('0x7')]('WhatsappMessage',attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':_0x89e5('0x8'),'fields':[_0x89e5('0x8')]},{'name':_0x89e5('0x9'),'fields':[_0x89e5('0xa')],'type':_0x89e5('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2f2dac,_0x56df92,_0x5d8645){var _0x1c248d=_0x4bd8ea[_0x89e5('0xc')];var _0x1f7f00=_0x2f2dac[_0x89e5('0xd')]({'plain':!![]});if(_0x1f7f00[_0x89e5('0xe')][_0x89e5('0xf')]()==='in'||_0x1f7f00[_0x89e5('0xe')][_0x89e5('0xf')]()===_0x89e5('0x10')&&!_0x1f7f00['secret']&&!_[_0x89e5('0x11')](_0x1f7f00[_0x89e5('0x12')])){_0x1c248d[_0x89e5('0x13')]['findOne']({'where':{'id':_0x1f7f00[_0x89e5('0x14')]}})[_0x89e5('0x15')](function(_0x26860f){if(_0x26860f){_0x26860f[_0x89e5('0x16')]({'lastMsgAt':_0x1f7f00[_0x89e5('0x17')],'lastMsgDirection':_0x1f7f00[_0x89e5('0xe')]['toLowerCase']()});}})[_0x89e5('0x18')](function(_0x42606d){console[_0x89e5('0x19')](_0x42606d);});}if(_0x1f7f00[_0x89e5('0xe')]===_0x89e5('0x10')&&!_0x1f7f00[_0x89e5('0x1a')]){var _0x41dd49;_0x1c248d[_0x89e5('0x1b')]['find']({'where':{'id':_0x1f7f00[_0x89e5('0x1c')]},'raw':!![]})[_0x89e5('0x15')](function(_0x1322dd){_0x41dd49=_0x1322dd;if(_0x41dd49&&_0x41dd49['type']){switch(_0x41dd49['type']){case _0x89e5('0x1d'):var _0x1551e2=require(_0x89e5('0x1d'));if(_0x41dd49[_0x89e5('0x1e')]&&_0x41dd49['authToken']&&_0x41dd49['phone']){var _0x5d466b=new _0x1551e2(_0x41dd49[_0x89e5('0x1e')],_0x41dd49[_0x89e5('0x1f')]);_0x5d466b['messages'][_0x89e5('0x20')]({'body':_0x1f7f00['body'],'to':'whatsapp:'+_0x1f7f00[_0x89e5('0x21')],'from':_0x89e5('0x22')+_0x41dd49['phone'],'statusCallback':_0x41dd49['remote']+_0x89e5('0x23')+_0x1f7f00['id']+_0x89e5('0x24')+_0x41dd49[_0x89e5('0x25')]})[_0x89e5('0x15')](function(_0x36538d){if(_0x36538d[_0x89e5('0x26')]){return _0x2f2dac[_0x89e5('0x16')]({'messageId':_0x36538d[_0x89e5('0x26')]});}})[_0x89e5('0x18')](function(_0x3258a9){logger[_0x89e5('0x19')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x89e5('0x27'),'twilio',util['inspect'](_0x3258a9,{'showHidden':![],'depth':null}));});}else{logger[_0x89e5('0x19')](_0x89e5('0x28'),_0x89e5('0x27'),_0x89e5('0x1d'),_0x89e5('0x29'));}break;}}})[_0x89e5('0x2a')](function(){_0x5d8645();});}else{_0x5d8645();}}},'charset':_0x89e5('0x2b'),'collate':_0x89e5('0x2c')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index 2afc38d..017137e 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 _0xdd19=['then','info','WhatsappMessage,\x20%s,\x20%s','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateWhatsappMessage','WhatsappMessage','create','body','raw','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','redis','defaults','localhost','./whatsappMessage.socket','register','request'];(function(_0x2ea174,_0xb3181){var _0x5987c7=function(_0x3f7c44){while(--_0x3f7c44){_0x2ea174['push'](_0x2ea174['shift']());}};_0x5987c7(++_0xb3181);}(_0xdd19,0x8d));var _0x9dd1=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0xdd19[_0x1694f5];return _0x5b4321;};'use strict';var _=require(_0x9dd1('0x0'));var util=require(_0x9dd1('0x1'));var moment=require(_0x9dd1('0x2'));var BPromise=require(_0x9dd1('0x3'));var rs=require(_0x9dd1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9dd1('0x5'))['db'];var utils=require(_0x9dd1('0x6'));var logger=require('../../config/logger')(_0x9dd1('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x9dd1('0x8')]=_[_0x9dd1('0x9')](config['redis'],{'host':_0x9dd1('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9dd1('0x8')]));require(_0x9dd1('0xb'))[_0x9dd1('0xc')](socket);function respondWithRpcPromise(_0x2344a3,_0x17ce25,_0x100f69){return new BPromise(function(_0x12d239,_0x52981e){return client[_0x9dd1('0xd')](_0x2344a3,_0x100f69)[_0x9dd1('0xe')](function(_0x59cda2){logger[_0x9dd1('0xf')](_0x9dd1('0x10'),_0x17ce25,'request\x20sent');logger[_0x9dd1('0x11')](_0x9dd1('0x12'),_0x17ce25,_0x9dd1('0x13'),JSON[_0x9dd1('0x14')](_0x59cda2));if(_0x59cda2['error']){if(_0x59cda2[_0x9dd1('0x15')][_0x9dd1('0x16')]===0x1f4){logger[_0x9dd1('0x15')]('WhatsappMessage,\x20%s,\x20%s',_0x17ce25,_0x59cda2[_0x9dd1('0x15')]['message']);return _0x52981e(_0x59cda2[_0x9dd1('0x15')][_0x9dd1('0x17')]);}logger['error'](_0x9dd1('0x10'),_0x17ce25,_0x59cda2[_0x9dd1('0x15')][_0x9dd1('0x17')]);return _0x12d239(_0x59cda2[_0x9dd1('0x15')]['message']);}else{logger[_0x9dd1('0xf')](_0x9dd1('0x10'),_0x17ce25,_0x9dd1('0x13'));_0x12d239(_0x59cda2[_0x9dd1('0x18')][_0x9dd1('0x17')]);}})[_0x9dd1('0x19')](function(_0x28c264){logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x17ce25,_0x28c264);_0x52981e(_0x28c264);});});}exports[_0x9dd1('0x1a')]=function(_0x8b126){var _0x62abbd=this;return new Promise(function(_0x51bb6d,_0x115075){return db[_0x9dd1('0x1b')][_0x9dd1('0x1c')](_0x8b126[_0x9dd1('0x1d')],{'raw':_0x8b126['options']?_0x8b126['options'][_0x9dd1('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x1a4d5f){logger[_0x9dd1('0xf')](_0x9dd1('0x1a'),_0x8b126);logger[_0x9dd1('0x11')]('CreateWhatsappMessage',_0x8b126,JSON[_0x9dd1('0x14')](_0x1a4d5f));_0x51bb6d(_0x1a4d5f);})[_0x9dd1('0x19')](function(_0x20362a){logger['error']('CreateWhatsappMessage',_0x20362a[_0x9dd1('0x17')],_0x8b126);_0x115075(_0x62abbd[_0x9dd1('0x15')](0x1f4,_0x20362a[_0x9dd1('0x17')]));});});}; \ No newline at end of file +var _0x74da=['error','code','message','result','catch','CreateWhatsappMessage','WhatsappMessage','create','body','options','raw','debug','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./whatsappMessage.socket','register','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x182267,_0xcd7b48){var _0x554618=function(_0x595482){while(--_0x595482){_0x182267['push'](_0x182267['shift']());}};_0x554618(++_0xcd7b48);}(_0x74da,0x124));var _0xa74d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x74da[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa74d('0x0'));var util=require(_0xa74d('0x1'));var moment=require(_0xa74d('0x2'));var BPromise=require(_0xa74d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa74d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa74d('0x5'));var logger=require(_0xa74d('0x6'))(_0xa74d('0x7'));var config=require(_0xa74d('0x8'));var jayson=require(_0xa74d('0x9'));var client=jayson[_0xa74d('0xa')]['http']({'port':0x232a});config[_0xa74d('0xb')]=_['defaults'](config['redis'],{'host':_0xa74d('0xc'),'port':0x18eb});var socket=require(_0xa74d('0xd'))(new Redis(config['redis']));require(_0xa74d('0xe'))[_0xa74d('0xf')](socket);function respondWithRpcPromise(_0x5f1ebf,_0x16d4c7,_0x22f777){return new BPromise(function(_0x598eab,_0x5b1865){return client[_0xa74d('0x10')](_0x5f1ebf,_0x22f777)[_0xa74d('0x11')](function(_0x50b77e){logger[_0xa74d('0x12')](_0xa74d('0x13'),_0x16d4c7,_0xa74d('0x14'));logger['debug'](_0xa74d('0x15'),_0x16d4c7,'request\x20sent',JSON[_0xa74d('0x16')](_0x50b77e));if(_0x50b77e[_0xa74d('0x17')]){if(_0x50b77e[_0xa74d('0x17')][_0xa74d('0x18')]===0x1f4){logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x16d4c7,_0x50b77e[_0xa74d('0x17')][_0xa74d('0x19')]);return _0x5b1865(_0x50b77e[_0xa74d('0x17')]['message']);}logger[_0xa74d('0x17')]('WhatsappMessage,\x20%s,\x20%s',_0x16d4c7,_0x50b77e[_0xa74d('0x17')][_0xa74d('0x19')]);return _0x598eab(_0x50b77e[_0xa74d('0x17')][_0xa74d('0x19')]);}else{logger['info'](_0xa74d('0x13'),_0x16d4c7,_0xa74d('0x14'));_0x598eab(_0x50b77e[_0xa74d('0x1a')][_0xa74d('0x19')]);}})[_0xa74d('0x1b')](function(_0x322cda){logger['error'](_0xa74d('0x13'),_0x16d4c7,_0x322cda);_0x5b1865(_0x322cda);});});}exports[_0xa74d('0x1c')]=function(_0x4895e8){var _0xad0fb6=this;return new Promise(function(_0xee8cb1,_0x3c306c){return db[_0xa74d('0x1d')][_0xa74d('0x1e')](_0x4895e8[_0xa74d('0x1f')],{'raw':_0x4895e8['options']?_0x4895e8[_0xa74d('0x20')][_0xa74d('0x21')]===undefined?!![]:![]:!![]})['then'](function(_0x5e4a1d){logger[_0xa74d('0x12')](_0xa74d('0x1c'),_0x4895e8);logger[_0xa74d('0x22')](_0xa74d('0x1c'),_0x4895e8,JSON[_0xa74d('0x16')](_0x5e4a1d));_0xee8cb1(_0x5e4a1d);})[_0xa74d('0x1b')](function(_0x5034f2){logger[_0xa74d('0x17')](_0xa74d('0x1c'),_0x5034f2[_0xa74d('0x19')],_0x4895e8);_0x3c306c(_0xad0fb6['error'](0x1f4,_0x5034f2[_0xa74d('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index e6c925e..d6f2b39 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 _0xa4c8=['remove','update','emit','removeListener','register','length'];(function(_0x5843e2,_0x5cd708){var _0x30f818=function(_0x2b8fc4){while(--_0x2b8fc4){_0x5843e2['push'](_0x5843e2['shift']());}};_0x30f818(++_0x5cd708);}(_0xa4c8,0x1c2));var _0x8a4c=function(_0xdfa4ff,_0x4c4320){_0xdfa4ff=_0xdfa4ff-0x0;var _0x309c14=_0xa4c8[_0xdfa4ff];return _0x309c14;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=['save',_0x8a4c('0x0'),_0x8a4c('0x1')];function createListener(_0x147e09,_0x16ea98){return function(_0x356c8c){_0x16ea98[_0x8a4c('0x2')](_0x147e09,_0x356c8c);};}function removeListener(_0x1267b2,_0x287643){return function(){WhatsappMessageEvents[_0x8a4c('0x3')](_0x1267b2,_0x287643);};}exports[_0x8a4c('0x4')]=function(_0x16441d){for(var _0x3e3f9a=0x0,_0x4c76a4=events[_0x8a4c('0x5')];_0x3e3f9a<_0x4c76a4;_0x3e3f9a++){var _0x2dd8e2=events[_0x3e3f9a];var _0x358252=createListener('whatsappMessage:'+_0x2dd8e2,_0x16441d);WhatsappMessageEvents['on'](_0x2dd8e2,_0x358252);}}; \ No newline at end of file +var _0xc6e3=['whatsappMessage:','./whatsappMessage.events','save','remove','update','emit','length'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc6e3,0x1a5));var _0x3c6e=function(_0x1a7b30,_0x41d102){_0x1a7b30=_0x1a7b30-0x0;var _0x2af787=_0xc6e3[_0x1a7b30];return _0x2af787;};'use strict';var WhatsappMessageEvents=require(_0x3c6e('0x0'));var events=[_0x3c6e('0x1'),_0x3c6e('0x2'),_0x3c6e('0x3')];function createListener(_0x1c35c2,_0x4e3113){return function(_0x508e32){_0x4e3113[_0x3c6e('0x4')](_0x1c35c2,_0x508e32);};}function removeListener(_0x36f364,_0x77654b){return function(){WhatsappMessageEvents['removeListener'](_0x36f364,_0x77654b);};}exports['register']=function(_0x2dcbdd){for(var _0x2d81c9=0x0,_0xa537cb=events[_0x3c6e('0x5')];_0x2d81c9<_0xa537cb;_0x2d81c9++){var _0x548e26=events[_0x2d81c9];var _0x573d04=createListener(_0x3c6e('0x6')+_0x548e26,_0x2dcbdd);WhatsappMessageEvents['on'](_0x548e26,_0x573d04);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 0fd6447..1760f36 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 _0xc571=['put','update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/members','getMembers','/:id/users','getAgents','post','create','/:id/teams','addTeams'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0xc571,0x1d9));var _0x1c57=function(_0x249d99,_0x16b584){_0x249d99=_0x249d99-0x0;var _0x5bfb05=_0xc571[_0x249d99];return _0x5bfb05;};'use strict';var multer=require(_0x1c57('0x0'));var util=require('util');var path=require(_0x1c57('0x1'));var timeout=require(_0x1c57('0x2'));var express=require(_0x1c57('0x3'));var router=express['Router']();var fs_extra=require(_0x1c57('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1c57('0x5'));var controller=require(_0x1c57('0x6'));router[_0x1c57('0x7')]('/',auth[_0x1c57('0x8')](),controller[_0x1c57('0x9')]);router[_0x1c57('0x7')](_0x1c57('0xa'),auth[_0x1c57('0x8')](),controller['describe']);router[_0x1c57('0x7')](_0x1c57('0xb'),auth[_0x1c57('0x8')](),controller[_0x1c57('0xc')]);router['get'](_0x1c57('0xd'),auth[_0x1c57('0x8')](),controller[_0x1c57('0xe')]);router['get']('/:id/teams',auth[_0x1c57('0x8')](),controller['getTeams']);router[_0x1c57('0x7')](_0x1c57('0xf'),auth[_0x1c57('0x8')](),controller[_0x1c57('0x10')]);router[_0x1c57('0x11')]('/',auth['isAuthenticated'](),controller[_0x1c57('0x12')]);router[_0x1c57('0x11')](_0x1c57('0x13'),auth[_0x1c57('0x8')](),controller[_0x1c57('0x14')]);router['post'](_0x1c57('0xf'),auth[_0x1c57('0x8')](),controller['addAgents']);router[_0x1c57('0x15')](_0x1c57('0xb'),auth[_0x1c57('0x8')](),controller[_0x1c57('0x16')]);router[_0x1c57('0x17')](_0x1c57('0xb'),auth[_0x1c57('0x8')](),controller[_0x1c57('0x18')]);router[_0x1c57('0x17')](_0x1c57('0x13'),auth[_0x1c57('0x8')](),controller['removeTeams']);router['delete']('/:id/users',auth[_0x1c57('0x8')](),controller['removeAgents']);module[_0x1c57('0x19')]=router; \ No newline at end of file +var _0xe2cc=['index','/describe','isAuthenticated','describe','show','/:id/members','getMembers','getTeams','getAgents','/:id/teams','addTeams','post','/:id/users','put','/:id','update','delete','destroy','removeTeams','removeAgents','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get'];(function(_0x33c603,_0x6d0ce4){var _0xae96f4=function(_0x2679f8){while(--_0x2679f8){_0x33c603['push'](_0x33c603['shift']());}};_0xae96f4(++_0x6d0ce4);}(_0xe2cc,0x189));var _0xce2c=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xe2cc[_0x2b4411];return _0x8e41ef;};'use strict';var multer=require('multer');var util=require(_0xce2c('0x0'));var path=require(_0xce2c('0x1'));var timeout=require('connect-timeout');var express=require(_0xce2c('0x2'));var router=express[_0xce2c('0x3')]();var fs_extra=require(_0xce2c('0x4'));var auth=require(_0xce2c('0x5'));var interaction=require(_0xce2c('0x6'));var config=require(_0xce2c('0x7'));var controller=require(_0xce2c('0x8'));router[_0xce2c('0x9')]('/',auth['isAuthenticated'](),controller[_0xce2c('0xa')]);router[_0xce2c('0x9')](_0xce2c('0xb'),auth[_0xce2c('0xc')](),controller[_0xce2c('0xd')]);router['get']('/:id',auth[_0xce2c('0xc')](),controller[_0xce2c('0xe')]);router[_0xce2c('0x9')](_0xce2c('0xf'),auth[_0xce2c('0xc')](),controller[_0xce2c('0x10')]);router[_0xce2c('0x9')]('/:id/teams',auth[_0xce2c('0xc')](),controller[_0xce2c('0x11')]);router[_0xce2c('0x9')]('/:id/users',auth[_0xce2c('0xc')](),controller[_0xce2c('0x12')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xce2c('0x13'),auth[_0xce2c('0xc')](),controller[_0xce2c('0x14')]);router[_0xce2c('0x15')](_0xce2c('0x16'),auth[_0xce2c('0xc')](),controller['addAgents']);router[_0xce2c('0x17')](_0xce2c('0x18'),auth[_0xce2c('0xc')](),controller[_0xce2c('0x19')]);router[_0xce2c('0x1a')]('/:id',auth['isAuthenticated'](),controller[_0xce2c('0x1b')]);router[_0xce2c('0x1a')](_0xce2c('0x13'),auth[_0xce2c('0xc')](),controller[_0xce2c('0x1c')]);router['delete'](_0xce2c('0x16'),auth[_0xce2c('0xc')](),controller[_0xce2c('0x1d')]);module[_0xce2c('0x1e')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 1d7d1b3..779d07b 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 _0xbefe=['exports','name','INTEGER','ENUM','rrmemory','beepall','roundrobin','STRING'];(function(_0x37f9a5,_0x2266b0){var _0x4b081e=function(_0x496b71){while(--_0x496b71){_0x37f9a5['push'](_0x37f9a5['shift']());}};_0x4b081e(++_0x2266b0);}(_0xbefe,0x168));var _0xebef=function(_0x2bdf29,_0x40cab0){_0x2bdf29=_0x2bdf29-0x0;var _0x60cb83=_0xbefe[_0x2bdf29];return _0x60cb83;};'use strict';var Sequelize=require('sequelize');module[_0xebef('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xebef('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xebef('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xebef('0x3')](_0xebef('0x4'),_0xebef('0x5'),_0xebef('0x6'))},'description':{'type':Sequelize[_0xebef('0x7')]}}; \ No newline at end of file +var _0xbed7=['rrmemory','beepall','roundrobin','sequelize','exports','STRING','name','INTEGER'];(function(_0x3ff7cf,_0xf3b962){var _0xc91167=function(_0x4323a5){while(--_0x4323a5){_0x3ff7cf['push'](_0x3ff7cf['shift']());}};_0xc91167(++_0xf3b962);}(_0xbed7,0x14b));var _0x7bed=function(_0x567e8d,_0xb8cc45){_0x567e8d=_0x567e8d-0x0;var _0x4390d6=_0xbed7[_0x567e8d];return _0x4390d6;};'use strict';var Sequelize=require(_0x7bed('0x0'));module[_0x7bed('0x1')]={'name':{'type':Sequelize[_0x7bed('0x2')],'unique':_0x7bed('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x7bed('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x7bed('0x5'),_0x7bed('0x6'),_0x7bed('0x7'))},'description':{'type':Sequelize[_0x7bed('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index 5e82e25..cac97e3 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 _0xfa17=['length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','includeAll','include','WhatsappQueue','findAll','catch','params','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','WhatsappQueues','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','WhatsappQueueId','UserWhatsappQueue','whatsappPause','updatedAt','createdAt','rows','SIP','Team','getTeams','ids','Agents','online','voicePause','interface','flatMap','each','findOrCreate','forEach','emit','User','field','tq.TeamId','from','join','user_has_teams','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','sequelize','QueryTypes','SELECT','every','TeamId','includes','value','transaction','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','omit','spread','userWhatsappQueue:save','isArray','getAgents','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','update','then','destroy','UserProfileResource','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes'];(function(_0x177306,_0xd1d010){var _0x328fb4=function(_0x40bd10){while(--_0x40bd10){_0x177306['push'](_0x177306['shift']());}};_0x328fb4(++_0xd1d010);}(_0xfa17,0xd0));var _0x7fa1=function(_0x2b533b,_0x1cfbf9){_0x2b533b=_0x2b533b-0x0;var _0x2098db=_0xfa17[_0x2b533b];return _0x2098db;};'use strict';var emlformat=require(_0x7fa1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7fa1('0x1'));var jsonpatch=require(_0x7fa1('0x2'));var rp=require('request-promise');var moment=require(_0x7fa1('0x3'));var BPromise=require(_0x7fa1('0x4'));var Mustache=require(_0x7fa1('0x5'));var util=require('util');var path=require('path');var sox=require(_0x7fa1('0x6'));var csv=require(_0x7fa1('0x7'));var ejs=require(_0x7fa1('0x8'));var fs=require('fs');var fs_extra=require(_0x7fa1('0x9'));var _=require(_0x7fa1('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7fa1('0xb'));var deskjs=require(_0x7fa1('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x7fa1('0xd'));var authService=require(_0x7fa1('0xe'));var qs=require(_0x7fa1('0xf'));var as=require(_0x7fa1('0x10'));var hardwareService=require(_0x7fa1('0x11'));var logger=require(_0x7fa1('0x12'))(_0x7fa1('0x13'));var utils=require('../../config/utils');var config=require(_0x7fa1('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x7fa1('0x15'))['db'];config[_0x7fa1('0x16')]=_[_0x7fa1('0x17')](config[_0x7fa1('0x16')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7fa1('0x16')]));require('./whatsappQueue.socket')['register'](socket);function respondWithStatusCode(_0x1d60e1,_0x19083a){_0x19083a=_0x19083a||0xcc;return function(_0x3f608a){if(_0x3f608a){return _0x1d60e1[_0x7fa1('0x18')](_0x19083a);}return _0x1d60e1[_0x7fa1('0x19')](_0x19083a)['end']();};}function respondWithResult(_0x62c3bd,_0x42dd41){_0x42dd41=_0x42dd41||0xc8;return function(_0x320b38){if(_0x320b38){return _0x62c3bd[_0x7fa1('0x19')](_0x42dd41)[_0x7fa1('0x1a')](_0x320b38);}};}function respondWithFilteredResult(_0x5d9fb4,_0x2fb67e){return function(_0x52ef93){if(_0x52ef93){var _0x213754=typeof _0x2fb67e['offset']===_0x7fa1('0x1b')&&typeof _0x2fb67e[_0x7fa1('0x1c')]===_0x7fa1('0x1b');var _0x34caa4=_0x52ef93[_0x7fa1('0x1d')];var _0x3f85c5=_0x213754?0x0:_0x2fb67e[_0x7fa1('0x1e')];var _0x5c989f=_0x213754?_0x52ef93[_0x7fa1('0x1d')]:_0x2fb67e['offset']+_0x2fb67e[_0x7fa1('0x1c')];var _0x174cc0;if(_0x5c989f>=_0x34caa4){_0x5c989f=_0x34caa4;_0x174cc0=0xc8;}else{_0x174cc0=0xce;}_0x5d9fb4[_0x7fa1('0x19')](_0x174cc0);return _0x5d9fb4[_0x7fa1('0x1f')](_0x7fa1('0x20'),_0x3f85c5+'-'+_0x5c989f+'/'+_0x34caa4)[_0x7fa1('0x1a')](_0x52ef93);}return null;};}function patchUpdates(_0x3273b1){return function(_0x44c327){try{jsonpatch[_0x7fa1('0x21')](_0x44c327,_0x3273b1,!![]);}catch(_0x5ec320){return BPromise['reject'](_0x5ec320);}return _0x44c327['save']();};}function saveUpdates(_0x301243,_0x178b5d){return function(_0x20102c){if(_0x20102c){return _0x20102c[_0x7fa1('0x22')](_0x301243)[_0x7fa1('0x23')](function(_0x91b2c0){return _0x91b2c0;});}return null;};}function removeEntity(_0x296992,_0x3d9cf6){return function(_0x2c1c64){if(_0x2c1c64){return _0x2c1c64[_0x7fa1('0x24')]()[_0x7fa1('0x23')](function(){var _0x2658c9=_0x2c1c64['get']({'plain':!![]});var _0x743731='WhatsappQueues';return db[_0x7fa1('0x25')][_0x7fa1('0x24')]({'where':{'type':_0x743731,'resourceId':_0x2658c9['id']}})['then'](function(){return _0x2c1c64;});})[_0x7fa1('0x23')](function(){_0x296992[_0x7fa1('0x19')](0xcc)[_0x7fa1('0x26')]();});}};}function handleEntityNotFound(_0x521756,_0x2106c2){return function(_0x2dbde1){if(!_0x2dbde1){_0x521756[_0x7fa1('0x18')](0x194);}return _0x2dbde1;};}function handleError(_0xa896f8,_0x3f3f65){_0x3f3f65=_0x3f3f65||0x1f4;return function(_0x20ede1){logger[_0x7fa1('0x27')](_0x20ede1[_0x7fa1('0x28')]);if(_0x20ede1['name']){delete _0x20ede1[_0x7fa1('0x29')];}_0xa896f8[_0x7fa1('0x19')](_0x3f3f65)[_0x7fa1('0x2a')](_0x20ede1);};}exports[_0x7fa1('0x2b')]=function(_0x359c0c,_0x39af24){var _0x11bc83={},_0x2b048f={},_0x3dd055={'count':0x0,'rows':[]};var _0x1f90fc=_[_0x7fa1('0x2c')](db['WhatsappQueue'][_0x7fa1('0x2d')],function(_0x48eb21){return{'name':_0x48eb21[_0x7fa1('0x2e')],'type':_0x48eb21[_0x7fa1('0x2f')][_0x7fa1('0x30')]};});_0x2b048f[_0x7fa1('0x31')]=_['map'](_0x1f90fc,_0x7fa1('0x29'));_0x2b048f[_0x7fa1('0x32')]=_[_0x7fa1('0x33')](_0x359c0c['query']);_0x2b048f[_0x7fa1('0x34')]=_[_0x7fa1('0x35')](_0x2b048f[_0x7fa1('0x31')],_0x2b048f[_0x7fa1('0x32')]);_0x11bc83['attributes']=_[_0x7fa1('0x35')](_0x2b048f[_0x7fa1('0x31')],qs[_0x7fa1('0x36')](_0x359c0c['query'][_0x7fa1('0x36')]));_0x11bc83[_0x7fa1('0x37')]=_0x11bc83[_0x7fa1('0x37')][_0x7fa1('0x38')]?_0x11bc83['attributes']:_0x2b048f['model'];if(!_0x359c0c[_0x7fa1('0x32')][_0x7fa1('0x39')](_0x7fa1('0x3a'))){_0x11bc83[_0x7fa1('0x1c')]=qs[_0x7fa1('0x1c')](_0x359c0c[_0x7fa1('0x32')][_0x7fa1('0x1c')]);_0x11bc83['offset']=qs['offset'](_0x359c0c[_0x7fa1('0x32')]['offset']);}_0x11bc83[_0x7fa1('0x3b')]=qs[_0x7fa1('0x3c')](_0x359c0c[_0x7fa1('0x32')][_0x7fa1('0x3c')]);_0x11bc83['where']=qs['filters'](_[_0x7fa1('0x3d')](_0x359c0c[_0x7fa1('0x32')],_0x2b048f[_0x7fa1('0x34')]),_0x1f90fc);if(_0x359c0c[_0x7fa1('0x32')][_0x7fa1('0x3e')]){_0x11bc83[_0x7fa1('0x3f')]=_[_0x7fa1('0x40')](_0x11bc83['where'],{'$or':_[_0x7fa1('0x2c')](_0x1f90fc,function(_0x59fd0c){if(_0x59fd0c[_0x7fa1('0x2f')]!=='VIRTUAL'){var _0x12ad50={};_0x12ad50[_0x59fd0c[_0x7fa1('0x29')]]={'$like':'%'+_0x359c0c[_0x7fa1('0x32')][_0x7fa1('0x3e')]+'%'};return _0x12ad50;}})});}_0x11bc83=_[_0x7fa1('0x40')]({},_0x11bc83,_0x359c0c['options']);var _0x512988={'where':_0x11bc83['where']};return db['WhatsappQueue'][_0x7fa1('0x1d')](_0x512988)[_0x7fa1('0x23')](function(_0x130d88){_0x3dd055[_0x7fa1('0x1d')]=_0x130d88;if(_0x359c0c[_0x7fa1('0x32')][_0x7fa1('0x41')]){_0x11bc83[_0x7fa1('0x42')]=[{'all':!![]}];}return db[_0x7fa1('0x43')][_0x7fa1('0x44')](_0x11bc83);})['then'](function(_0x114f60){_0x3dd055['rows']=_0x114f60;return _0x3dd055;})[_0x7fa1('0x23')](respondWithFilteredResult(_0x39af24,_0x11bc83))[_0x7fa1('0x45')](handleError(_0x39af24,null));};exports['show']=function(_0x962fa7,_0x5353d8){var _0x25e476={'raw':!![],'where':{'id':_0x962fa7[_0x7fa1('0x46')]['id']}},_0x244823={};_0x244823[_0x7fa1('0x31')]=_['keys'](db['WhatsappQueue'][_0x7fa1('0x2d')]);_0x244823[_0x7fa1('0x32')]=_['keys'](_0x962fa7[_0x7fa1('0x32')]);_0x244823[_0x7fa1('0x34')]=_['intersection'](_0x244823['model'],_0x244823['query']);_0x25e476[_0x7fa1('0x37')]=_[_0x7fa1('0x35')](_0x244823[_0x7fa1('0x31')],qs['fields'](_0x962fa7[_0x7fa1('0x32')][_0x7fa1('0x36')]));_0x25e476[_0x7fa1('0x37')]=_0x25e476['attributes'][_0x7fa1('0x38')]?_0x25e476[_0x7fa1('0x37')]:_0x244823[_0x7fa1('0x31')];if(_0x962fa7[_0x7fa1('0x32')][_0x7fa1('0x41')]){_0x25e476['include']=[{'all':!![]}];}_0x25e476=_['merge']({},_0x25e476,_0x962fa7[_0x7fa1('0x47')]);return db['WhatsappQueue'][_0x7fa1('0x48')](_0x25e476)[_0x7fa1('0x23')](handleEntityNotFound(_0x5353d8,null))[_0x7fa1('0x23')](respondWithResult(_0x5353d8,null))[_0x7fa1('0x45')](handleError(_0x5353d8,null));};exports[_0x7fa1('0x49')]=function(_0xf7a3df,_0x42ba85){return db[_0x7fa1('0x43')][_0x7fa1('0x49')](_0xf7a3df[_0x7fa1('0x4a')],{})[_0x7fa1('0x23')](function(_0x301b41){var _0x3d9924=_0xf7a3df[_0x7fa1('0x4b')][_0x7fa1('0x4c')]({'plain':!![]});if(!_0x3d9924)throw new Error(_0x7fa1('0x4d'));if(_0x3d9924[_0x7fa1('0x4e')]===_0x7fa1('0x4b')){var _0x57bbc2=_0x301b41['get']({'plain':!![]});var _0x33b9b6=_0x7fa1('0x4f');return db['UserProfileSection'][_0x7fa1('0x48')]({'where':{'name':_0x33b9b6,'userProfileId':_0x3d9924[_0x7fa1('0x50')]},'raw':!![]})[_0x7fa1('0x23')](function(_0x46b4f7){if(_0x46b4f7&&_0x46b4f7[_0x7fa1('0x51')]===0x0){return db[_0x7fa1('0x25')]['create']({'name':_0x57bbc2[_0x7fa1('0x29')],'resourceId':_0x57bbc2['id'],'type':_0x46b4f7['name'],'sectionId':_0x46b4f7['id']},{})['then'](function(){return _0x301b41;});}else{return _0x301b41;}})[_0x7fa1('0x45')](function(_0x418a5d){logger['error'](_0x7fa1('0x52'),_0x418a5d);throw _0x418a5d;});}return _0x301b41;})[_0x7fa1('0x23')](respondWithResult(_0x42ba85,0xc9))[_0x7fa1('0x45')](handleError(_0x42ba85,null));};exports[_0x7fa1('0x22')]=function(_0x3a7126,_0x40bf5c){if(_0x3a7126[_0x7fa1('0x4a')]['id']){delete _0x3a7126[_0x7fa1('0x4a')]['id'];}return db['WhatsappQueue'][_0x7fa1('0x48')]({'where':{'id':_0x3a7126[_0x7fa1('0x46')]['id']}})[_0x7fa1('0x23')](handleEntityNotFound(_0x40bf5c,null))[_0x7fa1('0x23')](saveUpdates(_0x3a7126[_0x7fa1('0x4a')],null))[_0x7fa1('0x23')](respondWithResult(_0x40bf5c,null))['catch'](handleError(_0x40bf5c,null));};exports[_0x7fa1('0x24')]=function(_0x1c3e86,_0x105e8e){return db[_0x7fa1('0x43')][_0x7fa1('0x48')]({'where':{'id':_0x1c3e86['params']['id']}})[_0x7fa1('0x23')](handleEntityNotFound(_0x105e8e,null))[_0x7fa1('0x23')](removeEntity(_0x105e8e,null))[_0x7fa1('0x45')](handleError(_0x105e8e,null));};exports[_0x7fa1('0x53')]=function(_0x3fb297,_0x2611c3){return db['WhatsappQueue'][_0x7fa1('0x53')]()[_0x7fa1('0x23')](respondWithResult(_0x2611c3,null))['catch'](handleError(_0x2611c3,null));};exports['getMembers']=function(_0x4a543a,_0x481539,_0x39cdf2){var _0x6c0026={'raw':!![],'where':{}},_0x244b50={},_0x1625d;return db[_0x7fa1('0x43')][_0x7fa1('0x54')]({'where':{'id':_0x4a543a[_0x7fa1('0x46')]['id']}})[_0x7fa1('0x23')](handleEntityNotFound(_0x481539,null))[_0x7fa1('0x23')](function(_0x153df7){if(_0x153df7){_0x1625d=_0x153df7[_0x7fa1('0x4c')]({'plain':!![]});_0x244b50[_0x7fa1('0x31')]=_[_0x7fa1('0x33')](db['UserWhatsappQueue'][_0x7fa1('0x2d')]);_0x244b50[_0x7fa1('0x32')]=_[_0x7fa1('0x33')](_0x4a543a['query']);_0x244b50[_0x7fa1('0x34')]=_[_0x7fa1('0x35')](_0x244b50['model'],_0x244b50[_0x7fa1('0x32')]);_0x6c0026[_0x7fa1('0x37')]=_['intersection'](_0x244b50[_0x7fa1('0x31')],qs['fields'](_0x4a543a[_0x7fa1('0x32')][_0x7fa1('0x36')]));_0x6c0026['attributes']=_0x6c0026['attributes']['length']?_0x6c0026['attributes']:_0x244b50[_0x7fa1('0x31')];if(!_0x4a543a['query'][_0x7fa1('0x39')](_0x7fa1('0x3a'))){_0x6c0026['limit']=qs['limit'](_0x4a543a['query'][_0x7fa1('0x1c')]);_0x6c0026[_0x7fa1('0x1e')]=qs[_0x7fa1('0x1e')](_0x4a543a[_0x7fa1('0x32')][_0x7fa1('0x1e')]);}_0x6c0026['order']=qs['sort'](_0x4a543a[_0x7fa1('0x32')]['sort']);_0x6c0026['where']=qs[_0x7fa1('0x34')](_['pick'](_0x4a543a['query'],_0x244b50['filters']));_0x6c0026[_0x7fa1('0x3f')][_0x7fa1('0x55')]=_0x153df7['id'];if(_0x4a543a[_0x7fa1('0x32')][_0x7fa1('0x3e')]){_0x6c0026['where']=_['merge'](_0x6c0026['where'],{'$or':_[_0x7fa1('0x2c')](_0x6c0026[_0x7fa1('0x37')],function(_0x1295f6){var _0x381ce0={};_0x381ce0[_0x1295f6]={'$like':'%'+_0x4a543a[_0x7fa1('0x32')][_0x7fa1('0x3e')]+'%'};return _0x381ce0;})});}_0x6c0026=_[_0x7fa1('0x40')]({},_0x6c0026,_0x4a543a[_0x7fa1('0x47')]);return db[_0x7fa1('0x56')][_0x7fa1('0x44')](_0x6c0026);}})[_0x7fa1('0x23')](function(_0x53ac61){if(_0x53ac61){return db['User']['findAndCountAll']({'where':{'id':_[_0x7fa1('0x2c')](_0x53ac61,'UserId'),'role':'agent'},'attributes':['id',_0x7fa1('0x29'),_0x7fa1('0x57'),_0x7fa1('0x58'),_0x7fa1('0x59')]});}})[_0x7fa1('0x23')](function(_0x7495db){if(_0x7495db){return{'count':_0x7495db[_0x7fa1('0x1d')],'rows':_[_0x7fa1('0x2c')](_0x7495db[_0x7fa1('0x5a')],function(_0x5bf325){return{'membername':_0x5bf325[_0x7fa1('0x29')],'UserId':_0x5bf325['id'],'queue_name':_0x1625d['name'],'WhatsappQueueId':_0x1625d['id'],'interface':util['format']('%s/%s',_0x7fa1('0x5b'),_0x5bf325[_0x7fa1('0x29')]),'penalty':0x0,'paused':_0x5bf325[_0x7fa1('0x57')],'createdAt':_0x5bf325[_0x7fa1('0x59')],'updatedAt':_0x5bf325[_0x7fa1('0x58')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x7fa1('0x23')](respondWithFilteredResult(_0x481539,_0x6c0026))[_0x7fa1('0x45')](handleError(_0x481539,null));};exports['getTeams']=function(_0x485436,_0x50992d,_0x5cd583){var _0x4e0811={};var _0x1cfbdf={};var _0x377428;var _0x38fb86;return db[_0x7fa1('0x43')]['findOne']({'where':{'id':_0x485436['params']['id']}})[_0x7fa1('0x23')](handleEntityNotFound(_0x50992d,null))[_0x7fa1('0x23')](function(_0xa58cec){if(_0xa58cec){_0x377428=_0xa58cec;_0x1cfbdf[_0x7fa1('0x31')]=_[_0x7fa1('0x33')](db[_0x7fa1('0x5c')][_0x7fa1('0x2d')]);_0x1cfbdf[_0x7fa1('0x32')]=_[_0x7fa1('0x33')](_0x485436[_0x7fa1('0x32')]);_0x1cfbdf[_0x7fa1('0x34')]=_['intersection'](_0x1cfbdf[_0x7fa1('0x31')],_0x1cfbdf[_0x7fa1('0x32')]);_0x4e0811[_0x7fa1('0x37')]=_['intersection'](_0x1cfbdf[_0x7fa1('0x31')],qs[_0x7fa1('0x36')](_0x485436[_0x7fa1('0x32')][_0x7fa1('0x36')]));_0x4e0811[_0x7fa1('0x37')]=_0x4e0811[_0x7fa1('0x37')][_0x7fa1('0x38')]?_0x4e0811[_0x7fa1('0x37')]:_0x1cfbdf[_0x7fa1('0x31')];_0x4e0811['order']=qs[_0x7fa1('0x3c')](_0x485436['query']['sort']);_0x4e0811[_0x7fa1('0x3f')]=qs[_0x7fa1('0x34')](_[_0x7fa1('0x3d')](_0x485436[_0x7fa1('0x32')],_0x1cfbdf[_0x7fa1('0x34')]));if(_0x485436[_0x7fa1('0x32')][_0x7fa1('0x3e')]){_0x4e0811[_0x7fa1('0x3f')]=_[_0x7fa1('0x40')](_0x4e0811[_0x7fa1('0x3f')],{'$or':_[_0x7fa1('0x2c')](_0x4e0811[_0x7fa1('0x37')],function(_0xec2f99){var _0x5c4143={};_0x5c4143[_0xec2f99]={'$like':'%'+_0x485436['query'][_0x7fa1('0x3e')]+'%'};return _0x5c4143;})});}_0x4e0811=_[_0x7fa1('0x40')]({},_0x4e0811,_0x485436[_0x7fa1('0x47')]);return _0x377428['getTeams'](_0x4e0811);}})['then'](function(_0x475bf0){if(_0x475bf0){_0x38fb86=_0x475bf0[_0x7fa1('0x38')];if(!_0x485436[_0x7fa1('0x32')][_0x7fa1('0x39')](_0x7fa1('0x3a'))){_0x4e0811[_0x7fa1('0x1c')]=qs['limit'](_0x485436[_0x7fa1('0x32')][_0x7fa1('0x1c')]);_0x4e0811['offset']=qs['offset'](_0x485436[_0x7fa1('0x32')]['offset']);}return _0x377428[_0x7fa1('0x5d')](_0x4e0811);}})[_0x7fa1('0x23')](function(_0x17f271){if(_0x17f271){return _0x17f271?{'count':_0x38fb86,'rows':_0x17f271}:null;}})[_0x7fa1('0x23')](respondWithResult(_0x50992d,null))[_0x7fa1('0x45')](handleError(_0x50992d,null));};exports['addTeams']=function(_0x3968f0,_0x4176b7,_0x438728){var _0x5144eb=_0x3968f0['body'][_0x7fa1('0x5e')];return db[_0x7fa1('0x5c')][_0x7fa1('0x44')]({'where':{'id':_0x5144eb},'attributes':['id'],'include':[{'model':db['User'],'as':_0x7fa1('0x5f'),'attributes':['id',_0x7fa1('0x29'),_0x7fa1('0x60'),_0x7fa1('0x61'),_0x7fa1('0x62')],'raw':!![]}]})[_0x7fa1('0x23')](function(_0x303410){if(_0x303410){var _0xbb1ed2=_[_0x7fa1('0x63')](_0x303410,function(_0x59bb3e){var _0x26cc4b=_0x59bb3e[_0x7fa1('0x4c')]({'plain':!![]});return _0x26cc4b[_0x7fa1('0x5f')];});return db[_0x7fa1('0x43')]['find']({'where':{'id':_0x3968f0[_0x7fa1('0x46')]['id']}})[_0x7fa1('0x23')](function(_0x45adb7){return db['sequelize']['transaction'](function(_0x2e273c){return _0x45adb7['addTeams'](_0x5144eb,{'transaction':_0x2e273c})['then'](function(){return BPromise[_0x7fa1('0x64')](_0xbb1ed2,function(_0x157767){return db['UserWhatsappQueue'][_0x7fa1('0x65')]({'where':{'UserId':_0x157767['id'],'WhatsappQueueId':_0x3968f0[_0x7fa1('0x46')]['id']},'transaction':_0x2e273c});});})[_0x7fa1('0x23')](function(){_0xbb1ed2[_0x7fa1('0x66')](function(_0x1d6d45){socket[_0x7fa1('0x67')]('userWhatsappQueue:save',{'UserId':_0x1d6d45['id'],'WhatsappQueueId':_0x45adb7['id']});});});});});}})[_0x7fa1('0x23')](respondWithStatusCode(_0x4176b7,null))[_0x7fa1('0x45')](handleError(_0x4176b7,null));};exports['removeTeams']=function(_0x348f88,_0x3ef70c,_0x468813){return db[_0x7fa1('0x5c')][_0x7fa1('0x44')]({'where':{'id':_0x348f88[_0x7fa1('0x32')]['ids']},'attributes':['id'],'include':[{'model':db[_0x7fa1('0x68')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x7fa1('0x23')](handleEntityNotFound(_0x3ef70c,null))[_0x7fa1('0x23')](function(_0x572f1d){var _0x3e4d65=_[_0x7fa1('0x2c')](_0x572f1d,'id');var _0x10fada=[];var _0x2a7d9e=[];var _0x503dd6=squel['select']();_0x503dd6[_0x7fa1('0x69')](_0x7fa1('0x6a'))[_0x7fa1('0x6b')]('team_has_whatsapp_queues','tq')[_0x7fa1('0x6c')](_0x7fa1('0x6d'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x7fa1('0x3f')](_0x7fa1('0x6e'),_0x348f88[_0x7fa1('0x46')]['id']);for(var _0x237ead=0x0;_0x237ead<_0x572f1d[_0x7fa1('0x38')];_0x237ead+=0x1){let _0x1a5540=_0x572f1d[_0x237ead];for(var _0x19bc1d=0x0;_0x19bc1d<_0x1a5540[_0x7fa1('0x5f')]['length'];_0x19bc1d+=0x1){let _0x196cda=_0x1a5540[_0x7fa1('0x5f')][_0x19bc1d];var _0x4b964a=_0x503dd6[_0x7fa1('0x6f')]();_0x4b964a['where'](_0x7fa1('0x70'),_0x196cda['id']);_0x2a7d9e[_0x7fa1('0x71')](db['sequelize'][_0x7fa1('0x32')](_0x4b964a[_0x7fa1('0x72')](),{'type':db[_0x7fa1('0x73')][_0x7fa1('0x74')][_0x7fa1('0x75')]})[_0x7fa1('0x23')](function(_0x58dc5b){if(_0x58dc5b['length']===0x1){return _0x196cda['id'];}else{var _0x202609=_[_0x7fa1('0x76')](_[_0x7fa1('0x2c')](_0x58dc5b,_0x7fa1('0x77')),function(_0x3b41c1){return _[_0x7fa1('0x78')](_0x3e4d65,_0x3b41c1);});if(_0x202609){return _0x196cda['id'];}}}));}}return BPromise['all'](_0x2a7d9e)[_0x7fa1('0x23')](function(_0x5b32e1){_0x10fada=_(_0x10fada)['union'](_0x5b32e1)['compact']()[_0x7fa1('0x79')]();return db[_0x7fa1('0x43')][_0x7fa1('0x48')]({'where':{'id':_0x348f88[_0x7fa1('0x46')]['id']}})[_0x7fa1('0x23')](function(_0xb7aeb1){return db['sequelize'][_0x7fa1('0x7a')](function(_0x3dd46d){return _0xb7aeb1['removeTeams'](_0x348f88[_0x7fa1('0x32')][_0x7fa1('0x5e')],{'transaction':_0x3dd46d})['then'](function(){if(!_[_0x7fa1('0x7b')](_0x10fada)){return _0xb7aeb1[_0x7fa1('0x7c')](_0x10fada,{'transaction':_0x3dd46d});}})[_0x7fa1('0x23')](function(){_0x10fada[_0x7fa1('0x66')](function(_0x372e4d){socket['emit'](_0x7fa1('0x7d'),{'UserId':_0x372e4d,'WhatsappQueueId':_0xb7aeb1['id']});});});});});});})[_0x7fa1('0x23')](respondWithStatusCode(_0x3ef70c,null))[_0x7fa1('0x45')](handleError(_0x3ef70c,null));};exports[_0x7fa1('0x7e')]=function(_0x58e6b3,_0x56bf09,_0x2a7491){return db[_0x7fa1('0x43')][_0x7fa1('0x48')]({'where':{'id':_0x58e6b3['params']['id']}})['then'](handleEntityNotFound(_0x56bf09,null))[_0x7fa1('0x23')](function(_0x58555d){if(_0x58555d){return _0x58555d['addAgents'](_0x58e6b3[_0x7fa1('0x4a')]['ids'],_[_0x7fa1('0x7f')](_0x58e6b3['body'],[_0x7fa1('0x5e'),'id'])||{})[_0x7fa1('0x80')](function(_0xd84fba){for(var _0x103b87=0x0;_0x103b87<_0x58e6b3[_0x7fa1('0x4a')][_0x7fa1('0x5e')][_0x7fa1('0x38')];_0x103b87+=0x1){socket[_0x7fa1('0x67')](_0x7fa1('0x81'),{'UserId':Number(_0x58e6b3[_0x7fa1('0x4a')][_0x7fa1('0x5e')][_0x103b87]),'WhatsappQueueId':Number(_0x58e6b3['params']['id'])});}return _0xd84fba;});}})[_0x7fa1('0x23')](respondWithResult(_0x56bf09,null))[_0x7fa1('0x45')](handleError(_0x56bf09,null));};exports[_0x7fa1('0x7c')]=function(_0x40bcf6,_0xbfedf6,_0x2e0ab1){return db[_0x7fa1('0x43')][_0x7fa1('0x48')]({'where':{'id':_0x40bcf6['params']['id']}})['then'](handleEntityNotFound(_0xbfedf6,null))[_0x7fa1('0x23')](function(_0x1f45db){if(_0x1f45db){return _0x1f45db[_0x7fa1('0x7c')](_0x40bcf6[_0x7fa1('0x32')][_0x7fa1('0x5e')])[_0x7fa1('0x23')](function(){if(_[_0x7fa1('0x82')](_0x40bcf6[_0x7fa1('0x32')][_0x7fa1('0x5e')])){for(var _0x465685=0x0;_0x465685<_0x40bcf6[_0x7fa1('0x32')][_0x7fa1('0x5e')][_0x7fa1('0x38')];_0x465685+=0x1){socket[_0x7fa1('0x67')](_0x7fa1('0x7d'),{'UserId':Number(_0x40bcf6[_0x7fa1('0x32')][_0x7fa1('0x5e')][_0x465685]),'WhatsappQueueId':Number(_0x40bcf6[_0x7fa1('0x46')]['id'])});}}else{socket[_0x7fa1('0x67')](_0x7fa1('0x7d'),{'UserId':Number(_0x40bcf6['query'][_0x7fa1('0x5e')]),'WhatsappQueueId':Number(_0x40bcf6['params']['id'])});}});}})['then'](respondWithStatusCode(_0xbfedf6,null))[_0x7fa1('0x45')](handleError(_0xbfedf6,null));};exports['getAgents']=function(_0x4972bd,_0x12b3b4,_0x4e6654){var _0x2cd1a1={};var _0x25f920={};var _0x22084a;var _0x1bc0f;return db[_0x7fa1('0x43')][_0x7fa1('0x54')]({'where':{'id':_0x4972bd[_0x7fa1('0x46')]['id']}})['then'](handleEntityNotFound(_0x12b3b4,null))[_0x7fa1('0x23')](function(_0x57ae00){if(_0x57ae00){_0x22084a=_0x57ae00;_0x25f920[_0x7fa1('0x31')]=_[_0x7fa1('0x33')](db[_0x7fa1('0x68')][_0x7fa1('0x2d')]);_0x25f920[_0x7fa1('0x32')]=_['keys'](_0x4972bd['query']);_0x25f920[_0x7fa1('0x34')]=_[_0x7fa1('0x35')](_0x25f920['model'],_0x25f920[_0x7fa1('0x32')]);_0x2cd1a1[_0x7fa1('0x37')]=_[_0x7fa1('0x35')](_0x25f920['model'],qs['fields'](_0x4972bd[_0x7fa1('0x32')][_0x7fa1('0x36')]));_0x2cd1a1[_0x7fa1('0x37')]=_0x2cd1a1[_0x7fa1('0x37')][_0x7fa1('0x38')]?_0x2cd1a1[_0x7fa1('0x37')]:_0x25f920[_0x7fa1('0x31')];_0x2cd1a1[_0x7fa1('0x3b')]=qs[_0x7fa1('0x3c')](_0x4972bd['query'][_0x7fa1('0x3c')]);_0x2cd1a1[_0x7fa1('0x3f')]=qs['filters'](_[_0x7fa1('0x3d')](_0x4972bd[_0x7fa1('0x32')],_0x25f920[_0x7fa1('0x34')]));if(_0x4972bd[_0x7fa1('0x32')]['filter']){_0x2cd1a1[_0x7fa1('0x3f')]=_[_0x7fa1('0x40')](_0x2cd1a1[_0x7fa1('0x3f')],{'$or':_[_0x7fa1('0x2c')](_0x2cd1a1['attributes'],function(_0x3a1c11){var _0x6f41d4={};_0x6f41d4[_0x3a1c11]={'$like':'%'+_0x4972bd['query'][_0x7fa1('0x3e')]+'%'};return _0x6f41d4;})});}_0x2cd1a1=_['merge']({},_0x2cd1a1,_0x4972bd[_0x7fa1('0x47')]);return _0x22084a[_0x7fa1('0x83')](_0x2cd1a1);}})[_0x7fa1('0x23')](function(_0x43ac1){if(_0x43ac1){_0x1bc0f=_0x43ac1['length'];if(!_0x4972bd[_0x7fa1('0x32')][_0x7fa1('0x39')](_0x7fa1('0x3a'))){_0x2cd1a1[_0x7fa1('0x1c')]=qs[_0x7fa1('0x1c')](_0x4972bd[_0x7fa1('0x32')][_0x7fa1('0x1c')]);_0x2cd1a1[_0x7fa1('0x1e')]=qs['offset'](_0x4972bd['query'][_0x7fa1('0x1e')]);}return _0x22084a[_0x7fa1('0x83')](_0x2cd1a1);}})[_0x7fa1('0x23')](function(_0x8be11d){if(_0x8be11d){return _0x8be11d?{'count':_0x1bc0f,'rows':_0x8be11d}:null;}})['then'](respondWithResult(_0x12b3b4,null))[_0x7fa1('0x45')](handleError(_0x12b3b4,null));}; \ No newline at end of file +var _0x3926=['defaults','socket.io-emitter','./whatsappQueue.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','WhatsappQueue','rawAttributes','type','key','keys','query','filters','intersection','model','attributes','fields','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','show','params','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','describe','findOne','length','hasOwnProperty','UserWhatsappQueue','User','UserId','agent','updatedAt','createdAt','format','whatsappPause','getTeams','addTeams','Agents','online','voicePause','interface','sequelize','transaction','each','findOrCreate','userWhatsappQueue:save','Team','ids','select','tq.TeamId','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','TeamId','union','compact','removeTeams','isEmpty','removeAgents','forEach','emit','userWhatsappQueue:remove','addAgents','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis'];(function(_0x38887e,_0x2866bd){var _0xd175b4=function(_0x2acb88){while(--_0x2acb88){_0x38887e['push'](_0x38887e['shift']());}};_0xd175b4(++_0x2866bd);}(_0x3926,0x6d));var _0x6392=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x3926[_0x465a0c];return _0x1e202e;};'use strict';var emlformat=require(_0x6392('0x0'));var rimraf=require(_0x6392('0x1'));var zipdir=require(_0x6392('0x2'));var jsonpatch=require(_0x6392('0x3'));var rp=require('request-promise');var moment=require(_0x6392('0x4'));var BPromise=require(_0x6392('0x5'));var Mustache=require(_0x6392('0x6'));var util=require(_0x6392('0x7'));var path=require(_0x6392('0x8'));var sox=require(_0x6392('0x9'));var csv=require('to-csv');var ejs=require(_0x6392('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6392('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6392('0xc'));var toCsv=require(_0x6392('0xd'));var querystring=require('querystring');var Papa=require(_0x6392('0xe'));var Redis=require('ioredis');var authService=require(_0x6392('0xf'));var qs=require(_0x6392('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6392('0x11'));var logger=require(_0x6392('0x12'))(_0x6392('0x13'));var utils=require(_0x6392('0x14'));var config=require(_0x6392('0x15'));var licenseUtil=require(_0x6392('0x16'));var db=require('../../mysqldb')['db'];config[_0x6392('0x17')]=_[_0x6392('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x6392('0x19'))(new Redis(config[_0x6392('0x17')]));require(_0x6392('0x1a'))['register'](socket);function respondWithStatusCode(_0x4a26a1,_0x21e898){_0x21e898=_0x21e898||0xcc;return function(_0x51ff95){if(_0x51ff95){return _0x4a26a1[_0x6392('0x1b')](_0x21e898);}return _0x4a26a1[_0x6392('0x1c')](_0x21e898)[_0x6392('0x1d')]();};}function respondWithResult(_0x1454a5,_0x259f7e){_0x259f7e=_0x259f7e||0xc8;return function(_0xba1b1){if(_0xba1b1){return _0x1454a5[_0x6392('0x1c')](_0x259f7e)[_0x6392('0x1e')](_0xba1b1);}};}function respondWithFilteredResult(_0x2dbe3e,_0x422408){return function(_0x3f1f00){if(_0x3f1f00){var _0x32d099=typeof _0x422408[_0x6392('0x1f')]===_0x6392('0x20')&&typeof _0x422408[_0x6392('0x21')]===_0x6392('0x20');var _0x4edd60=_0x3f1f00[_0x6392('0x22')];var _0x97cec7=_0x32d099?0x0:_0x422408[_0x6392('0x1f')];var _0x47ceaa=_0x32d099?_0x3f1f00[_0x6392('0x22')]:_0x422408[_0x6392('0x1f')]+_0x422408['limit'];var _0x3f434d;if(_0x47ceaa>=_0x4edd60){_0x47ceaa=_0x4edd60;_0x3f434d=0xc8;}else{_0x3f434d=0xce;}_0x2dbe3e[_0x6392('0x1c')](_0x3f434d);return _0x2dbe3e[_0x6392('0x23')]('Content-Range',_0x97cec7+'-'+_0x47ceaa+'/'+_0x4edd60)['json'](_0x3f1f00);}return null;};}function patchUpdates(_0x3f8c2a){return function(_0x45610f){try{jsonpatch[_0x6392('0x24')](_0x45610f,_0x3f8c2a,!![]);}catch(_0x381de6){return BPromise[_0x6392('0x25')](_0x381de6);}return _0x45610f[_0x6392('0x26')]();};}function saveUpdates(_0x44c9a2,_0x330ae3){return function(_0x48ce3f){if(_0x48ce3f){return _0x48ce3f[_0x6392('0x27')](_0x44c9a2)[_0x6392('0x28')](function(_0x4cc9ec){return _0x4cc9ec;});}return null;};}function removeEntity(_0x21eb4d,_0xa3f71b){return function(_0x3627e6){if(_0x3627e6){return _0x3627e6[_0x6392('0x29')]()[_0x6392('0x28')](function(){var _0x5f3f25=_0x3627e6[_0x6392('0x2a')]({'plain':!![]});var _0x374467='WhatsappQueues';return db[_0x6392('0x2b')][_0x6392('0x29')]({'where':{'type':_0x374467,'resourceId':_0x5f3f25['id']}})[_0x6392('0x28')](function(){return _0x3627e6;});})['then'](function(){_0x21eb4d[_0x6392('0x1c')](0xcc)[_0x6392('0x1d')]();});}};}function handleEntityNotFound(_0xb8ec37,_0x5c0792){return function(_0x29f4ac){if(!_0x29f4ac){_0xb8ec37[_0x6392('0x1b')](0x194);}return _0x29f4ac;};}function handleError(_0x9fd4ed,_0x11c0a2){_0x11c0a2=_0x11c0a2||0x1f4;return function(_0x5ece18){logger[_0x6392('0x2c')](_0x5ece18[_0x6392('0x2d')]);if(_0x5ece18['name']){delete _0x5ece18[_0x6392('0x2e')];}_0x9fd4ed[_0x6392('0x1c')](_0x11c0a2)[_0x6392('0x2f')](_0x5ece18);};}exports[_0x6392('0x30')]=function(_0x2d0079,_0x340ee7){var _0xfa499a={},_0x2395fc={},_0xbf53ca={'count':0x0,'rows':[]};var _0x5b2273=_[_0x6392('0x31')](db[_0x6392('0x32')][_0x6392('0x33')],function(_0xe2770f){return{'name':_0xe2770f['fieldName'],'type':_0xe2770f[_0x6392('0x34')][_0x6392('0x35')]};});_0x2395fc['model']=_['map'](_0x5b2273,_0x6392('0x2e'));_0x2395fc['query']=_[_0x6392('0x36')](_0x2d0079[_0x6392('0x37')]);_0x2395fc[_0x6392('0x38')]=_[_0x6392('0x39')](_0x2395fc[_0x6392('0x3a')],_0x2395fc[_0x6392('0x37')]);_0xfa499a[_0x6392('0x3b')]=_['intersection'](_0x2395fc['model'],qs[_0x6392('0x3c')](_0x2d0079[_0x6392('0x37')][_0x6392('0x3c')]));_0xfa499a[_0x6392('0x3b')]=_0xfa499a[_0x6392('0x3b')]['length']?_0xfa499a[_0x6392('0x3b')]:_0x2395fc[_0x6392('0x3a')];if(!_0x2d0079[_0x6392('0x37')]['hasOwnProperty'](_0x6392('0x3d'))){_0xfa499a[_0x6392('0x21')]=qs[_0x6392('0x21')](_0x2d0079[_0x6392('0x37')][_0x6392('0x21')]);_0xfa499a['offset']=qs[_0x6392('0x1f')](_0x2d0079['query'][_0x6392('0x1f')]);}_0xfa499a[_0x6392('0x3e')]=qs[_0x6392('0x3f')](_0x2d0079[_0x6392('0x37')][_0x6392('0x3f')]);_0xfa499a[_0x6392('0x40')]=qs[_0x6392('0x38')](_[_0x6392('0x41')](_0x2d0079[_0x6392('0x37')],_0x2395fc[_0x6392('0x38')]),_0x5b2273);if(_0x2d0079[_0x6392('0x37')]['filter']){_0xfa499a[_0x6392('0x40')]=_[_0x6392('0x42')](_0xfa499a[_0x6392('0x40')],{'$or':_[_0x6392('0x31')](_0x5b2273,function(_0x105bbf){if(_0x105bbf[_0x6392('0x34')]!==_0x6392('0x43')){var _0x2c6515={};_0x2c6515[_0x105bbf[_0x6392('0x2e')]]={'$like':'%'+_0x2d0079[_0x6392('0x37')][_0x6392('0x44')]+'%'};return _0x2c6515;}})});}_0xfa499a=_['merge']({},_0xfa499a,_0x2d0079[_0x6392('0x45')]);var _0x1b4191={'where':_0xfa499a[_0x6392('0x40')]};return db[_0x6392('0x32')][_0x6392('0x22')](_0x1b4191)[_0x6392('0x28')](function(_0x33a0db){_0xbf53ca['count']=_0x33a0db;if(_0x2d0079[_0x6392('0x37')]['includeAll']){_0xfa499a[_0x6392('0x46')]=[{'all':!![]}];}return db[_0x6392('0x32')][_0x6392('0x47')](_0xfa499a);})[_0x6392('0x28')](function(_0x3fd1e1){_0xbf53ca[_0x6392('0x48')]=_0x3fd1e1;return _0xbf53ca;})[_0x6392('0x28')](respondWithFilteredResult(_0x340ee7,_0xfa499a))['catch'](handleError(_0x340ee7,null));};exports[_0x6392('0x49')]=function(_0xae3b7c,_0x123cd5){var _0x190289={'raw':!![],'where':{'id':_0xae3b7c[_0x6392('0x4a')]['id']}},_0x4ca13e={};_0x4ca13e[_0x6392('0x3a')]=_[_0x6392('0x36')](db[_0x6392('0x32')][_0x6392('0x33')]);_0x4ca13e[_0x6392('0x37')]=_['keys'](_0xae3b7c['query']);_0x4ca13e[_0x6392('0x38')]=_['intersection'](_0x4ca13e[_0x6392('0x3a')],_0x4ca13e[_0x6392('0x37')]);_0x190289['attributes']=_['intersection'](_0x4ca13e['model'],qs[_0x6392('0x3c')](_0xae3b7c['query'][_0x6392('0x3c')]));_0x190289[_0x6392('0x3b')]=_0x190289[_0x6392('0x3b')]['length']?_0x190289['attributes']:_0x4ca13e['model'];if(_0xae3b7c['query']['includeAll']){_0x190289[_0x6392('0x46')]=[{'all':!![]}];}_0x190289=_['merge']({},_0x190289,_0xae3b7c['options']);return db[_0x6392('0x32')][_0x6392('0x4b')](_0x190289)['then'](handleEntityNotFound(_0x123cd5,null))['then'](respondWithResult(_0x123cd5,null))[_0x6392('0x4c')](handleError(_0x123cd5,null));};exports['create']=function(_0x2b3ffd,_0xcaca6d){return db[_0x6392('0x32')][_0x6392('0x4d')](_0x2b3ffd[_0x6392('0x4e')],{})[_0x6392('0x28')](function(_0x250e2a){var _0x1f161c=_0x2b3ffd[_0x6392('0x4f')][_0x6392('0x2a')]({'plain':!![]});if(!_0x1f161c)throw new Error(_0x6392('0x50'));if(_0x1f161c[_0x6392('0x51')]==='user'){var _0x4e996e=_0x250e2a[_0x6392('0x2a')]({'plain':!![]});var _0x21d6c4='WhatsappQueues';return db[_0x6392('0x52')][_0x6392('0x4b')]({'where':{'name':_0x21d6c4,'userProfileId':_0x1f161c['userProfileId']},'raw':!![]})[_0x6392('0x28')](function(_0x107bed){if(_0x107bed&&_0x107bed[_0x6392('0x53')]===0x0){return db[_0x6392('0x2b')][_0x6392('0x4d')]({'name':_0x4e996e[_0x6392('0x2e')],'resourceId':_0x4e996e['id'],'type':_0x107bed[_0x6392('0x2e')],'sectionId':_0x107bed['id']},{})['then'](function(){return _0x250e2a;});}else{return _0x250e2a;}})['catch'](function(_0xababd0){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xababd0);throw _0xababd0;});}return _0x250e2a;})[_0x6392('0x28')](respondWithResult(_0xcaca6d,0xc9))[_0x6392('0x4c')](handleError(_0xcaca6d,null));};exports[_0x6392('0x27')]=function(_0x557fd7,_0x3752a4){if(_0x557fd7[_0x6392('0x4e')]['id']){delete _0x557fd7[_0x6392('0x4e')]['id'];}return db[_0x6392('0x32')][_0x6392('0x4b')]({'where':{'id':_0x557fd7[_0x6392('0x4a')]['id']}})[_0x6392('0x28')](handleEntityNotFound(_0x3752a4,null))['then'](saveUpdates(_0x557fd7[_0x6392('0x4e')],null))[_0x6392('0x28')](respondWithResult(_0x3752a4,null))['catch'](handleError(_0x3752a4,null));};exports['destroy']=function(_0x2b41b5,_0x36cc61){return db[_0x6392('0x32')][_0x6392('0x4b')]({'where':{'id':_0x2b41b5[_0x6392('0x4a')]['id']}})['then'](handleEntityNotFound(_0x36cc61,null))[_0x6392('0x28')](removeEntity(_0x36cc61,null))['catch'](handleError(_0x36cc61,null));};exports[_0x6392('0x54')]=function(_0x23f4a7,_0x1354ab){return db[_0x6392('0x32')][_0x6392('0x54')]()[_0x6392('0x28')](respondWithResult(_0x1354ab,null))['catch'](handleError(_0x1354ab,null));};exports['getMembers']=function(_0x59cc24,_0x5a1038,_0x1a58ba){var _0x2841e3={'raw':!![],'where':{}},_0x215fa0={},_0x4c0217;return db['WhatsappQueue'][_0x6392('0x55')]({'where':{'id':_0x59cc24[_0x6392('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5a1038,null))['then'](function(_0x101d7d){if(_0x101d7d){_0x4c0217=_0x101d7d[_0x6392('0x2a')]({'plain':!![]});_0x215fa0['model']=_[_0x6392('0x36')](db['UserWhatsappQueue']['rawAttributes']);_0x215fa0['query']=_['keys'](_0x59cc24[_0x6392('0x37')]);_0x215fa0[_0x6392('0x38')]=_[_0x6392('0x39')](_0x215fa0[_0x6392('0x3a')],_0x215fa0['query']);_0x2841e3[_0x6392('0x3b')]=_[_0x6392('0x39')](_0x215fa0['model'],qs[_0x6392('0x3c')](_0x59cc24[_0x6392('0x37')]['fields']));_0x2841e3['attributes']=_0x2841e3[_0x6392('0x3b')][_0x6392('0x56')]?_0x2841e3[_0x6392('0x3b')]:_0x215fa0[_0x6392('0x3a')];if(!_0x59cc24[_0x6392('0x37')][_0x6392('0x57')](_0x6392('0x3d'))){_0x2841e3[_0x6392('0x21')]=qs[_0x6392('0x21')](_0x59cc24[_0x6392('0x37')][_0x6392('0x21')]);_0x2841e3['offset']=qs[_0x6392('0x1f')](_0x59cc24[_0x6392('0x37')][_0x6392('0x1f')]);}_0x2841e3[_0x6392('0x3e')]=qs[_0x6392('0x3f')](_0x59cc24['query'][_0x6392('0x3f')]);_0x2841e3['where']=qs[_0x6392('0x38')](_[_0x6392('0x41')](_0x59cc24[_0x6392('0x37')],_0x215fa0['filters']));_0x2841e3[_0x6392('0x40')]['WhatsappQueueId']=_0x101d7d['id'];if(_0x59cc24['query'][_0x6392('0x44')]){_0x2841e3[_0x6392('0x40')]=_[_0x6392('0x42')](_0x2841e3[_0x6392('0x40')],{'$or':_[_0x6392('0x31')](_0x2841e3['attributes'],function(_0x10b346){var _0xc5bd70={};_0xc5bd70[_0x10b346]={'$like':'%'+_0x59cc24[_0x6392('0x37')][_0x6392('0x44')]+'%'};return _0xc5bd70;})});}_0x2841e3=_[_0x6392('0x42')]({},_0x2841e3,_0x59cc24['options']);return db[_0x6392('0x58')][_0x6392('0x47')](_0x2841e3);}})[_0x6392('0x28')](function(_0x211dde){if(_0x211dde){return db[_0x6392('0x59')]['findAndCountAll']({'where':{'id':_[_0x6392('0x31')](_0x211dde,_0x6392('0x5a')),'role':_0x6392('0x5b')},'attributes':['id',_0x6392('0x2e'),'whatsappPause',_0x6392('0x5c'),_0x6392('0x5d')]});}})[_0x6392('0x28')](function(_0x1f6cad){if(_0x1f6cad){return{'count':_0x1f6cad[_0x6392('0x22')],'rows':_['map'](_0x1f6cad[_0x6392('0x48')],function(_0x2598bf){return{'membername':_0x2598bf[_0x6392('0x2e')],'UserId':_0x2598bf['id'],'queue_name':_0x4c0217[_0x6392('0x2e')],'WhatsappQueueId':_0x4c0217['id'],'interface':util[_0x6392('0x5e')]('%s/%s','SIP',_0x2598bf[_0x6392('0x2e')]),'penalty':0x0,'paused':_0x2598bf[_0x6392('0x5f')],'createdAt':_0x2598bf[_0x6392('0x5d')],'updatedAt':_0x2598bf[_0x6392('0x5c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x6392('0x28')](respondWithFilteredResult(_0x5a1038,_0x2841e3))['catch'](handleError(_0x5a1038,null));};exports[_0x6392('0x60')]=function(_0x11e9ab,_0x2c4c64,_0x35b067){var _0x182e0e={};var _0x4125ef={};var _0x16e3a2;var _0x4764da;return db[_0x6392('0x32')][_0x6392('0x55')]({'where':{'id':_0x11e9ab[_0x6392('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2c4c64,null))[_0x6392('0x28')](function(_0x45599d){if(_0x45599d){_0x16e3a2=_0x45599d;_0x4125ef[_0x6392('0x3a')]=_[_0x6392('0x36')](db['Team']['rawAttributes']);_0x4125ef['query']=_[_0x6392('0x36')](_0x11e9ab['query']);_0x4125ef[_0x6392('0x38')]=_[_0x6392('0x39')](_0x4125ef[_0x6392('0x3a')],_0x4125ef['query']);_0x182e0e[_0x6392('0x3b')]=_['intersection'](_0x4125ef['model'],qs['fields'](_0x11e9ab['query']['fields']));_0x182e0e['attributes']=_0x182e0e[_0x6392('0x3b')][_0x6392('0x56')]?_0x182e0e[_0x6392('0x3b')]:_0x4125ef[_0x6392('0x3a')];_0x182e0e[_0x6392('0x3e')]=qs[_0x6392('0x3f')](_0x11e9ab[_0x6392('0x37')][_0x6392('0x3f')]);_0x182e0e[_0x6392('0x40')]=qs[_0x6392('0x38')](_[_0x6392('0x41')](_0x11e9ab['query'],_0x4125ef[_0x6392('0x38')]));if(_0x11e9ab[_0x6392('0x37')][_0x6392('0x44')]){_0x182e0e[_0x6392('0x40')]=_['merge'](_0x182e0e[_0x6392('0x40')],{'$or':_[_0x6392('0x31')](_0x182e0e[_0x6392('0x3b')],function(_0x1d8d45){var _0x510df5={};_0x510df5[_0x1d8d45]={'$like':'%'+_0x11e9ab['query']['filter']+'%'};return _0x510df5;})});}_0x182e0e=_[_0x6392('0x42')]({},_0x182e0e,_0x11e9ab[_0x6392('0x45')]);return _0x16e3a2[_0x6392('0x60')](_0x182e0e);}})[_0x6392('0x28')](function(_0xc96b77){if(_0xc96b77){_0x4764da=_0xc96b77[_0x6392('0x56')];if(!_0x11e9ab[_0x6392('0x37')][_0x6392('0x57')](_0x6392('0x3d'))){_0x182e0e['limit']=qs[_0x6392('0x21')](_0x11e9ab[_0x6392('0x37')][_0x6392('0x21')]);_0x182e0e['offset']=qs[_0x6392('0x1f')](_0x11e9ab[_0x6392('0x37')]['offset']);}return _0x16e3a2['getTeams'](_0x182e0e);}})[_0x6392('0x28')](function(_0x25787e){if(_0x25787e){return _0x25787e?{'count':_0x4764da,'rows':_0x25787e}:null;}})['then'](respondWithResult(_0x2c4c64,null))['catch'](handleError(_0x2c4c64,null));};exports[_0x6392('0x61')]=function(_0x3ec867,_0x8f313e,_0x3ac9b9){var _0x3acf46=_0x3ec867['body']['ids'];return db['Team'][_0x6392('0x47')]({'where':{'id':_0x3acf46},'attributes':['id'],'include':[{'model':db[_0x6392('0x59')],'as':_0x6392('0x62'),'attributes':['id',_0x6392('0x2e'),_0x6392('0x63'),_0x6392('0x64'),_0x6392('0x65')],'raw':!![]}]})[_0x6392('0x28')](function(_0x16d3b9){if(_0x16d3b9){var _0x9e343=_['flatMap'](_0x16d3b9,function(_0xcce56c){var _0x3191d8=_0xcce56c[_0x6392('0x2a')]({'plain':!![]});return _0x3191d8[_0x6392('0x62')];});return db['WhatsappQueue'][_0x6392('0x4b')]({'where':{'id':_0x3ec867[_0x6392('0x4a')]['id']}})['then'](function(_0x2c081d){return db[_0x6392('0x66')][_0x6392('0x67')](function(_0x1a0c53){return _0x2c081d[_0x6392('0x61')](_0x3acf46,{'transaction':_0x1a0c53})['then'](function(){return BPromise[_0x6392('0x68')](_0x9e343,function(_0x1e3781){return db[_0x6392('0x58')][_0x6392('0x69')]({'where':{'UserId':_0x1e3781['id'],'WhatsappQueueId':_0x3ec867[_0x6392('0x4a')]['id']},'transaction':_0x1a0c53});});})['then'](function(){_0x9e343['forEach'](function(_0x2fae57){socket['emit'](_0x6392('0x6a'),{'UserId':_0x2fae57['id'],'WhatsappQueueId':_0x2c081d['id']});});});});});}})[_0x6392('0x28')](respondWithStatusCode(_0x8f313e,null))[_0x6392('0x4c')](handleError(_0x8f313e,null));};exports['removeTeams']=function(_0x5bd4db,_0x4709a6,_0x2f220c){return db[_0x6392('0x6b')]['findAll']({'where':{'id':_0x5bd4db[_0x6392('0x37')][_0x6392('0x6c')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x6392('0x62'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x4709a6,null))['then'](function(_0x47acb9){var _0x2aeccc=_[_0x6392('0x31')](_0x47acb9,'id');var _0x36e69e=[];var _0x1781e3=[];var _0xe601b6=squel[_0x6392('0x6d')]();_0xe601b6['field'](_0x6392('0x6e'))['from'](_0x6392('0x6f'),'tq')[_0x6392('0x70')](_0x6392('0x71'),'ut',_0x6392('0x72'))[_0x6392('0x40')](_0x6392('0x73'),_0x5bd4db[_0x6392('0x4a')]['id']);for(var _0x395d2e=0x0;_0x395d2e<_0x47acb9[_0x6392('0x56')];_0x395d2e+=0x1){let _0x477515=_0x47acb9[_0x395d2e];for(var _0x12f6a2=0x0;_0x12f6a2<_0x477515[_0x6392('0x62')][_0x6392('0x56')];_0x12f6a2+=0x1){let _0x480e5b=_0x477515[_0x6392('0x62')][_0x12f6a2];var _0x5822d6=_0xe601b6['clone']();_0x5822d6['where'](_0x6392('0x74'),_0x480e5b['id']);_0x1781e3[_0x6392('0x75')](db[_0x6392('0x66')][_0x6392('0x37')](_0x5822d6[_0x6392('0x76')](),{'type':db[_0x6392('0x66')][_0x6392('0x77')]['SELECT']})['then'](function(_0x5c9ac6){if(_0x5c9ac6[_0x6392('0x56')]===0x1){return _0x480e5b['id'];}else{var _0x5bd69b=_['every'](_[_0x6392('0x31')](_0x5c9ac6,_0x6392('0x78')),function(_0xc19ce){return _['includes'](_0x2aeccc,_0xc19ce);});if(_0x5bd69b){return _0x480e5b['id'];}}}));}}return BPromise['all'](_0x1781e3)['then'](function(_0x34a9c1){_0x36e69e=_(_0x36e69e)[_0x6392('0x79')](_0x34a9c1)[_0x6392('0x7a')]()['value']();return db[_0x6392('0x32')][_0x6392('0x4b')]({'where':{'id':_0x5bd4db[_0x6392('0x4a')]['id']}})[_0x6392('0x28')](function(_0xad16d0){return db[_0x6392('0x66')][_0x6392('0x67')](function(_0x1eac5d){return _0xad16d0[_0x6392('0x7b')](_0x5bd4db[_0x6392('0x37')][_0x6392('0x6c')],{'transaction':_0x1eac5d})[_0x6392('0x28')](function(){if(!_[_0x6392('0x7c')](_0x36e69e)){return _0xad16d0[_0x6392('0x7d')](_0x36e69e,{'transaction':_0x1eac5d});}})[_0x6392('0x28')](function(){_0x36e69e[_0x6392('0x7e')](function(_0x43b605){socket[_0x6392('0x7f')](_0x6392('0x80'),{'UserId':_0x43b605,'WhatsappQueueId':_0xad16d0['id']});});});});});});})['then'](respondWithStatusCode(_0x4709a6,null))['catch'](handleError(_0x4709a6,null));};exports['addAgents']=function(_0x572e01,_0x107183,_0x375424){return db['WhatsappQueue'][_0x6392('0x4b')]({'where':{'id':_0x572e01['params']['id']}})[_0x6392('0x28')](handleEntityNotFound(_0x107183,null))['then'](function(_0x595dbe){if(_0x595dbe){return _0x595dbe[_0x6392('0x81')](_0x572e01[_0x6392('0x4e')][_0x6392('0x6c')],_['omit'](_0x572e01[_0x6392('0x4e')],[_0x6392('0x6c'),'id'])||{})[_0x6392('0x82')](function(_0x5454ba){for(var _0x565eba=0x0;_0x565eba<_0x572e01[_0x6392('0x4e')][_0x6392('0x6c')][_0x6392('0x56')];_0x565eba+=0x1){socket[_0x6392('0x7f')](_0x6392('0x6a'),{'UserId':Number(_0x572e01[_0x6392('0x4e')][_0x6392('0x6c')][_0x565eba]),'WhatsappQueueId':Number(_0x572e01[_0x6392('0x4a')]['id'])});}return _0x5454ba;});}})[_0x6392('0x28')](respondWithResult(_0x107183,null))['catch'](handleError(_0x107183,null));};exports[_0x6392('0x7d')]=function(_0x931a9b,_0x284ae1,_0x144d53){return db['WhatsappQueue'][_0x6392('0x4b')]({'where':{'id':_0x931a9b[_0x6392('0x4a')]['id']}})[_0x6392('0x28')](handleEntityNotFound(_0x284ae1,null))['then'](function(_0x29229e){if(_0x29229e){return _0x29229e[_0x6392('0x7d')](_0x931a9b['query'][_0x6392('0x6c')])[_0x6392('0x28')](function(){if(_[_0x6392('0x83')](_0x931a9b[_0x6392('0x37')][_0x6392('0x6c')])){for(var _0x5badd4=0x0;_0x5badd4<_0x931a9b[_0x6392('0x37')][_0x6392('0x6c')][_0x6392('0x56')];_0x5badd4+=0x1){socket[_0x6392('0x7f')](_0x6392('0x80'),{'UserId':Number(_0x931a9b['query'][_0x6392('0x6c')][_0x5badd4]),'WhatsappQueueId':Number(_0x931a9b[_0x6392('0x4a')]['id'])});}}else{socket[_0x6392('0x7f')]('userWhatsappQueue:remove',{'UserId':Number(_0x931a9b[_0x6392('0x37')][_0x6392('0x6c')]),'WhatsappQueueId':Number(_0x931a9b[_0x6392('0x4a')]['id'])});}});}})[_0x6392('0x28')](respondWithStatusCode(_0x284ae1,null))['catch'](handleError(_0x284ae1,null));};exports['getAgents']=function(_0x3167d6,_0x167198,_0x38521c){var _0x23ceca={};var _0x3cdb2d={};var _0xa741e8;var _0x2cb1d9;return db[_0x6392('0x32')]['findOne']({'where':{'id':_0x3167d6[_0x6392('0x4a')]['id']}})[_0x6392('0x28')](handleEntityNotFound(_0x167198,null))[_0x6392('0x28')](function(_0x17e316){if(_0x17e316){_0xa741e8=_0x17e316;_0x3cdb2d[_0x6392('0x3a')]=_[_0x6392('0x36')](db['User']['rawAttributes']);_0x3cdb2d['query']=_['keys'](_0x3167d6[_0x6392('0x37')]);_0x3cdb2d['filters']=_[_0x6392('0x39')](_0x3cdb2d[_0x6392('0x3a')],_0x3cdb2d['query']);_0x23ceca['attributes']=_['intersection'](_0x3cdb2d[_0x6392('0x3a')],qs[_0x6392('0x3c')](_0x3167d6[_0x6392('0x37')]['fields']));_0x23ceca[_0x6392('0x3b')]=_0x23ceca[_0x6392('0x3b')][_0x6392('0x56')]?_0x23ceca[_0x6392('0x3b')]:_0x3cdb2d[_0x6392('0x3a')];_0x23ceca[_0x6392('0x3e')]=qs[_0x6392('0x3f')](_0x3167d6['query'][_0x6392('0x3f')]);_0x23ceca[_0x6392('0x40')]=qs[_0x6392('0x38')](_[_0x6392('0x41')](_0x3167d6[_0x6392('0x37')],_0x3cdb2d[_0x6392('0x38')]));if(_0x3167d6[_0x6392('0x37')][_0x6392('0x44')]){_0x23ceca[_0x6392('0x40')]=_[_0x6392('0x42')](_0x23ceca[_0x6392('0x40')],{'$or':_['map'](_0x23ceca['attributes'],function(_0x582cf3){var _0x45c4ae={};_0x45c4ae[_0x582cf3]={'$like':'%'+_0x3167d6[_0x6392('0x37')][_0x6392('0x44')]+'%'};return _0x45c4ae;})});}_0x23ceca=_[_0x6392('0x42')]({},_0x23ceca,_0x3167d6[_0x6392('0x45')]);return _0xa741e8[_0x6392('0x84')](_0x23ceca);}})[_0x6392('0x28')](function(_0x573063){if(_0x573063){_0x2cb1d9=_0x573063[_0x6392('0x56')];if(!_0x3167d6[_0x6392('0x37')]['hasOwnProperty'](_0x6392('0x3d'))){_0x23ceca['limit']=qs[_0x6392('0x21')](_0x3167d6[_0x6392('0x37')]['limit']);_0x23ceca[_0x6392('0x1f')]=qs['offset'](_0x3167d6[_0x6392('0x37')][_0x6392('0x1f')]);}return _0xa741e8['getAgents'](_0x23ceca);}})['then'](function(_0x58d885){if(_0x58d885){return _0x58d885?{'count':_0x2cb1d9,'rows':_0x58d885}:null;}})[_0x6392('0x28')](respondWithResult(_0x167198,null))[_0x6392('0x4c')](handleError(_0x167198,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 9fde6f5..20c8053 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 _0xae87=['../../mysqldb','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x2bb551,_0x4a23ca){var _0x3fd7cc=function(_0x1d2505){while(--_0x1d2505){_0x2bb551['push'](_0x2bb551['shift']());}};_0x3fd7cc(++_0x4a23ca);}(_0xae87,0xa7));var _0x7ae8=function(_0x3e961c,_0x5747e7){_0x3e961c=_0x3e961c-0x0;var _0x474f9c=_0xae87[_0x3e961c];return _0x474f9c;};'use strict';var EventEmitter=require(_0x7ae8('0x0'));var WhatsappQueue=require(_0x7ae8('0x1'))['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7ae8('0x2'),'afterUpdate':_0x7ae8('0x3'),'afterDestroy':_0x7ae8('0x4')};function emitEvent(_0x3f8fe3){return function(_0x1a762e,_0x5ae135,_0x487dd4){WhatsappQueueEvents['emit'](_0x3f8fe3+':'+_0x1a762e['id'],_0x1a762e);WhatsappQueueEvents[_0x7ae8('0x5')](_0x3f8fe3,_0x1a762e);_0x487dd4(null);};}for(var e in events){if(events[_0x7ae8('0x6')](e)){var event=events[e];WhatsappQueue[_0x7ae8('0x7')](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents; \ No newline at end of file +var _0x9655=['hasOwnProperty','hook','exports','events','WhatsappQueue','setMaxListeners','save','update','remove','emit'];(function(_0x5111e9,_0x4d2dff){var _0x456ff5=function(_0xb88995){while(--_0xb88995){_0x5111e9['push'](_0x5111e9['shift']());}};_0x456ff5(++_0x4d2dff);}(_0x9655,0x14d));var _0x5965=function(_0x2e3bc8,_0x2216d0){_0x2e3bc8=_0x2e3bc8-0x0;var _0x26ee87=_0x9655[_0x2e3bc8];return _0x26ee87;};'use strict';var EventEmitter=require(_0x5965('0x0'));var WhatsappQueue=require('../../mysqldb')['db'][_0x5965('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x5965('0x2')](0x0);var events={'afterCreate':_0x5965('0x3'),'afterUpdate':_0x5965('0x4'),'afterDestroy':_0x5965('0x5')};function emitEvent(_0x5d332b){return function(_0x309fba,_0x107e6a,_0x43be35){WhatsappQueueEvents[_0x5965('0x6')](_0x5d332b+':'+_0x309fba['id'],_0x309fba);WhatsappQueueEvents[_0x5965('0x6')](_0x5d332b,_0x309fba);_0x43be35(null);};}for(var e in events){if(events[_0x5965('0x7')](e)){var event=events[e];WhatsappQueue[_0x5965('0x8')](e,emitEvent(event));}}module[_0x5965('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 1aeda28..3ea3a10 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 _0xec58=['request-promise','path','../../config/environment','./whatsappQueue.attributes','exports','define','whatsapp_queues','../../config/logger','moment','bluebird'];(function(_0x2f5051,_0x3ed701){var _0x2b2304=function(_0x2470f3){while(--_0x2470f3){_0x2f5051['push'](_0x2f5051['shift']());}};_0x2b2304(++_0x3ed701);}(_0xec58,0x93));var _0x8ec5=function(_0x3bca2d,_0x1af8f4){_0x3bca2d=_0x3bca2d-0x0;var _0x144a7c=_0xec58[_0x3bca2d];return _0x144a7c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8ec5('0x0'))('api');var moment=require(_0x8ec5('0x1'));var BPromise=require(_0x8ec5('0x2'));var rp=require(_0x8ec5('0x3'));var fs=require('fs');var path=require(_0x8ec5('0x4'));var rimraf=require('rimraf');var config=require(_0x8ec5('0x5'));var attributes=require(_0x8ec5('0x6'));module[_0x8ec5('0x7')]=function(_0x3c6538,_0x286c87){return _0x3c6538[_0x8ec5('0x8')]('WhatsappQueue',attributes,{'tableName':_0x8ec5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf400=['api','moment','bluebird','rimraf','../../config/environment','./whatsappQueue.attributes','define','WhatsappQueue','lodash','util'];(function(_0x6e05f2,_0x7fc70e){var _0xc30bbc=function(_0x282f30){while(--_0x282f30){_0x6e05f2['push'](_0x6e05f2['shift']());}};_0xc30bbc(++_0x7fc70e);}(_0xf400,0x76));var _0x0f40=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xf400[_0xc6be3a];return _0x56a310;};'use strict';var _=require(_0x0f40('0x0'));var util=require(_0x0f40('0x1'));var logger=require('../../config/logger')(_0x0f40('0x2'));var moment=require(_0x0f40('0x3'));var BPromise=require(_0x0f40('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0f40('0x5'));var config=require(_0x0f40('0x6'));var attributes=require(_0x0f40('0x7'));module['exports']=function(_0x2776a7,_0x3d1c7c){return _0x2776a7[_0x0f40('0x8')](_0x0f40('0x9'),attributes,{'tableName':'whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.rpc.js b/server/api/whatsappQueue/whatsappQueue.rpc.js index e1300fd..f62aa09 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 _0x4602=['../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','then','WhatsappQueue,\x20%s,\x20%s','request\x20sent','WhatsappQueue,\x20%s,\x20%s,\x20%s','error','code','message','info','result','GetWhatsappQueue','findAll','options','raw','where','attributes','limit','include','map','model','debug','stringify','catch','ShowWhatsappQueue','WhatsappQueue','find','lodash','util','bluebird','randomstring','ioredis'];(function(_0x35ca67,_0x5157e7){var _0x4fa154=function(_0x14d0da){while(--_0x14d0da){_0x35ca67['push'](_0x35ca67['shift']());}};_0x4fa154(++_0x5157e7);}(_0x4602,0x9b));var _0x2460=function(_0xceece3,_0x2393a4){_0xceece3=_0xceece3-0x0;var _0xb086c0=_0x4602[_0xceece3];return _0xb086c0;};'use strict';var _=require(_0x2460('0x0'));var util=require(_0x2460('0x1'));var moment=require('moment');var BPromise=require(_0x2460('0x2'));var rs=require(_0x2460('0x3'));var fs=require('fs');var Redis=require(_0x2460('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2460('0x5'))(_0x2460('0x6'));var config=require('../../config/environment');var jayson=require(_0x2460('0x7'));var client=jayson[_0x2460('0x8')][_0x2460('0x9')]({'port':0x232a});config[_0x2460('0xa')]=_[_0x2460('0xb')](config[_0x2460('0xa')],{'host':_0x2460('0xc'),'port':0x18eb});var socket=require(_0x2460('0xd'))(new Redis(config[_0x2460('0xa')]));require(_0x2460('0xe'))['register'](socket);function respondWithRpcPromise(_0x5e09ad,_0x431107,_0x65a9d0){return new BPromise(function(_0x2e3478,_0x77997f){return client['request'](_0x5e09ad,_0x65a9d0)[_0x2460('0xf')](function(_0x44704d){logger['info'](_0x2460('0x10'),_0x431107,_0x2460('0x11'));logger['debug'](_0x2460('0x12'),_0x431107,_0x2460('0x11'),JSON['stringify'](_0x44704d));if(_0x44704d[_0x2460('0x13')]){if(_0x44704d[_0x2460('0x13')][_0x2460('0x14')]===0x1f4){logger['error'](_0x2460('0x10'),_0x431107,_0x44704d['error'][_0x2460('0x15')]);return _0x77997f(_0x44704d[_0x2460('0x13')]['message']);}logger['error']('WhatsappQueue,\x20%s,\x20%s',_0x431107,_0x44704d[_0x2460('0x13')][_0x2460('0x15')]);return _0x2e3478(_0x44704d[_0x2460('0x13')][_0x2460('0x15')]);}else{logger[_0x2460('0x16')](_0x2460('0x10'),_0x431107,'request\x20sent');_0x2e3478(_0x44704d[_0x2460('0x17')][_0x2460('0x15')]);}})['catch'](function(_0x5ae25b){logger['error']('WhatsappQueue,\x20%s,\x20%s',_0x431107,_0x5ae25b);_0x77997f(_0x5ae25b);});});}exports[_0x2460('0x18')]=function(_0x5eaae3){var _0x174c21=this;return new Promise(function(_0x139ed2,_0x4b74f1){return db['WhatsappQueue'][_0x2460('0x19')]({'raw':_0x5eaae3[_0x2460('0x1a')]?_0x5eaae3['options'][_0x2460('0x1b')]===undefined?!![]:![]:!![],'where':_0x5eaae3[_0x2460('0x1a')]?_0x5eaae3[_0x2460('0x1a')][_0x2460('0x1c')]||null:null,'attributes':_0x5eaae3[_0x2460('0x1a')]?_0x5eaae3[_0x2460('0x1a')][_0x2460('0x1d')]||null:null,'limit':_0x5eaae3[_0x2460('0x1a')]?_0x5eaae3[_0x2460('0x1a')][_0x2460('0x1e')]||null:null,'include':_0x5eaae3[_0x2460('0x1a')]?_0x5eaae3[_0x2460('0x1a')][_0x2460('0x1f')]?_[_0x2460('0x20')](_0x5eaae3['options']['include'],function(_0x87eae2){return{'model':db[_0x87eae2[_0x2460('0x21')]],'as':_0x87eae2['as'],'attributes':_0x87eae2[_0x2460('0x1d')],'include':_0x87eae2['include']?_[_0x2460('0x20')](_0x87eae2[_0x2460('0x1f')],function(_0x1d4e91){return{'model':db[_0x1d4e91[_0x2460('0x21')]],'as':_0x1d4e91['as'],'attributes':_0x1d4e91[_0x2460('0x1d')],'include':_0x1d4e91[_0x2460('0x1f')]?_[_0x2460('0x20')](_0x1d4e91[_0x2460('0x1f')],function(_0x36f5dc){return{'model':db[_0x36f5dc[_0x2460('0x21')]],'as':_0x36f5dc['as'],'attributes':_0x36f5dc[_0x2460('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x44ef49){logger[_0x2460('0x16')](_0x2460('0x18'),_0x5eaae3);logger[_0x2460('0x22')](_0x2460('0x18'),_0x5eaae3,JSON[_0x2460('0x23')](_0x44ef49));_0x139ed2(_0x44ef49);})[_0x2460('0x24')](function(_0x3c151c){logger[_0x2460('0x13')](_0x2460('0x18'),_0x3c151c[_0x2460('0x15')],_0x5eaae3);_0x4b74f1(_0x174c21['error'](0x1f4,_0x3c151c[_0x2460('0x15')]));});});};exports[_0x2460('0x25')]=function(_0xbb03f8){var _0x15901e=this;return new Promise(function(_0x486962,_0x471a08){return db[_0x2460('0x26')][_0x2460('0x27')]({'raw':_0xbb03f8[_0x2460('0x1a')]?_0xbb03f8[_0x2460('0x1a')][_0x2460('0x1b')]===undefined?!![]:![]:!![],'where':_0xbb03f8['options']?_0xbb03f8[_0x2460('0x1a')][_0x2460('0x1c')]||null:null,'attributes':_0xbb03f8[_0x2460('0x1a')]?_0xbb03f8['options'][_0x2460('0x1d')]||null:null,'include':_0xbb03f8[_0x2460('0x1a')]?_0xbb03f8[_0x2460('0x1a')][_0x2460('0x1f')]?_[_0x2460('0x20')](_0xbb03f8['options'][_0x2460('0x1f')],function(_0x59e1af){return{'model':db[_0x59e1af[_0x2460('0x21')]],'as':_0x59e1af['as'],'attributes':_0x59e1af[_0x2460('0x1d')],'include':_0x59e1af[_0x2460('0x1f')]?_[_0x2460('0x20')](_0x59e1af[_0x2460('0x1f')],function(_0x38f79b){return{'model':db[_0x38f79b[_0x2460('0x21')]],'as':_0x38f79b['as'],'attributes':_0x38f79b[_0x2460('0x1d')],'include':_0x38f79b[_0x2460('0x1f')]?_[_0x2460('0x20')](_0x38f79b[_0x2460('0x1f')],function(_0x36225a){return{'model':db[_0x36225a[_0x2460('0x21')]],'as':_0x36225a['as'],'attributes':_0x36225a[_0x2460('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x44043d){logger[_0x2460('0x16')](_0x2460('0x25'),_0xbb03f8);logger[_0x2460('0x22')](_0x2460('0x25'),_0xbb03f8,JSON[_0x2460('0x23')](_0x44043d));_0x486962(_0x44043d);})['catch'](function(_0x555c97){logger['error'](_0x2460('0x25'),_0x555c97[_0x2460('0x15')],_0xbb03f8);_0x471a08(_0x15901e['error'](0x1f4,_0x555c97['message']));});});}; \ No newline at end of file +var _0x614e=['GetWhatsappQueue','findAll','options','raw','where','include','map','model','attributes','then','ShowWhatsappQueue','WhatsappQueue','find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','request','WhatsappQueue,\x20%s,\x20%s','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch'];(function(_0x44890a,_0xca96dd){var _0x2bf7bf=function(_0x31c685){while(--_0x31c685){_0x44890a['push'](_0x44890a['shift']());}};_0x2bf7bf(++_0xca96dd);}(_0x614e,0xb5));var _0xe614=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x614e[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0xe614('0x0'));var util=require(_0xe614('0x1'));var moment=require('moment');var BPromise=require(_0xe614('0x2'));var rs=require(_0xe614('0x3'));var fs=require('fs');var Redis=require(_0xe614('0x4'));var db=require(_0xe614('0x5'))['db'];var utils=require(_0xe614('0x6'));var logger=require(_0xe614('0x7'))(_0xe614('0x8'));var config=require(_0xe614('0x9'));var jayson=require(_0xe614('0xa'));var client=jayson['client'][_0xe614('0xb')]({'port':0x232a});config[_0xe614('0xc')]=_[_0xe614('0xd')](config[_0xe614('0xc')],{'host':_0xe614('0xe'),'port':0x18eb});var socket=require(_0xe614('0xf'))(new Redis(config['redis']));require(_0xe614('0x10'))[_0xe614('0x11')](socket);function respondWithRpcPromise(_0x256be4,_0x27997d,_0x782d07){return new BPromise(function(_0x33b4a8,_0x481d21){return client[_0xe614('0x12')](_0x256be4,_0x782d07)['then'](function(_0x284c0f){logger['info'](_0xe614('0x13'),_0x27997d,'request\x20sent');logger[_0xe614('0x14')](_0xe614('0x15'),_0x27997d,_0xe614('0x16'),JSON[_0xe614('0x17')](_0x284c0f));if(_0x284c0f[_0xe614('0x18')]){if(_0x284c0f[_0xe614('0x18')]['code']===0x1f4){logger['error'](_0xe614('0x13'),_0x27997d,_0x284c0f['error'][_0xe614('0x19')]);return _0x481d21(_0x284c0f[_0xe614('0x18')][_0xe614('0x19')]);}logger['error'](_0xe614('0x13'),_0x27997d,_0x284c0f['error'][_0xe614('0x19')]);return _0x33b4a8(_0x284c0f['error'][_0xe614('0x19')]);}else{logger[_0xe614('0x1a')](_0xe614('0x13'),_0x27997d,_0xe614('0x16'));_0x33b4a8(_0x284c0f[_0xe614('0x1b')][_0xe614('0x19')]);}})[_0xe614('0x1c')](function(_0x3f73d5){logger[_0xe614('0x18')]('WhatsappQueue,\x20%s,\x20%s',_0x27997d,_0x3f73d5);_0x481d21(_0x3f73d5);});});}exports[_0xe614('0x1d')]=function(_0x336c25){var _0x5da285=this;return new Promise(function(_0x2bac2,_0x18af61){return db['WhatsappQueue'][_0xe614('0x1e')]({'raw':_0x336c25[_0xe614('0x1f')]?_0x336c25[_0xe614('0x1f')][_0xe614('0x20')]===undefined?!![]:![]:!![],'where':_0x336c25['options']?_0x336c25[_0xe614('0x1f')][_0xe614('0x21')]||null:null,'attributes':_0x336c25[_0xe614('0x1f')]?_0x336c25['options']['attributes']||null:null,'limit':_0x336c25[_0xe614('0x1f')]?_0x336c25[_0xe614('0x1f')]['limit']||null:null,'include':_0x336c25[_0xe614('0x1f')]?_0x336c25[_0xe614('0x1f')][_0xe614('0x22')]?_[_0xe614('0x23')](_0x336c25[_0xe614('0x1f')]['include'],function(_0xdcc56d){return{'model':db[_0xdcc56d['model']],'as':_0xdcc56d['as'],'attributes':_0xdcc56d['attributes'],'include':_0xdcc56d[_0xe614('0x22')]?_[_0xe614('0x23')](_0xdcc56d['include'],function(_0x2f499e){return{'model':db[_0x2f499e[_0xe614('0x24')]],'as':_0x2f499e['as'],'attributes':_0x2f499e[_0xe614('0x25')],'include':_0x2f499e[_0xe614('0x22')]?_[_0xe614('0x23')](_0x2f499e[_0xe614('0x22')],function(_0x43ff10){return{'model':db[_0x43ff10[_0xe614('0x24')]],'as':_0x43ff10['as'],'attributes':_0x43ff10['attributes']};}):[]};}):[]};}):[]:[]})[_0xe614('0x26')](function(_0x363a03){logger[_0xe614('0x1a')]('GetWhatsappQueue',_0x336c25);logger['debug'](_0xe614('0x1d'),_0x336c25,JSON['stringify'](_0x363a03));_0x2bac2(_0x363a03);})['catch'](function(_0x1de6d8){logger[_0xe614('0x18')](_0xe614('0x1d'),_0x1de6d8[_0xe614('0x19')],_0x336c25);_0x18af61(_0x5da285['error'](0x1f4,_0x1de6d8[_0xe614('0x19')]));});});};exports[_0xe614('0x27')]=function(_0x3009c0){var _0x2a4d7d=this;return new Promise(function(_0x1fd286,_0x561d4d){return db[_0xe614('0x28')][_0xe614('0x29')]({'raw':_0x3009c0[_0xe614('0x1f')]?_0x3009c0[_0xe614('0x1f')][_0xe614('0x20')]===undefined?!![]:![]:!![],'where':_0x3009c0[_0xe614('0x1f')]?_0x3009c0['options'][_0xe614('0x21')]||null:null,'attributes':_0x3009c0['options']?_0x3009c0[_0xe614('0x1f')][_0xe614('0x25')]||null:null,'include':_0x3009c0[_0xe614('0x1f')]?_0x3009c0[_0xe614('0x1f')]['include']?_[_0xe614('0x23')](_0x3009c0[_0xe614('0x1f')][_0xe614('0x22')],function(_0xcf4979){return{'model':db[_0xcf4979['model']],'as':_0xcf4979['as'],'attributes':_0xcf4979[_0xe614('0x25')],'include':_0xcf4979[_0xe614('0x22')]?_['map'](_0xcf4979[_0xe614('0x22')],function(_0x1224f7){return{'model':db[_0x1224f7[_0xe614('0x24')]],'as':_0x1224f7['as'],'attributes':_0x1224f7[_0xe614('0x25')],'include':_0x1224f7[_0xe614('0x22')]?_[_0xe614('0x23')](_0x1224f7[_0xe614('0x22')],function(_0x55fa82){return{'model':db[_0x55fa82['model']],'as':_0x55fa82['as'],'attributes':_0x55fa82[_0xe614('0x25')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3070ca){logger[_0xe614('0x1a')](_0xe614('0x27'),_0x3009c0);logger[_0xe614('0x14')](_0xe614('0x27'),_0x3009c0,JSON[_0xe614('0x17')](_0x3070ca));_0x1fd286(_0x3070ca);})[_0xe614('0x1c')](function(_0x11246d){logger[_0xe614('0x18')](_0xe614('0x27'),_0x11246d[_0xe614('0x19')],_0x3009c0);_0x561d4d(_0x2a4d7d['error'](0x1f4,_0x11246d[_0xe614('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 37cc910..fa63a78 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 _0x010c=['remove','removeListener','length','whatsappQueue:','./whatsappQueue.events','save'];(function(_0x3644a1,_0x2fadd8){var _0x227348=function(_0x109594){while(--_0x109594){_0x3644a1['push'](_0x3644a1['shift']());}};_0x227348(++_0x2fadd8);}(_0x010c,0x14e));var _0xc010=function(_0x4af25b,_0x3e3ef2){_0x4af25b=_0x4af25b-0x0;var _0x157126=_0x010c[_0x4af25b];return _0x157126;};'use strict';var WhatsappQueueEvents=require(_0xc010('0x0'));var events=[_0xc010('0x1'),_0xc010('0x2'),'update'];function createListener(_0x21554a,_0xd42ed6){return function(_0x284624){_0xd42ed6['emit'](_0x21554a,_0x284624);};}function removeListener(_0x1155f5,_0x6b7aec){return function(){WhatsappQueueEvents[_0xc010('0x3')](_0x1155f5,_0x6b7aec);};}exports['register']=function(_0x28fa29){for(var _0x237fae=0x0,_0x4c1718=events[_0xc010('0x4')];_0x237fae<_0x4c1718;_0x237fae++){var _0x2105ed=events[_0x237fae];var _0x3c3fe8=createListener(_0xc010('0x5')+_0x2105ed,_0x28fa29);WhatsappQueueEvents['on'](_0x2105ed,_0x3c3fe8);}}; \ No newline at end of file +var _0x82ce=['whatsappQueue:','save','remove','update','removeListener','length'];(function(_0x127916,_0x3b7a25){var _0x3c8d08=function(_0x386e92){while(--_0x386e92){_0x127916['push'](_0x127916['shift']());}};_0x3c8d08(++_0x3b7a25);}(_0x82ce,0x6d));var _0xe82c=function(_0x19217d,_0x542f91){_0x19217d=_0x19217d-0x0;var _0x25a7b7=_0x82ce[_0x19217d];return _0x25a7b7;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=[_0xe82c('0x0'),_0xe82c('0x1'),_0xe82c('0x2')];function createListener(_0x5f18cf,_0x3b47cd){return function(_0x43c399){_0x3b47cd['emit'](_0x5f18cf,_0x43c399);};}function removeListener(_0x4b3058,_0x5b3233){return function(){WhatsappQueueEvents[_0xe82c('0x3')](_0x4b3058,_0x5b3233);};}exports['register']=function(_0x2b08c8){for(var _0x1cb0e8=0x0,_0x4ab243=events[_0xe82c('0x4')];_0x1cb0e8<_0x4ab243;_0x1cb0e8++){var _0x44b677=events[_0x1cb0e8];var _0x12a15c=createListener(_0xe82c('0x5')+_0x44b677,_0x2b08c8);WhatsappQueueEvents['on'](_0x44b677,_0x12a15c);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 3ca3099..b60df1a 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 _0x14f1=['delete','destroy','exports','multer','util','connect-timeout','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','post','create','update'];(function(_0x11cc76,_0x22e815){var _0x30bcd2=function(_0x54a7f4){while(--_0x54a7f4){_0x11cc76['push'](_0x11cc76['shift']());}};_0x30bcd2(++_0x22e815);}(_0x14f1,0xb7));var _0x114f=function(_0x49baf0,_0x132263){_0x49baf0=_0x49baf0-0x0;var _0x28fa45=_0x14f1[_0x49baf0];return _0x28fa45;};'use strict';var multer=require(_0x114f('0x0'));var util=require(_0x114f('0x1'));var path=require('path');var timeout=require(_0x114f('0x2'));var express=require('express');var router=express[_0x114f('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x114f('0x4'));var config=require(_0x114f('0x5'));var controller=require('./whatsappQueueReport.controller');router[_0x114f('0x6')]('/',auth[_0x114f('0x7')](),controller[_0x114f('0x8')]);router['get'](_0x114f('0x9'),auth['isAuthenticated'](),controller[_0x114f('0xa')]);router[_0x114f('0x6')](_0x114f('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x114f('0xc')]('/',auth[_0x114f('0x7')](),controller[_0x114f('0xd')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x114f('0xe')]);router[_0x114f('0xf')](_0x114f('0xb'),auth[_0x114f('0x7')](),controller[_0x114f('0x10')]);module[_0x114f('0x11')]=router; \ No newline at end of file +var _0x94e2=['show','post','create','put','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id'];(function(_0x5c58fa,_0x335e48){var _0x3b0234=function(_0x2d3e41){while(--_0x2d3e41){_0x5c58fa['push'](_0x5c58fa['shift']());}};_0x3b0234(++_0x335e48);}(_0x94e2,0x11f));var _0x294e=function(_0x26d9b3,_0x591f4e){_0x26d9b3=_0x26d9b3-0x0;var _0x15c226=_0x94e2[_0x26d9b3];return _0x15c226;};'use strict';var multer=require('multer');var util=require(_0x294e('0x0'));var path=require(_0x294e('0x1'));var timeout=require(_0x294e('0x2'));var express=require('express');var router=express[_0x294e('0x3')]();var fs_extra=require(_0x294e('0x4'));var auth=require(_0x294e('0x5'));var interaction=require(_0x294e('0x6'));var config=require(_0x294e('0x7'));var controller=require('./whatsappQueueReport.controller');router[_0x294e('0x8')]('/',auth[_0x294e('0x9')](),controller[_0x294e('0xa')]);router[_0x294e('0x8')]('/describe',auth[_0x294e('0x9')](),controller[_0x294e('0xb')]);router[_0x294e('0x8')](_0x294e('0xc'),auth[_0x294e('0x9')](),controller[_0x294e('0xd')]);router[_0x294e('0xe')]('/',auth['isAuthenticated'](),controller[_0x294e('0xf')]);router[_0x294e('0x10')](_0x294e('0xc'),auth[_0x294e('0x9')](),controller['update']);router[_0x294e('0x11')](_0x294e('0xc'),auth['isAuthenticated'](),controller[_0x294e('0x12')]);module[_0x294e('0x13')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index 9275a73..5b01a19 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(_0x222db8,_0x22511f){var _0x1e5d2d=function(_0x57e45d){while(--_0x57e45d){_0x222db8['push'](_0x222db8['shift']());}};_0x1e5d2d(++_0x22511f);}(_0x7a54,0x106));var _0x47a5=function(_0x318e08,_0x2439ab){_0x318e08=_0x318e08-0x0;var _0x5ef2e9=_0x7a54[_0x318e08];return _0x5ef2e9;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file +var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x258bc6,_0x583fb3){var _0x284ece=function(_0x34ecbf){while(--_0x34ecbf){_0x258bc6['push'](_0x258bc6['shift']());}};_0x284ece(++_0x583fb3);}(_0x7a54,0x106));var _0x47a5=function(_0x4feea4,_0x1affd9){_0x4feea4=_0x4feea4-0x0;var _0x22487d=_0x7a54[_0x4feea4];return _0x22487d;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index 545b04c..b0eef04 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 _0x5423=['params','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','then','rows','catch','show','WhatsappQueueReport','find','create','body','update'];(function(_0x37261e,_0x26d202){var _0x2c3010=function(_0x49f5cb){while(--_0x49f5cb){_0x37261e['push'](_0x37261e['shift']());}};_0x2c3010(++_0x26d202);}(_0x5423,0xe3));var _0x3542=function(_0x369b36,_0x461c1e){_0x369b36=_0x369b36-0x0;var _0x52f32c=_0x5423[_0x369b36];return _0x52f32c;};'use strict';var emlformat=require(_0x3542('0x0'));var rimraf=require(_0x3542('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3542('0x2'));var rp=require(_0x3542('0x3'));var moment=require('moment');var BPromise=require(_0x3542('0x4'));var Mustache=require(_0x3542('0x5'));var util=require(_0x3542('0x6'));var path=require(_0x3542('0x7'));var sox=require('sox');var csv=require(_0x3542('0x8'));var ejs=require(_0x3542('0x9'));var fs=require('fs');var fs_extra=require(_0x3542('0xa'));var _=require(_0x3542('0xb'));var squel=require(_0x3542('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3542('0xd'));var toCsv=require(_0x3542('0x8'));var querystring=require('querystring');var Papa=require(_0x3542('0xe'));var Redis=require(_0x3542('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x3542('0x10'));var as=require(_0x3542('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3542('0x12'))(_0x3542('0x13'));var utils=require(_0x3542('0x14'));var config=require(_0x3542('0x15'));var licenseUtil=require(_0x3542('0x16'));var db=require(_0x3542('0x17'))['db'];function respondWithStatusCode(_0x1cf710,_0x43e977){_0x43e977=_0x43e977||0xcc;return function(_0x4ee86){if(_0x4ee86){return _0x1cf710[_0x3542('0x18')](_0x43e977);}return _0x1cf710[_0x3542('0x19')](_0x43e977)[_0x3542('0x1a')]();};}function respondWithResult(_0x15863d,_0x4bac5b){_0x4bac5b=_0x4bac5b||0xc8;return function(_0x14fe57){if(_0x14fe57){return _0x15863d['status'](_0x4bac5b)[_0x3542('0x1b')](_0x14fe57);}};}function respondWithFilteredResult(_0x13fe0b,_0xc33d42){return function(_0x546fbd){if(_0x546fbd){var _0x270312=typeof _0xc33d42[_0x3542('0x1c')]===_0x3542('0x1d')&&typeof _0xc33d42['limit']===_0x3542('0x1d');var _0x23b0de=_0x546fbd[_0x3542('0x1e')];var _0x3d5199=_0x270312?0x0:_0xc33d42['offset'];var _0x32df3f=_0x270312?_0x546fbd['count']:_0xc33d42[_0x3542('0x1c')]+_0xc33d42[_0x3542('0x1f')];var _0x4d93bc;if(_0x32df3f>=_0x23b0de){_0x32df3f=_0x23b0de;_0x4d93bc=0xc8;}else{_0x4d93bc=0xce;}_0x13fe0b[_0x3542('0x19')](_0x4d93bc);return _0x13fe0b[_0x3542('0x20')](_0x3542('0x21'),_0x3d5199+'-'+_0x32df3f+'/'+_0x23b0de)[_0x3542('0x1b')](_0x546fbd);}return null;};}function patchUpdates(_0x212950){return function(_0x4a7695){try{jsonpatch['apply'](_0x4a7695,_0x212950,!![]);}catch(_0x4c58f1){return BPromise[_0x3542('0x22')](_0x4c58f1);}return _0x4a7695['save']();};}function saveUpdates(_0x1d5488,_0x551645){return function(_0x1d5f1e){if(_0x1d5f1e){return _0x1d5f1e['update'](_0x1d5488)['then'](function(_0x3eacd0){return _0x3eacd0;});}return null;};}function removeEntity(_0xe3f983,_0x5ae097){return function(_0x5d05b2){if(_0x5d05b2){return _0x5d05b2[_0x3542('0x23')]()['then'](function(){_0xe3f983[_0x3542('0x19')](0xcc)[_0x3542('0x1a')]();});}};}function handleEntityNotFound(_0x1e0723,_0x2f2e63){return function(_0x298763){if(!_0x298763){_0x1e0723[_0x3542('0x18')](0x194);}return _0x298763;};}function handleError(_0x412184,_0x1e156e){_0x1e156e=_0x1e156e||0x1f4;return function(_0x18dc6c){logger[_0x3542('0x24')](_0x18dc6c[_0x3542('0x25')]);if(_0x18dc6c[_0x3542('0x26')]){delete _0x18dc6c[_0x3542('0x26')];}_0x412184[_0x3542('0x19')](_0x1e156e)[_0x3542('0x27')](_0x18dc6c);};}exports[_0x3542('0x28')]=function(_0x303412,_0x20eda1){var _0x3bd666={},_0x5590a2={},_0x31ad47={'count':0x0,'rows':[]};var _0x35bbc9=_[_0x3542('0x29')](db['WhatsappQueueReport'][_0x3542('0x2a')],function(_0xc6f23b){return{'name':_0xc6f23b[_0x3542('0x2b')],'type':_0xc6f23b[_0x3542('0x2c')]['key']};});_0x5590a2['model']=_[_0x3542('0x29')](_0x35bbc9,_0x3542('0x26'));_0x5590a2[_0x3542('0x2d')]=_[_0x3542('0x2e')](_0x303412[_0x3542('0x2d')]);_0x5590a2[_0x3542('0x2f')]=_[_0x3542('0x30')](_0x5590a2['model'],_0x5590a2['query']);_0x3bd666[_0x3542('0x31')]=_['intersection'](_0x5590a2['model'],qs[_0x3542('0x32')](_0x303412['query']['fields']));_0x3bd666[_0x3542('0x31')]=_0x3bd666[_0x3542('0x31')][_0x3542('0x33')]?_0x3bd666['attributes']:_0x5590a2[_0x3542('0x34')];if(!_0x303412['query'][_0x3542('0x35')](_0x3542('0x36'))){_0x3bd666['limit']=qs[_0x3542('0x1f')](_0x303412['query'][_0x3542('0x1f')]);_0x3bd666[_0x3542('0x1c')]=qs[_0x3542('0x1c')](_0x303412['query'][_0x3542('0x1c')]);}_0x3bd666['order']=qs[_0x3542('0x37')](_0x303412[_0x3542('0x2d')][_0x3542('0x37')]);_0x3bd666[_0x3542('0x38')]=qs[_0x3542('0x2f')](_[_0x3542('0x39')](_0x303412[_0x3542('0x2d')],_0x5590a2[_0x3542('0x2f')]),_0x35bbc9);if(_0x303412[_0x3542('0x2d')][_0x3542('0x3a')]){_0x3bd666[_0x3542('0x38')]=_[_0x3542('0x3b')](_0x3bd666[_0x3542('0x38')],{'$or':_['map'](_0x35bbc9,function(_0x62429){if(_0x62429['type']!=='VIRTUAL'){var _0x2782f2={};_0x2782f2[_0x62429[_0x3542('0x26')]]={'$like':'%'+_0x303412[_0x3542('0x2d')][_0x3542('0x3a')]+'%'};return _0x2782f2;}})});}_0x3bd666=_[_0x3542('0x3b')]({},_0x3bd666,_0x303412[_0x3542('0x3c')]);var _0xc7f13c={'where':_0x3bd666[_0x3542('0x38')]};return db['WhatsappQueueReport'][_0x3542('0x1e')](_0xc7f13c)['then'](function(_0x1c8855){_0x31ad47[_0x3542('0x1e')]=_0x1c8855;if(_0x303412['query'][_0x3542('0x3d')]){_0x3bd666[_0x3542('0x3e')]=[{'all':!![]}];}return db['WhatsappQueueReport'][_0x3542('0x3f')](_0x3bd666);})[_0x3542('0x40')](function(_0x5e1b29){_0x31ad47[_0x3542('0x41')]=_0x5e1b29;return _0x31ad47;})[_0x3542('0x40')](respondWithFilteredResult(_0x20eda1,_0x3bd666))[_0x3542('0x42')](handleError(_0x20eda1,null));};exports[_0x3542('0x43')]=function(_0x290c7c,_0xb12441){var _0x2b54b9={'raw':!![],'where':{'id':_0x290c7c['params']['id']}},_0x4bf45a={};_0x4bf45a[_0x3542('0x34')]=_[_0x3542('0x2e')](db[_0x3542('0x44')][_0x3542('0x2a')]);_0x4bf45a[_0x3542('0x2d')]=_['keys'](_0x290c7c[_0x3542('0x2d')]);_0x4bf45a['filters']=_[_0x3542('0x30')](_0x4bf45a[_0x3542('0x34')],_0x4bf45a[_0x3542('0x2d')]);_0x2b54b9['attributes']=_[_0x3542('0x30')](_0x4bf45a[_0x3542('0x34')],qs['fields'](_0x290c7c[_0x3542('0x2d')][_0x3542('0x32')]));_0x2b54b9[_0x3542('0x31')]=_0x2b54b9[_0x3542('0x31')][_0x3542('0x33')]?_0x2b54b9[_0x3542('0x31')]:_0x4bf45a[_0x3542('0x34')];if(_0x290c7c[_0x3542('0x2d')]['includeAll']){_0x2b54b9['include']=[{'all':!![]}];}_0x2b54b9=_['merge']({},_0x2b54b9,_0x290c7c[_0x3542('0x3c')]);return db[_0x3542('0x44')][_0x3542('0x45')](_0x2b54b9)[_0x3542('0x40')](handleEntityNotFound(_0xb12441,null))[_0x3542('0x40')](respondWithResult(_0xb12441,null))[_0x3542('0x42')](handleError(_0xb12441,null));};exports[_0x3542('0x46')]=function(_0x5adf34,_0x157683){return db[_0x3542('0x44')][_0x3542('0x46')](_0x5adf34[_0x3542('0x47')],{})['then'](respondWithResult(_0x157683,0xc9))[_0x3542('0x42')](handleError(_0x157683,null));};exports[_0x3542('0x48')]=function(_0x55b43a,_0x528f8c){if(_0x55b43a[_0x3542('0x47')]['id']){delete _0x55b43a[_0x3542('0x47')]['id'];}return db[_0x3542('0x44')][_0x3542('0x45')]({'where':{'id':_0x55b43a[_0x3542('0x49')]['id']}})[_0x3542('0x40')](handleEntityNotFound(_0x528f8c,null))[_0x3542('0x40')](saveUpdates(_0x55b43a['body'],null))[_0x3542('0x40')](respondWithResult(_0x528f8c,null))[_0x3542('0x42')](handleError(_0x528f8c,null));};exports[_0x3542('0x23')]=function(_0x392c6e,_0x1ebc82){return db[_0x3542('0x44')][_0x3542('0x45')]({'where':{'id':_0x392c6e[_0x3542('0x49')]['id']}})[_0x3542('0x40')](handleEntityNotFound(_0x1ebc82,null))['then'](removeEntity(_0x1ebc82,null))['catch'](handleError(_0x1ebc82,null));};exports[_0x3542('0x4a')]=function(_0x4b406b,_0x5a798a){return db['WhatsappQueueReport'][_0x3542('0x4a')]()[_0x3542('0x40')](respondWithResult(_0x5a798a,null))[_0x3542('0x42')](handleError(_0x5a798a,null));}; \ No newline at end of file +var _0x2547=['order','where','pick','filter','merge','VIRTUAL','options','WhatsappQueueReport','includeAll','include','rows','catch','params','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2547,0x1cd));var _0x7254=function(_0x59b891,_0x69bf27){_0x59b891=_0x59b891-0x0;var _0x458a15=_0x2547[_0x59b891];return _0x458a15;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7254('0x0'));var zipdir=require(_0x7254('0x1'));var jsonpatch=require(_0x7254('0x2'));var rp=require(_0x7254('0x3'));var moment=require(_0x7254('0x4'));var BPromise=require(_0x7254('0x5'));var Mustache=require(_0x7254('0x6'));var util=require(_0x7254('0x7'));var path=require('path');var sox=require(_0x7254('0x8'));var csv=require(_0x7254('0x9'));var ejs=require(_0x7254('0xa'));var fs=require('fs');var fs_extra=require(_0x7254('0xb'));var _=require('lodash');var squel=require(_0x7254('0xc'));var crypto=require(_0x7254('0xd'));var jsforce=require(_0x7254('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x7254('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7254('0xf'));var qs=require(_0x7254('0x10'));var as=require(_0x7254('0x11'));var hardwareService=require(_0x7254('0x12'));var logger=require(_0x7254('0x13'))(_0x7254('0x14'));var utils=require('../../config/utils');var config=require(_0x7254('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x7254('0x16'))['db'];function respondWithStatusCode(_0x53fc4f,_0x16c08e){_0x16c08e=_0x16c08e||0xcc;return function(_0x2bfff8){if(_0x2bfff8){return _0x53fc4f[_0x7254('0x17')](_0x16c08e);}return _0x53fc4f[_0x7254('0x18')](_0x16c08e)[_0x7254('0x19')]();};}function respondWithResult(_0x395a8a,_0x124192){_0x124192=_0x124192||0xc8;return function(_0x21cecc){if(_0x21cecc){return _0x395a8a[_0x7254('0x18')](_0x124192)[_0x7254('0x1a')](_0x21cecc);}};}function respondWithFilteredResult(_0x38a99c,_0x1ee5cb){return function(_0x163c8c){if(_0x163c8c){var _0x535065=typeof _0x1ee5cb[_0x7254('0x1b')]===_0x7254('0x1c')&&typeof _0x1ee5cb[_0x7254('0x1d')]===_0x7254('0x1c');var _0x3b5f06=_0x163c8c[_0x7254('0x1e')];var _0x2737e0=_0x535065?0x0:_0x1ee5cb['offset'];var _0x1f48f6=_0x535065?_0x163c8c[_0x7254('0x1e')]:_0x1ee5cb[_0x7254('0x1b')]+_0x1ee5cb[_0x7254('0x1d')];var _0x2a1ddc;if(_0x1f48f6>=_0x3b5f06){_0x1f48f6=_0x3b5f06;_0x2a1ddc=0xc8;}else{_0x2a1ddc=0xce;}_0x38a99c[_0x7254('0x18')](_0x2a1ddc);return _0x38a99c[_0x7254('0x1f')](_0x7254('0x20'),_0x2737e0+'-'+_0x1f48f6+'/'+_0x3b5f06)[_0x7254('0x1a')](_0x163c8c);}return null;};}function patchUpdates(_0x3b6cb6){return function(_0x2594b8){try{jsonpatch[_0x7254('0x21')](_0x2594b8,_0x3b6cb6,!![]);}catch(_0xc617b6){return BPromise[_0x7254('0x22')](_0xc617b6);}return _0x2594b8[_0x7254('0x23')]();};}function saveUpdates(_0x95ceaa,_0x2bb2fe){return function(_0x46c0a2){if(_0x46c0a2){return _0x46c0a2[_0x7254('0x24')](_0x95ceaa)[_0x7254('0x25')](function(_0x1be69b){return _0x1be69b;});}return null;};}function removeEntity(_0x50c34b,_0x493bfd){return function(_0x136ea3){if(_0x136ea3){return _0x136ea3[_0x7254('0x26')]()[_0x7254('0x25')](function(){_0x50c34b[_0x7254('0x18')](0xcc)[_0x7254('0x19')]();});}};}function handleEntityNotFound(_0x36b5d5,_0x133aee){return function(_0x5d6df5){if(!_0x5d6df5){_0x36b5d5[_0x7254('0x17')](0x194);}return _0x5d6df5;};}function handleError(_0x21a579,_0x2b4f46){_0x2b4f46=_0x2b4f46||0x1f4;return function(_0x494cdb){logger[_0x7254('0x27')](_0x494cdb['stack']);if(_0x494cdb[_0x7254('0x28')]){delete _0x494cdb[_0x7254('0x28')];}_0x21a579['status'](_0x2b4f46)[_0x7254('0x29')](_0x494cdb);};}exports[_0x7254('0x2a')]=function(_0x4f684c,_0x14cbea){var _0x6c4927={},_0x37cb5c={},_0xb9198b={'count':0x0,'rows':[]};var _0x43bf02=_[_0x7254('0x2b')](db['WhatsappQueueReport'][_0x7254('0x2c')],function(_0x2dba3f){return{'name':_0x2dba3f['fieldName'],'type':_0x2dba3f[_0x7254('0x2d')][_0x7254('0x2e')]};});_0x37cb5c[_0x7254('0x2f')]=_['map'](_0x43bf02,_0x7254('0x28'));_0x37cb5c[_0x7254('0x30')]=_[_0x7254('0x31')](_0x4f684c[_0x7254('0x30')]);_0x37cb5c[_0x7254('0x32')]=_[_0x7254('0x33')](_0x37cb5c[_0x7254('0x2f')],_0x37cb5c['query']);_0x6c4927[_0x7254('0x34')]=_['intersection'](_0x37cb5c['model'],qs[_0x7254('0x35')](_0x4f684c[_0x7254('0x30')][_0x7254('0x35')]));_0x6c4927[_0x7254('0x34')]=_0x6c4927[_0x7254('0x34')][_0x7254('0x36')]?_0x6c4927[_0x7254('0x34')]:_0x37cb5c[_0x7254('0x2f')];if(!_0x4f684c[_0x7254('0x30')][_0x7254('0x37')](_0x7254('0x38'))){_0x6c4927[_0x7254('0x1d')]=qs[_0x7254('0x1d')](_0x4f684c[_0x7254('0x30')]['limit']);_0x6c4927[_0x7254('0x1b')]=qs[_0x7254('0x1b')](_0x4f684c[_0x7254('0x30')][_0x7254('0x1b')]);}_0x6c4927[_0x7254('0x39')]=qs['sort'](_0x4f684c[_0x7254('0x30')]['sort']);_0x6c4927[_0x7254('0x3a')]=qs[_0x7254('0x32')](_[_0x7254('0x3b')](_0x4f684c[_0x7254('0x30')],_0x37cb5c[_0x7254('0x32')]),_0x43bf02);if(_0x4f684c['query'][_0x7254('0x3c')]){_0x6c4927['where']=_[_0x7254('0x3d')](_0x6c4927[_0x7254('0x3a')],{'$or':_['map'](_0x43bf02,function(_0x1485a0){if(_0x1485a0[_0x7254('0x2d')]!==_0x7254('0x3e')){var _0x9273ee={};_0x9273ee[_0x1485a0[_0x7254('0x28')]]={'$like':'%'+_0x4f684c[_0x7254('0x30')]['filter']+'%'};return _0x9273ee;}})});}_0x6c4927=_[_0x7254('0x3d')]({},_0x6c4927,_0x4f684c[_0x7254('0x3f')]);var _0x105b8c={'where':_0x6c4927['where']};return db[_0x7254('0x40')][_0x7254('0x1e')](_0x105b8c)[_0x7254('0x25')](function(_0x4824d5){_0xb9198b[_0x7254('0x1e')]=_0x4824d5;if(_0x4f684c[_0x7254('0x30')][_0x7254('0x41')]){_0x6c4927[_0x7254('0x42')]=[{'all':!![]}];}return db[_0x7254('0x40')]['findAll'](_0x6c4927);})['then'](function(_0x25004f){_0xb9198b[_0x7254('0x43')]=_0x25004f;return _0xb9198b;})[_0x7254('0x25')](respondWithFilteredResult(_0x14cbea,_0x6c4927))[_0x7254('0x44')](handleError(_0x14cbea,null));};exports['show']=function(_0x53a7a7,_0x29821a){var _0x565cd8={'raw':!![],'where':{'id':_0x53a7a7[_0x7254('0x45')]['id']}},_0x2ae22e={};_0x2ae22e[_0x7254('0x2f')]=_[_0x7254('0x31')](db['WhatsappQueueReport']['rawAttributes']);_0x2ae22e[_0x7254('0x30')]=_[_0x7254('0x31')](_0x53a7a7[_0x7254('0x30')]);_0x2ae22e[_0x7254('0x32')]=_[_0x7254('0x33')](_0x2ae22e['model'],_0x2ae22e['query']);_0x565cd8[_0x7254('0x34')]=_[_0x7254('0x33')](_0x2ae22e[_0x7254('0x2f')],qs['fields'](_0x53a7a7[_0x7254('0x30')][_0x7254('0x35')]));_0x565cd8['attributes']=_0x565cd8[_0x7254('0x34')][_0x7254('0x36')]?_0x565cd8[_0x7254('0x34')]:_0x2ae22e[_0x7254('0x2f')];if(_0x53a7a7['query'][_0x7254('0x41')]){_0x565cd8[_0x7254('0x42')]=[{'all':!![]}];}_0x565cd8=_['merge']({},_0x565cd8,_0x53a7a7[_0x7254('0x3f')]);return db[_0x7254('0x40')][_0x7254('0x46')](_0x565cd8)['then'](handleEntityNotFound(_0x29821a,null))[_0x7254('0x25')](respondWithResult(_0x29821a,null))[_0x7254('0x44')](handleError(_0x29821a,null));};exports['create']=function(_0x5f101e,_0x10b32f){return db['WhatsappQueueReport'][_0x7254('0x47')](_0x5f101e[_0x7254('0x48')],{})['then'](respondWithResult(_0x10b32f,0xc9))['catch'](handleError(_0x10b32f,null));};exports[_0x7254('0x24')]=function(_0xc40bc5,_0x38bcd5){if(_0xc40bc5[_0x7254('0x48')]['id']){delete _0xc40bc5[_0x7254('0x48')]['id'];}return db[_0x7254('0x40')]['find']({'where':{'id':_0xc40bc5[_0x7254('0x45')]['id']}})['then'](handleEntityNotFound(_0x38bcd5,null))[_0x7254('0x25')](saveUpdates(_0xc40bc5[_0x7254('0x48')],null))[_0x7254('0x25')](respondWithResult(_0x38bcd5,null))['catch'](handleError(_0x38bcd5,null));};exports[_0x7254('0x26')]=function(_0x1c1a0e,_0x252758){return db['WhatsappQueueReport'][_0x7254('0x46')]({'where':{'id':_0x1c1a0e[_0x7254('0x45')]['id']}})[_0x7254('0x25')](handleEntityNotFound(_0x252758,null))[_0x7254('0x25')](removeEntity(_0x252758,null))[_0x7254('0x44')](handleError(_0x252758,null));};exports['describe']=function(_0x5e66c6,_0x24c532){return db[_0x7254('0x40')][_0x7254('0x49')]()[_0x7254('0x25')](respondWithResult(_0x24c532,null))[_0x7254('0x44')](handleError(_0x24c532,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 9967961..2a9f89b 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 _0x70ab=['report_whatsapp_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./whatsappQueueReport.attributes','exports','define','WhatsappQueueReport'];(function(_0x39285d,_0x4e7c32){var _0x5b809b=function(_0x1c0b21){while(--_0x1c0b21){_0x39285d['push'](_0x39285d['shift']());}};_0x5b809b(++_0x4e7c32);}(_0x70ab,0x10c));var _0xb70a=function(_0x580dfa,_0x53f1f9){_0x580dfa=_0x580dfa-0x0;var _0x31a5b6=_0x70ab[_0x580dfa];return _0x31a5b6;};'use strict';var _=require(_0xb70a('0x0'));var util=require(_0xb70a('0x1'));var logger=require(_0xb70a('0x2'))('api');var moment=require(_0xb70a('0x3'));var BPromise=require(_0xb70a('0x4'));var rp=require(_0xb70a('0x5'));var fs=require('fs');var path=require(_0xb70a('0x6'));var rimraf=require('rimraf');var config=require(_0xb70a('0x7'));var attributes=require(_0xb70a('0x8'));module[_0xb70a('0x9')]=function(_0x28f38d,_0x9d3397){return _0x28f38d[_0xb70a('0xa')](_0xb70a('0xb'),attributes,{'tableName':_0xb70a('0xc'),'paranoid':![],'indexes':[{'name':_0xb70a('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xd581=['path','../../config/environment','./whatsappQueueReport.attributes','exports','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x26c762,_0x3488fb){var _0xb37f8c=function(_0x47009d){while(--_0x47009d){_0x26c762['push'](_0x26c762['shift']());}};_0xb37f8c(++_0x3488fb);}(_0xd581,0x1ac));var _0x1d58=function(_0x1a72f3,_0x217011){_0x1a72f3=_0x1a72f3-0x0;var _0x57ef47=_0xd581[_0x1a72f3];return _0x57ef47;};'use strict';var _=require(_0x1d58('0x0'));var util=require(_0x1d58('0x1'));var logger=require(_0x1d58('0x2'))('api');var moment=require(_0x1d58('0x3'));var BPromise=require(_0x1d58('0x4'));var rp=require(_0x1d58('0x5'));var fs=require('fs');var path=require(_0x1d58('0x6'));var rimraf=require('rimraf');var config=require(_0x1d58('0x7'));var attributes=require(_0x1d58('0x8'));module[_0x1d58('0x9')]=function(_0x20c39a,_0x2d44c1){return _0x20c39a[_0x1d58('0xa')](_0x1d58('0xb'),attributes,{'tableName':_0x1d58('0xc'),'paranoid':![],'indexes':[{'name':_0x1d58('0xd'),'fields':[_0x1d58('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 141401b..0c029fa 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 _0xee0f=['rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','error','code','WhatsappQueueReport,\x20%s,\x20%s','message','catch','CreateWhatsappQueueReport','body','options','raw','then','stringify','UpdateWhatsappQueueReport','WhatsappQueueReport','update','attributes','limit','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xee0f,0x1ea));var _0xfee0=function(_0x4c3851,_0xbebbfd){_0x4c3851=_0x4c3851-0x0;var _0x43a1e2=_0xee0f[_0x4c3851];return _0x43a1e2;};'use strict';var _=require(_0xfee0('0x0'));var util=require('util');var moment=require(_0xfee0('0x1'));var BPromise=require('bluebird');var rs=require(_0xfee0('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfee0('0x3'))['db'];var utils=require(_0xfee0('0x4'));var logger=require(_0xfee0('0x5'))(_0xfee0('0x6'));var config=require(_0xfee0('0x7'));var jayson=require(_0xfee0('0x8'));var client=jayson[_0xfee0('0x9')][_0xfee0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x8c9339,_0x1f42c0,_0x12bc37){return new BPromise(function(_0x39a22e,_0x4fc185){return client[_0xfee0('0xb')](_0x8c9339,_0x12bc37)['then'](function(_0x3221aa){logger[_0xfee0('0xc')]('WhatsappQueueReport,\x20%s,\x20%s',_0x1f42c0,_0xfee0('0xd'));logger[_0xfee0('0xe')]('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x1f42c0,_0xfee0('0xd'),JSON['stringify'](_0x3221aa));if(_0x3221aa[_0xfee0('0xf')]){if(_0x3221aa[_0xfee0('0xf')][_0xfee0('0x10')]===0x1f4){logger[_0xfee0('0xf')](_0xfee0('0x11'),_0x1f42c0,_0x3221aa['error'][_0xfee0('0x12')]);return _0x4fc185(_0x3221aa[_0xfee0('0xf')][_0xfee0('0x12')]);}logger[_0xfee0('0xf')]('WhatsappQueueReport,\x20%s,\x20%s',_0x1f42c0,_0x3221aa[_0xfee0('0xf')][_0xfee0('0x12')]);return _0x39a22e(_0x3221aa[_0xfee0('0xf')][_0xfee0('0x12')]);}else{logger[_0xfee0('0xc')](_0xfee0('0x11'),_0x1f42c0,'request\x20sent');_0x39a22e(_0x3221aa['result'][_0xfee0('0x12')]);}})[_0xfee0('0x13')](function(_0x55436e){logger[_0xfee0('0xf')]('WhatsappQueueReport,\x20%s,\x20%s',_0x1f42c0,_0x55436e);_0x4fc185(_0x55436e);});});}exports[_0xfee0('0x14')]=function(_0x2945bb){var _0x2c4645=this;return new Promise(function(_0x436364,_0x52ce60){return db['WhatsappQueueReport']['create'](_0x2945bb[_0xfee0('0x15')],{'raw':_0x2945bb['options']?_0x2945bb[_0xfee0('0x16')][_0xfee0('0x17')]===undefined?!![]:![]:!![]})[_0xfee0('0x18')](function(_0x55912a){logger[_0xfee0('0xc')](_0xfee0('0x14'),_0x2945bb);logger[_0xfee0('0xe')](_0xfee0('0x14'),_0x2945bb,JSON[_0xfee0('0x19')](_0x55912a));_0x436364(_0x55912a);})[_0xfee0('0x13')](function(_0x25a9a4){logger[_0xfee0('0xf')]('CreateWhatsappQueueReport',_0x25a9a4['message'],_0x2945bb);_0x52ce60(_0x2c4645[_0xfee0('0xf')](0x1f4,_0x25a9a4['message']));});});};exports[_0xfee0('0x1a')]=function(_0x3cddb0){var _0xd52e1d=this;return new Promise(function(_0x447bfc,_0x4d649a){return db[_0xfee0('0x1b')][_0xfee0('0x1c')](_0x3cddb0['body'],{'raw':_0x3cddb0[_0xfee0('0x16')]?_0x3cddb0[_0xfee0('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3cddb0[_0xfee0('0x16')]?_0x3cddb0['options']['where']||null:null,'attributes':_0x3cddb0[_0xfee0('0x16')]?_0x3cddb0[_0xfee0('0x16')][_0xfee0('0x1d')]||null:null,'limit':_0x3cddb0['options']?_0x3cddb0['options'][_0xfee0('0x1e')]||null:null})[_0xfee0('0x18')](function(_0x39f5b6){logger[_0xfee0('0xc')]('UpdateWhatsappQueueReport',_0x3cddb0);logger[_0xfee0('0xe')](_0xfee0('0x1a'),_0x3cddb0,JSON[_0xfee0('0x19')](_0x39f5b6));_0x447bfc(_0x39f5b6);})[_0xfee0('0x13')](function(_0x34128b){logger['error'](_0xfee0('0x1a'),_0x34128b[_0xfee0('0x12')],_0x3cddb0);_0x4d649a(_0xd52e1d['error'](0x1f4,_0x34128b[_0xfee0('0x12')]));});});}; \ No newline at end of file +var _0x5689=['raw','stringify','catch','UpdateWhatsappQueueReport','update','body','limit','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateWhatsappQueueReport','WhatsappQueueReport','create','options'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x5689,0xe0));var _0x9568=function(_0xd5ea18,_0x44e0d8){_0xd5ea18=_0xd5ea18-0x0;var _0x447951=_0x5689[_0xd5ea18];return _0x447951;};'use strict';var _=require(_0x9568('0x0'));var util=require('util');var moment=require(_0x9568('0x1'));var BPromise=require(_0x9568('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9568('0x3'));var db=require(_0x9568('0x4'))['db'];var utils=require(_0x9568('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x9568('0x6'));var jayson=require(_0x9568('0x7'));var client=jayson['client'][_0x9568('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x7090cc,_0x17a226,_0xa28e67){return new BPromise(function(_0x1b9eb3,_0x52cce1){return client[_0x9568('0x9')](_0x7090cc,_0xa28e67)[_0x9568('0xa')](function(_0x1601b1){logger[_0x9568('0xb')](_0x9568('0xc'),_0x17a226,_0x9568('0xd'));logger[_0x9568('0xe')](_0x9568('0xf'),_0x17a226,'request\x20sent',JSON['stringify'](_0x1601b1));if(_0x1601b1['error']){if(_0x1601b1[_0x9568('0x10')][_0x9568('0x11')]===0x1f4){logger[_0x9568('0x10')]('WhatsappQueueReport,\x20%s,\x20%s',_0x17a226,_0x1601b1['error'][_0x9568('0x12')]);return _0x52cce1(_0x1601b1[_0x9568('0x10')]['message']);}logger['error'](_0x9568('0xc'),_0x17a226,_0x1601b1[_0x9568('0x10')][_0x9568('0x12')]);return _0x1b9eb3(_0x1601b1['error'][_0x9568('0x12')]);}else{logger[_0x9568('0xb')](_0x9568('0xc'),_0x17a226,_0x9568('0xd'));_0x1b9eb3(_0x1601b1[_0x9568('0x13')][_0x9568('0x12')]);}})['catch'](function(_0x4abe79){logger[_0x9568('0x10')](_0x9568('0xc'),_0x17a226,_0x4abe79);_0x52cce1(_0x4abe79);});});}exports[_0x9568('0x14')]=function(_0x337ec4){var _0x124a28=this;return new Promise(function(_0xa92bb,_0x474d69){return db[_0x9568('0x15')][_0x9568('0x16')](_0x337ec4['body'],{'raw':_0x337ec4['options']?_0x337ec4[_0x9568('0x17')][_0x9568('0x18')]===undefined?!![]:![]:!![]})[_0x9568('0xa')](function(_0x3b4d7b){logger[_0x9568('0xb')]('CreateWhatsappQueueReport',_0x337ec4);logger['debug']('CreateWhatsappQueueReport',_0x337ec4,JSON[_0x9568('0x19')](_0x3b4d7b));_0xa92bb(_0x3b4d7b);})[_0x9568('0x1a')](function(_0x17ac37){logger[_0x9568('0x10')](_0x9568('0x14'),_0x17ac37['message'],_0x337ec4);_0x474d69(_0x124a28['error'](0x1f4,_0x17ac37[_0x9568('0x12')]));});});};exports[_0x9568('0x1b')]=function(_0x4d5d2e){var _0x417367=this;return new Promise(function(_0xc14c2a,_0xcf1ac9){return db[_0x9568('0x15')][_0x9568('0x1c')](_0x4d5d2e[_0x9568('0x1d')],{'raw':_0x4d5d2e[_0x9568('0x17')]?_0x4d5d2e[_0x9568('0x17')][_0x9568('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4d5d2e[_0x9568('0x17')]?_0x4d5d2e['options']['where']||null:null,'attributes':_0x4d5d2e[_0x9568('0x17')]?_0x4d5d2e['options']['attributes']||null:null,'limit':_0x4d5d2e[_0x9568('0x17')]?_0x4d5d2e[_0x9568('0x17')][_0x9568('0x1e')]||null:null})[_0x9568('0xa')](function(_0x573984){logger[_0x9568('0xb')]('UpdateWhatsappQueueReport',_0x4d5d2e);logger[_0x9568('0xe')](_0x9568('0x1b'),_0x4d5d2e,JSON[_0x9568('0x19')](_0x573984));_0xc14c2a(_0x573984);})[_0x9568('0x1a')](function(_0x5789a0){logger[_0x9568('0x10')]('UpdateWhatsappQueueReport',_0x5789a0['message'],_0x4d5d2e);_0xcf1ac9(_0x417367[_0x9568('0x10')](0x1f4,_0x5789a0[_0x9568('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index e8f25a4..e343186 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 _0x0b10=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','path','connect-timeout'];(function(_0x1ebce2,_0x10e903){var _0x4a330c=function(_0x4fd810){while(--_0x4fd810){_0x1ebce2['push'](_0x1ebce2['shift']());}};_0x4a330c(++_0x10e903);}(_0x0b10,0x152));var _0x00b1=function(_0x160004,_0x362c5c){_0x160004=_0x160004-0x0;var _0x112c20=_0x0b10[_0x160004];return _0x112c20;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x00b1('0x0'));var timeout=require(_0x00b1('0x1'));var express=require(_0x00b1('0x2'));var router=express[_0x00b1('0x3')]();var fs_extra=require(_0x00b1('0x4'));var auth=require(_0x00b1('0x5'));var interaction=require(_0x00b1('0x6'));var config=require(_0x00b1('0x7'));var controller=require(_0x00b1('0x8'));router[_0x00b1('0x9')]('/',auth[_0x00b1('0xa')](),controller[_0x00b1('0xb')]);router[_0x00b1('0x9')]('/describe',auth[_0x00b1('0xa')](),controller['describe']);router[_0x00b1('0x9')](_0x00b1('0xc'),auth[_0x00b1('0xa')](),controller[_0x00b1('0xd')]);router[_0x00b1('0xe')]('/',auth[_0x00b1('0xa')](),controller[_0x00b1('0xf')]);router[_0x00b1('0x10')](_0x00b1('0xc'),auth[_0x00b1('0xa')](),controller[_0x00b1('0x11')]);router[_0x00b1('0x12')](_0x00b1('0xc'),auth[_0x00b1('0xa')](),controller[_0x00b1('0x13')]);module['exports']=router; \ No newline at end of file +var _0x453a=['show','post','put','update','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','./whatsappTransferReport.controller','isAuthenticated','get','describe','/:id'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x453a,0x85));var _0xa453=function(_0x1b54f5,_0x83ee6a){_0x1b54f5=_0x1b54f5-0x0;var _0x3b9975=_0x453a[_0x1b54f5];return _0x3b9975;};'use strict';var multer=require(_0xa453('0x0'));var util=require(_0xa453('0x1'));var path=require('path');var timeout=require(_0xa453('0x2'));var express=require(_0xa453('0x3'));var router=express['Router']();var fs_extra=require(_0xa453('0x4'));var auth=require(_0xa453('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa453('0x6'));router['get']('/',auth[_0xa453('0x7')](),controller['index']);router[_0xa453('0x8')]('/describe',auth[_0xa453('0x7')](),controller[_0xa453('0x9')]);router['get'](_0xa453('0xa'),auth[_0xa453('0x7')](),controller[_0xa453('0xb')]);router[_0xa453('0xc')]('/',auth[_0xa453('0x7')](),controller['create']);router[_0xa453('0xd')](_0xa453('0xa'),auth[_0xa453('0x7')](),controller[_0xa453('0xe')]);router['delete'](_0xa453('0xa'),auth[_0xa453('0x7')](),controller['destroy']);module[_0xa453('0xf')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 26b7a82..87f9f8e 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 _0x3176=['sequelize','exports','STRING','ENUM','account','agent','queue','DATE'];(function(_0x470f67,_0x3b17f7){var _0x2848a8=function(_0x2e299f){while(--_0x2e299f){_0x470f67['push'](_0x470f67['shift']());}};_0x2848a8(++_0x3b17f7);}(_0x3176,0x1d8));var _0x6317=function(_0x422975,_0x7c3ccd){_0x422975=_0x422975-0x0;var _0x5abdb8=_0x3176[_0x422975];return _0x5abdb8;};'use strict';var Sequelize=require(_0x6317('0x0'));module[_0x6317('0x1')]={'uniqueid':{'type':Sequelize[_0x6317('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x6317('0x3')](_0x6317('0x4'),_0x6317('0x5'),_0x6317('0x6')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x6317('0x7')]}}; \ No newline at end of file +var _0x58a4=['exports','STRING','ENUM','account','agent','queue','DATE','sequelize'];(function(_0xbca161,_0x4ff432){var _0x16b108=function(_0x1f0463){while(--_0x1f0463){_0xbca161['push'](_0xbca161['shift']());}};_0x16b108(++_0x4ff432);}(_0x58a4,0xbf));var _0x458a=function(_0x3c8f26,_0x453699){_0x3c8f26=_0x3c8f26-0x0;var _0x5a4dd7=_0x58a4[_0x3c8f26];return _0x5a4dd7;};'use strict';var Sequelize=require(_0x458a('0x0'));module[_0x458a('0x1')]={'uniqueid':{'type':Sequelize[_0x458a('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x458a('0x3')](_0x458a('0x4'),_0x458a('0x5'),_0x458a('0x6')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x458a('0x7')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index fc4642c..d935f2b 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 _0x934b=['sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','params','WhatsappTransferReport','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x934b,0xe4));var _0xb934=function(_0x4582a9,_0x52e47d){_0x4582a9=_0x4582a9-0x0;var _0x49c003=_0x934b[_0x4582a9];return _0x49c003;};'use strict';var emlformat=require(_0xb934('0x0'));var rimraf=require(_0xb934('0x1'));var zipdir=require(_0xb934('0x2'));var jsonpatch=require(_0xb934('0x3'));var rp=require('request-promise');var moment=require(_0xb934('0x4'));var BPromise=require(_0xb934('0x5'));var Mustache=require(_0xb934('0x6'));var util=require(_0xb934('0x7'));var path=require(_0xb934('0x8'));var sox=require(_0xb934('0x9'));var csv=require(_0xb934('0xa'));var ejs=require(_0xb934('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb934('0xc'));var squel=require('squel');var crypto=require(_0xb934('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xb934('0xe'));var toCsv=require(_0xb934('0xa'));var querystring=require(_0xb934('0xf'));var Papa=require(_0xb934('0x10'));var Redis=require(_0xb934('0x11'));var authService=require(_0xb934('0x12'));var qs=require(_0xb934('0x13'));var as=require(_0xb934('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb934('0x15'))(_0xb934('0x16'));var utils=require(_0xb934('0x17'));var config=require(_0xb934('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xb934('0x19'))['db'];function respondWithStatusCode(_0x36b8a2,_0x1dfdb2){_0x1dfdb2=_0x1dfdb2||0xcc;return function(_0xd5fab4){if(_0xd5fab4){return _0x36b8a2['sendStatus'](_0x1dfdb2);}return _0x36b8a2[_0xb934('0x1a')](_0x1dfdb2)[_0xb934('0x1b')]();};}function respondWithResult(_0xde6a84,_0x331c34){_0x331c34=_0x331c34||0xc8;return function(_0x1d1ce6){if(_0x1d1ce6){return _0xde6a84[_0xb934('0x1a')](_0x331c34)['json'](_0x1d1ce6);}};}function respondWithFilteredResult(_0xc6d550,_0x1ea202){return function(_0x2e99fc){if(_0x2e99fc){var _0x15f749=typeof _0x1ea202[_0xb934('0x1c')]===_0xb934('0x1d')&&typeof _0x1ea202[_0xb934('0x1e')]===_0xb934('0x1d');var _0x5b05ff=_0x2e99fc[_0xb934('0x1f')];var _0xce998c=_0x15f749?0x0:_0x1ea202[_0xb934('0x1c')];var _0x4d2de5=_0x15f749?_0x2e99fc[_0xb934('0x1f')]:_0x1ea202['offset']+_0x1ea202['limit'];var _0xde2c30;if(_0x4d2de5>=_0x5b05ff){_0x4d2de5=_0x5b05ff;_0xde2c30=0xc8;}else{_0xde2c30=0xce;}_0xc6d550[_0xb934('0x1a')](_0xde2c30);return _0xc6d550[_0xb934('0x20')](_0xb934('0x21'),_0xce998c+'-'+_0x4d2de5+'/'+_0x5b05ff)[_0xb934('0x22')](_0x2e99fc);}return null;};}function patchUpdates(_0x2ec9f9){return function(_0x34df2d){try{jsonpatch[_0xb934('0x23')](_0x34df2d,_0x2ec9f9,!![]);}catch(_0x46ff39){return BPromise[_0xb934('0x24')](_0x46ff39);}return _0x34df2d[_0xb934('0x25')]();};}function saveUpdates(_0x269644,_0x36416c){return function(_0x193f33){if(_0x193f33){return _0x193f33[_0xb934('0x26')](_0x269644)[_0xb934('0x27')](function(_0x479a81){return _0x479a81;});}return null;};}function removeEntity(_0x4063e4,_0x1acce9){return function(_0x2691ac){if(_0x2691ac){return _0x2691ac[_0xb934('0x28')]()[_0xb934('0x27')](function(){_0x4063e4[_0xb934('0x1a')](0xcc)[_0xb934('0x1b')]();});}};}function handleEntityNotFound(_0x56e862,_0x59735b){return function(_0x5dc93c){if(!_0x5dc93c){_0x56e862[_0xb934('0x29')](0x194);}return _0x5dc93c;};}function handleError(_0x4b567b,_0x2fbabd){_0x2fbabd=_0x2fbabd||0x1f4;return function(_0x11cb15){logger[_0xb934('0x2a')](_0x11cb15[_0xb934('0x2b')]);if(_0x11cb15['name']){delete _0x11cb15[_0xb934('0x2c')];}_0x4b567b[_0xb934('0x1a')](_0x2fbabd)[_0xb934('0x2d')](_0x11cb15);};}exports[_0xb934('0x2e')]=function(_0xa177e6,_0xf30b02){var _0x402e3f={},_0x50e0f5={},_0x26c32b={'count':0x0,'rows':[]};var _0x486f00=_[_0xb934('0x2f')](db['WhatsappTransferReport'][_0xb934('0x30')],function(_0x8864a6){return{'name':_0x8864a6['fieldName'],'type':_0x8864a6[_0xb934('0x31')][_0xb934('0x32')]};});_0x50e0f5[_0xb934('0x33')]=_['map'](_0x486f00,_0xb934('0x2c'));_0x50e0f5[_0xb934('0x34')]=_[_0xb934('0x35')](_0xa177e6[_0xb934('0x34')]);_0x50e0f5[_0xb934('0x36')]=_[_0xb934('0x37')](_0x50e0f5[_0xb934('0x33')],_0x50e0f5[_0xb934('0x34')]);_0x402e3f[_0xb934('0x38')]=_[_0xb934('0x37')](_0x50e0f5[_0xb934('0x33')],qs[_0xb934('0x39')](_0xa177e6[_0xb934('0x34')][_0xb934('0x39')]));_0x402e3f['attributes']=_0x402e3f[_0xb934('0x38')][_0xb934('0x3a')]?_0x402e3f[_0xb934('0x38')]:_0x50e0f5['model'];if(!_0xa177e6[_0xb934('0x34')][_0xb934('0x3b')](_0xb934('0x3c'))){_0x402e3f[_0xb934('0x1e')]=qs[_0xb934('0x1e')](_0xa177e6[_0xb934('0x34')][_0xb934('0x1e')]);_0x402e3f[_0xb934('0x1c')]=qs['offset'](_0xa177e6[_0xb934('0x34')][_0xb934('0x1c')]);}_0x402e3f[_0xb934('0x3d')]=qs[_0xb934('0x3e')](_0xa177e6[_0xb934('0x34')][_0xb934('0x3e')]);_0x402e3f[_0xb934('0x3f')]=qs['filters'](_[_0xb934('0x40')](_0xa177e6['query'],_0x50e0f5[_0xb934('0x36')]),_0x486f00);if(_0xa177e6[_0xb934('0x34')][_0xb934('0x41')]){_0x402e3f[_0xb934('0x3f')]=_[_0xb934('0x42')](_0x402e3f[_0xb934('0x3f')],{'$or':_[_0xb934('0x2f')](_0x486f00,function(_0x41fb3e){if(_0x41fb3e[_0xb934('0x31')]!==_0xb934('0x43')){var _0x500d22={};_0x500d22[_0x41fb3e[_0xb934('0x2c')]]={'$like':'%'+_0xa177e6[_0xb934('0x34')][_0xb934('0x41')]+'%'};return _0x500d22;}})});}_0x402e3f=_[_0xb934('0x42')]({},_0x402e3f,_0xa177e6[_0xb934('0x44')]);var _0xcffc90={'where':_0x402e3f[_0xb934('0x3f')]};return db['WhatsappTransferReport']['count'](_0xcffc90)[_0xb934('0x27')](function(_0x161d5d){_0x26c32b[_0xb934('0x1f')]=_0x161d5d;if(_0xa177e6[_0xb934('0x34')]['includeAll']){_0x402e3f[_0xb934('0x45')]=[{'all':!![]}];}return db['WhatsappTransferReport'][_0xb934('0x46')](_0x402e3f);})[_0xb934('0x27')](function(_0x24fde8){_0x26c32b[_0xb934('0x47')]=_0x24fde8;return _0x26c32b;})['then'](respondWithFilteredResult(_0xf30b02,_0x402e3f))[_0xb934('0x48')](handleError(_0xf30b02,null));};exports['show']=function(_0x389777,_0x4e3244){var _0x229bc9={'raw':!![],'where':{'id':_0x389777[_0xb934('0x49')]['id']}},_0x8ac605={};_0x8ac605[_0xb934('0x33')]=_['keys'](db[_0xb934('0x4a')][_0xb934('0x30')]);_0x8ac605[_0xb934('0x34')]=_['keys'](_0x389777[_0xb934('0x34')]);_0x8ac605[_0xb934('0x36')]=_[_0xb934('0x37')](_0x8ac605[_0xb934('0x33')],_0x8ac605[_0xb934('0x34')]);_0x229bc9[_0xb934('0x38')]=_[_0xb934('0x37')](_0x8ac605[_0xb934('0x33')],qs[_0xb934('0x39')](_0x389777['query'][_0xb934('0x39')]));_0x229bc9[_0xb934('0x38')]=_0x229bc9[_0xb934('0x38')][_0xb934('0x3a')]?_0x229bc9[_0xb934('0x38')]:_0x8ac605['model'];if(_0x389777[_0xb934('0x34')]['includeAll']){_0x229bc9[_0xb934('0x45')]=[{'all':!![]}];}_0x229bc9=_['merge']({},_0x229bc9,_0x389777[_0xb934('0x44')]);return db['WhatsappTransferReport']['find'](_0x229bc9)[_0xb934('0x27')](handleEntityNotFound(_0x4e3244,null))[_0xb934('0x27')](respondWithResult(_0x4e3244,null))[_0xb934('0x48')](handleError(_0x4e3244,null));};exports[_0xb934('0x4b')]=function(_0x1880a2,_0x3502e6){return db['WhatsappTransferReport']['create'](_0x1880a2[_0xb934('0x4c')],{})[_0xb934('0x27')](respondWithResult(_0x3502e6,0xc9))['catch'](handleError(_0x3502e6,null));};exports[_0xb934('0x26')]=function(_0x5bfbb7,_0x1764f4){if(_0x5bfbb7[_0xb934('0x4c')]['id']){delete _0x5bfbb7['body']['id'];}return db['WhatsappTransferReport'][_0xb934('0x4d')]({'where':{'id':_0x5bfbb7[_0xb934('0x49')]['id']}})[_0xb934('0x27')](handleEntityNotFound(_0x1764f4,null))[_0xb934('0x27')](saveUpdates(_0x5bfbb7[_0xb934('0x4c')],null))[_0xb934('0x27')](respondWithResult(_0x1764f4,null))[_0xb934('0x48')](handleError(_0x1764f4,null));};exports[_0xb934('0x28')]=function(_0x3e171e,_0x5a7e26){return db[_0xb934('0x4a')]['find']({'where':{'id':_0x3e171e[_0xb934('0x49')]['id']}})[_0xb934('0x27')](handleEntityNotFound(_0x5a7e26,null))[_0xb934('0x27')](removeEntity(_0x5a7e26,null))['catch'](handleError(_0x5a7e26,null));};exports[_0xb934('0x4e')]=function(_0x48ae08,_0xcfef17){return db[_0xb934('0x4a')]['describe']()['then'](respondWithResult(_0xcfef17,null))[_0xb934('0x48')](handleError(_0xcfef17,null));}; \ No newline at end of file +var _0xe293=['hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','rows','catch','find','create','body','params','describe','eml-format','rimraf','fast-json-patch','moment','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','end','error','stack','name','send','map','WhatsappTransferReport','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0xe293,0x172));var _0x3e29=function(_0x218972,_0x1f9794){_0x218972=_0x218972-0x0;var _0x1bb1a8=_0xe293[_0x218972];return _0x1bb1a8;};'use strict';var emlformat=require(_0x3e29('0x0'));var rimraf=require(_0x3e29('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3e29('0x2'));var rp=require('request-promise');var moment=require(_0x3e29('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3e29('0x4'));var path=require('path');var sox=require(_0x3e29('0x5'));var csv=require(_0x3e29('0x6'));var ejs=require(_0x3e29('0x7'));var fs=require('fs');var fs_extra=require(_0x3e29('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x3e29('0x9'));var jsforce=require(_0x3e29('0xa'));var deskjs=require(_0x3e29('0xb'));var toCsv=require('to-csv');var querystring=require(_0x3e29('0xc'));var Papa=require(_0x3e29('0xd'));var Redis=require(_0x3e29('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3e29('0xf'))(_0x3e29('0x10'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3e29('0x11'));var db=require(_0x3e29('0x12'))['db'];function respondWithStatusCode(_0x10fa81,_0x5a33da){_0x5a33da=_0x5a33da||0xcc;return function(_0x6a3120){if(_0x6a3120){return _0x10fa81[_0x3e29('0x13')](_0x5a33da);}return _0x10fa81[_0x3e29('0x14')](_0x5a33da)['end']();};}function respondWithResult(_0x55584a,_0x36e37a){_0x36e37a=_0x36e37a||0xc8;return function(_0x3fb8b2){if(_0x3fb8b2){return _0x55584a[_0x3e29('0x14')](_0x36e37a)[_0x3e29('0x15')](_0x3fb8b2);}};}function respondWithFilteredResult(_0x4cbd02,_0x4e4101){return function(_0x5e577e){if(_0x5e577e){var _0x5e6785=typeof _0x4e4101[_0x3e29('0x16')]===_0x3e29('0x17')&&typeof _0x4e4101[_0x3e29('0x18')]===_0x3e29('0x17');var _0x58b9cc=_0x5e577e[_0x3e29('0x19')];var _0x2f07f6=_0x5e6785?0x0:_0x4e4101[_0x3e29('0x16')];var _0x1e85ec=_0x5e6785?_0x5e577e[_0x3e29('0x19')]:_0x4e4101['offset']+_0x4e4101[_0x3e29('0x18')];var _0x3856c0;if(_0x1e85ec>=_0x58b9cc){_0x1e85ec=_0x58b9cc;_0x3856c0=0xc8;}else{_0x3856c0=0xce;}_0x4cbd02[_0x3e29('0x14')](_0x3856c0);return _0x4cbd02[_0x3e29('0x1a')]('Content-Range',_0x2f07f6+'-'+_0x1e85ec+'/'+_0x58b9cc)[_0x3e29('0x15')](_0x5e577e);}return null;};}function patchUpdates(_0x405a4e){return function(_0x41c0a7){try{jsonpatch['apply'](_0x41c0a7,_0x405a4e,!![]);}catch(_0x6ee28e){return BPromise[_0x3e29('0x1b')](_0x6ee28e);}return _0x41c0a7[_0x3e29('0x1c')]();};}function saveUpdates(_0x1bff3c,_0x12ccb4){return function(_0x422f4b){if(_0x422f4b){return _0x422f4b[_0x3e29('0x1d')](_0x1bff3c)[_0x3e29('0x1e')](function(_0x40ee17){return _0x40ee17;});}return null;};}function removeEntity(_0x20a942,_0x415e20){return function(_0x47540a){if(_0x47540a){return _0x47540a[_0x3e29('0x1f')]()['then'](function(){_0x20a942[_0x3e29('0x14')](0xcc)[_0x3e29('0x20')]();});}};}function handleEntityNotFound(_0x51ebf3,_0x4de9cf){return function(_0x58a96c){if(!_0x58a96c){_0x51ebf3[_0x3e29('0x13')](0x194);}return _0x58a96c;};}function handleError(_0x23f47a,_0x4ba322){_0x4ba322=_0x4ba322||0x1f4;return function(_0x17701b){logger[_0x3e29('0x21')](_0x17701b[_0x3e29('0x22')]);if(_0x17701b[_0x3e29('0x23')]){delete _0x17701b[_0x3e29('0x23')];}_0x23f47a['status'](_0x4ba322)[_0x3e29('0x24')](_0x17701b);};}exports['index']=function(_0x3dc73f,_0x5522f8){var _0x405e45={},_0x1b5b57={},_0x1f92d1={'count':0x0,'rows':[]};var _0xce1148=_[_0x3e29('0x25')](db[_0x3e29('0x26')][_0x3e29('0x27')],function(_0x40ddc5){return{'name':_0x40ddc5[_0x3e29('0x28')],'type':_0x40ddc5['type'][_0x3e29('0x29')]};});_0x1b5b57[_0x3e29('0x2a')]=_['map'](_0xce1148,_0x3e29('0x23'));_0x1b5b57[_0x3e29('0x2b')]=_[_0x3e29('0x2c')](_0x3dc73f[_0x3e29('0x2b')]);_0x1b5b57[_0x3e29('0x2d')]=_['intersection'](_0x1b5b57[_0x3e29('0x2a')],_0x1b5b57['query']);_0x405e45[_0x3e29('0x2e')]=_[_0x3e29('0x2f')](_0x1b5b57[_0x3e29('0x2a')],qs[_0x3e29('0x30')](_0x3dc73f[_0x3e29('0x2b')]['fields']));_0x405e45[_0x3e29('0x2e')]=_0x405e45[_0x3e29('0x2e')][_0x3e29('0x31')]?_0x405e45['attributes']:_0x1b5b57[_0x3e29('0x2a')];if(!_0x3dc73f[_0x3e29('0x2b')][_0x3e29('0x32')](_0x3e29('0x33'))){_0x405e45[_0x3e29('0x18')]=qs[_0x3e29('0x18')](_0x3dc73f['query'][_0x3e29('0x18')]);_0x405e45[_0x3e29('0x16')]=qs[_0x3e29('0x16')](_0x3dc73f[_0x3e29('0x2b')]['offset']);}_0x405e45[_0x3e29('0x34')]=qs[_0x3e29('0x35')](_0x3dc73f[_0x3e29('0x2b')]['sort']);_0x405e45[_0x3e29('0x36')]=qs[_0x3e29('0x2d')](_[_0x3e29('0x37')](_0x3dc73f['query'],_0x1b5b57['filters']),_0xce1148);if(_0x3dc73f[_0x3e29('0x2b')][_0x3e29('0x38')]){_0x405e45['where']=_[_0x3e29('0x39')](_0x405e45[_0x3e29('0x36')],{'$or':_[_0x3e29('0x25')](_0xce1148,function(_0x3621e9){if(_0x3621e9[_0x3e29('0x3a')]!=='VIRTUAL'){var _0xde5847={};_0xde5847[_0x3621e9[_0x3e29('0x23')]]={'$like':'%'+_0x3dc73f[_0x3e29('0x2b')]['filter']+'%'};return _0xde5847;}})});}_0x405e45=_['merge']({},_0x405e45,_0x3dc73f[_0x3e29('0x3b')]);var _0x24be63={'where':_0x405e45[_0x3e29('0x36')]};return db[_0x3e29('0x26')][_0x3e29('0x19')](_0x24be63)[_0x3e29('0x1e')](function(_0x19ec18){_0x1f92d1[_0x3e29('0x19')]=_0x19ec18;if(_0x3dc73f[_0x3e29('0x2b')][_0x3e29('0x3c')]){_0x405e45[_0x3e29('0x3d')]=[{'all':!![]}];}return db[_0x3e29('0x26')][_0x3e29('0x3e')](_0x405e45);})['then'](function(_0xed30bf){_0x1f92d1[_0x3e29('0x3f')]=_0xed30bf;return _0x1f92d1;})[_0x3e29('0x1e')](respondWithFilteredResult(_0x5522f8,_0x405e45))[_0x3e29('0x40')](handleError(_0x5522f8,null));};exports['show']=function(_0x180df7,_0x1ce7e4){var _0x168bf2={'raw':!![],'where':{'id':_0x180df7['params']['id']}},_0x535b37={};_0x535b37['model']=_[_0x3e29('0x2c')](db[_0x3e29('0x26')][_0x3e29('0x27')]);_0x535b37[_0x3e29('0x2b')]=_[_0x3e29('0x2c')](_0x180df7['query']);_0x535b37['filters']=_[_0x3e29('0x2f')](_0x535b37[_0x3e29('0x2a')],_0x535b37[_0x3e29('0x2b')]);_0x168bf2[_0x3e29('0x2e')]=_[_0x3e29('0x2f')](_0x535b37[_0x3e29('0x2a')],qs[_0x3e29('0x30')](_0x180df7[_0x3e29('0x2b')][_0x3e29('0x30')]));_0x168bf2[_0x3e29('0x2e')]=_0x168bf2[_0x3e29('0x2e')]['length']?_0x168bf2['attributes']:_0x535b37['model'];if(_0x180df7['query']['includeAll']){_0x168bf2[_0x3e29('0x3d')]=[{'all':!![]}];}_0x168bf2=_[_0x3e29('0x39')]({},_0x168bf2,_0x180df7[_0x3e29('0x3b')]);return db[_0x3e29('0x26')][_0x3e29('0x41')](_0x168bf2)[_0x3e29('0x1e')](handleEntityNotFound(_0x1ce7e4,null))[_0x3e29('0x1e')](respondWithResult(_0x1ce7e4,null))[_0x3e29('0x40')](handleError(_0x1ce7e4,null));};exports[_0x3e29('0x42')]=function(_0x31b6c7,_0x566a9e){return db[_0x3e29('0x26')][_0x3e29('0x42')](_0x31b6c7[_0x3e29('0x43')],{})['then'](respondWithResult(_0x566a9e,0xc9))['catch'](handleError(_0x566a9e,null));};exports[_0x3e29('0x1d')]=function(_0x250b3d,_0x3a90cd){if(_0x250b3d[_0x3e29('0x43')]['id']){delete _0x250b3d[_0x3e29('0x43')]['id'];}return db[_0x3e29('0x26')][_0x3e29('0x41')]({'where':{'id':_0x250b3d['params']['id']}})[_0x3e29('0x1e')](handleEntityNotFound(_0x3a90cd,null))['then'](saveUpdates(_0x250b3d['body'],null))[_0x3e29('0x1e')](respondWithResult(_0x3a90cd,null))[_0x3e29('0x40')](handleError(_0x3a90cd,null));};exports[_0x3e29('0x1f')]=function(_0x1c6d61,_0x38b616){return db[_0x3e29('0x26')]['find']({'where':{'id':_0x1c6d61[_0x3e29('0x44')]['id']}})['then'](handleEntityNotFound(_0x38b616,null))[_0x3e29('0x1e')](removeEntity(_0x38b616,null))[_0x3e29('0x40')](handleError(_0x38b616,null));};exports[_0x3e29('0x45')]=function(_0x432169,_0x511909){return db[_0x3e29('0x26')][_0x3e29('0x45')]()[_0x3e29('0x1e')](respondWithResult(_0x511909,null))['catch'](handleError(_0x511909,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index 0870f9d..397e885 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 _0xa96a=['WhatsappTransferReport','uniqueid','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','exports','define'];(function(_0x1a74c8,_0x580a6e){var _0x4ec492=function(_0x27efb8){while(--_0x27efb8){_0x1a74c8['push'](_0x1a74c8['shift']());}};_0x4ec492(++_0x580a6e);}(_0xa96a,0x182));var _0xaa96=function(_0x46f21f,_0x1a06e2){_0x46f21f=_0x46f21f-0x0;var _0x1327e1=_0xa96a[_0x46f21f];return _0x1327e1;};'use strict';var _=require(_0xaa96('0x0'));var util=require(_0xaa96('0x1'));var logger=require(_0xaa96('0x2'))(_0xaa96('0x3'));var moment=require('moment');var BPromise=require(_0xaa96('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaa96('0x5'));var rimraf=require(_0xaa96('0x6'));var config=require(_0xaa96('0x7'));var attributes=require('./whatsappTransferReport.attributes');module[_0xaa96('0x8')]=function(_0x137926,_0x40cbe4){return _0x137926[_0xaa96('0x9')](_0xaa96('0xa'),attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':_0xaa96('0xb'),'fields':[_0xaa96('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5a2a=['uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','WhatsappTransferReport','report_whatsapp_transfer'];(function(_0x4d216c,_0x363a80){var _0x36fe74=function(_0x460e09){while(--_0x460e09){_0x4d216c['push'](_0x4d216c['shift']());}};_0x36fe74(++_0x363a80);}(_0x5a2a,0x16d));var _0xa5a2=function(_0x3fde87,_0x11291e){_0x3fde87=_0x3fde87-0x0;var _0x4bca0d=_0x5a2a[_0x3fde87];return _0x4bca0d;};'use strict';var _=require(_0xa5a2('0x0'));var util=require('util');var logger=require(_0xa5a2('0x1'))(_0xa5a2('0x2'));var moment=require(_0xa5a2('0x3'));var BPromise=require(_0xa5a2('0x4'));var rp=require(_0xa5a2('0x5'));var fs=require('fs');var path=require(_0xa5a2('0x6'));var rimraf=require(_0xa5a2('0x7'));var config=require(_0xa5a2('0x8'));var attributes=require('./whatsappTransferReport.attributes');module['exports']=function(_0x334898,_0x22467a){return _0x334898[_0xa5a2('0x9')](_0xa5a2('0xa'),attributes,{'tableName':_0xa5a2('0xb'),'paranoid':![],'indexes':[{'name':_0xa5a2('0xc'),'fields':[_0xa5a2('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index e2202aa..221ec0b 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 _0x8482=['error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','WhatsappTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x8482,0xe1));var _0x2848=function(_0x249043,_0xff2f31){_0x249043=_0x249043-0x0;var _0x265b0d=_0x8482[_0x249043];return _0x265b0d;};'use strict';var _=require(_0x2848('0x0'));var util=require(_0x2848('0x1'));var moment=require(_0x2848('0x2'));var BPromise=require(_0x2848('0x3'));var rs=require(_0x2848('0x4'));var fs=require('fs');var Redis=require(_0x2848('0x5'));var db=require(_0x2848('0x6'))['db'];var utils=require(_0x2848('0x7'));var logger=require(_0x2848('0x8'))(_0x2848('0x9'));var config=require('../../config/environment');var jayson=require(_0x2848('0xa'));var client=jayson['client'][_0x2848('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x162283,_0x40cc88,_0x36850a){return new BPromise(function(_0x2f0627,_0x47a843){return client['request'](_0x162283,_0x36850a)[_0x2848('0xc')](function(_0x1c5710){logger[_0x2848('0xd')](_0x2848('0xe'),_0x40cc88,_0x2848('0xf'));logger['debug'](_0x2848('0x10'),_0x40cc88,_0x2848('0xf'),JSON['stringify'](_0x1c5710));if(_0x1c5710[_0x2848('0x11')]){if(_0x1c5710[_0x2848('0x11')][_0x2848('0x12')]===0x1f4){logger['error'](_0x2848('0xe'),_0x40cc88,_0x1c5710[_0x2848('0x11')][_0x2848('0x13')]);return _0x47a843(_0x1c5710[_0x2848('0x11')]['message']);}logger[_0x2848('0x11')](_0x2848('0xe'),_0x40cc88,_0x1c5710[_0x2848('0x11')][_0x2848('0x13')]);return _0x2f0627(_0x1c5710[_0x2848('0x11')][_0x2848('0x13')]);}else{logger[_0x2848('0xd')](_0x2848('0xe'),_0x40cc88,_0x2848('0xf'));_0x2f0627(_0x1c5710[_0x2848('0x14')][_0x2848('0x13')]);}})[_0x2848('0x15')](function(_0x59077e){logger[_0x2848('0x11')](_0x2848('0xe'),_0x40cc88,_0x59077e);_0x47a843(_0x59077e);});});} \ No newline at end of file +var _0x0a63=['message','WhatsappTransferReport,\x20%s,\x20%s','info','request\x20sent','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x50223a,_0x530610){var _0x1863c6=function(_0x1efe65){while(--_0x1efe65){_0x50223a['push'](_0x50223a['shift']());}};_0x1863c6(++_0x530610);}(_0x0a63,0x1e5));var _0x30a6=function(_0x11a2dd,_0x5bf4bc){_0x11a2dd=_0x11a2dd-0x0;var _0x4bc0e2=_0x0a63[_0x11a2dd];return _0x4bc0e2;};'use strict';var _=require(_0x30a6('0x0'));var util=require(_0x30a6('0x1'));var moment=require(_0x30a6('0x2'));var BPromise=require(_0x30a6('0x3'));var rs=require(_0x30a6('0x4'));var fs=require('fs');var Redis=require(_0x30a6('0x5'));var db=require(_0x30a6('0x6'))['db'];var utils=require(_0x30a6('0x7'));var logger=require(_0x30a6('0x8'))(_0x30a6('0x9'));var config=require('../../config/environment');var jayson=require(_0x30a6('0xa'));var client=jayson['client'][_0x30a6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x344377,_0x7d183,_0x13bcdd){return new BPromise(function(_0x1c6a97,_0x1f7911){return client[_0x30a6('0xc')](_0x344377,_0x13bcdd)[_0x30a6('0xd')](function(_0x4deeaf){logger['info']('WhatsappTransferReport,\x20%s,\x20%s',_0x7d183,'request\x20sent');logger[_0x30a6('0xe')](_0x30a6('0xf'),_0x7d183,'request\x20sent',JSON[_0x30a6('0x10')](_0x4deeaf));if(_0x4deeaf[_0x30a6('0x11')]){if(_0x4deeaf['error'][_0x30a6('0x12')]===0x1f4){logger[_0x30a6('0x11')]('WhatsappTransferReport,\x20%s,\x20%s',_0x7d183,_0x4deeaf[_0x30a6('0x11')][_0x30a6('0x13')]);return _0x1f7911(_0x4deeaf[_0x30a6('0x11')]['message']);}logger[_0x30a6('0x11')](_0x30a6('0x14'),_0x7d183,_0x4deeaf['error'][_0x30a6('0x13')]);return _0x1c6a97(_0x4deeaf[_0x30a6('0x11')][_0x30a6('0x13')]);}else{logger[_0x30a6('0x15')](_0x30a6('0x14'),_0x7d183,_0x30a6('0x16'));_0x1c6a97(_0x4deeaf['result']['message']);}})[_0x30a6('0x17')](function(_0x527285){logger[_0x30a6('0x11')](_0x30a6('0x14'),_0x7d183,_0x527285);_0x1f7911(_0x527285);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index 3449423..dc46e5e 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9a71=['sync','listen','then','info','start','map','filter','online','join','Offline\x20apps:','status','name','None','seedDB','default','./config/license','catch','error','lodash','./mysqldb','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','sequelize'];(function(_0x43b888,_0xe977a6){var _0x142d2a=function(_0x49970e){while(--_0x49970e){_0x43b888['push'](_0x43b888['shift']());}};_0x142d2a(++_0xe977a6);}(_0x9a71,0x1f2));var _0x19a7=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9a71[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x19a7('0x0'));var mysqldb=require(_0x19a7('0x1'));var rpc=require(_0x19a7('0x2'));var config=require(_0x19a7('0x3'));var logger=require(_0x19a7('0x4'))(_0x19a7('0x5'));var pm2=require(_0x19a7('0x6'));var pm2Config=require('./config/pm2/config');var schedule=require(_0x19a7('0x7'));var chat=require(_0x19a7('0x8'));var whatsapp=require(_0x19a7('0x9'));var transcribe=require(_0x19a7('0xa'));function main(){return mysqldb['db'][_0x19a7('0xb')][_0x19a7('0xc')]()['then'](function(){return rpc[_0x19a7('0xd')]();})[_0x19a7('0xe')](function(_0x16e642){logger[_0x19a7('0xf')](_0x16e642);return chat['start']();})[_0x19a7('0xe')](function(){return whatsapp[_0x19a7('0x10')]();})[_0x19a7('0xe')](function(){return schedule[_0x19a7('0x10')]();})[_0x19a7('0xe')](function(){return transcribe[_0x19a7('0x10')]();})[_0x19a7('0xe')](function(_0x40ac27){logger[_0x19a7('0xf')](_0x40ac27);return pm2['start'](pm2Config);})['then'](function(_0x176c9c){logger[_0x19a7('0xf')]('Online\x20apps:',_[_0x19a7('0x11')](_[_0x19a7('0x12')](_0x176c9c,{'status':_0x19a7('0x13')}),'name')[_0x19a7('0x14')]());logger[_0x19a7('0xf')](_0x19a7('0x15'),_[_0x19a7('0x11')](_['filter'](_0x176c9c,function(_0x397b2d){return _0x397b2d[_0x19a7('0x16')]!=='online';}),_0x19a7('0x17'))[_0x19a7('0x14')]()||_0x19a7('0x18'));config[_0x19a7('0x19')]&&require('./config/seedDB')[_0x19a7('0x1a')]();require(_0x19a7('0x1b'))['default']();})[_0x19a7('0x1c')](function(_0x2a7864){logger[_0x19a7('0x1d')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x2a7864);process['exit'](0x1);});}main(); \ No newline at end of file +var _0x226d=['Online\x20apps:','map','filter','online','name','join','status','seedDB','default','catch','./mysqldb','./rpc','./config/environment','app','./config/pm2','./config/schedule/whatsapp','./config/schedule/transcribe','sequelize','sync','then','listen','info','start'];(function(_0x172747,_0x1732bd){var _0x509692=function(_0x448c56){while(--_0x448c56){_0x172747['push'](_0x172747['shift']());}};_0x509692(++_0x1732bd);}(_0x226d,0xc2));var _0xd226=function(_0x270286,_0x1525dd){_0x270286=_0x270286-0x0;var _0x4636ee=_0x226d[_0x270286];return _0x4636ee;};'use strict';var _=require('lodash');var mysqldb=require(_0xd226('0x0'));var rpc=require(_0xd226('0x1'));var config=require(_0xd226('0x2'));var logger=require('./config/logger')(_0xd226('0x3'));var pm2=require(_0xd226('0x4'));var pm2Config=require('./config/pm2/config');var schedule=require('./config/schedule');var chat=require('./config/schedule/chat');var whatsapp=require(_0xd226('0x5'));var transcribe=require(_0xd226('0x6'));function main(){return mysqldb['db'][_0xd226('0x7')][_0xd226('0x8')]()[_0xd226('0x9')](function(){return rpc[_0xd226('0xa')]();})[_0xd226('0x9')](function(_0x38d444){logger[_0xd226('0xb')](_0x38d444);return chat[_0xd226('0xc')]();})[_0xd226('0x9')](function(){return whatsapp[_0xd226('0xc')]();})[_0xd226('0x9')](function(){return schedule['start']();})[_0xd226('0x9')](function(){return transcribe[_0xd226('0xc')]();})['then'](function(_0x442294){logger[_0xd226('0xb')](_0x442294);return pm2[_0xd226('0xc')](pm2Config);})[_0xd226('0x9')](function(_0x30494b){logger[_0xd226('0xb')](_0xd226('0xd'),_[_0xd226('0xe')](_[_0xd226('0xf')](_0x30494b,{'status':_0xd226('0x10')}),_0xd226('0x11'))[_0xd226('0x12')]());logger[_0xd226('0xb')]('Offline\x20apps:',_[_0xd226('0xe')](_[_0xd226('0xf')](_0x30494b,function(_0x296005){return _0x296005[_0xd226('0x13')]!==_0xd226('0x10');}),_0xd226('0x11'))['join']()||'None');config[_0xd226('0x14')]&&require('./config/seedDB')['default']();require('./config/license')[_0xd226('0x15')]();})[_0xd226('0x16')](function(_0x1dbfa8){logger['error']('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x1dbfa8);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 74648b2..ebd105b 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 _0xc4ab=['validatePasswordHistory','decryptString','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','split','unshift','encryptString','join','promisify','sign','secret','options','verify','toString','hex','floor','now','../../config/environment','../../config/license/util','../encryptor','lodash','express-jwt','composable-middleware','basic-auth','crypto','bluebird','util','moment','secrets','session','fullname','name','email','permissions','md5secret','voicePause','chatPause','faxPause','smsPause','openchannelPause','pauseType','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','use','user','findOne','params','closed','then','status','unmanaged','json','disposition','Forbidden.','catch','isAuthenticated','headers','authorization','User','find','authenticate','Wrong\x20credentials.','Bearer','Unknown\x20authorization\x20format','apikey','getUuid','query','Setting','allowedLoginAttempts','blockDuration','isEqual','apiKeyNonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','blockedAt','add','User\x20object\x20not\x20found.','getLicense','update','Forbidden','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','role','cookie','motion.token','redirect','/dashboards/general','retrieveApiKey','isNil','apiKeyIat','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.'];(function(_0x12012d,_0x46e1f6){var _0x2ccaf1=function(_0x3a9488){while(--_0x3a9488){_0x12012d['push'](_0x12012d['shift']());}};_0x2ccaf1(++_0x46e1f6);}(_0xc4ab,0x8e));var _0xbc4a=function(_0x2910c8,_0x229299){_0x2910c8=_0x2910c8-0x0;var _0x3cdb11=_0xc4ab[_0x2910c8];return _0x3cdb11;};'use strict';var db=require('../../mysqldb')['db'];var config=require(_0xbc4a('0x0'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require(_0xbc4a('0x1'));var encryptor=require(_0xbc4a('0x2'));var _=require(_0xbc4a('0x3'));var jwt=require('jsonwebtoken');var expressJwt=require(_0xbc4a('0x4'));var compose=require(_0xbc4a('0x5'));var basicAuth=require(_0xbc4a('0x6'));var crypto=require(_0xbc4a('0x7'));var BPromise=require(_0xbc4a('0x8'));var util=require(_0xbc4a('0x9'));var moment=require(_0xbc4a('0xa'));var validateJwt=expressJwt({'secret':config[_0xbc4a('0xb')][_0xbc4a('0xc')]});var userAttributes=['id','role',_0xbc4a('0xd'),_0xbc4a('0xe'),'internal',_0xbc4a('0xf'),'userpic',_0xbc4a('0x10'),_0xbc4a('0x11'),_0xbc4a('0x12'),_0xbc4a('0x13'),'mailPause',_0xbc4a('0x14'),_0xbc4a('0x15'),_0xbc4a('0x16'),_0xbc4a('0x17'),'showWebBar',_0xbc4a('0x18'),_0xbc4a('0x19'),_0xbc4a('0x1a'),_0xbc4a('0x1b'),_0xbc4a('0x1c'),_0xbc4a('0x1d'),_0xbc4a('0x1e'),_0xbc4a('0x1f'),_0xbc4a('0x20'),_0xbc4a('0x21'),'phoneBarEnableDtmfTone',_0xbc4a('0x22'),_0xbc4a('0x23'),_0xbc4a('0x24'),_0xbc4a('0x25'),_0xbc4a('0x26'),_0xbc4a('0x27'),_0xbc4a('0x28'),_0xbc4a('0x29'),'privacyEnabled',_0xbc4a('0x2a'),_0xbc4a('0x2b'),_0xbc4a('0x2c'),_0xbc4a('0x2d'),'downloadAttachments'];exports['isChatInteractionAuthorized']=function(){return this['isAuthenticated'](!![])[_0xbc4a('0x2e')](function(_0x180058,_0x1a82c8,_0x1fe9ef){if(_0x180058[_0xbc4a('0x2f')]){_0x1fe9ef();}else{return db['ChatInteraction'][_0xbc4a('0x30')]({'where':{'id':_0x180058[_0xbc4a('0x31')]['id']},'attributes':['id',_0xbc4a('0x32'),'disposition'],'raw':!![]})[_0xbc4a('0x33')](function(_0x182942){if(_0x182942&&_0x182942[_0xbc4a('0x32')]){return _0x1a82c8[_0xbc4a('0x34')](_0x182942['disposition']===_0xbc4a('0x35')?0x195:0x193)[_0xbc4a('0x36')]({'message':_0x182942[_0xbc4a('0x37')]==='unmanaged'?'Unmanaged.':_0xbc4a('0x38')});}else{_0x1fe9ef();}})[_0xbc4a('0x39')](function(_0x5c45fd){_0x1fe9ef(_0x5c45fd);});}});};exports[_0xbc4a('0x3a')]=function isAuthenticated(_0x4122a8){return compose()[_0xbc4a('0x2e')](function(_0x3a6736,_0x5c8811,_0x36a360){var _0x5b8eba;if(_0x3a6736[_0xbc4a('0x3b')]['authorization']){if(_['startsWith'](_0x3a6736[_0xbc4a('0x3b')][_0xbc4a('0x3c')],'Basic')){var _0x3b1a11=basicAuth(_0x3a6736);db[_0xbc4a('0x3d')][_0xbc4a('0x3e')]({'where':{'name':_0x3b1a11['name']}})[_0xbc4a('0x33')](function(_0x1f4199){if(!_0x1f4199||!_0x1f4199[_0xbc4a('0x3f')](_0x3b1a11['pass'])){return _0x5c8811[_0xbc4a('0x34')](0x191)[_0xbc4a('0x36')]({'message':_0xbc4a('0x40')});}_0x3a6736[_0xbc4a('0x2f')]={'id':_0x1f4199['id']};_0x36a360();})[_0xbc4a('0x39')](function(_0x183848){_0x36a360(_0x183848);});}else if(_['startsWith'](_0x3a6736['headers'][_0xbc4a('0x3c')],_0xbc4a('0x41'))){validateJwt(_0x3a6736,_0x5c8811,_0x36a360);}else{if(_0x4122a8){_0x36a360();}else{return _0x5c8811['status'](0x193)[_0xbc4a('0x36')]({'message':_0xbc4a('0x42')});}}}else if(_0x3a6736['query'][_0xbc4a('0x43')]){try{var _0x289a89={'audience':hardwareConf[_0xbc4a('0x44')](),'issuer':hardwareConf[_0xbc4a('0x44')]()};verifyJwt(_0x3a6736[_0xbc4a('0x45')]['apikey'],_0x289a89)['then'](function(_0x10c504){return db['User'][_0xbc4a('0x3e')]({'where':{'id':_0x10c504['sub']}})['then'](function(_0x1a40ca){_0x5b8eba=_0x1a40ca;return db[_0xbc4a('0x46')][_0xbc4a('0x30')]({'where':{'id':0x1},'attributes':[_0xbc4a('0x47'),_0xbc4a('0x48')],'raw':!![]});})[_0xbc4a('0x33')](function(_0x46f736){if(!_0x5b8eba||!_[_0xbc4a('0x49')](_0x5b8eba[_0xbc4a('0x4a')],_0x10c504['nonce'])){return _0x5c8811[_0xbc4a('0x34')](0x191)['json']({'message':_0xbc4a('0x4b')});}if(_0x5b8eba[_0xbc4a('0x4c')]){return _0x5c8811[_0xbc4a('0x34')](0x191)['json']({'message':_0xbc4a('0x4d')});}if(_0x5b8eba[_0xbc4a('0x4e')]){if(_0x46f736[_0xbc4a('0x48')]>0x0){if(moment(_0x5b8eba[_0xbc4a('0x4f')])[_0xbc4a('0x50')](_0x46f736[_0xbc4a('0x48')],'minutes')>moment()){return _0x5c8811[_0xbc4a('0x34')](0x191)[_0xbc4a('0x36')]({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0x5c8811[_0xbc4a('0x34')](0x191)[_0xbc4a('0x36')]({'message':'Invalid\x20API\x20access\x20key'});}}_0x3a6736[_0xbc4a('0x2f')]={'id':_0x5b8eba['id']};_0x36a360();});})[_0xbc4a('0x39')](function(){return _0x5c8811[_0xbc4a('0x34')](0x191)['json']({'message':_0xbc4a('0x4d')});});}catch(_0x61a932){_0x36a360(_0x61a932);}}else if(_0x4122a8){_0x36a360();}else{return _0x5c8811[_0xbc4a('0x34')](0x193)[_0xbc4a('0x36')]({'message':_0xbc4a('0x42')});}})[_0xbc4a('0x2e')](function(_0x427156,_0xadadeb,_0x595d2b){if(_0x427156[_0xbc4a('0x2f')]){db[_0xbc4a('0x3d')][_0xbc4a('0x3e')]({'where':{'id':_0x427156['user']['id']},'attributes':userAttributes})[_0xbc4a('0x33')](function(_0x221318){if(!_0x221318){return _0xadadeb['status'](0x194)[_0xbc4a('0x36')]({'message':'User\x20not\x20found.'});}_0x427156['user']=_0x221318;_0x595d2b();})[_0xbc4a('0x39')](function(_0x1545b6){_0x595d2b(_0x1545b6);});}else if(_0x4122a8){_0x595d2b();}else{return _0xadadeb[_0xbc4a('0x34')](0x194)['json']({'message':_0xbc4a('0x51')});}});};exports['canUpdate']=function canUpdate(){return compose()['use'](function(_0x39bb97,_0x5cb60e,_0x11abec){return licenseUtil[_0xbc4a('0x52')]()['then'](function(_0x6ba24a){if(_0x6ba24a[_0xbc4a('0x53')]){_0x11abec();}else{return _0x5cb60e[_0xbc4a('0x34')](0x193)['json']({'message':_0xbc4a('0x54')});}})[_0xbc4a('0x39')](function(_0x5afec5){_0x11abec(_0x5afec5);});});};exports[_0xbc4a('0x55')]=function(_0x71d29f,_0x4f6ac0,_0x3ee8e4){_0x71d29f[_0xbc4a('0x55')]=!![];return _0x3ee8e4();};exports[_0xbc4a('0x56')]=function signToken(_0x4b9139){return signJwt(_0x4b9139);};exports[_0xbc4a('0x57')]=function(_0x5d11b1,_0x450660){if(!_0x5d11b1[_0xbc4a('0x2f')]){return _0x450660[_0xbc4a('0x34')](0x194)[_0xbc4a('0x36')]({'message':_0xbc4a('0x58')});}var _0x383f08={'payload':{'id':_0x5d11b1[_0xbc4a('0x2f')]['id'],'role':_0x5d11b1[_0xbc4a('0x2f')][_0xbc4a('0x59')]},'options':{'expiresIn':0x15180}};return signJwt(_0x383f08)['then'](function(_0xed40c5){_0x450660[_0xbc4a('0x5a')](_0xbc4a('0x5b'),_0xed40c5);_0x450660[_0xbc4a('0x5c')](_0xbc4a('0x5d'));})[_0xbc4a('0x39')](function(_0x59c34a){return _0x450660[_0xbc4a('0x34')](0x1f4)['send'](_0x59c34a);});};exports[_0xbc4a('0x5e')]=function(_0x19c503){if(_[_0xbc4a('0x5f')](_0x19c503[_0xbc4a('0x4a')])||_[_0xbc4a('0x5f')](_0x19c503[_0xbc4a('0x60')])){return null;}else{return createJwt(_0x19c503);}};exports['generateApiKey']=function(_0x17fa30){_0x17fa30[_0xbc4a('0x4a')]=generateNonce();_0x17fa30['apiKeyIat']=generateIssuedAt();return createJwt(_0x17fa30);};exports[_0xbc4a('0x61')]=function(_0x1c5d68,_0x4053a7){var _0x2e6532=_0x1c5d68[_0xbc4a('0x45')][_0xbc4a('0x43')];if(_0x2e6532){var _0x450523={'nonce':_0x4053a7['apiKeyNonce'],'iat':_0x4053a7[_0xbc4a('0x60')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xbc4a('0x44')]()};return verifyJwt(_0x2e6532,_0x450523)[_0xbc4a('0x33')](function(){return generateApiKey(_0x4053a7);});}else{throw{'message':_0xbc4a('0x62')};}};exports[_0xbc4a('0x63')]=function(_0x427210){var _0x52200b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x52200b[_0xbc4a('0x64')](_0x427210))throw new db[(_0xbc4a('0x65'))][(_0xbc4a('0x66'))](_0xbc4a('0x67'));return;};exports[_0xbc4a('0x68')]=function(_0x413e1e,_0x43ac2f,_0x530e71){var _0xe593c0=encryptor[_0xbc4a('0x69')](_0x43ac2f)['split'](',');for(var _0x448ccb=0x0;_0x448ccb<_0x530e71;_0x448ccb++){if(!_0xe593c0[_0x448ccb])break;if(_0x413e1e['toLowerCase']()===_0xe593c0[_0x448ccb]['toLowerCase']()){var _0x595cdb=util[_0xbc4a('0x6a')](_0xbc4a('0x6b'),_0x530e71);if(_0x530e71===0x1){_0x595cdb=_0xbc4a('0x6c');}throw new db[(_0xbc4a('0x65'))][(_0xbc4a('0x66'))](_0x595cdb);}}return;};exports[_0xbc4a('0x6d')]=function(_0x145c08,_0x55d519){var _0x352b7f=_0x55d519?encryptor[_0xbc4a('0x69')](_0x55d519)[_0xbc4a('0x6e')](','):[];if(_0x352b7f['length']===0x5){_0x352b7f['splice'](-0x1,0x1);}_0x352b7f[_0xbc4a('0x6f')](_0x145c08);return encryptor[_0xbc4a('0x70')](_0x352b7f[_0xbc4a('0x71')](','));};function signJwt(_0x5852e2){var _0x6bf4c4=BPromise[_0xbc4a('0x72')](jwt[_0xbc4a('0x73')],{'context':jwt});var _0x5ddf05=_0x5852e2[_0xbc4a('0x74')]||config[_0xbc4a('0xb')]['session'];return new BPromise(function(_0x4cd686,_0x19e0a1){_0x6bf4c4(_0x5852e2['payload'],_0x5ddf05,_0x5852e2[_0xbc4a('0x75')])[_0xbc4a('0x33')](function(_0x282261){_0x4cd686(_0x282261);})['catch'](function(_0x53abcd){_0x19e0a1(_0x53abcd);});});}function verifyJwt(_0x3b63b0,_0x2e8729,_0x1aaf8d){var _0x45603b=BPromise[_0xbc4a('0x72')](jwt[_0xbc4a('0x76')],{'context':jwt});var _0x5e4a95=_0x1aaf8d||config['secrets'][_0xbc4a('0xc')];return new BPromise(function(_0x482bdc,_0x5efcbe){_0x45603b(_0x3b63b0,_0x5e4a95,_0x2e8729)[_0xbc4a('0x33')](function(_0xb1960d){_0x482bdc(_0xb1960d);})[_0xbc4a('0x39')](function(_0x41d3cb){_0x5efcbe(_0x41d3cb);});});}function generateNonce(){return crypto['randomBytes'](0x10)[_0xbc4a('0x77')](_0xbc4a('0x78'));}function generateIssuedAt(){return Math[_0xbc4a('0x79')](Date[_0xbc4a('0x7a')]()/0x3e8)[_0xbc4a('0x77')]();}function createJwt(_0x38016a){var _0x88898d={'payload':{'iat':_0x38016a['apiKeyIat'],'nonce':_0x38016a[_0xbc4a('0x4a')]},'options':{'algorithm':'HS512','subject':_0x38016a['id']['toString'](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf[_0xbc4a('0x44')]()}};return signJwt(_0x88898d)[_0xbc4a('0x33')](function(_0x519622){return{'iat':_0x38016a['apiKeyIat'],'nonce':_0x38016a[_0xbc4a('0x4a')],'token':_0x519622};});} \ No newline at end of file +var _0x9f7a=['add','minutes','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','update','Forbidden','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','redirect','/dashboards/general','isNil','apiKeyIat','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','toLowerCase','format','updatePasswordsHistory','decryptString','split','length','unshift','sign','secret','payload','options','promisify','secrets','randomBytes','toString','hex','now','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','lodash','jsonwebtoken','express-jwt','util','moment','session','name','internal','userpic','permissions','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','lastLoginAt','lastPauseAt','crudPermissions','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','isChatInteractionAuthorized','isAuthenticated','use','user','findOne','params','closed','disposition','status','unmanaged','Unmanaged.','catch','authorization','startsWith','headers','Basic','User','find','then','authenticate','json','Wrong\x20credentials.','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','Setting','allowedLoginAttempts','blockDuration','isEqual','apiKeyNonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blockedAt'];(function(_0x92713a,_0x68f8b0){var _0x1893e1=function(_0xe49768){while(--_0xe49768){_0x92713a['push'](_0x92713a['shift']());}};_0x1893e1(++_0x68f8b0);}(_0x9f7a,0x185));var _0xa9f7=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0x9f7a[_0x5f309e];return _0x487b5e;};'use strict';var db=require(_0xa9f7('0x0'))['db'];var config=require(_0xa9f7('0x1'));var hardwareConf=require(_0xa9f7('0x2'));var licenseUtil=require(_0xa9f7('0x3'));var encryptor=require(_0xa9f7('0x4'));var _=require(_0xa9f7('0x5'));var jwt=require(_0xa9f7('0x6'));var expressJwt=require(_0xa9f7('0x7'));var compose=require('composable-middleware');var basicAuth=require('basic-auth');var crypto=require('crypto');var BPromise=require('bluebird');var util=require(_0xa9f7('0x8'));var moment=require(_0xa9f7('0x9'));var validateJwt=expressJwt({'secret':config['secrets'][_0xa9f7('0xa')]});var userAttributes=['id','role','fullname',_0xa9f7('0xb'),_0xa9f7('0xc'),'email',_0xa9f7('0xd'),_0xa9f7('0xe'),'md5secret',_0xa9f7('0xf'),_0xa9f7('0x10'),_0xa9f7('0x11'),_0xa9f7('0x12'),_0xa9f7('0x13'),_0xa9f7('0x14'),'pauseType','showWebBar',_0xa9f7('0x15'),_0xa9f7('0x16'),_0xa9f7('0x17'),'allowmessenger',_0xa9f7('0x18'),_0xa9f7('0x19'),_0xa9f7('0x1a'),_0xa9f7('0x1b'),_0xa9f7('0x1c'),_0xa9f7('0x1d'),'phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired',_0xa9f7('0x1e'),_0xa9f7('0x1f'),_0xa9f7('0x20'),_0xa9f7('0x21'),_0xa9f7('0x22'),'privacyEnabled','settingsEnabled',_0xa9f7('0x23'),_0xa9f7('0x24'),_0xa9f7('0x25'),_0xa9f7('0x26')];exports[_0xa9f7('0x27')]=function(){return this[_0xa9f7('0x28')](!![])[_0xa9f7('0x29')](function(_0x115bd2,_0x410519,_0x50ead9){if(_0x115bd2[_0xa9f7('0x2a')]){_0x50ead9();}else{return db['ChatInteraction'][_0xa9f7('0x2b')]({'where':{'id':_0x115bd2[_0xa9f7('0x2c')]['id']},'attributes':['id',_0xa9f7('0x2d'),_0xa9f7('0x2e')],'raw':!![]})['then'](function(_0x1c4482){if(_0x1c4482&&_0x1c4482[_0xa9f7('0x2d')]){return _0x410519[_0xa9f7('0x2f')](_0x1c4482['disposition']===_0xa9f7('0x30')?0x195:0x193)['json']({'message':_0x1c4482[_0xa9f7('0x2e')]===_0xa9f7('0x30')?_0xa9f7('0x31'):'Forbidden.'});}else{_0x50ead9();}})[_0xa9f7('0x32')](function(_0x2b017f){_0x50ead9(_0x2b017f);});}});};exports[_0xa9f7('0x28')]=function isAuthenticated(_0x2e1064){return compose()['use'](function(_0x4a8aa9,_0x45f287,_0x6a2bfd){var _0x4a13e2;if(_0x4a8aa9['headers'][_0xa9f7('0x33')]){if(_[_0xa9f7('0x34')](_0x4a8aa9[_0xa9f7('0x35')][_0xa9f7('0x33')],_0xa9f7('0x36'))){var _0x136797=basicAuth(_0x4a8aa9);db[_0xa9f7('0x37')][_0xa9f7('0x38')]({'where':{'name':_0x136797[_0xa9f7('0xb')]}})[_0xa9f7('0x39')](function(_0x19da8e){if(!_0x19da8e||!_0x19da8e[_0xa9f7('0x3a')](_0x136797['pass'])){return _0x45f287['status'](0x191)[_0xa9f7('0x3b')]({'message':_0xa9f7('0x3c')});}_0x4a8aa9['user']={'id':_0x19da8e['id']};_0x6a2bfd();})['catch'](function(_0x36f0a5){_0x6a2bfd(_0x36f0a5);});}else if(_[_0xa9f7('0x34')](_0x4a8aa9[_0xa9f7('0x35')]['authorization'],_0xa9f7('0x3d'))){validateJwt(_0x4a8aa9,_0x45f287,_0x6a2bfd);}else{if(_0x2e1064){_0x6a2bfd();}else{return _0x45f287[_0xa9f7('0x2f')](0x193)[_0xa9f7('0x3b')]({'message':_0xa9f7('0x3e')});}}}else if(_0x4a8aa9[_0xa9f7('0x3f')][_0xa9f7('0x40')]){try{var _0x4000fe={'audience':hardwareConf[_0xa9f7('0x41')](),'issuer':hardwareConf[_0xa9f7('0x41')]()};verifyJwt(_0x4a8aa9['query']['apikey'],_0x4000fe)[_0xa9f7('0x39')](function(_0x4519d8){return db[_0xa9f7('0x37')][_0xa9f7('0x38')]({'where':{'id':_0x4519d8['sub']}})[_0xa9f7('0x39')](function(_0x3b417a){_0x4a13e2=_0x3b417a;return db[_0xa9f7('0x42')][_0xa9f7('0x2b')]({'where':{'id':0x1},'attributes':[_0xa9f7('0x43'),_0xa9f7('0x44')],'raw':!![]});})[_0xa9f7('0x39')](function(_0x311ba9){if(!_0x4a13e2||!_[_0xa9f7('0x45')](_0x4a13e2[_0xa9f7('0x46')],_0x4519d8['nonce'])){return _0x45f287[_0xa9f7('0x2f')](0x191)['json']({'message':_0xa9f7('0x47')});}if(_0x4a13e2[_0xa9f7('0x48')]){return _0x45f287[_0xa9f7('0x2f')](0x191)[_0xa9f7('0x3b')]({'message':_0xa9f7('0x49')});}if(_0x4a13e2['blocked']){if(_0x311ba9[_0xa9f7('0x44')]>0x0){if(moment(_0x4a13e2[_0xa9f7('0x4a')])[_0xa9f7('0x4b')](_0x311ba9[_0xa9f7('0x44')],_0xa9f7('0x4c'))>moment()){return _0x45f287['status'](0x191)[_0xa9f7('0x3b')]({'message':_0xa9f7('0x49')});}}else{return _0x45f287[_0xa9f7('0x2f')](0x191)[_0xa9f7('0x3b')]({'message':_0xa9f7('0x49')});}}_0x4a8aa9[_0xa9f7('0x2a')]={'id':_0x4a13e2['id']};_0x6a2bfd();});})[_0xa9f7('0x32')](function(){return _0x45f287[_0xa9f7('0x2f')](0x191)['json']({'message':_0xa9f7('0x49')});});}catch(_0x1703b5){_0x6a2bfd(_0x1703b5);}}else if(_0x2e1064){_0x6a2bfd();}else{return _0x45f287[_0xa9f7('0x2f')](0x193)[_0xa9f7('0x3b')]({'message':_0xa9f7('0x3e')});}})[_0xa9f7('0x29')](function(_0x690f47,_0x81581a,_0x440b9c){if(_0x690f47[_0xa9f7('0x2a')]){db[_0xa9f7('0x37')][_0xa9f7('0x38')]({'where':{'id':_0x690f47[_0xa9f7('0x2a')]['id']},'attributes':userAttributes})['then'](function(_0x3c58ac){if(!_0x3c58ac){return _0x81581a[_0xa9f7('0x2f')](0x194)['json']({'message':_0xa9f7('0x4d')});}_0x690f47[_0xa9f7('0x2a')]=_0x3c58ac;_0x440b9c();})[_0xa9f7('0x32')](function(_0x1f47ef){_0x440b9c(_0x1f47ef);});}else if(_0x2e1064){_0x440b9c();}else{return _0x81581a[_0xa9f7('0x2f')](0x194)[_0xa9f7('0x3b')]({'message':_0xa9f7('0x4e')});}});};exports[_0xa9f7('0x4f')]=function canUpdate(){return compose()[_0xa9f7('0x29')](function(_0x3b25e8,_0x3f0c30,_0x4f1e06){return licenseUtil['getLicense']()['then'](function(_0x34154c){if(_0x34154c[_0xa9f7('0x50')]){_0x4f1e06();}else{return _0x3f0c30['status'](0x193)['json']({'message':_0xa9f7('0x51')});}})[_0xa9f7('0x32')](function(_0x1e33d8){_0x4f1e06(_0x1e33d8);});});};exports[_0xa9f7('0x52')]=function(_0x4b4162,_0x397df6,_0x4e3676){_0x4b4162[_0xa9f7('0x52')]=!![];return _0x4e3676();};exports[_0xa9f7('0x53')]=function signToken(_0x3b702b){return signJwt(_0x3b702b);};exports[_0xa9f7('0x54')]=function(_0x3a37b5,_0x4c61b4){if(!_0x3a37b5[_0xa9f7('0x2a')]){return _0x4c61b4[_0xa9f7('0x2f')](0x194)[_0xa9f7('0x3b')]({'message':_0xa9f7('0x55')});}var _0x28d4a9={'payload':{'id':_0x3a37b5['user']['id'],'role':_0x3a37b5['user']['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x28d4a9)[_0xa9f7('0x39')](function(_0x47854a){_0x4c61b4[_0xa9f7('0x56')]('motion.token',_0x47854a);_0x4c61b4[_0xa9f7('0x57')](_0xa9f7('0x58'));})['catch'](function(_0x10e7d9){return _0x4c61b4['status'](0x1f4)['send'](_0x10e7d9);});};exports['retrieveApiKey']=function(_0x465889){if(_[_0xa9f7('0x59')](_0x465889['apiKeyNonce'])||_[_0xa9f7('0x59')](_0x465889[_0xa9f7('0x5a')])){return null;}else{return createJwt(_0x465889);}};exports['generateApiKey']=function(_0x48a357){_0x48a357[_0xa9f7('0x46')]=generateNonce();_0x48a357[_0xa9f7('0x5a')]=generateIssuedAt();return createJwt(_0x48a357);};exports[_0xa9f7('0x5b')]=function(_0x3e60c5,_0x56eb75){var _0x3f2a66=_0x3e60c5[_0xa9f7('0x3f')]['apikey'];if(_0x3f2a66){var _0x5c1659={'nonce':_0x56eb75['apiKeyNonce'],'iat':_0x56eb75['apiKeyIat'],'audience':hardwareConf[_0xa9f7('0x41')](),'issuer':hardwareConf[_0xa9f7('0x41')]()};return verifyJwt(_0x3f2a66,_0x5c1659)[_0xa9f7('0x39')](function(){return generateApiKey(_0x56eb75);});}else{throw{'message':_0xa9f7('0x5c')};}};exports[_0xa9f7('0x5d')]=function(_0x5a56a1){var _0x1405d0=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x1405d0[_0xa9f7('0x5e')](_0x5a56a1))throw new db[(_0xa9f7('0x5f'))][(_0xa9f7('0x60'))](_0xa9f7('0x61'));return;};exports['validatePasswordHistory']=function(_0x15dce9,_0x4dcc9d,_0x5989c0){var _0x286e35=encryptor['decryptString'](_0x4dcc9d)['split'](',');for(var _0x1a380e=0x0;_0x1a380e<_0x5989c0;_0x1a380e++){if(!_0x286e35[_0x1a380e])break;if(_0x15dce9[_0xa9f7('0x62')]()===_0x286e35[_0x1a380e][_0xa9f7('0x62')]()){var _0x2492df=util[_0xa9f7('0x63')]('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x5989c0);if(_0x5989c0===0x1){_0x2492df='The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.';}throw new db[(_0xa9f7('0x5f'))][(_0xa9f7('0x60'))](_0x2492df);}}return;};exports[_0xa9f7('0x64')]=function(_0x551268,_0x1cbde2){var _0x547c27=_0x1cbde2?encryptor[_0xa9f7('0x65')](_0x1cbde2)[_0xa9f7('0x66')](','):[];if(_0x547c27[_0xa9f7('0x67')]===0x5){_0x547c27['splice'](-0x1,0x1);}_0x547c27[_0xa9f7('0x68')](_0x551268);return encryptor['encryptString'](_0x547c27['join'](','));};function signJwt(_0x59e9be){var _0x21aa46=BPromise['promisify'](jwt[_0xa9f7('0x69')],{'context':jwt});var _0x192472=_0x59e9be[_0xa9f7('0x6a')]||config['secrets'][_0xa9f7('0xa')];return new BPromise(function(_0xa8dfc7,_0x119aba){_0x21aa46(_0x59e9be[_0xa9f7('0x6b')],_0x192472,_0x59e9be[_0xa9f7('0x6c')])[_0xa9f7('0x39')](function(_0x404710){_0xa8dfc7(_0x404710);})['catch'](function(_0x23d120){_0x119aba(_0x23d120);});});}function verifyJwt(_0x493ca3,_0x5d1269,_0x6dbccf){var _0x25bf1f=BPromise[_0xa9f7('0x6d')](jwt['verify'],{'context':jwt});var _0x384812=_0x6dbccf||config[_0xa9f7('0x6e')][_0xa9f7('0xa')];return new BPromise(function(_0x1e94d0,_0x5ba50b){_0x25bf1f(_0x493ca3,_0x384812,_0x5d1269)['then'](function(_0x472aff){_0x1e94d0(_0x472aff);})[_0xa9f7('0x32')](function(_0xd01657){_0x5ba50b(_0xd01657);});});}function generateNonce(){return crypto[_0xa9f7('0x6f')](0x10)[_0xa9f7('0x70')](_0xa9f7('0x71'));}function generateIssuedAt(){return Math['floor'](Date[_0xa9f7('0x72')]()/0x3e8)[_0xa9f7('0x70')]();}function createJwt(_0x586959){var _0xb639f8={'payload':{'iat':_0x586959[_0xa9f7('0x5a')],'nonce':_0x586959[_0xa9f7('0x46')]},'options':{'algorithm':_0xa9f7('0x73'),'subject':_0x586959['id']['toString'](),'issuer':hardwareConf[_0xa9f7('0x41')](),'audience':hardwareConf[_0xa9f7('0x41')]()}};return signJwt(_0xb639f8)[_0xa9f7('0x39')](function(_0xd8fa8f){return{'iat':_0x586959[_0xa9f7('0x5a')],'nonce':_0x586959[_0xa9f7('0x46')],'token':_0xd8fa8f};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 1b2c73f..ced0c59 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 _0x2b46=['indexOf','hasOwnProperty','encryptFile','createReadStream','createWriteStream','data','update','binary','write','end','close','unlink','decryptFile','createDecipher','encryptString','createCipher','utf8','base64','final','decryptString','secret','crypto','bluebird','../../config/environment','../../config/logger','app','session','aes-256-ctr','aes192','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter'];(function(_0x2e63dd,_0x31651c){var _0x4fded6=function(_0x32d95d){while(--_0x32d95d){_0x2e63dd['push'](_0x2e63dd['shift']());}};_0x4fded6(++_0x31651c);}(_0x2b46,0x162));var _0x62b4=function(_0x3a09e5,_0x44f04f){_0x3a09e5=_0x3a09e5-0x0;var _0x39cbcf=_0x2b46[_0x3a09e5];return _0x39cbcf;};'use strict';var crypto=require(_0x62b4('0x0'));var fs=require('fs');var BPromise=require(_0x62b4('0x1'));var _=require('lodash');var config=require(_0x62b4('0x2'));var logger=require(_0x62b4('0x3'))(_0x62b4('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets'][_0x62b4('0x5')],'algorithm':_0x62b4('0x6')};const fileOptions={'algorithm':_0x62b4('0x7')};if(config['encrypt']&&config[_0x62b4('0x8')][_0x62b4('0x9')]){var isSupported=isAlgorithmSupported(config[_0x62b4('0x8')][_0x62b4('0x9')]);if(isSupported){fileOptions[_0x62b4('0x9')]=config[_0x62b4('0x8')][_0x62b4('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x62b4('0xa')](',\x20');logger[_0x62b4('0xb')](config['encrypt'][_0x62b4('0x9')],_0x62b4('0xc'),supportedAlgorithms);}}function isASupportedCipher(_0x2a68e1){return AES_SUPPORTED_RX[_0x62b4('0xd')](_0x2a68e1);}function getSupportedCiphers(){return crypto[_0x62b4('0xe')]()[_0x62b4('0xf')](isASupportedCipher);}function isAlgorithmSupported(_0x56780b){return getSupportedCiphers()[_0x62b4('0x10')](_0x56780b)>-0x1;}function combineOptions(_0x1acc0c){var _0x988a75={};for(var _0xdaddee in fileOptions){if(fileOptions[_0x62b4('0x11')](_0xdaddee)){_0x988a75[_0xdaddee]=fileOptions[_0xdaddee];}}if(_0x1acc0c){for(var _0x409c53 in _0x1acc0c){if(_0x1acc0c[_0x62b4('0x11')](_0x409c53)){_0x988a75[_0x409c53]=_0x1acc0c[_0x409c53];}}}return _0x988a75;}exports[_0x62b4('0x12')]=function(_0x14bd19,_0x36a76a,_0x2b87d2,_0xf7be73){return new BPromise(function(_0x1a274d,_0x5e73e2){_0xf7be73=combineOptions(_0xf7be73);var _0x1fa407=new Buffer(_0x2b87d2);var _0x539c3e=fs[_0x62b4('0x13')](_0x14bd19);var _0x30ab40=fs[_0x62b4('0x14')](_0x36a76a);var _0x114db8=crypto['createCipher'](_0xf7be73['algorithm'],_0x1fa407);_0x539c3e['on'](_0x62b4('0x15'),function(_0x4f52c4){var _0xbfaced=new Buffer(_0x114db8[_0x62b4('0x16')](_0x4f52c4),_0x62b4('0x17'));_0x30ab40['write'](_0xbfaced);});_0x539c3e['on']('end',function(){try{var _0x3a211e=new Buffer(_0x114db8['final'](_0x62b4('0x17')),_0x62b4('0x17'));_0x30ab40[_0x62b4('0x18')](_0x3a211e);_0x30ab40[_0x62b4('0x19')]();_0x30ab40['on'](_0x62b4('0x1a'),function(){return _0x1a274d(_0x36a76a);});}catch(_0x56b017){fs[_0x62b4('0x1b')](_0x36a76a);return _0x5e73e2(_0x56b017);}});});};exports[_0x62b4('0x1c')]=function(_0x17d395,_0x13382b,_0x4631b7,_0x2d79f6){return new BPromise(function(_0x3904d3,_0x297f0a){_0x2d79f6=combineOptions(_0x2d79f6);var _0x4f46ff=new Buffer(_0x4631b7);var _0x1bb40f=fs[_0x62b4('0x13')](_0x17d395);var _0xa69623=fs['createWriteStream'](_0x13382b);var _0x819aca=crypto[_0x62b4('0x1d')](_0x2d79f6[_0x62b4('0x9')],_0x4f46ff);_0x1bb40f['on'](_0x62b4('0x15'),function(_0x26e99d){var _0x1c6f23=new Buffer(_0x819aca[_0x62b4('0x16')](_0x26e99d),_0x62b4('0x17'));_0xa69623[_0x62b4('0x18')](_0x1c6f23);});_0x1bb40f['on'](_0x62b4('0x19'),function(){try{var _0x22b98b=new Buffer(_0x819aca['final'](_0x62b4('0x17')),_0x62b4('0x17'));_0xa69623[_0x62b4('0x18')](_0x22b98b);_0xa69623[_0x62b4('0x19')]();_0xa69623['on'](_0x62b4('0x1a'),function(){return _0x3904d3(_0x13382b);});}catch(_0xc773c1){fs['unlink'](_0x13382b);return _0x297f0a(_0xc773c1);}});});};exports[_0x62b4('0x1e')]=function(_0x46e9b3,_0x4e3deb,_0x107947){var _0x1c4972=_0x107947||stringOptions[_0x62b4('0x9')];var _0x42976f=_0x4e3deb||stringOptions['secret'];var _0x51271a=crypto[_0x62b4('0x1f')](_0x1c4972,_0x42976f);var _0x5c8ba1=_0x51271a[_0x62b4('0x16')](_0x46e9b3,_0x62b4('0x20'),_0x62b4('0x21'));_0x5c8ba1+=_0x51271a[_0x62b4('0x22')]('base64');return _0x5c8ba1;};exports[_0x62b4('0x23')]=function(_0x4a8f50,_0xec44b0,_0x633a84){var _0x3e8e4e=_0x633a84||stringOptions[_0x62b4('0x9')];var _0x59ecc5=_0xec44b0||stringOptions[_0x62b4('0x24')];var _0x4a6268=crypto['createDecipher'](_0x3e8e4e,_0x59ecc5);var _0x17ff6f=_0x4a6268[_0x62b4('0x16')](_0x4a8f50,_0x62b4('0x21'),_0x62b4('0x20'));_0x17ff6f+=_0x4a6268['final'](_0x62b4('0x20'));return _0x17ff6f;}; \ No newline at end of file +var _0x8ae9=['unlink','secret','utf8','base64','crypto','bluebird','lodash','../../config/environment','../../config/logger','app','secrets','session','aes192','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','indexOf','hasOwnProperty','encryptFile','createReadStream','createWriteStream','data','update','binary','write','end','final','close','decryptFile','createDecipher'];(function(_0x2fc012,_0x503e5b){var _0x2891f9=function(_0x295f5e){while(--_0x295f5e){_0x2fc012['push'](_0x2fc012['shift']());}};_0x2891f9(++_0x503e5b);}(_0x8ae9,0xf9));var _0x98ae=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8ae9[_0x3dd15e];return _0x231fd0;};'use strict';var crypto=require(_0x98ae('0x0'));var fs=require('fs');var BPromise=require(_0x98ae('0x1'));var _=require(_0x98ae('0x2'));var config=require(_0x98ae('0x3'));var logger=require(_0x98ae('0x4'))(_0x98ae('0x5'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x98ae('0x6')][_0x98ae('0x7')],'algorithm':'aes-256-ctr'};const fileOptions={'algorithm':_0x98ae('0x8')};if(config[_0x98ae('0x9')]&&config[_0x98ae('0x9')]['algorithm']){var isSupported=isAlgorithmSupported(config[_0x98ae('0x9')][_0x98ae('0xa')]);if(isSupported){fileOptions[_0x98ae('0xa')]=config[_0x98ae('0x9')][_0x98ae('0xa')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x98ae('0xb')](',\x20');logger[_0x98ae('0xc')](config[_0x98ae('0x9')][_0x98ae('0xa')],_0x98ae('0xd'),supportedAlgorithms);}}function isASupportedCipher(_0x35cad2){return AES_SUPPORTED_RX[_0x98ae('0xe')](_0x35cad2);}function getSupportedCiphers(){return crypto[_0x98ae('0xf')]()[_0x98ae('0x10')](isASupportedCipher);}function isAlgorithmSupported(_0xef8cf3){return getSupportedCiphers()[_0x98ae('0x11')](_0xef8cf3)>-0x1;}function combineOptions(_0xce633d){var _0xee8fe8={};for(var _0x5c7d54 in fileOptions){if(fileOptions['hasOwnProperty'](_0x5c7d54)){_0xee8fe8[_0x5c7d54]=fileOptions[_0x5c7d54];}}if(_0xce633d){for(var _0x293955 in _0xce633d){if(_0xce633d[_0x98ae('0x12')](_0x293955)){_0xee8fe8[_0x293955]=_0xce633d[_0x293955];}}}return _0xee8fe8;}exports[_0x98ae('0x13')]=function(_0x3008f8,_0x4bf97d,_0x1a5e1a,_0x36d658){return new BPromise(function(_0x48aac6,_0x9bc6ed){_0x36d658=combineOptions(_0x36d658);var _0x2a1370=new Buffer(_0x1a5e1a);var _0x1ce9f4=fs[_0x98ae('0x14')](_0x3008f8);var _0x2cd9d3=fs[_0x98ae('0x15')](_0x4bf97d);var _0x2f94fc=crypto['createCipher'](_0x36d658[_0x98ae('0xa')],_0x2a1370);_0x1ce9f4['on'](_0x98ae('0x16'),function(_0x4454e4){var _0x424910=new Buffer(_0x2f94fc[_0x98ae('0x17')](_0x4454e4),_0x98ae('0x18'));_0x2cd9d3[_0x98ae('0x19')](_0x424910);});_0x1ce9f4['on'](_0x98ae('0x1a'),function(){try{var _0x3fd20e=new Buffer(_0x2f94fc[_0x98ae('0x1b')](_0x98ae('0x18')),_0x98ae('0x18'));_0x2cd9d3[_0x98ae('0x19')](_0x3fd20e);_0x2cd9d3[_0x98ae('0x1a')]();_0x2cd9d3['on'](_0x98ae('0x1c'),function(){return _0x48aac6(_0x4bf97d);});}catch(_0x28ffbc){fs['unlink'](_0x4bf97d);return _0x9bc6ed(_0x28ffbc);}});});};exports[_0x98ae('0x1d')]=function(_0x1d1495,_0x44acec,_0x513ecc,_0x2c7278){return new BPromise(function(_0x248956,_0x76edb1){_0x2c7278=combineOptions(_0x2c7278);var _0x368073=new Buffer(_0x513ecc);var _0x406243=fs[_0x98ae('0x14')](_0x1d1495);var _0x2c7426=fs[_0x98ae('0x15')](_0x44acec);var _0xeec571=crypto[_0x98ae('0x1e')](_0x2c7278[_0x98ae('0xa')],_0x368073);_0x406243['on'](_0x98ae('0x16'),function(_0x3f0119){var _0x50fc6d=new Buffer(_0xeec571['update'](_0x3f0119),_0x98ae('0x18'));_0x2c7426[_0x98ae('0x19')](_0x50fc6d);});_0x406243['on'](_0x98ae('0x1a'),function(){try{var _0xf76f75=new Buffer(_0xeec571['final'](_0x98ae('0x18')),_0x98ae('0x18'));_0x2c7426[_0x98ae('0x19')](_0xf76f75);_0x2c7426['end']();_0x2c7426['on'](_0x98ae('0x1c'),function(){return _0x248956(_0x44acec);});}catch(_0x3c7b6f){fs[_0x98ae('0x1f')](_0x44acec);return _0x76edb1(_0x3c7b6f);}});});};exports['encryptString']=function(_0x3c646c,_0x5c3583,_0x533c15){var _0x5b4e7e=_0x533c15||stringOptions[_0x98ae('0xa')];var _0x411b15=_0x5c3583||stringOptions[_0x98ae('0x20')];var _0x427b6b=crypto['createCipher'](_0x5b4e7e,_0x411b15);var _0x3b2d71=_0x427b6b[_0x98ae('0x17')](_0x3c646c,_0x98ae('0x21'),'base64');_0x3b2d71+=_0x427b6b[_0x98ae('0x1b')](_0x98ae('0x22'));return _0x3b2d71;};exports['decryptString']=function(_0x154d13,_0x11d7c1,_0x4f8579){var _0x42683b=_0x4f8579||stringOptions[_0x98ae('0xa')];var _0x221302=_0x11d7c1||stringOptions[_0x98ae('0x20')];var _0x18227e=crypto['createDecipher'](_0x42683b,_0x221302);var _0xad2e45=_0x18227e[_0x98ae('0x17')](_0x154d13,_0x98ae('0x22'),_0x98ae('0x21'));_0xad2e45+=_0x18227e[_0x98ae('0x1b')](_0x98ae('0x21'));return _0xad2e45;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 6832f77..0413e08 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 _0x1121=['Failed','finally','util','path','lodash','to-csv','bluebird','rimraf','../../mysqldb','../../config/logger','analytics','argv','savename','update','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','num','Empty','length','range','isInteger','forEach','push','QueryTypes','SELECT','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','existsSync','join','mkdirSync','%s%d.%s','csv','%s.%s','zip','zip\x20finished','info','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format'];(function(_0x3f3daa,_0x35ac72){var _0x3ae81d=function(_0xb8bb6f){while(--_0xb8bb6f){_0x3f3daa['push'](_0x3f3daa['shift']());}};_0x3ae81d(++_0x35ac72);}(_0x1121,0x116));var _0x1112=function(_0x70493e,_0x37fd86){_0x70493e=_0x70493e-0x0;var _0x356182=_0x1121[_0x70493e];return _0x356182;};'use strict';var util=require(_0x1112('0x0'));var path=require(_0x1112('0x1'));var _=require(_0x1112('0x2'));var csv=require(_0x1112('0x3'));var fs=require('fs');var BPromise=require(_0x1112('0x4'));var zipdir=require('zip-dir');var rimraf=require(_0x1112('0x5'));var db=require(_0x1112('0x6'))['db'];var dbH=require(_0x1112('0x6'))['dbH'];var logger=require(_0x1112('0x7'))(_0x1112('0x8'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x1112('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x4478cc,_0x56bdf4){var _0x3b7e4b={'status':_0x4478cc};var _0x2da575={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x56bdf4){_0x3b7e4b[_0x1112('0xa')]=_0x56bdf4;}return db['AnalyticExtractedReport'][_0x1112('0xb')](_0x3b7e4b,_0x2da575);}function main(){var _0x4fa544=0x1388;var _0x198123;logger['info'](util[_0x1112('0xc')](_0x1112('0xd'),EXTRACTED_REPORT_ID,_0x1112('0xe')));return db['Setting'][_0x1112('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x1112('0x10'),_0x1112('0x11')]})[_0x1112('0x12')](function(_0x576e66){if(_0x576e66){_0x198123=_0x576e66;_0x4fa544=_0x198123[_0x1112('0x11')]||0x1388;}})['then'](function(){return dbH[_0x1112('0x13')][_0x1112('0x14')](util[_0x1112('0xc')](_0x1112('0x15'),QUERY),{'type':dbH['sequelize']['QueryTypes']['SELECT']});})[_0x1112('0x12')](function(_0x1fcb35){if(!_0x1fcb35[0x0][_0x1112('0x16')]){return analyticExtractedReport(_0x1112('0x17'));}var _0x3a426a=[];var _0x79b23f=0x0;if(_0x198123[_0x1112('0x10')]){if(_0x1fcb35&&_0x1fcb35[_0x1112('0x18')]){var _0x349be6=_[_0x1112('0x19')](_0x1fcb35[0x0][_0x1112('0x16')]/_0x4fa544);var _0x1df03d=Number[_0x1112('0x1a')](_0x1fcb35[0x0][_0x1112('0x16')]/_0x4fa544)?_0x1fcb35[0x0][_0x1112('0x16')]%_0x4fa544:0x0;_0x349be6[_0x1112('0x1b')](function(_0x38506e){if(_0x38506e>0x0){_0x79b23f+=_0x4fa544;}_0x3a426a[_0x1112('0x1c')](dbH[_0x1112('0x13')][_0x1112('0x14')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x4fa544,_0x79b23f),{'type':dbH[_0x1112('0x13')][_0x1112('0x1d')][_0x1112('0x1e')]}));});if(_0x1df03d>0x0){_0x79b23f+=_0x4fa544;_0x3a426a[_0x1112('0x1c')](dbH['sequelize'][_0x1112('0x14')](util[_0x1112('0xc')](_0x1112('0x1f'),QUERY,_0x1df03d,_0x79b23f),{'type':dbH[_0x1112('0x13')][_0x1112('0x1d')]['SELECT']}));}}}else{_0x3a426a[_0x1112('0x1c')](dbH[_0x1112('0x13')][_0x1112('0x14')](QUERY,{'type':dbH[_0x1112('0x13')][_0x1112('0x1d')][_0x1112('0x1e')]}));}var _0x37886e=path[_0x1112('0x20')](PATH);var _0x289cbe=path[_0x1112('0x21')](PATH,'.csv');var _0x1e7a06=_0x198123['split']&&_0x3a426a[_0x1112('0x18')]>0x1;var _0x391f57=[];if(!fs[_0x1112('0x22')](path[_0x1112('0x23')](_0x37886e,_0x289cbe))&&_0x1e7a06){fs[_0x1112('0x24')](path[_0x1112('0x23')](_0x37886e,_0x289cbe));}return BPromise['each'](_0x3a426a,function(_0x105ef9){_0x391f57['push'](_0x105ef9);})[_0x1112('0x12')](function(){for(var _0x4f6b6a=0x0;_0x4f6b6a<_0x391f57['length'];_0x4f6b6a+=0x1){var _0x1dfda7;var _0x3801f3=_0x391f57[_0x4f6b6a];if(_0x1e7a06){_0x1dfda7=path[_0x1112('0x23')](_0x37886e,_0x289cbe,util['format'](_0x1112('0x25'),_0x289cbe,_0x4f6b6a,_0x1112('0x26')));}else{_0x1dfda7=path['join'](_0x37886e,util[_0x1112('0xc')](_0x1112('0x27'),_0x289cbe,_0x1112('0x26')));}fs['writeFileSync'](_0x1dfda7,csv(_0x3801f3));}})[_0x1112('0x12')](function(){if(_0x1e7a06){return new Promise(function(_0x38b5fe){zipdir(path[_0x1112('0x23')](_0x37886e,_0x289cbe),{'saveTo':path['join'](_0x37886e,util[_0x1112('0xc')](_0x1112('0x27'),_0x289cbe,_0x1112('0x28')))},function(_0x18b113,_0x30881a){rimraf(path['join'](_0x37886e,_0x289cbe),function(){});_0x38b5fe(_0x1112('0x29'));});});}})[_0x1112('0x12')](function(){logger['info'](util['format']('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport('Completed',_0x1e7a06?util[_0x1112('0xc')](_0x1112('0x27'),_0x289cbe,_0x1e7a06?_0x1112('0x28'):_0x1112('0x26')):null);});})['catch'](function(_0x3490e6){logger[_0x1112('0x2a')](util['format'](_0x1112('0x2b'),EXTRACTED_REPORT_ID,_0x1112('0xe')),util['inspect'](_0x3490e6,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x1112('0x2c'));})[_0x1112('0x2d')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file +var _0x2351=['find','split','splitSizeCsv','then','sequelize','query','QueryTypes','SELECT','num','Empty','length','range','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','.csv','existsSync','join','mkdirSync','each','csv','writeFileSync','%s.%s','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','exit','util','path','lodash','to-csv','bluebird','zip-dir','rimraf','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting'];(function(_0x3c487b,_0x44c5e2){var _0x1d65f6=function(_0x135e6d){while(--_0x135e6d){_0x3c487b['push'](_0x3c487b['shift']());}};_0x1d65f6(++_0x44c5e2);}(_0x2351,0xed));var _0x1235=function(_0x1cc85f,_0x540c9c){_0x1cc85f=_0x1cc85f-0x0;var _0x3f0a49=_0x2351[_0x1cc85f];return _0x3f0a49;};'use strict';var util=require(_0x1235('0x0'));var path=require(_0x1235('0x1'));var _=require(_0x1235('0x2'));var csv=require(_0x1235('0x3'));var fs=require('fs');var BPromise=require(_0x1235('0x4'));var zipdir=require(_0x1235('0x5'));var rimraf=require(_0x1235('0x6'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0x1235('0x7')];var logger=require(_0x1235('0x8'))(_0x1235('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0x1235('0xa')][0x2]);var QUERY=process[_0x1235('0xa')][0x3];var PATH=process[_0x1235('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x33518b,_0x46f262){var _0x182bd={'status':_0x33518b};var _0x3c4a9a={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x46f262){_0x182bd[_0x1235('0xb')]=_0x46f262;}return db[_0x1235('0xc')][_0x1235('0xd')](_0x182bd,_0x3c4a9a);}function main(){var _0x452af3=0x1388;var _0x3186ce;logger['info'](util[_0x1235('0xe')](_0x1235('0xf'),EXTRACTED_REPORT_ID,_0x1235('0x10')));return db[_0x1235('0x11')][_0x1235('0x12')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x1235('0x13'),_0x1235('0x14')]})[_0x1235('0x15')](function(_0x590a8c){if(_0x590a8c){_0x3186ce=_0x590a8c;_0x452af3=_0x3186ce[_0x1235('0x14')]||0x1388;}})[_0x1235('0x15')](function(){return dbH[_0x1235('0x16')][_0x1235('0x17')](util[_0x1235('0xe')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x1235('0x16')][_0x1235('0x18')][_0x1235('0x19')]});})[_0x1235('0x15')](function(_0x36659a){if(!_0x36659a[0x0][_0x1235('0x1a')]){return analyticExtractedReport(_0x1235('0x1b'));}var _0x11e197=[];var _0x27c1b9=0x0;if(_0x3186ce[_0x1235('0x13')]){if(_0x36659a&&_0x36659a[_0x1235('0x1c')]){var _0x1e8bc9=_[_0x1235('0x1d')](_0x36659a[0x0][_0x1235('0x1a')]/_0x452af3);var _0x24c48d=Number['isInteger'](_0x36659a[0x0][_0x1235('0x1a')]/_0x452af3)?_0x36659a[0x0][_0x1235('0x1a')]%_0x452af3:0x0;_0x1e8bc9[_0x1235('0x1e')](function(_0x3374b0){if(_0x3374b0>0x0){_0x27c1b9+=_0x452af3;}_0x11e197[_0x1235('0x1f')](dbH[_0x1235('0x16')][_0x1235('0x17')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x452af3,_0x27c1b9),{'type':dbH['sequelize'][_0x1235('0x18')][_0x1235('0x19')]}));});if(_0x24c48d>0x0){_0x27c1b9+=_0x452af3;_0x11e197[_0x1235('0x1f')](dbH[_0x1235('0x16')][_0x1235('0x17')](util[_0x1235('0xe')](_0x1235('0x20'),QUERY,_0x24c48d,_0x27c1b9),{'type':dbH[_0x1235('0x16')]['QueryTypes']['SELECT']}));}}}else{_0x11e197[_0x1235('0x1f')](dbH[_0x1235('0x16')][_0x1235('0x17')](QUERY,{'type':dbH[_0x1235('0x16')][_0x1235('0x18')][_0x1235('0x19')]}));}var _0x270faf=path[_0x1235('0x21')](PATH);var _0x4bbb2f=path['basename'](PATH,_0x1235('0x22'));var _0x15b1fc=_0x3186ce['split']&&_0x11e197['length']>0x1;var _0x3198d4=[];if(!fs[_0x1235('0x23')](path[_0x1235('0x24')](_0x270faf,_0x4bbb2f))&&_0x15b1fc){fs[_0x1235('0x25')](path[_0x1235('0x24')](_0x270faf,_0x4bbb2f));}return BPromise[_0x1235('0x26')](_0x11e197,function(_0x526aa6){_0x3198d4[_0x1235('0x1f')](_0x526aa6);})[_0x1235('0x15')](function(){for(var _0x321d5f=0x0;_0x321d5f<_0x3198d4[_0x1235('0x1c')];_0x321d5f+=0x1){var _0x73912d;var _0x5004d1=_0x3198d4[_0x321d5f];if(_0x15b1fc){_0x73912d=path[_0x1235('0x24')](_0x270faf,_0x4bbb2f,util['format']('%s%d.%s',_0x4bbb2f,_0x321d5f,_0x1235('0x27')));}else{_0x73912d=path[_0x1235('0x24')](_0x270faf,util[_0x1235('0xe')]('%s.%s',_0x4bbb2f,_0x1235('0x27')));}fs[_0x1235('0x28')](_0x73912d,csv(_0x5004d1));}})[_0x1235('0x15')](function(){if(_0x15b1fc){return new Promise(function(_0x2e539b){zipdir(path[_0x1235('0x24')](_0x270faf,_0x4bbb2f),{'saveTo':path[_0x1235('0x24')](_0x270faf,util['format'](_0x1235('0x29'),_0x4bbb2f,_0x1235('0x2a')))},function(_0xd78021,_0xcc0b45){rimraf(path[_0x1235('0x24')](_0x270faf,_0x4bbb2f),function(){});_0x2e539b(_0x1235('0x2b'));});});}})[_0x1235('0x15')](function(){logger[_0x1235('0x2c')](util[_0x1235('0xe')](_0x1235('0x2d'),EXTRACTED_REPORT_ID,_0x1235('0x10')));return analyticExtractedReport('Completed',_0x15b1fc?util[_0x1235('0xe')]('%s.%s',_0x4bbb2f,_0x15b1fc?_0x1235('0x2a'):_0x1235('0x27')):null);});})[_0x1235('0x2e')](function(_0x471d1a){logger[_0x1235('0x2c')](util[_0x1235('0xe')](_0x1235('0x2f'),EXTRACTED_REPORT_ID,_0x1235('0x10')),util['inspect'](_0x471d1a,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x1235('0x30'));})[_0x1235('0x31')](function(){process[_0x1235('0x32')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index ccbe021..32ae9b0 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 _0xc4fe=['keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','length','header','pageBreak','margin','landscape','\x20/\x20','footer','Arial','black','Empty','Setting','find','split','splitSizePdf','then','num','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','.pdf','join','mkdirSync','flatten','createPdfKitDocument','%s%d.%s','pdf','%s.%s','all','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','zip','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-bold-italic.ttf','channel','interactionId','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','error','end','createPdfFromHTML','path','catch','lodash','util','moment','pdfmake/src/printer','zip-dir','rimraf','JSDOM','bluebird','../../mysqldb','dbH','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','tableHeader','map','toString','value','auto','push','body','chunk'];(function(_0x18db7b,_0xf8828c){var _0x1d5d9b=function(_0x2bd697){while(--_0x2bd697){_0x18db7b['push'](_0x18db7b['shift']());}};_0x1d5d9b(++_0xf8828c);}(_0xc4fe,0x140));var _0xec4f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc4fe[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xec4f('0x0'));var fs=require('fs');var util=require(_0xec4f('0x1'));var path=require('path');var moment=require(_0xec4f('0x2'));var htmlToPdfmake=require('html-to-pdfmake');var PdfPrinter=require(_0xec4f('0x3'));var zipdir=require(_0xec4f('0x4'));var rimraf=require(_0xec4f('0x5'));var JSDOM=require('jsdom')[_0xec4f('0x6')];var window=new JSDOM('')['window'];var BPromise=require(_0xec4f('0x7'));var db=require('../../mysqldb')['db'];var dbH=require(_0xec4f('0x8'))[_0xec4f('0x9')];var logger=require('../../config/logger')(_0xec4f('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0xec4f('0xb')][0x2]);var QUERY=process[_0xec4f('0xb')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0xec4f('0xb')][0x5];var FORMAT=_0xec4f('0xc');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x7457dc,_0x5324f8){var _0x33fb78={'status':_0x7457dc};var _0x51c30e={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5324f8){_0x33fb78[_0xec4f('0xd')]=_0x5324f8;}return db[_0xec4f('0xe')][_0xec4f('0xf')](_0x33fb78,_0x51c30e);}function getHeaders(_0x5cda74){return _['map'](_0x5cda74,function(_0x4a0fe8){return{'text':_0x4a0fe8,'style':_0xec4f('0x10')};});}function getRows(_0x1ca7a1,_0x5b992a){return _[_0xec4f('0x11')](_0x5b992a,function(_0xc74a01){return _(_0xc74a01)['pick'](_0x1ca7a1)['map'](function(_0x335fa0){return _0x335fa0?_[_0xec4f('0x12')](_0x335fa0):'';})[_0xec4f('0x13')]();});}function createTable(_0x24e2d1,_0x3f60b4){var _0x2016e6={'widths':_['fill'](Array(_0x24e2d1['length']),0x91),'heights':function(_0x352bf6){return _0x352bf6===0x0?_0xec4f('0x14'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x43d9e2=getHeaders(_0x24e2d1);_0x2016e6['body'][_0xec4f('0x15')](_0x43d9e2);var _0x4b5c28=getRows(_0x24e2d1,_0x3f60b4);_0x2016e6['body']=_0x2016e6[_0xec4f('0x16')]['concat'](_0x4b5c28);return _0x2016e6;}function createTables(_0x3282dc){var _0x587fbf=[];var _0x1a06cd=_[_0xec4f('0x17')](Object[_0xec4f('0x18')](_0x3282dc[0x0]),0x5);_0x1a06cd[_0xec4f('0x19')](function(_0x3701d5){_0x587fbf[_0xec4f('0x15')](createTable(_0x3701d5,_0x3282dc));});return _0x587fbf;}function getPDFDocDefinition(_0x2bd276){var _0x3fbf2c=util[_0xec4f('0x1a')](_0xec4f('0x1b'),NAME,EXTRACTED_REPORT[_0xec4f('0x1c')],moment(EXTRACTED_REPORT['startDate'])['format'](FORMAT),moment(EXTRACTED_REPORT['endDate'])[_0xec4f('0x1a')](FORMAT));var _0x364631=[];for(var _0x3b1287=0x0;_0x3b1287<_0x2bd276[_0xec4f('0x1d')];_0x3b1287++){var _0xdfe174=[];if(_0x3b1287===0x0){_0xdfe174['push']({'text':_0x3fbf2c,'style':_0xec4f('0x1e')});}var _0x67a9f9={'table':_0x2bd276[_0x3b1287]};if(_0x3b1287>0x0){_0x67a9f9[_0xec4f('0x1f')]='before';_0x67a9f9[_0xec4f('0x20')]=[0x0,0x46,0x0,0x0];}_0xdfe174['push'](_0x67a9f9);_0x364631[_0xec4f('0x15')](_0xdfe174);}return{'pageSize':'A4','pageOrientation':_0xec4f('0x21'),'content':_0x364631,'footer':function(_0x63b789,_0x46b38c){return{'text':_0x63b789[_0xec4f('0x12')]()+_0xec4f('0x22')+_0x46b38c,'style':_0xec4f('0x23')};},'defaultStyle':{'font':_0xec4f('0x24')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xec4f('0x25')},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x446775){var _0x597192=0x1388;var _0x460655;if(!_0x446775[0x0]['num']){return analyticExtractedReport(_0xec4f('0x26'));}return db[_0xec4f('0x27')][_0xec4f('0x28')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xec4f('0x29'),_0xec4f('0x2a')]})['then'](function(_0x302ee6){if(_0x302ee6){_0x460655=_0x302ee6;_0x597192=_0x460655[_0xec4f('0x2a')]||0x3e8;}})[_0xec4f('0x2b')](function(){var _0x22123a=[];var _0xad2dca=0x0;if(_0x460655[_0xec4f('0x29')]){if(_0x446775&&_0x446775[_0xec4f('0x1d')]){var _0x3a491c=_['range'](_0x446775[0x0][_0xec4f('0x2c')]/_0x597192);var _0x2d9fc8=Number['isInteger'](_0x446775[0x0][_0xec4f('0x2c')]/_0x597192)?_0x446775[0x0][_0xec4f('0x2c')]%_0x597192:0x0;_0x3a491c[_0xec4f('0x19')](function(_0x45c923){if(_0x45c923>0x0){_0xad2dca+=_0x597192;}_0x22123a['push'](dbH[_0xec4f('0x2d')][_0xec4f('0x2e')](util[_0xec4f('0x1a')](_0xec4f('0x2f'),QUERY,_0x597192,_0xad2dca),{'type':dbH[_0xec4f('0x2d')][_0xec4f('0x30')][_0xec4f('0x31')]}));});if(_0x2d9fc8>0x0){_0xad2dca+=_0x597192;_0x22123a['push'](dbH['sequelize'][_0xec4f('0x2e')](util[_0xec4f('0x1a')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x2d9fc8,_0xad2dca),{'type':dbH[_0xec4f('0x2d')][_0xec4f('0x30')][_0xec4f('0x31')]}));}}}else{_0x22123a[_0xec4f('0x15')](dbH[_0xec4f('0x2d')]['query'](QUERY,{'type':dbH[_0xec4f('0x2d')][_0xec4f('0x30')][_0xec4f('0x31')]}));}var _0x21e7ef=path['dirname'](PATH);var _0x76d3bb=path['basename'](PATH,_0xec4f('0x32'));var _0x5f518a=_0x460655['split']&&_0x22123a[_0xec4f('0x1d')]>0x1;var _0x3a923f=[];if(!fs['existsSync'](path[_0xec4f('0x33')](_0x21e7ef,_0x76d3bb))&&_0x5f518a){fs[_0xec4f('0x34')](path[_0xec4f('0x33')](_0x21e7ef,_0x76d3bb));}return BPromise['each'](_0x22123a,function(_0x4b366b){_0x3a923f['push'](_0x4b366b);})[_0xec4f('0x2b')](function(){var _0x4af5ce=[];for(var _0x33dad4=0x0;_0x33dad4<_0x3a923f[_0xec4f('0x1d')];_0x33dad4+=0x1){var _0xe7e94e=_0x3a923f[_0x33dad4];var _0x39f8ef=createTables(_[_0xec4f('0x35')](_0xe7e94e));var _0x5e4f4e;var _0x3b3c04=getPDFDocDefinition(_0x39f8ef);var _0x273b6f=getPDFPrinter();var _0x5af2e2=_0x273b6f[_0xec4f('0x36')](_0x3b3c04);if(_0x5f518a){_0x5e4f4e=path[_0xec4f('0x33')](_0x21e7ef,_0x76d3bb,util['format'](_0xec4f('0x37'),_0x76d3bb,_0x33dad4,_0xec4f('0x38')));}else{_0x5e4f4e=path['join'](_0x21e7ef,util[_0xec4f('0x1a')](_0xec4f('0x39'),_0x76d3bb,'pdf'));}_0x4af5ce['push'](writePDFDocument(_0x5af2e2,_0x5e4f4e));}return Promise[_0xec4f('0x3a')](_0x4af5ce);})['then'](function(){if(_0x5f518a){return new Promise(function(_0x14a611){zipdir(path[_0xec4f('0x33')](_0x21e7ef,_0x76d3bb),{'saveTo':path[_0xec4f('0x33')](_0x21e7ef,util['format']('%s.%s',_0x76d3bb,'zip'))},function(){rimraf(path[_0xec4f('0x33')](_0x21e7ef,_0x76d3bb),function(){});_0x14a611(_0xec4f('0x3b'));});});}})[_0xec4f('0x2b')](function(){if(!_0x5f518a)return;rimraf(path[_0xec4f('0x33')](_0x21e7ef,_0x76d3bb),function(){});})[_0xec4f('0x2b')](function(){logger[_0xec4f('0x3c')](util[_0xec4f('0x1a')](_0xec4f('0x3d'),EXTRACTED_REPORT_ID,_0xec4f('0x3e')));return analyticExtractedReport(_0xec4f('0x3f'),_0x5f518a?util[_0xec4f('0x1a')]('%s.%s',_0x76d3bb,_0x5f518a?_0xec4f('0x40'):_0xec4f('0x38')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger['info'](util['format'](_0xec4f('0x41'),EXTRACTED_REPORT_ID,_0xec4f('0x3e')));return db[_0xec4f('0xe')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})[_0xec4f('0x2b')](function(_0x203cef){EXTRACTED_REPORT=_0x203cef;return dbH['sequelize']['query'](util['format'](_0xec4f('0x42'),QUERY),{'type':dbH[_0xec4f('0x2d')][_0xec4f('0x30')][_0xec4f('0x31')]});})[_0xec4f('0x2b')](extractReport)['catch'](function(_0x4f1f12){logger[_0xec4f('0x3c')](util['format'](_0xec4f('0x43'),EXTRACTED_REPORT_ID,_0xec4f('0x3e')),util[_0xec4f('0x44')](_0x4f1f12,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})['finally'](function(){process[_0xec4f('0x45')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x23e3e7=new PdfPrinter({'Arial':{'normal':__dirname+_0xec4f('0x46'),'bold':__dirname+_0xec4f('0x47'),'italics':__dirname+'/fonts/arial-italic.ttf','bolditalics':__dirname+_0xec4f('0x48')}});return _0x23e3e7;}function getPDFDocDefinitionFromHTML(_0x5caf87,_0x2f466b){var _0x21f319=util[_0xec4f('0x1a')]('%s\x20#%d',_0x2f466b[_0xec4f('0x49')],_0x2f466b[_0xec4f('0x4a')]);var _0x42ab20=moment()['format']('YYYY-MM-DD')[_0xec4f('0x12')]();var _0x1a9e33=htmlToPdfmake(_0x5caf87,{'window':window,'tableAutoSize':!![]});return{'content':[_0x1a9e33],'defaultStyle':{'font':_0xec4f('0x24')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xec4f('0x4b'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xec4f('0x4b'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xec4f('0x4b')}},'header':function(){return[{'text':_0xec4f('0x4c'),'style':'header'}];},'footer':function(_0x4e16ba,_0x4053d2){return[{'text':util[_0xec4f('0x1a')](_0xec4f('0x4d'),_0x21f319,_0x4e16ba,_0x4053d2,_0x42ab20),'style':_0xec4f('0x23')}];}};}function writePDFDocument(_0x2a708d,_0x5458eb){return new Promise(function(_0x5af838,_0x1a3c15){var _0x592af7=_0x2a708d[_0xec4f('0x4e')](fs[_0xec4f('0x4f')](_0x5458eb));_0x592af7['on']('finish',function(){_0x5af838(_0xec4f('0x50'));});_0x592af7['on'](_0xec4f('0x51'),function(_0x1a0fd2){_0x1a3c15(_0x1a0fd2);});_0x2a708d[_0xec4f('0x52')]();});}exports[_0xec4f('0x53')]=function(_0x36f257,_0x3235d2){var _0x208f3a=getPDFPrinter();var _0x30065e=getPDFDocDefinitionFromHTML(_0x36f257,_0x3235d2);var _0x1960e1=_0x208f3a[_0xec4f('0x36')](_0x30065e);return writePDFDocument(_0x1960e1,_0x3235d2[_0xec4f('0x54')])[_0xec4f('0x55')](function(_0x8224f5){throw _0x8224f5;});}; \ No newline at end of file +var _0xbbc6=['footer','black','right','Empty','Setting','find','then','splitSizePdf','range','num','isInteger','forEach','sequelize','query','QueryTypes','SELECT','.pdf','split','mkdirSync','join','each','%s%d.%s','pdf','%s.%s','all','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','PDF','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','channel','interactionId','YYYY-MM-DD','Arial','center','createWriteStream','finish','error','end','createPdfFromHTML','createPdfKitDocument','catch','lodash','util','path','moment','html-to-pdfmake','zip-dir','rimraf','jsdom','JSDOM','window','bluebird','../../mysqldb','../../config/logger','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','map','tableHeader','pick','toString','value','fill','length','auto','body','push','chunk','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','format','endDate','pageBreak','before','landscape','\x20/\x20'];(function(_0x100af9,_0x262716){var _0x2b9160=function(_0x2b74c3){while(--_0x2b74c3){_0x100af9['push'](_0x100af9['shift']());}};_0x2b9160(++_0x262716);}(_0xbbc6,0x19c));var _0x6bbc=function(_0x2fbb9d,_0x505f83){_0x2fbb9d=_0x2fbb9d-0x0;var _0x5bf8ee=_0xbbc6[_0x2fbb9d];return _0x5bf8ee;};'use strict';var _=require(_0x6bbc('0x0'));var fs=require('fs');var util=require(_0x6bbc('0x1'));var path=require(_0x6bbc('0x2'));var moment=require(_0x6bbc('0x3'));var htmlToPdfmake=require(_0x6bbc('0x4'));var PdfPrinter=require('pdfmake/src/printer');var zipdir=require(_0x6bbc('0x5'));var rimraf=require(_0x6bbc('0x6'));var JSDOM=require(_0x6bbc('0x7'))[_0x6bbc('0x8')];var window=new JSDOM('')[_0x6bbc('0x9')];var BPromise=require(_0x6bbc('0xa'));var db=require(_0x6bbc('0xb'))['db'];var dbH=require('../../mysqldb')['dbH'];var logger=require(_0x6bbc('0xc'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x6bbc('0xd')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x6bbc('0xd')][0x4];var NAME=process[_0x6bbc('0xd')][0x5];var FORMAT=_0x6bbc('0xe');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x574d5a,_0x4b873a){var _0x1420b8={'status':_0x574d5a};var _0x564b51={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4b873a){_0x1420b8[_0x6bbc('0xf')]=_0x4b873a;}return db[_0x6bbc('0x10')][_0x6bbc('0x11')](_0x1420b8,_0x564b51);}function getHeaders(_0x4ab41e){return _[_0x6bbc('0x12')](_0x4ab41e,function(_0x10c4f6){return{'text':_0x10c4f6,'style':_0x6bbc('0x13')};});}function getRows(_0x23ab12,_0x35e43a){return _[_0x6bbc('0x12')](_0x35e43a,function(_0x1269d0){return _(_0x1269d0)[_0x6bbc('0x14')](_0x23ab12)[_0x6bbc('0x12')](function(_0x2640ff){return _0x2640ff?_[_0x6bbc('0x15')](_0x2640ff):'';})[_0x6bbc('0x16')]();});}function createTable(_0x4f3272,_0x47ecad){var _0x101885={'widths':_[_0x6bbc('0x17')](Array(_0x4f3272[_0x6bbc('0x18')]),0x91),'heights':function(_0x2fde2c){return _0x2fde2c===0x0?_0x6bbc('0x19'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x14334d=getHeaders(_0x4f3272);_0x101885[_0x6bbc('0x1a')][_0x6bbc('0x1b')](_0x14334d);var _0x37eeb9=getRows(_0x4f3272,_0x47ecad);_0x101885[_0x6bbc('0x1a')]=_0x101885[_0x6bbc('0x1a')]['concat'](_0x37eeb9);return _0x101885;}function createTables(_0x58c5dd){var _0x21b183=[];var _0x366680=_[_0x6bbc('0x1c')](Object['keys'](_0x58c5dd[0x0]),0x5);_0x366680['forEach'](function(_0x1624c4){_0x21b183[_0x6bbc('0x1b')](createTable(_0x1624c4,_0x58c5dd));});return _0x21b183;}function getPDFDocDefinition(_0x440211){var _0x1c3231=util['format'](_0x6bbc('0x1d'),NAME,EXTRACTED_REPORT[_0x6bbc('0x1e')],moment(EXTRACTED_REPORT[_0x6bbc('0x1f')])[_0x6bbc('0x20')](FORMAT),moment(EXTRACTED_REPORT[_0x6bbc('0x21')])[_0x6bbc('0x20')](FORMAT));var _0x359dd8=[];for(var _0x128d4b=0x0;_0x128d4b<_0x440211[_0x6bbc('0x18')];_0x128d4b++){var _0x1aaf6d=[];if(_0x128d4b===0x0){_0x1aaf6d[_0x6bbc('0x1b')]({'text':_0x1c3231,'style':'header'});}var _0x24b75f={'table':_0x440211[_0x128d4b]};if(_0x128d4b>0x0){_0x24b75f[_0x6bbc('0x22')]=_0x6bbc('0x23');_0x24b75f['margin']=[0x0,0x46,0x0,0x0];}_0x1aaf6d[_0x6bbc('0x1b')](_0x24b75f);_0x359dd8[_0x6bbc('0x1b')](_0x1aaf6d);}return{'pageSize':'A4','pageOrientation':_0x6bbc('0x24'),'content':_0x359dd8,'footer':function(_0x4c3d55,_0x3fdfc9){return{'text':_0x4c3d55[_0x6bbc('0x15')]()+_0x6bbc('0x25')+_0x3fdfc9,'style':_0x6bbc('0x26')};},'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x6bbc('0x27')},'footer':{'alignment':_0x6bbc('0x28'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x5a793c){var _0x226441=0x1388;var _0x45352c;if(!_0x5a793c[0x0]['num']){return analyticExtractedReport(_0x6bbc('0x29'));}return db[_0x6bbc('0x2a')][_0x6bbc('0x2b')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split','splitSizePdf']})[_0x6bbc('0x2c')](function(_0x3e84df){if(_0x3e84df){_0x45352c=_0x3e84df;_0x226441=_0x45352c[_0x6bbc('0x2d')]||0x3e8;}})['then'](function(){var _0x1ae9d3=[];var _0x28ff13=0x0;if(_0x45352c['split']){if(_0x5a793c&&_0x5a793c[_0x6bbc('0x18')]){var _0x2beae7=_[_0x6bbc('0x2e')](_0x5a793c[0x0][_0x6bbc('0x2f')]/_0x226441);var _0x2f8b81=Number[_0x6bbc('0x30')](_0x5a793c[0x0][_0x6bbc('0x2f')]/_0x226441)?_0x5a793c[0x0]['num']%_0x226441:0x0;_0x2beae7[_0x6bbc('0x31')](function(_0x13b6ab){if(_0x13b6ab>0x0){_0x28ff13+=_0x226441;}_0x1ae9d3[_0x6bbc('0x1b')](dbH[_0x6bbc('0x32')][_0x6bbc('0x33')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x226441,_0x28ff13),{'type':dbH[_0x6bbc('0x32')][_0x6bbc('0x34')][_0x6bbc('0x35')]}));});if(_0x2f8b81>0x0){_0x28ff13+=_0x226441;_0x1ae9d3['push'](dbH[_0x6bbc('0x32')][_0x6bbc('0x33')](util[_0x6bbc('0x20')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x2f8b81,_0x28ff13),{'type':dbH[_0x6bbc('0x32')][_0x6bbc('0x34')][_0x6bbc('0x35')]}));}}}else{_0x1ae9d3[_0x6bbc('0x1b')](dbH[_0x6bbc('0x32')][_0x6bbc('0x33')](QUERY,{'type':dbH[_0x6bbc('0x32')][_0x6bbc('0x34')][_0x6bbc('0x35')]}));}var _0x5c24b4=path['dirname'](PATH);var _0x2310c9=path['basename'](PATH,_0x6bbc('0x36'));var _0x61f9c1=_0x45352c[_0x6bbc('0x37')]&&_0x1ae9d3['length']>0x1;var _0x374c93=[];if(!fs['existsSync'](path['join'](_0x5c24b4,_0x2310c9))&&_0x61f9c1){fs[_0x6bbc('0x38')](path[_0x6bbc('0x39')](_0x5c24b4,_0x2310c9));}return BPromise[_0x6bbc('0x3a')](_0x1ae9d3,function(_0x129f22){_0x374c93['push'](_0x129f22);})[_0x6bbc('0x2c')](function(){var _0xf674f9=[];for(var _0x447225=0x0;_0x447225<_0x374c93[_0x6bbc('0x18')];_0x447225+=0x1){var _0x1ae82f=_0x374c93[_0x447225];var _0x49875b=createTables(_['flatten'](_0x1ae82f));var _0x3e9057;var _0x503868=getPDFDocDefinition(_0x49875b);var _0x17dd2f=getPDFPrinter();var _0x543643=_0x17dd2f['createPdfKitDocument'](_0x503868);if(_0x61f9c1){_0x3e9057=path[_0x6bbc('0x39')](_0x5c24b4,_0x2310c9,util[_0x6bbc('0x20')](_0x6bbc('0x3b'),_0x2310c9,_0x447225,_0x6bbc('0x3c')));}else{_0x3e9057=path['join'](_0x5c24b4,util[_0x6bbc('0x20')](_0x6bbc('0x3d'),_0x2310c9,_0x6bbc('0x3c')));}_0xf674f9[_0x6bbc('0x1b')](writePDFDocument(_0x543643,_0x3e9057));}return Promise[_0x6bbc('0x3e')](_0xf674f9);})['then'](function(){if(_0x61f9c1){return new Promise(function(_0x20aec7){zipdir(path[_0x6bbc('0x39')](_0x5c24b4,_0x2310c9),{'saveTo':path[_0x6bbc('0x39')](_0x5c24b4,util[_0x6bbc('0x20')](_0x6bbc('0x3d'),_0x2310c9,_0x6bbc('0x3f')))},function(){rimraf(path[_0x6bbc('0x39')](_0x5c24b4,_0x2310c9),function(){});_0x20aec7(_0x6bbc('0x40'));});});}})[_0x6bbc('0x2c')](function(){if(!_0x61f9c1)return;rimraf(path[_0x6bbc('0x39')](_0x5c24b4,_0x2310c9),function(){});})[_0x6bbc('0x2c')](function(){logger[_0x6bbc('0x41')](util[_0x6bbc('0x20')](_0x6bbc('0x42'),EXTRACTED_REPORT_ID,'PDF'));return analyticExtractedReport(_0x6bbc('0x43'),_0x61f9c1?util[_0x6bbc('0x20')](_0x6bbc('0x3d'),_0x2310c9,_0x61f9c1?'zip':'pdf'):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x6bbc('0x41')](util[_0x6bbc('0x20')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x6bbc('0x44')));return db[_0x6bbc('0x10')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})[_0x6bbc('0x2c')](function(_0x304117){EXTRACTED_REPORT=_0x304117;return dbH[_0x6bbc('0x32')][_0x6bbc('0x33')](util[_0x6bbc('0x20')](_0x6bbc('0x45'),QUERY),{'type':dbH[_0x6bbc('0x32')][_0x6bbc('0x34')][_0x6bbc('0x35')]});})[_0x6bbc('0x2c')](extractReport)['catch'](function(_0x16e5ed){logger[_0x6bbc('0x41')](util[_0x6bbc('0x20')](_0x6bbc('0x46'),EXTRACTED_REPORT_ID,_0x6bbc('0x44')),util[_0x6bbc('0x47')](_0x16e5ed,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x6bbc('0x48'));})['finally'](function(){process[_0x6bbc('0x49')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x5cf0d7=new PdfPrinter({'Arial':{'normal':__dirname+_0x6bbc('0x4a'),'bold':__dirname+_0x6bbc('0x4b'),'italics':__dirname+_0x6bbc('0x4c'),'bolditalics':__dirname+_0x6bbc('0x4d')}});return _0x5cf0d7;}function getPDFDocDefinitionFromHTML(_0x449b53,_0x3f9eb6){var _0x1c18a1=util[_0x6bbc('0x20')]('%s\x20#%d',_0x3f9eb6[_0x6bbc('0x4e')],_0x3f9eb6[_0x6bbc('0x4f')]);var _0x591939=moment()[_0x6bbc('0x20')](_0x6bbc('0x50'))[_0x6bbc('0x15')]();var _0xc4005=htmlToPdfmake(_0x449b53,{'window':window,'tableAutoSize':!![]});return{'content':[_0xc4005],'defaultStyle':{'font':_0x6bbc('0x51')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x6bbc('0x52'),'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':_0x6bbc('0x52')}},'header':function(){return[{'text':'Interaction\x20Transcript','style':'header'}];},'footer':function(_0x1d0ac5,_0x57bc96){return[{'text':util[_0x6bbc('0x20')]('\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s',_0x1c18a1,_0x1d0ac5,_0x57bc96,_0x591939),'style':_0x6bbc('0x26')}];}};}function writePDFDocument(_0x585398,_0x10b10b){return new Promise(function(_0x5c8d77,_0x213f5d){var _0x4fbf91=_0x585398['pipe'](fs[_0x6bbc('0x53')](_0x10b10b));_0x4fbf91['on'](_0x6bbc('0x54'),function(){_0x5c8d77(_0x6bbc('0x54'));});_0x4fbf91['on'](_0x6bbc('0x55'),function(_0x45b174){_0x213f5d(_0x45b174);});_0x585398[_0x6bbc('0x56')]();});}exports[_0x6bbc('0x57')]=function(_0x1b6234,_0x3ab6e3){var _0x3310c7=getPDFPrinter();var _0x3a733f=getPDFDocDefinitionFromHTML(_0x1b6234,_0x3ab6e3);var _0x44af6b=_0x3310c7[_0x6bbc('0x58')](_0x3a733f);return writePDFDocument(_0x44af6b,_0x3ab6e3[_0x6bbc('0x2')])[_0x6bbc('0x59')](function(_0x33d900){throw _0x33d900;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index fafc6e7..d853b26 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 _0x89b9=['existsSync','join','mkdirSync','each','%s%d.%s','xlsx','%s.%s','writeFileSync','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','path','lodash','json2xls','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','split','then','splitSizeXlsx','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','length','range','format','push','dirname','basename','.xlsx'];(function(_0x23f83b,_0x4fd76e){var _0x36a1d3=function(_0x5c15c5){while(--_0x5c15c5){_0x23f83b['push'](_0x23f83b['shift']());}};_0x36a1d3(++_0x4fd76e);}(_0x89b9,0x9e));var _0x989b=function(_0x243bbb,_0x4bbdb4){_0x243bbb=_0x243bbb-0x0;var _0x2548ab=_0x89b9[_0x243bbb];return _0x2548ab;};'use strict';var util=require('util');var path=require(_0x989b('0x0'));var _=require(_0x989b('0x1'));var fs=require('fs');var json2xls=require(_0x989b('0x2'));var BPromise=require('bluebird');var zipdir=require('zip-dir');var rimraf=require('rimraf');var db=require(_0x989b('0x3'))['db'];var dbH=require('../../mysqldb')[_0x989b('0x4')];var logger=require(_0x989b('0x5'))(_0x989b('0x6'));var EXTRACTED_REPORT_ID=Number(process[_0x989b('0x7')][0x2]);var QUERY=process[_0x989b('0x7')][0x3];var PATH=process[_0x989b('0x7')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x985822,_0x42f2bf){var _0x6ce2ea={'status':_0x985822};var _0x1ad2c9={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x42f2bf){_0x6ce2ea[_0x989b('0x8')]=_0x42f2bf;}return db[_0x989b('0x9')][_0x989b('0xa')](_0x6ce2ea,_0x1ad2c9);}function main(){var _0x1aa3d4=0x1388;var _0x52c7fc;logger[_0x989b('0xb')](util['format'](_0x989b('0xc'),EXTRACTED_REPORT_ID,_0x989b('0xd')));return db['Setting']['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x989b('0xe'),'splitSizeXlsx']})[_0x989b('0xf')](function(_0x528316){if(_0x528316){_0x52c7fc=_0x528316;_0x1aa3d4=_0x52c7fc[_0x989b('0x10')]||0x1388;}})[_0x989b('0xf')](function(){return dbH[_0x989b('0x11')][_0x989b('0x12')](util['format'](_0x989b('0x13'),QUERY),{'type':dbH['sequelize'][_0x989b('0x14')][_0x989b('0x15')]});})[_0x989b('0xf')](function(_0x5a1d3b){if(!_0x5a1d3b[0x0][_0x989b('0x16')]){return analyticExtractedReport('Empty');}var _0xb0a2cf=[];var _0x14479f=0x0;if(_0x52c7fc[_0x989b('0xe')]){if(_0x5a1d3b&&_0x5a1d3b[_0x989b('0x17')]){var _0x15f60f=_[_0x989b('0x18')](_0x5a1d3b[0x0]['num']/_0x1aa3d4);var _0x4f59bc=Number['isInteger'](_0x5a1d3b[0x0][_0x989b('0x16')]/_0x1aa3d4)?_0x5a1d3b[0x0]['num']%_0x1aa3d4:0x0;_0x15f60f['forEach'](function(_0x13a58f){if(_0x13a58f>0x0){_0x14479f+=_0x1aa3d4;}_0xb0a2cf['push'](dbH[_0x989b('0x11')]['query'](util[_0x989b('0x19')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x1aa3d4,_0x14479f),{'type':dbH[_0x989b('0x11')][_0x989b('0x14')][_0x989b('0x15')]}));});if(_0x4f59bc>0x0){_0x14479f+=_0x1aa3d4;_0xb0a2cf[_0x989b('0x1a')](dbH[_0x989b('0x11')][_0x989b('0x12')](util[_0x989b('0x19')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x4f59bc,_0x14479f),{'type':dbH[_0x989b('0x11')][_0x989b('0x14')]['SELECT']}));}}}else{_0xb0a2cf[_0x989b('0x1a')](dbH[_0x989b('0x11')]['query'](QUERY,{'type':dbH[_0x989b('0x11')][_0x989b('0x14')]['SELECT']}));}var _0x4e1a0c=path[_0x989b('0x1b')](PATH);var _0x585717=path[_0x989b('0x1c')](PATH,_0x989b('0x1d'));var _0x56843b=_0x52c7fc[_0x989b('0xe')]&&_0xb0a2cf[_0x989b('0x17')]>0x1;var _0x2ee84e=[];if(!fs[_0x989b('0x1e')](path[_0x989b('0x1f')](_0x4e1a0c,_0x585717))&&_0x56843b){fs[_0x989b('0x20')](path[_0x989b('0x1f')](_0x4e1a0c,_0x585717));}return BPromise[_0x989b('0x21')](_0xb0a2cf,function(_0x416ec0){_0x2ee84e[_0x989b('0x1a')](_0x416ec0);})[_0x989b('0xf')](function(){for(var _0x172f5c=0x0;_0x172f5c<_0x2ee84e['length'];_0x172f5c+=0x1){var _0x260d73;var _0x1c52de=_0x2ee84e[_0x172f5c];if(_0x56843b){_0x260d73=path[_0x989b('0x1f')](_0x4e1a0c,_0x585717,util[_0x989b('0x19')](_0x989b('0x22'),_0x585717,_0x172f5c,_0x989b('0x23')));}else{_0x260d73=path['join'](_0x4e1a0c,util[_0x989b('0x19')](_0x989b('0x24'),_0x585717,_0x989b('0x23')));}fs[_0x989b('0x25')](_0x260d73,json2xls(_0x1c52de),'binary');}})[_0x989b('0xf')](function(){if(_0x56843b){return new Promise(function(_0x308f84){zipdir(path['join'](_0x4e1a0c,_0x585717),{'saveTo':path['join'](_0x4e1a0c,util[_0x989b('0x19')]('%s.%s',_0x585717,_0x989b('0x26')))},function(_0x288c66,_0x482807){rimraf(path['join'](_0x4e1a0c,_0x585717),function(){});_0x308f84(_0x989b('0x27'));});});}})['then'](function(){logger[_0x989b('0xb')](util[_0x989b('0x19')](_0x989b('0x28'),EXTRACTED_REPORT_ID,_0x989b('0xd')));return analyticExtractedReport(_0x989b('0x29'),_0x56843b?util[_0x989b('0x19')](_0x989b('0x24'),_0x585717,_0x56843b?_0x989b('0x26'):_0x989b('0x23')):null);});})[_0x989b('0x2a')](function(_0x4347be){logger[_0x989b('0xb')](util[_0x989b('0x19')](_0x989b('0x2b'),EXTRACTED_REPORT_ID,_0x989b('0xd')),util[_0x989b('0x2c')](_0x4347be,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x989b('0x2d'));})[_0x989b('0x2e')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file +var _0x052c=['savename','AnalyticExtractedReport','update','info','format','XLSX','Setting','find','split','splitSizeXlsx','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','num','length','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','basename','existsSync','join','mkdirSync','each','%s%d.%s','xlsx','%s.%s','writeFileSync','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','exit','util','path','lodash','json2xls','bluebird','zip-dir','../../mysqldb','dbH','analytics','argv'];(function(_0x41c493,_0xed7a99){var _0xf95c25=function(_0x378f3b){while(--_0x378f3b){_0x41c493['push'](_0x41c493['shift']());}};_0xf95c25(++_0xed7a99);}(_0x052c,0xe6));var _0xc052=function(_0x2a9f3b,_0x411e03){_0x2a9f3b=_0x2a9f3b-0x0;var _0x2c6e4f=_0x052c[_0x2a9f3b];return _0x2c6e4f;};'use strict';var util=require(_0xc052('0x0'));var path=require(_0xc052('0x1'));var _=require(_0xc052('0x2'));var fs=require('fs');var json2xls=require(_0xc052('0x3'));var BPromise=require(_0xc052('0x4'));var zipdir=require(_0xc052('0x5'));var rimraf=require('rimraf');var db=require('../../mysqldb')['db'];var dbH=require(_0xc052('0x6'))[_0xc052('0x7')];var logger=require('../../config/logger')(_0xc052('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0xc052('0x9')][0x2]);var QUERY=process[_0xc052('0x9')][0x3];var PATH=process[_0xc052('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0xb0d25b,_0x8fd3c3){var _0x7211ff={'status':_0xb0d25b};var _0x350ec9={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x8fd3c3){_0x7211ff[_0xc052('0xa')]=_0x8fd3c3;}return db[_0xc052('0xb')][_0xc052('0xc')](_0x7211ff,_0x350ec9);}function main(){var _0x2941d5=0x1388;var _0x75ebdf;logger[_0xc052('0xd')](util[_0xc052('0xe')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xc052('0xf')));return db[_0xc052('0x10')][_0xc052('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xc052('0x12'),'splitSizeXlsx']})['then'](function(_0x41f66e){if(_0x41f66e){_0x75ebdf=_0x41f66e;_0x2941d5=_0x75ebdf[_0xc052('0x13')]||0x1388;}})[_0xc052('0x14')](function(){return dbH['sequelize'][_0xc052('0x15')](util['format'](_0xc052('0x16'),QUERY),{'type':dbH[_0xc052('0x17')]['QueryTypes']['SELECT']});})[_0xc052('0x14')](function(_0x374f0e){if(!_0x374f0e[0x0][_0xc052('0x18')]){return analyticExtractedReport('Empty');}var _0x142cf2=[];var _0x54bb71=0x0;if(_0x75ebdf[_0xc052('0x12')]){if(_0x374f0e&&_0x374f0e[_0xc052('0x19')]){var _0x3750a7=_['range'](_0x374f0e[0x0][_0xc052('0x18')]/_0x2941d5);var _0x2dc290=Number[_0xc052('0x1a')](_0x374f0e[0x0][_0xc052('0x18')]/_0x2941d5)?_0x374f0e[0x0]['num']%_0x2941d5:0x0;_0x3750a7[_0xc052('0x1b')](function(_0x4aa784){if(_0x4aa784>0x0){_0x54bb71+=_0x2941d5;}_0x142cf2[_0xc052('0x1c')](dbH[_0xc052('0x17')][_0xc052('0x15')](util['format'](_0xc052('0x1d'),QUERY,_0x2941d5,_0x54bb71),{'type':dbH[_0xc052('0x17')][_0xc052('0x1e')][_0xc052('0x1f')]}));});if(_0x2dc290>0x0){_0x54bb71+=_0x2941d5;_0x142cf2[_0xc052('0x1c')](dbH['sequelize'][_0xc052('0x15')](util[_0xc052('0xe')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x2dc290,_0x54bb71),{'type':dbH[_0xc052('0x17')][_0xc052('0x1e')]['SELECT']}));}}}else{_0x142cf2[_0xc052('0x1c')](dbH[_0xc052('0x17')][_0xc052('0x15')](QUERY,{'type':dbH[_0xc052('0x17')]['QueryTypes'][_0xc052('0x1f')]}));}var _0x4d52ed=path['dirname'](PATH);var _0x34d52f=path[_0xc052('0x20')](PATH,'.xlsx');var _0x2aafc3=_0x75ebdf[_0xc052('0x12')]&&_0x142cf2['length']>0x1;var _0x1af454=[];if(!fs[_0xc052('0x21')](path[_0xc052('0x22')](_0x4d52ed,_0x34d52f))&&_0x2aafc3){fs[_0xc052('0x23')](path['join'](_0x4d52ed,_0x34d52f));}return BPromise[_0xc052('0x24')](_0x142cf2,function(_0x3d6716){_0x1af454[_0xc052('0x1c')](_0x3d6716);})[_0xc052('0x14')](function(){for(var _0x1e7397=0x0;_0x1e7397<_0x1af454[_0xc052('0x19')];_0x1e7397+=0x1){var _0x2a1752;var _0x5b1f39=_0x1af454[_0x1e7397];if(_0x2aafc3){_0x2a1752=path[_0xc052('0x22')](_0x4d52ed,_0x34d52f,util[_0xc052('0xe')](_0xc052('0x25'),_0x34d52f,_0x1e7397,_0xc052('0x26')));}else{_0x2a1752=path[_0xc052('0x22')](_0x4d52ed,util[_0xc052('0xe')](_0xc052('0x27'),_0x34d52f,_0xc052('0x26')));}fs[_0xc052('0x28')](_0x2a1752,json2xls(_0x5b1f39),'binary');}})['then'](function(){if(_0x2aafc3){return new Promise(function(_0x34acac){zipdir(path[_0xc052('0x22')](_0x4d52ed,_0x34d52f),{'saveTo':path[_0xc052('0x22')](_0x4d52ed,util[_0xc052('0xe')]('%s.%s',_0x34d52f,_0xc052('0x29')))},function(_0x2db27f,_0x29f48d){rimraf(path[_0xc052('0x22')](_0x4d52ed,_0x34d52f),function(){});_0x34acac('zip\x20finished');});});}})['then'](function(){logger['info'](util['format'](_0xc052('0x2a'),EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport('Completed',_0x2aafc3?util['format']('%s.%s',_0x34d52f,_0x2aafc3?_0xc052('0x29'):_0xc052('0x26')):null);});})[_0xc052('0x2b')](function(_0x57755c){logger[_0xc052('0xd')](util[_0xc052('0xe')](_0xc052('0x2c'),EXTRACTED_REPORT_ID,_0xc052('0xf')),util[_0xc052('0x2d')](_0x57755c,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xc052('0x2e'));})['finally'](function(){process[_0xc052('0x2f')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index e7aaf3e..a160120 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 _0xab70=['$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','length','updatedAt','*,*,*,*','interval','map','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','toLowerCase','appType','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice',',${EXTEN},','last','concat','destroy','bulkCreate','sortBy','catch','error','rewrite','lodash','util','findAll','then','intervals','models','VoiceExtension','IntervalId','uniq','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','priority','extensions','extension','push','type','Set','context','inbound','CDR(routeid)=','VoiceExtensionId','outbound','CDR(destination)=','cutdigits','${EXTEN}','ExecIf'];(function(_0x11d4d7,_0x2f6fcc){var _0x50ed8f=function(_0x1b261b){while(--_0x1b261b){_0x11d4d7['push'](_0x11d4d7['shift']());}};_0x50ed8f(++_0x2f6fcc);}(_0xab70,0xee));var _0x0ab7=function(_0x89080a,_0x2d2b1b){_0x89080a=_0x89080a-0x0;var _0x33a55d=_0xab70[_0x89080a];return _0x33a55d;};'use strict';var _=require(_0x0ab7('0x0'));var util=require(_0x0ab7('0x1'));function rewrite(_0x5697a9,_0x368a7e){var _0x24ec98=this;return _0x5697a9['models']['Interval'][_0x0ab7('0x2')]({'raw':!![]})[_0x0ab7('0x3')](function(_0x5eda7b){_0x24ec98[_0x0ab7('0x4')]=_0x5eda7b;return _0x5697a9[_0x0ab7('0x5')][_0x0ab7('0x6')]['findAll']({'where':{'IntervalId':_0x368a7e[_0x0ab7('0x7')]},'raw':!![]});})[_0x0ab7('0x3')](function(_0x3c28ec){return _0x5697a9[_0x0ab7('0x5')][_0x0ab7('0x6')]['findAll']({'where':{'exten':{'$in':_[_0x0ab7('0x8')](_['map'](_0x3c28ec,_0x0ab7('0x9')))}},'order':[{'raw':_0x0ab7('0xa')}],'raw':!![]});})[_0x0ab7('0x3')](function(_0x19f211){var _0x6d43b7=_[_0x0ab7('0xb')](_0x19f211,{'priority':'1'});var _0x1a0f43=_[_0x0ab7('0xb')](_0x19f211,{'isApp':0x1});var _0x4b1247=_[_0x0ab7('0xc')](_0x1a0f43,_0x0ab7('0x9'));var _0x14c899=[_0x0ab7('0xd'),_0x0ab7('0xe')];var _0x4a6caa=[];var _0x412a62=[];for(var _0x314c44 in _0x4b1247){if(_0x4b1247['hasOwnProperty'](_0x314c44)){_0x24ec98[_0x0ab7('0xf')]=0x2;_0x24ec98[_0x0ab7('0x10')]=[];_0x24ec98[_0x0ab7('0x11')]=_['find'](_0x6d43b7,{'exten':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x9')]});_0x24ec98['extensions'][_0x0ab7('0x12')]({'type':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x13')],'app':_0x0ab7('0x14'),'appdata':util['format']('CDR(type)=%s',_0x4b1247[_0x314c44][0x0]['type']),'context':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x15')],'exten':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x9')],'priority':_0x24ec98[_0x0ab7('0xf')]++,'VoiceExtensionId':_0x4b1247[_0x314c44][0x0]['VoiceExtensionId']});if(_0x4b1247[_0x314c44][0x0][_0x0ab7('0x13')]===_0x0ab7('0x16')){_0x24ec98[_0x0ab7('0x10')][_0x0ab7('0x12')]({'type':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x13')],'app':_0x0ab7('0x14'),'appdata':_0x0ab7('0x17')+_0x4b1247[_0x314c44][0x0][_0x0ab7('0x18')],'context':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x15')],'exten':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x9')],'priority':_0x24ec98[_0x0ab7('0xf')]++,'VoiceExtensionId':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x18')]});}else if(_0x4b1247[_0x314c44][0x0]['type']===_0x0ab7('0x19')){if(_0x24ec98[_0x0ab7('0x11')]){_0x24ec98[_0x0ab7('0x10')]['push']({'type':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x13')],'app':'Set','appdata':_0x0ab7('0x1a')+(_0x24ec98['extension'][_0x0ab7('0x1b')]?'${EXTEN:'+_0x24ec98[_0x0ab7('0x11')][_0x0ab7('0x1b')]+'}':_0x0ab7('0x1c')),'context':_0x4b1247[_0x314c44][0x0]['context'],'exten':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x9')],'priority':_0x24ec98[_0x0ab7('0xf')]++,'VoiceExtensionId':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x18')]});}_0x24ec98[_0x0ab7('0x10')][_0x0ab7('0x12')]({'type':_0x4b1247[_0x314c44][0x0]['type'],'app':_0x0ab7('0x14'),'appdata':_0x0ab7('0x17')+_0x4b1247[_0x314c44][0x0][_0x0ab7('0x18')],'context':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x15')],'exten':_0x4b1247[_0x314c44][0x0]['exten'],'priority':_0x24ec98[_0x0ab7('0xf')]++,'VoiceExtensionId':_0x4b1247[_0x314c44][0x0]['VoiceExtensionId']});var _0x3ce1c6=_0x24ec98['priority']++;_0x24ec98[_0x0ab7('0x10')]['push']({'type':_0x4b1247[_0x314c44][0x0]['type'],'app':_0x0ab7('0x1d'),'appdata':_0x0ab7('0x1e')+(_0x3ce1c6+0x2)+'):Goto('+(_0x3ce1c6+0x1)+')','context':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x15')],'exten':_0x4b1247[_0x314c44][0x0]['exten'],'priority':_0x3ce1c6,'VoiceExtensionId':_0x4b1247[_0x314c44][0x0]['VoiceExtensionId']});if(_0x24ec98[_0x0ab7('0x11')]){_0x24ec98[_0x0ab7('0x10')][_0x0ab7('0x12')]({'type':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x13')],'app':_0x0ab7('0x14'),'appdata':_0x24ec98[_0x0ab7('0x11')][_0x0ab7('0x1b')]?'CDR(prefix)=${EXTEN:0:'+_0x24ec98[_0x0ab7('0x11')][_0x0ab7('0x1b')]+'}':'CDR(prefix)=noprefix','context':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x15')],'exten':_0x4b1247[_0x314c44][0x0]['exten'],'priority':_0x24ec98['priority']++,'VoiceExtensionId':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x18')]});}_0x24ec98[_0x0ab7('0x10')][_0x0ab7('0x12')]({'type':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x13')],'app':'Set','appdata':_0x0ab7('0x1f')+_0x4b1247[_0x314c44][0x0]['VoiceExtensionId'],'context':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x15')],'exten':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x9')],'priority':_0x24ec98[_0x0ab7('0xf')]++,'VoiceExtensionId':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x18')]});if(_0x24ec98[_0x0ab7('0x11')]&&_0x24ec98[_0x0ab7('0x11')][_0x0ab7('0x20')](_0x0ab7('0x21'))&&_0x24ec98[_0x0ab7('0x11')]['recordingFormat']!==_0x0ab7('0x22')){_0x24ec98['extensions'][_0x0ab7('0x12')]({'type':_0x4b1247[_0x314c44][0x0]['type'],'app':_0x0ab7('0x14'),'appdata':_0x0ab7('0x23'),'context':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x15')],'exten':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x9')],'priority':_0x24ec98[_0x0ab7('0xf')]++,'VoiceExtensionId':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x18')]});_0x24ec98[_0x0ab7('0x10')][_0x0ab7('0x12')]({'type':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x13')],'app':_0x0ab7('0x14'),'appdata':_0x0ab7('0x24')+_0x24ec98['extension'][_0x0ab7('0x21')]||_0x0ab7('0x25'),'context':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x15')],'exten':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x9')],'priority':_0x24ec98[_0x0ab7('0xf')]++,'VoiceExtensionId':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x18')]});}}_0x24ec98[_0x0ab7('0x10')][_0x0ab7('0x12')]({'type':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x13')],'app':_0x0ab7('0x14'),'appdata':_0x0ab7('0x26'),'context':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x15')],'exten':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x9')],'priority':_0x24ec98[_0x0ab7('0xf')]++,'VoiceExtensionId':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x18')]});_0x24ec98['extensions'][_0x0ab7('0x12')]({'type':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x13')],'app':_0x0ab7('0x14'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x15')],'exten':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x9')],'priority':_0x24ec98['priority']++,'VoiceExtensionId':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x18')]});_0x24ec98[_0x0ab7('0x10')][_0x0ab7('0x12')]({'type':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x13')],'app':'Set','appdata':'MONITOR_OPTIONS=ab','context':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x15')],'exten':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x9')],'priority':_0x24ec98[_0x0ab7('0xf')]++,'VoiceExtensionId':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x18')]});for(var _0x31d899=0x0,_0x3aaa2e=0x0;_0x31d899<_0x4b1247[_0x314c44][_0x0ab7('0x27')];_0x31d899+=0x1,_0x3aaa2e=0x0){var _0x2ccc17=_0x4b1247[_0x314c44][_0x31d899];if(_0x2ccc17['type']){_0x2ccc17[_0x0ab7('0x13')]=_0x2ccc17[_0x0ab7('0x13')]['toLowerCase']();}var _0x514f33=[];var _0x20623f=[];delete _0x2ccc17['id'];delete _0x2ccc17['createdAt'];delete _0x2ccc17[_0x0ab7('0x28')];var _0x5151dd=_0x2ccc17['interval']!==_0x0ab7('0x29')?[_0x2ccc17[_0x0ab7('0x2a')]]:_0x2ccc17[_0x0ab7('0x7')]?_[_0x0ab7('0x2b')](_['filter'](_0x24ec98[_0x0ab7('0x4')],{'IntervalId':_0x2ccc17['IntervalId']}),_0x0ab7('0x2a')):[];if(_0x2ccc17[_0x0ab7('0x20')](_0x0ab7('0x2c'))){if(_0x2ccc17[_0x0ab7('0x2c')]&&_0x2ccc17[_0x0ab7('0x2c')]!=='--'){_0x514f33[_0x0ab7('0x12')]({'type':_0x2ccc17[_0x0ab7('0x13')],'app':_0x0ab7('0x14'),'appdata':_0x0ab7('0x2d')+_0x2ccc17[_0x0ab7('0x2c')],'context':_0x2ccc17[_0x0ab7('0x15')],'exten':_0x2ccc17['exten'],'priority':_0x5151dd[_0x0ab7('0x27')]+_0x24ec98[_0x0ab7('0xf')]+_0x3aaa2e++,'VoiceExtensionId':_0x2ccc17[_0x0ab7('0x18')]});}}if(_0x2ccc17['type']===_0x0ab7('0x19')&&_0x2ccc17[_0x0ab7('0x20')](_0x0ab7('0x2e'))){if(_0x2ccc17[_0x0ab7('0x2e')]){_0x514f33['push']({'type':_0x2ccc17[_0x0ab7('0x13')],'app':_0x0ab7('0x1d'),'appdata':_0x0ab7('0x2f')+_0x2ccc17['callerID']+')','context':_0x2ccc17[_0x0ab7('0x15')],'exten':_0x2ccc17[_0x0ab7('0x9')],'priority':_0x5151dd[_0x0ab7('0x27')]+_0x24ec98['priority']+_0x3aaa2e++,'VoiceExtensionId':_0x2ccc17['VoiceExtensionId']});}else{_0x514f33[_0x0ab7('0x12')]({'type':_0x2ccc17['type'],'app':'ExecIf','appdata':_0x0ab7('0x30'),'context':_0x2ccc17[_0x0ab7('0x15')],'exten':_0x2ccc17[_0x0ab7('0x9')],'priority':_0x5151dd[_0x0ab7('0x27')]+_0x24ec98['priority']+_0x3aaa2e++,'VoiceExtensionId':_0x2ccc17[_0x0ab7('0x18')]});}}if(_0x2ccc17[_0x0ab7('0x20')](_0x0ab7('0x31'))){if(_0x14c899[_0x0ab7('0x32')](_0x2ccc17[_0x0ab7('0x33')][_0x0ab7('0x34')]())>=0x0&&_0x2ccc17[_0x0ab7('0x35')]!=='custom'){if(_0x2ccc17[_0x0ab7('0x31')]){_0x514f33[_0x0ab7('0x12')]({'type':_0x2ccc17[_0x0ab7('0x13')],'app':'ExecIf','appdata':_0x0ab7('0x36'),'context':_0x2ccc17[_0x0ab7('0x15')],'exten':_0x2ccc17[_0x0ab7('0x9')],'priority':_0x5151dd['length']+_0x24ec98[_0x0ab7('0xf')]+_0x3aaa2e++,'VoiceExtensionId':_0x2ccc17[_0x0ab7('0x18')]});_0x514f33[_0x0ab7('0x12')]({'type':_0x2ccc17[_0x0ab7('0x13')],'app':_0x0ab7('0x14'),'appdata':_0x0ab7('0x37'),'context':_0x2ccc17[_0x0ab7('0x15')],'exten':_0x2ccc17[_0x0ab7('0x9')],'priority':_0x5151dd['length']+_0x24ec98[_0x0ab7('0xf')]+_0x3aaa2e++,'VoiceExtensionId':_0x2ccc17[_0x0ab7('0x18')]});}else{_0x514f33[_0x0ab7('0x12')]({'type':_0x2ccc17['type'],'app':_0x0ab7('0x1d'),'appdata':_0x0ab7('0x38'),'context':_0x2ccc17[_0x0ab7('0x15')],'exten':_0x2ccc17[_0x0ab7('0x9')],'priority':_0x5151dd['length']+_0x24ec98[_0x0ab7('0xf')]+_0x3aaa2e++,'VoiceExtensionId':_0x2ccc17['VoiceExtensionId']});_0x514f33[_0x0ab7('0x12')]({'type':_0x2ccc17['type'],'app':_0x0ab7('0x14'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x2ccc17[_0x0ab7('0x15')],'exten':_0x2ccc17['exten'],'priority':_0x5151dd[_0x0ab7('0x27')]+_0x24ec98[_0x0ab7('0xf')]+_0x3aaa2e++,'VoiceExtensionId':_0x2ccc17[_0x0ab7('0x18')]});}}}for(var _0xd48c6d=0x0;_0xd48c6d<_0x5151dd['length'];_0xd48c6d+=0x1){var _0x37fdbc=_0x24ec98['priority']+_0x5151dd[_0x0ab7('0x27')];var _0x436a88=_0xd48c6d===_0x5151dd[_0x0ab7('0x27')]-0x1?_0x24ec98[_0x0ab7('0xf')]+_0x514f33['length']+_0x20623f[_0x0ab7('0x27')]+0x2:_0x24ec98[_0x0ab7('0xf')]+_0xd48c6d+0x1;_0x514f33[_0x0ab7('0x39')](_0xd48c6d,0x0,{'type':_0x2ccc17[_0x0ab7('0x13')],'app':'GotoIfTime','appdata':_0x5151dd[_0xd48c6d]+'?'+_0x2ccc17['context']+_0x0ab7('0x3a')+_0x37fdbc+':'+_0x2ccc17[_0x0ab7('0x15')]+',${EXTEN},'+_0x436a88,'exten':_0x2ccc17[_0x0ab7('0x9')],'context':_0x2ccc17[_0x0ab7('0x15')],'priority':_0x24ec98[_0x0ab7('0xf')]+_0xd48c6d,'VoiceExtensionId':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x18')]});}_0x2ccc17['priority']=_0x514f33[_0x0ab7('0x27')]?_[_0x0ab7('0x3b')](_0x514f33)[_0x0ab7('0xf')]+0x1:_0x24ec98[_0x0ab7('0xf')];_0x24ec98[_0x0ab7('0xf')]=(_0x20623f[_0x0ab7('0x27')]?_[_0x0ab7('0x3b')](_0x20623f)[_0x0ab7('0xf')]:_0x2ccc17[_0x0ab7('0xf')])+0x1;_0x24ec98[_0x0ab7('0x10')]=_[_0x0ab7('0x3c')](_0x24ec98[_0x0ab7('0x10')],_0x514f33,[_0x2ccc17],_0x20623f);}_0x24ec98[_0x0ab7('0x10')][_0x0ab7('0x12')]({'type':_0x4b1247[_0x314c44][0x0]['type'],'app':'Hangup','exten':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x9')],'context':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x15')],'priority':_0x24ec98[_0x0ab7('0xf')],'VoiceExtensionId':_0x4b1247[_0x314c44][0x0][_0x0ab7('0x18')]});_0x4a6caa['push'](_0x4b1247[_0x314c44][0x0][_0x0ab7('0x18')]);_0x412a62=_[_0x0ab7('0x3c')](_0x412a62,_0x24ec98[_0x0ab7('0x10')]);}}return _0x5697a9['transaction'](function(_0x5219a9){return _0x5697a9[_0x0ab7('0x5')][_0x0ab7('0x6')][_0x0ab7('0x3d')]({'where':{'VoiceExtensionId':{'$in':_0x4a6caa}},'transaction':_0x5219a9})['then'](function(_0x52313d){return _0x5697a9[_0x0ab7('0x5')][_0x0ab7('0x6')][_0x0ab7('0x3e')](_[_0x0ab7('0x3f')](_0x412a62,_0x0ab7('0xf')),{'transaction':_0x5219a9});});});})[_0x0ab7('0x40')](function(_0x150b9e){console[_0x0ab7('0x41')](_0x150b9e);});}exports[_0x0ab7('0x42')]=rewrite; \ No newline at end of file +var _0xf211=['CDR(destination)=','extension','${EXTEN:','cutdigits','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','wav','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','toLowerCase','updatedAt','interval','*,*,*,*','tag','CDR(tag)=','length','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','answer','indexOf','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','destroy','bulkCreate','sortBy','catch','error','rewrite','lodash','util','models','Interval','findAll','intervals','VoiceExtension','IntervalId','then','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','hasOwnProperty','priority','extensions','find','push','type','Set','CDR(type)=%s','context','VoiceExtensionId','inbound','CDR(routeid)=','outbound'];(function(_0x38865f,_0x58978d){var _0x5c03f1=function(_0x44c5ca){while(--_0x44c5ca){_0x38865f['push'](_0x38865f['shift']());}};_0x5c03f1(++_0x58978d);}(_0xf211,0x1ef));var _0x1f21=function(_0x593f03,_0x4af84a){_0x593f03=_0x593f03-0x0;var _0x178299=_0xf211[_0x593f03];return _0x178299;};'use strict';var _=require(_0x1f21('0x0'));var util=require(_0x1f21('0x1'));function rewrite(_0x2b4ee0,_0x1558e3){var _0x3d1f99=this;return _0x2b4ee0[_0x1f21('0x2')][_0x1f21('0x3')][_0x1f21('0x4')]({'raw':!![]})['then'](function(_0x58daab){_0x3d1f99[_0x1f21('0x5')]=_0x58daab;return _0x2b4ee0[_0x1f21('0x2')][_0x1f21('0x6')][_0x1f21('0x4')]({'where':{'IntervalId':_0x1558e3[_0x1f21('0x7')]},'raw':!![]});})[_0x1f21('0x8')](function(_0x86f2d2){return _0x2b4ee0[_0x1f21('0x2')][_0x1f21('0x6')][_0x1f21('0x4')]({'where':{'exten':{'$in':_[_0x1f21('0x9')](_[_0x1f21('0xa')](_0x86f2d2,_0x1f21('0xb')))}},'order':[{'raw':_0x1f21('0xc')}],'raw':!![]});})['then'](function(_0xe7e256){var _0x4aeffd=_['filter'](_0xe7e256,{'priority':'1'});var _0x293146=_[_0x1f21('0xd')](_0xe7e256,{'isApp':0x1});var _0x52536e=_[_0x1f21('0xe')](_0x293146,'exten');var _0x4df0c9=[_0x1f21('0xf'),_0x1f21('0x10')];var _0x2849be=[];var _0xc38d88=[];for(var _0x6dceac in _0x52536e){if(_0x52536e[_0x1f21('0x11')](_0x6dceac)){_0x3d1f99[_0x1f21('0x12')]=0x2;_0x3d1f99[_0x1f21('0x13')]=[];_0x3d1f99['extension']=_[_0x1f21('0x14')](_0x4aeffd,{'exten':_0x52536e[_0x6dceac][0x0]['exten']});_0x3d1f99[_0x1f21('0x13')][_0x1f21('0x15')]({'type':_0x52536e[_0x6dceac][0x0][_0x1f21('0x16')],'app':_0x1f21('0x17'),'appdata':util['format'](_0x1f21('0x18'),_0x52536e[_0x6dceac][0x0][_0x1f21('0x16')]),'context':_0x52536e[_0x6dceac][0x0][_0x1f21('0x19')],'exten':_0x52536e[_0x6dceac][0x0][_0x1f21('0xb')],'priority':_0x3d1f99['priority']++,'VoiceExtensionId':_0x52536e[_0x6dceac][0x0][_0x1f21('0x1a')]});if(_0x52536e[_0x6dceac][0x0][_0x1f21('0x16')]===_0x1f21('0x1b')){_0x3d1f99[_0x1f21('0x13')][_0x1f21('0x15')]({'type':_0x52536e[_0x6dceac][0x0][_0x1f21('0x16')],'app':_0x1f21('0x17'),'appdata':_0x1f21('0x1c')+_0x52536e[_0x6dceac][0x0][_0x1f21('0x1a')],'context':_0x52536e[_0x6dceac][0x0][_0x1f21('0x19')],'exten':_0x52536e[_0x6dceac][0x0]['exten'],'priority':_0x3d1f99['priority']++,'VoiceExtensionId':_0x52536e[_0x6dceac][0x0][_0x1f21('0x1a')]});}else if(_0x52536e[_0x6dceac][0x0][_0x1f21('0x16')]===_0x1f21('0x1d')){if(_0x3d1f99['extension']){_0x3d1f99[_0x1f21('0x13')]['push']({'type':_0x52536e[_0x6dceac][0x0][_0x1f21('0x16')],'app':_0x1f21('0x17'),'appdata':_0x1f21('0x1e')+(_0x3d1f99[_0x1f21('0x1f')]['cutdigits']?_0x1f21('0x20')+_0x3d1f99[_0x1f21('0x1f')][_0x1f21('0x21')]+'}':_0x1f21('0x22')),'context':_0x52536e[_0x6dceac][0x0][_0x1f21('0x19')],'exten':_0x52536e[_0x6dceac][0x0]['exten'],'priority':_0x3d1f99[_0x1f21('0x12')]++,'VoiceExtensionId':_0x52536e[_0x6dceac][0x0][_0x1f21('0x1a')]});}_0x3d1f99['extensions']['push']({'type':_0x52536e[_0x6dceac][0x0][_0x1f21('0x16')],'app':_0x1f21('0x17'),'appdata':_0x1f21('0x1c')+_0x52536e[_0x6dceac][0x0][_0x1f21('0x1a')],'context':_0x52536e[_0x6dceac][0x0][_0x1f21('0x19')],'exten':_0x52536e[_0x6dceac][0x0][_0x1f21('0xb')],'priority':_0x3d1f99[_0x1f21('0x12')]++,'VoiceExtensionId':_0x52536e[_0x6dceac][0x0]['VoiceExtensionId']});var _0x3f558d=_0x3d1f99['priority']++;_0x3d1f99[_0x1f21('0x13')][_0x1f21('0x15')]({'type':_0x52536e[_0x6dceac][0x0]['type'],'app':_0x1f21('0x23'),'appdata':_0x1f21('0x24')+(_0x3f558d+0x2)+_0x1f21('0x25')+(_0x3f558d+0x1)+')','context':_0x52536e[_0x6dceac][0x0][_0x1f21('0x19')],'exten':_0x52536e[_0x6dceac][0x0][_0x1f21('0xb')],'priority':_0x3f558d,'VoiceExtensionId':_0x52536e[_0x6dceac][0x0][_0x1f21('0x1a')]});if(_0x3d1f99[_0x1f21('0x1f')]){_0x3d1f99[_0x1f21('0x13')][_0x1f21('0x15')]({'type':_0x52536e[_0x6dceac][0x0][_0x1f21('0x16')],'app':'Set','appdata':_0x3d1f99['extension']['cutdigits']?_0x1f21('0x26')+_0x3d1f99[_0x1f21('0x1f')][_0x1f21('0x21')]+'}':_0x1f21('0x27'),'context':_0x52536e[_0x6dceac][0x0][_0x1f21('0x19')],'exten':_0x52536e[_0x6dceac][0x0]['exten'],'priority':_0x3d1f99[_0x1f21('0x12')]++,'VoiceExtensionId':_0x52536e[_0x6dceac][0x0][_0x1f21('0x1a')]});}_0x3d1f99['extensions']['push']({'type':_0x52536e[_0x6dceac][0x0][_0x1f21('0x16')],'app':_0x1f21('0x17'),'appdata':_0x1f21('0x28')+_0x52536e[_0x6dceac][0x0][_0x1f21('0x1a')],'context':_0x52536e[_0x6dceac][0x0][_0x1f21('0x19')],'exten':_0x52536e[_0x6dceac][0x0][_0x1f21('0xb')],'priority':_0x3d1f99[_0x1f21('0x12')]++,'VoiceExtensionId':_0x52536e[_0x6dceac][0x0][_0x1f21('0x1a')]});if(_0x3d1f99[_0x1f21('0x1f')]&&_0x3d1f99[_0x1f21('0x1f')][_0x1f21('0x11')](_0x1f21('0x29'))&&_0x3d1f99[_0x1f21('0x1f')]['recordingFormat']!==_0x1f21('0x2a')){_0x3d1f99[_0x1f21('0x13')][_0x1f21('0x15')]({'type':_0x52536e[_0x6dceac][0x0]['type'],'app':_0x1f21('0x17'),'appdata':_0x1f21('0x2b'),'context':_0x52536e[_0x6dceac][0x0]['context'],'exten':_0x52536e[_0x6dceac][0x0][_0x1f21('0xb')],'priority':_0x3d1f99[_0x1f21('0x12')]++,'VoiceExtensionId':_0x52536e[_0x6dceac][0x0][_0x1f21('0x1a')]});_0x3d1f99['extensions'][_0x1f21('0x15')]({'type':_0x52536e[_0x6dceac][0x0][_0x1f21('0x16')],'app':_0x1f21('0x17'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x3d1f99[_0x1f21('0x1f')][_0x1f21('0x29')]||_0x1f21('0x2c'),'context':_0x52536e[_0x6dceac][0x0][_0x1f21('0x19')],'exten':_0x52536e[_0x6dceac][0x0][_0x1f21('0xb')],'priority':_0x3d1f99[_0x1f21('0x12')]++,'VoiceExtensionId':_0x52536e[_0x6dceac][0x0][_0x1f21('0x1a')]});}}_0x3d1f99['extensions'][_0x1f21('0x15')]({'type':_0x52536e[_0x6dceac][0x0][_0x1f21('0x16')],'app':_0x1f21('0x17'),'appdata':_0x1f21('0x2d'),'context':_0x52536e[_0x6dceac][0x0][_0x1f21('0x19')],'exten':_0x52536e[_0x6dceac][0x0]['exten'],'priority':_0x3d1f99[_0x1f21('0x12')]++,'VoiceExtensionId':_0x52536e[_0x6dceac][0x0]['VoiceExtensionId']});_0x3d1f99[_0x1f21('0x13')][_0x1f21('0x15')]({'type':_0x52536e[_0x6dceac][0x0][_0x1f21('0x16')],'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x52536e[_0x6dceac][0x0][_0x1f21('0x19')],'exten':_0x52536e[_0x6dceac][0x0][_0x1f21('0xb')],'priority':_0x3d1f99[_0x1f21('0x12')]++,'VoiceExtensionId':_0x52536e[_0x6dceac][0x0][_0x1f21('0x1a')]});_0x3d1f99['extensions'][_0x1f21('0x15')]({'type':_0x52536e[_0x6dceac][0x0][_0x1f21('0x16')],'app':'Set','appdata':_0x1f21('0x2e'),'context':_0x52536e[_0x6dceac][0x0][_0x1f21('0x19')],'exten':_0x52536e[_0x6dceac][0x0][_0x1f21('0xb')],'priority':_0x3d1f99[_0x1f21('0x12')]++,'VoiceExtensionId':_0x52536e[_0x6dceac][0x0][_0x1f21('0x1a')]});for(var _0x55396d=0x0,_0x79bc36=0x0;_0x55396d<_0x52536e[_0x6dceac]['length'];_0x55396d+=0x1,_0x79bc36=0x0){var _0x5fb216=_0x52536e[_0x6dceac][_0x55396d];if(_0x5fb216[_0x1f21('0x16')]){_0x5fb216[_0x1f21('0x16')]=_0x5fb216[_0x1f21('0x16')][_0x1f21('0x2f')]();}var _0x5ad21f=[];var _0x22a2cb=[];delete _0x5fb216['id'];delete _0x5fb216['createdAt'];delete _0x5fb216[_0x1f21('0x30')];var _0x15249e=_0x5fb216[_0x1f21('0x31')]!==_0x1f21('0x32')?[_0x5fb216['interval']]:_0x5fb216[_0x1f21('0x7')]?_[_0x1f21('0xa')](_[_0x1f21('0xd')](_0x3d1f99[_0x1f21('0x5')],{'IntervalId':_0x5fb216[_0x1f21('0x7')]}),_0x1f21('0x31')):[];if(_0x5fb216[_0x1f21('0x11')]('tag')){if(_0x5fb216['tag']&&_0x5fb216[_0x1f21('0x33')]!=='--'){_0x5ad21f[_0x1f21('0x15')]({'type':_0x5fb216[_0x1f21('0x16')],'app':'Set','appdata':_0x1f21('0x34')+_0x5fb216[_0x1f21('0x33')],'context':_0x5fb216[_0x1f21('0x19')],'exten':_0x5fb216[_0x1f21('0xb')],'priority':_0x15249e[_0x1f21('0x35')]+_0x3d1f99[_0x1f21('0x12')]+_0x79bc36++,'VoiceExtensionId':_0x5fb216[_0x1f21('0x1a')]});}}if(_0x5fb216[_0x1f21('0x16')]===_0x1f21('0x1d')&&_0x5fb216[_0x1f21('0x11')](_0x1f21('0x36'))){if(_0x5fb216[_0x1f21('0x36')]){_0x5ad21f[_0x1f21('0x15')]({'type':_0x5fb216[_0x1f21('0x16')],'app':'ExecIf','appdata':_0x1f21('0x37')+_0x5fb216[_0x1f21('0x36')]+')','context':_0x5fb216['context'],'exten':_0x5fb216[_0x1f21('0xb')],'priority':_0x15249e[_0x1f21('0x35')]+_0x3d1f99[_0x1f21('0x12')]+_0x79bc36++,'VoiceExtensionId':_0x5fb216[_0x1f21('0x1a')]});}else{_0x5ad21f['push']({'type':_0x5fb216[_0x1f21('0x16')],'app':_0x1f21('0x23'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x5fb216[_0x1f21('0x19')],'exten':_0x5fb216['exten'],'priority':_0x15249e[_0x1f21('0x35')]+_0x3d1f99[_0x1f21('0x12')]+_0x79bc36++,'VoiceExtensionId':_0x5fb216[_0x1f21('0x1a')]});}}if(_0x5fb216[_0x1f21('0x11')](_0x1f21('0x38'))){if(_0x4df0c9[_0x1f21('0x39')](_0x5fb216['app'][_0x1f21('0x2f')]())>=0x0&&_0x5fb216['appType']!==_0x1f21('0x3a')){if(_0x5fb216[_0x1f21('0x38')]){_0x5ad21f[_0x1f21('0x15')]({'type':_0x5fb216['type'],'app':_0x1f21('0x23'),'appdata':_0x1f21('0x3b'),'context':_0x5fb216[_0x1f21('0x19')],'exten':_0x5fb216[_0x1f21('0xb')],'priority':_0x15249e[_0x1f21('0x35')]+_0x3d1f99[_0x1f21('0x12')]+_0x79bc36++,'VoiceExtensionId':_0x5fb216['VoiceExtensionId']});_0x5ad21f[_0x1f21('0x15')]({'type':_0x5fb216[_0x1f21('0x16')],'app':_0x1f21('0x17'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x5fb216[_0x1f21('0x19')],'exten':_0x5fb216['exten'],'priority':_0x15249e['length']+_0x3d1f99[_0x1f21('0x12')]+_0x79bc36++,'VoiceExtensionId':_0x5fb216['VoiceExtensionId']});}else{_0x5ad21f[_0x1f21('0x15')]({'type':_0x5fb216[_0x1f21('0x16')],'app':_0x1f21('0x23'),'appdata':_0x1f21('0x3c'),'context':_0x5fb216[_0x1f21('0x19')],'exten':_0x5fb216[_0x1f21('0xb')],'priority':_0x15249e[_0x1f21('0x35')]+_0x3d1f99[_0x1f21('0x12')]+_0x79bc36++,'VoiceExtensionId':_0x5fb216[_0x1f21('0x1a')]});_0x5ad21f[_0x1f21('0x15')]({'type':_0x5fb216[_0x1f21('0x16')],'app':_0x1f21('0x17'),'appdata':_0x1f21('0x3d'),'context':_0x5fb216[_0x1f21('0x19')],'exten':_0x5fb216[_0x1f21('0xb')],'priority':_0x15249e['length']+_0x3d1f99[_0x1f21('0x12')]+_0x79bc36++,'VoiceExtensionId':_0x5fb216['VoiceExtensionId']});}}}for(var _0x362eec=0x0;_0x362eec<_0x15249e[_0x1f21('0x35')];_0x362eec+=0x1){var _0x562296=_0x3d1f99[_0x1f21('0x12')]+_0x15249e[_0x1f21('0x35')];var _0x4a6af0=_0x362eec===_0x15249e['length']-0x1?_0x3d1f99[_0x1f21('0x12')]+_0x5ad21f[_0x1f21('0x35')]+_0x22a2cb[_0x1f21('0x35')]+0x2:_0x3d1f99[_0x1f21('0x12')]+_0x362eec+0x1;_0x5ad21f[_0x1f21('0x3e')](_0x362eec,0x0,{'type':_0x5fb216['type'],'app':_0x1f21('0x3f'),'appdata':_0x15249e[_0x362eec]+'?'+_0x5fb216[_0x1f21('0x19')]+_0x1f21('0x40')+_0x562296+':'+_0x5fb216['context']+_0x1f21('0x40')+_0x4a6af0,'exten':_0x5fb216[_0x1f21('0xb')],'context':_0x5fb216[_0x1f21('0x19')],'priority':_0x3d1f99['priority']+_0x362eec,'VoiceExtensionId':_0x52536e[_0x6dceac][0x0]['VoiceExtensionId']});}_0x5fb216[_0x1f21('0x12')]=_0x5ad21f['length']?_[_0x1f21('0x41')](_0x5ad21f)['priority']+0x1:_0x3d1f99[_0x1f21('0x12')];_0x3d1f99[_0x1f21('0x12')]=(_0x22a2cb[_0x1f21('0x35')]?_[_0x1f21('0x41')](_0x22a2cb)[_0x1f21('0x12')]:_0x5fb216[_0x1f21('0x12')])+0x1;_0x3d1f99[_0x1f21('0x13')]=_[_0x1f21('0x42')](_0x3d1f99[_0x1f21('0x13')],_0x5ad21f,[_0x5fb216],_0x22a2cb);}_0x3d1f99[_0x1f21('0x13')][_0x1f21('0x15')]({'type':_0x52536e[_0x6dceac][0x0]['type'],'app':_0x1f21('0x43'),'exten':_0x52536e[_0x6dceac][0x0]['exten'],'context':_0x52536e[_0x6dceac][0x0]['context'],'priority':_0x3d1f99[_0x1f21('0x12')],'VoiceExtensionId':_0x52536e[_0x6dceac][0x0]['VoiceExtensionId']});_0x2849be[_0x1f21('0x15')](_0x52536e[_0x6dceac][0x0][_0x1f21('0x1a')]);_0xc38d88=_[_0x1f21('0x42')](_0xc38d88,_0x3d1f99[_0x1f21('0x13')]);}}return _0x2b4ee0[_0x1f21('0x44')](function(_0x2028b8){return _0x2b4ee0[_0x1f21('0x2')][_0x1f21('0x6')][_0x1f21('0x45')]({'where':{'VoiceExtensionId':{'$in':_0x2849be}},'transaction':_0x2028b8})[_0x1f21('0x8')](function(_0x20976e){return _0x2b4ee0[_0x1f21('0x2')][_0x1f21('0x6')][_0x1f21('0x46')](_[_0x1f21('0x47')](_0xc38d88,_0x1f21('0x12')),{'transaction':_0x2028b8});});});})[_0x1f21('0x48')](function(_0x47e556){console[_0x1f21('0x49')](_0x47e556);});}exports[_0x1f21('0x4a')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 56c3440..5a1ba72 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 _0x6fb6=['message','cmContact','checkHopper','inspect','insert','into','cm_hopper','fromQuery','scheduledAt','ListId','updatedAt','field','NOW()','ContactId','toString','cm_contacts','where','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','\x20=\x20?','createdAt','from','id\x20IN\x20?','cm_hopper_final','str','cm_hopper_black','deletedAt\x20IS\x20NULL','VoiceQueue','outbound','dialCheckDuplicateType','CmList','then','always','sequelize','query','VoiceQueueId','findAll','get','all','Campaign','Lists','CampaignId','BlackLists','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','contact:csv_','resume','emit','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','stringify','info','CSV\x20import\x20process\x20stopped!','createReadStream','parse','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','lodash','squel','ioredis','../../../config/environment','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','undefined','Missing\x20socket_timestamp\x20parameter!','error','index','test','isNil','errors','map','join','hasOwnProperty','data','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','CompanyId','length','find','duplicate','CmContact','create','push','pick','catch','Error\x20while\x20creating\x20contact:\x20'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6fb6,0x11c));var _0x66fb=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0x6fb6[_0x481bf7];return _0x461787;};'use strict';var BPromise=require(_0x66fb('0x0'));var util=require('util');var _=require(_0x66fb('0x1'));var fs=require('fs');var squel=require(_0x66fb('0x2'));var Papa=require('papaparse');var Redis=require(_0x66fb('0x3'));var db=require('../../../mysqldb')['db'];var config=require(_0x66fb('0x4'));var logger=require(_0x66fb('0x5'))(_0x66fb('0x6'));config[_0x66fb('0x7')]=_[_0x66fb('0x8')](config[_0x66fb('0x7')],{'host':_0x66fb('0x9'),'port':0x18eb});var socket=require(_0x66fb('0xa'))(new Redis(config['redis']));require(_0x66fb('0xb'))[_0x66fb('0xc')](socket);try{if(!process[_0x66fb('0xd')][0x2]||process['argv'][0x2]==='undefined'||process[_0x66fb('0xd')][0x2]===_0x66fb('0xe')){throw new Error(_0x66fb('0xf'));}var FILEPATH=process[_0x66fb('0xd')][0x2];if(!process[_0x66fb('0xd')][0x3]||process['argv'][0x3]==='undefined'||process[_0x66fb('0xd')][0x3]===_0x66fb('0xe')||!process[_0x66fb('0xd')][0x4]||process[_0x66fb('0xd')][0x4]==='undefined'||process[_0x66fb('0xd')][0x4]===_0x66fb('0xe')){throw new Error(_0x66fb('0x10'));}var FIELDS=_[_0x66fb('0x11')](process[_0x66fb('0xd')][0x3][_0x66fb('0x12')](','),process[_0x66fb('0xd')][0x4][_0x66fb('0x12')](','));if(!process[_0x66fb('0xd')][0x5]||process[_0x66fb('0xd')][0x5]===_0x66fb('0x13')||process[_0x66fb('0xd')][0x5]===_0x66fb('0xe')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process[_0x66fb('0xd')][0x5];var COMPANYID=process[_0x66fb('0xd')][0x6]&&process[_0x66fb('0xd')][0x6]!==_0x66fb('0x13')&&process[_0x66fb('0xd')][0x6]!==_0x66fb('0xe')?process['argv'][0x6]:null;var DUPLICATES=process[_0x66fb('0xd')][0x7]&&process[_0x66fb('0xd')][0x7]!==_0x66fb('0x13')&&process[_0x66fb('0xd')][0x7]!==_0x66fb('0xe')?process['argv'][0x7]:null;if(!process[_0x66fb('0xd')][0x8]||process[_0x66fb('0xd')][0x8]==='undefined'||process[_0x66fb('0xd')][0x8]===_0x66fb('0xe')){throw new Error(_0x66fb('0x14'));}var SOCKET_TIMESTAMP=process[_0x66fb('0xd')][0x8];}catch(_0x214570){logger[_0x66fb('0x15')](_0x214570);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(_0x4eb4d3,_0x275673,_0x58cbc5,_0x471f7c){var _0x401197={'message':_0x275673};_0x401197[_0x4eb4d3]=!![];if(_0x58cbc5){_0x401197['contact']=_0x58cbc5;}if(_0x471f7c){_0x401197[_0x66fb('0x16')]=_0x471f7c;}return _0x401197;}function isEmail(_0x38cae9){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))*$/[_0x66fb('0x17')](_0x38cae9);}function checkRow(_0x27963d,_0x5019e4,_0x3a0616){return new BPromise(function(_0x5377d2,_0x433ba9){if(_[_0x66fb('0x18')](_0x27963d)){return _0x433ba9(handleCheckRowError(_0x66fb('0x15'),'The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x3a0616));}if(_0x27963d[_0x66fb('0x19')]&&_0x27963d[_0x66fb('0x19')]['length']){var _0x4991bb=_[_0x66fb('0x1a')](_0x27963d[_0x66fb('0x19')],'message')[_0x66fb('0x1b')](';');return _0x433ba9(handleCheckRowError('error',_0x4991bb,null,_0x3a0616));}var _0x5277e9={};for(var _0x5cded9 in FIELDS){if(FIELDS[_0x66fb('0x1c')](_0x5cded9)&&FIELDS[_0x5cded9]){_0x5277e9[_0x5cded9]=_0x27963d['data'][0x0][FIELDS[_0x5cded9]]||_0x27963d[_0x66fb('0x1d')][0x0]['\ufeff'+FIELDS[_0x5cded9]];}}if(!_0x5277e9['firstName']){return _0x433ba9(handleCheckRowError(_0x66fb('0x15'),_0x66fb('0x1e'),null,_0x3a0616));}if(!_0x5277e9[_0x66fb('0x1f')]){return _0x433ba9(handleCheckRowError(_0x66fb('0x15'),_0x66fb('0x20'),null,_0x3a0616));}if(_0x5277e9['birthDate']){var _0x47df90=moment(_0x5277e9[_0x66fb('0x21')],_0x66fb('0x22'));if(!_0x47df90[_0x66fb('0x23')]()){return _0x433ba9(handleCheckRowError('error',_0x66fb('0x24'),null,_0x3a0616));}}if(_0x5277e9[_0x66fb('0x25')]){if(!isEmail(_0x5277e9['email'])){return _0x433ba9(handleCheckRowError(_0x66fb('0x15'),_0x66fb('0x26'),null,_0x3a0616));}}_0x5277e9['ListId']=LISTID;_0x5277e9[_0x66fb('0x27')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x5019e4){var _0x54d02c={};for(var _0x46d335=0x0,_0x576421=DUPLICATES[_0x66fb('0x28')];_0x46d335<_0x576421;_0x46d335+=0x1){_0x54d02c[DUPLICATES[_0x46d335]]=_0x5277e9[DUPLICATES[_0x46d335]];}var _0x2a2158=_[_0x66fb('0x29')](_0x5019e4,_0x54d02c);if(_0x2a2158){return _0x433ba9(handleCheckRowError(_0x66fb('0x2a'),'Duplicate\x20Contact',_0x2a2158,_0x3a0616));}}return db[_0x66fb('0x2b')][_0x66fb('0x2c')](_0x5277e9,{'raw':!![],'hooks':![],'fields':_['keys'](_0x5277e9)})['then'](function(_0x4f04b4){if(DUPLICATES&&DUPLICATES[_0x66fb('0x28')]&&_0x5019e4){_0x5019e4[_0x66fb('0x2d')](_[_0x66fb('0x2e')](_0x5277e9,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x4f04b4['id'];return _0x5377d2();})[_0x66fb('0x2f')](function(_0x39bc7b){return _0x433ba9(handleCheckRowError(_0x66fb('0x15'),_0x66fb('0x30')+(_0x39bc7b[_0x66fb('0x31')]||JSON['stringify'](_0x39bc7b)),null,_0x3a0616));});});}function checkHopper(){function _0x27c1e3(){return function(_0x244861){logger[_0x66fb('0x15')](_0x66fb('0x32'),_0x66fb('0x33'),util[_0x66fb('0x34')](_0x244861,{'showHidden':![],'depth':null}));};}var _0xc9721e=function(_0x5adc24,_0x23d0fb){var _0x26c8e1=squel[_0x66fb('0x35')]()[_0x66fb('0x36')](_0x66fb('0x37'))[_0x66fb('0x38')]([_0x66fb('0x1f'),_0x66fb('0x39'),'ContactId',_0x66fb('0x3a'),_0x23d0fb,'createdAt',_0x66fb('0x3b')],squel['select']()['field'](_0x66fb('0x1f'),_0x66fb('0x1f'))[_0x66fb('0x3c')](_0x66fb('0x3d'),_0x66fb('0x39'))['field']('id',_0x66fb('0x3e'))[_0x66fb('0x3c')](LISTID[_0x66fb('0x3f')](),_0x66fb('0x3a'))[_0x66fb('0x3c')](_0x5adc24['id'][_0x66fb('0x3f')](),_0x23d0fb)[_0x66fb('0x3c')](_0x66fb('0x3d'),'createdAt')[_0x66fb('0x3c')]('NOW()',_0x66fb('0x3b'))['from'](_0x66fb('0x40'))[_0x66fb('0x41')]('deletedAt\x20IS\x20NULL')[_0x66fb('0x41')](_0x66fb('0x42'),LISTID[_0x66fb('0x3f')]())[_0x66fb('0x41')](_0x66fb('0x43'))['where'](_0x66fb('0x44'),squel[_0x66fb('0x45')]()[_0x66fb('0x3c')]('phone')['from'](_0x66fb('0x37'))['where'](_0x23d0fb+_0x66fb('0x46'),_0x5adc24['id'][_0x66fb('0x3f')]())))[_0x66fb('0x3f')]();return _0x26c8e1;};var _0x524b18=function(_0x45d173,_0x56ef3b){var _0xe0d68d=squel[_0x66fb('0x35')]()['into'](_0x66fb('0x37'))['fromQuery']([_0x66fb('0x1f'),_0x66fb('0x39'),'ContactId',_0x66fb('0x3a'),_0x56ef3b,_0x66fb('0x47'),_0x66fb('0x3b')],squel['select']()[_0x66fb('0x3c')](_0x66fb('0x1f'),'phone')[_0x66fb('0x3c')]('NOW()',_0x66fb('0x39'))[_0x66fb('0x3c')]('id','ContactId')[_0x66fb('0x3c')](LISTID[_0x66fb('0x3f')](),_0x66fb('0x3a'))[_0x66fb('0x3c')](_0x45d173['id'][_0x66fb('0x3f')](),_0x56ef3b)[_0x66fb('0x3c')]('NOW()',_0x66fb('0x47'))[_0x66fb('0x3c')]('NOW()','updatedAt')[_0x66fb('0x48')](_0x66fb('0x40'))['where']('deletedAt\x20IS\x20NULL')['where'](_0x66fb('0x42'),LISTID[_0x66fb('0x3f')]())['where'](_0x66fb('0x49'),squel['str'](hopperContacts))[_0x66fb('0x41')](_0x66fb('0x43'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x66fb('0x45')]()[_0x66fb('0x3c')]('calleridnum')[_0x66fb('0x48')](_0x66fb('0x4a'))['where'](_0x56ef3b+_0x66fb('0x46'),_0x45d173['id'][_0x66fb('0x3f')]()))['where'](_0x66fb('0x44'),squel['select']()[_0x66fb('0x3c')](_0x66fb('0x1f'))['from'](_0x66fb('0x37'))[_0x66fb('0x41')](_0x56ef3b+'\x20=\x20?',_0x45d173['id']['toString']())))[_0x66fb('0x3f')]();return _0xe0d68d;};function _0x58d22a(_0x2287b8,_0x112223){var _0x212a10=squel[_0x66fb('0x35')]()[_0x66fb('0x36')]('cm_hopper')[_0x66fb('0x38')](['phone',_0x66fb('0x39'),_0x66fb('0x3e'),_0x66fb('0x3a'),_0x112223,_0x66fb('0x47'),_0x66fb('0x3b')],squel[_0x66fb('0x45')]()[_0x66fb('0x3c')](_0x66fb('0x1f'),_0x66fb('0x1f'))[_0x66fb('0x3c')](_0x66fb('0x3d'),'scheduledAt')[_0x66fb('0x3c')]('id',_0x66fb('0x3e'))[_0x66fb('0x3c')](LISTID[_0x66fb('0x3f')](),_0x66fb('0x3a'))[_0x66fb('0x3c')](_0x2287b8['id'][_0x66fb('0x3f')](),_0x112223)[_0x66fb('0x3c')](_0x66fb('0x3d'),'createdAt')[_0x66fb('0x3c')](_0x66fb('0x3d'),_0x66fb('0x3b'))[_0x66fb('0x48')]('cm_contacts')[_0x66fb('0x41')]('deletedAt\x20IS\x20NULL')[_0x66fb('0x41')](_0x66fb('0x42'),LISTID[_0x66fb('0x3f')]())[_0x66fb('0x41')](_0x66fb('0x49'),squel[_0x66fb('0x4b')](hopperContacts))[_0x66fb('0x41')](_0x66fb('0x43')))[_0x66fb('0x3f')]();return _0x212a10;}function _0x35cb5a(_0x3cc49d,_0xdaea94){var _0x388b27=squel[_0x66fb('0x35')]()[_0x66fb('0x36')](_0x66fb('0x4c'))[_0x66fb('0x38')]([_0x66fb('0x1f'),_0x66fb('0x3e'),'ListId',_0xdaea94,_0x66fb('0x47'),_0x66fb('0x3b')],squel[_0x66fb('0x45')]()['field'](_0x66fb('0x1f'),_0x66fb('0x1f'))[_0x66fb('0x3c')]('id',_0x66fb('0x3e'))[_0x66fb('0x3c')](LISTID[_0x66fb('0x3f')](),_0x66fb('0x3a'))[_0x66fb('0x3c')](_0x3cc49d['id'][_0x66fb('0x3f')](),_0xdaea94)[_0x66fb('0x3c')](_0x66fb('0x3d'),'createdAt')[_0x66fb('0x3c')](_0x66fb('0x3d'),_0x66fb('0x3b'))['from'](_0x66fb('0x40'))[_0x66fb('0x41')](_0x66fb('0x4d'))[_0x66fb('0x41')](_0x66fb('0x42'),LISTID['toString']())[_0x66fb('0x41')](_0x66fb('0x49'),squel['str'](hopperContacts))[_0x66fb('0x41')](_0x66fb('0x43')))[_0x66fb('0x3f')]();return _0x388b27;}return db[_0x66fb('0x4e')]['findAll']({'where':{'type':_0x66fb('0x4f')},'attributes':['id',_0x66fb('0x50')],'include':[{'model':db[_0x66fb('0x51')],'as':'Lists','where':{'id':LISTID}}]})[_0x66fb('0x52')](function(_0x34b551){var _0x443c9e=[];if(_0x34b551){var _0x571c88;for(var _0x202892=0x0,_0x507994;_0x202892<_0x34b551[_0x66fb('0x28')];_0x202892+=0x1){_0x507994=_0x34b551[_0x202892]['get']({'plain':!![]});switch(_0x507994[_0x66fb('0x50')]){case _0x66fb('0x53'):_0x443c9e['push'](db[_0x66fb('0x54')][_0x66fb('0x55')](_0x524b18(_0x507994,'VoiceQueueId'))[_0x66fb('0x52')](function(){})[_0x66fb('0x2f')](_0x27c1e3()));break;case'onlyIfOpen':_0x443c9e[_0x66fb('0x2d')](db['sequelize'][_0x66fb('0x55')](_0xc9721e(_0x507994,_0x66fb('0x56')))['then'](function(){})['catch'](_0x27c1e3()));break;default:_0x443c9e[_0x66fb('0x2d')](db['sequelize'][_0x66fb('0x55')](_0x58d22a(_0x507994,'VoiceQueueId'))[_0x66fb('0x52')](function(){})[_0x66fb('0x2f')](_0x27c1e3()));}}}return _0x443c9e;})['all']()['then'](function(){return db['VoiceQueue'][_0x66fb('0x57')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db[_0x66fb('0x51')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x66fb('0x52')](function(_0x2dc4b0){var _0x5d9a53=[];if(_0x2dc4b0){var _0x3a8639;for(var _0x18db8f=0x0,_0x3efcfa;_0x18db8f<_0x2dc4b0['length'];_0x18db8f+=0x1){_0x3efcfa=_0x2dc4b0[_0x18db8f][_0x66fb('0x58')]({'plain':!![]});_0x5d9a53['push'](db[_0x66fb('0x54')]['query'](_0x35cb5a(_0x3efcfa,_0x66fb('0x56')))[_0x66fb('0x52')](function(){})[_0x66fb('0x2f')](_0x27c1e3()));}}return _0x5d9a53;})[_0x66fb('0x59')]();})[_0x66fb('0x52')](function(){return db[_0x66fb('0x5a')]['findAll']({'attributes':['id',_0x66fb('0x50')],'include':[{'model':db['CmList'],'as':_0x66fb('0x5b'),'where':{'id':LISTID}}]})['then'](function(_0x4c832f){var _0x1b03c0=[];if(_0x4c832f){for(var _0x54f916=0x0,_0x2d6005;_0x54f916<_0x4c832f[_0x66fb('0x28')];_0x54f916+=0x1){_0x2d6005=_0x4c832f[_0x54f916][_0x66fb('0x58')]({'plain':!![]});switch(_0x2d6005[_0x66fb('0x50')]){case'always':_0x1b03c0[_0x66fb('0x2d')](db[_0x66fb('0x54')][_0x66fb('0x55')](_0x524b18(_0x2d6005,_0x66fb('0x5c')))[_0x66fb('0x52')](function(){})[_0x66fb('0x2f')](_0x27c1e3()));break;case'onlyIfOpen':_0x1b03c0['push'](db[_0x66fb('0x54')][_0x66fb('0x55')](_0xc9721e(_0x2d6005,_0x66fb('0x5c')))[_0x66fb('0x52')](function(){})[_0x66fb('0x2f')](_0x27c1e3()));break;default:_0x1b03c0['push'](db['sequelize'][_0x66fb('0x55')](_0x58d22a(_0x2d6005,'CampaignId'))['then'](function(){})['catch'](_0x27c1e3()));}}}return _0x1b03c0;})['all']();})[_0x66fb('0x52')](function(){return db['Campaign'][_0x66fb('0x57')]({'attributes':['id'],'include':[{'model':db[_0x66fb('0x51')],'as':_0x66fb('0x5d'),'where':{'id':LISTID}}]})[_0x66fb('0x52')](function(_0x27cf78){var _0x474a16=[];if(_0x27cf78){for(var _0x164564=0x0,_0x339dd3;_0x164564<_0x27cf78[_0x66fb('0x28')];_0x164564+=0x1){_0x339dd3=_0x27cf78[_0x164564][_0x66fb('0x58')]({'plain':!![]});_0x474a16[_0x66fb('0x2d')](db[_0x66fb('0x54')][_0x66fb('0x55')](_0x35cb5a(_0x339dd3,_0x66fb('0x5c')))[_0x66fb('0x52')](function(){})[_0x66fb('0x2f')](_0x27c1e3()));}}return _0x474a16;})[_0x66fb('0x59')]();})[_0x66fb('0x2f')](function(_0x50286f){logger['error']('cmContact,\x20%s,\x20%s',_0x66fb('0x5e'),_0x50286f[_0x66fb('0x31')]);});}var processPromises=function(_0x13d357){return BPromise[_0x66fb('0x59')](promises)[_0x66fb('0x52')](function(_0x115ce4){})['catch'](function(_0x4fd848){logger[_0x66fb('0x15')](_0x66fb('0x5f'),JSON['stringify'](_0x4fd848));})[_0x66fb('0x60')](function(){socket['emit'](_0x66fb('0x61')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x13d357){return _0x13d357[_0x66fb('0x62')]();}});};var endCsv=function(){return BPromise['resolve']()['then'](function(){if(hopperContacts){return checkHopper();}})[_0x66fb('0x52')](function(){socket[_0x66fb('0x63')](_0x66fb('0x61')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x66fb('0x64')](FILEPATH);}catch(_0x430186){logger['error'](_0x66fb('0x65'),JSON[_0x66fb('0x66')](_0x430186));}finally{process['exit'](0x0);}});};process['on']('SIGINT',function(){logger[_0x66fb('0x67')](_0x66fb('0x68'));endCsv();});function main(){return BPromise['resolve']()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x66fb('0x12')](',');return db['CmContact'][_0x66fb('0x57')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x66fb('0x52')](function(_0x3873ca){var _0x522d56=fs[_0x66fb('0x69')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x66fb('0x6a')](_0x522d56,{'header':!![],'skipEmptyLines':!![],'step':function(_0x1efe2f,_0x14a3b4){total+=0x1;var _0x357c11=total;promises[_0x66fb('0x2d')](checkRow(_0x1efe2f,_0x3873ca,_0x357c11)['then'](function(){success+=0x1;})[_0x66fb('0x2f')](function(_0x124d4a){if(_0x124d4a[_0x66fb('0x15')]){errors+=0x1;delete _0x124d4a['error'];}else if(_0x124d4a[_0x66fb('0x2a')]){duplicates+=0x1;delete _0x124d4a[_0x66fb('0x2a')];}rows[_0x66fb('0x2d')](_0x124d4a);}));if(total%0xc8===0x0){_0x14a3b4[_0x66fb('0x6b')]();return processPromises(_0x14a3b4);}},'complete':function(){return processPromises()[_0x66fb('0x52')](function(){logger[_0x66fb('0x67')](_0x66fb('0x6c'));endCsv();});},'error':function(_0x3e6c85,_0x203668){logger[_0x66fb('0x67')](_0x66fb('0x6d'),JSON[_0x66fb('0x66')](_0x3e6c85));endCsv();}});})[_0x66fb('0x2f')](function(_0x179849){logger[_0x66fb('0x15')](_0x66fb('0x6e'),JSON[_0x66fb('0x66')](_0x179849));});}main(); \ No newline at end of file +var _0x1953=['contact:csv_','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','createReadStream','parse','duplicate','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','util','lodash','ioredis','../../../config/environment','../../../config/logger','api','redis','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','zipObject','split','Missing\x20socket_timestamp\x20parameter!','error','contact','index','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','message','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','Duplicate\x20Contact','create','keys','then','push','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','inspect','insert','into','fromQuery','ContactId','createdAt','updatedAt','select','field','NOW()','scheduledAt','toString','from','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper','cm_contacts','id\x20IN\x20?','str','cm_hopper_final','\x20=\x20?','findAll','outbound','dialCheckDuplicateType','CmList','query','VoiceQueueId','onlyIfOpen','sequelize','all','VoiceQueue','BlackLists','get','Campaign','Lists','CampaignId','Error\x20processing\x20rows\x20block:','finally','emit','resume','resolve'];(function(_0x14e9a5,_0x3f2840){var _0x56b6c7=function(_0x25b24d){while(--_0x25b24d){_0x14e9a5['push'](_0x14e9a5['shift']());}};_0x56b6c7(++_0x3f2840);}(_0x1953,0xe6));var _0x3195=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x1953[_0x17d9e3];return _0x14192d;};'use strict';var BPromise=require('bluebird');var util=require(_0x3195('0x0'));var _=require(_0x3195('0x1'));var fs=require('fs');var squel=require('squel');var Papa=require('papaparse');var Redis=require(_0x3195('0x2'));var db=require('../../../mysqldb')['db'];var config=require(_0x3195('0x3'));var logger=require(_0x3195('0x4'))(_0x3195('0x5'));config[_0x3195('0x6')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x3195('0x7'))(new Redis(config[_0x3195('0x6')]));require(_0x3195('0x8'))[_0x3195('0x9')](socket);try{if(!process[_0x3195('0xa')][0x2]||process[_0x3195('0xa')][0x2]===_0x3195('0xb')||process['argv'][0x2]===_0x3195('0xc')){throw new Error(_0x3195('0xd'));}var FILEPATH=process[_0x3195('0xa')][0x2];if(!process[_0x3195('0xa')][0x3]||process[_0x3195('0xa')][0x3]===_0x3195('0xb')||process[_0x3195('0xa')][0x3]===_0x3195('0xc')||!process[_0x3195('0xa')][0x4]||process[_0x3195('0xa')][0x4]===_0x3195('0xb')||process['argv'][0x4]==='null'){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_[_0x3195('0xe')](process[_0x3195('0xa')][0x3][_0x3195('0xf')](','),process[_0x3195('0xa')][0x4][_0x3195('0xf')](','));if(!process[_0x3195('0xa')][0x5]||process['argv'][0x5]===_0x3195('0xb')||process[_0x3195('0xa')][0x5]===_0x3195('0xc')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process[_0x3195('0xa')][0x5];var COMPANYID=process[_0x3195('0xa')][0x6]&&process[_0x3195('0xa')][0x6]!==_0x3195('0xb')&&process[_0x3195('0xa')][0x6]!==_0x3195('0xc')?process[_0x3195('0xa')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0x3195('0xa')][0x7]!==_0x3195('0xb')&&process['argv'][0x7]!==_0x3195('0xc')?process[_0x3195('0xa')][0x7]:null;if(!process[_0x3195('0xa')][0x8]||process[_0x3195('0xa')][0x8]===_0x3195('0xb')||process[_0x3195('0xa')][0x8]==='null'){throw new Error(_0x3195('0x10'));}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x5ab199){logger[_0x3195('0x11')](_0x5ab199);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(_0x42b190,_0x3992aa,_0x28e6c6,_0x15464f){var _0x3b3432={'message':_0x3992aa};_0x3b3432[_0x42b190]=!![];if(_0x28e6c6){_0x3b3432[_0x3195('0x12')]=_0x28e6c6;}if(_0x15464f){_0x3b3432[_0x3195('0x13')]=_0x15464f;}return _0x3b3432;}function isEmail(_0x421679){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'](_0x421679);}function checkRow(_0x26d14b,_0x2cc020,_0x52281a){return new BPromise(function(_0x24e213,_0x5940b7){if(_['isNil'](_0x26d14b)){return _0x5940b7(handleCheckRowError(_0x3195('0x11'),_0x3195('0x14'),null,_0x52281a));}if(_0x26d14b[_0x3195('0x15')]&&_0x26d14b[_0x3195('0x15')][_0x3195('0x16')]){var _0xbdfa2=_['map'](_0x26d14b[_0x3195('0x15')],_0x3195('0x17'))[_0x3195('0x18')](';');return _0x5940b7(handleCheckRowError(_0x3195('0x11'),_0xbdfa2,null,_0x52281a));}var _0xc54091={};for(var _0x59a805 in FIELDS){if(FIELDS[_0x3195('0x19')](_0x59a805)&&FIELDS[_0x59a805]){_0xc54091[_0x59a805]=_0x26d14b['data'][0x0][FIELDS[_0x59a805]]||_0x26d14b[_0x3195('0x1a')][0x0]['\ufeff'+FIELDS[_0x59a805]];}}if(!_0xc54091[_0x3195('0x1b')]){return _0x5940b7(handleCheckRowError('error',_0x3195('0x1c'),null,_0x52281a));}if(!_0xc54091[_0x3195('0x1d')]){return _0x5940b7(handleCheckRowError('error',_0x3195('0x1e'),null,_0x52281a));}if(_0xc54091[_0x3195('0x1f')]){var _0x5a27b0=moment(_0xc54091[_0x3195('0x1f')],_0x3195('0x20'));if(!_0x5a27b0[_0x3195('0x21')]()){return _0x5940b7(handleCheckRowError(_0x3195('0x11'),_0x3195('0x22'),null,_0x52281a));}}if(_0xc54091['email']){if(!isEmail(_0xc54091[_0x3195('0x23')])){return _0x5940b7(handleCheckRowError(_0x3195('0x11'),_0x3195('0x24'),null,_0x52281a));}}_0xc54091[_0x3195('0x25')]=LISTID;_0xc54091[_0x3195('0x26')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x3195('0x16')]&&_0x2cc020){var _0x1d9a45={};for(var _0x4a3159=0x0,_0x719d1c=DUPLICATES['length'];_0x4a3159<_0x719d1c;_0x4a3159+=0x1){_0x1d9a45[DUPLICATES[_0x4a3159]]=_0xc54091[DUPLICATES[_0x4a3159]];}var _0x33be9e=_[_0x3195('0x27')](_0x2cc020,_0x1d9a45);if(_0x33be9e){return _0x5940b7(handleCheckRowError('duplicate',_0x3195('0x28'),_0x33be9e,_0x52281a));}}return db['CmContact'][_0x3195('0x29')](_0xc54091,{'raw':!![],'hooks':![],'fields':_[_0x3195('0x2a')](_0xc54091)})[_0x3195('0x2b')](function(_0x599607){if(DUPLICATES&&DUPLICATES[_0x3195('0x16')]&&_0x2cc020){_0x2cc020[_0x3195('0x2c')](_['pick'](_0xc54091,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x599607['id'];return _0x24e213();})[_0x3195('0x2d')](function(_0x28923f){return _0x5940b7(handleCheckRowError(_0x3195('0x11'),_0x3195('0x2e')+(_0x28923f[_0x3195('0x17')]||JSON[_0x3195('0x2f')](_0x28923f)),null,_0x52281a));});});}function checkHopper(){function _0x560865(){return function(_0x104338){logger[_0x3195('0x11')](_0x3195('0x30'),_0x3195('0x31'),util[_0x3195('0x32')](_0x104338,{'showHidden':![],'depth':null}));};}var _0x31490b=function(_0x2dedfa,_0x2ba332){var _0x4f6b79=squel[_0x3195('0x33')]()[_0x3195('0x34')]('cm_hopper')[_0x3195('0x35')]([_0x3195('0x1d'),'scheduledAt',_0x3195('0x36'),'ListId',_0x2ba332,_0x3195('0x37'),_0x3195('0x38')],squel[_0x3195('0x39')]()[_0x3195('0x3a')]('phone','phone')['field'](_0x3195('0x3b'),_0x3195('0x3c'))[_0x3195('0x3a')]('id',_0x3195('0x36'))[_0x3195('0x3a')](LISTID[_0x3195('0x3d')](),_0x3195('0x25'))[_0x3195('0x3a')](_0x2dedfa['id'][_0x3195('0x3d')](),_0x2ba332)['field'](_0x3195('0x3b'),'createdAt')[_0x3195('0x3a')](_0x3195('0x3b'),_0x3195('0x38'))[_0x3195('0x3e')]('cm_contacts')[_0x3195('0x3f')](_0x3195('0x40'))[_0x3195('0x3f')](_0x3195('0x41'),LISTID['toString']())[_0x3195('0x3f')](_0x3195('0x42'))[_0x3195('0x3f')](_0x3195('0x43'),squel[_0x3195('0x39')]()[_0x3195('0x3a')](_0x3195('0x1d'))[_0x3195('0x3e')]('cm_hopper')[_0x3195('0x3f')](_0x2ba332+'\x20=\x20?',_0x2dedfa['id'][_0x3195('0x3d')]())))[_0x3195('0x3d')]();return _0x4f6b79;};var _0x309bcd=function(_0x6c8a96,_0xc38eb0){var _0x46fd23=squel['insert']()['into'](_0x3195('0x44'))[_0x3195('0x35')]([_0x3195('0x1d'),_0x3195('0x3c'),'ContactId','ListId',_0xc38eb0,_0x3195('0x37'),_0x3195('0x38')],squel['select']()[_0x3195('0x3a')](_0x3195('0x1d'),_0x3195('0x1d'))[_0x3195('0x3a')](_0x3195('0x3b'),_0x3195('0x3c'))[_0x3195('0x3a')]('id','ContactId')[_0x3195('0x3a')](LISTID[_0x3195('0x3d')](),_0x3195('0x25'))['field'](_0x6c8a96['id'][_0x3195('0x3d')](),_0xc38eb0)[_0x3195('0x3a')](_0x3195('0x3b'),'createdAt')[_0x3195('0x3a')](_0x3195('0x3b'),_0x3195('0x38'))[_0x3195('0x3e')](_0x3195('0x45'))[_0x3195('0x3f')](_0x3195('0x40'))[_0x3195('0x3f')]('ListId\x20=\x20?',LISTID[_0x3195('0x3d')]())[_0x3195('0x3f')](_0x3195('0x46'),squel[_0x3195('0x47')](hopperContacts))[_0x3195('0x3f')](_0x3195('0x42'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x3195('0x39')]()[_0x3195('0x3a')]('calleridnum')[_0x3195('0x3e')](_0x3195('0x48'))[_0x3195('0x3f')](_0xc38eb0+_0x3195('0x49'),_0x6c8a96['id'][_0x3195('0x3d')]()))[_0x3195('0x3f')](_0x3195('0x43'),squel[_0x3195('0x39')]()[_0x3195('0x3a')](_0x3195('0x1d'))[_0x3195('0x3e')](_0x3195('0x44'))['where'](_0xc38eb0+_0x3195('0x49'),_0x6c8a96['id'][_0x3195('0x3d')]())))[_0x3195('0x3d')]();return _0x46fd23;};function _0x3894e7(_0x553ce8,_0x32bd1a){var _0x56498e=squel[_0x3195('0x33')]()[_0x3195('0x34')](_0x3195('0x44'))[_0x3195('0x35')]([_0x3195('0x1d'),_0x3195('0x3c'),_0x3195('0x36'),_0x3195('0x25'),_0x32bd1a,_0x3195('0x37'),_0x3195('0x38')],squel[_0x3195('0x39')]()['field']('phone','phone')[_0x3195('0x3a')](_0x3195('0x3b'),_0x3195('0x3c'))[_0x3195('0x3a')]('id','ContactId')[_0x3195('0x3a')](LISTID[_0x3195('0x3d')](),_0x3195('0x25'))[_0x3195('0x3a')](_0x553ce8['id'][_0x3195('0x3d')](),_0x32bd1a)[_0x3195('0x3a')](_0x3195('0x3b'),_0x3195('0x37'))[_0x3195('0x3a')](_0x3195('0x3b'),_0x3195('0x38'))[_0x3195('0x3e')](_0x3195('0x45'))[_0x3195('0x3f')](_0x3195('0x40'))[_0x3195('0x3f')]('ListId\x20=\x20?',LISTID['toString']())[_0x3195('0x3f')]('id\x20IN\x20?',squel['str'](hopperContacts))['where'](_0x3195('0x42')))['toString']();return _0x56498e;}function _0x3136db(_0x1d4693,_0x3f6a3f){var _0x35bb1f=squel['insert']()[_0x3195('0x34')]('cm_hopper_black')['fromQuery']([_0x3195('0x1d'),'ContactId',_0x3195('0x25'),_0x3f6a3f,_0x3195('0x37'),_0x3195('0x38')],squel[_0x3195('0x39')]()[_0x3195('0x3a')](_0x3195('0x1d'),_0x3195('0x1d'))[_0x3195('0x3a')]('id',_0x3195('0x36'))[_0x3195('0x3a')](LISTID[_0x3195('0x3d')](),'ListId')[_0x3195('0x3a')](_0x1d4693['id'][_0x3195('0x3d')](),_0x3f6a3f)['field'](_0x3195('0x3b'),'createdAt')[_0x3195('0x3a')](_0x3195('0x3b'),'updatedAt')[_0x3195('0x3e')](_0x3195('0x45'))[_0x3195('0x3f')](_0x3195('0x40'))[_0x3195('0x3f')](_0x3195('0x41'),LISTID[_0x3195('0x3d')]())['where'](_0x3195('0x46'),squel[_0x3195('0x47')](hopperContacts))[_0x3195('0x3f')](_0x3195('0x42')))[_0x3195('0x3d')]();return _0x35bb1f;}return db['VoiceQueue'][_0x3195('0x4a')]({'where':{'type':_0x3195('0x4b')},'attributes':['id',_0x3195('0x4c')],'include':[{'model':db[_0x3195('0x4d')],'as':'Lists','where':{'id':LISTID}}]})[_0x3195('0x2b')](function(_0x2f299f){var _0x22e82c=[];if(_0x2f299f){var _0x2d66ac;for(var _0x502706=0x0,_0x27b44a;_0x502706<_0x2f299f[_0x3195('0x16')];_0x502706+=0x1){_0x27b44a=_0x2f299f[_0x502706]['get']({'plain':!![]});switch(_0x27b44a[_0x3195('0x4c')]){case'always':_0x22e82c[_0x3195('0x2c')](db['sequelize'][_0x3195('0x4e')](_0x309bcd(_0x27b44a,_0x3195('0x4f')))[_0x3195('0x2b')](function(){})[_0x3195('0x2d')](_0x560865()));break;case _0x3195('0x50'):_0x22e82c[_0x3195('0x2c')](db[_0x3195('0x51')][_0x3195('0x4e')](_0x31490b(_0x27b44a,_0x3195('0x4f')))[_0x3195('0x2b')](function(){})[_0x3195('0x2d')](_0x560865()));break;default:_0x22e82c[_0x3195('0x2c')](db[_0x3195('0x51')][_0x3195('0x4e')](_0x3894e7(_0x27b44a,_0x3195('0x4f')))[_0x3195('0x2b')](function(){})[_0x3195('0x2d')](_0x560865()));}}}return _0x22e82c;})[_0x3195('0x52')]()[_0x3195('0x2b')](function(){return db[_0x3195('0x53')][_0x3195('0x4a')]({'where':{'type':_0x3195('0x4b')},'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x3195('0x54'),'where':{'id':LISTID}}]})[_0x3195('0x2b')](function(_0x1d8f99){var _0x3eeab3=[];if(_0x1d8f99){var _0x2f4792;for(var _0x3c380a=0x0,_0x1ba2a2;_0x3c380a<_0x1d8f99[_0x3195('0x16')];_0x3c380a+=0x1){_0x1ba2a2=_0x1d8f99[_0x3c380a][_0x3195('0x55')]({'plain':!![]});_0x3eeab3['push'](db['sequelize']['query'](_0x3136db(_0x1ba2a2,_0x3195('0x4f')))[_0x3195('0x2b')](function(){})[_0x3195('0x2d')](_0x560865()));}}return _0x3eeab3;})[_0x3195('0x52')]();})[_0x3195('0x2b')](function(){return db[_0x3195('0x56')]['findAll']({'attributes':['id',_0x3195('0x4c')],'include':[{'model':db[_0x3195('0x4d')],'as':_0x3195('0x57'),'where':{'id':LISTID}}]})[_0x3195('0x2b')](function(_0x4bea14){var _0x33cc62=[];if(_0x4bea14){for(var _0x19a7f5=0x0,_0x6dd5d5;_0x19a7f5<_0x4bea14[_0x3195('0x16')];_0x19a7f5+=0x1){_0x6dd5d5=_0x4bea14[_0x19a7f5][_0x3195('0x55')]({'plain':!![]});switch(_0x6dd5d5[_0x3195('0x4c')]){case'always':_0x33cc62[_0x3195('0x2c')](db[_0x3195('0x51')][_0x3195('0x4e')](_0x309bcd(_0x6dd5d5,'CampaignId'))[_0x3195('0x2b')](function(){})['catch'](_0x560865()));break;case'onlyIfOpen':_0x33cc62[_0x3195('0x2c')](db['sequelize'][_0x3195('0x4e')](_0x31490b(_0x6dd5d5,_0x3195('0x58')))['then'](function(){})[_0x3195('0x2d')](_0x560865()));break;default:_0x33cc62[_0x3195('0x2c')](db[_0x3195('0x51')][_0x3195('0x4e')](_0x3894e7(_0x6dd5d5,_0x3195('0x58')))[_0x3195('0x2b')](function(){})['catch'](_0x560865()));}}}return _0x33cc62;})['all']();})[_0x3195('0x2b')](function(){return db[_0x3195('0x56')][_0x3195('0x4a')]({'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x3195('0x54'),'where':{'id':LISTID}}]})['then'](function(_0x3de554){var _0x5bbaf9=[];if(_0x3de554){for(var _0x53b09c=0x0,_0x5cd651;_0x53b09c<_0x3de554[_0x3195('0x16')];_0x53b09c+=0x1){_0x5cd651=_0x3de554[_0x53b09c][_0x3195('0x55')]({'plain':!![]});_0x5bbaf9[_0x3195('0x2c')](db['sequelize'][_0x3195('0x4e')](_0x3136db(_0x5cd651,_0x3195('0x58')))[_0x3195('0x2b')](function(){})[_0x3195('0x2d')](_0x560865()));}}return _0x5bbaf9;})['all']();})[_0x3195('0x2d')](function(_0x3b8ae0){logger[_0x3195('0x11')]('cmContact,\x20%s,\x20%s','generalCheckHopper',_0x3b8ae0[_0x3195('0x17')]);});}var processPromises=function(_0x5ef872){return BPromise['all'](promises)[_0x3195('0x2b')](function(_0x20ecb4){})[_0x3195('0x2d')](function(_0x4100ee){logger[_0x3195('0x11')](_0x3195('0x59'),JSON['stringify'](_0x4100ee));})[_0x3195('0x5a')](function(){socket[_0x3195('0x5b')]('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x5ef872){return _0x5ef872[_0x3195('0x5c')]();}});};var endCsv=function(){return BPromise[_0x3195('0x5d')]()[_0x3195('0x2b')](function(){if(hopperContacts){return checkHopper();}})[_0x3195('0x2b')](function(){socket[_0x3195('0x5b')](_0x3195('0x5e')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x3195('0x5f')](FILEPATH);}catch(_0x496db5){logger[_0x3195('0x11')](_0x3195('0x60'),JSON['stringify'](_0x496db5));}finally{process[_0x3195('0x61')](0x0);}});};process['on'](_0x3195('0x62'),function(){logger[_0x3195('0x63')](_0x3195('0x64'));endCsv();});function main(){return BPromise[_0x3195('0x5d')]()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x3195('0xf')](',');return db['CmContact'][_0x3195('0x4a')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x47f317){var _0x507b99=fs[_0x3195('0x65')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x3195('0x66')](_0x507b99,{'header':!![],'skipEmptyLines':!![],'step':function(_0x1d10b5,_0x4ce262){total+=0x1;var _0x412c42=total;promises[_0x3195('0x2c')](checkRow(_0x1d10b5,_0x47f317,_0x412c42)[_0x3195('0x2b')](function(){success+=0x1;})['catch'](function(_0x575296){if(_0x575296[_0x3195('0x11')]){errors+=0x1;delete _0x575296['error'];}else if(_0x575296['duplicate']){duplicates+=0x1;delete _0x575296[_0x3195('0x67')];}rows[_0x3195('0x2c')](_0x575296);}));if(total%0xc8===0x0){_0x4ce262[_0x3195('0x68')]();return processPromises(_0x4ce262);}},'complete':function(){return processPromises()['then'](function(){logger[_0x3195('0x63')](_0x3195('0x69'));endCsv();});},'error':function(_0x3015c6,_0x7da2af){logger['info'](_0x3195('0x6a'),JSON[_0x3195('0x2f')](_0x3015c6));endCsv();}});})[_0x3195('0x2d')](function(_0x3fda54){logger[_0x3195('0x11')](_0x3195('0x6b'),JSON[_0x3195('0x2f')](_0x3fda54));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index e75e5db..979af7d 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 _0x99e6=['socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','phone','join','where','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','insert','into','cm_hopper','fromQuery','scheduledat','ContactId','ListId','createdAt','updatedAt','fields','from','cm_contacts.ListId\x20=\x20','.id\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22onlyIfOpen\x22','\x22always\x22','cm_hopper_black','cm_contacts','.CmListId','field','ListId\x20=\x20?','\x20=\x20?','toString',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','message','push','code','sequelize','query','spread','catch','error','stringify','send','socket_timestamp','.csv','keys','header','parse','createReadStream','data','length','rows','errors','hasOwnProperty','trim','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','priority','isNaN','UserId','isNumber','agent\x20not\x20exists','email\x20wrong\x20format','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','SystemRow','appendFileSync','emit','contact:import:','abort','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','CompanyId','DROP\x20TABLE\x20','voice_queues','VoiceQueueId','campaigns_has_cm_lists','campaigns','CampaignId','each','finish','affectedRows','unlink','exit','complete','arguments\x20\x20\x20','root','server/files/tmp','argv','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','binding','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','papaparse','util','bluebird','moment','squel','ioredis','../../../config/environment','../../../config/logger','import','defaults','redis','localhost'];(function(_0x197185,_0x251145){var _0x2c8af1=function(_0x1dbcfd){while(--_0x1dbcfd){_0x197185['push'](_0x197185['shift']());}};_0x2c8af1(++_0x251145);}(_0x99e6,0x76));var _0x699e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x99e6[_0x2b4411];return _0x8e41ef;};'use strict';var fs=require('fs');var path=require(_0x699e('0x0'));var _=require('lodash');var Papa=require(_0x699e('0x1'));var util=require(_0x699e('0x2'));var BPromise=require(_0x699e('0x3'));var moment=require(_0x699e('0x4'));var squel=require(_0x699e('0x5'));var Redis=require(_0x699e('0x6'));var db=require('../../../mysqldb')['db'];var config=require(_0x699e('0x7'));var logger=require(_0x699e('0x8'))(_0x699e('0x9'));config['redis']=_[_0x699e('0xa')](config[_0x699e('0xb')],{'host':_0x699e('0xc'),'port':0x18eb});var socket=require(_0x699e('0xd'))(new Redis(config[_0x699e('0xb')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x699e('0xe')](_0x699e('0xf'));function isEmail(_0x254da6){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))*$/[_0x699e('0x10')](_0x254da6);}function selectNotIn(_0x3a5590,_0x179b51,_0x5e5adc,_0x28101e,_0xfc17fe){return squel[_0x699e('0x11')]()['field'](_0x699e('0x12'))['from'](_0x28101e)[_0x699e('0x13')](_0x179b51,null,_0x179b51+'.id\x20=\x20'+_0x28101e+'.'+_0x5e5adc)[_0x699e('0x14')](_0x28101e+'.'+_0x5e5adc+'\x20=\x20'+_0x3a5590+'.'+_0x5e5adc)[_0x699e('0x14')](_0x179b51+_0x699e('0x15')+_0xfc17fe[_0x699e('0x13')]()+')');}function insertCmHopper(_0x378fb5,_0x145f36,_0x318f54,_0x3f1b9c,_0x8c1858){var _0x343f7b=[_0x699e('0x16'),_0x699e('0x17'),_0x699e('0x18'),_0x699e('0x19'),_0x145f36+'.'+_0x3f1b9c,_0x699e('0x1a'),_0x699e('0x1b'),_0x699e('0x1c'),'cm_contacts.UserId','\x22'+_0x8c1858+'\x22'];return squel[_0x699e('0x1d')]()[_0x699e('0x1e')](_0x699e('0x1f'))[_0x699e('0x20')](['phone',_0x699e('0x21'),_0x699e('0x22'),_0x699e('0x23'),_0x3f1b9c,_0x699e('0x24'),_0x699e('0x25'),'priority','UserId','recallme'],squel['select']()[_0x699e('0x26')](_0x343f7b)[_0x699e('0x27')](_0x145f36)[_0x699e('0x13')]('cm_contacts',null,_0x699e('0x28')+_0x145f36+'.CmListId')[_0x699e('0x13')](_0x318f54,null,_0x318f54+_0x699e('0x29')+_0x145f36+'.'+_0x3f1b9c)[_0x699e('0x14')](_0x145f36+_0x699e('0x2a'),_0x378fb5)['where'](_0x699e('0x2b'),NOW)[_0x699e('0x14')](_0x699e('0x2c'),selectNotIn(_0x145f36,_0x318f54,_0x3f1b9c,_0x699e('0x1f'),['\x22always\x22',_0x699e('0x2d')]))[_0x699e('0x14')](_0x699e('0x2c'),selectNotIn(_0x145f36,_0x318f54,_0x3f1b9c,_0x699e('0x1f'),[_0x699e('0x2e')])))['toString']();}function insertCmHopperBlack(_0x272314,_0x42cd9e,_0x24899d,_0x337f53){var _0x2a7904=[_0x699e('0x16'),_0x699e('0x18'),_0x699e('0x19'),_0x42cd9e+'.'+_0x337f53,_0x699e('0x1a'),_0x699e('0x1b')];return squel[_0x699e('0x1d')]()[_0x699e('0x1e')](_0x699e('0x2f'))[_0x699e('0x20')]([_0x699e('0x12'),_0x699e('0x22'),'ListId',_0x337f53,_0x699e('0x24'),_0x699e('0x25')],squel[_0x699e('0x11')]()['fields'](_0x2a7904)['from'](_0x42cd9e)[_0x699e('0x13')](_0x699e('0x30'),null,_0x699e('0x28')+_0x42cd9e+_0x699e('0x31'))[_0x699e('0x13')](_0x24899d,null,_0x24899d+_0x699e('0x29')+_0x42cd9e+'.'+_0x337f53)['where'](_0x42cd9e+_0x699e('0x2a'),_0x272314)['where']('cm_contacts.createdAt\x20=\x20?',NOW)[_0x699e('0x14')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x699e('0x11')]()[_0x699e('0x32')]('phone')[_0x699e('0x27')]('cm_hopper_black')[_0x699e('0x14')](_0x699e('0x33'),_0x272314)[_0x699e('0x14')](_0x337f53+_0x699e('0x34'),_0x42cd9e+'.'+_0x337f53)))[_0x699e('0x35')]();}function insertCmContact(_0x576556,_0x17fc33,_0x3976fc,_0x508385){var _0x38315e=_['concat'](_['keys'](_0x508385),[_0x699e('0x23'),'CompanyId','createdAt',_0x699e('0x25')]);return squel[_0x699e('0x1d')]()[_0x699e('0x1e')](_0x699e('0x30'))[_0x699e('0x20')](_0x38315e,squel[_0x699e('0x11')]()[_0x699e('0x26')](_0x38315e)['from'](_0x17fc33)[_0x699e('0x14')]('('+_0x3976fc['join'](',')+_0x699e('0x36'),squel['select']()[_0x699e('0x26')](_0x3976fc)[_0x699e('0x27')]('cm_contacts')[_0x699e('0x14')](_0x699e('0x33'),_0x576556)[_0x699e('0x14')](_0x699e('0x37')))[_0x699e('0x14')](_0x699e('0x38'),squel[_0x699e('0x11')]()['field'](_0x699e('0x39'),_0x699e('0x3a'))[_0x699e('0x27')](_0x17fc33)[_0x699e('0x3b')](_0x3976fc[_0x699e('0x13')](','))))[_0x699e('0x35')]();}function handleStop(){logger[_0x699e('0x3c')](_0x699e('0x3d'));stopped=!![];}function handleUncaughtException(_0x2ae79f){logger['error'](_0x2ae79f[_0x699e('0x3e')]);process['exit'](0x1);}function handleError(_0x4d2887,_0x249a45){stats['errors'][_0x699e('0x3f')]({'name':_0x249a45[_0x699e('0x40')],'message':_0x249a45[_0x699e('0x3e')],'row':_0x4d2887});}function handleQuery(_0x3ce79e){logger[_0x699e('0x3c')](_0x3ce79e);return db[_0x699e('0x41')][_0x699e('0x42')](_0x3ce79e)[_0x699e('0x43')](function(_0x44b8c2){results[_0x699e('0x3f')](_0x44b8c2);})[_0x699e('0x44')](function(_0x24e638){logger[_0x699e('0x45')](_0x24e638[_0x699e('0x3e')]);});}function main(_0x5b974c,_0x1e6267,_0x3edc24,_0x2d9722){logger['info']('main',_0x5b974c,JSON[_0x699e('0x46')](_0x1e6267));process[_0x699e('0x47')]('start');var _0x46060f=_0x1e6267['binding'];var _0x24d836=_0x1e6267[_0x699e('0x48')];var _0x89f902=path[_0x699e('0x13')](config['root'],'server/files/tmp',_0x24d836+_0x699e('0x49'));var _0x5cd768=_[_0x699e('0x4a')](_0x46060f)[_0x699e('0x13')]();logger[_0x699e('0x3c')](_0x699e('0x4b'),_0x5cd768);fs['writeFileSync'](_0x89f902,_0x5cd768+'\x0a');Papa[_0x699e('0x4c')](fs[_0x699e('0x4d')](_0x5b974c),{'header':!![],'skipEmptyLines':!![],'step':function(_0x37227a,_0x53ce13){try{for(var _0x3edb48=0x0,_0x50f74c=[];_0x3edb48<_0x37227a[_0x699e('0x4e')][_0x699e('0x4f')];_0x3edb48++){stats[_0x699e('0x50')]+=0x1;if(_0x37227a[_0x699e('0x51')][_0x3edb48]){handleError(_0x37227a[_0x699e('0x4e')][_0x3edb48],_0x37227a[_0x699e('0x51')][_0x3edb48]);}else{var _0x2e9b38=[];for(var _0x3b6d39 in _0x46060f){if(_0x46060f[_0x699e('0x52')](_0x3b6d39)){if(_0x37227a['data'][_0x3edb48][_0x46060f[_0x3b6d39]]){var _0x188846=_[_0x699e('0x53')](_0x37227a[_0x699e('0x4e')][_0x3edb48][_0x46060f[_0x3b6d39]]['replace'](/"/g,'\x27'));switch(_0x3b6d39){case _0x699e('0x21'):var _0x792e95=moment(_0x188846,_0x699e('0xf'),!![]);if(_0x792e95[_0x699e('0x54')]()){_0x50f74c[_0x699e('0x3f')]('\x22'+_0x188846+'\x22');}else{_0x2e9b38[_0x699e('0x3f')](_0x699e('0x55'));}break;case _0x699e('0x56'):var _0x28a44e=parseInt(_0x188846);_0x188846=_[_0x699e('0x57')](_0x28a44e)||_0x28a44e<0x0||_0x28a44e>0x4?_0x2d9722?0x3:0x2:_0x28a44e;_0x50f74c['push']('\x22'+_0x188846+'\x22');break;case _0x699e('0x58'):var _0x2a1ac9=parseInt(_0x188846);if(_[_0x699e('0x59')](_0x2a1ac9)&&_['includes'](_0x3edc24,_0x2a1ac9)){_0x50f74c['push']('\x22'+_0x2a1ac9+'\x22');}else{_0x2e9b38[_0x699e('0x3f')](_0x699e('0x5a'));}break;case'email':if(isEmail(_0x188846)){_0x50f74c[_0x699e('0x3f')]('\x22'+_0x188846+'\x22');}else{_0x2e9b38['push'](_0x699e('0x5b'));}break;case'dateOfBirth':var _0x622679=moment(_0x188846,_0x699e('0x5c'),!![]);if(_0x622679[_0x699e('0x54')]()){_0x50f74c[_0x699e('0x3f')]('\x22'+_0x188846+'\x22');}else{_0x2e9b38['push'](_0x699e('0x5d'));}break;default:_0x50f74c[_0x699e('0x3f')]('\x22'+_0x188846+'\x22');}}else{switch(_0x3b6d39){case _0x699e('0x5e'):case _0x699e('0x12'):_0x2e9b38['push'](_0x3b6d39+'\x20not\x20specified');break;default:_0x50f74c[_0x699e('0x3f')]('\x22\x22');}}}}if(_0x2e9b38[_0x699e('0x4f')]){handleError(_0x37227a[_0x699e('0x4e')][_0x3edb48],{'code':_0x699e('0x5f'),'message':_0x2e9b38['join']()});}else{fs[_0x699e('0x60')](_0x89f902,_0x50f74c[_0x699e('0x13')]()+'\x0a');}_0x50f74c=[];}if(!(stats[_0x699e('0x50')]%0xc8)){socket[_0x699e('0x61')](_0x699e('0x62')+_0x24d836,stats);stats[_0x699e('0x51')]=[];}}if(stopped){logger[_0x699e('0x3c')]('Abort\x20parser');_0x53ce13[_0x699e('0x63')]();}}catch(_0x3835f4){handleError(_0x37227a[_0x699e('0x4e')][_0x3edb48],{'code':'SystemError','message':_0x3835f4[_0x699e('0x3e')]});logger[_0x699e('0x45')]('step',_0x3835f4[_0x699e('0x3e')]);}},'complete':function(){try{var _0x5b7c53=[];var _0x4537e6='cm_contacts';if(_0x1e6267[_0x699e('0x64')]&&_0x1e6267['duplicates'][_0x699e('0x4f')]){_0x4537e6=_0x699e('0x65')+_0x24d836;_0x5b7c53['push'](_0x699e('0x66')+_0x4537e6+_0x699e('0x67'));}var _0x3a8226=util['format']('LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',_0x89f902,_0x4537e6,_0x5cd768,_0x1e6267[_0x699e('0x23')],_0x1e6267[_0x699e('0x68')]||null,NOW,NOW);if(_['isNil'](_0x46060f[_0x699e('0x21')])){_0x3a8226+=',\x20scheduledAt\x20=\x20NOW()';}_0x5b7c53['push'](_0x3a8226);if(_0x1e6267[_0x699e('0x64')]&&_0x1e6267[_0x699e('0x64')][_0x699e('0x4f')]){_0x5b7c53[_0x699e('0x3f')](insertCmContact(_0x1e6267[_0x699e('0x23')],_0x4537e6,_0x1e6267[_0x699e('0x64')],_0x46060f));_0x5b7c53['push'](_0x699e('0x69')+_0x4537e6+';');}_0x5b7c53['push'](insertCmHopper(_0x1e6267['ListId'],'voice_queues_has_cm_lists',_0x699e('0x6a'),'VoiceQueueId',_0x2d9722));_0x5b7c53[_0x699e('0x3f')](insertCmHopperBlack(_0x1e6267[_0x699e('0x23')],'voice_queues_has_cm_blacklists','voice_queues',_0x699e('0x6b')));_0x5b7c53['push'](insertCmHopper(_0x1e6267['ListId'],_0x699e('0x6c'),_0x699e('0x6d'),_0x699e('0x6e'),_0x2d9722));_0x5b7c53[_0x699e('0x3f')](insertCmHopperBlack(_0x1e6267[_0x699e('0x23')],'campaigns_has_cm_blacklists',_0x699e('0x6d'),_0x699e('0x6e')));BPromise[_0x699e('0x6f')](_0x5b7c53,handleQuery)['then'](function(_0x129c6f){stats[_0x699e('0x70')]=!![];stats['affectedRows']=_0x1e6267[_0x699e('0x64')]&&_0x1e6267[_0x699e('0x64')][_0x699e('0x4f')]?results[0x2][_0x699e('0x71')]:results[0x0][_0x699e('0x71')];socket[_0x699e('0x61')](_0x699e('0x62')+_0x24d836,stats);fs[_0x699e('0x72')](_0x5b974c);fs[_0x699e('0x72')](_0x89f902);process[_0x699e('0x73')](0x0);})['catch'](function(_0x8b92d1){logger[_0x699e('0x45')](_0x8b92d1[_0x699e('0x3e')]);process[_0x699e('0x73')](0x1);});}catch(_0x5b3c73){logger[_0x699e('0x45')](_0x699e('0x74'),_0x5b3c73[_0x699e('0x3e')]);process[_0x699e('0x73')](0x1);}},'error':function(_0x34b6d0,_0x359167,_0x4aed1b,_0x21c078){throw new Error(_0x21c078);}});}function validate(){if(process['argv']&&process['argv'][_0x699e('0x4f')]<0x4){throw new Error(_0x699e('0x75'));}var _0x2fe71e=path[_0x699e('0x13')](config[_0x699e('0x76')],_0x699e('0x77'),process[_0x699e('0x78')][0x2]);if(!fs[_0x699e('0x79')](_0x2fe71e)){throw new Error(_0x699e('0x7a'));}var _0x1ccb18={};try{_0x1ccb18=JSON[_0x699e('0x4c')](process[_0x699e('0x78')][0x3]);if(!_0x1ccb18['binding']){throw new Error(_0x699e('0x7b'));}if(!_0x1ccb18[_0x699e('0x7c')]['phone']){throw new Error('phone\x20is\x20mandatory');}if(!_0x1ccb18[_0x699e('0x7c')]['firstName']){throw new Error(_0x699e('0x7d'));}var _0x420c59=0x0;if(_0x1ccb18[_0x699e('0x7c')][_0x699e('0x58')]){_0x420c59=0x1;}if(!_0x1ccb18[_0x699e('0x23')]){throw new Error(_0x699e('0x7e'));}}catch(_0x5e5804){throw new Error('body\x20id\x20mandatory');}var _0x2bbeef=[];try{_0x2bbeef=_[_0x699e('0x7f')](JSON[_0x699e('0x4c')](process[_0x699e('0x78')][0x4]),'id');}catch(_0x23652a){logger[_0x699e('0x3c')](_0x699e('0x80'));}main(_0x2fe71e,_0x1ccb18,_0x2bbeef,_0x420c59);}validate();process['on'](_0x699e('0x81'),handleStop);process['on'](_0x699e('0x82'),handleUncaughtException); \ No newline at end of file +var _0xa8d3=['voice_queues','VoiceQueueId','campaigns','CampaignId','campaigns_has_cm_blacklists','each','then','finish','affectedRows','contact:import:','unlink','complete','argv','existsSync','binding\x20doesn\x27t\x20exists','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','moment','squel','ioredis','../../../mysqldb','../../../config/environment','import','redis','localhost','format','YYYY-MM-DD\x20HH:mm:ss','select','field','phone','from','join','where','\x20=\x20','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','insert','into','fromQuery','ContactId','ListId','createdAt','updatedAt','priority','UserId','recallme','cm_contacts','cm_contacts.ListId\x20=\x20','.id\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_hopper','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.phone','cm_hopper_black','fields','ListId\x20=\x20?','\x20=\x20?','CompanyId',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','MIN(id)','min_id','group','info','Received\x20SIGINT','message','exit','errors','push','sequelize','spread','catch','main','stringify','binding','socket_timestamp','root','server/files/tmp','keys','header','writeFileSync','parse','createReadStream','data','length','rows','hasOwnProperty','trim','replace','scheduledat','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','includes','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','SystemRow','emit','Abort\x20parser','abort','SystemError','error','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','isNil','DROP\x20TABLE\x20','voice_queues_has_cm_lists'];(function(_0x149c1f,_0x7b4dc6){var _0x309eeb=function(_0x19863c){while(--_0x19863c){_0x149c1f['push'](_0x149c1f['shift']());}};_0x309eeb(++_0x7b4dc6);}(_0xa8d3,0x94));var _0x3a8d=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa8d3[_0x5ddb1c];return _0x354adc;};'use strict';var fs=require('fs');var path=require(_0x3a8d('0x0'));var _=require(_0x3a8d('0x1'));var Papa=require(_0x3a8d('0x2'));var util=require('util');var BPromise=require('bluebird');var moment=require(_0x3a8d('0x3'));var squel=require(_0x3a8d('0x4'));var Redis=require(_0x3a8d('0x5'));var db=require(_0x3a8d('0x6'))['db'];var config=require(_0x3a8d('0x7'));var logger=require('../../../config/logger')(_0x3a8d('0x8'));config[_0x3a8d('0x9')]=_['defaults'](config[_0x3a8d('0x9')],{'host':_0x3a8d('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3a8d('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x3a8d('0xb')](_0x3a8d('0xc'));function isEmail(_0x4cdc62){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'](_0x4cdc62);}function selectNotIn(_0x50c4f2,_0xc157ac,_0x3c4a39,_0x37ff14,_0x4835de){return squel[_0x3a8d('0xd')]()[_0x3a8d('0xe')](_0x3a8d('0xf'))[_0x3a8d('0x10')](_0x37ff14)[_0x3a8d('0x11')](_0xc157ac,null,_0xc157ac+'.id\x20=\x20'+_0x37ff14+'.'+_0x3c4a39)[_0x3a8d('0x12')](_0x37ff14+'.'+_0x3c4a39+_0x3a8d('0x13')+_0x50c4f2+'.'+_0x3c4a39)['where'](_0xc157ac+'.dialCheckDuplicateType\x20IN\x20('+_0x4835de['join']()+')');}function insertCmHopper(_0x5f24eb,_0x134f40,_0x30192a,_0x5c95fa,_0x2712b3){var _0x4d2fad=['cm_contacts.phone',_0x3a8d('0x14'),_0x3a8d('0x15'),_0x3a8d('0x16'),_0x134f40+'.'+_0x5c95fa,_0x3a8d('0x17'),_0x3a8d('0x18'),'cm_contacts.priority','cm_contacts.UserId','\x22'+_0x2712b3+'\x22'];return squel[_0x3a8d('0x19')]()[_0x3a8d('0x1a')]('cm_hopper')[_0x3a8d('0x1b')]([_0x3a8d('0xf'),'scheduledat',_0x3a8d('0x1c'),_0x3a8d('0x1d'),_0x5c95fa,_0x3a8d('0x1e'),_0x3a8d('0x1f'),_0x3a8d('0x20'),_0x3a8d('0x21'),_0x3a8d('0x22')],squel[_0x3a8d('0xd')]()['fields'](_0x4d2fad)[_0x3a8d('0x10')](_0x134f40)['join'](_0x3a8d('0x23'),null,_0x3a8d('0x24')+_0x134f40+'.CmListId')['join'](_0x30192a,null,_0x30192a+_0x3a8d('0x25')+_0x134f40+'.'+_0x5c95fa)[_0x3a8d('0x12')](_0x134f40+_0x3a8d('0x26'),_0x5f24eb)[_0x3a8d('0x12')](_0x3a8d('0x27'),NOW)[_0x3a8d('0x12')](_0x3a8d('0x28'),selectNotIn(_0x134f40,_0x30192a,_0x5c95fa,_0x3a8d('0x29'),[_0x3a8d('0x2a'),_0x3a8d('0x2b')]))[_0x3a8d('0x12')](_0x3a8d('0x28'),selectNotIn(_0x134f40,_0x30192a,_0x5c95fa,_0x3a8d('0x29'),[_0x3a8d('0x2a')])))[_0x3a8d('0x2c')]();}function insertCmHopperBlack(_0xda9490,_0x17f389,_0x2cbd4d,_0x3924ab){var _0x881d91=[_0x3a8d('0x2d'),'cm_contacts.id',_0x3a8d('0x16'),_0x17f389+'.'+_0x3924ab,_0x3a8d('0x17'),_0x3a8d('0x18')];return squel['insert']()[_0x3a8d('0x1a')](_0x3a8d('0x2e'))['fromQuery'](['phone',_0x3a8d('0x1c'),_0x3a8d('0x1d'),_0x3924ab,_0x3a8d('0x1e'),_0x3a8d('0x1f')],squel[_0x3a8d('0xd')]()[_0x3a8d('0x2f')](_0x881d91)[_0x3a8d('0x10')](_0x17f389)[_0x3a8d('0x11')](_0x3a8d('0x23'),null,_0x3a8d('0x24')+_0x17f389+'.CmListId')[_0x3a8d('0x11')](_0x2cbd4d,null,_0x2cbd4d+_0x3a8d('0x25')+_0x17f389+'.'+_0x3924ab)[_0x3a8d('0x12')](_0x17f389+_0x3a8d('0x26'),_0xda9490)[_0x3a8d('0x12')]('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0x3a8d('0x28'),squel[_0x3a8d('0xd')]()[_0x3a8d('0xe')](_0x3a8d('0xf'))[_0x3a8d('0x10')]('cm_hopper_black')['where'](_0x3a8d('0x30'),_0xda9490)['where'](_0x3924ab+_0x3a8d('0x31'),_0x17f389+'.'+_0x3924ab)))['toString']();}function insertCmContact(_0x279d84,_0x1c3b33,_0x166431,_0x1bdf39){var _0x456d15=_['concat'](_['keys'](_0x1bdf39),['ListId',_0x3a8d('0x32'),_0x3a8d('0x1e'),'updatedAt']);return squel[_0x3a8d('0x19')]()[_0x3a8d('0x1a')](_0x3a8d('0x23'))['fromQuery'](_0x456d15,squel[_0x3a8d('0xd')]()[_0x3a8d('0x2f')](_0x456d15)['from'](_0x1c3b33)['where']('('+_0x166431[_0x3a8d('0x11')](',')+_0x3a8d('0x33'),squel[_0x3a8d('0xd')]()[_0x3a8d('0x2f')](_0x166431)['from'](_0x3a8d('0x23'))[_0x3a8d('0x12')](_0x3a8d('0x30'),_0x279d84)[_0x3a8d('0x12')](_0x3a8d('0x34')))[_0x3a8d('0x12')]('id\x20IN\x20?',squel['select']()[_0x3a8d('0xe')](_0x3a8d('0x35'),_0x3a8d('0x36'))['from'](_0x1c3b33)[_0x3a8d('0x37')](_0x166431[_0x3a8d('0x11')](','))))[_0x3a8d('0x2c')]();}function handleStop(){logger[_0x3a8d('0x38')](_0x3a8d('0x39'));stopped=!![];}function handleUncaughtException(_0x4af0ad){logger['error'](_0x4af0ad[_0x3a8d('0x3a')]);process[_0x3a8d('0x3b')](0x1);}function handleError(_0x33698d,_0x53ecf2){stats[_0x3a8d('0x3c')][_0x3a8d('0x3d')]({'name':_0x53ecf2['code'],'message':_0x53ecf2[_0x3a8d('0x3a')],'row':_0x33698d});}function handleQuery(_0x75afb7){logger['info'](_0x75afb7);return db[_0x3a8d('0x3e')]['query'](_0x75afb7)[_0x3a8d('0x3f')](function(_0x53a4d9){results[_0x3a8d('0x3d')](_0x53a4d9);})[_0x3a8d('0x40')](function(_0x3e893a){logger['error'](_0x3e893a[_0x3a8d('0x3a')]);});}function main(_0x590d05,_0x1a5f30,_0x39c622,_0x2c0a45){logger[_0x3a8d('0x38')](_0x3a8d('0x41'),_0x590d05,JSON[_0x3a8d('0x42')](_0x1a5f30));process['send']('start');var _0x5a3b0f=_0x1a5f30[_0x3a8d('0x43')];var _0x3617ee=_0x1a5f30[_0x3a8d('0x44')];var _0x226a38=path[_0x3a8d('0x11')](config[_0x3a8d('0x45')],_0x3a8d('0x46'),_0x3617ee+'.csv');var _0x14f292=_[_0x3a8d('0x47')](_0x5a3b0f)[_0x3a8d('0x11')]();logger[_0x3a8d('0x38')](_0x3a8d('0x48'),_0x14f292);fs[_0x3a8d('0x49')](_0x226a38,_0x14f292+'\x0a');Papa[_0x3a8d('0x4a')](fs[_0x3a8d('0x4b')](_0x590d05),{'header':!![],'skipEmptyLines':!![],'step':function(_0x22cc2d,_0x49847a){try{for(var _0x578e29=0x0,_0x148b90=[];_0x578e29<_0x22cc2d[_0x3a8d('0x4c')][_0x3a8d('0x4d')];_0x578e29++){stats[_0x3a8d('0x4e')]+=0x1;if(_0x22cc2d['errors'][_0x578e29]){handleError(_0x22cc2d['data'][_0x578e29],_0x22cc2d[_0x3a8d('0x3c')][_0x578e29]);}else{var _0x487e34=[];for(var _0x427417 in _0x5a3b0f){if(_0x5a3b0f[_0x3a8d('0x4f')](_0x427417)){if(_0x22cc2d['data'][_0x578e29][_0x5a3b0f[_0x427417]]){var _0x36d3c9=_[_0x3a8d('0x50')](_0x22cc2d[_0x3a8d('0x4c')][_0x578e29][_0x5a3b0f[_0x427417]][_0x3a8d('0x51')](/"/g,'\x27'));switch(_0x427417){case _0x3a8d('0x52'):var _0xfaf5e5=moment(_0x36d3c9,_0x3a8d('0xc'),!![]);if(_0xfaf5e5[_0x3a8d('0x53')]()){_0x148b90[_0x3a8d('0x3d')]('\x22'+_0x36d3c9+'\x22');}else{_0x487e34['push'](_0x3a8d('0x54'));}break;case'priority':var _0x558fd6=parseInt(_0x36d3c9);_0x36d3c9=_[_0x3a8d('0x55')](_0x558fd6)||_0x558fd6<0x0||_0x558fd6>0x4?_0x2c0a45?0x3:0x2:_0x558fd6;_0x148b90[_0x3a8d('0x3d')]('\x22'+_0x36d3c9+'\x22');break;case _0x3a8d('0x21'):var _0x25870e=parseInt(_0x36d3c9);if(_['isNumber'](_0x25870e)&&_[_0x3a8d('0x56')](_0x39c622,_0x25870e)){_0x148b90[_0x3a8d('0x3d')]('\x22'+_0x25870e+'\x22');}else{_0x487e34[_0x3a8d('0x3d')]('agent\x20not\x20exists');}break;case _0x3a8d('0x57'):if(isEmail(_0x36d3c9)){_0x148b90[_0x3a8d('0x3d')]('\x22'+_0x36d3c9+'\x22');}else{_0x487e34['push'](_0x3a8d('0x58'));}break;case _0x3a8d('0x59'):var _0x36bc99=moment(_0x36d3c9,_0x3a8d('0x5a'),!![]);if(_0x36bc99['isValid']()){_0x148b90[_0x3a8d('0x3d')]('\x22'+_0x36d3c9+'\x22');}else{_0x487e34[_0x3a8d('0x3d')](_0x3a8d('0x5b'));}break;default:_0x148b90['push']('\x22'+_0x36d3c9+'\x22');}}else{switch(_0x427417){case _0x3a8d('0x5c'):case _0x3a8d('0xf'):_0x487e34['push'](_0x427417+_0x3a8d('0x5d'));break;default:_0x148b90[_0x3a8d('0x3d')]('\x22\x22');}}}}if(_0x487e34[_0x3a8d('0x4d')]){handleError(_0x22cc2d[_0x3a8d('0x4c')][_0x578e29],{'code':_0x3a8d('0x5e'),'message':_0x487e34['join']()});}else{fs['appendFileSync'](_0x226a38,_0x148b90[_0x3a8d('0x11')]()+'\x0a');}_0x148b90=[];}if(!(stats[_0x3a8d('0x4e')]%0xc8)){socket[_0x3a8d('0x5f')]('contact:import:'+_0x3617ee,stats);stats['errors']=[];}}if(stopped){logger['info'](_0x3a8d('0x60'));_0x49847a[_0x3a8d('0x61')]();}}catch(_0x45085c){handleError(_0x22cc2d[_0x3a8d('0x4c')][_0x578e29],{'code':_0x3a8d('0x62'),'message':_0x45085c[_0x3a8d('0x3a')]});logger[_0x3a8d('0x63')](_0x3a8d('0x64'),_0x45085c[_0x3a8d('0x3a')]);}},'complete':function(){try{var _0x3c6c1c=[];var _0x16b025='cm_contacts';if(_0x1a5f30['duplicates']&&_0x1a5f30[_0x3a8d('0x65')][_0x3a8d('0x4d')]){_0x16b025=_0x3a8d('0x66')+_0x3617ee;_0x3c6c1c[_0x3a8d('0x3d')](_0x3a8d('0x67')+_0x16b025+'\x20LIKE\x20cm_contacts;');}var _0x59907f=util[_0x3a8d('0xb')](_0x3a8d('0x68'),_0x226a38,_0x16b025,_0x14f292,_0x1a5f30[_0x3a8d('0x1d')],_0x1a5f30[_0x3a8d('0x32')]||null,NOW,NOW);if(_[_0x3a8d('0x69')](_0x5a3b0f[_0x3a8d('0x52')])){_0x59907f+=',\x20scheduledAt\x20=\x20NOW()';}_0x3c6c1c[_0x3a8d('0x3d')](_0x59907f);if(_0x1a5f30['duplicates']&&_0x1a5f30['duplicates'][_0x3a8d('0x4d')]){_0x3c6c1c[_0x3a8d('0x3d')](insertCmContact(_0x1a5f30['ListId'],_0x16b025,_0x1a5f30[_0x3a8d('0x65')],_0x5a3b0f));_0x3c6c1c[_0x3a8d('0x3d')](_0x3a8d('0x6a')+_0x16b025+';');}_0x3c6c1c[_0x3a8d('0x3d')](insertCmHopper(_0x1a5f30[_0x3a8d('0x1d')],_0x3a8d('0x6b'),_0x3a8d('0x6c'),_0x3a8d('0x6d'),_0x2c0a45));_0x3c6c1c[_0x3a8d('0x3d')](insertCmHopperBlack(_0x1a5f30[_0x3a8d('0x1d')],'voice_queues_has_cm_blacklists','voice_queues',_0x3a8d('0x6d')));_0x3c6c1c[_0x3a8d('0x3d')](insertCmHopper(_0x1a5f30[_0x3a8d('0x1d')],'campaigns_has_cm_lists',_0x3a8d('0x6e'),_0x3a8d('0x6f'),_0x2c0a45));_0x3c6c1c['push'](insertCmHopperBlack(_0x1a5f30[_0x3a8d('0x1d')],_0x3a8d('0x70'),_0x3a8d('0x6e'),_0x3a8d('0x6f')));BPromise[_0x3a8d('0x71')](_0x3c6c1c,handleQuery)[_0x3a8d('0x72')](function(_0x2fd431){stats[_0x3a8d('0x73')]=!![];stats[_0x3a8d('0x74')]=_0x1a5f30[_0x3a8d('0x65')]&&_0x1a5f30[_0x3a8d('0x65')][_0x3a8d('0x4d')]?results[0x2][_0x3a8d('0x74')]:results[0x0][_0x3a8d('0x74')];socket[_0x3a8d('0x5f')](_0x3a8d('0x75')+_0x3617ee,stats);fs[_0x3a8d('0x76')](_0x590d05);fs[_0x3a8d('0x76')](_0x226a38);process[_0x3a8d('0x3b')](0x0);})[_0x3a8d('0x40')](function(_0x3d16c3){logger[_0x3a8d('0x63')](_0x3d16c3[_0x3a8d('0x3a')]);process[_0x3a8d('0x3b')](0x1);});}catch(_0x327e76){logger[_0x3a8d('0x63')](_0x3a8d('0x77'),_0x327e76['message']);process['exit'](0x1);}},'error':function(_0x4621e8,_0x53c33e,_0x57b910,_0x590117){throw new Error(_0x590117);}});}function validate(){if(process[_0x3a8d('0x78')]&&process['argv'][_0x3a8d('0x4d')]<0x4){throw new Error('arguments\x20\x20\x20');}var _0x3c2607=path[_0x3a8d('0x11')](config[_0x3a8d('0x45')],_0x3a8d('0x46'),process['argv'][0x2]);if(!fs[_0x3a8d('0x79')](_0x3c2607)){throw new Error('file\x20doesn\x27t\x20exists');}var _0x26955a={};try{_0x26955a=JSON[_0x3a8d('0x4a')](process[_0x3a8d('0x78')][0x3]);if(!_0x26955a['binding']){throw new Error(_0x3a8d('0x7a'));}if(!_0x26955a[_0x3a8d('0x43')][_0x3a8d('0xf')]){throw new Error('phone\x20is\x20mandatory');}if(!_0x26955a['binding']['firstName']){throw new Error('firstName\x20is\x20mandatory');}var _0x291dea=0x0;if(_0x26955a[_0x3a8d('0x43')][_0x3a8d('0x21')]){_0x291dea=0x1;}if(!_0x26955a[_0x3a8d('0x1d')]){throw new Error('ListId\x20is\x20mandatory');}}catch(_0x2ed4e6){throw new Error(_0x3a8d('0x7b'));}var _0x2dc1e8=[];try{_0x2dc1e8=_[_0x3a8d('0x7c')](JSON['parse'](process[_0x3a8d('0x78')][0x4]),'id');}catch(_0x4f74d3){logger[_0x3a8d('0x38')](_0x3a8d('0x7d'));}main(_0x3c2607,_0x26955a,_0x2dc1e8,_0x291dea);}validate();process['on'](_0x3a8d('0x7e'),handleStop);process['on'](_0x3a8d('0x7f'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index 08b0969..cb9ac97 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 _0x10be=['***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','Caller\x20Name','Call\x20To','Queue','UniqueId','uniqueid','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Connect','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','talktime','outbound','Member\x20Name','starttime','Answer\x20Time','answertime','Complete\x20Time','endtime','duration','Billable\x20Time','getSubjects','string','toLowerCase','voice','inbound','push','variable','calleridnum','Outbound\x20Call','destcalleridnum','getDescriptions'];(function(_0x161062,_0x457b6b){var _0x12a1b4=function(_0x505427){while(--_0x505427){_0x161062['push'](_0x161062['shift']());}};_0x12a1b4(++_0x457b6b);}(_0x10be,0x1b8));var _0xe10b=function(_0x40b950,_0x3fb9d4){_0x40b950=_0x40b950-0x0;var _0x422874=_0x10be[_0x40b950];return _0x422874;};'use strict';exports[_0xe10b('0x0')]=function(_0x1fb086,_0x9dacd7){var _0x59bdb6=[{'type':_0xe10b('0x1'),'content':'[xCALLY\x20Ticket]','variableName':null}];switch(_0x1fb086[_0xe10b('0x2')]()){case _0xe10b('0x3'):switch(_0x9dacd7[_0xe10b('0x2')]()){case _0xe10b('0x4'):_0x59bdb6[_0xe10b('0x5')]({'type':'variable','content':'','variableName':'queue'});_0x59bdb6[_0xe10b('0x5')]({'type':_0xe10b('0x6'),'content':'','variableName':_0xe10b('0x7')});break;case'outbound':_0x59bdb6[_0xe10b('0x5')]({'type':_0xe10b('0x1'),'content':_0xe10b('0x8'),'variableName':null});_0x59bdb6[_0xe10b('0x5')]({'type':'variable','content':'','variableName':_0xe10b('0x9')});break;}}return _0x59bdb6;};exports[_0xe10b('0xa')]=function(_0x4995e0,_0x484971){var _0xa6e827=[];switch(_0x4995e0['toLowerCase']()){case _0xe10b('0x3'):switch(_0x484971[_0xe10b('0x2')]()){case _0xe10b('0x4'):_0xa6e827=[{'type':'string','content':_0xe10b('0xb'),'key':null,'keyType':null,'variableName':null},{'type':_0xe10b('0xc'),'content':'','key':_0xe10b('0xd'),'keyType':_0xe10b('0x6'),'variableName':_0xe10b('0x7')},{'type':_0xe10b('0xc'),'content':'','key':_0xe10b('0xe'),'keyType':'variable','variableName':'calleridname'},{'type':'keyValue','content':'','key':_0xe10b('0xf'),'keyType':_0xe10b('0x6'),'variableName':'destexten'},{'type':'keyValue','content':'','key':_0xe10b('0x10'),'keyType':'variable','variableName':'queue'},{'type':_0xe10b('0xc'),'content':'','key':_0xe10b('0x11'),'keyType':_0xe10b('0x6'),'variableName':_0xe10b('0x12')},{'type':_0xe10b('0xc'),'content':'','key':'Date','keyType':'variable','variableName':_0xe10b('0x13')},{'type':_0xe10b('0x1'),'content':_0xe10b('0x14'),'key':null,'keyType':null,'variableName':null},{'type':_0xe10b('0xc'),'content':'','key':_0xe10b('0x15'),'keyType':_0xe10b('0x6'),'variableName':_0xe10b('0x16')},{'type':'keyValue','content':'','key':_0xe10b('0x17'),'keyType':_0xe10b('0x6'),'variableName':_0xe10b('0x9')},{'type':_0xe10b('0x1'),'content':_0xe10b('0x18'),'key':null,'keyType':null,'variableName':null},{'type':_0xe10b('0xc'),'content':'','key':'Agent\x20Ring','keyType':_0xe10b('0x6'),'variableName':_0xe10b('0x13')},{'type':_0xe10b('0xc'),'content':'','key':_0xe10b('0x19'),'keyType':_0xe10b('0x6'),'variableName':'agentconnectAt'},{'type':_0xe10b('0xc'),'content':'','key':_0xe10b('0x1a'),'keyType':'variable','variableName':_0xe10b('0x1b')},{'type':_0xe10b('0xc'),'content':'','key':_0xe10b('0x1c'),'keyType':_0xe10b('0x6'),'variableName':_0xe10b('0x1d')},{'type':_0xe10b('0xc'),'content':'','key':_0xe10b('0x1e'),'keyType':_0xe10b('0x6'),'variableName':_0xe10b('0x1f')}];break;case _0xe10b('0x20'):_0xa6e827=[{'type':_0xe10b('0x1'),'content':_0xe10b('0xb'),'variableName':null},{'type':'keyValue','content':'','key':'Called\x20Number','keyType':_0xe10b('0x6'),'keyContent':'','variableName':_0xe10b('0x9')},{'type':'keyValue','content':'','key':_0xe10b('0x21'),'keyType':_0xe10b('0x6'),'keyContent':'','variableName':'membername'},{'type':_0xe10b('0xc'),'content':'','key':'UniqueId','keyType':_0xe10b('0x6'),'keyContent':'','variableName':_0xe10b('0x12')},{'type':_0xe10b('0xc'),'content':'','key':'Date','keyType':_0xe10b('0x6'),'keyContent':'','variableName':_0xe10b('0x22')},{'type':_0xe10b('0x1'),'content':_0xe10b('0x18')},{'type':_0xe10b('0xc'),'content':'','key':_0xe10b('0x23'),'keyType':'variable','keyContent':'','variableName':_0xe10b('0x24')},{'type':_0xe10b('0xc'),'content':'','key':_0xe10b('0x25'),'keyType':_0xe10b('0x6'),'keyContent':'','variableName':_0xe10b('0x26')},{'type':_0xe10b('0xc'),'content':'','key':'Duration','keyType':_0xe10b('0x6'),'keyContent':'','variableName':_0xe10b('0x27')},{'type':_0xe10b('0xc'),'content':'','key':_0xe10b('0x28'),'keyType':_0xe10b('0x6'),'keyContent':'','variableName':'billableseconds'}];break;}}return _0xa6e827;}; \ No newline at end of file +var _0x2f73=['Member\x20Name','UniqueId','starttime','Answer\x20Time','Complete\x20Time','Duration','duration','Billable\x20Time','billableseconds','string','toLowerCase','voice','inbound','queue','push','variable','calleridnum','outbound','getDescriptions','***\x20Call\x20Info\x20***','keyValue','uniqueid','Date','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Number','destcalleridnum','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','talktime','Called\x20Number'];(function(_0x283d33,_0x303be2){var _0x41cc0b=function(_0x51f7e2){while(--_0x51f7e2){_0x283d33['push'](_0x283d33['shift']());}};_0x41cc0b(++_0x303be2);}(_0x2f73,0x99));var _0x32f7=function(_0xaa6c53,_0x57e3ec){_0xaa6c53=_0xaa6c53-0x0;var _0xa14007=_0x2f73[_0xaa6c53];return _0xa14007;};'use strict';exports['getSubjects']=function(_0x426c68,_0x511965){var _0x120302=[{'type':_0x32f7('0x0'),'content':'[xCALLY\x20Ticket]','variableName':null}];switch(_0x426c68[_0x32f7('0x1')]()){case _0x32f7('0x2'):switch(_0x511965[_0x32f7('0x1')]()){case _0x32f7('0x3'):_0x120302['push']({'type':'variable','content':'','variableName':_0x32f7('0x4')});_0x120302[_0x32f7('0x5')]({'type':_0x32f7('0x6'),'content':'','variableName':_0x32f7('0x7')});break;case _0x32f7('0x8'):_0x120302[_0x32f7('0x5')]({'type':'string','content':'Outbound\x20Call','variableName':null});_0x120302['push']({'type':_0x32f7('0x6'),'content':'','variableName':'destcalleridnum'});break;}}return _0x120302;};exports[_0x32f7('0x9')]=function(_0x1d079a,_0x1c3005){var _0x431456=[];switch(_0x1d079a['toLowerCase']()){case _0x32f7('0x2'):switch(_0x1c3005[_0x32f7('0x1')]()){case'inbound':_0x431456=[{'type':'string','content':_0x32f7('0xa'),'key':null,'keyType':null,'variableName':null},{'type':_0x32f7('0xb'),'content':'','key':'Caller\x20Number','keyType':_0x32f7('0x6'),'variableName':_0x32f7('0x7')},{'type':'keyValue','content':'','key':'Caller\x20Name','keyType':_0x32f7('0x6'),'variableName':'calleridname'},{'type':_0x32f7('0xb'),'content':'','key':'Call\x20To','keyType':_0x32f7('0x6'),'variableName':'destexten'},{'type':_0x32f7('0xb'),'content':'','key':'Queue','keyType':_0x32f7('0x6'),'variableName':_0x32f7('0x4')},{'type':_0x32f7('0xb'),'content':'','key':'UniqueId','keyType':_0x32f7('0x6'),'variableName':_0x32f7('0xc')},{'type':_0x32f7('0xb'),'content':'','key':_0x32f7('0xd'),'keyType':_0x32f7('0x6'),'variableName':_0x32f7('0xe')},{'type':'string','content':_0x32f7('0xf'),'key':null,'keyType':null,'variableName':null},{'type':_0x32f7('0xb'),'content':'','key':'Agent\x20Name','keyType':_0x32f7('0x6'),'variableName':'destcalleridname'},{'type':'keyValue','content':'','key':_0x32f7('0x10'),'keyType':'variable','variableName':_0x32f7('0x11')},{'type':_0x32f7('0x0'),'content':_0x32f7('0x12'),'key':null,'keyType':null,'variableName':null},{'type':_0x32f7('0xb'),'content':'','key':_0x32f7('0x13'),'keyType':'variable','variableName':_0x32f7('0xe')},{'type':'keyValue','content':'','key':_0x32f7('0x14'),'keyType':'variable','variableName':'agentconnectAt'},{'type':_0x32f7('0xb'),'content':'','key':_0x32f7('0x15'),'keyType':_0x32f7('0x6'),'variableName':_0x32f7('0x16')},{'type':_0x32f7('0xb'),'content':'','key':_0x32f7('0x17'),'keyType':'variable','variableName':_0x32f7('0x18')},{'type':'keyValue','content':'','key':'Talk\x20Time','keyType':_0x32f7('0x6'),'variableName':_0x32f7('0x19')}];break;case'outbound':_0x431456=[{'type':_0x32f7('0x0'),'content':'***\x20Call\x20Info\x20***','variableName':null},{'type':_0x32f7('0xb'),'content':'','key':_0x32f7('0x1a'),'keyType':_0x32f7('0x6'),'keyContent':'','variableName':'destcalleridnum'},{'type':_0x32f7('0xb'),'content':'','key':_0x32f7('0x1b'),'keyType':_0x32f7('0x6'),'keyContent':'','variableName':'membername'},{'type':_0x32f7('0xb'),'content':'','key':_0x32f7('0x1c'),'keyType':'variable','keyContent':'','variableName':_0x32f7('0xc')},{'type':'keyValue','content':'','key':'Date','keyType':'variable','keyContent':'','variableName':_0x32f7('0x1d')},{'type':_0x32f7('0x0'),'content':'***\x20Time\x20Info\x20***'},{'type':'keyValue','content':'','key':_0x32f7('0x1e'),'keyType':_0x32f7('0x6'),'keyContent':'','variableName':'answertime'},{'type':'keyValue','content':'','key':_0x32f7('0x1f'),'keyType':'variable','keyContent':'','variableName':'endtime'},{'type':_0x32f7('0xb'),'content':'','key':_0x32f7('0x20'),'keyType':_0x32f7('0x6'),'keyContent':'','variableName':_0x32f7('0x21')},{'type':_0x32f7('0xb'),'content':'','key':_0x32f7('0x22'),'keyType':_0x32f7('0x6'),'keyContent':'','variableName':_0x32f7('0x23')}];break;}}return _0x431456;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index d3b8f18..5fe4c75 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 _0xd9bf=['update','info','catch','tracked','user','body','omit','html','phone','mobile','lodash','../../mysqldb','../../config/logger','mail-interactions','sms-interactions','chat-interactions','whatsapp-interactions','upperFirst','InteractionId','unknown','toLowerCase','toUpperCase','stringify','null','findOne','then'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xd9bf,0xda));var _0xfd9b=function(_0x393f4e,_0x395f5b){_0x393f4e=_0x393f4e-0x0;var _0x23a0a3=_0xd9bf[_0x393f4e];return _0x23a0a3;};'use strict';var _=require(_0xfd9b('0x0'));var db=require(_0xfd9b('0x1'))['db'];var loggers={'openchannel':require(_0xfd9b('0x2'))('openchannel-interactions'),'mail':require(_0xfd9b('0x2'))(_0xfd9b('0x3')),'fax':require(_0xfd9b('0x2'))('fax-interactions'),'sms':require(_0xfd9b('0x2'))(_0xfd9b('0x4')),'chat':require(_0xfd9b('0x2'))(_0xfd9b('0x5')),'whatsapp':require('../../config/logger')(_0xfd9b('0x6'))};function getInteractionId(_0x63d0cf,_0x5d7622,_0x2b8634){if(_0x63d0cf&&_0x63d0cf[_[_0xfd9b('0x7')](_0x2b8634)+_0xfd9b('0x8')]){return _0x63d0cf[_[_0xfd9b('0x7')](_0x2b8634)+_0xfd9b('0x8')];}else if(_0x63d0cf&&_0x63d0cf['id']){return _0x63d0cf['id'];}else if(_0x5d7622&&_0x5d7622['id']){return _0x5d7622['id'];}else{return _0xfd9b('0x9');}}function log(_0x4e97c4,_0x22918c,_0x23cfad,_0x53f675,_0x326bc2,_0x42ae30){loggers[_0x326bc2[_0xfd9b('0xa')]()][_0x4e97c4]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x42ae30[_0xfd9b('0xb')](),_0x22918c?_0x22918c['id']:null,_0x22918c?_0x22918c['name']:null,_0x22918c?_0x22918c['role']:null,getInteractionId(_0x23cfad,_0x53f675,_0x326bc2),_0x23cfad?JSON[_0xfd9b('0xc')](_0x23cfad):_0xfd9b('0xd'));}function updateUser(_0x36f6b0,_0x4ee9ed,_0x8932bc,_0x17fd47,_0x2cfbf0){db[_[_0xfd9b('0x7')](_0x17fd47)+'Interaction'][_0xfd9b('0xe')]({'where':{'id':getInteractionId(_0x4ee9ed,_0x8932bc,_0x17fd47)}})[_0xfd9b('0xf')](function(_0x5368ab){if(_0x5368ab){return _0x5368ab[_0xfd9b('0x10')]({'UserId':_0x36f6b0?_0x36f6b0['id']:null});}})[_0xfd9b('0xf')](function(_0x254026){if(_0x254026){log(_0xfd9b('0x11'),_0x36f6b0,_0x4ee9ed,_0x8932bc,_0x17fd47,_0x2cfbf0);}})[_0xfd9b('0x12')](function(){log('error',_0x36f6b0,_0x4ee9ed,_0x8932bc,_0x17fd47,_0x2cfbf0);});}exports[_0xfd9b('0x13')]=function(_0x6e95bc,_0x5ced4d){return function(_0x569329,_0x1515a8,_0x20868f){var _0x57d615=_0x569329[_0xfd9b('0x14')];var _0x4b1b28={};var _0x3e0ac1=_0x569329['query'];if(_0x4b1b28){_0x4b1b28=_['clone'](_0x569329[_0xfd9b('0x15')]);_0x4b1b28=_[_0xfd9b('0x16')](_0x4b1b28,[_0xfd9b('0x15'),_0xfd9b('0x17'),_0xfd9b('0x18'),'fax',_0xfd9b('0x19')]);}updateUser(_0x57d615,_0x4b1b28,_0x3e0ac1,_0x6e95bc,_0x5ced4d);_0x20868f(null);};}; \ No newline at end of file +var _0x47e9=['stringify','Interaction','update','then','catch','clone','body','html','fax','mobile','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','InteractionId','upperFirst','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role'];(function(_0x1483ed,_0x3919ea){var _0x198002=function(_0x3e6f79){while(--_0x3e6f79){_0x1483ed['push'](_0x1483ed['shift']());}};_0x198002(++_0x3919ea);}(_0x47e9,0x1cc));var _0x947e=function(_0x186051,_0x55857d){_0x186051=_0x186051-0x0;var _0x3671b3=_0x47e9[_0x186051];return _0x3671b3;};'use strict';var _=require(_0x947e('0x0'));var db=require(_0x947e('0x1'))['db'];var loggers={'openchannel':require(_0x947e('0x2'))(_0x947e('0x3')),'mail':require('../../config/logger')(_0x947e('0x4')),'fax':require('../../config/logger')(_0x947e('0x5')),'sms':require(_0x947e('0x2'))(_0x947e('0x6')),'chat':require('../../config/logger')('chat-interactions'),'whatsapp':require(_0x947e('0x2'))('whatsapp-interactions')};function getInteractionId(_0x5927aa,_0x1e7935,_0x48b7d5){if(_0x5927aa&&_0x5927aa[_['upperFirst'](_0x48b7d5)+_0x947e('0x7')]){return _0x5927aa[_[_0x947e('0x8')](_0x48b7d5)+_0x947e('0x7')];}else if(_0x5927aa&&_0x5927aa['id']){return _0x5927aa['id'];}else if(_0x1e7935&&_0x1e7935['id']){return _0x1e7935['id'];}else{return _0x947e('0x9');}}function log(_0xec34b0,_0x525115,_0x3060b1,_0x3f54df,_0x1e2ba9,_0x236920){loggers[_0x1e2ba9[_0x947e('0xa')]()][_0xec34b0](_0x947e('0xb'),_0x236920[_0x947e('0xc')](),_0x525115?_0x525115['id']:null,_0x525115?_0x525115[_0x947e('0xd')]:null,_0x525115?_0x525115[_0x947e('0xe')]:null,getInteractionId(_0x3060b1,_0x3f54df,_0x1e2ba9),_0x3060b1?JSON[_0x947e('0xf')](_0x3060b1):'null');}function updateUser(_0x133c82,_0x4b81de,_0x3d2a21,_0x5f1c99,_0x33e64c){db[_[_0x947e('0x8')](_0x5f1c99)+_0x947e('0x10')]['findOne']({'where':{'id':getInteractionId(_0x4b81de,_0x3d2a21,_0x5f1c99)}})['then'](function(_0x4a7da7){if(_0x4a7da7){return _0x4a7da7[_0x947e('0x11')]({'UserId':_0x133c82?_0x133c82['id']:null});}})[_0x947e('0x12')](function(_0x156f38){if(_0x156f38){log('info',_0x133c82,_0x4b81de,_0x3d2a21,_0x5f1c99,_0x33e64c);}})[_0x947e('0x13')](function(){log('error',_0x133c82,_0x4b81de,_0x3d2a21,_0x5f1c99,_0x33e64c);});}exports['tracked']=function(_0x1f7e3a,_0x285bbb){return function(_0x5def08,_0xb388c5,_0x191c87){var _0x4e6d66=_0x5def08['user'];var _0x631a13={};var _0x1ee68f=_0x5def08['query'];if(_0x631a13){_0x631a13=_[_0x947e('0x14')](_0x5def08[_0x947e('0x15')]);_0x631a13=_['omit'](_0x631a13,[_0x947e('0x15'),_0x947e('0x16'),'phone',_0x947e('0x17'),_0x947e('0x18')]);}updateUser(_0x4e6d66,_0x631a13,_0x1ee68f,_0x1f7e3a,_0x285bbb);_0x191c87(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 6103fea..8e7739b 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 _0x1aba=['utf8','parse','hasOwnProperty','use','License','findOne','then','count','status','users','User','user','isUserLimit','util','../../mysqldb','../../config/environment','license','data1','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64','final'];(function(_0x38623a,_0x2da80f){var _0x171b6a=function(_0xc18663){while(--_0xc18663){_0x38623a['push'](_0x38623a['shift']());}};_0x171b6a(++_0x2da80f);}(_0x1aba,0x8f));var _0xa1ab=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x1aba[_0x3bf83f];return _0x22c4a9;};'use strict';var crypto=require('crypto');var util=require(_0xa1ab('0x0'));var compose=require('composable-middleware');var db=require(_0xa1ab('0x1'))['db'];var config=require(_0xa1ab('0x2'));function getValueFromLicense(_0x40accd,_0x33f92f){if(_0x40accd&&_0x33f92f){if(_0x33f92f['data1']&&_0x33f92f[_0xa1ab('0x3')]){var _0x539e28=_0x33f92f[_0xa1ab('0x4')];var _0x2a6c05=_0x33f92f[_0xa1ab('0x3')];var _0x2ce37b=_0x539e28['split']('-')[0x4];var _0x54911d=_0x539e28[_0xa1ab('0x5')]('-')[0x0];var _0x675504=crypto[_0xa1ab('0x6')](_0xa1ab('0x7'),util[_0xa1ab('0x8')](_0xa1ab('0x9'),_0x2ce37b,_0x539e28,_0x54911d));var _0x338689=_0x675504[_0xa1ab('0xa')](_0x2a6c05,_0xa1ab('0xb'),'utf8');_0x338689+=_0x675504[_0xa1ab('0xc')](_0xa1ab('0xd'));var _0x273445=JSON[_0xa1ab('0xe')](_0x338689);return _0x273445[_0xa1ab('0xf')](_0x40accd)?_0x273445[_0x40accd]:null;}}return null;}function isLimit(_0x28962c,_0x178ca8,_0x3ce7cc,_0x2ee552){var _0x12c751=_0x178ca8;return compose()[_0xa1ab('0x10')](function(_0x1094ed,_0x317cf0,_0x5e62b2){return db[_0xa1ab('0x11')][_0xa1ab('0x12')]({'where':{'id':0x1},'raw':!![]})[_0xa1ab('0x13')](function(_0x1d2fa2){var _0x5f1c2f=getValueFromLicense(_0x28962c,_0x1d2fa2);return _0x5f1c2f?_0x5f1c2f:_0x12c751;})[_0xa1ab('0x13')](function(_0x4dd4c2){_0x12c751=_0x4dd4c2;return _0x3ce7cc[_0xa1ab('0x14')](_0x2ee552);})[_0xa1ab('0x13')](function(_0x325e79){if(_0x325e79>=_0x12c751){return _0x317cf0[_0xa1ab('0x15')](0x193)['json']({'message':util[_0xa1ab('0x8')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x28962c)});}_0x5e62b2();})['catch'](function(_0x17d17b){_0x5e62b2(_0x17d17b);});});}function isUserLimit(){return isLimit(_0xa1ab('0x16'),0x1,db[_0xa1ab('0x17')],{'where':{'$or':[{'role':'admin'},{'role':_0xa1ab('0x18')}]}});}exports[_0xa1ab('0x19')]=isUserLimit; \ No newline at end of file +var _0x3777=['findOne','then','count','status','catch','users','User','admin','user','isUserLimit','crypto','util','composable-middleware','../../mysqldb','../../config/environment','data1','license','split','aes-256-ctr','format','update','utf8','parse','hasOwnProperty','use','License'];(function(_0x47ad4f,_0xefa6e1){var _0x441870=function(_0x47060b){while(--_0x47060b){_0x47ad4f['push'](_0x47ad4f['shift']());}};_0x441870(++_0xefa6e1);}(_0x3777,0xda));var _0x7377=function(_0x5416db,_0x55683a){_0x5416db=_0x5416db-0x0;var _0x243e35=_0x3777[_0x5416db];return _0x243e35;};'use strict';var crypto=require(_0x7377('0x0'));var util=require(_0x7377('0x1'));var compose=require(_0x7377('0x2'));var db=require(_0x7377('0x3'))['db'];var config=require(_0x7377('0x4'));function getValueFromLicense(_0x33739b,_0x23f737){if(_0x33739b&&_0x23f737){if(_0x23f737[_0x7377('0x5')]&&_0x23f737[_0x7377('0x6')]){var _0x4f85f0=_0x23f737[_0x7377('0x5')];var _0x4bfee4=_0x23f737[_0x7377('0x6')];var _0x1b2611=_0x4f85f0[_0x7377('0x7')]('-')[0x4];var _0x50b3ec=_0x4f85f0[_0x7377('0x7')]('-')[0x0];var _0x1101f8=crypto['createDecipher'](_0x7377('0x8'),util[_0x7377('0x9')]('%s:%s:%s',_0x1b2611,_0x4f85f0,_0x50b3ec));var _0x509a50=_0x1101f8[_0x7377('0xa')](_0x4bfee4,'base64',_0x7377('0xb'));_0x509a50+=_0x1101f8['final'](_0x7377('0xb'));var _0x50fddf=JSON[_0x7377('0xc')](_0x509a50);return _0x50fddf[_0x7377('0xd')](_0x33739b)?_0x50fddf[_0x33739b]:null;}}return null;}function isLimit(_0x424eb9,_0x34d9df,_0x4709a3,_0x3e203d){var _0x14a48f=_0x34d9df;return compose()[_0x7377('0xe')](function(_0x28ac76,_0x38c257,_0x4bd956){return db[_0x7377('0xf')][_0x7377('0x10')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x1509f7){var _0x1c7010=getValueFromLicense(_0x424eb9,_0x1509f7);return _0x1c7010?_0x1c7010:_0x14a48f;})[_0x7377('0x11')](function(_0x261e0a){_0x14a48f=_0x261e0a;return _0x4709a3[_0x7377('0x12')](_0x3e203d);})[_0x7377('0x11')](function(_0x68e35){if(_0x68e35>=_0x14a48f){return _0x38c257[_0x7377('0x13')](0x193)['json']({'message':util[_0x7377('0x9')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x424eb9)});}_0x4bd956();})[_0x7377('0x14')](function(_0x3eead8){_0x4bd956(_0x3eead8);});});}function isUserLimit(){return isLimit(_0x7377('0x15'),0x1,db[_0x7377('0x16')],{'where':{'$or':[{'role':_0x7377('0x17')},{'role':_0x7377('0x18')}]}});}exports[_0x7377('0x19')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 8b5d0b0..66b0f18 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 _0xe1a7=['$in','IN\x20?','NOT\x20IN\x20?','=\x20?','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','>\x20?','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','$substring','pop','DATE','utcOffset','format','add','minutes','seconds','moment','sqlOperator','[$or]','and','replace','[$and]','length','split','forEach','shift','match','filter','indexOf','map','conditions','push','buildExpression','$eq','operator','$between','value','includes','$gt','$lte','days','YYYY-MM-DD','castTo','field','\x20AS\x20','text','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0xe1a7,0x89));var _0x7e1a=function(_0x50a94c,_0x279837){_0x50a94c=_0x50a94c-0x0;var _0x25f4a1=_0xe1a7[_0x50a94c];return _0x25f4a1;};'use strict';var _=require('lodash');var moment=require(_0x7e1a('0x0'));exports['parseSearch']=function(_0xc8af2f){var _0x1a4819={'conditions':[]};_0x1a4819[_0x7e1a('0x1')]=_['startsWith'](_0xc8af2f,_0x7e1a('0x2'))?'or':_0x7e1a('0x3');var _0x1c3c11=_0xc8af2f[_0x7e1a('0x4')](_0x7e1a('0x5'),'')[_0x7e1a('0x4')](_0x7e1a('0x2'),'')['split']('||');for(var _0x18bab6=0x0;_0x18bab6<_0x1c3c11[_0x7e1a('0x6')];_0x18bab6++){var _0x302ecf=_0x1c3c11[_0x18bab6][_0x7e1a('0x7')](':=');var _0x421ce7=_0x302ecf[0x0];var _0x472c1f=_0x302ecf['slice'](0x1);_0x472c1f[_0x7e1a('0x8')](function(_0x502f80){var _0x3a600f=_0x502f80[_0x7e1a('0x7')]('[')[_0x7e1a('0x9')]();var _0x44d42d=_0x502f80[_0x7e1a('0xa')](/\[(.*?)\]/g);_0x44d42d['forEach'](function(_0x35b5f5){var _0x129f79=_0x35b5f5['split']('[')[_0x7e1a('0xb')](function(_0x402fbc){return _0x402fbc[_0x7e1a('0xc')](']')>-0x1;})[_0x7e1a('0xd')](function(_0x37e40d){return _0x37e40d['split'](']')[0x0];})[0x0];_0x1a4819[_0x7e1a('0xe')][_0x7e1a('0xf')]({'field':_0x421ce7,'operator':_0x3a600f,'value':_0x129f79});});});}return _0x1a4819;};exports[_0x7e1a('0x10')]=function(_0x1eb77b,_0xf54df2,_0x3404d4){var _0x1867ce={};if(_0xf54df2==='DATE'){if(_0x3404d4['operator']===_0x7e1a('0x11')){_0x3404d4[_0x7e1a('0x12')]=_0x7e1a('0x13');_0x3404d4[_0x7e1a('0x14')]+=','+_0x3404d4[_0x7e1a('0x14')];}else if(_[_0x7e1a('0x15')]([_0x7e1a('0x16'),_0x7e1a('0x17')],_0x3404d4[_0x7e1a('0x12')])){_0x3404d4[_0x7e1a('0x14')]=moment(_0x3404d4[_0x7e1a('0x14')])['add'](0x1,_0x7e1a('0x18'))['format'](_0x7e1a('0x19'));}}if(_0x3404d4['castTo']){_0xf54df2=_0x3404d4[_0x7e1a('0x1a')];_0x1867ce['text']='CAST('+_0x1eb77b+'.'+_0x3404d4[_0x7e1a('0x1b')]+_0x7e1a('0x1c')+_0x3404d4[_0x7e1a('0x1a')]+')\x20'+parseOperator(_0x3404d4[_0x7e1a('0x12')]);}else{_0x1867ce[_0x7e1a('0x1d')]=_0x1eb77b+'.'+_0x3404d4[_0x7e1a('0x1b')]+'\x20'+parseOperator(_0x3404d4[_0x7e1a('0x12')]);}if(_[_0x7e1a('0x15')]([_0x7e1a('0x1e'),_0x7e1a('0x1f')],_0x3404d4[_0x7e1a('0x12')]))_0x1867ce[_0x7e1a('0x1d')]='('+_0x1867ce['text']+_0x7e1a('0x20')+_0x1eb77b+'.'+_0x3404d4[_0x7e1a('0x1b')]+_0x7e1a('0x21');_0x1867ce[_0x7e1a('0x14')]=parseValue(_0xf54df2,_0x3404d4[_0x7e1a('0x12')],_0x3404d4['value']);return _0x1867ce;};function parseOperator(_0x481add){var _0x440da5;switch(_0x481add){case _0x7e1a('0x22'):_0x440da5=_0x7e1a('0x23');break;case _0x7e1a('0x1f'):_0x440da5=_0x7e1a('0x24');break;case _0x7e1a('0x11'):_0x440da5=_0x7e1a('0x25');break;case'$ne':_0x440da5='<>\x20?';break;case'$substring':case _0x7e1a('0x26'):case _0x7e1a('0x27'):_0x440da5=_0x7e1a('0x28');break;case _0x7e1a('0x29'):_0x440da5=_0x7e1a('0x2a');break;case _0x7e1a('0x16'):_0x440da5=_0x7e1a('0x2b');break;case'$lte':_0x440da5=_0x7e1a('0x2c');break;case _0x7e1a('0x2d'):_0x440da5=_0x7e1a('0x2e');break;case _0x7e1a('0x13'):_0x440da5=_0x7e1a('0x2f');break;}return _0x440da5;}function parseValue(_0x44807a,_0x5aecb3,_0x20500d){var _0x473bf0={'start':undefined,'end':undefined};switch(_0x5aecb3){case _0x7e1a('0x22'):case _0x7e1a('0x1f'):_0x473bf0[_0x7e1a('0x30')]=_0x20500d['split'](',');break;case _0x7e1a('0x31'):_0x473bf0[_0x7e1a('0x30')]='%'+_0x20500d+'%';break;case'$startsWith':_0x473bf0['start']=_0x20500d+'%';break;case _0x7e1a('0x27'):_0x473bf0[_0x7e1a('0x30')]='%'+_0x20500d;break;case _0x7e1a('0x13'):var _0x25a217=_0x20500d[_0x7e1a('0x7')](',');var _0x20500d=_0x25a217[_0x7e1a('0x9')]();var _0x56457c=_0x25a217[_0x7e1a('0x32')]();if(_0x44807a===_0x7e1a('0x33')){_0x20500d=moment(_0x20500d)[_0x7e1a('0x34')](0x0,!![])[_0x7e1a('0x35')]();_0x56457c=moment(_0x56457c)[_0x7e1a('0x34')](0x0,!![])[_0x7e1a('0x36')](0x17,'hours')['add'](0x3b,_0x7e1a('0x37'))[_0x7e1a('0x36')](0x3b,_0x7e1a('0x38'))['format']();}_0x473bf0={'start':_0x20500d,'end':_0x56457c};break;default:_0x473bf0['start']=_0x20500d;break;}return _0x473bf0;} \ No newline at end of file +var _0xdafb=['castTo','text','CAST(','field','\x20AS\x20','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','=\x20?','<>\x20?','$substring','$startsWith','$endsWith','$lt','<\x20?','<=\x20?','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','shift','pop','utcOffset','add','hours','minutes','seconds','lodash','moment','parseSearch','startsWith','[$or]','and','replace','[$and]','split','length','slice','forEach','match','indexOf','map','conditions','DATE','$eq','operator','$between','value','includes','$gt','$lte','days','format','YYYY-MM-DD'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0xdafb,0x13b));var _0xbdaf=function(_0x5d1533,_0xf2d3e9){_0x5d1533=_0x5d1533-0x0;var _0x269fda=_0xdafb[_0x5d1533];return _0x269fda;};'use strict';var _=require(_0xbdaf('0x0'));var moment=require(_0xbdaf('0x1'));exports[_0xbdaf('0x2')]=function(_0x361e3a){var _0x18f773={'conditions':[]};_0x18f773['sqlOperator']=_[_0xbdaf('0x3')](_0x361e3a,_0xbdaf('0x4'))?'or':_0xbdaf('0x5');var _0x5e836d=_0x361e3a[_0xbdaf('0x6')](_0xbdaf('0x7'),'')[_0xbdaf('0x6')](_0xbdaf('0x4'),'')[_0xbdaf('0x8')]('||');for(var _0x3e817f=0x0;_0x3e817f<_0x5e836d[_0xbdaf('0x9')];_0x3e817f++){var _0x9dbec3=_0x5e836d[_0x3e817f][_0xbdaf('0x8')](':=');var _0x2a0fff=_0x9dbec3[0x0];var _0x2993cc=_0x9dbec3[_0xbdaf('0xa')](0x1);_0x2993cc[_0xbdaf('0xb')](function(_0x2d5635){var _0x5cc333=_0x2d5635['split']('[')['shift']();var _0x4ee9d8=_0x2d5635[_0xbdaf('0xc')](/\[(.*?)\]/g);_0x4ee9d8[_0xbdaf('0xb')](function(_0x4bdb22){var _0x570216=_0x4bdb22[_0xbdaf('0x8')]('[')['filter'](function(_0x1498a2){return _0x1498a2[_0xbdaf('0xd')](']')>-0x1;})[_0xbdaf('0xe')](function(_0x2a64ed){return _0x2a64ed[_0xbdaf('0x8')](']')[0x0];})[0x0];_0x18f773[_0xbdaf('0xf')]['push']({'field':_0x2a0fff,'operator':_0x5cc333,'value':_0x570216});});});}return _0x18f773;};exports['buildExpression']=function(_0x44d600,_0x4bafa5,_0x280bac){var _0x40f7b3={};if(_0x4bafa5===_0xbdaf('0x10')){if(_0x280bac['operator']===_0xbdaf('0x11')){_0x280bac[_0xbdaf('0x12')]=_0xbdaf('0x13');_0x280bac[_0xbdaf('0x14')]+=','+_0x280bac[_0xbdaf('0x14')];}else if(_[_0xbdaf('0x15')]([_0xbdaf('0x16'),_0xbdaf('0x17')],_0x280bac['operator'])){_0x280bac[_0xbdaf('0x14')]=moment(_0x280bac[_0xbdaf('0x14')])['add'](0x1,_0xbdaf('0x18'))[_0xbdaf('0x19')](_0xbdaf('0x1a'));}}if(_0x280bac[_0xbdaf('0x1b')]){_0x4bafa5=_0x280bac[_0xbdaf('0x1b')];_0x40f7b3[_0xbdaf('0x1c')]=_0xbdaf('0x1d')+_0x44d600+'.'+_0x280bac[_0xbdaf('0x1e')]+_0xbdaf('0x1f')+_0x280bac['castTo']+')\x20'+parseOperator(_0x280bac[_0xbdaf('0x12')]);}else{_0x40f7b3['text']=_0x44d600+'.'+_0x280bac['field']+'\x20'+parseOperator(_0x280bac[_0xbdaf('0x12')]);}if(_['includes']([_0xbdaf('0x20'),_0xbdaf('0x21')],_0x280bac[_0xbdaf('0x12')]))_0x40f7b3['text']='('+_0x40f7b3[_0xbdaf('0x1c')]+_0xbdaf('0x22')+_0x44d600+'.'+_0x280bac[_0xbdaf('0x1e')]+_0xbdaf('0x23');_0x40f7b3[_0xbdaf('0x14')]=parseValue(_0x4bafa5,_0x280bac[_0xbdaf('0x12')],_0x280bac[_0xbdaf('0x14')]);return _0x40f7b3;};function parseOperator(_0x52a5bf){var _0x585e19;switch(_0x52a5bf){case _0xbdaf('0x24'):_0x585e19=_0xbdaf('0x25');break;case _0xbdaf('0x21'):_0x585e19=_0xbdaf('0x26');break;case'$eq':_0x585e19=_0xbdaf('0x27');break;case'$ne':_0x585e19=_0xbdaf('0x28');break;case _0xbdaf('0x29'):case _0xbdaf('0x2a'):case _0xbdaf('0x2b'):_0x585e19='LIKE\x20?';break;case _0xbdaf('0x2c'):_0x585e19=_0xbdaf('0x2d');break;case _0xbdaf('0x16'):_0x585e19='>\x20?';break;case _0xbdaf('0x17'):_0x585e19=_0xbdaf('0x2e');break;case'$gte':_0x585e19=_0xbdaf('0x2f');break;case _0xbdaf('0x13'):_0x585e19=_0xbdaf('0x30');break;}return _0x585e19;}function parseValue(_0x171db5,_0xc1ad04,_0xc8de53){var _0xf5eb02={'start':undefined,'end':undefined};switch(_0xc1ad04){case _0xbdaf('0x24'):case'$notIn':_0xf5eb02[_0xbdaf('0x31')]=_0xc8de53[_0xbdaf('0x8')](',');break;case _0xbdaf('0x29'):_0xf5eb02['start']='%'+_0xc8de53+'%';break;case _0xbdaf('0x2a'):_0xf5eb02[_0xbdaf('0x31')]=_0xc8de53+'%';break;case _0xbdaf('0x2b'):_0xf5eb02[_0xbdaf('0x31')]='%'+_0xc8de53;break;case'$between':var _0x4c1248=_0xc8de53[_0xbdaf('0x8')](',');var _0xc8de53=_0x4c1248[_0xbdaf('0x32')]();var _0x29c16d=_0x4c1248[_0xbdaf('0x33')]();if(_0x171db5==='DATE'){_0xc8de53=moment(_0xc8de53)['utcOffset'](0x0,!![])['format']();_0x29c16d=moment(_0x29c16d)[_0xbdaf('0x34')](0x0,!![])[_0xbdaf('0x35')](0x17,_0xbdaf('0x36'))[_0xbdaf('0x35')](0x3b,_0xbdaf('0x37'))[_0xbdaf('0x35')](0x3b,_0xbdaf('0x38'))['format']();}_0xf5eb02={'start':_0xc8de53,'end':_0x29c16d};break;default:_0xf5eb02['start']=_0xc8de53;break;}return _0xf5eb02;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 45fb68c..62117fd 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 _0xfffe=['format','$lte','subtract','uniqueid','isArray','limit','offset','sort','map','priority','cast','unsigned','substr','col','ASC','omit','length','isObject','isString','unset','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','isEmail','forEach','includes','push','getOptions','query','$id','name','intersection','model','attributes','nolimit','order','where','pick','VIRTUAL','lower','filter','merge','options','sequelize','moment','keys','parse','fields','split','filters','isEmpty','forOwn','type','DATE','isPlainObject','$gte','YYYY-MM-DD','utc'];(function(_0x285a14,_0x394a27){var _0x3430cc=function(_0x46d2d7){while(--_0x46d2d7){_0x285a14['push'](_0x285a14['shift']());}};_0x3430cc(++_0x394a27);}(_0xfffe,0x1c9));var _0xefff=function(_0x58e2bd,_0x3dacea){_0x58e2bd=_0x58e2bd-0x0;var _0x2d0a5b=_0xfffe[_0x58e2bd];return _0x2d0a5b;};'use strict';var _=require('lodash');var sequelize=require(_0xefff('0x0'));var moment=require(_0xefff('0x1'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x540027){var _0x28d9c2=['ne'];try{var _0x42ece6=JSON['parse'](_0x540027);var _0x126830=Object[_0xefff('0x2')](_0x42ece6)[0x0];return _0x28d9c2['includes'](_0x126830);}catch(_0x2bdb4c){return![];}}function getOperatorValue(_0x1b1142){var _0x5e324f=JSON[_0xefff('0x3')](_0x1b1142);var _0x5ce869=Object[_0xefff('0x2')](_0x5e324f)[0x0];var _0x163a5e=_0x5e324f[_0x5ce869];return{['$'+_0x5ce869]:_0x163a5e};}exports[_0xefff('0x4')]=function(_0x32f9aa){var _0x2898c7=null;if(_0x32f9aa){_0x2898c7=_0x32f9aa[_0xefff('0x5')](',');}return _0x2898c7;};exports[_0xefff('0x6')]=function(_0x2a82c0,_0x2e9df8){var _0x48cc63={};if(!_[_0xefff('0x7')](_0x2a82c0)){_[_0xefff('0x8')](_0x2a82c0,function(_0x3e0a4c,_0x82a144){try{if(_0x2e9df8){var _0x478fe2=_['find'](_0x2e9df8,{'name':_0x82a144})||{};if(hasSequelizeOperator(_0x3e0a4c)){_0x48cc63[_0x82a144]=getOperatorValue(_0x3e0a4c);}else if(_0x478fe2[_0xefff('0x9')]===_0xefff('0xa')&&_[_0xefff('0xb')](_0x3e0a4c)){var _0x542abf=JSON['parse'](_0x3e0a4c);var _0x17a30c={'$gte':moment(moment(_0x542abf[_0xefff('0xc')])['format'](_0xefff('0xd')))[_0xefff('0xe')]()[_0xefff('0xf')](),'$lte':moment(moment(_0x542abf[_0xefff('0x10')])[_0xefff('0xf')](_0xefff('0xd')))[_0xefff('0xe')]()[_0xefff('0x11')](0x1,'s')[_0xefff('0xf')]()};_0x48cc63[_0x82a144]=_0x17a30c;}else if(_0x478fe2['name']===_0xefff('0x12')){_0x48cc63[_0x82a144]=_0x3e0a4c;}else{_0x48cc63[_0x82a144]=_[_0xefff('0x13')](_0x3e0a4c)?_0x3e0a4c:JSON[_0xefff('0x3')](_0x3e0a4c);}}else{_0x48cc63[_0x82a144]=_[_0xefff('0x13')](_0x3e0a4c)?_0x3e0a4c:JSON['parse'](_0x3e0a4c);}}catch(_0x3669fe){_0x48cc63[_0x82a144]=_0x3e0a4c[_0xefff('0x5')](',');}});}return _0x48cc63;};exports[_0xefff('0x14')]=function(_0x4edf7b){_0x4edf7b=parseInt(_0x4edf7b,0xa);if(!_0x4edf7b||_0x4edf7b<0x0){_0x4edf7b=LIMIT_VALUE;}return _0x4edf7b;};exports[_0xefff('0x15')]=function(_0x5c26ca){_0x5c26ca=parseInt(_0x5c26ca,0xa);if(!_0x5c26ca||_0x5c26ca<0x0){_0x5c26ca=0x0;}return _0x5c26ca;};exports[_0xefff('0x16')]=function(_0x3117c9){var _0x1974d6,_0x5de557=null;if(_0x3117c9){_0x1974d6=_0x3117c9[_0xefff('0x5')](',');_0x5de557=_[_0xefff('0x17')](_0x1974d6,function(_0x532907){if(_0x532907['indexOf']('-')===0x0){return[_0x532907===_0xefff('0x18')?sequelize[_0xefff('0x19')](sequelize['col'](_0xefff('0x18')),_0xefff('0x1a')):_0x532907[_0xefff('0x1b')](0x1),'DESC'];}else{return[_0x532907==='priority'?sequelize['cast'](sequelize[_0xefff('0x1c')](_0xefff('0x18')),_0xefff('0x1a')):_0x532907,_0xefff('0x1d')];}});}return _0x5de557;};exports[_0xefff('0x1e')]=function(_0x2f6bf5,_0x49496d){if(_['isEmpty'](_0x2f6bf5)){return _0x2f6bf5;}if(_[_0xefff('0x13')](_0x2f6bf5)){for(var _0x32a7db=0x0;_0x32a7db<_0x2f6bf5[_0xefff('0x1f')];_0x32a7db+=0x1){_0x2f6bf5[_0x32a7db]=this['omit'](_0x2f6bf5[_0x32a7db],_0x49496d);}return _0x2f6bf5;}if(!_[_0xefff('0x20')](_0x2f6bf5)){return _0x2f6bf5;}if(_[_0xefff('0x21')](_0x49496d)){_0x49496d=[_0x49496d];}if(!_[_0xefff('0x13')](_0x49496d)){return _0x2f6bf5;}for(var _0x2dcc8f=0x0;_0x2dcc8f<_0x49496d[_0xefff('0x1f')];_0x2dcc8f+=0x1){_[_0xefff('0x22')](_0x2f6bf5,_0x49496d[_0x2dcc8f]);}for(var _0x3ba59b in _0x2f6bf5){if(_0x2f6bf5[_0xefff('0x23')](_0x3ba59b)){_0x2f6bf5[_0x3ba59b]=this[_0xefff('0x1e')](_0x2f6bf5[_0x3ba59b],_0x49496d);}}return _0x2f6bf5;};exports[_0xefff('0x24')]=function(_0x542033){return _0x542033[_0xefff('0x25')](RegExp(_0xefff('0x26')))?!![]:![];};exports[_0xefff('0x27')]=function(_0x26b152){return _0x26b152[_0xefff('0x25')](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x31bb0b){var _0x598ad6=[];_0x31bb0b['split'](/[ ,]+/)[_0xefff('0x28')](function(_0x208188){_0x208188=_0x208188['replace'](/([^:]")"+/g,'$1');_0x208188='+'+_0x208188+'*';if(_0x208188[_0xefff('0x29')]('@'))_0x208188='\x22'+_0x208188+'\x22';_0x598ad6[_0xefff('0x2a')](_0x208188);});return _0x598ad6['join']('\x20');};exports[_0xefff('0x2b')]=function(_0x29b4ca,_0x28ea43,_0x367dd3){var _0x1acaef={},_0x40da32={};if(_0x28ea43[_0xefff('0x2c')][_0xefff('0x2d')]){_0x28ea43[_0xefff('0x2c')]['id']=_0x28ea43[_0xefff('0x2c')]['$id'];delete _0x28ea43['query'][_0xefff('0x2d')];}_0x1acaef['model']=_[_0xefff('0x17')](_0x29b4ca,_0xefff('0x2e'));_0x1acaef[_0xefff('0x2c')]=_['keys'](_0x28ea43[_0xefff('0x2c')]);_0x1acaef[_0xefff('0x6')]=_[_0xefff('0x2f')](_0x1acaef[_0xefff('0x30')],_0x1acaef[_0xefff('0x2c')]);_0x40da32['attributes']=_['intersection'](_0x1acaef[_0xefff('0x30')],this[_0xefff('0x4')](_0x28ea43[_0xefff('0x2c')][_0xefff('0x4')]));_0x40da32[_0xefff('0x31')]=_0x40da32[_0xefff('0x31')][_0xefff('0x1f')]?_0x40da32[_0xefff('0x31')]:_0x1acaef[_0xefff('0x30')];if(!_0x28ea43[_0xefff('0x2c')][_0xefff('0x23')](_0xefff('0x32'))){_0x40da32['limit']=this[_0xefff('0x14')](_0x28ea43[_0xefff('0x2c')]['limit']);_0x40da32[_0xefff('0x15')]=this[_0xefff('0x15')](_0x28ea43[_0xefff('0x2c')][_0xefff('0x15')]);}_0x40da32[_0xefff('0x33')]=this['sort'](_0x28ea43['query']['sort']);_0x40da32[_0xefff('0x34')]=this[_0xefff('0x6')](_[_0xefff('0x35')](_0x28ea43[_0xefff('0x2c')],_0x1acaef[_0xefff('0x6')]),_0x29b4ca);if(_0x28ea43[_0xefff('0x2c')]['filter']){_0x40da32[_0xefff('0x34')]=_['merge'](_0x40da32[_0xefff('0x34')],{'$or':_[_0xefff('0x17')](_0x29b4ca,function(_0x278713){if(_0x278713[_0xefff('0x9')]!==_0xefff('0x36')){if(_0x367dd3){return sequelize[_0xefff('0x34')](sequelize['fn'](_0xefff('0x37'),sequelize['col'](_0x278713[_0xefff('0x2e')])),{'$like':sequelize['fn']('lower','%'+_0x28ea43[_0xefff('0x2c')]['filter']+'%')});}else{var _0x5b88c7={};_0x5b88c7[_0x278713['name']]={'$like':'%'+_0x28ea43[_0xefff('0x2c')][_0xefff('0x38')]+'%'};return _0x5b88c7;}}})});}_0x40da32=_[_0xefff('0x39')]({},_0x40da32,_0x28ea43[_0xefff('0x3a')]);return _0x40da32;}; \ No newline at end of file +var _0xab31=['model','name','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','lower','options','sequelize','moment','keys','includes','parse','fields','split','filters','isEmpty','forOwn','find','type','DATE','isPlainObject','$gte','format','YYYY-MM-DD','utc','$lte','uniqueid','isArray','limit','offset','map','indexOf','priority','cast','col','unsigned','substr','DESC','ASC','omit','length','isObject','isString','unset','isNumeric','match','^[+]?[0-9]*$','isEmail','getFullTextValue','forEach','replace','push','join','getOptions','query','$id'];(function(_0x28be72,_0x2b83af){var _0x46c5da=function(_0x312911){while(--_0x312911){_0x28be72['push'](_0x28be72['shift']());}};_0x46c5da(++_0x2b83af);}(_0xab31,0x10f));var _0x1ab3=function(_0x1098a5,_0x586b8c){_0x1098a5=_0x1098a5-0x0;var _0x4d27a9=_0xab31[_0x1098a5];return _0x4d27a9;};'use strict';var _=require('lodash');var sequelize=require(_0x1ab3('0x0'));var moment=require(_0x1ab3('0x1'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x2d0f85){var _0x5bfa9c=['ne'];try{var _0x48e5b6=JSON['parse'](_0x2d0f85);var _0xb2313f=Object[_0x1ab3('0x2')](_0x48e5b6)[0x0];return _0x5bfa9c[_0x1ab3('0x3')](_0xb2313f);}catch(_0x2a148a){return![];}}function getOperatorValue(_0x37e175){var _0x4c01e3=JSON[_0x1ab3('0x4')](_0x37e175);var _0x2dc8ca=Object['keys'](_0x4c01e3)[0x0];var _0x1c7787=_0x4c01e3[_0x2dc8ca];return{['$'+_0x2dc8ca]:_0x1c7787};}exports[_0x1ab3('0x5')]=function(_0x6c383f){var _0x5aaf8b=null;if(_0x6c383f){_0x5aaf8b=_0x6c383f[_0x1ab3('0x6')](',');}return _0x5aaf8b;};exports[_0x1ab3('0x7')]=function(_0x9ae7bb,_0x17c5d4){var _0x247c49={};if(!_[_0x1ab3('0x8')](_0x9ae7bb)){_[_0x1ab3('0x9')](_0x9ae7bb,function(_0x8a72cf,_0x3cd929){try{if(_0x17c5d4){var _0x45ea67=_[_0x1ab3('0xa')](_0x17c5d4,{'name':_0x3cd929})||{};if(hasSequelizeOperator(_0x8a72cf)){_0x247c49[_0x3cd929]=getOperatorValue(_0x8a72cf);}else if(_0x45ea67[_0x1ab3('0xb')]===_0x1ab3('0xc')&&_[_0x1ab3('0xd')](_0x8a72cf)){var _0x21055a=JSON[_0x1ab3('0x4')](_0x8a72cf);var _0x1bbf6d={'$gte':moment(moment(_0x21055a[_0x1ab3('0xe')])[_0x1ab3('0xf')](_0x1ab3('0x10')))[_0x1ab3('0x11')]()['format'](),'$lte':moment(moment(_0x21055a[_0x1ab3('0x12')])['format'](_0x1ab3('0x10')))['utc']()['subtract'](0x1,'s')[_0x1ab3('0xf')]()};_0x247c49[_0x3cd929]=_0x1bbf6d;}else if(_0x45ea67['name']===_0x1ab3('0x13')){_0x247c49[_0x3cd929]=_0x8a72cf;}else{_0x247c49[_0x3cd929]=_['isArray'](_0x8a72cf)?_0x8a72cf:JSON[_0x1ab3('0x4')](_0x8a72cf);}}else{_0x247c49[_0x3cd929]=_[_0x1ab3('0x14')](_0x8a72cf)?_0x8a72cf:JSON[_0x1ab3('0x4')](_0x8a72cf);}}catch(_0x5b0b76){_0x247c49[_0x3cd929]=_0x8a72cf[_0x1ab3('0x6')](',');}});}return _0x247c49;};exports[_0x1ab3('0x15')]=function(_0x6d89ac){_0x6d89ac=parseInt(_0x6d89ac,0xa);if(!_0x6d89ac||_0x6d89ac<0x0){_0x6d89ac=LIMIT_VALUE;}return _0x6d89ac;};exports[_0x1ab3('0x16')]=function(_0x8b691){_0x8b691=parseInt(_0x8b691,0xa);if(!_0x8b691||_0x8b691<0x0){_0x8b691=0x0;}return _0x8b691;};exports['sort']=function(_0x3d0769){var _0x400cb0,_0x238400=null;if(_0x3d0769){_0x400cb0=_0x3d0769[_0x1ab3('0x6')](',');_0x238400=_[_0x1ab3('0x17')](_0x400cb0,function(_0x3f5b85){if(_0x3f5b85[_0x1ab3('0x18')]('-')===0x0){return[_0x3f5b85===_0x1ab3('0x19')?sequelize[_0x1ab3('0x1a')](sequelize[_0x1ab3('0x1b')](_0x1ab3('0x19')),_0x1ab3('0x1c')):_0x3f5b85[_0x1ab3('0x1d')](0x1),_0x1ab3('0x1e')];}else{return[_0x3f5b85===_0x1ab3('0x19')?sequelize['cast'](sequelize[_0x1ab3('0x1b')](_0x1ab3('0x19')),_0x1ab3('0x1c')):_0x3f5b85,_0x1ab3('0x1f')];}});}return _0x238400;};exports[_0x1ab3('0x20')]=function(_0x380c2f,_0x3bf021){if(_[_0x1ab3('0x8')](_0x380c2f)){return _0x380c2f;}if(_[_0x1ab3('0x14')](_0x380c2f)){for(var _0x362ad7=0x0;_0x362ad7<_0x380c2f[_0x1ab3('0x21')];_0x362ad7+=0x1){_0x380c2f[_0x362ad7]=this['omit'](_0x380c2f[_0x362ad7],_0x3bf021);}return _0x380c2f;}if(!_[_0x1ab3('0x22')](_0x380c2f)){return _0x380c2f;}if(_[_0x1ab3('0x23')](_0x3bf021)){_0x3bf021=[_0x3bf021];}if(!_['isArray'](_0x3bf021)){return _0x380c2f;}for(var _0x5ab051=0x0;_0x5ab051<_0x3bf021[_0x1ab3('0x21')];_0x5ab051+=0x1){_[_0x1ab3('0x24')](_0x380c2f,_0x3bf021[_0x5ab051]);}for(var _0x14a0d0 in _0x380c2f){if(_0x380c2f['hasOwnProperty'](_0x14a0d0)){_0x380c2f[_0x14a0d0]=this[_0x1ab3('0x20')](_0x380c2f[_0x14a0d0],_0x3bf021);}}return _0x380c2f;};exports[_0x1ab3('0x25')]=function(_0x2054b7){return _0x2054b7[_0x1ab3('0x26')](RegExp(_0x1ab3('0x27')))?!![]:![];};exports[_0x1ab3('0x28')]=function(_0x44b0e3){return _0x44b0e3['match'](/^\S+@\S+$/)?!![]:![];};exports[_0x1ab3('0x29')]=function(_0x12d5ac){var _0x410930=[];_0x12d5ac['split'](/[ ,]+/)[_0x1ab3('0x2a')](function(_0x35877b){_0x35877b=_0x35877b[_0x1ab3('0x2b')](/([^:]")"+/g,'$1');_0x35877b='+'+_0x35877b+'*';if(_0x35877b['includes']('@'))_0x35877b='\x22'+_0x35877b+'\x22';_0x410930[_0x1ab3('0x2c')](_0x35877b);});return _0x410930[_0x1ab3('0x2d')]('\x20');};exports[_0x1ab3('0x2e')]=function(_0x548403,_0x44860a,_0x16d2a3){var _0x3a74de={},_0x399b5c={};if(_0x44860a[_0x1ab3('0x2f')][_0x1ab3('0x30')]){_0x44860a[_0x1ab3('0x2f')]['id']=_0x44860a[_0x1ab3('0x2f')][_0x1ab3('0x30')];delete _0x44860a[_0x1ab3('0x2f')]['$id'];}_0x3a74de[_0x1ab3('0x31')]=_[_0x1ab3('0x17')](_0x548403,_0x1ab3('0x32'));_0x3a74de[_0x1ab3('0x2f')]=_[_0x1ab3('0x2')](_0x44860a[_0x1ab3('0x2f')]);_0x3a74de[_0x1ab3('0x7')]=_[_0x1ab3('0x33')](_0x3a74de['model'],_0x3a74de[_0x1ab3('0x2f')]);_0x399b5c[_0x1ab3('0x34')]=_[_0x1ab3('0x33')](_0x3a74de[_0x1ab3('0x31')],this[_0x1ab3('0x5')](_0x44860a[_0x1ab3('0x2f')]['fields']));_0x399b5c[_0x1ab3('0x34')]=_0x399b5c[_0x1ab3('0x34')][_0x1ab3('0x21')]?_0x399b5c['attributes']:_0x3a74de['model'];if(!_0x44860a[_0x1ab3('0x2f')][_0x1ab3('0x35')](_0x1ab3('0x36'))){_0x399b5c['limit']=this[_0x1ab3('0x15')](_0x44860a['query'][_0x1ab3('0x15')]);_0x399b5c[_0x1ab3('0x16')]=this[_0x1ab3('0x16')](_0x44860a[_0x1ab3('0x2f')]['offset']);}_0x399b5c[_0x1ab3('0x37')]=this[_0x1ab3('0x38')](_0x44860a[_0x1ab3('0x2f')]['sort']);_0x399b5c[_0x1ab3('0x39')]=this[_0x1ab3('0x7')](_[_0x1ab3('0x3a')](_0x44860a[_0x1ab3('0x2f')],_0x3a74de[_0x1ab3('0x7')]),_0x548403);if(_0x44860a[_0x1ab3('0x2f')][_0x1ab3('0x3b')]){_0x399b5c['where']=_[_0x1ab3('0x3c')](_0x399b5c[_0x1ab3('0x39')],{'$or':_[_0x1ab3('0x17')](_0x548403,function(_0x2fe0d4){if(_0x2fe0d4[_0x1ab3('0xb')]!==_0x1ab3('0x3d')){if(_0x16d2a3){return sequelize['where'](sequelize['fn'](_0x1ab3('0x3e'),sequelize[_0x1ab3('0x1b')](_0x2fe0d4[_0x1ab3('0x32')])),{'$like':sequelize['fn']('lower','%'+_0x44860a[_0x1ab3('0x2f')][_0x1ab3('0x3b')]+'%')});}else{var _0x1ae6a3={};_0x1ae6a3[_0x2fe0d4[_0x1ab3('0x32')]]={'$like':'%'+_0x44860a[_0x1ab3('0x2f')][_0x1ab3('0x3b')]+'%'};return _0x1ae6a3;}}})});}_0x399b5c=_['merge']({},_0x399b5c,_0x44860a[_0x1ab3('0x3f')]);return _0x399b5c;}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 929156c..1541e74 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2a8a=['body-parser','method-override','cookie-parser','errorhandler','path','passport','cors','moment','./environment','../mysqldb','env','production','set','appPath','join','development','test','root','client','use','json\x20replacer','toISOString','static','/server/views','engine','html','renderFile','view\x20engine','urlencoded','50mb','json','express','serve-favicon'];(function(_0x4487d5,_0x292afb){var _0xa4dfc5=function(_0x1b7ee4){while(--_0x1b7ee4){_0x4487d5['push'](_0x4487d5['shift']());}};_0xa4dfc5(++_0x292afb);}(_0x2a8a,0x1cc));var _0xa2a8=function(_0x168fca,_0x556fa8){_0x168fca=_0x168fca-0x0;var _0x5516cf=_0x2a8a[_0x168fca];return _0x5516cf;};'use strict';var express=require(_0xa2a8('0x0'));var favicon=require(_0xa2a8('0x1'));var bodyParser=require(_0xa2a8('0x2'));var methodOverride=require(_0xa2a8('0x3'));var cookieParser=require(_0xa2a8('0x4'));var errorHandler=require(_0xa2a8('0x5'));var path=require(_0xa2a8('0x6'));var passport=require(_0xa2a8('0x7'));var cors=require(_0xa2a8('0x8'));var moment=require(_0xa2a8('0x9'));var config=require(_0xa2a8('0xa'));var db=require(_0xa2a8('0xb'))['db'];exports['default']=function(_0x3c1992){var _0x404902=_0x3c1992['get'](_0xa2a8('0xc'));if(_0x404902===_0xa2a8('0xd')){_0x3c1992[_0xa2a8('0xe')](_0xa2a8('0xf'),path[_0xa2a8('0x10')](config['root'],'public'));}if(_0x404902===_0xa2a8('0x11')||_0x404902===_0xa2a8('0x12')){_0x3c1992['set'](_0xa2a8('0xf'),path['join'](config[_0xa2a8('0x13')],_0xa2a8('0x14')));_0x3c1992[_0xa2a8('0x15')](errorHandler());}_0x3c1992[_0xa2a8('0xe')](_0xa2a8('0x16'),function(_0xccde5f,_0x3e6be6){if(this[_0xccde5f]instanceof Date){_0x3e6be6=this[_0xccde5f][_0xa2a8('0x17')]()['split']('.')[0x0]+'Z';}return _0x3e6be6;});_0x3c1992[_0xa2a8('0x15')](express[_0xa2a8('0x18')](_0x3c1992['get'](_0xa2a8('0xf'))));_0x3c1992[_0xa2a8('0xe')]('views',config[_0xa2a8('0x13')]+_0xa2a8('0x19'));_0x3c1992[_0xa2a8('0x1a')](_0xa2a8('0x1b'),require('ejs')[_0xa2a8('0x1c')]);_0x3c1992[_0xa2a8('0xe')](_0xa2a8('0x1d'),_0xa2a8('0x1b'));_0x3c1992[_0xa2a8('0x15')](bodyParser[_0xa2a8('0x1e')]({'limit':_0xa2a8('0x1f'),'extended':!![]}));_0x3c1992[_0xa2a8('0x15')](bodyParser[_0xa2a8('0x20')]({'limit':_0xa2a8('0x1f')}));_0x3c1992[_0xa2a8('0x15')](cors());_0x3c1992[_0xa2a8('0x15')](methodOverride());_0x3c1992[_0xa2a8('0x15')](cookieParser());_0x3c1992[_0xa2a8('0x15')](passport['initialize']());}; \ No newline at end of file +var _0xbc9a=['ejs','view\x20engine','html','urlencoded','50mb','json','initialize','express','body-parser','cookie-parser','errorhandler','path','moment','./environment','default','env','production','set','join','root','public','development','test','appPath','client','use','json\x20replacer','toISOString','static','get','views','/server/views','engine'];(function(_0x15100a,_0x29bdb0){var _0x4aa853=function(_0x299a44){while(--_0x299a44){_0x15100a['push'](_0x15100a['shift']());}};_0x4aa853(++_0x29bdb0);}(_0xbc9a,0x10f));var _0xabc9=function(_0x13f38e,_0x10ecce){_0x13f38e=_0x13f38e-0x0;var _0x2a4b96=_0xbc9a[_0x13f38e];return _0x2a4b96;};'use strict';var express=require(_0xabc9('0x0'));var favicon=require('serve-favicon');var bodyParser=require(_0xabc9('0x1'));var methodOverride=require('method-override');var cookieParser=require(_0xabc9('0x2'));var errorHandler=require(_0xabc9('0x3'));var path=require(_0xabc9('0x4'));var passport=require('passport');var cors=require('cors');var moment=require(_0xabc9('0x5'));var config=require(_0xabc9('0x6'));var db=require('../mysqldb')['db'];exports[_0xabc9('0x7')]=function(_0x66fa22){var _0xe4312d=_0x66fa22['get'](_0xabc9('0x8'));if(_0xe4312d===_0xabc9('0x9')){_0x66fa22[_0xabc9('0xa')]('appPath',path[_0xabc9('0xb')](config[_0xabc9('0xc')],_0xabc9('0xd')));}if(_0xe4312d===_0xabc9('0xe')||_0xe4312d===_0xabc9('0xf')){_0x66fa22[_0xabc9('0xa')](_0xabc9('0x10'),path[_0xabc9('0xb')](config[_0xabc9('0xc')],_0xabc9('0x11')));_0x66fa22[_0xabc9('0x12')](errorHandler());}_0x66fa22[_0xabc9('0xa')](_0xabc9('0x13'),function(_0x1ac2d7,_0x1c2ff4){if(this[_0x1ac2d7]instanceof Date){_0x1c2ff4=this[_0x1ac2d7][_0xabc9('0x14')]()['split']('.')[0x0]+'Z';}return _0x1c2ff4;});_0x66fa22[_0xabc9('0x12')](express[_0xabc9('0x15')](_0x66fa22[_0xabc9('0x16')](_0xabc9('0x10'))));_0x66fa22[_0xabc9('0xa')](_0xabc9('0x17'),config[_0xabc9('0xc')]+_0xabc9('0x18'));_0x66fa22[_0xabc9('0x19')]('html',require(_0xabc9('0x1a'))['renderFile']);_0x66fa22['set'](_0xabc9('0x1b'),_0xabc9('0x1c'));_0x66fa22['use'](bodyParser[_0xabc9('0x1d')]({'limit':_0xabc9('0x1e'),'extended':!![]}));_0x66fa22[_0xabc9('0x12')](bodyParser[_0xabc9('0x1f')]({'limit':_0xabc9('0x1e')}));_0x66fa22[_0xabc9('0x12')](cors());_0x66fa22[_0xabc9('0x12')](methodOverride());_0x66fa22['use'](cookieParser());_0x66fa22[_0xabc9('0x12')](passport[_0xabc9('0x20')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 1318197..bf2bba5 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 _0x36d0=['win32','dmidecode\x20--string\x20system-uuid','replace','hostname','macAddress','ipAddress','createHash','md5','digest','hex','substring','lodash','crypto','child_process','execSync','../environment','networkInterfaces','keys','length','filter','family','IPv4','internal','concat','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','orderBy','cpus','map','model','join','update','getUuid','licenseToken','test'];(function(_0x162fd7,_0x365162){var _0x2373a0=function(_0xa983dc){while(--_0xa983dc){_0x162fd7['push'](_0x162fd7['shift']());}};_0x2373a0(++_0x365162);}(_0x36d0,0xef));var _0x036d=function(_0x47c8da,_0x464581){_0x47c8da=_0x47c8da-0x0;var _0x2f9cae=_0x36d0[_0x47c8da];return _0x2f9cae;};'use strict';var _=require(_0x036d('0x0'));var os=require('os');var crypto=require(_0x036d('0x1'));var machine=require('bimedia-machine-uuid');var exec=require(_0x036d('0x2'))[_0x036d('0x3')];var config=require(_0x036d('0x4'));function getInterfaces(){var _0xeb90c8=[];var _0x14449e=os[_0x036d('0x5')]();var _0x2e7929=_['orderBy'](_[_0x036d('0x6')](_0x14449e));for(var _0x7fbb03=0x0;_0x7fbb03<_0x2e7929[_0x036d('0x7')];_0x7fbb03++){var _0x19a622=_0x14449e[_0x2e7929[_0x7fbb03]][_0x036d('0x8')](function(_0x12432b){return _0x12432b[_0x036d('0x9')]===_0x036d('0xa')&&_0x12432b[_0x036d('0xb')]===![];});_0xeb90c8=_0xeb90c8[_0x036d('0xc')](_0x19a622);}return _0xeb90c8;}function getFirstInterface(){var _0x28fe4c=_['head'](getInterfaces());return{'macAddress':_0x28fe4c&&_0x28fe4c[_0x036d('0xd')]?_0x28fe4c[_0x036d('0xd')]:_0x036d('0xe'),'ipAddress':_0x28fe4c&&_0x28fe4c[_0x036d('0xf')]?_0x28fe4c[_0x036d('0xf')]:_0x036d('0x10')};}exports[_0x036d('0x11')]=getFirstInterface;function getCPUhash(){var _0x2ca7b5=_[_0x036d('0x12')](os[_0x036d('0x13')]()[_0x036d('0x14')](function(_0x174152){return _0x174152[_0x036d('0x15')];}))[_0x036d('0x16')](':');return crypto['createHash']('md5')[_0x036d('0x17')](_0x2ca7b5)['digest']('hex');}exports[_0x036d('0x18')]=function(){var _0x2fee73=os['platform']();var _0x28e62b=/[0-9a-f-]{36}/;if(config[_0x036d('0x19')]&&_0x28e62b[_0x036d('0x1a')](config[_0x036d('0x19')])){return config[_0x036d('0x19')];}else if(_0x2fee73===_0x036d('0x1b')){return exec(_0x036d('0x1c'),{'encoding':'utf8'})[_0x036d('0x1d')]('\x0d\x0a','');}else{var _0x5cb00d=getFirstInterface();var _0x2a44d2=getCPUhash();var _0x6102b2=_0x2a44d2+'|'+os[_0x036d('0x1e')]()+'|'+_0x5cb00d[_0x036d('0x1f')]+'|'+_0x5cb00d[_0x036d('0x20')];var _0x12177e=crypto[_0x036d('0x21')](_0x036d('0x22'))[_0x036d('0x17')](_0x6102b2)[_0x036d('0x23')](_0x036d('0x24'));return _0x12177e[_0x036d('0x25')](0x0,0x8)+'-'+_0x12177e[_0x036d('0x25')](0x8,0xc)+'-'+_0x12177e[_0x036d('0x25')](0xc,0x10)+'-'+_0x12177e[_0x036d('0x25')](0x10,0x14)+'-'+_0x12177e[_0x036d('0x25')](0x14);}}; \ No newline at end of file +var _0x688e=['licenseToken','test','win32','dmidecode\x20--string\x20system-uuid','replace','ipAddress','createHash','hex','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','networkInterfaces','orderBy','keys','length','IPv4','internal','concat','head','mac','00:00:00:00:00:00','address','getFirstInterface','cpus','map','model','join','md5','update','digest','getUuid'];(function(_0x2f037f,_0x2958c5){var _0x2d1573=function(_0x34146e){while(--_0x34146e){_0x2f037f['push'](_0x2f037f['shift']());}};_0x2d1573(++_0x2958c5);}(_0x688e,0xb3));var _0xe688=function(_0x30cdee,_0x1d2472){_0x30cdee=_0x30cdee-0x0;var _0x4231bf=_0x688e[_0x30cdee];return _0x4231bf;};'use strict';var _=require(_0xe688('0x0'));var os=require('os');var crypto=require(_0xe688('0x1'));var machine=require(_0xe688('0x2'));var exec=require(_0xe688('0x3'))[_0xe688('0x4')];var config=require('../environment');function getInterfaces(){var _0x1fc20d=[];var _0x45425a=os[_0xe688('0x5')]();var _0xbb4645=_[_0xe688('0x6')](_[_0xe688('0x7')](_0x45425a));for(var _0x429f2c=0x0;_0x429f2c<_0xbb4645[_0xe688('0x8')];_0x429f2c++){var _0x18a666=_0x45425a[_0xbb4645[_0x429f2c]]['filter'](function(_0xe6af18){return _0xe6af18['family']===_0xe688('0x9')&&_0xe6af18[_0xe688('0xa')]===![];});_0x1fc20d=_0x1fc20d[_0xe688('0xb')](_0x18a666);}return _0x1fc20d;}function getFirstInterface(){var _0x4e4bff=_[_0xe688('0xc')](getInterfaces());return{'macAddress':_0x4e4bff&&_0x4e4bff[_0xe688('0xd')]?_0x4e4bff[_0xe688('0xd')]:_0xe688('0xe'),'ipAddress':_0x4e4bff&&_0x4e4bff[_0xe688('0xf')]?_0x4e4bff[_0xe688('0xf')]:'127.0.0.1'};}exports[_0xe688('0x10')]=getFirstInterface;function getCPUhash(){var _0x5b3b5f=_[_0xe688('0x6')](os[_0xe688('0x11')]()[_0xe688('0x12')](function(_0x1bfa6c){return _0x1bfa6c[_0xe688('0x13')];}))[_0xe688('0x14')](':');return crypto['createHash'](_0xe688('0x15'))[_0xe688('0x16')](_0x5b3b5f)[_0xe688('0x17')]('hex');}exports[_0xe688('0x18')]=function(){var _0x553d8a=os['platform']();var _0x200d77=/[0-9a-f-]{36}/;if(config[_0xe688('0x19')]&&_0x200d77[_0xe688('0x1a')](config[_0xe688('0x19')])){return config[_0xe688('0x19')];}else if(_0x553d8a===_0xe688('0x1b')){return exec(_0xe688('0x1c'),{'encoding':'utf8'})[_0xe688('0x1d')]('\x0d\x0a','');}else{var _0x296ced=getFirstInterface();var _0x188021=getCPUhash();var _0x5dc4cb=_0x188021+'|'+os['hostname']()+'|'+_0x296ced['macAddress']+'|'+_0x296ced[_0xe688('0x1e')];var _0x3b2e02=crypto[_0xe688('0x1f')](_0xe688('0x15'))[_0xe688('0x16')](_0x5dc4cb)[_0xe688('0x17')](_0xe688('0x20'));return _0x3b2e02[_0xe688('0x21')](0x0,0x8)+'-'+_0x3b2e02[_0xe688('0x21')](0x8,0xc)+'-'+_0x3b2e02[_0xe688('0x21')](0xc,0x10)+'-'+_0x3b2e02[_0xe688('0x21')](0x10,0x14)+'-'+_0x3b2e02[_0xe688('0x21')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index a8adb98..e588039 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 _0x34cb=['./hardware','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','GET','then','get','data1','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','Disabled','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','update','encryptString','diff','days','catch','error','message','finally','getUuid','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','util','moment','request-promise','bluebird','version','../../mysqldb','../../components/encryptor'];(function(_0x4e029d,_0x14dfde){var _0x45a9ff=function(_0x1fa9eb){while(--_0x1fa9eb){_0x4e029d['push'](_0x4e029d['shift']());}};_0x45a9ff(++_0x14dfde);}(_0x34cb,0x190));var _0xb34c=function(_0x5bc1e8,_0x26ac75){_0x5bc1e8=_0x5bc1e8-0x0;var _0xb24517=_0x34cb[_0x5bc1e8];return _0xb24517;};'use strict';var util=require(_0xb34c('0x0'));var moment=require(_0xb34c('0x1'));var rp=require(_0xb34c('0x2'));var BPromise=require(_0xb34c('0x3'));var pkginfo=require('pkginfo')(module,_0xb34c('0x4'));var db=require(_0xb34c('0x5'))['db'];var encryptor=require(_0xb34c('0x6'));var hardware=require(_0xb34c('0x7'));var logger=require('../logger')(_0xb34c('0x8'));var HOST=_0xb34c('0x9');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x5aa271){return new BPromise(function(_0x581690,_0x3cc75d){var _0x89881d=util[_0xb34c('0xa')](_0xb34c('0xb'),HOST,_0x5aa271,module[_0xb34c('0xc')][_0xb34c('0x4')]);if(oldToken){_0x89881d=util['format']('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x5aa271,module[_0xb34c('0xc')]['version'],oldToken);}var _0x486030={'uri':_0x89881d,'method':_0xb34c('0xd'),'timeout':0xea60,'json':!![]};return rp(_0x486030)[_0xb34c('0xe')](function(_0x364782){_0x581690(_0x364782);})['catch'](function(_0x5a226b){_0x3cc75d(_0x5a226b);});});}function manageLicense(_0x376876,_0x421069){var _0x49c916=_0x421069[_0xb34c('0xf')]({'plain':!![]});if(!isOldTokenSent&&_0x49c916[_0xb34c('0x10')]!==_0x376876&&!_0x49c916[_0xb34c('0x11')]){oldToken=_0x49c916[_0xb34c('0x10')];}httpRequest(_0x376876)[_0xb34c('0xe')](function(_0x5acb0e){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x5acb0e['active']){isOldTokenSent=![];if(!_0x49c916[_0xb34c('0x8')]&&_0x49c916['license']!=_0x5acb0e[_0xb34c('0x8')]||_0x49c916[_0xb34c('0x8')]&&_0x49c916['data2']){logger[_0xb34c('0x12')](_0xb34c('0x13'));}if(_0x49c916[_0xb34c('0x8')]&&!_0x49c916[_0xb34c('0x11')]&&_0x49c916[_0xb34c('0x8')]!=_0x5acb0e[_0xb34c('0x8')]){logger[_0xb34c('0x12')](_0xb34c('0x14'));}if(_0x49c916[_0xb34c('0x8')]&&!_0x49c916['data2']&&_0x49c916['license']==_0x5acb0e[_0xb34c('0x8')]){return _0x421069;}return _0x421069['update']({'data1':_0x376876,'data2':null,'license':_0x5acb0e['license']});}else{if(_0x5acb0e['license']||_0x49c916[_0xb34c('0x8')]){if(!_0x49c916[_0xb34c('0x11')]){if(_0x49c916[_0xb34c('0x10')]==_0x376876){GRAY_PERIOD_REASON=_0xb34c('0x15');logger[_0xb34c('0x12')]('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON='Changed';logger['info'](_0xb34c('0x16'),_0x49c916['data1'],_0x376876);}logger[_0xb34c('0x12')](_0xb34c('0x17'),GRAY_PERIOD_REASON[_0xb34c('0x18')](),moment()[_0xb34c('0xa')](_0xb34c('0x19')));return _0x421069[_0xb34c('0x1a')]({'data2':encryptor[_0xb34c('0x1b')](moment()[_0xb34c('0xa')](_0xb34c('0x19')))});}else{if(moment()[_0xb34c('0x1c')](encryptor['decryptString'](_0x49c916[_0xb34c('0x11')]),_0xb34c('0x1d'))>DAYS){logger[_0xb34c('0x12')]('DEMO\x20START\x20AT\x20%s',moment()[_0xb34c('0xa')](_0xb34c('0x19')));isOldTokenSent=![];return _0x421069[_0xb34c('0x1a')]({'data1':_0x376876,'data2':null,'license':null});}}}else{if(_0x49c916['data1']!=_0x376876){logger[_0xb34c('0x12')](_0xb34c('0x16'),_0x49c916['data1'],_0x376876);return _0x421069[_0xb34c('0x1a')]({'data1':_0x376876,'data2':null,'license':null});}}}return _0x421069;})[_0xb34c('0xe')](function(_0x171e4c){_0x421069=_0x171e4c;})[_0xb34c('0x1e')](function(_0x3d5d98){logger[_0xb34c('0x1f')](_0x3d5d98[_0xb34c('0x20')]);})[_0xb34c('0x21')](function(){setTimeout(function(){manageLicense(hardware[_0xb34c('0x22')](),_0x421069);},TIME);});}function defaultLicense(){var _0x210982=hardware[_0xb34c('0x22')]();if(_0x210982){return db['License']['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x210982}})[_0xb34c('0x23')](function(_0x4eab6c,_0x14406e){logger[_0xb34c('0x12')](_0xb34c('0x24'),_0x210982);manageLicense(_0x210982,_0x4eab6c);})['catch'](function(_0x26ce53){logger[_0xb34c('0x1f')](_0x26ce53['message']);});}}exports['default']=defaultLicense; \ No newline at end of file +var _0x71e4=['moment','bluebird','version','../../mysqldb','../../components/encryptor','./hardware','../logger','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','%s/api/servers/%s/check?version=%s&oldtoken=%s','exports','GET','then','catch','get','data1','data2','active','license','info','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','diff','decryptString','days','DEMO\x20START\x20AT\x20%s','message','finally','getUuid','License','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','error','util'];(function(_0x2e8b45,_0x40b219){var _0x173aa2=function(_0x519636){while(--_0x519636){_0x2e8b45['push'](_0x2e8b45['shift']());}};_0x173aa2(++_0x40b219);}(_0x71e4,0x1c2));var _0x471e=function(_0xb98d8d,_0x481423){_0xb98d8d=_0xb98d8d-0x0;var _0x489b15=_0x71e4[_0xb98d8d];return _0x489b15;};'use strict';var util=require(_0x471e('0x0'));var moment=require(_0x471e('0x1'));var rp=require('request-promise');var BPromise=require(_0x471e('0x2'));var pkginfo=require('pkginfo')(module,_0x471e('0x3'));var db=require(_0x471e('0x4'))['db'];var encryptor=require(_0x471e('0x5'));var hardware=require(_0x471e('0x6'));var logger=require(_0x471e('0x7'))('license');var HOST=_0x471e('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x4df884){return new BPromise(function(_0x3b391f,_0x257c6a){var _0x1eeddc=util[_0x471e('0x9')](_0x471e('0xa'),HOST,_0x4df884,module['exports'][_0x471e('0x3')]);if(oldToken){_0x1eeddc=util[_0x471e('0x9')](_0x471e('0xb'),HOST,_0x4df884,module[_0x471e('0xc')]['version'],oldToken);}var _0x36429a={'uri':_0x1eeddc,'method':_0x471e('0xd'),'timeout':0xea60,'json':!![]};return rp(_0x36429a)[_0x471e('0xe')](function(_0x12d7df){_0x3b391f(_0x12d7df);})[_0x471e('0xf')](function(_0x370116){_0x257c6a(_0x370116);});});}function manageLicense(_0x444fa7,_0x1399ef){var _0x8d1c4b=_0x1399ef[_0x471e('0x10')]({'plain':!![]});if(!isOldTokenSent&&_0x8d1c4b[_0x471e('0x11')]!==_0x444fa7&&!_0x8d1c4b[_0x471e('0x12')]){oldToken=_0x8d1c4b[_0x471e('0x11')];}httpRequest(_0x444fa7)[_0x471e('0xe')](function(_0x263b4b){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x263b4b[_0x471e('0x13')]){isOldTokenSent=![];if(!_0x8d1c4b[_0x471e('0x14')]&&_0x8d1c4b['license']!=_0x263b4b[_0x471e('0x14')]||_0x8d1c4b['license']&&_0x8d1c4b['data2']){logger[_0x471e('0x15')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x8d1c4b['license']&&!_0x8d1c4b['data2']&&_0x8d1c4b[_0x471e('0x14')]!=_0x263b4b['license']){logger[_0x471e('0x15')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x8d1c4b[_0x471e('0x14')]&&!_0x8d1c4b[_0x471e('0x12')]&&_0x8d1c4b['license']==_0x263b4b['license']){return _0x1399ef;}return _0x1399ef[_0x471e('0x16')]({'data1':_0x444fa7,'data2':null,'license':_0x263b4b[_0x471e('0x14')]});}else{if(_0x263b4b[_0x471e('0x14')]||_0x8d1c4b['license']){if(!_0x8d1c4b[_0x471e('0x12')]){if(_0x8d1c4b[_0x471e('0x11')]==_0x444fa7){GRAY_PERIOD_REASON=_0x471e('0x17');logger[_0x471e('0x15')](_0x471e('0x18'));}else{GRAY_PERIOD_REASON=_0x471e('0x19');logger['info'](_0x471e('0x1a'),_0x8d1c4b[_0x471e('0x11')],_0x444fa7);}logger[_0x471e('0x15')]('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON[_0x471e('0x1b')](),moment()['format'](_0x471e('0x1c')));return _0x1399ef[_0x471e('0x16')]({'data2':encryptor[_0x471e('0x1d')](moment()[_0x471e('0x9')](_0x471e('0x1c')))});}else{if(moment()[_0x471e('0x1e')](encryptor[_0x471e('0x1f')](_0x8d1c4b[_0x471e('0x12')]),_0x471e('0x20'))>DAYS){logger[_0x471e('0x15')](_0x471e('0x21'),moment()[_0x471e('0x9')](_0x471e('0x1c')));isOldTokenSent=![];return _0x1399ef['update']({'data1':_0x444fa7,'data2':null,'license':null});}}}else{if(_0x8d1c4b['data1']!=_0x444fa7){logger[_0x471e('0x15')](_0x471e('0x1a'),_0x8d1c4b[_0x471e('0x11')],_0x444fa7);return _0x1399ef[_0x471e('0x16')]({'data1':_0x444fa7,'data2':null,'license':null});}}}return _0x1399ef;})['then'](function(_0x4e67d4){_0x1399ef=_0x4e67d4;})[_0x471e('0xf')](function(_0x5d15b9){logger['error'](_0x5d15b9[_0x471e('0x22')]);})[_0x471e('0x23')](function(){setTimeout(function(){manageLicense(hardware[_0x471e('0x24')](),_0x1399ef);},TIME);});}function defaultLicense(){var _0xbee0a8=hardware['getUuid']();if(_0xbee0a8){return db[_0x471e('0x25')]['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0xbee0a8}})[_0x471e('0x26')](function(_0x1d1fa1,_0x371e0c){logger[_0x471e('0x15')](_0x471e('0x27'),_0xbee0a8);manageLicense(_0xbee0a8,_0x1d1fa1);})['catch'](function(_0x54bf8d){logger[_0x471e('0x28')](_0x54bf8d[_0x471e('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 44435bc..7167acb 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 _0x4916=['License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','moment','bluebird','./hardware','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','License','find','defaults','then','catch','uuid','data1','license','isEmpty','data2','split','format','%s:%s:%s','parse','demo','machineUuid','decryptString','gray','add','days','changed','disabled','message','findAll','role','sequelize','COUNT','col','count','admin','user','telephone','users','forEach','countBy'];(function(_0x326797,_0x39262a){var _0x4c2052=function(_0x5468f2){while(--_0x5468f2){_0x326797['push'](_0x326797['shift']());}};_0x4c2052(++_0x39262a);}(_0x4916,0x10a));var _0x6491=function(_0x3b02dd,_0x16847e){_0x3b02dd=_0x3b02dd-0x0;var _0x538563=_0x4916[_0x3b02dd];return _0x538563;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x6491('0x0'));var BPromise=require(_0x6491('0x1'));var hardware=require(_0x6491('0x2'));var encryptor=require('../../components/encryptor');var db=require(_0x6491('0x3'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x6491('0x4'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x6491('0x5'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x6491('0x4'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','machineUuid':hardware[_0x6491('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x1edab8){return new BPromise(function(_0x492a5a,_0x15cfb4){return db[_0x6491('0x7')][_0x6491('0x8')](_[_0x6491('0x9')](_0x1edab8,{'raw':!![],'where':{'id':0x1}}))[_0x6491('0xa')](function(_0x4929d5){return checkLicense(_0x4929d5,null);})[_0x6491('0xa')](function(_0x263297){_0x492a5a(_0x263297);return;})[_0x6491('0xb')](function(_0x384a34){_0x15cfb4(_0x384a34);});});}function checkLicense(_0x5944e9,_0x481e97){if(!_0x5944e9){demoLicense[_0x6491('0xc')]=_0x5944e9[_0x6491('0xd')];return demoLicense;}try{var _0x38924c=_0x481e97||_0x5944e9[_0x6491('0xe')];if(_[_0x6491('0xf')](_0x38924c)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0xdb242e=_0x5944e9[_0x6491('0xd')];var _0x3b3b21=_0x5944e9[_0x6491('0x10')];var _0x4ebdda=_0xdb242e[_0x6491('0x11')]('-')[0x4];var _0x50bf1e=_0xdb242e['split']('-')[0x0];var _0x1a6c65=encryptor['decryptString'](_0x38924c,util[_0x6491('0x12')](_0x6491('0x13'),_0x4ebdda,_0xdb242e,_0x50bf1e));var _0x4a765a=JSON[_0x6491('0x14')](_0x1a6c65);_0x4a765a[_0x6491('0x15')]=![];_0x4a765a[_0x6491('0xc')]=_0xdb242e;_0x4a765a[_0x6491('0x16')]=hardware[_0x6491('0x6')]();if(_0x3b3b21){var _0x27e1b7=encryptor[_0x6491('0x17')](_0x3b3b21);_0x4a765a[_0x6491('0x18')]=_0x27e1b7;_0x4a765a['deadline']=moment(_0x27e1b7)[_0x6491('0x19')](0x7,_0x6491('0x1a'))[_0x6491('0x12')]();_0x4a765a['grayReason']=_0x4a765a[_0x6491('0xc')]!=_0x4a765a[_0x6491('0x16')]?_0x6491('0x1b'):_0x6491('0x1c');}return _0x4a765a;}catch(_0x1f0814){breakingLicense['uuid']=_0x5944e9[_0x6491('0xd')];breakingLicense[_0x6491('0x1d')]=_0x1f0814[_0x6491('0x1d')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x19c98e,_0xd23d93){getLicense()[_0x6491('0xa')](function(_0x24a16b){return db['User'][_0x6491('0x1e')]({'attributes':[_0x6491('0x1f'),[db[_0x6491('0x20')]['fn'](_0x6491('0x21'),db[_0x6491('0x20')][_0x6491('0x22')](_0x6491('0x1f'))),_0x6491('0x23')]],'group':_0x6491('0x1f'),'where':{'role':{'$or':[_0x6491('0x24'),_0x6491('0x25'),_0x6491('0x26')]}},'raw':!![]})[_0x6491('0xa')](function(_0x4482b6){var _0x42a9d8={'user':_0x24a16b[_0x6491('0x27')]||0x0,'telephone':_0x24a16b['telephones']||0x0};_0x4482b6[_0x6491('0x28')](function(_0x423897){var _0x421b21=_0x423897[_0x6491('0x1f')]===_0x6491('0x24')?_0x6491('0x25'):_0x423897[_0x6491('0x1f')];_0x42a9d8[_0x421b21]-=_0x423897[_0x6491('0x23')];if(_0x42a9d8[_0x421b21]<0x0)_0x42a9d8[_0x421b21]=0x0;});_0x19c98e(_0x42a9d8);return;});})['catch'](function(_0x469cbb){_0xd23d93(_0x469cbb);});});}function checkUserLimits(_0x149c93){return new BPromise(function(_0x215a47,_0x22da04){getLimits()[_0x6491('0xa')](function(_0x2702e4){var _0x4dab01=_['pick'](_[_0x6491('0x29')](_0x149c93,_0x6491('0x1f')),[_0x6491('0x24'),'user','telephone']);var _0xa7171b=(_0x4dab01[_0x6491('0x24')]||0x0)+(_0x4dab01[_0x6491('0x25')]||0x0);var _0xf6e6c1=_0x4dab01[_0x6491('0x26')]||0x0;if(_0xa7171b>_0x2702e4['user'])return _0x22da04(_0x6491('0x2a'));if(_0xf6e6c1>_0x2702e4[_0x6491('0x26')])return _0x22da04(_0x6491('0x2b'));return _0x215a47();})[_0x6491('0xb')](function(_0x139a1a){_0x22da04(_0x139a1a);});});}module['exports']={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0xaf0d=['decryptString','format','%s:%s:%s','parse','demo','machineUuid','gray','deadline','add','days','grayReason','disabled','message','User','role','sequelize','COUNT','col','count','user','telephone','users','telephones','forEach','admin','pick','countBy','License\x20limit\x20reached\x20for\x20users','lodash','bluebird','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','Breaking\x20license','getUuid','License','find','defaults','then','catch','uuid','data1','license','License\x20key\x20value\x20not\x20found','data2','split'];(function(_0xa81b8c,_0x389aae){var _0x4c11b3=function(_0x2f990c){while(--_0x2f990c){_0xa81b8c['push'](_0xa81b8c['shift']());}};_0x4c11b3(++_0x389aae);}(_0xaf0d,0x7a));var _0xdaf0=function(_0x39eae0,_0x4556ea){_0x39eae0=_0x39eae0-0x0;var _0x121579=_0xaf0d[_0x39eae0];return _0x121579;};'use strict';var util=require('util');var _=require(_0xdaf0('0x0'));var moment=require('moment');var BPromise=require(_0xdaf0('0x1'));var hardware=require('./hardware');var encryptor=require(_0xdaf0('0x2'));var db=require(_0xdaf0('0x3'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xdaf0('0x4'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xdaf0('0x5'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xdaf0('0x4'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xdaf0('0x6'),'machineUuid':hardware[_0xdaf0('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x5ba4fd){return new BPromise(function(_0x2318f8,_0x3285ae){return db[_0xdaf0('0x8')][_0xdaf0('0x9')](_[_0xdaf0('0xa')](_0x5ba4fd,{'raw':!![],'where':{'id':0x1}}))[_0xdaf0('0xb')](function(_0x169cff){return checkLicense(_0x169cff,null);})[_0xdaf0('0xb')](function(_0x54a11f){_0x2318f8(_0x54a11f);return;})[_0xdaf0('0xc')](function(_0x57a541){_0x3285ae(_0x57a541);});});}function checkLicense(_0x59630e,_0x3ecb49){if(!_0x59630e){demoLicense[_0xdaf0('0xd')]=_0x59630e[_0xdaf0('0xe')];return demoLicense;}try{var _0x53e5aa=_0x3ecb49||_0x59630e[_0xdaf0('0xf')];if(_['isEmpty'](_0x53e5aa)){throw new Error(_0xdaf0('0x10'));}var _0xad6264=_0x59630e['data1'];var _0x48ab42=_0x59630e[_0xdaf0('0x11')];var _0x4c022c=_0xad6264[_0xdaf0('0x12')]('-')[0x4];var _0x4a3860=_0xad6264[_0xdaf0('0x12')]('-')[0x0];var _0x1d1ee4=encryptor[_0xdaf0('0x13')](_0x53e5aa,util[_0xdaf0('0x14')](_0xdaf0('0x15'),_0x4c022c,_0xad6264,_0x4a3860));var _0x159d24=JSON[_0xdaf0('0x16')](_0x1d1ee4);_0x159d24[_0xdaf0('0x17')]=![];_0x159d24['uuid']=_0xad6264;_0x159d24[_0xdaf0('0x18')]=hardware['getUuid']();if(_0x48ab42){var _0x268ad=encryptor[_0xdaf0('0x13')](_0x48ab42);_0x159d24[_0xdaf0('0x19')]=_0x268ad;_0x159d24[_0xdaf0('0x1a')]=moment(_0x268ad)[_0xdaf0('0x1b')](0x7,_0xdaf0('0x1c'))[_0xdaf0('0x14')]();_0x159d24[_0xdaf0('0x1d')]=_0x159d24['uuid']!=_0x159d24[_0xdaf0('0x18')]?'changed':_0xdaf0('0x1e');}return _0x159d24;}catch(_0x3ab0b3){breakingLicense[_0xdaf0('0xd')]=_0x59630e[_0xdaf0('0xe')];breakingLicense[_0xdaf0('0x1f')]=_0x3ab0b3['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x4b0312,_0x5a5759){getLicense()['then'](function(_0x184374){return db[_0xdaf0('0x20')]['findAll']({'attributes':[_0xdaf0('0x21'),[db[_0xdaf0('0x22')]['fn'](_0xdaf0('0x23'),db[_0xdaf0('0x22')][_0xdaf0('0x24')](_0xdaf0('0x21'))),_0xdaf0('0x25')]],'group':_0xdaf0('0x21'),'where':{'role':{'$or':['admin',_0xdaf0('0x26'),_0xdaf0('0x27')]}},'raw':!![]})[_0xdaf0('0xb')](function(_0x20c285){var _0x1d8507={'user':_0x184374[_0xdaf0('0x28')]||0x0,'telephone':_0x184374[_0xdaf0('0x29')]||0x0};_0x20c285[_0xdaf0('0x2a')](function(_0x32319f){var _0x4c146d=_0x32319f[_0xdaf0('0x21')]===_0xdaf0('0x2b')?_0xdaf0('0x26'):_0x32319f[_0xdaf0('0x21')];_0x1d8507[_0x4c146d]-=_0x32319f[_0xdaf0('0x25')];if(_0x1d8507[_0x4c146d]<0x0)_0x1d8507[_0x4c146d]=0x0;});_0x4b0312(_0x1d8507);return;});})['catch'](function(_0x408a9b){_0x5a5759(_0x408a9b);});});}function checkUserLimits(_0x2757e9){return new BPromise(function(_0x28ec08,_0x5c17f0){getLimits()[_0xdaf0('0xb')](function(_0x361d44){var _0x3cf317=_[_0xdaf0('0x2c')](_[_0xdaf0('0x2d')](_0x2757e9,'role'),[_0xdaf0('0x2b'),'user',_0xdaf0('0x27')]);var _0x29840d=(_0x3cf317[_0xdaf0('0x2b')]||0x0)+(_0x3cf317[_0xdaf0('0x26')]||0x0);var _0x4dd905=_0x3cf317[_0xdaf0('0x27')]||0x0;if(_0x29840d>_0x361d44[_0xdaf0('0x26')])return _0x5c17f0(_0xdaf0('0x2e'));if(_0x4dd905>_0x361d44[_0xdaf0('0x27')])return _0x5c17f0('License\x20limit\x20reached\x20for\x20telephones');return _0x28ec08();})[_0xdaf0('0xc')](function(_0x2a52ea){_0x5c17f0(_0x2a52ea);});});}module['exports']={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file diff --git a/server/config/local.env.js b/server/config/local.env.js index 5ce5e36..d542f34 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 _0x1c9a=['myappanuglar-secret','secret','exports'];(function(_0x5f0661,_0x482a00){var _0x216354=function(_0x2c5b0a){while(--_0x2c5b0a){_0x5f0661['push'](_0x5f0661['shift']());}};_0x216354(++_0x482a00);}(_0x1c9a,0x98));var _0xa1c9=function(_0x14b2be,_0xde05de){_0x14b2be=_0x14b2be-0x0;var _0x5ea869=_0x1c9a[_0x14b2be];return _0x5ea869;};'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 +var _0x5f66=['app-id','secret','http://localhost:9000'];(function(_0x4b1e60,_0x4a2e1c){var _0x27f958=function(_0x3570d2){while(--_0x3570d2){_0x4b1e60['push'](_0x4b1e60['shift']());}};_0x27f958(++_0x4a2e1c);}(_0x5f66,0x1a0));var _0x65f6=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x5f66[_0x2b4411];return _0x8e41ef;};'use strict';module['exports']={'DOMAIN':_0x65f6('0x0'),'SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0x65f6('0x1'),'GOOGLE_SECRET':_0x65f6('0x2'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 995828d..ee8feb7 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x114c=['join','/var','log','replace','{{{','format','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','toUpperCase','message','exports','transports','File','%s-%s','error','info','Console','env','debugLevel','moment','winston','util','INFO'];(function(_0x4ca852,_0xb69fbf){var _0xaab42c=function(_0x38787e){while(--_0x38787e){_0x4ca852['push'](_0x4ca852['shift']());}};_0xaab42c(++_0xb69fbf);}(_0x114c,0xb4));var _0xc114=function(_0x36e400,_0x54a1b9){_0x36e400=_0x36e400-0x0;var _0x4951e0=_0x114c[_0x36e400];return _0x4951e0;};'use strict';var moment=require(_0xc114('0x0'));var winston=require(_0xc114('0x1'));var util=require(_0xc114('0x2'));var path=require('path');var debugLevel=_0xc114('0x3');function filename(_0x545f77,_0x4b1a1b){return path[_0xc114('0x4')](_0xc114('0x5'),_0xc114('0x6'),'xcally',util['format']('%s-%s.log',_0x545f77,_0x4b1a1b));}function formatter(_0x47fcc5,_0x2b43bb){_0x2b43bb['message']=_0x2b43bb['message'][_0xc114('0x7')](/@@{/g,_0xc114('0x8'))[_0xc114('0x7')](/}@@/g,'}}}')[_0xc114('0x7')](/@{/g,'{{')['replace'](/}@/g,'}}');return util[_0xc114('0x9')](_0xc114('0xa'),moment()['format'](_0xc114('0xb')),_0x2b43bb['level'][_0xc114('0xc')](),_0x47fcc5,_0x2b43bb[_0xc114('0xd')]);}module[_0xc114('0xe')]=function(_0x714246){return new winston['Logger']({'transports':[new winston[(_0xc114('0xf'))][(_0xc114('0x10'))]({'name':util[_0xc114('0x9')](_0xc114('0x11'),_0x714246,_0xc114('0x12')),'filename':filename(_0x714246,_0xc114('0x12')),'level':_0xc114('0x12'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x3bd6cb){return formatter(_0x714246,_0x3bd6cb);}}),new winston[(_0xc114('0xf'))]['File']({'name':util[_0xc114('0x9')](_0xc114('0x11'),_0x714246,'info'),'filename':filename(_0x714246,_0xc114('0x13')),'level':_0xc114('0x13'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x8847e0){return formatter(_0x714246,_0x8847e0);}}),new winston[(_0xc114('0xf'))][(_0xc114('0x14'))]({'level':process[_0xc114('0x15')][_0xc114('0x16')]||debugLevel,'json':![],'formatter':function(_0x26cff7){return formatter(_0x714246,_0x26cff7);}})]});}; \ No newline at end of file +var _0x8911=['replace','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','message','exports','Logger','transports','File','error','%s-%s','info','Console','debugLevel','moment','winston','util','path','join','xcally','format','%s-%s.log','{{{'];(function(_0x3cc634,_0x1fa280){var _0x5530fe=function(_0xf42993){while(--_0xf42993){_0x3cc634['push'](_0x3cc634['shift']());}};_0x5530fe(++_0x1fa280);}(_0x8911,0x115));var _0x1891=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8911[_0x14add3];return _0x4a174f;};'use strict';var moment=require(_0x1891('0x0'));var winston=require(_0x1891('0x1'));var util=require(_0x1891('0x2'));var path=require(_0x1891('0x3'));var debugLevel='INFO';function filename(_0x2323df,_0x291b49){return path[_0x1891('0x4')]('/var','log',_0x1891('0x5'),util[_0x1891('0x6')](_0x1891('0x7'),_0x2323df,_0x291b49));}function formatter(_0x5a4449,_0x44b9fb){_0x44b9fb['message']=_0x44b9fb['message']['replace'](/@@{/g,_0x1891('0x8'))[_0x1891('0x9')](/}@@/g,'}}}')['replace'](/@{/g,'{{')[_0x1891('0x9')](/}@/g,'}}');return util[_0x1891('0x6')](_0x1891('0xa'),moment()[_0x1891('0x6')](_0x1891('0xb')),_0x44b9fb['level']['toUpperCase'](),_0x5a4449,_0x44b9fb[_0x1891('0xc')]);}module[_0x1891('0xd')]=function(_0x494256){return new winston[(_0x1891('0xe'))]({'transports':[new winston[(_0x1891('0xf'))][(_0x1891('0x10'))]({'name':util['format']('%s-%s',_0x494256,_0x1891('0x11')),'filename':filename(_0x494256,_0x1891('0x11')),'level':_0x1891('0x11'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x142bf1){return formatter(_0x494256,_0x142bf1);}}),new winston[(_0x1891('0xf'))]['File']({'name':util['format'](_0x1891('0x12'),_0x494256,_0x1891('0x13')),'filename':filename(_0x494256,_0x1891('0x13')),'level':_0x1891('0x13'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x353473){return formatter(_0x494256,_0x353473);}}),new winston['transports'][(_0x1891('0x14'))]({'level':process['env'][_0x1891('0x15')]||debugLevel,'json':![],'formatter':function(_0x3c443c){return formatter(_0x494256,_0x3c443c);}})]});}; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 4481fa1..e53c96b 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 _0x2412=['join','../../services/ami/index.js','../../services/email/index.js','../../services/routing/index.js','exports','path','express','../../services/express/index.js','ami'];(function(_0x43b0e7,_0x84c98a){var _0x207d0f=function(_0x10c9f6){while(--_0x10c9f6){_0x43b0e7['push'](_0x43b0e7['shift']());}};_0x207d0f(++_0x84c98a);}(_0x2412,0x1a3));var _0x2241=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2412[_0x3dd15e];return _0x231fd0;};'use strict';var path=require(_0x2241('0x0'));var os=require('os');var config={'apps':[{'name':_0x2241('0x1'),'script':path['join'](__dirname,_0x2241('0x2'))},{'name':_0x2241('0x3'),'script':path[_0x2241('0x4')](__dirname,_0x2241('0x5'))},{'name':'agi','script':path[_0x2241('0x4')](__dirname,'../../services/agi/index.js')},{'name':'email','script':path['join'](__dirname,_0x2241('0x6'))},{'name':'routing','script':path[_0x2241('0x4')](__dirname,_0x2241('0x7'))},{'name':'xdr','script':path[_0x2241('0x4')](__dirname,'../../services/xdr/index.js')}]};module[_0x2241('0x8')]=config; \ No newline at end of file +var _0x95d0=['join','../../services/express/index.js','ami','agi','../../services/agi/index.js','routing','../../services/routing/index.js','../../services/xdr/index.js','exports','path','express'];(function(_0x2dcf8b,_0x477184){var _0x287c68=function(_0x5f1689){while(--_0x5f1689){_0x2dcf8b['push'](_0x2dcf8b['shift']());}};_0x287c68(++_0x477184);}(_0x95d0,0x1e2));var _0x095d=function(_0x54c7a8,_0x45aba5){_0x54c7a8=_0x54c7a8-0x0;var _0x2d5d6e=_0x95d0[_0x54c7a8];return _0x2d5d6e;};'use strict';var path=require(_0x095d('0x0'));var os=require('os');var config={'apps':[{'name':_0x095d('0x1'),'script':path[_0x095d('0x2')](__dirname,_0x095d('0x3'))},{'name':_0x095d('0x4'),'script':path['join'](__dirname,'../../services/ami/index.js')},{'name':_0x095d('0x5'),'script':path['join'](__dirname,_0x095d('0x6'))},{'name':'email','script':path[_0x095d('0x2')](__dirname,'../../services/email/index.js')},{'name':_0x095d('0x7'),'script':path['join'](__dirname,_0x095d('0x8'))},{'name':'xdr','script':path[_0x095d('0x2')](__dirname,_0x095d('0x9'))}]};module[_0x095d('0xa')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 47283d4..8124e8e 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 _0xd11d=['describe','delete','dump','saved','pm2','bluebird','./config','connect','then','start','disconnect','stop','restart','list'];(function(_0x171882,_0x265c97){var _0x23a210=function(_0x183bd2){while(--_0x183bd2){_0x171882['push'](_0x171882['shift']());}};_0x23a210(++_0x265c97);}(_0xd11d,0x19a));var _0xdd11=function(_0xf3f4d0,_0x1419b4){_0xf3f4d0=_0xf3f4d0-0x0;var _0x29565c=_0xd11d[_0xf3f4d0];return _0x29565c;};'use strict';var pm2=require(_0xdd11('0x0'));var BPromise=require(_0xdd11('0x1'));var config=require(_0xdd11('0x2'));function connect(){return new BPromise(function(_0x4379e9,_0x3d79ed){return pm2[_0xdd11('0x3')](function(_0x13892d){if(_0x13892d){return _0x3d79ed(_0x13892d);}return _0x4379e9('connected');});});};exports['start']=function(_0x1be615){return connect()[_0xdd11('0x4')](function(){return new BPromise(function(_0x487296,_0x4beec8){return pm2[_0xdd11('0x5')](_0x1be615,function(_0x5ecaca,_0xd7326e){if(_0x5ecaca){return _0x4beec8(_0x5ecaca);}pm2[_0xdd11('0x6')]();return _0x487296(_0xd7326e);});});});};exports[_0xdd11('0x7')]=function(_0xe32e80){return connect()[_0xdd11('0x4')](function(){return new BPromise(function(_0x475313,_0x6f5351){return pm2[_0xdd11('0x7')](_0xe32e80,function(_0x463a14,_0x924ed3){if(_0x463a14){return _0x6f5351(_0x463a14);}pm2[_0xdd11('0x6')]();return _0x475313(_0x924ed3);});});});};exports[_0xdd11('0x8')]=function(_0x138a68){return connect()[_0xdd11('0x4')](function(){return new BPromise(function(_0x13136d,_0x1eecc7){return pm2['restart'](_0x138a68,function(_0x2135f4,_0x5d233b){if(_0x2135f4){return _0x1eecc7(_0x2135f4);}pm2['disconnect']();return _0x13136d(_0x5d233b);});});});};exports[_0xdd11('0x9')]=function(){return connect()[_0xdd11('0x4')](function(){return new BPromise(function(_0x1cc07b,_0x21a5a0){return pm2['list'](function(_0x4a35dd,_0x7fcf50){if(_0x4a35dd){return _0x21a5a0(_0x4a35dd);}pm2[_0xdd11('0x6')]();return _0x1cc07b(_0x7fcf50);});});});};exports['describe']=function(_0x2dfedc){return connect()[_0xdd11('0x4')](function(){return new BPromise(function(_0x6d0a87,_0x4f9c1e){return pm2[_0xdd11('0xa')](_0x2dfedc,function(_0x18024d,_0xa63353){if(_0x18024d){return _0x4f9c1e(_0x18024d);}pm2['disconnect']();return _0x6d0a87(_0xa63353);});});});};exports[_0xdd11('0xb')]=function(_0x426139){return connect()[_0xdd11('0x4')](function(){return new BPromise(function(_0x583df9,_0x4a378a){return pm2['delete'](_0x426139,function(_0x20db3c,_0xb66210){if(_0x20db3c){return _0x4a378a(_0x20db3c);}pm2[_0xdd11('0x6')]();return _0x583df9(_0xb66210);});});});};exports[_0xdd11('0xc')]=function(){return connect()[_0xdd11('0x4')](function(){return new BPromise(function(_0x189aca,_0x51b593){return pm2[_0xdd11('0xc')](function(_0x5a924d){if(_0x5a924d){return _0x51b593(_0x5a924d);}return _0x189aca(_0xdd11('0xd'));});});});}; \ No newline at end of file +var _0x908d=['then','restart','list','describe','delete','dump','pm2','connected','start','disconnect','stop'];(function(_0x201956,_0x2f2457){var _0x1c065c=function(_0x475b47){while(--_0x475b47){_0x201956['push'](_0x201956['shift']());}};_0x1c065c(++_0x2f2457);}(_0x908d,0xab));var _0xd908=function(_0x9769a3,_0xe431f0){_0x9769a3=_0x9769a3-0x0;var _0x43667d=_0x908d[_0x9769a3];return _0x43667d;};'use strict';var pm2=require(_0xd908('0x0'));var BPromise=require('bluebird');var config=require('./config');function connect(){return new BPromise(function(_0x1feed8,_0x396be3){return pm2['connect'](function(_0x196883){if(_0x196883){return _0x396be3(_0x196883);}return _0x1feed8(_0xd908('0x1'));});});};exports[_0xd908('0x2')]=function(_0x5a4fdf){return connect()['then'](function(){return new BPromise(function(_0x2bb2f8,_0x2b5ca8){return pm2['start'](_0x5a4fdf,function(_0x4000c5,_0x2fb877){if(_0x4000c5){return _0x2b5ca8(_0x4000c5);}pm2[_0xd908('0x3')]();return _0x2bb2f8(_0x2fb877);});});});};exports[_0xd908('0x4')]=function(_0x57e45c){return connect()[_0xd908('0x5')](function(){return new BPromise(function(_0x44a8a1,_0x42aa20){return pm2[_0xd908('0x4')](_0x57e45c,function(_0x18944f,_0x36a667){if(_0x18944f){return _0x42aa20(_0x18944f);}pm2[_0xd908('0x3')]();return _0x44a8a1(_0x36a667);});});});};exports[_0xd908('0x6')]=function(_0x1e9e87){return connect()['then'](function(){return new BPromise(function(_0x59f4b0,_0x142def){return pm2[_0xd908('0x6')](_0x1e9e87,function(_0x176d35,_0xe9fdb1){if(_0x176d35){return _0x142def(_0x176d35);}pm2[_0xd908('0x3')]();return _0x59f4b0(_0xe9fdb1);});});});};exports[_0xd908('0x7')]=function(){return connect()[_0xd908('0x5')](function(){return new BPromise(function(_0x467991,_0x477ab9){return pm2[_0xd908('0x7')](function(_0x838645,_0xba3dbc){if(_0x838645){return _0x477ab9(_0x838645);}pm2[_0xd908('0x3')]();return _0x467991(_0xba3dbc);});});});};exports[_0xd908('0x8')]=function(_0x2fe304){return connect()[_0xd908('0x5')](function(){return new BPromise(function(_0x39615c,_0xb46ed5){return pm2[_0xd908('0x8')](_0x2fe304,function(_0x2364e8,_0x43142a){if(_0x2364e8){return _0xb46ed5(_0x2364e8);}pm2[_0xd908('0x3')]();return _0x39615c(_0x43142a);});});});};exports[_0xd908('0x9')]=function(_0x1ac086){return connect()[_0xd908('0x5')](function(){return new BPromise(function(_0x8b34d1,_0x31fa3c){return pm2[_0xd908('0x9')](_0x1ac086,function(_0xfbfa51,_0x553d33){if(_0xfbfa51){return _0x31fa3c(_0xfbfa51);}pm2[_0xd908('0x3')]();return _0x8b34d1(_0x553d33);});});});};exports['dump']=function(){return connect()['then'](function(){return new BPromise(function(_0x5d6b60,_0x544b63){return pm2[_0xd908('0xa')](function(_0x3ff5a6){if(_0x3ff5a6){return _0x544b63(_0x3ff5a6);}return _0x5d6b60('saved');});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 2d022b7..24b55e1 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 _0x841e=['../../config/environment','../logger','schedule','redis','localhost','socket.io-emitter','Setting','find','chatTimeout','then','ChatInteraction','lastMsgAt','subtract','minutes','length','map','info','[CHAT]\x20Interactions\x20to\x20close:','join','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','emit','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','ioredis','util'];(function(_0x3546aa,_0x478de8){var _0x52e75e=function(_0x46e023){while(--_0x46e023){_0x3546aa['push'](_0x3546aa['shift']());}};_0x52e75e(++_0x478de8);}(_0x841e,0x148));var _0xe841=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x841e[_0x502c7d];return _0x30b7ed;};'use strict';var _=require('lodash');var moment=require('moment');var Redis=require(_0xe841('0x0'));var util=require(_0xe841('0x1'));var config=require(_0xe841('0x2'));var db=require('../../mysqldb')['db'];var logger=require(_0xe841('0x3'))(_0xe841('0x4'));config['redis']=_['defaults'](config[_0xe841('0x5')],{'host':_0xe841('0x6'),'port':0x18eb});var io=require(_0xe841('0x7'))(new Redis(config[_0xe841('0x5')]));function closeInteractions(){var _0x123a14=0x0;var _0x4858c8=[];return db[_0xe841('0x8')][_0xe841('0x9')]({'raw':!![],'attributes':['id',_0xe841('0xa')],'where':{'id':0x1}})[_0xe841('0xb')](function(_0x592cc8){_0x123a14=_0x592cc8[_0xe841('0xa')];if(_0x123a14){return db[_0xe841('0xc')]['findAll']({'raw':!![],'attributes':['id',_0xe841('0xd')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xe841('0xe')](_0x592cc8['chatTimeout'],_0xe841('0xf'))}}});}else{return[];}})[_0xe841('0xb')](function(_0x3a07e8){if(_0x3a07e8&&_0x3a07e8[_0xe841('0x10')]){_0x4858c8=_[_0xe841('0x11')](_0x3a07e8||[],'id');logger[_0xe841('0x12')](_0xe841('0x13'),_0x4858c8[_0xe841('0x14')]());return db[_0xe841('0xc')][_0xe841('0x15')]({'closeReason':_0xe841('0x16'),'disposition':_0xe841('0x17'),'closed':!![],'closedAt':moment()[_0xe841('0x18')](_0xe841('0x19'))},{'where':{'id':_0x4858c8}});}})[_0xe841('0xb')](function(){if(_0x4858c8&&_0x4858c8[_0xe841('0x10')]){logger['info']('[CHAT]\x20Sending\x20updates\x20for\x20interactions:',_0x4858c8[_0xe841('0x14')]());for(var _0x1ed0a5=0x0;_0x1ed0a5<_0x4858c8['length'];_0x1ed0a5++){io[_0xe841('0x1a')](_0xe841('0x1b'),{'id':_0x4858c8[_0x1ed0a5],'closed':!![]});}}})[_0xe841('0x1c')](function(_0x59ecb3){logger[_0xe841('0x1d')](_0xe841('0x1e'),_0x59ecb3?util[_0xe841('0x1f')](_0x59ecb3,{'showHidden':![],'depth':null}):'');});}exports[_0xe841('0x20')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x5270=['minutes','map','info','update','system','timeout','YYYY-MM-DD\x20HH:mm:ss','length','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','join','emit','chatInteraction:update','error','inspect','lodash','moment','ioredis','util','../../mysqldb','../logger','schedule','redis','defaults','Setting','find','chatTimeout','then','ChatInteraction','findAll','subtract'];(function(_0x31997c,_0x13412b){var _0x3c9756=function(_0x23e38c){while(--_0x23e38c){_0x31997c['push'](_0x31997c['shift']());}};_0x3c9756(++_0x13412b);}(_0x5270,0xa4));var _0x0527=function(_0x203127,_0x4a695d){_0x203127=_0x203127-0x0;var _0x217b4b=_0x5270[_0x203127];return _0x217b4b;};'use strict';var _=require(_0x0527('0x0'));var moment=require(_0x0527('0x1'));var Redis=require(_0x0527('0x2'));var util=require(_0x0527('0x3'));var config=require('../../config/environment');var db=require(_0x0527('0x4'))['db'];var logger=require(_0x0527('0x5'))(_0x0527('0x6'));config[_0x0527('0x7')]=_[_0x0527('0x8')](config[_0x0527('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0527('0x7')]));function closeInteractions(){var _0xee4b0=0x0;var _0x2be3f3=[];return db[_0x0527('0x9')][_0x0527('0xa')]({'raw':!![],'attributes':['id',_0x0527('0xb')],'where':{'id':0x1}})[_0x0527('0xc')](function(_0x569f9e){_0xee4b0=_0x569f9e[_0x0527('0xb')];if(_0xee4b0){return db[_0x0527('0xd')][_0x0527('0xe')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x0527('0xf')](_0x569f9e[_0x0527('0xb')],_0x0527('0x10'))}}});}else{return[];}})[_0x0527('0xc')](function(_0x54f72a){if(_0x54f72a&&_0x54f72a['length']){_0x2be3f3=_[_0x0527('0x11')](_0x54f72a||[],'id');logger[_0x0527('0x12')]('[CHAT]\x20Interactions\x20to\x20close:',_0x2be3f3['join']());return db[_0x0527('0xd')][_0x0527('0x13')]({'closeReason':_0x0527('0x14'),'disposition':_0x0527('0x15'),'closed':!![],'closedAt':moment()['format'](_0x0527('0x16'))},{'where':{'id':_0x2be3f3}});}})[_0x0527('0xc')](function(){if(_0x2be3f3&&_0x2be3f3[_0x0527('0x17')]){logger['info'](_0x0527('0x18'),_0x2be3f3[_0x0527('0x19')]());for(var _0x11e57e=0x0;_0x11e57e<_0x2be3f3['length'];_0x11e57e++){io[_0x0527('0x1a')](_0x0527('0x1b'),{'id':_0x2be3f3[_0x11e57e],'closed':!![]});}}})['catch'](function(_0x53282b){logger[_0x0527('0x1c')]('[CHAT]\x20Error\x20closing\x20interactions',_0x53282b?util[_0x0527('0x1d')](_0x53282b,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index 2d21220..a628337 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 _0x875b=['info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','service','host','Smtp','port','secure','authentication','auth','user','format','\x22%s\x22\x20<%s>','name','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','../../files/reports','savename','basename','extname','zip','status','Sent','message','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','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','stringify','email\x20sent','data','isNil','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','catch','Schedule','MailServerOut','jobs','map','keyBy','toString','difference','intersection','exists','stop','deleteJob','delete\x20cron','length','index','my\x20id','resolve','run\x20job','cron','isBetween','startAt','add','stop\x20cron','active','update','update\x20cron','run','start','path','lodash','cron-job-manager','bluebird','schedule','../../mysqldb','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x875b,0x157));var _0xb875=function(_0x3b90ab,_0x174a22){_0x3b90ab=_0x3b90ab-0x0;var _0x206e92=_0x875b[_0x3b90ab];return _0x206e92;};'use strict';var fs=require('fs');var util=require('util');var path=require(_0xb875('0x0'));var _=require(_0xb875('0x1'));var moment=require('moment');var CronJobManager=require(_0xb875('0x2'));var jayson=require('jayson/promise');var BPromise=require(_0xb875('0x3'));var logger=require('../logger')(_0xb875('0x4'));var db=require(_0xb875('0x5'))['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require(_0xb875('0x6'));var client=jayson[_0xb875('0x7')][_0xb875('0x8')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x2a9e3b,_0x124346){return function(){logger[_0xb875('0x9')](_0xb875('0xa'),_0x2a9e3b[_0xb875('0xb')]);var _0x3fae82=!![];var _0x3bcaa8={'tls':{'rejectUnauthorized':![]}};if(_0x2a9e3b[_0xb875('0xc')]['Smtp'][_0xb875('0xd')]){_0x3bcaa8['service']=_0x2a9e3b[_0xb875('0xc')]['Smtp']['service'];}else{_0x3bcaa8[_0xb875('0xe')]=_0x2a9e3b['MailAccount'][_0xb875('0xf')][_0xb875('0xe')];_0x3bcaa8[_0xb875('0x10')]=_0x2a9e3b[_0xb875('0xc')][_0xb875('0xf')]['port'];_0x3bcaa8[_0xb875('0x11')]=_0x2a9e3b[_0xb875('0xc')]['Smtp'][_0xb875('0x11')];}if(_0x2a9e3b[_0xb875('0xc')][_0xb875('0xf')][_0xb875('0x12')]){_0x3bcaa8[_0xb875('0x13')]={'user':_0x2a9e3b[_0xb875('0xc')]['Smtp'][_0xb875('0x14')],'pass':_0x2a9e3b[_0xb875('0xc')]['Smtp']['pass']};}var _0x42cd81={'account':_0x3bcaa8,'message':{'from':util[_0xb875('0x15')](_0xb875('0x16'),_0x2a9e3b[_0xb875('0xc')][_0xb875('0x17')],_0x2a9e3b[_0xb875('0xc')][_0xb875('0xb')]||_0x2a9e3b[_0xb875('0xc')][_0xb875('0xf')]['user']),'to':_0x2a9e3b[_0xb875('0xb')],'cc':_0x2a9e3b['cc'],'bcc':_0x2a9e3b[_0xb875('0x18')],'subject':util[_0xb875('0x15')](_0xb875('0x19'),_0x124346[_0xb875('0x17')],_0x2a9e3b[_0xb875('0x1a')],_0x2a9e3b[_0xb875('0x1b')])}};var _0x3c8927=path[_0xb875('0x1c')](__dirname,_0xb875('0x1d'));var _0x141217=_0x124346[_0xb875('0x1e')];var _0x18a08d=util[_0xb875('0x15')]('%s.%s',path[_0xb875('0x1f')](_0x124346[_0xb875('0x1e')],path[_0xb875('0x20')](_0x124346[_0xb875('0x1e')])),_0xb875('0x21'));var _0x5ae38c=path['join'](_0x3c8927,_0x141217);var _0x8be9ac=path['join'](_0x3c8927,_0x18a08d);if(fs['existsSync'](_0x5ae38c)){_0x124346[_0xb875('0x22')]=_0xb875('0x23');_0x42cd81['message']['attachments']=[{'filename':_0x141217,'path':_0x5ae38c}];_0x42cd81[_0xb875('0x24')][_0xb875('0x25')]=util[_0xb875('0x15')](_0xb875('0x26'),JSON['stringify'](_0x124346,null,0x2));}else if(fs['existsSync'](_0x8be9ac)){_0x124346['status']=_0xb875('0x23');_0x42cd81['message']['attachments']=[{'filename':_0x18a08d,'path':_0x8be9ac}];}else{_0x42cd81[_0xb875('0x24')][_0xb875('0x25')]=_0xb875('0x27');if(!_0x2a9e3b[_0xb875('0x28')]){_0x3fae82=![];logger['info'](_0xb875('0x29'));}}if(_0x3fae82){return client[_0xb875('0x2a')](_0xb875('0x2b'),_0x42cd81)[_0xb875('0x2c')](function(_0x120f6d){if(_0x120f6d[_0xb875('0x2d')]){return logger[_0xb875('0x2d')](_0xb875('0x2e'),JSON[_0xb875('0x2f')](_0x120f6d));}return logger[_0xb875('0x9')](_0xb875('0x30'));})['catch'](function(_0x10c1b9){return logger[_0xb875('0x2d')](_0xb875('0x2e'),JSON[_0xb875('0x2f')](_0x10c1b9));});}};}function handleError(){return function(_0x1f038d){return logger[_0xb875('0x2d')](JSON['stringify'](_0x1f038d));};}function handleResult(_0x303b68){return function(_0x25d98f){logger[_0xb875('0x9')](_0xb875('0x31'),JSON[_0xb875('0x2f')](_0x25d98f));if(_0x303b68['MailAccount']&&_0x303b68['MailAccount'][_0xb875('0xf')]&&!_[_0xb875('0x32')](_0x303b68[_0xb875('0xb')])){setTimeout(handleSendEmail(_0x303b68,_0x25d98f),0x3c*0x3e8);}};}function handleJob(_0x4b2901){return function(){try{if(_[_0xb875('0x32')](_0x4b2901['subtractNumber'])){return logger[_0xb875('0x9')]('subtractNumber\x20null\x20or\x20undefined');}if(_[_0xb875('0x32')](_0x4b2901[_0xb875('0x1b')])){return logger[_0xb875('0x9')](_0xb875('0x33'));}var _0x2066d2={'startDate':moment()[_0xb875('0x34')](_0x4b2901[_0xb875('0x1a')],_0x4b2901['subtractUnit'])[_0xb875('0x15')](_0xb875('0x35')),'endDate':moment()['format'](_0xb875('0x35')),'type':_0xb875('0x36'),'output':_0x4b2901[_0xb875('0x37')],'name':_0x4b2901[_0xb875('0x17')]};if(!_[_0xb875('0x32')](_0x4b2901[_0xb875('0x38')])){logger[_0xb875('0x9')](_0xb875('0x39'),_0x4b2901[_0xb875('0x38')]);return analyticDefaultReportController[_0xb875('0x3a')]({'id':_0x4b2901[_0xb875('0x38')]},_0x2066d2)[_0xb875('0x2c')](handleResult(_0x4b2901))['catch'](handleError());}if(!_[_0xb875('0x32')](_0x4b2901['CustomReportId'])){logger['info']('exec\x20custom\x20report\x20id:%s',_0x4b2901[_0xb875('0x3b')]);return analyticCustomReportController[_0xb875('0x3a')]({'id':_0x4b2901[_0xb875('0x3b')]},_0x2066d2)[_0xb875('0x2c')](handleResult(_0x4b2901))[_0xb875('0x3c')](handleError());}}catch(_0x477753){logger['error'](JSON[_0xb875('0x2f')](_0x477753));}return logger['info']('no\x20report\x20id');};}function getJobs(_0x5929cd){var _0x1195cd={};if(_0x5929cd){_0x1195cd['id']=_0x5929cd;}return db[_0xb875('0x3d')]['findAll']({'where':_0x1195cd,'include':[{'model':db[_0xb875('0xc')],'attributes':['id',_0xb875('0x17'),_0xb875('0xb')],'include':[{'model':db[_0xb875('0x3e')],'as':_0xb875('0xf')}]}]})[_0xb875('0x2c')](function(_0xd791b3){var _0xa98840=_['keys'](manager[_0xb875('0x3f')]);var _0x2d3724=_[_0xb875('0x40')](_0xd791b3,function(_0x5a0c67){return _0x5a0c67['id']['toString']();});var _0x20edc1=_[_0xb875('0x41')](_0xd791b3,function(_0x1a3ba6){return _0x1a3ba6['id'][_0xb875('0x42')]();});var _0x10a77b=_0x5929cd?_0x2d3724:_[_0xb875('0x43')](_0x2d3724,_0xa98840);var _0x323ca0=_[_0xb875('0x44')](_0x2d3724,_0xa98840);var _0x46e354=_[_0xb875('0x43')](_0xa98840,_0x2d3724);var _0x4ae919;var _0x3f096b;for(_0x4ae919=0x0;_0x4ae919<_0x46e354['length']&&!_0x5929cd;_0x4ae919+=0x1){_0x3f096b=_0x46e354[_0x4ae919][_0xb875('0x42')]();if(manager[_0xb875('0x45')](_0x3f096b)){manager[_0xb875('0x46')](_0x3f096b);manager[_0xb875('0x47')](_0x3f096b);logger[_0xb875('0x9')](_0xb875('0x48'),_0x3f096b);}}logger[_0xb875('0x9')]('toRun',JSON[_0xb875('0x2f')](_0x10a77b));for(_0x4ae919=0x0;_0x4ae919<_0x10a77b[_0xb875('0x49')];_0x4ae919+=0x1){_0x3f096b=_0x10a77b[_0x4ae919][_0xb875('0x42')]();logger[_0xb875('0x9')](_0xb875('0x4a'),_0x3f096b);if(_0x5929cd){logger[_0xb875('0x9')](_0xb875('0x4b'),_0x5929cd);logger[_0xb875('0x9')](JSON[_0xb875('0x2f')](_0x20edc1[_0x3f096b]));BPromise[_0xb875('0x4c')]()['then'](handleJob(_0x20edc1[_0x3f096b]));logger[_0xb875('0x9')](_0xb875('0x4d'),_0x20edc1[_0x3f096b][_0xb875('0x17')],_0x20edc1[_0x3f096b][_0xb875('0x4e')]);}else if(_0x20edc1[_0x3f096b][_0xb875('0x4e')]&&_0x20edc1[_0x3f096b]['active']&&moment()[_0xb875('0x4f')](_0x20edc1[_0x3f096b][_0xb875('0x50')],_0x20edc1[_0x3f096b]['endAt'])){manager[_0xb875('0x51')](_0x3f096b,_0x20edc1[_0x3f096b][_0xb875('0x4e')],handleJob(_0x20edc1[_0x3f096b]));manager['start'](_0x3f096b);logger[_0xb875('0x9')]('add\x20cron',_0x20edc1[_0x3f096b][_0xb875('0x17')],_0x20edc1[_0x3f096b]['cron']);}else if(manager[_0xb875('0x45')](_0x3f096b)){manager[_0xb875('0x46')](_0x3f096b);manager[_0xb875('0x47')](_0x3f096b);logger[_0xb875('0x9')](_0xb875('0x52'),_0x20edc1[_0x3f096b][_0xb875('0x17')],_0x20edc1[_0x3f096b][_0xb875('0x4e')]);}}for(_0x4ae919=0x0,_0x3f096b;_0x4ae919<_0x323ca0[_0xb875('0x49')]&&!_0x5929cd;_0x4ae919+=0x1){_0x3f096b=_0x323ca0[_0x4ae919][_0xb875('0x42')]();if(manager[_0xb875('0x45')](_0x3f096b)){if(_0x20edc1[_0x3f096b]['cron']&&_0x20edc1[_0x3f096b][_0xb875('0x53')]&&moment()[_0xb875('0x4f')](_0x20edc1[_0x3f096b][_0xb875('0x50')],_0x20edc1[_0x3f096b]['endAt'])){manager[_0xb875('0x54')](_0x3f096b,_0x20edc1[_0x3f096b][_0xb875('0x4e')],handleJob(_0x20edc1[_0x3f096b]));logger['info'](_0xb875('0x55'),_0x20edc1[_0x3f096b][_0xb875('0x17')],_0x20edc1[_0x3f096b][_0xb875('0x4e')]);}else{manager['stop'](_0x3f096b);manager['deleteJob'](_0x3f096b);logger[_0xb875('0x9')](_0xb875('0x52'),_0x20edc1[_0x3f096b][_0xb875('0x17')],_0x20edc1[_0x3f096b][_0xb875('0x4e')]);}}}})[_0xb875('0x3c')](function(_0xd5d743){logger[_0xb875('0x2d')](JSON['stringify'](_0xd5d743));});}exports[_0xb875('0x56')]=function(_0x3c5bec){return getJobs(_0x3c5bec);};exports[_0xb875('0x57')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x6a41=['isNil','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','Schedule','MailServerOut','keys','map','toString','keyBy','intersection','difference','toRun','length','index','my\x20id','resolve','run\x20job','cron','active','isBetween','startAt','endAt','add','add\x20cron','stop','deleteJob','update','update\x20cron','run','start','util','path','lodash','moment','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','http','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','service','host','Smtp','port','secure','authentication','auth','user','format','\x22%s\x22\x20<%s>','name','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','../../files/reports','savename','%s.%s','extname','existsSync','status','Sent','message','attachments','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','text','info','request','SendMail','then','error','error\x20mail','stringify','catch','data'];(function(_0x41a4bb,_0x36b115){var _0x4d4239=function(_0x572b5c){while(--_0x572b5c){_0x41a4bb['push'](_0x41a4bb['shift']());}};_0x4d4239(++_0x36b115);}(_0x6a41,0x1e3));var _0x16a4=function(_0x13cc23,_0x487f14){_0x13cc23=_0x13cc23-0x0;var _0x11677c=_0x6a41[_0x13cc23];return _0x11677c;};'use strict';var fs=require('fs');var util=require(_0x16a4('0x0'));var path=require(_0x16a4('0x1'));var _=require(_0x16a4('0x2'));var moment=require(_0x16a4('0x3'));var CronJobManager=require('cron-job-manager');var jayson=require(_0x16a4('0x4'));var BPromise=require(_0x16a4('0x5'));var logger=require(_0x16a4('0x6'))(_0x16a4('0x7'));var db=require(_0x16a4('0x8'))['db'];var analyticCustomReportController=require(_0x16a4('0x9'));var analyticDefaultReportController=require(_0x16a4('0xa'));var client=jayson['client'][_0x16a4('0xb')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x4606ee,_0x10b33f){return function(){logger['info'](_0x16a4('0xc'),_0x4606ee[_0x16a4('0xd')]);var _0x5437e7=!![];var _0x434448={'tls':{'rejectUnauthorized':![]}};if(_0x4606ee[_0x16a4('0xe')]['Smtp'][_0x16a4('0xf')]){_0x434448[_0x16a4('0xf')]=_0x4606ee[_0x16a4('0xe')]['Smtp'][_0x16a4('0xf')];}else{_0x434448[_0x16a4('0x10')]=_0x4606ee[_0x16a4('0xe')][_0x16a4('0x11')][_0x16a4('0x10')];_0x434448[_0x16a4('0x12')]=_0x4606ee[_0x16a4('0xe')][_0x16a4('0x11')][_0x16a4('0x12')];_0x434448[_0x16a4('0x13')]=_0x4606ee[_0x16a4('0xe')]['Smtp'][_0x16a4('0x13')];}if(_0x4606ee[_0x16a4('0xe')][_0x16a4('0x11')][_0x16a4('0x14')]){_0x434448[_0x16a4('0x15')]={'user':_0x4606ee[_0x16a4('0xe')]['Smtp'][_0x16a4('0x16')],'pass':_0x4606ee[_0x16a4('0xe')][_0x16a4('0x11')]['pass']};}var _0x3787b5={'account':_0x434448,'message':{'from':util[_0x16a4('0x17')](_0x16a4('0x18'),_0x4606ee[_0x16a4('0xe')][_0x16a4('0x19')],_0x4606ee[_0x16a4('0xe')][_0x16a4('0xd')]||_0x4606ee[_0x16a4('0xe')][_0x16a4('0x11')][_0x16a4('0x16')]),'to':_0x4606ee['email'],'cc':_0x4606ee['cc'],'bcc':_0x4606ee[_0x16a4('0x1a')],'subject':util[_0x16a4('0x17')](_0x16a4('0x1b'),_0x10b33f[_0x16a4('0x19')],_0x4606ee[_0x16a4('0x1c')],_0x4606ee[_0x16a4('0x1d')])}};var _0x529bbc=path[_0x16a4('0x1e')](__dirname,_0x16a4('0x1f'));var _0x1f0331=_0x10b33f[_0x16a4('0x20')];var _0x3d60f3=util[_0x16a4('0x17')](_0x16a4('0x21'),path['basename'](_0x10b33f['savename'],path[_0x16a4('0x22')](_0x10b33f[_0x16a4('0x20')])),'zip');var _0xee5ab5=path[_0x16a4('0x1e')](_0x529bbc,_0x1f0331);var _0x303fbb=path[_0x16a4('0x1e')](_0x529bbc,_0x3d60f3);if(fs[_0x16a4('0x23')](_0xee5ab5)){_0x10b33f[_0x16a4('0x24')]=_0x16a4('0x25');_0x3787b5[_0x16a4('0x26')][_0x16a4('0x27')]=[{'filename':_0x1f0331,'path':_0xee5ab5}];_0x3787b5[_0x16a4('0x26')]['text']=util[_0x16a4('0x17')](_0x16a4('0x28'),JSON['stringify'](_0x10b33f,null,0x2));}else if(fs['existsSync'](_0x303fbb)){_0x10b33f[_0x16a4('0x24')]=_0x16a4('0x25');_0x3787b5[_0x16a4('0x26')][_0x16a4('0x27')]=[{'filename':_0x3d60f3,'path':_0x303fbb}];}else{_0x3787b5[_0x16a4('0x26')][_0x16a4('0x29')]='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x4606ee['sendIfEmpty']){_0x5437e7=![];logger[_0x16a4('0x2a')]('empty\x20file,\x20email\x20not\x20sent');}}if(_0x5437e7){return client[_0x16a4('0x2b')](_0x16a4('0x2c'),_0x3787b5)[_0x16a4('0x2d')](function(_0x4bc6d1){if(_0x4bc6d1[_0x16a4('0x2e')]){return logger[_0x16a4('0x2e')](_0x16a4('0x2f'),JSON[_0x16a4('0x30')](_0x4bc6d1));}return logger[_0x16a4('0x2a')]('email\x20sent');})[_0x16a4('0x31')](function(_0x4265dd){return logger[_0x16a4('0x2e')](_0x16a4('0x2f'),JSON['stringify'](_0x4265dd));});}};}function handleError(){return function(_0x434647){return logger[_0x16a4('0x2e')](JSON[_0x16a4('0x30')](_0x434647));};}function handleResult(_0x128a5e){return function(_0x2aadbe){logger[_0x16a4('0x2a')](_0x16a4('0x32'),JSON[_0x16a4('0x30')](_0x2aadbe));if(_0x128a5e[_0x16a4('0xe')]&&_0x128a5e[_0x16a4('0xe')][_0x16a4('0x11')]&&!_[_0x16a4('0x33')](_0x128a5e[_0x16a4('0xd')])){setTimeout(handleSendEmail(_0x128a5e,_0x2aadbe),0x3c*0x3e8);}};}function handleJob(_0x531777){return function(){try{if(_['isNil'](_0x531777['subtractNumber'])){return logger[_0x16a4('0x2a')]('subtractNumber\x20null\x20or\x20undefined');}if(_[_0x16a4('0x33')](_0x531777[_0x16a4('0x1d')])){return logger[_0x16a4('0x2a')](_0x16a4('0x34'));}var _0x1ca0df={'startDate':moment()[_0x16a4('0x35')](_0x531777[_0x16a4('0x1c')],_0x531777['subtractUnit'])[_0x16a4('0x17')]('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()['format'](_0x16a4('0x36')),'type':_0x16a4('0x37'),'output':_0x531777[_0x16a4('0x38')],'name':_0x531777[_0x16a4('0x19')]};if(!_[_0x16a4('0x33')](_0x531777[_0x16a4('0x39')])){logger[_0x16a4('0x2a')](_0x16a4('0x3a'),_0x531777['DefaultReportId']);return analyticDefaultReportController[_0x16a4('0x3b')]({'id':_0x531777['DefaultReportId']},_0x1ca0df)[_0x16a4('0x2d')](handleResult(_0x531777))['catch'](handleError());}if(!_[_0x16a4('0x33')](_0x531777[_0x16a4('0x3c')])){logger[_0x16a4('0x2a')](_0x16a4('0x3d'),_0x531777[_0x16a4('0x3c')]);return analyticCustomReportController[_0x16a4('0x3b')]({'id':_0x531777['CustomReportId']},_0x1ca0df)[_0x16a4('0x2d')](handleResult(_0x531777))['catch'](handleError());}}catch(_0x264198){logger[_0x16a4('0x2e')](JSON[_0x16a4('0x30')](_0x264198));}return logger[_0x16a4('0x2a')]('no\x20report\x20id');};}function getJobs(_0x597212){var _0x17483e={};if(_0x597212){_0x17483e['id']=_0x597212;}return db[_0x16a4('0x3e')]['findAll']({'where':_0x17483e,'include':[{'model':db['MailAccount'],'attributes':['id',_0x16a4('0x19'),_0x16a4('0xd')],'include':[{'model':db[_0x16a4('0x3f')],'as':_0x16a4('0x11')}]}]})[_0x16a4('0x2d')](function(_0x2f9af0){var _0x416f36=_[_0x16a4('0x40')](manager['jobs']);var _0xca013d=_[_0x16a4('0x41')](_0x2f9af0,function(_0x242b0f){return _0x242b0f['id'][_0x16a4('0x42')]();});var _0x39d680=_[_0x16a4('0x43')](_0x2f9af0,function(_0x56fb6c){return _0x56fb6c['id'][_0x16a4('0x42')]();});var _0x2921e0=_0x597212?_0xca013d:_['difference'](_0xca013d,_0x416f36);var _0x3d9d98=_[_0x16a4('0x44')](_0xca013d,_0x416f36);var _0x250254=_[_0x16a4('0x45')](_0x416f36,_0xca013d);var _0x43b984;var _0x36947c;for(_0x43b984=0x0;_0x43b984<_0x250254['length']&&!_0x597212;_0x43b984+=0x1){_0x36947c=_0x250254[_0x43b984][_0x16a4('0x42')]();if(manager['exists'](_0x36947c)){manager['stop'](_0x36947c);manager['deleteJob'](_0x36947c);logger[_0x16a4('0x2a')]('delete\x20cron',_0x36947c);}}logger[_0x16a4('0x2a')](_0x16a4('0x46'),JSON[_0x16a4('0x30')](_0x2921e0));for(_0x43b984=0x0;_0x43b984<_0x2921e0[_0x16a4('0x47')];_0x43b984+=0x1){_0x36947c=_0x2921e0[_0x43b984]['toString']();logger['info'](_0x16a4('0x48'),_0x36947c);if(_0x597212){logger['info'](_0x16a4('0x49'),_0x597212);logger[_0x16a4('0x2a')](JSON['stringify'](_0x39d680[_0x36947c]));BPromise[_0x16a4('0x4a')]()[_0x16a4('0x2d')](handleJob(_0x39d680[_0x36947c]));logger['info'](_0x16a4('0x4b'),_0x39d680[_0x36947c][_0x16a4('0x19')],_0x39d680[_0x36947c]['cron']);}else if(_0x39d680[_0x36947c][_0x16a4('0x4c')]&&_0x39d680[_0x36947c][_0x16a4('0x4d')]&&moment()[_0x16a4('0x4e')](_0x39d680[_0x36947c][_0x16a4('0x4f')],_0x39d680[_0x36947c][_0x16a4('0x50')])){manager[_0x16a4('0x51')](_0x36947c,_0x39d680[_0x36947c][_0x16a4('0x4c')],handleJob(_0x39d680[_0x36947c]));manager['start'](_0x36947c);logger[_0x16a4('0x2a')](_0x16a4('0x52'),_0x39d680[_0x36947c][_0x16a4('0x19')],_0x39d680[_0x36947c]['cron']);}else if(manager['exists'](_0x36947c)){manager[_0x16a4('0x53')](_0x36947c);manager[_0x16a4('0x54')](_0x36947c);logger[_0x16a4('0x2a')]('stop\x20cron',_0x39d680[_0x36947c][_0x16a4('0x19')],_0x39d680[_0x36947c]['cron']);}}for(_0x43b984=0x0,_0x36947c;_0x43b984<_0x3d9d98[_0x16a4('0x47')]&&!_0x597212;_0x43b984+=0x1){_0x36947c=_0x3d9d98[_0x43b984][_0x16a4('0x42')]();if(manager['exists'](_0x36947c)){if(_0x39d680[_0x36947c][_0x16a4('0x4c')]&&_0x39d680[_0x36947c][_0x16a4('0x4d')]&&moment()['isBetween'](_0x39d680[_0x36947c][_0x16a4('0x4f')],_0x39d680[_0x36947c][_0x16a4('0x50')])){manager[_0x16a4('0x55')](_0x36947c,_0x39d680[_0x36947c]['cron'],handleJob(_0x39d680[_0x36947c]));logger[_0x16a4('0x2a')](_0x16a4('0x56'),_0x39d680[_0x36947c][_0x16a4('0x19')],_0x39d680[_0x36947c][_0x16a4('0x4c')]);}else{manager[_0x16a4('0x53')](_0x36947c);manager['deleteJob'](_0x36947c);logger[_0x16a4('0x2a')]('stop\x20cron',_0x39d680[_0x36947c][_0x16a4('0x19')],_0x39d680[_0x36947c][_0x16a4('0x4c')]);}}}})[_0x16a4('0x31')](function(_0x1ab95a){logger[_0x16a4('0x2e')](JSON[_0x16a4('0x30')](_0x1ab95a));});}exports[_0x16a4('0x57')]=function(_0x2971d2){return getJobs(_0x2971d2);};exports[_0x16a4('0x58')]=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 6038a14..613d1f5 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 _0xaf60=['data1','data2','transcribeRegion','transcribeName','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','TranscriptFileUri','format','Transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','then','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','findOne','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','SentimentScore','Positive','Negative','Mixed','Neutral','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','tempSentiment','sentiment','language','bucket','Cloud\x20Provider\x20not\x20configured','Sentiment','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','IN_PROGRESS','Setting','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','Cloud\x20Provider\x20not\x20available','push','all','start','lodash','aws-sdk','request-promise','../../mysqldb','getTranscriptionJob','Comprehend','info','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)'];(function(_0x2e9ef1,_0x1b6dbc){var _0x4f294b=function(_0x4e89b6){while(--_0x4e89b6){_0x2e9ef1['push'](_0x2e9ef1['shift']());}};_0x4f294b(++_0x1b6dbc);}(_0xaf60,0x82));var _0x0af6=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xaf60[_0xbe200f];return _0x192597;};var _=require(_0x0af6('0x0'));var AWS=require(_0x0af6('0x1'));var rp=require(_0x0af6('0x2'));var util=require('util');var BPromise=require('bluebird');var db=require(_0x0af6('0x3'))['db'];var logger=require('../../config/logger')('transcribe');function getTranscriptionJob(_0xbb4bdd,_0x3e1023,_0x427a4c,_0x2fe667){return new Promise(function(_0x463023,_0x333ce1){var _0x2eb218=new AWS['TranscribeService']({'accessKeyId':_0x3e1023,'secretAccessKey':_0xbb4bdd,'region':_0x427a4c});_0x2eb218[_0x0af6('0x4')]({'TranscriptionJobName':_0x2fe667},function(_0x28d620,_0x525bcc){if(_0x28d620){return _0x333ce1(_0x28d620);}else{return _0x463023(_0x525bcc);}});});}function sentiment(_0xd326e7,_0x15552e,_0xe9d01a,_0x5637be,_0x5f1492){return new Promise(function(_0x5ec690,_0x185dee){var _0x48f9cf=new AWS[(_0x0af6('0x5'))]({'accessKeyId':_0x15552e,'secretAccessKey':_0xd326e7,'region':_0xe9d01a});_0x48f9cf['detectSentiment']({'Text':_0x5637be,'LanguageCode':_0x5f1492['substring'](0x0,0x2)},function(_0x191df6,_0x1155ab){if(_0x191df6){return _0x185dee(_0x191df6);}else{return _0x5ec690(_0x1155ab);}});});}function checkTranscribeJob(_0x2908f8,_0x478df5,_0x1a51ed){var _0x30a734;return new BPromise(function(_0x43a6c0,_0x563943){logger[_0x0af6('0x6')](util['format'](_0x0af6('0x7'),_0x2908f8['id'],_0x2908f8['transcribeName']));return getTranscriptionJob(_0x1a51ed[_0x0af6('0x8')],_0x1a51ed[_0x0af6('0x9')],_0x478df5[_0x0af6('0xa')],_0x2908f8[_0x0af6('0xb')])['then'](function(_0x57a725){logger['info'](util['format']('[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s',_0x2908f8['id'],_0x2908f8[_0x0af6('0xb')],_0x57a725[_0x0af6('0xc')][_0x0af6('0xd')]));if(!_0x2908f8[_0x0af6('0xe')]){switch(_0x57a725['TranscriptionJob']['TranscriptionJobStatus']){case _0x0af6('0xf'):var _0x1b3ceb={'transcribeStatus':_0x57a725['TranscriptionJob'][_0x0af6('0xd')],'fileUri':_0x57a725[_0x0af6('0xc')]['Transcript'][_0x0af6('0x10')]};logger[_0x0af6('0x6')](util[_0x0af6('0x11')]('[RECORDING:%d]\x20Get\x20transcript',_0x2908f8['id']));return rp({'uri':_0x57a725[_0x0af6('0xc')][_0x0af6('0x12')][_0x0af6('0x10')],'json':!![]})['then'](function(_0x48a50f){logger['info'](util[_0x0af6('0x11')](_0x0af6('0x13'),_0x2908f8['id']));if(_0x48a50f&&_0x48a50f[_0x0af6('0x14')]&&_0x48a50f[_0x0af6('0x14')]['transcripts']&&_0x48a50f[_0x0af6('0x14')][_0x0af6('0x15')][_0x0af6('0x16')]){_0x1b3ceb[_0x0af6('0xe')]='';for(var _0x56df0b=0x0;_0x56df0b<_0x48a50f[_0x0af6('0x14')][_0x0af6('0x15')]['length'];_0x56df0b++){_0x1b3ceb[_0x0af6('0xe')]+=_0x48a50f['results'][_0x0af6('0x15')][_0x56df0b][_0x0af6('0x17')]+'';}}return _0x2908f8[_0x0af6('0x18')](_0x1b3ceb);})[_0x0af6('0x19')](function(){logger[_0x0af6('0x6')](util['format']('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x2908f8['id']));if(!_0x2908f8['tempSentiment']){throw new db[(_0x0af6('0x1a'))][(_0x0af6('0x1b'))](_0x0af6('0x1c'));}if(!_0x478df5['sentiment']||!_0x478df5[_0x0af6('0x1d')]||!_0x478df5[_0x0af6('0x1e')]||!_0x478df5['language']||!_0x478df5['bucket']){throw new db['Sequelize'][(_0x0af6('0x1b'))](_0x0af6('0x1f'));}if(!_0x1b3ceb['fileText']){throw new Error(_0x0af6('0x20'));}if(_0x478df5[_0x0af6('0x1d')]===_0x1a51ed['id']){return _0x1a51ed;}else{return db[_0x0af6('0x21')][_0x0af6('0x22')]({'where':{'id':_settings['sentimentAccountId']}});}})['then'](function(_0x3f0ef7){if(!_0x3f0ef7){throw new db[(_0x0af6('0x1a'))]['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x3f0ef7[_0x0af6('0x8')]||!_0x3f0ef7[_0x0af6('0x9')]){throw new db[(_0x0af6('0x1a'))]['ValidationError']('Cloud\x20Provider\x20not\x20configured');}_0x30a734=_0x3f0ef7;logger[_0x0af6('0x6')](util[_0x0af6('0x11')](_0x0af6('0x23'),_0x2908f8['id']));return sentiment(_0x30a734['data1'],_0x30a734[_0x0af6('0x9')],_0x478df5[_0x0af6('0x1e')],_0x1b3ceb['fileText'],_0x478df5['language']);})['then'](function(_0x22264d){logger[_0x0af6('0x6')](util[_0x0af6('0x11')](_0x0af6('0x24'),_0x2908f8['id']));return _0x2908f8[_0x0af6('0x18')]({'sentiment':_0x22264d['Sentiment'],'sPositive':_0x22264d[_0x0af6('0x25')][_0x0af6('0x26')],'sNegative':_0x22264d[_0x0af6('0x25')][_0x0af6('0x27')],'sMixed':_0x22264d['SentimentScore'][_0x0af6('0x28')],'sNeutral':_0x22264d['SentimentScore'][_0x0af6('0x29')]});})['then'](function(){logger['info'](util[_0x0af6('0x11')](_0x0af6('0x2a'),_0x2908f8['id']));_0x43a6c0();});case _0x0af6('0x2b'):return _0x2908f8[_0x0af6('0x18')]({'transcribeStatus':_0x0af6('0x2b'),'failureReason':_0x57a725[_0x0af6('0xc')][_0x0af6('0x2c')]})[_0x0af6('0x19')](function(){logger[_0x0af6('0x6')](util[_0x0af6('0x11')](_0x0af6('0x2a'),_0x2908f8['id']));_0x43a6c0();});default:logger[_0x0af6('0x6')](util[_0x0af6('0x11')](_0x0af6('0x2d'),_0x2908f8['id']));break;}}else{return BPromise[_0x0af6('0x2e')]()[_0x0af6('0x19')](function(){if(!_0x2908f8[_0x0af6('0x2f')]){throw new db[(_0x0af6('0x1a'))][(_0x0af6('0x1b'))](_0x0af6('0x1c'));}if(!_0x478df5[_0x0af6('0x30')]||!_0x478df5[_0x0af6('0x1d')]||!_0x478df5[_0x0af6('0x1e')]||!_0x478df5[_0x0af6('0x31')]||!_0x478df5[_0x0af6('0x32')]){throw new db[(_0x0af6('0x1a'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x2908f8[_0x0af6('0xe')]){throw new Error(_0x0af6('0x20'));}if(_0x478df5[_0x0af6('0x1d')]===_0x1a51ed['id']){return _0x1a51ed;}else{return db[_0x0af6('0x21')][_0x0af6('0x22')]({'where':{'id':_settings[_0x0af6('0x1d')]}});}})['then'](function(_0x12205a){if(!_0x12205a){throw new db[(_0x0af6('0x1a'))][(_0x0af6('0x1b'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x12205a[_0x0af6('0x8')]||!_0x12205a[_0x0af6('0x9')]){throw new db[(_0x0af6('0x1a'))][(_0x0af6('0x1b'))](_0x0af6('0x33'));}_0x30a734=_0x12205a;logger['info'](util['format']('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x2908f8['id']));return sentiment(_0x30a734['data1'],_0x30a734['data2'],_0x478df5[_0x0af6('0x1e')],_0x2908f8[_0x0af6('0xe')],_0x478df5[_0x0af6('0x31')]);})[_0x0af6('0x19')](function(_0x426079){logger[_0x0af6('0x6')](util[_0x0af6('0x11')](_0x0af6('0x24'),_0x2908f8['id']));return _0x2908f8['update']({'sentiment':_0x426079[_0x0af6('0x34')],'sPositive':_0x426079[_0x0af6('0x25')][_0x0af6('0x26')],'sNegative':_0x426079[_0x0af6('0x25')][_0x0af6('0x27')],'sMixed':_0x426079[_0x0af6('0x25')]['Mixed'],'sNeutral':_0x426079[_0x0af6('0x25')][_0x0af6('0x29')],'transcribeStatus':_0x0af6('0xf')});})['then'](function(){logger[_0x0af6('0x6')](util[_0x0af6('0x11')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x2908f8['id']));_0x43a6c0();});}})[_0x0af6('0x35')](function(_0x4acd94){if(_0x4acd94){if(!_0x4acd94[_0x0af6('0x36')]||_0x4acd94['name']!==_0x0af6('0x37')){logger[_0x0af6('0x38')](util[_0x0af6('0x11')](_0x0af6('0x39'),_0x2908f8['id']),util[_0x0af6('0x3a')](_0x4acd94,{'showHidden':![],'depth':null}));}}_0x43a6c0();});});}function checkTranscribe(){var _0x4827b0;var _0x216550;var _0x16d398;return db[_0x0af6('0x3b')]['findAll']({'where':{'transcribeStatus':_0x0af6('0x3c')}})['then'](function(_0x41b916){if(!_0x41b916||!_0x41b916[_0x0af6('0x16')]){throw new db[(_0x0af6('0x1a'))]['ValidationError']('No\x20transcribe\x20job\x20to\x20check');}_0x4827b0=_0x41b916;return db[_0x0af6('0x3d')]['findOne']({'where':{'id':0x1}});})['then'](function(_0x27b0a4){if(!_0x27b0a4){throw new db[(_0x0af6('0x1a'))][(_0x0af6('0x1b'))](_0x0af6('0x3e'));}_0x216550=_0x27b0a4;if(!_0x216550['transcribe']||!_0x216550[_0x0af6('0x3f')]||!_0x216550[_0x0af6('0xa')]||!_0x216550[_0x0af6('0x31')]||!_0x216550[_0x0af6('0x32')]){throw new db[(_0x0af6('0x1a'))]['ValidationError'](_0x0af6('0x40'));}return db[_0x0af6('0x21')]['findOne']({'where':{'id':_0x216550[_0x0af6('0x3f')]}});})[_0x0af6('0x19')](function(_0x7c2c7b){if(!_0x7c2c7b){throw new db[(_0x0af6('0x1a'))][(_0x0af6('0x1b'))](_0x0af6('0x41'));}if(!_0x7c2c7b[_0x0af6('0x8')]||!_0x7c2c7b['data2']){throw new db[(_0x0af6('0x1a'))][(_0x0af6('0x1b'))]('Cloud\x20Provider\x20not\x20configured');}_0x16d398=_0x7c2c7b;var _0x287269=[];_0x4827b0['forEach'](function(_0x51e0ea){_0x287269[_0x0af6('0x42')](checkTranscribeJob(_0x51e0ea,_0x216550,_0x16d398));});return BPromise[_0x0af6('0x43')](_0x287269);})[_0x0af6('0x35')](function(_0x514760){if(_0x514760){if(!_0x514760['name']||_0x514760['name']!=='SequelizeValidationError'){logger['error'](util['inspect'](_0x514760,{'showHidden':![],'depth':null}));}}});}exports[_0x0af6('0x44')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0xf81a=['TranscriptionJobStatus','fileText','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','then','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','tempSentiment','Sequelize','ValidationError','sentiment','sentimentAccountId','sentimentRegion','language','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','findOne','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','data2','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','Negative','Mixed','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','Sentiment\x20Analysis\x20not\x20requested','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribe','transcribeAccountId','Transcribe\x20not\x20configured','forEach','push','all','lodash','aws-sdk','request-promise','bluebird','../../mysqldb','../../config/logger','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','transcribeRegion','TranscriptionJob'];(function(_0x533edc,_0x99bbe9){var _0x58bc91=function(_0x3c2b58){while(--_0x3c2b58){_0x533edc['push'](_0x533edc['shift']());}};_0x58bc91(++_0x99bbe9);}(_0xf81a,0x16b));var _0xaf81=function(_0x16885a,_0x395ebc){_0x16885a=_0x16885a-0x0;var _0x289b2c=_0xf81a[_0x16885a];return _0x289b2c;};var _=require(_0xaf81('0x0'));var AWS=require(_0xaf81('0x1'));var rp=require(_0xaf81('0x2'));var util=require('util');var BPromise=require(_0xaf81('0x3'));var db=require(_0xaf81('0x4'))['db'];var logger=require(_0xaf81('0x5'))('transcribe');function getTranscriptionJob(_0x4590d4,_0x398bb6,_0x5c8d58,_0x102c05){return new Promise(function(_0x3c4f98,_0x1c89dd){var _0x5cfd36=new AWS[(_0xaf81('0x6'))]({'accessKeyId':_0x398bb6,'secretAccessKey':_0x4590d4,'region':_0x5c8d58});_0x5cfd36[_0xaf81('0x7')]({'TranscriptionJobName':_0x102c05},function(_0x4c3052,_0x3f0ac8){if(_0x4c3052){return _0x1c89dd(_0x4c3052);}else{return _0x3c4f98(_0x3f0ac8);}});});}function sentiment(_0x34cc6a,_0x413337,_0x3efaaf,_0x4be0dd,_0x26d83a){return new Promise(function(_0x304b68,_0x154067){var _0x307190=new AWS[(_0xaf81('0x8'))]({'accessKeyId':_0x413337,'secretAccessKey':_0x34cc6a,'region':_0x3efaaf});_0x307190[_0xaf81('0x9')]({'Text':_0x4be0dd,'LanguageCode':_0x26d83a['substring'](0x0,0x2)},function(_0x57ba9c,_0x2acecd){if(_0x57ba9c){return _0x154067(_0x57ba9c);}else{return _0x304b68(_0x2acecd);}});});}function checkTranscribeJob(_0x56497d,_0x2ecd06,_0x327517){var _0x2b62dd;return new BPromise(function(_0x3f6fbd,_0x5dc8dc){logger[_0xaf81('0xa')](util[_0xaf81('0xb')](_0xaf81('0xc'),_0x56497d['id'],_0x56497d[_0xaf81('0xd')]));return getTranscriptionJob(_0x327517[_0xaf81('0xe')],_0x327517['data2'],_0x2ecd06[_0xaf81('0xf')],_0x56497d[_0xaf81('0xd')])['then'](function(_0x14d43e){logger[_0xaf81('0xa')](util[_0xaf81('0xb')]('[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s',_0x56497d['id'],_0x56497d[_0xaf81('0xd')],_0x14d43e[_0xaf81('0x10')][_0xaf81('0x11')]));if(!_0x56497d[_0xaf81('0x12')]){switch(_0x14d43e[_0xaf81('0x10')][_0xaf81('0x11')]){case _0xaf81('0x13'):var _0x3912de={'transcribeStatus':_0x14d43e['TranscriptionJob'][_0xaf81('0x11')],'fileUri':_0x14d43e['TranscriptionJob'][_0xaf81('0x14')][_0xaf81('0x15')]};logger[_0xaf81('0xa')](util[_0xaf81('0xb')](_0xaf81('0x16'),_0x56497d['id']));return rp({'uri':_0x14d43e['TranscriptionJob']['Transcript']['TranscriptFileUri'],'json':!![]})[_0xaf81('0x17')](function(_0x45d102){logger[_0xaf81('0xa')](util[_0xaf81('0xb')](_0xaf81('0x18'),_0x56497d['id']));if(_0x45d102&&_0x45d102[_0xaf81('0x19')]&&_0x45d102[_0xaf81('0x19')][_0xaf81('0x1a')]&&_0x45d102[_0xaf81('0x19')]['transcripts'][_0xaf81('0x1b')]){_0x3912de[_0xaf81('0x12')]='';for(var _0x4d7f7a=0x0;_0x4d7f7a<_0x45d102['results']['transcripts'][_0xaf81('0x1b')];_0x4d7f7a++){_0x3912de[_0xaf81('0x12')]+=_0x45d102[_0xaf81('0x19')][_0xaf81('0x1a')][_0x4d7f7a][_0xaf81('0x1c')]+'';}}return _0x56497d[_0xaf81('0x1d')](_0x3912de);})[_0xaf81('0x17')](function(){logger[_0xaf81('0xa')](util[_0xaf81('0xb')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x56497d['id']));if(!_0x56497d[_0xaf81('0x1e')]){throw new db[(_0xaf81('0x1f'))][(_0xaf81('0x20'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x2ecd06[_0xaf81('0x21')]||!_0x2ecd06[_0xaf81('0x22')]||!_0x2ecd06[_0xaf81('0x23')]||!_0x2ecd06[_0xaf81('0x24')]||!_0x2ecd06[_0xaf81('0x25')]){throw new db['Sequelize'][(_0xaf81('0x20'))](_0xaf81('0x26'));}if(!_0x3912de[_0xaf81('0x12')]){throw new Error(_0xaf81('0x27'));}if(_0x2ecd06[_0xaf81('0x22')]===_0x327517['id']){return _0x327517;}else{return db[_0xaf81('0x28')][_0xaf81('0x29')]({'where':{'id':_settings[_0xaf81('0x22')]}});}})[_0xaf81('0x17')](function(_0x207058){if(!_0x207058){throw new db['Sequelize'][(_0xaf81('0x20'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x207058[_0xaf81('0xe')]||!_0x207058['data2']){throw new db['Sequelize'][(_0xaf81('0x20'))]('Cloud\x20Provider\x20not\x20configured');}_0x2b62dd=_0x207058;logger[_0xaf81('0xa')](util['format'](_0xaf81('0x2a'),_0x56497d['id']));return sentiment(_0x2b62dd['data1'],_0x2b62dd[_0xaf81('0x2b')],_0x2ecd06[_0xaf81('0x23')],_0x3912de[_0xaf81('0x12')],_0x2ecd06[_0xaf81('0x24')]);})[_0xaf81('0x17')](function(_0x3c51d2){logger[_0xaf81('0xa')](util[_0xaf81('0xb')](_0xaf81('0x2c'),_0x56497d['id']));return _0x56497d['update']({'sentiment':_0x3c51d2[_0xaf81('0x2d')],'sPositive':_0x3c51d2[_0xaf81('0x2e')][_0xaf81('0x2f')],'sNegative':_0x3c51d2['SentimentScore'][_0xaf81('0x30')],'sMixed':_0x3c51d2[_0xaf81('0x2e')][_0xaf81('0x31')],'sNeutral':_0x3c51d2[_0xaf81('0x2e')]['Neutral']});})['then'](function(){logger[_0xaf81('0xa')](util[_0xaf81('0xb')](_0xaf81('0x32'),_0x56497d['id']));_0x3f6fbd();});case'FAILED':return _0x56497d[_0xaf81('0x1d')]({'transcribeStatus':_0xaf81('0x33'),'failureReason':_0x14d43e[_0xaf81('0x10')][_0xaf81('0x34')]})[_0xaf81('0x17')](function(){logger[_0xaf81('0xa')](util[_0xaf81('0xb')](_0xaf81('0x32'),_0x56497d['id']));_0x3f6fbd();});default:logger[_0xaf81('0xa')](util[_0xaf81('0xb')](_0xaf81('0x35'),_0x56497d['id']));break;}}else{return BPromise[_0xaf81('0x36')]()[_0xaf81('0x17')](function(){if(!_0x56497d[_0xaf81('0x1e')]){throw new db['Sequelize']['ValidationError'](_0xaf81('0x37'));}if(!_0x2ecd06[_0xaf81('0x21')]||!_0x2ecd06[_0xaf81('0x22')]||!_0x2ecd06['sentimentRegion']||!_0x2ecd06['language']||!_0x2ecd06[_0xaf81('0x25')]){throw new db['Sequelize'][(_0xaf81('0x20'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x56497d['fileText']){throw new Error('Transcript\x20not\x20available');}if(_0x2ecd06['sentimentAccountId']===_0x327517['id']){return _0x327517;}else{return db[_0xaf81('0x28')][_0xaf81('0x29')]({'where':{'id':_settings[_0xaf81('0x22')]}});}})[_0xaf81('0x17')](function(_0x425dd1){if(!_0x425dd1){throw new db[(_0xaf81('0x1f'))]['ValidationError'](_0xaf81('0x38'));}if(!_0x425dd1[_0xaf81('0xe')]||!_0x425dd1[_0xaf81('0x2b')]){throw new db['Sequelize'][(_0xaf81('0x20'))](_0xaf81('0x39'));}_0x2b62dd=_0x425dd1;logger[_0xaf81('0xa')](util[_0xaf81('0xb')](_0xaf81('0x2a'),_0x56497d['id']));return sentiment(_0x2b62dd[_0xaf81('0xe')],_0x2b62dd[_0xaf81('0x2b')],_0x2ecd06[_0xaf81('0x23')],_0x56497d[_0xaf81('0x12')],_0x2ecd06[_0xaf81('0x24')]);})['then'](function(_0x52bb17){logger['info'](util[_0xaf81('0xb')](_0xaf81('0x2c'),_0x56497d['id']));return _0x56497d[_0xaf81('0x1d')]({'sentiment':_0x52bb17[_0xaf81('0x2d')],'sPositive':_0x52bb17[_0xaf81('0x2e')][_0xaf81('0x2f')],'sNegative':_0x52bb17[_0xaf81('0x2e')]['Negative'],'sMixed':_0x52bb17[_0xaf81('0x2e')][_0xaf81('0x31')],'sNeutral':_0x52bb17[_0xaf81('0x2e')]['Neutral'],'transcribeStatus':'COMPLETED'});})[_0xaf81('0x17')](function(){logger[_0xaf81('0xa')](util[_0xaf81('0xb')](_0xaf81('0x32'),_0x56497d['id']));_0x3f6fbd();});}})[_0xaf81('0x3a')](function(_0xbc5496){if(_0xbc5496){if(!_0xbc5496[_0xaf81('0x3b')]||_0xbc5496[_0xaf81('0x3b')]!==_0xaf81('0x3c')){logger[_0xaf81('0x3d')](util[_0xaf81('0xb')](_0xaf81('0x3e'),_0x56497d['id']),util[_0xaf81('0x3f')](_0xbc5496,{'showHidden':![],'depth':null}));}}_0x3f6fbd();});});}function checkTranscribe(){var _0x485b8c;var _0x53dd8e;var _0x29347b;return db[_0xaf81('0x40')][_0xaf81('0x41')]({'where':{'transcribeStatus':_0xaf81('0x42')}})[_0xaf81('0x17')](function(_0x2a40f7){if(!_0x2a40f7||!_0x2a40f7[_0xaf81('0x1b')]){throw new db[(_0xaf81('0x1f'))][(_0xaf81('0x20'))](_0xaf81('0x43'));}_0x485b8c=_0x2a40f7;return db[_0xaf81('0x44')][_0xaf81('0x29')]({'where':{'id':0x1}});})['then'](function(_0x392ad5){if(!_0x392ad5){throw new db[(_0xaf81('0x1f'))]['ValidationError'](_0xaf81('0x45'));}_0x53dd8e=_0x392ad5;if(!_0x53dd8e[_0xaf81('0x46')]||!_0x53dd8e[_0xaf81('0x47')]||!_0x53dd8e[_0xaf81('0xf')]||!_0x53dd8e['language']||!_0x53dd8e[_0xaf81('0x25')]){throw new db[(_0xaf81('0x1f'))]['ValidationError'](_0xaf81('0x48'));}return db[_0xaf81('0x28')][_0xaf81('0x29')]({'where':{'id':_0x53dd8e['transcribeAccountId']}});})[_0xaf81('0x17')](function(_0x21b27d){if(!_0x21b27d){throw new db[(_0xaf81('0x1f'))][(_0xaf81('0x20'))](_0xaf81('0x38'));}if(!_0x21b27d[_0xaf81('0xe')]||!_0x21b27d['data2']){throw new db[(_0xaf81('0x1f'))][(_0xaf81('0x20'))](_0xaf81('0x39'));}_0x29347b=_0x21b27d;var _0x1ea024=[];_0x485b8c[_0xaf81('0x49')](function(_0x2897f3){_0x1ea024[_0xaf81('0x4a')](checkTranscribeJob(_0x2897f3,_0x53dd8e,_0x29347b));});return BPromise[_0xaf81('0x4b')](_0x1ea024);})['catch'](function(_0x1088ab){if(_0x1088ab){if(!_0x1088ab['name']||_0x1088ab[_0xaf81('0x3b')]!=='SequelizeValidationError'){logger[_0xaf81('0x3d')](util[_0xaf81('0x3f')](_0x1088ab,{'showHidden':![],'depth':null}));}}});}exports['start']=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file diff --git a/server/config/schedule/whatsapp.js b/server/config/schedule/whatsapp.js index 7e6c049..799ebf9 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 _0xff0e=['system','timeout','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','defaults','socket.io-emitter','redis','WhatsappInteraction','findAll','lastMsgAt','subtract','hours','then','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:'];(function(_0x258aca,_0x45c459){var _0x4f9944=function(_0x187626){while(--_0x187626){_0x258aca['push'](_0x258aca['shift']());}};_0x4f9944(++_0x45c459);}(_0xff0e,0x87));var _0xeff0=function(_0x53b773,_0x97444c){_0x53b773=_0x53b773-0x0;var _0x522455=_0xff0e[_0x53b773];return _0x522455;};'use strict';var _=require(_0xeff0('0x0'));var moment=require(_0xeff0('0x1'));var Redis=require(_0xeff0('0x2'));var util=require(_0xeff0('0x3'));var config=require(_0xeff0('0x4'));var db=require(_0xeff0('0x5'))['db'];var logger=require(_0xeff0('0x6'))('schedule');config['redis']=_[_0xeff0('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xeff0('0x8'))(new Redis(config[_0xeff0('0x9')]));function closeInteractions(){var _0x3a4111=[];return db[_0xeff0('0xa')][_0xeff0('0xb')]({'raw':!![],'attributes':['id',_0xeff0('0xc')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xeff0('0xd')](0x18,_0xeff0('0xe'))}}})[_0xeff0('0xf')](function(_0x264fee){if(_0x264fee&&_0x264fee[_0xeff0('0x10')]){_0x3a4111=_[_0xeff0('0x11')](_0x264fee||[],'id');logger[_0xeff0('0x12')](_0xeff0('0x13'),_0x3a4111['join']());return db[_0xeff0('0xa')]['update']({'closeReason':_0xeff0('0x14'),'disposition':_0xeff0('0x15'),'closed':!![],'closedAt':moment()['format'](_0xeff0('0x16'))},{'where':{'id':_0x3a4111}});}})[_0xeff0('0xf')](function(){if(_0x3a4111&&_0x3a4111['length']){logger[_0xeff0('0x12')](_0xeff0('0x17'),_0x3a4111['join']());for(var _0x1fa0b2=0x0;_0x1fa0b2<_0x3a4111['length'];_0x1fa0b2++){io[_0xeff0('0x18')](_0xeff0('0x19'),{'id':_0x3a4111[_0x1fa0b2],'closed':!![]});}}})[_0xeff0('0x1a')](function(_0x38a36c){logger[_0xeff0('0x1b')](_0xeff0('0x1c'),_0x38a36c?util[_0xeff0('0x1d')](_0x38a36c,{'showHidden':![],'depth':null}):'');});}exports[_0xeff0('0x1e')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x9aea=['../../config/environment','../logger','schedule','redis','WhatsappInteraction','findAll','hours','then','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','timeout','format','length','emit','whatsappInteraction:update','catch','error','inspect','start','lodash','ioredis'];(function(_0x147f8e,_0x3d97f2){var _0x64ceb3=function(_0x4c5ed7){while(--_0x4c5ed7){_0x147f8e['push'](_0x147f8e['shift']());}};_0x64ceb3(++_0x3d97f2);}(_0x9aea,0xee));var _0xa9ae=function(_0x5c54cf,_0x3bed51){_0x5c54cf=_0x5c54cf-0x0;var _0x5a43e3=_0x9aea[_0x5c54cf];return _0x5a43e3;};'use strict';var _=require(_0xa9ae('0x0'));var moment=require('moment');var Redis=require(_0xa9ae('0x1'));var util=require('util');var config=require(_0xa9ae('0x2'));var db=require('../../mysqldb')['db'];var logger=require(_0xa9ae('0x3'))(_0xa9ae('0x4'));config[_0xa9ae('0x5')]=_['defaults'](config[_0xa9ae('0x5')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa9ae('0x5')]));function closeInteractions(){var _0x85257=[];return db[_0xa9ae('0x6')][_0xa9ae('0x7')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()['subtract'](0x18,_0xa9ae('0x8'))}}})[_0xa9ae('0x9')](function(_0x31b098){if(_0x31b098&&_0x31b098['length']){_0x85257=_[_0xa9ae('0xa')](_0x31b098||[],'id');logger[_0xa9ae('0xb')](_0xa9ae('0xc'),_0x85257[_0xa9ae('0xd')]());return db['WhatsappInteraction'][_0xa9ae('0xe')]({'closeReason':'system','disposition':_0xa9ae('0xf'),'closed':!![],'closedAt':moment()[_0xa9ae('0x10')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x85257}});}})[_0xa9ae('0x9')](function(){if(_0x85257&&_0x85257['length']){logger[_0xa9ae('0xb')]('[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:',_0x85257['join']());for(var _0x19c152=0x0;_0x19c152<_0x85257[_0xa9ae('0x11')];_0x19c152++){io[_0xa9ae('0x12')](_0xa9ae('0x13'),{'id':_0x85257[_0x19c152],'closed':!![]});}}})[_0xa9ae('0x14')](function(_0x42d2e5){logger[_0xa9ae('0x15')]('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x42d2e5?util[_0xa9ae('0x16')](_0x42d2e5,{'showHidden':![],'depth':null}):'');});}exports[_0xa9ae('0x17')]=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 e2026c2..304ba2a 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdf15=['then','bulkCreate','log','finished\x20populating','contacts1','CmHopper','hopper1','contacts2','hopper2','catch','util','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','CmContact','destroy'];(function(_0x2c55b5,_0x39f9d1){var _0x1200e9=function(_0x7d856e){while(--_0x7d856e){_0x2c55b5['push'](_0x2c55b5['shift']());}};_0x1200e9(++_0x39f9d1);}(_0xdf15,0x136));var _0x5df1=function(_0x246fc1,_0x30c044){_0x246fc1=_0x246fc1-0x0;var _0x1f172c=_0xdf15[_0x246fc1];return _0x1f172c;};'use strict';var util=require(_0x5df1('0x0'));var db=require(_0x5df1('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x5df1('0x2')]({'id':i,'firstName':_0x5df1('0x3')+i,'lastName':_0x5df1('0x4')+i,'phone':0xf879fb460+i,'email':_0x5df1('0x5')+i+_0x5df1('0x6')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x5df1('0x2')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x5df1('0x7')](),'updatedAt':Date[_0x5df1('0x7')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x5df1('0x2')]({'id':i,'firstName':_0x5df1('0x3')+i,'lastName':_0x5df1('0x4')+i,'phone':0xf879fb460+i,'email':_0x5df1('0x5')+i+_0x5df1('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x5df1('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x5df1('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x5df1('0x7')](),'updatedAt':Date[_0x5df1('0x7')]()});}db[_0x5df1('0x8')][_0x5df1('0x9')]({'where':{}})[_0x5df1('0xa')](function(){return db['CmContact'][_0x5df1('0xb')](contacts);})[_0x5df1('0xa')](function(){console[_0x5df1('0xc')](_0x5df1('0xd'),_0x5df1('0xe'));return db[_0x5df1('0xf')]['destroy']({'where':{}});})[_0x5df1('0xa')](function(){return db[_0x5df1('0xf')][_0x5df1('0xb')](hopper);})['then'](function(){console['log'](_0x5df1('0xd'),_0x5df1('0x10'));return db[_0x5df1('0x8')][_0x5df1('0xb')](contacts2);})[_0x5df1('0xa')](function(){console[_0x5df1('0xc')]('finished\x20populating',_0x5df1('0x11'));return db['CmHopper']['bulkCreate'](hopper2);})['then'](function(){console[_0x5df1('0xc')]('finished\x20populating',_0x5df1('0x12'));})[_0x5df1('0x13')](function(_0xc49674){console[_0x5df1('0xc')](_0xc49674);}); \ No newline at end of file +var _0x7311=['hopper1','contacts2','hopper2','util','../mysqldb','push','Biondo','innocenzo.biondo','now','Innocenzo','@xcally.com','CmContact','destroy','then','bulkCreate','log','finished\x20populating','contacts1','CmHopper'];(function(_0x510ee9,_0x894344){var _0x5bf64f=function(_0x19b423){while(--_0x19b423){_0x510ee9['push'](_0x510ee9['shift']());}};_0x5bf64f(++_0x894344);}(_0x7311,0xae));var _0x1731=function(_0x4f15c6,_0x3eb56a){_0x4f15c6=_0x4f15c6-0x0;var _0x5cd110=_0x7311[_0x4f15c6];return _0x5cd110;};'use strict';var util=require(_0x1731('0x0'));var db=require(_0x1731('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x1731('0x2')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x1731('0x3')+i,'phone':0xf879fb460+i,'email':_0x1731('0x4')+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x1731('0x5')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x1731('0x2')]({'id':i,'firstName':_0x1731('0x6')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x1731('0x4')+i+_0x1731('0x7')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x1731('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x1731('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x1731('0x5')](),'updatedAt':Date[_0x1731('0x5')]()});}db[_0x1731('0x8')][_0x1731('0x9')]({'where':{}})[_0x1731('0xa')](function(){return db[_0x1731('0x8')][_0x1731('0xb')](contacts);})[_0x1731('0xa')](function(){console[_0x1731('0xc')](_0x1731('0xd'),_0x1731('0xe'));return db[_0x1731('0xf')][_0x1731('0x9')]({'where':{}});})[_0x1731('0xa')](function(){return db['CmHopper']['bulkCreate'](hopper);})[_0x1731('0xa')](function(){console[_0x1731('0xc')](_0x1731('0xd'),_0x1731('0x10'));return db['CmContact'][_0x1731('0xb')](contacts2);})['then'](function(){console[_0x1731('0xc')](_0x1731('0xd'),_0x1731('0x11'));return db[_0x1731('0xf')][_0x1731('0xb')](hopper2);})[_0x1731('0xa')](function(){console['log']('finished\x20populating',_0x1731('0x12'));})['catch'](function(_0x21c016){console[_0x1731('0xc')](_0x21c016);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 32a9551..f3cdbd7 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3285=['friend','wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','\x22%s\x22\x20<%s>','User','log','push','%s%s','agent','format','%s%s@xcally.com','password'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0x3285,0xdb));var _0x5328=function(_0x38ced4,_0x24263f){_0x38ced4=_0x38ced4-0x0;var _0x547c07=_0x3285[_0x38ced4];return _0x547c07;};'use strict';var util=require('util');var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x5328('0x0')]({'name':util['format'](_0x5328('0x1'),_0x5328('0x2'),i),'fullname':util['format'](_0x5328('0x1'),_0x5328('0x2'),i),'email':util[_0x5328('0x3')](_0x5328('0x4'),'agent',i),'role':_0x5328('0x2'),'password':_0x5328('0x5'),'internal':0xfa0+i,'type':_0x5328('0x6'),'transport':['udp','ws',_0x5328('0x7')],'disallow':[_0x5328('0x8')],'allow':[_0x5328('0x9')],'defaultuser':util[_0x5328('0x3')](_0x5328('0x1'),_0x5328('0x2'),i),'encryption':'yes','avpf':_0x5328('0xa'),'force_avp':'yes','icesupport':'yes','dtlsenable':'yes','dtlsverify':'no','dtlscertfile':_0x5328('0xb'),'dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':'actpass','callerid':util[_0x5328('0x3')](_0x5328('0xc'),util[_0x5328('0x3')](_0x5328('0x1'),_0x5328('0x2'),i),0xfa0+i)});}db[_0x5328('0xd')]['bulkCreate'](users)['then'](function(){console[_0x5328('0xe')]('add\x20user');})['catch'](function(_0x125174){console[_0x5328('0xe')](_0x125174);}); \ No newline at end of file +var _0x8b83=['/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','bulkCreate','then','add\x20user','log','util','../mysqldb','push','format','%s%s','agent','%s%s@xcally.com','password','friend','wss','ulaw','yes'];(function(_0x433bf8,_0x4b5981){var _0x181b83=function(_0x6007b0){while(--_0x6007b0){_0x433bf8['push'](_0x433bf8['shift']());}};_0x181b83(++_0x4b5981);}(_0x8b83,0x184));var _0x38b8=function(_0x308e27,_0x40c1cf){_0x308e27=_0x308e27-0x0;var _0xde0701=_0x8b83[_0x308e27];return _0xde0701;};'use strict';var util=require(_0x38b8('0x0'));var db=require(_0x38b8('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x38b8('0x2')]({'name':util[_0x38b8('0x3')](_0x38b8('0x4'),_0x38b8('0x5'),i),'fullname':util[_0x38b8('0x3')](_0x38b8('0x4'),_0x38b8('0x5'),i),'email':util[_0x38b8('0x3')](_0x38b8('0x6'),_0x38b8('0x5'),i),'role':_0x38b8('0x5'),'password':_0x38b8('0x7'),'internal':0xfa0+i,'type':_0x38b8('0x8'),'transport':['udp','ws',_0x38b8('0x9')],'disallow':['all'],'allow':[_0x38b8('0xa')],'defaultuser':util[_0x38b8('0x3')](_0x38b8('0x4'),_0x38b8('0x5'),i),'encryption':_0x38b8('0xb'),'avpf':'yes','force_avp':_0x38b8('0xb'),'icesupport':'yes','dtlsenable':'yes','dtlsverify':'no','dtlscertfile':_0x38b8('0xc'),'dtlsprivatekey':_0x38b8('0xd'),'dtlssetup':_0x38b8('0xe'),'callerid':util[_0x38b8('0x3')](_0x38b8('0xf'),util[_0x38b8('0x3')]('%s%s',_0x38b8('0x5'),i),0xfa0+i)});}db['User'][_0x38b8('0x10')](users)[_0x38b8('0x11')](function(){console['log'](_0x38b8('0x12'));})['catch'](function(_0x5d6b11){console[_0x38b8('0x13')](_0x5d6b11);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index d3bb340..8601288 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4dcb=['request','remoteAddress','remotePort','connectedAt','SocketIO\x20','nsp','util','bluebird','../mysqldb','./environment','name','Agents','User','role','telephone','agent','type','ivr','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','Telephones','findAll','Trunks','IvrCampaigns','resourceId','map','where','Campaign','%s:queue:%s','length','format','user:%s','handshake','find','userProfileId','query','ChatInteractions','MailInteractions','OpenchannelInteraction','WhatsappInteraction','admin','voice:inbound','voice:outbound','hasOwnProperty','include','VoiceQueue','ChatQueue','push','FaxQueue','Trunk','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','voice','chat','fax','sms','mail','openchannel','telephone:%s','trunk:%s','leave','removeChatInteractions','emit','user_has_chat_interactions:remove','removeMailInteractions','user_has_fax_interactions:remove','SmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','OpenchannelInteractions','removeOpenchannelInteractions','user_has_whatsapp_interactions:remove','catch','log','default','setMaxListeners','address'];(function(_0x1055d6,_0x2b2cf3){var _0x4dc056=function(_0xcb7d57){while(--_0xcb7d57){_0x1055d6['push'](_0x1055d6['shift']());}};_0x4dc056(++_0x2b2cf3);}(_0x4dcb,0x186));var _0xb4dc=function(_0x1c4955,_0x29d472){_0x1c4955=_0x1c4955-0x0;var _0xb31703=_0x4dcb[_0x1c4955];return _0xb31703;};'use strict';var _=require('lodash');var util=require(_0xb4dc('0x0'));var BPromise=require(_0xb4dc('0x1'));var db=require(_0xb4dc('0x2'))['db'];var config=require(_0xb4dc('0x3'));var queryQueues={'attributes':['id',_0xb4dc('0x4')],'include':[{'as':_0xb4dc('0x5'),'model':db[_0xb4dc('0x6')],'attributes':['id',_0xb4dc('0x4'),_0xb4dc('0x7')],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':_0xb4dc('0x8')}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id',_0xb4dc('0x4')],'where':{'role':_0xb4dc('0x9')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xb4dc('0x4'),_0xb4dc('0xa')],'where':{'type':_0xb4dc('0xb')}};function getAssociatedResources(_0x168305,_0x57d4ab,_0xa50528){return db[_0xb4dc('0xc')][_0xb4dc('0xd')]({'where':{'name':_0x168305,'userProfileId':_0x57d4ab},'raw':!![]})[_0xb4dc('0xe')](function(_0x3fd9ec){if(_0x3fd9ec){if(_0x3fd9ec[_0xb4dc('0xf')]){switch(_0x168305){case _0xb4dc('0x10'):case _0xb4dc('0x11'):case _0xb4dc('0x12'):case _0xb4dc('0x13'):case _0xb4dc('0x14'):case _0xb4dc('0x15'):case _0xb4dc('0x16'):return db[_0xa50528]['findAll'](queryQueues);case _0xb4dc('0x17'):return db[_0xa50528][_0xb4dc('0x18')](queryTelephones);case _0xb4dc('0x19'):return db[_0xa50528][_0xb4dc('0x18')](queryTrunks);case _0xb4dc('0x1a'):return db[_0xa50528]['findAll'](queryCampaigns);}}else{return db['UserProfileResource'][_0xb4dc('0x18')]({'attributes':[_0xb4dc('0x1b')],'where':{'sectionId':_0x3fd9ec['id']},'raw':!![]})[_0xb4dc('0xe')](function(_0x8dbc17){if(_0x8dbc17){var _0x35e5dd={'where':{'id':_[_0xb4dc('0x1c')](_0x8dbc17,'resourceId')},'raw':!![]};switch(_0xa50528){case'User':_0x35e5dd[_0xb4dc('0x1d')][_0xb4dc('0x7')]=_0xb4dc('0x8');break;case _0xb4dc('0x1e'):_0x35e5dd[_0xb4dc('0x1d')][_0xb4dc('0xa')]=_0xb4dc('0xb');break;}return db[_0xa50528][_0xb4dc('0x18')](_0x35e5dd);}else{return[];}});}}else{return[];}})[_0xb4dc('0xe')](function(_0x1d2970){return _0x1d2970;});}function joinOrLeaveQueues(_0x2386f5,_0x2a2729,_0x257443,_0x2dfc39){_0x2386f5[_0x2a2729](util['format'](_0xb4dc('0x1f'),_0x257443,_0x2dfc39['name']));if(_0x2dfc39[_0xb4dc('0x5')]){for(var _0x13666b=0x0;_0x13666b<_0x2dfc39['Agents'][_0xb4dc('0x20')];_0x13666b+=0x1){_0x2386f5[_0x2a2729](util[_0xb4dc('0x21')](_0xb4dc('0x22'),_0x2dfc39[_0xb4dc('0x5')][_0x13666b][_0xb4dc('0x4')]));}}}function joinOrLeave(_0x1783c1,_0x2d0c90,_0x2b1ee1){var _0xa2561d;if(_0x1783c1[_0xb4dc('0x23')]['query']['id']){db['User'][_0xb4dc('0x24')]({'attributes':['id',_0xb4dc('0x4'),_0xb4dc('0x7'),_0xb4dc('0x25')],'where':{'id':_0x1783c1[_0xb4dc('0x23')][_0xb4dc('0x26')]['id']},'include':[{'model':db['ChatInteraction'],'as':_0xb4dc('0x27'),'attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':_0xb4dc('0x28'),'attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xb4dc('0x29')],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xb4dc('0x2a')],'as':'WhatsappInteractions','attributes':['id'],'raw':!![]}]})[_0xb4dc('0xe')](function(_0x15642c){if(_0x15642c){_0xa2561d=_0x15642c;_0x1783c1[_0x2d0c90](util['format']('user:%s',_0x15642c[_0xb4dc('0x4')]));var _0x11d20a=[];switch(_0x15642c[_0xb4dc('0x7')]){case _0xb4dc('0x2b'):_0x1783c1[_0x2d0c90](_0xb4dc('0x2c'));_0x1783c1[_0x2d0c90](_0xb4dc('0x2d'));if(queryQueues[_0xb4dc('0x2e')](_0xb4dc('0x2f'))){delete queryQueues['include'];}_0x11d20a['push'](db[_0xb4dc('0x30')][_0xb4dc('0x18')](queryQueues));_0x11d20a['push'](db[_0xb4dc('0x31')]['findAll'](queryQueues));_0x11d20a[_0xb4dc('0x32')](db[_0xb4dc('0x33')][_0xb4dc('0x18')](queryQueues));_0x11d20a[_0xb4dc('0x32')](db['SmsQueue']['findAll'](queryQueues));_0x11d20a[_0xb4dc('0x32')](db['MailQueue']['findAll'](queryQueues));_0x11d20a[_0xb4dc('0x32')](db['OpenchannelQueue'][_0xb4dc('0x18')](queryQueues));_0x11d20a[_0xb4dc('0x32')](db['WhatsappQueue']['findAll'](queryQueues));_0x11d20a['push'](db['User']['findAll'](queryTelephones));_0x11d20a[_0xb4dc('0x32')](db[_0xb4dc('0x34')][_0xb4dc('0x18')](queryTrunks));_0x11d20a['push'](db[_0xb4dc('0x1e')][_0xb4dc('0x18')](queryCampaigns));_0x11d20a[_0xb4dc('0x32')](db[_0xb4dc('0x6')][_0xb4dc('0x18')](queryAgents));break;case'user':_0x1783c1[_0x2d0c90](_0xb4dc('0x2c'));_0x1783c1[_0x2d0c90](_0xb4dc('0x2d'));_0x11d20a[_0xb4dc('0x32')](getAssociatedResources(_0xb4dc('0x10'),_0x15642c[_0xb4dc('0x25')],'VoiceQueue'));_0x11d20a['push'](getAssociatedResources(_0xb4dc('0x11'),_0x15642c[_0xb4dc('0x25')],_0xb4dc('0x31')));_0x11d20a['push'](getAssociatedResources(_0xb4dc('0x12'),_0x15642c[_0xb4dc('0x25')],_0xb4dc('0x33')));_0x11d20a[_0xb4dc('0x32')](getAssociatedResources('SmsQueues',_0x15642c[_0xb4dc('0x25')],_0xb4dc('0x35')));_0x11d20a[_0xb4dc('0x32')](getAssociatedResources(_0xb4dc('0x14'),_0x15642c[_0xb4dc('0x25')],_0xb4dc('0x36')));_0x11d20a[_0xb4dc('0x32')](getAssociatedResources(_0xb4dc('0x15'),_0x15642c['userProfileId'],_0xb4dc('0x37')));_0x11d20a[_0xb4dc('0x32')](getAssociatedResources('WhatsappQueues',_0x15642c['userProfileId'],_0xb4dc('0x38')));_0x11d20a[_0xb4dc('0x32')](getAssociatedResources(_0xb4dc('0x17'),_0x15642c[_0xb4dc('0x25')],_0xb4dc('0x6')));_0x11d20a[_0xb4dc('0x32')](getAssociatedResources('Trunks',_0x15642c[_0xb4dc('0x25')],_0xb4dc('0x34')));_0x11d20a[_0xb4dc('0x32')](getAssociatedResources('IvrCampaigns',_0x15642c[_0xb4dc('0x25')],_0xb4dc('0x1e')));_0x11d20a[_0xb4dc('0x32')](db[_0xb4dc('0x6')][_0xb4dc('0x18')](queryAgents));break;case _0xb4dc('0x9'):_0x1783c1[_0x2d0c90](_0xb4dc('0x2c'));_0x1783c1[_0x2d0c90]('voice:outbound');_0x11d20a['push'](_0x15642c[_0xb4dc('0x39')]({'attributes':['id',_0xb4dc('0x4')]}));_0x11d20a['push'](_0x15642c[_0xb4dc('0x3a')]({'attributes':['id',_0xb4dc('0x4')]}));_0x11d20a[_0xb4dc('0x32')](_0x15642c[_0xb4dc('0x3b')]({'attributes':['id',_0xb4dc('0x4')]}));_0x11d20a[_0xb4dc('0x32')](_0x15642c[_0xb4dc('0x3c')]({'attributes':['id','name']}));_0x11d20a['push'](_0x15642c[_0xb4dc('0x3d')]({'attributes':['id',_0xb4dc('0x4')]}));_0x11d20a['push'](_0x15642c[_0xb4dc('0x3e')]({'attributes':['id',_0xb4dc('0x4')]}));_0x11d20a[_0xb4dc('0x32')](_0x15642c[_0xb4dc('0x3f')]({'attributes':['id',_0xb4dc('0x4')]}));break;}return BPromise[_0xb4dc('0x40')](_0x11d20a);}})['then'](function(_0x3a5291){if(_0x3a5291&&_0x3a5291[_0xb4dc('0x20')]){for(var _0x5c339d=0x0;_0x5c339d<_0x3a5291[_0xb4dc('0x20')];_0x5c339d+=0x1){for(var _0x24b151=0x0;_0x24b151<_0x3a5291[_0x5c339d][_0xb4dc('0x20')];_0x24b151+=0x1){switch(_0x5c339d){case 0x0:joinOrLeaveQueues(_0x1783c1,_0x2d0c90,_0xb4dc('0x41'),_0x3a5291[_0x5c339d][_0x24b151]);break;case 0x1:joinOrLeaveQueues(_0x1783c1,_0x2d0c90,_0xb4dc('0x42'),_0x3a5291[_0x5c339d][_0x24b151]);break;case 0x2:joinOrLeaveQueues(_0x1783c1,_0x2d0c90,_0xb4dc('0x43'),_0x3a5291[_0x5c339d][_0x24b151]);break;case 0x3:joinOrLeaveQueues(_0x1783c1,_0x2d0c90,_0xb4dc('0x44'),_0x3a5291[_0x5c339d][_0x24b151]);break;case 0x4:joinOrLeaveQueues(_0x1783c1,_0x2d0c90,_0xb4dc('0x45'),_0x3a5291[_0x5c339d][_0x24b151]);break;case 0x5:joinOrLeaveQueues(_0x1783c1,_0x2d0c90,_0xb4dc('0x46'),_0x3a5291[_0x5c339d][_0x24b151]);break;case 0x6:joinOrLeaveQueues(_0x1783c1,_0x2d0c90,'whatsapp',_0x3a5291[_0x5c339d][_0x24b151]);break;case 0x7:if(_0xa2561d[_0xb4dc('0x7')]!==_0xb4dc('0x9'))_0x1783c1[_0x2d0c90](util['format'](_0xb4dc('0x47'),_0x3a5291[_0x5c339d][_0x24b151][_0xb4dc('0x4')]));break;case 0x8:if(_0xa2561d[_0xb4dc('0x7')]!==_0xb4dc('0x9'))_0x1783c1[_0x2d0c90](util[_0xb4dc('0x21')](_0xb4dc('0x48'),_0x3a5291[_0x5c339d][_0x24b151][_0xb4dc('0x4')]));break;case 0x9:if(_0xa2561d[_0xb4dc('0x7')]!=='agent')_0x1783c1[_0x2d0c90](util[_0xb4dc('0x21')]('campaign:%s:%s',_0x3a5291[_0x5c339d][_0x24b151][_0xb4dc('0xa')],_0x3a5291[_0x5c339d][_0x24b151][_0xb4dc('0x4')]));break;case 0xa:_0x1783c1[_0x2d0c90](util[_0xb4dc('0x21')](_0xb4dc('0x22'),_0x3a5291[_0x5c339d][_0x24b151]['name']));break;}}}}})['then'](function(){if(_0x2d0c90===_0xb4dc('0x49')){var _0x2512fd=_[_0xb4dc('0x1c')](_0xa2561d[_0xb4dc('0x27')],'id');return _0xa2561d[_0xb4dc('0x4a')](_0x2512fd)[_0xb4dc('0xe')](function(){for(var _0x397b7f=0x0;_0x397b7f<_0x2512fd[_0xb4dc('0x20')];_0x397b7f+=0x1){_0x2b1ee1[_0xb4dc('0x4b')](_0xb4dc('0x4c'),{'ChatInteractionId':Number(_0x2512fd[_0x397b7f]),'UserId':Number(_0xa2561d['id'])});}});}})[_0xb4dc('0xe')](function(){if(_0x2d0c90===_0xb4dc('0x49')){var _0x1da38c=_['map'](_0xa2561d[_0xb4dc('0x28')],'id');return _0xa2561d[_0xb4dc('0x4d')](_0x1da38c)[_0xb4dc('0xe')](function(){for(var _0xdf6bb3=0x0;_0xdf6bb3<_0x1da38c['length'];_0xdf6bb3+=0x1){_0x2b1ee1[_0xb4dc('0x4b')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x1da38c[_0xdf6bb3]),'UserId':Number(_0xa2561d['id'])});}});}})['then'](function(){if(_0x2d0c90==='leave'){var _0x141fa1=_[_0xb4dc('0x1c')](_0xa2561d['FaxInteractions'],'id');return _0xa2561d['removeFaxInteractions'](_0x141fa1)[_0xb4dc('0xe')](function(){for(var _0x2c137e=0x0;_0x2c137e<_0x141fa1[_0xb4dc('0x20')];_0x2c137e+=0x1){_0x2b1ee1[_0xb4dc('0x4b')](_0xb4dc('0x4e'),{'FaxInteractionId':Number(_0x141fa1[_0x2c137e]),'UserId':Number(_0xa2561d['id'])});}});}})[_0xb4dc('0xe')](function(){if(_0x2d0c90===_0xb4dc('0x49')){var _0x2983b9=_['map'](_0xa2561d[_0xb4dc('0x4f')],'id');return _0xa2561d[_0xb4dc('0x50')](_0x2983b9)[_0xb4dc('0xe')](function(){for(var _0x45a048=0x0;_0x45a048<_0x2983b9[_0xb4dc('0x20')];_0x45a048+=0x1){_0x2b1ee1[_0xb4dc('0x4b')](_0xb4dc('0x51'),{'SmsInteractionId':Number(_0x2983b9[_0x45a048]),'UserId':Number(_0xa2561d['id'])});}});}})[_0xb4dc('0xe')](function(){if(_0x2d0c90===_0xb4dc('0x49')){var _0x3acb7e=_[_0xb4dc('0x1c')](_0xa2561d[_0xb4dc('0x52')],'id');return _0xa2561d[_0xb4dc('0x53')](_0x3acb7e)['then'](function(){for(var _0xc0d57c=0x0;_0xc0d57c<_0x3acb7e['length'];_0xc0d57c+=0x1){_0x2b1ee1[_0xb4dc('0x4b')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x3acb7e[_0xc0d57c]),'UserId':Number(_0xa2561d['id'])});}});}})['then'](function(){if(_0x2d0c90==='leave'){var _0x37da4d=_['map'](_0xa2561d['WhatsappInteractions'],'id');return _0xa2561d['removeWhatsappInteractions'](_0x37da4d)[_0xb4dc('0xe')](function(){for(var _0x3ade05=0x0;_0x3ade05<_0x37da4d[_0xb4dc('0x20')];_0x3ade05+=0x1){_0x2b1ee1['emit'](_0xb4dc('0x54'),{'WhatsappInteractionId':Number(_0x37da4d[_0x3ade05]),'UserId':Number(_0xa2561d['id'])});}});}})[_0xb4dc('0x55')](function(_0x257ba0){_0x1783c1[_0xb4dc('0x56')](_0x257ba0);});}}function onDisconnect(_0x3f23dc,_0x1b4044){joinOrLeave(_0x3f23dc,_0xb4dc('0x49'),_0x1b4044);}function onConnect(_0x3588af){joinOrLeave(_0x3588af,'join');}exports[_0xb4dc('0x57')]=function(_0x50e65b){_0x50e65b['on']('connection',function(_0x3c2c50){_0x3c2c50[_0xb4dc('0x58')](0x0);_0x3c2c50[_0xb4dc('0x59')]=_0x3c2c50[_0xb4dc('0x5a')]['connection'][_0xb4dc('0x5b')]+':'+_0x3c2c50[_0xb4dc('0x5a')]['connection'][_0xb4dc('0x5c')];_0x3c2c50[_0xb4dc('0x5d')]=new Date();_0x3c2c50[_0xb4dc('0x56')]=function(_0x51bbd2){console['log'](_0xb4dc('0x5e')+_0x3c2c50[_0xb4dc('0x5f')][_0xb4dc('0x4')]+'['+_0x3c2c50['address']+']',_0x51bbd2);};_0x3c2c50['on']('disconnect',function(){onDisconnect(_0x3c2c50,_0x50e65b);_0x3c2c50[_0xb4dc('0x56')]('DISCONNECTED');});onConnect(_0x3c2c50);_0x3c2c50[_0xb4dc('0x56')]('CONNECTED');});}; \ No newline at end of file +var _0x8561=['fax','sms','mail','openchannel','whatsapp','telephone:%s','campaign:%s:%s','removeChatInteractions','emit','leave','MailInteractions','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','SmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','default','setMaxListeners','connection','remoteAddress','request','remotePort','connectedAt','nsp','disconnect','DISCONNECTED','CONNECTED','util','bluebird','./environment','Agents','name','agent','type','UserProfileSection','findOne','autoAssociation','ChatQueues','FaxQueues','SmsQueues','OpenchannelQueues','WhatsappQueues','Telephones','findAll','Trunks','IvrCampaigns','UserProfileResource','resourceId','then','map','User','telephone','ivr','format','length','user:%s','handshake','query','find','role','userProfileId','ChatInteractions','MailInteraction','FaxInteraction','SmsInteraction','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','user','VoiceQueues','ChatQueue','MailQueues','Campaign','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all'];(function(_0x46a3e8,_0x2e1b35){var _0xf1442e=function(_0x37b5d4){while(--_0x37b5d4){_0x46a3e8['push'](_0x46a3e8['shift']());}};_0xf1442e(++_0x2e1b35);}(_0x8561,0x1b2));var _0x1856=function(_0xeb67d8,_0x14a337){_0xeb67d8=_0xeb67d8-0x0;var _0x4138f9=_0x8561[_0xeb67d8];return _0x4138f9;};'use strict';var _=require('lodash');var util=require(_0x1856('0x0'));var BPromise=require(_0x1856('0x1'));var db=require('../mysqldb')['db'];var config=require(_0x1856('0x2'));var queryQueues={'attributes':['id','name'],'include':[{'as':_0x1856('0x3'),'model':db['User'],'attributes':['id',_0x1856('0x4'),'role'],'raw':!![],'where':{'role':_0x1856('0x5')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x1856('0x4')],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id',_0x1856('0x4')],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id','name',_0x1856('0x6')],'where':{'type':'ivr'}};function getAssociatedResources(_0x4c19c5,_0x5b0930,_0x5c3bc5){return db[_0x1856('0x7')][_0x1856('0x8')]({'where':{'name':_0x4c19c5,'userProfileId':_0x5b0930},'raw':!![]})['then'](function(_0x55fe85){if(_0x55fe85){if(_0x55fe85[_0x1856('0x9')]){switch(_0x4c19c5){case'VoiceQueues':case _0x1856('0xa'):case _0x1856('0xb'):case _0x1856('0xc'):case'MailQueues':case _0x1856('0xd'):case _0x1856('0xe'):return db[_0x5c3bc5]['findAll'](queryQueues);case _0x1856('0xf'):return db[_0x5c3bc5][_0x1856('0x10')](queryTelephones);case _0x1856('0x11'):return db[_0x5c3bc5]['findAll'](queryTrunks);case _0x1856('0x12'):return db[_0x5c3bc5][_0x1856('0x10')](queryCampaigns);}}else{return db[_0x1856('0x13')]['findAll']({'attributes':[_0x1856('0x14')],'where':{'sectionId':_0x55fe85['id']},'raw':!![]})[_0x1856('0x15')](function(_0x12a82f){if(_0x12a82f){var _0x3ff3af={'where':{'id':_[_0x1856('0x16')](_0x12a82f,_0x1856('0x14'))},'raw':!![]};switch(_0x5c3bc5){case _0x1856('0x17'):_0x3ff3af['where']['role']=_0x1856('0x18');break;case'Campaign':_0x3ff3af['where'][_0x1856('0x6')]=_0x1856('0x19');break;}return db[_0x5c3bc5]['findAll'](_0x3ff3af);}else{return[];}});}}else{return[];}})['then'](function(_0x1a12e1){return _0x1a12e1;});}function joinOrLeaveQueues(_0x40d229,_0xd19f62,_0x17ed21,_0x2d4771){_0x40d229[_0xd19f62](util[_0x1856('0x1a')]('%s:queue:%s',_0x17ed21,_0x2d4771[_0x1856('0x4')]));if(_0x2d4771[_0x1856('0x3')]){for(var _0x1dd95d=0x0;_0x1dd95d<_0x2d4771[_0x1856('0x3')][_0x1856('0x1b')];_0x1dd95d+=0x1){_0x40d229[_0xd19f62](util[_0x1856('0x1a')](_0x1856('0x1c'),_0x2d4771['Agents'][_0x1dd95d]['name']));}}}function joinOrLeave(_0x237d8b,_0x31df72,_0x31dc64){var _0x4b867e;if(_0x237d8b[_0x1856('0x1d')][_0x1856('0x1e')]['id']){db[_0x1856('0x17')][_0x1856('0x1f')]({'attributes':['id','name',_0x1856('0x20'),_0x1856('0x21')],'where':{'id':_0x237d8b[_0x1856('0x1d')][_0x1856('0x1e')]['id']},'include':[{'model':db['ChatInteraction'],'as':_0x1856('0x22'),'attributes':['id'],'raw':!![]},{'model':db[_0x1856('0x23')],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x1856('0x24')],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x1856('0x25')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x1856('0x26')],'as':_0x1856('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0x1856('0x28')],'as':_0x1856('0x29'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x2f3d8f){if(_0x2f3d8f){_0x4b867e=_0x2f3d8f;_0x237d8b[_0x31df72](util[_0x1856('0x1a')](_0x1856('0x1c'),_0x2f3d8f[_0x1856('0x4')]));var _0x3ef572=[];switch(_0x2f3d8f[_0x1856('0x20')]){case'admin':_0x237d8b[_0x31df72](_0x1856('0x2a'));_0x237d8b[_0x31df72](_0x1856('0x2b'));if(queryQueues[_0x1856('0x2c')]('include')){delete queryQueues[_0x1856('0x2d')];}_0x3ef572[_0x1856('0x2e')](db[_0x1856('0x2f')]['findAll'](queryQueues));_0x3ef572[_0x1856('0x2e')](db['ChatQueue'][_0x1856('0x10')](queryQueues));_0x3ef572[_0x1856('0x2e')](db[_0x1856('0x30')][_0x1856('0x10')](queryQueues));_0x3ef572[_0x1856('0x2e')](db[_0x1856('0x31')][_0x1856('0x10')](queryQueues));_0x3ef572['push'](db[_0x1856('0x32')][_0x1856('0x10')](queryQueues));_0x3ef572[_0x1856('0x2e')](db[_0x1856('0x33')][_0x1856('0x10')](queryQueues));_0x3ef572['push'](db[_0x1856('0x34')][_0x1856('0x10')](queryQueues));_0x3ef572[_0x1856('0x2e')](db['User'][_0x1856('0x10')](queryTelephones));_0x3ef572[_0x1856('0x2e')](db[_0x1856('0x35')][_0x1856('0x10')](queryTrunks));_0x3ef572[_0x1856('0x2e')](db['Campaign']['findAll'](queryCampaigns));_0x3ef572['push'](db[_0x1856('0x17')]['findAll'](queryAgents));break;case _0x1856('0x36'):_0x237d8b[_0x31df72](_0x1856('0x2a'));_0x237d8b[_0x31df72]('voice:outbound');_0x3ef572['push'](getAssociatedResources(_0x1856('0x37'),_0x2f3d8f[_0x1856('0x21')],_0x1856('0x2f')));_0x3ef572[_0x1856('0x2e')](getAssociatedResources('ChatQueues',_0x2f3d8f[_0x1856('0x21')],_0x1856('0x38')));_0x3ef572[_0x1856('0x2e')](getAssociatedResources(_0x1856('0xb'),_0x2f3d8f[_0x1856('0x21')],_0x1856('0x30')));_0x3ef572[_0x1856('0x2e')](getAssociatedResources('SmsQueues',_0x2f3d8f[_0x1856('0x21')],_0x1856('0x31')));_0x3ef572['push'](getAssociatedResources(_0x1856('0x39'),_0x2f3d8f[_0x1856('0x21')],'MailQueue'));_0x3ef572['push'](getAssociatedResources(_0x1856('0xd'),_0x2f3d8f[_0x1856('0x21')],_0x1856('0x33')));_0x3ef572[_0x1856('0x2e')](getAssociatedResources(_0x1856('0xe'),_0x2f3d8f[_0x1856('0x21')],'WhatsappQueue'));_0x3ef572[_0x1856('0x2e')](getAssociatedResources('Telephones',_0x2f3d8f[_0x1856('0x21')],_0x1856('0x17')));_0x3ef572['push'](getAssociatedResources(_0x1856('0x11'),_0x2f3d8f[_0x1856('0x21')],_0x1856('0x35')));_0x3ef572[_0x1856('0x2e')](getAssociatedResources(_0x1856('0x12'),_0x2f3d8f[_0x1856('0x21')],_0x1856('0x3a')));_0x3ef572['push'](db['User'][_0x1856('0x10')](queryAgents));break;case'agent':_0x237d8b[_0x31df72]('voice:inbound');_0x237d8b[_0x31df72](_0x1856('0x2b'));_0x3ef572[_0x1856('0x2e')](_0x2f3d8f['getVoiceQueues']({'attributes':['id',_0x1856('0x4')]}));_0x3ef572[_0x1856('0x2e')](_0x2f3d8f[_0x1856('0x3b')]({'attributes':['id',_0x1856('0x4')]}));_0x3ef572[_0x1856('0x2e')](_0x2f3d8f[_0x1856('0x3c')]({'attributes':['id',_0x1856('0x4')]}));_0x3ef572[_0x1856('0x2e')](_0x2f3d8f[_0x1856('0x3d')]({'attributes':['id',_0x1856('0x4')]}));_0x3ef572['push'](_0x2f3d8f[_0x1856('0x3e')]({'attributes':['id',_0x1856('0x4')]}));_0x3ef572[_0x1856('0x2e')](_0x2f3d8f[_0x1856('0x3f')]({'attributes':['id',_0x1856('0x4')]}));_0x3ef572['push'](_0x2f3d8f[_0x1856('0x40')]({'attributes':['id',_0x1856('0x4')]}));break;}return BPromise[_0x1856('0x41')](_0x3ef572);}})[_0x1856('0x15')](function(_0x426ea5){if(_0x426ea5&&_0x426ea5['length']){for(var _0x942900=0x0;_0x942900<_0x426ea5[_0x1856('0x1b')];_0x942900+=0x1){for(var _0x3426ed=0x0;_0x3426ed<_0x426ea5[_0x942900]['length'];_0x3426ed+=0x1){switch(_0x942900){case 0x0:joinOrLeaveQueues(_0x237d8b,_0x31df72,'voice',_0x426ea5[_0x942900][_0x3426ed]);break;case 0x1:joinOrLeaveQueues(_0x237d8b,_0x31df72,'chat',_0x426ea5[_0x942900][_0x3426ed]);break;case 0x2:joinOrLeaveQueues(_0x237d8b,_0x31df72,_0x1856('0x42'),_0x426ea5[_0x942900][_0x3426ed]);break;case 0x3:joinOrLeaveQueues(_0x237d8b,_0x31df72,_0x1856('0x43'),_0x426ea5[_0x942900][_0x3426ed]);break;case 0x4:joinOrLeaveQueues(_0x237d8b,_0x31df72,_0x1856('0x44'),_0x426ea5[_0x942900][_0x3426ed]);break;case 0x5:joinOrLeaveQueues(_0x237d8b,_0x31df72,_0x1856('0x45'),_0x426ea5[_0x942900][_0x3426ed]);break;case 0x6:joinOrLeaveQueues(_0x237d8b,_0x31df72,_0x1856('0x46'),_0x426ea5[_0x942900][_0x3426ed]);break;case 0x7:if(_0x4b867e['role']!==_0x1856('0x5'))_0x237d8b[_0x31df72](util[_0x1856('0x1a')](_0x1856('0x47'),_0x426ea5[_0x942900][_0x3426ed][_0x1856('0x4')]));break;case 0x8:if(_0x4b867e['role']!==_0x1856('0x5'))_0x237d8b[_0x31df72](util[_0x1856('0x1a')]('trunk:%s',_0x426ea5[_0x942900][_0x3426ed][_0x1856('0x4')]));break;case 0x9:if(_0x4b867e[_0x1856('0x20')]!==_0x1856('0x5'))_0x237d8b[_0x31df72](util[_0x1856('0x1a')](_0x1856('0x48'),_0x426ea5[_0x942900][_0x3426ed][_0x1856('0x6')],_0x426ea5[_0x942900][_0x3426ed][_0x1856('0x4')]));break;case 0xa:_0x237d8b[_0x31df72](util[_0x1856('0x1a')]('user:%s',_0x426ea5[_0x942900][_0x3426ed][_0x1856('0x4')]));break;}}}}})['then'](function(){if(_0x31df72==='leave'){var _0xc8def7=_['map'](_0x4b867e[_0x1856('0x22')],'id');return _0x4b867e[_0x1856('0x49')](_0xc8def7)[_0x1856('0x15')](function(){for(var _0x3256ae=0x0;_0x3256ae<_0xc8def7[_0x1856('0x1b')];_0x3256ae+=0x1){_0x31dc64[_0x1856('0x4a')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0xc8def7[_0x3256ae]),'UserId':Number(_0x4b867e['id'])});}});}})[_0x1856('0x15')](function(){if(_0x31df72===_0x1856('0x4b')){var _0x5b3704=_[_0x1856('0x16')](_0x4b867e[_0x1856('0x4c')],'id');return _0x4b867e[_0x1856('0x4d')](_0x5b3704)[_0x1856('0x15')](function(){for(var _0x5beae8=0x0;_0x5beae8<_0x5b3704[_0x1856('0x1b')];_0x5beae8+=0x1){_0x31dc64[_0x1856('0x4a')](_0x1856('0x4e'),{'MailInteractionId':Number(_0x5b3704[_0x5beae8]),'UserId':Number(_0x4b867e['id'])});}});}})[_0x1856('0x15')](function(){if(_0x31df72===_0x1856('0x4b')){var _0x40e2f5=_['map'](_0x4b867e['FaxInteractions'],'id');return _0x4b867e[_0x1856('0x4f')](_0x40e2f5)[_0x1856('0x15')](function(){for(var _0x544d0a=0x0;_0x544d0a<_0x40e2f5[_0x1856('0x1b')];_0x544d0a+=0x1){_0x31dc64[_0x1856('0x4a')](_0x1856('0x50'),{'FaxInteractionId':Number(_0x40e2f5[_0x544d0a]),'UserId':Number(_0x4b867e['id'])});}});}})[_0x1856('0x15')](function(){if(_0x31df72===_0x1856('0x4b')){var _0x593e60=_[_0x1856('0x16')](_0x4b867e[_0x1856('0x51')],'id');return _0x4b867e[_0x1856('0x52')](_0x593e60)[_0x1856('0x15')](function(){for(var _0xec318d=0x0;_0xec318d<_0x593e60[_0x1856('0x1b')];_0xec318d+=0x1){_0x31dc64[_0x1856('0x4a')](_0x1856('0x53'),{'SmsInteractionId':Number(_0x593e60[_0xec318d]),'UserId':Number(_0x4b867e['id'])});}});}})['then'](function(){if(_0x31df72===_0x1856('0x4b')){var _0x24499a=_['map'](_0x4b867e[_0x1856('0x27')],'id');return _0x4b867e['removeOpenchannelInteractions'](_0x24499a)['then'](function(){for(var _0x2301ae=0x0;_0x2301ae<_0x24499a['length'];_0x2301ae+=0x1){_0x31dc64['emit']('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x24499a[_0x2301ae]),'UserId':Number(_0x4b867e['id'])});}});}})[_0x1856('0x15')](function(){if(_0x31df72===_0x1856('0x4b')){var _0x98740a=_[_0x1856('0x16')](_0x4b867e[_0x1856('0x29')],'id');return _0x4b867e[_0x1856('0x54')](_0x98740a)[_0x1856('0x15')](function(){for(var _0x53eee2=0x0;_0x53eee2<_0x98740a[_0x1856('0x1b')];_0x53eee2+=0x1){_0x31dc64[_0x1856('0x4a')](_0x1856('0x55'),{'WhatsappInteractionId':Number(_0x98740a[_0x53eee2]),'UserId':Number(_0x4b867e['id'])});}});}})[_0x1856('0x56')](function(_0x1fe02c){_0x237d8b[_0x1856('0x57')](_0x1fe02c);});}}function onDisconnect(_0x1b9d76,_0x5e553c){joinOrLeave(_0x1b9d76,_0x1856('0x4b'),_0x5e553c);}function onConnect(_0x4b421e){joinOrLeave(_0x4b421e,_0x1856('0x58'));}exports[_0x1856('0x59')]=function(_0x199401){_0x199401['on']('connection',function(_0x54376d){_0x54376d[_0x1856('0x5a')](0x0);_0x54376d['address']=_0x54376d['request'][_0x1856('0x5b')][_0x1856('0x5c')]+':'+_0x54376d[_0x1856('0x5d')][_0x1856('0x5b')][_0x1856('0x5e')];_0x54376d[_0x1856('0x5f')]=new Date();_0x54376d['log']=function(_0x18d5b3){console[_0x1856('0x57')]('SocketIO\x20'+_0x54376d[_0x1856('0x60')]['name']+'['+_0x54376d['address']+']',_0x18d5b3);};_0x54376d['on'](_0x1856('0x61'),function(){onDisconnect(_0x54376d,_0x199401);_0x54376d[_0x1856('0x57')](_0x1856('0x62'));});onConnect(_0x54376d);_0x54376d[_0x1856('0x57')](_0x1856('0x63'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index a154e26..0b12add 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 _0xef38=['interface','SIP/%s','format','default','hasOwnProperty','model','hook','callback','toLowerCase','condition','../../mysqldb','jayson/promise','../logger','client','http','Chat','ChatInteraction','afterCreate','closedinteraction','ChatMessage','newmessage','Sms','SmsInteraction','newinteraction','afterUpdate','SmsMessage','Whatsapp','WhatsappInteraction','WhatsappMessage','FaxInteraction','Fax','FaxMessage','MailInteraction','Mail','substatus','MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','EventManager','then','info','Trigger,\x20%s','error','code','catch','motionChannel','direction','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','SELECT','contact','User','find','UserId','fullname','internal','name','agent','get','channel','event','opened','ContactId','query','Sequelize','QueryTypes','changed','closed','email'];(function(_0x18411d,_0x3251ae){var _0x2b939b=function(_0x267582){while(--_0x267582){_0x18411d['push'](_0x18411d['shift']());}};_0x2b939b(++_0x3251ae);}(_0xef38,0x122));var _0x8ef3=function(_0xe8b124,_0x17218c){_0xe8b124=_0xe8b124-0x0;var _0x46a9b7=_0xef38[_0xe8b124];return _0x46a9b7;};'use strict';var util=require('util');var db=require(_0x8ef3('0x0'))['db'];var jayson=require(_0x8ef3('0x1'));var logger=require(_0x8ef3('0x2'))('triggers');var _=require('lodash');var client=jayson[_0x8ef3('0x3')][_0x8ef3('0x4')]({'port':0x232a});var triggers=[{'channel':_0x8ef3('0x5'),'model':_0x8ef3('0x6'),'event':_0x8ef3('0x7'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x8ef3('0x5'),'model':_0x8ef3('0x6'),'event':'afterUpdate','condition':_0x8ef3('0x8'),'callback':afterUpdate},{'channel':_0x8ef3('0x5'),'model':_0x8ef3('0x9'),'event':_0x8ef3('0x7'),'condition':_0x8ef3('0xa'),'callback':afterCreateMessage},{'channel':_0x8ef3('0xb'),'model':_0x8ef3('0xc'),'event':'afterCreate','condition':_0x8ef3('0xd'),'callback':afterCreate},{'channel':_0x8ef3('0xb'),'model':_0x8ef3('0xc'),'event':_0x8ef3('0xe'),'condition':_0x8ef3('0x8'),'callback':afterUpdate},{'channel':_0x8ef3('0xb'),'model':_0x8ef3('0xf'),'event':_0x8ef3('0x7'),'condition':_0x8ef3('0xa'),'callback':afterCreateMessage},{'channel':_0x8ef3('0x10'),'model':_0x8ef3('0x11'),'event':_0x8ef3('0x7'),'condition':_0x8ef3('0xd'),'callback':afterCreate},{'channel':_0x8ef3('0x10'),'model':_0x8ef3('0x11'),'event':_0x8ef3('0xe'),'condition':_0x8ef3('0x8'),'callback':afterUpdate},{'channel':_0x8ef3('0x10'),'model':_0x8ef3('0x12'),'event':'afterCreate','condition':_0x8ef3('0xa'),'callback':afterCreateMessage},{'channel':'Fax','model':_0x8ef3('0x13'),'event':'afterCreate','condition':_0x8ef3('0xd'),'callback':afterCreate},{'channel':_0x8ef3('0x14'),'model':'FaxInteraction','event':'afterUpdate','condition':_0x8ef3('0x8'),'callback':afterUpdate},{'channel':_0x8ef3('0x14'),'model':_0x8ef3('0x15'),'event':_0x8ef3('0x7'),'condition':'newmessage','callback':afterCreateMessage},{'channel':'Mail','model':_0x8ef3('0x16'),'event':_0x8ef3('0x7'),'condition':_0x8ef3('0xd'),'callback':afterCreate},{'channel':_0x8ef3('0x17'),'model':'MailInteraction','event':_0x8ef3('0xe'),'condition':_0x8ef3('0x8'),'callback':afterUpdate},{'channel':_0x8ef3('0x17'),'model':'MailInteraction','event':'substatus','condition':_0x8ef3('0x18'),'callback':afterUpdate},{'channel':_0x8ef3('0x17'),'model':_0x8ef3('0x19'),'event':_0x8ef3('0x7'),'condition':_0x8ef3('0xa'),'callback':afterCreateMessage},{'channel':_0x8ef3('0x1a'),'model':_0x8ef3('0x1b'),'event':'afterCreate','condition':_0x8ef3('0xd'),'callback':afterCreate},{'channel':_0x8ef3('0x1a'),'model':'OpenchannelInteraction','event':_0x8ef3('0xe'),'condition':_0x8ef3('0x8'),'callback':afterUpdate},{'channel':_0x8ef3('0x1a'),'model':_0x8ef3('0x1c'),'event':_0x8ef3('0x7'),'condition':'newmessage','callback':afterCreateMessage}];function request(_0x18ef45){return client[_0x8ef3('0x1d')](_0x8ef3('0x1e'),_0x18ef45)[_0x8ef3('0x1f')](function(_0x59b673){logger[_0x8ef3('0x20')](_0x8ef3('0x21'),_0x8ef3('0x1e'),_0x59b673);if(_0x59b673[_0x8ef3('0x22')]){if(_0x59b673[_0x8ef3('0x22')][_0x8ef3('0x23')]===0x1f4){logger[_0x8ef3('0x22')](_0x8ef3('0x21'),_0x8ef3('0x1e'),_0x59b673[_0x8ef3('0x22')]);}}})[_0x8ef3('0x24')](function(_0x594a25){logger[_0x8ef3('0x22')](_0x8ef3('0x21'),_0x8ef3('0x1e'),_0x594a25);});}function afterCreateMessage(_0x2b33af,_0x3b9d3a){return function(_0x451027,_0x2c9780){_0x451027=_0x451027['get']({'plain':!![]});_0x451027['channel']=_0x2b33af;_0x451027[_0x8ef3('0x25')]=_0x2b33af;_0x451027['event']=_0x451027[_0x8ef3('0x26')];var _0x182394=_0x8ef3('0x27')+_0x451027['ContactId'];return db['sequelize']['query'](_0x182394,{'type':db['Sequelize']['QueryTypes'][_0x8ef3('0x28')],'raw':!![]})[_0x8ef3('0x1f')](function(_0x4003df){return _0x4003df;})['then'](function(_0x3b5dfa){if(_0x3b5dfa){_0x451027[_0x8ef3('0x29')]=_0x3b5dfa[0x0];}if(_0x451027['UserId']){return db[_0x8ef3('0x2a')][_0x8ef3('0x2b')]({'where':{'id':_0x451027[_0x8ef3('0x2c')]},'attributes':['id','name',_0x8ef3('0x2d'),'email',_0x8ef3('0x2e')],'raw':!![]})['then'](function(_0x4acca1){_0x451027['interface']=util['format']('SIP/%s',_0x4acca1[_0x8ef3('0x2f')]);_0x451027['channel']=_0x2b33af;_0x451027[_0x8ef3('0x30')]=_0x4acca1;return request({'event':'incomingmessage','message':_0x451027});})[_0x8ef3('0x24')](function(_0x1ba514){console[_0x8ef3('0x22')](_0x1ba514);});}else{return request({'event':'outgoingmessage','message':_0x451027});}});};}function afterCreate(_0x5b4b52,_0x45a7ed){return function(_0x1bf3b0,_0x2436d5){_0x1bf3b0=_0x1bf3b0[_0x8ef3('0x31')]({'plain':!![]});_0x1bf3b0[_0x8ef3('0x32')]=_0x5b4b52;_0x1bf3b0['motionChannel']=_0x5b4b52;_0x1bf3b0[_0x8ef3('0x33')]=_0x8ef3('0x34');var _0x192f4a='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1bf3b0[_0x8ef3('0x35')];return db['sequelize'][_0x8ef3('0x36')](_0x192f4a,{'type':db[_0x8ef3('0x37')][_0x8ef3('0x38')][_0x8ef3('0x28')],'raw':!![]})['then'](function(_0x3e7140){return _0x3e7140;})[_0x8ef3('0x1f')](function(_0x4cc24b){if(_0x4cc24b){_0x1bf3b0[_0x8ef3('0x29')]=_0x4cc24b[0x0];}return request({'event':_0x45a7ed,'message':_0x1bf3b0});});};}function afterUpdate(_0x2be97b,_0xd554da){return function(_0x11596c,_0x19b4f5){if(_0x11596c[_0x8ef3('0x39')](_0x8ef3('0x3a'))&&_0x11596c[_0x8ef3('0x3a')]){_0x11596c=_0x11596c['get']({'plain':!![]});_0x11596c[_0x8ef3('0x32')]=_0x2be97b;_0x11596c[_0x8ef3('0x25')]=_0x2be97b;_0x11596c[_0x8ef3('0x33')]=_0x8ef3('0x3a');var _0x384ccd='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x11596c[_0x8ef3('0x35')];return db['sequelize'][_0x8ef3('0x36')](_0x384ccd,{'type':db[_0x8ef3('0x37')][_0x8ef3('0x38')][_0x8ef3('0x28')],'raw':!![]})['then'](function(_0x5c4cca){return _0x5c4cca;})[_0x8ef3('0x1f')](function(_0x5ba7a5){if(_0x5ba7a5){_0x11596c[_0x8ef3('0x29')]=_0x5ba7a5[0x0];}if(_0x11596c[_0x8ef3('0x2c')]){return db[_0x8ef3('0x2a')][_0x8ef3('0x2b')]({'where':{'id':_0x11596c['UserId']},'attributes':['id',_0x8ef3('0x2f'),_0x8ef3('0x2d'),_0x8ef3('0x3b'),_0x8ef3('0x2e')],'raw':!![]})[_0x8ef3('0x1f')](function(_0x4a3d37){_0x11596c[_0x8ef3('0x3c')]=util['format'](_0x8ef3('0x3d'),_0x4a3d37[_0x8ef3('0x2f')]);_0x11596c[_0x8ef3('0x30')]=_0x4a3d37;return request({'event':_0xd554da,'message':_0x11596c});})['catch'](function(_0x248ee5){console[_0x8ef3('0x22')](_0x248ee5);});}else{return request({'event':_0xd554da,'message':_0x11596c});}});}else if(_0x11596c[_0x8ef3('0x39')]('substatus')){_0x11596c=_0x11596c[_0x8ef3('0x31')]({'plain':!![]});_0x11596c[_0x8ef3('0x32')]=_0x2be97b;_0x11596c[_0x8ef3('0x33')]='substatus';var _0x384ccd=_0x8ef3('0x27')+_0x11596c['ContactId'];return db['sequelize'][_0x8ef3('0x36')](_0x384ccd,{'type':db[_0x8ef3('0x37')][_0x8ef3('0x38')][_0x8ef3('0x28')],'raw':!![]})['then'](function(_0x1db420){return _0x1db420;})[_0x8ef3('0x1f')](function(_0x309ea1){if(_0x309ea1){_0x11596c['contact']=_0x309ea1[0x0];}if(_0x11596c[_0x8ef3('0x2c')]){return db[_0x8ef3('0x2a')][_0x8ef3('0x2b')]({'where':{'id':_0x11596c[_0x8ef3('0x2c')]},'attributes':['id',_0x8ef3('0x2f'),_0x8ef3('0x2d'),_0x8ef3('0x3b'),_0x8ef3('0x2e')],'raw':!![]})[_0x8ef3('0x1f')](function(_0x3be8e0){_0x11596c[_0x8ef3('0x3c')]=util[_0x8ef3('0x3e')]('SIP/%s',_0x3be8e0[_0x8ef3('0x2f')]);_0x11596c[_0x8ef3('0x30')]=_0x3be8e0;return request({'event':_0xd554da,'message':_0x11596c});})[_0x8ef3('0x24')](function(_0x27026a){console['error'](_0x27026a);});}else{return request({'event':_0xd554da,'message':_0x11596c});}});}};}exports[_0x8ef3('0x3f')]=function(){for(var _0x56eb6f=0x0;_0x56eb6f=_0x2115ef['agents']){throw Error(_0xcea9('0x12'));}_0xf4132b(_0x14df9f);})['catch'](function(_0x5d208a){_0x15f144(_0x5d208a);});});}; \ No newline at end of file +var _0x9613=['updateAttributes','getLicense','agent','User','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','bluebird','../mysqldb','./license/util','mail','chat','fax','sms','whatsapp','isValidChannel','toLowerCase','clearBlockUser','isUndefined'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0x9613,0x16d));var _0x3961=function(_0x280d83,_0x44b1f9){_0x280d83=_0x280d83-0x0;var _0x10d72f=_0x9613[_0x280d83];return _0x10d72f;};'use strict';var _=require(_0x3961('0x0'));var BPromise=require(_0x3961('0x1'));var db=require(_0x3961('0x2'))['db'];var util=require(_0x3961('0x3'));var channels=['voice',_0x3961('0x4'),_0x3961('0x5'),_0x3961('0x6'),_0x3961('0x7'),_0x3961('0x8'),'openchannel'];exports['getChannels']=function(){return channels;};exports[_0x3961('0x9')]=function(_0x44bc97){_0x44bc97=_0x44bc97[_0x3961('0xa')]();return _['includes'](channels,_0x44bc97);};exports[_0x3961('0xb')]=function(_0x985fb6,_0x200f76,_0x2d01d7,_0x1a2815){var _0x3158a8={'loginAttempts':_0x200f76,'blocked':_0x2d01d7};if(!_[_0x3961('0xc')](_0x1a2815)){_0x3158a8['blockedAt']=_0x1a2815;}return _0x985fb6[_0x3961('0xd')](_0x3158a8);};exports[_0x3961('0xe')]=function(_0x2aa6ce){return new BPromise(function(_0x151de5,_0x5a9d0a){var _0x4bc549=0x0;if(_0x2aa6ce['role']!==_0x3961('0xf')){_0x151de5(_0x2aa6ce);}db[_0x3961('0x10')]['count']({'where':{'role':_0x3961('0xf'),'online':!![],'id':{'$ne':_0x2aa6ce['id']}}})[_0x3961('0x11')](function(_0x4e82dc){_0x4bc549=_0x4e82dc;return util[_0x3961('0xe')]();})[_0x3961('0x11')](function(_0x2e8bd5){if(_0x2e8bd5&&_0x2e8bd5[_0x3961('0x12')]&&_0x4bc549>=_0x2e8bd5['agents']){throw Error(_0x3961('0x13'));}_0x151de5(_0x2aa6ce);})[_0x3961('0x14')](function(_0x17f144){_0x5a9d0a(_0x17f144);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 6116742..3f1f414 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8dd1=['404','status','render','json','send','exports'];(function(_0x321781,_0x585793){var _0x1eacdc=function(_0x4f1695){while(--_0x4f1695){_0x321781['push'](_0x321781['shift']());}};_0x1eacdc(++_0x585793);}(_0x8dd1,0x1e5));var _0x18dd=function(_0x5e6e0d,_0x16ab7e){_0x5e6e0d=_0x5e6e0d-0x0;var _0x129048=_0x8dd1[_0x5e6e0d];return _0x129048;};'use strict';module[_0x18dd('0x0')][0x194]=function pageNotFound(_0x408f09,_0x555ded){var _0x55a4a2=_0x18dd('0x1');var _0x577b40=0x194;var _0x24af6c={'status':_0x577b40};_0x555ded[_0x18dd('0x2')](_0x24af6c[_0x18dd('0x2')]);_0x555ded[_0x18dd('0x3')](_0x55a4a2,{},function(_0x4c99bf,_0x1093fe){if(_0x4c99bf){return _0x555ded[_0x18dd('0x2')](_0x24af6c[_0x18dd('0x2')])[_0x18dd('0x4')](_0x24af6c);}_0x555ded[_0x18dd('0x5')](_0x1093fe);});}; \ No newline at end of file +var _0x31ae=['404','status','render','exports'];(function(_0x6f7b7e,_0x211345){var _0x5da0a0=function(_0x2999ce){while(--_0x2999ce){_0x6f7b7e['push'](_0x6f7b7e['shift']());}};_0x5da0a0(++_0x211345);}(_0x31ae,0x6b));var _0xe31a=function(_0x1ac77b,_0x10ee7a){_0x1ac77b=_0x1ac77b-0x0;var _0x161584=_0x31ae[_0x1ac77b];return _0x161584;};'use strict';module[_0xe31a('0x0')][0x194]=function pageNotFound(_0x487eff,_0x30c7b5){var _0x3e1121=_0xe31a('0x1');var _0x860bcc=0x194;var _0x1c90d1={'status':_0x860bcc};_0x30c7b5[_0xe31a('0x2')](_0x1c90d1[_0xe31a('0x2')]);_0x30c7b5[_0xe31a('0x3')](_0x3e1121,{},function(_0x5a6be4,_0x540795){if(_0x5a6be4){return _0x30c7b5['status'](_0x1c90d1[_0xe31a('0x2')])['json'](_0x1c90d1);}_0x30c7b5['send'](_0x540795);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index c7c080c..15830aa 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2bc2=['UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','TeamVoicePrefix','UserVoicePrefix','cascade','UserId','User','hasMany','Recordings','VoiceQueuesRt','Extensions','HopperFinals','CmHopperHistory','HopperHistory','OpenchannelInteraction','OpenchannelInteractions','ChatInteractions','SmsInteraction','FaxInteractions','MailInteractions','UserNotifications','belongsTo','userProfileId','Groups','chat_group_has_users','belongsToMany','Contacts','CmList','Lists','cm_user_has_lists','user_has_mail_interactions','user_has_fax_interactions','SmsInteractions','user_has_sms_interactions','user_has_openchannel_interactions','WhatsappInteractions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefix','VoicePrefixes','MailQueues','UserMailQueue','FaxQueues','SmsQueues','OpenchannelQueues','UserOpenchannelQueue','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','SquareProjects','user_has_square_projects','SpiedAgents','ChanSpyId','Applications','Sounds','Members','Hoppers','VoiceQueueId','HopperHistories','HopperBlacks','JscriptySessions','TrunkId','TrunkBackup','TrunkBackupId','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','BlackLists','Messages','mailboxuser','mailbox','VoiceCallReport','QueueCalls','uniqueid','VoiceAgentReport','Contact','ContactId','MailServerIn','hasOne','Smtp','Dispositions','MailAccountId','Answers','Interactions','List','ListId','Pause','team_has_mail_queues','Account','Owner','Tag','mail_interaction_has_tags','Users','MailInteractionId','Attachments','Interaction','ChatWebsiteId','ChatOfflineMessageId','restrict','TagId','MailQueueReport','Items','FaxAccountId','FaxMessage','fax_interaction_has_tags','Tags','ThroughTags','FaxInteractionId','AttachmentId','FaxQueue','team_has_fax_queues','Teams','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelMessage','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','IntervalId','OpenchannelQueueReport','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','team_has_chat_queues','ChatGroupId','Company','CompanyId','cm_user_has_contacts','cm_contact_has_tags','OwnerId','Condition','All','OneAll','AutomationAllId','Any','OneAny','AutomationAnyId','Actions','AutomationId','MailApplications','ChatApplications','FaxApplications','SmsApplications','Schedule','DefaultReportId','Sound','Mohs','moh_has_sounds','whatsapp_interaction_has_tags','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','AnalyticFieldReport','CustomReportId','Fields','MetricId','Configurations','Subjects','SubjectId','SalesforceField','Descriptions','AccountId','Description','DescriptionId','Field','FieldId','VariableId','SugarcrmAccount','SugarcrmConfiguration','DeskConfiguration','int_desk_configuration_has_tags','Subject','ZohoField','ZendeskField','int_zendesk_configuration_has_tags','FreshdeskAccount','FreshdeskField','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','ServicenowAccount','Dynamics365Account','FreshsalesField','ToId','SessionId','SmsQueueReport','ProjectId','ChatQueues','team_has_whatsapp_queues','WhatsappQueues','CampaignId','SquareProjectId','campaigns_has_cm_blacklists','FromMailAccountId','FromUserId','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','FromAccount','ToChatQueueId','ToChatWebsiteId','ToAccount','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','ToSmsQueueId','ToSmsAccountId','CmCustomField','CustomFields','Queues','Resources','sectionId','WhatsappAccountId','user_has_whatsapp_accounts','WhatsappInteractionId','FromWhatsappAccountId','ToQueueId','../config/environment','lodash','jstz','sequelize','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','defaultsDeep','motion2','database','username','options','password','import','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','VoiceRecording','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','UserVoiceQueueRt','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','../api/faxMessage/faxMessage.model','../api/faxQueue/faxQueue.model','FaxQueueReport','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelInteraction/openchannelInteraction.model','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','ChatMessage','ChatOfflineMessage','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','CmCompany','../api/cmCompany/cmCompany.model','CmContact','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','Action','../api/action/action.model','Automation','CannedAnswer','Disposition','../api/condition/condition.model','Interval','../api/interval/interval.model','../api/pause/pause.model','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','../api/schedule/schedule.model','../api/tag/tag.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','../api/intSalesforceField/intSalesforceField.model','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intFreshdeskAccount/intFreshdeskAccount.model','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','FreshsalesAccount','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','../api/intFreshsalesField/intFreshsalesField.model','../api/integration/integration.model','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','../api/squareMessage/squareMessage.model','Team','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','../api/cmList/cmList.model','../api/voicePrefix/voicePrefix.model'];(function(_0x34fdc0,_0x4a2296){var _0x1295d3=function(_0x3e17b0){while(--_0x3e17b0){_0x34fdc0['push'](_0x34fdc0['shift']());}};_0x1295d3(++_0x4a2296);}(_0x2bc2,0x108));var _0x22bc=function(_0x2ceb47,_0x5c6f60){_0x2ceb47=_0x2ceb47-0x0;var _0x4a77b0=_0x2bc2[_0x2ceb47];return _0x4a77b0;};'use strict';var config=require(_0x22bc('0x0'));var Sequelize=require('sequelize');var _=require(_0x22bc('0x1'));var jstz=require(_0x22bc('0x2'));var timezone=jstz['determine']();config[_0x22bc('0x3')]=_['defaultsDeep'](config[_0x22bc('0x3')],{'database':'motion2','username':'xcall','password':_0x22bc('0x4'),'options':{'host':_0x22bc('0x5'),'port':0xcea,'dialect':_0x22bc('0x6'),'dialectOptions':{'charset':_0x22bc('0x7')},'logging':![],'timezone':timezone[_0x22bc('0x8')](),'define':{'charset':_0x22bc('0x9'),'collate':_0x22bc('0xa')}}});config[_0x22bc('0xb')]=_[_0x22bc('0xc')](config[_0x22bc('0xb')],{'database':_0x22bc('0xd'),'username':'xcall','password':_0x22bc('0x4'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x22bc('0x7')},'logging':![],'timezone':timezone[_0x22bc('0x8')](),'define':{'charset':_0x22bc('0x9'),'collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize'][_0x22bc('0xe')],config[_0x22bc('0x3')][_0x22bc('0xf')],config[_0x22bc('0x3')]['password'],config['sequelize'][_0x22bc('0x10')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x22bc('0xb')][_0x22bc('0xe')],config[_0x22bc('0xb')][_0x22bc('0xf')],config[_0x22bc('0xb')][_0x22bc('0x11')],config['sequelizeHistory']['options'])};db['User']=db[_0x22bc('0x3')][_0x22bc('0x12')]('../api/user/user.model');db[_0x22bc('0x13')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x14'));db[_0x22bc('0x15')]=db[_0x22bc('0x3')]['import'](_0x22bc('0x16'));db[_0x22bc('0x17')]=db[_0x22bc('0x3')][_0x22bc('0x12')]('../api/voiceExtension/voiceExtension.model');db[_0x22bc('0x18')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x19'));db[_0x22bc('0x1a')]=db['sequelize'][_0x22bc('0x12')]('../api/voiceQueue/voiceQueue.model');db[_0x22bc('0x1b')]=db[_0x22bc('0x3')][_0x22bc('0x12')]('../api/voiceRecording/voiceRecording.model');db[_0x22bc('0x1c')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x1d'));db[_0x22bc('0x1e')]=db['sequelize']['import']('../api/voiceMail/voiceMail.model');db[_0x22bc('0x1f')]=db[_0x22bc('0x3')]['import'](_0x22bc('0x20'));db['VoiceCallReport']=db[_0x22bc('0x3')][_0x22bc('0x12')]('../api/voiceCallReport/voiceCallReport.model');db['VoiceDialReport']=db['sequelize']['import'](_0x22bc('0x21'));db['VoiceAgentReport']=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x22'));db[_0x22bc('0x23')]=db[_0x22bc('0x3')]['import'](_0x22bc('0x24'));db[_0x22bc('0x25')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x26'));db[_0x22bc('0x27')]=db['sequelize'][_0x22bc('0x12')](_0x22bc('0x28'));db[_0x22bc('0x29')]=db[_0x22bc('0x3')]['import']('../api/voiceTransferReport/voiceTransferReport.model');db[_0x22bc('0x2a')]=db['sequelize'][_0x22bc('0x12')]('../api/userVoiceQueueRt/userVoiceQueueRt.model');db[_0x22bc('0x2b')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x2c'));db[_0x22bc('0x2d')]=db['sequelize'][_0x22bc('0x12')]('../api/userChatQueue/userChatQueue.model');db['UserMailQueue']=db[_0x22bc('0x3')][_0x22bc('0x12')]('../api/userMailQueue/userMailQueue.model');db[_0x22bc('0x2e')]=db['sequelize']['import'](_0x22bc('0x2f'));db[_0x22bc('0x30')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x31'));db['UserOpenchannelQueue']=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x32'));db[_0x22bc('0x33')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x34'));db['MailServerIn']=db['sequelize'][_0x22bc('0x12')](_0x22bc('0x35'));db[_0x22bc('0x36')]=db['sequelize'][_0x22bc('0x12')](_0x22bc('0x37'));db[_0x22bc('0x38')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x39'));db[_0x22bc('0x3a')]=db[_0x22bc('0x3')]['import'](_0x22bc('0x3b'));db[_0x22bc('0x3c')]=db['sequelize']['import'](_0x22bc('0x3d'));db[_0x22bc('0x3e')]=db['sequelize'][_0x22bc('0x12')](_0x22bc('0x3f'));db[_0x22bc('0x40')]=db['sequelize'][_0x22bc('0x12')](_0x22bc('0x41'));db[_0x22bc('0x42')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x43'));db['MailQueueReport']=db['sequelize'][_0x22bc('0x12')](_0x22bc('0x44'));db[_0x22bc('0x45')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x46'));db[_0x22bc('0x47')]=db[_0x22bc('0x3')]['import'](_0x22bc('0x48'));db[_0x22bc('0x49')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x4a'));db[_0x22bc('0x4b')]=db[_0x22bc('0x3')]['import'](_0x22bc('0x4c'));db[_0x22bc('0x4d')]=db[_0x22bc('0x3')]['import'](_0x22bc('0x4e'));db['FaxMessage']=db['sequelize'][_0x22bc('0x12')](_0x22bc('0x4f'));db['FaxQueue']=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x50'));db[_0x22bc('0x51')]=db['sequelize'][_0x22bc('0x12')]('../api/faxQueueReport/faxQueueReport.model');db[_0x22bc('0x52')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x53'));db[_0x22bc('0x54')]=db['sequelize'][_0x22bc('0x12')](_0x22bc('0x55'));db['SmsInteraction']=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x56'));db[_0x22bc('0x57')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x58'));db[_0x22bc('0x59')]=db['sequelize']['import'](_0x22bc('0x5a'));db[_0x22bc('0x5b')]=db['sequelize']['import'](_0x22bc('0x5c'));db[_0x22bc('0x5d')]=db['sequelize'][_0x22bc('0x12')]('../api/openchannelApplication/openchannelApplication.model');db['OpenchannelInteraction']=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x5e'));db['OpenchannelMessage']=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x5f'));db[_0x22bc('0x60')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x61'));db[_0x22bc('0x62')]=db[_0x22bc('0x3')][_0x22bc('0x12')]('../api/chatWebsite/chatWebsite.model');db['OpenchannelQueueReport']=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x63'));db[_0x22bc('0x64')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x65'));db[_0x22bc('0x66')]=db[_0x22bc('0x3')][_0x22bc('0x12')]('../api/chatInteraction/chatInteraction.model');db[_0x22bc('0x67')]=db['sequelize'][_0x22bc('0x12')]('../api/chatMessage/chatMessage.model');db[_0x22bc('0x68')]=db['sequelize']['import']('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0x22bc('0x69')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x6a'));db[_0x22bc('0x6b')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x6c'));db[_0x22bc('0x6d')]=db[_0x22bc('0x3')][_0x22bc('0x12')]('../api/chatProactiveAction/chatProactiveAction.model');db[_0x22bc('0x6e')]=db['sequelize'][_0x22bc('0x12')](_0x22bc('0x6f'));db[_0x22bc('0x70')]=db[_0x22bc('0x3')][_0x22bc('0x12')]('../api/cmContact/cmContact.model');db[_0x22bc('0x71')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x72'));db[_0x22bc('0x73')]=db['sequelize'][_0x22bc('0x12')]('../api/cmHopperBlack/cmHopperBlack.model');db[_0x22bc('0x74')]=db['sequelize']['import'](_0x22bc('0x75'));db['CmHopperHistory']=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x76'));db[_0x22bc('0x77')]=db['sequelize'][_0x22bc('0x12')](_0x22bc('0x78'));db['CmCustomField']=db['sequelize'][_0x22bc('0x12')]('../api/cmCustomField/cmCustomField.model');db[_0x22bc('0x79')]=db['sequelize'][_0x22bc('0x12')](_0x22bc('0x7a'));db[_0x22bc('0x7b')]=db['sequelize'][_0x22bc('0x12')]('../api/automation/automation.model');db[_0x22bc('0x7c')]=db['sequelize']['import']('../api/cannedAnswer/cannedAnswer.model');db[_0x22bc('0x7d')]=db[_0x22bc('0x3')][_0x22bc('0x12')]('../api/disposition/disposition.model');db['Condition']=db[_0x22bc('0x3')]['import'](_0x22bc('0x7e'));db[_0x22bc('0x7f')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x80'));db['Pause']=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x81'));db['Cdr']=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x82'));db[_0x22bc('0x83')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x84'));db['Schedule']=db['sequelize'][_0x22bc('0x12')](_0x22bc('0x85'));db['Sound']=db[_0x22bc('0x3')][_0x22bc('0x12')]('../api/sound/sound.model');db['Tag']=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x86'));db[_0x22bc('0x87')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x88'));db[_0x22bc('0x89')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x8a'));db[_0x22bc('0x8b')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x8c'));db[_0x22bc('0x8d')]=db[_0x22bc('0x3')][_0x22bc('0x12')]('../api/integration/integration.model');db[_0x22bc('0x8e')]=db[_0x22bc('0x3')]['import'](_0x22bc('0x8f'));db[_0x22bc('0x90')]=db[_0x22bc('0x3')]['import'](_0x22bc('0x91'));db[_0x22bc('0x92')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x93'));db[_0x22bc('0x94')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x95'));db[_0x22bc('0x96')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x97'));db['AnalyticFieldReport']=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x98'));db[_0x22bc('0x99')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x9a'));db[_0x22bc('0x9b')]=db[_0x22bc('0x3')][_0x22bc('0x12')]('../api/intSalesforceAccount/intSalesforceAccount.model');db[_0x22bc('0x9c')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x9d'));db['SalesforceField']=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x9e'));db['SugarcrmAccount']=db[_0x22bc('0x3')]['import']('../api/intSugarcrmAccount/intSugarcrmAccount.model');db['SugarcrmConfiguration']=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x9f'));db[_0x22bc('0xa0')]=db[_0x22bc('0x3')]['import'](_0x22bc('0xa1'));db[_0x22bc('0xa2')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0xa3'));db['DeskConfiguration']=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0xa4'));db[_0x22bc('0xa5')]=db['sequelize'][_0x22bc('0x12')]('../api/intDeskField/intDeskField.model');db[_0x22bc('0xa6')]=db['sequelize'][_0x22bc('0x12')](_0x22bc('0xa7'));db[_0x22bc('0xa8')]=db['sequelize'][_0x22bc('0x12')](_0x22bc('0xa9'));db['ZohoField']=db['sequelize'][_0x22bc('0x12')](_0x22bc('0xaa'));db[_0x22bc('0xab')]=db['sequelize']['import'](_0x22bc('0xac'));db[_0x22bc('0xad')]=db[_0x22bc('0x3')][_0x22bc('0x12')]('../api/intZendeskConfiguration/intZendeskConfiguration.model');db['ZendeskField']=db[_0x22bc('0x3')][_0x22bc('0x12')]('../api/intZendeskField/intZendeskField.model');db['FreshdeskAccount']=db['sequelize'][_0x22bc('0x12')](_0x22bc('0xae'));db['FreshdeskConfiguration']=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0xaf'));db['FreshdeskField']=db['sequelize'][_0x22bc('0x12')]('../api/intFreshdeskField/intFreshdeskField.model');db[_0x22bc('0xb0')]=db[_0x22bc('0x3')]['import'](_0x22bc('0xb1'));db[_0x22bc('0xb2')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0xb3'));db[_0x22bc('0xb4')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0xb5'));db['ServicenowAccount']=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0xb6'));db[_0x22bc('0xb7')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0xb8'));db[_0x22bc('0xb9')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0xba'));db['Dynamics365Account']=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0xbb'));db[_0x22bc('0xbc')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0xbd'));db[_0x22bc('0xbe')]=db['sequelize']['import']('../api/intDynamics365Field/intDynamics365Field.model');db[_0x22bc('0xbf')]=db['sequelize'][_0x22bc('0x12')]('../api/intFreshsalesAccount/intFreshsalesAccount.model');db[_0x22bc('0xc0')]=db['sequelize']['import'](_0x22bc('0xc1'));db['FreshsalesField']=db[_0x22bc('0x3')]['import'](_0x22bc('0xc2'));db['Integration']=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0xc3'));db[_0x22bc('0xc4')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0xc5'));db[_0x22bc('0xc6')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0xc7'));db[_0x22bc('0xc8')]=db['sequelize'][_0x22bc('0x12')](_0x22bc('0xc9'));db[_0x22bc('0xca')]=db['sequelize'][_0x22bc('0x12')](_0x22bc('0xcb'));db[_0x22bc('0xcc')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0xcd'));db[_0x22bc('0xce')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0xcf'));db['SmsQueueReport']=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0xd0'));db[_0x22bc('0xd1')]=db[_0x22bc('0x3')][_0x22bc('0x12')]('../api/squareReport/squareReport.model');db['SquareDetailsReport']=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0xd2'));db[_0x22bc('0xd3')]=db[_0x22bc('0x3')]['import'](_0x22bc('0xd4'));db['Setting']=db['sequelize'][_0x22bc('0x12')](_0x22bc('0xd5'));db[_0x22bc('0xd6')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0xd7'));db[_0x22bc('0xd8')]=db['sequelize'][_0x22bc('0x12')](_0x22bc('0xd9'));db[_0x22bc('0xda')]=db[_0x22bc('0x3')]['import'](_0x22bc('0xdb'));db['SquareMessage']=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0xdc'));db[_0x22bc('0xdd')]=db[_0x22bc('0x3')][_0x22bc('0x12')]('../api/team/team.model');db[_0x22bc('0xde')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0xdf'));db[_0x22bc('0xe0')]=db['sequelize'][_0x22bc('0x12')](_0x22bc('0xe1'));db[_0x22bc('0xe2')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0xe3'));db[_0x22bc('0xe4')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0xe5'));db[_0x22bc('0xe6')]=db['sequelize'][_0x22bc('0x12')]('../api/plugin/plugin.model');db[_0x22bc('0xe7')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0xe8'));db[_0x22bc('0xe9')]=db['sequelize']['import'](_0x22bc('0xea'));db[_0x22bc('0xeb')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0xec'));db[_0x22bc('0xed')]=db[_0x22bc('0x3')]['import'](_0x22bc('0xee'));db[_0x22bc('0xef')]=db['sequelize'][_0x22bc('0x12')](_0x22bc('0xf0'));db['CmList']=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0xf1'));db['VoicePrefix']=db['sequelize'][_0x22bc('0x12')](_0x22bc('0xf2'));db[_0x22bc('0xf3')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0xf4'));db[_0x22bc('0xf5')]=db['sequelize'][_0x22bc('0x12')](_0x22bc('0xf6'));db[_0x22bc('0xf7')]=db[_0x22bc('0x3')]['import'](_0x22bc('0xf8'));db['UserNotification']=db['sequelize'][_0x22bc('0x12')](_0x22bc('0xf9'));db[_0x22bc('0xfa')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0xfb'));db[_0x22bc('0xfc')]=db['sequelize'][_0x22bc('0x12')]('../api/whatsappApplication/whatsappApplication.model');db[_0x22bc('0xfd')]=db[_0x22bc('0x3')]['import'](_0x22bc('0xfe'));db[_0x22bc('0xff')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x100'));db[_0x22bc('0x101')]=db[_0x22bc('0x3')]['import'](_0x22bc('0x102'));db[_0x22bc('0x103')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x104'));db[_0x22bc('0x105')]=db[_0x22bc('0x3')][_0x22bc('0x12')](_0x22bc('0x106'));db['CloudProvider']=db['sequelize'][_0x22bc('0x12')](_0x22bc('0x107'));db[_0x22bc('0x108')]=db[_0x22bc('0x3')][_0x22bc('0x12')]('../api/teamVoiceQueue/teamVoiceQueue.model');db[_0x22bc('0x109')]=db[_0x22bc('0x3')][_0x22bc('0x12')]('../api/teamVoicePrefix/teamVoicePrefix.model');db[_0x22bc('0x10a')]=db['sequelize']['import']('../api/userVoicePrefix/userVoicePrefix.model');db['User']['hasOne'](db[_0x22bc('0x1e')],{'as':_0x22bc('0x1e'),'onDelete':_0x22bc('0x10b'),'foreignKey':_0x22bc('0x10c')});db[_0x22bc('0x10d')][_0x22bc('0x10e')](db[_0x22bc('0x1b')],{'as':_0x22bc('0x10f'),'foreignKey':_0x22bc('0x10c')});db[_0x22bc('0x10d')][_0x22bc('0x10e')](db[_0x22bc('0x2a')],{'as':_0x22bc('0x110'),'foreignKey':'UserId'});db[_0x22bc('0x10d')][_0x22bc('0x10e')](db[_0x22bc('0x17')],{'as':_0x22bc('0x111'),'onDelete':_0x22bc('0x10b'),'hooks':!![]});db[_0x22bc('0x10d')]['hasMany'](db['CmHopperFinal'],{'as':_0x22bc('0x112'),'foreignKey':_0x22bc('0x10c')});db['User'][_0x22bc('0x10e')](db[_0x22bc('0x113')],{'as':_0x22bc('0x114'),'foreignKey':_0x22bc('0x10c')});db['User'][_0x22bc('0x10e')](db[_0x22bc('0x77')],{'as':_0x22bc('0x77'),'foreignKey':_0x22bc('0x10c')});db[_0x22bc('0x10d')]['hasMany'](db[_0x22bc('0x115')],{'as':_0x22bc('0x116'),'foreignKey':_0x22bc('0x10c')});db[_0x22bc('0x10d')][_0x22bc('0x10e')](db['ChatInteraction'],{'as':_0x22bc('0x117'),'foreignKey':_0x22bc('0x10c')});db['User'][_0x22bc('0x10e')](db[_0x22bc('0x118')],{'as':'SmsInteractions','foreignKey':_0x22bc('0x10c')});db['User'][_0x22bc('0x10e')](db[_0x22bc('0x4d')],{'as':_0x22bc('0x119'),'foreignKey':_0x22bc('0x10c')});db[_0x22bc('0x10d')][_0x22bc('0x10e')](db[_0x22bc('0x3e')],{'as':_0x22bc('0x11a'),'foreignKey':_0x22bc('0x10c')});db[_0x22bc('0x10d')][_0x22bc('0x10e')](db['WhatsappInteraction'],{'as':'WhatsappInteractions','foreignKey':'UserId'});db[_0x22bc('0x10d')][_0x22bc('0x10e')](db['UserNotification'],{'as':_0x22bc('0x11b'),'foreignKey':'SenderId'});db[_0x22bc('0x10d')][_0x22bc('0x11c')](db[_0x22bc('0xf3')],{'as':_0x22bc('0xf3'),'foreignKey':_0x22bc('0x11d')});db['User']['belongsToMany'](db['ChatGroup'],{'as':_0x22bc('0x11e'),'through':_0x22bc('0x11f')});db[_0x22bc('0x10d')][_0x22bc('0x120')](db[_0x22bc('0x70')],{'as':_0x22bc('0x121'),'through':'cm_user_has_contacts'});db[_0x22bc('0x10d')]['belongsToMany'](db[_0x22bc('0x122')],{'as':_0x22bc('0x123'),'through':_0x22bc('0x124')});db[_0x22bc('0x10d')][_0x22bc('0x120')](db['Team'],{'through':'user_has_teams'});db[_0x22bc('0x10d')]['belongsToMany'](db[_0x22bc('0x3e')],{'as':_0x22bc('0x11a'),'through':_0x22bc('0x125')});db[_0x22bc('0x10d')]['belongsToMany'](db[_0x22bc('0x66')],{'as':_0x22bc('0x117'),'through':'user_has_chat_interactions'});db[_0x22bc('0x10d')][_0x22bc('0x120')](db['FaxInteraction'],{'as':_0x22bc('0x119'),'through':_0x22bc('0x126')});db[_0x22bc('0x10d')][_0x22bc('0x120')](db[_0x22bc('0x118')],{'as':_0x22bc('0x127'),'through':_0x22bc('0x128')});db[_0x22bc('0x10d')]['belongsToMany'](db['OpenchannelInteraction'],{'as':'OpenchannelInteractions','through':_0x22bc('0x129')});db['User'][_0x22bc('0x120')](db['WhatsappInteraction'],{'as':_0x22bc('0x12a'),'through':_0x22bc('0x12b')});db[_0x22bc('0x10d')]['belongsToMany'](db['VoiceQueue'],{'as':_0x22bc('0x12c'),'through':_0x22bc('0x2b'),'required':![]});db[_0x22bc('0x10d')]['belongsToMany'](db[_0x22bc('0x12d')],{'as':_0x22bc('0x12e'),'through':'UserVoicePrefix','required':![]});db[_0x22bc('0x10d')]['belongsToMany'](db['MailQueue'],{'as':_0x22bc('0x12f'),'through':_0x22bc('0x130'),'required':![]});db['User'][_0x22bc('0x120')](db[_0x22bc('0x69')],{'as':'ChatQueues','through':_0x22bc('0x2d'),'required':![],'hooks':!![]});db[_0x22bc('0x10d')]['belongsToMany'](db['FaxQueue'],{'as':_0x22bc('0x131'),'through':_0x22bc('0x2e'),'required':![]});db['User'][_0x22bc('0x120')](db[_0x22bc('0x59')],{'as':_0x22bc('0x132'),'through':_0x22bc('0x30'),'required':![]});db['User'][_0x22bc('0x120')](db[_0x22bc('0x60')],{'as':_0x22bc('0x133'),'through':_0x22bc('0x134'),'required':![]});db['User'][_0x22bc('0x120')](db[_0x22bc('0x105')],{'as':'WhatsappQueues','through':_0x22bc('0x33'),'required':![]});db[_0x22bc('0x10d')][_0x22bc('0x120')](db[_0x22bc('0x122')],{'through':_0x22bc('0x124')});db['User'][_0x22bc('0x120')](db[_0x22bc('0x12d')],{'as':_0x22bc('0x12e'),'through':'user_has_voice_prefixes','required':![]});db[_0x22bc('0x10d')][_0x22bc('0x120')](db['ChatWebsite'],{'as':_0x22bc('0x135'),'through':_0x22bc('0x136')});db[_0x22bc('0x10d')][_0x22bc('0x120')](db['FaxAccount'],{'as':_0x22bc('0x137'),'through':_0x22bc('0x138')});db[_0x22bc('0x10d')][_0x22bc('0x120')](db[_0x22bc('0x38')],{'as':_0x22bc('0x139'),'through':_0x22bc('0x13a')});db[_0x22bc('0x10d')][_0x22bc('0x120')](db[_0x22bc('0x5b')],{'as':_0x22bc('0x13b'),'through':_0x22bc('0x13c')});db['User'][_0x22bc('0x120')](db[_0x22bc('0x52')],{'as':_0x22bc('0x13d'),'through':_0x22bc('0x13e')});db[_0x22bc('0x10d')][_0x22bc('0x120')](db[_0x22bc('0xfa')],{'as':_0x22bc('0x13f'),'through':'user_has_whatsapp_accounts'});db[_0x22bc('0x10d')]['belongsToMany'](db[_0x22bc('0xd8')],{'as':_0x22bc('0x140'),'through':_0x22bc('0x141')});db[_0x22bc('0x13')]['hasMany'](db[_0x22bc('0x17')],{'as':_0x22bc('0x142'),'onDelete':_0x22bc('0x10b'),'foreignKey':_0x22bc('0x143')});db[_0x22bc('0x15')]['hasMany'](db[_0x22bc('0x17')],{'onDelete':'cascade'});db[_0x22bc('0x17')][_0x22bc('0x10e')](db[_0x22bc('0x17')],{'as':_0x22bc('0x144'),'onDelete':_0x22bc('0x10b')});db['VoiceMusicOnHold']['belongsToMany'](db['Sound'],{'as':_0x22bc('0x145'),'through':'moh_has_sounds'});db[_0x22bc('0x1a')][_0x22bc('0x10e')](db[_0x22bc('0x2a')],{'as':_0x22bc('0x146'),'foreignKey':'VoiceQueueId'});db[_0x22bc('0x1a')][_0x22bc('0x10e')](db[_0x22bc('0x71')],{'as':_0x22bc('0x147'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x22bc('0x10e')](db[_0x22bc('0x74')],{'as':_0x22bc('0x112'),'foreignKey':_0x22bc('0x148')});db[_0x22bc('0x1a')][_0x22bc('0x10e')](db[_0x22bc('0x113')],{'as':_0x22bc('0x149'),'foreignKey':'VoiceQueueId'});db[_0x22bc('0x1a')][_0x22bc('0x10e')](db[_0x22bc('0x77')],{'as':_0x22bc('0x77'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x22bc('0x10e')](db[_0x22bc('0x73')],{'as':_0x22bc('0x14a'),'foreignKey':_0x22bc('0x148')});db[_0x22bc('0x1a')]['hasMany'](db['JscriptySessionReport'],{'as':_0x22bc('0x14b'),'foreignKey':_0x22bc('0x148')});db[_0x22bc('0x1a')]['belongsTo'](db[_0x22bc('0x27')],{'as':'Trunk','foreignKey':_0x22bc('0x14c')});db[_0x22bc('0x1a')][_0x22bc('0x11c')](db[_0x22bc('0x27')],{'as':_0x22bc('0x14d'),'foreignKey':_0x22bc('0x14e')});db[_0x22bc('0x1a')][_0x22bc('0x11c')](db[_0x22bc('0x7f')],{'as':_0x22bc('0x7f'),'foreignKey':'IntervalId'});db['VoiceQueue']['belongsTo'](db['Pause'],{'as':_0x22bc('0x14f'),'foreignKey':_0x22bc('0x150')});db[_0x22bc('0x1a')][_0x22bc('0x120')](db[_0x22bc('0x122')],{'as':'Lists','through':_0x22bc('0x151')});db[_0x22bc('0x1a')][_0x22bc('0x120')](db[_0x22bc('0x10d')],{'as':_0x22bc('0x152'),'through':_0x22bc('0x2b')});db[_0x22bc('0x1a')][_0x22bc('0x120')](db[_0x22bc('0xdd')],{'as':'Teams','through':_0x22bc('0x108')});db[_0x22bc('0x1a')][_0x22bc('0x120')](db['CmList'],{'as':_0x22bc('0x153'),'through':'voice_queues_has_cm_blacklists'});db[_0x22bc('0x1b')]['belongsTo'](db[_0x22bc('0x10d')],{'as':'User','foreignKey':_0x22bc('0x10c')});db[_0x22bc('0x1c')][_0x22bc('0x11c')](db[_0x22bc('0x10d')],{'as':_0x22bc('0x10d'),'foreignKey':_0x22bc('0x10c')});db[_0x22bc('0x1e')]['hasMany'](db[_0x22bc('0x1f')],{'as':_0x22bc('0x154'),'onDelete':_0x22bc('0x10b'),'foreignKey':_0x22bc('0x155'),'sourceKey':_0x22bc('0x156')});db[_0x22bc('0x1f')][_0x22bc('0x11c')](db[_0x22bc('0x1e')],{'foreignKey':_0x22bc('0x155'),'targetKey':_0x22bc('0x156')});db[_0x22bc('0x157')][_0x22bc('0x10e')](db[_0x22bc('0x23')],{'as':_0x22bc('0x158'),'foreignKey':_0x22bc('0x159'),'constraints':![]});db[_0x22bc('0x157')][_0x22bc('0x10e')](db[_0x22bc('0x15a')],{'as':'AgentReports','foreignKey':_0x22bc('0x159'),'constraints':![]});db['VoiceCallReport'][_0x22bc('0x11c')](db[_0x22bc('0x10d')],{'as':'User','foreignKey':_0x22bc('0x10c')});db['VoiceCallReport']['belongsTo'](db[_0x22bc('0x70')],{'as':_0x22bc('0x15b'),'foreignKey':_0x22bc('0x15c')});db[_0x22bc('0x15d')][_0x22bc('0x11c')](db[_0x22bc('0x38')],{'as':_0x22bc('0x38'),'foreignKey':'MailAccountId'});db['MailServerOut'][_0x22bc('0x11c')](db[_0x22bc('0x38')],{'as':'MailAccount','foreignKey':'MailAccountId'});db[_0x22bc('0x38')]['hasOne'](db['MailServerIn'],{'as':'Imap','onDelete':_0x22bc('0x10b')});db[_0x22bc('0x38')][_0x22bc('0x15e')](db['MailServerOut'],{'as':_0x22bc('0x15f'),'onDelete':_0x22bc('0x10b')});db[_0x22bc('0x38')][_0x22bc('0x10e')](db['Disposition'],{'as':_0x22bc('0x160'),'foreignKey':_0x22bc('0x161'),'onDelete':_0x22bc('0x10b')});db['MailAccount']['hasMany'](db[_0x22bc('0x7c')],{'as':_0x22bc('0x162'),'foreignKey':_0x22bc('0x161')});db[_0x22bc('0x38')][_0x22bc('0x10e')](db['MailMessage'],{'as':_0x22bc('0x154'),'foreignKey':_0x22bc('0x161')});db[_0x22bc('0x38')]['hasMany'](db[_0x22bc('0x3e')],{'as':_0x22bc('0x163')});db[_0x22bc('0x38')][_0x22bc('0x10e')](db['MailApplication'],{'as':_0x22bc('0x144')});db[_0x22bc('0x38')][_0x22bc('0x11c')](db[_0x22bc('0x122')],{'as':_0x22bc('0x164'),'foreignKey':_0x22bc('0x165')});db[_0x22bc('0x38')]['belongsTo'](db['Template'],{'as':_0x22bc('0x87'),'foreignKey':'TemplateId'});db[_0x22bc('0x38')][_0x22bc('0x11c')](db[_0x22bc('0x166')],{'as':_0x22bc('0x14f'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x22bc('0x38')]['belongsToMany'](db[_0x22bc('0x10d')],{'as':'Agents','through':'user_has_mail_accounts'});db[_0x22bc('0x3a')][_0x22bc('0x120')](db['User'],{'as':_0x22bc('0x152'),'through':_0x22bc('0x130')});db['MailQueue'][_0x22bc('0x120')](db[_0x22bc('0xdd')],{'through':_0x22bc('0x167'),'as':'Teams'});db['MailInteraction'][_0x22bc('0x10e')](db[_0x22bc('0x40')],{'as':_0x22bc('0x154'),'onDelete':'cascade','foreignKey':'MailInteractionId'});db['MailInteraction'][_0x22bc('0x11c')](db[_0x22bc('0x38')],{'as':_0x22bc('0x168'),'foreignKey':_0x22bc('0x161')});db[_0x22bc('0x3e')][_0x22bc('0x11c')](db[_0x22bc('0x70')],{'as':_0x22bc('0x15b'),'foreignKey':_0x22bc('0x15c')});db['MailInteraction']['belongsTo'](db['User'],{'as':_0x22bc('0x169'),'foreignKey':'UserId'});db[_0x22bc('0x3e')][_0x22bc('0x120')](db[_0x22bc('0x16a')],{'through':_0x22bc('0x16b'),'as':'Tags'});db['MailInteraction'][_0x22bc('0x120')](db['Tag'],{'through':_0x22bc('0x16b'),'as':'ThroughTags'});db[_0x22bc('0x3e')][_0x22bc('0x120')](db[_0x22bc('0x10d')],{'as':_0x22bc('0x16c'),'through':_0x22bc('0x125'),'foreignKey':_0x22bc('0x16d')});db[_0x22bc('0x40')][_0x22bc('0x10e')](db['Attachment'],{'as':_0x22bc('0x16e'),'onDelete':_0x22bc('0x10b')});db[_0x22bc('0x40')][_0x22bc('0x11c')](db[_0x22bc('0x10d')],{'as':_0x22bc('0x10d')});db['MailMessage'][_0x22bc('0x11c')](db['CmContact'],{'onDelete':_0x22bc('0x10b'),'as':_0x22bc('0x15b')});db['MailMessage'][_0x22bc('0x11c')](db['MailInteraction'],{'as':_0x22bc('0x16f'),'foreignKey':_0x22bc('0x16d')});db[_0x22bc('0x40')][_0x22bc('0x11c')](db['MailAccount'],{'as':_0x22bc('0x168'),'foreignKey':_0x22bc('0x161')});db[_0x22bc('0x40')][_0x22bc('0x11c')](db[_0x22bc('0x62')],{'as':_0x22bc('0x62'),'foreignKey':_0x22bc('0x170')});db[_0x22bc('0x40')][_0x22bc('0x11c')](db['ChatOfflineMessage'],{'as':_0x22bc('0x68'),'foreignKey':_0x22bc('0x171')});db[_0x22bc('0x42')]['belongsTo'](db[_0x22bc('0x10d')],{'onDelete':'restrict'});db[_0x22bc('0x42')][_0x22bc('0x11c')](db[_0x22bc('0x3a')],{'onDelete':_0x22bc('0x172')});db[_0x22bc('0x42')][_0x22bc('0x11c')](db[_0x22bc('0x38')],{'onDelete':_0x22bc('0x172')});db[_0x22bc('0x42')]['belongsTo'](db[_0x22bc('0x7f')],{'onDelete':_0x22bc('0x172'),'foreignKey':'IntervalId'});db[_0x22bc('0x42')][_0x22bc('0x11c')](db[_0x22bc('0x16a')],{'onDelete':'restrict','foreignKey':_0x22bc('0x173')});db[_0x22bc('0x174')][_0x22bc('0x11c')](db[_0x22bc('0x38')],{});db[_0x22bc('0x174')][_0x22bc('0x11c')](db['CmList'],{'as':_0x22bc('0x164'),'foreignKey':_0x22bc('0x165')});db[_0x22bc('0x174')]['belongsTo'](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db['MailQueueReport'][_0x22bc('0x11c')](db[_0x22bc('0x3e')],{});db['MailQueueReport']['belongsTo'](db[_0x22bc('0x40')],{});db[_0x22bc('0x174')][_0x22bc('0x11c')](db[_0x22bc('0x10d')],{});db[_0x22bc('0x174')]['belongsTo'](db[_0x22bc('0x3a')],{});db[_0x22bc('0x45')][_0x22bc('0x10e')](db['DashboardItem'],{'as':_0x22bc('0x175'),'onDelete':_0x22bc('0x10b')});db['FaxAccount'][_0x22bc('0x10e')](db['Disposition'],{'as':'Dispositions','foreignKey':_0x22bc('0x176'),'onDelete':_0x22bc('0x10b')});db['FaxAccount']['hasMany'](db[_0x22bc('0x7c')],{'as':_0x22bc('0x162'),'foreignKey':_0x22bc('0x176')});db['FaxAccount']['hasMany'](db[_0x22bc('0x4d')],{'as':'Interactions'});db[_0x22bc('0x49')][_0x22bc('0x10e')](db[_0x22bc('0x4b')],{'as':_0x22bc('0x144')});db['FaxAccount']['hasMany'](db['VoiceExtension'],{'as':'Exntensions','onDelete':'cascade'});db['FaxAccount'][_0x22bc('0x10e')](db[_0x22bc('0x177')],{'as':_0x22bc('0x154')});db['FaxAccount']['belongsTo'](db['Trunk'],{'as':_0x22bc('0x27')});db['FaxAccount'][_0x22bc('0x11c')](db[_0x22bc('0x122')],{'as':_0x22bc('0x164'),'foreignKey':_0x22bc('0x165')});db['FaxAccount']['belongsTo'](db[_0x22bc('0x166')],{'as':_0x22bc('0x14f'),'foreignKey':_0x22bc('0x150')});db[_0x22bc('0x49')][_0x22bc('0x120')](db['User'],{'as':_0x22bc('0x152'),'through':_0x22bc('0x138')});db['FaxApplication']['belongsTo'](db['User'],{'onDelete':_0x22bc('0x172')});db[_0x22bc('0x4b')]['belongsTo'](db['FaxQueue'],{'onDelete':_0x22bc('0x172')});db[_0x22bc('0x4b')][_0x22bc('0x11c')](db[_0x22bc('0x49')],{'onDelete':_0x22bc('0x172')});db[_0x22bc('0x4b')][_0x22bc('0x11c')](db[_0x22bc('0x16a')],{'onDelete':'restrict','foreignKey':_0x22bc('0x173')});db[_0x22bc('0x4d')][_0x22bc('0x10e')](db[_0x22bc('0x177')],{'as':'Messages','onDelete':_0x22bc('0x10b'),'foreignKey':'FaxInteractionId'});db['FaxInteraction']['belongsTo'](db[_0x22bc('0x49')],{'as':_0x22bc('0x168'),'foreignKey':_0x22bc('0x176')});db[_0x22bc('0x4d')][_0x22bc('0x11c')](db[_0x22bc('0x70')],{'as':_0x22bc('0x15b'),'foreignKey':_0x22bc('0x15c')});db[_0x22bc('0x4d')][_0x22bc('0x11c')](db[_0x22bc('0x10d')],{'as':_0x22bc('0x169'),'foreignKey':_0x22bc('0x10c')});db[_0x22bc('0x4d')]['belongsToMany'](db[_0x22bc('0x16a')],{'through':_0x22bc('0x178'),'as':_0x22bc('0x179')});db['FaxInteraction'][_0x22bc('0x120')](db[_0x22bc('0x16a')],{'through':_0x22bc('0x178'),'as':_0x22bc('0x17a')});db['FaxInteraction'][_0x22bc('0x120')](db['User'],{'as':_0x22bc('0x16c'),'through':_0x22bc('0x126'),'foreignKey':_0x22bc('0x17b')});db[_0x22bc('0x177')]['belongsTo'](db[_0x22bc('0x10d')],{'onDelete':_0x22bc('0x10b'),'as':_0x22bc('0x10d')});db[_0x22bc('0x177')][_0x22bc('0x11c')](db['FaxInteraction'],{'as':'Interaction','foreignKey':'FaxInteractionId'});db['FaxMessage']['belongsTo'](db[_0x22bc('0x70')],{'onDelete':_0x22bc('0x10b'),'as':_0x22bc('0x15b')});db[_0x22bc('0x177')][_0x22bc('0x11c')](db[_0x22bc('0xe4')],{'as':'Attachment','foreignKey':_0x22bc('0x17c')});db['FaxMessage']['belongsTo'](db['FaxAccount'],{'as':_0x22bc('0x168'),'foreignKey':_0x22bc('0x176')});db[_0x22bc('0x17d')][_0x22bc('0x120')](db[_0x22bc('0x10d')],{'as':_0x22bc('0x152'),'through':_0x22bc('0x2e')});db['FaxQueue'][_0x22bc('0x120')](db[_0x22bc('0xdd')],{'through':_0x22bc('0x17e'),'as':_0x22bc('0x17f')});db[_0x22bc('0x51')]['belongsTo'](db[_0x22bc('0x49')],{});db['FaxQueueReport'][_0x22bc('0x11c')](db[_0x22bc('0x122')],{'as':_0x22bc('0x164'),'foreignKey':'ListId'});db[_0x22bc('0x51')]['belongsTo'](db[_0x22bc('0x70')],{'as':_0x22bc('0x15b'),'foreignKey':'ContactId'});db[_0x22bc('0x51')][_0x22bc('0x11c')](db[_0x22bc('0x4d')],{});db['FaxQueueReport'][_0x22bc('0x11c')](db[_0x22bc('0x177')],{});db['FaxQueueReport']['belongsTo'](db[_0x22bc('0x10d')],{});db[_0x22bc('0x51')][_0x22bc('0x11c')](db[_0x22bc('0x17d')],{});db[_0x22bc('0x52')][_0x22bc('0x10e')](db['Disposition'],{'as':_0x22bc('0x160'),'foreignKey':_0x22bc('0x180'),'onDelete':_0x22bc('0x10b')});db[_0x22bc('0x52')][_0x22bc('0x10e')](db[_0x22bc('0x7c')],{'as':_0x22bc('0x162'),'foreignKey':'SmsAccountId'});db[_0x22bc('0x52')][_0x22bc('0x10e')](db['SmsMessage'],{'as':_0x22bc('0x154'),'foreignKey':_0x22bc('0x180')});db[_0x22bc('0x52')][_0x22bc('0x10e')](db[_0x22bc('0x118')],{'as':_0x22bc('0x163')});db['SmsAccount'][_0x22bc('0x10e')](db[_0x22bc('0x54')],{'as':_0x22bc('0x144')});db['SmsAccount'][_0x22bc('0x11c')](db[_0x22bc('0x122')],{'as':_0x22bc('0x164'),'foreignKey':_0x22bc('0x165')});db[_0x22bc('0x52')]['belongsTo'](db['Pause'],{'as':_0x22bc('0x14f'),'foreignKey':_0x22bc('0x150')});db[_0x22bc('0x52')][_0x22bc('0x120')](db[_0x22bc('0x10d')],{'as':_0x22bc('0x152'),'through':_0x22bc('0x13e')});db[_0x22bc('0x54')][_0x22bc('0x11c')](db[_0x22bc('0x10d')],{'onDelete':_0x22bc('0x172')});db[_0x22bc('0x54')][_0x22bc('0x11c')](db['SmsQueue'],{'onDelete':_0x22bc('0x172')});db[_0x22bc('0x54')][_0x22bc('0x11c')](db['SmsAccount'],{'onDelete':_0x22bc('0x172')});db[_0x22bc('0x54')]['belongsTo'](db[_0x22bc('0x7f')],{'onDelete':_0x22bc('0x172'),'foreignKey':'IntervalId'});db['SmsApplication'][_0x22bc('0x11c')](db[_0x22bc('0x16a')],{'onDelete':'restrict','foreignKey':'TagId'});db[_0x22bc('0x118')][_0x22bc('0x10e')](db[_0x22bc('0x57')],{'as':_0x22bc('0x154'),'onDelete':_0x22bc('0x10b'),'foreignKey':_0x22bc('0x181')});db[_0x22bc('0x118')][_0x22bc('0x11c')](db[_0x22bc('0x52')],{'as':'Account','foreignKey':_0x22bc('0x180')});db['SmsInteraction'][_0x22bc('0x11c')](db['CmContact'],{'as':'Contact','foreignKey':_0x22bc('0x15c')});db[_0x22bc('0x118')]['belongsTo'](db[_0x22bc('0x10d')],{'as':_0x22bc('0x169'),'foreignKey':_0x22bc('0x10c')});db[_0x22bc('0x118')][_0x22bc('0x120')](db[_0x22bc('0x16a')],{'through':_0x22bc('0x182'),'as':_0x22bc('0x179')});db[_0x22bc('0x118')][_0x22bc('0x120')](db[_0x22bc('0x16a')],{'through':_0x22bc('0x182'),'as':'ThroughTags'});db[_0x22bc('0x118')][_0x22bc('0x120')](db['User'],{'as':_0x22bc('0x16c'),'through':_0x22bc('0x128'),'foreignKey':_0x22bc('0x181')});db[_0x22bc('0x57')][_0x22bc('0x11c')](db[_0x22bc('0x10d')],{'as':_0x22bc('0x10d')});db[_0x22bc('0x57')]['belongsTo'](db['CmContact'],{'onDelete':'cascade','as':_0x22bc('0x15b')});db[_0x22bc('0x57')]['belongsTo'](db['SmsInteraction'],{'onDelete':'cascade','as':_0x22bc('0x16f'),'foreignKey':_0x22bc('0x181')});db[_0x22bc('0x57')]['belongsTo'](db[_0x22bc('0x52')],{'as':_0x22bc('0x168'),'foreignKey':_0x22bc('0x180')});db[_0x22bc('0x59')]['belongsToMany'](db[_0x22bc('0x10d')],{'as':_0x22bc('0x152'),'through':'UserSmsQueue','foreignKey':_0x22bc('0x183')});db[_0x22bc('0x59')][_0x22bc('0x120')](db[_0x22bc('0xdd')],{'through':_0x22bc('0x184'),'as':_0x22bc('0x17f')});db[_0x22bc('0x5b')][_0x22bc('0x10e')](db[_0x22bc('0x7d')],{'as':'Dispositions','foreignKey':_0x22bc('0x185'),'onDelete':_0x22bc('0x10b')});db['OpenchannelAccount']['hasMany'](db['CannedAnswer'],{'as':_0x22bc('0x162'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0x22bc('0x10e')](db['OpenchannelInteraction'],{'as':_0x22bc('0x163'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0x22bc('0x10e')](db['OpenchannelMessage'],{'as':'Messages','foreignKey':_0x22bc('0x185')});db[_0x22bc('0x5b')][_0x22bc('0x10e')](db[_0x22bc('0x5d')],{'as':'Applications','foreignKey':'OpenchannelAccountId'});db[_0x22bc('0x5b')][_0x22bc('0x11c')](db[_0x22bc('0x122')],{'as':_0x22bc('0x164'),'foreignKey':_0x22bc('0x165')});db[_0x22bc('0x5b')]['belongsTo'](db[_0x22bc('0x166')],{'as':_0x22bc('0x14f'),'foreignKey':_0x22bc('0x150')});db[_0x22bc('0x5b')][_0x22bc('0x120')](db[_0x22bc('0x10d')],{'as':_0x22bc('0x152'),'through':'user_has_openchannel_accounts'});db[_0x22bc('0x5d')]['belongsTo'](db[_0x22bc('0x10d')],{'onDelete':'restrict'});db[_0x22bc('0x5d')][_0x22bc('0x11c')](db[_0x22bc('0x60')],{'onDelete':_0x22bc('0x172'),'foreignKey':_0x22bc('0x186')});db[_0x22bc('0x5d')][_0x22bc('0x11c')](db[_0x22bc('0x5b')],{'onDelete':'restrict','foreignKey':'OpenchannelAccountId'});db[_0x22bc('0x5d')][_0x22bc('0x11c')](db['Interval'],{'onDelete':_0x22bc('0x172'),'foreignKey':'IntervalId'});db[_0x22bc('0x5d')]['belongsTo'](db[_0x22bc('0x16a')],{'onDelete':_0x22bc('0x172'),'foreignKey':'TagId'});db[_0x22bc('0x115')][_0x22bc('0x10e')](db[_0x22bc('0x187')],{'as':_0x22bc('0x154'),'onDelete':_0x22bc('0x10b'),'foreignKey':_0x22bc('0x188')});db[_0x22bc('0x115')]['belongsTo'](db[_0x22bc('0x5b')],{'as':'Account','foreignKey':_0x22bc('0x185')});db[_0x22bc('0x115')][_0x22bc('0x11c')](db['CmContact'],{'as':'Contact','foreignKey':_0x22bc('0x15c')});db[_0x22bc('0x115')]['belongsTo'](db['User'],{'as':'Owner','foreignKey':_0x22bc('0x10c')});db[_0x22bc('0x115')]['belongsToMany'](db['Tag'],{'through':_0x22bc('0x189'),'as':_0x22bc('0x179')});db[_0x22bc('0x115')]['belongsToMany'](db[_0x22bc('0x16a')],{'through':_0x22bc('0x189'),'as':_0x22bc('0x17a')});db[_0x22bc('0x115')][_0x22bc('0x120')](db[_0x22bc('0x10d')],{'as':'Users','through':_0x22bc('0x129'),'foreignKey':_0x22bc('0x188')});db[_0x22bc('0x187')][_0x22bc('0x11c')](db[_0x22bc('0x10d')],{'onDelete':_0x22bc('0x10b'),'as':_0x22bc('0x10d')});db[_0x22bc('0x187')]['belongsTo'](db[_0x22bc('0x70')],{'onDelete':_0x22bc('0x10b'),'as':'Contact'});db[_0x22bc('0x187')][_0x22bc('0x11c')](db[_0x22bc('0x115')],{'onDelete':_0x22bc('0x10b'),'as':'Interaction','foreignKey':_0x22bc('0x188')});db[_0x22bc('0x187')][_0x22bc('0x11c')](db[_0x22bc('0xe4')],{'as':_0x22bc('0xe4'),'foreignKey':_0x22bc('0x17c')});db[_0x22bc('0x187')][_0x22bc('0x11c')](db[_0x22bc('0x5b')],{'as':'Account','foreignKey':_0x22bc('0x185')});db['OpenchannelQueue'][_0x22bc('0x120')](db[_0x22bc('0x10d')],{'as':_0x22bc('0x152'),'through':_0x22bc('0x134'),'foreignKey':'OpenchannelQueueId'});db[_0x22bc('0x60')][_0x22bc('0x120')](db['Team'],{'through':_0x22bc('0x18a'),'as':_0x22bc('0x17f')});db['ChatWebsite'][_0x22bc('0x10e')](db[_0x22bc('0x7d')],{'as':'Dispositions','foreignKey':_0x22bc('0x170'),'onDelete':'cascade'});db[_0x22bc('0x62')][_0x22bc('0x10e')](db['CannedAnswer'],{'as':_0x22bc('0x162'),'foreignKey':_0x22bc('0x170')});db[_0x22bc('0x62')][_0x22bc('0x10e')](db[_0x22bc('0x6d')],{'as':'ProactiveActions'});db[_0x22bc('0x62')][_0x22bc('0x10e')](db[_0x22bc('0x66')],{'as':_0x22bc('0x163')});db[_0x22bc('0x62')][_0x22bc('0x10e')](db[_0x22bc('0x64')],{'as':'Applications'});db[_0x22bc('0x62')]['hasMany'](db[_0x22bc('0x67')],{'as':'Messages'});db[_0x22bc('0x62')][_0x22bc('0x11c')](db[_0x22bc('0x122')],{'as':_0x22bc('0x164'),'foreignKey':_0x22bc('0x165')});db['ChatWebsite'][_0x22bc('0x11c')](db[_0x22bc('0x7f')],{'as':_0x22bc('0x7f'),'foreignKey':_0x22bc('0x18b')});db['ChatWebsite'][_0x22bc('0x11c')](db[_0x22bc('0x38')],{'as':'MailAccount','foreignKey':_0x22bc('0x161')});db['ChatWebsite'][_0x22bc('0x11c')](db[_0x22bc('0x166')],{'as':_0x22bc('0x14f'),'foreignKey':'mandatoryDispositionPauseId'});db['ChatWebsite'][_0x22bc('0x120')](db['User'],{'as':'Agents','through':_0x22bc('0x136')});db[_0x22bc('0x18c')][_0x22bc('0x11c')](db[_0x22bc('0x5b')],{});db[_0x22bc('0x18c')][_0x22bc('0x11c')](db[_0x22bc('0x122')],{'as':_0x22bc('0x164'),'foreignKey':_0x22bc('0x165')});db[_0x22bc('0x18c')][_0x22bc('0x11c')](db['CmContact'],{'as':_0x22bc('0x15b'),'foreignKey':'ContactId'});db['OpenchannelQueueReport']['belongsTo'](db['OpenchannelInteraction'],{});db[_0x22bc('0x18c')][_0x22bc('0x11c')](db[_0x22bc('0x187')],{});db[_0x22bc('0x18c')][_0x22bc('0x11c')](db[_0x22bc('0x10d')],{});db[_0x22bc('0x18c')][_0x22bc('0x11c')](db['OpenchannelQueue'],{});db[_0x22bc('0x64')][_0x22bc('0x11c')](db['User'],{'as':_0x22bc('0x18d'),'foreignKey':_0x22bc('0x10c'),'onDelete':'restrict'});db[_0x22bc('0x64')][_0x22bc('0x11c')](db[_0x22bc('0x69')],{'as':_0x22bc('0x18e'),'foreignKey':_0x22bc('0x18f'),'onDelete':'restrict'});db[_0x22bc('0x64')][_0x22bc('0x11c')](db[_0x22bc('0x62')],{'as':_0x22bc('0x190'),'foreignKey':_0x22bc('0x170'),'onDelete':_0x22bc('0x172')});db[_0x22bc('0x64')][_0x22bc('0x11c')](db[_0x22bc('0x16a')],{'onDelete':'restrict','foreignKey':_0x22bc('0x173')});db[_0x22bc('0x66')]['hasMany'](db[_0x22bc('0x67')],{'as':_0x22bc('0x154'),'onDelete':_0x22bc('0x10b'),'foreignKey':_0x22bc('0x191')});db[_0x22bc('0x66')][_0x22bc('0x11c')](db[_0x22bc('0x62')],{'as':_0x22bc('0x168'),'foreignKey':_0x22bc('0x170')});db[_0x22bc('0x66')]['belongsTo'](db[_0x22bc('0x70')],{'as':_0x22bc('0x15b'),'foreignKey':_0x22bc('0x15c')});db['ChatInteraction']['belongsTo'](db[_0x22bc('0x10d')],{'as':_0x22bc('0x169'),'foreignKey':_0x22bc('0x10c')});db[_0x22bc('0x66')][_0x22bc('0x120')](db[_0x22bc('0x16a')],{'through':'chat_interaction_has_tags','as':_0x22bc('0x179')});db[_0x22bc('0x66')]['belongsToMany'](db[_0x22bc('0x16a')],{'through':_0x22bc('0x192'),'as':'ThroughTags'});db['ChatInteraction'][_0x22bc('0x120')](db[_0x22bc('0x10d')],{'as':_0x22bc('0x16c'),'through':_0x22bc('0x193'),'foreignKey':'ChatInteractionId'});db[_0x22bc('0x67')]['belongsTo'](db[_0x22bc('0x10d')],{'onDelete':_0x22bc('0x10b'),'as':_0x22bc('0x10d')});db[_0x22bc('0x67')][_0x22bc('0x11c')](db['CmContact'],{'onDelete':_0x22bc('0x10b'),'as':_0x22bc('0x15b'),'foreignKey':_0x22bc('0x15c')});db[_0x22bc('0x67')][_0x22bc('0x11c')](db[_0x22bc('0x66')],{'onDelete':_0x22bc('0x10b'),'as':_0x22bc('0x16f'),'foreignKey':_0x22bc('0x191')});db[_0x22bc('0x67')][_0x22bc('0x11c')](db[_0x22bc('0xe4')],{'as':_0x22bc('0xe4'),'foreignKey':_0x22bc('0x17c')});db[_0x22bc('0x67')]['belongsTo'](db[_0x22bc('0x62')],{'as':'Account','foreignKey':_0x22bc('0x170')});db[_0x22bc('0x68')]['hasMany'](db[_0x22bc('0xe4')],{'as':_0x22bc('0x16e'),'foreignKey':_0x22bc('0x171'),'onDelete':'cascade','hooks':!![]});db[_0x22bc('0x68')][_0x22bc('0x11c')](db['CmContact'],{'onDelete':'cascade','as':_0x22bc('0x15b'),'foreignKey':_0x22bc('0x15c')});db[_0x22bc('0x68')][_0x22bc('0x11c')](db[_0x22bc('0x62')],{'as':_0x22bc('0x168'),'foreignKey':_0x22bc('0x170')});db[_0x22bc('0x69')][_0x22bc('0x120')](db[_0x22bc('0x10d')],{'as':_0x22bc('0x152'),'through':_0x22bc('0x2d'),'hooks':!![]});db[_0x22bc('0x69')][_0x22bc('0x120')](db[_0x22bc('0xdd')],{'through':_0x22bc('0x194'),'as':'Teams'});db[_0x22bc('0x6b')]['hasMany'](db[_0x22bc('0xc8')],{'as':_0x22bc('0x154'),'foreignKey':_0x22bc('0x195'),'onDelete':_0x22bc('0x10b')});db[_0x22bc('0x6b')][_0x22bc('0x120')](db[_0x22bc('0x10d')],{'as':_0x22bc('0x146'),'through':_0x22bc('0x11f')});db[_0x22bc('0x6d')][_0x22bc('0x11c')](db[_0x22bc('0x62')],{'as':_0x22bc('0x190'),'foreignKey':_0x22bc('0x170')});db[_0x22bc('0x6e')][_0x22bc('0x10e')](db['CmContact'],{'as':_0x22bc('0x121'),'foreignKey':'CompanyId'});db[_0x22bc('0x70')][_0x22bc('0x10e')](db['CmHopper'],{'as':'Hoppers','foreignKey':_0x22bc('0x15c')});db['CmContact'][_0x22bc('0x10e')](db[_0x22bc('0x74')],{'as':'HopperFinals','foreignKey':_0x22bc('0x15c')});db[_0x22bc('0x70')][_0x22bc('0x10e')](db[_0x22bc('0x113')],{'as':_0x22bc('0x149'),'foreignKey':_0x22bc('0x15c')});db[_0x22bc('0x70')][_0x22bc('0x10e')](db['ReportAgentPreview'],{'as':_0x22bc('0x77'),'foreignKey':'ContactId'});db[_0x22bc('0x70')]['hasMany'](db[_0x22bc('0xce')],{'as':_0x22bc('0x14b'),'foreignKey':'ContactId'});db[_0x22bc('0x70')][_0x22bc('0x10e')](db[_0x22bc('0x115')],{'as':_0x22bc('0x116'),'foreignKey':'ContactId','onDelete':_0x22bc('0x172')});db[_0x22bc('0x70')]['hasMany'](db[_0x22bc('0x66')],{'as':_0x22bc('0x117'),'foreignKey':_0x22bc('0x15c'),'onDelete':_0x22bc('0x172')});db[_0x22bc('0x70')][_0x22bc('0x10e')](db['SmsInteraction'],{'as':_0x22bc('0x127'),'foreignKey':_0x22bc('0x15c'),'onDelete':'restrict'});db['CmContact'][_0x22bc('0x10e')](db[_0x22bc('0x4d')],{'as':_0x22bc('0x119'),'foreignKey':_0x22bc('0x15c'),'onDelete':_0x22bc('0x172')});db['CmContact'][_0x22bc('0x10e')](db[_0x22bc('0x3e')],{'as':'MailInteractions','foreignKey':_0x22bc('0x15c'),'onDelete':'restrict'});db['CmContact'][_0x22bc('0x11c')](db[_0x22bc('0x6e')],{'as':_0x22bc('0x196'),'foreignKey':_0x22bc('0x197')});db['CmContact'][_0x22bc('0x11c')](db[_0x22bc('0x122')],{'as':'List','foreignKey':_0x22bc('0x165'),'onDelete':_0x22bc('0x10b')});db[_0x22bc('0x70')]['belongsToMany'](db[_0x22bc('0x10d')],{'as':_0x22bc('0x16c'),'through':_0x22bc('0x198')});db[_0x22bc('0x70')]['belongsToMany'](db[_0x22bc('0x16a')],{'as':'Tags','through':_0x22bc('0x199')});db['CmContact'][_0x22bc('0x120')](db['Tag'],{'through':_0x22bc('0x199'),'as':'ThroughTags'});db['CmHopper'][_0x22bc('0x11c')](db[_0x22bc('0x70')],{'as':_0x22bc('0x15b'),'foreignKey':_0x22bc('0x15c'),'onDelete':_0x22bc('0x10b')});db[_0x22bc('0x71')][_0x22bc('0x11c')](db[_0x22bc('0x122')],{'as':_0x22bc('0x164'),'foreignKey':_0x22bc('0x165'),'onDelete':'cascade'});db['CmHopper'][_0x22bc('0x11c')](db[_0x22bc('0x10d')],{'as':_0x22bc('0x18d'),'foreignKey':_0x22bc('0x10c')});db[_0x22bc('0x71')]['belongsTo'](db['VoiceQueue'],{'as':'Queue','foreignKey':_0x22bc('0x148'),'onDelete':_0x22bc('0x10b')});db['CmHopper']['belongsTo'](db[_0x22bc('0xe0')],{'as':_0x22bc('0xe0'),'foreignKey':'CampaignId','onDelete':_0x22bc('0x10b')});db[_0x22bc('0x71')]['belongsTo'](db[_0x22bc('0x10d')],{'as':_0x22bc('0x169'),'foreignKey':_0x22bc('0x19a')});db[_0x22bc('0x73')][_0x22bc('0x11c')](db[_0x22bc('0x70')],{'as':_0x22bc('0x15b'),'foreignKey':_0x22bc('0x15c'),'onDelete':'cascade'});db[_0x22bc('0x73')][_0x22bc('0x11c')](db[_0x22bc('0x122')],{'as':_0x22bc('0x164'),'foreignKey':_0x22bc('0x165'),'onDelete':_0x22bc('0x10b')});db[_0x22bc('0x73')][_0x22bc('0x11c')](db[_0x22bc('0x1a')],{'as':'Queue','foreignKey':_0x22bc('0x148'),'onDelete':'cascade'});db[_0x22bc('0x73')][_0x22bc('0x11c')](db['Campaign'],{'as':_0x22bc('0xe0'),'foreignKey':'CampaignId','onDelete':_0x22bc('0x10b')});db[_0x22bc('0x7b')][_0x22bc('0x10e')](db[_0x22bc('0x19b')],{'as':{'plural':_0x22bc('0x19c'),'singular':_0x22bc('0x19d')},'foreignKey':_0x22bc('0x19e'),'onDelete':'cascade','hooks':!![]});db[_0x22bc('0x7b')]['hasMany'](db[_0x22bc('0x19b')],{'as':{'plural':_0x22bc('0x19f'),'singular':_0x22bc('0x1a0')},'foreignKey':_0x22bc('0x1a1'),'onDelete':_0x22bc('0x10b'),'hooks':!![]});db[_0x22bc('0x7b')][_0x22bc('0x10e')](db[_0x22bc('0x79')],{'as':_0x22bc('0x1a2'),'foreignKey':_0x22bc('0x1a3'),'onDelete':_0x22bc('0x10b'),'hooks':!![]});db[_0x22bc('0x7d')][_0x22bc('0x10e')](db[_0x22bc('0x7d')],{'as':_0x22bc('0x160'),'foreignKey':'ParentId','onDelete':_0x22bc('0x10b')});db[_0x22bc('0x7f')][_0x22bc('0x10e')](db[_0x22bc('0x7f')],{'as':'Intervals','foreignKey':'IntervalId','onDelete':'cascade','hooks':!![],'required':![]});db[_0x22bc('0x7f')][_0x22bc('0x10e')](db[_0x22bc('0x17')],{'as':_0x22bc('0x111'),'foreignKey':_0x22bc('0x18b'),'onDelete':_0x22bc('0x172')});db['Interval'][_0x22bc('0x10e')](db[_0x22bc('0x42')],{'as':_0x22bc('0x1a4'),'foreignKey':_0x22bc('0x18b')});db['Interval']['hasMany'](db[_0x22bc('0x64')],{'as':_0x22bc('0x1a5'),'foreignKey':_0x22bc('0x18b')});db['Interval']['hasMany'](db['FaxApplication'],{'as':_0x22bc('0x1a6'),'foreignKey':_0x22bc('0x18b')});db[_0x22bc('0x7f')][_0x22bc('0x10e')](db[_0x22bc('0x54')],{'as':_0x22bc('0x1a7'),'foreignKey':'IntervalId'});db['Schedule'][_0x22bc('0x11c')](db[_0x22bc('0x38')],{});db[_0x22bc('0x1a8')][_0x22bc('0x11c')](db[_0x22bc('0x92')],{'foreignKey':_0x22bc('0x1a9')});db[_0x22bc('0x1a8')][_0x22bc('0x11c')](db['AnalyticCustomReport'],{'foreignKey':'CustomReportId'});db[_0x22bc('0x1aa')][_0x22bc('0x120')](db[_0x22bc('0x18')],{'as':_0x22bc('0x1ab'),'through':_0x22bc('0x1ac'),'onDelete':'restrict'});db[_0x22bc('0x16a')]['belongsToMany'](db[_0x22bc('0x70')],{'through':'cm_contact_has_tags'});db[_0x22bc('0x16a')][_0x22bc('0x120')](db[_0x22bc('0x66')],{'through':_0x22bc('0x192')});db[_0x22bc('0x16a')][_0x22bc('0x120')](db['MailInteraction'],{'through':'mail_interaction_has_tags'});db[_0x22bc('0x16a')][_0x22bc('0x120')](db[_0x22bc('0x118')],{'through':'sms_interaction_has_tags'});db[_0x22bc('0x16a')][_0x22bc('0x120')](db['FaxInteraction'],{'through':_0x22bc('0x178')});db[_0x22bc('0x16a')]['belongsToMany'](db['OpenchannelInteraction'],{'through':'openchannel_interaction_has_tags'});db[_0x22bc('0x16a')][_0x22bc('0x120')](db[_0x22bc('0xfd')],{'through':_0x22bc('0x1ad')});db[_0x22bc('0x89')]['hasMany'](db[_0x22bc('0x19b')],{'as':{'plural':_0x22bc('0x1ae'),'singular':_0x22bc('0x1af')},'foreignKey':_0x22bc('0x1b0'),'onDelete':'cascade','hooks':!![]});db[_0x22bc('0x89')][_0x22bc('0x10e')](db[_0x22bc('0x19b')],{'as':{'plural':_0x22bc('0x1b1'),'singular':_0x22bc('0x1b2')},'foreignKey':_0x22bc('0x1b3'),'onDelete':_0x22bc('0x10b'),'hooks':!![]});db[_0x22bc('0x89')][_0x22bc('0x10e')](db[_0x22bc('0x79')],{'as':_0x22bc('0x1a2'),'foreignKey':_0x22bc('0x1b4'),'onDelete':_0x22bc('0x10b'),'hooks':!![]});db[_0x22bc('0x90')][_0x22bc('0x10e')](db[_0x22bc('0x1b5')],{'as':'Fields','onDelete':_0x22bc('0x10b'),'foreignKey':_0x22bc('0x1b6'),'hooks':!![]});db[_0x22bc('0x92')][_0x22bc('0x10e')](db[_0x22bc('0x1b5')],{'as':_0x22bc('0x1b7'),'onDelete':_0x22bc('0x10b'),'foreignKey':_0x22bc('0x1a9')});db['AnalyticMetric']['hasMany'](db['AnalyticFieldReport'],{'as':_0x22bc('0x1b7'),'onDelete':'cascade','foreignKey':'MetricId'});db[_0x22bc('0x1b5')][_0x22bc('0x11c')](db[_0x22bc('0x96')],{'foreignKey':_0x22bc('0x1b8')});db[_0x22bc('0x9b')][_0x22bc('0x10e')](db['SalesforceConfiguration'],{'as':_0x22bc('0x1b9'),'onDelete':'cascade','foreignKey':'AccountId'});db['SalesforceConfiguration'][_0x22bc('0x10e')](db['SalesforceField'],{'as':_0x22bc('0x1ba'),'onDelete':_0x22bc('0x10b'),'foreignKey':_0x22bc('0x1bb')});db[_0x22bc('0x9c')][_0x22bc('0x10e')](db[_0x22bc('0x1bc')],{'as':_0x22bc('0x1bd'),'onDelete':_0x22bc('0x10b'),'foreignKey':'DescriptionId'});db[_0x22bc('0x9c')]['hasMany'](db[_0x22bc('0x1bc')],{'as':_0x22bc('0x1b7'),'onDelete':'cascade','foreignKey':'FieldId'});db[_0x22bc('0x9c')][_0x22bc('0x11c')](db[_0x22bc('0x9b')],{'as':_0x22bc('0x168'),'foreignKey':_0x22bc('0x1be')});db[_0x22bc('0x1bc')][_0x22bc('0x10e')](db[_0x22bc('0x1bc')],{'as':'Subject','foreignKey':_0x22bc('0x1bb')});db['SalesforceField'][_0x22bc('0x10e')](db[_0x22bc('0x1bc')],{'as':_0x22bc('0x1bf'),'foreignKey':_0x22bc('0x1c0')});db[_0x22bc('0x1bc')][_0x22bc('0x10e')](db[_0x22bc('0x1bc')],{'as':_0x22bc('0x1c1'),'foreignKey':_0x22bc('0x1c2')});db[_0x22bc('0x1bc')][_0x22bc('0x11c')](db[_0x22bc('0x8b')],{'as':'Variable','foreignKey':_0x22bc('0x1c3')});db[_0x22bc('0x1c4')][_0x22bc('0x10e')](db[_0x22bc('0x1c5')],{'as':_0x22bc('0x1b9'),'onDelete':_0x22bc('0x10b'),'foreignKey':_0x22bc('0x1be')});db[_0x22bc('0x1c5')]['hasMany'](db[_0x22bc('0xa0')],{'as':'Subjects','onDelete':'cascade','foreignKey':_0x22bc('0x1bb')});db[_0x22bc('0x1c5')][_0x22bc('0x10e')](db[_0x22bc('0xa0')],{'as':_0x22bc('0x1bd'),'onDelete':_0x22bc('0x10b'),'foreignKey':'DescriptionId'});db['SugarcrmConfiguration'][_0x22bc('0x10e')](db[_0x22bc('0xa0')],{'as':_0x22bc('0x1b7'),'onDelete':_0x22bc('0x10b'),'foreignKey':_0x22bc('0x1c2')});db['SugarcrmConfiguration'][_0x22bc('0x11c')](db['SugarcrmAccount'],{'as':_0x22bc('0x168'),'foreignKey':_0x22bc('0x1be')});db[_0x22bc('0xa0')]['hasMany'](db[_0x22bc('0xa0')],{'as':'Subject','foreignKey':'SubjectId'});db['SugarcrmField'][_0x22bc('0x10e')](db[_0x22bc('0xa0')],{'as':_0x22bc('0x1bf'),'foreignKey':'DescriptionId'});db[_0x22bc('0xa0')][_0x22bc('0x10e')](db[_0x22bc('0xa0')],{'as':'Field','foreignKey':_0x22bc('0x1c2')});db['SugarcrmField']['belongsTo'](db[_0x22bc('0x8b')],{'as':_0x22bc('0x8b'),'foreignKey':_0x22bc('0x1c3')});db[_0x22bc('0xa2')]['hasMany'](db['DeskConfiguration'],{'as':_0x22bc('0x1b9'),'onDelete':_0x22bc('0x10b'),'foreignKey':'AccountId'});db[_0x22bc('0x1c6')][_0x22bc('0x10e')](db[_0x22bc('0xa5')],{'as':_0x22bc('0x1ba'),'onDelete':_0x22bc('0x10b'),'foreignKey':_0x22bc('0x1bb')});db[_0x22bc('0x1c6')][_0x22bc('0x10e')](db['DeskField'],{'as':_0x22bc('0x1bd'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0x22bc('0x1c6')][_0x22bc('0x10e')](db[_0x22bc('0xa5')],{'as':_0x22bc('0x1b7'),'onDelete':_0x22bc('0x10b'),'foreignKey':_0x22bc('0x1c2')});db['DeskConfiguration']['belongsTo'](db[_0x22bc('0xa2')],{'as':'Account','foreignKey':_0x22bc('0x1be')});db[_0x22bc('0x1c6')]['belongsToMany'](db[_0x22bc('0x16a')],{'through':_0x22bc('0x1c7')});db[_0x22bc('0xa5')][_0x22bc('0x10e')](db['DeskField'],{'as':_0x22bc('0x1c8'),'foreignKey':_0x22bc('0x1bb')});db[_0x22bc('0xa5')][_0x22bc('0x10e')](db[_0x22bc('0xa5')],{'as':'Description','foreignKey':_0x22bc('0x1c0')});db[_0x22bc('0xa5')]['hasMany'](db[_0x22bc('0xa5')],{'as':_0x22bc('0x1c1'),'foreignKey':_0x22bc('0x1c2')});db[_0x22bc('0xa5')][_0x22bc('0x11c')](db[_0x22bc('0x8b')],{'as':'Variable','foreignKey':_0x22bc('0x1c3')});db[_0x22bc('0xa6')][_0x22bc('0x10e')](db[_0x22bc('0xa8')],{'as':_0x22bc('0x1b9'),'onDelete':_0x22bc('0x10b'),'foreignKey':'AccountId'});db[_0x22bc('0xa8')][_0x22bc('0x10e')](db[_0x22bc('0x1c9')],{'as':_0x22bc('0x1ba'),'onDelete':_0x22bc('0x10b'),'foreignKey':'SubjectId'});db[_0x22bc('0xa8')][_0x22bc('0x10e')](db[_0x22bc('0x1c9')],{'as':_0x22bc('0x1bd'),'onDelete':_0x22bc('0x10b'),'foreignKey':'DescriptionId'});db[_0x22bc('0xa8')][_0x22bc('0x10e')](db['ZohoField'],{'as':_0x22bc('0x1b7'),'onDelete':_0x22bc('0x10b'),'foreignKey':_0x22bc('0x1c2')});db['ZohoConfiguration']['belongsTo'](db[_0x22bc('0xa6')],{'as':'Account','foreignKey':_0x22bc('0x1be')});db['ZohoField'][_0x22bc('0x10e')](db[_0x22bc('0x1c9')],{'as':_0x22bc('0x1c8'),'foreignKey':_0x22bc('0x1bb')});db[_0x22bc('0x1c9')][_0x22bc('0x10e')](db[_0x22bc('0x1c9')],{'as':'Description','foreignKey':_0x22bc('0x1c0')});db[_0x22bc('0x1c9')][_0x22bc('0x10e')](db[_0x22bc('0x1c9')],{'as':_0x22bc('0x1c1'),'foreignKey':_0x22bc('0x1c2')});db[_0x22bc('0x1c9')][_0x22bc('0x11c')](db[_0x22bc('0x8b')],{'as':_0x22bc('0x8b'),'foreignKey':_0x22bc('0x1c3')});db['ZendeskAccount'][_0x22bc('0x10e')](db[_0x22bc('0xad')],{'as':'Configurations','onDelete':_0x22bc('0x10b'),'foreignKey':'AccountId'});db[_0x22bc('0xad')][_0x22bc('0x10e')](db['ZendeskField'],{'as':'Subjects','foreignKey':'SubjectId'});db[_0x22bc('0xad')][_0x22bc('0x10e')](db[_0x22bc('0x1ca')],{'as':_0x22bc('0x1bd'),'foreignKey':_0x22bc('0x1c0')});db[_0x22bc('0xad')][_0x22bc('0x10e')](db['ZendeskField'],{'as':_0x22bc('0x1b7'),'foreignKey':'FieldId'});db['ZendeskConfiguration'][_0x22bc('0x11c')](db['ZendeskAccount'],{'as':_0x22bc('0x168'),'foreignKey':_0x22bc('0x1be')});db[_0x22bc('0xad')]['belongsToMany'](db[_0x22bc('0x16a')],{'through':_0x22bc('0x1cb')});db[_0x22bc('0x1ca')]['hasMany'](db['ZendeskField'],{'as':_0x22bc('0x1c8'),'foreignKey':_0x22bc('0x1bb')});db[_0x22bc('0x1ca')][_0x22bc('0x10e')](db[_0x22bc('0x1ca')],{'as':_0x22bc('0x1bf'),'foreignKey':_0x22bc('0x1c0')});db['ZendeskField']['hasMany'](db[_0x22bc('0x1ca')],{'as':_0x22bc('0x1c1'),'foreignKey':_0x22bc('0x1c2')});db['ZendeskField'][_0x22bc('0x11c')](db[_0x22bc('0x8b')],{'as':_0x22bc('0x8b'),'foreignKey':'VariableId'});db[_0x22bc('0x1cc')][_0x22bc('0x10e')](db['FreshdeskConfiguration'],{'as':_0x22bc('0x1b9'),'onDelete':_0x22bc('0x10b'),'foreignKey':_0x22bc('0x1be')});db['FreshdeskConfiguration']['hasMany'](db[_0x22bc('0x1cd')],{'as':_0x22bc('0x1ba'),'onDelete':_0x22bc('0x10b'),'foreignKey':_0x22bc('0x1bb')});db[_0x22bc('0x1ce')][_0x22bc('0x10e')](db[_0x22bc('0x1cd')],{'as':_0x22bc('0x1bd'),'onDelete':'cascade','foreignKey':_0x22bc('0x1c0')});db[_0x22bc('0x1ce')][_0x22bc('0x10e')](db[_0x22bc('0x1cd')],{'as':_0x22bc('0x1b7'),'onDelete':_0x22bc('0x10b'),'foreignKey':_0x22bc('0x1c2')});db[_0x22bc('0x1ce')][_0x22bc('0x11c')](db['FreshdeskAccount'],{'as':'Account','foreignKey':_0x22bc('0x1be')});db[_0x22bc('0x1ce')]['belongsToMany'](db[_0x22bc('0x16a')],{'through':_0x22bc('0x1cf')});db['FreshdeskField'][_0x22bc('0x10e')](db[_0x22bc('0x1cd')],{'as':'Subject','foreignKey':_0x22bc('0x1bb')});db[_0x22bc('0x1cd')][_0x22bc('0x10e')](db['FreshdeskField'],{'as':_0x22bc('0x1bf'),'foreignKey':_0x22bc('0x1c0')});db[_0x22bc('0x1cd')][_0x22bc('0x10e')](db[_0x22bc('0x1cd')],{'as':_0x22bc('0x1c1'),'foreignKey':'FieldId'});db[_0x22bc('0x1cd')][_0x22bc('0x11c')](db[_0x22bc('0x8b')],{'as':'Variable','foreignKey':'VariableId'});db[_0x22bc('0xb0')][_0x22bc('0x10e')](db[_0x22bc('0xb2')],{'as':_0x22bc('0x1b9'),'onDelete':_0x22bc('0x10b'),'foreignKey':_0x22bc('0x1be')});db[_0x22bc('0xb2')][_0x22bc('0x10e')](db[_0x22bc('0xb4')],{'as':_0x22bc('0x1ba'),'foreignKey':'SubjectId'});db[_0x22bc('0xb2')][_0x22bc('0x10e')](db['VtigerField'],{'as':_0x22bc('0x1bd'),'foreignKey':_0x22bc('0x1c0')});db[_0x22bc('0xb2')][_0x22bc('0x10e')](db[_0x22bc('0xb4')],{'as':_0x22bc('0x1b7'),'foreignKey':'FieldId'});db['VtigerConfiguration']['belongsTo'](db[_0x22bc('0xb0')],{'as':_0x22bc('0x168'),'foreignKey':'AccountId'});db[_0x22bc('0xb4')]['hasMany'](db[_0x22bc('0xb4')],{'as':_0x22bc('0x1c8'),'foreignKey':_0x22bc('0x1bb')});db[_0x22bc('0xb4')][_0x22bc('0x10e')](db[_0x22bc('0xb4')],{'as':_0x22bc('0x1bf'),'foreignKey':_0x22bc('0x1c0')});db['VtigerField']['hasMany'](db['VtigerField'],{'as':'Field','foreignKey':_0x22bc('0x1c2')});db['VtigerField']['belongsTo'](db['Variable'],{'as':_0x22bc('0x8b'),'foreignKey':_0x22bc('0x1c3')});db[_0x22bc('0x1d0')]['hasMany'](db[_0x22bc('0xb7')],{'as':_0x22bc('0x1b9'),'onDelete':'cascade','foreignKey':_0x22bc('0x1be')});db['ServicenowConfiguration']['hasMany'](db[_0x22bc('0xb9')],{'as':_0x22bc('0x1ba'),'foreignKey':_0x22bc('0x1bb')});db[_0x22bc('0xb7')][_0x22bc('0x10e')](db[_0x22bc('0xb9')],{'as':'Descriptions','foreignKey':'DescriptionId'});db['ServicenowConfiguration']['hasMany'](db[_0x22bc('0xb9')],{'as':_0x22bc('0x1b7'),'foreignKey':_0x22bc('0x1c2')});db[_0x22bc('0xb7')][_0x22bc('0x11c')](db[_0x22bc('0x1d0')],{'as':'Account','foreignKey':_0x22bc('0x1be')});db[_0x22bc('0xb9')][_0x22bc('0x10e')](db[_0x22bc('0xb9')],{'as':_0x22bc('0x1c8'),'foreignKey':'SubjectId'});db[_0x22bc('0xb9')][_0x22bc('0x10e')](db['ServicenowField'],{'as':_0x22bc('0x1bf'),'foreignKey':_0x22bc('0x1c0')});db[_0x22bc('0xb9')][_0x22bc('0x10e')](db[_0x22bc('0xb9')],{'as':_0x22bc('0x1c1'),'foreignKey':_0x22bc('0x1c2')});db[_0x22bc('0xb9')][_0x22bc('0x11c')](db[_0x22bc('0x8b')],{'as':_0x22bc('0x8b'),'foreignKey':_0x22bc('0x1c3')});db[_0x22bc('0x1d1')]['hasMany'](db['Dynamics365Configuration'],{'as':_0x22bc('0x1b9'),'onDelete':_0x22bc('0x10b'),'foreignKey':_0x22bc('0x1be')});db[_0x22bc('0xbc')]['hasMany'](db['Dynamics365Field'],{'as':_0x22bc('0x1ba'),'onDelete':_0x22bc('0x10b'),'foreignKey':_0x22bc('0x1bb')});db['Dynamics365Configuration']['hasMany'](db[_0x22bc('0xbe')],{'as':_0x22bc('0x1bd'),'onDelete':'cascade','foreignKey':_0x22bc('0x1c0')});db['Dynamics365Configuration'][_0x22bc('0x10e')](db[_0x22bc('0xbe')],{'as':_0x22bc('0x1b7'),'onDelete':_0x22bc('0x10b'),'foreignKey':_0x22bc('0x1c2')});db[_0x22bc('0xbc')][_0x22bc('0x11c')](db[_0x22bc('0x1d1')],{'as':'Account','foreignKey':_0x22bc('0x1be')});db['Dynamics365Field'][_0x22bc('0x10e')](db[_0x22bc('0xbe')],{'as':'Subject','foreignKey':_0x22bc('0x1bb')});db[_0x22bc('0xbe')][_0x22bc('0x10e')](db[_0x22bc('0xbe')],{'as':_0x22bc('0x1bf'),'foreignKey':_0x22bc('0x1c0')});db[_0x22bc('0xbe')][_0x22bc('0x10e')](db[_0x22bc('0xbe')],{'as':_0x22bc('0x1c1'),'foreignKey':_0x22bc('0x1c2')});db['Dynamics365Field'][_0x22bc('0x11c')](db[_0x22bc('0x8b')],{'as':_0x22bc('0x8b'),'foreignKey':_0x22bc('0x1c3')});db[_0x22bc('0xbf')]['hasMany'](db[_0x22bc('0xc0')],{'as':'Configurations','onDelete':_0x22bc('0x10b'),'foreignKey':_0x22bc('0x1be')});db[_0x22bc('0xc0')]['hasMany'](db['FreshsalesField'],{'as':'Subjects','foreignKey':_0x22bc('0x1bb')});db['FreshsalesConfiguration'][_0x22bc('0x10e')](db[_0x22bc('0x1d2')],{'as':'Descriptions','foreignKey':_0x22bc('0x1c0')});db['FreshsalesConfiguration'][_0x22bc('0x10e')](db[_0x22bc('0x1d2')],{'as':_0x22bc('0x1b7'),'foreignKey':_0x22bc('0x1c2')});db['FreshsalesConfiguration'][_0x22bc('0x11c')](db[_0x22bc('0xbf')],{'as':_0x22bc('0x168'),'foreignKey':_0x22bc('0x1be')});db[_0x22bc('0x1d2')][_0x22bc('0x10e')](db[_0x22bc('0x1d2')],{'as':_0x22bc('0x1c8'),'foreignKey':'SubjectId'});db[_0x22bc('0x1d2')][_0x22bc('0x10e')](db[_0x22bc('0x1d2')],{'as':_0x22bc('0x1bf'),'foreignKey':_0x22bc('0x1c0')});db[_0x22bc('0x1d2')][_0x22bc('0x10e')](db[_0x22bc('0x1d2')],{'as':'Field','foreignKey':_0x22bc('0x1c2')});db[_0x22bc('0x1d2')][_0x22bc('0x11c')](db[_0x22bc('0x8b')],{'as':_0x22bc('0x8b'),'foreignKey':'VariableId'});db[_0x22bc('0xc6')]['belongsTo'](db[_0x22bc('0x62')],{});db[_0x22bc('0xc6')][_0x22bc('0x11c')](db['CmList'],{'as':'List','foreignKey':_0x22bc('0x165')});db['ChatQueueReport'][_0x22bc('0x11c')](db[_0x22bc('0x70')],{'as':_0x22bc('0x15b'),'foreignKey':_0x22bc('0x15c')});db[_0x22bc('0xc6')][_0x22bc('0x11c')](db[_0x22bc('0x66')],{});db['ChatQueueReport'][_0x22bc('0x11c')](db['ChatMessage'],{});db['ChatQueueReport']['belongsTo'](db['User'],{});db['ChatQueueReport'][_0x22bc('0x11c')](db[_0x22bc('0x69')],{});db['ChatInternalMessage'][_0x22bc('0x11c')](db[_0x22bc('0x10d')],{'onDelete':'cascade','foreignKey':'FromId'});db[_0x22bc('0xc8')][_0x22bc('0x11c')](db[_0x22bc('0x10d')],{'onDelete':'cascade','foreignKey':_0x22bc('0x1d3')});db[_0x22bc('0xce')][_0x22bc('0x10e')](db[_0x22bc('0xcc')],{'foreignKey':_0x22bc('0x1d4'),'onDelete':_0x22bc('0x10b')});db[_0x22bc('0xce')][_0x22bc('0x10e')](db[_0x22bc('0xca')],{'foreignKey':_0x22bc('0x1d4'),'onDelete':_0x22bc('0x10b')});db[_0x22bc('0x1d5')][_0x22bc('0x11c')](db[_0x22bc('0x52')],{});db[_0x22bc('0x1d5')][_0x22bc('0x11c')](db[_0x22bc('0x122')],{'as':_0x22bc('0x164'),'foreignKey':_0x22bc('0x165')});db[_0x22bc('0x1d5')][_0x22bc('0x11c')](db[_0x22bc('0x70')],{'as':_0x22bc('0x15b'),'foreignKey':_0x22bc('0x15c')});db['SmsQueueReport']['belongsTo'](db['SmsInteraction'],{});db[_0x22bc('0x1d5')][_0x22bc('0x11c')](db['SmsMessage'],{});db[_0x22bc('0x1d5')][_0x22bc('0x11c')](db[_0x22bc('0x10d')],{});db[_0x22bc('0x1d5')][_0x22bc('0x11c')](db['SmsQueue'],{});db['JscriptyProject']['hasMany'](db[_0x22bc('0xce')],{'foreignKey':_0x22bc('0x1d6')});db['JscriptyProject'][_0x22bc('0x10e')](db[_0x22bc('0xcc')],{'foreignKey':_0x22bc('0x1d6')});db[_0x22bc('0xd3')][_0x22bc('0x10e')](db['JscriptyAnswerReport'],{'foreignKey':'ProjectId'});db[_0x22bc('0xd8')][_0x22bc('0x120')](db['User'],{'as':'Users','through':_0x22bc('0x141')});db[_0x22bc('0xdd')]['belongsToMany'](db[_0x22bc('0x10d')],{'as':_0x22bc('0x152'),'through':'user_has_teams'});db['Team'][_0x22bc('0x120')](db[_0x22bc('0x1a')],{'through':_0x22bc('0x108'),'as':'VoiceQueues'});db[_0x22bc('0xdd')][_0x22bc('0x120')](db[_0x22bc('0x3a')],{'through':_0x22bc('0x167'),'as':'MailQueues'});db[_0x22bc('0xdd')][_0x22bc('0x120')](db['ChatQueue'],{'through':_0x22bc('0x194'),'as':_0x22bc('0x1d7')});db[_0x22bc('0xdd')][_0x22bc('0x120')](db[_0x22bc('0x17d')],{'through':_0x22bc('0x17e'),'as':_0x22bc('0x131')});db[_0x22bc('0xdd')]['belongsToMany'](db[_0x22bc('0x59')],{'through':_0x22bc('0x184'),'as':_0x22bc('0x132')});db[_0x22bc('0xdd')][_0x22bc('0x120')](db[_0x22bc('0x60')],{'through':'team_has_openchannel_queues','as':_0x22bc('0x133')});db[_0x22bc('0xdd')][_0x22bc('0x120')](db[_0x22bc('0x105')],{'through':_0x22bc('0x1d8'),'as':_0x22bc('0x1d9')});db[_0x22bc('0xdd')][_0x22bc('0x120')](db[_0x22bc('0x12d')],{'through':_0x22bc('0x109'),'as':_0x22bc('0x12e')});db[_0x22bc('0xe0')][_0x22bc('0x10e')](db[_0x22bc('0x71')],{'as':'Hoppers','foreignKey':'CampaignId'});db[_0x22bc('0xe0')][_0x22bc('0x10e')](db[_0x22bc('0x74')],{'as':_0x22bc('0x112'),'foreignKey':_0x22bc('0x1da')});db[_0x22bc('0xe0')][_0x22bc('0x10e')](db[_0x22bc('0x113')],{'as':_0x22bc('0x149'),'foreignKey':_0x22bc('0x1da')});db['Campaign'][_0x22bc('0x10e')](db['CmHopperBlack'],{'as':_0x22bc('0x14a'),'foreignKey':_0x22bc('0x1da')});db[_0x22bc('0xe0')][_0x22bc('0x11c')](db[_0x22bc('0x27')],{'as':_0x22bc('0x27'),'foreignKey':_0x22bc('0x14c')});db[_0x22bc('0xe0')][_0x22bc('0x11c')](db[_0x22bc('0x27')],{'as':'TrunkBackup','foreignKey':_0x22bc('0x14e')});db['Campaign'][_0x22bc('0x11c')](db[_0x22bc('0x7f')],{'as':'Interval','foreignKey':'IntervalId'});db[_0x22bc('0xe0')][_0x22bc('0x11c')](db[_0x22bc('0xd8')],{'as':_0x22bc('0xd8'),'foreignKey':_0x22bc('0x1db')});db[_0x22bc('0xe0')][_0x22bc('0x120')](db['CmList'],{'as':'Lists','through':'campaigns_has_cm_lists'});db[_0x22bc('0xe0')][_0x22bc('0x120')](db[_0x22bc('0x122')],{'as':_0x22bc('0x153'),'through':_0x22bc('0x1dc')});db['Attachment'][_0x22bc('0x11c')](db[_0x22bc('0x68')],{'as':_0x22bc('0x68'),'foreignKey':_0x22bc('0x171')});db[_0x22bc('0xe7')]['belongsTo'](db[_0x22bc('0x40')],{});db[_0x22bc('0xe7')][_0x22bc('0x11c')](db[_0x22bc('0x3e')],{});db[_0x22bc('0xe7')][_0x22bc('0x11c')](db[_0x22bc('0x38')],{'foreignKey':_0x22bc('0x1dd'),'as':'FromAccount'});db[_0x22bc('0xe7')][_0x22bc('0x11c')](db[_0x22bc('0x10d')],{'foreignKey':_0x22bc('0x1de'),'as':_0x22bc('0x1df')});db[_0x22bc('0xe7')][_0x22bc('0x11c')](db[_0x22bc('0x10d')],{'foreignKey':_0x22bc('0x1e0'),'as':_0x22bc('0x1e1')});db['MailTransferReport']['belongsTo'](db['MailQueue'],{'foreignKey':_0x22bc('0x1e2'),'as':_0x22bc('0x1e3')});db[_0x22bc('0xe7')][_0x22bc('0x11c')](db[_0x22bc('0x38')],{'foreignKey':_0x22bc('0x1e4'),'as':'ToAccount'});db[_0x22bc('0xe9')][_0x22bc('0x11c')](db['ChatMessage'],{});db['ChatTransferReport']['belongsTo'](db['ChatInteraction'],{});db[_0x22bc('0xe9')][_0x22bc('0x11c')](db[_0x22bc('0x62')],{'foreignKey':'FromChatWebsiteId','as':_0x22bc('0x1e5')});db[_0x22bc('0xe9')]['belongsTo'](db[_0x22bc('0x10d')],{'foreignKey':'FromUserId','as':_0x22bc('0x1df')});db['ChatTransferReport']['belongsTo'](db[_0x22bc('0x10d')],{'foreignKey':_0x22bc('0x1e0'),'as':_0x22bc('0x1e1')});db['ChatTransferReport']['belongsTo'](db['ChatQueue'],{'foreignKey':_0x22bc('0x1e6'),'as':_0x22bc('0x1e3')});db['ChatTransferReport'][_0x22bc('0x11c')](db[_0x22bc('0x62')],{'foreignKey':_0x22bc('0x1e7'),'as':_0x22bc('0x1e8')});db[_0x22bc('0xeb')][_0x22bc('0x11c')](db[_0x22bc('0x177')],{});db[_0x22bc('0xeb')]['belongsTo'](db[_0x22bc('0x4d')],{});db['FaxTransferReport'][_0x22bc('0x11c')](db['FaxAccount'],{'foreignKey':_0x22bc('0x1e9'),'as':_0x22bc('0x1e5')});db[_0x22bc('0xeb')][_0x22bc('0x11c')](db[_0x22bc('0x10d')],{'foreignKey':'FromUserId','as':_0x22bc('0x1df')});db['FaxTransferReport'][_0x22bc('0x11c')](db[_0x22bc('0x10d')],{'foreignKey':'ToUserId','as':'ToAgent'});db['FaxTransferReport'][_0x22bc('0x11c')](db['FaxQueue'],{'foreignKey':_0x22bc('0x1ea'),'as':_0x22bc('0x1e3')});db[_0x22bc('0xeb')][_0x22bc('0x11c')](db['FaxAccount'],{'foreignKey':_0x22bc('0x1eb'),'as':_0x22bc('0x1e8')});db[_0x22bc('0xed')]['belongsTo'](db['OpenchannelMessage'],{});db[_0x22bc('0xed')]['belongsTo'](db['OpenchannelInteraction'],{});db['OpenchannelTransferReport']['belongsTo'](db[_0x22bc('0x5b')],{'foreignKey':_0x22bc('0x1ec'),'as':'FromAccount'});db['OpenchannelTransferReport'][_0x22bc('0x11c')](db['User'],{'foreignKey':_0x22bc('0x1de'),'as':_0x22bc('0x1df')});db[_0x22bc('0xed')][_0x22bc('0x11c')](db[_0x22bc('0x10d')],{'foreignKey':_0x22bc('0x1e0'),'as':_0x22bc('0x1e1')});db[_0x22bc('0xed')][_0x22bc('0x11c')](db[_0x22bc('0x60')],{'foreignKey':_0x22bc('0x1ed'),'as':_0x22bc('0x1e3')});db[_0x22bc('0xed')][_0x22bc('0x11c')](db['OpenchannelAccount'],{'foreignKey':_0x22bc('0x1ee'),'as':_0x22bc('0x1e8')});db[_0x22bc('0xef')][_0x22bc('0x11c')](db[_0x22bc('0x57')],{});db[_0x22bc('0xef')][_0x22bc('0x11c')](db[_0x22bc('0x118')],{});db[_0x22bc('0xef')][_0x22bc('0x11c')](db[_0x22bc('0x52')],{'foreignKey':'FromSmsAccountId','as':_0x22bc('0x1e5')});db[_0x22bc('0xef')][_0x22bc('0x11c')](db[_0x22bc('0x10d')],{'foreignKey':_0x22bc('0x1de'),'as':_0x22bc('0x1df')});db['SmsTransferReport']['belongsTo'](db[_0x22bc('0x10d')],{'foreignKey':_0x22bc('0x1e0'),'as':_0x22bc('0x1e1')});db[_0x22bc('0xef')][_0x22bc('0x11c')](db[_0x22bc('0x59')],{'foreignKey':_0x22bc('0x1ef'),'as':_0x22bc('0x1e3')});db['SmsTransferReport'][_0x22bc('0x11c')](db[_0x22bc('0x52')],{'foreignKey':_0x22bc('0x1f0'),'as':_0x22bc('0x1e8')});db[_0x22bc('0x122')][_0x22bc('0x10e')](db['Disposition'],{'as':_0x22bc('0x160'),'foreignKey':_0x22bc('0x165'),'onDelete':_0x22bc('0x10b')});db[_0x22bc('0x122')][_0x22bc('0x10e')](db[_0x22bc('0x1f1')],{'as':_0x22bc('0x1f2'),'foreignKey':_0x22bc('0x165')});db[_0x22bc('0x122')][_0x22bc('0x10e')](db[_0x22bc('0x70')],{'as':'Contacts','onDelete':_0x22bc('0x10b'),'foreignKey':'ListId'});db[_0x22bc('0x122')][_0x22bc('0x10e')](db[_0x22bc('0x74')],{'as':_0x22bc('0x112'),'foreignKey':'ListId'});db[_0x22bc('0x122')]['hasMany'](db[_0x22bc('0x113')],{'as':_0x22bc('0x114'),'foreignKey':_0x22bc('0x165')});db[_0x22bc('0x122')][_0x22bc('0x10e')](db['ReportAgentPreview'],{'as':_0x22bc('0x77'),'foreignKey':_0x22bc('0x165')});db[_0x22bc('0x122')][_0x22bc('0x120')](db[_0x22bc('0x1a')],{'as':_0x22bc('0x1f3'),'through':_0x22bc('0x151')});db[_0x22bc('0x122')][_0x22bc('0x120')](db['User'],{'as':_0x22bc('0x152'),'through':_0x22bc('0x124')});db[_0x22bc('0x12d')][_0x22bc('0x10e')](db[_0x22bc('0x17')],{'as':'Extensions','onDelete':_0x22bc('0x10b')});db[_0x22bc('0x12d')][_0x22bc('0x120')](db['User'],{'as':'Agents','through':_0x22bc('0x10a')});db['VoicePrefix']['belongsToMany'](db[_0x22bc('0xdd')],{'through':_0x22bc('0x109'),'as':'Teams'});db['UserProfile']['hasMany'](db['User'],{'as':_0x22bc('0x16c'),'foreignKey':_0x22bc('0x11d')});db[_0x22bc('0xf3')]['hasMany'](db[_0x22bc('0xf5')],{'as':'UserProfileSections','foreignKey':_0x22bc('0x11d'),'onDelete':'cascade'});db['UserProfileSection'][_0x22bc('0x10e')](db[_0x22bc('0xf7')],{'as':_0x22bc('0x1f4'),'foreignKey':_0x22bc('0x1f5'),'onDelete':'cascade'});db['WhatsappAccount']['hasMany'](db[_0x22bc('0x7d')],{'as':_0x22bc('0x160'),'foreignKey':'WhatsappAccountId','onDelete':_0x22bc('0x10b')});db[_0x22bc('0xfa')]['hasMany'](db[_0x22bc('0x7c')],{'as':_0x22bc('0x162'),'foreignKey':_0x22bc('0x1f6')});db['WhatsappAccount'][_0x22bc('0x10e')](db[_0x22bc('0xff')],{'as':_0x22bc('0x154'),'foreignKey':_0x22bc('0x1f6')});db[_0x22bc('0xfa')][_0x22bc('0x10e')](db[_0x22bc('0xfd')],{'as':_0x22bc('0x163')});db[_0x22bc('0xfa')][_0x22bc('0x10e')](db[_0x22bc('0xfc')],{'as':_0x22bc('0x144')});db[_0x22bc('0xfa')][_0x22bc('0x11c')](db[_0x22bc('0x122')],{'as':'List','foreignKey':_0x22bc('0x165')});db['WhatsappAccount'][_0x22bc('0x11c')](db['Pause'],{'as':_0x22bc('0x14f'),'foreignKey':'mandatoryDispositionPauseId'});db['WhatsappAccount'][_0x22bc('0x120')](db[_0x22bc('0x10d')],{'as':_0x22bc('0x152'),'through':_0x22bc('0x1f7')});db[_0x22bc('0xfc')][_0x22bc('0x11c')](db[_0x22bc('0x10d')],{'onDelete':_0x22bc('0x172')});db[_0x22bc('0xfc')]['belongsTo'](db[_0x22bc('0x105')],{'onDelete':_0x22bc('0x172')});db[_0x22bc('0xfc')][_0x22bc('0x11c')](db['WhatsappAccount'],{'onDelete':'restrict'});db[_0x22bc('0xfc')][_0x22bc('0x11c')](db[_0x22bc('0x7f')],{'onDelete':_0x22bc('0x172'),'foreignKey':_0x22bc('0x18b')});db[_0x22bc('0xfc')]['belongsTo'](db[_0x22bc('0x16a')],{'onDelete':_0x22bc('0x172'),'foreignKey':_0x22bc('0x173')});db[_0x22bc('0xfd')]['hasMany'](db[_0x22bc('0xff')],{'as':'Messages','onDelete':_0x22bc('0x10b'),'foreignKey':_0x22bc('0x1f8')});db[_0x22bc('0xfd')][_0x22bc('0x11c')](db[_0x22bc('0xfa')],{'as':'Account','foreignKey':_0x22bc('0x1f6')});db['WhatsappInteraction'][_0x22bc('0x11c')](db['CmContact'],{'as':_0x22bc('0x15b'),'foreignKey':_0x22bc('0x15c')});db[_0x22bc('0xfd')][_0x22bc('0x11c')](db['User'],{'as':_0x22bc('0x169'),'foreignKey':'UserId'});db['WhatsappInteraction']['belongsToMany'](db[_0x22bc('0x16a')],{'through':'whatsapp_interaction_has_tags','as':_0x22bc('0x179')});db['WhatsappInteraction'][_0x22bc('0x120')](db[_0x22bc('0x16a')],{'through':_0x22bc('0x1ad'),'as':_0x22bc('0x17a')});db[_0x22bc('0xfd')][_0x22bc('0x120')](db[_0x22bc('0x10d')],{'as':_0x22bc('0x16c'),'through':_0x22bc('0x12b'),'foreignKey':_0x22bc('0x1f8')});db[_0x22bc('0xff')]['belongsTo'](db[_0x22bc('0x10d')],{'as':_0x22bc('0x10d')});db[_0x22bc('0xff')][_0x22bc('0x11c')](db[_0x22bc('0x70')],{'onDelete':'cascade','as':'Contact'});db[_0x22bc('0xff')][_0x22bc('0x11c')](db[_0x22bc('0xfd')],{'onDelete':_0x22bc('0x10b'),'as':_0x22bc('0x16f'),'foreignKey':_0x22bc('0x1f8')});db[_0x22bc('0xff')]['belongsTo'](db[_0x22bc('0xfa')],{'as':_0x22bc('0x168'),'foreignKey':_0x22bc('0x1f6')});db[_0x22bc('0x101')][_0x22bc('0x11c')](db[_0x22bc('0xfa')],{});db[_0x22bc('0x101')]['belongsTo'](db[_0x22bc('0x122')],{'as':'List','foreignKey':'ListId'});db[_0x22bc('0x101')][_0x22bc('0x11c')](db[_0x22bc('0x70')],{'as':'Contact','foreignKey':_0x22bc('0x15c')});db['WhatsappQueueReport']['belongsTo'](db[_0x22bc('0xfd')],{});db[_0x22bc('0x101')][_0x22bc('0x11c')](db[_0x22bc('0x105')],{});db[_0x22bc('0x101')][_0x22bc('0x11c')](db[_0x22bc('0xff')],{});db[_0x22bc('0x101')]['belongsTo'](db['User'],{});db[_0x22bc('0x103')][_0x22bc('0x11c')](db[_0x22bc('0xff')],{});db['WhatsappTransferReport']['belongsTo'](db[_0x22bc('0xfd')],{});db[_0x22bc('0x103')][_0x22bc('0x11c')](db[_0x22bc('0xfa')],{'foreignKey':_0x22bc('0x1f9'),'as':'FromAccount'});db['WhatsappTransferReport'][_0x22bc('0x11c')](db['WhatsappAccount'],{'foreignKey':'ToWhatsappAccountId','as':_0x22bc('0x1e8')});db[_0x22bc('0x103')][_0x22bc('0x11c')](db['WhatsappQueue'],{'foreignKey':_0x22bc('0x1fa'),'as':'ToQueue'});db[_0x22bc('0x103')][_0x22bc('0x11c')](db[_0x22bc('0x10d')],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0x22bc('0x103')]['belongsTo'](db[_0x22bc('0x10d')],{'foreignKey':_0x22bc('0x1e0'),'as':_0x22bc('0x1e1')});db['WhatsappQueue'][_0x22bc('0x120')](db[_0x22bc('0x10d')],{'as':_0x22bc('0x152'),'through':_0x22bc('0x33'),'foreignKey':'WhatsappQueueId'});db[_0x22bc('0x105')][_0x22bc('0x120')](db[_0x22bc('0xdd')],{'through':_0x22bc('0x1d8'),'as':_0x22bc('0x17f')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file +var _0xd70d=['FaxQueue','../api/faxQueue/faxQueue.model','../api/faxQueueReport/faxQueueReport.model','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','../api/openchannelQueue/openchannelQueue.model','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','Template','../api/template/template.model','Trigger','Variable','Integration','../api/integration/integration.model','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','../api/intDeskField/intDeskField.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','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','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','Network','../api/network/network.model','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','../api/cmList/cmList.model','../api/voicePrefix/voicePrefix.model','UserProfile','UserProfileSection','UserProfileResource','UserNotification','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','hasOne','VoiceMail','cascade','UserId','hasMany','VoiceRecording','VoiceQueuesRt','Extensions','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteraction','MailInteraction','WhatsappInteraction','WhatsappInteractions','UserNotifications','SenderId','belongsTo','ChatGroup','chat_group_has_users','belongsToMany','CmList','cm_user_has_lists','user_has_teams','MailInteractions','user_has_mail_interactions','user_has_chat_interactions','FaxInteractions','user_has_fax_interactions','user_has_sms_interactions','OpenchannelInteraction','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueue','VoiceQueues','UserVoiceQueue','VoicePrefix','FaxQueues','SmsQueues','OpenchannelQueue','OpenchannelQueues','WhatsappQueues','VoicePrefixes','ChatWebsite','ChatWebsites','user_has_chat_websites','FaxAccounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','SmsAccounts','SquareProjects','user_has_square_projects','SpiedAgents','ChanSpyId','VoiceContext','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','HopperFinals','HopperHistories','HopperBlacks','JscriptySessions','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPause','voice_queues_has_cm_lists','Agents','Teams','BlackLists','mailbox','mailboxuser','uniqueid','Contact','ContactId','MailAccountId','Imap','Smtp','Dispositions','Answers','Messages','Interactions','List','ListId','TemplateId','team_has_mail_queues','MailInteractionId','Account','Owner','Tag','mail_interaction_has_tags','Tags','Users','Interaction','ChatWebsiteId','restrict','TagId','MailQueueReport','Dashboard','FaxAccountId','Exntensions','mandatoryDispositionPauseId','user_has_fax_accounts','FaxInteractionId','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','FaxQueueReport','SmsAccount','SmsAccountId','SmsMessage','user_has_sms_accounts','SmsInteractionId','sms_interaction_has_tags','ThroughTags','team_has_sms_queues','OpenchannelAccountId','OpenchannelInteractionId','openchannel_interaction_has_tags','OpenchannelQueueId','team_has_openchannel_queues','Agent','Queue','ChatQueueId','chat_interaction_has_tags','ChatInteractionId','ChatMessage','ChatOfflineMessageId','team_has_chat_queues','CmCompany','Company','cm_user_has_contacts','cm_contact_has_tags','Campaign','CampaignId','OwnerId','OneAll','AutomationAllId','Any','OneAny','AutomationId','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','DefaultReportId','Mohs','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','Actions','TriggerId','Fields','CustomReportId','MetricId','Configurations','Subjects','DescriptionId','FieldId','AccountId','SubjectId','Description','Field','VariableId','SugarcrmAccount','SugarcrmField','Subject','DeskField','Descriptions','int_desk_configuration_has_tags','ZohoAccount','FreshdeskField','int_freshdesk_configuration_has_tags','Dynamics365Account','Dynamics365Field','ChatQueueReport','FromId','ToId','JscriptyQuestionReport','SessionId','ProjectId','ChatQueues','team_has_whatsapp_queues','TeamVoicePrefix','Hoppers','SquareProjectId','Lists','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromUserId','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToMailAccountId','FromChatWebsiteId','FromAccount','ToChatQueueId','ToQueue','ToAccount','ToFaxQueueId','ToFaxAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','SmsTransferReport','ToSmsQueueId','ToSmsAccountId','Contacts','Queues','userProfileId','UserProfileSections','sectionId','WhatsappAccountId','user_has_whatsapp_accounts','WhatsappInteractionId','whatsapp_interaction_has_tags','FromWhatsappAccountId','ToWhatsappAccountId','UserWhatsappQueue','WhatsappQueueId','../config/environment','sequelize','lodash','determine','defaultsDeep','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','motion2','xcall','database','username','password','options','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','ScreenRecording','../api/screenRecording/screenRecording.model','../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','UserVoiceQueueRt','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','UserFaxQueue','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','DashboardItem','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model'];(function(_0x3602c9,_0x48e6d0){var _0xf5f6a9=function(_0x43f3da){while(--_0x43f3da){_0x3602c9['push'](_0x3602c9['shift']());}};_0xf5f6a9(++_0x48e6d0);}(_0xd70d,0x1ab));var _0xdd70=function(_0x145b5d,_0x1e87a1){_0x145b5d=_0x145b5d-0x0;var _0xed463=_0xd70d[_0x145b5d];return _0xed463;};'use strict';var config=require(_0xdd70('0x0'));var Sequelize=require(_0xdd70('0x1'));var _=require(_0xdd70('0x2'));var jstz=require('jstz');var timezone=jstz[_0xdd70('0x3')]();config[_0xdd70('0x1')]=_[_0xdd70('0x4')](config['sequelize'],{'database':'motion2','username':'xcall','password':_0xdd70('0x5'),'options':{'host':_0xdd70('0x6'),'port':0xcea,'dialect':_0xdd70('0x7'),'dialectOptions':{'charset':_0xdd70('0x8')},'logging':![],'timezone':timezone[_0xdd70('0x9')](),'define':{'charset':_0xdd70('0xa'),'collate':_0xdd70('0xb')}}});config[_0xdd70('0xc')]=_['defaultsDeep'](config['sequelizeHistory'],{'database':_0xdd70('0xd'),'username':_0xdd70('0xe'),'password':_0xdd70('0x5'),'options':{'host':_0xdd70('0x6'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0xdd70('0x8')},'logging':![],'timezone':timezone[_0xdd70('0x9')](),'define':{'charset':_0xdd70('0xa'),'collate':_0xdd70('0xb')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xdd70('0x1')][_0xdd70('0xf')],config[_0xdd70('0x1')][_0xdd70('0x10')],config['sequelize']['password'],config[_0xdd70('0x1')]['options'])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xdd70('0xc')]['database'],config['sequelizeHistory'][_0xdd70('0x10')],config['sequelizeHistory'][_0xdd70('0x11')],config[_0xdd70('0xc')][_0xdd70('0x12')])};db[_0xdd70('0x13')]=db[_0xdd70('0x1')][_0xdd70('0x14')](_0xdd70('0x15'));db[_0xdd70('0x16')]=db[_0xdd70('0x1')][_0xdd70('0x14')](_0xdd70('0x17'));db['VoiceContext']=db[_0xdd70('0x1')]['import'](_0xdd70('0x18'));db[_0xdd70('0x19')]=db[_0xdd70('0x1')][_0xdd70('0x14')](_0xdd70('0x1a'));db[_0xdd70('0x1b')]=db[_0xdd70('0x1')][_0xdd70('0x14')]('../api/voiceMusicOnHold/voiceMusicOnHold.model');db['VoiceQueue']=db[_0xdd70('0x1')]['import']('../api/voiceQueue/voiceQueue.model');db['VoiceRecording']=db[_0xdd70('0x1')]['import']('../api/voiceRecording/voiceRecording.model');db[_0xdd70('0x1c')]=db[_0xdd70('0x1')]['import'](_0xdd70('0x1d'));db['VoiceMail']=db[_0xdd70('0x1')][_0xdd70('0x14')](_0xdd70('0x1e'));db[_0xdd70('0x1f')]=db[_0xdd70('0x1')][_0xdd70('0x14')](_0xdd70('0x20'));db[_0xdd70('0x21')]=db[_0xdd70('0x1')][_0xdd70('0x14')](_0xdd70('0x22'));db[_0xdd70('0x23')]=db['sequelize'][_0xdd70('0x14')](_0xdd70('0x24'));db[_0xdd70('0x25')]=db[_0xdd70('0x1')][_0xdd70('0x14')]('../api/voiceAgentReport/voiceAgentReport.model');db[_0xdd70('0x26')]=db[_0xdd70('0x1')][_0xdd70('0x14')](_0xdd70('0x27'));db[_0xdd70('0x28')]=db[_0xdd70('0x1')][_0xdd70('0x14')](_0xdd70('0x29'));db[_0xdd70('0x2a')]=db[_0xdd70('0x1')][_0xdd70('0x14')](_0xdd70('0x2b'));db[_0xdd70('0x2c')]=db['sequelize']['import'](_0xdd70('0x2d'));db[_0xdd70('0x2e')]=db[_0xdd70('0x1')][_0xdd70('0x14')]('../api/userVoiceQueueRt/userVoiceQueueRt.model');db['UserVoiceQueue']=db[_0xdd70('0x1')][_0xdd70('0x14')](_0xdd70('0x2f'));db[_0xdd70('0x30')]=db[_0xdd70('0x1')][_0xdd70('0x14')](_0xdd70('0x31'));db[_0xdd70('0x32')]=db['sequelize'][_0xdd70('0x14')]('../api/userMailQueue/userMailQueue.model');db[_0xdd70('0x33')]=db[_0xdd70('0x1')][_0xdd70('0x14')]('../api/userFaxQueue/userFaxQueue.model');db[_0xdd70('0x34')]=db[_0xdd70('0x1')]['import'](_0xdd70('0x35'));db[_0xdd70('0x36')]=db['sequelize'][_0xdd70('0x14')]('../api/userOpenchannelQueue/userOpenchannelQueue.model');db['UserWhatsappQueue']=db[_0xdd70('0x1')][_0xdd70('0x14')](_0xdd70('0x37'));db[_0xdd70('0x38')]=db[_0xdd70('0x1')][_0xdd70('0x14')](_0xdd70('0x39'));db[_0xdd70('0x3a')]=db[_0xdd70('0x1')]['import'](_0xdd70('0x3b'));db[_0xdd70('0x3c')]=db['sequelize'][_0xdd70('0x14')](_0xdd70('0x3d'));db[_0xdd70('0x3e')]=db['sequelize'][_0xdd70('0x14')]('../api/mailQueue/mailQueue.model');db[_0xdd70('0x3f')]=db['sequelize']['import'](_0xdd70('0x40'));db['MailInteraction']=db[_0xdd70('0x1')][_0xdd70('0x14')](_0xdd70('0x41'));db[_0xdd70('0x42')]=db['sequelize']['import'](_0xdd70('0x43'));db[_0xdd70('0x44')]=db[_0xdd70('0x1')][_0xdd70('0x14')]('../api/mailApplication/mailApplication.model');db['MailQueueReport']=db[_0xdd70('0x1')][_0xdd70('0x14')](_0xdd70('0x45'));db['Dashboard']=db['sequelize']['import'](_0xdd70('0x46'));db[_0xdd70('0x47')]=db['sequelize'][_0xdd70('0x14')]('../api/dashboardItem/dashboardItem.model');db[_0xdd70('0x48')]=db[_0xdd70('0x1')][_0xdd70('0x14')](_0xdd70('0x49'));db[_0xdd70('0x4a')]=db['sequelize'][_0xdd70('0x14')](_0xdd70('0x4b'));db['FaxInteraction']=db['sequelize'][_0xdd70('0x14')](_0xdd70('0x4c'));db[_0xdd70('0x4d')]=db[_0xdd70('0x1')][_0xdd70('0x14')](_0xdd70('0x4e'));db[_0xdd70('0x4f')]=db[_0xdd70('0x1')][_0xdd70('0x14')](_0xdd70('0x50'));db['FaxQueueReport']=db[_0xdd70('0x1')][_0xdd70('0x14')](_0xdd70('0x51'));db['SmsAccount']=db['sequelize'][_0xdd70('0x14')](_0xdd70('0x52'));db[_0xdd70('0x53')]=db[_0xdd70('0x1')]['import'](_0xdd70('0x54'));db[_0xdd70('0x55')]=db['sequelize'][_0xdd70('0x14')](_0xdd70('0x56'));db['SmsMessage']=db['sequelize'][_0xdd70('0x14')](_0xdd70('0x57'));db[_0xdd70('0x58')]=db['sequelize']['import'](_0xdd70('0x59'));db[_0xdd70('0x5a')]=db[_0xdd70('0x1')][_0xdd70('0x14')](_0xdd70('0x5b'));db[_0xdd70('0x5c')]=db[_0xdd70('0x1')]['import']('../api/openchannelApplication/openchannelApplication.model');db['OpenchannelInteraction']=db['sequelize'][_0xdd70('0x14')](_0xdd70('0x5d'));db[_0xdd70('0x5e')]=db['sequelize'][_0xdd70('0x14')](_0xdd70('0x5f'));db['OpenchannelQueue']=db[_0xdd70('0x1')]['import'](_0xdd70('0x60'));db['ChatWebsite']=db[_0xdd70('0x1')][_0xdd70('0x14')](_0xdd70('0x61'));db[_0xdd70('0x62')]=db[_0xdd70('0x1')][_0xdd70('0x14')](_0xdd70('0x63'));db[_0xdd70('0x64')]=db[_0xdd70('0x1')][_0xdd70('0x14')](_0xdd70('0x65'));db[_0xdd70('0x66')]=db[_0xdd70('0x1')]['import'](_0xdd70('0x67'));db['ChatMessage']=db['sequelize'][_0xdd70('0x14')]('../api/chatMessage/chatMessage.model');db[_0xdd70('0x68')]=db[_0xdd70('0x1')][_0xdd70('0x14')](_0xdd70('0x69'));db[_0xdd70('0x6a')]=db['sequelize'][_0xdd70('0x14')](_0xdd70('0x6b'));db['ChatGroup']=db['sequelize'][_0xdd70('0x14')](_0xdd70('0x6c'));db[_0xdd70('0x6d')]=db[_0xdd70('0x1')][_0xdd70('0x14')](_0xdd70('0x6e'));db['CmCompany']=db['sequelize'][_0xdd70('0x14')](_0xdd70('0x6f'));db[_0xdd70('0x70')]=db['sequelize'][_0xdd70('0x14')](_0xdd70('0x71'));db[_0xdd70('0x72')]=db['sequelize'][_0xdd70('0x14')](_0xdd70('0x73'));db[_0xdd70('0x74')]=db[_0xdd70('0x1')][_0xdd70('0x14')](_0xdd70('0x75'));db[_0xdd70('0x76')]=db['sequelize'][_0xdd70('0x14')](_0xdd70('0x77'));db[_0xdd70('0x78')]=db[_0xdd70('0x1')]['import'](_0xdd70('0x79'));db[_0xdd70('0x7a')]=db[_0xdd70('0x1')][_0xdd70('0x14')](_0xdd70('0x7b'));db[_0xdd70('0x7c')]=db[_0xdd70('0x1')][_0xdd70('0x14')]('../api/cmCustomField/cmCustomField.model');db['Action']=db[_0xdd70('0x1')][_0xdd70('0x14')]('../api/action/action.model');db[_0xdd70('0x7d')]=db['sequelize']['import'](_0xdd70('0x7e'));db[_0xdd70('0x7f')]=db[_0xdd70('0x1')][_0xdd70('0x14')](_0xdd70('0x80'));db[_0xdd70('0x81')]=db[_0xdd70('0x1')]['import'](_0xdd70('0x82'));db[_0xdd70('0x83')]=db['sequelize']['import'](_0xdd70('0x84'));db[_0xdd70('0x85')]=db[_0xdd70('0x1')][_0xdd70('0x14')](_0xdd70('0x86'));db[_0xdd70('0x87')]=db[_0xdd70('0x1')]['import'](_0xdd70('0x88'));db[_0xdd70('0x89')]=db['sequelize'][_0xdd70('0x14')](_0xdd70('0x8a'));db[_0xdd70('0x8b')]=db[_0xdd70('0x1')][_0xdd70('0x14')](_0xdd70('0x8c'));db[_0xdd70('0x8d')]=db['sequelize'][_0xdd70('0x14')](_0xdd70('0x8e'));db[_0xdd70('0x8f')]=db[_0xdd70('0x1')][_0xdd70('0x14')]('../api/sound/sound.model');db['Tag']=db['sequelize']['import']('../api/tag/tag.model');db[_0xdd70('0x90')]=db['sequelize'][_0xdd70('0x14')](_0xdd70('0x91'));db[_0xdd70('0x92')]=db[_0xdd70('0x1')][_0xdd70('0x14')]('../api/trigger/trigger.model');db[_0xdd70('0x93')]=db[_0xdd70('0x1')][_0xdd70('0x14')]('../api/variable/variable.model');db[_0xdd70('0x94')]=db[_0xdd70('0x1')][_0xdd70('0x14')](_0xdd70('0x95'));db['IntegrationReport']=db[_0xdd70('0x1')]['import'](_0xdd70('0x96'));db[_0xdd70('0x97')]=db[_0xdd70('0x1')][_0xdd70('0x14')](_0xdd70('0x98'));db[_0xdd70('0x99')]=db[_0xdd70('0x1')][_0xdd70('0x14')](_0xdd70('0x9a'));db[_0xdd70('0x9b')]=db[_0xdd70('0x1')][_0xdd70('0x14')](_0xdd70('0x9c'));db[_0xdd70('0x9d')]=db[_0xdd70('0x1')][_0xdd70('0x14')](_0xdd70('0x9e'));db[_0xdd70('0x9f')]=db[_0xdd70('0x1')][_0xdd70('0x14')](_0xdd70('0xa0'));db[_0xdd70('0xa1')]=db[_0xdd70('0x1')][_0xdd70('0x14')](_0xdd70('0xa2'));db[_0xdd70('0xa3')]=db['sequelize'][_0xdd70('0x14')](_0xdd70('0xa4'));db[_0xdd70('0xa5')]=db['sequelize']['import'](_0xdd70('0xa6'));db[_0xdd70('0xa7')]=db['sequelize']['import'](_0xdd70('0xa8'));db['SugarcrmAccount']=db['sequelize']['import'](_0xdd70('0xa9'));db[_0xdd70('0xaa')]=db[_0xdd70('0x1')][_0xdd70('0x14')]('../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model');db['SugarcrmField']=db[_0xdd70('0x1')][_0xdd70('0x14')](_0xdd70('0xab'));db[_0xdd70('0xac')]=db['sequelize'][_0xdd70('0x14')](_0xdd70('0xad'));db[_0xdd70('0xae')]=db['sequelize'][_0xdd70('0x14')](_0xdd70('0xaf'));db['DeskField']=db['sequelize'][_0xdd70('0x14')](_0xdd70('0xb0'));db['ZohoAccount']=db[_0xdd70('0x1')][_0xdd70('0x14')]('../api/intZohoAccount/intZohoAccount.model');db[_0xdd70('0xb1')]=db[_0xdd70('0x1')]['import'](_0xdd70('0xb2'));db[_0xdd70('0xb3')]=db[_0xdd70('0x1')][_0xdd70('0x14')](_0xdd70('0xb4'));db[_0xdd70('0xb5')]=db['sequelize']['import'](_0xdd70('0xb6'));db[_0xdd70('0xb7')]=db[_0xdd70('0x1')]['import'](_0xdd70('0xb8'));db[_0xdd70('0xb9')]=db[_0xdd70('0x1')][_0xdd70('0x14')]('../api/intZendeskField/intZendeskField.model');db[_0xdd70('0xba')]=db['sequelize'][_0xdd70('0x14')](_0xdd70('0xbb'));db[_0xdd70('0xbc')]=db[_0xdd70('0x1')][_0xdd70('0x14')](_0xdd70('0xbd'));db['FreshdeskField']=db['sequelize']['import'](_0xdd70('0xbe'));db[_0xdd70('0xbf')]=db[_0xdd70('0x1')][_0xdd70('0x14')](_0xdd70('0xc0'));db[_0xdd70('0xc1')]=db['sequelize'][_0xdd70('0x14')](_0xdd70('0xc2'));db[_0xdd70('0xc3')]=db['sequelize'][_0xdd70('0x14')](_0xdd70('0xc4'));db[_0xdd70('0xc5')]=db[_0xdd70('0x1')][_0xdd70('0x14')](_0xdd70('0xc6'));db[_0xdd70('0xc7')]=db['sequelize'][_0xdd70('0x14')](_0xdd70('0xc8'));db[_0xdd70('0xc9')]=db[_0xdd70('0x1')][_0xdd70('0x14')](_0xdd70('0xca'));db['Dynamics365Account']=db[_0xdd70('0x1')]['import']('../api/intDynamics365Account/intDynamics365Account.model');db[_0xdd70('0xcb')]=db[_0xdd70('0x1')][_0xdd70('0x14')](_0xdd70('0xcc'));db['Dynamics365Field']=db[_0xdd70('0x1')][_0xdd70('0x14')](_0xdd70('0xcd'));db[_0xdd70('0xce')]=db[_0xdd70('0x1')][_0xdd70('0x14')](_0xdd70('0xcf'));db[_0xdd70('0xd0')]=db[_0xdd70('0x1')][_0xdd70('0x14')](_0xdd70('0xd1'));db[_0xdd70('0xd2')]=db[_0xdd70('0x1')][_0xdd70('0x14')]('../api/intFreshsalesField/intFreshsalesField.model');db[_0xdd70('0x94')]=db[_0xdd70('0x1')][_0xdd70('0x14')](_0xdd70('0x95'));db[_0xdd70('0xd3')]=db['sequelize']['import'](_0xdd70('0xd4'));db['ChatQueueReport']=db[_0xdd70('0x1')][_0xdd70('0x14')](_0xdd70('0xd5'));db[_0xdd70('0xd6')]=db[_0xdd70('0x1')][_0xdd70('0x14')](_0xdd70('0xd7'));db[_0xdd70('0xd8')]=db[_0xdd70('0x1')]['import'](_0xdd70('0xd9'));db['JscriptyQuestionReport']=db[_0xdd70('0x1')][_0xdd70('0x14')](_0xdd70('0xda'));db[_0xdd70('0xdb')]=db[_0xdd70('0x1')][_0xdd70('0x14')](_0xdd70('0xdc'));db[_0xdd70('0xdd')]=db['sequelize'][_0xdd70('0x14')](_0xdd70('0xde'));db[_0xdd70('0xdf')]=db[_0xdd70('0x1')][_0xdd70('0x14')](_0xdd70('0xe0'));db[_0xdd70('0xe1')]=db['sequelize'][_0xdd70('0x14')](_0xdd70('0xe2'));db[_0xdd70('0xe3')]=db[_0xdd70('0x1')][_0xdd70('0x14')](_0xdd70('0xe4'));db[_0xdd70('0xe5')]=db[_0xdd70('0x1')][_0xdd70('0x14')](_0xdd70('0xe6'));db[_0xdd70('0xe7')]=db[_0xdd70('0x1')]['import'](_0xdd70('0xe8'));db[_0xdd70('0xe9')]=db[_0xdd70('0x1')][_0xdd70('0x14')](_0xdd70('0xea'));db['SquareRecording']=db[_0xdd70('0x1')][_0xdd70('0x14')](_0xdd70('0xeb'));db[_0xdd70('0xec')]=db['sequelize']['import'](_0xdd70('0xed'));db[_0xdd70('0xee')]=db[_0xdd70('0x1')][_0xdd70('0x14')](_0xdd70('0xef'));db[_0xdd70('0xf0')]=db[_0xdd70('0x1')]['import'](_0xdd70('0xf1'));db['Campaign']=db['sequelize'][_0xdd70('0x14')]('../api/campaign/campaign.model');db['Migration']=db[_0xdd70('0x1')][_0xdd70('0x14')](_0xdd70('0xf2'));db[_0xdd70('0xf3')]=db[_0xdd70('0x1')][_0xdd70('0x14')](_0xdd70('0xf4'));db[_0xdd70('0xf5')]=db['sequelize'][_0xdd70('0x14')](_0xdd70('0xf6'));db[_0xdd70('0xf7')]=db['sequelize'][_0xdd70('0x14')](_0xdd70('0xf8'));db[_0xdd70('0xf9')]=db[_0xdd70('0x1')][_0xdd70('0x14')](_0xdd70('0xfa'));db[_0xdd70('0xfb')]=db[_0xdd70('0x1')][_0xdd70('0x14')](_0xdd70('0xfc'));db[_0xdd70('0xfd')]=db['sequelize'][_0xdd70('0x14')](_0xdd70('0xfe'));db['SmsTransferReport']=db[_0xdd70('0x1')][_0xdd70('0x14')]('../api/smsTransferReport/smsTransferReport.model');db['CmList']=db[_0xdd70('0x1')][_0xdd70('0x14')](_0xdd70('0xff'));db['VoicePrefix']=db[_0xdd70('0x1')]['import'](_0xdd70('0x100'));db[_0xdd70('0x101')]=db['sequelize']['import']('../api/userProfile/userProfile.model');db[_0xdd70('0x102')]=db[_0xdd70('0x1')][_0xdd70('0x14')]('../api/userProfileSection/userProfileSection.model');db[_0xdd70('0x103')]=db['sequelize'][_0xdd70('0x14')]('../api/userProfileResource/userProfileResource.model');db[_0xdd70('0x104')]=db[_0xdd70('0x1')][_0xdd70('0x14')]('../api/userNotification/userNotification.model');db[_0xdd70('0x105')]=db[_0xdd70('0x1')]['import'](_0xdd70('0x106'));db[_0xdd70('0x107')]=db[_0xdd70('0x1')]['import'](_0xdd70('0x108'));db['WhatsappInteraction']=db[_0xdd70('0x1')][_0xdd70('0x14')](_0xdd70('0x109'));db[_0xdd70('0x10a')]=db[_0xdd70('0x1')][_0xdd70('0x14')](_0xdd70('0x10b'));db[_0xdd70('0x10c')]=db['sequelize']['import'](_0xdd70('0x10d'));db[_0xdd70('0x10e')]=db[_0xdd70('0x1')][_0xdd70('0x14')]('../api/whatsappTransferReport/whatsappTransferReport.model');db[_0xdd70('0x10f')]=db[_0xdd70('0x1')]['import'](_0xdd70('0x110'));db['CloudProvider']=db[_0xdd70('0x1')][_0xdd70('0x14')](_0xdd70('0x111'));db[_0xdd70('0x112')]=db[_0xdd70('0x1')]['import']('../api/teamVoiceQueue/teamVoiceQueue.model');db['TeamVoicePrefix']=db[_0xdd70('0x1')]['import'](_0xdd70('0x113'));db[_0xdd70('0x114')]=db[_0xdd70('0x1')]['import'](_0xdd70('0x115'));db[_0xdd70('0x13')][_0xdd70('0x116')](db[_0xdd70('0x117')],{'as':'VoiceMail','onDelete':_0xdd70('0x118'),'foreignKey':_0xdd70('0x119')});db['User'][_0xdd70('0x11a')](db[_0xdd70('0x11b')],{'as':'Recordings','foreignKey':_0xdd70('0x119')});db[_0xdd70('0x13')]['hasMany'](db['UserVoiceQueueRt'],{'as':_0xdd70('0x11c'),'foreignKey':'UserId'});db[_0xdd70('0x13')][_0xdd70('0x11a')](db[_0xdd70('0x19')],{'as':_0xdd70('0x11d'),'onDelete':'cascade','hooks':!![]});db[_0xdd70('0x13')][_0xdd70('0x11a')](db[_0xdd70('0x76')],{'as':'HopperFinals','foreignKey':_0xdd70('0x119')});db[_0xdd70('0x13')]['hasMany'](db[_0xdd70('0x78')],{'as':_0xdd70('0x11e'),'foreignKey':_0xdd70('0x119')});db[_0xdd70('0x13')]['hasMany'](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0xdd70('0x119')});db[_0xdd70('0x13')]['hasMany'](db['OpenchannelInteraction'],{'as':_0xdd70('0x11f'),'foreignKey':_0xdd70('0x119')});db[_0xdd70('0x13')][_0xdd70('0x11a')](db[_0xdd70('0x66')],{'as':_0xdd70('0x120'),'foreignKey':_0xdd70('0x119')});db['User'][_0xdd70('0x11a')](db[_0xdd70('0x55')],{'as':_0xdd70('0x121'),'foreignKey':_0xdd70('0x119')});db['User']['hasMany'](db[_0xdd70('0x122')],{'as':'FaxInteractions','foreignKey':_0xdd70('0x119')});db['User'][_0xdd70('0x11a')](db[_0xdd70('0x123')],{'as':'MailInteractions','foreignKey':_0xdd70('0x119')});db['User'][_0xdd70('0x11a')](db[_0xdd70('0x124')],{'as':_0xdd70('0x125'),'foreignKey':_0xdd70('0x119')});db[_0xdd70('0x13')][_0xdd70('0x11a')](db[_0xdd70('0x104')],{'as':_0xdd70('0x126'),'foreignKey':_0xdd70('0x127')});db['User'][_0xdd70('0x128')](db[_0xdd70('0x101')],{'as':_0xdd70('0x101'),'foreignKey':'userProfileId'});db['User']['belongsToMany'](db[_0xdd70('0x129')],{'as':'Groups','through':_0xdd70('0x12a')});db[_0xdd70('0x13')][_0xdd70('0x12b')](db[_0xdd70('0x70')],{'as':'Contacts','through':'cm_user_has_contacts'});db[_0xdd70('0x13')][_0xdd70('0x12b')](db[_0xdd70('0x12c')],{'as':'Lists','through':_0xdd70('0x12d')});db[_0xdd70('0x13')][_0xdd70('0x12b')](db[_0xdd70('0xee')],{'through':_0xdd70('0x12e')});db['User'][_0xdd70('0x12b')](db['MailInteraction'],{'as':_0xdd70('0x12f'),'through':_0xdd70('0x130')});db[_0xdd70('0x13')][_0xdd70('0x12b')](db[_0xdd70('0x66')],{'as':_0xdd70('0x120'),'through':_0xdd70('0x131')});db[_0xdd70('0x13')][_0xdd70('0x12b')](db[_0xdd70('0x122')],{'as':_0xdd70('0x132'),'through':_0xdd70('0x133')});db[_0xdd70('0x13')]['belongsToMany'](db['SmsInteraction'],{'as':_0xdd70('0x121'),'through':_0xdd70('0x134')});db[_0xdd70('0x13')]['belongsToMany'](db[_0xdd70('0x135')],{'as':_0xdd70('0x11f'),'through':_0xdd70('0x136')});db['User']['belongsToMany'](db[_0xdd70('0x124')],{'as':'WhatsappInteractions','through':_0xdd70('0x137')});db[_0xdd70('0x13')][_0xdd70('0x12b')](db[_0xdd70('0x138')],{'as':_0xdd70('0x139'),'through':_0xdd70('0x13a'),'required':![]});db[_0xdd70('0x13')][_0xdd70('0x12b')](db[_0xdd70('0x13b')],{'as':'VoicePrefixes','through':_0xdd70('0x114'),'required':![]});db['User'][_0xdd70('0x12b')](db[_0xdd70('0x3e')],{'as':'MailQueues','through':_0xdd70('0x32'),'required':![]});db['User'][_0xdd70('0x12b')](db[_0xdd70('0x6a')],{'as':'ChatQueues','through':_0xdd70('0x30'),'required':![],'hooks':!![]});db[_0xdd70('0x13')][_0xdd70('0x12b')](db[_0xdd70('0x4f')],{'as':_0xdd70('0x13c'),'through':_0xdd70('0x33'),'required':![]});db[_0xdd70('0x13')][_0xdd70('0x12b')](db['SmsQueue'],{'as':_0xdd70('0x13d'),'through':_0xdd70('0x34'),'required':![]});db[_0xdd70('0x13')]['belongsToMany'](db[_0xdd70('0x13e')],{'as':_0xdd70('0x13f'),'through':_0xdd70('0x36'),'required':![]});db[_0xdd70('0x13')][_0xdd70('0x12b')](db['WhatsappQueue'],{'as':_0xdd70('0x140'),'through':'UserWhatsappQueue','required':![]});db[_0xdd70('0x13')]['belongsToMany'](db[_0xdd70('0x12c')],{'through':'cm_user_has_lists'});db[_0xdd70('0x13')][_0xdd70('0x12b')](db[_0xdd70('0x13b')],{'as':_0xdd70('0x141'),'through':'user_has_voice_prefixes','required':![]});db[_0xdd70('0x13')]['belongsToMany'](db[_0xdd70('0x142')],{'as':_0xdd70('0x143'),'through':_0xdd70('0x144')});db[_0xdd70('0x13')][_0xdd70('0x12b')](db[_0xdd70('0x48')],{'as':_0xdd70('0x145'),'through':'user_has_fax_accounts'});db[_0xdd70('0x13')]['belongsToMany'](db[_0xdd70('0x3c')],{'as':_0xdd70('0x146'),'through':_0xdd70('0x147')});db[_0xdd70('0x13')][_0xdd70('0x12b')](db[_0xdd70('0x5a')],{'as':_0xdd70('0x148'),'through':'user_has_openchannel_accounts'});db[_0xdd70('0x13')][_0xdd70('0x12b')](db['SmsAccount'],{'as':_0xdd70('0x149'),'through':'user_has_sms_accounts'});db[_0xdd70('0x13')]['belongsToMany'](db[_0xdd70('0x105')],{'as':'WhatsappAccounts','through':'user_has_whatsapp_accounts'});db['User'][_0xdd70('0x12b')](db[_0xdd70('0xe9')],{'as':_0xdd70('0x14a'),'through':_0xdd70('0x14b')});db['VoiceChanSpy']['hasMany'](db[_0xdd70('0x19')],{'as':_0xdd70('0x14c'),'onDelete':'cascade','foreignKey':_0xdd70('0x14d')});db[_0xdd70('0x14e')]['hasMany'](db[_0xdd70('0x19')],{'onDelete':_0xdd70('0x118')});db['VoiceExtension'][_0xdd70('0x11a')](db['VoiceExtension'],{'as':_0xdd70('0x14f'),'onDelete':'cascade'});db[_0xdd70('0x1b')][_0xdd70('0x12b')](db['Sound'],{'as':_0xdd70('0x150'),'through':_0xdd70('0x151')});db[_0xdd70('0x138')][_0xdd70('0x11a')](db[_0xdd70('0x2e')],{'as':_0xdd70('0x152'),'foreignKey':_0xdd70('0x153')});db['VoiceQueue'][_0xdd70('0x11a')](db['CmHopper'],{'as':'Hoppers','foreignKey':_0xdd70('0x153')});db[_0xdd70('0x138')][_0xdd70('0x11a')](db[_0xdd70('0x76')],{'as':_0xdd70('0x154'),'foreignKey':_0xdd70('0x153')});db[_0xdd70('0x138')][_0xdd70('0x11a')](db[_0xdd70('0x78')],{'as':_0xdd70('0x155'),'foreignKey':_0xdd70('0x153')});db[_0xdd70('0x138')][_0xdd70('0x11a')](db[_0xdd70('0x7a')],{'as':_0xdd70('0x7a'),'foreignKey':'VoiceQueueId'});db[_0xdd70('0x138')][_0xdd70('0x11a')](db['CmHopperBlack'],{'as':_0xdd70('0x156'),'foreignKey':_0xdd70('0x153')});db['VoiceQueue']['hasMany'](db[_0xdd70('0xdb')],{'as':_0xdd70('0x157'),'foreignKey':_0xdd70('0x153')});db['VoiceQueue'][_0xdd70('0x128')](db[_0xdd70('0x2a')],{'as':_0xdd70('0x2a'),'foreignKey':_0xdd70('0x158')});db[_0xdd70('0x138')][_0xdd70('0x128')](db['Trunk'],{'as':_0xdd70('0x159'),'foreignKey':_0xdd70('0x15a')});db[_0xdd70('0x138')]['belongsTo'](db['Interval'],{'as':_0xdd70('0x85'),'foreignKey':_0xdd70('0x15b')});db[_0xdd70('0x138')]['belongsTo'](db[_0xdd70('0x87')],{'as':_0xdd70('0x15c'),'foreignKey':'mandatoryDispositionPauseId'});db['VoiceQueue'][_0xdd70('0x12b')](db[_0xdd70('0x12c')],{'as':'Lists','through':_0xdd70('0x15d')});db[_0xdd70('0x138')]['belongsToMany'](db['User'],{'as':_0xdd70('0x15e'),'through':_0xdd70('0x13a')});db[_0xdd70('0x138')]['belongsToMany'](db[_0xdd70('0xee')],{'as':_0xdd70('0x15f'),'through':_0xdd70('0x112')});db['VoiceQueue'][_0xdd70('0x12b')](db[_0xdd70('0x12c')],{'as':_0xdd70('0x160'),'through':'voice_queues_has_cm_blacklists'});db[_0xdd70('0x11b')][_0xdd70('0x128')](db[_0xdd70('0x13')],{'as':'User','foreignKey':'UserId'});db[_0xdd70('0x1c')][_0xdd70('0x128')](db['User'],{'as':_0xdd70('0x13'),'foreignKey':_0xdd70('0x119')});db[_0xdd70('0x117')]['hasMany'](db[_0xdd70('0x1f')],{'as':'Messages','onDelete':_0xdd70('0x118'),'foreignKey':'mailboxuser','sourceKey':_0xdd70('0x161')});db[_0xdd70('0x1f')][_0xdd70('0x128')](db['VoiceMail'],{'foreignKey':_0xdd70('0x162'),'targetKey':_0xdd70('0x161')});db[_0xdd70('0x21')][_0xdd70('0x11a')](db[_0xdd70('0x26')],{'as':'QueueCalls','foreignKey':_0xdd70('0x163'),'constraints':![]});db['VoiceCallReport'][_0xdd70('0x11a')](db['VoiceAgentReport'],{'as':'AgentReports','foreignKey':'uniqueid','constraints':![]});db[_0xdd70('0x21')][_0xdd70('0x128')](db[_0xdd70('0x13')],{'as':_0xdd70('0x13'),'foreignKey':_0xdd70('0x119')});db[_0xdd70('0x21')]['belongsTo'](db[_0xdd70('0x70')],{'as':_0xdd70('0x164'),'foreignKey':_0xdd70('0x165')});db[_0xdd70('0x38')]['belongsTo'](db[_0xdd70('0x3c')],{'as':_0xdd70('0x3c'),'foreignKey':_0xdd70('0x166')});db[_0xdd70('0x3a')]['belongsTo'](db[_0xdd70('0x3c')],{'as':_0xdd70('0x3c'),'foreignKey':_0xdd70('0x166')});db['MailAccount']['hasOne'](db[_0xdd70('0x38')],{'as':_0xdd70('0x167'),'onDelete':_0xdd70('0x118')});db['MailAccount'][_0xdd70('0x116')](db['MailServerOut'],{'as':_0xdd70('0x168'),'onDelete':'cascade'});db[_0xdd70('0x3c')][_0xdd70('0x11a')](db[_0xdd70('0x81')],{'as':_0xdd70('0x169'),'foreignKey':'MailAccountId','onDelete':_0xdd70('0x118')});db[_0xdd70('0x3c')][_0xdd70('0x11a')](db[_0xdd70('0x7f')],{'as':_0xdd70('0x16a'),'foreignKey':'MailAccountId'});db[_0xdd70('0x3c')]['hasMany'](db[_0xdd70('0x42')],{'as':_0xdd70('0x16b'),'foreignKey':_0xdd70('0x166')});db[_0xdd70('0x3c')][_0xdd70('0x11a')](db[_0xdd70('0x123')],{'as':_0xdd70('0x16c')});db[_0xdd70('0x3c')][_0xdd70('0x11a')](db[_0xdd70('0x44')],{'as':_0xdd70('0x14f')});db[_0xdd70('0x3c')][_0xdd70('0x128')](db[_0xdd70('0x12c')],{'as':_0xdd70('0x16d'),'foreignKey':_0xdd70('0x16e')});db['MailAccount'][_0xdd70('0x128')](db[_0xdd70('0x90')],{'as':'Template','foreignKey':_0xdd70('0x16f')});db[_0xdd70('0x3c')][_0xdd70('0x128')](db[_0xdd70('0x87')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0xdd70('0x3c')]['belongsToMany'](db[_0xdd70('0x13')],{'as':'Agents','through':_0xdd70('0x147')});db[_0xdd70('0x3e')][_0xdd70('0x12b')](db[_0xdd70('0x13')],{'as':_0xdd70('0x15e'),'through':'UserMailQueue'});db[_0xdd70('0x3e')][_0xdd70('0x12b')](db[_0xdd70('0xee')],{'through':_0xdd70('0x170'),'as':'Teams'});db[_0xdd70('0x123')][_0xdd70('0x11a')](db[_0xdd70('0x42')],{'as':_0xdd70('0x16b'),'onDelete':_0xdd70('0x118'),'foreignKey':_0xdd70('0x171')});db[_0xdd70('0x123')]['belongsTo'](db[_0xdd70('0x3c')],{'as':_0xdd70('0x172'),'foreignKey':_0xdd70('0x166')});db[_0xdd70('0x123')][_0xdd70('0x128')](db[_0xdd70('0x70')],{'as':_0xdd70('0x164'),'foreignKey':_0xdd70('0x165')});db[_0xdd70('0x123')][_0xdd70('0x128')](db[_0xdd70('0x13')],{'as':_0xdd70('0x173'),'foreignKey':_0xdd70('0x119')});db[_0xdd70('0x123')][_0xdd70('0x12b')](db[_0xdd70('0x174')],{'through':_0xdd70('0x175'),'as':_0xdd70('0x176')});db[_0xdd70('0x123')][_0xdd70('0x12b')](db['Tag'],{'through':_0xdd70('0x175'),'as':'ThroughTags'});db[_0xdd70('0x123')][_0xdd70('0x12b')](db[_0xdd70('0x13')],{'as':_0xdd70('0x177'),'through':_0xdd70('0x130'),'foreignKey':'MailInteractionId'});db[_0xdd70('0x42')][_0xdd70('0x11a')](db[_0xdd70('0xf3')],{'as':'Attachments','onDelete':_0xdd70('0x118')});db[_0xdd70('0x42')][_0xdd70('0x128')](db[_0xdd70('0x13')],{'as':_0xdd70('0x13')});db['MailMessage'][_0xdd70('0x128')](db[_0xdd70('0x70')],{'onDelete':'cascade','as':_0xdd70('0x164')});db[_0xdd70('0x42')]['belongsTo'](db[_0xdd70('0x123')],{'as':_0xdd70('0x178'),'foreignKey':_0xdd70('0x171')});db[_0xdd70('0x42')][_0xdd70('0x128')](db[_0xdd70('0x3c')],{'as':_0xdd70('0x172'),'foreignKey':_0xdd70('0x166')});db[_0xdd70('0x42')][_0xdd70('0x128')](db[_0xdd70('0x142')],{'as':_0xdd70('0x142'),'foreignKey':_0xdd70('0x179')});db[_0xdd70('0x42')]['belongsTo'](db[_0xdd70('0x68')],{'as':'ChatOfflineMessage','foreignKey':'ChatOfflineMessageId'});db[_0xdd70('0x44')]['belongsTo'](db['User'],{'onDelete':_0xdd70('0x17a')});db['MailApplication'][_0xdd70('0x128')](db[_0xdd70('0x3e')],{'onDelete':_0xdd70('0x17a')});db['MailApplication'][_0xdd70('0x128')](db[_0xdd70('0x3c')],{'onDelete':_0xdd70('0x17a')});db[_0xdd70('0x44')][_0xdd70('0x128')](db[_0xdd70('0x85')],{'onDelete':'restrict','foreignKey':_0xdd70('0x15b')});db[_0xdd70('0x44')]['belongsTo'](db[_0xdd70('0x174')],{'onDelete':'restrict','foreignKey':_0xdd70('0x17b')});db[_0xdd70('0x17c')][_0xdd70('0x128')](db[_0xdd70('0x3c')],{});db[_0xdd70('0x17c')][_0xdd70('0x128')](db['CmList'],{'as':_0xdd70('0x16d'),'foreignKey':_0xdd70('0x16e')});db[_0xdd70('0x17c')][_0xdd70('0x128')](db[_0xdd70('0x70')],{'as':_0xdd70('0x164'),'foreignKey':_0xdd70('0x165')});db[_0xdd70('0x17c')]['belongsTo'](db[_0xdd70('0x123')],{});db[_0xdd70('0x17c')]['belongsTo'](db[_0xdd70('0x42')],{});db[_0xdd70('0x17c')]['belongsTo'](db[_0xdd70('0x13')],{});db[_0xdd70('0x17c')][_0xdd70('0x128')](db[_0xdd70('0x3e')],{});db[_0xdd70('0x17d')][_0xdd70('0x11a')](db[_0xdd70('0x47')],{'as':'Items','onDelete':_0xdd70('0x118')});db[_0xdd70('0x48')][_0xdd70('0x11a')](db['Disposition'],{'as':_0xdd70('0x169'),'foreignKey':_0xdd70('0x17e'),'onDelete':_0xdd70('0x118')});db[_0xdd70('0x48')][_0xdd70('0x11a')](db[_0xdd70('0x7f')],{'as':_0xdd70('0x16a'),'foreignKey':_0xdd70('0x17e')});db[_0xdd70('0x48')][_0xdd70('0x11a')](db[_0xdd70('0x122')],{'as':_0xdd70('0x16c')});db[_0xdd70('0x48')][_0xdd70('0x11a')](db[_0xdd70('0x4a')],{'as':'Applications'});db[_0xdd70('0x48')][_0xdd70('0x11a')](db[_0xdd70('0x19')],{'as':_0xdd70('0x17f'),'onDelete':_0xdd70('0x118')});db[_0xdd70('0x48')][_0xdd70('0x11a')](db[_0xdd70('0x4d')],{'as':_0xdd70('0x16b')});db[_0xdd70('0x48')][_0xdd70('0x128')](db[_0xdd70('0x2a')],{'as':'Trunk'});db[_0xdd70('0x48')][_0xdd70('0x128')](db[_0xdd70('0x12c')],{'as':_0xdd70('0x16d'),'foreignKey':_0xdd70('0x16e')});db[_0xdd70('0x48')][_0xdd70('0x128')](db['Pause'],{'as':_0xdd70('0x15c'),'foreignKey':_0xdd70('0x180')});db['FaxAccount']['belongsToMany'](db[_0xdd70('0x13')],{'as':_0xdd70('0x15e'),'through':_0xdd70('0x181')});db['FaxApplication'][_0xdd70('0x128')](db[_0xdd70('0x13')],{'onDelete':'restrict'});db[_0xdd70('0x4a')][_0xdd70('0x128')](db[_0xdd70('0x4f')],{'onDelete':_0xdd70('0x17a')});db[_0xdd70('0x4a')]['belongsTo'](db['FaxAccount'],{'onDelete':_0xdd70('0x17a')});db['FaxApplication']['belongsTo'](db['Tag'],{'onDelete':'restrict','foreignKey':'TagId'});db[_0xdd70('0x122')][_0xdd70('0x11a')](db['FaxMessage'],{'as':_0xdd70('0x16b'),'onDelete':'cascade','foreignKey':_0xdd70('0x182')});db[_0xdd70('0x122')]['belongsTo'](db[_0xdd70('0x48')],{'as':_0xdd70('0x172'),'foreignKey':_0xdd70('0x17e')});db['FaxInteraction'][_0xdd70('0x128')](db[_0xdd70('0x70')],{'as':_0xdd70('0x164'),'foreignKey':_0xdd70('0x165')});db[_0xdd70('0x122')][_0xdd70('0x128')](db[_0xdd70('0x13')],{'as':_0xdd70('0x173'),'foreignKey':_0xdd70('0x119')});db[_0xdd70('0x122')][_0xdd70('0x12b')](db[_0xdd70('0x174')],{'through':_0xdd70('0x183'),'as':_0xdd70('0x176')});db[_0xdd70('0x122')][_0xdd70('0x12b')](db[_0xdd70('0x174')],{'through':_0xdd70('0x183'),'as':'ThroughTags'});db['FaxInteraction'][_0xdd70('0x12b')](db[_0xdd70('0x13')],{'as':_0xdd70('0x177'),'through':_0xdd70('0x133'),'foreignKey':_0xdd70('0x182')});db[_0xdd70('0x4d')][_0xdd70('0x128')](db[_0xdd70('0x13')],{'onDelete':_0xdd70('0x118'),'as':'User'});db[_0xdd70('0x4d')][_0xdd70('0x128')](db['FaxInteraction'],{'as':_0xdd70('0x178'),'foreignKey':'FaxInteractionId'});db[_0xdd70('0x4d')][_0xdd70('0x128')](db[_0xdd70('0x70')],{'onDelete':_0xdd70('0x118'),'as':_0xdd70('0x164')});db['FaxMessage'][_0xdd70('0x128')](db[_0xdd70('0xf3')],{'as':_0xdd70('0xf3'),'foreignKey':_0xdd70('0x184')});db['FaxMessage'][_0xdd70('0x128')](db['FaxAccount'],{'as':_0xdd70('0x172'),'foreignKey':'FaxAccountId'});db[_0xdd70('0x4f')][_0xdd70('0x12b')](db['User'],{'as':_0xdd70('0x15e'),'through':_0xdd70('0x33')});db[_0xdd70('0x4f')]['belongsToMany'](db['Team'],{'through':_0xdd70('0x185'),'as':_0xdd70('0x15f')});db['FaxQueueReport']['belongsTo'](db[_0xdd70('0x48')],{});db[_0xdd70('0x186')][_0xdd70('0x128')](db[_0xdd70('0x12c')],{'as':_0xdd70('0x16d'),'foreignKey':_0xdd70('0x16e')});db['FaxQueueReport'][_0xdd70('0x128')](db['CmContact'],{'as':_0xdd70('0x164'),'foreignKey':'ContactId'});db[_0xdd70('0x186')][_0xdd70('0x128')](db['FaxInteraction'],{});db[_0xdd70('0x186')][_0xdd70('0x128')](db[_0xdd70('0x4d')],{});db[_0xdd70('0x186')][_0xdd70('0x128')](db[_0xdd70('0x13')],{});db[_0xdd70('0x186')][_0xdd70('0x128')](db[_0xdd70('0x4f')],{});db[_0xdd70('0x187')][_0xdd70('0x11a')](db[_0xdd70('0x81')],{'as':_0xdd70('0x169'),'foreignKey':_0xdd70('0x188'),'onDelete':'cascade'});db[_0xdd70('0x187')]['hasMany'](db['CannedAnswer'],{'as':'Answers','foreignKey':'SmsAccountId'});db[_0xdd70('0x187')]['hasMany'](db[_0xdd70('0x189')],{'as':'Messages','foreignKey':'SmsAccountId'});db['SmsAccount']['hasMany'](db[_0xdd70('0x55')],{'as':_0xdd70('0x16c')});db[_0xdd70('0x187')][_0xdd70('0x11a')](db[_0xdd70('0x53')],{'as':_0xdd70('0x14f')});db[_0xdd70('0x187')][_0xdd70('0x128')](db[_0xdd70('0x12c')],{'as':_0xdd70('0x16d'),'foreignKey':_0xdd70('0x16e')});db[_0xdd70('0x187')]['belongsTo'](db[_0xdd70('0x87')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0xdd70('0x187')]['belongsToMany'](db[_0xdd70('0x13')],{'as':_0xdd70('0x15e'),'through':_0xdd70('0x18a')});db[_0xdd70('0x53')][_0xdd70('0x128')](db[_0xdd70('0x13')],{'onDelete':_0xdd70('0x17a')});db[_0xdd70('0x53')][_0xdd70('0x128')](db['SmsQueue'],{'onDelete':_0xdd70('0x17a')});db[_0xdd70('0x53')][_0xdd70('0x128')](db[_0xdd70('0x187')],{'onDelete':_0xdd70('0x17a')});db['SmsApplication']['belongsTo'](db[_0xdd70('0x85')],{'onDelete':_0xdd70('0x17a'),'foreignKey':_0xdd70('0x15b')});db[_0xdd70('0x53')][_0xdd70('0x128')](db[_0xdd70('0x174')],{'onDelete':_0xdd70('0x17a'),'foreignKey':_0xdd70('0x17b')});db[_0xdd70('0x55')]['hasMany'](db['SmsMessage'],{'as':_0xdd70('0x16b'),'onDelete':_0xdd70('0x118'),'foreignKey':_0xdd70('0x18b')});db[_0xdd70('0x55')][_0xdd70('0x128')](db['SmsAccount'],{'as':_0xdd70('0x172'),'foreignKey':_0xdd70('0x188')});db[_0xdd70('0x55')][_0xdd70('0x128')](db[_0xdd70('0x70')],{'as':'Contact','foreignKey':'ContactId'});db[_0xdd70('0x55')]['belongsTo'](db[_0xdd70('0x13')],{'as':_0xdd70('0x173'),'foreignKey':_0xdd70('0x119')});db[_0xdd70('0x55')][_0xdd70('0x12b')](db[_0xdd70('0x174')],{'through':'sms_interaction_has_tags','as':_0xdd70('0x176')});db[_0xdd70('0x55')][_0xdd70('0x12b')](db[_0xdd70('0x174')],{'through':_0xdd70('0x18c'),'as':_0xdd70('0x18d')});db[_0xdd70('0x55')][_0xdd70('0x12b')](db[_0xdd70('0x13')],{'as':_0xdd70('0x177'),'through':_0xdd70('0x134'),'foreignKey':'SmsInteractionId'});db[_0xdd70('0x189')][_0xdd70('0x128')](db[_0xdd70('0x13')],{'as':_0xdd70('0x13')});db['SmsMessage']['belongsTo'](db['CmContact'],{'onDelete':_0xdd70('0x118'),'as':'Contact'});db[_0xdd70('0x189')][_0xdd70('0x128')](db[_0xdd70('0x55')],{'onDelete':_0xdd70('0x118'),'as':_0xdd70('0x178'),'foreignKey':_0xdd70('0x18b')});db['SmsMessage'][_0xdd70('0x128')](db[_0xdd70('0x187')],{'as':_0xdd70('0x172'),'foreignKey':_0xdd70('0x188')});db[_0xdd70('0x58')][_0xdd70('0x12b')](db[_0xdd70('0x13')],{'as':_0xdd70('0x15e'),'through':'UserSmsQueue','foreignKey':'SmsQueueId'});db['SmsQueue'][_0xdd70('0x12b')](db[_0xdd70('0xee')],{'through':_0xdd70('0x18e'),'as':'Teams'});db['OpenchannelAccount'][_0xdd70('0x11a')](db['Disposition'],{'as':'Dispositions','foreignKey':_0xdd70('0x18f'),'onDelete':_0xdd70('0x118')});db[_0xdd70('0x5a')]['hasMany'](db[_0xdd70('0x7f')],{'as':_0xdd70('0x16a'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount']['hasMany'](db[_0xdd70('0x135')],{'as':_0xdd70('0x16c'),'foreignKey':_0xdd70('0x18f')});db[_0xdd70('0x5a')][_0xdd70('0x11a')](db[_0xdd70('0x5e')],{'as':_0xdd70('0x16b'),'foreignKey':_0xdd70('0x18f')});db[_0xdd70('0x5a')]['hasMany'](db[_0xdd70('0x5c')],{'as':_0xdd70('0x14f'),'foreignKey':'OpenchannelAccountId'});db[_0xdd70('0x5a')][_0xdd70('0x128')](db[_0xdd70('0x12c')],{'as':_0xdd70('0x16d'),'foreignKey':'ListId'});db[_0xdd70('0x5a')]['belongsTo'](db[_0xdd70('0x87')],{'as':'mandatoryDispositionPause','foreignKey':_0xdd70('0x180')});db[_0xdd70('0x5a')][_0xdd70('0x12b')](db[_0xdd70('0x13')],{'as':_0xdd70('0x15e'),'through':'user_has_openchannel_accounts'});db['OpenchannelApplication']['belongsTo'](db['User'],{'onDelete':_0xdd70('0x17a')});db[_0xdd70('0x5c')][_0xdd70('0x128')](db[_0xdd70('0x13e')],{'onDelete':_0xdd70('0x17a'),'foreignKey':'OpenchannelQueueId'});db[_0xdd70('0x5c')][_0xdd70('0x128')](db[_0xdd70('0x5a')],{'onDelete':_0xdd70('0x17a'),'foreignKey':_0xdd70('0x18f')});db[_0xdd70('0x5c')][_0xdd70('0x128')](db['Interval'],{'onDelete':'restrict','foreignKey':_0xdd70('0x15b')});db[_0xdd70('0x5c')][_0xdd70('0x128')](db[_0xdd70('0x174')],{'onDelete':_0xdd70('0x17a'),'foreignKey':'TagId'});db['OpenchannelInteraction'][_0xdd70('0x11a')](db[_0xdd70('0x5e')],{'as':_0xdd70('0x16b'),'onDelete':_0xdd70('0x118'),'foreignKey':_0xdd70('0x190')});db['OpenchannelInteraction'][_0xdd70('0x128')](db['OpenchannelAccount'],{'as':_0xdd70('0x172'),'foreignKey':_0xdd70('0x18f')});db[_0xdd70('0x135')][_0xdd70('0x128')](db[_0xdd70('0x70')],{'as':'Contact','foreignKey':_0xdd70('0x165')});db[_0xdd70('0x135')][_0xdd70('0x128')](db['User'],{'as':'Owner','foreignKey':_0xdd70('0x119')});db['OpenchannelInteraction'][_0xdd70('0x12b')](db[_0xdd70('0x174')],{'through':_0xdd70('0x191'),'as':_0xdd70('0x176')});db[_0xdd70('0x135')][_0xdd70('0x12b')](db[_0xdd70('0x174')],{'through':_0xdd70('0x191'),'as':_0xdd70('0x18d')});db[_0xdd70('0x135')][_0xdd70('0x12b')](db['User'],{'as':'Users','through':'user_has_openchannel_interactions','foreignKey':_0xdd70('0x190')});db[_0xdd70('0x5e')]['belongsTo'](db['User'],{'onDelete':'cascade','as':_0xdd70('0x13')});db['OpenchannelMessage'][_0xdd70('0x128')](db[_0xdd70('0x70')],{'onDelete':'cascade','as':'Contact'});db[_0xdd70('0x5e')][_0xdd70('0x128')](db[_0xdd70('0x135')],{'onDelete':_0xdd70('0x118'),'as':_0xdd70('0x178'),'foreignKey':_0xdd70('0x190')});db['OpenchannelMessage'][_0xdd70('0x128')](db['Attachment'],{'as':'Attachment','foreignKey':'AttachmentId'});db[_0xdd70('0x5e')][_0xdd70('0x128')](db[_0xdd70('0x5a')],{'as':_0xdd70('0x172'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelQueue'][_0xdd70('0x12b')](db[_0xdd70('0x13')],{'as':_0xdd70('0x15e'),'through':_0xdd70('0x36'),'foreignKey':_0xdd70('0x192')});db[_0xdd70('0x13e')][_0xdd70('0x12b')](db[_0xdd70('0xee')],{'through':_0xdd70('0x193'),'as':_0xdd70('0x15f')});db[_0xdd70('0x142')][_0xdd70('0x11a')](db[_0xdd70('0x81')],{'as':_0xdd70('0x169'),'foreignKey':_0xdd70('0x179'),'onDelete':_0xdd70('0x118')});db[_0xdd70('0x142')][_0xdd70('0x11a')](db[_0xdd70('0x7f')],{'as':_0xdd70('0x16a'),'foreignKey':_0xdd70('0x179')});db[_0xdd70('0x142')][_0xdd70('0x11a')](db[_0xdd70('0x6d')],{'as':'ProactiveActions'});db['ChatWebsite'][_0xdd70('0x11a')](db[_0xdd70('0x66')],{'as':_0xdd70('0x16c')});db[_0xdd70('0x142')][_0xdd70('0x11a')](db['ChatApplication'],{'as':_0xdd70('0x14f')});db[_0xdd70('0x142')][_0xdd70('0x11a')](db['ChatMessage'],{'as':_0xdd70('0x16b')});db[_0xdd70('0x142')][_0xdd70('0x128')](db[_0xdd70('0x12c')],{'as':_0xdd70('0x16d'),'foreignKey':_0xdd70('0x16e')});db[_0xdd70('0x142')][_0xdd70('0x128')](db[_0xdd70('0x85')],{'as':_0xdd70('0x85'),'foreignKey':_0xdd70('0x15b')});db[_0xdd70('0x142')]['belongsTo'](db['MailAccount'],{'as':_0xdd70('0x3c'),'foreignKey':_0xdd70('0x166')});db[_0xdd70('0x142')][_0xdd70('0x128')](db[_0xdd70('0x87')],{'as':_0xdd70('0x15c'),'foreignKey':'mandatoryDispositionPauseId'});db['ChatWebsite'][_0xdd70('0x12b')](db[_0xdd70('0x13')],{'as':_0xdd70('0x15e'),'through':_0xdd70('0x144')});db[_0xdd70('0x62')][_0xdd70('0x128')](db['OpenchannelAccount'],{});db[_0xdd70('0x62')][_0xdd70('0x128')](db[_0xdd70('0x12c')],{'as':_0xdd70('0x16d'),'foreignKey':_0xdd70('0x16e')});db['OpenchannelQueueReport']['belongsTo'](db[_0xdd70('0x70')],{'as':_0xdd70('0x164'),'foreignKey':_0xdd70('0x165')});db['OpenchannelQueueReport'][_0xdd70('0x128')](db[_0xdd70('0x135')],{});db[_0xdd70('0x62')][_0xdd70('0x128')](db[_0xdd70('0x5e')],{});db['OpenchannelQueueReport']['belongsTo'](db['User'],{});db[_0xdd70('0x62')][_0xdd70('0x128')](db[_0xdd70('0x13e')],{});db[_0xdd70('0x64')][_0xdd70('0x128')](db[_0xdd70('0x13')],{'as':_0xdd70('0x194'),'foreignKey':_0xdd70('0x119'),'onDelete':_0xdd70('0x17a')});db[_0xdd70('0x64')][_0xdd70('0x128')](db[_0xdd70('0x6a')],{'as':_0xdd70('0x195'),'foreignKey':_0xdd70('0x196'),'onDelete':'restrict'});db[_0xdd70('0x64')][_0xdd70('0x128')](db['ChatWebsite'],{'as':'Website','foreignKey':'ChatWebsiteId','onDelete':_0xdd70('0x17a')});db['ChatApplication']['belongsTo'](db[_0xdd70('0x174')],{'onDelete':_0xdd70('0x17a'),'foreignKey':_0xdd70('0x17b')});db[_0xdd70('0x66')]['hasMany'](db['ChatMessage'],{'as':_0xdd70('0x16b'),'onDelete':_0xdd70('0x118'),'foreignKey':'ChatInteractionId'});db[_0xdd70('0x66')]['belongsTo'](db[_0xdd70('0x142')],{'as':_0xdd70('0x172'),'foreignKey':_0xdd70('0x179')});db[_0xdd70('0x66')]['belongsTo'](db[_0xdd70('0x70')],{'as':_0xdd70('0x164'),'foreignKey':'ContactId'});db[_0xdd70('0x66')][_0xdd70('0x128')](db[_0xdd70('0x13')],{'as':_0xdd70('0x173'),'foreignKey':_0xdd70('0x119')});db[_0xdd70('0x66')][_0xdd70('0x12b')](db[_0xdd70('0x174')],{'through':_0xdd70('0x197'),'as':_0xdd70('0x176')});db[_0xdd70('0x66')][_0xdd70('0x12b')](db[_0xdd70('0x174')],{'through':'chat_interaction_has_tags','as':_0xdd70('0x18d')});db[_0xdd70('0x66')][_0xdd70('0x12b')](db[_0xdd70('0x13')],{'as':_0xdd70('0x177'),'through':_0xdd70('0x131'),'foreignKey':_0xdd70('0x198')});db[_0xdd70('0x199')][_0xdd70('0x128')](db[_0xdd70('0x13')],{'onDelete':_0xdd70('0x118'),'as':_0xdd70('0x13')});db[_0xdd70('0x199')][_0xdd70('0x128')](db[_0xdd70('0x70')],{'onDelete':_0xdd70('0x118'),'as':'Contact','foreignKey':_0xdd70('0x165')});db[_0xdd70('0x199')][_0xdd70('0x128')](db[_0xdd70('0x66')],{'onDelete':_0xdd70('0x118'),'as':'Interaction','foreignKey':_0xdd70('0x198')});db[_0xdd70('0x199')][_0xdd70('0x128')](db['Attachment'],{'as':_0xdd70('0xf3'),'foreignKey':_0xdd70('0x184')});db['ChatMessage'][_0xdd70('0x128')](db[_0xdd70('0x142')],{'as':_0xdd70('0x172'),'foreignKey':_0xdd70('0x179')});db[_0xdd70('0x68')][_0xdd70('0x11a')](db[_0xdd70('0xf3')],{'as':'Attachments','foreignKey':_0xdd70('0x19a'),'onDelete':_0xdd70('0x118'),'hooks':!![]});db[_0xdd70('0x68')][_0xdd70('0x128')](db[_0xdd70('0x70')],{'onDelete':'cascade','as':_0xdd70('0x164'),'foreignKey':_0xdd70('0x165')});db[_0xdd70('0x68')][_0xdd70('0x128')](db[_0xdd70('0x142')],{'as':_0xdd70('0x172'),'foreignKey':_0xdd70('0x179')});db[_0xdd70('0x6a')]['belongsToMany'](db[_0xdd70('0x13')],{'as':_0xdd70('0x15e'),'through':_0xdd70('0x30'),'hooks':!![]});db[_0xdd70('0x6a')]['belongsToMany'](db[_0xdd70('0xee')],{'through':_0xdd70('0x19b'),'as':_0xdd70('0x15f')});db[_0xdd70('0x129')]['hasMany'](db[_0xdd70('0xd6')],{'as':_0xdd70('0x16b'),'foreignKey':'ChatGroupId','onDelete':_0xdd70('0x118')});db['ChatGroup'][_0xdd70('0x12b')](db[_0xdd70('0x13')],{'as':_0xdd70('0x152'),'through':_0xdd70('0x12a')});db[_0xdd70('0x6d')][_0xdd70('0x128')](db[_0xdd70('0x142')],{'as':'Website','foreignKey':_0xdd70('0x179')});db[_0xdd70('0x19c')][_0xdd70('0x11a')](db[_0xdd70('0x70')],{'as':'Contacts','foreignKey':'CompanyId'});db['CmContact'][_0xdd70('0x11a')](db[_0xdd70('0x72')],{'as':'Hoppers','foreignKey':_0xdd70('0x165')});db[_0xdd70('0x70')][_0xdd70('0x11a')](db[_0xdd70('0x76')],{'as':_0xdd70('0x154'),'foreignKey':_0xdd70('0x165')});db[_0xdd70('0x70')][_0xdd70('0x11a')](db[_0xdd70('0x78')],{'as':_0xdd70('0x155'),'foreignKey':_0xdd70('0x165')});db[_0xdd70('0x70')]['hasMany'](db[_0xdd70('0x7a')],{'as':'ReportAgentPreview','foreignKey':_0xdd70('0x165')});db[_0xdd70('0x70')]['hasMany'](db[_0xdd70('0xdb')],{'as':'JscriptySessions','foreignKey':_0xdd70('0x165')});db['CmContact'][_0xdd70('0x11a')](db[_0xdd70('0x135')],{'as':_0xdd70('0x11f'),'foreignKey':_0xdd70('0x165'),'onDelete':'restrict'});db[_0xdd70('0x70')][_0xdd70('0x11a')](db[_0xdd70('0x66')],{'as':_0xdd70('0x120'),'foreignKey':_0xdd70('0x165'),'onDelete':_0xdd70('0x17a')});db['CmContact']['hasMany'](db[_0xdd70('0x55')],{'as':'SmsInteractions','foreignKey':_0xdd70('0x165'),'onDelete':_0xdd70('0x17a')});db[_0xdd70('0x70')][_0xdd70('0x11a')](db[_0xdd70('0x122')],{'as':_0xdd70('0x132'),'foreignKey':_0xdd70('0x165'),'onDelete':'restrict'});db[_0xdd70('0x70')][_0xdd70('0x11a')](db[_0xdd70('0x123')],{'as':'MailInteractions','foreignKey':_0xdd70('0x165'),'onDelete':_0xdd70('0x17a')});db[_0xdd70('0x70')][_0xdd70('0x128')](db[_0xdd70('0x19c')],{'as':_0xdd70('0x19d'),'foreignKey':'CompanyId'});db[_0xdd70('0x70')][_0xdd70('0x128')](db[_0xdd70('0x12c')],{'as':_0xdd70('0x16d'),'foreignKey':_0xdd70('0x16e'),'onDelete':_0xdd70('0x118')});db[_0xdd70('0x70')][_0xdd70('0x12b')](db['User'],{'as':_0xdd70('0x177'),'through':_0xdd70('0x19e')});db[_0xdd70('0x70')][_0xdd70('0x12b')](db[_0xdd70('0x174')],{'as':_0xdd70('0x176'),'through':_0xdd70('0x19f')});db[_0xdd70('0x70')][_0xdd70('0x12b')](db[_0xdd70('0x174')],{'through':_0xdd70('0x19f'),'as':_0xdd70('0x18d')});db[_0xdd70('0x72')][_0xdd70('0x128')](db[_0xdd70('0x70')],{'as':'Contact','foreignKey':_0xdd70('0x165'),'onDelete':_0xdd70('0x118')});db[_0xdd70('0x72')][_0xdd70('0x128')](db[_0xdd70('0x12c')],{'as':_0xdd70('0x16d'),'foreignKey':_0xdd70('0x16e'),'onDelete':_0xdd70('0x118')});db['CmHopper'][_0xdd70('0x128')](db[_0xdd70('0x13')],{'as':'Agent','foreignKey':_0xdd70('0x119')});db['CmHopper']['belongsTo'](db[_0xdd70('0x138')],{'as':'Queue','foreignKey':'VoiceQueueId','onDelete':'cascade'});db[_0xdd70('0x72')][_0xdd70('0x128')](db[_0xdd70('0x1a0')],{'as':_0xdd70('0x1a0'),'foreignKey':_0xdd70('0x1a1'),'onDelete':_0xdd70('0x118')});db[_0xdd70('0x72')][_0xdd70('0x128')](db[_0xdd70('0x13')],{'as':_0xdd70('0x173'),'foreignKey':_0xdd70('0x1a2')});db['CmHopperBlack']['belongsTo'](db[_0xdd70('0x70')],{'as':_0xdd70('0x164'),'foreignKey':_0xdd70('0x165'),'onDelete':_0xdd70('0x118')});db['CmHopperBlack'][_0xdd70('0x128')](db[_0xdd70('0x12c')],{'as':_0xdd70('0x16d'),'foreignKey':_0xdd70('0x16e'),'onDelete':_0xdd70('0x118')});db[_0xdd70('0x74')][_0xdd70('0x128')](db[_0xdd70('0x138')],{'as':_0xdd70('0x195'),'foreignKey':_0xdd70('0x153'),'onDelete':_0xdd70('0x118')});db['CmHopperBlack']['belongsTo'](db[_0xdd70('0x1a0')],{'as':'Campaign','foreignKey':_0xdd70('0x1a1'),'onDelete':_0xdd70('0x118')});db[_0xdd70('0x7d')][_0xdd70('0x11a')](db[_0xdd70('0x83')],{'as':{'plural':'All','singular':_0xdd70('0x1a3')},'foreignKey':_0xdd70('0x1a4'),'onDelete':_0xdd70('0x118'),'hooks':!![]});db[_0xdd70('0x7d')]['hasMany'](db['Condition'],{'as':{'plural':_0xdd70('0x1a5'),'singular':_0xdd70('0x1a6')},'foreignKey':'AutomationAnyId','onDelete':'cascade','hooks':!![]});db[_0xdd70('0x7d')][_0xdd70('0x11a')](db['Action'],{'as':'Actions','foreignKey':_0xdd70('0x1a7'),'onDelete':_0xdd70('0x118'),'hooks':!![]});db[_0xdd70('0x81')][_0xdd70('0x11a')](db['Disposition'],{'as':_0xdd70('0x169'),'foreignKey':_0xdd70('0x1a8'),'onDelete':_0xdd70('0x118')});db[_0xdd70('0x85')][_0xdd70('0x11a')](db['Interval'],{'as':_0xdd70('0x1a9'),'foreignKey':_0xdd70('0x15b'),'onDelete':_0xdd70('0x118'),'hooks':!![],'required':![]});db[_0xdd70('0x85')]['hasMany'](db[_0xdd70('0x19')],{'as':_0xdd70('0x11d'),'foreignKey':'IntervalId','onDelete':_0xdd70('0x17a')});db[_0xdd70('0x85')][_0xdd70('0x11a')](db[_0xdd70('0x44')],{'as':_0xdd70('0x1aa'),'foreignKey':_0xdd70('0x15b')});db[_0xdd70('0x85')][_0xdd70('0x11a')](db['ChatApplication'],{'as':_0xdd70('0x1ab'),'foreignKey':_0xdd70('0x15b')});db[_0xdd70('0x85')]['hasMany'](db[_0xdd70('0x4a')],{'as':_0xdd70('0x1ac'),'foreignKey':_0xdd70('0x15b')});db[_0xdd70('0x85')][_0xdd70('0x11a')](db['SmsApplication'],{'as':'SmsApplications','foreignKey':_0xdd70('0x15b')});db[_0xdd70('0x8d')][_0xdd70('0x128')](db[_0xdd70('0x3c')],{});db[_0xdd70('0x8d')][_0xdd70('0x128')](db[_0xdd70('0x99')],{'foreignKey':_0xdd70('0x1ad')});db[_0xdd70('0x8d')]['belongsTo'](db[_0xdd70('0x97')],{'foreignKey':'CustomReportId'});db['Sound'][_0xdd70('0x12b')](db[_0xdd70('0x1b')],{'as':_0xdd70('0x1ae'),'through':_0xdd70('0x151'),'onDelete':'restrict'});db[_0xdd70('0x174')][_0xdd70('0x12b')](db[_0xdd70('0x70')],{'through':_0xdd70('0x19f')});db[_0xdd70('0x174')][_0xdd70('0x12b')](db[_0xdd70('0x66')],{'through':'chat_interaction_has_tags'});db[_0xdd70('0x174')][_0xdd70('0x12b')](db[_0xdd70('0x123')],{'through':_0xdd70('0x175')});db[_0xdd70('0x174')][_0xdd70('0x12b')](db['SmsInteraction'],{'through':'sms_interaction_has_tags'});db[_0xdd70('0x174')]['belongsToMany'](db[_0xdd70('0x122')],{'through':_0xdd70('0x183')});db['Tag']['belongsToMany'](db['OpenchannelInteraction'],{'through':_0xdd70('0x191')});db[_0xdd70('0x174')][_0xdd70('0x12b')](db['WhatsappInteraction'],{'through':'whatsapp_interaction_has_tags'});db[_0xdd70('0x92')][_0xdd70('0x11a')](db['Condition'],{'as':{'plural':_0xdd70('0x1af'),'singular':_0xdd70('0x1b0')},'foreignKey':_0xdd70('0x1b1'),'onDelete':_0xdd70('0x118'),'hooks':!![]});db[_0xdd70('0x92')]['hasMany'](db['Condition'],{'as':{'plural':_0xdd70('0x1b2'),'singular':_0xdd70('0x1b3')},'foreignKey':'TriggerAnyId','onDelete':_0xdd70('0x118'),'hooks':!![]});db[_0xdd70('0x92')][_0xdd70('0x11a')](db['Action'],{'as':_0xdd70('0x1b4'),'foreignKey':_0xdd70('0x1b5'),'onDelete':_0xdd70('0x118'),'hooks':!![]});db['AnalyticCustomReport'][_0xdd70('0x11a')](db[_0xdd70('0x9f')],{'as':_0xdd70('0x1b6'),'onDelete':'cascade','foreignKey':_0xdd70('0x1b7'),'hooks':!![]});db[_0xdd70('0x99')][_0xdd70('0x11a')](db[_0xdd70('0x9f')],{'as':_0xdd70('0x1b6'),'onDelete':_0xdd70('0x118'),'foreignKey':_0xdd70('0x1ad')});db['AnalyticMetric'][_0xdd70('0x11a')](db['AnalyticFieldReport'],{'as':_0xdd70('0x1b6'),'onDelete':_0xdd70('0x118'),'foreignKey':_0xdd70('0x1b8')});db[_0xdd70('0x9f')][_0xdd70('0x128')](db[_0xdd70('0x9d')],{'foreignKey':_0xdd70('0x1b8')});db[_0xdd70('0xa3')][_0xdd70('0x11a')](db['SalesforceConfiguration'],{'as':_0xdd70('0x1b9'),'onDelete':'cascade','foreignKey':'AccountId'});db['SalesforceConfiguration'][_0xdd70('0x11a')](db[_0xdd70('0xa7')],{'as':_0xdd70('0x1ba'),'onDelete':_0xdd70('0x118'),'foreignKey':'SubjectId'});db['SalesforceConfiguration'][_0xdd70('0x11a')](db[_0xdd70('0xa7')],{'as':'Descriptions','onDelete':_0xdd70('0x118'),'foreignKey':_0xdd70('0x1bb')});db[_0xdd70('0xa5')][_0xdd70('0x11a')](db[_0xdd70('0xa7')],{'as':_0xdd70('0x1b6'),'onDelete':'cascade','foreignKey':_0xdd70('0x1bc')});db['SalesforceConfiguration'][_0xdd70('0x128')](db[_0xdd70('0xa3')],{'as':_0xdd70('0x172'),'foreignKey':_0xdd70('0x1bd')});db[_0xdd70('0xa7')][_0xdd70('0x11a')](db['SalesforceField'],{'as':'Subject','foreignKey':_0xdd70('0x1be')});db[_0xdd70('0xa7')][_0xdd70('0x11a')](db['SalesforceField'],{'as':_0xdd70('0x1bf'),'foreignKey':'DescriptionId'});db[_0xdd70('0xa7')][_0xdd70('0x11a')](db['SalesforceField'],{'as':_0xdd70('0x1c0'),'foreignKey':_0xdd70('0x1bc')});db['SalesforceField'][_0xdd70('0x128')](db['Variable'],{'as':_0xdd70('0x93'),'foreignKey':_0xdd70('0x1c1')});db['SugarcrmAccount']['hasMany'](db[_0xdd70('0xaa')],{'as':_0xdd70('0x1b9'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0xdd70('0xaa')][_0xdd70('0x11a')](db['SugarcrmField'],{'as':'Subjects','onDelete':_0xdd70('0x118'),'foreignKey':_0xdd70('0x1be')});db['SugarcrmConfiguration'][_0xdd70('0x11a')](db['SugarcrmField'],{'as':'Descriptions','onDelete':_0xdd70('0x118'),'foreignKey':'DescriptionId'});db['SugarcrmConfiguration'][_0xdd70('0x11a')](db['SugarcrmField'],{'as':_0xdd70('0x1b6'),'onDelete':_0xdd70('0x118'),'foreignKey':'FieldId'});db[_0xdd70('0xaa')][_0xdd70('0x128')](db[_0xdd70('0x1c2')],{'as':_0xdd70('0x172'),'foreignKey':_0xdd70('0x1bd')});db[_0xdd70('0x1c3')][_0xdd70('0x11a')](db[_0xdd70('0x1c3')],{'as':_0xdd70('0x1c4'),'foreignKey':_0xdd70('0x1be')});db['SugarcrmField']['hasMany'](db[_0xdd70('0x1c3')],{'as':_0xdd70('0x1bf'),'foreignKey':_0xdd70('0x1bb')});db[_0xdd70('0x1c3')]['hasMany'](db[_0xdd70('0x1c3')],{'as':'Field','foreignKey':_0xdd70('0x1bc')});db[_0xdd70('0x1c3')]['belongsTo'](db[_0xdd70('0x93')],{'as':_0xdd70('0x93'),'foreignKey':_0xdd70('0x1c1')});db[_0xdd70('0xac')][_0xdd70('0x11a')](db[_0xdd70('0xae')],{'as':_0xdd70('0x1b9'),'onDelete':_0xdd70('0x118'),'foreignKey':_0xdd70('0x1bd')});db['DeskConfiguration'][_0xdd70('0x11a')](db[_0xdd70('0x1c5')],{'as':'Subjects','onDelete':_0xdd70('0x118'),'foreignKey':_0xdd70('0x1be')});db['DeskConfiguration'][_0xdd70('0x11a')](db['DeskField'],{'as':_0xdd70('0x1c6'),'onDelete':_0xdd70('0x118'),'foreignKey':_0xdd70('0x1bb')});db['DeskConfiguration'][_0xdd70('0x11a')](db['DeskField'],{'as':_0xdd70('0x1b6'),'onDelete':_0xdd70('0x118'),'foreignKey':_0xdd70('0x1bc')});db['DeskConfiguration']['belongsTo'](db[_0xdd70('0xac')],{'as':_0xdd70('0x172'),'foreignKey':_0xdd70('0x1bd')});db[_0xdd70('0xae')][_0xdd70('0x12b')](db['Tag'],{'through':_0xdd70('0x1c7')});db['DeskField'][_0xdd70('0x11a')](db[_0xdd70('0x1c5')],{'as':_0xdd70('0x1c4'),'foreignKey':_0xdd70('0x1be')});db[_0xdd70('0x1c5')][_0xdd70('0x11a')](db['DeskField'],{'as':'Description','foreignKey':_0xdd70('0x1bb')});db['DeskField'][_0xdd70('0x11a')](db['DeskField'],{'as':_0xdd70('0x1c0'),'foreignKey':'FieldId'});db[_0xdd70('0x1c5')][_0xdd70('0x128')](db[_0xdd70('0x93')],{'as':_0xdd70('0x93'),'foreignKey':_0xdd70('0x1c1')});db[_0xdd70('0x1c8')]['hasMany'](db[_0xdd70('0xb1')],{'as':_0xdd70('0x1b9'),'onDelete':'cascade','foreignKey':_0xdd70('0x1bd')});db[_0xdd70('0xb1')][_0xdd70('0x11a')](db[_0xdd70('0xb3')],{'as':_0xdd70('0x1ba'),'onDelete':'cascade','foreignKey':_0xdd70('0x1be')});db[_0xdd70('0xb1')][_0xdd70('0x11a')](db[_0xdd70('0xb3')],{'as':_0xdd70('0x1c6'),'onDelete':'cascade','foreignKey':_0xdd70('0x1bb')});db[_0xdd70('0xb1')][_0xdd70('0x11a')](db[_0xdd70('0xb3')],{'as':_0xdd70('0x1b6'),'onDelete':'cascade','foreignKey':_0xdd70('0x1bc')});db[_0xdd70('0xb1')]['belongsTo'](db['ZohoAccount'],{'as':_0xdd70('0x172'),'foreignKey':'AccountId'});db[_0xdd70('0xb3')][_0xdd70('0x11a')](db[_0xdd70('0xb3')],{'as':_0xdd70('0x1c4'),'foreignKey':_0xdd70('0x1be')});db[_0xdd70('0xb3')]['hasMany'](db['ZohoField'],{'as':_0xdd70('0x1bf'),'foreignKey':'DescriptionId'});db[_0xdd70('0xb3')][_0xdd70('0x11a')](db[_0xdd70('0xb3')],{'as':_0xdd70('0x1c0'),'foreignKey':_0xdd70('0x1bc')});db[_0xdd70('0xb3')][_0xdd70('0x128')](db['Variable'],{'as':'Variable','foreignKey':_0xdd70('0x1c1')});db['ZendeskAccount'][_0xdd70('0x11a')](db[_0xdd70('0xb7')],{'as':_0xdd70('0x1b9'),'onDelete':_0xdd70('0x118'),'foreignKey':_0xdd70('0x1bd')});db[_0xdd70('0xb7')][_0xdd70('0x11a')](db[_0xdd70('0xb9')],{'as':_0xdd70('0x1ba'),'foreignKey':'SubjectId'});db[_0xdd70('0xb7')][_0xdd70('0x11a')](db[_0xdd70('0xb9')],{'as':_0xdd70('0x1c6'),'foreignKey':_0xdd70('0x1bb')});db['ZendeskConfiguration'][_0xdd70('0x11a')](db[_0xdd70('0xb9')],{'as':_0xdd70('0x1b6'),'foreignKey':_0xdd70('0x1bc')});db[_0xdd70('0xb7')]['belongsTo'](db['ZendeskAccount'],{'as':_0xdd70('0x172'),'foreignKey':_0xdd70('0x1bd')});db[_0xdd70('0xb7')][_0xdd70('0x12b')](db['Tag'],{'through':'int_zendesk_configuration_has_tags'});db['ZendeskField']['hasMany'](db[_0xdd70('0xb9')],{'as':_0xdd70('0x1c4'),'foreignKey':_0xdd70('0x1be')});db[_0xdd70('0xb9')][_0xdd70('0x11a')](db['ZendeskField'],{'as':_0xdd70('0x1bf'),'foreignKey':'DescriptionId'});db[_0xdd70('0xb9')][_0xdd70('0x11a')](db['ZendeskField'],{'as':_0xdd70('0x1c0'),'foreignKey':_0xdd70('0x1bc')});db[_0xdd70('0xb9')][_0xdd70('0x128')](db['Variable'],{'as':_0xdd70('0x93'),'foreignKey':'VariableId'});db[_0xdd70('0xba')][_0xdd70('0x11a')](db[_0xdd70('0xbc')],{'as':_0xdd70('0x1b9'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0xdd70('0xbc')]['hasMany'](db[_0xdd70('0x1c9')],{'as':_0xdd70('0x1ba'),'onDelete':_0xdd70('0x118'),'foreignKey':'SubjectId'});db[_0xdd70('0xbc')]['hasMany'](db[_0xdd70('0x1c9')],{'as':'Descriptions','onDelete':_0xdd70('0x118'),'foreignKey':_0xdd70('0x1bb')});db['FreshdeskConfiguration'][_0xdd70('0x11a')](db['FreshdeskField'],{'as':'Fields','onDelete':_0xdd70('0x118'),'foreignKey':_0xdd70('0x1bc')});db['FreshdeskConfiguration'][_0xdd70('0x128')](db[_0xdd70('0xba')],{'as':'Account','foreignKey':'AccountId'});db[_0xdd70('0xbc')][_0xdd70('0x12b')](db['Tag'],{'through':_0xdd70('0x1ca')});db['FreshdeskField']['hasMany'](db[_0xdd70('0x1c9')],{'as':'Subject','foreignKey':'SubjectId'});db[_0xdd70('0x1c9')][_0xdd70('0x11a')](db[_0xdd70('0x1c9')],{'as':_0xdd70('0x1bf'),'foreignKey':_0xdd70('0x1bb')});db['FreshdeskField']['hasMany'](db[_0xdd70('0x1c9')],{'as':_0xdd70('0x1c0'),'foreignKey':_0xdd70('0x1bc')});db[_0xdd70('0x1c9')][_0xdd70('0x128')](db[_0xdd70('0x93')],{'as':'Variable','foreignKey':_0xdd70('0x1c1')});db[_0xdd70('0xbf')][_0xdd70('0x11a')](db[_0xdd70('0xc1')],{'as':_0xdd70('0x1b9'),'onDelete':_0xdd70('0x118'),'foreignKey':_0xdd70('0x1bd')});db[_0xdd70('0xc1')][_0xdd70('0x11a')](db[_0xdd70('0xc3')],{'as':_0xdd70('0x1ba'),'foreignKey':'SubjectId'});db[_0xdd70('0xc1')]['hasMany'](db[_0xdd70('0xc3')],{'as':_0xdd70('0x1c6'),'foreignKey':_0xdd70('0x1bb')});db[_0xdd70('0xc1')][_0xdd70('0x11a')](db[_0xdd70('0xc3')],{'as':_0xdd70('0x1b6'),'foreignKey':'FieldId'});db[_0xdd70('0xc1')][_0xdd70('0x128')](db['VtigerAccount'],{'as':'Account','foreignKey':'AccountId'});db['VtigerField'][_0xdd70('0x11a')](db[_0xdd70('0xc3')],{'as':'Subject','foreignKey':'SubjectId'});db[_0xdd70('0xc3')][_0xdd70('0x11a')](db[_0xdd70('0xc3')],{'as':_0xdd70('0x1bf'),'foreignKey':_0xdd70('0x1bb')});db[_0xdd70('0xc3')][_0xdd70('0x11a')](db[_0xdd70('0xc3')],{'as':_0xdd70('0x1c0'),'foreignKey':_0xdd70('0x1bc')});db[_0xdd70('0xc3')][_0xdd70('0x128')](db[_0xdd70('0x93')],{'as':_0xdd70('0x93'),'foreignKey':_0xdd70('0x1c1')});db[_0xdd70('0xc5')][_0xdd70('0x11a')](db[_0xdd70('0xc7')],{'as':_0xdd70('0x1b9'),'onDelete':_0xdd70('0x118'),'foreignKey':_0xdd70('0x1bd')});db[_0xdd70('0xc7')]['hasMany'](db[_0xdd70('0xc9')],{'as':_0xdd70('0x1ba'),'foreignKey':_0xdd70('0x1be')});db[_0xdd70('0xc7')][_0xdd70('0x11a')](db[_0xdd70('0xc9')],{'as':'Descriptions','foreignKey':'DescriptionId'});db['ServicenowConfiguration'][_0xdd70('0x11a')](db['ServicenowField'],{'as':_0xdd70('0x1b6'),'foreignKey':_0xdd70('0x1bc')});db['ServicenowConfiguration'][_0xdd70('0x128')](db[_0xdd70('0xc5')],{'as':_0xdd70('0x172'),'foreignKey':_0xdd70('0x1bd')});db['ServicenowField']['hasMany'](db[_0xdd70('0xc9')],{'as':_0xdd70('0x1c4'),'foreignKey':_0xdd70('0x1be')});db[_0xdd70('0xc9')][_0xdd70('0x11a')](db[_0xdd70('0xc9')],{'as':_0xdd70('0x1bf'),'foreignKey':'DescriptionId'});db['ServicenowField'][_0xdd70('0x11a')](db[_0xdd70('0xc9')],{'as':'Field','foreignKey':_0xdd70('0x1bc')});db[_0xdd70('0xc9')][_0xdd70('0x128')](db[_0xdd70('0x93')],{'as':_0xdd70('0x93'),'foreignKey':'VariableId'});db[_0xdd70('0x1cb')][_0xdd70('0x11a')](db[_0xdd70('0xcb')],{'as':_0xdd70('0x1b9'),'onDelete':_0xdd70('0x118'),'foreignKey':_0xdd70('0x1bd')});db[_0xdd70('0xcb')]['hasMany'](db['Dynamics365Field'],{'as':_0xdd70('0x1ba'),'onDelete':_0xdd70('0x118'),'foreignKey':_0xdd70('0x1be')});db[_0xdd70('0xcb')][_0xdd70('0x11a')](db[_0xdd70('0x1cc')],{'as':_0xdd70('0x1c6'),'onDelete':_0xdd70('0x118'),'foreignKey':'DescriptionId'});db[_0xdd70('0xcb')]['hasMany'](db[_0xdd70('0x1cc')],{'as':'Fields','onDelete':_0xdd70('0x118'),'foreignKey':_0xdd70('0x1bc')});db['Dynamics365Configuration'][_0xdd70('0x128')](db[_0xdd70('0x1cb')],{'as':_0xdd70('0x172'),'foreignKey':_0xdd70('0x1bd')});db[_0xdd70('0x1cc')][_0xdd70('0x11a')](db['Dynamics365Field'],{'as':'Subject','foreignKey':_0xdd70('0x1be')});db[_0xdd70('0x1cc')][_0xdd70('0x11a')](db[_0xdd70('0x1cc')],{'as':'Description','foreignKey':_0xdd70('0x1bb')});db[_0xdd70('0x1cc')][_0xdd70('0x11a')](db[_0xdd70('0x1cc')],{'as':'Field','foreignKey':_0xdd70('0x1bc')});db[_0xdd70('0x1cc')][_0xdd70('0x128')](db[_0xdd70('0x93')],{'as':_0xdd70('0x93'),'foreignKey':_0xdd70('0x1c1')});db[_0xdd70('0xce')][_0xdd70('0x11a')](db[_0xdd70('0xd0')],{'as':_0xdd70('0x1b9'),'onDelete':'cascade','foreignKey':_0xdd70('0x1bd')});db[_0xdd70('0xd0')][_0xdd70('0x11a')](db[_0xdd70('0xd2')],{'as':_0xdd70('0x1ba'),'foreignKey':'SubjectId'});db['FreshsalesConfiguration'][_0xdd70('0x11a')](db[_0xdd70('0xd2')],{'as':_0xdd70('0x1c6'),'foreignKey':'DescriptionId'});db[_0xdd70('0xd0')][_0xdd70('0x11a')](db[_0xdd70('0xd2')],{'as':_0xdd70('0x1b6'),'foreignKey':_0xdd70('0x1bc')});db[_0xdd70('0xd0')]['belongsTo'](db['FreshsalesAccount'],{'as':'Account','foreignKey':_0xdd70('0x1bd')});db[_0xdd70('0xd2')][_0xdd70('0x11a')](db['FreshsalesField'],{'as':_0xdd70('0x1c4'),'foreignKey':_0xdd70('0x1be')});db[_0xdd70('0xd2')]['hasMany'](db[_0xdd70('0xd2')],{'as':_0xdd70('0x1bf'),'foreignKey':_0xdd70('0x1bb')});db[_0xdd70('0xd2')]['hasMany'](db[_0xdd70('0xd2')],{'as':_0xdd70('0x1c0'),'foreignKey':'FieldId'});db[_0xdd70('0xd2')][_0xdd70('0x128')](db[_0xdd70('0x93')],{'as':_0xdd70('0x93'),'foreignKey':_0xdd70('0x1c1')});db[_0xdd70('0x1cd')][_0xdd70('0x128')](db[_0xdd70('0x142')],{});db[_0xdd70('0x1cd')]['belongsTo'](db['CmList'],{'as':_0xdd70('0x16d'),'foreignKey':_0xdd70('0x16e')});db[_0xdd70('0x1cd')][_0xdd70('0x128')](db[_0xdd70('0x70')],{'as':_0xdd70('0x164'),'foreignKey':_0xdd70('0x165')});db['ChatQueueReport'][_0xdd70('0x128')](db[_0xdd70('0x66')],{});db[_0xdd70('0x1cd')][_0xdd70('0x128')](db[_0xdd70('0x199')],{});db['ChatQueueReport']['belongsTo'](db['User'],{});db[_0xdd70('0x1cd')][_0xdd70('0x128')](db['ChatQueue'],{});db[_0xdd70('0xd6')][_0xdd70('0x128')](db[_0xdd70('0x13')],{'onDelete':_0xdd70('0x118'),'foreignKey':_0xdd70('0x1ce')});db['ChatInternalMessage'][_0xdd70('0x128')](db[_0xdd70('0x13')],{'onDelete':_0xdd70('0x118'),'foreignKey':_0xdd70('0x1cf')});db[_0xdd70('0xdb')][_0xdd70('0x11a')](db[_0xdd70('0x1d0')],{'foreignKey':_0xdd70('0x1d1'),'onDelete':_0xdd70('0x118')});db[_0xdd70('0xdb')][_0xdd70('0x11a')](db['JscriptyAnswerReport'],{'foreignKey':_0xdd70('0x1d1'),'onDelete':'cascade'});db[_0xdd70('0xdd')][_0xdd70('0x128')](db[_0xdd70('0x187')],{});db['SmsQueueReport'][_0xdd70('0x128')](db[_0xdd70('0x12c')],{'as':_0xdd70('0x16d'),'foreignKey':'ListId'});db[_0xdd70('0xdd')][_0xdd70('0x128')](db['CmContact'],{'as':_0xdd70('0x164'),'foreignKey':_0xdd70('0x165')});db[_0xdd70('0xdd')][_0xdd70('0x128')](db[_0xdd70('0x55')],{});db[_0xdd70('0xdd')][_0xdd70('0x128')](db[_0xdd70('0x189')],{});db[_0xdd70('0xdd')][_0xdd70('0x128')](db['User'],{});db[_0xdd70('0xdd')][_0xdd70('0x128')](db[_0xdd70('0x58')],{});db[_0xdd70('0xe3')]['hasMany'](db[_0xdd70('0xdb')],{'foreignKey':_0xdd70('0x1d2')});db[_0xdd70('0xe3')][_0xdd70('0x11a')](db['JscriptyQuestionReport'],{'foreignKey':'ProjectId'});db['JscriptyProject'][_0xdd70('0x11a')](db[_0xdd70('0xd8')],{'foreignKey':_0xdd70('0x1d2')});db['SquareProject'][_0xdd70('0x12b')](db[_0xdd70('0x13')],{'as':_0xdd70('0x177'),'through':_0xdd70('0x14b')});db['Team']['belongsToMany'](db[_0xdd70('0x13')],{'as':_0xdd70('0x15e'),'through':_0xdd70('0x12e')});db[_0xdd70('0xee')][_0xdd70('0x12b')](db[_0xdd70('0x138')],{'through':_0xdd70('0x112'),'as':_0xdd70('0x139')});db[_0xdd70('0xee')]['belongsToMany'](db[_0xdd70('0x3e')],{'through':'team_has_mail_queues','as':'MailQueues'});db[_0xdd70('0xee')]['belongsToMany'](db[_0xdd70('0x6a')],{'through':_0xdd70('0x19b'),'as':_0xdd70('0x1d3')});db[_0xdd70('0xee')][_0xdd70('0x12b')](db['FaxQueue'],{'through':_0xdd70('0x185'),'as':_0xdd70('0x13c')});db[_0xdd70('0xee')]['belongsToMany'](db['SmsQueue'],{'through':_0xdd70('0x18e'),'as':_0xdd70('0x13d')});db[_0xdd70('0xee')]['belongsToMany'](db[_0xdd70('0x13e')],{'through':_0xdd70('0x193'),'as':'OpenchannelQueues'});db[_0xdd70('0xee')]['belongsToMany'](db[_0xdd70('0x10f')],{'through':_0xdd70('0x1d4'),'as':_0xdd70('0x140')});db['Team'][_0xdd70('0x12b')](db[_0xdd70('0x13b')],{'through':_0xdd70('0x1d5'),'as':_0xdd70('0x141')});db['Campaign'][_0xdd70('0x11a')](db[_0xdd70('0x72')],{'as':_0xdd70('0x1d6'),'foreignKey':_0xdd70('0x1a1')});db[_0xdd70('0x1a0')][_0xdd70('0x11a')](db[_0xdd70('0x76')],{'as':_0xdd70('0x154'),'foreignKey':_0xdd70('0x1a1')});db[_0xdd70('0x1a0')]['hasMany'](db[_0xdd70('0x78')],{'as':_0xdd70('0x155'),'foreignKey':_0xdd70('0x1a1')});db[_0xdd70('0x1a0')][_0xdd70('0x11a')](db[_0xdd70('0x74')],{'as':_0xdd70('0x156'),'foreignKey':'CampaignId'});db[_0xdd70('0x1a0')][_0xdd70('0x128')](db[_0xdd70('0x2a')],{'as':_0xdd70('0x2a'),'foreignKey':_0xdd70('0x158')});db[_0xdd70('0x1a0')][_0xdd70('0x128')](db[_0xdd70('0x2a')],{'as':'TrunkBackup','foreignKey':_0xdd70('0x15a')});db[_0xdd70('0x1a0')][_0xdd70('0x128')](db[_0xdd70('0x85')],{'as':_0xdd70('0x85'),'foreignKey':_0xdd70('0x15b')});db['Campaign']['belongsTo'](db[_0xdd70('0xe9')],{'as':_0xdd70('0xe9'),'foreignKey':_0xdd70('0x1d7')});db['Campaign'][_0xdd70('0x12b')](db['CmList'],{'as':_0xdd70('0x1d8'),'through':_0xdd70('0x1d9')});db[_0xdd70('0x1a0')]['belongsToMany'](db['CmList'],{'as':_0xdd70('0x160'),'through':_0xdd70('0x1da')});db[_0xdd70('0xf3')][_0xdd70('0x128')](db[_0xdd70('0x68')],{'as':_0xdd70('0x68'),'foreignKey':_0xdd70('0x19a')});db[_0xdd70('0xf7')][_0xdd70('0x128')](db[_0xdd70('0x42')],{});db['MailTransferReport'][_0xdd70('0x128')](db[_0xdd70('0x123')],{});db[_0xdd70('0xf7')][_0xdd70('0x128')](db[_0xdd70('0x3c')],{'foreignKey':'FromMailAccountId','as':'FromAccount'});db['MailTransferReport']['belongsTo'](db[_0xdd70('0x13')],{'foreignKey':_0xdd70('0x1db'),'as':_0xdd70('0x1dc')});db[_0xdd70('0xf7')][_0xdd70('0x128')](db[_0xdd70('0x13')],{'foreignKey':_0xdd70('0x1dd'),'as':_0xdd70('0x1de')});db[_0xdd70('0xf7')]['belongsTo'](db[_0xdd70('0x3e')],{'foreignKey':_0xdd70('0x1df'),'as':'ToQueue'});db[_0xdd70('0xf7')][_0xdd70('0x128')](db[_0xdd70('0x3c')],{'foreignKey':_0xdd70('0x1e0'),'as':'ToAccount'});db[_0xdd70('0xf9')]['belongsTo'](db[_0xdd70('0x199')],{});db[_0xdd70('0xf9')][_0xdd70('0x128')](db[_0xdd70('0x66')],{});db[_0xdd70('0xf9')][_0xdd70('0x128')](db['ChatWebsite'],{'foreignKey':_0xdd70('0x1e1'),'as':_0xdd70('0x1e2')});db[_0xdd70('0xf9')][_0xdd70('0x128')](db[_0xdd70('0x13')],{'foreignKey':'FromUserId','as':_0xdd70('0x1dc')});db[_0xdd70('0xf9')][_0xdd70('0x128')](db[_0xdd70('0x13')],{'foreignKey':_0xdd70('0x1dd'),'as':'ToAgent'});db[_0xdd70('0xf9')]['belongsTo'](db[_0xdd70('0x6a')],{'foreignKey':_0xdd70('0x1e3'),'as':_0xdd70('0x1e4')});db[_0xdd70('0xf9')][_0xdd70('0x128')](db[_0xdd70('0x142')],{'foreignKey':'ToChatWebsiteId','as':_0xdd70('0x1e5')});db[_0xdd70('0xfb')][_0xdd70('0x128')](db['FaxMessage'],{});db['FaxTransferReport']['belongsTo'](db[_0xdd70('0x122')],{});db[_0xdd70('0xfb')][_0xdd70('0x128')](db[_0xdd70('0x48')],{'foreignKey':'FromFaxAccountId','as':_0xdd70('0x1e2')});db[_0xdd70('0xfb')][_0xdd70('0x128')](db[_0xdd70('0x13')],{'foreignKey':_0xdd70('0x1db'),'as':_0xdd70('0x1dc')});db[_0xdd70('0xfb')]['belongsTo'](db['User'],{'foreignKey':'ToUserId','as':_0xdd70('0x1de')});db[_0xdd70('0xfb')][_0xdd70('0x128')](db[_0xdd70('0x4f')],{'foreignKey':_0xdd70('0x1e6'),'as':'ToQueue'});db['FaxTransferReport']['belongsTo'](db['FaxAccount'],{'foreignKey':_0xdd70('0x1e7'),'as':_0xdd70('0x1e5')});db[_0xdd70('0xfd')][_0xdd70('0x128')](db[_0xdd70('0x5e')],{});db[_0xdd70('0xfd')][_0xdd70('0x128')](db[_0xdd70('0x135')],{});db[_0xdd70('0xfd')][_0xdd70('0x128')](db[_0xdd70('0x5a')],{'foreignKey':'FromOpenchannelAccountId','as':_0xdd70('0x1e2')});db[_0xdd70('0xfd')][_0xdd70('0x128')](db[_0xdd70('0x13')],{'foreignKey':_0xdd70('0x1db'),'as':'FromAgent'});db[_0xdd70('0xfd')][_0xdd70('0x128')](db[_0xdd70('0x13')],{'foreignKey':'ToUserId','as':_0xdd70('0x1de')});db['OpenchannelTransferReport'][_0xdd70('0x128')](db[_0xdd70('0x13e')],{'foreignKey':_0xdd70('0x1e8'),'as':_0xdd70('0x1e4')});db[_0xdd70('0xfd')]['belongsTo'](db[_0xdd70('0x5a')],{'foreignKey':_0xdd70('0x1e9'),'as':'ToAccount'});db[_0xdd70('0x1ea')][_0xdd70('0x128')](db[_0xdd70('0x189')],{});db[_0xdd70('0x1ea')][_0xdd70('0x128')](db[_0xdd70('0x55')],{});db['SmsTransferReport']['belongsTo'](db[_0xdd70('0x187')],{'foreignKey':'FromSmsAccountId','as':_0xdd70('0x1e2')});db[_0xdd70('0x1ea')][_0xdd70('0x128')](db[_0xdd70('0x13')],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0xdd70('0x1ea')]['belongsTo'](db[_0xdd70('0x13')],{'foreignKey':_0xdd70('0x1dd'),'as':_0xdd70('0x1de')});db[_0xdd70('0x1ea')][_0xdd70('0x128')](db[_0xdd70('0x58')],{'foreignKey':_0xdd70('0x1eb'),'as':'ToQueue'});db[_0xdd70('0x1ea')][_0xdd70('0x128')](db[_0xdd70('0x187')],{'foreignKey':_0xdd70('0x1ec'),'as':_0xdd70('0x1e5')});db[_0xdd70('0x12c')][_0xdd70('0x11a')](db[_0xdd70('0x81')],{'as':'Dispositions','foreignKey':_0xdd70('0x16e'),'onDelete':_0xdd70('0x118')});db[_0xdd70('0x12c')][_0xdd70('0x11a')](db['CmCustomField'],{'as':'CustomFields','foreignKey':_0xdd70('0x16e')});db[_0xdd70('0x12c')][_0xdd70('0x11a')](db['CmContact'],{'as':_0xdd70('0x1ed'),'onDelete':_0xdd70('0x118'),'foreignKey':_0xdd70('0x16e')});db[_0xdd70('0x12c')][_0xdd70('0x11a')](db[_0xdd70('0x76')],{'as':_0xdd70('0x154'),'foreignKey':_0xdd70('0x16e')});db[_0xdd70('0x12c')][_0xdd70('0x11a')](db[_0xdd70('0x78')],{'as':_0xdd70('0x11e'),'foreignKey':_0xdd70('0x16e')});db['CmList']['hasMany'](db[_0xdd70('0x7a')],{'as':_0xdd70('0x7a'),'foreignKey':_0xdd70('0x16e')});db[_0xdd70('0x12c')][_0xdd70('0x12b')](db[_0xdd70('0x138')],{'as':_0xdd70('0x1ee'),'through':_0xdd70('0x15d')});db[_0xdd70('0x12c')][_0xdd70('0x12b')](db['User'],{'as':_0xdd70('0x15e'),'through':_0xdd70('0x12d')});db[_0xdd70('0x13b')]['hasMany'](db[_0xdd70('0x19')],{'as':_0xdd70('0x11d'),'onDelete':_0xdd70('0x118')});db[_0xdd70('0x13b')][_0xdd70('0x12b')](db[_0xdd70('0x13')],{'as':_0xdd70('0x15e'),'through':_0xdd70('0x114')});db[_0xdd70('0x13b')][_0xdd70('0x12b')](db[_0xdd70('0xee')],{'through':_0xdd70('0x1d5'),'as':_0xdd70('0x15f')});db[_0xdd70('0x101')][_0xdd70('0x11a')](db[_0xdd70('0x13')],{'as':'Users','foreignKey':_0xdd70('0x1ef')});db[_0xdd70('0x101')]['hasMany'](db['UserProfileSection'],{'as':_0xdd70('0x1f0'),'foreignKey':'userProfileId','onDelete':_0xdd70('0x118')});db['UserProfileSection'][_0xdd70('0x11a')](db[_0xdd70('0x103')],{'as':'Resources','foreignKey':_0xdd70('0x1f1'),'onDelete':_0xdd70('0x118')});db[_0xdd70('0x105')][_0xdd70('0x11a')](db[_0xdd70('0x81')],{'as':_0xdd70('0x169'),'foreignKey':_0xdd70('0x1f2'),'onDelete':'cascade'});db[_0xdd70('0x105')]['hasMany'](db[_0xdd70('0x7f')],{'as':'Answers','foreignKey':_0xdd70('0x1f2')});db[_0xdd70('0x105')][_0xdd70('0x11a')](db[_0xdd70('0x10a')],{'as':_0xdd70('0x16b'),'foreignKey':_0xdd70('0x1f2')});db[_0xdd70('0x105')]['hasMany'](db['WhatsappInteraction'],{'as':_0xdd70('0x16c')});db[_0xdd70('0x105')][_0xdd70('0x11a')](db[_0xdd70('0x107')],{'as':_0xdd70('0x14f')});db['WhatsappAccount']['belongsTo'](db['CmList'],{'as':_0xdd70('0x16d'),'foreignKey':_0xdd70('0x16e')});db['WhatsappAccount'][_0xdd70('0x128')](db[_0xdd70('0x87')],{'as':_0xdd70('0x15c'),'foreignKey':_0xdd70('0x180')});db[_0xdd70('0x105')][_0xdd70('0x12b')](db[_0xdd70('0x13')],{'as':_0xdd70('0x15e'),'through':_0xdd70('0x1f3')});db[_0xdd70('0x107')]['belongsTo'](db['User'],{'onDelete':_0xdd70('0x17a')});db[_0xdd70('0x107')][_0xdd70('0x128')](db['WhatsappQueue'],{'onDelete':_0xdd70('0x17a')});db[_0xdd70('0x107')][_0xdd70('0x128')](db[_0xdd70('0x105')],{'onDelete':_0xdd70('0x17a')});db[_0xdd70('0x107')]['belongsTo'](db[_0xdd70('0x85')],{'onDelete':_0xdd70('0x17a'),'foreignKey':_0xdd70('0x15b')});db[_0xdd70('0x107')][_0xdd70('0x128')](db[_0xdd70('0x174')],{'onDelete':_0xdd70('0x17a'),'foreignKey':_0xdd70('0x17b')});db[_0xdd70('0x124')][_0xdd70('0x11a')](db['WhatsappMessage'],{'as':_0xdd70('0x16b'),'onDelete':_0xdd70('0x118'),'foreignKey':_0xdd70('0x1f4')});db['WhatsappInteraction'][_0xdd70('0x128')](db[_0xdd70('0x105')],{'as':'Account','foreignKey':_0xdd70('0x1f2')});db[_0xdd70('0x124')][_0xdd70('0x128')](db[_0xdd70('0x70')],{'as':_0xdd70('0x164'),'foreignKey':_0xdd70('0x165')});db['WhatsappInteraction']['belongsTo'](db['User'],{'as':_0xdd70('0x173'),'foreignKey':_0xdd70('0x119')});db[_0xdd70('0x124')][_0xdd70('0x12b')](db[_0xdd70('0x174')],{'through':_0xdd70('0x1f5'),'as':_0xdd70('0x176')});db[_0xdd70('0x124')][_0xdd70('0x12b')](db['Tag'],{'through':_0xdd70('0x1f5'),'as':_0xdd70('0x18d')});db[_0xdd70('0x124')][_0xdd70('0x12b')](db['User'],{'as':'Users','through':_0xdd70('0x137'),'foreignKey':_0xdd70('0x1f4')});db[_0xdd70('0x10a')][_0xdd70('0x128')](db[_0xdd70('0x13')],{'as':_0xdd70('0x13')});db[_0xdd70('0x10a')]['belongsTo'](db[_0xdd70('0x70')],{'onDelete':_0xdd70('0x118'),'as':_0xdd70('0x164')});db[_0xdd70('0x10a')][_0xdd70('0x128')](db[_0xdd70('0x124')],{'onDelete':_0xdd70('0x118'),'as':'Interaction','foreignKey':'WhatsappInteractionId'});db[_0xdd70('0x10a')][_0xdd70('0x128')](db[_0xdd70('0x105')],{'as':_0xdd70('0x172'),'foreignKey':_0xdd70('0x1f2')});db[_0xdd70('0x10c')][_0xdd70('0x128')](db[_0xdd70('0x105')],{});db[_0xdd70('0x10c')][_0xdd70('0x128')](db[_0xdd70('0x12c')],{'as':_0xdd70('0x16d'),'foreignKey':_0xdd70('0x16e')});db[_0xdd70('0x10c')][_0xdd70('0x128')](db[_0xdd70('0x70')],{'as':_0xdd70('0x164'),'foreignKey':_0xdd70('0x165')});db[_0xdd70('0x10c')]['belongsTo'](db[_0xdd70('0x124')],{});db['WhatsappQueueReport'][_0xdd70('0x128')](db[_0xdd70('0x10f')],{});db['WhatsappQueueReport'][_0xdd70('0x128')](db[_0xdd70('0x10a')],{});db[_0xdd70('0x10c')][_0xdd70('0x128')](db[_0xdd70('0x13')],{});db[_0xdd70('0x10e')][_0xdd70('0x128')](db[_0xdd70('0x10a')],{});db[_0xdd70('0x10e')][_0xdd70('0x128')](db[_0xdd70('0x124')],{});db[_0xdd70('0x10e')][_0xdd70('0x128')](db[_0xdd70('0x105')],{'foreignKey':_0xdd70('0x1f6'),'as':_0xdd70('0x1e2')});db[_0xdd70('0x10e')]['belongsTo'](db[_0xdd70('0x105')],{'foreignKey':_0xdd70('0x1f7'),'as':'ToAccount'});db[_0xdd70('0x10e')][_0xdd70('0x128')](db[_0xdd70('0x10f')],{'foreignKey':'ToQueueId','as':_0xdd70('0x1e4')});db[_0xdd70('0x10e')]['belongsTo'](db['User'],{'foreignKey':_0xdd70('0x1db'),'as':_0xdd70('0x1dc')});db[_0xdd70('0x10e')][_0xdd70('0x128')](db[_0xdd70('0x13')],{'foreignKey':_0xdd70('0x1dd'),'as':'ToAgent'});db[_0xdd70('0x10f')][_0xdd70('0x12b')](db[_0xdd70('0x13')],{'as':'Agents','through':_0xdd70('0x1f8'),'foreignKey':_0xdd70('0x1f9')});db[_0xdd70('0x10f')][_0xdd70('0x12b')](db['Team'],{'through':_0xdd70('0x1d4'),'as':_0xdd70('0x15f')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index f338d74..9fe3a75 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x030f=['./api/voiceMusicOnHold','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','/api/voice/dials/reports','./api/voiceDialReport','/api/members/reports','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','/api/sms/accounts','/api/sms/applications','./api/smsApplication','/api/sms/interactions','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','./api/openchannelMessage','./api/openchannelQueue','/api/chat/websites','/api/openchannel/reports/queue','/api/chat/applications','./api/chatApplication','./api/chatMessage','/api/chat/offline_messages','/api/chat/queues','/api/chat/groups','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','/api/cm/contacts','/api/cm/hopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','/api/cm/custom_fields','./api/cmCustomField','/api/actions','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','/api/intervals','./api/interval','/api/pauses','/api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','./api/sound','/api/tags','./api/tag','/api/templates','./api/trigger','/api/variables','./api/variable','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','/api/analytics/default_reports','/api/analytics/extracted_reports','./api/analyticExtractedReport','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','/api/integrations/salesforce/fields','./api/intSalesforceField','./api/intSugarcrmAccount','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','/api/integrations/desk/fields','/api/integrations/zoho/accounts','./api/intZohoAccount','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','/api/integrations/freshsales/accounts','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','./api/jscriptySessionReport','/api/sms/reports/queue','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','./api/jscriptyProject','/api/settings','/api/square/odbc','/api/square/projects','/api/square/recordings','/api/square/messages','/api/teams','./api/team','/api/campaigns','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','./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/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/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/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','/api/auth/local','./api/authLocal','./api/authGoogle','/api/jira','./api/jira','./api/system','/api/pm2','/apidoc','static','join','root','/www','/demo','snippet','3.0.0','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','username','password','street','mobile','fax','code','accessKey','channelSecret','accessToken','authToken','consumerKey','consumerSecret','calleridnum','exten','vidaooApiKey','clientEmail','privateKey','accesskeyid','secretaccesskey','key','accountSid','localstationid','dsn','secret','isPlainObject','isArray','isString','replace','includes','lodash','path','express','express-winston','util','./config/environment','api','./config/logger','auth','default','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','body','\x20body=%s','headers','x-forwarded-for','connection','remoteAddress','url','responseTime','user','name','role','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','method','statusCode','other','agent_id','agent_name','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','./api/voiceExtension','/api/voice/mohs'];(function(_0x58a333,_0x2092b8){var _0x539d9a=function(_0x12dc75){while(--_0x12dc75){_0x58a333['push'](_0x58a333['shift']());}};_0x539d9a(++_0x2092b8);}(_0x030f,0x10e));var _0xf030=function(_0x3a9f3a,_0x4a06d2){_0x3a9f3a=_0x3a9f3a-0x0;var _0x18eb25=_0x030f[_0x3a9f3a];return _0x18eb25;};'use strict';var _=require(_0xf030('0x0'));var path=require(_0xf030('0x1'));var express=require(_0xf030('0x2'));var ewinston=require(_0xf030('0x3'));var util=require(_0xf030('0x4'));var errors=require('./errors');var config=require(_0xf030('0x5'));var logger=require('./config/logger')(_0xf030('0x6'));var authLogger=require(_0xf030('0x7'))(_0xf030('0x8'));exports[_0xf030('0x9')]=function(_0x4b9759){_0x4b9759[_0xf030('0xa')](ewinston['logger']({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0xd1bca9,_0x237b60){var _0x40d066=_0xf030('0xb');if(!_['isEmpty'](_0xd1bca9[_0xf030('0xc')])){_0x40d066+=_0xf030('0xd');var _0x17a9d7=_0xd1bca9[_0xf030('0xc')];maskSensitiveData(_0x17a9d7);}return util['format'](_0x40d066,_0xd1bca9['method'],_0xd1bca9[_0xf030('0xe')][_0xf030('0xf')]?_0xd1bca9[_0xf030('0xe')]['x-forwarded-for']:_0xd1bca9[_0xf030('0x10')][_0xf030('0x11')]||_0xd1bca9['ip'],_0xd1bca9[_0xf030('0x12')],_0x237b60['statusCode'],_0x237b60[_0xf030('0x13')],_0xd1bca9[_0xf030('0x14')]?_0xd1bca9[_0xf030('0x14')]['id']:null,_0xd1bca9['user']?_0xd1bca9[_0xf030('0x14')][_0xf030('0x15')]:null,_0xd1bca9['user']?_0xd1bca9[_0xf030('0x14')][_0xf030('0x16')]:null,_0x17a9d7?util[_0xf030('0x17')](_0x17a9d7,![],null):'');}}));_0x4b9759[_0xf030('0xa')](ewinston['logger']({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x39bdae,_0x31deb3){var _0x3c0efe=_0xf030('0x18');if(_0x39bdae[_0xf030('0xc')]&&_0x39bdae['body'][_0xf030('0x19')]&&_0x39bdae[_0xf030('0xc')]['agent_id']){_0x3c0efe=_0xf030('0x1a');}return util['format'](_0x3c0efe,_0x39bdae[_0xf030('0x1b')],_0x39bdae['headers'][_0xf030('0xf')]?_0x39bdae[_0xf030('0xe')]['x-forwarded-for']:_0x39bdae[_0xf030('0x10')][_0xf030('0x11')]||_0x39bdae['ip'],_0x39bdae['url'],_0x31deb3[_0xf030('0x1c')],_0x31deb3['responseTime'],_0x39bdae[_0xf030('0x14')]?_0x39bdae[_0xf030('0x14')]['id']:null,_0x39bdae['user']?_0x39bdae[_0xf030('0x14')][_0xf030('0x15')]:null,_0x39bdae[_0xf030('0x14')]?_0x39bdae[_0xf030('0x14')][_0xf030('0x16')]:null,_0x39bdae[_0xf030('0xc')]&&_0x39bdae['body'][_0xf030('0x19')]?_0x39bdae[_0xf030('0xc')][_0xf030('0x19')]:_0xf030('0x1d'),_0x39bdae[_0xf030('0xc')]&&_0x39bdae['body']['agent_id']?_0x39bdae[_0xf030('0xc')][_0xf030('0x1e')]:'',_0x39bdae[_0xf030('0xc')]&&_0x39bdae[_0xf030('0xc')]['agent_name']?_0x39bdae[_0xf030('0xc')][_0xf030('0x1f')]:'');},'ignoreRoute':function(_0x13b520){var _0x111b30=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x111b30['test'](_0x13b520[_0xf030('0x12')]);}}));_0x4b9759['use'](_0xf030('0x20'),require(_0xf030('0x21')));_0x4b9759['use'](_0xf030('0x22'),require(_0xf030('0x23')));_0x4b9759[_0xf030('0xa')](_0xf030('0x24'),require(_0xf030('0x25')));_0x4b9759['use']('/api/voice/extensions',require(_0xf030('0x26')));_0x4b9759[_0xf030('0xa')](_0xf030('0x27'),require(_0xf030('0x28')));_0x4b9759['use']('/api/voice/queues',require('./api/voiceQueue'));_0x4b9759['use'](_0xf030('0x29'),require(_0xf030('0x2a')));_0x4b9759[_0xf030('0xa')](_0xf030('0x2b'),require(_0xf030('0x2c')));_0x4b9759[_0xf030('0xa')]('/api/voice/mails',require(_0xf030('0x2d')));_0x4b9759[_0xf030('0xa')](_0xf030('0x2e'),require(_0xf030('0x2f')));_0x4b9759[_0xf030('0xa')](_0xf030('0x30'),require('./api/voiceCallReport'));_0x4b9759['use'](_0xf030('0x31'),require(_0xf030('0x32')));_0x4b9759['use']('/api/voice/agents/reports',require('./api/voiceAgentReport'));_0x4b9759['use']('/api/voice/queues/reports',require('./api/voiceQueueReport'));_0x4b9759[_0xf030('0xa')](_0xf030('0x33'),require('./api/memberReport'));_0x4b9759[_0xf030('0xa')](_0xf030('0x34'),require(_0xf030('0x35')));_0x4b9759[_0xf030('0xa')](_0xf030('0x36'),require(_0xf030('0x37')));_0x4b9759['use']('/api/mail/out_servers',require(_0xf030('0x38')));_0x4b9759['use'](_0xf030('0x39'),require(_0xf030('0x3a')));_0x4b9759['use']('/api/mail/queues',require(_0xf030('0x3b')));_0x4b9759['use'](_0xf030('0x3c'),require(_0xf030('0x3d')));_0x4b9759[_0xf030('0xa')](_0xf030('0x3e'),require(_0xf030('0x3f')));_0x4b9759[_0xf030('0xa')](_0xf030('0x40'),require(_0xf030('0x41')));_0x4b9759[_0xf030('0xa')](_0xf030('0x42'),require(_0xf030('0x43')));_0x4b9759['use'](_0xf030('0x44'),require(_0xf030('0x45')));_0x4b9759['use'](_0xf030('0x46'),require(_0xf030('0x47')));_0x4b9759[_0xf030('0xa')](_0xf030('0x48'),require(_0xf030('0x49')));_0x4b9759['use']('/api/fax/accounts',require(_0xf030('0x4a')));_0x4b9759['use'](_0xf030('0x4b'),require(_0xf030('0x4c')));_0x4b9759[_0xf030('0xa')](_0xf030('0x4d'),require(_0xf030('0x4e')));_0x4b9759['use'](_0xf030('0x4f'),require(_0xf030('0x50')));_0x4b9759[_0xf030('0xa')](_0xf030('0x51'),require(_0xf030('0x52')));_0x4b9759[_0xf030('0xa')](_0xf030('0x53'),require('./api/faxQueueReport'));_0x4b9759[_0xf030('0xa')](_0xf030('0x54'),require('./api/smsAccount'));_0x4b9759['use'](_0xf030('0x55'),require(_0xf030('0x56')));_0x4b9759['use'](_0xf030('0x57'),require('./api/smsInteraction'));_0x4b9759[_0xf030('0xa')](_0xf030('0x58'),require(_0xf030('0x59')));_0x4b9759['use'](_0xf030('0x5a'),require(_0xf030('0x5b')));_0x4b9759[_0xf030('0xa')](_0xf030('0x5c'),require('./api/openchannelAccount'));_0x4b9759['use'](_0xf030('0x5d'),require(_0xf030('0x5e')));_0x4b9759[_0xf030('0xa')](_0xf030('0x5f'),require(_0xf030('0x60')));_0x4b9759[_0xf030('0xa')]('/api/openchannel/messages',require(_0xf030('0x61')));_0x4b9759[_0xf030('0xa')]('/api/openchannel/queues',require(_0xf030('0x62')));_0x4b9759[_0xf030('0xa')](_0xf030('0x63'),require('./api/chatWebsite'));_0x4b9759[_0xf030('0xa')](_0xf030('0x64'),require('./api/openchannelQueueReport'));_0x4b9759['use'](_0xf030('0x65'),require(_0xf030('0x66')));_0x4b9759[_0xf030('0xa')]('/api/chat/interactions',require('./api/chatInteraction'));_0x4b9759['use']('/api/chat/messages',require(_0xf030('0x67')));_0x4b9759[_0xf030('0xa')](_0xf030('0x68'),require('./api/chatOfflineMessage'));_0x4b9759[_0xf030('0xa')](_0xf030('0x69'),require('./api/chatQueue'));_0x4b9759['use'](_0xf030('0x6a'),require('./api/chatGroup'));_0x4b9759[_0xf030('0xa')](_0xf030('0x6b'),require(_0xf030('0x6c')));_0x4b9759[_0xf030('0xa')](_0xf030('0x6d'),require('./api/cmCompany'));_0x4b9759[_0xf030('0xa')](_0xf030('0x6e'),require('./api/cmContact'));_0x4b9759['use'](_0xf030('0x6f'),require('./api/cmHopper'));_0x4b9759['use'](_0xf030('0x70'),require(_0xf030('0x71')));_0x4b9759['use'](_0xf030('0x72'),require(_0xf030('0x73')));_0x4b9759[_0xf030('0xa')](_0xf030('0x74'),require('./api/cmHopperHistory'));_0x4b9759[_0xf030('0xa')](_0xf030('0x75'),require(_0xf030('0x76')));_0x4b9759[_0xf030('0xa')](_0xf030('0x77'),require('./api/action'));_0x4b9759['use'](_0xf030('0x78'),require(_0xf030('0x79')));_0x4b9759['use'](_0xf030('0x7a'),require(_0xf030('0x7b')));_0x4b9759[_0xf030('0xa')](_0xf030('0x7c'),require('./api/disposition'));_0x4b9759[_0xf030('0xa')]('/api/conditions',require('./api/condition'));_0x4b9759[_0xf030('0xa')](_0xf030('0x7d'),require(_0xf030('0x7e')));_0x4b9759[_0xf030('0xa')](_0xf030('0x7f'),require('./api/pause'));_0x4b9759['use'](_0xf030('0x80'),require('./api/cdr'));_0x4b9759[_0xf030('0xa')](_0xf030('0x81'),require(_0xf030('0x82')));_0x4b9759[_0xf030('0xa')](_0xf030('0x83'),require(_0xf030('0x84')));_0x4b9759[_0xf030('0xa')]('/api/sounds',require(_0xf030('0x85')));_0x4b9759[_0xf030('0xa')](_0xf030('0x86'),require(_0xf030('0x87')));_0x4b9759[_0xf030('0xa')](_0xf030('0x88'),require('./api/template'));_0x4b9759[_0xf030('0xa')]('/api/triggers',require(_0xf030('0x89')));_0x4b9759[_0xf030('0xa')](_0xf030('0x8a'),require(_0xf030('0x8b')));_0x4b9759[_0xf030('0xa')]('/api/integrations',require(_0xf030('0x8c')));_0x4b9759[_0xf030('0xa')](_0xf030('0x8d'),require(_0xf030('0x8e')));_0x4b9759[_0xf030('0xa')](_0xf030('0x8f'),require('./api/analyticCustomReport'));_0x4b9759[_0xf030('0xa')](_0xf030('0x90'),require('./api/analyticDefaultReport'));_0x4b9759['use'](_0xf030('0x91'),require(_0xf030('0x92')));_0x4b9759[_0xf030('0xa')]('/api/analytics/metrics',require(_0xf030('0x93')));_0x4b9759[_0xf030('0xa')](_0xf030('0x94'),require(_0xf030('0x95')));_0x4b9759[_0xf030('0xa')](_0xf030('0x96'),require(_0xf030('0x97')));_0x4b9759[_0xf030('0xa')](_0xf030('0x98'),require(_0xf030('0x99')));_0x4b9759[_0xf030('0xa')](_0xf030('0x9a'),require('./api/intSalesforceConfiguration'));_0x4b9759[_0xf030('0xa')](_0xf030('0x9b'),require(_0xf030('0x9c')));_0x4b9759[_0xf030('0xa')]('/api/integrations/sugarcrm/accounts',require(_0xf030('0x9d')));_0x4b9759['use']('/api/integrations/sugarcrm/configurations',require(_0xf030('0x9e')));_0x4b9759[_0xf030('0xa')](_0xf030('0x9f'),require(_0xf030('0xa0')));_0x4b9759[_0xf030('0xa')](_0xf030('0xa1'),require(_0xf030('0xa2')));_0x4b9759['use'](_0xf030('0xa3'),require('./api/intDeskConfiguration'));_0x4b9759['use'](_0xf030('0xa4'),require('./api/intDeskField'));_0x4b9759[_0xf030('0xa')](_0xf030('0xa5'),require(_0xf030('0xa6')));_0x4b9759[_0xf030('0xa')]('/api/integrations/zoho/configurations',require(_0xf030('0xa7')));_0x4b9759[_0xf030('0xa')](_0xf030('0xa8'),require(_0xf030('0xa9')));_0x4b9759[_0xf030('0xa')](_0xf030('0xaa'),require(_0xf030('0xab')));_0x4b9759[_0xf030('0xa')](_0xf030('0xac'),require(_0xf030('0xad')));_0x4b9759[_0xf030('0xa')](_0xf030('0xae'),require(_0xf030('0xaf')));_0x4b9759[_0xf030('0xa')]('/api/integrations/freshdesk/accounts',require('./api/intFreshdeskAccount'));_0x4b9759[_0xf030('0xa')](_0xf030('0xb0'),require(_0xf030('0xb1')));_0x4b9759[_0xf030('0xa')](_0xf030('0xb2'),require(_0xf030('0xb3')));_0x4b9759['use'](_0xf030('0xb4'),require('./api/intVtigerAccount'));_0x4b9759[_0xf030('0xa')]('/api/integrations/vtiger/configurations',require(_0xf030('0xb5')));_0x4b9759[_0xf030('0xa')](_0xf030('0xb6'),require('./api/intVtigerField'));_0x4b9759[_0xf030('0xa')](_0xf030('0xb7'),require(_0xf030('0xb8')));_0x4b9759['use']('/api/integrations/servicenow/configurations',require('./api/intServicenowConfiguration'));_0x4b9759[_0xf030('0xa')](_0xf030('0xb9'),require(_0xf030('0xba')));_0x4b9759['use'](_0xf030('0xbb'),require(_0xf030('0xbc')));_0x4b9759[_0xf030('0xa')]('/api/integrations/dynamics365/configurations',require(_0xf030('0xbd')));_0x4b9759[_0xf030('0xa')](_0xf030('0xbe'),require('./api/intDynamics365Field'));_0x4b9759[_0xf030('0xa')](_0xf030('0xbf'),require('./api/intFreshsalesAccount'));_0x4b9759['use']('/api/integrations/freshsales/configurations',require(_0xf030('0xc0')));_0x4b9759[_0xf030('0xa')](_0xf030('0xc1'),require('./api/intFreshsalesField'));_0x4b9759[_0xf030('0xa')](_0xf030('0xc2'),require(_0xf030('0xc3')));_0x4b9759[_0xf030('0xa')](_0xf030('0xc4'),require(_0xf030('0xc5')));_0x4b9759[_0xf030('0xa')](_0xf030('0xc6'),require(_0xf030('0xc7')));_0x4b9759[_0xf030('0xa')](_0xf030('0xc8'),require('./api/jscriptyAnswerReport'));_0x4b9759['use'](_0xf030('0xc9'),require(_0xf030('0xca')));_0x4b9759['use']('/api/jscripty/sessions/reports',require(_0xf030('0xcb')));_0x4b9759[_0xf030('0xa')](_0xf030('0xcc'),require('./api/smsQueueReport'));_0x4b9759['use'](_0xf030('0xcd'),require(_0xf030('0xce')));_0x4b9759['use'](_0xf030('0xcf'),require(_0xf030('0xd0')));_0x4b9759[_0xf030('0xa')]('/api/jscripty/projects',require(_0xf030('0xd1')));_0x4b9759['use'](_0xf030('0xd2'),require('./api/setting'));_0x4b9759['use'](_0xf030('0xd3'),require('./api/squareOdbc'));_0x4b9759['use'](_0xf030('0xd4'),require('./api/squareProject'));_0x4b9759[_0xf030('0xa')](_0xf030('0xd5'),require('./api/squareRecording'));_0x4b9759[_0xf030('0xa')](_0xf030('0xd6'),require('./api/squareMessage'));_0x4b9759[_0xf030('0xa')](_0xf030('0xd7'),require(_0xf030('0xd8')));_0x4b9759[_0xf030('0xa')]('/api/license',require('./api/license'));_0x4b9759[_0xf030('0xa')](_0xf030('0xd9'),require('./api/campaign'));_0x4b9759[_0xf030('0xa')](_0xf030('0xda'),require(_0xf030('0xdb')));_0x4b9759[_0xf030('0xa')](_0xf030('0xdc'),require(_0xf030('0xdd')));_0x4b9759[_0xf030('0xa')](_0xf030('0xde'),require(_0xf030('0xdf')));_0x4b9759[_0xf030('0xa')](_0xf030('0xe0'),require(_0xf030('0xe1')));_0x4b9759[_0xf030('0xa')](_0xf030('0xe2'),require(_0xf030('0xe3')));_0x4b9759[_0xf030('0xa')](_0xf030('0xe4'),require(_0xf030('0xe5')));_0x4b9759[_0xf030('0xa')]('/api/openchannel/reports/transfer',require(_0xf030('0xe6')));_0x4b9759[_0xf030('0xa')](_0xf030('0xe7'),require(_0xf030('0xe8')));_0x4b9759[_0xf030('0xa')](_0xf030('0xe9'),require(_0xf030('0xea')));_0x4b9759['use'](_0xf030('0xeb'),require(_0xf030('0xec')));_0x4b9759[_0xf030('0xa')](_0xf030('0xed'),require(_0xf030('0xee')));_0x4b9759[_0xf030('0xa')](_0xf030('0xef'),require(_0xf030('0xf0')));_0x4b9759[_0xf030('0xa')]('/api/userProfile/resources',require(_0xf030('0xf1')));_0x4b9759[_0xf030('0xa')](_0xf030('0xf2'),require(_0xf030('0xf3')));_0x4b9759[_0xf030('0xa')](_0xf030('0xf4'),require(_0xf030('0xf5')));_0x4b9759['use']('/api/whatsapp/applications',require('./api/whatsappApplication'));_0x4b9759[_0xf030('0xa')](_0xf030('0xf6'),require(_0xf030('0xf7')));_0x4b9759[_0xf030('0xa')](_0xf030('0xf8'),require(_0xf030('0xf9')));_0x4b9759[_0xf030('0xa')](_0xf030('0xfa'),require(_0xf030('0xfb')));_0x4b9759[_0xf030('0xa')](_0xf030('0xfc'),require(_0xf030('0xfd')));_0x4b9759[_0xf030('0xa')](_0xf030('0xfe'),require(_0xf030('0xff')));_0x4b9759[_0xf030('0xa')](_0xf030('0x100'),require(_0xf030('0x101')));_0x4b9759['use'](_0xf030('0x102'),require('./api/realtime'));_0x4b9759[_0xf030('0xa')](_0xf030('0x103'),require(_0xf030('0x104')));_0x4b9759[_0xf030('0xa')]('/api/auth/google',require(_0xf030('0x105')));_0x4b9759[_0xf030('0xa')](_0xf030('0x106'),require(_0xf030('0x107')));_0x4b9759['use']('/api/rpc',require('./api/rpc'));_0x4b9759['use']('/api/version',require('./api/version'));_0x4b9759[_0xf030('0xa')]('/api/system',require(_0xf030('0x108')));_0x4b9759[_0xf030('0xa')](_0xf030('0x109'),require('./api/pm2'));_0x4b9759[_0xf030('0xa')]('/api/webbar',require('./api/webbar'));_0x4b9759[_0xf030('0xa')](_0xf030('0x10a'),express[_0xf030('0x10b')](path[_0xf030('0x10c')](config['root'],'/apidoc')));_0x4b9759[_0xf030('0xa')]('/www',express[_0xf030('0x10b')](path[_0xf030('0x10c')](config[_0xf030('0x10d')],_0xf030('0x10e'))));_0x4b9759[_0xf030('0xa')](_0xf030('0x10f'),express[_0xf030('0x10b')](path[_0xf030('0x10c')](config[_0xf030('0x10d')],_0xf030('0x10f'))));_0x4b9759[_0xf030('0xa')]('/snippet',express[_0xf030('0x10b')](path[_0xf030('0x10c')](config[_0xf030('0x10d')],_0xf030('0x110'),_0xf030('0x111'))));_0x4b9759[_0xf030('0xa')](_0xf030('0x112'),express[_0xf030('0x10b')](path[_0xf030('0x10c')](config[_0xf030('0x10d')],_0xf030('0x113'))));_0x4b9759[_0xf030('0x114')](_0xf030('0x115'))[_0xf030('0x116')](errors[0x194]);_0x4b9759['route']('/*')['get'](function(_0x581909,_0x27574a){_0x27574a[_0xf030('0x117')](path[_0xf030('0x118')](_0x4b9759['get']('appPath')+'/index.html'));});};var sensitiveFields=[_0xf030('0x119'),_0xf030('0x11a'),'newPassword','apiKey','firstName','lastName',_0xf030('0x11b'),'phone',_0xf030('0x11c'),_0xf030('0x11d'),'email','clientId','clientSecret','securityToken',_0xf030('0x11e'),_0xf030('0x11f'),'tenantId','token',_0xf030('0x120'),_0xf030('0x121'),'accessTokenSecret',_0xf030('0x122'),_0xf030('0x123'),_0xf030('0x124'),'membername','calleridname',_0xf030('0x125'),_0xf030('0x126'),_0xf030('0x127'),_0xf030('0x128'),_0xf030('0x129'),_0xf030('0x12a'),_0xf030('0x12b'),_0xf030('0x12c'),_0xf030('0x14'),'pass',_0xf030('0x12d'),_0xf030('0x12e'),_0xf030('0x12f'),_0xf030('0x130'),'registry','oldPassword'];function maskSensitiveData(_0x37c3fb){var _0x8753a5=/(?!^)[\s\S](?!$)/g;if(!_[_0xf030('0x131')](_0x37c3fb))return;for(var _0x2c5d5d in _0x37c3fb){if(_[_0xf030('0x132')](_0x37c3fb[_0x2c5d5d])){for(var _0x678d1e=0x0;_0x678d1e<_0x37c3fb[_0x2c5d5d]['length'];_0x678d1e++){maskSensitiveData(_0x37c3fb[_0x2c5d5d][_0x678d1e]);}}else if(_['isPlainObject'](_0x37c3fb[_0x2c5d5d])){maskSensitiveData(_0x37c3fb[_0x2c5d5d]);}else if(_[_0xf030('0x133')](_0x37c3fb[_0x2c5d5d])){_0x37c3fb[_0x2c5d5d]=_0x37c3fb[_0x2c5d5d][_0xf030('0x134')](/{{{/g,'@@{')[_0xf030('0x134')](/}}}/g,'}@@')[_0xf030('0x134')](/{{/g,'@{')[_0xf030('0x134')](/}}/g,'}@');if(_[_0xf030('0x135')](sensitiveFields,_0x2c5d5d)){_0x37c3fb[_0x2c5d5d]=_0x37c3fb[_0x2c5d5d][_0xf030('0x134')](_0x8753a5,'*');}}}} \ No newline at end of file +var _0xd74d=['/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','/api/canned_answers','./api/cannedAnswer','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/cdr','./api/voiceQueuesLog','/api/schedules','./api/schedule','./api/sound','/api/tags','./api/tag','/api/templates','./api/template','/api/triggers','./api/variable','/api/integrations','/api/integrations/reports','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','/api/analytics/extracted_reports','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticTreeReport','/api/integrations/salesforce/configurations','/api/integrations/salesforce/fields','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoField','/api/integrations/zendesk/accounts','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskField','/api/integrations/vtiger/accounts','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','./api/jscriptySessionReport','./api/smsQueueReport','./api/squareReport','/api/square/details/reports','/api/settings','./api/setting','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','/api/teams','./api/team','/api/license','/api/campaigns','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','./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/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/apidoc','join','root','static','/www','/demo','3.0.0','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','appPath','/index.html','username','newPassword','apiKey','lastName','street','phone','mobile','clientId','clientSecret','tenantId','token','channelSecret','accessToken','accessTokenSecret','authToken','consumerKey','membername','calleridname','calleridnum','clientEmail','privateKey','accesskeyid','secretaccesskey','key','pass','accountSid','dsn','secret','oldPassword','isPlainObject','isArray','length','isString','replace','@@{','}@@','lodash','path','util','./errors','./config/logger','api','auth','default','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','\x20body=%s','format','method','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','responseTime','user','role','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','name','other','agent_name','test','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','/api/mail/out_servers','/api/mail/accounts','./api/mailAccount','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','/api/chat/queues','./api/chatQueue','/api/chat/groups','/api/chat/proactive_actions'];(function(_0xd1ce83,_0x4199ec){var _0x51aabb=function(_0xa05538){while(--_0xa05538){_0xd1ce83['push'](_0xd1ce83['shift']());}};_0x51aabb(++_0x4199ec);}(_0xd74d,0xd5));var _0xdd74=function(_0x59cb41,_0x5e2fa6){_0x59cb41=_0x59cb41-0x0;var _0x1022ff=_0xd74d[_0x59cb41];return _0x1022ff;};'use strict';var _=require(_0xdd74('0x0'));var path=require(_0xdd74('0x1'));var express=require('express');var ewinston=require('express-winston');var util=require(_0xdd74('0x2'));var errors=require(_0xdd74('0x3'));var config=require('./config/environment');var logger=require(_0xdd74('0x4'))(_0xdd74('0x5'));var authLogger=require(_0xdd74('0x4'))(_0xdd74('0x6'));exports[_0xdd74('0x7')]=function(_0x52f31d){_0x52f31d[_0xdd74('0x8')](ewinston[_0xdd74('0x9')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x33b487,_0x4fc05a){var _0x3fe150=_0xdd74('0xa');if(!_[_0xdd74('0xb')](_0x33b487[_0xdd74('0xc')])){_0x3fe150+=_0xdd74('0xd');var _0x3ee76a=_0x33b487[_0xdd74('0xc')];maskSensitiveData(_0x3ee76a);}return util[_0xdd74('0xe')](_0x3fe150,_0x33b487[_0xdd74('0xf')],_0x33b487[_0xdd74('0x10')][_0xdd74('0x11')]?_0x33b487[_0xdd74('0x10')]['x-forwarded-for']:_0x33b487[_0xdd74('0x12')][_0xdd74('0x13')]||_0x33b487['ip'],_0x33b487[_0xdd74('0x14')],_0x4fc05a[_0xdd74('0x15')],_0x4fc05a[_0xdd74('0x16')],_0x33b487['user']?_0x33b487[_0xdd74('0x17')]['id']:null,_0x33b487[_0xdd74('0x17')]?_0x33b487[_0xdd74('0x17')]['name']:null,_0x33b487[_0xdd74('0x17')]?_0x33b487[_0xdd74('0x17')][_0xdd74('0x18')]:null,_0x3ee76a?util[_0xdd74('0x19')](_0x3ee76a,![],null):'');}}));_0x52f31d[_0xdd74('0x8')](ewinston['logger']({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x2ce11d,_0x52993e){var _0x436e36=_0xdd74('0x1a');if(_0x2ce11d[_0xdd74('0xc')]&&_0x2ce11d[_0xdd74('0xc')][_0xdd74('0x1b')]&&_0x2ce11d[_0xdd74('0xc')][_0xdd74('0x1c')]){_0x436e36=_0xdd74('0x1d');}return util['format'](_0x436e36,_0x2ce11d[_0xdd74('0xf')],_0x2ce11d[_0xdd74('0x10')][_0xdd74('0x11')]?_0x2ce11d[_0xdd74('0x10')][_0xdd74('0x11')]:_0x2ce11d[_0xdd74('0x12')][_0xdd74('0x13')]||_0x2ce11d['ip'],_0x2ce11d[_0xdd74('0x14')],_0x52993e[_0xdd74('0x15')],_0x52993e[_0xdd74('0x16')],_0x2ce11d[_0xdd74('0x17')]?_0x2ce11d[_0xdd74('0x17')]['id']:null,_0x2ce11d[_0xdd74('0x17')]?_0x2ce11d['user'][_0xdd74('0x1e')]:null,_0x2ce11d[_0xdd74('0x17')]?_0x2ce11d['user'][_0xdd74('0x18')]:null,_0x2ce11d[_0xdd74('0xc')]&&_0x2ce11d[_0xdd74('0xc')]['device']?_0x2ce11d['body'][_0xdd74('0x1b')]:_0xdd74('0x1f'),_0x2ce11d[_0xdd74('0xc')]&&_0x2ce11d['body'][_0xdd74('0x1c')]?_0x2ce11d[_0xdd74('0xc')][_0xdd74('0x1c')]:'',_0x2ce11d[_0xdd74('0xc')]&&_0x2ce11d[_0xdd74('0xc')]['agent_name']?_0x2ce11d[_0xdd74('0xc')][_0xdd74('0x20')]:'');},'ignoreRoute':function(_0x19f4ae){var _0x4afb22=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x4afb22[_0xdd74('0x21')](_0x19f4ae[_0xdd74('0x14')]);}}));_0x52f31d['use'](_0xdd74('0x22'),require(_0xdd74('0x23')));_0x52f31d['use'](_0xdd74('0x24'),require(_0xdd74('0x25')));_0x52f31d[_0xdd74('0x8')](_0xdd74('0x26'),require(_0xdd74('0x27')));_0x52f31d[_0xdd74('0x8')](_0xdd74('0x28'),require(_0xdd74('0x29')));_0x52f31d['use'](_0xdd74('0x2a'),require(_0xdd74('0x2b')));_0x52f31d[_0xdd74('0x8')]('/api/voice/queues',require(_0xdd74('0x2c')));_0x52f31d[_0xdd74('0x8')](_0xdd74('0x2d'),require(_0xdd74('0x2e')));_0x52f31d['use'](_0xdd74('0x2f'),require(_0xdd74('0x30')));_0x52f31d[_0xdd74('0x8')](_0xdd74('0x31'),require(_0xdd74('0x32')));_0x52f31d['use'](_0xdd74('0x33'),require(_0xdd74('0x34')));_0x52f31d[_0xdd74('0x8')](_0xdd74('0x35'),require('./api/voiceCallReport'));_0x52f31d['use'](_0xdd74('0x36'),require(_0xdd74('0x37')));_0x52f31d[_0xdd74('0x8')](_0xdd74('0x38'),require(_0xdd74('0x39')));_0x52f31d[_0xdd74('0x8')](_0xdd74('0x3a'),require(_0xdd74('0x3b')));_0x52f31d['use']('/api/members/reports',require('./api/memberReport'));_0x52f31d['use'](_0xdd74('0x3c'),require(_0xdd74('0x3d')));_0x52f31d[_0xdd74('0x8')](_0xdd74('0x3e'),require('./api/voiceTransferReport'));_0x52f31d[_0xdd74('0x8')](_0xdd74('0x3f'),require('./api/mailServerOut'));_0x52f31d['use'](_0xdd74('0x40'),require(_0xdd74('0x41')));_0x52f31d[_0xdd74('0x8')]('/api/mail/queues',require('./api/mailQueue'));_0x52f31d['use']('/api/mail/substatuses',require(_0xdd74('0x42')));_0x52f31d[_0xdd74('0x8')](_0xdd74('0x43'),require(_0xdd74('0x44')));_0x52f31d[_0xdd74('0x8')]('/api/mail/messages',require(_0xdd74('0x45')));_0x52f31d[_0xdd74('0x8')](_0xdd74('0x46'),require(_0xdd74('0x47')));_0x52f31d[_0xdd74('0x8')](_0xdd74('0x48'),require(_0xdd74('0x49')));_0x52f31d[_0xdd74('0x8')](_0xdd74('0x4a'),require(_0xdd74('0x4b')));_0x52f31d[_0xdd74('0x8')](_0xdd74('0x4c'),require('./api/dashboardItem'));_0x52f31d[_0xdd74('0x8')](_0xdd74('0x4d'),require(_0xdd74('0x4e')));_0x52f31d[_0xdd74('0x8')](_0xdd74('0x4f'),require(_0xdd74('0x50')));_0x52f31d[_0xdd74('0x8')](_0xdd74('0x51'),require(_0xdd74('0x52')));_0x52f31d[_0xdd74('0x8')](_0xdd74('0x53'),require(_0xdd74('0x54')));_0x52f31d[_0xdd74('0x8')](_0xdd74('0x55'),require('./api/faxQueue'));_0x52f31d[_0xdd74('0x8')](_0xdd74('0x56'),require(_0xdd74('0x57')));_0x52f31d[_0xdd74('0x8')](_0xdd74('0x58'),require(_0xdd74('0x59')));_0x52f31d[_0xdd74('0x8')](_0xdd74('0x5a'),require(_0xdd74('0x5b')));_0x52f31d['use'](_0xdd74('0x5c'),require(_0xdd74('0x5d')));_0x52f31d[_0xdd74('0x8')](_0xdd74('0x5e'),require(_0xdd74('0x5f')));_0x52f31d[_0xdd74('0x8')](_0xdd74('0x60'),require(_0xdd74('0x61')));_0x52f31d['use'](_0xdd74('0x62'),require(_0xdd74('0x63')));_0x52f31d['use'](_0xdd74('0x64'),require(_0xdd74('0x65')));_0x52f31d['use'](_0xdd74('0x66'),require(_0xdd74('0x67')));_0x52f31d[_0xdd74('0x8')](_0xdd74('0x68'),require('./api/openchannelMessage'));_0x52f31d[_0xdd74('0x8')](_0xdd74('0x69'),require(_0xdd74('0x6a')));_0x52f31d['use'](_0xdd74('0x6b'),require(_0xdd74('0x6c')));_0x52f31d[_0xdd74('0x8')]('/api/openchannel/reports/queue',require(_0xdd74('0x6d')));_0x52f31d[_0xdd74('0x8')](_0xdd74('0x6e'),require(_0xdd74('0x6f')));_0x52f31d[_0xdd74('0x8')]('/api/chat/interactions',require(_0xdd74('0x70')));_0x52f31d[_0xdd74('0x8')](_0xdd74('0x71'),require(_0xdd74('0x72')));_0x52f31d[_0xdd74('0x8')](_0xdd74('0x73'),require('./api/chatOfflineMessage'));_0x52f31d[_0xdd74('0x8')](_0xdd74('0x74'),require(_0xdd74('0x75')));_0x52f31d[_0xdd74('0x8')](_0xdd74('0x76'),require('./api/chatGroup'));_0x52f31d[_0xdd74('0x8')](_0xdd74('0x77'),require('./api/chatProactiveAction'));_0x52f31d[_0xdd74('0x8')](_0xdd74('0x78'),require(_0xdd74('0x79')));_0x52f31d['use'](_0xdd74('0x7a'),require(_0xdd74('0x7b')));_0x52f31d[_0xdd74('0x8')](_0xdd74('0x7c'),require(_0xdd74('0x7d')));_0x52f31d[_0xdd74('0x8')](_0xdd74('0x7e'),require(_0xdd74('0x7f')));_0x52f31d[_0xdd74('0x8')](_0xdd74('0x80'),require(_0xdd74('0x81')));_0x52f31d[_0xdd74('0x8')](_0xdd74('0x82'),require('./api/cmHopperHistory'));_0x52f31d[_0xdd74('0x8')](_0xdd74('0x83'),require(_0xdd74('0x84')));_0x52f31d[_0xdd74('0x8')](_0xdd74('0x85'),require(_0xdd74('0x86')));_0x52f31d[_0xdd74('0x8')]('/api/automations',require('./api/automation'));_0x52f31d[_0xdd74('0x8')](_0xdd74('0x87'),require(_0xdd74('0x88')));_0x52f31d[_0xdd74('0x8')]('/api/dispositions',require(_0xdd74('0x89')));_0x52f31d[_0xdd74('0x8')](_0xdd74('0x8a'),require(_0xdd74('0x8b')));_0x52f31d[_0xdd74('0x8')](_0xdd74('0x8c'),require(_0xdd74('0x8d')));_0x52f31d[_0xdd74('0x8')](_0xdd74('0x8e'),require(_0xdd74('0x8f')));_0x52f31d[_0xdd74('0x8')](_0xdd74('0x90'),require(_0xdd74('0x91')));_0x52f31d[_0xdd74('0x8')]('/api/voiceQueuesLog',require(_0xdd74('0x92')));_0x52f31d[_0xdd74('0x8')](_0xdd74('0x93'),require(_0xdd74('0x94')));_0x52f31d[_0xdd74('0x8')]('/api/sounds',require(_0xdd74('0x95')));_0x52f31d['use'](_0xdd74('0x96'),require(_0xdd74('0x97')));_0x52f31d[_0xdd74('0x8')](_0xdd74('0x98'),require(_0xdd74('0x99')));_0x52f31d[_0xdd74('0x8')](_0xdd74('0x9a'),require('./api/trigger'));_0x52f31d[_0xdd74('0x8')]('/api/variables',require(_0xdd74('0x9b')));_0x52f31d[_0xdd74('0x8')](_0xdd74('0x9c'),require('./api/integration'));_0x52f31d[_0xdd74('0x8')](_0xdd74('0x9d'),require('./api/integrationReport'));_0x52f31d[_0xdd74('0x8')](_0xdd74('0x9e'),require(_0xdd74('0x9f')));_0x52f31d[_0xdd74('0x8')](_0xdd74('0xa0'),require('./api/analyticDefaultReport'));_0x52f31d[_0xdd74('0x8')](_0xdd74('0xa1'),require('./api/analyticExtractedReport'));_0x52f31d['use'](_0xdd74('0xa2'),require(_0xdd74('0xa3')));_0x52f31d['use'](_0xdd74('0xa4'),require('./api/analyticFieldReport'));_0x52f31d[_0xdd74('0x8')]('/api/analytics/tree_reports',require(_0xdd74('0xa5')));_0x52f31d[_0xdd74('0x8')]('/api/integrations/salesforce/accounts',require('./api/intSalesforceAccount'));_0x52f31d['use'](_0xdd74('0xa6'),require('./api/intSalesforceConfiguration'));_0x52f31d[_0xdd74('0x8')](_0xdd74('0xa7'),require('./api/intSalesforceField'));_0x52f31d[_0xdd74('0x8')](_0xdd74('0xa8'),require(_0xdd74('0xa9')));_0x52f31d[_0xdd74('0x8')](_0xdd74('0xaa'),require(_0xdd74('0xab')));_0x52f31d[_0xdd74('0x8')](_0xdd74('0xac'),require(_0xdd74('0xad')));_0x52f31d['use'](_0xdd74('0xae'),require(_0xdd74('0xaf')));_0x52f31d[_0xdd74('0x8')](_0xdd74('0xb0'),require(_0xdd74('0xb1')));_0x52f31d[_0xdd74('0x8')](_0xdd74('0xb2'),require('./api/intDeskField'));_0x52f31d[_0xdd74('0x8')](_0xdd74('0xb3'),require(_0xdd74('0xb4')));_0x52f31d['use'](_0xdd74('0xb5'),require('./api/intZohoConfiguration'));_0x52f31d['use']('/api/integrations/zoho/fields',require(_0xdd74('0xb6')));_0x52f31d[_0xdd74('0x8')](_0xdd74('0xb7'),require('./api/intZendeskAccount'));_0x52f31d['use'](_0xdd74('0xb8'),require(_0xdd74('0xb9')));_0x52f31d[_0xdd74('0x8')](_0xdd74('0xba'),require('./api/intZendeskField'));_0x52f31d[_0xdd74('0x8')](_0xdd74('0xbb'),require(_0xdd74('0xbc')));_0x52f31d[_0xdd74('0x8')](_0xdd74('0xbd'),require('./api/intFreshdeskConfiguration'));_0x52f31d['use']('/api/integrations/freshdesk/fields',require(_0xdd74('0xbe')));_0x52f31d['use'](_0xdd74('0xbf'),require('./api/intVtigerAccount'));_0x52f31d[_0xdd74('0x8')](_0xdd74('0xc0'),require(_0xdd74('0xc1')));_0x52f31d[_0xdd74('0x8')](_0xdd74('0xc2'),require(_0xdd74('0xc3')));_0x52f31d[_0xdd74('0x8')]('/api/integrations/servicenow/accounts',require(_0xdd74('0xc4')));_0x52f31d[_0xdd74('0x8')](_0xdd74('0xc5'),require(_0xdd74('0xc6')));_0x52f31d[_0xdd74('0x8')](_0xdd74('0xc7'),require('./api/intServicenowField'));_0x52f31d[_0xdd74('0x8')](_0xdd74('0xc8'),require(_0xdd74('0xc9')));_0x52f31d[_0xdd74('0x8')](_0xdd74('0xca'),require(_0xdd74('0xcb')));_0x52f31d[_0xdd74('0x8')](_0xdd74('0xcc'),require('./api/intDynamics365Field'));_0x52f31d[_0xdd74('0x8')](_0xdd74('0xcd'),require(_0xdd74('0xce')));_0x52f31d['use'](_0xdd74('0xcf'),require(_0xdd74('0xd0')));_0x52f31d['use']('/api/integrations/freshsales/fields',require(_0xdd74('0xd1')));_0x52f31d['use'](_0xdd74('0xd2'),require(_0xdd74('0xd3')));_0x52f31d[_0xdd74('0x8')](_0xdd74('0xd4'),require('./api/chatQueueReport'));_0x52f31d['use'](_0xdd74('0xd5'),require(_0xdd74('0xd6')));_0x52f31d[_0xdd74('0x8')](_0xdd74('0xd7'),require('./api/jscriptyAnswerReport'));_0x52f31d[_0xdd74('0x8')](_0xdd74('0xd8'),require(_0xdd74('0xd9')));_0x52f31d['use']('/api/jscripty/sessions/reports',require(_0xdd74('0xda')));_0x52f31d['use']('/api/sms/reports/queue',require(_0xdd74('0xdb')));_0x52f31d['use']('/api/square/reports',require(_0xdd74('0xdc')));_0x52f31d[_0xdd74('0x8')](_0xdd74('0xdd'),require('./api/squareReportDetail'));_0x52f31d[_0xdd74('0x8')]('/api/jscripty/projects',require('./api/jscriptyProject'));_0x52f31d[_0xdd74('0x8')](_0xdd74('0xde'),require(_0xdd74('0xdf')));_0x52f31d[_0xdd74('0x8')]('/api/square/odbc',require(_0xdd74('0xe0')));_0x52f31d[_0xdd74('0x8')](_0xdd74('0xe1'),require(_0xdd74('0xe2')));_0x52f31d[_0xdd74('0x8')](_0xdd74('0xe3'),require(_0xdd74('0xe4')));_0x52f31d[_0xdd74('0x8')](_0xdd74('0xe5'),require('./api/squareMessage'));_0x52f31d[_0xdd74('0x8')](_0xdd74('0xe6'),require(_0xdd74('0xe7')));_0x52f31d[_0xdd74('0x8')](_0xdd74('0xe8'),require('./api/license'));_0x52f31d[_0xdd74('0x8')](_0xdd74('0xe9'),require('./api/campaign'));_0x52f31d[_0xdd74('0x8')](_0xdd74('0xea'),require(_0xdd74('0xeb')));_0x52f31d[_0xdd74('0x8')](_0xdd74('0xec'),require(_0xdd74('0xed')));_0x52f31d[_0xdd74('0x8')](_0xdd74('0xee'),require(_0xdd74('0xef')));_0x52f31d[_0xdd74('0x8')](_0xdd74('0xf0'),require(_0xdd74('0xf1')));_0x52f31d['use'](_0xdd74('0xf2'),require(_0xdd74('0xf3')));_0x52f31d[_0xdd74('0x8')](_0xdd74('0xf4'),require(_0xdd74('0xf5')));_0x52f31d[_0xdd74('0x8')](_0xdd74('0xf6'),require(_0xdd74('0xf7')));_0x52f31d[_0xdd74('0x8')](_0xdd74('0xf8'),require(_0xdd74('0xf9')));_0x52f31d[_0xdd74('0x8')](_0xdd74('0xfa'),require('./api/cmList'));_0x52f31d['use']('/api/voice/prefixes',require('./api/voicePrefix'));_0x52f31d['use']('/api/userProfiles',require('./api/userProfile'));_0x52f31d['use']('/api/userProfile/sections',require(_0xdd74('0xfb')));_0x52f31d[_0xdd74('0x8')](_0xdd74('0xfc'),require(_0xdd74('0xfd')));_0x52f31d[_0xdd74('0x8')](_0xdd74('0xfe'),require('./api/userNotification'));_0x52f31d['use']('/api/whatsapp/accounts',require(_0xdd74('0xff')));_0x52f31d[_0xdd74('0x8')](_0xdd74('0x100'),require(_0xdd74('0x101')));_0x52f31d[_0xdd74('0x8')](_0xdd74('0x102'),require('./api/whatsappInteraction'));_0x52f31d[_0xdd74('0x8')](_0xdd74('0x103'),require(_0xdd74('0x104')));_0x52f31d['use'](_0xdd74('0x105'),require(_0xdd74('0x106')));_0x52f31d[_0xdd74('0x8')](_0xdd74('0x107'),require(_0xdd74('0x108')));_0x52f31d['use']('/api/whatsapp/queues',require('./api/whatsappQueue'));_0x52f31d[_0xdd74('0x8')](_0xdd74('0x109'),require(_0xdd74('0x10a')));_0x52f31d[_0xdd74('0x8')](_0xdd74('0x10b'),require(_0xdd74('0x10c')));_0x52f31d['use'](_0xdd74('0x10d'),require(_0xdd74('0x10e')));_0x52f31d[_0xdd74('0x8')](_0xdd74('0x10f'),require(_0xdd74('0x110')));_0x52f31d[_0xdd74('0x8')]('/api/jira',require('./api/jira'));_0x52f31d['use'](_0xdd74('0x111'),require(_0xdd74('0x112')));_0x52f31d['use'](_0xdd74('0x113'),require(_0xdd74('0x114')));_0x52f31d[_0xdd74('0x8')](_0xdd74('0x115'),require(_0xdd74('0x116')));_0x52f31d[_0xdd74('0x8')](_0xdd74('0x117'),require(_0xdd74('0x118')));_0x52f31d['use'](_0xdd74('0x119'),require(_0xdd74('0x11a')));_0x52f31d[_0xdd74('0x8')](_0xdd74('0x11b'),express['static'](path[_0xdd74('0x11c')](config[_0xdd74('0x11d')],_0xdd74('0x11b'))));_0x52f31d['use']('/www',express[_0xdd74('0x11e')](path['join'](config[_0xdd74('0x11d')],_0xdd74('0x11f'))));_0x52f31d[_0xdd74('0x8')]('/demo',express['static'](path['join'](config['root'],_0xdd74('0x120'))));_0x52f31d['use']('/snippet',express[_0xdd74('0x11e')](path[_0xdd74('0x11c')](config[_0xdd74('0x11d')],'snippet',_0xdd74('0x121'))));_0x52f31d[_0xdd74('0x8')]('/plugins',express[_0xdd74('0x11e')](path[_0xdd74('0x11c')](config[_0xdd74('0x11d')],_0xdd74('0x122'))));_0x52f31d[_0xdd74('0x123')](_0xdd74('0x124'))[_0xdd74('0x125')](errors[0x194]);_0x52f31d[_0xdd74('0x123')]('/*')[_0xdd74('0x125')](function(_0x192269,_0x2ee4d6){_0x2ee4d6[_0xdd74('0x126')](path['resolve'](_0x52f31d[_0xdd74('0x125')](_0xdd74('0x127'))+_0xdd74('0x128')));});};var sensitiveFields=[_0xdd74('0x129'),'password',_0xdd74('0x12a'),_0xdd74('0x12b'),'firstName',_0xdd74('0x12c'),_0xdd74('0x12d'),_0xdd74('0x12e'),_0xdd74('0x12f'),'fax','email',_0xdd74('0x130'),_0xdd74('0x131'),'securityToken','code','accessKey',_0xdd74('0x132'),_0xdd74('0x133'),_0xdd74('0x134'),_0xdd74('0x135'),_0xdd74('0x136'),_0xdd74('0x137'),_0xdd74('0x138'),'consumerSecret',_0xdd74('0x139'),_0xdd74('0x13a'),_0xdd74('0x13b'),'exten','vidaooApiKey',_0xdd74('0x13c'),_0xdd74('0x13d'),_0xdd74('0x13e'),_0xdd74('0x13f'),_0xdd74('0x140'),_0xdd74('0x17'),_0xdd74('0x141'),_0xdd74('0x142'),'localstationid',_0xdd74('0x143'),_0xdd74('0x144'),'registry',_0xdd74('0x145')];function maskSensitiveData(_0x3add0a){var _0x25d1de=/(?!^)[\s\S](?!$)/g;if(!_[_0xdd74('0x146')](_0x3add0a))return;for(var _0x4b351b in _0x3add0a){if(_[_0xdd74('0x147')](_0x3add0a[_0x4b351b])){for(var _0x16197c=0x0;_0x16197c<_0x3add0a[_0x4b351b][_0xdd74('0x148')];_0x16197c++){maskSensitiveData(_0x3add0a[_0x4b351b][_0x16197c]);}}else if(_[_0xdd74('0x146')](_0x3add0a[_0x4b351b])){maskSensitiveData(_0x3add0a[_0x4b351b]);}else if(_[_0xdd74('0x149')](_0x3add0a[_0x4b351b])){_0x3add0a[_0x4b351b]=_0x3add0a[_0x4b351b][_0xdd74('0x14a')](/{{{/g,_0xdd74('0x14b'))['replace'](/}}}/g,_0xdd74('0x14c'))['replace'](/{{/g,'@{')[_0xdd74('0x14a')](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x4b351b)){_0x3add0a[_0x4b351b]=_0x3add0a[_0x4b351b][_0xdd74('0x14a')](_0x25d1de,'*');}}}} \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index c6a8582..85a7e54 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe25e=['../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','http','port','localhost','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','bluebird','lodash','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc'];(function(_0x574afb,_0x36ad3b){var _0x456cc1=function(_0x5844fb){while(--_0x5844fb){_0x574afb['push'](_0x574afb['shift']());}};_0x456cc1(++_0x36ad3b);}(_0xe25e,0x84));var _0xee25=function(_0x28fcdc,_0x17e930){_0x28fcdc=_0x28fcdc-0x0;var _0x80bd4c=_0xe25e[_0x28fcdc];return _0x80bd4c;};'use strict';var jayson=require(_0xee25('0x0'));var BPromise=require(_0xee25('0x1'));var _=require(_0xee25('0x2'));var config=require(_0xee25('0x3'));exports[_0xee25('0x4')]=function(){return new BPromise(function(_0x44e74e,_0x292bce){var _0x347c26={};_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0x6')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0x7')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0x8')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require('../api/voiceRecording/voiceRecording.rpc'));_0x347c26=_[_0xee25('0x5')](_0x347c26,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x347c26=_['merge'](_0x347c26,require(_0xee25('0x9')));_0x347c26=_['merge'](_0x347c26,require(_0xee25('0xa')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0xb')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0xc')));_0x347c26=_['merge'](_0x347c26,require('../api/trunk/trunk.rpc'));_0x347c26=_['merge'](_0x347c26,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0xd')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0xe')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0xf')));_0x347c26=_['merge'](_0x347c26,require('../api/mailQueue/mailQueue.rpc'));_0x347c26=_[_0xee25('0x5')](_0x347c26,require('../api/mailInteraction/mailInteraction.rpc'));_0x347c26=_[_0xee25('0x5')](_0x347c26,require('../api/mailMessage/mailMessage.rpc'));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0x10')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0x11')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require('../api/faxAccount/faxAccount.rpc'));_0x347c26=_[_0xee25('0x5')](_0x347c26,require('../api/faxApplication/faxApplication.rpc'));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0x12')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require('../api/faxMessage/faxMessage.rpc'));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0x13')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0x14')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require('../api/smsAccount/smsAccount.rpc'));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0x15')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require('../api/smsMessage/smsMessage.rpc'));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0x16')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0x17')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0x18')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0x19')));_0x347c26=_['merge'](_0x347c26,require(_0xee25('0x1a')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x347c26=_['merge'](_0x347c26,require('../api/chatInteraction/chatInteraction.rpc'));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0x1b')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0x1c')));_0x347c26=_['merge'](_0x347c26,require(_0xee25('0x1d')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0x1e')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0x1f')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0x20')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0x21')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0x22')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require('../api/interval/interval.rpc'));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0x23')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0x24')));_0x347c26=_['merge'](_0x347c26,require(_0xee25('0x25')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require('../api/trigger/trigger.rpc'));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0x26')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0x27')));_0x347c26=_['merge'](_0x347c26,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0x28')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0x29')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0x2a')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0x2b')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0x2c')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0x2d')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0x2e')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0x2f')));_0x347c26=_['merge'](_0x347c26,require(_0xee25('0x30')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0x31')));_0x347c26=_['merge'](_0x347c26,require(_0xee25('0x32')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0x33')));_0x347c26=_['merge'](_0x347c26,require(_0xee25('0x34')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0x35')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require('../api/squareProject/squareProject.rpc'));_0x347c26=_['merge'](_0x347c26,require(_0xee25('0x36')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0x37')));_0x347c26=_['merge'](_0x347c26,require(_0xee25('0x38')));_0x347c26=_['merge'](_0x347c26,require(_0xee25('0x39')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0x3a')));_0x347c26=_['merge'](_0x347c26,require(_0xee25('0x3b')));_0x347c26=_['merge'](_0x347c26,require(_0xee25('0x3c')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0x3d')));_0x347c26=_['merge'](_0x347c26,require(_0xee25('0x3e')));_0x347c26=_[_0xee25('0x5')](_0x347c26,require(_0xee25('0x3f')));var _0x10c92e=jayson['server'](_0x347c26)[_0xee25('0x40')]();var _0xf80790=config['rpc'][_0xee25('0x41')]||config[_0xee25('0x41')]+0x1;var _0x5a6691=config['rpc']['ip']||_0xee25('0x42');_0x10c92e['on'](_0xee25('0x43'),function(_0x1db7af){return _0x292bce(_0x1db7af);});_0x10c92e[_0xee25('0x4')](_0xf80790,_0x5a6691,function(){console[_0xee25('0x44')](_0xee25('0x45'),_0x5a6691,_0xf80790);require(_0xee25('0x46'))[_0xee25('0x47')]();return _0x44e74e(_0xee25('0x48')+_0x5a6691+':'+_0xf80790);});});}; \ No newline at end of file +var _0x4810=['../api/sound/sound.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueue/whatsappQueue.rpc','http','port','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','jayson/promise','bluebird','lodash','../config/environment','listen','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/mailAccount/mailAccount.rpc','../api/mailInteraction/mailInteraction.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/faxQueueReport/faxQueueReport.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/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc'];(function(_0x47604f,_0x17531e){var _0x171b8a=function(_0x547193){while(--_0x547193){_0x47604f['push'](_0x47604f['shift']());}};_0x171b8a(++_0x17531e);}(_0x4810,0xa4));var _0x0481=function(_0x2a478b,_0x29b8b3){_0x2a478b=_0x2a478b-0x0;var _0x539bee=_0x4810[_0x2a478b];return _0x539bee;};'use strict';var jayson=require(_0x0481('0x0'));var BPromise=require(_0x0481('0x1'));var _=require(_0x0481('0x2'));var config=require(_0x0481('0x3'));exports[_0x0481('0x4')]=function(){return new BPromise(function(_0x401a39,_0x39807a){var _0x366288={};_0x366288=_[_0x0481('0x5')](_0x366288,require('../api/user/user.rpc'));_0x366288=_[_0x0481('0x5')](_0x366288,require(_0x0481('0x6')));_0x366288=_[_0x0481('0x5')](_0x366288,require(_0x0481('0x7')));_0x366288=_[_0x0481('0x5')](_0x366288,require(_0x0481('0x8')));_0x366288=_['merge'](_0x366288,require(_0x0481('0x9')));_0x366288=_[_0x0481('0x5')](_0x366288,require(_0x0481('0xa')));_0x366288=_[_0x0481('0x5')](_0x366288,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x366288=_[_0x0481('0x5')](_0x366288,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x366288=_['merge'](_0x366288,require(_0x0481('0xb')));_0x366288=_['merge'](_0x366288,require(_0x0481('0xc')));_0x366288=_['merge'](_0x366288,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x366288=_[_0x0481('0x5')](_0x366288,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x366288=_[_0x0481('0x5')](_0x366288,require('../api/mailServerIn/mailServerIn.rpc'));_0x366288=_[_0x0481('0x5')](_0x366288,require(_0x0481('0xd')));_0x366288=_[_0x0481('0x5')](_0x366288,require('../api/mailQueue/mailQueue.rpc'));_0x366288=_['merge'](_0x366288,require(_0x0481('0xe')));_0x366288=_['merge'](_0x366288,require('../api/mailMessage/mailMessage.rpc'));_0x366288=_[_0x0481('0x5')](_0x366288,require(_0x0481('0xf')));_0x366288=_[_0x0481('0x5')](_0x366288,require(_0x0481('0x10')));_0x366288=_[_0x0481('0x5')](_0x366288,require(_0x0481('0x11')));_0x366288=_[_0x0481('0x5')](_0x366288,require(_0x0481('0x12')));_0x366288=_[_0x0481('0x5')](_0x366288,require(_0x0481('0x13')));_0x366288=_[_0x0481('0x5')](_0x366288,require(_0x0481('0x14')));_0x366288=_[_0x0481('0x5')](_0x366288,require(_0x0481('0x15')));_0x366288=_[_0x0481('0x5')](_0x366288,require(_0x0481('0x16')));_0x366288=_[_0x0481('0x5')](_0x366288,require(_0x0481('0x17')));_0x366288=_[_0x0481('0x5')](_0x366288,require(_0x0481('0x18')));_0x366288=_[_0x0481('0x5')](_0x366288,require(_0x0481('0x19')));_0x366288=_[_0x0481('0x5')](_0x366288,require(_0x0481('0x1a')));_0x366288=_['merge'](_0x366288,require(_0x0481('0x1b')));_0x366288=_['merge'](_0x366288,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x366288=_['merge'](_0x366288,require(_0x0481('0x1c')));_0x366288=_[_0x0481('0x5')](_0x366288,require(_0x0481('0x1d')));_0x366288=_[_0x0481('0x5')](_0x366288,require(_0x0481('0x1e')));_0x366288=_[_0x0481('0x5')](_0x366288,require(_0x0481('0x1f')));_0x366288=_[_0x0481('0x5')](_0x366288,require('../api/chatMessage/chatMessage.rpc'));_0x366288=_[_0x0481('0x5')](_0x366288,require('../api/chatQueue/chatQueue.rpc'));_0x366288=_[_0x0481('0x5')](_0x366288,require(_0x0481('0x20')));_0x366288=_[_0x0481('0x5')](_0x366288,require(_0x0481('0x21')));_0x366288=_[_0x0481('0x5')](_0x366288,require(_0x0481('0x22')));_0x366288=_[_0x0481('0x5')](_0x366288,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x366288=_[_0x0481('0x5')](_0x366288,require(_0x0481('0x23')));_0x366288=_[_0x0481('0x5')](_0x366288,require(_0x0481('0x24')));_0x366288=_[_0x0481('0x5')](_0x366288,require('../api/interval/interval.rpc'));_0x366288=_[_0x0481('0x5')](_0x366288,require('../api/pause/pause.rpc'));_0x366288=_['merge'](_0x366288,require(_0x0481('0x25')));_0x366288=_[_0x0481('0x5')](_0x366288,require('../api/template/template.rpc'));_0x366288=_['merge'](_0x366288,require(_0x0481('0x26')));_0x366288=_['merge'](_0x366288,require(_0x0481('0x27')));_0x366288=_[_0x0481('0x5')](_0x366288,require(_0x0481('0x28')));_0x366288=_[_0x0481('0x5')](_0x366288,require(_0x0481('0x29')));_0x366288=_[_0x0481('0x5')](_0x366288,require(_0x0481('0x2a')));_0x366288=_['merge'](_0x366288,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x366288=_['merge'](_0x366288,require(_0x0481('0x2b')));_0x366288=_['merge'](_0x366288,require(_0x0481('0x2c')));_0x366288=_[_0x0481('0x5')](_0x366288,require(_0x0481('0x2d')));_0x366288=_['merge'](_0x366288,require(_0x0481('0x2e')));_0x366288=_[_0x0481('0x5')](_0x366288,require(_0x0481('0x2f')));_0x366288=_[_0x0481('0x5')](_0x366288,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x366288=_['merge'](_0x366288,require(_0x0481('0x30')));_0x366288=_[_0x0481('0x5')](_0x366288,require(_0x0481('0x31')));_0x366288=_[_0x0481('0x5')](_0x366288,require(_0x0481('0x32')));_0x366288=_[_0x0481('0x5')](_0x366288,require(_0x0481('0x33')));_0x366288=_['merge'](_0x366288,require(_0x0481('0x34')));_0x366288=_['merge'](_0x366288,require(_0x0481('0x35')));_0x366288=_[_0x0481('0x5')](_0x366288,require(_0x0481('0x36')));_0x366288=_['merge'](_0x366288,require(_0x0481('0x37')));_0x366288=_[_0x0481('0x5')](_0x366288,require(_0x0481('0x38')));_0x366288=_[_0x0481('0x5')](_0x366288,require(_0x0481('0x39')));_0x366288=_['merge'](_0x366288,require(_0x0481('0x3a')));_0x366288=_[_0x0481('0x5')](_0x366288,require(_0x0481('0x3b')));_0x366288=_[_0x0481('0x5')](_0x366288,require('../api/whatsappAccount/whatsappAccount.rpc'));_0x366288=_[_0x0481('0x5')](_0x366288,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x366288=_[_0x0481('0x5')](_0x366288,require(_0x0481('0x3c')));_0x366288=_[_0x0481('0x5')](_0x366288,require('../api/whatsappQueueReport/whatsappQueueReport.rpc'));_0x366288=_['merge'](_0x366288,require(_0x0481('0x3d')));var _0x1da4a3=jayson['server'](_0x366288)[_0x0481('0x3e')]();var _0x13d488=config['rpc'][_0x0481('0x3f')]||config[_0x0481('0x3f')]+0x1;var _0x584fff=config['rpc']['ip']||'localhost';_0x1da4a3['on']('error',function(_0x692ad0){return _0x39807a(_0x692ad0);});_0x1da4a3['listen'](_0x13d488,_0x584fff,function(){console[_0x0481('0x40')](_0x0481('0x41'),_0x584fff,_0x13d488);require(_0x0481('0x42'))['default']();return _0x401a39('RPC\x20listening\x20on\x20'+_0x584fff+':'+_0x13d488);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 7dc360c..102a698 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 _0xc599=['call','setEncoding','utf8','emit','ready','line','substring','search','function','result=','indexOf','substr','split','length','match','error','E_AGI_SOCKET_ERROR','code','E_AGI_SOCKET_CLOSE','timeout','destroy','command','write','close','inherits','prototype','sendRequest','sync','answer','ANSWER','getData','beep','format','noop','VERBOSE\x20\x22%s\x22','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','setPriority','hangup','HANGUP','isBoolean','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','replace','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','GOTO\x20%s\x20%s\x20%s','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','exec','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','exports','lodash','EventEmitter','./reply','./error'];(function(_0x587ba2,_0x42eb40){var _0x50ec73=function(_0x2f32e3){while(--_0x2f32e3){_0x587ba2['push'](_0x587ba2['shift']());}};_0x50ec73(++_0x42eb40);}(_0xc599,0x1b2));var _0x9c59=function(_0x4840f5,_0x5ebb78){_0x4840f5=_0x4840f5-0x0;var _0x2ac1b8=_0xc599[_0x4840f5];return _0x2ac1b8;};'use strict';var util=require('util');var _=require(_0x9c59('0x0'));var EventEmitter=require('events')[_0x9c59('0x1')];var AGIReply=require(_0x9c59('0x2'));var AGIError=require(_0x9c59('0x3'));function AGIChannel(_0x593f93){var _0x2fb8fa=this,_0x129a0c=new AGIReply(),_0x320cb0=![],_0x2f16df={};EventEmitter[_0x9c59('0x4')](_0x2fb8fa);_0x593f93[_0x9c59('0x5')](_0x9c59('0x6'));_0x593f93['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x129a0c['setEncoding'](_0x9c59('0x6'));_0x129a0c['on']('headers',function(_0x1220ad){for(var _0x4b87f2 in _0x1220ad){_0x2fb8fa[_0x4b87f2]=_0x1220ad[_0x4b87f2];}_0x2fb8fa[_0x9c59('0x7')](_0x9c59('0x8'));});_0x129a0c['on'](_0x9c59('0x9'),function(_0x120151){if(_0x120151['toLowerCase']()=='hangup'){_0x2fb8fa[_0x9c59('0x7')]('hangup');return;}if(_0x120151[_0x9c59('0xa')](0x0,0xb)=='520-Invalid'){_0x320cb0=!![];}if(_0x320cb0){_0x2f16df['rx']+=_0x120151+'\x0a';if(_0x120151[_0x9c59('0xb')]('520\x20End\x20of\x20proper')!=-0x1){_0x320cb0=![];}}else{_0x2f16df['rx']=_0x120151;}if(_0x320cb0){return;}if(typeof _0x2f16df['cb']==_0x9c59('0xc')){var _0x2cc4f7=_0x2f16df['rx']['substring'](0x0,0x3),_0x40216c=null,_0x5d5320=null;_0x2cc4f7=parseInt(_0x2cc4f7);if(isNaN(_0x2cc4f7)){_0x2f16df['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x2cc4f7!=0xc8){_0x2f16df['cb'](null,{'code':_0x2cc4f7,'result':-0x1,'extra':'KO'});return;}_0x40216c=_0x2f16df['rx']['substring'](0x4)['replace'](_0x9c59('0xd'),'');if(_0x40216c[_0x9c59('0xe')]('\x20')!=-0x1){_0x40216c=_0x40216c[_0x9c59('0xf')](0x0,_0x40216c[_0x9c59('0xe')]('\x20'));}if(_['startsWith'](_0x40216c,'-1')){_0x40216c=parseInt(_0x40216c);}_0x5d5320=_0x2f16df['rx'][_0x9c59('0x10')]('\x20');if(_0x5d5320[_0x9c59('0x11')]==0x3){_0x5d5320=_0x5d5320[0x2][_0x9c59('0xa')](0x1,_0x5d5320[0x2]['length']-0x1);}else if(_0x5d5320['length']>0x3){var _0x4d6ca7=/\((.+)\)/;var _0x5c5a86=_0x2f16df['rx'][_0x9c59('0x12')](_0x4d6ca7);if(_0x5c5a86){_0x5d5320=_0x5c5a86[0x1];}else{_0x5d5320=null;}}else{_0x5d5320=null;}_0x2f16df['cb'](null,{'code':_0x2cc4f7,'result':_0x40216c,'extra':_0x5d5320});}});_0x593f93['on'](_0x9c59('0x13'),function(_0x19f372){_0x2fb8fa[_0x9c59('0x7')](_0x9c59('0x13'),new AGIError(_0x9c59('0x14'),_0x19f372[_0x9c59('0x15')]));});_0x593f93['on']('close',function(){_0x2fb8fa['emit']('close',new AGIError(_0x9c59('0x16')));});_0x593f93['on'](_0x9c59('0x17'),function(){_0x2fb8fa[_0x9c59('0x7')](_0x9c59('0x17'),new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x593f93[_0x9c59('0x18')]();});_0x593f93['pipe'](_0x129a0c);this[_0x9c59('0x19')]=function(_0x21258d,_0x4dcc88){var _0x21258d=_0x21258d||'',_0x4dcc88=typeof _0x4dcc88==_0x9c59('0xc')?_0x4dcc88:new Function();_0x2f16df={'tx':_0x21258d,'rx':'','cb':_0x4dcc88};_0x593f93[_0x9c59('0x1a')](_0x21258d+'\x0a');},this[_0x9c59('0x1b')]=function(){_0x593f93['destroy']();};}util[_0x9c59('0x1c')](AGIChannel,EventEmitter);AGIChannel[_0x9c59('0x1d')][_0x9c59('0x1e')]=function(_0x5e1146){return this[_0x9c59('0x19')][_0x9c59('0x1f')](this,_0x5e1146);};AGIChannel[_0x9c59('0x1d')][_0x9c59('0x20')]=function(){return this['sendRequest'](_0x9c59('0x21'));};AGIChannel[_0x9c59('0x1d')][_0x9c59('0x22')]=function(_0x597ffc,_0x1d2e47,_0x27e6b2){_0x597ffc=_0x597ffc===undefined?_0x9c59('0x23'):_0x597ffc;_0x1d2e47=_0x1d2e47===undefined?'5':_0x1d2e47;_0x27e6b2=_0x27e6b2===undefined?'1':_0x27e6b2;return this[_0x9c59('0x1e')](util[_0x9c59('0x24')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x597ffc,_0x1d2e47*0x3e8,_0x27e6b2));};AGIChannel[_0x9c59('0x1d')][_0x9c59('0x25')]=function(_0x4f497d){_0x4f497d=_0x4f497d||'NO\x20MESSAGE';return this[_0x9c59('0x1e')](util[_0x9c59('0x24')](_0x9c59('0x26'),_0x4f497d));};AGIChannel[_0x9c59('0x1d')]['exec']=function(_0x10b971,_0x25c0ab){if(_[_0x9c59('0x27')](_0x25c0ab)){return this[_0x9c59('0x1e')](util['format'](_0x9c59('0x28'),_0x10b971,_0x25c0ab[_0x9c59('0x29')](',')));}return this[_0x9c59('0x1e')](util[_0x9c59('0x24')](_0x9c59('0x28'),_0x10b971,_0x25c0ab));};AGIChannel[_0x9c59('0x1d')][_0x9c59('0x2a')]=function(_0x29825e){return this[_0x9c59('0x1e')](util[_0x9c59('0x24')](_0x9c59('0x2b'),_0x29825e));};AGIChannel[_0x9c59('0x1d')][_0x9c59('0x2c')]=function(_0x58745b){return this[_0x9c59('0x1e')](util[_0x9c59('0x24')]('SET\x20EXTENSION\x20%s',_0x58745b));};AGIChannel['prototype'][_0x9c59('0x2d')]=function(_0x288f12){return this[_0x9c59('0x1e')](util[_0x9c59('0x24')]('SET\x20PRIORITY\x20%s',_0x288f12));};AGIChannel[_0x9c59('0x1d')][_0x9c59('0x2e')]=function(){return this['sendRequest'](_0x9c59('0x2f'));};AGIChannel[_0x9c59('0x1d')]['setVariable']=function(_0x145d4c,_0x4d24c4){var _0x2fc643=_[_0x9c59('0x30')](_0x4d24c4)||_['isNumber'](_0x4d24c4)?_0x4d24c4[_0x9c59('0x31')]():_0x4d24c4;return this['sendRequest'](util['format'](_0x9c59('0x32'),_0x145d4c,_0x2fc643?_0x2fc643['toString']()[_0x9c59('0x33')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype']['sayNumber']=function(_0x490f6e,_0x3c0280){return this[_0x9c59('0x1e')](util[_0x9c59('0x24')](_0x9c59('0x34'),_0x490f6e,_0x3c0280));};AGIChannel[_0x9c59('0x1d')][_0x9c59('0x35')]=function(_0x493407,_0xeb9134){return this['sendRequest'](util[_0x9c59('0x24')](_0x9c59('0x36'),_0x493407,_0xeb9134));};AGIChannel[_0x9c59('0x1d')][_0x9c59('0x37')]=function(_0x2bab4f,_0x10f9fd){return this['sendRequest'](util[_0x9c59('0x24')](_0x9c59('0x38'),_0x2bab4f,_0x10f9fd));};AGIChannel[_0x9c59('0x1d')][_0x9c59('0x39')]=function(_0xdb50d8,_0x26195e,_0x550692){_0x26195e=_0x26195e||this[_0x9c59('0x3a')];_0x550692=_0x550692||0x1;this[_0x9c59('0x2a')](_0xdb50d8);this[_0x9c59('0x2c')](_0x26195e);this['setPriority'](_0x550692);return this[_0x9c59('0x25')](util[_0x9c59('0x24')](_0x9c59('0x3b'),_0xdb50d8,_0x26195e,_0x550692));};AGIChannel[_0x9c59('0x1d')]['getVariable']=function(_0x3aafc9){return this[_0x9c59('0x1e')](util[_0x9c59('0x24')](_0x9c59('0x3c'),_0x3aafc9));};AGIChannel[_0x9c59('0x1d')][_0x9c59('0x3d')]=function(_0x490460,_0x593ccf,_0x4cd587,_0x54cfec,_0x1df303,_0x2c7181){_0x593ccf=_0x593ccf||_0x9c59('0x3e');_0x4cd587=_0x4cd587||'';_0x54cfec=_0x54cfec===undefined?-0x1:_0x54cfec==='-1'?-0x1:_0x54cfec*0x3e8;_0x1df303=_0x1df303===undefined?'':'s='+_0x1df303;_0x2c7181=_0x2c7181?_0x9c59('0x3f'):'';return this[_0x9c59('0x1e')](util['format']('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x490460,_0x593ccf,_0x4cd587,_0x54cfec,_0x2c7181,_0x1df303));};AGIChannel[_0x9c59('0x1d')][_0x9c59('0x40')]=function(_0x165a43,_0x24c71b){_0x24c71b=_0x24c71b||'';return this[_0x9c59('0x1e')](util[_0x9c59('0x24')](_0x9c59('0x41'),_0x165a43,_0x24c71b));};AGIChannel[_0x9c59('0x1d')][_0x9c59('0x42')]=function(_0x169ded){return this[_0x9c59('0x43')](_0x9c59('0x44'),_0x169ded);};AGIChannel['prototype'][_0x9c59('0x45')]=function(_0x2c10c9){return this['exec'](_0x9c59('0x46'),_0x2c10c9);};AGIChannel[_0x9c59('0x1d')][_0x9c59('0x13')]=function(_0x10e77b,_0x170304){this[_0x9c59('0x25')](util[_0x9c59('0x24')](_0x9c59('0x47'),_0x10e77b['id'],_0x10e77b['label'],_0x170304));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x9c59('0x48')]=AGIChannel; \ No newline at end of file +var _0xea21=['E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','inherits','prototype','sync','answer','sendRequest','ANSWER','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','setContext','SET\x20CONTEXT\x20%s','setExtension','setPriority','HANGUP','setVariable','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayDigits','SAY\x20DIGITS\x20%s\x20%s','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','AGI','wait','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','events','EventEmitter','./reply','call','utf8','setTimeout','setEncoding','ready','line','toLowerCase','hangup','emit','520-Invalid','search','520\x20End\x20of\x20proper','function','no\x20code','substring','replace','indexOf','substr','startsWith','length','match','error'];(function(_0x2be30d,_0x47e21b){var _0x2837a3=function(_0x26c4a3){while(--_0x26c4a3){_0x2be30d['push'](_0x2be30d['shift']());}};_0x2837a3(++_0x47e21b);}(_0xea21,0x80));var _0x1ea2=function(_0x3ac203,_0x822e96){_0x3ac203=_0x3ac203-0x0;var _0x36b3e4=_0xea21[_0x3ac203];return _0x36b3e4;};'use strict';var util=require(_0x1ea2('0x0'));var _=require('lodash');var EventEmitter=require(_0x1ea2('0x1'))[_0x1ea2('0x2')];var AGIReply=require(_0x1ea2('0x3'));var AGIError=require('./error');function AGIChannel(_0x40f808){var _0x5e1519=this,_0xd183cc=new AGIReply(),_0x1d1d87=![],_0x324637={};EventEmitter[_0x1ea2('0x4')](_0x5e1519);_0x40f808['setEncoding'](_0x1ea2('0x5'));_0x40f808[_0x1ea2('0x6')](0x8*0x3c*0x3c*0x3e8);_0xd183cc[_0x1ea2('0x7')](_0x1ea2('0x5'));_0xd183cc['on']('headers',function(_0x407202){for(var _0x210ae4 in _0x407202){_0x5e1519[_0x210ae4]=_0x407202[_0x210ae4];}_0x5e1519['emit'](_0x1ea2('0x8'));});_0xd183cc['on'](_0x1ea2('0x9'),function(_0x21fa87){if(_0x21fa87[_0x1ea2('0xa')]()==_0x1ea2('0xb')){_0x5e1519[_0x1ea2('0xc')]('hangup');return;}if(_0x21fa87['substring'](0x0,0xb)==_0x1ea2('0xd')){_0x1d1d87=!![];}if(_0x1d1d87){_0x324637['rx']+=_0x21fa87+'\x0a';if(_0x21fa87[_0x1ea2('0xe')](_0x1ea2('0xf'))!=-0x1){_0x1d1d87=![];}}else{_0x324637['rx']=_0x21fa87;}if(_0x1d1d87){return;}if(typeof _0x324637['cb']==_0x1ea2('0x10')){var _0x303b44=_0x324637['rx']['substring'](0x0,0x3),_0x13717f=null,_0xf0cf76=null;_0x303b44=parseInt(_0x303b44);if(isNaN(_0x303b44)){_0x324637['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x1ea2('0x11')});return;}if(_0x303b44!=0xc8){_0x324637['cb'](null,{'code':_0x303b44,'result':-0x1,'extra':'KO'});return;}_0x13717f=_0x324637['rx'][_0x1ea2('0x12')](0x4)[_0x1ea2('0x13')]('result=','');if(_0x13717f[_0x1ea2('0x14')]('\x20')!=-0x1){_0x13717f=_0x13717f[_0x1ea2('0x15')](0x0,_0x13717f[_0x1ea2('0x14')]('\x20'));}if(_[_0x1ea2('0x16')](_0x13717f,'-1')){_0x13717f=parseInt(_0x13717f);}_0xf0cf76=_0x324637['rx']['split']('\x20');if(_0xf0cf76[_0x1ea2('0x17')]==0x3){_0xf0cf76=_0xf0cf76[0x2][_0x1ea2('0x12')](0x1,_0xf0cf76[0x2][_0x1ea2('0x17')]-0x1);}else if(_0xf0cf76[_0x1ea2('0x17')]>0x3){var _0x28040b=/\((.+)\)/;var _0x53965f=_0x324637['rx'][_0x1ea2('0x18')](_0x28040b);if(_0x53965f){_0xf0cf76=_0x53965f[0x1];}else{_0xf0cf76=null;}}else{_0xf0cf76=null;}_0x324637['cb'](null,{'code':_0x303b44,'result':_0x13717f,'extra':_0xf0cf76});}});_0x40f808['on'](_0x1ea2('0x19'),function(_0x1819b2){_0x5e1519['emit'](_0x1ea2('0x19'),new AGIError(_0x1ea2('0x1a'),_0x1819b2[_0x1ea2('0x1b')]));});_0x40f808['on']('close',function(){_0x5e1519[_0x1ea2('0xc')](_0x1ea2('0x1c'),new AGIError(_0x1ea2('0x1d')));});_0x40f808['on'](_0x1ea2('0x1e'),function(){_0x5e1519[_0x1ea2('0xc')]('timeout',new AGIError(_0x1ea2('0x1f')));_0x40f808[_0x1ea2('0x20')]();});_0x40f808[_0x1ea2('0x21')](_0xd183cc);this[_0x1ea2('0x22')]=function(_0x20d4d2,_0x35a87f){var _0x20d4d2=_0x20d4d2||'',_0x35a87f=typeof _0x35a87f==_0x1ea2('0x10')?_0x35a87f:new Function();_0x324637={'tx':_0x20d4d2,'rx':'','cb':_0x35a87f};_0x40f808['write'](_0x20d4d2+'\x0a');},this[_0x1ea2('0x1c')]=function(){_0x40f808[_0x1ea2('0x20')]();};}util[_0x1ea2('0x23')](AGIChannel,EventEmitter);AGIChannel[_0x1ea2('0x24')]['sendRequest']=function(_0x56da54){return this[_0x1ea2('0x22')][_0x1ea2('0x25')](this,_0x56da54);};AGIChannel['prototype'][_0x1ea2('0x26')]=function(){return this[_0x1ea2('0x27')](_0x1ea2('0x28'));};AGIChannel[_0x1ea2('0x24')][_0x1ea2('0x29')]=function(_0xfd52b2,_0x5504d9,_0x58c125){_0xfd52b2=_0xfd52b2===undefined?_0x1ea2('0x2a'):_0xfd52b2;_0x5504d9=_0x5504d9===undefined?'5':_0x5504d9;_0x58c125=_0x58c125===undefined?'1':_0x58c125;return this[_0x1ea2('0x27')](util[_0x1ea2('0x2b')](_0x1ea2('0x2c'),_0xfd52b2,_0x5504d9*0x3e8,_0x58c125));};AGIChannel[_0x1ea2('0x24')][_0x1ea2('0x2d')]=function(_0x53e48c){_0x53e48c=_0x53e48c||_0x1ea2('0x2e');return this['sendRequest'](util[_0x1ea2('0x2b')](_0x1ea2('0x2f'),_0x53e48c));};AGIChannel[_0x1ea2('0x24')][_0x1ea2('0x30')]=function(_0x149251,_0x2b17ce){if(_[_0x1ea2('0x31')](_0x2b17ce)){return this[_0x1ea2('0x27')](util['format']('EXEC\x20%s\x20%s',_0x149251,_0x2b17ce['join'](',')));}return this[_0x1ea2('0x27')](util[_0x1ea2('0x2b')](_0x1ea2('0x32'),_0x149251,_0x2b17ce));};AGIChannel['prototype'][_0x1ea2('0x33')]=function(_0xdd9d68){return this[_0x1ea2('0x27')](util[_0x1ea2('0x2b')](_0x1ea2('0x34'),_0xdd9d68));};AGIChannel[_0x1ea2('0x24')][_0x1ea2('0x35')]=function(_0x567bb6){return this[_0x1ea2('0x27')](util[_0x1ea2('0x2b')]('SET\x20EXTENSION\x20%s',_0x567bb6));};AGIChannel[_0x1ea2('0x24')][_0x1ea2('0x36')]=function(_0x108b74){return this[_0x1ea2('0x27')](util[_0x1ea2('0x2b')]('SET\x20PRIORITY\x20%s',_0x108b74));};AGIChannel[_0x1ea2('0x24')]['hangup']=function(){return this[_0x1ea2('0x27')](_0x1ea2('0x37'));};AGIChannel[_0x1ea2('0x24')][_0x1ea2('0x38')]=function(_0x2b825a,_0xe6da){var _0x134277=_[_0x1ea2('0x39')](_0xe6da)||_[_0x1ea2('0x3a')](_0xe6da)?_0xe6da[_0x1ea2('0x3b')]():_0xe6da;return this[_0x1ea2('0x27')](util[_0x1ea2('0x2b')](_0x1ea2('0x3c'),_0x2b825a,_0x134277?_0x134277[_0x1ea2('0x3b')]()[_0x1ea2('0x13')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype']['sayNumber']=function(_0x411766,_0x7acab0){return this[_0x1ea2('0x27')](util[_0x1ea2('0x2b')]('SAY\x20NUMBER\x20%s\x20%s',_0x411766,_0x7acab0));};AGIChannel[_0x1ea2('0x24')][_0x1ea2('0x3d')]=function(_0x363525,_0x4cf0c8){return this[_0x1ea2('0x27')](util[_0x1ea2('0x2b')](_0x1ea2('0x3e'),_0x363525,_0x4cf0c8));};AGIChannel[_0x1ea2('0x24')]['sayPhonetic']=function(_0x49b95b,_0x483a6d){return this[_0x1ea2('0x27')](util[_0x1ea2('0x2b')](_0x1ea2('0x3f'),_0x49b95b,_0x483a6d));};AGIChannel[_0x1ea2('0x24')][_0x1ea2('0x40')]=function(_0x2153c4,_0x182032,_0x11e648){_0x182032=_0x182032||this[_0x1ea2('0x41')];_0x11e648=_0x11e648||0x1;this[_0x1ea2('0x33')](_0x2153c4);this['setExtension'](_0x182032);this[_0x1ea2('0x36')](_0x11e648);return this['noop'](util[_0x1ea2('0x2b')](_0x1ea2('0x42'),_0x2153c4,_0x182032,_0x11e648));};AGIChannel[_0x1ea2('0x24')][_0x1ea2('0x43')]=function(_0x4029d5){return this[_0x1ea2('0x27')](util['format'](_0x1ea2('0x44'),_0x4029d5));};AGIChannel['prototype'][_0x1ea2('0x45')]=function(_0x466d5e,_0x3b418b,_0x594797,_0x49e02c,_0x339e00,_0x1ae073){_0x3b418b=_0x3b418b||_0x1ea2('0x46');_0x594797=_0x594797||'';_0x49e02c=_0x49e02c===undefined?-0x1:_0x49e02c==='-1'?-0x1:_0x49e02c*0x3e8;_0x339e00=_0x339e00===undefined?'':'s='+_0x339e00;_0x1ae073=_0x1ae073?_0x1ea2('0x47'):'';return this['sendRequest'](util['format']('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x466d5e,_0x3b418b,_0x594797,_0x49e02c,_0x1ae073,_0x339e00));};AGIChannel[_0x1ea2('0x24')]['streamFile']=function(_0x2a221c,_0x33f7c9){_0x33f7c9=_0x33f7c9||'';return this[_0x1ea2('0x27')](util['format']('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x2a221c,_0x33f7c9));};AGIChannel[_0x1ea2('0x24')]['agi']=function(_0x56fd1b){return this[_0x1ea2('0x30')](_0x1ea2('0x48'),_0x56fd1b);};AGIChannel[_0x1ea2('0x24')][_0x1ea2('0x49')]=function(_0x2e3491){return this[_0x1ea2('0x30')]('WAIT',_0x2e3491);};AGIChannel['prototype']['error']=function(_0x57c106,_0x518eab){this[_0x1ea2('0x2d')](util['format'](_0x1ea2('0x4a'),_0x57c106['id'],_0x57c106[_0x1ea2('0x4b')],_0x518eab));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x1ea2('0x4c')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index e6a0236..fddb811 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 _0x548c=['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.','E_AGI_UNDEFINED','push','apply','message','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.'];(function(_0x30dea6,_0x45559f){var _0x1a70bd=function(_0x52a805){while(--_0x52a805){_0x30dea6['push'](_0x30dea6['shift']());}};_0x1a70bd(++_0x45559f);}(_0x548c,0xfb));var _0xc548=function(_0x564d43,_0xa73335){_0x564d43=_0x564d43-0x0;var _0x2286bf=_0x548c[_0x564d43];return _0x2286bf;};'use strict';var util=require(_0xc548('0x0'));var error={'E_AGI_UNDEFINED':_0xc548('0x1'),'E_AGI_ARGUMENT_PORT':_0xc548('0x2'),'E_AGI_SERVER_ERROR':_0xc548('0x3'),'E_AGI_SERVER_CLOSE':_0xc548('0x4'),'E_AGI_SERVER_MAXCONNECTION':_0xc548('0x5'),'E_AGI_SERVER_VOICE_DISABLED':_0xc548('0x6'),'E_AGI_SOCKET_ERROR':_0xc548('0x7'),'E_AGI_SOCKET_CLOSE':_0xc548('0x8'),'E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':_0xc548('0x9'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xc548('0xa'),'E_AGI_IVR_ENTRY':_0xc548('0xb')};function AGIError(_0x42a168){var _0x42a168=_0x42a168||null,_0x4b449f=_0x4b449f||[],_0x298df6=0x1,_0x56efb1='';if(!error[_0x42a168]){_0x42a168=_0xc548('0xc');}_0x4b449f[_0xc548('0xd')](error[_0x42a168]);while(arguments[_0x298df6]){_0x4b449f[_0xc548('0xd')](arguments[_0x298df6]);_0x298df6++;}_0x56efb1=util['format'][_0xc548('0xe')](util,_0x4b449f);this[_0xc548('0xf')]=_0x56efb1;this['name']=_0x42a168;}module[_0xc548('0x10')]=AGIError; \ No newline at end of file +var _0x3ce4=['Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_UNDEFINED','push','format','name','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Empty\x20command.'];(function(_0x1bdfb6,_0x2dd242){var _0x5c124d=function(_0x3af4c3){while(--_0x3af4c3){_0x1bdfb6['push'](_0x1bdfb6['shift']());}};_0x5c124d(++_0x2dd242);}(_0x3ce4,0x123));var _0x43ce=function(_0x391c55,_0x168617){_0x391c55=_0x391c55-0x0;var _0xa434e0=_0x3ce4[_0x391c55];return _0xa434e0;};'use strict';var util=require(_0x43ce('0x0'));var error={'E_AGI_UNDEFINED':_0x43ce('0x1'),'E_AGI_ARGUMENT_PORT':_0x43ce('0x2'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':_0x43ce('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0x43ce('0x4'),'E_AGI_SERVER_VOICE_DISABLED':_0x43ce('0x5'),'E_AGI_SOCKET_ERROR':_0x43ce('0x6'),'E_AGI_SOCKET_CLOSE':_0x43ce('0x7'),'E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':_0x43ce('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x43ce('0x9'),'E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x3c2dda){var _0x3c2dda=_0x3c2dda||null,_0x2d2ee6=_0x2d2ee6||[],_0x5763e4=0x1,_0x5a3e9b='';if(!error[_0x3c2dda]){_0x3c2dda=_0x43ce('0xa');}_0x2d2ee6[_0x43ce('0xb')](error[_0x3c2dda]);while(arguments[_0x5763e4]){_0x2d2ee6[_0x43ce('0xb')](arguments[_0x5763e4]);_0x5763e4++;}_0x5a3e9b=util[_0x43ce('0xc')]['apply'](util,_0x2d2ee6);this['message']=_0x5a3e9b;this[_0x43ce('0xd')]=_0x3c2dda;}module[_0x43ce('0xe')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index acce5df..0b04531 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 _0x30cd=['includes','condition\x20not\x20found','exports','lodash','agi','menu','getdigits','vertices','edges','numberOfEdges','prototype','addEdge','push','size','relations','getVertex','traverseBFS','info','no\x20vertex\x20found','stop\x20traverse','length','no\x20edge/s\x20available','condition','split','agicommand','target','invalid','default\x20on\x20switch\x20not\x20found'];(function(_0x9bed01,_0x5680b7){var _0x6b10fe=function(_0x18dae7){while(--_0x18dae7){_0x9bed01['push'](_0x9bed01['shift']());}};_0x6b10fe(++_0x5680b7);}(_0x30cd,0x16f));var _0xd30c=function(_0x339add,_0x5552ac){_0x339add=_0x339add-0x0;var _0x5323fa=_0x30cd[_0x339add];return _0x5323fa;};'use strict';var _=require(_0xd30c('0x0'));var logger=require('../../../config/logger')(_0xd30c('0x1'));var verticesWithRetry=[_0xd30c('0x2'),_0xd30c('0x3'),'getsecretdigits'];var Graph=function(){this[_0xd30c('0x4')]={};this[_0xd30c('0x5')]={};this[_0xd30c('0x6')]=0x0;};Graph['prototype']['addVertex']=function(_0x1c4e1b){this['vertices'][_0x1c4e1b['id']]=_0x1c4e1b;this[_0xd30c('0x5')][_0x1c4e1b['id']]=[];};Graph[_0xd30c('0x7')][_0xd30c('0x8')]=function(_0x47e9e5,_0x2637ff,_0x4c2798){this['edges'][_0x47e9e5][_0xd30c('0x9')]({'target':_0x2637ff,'condition':_0x4c2798});this[_0xd30c('0x6')]+=0x1;};Graph['prototype'][_0xd30c('0xa')]=function(){return _[_0xd30c('0xa')](this[_0xd30c('0x4')]);};Graph[_0xd30c('0x7')][_0xd30c('0xb')]=function(){return this['numberOfEdges'];};Graph[_0xd30c('0x7')][_0xd30c('0xc')]=function(_0x534371){return this['vertices'][_0x534371];};Graph['prototype'][_0xd30c('0xd')]=function(_0x4132e3,_0x1524b9){if(!this[_0xd30c('0x4')][_0x4132e3]){return logger[_0xd30c('0xe')](_0xd30c('0xf'));}var _0x5016a8=_0x1524b9(this[_0xd30c('0x4')][_0x4132e3]);if(!_0x5016a8){return logger['info'](_0xd30c('0x10'));}if(this[_0xd30c('0x5')][_0x4132e3][_0xd30c('0x11')]===0x0){return logger[_0xd30c('0xe')](_0xd30c('0x12'));}for(var _0x5a76a6=0x0,_0x10a5ff=[],_0x43a427=![];_0x5a76a6\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','dnid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','toJson','mxGraphModel','root','agicommand','hasOwnProperty','maxRetry','addVertex','mxCell','isArray','length','source','target','addEdge','value','getSquareProject','catch','indexOf','agi_','substring','inspect','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','evtHangup','sync','production','start','debug','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','traverseBFS','vertex','gotoc','context','extension','priority','response','code','result','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','clear','isUndefined','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20found','getLicense','then','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]','listening','connection','xml2json','lodash','syncho','util'];(function(_0x3722e4,_0x237174){var _0x28b1a3=function(_0x14013d){while(--_0x14013d){_0x3722e4['push'](_0x3722e4['shift']());}};_0x28b1a3(++_0x237174);}(_0x7793,0x10a));var _0x3779=function(_0x25f06e,_0x5202c7){_0x25f06e=_0x25f06e-0x0;var _0x319fbe=_0x7793[_0x25f06e];return _0x319fbe;};'use strict';var parser=require(_0x3779('0x0'));var _=require(_0x3779('0x1'));var syncho=require(_0x3779('0x2'));var util=require(_0x3779('0x3'));var moment=require(_0x3779('0x4'));var config=require('../../config/environment');var logger=require(_0x3779('0x5'))(_0x3779('0x6'));var utilLicense=require(_0x3779('0x7'));var rpc=require(_0x3779('0x8'));var mailRpc=require(_0x3779('0x9'));var Graph=require('./graph');var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x3779('0x6')]=_[_0x3779('0xa')](config[_0x3779('0x6')],{'ip':'127.0.0.1','port':0x11dd});function connectionHandler(_0x3f0d8a){process[_0x3779('0xb')](function(){syncho(function(){try{setChannelVariables(_0x3f0d8a);agiHandler(_0x3f0d8a);}catch(_0x4e39a1){logger['error'](_0x4e39a1[_0x3779('0xc')]);}});});}function listeningHandler(){console[_0x3779('0xd')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0x3779('0x6')]['port']);logger[_0x3779('0xe')](util[_0x3779('0xf')](_0x3779('0x10'),config[_0x3779('0x6')]['ip'],config['agi'][_0x3779('0x11')]));}function errorHandler(_0x297534){if(_0x297534&&_0x297534[_0x3779('0x12')]&&_0x297534[_0x3779('0x13')]){logger[_0x3779('0x14')](util[_0x3779('0xf')](_0x3779('0x15'),_0x297534[_0x3779('0x12')],_0x297534['message']));}else{logger[_0x3779('0x14')](util[_0x3779('0xf')]('[ERROR]\x20%s',_0x297534[_0x3779('0xc')]));}}function closeHandler(){logger[_0x3779('0xe')](util['format'](_0x3779('0x16'),this[_0x3779('0x17')],this[_0x3779('0x18')],this[_0x3779('0x19')],this['dnid'],this[_0x3779('0x1a')]));try{createSquareReport(this);}catch(_0x4edd5c){logger[_0x3779('0x14')](_0x4edd5c[_0x3779('0xc')]);}}function timeoutHandler(){logger[_0x3779('0xe')](util[_0x3779('0xf')](_0x3779('0x1b'),this['arg_1'],this[_0x3779('0x18')],this[_0x3779('0x19')],this[_0x3779('0x1c')],this[_0x3779('0x1a')]));}function hangupHandler(){logger[_0x3779('0xe')](util[_0x3779('0xf')](_0x3779('0x1d'),this['arg_1'],this[_0x3779('0x18')],this[_0x3779('0x19')],this[_0x3779('0x1c')],this[_0x3779('0x1a')]));this['evtHangup']=!![];}function getRoot(_0x4b16a8){return parser[_0x3779('0x1e')](_0x4b16a8,{'object':!![]})[_0x3779('0x1f')][_0x3779('0x20')];}function addVertex(_0x338e87,_0x292365,_0x16b647){_0x292365[_0x3779('0x21')]=_0x16b647;if(_0x292365[_0x3779('0x22')]('retry')){_0x292365[_0x3779('0x23')]=parseInt(_0x292365['retry'],0xa);}_0x338e87[_0x3779('0x24')](_['omit'](_0x292365,_0x3779('0x25')));}function initGraph(_0xd49002,_0x538767){var _0x1e484c=new Graph();for(var _0x36866d in _0xd49002){if(_0xd49002['hasOwnProperty'](_0x36866d)){if(_[_0x3779('0x26')](_0xd49002[_0x36866d])){for(var _0x50f710=0x0;_0x50f710<_0xd49002[_0x36866d][_0x3779('0x27')];_0x50f710+=0x1){addVertex(_0x1e484c,_0xd49002[_0x36866d][_0x50f710],_0x36866d);}}else{addVertex(_0x1e484c,_0xd49002[_0x36866d],_0x36866d);}}}for(var _0x39a05b=0x0;_0x39a05b<_0x538767[_0x3779('0x27')];_0x39a05b+=0x1){if(_0x538767[_0x39a05b][_0x3779('0x28')]&&_0x538767[_0x39a05b][_0x3779('0x29')]){_0x1e484c[_0x3779('0x2a')](_0x538767[_0x39a05b][_0x3779('0x28')],_0x538767[_0x39a05b][_0x3779('0x29')],_0x538767[_0x39a05b][_0x3779('0x2b')]);}}return _0x1e484c;}function getSquareProject(_0x270ed1,_0x4f2c56){rpc[_0x3779('0x2c')](_0x270ed1)['then'](function(_0x5d0f0f){_0x4f2c56(null,_0x5d0f0f);})[_0x3779('0x2d')](function(_0x4e4538){_0x4f2c56(null,_0x4e4538);});}function createSquareReport(_0x5911b3,_0x559c3f){rpc['createSquareReport'](_0x5911b3)['then'](function(_0x4ddd34){if(_0x559c3f){_0x559c3f(null,_0x4ddd34);}})[_0x3779('0x2d')](function(_0x471c35){if(_0x559c3f){_0x559c3f(null,_0x471c35);}});}function setChannelVariables(_0x167fe2){for(var _0x21d769 in _0x167fe2){if(_0x167fe2[_0x3779('0x22')](_0x21d769)){if(_0x21d769[_0x3779('0x2e')](_0x3779('0x2f'))===0x0){_0x167fe2[_0x21d769[_0x3779('0x30')](0x4)]=_0x167fe2[_0x21d769];delete _0x167fe2[_0x21d769];}}}}function getLogFromObject(_0x2d01b3){return util[_0x3779('0x31')](_0x2d01b3,{'showHidden':![],'depth':null});}function agiHandler(_0x2048b1){var _0x3fb9a2,_0x4edda6,_0x252308,_0x2f2420,_0x465e53;logger['debug'](_0x3779('0x32'),JSON[_0x3779('0x33')](_0x2048b1,null,0x2));logger[_0x3779('0xe')](util[_0x3779('0xf')](_0x3779('0x34'),_0x2048b1['arg_1'],_0x2048b1[_0x3779('0x18')],_0x2048b1['callerid'],_0x2048b1[_0x3779('0x1c')],_0x2048b1['uniqueid']));_0x2048b1['on'](_0x3779('0x14'),errorHandler);_0x2048b1['on'](_0x3779('0x35'),closeHandler);_0x2048b1['on'](_0x3779('0x36'),timeoutHandler);_0x2048b1[_0x3779('0x37')]=![];_0x2048b1['on']('hangup',hangupHandler);var _0x10fc95=getSquareProject[_0x3779('0x38')](null,_0x2048b1[_0x3779('0x17')]);if(_0x10fc95){if(_0x10fc95[_0x3779('0x39')]){_0x3fb9a2=getRoot(_0x10fc95[_0x3779('0x39')]);if(_0x3fb9a2&&_0x3fb9a2[_0x3779('0x3a')]){logger[_0x3779('0x3b')]('root',JSON[_0x3779('0x33')](_0x3fb9a2,null,0x2));_0x2048b1[_0x3779('0x3c')]=moment()[_0x3779('0xf')](_0x3779('0x3d'));_0x4edda6=initGraph(_[_0x3779('0x3e')](_0x3fb9a2,'mxCell'),_0x3fb9a2[_0x3779('0x25')]);_0x252308=new Vertices(_0x2048b1,rpc,mailRpc);logger[_0x3779('0xe')](util[_0x3779('0xf')](_0x3779('0x3f'),_0x2048b1[_0x3779('0x17')],_0x2048b1[_0x3779('0x18')],_0x2048b1[_0x3779('0x19')],_0x2048b1[_0x3779('0x1c')],_0x2048b1['uniqueid']));_0x4edda6[_0x3779('0x40')](_0x3fb9a2[_0x3779('0x3a')]['id'],function(_0x688389){try{_0x688389=_0x252308['clear'](_0x688389);logger['debug'](_0x3779('0x41'),JSON[_0x3779('0x33')](_0x688389,null,0x2));if(_0x688389[_0x3779('0x21')]===_0x3779('0x42')){logger['info']('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x2048b1[_0x3779('0x43')]=_0x688389['context']||_0x2048b1['context'];_0x2048b1[_0x3779('0x44')]=_0x688389[_0x3779('0x44')];_0x2048b1['priority']=_0x688389[_0x3779('0x45')]?_0x688389[_0x3779('0x45')]-0x1:0x1;return null;}else if(_0x688389&&_0x252308[_0x688389[_0x3779('0x21')]]){_0x465e53=_0x252308[_0x688389[_0x3779('0x21')]](_0x688389);logger[_0x3779('0xe')](_0x3779('0x46'),JSON[_0x3779('0x33')](_0x465e53,null,0x2));if(_0x465e53&&_0x465e53[_0x3779('0x47')]===AGI_CODE_SUCCESS&&_0x465e53[_0x3779('0x48')]!==AGI_RESULT_ERROR&&!_0x2048b1['evtHangup']){logger[_0x3779('0x3b')](_0x3779('0x46'),getLogFromObject(_0x465e53));return _['isUndefined'](_0x465e53[_0x3779('0x48')])?null:_0x465e53[_0x3779('0x48')]['toString']();}else{logger[_0x3779('0x14')](_0x3779('0x46'),getLogFromObject(_0x465e53));return null;}}else{logger[_0x3779('0x14')](_0x3779('0x49'));return null;}}catch(_0x158e16){logger['error'](_0x158e16['stack']);return null;}});if(_0x3fb9a2[_0x3779('0x4a')]){logger[_0x3779('0xe')](util[_0x3779('0xf')](_0x3779('0x4b'),_0x2048b1[_0x3779('0x17')],_0x2048b1[_0x3779('0x18')],_0x2048b1[_0x3779('0x19')],_0x2048b1[_0x3779('0x1c')],_0x2048b1[_0x3779('0x1a')]));_0x4edda6['traverseBFS'](_0x3fb9a2[_0x3779('0x4a')]['id'],function(_0x364ac4){try{_0x364ac4=_0x252308[_0x3779('0x4c')](_0x364ac4);logger[_0x3779('0x3b')]('vertex',JSON['stringify'](_0x364ac4,null,0x2));if(_0x364ac4&&_0x252308[_0x364ac4[_0x3779('0x21')]]){_0x465e53=_0x252308[_0x364ac4[_0x3779('0x21')]](_0x364ac4);if(_0x465e53){logger['debug'](_0x3779('0x46'),getLogFromObject(_0x465e53));return _[_0x3779('0x4d')](_0x465e53[_0x3779('0x48')])?null:_0x465e53[_0x3779('0x48')]['toString']();}else{logger[_0x3779('0x14')](_0x3779('0x46'),getLogFromObject(_0x465e53));return null;}}else{logger[_0x3779('0x14')](_0x3779('0x49'));return null;}}catch(_0x3cb69d){logger[_0x3779('0x14')](_0x3cb69d[_0x3779('0xc')]);return null;}});}logger[_0x3779('0xe')](util[_0x3779('0xf')]('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x2048b1[_0x3779('0x17')],_0x2048b1[_0x3779('0x18')],_0x2048b1[_0x3779('0x19')],_0x2048b1[_0x3779('0x1c')],_0x2048b1[_0x3779('0x1a')]));logger['info'](util[_0x3779('0xf')](_0x3779('0x4e'),_0x2048b1[_0x3779('0x43')],_0x2048b1[_0x3779('0x44')],parseInt(_0x2048b1[_0x3779('0x45')],0xa)+0x1));_0x2048b1['continueAt'](_0x2048b1[_0x3779('0x43')],_0x2048b1['extension'],parseInt(_0x2048b1['priority'],0xa)+0x1);_0x2048b1['close']();}}else{logger[_0x3779('0x14')](util[_0x3779('0xf')]('Project\x20%s\x20not\x20published',_0x2048b1['arg_1']));_0x2048b1[_0x3779('0x4f')](_0x2048b1[_0x3779('0x43')],_0x2048b1[_0x3779('0x44')],parseInt(_0x2048b1[_0x3779('0x45')],0xa)+0x1);_0x2048b1[_0x3779('0x35')]();}}else{logger[_0x3779('0x14')](util[_0x3779('0xf')](_0x3779('0x50'),_0x2048b1['arg_1']));_0x2048b1[_0x3779('0x4f')](_0x2048b1['context'],_0x2048b1[_0x3779('0x44')],parseInt(_0x2048b1[_0x3779('0x45')],0xa)+0x1);_0x2048b1[_0x3779('0x35')]();}}function main(){var _0x45c3bf;return utilLicense[_0x3779('0x51')]()[_0x3779('0x52')](function(_0x490490){if(_0x490490){if(_0x490490[_0x3779('0x53')]){if(_0x490490['callysquare']&&_0x490490[_0x3779('0x54')]>0x0){logger[_0x3779('0xe')](util[_0x3779('0xf')](_0x3779('0x55'),_0x490490['callysquare']));_0x45c3bf=_0x490490[_0x3779('0x54')];}else{logger[_0x3779('0xe')](_0x3779('0x56'));}}else{logger[_0x3779('0xe')]('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x45c3bf=-0x1;}}})[_0x3779('0x2d')](function(_0x1f6342){logger[_0x3779('0x14')](_0x3779('0x57'),_0x1f6342[_0x3779('0xc')]);})[_0x3779('0x4a')](function(){var _0x3db68c=require('./server')(config[_0x3779('0x6')]['port'],config['agi']['ip'],_0x45c3bf);_0x3db68c['on'](_0x3779('0x14'),errorHandler);_0x3db68c['on'](_0x3779('0x58'),listeningHandler);_0x3db68c['on'](_0x3779('0x59'),connectionHandler);_0x3db68c['on'](_0x3779('0x35'),closeHandler);});}main(); \ No newline at end of file +var _0x6278=['gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','code','response','result','toString','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20published','Project\x20%s\x20not\x20found','getLicense','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','./server','listening','xml2json','lodash','syncho','util','moment','../../config/logger','agi','../../config/license/util','./rpc','./mailRpc','./graph','./vertices','127.0.0.1','nextTick','error','stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','message','format','[%s]\x20%s','name','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','uniqueid','evtHangup','root','agicommand','hasOwnProperty','retry','maxRetry','addVertex','mxCell','length','source','addEdge','target','value','getSquareProject','catch','createSquareReport','then','agi_','substring','inspect','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','production','debug','joinAt','omit','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','start','clear','vertex'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x6278,0xc9));var _0x8627=function(_0x4b03d3,_0x32f1d2){_0x4b03d3=_0x4b03d3-0x0;var _0x58a968=_0x6278[_0x4b03d3];return _0x58a968;};'use strict';var parser=require(_0x8627('0x0'));var _=require(_0x8627('0x1'));var syncho=require(_0x8627('0x2'));var util=require(_0x8627('0x3'));var moment=require(_0x8627('0x4'));var config=require('../../config/environment');var logger=require(_0x8627('0x5'))(_0x8627('0x6'));var utilLicense=require(_0x8627('0x7'));var rpc=require(_0x8627('0x8'));var mailRpc=require(_0x8627('0x9'));var Graph=require(_0x8627('0xa'));var Vertices=require(_0x8627('0xb'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x8627('0x6')]=_['defaults'](config[_0x8627('0x6')],{'ip':_0x8627('0xc'),'port':0x11dd});function connectionHandler(_0x397662){process[_0x8627('0xd')](function(){syncho(function(){try{setChannelVariables(_0x397662);agiHandler(_0x397662);}catch(_0x247a5b){logger[_0x8627('0xe')](_0x247a5b[_0x8627('0xf')]);}});});}function listeningHandler(){console[_0x8627('0x10')](_0x8627('0x11'),config[_0x8627('0x6')][_0x8627('0x12')]);logger[_0x8627('0x13')](util['format']('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config[_0x8627('0x6')]['ip'],config['agi'][_0x8627('0x12')]));}function errorHandler(_0x2d4305){if(_0x2d4305&&_0x2d4305['name']&&_0x2d4305[_0x8627('0x14')]){logger['error'](util[_0x8627('0x15')](_0x8627('0x16'),_0x2d4305[_0x8627('0x17')],_0x2d4305[_0x8627('0x14')]));}else{logger[_0x8627('0xe')](util[_0x8627('0x15')](_0x8627('0x18'),_0x2d4305[_0x8627('0xf')]));}}function closeHandler(){logger['info'](util[_0x8627('0x15')](_0x8627('0x19'),this[_0x8627('0x1a')],this[_0x8627('0x1b')],this[_0x8627('0x1c')],this[_0x8627('0x1d')],this['uniqueid']));try{createSquareReport(this);}catch(_0xcf0bd3){logger['error'](_0xcf0bd3[_0x8627('0xf')]);}}function timeoutHandler(){logger[_0x8627('0x13')](util[_0x8627('0x15')](_0x8627('0x1e'),this['arg_1'],this[_0x8627('0x1b')],this[_0x8627('0x1c')],this[_0x8627('0x1d')],this[_0x8627('0x1f')]));}function hangupHandler(){logger[_0x8627('0x13')](util[_0x8627('0x15')]('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x8627('0x1a')],this['calleridname'],this[_0x8627('0x1c')],this['dnid'],this[_0x8627('0x1f')]));this[_0x8627('0x20')]=!![];}function getRoot(_0x2c2a02){return parser['toJson'](_0x2c2a02,{'object':!![]})['mxGraphModel'][_0x8627('0x21')];}function addVertex(_0x2f39fc,_0x33bb6c,_0x102f01){_0x33bb6c[_0x8627('0x22')]=_0x102f01;if(_0x33bb6c[_0x8627('0x23')](_0x8627('0x24'))){_0x33bb6c[_0x8627('0x25')]=parseInt(_0x33bb6c['retry'],0xa);}_0x2f39fc[_0x8627('0x26')](_['omit'](_0x33bb6c,_0x8627('0x27')));}function initGraph(_0x2a04b8,_0x25d8f3){var _0x418ef7=new Graph();for(var _0x2f6a3d in _0x2a04b8){if(_0x2a04b8[_0x8627('0x23')](_0x2f6a3d)){if(_['isArray'](_0x2a04b8[_0x2f6a3d])){for(var _0x4507da=0x0;_0x4507da<_0x2a04b8[_0x2f6a3d][_0x8627('0x28')];_0x4507da+=0x1){addVertex(_0x418ef7,_0x2a04b8[_0x2f6a3d][_0x4507da],_0x2f6a3d);}}else{addVertex(_0x418ef7,_0x2a04b8[_0x2f6a3d],_0x2f6a3d);}}}for(var _0x57c518=0x0;_0x57c518<_0x25d8f3[_0x8627('0x28')];_0x57c518+=0x1){if(_0x25d8f3[_0x57c518][_0x8627('0x29')]&&_0x25d8f3[_0x57c518]['target']){_0x418ef7[_0x8627('0x2a')](_0x25d8f3[_0x57c518]['source'],_0x25d8f3[_0x57c518][_0x8627('0x2b')],_0x25d8f3[_0x57c518][_0x8627('0x2c')]);}}return _0x418ef7;}function getSquareProject(_0x11da75,_0x4e442d){rpc[_0x8627('0x2d')](_0x11da75)['then'](function(_0x57639e){_0x4e442d(null,_0x57639e);})[_0x8627('0x2e')](function(_0x4d9645){_0x4e442d(null,_0x4d9645);});}function createSquareReport(_0x5ea56f,_0x132f37){rpc[_0x8627('0x2f')](_0x5ea56f)[_0x8627('0x30')](function(_0x12168f){if(_0x132f37){_0x132f37(null,_0x12168f);}})[_0x8627('0x2e')](function(_0x2cd4db){if(_0x132f37){_0x132f37(null,_0x2cd4db);}});}function setChannelVariables(_0x36a3ae){for(var _0x2318a5 in _0x36a3ae){if(_0x36a3ae['hasOwnProperty'](_0x2318a5)){if(_0x2318a5['indexOf'](_0x8627('0x31'))===0x0){_0x36a3ae[_0x2318a5[_0x8627('0x32')](0x4)]=_0x36a3ae[_0x2318a5];delete _0x36a3ae[_0x2318a5];}}}}function getLogFromObject(_0x5508a3){return util[_0x8627('0x33')](_0x5508a3,{'showHidden':![],'depth':null});}function agiHandler(_0x51b58a){var _0xbd9292,_0x5b4bfc,_0x47833f,_0x91220d,_0x16cb34;logger['debug'](_0x8627('0x34'),JSON[_0x8627('0x35')](_0x51b58a,null,0x2));logger['info'](util['format'](_0x8627('0x36'),_0x51b58a[_0x8627('0x1a')],_0x51b58a['calleridname'],_0x51b58a['callerid'],_0x51b58a[_0x8627('0x1d')],_0x51b58a['uniqueid']));_0x51b58a['on'](_0x8627('0xe'),errorHandler);_0x51b58a['on'](_0x8627('0x37'),closeHandler);_0x51b58a['on'](_0x8627('0x38'),timeoutHandler);_0x51b58a[_0x8627('0x20')]=![];_0x51b58a['on']('hangup',hangupHandler);var _0x5782c5=getSquareProject['sync'](null,_0x51b58a[_0x8627('0x1a')]);if(_0x5782c5){if(_0x5782c5[_0x8627('0x39')]){_0xbd9292=getRoot(_0x5782c5[_0x8627('0x39')]);if(_0xbd9292&&_0xbd9292['start']){logger[_0x8627('0x3a')]('root',JSON[_0x8627('0x35')](_0xbd9292,null,0x2));_0x51b58a[_0x8627('0x3b')]=moment()[_0x8627('0x15')]('YYYY-MM-DD\x20HH:mm:ss');_0x5b4bfc=initGraph(_[_0x8627('0x3c')](_0xbd9292,_0x8627('0x27')),_0xbd9292['mxCell']);_0x47833f=new Vertices(_0x51b58a,rpc,mailRpc);logger[_0x8627('0x13')](util[_0x8627('0x15')](_0x8627('0x3d'),_0x51b58a[_0x8627('0x1a')],_0x51b58a[_0x8627('0x1b')],_0x51b58a[_0x8627('0x1c')],_0x51b58a[_0x8627('0x1d')],_0x51b58a[_0x8627('0x1f')]));_0x5b4bfc[_0x8627('0x3e')](_0xbd9292[_0x8627('0x3f')]['id'],function(_0x30ae02){try{_0x30ae02=_0x47833f[_0x8627('0x40')](_0x30ae02);logger['debug'](_0x8627('0x41'),JSON[_0x8627('0x35')](_0x30ae02,null,0x2));if(_0x30ae02[_0x8627('0x22')]==='gotoc'){logger[_0x8627('0x13')](_0x8627('0x42'));_0x51b58a[_0x8627('0x43')]=_0x30ae02['context']||_0x51b58a['context'];_0x51b58a[_0x8627('0x44')]=_0x30ae02['extension'];_0x51b58a['priority']=_0x30ae02[_0x8627('0x45')]?_0x30ae02[_0x8627('0x45')]-0x1:0x1;return null;}else if(_0x30ae02&&_0x47833f[_0x30ae02['agicommand']]){_0x16cb34=_0x47833f[_0x30ae02[_0x8627('0x22')]](_0x30ae02);logger[_0x8627('0x13')]('response',JSON[_0x8627('0x35')](_0x16cb34,null,0x2));if(_0x16cb34&&_0x16cb34[_0x8627('0x46')]===AGI_CODE_SUCCESS&&_0x16cb34['result']!==AGI_RESULT_ERROR&&!_0x51b58a[_0x8627('0x20')]){logger[_0x8627('0x3a')](_0x8627('0x47'),getLogFromObject(_0x16cb34));return _['isUndefined'](_0x16cb34['result'])?null:_0x16cb34[_0x8627('0x48')][_0x8627('0x49')]();}else{logger['error'](_0x8627('0x47'),getLogFromObject(_0x16cb34));return null;}}else{logger[_0x8627('0xe')](_0x8627('0x4a'));return null;}}catch(_0xee2d13){logger['error'](_0xee2d13[_0x8627('0xf')]);return null;}});if(_0xbd9292[_0x8627('0x4b')]){logger[_0x8627('0x13')](util[_0x8627('0x15')](_0x8627('0x4c'),_0x51b58a['arg_1'],_0x51b58a[_0x8627('0x1b')],_0x51b58a['callerid'],_0x51b58a['dnid'],_0x51b58a[_0x8627('0x1f')]));_0x5b4bfc[_0x8627('0x3e')](_0xbd9292[_0x8627('0x4b')]['id'],function(_0x37505b){try{_0x37505b=_0x47833f[_0x8627('0x40')](_0x37505b);logger[_0x8627('0x3a')](_0x8627('0x41'),JSON[_0x8627('0x35')](_0x37505b,null,0x2));if(_0x37505b&&_0x47833f[_0x37505b[_0x8627('0x22')]]){_0x16cb34=_0x47833f[_0x37505b[_0x8627('0x22')]](_0x37505b);if(_0x16cb34){logger[_0x8627('0x3a')]('response',getLogFromObject(_0x16cb34));return _['isUndefined'](_0x16cb34['result'])?null:_0x16cb34[_0x8627('0x48')][_0x8627('0x49')]();}else{logger[_0x8627('0xe')]('response',getLogFromObject(_0x16cb34));return null;}}else{logger[_0x8627('0xe')](_0x8627('0x4a'));return null;}}catch(_0x2b7486){logger[_0x8627('0xe')](_0x2b7486['stack']);return null;}});}logger[_0x8627('0x13')](util[_0x8627('0x15')](_0x8627('0x4d'),_0x51b58a['arg_1'],_0x51b58a['calleridname'],_0x51b58a[_0x8627('0x1c')],_0x51b58a[_0x8627('0x1d')],_0x51b58a['uniqueid']));logger[_0x8627('0x13')](util[_0x8627('0x15')](_0x8627('0x4e'),_0x51b58a[_0x8627('0x43')],_0x51b58a[_0x8627('0x44')],parseInt(_0x51b58a[_0x8627('0x45')],0xa)+0x1));_0x51b58a[_0x8627('0x4f')](_0x51b58a[_0x8627('0x43')],_0x51b58a[_0x8627('0x44')],parseInt(_0x51b58a[_0x8627('0x45')],0xa)+0x1);_0x51b58a[_0x8627('0x37')]();}}else{logger[_0x8627('0xe')](util[_0x8627('0x15')](_0x8627('0x50'),_0x51b58a['arg_1']));_0x51b58a[_0x8627('0x4f')](_0x51b58a[_0x8627('0x43')],_0x51b58a[_0x8627('0x44')],parseInt(_0x51b58a[_0x8627('0x45')],0xa)+0x1);_0x51b58a[_0x8627('0x37')]();}}else{logger[_0x8627('0xe')](util[_0x8627('0x15')](_0x8627('0x51'),_0x51b58a['arg_1']));_0x51b58a['continueAt'](_0x51b58a['context'],_0x51b58a[_0x8627('0x44')],parseInt(_0x51b58a[_0x8627('0x45')],0xa)+0x1);_0x51b58a['close']();}}function main(){var _0x365465;return utilLicense[_0x8627('0x52')]()['then'](function(_0x458c6e){if(_0x458c6e){if(_0x458c6e['voice']){if(_0x458c6e[_0x8627('0x53')]&&_0x458c6e[_0x8627('0x53')]>0x0){logger[_0x8627('0x13')](util[_0x8627('0x15')](_0x8627('0x54'),_0x458c6e['callysquare']));_0x365465=_0x458c6e['callysquare'];}else{logger['info'](_0x8627('0x55'));}}else{logger[_0x8627('0x13')](_0x8627('0x56'));_0x365465=-0x1;}}})[_0x8627('0x2e')](function(_0x1beaf9){logger[_0x8627('0xe')]('[LICENSE]',_0x1beaf9[_0x8627('0xf')]);})['finally'](function(){var _0x34a97f=require(_0x8627('0x57'))(config[_0x8627('0x6')][_0x8627('0x12')],config['agi']['ip'],_0x365465);_0x34a97f['on']('error',errorHandler);_0x34a97f['on'](_0x8627('0x58'),listeningHandler);_0x34a97f['on']('connection',connectionHandler);_0x34a97f['on']('close',closeHandler);});}main(); \ No newline at end of file diff --git a/server/services/agi/mailRpc/index.js b/server/services/agi/mailRpc/index.js index 1d1bae1..e7ce2ef 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 _0xc559=['error','message','result','catch','bluebird','http','request','then'];(function(_0x210116,_0x3be802){var _0x165a9a=function(_0x324d8b){while(--_0x324d8b){_0x210116['push'](_0x210116['shift']());}};_0x165a9a(++_0x3be802);}(_0xc559,0x84));var _0x9c55=function(_0x43bef7,_0x7983f7){_0x43bef7=_0x43bef7-0x0;var _0x3c8151=_0xc559[_0x43bef7];return _0x3c8151;};'use strict';var BPromise=require(_0x9c55('0x0'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9c55('0x1')]({'port':0x232b});function request(_0x1bd3ca,_0x33a5d0){return new BPromise(function(_0x3af360,_0x2440e7){return client[_0x9c55('0x2')](_0x1bd3ca,_0x33a5d0)[_0x9c55('0x3')](function(_0x1f7b92){if(_0x1f7b92[_0x9c55('0x4')]){return _0x2440e7(_0x1f7b92['error'][_0x9c55('0x5')]);}else{return _0x3af360(_0x1f7b92[_0x9c55('0x6')]);}})[_0x9c55('0x7')](function(_0x27b8c7){return _0x2440e7(_0x27b8c7);});});}exports['sendMailMessage']=function(_0x41c69e,_0x149e8f){return request('SendMail',{'account':_0x41c69e,'message':_0x149e8f});}; \ No newline at end of file +var _0xfe22=['SendMail','bluebird','client','request','then','error','message','result','catch','sendMailMessage'];(function(_0x1f1fbf,_0x21abb0){var _0x5d1869=function(_0x32cad5){while(--_0x32cad5){_0x1f1fbf['push'](_0x1f1fbf['shift']());}};_0x5d1869(++_0x21abb0);}(_0xfe22,0x1eb));var _0x2fe2=function(_0x3bc062,_0x5f20e6){_0x3bc062=_0x3bc062-0x0;var _0x3682ef=_0xfe22[_0x3bc062];return _0x3682ef;};'use strict';var BPromise=require(_0x2fe2('0x0'));var jayson=require('jayson/promise');var client=jayson[_0x2fe2('0x1')]['http']({'port':0x232b});function request(_0x2a0fa7,_0x2ec8cc){return new BPromise(function(_0x22233b,_0x159bea){return client[_0x2fe2('0x2')](_0x2a0fa7,_0x2ec8cc)[_0x2fe2('0x3')](function(_0x5df109){if(_0x5df109[_0x2fe2('0x4')]){return _0x159bea(_0x5df109[_0x2fe2('0x4')][_0x2fe2('0x5')]);}else{return _0x22233b(_0x5df109[_0x2fe2('0x6')]);}})[_0x2fe2('0x7')](function(_0x5c2b21){return _0x159bea(_0x5c2b21);});});}exports[_0x2fe2('0x8')]=function(_0x59ed40,_0x5698b2){return request(_0x2fe2('0x9'),{'account':_0x59ed40,'message':_0x5698b2});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index b8400bc..574797a 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 _0xd752=['Transform','call','_localBuffer','_inBody','inherits','prototype','_transform','indexOf','substring','length','split','slice','trim','headers','emit','exports','util','stream'];(function(_0x269410,_0x27d834){var _0x4b7e51=function(_0x5b2010){while(--_0x5b2010){_0x269410['push'](_0x269410['shift']());}};_0x4b7e51(++_0x27d834);}(_0xd752,0x7c));var _0x2d75=function(_0x1b00d0,_0x265b67){_0x1b00d0=_0x1b00d0-0x0;var _0x31446c=_0xd752[_0x1b00d0];return _0x31446c;};'use strict';var util=require(_0x2d75('0x0'));var Transform=require(_0x2d75('0x1'))[_0x2d75('0x2')];function AGIReply(_0x18b14a){Transform[_0x2d75('0x3')](this,_0x18b14a);this[_0x2d75('0x4')]='';this[_0x2d75('0x5')]=![];}util[_0x2d75('0x6')](AGIReply,Transform);AGIReply[_0x2d75('0x7')][_0x2d75('0x8')]=function(_0x89cce3,_0xb1226d,_0x529e6b){var _0x4843e7='\x0a',_0x339218=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x37070f=-0x1,_0x7eedcb=-0x1,_0x446b0c='',_0x3bacdb=0x0,_0x58ccc2='',_0x20c365='';this[_0x2d75('0x4')]+=_0x89cce3['toString']();_0x58ccc2=this['_localBuffer'];if(!this[_0x2d75('0x5')]){_0x3bacdb=0x0;while(_0x339218[_0x3bacdb]){while((_0x7eedcb=_0x58ccc2[_0x2d75('0x9')](_0x339218[_0x3bacdb]))!=-0x1){_0x446b0c=_0x339218[_0x3bacdb];_0x20c365=_0x58ccc2[_0x2d75('0xa')](0x0,_0x7eedcb);_0x58ccc2=_0x58ccc2['substring'](_0x7eedcb+_0x446b0c[_0x2d75('0xb')]);var _0x507f3e=_0x20c365[_0x2d75('0xc')](_0x4843e7),_0x3995df=0x0,_0x466eca={},_0x3fdee7='',_0x58c0dd='',_0x5ef044=-0x1;while(_0x507f3e[_0x3995df]){_0x5ef044=_0x507f3e[_0x3995df][_0x2d75('0x9')](':');if(_0x5ef044!=-0x1){_0x3fdee7=_0x507f3e[_0x3995df][_0x2d75('0xd')](0x0,_0x5ef044)[_0x2d75('0xe')]();_0x58c0dd=_0x507f3e[_0x3995df]['slice'](_0x5ef044+0x1)[_0x2d75('0xe')]();if(_0x3fdee7[_0x2d75('0xb')]>0x0){_0x466eca[_0x3fdee7]=_0x58c0dd;}}else{}_0x3995df++;}this['emit'](_0x2d75('0xf'),_0x466eca);this[_0x2d75('0x5')]=!![];}_0x3bacdb++;}this['_localBuffer']=_0x58ccc2;}else{while((_0x37070f=_0x58ccc2[_0x2d75('0x9')](_0x4843e7))!=-0x1){_0x20c365=_0x58ccc2['substring'](0x0,_0x37070f);this[_0x2d75('0x10')]('line',_0x20c365);_0x58ccc2=_0x58ccc2[_0x2d75('0xa')](_0x37070f+_0x4843e7['length']);}this[_0x2d75('0x4')]=_0x58ccc2;}_0x529e6b();};module[_0x2d75('0x11')]=AGIReply; \ No newline at end of file +var _0x10c4=['toString','indexOf','substring','length','split','slice','trim','emit','headers','exports','util','stream','call','_localBuffer','_inBody','prototype','_transform'];(function(_0x1f0d60,_0x58a2c2){var _0x148a20=function(_0x96e0a3){while(--_0x96e0a3){_0x1f0d60['push'](_0x1f0d60['shift']());}};_0x148a20(++_0x58a2c2);}(_0x10c4,0x109));var _0x410c=function(_0x4f79f2,_0x2a2085){_0x4f79f2=_0x4f79f2-0x0;var _0x1968d2=_0x10c4[_0x4f79f2];return _0x1968d2;};'use strict';var util=require(_0x410c('0x0'));var Transform=require(_0x410c('0x1'))['Transform'];function AGIReply(_0x474ad5){Transform[_0x410c('0x2')](this,_0x474ad5);this[_0x410c('0x3')]='';this[_0x410c('0x4')]=![];}util['inherits'](AGIReply,Transform);AGIReply[_0x410c('0x5')][_0x410c('0x6')]=function(_0x535164,_0x3d99df,_0x518935){var _0x34c9ff='\x0a',_0xb90c89=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x540097=-0x1,_0x5a1ed3=-0x1,_0x1fcca8='',_0x30d2bb=0x0,_0x22ef62='',_0x4c0b23='';this[_0x410c('0x3')]+=_0x535164[_0x410c('0x7')]();_0x22ef62=this[_0x410c('0x3')];if(!this[_0x410c('0x4')]){_0x30d2bb=0x0;while(_0xb90c89[_0x30d2bb]){while((_0x5a1ed3=_0x22ef62[_0x410c('0x8')](_0xb90c89[_0x30d2bb]))!=-0x1){_0x1fcca8=_0xb90c89[_0x30d2bb];_0x4c0b23=_0x22ef62[_0x410c('0x9')](0x0,_0x5a1ed3);_0x22ef62=_0x22ef62[_0x410c('0x9')](_0x5a1ed3+_0x1fcca8[_0x410c('0xa')]);var _0x53e6a9=_0x4c0b23[_0x410c('0xb')](_0x34c9ff),_0x4922b4=0x0,_0x2d125d={},_0x3231c7='',_0x55cfd7='',_0x1b1908=-0x1;while(_0x53e6a9[_0x4922b4]){_0x1b1908=_0x53e6a9[_0x4922b4][_0x410c('0x8')](':');if(_0x1b1908!=-0x1){_0x3231c7=_0x53e6a9[_0x4922b4][_0x410c('0xc')](0x0,_0x1b1908)['trim']();_0x55cfd7=_0x53e6a9[_0x4922b4][_0x410c('0xc')](_0x1b1908+0x1)[_0x410c('0xd')]();if(_0x3231c7[_0x410c('0xa')]>0x0){_0x2d125d[_0x3231c7]=_0x55cfd7;}}else{}_0x4922b4++;}this[_0x410c('0xe')](_0x410c('0xf'),_0x2d125d);this['_inBody']=!![];}_0x30d2bb++;}this[_0x410c('0x3')]=_0x22ef62;}else{while((_0x540097=_0x22ef62[_0x410c('0x8')](_0x34c9ff))!=-0x1){_0x4c0b23=_0x22ef62[_0x410c('0x9')](0x0,_0x540097);this[_0x410c('0xe')]('line',_0x4c0b23);_0x22ef62=_0x22ef62[_0x410c('0x9')](_0x540097+_0x34c9ff[_0x410c('0xa')]);}this[_0x410c('0x3')]=_0x22ef62;}_0x518935();};module[_0x410c('0x10')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index ab0773d..d175899 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 _0x7607=['getTrunkById','ShowTrunk','ShowSound','save_name','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareMessage','createCmContact','ShowCmHopper','phone','ListId','CreateCmContact','getPauseById','agentLogin','LoginUser','agentPause','UnpauseUser','agentLogout','LogoutUser','bluebird','moment','lodash','jayson/promise','client','http','request','then','error','catch','getSquareProject','ShowSquareProject','ShowMailAccount','MailServerOut','Smtp','name','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser'];(function(_0x57bcc0,_0x281040){var _0x4e361f=function(_0x406ef5){while(--_0x406ef5){_0x57bcc0['push'](_0x57bcc0['shift']());}};_0x4e361f(++_0x281040);}(_0x7607,0x92));var _0x7760=function(_0xb786a3,_0x48d5b4){_0xb786a3=_0xb786a3-0x0;var _0x24d7a4=_0x7607[_0xb786a3];return _0x24d7a4;};'use strict';var BPromise=require(_0x7760('0x0'));var moment=require(_0x7760('0x1'));var _=require(_0x7760('0x2'));var util=require('util');var jayson=require(_0x7760('0x3'));var client=jayson[_0x7760('0x4')][_0x7760('0x5')]({'port':0x2329});function request(_0x45a396,_0x21730d){return new BPromise(function(_0xde117d,_0x55560c){return client[_0x7760('0x6')](_0x45a396,_0x21730d)[_0x7760('0x7')](function(_0x53dfef){if(_0x53dfef[_0x7760('0x8')]){return _0x55560c(_0x53dfef['error']['message']);}else{return _0xde117d(_0x53dfef['result']);}})[_0x7760('0x9')](function(_0x5d6798){return _0x55560c(_0x5d6798);});});}exports[_0x7760('0xa')]=function(_0x2ebc39){return request(_0x7760('0xb'),{'options':{'raw':![],'where':{'name':_0x2ebc39},'attributes':['production']}});};exports['getMailAccountById']=function(_0x59fcf5){return request(_0x7760('0xc'),{'options':{'raw':![],'where':{'id':_0x59fcf5},'include':[{'model':_0x7760('0xd'),'as':_0x7760('0xe')}],'attributes':['id',_0x7760('0xf'),'email']}});};exports[_0x7760('0x10')]=function(_0xb0634c){return request('ShowSquareProject',{'options':{'where':{'id':_0xb0634c},'attributes':['name']}});};exports[_0x7760('0x11')]=function(_0x50457e){return request(_0x7760('0x12'),{'options':{'where':{'id':_0x50457e},'attributes':['name']}});};exports[_0x7760('0x13')]=function(_0x2f2e1a){return request('ShowVariable',{'options':{'where':{'id':_0x2f2e1a},'attributes':[_0x7760('0xf')]}});};exports[_0x7760('0x14')]=function(_0x24991d){return request(_0x7760('0x15'),{'options':{'where':{'id':_0x24991d},'attributes':[_0x7760('0x16')]}});};exports[_0x7760('0x17')]=function(_0x3b58bd){return request(_0x7760('0x18'),{'options':{'where':{'id':_0x3b58bd},'attributes':['name']}});};exports[_0x7760('0x19')]=function(_0x30104b){return request(_0x7760('0x1a'),{'options':{'where':{'id':_0x30104b},'attributes':['name']}});};exports['getSoundById']=function(_0x2809ff){return request(_0x7760('0x1b'),{'options':{'where':{'id':_0x2809ff},'attributes':[_0x7760('0x1c')]}});};exports['getIntervalById']=function(_0x410115){return request(_0x7760('0x1d'),{'options':{'raw':![],'where':{'id':_0x410115},'include':[{'model':_0x7760('0x1e'),'as':_0x7760('0x1f')}]}});};exports[_0x7760('0x20')]=function(_0x16e8d6){return request(_0x7760('0x21'),{'options':{'where':{'id':_0x16e8d6},'attributes':['id','name']}});};exports[_0x7760('0x22')]=function(_0x34fbfb){return request('CreateSmsMessage',{'body':_0x34fbfb});};exports[_0x7760('0x23')]=function(_0x5ba9c4){return request(_0x7760('0x24'),{'body':_0x5ba9c4});};exports[_0x7760('0x25')]=function(_0x8dc032){return request(_0x7760('0x26'),{'body':_[_0x7760('0x27')](_0x8dc032,{'project_name':_0x8dc032['arg_1'],'prev_project_name':_0x8dc032[_0x7760('0x28')]||'','is_subproject':_0x8dc032[_0x7760('0x28')]?!![]:![],'leaveAt':moment()[_0x7760('0x29')](_0x7760('0x2a'))})});};exports[_0x7760('0x2b')]=function(_0x35866d){return request('CreateSquareRecording',{'body':_0x35866d});};exports['createSquareMessage']=function(_0x2bc907){return request(_0x7760('0x2c'),{'body':_0x2bc907});};exports[_0x7760('0x2d')]=function(_0x190059){return request(_0x7760('0x2e'),{'options':{'raw':![],'where':{'phone':_0x190059[_0x7760('0x2f')],'ListId':_0x190059[_0x7760('0x30')]}}})[_0x7760('0x7')](function(_0x4acd40){if(_0x4acd40){return _0x4acd40;}return request(_0x7760('0x31'),{'body':_0x190059});});};exports[_0x7760('0x32')]=function(_0x1ccb86){return request('ShowPause',{'options':{'where':{'id':_0x1ccb86},'attributes':[_0x7760('0xf')]}});};exports[_0x7760('0x33')]=function(_0x5a791c,_0x4c32da){return request(_0x7760('0x34'),{'body':{'interface':_0x4c32da},'options':{'where':_0x5a791c}});};exports[_0x7760('0x35')]=function(_0x281d0f,_0x2293b3,_0x1cc443){return request('PauseUser',{'body':{'type':_0x2293b3,'uniqueid':_0x1cc443},'options':{'where':_0x281d0f}});};exports['agentUnpause']=function(_0x4f25bf){return request(_0x7760('0x36'),{'body':{},'options':{'where':_0x4f25bf}});};exports[_0x7760('0x37')]=function(_0x2141e4){return request(_0x7760('0x38'),{'body':{},'options':{'where':_0x2141e4}});}; \ No newline at end of file +var _0x5853=['ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareMessage','createCmContact','ShowCmHopper','phone','ListId','then','CreateCmContact','getPauseById','agentLogin','LoginUser','agentUnpause','UnpauseUser','LogoutUser','bluebird','moment','lodash','util','http','request','error','message','result','catch','getSquareProject','ShowSquareProject','production','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','email','getSquareProjectById','name','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','ShowTrunk','ShowSound','ShowInterval','Interval','Intervals','getSmsAccountById'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5853,0x1f1));var _0x3585=function(_0x596de3,_0xf801c0){_0x596de3=_0x596de3-0x0;var _0xbf541f=_0x5853[_0x596de3];return _0xbf541f;};'use strict';var BPromise=require(_0x3585('0x0'));var moment=require(_0x3585('0x1'));var _=require(_0x3585('0x2'));var util=require(_0x3585('0x3'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3585('0x4')]({'port':0x2329});function request(_0x3b4079,_0x284074){return new BPromise(function(_0x5cac28,_0x418720){return client[_0x3585('0x5')](_0x3b4079,_0x284074)['then'](function(_0x318d33){if(_0x318d33[_0x3585('0x6')]){return _0x418720(_0x318d33[_0x3585('0x6')][_0x3585('0x7')]);}else{return _0x5cac28(_0x318d33[_0x3585('0x8')]);}})[_0x3585('0x9')](function(_0x279287){return _0x418720(_0x279287);});});}exports[_0x3585('0xa')]=function(_0x18f9ca){return request(_0x3585('0xb'),{'options':{'raw':![],'where':{'name':_0x18f9ca},'attributes':[_0x3585('0xc')]}});};exports[_0x3585('0xd')]=function(_0xb5abe9){return request(_0x3585('0xe'),{'options':{'raw':![],'where':{'id':_0xb5abe9},'include':[{'model':_0x3585('0xf'),'as':_0x3585('0x10')}],'attributes':['id','name',_0x3585('0x11')]}});};exports[_0x3585('0x12')]=function(_0x2f7efa){return request(_0x3585('0xb'),{'options':{'where':{'id':_0x2f7efa},'attributes':[_0x3585('0x13')]}});};exports['getVoiceQueueById']=function(_0x393cd4){return request(_0x3585('0x14'),{'options':{'where':{'id':_0x393cd4},'attributes':[_0x3585('0x13')]}});};exports[_0x3585('0x15')]=function(_0x365861){return request(_0x3585('0x16'),{'options':{'where':{'id':_0x365861},'attributes':['name']}});};exports[_0x3585('0x17')]=function(_0x1c2d66){return request(_0x3585('0x18'),{'options':{'where':{'id':_0x1c2d66},'attributes':[_0x3585('0x19')]}});};exports[_0x3585('0x1a')]=function(_0x5cb954){return request(_0x3585('0x1b'),{'options':{'where':{'id':_0x5cb954},'attributes':['name']}});};exports['getTrunkById']=function(_0x21b991){return request(_0x3585('0x1c'),{'options':{'where':{'id':_0x21b991},'attributes':[_0x3585('0x13')]}});};exports['getSoundById']=function(_0x3fd434){return request(_0x3585('0x1d'),{'options':{'where':{'id':_0x3fd434},'attributes':['save_name']}});};exports['getIntervalById']=function(_0x5aa96a){return request(_0x3585('0x1e'),{'options':{'raw':![],'where':{'id':_0x5aa96a},'include':[{'model':_0x3585('0x1f'),'as':_0x3585('0x20')}]}});};exports[_0x3585('0x21')]=function(_0x178876){return request(_0x3585('0x22'),{'options':{'where':{'id':_0x178876},'attributes':['id',_0x3585('0x13')]}});};exports[_0x3585('0x23')]=function(_0x44ef6b){return request(_0x3585('0x24'),{'body':_0x44ef6b});};exports[_0x3585('0x25')]=function(_0x2df5ec){return request(_0x3585('0x26'),{'body':_0x2df5ec});};exports[_0x3585('0x27')]=function(_0x253f66){return request('CreateSquareReport',{'body':_[_0x3585('0x28')](_0x253f66,{'project_name':_0x253f66[_0x3585('0x29')],'prev_project_name':_0x253f66[_0x3585('0x2a')]||'','is_subproject':_0x253f66[_0x3585('0x2a')]?!![]:![],'leaveAt':moment()[_0x3585('0x2b')](_0x3585('0x2c'))})});};exports[_0x3585('0x2d')]=function(_0x4ed1fb){return request('CreateSquareRecording',{'body':_0x4ed1fb});};exports['createSquareMessage']=function(_0x337fbd){return request(_0x3585('0x2e'),{'body':_0x337fbd});};exports[_0x3585('0x2f')]=function(_0x1e60c8){return request(_0x3585('0x30'),{'options':{'raw':![],'where':{'phone':_0x1e60c8[_0x3585('0x31')],'ListId':_0x1e60c8[_0x3585('0x32')]}}})[_0x3585('0x33')](function(_0x9fd7b){if(_0x9fd7b){return _0x9fd7b;}return request(_0x3585('0x34'),{'body':_0x1e60c8});});};exports[_0x3585('0x35')]=function(_0xf85472){return request('ShowPause',{'options':{'where':{'id':_0xf85472},'attributes':[_0x3585('0x13')]}});};exports[_0x3585('0x36')]=function(_0x4b1089,_0x5f4148){return request(_0x3585('0x37'),{'body':{'interface':_0x5f4148},'options':{'where':_0x4b1089}});};exports['agentPause']=function(_0x5e62fa,_0x28e5cd,_0x207b10){return request('PauseUser',{'body':{'type':_0x28e5cd,'uniqueid':_0x207b10},'options':{'where':_0x5e62fa}});};exports[_0x3585('0x38')]=function(_0x129dc5){return request(_0x3585('0x39'),{'body':{},'options':{'where':_0x129dc5}});};exports['agentLogout']=function(_0x4aea52){return request(_0x3585('0x3a'),{'body':{},'options':{'where':_0x4aea52}});}; \ 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 9695a4a..5c5eef3 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 _0x4819=['exports','./lex'];(function(_0x5768d6,_0x6812cc){var _0x2f24b3=function(_0x1427ce){while(--_0x1427ce){_0x5768d6['push'](_0x5768d6['shift']());}};_0x2f24b3(++_0x6812cc);}(_0x4819,0xcd));var _0x9481=function(_0x56ab74,_0x1effda){_0x56ab74=_0x56ab74-0x0;var _0x17d8d0=_0x4819[_0x56ab74];return _0x17d8d0;};var polly=require('./polly');var lex=require(_0x9481('0x0'));module[_0x9481('0x1')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x21cd=['exports','./polly','./lex'];(function(_0x3c9cab,_0x5f06de){var _0x2e7f50=function(_0x2c54cf){while(--_0x2c54cf){_0x3c9cab['push'](_0x3c9cab['shift']());}};_0x2e7f50(++_0x5f06de);}(_0x21cd,0x6a));var _0xd21c=function(_0x4e7d25,_0x58285f){_0x4e7d25=_0x4e7d25-0x0;var _0x526fe6=_0x21cd[_0x4e7d25];return _0x526fe6;};var polly=require(_0xd21c('0x0'));var lex=require(_0xd21c('0x1'));module[_0xd21c('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 198598e..20aaa45 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 _0x2547=['exports'];(function(_0x9cd6d7,_0x453050){var _0x48e5d2=function(_0x532699){while(--_0x532699){_0x9cd6d7['push'](_0x9cd6d7['shift']());}};_0x48e5d2(++_0x453050);}(_0x2547,0x1cd));var _0x7254=function(_0x4a233c,_0x5edc48){_0x4a233c=_0x4a233c-0x0;var _0x4940c6=_0x2547[_0x4a233c];return _0x4940c6;};'use strict';var lex=require('./lib/api');module[_0x7254('0x0')]=function(_0x23e38c,_0x44b692,_0x3ea6e6,_0xbbc747,_0x1a36de,_0x9f3435){return lex(_0x23e38c,_0x44b692,_0x3ea6e6,_0xbbc747,_0x1a36de,_0x9f3435);}; \ No newline at end of file +var _0xec56=['./lib/api'];(function(_0x5eb22e,_0x27cbac){var _0x27fed5=function(_0x565467){while(--_0x565467){_0x5eb22e['push'](_0x5eb22e['shift']());}};_0x27fed5(++_0x27cbac);}(_0xec56,0x1bd));var _0x6ec5=function(_0x15b8c3,_0x5974f7){_0x15b8c3=_0x15b8c3-0x0;var _0x2fb3e9=_0xec56[_0x15b8c3];return _0x2fb3e9;};'use strict';var lex=require(_0x6ec5('0x0'));module['exports']=function(_0x4d6dcd,_0x10a273,_0x3b8a3f,_0x26a5af,_0x240ccf,_0x43c2cd){return lex(_0x4d6dcd,_0x10a273,_0x3b8a3f,_0x26a5af,_0x240ccf,_0x43c2cd);}; \ 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 91e899c..0a89abd 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(_0x37fada,_0x539b8b){var _0x5329ec=function(_0x9c9950){while(--_0x9c9950){_0x37fada['push'](_0x37fada['shift']());}};_0x5329ec(++_0x539b8b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'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(_0x4a4d2f,_0x33fd37){var _0x36ffc0=function(_0x4bd6ba){while(--_0x4bd6ba){_0x4a4d2f['push'](_0x4a4d2f['shift']());}};_0x36ffc0(++_0x33fd37);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'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 68c4459..12669ee 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 _0x4a11=['./lib/api','exports'];(function(_0x5b7b24,_0x3c64f6){var _0x5511d1=function(_0x3d17a2){while(--_0x3d17a2){_0x5b7b24['push'](_0x5b7b24['shift']());}};_0x5511d1(++_0x3c64f6);}(_0x4a11,0x1ac));var _0x14a1=function(_0x3d0016,_0x4a37e0){_0x3d0016=_0x3d0016-0x0;var _0x1dcb28=_0x4a11[_0x3d0016];return _0x1dcb28;};'use strict';var polly=require(_0x14a1('0x0'));module[_0x14a1('0x1')]=function(_0x47ada3,_0x541613,_0xefb20b,_0x36ded0,_0x39b175,_0x45ecdd,_0x3d3c80){return polly(_0x47ada3,_0x541613,_0xefb20b,_0x36ded0,_0x39b175,_0x45ecdd,_0x3d3c80);}; \ No newline at end of file +var _0xf307=['exports','./lib/api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf307,0x11b));var _0x7f30=function(_0xfbceb4,_0x392f3b){_0xfbceb4=_0xfbceb4-0x0;var _0x563dbe=_0xf307[_0xfbceb4];return _0x563dbe;};'use strict';var polly=require(_0x7f30('0x0'));module[_0x7f30('0x1')]=function(_0x300d94,_0x53c459,_0x35f864,_0x36c42a,_0x4ffec2,_0x1ea4af,_0xee5f7b){return polly(_0x300d94,_0x53c459,_0x35f864,_0x36c42a,_0x4ffec2,_0x1ea4af,_0xee5f7b);}; \ 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 e5c7eba..83b5902 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 _0x8616=['randomstring','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','path'];(function(_0x20b89f,_0x5b487f){var _0x4e1a55=function(_0x10dd56){while(--_0x10dd56){_0x20b89f['push'](_0x20b89f['shift']());}};_0x4e1a55(++_0x5b487f);}(_0x8616,0x1c7));var _0x6861=function(_0x96f74c,_0xfc30a4){_0x96f74c=_0x96f74c-0x0;var _0x379222=_0x8616[_0x96f74c];return _0x379222;};'use strict';var fs=require('fs');var path=require(_0x6861('0x0'));var BPromise=require('bluebird');var rs=require(_0x6861('0x1'));var AWS=require('aws-sdk');function pollyResult(_0x883e9e,_0x24b3f3,_0x4622ff){return new BPromise(function(_0x32c184,_0x1e7176){_0x883e9e['synthesizeSpeech'](_0x24b3f3,function(_0x387848,_0x423c7a){if(_0x387848){_0x1e7176(_0x387848);}else if(_0x423c7a){if(_0x423c7a[_0x6861('0x2')]instanceof Buffer){fs['writeFile'](_0x4622ff,_0x423c7a[_0x6861('0x2')],function(_0x363e79){if(_0x363e79){_0x1e7176(_0x363e79);}else{_0x32c184();}});}else{_0x1e7176(new Error(_0x6861('0x3')));}}else{_0x1e7176(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module[_0x6861('0x4')]=function(_0x3991ef,_0x8d8092,_0x3ff6c5,_0xe43e23,_0x9efe0b,_0x48b1b8,_0x18bec8){var _0x40824e=new AWS[(_0x6861('0x5'))]({'accessKeyId':_0x3991ef,'secretAccessKey':_0x8d8092,'region':_0x3ff6c5});var _0xffd11a={'Text':_0x9efe0b,'TextType':_0x48b1b8||_0x6861('0x6'),'OutputFormat':_0x6861('0x7'),'VoiceId':_0xe43e23};return pollyResult(_0x40824e,_0xffd11a,_0x18bec8);}; \ No newline at end of file +var _0x8dd9=['randomstring','synthesizeSpeech','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text'];(function(_0x214266,_0x1f6f52){var _0x568f75=function(_0x541904){while(--_0x541904){_0x214266['push'](_0x214266['shift']());}};_0x568f75(++_0x1f6f52);}(_0x8dd9,0x1b9));var _0x98dd=function(_0x163000,_0x4ee91){_0x163000=_0x163000-0x0;var _0xacd5af=_0x8dd9[_0x163000];return _0xacd5af;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require('bluebird');var rs=require(_0x98dd('0x0'));var AWS=require('aws-sdk');function pollyResult(_0xdf9460,_0x4dc56d,_0x4b6592){return new BPromise(function(_0xcd80eb,_0x4c90f7){_0xdf9460[_0x98dd('0x1')](_0x4dc56d,function(_0x30e428,_0x5a73cb){if(_0x30e428){_0x4c90f7(_0x30e428);}else if(_0x5a73cb){if(_0x5a73cb[_0x98dd('0x2')]instanceof Buffer){fs[_0x98dd('0x3')](_0x4b6592,_0x5a73cb[_0x98dd('0x2')],function(_0xc2d958){if(_0xc2d958){_0x4c90f7(_0xc2d958);}else{_0xcd80eb();}});}else{_0x4c90f7(new Error(_0x98dd('0x4')));}}else{_0x4c90f7(new Error(_0x98dd('0x5')));}});});}module[_0x98dd('0x6')]=function(_0x443758,_0x333f58,_0x1823cd,_0x44f441,_0x31c3bb,_0x22673a,_0x3fa544){var _0x1e4e76=new AWS[(_0x98dd('0x7'))]({'accessKeyId':_0x443758,'secretAccessKey':_0x333f58,'region':_0x1823cd});var _0x5d75ba={'Text':_0x31c3bb,'TextType':_0x22673a||_0x98dd('0x8'),'OutputFormat':'mp3','VoiceId':_0x44f441};return pollyResult(_0x1e4e76,_0x5d75ba,_0x3fa544);}; \ 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 85ebdc7..570e9e3 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 _0xb487=['./lib/api'];(function(_0x183d0e,_0x1f520f){var _0x278ff8=function(_0x49b6d1){while(--_0x49b6d1){_0x183d0e['push'](_0x183d0e['shift']());}};_0x278ff8(++_0x1f520f);}(_0xb487,0x159));var _0x7b48=function(_0x7d962d,_0x557a6f){_0x7d962d=_0x7d962d-0x0;var _0x22ddbc=_0xb487[_0x7d962d];return _0x22ddbc;};'use strict';var asr=require(_0x7b48('0x0'));module['exports']=function(_0x1e46ae,_0x53737e,_0x11fdeb,_0x332ce1){return asr(_0x1e46ae,_0x53737e,_0x11fdeb);}; \ No newline at end of file +var _0x019e=['./lib/api','exports'];(function(_0x20732c,_0xae22d){var _0x3fd9c1=function(_0x28ae21){while(--_0x28ae21){_0x20732c['push'](_0x20732c['shift']());}};_0x3fd9c1(++_0xae22d);}(_0x019e,0x13a));var _0xe019=function(_0x40aa28,_0x471669){_0x40aa28=_0x40aa28-0x0;var _0x415534=_0x019e[_0x40aa28];return _0x415534;};'use strict';var asr=require(_0xe019('0x0'));module[_0xe019('0x1')]=function(_0x4696bf,_0x3046da,_0x372bfd,_0x1da7d5){return asr(_0x4696bf,_0x3046da,_0x372bfd);}; \ 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 049c4f0..19e6144 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 _0x7119=['base64','POST','LINEAR16','8000','bluebird','exports','string','length','filepath\x20should\x20be\x20a\x20string','undefined','readFileSync'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x7119,0x1c7));var _0x9711=function(_0x5e6515,_0x2954b1){_0x5e6515=_0x5e6515-0x0;var _0xd33ce2=_0x7119[_0x5e6515];return _0xd33ce2;};'use strict';var url=require('url');var BPromise=require(_0x9711('0x0'));var fs=require('fs');var host='https://speech.googleapis.com';module[_0x9711('0x1')]=function(_0x5843e8,_0x347925,_0x443d8f){return new BPromise(function(_0x36cd4d,_0x2de7dd){var _0x47dda0;if(typeof _0x5843e8!==_0x9711('0x2')||_0x5843e8[_0x9711('0x3')]===0x0){return _0x2de7dd(_0x9711('0x4'));}if(typeof _0x347925!==_0x9711('0x2')||_0x347925[_0x9711('0x3')]===0x0){return _0x2de7dd('key\x20should\x20be\x20a\x20string');}if(typeof _0x443d8f!==_0x9711('0x5')&&(typeof _0x443d8f!==_0x9711('0x2')||_0x443d8f[_0x9711('0x3')]===0x0)){return _0x2de7dd('lang\x20should\x20be\x20a\x20string');}try{_0x47dda0=fs[_0x9711('0x6')](_0x5843e8)['toString'](_0x9711('0x7'));}catch(_0x16e820){return _0x2de7dd(_0x16e820);}return _0x36cd4d({'method':_0x9711('0x8'),'uri':host+'/v1/speech:recognize?key='+_0x347925,'body':{'config':{'encoding':_0x9711('0x9'),'sampleRateHertz':_0x9711('0xa'),'languageCode':_0x443d8f},'audio':{'content':_0x47dda0}},'json':!![]});});}; \ No newline at end of file +var _0x48ea=['url','https://speech.googleapis.com','exports','string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','/v1/speech:recognize?key='];(function(_0x15318c,_0x2e50e4){var _0x10d3ce=function(_0x2fecdd){while(--_0x2fecdd){_0x15318c['push'](_0x15318c['shift']());}};_0x10d3ce(++_0x2e50e4);}(_0x48ea,0x9c));var _0xa48e=function(_0x479ddb,_0x4b2927){_0x479ddb=_0x479ddb-0x0;var _0xd9f0fa=_0x48ea[_0x479ddb];return _0xd9f0fa;};'use strict';var url=require(_0xa48e('0x0'));var BPromise=require('bluebird');var fs=require('fs');var host=_0xa48e('0x1');module[_0xa48e('0x2')]=function(_0x108dac,_0x492009,_0x480d3c){return new BPromise(function(_0x86a544,_0x5c7354){var _0x1da836;if(typeof _0x108dac!==_0xa48e('0x3')||_0x108dac[_0xa48e('0x4')]===0x0){return _0x5c7354(_0xa48e('0x5'));}if(typeof _0x492009!==_0xa48e('0x3')||_0x492009[_0xa48e('0x4')]===0x0){return _0x5c7354(_0xa48e('0x6'));}if(typeof _0x480d3c!==_0xa48e('0x7')&&(typeof _0x480d3c!==_0xa48e('0x3')||_0x480d3c[_0xa48e('0x4')]===0x0)){return _0x5c7354(_0xa48e('0x8'));}try{_0x1da836=fs[_0xa48e('0x9')](_0x108dac)[_0xa48e('0xa')](_0xa48e('0xb'));}catch(_0xf9436a){return _0x5c7354(_0xf9436a);}return _0x86a544({'method':'POST','uri':host+_0xa48e('0xc')+_0x492009,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':'8000','languageCode':_0x480d3c},'audio':{'content':_0x1da836}},'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 3f286c7..63b2c7a 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 _0x6277=['./asr','exports'];(function(_0x27b51a,_0x1ecfd7){var _0x1205e6=function(_0x5c8f8a){while(--_0x5c8f8a){_0x27b51a['push'](_0x27b51a['shift']());}};_0x1205e6(++_0x1ecfd7);}(_0x6277,0x8a));var _0x7627=function(_0xf94257,_0x28a889){_0xf94257=_0xf94257-0x0;var _0x3af135=_0x6277[_0xf94257];return _0x3af135;};var asr=require(_0x7627('0x0'));module[_0x7627('0x1')]={'asr':asr}; \ No newline at end of file +var _0x03e0=['exports','./asr'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x03e0,0x1bf));var _0x003e=function(_0x1f2033,_0x4484b8){_0x1f2033=_0x1f2033-0x0;var _0x44f104=_0x03e0[_0x1f2033];return _0x44f104;};var asr=require(_0x003e('0x0'));module[_0x003e('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/scripts/index.js b/server/services/agi/scripts/index.js index 97743c5..67bc161 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 _0x2469=['tmp','.mp3','from','audioContent','writeFile','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','POST','application/x-www-form-urlencoded','jQ1olc','stringify','null','generic','slice','parse\x20response\x20failed:\x0a','text\x20length\x20limit\x20reached','\x22\x20might\x20not\x20exist','goggleTTS\x20path','googleASR','results','map','alternatives','transcript','join','confidence','googleASR\x20confidence','catch','name','message','googleDialogflow','textRequest','source','resolvedQuery','result','action','actionIncomplete','speech','status','code','metadata','endConversation','googleDialogflowV2','replace','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','boolValue','intent','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','asr','Tilde\x20ASR\x20transcription','awsPolly','polly','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','sestekNDA','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','dirName','apiai-promise','bluebird','dialogflow','http','https','md5','path','querystring','request-promise','randomstring','sox','google-tts-api','parse','util','./aws','./google','./sestek','./tilde','../../../config/logger','https://api.ispeech.org/api/rest','https:','host','WHAT_EVER','get','statusCode','error','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','close','unlink','download\x20error','end','request\x20to\x20','data','transcode','start','resolve','generate','.wav','writeFileSync','base64','chmodSync','777','split','googleCloudTTS','https://texttospeech.googleapis.com/v1/','input','voice','audioConfig','MP3','text:synthesize','then'];(function(_0x7773ea,_0xfe0220){var _0x2920e4=function(_0x10d228){while(--_0x10d228){_0x7773ea['push'](_0x7773ea['shift']());}};_0x2920e4(++_0xfe0220);}(_0x2469,0xd6));var _0x9246=function(_0x3ae782,_0xbc6964){_0x3ae782=_0x3ae782-0x0;var _0x57865c=_0x2469[_0x3ae782];return _0x57865c;};'use strict';var apiai=require(_0x9246('0x0'));var BPromise=require(_0x9246('0x1'));var dialogflow=require(_0x9246('0x2'));var fs=require('fs');var http=require(_0x9246('0x3'));var https=require(_0x9246('0x4'));var md5=require(_0x9246('0x5'));var path=require(_0x9246('0x6'));var querystring=require(_0x9246('0x7'));var rp=require(_0x9246('0x8'));var rs=require(_0x9246('0x9'));var sox=require(_0x9246('0xa'));var tts=require(_0x9246('0xb'));var urlParse=require('url')[_0x9246('0xc')];var util=require(_0x9246('0xd'));var aws=require(_0x9246('0xe'));var google=require(_0x9246('0xf'));var sestek=require(_0x9246('0x10'));var tilde=require(_0x9246('0x11'));var logger=require(_0x9246('0x12'))('agi');var ISPEECH_API=_0x9246('0x13');function downloadFile(_0x118923,_0x3d9e52){return new BPromise(function(_0x30aadf,_0x2b9b34){var _0x36de19=urlParse(_0x118923);var _0x33ae4d=_0x36de19['protocol']===_0x9246('0x14')?https:http;var _0x23593b={'host':_0x36de19[_0x9246('0x15')],'path':_0x36de19['path'],'headers':{'user-agent':_0x9246('0x16')}};_0x33ae4d[_0x9246('0x17')](_0x23593b,function(_0x751a54){if(_0x751a54[_0x9246('0x18')]!==0xc8){logger[_0x9246('0x19')]('request\x20to\x20'+_0x118923+_0x9246('0x1a')+_0x751a54['statusCode']+'\x20('+_0x751a54['statusMessage']+')');_0x2b9b34(new Error('request\x20to\x20'+_0x118923+_0x9246('0x1a')+_0x751a54['statusCode']+'\x20('+_0x751a54[_0x9246('0x1b')]+')'));return;}var _0x5b9fd2=fs[_0x9246('0x1c')](_0x3d9e52);_0x5b9fd2['on'](_0x9246('0x1d'),function(){logger[_0x9246('0x1e')](_0x9246('0x1f'));_0x5b9fd2[_0x9246('0x20')](_0x30aadf);});_0x5b9fd2['on']('error',function(_0x31057b){fs[_0x9246('0x21')](_0x3d9e52);logger['error'](_0x9246('0x22'),_0x31057b);_0x2b9b34(_0x31057b);});_0x751a54['pipe'](_0x5b9fd2);})['on'](_0x9246('0x19'),function(_0x26d15d){logger['error'](_0x26d15d);_0x2b9b34(_0x26d15d);})[_0x9246('0x23')]();});}function uploadFile(_0x46a3e0){return new BPromise(function(_0x2b5f47,_0x4d0037){var _0x14b639=urlParse(_0x46a3e0);var _0x3b5a1d=_0x14b639['protocol']===_0x9246('0x14')?https:http;var _0x55a33a={'host':_0x14b639['host'],'path':_0x14b639[_0x9246('0x6')],'headers':{'user-agent':_0x9246('0x16')}};_0x3b5a1d['get'](_0x55a33a,function(_0x415c43){if(_0x415c43[_0x9246('0x18')]!==0xc8){_0x4d0037(new Error(_0x9246('0x24')+_0x46a3e0+_0x9246('0x1a')+_0x415c43[_0x9246('0x18')]+'\x20('+_0x415c43[_0x9246('0x1b')]+')'));return;}var _0x1854bb='';_0x415c43['on'](_0x9246('0x25'),function(_0x422353){_0x1854bb+=_0x422353;});_0x415c43['on'](_0x9246('0x23'),function(){_0x2b5f47(_0x1854bb);});})['on'](_0x9246('0x19'),function(_0x3b54ee){_0x4d0037(_0x3b54ee);})[_0x9246('0x23')]();});}function convertFile(_0x276c10,_0x1b10b3){return new BPromise(function(_0x1b4a5e,_0x428224){var _0x5869c8=sox[_0x9246('0x26')](_0x276c10,_0x1b10b3,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x5869c8['on'](_0x9246('0x19'),function(_0xac3a91){logger[_0x9246('0x19')]('error\x20convert',_0xac3a91);_0x428224(_0xac3a91);});_0x5869c8['on'](_0x9246('0x23'),function(){logger[_0x9246('0x1e')]('finish\x20to\x20convert');_0x1b4a5e();});_0x5869c8[_0x9246('0x27')]();});}function base64Decode(_0x2cb471,_0x1ff5fd){var _0x3cf3ed=path[_0x9246('0x28')](__dirname,'tmp',rs[_0x9246('0x29')](0x4)+_0x9246('0x2a'));fs[_0x9246('0x2b')](_0x3cf3ed,_0x2cb471,_0x9246('0x2c'));return convertFile(_0x3cf3ed,_0x1ff5fd)['then'](function(){try{fs[_0x9246('0x21')](_0x3cf3ed);fs[_0x9246('0x2d')](_0x1ff5fd,_0x9246('0x2e'));}catch(_0x5f79fc){logger[_0x9246('0x19')](_0x5f79fc);}return _0x1ff5fd[_0x9246('0x2f')]('.')[0x0];});}function base64Encode(_0x498c8e){var _0x459b9c=fs['readFileSync'](_0x498c8e);return new Buffer(_0x459b9c)['toString'](_0x9246('0x2c'));}exports[_0x9246('0x30')]=function(_0x5a2ab9,_0x448df8,_0x4013f4,_0x592d1f,_0x28d0a0,_0x3422d6){var _0x490fa9,_0x653d6a;var _0xf439bd=_0x9246('0x31');var _0x413f80='?key='+_0x5a2ab9;var _0x156851={};if(_0x448df8==='ssml'){_0x156851[_0x9246('0x32')]={'ssml':_0x4013f4};}else{_0x156851[_0x9246('0x32')]={'text':_0x4013f4};};_0x156851[_0x9246('0x33')]={'languageCode':_0x592d1f,'ssmlGender':_0x28d0a0};_0x156851[_0x9246('0x34')]={'audioEncoding':_0x9246('0x35'),'sampleRateHertz':0x1f40};var _0x28aaf6={'url':_0xf439bd+_0x9246('0x36')+_0x413f80,'method':'POST','json':!![],'body':_0x156851};return rp(_0x28aaf6)[_0x9246('0x37')](function(_0xd5b8a1){return new BPromise(function(_0x354307,_0x177f81){_0x490fa9=path['resolve'](__dirname,_0x9246('0x38'),rs[_0x9246('0x29')](0x4)+_0x9246('0x39'));var _0x356ba7=Buffer[_0x9246('0x3a')](_0xd5b8a1[_0x9246('0x3b')],_0x9246('0x2c'));return fs[_0x9246('0x3c')](_0x490fa9,_0x356ba7,function(_0x2b6224){_0x177f81(_0x2b6224);},function(_0x558521){fs[_0x9246('0x2d')](_0x490fa9,'777');_0x354307(_0x558521);});});})[_0x9246('0x37')](function(_0x71eeca){_0x653d6a=path[_0x9246('0x28')](__dirname,_0x9246('0x38'),rs[_0x9246('0x29')](0x4)+_0x9246('0x2a'));return convertFile(_0x490fa9,_0x653d6a);})[_0x9246('0x37')](function(){try{fs['unlink'](_0x490fa9);fs[_0x9246('0x2d')](_0x653d6a,_0x9246('0x2e'));}catch(_0x4cc8ce){logger[_0x9246('0x19')](_0x4cc8ce);}logger[_0x9246('0x1e')](_0x9246('0x3d'),_0x653d6a[_0x9246('0x2f')]('.')[0x0]);return _0x653d6a[_0x9246('0x2f')]('.')[0x0];});};exports[_0x9246('0x3e')]=function(_0x1c5880,_0x4e96d5){var _0x3428b4=_0x9246('0x3f');var _0x1bcb16,_0x1d51eb;var _0x5ddedf;var _0xae4798={'encoding':_0x9246('0x40'),'method':_0x9246('0x41'),'timeout':0x2710,'url':_0x3428b4,'headers':{'Content-Type':_0x9246('0x42')},'body':'f.req='+encodeURIComponent(JSON['stringify']([[[_0x9246('0x43'),JSON[_0x9246('0x44')]([_0x1c5880,_0x4e96d5||'en',![],_0x9246('0x45')]),null,_0x9246('0x46')]]]))};return rp(_0xae4798)[_0x9246('0x37')](function(_0x365ae9){try{_0x5ddedf=eval(_0x365ae9[_0x9246('0x47')](0x5))[0x0][0x2];}catch(_0x12e9ed){throw new Error(_0x9246('0x48')+_0x365ae9[_0x9246('0x25')]);}if(!_0x5ddedf){if(_0x1c5880['length']>0xc8){throw new Error(_0x9246('0x49'));}else{throw new Error('lang\x20\x22'+_0x4e96d5+_0x9246('0x4a'));}}try{_0x5ddedf=eval(_0x5ddedf)[0x0];}catch(_0x48fbf0){throw new Error('parse\x20response\x20failed:\x0a'+res[_0x9246('0x25')]);}const _0x41215b=_0x5ddedf;_0x1bcb16=path[_0x9246('0x28')](__dirname,_0x9246('0x38'),rs[_0x9246('0x29')](0x4)+_0x9246('0x39'));fs[_0x9246('0x2b')](_0x1bcb16,_0x5ddedf,{'encoding':'base64'});_0x1d51eb=path[_0x9246('0x28')](__dirname,_0x9246('0x38'),rs['generate'](0x4)+_0x9246('0x2a'));return convertFile(_0x1bcb16,_0x1d51eb);})[_0x9246('0x37')](function(){try{fs[_0x9246('0x21')](_0x1bcb16);fs[_0x9246('0x2d')](_0x1d51eb,_0x9246('0x2e'));}catch(_0x1c3afb){logger['error'](_0x1c3afb);}logger['info'](_0x9246('0x4b'),_0x1d51eb[_0x9246('0x2f')]('.')[0x0]);return _0x1d51eb[_0x9246('0x2f')]('.')[0x0];});};exports[_0x9246('0x4c')]=function(_0x3162d0,_0x2ea91f,_0x11ff49){return google['asr'](_0x3162d0,_0x2ea91f,_0x11ff49)[_0x9246('0x37')](function(_0x37a742){logger['info'](_0x37a742['uri']);return rp(_0x37a742);})[_0x9246('0x37')](function(_0x33e07d){var _0x1b6373='';var _0x2562da=0x0;try{fs[_0x9246('0x21')](_0x3162d0);}catch(_0x199f6e){logger['error'](_0x199f6e);}if(_0x33e07d&&_0x33e07d[_0x9246('0x4d')]){_0x1b6373=_0x33e07d[_0x9246('0x4d')][_0x9246('0x4e')](function(_0x27ddbf){return _0x27ddbf&&_0x27ddbf[_0x9246('0x4f')][0x0]&&_0x27ddbf[_0x9246('0x4f')][0x0][_0x9246('0x50')]?_0x27ddbf[_0x9246('0x4f')][0x0]['transcript']:'';})[_0x9246('0x51')]('\x0a');_0x2562da=_0x33e07d['results'][_0x9246('0x4e')](function(_0x18e3ba){return _0x18e3ba&&_0x18e3ba[_0x9246('0x4f')][0x0]&&_0x18e3ba['alternatives'][0x0][_0x9246('0x52')]?_0x18e3ba[_0x9246('0x4f')][0x0][_0x9246('0x52')]:0x0;})[_0x9246('0x51')]('\x0a');}logger[_0x9246('0x1e')]('googleASR\x20transcription',_0x1b6373);logger['info'](_0x9246('0x53'),_0x2562da);return{'transcript':_0x1b6373,'confidence':_0x2562da};})[_0x9246('0x54')](function(_0x201212){logger[_0x9246('0x19')]('[%s]\x20%s:%s',_0x201212[_0x9246('0x18')],_0x201212[_0x9246('0x55')],_0x201212[_0x9246('0x56')]);});};exports[_0x9246('0x57')]=function(_0x226965,_0x62952b,_0x19a3ae,_0x3e0d32){var _0x6eec58=apiai(_0x62952b,{'language':_0x3e0d32||'en'});return _0x6eec58[_0x9246('0x58')](_0x19a3ae,{'sessionId':md5(_0x226965)})['then'](function(_0x1fb215){logger['info'](JSON[_0x9246('0x44')](_0x1fb215));return{'source':_0x1fb215['result'][_0x9246('0x59')],'resolvedQuery':_0x1fb215['result'][_0x9246('0x5a')],'action':_0x1fb215[_0x9246('0x5b')][_0x9246('0x5c')],'actionIncomplete':_0x1fb215['result'][_0x9246('0x5d')],'speech':_0x1fb215[_0x9246('0x5b')]['fulfillment'][_0x9246('0x5e')],'score':_0x1fb215[_0x9246('0x5b')]['score'],'statusCode':_0x1fb215[_0x9246('0x5f')][_0x9246('0x60')],'endConversation':_0x1fb215['result'][_0x9246('0x61')][_0x9246('0x62')]||![],'isFallbackIntent':_0x1fb215[_0x9246('0x5b')][_0x9246('0x61')]['isFallbackIntent']};});};exports[_0x9246('0x63')]=function(_0x3dea28,_0x4c7cbd,_0x2d6a25,_0x971f54,_0x34e981,_0x4dbe01){var _0x23b8af=_0x971f54[_0x9246('0x64')](/\\n/g,'\x0a');var _0x5360a9={'credentials':{'private_key':_0x23b8af,'client_email':_0x2d6a25}};var _0x1baab3=new dialogflow[(_0x9246('0x65'))](_0x5360a9);var _0x5d61b7=_0x1baab3[_0x9246('0x66')](_0x4c7cbd,md5(_0x3dea28));var _0x450ba5={'session':_0x5d61b7,'queryInput':{'text':{'text':_0x34e981,'languageCode':_0x4dbe01}}};return _0x1baab3[_0x9246('0x67')](_0x450ba5)[_0x9246('0x37')](function(_0x4247d8){if(_0x4247d8&&_0x4247d8['length']){logger[_0x9246('0x1e')](_0x9246('0x68'),JSON['stringify'](_0x4247d8));var _0x5194b5=_0x4247d8[0x0];if(_0x5194b5){var _0x38aa4c={'action':_0x5194b5[_0x9246('0x69')]['action'],'allRequiredParamsPresent':_0x5194b5[_0x9246('0x69')][_0x9246('0x6a')],'endConversation':_0x5194b5['queryResult'][_0x9246('0x6b')]&&_0x5194b5[_0x9246('0x69')][_0x9246('0x6b')][_0x9246('0x6c')]?_0x5194b5[_0x9246('0x69')][_0x9246('0x6b')][_0x9246('0x6c')]['end_conversation'][_0x9246('0x6d')]:![],'fulfillmentText':_0x5194b5['queryResult']['fulfillmentText'],'intentName':_0x5194b5['queryResult'][_0x9246('0x6e')][_0x9246('0x55')],'intentDisplayName':_0x5194b5['queryResult']['intent']['displayName'],'isFallbackIntent':_0x5194b5[_0x9246('0x69')][_0x9246('0x6e')][_0x9246('0x6f')],'languageCode':_0x5194b5[_0x9246('0x69')][_0x9246('0x70')],'queryText':_0x5194b5[_0x9246('0x69')][_0x9246('0x71')],'responseId':_0x5194b5[_0x9246('0x72')],'score':_0x5194b5['queryResult'][_0x9246('0x73')],'speech':_0x5194b5[_0x9246('0x69')]['fulfillmentText'],'providerResponse':JSON['stringify'](_0x4247d8)};return _0x38aa4c;}}});};exports['tildeASR']=function(_0x10b8f8,_0x22ac2a,_0x487daf,_0x21a187){return tilde[_0x9246('0x74')](_0x10b8f8,_0x22ac2a,_0x487daf,_0x21a187)[_0x9246('0x37')](function(_0x11e10f){try{fs['unlink'](_0x10b8f8);}catch(_0x9f253b){logger[_0x9246('0x19')](_0x9f253b);}logger['info'](_0x9246('0x75'),_0x11e10f[_0x9246('0x50')]);logger['info']('Tilde\x20ASR\x20confidence',_0x11e10f[_0x9246('0x52')]);return _0x11e10f;});};exports[_0x9246('0x76')]=function(_0x47ffba,_0xc449,_0x1ca8a3,_0x5ffc1a,_0x11c110,_0x39edf5){var _0x4b8b6f=path[_0x9246('0x28')](__dirname,_0x9246('0x38'),rs[_0x9246('0x29')](0x4)+_0x9246('0x39'));var _0x3fbc14;return aws[_0x9246('0x77')](_0x47ffba,_0xc449,_0x1ca8a3,_0x5ffc1a,_0x11c110,_0x39edf5,_0x4b8b6f)['then'](function(){_0x3fbc14=path[_0x9246('0x28')](__dirname,_0x9246('0x38'),rs[_0x9246('0x29')](0x4)+_0x9246('0x2a'));return convertFile(_0x4b8b6f,_0x3fbc14);})[_0x9246('0x37')](function(){try{fs[_0x9246('0x21')](_0x4b8b6f);fs['chmodSync'](_0x3fbc14,'777');}catch(_0x187fca){logger[_0x9246('0x19')](_0x187fca);}return _0x3fbc14[_0x9246('0x2f')]('.')[0x0];});};exports[_0x9246('0x78')]=function(_0x15bb02,_0x3ea67a,_0xd602aa,_0xe0c9bc,_0x560ddf,_0x1b2283){return aws[_0x9246('0x79')](_0x15bb02,_0x3ea67a,_0xd602aa,_0xe0c9bc,_0x560ddf,_0x1b2283)[_0x9246('0x37')](function(_0x1e7f59){logger[_0x9246('0x1e')](JSON[_0x9246('0x44')](_0x1e7f59));return _0x1e7f59;});};exports[_0x9246('0x7a')]=function(_0x3d06b5,_0x32f9f7,_0x3037be,_0x524472){var _0x334387=util[_0x9246('0x7b')](_0x9246('0x7c'),ISPEECH_API,_0x3d06b5,encodeURIComponent(_0x32f9f7),_0x3037be,_0x524472);var _0x58712c=path['resolve'](__dirname,_0x9246('0x38'),rs[_0x9246('0x29')](0x4)+_0x9246('0x39'));var _0x268a65;return downloadFile(_0x334387,_0x58712c)['then'](function(){_0x268a65=path[_0x9246('0x28')](__dirname,_0x9246('0x38'),rs[_0x9246('0x29')](0x4)+_0x9246('0x2a'));return convertFile(_0x58712c,_0x268a65);})[_0x9246('0x37')](function(){try{fs[_0x9246('0x21')](_0x58712c);fs[_0x9246('0x2d')](_0x268a65,_0x9246('0x2e'));}catch(_0x19d97d){logger['error'](_0x19d97d);}return _0x268a65[_0x9246('0x2f')]('.')[0x0];});};exports['ispeechASR']=function(_0x1b3ac2,_0x156f85,_0x3983a1,_0x24e649){var _0x57b3f3=util[_0x9246('0x7b')](_0x9246('0x7d'),ISPEECH_API,_0x156f85,_0x3983a1,base64Encode(_0x1b3ac2),_0x24e649?util['format']('model=%s',encodeURIComponent(_0x24e649)):'freeform=3');return uploadFile(_0x57b3f3)[_0x9246('0x37')](function(_0x566278){return querystring[_0x9246('0xc')](_0x566278);});};exports[_0x9246('0x7e')]=function(_0x26e63d,_0x3f8e50){return sestek[_0x9246('0x7f')](_0x26e63d,_0x3f8e50)[_0x9246('0x37')](function(_0x1b00bd){logger[_0x9246('0x1e')](JSON['stringify'](_0x1b00bd));var _0x1bdc61={'speech':_0x1b00bd[_0x9246('0x80')],'action':_0x1b00bd[_0x9246('0x81')]?_0x1b00bd['channelData'][_0x9246('0x82')]:undefined,'actiondata':_0x1b00bd[_0x9246('0x81')]?_0x1b00bd[_0x9246('0x81')][_0x9246('0x83')]:undefined};if(_0x1b00bd[_0x9246('0x81')]&&_0x1b00bd['channelData'][_0x9246('0x84')]){return base64Decode(_0x1b00bd[_0x9246('0x81')][_0x9246('0x84')][_0x9246('0x85')],path[_0x9246('0x28')](__dirname,_0x9246('0x38'),rs[_0x9246('0x29')](0x4)+'.wav'))[_0x9246('0x37')](function(_0x1e88e7){_0x1bdc61['audiofile']=_0x1e88e7;return _0x1bdc61;});}return _0x1bdc61;});};exports[_0x9246('0x86')]=function(){return __dirname;}; \ No newline at end of file +var _0x9e8f=['request-promise','randomstring','sox','google-tts-api','url','parse','util','./aws','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','https:','host','path','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','finish','finish\x20download\x20file','close','unlink','download\x20error','protocol','WHAT_EVER','data','end','transcode','wav','error\x20convert','finish\x20to\x20convert','resolve','tmp','generate','.wav','writeFileSync','base64','777','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','MP3','text:synthesize','POST','then','.mp3','from','audioContent','writeFile','chmodSync','info','googleCloudTTS\x20path','split','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','f.req=','stringify','null','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','goggleTTS\x20path','googleASR','asr','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','catch','name','googleDialogflow','textRequest','result','source','resolvedQuery','action','actionIncomplete','score','status','code','metadata','endConversation','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','sessionPath','detectIntent','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','fulfillmentText','intent','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','sestekNDA','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','apiai-promise','http','md5','querystring'];(function(_0x5dcdc7,_0x3c8e6b){var _0x13ab40=function(_0x2236a6){while(--_0x2236a6){_0x5dcdc7['push'](_0x5dcdc7['shift']());}};_0x13ab40(++_0x3c8e6b);}(_0x9e8f,0x1a0));var _0xf9e8=function(_0x420b45,_0x1bc16e){_0x420b45=_0x420b45-0x0;var _0x287e37=_0x9e8f[_0x420b45];return _0x287e37;};'use strict';var apiai=require(_0xf9e8('0x0'));var BPromise=require('bluebird');var dialogflow=require('dialogflow');var fs=require('fs');var http=require(_0xf9e8('0x1'));var https=require('https');var md5=require(_0xf9e8('0x2'));var path=require('path');var querystring=require(_0xf9e8('0x3'));var rp=require(_0xf9e8('0x4'));var rs=require(_0xf9e8('0x5'));var sox=require(_0xf9e8('0x6'));var tts=require(_0xf9e8('0x7'));var urlParse=require(_0xf9e8('0x8'))[_0xf9e8('0x9')];var util=require(_0xf9e8('0xa'));var aws=require(_0xf9e8('0xb'));var google=require('./google');var sestek=require('./sestek');var tilde=require(_0xf9e8('0xc'));var logger=require(_0xf9e8('0xd'))(_0xf9e8('0xe'));var ISPEECH_API=_0xf9e8('0xf');function downloadFile(_0x533ca6,_0x4ec9c8){return new BPromise(function(_0x744818,_0x4c4325){var _0x523fcb=urlParse(_0x533ca6);var _0x3098c7=_0x523fcb['protocol']===_0xf9e8('0x10')?https:http;var _0x54e3c5={'host':_0x523fcb[_0xf9e8('0x11')],'path':_0x523fcb[_0xf9e8('0x12')],'headers':{'user-agent':'WHAT_EVER'}};_0x3098c7[_0xf9e8('0x13')](_0x54e3c5,function(_0x40ebf2){if(_0x40ebf2[_0xf9e8('0x14')]!==0xc8){logger[_0xf9e8('0x15')](_0xf9e8('0x16')+_0x533ca6+_0xf9e8('0x17')+_0x40ebf2['statusCode']+'\x20('+_0x40ebf2[_0xf9e8('0x18')]+')');_0x4c4325(new Error(_0xf9e8('0x16')+_0x533ca6+_0xf9e8('0x17')+_0x40ebf2[_0xf9e8('0x14')]+'\x20('+_0x40ebf2['statusMessage']+')'));return;}var _0x207770=fs['createWriteStream'](_0x4ec9c8);_0x207770['on'](_0xf9e8('0x19'),function(){logger['info'](_0xf9e8('0x1a'));_0x207770[_0xf9e8('0x1b')](_0x744818);});_0x207770['on']('error',function(_0x1ac8d3){fs[_0xf9e8('0x1c')](_0x4ec9c8);logger[_0xf9e8('0x15')](_0xf9e8('0x1d'),_0x1ac8d3);_0x4c4325(_0x1ac8d3);});_0x40ebf2['pipe'](_0x207770);})['on']('error',function(_0x42461e){logger[_0xf9e8('0x15')](_0x42461e);_0x4c4325(_0x42461e);})['end']();});}function uploadFile(_0x493c52){return new BPromise(function(_0x2738ba,_0x4f61c8){var _0x4e3f2a=urlParse(_0x493c52);var _0x3b9129=_0x4e3f2a[_0xf9e8('0x1e')]==='https:'?https:http;var _0x2da7a1={'host':_0x4e3f2a[_0xf9e8('0x11')],'path':_0x4e3f2a['path'],'headers':{'user-agent':_0xf9e8('0x1f')}};_0x3b9129['get'](_0x2da7a1,function(_0x4c35a1){if(_0x4c35a1['statusCode']!==0xc8){_0x4f61c8(new Error(_0xf9e8('0x16')+_0x493c52+_0xf9e8('0x17')+_0x4c35a1[_0xf9e8('0x14')]+'\x20('+_0x4c35a1[_0xf9e8('0x18')]+')'));return;}var _0x49fc64='';_0x4c35a1['on'](_0xf9e8('0x20'),function(_0x195973){_0x49fc64+=_0x195973;});_0x4c35a1['on'](_0xf9e8('0x21'),function(){_0x2738ba(_0x49fc64);});})['on'](_0xf9e8('0x15'),function(_0x3842bf){_0x4f61c8(_0x3842bf);})[_0xf9e8('0x21')]();});}function convertFile(_0x10ab23,_0x1f05e2){return new BPromise(function(_0x3c9513,_0x464730){var _0x20adfa=sox[_0xf9e8('0x22')](_0x10ab23,_0x1f05e2,{'sampleRate':0x1f40,'format':_0xf9e8('0x23'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x20adfa['on'](_0xf9e8('0x15'),function(_0x409c17){logger[_0xf9e8('0x15')](_0xf9e8('0x24'),_0x409c17);_0x464730(_0x409c17);});_0x20adfa['on'](_0xf9e8('0x21'),function(){logger['info'](_0xf9e8('0x25'));_0x3c9513();});_0x20adfa['start']();});}function base64Decode(_0x126da1,_0x7a8606){var _0x298a73=path[_0xf9e8('0x26')](__dirname,_0xf9e8('0x27'),rs[_0xf9e8('0x28')](0x4)+_0xf9e8('0x29'));fs[_0xf9e8('0x2a')](_0x298a73,_0x126da1,_0xf9e8('0x2b'));return convertFile(_0x298a73,_0x7a8606)['then'](function(){try{fs[_0xf9e8('0x1c')](_0x298a73);fs['chmodSync'](_0x7a8606,_0xf9e8('0x2c'));}catch(_0x223f82){logger[_0xf9e8('0x15')](_0x223f82);}return _0x7a8606['split']('.')[0x0];});}function base64Encode(_0x504852){var _0xdbd54=fs[_0xf9e8('0x2d')](_0x504852);return new Buffer(_0xdbd54)[_0xf9e8('0x2e')](_0xf9e8('0x2b'));}exports[_0xf9e8('0x2f')]=function(_0x38fd4f,_0x34d24e,_0x5d6ef2,_0x4dd3f6,_0x482cac,_0xee08d8){var _0x592973,_0x483798;var _0x57e9f2=_0xf9e8('0x30');var _0x3df8f6=_0xf9e8('0x31')+_0x38fd4f;var _0x1cd2b1={};if(_0x34d24e===_0xf9e8('0x32')){_0x1cd2b1['input']={'ssml':_0x5d6ef2};}else{_0x1cd2b1[_0xf9e8('0x33')]={'text':_0x5d6ef2};};_0x1cd2b1[_0xf9e8('0x34')]={'languageCode':_0x4dd3f6,'ssmlGender':_0x482cac};_0x1cd2b1['audioConfig']={'audioEncoding':_0xf9e8('0x35'),'sampleRateHertz':0x1f40};var _0x209bf9={'url':_0x57e9f2+_0xf9e8('0x36')+_0x3df8f6,'method':_0xf9e8('0x37'),'json':!![],'body':_0x1cd2b1};return rp(_0x209bf9)[_0xf9e8('0x38')](function(_0x17e200){return new BPromise(function(_0x442700,_0x17064f){_0x592973=path[_0xf9e8('0x26')](__dirname,'tmp',rs['generate'](0x4)+_0xf9e8('0x39'));var _0x3b16fd=Buffer[_0xf9e8('0x3a')](_0x17e200[_0xf9e8('0x3b')],_0xf9e8('0x2b'));return fs[_0xf9e8('0x3c')](_0x592973,_0x3b16fd,function(_0x3d3cf1){_0x17064f(_0x3d3cf1);},function(_0xae0f3e){fs['chmodSync'](_0x592973,_0xf9e8('0x2c'));_0x442700(_0xae0f3e);});});})[_0xf9e8('0x38')](function(_0x10f84a){_0x483798=path[_0xf9e8('0x26')](__dirname,_0xf9e8('0x27'),rs[_0xf9e8('0x28')](0x4)+_0xf9e8('0x29'));return convertFile(_0x592973,_0x483798);})[_0xf9e8('0x38')](function(){try{fs['unlink'](_0x592973);fs[_0xf9e8('0x3d')](_0x483798,_0xf9e8('0x2c'));}catch(_0x405421){logger[_0xf9e8('0x15')](_0x405421);}logger[_0xf9e8('0x3e')](_0xf9e8('0x3f'),_0x483798[_0xf9e8('0x40')]('.')[0x0]);return _0x483798[_0xf9e8('0x40')]('.')[0x0];});};exports[_0xf9e8('0x41')]=function(_0x2e81a3,_0x1a843d){var _0x49b38c=_0xf9e8('0x42');var _0x21b3c8,_0x2b7abd;var _0x2901d1;var _0x307462={'encoding':_0xf9e8('0x43'),'method':_0xf9e8('0x37'),'timeout':0x2710,'url':_0x49b38c,'headers':{'Content-Type':_0xf9e8('0x44')},'body':_0xf9e8('0x45')+encodeURIComponent(JSON[_0xf9e8('0x46')]([[['jQ1olc',JSON[_0xf9e8('0x46')]([_0x2e81a3,_0x1a843d||'en',![],_0xf9e8('0x47')]),null,'generic']]]))};return rp(_0x307462)[_0xf9e8('0x38')](function(_0x2dbaa0){try{_0x2901d1=eval(_0x2dbaa0[_0xf9e8('0x48')](0x5))[0x0][0x2];}catch(_0x47f32f){throw new Error(_0xf9e8('0x49')+_0x2dbaa0[_0xf9e8('0x20')]);}if(!_0x2901d1){if(_0x2e81a3[_0xf9e8('0x4a')]>0xc8){throw new Error(_0xf9e8('0x4b'));}else{throw new Error(_0xf9e8('0x4c')+_0x1a843d+_0xf9e8('0x4d'));}}try{_0x2901d1=eval(_0x2901d1)[0x0];}catch(_0x111548){throw new Error(_0xf9e8('0x49')+res[_0xf9e8('0x20')]);}const _0x449d62=_0x2901d1;_0x21b3c8=path[_0xf9e8('0x26')](__dirname,_0xf9e8('0x27'),rs['generate'](0x4)+_0xf9e8('0x39'));fs[_0xf9e8('0x2a')](_0x21b3c8,_0x2901d1,{'encoding':_0xf9e8('0x2b')});_0x2b7abd=path[_0xf9e8('0x26')](__dirname,_0xf9e8('0x27'),rs['generate'](0x4)+_0xf9e8('0x29'));return convertFile(_0x21b3c8,_0x2b7abd);})[_0xf9e8('0x38')](function(){try{fs[_0xf9e8('0x1c')](_0x21b3c8);fs[_0xf9e8('0x3d')](_0x2b7abd,_0xf9e8('0x2c'));}catch(_0x5b05f5){logger[_0xf9e8('0x15')](_0x5b05f5);}logger[_0xf9e8('0x3e')](_0xf9e8('0x4e'),_0x2b7abd[_0xf9e8('0x40')]('.')[0x0]);return _0x2b7abd['split']('.')[0x0];});};exports[_0xf9e8('0x4f')]=function(_0x3afaa7,_0x15bfe0,_0x30acac){return google[_0xf9e8('0x50')](_0x3afaa7,_0x15bfe0,_0x30acac)[_0xf9e8('0x38')](function(_0x5649e3){logger['info'](_0x5649e3[_0xf9e8('0x51')]);return rp(_0x5649e3);})[_0xf9e8('0x38')](function(_0x1476df){var _0x56b5a3='';var _0x4ea68a=0x0;try{fs[_0xf9e8('0x1c')](_0x3afaa7);}catch(_0x3c5b45){logger['error'](_0x3c5b45);}if(_0x1476df&&_0x1476df[_0xf9e8('0x52')]){_0x56b5a3=_0x1476df[_0xf9e8('0x52')][_0xf9e8('0x53')](function(_0x56edac){return _0x56edac&&_0x56edac['alternatives'][0x0]&&_0x56edac[_0xf9e8('0x54')][0x0][_0xf9e8('0x55')]?_0x56edac[_0xf9e8('0x54')][0x0][_0xf9e8('0x55')]:'';})[_0xf9e8('0x56')]('\x0a');_0x4ea68a=_0x1476df[_0xf9e8('0x52')][_0xf9e8('0x53')](function(_0x52f876){return _0x52f876&&_0x52f876['alternatives'][0x0]&&_0x52f876[_0xf9e8('0x54')][0x0]['confidence']?_0x52f876[_0xf9e8('0x54')][0x0][_0xf9e8('0x57')]:0x0;})[_0xf9e8('0x56')]('\x0a');}logger[_0xf9e8('0x3e')](_0xf9e8('0x58'),_0x56b5a3);logger[_0xf9e8('0x3e')]('googleASR\x20confidence',_0x4ea68a);return{'transcript':_0x56b5a3,'confidence':_0x4ea68a};})[_0xf9e8('0x59')](function(_0x12de8f){logger[_0xf9e8('0x15')]('[%s]\x20%s:%s',_0x12de8f['statusCode'],_0x12de8f[_0xf9e8('0x5a')],_0x12de8f['message']);});};exports[_0xf9e8('0x5b')]=function(_0x3e42b8,_0x29b50f,_0x210f52,_0x4711a3){var _0x1b8d82=apiai(_0x29b50f,{'language':_0x4711a3||'en'});return _0x1b8d82[_0xf9e8('0x5c')](_0x210f52,{'sessionId':md5(_0x3e42b8)})[_0xf9e8('0x38')](function(_0x282ef8){logger[_0xf9e8('0x3e')](JSON[_0xf9e8('0x46')](_0x282ef8));return{'source':_0x282ef8[_0xf9e8('0x5d')][_0xf9e8('0x5e')],'resolvedQuery':_0x282ef8['result'][_0xf9e8('0x5f')],'action':_0x282ef8['result'][_0xf9e8('0x60')],'actionIncomplete':_0x282ef8[_0xf9e8('0x5d')][_0xf9e8('0x61')],'speech':_0x282ef8[_0xf9e8('0x5d')]['fulfillment']['speech'],'score':_0x282ef8[_0xf9e8('0x5d')][_0xf9e8('0x62')],'statusCode':_0x282ef8[_0xf9e8('0x63')][_0xf9e8('0x64')],'endConversation':_0x282ef8[_0xf9e8('0x5d')][_0xf9e8('0x65')][_0xf9e8('0x66')]||![],'isFallbackIntent':_0x282ef8['result']['metadata'][_0xf9e8('0x67')]};});};exports[_0xf9e8('0x68')]=function(_0x58c1a1,_0x12d543,_0x3523fb,_0xec4f03,_0xd571bd,_0x57a81c){var _0x4cff06=_0xec4f03[_0xf9e8('0x69')](/\\n/g,'\x0a');var _0x377b6e={'credentials':{'private_key':_0x4cff06,'client_email':_0x3523fb}};var _0x5f2ed8=new dialogflow[(_0xf9e8('0x6a'))](_0x377b6e);var _0x583f8c=_0x5f2ed8[_0xf9e8('0x6b')](_0x12d543,md5(_0x58c1a1));var _0x2524aa={'session':_0x583f8c,'queryInput':{'text':{'text':_0xd571bd,'languageCode':_0x57a81c}}};return _0x5f2ed8[_0xf9e8('0x6c')](_0x2524aa)['then'](function(_0x4f2ecc){if(_0x4f2ecc&&_0x4f2ecc[_0xf9e8('0x4a')]){logger[_0xf9e8('0x3e')]('Dialogflow\x20V2\x20response:',JSON[_0xf9e8('0x46')](_0x4f2ecc));var _0x479825=_0x4f2ecc[0x0];if(_0x479825){var _0x29084b={'action':_0x479825[_0xf9e8('0x6d')][_0xf9e8('0x60')],'allRequiredParamsPresent':_0x479825['queryResult'][_0xf9e8('0x6e')],'endConversation':_0x479825['queryResult'][_0xf9e8('0x6f')]&&_0x479825[_0xf9e8('0x6d')]['diagnosticInfo'][_0xf9e8('0x70')]?_0x479825[_0xf9e8('0x6d')][_0xf9e8('0x6f')]['fields'][_0xf9e8('0x71')]['boolValue']:![],'fulfillmentText':_0x479825[_0xf9e8('0x6d')][_0xf9e8('0x72')],'intentName':_0x479825[_0xf9e8('0x6d')]['intent'][_0xf9e8('0x5a')],'intentDisplayName':_0x479825[_0xf9e8('0x6d')][_0xf9e8('0x73')]['displayName'],'isFallbackIntent':_0x479825[_0xf9e8('0x6d')]['intent'][_0xf9e8('0x74')],'languageCode':_0x479825[_0xf9e8('0x6d')][_0xf9e8('0x75')],'queryText':_0x479825[_0xf9e8('0x6d')][_0xf9e8('0x76')],'responseId':_0x479825[_0xf9e8('0x77')],'score':_0x479825[_0xf9e8('0x6d')][_0xf9e8('0x78')],'speech':_0x479825['queryResult'][_0xf9e8('0x72')],'providerResponse':JSON[_0xf9e8('0x46')](_0x4f2ecc)};return _0x29084b;}}});};exports[_0xf9e8('0x79')]=function(_0x11d233,_0x51b016,_0x29e48c,_0x1300b4){return tilde[_0xf9e8('0x50')](_0x11d233,_0x51b016,_0x29e48c,_0x1300b4)[_0xf9e8('0x38')](function(_0x5606f0){try{fs[_0xf9e8('0x1c')](_0x11d233);}catch(_0x538140){logger['error'](_0x538140);}logger[_0xf9e8('0x3e')]('Tilde\x20ASR\x20transcription',_0x5606f0[_0xf9e8('0x55')]);logger[_0xf9e8('0x3e')](_0xf9e8('0x7a'),_0x5606f0[_0xf9e8('0x57')]);return _0x5606f0;});};exports[_0xf9e8('0x7b')]=function(_0x47183c,_0x27c52e,_0x36fa79,_0x500fe8,_0xabac20,_0x50f75e){var _0x4896d2=path[_0xf9e8('0x26')](__dirname,_0xf9e8('0x27'),rs[_0xf9e8('0x28')](0x4)+'.mp3');var _0x7d586c;return aws[_0xf9e8('0x7c')](_0x47183c,_0x27c52e,_0x36fa79,_0x500fe8,_0xabac20,_0x50f75e,_0x4896d2)['then'](function(){_0x7d586c=path['resolve'](__dirname,_0xf9e8('0x27'),rs[_0xf9e8('0x28')](0x4)+_0xf9e8('0x29'));return convertFile(_0x4896d2,_0x7d586c);})[_0xf9e8('0x38')](function(){try{fs[_0xf9e8('0x1c')](_0x4896d2);fs[_0xf9e8('0x3d')](_0x7d586c,_0xf9e8('0x2c'));}catch(_0x875495){logger[_0xf9e8('0x15')](_0x875495);}return _0x7d586c[_0xf9e8('0x40')]('.')[0x0];});};exports[_0xf9e8('0x7d')]=function(_0x23cf43,_0x4ab84a,_0x20551e,_0x56a537,_0x4298ce,_0x20831f){return aws[_0xf9e8('0x7e')](_0x23cf43,_0x4ab84a,_0x20551e,_0x56a537,_0x4298ce,_0x20831f)[_0xf9e8('0x38')](function(_0x24a732){logger[_0xf9e8('0x3e')](JSON[_0xf9e8('0x46')](_0x24a732));return _0x24a732;});};exports[_0xf9e8('0x7f')]=function(_0x57b64,_0x428751,_0x4d9eac,_0xd20dc6){var _0x339ff8=util[_0xf9e8('0x80')](_0xf9e8('0x81'),ISPEECH_API,_0x57b64,encodeURIComponent(_0x428751),_0x4d9eac,_0xd20dc6);var _0x9efc4b=path[_0xf9e8('0x26')](__dirname,_0xf9e8('0x27'),rs['generate'](0x4)+_0xf9e8('0x39'));var _0x2a74fc;return downloadFile(_0x339ff8,_0x9efc4b)[_0xf9e8('0x38')](function(){_0x2a74fc=path[_0xf9e8('0x26')](__dirname,'tmp',rs[_0xf9e8('0x28')](0x4)+_0xf9e8('0x29'));return convertFile(_0x9efc4b,_0x2a74fc);})[_0xf9e8('0x38')](function(){try{fs[_0xf9e8('0x1c')](_0x9efc4b);fs['chmodSync'](_0x2a74fc,_0xf9e8('0x2c'));}catch(_0x5be877){logger[_0xf9e8('0x15')](_0x5be877);}return _0x2a74fc[_0xf9e8('0x40')]('.')[0x0];});};exports[_0xf9e8('0x82')]=function(_0x308479,_0x36b323,_0x21a596,_0x183938){var _0x785f72=util[_0xf9e8('0x80')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x36b323,_0x21a596,base64Encode(_0x308479),_0x183938?util['format']('model=%s',encodeURIComponent(_0x183938)):'freeform=3');return uploadFile(_0x785f72)[_0xf9e8('0x38')](function(_0x487bef){return querystring['parse'](_0x487bef);});};exports[_0xf9e8('0x83')]=function(_0x378bbd,_0x827131){return sestek['nda'](_0x378bbd,_0x827131)[_0xf9e8('0x38')](function(_0x3a5548){logger[_0xf9e8('0x3e')](JSON[_0xf9e8('0x46')](_0x3a5548));var _0xb68812={'speech':_0x3a5548[_0xf9e8('0x84')],'action':_0x3a5548['channelData']?_0x3a5548[_0xf9e8('0x85')][_0xf9e8('0x86')]:undefined,'actiondata':_0x3a5548[_0xf9e8('0x85')]?_0x3a5548['channelData'][_0xf9e8('0x87')]:undefined};if(_0x3a5548[_0xf9e8('0x85')]&&_0x3a5548[_0xf9e8('0x85')][_0xf9e8('0x88')]){return base64Decode(_0x3a5548['channelData']['AudioFromTts'][_0xf9e8('0x89')],path[_0xf9e8('0x26')](__dirname,'tmp',rs[_0xf9e8('0x28')](0x4)+_0xf9e8('0x29')))['then'](function(_0x1baac2){_0xb68812[_0xf9e8('0x8a')]=_0x1baac2;return _0xb68812;});}return _0xb68812;});};exports[_0xf9e8('0x8b')]=function(){return __dirname;}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/index.js b/server/services/agi/scripts/sestek/index.js index 25be112..f88f743 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 _0x7c79=['./nda','exports'];(function(_0x57486e,_0x32283b){var _0x5f110b=function(_0xa18fc3){while(--_0xa18fc3){_0x57486e['push'](_0x57486e['shift']());}};_0x5f110b(++_0x32283b);}(_0x7c79,0x86));var _0x97c7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7c79[_0x3dd15e];return _0x231fd0;};var nda=require(_0x97c7('0x0'));module[_0x97c7('0x1')]={'nda':nda}; \ No newline at end of file +var _0x5d02=['exports','./nda'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0x5d02,0x107));var _0x25d0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5d02[_0x3dd15e];return _0x231fd0;};var nda=require(_0x25d0('0x0'));module[_0x25d0('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 459f0d6..2ff6456 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 _0xb010=['audio/wav','custom_action','CustomAction','custom_action_data','CustomActionData','info','stringify','url','agi','POST','resolve','ndauth_url','/token','password','username','then','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','callerid','calleridname','dnid','extension','text','access_token','project','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings'];(function(_0x20b9fd,_0x57c229){var _0x2acabb=function(_0xb04edf){while(--_0xb04edf){_0x20b9fd['push'](_0x20b9fd['shift']());}};_0x2acabb(++_0x57c229);}(_0xb010,0x8b));var _0x0b01=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0xb010[_0xa148b7];return _0x51efd3;};'use strict';var rp=require('request-promise');var url=require(_0x0b01('0x0'));var logger=require('../../../../../config/logger')(_0x0b01('0x1'));module['exports']=function(_0x5fa8df,_0x48ca42){var _0x3156db={'method':_0x0b01('0x2'),'uri':url[_0x0b01('0x3')](_0x48ca42[_0x0b01('0x4')],_0x0b01('0x5')),'form':{'grant_type':_0x0b01('0x6'),'username':_0x48ca42[_0x0b01('0x7')],'password':_0x48ca42[_0x0b01('0x6')]},'json':!![]};return rp(_0x3156db)[_0x0b01('0x8')](function(_0x33eb05){var _0xcdfdfd={'method':_0x0b01('0x2'),'uri':url[_0x0b01('0x3')](_0x48ca42['ndassistant_url'],_0x0b01('0x9')),'body':{'type':_0x48ca42[_0x0b01('0xa')]||_0x0b01('0xb'),'channelId':_0x0b01('0xc'),'conversation':{'id':_0x5fa8df[_0x0b01('0xd')]},'from':{'id':_0x5fa8df[_0x0b01('0xe')],'name':_0x5fa8df[_0x0b01('0xf')]},'recipient':{'id':_0x5fa8df[_0x0b01('0x10')],'name':_0x5fa8df[_0x0b01('0x11')]},'text':_0x48ca42[_0x0b01('0x12')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x33eb05[_0x0b01('0x13')]},'json':!![]};if(_0x48ca42[_0x0b01('0x14')]){_0xcdfdfd[_0x0b01('0x15')][_0x0b01('0x16')][_0x0b01('0x17')]=_0x48ca42[_0x0b01('0x14')];}if(_0x48ca42[_0x0b01('0x18')]=='1'){_0xcdfdfd['body'][_0x0b01('0x16')][_0x0b01('0x19')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x0b01('0x1a')};}if(_0x48ca42[_0x0b01('0x1b')]){_0xcdfdfd[_0x0b01('0x15')][_0x0b01('0x16')][_0x0b01('0x1c')]=_0x48ca42[_0x0b01('0x1b')];if(_0x48ca42[_0x0b01('0x1d')]){_0xcdfdfd[_0x0b01('0x15')][_0x0b01('0x16')][_0x0b01('0x1e')]=_0x48ca42['custom_action_data'];}}logger[_0x0b01('0x1f')](JSON[_0x0b01('0x20')](_0xcdfdfd));return rp(_0xcdfdfd);});}; \ No newline at end of file +var _0x1b73=['password','username','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','message','Nda','uniqueid','callerid','calleridname','dnid','extension','text','Bearer\x20','access_token','body','channelData','ProjectName','project','ndagenerate_audio','AudioOutputSettings','audio/wav','CustomAction','custom_action','CustomActionData','custom_action_data','info','url','../../../../../config/logger','agi','exports','POST','resolve','/token'];(function(_0xbaa540,_0x339232){var _0x52aaa0=function(_0xd8663c){while(--_0xd8663c){_0xbaa540['push'](_0xbaa540['shift']());}};_0x52aaa0(++_0x339232);}(_0x1b73,0x1d5));var _0x31b7=function(_0x2bb0c5,_0x56560c){_0x2bb0c5=_0x2bb0c5-0x0;var _0x328244=_0x1b73[_0x2bb0c5];return _0x328244;};'use strict';var rp=require('request-promise');var url=require(_0x31b7('0x0'));var logger=require(_0x31b7('0x1'))(_0x31b7('0x2'));module[_0x31b7('0x3')]=function(_0x4bf5ae,_0x17c0ef){var _0x59e606={'method':_0x31b7('0x4'),'uri':url[_0x31b7('0x5')](_0x17c0ef['ndauth_url'],_0x31b7('0x6')),'form':{'grant_type':_0x31b7('0x7'),'username':_0x17c0ef[_0x31b7('0x8')],'password':_0x17c0ef['password']},'json':!![]};return rp(_0x59e606)[_0x31b7('0x9')](function(_0x1a730f){var _0x86ef8e={'method':_0x31b7('0x4'),'uri':url[_0x31b7('0x5')](_0x17c0ef[_0x31b7('0xa')],_0x31b7('0xb')),'body':{'type':_0x17c0ef['ndaactivity_type']||_0x31b7('0xc'),'channelId':_0x31b7('0xd'),'conversation':{'id':_0x4bf5ae[_0x31b7('0xe')]},'from':{'id':_0x4bf5ae[_0x31b7('0xf')],'name':_0x4bf5ae[_0x31b7('0x10')]},'recipient':{'id':_0x4bf5ae[_0x31b7('0x11')],'name':_0x4bf5ae[_0x31b7('0x12')]},'text':_0x17c0ef[_0x31b7('0x13')],'channelData':{}},'headers':{'Authorization':_0x31b7('0x14')+_0x1a730f[_0x31b7('0x15')]},'json':!![]};if(_0x17c0ef['project']){_0x86ef8e[_0x31b7('0x16')][_0x31b7('0x17')][_0x31b7('0x18')]=_0x17c0ef[_0x31b7('0x19')];}if(_0x17c0ef[_0x31b7('0x1a')]=='1'){_0x86ef8e[_0x31b7('0x16')][_0x31b7('0x17')][_0x31b7('0x1b')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x31b7('0x1c')};}if(_0x17c0ef['custom_action']){_0x86ef8e[_0x31b7('0x16')]['channelData'][_0x31b7('0x1d')]=_0x17c0ef[_0x31b7('0x1e')];if(_0x17c0ef['custom_action_data']){_0x86ef8e[_0x31b7('0x16')][_0x31b7('0x17')][_0x31b7('0x1f')]=_0x17c0ef[_0x31b7('0x20')];}}logger[_0x31b7('0x21')](JSON['stringify'](_0x86ef8e));return rp(_0x86ef8e);});}; \ 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 b2123a3..94ec62c 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 _0xf3ec=['./lib/api','exports'];(function(_0x77d286,_0x1ddc6d){var _0x5446a5=function(_0x45e2cf){while(--_0x45e2cf){_0x77d286['push'](_0x77d286['shift']());}};_0x5446a5(++_0x1ddc6d);}(_0xf3ec,0xf2));var _0xcf3e=function(_0x4e6169,_0x24d405){_0x4e6169=_0x4e6169-0x0;var _0x518f54=_0xf3ec[_0x4e6169];return _0x518f54;};'use strict';var asr=require(_0xcf3e('0x0'));module[_0xcf3e('0x1')]=function(_0x306085,_0xeec228,_0x548171,_0x521134){return asr(_0x306085,_0xeec228,_0x548171,_0x521134);}; \ No newline at end of file +var _0x66ff=['./lib/api'];(function(_0x52f9dc,_0x58cfc4){var _0x395a45=function(_0x11eca1){while(--_0x11eca1){_0x52f9dc['push'](_0x52f9dc['shift']());}};_0x395a45(++_0x58cfc4);}(_0x66ff,0xb3));var _0xf66f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x66ff[_0x14add3];return _0x4a174f;};'use strict';var asr=require(_0xf66f('0x0'));module['exports']=function(_0x49eee3,_0xd7d5f4,_0x3a08e0,_0x4e6d01){return asr(_0x49eee3,_0xd7d5f4,_0x3a08e0,_0x4e6d01);}; \ 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 bb92da4..7eef793 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 _0xc282=['agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','createHash','sha1','update','digest','hex','Open\x20Tilde\x20ASR\x20socket','send','stringify','createReadStream','data','close','terminate','parse','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','likelihood','Success.','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','error','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','message','bluebird','lodash','moment','crypto'];(function(_0x4a095e,_0x381cd5){var _0x10ef73=function(_0x1f6964){while(--_0x1f6964){_0x4a095e['push'](_0x4a095e['shift']());}};_0x10ef73(++_0x381cd5);}(_0xc282,0x182));var _0x2c28=function(_0x499eac,_0x26fe2c){_0x499eac=_0x499eac-0x0;var _0x3ba5de=_0xc282[_0x499eac];return _0x3ba5de;};'use strict';var BPromise=require(_0x2c28('0x0'));var _=require(_0x2c28('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x2c28('0x2'));var crypto=require(_0x2c28('0x3'));var logger=require('../../../../../../config/logger')(_0x2c28('0x4'));module[_0x2c28('0x5')]=function(_0x35b197,_0x10fa29,_0x6318cb,_0x1a7484){return new BPromise(function(_0x1ccfd4,_0x34a71e){logger[_0x2c28('0x6')](_0x2c28('0x7'),_0x1a7484||_0x2c28('0x8'));var _0x5bfc9d=new WebSocket(_0x1a7484||_0x2c28('0x8'),{'perMessageDeflate':![]});var _0x5e0874='';var _0x4c8235='0';var _0x27ecc5='1';var _0xbcf225='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0xcf0046(_0x32c500){var _0x3ae225=crypto[_0x2c28('0x9')](_0x2c28('0xa'));_0x3ae225[_0x2c28('0xb')](_0x32c500);return _0x3ae225[_0x2c28('0xc')](_0x2c28('0xd'));}function _0xaeecd9(){try{logger[_0x2c28('0x6')](_0x2c28('0xe'));var _0x57470d=moment()['unix']();var _0x31e881=_0xcf0046(_0x57470d+_0x10fa29+_0x6318cb);_0x5bfc9d[_0x2c28('0xf')](JSON[_0x2c28('0x10')]({'appID':_0x10fa29,'timestamp':_0x57470d,'appKey':_0x31e881}));var _0x137b3f=fs[_0x2c28('0x11')](_0x35b197);_0x137b3f['on'](_0x2c28('0x12'),function(_0x134aef){_0x5bfc9d[_0x2c28('0xf')](_0x134aef);});_0x137b3f['on'](_0x2c28('0x13'),function(){_0x5bfc9d[_0x2c28('0xf')]('EOS');});}catch(_0x2273d3){logger['error']('Tilde\x20ASR\x20send\x20error',JSON[_0x2c28('0x10')](_0x2273d3));_0x5bfc9d[_0x2c28('0x14')]();}}function _0x5d2b05(_0x19ba12){try{if(_0x19ba12){var _0x4ea880=JSON[_0x2c28('0x15')](_0x19ba12);switch(_0x4ea880['status']){case 0x0:if(_0x4ea880['result']){if(_0x4ea880[_0x2c28('0x16')][_0x2c28('0x17')]){logger[_0x2c28('0x6')](_0x2c28('0x18'),JSON[_0x2c28('0x10')](_0x4ea880[_0x2c28('0x16')][_0x2c28('0x19')]));_0x5e0874=_0x4ea880[_0x2c28('0x16')][_0x2c28('0x19')][0x0]['transcript'];_0x4c8235=_0x4ea880[_0x2c28('0x16')]['hypotheses'][0x0][_0x2c28('0x1a')];_0x27ecc5='0';_0xbcf225=_0x2c28('0x1b');_0x5bfc9d[_0x2c28('0x14')]();}}break;case 0x1:logger['info']('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x27ecc5='1';_0xbcf225=_0x2c28('0x1c');break;case 0x2:logger[_0x2c28('0x6')](_0x2c28('0x1d'));_0x27ecc5='2';_0xbcf225='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger[_0x2c28('0x6')](_0x2c28('0x1e'));_0x27ecc5='9';_0xbcf225=_0x2c28('0x1e');break;case 0xa:logger['info']('Authentication\x20failed.');_0x27ecc5='10';_0xbcf225=_0x2c28('0x1f');break;case 0xb:logger[_0x2c28('0x6')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x27ecc5='11';_0xbcf225='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0x337a4b){logger[_0x2c28('0x20')](_0x2c28('0x21'),JSON[_0x2c28('0x10')](_0x337a4b));_0x5bfc9d[_0x2c28('0x14')]();}}function _0x16a5fe(){logger['info'](_0x2c28('0x22'));_0x1ccfd4({'transcript':_0x5e0874,'confidence':_0x4c8235,'status':_0x27ecc5,'status_message':_0xbcf225});}function _0x4f95e5(_0x25c630){logger['error'](_0x2c28('0x23'));if(!_[_0x2c28('0x24')](_0x25c630)){logger[_0x2c28('0x20')](_[_0x2c28('0x25')](_0x25c630)?JSON['stringify'](_0x25c630):_0x25c630);}}_0x5bfc9d['on']('open',_0xaeecd9);_0x5bfc9d['on'](_0x2c28('0x26'),_0x5d2b05);_0x5bfc9d['on'](_0x2c28('0x13'),_0x16a5fe);_0x5bfc9d['on']('error',_0x4f95e5);});}; \ No newline at end of file +var _0xc6d5=['hex','unix','stringify','createReadStream','send','EOS','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','error','Tilde\x20ASR\x20parse\x20error','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','message','close','bluebird','lodash','moment','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','digest'];(function(_0xd559cb,_0x4f64e7){var _0x364827=function(_0x5d2063){while(--_0x5d2063){_0xd559cb['push'](_0xd559cb['shift']());}};_0x364827(++_0x4f64e7);}(_0xc6d5,0x1ef));var _0x5c6d=function(_0x3414cd,_0x467348){_0x3414cd=_0x3414cd-0x0;var _0x3891e9=_0xc6d5[_0x3414cd];return _0x3891e9;};'use strict';var BPromise=require(_0x5c6d('0x0'));var _=require(_0x5c6d('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x5c6d('0x2'));var crypto=require('crypto');var logger=require('../../../../../../config/logger')(_0x5c6d('0x3'));module[_0x5c6d('0x4')]=function(_0x145ab4,_0x770f2,_0x888e46,_0x17548c){return new BPromise(function(_0x463cc7,_0x11b7af){logger[_0x5c6d('0x5')](_0x5c6d('0x6'),_0x17548c||_0x5c6d('0x7'));var _0x19634d=new WebSocket(_0x17548c||_0x5c6d('0x7'),{'perMessageDeflate':![]});var _0x3d5621='';var _0x4522c1='0';var _0xfaef12='1';var _0x1d6759=_0x5c6d('0x8');function _0x382199(_0x257d58){var _0x30e1ca=crypto[_0x5c6d('0x9')](_0x5c6d('0xa'));_0x30e1ca['update'](_0x257d58);return _0x30e1ca[_0x5c6d('0xb')](_0x5c6d('0xc'));}function _0x5a8896(){try{logger[_0x5c6d('0x5')]('Open\x20Tilde\x20ASR\x20socket');var _0x5c1eb3=moment()[_0x5c6d('0xd')]();var _0x387691=_0x382199(_0x5c1eb3+_0x770f2+_0x888e46);_0x19634d['send'](JSON[_0x5c6d('0xe')]({'appID':_0x770f2,'timestamp':_0x5c1eb3,'appKey':_0x387691}));var _0x554e29=fs[_0x5c6d('0xf')](_0x145ab4);_0x554e29['on']('data',function(_0x5311c1){_0x19634d[_0x5c6d('0x10')](_0x5311c1);});_0x554e29['on']('close',function(){_0x19634d[_0x5c6d('0x10')](_0x5c6d('0x11'));});}catch(_0x1647d9){logger['error'](_0x5c6d('0x12'),JSON[_0x5c6d('0xe')](_0x1647d9));_0x19634d[_0x5c6d('0x13')]();}}function _0x20c4cd(_0x1683dc){try{if(_0x1683dc){var _0x2d8a48=JSON[_0x5c6d('0x14')](_0x1683dc);switch(_0x2d8a48[_0x5c6d('0x15')]){case 0x0:if(_0x2d8a48['result']){if(_0x2d8a48[_0x5c6d('0x16')][_0x5c6d('0x17')]){logger[_0x5c6d('0x5')](_0x5c6d('0x18'),JSON[_0x5c6d('0xe')](_0x2d8a48[_0x5c6d('0x16')][_0x5c6d('0x19')]));_0x3d5621=_0x2d8a48['result'][_0x5c6d('0x19')][0x0][_0x5c6d('0x1a')];_0x4522c1=_0x2d8a48[_0x5c6d('0x16')][_0x5c6d('0x19')][0x0]['likelihood'];_0xfaef12='0';_0x1d6759=_0x5c6d('0x1b');_0x19634d[_0x5c6d('0x13')]();}}break;case 0x1:logger[_0x5c6d('0x5')](_0x5c6d('0x8'));_0xfaef12='1';_0x1d6759=_0x5c6d('0x8');break;case 0x2:logger[_0x5c6d('0x5')](_0x5c6d('0x1c'));_0xfaef12='2';_0x1d6759=_0x5c6d('0x1c');break;case 0x9:logger[_0x5c6d('0x5')](_0x5c6d('0x1d'));_0xfaef12='9';_0x1d6759=_0x5c6d('0x1d');break;case 0xa:logger[_0x5c6d('0x5')]('Authentication\x20failed.');_0xfaef12='10';_0x1d6759=_0x5c6d('0x1e');break;case 0xb:logger[_0x5c6d('0x5')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0xfaef12='11';_0x1d6759=_0x5c6d('0x1f');}}}catch(_0x299918){logger[_0x5c6d('0x20')](_0x5c6d('0x21'),JSON[_0x5c6d('0xe')](_0x299918));_0x19634d[_0x5c6d('0x13')]();}}function _0x1c3402(){logger[_0x5c6d('0x5')]('Close\x20Tilde\x20ASR\x20socket');_0x463cc7({'transcript':_0x3d5621,'confidence':_0x4522c1,'status':_0xfaef12,'status_message':_0x1d6759});}function _0x8f5e5(_0x34bc45){logger[_0x5c6d('0x20')](_0x5c6d('0x22'));if(!_[_0x5c6d('0x23')](_0x34bc45)){logger[_0x5c6d('0x20')](_[_0x5c6d('0x24')](_0x34bc45)?JSON[_0x5c6d('0xe')](_0x34bc45):_0x34bc45);}}_0x19634d['on']('open',_0x5a8896);_0x19634d['on'](_0x5c6d('0x25'),_0x20c4cd);_0x19634d['on'](_0x5c6d('0x26'),_0x1c3402);_0x19634d['on'](_0x5c6d('0x20'),_0x8f5e5);});}; \ 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 fd7355f..753acc4 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 _0xd206=['exports','./asr'];(function(_0x3c0c67,_0x107b7b){var _0x8616cb=function(_0x4a4c96){while(--_0x4a4c96){_0x3c0c67['push'](_0x3c0c67['shift']());}};_0x8616cb(++_0x107b7b);}(_0xd206,0x125));var _0x6d20=function(_0x87b0ff,_0x314389){_0x87b0ff=_0x87b0ff-0x0;var _0x3bc0b2=_0xd206[_0x87b0ff];return _0x3bc0b2;};var asr=require(_0x6d20('0x0'));module[_0x6d20('0x1')]={'asr':asr}; \ No newline at end of file +var _0x2034=['./asr'];(function(_0x492638,_0x5cfc7f){var _0x1d4aca=function(_0x2760bb){while(--_0x2760bb){_0x492638['push'](_0x492638['shift']());}};_0x1d4aca(++_0x5cfc7f);}(_0x2034,0x156));var _0x4203=function(_0x1582cd,_0x211132){_0x1582cd=_0x1582cd-0x0;var _0x2ef951=_0x2034[_0x1582cd];return _0x2ef951;};var asr=require(_0x4203('0x0'));module['exports']={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index c27befe..e429cb7 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 _0x4787=['E_AGI_ARGUMENT_PORT','listening','connection','getConnections','emit','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','ready','E_AGI_SERVER_ERROR','close','E_AGI_SERVER_CLOSE','nextTick','inherits','util','net','events','EventEmitter','./channel','127.0.0.1','error'];(function(_0x397cfb,_0xb8f317){var _0x15fed9=function(_0x3eba43){while(--_0x3eba43){_0x397cfb['push'](_0x397cfb['shift']());}};_0x15fed9(++_0xb8f317);}(_0x4787,0x1dc));var _0x7478=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x4787[_0x5f1391];return _0x50ebe3;};'use strict';var util=require(_0x7478('0x0'));var net=require(_0x7478('0x1'));var EventEmitter=require(_0x7478('0x2'))[_0x7478('0x3')];var AGIError=require('./error');var AGIChannel=require(_0x7478('0x4'));var AGIServer=function(_0x5c408d,_0x36f07a,_0x5b0155){var _0x19aa22=this,_0x5c408d=_0x5c408d||0x11dd,_0x36f07a=_0x36f07a||_0x7478('0x5'),_0x12a981=null,_0x4059e5=0x0;EventEmitter['call'](_0x19aa22);function _0x34cfc5(){if(!_0x5c408d){_0x19aa22['emit'](_0x7478('0x6'),new AGIError(_0x7478('0x7')));return![];}_0x12a981=net['createServer']();_0x12a981['listen'](_0x5c408d,_0x36f07a);_0x12a981['on']('listening',function(){_0x19aa22['emit'](_0x7478('0x8'));});_0x12a981['on'](_0x7478('0x9'),function(_0x2c2c11){_0x12a981[_0x7478('0xa')](function(_0x1ebda0,_0x939104){if(_0x1ebda0){_0x19aa22[_0x7478('0xb')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x1ebda0));}else if(_0x5b0155&&_0x5b0155<0x0){_0x19aa22[_0x7478('0xb')](_0x7478('0x6'),new AGIError(_0x7478('0xc')));_0x2c2c11[_0x7478('0xd')]();}else if(_0x5b0155&&_0x5b0155>0x0&&_0x5b0155<_0x939104){_0x4059e5+=0x1;_0x19aa22[_0x7478('0xb')]('error',new AGIError(_0x7478('0xe'),_0x4059e5));_0x2c2c11[_0x7478('0xd')]();}else{var _0x3867d2=new AGIChannel(_0x2c2c11);_0x3867d2['on'](_0x7478('0xf'),function(){_0x19aa22[_0x7478('0xb')](_0x7478('0x9'),_0x3867d2);});}});});_0x12a981['on'](_0x7478('0x6'),function(_0x40e463){_0x19aa22[_0x7478('0xb')](_0x7478('0x6'),new AGIError(_0x7478('0x10'),_0x40e463['code']));});_0x12a981['on']('close',function(){_0x19aa22['emit'](_0x7478('0x11'),new AGIError(_0x7478('0x12')));});}process[_0x7478('0x13')](function(){_0x34cfc5();});};util[_0x7478('0x14')](AGIServer,EventEmitter);module['exports']=function(_0x49c9ec,_0xd8570c,_0x293b94){return new AGIServer(_0x49c9ec,_0xd8570c,_0x293b94);}; \ No newline at end of file +var _0xc605=['E_AGI_SERVER_CLOSE','nextTick','inherits','net','events','EventEmitter','./error','./channel','127.0.0.1','emit','createServer','listening','connection','getConnections','error','destroy','E_AGI_SERVER_MAXCONNECTION','ready','E_AGI_SERVER_ERROR','code','close'];(function(_0x5b5ffe,_0x1c5874){var _0x2d12bc=function(_0x14d075){while(--_0x14d075){_0x5b5ffe['push'](_0x5b5ffe['shift']());}};_0x2d12bc(++_0x1c5874);}(_0xc605,0xff));var _0x5c60=function(_0x1ec33f,_0xac9a0a){_0x1ec33f=_0x1ec33f-0x0;var _0xacb3da=_0xc605[_0x1ec33f];return _0xacb3da;};'use strict';var util=require('util');var net=require(_0x5c60('0x0'));var EventEmitter=require(_0x5c60('0x1'))[_0x5c60('0x2')];var AGIError=require(_0x5c60('0x3'));var AGIChannel=require(_0x5c60('0x4'));var AGIServer=function(_0x350950,_0xed21cd,_0x3be2e1){var _0x12969d=this,_0x350950=_0x350950||0x11dd,_0xed21cd=_0xed21cd||_0x5c60('0x5'),_0x426590=null,_0x2f72d8=0x0;EventEmitter['call'](_0x12969d);function _0x1e5321(){if(!_0x350950){_0x12969d[_0x5c60('0x6')]('error',new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x426590=net[_0x5c60('0x7')]();_0x426590['listen'](_0x350950,_0xed21cd);_0x426590['on'](_0x5c60('0x8'),function(){_0x12969d[_0x5c60('0x6')](_0x5c60('0x8'));});_0x426590['on'](_0x5c60('0x9'),function(_0x2732f3){_0x426590[_0x5c60('0xa')](function(_0x4ee8d4,_0x3e71e4){if(_0x4ee8d4){_0x12969d[_0x5c60('0x6')](_0x5c60('0xb'),new AGIError('E_AGI_SERVER_ERROR',_0x4ee8d4));}else if(_0x3be2e1&&_0x3be2e1<0x0){_0x12969d[_0x5c60('0x6')]('error',new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x2732f3[_0x5c60('0xc')]();}else if(_0x3be2e1&&_0x3be2e1>0x0&&_0x3be2e1<_0x3e71e4){_0x2f72d8+=0x1;_0x12969d[_0x5c60('0x6')](_0x5c60('0xb'),new AGIError(_0x5c60('0xd'),_0x2f72d8));_0x2732f3['destroy']();}else{var _0x2655eb=new AGIChannel(_0x2732f3);_0x2655eb['on'](_0x5c60('0xe'),function(){_0x12969d[_0x5c60('0x6')]('connection',_0x2655eb);});}});});_0x426590['on'](_0x5c60('0xb'),function(_0x1f9663){_0x12969d[_0x5c60('0x6')](_0x5c60('0xb'),new AGIError(_0x5c60('0xf'),_0x1f9663[_0x5c60('0x10')]));});_0x426590['on'](_0x5c60('0x11'),function(){_0x12969d[_0x5c60('0x6')](_0x5c60('0x11'),new AGIError(_0x5c60('0x12')));});}process[_0x5c60('0x13')](function(){_0x1e5321();});};util[_0x5c60('0x14')](AGIServer,EventEmitter);module['exports']=function(_0x823f5a,_0x49310e,_0xc77dde){return new AGIServer(_0x823f5a,_0x49310e,_0xc77dde);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index fb12838..1cb5f23 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 _0x2e54=['getData','response','maxdigit','test','mindigit','hiddendigitsnum','generate','first','substr','getdigits','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','AWS_LEX_%s','message','amazonlex','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','no\x20key\x20configured','wav','%s/recordings/%s','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','appsecret','no\x20appsecret\x20configured','beep','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','continueAt','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','true','EVAL\x20CONDITION\x20%s\x20%s','false','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','getIntervals','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','IspeechASR\x20Result\x20%s','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20%s\x20file\x20created','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','isArray','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20selected','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','getPause','playback','no\x20file\x20audio\x20found','PLAYBACK','Executed\x20command\x20%s\x20%s','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20found','indexOf','XMCS-QUEUE','QUEUE','macro','gosub','record','recordingFormat','%s_%s','%s/recordings/%s.%s','escape_digits','restapi','no\x20url\x20configured','no\x20variable\x20selected\x20for\x20the\x20response','200','statusMessage','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','getMailAccount','account_id','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','bcc','service','host','port','secure','authentication','auth','pass','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sendSMS\x20message','sms_account_id','Trying\x20SendSMS\x20with\x20account\x20%s','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','yes','Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','arg_1','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','lodash','shelljs','odbc','randomstring','moment','request-promise','../../config/logger','agi','../../config/environment','./scripts','rawBody','menu','getsecretdigits','channel','rpc','mailRpc','getVariable','getVariableById','then','catch','prototype','getVoiceQueue','getVoiceQueueById','name','getSquareProject','dsn','getUser','getTrunk','getSound','getSoundById','getSoundPath','save_name','getMailAccountById','sendMailMessage','getIntervalById','IntervalId','interval','format','%s/sounds/converted/%s','getQueryOdbc','open','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','error','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','uniqueid','agicommand','callerid','createSquareRecording','context','extension','priority','accountcode','dnid','createSquareMessage','createCmContact','isNil','isEmpty','lastName','phone','list_id','scheduledAt','Callback\x20scheduled\x20at\x20','toString','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','replace','googleCloudTTS','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','googleTTS','google_tts_language','restAPI','url','method','timeout','number','includes','POST','PUT','toUpperCase','body','headers','rawHeaders','parse','computedVariables','sync','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','dialogflowV2_language','sestekNDA','ispeechTTS','speed','ispeechASR','ispeech_asr_language','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','google_asr_language','tildeASR','appid','hasOwnProperty','isString','replaceAllVariables','recursiveNodeIndex','isPlainObject','length','saveRestApiResult','%s.%s','setVariable','split','replaceAll','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','extra','maxRetry','createSquareDetailsReport','retry','mrcpsynth','label','MRCPSynth','result','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','grammar','noop','no\x20grammar\x20configured','getAndSetVariable','RECOG_CONFIDENCE()','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','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','callback','no\x20list\x20selected','delay','minutes','callback_priority','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','no\x20text\x20configured','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','MRCPRecog','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','no\x20database\x20selected','getSquareOdbc','odbc_id','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','opts','Executed\x20command\x20%s','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','bot','out','dialogflow','Dialogflow\x20Result\x20%s','speech','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','client_email','no\x20client_email\x20configured','private_key','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','Sestek\x20NDA\x20%s\x20file\x20created','audiofile','streamFile','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\x20found','trunk_name','no\x20trunk\x20selected','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','file_id'];(function(_0x153e27,_0x3c1a56){var _0x3ae476=function(_0x3a935c){while(--_0x3a935c){_0x153e27['push'](_0x153e27['shift']());}};_0x3ae476(++_0x3c1a56);}(_0x2e54,0xc1));var _0x42e5=function(_0x453a36,_0x11cd93){_0x453a36=_0x453a36-0x0;var _0x2f38c6=_0x2e54[_0x453a36];return _0x2f38c6;};'use strict';var fs=require('fs');var path=require('path');var util=require('util');var _=require(_0x42e5('0x0'));var sh=require(_0x42e5('0x1'));var odbc=require(_0x42e5('0x2'))();var rs=require(_0x42e5('0x3'));var moment=require(_0x42e5('0x4'));var Mustache=require('mustache');var rp=require(_0x42e5('0x5'));var logger=require(_0x42e5('0x6'))(_0x42e5('0x7'));var config=require(_0x42e5('0x8'));var scripts=require(_0x42e5('0x9'));var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=['rawHeaders',_0x42e5('0xa')];var verticesWithRetry=[_0x42e5('0xb'),'getdigits',_0x42e5('0xc')];var AGIVertices=function(_0x3c26cd,_0x2dfd61,_0x5f0fca){this[_0x42e5('0xd')]=_0x3c26cd;this[_0x42e5('0xe')]=_0x2dfd61;this[_0x42e5('0xf')]=_0x5f0fca;};AGIVertices['prototype'][_0x42e5('0x10')]=function(_0x4e6c0f,_0x1cfc8e){this[_0x42e5('0xe')][_0x42e5('0x11')](_0x4e6c0f)[_0x42e5('0x12')](function(_0x12d4af){_0x1cfc8e(null,_0x12d4af?_0x12d4af['name']:![]);})[_0x42e5('0x13')](function(_0x244bc4){_0x1cfc8e(_0x244bc4);});};AGIVertices[_0x42e5('0x14')][_0x42e5('0x15')]=function(_0x472d0f,_0x3090aa){this[_0x42e5('0xe')][_0x42e5('0x16')](_0x472d0f)[_0x42e5('0x12')](function(_0x151173){_0x3090aa(null,_0x151173?_0x151173[_0x42e5('0x17')]:![]);})['catch'](function(_0x51dcf3){_0x3090aa(_0x51dcf3);});};AGIVertices[_0x42e5('0x14')][_0x42e5('0x18')]=function(_0x2d55c9,_0x15e8cb){this[_0x42e5('0xe')]['getSquareProjectById'](_0x2d55c9)[_0x42e5('0x12')](function(_0x143733){_0x15e8cb(null,_0x143733?_0x143733[_0x42e5('0x17')]:![]);})['catch'](function(_0x19fdf1){_0x15e8cb(_0x19fdf1);});};AGIVertices[_0x42e5('0x14')]['getSquareOdbc']=function(_0x435dfd,_0x497323){this['rpc']['getSquareOdbcById'](_0x435dfd)[_0x42e5('0x12')](function(_0x2e8502){_0x497323(null,_0x2e8502?_0x2e8502[_0x42e5('0x19')]:![]);})['catch'](function(_0xdf97f0){_0x497323(_0xdf97f0);});};AGIVertices[_0x42e5('0x14')][_0x42e5('0x1a')]=function(_0x1a79e6,_0x1fc835){this['rpc']['getUserById'](_0x1a79e6)[_0x42e5('0x12')](function(_0x17b5d3){_0x1fc835(null,_0x17b5d3?_0x17b5d3['name']:![]);})[_0x42e5('0x13')](function(_0x11d530){_0x1fc835(_0x11d530);});};AGIVertices['prototype'][_0x42e5('0x1b')]=function(_0x56cf89,_0x572b17){this[_0x42e5('0xe')]['getTrunkById'](_0x56cf89)[_0x42e5('0x12')](function(_0x96e6d0){_0x572b17(null,_0x96e6d0?_0x96e6d0['name']:![]);})[_0x42e5('0x13')](function(_0x1b4c83){_0x572b17(_0x1b4c83);});};AGIVertices['prototype'][_0x42e5('0x1c')]=function(_0x10f309,_0x169772){var _0x4622a7=this;this[_0x42e5('0xe')][_0x42e5('0x1d')](_0x10f309)['then'](function(_0xf173ca){_0x169772(null,_0xf173ca?_0x4622a7[_0x42e5('0x1e')](_0xf173ca[_0x42e5('0x1f')]):![]);})[_0x42e5('0x13')](function(_0x178c03){_0x169772(_0x178c03);});};AGIVertices['prototype']['getMailAccount']=function(_0x333e6a,_0x520507){this[_0x42e5('0xe')][_0x42e5('0x20')](_0x333e6a)[_0x42e5('0x12')](function(_0x37cb43){_0x520507(null,_0x37cb43?_0x37cb43:![]);})['catch'](function(_0x176e91){_0x520507(_0x176e91);});};AGIVertices[_0x42e5('0x14')][_0x42e5('0x21')]=function(_0x52c4c6,_0x195e40,_0x3a1901){this[_0x42e5('0xf')][_0x42e5('0x21')](_0x52c4c6,_0x195e40)['then'](function(){_0x3a1901(null);})[_0x42e5('0x13')](function(_0xc8999e){_0x3a1901(_0xc8999e);});};AGIVertices[_0x42e5('0x14')]['getIntervals']=function(_0x34e613,_0x1640b9){this['rpc'][_0x42e5('0x22')](_0x34e613)[_0x42e5('0x12')](function(_0x1e9f46){if(_0x1e9f46){if(_0x1e9f46[_0x42e5('0x23')]){_0x1640b9(null,[_0x1e9f46[_0x42e5('0x24')]]);}else{_0x1640b9(null,_['map'](_0x1e9f46['Intervals'],_0x42e5('0x24')));}}else{_0x1640b9(null,![]);}})['catch'](function(_0x1a0c52){_0x1640b9(_0x1a0c52);});};AGIVertices[_0x42e5('0x14')][_0x42e5('0x1e')]=function(_0x133662){return util[_0x42e5('0x25')](_0x42e5('0x26'),FILES_PATH,_0x133662);};AGIVertices[_0x42e5('0x14')][_0x42e5('0x27')]=function(_0x54781d,_0x3817f2,_0x43afaf){odbc[_0x42e5('0x28')](_0x54781d,function(_0x5372d2){if(_0x5372d2){logger['error'](_0x42e5('0x29'),_0x5372d2);_0x43afaf(_0x5372d2);}else{logger[_0x42e5('0x2a')](_0x42e5('0x2b'));odbc[_0x42e5('0x2c')](_0x3817f2,function(_0x2f6d34,_0x25c222){if(_0x2f6d34){logger['info'](_0x42e5('0x2d'),_0x3817f2);_0x43afaf(_0x2f6d34);}else{logger['info'](_0x42e5('0x2e'),_0x3817f2);odbc[_0x42e5('0x2f')](function(_0x2d5434){if(_0x2d5434){logger[_0x42e5('0x30')](_0x42e5('0x31'),_0x2d5434);}_0x43afaf(null,_0x25c222);});}});}});};AGIVertices[_0x42e5('0x14')][_0x42e5('0x32')]=function(_0x3e9245,_0x12296a){this[_0x42e5('0xe')][_0x42e5('0x33')](_0x3e9245)['then'](function(_0x370c4d){_0x12296a(null,_0x370c4d?_0x370c4d:![]);})[_0x42e5('0x13')](function(_0x57c86d){_0x12296a(_0x57c86d);});};AGIVertices[_0x42e5('0x14')][_0x42e5('0x34')]=function(_0x366e43,_0x3688cf){this[_0x42e5('0xe')]['createSmsMessage'](_0x366e43)[_0x42e5('0x12')](function(_0x3acbc6){_0x3688cf(null,_0x3acbc6);})[_0x42e5('0x13')](function(_0x5290a1){_0x3688cf(_0x5290a1);});};AGIVertices[_0x42e5('0x14')]['createSquareDetailsReport']=function(_0x301abe,_0x383d3c,_0x46beb9){this[_0x42e5('0xe')]['createSquareDetailsReport']({'uniqueid':this[_0x42e5('0xd')][_0x42e5('0x35')],'node':_0x301abe['label'],'application':_0x301abe[_0x42e5('0x36')],'data':_0x383d3c||null,'project_name':this[_0x42e5('0xd')]['arg_1'],'callerid':this['channel'][_0x42e5('0x37')]})[_0x42e5('0x12')](function(_0xcbc14e){if(_0x46beb9){_0x46beb9(null,_0xcbc14e);}})[_0x42e5('0x13')](function(_0x5341bc){if(_0x46beb9){_0x46beb9(_0x5341bc);}});};AGIVertices['prototype'][_0x42e5('0x38')]=function(_0x294f96,_0x2d3aa7,_0x45c9e2,_0x7a1cda){this['rpc'][_0x42e5('0x38')]({'uniqueid':this[_0x42e5('0xd')][_0x42e5('0x35')],'callerid':this['channel']['callerid'],'calleridname':this[_0x42e5('0xd')]['calleridname'],'context':this['channel'][_0x42e5('0x39')],'extension':this[_0x42e5('0xd')][_0x42e5('0x3a')],'priority':this[_0x42e5('0xd')][_0x42e5('0x3b')],'accountcode':this[_0x42e5('0xd')][_0x42e5('0x3c')],'dnid':this[_0x42e5('0xd')][_0x42e5('0x3d')],'projectName':this[_0x42e5('0xd')]['arg_1'],'saveName':_0x2d3aa7,'filename':_0x294f96['file']||_0x2d3aa7,'savePath':_0x45c9e2})[_0x42e5('0x12')](function(_0x3aca42){_0x7a1cda(null,_0x3aca42);})[_0x42e5('0x13')](function(_0x56625e){_0x7a1cda(_0x56625e);});};AGIVertices[_0x42e5('0x14')][_0x42e5('0x3e')]=function(_0x586a80,_0x2a1366,_0x369fc6,_0x5915ca,_0x483d6b){this[_0x42e5('0xe')][_0x42e5('0x3e')]({'uniqueid':this[_0x42e5('0xd')]['uniqueid'],'body':_0x586a80,'direction':_0x2a1366,'providerName':_0x369fc6,'providerResponse':_0x5915ca})[_0x42e5('0x12')](function(_0x46d2a6){if(_0x483d6b){_0x483d6b(null,_0x46d2a6);}})[_0x42e5('0x13')](function(_0x4ebbcb){if(_0x483d6b){_0x483d6b(_0x4ebbcb);}});};AGIVertices[_0x42e5('0x14')][_0x42e5('0x3f')]=function(_0x1345c8,_0x3994de){this[_0x42e5('0xe')][_0x42e5('0x3f')]({'firstName':_['isEmpty'](_0x1345c8[_0x42e5('0x17')])||_[_0x42e5('0x40')](_0x1345c8['name'])?'callback_'+Math['random']():_0x1345c8[_0x42e5('0x17')],'lastName':_[_0x42e5('0x41')](_0x1345c8[_0x42e5('0x42')])||_[_0x42e5('0x40')](_0x1345c8[_0x42e5('0x42')])?null:_0x1345c8[_0x42e5('0x42')],'phone':_0x1345c8[_0x42e5('0x43')],'ListId':_0x1345c8[_0x42e5('0x44')],'scheduledat':_0x1345c8[_0x42e5('0x45')],'callbackUniqueid':this[_0x42e5('0xd')]['uniqueid'],'tags':'callback','description':_0x42e5('0x46')+_0x1345c8['scheduledAt'][_0x42e5('0x47')](),'priority':_0x1345c8['callback_priority']})[_0x42e5('0x12')](function(_0x51e305){_0x3994de(null,_0x51e305);})['catch'](function(_0x24d108){_0x3994de(_0x24d108);});};AGIVertices['prototype']['getPause']=function(_0x5c3de8,_0x4d8925){this['rpc'][_0x42e5('0x48')](_0x5c3de8)['then'](function(_0x1fa946){_0x4d8925(null,_0x1fa946?_0x1fa946['name']:![]);})[_0x42e5('0x13')](function(_0x15c2b7){_0x4d8925(_0x15c2b7);});};AGIVertices['prototype'][_0x42e5('0x49')]=function(_0x38f70b,_0x5670cc,_0x920ce9){var _0x51ab39={'role':_0x42e5('0x4a')};_0x51ab39[_0x38f70b]=this[_0x42e5('0xd')][_0x42e5('0x37')];this[_0x42e5('0xe')][_0x42e5('0x49')](_0x51ab39,_0x5670cc,this[_0x42e5('0xd')][_0x42e5('0x35')])[_0x42e5('0x12')](function(_0x362827){_0x920ce9(null,_[_0x42e5('0x40')](_0x362827)?![]:!![]);})[_0x42e5('0x13')](function(_0x340b54){logger[_0x42e5('0x30')](_0x340b54);_0x920ce9(null,![]);});};AGIVertices[_0x42e5('0x14')][_0x42e5('0x4b')]=function(_0x5ecc28,_0x2acfa3){var _0x58284b={'role':_0x42e5('0x4a')};_0x58284b[_0x5ecc28]=this[_0x42e5('0xd')][_0x42e5('0x37')];this[_0x42e5('0xe')][_0x42e5('0x4b')](_0x58284b)[_0x42e5('0x12')](function(_0x38254f){_0x2acfa3(null,_[_0x42e5('0x40')](_0x38254f)?![]:!![]);})['catch'](function(_0x3fcd7e){logger['error'](_0x3fcd7e);_0x2acfa3(null,![]);});};AGIVertices[_0x42e5('0x14')][_0x42e5('0x4c')]=function(_0x1d4d6e,_0x206d44){var _0x5c8952={'role':_0x42e5('0x4a')};_0x5c8952[_0x1d4d6e]=this[_0x42e5('0xd')][_0x42e5('0x37')];this[_0x42e5('0xe')]['agentLogout'](_0x5c8952)[_0x42e5('0x12')](function(_0x41ef45){_0x206d44(null,_['isNil'](_0x41ef45)?![]:!![]);})[_0x42e5('0x13')](function(_0x4ce505){logger['error'](_0x4ce505);_0x206d44(null,![]);});};AGIVertices['prototype'][_0x42e5('0x4d')]=function(_0x41cac2,_0x3ebe7d){var _0x4f8cfd={'role':_0x42e5('0x4a')};_0x4f8cfd[_0x41cac2]=this['channel']['callerid'];var _0x405838=_0x41cac2!=_0x42e5('0x4e')?util[_0x42e5('0x25')](_0x42e5('0x4f'),_0x42e5('0x50'),this[_0x42e5('0xd')]['callerid']):undefined;this[_0x42e5('0xe')][_0x42e5('0x4d')](_0x4f8cfd,_0x405838)[_0x42e5('0x12')](function(_0x332337){_0x3ebe7d(null,_['isNil'](_0x332337)?![]:!![]);})[_0x42e5('0x13')](function(_0x22c541){logger['error'](_0x22c541);_0x3ebe7d(null,![]);});};AGIVertices[_0x42e5('0x14')][_0x42e5('0x51')]=function(_0x444ad8,_0x587e90){sh[_0x42e5('0x52')](_['trim'](_0x444ad8),function(_0x420171,_0x3f76e6){var _0x51a14a=_0x3f76e6[_0x42e5('0x53')](/(\r\n|\n|\r)/gm,'');_0x587e90(null,_0x51a14a);});};AGIVertices[_0x42e5('0x14')][_0x42e5('0x54')]=function(_0x46e502,_0x5522af){scripts['googleCloudTTS'](_0x46e502['apiKey'],_0x46e502['google_cloud_tts_text_type']||_0x42e5('0x55'),_0x46e502[_0x42e5('0x55')],_0x46e502[_0x42e5('0x56')]||_0x42e5('0x57'),_0x46e502[_0x42e5('0x58')]||_0x42e5('0x59'),_0x46e502[_0x42e5('0x5a')]||'MP3')[_0x42e5('0x12')](function(_0x1b91ef){_0x5522af(null,_0x1b91ef);})[_0x42e5('0x13')](function(_0xeac110){_0x5522af(_0xeac110);});};AGIVertices[_0x42e5('0x14')]['googleTTS']=function(_0xb7e265,_0x390d45){scripts[_0x42e5('0x5b')](_0xb7e265[_0x42e5('0x55')],_0xb7e265[_0x42e5('0x5c')]||'en',0x1)['then'](function(_0x568bd6){_0x390d45(null,_0x568bd6);})['catch'](function(_0x9bc545){_0x390d45(_0x9bc545);});};AGIVertices[_0x42e5('0x14')][_0x42e5('0x5d')]=function(_0x33dc18,_0x2ab943){var _0x2f7c45={'uri':_0x33dc18[_0x42e5('0x5e')],'method':_0x33dc18[_0x42e5('0x5f')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x33dc18[_0x42e5('0x60')])===_0x42e5('0x61')&&parseInt(_0x33dc18[_0x42e5('0x60')])>=0x1?parseInt(_0x33dc18[_0x42e5('0x60')])*0x3e8:0x5*0x3e8};if(_[_0x42e5('0x62')]([_0x42e5('0x63'),_0x42e5('0x64')],_0x2f7c45['method'][_0x42e5('0x65')]())){try{_0x2f7c45[_0x42e5('0x66')]=_0x33dc18['rawBody']?JSON['parse'](_0x33dc18[_0x42e5('0xa')]):{};}catch(_0x33032e){logger[_0x42e5('0x30')]('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x33032e);}}try{_0x2f7c45[_0x42e5('0x67')]=_0x33dc18[_0x42e5('0x68')]?JSON[_0x42e5('0x69')](_0x33dc18['rawHeaders']):{};}catch(_0x2d1107){logger[_0x42e5('0x30')]('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x2d1107);}if(_0x33dc18[_0x42e5('0x6a')]){try{var _0x5b6ad1=require(_0x33dc18[_0x42e5('0x6a')])[_0x42e5('0x6b')](this,_0x2f7c45);_0x2f7c45['uri']=Mustache[_0x42e5('0x6c')](_0x33dc18[_0x42e5('0x5e')],_0x5b6ad1,{},['$$','$$']);if(_0x2f7c45[_0x42e5('0x67')]){_0x2f7c45[_0x42e5('0x67')]=JSON[_0x42e5('0x69')](Mustache['render'](JSON[_0x42e5('0x6d')](_0x2f7c45[_0x42e5('0x67')]),_0x5b6ad1,{},['$$','$$']));}if(_0x2f7c45[_0x42e5('0x66')]){_0x2f7c45[_0x42e5('0x66')]=JSON[_0x42e5('0x69')](Mustache[_0x42e5('0x6c')](JSON[_0x42e5('0x6d')](_0x2f7c45[_0x42e5('0x66')]),_0x5b6ad1,{},['$$','$$']));}}catch(_0x1436d2){logger['error'](_0x42e5('0x6e'),_0x1436d2);}}rp(_0x2f7c45)[_0x42e5('0x12')](function(_0xa00cbe){var _0x2eb14a={'statusCode':_0xa00cbe[_0x42e5('0x6f')]||0xc8,'statusMessage':_0xa00cbe['statusMessage']||'OK','headers':_0xa00cbe[_0x42e5('0x67')]||{},'body':_0xa00cbe[_0x42e5('0x66')]||{}};_0x2ab943(null,_0x2eb14a);})[_0x42e5('0x13')](function(_0x49e655){var _0xf3f3ac={'statusCode':_0x49e655['statusCode']||0x1f4,'statusMessage':_0x49e655['message']||_0x42e5('0x70'),'headers':_0x49e655[_0x42e5('0x71')][_0x42e5('0x67')]||{},'body':_0x49e655[_0x42e5('0x71')][_0x42e5('0x66')]||{}};_0x2ab943(null,_0xf3f3ac);});};AGIVertices['prototype']['googleDialogflow']=function(_0xdfb887,_0x53e085){scripts[_0x42e5('0x72')](this[_0x42e5('0xd')][_0x42e5('0x35')],_0xdfb887[_0x42e5('0x73')],_0xdfb887[_0x42e5('0x55')],_0xdfb887[_0x42e5('0x74')]||'en')[_0x42e5('0x12')](function(_0x1095b2){_0x53e085(null,_0x1095b2);})[_0x42e5('0x13')](function(_0x2c991c){_0x53e085(_0x2c991c);});};AGIVertices[_0x42e5('0x14')][_0x42e5('0x75')]=function(_0x4ab176,_0x2bef76){scripts[_0x42e5('0x75')](this[_0x42e5('0xd')]['uniqueid'],_0x4ab176[_0x42e5('0x76')],_0x4ab176['client_email'],_0x4ab176['private_key'],_0x4ab176[_0x42e5('0x55')],_0x4ab176[_0x42e5('0x77')]||'en')[_0x42e5('0x12')](function(_0x5b1d30){_0x2bef76(null,_0x5b1d30);})[_0x42e5('0x13')](function(_0x3771c6){_0x2bef76(_0x3771c6);});};AGIVertices[_0x42e5('0x14')][_0x42e5('0x78')]=function(_0x2cd5b1,_0x591e85){scripts[_0x42e5('0x78')](this[_0x42e5('0xd')],_0x2cd5b1)[_0x42e5('0x12')](function(_0x311c19){_0x591e85(null,_0x311c19);})[_0x42e5('0x13')](function(_0x52c1d3){_0x591e85(_0x52c1d3);});};AGIVertices[_0x42e5('0x14')][_0x42e5('0x79')]=function(_0x488d44,_0x1e3245){scripts[_0x42e5('0x79')](_0x488d44[_0x42e5('0x73')],_0x488d44[_0x42e5('0x55')],_0x488d44['ispeech_tts_language']||_0x42e5('0x57'),_0x488d44[_0x42e5('0x7a')])[_0x42e5('0x12')](function(_0x3e3a6e){_0x1e3245(null,_0x3e3a6e);})[_0x42e5('0x13')](function(_0x42caf8){_0x1e3245(_0x42caf8);});};AGIVertices[_0x42e5('0x14')][_0x42e5('0x7b')]=function(_0x1d25b5,_0x50df63,_0x3aea01){scripts[_0x42e5('0x7b')](_0x50df63,_0x1d25b5['key'],_0x1d25b5[_0x42e5('0x7c')]||_0x42e5('0x57'),this[_0x42e5('0x7d')](_0x1d25b5[_0x42e5('0x7e')])?_0x1d25b5['model']:undefined)[_0x42e5('0x12')](function(_0x535e9c){_0x3aea01(null,_0x535e9c);})[_0x42e5('0x13')](function(_0x1dd0e8){_0x3aea01(_0x1dd0e8);});};AGIVertices['prototype'][_0x42e5('0x7f')]=function(_0x1be3d5,_0x231dd1){scripts['awsPolly'](_0x1be3d5[_0x42e5('0x80')],_0x1be3d5[_0x42e5('0x81')],_0x1be3d5['aws_polly_region'],_0x1be3d5[_0x42e5('0x82')]||_0x42e5('0x83'),_0x1be3d5[_0x42e5('0x55')],_0x1be3d5[_0x42e5('0x84')]||_0x42e5('0x55'))[_0x42e5('0x12')](function(_0x154f88){_0x231dd1(null,_0x154f88);})[_0x42e5('0x13')](function(_0x1676a0){_0x231dd1(_0x1676a0);});};AGIVertices[_0x42e5('0x14')][_0x42e5('0x85')]=function(_0x6c313c,_0x16ccd1){scripts[_0x42e5('0x85')](this[_0x42e5('0xd')][_0x42e5('0x35')],_0x6c313c[_0x42e5('0x80')],_0x6c313c[_0x42e5('0x81')],_0x6c313c[_0x42e5('0x86')],_0x6c313c['text'],_0x6c313c[_0x42e5('0x87')])[_0x42e5('0x12')](function(_0x492902){_0x16ccd1(null,_0x492902);})[_0x42e5('0x13')](function(_0x54a06c){_0x16ccd1(_0x54a06c);});};AGIVertices[_0x42e5('0x14')][_0x42e5('0x88')]=function(_0x2e98f4,_0x46cc1d,_0x9bacce){scripts[_0x42e5('0x88')](_0x46cc1d,_0x2e98f4[_0x42e5('0x73')],_0x2e98f4[_0x42e5('0x89')]||_0x42e5('0x57'))[_0x42e5('0x12')](function(_0x324bfa){_0x9bacce(null,_0x324bfa);})['catch'](function(_0x503d69){_0x9bacce(_0x503d69);});};AGIVertices['prototype'][_0x42e5('0x8a')]=function(_0x322275,_0x4d3d87,_0xf6b77f){scripts[_0x42e5('0x8a')](_0x4d3d87,_0x322275[_0x42e5('0x8b')],_0x322275['appsecret'],_0x322275['uri'])[_0x42e5('0x12')](function(_0xc30912){_0xf6b77f(null,_0xc30912);})[_0x42e5('0x13')](function(_0xea7807){_0xf6b77f(_0xea7807);});};AGIVertices['prototype']['clear']=function(_0x1ca3f2){var _0x27fad6=_['includes'](verticesWithRetry,_0x1ca3f2['agicommand'])?_0x1ca3f2:_['clone'](_0x1ca3f2);for(var _0x73ad1 in _0x27fad6){if(_0x27fad6[_0x42e5('0x8c')](_0x73ad1)){if(_0x27fad6[_0x73ad1]&&_[_0x42e5('0x8d')](_0x27fad6[_0x73ad1])){if(_[_0x42e5('0x62')](recursiveMapAttributes,_0x73ad1)){_0x27fad6[_0x73ad1]=this['replaceObjectAllVariables'](_0x27fad6[_0x73ad1]);}else{_0x27fad6[_0x73ad1]=this[_0x42e5('0x8e')](_0x27fad6[_0x73ad1]);}}}}return _0x27fad6;};AGIVertices['prototype'][_0x42e5('0x8f')]=function(_0x27c67d){for(var _0x3d1ba1 in _0x27c67d){if(_0x27c67d['hasOwnProperty'](_0x3d1ba1)){if(_[_0x42e5('0x90')](_0x27c67d[_0x3d1ba1])){this['recursiveNodeIndex'](_0x27c67d[_0x3d1ba1]);}else if(_['isArray'](_0x27c67d[_0x3d1ba1])){for(var _0x146d6c=0x0;_0x146d6c<_0x27c67d[_0x3d1ba1][_0x42e5('0x91')];_0x146d6c++){this['recursiveNodeIndex'](_0x27c67d[_0x3d1ba1][_0x146d6c]);}}else if(_[_0x42e5('0x8d')](_0x27c67d[_0x3d1ba1])){_0x27c67d[_0x3d1ba1]=this[_0x42e5('0x8e')](_0x27c67d[_0x3d1ba1]);}}}};AGIVertices[_0x42e5('0x14')][_0x42e5('0x92')]=function(_0x33ccec,_0x28493e){for(var _0x34c86d in _0x33ccec){if(_0x33ccec[_0x42e5('0x8c')](_0x34c86d)){if(_[_0x42e5('0x90')](_0x33ccec[_0x34c86d])){if(!_[_0x42e5('0x41')](_0x33ccec[_0x34c86d])){this[_0x42e5('0x92')](_0x33ccec[_0x34c86d],util[_0x42e5('0x25')](_0x42e5('0x93'),_0x28493e,_0x34c86d));}}else if(_['isArray'](_0x33ccec[_0x34c86d])){for(var _0x469b3e=0x0;_0x469b3e<_0x33ccec[_0x34c86d][_0x42e5('0x91')];_0x469b3e++){this['saveRestApiResult'](_0x33ccec[_0x34c86d][_0x469b3e],util[_0x42e5('0x25')](_0x42e5('0x93'),_0x28493e,_0x34c86d+'['+_0x469b3e+']'));}}else{if(!_[_0x42e5('0x40')](_0x33ccec[_0x34c86d])){this[_0x42e5('0xd')][_0x42e5('0x94')](util[_0x42e5('0x25')](_0x42e5('0x93'),_0x28493e,_0x34c86d),_0x33ccec[_0x34c86d]);}}}}};AGIVertices[_0x42e5('0x14')]['replaceObjectAllVariables']=function(_0x208593){try{var _0x2df60f=JSON[_0x42e5('0x69')](_0x208593);this[_0x42e5('0x8f')](_0x2df60f);return JSON[_0x42e5('0x6d')](_0x2df60f);}catch(_0x4cd088){return this['replaceAllVariables'](_0x208593);}};AGIVertices['prototype'][_0x42e5('0x8e')]=function(_0x2e8c3e){var _0x4c4c0b=_0x2e8c3e[_0x42e5('0x95')]('{');for(var _0x4e22ca=0x1;_0x4e22ca<_0x4c4c0b[_0x42e5('0x91')];_0x4e22ca+=0x1){var _0x1e93bc=_0x4c4c0b[_0x4e22ca][_0x42e5('0x95')]('}');if(_0x1e93bc['length']>0x1){_0x2e8c3e=_0x2e8c3e[_0x42e5('0x96')]('{'+_0x1e93bc[0x0]+'}',this[_0x42e5('0xd')][_0x42e5('0x10')](_0x1e93bc[0x0])['extra']||_0x1e93bc[0x0]);}}if(_0x4c4c0b[_0x42e5('0x91')]===0x1){return _0x2e8c3e[_0x42e5('0x47')]();}return this[_0x42e5('0x8e')](_0x2e8c3e);};AGIVertices['prototype']['getAndSetVariable']=function(_0x4e5e65,_0x238b43){var _0x169900=this[_0x42e5('0xd')][_0x42e5('0x10')](_0x4e5e65);if(_0x169900['result']===-0x1){return _0x169900;}logger[_0x42e5('0x2a')](util['format'](_0x42e5('0x97'),_0x238b43,_0x169900[_0x42e5('0x98')]));return this[_0x42e5('0xd')][_0x42e5('0x94')](_0x238b43,_0x169900[_0x42e5('0x98')]);};AGIVertices[_0x42e5('0x14')]['isConfigured']=function(_0x5c4b69){return _0x5c4b69&&_0x5c4b69!=='0'&&_0x5c4b69!=='-1'&&_0x5c4b69!=='';};AGIVertices['prototype'][_0x42e5('0x99')]=function(_0x3976e7){this[_0x42e5('0x9a')][_0x42e5('0x6b')](this,_0x3976e7,'-');_0x3976e7[_0x42e5('0x9b')]=_0x3976e7[_0x42e5('0x99')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x42e5('0x14')][_0x42e5('0x9c')]=function(_0x1fb455){logger['info'](util['format']('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0x1fb455[_0x42e5('0x9d')]));if(!this[_0x42e5('0x7d')](_0x1fb455['text'])){return this[_0x42e5('0xd')]['noop']('no\x20text\x20configured');}var _0x29fd5b='\x22'+_0x1fb455[_0x42e5('0x55')]+'\x22';if(this[_0x42e5('0x7d')](_0x1fb455[_0x42e5('0x71')])){_0x29fd5b+=','+_0x1fb455[_0x42e5('0x71')];}var _0x2c4ccd=this[_0x42e5('0xd')]['exec'](_0x42e5('0x9e'),_0x29fd5b);if(_0x2c4ccd[_0x42e5('0x9f')]===-0x1){return _0x2c4ccd;}return this['channel']['noop'](util[_0x42e5('0x25')](_0x42e5('0xa0'),_0x29fd5b));};AGIVertices[_0x42e5('0x14')][_0x42e5('0xa1')]=function(_0xd0edc2){logger[_0x42e5('0x2a')](util[_0x42e5('0x25')]('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0xd0edc2[_0x42e5('0x9d')]));if(!this[_0x42e5('0x7d')](_0xd0edc2[_0x42e5('0xa2')])){return this[_0x42e5('0xd')][_0x42e5('0xa3')](_0x42e5('0xa4'));}var _0x2372f5=_0xd0edc2[_0x42e5('0xa2')];if(this[_0x42e5('0x7d')](_0xd0edc2[_0x42e5('0x71')])){_0x2372f5+=','+_0xd0edc2[_0x42e5('0x71')];}var _0x6eb226=this[_0x42e5('0xd')][_0x42e5('0x52')]('MRCPRecog',_0x2372f5);if(_0x6eb226[_0x42e5('0x9f')]===-0x1){return _0x6eb226;}var _0x2516a1=this[_0x42e5('0xa5')](_0x42e5('0xa6'),'MRCP_RECOG_CONFIDENCE');if(_0x2516a1[_0x42e5('0x9f')]===-0x1){return _0x2516a1;}var _0x4ad0a1=this[_0x42e5('0xa5')](_0x42e5('0xa7'),_0x42e5('0xa8'));if(_0x4ad0a1[_0x42e5('0x9f')]===-0x1){return _0x4ad0a1;}var _0x2bf154=this[_0x42e5('0xa5')](_0x42e5('0xa9'),_0x42e5('0xaa'));if(_0x2bf154['result']===-0x1){return _0x2bf154;}return this[_0x42e5('0xd')][_0x42e5('0xa3')](util['format'](_0x42e5('0xab'),_0x2372f5));};AGIVertices[_0x42e5('0x14')][_0x42e5('0x7')]=function(_0x166f57){logger['info'](util[_0x42e5('0x25')](_0x42e5('0xac'),_0x166f57[_0x42e5('0x9d')]));return this[_0x42e5('0xd')][_0x42e5('0x7')]([_0x166f57[_0x42e5('0xad')],_0x166f57[_0x42e5('0xae')]]);};AGIVertices['prototype'][_0x42e5('0xaf')]=function(_0x263103){logger['info'](util[_0x42e5('0x25')](_0x42e5('0xb0'),_0x263103[_0x42e5('0x9d')]));if(this[_0x42e5('0x7d')](_0x263103[_0x42e5('0x60')])){logger[_0x42e5('0x2a')](util['format'](_0x42e5('0xb1'),_0x263103[_0x42e5('0x60')]));var _0x1451a8=this[_0x42e5('0xd')][_0x42e5('0xb2')](_0x263103[_0x42e5('0x60')]);if(_0x1451a8[_0x42e5('0x9f')]===-0x1){return _0x1451a8;}}return this[_0x42e5('0xd')][_0x42e5('0xaf')]();};AGIVertices[_0x42e5('0x14')][_0x42e5('0xb3')]=function(_0x5b6f15){logger[_0x42e5('0x2a')](util[_0x42e5('0x25')]('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x5b6f15[_0x42e5('0x9d')]));if(!this[_0x42e5('0x7d')](_0x5b6f15[_0x42e5('0x44')])){return this[_0x42e5('0xd')]['error'](_0x5b6f15,_0x42e5('0xb4'));}_0x5b6f15[_0x42e5('0x45')]=moment();if(this['isConfigured'](_0x5b6f15[_0x42e5('0xb5')])){_0x5b6f15[_0x42e5('0x45')]=moment()['add'](_0x5b6f15['delay'],_0x42e5('0xb6'));}if(!this[_0x42e5('0x7d')](_0x5b6f15[_0x42e5('0xb7')])){_0x5b6f15[_0x42e5('0xb7')]=0x2;}this[_0x42e5('0x3f')]['sync'](this,_0x5b6f15);return this['channel'][_0x42e5('0xa3')](util[_0x42e5('0x25')]('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x5b6f15['phone'],_0x5b6f15['list_id'],_0x5b6f15[_0x42e5('0x45')]));};AGIVertices['prototype'][_0x42e5('0xb8')]=function(_0x4f417b){logger[_0x42e5('0x2a')](util[_0x42e5('0x25')](_0x42e5('0xb9'),_0x4f417b['label']));var _0x5b7244=this['channel'][_0x42e5('0x52')](_0x4f417b[_0x42e5('0xba')],_0x4f417b[_0x42e5('0x71')]);if(_0x5b7244[_0x42e5('0x9f')]===-0x1){return _0x5b7244;}return this[_0x42e5('0xd')][_0x42e5('0xa3')](util[_0x42e5('0x25')]('Executed\x20command\x20%s\x20%s',_0x4f417b[_0x42e5('0xba')],_0x4f417b[_0x42e5('0x71')]));};AGIVertices[_0x42e5('0x14')][_0x42e5('0xbb')]=function(_0x2bd3fc){logger[_0x42e5('0x2a')](util[_0x42e5('0x25')](_0x42e5('0xbc'),_0x2bd3fc[_0x42e5('0x9d')]));if(!this[_0x42e5('0x7d')](_0x2bd3fc[_0x42e5('0x55')])){return this[_0x42e5('0xd')]['noop'](_0x42e5('0xbd'));}var _0x29fd40='\x22'+_0x2bd3fc['text']+'\x22';if(this[_0x42e5('0x7d')](_0x2bd3fc['options'])){_0x29fd40+=','+_0x2bd3fc[_0x42e5('0x71')];}var _0x372dc8=this[_0x42e5('0xd')]['exec'](_0x42e5('0x9e'),_0x29fd40);if(_0x372dc8['result']===-0x1){return _0x372dc8;}return this[_0x42e5('0xd')]['noop'](util['format'](_0x42e5('0xa0'),_0x29fd40));};AGIVertices[_0x42e5('0x14')][_0x42e5('0xbe')]=function(_0x36c1fd){logger[_0x42e5('0x2a')](util['format'](_0x42e5('0xbf'),_0x36c1fd[_0x42e5('0x9d')]));if(!this[_0x42e5('0x7d')](_0x36c1fd[_0x42e5('0x55')])){return this[_0x42e5('0xd')][_0x42e5('0xa3')](_0x42e5('0xbd'));}var _0x55db8d='\x22'+_0x36c1fd['text']+'\x22';if(this[_0x42e5('0x7d')](_0x36c1fd[_0x42e5('0x71')])){_0x55db8d+=','+_0x36c1fd[_0x42e5('0x71')];}var _0x1a2afd=this['channel'][_0x42e5('0x52')]('MRCPSynth',_0x55db8d);if(_0x1a2afd[_0x42e5('0x9f')]===-0x1){return _0x1a2afd;}return this[_0x42e5('0xd')][_0x42e5('0xa3')](util[_0x42e5('0x25')]('Executed\x20command\x20MRCPSynth\x20%s',_0x55db8d));};AGIVertices[_0x42e5('0x14')][_0x42e5('0xc0')]=function(_0x344871){logger[_0x42e5('0x2a')](util[_0x42e5('0x25')](_0x42e5('0xc1'),_0x344871[_0x42e5('0x9d')]));if(!this[_0x42e5('0x7d')](_0x344871[_0x42e5('0xa2')])){return this['channel'][_0x42e5('0xa3')](_0x42e5('0xa4'));}var _0x1ae1c9=_0x344871['grammar'];if(this[_0x42e5('0x7d')](_0x344871[_0x42e5('0x71')])){_0x1ae1c9+=','+_0x344871[_0x42e5('0x71')];}var _0x4785c6=this[_0x42e5('0xd')]['exec'](_0x42e5('0xc2'),_0x1ae1c9);if(_0x4785c6[_0x42e5('0x9f')]===-0x1){return _0x4785c6;}var _0x417b25=this['getAndSetVariable'](_0x42e5('0xa6'),_0x42e5('0xc3'));if(_0x417b25[_0x42e5('0x9f')]===-0x1){return _0x417b25;}var _0x3e4664=this['getAndSetVariable'](_0x42e5('0xa7'),'LUMENVOX_ASR_TRANSCRIPT');if(_0x3e4664['result']===-0x1){return _0x3e4664;}var _0x20b126=this['getAndSetVariable'](_0x42e5('0xa9'),_0x42e5('0xc4'));if(_0x20b126[_0x42e5('0x9f')]===-0x1){return _0x20b126;}return this[_0x42e5('0xd')][_0x42e5('0xa3')](util[_0x42e5('0x25')](_0x42e5('0xab'),_0x1ae1c9));};AGIVertices['prototype'][_0x42e5('0xc5')]=function(_0xe8f030){logger[_0x42e5('0x2a')](util['format'](_0x42e5('0xc6'),_0xe8f030[_0x42e5('0x9d')]));if(!this[_0x42e5('0x7d')](_0xe8f030[_0x42e5('0xa2')])){return this['channel'][_0x42e5('0xa3')](_0x42e5('0xa4'));}var _0x43295d=_0xe8f030[_0x42e5('0xa2')];if(this[_0x42e5('0x7d')](_0xe8f030['options'])){_0x43295d+=','+_0xe8f030['options'];}var _0x1b66cf=this[_0x42e5('0xd')][_0x42e5('0x52')](_0x42e5('0xc2'),_0x43295d);if(_0x1b66cf['result']===-0x1){return _0x1b66cf;}var _0x4406ff=this[_0x42e5('0xa5')](_0x42e5('0xa6'),'SESTEK_ASR_CONFIDENCE');if(_0x4406ff[_0x42e5('0x9f')]===-0x1){return _0x4406ff;}var _0x57706e=this[_0x42e5('0xa5')]('RECOG_INPUT()','SESTEK_ASR_TRANSCRIPT');if(_0x57706e['result']===-0x1){return _0x57706e;}var _0x3fdfb8=this[_0x42e5('0xa5')]('RECOG_INSTANCE()',_0x42e5('0xc7'));if(_0x3fdfb8[_0x42e5('0x9f')]===-0x1){return _0x3fdfb8;}return this['channel'][_0x42e5('0xa3')](util['format']('Executed\x20command\x20MRCPRecog\x20%s',_0x43295d));};AGIVertices['prototype'][_0x42e5('0xc8')]=function(_0x5b7c48){logger['info'](util[_0x42e5('0x25')](_0x42e5('0xc9'),_0x5b7c48['label']));if(!this['isConfigured'](_0x5b7c48['odbc_id'])){return this[_0x42e5('0xd')]['error'](_0x5b7c48,_0x42e5('0xca'));}var _0x2b81eb=this[_0x42e5('0xcb')][_0x42e5('0x6b')](this,_0x5b7c48[_0x42e5('0xcc')]);if(!_0x2b81eb){return this[_0x42e5('0xd')]['error'](_0x5b7c48,_0x42e5('0xcd'));}if(!this[_0x42e5('0x7d')](_0x5b7c48['query'])){return this['channel'][_0x42e5('0x30')](_0x5b7c48,_0x42e5('0xce'));}var _0x15ab89=_0x5b7c48[_0x42e5('0x2c')][_0x42e5('0x53')](/(\r\n|\n|\r)/gm,'\x20');this[_0x42e5('0xd')]['noop'](util[_0x42e5('0x25')](_0x42e5('0xcf'),_0x15ab89));var _0x17e10c=this[_0x42e5('0x27')]['sync'](this,_0x2b81eb,_0x15ab89);this[_0x42e5('0x9a')]['sync'](this,_0x5b7c48,_0x15ab89);if(!this[_0x42e5('0x7d')](_0x5b7c48[_0x42e5('0xd0')])){return this['channel'][_0x42e5('0xa3')](_0x42e5('0xd1'));}var _0x3a22b7=this[_0x42e5('0x10')][_0x42e5('0x6b')](this,_0x5b7c48[_0x42e5('0xd0')]);if(!_0x3a22b7){return this['channel'][_0x42e5('0x30')](_0x5b7c48,_0x42e5('0xd2'));}var _0x12b976=this;_0x17e10c[_0x42e5('0xd3')](function(_0x4b2cb8,_0x334989){Object[_0x42e5('0xd4')](_0x4b2cb8)['forEach'](function(_0x37b14f){_0x12b976[_0x42e5('0xd')][_0x42e5('0x94')](util['format']('%s[%s][%s]',_0x3a22b7,_0x334989,_0x37b14f),_0x4b2cb8[_0x37b14f]);});});this[_0x42e5('0xd')]['setVariable'](util[_0x42e5('0x25')](_0x42e5('0xd5'),_0x3a22b7),_0x17e10c['length']);return this['channel'][_0x42e5('0xa3')](util[_0x42e5('0x25')](_0x42e5('0xd6'),_0x3a22b7));};AGIVertices[_0x42e5('0x14')][_0x42e5('0xd7')]=function(_0x487861){logger[_0x42e5('0xd8')](util[_0x42e5('0x25')](_0x42e5('0xd9'),_0x487861[_0x42e5('0x9d')]));if(!this['isConfigured'](_0x487861[_0x42e5('0xda')])){return this[_0x42e5('0xd')][_0x42e5('0x30')](_0x487861,_0x42e5('0xdb'));}var _0x3b832f=this[_0x42e5('0x1a')][_0x42e5('0x6b')](this,_0x487861[_0x42e5('0xda')]);if(!_0x3b832f){return this['channel'][_0x42e5('0x30')](_0x487861,_0x42e5('0xdc'));}var _0x23d13a=this['channel']['exec'](_0x42e5('0xdd'),[util[_0x42e5('0x25')]('SIP/%s',_0x3b832f),_0x487861['timeout'],_0x487861[_0x42e5('0xde')],_0x487861[_0x42e5('0x5e')]]);if(_0x23d13a[_0x42e5('0x9f')]===-0x1){return _0x23d13a;}return this[_0x42e5('0xd')][_0x42e5('0xa3')](util['format'](_0x42e5('0xdf'),'DIAL'));};AGIVertices[_0x42e5('0x14')]['dialogflow']=function(_0x294019){logger[_0x42e5('0x2a')](util[_0x42e5('0x25')](_0x42e5('0xe0'),_0x294019[_0x42e5('0x9d')]));if(!this[_0x42e5('0x7d')](_0x294019['key'])){return this[_0x42e5('0xd')][_0x42e5('0xa3')]('no\x20key\x20configured');}if(!this['isConfigured'](_0x294019[_0x42e5('0x55')])){return this[_0x42e5('0xd')][_0x42e5('0xa3')](_0x42e5('0xbd'));}this[_0x42e5('0xd')][_0x42e5('0xe1')]=!![];this['createSquareDetailsReport'](_0x294019);this['createSquareMessage'](_0x294019[_0x42e5('0x55')],'in','','');this[_0x42e5('0xd')][_0x42e5('0xa3')](util[_0x42e5('0x25')]('Trying\x20Dialogflow:\x20%s',_0x294019['text']));var _0x1ed31e=this[_0x42e5('0x72')][_0x42e5('0x6b')](this,_0x294019);if(_0x1ed31e){for(var _0x4f28f7 in _0x1ed31e){if(_0x1ed31e['hasOwnProperty'](_0x4f28f7)){this['channel'][_0x42e5('0x94')](util[_0x42e5('0x25')]('DIALOGFLOW_%s',_0x4f28f7[_0x42e5('0x65')]()),_0x1ed31e[_0x4f28f7]);}}this[_0x42e5('0x3e')](_0x1ed31e['speech'],_0x42e5('0xe2'),_0x42e5('0xe3'),'');return this[_0x42e5('0xd')][_0x42e5('0xa3')](util[_0x42e5('0x25')](_0x42e5('0xe4'),_0x1ed31e[_0x42e5('0xe5')]));}return this[_0x42e5('0xd')][_0x42e5('0x30')](_0x294019,'Dialogflow\x20is\x20unreachable');};AGIVertices[_0x42e5('0x14')][_0x42e5('0xe6')]=function(_0x2e26e4){logger[_0x42e5('0x2a')](util[_0x42e5('0x25')](_0x42e5('0xe7'),_0x2e26e4[_0x42e5('0x9d')]));if(!this[_0x42e5('0x7d')](_0x2e26e4['dialogflowV2_project_id'])){return this[_0x42e5('0xd')]['noop']('no\x20project_id\x20configured');}if(!this['isConfigured'](_0x2e26e4[_0x42e5('0xe8')])){return this[_0x42e5('0xd')]['noop'](_0x42e5('0xe9'));}if(!this[_0x42e5('0x7d')](_0x2e26e4[_0x42e5('0xea')])){return this[_0x42e5('0xd')][_0x42e5('0xa3')]('no\x20private_key\x20configured');}if(!this['isConfigured'](_0x2e26e4[_0x42e5('0x77')])){return this[_0x42e5('0xd')][_0x42e5('0xa3')](_0x42e5('0xeb'));}if(!this['isConfigured'](_0x2e26e4[_0x42e5('0x55')])){return this[_0x42e5('0xd')][_0x42e5('0xa3')](_0x42e5('0xbd'));}this['channel'][_0x42e5('0xe1')]=!![];this[_0x42e5('0x9a')](_0x2e26e4);this[_0x42e5('0x3e')](_0x2e26e4[_0x42e5('0x55')],'in','','');this[_0x42e5('0xd')][_0x42e5('0xa3')](util[_0x42e5('0x25')](_0x42e5('0xec'),_0x2e26e4['text']));var _0x5090b2=this[_0x42e5('0x75')][_0x42e5('0x6b')](this,_0x2e26e4);if(_0x5090b2){for(var _0x3e661b in _0x5090b2){if(_0x5090b2['hasOwnProperty'](_0x3e661b)){if(_0x3e661b!==_0x42e5('0xed')){this[_0x42e5('0xd')][_0x42e5('0x94')](util[_0x42e5('0x25')]('DIALOGFLOW_%s',_0x3e661b[_0x42e5('0x65')]()),_0x5090b2[_0x3e661b]);}}}this[_0x42e5('0x3e')](_0x5090b2[_0x42e5('0xe5')],'out',_0x42e5('0xe6'),_0x5090b2[_0x42e5('0xed')]);return this['channel'][_0x42e5('0xa3')](util[_0x42e5('0x25')](_0x42e5('0xee'),_0x5090b2[_0x42e5('0xe5')]));}return this[_0x42e5('0xd')]['error'](_0x2e26e4,_0x42e5('0xef'));};AGIVertices[_0x42e5('0x14')][_0x42e5('0xf0')]=function(_0x1fcc78){logger[_0x42e5('0x2a')](util[_0x42e5('0x25')](_0x42e5('0xf1'),_0x1fcc78[_0x42e5('0x9d')]));if(!this[_0x42e5('0x7d')](_0x1fcc78[_0x42e5('0xf2')])){return this[_0x42e5('0xd')][_0x42e5('0xa3')](_0x42e5('0xf3'));}if(!this[_0x42e5('0x7d')](_0x1fcc78[_0x42e5('0xf4')])){return this[_0x42e5('0xd')]['noop']('no\x20username\x20configured');}if(!this[_0x42e5('0x7d')](_0x1fcc78[_0x42e5('0xf5')])){return this['channel'][_0x42e5('0xa3')](_0x42e5('0xf6'));}if(!this[_0x42e5('0x7d')](_0x1fcc78[_0x42e5('0xf7')])){return this[_0x42e5('0xd')][_0x42e5('0xa3')](_0x42e5('0xbd'));}this['channel']['bot']=!![];this[_0x42e5('0x9a')](_0x1fcc78);this['createSquareMessage'](_0x1fcc78[_0x42e5('0x55')],'in','','');this['channel'][_0x42e5('0xa3')](util[_0x42e5('0x25')](_0x42e5('0xf8'),_0x1fcc78[_0x42e5('0x55')]));var _0x8c27d5=this[_0x42e5('0x78')]['sync'](this,_0x1fcc78);if(_0x8c27d5){for(var _0x59fd8f in _0x8c27d5){if(_0x8c27d5[_0x42e5('0x8c')](_0x59fd8f)){this[_0x42e5('0xd')][_0x42e5('0x94')](util['format'](_0x42e5('0xf9'),_0x59fd8f[_0x42e5('0x65')]()),_0x8c27d5[_0x59fd8f]);}}this[_0x42e5('0x3e')](_0x8c27d5[_0x42e5('0xe5')],'out','sesteknda','');if(_0x8c27d5['audiofile']){this[_0x42e5('0xd')][_0x42e5('0xa3')](util[_0x42e5('0x25')](_0x42e5('0xfa'),_0x8c27d5[_0x42e5('0xfb')]));var _0x2fbe56=this[_0x42e5('0xd')][_0x42e5('0xfc')](_0x8c27d5[_0x42e5('0xfb')]);try{fs[_0x42e5('0xfd')](_0x8c27d5['audiofile']+_0x42e5('0xfe'));}catch(_0x49479d){logger['error'](_0x49479d);}return _0x2fbe56;}else{return this[_0x42e5('0xd')][_0x42e5('0xa3')](util[_0x42e5('0x25')](_0x42e5('0xff'),_0x8c27d5[_0x42e5('0xe5')]));}}return this[_0x42e5('0xd')][_0x42e5('0x30')](_0x1fcc78,_0x42e5('0x100'));};AGIVertices[_0x42e5('0x14')][_0x42e5('0x101')]=function(_0x46467f){logger[_0x42e5('0x2a')](util[_0x42e5('0x25')](_0x42e5('0x102'),_0x46467f[_0x42e5('0x9d')]));return this[_0x42e5('0xd')][_0x42e5('0xa3')](_0x42e5('0x101'));};AGIVertices[_0x42e5('0x14')][_0x42e5('0x103')]=function(_0x3e144b){logger['info'](util[_0x42e5('0x25')](_0x42e5('0x104'),_0x3e144b['label']));var _0x14310b='';if(_0x3e144b['trunk_id']){if(!this[_0x42e5('0x7d')](_0x3e144b[_0x42e5('0x105')])){return this[_0x42e5('0xd')]['error'](_0x3e144b,'no\x20trunk\x20selected');}else{var _0x49e379=parseInt(_0x3e144b[_0x42e5('0x105')],0xa);if(isNaN(_0x49e379)){_0x14310b=_0x3e144b[_0x42e5('0x105')];}else{_0x14310b=this[_0x42e5('0x1b')][_0x42e5('0x6b')](this,_0x3e144b[_0x42e5('0x105')]);if(!_0x14310b){return this[_0x42e5('0xd')][_0x42e5('0x30')](_0x3e144b,_0x42e5('0x106'));}}}}else if(_0x3e144b[_0x42e5('0x107')]){_0x14310b=_0x3e144b[_0x42e5('0x107')];}else{return this[_0x42e5('0xd')][_0x42e5('0x30')](_0x3e144b,_0x42e5('0x108'));}var _0x163d3b=this[_0x42e5('0xd')][_0x42e5('0x52')](_0x42e5('0xdd'),[util[_0x42e5('0x25')]('SIP/%s/%s',_0x14310b,_0x3e144b[_0x42e5('0x43')]),_0x3e144b[_0x42e5('0x60')],_0x3e144b['opts'],_0x3e144b[_0x42e5('0x5e')]]);if(_0x163d3b['result']===-0x1){return _0x163d3b;}return this[_0x42e5('0xd')][_0x42e5('0xa3')](util[_0x42e5('0x25')](_0x42e5('0xdf'),_0x42e5('0xdd')));};AGIVertices['prototype'][_0x42e5('0x109')]=function(_0x105053){logger[_0x42e5('0x2a')](util[_0x42e5('0x25')](_0x42e5('0x10a'),_0x105053[_0x42e5('0x9d')]));return this[_0x42e5('0xd')][_0x42e5('0xa3')](_0x42e5('0x109'));};AGIVertices[_0x42e5('0x14')]['getdigits']=function(_0x4b6cbd){logger[_0x42e5('0x2a')](util[_0x42e5('0x25')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x4b6cbd['label']));if(_0x4b6cbd['retry']===0x0){return this['maxRetry'](_0x4b6cbd);}_0x4b6cbd[_0x42e5('0x9b')]-=0x1;if(!this[_0x42e5('0x7d')](_0x4b6cbd[_0x42e5('0x10b')])){return this[_0x42e5('0xd')][_0x42e5('0x30')](_0x4b6cbd,'no\x20file\x20audio\x20selected');}var _0x1da679=this[_0x42e5('0x1c')][_0x42e5('0x6b')](this,_0x4b6cbd[_0x42e5('0x10b')]);if(!_0x1da679){return this[_0x42e5('0xd')][_0x42e5('0x30')](_0x4b6cbd,'no\x20file\x20audio\x20found');}if(!this['isConfigured'](_0x4b6cbd['variable_id'])){return this[_0x42e5('0xd')]['error'](_0x42e5('0xd1'));}var _0x2f1ab6=this[_0x42e5('0xd')][_0x42e5('0x10c')](_0x1da679,_0x4b6cbd[_0x42e5('0x10d')],_0x4b6cbd[_0x42e5('0x10e')]);var _0x9a213e=_0x2f1ab6[_0x42e5('0x9f')]?_0x2f1ab6[_0x42e5('0x9f')]['toString']():'';logger['info'](_0x42e5('0x10f'),JSON['stringify'](_0x2f1ab6));if(_0x2f1ab6[_0x42e5('0x9f')]===-0x1){this[_0x42e5('0x9a')]['sync'](this,_0x4b6cbd,_0x9a213e);return _0x2f1ab6;}else if(_0x2f1ab6[_0x42e5('0x98')]===_0x42e5('0x60')){_0x2f1ab6[_0x42e5('0x9f')]=_0x9a213e['length']>=parseInt(_0x4b6cbd[_0x42e5('0x110')])?'x':'i';}else{_0x2f1ab6[_0x42e5('0x9f')]=_0x9a213e[_0x42e5('0x91')]>=parseInt(_0x4b6cbd['mindigit'])&&_0x9a213e[_0x42e5('0x91')]<=parseInt(_0x4b6cbd[_0x42e5('0x10e')])?'x':'i';}var _0x609b4b=this['getVariable'][_0x42e5('0x6b')](this,_0x4b6cbd[_0x42e5('0xd0')]);if(!_0x609b4b){return this[_0x42e5('0xd')]['error'](_0x4b6cbd,_0x42e5('0xd2'));}this['channel'][_0x42e5('0x94')](_0x609b4b,_0x9a213e);if(this[_0x42e5('0x7d')](_0x4b6cbd[_0x42e5('0x111')])){var _0xfca3ed=parseInt(_0x4b6cbd[_0x42e5('0x111')],0xa);var _0x2b6efd=rs[_0x42e5('0x112')]({'charset':'*','length':_0xfca3ed});var _0x42abf4=_0x9a213e[_0x42e5('0x91')];if(_0x42abf4>0x0){if(_0x42abf4>_0xfca3ed){this[_0x42e5('0x9a')][_0x42e5('0x6b')](this,_0x4b6cbd,_0x4b6cbd['hiddendigitspos']===_0x42e5('0x113')?_0x2b6efd+_0x9a213e[_0x42e5('0x114')](_0xfca3ed):_0x9a213e[_0x42e5('0x114')](0x0,_0x42abf4-_0xfca3ed)+_0x2b6efd);}else{this['createSquareDetailsReport'][_0x42e5('0x6b')](this,_0x4b6cbd,rs[_0x42e5('0x112')]({'charset':'*','length':_0x42abf4}));}}else{this[_0x42e5('0x9a')]['sync'](this,_0x4b6cbd,'');}}else{this[_0x42e5('0x9a')]['sync'](this,_0x4b6cbd,_0x9a213e);}return _0x2f1ab6;};AGIVertices[_0x42e5('0x14')][_0x42e5('0xc')]=function(_0x57fd23){logger[_0x42e5('0x2a')](util[_0x42e5('0x25')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x57fd23[_0x42e5('0x9d')]));return this[_0x42e5('0x115')](_0x57fd23);};AGIVertices[_0x42e5('0x14')][_0x42e5('0x116')]=function(_0x138067){logger[_0x42e5('0x2a')](util['format'](_0x42e5('0x117'),_0x138067['label']));this[_0x42e5('0x9a')][_0x42e5('0x6b')](this,_0x138067,_0x138067[_0x42e5('0x118')]);return this[_0x42e5('0xd')][_0x42e5('0xa3')](util[_0x42e5('0x25')](_0x42e5('0x119'),_0x138067[_0x42e5('0x118')]));};AGIVertices[_0x42e5('0x14')][_0x42e5('0x11a')]=function(_0x440d46){logger[_0x42e5('0x2a')](util['format'](_0x42e5('0x11b'),_0x440d46[_0x42e5('0x9d')]));if(!this[_0x42e5('0x7d')](_0x440d46[_0x42e5('0x80')])||!this[_0x42e5('0x7d')](_0x440d46[_0x42e5('0x81')])){return this[_0x42e5('0xd')]['noop'](_0x42e5('0x11c'));}if(!this[_0x42e5('0x7d')](_0x440d46[_0x42e5('0x55')])){return this['channel']['noop'](_0x42e5('0xbd'));}this[_0x42e5('0xd')][_0x42e5('0xa3')](util['format'](_0x42e5('0x11d'),_0x440d46[_0x42e5('0x55')]));var _0x2305ec=this[_0x42e5('0x7f')]['sync'](this,_0x440d46);if(_0x2305ec){this[_0x42e5('0xd')]['noop'](util[_0x42e5('0x25')](_0x42e5('0x11e'),_0x2305ec));var _0x38758=this[_0x42e5('0xd')][_0x42e5('0xfc')](_0x2305ec);try{fs[_0x42e5('0xfd')](_0x2305ec+'.wav');}catch(_0x1a540c){logger['error'](_0x1a540c);}return _0x38758;}return this[_0x42e5('0xd')][_0x42e5('0x30')](_0x440d46,_0x42e5('0x11f'));};AGIVertices[_0x42e5('0x14')][_0x42e5('0x120')]=function(_0x3e9552){logger[_0x42e5('0x2a')](util['format'](_0x42e5('0x121'),_0x3e9552['label']));if(!this['isConfigured'](_0x3e9552[_0x42e5('0x80')])||!this['isConfigured'](_0x3e9552[_0x42e5('0x81')])){return this[_0x42e5('0xd')][_0x42e5('0xa3')]('no\x20valid\x20credentials\x20configured');}if(!this[_0x42e5('0x7d')](_0x3e9552['aws_bot_name'])){return this[_0x42e5('0xd')][_0x42e5('0xa3')](_0x42e5('0x122'));}if(!this[_0x42e5('0x7d')](_0x3e9552[_0x42e5('0x55')])){return this[_0x42e5('0xd')][_0x42e5('0xa3')](_0x42e5('0xbd'));}this[_0x42e5('0xd')]['bot']=!![];this['createSquareDetailsReport'](_0x3e9552);this[_0x42e5('0x3e')](_0x3e9552[_0x42e5('0x55')],'in','','');this[_0x42e5('0xd')][_0x42e5('0xa3')](util['format']('Trying\x20Amazon\x20Lex:\x20%s',_0x3e9552[_0x42e5('0x55')]));var _0x2a0ac4=this['awsLex'][_0x42e5('0x6b')](this,_0x3e9552);if(_0x2a0ac4){for(var _0x252453 in _0x2a0ac4){if(_0x2a0ac4[_0x42e5('0x8c')](_0x252453)&&_[_0x42e5('0x8d')](_0x2a0ac4[_0x252453])){this['channel'][_0x42e5('0x94')](util[_0x42e5('0x25')](_0x42e5('0x123'),_0x252453[_0x42e5('0x65')]()),_0x2a0ac4[_0x252453]);}}if(_[_0x42e5('0x40')](_0x2a0ac4['message'])){return this[_0x42e5('0xd')][_0x42e5('0xa3')]('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0x42e5('0x3e')](_0x2a0ac4[_0x42e5('0x124')],_0x42e5('0xe2'),_0x42e5('0x125'),'');return this[_0x42e5('0xd')][_0x42e5('0xa3')](util[_0x42e5('0x25')]('Amazon\x20Lex\x20Result\x20%s',_0x2a0ac4[_0x42e5('0x124')]));}}return this[_0x42e5('0xd')][_0x42e5('0x30')](_0x3e9552,_0x42e5('0x126'));};AGIVertices[_0x42e5('0x14')][_0x42e5('0x127')]=function(_0x288f7e){logger[_0x42e5('0x2a')](util[_0x42e5('0x25')](_0x42e5('0x128'),_0x288f7e[_0x42e5('0x9d')],_0x288f7e['timeout']));if(!this['isConfigured'](_0x288f7e[_0x42e5('0x73')])){return this[_0x42e5('0xd')][_0x42e5('0xa3')](_0x42e5('0x129'));}var _0x45ccee=_0x42e5('0x12a');var _0x4f6503=util['format'](_0x42e5('0x12b'),FILES_PATH,rs[_0x42e5('0x112')](0x4));var _0x3b0d1c=util['format'](_0x42e5('0x93'),_0x4f6503,_0x45ccee);var _0x21728a=!![];if(_0x288f7e['beep']===_0x42e5('0x12c')){_0x21728a=![];}var _0x32ad52=this[_0x42e5('0xd')][_0x42e5('0x12d')](_0x4f6503,_0x45ccee,_0x288f7e[_0x42e5('0x12e')],_0x288f7e[_0x42e5('0x60')],undefined,_0x21728a);if(_0x32ad52['result']!==-0x1){this[_0x42e5('0xd')][_0x42e5('0xa3')](util[_0x42e5('0x25')](_0x42e5('0x12f'),_0x3b0d1c));var _0x4207f9=this[_0x42e5('0x88')][_0x42e5('0x6b')](this,_0x288f7e,_0x3b0d1c);if(_0x4207f9){for(var _0xc4874d in _0x4207f9){if(_0x4207f9[_0x42e5('0x8c')](_0xc4874d)){this[_0x42e5('0xd')][_0x42e5('0x94')](util[_0x42e5('0x25')](_0x42e5('0x130'),_0xc4874d[_0x42e5('0x65')]()),_0x4207f9[_0xc4874d]);}}return this[_0x42e5('0xd')][_0x42e5('0xa3')](util[_0x42e5('0x25')](_0x42e5('0x131'),JSON[_0x42e5('0x6d')](_0x4207f9)));}}return _0x32ad52;};AGIVertices[_0x42e5('0x14')]['tildeasr']=function(_0x218cf5){logger[_0x42e5('0x2a')](util[_0x42e5('0x25')](_0x42e5('0x132'),_0x218cf5[_0x42e5('0x9d')]));if(!this['isConfigured'](_0x218cf5[_0x42e5('0x8b')])){return this['channel'][_0x42e5('0xa3')](_0x42e5('0x133'));}if(!this[_0x42e5('0x7d')](_0x218cf5[_0x42e5('0x134')])){return this['channel']['noop'](_0x42e5('0x135'));}var _0xa1cde0=_0x42e5('0x12a');var _0x3c5087=util[_0x42e5('0x25')](_0x42e5('0x12b'),FILES_PATH,rs['generate'](0x4));var _0x1e74e3=util['format']('%s.%s',_0x3c5087,_0xa1cde0);var _0x3924a2=!![];if(_0x218cf5[_0x42e5('0x136')]===_0x42e5('0x12c')){_0x3924a2=![];}var _0x3dc18c=this['channel'][_0x42e5('0x12d')](_0x3c5087,_0xa1cde0,_0x218cf5[_0x42e5('0x12e')],_0x218cf5['timeout'],undefined,_0x3924a2);if(_0x3dc18c[_0x42e5('0x9f')]!==-0x1){this[_0x42e5('0xd')][_0x42e5('0xa3')](util[_0x42e5('0x25')](_0x42e5('0x137'),_0x1e74e3));var _0x110042=this[_0x42e5('0x8a')][_0x42e5('0x6b')](this,_0x218cf5,_0x1e74e3);if(_0x110042){for(var _0x13e6a9 in _0x110042){if(_0x110042[_0x42e5('0x8c')](_0x13e6a9)){this[_0x42e5('0xd')][_0x42e5('0x94')](util[_0x42e5('0x25')](_0x42e5('0x138'),_0x13e6a9['toUpperCase']()),_0x110042[_0x13e6a9]);}}return this['channel'][_0x42e5('0xa3')](util[_0x42e5('0x25')](_0x42e5('0x139'),JSON[_0x42e5('0x6d')](_0x110042)));}}return _0x3dc18c;};AGIVertices[_0x42e5('0x14')][_0x42e5('0x13a')]=function(_0x5e2229){logger[_0x42e5('0x2a')](util[_0x42e5('0x25')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x5e2229['label']));return this['channel'][_0x42e5('0x13b')](_0x5e2229[_0x42e5('0x39')],_0x5e2229['extension'],_0x5e2229[_0x42e5('0x3b')]);};AGIVertices[_0x42e5('0x14')]['gotoif']=function(_0x4bbf3d){logger['info'](util[_0x42e5('0x25')](_0x42e5('0x13c'),_0x4bbf3d[_0x42e5('0x9d')]));if(!this[_0x42e5('0x7d')](_0x4bbf3d[_0x42e5('0x13d')])){return this[_0x42e5('0xd')]['error'](_0x4bbf3d,'no\x20condition\x20configured');}try{var _0x593e9d=eval(_0x4bbf3d['condition'])?_0x42e5('0x13e'):'false';this[_0x42e5('0xd')]['noop'](util[_0x42e5('0x25')](_0x42e5('0x13f'),_0x4bbf3d[_0x42e5('0x13d')],_0x593e9d));return{'code':0xc8,'result':_0x593e9d};}catch(_0x530514){return{'code':0xc8,'result':_0x42e5('0x140')};}};AGIVertices[_0x42e5('0x14')][_0x42e5('0x141')]=function(_0x17f33f){logger[_0x42e5('0x2a')](util[_0x42e5('0x25')](_0x42e5('0x142'),_0x17f33f[_0x42e5('0x9d')]));if(!this['isConfigured'](_0x17f33f[_0x42e5('0x143')])){return this[_0x42e5('0xd')]['error'](_0x17f33f,_0x42e5('0x144'));}var _0x4f0c95=this[_0x42e5('0x145')]['sync'](this,_0x17f33f['interval_id']);if(!_0x4f0c95){return this[_0x42e5('0xd')][_0x42e5('0x30')](_0x17f33f,_0x42e5('0x146'));}for(var _0x3ee75f=0x0;_0x3ee75f<_0x4f0c95[_0x42e5('0x91')];_0x3ee75f+=0x1){var _0x1a00ad=this[_0x42e5('0xd')][_0x42e5('0x10')](util[_0x42e5('0x25')](_0x42e5('0x147'),_0x4f0c95[_0x3ee75f]));if(_0x1a00ad['result']===-0x1){return _0x1a00ad;}logger[_0x42e5('0x2a')](util['format'](_0x42e5('0x148'),_0x4f0c95[_0x3ee75f],_0x1a00ad[_0x42e5('0x98')]));if(_0x1a00ad[_0x42e5('0x98')]===_0x42e5('0x13e')){logger[_0x42e5('0x2a')](util[_0x42e5('0x25')](_0x42e5('0x148'),_0x4f0c95[_0x3ee75f],_0x42e5('0x13e')));this[_0x42e5('0xd')][_0x42e5('0xa3')](util[_0x42e5('0x25')](_0x42e5('0x148'),_0x4f0c95[_0x3ee75f],_0x42e5('0x13e')));return{'code':0xc8,'result':'true'};}else{logger[_0x42e5('0x2a')](util[_0x42e5('0x25')]('IFTIME\x20%s\x20%s',_0x4f0c95[_0x3ee75f],_0x42e5('0x140')));this[_0x42e5('0xd')]['noop'](util[_0x42e5('0x25')]('IFTIME\x20%s\x20%s',_0x4f0c95[_0x3ee75f],_0x42e5('0x140')));}}return{'code':0xc8,'result':'false'};};AGIVertices['prototype'][_0x42e5('0x149')]=function(_0xd42d41){logger[_0x42e5('0x2a')](util[_0x42e5('0x25')](_0x42e5('0x14a'),_0xd42d41[_0x42e5('0x9d')]));return this[_0x42e5('0xd')][_0x42e5('0x149')]();};AGIVertices[_0x42e5('0x14')][_0x42e5('0x14b')]=function(_0x32e541){logger[_0x42e5('0x2a')](util[_0x42e5('0x25')](_0x42e5('0x14c'),_0x32e541[_0x42e5('0x9d')]));if(!this[_0x42e5('0x7d')](_0x32e541[_0x42e5('0x73')])){return this[_0x42e5('0xd')][_0x42e5('0xa3')](_0x42e5('0x129'));}var _0xbe2e8b=_0x42e5('0x12a');var _0x138c63=util[_0x42e5('0x25')](_0x42e5('0x12b'),FILES_PATH,rs['generate'](0x4));var _0x56c8bc=util['format']('%s.%s',_0x138c63,_0xbe2e8b);var _0x16686a=!![];if(_0x32e541[_0x42e5('0x136')]===_0x42e5('0x12c')){_0x16686a=![];}var _0x9c7842=this[_0x42e5('0xd')][_0x42e5('0x12d')](_0x138c63,_0xbe2e8b,_0x32e541['intKey'],_0x32e541[_0x42e5('0x60')],undefined,_0x16686a);if(_0x9c7842[_0x42e5('0x9f')]!==-0x1){this['channel']['noop'](util[_0x42e5('0x25')]('ispeech\x20%s\x20file\x20created',_0x56c8bc));var _0x8bfbe2=this[_0x42e5('0x7b')]['sync'](this,_0x32e541,_0x56c8bc);if(_0x8bfbe2){for(var _0x8640df in _0x8bfbe2){if(_0x8bfbe2[_0x42e5('0x8c')](_0x8640df)){this['channel']['setVariable'](util['format']('ISPEECH_ASR_%s',_0x8640df[_0x42e5('0x65')]()),_0x8bfbe2[_0x8640df]);}}return this[_0x42e5('0xd')][_0x42e5('0xa3')](util[_0x42e5('0x25')](_0x42e5('0x14d'),JSON[_0x42e5('0x6d')](_0x8bfbe2)));}}return _0x9c7842;};AGIVertices[_0x42e5('0x14')]['ispeechtts']=function(_0x5e9b22){logger[_0x42e5('0x2a')](util[_0x42e5('0x25')]('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x5e9b22['label']));if(!this[_0x42e5('0x7d')](_0x5e9b22['key'])){return this[_0x42e5('0xd')][_0x42e5('0xa3')]('no\x20key\x20configured');}if(!this['isConfigured'](_0x5e9b22[_0x42e5('0x55')])){return this[_0x42e5('0xd')][_0x42e5('0xa3')]('no\x20text\x20configured');}this[_0x42e5('0xd')]['noop'](util[_0x42e5('0x25')](_0x42e5('0x14e'),_0x5e9b22[_0x42e5('0x55')]));var _0x2d463c=this[_0x42e5('0x79')]['sync'](this,_0x5e9b22);if(_0x2d463c){this[_0x42e5('0xd')]['noop'](util[_0x42e5('0x25')](_0x42e5('0x14f'),_0x2d463c));var _0x25ba4d=this[_0x42e5('0xd')]['streamFile'](_0x2d463c,_0x5e9b22[_0x42e5('0x12e')]);try{fs[_0x42e5('0xfd')](_0x2d463c+'.wav');}catch(_0x3d38d0){logger[_0x42e5('0x30')](_0x3d38d0);}return _0x25ba4d;}return this[_0x42e5('0xd')][_0x42e5('0x30')](_0x5e9b22,_0x42e5('0x150'));};AGIVertices[_0x42e5('0x14')][_0x42e5('0x151')]=function(_0x2aa16e){logger['info'](util['format'](_0x42e5('0x152'),_0x2aa16e[_0x42e5('0x9d')]));if(!this[_0x42e5('0x7d')](_0x2aa16e[_0x42e5('0x153')])){return this[_0x42e5('0xd')][_0x42e5('0x30')](_0x2aa16e,'no\x20find\x20by\x20configured');}logger[_0x42e5('0x2a')](util[_0x42e5('0x25')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x42e5('0xd')][_0x42e5('0x37')],_0x2aa16e[_0x42e5('0x153')]));var _0x193d77=this[_0x42e5('0x4d')][_0x42e5('0x6b')](this,_0x2aa16e[_0x42e5('0x153')]);if(_0x193d77){logger[_0x42e5('0x2a')](util[_0x42e5('0x25')](_0x42e5('0x154'),this[_0x42e5('0xd')][_0x42e5('0x37')],_0x2aa16e['findBy']));this[_0x42e5('0xd')][_0x42e5('0xa3')](util[_0x42e5('0x25')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x42e5('0xd')]['callerid'],_0x2aa16e[_0x42e5('0x153')]));return{'code':0xc8,'result':_0x42e5('0x155')};}else{logger['info'](util[_0x42e5('0x25')](_0x42e5('0x156'),this[_0x42e5('0xd')]['callerid'],_0x2aa16e[_0x42e5('0x153')]));this[_0x42e5('0xd')][_0x42e5('0xa3')](util[_0x42e5('0x25')](_0x42e5('0x156'),this[_0x42e5('0xd')]['callerid'],_0x2aa16e[_0x42e5('0x153')]));return{'code':0xc8,'result':_0x42e5('0x157')};}};AGIVertices[_0x42e5('0x14')][_0x42e5('0x158')]=function(_0x3a9eb8){logger['info'](util[_0x42e5('0x25')](_0x42e5('0x159'),_0x3a9eb8['label']));if(!this['isConfigured'](_0x3a9eb8[_0x42e5('0x153')])){return this['channel'][_0x42e5('0x30')](_0x3a9eb8,_0x42e5('0x15a'));}logger[_0x42e5('0x2a')](util[_0x42e5('0x25')](_0x42e5('0x15b'),this[_0x42e5('0xd')][_0x42e5('0x37')],_0x3a9eb8[_0x42e5('0x153')]));var _0x2c790d=this[_0x42e5('0x4c')][_0x42e5('0x6b')](this,_0x3a9eb8[_0x42e5('0x153')]);if(_0x2c790d){logger['info'](util['format'](_0x42e5('0x154'),this[_0x42e5('0xd')]['callerid'],_0x3a9eb8[_0x42e5('0x153')]));this[_0x42e5('0xd')][_0x42e5('0xa3')](util['format'](_0x42e5('0x154'),this[_0x42e5('0xd')][_0x42e5('0x37')],_0x3a9eb8[_0x42e5('0x153')]));return{'code':0xc8,'result':_0x42e5('0x155')};}else{logger[_0x42e5('0x2a')](util[_0x42e5('0x25')](_0x42e5('0x156'),this[_0x42e5('0xd')]['callerid'],_0x3a9eb8[_0x42e5('0x153')]));this['channel'][_0x42e5('0xa3')](util['format'](_0x42e5('0x156'),this[_0x42e5('0xd')][_0x42e5('0x37')],_0x3a9eb8[_0x42e5('0x153')]));return{'code':0xc8,'result':_0x42e5('0x157')};}};AGIVertices['prototype']['math']=function(_0x180b1e){logger[_0x42e5('0x2a')](util[_0x42e5('0x25')](_0x42e5('0x15c'),_0x180b1e[_0x42e5('0x9d')]));if(!this[_0x42e5('0x7d')](_0x180b1e[_0x42e5('0x15d')])){return this[_0x42e5('0xd')][_0x42e5('0x30')](_0x180b1e,_0x42e5('0x15e'));}this['channel'][_0x42e5('0xa3')](util['format']('math\x20%s',_0x180b1e['operation']));var _0x5ed97f=eval(_0x180b1e[_0x42e5('0x15d')]);if(!this[_0x42e5('0x7d')](_0x180b1e['variable_id'])){return this[_0x42e5('0xd')]['noop']('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x1d343b=this[_0x42e5('0x10')][_0x42e5('0x6b')](this,_0x180b1e[_0x42e5('0xd0')]);if(!_0x1d343b){return this[_0x42e5('0xd')]['error'](_0x180b1e,_0x42e5('0xd2'));}if(_[_0x42e5('0x15f')](_0x5ed97f)){var _0x24e52d=this;_0x5ed97f[_0x42e5('0xd3')](function(_0x385711,_0x53048b){_0x24e52d[_0x42e5('0xd')]['setVariable'](util[_0x42e5('0x25')]('%s[%s]',_0x1d343b,_0x53048b),_0x385711);});return this[_0x42e5('0xd')]['noop'](util[_0x42e5('0x25')]('variable\x20%s[key]\x20set',_0x1d343b));}else{return this[_0x42e5('0xd')][_0x42e5('0x94')](_0x1d343b,_0x5ed97f);}};AGIVertices[_0x42e5('0x14')][_0x42e5('0xb')]=function(_0x11020a){logger[_0x42e5('0x2a')](util[_0x42e5('0x25')](_0x42e5('0x160'),_0x11020a[_0x42e5('0x9d')]));if(_0x11020a[_0x42e5('0x9b')]===0x0){return this[_0x42e5('0x99')](_0x11020a);}_0x11020a[_0x42e5('0x9b')]-=0x1;if(!this[_0x42e5('0x7d')](_0x11020a[_0x42e5('0x10b')])){return this[_0x42e5('0xd')][_0x42e5('0x30')](_0x11020a,_0x42e5('0x161'));}var _0x5e252e=this[_0x42e5('0x1c')][_0x42e5('0x6b')](this,_0x11020a[_0x42e5('0x10b')]);if(!_0x5e252e){return this['channel'][_0x42e5('0x30')](_0x11020a,'no\x20file\x20audio\x20found');}var _0x21de31=this[_0x42e5('0xd')]['getData'](_0x5e252e,_0x11020a[_0x42e5('0x10d')],_0x11020a[_0x42e5('0x162')]);var _0x515986=_0x21de31['result'];if(_0x21de31[_0x42e5('0x9f')]===-0x1){this[_0x42e5('0x9a')][_0x42e5('0x6b')](this,_0x11020a,'-1');return _0x21de31;}else if(_0x21de31[_0x42e5('0x98')]===_0x42e5('0x60')){_0x21de31[_0x42e5('0x9f')]=_0x21de31[_0x42e5('0x9f')][_0x42e5('0x91')]>0x0?_0x21de31[_0x42e5('0x9f')]:'t';}else if(_[_0x42e5('0x41')](_0x21de31['result'])){_0x21de31['result']='#';_0x515986='#';}if(!this[_0x42e5('0x7d')](_0x11020a['variable_id'])){this[_0x42e5('0xd')]['noop'](_0x42e5('0xd1'));}else{var _0x22719b=this[_0x42e5('0x10')][_0x42e5('0x6b')](this,_0x11020a[_0x42e5('0xd0')]);if(!_0x22719b){return this[_0x42e5('0xd')][_0x42e5('0x30')](_0x11020a,'no\x20variable\x20found');}this[_0x42e5('0xd')]['setVariable'](_0x22719b,_0x515986);}this[_0x42e5('0x9a')][_0x42e5('0x6b')](this,_0x11020a,_0x515986);return _0x21de31;};AGIVertices[_0x42e5('0x14')]['noop']=function(_0x575109){logger[_0x42e5('0x2a')](util['format'](_0x42e5('0x163'),_0x575109[_0x42e5('0x9d')]));return this[_0x42e5('0xd')][_0x42e5('0xa3')](_0x575109[_0x42e5('0x164')]||_0x575109[_0x42e5('0x9d')]);};AGIVertices[_0x42e5('0x14')][_0x42e5('0x165')]=function(_0x4e1425){logger[_0x42e5('0x2a')](util[_0x42e5('0x25')](_0x42e5('0x166'),_0x4e1425[_0x42e5('0x9d')]));if(!this[_0x42e5('0x7d')](_0x4e1425[_0x42e5('0x153')])){return this[_0x42e5('0xd')]['error'](_0x4e1425,_0x42e5('0x15a'));}logger[_0x42e5('0x2a')](util['format'](_0x42e5('0x15b'),this['channel']['callerid'],_0x4e1425[_0x42e5('0x153')]));var _0x5acf64=this[_0x42e5('0x167')][_0x42e5('0x6b')](this,_0x4e1425['pause_id']);var _0x25d800=this['agentPause'][_0x42e5('0x6b')](this,_0x4e1425[_0x42e5('0x153')],_0x5acf64);if(_0x25d800){logger[_0x42e5('0x2a')](util[_0x42e5('0x25')](_0x42e5('0x154'),this[_0x42e5('0xd')][_0x42e5('0x37')],_0x4e1425[_0x42e5('0x153')]));this['channel']['noop'](util[_0x42e5('0x25')](_0x42e5('0x154'),this[_0x42e5('0xd')][_0x42e5('0x37')],_0x4e1425[_0x42e5('0x153')]));return{'code':0xc8,'result':'success'};}else{logger['info'](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x42e5('0x37')],_0x4e1425['findBy']));this[_0x42e5('0xd')]['noop'](util[_0x42e5('0x25')](_0x42e5('0x154'),this[_0x42e5('0xd')][_0x42e5('0x37')],_0x4e1425[_0x42e5('0x153')]));return{'code':0xc8,'result':_0x42e5('0x157')};}};AGIVertices[_0x42e5('0x14')][_0x42e5('0x168')]=function(_0x501c44){logger['info'](util[_0x42e5('0x25')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x501c44[_0x42e5('0x9d')]));if(!this['isConfigured'](_0x501c44[_0x42e5('0x10b')])){return this[_0x42e5('0xd')][_0x42e5('0x30')](_0x501c44,'no\x20file\x20audio\x20selected');}var _0x209642=this[_0x42e5('0x1c')]['sync'](this,_0x501c44['file_id']);if(!_0x209642){return this[_0x42e5('0xd')][_0x42e5('0x30')](_0x501c44,_0x42e5('0x169'));}var _0x105195=this[_0x42e5('0xd')][_0x42e5('0x52')](_0x42e5('0x16a'),[_0x209642,_0x501c44[_0x42e5('0xde')]]);if(_0x105195['result']===-0x1){return _0x105195;}return this[_0x42e5('0xd')][_0x42e5('0xa3')](util[_0x42e5('0x25')](_0x42e5('0x16b'),_0x42e5('0x16a'),_0x209642));};AGIVertices[_0x42e5('0x14')][_0x42e5('0x16c')]=function(_0x514ee0){logger[_0x42e5('0x2a')](util[_0x42e5('0x25')](_0x42e5('0x16d'),_0x514ee0[_0x42e5('0x9d')]));if(!this[_0x42e5('0x7d')](_0x514ee0['queue_id'])){return this[_0x42e5('0xd')][_0x42e5('0x30')](_0x514ee0,'no\x20queue\x20selected');}var _0x1dc57b='';var _0x423827=parseInt(_0x514ee0[_0x42e5('0x16e')],0xa);if(isNaN(_0x423827)){_0x1dc57b=_0x514ee0[_0x42e5('0x16e')];}else{_0x1dc57b=this['getVoiceQueue']['sync'](this,_0x514ee0[_0x42e5('0x16e')]);if(!_0x1dc57b){return this['channel'][_0x42e5('0x30')](_0x514ee0,_0x42e5('0x16f'));}}var _0x2a6e89='';if(this[_0x42e5('0x7d')](_0x514ee0['file_id'])){var _0x261841=this[_0x42e5('0x1c')][_0x42e5('0x6b')](this,_0x514ee0[_0x42e5('0x10b')]);if(_0x261841){_0x2a6e89=_0x261841;}}this[_0x42e5('0x9a')][_0x42e5('0x6b')](this,_0x514ee0,_0x1dc57b);if(_0x514ee0[_0x42e5('0xde')][_0x42e5('0x170')]('x')<0x0){_0x514ee0[_0x42e5('0xde')]+='x';}if(_0x514ee0[_0x42e5('0xde')]['indexOf']('X')<0x0){_0x514ee0[_0x42e5('0xde')]+='X';}this['channel'][_0x42e5('0x94')](_0x42e5('0x171'),_0x1dc57b?_0x1dc57b['toLowerCase']():'');var _0x27ea3a=this[_0x42e5('0xd')][_0x42e5('0x52')](_0x42e5('0x172'),[_0x1dc57b,_0x514ee0[_0x42e5('0xde')],_0x514ee0[_0x42e5('0x5e')],_0x2a6e89,_0x514ee0[_0x42e5('0x60')],_0x514ee0[_0x42e5('0x7')],_0x514ee0[_0x42e5('0x173')],_0x514ee0[_0x42e5('0x174')],'',_0x514ee0['position']]);if(_0x27ea3a['result']===-0x1){return _0x27ea3a;}return this[_0x42e5('0xd')]['noop'](util[_0x42e5('0x25')](_0x42e5('0x16b'),_0x42e5('0x172'),_0x1dc57b));};AGIVertices[_0x42e5('0x14')][_0x42e5('0x175')]=function(_0x4c2ac8){logger[_0x42e5('0x2a')](util[_0x42e5('0x25')]('Enter\x20in\x20RECORD\x20(%s)\x20block',_0x4c2ac8['label']));var _0x883364=_0x4c2ac8[_0x42e5('0x176')]||_0x42e5('0x12a');var _0x55ecae=util[_0x42e5('0x25')](_0x42e5('0x177'),this[_0x42e5('0xd')][_0x42e5('0x35')],rs[_0x42e5('0x112')](0x5));var _0x23114e=util[_0x42e5('0x25')](_0x42e5('0x178'),FILES_PATH,_0x55ecae,_0x883364);var _0x81c6d7=util[_0x42e5('0x25')]('%s/recordings/%s',FILES_PATH,_0x55ecae);this[_0x42e5('0x38')][_0x42e5('0x6b')](this,_0x4c2ac8,_0x55ecae,_0x23114e);this[_0x42e5('0xd')][_0x42e5('0x94')]('RECORDING_SAVENAME',_0x55ecae);logger[_0x42e5('0x2a')]('Recording\x20%s\x20%s\x20%s\x20%s',_0x81c6d7,_0x883364,_0x4c2ac8[_0x42e5('0x179')],_0x4c2ac8[_0x42e5('0x60')]);return this['channel']['recordFile'](_0x81c6d7,_0x883364,_0x4c2ac8[_0x42e5('0x179')],_0x4c2ac8[_0x42e5('0x60')],undefined,!![]);};AGIVertices[_0x42e5('0x14')][_0x42e5('0x17a')]=function(_0xa9ef5){logger[_0x42e5('0x2a')](util[_0x42e5('0x25')]('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0xa9ef5[_0x42e5('0x9d')]));if(!this[_0x42e5('0x7d')](_0xa9ef5[_0x42e5('0x5e')])){return this['channel'][_0x42e5('0xa3')](_0x42e5('0x17b'));}var _0x27b5b4=this['restAPI'][_0x42e5('0x6b')](this,_0xa9ef5);logger[_0x42e5('0x2a')](util[_0x42e5('0x25')]('Response:',util['inspect'](_0x27b5b4,{'showHidden':![],'depth':null})));if(!this[_0x42e5('0x7d')](_0xa9ef5['variable_id'])){return this[_0x42e5('0xd')][_0x42e5('0xa3')](_0x42e5('0x17c'));}var _0x1d1fa2=this[_0x42e5('0x10')][_0x42e5('0x6b')](this,_0xa9ef5['variable_id']);if(!_0x1d1fa2){return this['channel']['error'](_0xa9ef5,_0x42e5('0xd2'));}this[_0x42e5('0xd')][_0x42e5('0x94')](util['format']('%s_STATUS_CODE',_0x1d1fa2),_0x27b5b4[_0x42e5('0x6f')]?_0x27b5b4['statusCode']:_0x42e5('0x17d'));this[_0x42e5('0xd')][_0x42e5('0x94')](util['format']('%s_STATUS_MESSAGE',_0x1d1fa2),_0x27b5b4[_0x42e5('0x17e')]?_0x27b5b4['statusMessage']:'OK');if(_0x27b5b4['body']){try{this['saveRestApiResult'](_0x27b5b4['body'],_0x1d1fa2);}catch(_0x5f41fa){logger[_0x42e5('0x30')](util[_0x42e5('0x25')](_0x42e5('0x17f'),_0x1d1fa2));}}return this[_0x42e5('0xd')][_0x42e5('0xa3')](util[_0x42e5('0x25')](_0x42e5('0xd6'),_0x1d1fa2));};AGIVertices[_0x42e5('0x14')][_0x42e5('0x180')]=function(_0x45de61){logger[_0x42e5('0x2a')](util['format'](_0x42e5('0x181'),_0x45de61['label']));return this['channel'][_0x42e5('0x182')](_0x45de61[_0x42e5('0x183')]['replace'](/\s+/g,''),_0x45de61[_0x42e5('0x179')]);};AGIVertices[_0x42e5('0x14')][_0x42e5('0x184')]=function(_0x5645f0){logger['info'](util[_0x42e5('0x25')](_0x42e5('0x185'),_0x5645f0[_0x42e5('0x9d')]));return this[_0x42e5('0xd')][_0x42e5('0x186')](_0x5645f0[_0x42e5('0x61')][_0x42e5('0x53')](/\s+/g,''),_0x5645f0[_0x42e5('0x179')]);};AGIVertices[_0x42e5('0x14')][_0x42e5('0x187')]=function(_0x54cad0){logger[_0x42e5('0x2a')](util['format'](_0x42e5('0x188'),_0x54cad0['label']));return this[_0x42e5('0xd')][_0x42e5('0x189')](_0x54cad0[_0x42e5('0x55')],_0x54cad0['escape_digits']);};AGIVertices[_0x42e5('0x14')][_0x42e5('0x18a')]=function(_0x1a16d5){logger[_0x42e5('0x2a')](util[_0x42e5('0x25')](_0x42e5('0x18b'),_0x1a16d5[_0x42e5('0x9d')]));if(!this[_0x42e5('0x7d')](_0x1a16d5['account_id'])){return this[_0x42e5('0xd')][_0x42e5('0xa3')]('no\x20mail\x20account\x20configured');}var _0x335e8e=this[_0x42e5('0x18c')][_0x42e5('0x6b')](this,_0x1a16d5[_0x42e5('0x18d')]);if(!_0x335e8e||!_0x335e8e[_0x42e5('0x18e')]){return this[_0x42e5('0xd')][_0x42e5('0x30')](_0x1a16d5,_0x42e5('0x18f'));}var _0xe12ecb={'from':util[_0x42e5('0x25')](_0x42e5('0x190'),_0x335e8e[_0x42e5('0x17')],_0x335e8e[_0x42e5('0x191')]||_0x335e8e[_0x42e5('0x18e')][_0x42e5('0x192')]),'to':_0x1a16d5['to']||'','cc':_0x1a16d5['cc']||'','bcc':_0x1a16d5[_0x42e5('0x193')]||'','subject':_0x1a16d5['subject'],'html':_0x1a16d5[_0x42e5('0x55')],'text':_0x1a16d5[_0x42e5('0x55')]};var _0x456ca8={'tls':{'rejectUnauthorized':![]}};if(_0x335e8e[_0x42e5('0x18e')][_0x42e5('0x194')]){_0x456ca8[_0x42e5('0x194')]=_0x335e8e[_0x42e5('0x18e')]['service'];}else{_0x456ca8[_0x42e5('0x195')]=_0x335e8e[_0x42e5('0x18e')][_0x42e5('0x195')];_0x456ca8['port']=_0x335e8e[_0x42e5('0x18e')][_0x42e5('0x196')];_0x456ca8[_0x42e5('0x197')]=_0x335e8e[_0x42e5('0x18e')]['secure'];}if(_0x335e8e['Smtp'][_0x42e5('0x198')]){_0x456ca8[_0x42e5('0x199')]={'user':_0x335e8e[_0x42e5('0x18e')][_0x42e5('0x192')],'pass':_0x335e8e['Smtp'][_0x42e5('0x19a')]};}if(this[_0x42e5('0x7d')](_0x1a16d5[_0x42e5('0x19b')])){}logger[_0x42e5('0xd8')](_0x42e5('0x19c'),JSON[_0x42e5('0x6d')](_0xe12ecb));this[_0x42e5('0x9a')][_0x42e5('0x6b')](this,_0x1a16d5,_0x1a16d5[_0x42e5('0x18d')]);this['channel'][_0x42e5('0xa3')](util[_0x42e5('0x25')](_0x42e5('0x19d'),_0x335e8e['name']));this['sendMailMessage'][_0x42e5('0x6b')](this,_0x456ca8,_0xe12ecb);return this[_0x42e5('0xd')][_0x42e5('0xa3')](_0x42e5('0x19e'));};AGIVertices['prototype'][_0x42e5('0x19f')]=function(_0x59616f){logger[_0x42e5('0x2a')](util[_0x42e5('0x25')](_0x42e5('0x1a0'),_0x59616f['label']));return this['channel']['noop'](_0x42e5('0x1a1'));};AGIVertices[_0x42e5('0x14')][_0x42e5('0x1a2')]=function(_0x5743cc){logger['info'](util[_0x42e5('0x25')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x5743cc['label']));if(!this['isConfigured'](_0x5743cc['sms_account_id'])){return this[_0x42e5('0xd')]['noop'](_0x42e5('0x1a3'));}var _0x6dc33e=this[_0x42e5('0x32')]['sync'](this,_0x5743cc['sms_account_id']);if(!_0x6dc33e){return this['channel'][_0x42e5('0x30')](_0x5743cc,_0x42e5('0x1a4'));}var _0x31c1eb={'body':_0x5743cc['sms_text'],'phone':_0x5743cc['to']||'','SmsAccountId':_0x6dc33e['id']};logger[_0x42e5('0xd8')](_0x42e5('0x1a5'),JSON[_0x42e5('0x6d')](_0x31c1eb));this[_0x42e5('0x9a')][_0x42e5('0x6b')](this,_0x5743cc,_0x5743cc[_0x42e5('0x1a6')]);this['channel']['noop'](util[_0x42e5('0x25')](_0x42e5('0x1a7'),_0x6dc33e[_0x42e5('0x17')]));this[_0x42e5('0x34')][_0x42e5('0x6b')](this,_0x31c1eb);return this['channel'][_0x42e5('0xa3')]('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices['prototype'][_0x42e5('0x1a8')]=function(_0x2dc2ea){logger[_0x42e5('0x2a')](util[_0x42e5('0x25')](_0x42e5('0x1a9'),_0x2dc2ea[_0x42e5('0x9d')]));if(!this['isConfigured'](_0x2dc2ea[_0x42e5('0xd0')])){return this['channel'][_0x42e5('0x30')](_0x2dc2ea,_0x42e5('0x1aa'));}var _0x55913d=this[_0x42e5('0x10')]['sync'](this,_0x2dc2ea[_0x42e5('0xd0')]);if(!_0x55913d){return this[_0x42e5('0xd')][_0x42e5('0x30')](_0x2dc2ea,'no\x20variable\x20found');}return this[_0x42e5('0xd')][_0x42e5('0x94')](_0x55913d,_0x2dc2ea[_0x42e5('0x1ab')]);};AGIVertices['prototype'][_0x42e5('0x1ac')]=function(_0x26eedc){logger[_0x42e5('0x2a')](util[_0x42e5('0x25')](_0x42e5('0x1ad'),_0x26eedc['label']));this[_0x42e5('0xd')]['noop']('START\x20CALLY\x20SQUARE');if(_0x26eedc[_0x42e5('0xaf')]===_0x42e5('0x1ae')){this[_0x42e5('0xd')][_0x42e5('0xa3')](_0x42e5('0x1af'));return this[_0x42e5('0xd')][_0x42e5('0xaf')]();}return this[_0x42e5('0xd')][_0x42e5('0xa3')]('Skipped\x20Answer');};AGIVertices[_0x42e5('0x14')][_0x42e5('0x1b0')]=function(_0x3dc565){logger[_0x42e5('0x2a')](util[_0x42e5('0x25')](_0x42e5('0x1b1'),_0x3dc565['label']));if(!this[_0x42e5('0x7d')](_0x3dc565[_0x42e5('0x1b2')])){return this[_0x42e5('0xd')][_0x42e5('0x30')](_0x3dc565,_0x42e5('0x1b3'));}var _0x21d571=this[_0x42e5('0x18')][_0x42e5('0x6b')](this,_0x3dc565[_0x42e5('0x1b2')]);if(!this[_0x42e5('0x7d')](_0x21d571)){return this[_0x42e5('0xd')][_0x42e5('0x30')](_0x3dc565,util['format'](_0x42e5('0x1b4'),_0x3dc565[_0x42e5('0x1b2')]));}if(_0x21d571===this[_0x42e5('0xd')][_0x42e5('0x1b5')]){return this[_0x42e5('0xd')][_0x42e5('0x30')](_0x3dc565,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this[_0x42e5('0x9a')]['sync'](this,_0x3dc565,_0x21d571);var _0x168bdf=this[_0x42e5('0xd')]['exec']('AGI',util[_0x42e5('0x25')](_0x42e5('0x1b6'),config[_0x42e5('0x7')]['host']||_0x42e5('0x1b7'),_0x21d571,this['channel']['arg_1']));if(_0x168bdf[_0x42e5('0x9f')]===-0x1){return _0x168bdf;}return this[_0x42e5('0xd')]['noop'](util[_0x42e5('0x25')]('Executed\x20command\x20%s\x20%s','AGI',_0x21d571));};AGIVertices[_0x42e5('0x14')][_0x42e5('0x1b8')]=function(_0x1f253c){logger[_0x42e5('0x2a')](util[_0x42e5('0x25')](_0x42e5('0x1b9'),_0x1f253c[_0x42e5('0x9d')]));var _0x515c75=this['shellCommand'][_0x42e5('0x6b')](this,_0x1f253c[_0x42e5('0xad')]);this['createSquareDetailsReport']['sync'](this,_0x1f253c,_0x1f253c[_0x42e5('0xad')]);if(this[_0x42e5('0x7d')](_0x1f253c[_0x42e5('0xd0')])){var _0x5cb7fe=this[_0x42e5('0x10')][_0x42e5('0x6b')](this,_0x1f253c[_0x42e5('0xd0')]);if(_0x5cb7fe){this[_0x42e5('0xd')][_0x42e5('0x94')](_0x5cb7fe,_0x515c75);return this[_0x42e5('0xd')][_0x42e5('0xa3')](util[_0x42e5('0x25')](_0x42e5('0x1ba'),_0x1f253c[_0x42e5('0xad')],_0x5cb7fe));}}return this[_0x42e5('0xd')][_0x42e5('0xa3')](util[_0x42e5('0x25')](_0x42e5('0x1bb'),_0x1f253c[_0x42e5('0xad')]));};AGIVertices[_0x42e5('0x14')][_0x42e5('0x1bc')]=function(_0x3346b0){logger[_0x42e5('0x2a')](util[_0x42e5('0x25')](_0x42e5('0x1bd'),_0x3346b0[_0x42e5('0x9d')]));_0x3346b0[_0x42e5('0x55')]=_0x3346b0[_0x42e5('0x55')][_0x42e5('0x53')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x42e5('0x7d')](_0x3346b0['apiKey'])){return this[_0x42e5('0xd')]['noop']('no\x20apiKey\x20configured');}if(!this[_0x42e5('0x7d')](_0x3346b0[_0x42e5('0x55')])){return this[_0x42e5('0xd')][_0x42e5('0xa3')](_0x42e5('0xbd'));}this[_0x42e5('0xd')]['noop'](util[_0x42e5('0x25')](_0x42e5('0x1be'),_0x3346b0[_0x42e5('0x55')]));var _0x76c1d4=this[_0x42e5('0x54')][_0x42e5('0x6b')](this,_0x3346b0);if(_0x76c1d4){this['channel'][_0x42e5('0xa3')](util[_0x42e5('0x25')](_0x42e5('0x1bf'),_0x76c1d4));var _0x44e47f=this[_0x42e5('0xd')]['streamFile'](_0x76c1d4);try{fs['unlink'](_0x76c1d4+'.wav');}catch(_0x16dd5d){logger[_0x42e5('0x30')](_0x16dd5d);}return _0x44e47f;}return this['channel'][_0x42e5('0x30')](_0x3346b0,_0x42e5('0x1c0'));};AGIVertices[_0x42e5('0x14')][_0x42e5('0x1c1')]=function(_0x4ff3d8){logger[_0x42e5('0x2a')](util[_0x42e5('0x25')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x4ff3d8[_0x42e5('0x9d')]));_0x4ff3d8['text']=_0x4ff3d8['text'][_0x42e5('0x53')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x42e5('0x7d')](_0x4ff3d8['text'])){return this['channel'][_0x42e5('0xa3')](_0x42e5('0xbd'));}this[_0x42e5('0xd')][_0x42e5('0xa3')](util['format'](_0x42e5('0x1c2'),_0x4ff3d8[_0x42e5('0x55')]));var _0x36402a=this['googleTTS']['sync'](this,_0x4ff3d8);if(_0x36402a){this[_0x42e5('0xd')][_0x42e5('0xa3')](util['format'](_0x42e5('0x1c3'),_0x36402a));var _0x3e8ae1=this['channel'][_0x42e5('0xfc')](_0x36402a);try{fs[_0x42e5('0xfd')](_0x36402a+_0x42e5('0xfe'));}catch(_0x55a918){logger[_0x42e5('0x30')](_0x55a918);}return _0x3e8ae1;}return this[_0x42e5('0xd')]['error'](_0x4ff3d8,_0x42e5('0x1c4'));};AGIVertices[_0x42e5('0x14')][_0x42e5('0x1c5')]=function(_0x16ac70){logger[_0x42e5('0x2a')](util['format'](_0x42e5('0x1c6'),_0x16ac70[_0x42e5('0x9d')]));if(!this['isConfigured'](_0x16ac70['findBy'])){return this[_0x42e5('0xd')][_0x42e5('0x30')](_0x16ac70,_0x42e5('0x15a'));}logger['info'](util[_0x42e5('0x25')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel'][_0x42e5('0x37')],_0x16ac70['findBy']));var _0x710fa4=this[_0x42e5('0x4b')]['sync'](this,_0x16ac70[_0x42e5('0x153')]);if(_0x710fa4){logger[_0x42e5('0x2a')](util[_0x42e5('0x25')](_0x42e5('0x154'),this[_0x42e5('0xd')]['callerid'],_0x16ac70[_0x42e5('0x153')]));this[_0x42e5('0xd')][_0x42e5('0xa3')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this['channel']['callerid'],_0x16ac70[_0x42e5('0x153')]));return{'code':0xc8,'result':'success'};}else{logger[_0x42e5('0x2a')](util[_0x42e5('0x25')](_0x42e5('0x156'),this[_0x42e5('0xd')]['callerid'],_0x16ac70[_0x42e5('0x153')]));this[_0x42e5('0xd')][_0x42e5('0xa3')](util['format'](_0x42e5('0x156'),this[_0x42e5('0xd')][_0x42e5('0x37')],_0x16ac70['findBy']));return{'code':0xc8,'result':_0x42e5('0x157')};}};AGIVertices[_0x42e5('0x14')][_0x42e5('0x1c7')]=function(_0x32363c){logger[_0x42e5('0x2a')](util[_0x42e5('0x25')](_0x42e5('0x1c8'),_0x32363c[_0x42e5('0x9d')]));var _0x15e77f=this['channel'][_0x42e5('0x52')](_0x42e5('0x1c9'),[_0x32363c[_0x42e5('0x1ca')],_0x32363c[_0x42e5('0x71')]]);if(_0x15e77f[_0x42e5('0x9f')]===-0x1){return _0x15e77f;}return this[_0x42e5('0xd')][_0x42e5('0xa3')](util[_0x42e5('0x25')](_0x42e5('0x16b'),_0x42e5('0x1c9'),_0x32363c[_0x42e5('0x1ca')]));};AGIVertices[_0x42e5('0x14')]['vswitch']=function(_0x3ccaff){logger[_0x42e5('0x2a')](util['format'](_0x42e5('0x1cb'),_0x3ccaff[_0x42e5('0x9d')]));if(!this[_0x42e5('0x7d')](_0x3ccaff[_0x42e5('0xd0')])){return this['channel'][_0x42e5('0x30')](_0x3ccaff,_0x42e5('0x1aa'));}var _0x520893=this[_0x42e5('0x10')]['sync'](this,_0x3ccaff[_0x42e5('0xd0')]);if(!_0x520893){return this[_0x42e5('0xd')]['error'](_0x3ccaff,'no\x20variable\x20found');}var _0x2862be=this[_0x42e5('0xd')]['getVariable'](_0x520893);return{'code':0xc8,'result':_0x2862be[_0x42e5('0x98')]?_0x2862be[_0x42e5('0x98')]:'-'};};String['prototype'][_0x42e5('0x96')]=function(_0x568df5,_0x27e4f5){return this[_0x42e5('0x95')](_0x568df5)[_0x42e5('0x1cc')](_0x27e4f5);};module['exports']=AGIVertices; \ No newline at end of file +var _0xf0b0=['password','no\x20password\x20configured','ndassistant_url','bot','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','streamFile','.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','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','retry','file_id','no\x20file\x20audio\x20selected','getData','response','maxdigit','test','mindigit','hiddendigitsnum','hiddendigitspos','first','substr','generate','getsecretdigits','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','aws_bot_name','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','beep','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','recordFile','intKey','tilde\x20%s\x20file\x20created','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','no\x20condition\x20configured','true','EVAL\x20CONDITION\x20%s\x20%s','condition','false','gotoiftime','interval_id','no\x20interval\x20configured','getIntervals','no\x20intervals\x20found','IFTIME\x20%s\x20%s','Enter\x20in\x20HANGUP\x20(%s)\x20block','hangup','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','NOBEEP','ispeech\x20%s\x20file\x20created','ispeechtts','unlink','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','AGENT\x20%s\x20FOUND\x20BY','success','failure','Enter\x20in\x20LOGOUT\x20(%s)\x20block','no\x20find\x20by\x20configured','AGENT\x20%s\x20NOT\x20FOUND\x20BY','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','FIND\x20AGENT\x20%s\x20BY\x20%s','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','no\x20file\x20audio\x20found','PLAYBACK','Executed\x20command\x20%s\x20%s','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','getVoiceQueue','indexOf','toLowerCase','macro','gosub','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','statusCode','200','%s_STATUS_MESSAGE','variable\x20%s\x20set','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','account_id','Smtp','no\x20mail\x20account\x20found','email','user','bcc','subject','service','host','port','authentication','auth','template_id','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','no\x20subproject\x20selected','project_id','agi://%s/square,\x22%s\x22,\x22%s\x22','AGI','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','no\x20apiKey\x20configured','googleCloudTTS','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','no\x20variable\x20selected','exports','path','util','shelljs','odbc','randomstring','mustache','request-promise','../../config/environment','./scripts','rawHeaders','rawBody','menu','getdigits','rpc','mailRpc','prototype','getVariable','then','name','catch','getSquareProject','getSquareOdbc','dsn','getUser','getUserById','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccount','sendMailMessage','getIntervalById','map','Intervals','interval','format','%s/sounds/converted/%s','getQueryOdbc','open','error','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','label','agicommand','arg_1','channel','callerid','createSquareRecording','uniqueid','calleridname','context','extension','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isNil','random','lastName','phone','list_id','scheduledAt','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','replace','apiKey','google_cloud_tts_text_type','text','ssmlGender','MALE','MP3','googleTTS','google_tts_language','restAPI','timeout','number','includes','PUT','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','computedVariables','uri','url','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','googleDialogflowV2','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','en-US','ispeechASR','isConfigured','model','awsPolly','aws_polly_voice','Amy','awsLex','aws_access_key_id','aws_secret_access_key','aws_lex_region','googleASR','google_asr_language','tildeASR','appsecret','clone','isString','replaceAllVariables','hasOwnProperty','isPlainObject','isArray','length','recursiveNodeIndex','isEmpty','%s.%s','saveRestApiResult','setVariable','replaceObjectAllVariables','split','replaceAll','extra','result','sync','maxRetry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','no\x20text\x20configured','MRCPSynth','noop','Executed\x20command\x20MRCPSynth\x20%s','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','getAndSetVariable','RECOG_CONFIDENCE()','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','agi','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','answer','callback','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','add','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','no\x20database\x20selected','odbc_id','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','dial','debug','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','SIP/%s','opts','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','DIALOGFLOW_%s','toUpperCase','speech','out','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','dialogflowV2_project_id','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username'];(function(_0x2849e2,_0x23a701){var _0x3e5418=function(_0x264791){while(--_0x264791){_0x2849e2['push'](_0x2849e2['shift']());}};_0x3e5418(++_0x23a701);}(_0xf0b0,0xd1));var _0x0f0b=function(_0x1e52de,_0x493da4){_0x1e52de=_0x1e52de-0x0;var _0x1f9dbf=_0xf0b0[_0x1e52de];return _0x1f9dbf;};'use strict';var fs=require('fs');var path=require(_0x0f0b('0x0'));var util=require(_0x0f0b('0x1'));var _=require('lodash');var sh=require(_0x0f0b('0x2'));var odbc=require(_0x0f0b('0x3'))();var rs=require(_0x0f0b('0x4'));var moment=require('moment');var Mustache=require(_0x0f0b('0x5'));var rp=require(_0x0f0b('0x6'));var logger=require('../../config/logger')('agi');var config=require(_0x0f0b('0x7'));var scripts=require(_0x0f0b('0x8'));var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=[_0x0f0b('0x9'),_0x0f0b('0xa')];var verticesWithRetry=[_0x0f0b('0xb'),_0x0f0b('0xc'),'getsecretdigits'];var AGIVertices=function(_0x327c7f,_0x47bf98,_0xfc4d57){this['channel']=_0x327c7f;this[_0x0f0b('0xd')]=_0x47bf98;this[_0x0f0b('0xe')]=_0xfc4d57;};AGIVertices[_0x0f0b('0xf')][_0x0f0b('0x10')]=function(_0x5ca9c9,_0x36aa82){this['rpc']['getVariableById'](_0x5ca9c9)[_0x0f0b('0x11')](function(_0x2382ff){_0x36aa82(null,_0x2382ff?_0x2382ff[_0x0f0b('0x12')]:![]);})[_0x0f0b('0x13')](function(_0x500eea){_0x36aa82(_0x500eea);});};AGIVertices['prototype']['getVoiceQueue']=function(_0x362aa0,_0x3d907d){this[_0x0f0b('0xd')]['getVoiceQueueById'](_0x362aa0)[_0x0f0b('0x11')](function(_0x53dedc){_0x3d907d(null,_0x53dedc?_0x53dedc[_0x0f0b('0x12')]:![]);})[_0x0f0b('0x13')](function(_0x1334e6){_0x3d907d(_0x1334e6);});};AGIVertices['prototype'][_0x0f0b('0x14')]=function(_0x3d6293,_0xc98412){this[_0x0f0b('0xd')]['getSquareProjectById'](_0x3d6293)[_0x0f0b('0x11')](function(_0xd0f672){_0xc98412(null,_0xd0f672?_0xd0f672[_0x0f0b('0x12')]:![]);})[_0x0f0b('0x13')](function(_0x2cdd2d){_0xc98412(_0x2cdd2d);});};AGIVertices[_0x0f0b('0xf')][_0x0f0b('0x15')]=function(_0x551bea,_0x189b38){this[_0x0f0b('0xd')]['getSquareOdbcById'](_0x551bea)[_0x0f0b('0x11')](function(_0x302a9f){_0x189b38(null,_0x302a9f?_0x302a9f[_0x0f0b('0x16')]:![]);})[_0x0f0b('0x13')](function(_0x5d8060){_0x189b38(_0x5d8060);});};AGIVertices[_0x0f0b('0xf')][_0x0f0b('0x17')]=function(_0xb76fa1,_0x358327){this[_0x0f0b('0xd')][_0x0f0b('0x18')](_0xb76fa1)[_0x0f0b('0x11')](function(_0x2647fb){_0x358327(null,_0x2647fb?_0x2647fb[_0x0f0b('0x12')]:![]);})['catch'](function(_0x5bac1a){_0x358327(_0x5bac1a);});};AGIVertices[_0x0f0b('0xf')][_0x0f0b('0x19')]=function(_0x1c6d68,_0x232020){this[_0x0f0b('0xd')][_0x0f0b('0x1a')](_0x1c6d68)['then'](function(_0x2a8e27){_0x232020(null,_0x2a8e27?_0x2a8e27['name']:![]);})['catch'](function(_0x4b61c5){_0x232020(_0x4b61c5);});};AGIVertices[_0x0f0b('0xf')][_0x0f0b('0x1b')]=function(_0x25359d,_0x3fb4f7){var _0x16de11=this;this[_0x0f0b('0xd')][_0x0f0b('0x1c')](_0x25359d)[_0x0f0b('0x11')](function(_0x155902){_0x3fb4f7(null,_0x155902?_0x16de11[_0x0f0b('0x1d')](_0x155902[_0x0f0b('0x1e')]):![]);})[_0x0f0b('0x13')](function(_0x275791){_0x3fb4f7(_0x275791);});};AGIVertices[_0x0f0b('0xf')][_0x0f0b('0x1f')]=function(_0xe3f647,_0x388235){this[_0x0f0b('0xd')]['getMailAccountById'](_0xe3f647)[_0x0f0b('0x11')](function(_0xabb8dc){_0x388235(null,_0xabb8dc?_0xabb8dc:![]);})['catch'](function(_0x376b24){_0x388235(_0x376b24);});};AGIVertices[_0x0f0b('0xf')][_0x0f0b('0x20')]=function(_0x17b750,_0x2acd9f,_0x30ec8f){this[_0x0f0b('0xe')][_0x0f0b('0x20')](_0x17b750,_0x2acd9f)['then'](function(){_0x30ec8f(null);})['catch'](function(_0x13bf04){_0x30ec8f(_0x13bf04);});};AGIVertices['prototype']['getIntervals']=function(_0x4bc766,_0x4f238b){this[_0x0f0b('0xd')][_0x0f0b('0x21')](_0x4bc766)[_0x0f0b('0x11')](function(_0x582b92){if(_0x582b92){if(_0x582b92['IntervalId']){_0x4f238b(null,[_0x582b92['interval']]);}else{_0x4f238b(null,_[_0x0f0b('0x22')](_0x582b92[_0x0f0b('0x23')],_0x0f0b('0x24')));}}else{_0x4f238b(null,![]);}})[_0x0f0b('0x13')](function(_0x59edb0){_0x4f238b(_0x59edb0);});};AGIVertices[_0x0f0b('0xf')][_0x0f0b('0x1d')]=function(_0x3244a9){return util[_0x0f0b('0x25')](_0x0f0b('0x26'),FILES_PATH,_0x3244a9);};AGIVertices[_0x0f0b('0xf')][_0x0f0b('0x27')]=function(_0x25047a,_0xf1838f,_0x32906d){odbc[_0x0f0b('0x28')](_0x25047a,function(_0x5ce108){if(_0x5ce108){logger[_0x0f0b('0x29')]('Error\x20getting\x20ODBC\x20connection\x20%s',_0x5ce108);_0x32906d(_0x5ce108);}else{logger[_0x0f0b('0x2a')](_0x0f0b('0x2b'));odbc[_0x0f0b('0x2c')](_0xf1838f,function(_0x2de5f8,_0x35705b){if(_0x2de5f8){logger[_0x0f0b('0x2a')](_0x0f0b('0x2d'),_0xf1838f);_0x32906d(_0x2de5f8);}else{logger[_0x0f0b('0x2a')](_0x0f0b('0x2e'),_0xf1838f);odbc[_0x0f0b('0x2f')](function(_0x213033){if(_0x213033){logger[_0x0f0b('0x29')](_0x0f0b('0x30'),_0x213033);}_0x32906d(null,_0x35705b);});}});}});};AGIVertices[_0x0f0b('0xf')][_0x0f0b('0x31')]=function(_0x4f9553,_0x4eb7ef){this[_0x0f0b('0xd')][_0x0f0b('0x32')](_0x4f9553)[_0x0f0b('0x11')](function(_0x2bc4eb){_0x4eb7ef(null,_0x2bc4eb?_0x2bc4eb:![]);})[_0x0f0b('0x13')](function(_0xd4f201){_0x4eb7ef(_0xd4f201);});};AGIVertices[_0x0f0b('0xf')][_0x0f0b('0x33')]=function(_0x3c5d50,_0x2a7037){this[_0x0f0b('0xd')][_0x0f0b('0x33')](_0x3c5d50)['then'](function(_0x38388a){_0x2a7037(null,_0x38388a);})[_0x0f0b('0x13')](function(_0x3a562d){_0x2a7037(_0x3a562d);});};AGIVertices[_0x0f0b('0xf')][_0x0f0b('0x34')]=function(_0x1ab81c,_0x1f09ab,_0x19590a){this['rpc'][_0x0f0b('0x34')]({'uniqueid':this['channel']['uniqueid'],'node':_0x1ab81c[_0x0f0b('0x35')],'application':_0x1ab81c[_0x0f0b('0x36')],'data':_0x1f09ab||null,'project_name':this['channel'][_0x0f0b('0x37')],'callerid':this[_0x0f0b('0x38')][_0x0f0b('0x39')]})[_0x0f0b('0x11')](function(_0xf4abf4){if(_0x19590a){_0x19590a(null,_0xf4abf4);}})[_0x0f0b('0x13')](function(_0xca793c){if(_0x19590a){_0x19590a(_0xca793c);}});};AGIVertices[_0x0f0b('0xf')][_0x0f0b('0x3a')]=function(_0x2fea13,_0x441caa,_0x4a7aa1,_0x1f5082){this[_0x0f0b('0xd')]['createSquareRecording']({'uniqueid':this[_0x0f0b('0x38')][_0x0f0b('0x3b')],'callerid':this[_0x0f0b('0x38')][_0x0f0b('0x39')],'calleridname':this['channel'][_0x0f0b('0x3c')],'context':this[_0x0f0b('0x38')][_0x0f0b('0x3d')],'extension':this[_0x0f0b('0x38')][_0x0f0b('0x3e')],'priority':this[_0x0f0b('0x38')][_0x0f0b('0x3f')],'accountcode':this[_0x0f0b('0x38')][_0x0f0b('0x40')],'dnid':this[_0x0f0b('0x38')][_0x0f0b('0x41')],'projectName':this[_0x0f0b('0x38')]['arg_1'],'saveName':_0x441caa,'filename':_0x2fea13[_0x0f0b('0x42')]||_0x441caa,'savePath':_0x4a7aa1})[_0x0f0b('0x11')](function(_0x381118){_0x1f5082(null,_0x381118);})[_0x0f0b('0x13')](function(_0x10c331){_0x1f5082(_0x10c331);});};AGIVertices['prototype'][_0x0f0b('0x43')]=function(_0x59b7ff,_0x20c01c,_0x238323,_0x4fd216,_0x584a89){this['rpc'][_0x0f0b('0x43')]({'uniqueid':this[_0x0f0b('0x38')]['uniqueid'],'body':_0x59b7ff,'direction':_0x20c01c,'providerName':_0x238323,'providerResponse':_0x4fd216})[_0x0f0b('0x11')](function(_0x1e9397){if(_0x584a89){_0x584a89(null,_0x1e9397);}})[_0x0f0b('0x13')](function(_0x677129){if(_0x584a89){_0x584a89(_0x677129);}});};AGIVertices[_0x0f0b('0xf')]['createCmContact']=function(_0x3c373a,_0x3b1ae9){this['rpc'][_0x0f0b('0x44')]({'firstName':_['isEmpty'](_0x3c373a['name'])||_[_0x0f0b('0x45')](_0x3c373a['name'])?'callback_'+Math[_0x0f0b('0x46')]():_0x3c373a[_0x0f0b('0x12')],'lastName':_['isEmpty'](_0x3c373a[_0x0f0b('0x47')])||_[_0x0f0b('0x45')](_0x3c373a[_0x0f0b('0x47')])?null:_0x3c373a[_0x0f0b('0x47')],'phone':_0x3c373a[_0x0f0b('0x48')],'ListId':_0x3c373a[_0x0f0b('0x49')],'scheduledat':_0x3c373a[_0x0f0b('0x4a')],'callbackUniqueid':this[_0x0f0b('0x38')][_0x0f0b('0x3b')],'tags':'callback','description':_0x0f0b('0x4b')+_0x3c373a[_0x0f0b('0x4a')][_0x0f0b('0x4c')](),'priority':_0x3c373a[_0x0f0b('0x4d')]})['then'](function(_0x3b873d){_0x3b1ae9(null,_0x3b873d);})[_0x0f0b('0x13')](function(_0x2b88f8){_0x3b1ae9(_0x2b88f8);});};AGIVertices[_0x0f0b('0xf')][_0x0f0b('0x4e')]=function(_0x5da44e,_0xdfad7f){this[_0x0f0b('0xd')][_0x0f0b('0x4f')](_0x5da44e)[_0x0f0b('0x11')](function(_0x375f0f){_0xdfad7f(null,_0x375f0f?_0x375f0f[_0x0f0b('0x12')]:![]);})[_0x0f0b('0x13')](function(_0x4b6520){_0xdfad7f(_0x4b6520);});};AGIVertices[_0x0f0b('0xf')][_0x0f0b('0x50')]=function(_0xa2db5a,_0x465c7e,_0x5c4649){var _0x5718fc={'role':_0x0f0b('0x51')};_0x5718fc[_0xa2db5a]=this['channel'][_0x0f0b('0x39')];this[_0x0f0b('0xd')][_0x0f0b('0x50')](_0x5718fc,_0x465c7e,this['channel'][_0x0f0b('0x3b')])['then'](function(_0xb61db){_0x5c4649(null,_['isNil'](_0xb61db)?![]:!![]);})['catch'](function(_0x28a97f){logger[_0x0f0b('0x29')](_0x28a97f);_0x5c4649(null,![]);});};AGIVertices[_0x0f0b('0xf')][_0x0f0b('0x52')]=function(_0x282005,_0xb1096d){var _0x94d180={'role':'agent'};_0x94d180[_0x282005]=this[_0x0f0b('0x38')][_0x0f0b('0x39')];this[_0x0f0b('0xd')][_0x0f0b('0x52')](_0x94d180)[_0x0f0b('0x11')](function(_0x58d21c){_0xb1096d(null,_[_0x0f0b('0x45')](_0x58d21c)?![]:!![]);})[_0x0f0b('0x13')](function(_0x4c3ae4){logger['error'](_0x4c3ae4);_0xb1096d(null,![]);});};AGIVertices[_0x0f0b('0xf')][_0x0f0b('0x53')]=function(_0x510903,_0x303259){var _0x1c4ba3={'role':_0x0f0b('0x51')};_0x1c4ba3[_0x510903]=this[_0x0f0b('0x38')][_0x0f0b('0x39')];this[_0x0f0b('0xd')][_0x0f0b('0x53')](_0x1c4ba3)[_0x0f0b('0x11')](function(_0x23e450){_0x303259(null,_[_0x0f0b('0x45')](_0x23e450)?![]:!![]);})[_0x0f0b('0x13')](function(_0x1f69a4){logger[_0x0f0b('0x29')](_0x1f69a4);_0x303259(null,![]);});};AGIVertices[_0x0f0b('0xf')][_0x0f0b('0x54')]=function(_0x247e35,_0x192c04){var _0x18700a={'role':_0x0f0b('0x51')};_0x18700a[_0x247e35]=this[_0x0f0b('0x38')][_0x0f0b('0x39')];var _0x428209=_0x247e35!=_0x0f0b('0x55')?util[_0x0f0b('0x25')](_0x0f0b('0x56'),_0x0f0b('0x57'),this[_0x0f0b('0x38')][_0x0f0b('0x39')]):undefined;this[_0x0f0b('0xd')]['agentLogin'](_0x18700a,_0x428209)[_0x0f0b('0x11')](function(_0x187e44){_0x192c04(null,_[_0x0f0b('0x45')](_0x187e44)?![]:!![]);})['catch'](function(_0x4e4dd5){logger['error'](_0x4e4dd5);_0x192c04(null,![]);});};AGIVertices[_0x0f0b('0xf')][_0x0f0b('0x58')]=function(_0xcfa93e,_0x4ad982){sh[_0x0f0b('0x59')](_[_0x0f0b('0x5a')](_0xcfa93e),function(_0x5b7b35,_0x194ec8){var _0x11b1fe=_0x194ec8[_0x0f0b('0x5b')](/(\r\n|\n|\r)/gm,'');_0x4ad982(null,_0x11b1fe);});};AGIVertices[_0x0f0b('0xf')]['googleCloudTTS']=function(_0x8bf17,_0x5d6403){scripts['googleCloudTTS'](_0x8bf17[_0x0f0b('0x5c')],_0x8bf17[_0x0f0b('0x5d')]||_0x0f0b('0x5e'),_0x8bf17[_0x0f0b('0x5e')],_0x8bf17['languageCode']||'en-US',_0x8bf17[_0x0f0b('0x5f')]||_0x0f0b('0x60'),_0x8bf17['audioEncoding']||_0x0f0b('0x61'))[_0x0f0b('0x11')](function(_0x410fef){_0x5d6403(null,_0x410fef);})[_0x0f0b('0x13')](function(_0x6343d2){_0x5d6403(_0x6343d2);});};AGIVertices[_0x0f0b('0xf')][_0x0f0b('0x62')]=function(_0x49012d,_0x3b045d){scripts[_0x0f0b('0x62')](_0x49012d[_0x0f0b('0x5e')],_0x49012d[_0x0f0b('0x63')]||'en',0x1)[_0x0f0b('0x11')](function(_0x79eb21){_0x3b045d(null,_0x79eb21);})[_0x0f0b('0x13')](function(_0x31a8e7){_0x3b045d(_0x31a8e7);});};AGIVertices['prototype'][_0x0f0b('0x64')]=function(_0x20b82f,_0x861d3f){var _0x58cca8={'uri':_0x20b82f['url'],'method':_0x20b82f['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x20b82f[_0x0f0b('0x65')])===_0x0f0b('0x66')&&parseInt(_0x20b82f[_0x0f0b('0x65')])>=0x1?parseInt(_0x20b82f[_0x0f0b('0x65')])*0x3e8:0x5*0x3e8};if(_[_0x0f0b('0x67')](['POST',_0x0f0b('0x68')],_0x58cca8['method']['toUpperCase']())){try{_0x58cca8[_0x0f0b('0x69')]=_0x20b82f[_0x0f0b('0xa')]?JSON[_0x0f0b('0x6a')](_0x20b82f[_0x0f0b('0xa')]):{};}catch(_0x274dca){logger[_0x0f0b('0x29')](_0x0f0b('0x6b'),_0x274dca);}}try{_0x58cca8[_0x0f0b('0x6c')]=_0x20b82f[_0x0f0b('0x9')]?JSON[_0x0f0b('0x6a')](_0x20b82f[_0x0f0b('0x9')]):{};}catch(_0x33683e){logger[_0x0f0b('0x29')]('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x33683e);}if(_0x20b82f[_0x0f0b('0x6d')]){try{var _0x141547=require(_0x20b82f[_0x0f0b('0x6d')])['sync'](this,_0x58cca8);_0x58cca8[_0x0f0b('0x6e')]=Mustache['render'](_0x20b82f[_0x0f0b('0x6f')],_0x141547,{},['$$','$$']);if(_0x58cca8['headers']){_0x58cca8[_0x0f0b('0x6c')]=JSON[_0x0f0b('0x6a')](Mustache['render'](JSON['stringify'](_0x58cca8[_0x0f0b('0x6c')]),_0x141547,{},['$$','$$']));}if(_0x58cca8[_0x0f0b('0x69')]){_0x58cca8['body']=JSON[_0x0f0b('0x6a')](Mustache[_0x0f0b('0x70')](JSON[_0x0f0b('0x71')](_0x58cca8[_0x0f0b('0x69')]),_0x141547,{},['$$','$$']));}}catch(_0x1cf692){logger[_0x0f0b('0x29')](_0x0f0b('0x72'),_0x1cf692);}}rp(_0x58cca8)[_0x0f0b('0x11')](function(_0x3c75d7){var _0x5308dc={'statusCode':_0x3c75d7['statusCode']||0xc8,'statusMessage':_0x3c75d7[_0x0f0b('0x73')]||'OK','headers':_0x3c75d7['headers']||{},'body':_0x3c75d7[_0x0f0b('0x69')]||{}};_0x861d3f(null,_0x5308dc);})[_0x0f0b('0x13')](function(_0x4cebd3){var _0x3f962d={'statusCode':_0x4cebd3['statusCode']||0x1f4,'statusMessage':_0x4cebd3[_0x0f0b('0x74')]||_0x0f0b('0x75'),'headers':_0x4cebd3[_0x0f0b('0x76')]['headers']||{},'body':_0x4cebd3[_0x0f0b('0x76')][_0x0f0b('0x69')]||{}};_0x861d3f(null,_0x3f962d);});};AGIVertices[_0x0f0b('0xf')]['googleDialogflow']=function(_0x5b3fbc,_0x354bd5){scripts[_0x0f0b('0x77')](this['channel']['uniqueid'],_0x5b3fbc[_0x0f0b('0x78')],_0x5b3fbc['text'],_0x5b3fbc['dialogflow_language']||'en')[_0x0f0b('0x11')](function(_0x10097e){_0x354bd5(null,_0x10097e);})[_0x0f0b('0x13')](function(_0x20b1ae){_0x354bd5(_0x20b1ae);});};AGIVertices[_0x0f0b('0xf')][_0x0f0b('0x79')]=function(_0x5aa3e8,_0x243fb0){scripts[_0x0f0b('0x79')](this[_0x0f0b('0x38')][_0x0f0b('0x3b')],_0x5aa3e8['dialogflowV2_project_id'],_0x5aa3e8[_0x0f0b('0x7a')],_0x5aa3e8[_0x0f0b('0x7b')],_0x5aa3e8[_0x0f0b('0x5e')],_0x5aa3e8[_0x0f0b('0x7c')]||'en')[_0x0f0b('0x11')](function(_0x353587){_0x243fb0(null,_0x353587);})[_0x0f0b('0x13')](function(_0x2845e0){_0x243fb0(_0x2845e0);});};AGIVertices['prototype']['sestekNDA']=function(_0x5c7e34,_0x173d69){scripts[_0x0f0b('0x7d')](this[_0x0f0b('0x38')],_0x5c7e34)['then'](function(_0x566c3a){_0x173d69(null,_0x566c3a);})['catch'](function(_0x5e2b12){_0x173d69(_0x5e2b12);});};AGIVertices['prototype'][_0x0f0b('0x7e')]=function(_0x3aa7af,_0x39fa07){scripts[_0x0f0b('0x7e')](_0x3aa7af[_0x0f0b('0x78')],_0x3aa7af[_0x0f0b('0x5e')],_0x3aa7af[_0x0f0b('0x7f')]||_0x0f0b('0x80'),_0x3aa7af['speed'])[_0x0f0b('0x11')](function(_0x2e6a81){_0x39fa07(null,_0x2e6a81);})[_0x0f0b('0x13')](function(_0x13601e){_0x39fa07(_0x13601e);});};AGIVertices['prototype']['ispeechASR']=function(_0x18b732,_0x2370d4,_0x241fcd){scripts[_0x0f0b('0x81')](_0x2370d4,_0x18b732[_0x0f0b('0x78')],_0x18b732['ispeech_asr_language']||'en-US',this[_0x0f0b('0x82')](_0x18b732['model'])?_0x18b732[_0x0f0b('0x83')]:undefined)['then'](function(_0x4b4c33){_0x241fcd(null,_0x4b4c33);})[_0x0f0b('0x13')](function(_0x25d160){_0x241fcd(_0x25d160);});};AGIVertices['prototype'][_0x0f0b('0x84')]=function(_0x7d8b77,_0x2fd386){scripts[_0x0f0b('0x84')](_0x7d8b77['aws_access_key_id'],_0x7d8b77['aws_secret_access_key'],_0x7d8b77['aws_polly_region'],_0x7d8b77[_0x0f0b('0x85')]||_0x0f0b('0x86'),_0x7d8b77['text'],_0x7d8b77['aws_text_type']||_0x0f0b('0x5e'))[_0x0f0b('0x11')](function(_0x31dbf0){_0x2fd386(null,_0x31dbf0);})[_0x0f0b('0x13')](function(_0x301538){_0x2fd386(_0x301538);});};AGIVertices[_0x0f0b('0xf')]['awsLex']=function(_0x2ec75d,_0x9a355a){scripts[_0x0f0b('0x87')](this[_0x0f0b('0x38')][_0x0f0b('0x3b')],_0x2ec75d[_0x0f0b('0x88')],_0x2ec75d[_0x0f0b('0x89')],_0x2ec75d[_0x0f0b('0x8a')],_0x2ec75d[_0x0f0b('0x5e')],_0x2ec75d['aws_bot_name'])['then'](function(_0x10cd5d){_0x9a355a(null,_0x10cd5d);})['catch'](function(_0x55f526){_0x9a355a(_0x55f526);});};AGIVertices[_0x0f0b('0xf')][_0x0f0b('0x8b')]=function(_0x565cfa,_0x19cbab,_0x347dfa){scripts[_0x0f0b('0x8b')](_0x19cbab,_0x565cfa['key'],_0x565cfa[_0x0f0b('0x8c')]||_0x0f0b('0x80'))[_0x0f0b('0x11')](function(_0x325927){_0x347dfa(null,_0x325927);})[_0x0f0b('0x13')](function(_0x5dc0b9){_0x347dfa(_0x5dc0b9);});};AGIVertices['prototype'][_0x0f0b('0x8d')]=function(_0x82dcda,_0x116090,_0x475dcc){scripts[_0x0f0b('0x8d')](_0x116090,_0x82dcda['appid'],_0x82dcda[_0x0f0b('0x8e')],_0x82dcda['uri'])[_0x0f0b('0x11')](function(_0x4b1472){_0x475dcc(null,_0x4b1472);})[_0x0f0b('0x13')](function(_0x578481){_0x475dcc(_0x578481);});};AGIVertices[_0x0f0b('0xf')]['clear']=function(_0x47d422){var _0x489a26=_[_0x0f0b('0x67')](verticesWithRetry,_0x47d422[_0x0f0b('0x36')])?_0x47d422:_[_0x0f0b('0x8f')](_0x47d422);for(var _0x26fe89 in _0x489a26){if(_0x489a26['hasOwnProperty'](_0x26fe89)){if(_0x489a26[_0x26fe89]&&_[_0x0f0b('0x90')](_0x489a26[_0x26fe89])){if(_[_0x0f0b('0x67')](recursiveMapAttributes,_0x26fe89)){_0x489a26[_0x26fe89]=this['replaceObjectAllVariables'](_0x489a26[_0x26fe89]);}else{_0x489a26[_0x26fe89]=this[_0x0f0b('0x91')](_0x489a26[_0x26fe89]);}}}}return _0x489a26;};AGIVertices[_0x0f0b('0xf')]['recursiveNodeIndex']=function(_0x1fcc13){for(var _0xbbc5a9 in _0x1fcc13){if(_0x1fcc13[_0x0f0b('0x92')](_0xbbc5a9)){if(_[_0x0f0b('0x93')](_0x1fcc13[_0xbbc5a9])){this['recursiveNodeIndex'](_0x1fcc13[_0xbbc5a9]);}else if(_[_0x0f0b('0x94')](_0x1fcc13[_0xbbc5a9])){for(var _0x49a457=0x0;_0x49a457<_0x1fcc13[_0xbbc5a9][_0x0f0b('0x95')];_0x49a457++){this[_0x0f0b('0x96')](_0x1fcc13[_0xbbc5a9][_0x49a457]);}}else if(_[_0x0f0b('0x90')](_0x1fcc13[_0xbbc5a9])){_0x1fcc13[_0xbbc5a9]=this['replaceAllVariables'](_0x1fcc13[_0xbbc5a9]);}}}};AGIVertices[_0x0f0b('0xf')]['saveRestApiResult']=function(_0x26870f,_0x470cec){for(var _0x36d90b in _0x26870f){if(_0x26870f[_0x0f0b('0x92')](_0x36d90b)){if(_[_0x0f0b('0x93')](_0x26870f[_0x36d90b])){if(!_[_0x0f0b('0x97')](_0x26870f[_0x36d90b])){this['saveRestApiResult'](_0x26870f[_0x36d90b],util[_0x0f0b('0x25')](_0x0f0b('0x98'),_0x470cec,_0x36d90b));}}else if(_[_0x0f0b('0x94')](_0x26870f[_0x36d90b])){for(var _0xad0b09=0x0;_0xad0b09<_0x26870f[_0x36d90b][_0x0f0b('0x95')];_0xad0b09++){this[_0x0f0b('0x99')](_0x26870f[_0x36d90b][_0xad0b09],util[_0x0f0b('0x25')]('%s.%s',_0x470cec,_0x36d90b+'['+_0xad0b09+']'));}}else{if(!_[_0x0f0b('0x45')](_0x26870f[_0x36d90b])){this[_0x0f0b('0x38')][_0x0f0b('0x9a')](util['format']('%s.%s',_0x470cec,_0x36d90b),_0x26870f[_0x36d90b]);}}}}};AGIVertices[_0x0f0b('0xf')][_0x0f0b('0x9b')]=function(_0x49c3ea){try{var _0x5b535c=JSON[_0x0f0b('0x6a')](_0x49c3ea);this[_0x0f0b('0x96')](_0x5b535c);return JSON['stringify'](_0x5b535c);}catch(_0x3e3d7c){return this[_0x0f0b('0x91')](_0x49c3ea);}};AGIVertices[_0x0f0b('0xf')][_0x0f0b('0x91')]=function(_0x28bb1a){var _0x28cacd=_0x28bb1a[_0x0f0b('0x9c')]('{');for(var _0x7b38b9=0x1;_0x7b38b9<_0x28cacd[_0x0f0b('0x95')];_0x7b38b9+=0x1){var _0x785406=_0x28cacd[_0x7b38b9][_0x0f0b('0x9c')]('}');if(_0x785406[_0x0f0b('0x95')]>0x1){_0x28bb1a=_0x28bb1a[_0x0f0b('0x9d')]('{'+_0x785406[0x0]+'}',this['channel'][_0x0f0b('0x10')](_0x785406[0x0])[_0x0f0b('0x9e')]||_0x785406[0x0]);}}if(_0x28cacd[_0x0f0b('0x95')]===0x1){return _0x28bb1a[_0x0f0b('0x4c')]();}return this['replaceAllVariables'](_0x28bb1a);};AGIVertices[_0x0f0b('0xf')]['getAndSetVariable']=function(_0x3a8784,_0x1b0ea0){var _0x3ce5d6=this[_0x0f0b('0x38')]['getVariable'](_0x3a8784);if(_0x3ce5d6[_0x0f0b('0x9f')]===-0x1){return _0x3ce5d6;}logger[_0x0f0b('0x2a')](util[_0x0f0b('0x25')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x1b0ea0,_0x3ce5d6[_0x0f0b('0x9e')]));return this[_0x0f0b('0x38')][_0x0f0b('0x9a')](_0x1b0ea0,_0x3ce5d6['extra']);};AGIVertices['prototype'][_0x0f0b('0x82')]=function(_0x140551){return _0x140551&&_0x140551!=='0'&&_0x140551!=='-1'&&_0x140551!=='';};AGIVertices[_0x0f0b('0xf')]['maxRetry']=function(_0x354fdd){this[_0x0f0b('0x34')][_0x0f0b('0xa0')](this,_0x354fdd,'-');_0x354fdd['retry']=_0x354fdd[_0x0f0b('0xa1')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x0f0b('0xf')][_0x0f0b('0xa2')]=function(_0x314897){logger['info'](util[_0x0f0b('0x25')](_0x0f0b('0xa3'),_0x314897[_0x0f0b('0x35')]));if(!this[_0x0f0b('0x82')](_0x314897[_0x0f0b('0x5e')])){return this[_0x0f0b('0x38')]['noop'](_0x0f0b('0xa4'));}var _0x2f38d2='\x22'+_0x314897[_0x0f0b('0x5e')]+'\x22';if(this[_0x0f0b('0x82')](_0x314897[_0x0f0b('0x76')])){_0x2f38d2+=','+_0x314897[_0x0f0b('0x76')];}var _0x368edb=this[_0x0f0b('0x38')]['exec'](_0x0f0b('0xa5'),_0x2f38d2);if(_0x368edb[_0x0f0b('0x9f')]===-0x1){return _0x368edb;}return this[_0x0f0b('0x38')][_0x0f0b('0xa6')](util[_0x0f0b('0x25')](_0x0f0b('0xa7'),_0x2f38d2));};AGIVertices['prototype']['mrcprecog']=function(_0x4286db){logger[_0x0f0b('0x2a')](util[_0x0f0b('0x25')](_0x0f0b('0xa8'),_0x4286db[_0x0f0b('0x35')]));if(!this[_0x0f0b('0x82')](_0x4286db[_0x0f0b('0xa9')])){return this[_0x0f0b('0x38')]['noop'](_0x0f0b('0xaa'));}var _0x107897=_0x4286db[_0x0f0b('0xa9')];if(this[_0x0f0b('0x82')](_0x4286db['options'])){_0x107897+=','+_0x4286db[_0x0f0b('0x76')];}var _0x59d053=this[_0x0f0b('0x38')][_0x0f0b('0x59')](_0x0f0b('0xab'),_0x107897);if(_0x59d053[_0x0f0b('0x9f')]===-0x1){return _0x59d053;}var _0x1a0e73=this[_0x0f0b('0xac')](_0x0f0b('0xad'),'MRCP_RECOG_CONFIDENCE');if(_0x1a0e73[_0x0f0b('0x9f')]===-0x1){return _0x1a0e73;}var _0x47e964=this[_0x0f0b('0xac')](_0x0f0b('0xae'),_0x0f0b('0xaf'));if(_0x47e964[_0x0f0b('0x9f')]===-0x1){return _0x47e964;}var _0x41ec22=this[_0x0f0b('0xac')](_0x0f0b('0xb0'),_0x0f0b('0xb1'));if(_0x41ec22[_0x0f0b('0x9f')]===-0x1){return _0x41ec22;}return this[_0x0f0b('0x38')][_0x0f0b('0xa6')](util[_0x0f0b('0x25')](_0x0f0b('0xb2'),_0x107897));};AGIVertices[_0x0f0b('0xf')][_0x0f0b('0xb3')]=function(_0x3e5fe1){logger[_0x0f0b('0x2a')](util[_0x0f0b('0x25')](_0x0f0b('0xb4'),_0x3e5fe1[_0x0f0b('0x35')]));return this['channel']['agi']([_0x3e5fe1[_0x0f0b('0xb5')],_0x3e5fe1[_0x0f0b('0xb6')]]);};AGIVertices[_0x0f0b('0xf')]['answer']=function(_0x5f412e){logger['info'](util['format'](_0x0f0b('0xb7'),_0x5f412e[_0x0f0b('0x35')]));if(this[_0x0f0b('0x82')](_0x5f412e[_0x0f0b('0x65')])){logger['info'](util[_0x0f0b('0x25')](_0x0f0b('0xb8'),_0x5f412e[_0x0f0b('0x65')]));var _0x20dacb=this[_0x0f0b('0x38')][_0x0f0b('0xb9')](_0x5f412e['timeout']);if(_0x20dacb[_0x0f0b('0x9f')]===-0x1){return _0x20dacb;}}return this[_0x0f0b('0x38')][_0x0f0b('0xba')]();};AGIVertices[_0x0f0b('0xf')][_0x0f0b('0xbb')]=function(_0x3608f2){logger[_0x0f0b('0x2a')](util[_0x0f0b('0x25')](_0x0f0b('0xbc'),_0x3608f2[_0x0f0b('0x35')]));if(!this[_0x0f0b('0x82')](_0x3608f2['list_id'])){return this[_0x0f0b('0x38')][_0x0f0b('0x29')](_0x3608f2,_0x0f0b('0xbd'));}_0x3608f2[_0x0f0b('0x4a')]=moment();if(this['isConfigured'](_0x3608f2[_0x0f0b('0xbe')])){_0x3608f2[_0x0f0b('0x4a')]=moment()[_0x0f0b('0xbf')](_0x3608f2[_0x0f0b('0xbe')],'minutes');}if(!this[_0x0f0b('0x82')](_0x3608f2[_0x0f0b('0x4d')])){_0x3608f2['callback_priority']=0x2;}this[_0x0f0b('0x44')][_0x0f0b('0xa0')](this,_0x3608f2);return this['channel'][_0x0f0b('0xa6')](util[_0x0f0b('0x25')](_0x0f0b('0xc0'),_0x3608f2[_0x0f0b('0x48')],_0x3608f2[_0x0f0b('0x49')],_0x3608f2[_0x0f0b('0x4a')]));};AGIVertices[_0x0f0b('0xf')][_0x0f0b('0xc1')]=function(_0xb6f7ff){logger[_0x0f0b('0x2a')](util[_0x0f0b('0x25')](_0x0f0b('0xc2'),_0xb6f7ff[_0x0f0b('0x35')]));var _0x56e991=this[_0x0f0b('0x38')][_0x0f0b('0x59')](_0xb6f7ff[_0x0f0b('0xc3')],_0xb6f7ff['options']);if(_0x56e991['result']===-0x1){return _0x56e991;}return this[_0x0f0b('0x38')]['noop'](util[_0x0f0b('0x25')]('Executed\x20command\x20%s\x20%s',_0xb6f7ff[_0x0f0b('0xc3')],_0xb6f7ff['options']));};AGIVertices[_0x0f0b('0xf')][_0x0f0b('0xc4')]=function(_0x3d1131){logger[_0x0f0b('0x2a')](util[_0x0f0b('0x25')](_0x0f0b('0xc5'),_0x3d1131[_0x0f0b('0x35')]));if(!this[_0x0f0b('0x82')](_0x3d1131[_0x0f0b('0x5e')])){return this[_0x0f0b('0x38')][_0x0f0b('0xa6')](_0x0f0b('0xa4'));}var _0x3e8dfc='\x22'+_0x3d1131[_0x0f0b('0x5e')]+'\x22';if(this[_0x0f0b('0x82')](_0x3d1131[_0x0f0b('0x76')])){_0x3e8dfc+=','+_0x3d1131['options'];}var _0x5d1fa7=this[_0x0f0b('0x38')][_0x0f0b('0x59')]('MRCPSynth',_0x3e8dfc);if(_0x5d1fa7[_0x0f0b('0x9f')]===-0x1){return _0x5d1fa7;}return this[_0x0f0b('0x38')][_0x0f0b('0xa6')](util['format'](_0x0f0b('0xa7'),_0x3e8dfc));};AGIVertices[_0x0f0b('0xf')][_0x0f0b('0xc6')]=function(_0x580ba3){logger[_0x0f0b('0x2a')](util[_0x0f0b('0x25')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x580ba3[_0x0f0b('0x35')]));if(!this[_0x0f0b('0x82')](_0x580ba3[_0x0f0b('0x5e')])){return this[_0x0f0b('0x38')][_0x0f0b('0xa6')](_0x0f0b('0xa4'));}var _0x432319='\x22'+_0x580ba3[_0x0f0b('0x5e')]+'\x22';if(this[_0x0f0b('0x82')](_0x580ba3[_0x0f0b('0x76')])){_0x432319+=','+_0x580ba3['options'];}var _0x291afb=this['channel'][_0x0f0b('0x59')](_0x0f0b('0xa5'),_0x432319);if(_0x291afb[_0x0f0b('0x9f')]===-0x1){return _0x291afb;}return this['channel'][_0x0f0b('0xa6')](util['format'](_0x0f0b('0xa7'),_0x432319));};AGIVertices[_0x0f0b('0xf')][_0x0f0b('0xc7')]=function(_0x2f5d39){logger['info'](util[_0x0f0b('0x25')](_0x0f0b('0xc8'),_0x2f5d39[_0x0f0b('0x35')]));if(!this[_0x0f0b('0x82')](_0x2f5d39[_0x0f0b('0xa9')])){return this[_0x0f0b('0x38')]['noop'](_0x0f0b('0xaa'));}var _0x1ee46c=_0x2f5d39['grammar'];if(this['isConfigured'](_0x2f5d39[_0x0f0b('0x76')])){_0x1ee46c+=','+_0x2f5d39[_0x0f0b('0x76')];}var _0x3a2798=this['channel']['exec'](_0x0f0b('0xab'),_0x1ee46c);if(_0x3a2798[_0x0f0b('0x9f')]===-0x1){return _0x3a2798;}var _0x481933=this['getAndSetVariable'](_0x0f0b('0xad'),_0x0f0b('0xc9'));if(_0x481933[_0x0f0b('0x9f')]===-0x1){return _0x481933;}var _0x15aac2=this[_0x0f0b('0xac')](_0x0f0b('0xae'),_0x0f0b('0xca'));if(_0x15aac2[_0x0f0b('0x9f')]===-0x1){return _0x15aac2;}var _0x1022d2=this[_0x0f0b('0xac')](_0x0f0b('0xb0'),'LUMENVOX_ASR_INSTANCE');if(_0x1022d2[_0x0f0b('0x9f')]===-0x1){return _0x1022d2;}return this['channel'][_0x0f0b('0xa6')](util[_0x0f0b('0x25')](_0x0f0b('0xb2'),_0x1ee46c));};AGIVertices[_0x0f0b('0xf')][_0x0f0b('0xcb')]=function(_0x158426){logger['info'](util[_0x0f0b('0x25')](_0x0f0b('0xcc'),_0x158426[_0x0f0b('0x35')]));if(!this[_0x0f0b('0x82')](_0x158426[_0x0f0b('0xa9')])){return this[_0x0f0b('0x38')][_0x0f0b('0xa6')](_0x0f0b('0xaa'));}var _0x70486c=_0x158426['grammar'];if(this[_0x0f0b('0x82')](_0x158426[_0x0f0b('0x76')])){_0x70486c+=','+_0x158426['options'];}var _0x3ddded=this[_0x0f0b('0x38')]['exec'](_0x0f0b('0xab'),_0x70486c);if(_0x3ddded[_0x0f0b('0x9f')]===-0x1){return _0x3ddded;}var _0x539a93=this[_0x0f0b('0xac')]('RECOG_CONFIDENCE()',_0x0f0b('0xcd'));if(_0x539a93[_0x0f0b('0x9f')]===-0x1){return _0x539a93;}var _0x3b640c=this['getAndSetVariable'](_0x0f0b('0xae'),_0x0f0b('0xce'));if(_0x3b640c['result']===-0x1){return _0x3b640c;}var _0x14c881=this[_0x0f0b('0xac')](_0x0f0b('0xb0'),_0x0f0b('0xcf'));if(_0x14c881['result']===-0x1){return _0x14c881;}return this[_0x0f0b('0x38')][_0x0f0b('0xa6')](util[_0x0f0b('0x25')](_0x0f0b('0xb2'),_0x70486c));};AGIVertices[_0x0f0b('0xf')]['database']=function(_0x53c94f){logger[_0x0f0b('0x2a')](util[_0x0f0b('0x25')]('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x53c94f['label']));if(!this['isConfigured'](_0x53c94f['odbc_id'])){return this[_0x0f0b('0x38')][_0x0f0b('0x29')](_0x53c94f,_0x0f0b('0xd0'));}var _0x583c9a=this['getSquareOdbc']['sync'](this,_0x53c94f[_0x0f0b('0xd1')]);if(!_0x583c9a){return this[_0x0f0b('0x38')]['error'](_0x53c94f,_0x0f0b('0xd2'));}if(!this['isConfigured'](_0x53c94f['query'])){return this[_0x0f0b('0x38')]['error'](_0x53c94f,_0x0f0b('0xd3'));}var _0x4e2f8f=_0x53c94f['query'][_0x0f0b('0x5b')](/(\r\n|\n|\r)/gm,'\x20');this[_0x0f0b('0x38')][_0x0f0b('0xa6')](util[_0x0f0b('0x25')](_0x0f0b('0xd4'),_0x4e2f8f));var _0x502831=this[_0x0f0b('0x27')][_0x0f0b('0xa0')](this,_0x583c9a,_0x4e2f8f);this[_0x0f0b('0x34')][_0x0f0b('0xa0')](this,_0x53c94f,_0x4e2f8f);if(!this[_0x0f0b('0x82')](_0x53c94f[_0x0f0b('0xd5')])){return this[_0x0f0b('0x38')]['noop'](_0x0f0b('0xd6'));}var _0x10120e=this[_0x0f0b('0x10')][_0x0f0b('0xa0')](this,_0x53c94f[_0x0f0b('0xd5')]);if(!_0x10120e){return this[_0x0f0b('0x38')][_0x0f0b('0x29')](_0x53c94f,_0x0f0b('0xd7'));}var _0x4b7c06=this;_0x502831[_0x0f0b('0xd8')](function(_0x31bb9f,_0x4dba07){Object[_0x0f0b('0xd9')](_0x31bb9f)[_0x0f0b('0xd8')](function(_0x2d6ea5){_0x4b7c06[_0x0f0b('0x38')][_0x0f0b('0x9a')](util[_0x0f0b('0x25')](_0x0f0b('0xda'),_0x10120e,_0x4dba07,_0x2d6ea5),_0x31bb9f[_0x2d6ea5]);});});this[_0x0f0b('0x38')][_0x0f0b('0x9a')](util[_0x0f0b('0x25')](_0x0f0b('0xdb'),_0x10120e),_0x502831[_0x0f0b('0x95')]);return this[_0x0f0b('0x38')][_0x0f0b('0xa6')](util[_0x0f0b('0x25')]('variable\x20%s\x20set',_0x10120e));};AGIVertices[_0x0f0b('0xf')][_0x0f0b('0xdc')]=function(_0x346e8b){logger[_0x0f0b('0xdd')](util['format']('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x346e8b[_0x0f0b('0x35')]));if(!this[_0x0f0b('0x82')](_0x346e8b[_0x0f0b('0xde')])){return this[_0x0f0b('0x38')][_0x0f0b('0x29')](_0x346e8b,_0x0f0b('0xdf'));}var _0x531c34=this[_0x0f0b('0x17')][_0x0f0b('0xa0')](this,_0x346e8b[_0x0f0b('0xde')]);if(!_0x531c34){return this[_0x0f0b('0x38')][_0x0f0b('0x29')](_0x346e8b,_0x0f0b('0xe0'));}var _0x3383b3=this[_0x0f0b('0x38')][_0x0f0b('0x59')](_0x0f0b('0xe1'),[util[_0x0f0b('0x25')](_0x0f0b('0xe2'),_0x531c34),_0x346e8b[_0x0f0b('0x65')],_0x346e8b[_0x0f0b('0xe3')],_0x346e8b[_0x0f0b('0x6f')]]);if(_0x3383b3[_0x0f0b('0x9f')]===-0x1){return _0x3383b3;}return this[_0x0f0b('0x38')][_0x0f0b('0xa6')](util['format'](_0x0f0b('0xe4'),_0x0f0b('0xe1')));};AGIVertices[_0x0f0b('0xf')][_0x0f0b('0xe5')]=function(_0x18e59a){logger[_0x0f0b('0x2a')](util[_0x0f0b('0x25')](_0x0f0b('0xe6'),_0x18e59a[_0x0f0b('0x35')]));if(!this[_0x0f0b('0x82')](_0x18e59a[_0x0f0b('0x78')])){return this[_0x0f0b('0x38')][_0x0f0b('0xa6')](_0x0f0b('0xe7'));}if(!this[_0x0f0b('0x82')](_0x18e59a[_0x0f0b('0x5e')])){return this['channel']['noop'](_0x0f0b('0xa4'));}this['channel']['bot']=!![];this[_0x0f0b('0x34')](_0x18e59a);this[_0x0f0b('0x43')](_0x18e59a[_0x0f0b('0x5e')],'in','','');this[_0x0f0b('0x38')][_0x0f0b('0xa6')](util[_0x0f0b('0x25')]('Trying\x20Dialogflow:\x20%s',_0x18e59a[_0x0f0b('0x5e')]));var _0x4de5b0=this[_0x0f0b('0x77')][_0x0f0b('0xa0')](this,_0x18e59a);if(_0x4de5b0){for(var _0x235062 in _0x4de5b0){if(_0x4de5b0[_0x0f0b('0x92')](_0x235062)){this[_0x0f0b('0x38')][_0x0f0b('0x9a')](util[_0x0f0b('0x25')](_0x0f0b('0xe8'),_0x235062[_0x0f0b('0xe9')]()),_0x4de5b0[_0x235062]);}}this[_0x0f0b('0x43')](_0x4de5b0[_0x0f0b('0xea')],_0x0f0b('0xeb'),'dialogflow','');return this[_0x0f0b('0x38')][_0x0f0b('0xa6')](util[_0x0f0b('0x25')]('Dialogflow\x20Result\x20%s',_0x4de5b0['speech']));}return this[_0x0f0b('0x38')][_0x0f0b('0x29')](_0x18e59a,_0x0f0b('0xec'));};AGIVertices[_0x0f0b('0xf')][_0x0f0b('0xed')]=function(_0x6cdd97){logger[_0x0f0b('0x2a')](util[_0x0f0b('0x25')](_0x0f0b('0xee'),_0x6cdd97['label']));if(!this[_0x0f0b('0x82')](_0x6cdd97[_0x0f0b('0xef')])){return this[_0x0f0b('0x38')][_0x0f0b('0xa6')](_0x0f0b('0xf0'));}if(!this[_0x0f0b('0x82')](_0x6cdd97['client_email'])){return this[_0x0f0b('0x38')][_0x0f0b('0xa6')](_0x0f0b('0xf1'));}if(!this[_0x0f0b('0x82')](_0x6cdd97[_0x0f0b('0x7b')])){return this[_0x0f0b('0x38')][_0x0f0b('0xa6')](_0x0f0b('0xf2'));}if(!this[_0x0f0b('0x82')](_0x6cdd97[_0x0f0b('0x7c')])){return this['channel'][_0x0f0b('0xa6')](_0x0f0b('0xf3'));}if(!this[_0x0f0b('0x82')](_0x6cdd97[_0x0f0b('0x5e')])){return this[_0x0f0b('0x38')][_0x0f0b('0xa6')](_0x0f0b('0xa4'));}this[_0x0f0b('0x38')]['bot']=!![];this['createSquareDetailsReport'](_0x6cdd97);this[_0x0f0b('0x43')](_0x6cdd97[_0x0f0b('0x5e')],'in','','');this[_0x0f0b('0x38')]['noop'](util[_0x0f0b('0x25')](_0x0f0b('0xf4'),_0x6cdd97['text']));var _0x253816=this[_0x0f0b('0x79')][_0x0f0b('0xa0')](this,_0x6cdd97);if(_0x253816){for(var _0x31fca3 in _0x253816){if(_0x253816[_0x0f0b('0x92')](_0x31fca3)){if(_0x31fca3!=='providerResponse'){this[_0x0f0b('0x38')][_0x0f0b('0x9a')](util[_0x0f0b('0x25')]('DIALOGFLOW_%s',_0x31fca3['toUpperCase']()),_0x253816[_0x31fca3]);}}}this[_0x0f0b('0x43')](_0x253816[_0x0f0b('0xea')],_0x0f0b('0xeb'),'dialogflowV2',_0x253816[_0x0f0b('0xf5')]);return this[_0x0f0b('0x38')][_0x0f0b('0xa6')](util[_0x0f0b('0x25')]('DialogflowV2\x20Result\x20%s',_0x253816[_0x0f0b('0xea')]));}return this[_0x0f0b('0x38')][_0x0f0b('0x29')](_0x6cdd97,'DialogflowV2\x20is\x20unreachable');};AGIVertices['prototype'][_0x0f0b('0xf6')]=function(_0x2f1813){logger[_0x0f0b('0x2a')](util['format'](_0x0f0b('0xf7'),_0x2f1813[_0x0f0b('0x35')]));if(!this['isConfigured'](_0x2f1813[_0x0f0b('0xf8')])){return this[_0x0f0b('0x38')][_0x0f0b('0xa6')](_0x0f0b('0xf9'));}if(!this[_0x0f0b('0x82')](_0x2f1813[_0x0f0b('0xfa')])){return this[_0x0f0b('0x38')][_0x0f0b('0xa6')]('no\x20username\x20configured');}if(!this[_0x0f0b('0x82')](_0x2f1813[_0x0f0b('0xfb')])){return this[_0x0f0b('0x38')][_0x0f0b('0xa6')](_0x0f0b('0xfc'));}if(!this[_0x0f0b('0x82')](_0x2f1813[_0x0f0b('0xfd')])){return this[_0x0f0b('0x38')]['noop'](_0x0f0b('0xa4'));}this[_0x0f0b('0x38')][_0x0f0b('0xfe')]=!![];this[_0x0f0b('0x34')](_0x2f1813);this['createSquareMessage'](_0x2f1813[_0x0f0b('0x5e')],'in','','');this[_0x0f0b('0x38')][_0x0f0b('0xa6')](util[_0x0f0b('0x25')](_0x0f0b('0xff'),_0x2f1813['text']));var _0xfb2a8f=this[_0x0f0b('0x7d')][_0x0f0b('0xa0')](this,_0x2f1813);if(_0xfb2a8f){for(var _0x592bd in _0xfb2a8f){if(_0xfb2a8f['hasOwnProperty'](_0x592bd)){this[_0x0f0b('0x38')][_0x0f0b('0x9a')](util[_0x0f0b('0x25')](_0x0f0b('0x100'),_0x592bd[_0x0f0b('0xe9')]()),_0xfb2a8f[_0x592bd]);}}this[_0x0f0b('0x43')](_0xfb2a8f[_0x0f0b('0xea')],_0x0f0b('0xeb'),'sesteknda','');if(_0xfb2a8f['audiofile']){this['channel'][_0x0f0b('0xa6')](util[_0x0f0b('0x25')]('Sestek\x20NDA\x20%s\x20file\x20created',_0xfb2a8f[_0x0f0b('0x101')]));var _0x4aabcc=this[_0x0f0b('0x38')][_0x0f0b('0x102')](_0xfb2a8f[_0x0f0b('0x101')]);try{fs['unlink'](_0xfb2a8f['audiofile']+_0x0f0b('0x103'));}catch(_0x657ad1){logger[_0x0f0b('0x29')](_0x657ad1);}return _0x4aabcc;}else{return this[_0x0f0b('0x38')]['noop'](util[_0x0f0b('0x25')](_0x0f0b('0x104'),_0xfb2a8f[_0x0f0b('0xea')]));}}return this[_0x0f0b('0x38')][_0x0f0b('0x29')](_0x2f1813,_0x0f0b('0x105'));};AGIVertices[_0x0f0b('0xf')][_0x0f0b('0x106')]=function(_0x50ca38){logger[_0x0f0b('0x2a')](util[_0x0f0b('0x25')](_0x0f0b('0x107'),_0x50ca38['label']));return this[_0x0f0b('0x38')][_0x0f0b('0xa6')](_0x0f0b('0x106'));};AGIVertices[_0x0f0b('0xf')][_0x0f0b('0x108')]=function(_0x26d836){logger[_0x0f0b('0x2a')](util[_0x0f0b('0x25')](_0x0f0b('0x109'),_0x26d836[_0x0f0b('0x35')]));var _0x359829='';if(_0x26d836[_0x0f0b('0x10a')]){if(!this[_0x0f0b('0x82')](_0x26d836[_0x0f0b('0x10a')])){return this[_0x0f0b('0x38')][_0x0f0b('0x29')](_0x26d836,_0x0f0b('0x10b'));}else{var _0x2a812f=parseInt(_0x26d836['trunk_id'],0xa);if(isNaN(_0x2a812f)){_0x359829=_0x26d836[_0x0f0b('0x10a')];}else{_0x359829=this[_0x0f0b('0x19')][_0x0f0b('0xa0')](this,_0x26d836['trunk_id']);if(!_0x359829){return this[_0x0f0b('0x38')][_0x0f0b('0x29')](_0x26d836,_0x0f0b('0x10c'));}}}}else if(_0x26d836[_0x0f0b('0x10d')]){_0x359829=_0x26d836[_0x0f0b('0x10d')];}else{return this['channel'][_0x0f0b('0x29')](_0x26d836,'no\x20trunk\x20selected');}var _0x28f5c4=this[_0x0f0b('0x38')][_0x0f0b('0x59')](_0x0f0b('0xe1'),[util['format'](_0x0f0b('0x10e'),_0x359829,_0x26d836['phone']),_0x26d836[_0x0f0b('0x65')],_0x26d836[_0x0f0b('0xe3')],_0x26d836[_0x0f0b('0x6f')]]);if(_0x28f5c4[_0x0f0b('0x9f')]===-0x1){return _0x28f5c4;}return this['channel'][_0x0f0b('0xa6')](util[_0x0f0b('0x25')](_0x0f0b('0xe4'),'DIAL'));};AGIVertices['prototype'][_0x0f0b('0x10f')]=function(_0x17d8c7){logger[_0x0f0b('0x2a')](util[_0x0f0b('0x25')](_0x0f0b('0x110'),_0x17d8c7[_0x0f0b('0x35')]));return this[_0x0f0b('0x38')]['noop'](_0x0f0b('0x10f'));};AGIVertices[_0x0f0b('0xf')][_0x0f0b('0xc')]=function(_0xa3e563){logger[_0x0f0b('0x2a')](util[_0x0f0b('0x25')](_0x0f0b('0x111'),_0xa3e563[_0x0f0b('0x35')]));if(_0xa3e563[_0x0f0b('0x112')]===0x0){return this[_0x0f0b('0xa1')](_0xa3e563);}_0xa3e563['retry']-=0x1;if(!this[_0x0f0b('0x82')](_0xa3e563[_0x0f0b('0x113')])){return this[_0x0f0b('0x38')]['error'](_0xa3e563,_0x0f0b('0x114'));}var _0x1882c5=this['getSound'][_0x0f0b('0xa0')](this,_0xa3e563[_0x0f0b('0x113')]);if(!_0x1882c5){return this[_0x0f0b('0x38')][_0x0f0b('0x29')](_0xa3e563,'no\x20file\x20audio\x20found');}if(!this[_0x0f0b('0x82')](_0xa3e563[_0x0f0b('0xd5')])){return this[_0x0f0b('0x38')][_0x0f0b('0x29')](_0x0f0b('0xd6'));}var _0x3c974f=this[_0x0f0b('0x38')][_0x0f0b('0x115')](_0x1882c5,_0xa3e563[_0x0f0b('0x116')],_0xa3e563[_0x0f0b('0x117')]);var _0x45cb6b=_0x3c974f[_0x0f0b('0x9f')]?_0x3c974f[_0x0f0b('0x9f')][_0x0f0b('0x4c')]():'';logger[_0x0f0b('0x2a')](_0x0f0b('0x118'),JSON[_0x0f0b('0x71')](_0x3c974f));if(_0x3c974f['result']===-0x1){this[_0x0f0b('0x34')][_0x0f0b('0xa0')](this,_0xa3e563,_0x45cb6b);return _0x3c974f;}else if(_0x3c974f[_0x0f0b('0x9e')]===_0x0f0b('0x65')){_0x3c974f['result']=_0x45cb6b[_0x0f0b('0x95')]>=parseInt(_0xa3e563['mindigit'])?'x':'i';}else{_0x3c974f['result']=_0x45cb6b[_0x0f0b('0x95')]>=parseInt(_0xa3e563[_0x0f0b('0x119')])&&_0x45cb6b[_0x0f0b('0x95')]<=parseInt(_0xa3e563['maxdigit'])?'x':'i';}var _0xfe8757=this['getVariable']['sync'](this,_0xa3e563[_0x0f0b('0xd5')]);if(!_0xfe8757){return this[_0x0f0b('0x38')][_0x0f0b('0x29')](_0xa3e563,_0x0f0b('0xd7'));}this[_0x0f0b('0x38')][_0x0f0b('0x9a')](_0xfe8757,_0x45cb6b);if(this[_0x0f0b('0x82')](_0xa3e563[_0x0f0b('0x11a')])){var _0x36bb4e=parseInt(_0xa3e563[_0x0f0b('0x11a')],0xa);var _0x520c3a=rs['generate']({'charset':'*','length':_0x36bb4e});var _0x1ca3d6=_0x45cb6b['length'];if(_0x1ca3d6>0x0){if(_0x1ca3d6>_0x36bb4e){this['createSquareDetailsReport'][_0x0f0b('0xa0')](this,_0xa3e563,_0xa3e563[_0x0f0b('0x11b')]===_0x0f0b('0x11c')?_0x520c3a+_0x45cb6b['substr'](_0x36bb4e):_0x45cb6b[_0x0f0b('0x11d')](0x0,_0x1ca3d6-_0x36bb4e)+_0x520c3a);}else{this[_0x0f0b('0x34')][_0x0f0b('0xa0')](this,_0xa3e563,rs[_0x0f0b('0x11e')]({'charset':'*','length':_0x1ca3d6}));}}else{this['createSquareDetailsReport']['sync'](this,_0xa3e563,'');}}else{this['createSquareDetailsReport']['sync'](this,_0xa3e563,_0x45cb6b);}return _0x3c974f;};AGIVertices[_0x0f0b('0xf')][_0x0f0b('0x11f')]=function(_0x4d9275){logger['info'](util['format']('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x4d9275['label']));return this[_0x0f0b('0xc')](_0x4d9275);};AGIVertices[_0x0f0b('0xf')]['goal']=function(_0x551fb8){logger[_0x0f0b('0x2a')](util['format']('Enter\x20in\x20GOAL\x20(%s)\x20block',_0x551fb8[_0x0f0b('0x35')]));this[_0x0f0b('0x34')][_0x0f0b('0xa0')](this,_0x551fb8,_0x551fb8[_0x0f0b('0x120')]);return this[_0x0f0b('0x38')][_0x0f0b('0xa6')](util[_0x0f0b('0x25')](_0x0f0b('0x121'),_0x551fb8['goalname']));};AGIVertices[_0x0f0b('0xf')][_0x0f0b('0x122')]=function(_0x4411ce){logger[_0x0f0b('0x2a')](util[_0x0f0b('0x25')](_0x0f0b('0x123'),_0x4411ce[_0x0f0b('0x35')]));if(!this[_0x0f0b('0x82')](_0x4411ce['aws_access_key_id'])||!this[_0x0f0b('0x82')](_0x4411ce[_0x0f0b('0x89')])){return this[_0x0f0b('0x38')][_0x0f0b('0xa6')]('no\x20valid\x20credentials\x20configured');}if(!this[_0x0f0b('0x82')](_0x4411ce['text'])){return this['channel']['noop'](_0x0f0b('0xa4'));}this[_0x0f0b('0x38')][_0x0f0b('0xa6')](util['format'](_0x0f0b('0x124'),_0x4411ce['text']));var _0x22f469=this['awsPolly'][_0x0f0b('0xa0')](this,_0x4411ce);if(_0x22f469){this[_0x0f0b('0x38')]['noop'](util['format'](_0x0f0b('0x125'),_0x22f469));var _0x546095=this[_0x0f0b('0x38')]['streamFile'](_0x22f469);try{fs['unlink'](_0x22f469+_0x0f0b('0x103'));}catch(_0x31a059){logger[_0x0f0b('0x29')](_0x31a059);}return _0x546095;}return this[_0x0f0b('0x38')][_0x0f0b('0x29')](_0x4411ce,_0x0f0b('0x126'));};AGIVertices[_0x0f0b('0xf')][_0x0f0b('0x127')]=function(_0x2730cf){logger[_0x0f0b('0x2a')](util[_0x0f0b('0x25')](_0x0f0b('0x128'),_0x2730cf[_0x0f0b('0x35')]));if(!this[_0x0f0b('0x82')](_0x2730cf['aws_access_key_id'])||!this[_0x0f0b('0x82')](_0x2730cf[_0x0f0b('0x89')])){return this['channel'][_0x0f0b('0xa6')]('no\x20valid\x20credentials\x20configured');}if(!this['isConfigured'](_0x2730cf[_0x0f0b('0x129')])){return this[_0x0f0b('0x38')][_0x0f0b('0xa6')](_0x0f0b('0x12a'));}if(!this[_0x0f0b('0x82')](_0x2730cf[_0x0f0b('0x5e')])){return this['channel'][_0x0f0b('0xa6')](_0x0f0b('0xa4'));}this['channel']['bot']=!![];this[_0x0f0b('0x34')](_0x2730cf);this['createSquareMessage'](_0x2730cf[_0x0f0b('0x5e')],'in','','');this[_0x0f0b('0x38')][_0x0f0b('0xa6')](util[_0x0f0b('0x25')](_0x0f0b('0x12b'),_0x2730cf[_0x0f0b('0x5e')]));var _0x1811df=this[_0x0f0b('0x87')][_0x0f0b('0xa0')](this,_0x2730cf);if(_0x1811df){for(var _0x4378ba in _0x1811df){if(_0x1811df['hasOwnProperty'](_0x4378ba)&&_[_0x0f0b('0x90')](_0x1811df[_0x4378ba])){this[_0x0f0b('0x38')][_0x0f0b('0x9a')](util[_0x0f0b('0x25')](_0x0f0b('0x12c'),_0x4378ba['toUpperCase']()),_0x1811df[_0x4378ba]);}}if(_[_0x0f0b('0x45')](_0x1811df[_0x0f0b('0x74')])){return this[_0x0f0b('0x38')][_0x0f0b('0xa6')](_0x0f0b('0x12d'));}else{this[_0x0f0b('0x43')](_0x1811df[_0x0f0b('0x74')],_0x0f0b('0xeb'),'amazonlex','');return this[_0x0f0b('0x38')]['noop'](util[_0x0f0b('0x25')](_0x0f0b('0x12e'),_0x1811df[_0x0f0b('0x74')]));}}return this[_0x0f0b('0x38')][_0x0f0b('0x29')](_0x2730cf,_0x0f0b('0x12f'));};AGIVertices[_0x0f0b('0xf')][_0x0f0b('0x130')]=function(_0x46bc8e){logger[_0x0f0b('0x2a')](util[_0x0f0b('0x25')](_0x0f0b('0x131'),_0x46bc8e[_0x0f0b('0x35')],_0x46bc8e[_0x0f0b('0x65')]));if(!this[_0x0f0b('0x82')](_0x46bc8e['key'])){return this['channel']['noop'](_0x0f0b('0xe7'));}var _0x30451e=_0x0f0b('0x132');var _0xc13302=util[_0x0f0b('0x25')](_0x0f0b('0x133'),FILES_PATH,rs[_0x0f0b('0x11e')](0x4));var _0x15c0e2=util['format'](_0x0f0b('0x98'),_0xc13302,_0x30451e);var _0x195049=!![];if(_0x46bc8e[_0x0f0b('0x134')]==='NOBEEP'){_0x195049=![];}var _0x440262=this[_0x0f0b('0x38')]['recordFile'](_0xc13302,_0x30451e,_0x46bc8e['intKey'],_0x46bc8e['timeout'],undefined,_0x195049);if(_0x440262[_0x0f0b('0x9f')]!==-0x1){this['channel'][_0x0f0b('0xa6')](util[_0x0f0b('0x25')]('google\x20%s\x20file\x20created',_0x15c0e2));var _0x3a2554=this[_0x0f0b('0x8b')]['sync'](this,_0x46bc8e,_0x15c0e2);if(_0x3a2554){for(var _0x397f5d in _0x3a2554){if(_0x3a2554[_0x0f0b('0x92')](_0x397f5d)){this[_0x0f0b('0x38')][_0x0f0b('0x9a')](util['format'](_0x0f0b('0x135'),_0x397f5d[_0x0f0b('0xe9')]()),_0x3a2554[_0x397f5d]);}}return this[_0x0f0b('0x38')]['noop'](util[_0x0f0b('0x25')](_0x0f0b('0x136'),JSON['stringify'](_0x3a2554)));}}return _0x440262;};AGIVertices[_0x0f0b('0xf')][_0x0f0b('0x137')]=function(_0x2ce79c){logger[_0x0f0b('0x2a')](util[_0x0f0b('0x25')](_0x0f0b('0x138'),_0x2ce79c[_0x0f0b('0x35')]));if(!this[_0x0f0b('0x82')](_0x2ce79c['appid'])){return this[_0x0f0b('0x38')]['noop'](_0x0f0b('0x139'));}if(!this['isConfigured'](_0x2ce79c[_0x0f0b('0x8e')])){return this['channel'][_0x0f0b('0xa6')](_0x0f0b('0x13a'));}var _0x454472=_0x0f0b('0x132');var _0x4d9deb=util[_0x0f0b('0x25')]('%s/recordings/%s',FILES_PATH,rs[_0x0f0b('0x11e')](0x4));var _0x3ce5f8=util[_0x0f0b('0x25')]('%s.%s',_0x4d9deb,_0x454472);var _0x37caef=!![];if(_0x2ce79c[_0x0f0b('0x134')]==='NOBEEP'){_0x37caef=![];}var _0x1c89c0=this['channel'][_0x0f0b('0x13b')](_0x4d9deb,_0x454472,_0x2ce79c[_0x0f0b('0x13c')],_0x2ce79c[_0x0f0b('0x65')],undefined,_0x37caef);if(_0x1c89c0['result']!==-0x1){this[_0x0f0b('0x38')][_0x0f0b('0xa6')](util['format'](_0x0f0b('0x13d'),_0x3ce5f8));var _0x5aea85=this['tildeASR'][_0x0f0b('0xa0')](this,_0x2ce79c,_0x3ce5f8);if(_0x5aea85){for(var _0x12a63a in _0x5aea85){if(_0x5aea85[_0x0f0b('0x92')](_0x12a63a)){this['channel'][_0x0f0b('0x9a')](util['format']('TILDE_ASR_%s',_0x12a63a[_0x0f0b('0xe9')]()),_0x5aea85[_0x12a63a]);}}return this['channel'][_0x0f0b('0xa6')](util['format'](_0x0f0b('0x13e'),JSON[_0x0f0b('0x71')](_0x5aea85)));}}return _0x1c89c0;};AGIVertices[_0x0f0b('0xf')][_0x0f0b('0x13f')]=function(_0x34d060){logger[_0x0f0b('0x2a')](util['format'](_0x0f0b('0x140'),_0x34d060['label']));return this[_0x0f0b('0x38')][_0x0f0b('0x141')](_0x34d060['context'],_0x34d060[_0x0f0b('0x3e')],_0x34d060[_0x0f0b('0x3f')]);};AGIVertices[_0x0f0b('0xf')][_0x0f0b('0x142')]=function(_0xde863f){logger[_0x0f0b('0x2a')](util[_0x0f0b('0x25')](_0x0f0b('0x143'),_0xde863f[_0x0f0b('0x35')]));if(!this['isConfigured'](_0xde863f['condition'])){return this['channel'][_0x0f0b('0x29')](_0xde863f,_0x0f0b('0x144'));}try{var _0x3f2208=eval(_0xde863f['condition'])?_0x0f0b('0x145'):'false';this['channel'][_0x0f0b('0xa6')](util['format'](_0x0f0b('0x146'),_0xde863f[_0x0f0b('0x147')],_0x3f2208));return{'code':0xc8,'result':_0x3f2208};}catch(_0x1b93d5){return{'code':0xc8,'result':_0x0f0b('0x148')};}};AGIVertices[_0x0f0b('0xf')][_0x0f0b('0x149')]=function(_0x5c0849){logger['info'](util[_0x0f0b('0x25')]('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x5c0849[_0x0f0b('0x35')]));if(!this[_0x0f0b('0x82')](_0x5c0849[_0x0f0b('0x14a')])){return this[_0x0f0b('0x38')]['error'](_0x5c0849,_0x0f0b('0x14b'));}var _0x396d0f=this[_0x0f0b('0x14c')][_0x0f0b('0xa0')](this,_0x5c0849[_0x0f0b('0x14a')]);if(!_0x396d0f){return this['channel'][_0x0f0b('0x29')](_0x5c0849,_0x0f0b('0x14d'));}for(var _0x5b2750=0x0;_0x5b2750<_0x396d0f['length'];_0x5b2750+=0x1){var _0x3cc76e=this[_0x0f0b('0x38')][_0x0f0b('0x10')](util[_0x0f0b('0x25')]('IFTIME(%s?true:false)',_0x396d0f[_0x5b2750]));if(_0x3cc76e['result']===-0x1){return _0x3cc76e;}logger['info'](util[_0x0f0b('0x25')](_0x0f0b('0x14e'),_0x396d0f[_0x5b2750],_0x3cc76e[_0x0f0b('0x9e')]));if(_0x3cc76e[_0x0f0b('0x9e')]===_0x0f0b('0x145')){logger[_0x0f0b('0x2a')](util[_0x0f0b('0x25')](_0x0f0b('0x14e'),_0x396d0f[_0x5b2750],_0x0f0b('0x145')));this[_0x0f0b('0x38')][_0x0f0b('0xa6')](util[_0x0f0b('0x25')](_0x0f0b('0x14e'),_0x396d0f[_0x5b2750],_0x0f0b('0x145')));return{'code':0xc8,'result':'true'};}else{logger[_0x0f0b('0x2a')](util[_0x0f0b('0x25')](_0x0f0b('0x14e'),_0x396d0f[_0x5b2750],_0x0f0b('0x148')));this[_0x0f0b('0x38')][_0x0f0b('0xa6')](util[_0x0f0b('0x25')](_0x0f0b('0x14e'),_0x396d0f[_0x5b2750],_0x0f0b('0x148')));}}return{'code':0xc8,'result':'false'};};AGIVertices[_0x0f0b('0xf')]['hangup']=function(_0x7a9059){logger['info'](util[_0x0f0b('0x25')](_0x0f0b('0x14f'),_0x7a9059[_0x0f0b('0x35')]));return this[_0x0f0b('0x38')][_0x0f0b('0x150')]();};AGIVertices[_0x0f0b('0xf')]['ispeechasr']=function(_0xa36436){logger[_0x0f0b('0x2a')](util[_0x0f0b('0x25')](_0x0f0b('0x151'),_0xa36436[_0x0f0b('0x35')]));if(!this[_0x0f0b('0x82')](_0xa36436['key'])){return this['channel']['noop'](_0x0f0b('0xe7'));}var _0x3e8267='wav';var _0x20c883=util[_0x0f0b('0x25')]('%s/recordings/%s',FILES_PATH,rs[_0x0f0b('0x11e')](0x4));var _0x447565=util[_0x0f0b('0x25')]('%s.%s',_0x20c883,_0x3e8267);var _0x348838=!![];if(_0xa36436[_0x0f0b('0x134')]===_0x0f0b('0x152')){_0x348838=![];}var _0x3a9541=this['channel']['recordFile'](_0x20c883,_0x3e8267,_0xa36436['intKey'],_0xa36436['timeout'],undefined,_0x348838);if(_0x3a9541[_0x0f0b('0x9f')]!==-0x1){this[_0x0f0b('0x38')][_0x0f0b('0xa6')](util[_0x0f0b('0x25')](_0x0f0b('0x153'),_0x447565));var _0x417255=this[_0x0f0b('0x81')][_0x0f0b('0xa0')](this,_0xa36436,_0x447565);if(_0x417255){for(var _0x21e6f7 in _0x417255){if(_0x417255['hasOwnProperty'](_0x21e6f7)){this[_0x0f0b('0x38')][_0x0f0b('0x9a')](util[_0x0f0b('0x25')]('ISPEECH_ASR_%s',_0x21e6f7['toUpperCase']()),_0x417255[_0x21e6f7]);}}return this[_0x0f0b('0x38')]['noop'](util['format']('IspeechASR\x20Result\x20%s',JSON['stringify'](_0x417255)));}}return _0x3a9541;};AGIVertices[_0x0f0b('0xf')][_0x0f0b('0x154')]=function(_0xe731de){logger[_0x0f0b('0x2a')](util[_0x0f0b('0x25')]('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0xe731de[_0x0f0b('0x35')]));if(!this['isConfigured'](_0xe731de['key'])){return this['channel'][_0x0f0b('0xa6')](_0x0f0b('0xe7'));}if(!this[_0x0f0b('0x82')](_0xe731de[_0x0f0b('0x5e')])){return this['channel'][_0x0f0b('0xa6')](_0x0f0b('0xa4'));}this[_0x0f0b('0x38')][_0x0f0b('0xa6')](util[_0x0f0b('0x25')]('Trying\x20ispeech\x20TTS\x20%s',_0xe731de['text']));var _0x447f9e=this[_0x0f0b('0x7e')][_0x0f0b('0xa0')](this,_0xe731de);if(_0x447f9e){this[_0x0f0b('0x38')][_0x0f0b('0xa6')](util[_0x0f0b('0x25')](_0x0f0b('0x153'),_0x447f9e));var _0x2a37b5=this['channel'][_0x0f0b('0x102')](_0x447f9e,_0xe731de[_0x0f0b('0x13c')]);try{fs[_0x0f0b('0x155')](_0x447f9e+'.wav');}catch(_0x5dcb76){logger[_0x0f0b('0x29')](_0x5dcb76);}return _0x2a37b5;}return this[_0x0f0b('0x38')][_0x0f0b('0x29')](_0xe731de,_0x0f0b('0x156'));};AGIVertices[_0x0f0b('0xf')][_0x0f0b('0x157')]=function(_0x5ae022){logger[_0x0f0b('0x2a')](util[_0x0f0b('0x25')](_0x0f0b('0x158'),_0x5ae022[_0x0f0b('0x35')]));if(!this[_0x0f0b('0x82')](_0x5ae022[_0x0f0b('0x159')])){return this['channel'][_0x0f0b('0x29')](_0x5ae022,'no\x20find\x20by\x20configured');}logger['info'](util[_0x0f0b('0x25')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x0f0b('0x38')][_0x0f0b('0x39')],_0x5ae022[_0x0f0b('0x159')]));var _0x93c723=this[_0x0f0b('0x54')][_0x0f0b('0xa0')](this,_0x5ae022[_0x0f0b('0x159')]);if(_0x93c723){logger[_0x0f0b('0x2a')](util['format'](_0x0f0b('0x15a'),this['channel'][_0x0f0b('0x39')],_0x5ae022[_0x0f0b('0x159')]));this[_0x0f0b('0x38')][_0x0f0b('0xa6')](util[_0x0f0b('0x25')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x0f0b('0x38')][_0x0f0b('0x39')],_0x5ae022[_0x0f0b('0x159')]));return{'code':0xc8,'result':_0x0f0b('0x15b')};}else{logger['info'](util[_0x0f0b('0x25')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x0f0b('0x38')]['callerid'],_0x5ae022[_0x0f0b('0x159')]));this[_0x0f0b('0x38')][_0x0f0b('0xa6')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x0f0b('0x38')][_0x0f0b('0x39')],_0x5ae022[_0x0f0b('0x159')]));return{'code':0xc8,'result':_0x0f0b('0x15c')};}};AGIVertices[_0x0f0b('0xf')]['logout']=function(_0x250297){logger[_0x0f0b('0x2a')](util[_0x0f0b('0x25')](_0x0f0b('0x15d'),_0x250297[_0x0f0b('0x35')]));if(!this['isConfigured'](_0x250297[_0x0f0b('0x159')])){return this['channel'][_0x0f0b('0x29')](_0x250297,_0x0f0b('0x15e'));}logger[_0x0f0b('0x2a')](util[_0x0f0b('0x25')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x0f0b('0x38')][_0x0f0b('0x39')],_0x250297['findBy']));var _0x12c71e=this[_0x0f0b('0x53')][_0x0f0b('0xa0')](this,_0x250297[_0x0f0b('0x159')]);if(_0x12c71e){logger['info'](util['format'](_0x0f0b('0x15a'),this['channel'][_0x0f0b('0x39')],_0x250297[_0x0f0b('0x159')]));this[_0x0f0b('0x38')][_0x0f0b('0xa6')](util[_0x0f0b('0x25')](_0x0f0b('0x15a'),this[_0x0f0b('0x38')][_0x0f0b('0x39')],_0x250297[_0x0f0b('0x159')]));return{'code':0xc8,'result':_0x0f0b('0x15b')};}else{logger[_0x0f0b('0x2a')](util[_0x0f0b('0x25')](_0x0f0b('0x15f'),this[_0x0f0b('0x38')][_0x0f0b('0x39')],_0x250297['findBy']));this[_0x0f0b('0x38')][_0x0f0b('0xa6')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x0f0b('0x38')][_0x0f0b('0x39')],_0x250297[_0x0f0b('0x159')]));return{'code':0xc8,'result':_0x0f0b('0x15c')};}};AGIVertices[_0x0f0b('0xf')]['math']=function(_0x53778e){logger['info'](util[_0x0f0b('0x25')](_0x0f0b('0x160'),_0x53778e[_0x0f0b('0x35')]));if(!this['isConfigured'](_0x53778e[_0x0f0b('0x161')])){return this[_0x0f0b('0x38')][_0x0f0b('0x29')](_0x53778e,_0x0f0b('0x162'));}this[_0x0f0b('0x38')][_0x0f0b('0xa6')](util['format'](_0x0f0b('0x163'),_0x53778e[_0x0f0b('0x161')]));var _0x19d8ee=eval(_0x53778e[_0x0f0b('0x161')]);if(!this[_0x0f0b('0x82')](_0x53778e[_0x0f0b('0xd5')])){return this[_0x0f0b('0x38')][_0x0f0b('0xa6')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x44f5b8=this[_0x0f0b('0x10')][_0x0f0b('0xa0')](this,_0x53778e['variable_id']);if(!_0x44f5b8){return this[_0x0f0b('0x38')][_0x0f0b('0x29')](_0x53778e,'no\x20variable\x20found');}if(_[_0x0f0b('0x94')](_0x19d8ee)){var _0x6102ad=this;_0x19d8ee[_0x0f0b('0xd8')](function(_0x1b2f9f,_0x13c1c4){_0x6102ad[_0x0f0b('0x38')][_0x0f0b('0x9a')](util['format'](_0x0f0b('0x164'),_0x44f5b8,_0x13c1c4),_0x1b2f9f);});return this['channel'][_0x0f0b('0xa6')](util[_0x0f0b('0x25')](_0x0f0b('0x165'),_0x44f5b8));}else{return this[_0x0f0b('0x38')]['setVariable'](_0x44f5b8,_0x19d8ee);}};AGIVertices[_0x0f0b('0xf')][_0x0f0b('0xb')]=function(_0xc73e21){logger[_0x0f0b('0x2a')](util[_0x0f0b('0x25')](_0x0f0b('0x166'),_0xc73e21[_0x0f0b('0x35')]));if(_0xc73e21[_0x0f0b('0x112')]===0x0){return this[_0x0f0b('0xa1')](_0xc73e21);}_0xc73e21[_0x0f0b('0x112')]-=0x1;if(!this[_0x0f0b('0x82')](_0xc73e21[_0x0f0b('0x113')])){return this[_0x0f0b('0x38')][_0x0f0b('0x29')](_0xc73e21,_0x0f0b('0x114'));}var _0x12e53a=this[_0x0f0b('0x1b')][_0x0f0b('0xa0')](this,_0xc73e21['file_id']);if(!_0x12e53a){return this[_0x0f0b('0x38')][_0x0f0b('0x29')](_0xc73e21,'no\x20file\x20audio\x20found');}var _0x515a4a=this[_0x0f0b('0x38')]['getData'](_0x12e53a,_0xc73e21[_0x0f0b('0x116')],_0xc73e21[_0x0f0b('0x167')]);var _0x559be3=_0x515a4a[_0x0f0b('0x9f')];if(_0x515a4a[_0x0f0b('0x9f')]===-0x1){this[_0x0f0b('0x34')]['sync'](this,_0xc73e21,'-1');return _0x515a4a;}else if(_0x515a4a[_0x0f0b('0x9e')]==='timeout'){_0x515a4a[_0x0f0b('0x9f')]=_0x515a4a[_0x0f0b('0x9f')]['length']>0x0?_0x515a4a[_0x0f0b('0x9f')]:'t';}else if(_['isEmpty'](_0x515a4a[_0x0f0b('0x9f')])){_0x515a4a[_0x0f0b('0x9f')]='#';_0x559be3='#';}if(!this['isConfigured'](_0xc73e21[_0x0f0b('0xd5')])){this[_0x0f0b('0x38')][_0x0f0b('0xa6')]('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x2e6ed6=this[_0x0f0b('0x10')][_0x0f0b('0xa0')](this,_0xc73e21[_0x0f0b('0xd5')]);if(!_0x2e6ed6){return this[_0x0f0b('0x38')]['error'](_0xc73e21,'no\x20variable\x20found');}this['channel'][_0x0f0b('0x9a')](_0x2e6ed6,_0x559be3);}this[_0x0f0b('0x34')][_0x0f0b('0xa0')](this,_0xc73e21,_0x559be3);return _0x515a4a;};AGIVertices[_0x0f0b('0xf')][_0x0f0b('0xa6')]=function(_0xada16d){logger['info'](util['format'](_0x0f0b('0x168'),_0xada16d['label']));return this[_0x0f0b('0x38')]['noop'](_0xada16d[_0x0f0b('0x169')]||_0xada16d[_0x0f0b('0x35')]);};AGIVertices[_0x0f0b('0xf')][_0x0f0b('0x16a')]=function(_0x39c04d){logger[_0x0f0b('0x2a')](util['format']('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x39c04d[_0x0f0b('0x35')]));if(!this[_0x0f0b('0x82')](_0x39c04d[_0x0f0b('0x159')])){return this[_0x0f0b('0x38')][_0x0f0b('0x29')](_0x39c04d,_0x0f0b('0x15e'));}logger[_0x0f0b('0x2a')](util[_0x0f0b('0x25')](_0x0f0b('0x16b'),this[_0x0f0b('0x38')][_0x0f0b('0x39')],_0x39c04d['findBy']));var _0x3e15e7=this[_0x0f0b('0x4e')][_0x0f0b('0xa0')](this,_0x39c04d[_0x0f0b('0x16c')]);var _0x55384f=this[_0x0f0b('0x50')][_0x0f0b('0xa0')](this,_0x39c04d[_0x0f0b('0x159')],_0x3e15e7);if(_0x55384f){logger[_0x0f0b('0x2a')](util[_0x0f0b('0x25')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x0f0b('0x38')][_0x0f0b('0x39')],_0x39c04d['findBy']));this['channel'][_0x0f0b('0xa6')](util[_0x0f0b('0x25')](_0x0f0b('0x15a'),this[_0x0f0b('0x38')][_0x0f0b('0x39')],_0x39c04d[_0x0f0b('0x159')]));return{'code':0xc8,'result':_0x0f0b('0x15b')};}else{logger[_0x0f0b('0x2a')](util[_0x0f0b('0x25')](_0x0f0b('0x15f'),this[_0x0f0b('0x38')][_0x0f0b('0x39')],_0x39c04d['findBy']));this[_0x0f0b('0x38')]['noop'](util['format'](_0x0f0b('0x15a'),this[_0x0f0b('0x38')]['callerid'],_0x39c04d[_0x0f0b('0x159')]));return{'code':0xc8,'result':_0x0f0b('0x15c')};}};AGIVertices[_0x0f0b('0xf')][_0x0f0b('0x16d')]=function(_0x34d8e8){logger[_0x0f0b('0x2a')](util[_0x0f0b('0x25')](_0x0f0b('0x16e'),_0x34d8e8['label']));if(!this['isConfigured'](_0x34d8e8['file_id'])){return this[_0x0f0b('0x38')][_0x0f0b('0x29')](_0x34d8e8,'no\x20file\x20audio\x20selected');}var _0x38a72e=this[_0x0f0b('0x1b')]['sync'](this,_0x34d8e8[_0x0f0b('0x113')]);if(!_0x38a72e){return this[_0x0f0b('0x38')][_0x0f0b('0x29')](_0x34d8e8,_0x0f0b('0x16f'));}var _0x1be187=this[_0x0f0b('0x38')]['exec'](_0x0f0b('0x170'),[_0x38a72e,_0x34d8e8[_0x0f0b('0xe3')]]);if(_0x1be187[_0x0f0b('0x9f')]===-0x1){return _0x1be187;}return this['channel'][_0x0f0b('0xa6')](util[_0x0f0b('0x25')](_0x0f0b('0x171'),_0x0f0b('0x170'),_0x38a72e));};AGIVertices[_0x0f0b('0xf')][_0x0f0b('0x172')]=function(_0x266bf2){logger[_0x0f0b('0x2a')](util['format'](_0x0f0b('0x173'),_0x266bf2[_0x0f0b('0x35')]));if(!this['isConfigured'](_0x266bf2[_0x0f0b('0x174')])){return this[_0x0f0b('0x38')]['error'](_0x266bf2,'no\x20queue\x20selected');}var _0x420ef6='';var _0x377b34=parseInt(_0x266bf2['queue_id'],0xa);if(isNaN(_0x377b34)){_0x420ef6=_0x266bf2[_0x0f0b('0x174')];}else{_0x420ef6=this[_0x0f0b('0x175')][_0x0f0b('0xa0')](this,_0x266bf2[_0x0f0b('0x174')]);if(!_0x420ef6){return this[_0x0f0b('0x38')][_0x0f0b('0x29')](_0x266bf2,'no\x20queue\x20found');}}var _0x10c8eb='';if(this[_0x0f0b('0x82')](_0x266bf2['file_id'])){var _0x254aa2=this[_0x0f0b('0x1b')][_0x0f0b('0xa0')](this,_0x266bf2[_0x0f0b('0x113')]);if(_0x254aa2){_0x10c8eb=_0x254aa2;}}this[_0x0f0b('0x34')][_0x0f0b('0xa0')](this,_0x266bf2,_0x420ef6);if(_0x266bf2['opts'][_0x0f0b('0x176')]('x')<0x0){_0x266bf2['opts']+='x';}if(_0x266bf2[_0x0f0b('0xe3')][_0x0f0b('0x176')]('X')<0x0){_0x266bf2[_0x0f0b('0xe3')]+='X';}this['channel'][_0x0f0b('0x9a')]('XMCS-QUEUE',_0x420ef6?_0x420ef6[_0x0f0b('0x177')]():'');var _0x401b49=this[_0x0f0b('0x38')][_0x0f0b('0x59')]('QUEUE',[_0x420ef6,_0x266bf2[_0x0f0b('0xe3')],_0x266bf2[_0x0f0b('0x6f')],_0x10c8eb,_0x266bf2['timeout'],_0x266bf2[_0x0f0b('0xb3')],_0x266bf2[_0x0f0b('0x178')],_0x266bf2[_0x0f0b('0x179')],'',_0x266bf2['position']]);if(_0x401b49[_0x0f0b('0x9f')]===-0x1){return _0x401b49;}return this[_0x0f0b('0x38')][_0x0f0b('0xa6')](util[_0x0f0b('0x25')](_0x0f0b('0x171'),'QUEUE',_0x420ef6));};AGIVertices[_0x0f0b('0xf')][_0x0f0b('0x17a')]=function(_0x1c912b){logger[_0x0f0b('0x2a')](util[_0x0f0b('0x25')](_0x0f0b('0x17b'),_0x1c912b['label']));var _0x11aeb2=_0x1c912b[_0x0f0b('0x17c')]||_0x0f0b('0x132');var _0x493303=util[_0x0f0b('0x25')](_0x0f0b('0x17d'),this['channel'][_0x0f0b('0x3b')],rs[_0x0f0b('0x11e')](0x5));var _0x40ac8a=util[_0x0f0b('0x25')]('%s/recordings/%s.%s',FILES_PATH,_0x493303,_0x11aeb2);var _0x141441=util[_0x0f0b('0x25')](_0x0f0b('0x133'),FILES_PATH,_0x493303);this['createSquareRecording'][_0x0f0b('0xa0')](this,_0x1c912b,_0x493303,_0x40ac8a);this[_0x0f0b('0x38')][_0x0f0b('0x9a')]('RECORDING_SAVENAME',_0x493303);logger[_0x0f0b('0x2a')]('Recording\x20%s\x20%s\x20%s\x20%s',_0x141441,_0x11aeb2,_0x1c912b[_0x0f0b('0x17e')],_0x1c912b[_0x0f0b('0x65')]);return this[_0x0f0b('0x38')][_0x0f0b('0x13b')](_0x141441,_0x11aeb2,_0x1c912b[_0x0f0b('0x17e')],_0x1c912b[_0x0f0b('0x65')],undefined,!![]);};AGIVertices[_0x0f0b('0xf')][_0x0f0b('0x17f')]=function(_0x270176){logger['info'](util[_0x0f0b('0x25')](_0x0f0b('0x180'),_0x270176[_0x0f0b('0x35')]));if(!this[_0x0f0b('0x82')](_0x270176['url'])){return this[_0x0f0b('0x38')][_0x0f0b('0xa6')](_0x0f0b('0x181'));}var _0x51d37c=this['restAPI'][_0x0f0b('0xa0')](this,_0x270176);logger['info'](util[_0x0f0b('0x25')]('Response:',util['inspect'](_0x51d37c,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x270176[_0x0f0b('0xd5')])){return this['channel'][_0x0f0b('0xa6')](_0x0f0b('0x182'));}var _0x3559c5=this['getVariable'][_0x0f0b('0xa0')](this,_0x270176[_0x0f0b('0xd5')]);if(!_0x3559c5){return this['channel']['error'](_0x270176,_0x0f0b('0xd7'));}this['channel'][_0x0f0b('0x9a')](util[_0x0f0b('0x25')](_0x0f0b('0x183'),_0x3559c5),_0x51d37c['statusCode']?_0x51d37c[_0x0f0b('0x184')]:_0x0f0b('0x185'));this[_0x0f0b('0x38')][_0x0f0b('0x9a')](util[_0x0f0b('0x25')](_0x0f0b('0x186'),_0x3559c5),_0x51d37c['statusMessage']?_0x51d37c[_0x0f0b('0x73')]:'OK');if(_0x51d37c[_0x0f0b('0x69')]){try{this[_0x0f0b('0x99')](_0x51d37c['body'],_0x3559c5);}catch(_0x39dbd8){logger[_0x0f0b('0x29')](util[_0x0f0b('0x25')]('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0x3559c5));}}return this[_0x0f0b('0x38')][_0x0f0b('0xa6')](util[_0x0f0b('0x25')](_0x0f0b('0x187'),_0x3559c5));};AGIVertices[_0x0f0b('0xf')]['saydigits']=function(_0x367ac4){logger['info'](util[_0x0f0b('0x25')](_0x0f0b('0x188'),_0x367ac4[_0x0f0b('0x35')]));return this['channel']['sayDigits'](_0x367ac4[_0x0f0b('0x189')][_0x0f0b('0x5b')](/\s+/g,''),_0x367ac4[_0x0f0b('0x17e')]);};AGIVertices['prototype'][_0x0f0b('0x18a')]=function(_0x5a83b3){logger[_0x0f0b('0x2a')](util[_0x0f0b('0x25')](_0x0f0b('0x18b'),_0x5a83b3['label']));return this[_0x0f0b('0x38')][_0x0f0b('0x18c')](_0x5a83b3[_0x0f0b('0x66')]['replace'](/\s+/g,''),_0x5a83b3[_0x0f0b('0x17e')]);};AGIVertices['prototype'][_0x0f0b('0x18d')]=function(_0x552660){logger[_0x0f0b('0x2a')](util[_0x0f0b('0x25')](_0x0f0b('0x18e'),_0x552660['label']));return this['channel'][_0x0f0b('0x18f')](_0x552660[_0x0f0b('0x5e')],_0x552660[_0x0f0b('0x17e')]);};AGIVertices[_0x0f0b('0xf')]['sendMail']=function(_0xdc7538){logger[_0x0f0b('0x2a')](util[_0x0f0b('0x25')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0xdc7538[_0x0f0b('0x35')]));if(!this[_0x0f0b('0x82')](_0xdc7538[_0x0f0b('0x190')])){return this[_0x0f0b('0x38')]['noop']('no\x20mail\x20account\x20configured');}var _0x734e32=this[_0x0f0b('0x1f')][_0x0f0b('0xa0')](this,_0xdc7538[_0x0f0b('0x190')]);if(!_0x734e32||!_0x734e32[_0x0f0b('0x191')]){return this[_0x0f0b('0x38')][_0x0f0b('0x29')](_0xdc7538,_0x0f0b('0x192'));}var _0x5a4623={'from':util[_0x0f0b('0x25')]('\x22%s\x22\x20<%s>',_0x734e32[_0x0f0b('0x12')],_0x734e32[_0x0f0b('0x193')]||_0x734e32[_0x0f0b('0x191')][_0x0f0b('0x194')]),'to':_0xdc7538['to']||'','cc':_0xdc7538['cc']||'','bcc':_0xdc7538[_0x0f0b('0x195')]||'','subject':_0xdc7538[_0x0f0b('0x196')],'html':_0xdc7538[_0x0f0b('0x5e')],'text':_0xdc7538[_0x0f0b('0x5e')]};var _0x5b9cf6={'tls':{'rejectUnauthorized':![]}};if(_0x734e32['Smtp']['service']){_0x5b9cf6[_0x0f0b('0x197')]=_0x734e32[_0x0f0b('0x191')]['service'];}else{_0x5b9cf6[_0x0f0b('0x198')]=_0x734e32[_0x0f0b('0x191')]['host'];_0x5b9cf6[_0x0f0b('0x199')]=_0x734e32[_0x0f0b('0x191')]['port'];_0x5b9cf6['secure']=_0x734e32['Smtp']['secure'];}if(_0x734e32['Smtp'][_0x0f0b('0x19a')]){_0x5b9cf6[_0x0f0b('0x19b')]={'user':_0x734e32[_0x0f0b('0x191')][_0x0f0b('0x194')],'pass':_0x734e32[_0x0f0b('0x191')]['pass']};}if(this['isConfigured'](_0xdc7538[_0x0f0b('0x19c')])){}logger[_0x0f0b('0xdd')]('sendMail\x20message',JSON[_0x0f0b('0x71')](_0x5a4623));this[_0x0f0b('0x34')][_0x0f0b('0xa0')](this,_0xdc7538,_0xdc7538[_0x0f0b('0x190')]);this[_0x0f0b('0x38')][_0x0f0b('0xa6')](util[_0x0f0b('0x25')](_0x0f0b('0x19d'),_0x734e32[_0x0f0b('0x12')]));this['sendMailMessage'][_0x0f0b('0xa0')](this,_0x5b9cf6,_0x5a4623);return this[_0x0f0b('0x38')][_0x0f0b('0xa6')](_0x0f0b('0x19e'));};AGIVertices[_0x0f0b('0xf')][_0x0f0b('0x19f')]=function(_0x3d5d44){logger[_0x0f0b('0x2a')](util['format']('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x3d5d44[_0x0f0b('0x35')]));return this[_0x0f0b('0x38')][_0x0f0b('0xa6')](_0x0f0b('0x1a0'));};AGIVertices[_0x0f0b('0xf')][_0x0f0b('0x1a1')]=function(_0x237635){logger[_0x0f0b('0x2a')](util['format'](_0x0f0b('0x1a2'),_0x237635[_0x0f0b('0x35')]));if(!this[_0x0f0b('0x82')](_0x237635['sms_account_id'])){return this[_0x0f0b('0x38')]['noop']('no\x20sms\x20account\x20configured');}var _0x4883f8=this['getSmsAccount']['sync'](this,_0x237635[_0x0f0b('0x1a3')]);if(!_0x4883f8){return this[_0x0f0b('0x38')][_0x0f0b('0x29')](_0x237635,_0x0f0b('0x1a4'));}var _0x4c1d26={'body':_0x237635[_0x0f0b('0x1a5')],'phone':_0x237635['to']||'','SmsAccountId':_0x4883f8['id']};logger[_0x0f0b('0xdd')](_0x0f0b('0x1a6'),JSON[_0x0f0b('0x71')](_0x4c1d26));this[_0x0f0b('0x34')][_0x0f0b('0xa0')](this,_0x237635,_0x237635[_0x0f0b('0x1a3')]);this[_0x0f0b('0x38')][_0x0f0b('0xa6')](util['format'](_0x0f0b('0x1a7'),_0x4883f8[_0x0f0b('0x12')]));this[_0x0f0b('0x33')][_0x0f0b('0xa0')](this,_0x4c1d26);return this['channel']['noop'](_0x0f0b('0x1a8'));};AGIVertices[_0x0f0b('0xf')][_0x0f0b('0x1a9')]=function(_0x116c27){logger[_0x0f0b('0x2a')](util['format'](_0x0f0b('0x1aa'),_0x116c27[_0x0f0b('0x35')]));if(!this['isConfigured'](_0x116c27[_0x0f0b('0xd5')])){return this[_0x0f0b('0x38')][_0x0f0b('0x29')](_0x116c27,'no\x20variable\x20selected');}var _0x1ac87f=this['getVariable'][_0x0f0b('0xa0')](this,_0x116c27[_0x0f0b('0xd5')]);if(!_0x1ac87f){return this[_0x0f0b('0x38')][_0x0f0b('0x29')](_0x116c27,_0x0f0b('0xd7'));}return this[_0x0f0b('0x38')][_0x0f0b('0x9a')](_0x1ac87f,_0x116c27[_0x0f0b('0x1ab')]);};AGIVertices[_0x0f0b('0xf')][_0x0f0b('0x1ac')]=function(_0x4f705b){logger[_0x0f0b('0x2a')](util[_0x0f0b('0x25')](_0x0f0b('0x1ad'),_0x4f705b[_0x0f0b('0x35')]));this[_0x0f0b('0x38')][_0x0f0b('0xa6')](_0x0f0b('0x1ae'));if(_0x4f705b[_0x0f0b('0xba')]===_0x0f0b('0x1af')){this[_0x0f0b('0x38')][_0x0f0b('0xa6')]('Answer');return this[_0x0f0b('0x38')]['answer']();}return this[_0x0f0b('0x38')][_0x0f0b('0xa6')]('Skipped\x20Answer');};AGIVertices[_0x0f0b('0xf')][_0x0f0b('0x1b0')]=function(_0xaba452){logger[_0x0f0b('0x2a')](util[_0x0f0b('0x25')](_0x0f0b('0x1b1'),_0xaba452[_0x0f0b('0x35')]));if(!this[_0x0f0b('0x82')](_0xaba452['project_id'])){return this[_0x0f0b('0x38')][_0x0f0b('0x29')](_0xaba452,_0x0f0b('0x1b2'));}var _0x4da36e=this[_0x0f0b('0x14')][_0x0f0b('0xa0')](this,_0xaba452[_0x0f0b('0x1b3')]);if(!this[_0x0f0b('0x82')](_0x4da36e)){return this['channel'][_0x0f0b('0x29')](_0xaba452,util[_0x0f0b('0x25')]('no\x20subproject\x20found\x20with\x20id\x20%d',_0xaba452[_0x0f0b('0x1b3')]));}if(_0x4da36e===this[_0x0f0b('0x38')][_0x0f0b('0x37')]){return this[_0x0f0b('0x38')]['error'](_0xaba452,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this[_0x0f0b('0x34')][_0x0f0b('0xa0')](this,_0xaba452,_0x4da36e);var _0x20cf23=this['channel'][_0x0f0b('0x59')]('AGI',util['format'](_0x0f0b('0x1b4'),config[_0x0f0b('0xb3')][_0x0f0b('0x198')]||'127.0.0.1',_0x4da36e,this[_0x0f0b('0x38')][_0x0f0b('0x37')]));if(_0x20cf23['result']===-0x1){return _0x20cf23;}return this[_0x0f0b('0x38')][_0x0f0b('0xa6')](util[_0x0f0b('0x25')]('Executed\x20command\x20%s\x20%s',_0x0f0b('0x1b5'),_0x4da36e));};AGIVertices['prototype'][_0x0f0b('0x1b6')]=function(_0xec862a){logger['info'](util[_0x0f0b('0x25')](_0x0f0b('0x1b7'),_0xec862a[_0x0f0b('0x35')]));var _0x12841d=this[_0x0f0b('0x58')][_0x0f0b('0xa0')](this,_0xec862a['command']);this[_0x0f0b('0x34')][_0x0f0b('0xa0')](this,_0xec862a,_0xec862a['command']);if(this[_0x0f0b('0x82')](_0xec862a[_0x0f0b('0xd5')])){var _0x149401=this[_0x0f0b('0x10')][_0x0f0b('0xa0')](this,_0xec862a[_0x0f0b('0xd5')]);if(_0x149401){this[_0x0f0b('0x38')][_0x0f0b('0x9a')](_0x149401,_0x12841d);return this['channel'][_0x0f0b('0xa6')](util[_0x0f0b('0x25')](_0x0f0b('0x1b8'),_0xec862a[_0x0f0b('0xb5')],_0x149401));}}return this[_0x0f0b('0x38')]['noop'](util[_0x0f0b('0x25')](_0x0f0b('0x1b9'),_0xec862a[_0x0f0b('0xb5')]));};AGIVertices[_0x0f0b('0xf')][_0x0f0b('0x1ba')]=function(_0x445be8){logger[_0x0f0b('0x2a')](util[_0x0f0b('0x25')]('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x445be8['label']));_0x445be8[_0x0f0b('0x5e')]=_0x445be8[_0x0f0b('0x5e')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x0f0b('0x82')](_0x445be8['apiKey'])){return this['channel']['noop'](_0x0f0b('0x1bb'));}if(!this['isConfigured'](_0x445be8['text'])){return this[_0x0f0b('0x38')][_0x0f0b('0xa6')](_0x0f0b('0xa4'));}this[_0x0f0b('0x38')][_0x0f0b('0xa6')](util[_0x0f0b('0x25')]('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0x445be8[_0x0f0b('0x5e')]));var _0x4e3eb9=this[_0x0f0b('0x1bc')]['sync'](this,_0x445be8);if(_0x4e3eb9){this[_0x0f0b('0x38')]['noop'](util[_0x0f0b('0x25')](_0x0f0b('0x1bd'),_0x4e3eb9));var _0x49e56c=this['channel'][_0x0f0b('0x102')](_0x4e3eb9);try{fs[_0x0f0b('0x155')](_0x4e3eb9+_0x0f0b('0x103'));}catch(_0x2ec638){logger['error'](_0x2ec638);}return _0x49e56c;}return this[_0x0f0b('0x38')][_0x0f0b('0x29')](_0x445be8,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices[_0x0f0b('0xf')][_0x0f0b('0x1be')]=function(_0x46ecea){logger['info'](util[_0x0f0b('0x25')](_0x0f0b('0x1bf'),_0x46ecea['label']));_0x46ecea['text']=_0x46ecea['text'][_0x0f0b('0x5b')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x0f0b('0x82')](_0x46ecea[_0x0f0b('0x5e')])){return this['channel'][_0x0f0b('0xa6')](_0x0f0b('0xa4'));}this['channel'][_0x0f0b('0xa6')](util[_0x0f0b('0x25')](_0x0f0b('0x1c0'),_0x46ecea[_0x0f0b('0x5e')]));var _0x16deaf=this[_0x0f0b('0x62')][_0x0f0b('0xa0')](this,_0x46ecea);if(_0x16deaf){this[_0x0f0b('0x38')][_0x0f0b('0xa6')](util[_0x0f0b('0x25')](_0x0f0b('0x1c1'),_0x16deaf));var _0x2593b7=this[_0x0f0b('0x38')][_0x0f0b('0x102')](_0x16deaf);try{fs['unlink'](_0x16deaf+'.wav');}catch(_0x5b54c6){logger[_0x0f0b('0x29')](_0x5b54c6);}return _0x2593b7;}return this[_0x0f0b('0x38')][_0x0f0b('0x29')](_0x46ecea,_0x0f0b('0x1c2'));};AGIVertices[_0x0f0b('0xf')]['unpause']=function(_0x4ca3cc){logger[_0x0f0b('0x2a')](util[_0x0f0b('0x25')](_0x0f0b('0x1c3'),_0x4ca3cc[_0x0f0b('0x35')]));if(!this['isConfigured'](_0x4ca3cc[_0x0f0b('0x159')])){return this[_0x0f0b('0x38')][_0x0f0b('0x29')](_0x4ca3cc,'no\x20find\x20by\x20configured');}logger[_0x0f0b('0x2a')](util[_0x0f0b('0x25')](_0x0f0b('0x16b'),this['channel'][_0x0f0b('0x39')],_0x4ca3cc[_0x0f0b('0x159')]));var _0x577964=this['agentUnpause'][_0x0f0b('0xa0')](this,_0x4ca3cc[_0x0f0b('0x159')]);if(_0x577964){logger[_0x0f0b('0x2a')](util[_0x0f0b('0x25')](_0x0f0b('0x15a'),this[_0x0f0b('0x38')][_0x0f0b('0x39')],_0x4ca3cc['findBy']));this[_0x0f0b('0x38')]['noop'](util['format'](_0x0f0b('0x15a'),this[_0x0f0b('0x38')][_0x0f0b('0x39')],_0x4ca3cc[_0x0f0b('0x159')]));return{'code':0xc8,'result':_0x0f0b('0x15b')};}else{logger[_0x0f0b('0x2a')](util[_0x0f0b('0x25')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel']['callerid'],_0x4ca3cc['findBy']));this[_0x0f0b('0x38')][_0x0f0b('0xa6')](util[_0x0f0b('0x25')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x0f0b('0x38')][_0x0f0b('0x39')],_0x4ca3cc[_0x0f0b('0x159')]));return{'code':0xc8,'result':_0x0f0b('0x15c')};}};AGIVertices[_0x0f0b('0xf')][_0x0f0b('0x1c4')]=function(_0x22fb88){logger[_0x0f0b('0x2a')](util[_0x0f0b('0x25')](_0x0f0b('0x1c5'),_0x22fb88['label']));var _0x453140=this[_0x0f0b('0x38')][_0x0f0b('0x59')](_0x0f0b('0x1c6'),[_0x22fb88[_0x0f0b('0x1c7')],_0x22fb88[_0x0f0b('0x76')]]);if(_0x453140[_0x0f0b('0x9f')]===-0x1){return _0x453140;}return this[_0x0f0b('0x38')][_0x0f0b('0xa6')](util['format'](_0x0f0b('0x171'),_0x0f0b('0x1c6'),_0x22fb88[_0x0f0b('0x1c7')]));};AGIVertices[_0x0f0b('0xf')][_0x0f0b('0x1c8')]=function(_0x12f5f4){logger[_0x0f0b('0x2a')](util[_0x0f0b('0x25')](_0x0f0b('0x1c9'),_0x12f5f4[_0x0f0b('0x35')]));if(!this[_0x0f0b('0x82')](_0x12f5f4[_0x0f0b('0xd5')])){return this[_0x0f0b('0x38')]['error'](_0x12f5f4,_0x0f0b('0x1ca'));}var _0x5b592a=this[_0x0f0b('0x10')]['sync'](this,_0x12f5f4[_0x0f0b('0xd5')]);if(!_0x5b592a){return this['channel'][_0x0f0b('0x29')](_0x12f5f4,'no\x20variable\x20found');}var _0x32fab4=this['channel'][_0x0f0b('0x10')](_0x5b592a);return{'code':0xc8,'result':_0x32fab4['extra']?_0x32fab4['extra']:'-'};};String[_0x0f0b('0xf')][_0x0f0b('0x9d')]=function(_0x4470bb,_0x45bf43){return this[_0x0f0b('0x9c')](_0x4470bb)['join'](_0x45bf43);};module[_0x0f0b('0x1cb')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 3964c45..fcbc349 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 _0x7796=['syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','startAcw','interface','queue','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','timer','stopAcw','lastPauseAt','format','uniqueid','update','[%s][UPDATE][ACWTIME:%s]','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','acwTimeout','finally','error','[ACW][START]\x20%s','message','saveUnpause','catch','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','[ACW][STOP]\x20%s','syncAgentConnect','[ACW][syncAgentConnect]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','stringify','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','autopause','all','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','moment','../ami','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','bind'];(function(_0x3ce4a5,_0x50bc4b){var _0x3f5809=function(_0x2f5b78){while(--_0x2f5b78){_0x3ce4a5['push'](_0x3ce4a5['shift']());}};_0x3f5809(++_0x50bc4b);}(_0x7796,0x14a));var _0x6779=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7796[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x6779('0x0'));var _=require(_0x6779('0x1'));var moment=require(_0x6779('0x2'));var ami=require(_0x6779('0x3'));var logger=require(_0x6779('0x4'))(_0x6779('0x5'));var RpcUser=require(_0x6779('0x6'));var RpcVoiceAgentReport=require(_0x6779('0x7'));function Acw(_0x5f44a5){this[_0x6779('0x8')]=_0x5f44a5['voiceQueues'];this[_0x6779('0x9')]=_0x5f44a5[_0x6779('0x9')];this[_0x6779('0xa')]=_0x5f44a5['timers'];this[_0x6779('0xb')]={};ami['on'](_0x6779('0xc'),this['syncAgentConnect'][_0x6779('0xd')](this));ami['on']('hanguprequest',this[_0x6779('0xe')][_0x6779('0xd')](this));ami['on'](_0x6779('0xf'),this[_0x6779('0x10')][_0x6779('0xd')](this));ami['on'](_0x6779('0x11'),this[_0x6779('0x12')][_0x6779('0xd')](this));ami['on'](_0x6779('0x13'),this[_0x6779('0x14')]['bind'](this));ami['on'](_0x6779('0x15'),this[_0x6779('0x16')]['bind'](this));ami['on'](_0x6779('0x17'),this[_0x6779('0x18')][_0x6779('0xd')](this));}function getDiff(_0x483413){var _0x314ef5=moment()[_0x6779('0x19')](0x0);var _0x557a5d=moment(_0x483413)[_0x6779('0x19')](0x0);return _0x314ef5[_0x6779('0x1a')](_0x557a5d,_0x6779('0x1b'));}Acw[_0x6779('0x1c')][_0x6779('0x1d')]=function(_0x15d91b){try{var _0x2791cd=this;var _0x122234=this[_0x6779('0xb')][_0x15d91b][_0x6779('0x1e')];var _0x196ce2=this[_0x6779('0xb')][_0x15d91b][_0x6779('0x1f')];var _0x290035=this[_0x6779('0x8')][_0x196ce2];var _0x4245a9=![];var _0x214c7f='ACW';if(_0x290035[_0x6779('0x20')]){if(_0x290035[_0x6779('0x21')]['name']){_0x4245a9=!![];_0x214c7f=_0x290035['mandatoryDispositionPause'][_0x6779('0x22')];}}ami[_0x6779('0x23')]({'action':_0x6779('0x24'),'interface':_0x122234,'paused':!![],'reason':_0x214c7f})[_0x6779('0x25')](function(_0x4d3f06){if(_0x2791cd['agents'][_0x122234]){return RpcUser[_0x6779('0x26')](_0x2791cd[_0x6779('0x9')][_0x122234]['id'])[_0x6779('0x25')](function(_0x23bb08){if(_0x23bb08&&!_0x23bb08[_0x6779('0x27')]){logger[_0x6779('0x28')](_0x6779('0x29'),_0x15d91b,_0x122234,_0x196ce2);var _0x829aef=_0x2791cd['channels'][_0x15d91b][_0x6779('0x2a')]&&_0x2791cd['channels'][_0x15d91b]['destlinkedid']?_0x2791cd['channels'][_0x15d91b][_0x6779('0x2b')]:_0x15d91b;return RpcUser[_0x6779('0x2c')](_0x2791cd['agents'][_0x122234],_0x214c7f,_0x829aef)['then'](function(_0x4dbb86){if(!_0x4245a9){_0x2791cd[_0x6779('0xa')][_0x122234]={};logger['info']('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x15d91b,_0x2791cd[_0x6779('0x8')][_0x196ce2]['acwTimeout'],_0x122234,_0x196ce2);_0x2791cd[_0x6779('0xa')][_0x122234][_0x6779('0x2d')]=setTimeout(_0x2791cd[_0x6779('0x2e')][_0x6779('0xd')](_0x2791cd,_0x122234),_0x2791cd[_0x6779('0x8')][_0x196ce2]['acwTimeout']*0x3e8);_0x2791cd['timers'][_0x122234][_0x6779('0x2f')]=moment()[_0x6779('0x30')]('YYYY-MM-DD\x20HH:mm:ss');_0x2791cd[_0x6779('0xa')][_0x122234][_0x6779('0x31')]=_0x15d91b;_0x2791cd[_0x6779('0xa')][_0x122234][_0x6779('0x1f')]=_0x196ce2;_0x2791cd[_0x6779('0xa')][_0x122234]['updateAcw']=function(){var _0x1fc135=getDiff(_0x2791cd[_0x6779('0xa')][_0x122234][_0x6779('0x2f')]);clearTimeout(_0x2791cd[_0x6779('0xa')][_0x122234][_0x6779('0x2d')]);_0x2791cd[_0x6779('0xa')][_0x122234][_0x6779('0x2d')]=![];RpcVoiceAgentReport[_0x6779('0x32')]({'acwtime':_0x1fc135},_0x2791cd['timers'][_0x122234][_0x6779('0x31')],_0x122234)[_0x6779('0x25')](function(_0x486e85){logger[_0x6779('0x28')](_0x6779('0x33'),_0x15d91b,_0x1fc135,_0x486e85);})['catch'](function(_0x527724){logger['error'](_0x6779('0x34'),_0x15d91b,_0x527724);});delete _0x2791cd[_0x6779('0xa')][_0x122234];};}});}else{logger[_0x6779('0x28')](_0x6779('0x35'),_0x15d91b,_0x122234,_0x196ce2);}});}})['catch'](function(_0xfde3c7){logger['error']('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x15d91b,_0x2791cd[_0x6779('0x8')][_0x196ce2][_0x6779('0x36')],_0x122234,_0x196ce2);})[_0x6779('0x37')](function(){delete _0x2791cd[_0x6779('0xb')][_0x15d91b];});}catch(_0x499d05){logger[_0x6779('0x38')](_0x6779('0x39'),_0x499d05[_0x6779('0x3a')]);}};Acw[_0x6779('0x1c')][_0x6779('0x2e')]=function(_0x323a62){try{var _0xdde6c1=this;if(_0xdde6c1[_0x6779('0xa')][_0x323a62]){_0xdde6c1[_0x6779('0xa')][_0x323a62]['timer']=![];var _0x16fcd2=_0xdde6c1['timers'][_0x323a62][_0x6779('0x31')];var _0x449742=_0xdde6c1[_0x6779('0xa')][_0x323a62][_0x6779('0x1f')];var _0x4a9ec6=_0xdde6c1[_0x6779('0x8')][_0x449742]['acwTimeout'];logger['info']('[%s][TIMER][STOP][AGENT:%s]',_0x16fcd2,_0x323a62);RpcUser[_0x6779('0x3b')](this[_0x6779('0x9')][_0x323a62]);RpcVoiceAgentReport[_0x6779('0x32')]({'acwtime':_0x4a9ec6,'agentacw':!![]},_0x16fcd2,_0x323a62)['then'](function(_0x3685ec){logger[_0x6779('0x28')](_0x6779('0x33'),_0x16fcd2,_0x4a9ec6,_0x3685ec);})[_0x6779('0x3c')](function(_0x5f1b7d){logger[_0x6779('0x38')]('[%s][UPDATE][ERRORS:%s]',_0x16fcd2,_0x5f1b7d);});}else{logger[_0x6779('0x38')](_0x6779('0x3d'),_0x323a62);if(_0xdde6c1[_0x6779('0xa')]){logger['info'](_0x6779('0x3e'),JSON['stringify'](_0xdde6c1['timers']));}}}catch(_0x345b61){logger[_0x6779('0x38')](_0x6779('0x3f'),_0x345b61[_0x6779('0x3a')]);}};Acw[_0x6779('0x1c')][_0x6779('0x40')]=function(_0x416624){try{if(this[_0x6779('0x8')][_0x416624[_0x6779('0x1f')]]&&(this[_0x6779('0x8')][_0x416624[_0x6779('0x1f')]]['acw']||this[_0x6779('0x8')][_0x416624['queue']]['mandatoryDisposition'])){if(this[_0x6779('0x9')][_0x416624[_0x6779('0x1e')]]){this[_0x6779('0xb')][_0x416624[_0x6779('0x31')]]={'queue':_0x416624['queue'],'interface':_0x416624['interface'],'destlinkedid':_0x416624[_0x6779('0x2b')]};}}}catch(_0x98da0e){logger[_0x6779('0x38')](_0x6779('0x41'),_0x98da0e[_0x6779('0x3a')]);}};Acw['prototype'][_0x6779('0x18')]=function(_0x258726){try{if(this[_0x6779('0x8')][_0x258726[_0x6779('0x1f')]]&&(this['voiceQueues'][_0x258726['queue']][_0x6779('0x5')]||this[_0x6779('0x8')][_0x258726[_0x6779('0x1f')]][_0x6779('0x20')])){if(this[_0x6779('0x9')][_0x258726[_0x6779('0x1e')]]){this[_0x6779('0xb')][_0x258726[_0x6779('0x31')]]={'queue':_0x258726[_0x6779('0x1f')],'interface':_0x258726[_0x6779('0x1e')]};}}}catch(_0x28cd9b){logger[_0x6779('0x38')]('[ACW][syncAgentConnectPreview]\x20%s',_0x28cd9b[_0x6779('0x3a')]);}};Acw[_0x6779('0x1c')][_0x6779('0xe')]=function(_0x13a803){try{if(this[_0x6779('0xb')][_0x13a803[_0x6779('0x31')]]&&_[_0x6779('0x42')](this[_0x6779('0xb')][_0x13a803[_0x6779('0x31')]][_0x6779('0x2a')])){logger[_0x6779('0x28')](_0x6779('0x43'),_0x13a803['uniqueid']);this[_0x6779('0x1d')](_0x13a803[_0x6779('0x31')]);}else if(this['channels'][_0x13a803[_0x6779('0x44')]]&&_['isUndefined'](this[_0x6779('0xb')][_0x13a803[_0x6779('0x44')]][_0x6779('0x2a')])){logger['info'](_0x6779('0x45'),_0x13a803['linkedid']);this[_0x6779('0x1d')](_0x13a803[_0x6779('0x44')]);}}catch(_0x5a0ac4){logger[_0x6779('0x38')]('[ACW][syncHangupRequest]\x20%s',_0x5a0ac4[_0x6779('0x3a')]);}};Acw[_0x6779('0x1c')][_0x6779('0x10')]=function(_0x29a48e){try{if(this['channels'][_0x29a48e['uniqueid']]&&this[_0x6779('0xb')][_0x29a48e['uniqueid']][_0x6779('0x2a')]){logger['info']('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x29a48e[_0x6779('0x31')]);this[_0x6779('0x1d')](_0x29a48e[_0x6779('0x31')]);}else if(this[_0x6779('0xb')][_0x29a48e[_0x6779('0x44')]]&&this[_0x6779('0xb')][_0x29a48e[_0x6779('0x44')]][_0x6779('0x2a')]){logger[_0x6779('0x28')](_0x6779('0x46'),_0x29a48e[_0x6779('0x44')]);this[_0x6779('0x1d')](_0x29a48e[_0x6779('0x44')]);}}catch(_0xb3c5a2){logger[_0x6779('0x38')](_0x6779('0x47'),_0xb3c5a2['message']);}};Acw[_0x6779('0x1c')][_0x6779('0x14')]=function(_0x132e6b){try{if(!_[_0x6779('0x48')](this[_0x6779('0xb')][_0x132e6b[_0x6779('0x49')]])){this['startAcw'](_0x132e6b[_0x6779('0x49')]);if(this[_0x6779('0xb')][_0x132e6b[_0x6779('0x4a')]]){this[_0x6779('0xb')][_0x132e6b[_0x6779('0x4a')]][_0x6779('0x2a')]=!![];this[_0x6779('0xb')][_0x132e6b[_0x6779('0x4b')]]=this[_0x6779('0xb')][_0x132e6b[_0x6779('0x4a')]];delete this['channels'][_0x132e6b['secondtransfereruniqueid']];}}else if(!_[_0x6779('0x48')](this[_0x6779('0xb')][_0x132e6b[_0x6779('0x4b')]])){this[_0x6779('0x1d')](_0x132e6b[_0x6779('0x4b')]);if(this[_0x6779('0xb')][_0x132e6b[_0x6779('0x4c')]]){this[_0x6779('0xb')][_0x132e6b[_0x6779('0x4c')]][_0x6779('0x2a')]=!![];this[_0x6779('0xb')][_0x132e6b[_0x6779('0x49')]]=this[_0x6779('0xb')][_0x132e6b[_0x6779('0x4c')]];delete this[_0x6779('0xb')][_0x132e6b[_0x6779('0x4c')]];}}}catch(_0x2cb427){logger[_0x6779('0x38')](_0x6779('0x4d'),_0x2cb427['message']);}};Acw[_0x6779('0x1c')][_0x6779('0x16')]=function(_0x25d290){try{if(this[_0x6779('0xb')][_0x25d290[_0x6779('0x4e')]]){logger[_0x6779('0x28')]('[%s][BLINDTRANSFER:UNIQUEID]',JSON[_0x6779('0x4f')](_0x25d290[_0x6779('0x4e')]));this['startAcw'](_0x25d290[_0x6779('0x4e')]);}else if(this['channels'][_0x25d290[_0x6779('0x50')]]){logger['info'](_0x6779('0x51'),JSON[_0x6779('0x4f')](_0x25d290['transfererlinkedid']));this[_0x6779('0x1d')](_0x25d290[_0x6779('0x50')]);}}catch(_0x5551d4){logger[_0x6779('0x38')]('[ACW][syncBlindTransfer]\x20%s',_0x5551d4[_0x6779('0x3a')]);}};Acw[_0x6779('0x1c')]['syncAgentRingNoAnswer']=function(_0x5cb189){try{if(this['voiceQueues'][_0x5cb189[_0x6779('0x1f')]]&&this['voiceQueues'][_0x5cb189[_0x6779('0x1f')]][_0x6779('0x52')]===_0x6779('0x53')){if(this[_0x6779('0x9')][_0x5cb189[_0x6779('0x1e')]]){logger['info']('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x5cb189[_0x6779('0x31')],_0x5cb189['interface'],_0x5cb189[_0x6779('0x1f')]);return RpcUser[_0x6779('0x2c')](this[_0x6779('0x9')][_0x5cb189[_0x6779('0x1e')]],'Auto-Pause',_0x5cb189[_0x6779('0x31')]);}}}catch(_0x5ba26a){logger[_0x6779('0x38')](_0x6779('0x54'),_0x5ba26a['message']);}};module[_0x6779('0x55')]=Acw; \ No newline at end of file +var _0x7983=['savePause','acwTimeout','timer','stopAcw','format','lastPauseAt','update','[%s][UPDATE][ACWTIME:%s]','error','catch','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','[ACW][START]\x20%s','message','prototype','uniqueid','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[%s][UPDATE][ERRORS:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','interface','destlinkedid','isUndefined','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','transfererlinkedid','autopause','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','../ami','../../../config/logger','acw','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','hanguprequest','bind','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','syncAgentConnectPreview','milliseconds','diff','seconds','startAcw','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0x7983,0x79));var _0x3798=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x7983[_0x167cc1];return _0x10bc4b;};'use strict';var util=require(_0x3798('0x0'));var _=require('lodash');var moment=require('moment');var ami=require(_0x3798('0x1'));var logger=require(_0x3798('0x2'))(_0x3798('0x3'));var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require(_0x3798('0x4'));function Acw(_0x4e3034){this[_0x3798('0x5')]=_0x4e3034[_0x3798('0x5')];this['agents']=_0x4e3034[_0x3798('0x6')];this[_0x3798('0x7')]=_0x4e3034['timers'];this[_0x3798('0x8')]={};ami['on'](_0x3798('0x9'),this[_0x3798('0xa')]['bind'](this));ami['on'](_0x3798('0xb'),this['syncHangupRequest'][_0x3798('0xc')](this));ami['on'](_0x3798('0xd'),this[_0x3798('0xe')][_0x3798('0xc')](this));ami['on'](_0x3798('0xf'),this[_0x3798('0x10')][_0x3798('0xc')](this));ami['on'](_0x3798('0x11'),this[_0x3798('0x12')][_0x3798('0xc')](this));ami['on'](_0x3798('0x13'),this[_0x3798('0x14')][_0x3798('0xc')](this));ami['on']('custom:agentConnectPreview',this[_0x3798('0x15')][_0x3798('0xc')](this));}function getDiff(_0x387f52){var _0x21965e=moment()[_0x3798('0x16')](0x0);var _0x4d3031=moment(_0x387f52)[_0x3798('0x16')](0x0);return _0x21965e[_0x3798('0x17')](_0x4d3031,_0x3798('0x18'));}Acw['prototype'][_0x3798('0x19')]=function(_0x47cf0f){try{var _0x4b35f7=this;var _0x446363=this[_0x3798('0x8')][_0x47cf0f]['interface'];var _0x4d17cf=this[_0x3798('0x8')][_0x47cf0f][_0x3798('0x1a')];var _0x19a784=this[_0x3798('0x5')][_0x4d17cf];var _0x1ffd86=![];var _0x446e5d=_0x3798('0x1b');if(_0x19a784[_0x3798('0x1c')]){if(_0x19a784[_0x3798('0x1d')][_0x3798('0x1e')]){_0x1ffd86=!![];_0x446e5d=_0x19a784[_0x3798('0x1d')][_0x3798('0x1e')];}}ami['Action']({'action':'QueuePause','interface':_0x446363,'paused':!![],'reason':_0x446e5d})[_0x3798('0x1f')](function(_0x715e2d){if(_0x4b35f7[_0x3798('0x6')][_0x446363]){return RpcUser[_0x3798('0x20')](_0x4b35f7[_0x3798('0x6')][_0x446363]['id'])[_0x3798('0x1f')](function(_0x5709d5){if(_0x5709d5&&!_0x5709d5[_0x3798('0x21')]){logger[_0x3798('0x22')](_0x3798('0x23'),_0x47cf0f,_0x446363,_0x4d17cf);var _0x3abad2=_0x4b35f7[_0x3798('0x8')][_0x47cf0f][_0x3798('0x24')]&&_0x4b35f7[_0x3798('0x8')][_0x47cf0f]['destlinkedid']?_0x4b35f7[_0x3798('0x8')][_0x47cf0f]['destlinkedid']:_0x47cf0f;return RpcUser[_0x3798('0x25')](_0x4b35f7[_0x3798('0x6')][_0x446363],_0x446e5d,_0x3abad2)[_0x3798('0x1f')](function(_0x2287ee){if(!_0x1ffd86){_0x4b35f7['timers'][_0x446363]={};logger[_0x3798('0x22')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x47cf0f,_0x4b35f7[_0x3798('0x5')][_0x4d17cf][_0x3798('0x26')],_0x446363,_0x4d17cf);_0x4b35f7['timers'][_0x446363][_0x3798('0x27')]=setTimeout(_0x4b35f7[_0x3798('0x28')][_0x3798('0xc')](_0x4b35f7,_0x446363),_0x4b35f7['voiceQueues'][_0x4d17cf][_0x3798('0x26')]*0x3e8);_0x4b35f7['timers'][_0x446363]['lastPauseAt']=moment()[_0x3798('0x29')]('YYYY-MM-DD\x20HH:mm:ss');_0x4b35f7['timers'][_0x446363]['uniqueid']=_0x47cf0f;_0x4b35f7['timers'][_0x446363][_0x3798('0x1a')]=_0x4d17cf;_0x4b35f7[_0x3798('0x7')][_0x446363]['updateAcw']=function(){var _0x1bd1eb=getDiff(_0x4b35f7[_0x3798('0x7')][_0x446363][_0x3798('0x2a')]);clearTimeout(_0x4b35f7[_0x3798('0x7')][_0x446363][_0x3798('0x27')]);_0x4b35f7[_0x3798('0x7')][_0x446363][_0x3798('0x27')]=![];RpcVoiceAgentReport[_0x3798('0x2b')]({'acwtime':_0x1bd1eb},_0x4b35f7[_0x3798('0x7')][_0x446363]['uniqueid'],_0x446363)[_0x3798('0x1f')](function(_0x53a9ad){logger[_0x3798('0x22')](_0x3798('0x2c'),_0x47cf0f,_0x1bd1eb,_0x53a9ad);})['catch'](function(_0x5ea194){logger[_0x3798('0x2d')]('[%s][UPDATE][ERRORS:%s]',_0x47cf0f,_0x5ea194);});delete _0x4b35f7[_0x3798('0x7')][_0x446363];};}});}else{logger[_0x3798('0x22')]('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x47cf0f,_0x446363,_0x4d17cf);}});}})[_0x3798('0x2e')](function(_0x228af7){logger[_0x3798('0x2d')](_0x3798('0x2f'),_0x47cf0f,_0x4b35f7['voiceQueues'][_0x4d17cf][_0x3798('0x26')],_0x446363,_0x4d17cf);})['finally'](function(){delete _0x4b35f7[_0x3798('0x8')][_0x47cf0f];});}catch(_0x4f71af){logger[_0x3798('0x2d')](_0x3798('0x30'),_0x4f71af[_0x3798('0x31')]);}};Acw[_0x3798('0x32')]['stopAcw']=function(_0x4eaef5){try{var _0x5ac156=this;if(_0x5ac156[_0x3798('0x7')][_0x4eaef5]){_0x5ac156['timers'][_0x4eaef5][_0x3798('0x27')]=![];var _0x56a23f=_0x5ac156[_0x3798('0x7')][_0x4eaef5][_0x3798('0x33')];var _0x491db8=_0x5ac156['timers'][_0x4eaef5][_0x3798('0x1a')];var _0x401063=_0x5ac156['voiceQueues'][_0x491db8]['acwTimeout'];logger[_0x3798('0x22')](_0x3798('0x34'),_0x56a23f,_0x4eaef5);RpcUser[_0x3798('0x35')](this[_0x3798('0x6')][_0x4eaef5]);RpcVoiceAgentReport[_0x3798('0x2b')]({'acwtime':_0x401063,'agentacw':!![]},_0x56a23f,_0x4eaef5)['then'](function(_0x490833){logger[_0x3798('0x22')]('[%s][UPDATE][ACWTIME:%s]',_0x56a23f,_0x401063,_0x490833);})[_0x3798('0x2e')](function(_0x53537f){logger[_0x3798('0x2d')](_0x3798('0x36'),_0x56a23f,_0x53537f);});}else{logger[_0x3798('0x2d')](_0x3798('0x37'),_0x4eaef5);if(_0x5ac156[_0x3798('0x7')]){logger[_0x3798('0x22')](_0x3798('0x38'),JSON[_0x3798('0x39')](_0x5ac156[_0x3798('0x7')]));}}}catch(_0x5c9fe1){logger[_0x3798('0x2d')]('[ACW][STOP]\x20%s',_0x5c9fe1[_0x3798('0x31')]);}};Acw['prototype']['syncAgentConnect']=function(_0x3774f9){try{if(this[_0x3798('0x5')][_0x3774f9[_0x3798('0x1a')]]&&(this[_0x3798('0x5')][_0x3774f9[_0x3798('0x1a')]][_0x3798('0x3')]||this[_0x3798('0x5')][_0x3774f9['queue']][_0x3798('0x1c')])){if(this['agents'][_0x3774f9[_0x3798('0x3a')]]){this[_0x3798('0x8')][_0x3774f9['uniqueid']]={'queue':_0x3774f9[_0x3798('0x1a')],'interface':_0x3774f9[_0x3798('0x3a')],'destlinkedid':_0x3774f9[_0x3798('0x3b')]};}}}catch(_0x54b25c){logger[_0x3798('0x2d')]('[ACW][syncAgentConnect]\x20%s',_0x54b25c[_0x3798('0x31')]);}};Acw[_0x3798('0x32')][_0x3798('0x15')]=function(_0x2cf50c){try{if(this[_0x3798('0x5')][_0x2cf50c[_0x3798('0x1a')]]&&(this[_0x3798('0x5')][_0x2cf50c[_0x3798('0x1a')]]['acw']||this[_0x3798('0x5')][_0x2cf50c[_0x3798('0x1a')]][_0x3798('0x1c')])){if(this[_0x3798('0x6')][_0x2cf50c[_0x3798('0x3a')]]){this['channels'][_0x2cf50c['uniqueid']]={'queue':_0x2cf50c[_0x3798('0x1a')],'interface':_0x2cf50c[_0x3798('0x3a')]};}}}catch(_0x4ba31d){logger[_0x3798('0x2d')]('[ACW][syncAgentConnectPreview]\x20%s',_0x4ba31d['message']);}};Acw[_0x3798('0x32')]['syncHangupRequest']=function(_0x1947fd){try{if(this[_0x3798('0x8')][_0x1947fd['uniqueid']]&&_[_0x3798('0x3c')](this[_0x3798('0x8')][_0x1947fd['uniqueid']][_0x3798('0x24')])){logger[_0x3798('0x22')]('[%s][HANGUP:UNIQUEID]',_0x1947fd[_0x3798('0x33')]);this[_0x3798('0x19')](_0x1947fd['uniqueid']);}else if(this[_0x3798('0x8')][_0x1947fd['linkedid']]&&_[_0x3798('0x3c')](this[_0x3798('0x8')][_0x1947fd[_0x3798('0x3d')]][_0x3798('0x24')])){logger[_0x3798('0x22')](_0x3798('0x3e'),_0x1947fd[_0x3798('0x3d')]);this[_0x3798('0x19')](_0x1947fd['linkedid']);}}catch(_0x307ef9){logger[_0x3798('0x2d')](_0x3798('0x3f'),_0x307ef9[_0x3798('0x31')]);}};Acw[_0x3798('0x32')][_0x3798('0xe')]=function(_0x2016bf){try{if(this['channels'][_0x2016bf['uniqueid']]&&this[_0x3798('0x8')][_0x2016bf['uniqueid']][_0x3798('0x24')]){logger[_0x3798('0x22')](_0x3798('0x40'),_0x2016bf['uniqueid']);this[_0x3798('0x19')](_0x2016bf[_0x3798('0x33')]);}else if(this[_0x3798('0x8')][_0x2016bf[_0x3798('0x3d')]]&&this[_0x3798('0x8')][_0x2016bf['linkedid']][_0x3798('0x24')]){logger['info'](_0x3798('0x41'),_0x2016bf[_0x3798('0x3d')]);this[_0x3798('0x19')](_0x2016bf[_0x3798('0x3d')]);}}catch(_0x285ce8){logger[_0x3798('0x2d')]('[ACW][syncHangup]\x20%s',_0x285ce8[_0x3798('0x31')]);}};Acw[_0x3798('0x32')][_0x3798('0x12')]=function(_0x227fa8){try{if(!_[_0x3798('0x42')](this[_0x3798('0x8')][_0x227fa8[_0x3798('0x43')]])){this[_0x3798('0x19')](_0x227fa8[_0x3798('0x43')]);if(this['channels'][_0x227fa8[_0x3798('0x44')]]){this[_0x3798('0x8')][_0x227fa8[_0x3798('0x44')]]['attended']=!![];this['channels'][_0x227fa8[_0x3798('0x45')]]=this[_0x3798('0x8')][_0x227fa8[_0x3798('0x44')]];delete this[_0x3798('0x8')][_0x227fa8[_0x3798('0x44')]];}}else if(!_[_0x3798('0x42')](this[_0x3798('0x8')][_0x227fa8[_0x3798('0x45')]])){this['startAcw'](_0x227fa8[_0x3798('0x45')]);if(this[_0x3798('0x8')][_0x227fa8[_0x3798('0x46')]]){this['channels'][_0x227fa8['origtransfereruniqueid']][_0x3798('0x24')]=!![];this['channels'][_0x227fa8[_0x3798('0x43')]]=this[_0x3798('0x8')][_0x227fa8[_0x3798('0x46')]];delete this[_0x3798('0x8')][_0x227fa8[_0x3798('0x46')]];}}}catch(_0x39375d){logger[_0x3798('0x2d')](_0x3798('0x47'),_0x39375d[_0x3798('0x31')]);}};Acw[_0x3798('0x32')][_0x3798('0x14')]=function(_0xff8369){try{if(this['channels'][_0xff8369[_0x3798('0x48')]]){logger['info']('[%s][BLINDTRANSFER:UNIQUEID]',JSON['stringify'](_0xff8369[_0x3798('0x48')]));this['startAcw'](_0xff8369[_0x3798('0x48')]);}else if(this[_0x3798('0x8')][_0xff8369[_0x3798('0x49')]]){logger[_0x3798('0x22')]('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0x3798('0x39')](_0xff8369['transfererlinkedid']));this[_0x3798('0x19')](_0xff8369[_0x3798('0x49')]);}}catch(_0xc17938){logger['error']('[ACW][syncBlindTransfer]\x20%s',_0xc17938['message']);}};Acw[_0x3798('0x32')][_0x3798('0x10')]=function(_0x4c8a8f){try{if(this[_0x3798('0x5')][_0x4c8a8f['queue']]&&this[_0x3798('0x5')][_0x4c8a8f[_0x3798('0x1a')]][_0x3798('0x4a')]==='all'){if(this[_0x3798('0x6')][_0x4c8a8f['interface']]){logger[_0x3798('0x22')](_0x3798('0x4b'),_0x4c8a8f[_0x3798('0x33')],_0x4c8a8f[_0x3798('0x3a')],_0x4c8a8f['queue']);return RpcUser['savePause'](this[_0x3798('0x6')][_0x4c8a8f[_0x3798('0x3a')]],_0x3798('0x4c'),_0x4c8a8f[_0x3798('0x33')]);}}}catch(_0x586f53){logger[_0x3798('0x2d')](_0x3798('0x4d'),_0x586f53[_0x3798('0x31')]);}};module[_0x3798('0x4e')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 95ff41b..f0bb7b7 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 _0x750a=['moment','util','../../config/logger','ami','asterisk','username','keepConnected','promisify','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','port','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','Action','sipshowregistry','actionDeviceStateList','actionSipPeerStatus','sippeerstatus','actionQueueSummary','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','then','catch','log','asterisk-manager','bluebird'];(function(_0x13c9c4,_0x96ed68){var _0x30a191=function(_0x2e3d04){while(--_0x2e3d04){_0x13c9c4['push'](_0x13c9c4['shift']());}};_0x30a191(++_0x96ed68);}(_0x750a,0x1df));var _0xa750=function(_0x1974c0,_0x361d0a){_0x1974c0=_0x1974c0-0x0;var _0x24918b=_0x750a[_0x1974c0];return _0x24918b;};'use strict';var Manager=require(_0xa750('0x0'));var BPromise=require(_0xa750('0x1'));var moment=require(_0xa750('0x2'));var util=require(_0xa750('0x3'));var _=require('lodash');var logger=require(_0xa750('0x4'))(_0xa750('0x5'));var config=require('../../config/environment');var ami=new Manager(config[_0xa750('0x6')]['port'],config[_0xa750('0x6')]['ip'],config['asterisk'][_0xa750('0x7')],config[_0xa750('0x6')]['password'],!![]);ami[_0xa750('0x8')]();ami['Action']=BPromise[_0xa750('0x9')](ami[_0xa750('0xa')]);function error(_0x401fd6){logger[_0xa750('0xb')](util[_0xa750('0xc')](_0xa750('0xd'),config[_0xa750('0x6')][_0xa750('0x7')],config[_0xa750('0x6')]['ip'],config[_0xa750('0x6')][_0xa750('0xe')],util['inspect'](_0x401fd6,![],null)));}function close(){logger[_0xa750('0xb')](util[_0xa750('0xc')](_0xa750('0xf'),config[_0xa750('0x6')][_0xa750('0x7')],config['asterisk']['ip'],config[_0xa750('0x6')][_0xa750('0xe')]));}ami[_0xa750('0x10')]=function(){return function(){return ami[_0xa750('0x11')]({'action':_0xa750('0x12')});};};ami[_0xa750('0x13')]=function(){return function(){return ami[_0xa750('0x11')]({'action':'devicestatelist'});};};ami[_0xa750('0x14')]=function(){return function(){return ami[_0xa750('0x11')]({'action':_0xa750('0x15')});};};ami[_0xa750('0x16')]=function(){return function(){return ami[_0xa750('0x11')]({'action':_0xa750('0x17')});};};ami[_0xa750('0x18')]=function(){return function(){return ami['Action']({'action':_0xa750('0x19')});};};function connect(_0x5ae460){logger[_0xa750('0x1a')](util[_0xa750('0xc')](_0xa750('0x1b'),config[_0xa750('0x6')]['username'],config['asterisk']['ip'],config[_0xa750('0x6')]['port']));ami[_0xa750('0x1c')](_0xa750('0xb'),error);ami[_0xa750('0x1c')](_0xa750('0x1d'),close);}ami['on']('connect',connect);ami['on'](_0xa750('0x1e'),function(_0x1260ce){logger['info'](util['format'](_0xa750('0x1f'),config[_0xa750('0x6')]['username'],config[_0xa750('0x6')]['ip'],config[_0xa750('0x6')][_0xa750('0xe')],util['inspect'](_0x1260ce,![],null)));});ami['on'](_0xa750('0x20'),function(_0x41848a){logger[_0xa750('0x1a')](util[_0xa750('0xc')](_0xa750('0x21'),config[_0xa750('0x6')][_0xa750('0x7')],config[_0xa750('0x6')]['ip'],config['asterisk']['port']));return BPromise['resolve']()[_0xa750('0x22')](ami[_0xa750('0x10')]())[_0xa750('0x22')](ami['actionDeviceStateList']())[_0xa750('0x22')](ami[_0xa750('0x14')]())['then'](ami[_0xa750('0x16')]())['then'](ami[_0xa750('0x18')]())[_0xa750('0x23')](function(_0x21ae61){console[_0xa750('0x24')](_0x21ae61);});});ami['once'](_0xa750('0xb'),error);ami[_0xa750('0x1c')](_0xa750('0x1d'),close);module['exports']=ami; \ No newline at end of file +var _0xc258=['asterisk-manager','moment','util','../../config/logger','ami','../../config/environment','asterisk','port','username','password','action','error','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','format','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','Action','sipshowregistry','devicestatelist','queuesummary','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','resolve','actionDeviceStateList','then','actionSipPeerStatus','actionQueueSummary','actionCoreShowChannels','catch','log','exports'];(function(_0x599e60,_0x5b6519){var _0x468e19=function(_0xcdfd97){while(--_0xcdfd97){_0x599e60['push'](_0x599e60['shift']());}};_0x468e19(++_0x5b6519);}(_0xc258,0x90));var _0x8c25=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xc258[_0x4a9fb1];return _0x348672;};'use strict';var Manager=require(_0x8c25('0x0'));var BPromise=require('bluebird');var moment=require(_0x8c25('0x1'));var util=require(_0x8c25('0x2'));var _=require('lodash');var logger=require(_0x8c25('0x3'))(_0x8c25('0x4'));var config=require(_0x8c25('0x5'));var ami=new Manager(config[_0x8c25('0x6')][_0x8c25('0x7')],config[_0x8c25('0x6')]['ip'],config['asterisk'][_0x8c25('0x8')],config[_0x8c25('0x6')][_0x8c25('0x9')],!![]);ami['keepConnected']();ami['Action']=BPromise['promisify'](ami[_0x8c25('0xa')]);function error(_0x6f563b){logger[_0x8c25('0xb')](util['format'](_0x8c25('0xc'),config['asterisk'][_0x8c25('0x8')],config['asterisk']['ip'],config[_0x8c25('0x6')]['port'],util[_0x8c25('0xd')](_0x6f563b,![],null)));}function close(){logger[_0x8c25('0xb')](util[_0x8c25('0xe')](_0x8c25('0xf'),config[_0x8c25('0x6')][_0x8c25('0x8')],config[_0x8c25('0x6')]['ip'],config[_0x8c25('0x6')][_0x8c25('0x7')]));}ami[_0x8c25('0x10')]=function(){return function(){return ami[_0x8c25('0x11')]({'action':_0x8c25('0x12')});};};ami['actionDeviceStateList']=function(){return function(){return ami['Action']({'action':_0x8c25('0x13')});};};ami['actionSipPeerStatus']=function(){return function(){return ami[_0x8c25('0x11')]({'action':'sippeerstatus'});};};ami['actionQueueSummary']=function(){return function(){return ami[_0x8c25('0x11')]({'action':_0x8c25('0x14')});};};ami['actionCoreShowChannels']=function(){return function(){return ami['Action']({'action':'coreshowchannels'});};};function connect(_0x56b10e){logger[_0x8c25('0x15')](util['format'](_0x8c25('0x16'),config[_0x8c25('0x6')]['username'],config[_0x8c25('0x6')]['ip'],config[_0x8c25('0x6')][_0x8c25('0x7')]));ami[_0x8c25('0x17')](_0x8c25('0xb'),error);ami[_0x8c25('0x17')](_0x8c25('0x18'),close);}ami['on']('connect',connect);ami['on']('shutdown',function(_0x429c52){logger[_0x8c25('0x15')](util[_0x8c25('0xe')](_0x8c25('0x19'),config[_0x8c25('0x6')][_0x8c25('0x8')],config[_0x8c25('0x6')]['ip'],config[_0x8c25('0x6')][_0x8c25('0x7')],util[_0x8c25('0xd')](_0x429c52,![],null)));});ami['on'](_0x8c25('0x1a'),function(_0x592813){logger[_0x8c25('0x15')](util['format']('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config['asterisk']['username'],config[_0x8c25('0x6')]['ip'],config['asterisk']['port']));return BPromise[_0x8c25('0x1b')]()['then'](ami['actionSipShowRegistry']())['then'](ami[_0x8c25('0x1c')]())[_0x8c25('0x1d')](ami[_0x8c25('0x1e')]())[_0x8c25('0x1d')](ami[_0x8c25('0x1f')]())[_0x8c25('0x1d')](ami[_0x8c25('0x20')]())[_0x8c25('0x21')](function(_0x454b4d){console[_0x8c25('0x22')](_0x454b4d);});});ami[_0x8c25('0x17')]('error',error);ami[_0x8c25('0x17')](_0x8c25('0x18'),close);module[_0x8c25('0x23')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 22cf49b..dbf53ab 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 _0xcb91=['request','debug','memberReport','error','rpc','message','result','catch','exports','../../config/logger','ami','client','http'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x258b93,_0x188ccc){_0x258b93=_0x258b93-0x0;var _0x35484b=_0xcb91[_0x258b93];return _0x35484b;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var client=jayson[_0x1cb9('0x2')][_0x1cb9('0x3')]({'port':0x2329});client['Request']=function(_0x8c392f,_0x2c17b8){return new BPromise(function(_0x545a34,_0x13d5fd){return client[_0x1cb9('0x4')](_0x8c392f,_0x2c17b8)['then'](function(_0x226b69){logger[_0x1cb9('0x5')]('rpc',_0x1cb9('0x6'),_0x8c392f,_0x2c17b8,_0x226b69);if(_0x226b69[_0x1cb9('0x7')]){logger['error'](_0x1cb9('0x8'),'memberReport',_0x8c392f,_0x226b69['error'][_0x1cb9('0x9')],_0x2c17b8);return _0x13d5fd(_0x226b69[_0x1cb9('0x7')][_0x1cb9('0x9')]);}else{return _0x545a34(_0x226b69[_0x1cb9('0xa')]);}})[_0x1cb9('0xb')](function(_0x50ce71){logger[_0x1cb9('0x7')](_0x1cb9('0x8'),_0x1cb9('0x6'),_0x8c392f,_0x50ce71,_0x2c17b8);return _0x13d5fd(_0x50ce71);});});};module[_0x1cb9('0xc')]=client; \ No newline at end of file +var _0x0713=['rpc','memberReport','error','message','result','catch','exports','../../config/logger','ami','client','http','Request','request','then','debug'];(function(_0x192791,_0x418a6e){var _0x3f2b35=function(_0x413b8a){while(--_0x413b8a){_0x192791['push'](_0x192791['shift']());}};_0x3f2b35(++_0x418a6e);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var client=jayson[_0x3071('0x2')][_0x3071('0x3')]({'port':0x2329});client[_0x3071('0x4')]=function(_0x52b5fb,_0x2c547f){return new BPromise(function(_0x7b18a4,_0x33a70c){return client[_0x3071('0x5')](_0x52b5fb,_0x2c547f)[_0x3071('0x6')](function(_0x41cf76){logger[_0x3071('0x7')](_0x3071('0x8'),_0x3071('0x9'),_0x52b5fb,_0x2c547f,_0x41cf76);if(_0x41cf76[_0x3071('0xa')]){logger[_0x3071('0xa')](_0x3071('0x8'),_0x3071('0x9'),_0x52b5fb,_0x41cf76['error'][_0x3071('0xb')],_0x2c547f);return _0x33a70c(_0x41cf76[_0x3071('0xa')][_0x3071('0xb')]);}else{return _0x7b18a4(_0x41cf76[_0x3071('0xc')]);}})[_0x3071('0xd')](function(_0x4a470a){logger[_0x3071('0xa')](_0x3071('0x8'),_0x3071('0x9'),_0x52b5fb,_0x4a470a,_0x2c547f);return _0x33a70c(_0x4a470a);});});};module[_0x3071('0xe')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index 8cc5cde..c270d1f 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 _0xd875=['lodash','moment','isNil','string','voiceQueue','uniqueid','name','phone','Contact','firstName','lastName','number','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','substring','getQueue','queue','exports','util'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0xd875,0x1a6));var _0x5d87=function(_0x5bdaf0,_0x287d94){_0x5bdaf0=_0x5bdaf0-0x0;var _0x326399=_0xd875[_0x5bdaf0];return _0x326399;};'use strict';var util=require(_0x5d87('0x0'));var _=require(_0x5d87('0x1'));var moment=require(_0x5d87('0x2'));function checkNameSurname(_0x2a16c4,_0x20877d,_0x3d2c7b){var _0xb33d72='';if(!_[_0x5d87('0x3')](_0x20877d)&&_0x5d87('0x4')===typeof _0x20877d){_0xb33d72+=_0x20877d;}if(!_['isNil'](_0x3d2c7b)&&_0x5d87('0x4')===typeof _0x3d2c7b){_0xb33d72+='\x20'+_0x3d2c7b;}if(_0xb33d72!==''){return _0xb33d72;}return _0x2a16c4;}function Action(_0x3a3beb,_0x62e53,_0x162847){this[_0x5d87('0x5')]=_0x3a3beb;this[_0x5d87('0x6')]=_0x162847||undefined;this[_0x5d87('0x7')]=checkNameSurname(_0x62e53['Contact'][_0x5d87('0x8')],_0x62e53[_0x5d87('0x9')][_0x5d87('0xa')],_0x62e53['Contact'][_0x5d87('0xb')]);this[_0x5d87('0xc')]=_0x62e53[_0x5d87('0x9')][_0x5d87('0x8')];this['queue']=_0x3a3beb[_0x5d87('0x7')];this[_0x5d87('0xd')]=_0x62e53[_0x5d87('0xd')]||![];this[_0x5d87('0xe')]=_0x3a3beb['type'];this[_0x5d87('0xf')]=_0x3a3beb[_0x5d87('0xf')]||0x3;this[_0x5d87('0x10')]=_0x62e53[_0x5d87('0x10')];this[_0x5d87('0x11')]=_0x62e53[_0x5d87('0x11')];this[_0x5d87('0x12')]=_0x62e53[_0x5d87('0x12')];this['countnoanswerretry']=_0x62e53[_0x5d87('0x13')];this[_0x5d87('0x14')]=_0x62e53[_0x5d87('0x14')];this[_0x5d87('0x15')]=_0x62e53[_0x5d87('0x15')];this[_0x5d87('0x16')]=_0x62e53[_0x5d87('0x16')];this[_0x5d87('0x17')]=_0x62e53['countmachineretry'];this['countagentrejectretry']=_0x62e53['countagentrejectretry'];this[_0x5d87('0x18')]=_0x62e53['ContactId'];this[_0x5d87('0x19')]=_0x62e53[_0x5d87('0x19')];this[_0x5d87('0x1a')]=_0x62e53[_0x5d87('0x1a')];this[_0x5d87('0x1b')]=_0x62e53[_0x5d87('0x1b')];this['CampaignId']=_0x62e53[_0x5d87('0x1c')];this[_0x5d87('0x1d')]=_0x62e53['id'];this[_0x5d87('0x1e')]=_0x62e53[_0x5d87('0x9')][_0x5d87('0xa')]||'';this[_0x5d87('0x1f')]=moment()[_0x5d87('0x20')](_0x5d87('0x21'));this[_0x5d87('0x22')]=_0x62e53['callback'];this[_0x5d87('0x23')]=_0x62e53[_0x5d87('0x23')];this[_0x5d87('0x24')]=_0x62e53[_0x5d87('0x24')];this[_0x5d87('0x25')]=_0x62e53[_0x5d87('0x25')];this['originatecalleridnum']='';this[_0x5d87('0x26')]='';}Action[_0x5d87('0x27')][_0x5d87('0x28')]=function(){return util[_0x5d87('0x20')](_0x5d87('0x29'),this[_0x5d87('0x7')],this[_0x5d87('0x5')][_0x5d87('0x2a')]>0x0?this['number'][_0x5d87('0x2b')](this['voiceQueue'][_0x5d87('0x2a')]):this[_0x5d87('0xc')]);};Action[_0x5d87('0x27')][_0x5d87('0x2c')]=function(){return this[_0x5d87('0x2d')];};module[_0x5d87('0x2e')]=Action; \ No newline at end of file +var _0x43f4=['getQueue','exports','util','lodash','moment','isNil','voiceQueue','uniqueid','name','Contact','phone','lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','ContactFirstName','firstName','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','originatecalleridnum','originatecalleridname','dialCutDigit','substring','prototype'];(function(_0x5164b0,_0x55c095){var _0x4a17d5=function(_0x322f5c){while(--_0x322f5c){_0x5164b0['push'](_0x5164b0['shift']());}};_0x4a17d5(++_0x55c095);}(_0x43f4,0xd9));var _0x443f=function(_0x162f44,_0x1df451){_0x162f44=_0x162f44-0x0;var _0x57837b=_0x43f4[_0x162f44];return _0x57837b;};'use strict';var util=require(_0x443f('0x0'));var _=require(_0x443f('0x1'));var moment=require(_0x443f('0x2'));function checkNameSurname(_0x411319,_0xf9314c,_0x1d3178){var _0x46e09c='';if(!_[_0x443f('0x3')](_0xf9314c)&&'string'===typeof _0xf9314c){_0x46e09c+=_0xf9314c;}if(!_[_0x443f('0x3')](_0x1d3178)&&'string'===typeof _0x1d3178){_0x46e09c+='\x20'+_0x1d3178;}if(_0x46e09c!==''){return _0x46e09c;}return _0x411319;}function Action(_0x21bef0,_0x5847d0,_0x34a5a7){this[_0x443f('0x4')]=_0x21bef0;this[_0x443f('0x5')]=_0x34a5a7||undefined;this[_0x443f('0x6')]=checkNameSurname(_0x5847d0[_0x443f('0x7')][_0x443f('0x8')],_0x5847d0['Contact']['firstName'],_0x5847d0[_0x443f('0x7')][_0x443f('0x9')]);this[_0x443f('0xa')]=_0x5847d0['Contact'][_0x443f('0x8')];this[_0x443f('0xb')]=_0x21bef0['name'];this[_0x443f('0xc')]=_0x5847d0['active']||![];this[_0x443f('0xd')]=_0x21bef0[_0x443f('0xd')];this[_0x443f('0xe')]=_0x21bef0[_0x443f('0xe')]||0x3;this['scheduledat']=_0x5847d0[_0x443f('0xf')];this['countbusyretry']=_0x5847d0[_0x443f('0x10')];this[_0x443f('0x11')]=_0x5847d0[_0x443f('0x11')];this[_0x443f('0x12')]=_0x5847d0[_0x443f('0x12')];this[_0x443f('0x13')]=_0x5847d0[_0x443f('0x13')];this[_0x443f('0x14')]=_0x5847d0[_0x443f('0x14')];this['countabandonedretry']=_0x5847d0[_0x443f('0x15')];this[_0x443f('0x16')]=_0x5847d0[_0x443f('0x16')];this[_0x443f('0x17')]=_0x5847d0[_0x443f('0x17')];this[_0x443f('0x18')]=_0x5847d0[_0x443f('0x18')];this[_0x443f('0x19')]=_0x5847d0[_0x443f('0x19')];this[_0x443f('0x1a')]=_0x5847d0[_0x443f('0x1a')];this[_0x443f('0x1b')]=_0x5847d0[_0x443f('0x1b')];this[_0x443f('0x1c')]=_0x5847d0['CampaignId'];this['idHopper']=_0x5847d0['id'];this[_0x443f('0x1d')]=_0x5847d0[_0x443f('0x7')][_0x443f('0x1e')]||'';this['starttime']=moment()[_0x443f('0x1f')](_0x443f('0x20'));this[_0x443f('0x21')]=_0x5847d0[_0x443f('0x21')];this[_0x443f('0x22')]=_0x5847d0[_0x443f('0x22')];this[_0x443f('0x23')]=_0x5847d0[_0x443f('0x23')];this['recallme']=_0x5847d0['recallme'];this[_0x443f('0x24')]='';this[_0x443f('0x25')]='';}Action['prototype']['getCaller']=function(){return util[_0x443f('0x1f')]('\x22%s\x22\x20<%s>',this[_0x443f('0x6')],this[_0x443f('0x4')][_0x443f('0x26')]>0x0?this['number'][_0x443f('0x27')](this[_0x443f('0x4')][_0x443f('0x26')]):this[_0x443f('0xa')]);};Action[_0x443f('0x28')][_0x443f('0x29')]=function(){return this[_0x443f('0xb')];};module[_0x443f('0x2a')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index ad8e082..b87418f 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 _0xa72c=['countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','membername','reason','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','exports','util','lodash','milliseconds','diff','state','statedesc','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry'];(function(_0x133ae7,_0x31bfd9){var _0x48677e=function(_0xc8bcc){while(--_0xc8bcc){_0x133ae7['push'](_0x133ae7['shift']());}};_0x48677e(++_0x31bfd9);}(_0xa72c,0x9b));var _0xca72=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0xa72c[_0x565c49];return _0x20ca34;};'use strict';var util=require(_0xca72('0x0'));var _=require(_0xca72('0x1'));var moment=require('moment');function getSeconds(_0x2539d9,_0x3582af){var _0x22134=moment(_0x2539d9)['milliseconds'](0x0);var _0x219c7e=moment(_0x3582af)[_0xca72('0x2')](0x0);return _0x22134[_0xca72('0x3')](_0x219c7e,'seconds');}function AgentComplete(_0x5b480a,_0x370499){this[_0xca72('0x4')]=0x4;this[_0xca72('0x5')]='Answer';this[_0xca72('0x6')]=_0x5b480a[_0xca72('0x6')];this[_0xca72('0x7')]=_0x5b480a[_0xca72('0x7')];this[_0xca72('0x8')]=_0x5b480a['type']===_0xca72('0x9')?_0xca72('0xa'):_0x5b480a[_0xca72('0x7')];this[_0xca72('0xb')]=_0x5b480a[_0xca72('0xb')];this[_0xca72('0xc')]=_0x5b480a[_0xca72('0xc')];this[_0xca72('0xd')]=_0x5b480a[_0xca72('0xd')];this[_0xca72('0xe')]=_0x5b480a[_0xca72('0xb')]+_0x5b480a[_0xca72('0xc')]+_0x5b480a[_0xca72('0xd')]+_0x5b480a[_0xca72('0xf')]+_0x5b480a[_0xca72('0x10')]+_0x5b480a[_0xca72('0x11')]+_0x5b480a[_0xca72('0x12')]+_0x5b480a[_0xca72('0x13')];this[_0xca72('0xf')]=_0x5b480a[_0xca72('0xf')];this[_0xca72('0x10')]=_0x5b480a['countdropretry'];this[_0xca72('0x11')]=_0x5b480a['countabandonedretry'];this['countmachineretry']=_0x5b480a['countmachineretry'];this['countagentrejectretry']=_0x5b480a[_0xca72('0x13')];this[_0xca72('0x14')]=_0x370499['uniqueid'];this[_0xca72('0x15')]=_0x5b480a[_0xca72('0x16')];this['calleridnum']=_0x5b480a['number'];this['starttime']=_0x5b480a[_0xca72('0x17')];this[_0xca72('0x18')]=_0x5b480a[_0xca72('0x18')];this[_0xca72('0x19')]=_0x5b480a[_0xca72('0x19')];this[_0xca72('0x1a')]=moment()[_0xca72('0x1b')](_0xca72('0x1c'));this[_0xca72('0x1d')]=getSeconds(_0x5b480a[_0xca72('0x18')],_0x5b480a['starttime']);this[_0xca72('0x1e')]=getSeconds(_0x5b480a[_0xca72('0x19')],_0x5b480a[_0xca72('0x18')]);this['talktime']=getSeconds(this['endtime'],_0x5b480a[_0xca72('0x19')]);this[_0xca72('0xa')]=_0x370499[_0xca72('0xa')];this[_0xca72('0x1f')]=_0x370499[_0xca72('0x1f')];this[_0xca72('0x20')]=_0x370499[_0xca72('0x20')];this['callback']=_0x5b480a['callback'];this[_0xca72('0x21')]=_0x5b480a[_0xca72('0x21')];this[_0xca72('0x22')]=_0x5b480a[_0xca72('0x22')];this[_0xca72('0x23')]=_0x5b480a[_0xca72('0x23')];this['ContactId']=_0x5b480a[_0xca72('0x24')];this[_0xca72('0x25')]=_0x5b480a[_0xca72('0x25')];this[_0xca72('0x26')]=_0x5b480a[_0xca72('0x26')];this[_0xca72('0x27')]=_0x5b480a[_0xca72('0x27')];this[_0xca72('0x28')]=_0x5b480a[_0xca72('0x28')];this['originatecalleridnum']=_0x5b480a[_0xca72('0x29')]||'';this['originatecalleridname']=_0x5b480a['originatecalleridname']||'';}module[_0xca72('0x2a')]=AgentComplete; \ No newline at end of file +var _0x1bb4=['UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','moment','milliseconds','seconds','state','statedesc','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','name','calleridnum','starttime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','responsetime','holdtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId'];(function(_0x508dbe,_0x3573db){var _0x377bf2=function(_0x3f0d0e){while(--_0x3f0d0e){_0x508dbe['push'](_0x508dbe['shift']());}};_0x377bf2(++_0x3573db);}(_0x1bb4,0x1c7));var _0x41bb=function(_0x3bb8f5,_0x4343c8){_0x3bb8f5=_0x3bb8f5-0x0;var _0x176048=_0x1bb4[_0x3bb8f5];return _0x176048;};'use strict';var util=require(_0x41bb('0x0'));var _=require(_0x41bb('0x1'));var moment=require(_0x41bb('0x2'));function getSeconds(_0x42db48,_0x1cd211){var _0x4db093=moment(_0x42db48)[_0x41bb('0x3')](0x0);var _0x5da3f3=moment(_0x1cd211)[_0x41bb('0x3')](0x0);return _0x4db093['diff'](_0x5da3f3,_0x41bb('0x4'));}function AgentComplete(_0x4f7261,_0x232b17){this[_0x41bb('0x5')]=0x4;this[_0x41bb('0x6')]='Answer';this[_0x41bb('0x7')]=_0x4f7261[_0x41bb('0x7')];this['type']=_0x4f7261[_0x41bb('0x8')];this[_0x41bb('0x9')]=_0x4f7261[_0x41bb('0x8')]==='outbound'?_0x41bb('0xa'):_0x4f7261[_0x41bb('0x8')];this[_0x41bb('0xb')]=_0x4f7261[_0x41bb('0xb')];this[_0x41bb('0xc')]=_0x4f7261['countcongestionretry'];this[_0x41bb('0xd')]=_0x4f7261[_0x41bb('0xd')];this[_0x41bb('0xe')]=_0x4f7261[_0x41bb('0xb')]+_0x4f7261[_0x41bb('0xc')]+_0x4f7261[_0x41bb('0xd')]+_0x4f7261[_0x41bb('0xf')]+_0x4f7261[_0x41bb('0x10')]+_0x4f7261['countabandonedretry']+_0x4f7261['countmachineretry']+_0x4f7261['countagentrejectretry'];this[_0x41bb('0xf')]=_0x4f7261[_0x41bb('0xf')];this[_0x41bb('0x10')]=_0x4f7261['countdropretry'];this['countabandonedretry']=_0x4f7261[_0x41bb('0x11')];this[_0x41bb('0x12')]=_0x4f7261[_0x41bb('0x12')];this[_0x41bb('0x13')]=_0x4f7261[_0x41bb('0x13')];this['uniqueid']=_0x232b17[_0x41bb('0x14')];this['calleridname']=_0x4f7261[_0x41bb('0x15')];this[_0x41bb('0x16')]=_0x4f7261['number'];this[_0x41bb('0x17')]=_0x4f7261[_0x41bb('0x17')];this['responsetime']=_0x4f7261['responsetime'];this[_0x41bb('0x18')]=_0x4f7261['answertime'];this[_0x41bb('0x19')]=moment()[_0x41bb('0x1a')](_0x41bb('0x1b'));this[_0x41bb('0x1c')]=getSeconds(_0x4f7261[_0x41bb('0x1d')],_0x4f7261[_0x41bb('0x17')]);this[_0x41bb('0x1e')]=getSeconds(_0x4f7261[_0x41bb('0x18')],_0x4f7261[_0x41bb('0x1d')]);this[_0x41bb('0x1f')]=getSeconds(this['endtime'],_0x4f7261[_0x41bb('0x18')]);this[_0x41bb('0xa')]=_0x232b17[_0x41bb('0xa')];this[_0x41bb('0x20')]=_0x232b17['membername'];this['reason']=_0x232b17[_0x41bb('0x21')];this[_0x41bb('0x22')]=_0x4f7261[_0x41bb('0x22')];this['callbackuniqueid']=_0x4f7261[_0x41bb('0x23')];this[_0x41bb('0x24')]=_0x4f7261['callbackat'];this[_0x41bb('0x25')]=_0x4f7261[_0x41bb('0x25')];this[_0x41bb('0x26')]=_0x4f7261[_0x41bb('0x26')];this[_0x41bb('0x27')]=_0x4f7261[_0x41bb('0x27')];this[_0x41bb('0x28')]=_0x4f7261[_0x41bb('0x28')];this[_0x41bb('0x29')]=_0x4f7261[_0x41bb('0x29')];this[_0x41bb('0x2a')]=_0x4f7261[_0x41bb('0x2a')];this[_0x41bb('0x2b')]=_0x4f7261[_0x41bb('0x2b')]||'';this[_0x41bb('0x2c')]=_0x4f7261[_0x41bb('0x2c')]||'';}module['exports']=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index 04f302d..bb53af4 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 _0x7f42=['scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','diff','uniqueid'];(function(_0xeadc11,_0x27e378){var _0x4257b6=function(_0x38bb40){while(--_0x38bb40){_0xeadc11['push'](_0xeadc11['shift']());}};_0x4257b6(++_0x27e378);}(_0x7f42,0x1dd));var _0x27f4=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x7f42[_0x57b54c];return _0x59cc19;};'use strict';var util=require(_0x27f4('0x0'));var _=require('lodash');var moment=require(_0x27f4('0x1'));function getSeconds(_0xd1035c,_0x48e553){var _0x66342a=moment(_0xd1035c)['milliseconds'](0x0);var _0x10627e=moment(_0x48e553)['milliseconds'](0x0);return _0x66342a[_0x27f4('0x2')](_0x10627e,'seconds');}function Final(_0xe8eabe){this['uniqueid']=_0xe8eabe[_0x27f4('0x3')];this[_0x27f4('0x4')]=_0xe8eabe[_0x27f4('0x4')];this[_0x27f4('0x5')]=_0xe8eabe[_0x27f4('0x5')];this[_0x27f4('0x6')]=_0xe8eabe[_0x27f4('0x5')]===_0x27f4('0x7')?_0x27f4('0x8'):_0xe8eabe[_0x27f4('0x5')];this[_0x27f4('0x9')]=_0xe8eabe[_0x27f4('0x9')];this[_0x27f4('0xa')]=_0xe8eabe[_0x27f4('0xa')];this[_0x27f4('0xb')]=_0xe8eabe[_0x27f4('0xb')];this[_0x27f4('0xc')]=_0xe8eabe[_0x27f4('0x9')]+_0xe8eabe['countcongestionretry']+_0xe8eabe['countnoanswerretry']+_0xe8eabe[_0x27f4('0xd')]+_0xe8eabe[_0x27f4('0xe')]+_0xe8eabe[_0x27f4('0xf')]+_0xe8eabe[_0x27f4('0x10')]+_0xe8eabe[_0x27f4('0x11')];this[_0x27f4('0xd')]=_0xe8eabe[_0x27f4('0xd')];this[_0x27f4('0xe')]=_0xe8eabe['countdropretry'];this['countabandonedretry']=_0xe8eabe[_0x27f4('0xf')];this[_0x27f4('0x10')]=_0xe8eabe[_0x27f4('0x10')];this[_0x27f4('0x11')]=_0xe8eabe['countagentrejectretry'];this[_0x27f4('0x8')]=_0xe8eabe[_0x27f4('0x8')];this[_0x27f4('0x12')]=_0xe8eabe['calleridname'];this[_0x27f4('0x13')]=_0xe8eabe[_0x27f4('0x13')];this[_0x27f4('0x14')]=_0xe8eabe['starttime'];this[_0x27f4('0x15')]=_0xe8eabe[_0x27f4('0x15')];this['endtime']=_0xe8eabe['responsetime'];this[_0x27f4('0x16')]=_0xe8eabe[_0x27f4('0x16')]||0x0;this[_0x27f4('0x17')]=_0xe8eabe[_0x27f4('0x17')]||0x0;this[_0x27f4('0x18')]=_0xe8eabe[_0x27f4('0x18')]||0x0;this[_0x27f4('0x19')]=_0xe8eabe[_0x27f4('0x19')];this[_0x27f4('0x1a')]=_0xe8eabe[_0x27f4('0x1a')];this[_0x27f4('0x1b')]=_0xe8eabe[_0x27f4('0x1b')];this[_0x27f4('0x1c')]=_0xe8eabe[_0x27f4('0x1c')];this[_0x27f4('0x1d')]=_0xe8eabe['ContactId'];this[_0x27f4('0x1e')]=_0xe8eabe[_0x27f4('0x1e')];this[_0x27f4('0x1f')]=_0xe8eabe[_0x27f4('0x1f')];this[_0x27f4('0x20')]=_0xe8eabe[_0x27f4('0x20')];this[_0x27f4('0x21')]=_0xe8eabe[_0x27f4('0x21')];this[_0x27f4('0x22')]=_0xe8eabe[_0x27f4('0x22')]||'';this[_0x27f4('0x23')]=_0xe8eabe[_0x27f4('0x23')]||'';}module[_0x27f4('0x24')]=Final; \ No newline at end of file +var _0xbfe8=['countagentrejectretry','countabandonedretry','countmachineretry','calleridname','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','milliseconds','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry'];(function(_0x5d1ed3,_0x56a960){var _0x26dda5=function(_0x3eee29){while(--_0x3eee29){_0x5d1ed3['push'](_0x5d1ed3['shift']());}};_0x26dda5(++_0x56a960);}(_0xbfe8,0x1b9));var _0x8bfe=function(_0x32d231,_0x1ef030){_0x32d231=_0x32d231-0x0;var _0x46411b=_0xbfe8[_0x32d231];return _0x46411b;};'use strict';var util=require('util');var _=require(_0x8bfe('0x0'));var moment=require('moment');function getSeconds(_0x1fd32c,_0x39d664){var _0x56fddf=moment(_0x1fd32c)['milliseconds'](0x0);var _0x101fc1=moment(_0x39d664)[_0x8bfe('0x1')](0x0);return _0x56fddf['diff'](_0x101fc1,_0x8bfe('0x2'));}function Final(_0x1deab0){this[_0x8bfe('0x3')]=_0x1deab0['uniqueid'];this[_0x8bfe('0x4')]=_0x1deab0[_0x8bfe('0x4')];this[_0x8bfe('0x5')]=_0x1deab0[_0x8bfe('0x5')];this[_0x8bfe('0x6')]=_0x1deab0[_0x8bfe('0x5')]===_0x8bfe('0x7')?_0x8bfe('0x8'):_0x1deab0[_0x8bfe('0x5')];this[_0x8bfe('0x9')]=_0x1deab0[_0x8bfe('0x9')];this[_0x8bfe('0xa')]=_0x1deab0[_0x8bfe('0xa')];this[_0x8bfe('0xb')]=_0x1deab0[_0x8bfe('0xb')];this['countglobal']=_0x1deab0[_0x8bfe('0x9')]+_0x1deab0['countcongestionretry']+_0x1deab0[_0x8bfe('0xb')]+_0x1deab0[_0x8bfe('0xc')]+_0x1deab0[_0x8bfe('0xd')]+_0x1deab0['countabandonedretry']+_0x1deab0['countmachineretry']+_0x1deab0[_0x8bfe('0xe')];this[_0x8bfe('0xc')]=_0x1deab0[_0x8bfe('0xc')];this[_0x8bfe('0xd')]=_0x1deab0[_0x8bfe('0xd')];this['countabandonedretry']=_0x1deab0[_0x8bfe('0xf')];this[_0x8bfe('0x10')]=_0x1deab0['countmachineretry'];this[_0x8bfe('0xe')]=_0x1deab0[_0x8bfe('0xe')];this[_0x8bfe('0x8')]=_0x1deab0['queue'];this['calleridname']=_0x1deab0[_0x8bfe('0x11')];this['calleridnum']=_0x1deab0['calleridnum'];this[_0x8bfe('0x12')]=_0x1deab0[_0x8bfe('0x12')];this[_0x8bfe('0x13')]=_0x1deab0[_0x8bfe('0x13')];this[_0x8bfe('0x14')]=_0x1deab0[_0x8bfe('0x13')];this[_0x8bfe('0x15')]=_0x1deab0['ringtime']||0x0;this[_0x8bfe('0x16')]=_0x1deab0['holdtime']||0x0;this[_0x8bfe('0x17')]=_0x1deab0[_0x8bfe('0x17')]||0x0;this[_0x8bfe('0x18')]=_0x1deab0['callback'];this['callbackuniqueid']=_0x1deab0[_0x8bfe('0x19')];this['callbackat']=_0x1deab0['callbackat'];this[_0x8bfe('0x1a')]=_0x1deab0['recallme'];this[_0x8bfe('0x1b')]=_0x1deab0['ContactId'];this[_0x8bfe('0x1c')]=_0x1deab0[_0x8bfe('0x1c')];this[_0x8bfe('0x1d')]=_0x1deab0[_0x8bfe('0x1d')];this['VoiceQueueId']=_0x1deab0[_0x8bfe('0x1e')];this[_0x8bfe('0x1f')]=_0x1deab0['CampaignId'];this[_0x8bfe('0x20')]=_0x1deab0[_0x8bfe('0x20')]||'';this[_0x8bfe('0x21')]=_0x1deab0[_0x8bfe('0x21')]||'';}module[_0x8bfe('0x22')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index 3088538..6f04970 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 _0x10d2=['milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','endtime','format','holdtime','talktime','membername','IVR','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','moment'];(function(_0x51cb67,_0x377fc0){var _0x3063b5=function(_0x5ad44e){while(--_0x5ad44e){_0x51cb67['push'](_0x51cb67['shift']());}};_0x3063b5(++_0x377fc0);}(_0x10d2,0x1d7));var _0x210d=function(_0x810b62,_0x5e5413){_0x810b62=_0x810b62-0x0;var _0x58571a=_0x10d2[_0x810b62];return _0x58571a;};'use strict';var util=require(_0x210d('0x0'));var _=require('lodash');var moment=require(_0x210d('0x1'));function getSeconds(_0x3c0455,_0x29c4c2){var _0x1f2b58=moment(_0x3c0455)[_0x210d('0x2')](0x0);var _0x17f590=moment(_0x29c4c2)['milliseconds'](0x0);return _0x1f2b58[_0x210d('0x3')](_0x17f590,_0x210d('0x4'));}function Hangup(_0x50ca0b,_0x58aba4){this[_0x210d('0x5')]=0x4;this[_0x210d('0x6')]=_0x210d('0x7');this[_0x210d('0x8')]=_0x50ca0b[_0x210d('0x8')];this[_0x210d('0x9')]=_0x50ca0b[_0x210d('0x9')];this[_0x210d('0xa')]=_0x50ca0b['type']===_0x210d('0xb')?_0x210d('0xc'):_0x50ca0b[_0x210d('0x9')];this[_0x210d('0xd')]=_0x50ca0b[_0x210d('0xd')];this[_0x210d('0xe')]=_0x50ca0b[_0x210d('0xe')];this['countnoanswerretry']=_0x50ca0b['countnoanswerretry'];this['countglobal']=_0x50ca0b[_0x210d('0xd')]+_0x50ca0b[_0x210d('0xe')]+_0x50ca0b['countnoanswerretry']+_0x50ca0b['countnosuchnumberretry']+_0x50ca0b[_0x210d('0xf')]+_0x50ca0b[_0x210d('0x10')]+_0x50ca0b[_0x210d('0x11')]+_0x50ca0b[_0x210d('0x12')];this[_0x210d('0x13')]=_0x50ca0b[_0x210d('0x13')];this[_0x210d('0xf')]=_0x50ca0b[_0x210d('0xf')];this[_0x210d('0x10')]=_0x50ca0b[_0x210d('0x10')];this['countmachineretry']=_0x50ca0b[_0x210d('0x11')];this[_0x210d('0x12')]=_0x50ca0b[_0x210d('0x12')];this[_0x210d('0x14')]=_0x58aba4[_0x210d('0x14')];this[_0x210d('0x15')]=_0x50ca0b[_0x210d('0x16')];this[_0x210d('0x17')]=_0x50ca0b[_0x210d('0x18')];this[_0x210d('0x19')]=_0x50ca0b[_0x210d('0x19')];this[_0x210d('0x1a')]=_0x50ca0b[_0x210d('0x1a')];this[_0x210d('0x1b')]=moment()[_0x210d('0x1c')]('YYYY-MM-DD\x20HH:mm:ss');this['ringtime']=getSeconds(_0x50ca0b[_0x210d('0x1a')],_0x50ca0b[_0x210d('0x19')]);this[_0x210d('0x1d')]=0x0;this[_0x210d('0x1e')]=getSeconds(this['endtime'],_0x50ca0b[_0x210d('0x1a')]);this[_0x210d('0xc')]=_0x50ca0b[_0x210d('0xc')];this[_0x210d('0x1f')]=_0x210d('0x20');this['reason']=_0x58aba4['cause-txt'];this[_0x210d('0x21')]=_0x50ca0b[_0x210d('0x21')];this[_0x210d('0x22')]=_0x50ca0b[_0x210d('0x22')];this[_0x210d('0x23')]=_0x50ca0b[_0x210d('0x23')];this[_0x210d('0x24')]=_0x50ca0b[_0x210d('0x24')];this[_0x210d('0x25')]=_0x50ca0b[_0x210d('0x25')];this['ListId']=_0x50ca0b[_0x210d('0x26')];this['UserId']=_0x50ca0b[_0x210d('0x27')];this[_0x210d('0x28')]=_0x50ca0b['VoiceQueueId'];this['CampaignId']=_0x50ca0b[_0x210d('0x29')];}module[_0x210d('0x2a')]=Hangup; \ No newline at end of file +var _0x63d4=['starttime','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','holdtime','talktime','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','util','lodash','moment','milliseconds','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','uniqueid','calleridname','calleridnum','number'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x63d4,0xc3));var _0x463d=function(_0x1574b4,_0x2a15f5){_0x1574b4=_0x1574b4-0x0;var _0x1cb660=_0x63d4[_0x1574b4];return _0x1cb660;};'use strict';var util=require(_0x463d('0x0'));var _=require(_0x463d('0x1'));var moment=require(_0x463d('0x2'));function getSeconds(_0x6b09fb,_0x4e5e4f){var _0x22f192=moment(_0x6b09fb)['milliseconds'](0x0);var _0xc6dc8e=moment(_0x4e5e4f)[_0x463d('0x3')](0x0);return _0x22f192['diff'](_0xc6dc8e,_0x463d('0x4'));}function Hangup(_0x24fd2d,_0x1d1560){this[_0x463d('0x5')]=0x4;this[_0x463d('0x6')]=_0x463d('0x7');this['scheduledat']=_0x24fd2d[_0x463d('0x8')];this[_0x463d('0x9')]=_0x24fd2d[_0x463d('0x9')];this[_0x463d('0xa')]=_0x24fd2d[_0x463d('0x9')]==='outbound'?_0x463d('0xb'):_0x24fd2d[_0x463d('0x9')];this[_0x463d('0xc')]=_0x24fd2d[_0x463d('0xc')];this[_0x463d('0xd')]=_0x24fd2d[_0x463d('0xd')];this[_0x463d('0xe')]=_0x24fd2d[_0x463d('0xe')];this[_0x463d('0xf')]=_0x24fd2d['countbusyretry']+_0x24fd2d[_0x463d('0xd')]+_0x24fd2d['countnoanswerretry']+_0x24fd2d[_0x463d('0x10')]+_0x24fd2d[_0x463d('0x11')]+_0x24fd2d['countabandonedretry']+_0x24fd2d[_0x463d('0x12')]+_0x24fd2d[_0x463d('0x13')];this[_0x463d('0x10')]=_0x24fd2d[_0x463d('0x10')];this[_0x463d('0x11')]=_0x24fd2d[_0x463d('0x11')];this[_0x463d('0x14')]=_0x24fd2d[_0x463d('0x14')];this[_0x463d('0x12')]=_0x24fd2d[_0x463d('0x12')];this[_0x463d('0x13')]=_0x24fd2d[_0x463d('0x13')];this['uniqueid']=_0x1d1560[_0x463d('0x15')];this[_0x463d('0x16')]=_0x24fd2d['name'];this[_0x463d('0x17')]=_0x24fd2d[_0x463d('0x18')];this[_0x463d('0x19')]=_0x24fd2d[_0x463d('0x19')];this[_0x463d('0x1a')]=_0x24fd2d[_0x463d('0x1a')];this[_0x463d('0x1b')]=moment()['format'](_0x463d('0x1c'));this['ringtime']=getSeconds(_0x24fd2d['responsetime'],_0x24fd2d[_0x463d('0x19')]);this[_0x463d('0x1d')]=0x0;this[_0x463d('0x1e')]=getSeconds(this[_0x463d('0x1b')],_0x24fd2d['responsetime']);this['queue']=_0x24fd2d[_0x463d('0xb')];this[_0x463d('0x1f')]=_0x463d('0x20');this[_0x463d('0x21')]=_0x1d1560[_0x463d('0x22')];this[_0x463d('0x23')]=_0x24fd2d[_0x463d('0x23')];this[_0x463d('0x24')]=_0x24fd2d[_0x463d('0x24')];this['callbackat']=_0x24fd2d[_0x463d('0x25')];this[_0x463d('0x26')]=_0x24fd2d['recallme'];this[_0x463d('0x27')]=_0x24fd2d[_0x463d('0x27')];this[_0x463d('0x28')]=_0x24fd2d[_0x463d('0x28')];this[_0x463d('0x29')]=_0x24fd2d[_0x463d('0x29')];this['VoiceQueueId']=_0x24fd2d[_0x463d('0x2a')];this[_0x463d('0x2b')]=_0x24fd2d[_0x463d('0x2b')];}module['exports']=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index a4285cb..9af802e 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 _0x0084=['callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','name','number','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback'];(function(_0xe66cf2,_0x32ba5f){var _0x2d84e7=function(_0x58a7d8){while(--_0x58a7d8){_0xe66cf2['push'](_0xe66cf2['shift']());}};_0x2d84e7(++_0x32ba5f);}(_0x0084,0xa1));var _0x4008=function(_0x5b2865,_0x3b814b){_0x5b2865=_0x5b2865-0x0;var _0x3cb4c6=_0x0084[_0x5b2865];return _0x3cb4c6;};'use strict';var util=require(_0x4008('0x0'));var _=require(_0x4008('0x1'));var moment=require('moment');function getSeconds(_0x12e224,_0x374805){var _0x454a19=moment(_0x12e224)['milliseconds'](0x0);var _0x464c7d=moment(_0x374805)[_0x4008('0x2')](0x0);return _0x454a19[_0x4008('0x3')](_0x464c7d,_0x4008('0x4'));}function History(_0x57fd78){this['uniqueid']=_0x57fd78[_0x4008('0x5')];this[_0x4008('0x6')]=_0x57fd78['scheduledat']||undefined;this[_0x4008('0x7')]=_0x57fd78[_0x4008('0x7')];this[_0x4008('0x8')]=_0x57fd78[_0x4008('0x7')]==='outbound'?_0x4008('0x9'):_0x57fd78[_0x4008('0x7')];this[_0x4008('0xa')]=_0x57fd78[_0x4008('0xa')];this[_0x4008('0xb')]=_0x57fd78[_0x4008('0xb')];this['countnoanswerretry']=_0x57fd78[_0x4008('0xc')];this[_0x4008('0xd')]=_0x57fd78[_0x4008('0xa')]+_0x57fd78[_0x4008('0xb')]+_0x57fd78[_0x4008('0xc')]+_0x57fd78[_0x4008('0xe')]+_0x57fd78[_0x4008('0xf')]+_0x57fd78[_0x4008('0x10')]+_0x57fd78[_0x4008('0x11')]+_0x57fd78[_0x4008('0x12')];this['countnosuchnumberretry']=_0x57fd78[_0x4008('0xe')];this[_0x4008('0xf')]=_0x57fd78[_0x4008('0xf')];this[_0x4008('0x10')]=_0x57fd78[_0x4008('0x10')];this['countmachineretry']=_0x57fd78[_0x4008('0x11')];this['countagentrejectretry']=_0x57fd78[_0x4008('0x12')];this['queue']=_0x57fd78[_0x4008('0x9')];this[_0x4008('0x13')]=_0x57fd78[_0x4008('0x14')];this['calleridnum']=_0x57fd78[_0x4008('0x15')];this[_0x4008('0x16')]=_0x57fd78[_0x4008('0x16')];this[_0x4008('0x17')]=_0x57fd78[_0x4008('0x17')];this[_0x4008('0x18')]=_0x57fd78[_0x4008('0x17')];this[_0x4008('0x19')]=getSeconds(_0x57fd78[_0x4008('0x17')],_0x57fd78[_0x4008('0x16')]);this[_0x4008('0x1a')]=0x0;this[_0x4008('0x1b')]=0x0;this[_0x4008('0x1c')]=_0x57fd78[_0x4008('0x1c')];this['callbackuniqueid']=_0x57fd78[_0x4008('0x1d')];this[_0x4008('0x1e')]=_0x57fd78[_0x4008('0x1e')];this['recallme']=_0x57fd78['recallme'];this[_0x4008('0x1f')]=_0x57fd78[_0x4008('0x1f')];this[_0x4008('0x20')]=_0x57fd78[_0x4008('0x20')];this[_0x4008('0x21')]=_0x57fd78[_0x4008('0x21')];this['VoiceQueueId']=_0x57fd78[_0x4008('0x22')];this['CampaignId']=_0x57fd78[_0x4008('0x23')];this[_0x4008('0x24')]=_0x57fd78[_0x4008('0x24')]||'';this[_0x4008('0x25')]=_0x57fd78[_0x4008('0x25')]||'';}module['exports']=History; \ No newline at end of file +var _0x9594=['countcongestionretry','countnoanswerretry','countbusyretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','calleridname','calleridnum','number','starttime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','seconds','uniqueid','scheduledat','type','campaigntype','outbound'];(function(_0x17ce97,_0x42af59){var _0x2f5d7e=function(_0x2be025){while(--_0x2be025){_0x17ce97['push'](_0x17ce97['shift']());}};_0x2f5d7e(++_0x42af59);}(_0x9594,0x11e));var _0x4959=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x9594[_0x5b561d];return _0x431060;};'use strict';var util=require(_0x4959('0x0'));var _=require(_0x4959('0x1'));var moment=require(_0x4959('0x2'));function getSeconds(_0x897ed8,_0x51f910){var _0x8936e5=moment(_0x897ed8)[_0x4959('0x3')](0x0);var _0x337339=moment(_0x51f910)[_0x4959('0x3')](0x0);return _0x8936e5['diff'](_0x337339,_0x4959('0x4'));}function History(_0x5aec26){this[_0x4959('0x5')]=_0x5aec26['uniqueid'];this[_0x4959('0x6')]=_0x5aec26[_0x4959('0x6')]||undefined;this[_0x4959('0x7')]=_0x5aec26[_0x4959('0x7')];this[_0x4959('0x8')]=_0x5aec26[_0x4959('0x7')]===_0x4959('0x9')?'queue':_0x5aec26[_0x4959('0x7')];this['countbusyretry']=_0x5aec26['countbusyretry'];this[_0x4959('0xa')]=_0x5aec26[_0x4959('0xa')];this[_0x4959('0xb')]=_0x5aec26[_0x4959('0xb')];this['countglobal']=_0x5aec26[_0x4959('0xc')]+_0x5aec26['countcongestionretry']+_0x5aec26[_0x4959('0xb')]+_0x5aec26[_0x4959('0xd')]+_0x5aec26['countdropretry']+_0x5aec26[_0x4959('0xe')]+_0x5aec26[_0x4959('0xf')]+_0x5aec26[_0x4959('0x10')];this[_0x4959('0xd')]=_0x5aec26[_0x4959('0xd')];this[_0x4959('0x11')]=_0x5aec26[_0x4959('0x11')];this[_0x4959('0xe')]=_0x5aec26['countabandonedretry'];this[_0x4959('0xf')]=_0x5aec26['countmachineretry'];this['countagentrejectretry']=_0x5aec26[_0x4959('0x10')];this['queue']=_0x5aec26['queue'];this[_0x4959('0x12')]=_0x5aec26['name'];this[_0x4959('0x13')]=_0x5aec26[_0x4959('0x14')];this[_0x4959('0x15')]=_0x5aec26[_0x4959('0x15')];this['responsetime']=_0x5aec26['responsetime'];this['endtime']=_0x5aec26[_0x4959('0x16')];this[_0x4959('0x17')]=getSeconds(_0x5aec26[_0x4959('0x16')],_0x5aec26['starttime']);this[_0x4959('0x18')]=0x0;this[_0x4959('0x19')]=0x0;this[_0x4959('0x1a')]=_0x5aec26[_0x4959('0x1a')];this['callbackuniqueid']=_0x5aec26[_0x4959('0x1b')];this[_0x4959('0x1c')]=_0x5aec26['callbackat'];this['recallme']=_0x5aec26['recallme'];this[_0x4959('0x1d')]=_0x5aec26[_0x4959('0x1d')];this[_0x4959('0x1e')]=_0x5aec26[_0x4959('0x1e')];this[_0x4959('0x1f')]=_0x5aec26['UserId'];this[_0x4959('0x20')]=_0x5aec26['VoiceQueueId'];this[_0x4959('0x21')]=_0x5aec26[_0x4959('0x21')];this[_0x4959('0x22')]=_0x5aec26[_0x4959('0x22')]||'';this['originatecalleridname']=_0x5aec26[_0x4959('0x23')]||'';}module[_0x4959('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 eae4275..af83e69 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 _0x3ae9=['\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','Failure','INTERVAL_IS_EMPTY','timezones','TIMEZONE_UNKNOW','isArray','command','iftime\x20%s,%s','interval','content','indexOf','true','all','some','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','power','dialPowerLevel','booked','Queue','method\x20not\x20recognized','handleIvr','dialGlobalInterval','dialTimezone','checkIfTimeIntervals','[syncQueueSummary]','syncCampaigns','\x5cw{0,','pow','random','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','Contact','phone','contact\x20is\x20undefine','\x22agi://%s/square,%s\x22','NONE','dialQueueOptions','dialAgiAfterHangupAgent','getCaller','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','XMD-AMDAFTERGREETINGSILENCE','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','XMD-AMDBETWEENWORDSSILENCE','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','%s%s','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','trim','dialCutDigit','substring','from-sip','OriginateError','[originate][error]','originate\x20action\x20Error','syncOriginateResponse','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','[rescheduleContact][NoSuchNumber]','[rescheduleContact][Drop]','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','entity\x20is\x20undefine','evt\x20is\x20undefine','reason','outboundNoSuchCallsDay','NoSuchNumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','custom:agentnoanswer','noanswer','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[callProgressDetecting]','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMinThreshold','erlangAbandonmentRate','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','startMethodPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','getDataPredictive','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','floor','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','Queue:\x20','scheduledat','Agent','run','unlockContact','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','[Originate][HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','BLACKLIST','Blacklist','[Originate][historyBlacklist]','inBlackList','limitCalls','dialOrderByScheduledAt','AVAILABLE_CONTACTS_FINISHED','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','[getContactCampaign2]','available','dialLimitQueue','not_inuse','Contact.phone','tryOriginatePredictive','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','interval\x20=\x20','exports','bluebird','uuid','moment','ioredis','../preview/util/util','../../../config/environment/','../../../config/logger','predictive','predictiveCalls','syncQueueSummary','redis','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./final','./agentComplete','env','127.0.0.1','rrmemory','prototype','enqueue','tail','sequence','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','uniqueId','optionPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','bind','originateresponse','agentcomplete','syncAgentComplete','custom:queuesummary','hangup','syncHangup','varset','syncVarSet','queuemember','syncQueueMember','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','AGENTS_NOT_LOGGED','name','message','NOT_ACTIVE','\x20NOT\x20Active','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Interval','Intervals','[ifTime][Action]','Error','stringify','milliseconds','diff','seconds','emit','type','outbound','strategy','answered','loggedIn','sumDuration','talking','total','unmanaged','abandoned','waiting','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','erlangCalls','erlangBusyFactor','startPredictive','Trunk','callerid','md5','format','voice:queue:%s','voice_queue:save','isEmpty','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','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','---------------------------','predictiveIntervalTotalCalls','isUndefined','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\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','ivr','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','length','undefined','originated','[decremetOriginate]\x20object\x20originated\x20is\x20negative','RESCHEDULED_CONTACTS','[getContactDialer2][Empty]','sendMessageOneNotActive','pTalking','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20disactive','state','endtime','clearZombieChannels','[uniqueid]','[actions]','isNil','Action','status','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','resolve','countReScheduled','[countReScheduled]\x20','checkIsBlackList','then','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','[averageHandleTime]\x20','rescheduleContact','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','saveInDb','ContactId','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','isTrunkReachable','active','SIP/%s','reachable','uniqueid','variable','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','HangupInAMD','membername','AMD','buildObj','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','statedesc','Machine','countglobal','custom:amd','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','add','minutes','YYYY-MM-DD\x20HH:mm:ss','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','countdropretry','[rescheduleContact][Machine]','ivrAnswerCallsDay','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','[syncHangupIvr][createHistory]','cause-txt','Unknow','agent','agiafterat','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','[syncAgentComplete][createHistory]','droptime','responsetime','dialQueueTimeout','Drop','dropreason','TIMEOUT','dialQueueProject2','dialDropMaxRetry','dialDropRetryFrequency','starttime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','CALLEREXIT','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','syncNewExten','channel','actionid','roundrobin','locked','stateinterface','push','pick','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','[Catch][Preview][syncQueueStatusComplete]','finally','[unlock][syncQueueStatusComplete]','_rr','paused','[booked][RR]','contactAgent-idHopper:\x20','unlockRR','preview','[booked][RR][finaly]','Agent:\x20','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','checkIsTrunkReachable','TrunkBackup'];(function(_0x3b854f,_0x1d3232){var _0x12cf64=function(_0x166ffa){while(--_0x166ffa){_0x3b854f['push'](_0x3b854f['shift']());}};_0x12cf64(++_0x1d3232);}(_0x3ae9,0xdb));var _0x93ae=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x3ae9[_0x4c12ec];return _0x3ae42c;};'use strict';var util=require('util');var _=require('lodash');var BPromise=require(_0x93ae('0x0'));var uuid=require(_0x93ae('0x1'));var moment=require(_0x93ae('0x2'));var rr=require('rr');var md5=require('md5');var Redis=require(_0x93ae('0x3'));var ut=require(_0x93ae('0x4'));var config=require(_0x93ae('0x5'));var logger=require(_0x93ae('0x6'))('dialer');var loggerBooked=require(_0x93ae('0x6'))('booked');var loggerPredictive=require(_0x93ae('0x6'))(_0x93ae('0x7'));var loggerPredictiveCalls=require(_0x93ae('0x6'))(_0x93ae('0x8'));var loggerSyncQueueSummary=require(_0x93ae('0x6'))(_0x93ae('0x9'));var ami=require('../ami');config[_0x93ae('0xa')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x93ae('0xb'))(new Redis(config[_0x93ae('0xa')]));var cmHopper=require(_0x93ae('0xc'));var cmHopperHistory=require(_0x93ae('0xd'));var cmHopperBlack=require(_0x93ae('0xe'));var voiceQueueRt=require(_0x93ae('0xf'));var Action=require('./action');var History=require('./history');var Final=require(_0x93ae('0x10'));var AgentComplete=require(_0x93ae('0x11'));var QueueCallerAbandon=require('./queueCallerAbandon');var Hangup=require('./hangup');var ipAgi=process[_0x93ae('0x12')]['XCALLY_IP_AGI']||_0x93ae('0x13');var strategy={'rrmemory':_0x93ae('0x14'),'roundrobin':'roundrobin'};var Sequence=function(){};Sequence[_0x93ae('0x15')][_0x93ae('0x16')]=function(_0x3c38b9){this[_0x93ae('0x17')]=this[_0x93ae('0x17')]?this[_0x93ae('0x17')]['finally'](_0x3c38b9):_0x3c38b9();};function Dialer(_0x11a9ce,_0x282094){this[_0x93ae('0x18')]=new Sequence();this['preview']=_0x282094;this[_0x93ae('0x19')]=_0x11a9ce['voiceQueues'];this['campaigns']=_0x11a9ce[_0x93ae('0x1a')];this['agents']=_0x11a9ce[_0x93ae('0x1b')];this[_0x93ae('0x1c')]=_0x11a9ce['trunks'];this[_0x93ae('0x1d')]=config[_0x93ae('0x1d')]||0x2;this[_0x93ae('0x1e')]={};this[_0x93ae('0x1f')]={};this['contactsId']={};this[_0x93ae('0x20')]={};this[_0x93ae('0x21')]={};this['startPredictive']={};this[_0x93ae('0x22')]={};this[_0x93ae('0x23')]={};this[_0x93ae('0x24')]={};this[_0x93ae('0x25')]={};ami['on'](_0x93ae('0x26'),this[_0x93ae('0x27')][_0x93ae('0x28')](this));ami['on']('queuecallerabandon',this['syncQueueCallerAbandon'][_0x93ae('0x28')](this));ami['on'](_0x93ae('0x29'),this['syncOriginateResponse']['bind'](this));ami['on'](_0x93ae('0x2a'),this[_0x93ae('0x2b')][_0x93ae('0x28')](this));ami['on'](_0x93ae('0x2c'),this[_0x93ae('0x9')][_0x93ae('0x28')](this));ami['on'](_0x93ae('0x2d'),this[_0x93ae('0x2e')]['bind'](this));ami['on']('newexten',this['syncNewExten'][_0x93ae('0x28')](this));ami['on'](_0x93ae('0x2f'),this[_0x93ae('0x30')][_0x93ae('0x28')](this));ami['on'](_0x93ae('0x31'),this[_0x93ae('0x32')]['bind'](this));ami['on']('queuestatuscomplete',this[_0x93ae('0x33')][_0x93ae('0x28')](this));this[_0x93ae('0x34')]();this[_0x93ae('0x35')]();}function isNotNull(_0x485622){return _0x485622!==null&&!_['isUndefined'](_0x485622);}function checkIsLoggedIn(_0x554318,_0x19aaaa){return function(){if(_0x19aaaa<=0x0){_0x554318['message']=_0x93ae('0x36');throw _0x554318[_0x93ae('0x37')]+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0x4369c2){return _0x4369c2;}function checkIsActive(_0x1554cf,_0x11359d){return function(){if(!isActive(_0x11359d)){_0x1554cf[_0x93ae('0x38')]=_0x93ae('0x39');throw _0x1554cf[_0x93ae('0x37')]+_0x93ae('0x3a');}};}function checkInterval(_0x371c53){return function(){if(!isNotNull(_0x371c53['Interval'])){_0x371c53[_0x93ae('0x38')]=_0x93ae('0x3b');throw _0x371c53[_0x93ae('0x37')]+_0x93ae('0x3c');}if(!isNotNull(_0x371c53[_0x93ae('0x3d')][_0x93ae('0x3e')])){_0x371c53[_0x93ae('0x38')]=_0x93ae('0x3b');throw _0x371c53['name']+_0x93ae('0x3c');}if(!isNotNull(_['isEmpty'](_0x371c53[_0x93ae('0x3d')][_0x93ae('0x3e')]))){_0x371c53[_0x93ae('0x38')]=_0x93ae('0x3b');throw _0x371c53[_0x93ae('0x37')]+_0x93ae('0x3c');}};}function msgResponse(_0x47ed0b,_0x1b9777,_0x1453c0){return{'action':_0x47ed0b,'response':_0x1b9777,'message':_0x1453c0,'stack':_0x1453c0};}function myreject(_0x2aa4ae){return function(_0x4fab04){return _0x2aa4ae(msgResponse(_0x93ae('0x3f'),_0x93ae('0x40'),JSON[_0x93ae('0x41')](_0x4fab04)));};}function getSeconds(_0x4d4712,_0x588916){var _0x2e5b91=moment(_0x4d4712)[_0x93ae('0x42')](0x0);var _0x31e9b0=moment(_0x588916)[_0x93ae('0x42')](0x0);return _0x2e5b91[_0x93ae('0x43')](_0x31e9b0,_0x93ae('0x44'));}function emit(_0xc588e4,_0x4319ed,_0x174dca){io['to'](_0xc588e4)[_0x93ae('0x45')](_0x4319ed,_0x174dca);}function emitVoiceQueueSummary(_0x6ee0de){if(_0x6ee0de[_0x93ae('0x46')]===_0x93ae('0x47')){var _0x3fdf77={'id':_0x6ee0de['id'],'name':_0x6ee0de['name'],'strategy':_0x6ee0de[_0x93ae('0x48')],'answered':_0x6ee0de[_0x93ae('0x49')],'available':_0x6ee0de['available'],'loggedIn':_0x6ee0de[_0x93ae('0x4a')],'pTalking':_0x6ee0de['pTalking'],'sumBillable':_0x6ee0de['sumBillable'],'sumDuration':_0x6ee0de[_0x93ae('0x4b')],'sumHoldTime':_0x6ee0de['sumHoldTime']||0x0,'talking':_0x6ee0de[_0x93ae('0x4c')],'total':_0x6ee0de[_0x93ae('0x4d')],'type':_0x6ee0de[_0x93ae('0x46')],'unmanaged':_0x6ee0de[_0x93ae('0x4e')],'abandoned':_0x6ee0de[_0x93ae('0x4f')],'waiting':_0x6ee0de[_0x93ae('0x50')],'loggedInDb':_0x6ee0de['loggedInDb'],'dialActive':_0x6ee0de[_0x93ae('0x51')],'dialMethod':_0x6ee0de[_0x93ae('0x52')],'dialOriginateCallerIdName':_0x6ee0de[_0x93ae('0x53')],'dialOriginateCallerIdNumber':_0x6ee0de[_0x93ae('0x54')],'dialOriginateTimeout':_0x6ee0de[_0x93ae('0x55')],'dialPrefix':_0x6ee0de[_0x93ae('0x56')],'outboundAnswerAgiCallsDay':_0x6ee0de[_0x93ae('0x57')],'outboundAnswerCallsDay':_0x6ee0de[_0x93ae('0x58')],'outboundBlacklistCallsDay':_0x6ee0de[_0x93ae('0x59')],'outboundBusyCallsDay':_0x6ee0de[_0x93ae('0x5a')],'outboundCongestionCallsDay':_0x6ee0de[_0x93ae('0x5b')],'outboundDropCallsDayACS':_0x6ee0de['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x6ee0de[_0x93ae('0x5c')],'outboundDropCallsDayTimeout':_0x6ee0de[_0x93ae('0x5d')],'outboundNoAnswerCallsDay':_0x6ee0de['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x6ee0de['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x6ee0de[_0x93ae('0x5e')],'outboundReCallsDay':_0x6ee0de[_0x93ae('0x5f')],'outboundRejectCallsDay':_0x6ee0de[_0x93ae('0x60')],'outboundUnknownCallsDay':_0x6ee0de[_0x93ae('0x61')],'predictiveIntervalAnsweredCalls':_0x6ee0de[_0x93ae('0x62')],'predictiveIntervalAvgHoldtime':_0x6ee0de[_0x93ae('0x63')],'predictiveIntervalAvgTalktime':_0x6ee0de[_0x93ae('0x64')],'predictiveIntervalDroppedCallsCallersExit':_0x6ee0de[_0x93ae('0x65')],'predictiveIntervalDroppedCallsTimeout':_0x6ee0de['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x6ee0de[_0x93ae('0x66')],'predictiveIntervalErlangCallsDroppedCalls':_0x6ee0de[_0x93ae('0x67')],'predictiveIntervalHitRate':_0x6ee0de[_0x93ae('0x68')],'predictiveIntervalMultiplicativeFactor':_0x6ee0de[_0x93ae('0x69')],'predictiveIntervalPauses':_0x6ee0de[_0x93ae('0x6a')],'predictiveIntervalAvailable':_0x6ee0de['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x6ee0de['predictiveIntervalTotalCalls'],'message':_0x6ee0de[_0x93ae('0x38')],'originated':_0x6ee0de['originated'],'erlangCalls':_0x6ee0de[_0x93ae('0x6b')],'erlangCallToSecond':_0x6ee0de['erlangCallToSecond'],'erlangAbandonmentRate':_0x6ee0de['erlangAbandonmentRate'],'erlangBusyFactor':_0x6ee0de[_0x93ae('0x6c')],'startPredictive':_0x6ee0de[_0x93ae('0x6d')],'startProgressive':_0x6ee0de[_0x93ae('0x22')]};if(_0x6ee0de[_0x93ae('0x6e')]){_0x3fdf77[_0x93ae('0x6e')]={'id':_0x6ee0de[_0x93ae('0x6e')]['id'],'name':_0x6ee0de[_0x93ae('0x6e')]['name'],'active':_0x6ee0de[_0x93ae('0x6e')]['active'],'callerid':_0x6ee0de['Trunk'][_0x93ae('0x6f')]};}if(_0x6ee0de[_0x93ae('0x3d')]){_0x3fdf77[_0x93ae('0x3d')]={'id':_0x6ee0de[_0x93ae('0x3d')]['id'],'name':_0x6ee0de['Interval'][_0x93ae('0x37')]};}var _0x4e7652=md5(JSON[_0x93ae('0x41')](_0x3fdf77));if(_0x6ee0de[_0x93ae('0x70')]!==_0x4e7652){_0x6ee0de[_0x93ae('0x70')]=_0x4e7652;emit(util[_0x93ae('0x71')](_0x93ae('0x72'),_0x3fdf77[_0x93ae('0x37')]),_0x93ae('0x73'),_0x3fdf77);}}}function emitCampaignSummary(_0x411ec6){if(_0x411ec6[_0x93ae('0x46')]==='ivr'){emit(util['format']('campaign:ivr:%s',_0x411ec6['name']),'campaign:save',_0x411ec6);}}function checkGetDataPredictive(_0x2a837b){if(isNotNull(_0x2a837b)&&!_[_0x93ae('0x74')](_0x2a837b)){loggerPredictive[_0x93ae('0x75')](_0x93ae('0x76'));loggerPredictive['info'](_0x93ae('0x77'),_0x2a837b['predictiveIntervalTotalCalls']);loggerPredictive[_0x93ae('0x75')](_0x93ae('0x78'),_0x2a837b[_0x93ae('0x62')]);loggerPredictive[_0x93ae('0x75')](_0x93ae('0x79'),_0x2a837b[_0x93ae('0x7a')]);loggerPredictive[_0x93ae('0x75')](_0x93ae('0x7b'),_0x2a837b[_0x93ae('0x65')]);loggerPredictive['info'](_0x93ae('0x7c'),_0x2a837b['predictiveIntervalAvgHoldtime']);loggerPredictive[_0x93ae('0x75')](_0x93ae('0x7d'),_0x2a837b[_0x93ae('0x64')]);loggerPredictive[_0x93ae('0x75')](_0x93ae('0x7e'));if(_0x2a837b[_0x93ae('0x7f')]>0x0){if(!_[_0x93ae('0x80')](_0x2a837b['predictiveIntervalAvgTalktime'])&&_0x2a837b[_0x93ae('0x64')]>0x0){return!![];}loggerPredictive['info']('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_[_0x93ae('0x80')](_0x2a837b[_0x93ae('0x63')])&&_0x2a837b['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive[_0x93ae('0x75')](_0x93ae('0x81'));}else{loggerPredictive[_0x93ae('0x75')](_0x93ae('0x82'));}}else{loggerPredictive[_0x93ae('0x75')](_0x93ae('0x83'));}return![];}function mergeDataErlangB(_0x450ec8){return function(_0x2f3e1d){loggerPredictive[_0x93ae('0x75')](_0x93ae('0x84'));loggerPredictive[_0x93ae('0x75')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2f3e1d[_0x93ae('0x6b')]);loggerPredictive[_0x93ae('0x75')](_0x93ae('0x85'),_0x2f3e1d[_0x93ae('0x86')]);loggerPredictive[_0x93ae('0x75')](_0x93ae('0x87'),_0x2f3e1d['erlangAbandonmentRate']);loggerPredictive[_0x93ae('0x75')](_0x93ae('0x88'),_0x2f3e1d[_0x93ae('0x6c')]);loggerPredictive[_0x93ae('0x75')](_0x93ae('0x87'),_0x2f3e1d['erlangAbandonmentRate']);loggerPredictive[_0x93ae('0x75')](_0x93ae('0x7e'));_[_0x93ae('0x89')](_0x450ec8,_0x2f3e1d);};}function getDiff(_0x492d93){var _0x930065=moment()[_0x93ae('0x42')](0x0);var _0x5605ca=moment(_0x492d93)[_0x93ae('0x42')](0x0);return _0x930065[_0x93ae('0x43')](_0x5605ca,_0x93ae('0x44'));}function ifInterval(_0x120e65,_0xb38655){if(_[_0x93ae('0x80')](_0xb38655)){return![];}return getDiff(_0xb38655)<_0x120e65*0x3c;}function freeVariablesPredictive(_0x339459){if(isNotNull(_0x339459)){if(!_['isUndefined'](_0x339459[_0x93ae('0x22')])){_0x339459['startProgressive']=undefined;loggerPredictive['info'](_0x339459[_0x93ae('0x37')],_0x93ae('0x8a'));}if(!_['isUndefined'](_0x339459[_0x93ae('0x6d')])){_0x339459[_0x93ae('0x6d')]=undefined;loggerPredictive[_0x93ae('0x75')](_0x339459[_0x93ae('0x37')],_0x93ae('0x8b'));}if(!_[_0x93ae('0x80')](_0x339459[_0x93ae('0x8c')])){clearInterval(_0x339459[_0x93ae('0x8c')]);_0x339459[_0x93ae('0x8c')]=undefined;loggerPredictive['info'](_0x339459['name'],_0x93ae('0x8d'));}}}function erlangb(_0xb656c9,_0xc622ff){if(_0xc622ff===0x0){return 0x0;}var _0x40a4b5=0x1;for(var _0xfe944d=0x1;_0xfe944d<=_0xc622ff;_0xfe944d+=0x1){_0x40a4b5=0x1+_0x40a4b5*_0xfe944d/_0xb656c9;}return 0x1/_0x40a4b5;}function isVoiceQueueOutbound(_0x20f2af){return _0x20f2af===_0x93ae('0x47');}function isNotPreview(_0x591020){return _0x591020!=='preview';}function isCampaignIvr(_0x12dd3c){return _0x12dd3c===_0x93ae('0x8e');}function getCallerId(_0x71867b,_0x3dd412,_0x45b6bb){if(!_[_0x93ae('0x80')](_0x45b6bb)&&typeof _0x45b6bb===_0x93ae('0x8f')&&!_[_0x93ae('0x74')](_0x45b6bb)){if(!_[_0x93ae('0x80')](_0x3dd412)&&typeof _0x3dd412==='string'&&!_[_0x93ae('0x74')](_0x3dd412)){return util['format']('\x22%s\x22\x20<%s>',_0x3dd412,_0x45b6bb);}return util[_0x93ae('0x71')](_0x93ae('0x90'),_0x45b6bb,_0x45b6bb);}if(!_[_0x93ae('0x80')](_0x71867b)&&typeof _0x71867b===_0x93ae('0x8f')&&!_[_0x93ae('0x74')](_0x71867b)){return _0x71867b;}return _0x93ae('0x91');}function loggerCatchQueueSummary(_0x1885fe,_0x44e861){return function(_0x1e0f7a){freeVariablesPredictive(_0x44e861);emitVoiceQueueSummary(_0x44e861);emitCampaignSummary(_0x44e861);loggerSyncQueueSummary[_0x93ae('0x92')](_0x1885fe,util[_0x93ae('0x93')](_0x1e0f7a,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x24e2d8,_0x540324){return function(_0x5b5b5a){loggerPredictive[_0x93ae('0x92')](_0x540324[_0x93ae('0x37')],_0x24e2d8);loggerPredictive[_0x93ae('0x92')](_0x5b5b5a['stack']);freeVariablesPredictive(_0x540324);};}function loggerCatch(_0x57fcc8){return function(_0x21cff4){logger[_0x93ae('0x92')](_0x57fcc8,util['inspect'](_0x21cff4,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x13055a){return _0x13055a&&!_[_0x93ae('0x80')](_0x13055a)&&_0x13055a[_0x93ae('0x94')]>0x0;}function decremetOriginate(_0x2ab139){if(!_[_0x93ae('0x80')](_0x2ab139)&&_0x2ab139!==null){if(typeof _0x2ab139['originated']!==_0x93ae('0x95')){if(_0x2ab139[_0x93ae('0x96')]>0x0){_0x2ab139[_0x93ae('0x96')]-=0x1;}else{logger['error'](_0x93ae('0x97'));}}}else{logger[_0x93ae('0x92')]('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x2ba026,_0x239921,_0x2ccb2b){if(_0x239921>_0x2ccb2b){for(var _0x974aea=0x0;_0x974aea<_0x239921-_0x2ccb2b;_0x974aea+=0x1){decremetOriginate(_0x2ba026);}}}function loggerGetContactDialer(_0x563fe6,_0x26fd6e,_0x4d3bdf){return function(_0x2d68f4){checkContactLowerLimitOriginate(_0x26fd6e,_0x4d3bdf,0x0);logger[_0x93ae('0x92')](_0x563fe6,util['inspect'](_0x2d68f4,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0xc344b8){return function(_0x23a3fe){if(isNotNull(_0x23a3fe)&&isNotNull(_0x23a3fe[0x0])){if(_0x23a3fe[0x0]['contactsRescheduled']>0x0){_0xc344b8[_0x93ae('0x38')]=_0x93ae('0x98');logger[_0x93ae('0x75')]('[getContactDialer2][ReScheduled]'+_0xc344b8[_0x93ae('0x37')],_0x23a3fe[0x0]['contactsRescheduled'],'contacts');}else{_0xc344b8[_0x93ae('0x38')]='AVAILABLE_CONTACTS_FINISHED';logger[_0x93ae('0x75')](_0x93ae('0x99')+_0xc344b8[_0x93ae('0x37')]);}}};}function notSendMessagesQueue(_0x18bed6){if(_0x18bed6[_0x93ae('0x9a')]){freeVariablesPredictive(_0x18bed6);if(_0x18bed6[_0x93ae('0x96')]===0x0&&_0x18bed6[_0x93ae('0x4c')]===0x0&&_0x18bed6[_0x93ae('0x50')]===0x0&&(_0x18bed6[_0x93ae('0x9b')]||0x0)===0x0){_0x18bed6[_0x93ae('0x9a')]=![];_0x18bed6['available']=0x0;_0x18bed6['message']=_0x93ae('0x39');loggerSyncQueueSummary[_0x93ae('0x92')](_0x93ae('0x9c'),_0x18bed6[_0x93ae('0x37')],_0x93ae('0x9d'));}else{_0x18bed6['message']=_0x93ae('0x9e');loggerSyncQueueSummary[_0x93ae('0x92')](_0x93ae('0x9c'),_0x18bed6[_0x93ae('0x37')],'is\x20disactive');}emitVoiceQueueSummary(_0x18bed6);}}function notSendMessagesCampaign(_0x505e8f){if(_0x505e8f['sendMessageOneNotActive']){if(_0x505e8f[_0x93ae('0x96')]===0x0){_0x505e8f['sendMessageOneNotActive']=![];_0x505e8f[_0x93ae('0x38')]=_0x93ae('0x39');loggerSyncQueueSummary['error'](_0x93ae('0x9f'),_0x505e8f[_0x93ae('0x37')],_0x93ae('0x9d'));}else{_0x505e8f[_0x93ae('0x38')]=_0x93ae('0x9e');loggerSyncQueueSummary[_0x93ae('0x92')](_0x93ae('0x9f'),_0x505e8f[_0x93ae('0x37')],_0x93ae('0xa0'));}emitCampaignSummary(_0x505e8f);}}function createObjHistory(_0x149814,_0xc1d90e,_0x3bfa80,_0x47eaf7,_0xc486eb){_0x149814[_0x93ae('0x38')]=_0x3bfa80;var _0x1f93b5=new Action(_0x149814,_0xc1d90e);var _0x91efd7=new History(_0x1f93b5);_0x91efd7[_0x93ae('0xa1')]=_0x47eaf7;_0x91efd7['statedesc']=_0xc486eb;_0x91efd7[_0x93ae('0xa2')]=_0x1f93b5['starttime'];return _0x91efd7;}Dialer[_0x93ae('0x15')][_0x93ae('0x35')]=function(){var _0x2445b6=this;setInterval(function(){_0x2445b6[_0x93ae('0xa3')](_0x2445b6['uniqueId'],_0x93ae('0xa4'));_0x2445b6['clearZombieChannels'](_0x2445b6[_0x93ae('0x1f')],_0x93ae('0xa5'));},0x32c8);};Dialer[_0x93ae('0x15')][_0x93ae('0xa3')]=function(_0x1c2429,_0x15d85a){var _0x4abe7b=this;for(var _0x238d88 in _0x1c2429){if(typeof _0x1c2429[_0x238d88]!==_0x93ae('0x95')){this[_0x93ae('0x18')]['enqueue'](function(){if(!_[_0x93ae('0xa6')](_0x1c2429[_0x238d88])){return ami[_0x93ae('0xa7')]({'action':_0x93ae('0xa8'),'channel':_0x1c2429[_0x238d88]['channel']})[_0x93ae('0xa9')](function(_0x5d59b0){if(_0x5d59b0[_0x93ae('0x38')]===_0x93ae('0xaa')){setTimeout(function(){if(_0x1c2429[_0x238d88]&&_0x1c2429[_0x238d88]['type']!==_0x93ae('0x8e')){_0x4abe7b[_0x93ae('0xab')](_0x4abe7b[_0x93ae('0x19')][_0x1c2429[_0x238d88][_0x93ae('0xac')]]);logger['error'](_0x93ae('0xad'),_0x15d85a,_0x238d88,_0x1c2429[_0x238d88][_0x93ae('0xac')]);delete _0x1c2429[_0x238d88];}if(_0x1c2429[_0x238d88]&&_0x1c2429[_0x238d88][_0x93ae('0x46')]==='ivr'){_0x4abe7b[_0x93ae('0xab')](_0x4abe7b[_0x93ae('0x1a')][_0x1c2429[_0x238d88][_0x93ae('0xac')]]);logger[_0x93ae('0x92')](_0x93ae('0xae'),_0x15d85a,_0x238d88,_0x1c2429[_0x238d88][_0x93ae('0xac')]);delete _0x1c2429[_0x238d88];}},0x2328);}});}});}}};Dialer[_0x93ae('0x15')]['countReScheduled']=function(_0x20827f){return BPromise[_0x93ae('0xaf')]()['then'](cmHopper[_0x93ae('0xb0')](_0x20827f))[_0x93ae('0xa9')](loggerCatch(_0x93ae('0xb1')));};Dialer['prototype'][_0x93ae('0xb2')]=function(_0x54728b){return BPromise[_0x93ae('0xaf')]()[_0x93ae('0xb3')](cmHopperBlack[_0x93ae('0xb2')](_0x54728b))[_0x93ae('0xa9')](loggerCatch(_0x93ae('0xb4')));};Dialer['prototype']['checkIsBlackListIvr']=function(_0x17de69){return BPromise[_0x93ae('0xaf')]()[_0x93ae('0xb3')](cmHopperBlack[_0x93ae('0xb5')](_0x17de69))['catch'](loggerCatch(_0x93ae('0xb6')));};Dialer[_0x93ae('0x15')][_0x93ae('0xb7')]=function(_0x51af24){return BPromise['resolve']()['then'](cmHopperHistory['avgHandleTime'](_0x51af24))[_0x93ae('0xa9')](loggerCatch(_0x93ae('0xb8')));};Dialer[_0x93ae('0x15')]['rescheduleContact']=function(_0x43d8d2){return BPromise['resolve']()[_0x93ae('0xb3')](cmHopper[_0x93ae('0xb9')](_0x43d8d2))[_0x93ae('0xa9')](loggerCatch('[rescheduleContact]\x20'));};Dialer['prototype']['unlockContact']=function(_0x4ae222,_0x6e3646,_0x487ff0){return BPromise['resolve']()[_0x93ae('0xb3')](cmHopper['unlockContact'](_0x4ae222,_0x6e3646,_0x487ff0))[_0x93ae('0xa9')](loggerCatch('[unlockContact]\x20'));};Dialer[_0x93ae('0x15')][_0x93ae('0xba')]=function(_0x3c99f2,_0x42d0a5,_0x48dc1d,_0x2467d3,_0x14545c){return BPromise[_0x93ae('0xaf')]()['then'](cmHopper['getContactDialer'](_0x3c99f2,_0x42d0a5,_0x48dc1d,_0x2467d3))['catch'](function(_0x1eb18e){_0x14545c['temp']-=_0x48dc1d;_0x14545c[_0x93ae('0xbb')]=_0x14545c[_0x93ae('0xbb')]>0x0?_0x14545c[_0x93ae('0xbb')]:0x0;loggerCatch(_0x93ae('0xbc'))(_0x1eb18e);});};Dialer[_0x93ae('0x15')][_0x93ae('0xbd')]=function(_0x257bcf,_0x30d7cb,_0x1f0db0,_0x2b825e){return BPromise[_0x93ae('0xaf')]()[_0x93ae('0xb3')](cmHopper[_0x93ae('0xbd')](_0x257bcf,_0x30d7cb,_0x1f0db0))[_0x93ae('0xa9')](function(_0x4a66c8){_0x2b825e[_0x93ae('0xbb')]-=_0x30d7cb;_0x2b825e['temp']=_0x2b825e['temp']>0x0?_0x2b825e[_0x93ae('0xbb')]:0x0;loggerCatch(_0x93ae('0xbe'))(_0x4a66c8);});};Dialer[_0x93ae('0x15')][_0x93ae('0xbf')]=function(_0x111694){return BPromise[_0x93ae('0xaf')]()[_0x93ae('0xb3')](voiceQueueRt[_0x93ae('0xbf')](_0x111694))[_0x93ae('0xa9')](loggerCatch(_0x93ae('0xc0')));};Dialer['prototype'][_0x93ae('0xc1')]=function(_0x1683fe){return BPromise[_0x93ae('0xaf')]()[_0x93ae('0xb3')](cmHopper[_0x93ae('0xc1')](_0x1683fe))[_0x93ae('0xa9')](loggerCatch(_0x93ae('0xc2')));};Dialer[_0x93ae('0x15')][_0x93ae('0xc3')]=function(_0x4c68c9){return BPromise['resolve']()[_0x93ae('0xb3')](cmHopperHistory['createHistory'](_0x4c68c9))['catch'](loggerCatch(_0x93ae('0xc4')));};Dialer[_0x93ae('0x15')][_0x93ae('0xab')]=function(_0xf0f1af){if(!_[_0x93ae('0x80')](_0xf0f1af)&&_0xf0f1af!==null){if(typeof _0xf0f1af['originated']!==_0x93ae('0x95')){if(_0xf0f1af[_0x93ae('0x96')]>0x0){_0xf0f1af['originated']-=0x1;}else{logger[_0x93ae('0x92')](_0x93ae('0xc5'));}}}else{logger[_0x93ae('0x92')](_0x93ae('0xc6'));}};Dialer[_0x93ae('0x15')][_0x93ae('0xc7')]=function(_0x129443,_0x5502ae){var _0x5392c1=this;return function(_0x3b85a4){_0x5392c1[_0x93ae('0xab')](_0x5502ae);logger[_0x93ae('0x92')](_0x129443,util[_0x93ae('0x93')](_0x3b85a4,{'showHidden':![],'depth':null}));};};Dialer[_0x93ae('0x15')][_0x93ae('0xc8')]=function(_0x46fdb2,_0x2f6279,_0x444318){var _0x187353={'state':0x19,'statedesc':_0x93ae('0xc9')};this[_0x93ae('0xab')](_0x2f6279);this[_0x93ae('0xca')](_[_0x93ae('0x89')](_0x187353,_['pick'](_0x444318,[_0x93ae('0xcb'),_0x93ae('0xcc'),_0x93ae('0xcd'),_0x93ae('0xce'),_0x93ae('0xcf')])),_0x93ae('0xd0'),_0x93ae('0xd1'));logger['error'](_0x46fdb2);};Dialer['prototype'][_0x93ae('0xd2')]=function(_0x21e113){return _0x21e113===_0x93ae('0xd3');};Dialer[_0x93ae('0x15')][_0x93ae('0xd4')]=function(_0x1aeb35){return!_['isUndefined'](_0x1aeb35)&&_0x1aeb35&&!_['isUndefined'](_0x1aeb35['name'])&&!_[_0x93ae('0x80')](_0x1aeb35[_0x93ae('0xd5')])&&_0x1aeb35[_0x93ae('0xd5')]&&(this[_0x93ae('0x1c')][util['format'](_0x93ae('0xd6'),_0x1aeb35['name'])]['status']===_0x93ae('0xd7')||this[_0x93ae('0x1c')][util[_0x93ae('0x71')]('SIP/%s',_0x1aeb35['name'])][_0x93ae('0xa8')]==='unmonitored');};Dialer[_0x93ae('0x15')][_0x93ae('0xca')]=function(_0xebc7ea,_0x19cc71,_0x39da90){this[_0x93ae('0xc3')](_0xebc7ea)['catch'](loggerCatch(_0x19cc71));this[_0x93ae('0xc1')](_0xebc7ea)[_0x93ae('0xa9')](loggerCatch(_0x39da90));};Dialer[_0x93ae('0x15')][_0x93ae('0x30')]=function(_0x20f753){var _0xd28ba8=this[_0x93ae('0x20')][_0x20f753[_0x93ae('0xd8')]];var _0x57cbb3;if(!_['isNil'](_0x20f753)&&!_[_0x93ae('0xa6')](_0x20f753[_0x93ae('0xd9')])&&!_[_0x93ae('0xa6')](_0x20f753[_0x93ae('0xd9')]['amdstatus'])&&_0x20f753[_0x93ae('0xda')]===_0x93ae('0xdb')&&_0xd28ba8){if(_0xd28ba8['type']!==_0x93ae('0x8e')&&this[_0x93ae('0x19')][_0xd28ba8[_0x93ae('0xac')]][_0x93ae('0xdc')]&&_0x20f753[_0x93ae('0xdd')]===_0x93ae('0xde')){delete this[_0x93ae('0x20')][_0x20f753[_0x93ae('0xd8')]];this[_0x93ae('0xab')](this[_0x93ae('0x19')][_0xd28ba8[_0x93ae('0xac')]]);this[_0x93ae('0x19')][_0xd28ba8[_0x93ae('0xac')]][_0x93ae('0x58')]+=0x1;this[_0x93ae('0x19')][_0xd28ba8['queue']][_0x93ae('0x57')]+=0x1;_0x57cbb3=new Hangup(_0xd28ba8,_0x20f753);_0x57cbb3['state']=0x12;_0x57cbb3['statedesc']=_0x93ae('0xdf');_0x57cbb3[_0x93ae('0xe0')]=_0x93ae('0xe1');ami[_0x93ae('0x45')]('custom:amd',ut[_0x93ae('0xe2')](_0x57cbb3,_0x93ae('0xe3')));this[_0x93ae('0xca')](_0x57cbb3,_0x93ae('0xe4'),_0x93ae('0xe5'));}if(_0xd28ba8[_0x93ae('0x46')]!==_0x93ae('0x8e')&&this[_0x93ae('0x19')][_0xd28ba8[_0x93ae('0xac')]][_0x93ae('0xdc')]&&_0x20f753[_0x93ae('0xdd')]===_0x93ae('0xe6')){var _0xc5a12=this;return new BPromise(function(_0x129dab,_0x678df5){delete _0xc5a12[_0x93ae('0x20')][_0x20f753[_0x93ae('0xd8')]];_0xc5a12[_0x93ae('0xab')](_0xc5a12['voiceQueues'][_0xd28ba8[_0x93ae('0xac')]]);_0xc5a12['voiceQueues'][_0xd28ba8[_0x93ae('0xac')]][_0x93ae('0x58')]+=0x1;_0xc5a12[_0x93ae('0x19')][_0xd28ba8[_0x93ae('0xac')]][_0x93ae('0x57')]+=0x1;var _0x2058e2=_0xc5a12[_0x93ae('0x19')][_0xd28ba8[_0x93ae('0xac')]];var _0x50ecc0=new Hangup(_0xd28ba8,_0x20f753);_0x50ecc0[_0x93ae('0xa1')]=0x13;_0x50ecc0[_0x93ae('0xe7')]=_0x93ae('0xe8');_0x50ecc0[_0x93ae('0xe0')]=_0x93ae('0xe1');_0x50ecc0['countmachineretry']+=0x1;_0x50ecc0[_0x93ae('0xe9')]+=0x1;_0x50ecc0[_0x93ae('0xe3')]=!![];ami['emit'](_0x93ae('0xea'),ut[_0x93ae('0xe2')](_0x50ecc0,_0x93ae('0xe3')));_0xc5a12[_0x93ae('0xc3')](_0x50ecc0)[_0x93ae('0xa9')](loggerCatch(_0x93ae('0xeb')));if(_0x50ecc0[_0x93ae('0xec')]+_0x50ecc0[_0x93ae('0xed')]+_0x50ecc0[_0x93ae('0xee')]+_0x50ecc0[_0x93ae('0xef')]+_0x50ecc0['countdropretry']+_0x50ecc0[_0x93ae('0xf0')]+_0x50ecc0[_0x93ae('0xf1')]+_0x50ecc0[_0x93ae('0xf2')]>=_0x2058e2[_0x93ae('0xf3')]){_0xc5a12[_0x93ae('0xf4')](_0x50ecc0,_0x129dab,_0x678df5,_0x93ae('0xf5'));}else{if(_0x50ecc0[_0x93ae('0xf1')]>=_0x2058e2[_0x93ae('0xf6')]){_0xc5a12[_0x93ae('0xf7')](_0x50ecc0,_0x129dab,_0x678df5,'reason\x2019\x20machine....');}else{_0xc5a12['rescheduleContact']({'active':![],'countmachineretry':_0x50ecc0[_0x93ae('0xf1')],'scheduledat':moment()[_0x93ae('0xf8')](_0x2058e2['dialMachineRetryFrequency'],_0x93ae('0xf9'))['format'](_0x93ae('0xfa')),'ContactId':_0x50ecc0[_0x93ae('0xcb')],'ListId':_0x50ecc0[_0x93ae('0xcc')],'VoiceQueueId':_0x50ecc0[_0x93ae('0xce')]||undefined,'CampaignId':_0x50ecc0['CampaignId']||undefined})[_0x93ae('0xa9')](loggerCatch('[rescheduleContact][Machine]'));_0x129dab({'reschedule':0x1});}}});}if(_0xd28ba8[_0x93ae('0x46')]===_0x93ae('0x8e')&&this[_0x93ae('0x1a')][_0xd28ba8[_0x93ae('0xac')]][_0x93ae('0xdc')]&&_0x20f753[_0x93ae('0xdd')]===_0x93ae('0xde')){delete this['uniqueId'][_0x20f753['uniqueid']];this['updateOriginated'](this['campaigns'][_0xd28ba8[_0x93ae('0xac')]]);_0x57cbb3=new Hangup(_0xd28ba8,_0x20f753);_0x57cbb3[_0x93ae('0xa1')]=0x12;_0x57cbb3['statedesc']='HangupInAMD';_0x57cbb3['membername']=_0x93ae('0xe1');ami[_0x93ae('0x45')]('custom:amd',ut[_0x93ae('0xe2')](_0x57cbb3,_0x93ae('0xe3')));this[_0x93ae('0xca')](_0x57cbb3,_0x93ae('0xfb'),_0x93ae('0xfc'));}if(_0xd28ba8['type']===_0x93ae('0x8e')&&this[_0x93ae('0x1a')][_0xd28ba8[_0x93ae('0xac')]][_0x93ae('0xdc')]&&_0x20f753[_0x93ae('0xdd')]==='MACHINE'){var _0xc5a12=this;return new BPromise(function(_0x17081f,_0x104a93){delete _0xc5a12[_0x93ae('0x20')][_0x20f753['uniqueid']];_0xc5a12[_0x93ae('0xab')](_0xc5a12['campaigns'][_0xd28ba8[_0x93ae('0xac')]]);_0xc5a12[_0x93ae('0x1a')][_0xd28ba8[_0x93ae('0xac')]]['outboundAnswerCallsDay']+=0x1;_0xc5a12[_0x93ae('0x1a')][_0xd28ba8['queue']][_0x93ae('0x57')]+=0x1;var _0x384d73=_0xc5a12['campaigns'][_0xd28ba8['queue']];var _0x5da0fc=new Hangup(_0xd28ba8,_0x20f753);_0x5da0fc[_0x93ae('0xa1')]=0x13;_0x5da0fc[_0x93ae('0xe7')]=_0x93ae('0xe8');_0x5da0fc[_0x93ae('0xe0')]=_0x93ae('0xe1');_0x5da0fc[_0x93ae('0xf1')]+=0x1;_0x5da0fc[_0x93ae('0xe9')]+=0x1;_0x5da0fc['amd']=!![];ami['emit'](_0x93ae('0xea'),ut['buildObj'](_0x5da0fc,'amd'));_0xc5a12[_0x93ae('0xc3')](_0x5da0fc)[_0x93ae('0xa9')](loggerCatch(_0x93ae('0xeb')));if(_0x5da0fc['countbusyretry']+_0x5da0fc[_0x93ae('0xed')]+_0x5da0fc[_0x93ae('0xee')]+_0x5da0fc[_0x93ae('0xef')]+_0x5da0fc[_0x93ae('0xfd')]+_0x5da0fc[_0x93ae('0xf0')]+_0x5da0fc['countmachineretry']+_0x5da0fc[_0x93ae('0xf2')]>=_0x384d73['dialGlobalMaxRetry']){_0xc5a12[_0x93ae('0xf4')](_0x5da0fc,_0x17081f,_0x104a93,_0x93ae('0xf5'));}else{if(_0x5da0fc['countmachineretry']>=_0x384d73[_0x93ae('0xf6')]){_0xc5a12[_0x93ae('0xf7')](_0x5da0fc,_0x17081f,_0x104a93,'reason\x2019\x20machine....');}else{_0xc5a12[_0x93ae('0xb9')]({'active':![],'countmachineretry':_0x5da0fc[_0x93ae('0xf1')],'scheduledat':moment()['add'](_0x384d73['dialMachineRetryFrequency'],_0x93ae('0xf9'))[_0x93ae('0x71')](_0x93ae('0xfa')),'ContactId':_0x5da0fc[_0x93ae('0xcb')],'ListId':_0x5da0fc['ListId'],'VoiceQueueId':_0x5da0fc['VoiceQueueId']||undefined,'CampaignId':_0x5da0fc[_0x93ae('0xcf')]||undefined})[_0x93ae('0xa9')](loggerCatch(_0x93ae('0xfe')));_0x17081f({'reschedule':0x1});}}});}}};Dialer[_0x93ae('0x15')][_0x93ae('0x2e')]=function(_0x5c8cb0){var _0x5c5937=this[_0x93ae('0x20')][_0x5c8cb0[_0x93ae('0xd8')]];var _0xf5bb85=this;var _0x4f981a;if(_0x5c5937&&_0x5c5937[_0x93ae('0x46')]===_0x93ae('0x8e')){delete this[_0x93ae('0x20')][_0x5c8cb0[_0x93ae('0xd8')]];this[_0x93ae('0xab')](this[_0x93ae('0x1a')][_0x5c5937[_0x93ae('0xac')]]);this['campaigns'][_0x5c5937[_0x93ae('0xac')]][_0x93ae('0xff')]+=0x1;_0x4f981a=new Hangup(_0x5c5937,_0x5c8cb0);this[_0x93ae('0xc3')](_0x4f981a)[_0x93ae('0xa9')](loggerCatch('[syncHangupIvr][createHistory]'));this['moveContactManagedDialer'](_0x4f981a)['catch'](loggerCatch(_0x93ae('0x100')));}if(_0x5c5937&&_0x5c5937[_0x93ae('0x46')]!==_0x93ae('0x8e')&&isNotNull(this[_0x93ae('0x19')][_0x5c5937[_0x93ae('0xac')]][_0x93ae('0x101')])){delete this[_0x93ae('0x20')][_0x5c8cb0[_0x93ae('0xd8')]];this[_0x93ae('0xab')](this[_0x93ae('0x19')][_0x5c5937['queue']]);this[_0x93ae('0x19')][_0x5c5937[_0x93ae('0xac')]][_0x93ae('0x58')]+=0x1;this['voiceQueues'][_0x5c5937[_0x93ae('0xac')]][_0x93ae('0x57')]+=0x1;_0x4f981a=new Hangup(_0x5c5937,_0x5c8cb0);_0x4f981a[_0x93ae('0xa1')]=0x10;_0x4f981a['statedesc']=_0x93ae('0x102');_0x4f981a[_0x93ae('0xe0')]=_0x93ae('0x103');this[_0x93ae('0xc3')](_0x4f981a)['catch'](loggerCatch(_0x93ae('0x104')));this[_0x93ae('0xc1')](_0x4f981a)[_0x93ae('0xa9')](loggerCatch(_0x93ae('0x100')));}if(_0x5c5937&&_0x5c5937['type']!==_0x93ae('0x8e')&&!isNotNull(this[_0x93ae('0x19')][_0x5c5937[_0x93ae('0xac')]][_0x93ae('0x101')])){delete this[_0x93ae('0x20')][_0x5c8cb0['uniqueid']];this[_0x93ae('0xab')](this[_0x93ae('0x19')][_0x5c5937[_0x93ae('0xac')]]);this[_0x93ae('0x19')][_0x5c5937[_0x93ae('0xac')]][_0x93ae('0x61')]+=0x1;_0x4f981a=new Hangup(_0x5c5937,_0x5c8cb0);_0x4f981a[_0x93ae('0xa1')]=0xc;_0x4f981a[_0x93ae('0xe7')]=_0x5c8cb0[_0x93ae('0x105')];_0x4f981a['membername']=_0x93ae('0x106');this[_0x93ae('0xc3')](_0x4f981a)[_0x93ae('0xa9')](loggerCatch(_0x93ae('0x104')));this[_0x93ae('0xc1')](_0x4f981a)['catch'](loggerCatch('[syncHangupIvr]'));}};Dialer['prototype'][_0x93ae('0x2b')]=function(_0x7b711){var _0x394db7=this[_0x93ae('0x20')][_0x7b711[_0x93ae('0xd8')]];var _0x144912=this;if(this[_0x93ae('0x19')][_0x7b711['queue']]){if(_0x394db7&&_0x394db7['type']!==_0x93ae('0x8e')){delete this['uniqueId'][_0x7b711[_0x93ae('0xd8')]];this[_0x93ae('0x19')][_0x7b711[_0x93ae('0xac')]][_0x93ae('0x58')]+=0x1;var _0x1e9179=new AgentComplete(_0x394db7,_0x7b711);if(_0x7b711['reason']===_0x93ae('0x107')){_0x1e9179[_0x93ae('0x108')]=this[_0x93ae('0x19')][_0x7b711[_0x93ae('0xac')]]['dialQueueProject2']&&this[_0x93ae('0x19')][_0x7b711[_0x93ae('0xac')]]['dialAgiAfterHangupAgent']?moment()[_0x93ae('0x71')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;}this[_0x93ae('0xc3')](_0x1e9179)['catch'](loggerCatch('[syncAgentComplete][createHistory]'));this[_0x93ae('0xc1')](_0x1e9179)['catch'](loggerCatch(_0x93ae('0x109')));}}};Dialer[_0x93ae('0x15')][_0x93ae('0x27')]=function(_0x3a2956){if(this['voiceQueues'][_0x3a2956['queue']]){if(this[_0x93ae('0x20')][_0x3a2956['uniqueid']]&&this['uniqueId'][_0x3a2956[_0x93ae('0xd8')]][_0x93ae('0x46')]!=='ivr'){this[_0x93ae('0xab')](this[_0x93ae('0x19')][_0x3a2956[_0x93ae('0xac')]]);this['uniqueId'][_0x3a2956['uniqueid']][_0x93ae('0x10a')]=moment()[_0x93ae('0x71')](_0x93ae('0xfa'));}}};Dialer[_0x93ae('0x15')][_0x93ae('0x10b')]=function(_0x3a6126){this[_0x93ae('0xc3')](_0x3a6126)[_0x93ae('0xa9')](loggerCatch(_0x93ae('0x10c')));this[_0x93ae('0xc1')](_0x3a6126)[_0x93ae('0xa9')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));};Dialer[_0x93ae('0x15')]['syncQueueCallerAbandon']=function(_0x2d9a45){var _0x277505=this['uniqueId'][_0x2d9a45[_0x93ae('0xd8')]];var _0x554c01=this;if(this['voiceQueues'][_0x2d9a45[_0x93ae('0xac')]]){if(_0x277505&&_0x277505[_0x93ae('0x46')]!==_0x93ae('0x8e')){delete this['uniqueId'][_0x2d9a45['uniqueid']];this[_0x93ae('0xab')](this[_0x93ae('0x19')][_0x2d9a45['queue']]);_0x277505[_0x93ae('0x10d')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x3c7000=new QueueCallerAbandon(_0x277505,_0x2d9a45);if(getSeconds(_0x277505[_0x93ae('0x10d')],_0x277505[_0x93ae('0x10e')])>=_0x277505[_0x93ae('0x10f')]){this[_0x93ae('0x19')][_0x2d9a45['queue']][_0x93ae('0x7a')]+=0x1;this[_0x93ae('0x19')][_0x2d9a45['queue']][_0x93ae('0x5d')]+=0x1;this['voiceQueues'][_0x2d9a45['queue']][_0x93ae('0x67')]+=0x1;_0x3c7000[_0x93ae('0xa1')]=0xa;_0x3c7000[_0x93ae('0xe7')]=_0x93ae('0x110');_0x3c7000[_0x93ae('0x111')]=_0x93ae('0x112');_0x3c7000[_0x93ae('0x108')]=this[_0x93ae('0x19')][_0x2d9a45[_0x93ae('0xac')]][_0x93ae('0x113')]?moment()[_0x93ae('0x71')](_0x93ae('0xfa')):undefined;_0x3c7000[_0x93ae('0xfd')]+=0x1;_0x3c7000[_0x93ae('0xe9')]+=0x1;if(_0x3c7000['countdropretry']>=this[_0x93ae('0x19')][_0x2d9a45[_0x93ae('0xac')]][_0x93ae('0x114')]){this[_0x93ae('0x10b')](_0x3c7000);}else{this[_0x93ae('0xb9')]({'active':![],'countdropretry':_0x3c7000[_0x93ae('0xfd')],'scheduledat':moment()['add'](this[_0x93ae('0x19')][_0x2d9a45['queue']][_0x93ae('0x115')],_0x93ae('0xf9'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x277505[_0x93ae('0xcb')],'ListId':_0x277505['ListId'],'VoiceQueueId':_0x277505[_0x93ae('0xce')]||undefined,'CampaignId':_0x277505['CampaignId']||undefined})[_0x93ae('0xa9')](loggerCatch('[rescheduleContact][Drop]'));var _0x6394a2=new History(_0x3c7000);_0x6394a2[_0x93ae('0xa1')]=0xa;_0x6394a2['statedesc']=_0x93ae('0x110');_0x6394a2['starttime']=moment()[_0x93ae('0x71')]('YYYY-MM-DD\x20HH:mm:ss');_0x6394a2[_0x93ae('0xa2')]=_0x6394a2[_0x93ae('0x116')];_0x6394a2[_0x93ae('0x117')]=_0x3c7000['calleridname'];_0x6394a2[_0x93ae('0x118')]=_0x3c7000['calleridnum'];this[_0x93ae('0xc3')](_0x6394a2)[_0x93ae('0xa9')](loggerCatch(_0x93ae('0x119')));}}else{this[_0x93ae('0x19')][_0x2d9a45[_0x93ae('0xac')]][_0x93ae('0x65')]+=0x1;this[_0x93ae('0x19')][_0x2d9a45[_0x93ae('0xac')]][_0x93ae('0x5c')]+=0x1;_0x3c7000[_0x93ae('0xa1')]=0xb;_0x3c7000[_0x93ae('0xe7')]=_0x93ae('0x11a');_0x3c7000[_0x93ae('0x111')]=_0x93ae('0x11b');_0x3c7000[_0x93ae('0xf0')]+=0x1;_0x3c7000[_0x93ae('0xe9')]+=0x1;if(_0x3c7000['countabandonedretry']>=this[_0x93ae('0x19')][_0x2d9a45[_0x93ae('0xac')]][_0x93ae('0x11c')]){this[_0x93ae('0x10b')](_0x3c7000);}else{this[_0x93ae('0xb9')]({'active':![],'countabandonedretry':_0x3c7000[_0x93ae('0xf0')],'scheduledat':moment()[_0x93ae('0xf8')](this['voiceQueues'][_0x2d9a45['queue']][_0x93ae('0x11d')],_0x93ae('0xf9'))[_0x93ae('0x71')](_0x93ae('0xfa')),'ContactId':_0x277505[_0x93ae('0xcb')],'ListId':_0x277505[_0x93ae('0xcc')],'VoiceQueueId':_0x277505[_0x93ae('0xce')]||undefined,'CampaignId':_0x277505['CampaignId']||undefined})[_0x93ae('0xa9')](loggerCatch(_0x93ae('0x11e')));var _0x6394a2=new History(_0x3c7000);_0x6394a2['state']=0xb;_0x6394a2['statedesc']='Abandoned';_0x6394a2[_0x93ae('0x116')]=moment()[_0x93ae('0x71')](_0x93ae('0xfa'));_0x6394a2[_0x93ae('0xa2')]=_0x6394a2[_0x93ae('0x116')];_0x6394a2['calleridname']=_0x3c7000['calleridname'];_0x6394a2['calleridnum']=_0x3c7000[_0x93ae('0x118')];this['createHistory'](_0x6394a2)[_0x93ae('0xa9')](loggerCatch(_0x93ae('0x11f')));}}}}};Dialer[_0x93ae('0x15')][_0x93ae('0x120')]=function(_0x4dfa3b){if(this[_0x93ae('0x1f')][_0x4dfa3b[_0x93ae('0xd8')]]){this[_0x93ae('0x1f')][_0x4dfa3b['uniqueid']][_0x93ae('0x121')]=_0x4dfa3b[_0x93ae('0x121')];}if(this[_0x93ae('0x20')][_0x4dfa3b[_0x93ae('0xd8')]]){this[_0x93ae('0x20')][_0x4dfa3b['uniqueid']][_0x93ae('0x121')]=_0x4dfa3b[_0x93ae('0x121')];}};Dialer[_0x93ae('0x15')][_0x93ae('0x32')]=function(_0x1e4a7a){if(strategy[this['voiceQueues'][this[_0x93ae('0x1f')][_0x1e4a7a[_0x93ae('0x122')]][_0x93ae('0xac')]][_0x93ae('0x48')]]===_0x93ae('0x123')){if(this[_0x93ae('0x1f')][_0x1e4a7a[_0x93ae('0x122')]]&&_[_0x93ae('0xa6')](this[_0x93ae('0x1f')][_0x1e4a7a[_0x93ae('0x122')]][_0x93ae('0x124')])&&_0x1e4a7a[_0x93ae('0xa8')]==='1'&&_0x1e4a7a['paused']==='0'){if(this[_0x93ae('0x1b')][_0x1e4a7a['stateinterface']]){if(!this[_0x93ae('0x1b')][_0x1e4a7a[_0x93ae('0x125')]][_0x93ae('0x124')]){this[_0x93ae('0x1b')][_0x1e4a7a[_0x93ae('0x125')]][_0x93ae('0x124')]=!![];this[_0x93ae('0x1f')][_0x1e4a7a[_0x93ae('0x122')]][_0x93ae('0x124')]=!![];this[_0x93ae('0x1f')][_0x1e4a7a[_0x93ae('0x122')]][_0x93ae('0x125')]=_0x1e4a7a[_0x93ae('0x125')];}}}}else if((strategy[this[_0x93ae('0x19')][this[_0x93ae('0x1f')][_0x1e4a7a[_0x93ae('0x122')]][_0x93ae('0xac')]][_0x93ae('0x48')]]||'rrmemory')===_0x93ae('0x14')){if(this[_0x93ae('0x1f')][_0x1e4a7a[_0x93ae('0x122')]]){if(this['agents'][_0x1e4a7a[_0x93ae('0x125')]]){this[_0x93ae('0x1f')][_0x1e4a7a[_0x93ae('0x122')]]['stateinterface']=_0x1e4a7a[_0x93ae('0x125')];if(_[_0x93ae('0xa6')](this['queueBooked'][this['actions'][_0x1e4a7a['actionid']][_0x93ae('0xac')]])){this['queueBooked'][this['actions'][_0x1e4a7a[_0x93ae('0x122')]][_0x93ae('0xac')]]=[];}this[_0x93ae('0x24')][this[_0x93ae('0x1f')][_0x1e4a7a[_0x93ae('0x122')]][_0x93ae('0xac')]][_0x93ae('0x126')](_[_0x93ae('0x89')](_[_0x93ae('0x127')](this[_0x93ae('0x1f')][_0x1e4a7a[_0x93ae('0x122')]],[_0x93ae('0x128'),_0x93ae('0x125')]),{'status':_0x1e4a7a[_0x93ae('0xa8')],'paused':_0x1e4a7a['paused']}));}}}};function unlockQueueStatus(_0x32339f,_0x22106a){setTimeout(function(){if(_[_0x93ae('0x80')](_0x32339f[_0x93ae('0x129')])){loggerBooked[_0x93ae('0x92')](_0x93ae('0x12a'),_0x22106a);}_0x32339f[_0x93ae('0x129')]=!![];loggerBooked['info'](_0x93ae('0x12b'),_0x22106a,JSON[_0x93ae('0x41')](_['pick'](_0x32339f,[_0x93ae('0x37'),'queueStatusComplete'])));},0x1f3);}Dialer[_0x93ae('0x15')][_0x93ae('0x33')]=function(_0x332145){var _0x52e2d1=this;var _0x3aacf0=_0x52e2d1[_0x93ae('0x19')][_0x52e2d1[_0x93ae('0x1f')][_0x332145['actionid']][_0x93ae('0xac')]];if(strategy[this[_0x93ae('0x19')][this[_0x93ae('0x1f')][_0x332145[_0x93ae('0x122')]]['queue']]['strategy']]===_0x93ae('0x123')){if(this[_0x93ae('0x1f')][_0x332145[_0x93ae('0x122')]]&&this[_0x93ae('0x1f')][_0x332145[_0x93ae('0x122')]][_0x93ae('0x125')]){this['preview']['run'](this[_0x93ae('0x1f')][_0x332145[_0x93ae('0x122')]][_0x93ae('0x128')],this['actions'][_0x332145[_0x93ae('0x122')]][_0x93ae('0x125')])[_0x93ae('0xa9')](function(_0x2589db){logger[_0x93ae('0x92')](_0x93ae('0x12c'),util[_0x93ae('0x93')](_0x2589db,{'showHidden':![],'depth':null}));})[_0x93ae('0x12d')](function(){_0x52e2d1[_0x93ae('0xab')](_0x52e2d1[_0x93ae('0x19')][_0x52e2d1[_0x93ae('0x1f')][_0x332145[_0x93ae('0x122')]][_0x93ae('0xac')]]);_0x52e2d1[_0x93ae('0x1b')][_0x52e2d1[_0x93ae('0x1f')][_0x332145['actionid']][_0x93ae('0x125')]][_0x93ae('0x124')]=![];delete _0x52e2d1[_0x93ae('0x1f')][_0x332145[_0x93ae('0x122')]];unlockQueueStatus(_0x3aacf0);});}else{this[_0x93ae('0xab')](this[_0x93ae('0x19')][this['actions'][_0x332145['actionid']]['queue']]);this[_0x93ae('0xb9')]({'active':![],'ContactId':this['actions'][_0x332145[_0x93ae('0x122')]]['ContactId'],'ListId':this[_0x93ae('0x1f')][_0x332145[_0x93ae('0x122')]]['ListId'],'VoiceQueueId':this[_0x93ae('0x1f')][_0x332145[_0x93ae('0x122')]]['VoiceQueueId']||undefined,'CampaignId':this[_0x93ae('0x1f')][_0x332145[_0x93ae('0x122')]][_0x93ae('0xcf')]||undefined})['catch'](loggerCatch(_0x93ae('0x12e')));delete this[_0x93ae('0x1f')][_0x332145[_0x93ae('0x122')]];unlockQueueStatus(_0x3aacf0);}}else if((strategy[this['voiceQueues'][this[_0x93ae('0x1f')][_0x332145[_0x93ae('0x122')]][_0x93ae('0xac')]][_0x93ae('0x48')]]||_0x93ae('0x14'))===_0x93ae('0x14')){var _0x4bbd5e;if(this['actions'][_0x332145[_0x93ae('0x122')]]&&!_[_0x93ae('0x74')](this['queueBooked'][this[_0x93ae('0x1f')][_0x332145[_0x93ae('0x122')]][_0x93ae('0xac')]])){if(this[_0x93ae('0x25')][_0x52e2d1[_0x93ae('0x1f')][_0x332145[_0x93ae('0x122')]][_0x93ae('0xac')]]){this['queueBookedRR'][_0x52e2d1[_0x93ae('0x1f')][_0x332145[_0x93ae('0x122')]][_0x93ae('0xac')]]=this[_0x93ae('0x25')][this[_0x93ae('0x1f')][_0x332145['actionid']][_0x93ae('0xac')]]?this[_0x93ae('0x25')][this[_0x93ae('0x1f')][_0x332145[_0x93ae('0x122')]][_0x93ae('0xac')]]:this[_0x93ae('0x24')][this[_0x93ae('0x1f')][_0x332145[_0x93ae('0x122')]][_0x93ae('0xac')]]?this[_0x93ae('0x24')][this[_0x93ae('0x1f')][_0x332145[_0x93ae('0x122')]][_0x93ae('0xac')]]['_rr']||0x0:0x0;}this[_0x93ae('0x24')][this[_0x93ae('0x1f')][_0x332145['actionid']][_0x93ae('0xac')]]['_rr']=this['queueBookedRR'][this[_0x93ae('0x1f')][_0x332145[_0x93ae('0x122')]][_0x93ae('0xac')]];for(var _0x4d61e8=0x0;_0x4d61e8=0x0;})[_0x93ae('0xa9')](myreject(_0x2c11db)));}}else{_0x513dec['push'](ami[_0x93ae('0xa7')]({'action':_0x93ae('0x146'),'command':util['format'](_0x93ae('0x147'),_0x281ac1,!_[_0x93ae('0x80')](config['timezones'][_0xd6c655])?_0xd6c655:'')})['then'](function(_0x220cf4){return _0x220cf4[_0x93ae('0x149')]['indexOf'](_0x93ae('0x14b'))>=0x0;})['catch'](myreject(_0x2c11db)));}BPromise[_0x93ae('0x14c')](_0x513dec)[_0x93ae('0xb3')](function(_0x21001c){var _0x54e540=_[_0x93ae('0x14d')](_0x21001c);if(_0x54e540){return _0x1d6a19(_0x54e540);}else{_0x5d058b[_0x93ae('0x38')]=_0x3a0888?'GLOBAL_INTERVAL_IS_OVERTIME':'INTERVAL_IS_OVERTIME';return _0x2c11db(msgResponse(_0x93ae('0x14e'),_0x93ae('0x141'),_0x93ae('0x14f')+_0x3a0888+'\x20'+_0x13d9c5+_0x93ae('0x150')+util[_0x93ae('0x93')](_0x281ac1,{'showHidden':![],'depth':null})+_0x93ae('0x151')+_0xd6c655));}})[_0x93ae('0xa9')](function(_0x29c525){return _0x2c11db(msgResponse(_0x93ae('0x140'),'Failure',JSON[_0x93ae('0x41')](_0x29c525)));});});};Dialer['prototype'][_0x93ae('0x152')]=function(_0x7efff0){var _0x4ec4e4=this;return function(){switch(_0x7efff0['dialMethod']){case _0x93ae('0x153'):freeVariablesPredictive(_0x7efff0);_0x4ec4e4[_0x93ae('0x154')](_0x7efff0,0x1);break;case _0x93ae('0x155'):freeVariablesPredictive(_0x7efff0);_0x4ec4e4[_0x93ae('0x154')](_0x7efff0,_0x7efff0[_0x93ae('0x156')]);break;case'predictive':_0x4ec4e4['predictive'](_0x7efff0);break;case _0x93ae('0x157'):freeVariablesPredictive(_0x7efff0);_0x4ec4e4[_0x93ae('0x154')](_0x7efff0,0x1);break;default:freeVariablesPredictive(_0x7efff0);logger[_0x93ae('0x92')](_0x93ae('0x158'),_0x7efff0[_0x93ae('0x37')],_0x93ae('0x159'));}};};Dialer[_0x93ae('0x15')]['launchHandleIvr']=function(_0x30e2da){var _0x5555e7=this;return function(){_0x5555e7[_0x93ae('0x15a')](_0x30e2da);};};Dialer['prototype']['syncQueueSummary']=function(_0x4c3ec5){var _0x2479b1=this;if(isNotPreview(_0x4c3ec5[_0x93ae('0x52')])){if(isVoiceQueueOutbound(_0x4c3ec5[_0x93ae('0x46')])&&isActive(_0x4c3ec5[_0x93ae('0x51')])){_0x4c3ec5[_0x93ae('0x9a')]=!![];BPromise[_0x93ae('0xaf')]()['then'](checkIsLoggedIn(_0x4c3ec5,_0x4c3ec5[_0x93ae('0x4a')]))['then'](checkIsActive(_0x4c3ec5,_0x4c3ec5[_0x93ae('0x51')]))['then'](checkInterval(_0x4c3ec5))[_0x93ae('0xb3')](_0x2479b1['checkIsTrunkReachable'](_0x4c3ec5))[_0x93ae('0xb3')](_0x2479b1[_0x93ae('0x13f')](_0x4c3ec5[_0x93ae('0x15b')],_0x4c3ec5[_0x93ae('0x15c')],_0x4c3ec5[_0x93ae('0x37')],_0x4c3ec5))[_0x93ae('0xb3')](_0x2479b1[_0x93ae('0x15d')](_0x4c3ec5[_0x93ae('0x3d')],_0x4c3ec5['dialTimezone'],_0x4c3ec5['name'],_0x4c3ec5))['then'](_0x2479b1['checkDialMethod'](_0x4c3ec5))[_0x93ae('0xa9')](loggerCatchQueueSummary(_0x93ae('0x15e'),_0x4c3ec5));}else{notSendMessagesQueue(_0x4c3ec5);}}else{freeVariablesPredictive(_0x4c3ec5);}};Dialer[_0x93ae('0x15')][_0x93ae('0x15f')]=function(){var _0x1a1691=this;var _0x4da4e5;for(var _0xb3c15f in this[_0x93ae('0x1a')]){if(typeof this['campaigns'][_0xb3c15f]!=='undefined'){_0x4da4e5=this[_0x93ae('0x1a')][_0xb3c15f];if(isCampaignIvr(_0x4da4e5['type'])&&isActive(_0x4da4e5[_0x93ae('0xd5')])){_0x4da4e5[_0x93ae('0x9a')]=!![];BPromise[_0x93ae('0xaf')]()['then'](checkIsActive(_0x4da4e5,_0x4da4e5[_0x93ae('0xd5')]))[_0x93ae('0xb3')](checkInterval(_0x4da4e5))[_0x93ae('0xb3')](_0x1a1691[_0x93ae('0x13c')](_0x4da4e5))[_0x93ae('0xb3')](_0x1a1691['checkIfTime'](_0x4da4e5['dialGlobalInterval'],_0x4da4e5[_0x93ae('0x15c')],_0x4da4e5[_0x93ae('0x37')],_0x4da4e5))[_0x93ae('0xb3')](_0x1a1691[_0x93ae('0x15d')](_0x4da4e5[_0x93ae('0x3d')],_0x4da4e5[_0x93ae('0x15c')],_0x4da4e5[_0x93ae('0x37')],_0x4da4e5))[_0x93ae('0xb3')](_0x1a1691['launchHandleIvr'](_0x4da4e5))[_0x93ae('0xa9')](loggerCatchQueueSummary('[syncCampaigns]',_0x4da4e5));}else{notSendMessagesCampaign(_0x4da4e5);}}}};function getCallerIdRandom(_0x5dbf40,_0x47e9af){var _0x45d1cc;var _0x26d028;var _0x218ccc;if(_0x47e9af<=0x0){_0x47e9af=0x1;}_0x45d1cc=new RegExp(_0x93ae('0x160')+_0x47e9af+'}$');_0x26d028=Math[_0x93ae('0x161')](0xa,_0x47e9af-0x1);_0x218ccc=Math[_0x93ae('0x161')](0xa,_0x47e9af)-0x1;return util[_0x93ae('0x71')]('%s',_['replace'](_0x5dbf40,_0x45d1cc,_[_0x93ae('0x162')](_0x26d028,_0x218ccc)));}function extractCalleridName(_0x41a4e4){var _0x533e5a=_0x41a4e4[_0x93ae('0x163')](/"(.*?)"/);return _0x533e5a?_0x533e5a[0x1]:_0x41a4e4;}function extractCalleridNumber(_0x123cff){var _0x598a68=_0x123cff[_0x93ae('0x163')](/<(.*?)>/);return _0x598a68?_0x598a68[0x1]:_0x123cff;}Dialer[_0x93ae('0x15')][_0x93ae('0x164')]=function(_0x5ca56f,_0x210284){var _0x1e02d6=this;var _0x29ea63=uuid['v4']();this[_0x93ae('0x1f')][_0x29ea63]=new Action(_0x5ca56f,_0x210284,_0x29ea63);return new BPromise(function(_0x4753a7,_0x2ca1f2){if(_[_0x93ae('0x80')](_0x5ca56f)&&typeof _0x5ca56f!==_0x93ae('0x165')){return _0x2ca1f2(msgResponse(_0x93ae('0x166'),'Failure',_0x93ae('0x167')));}if(_['isUndefined'](_0x210284[_0x93ae('0x168')][_0x93ae('0x169')])||_0x210284[_0x93ae('0x168')][_0x93ae('0x169')]===null){return _0x2ca1f2(msgResponse(_0x93ae('0x166'),_0x93ae('0x141'),_0x93ae('0x16a')));}var _0x236bb0={'XMD-CALLERID':_0x1e02d6[_0x93ae('0x1f')][_0x29ea63]['getCaller'](),'XMD-AGI':_0x5ca56f['dialQueueProject']?util[_0x93ae('0x71')](_0x93ae('0x16b'),ipAgi,_0x5ca56f[_0x93ae('0x101')]):_0x93ae('0x16c'),'XMD-AGIAFTER':_0x5ca56f[_0x93ae('0x113')]?util[_0x93ae('0x71')](_0x93ae('0x16b'),ipAgi,_0x5ca56f[_0x93ae('0x113')]):_0x93ae('0x16c'),'XMD-QUEUE':_0x5ca56f['type']===_0x93ae('0x47')?util[_0x93ae('0x71')]('\x22%s,%s%s,,,%s\x22',_0x5ca56f[_0x93ae('0x37')],_0x5ca56f[_0x93ae('0x16d')]||'',_0x5ca56f[_0x93ae('0x16e')]?'c':'',_0x5ca56f['dialQueueTimeout']||0x3):_0x93ae('0x16c'),'XMD-CONTACTID':_0x210284[_0x93ae('0xcb')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x1e02d6[_0x93ae('0x1f')][_0x29ea63][_0x93ae('0x16f')](),'XMD-AMD':_0x5ca56f['dialAMDActive']?_0x93ae('0x170'):_0x93ae('0x16c'),'XMD-DESTINATION':_0x93ae('0xdb')};if(_0x5ca56f[_0x93ae('0xdc')]){_0x236bb0[_0x93ae('0x171')]=_0x5ca56f[_0x93ae('0x172')]||0x9c4;_0x236bb0[_0x93ae('0x173')]=_0x5ca56f['dialAMDGreeting']||0x5dc;_0x236bb0[_0x93ae('0x174')]=_0x5ca56f['dialAMDAfterGreetingSilence']||0x320;_0x236bb0['XMD-AMDTOTALANALYSISTIME']=_0x5ca56f[_0x93ae('0x175')]||0x1388;_0x236bb0[_0x93ae('0x176')]=_0x5ca56f['dialAMDMinWordLength']||0x64;_0x236bb0[_0x93ae('0x177')]=_0x5ca56f['dialAMDBetweenWordsSilence']||0x32;_0x236bb0[_0x93ae('0x178')]=_0x5ca56f[_0x93ae('0x179')]||0x3;_0x236bb0['XMD-AMDSILENCETHRESHOLD']=_0x5ca56f[_0x93ae('0x17a')]||0x100;_0x236bb0[_0x93ae('0x17b')]=_0x5ca56f[_0x93ae('0x17c')]||0x1388;}if(_0x5ca56f[_0x93ae('0x46')]===_0x93ae('0x47')){_0x236bb0['XMD-VOICEQUEUEID']=_0x210284[_0x93ae('0xce')];}else{_0x236bb0['XMD-CAMPAIGNID']=_0x210284[_0x93ae('0xcf')];}for(var _0x35ba4d in _0x210284['Contact']){if(typeof _0x210284[_0x93ae('0x168')][_0x35ba4d]!==_0x93ae('0x95')){if(isNotNull(_0x210284[_0x93ae('0x168')][_0x35ba4d])&&_0x35ba4d!=='id'&&_0x35ba4d!=='tags'&&_0x35ba4d!=='createdAt'&&_0x35ba4d!=='updatedAt'){_0x236bb0[util[_0x93ae('0x71')](_0x93ae('0x17d'),_0x93ae('0x17e'),_[_0x93ae('0x17f')](_0x35ba4d))]=_0x210284['Contact'][_0x35ba4d];}}}var _0x424516=_0x1e02d6[_0x93ae('0xd4')](_0x5ca56f[_0x93ae('0x6e')])?getCallerId(_0x5ca56f[_0x93ae('0x6e')][_0x93ae('0x6f')],_0x5ca56f[_0x93ae('0x53')],_0x5ca56f[_0x93ae('0x180')]>0x0?getCallerIdRandom(_0x5ca56f['dialOriginateCallerIdNumber'],_0x5ca56f[_0x93ae('0x180')]):_0x5ca56f['dialOriginateCallerIdNumber']):getCallerId(_[_0x93ae('0xa6')](_0x5ca56f[_0x93ae('0x13d')])?_0x5ca56f[_0x93ae('0x6e')][_0x93ae('0x6f')]:_0x5ca56f[_0x93ae('0x13d')]['callerid'],_0x5ca56f[_0x93ae('0x53')],_0x5ca56f['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x5ca56f[_0x93ae('0x54')],_0x5ca56f[_0x93ae('0x180')]):_0x5ca56f[_0x93ae('0x54')]);if(_0x424516){_0x236bb0['XMD-ORIGINATECALLERIDNAME']=_0x1e02d6[_0x93ae('0x1f')][_0x29ea63][_0x93ae('0x181')]=extractCalleridName(_0x424516);_0x236bb0[_0x93ae('0x182')]=_0x1e02d6[_0x93ae('0x1f')][_0x29ea63][_0x93ae('0x183')]=extractCalleridNumber(_0x424516);}return ami['Action']({'actionid':_0x29ea63,'action':_0x93ae('0x166'),'channel':_0x1e02d6[_0x93ae('0xd4')](_0x5ca56f[_0x93ae('0x6e')])?util[_0x93ae('0x71')](_0x93ae('0x184'),_0x5ca56f['Trunk'][_0x93ae('0x37')],isNotNull(_0x5ca56f['dialPrefix'])?_0x5ca56f['dialPrefix'][_0x93ae('0x185')]()||'':'',_0x5ca56f[_0x93ae('0x186')]>0x0?_0x210284[_0x93ae('0x168')][_0x93ae('0x169')][_0x93ae('0x187')](_0x5ca56f['dialCutDigit']):_0x210284[_0x93ae('0x168')][_0x93ae('0x169')]):util['format'](_0x93ae('0x184'),_[_0x93ae('0xa6')](_0x5ca56f[_0x93ae('0x13d')])?_0x5ca56f[_0x93ae('0x6e')]['name']:_0x5ca56f[_0x93ae('0x13d')][_0x93ae('0x37')],isNotNull(_0x5ca56f['dialPrefix'])?_0x5ca56f[_0x93ae('0x56')]['trim']()||'':'',_0x5ca56f[_0x93ae('0x186')]>0x0?_0x210284[_0x93ae('0x168')][_0x93ae('0x169')]['substring'](_0x5ca56f[_0x93ae('0x186')]):_0x210284[_0x93ae('0x168')][_0x93ae('0x169')]),'callerid':_0x424516,'Exten':_0x93ae('0xdb'),'Context':_0x93ae('0x188'),'Priority':'1','variable':_0x236bb0,'timeout':(_0x5ca56f['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x29ea63})[_0x93ae('0xb3')](function(_0x171eb0){return _0x4753a7(_0x171eb0);})['catch'](function(_0x40b3ce){_0x5ca56f['outboundOriginateFailureCallsDay']+=0x1;var _0x219e0e=new History(_0x1e02d6[_0x93ae('0x1f')][_0x29ea63]);logger[_0x93ae('0x92')](util[_0x93ae('0x71')]('[originateError]:\x20%s',JSON['stringify'](_0x40b3ce)));_0x219e0e[_0x93ae('0xa1')]=0xe;_0x219e0e[_0x93ae('0xe7')]=_0x93ae('0x189');_0x219e0e[_0x93ae('0x116')]=moment()[_0x93ae('0x71')](_0x93ae('0xfa'));_0x219e0e[_0x93ae('0xa2')]=_0x219e0e[_0x93ae('0x116')];_0x1e02d6[_0x93ae('0xc3')](_0x219e0e)[_0x93ae('0xa9')](loggerCatch('[originate][error]'));_0x1e02d6[_0x93ae('0xc1')](_0x219e0e)['catch'](loggerCatch(_0x93ae('0x18a')))['finally'](function(){delete _0x1e02d6[_0x93ae('0x1f')][_0x29ea63];return _0x2ca1f2(msgResponse('originate','Error',_0x93ae('0x18b')));});});});};Dialer[_0x93ae('0x15')][_0x93ae('0x18c')]=function(_0x105639){var _0x5f1ae7=this[_0x93ae('0x1f')][_0x105639['actionid']];if(_0x5f1ae7){delete this['actions'][_0x105639[_0x93ae('0x122')]];_0x5f1ae7[_0x93ae('0x10e')]=moment()[_0x93ae('0x71')]('YYYY-MM-DD\x20HH:mm:ss');var _0x52cae7=_0x5f1ae7[_0x93ae('0x46')]===_0x93ae('0x8e')?this[_0x93ae('0x1a')][_0x5f1ae7['queue']]:this[_0x93ae('0x19')][_0x5f1ae7[_0x93ae('0x18d')]()];if(!this[_0x93ae('0xd2')](_0x105639[_0x93ae('0x18e')])){this[_0x93ae('0xab')](_0x52cae7);return this[_0x93ae('0x18f')](_0x5f1ae7,_0x52cae7,_0x105639)[_0x93ae('0xa9')](loggerCatch(_0x93ae('0x190')));}this[_0x93ae('0x20')][_0x105639['uniqueid']]=_0x5f1ae7;}};Dialer[_0x93ae('0x15')][_0x93ae('0x191')]=function(_0x3e88a9,_0x196a1e,_0x274be1){var _0x51f75c=new History(_0x196a1e);if(_0x51f75c[_0x93ae('0xec')]+_0x51f75c[_0x93ae('0xed')]+_0x51f75c[_0x93ae('0xee')]+_0x51f75c['countnosuchnumberretry']+_0x51f75c['countdropretry']+_0x51f75c['countabandonedretry']+_0x51f75c[_0x93ae('0xf1')]+_0x51f75c[_0x93ae('0xf2')]>=_0x274be1[_0x93ae('0xf3')]-0x1){return!![];}switch(_0x3e88a9){case 0x3:if(_0x51f75c['countnoanswerretry']>=_0x274be1[_0x93ae('0x192')]-0x1){return!![];}this[_0x93ae('0xb9')]({'active':![],'countnoanswerretry':_0x51f75c['countnoanswerretry']+=0x1,'scheduledat':moment()[_0x93ae('0xf8')](_0x274be1[_0x93ae('0x193')],_0x93ae('0xf9'))[_0x93ae('0x71')](_0x93ae('0xfa')),'ContactId':_0x51f75c[_0x93ae('0xcb')],'ListId':_0x51f75c[_0x93ae('0xcc')],'VoiceQueueId':_0x51f75c[_0x93ae('0xce')]||undefined,'CampaignId':_0x51f75c[_0x93ae('0xcf')]||undefined})[_0x93ae('0xa9')](loggerCatch(_0x93ae('0x194')));break;case 0x5:if(_0x51f75c[_0x93ae('0xec')]>=_0x274be1[_0x93ae('0x195')]-0x1){return!![];}this[_0x93ae('0xb9')]({'active':![],'countbusyretry':_0x51f75c[_0x93ae('0xec')]+=0x1,'scheduledat':moment()[_0x93ae('0xf8')](_0x274be1[_0x93ae('0x196')],_0x93ae('0xf9'))[_0x93ae('0x71')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x51f75c['ContactId'],'ListId':_0x51f75c[_0x93ae('0xcc')],'VoiceQueueId':_0x51f75c[_0x93ae('0xce')]||undefined,'CampaignId':_0x51f75c[_0x93ae('0xcf')]||undefined})[_0x93ae('0xa9')](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0x51f75c[_0x93ae('0xed')]>=_0x274be1['dialCongestionMaxRetry']-0x1){return!![];}this[_0x93ae('0xb9')]({'active':![],'countcongestionretry':_0x51f75c['countcongestionretry']+=0x1,'scheduledat':moment()[_0x93ae('0xf8')](_0x274be1[_0x93ae('0x197')],_0x93ae('0xf9'))[_0x93ae('0x71')](_0x93ae('0xfa')),'ContactId':_0x51f75c[_0x93ae('0xcb')],'ListId':_0x51f75c[_0x93ae('0xcc')],'VoiceQueueId':_0x51f75c['VoiceQueueId']||undefined,'CampaignId':_0x51f75c[_0x93ae('0xcf')]||undefined})[_0x93ae('0xa9')](loggerCatch(_0x93ae('0x198')));break;case 0x0:if(_0x51f75c['countnosuchnumberretry']>=_0x274be1[_0x93ae('0x199')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x51f75c[_0x93ae('0xef')]+=0x1,'scheduledat':moment()['add'](_0x274be1['dialNoSuchNumberRetryFrequency'],_0x93ae('0xf9'))[_0x93ae('0x71')](_0x93ae('0xfa')),'ContactId':_0x51f75c[_0x93ae('0xcb')],'ListId':_0x51f75c[_0x93ae('0xcc')],'VoiceQueueId':_0x51f75c[_0x93ae('0xce')]||undefined,'CampaignId':_0x51f75c[_0x93ae('0xcf')]||undefined})[_0x93ae('0xa9')](loggerCatch(_0x93ae('0x19a')));}break;case 0xa:if(_0x51f75c[_0x93ae('0xfd')]>=_0x274be1[_0x93ae('0x114')]-0x1){return!![];}this[_0x93ae('0xb9')]({'active':![],'countdropretry':_0x51f75c[_0x93ae('0xfd')]+=0x1,'scheduledat':moment()[_0x93ae('0xf8')](_0x274be1[_0x93ae('0x115')],_0x93ae('0xf9'))[_0x93ae('0x71')](_0x93ae('0xfa')),'ContactId':_0x51f75c[_0x93ae('0xcb')],'ListId':_0x51f75c[_0x93ae('0xcc')],'VoiceQueueId':_0x51f75c[_0x93ae('0xce')]||undefined,'CampaignId':_0x51f75c[_0x93ae('0xcf')]||undefined})[_0x93ae('0xa9')](loggerCatch(_0x93ae('0x19b')));break;case 0xb:if(_0x51f75c['countabandonedretry']>=_0x274be1[_0x93ae('0x11c')]-0x1){return!![];}this[_0x93ae('0xb9')]({'active':![],'countabandonedretry':_0x51f75c[_0x93ae('0xf0')]+=0x1,'scheduledat':moment()[_0x93ae('0xf8')](_0x274be1[_0x93ae('0x11d')],'minutes')[_0x93ae('0x71')](_0x93ae('0xfa')),'ContactId':_0x51f75c['ContactId'],'ListId':_0x51f75c[_0x93ae('0xcc')],'VoiceQueueId':_0x51f75c[_0x93ae('0xce')]||undefined,'CampaignId':_0x51f75c['CampaignId']||undefined})[_0x93ae('0xa9')](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x51f75c[_0x93ae('0xf1')]>=_0x274be1[_0x93ae('0xf6')]-0x1){return!![];}this[_0x93ae('0xb9')]({'active':![],'countmachineretry':_0x51f75c[_0x93ae('0xf1')]+=0x1,'scheduledat':moment()['add'](_0x274be1[_0x93ae('0x19c')],'minutes')[_0x93ae('0x71')](_0x93ae('0xfa')),'ContactId':_0x51f75c['ContactId'],'ListId':_0x51f75c[_0x93ae('0xcc')],'VoiceQueueId':_0x51f75c['VoiceQueueId']||undefined,'CampaignId':_0x51f75c['CampaignId']||undefined})[_0x93ae('0xa9')](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x51f75c[_0x93ae('0xf2')]>=_0x274be1[_0x93ae('0x19d')]-0x1){return!![];}this[_0x93ae('0xb9')]({'active':![],'countagentrejectretry':_0x51f75c[_0x93ae('0xf2')]+=0x1,'scheduledat':moment()['add'](_0x274be1[_0x93ae('0x19e')],_0x93ae('0xf9'))[_0x93ae('0x71')](_0x93ae('0xfa')),'ContactId':_0x51f75c[_0x93ae('0xcb')],'ListId':_0x51f75c[_0x93ae('0xcc')],'VoiceQueueId':_0x51f75c[_0x93ae('0xce')]||undefined,'CampaignId':_0x51f75c[_0x93ae('0xcf')]||undefined})[_0x93ae('0xa9')](loggerCatch(_0x93ae('0x19f')));break;default:return!![];}};Dialer[_0x93ae('0x15')][_0x93ae('0x18f')]=function(_0x88c23c,_0x5495df,_0x56083b){var _0x2340a3=this;var _0x17ffe0=new History(_0x88c23c);return new BPromise(function(_0x2c4646,_0x4d9794){if(_[_0x93ae('0x80')](_0x5495df)&&typeof _0x5495df!=='object'){return _0x4d9794(msgResponse('[callProgressDetecting]',_0x93ae('0x141'),_0x93ae('0x1a0')));}if(_['isUndefined'](_0x56083b)&&typeof _0x56083b!==_0x93ae('0x165')){return _0x4d9794(msgResponse('[callProgressDetecting]','Failure',_0x93ae('0x1a1')));}switch(_0x56083b[_0x93ae('0x1a2')]){case'0':_0x5495df[_0x93ae('0x1a3')]+=0x1;_0x17ffe0[_0x93ae('0xa1')]=0x0;_0x17ffe0['statedesc']=_0x93ae('0x1a4');_0x17ffe0[_0x93ae('0xef')]+=0x1;_0x17ffe0[_0x93ae('0xe9')]+=0x1;ami['emit']('custom:agentnosuchnumber',ut[_0x93ae('0xe2')](_0x88c23c,_0x93ae('0x1a5')));_0x2340a3[_0x93ae('0xc3')](_0x17ffe0)[_0x93ae('0xa9')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x2340a3[_0x93ae('0x191')](0x0,_0x88c23c,_0x5495df)){if(_0x17ffe0['countnosuchnumberretry']>=_0x5495df[_0x93ae('0x199')]){_0x2340a3['createStateFinal'](_0x17ffe0,_0x2c4646,_0x4d9794,_0x93ae('0x1a6'));}else{_0x2340a3['stateGlobal'](_0x17ffe0,_0x2c4646,_0x4d9794,_0x93ae('0x1a6'));}}break;case'3':_0x5495df[_0x93ae('0x1a7')]+=0x1;_0x17ffe0[_0x93ae('0xa1')]=0x3;_0x17ffe0[_0x93ae('0xe7')]=_0x93ae('0x1a8');_0x17ffe0[_0x93ae('0xee')]+=0x1;_0x17ffe0[_0x93ae('0xe9')]+=0x1;ami[_0x93ae('0x45')](_0x93ae('0x1a9'),ut['buildObj'](_0x88c23c,_0x93ae('0x1aa')));_0x2340a3[_0x93ae('0xc3')](_0x17ffe0)['catch'](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x2340a3['checkRetriveMax'](0x3,_0x88c23c,_0x5495df)){if(_0x17ffe0[_0x93ae('0xee')]>=_0x5495df[_0x93ae('0x192')]){_0x2340a3['createStateFinal'](_0x17ffe0,_0x2c4646,_0x4d9794,_0x93ae('0x1ab'));}else{_0x2340a3[_0x93ae('0xf4')](_0x17ffe0,_0x2c4646,_0x4d9794,_0x93ae('0x1ab'));}}break;case'5':_0x5495df[_0x93ae('0x5a')]+=0x1;_0x17ffe0['state']=0x5;_0x17ffe0[_0x93ae('0xe7')]=_0x93ae('0x1ac');_0x17ffe0[_0x93ae('0xec')]+=0x1;_0x17ffe0[_0x93ae('0xe9')]+=0x1;ami[_0x93ae('0x45')](_0x93ae('0x1ad'),ut['buildObj'](_0x88c23c,'busy'));_0x2340a3[_0x93ae('0xc3')](_0x17ffe0)[_0x93ae('0xa9')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x2340a3[_0x93ae('0x191')](0x5,_0x88c23c,_0x5495df)){if(_0x17ffe0[_0x93ae('0xec')]>=_0x5495df[_0x93ae('0x195')]){_0x2340a3[_0x93ae('0xf7')](_0x17ffe0,_0x2c4646,_0x4d9794,_0x93ae('0x1ae'));}else{_0x2340a3[_0x93ae('0xf4')](_0x17ffe0,_0x2c4646,_0x4d9794,'reason\x205\x20busy');}}break;case'8':_0x5495df[_0x93ae('0x5b')]+=0x1;_0x17ffe0[_0x93ae('0xa1')]=0x8;_0x17ffe0[_0x93ae('0xe7')]=_0x93ae('0x1af');_0x17ffe0['countcongestionretry']+=0x1;_0x17ffe0['countglobal']+=0x1;ami[_0x93ae('0x45')](_0x93ae('0x1b0'),ut[_0x93ae('0xe2')](_0x88c23c,_0x93ae('0x1b1')));_0x2340a3[_0x93ae('0xc3')](_0x17ffe0)[_0x93ae('0xa9')](loggerCatch(_0x93ae('0x1b2')));if(_0x2340a3[_0x93ae('0x191')](0x8,_0x88c23c,_0x5495df)){if(_0x17ffe0[_0x93ae('0xed')]>=_0x5495df['dialCongestionMaxRetry']){_0x2340a3['createStateFinal'](_0x17ffe0,_0x2c4646,_0x4d9794,'reason\x208\x20congestion');}else{_0x2340a3['stateGlobal'](_0x17ffe0,_0x2c4646,_0x4d9794,_0x93ae('0x1b3'));}}break;case'11':_0x5495df[_0x93ae('0x1b4')]+=0x1;_0x17ffe0[_0x93ae('0xa1')]=0xb;_0x17ffe0['statedesc']=_0x93ae('0x11a');_0x17ffe0['countabandonedretry']+=0x1;_0x17ffe0['countglobal']+=0x1;_0x2340a3['createHistory'](_0x17ffe0)[_0x93ae('0xa9')](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0x2340a3[_0x93ae('0x191')](0xb,_0x88c23c,_0x5495df)){if(_0x17ffe0['countabandonedretry']>=_0x5495df['dialAbandonedMaxRetry']){_0x2340a3['createStateFinal'](_0x17ffe0,_0x2c4646,_0x4d9794,_0x93ae('0x1b5'));}else{_0x2340a3['stateGlobal'](_0x17ffe0,_0x2c4646,_0x4d9794,_0x93ae('0x1b5'));}}break;case'20':_0x5495df['outboundRejectCallsDay']+=0x1;_0x17ffe0[_0x93ae('0xa1')]=0x14;_0x17ffe0[_0x93ae('0xe7')]='AgentReject';_0x17ffe0[_0x93ae('0xf2')]+=0x1;_0x17ffe0['countglobal']+=0x1;ami[_0x93ae('0x45')]('custom:agentreject',ut[_0x93ae('0xe2')](_0x88c23c,_0x93ae('0x1b6')));_0x2340a3[_0x93ae('0xc3')](_0x17ffe0)['catch'](loggerCatch(_0x93ae('0x1b7')));if(_0x2340a3[_0x93ae('0x191')](0x14,_0x88c23c,_0x5495df)){if(_0x17ffe0['countagentrejectretry']>=_0x5495df['dialAgentRejectMaxRetry']){_0x2340a3['createStateFinal'](_0x17ffe0,_0x2c4646,_0x4d9794,_0x93ae('0x1b8'));}else{_0x2340a3['stateGlobal'](_0x17ffe0,_0x2c4646,_0x4d9794,'reason\x2020\x20agentreject');}}break;default:_0x5495df[_0x93ae('0x61')]+=0x1;_0x17ffe0[_0x93ae('0xa1')]=0xc;_0x17ffe0[_0x93ae('0xe7')]=_0x56083b[_0x93ae('0x1a2')];_0x2340a3[_0x93ae('0xc3')](_0x17ffe0)[_0x93ae('0xa9')](loggerCatch(_0x93ae('0x1b9')));if(_0x2340a3[_0x93ae('0x191')](_0x56083b[_0x93ae('0x1a2')],_0x88c23c,_0x5495df)){if(_0x17ffe0[_0x93ae('0xec')]+_0x17ffe0[_0x93ae('0xed')]+_0x17ffe0[_0x93ae('0xee')]+_0x17ffe0['countnosuchnumberretry']+_0x17ffe0[_0x93ae('0xfd')]+_0x17ffe0[_0x93ae('0xf0')]+_0x17ffe0['countmachineretry']+_0x17ffe0['countagentrejectretry']>=_0x5495df[_0x93ae('0xf3')]){_0x2340a3[_0x93ae('0xf4')](_0x17ffe0,_0x2c4646,_0x4d9794,_0x56083b[_0x93ae('0x1a2')]);}else{_0x2340a3[_0x93ae('0xf7')](_0x17ffe0,_0x2c4646,_0x4d9794,_0x56083b[_0x93ae('0x1a2')]);}}}});};Dialer[_0x93ae('0x15')][_0x93ae('0xf4')]=function(_0x55d964,_0x13391b,_0x2e624d,_0xdc83c2){var _0x42719a=new Final(_0x55d964);_0x42719a[_0x93ae('0xa1')]=0xf;_0x42719a[_0x93ae('0xe7')]=_0x93ae('0x1ba');this[_0x93ae('0xf7')](_0x42719a,_0x13391b,_0x2e624d,_0xdc83c2);};Dialer['prototype'][_0x93ae('0xf7')]=function(_0x5b4801,_0x373f60,_0x56b2ba,_0x4c6142){this['moveContactManagedDialer'](_0x5b4801)[_0x93ae('0xb3')](function(){return _0x373f60(msgResponse(_0x93ae('0x1bb'),_0x93ae('0xd3'),_0x4c6142));})[_0x93ae('0xa9')](function(){return _0x56b2ba(msgResponse(_0x93ae('0x1bc'),_0x93ae('0x141'),_0x93ae('0x1bd')));});};Dialer[_0x93ae('0x15')]['predictive']=function(_0x3a762d){var _0x4bc2f9=_0x3a762d[_0x93ae('0x1be')]/0x64;var _0x324e3a=_0x3a762d[_0x93ae('0x5d')]/(_0x3a762d[_0x93ae('0x5d')]+_0x3a762d[_0x93ae('0x58')]);var _0x44746a=Math[_0x93ae('0x1bf')](_0x3a762d['predictiveIntervalAvailable']*(_0x3a762d['predictiveIntervalMaxThreshold']/0x64));var _0x2619b6=Math[_0x93ae('0x1bf')](_0x3a762d[_0x93ae('0x1c0')]*(_0x3a762d[_0x93ae('0x1c1')]/0x64));var _0x36aaef=_0x3a762d['available']+_0x3a762d[_0x93ae('0x4c')];var _0x5cee7c=Math['floor'](_0x3a762d[_0x93ae('0x6b')]*_0x3a762d[_0x93ae('0x1c2')]*_0x3a762d['predictiveIntervalHitRate']*_0x3a762d['predictiveIntervalMultiplicativeFactor']);if(_[_0x93ae('0x80')](_0x3a762d[_0x93ae('0x22')])){if(!_[_0x93ae('0x80')](_0x3a762d[_0x93ae('0x6d')])){_0x3a762d[_0x93ae('0x6d')]=undefined;loggerPredictive[_0x93ae('0x92')](_0x93ae('0x1c3'),_0x93ae('0x1c4'));}if(!_['isUndefined'](_0x3a762d[_0x93ae('0x8c')])){loggerPredictive['error'](_0x93ae('0x1c3'),_0x93ae('0x1c5'));clearInterval(_0x3a762d[_0x93ae('0x8c')]);_0x3a762d[_0x93ae('0x8c')]=undefined;}_0x3a762d[_0x93ae('0x22')]=moment()['format'](_0x93ae('0xfa'));loggerPredictive[_0x93ae('0x75')](_0x3a762d[_0x93ae('0x37')],_0x93ae('0x1c6'),_0x3a762d[_0x93ae('0x22')]);this[_0x93ae('0x154')](_0x3a762d,0x1);}else if(ifInterval(_0x3a762d[_0x93ae('0x1c7')],_0x3a762d[_0x93ae('0x22')])){this[_0x93ae('0x154')](_0x3a762d,0x1);loggerPredictiveCalls['info'](_0x93ae('0x1c8'),_0x3a762d['startProgressive'],_0x3a762d[_0x93ae('0x37')]);_0x3a762d[_0x93ae('0x6b')]=0x0;_0x3a762d[_0x93ae('0x67')]=0x0;}else if(_0x4bc2f9<_0x324e3a&&_0x3a762d[_0x93ae('0x1c9')]===_0x93ae('0x1ca')){freeVariablesPredictive(_0x3a762d);loggerPredictive[_0x93ae('0x75')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0x93ae('0x1cb'),_0x324e3a,'startProgressive',_0x3a762d[_0x93ae('0x37')]);}else if(_0x5cee7c<_0x3a762d['predictiveIntervalErlangCallsDroppedCalls']&&_0x3a762d[_0x93ae('0x1c9')]===_0x93ae('0x1ca')){freeVariablesPredictive(_0x3a762d);loggerPredictive[_0x93ae('0x75')](_0x93ae('0x1cc'),_0x93ae('0x1cd'),_0x5cee7c,_0x93ae('0x1ce'),_0x3a762d[_0x93ae('0x67')],_0x93ae('0x22'),_0x3a762d[_0x93ae('0x37')]);}else if(!ifInterval(_0x3a762d[_0x93ae('0x1c7')],_0x3a762d[_0x93ae('0x22')])&&_['isUndefined'](_0x3a762d[_0x93ae('0x6d')])&&!_[_0x93ae('0x80')](_0x3a762d['startProgressive'])){_0x3a762d[_0x93ae('0x6d')]=moment()[_0x93ae('0x71')](_0x93ae('0xfa'));loggerPredictive[_0x93ae('0x75')](_0x3a762d[_0x93ae('0x37')],_0x93ae('0x1cf'),_0x3a762d['startPredictive']);this['averageHandleTime'](_0x3a762d['dialPredictiveInterval'])[_0x93ae('0xb3')](this['getDataPredictive'](_0x3a762d))['then'](mergeDataErlangB(_0x3a762d))[_0x93ae('0xb3')](this['startMethodPredictive'](_0x3a762d))[_0x93ae('0xa9')](loggerCatchPredictive(_0x93ae('0x1d0'),_0x3a762d));}else if(!ifInterval(_0x3a762d[_0x93ae('0x1c7')],_0x3a762d['startPredictive'])){_0x3a762d[_0x93ae('0x67')]=0x0;_0x3a762d[_0x93ae('0x6d')]=moment()[_0x93ae('0x71')](_0x93ae('0xfa'));loggerPredictive[_0x93ae('0x75')](_0x3a762d['name'],_0x93ae('0x1d1'),_0x3a762d[_0x93ae('0x6d')]);clearInterval(_0x3a762d[_0x93ae('0x8c')]);_0x3a762d[_0x93ae('0x8c')]=undefined;this[_0x93ae('0xb7')](_0x3a762d['dialPredictiveInterval'])[_0x93ae('0xb3')](this['getDataPredictive'](_0x3a762d))[_0x93ae('0xb3')](mergeDataErlangB(_0x3a762d))[_0x93ae('0xb3')](this[_0x93ae('0x1d2')](_0x3a762d))[_0x93ae('0xa9')](loggerCatchPredictive(_0x93ae('0x1d3'),_0x3a762d));}else if(_0x3a762d[_0x93ae('0x1c0')]&&_0x36aaef<_0x3a762d[_0x93ae('0x1c0')]-_0x2619b6){freeVariablesPredictive(_0x3a762d);loggerPredictive[_0x93ae('0x75')](_0x3a762d[_0x93ae('0x37')],_0x93ae('0x1d4'),_0x36aaef,_0x93ae('0x1d5'),_0x3a762d[_0x93ae('0x1c0')],'-',_0x2619b6,'=',_0x3a762d[_0x93ae('0x1c0')]-_0x2619b6,')');}else if(_0x3a762d[_0x93ae('0x1c0')]&&_0x36aaef>_0x3a762d[_0x93ae('0x1c0')]+_0x44746a){freeVariablesPredictive(_0x3a762d);loggerPredictive[_0x93ae('0x75')](_0x3a762d[_0x93ae('0x37')],_0x93ae('0x1d4'),_0x36aaef,_0x93ae('0x1d6'),_0x3a762d[_0x93ae('0x1c0')],'+',_0x44746a,'=',_0x3a762d['predictiveIntervalAvailable']+_0x44746a,')');}};Dialer[_0x93ae('0x15')][_0x93ae('0x1d7')]=function(_0x5d89f8){var _0x64b639=this;return function(_0x309d03){return new BPromise(function(_0x197e5a,_0x59d863){_[_0x93ae('0x89')](_0x5d89f8,_0x309d03[0x0]);if(checkGetDataPredictive(_0x309d03[0x0])){var _0x5966c4=_0x5d89f8[_0x93ae('0x1c0')]=_0x5d89f8[_0x93ae('0x4c')]+_0x5d89f8['available'];var _0x3286b4=_0x5d89f8[_0x93ae('0x1c7')]*0x3c;var _0x398a0c=_0x309d03[0x0][_0x93ae('0x64')]+_0x309d03[0x0][_0x93ae('0x63')];var _0x20d02c=(_0x309d03[0x0][_0x93ae('0x62')]+_0x309d03[0x0][_0x93ae('0x7a')]+_0x309d03[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x309d03[0x0][_0x93ae('0x7f')];_0x5d89f8[_0x93ae('0x68')]=_0x20d02c>0x0?_0x20d02c:0x1;switch(_0x5d89f8[_0x93ae('0x1c9')]){case _0x93ae('0x1ca'):var _0x377fa0=_0x5d89f8['dialPredictiveOptimizationPercentage']/0x64;return _0x64b639[_0x93ae('0x1d8')](_0x5966c4,_0x3286b4,_0x398a0c,_0x20d02c,_0x377fa0)['then'](function(_0x24397d){return _0x197e5a(_0x24397d);});case _0x93ae('0x1d9'):var _0x2aec98=_0x5d89f8[_0x93ae('0x1be')]/0x64;return _0x64b639[_0x93ae('0x1da')](_0x5966c4,_0x3286b4,_0x398a0c,_0x20d02c,_0x2aec98)[_0x93ae('0xb3')](function(_0x184f8a){return _0x197e5a(_0x184f8a);});default:return _0x59d863(msgResponse(_0x93ae('0x1db'),_0x93ae('0x141'),_0x93ae('0x1dc')));}}else{return _0x59d863(msgResponse(_0x93ae('0x1db'),_0x93ae('0x141'),_0x93ae('0x1dd')));}});};};Dialer['prototype'][_0x93ae('0x1de')]=function(_0x36de24){var _0x414cea=this;return function(_0x35d52b){return new BPromise(function(_0x225a16,_0x5b2a33){_[_0x93ae('0x89')](_0x36de24,_0x35d52b[0x0]);if(checkGetDataPredictive(_0x35d52b[0x0])){loggerPredictive[_0x93ae('0x75')](JSON[_0x93ae('0x41')](_0x35d52b[0x0]));if(_0x36de24[_0x93ae('0x1c9')]===_0x93ae('0x1ca')){return _0x414cea['getVoiceQueueRtPauses'](_0x36de24['id'])[_0x93ae('0xb3')](function(_0x5514c5){var _0x1fa9b7=_0x36de24['loggedIn']-_0x5514c5[0x0][_0x93ae('0x1df')];var _0x16340b=_0x36de24[_0x93ae('0x1c7')]*0x3c;var _0x1201f4=_0x35d52b[0x0][_0x93ae('0x64')]+_0x35d52b[0x0][_0x93ae('0x63')];var _0x2e3543=(_0x35d52b[0x0][_0x93ae('0x62')]+_0x35d52b[0x0][_0x93ae('0x7a')]+_0x35d52b[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x35d52b[0x0][_0x93ae('0x7f')];var _0x101760=_0x36de24['dialPredictiveOptimizationPercentage']/0x64;_0x36de24[_0x93ae('0x6a')]=_0x5514c5[0x0]['outboundQueuePauses']||0x0;_0x36de24[_0x93ae('0x68')]=_0x2e3543>0x0?_0x2e3543:0x1;return _0x414cea[_0x93ae('0x1d8')](_0x1fa9b7,_0x16340b,_0x1201f4,_0x2e3543,_0x101760);})['then'](function(_0x46763b){return _0x225a16(_0x46763b);})[_0x93ae('0xa9')](function(_0x4f8200){return _0x5b2a33(msgResponse(_0x93ae('0x1e0'),'Failure',JSON[_0x93ae('0x41')](_0x4f8200)));});}if(_0x36de24[_0x93ae('0x1c9')]===_0x93ae('0x1d9')){return _0x414cea[_0x93ae('0xbf')](_0x36de24['id'])[_0x93ae('0xb3')](function(_0x15a2e4){var _0x49f837=_0x36de24['loggedIn']-_0x15a2e4[0x0][_0x93ae('0x1df')];var _0xe2a430=_0x36de24[_0x93ae('0x1c7')]*0x3c;var _0x4476c7=_0x35d52b[0x0][_0x93ae('0x64')]+_0x35d52b[0x0][_0x93ae('0x63')];var _0x5356db=(_0x35d52b[0x0][_0x93ae('0x62')]+_0x35d52b[0x0][_0x93ae('0x7a')]+_0x35d52b[0x0][_0x93ae('0x65')])/_0x35d52b[0x0][_0x93ae('0x7f')];var _0x554626=_0x36de24[_0x93ae('0x1be')]/0x64;_0x36de24['predictiveIntervalPauses']=_0x15a2e4[0x0][_0x93ae('0x1df')]||0x0;_0x36de24[_0x93ae('0x68')]=_0x5356db>0x0?_0x5356db:0x1;return _0x414cea['busyFactor'](_0x49f837,_0xe2a430,_0x4476c7,_0x5356db,_0x554626);})[_0x93ae('0xb3')](function(_0x165345){return _0x225a16(_0x165345);})[_0x93ae('0xa9')](function(_0x3d6df9){return _0x5b2a33(msgResponse(_0x93ae('0x1e0'),_0x93ae('0x141'),JSON[_0x93ae('0x41')](_0x3d6df9)));});}}else{return _0x5b2a33(msgResponse(_0x93ae('0x1db'),_0x93ae('0x141'),'check\x20failure'));}});};};Dialer[_0x93ae('0x15')][_0x93ae('0x1d2')]=function(_0x4bba84){var _0x3a942f=this;return function(){var _0x19b41c=0x0;var _0x30854c=Math[_0x93ae('0x1e1')](_0x4bba84[_0x93ae('0x86')]*0x3e8);if(_0x30854c>0x0){_0x30854c=_0x30854c<0x64?0x64:_0x30854c;loggerPredictive[_0x93ae('0x75')](_0x4bba84[_0x93ae('0x37')],_0x93ae('0x1e2'),_0x30854c,'milliseconds');_0x4bba84[_0x93ae('0x8c')]=setInterval(function(){_0x3a942f[_0x93ae('0x8c')](_0x4bba84);loggerPredictiveCalls['info'](_0x93ae('0x1e3'),_0x19b41c+=0x1);},_0x30854c);}else{loggerPredictive['info'](_0x4bba84[_0x93ae('0x37')],_0x93ae('0x1e4'));}};};Dialer[_0x93ae('0x15')][_0x93ae('0x1e5')]=function(_0x59984f,_0x16f386){var _0x4c2885=this;return function(_0x1775c8){if(_['isEmpty'](_0x1775c8)){if(_[_0x93ae('0xa6')](_0x16f386[_0x93ae('0xcd')])||!_0x16f386[_0x93ae('0x1e6')]){if(_0x59984f[_0x93ae('0x52')]===_0x93ae('0x157')){_0x59984f['queueStatusComplete']=_[_0x93ae('0x80')](_0x59984f[_0x93ae('0x129')])?!![]:_0x59984f[_0x93ae('0x129')];var _0x35fc41=uuid['v4']();_0x4c2885[_0x93ae('0x1f')][_0x35fc41]=new Action(_0x59984f,_0x16f386,_0x35fc41);loggerBooked[_0x93ae('0x75')](_0x93ae('0x1e7'),_0x35fc41,_0x93ae('0x1e8'),JSON[_0x93ae('0x41')](_0x59984f[_0x93ae('0x129')]),'Queue:\x20',_0x59984f[_0x93ae('0x37')]);if(_0x59984f[_0x93ae('0x129')]){_0x59984f[_0x93ae('0x129')]=![];_0x4c2885[_0x93ae('0x24')][_0x4c2885['actions'][_0x35fc41]['queue']]=[];ami[_0x93ae('0xa7')]({'actionid':_0x35fc41,'action':_0x93ae('0x1e9'),'queue':_0x59984f[_0x93ae('0x37')]})[_0x93ae('0xa9')](function(){_0x4c2885[_0x93ae('0xab')](_0x59984f);_0x4c2885['rescheduleContact']({'active':![],'ContactId':_0x4c2885[_0x93ae('0x1f')][_0x35fc41][_0x93ae('0xcb')],'ListId':_0x4c2885[_0x93ae('0x1f')][_0x35fc41]['ListId'],'VoiceQueueId':_0x4c2885['actions'][_0x35fc41][_0x93ae('0xce')]||undefined,'CampaignId':_0x4c2885[_0x93ae('0x1f')][_0x35fc41][_0x93ae('0xcf')]||undefined})[_0x93ae('0xa9')](loggerCatch(_0x93ae('0x1ea')));delete _0x4c2885[_0x93ae('0x1f')][_0x35fc41];});}else{loggerBooked[_0x93ae('0x75')](_0x93ae('0x1eb'),JSON[_0x93ae('0x41')](_0x59984f['queueStatusComplete']),_0x93ae('0x1ec'),_0x59984f[_0x93ae('0x37')]);_0x4c2885[_0x93ae('0xab')](_0x59984f);_0x4c2885[_0x93ae('0xb9')]({'active':![],'ContactId':_0x4c2885[_0x93ae('0x1f')][_0x35fc41]['ContactId'],'ListId':_0x4c2885[_0x93ae('0x1f')][_0x35fc41][_0x93ae('0xcc')],'VoiceQueueId':_0x4c2885[_0x93ae('0x1f')][_0x35fc41]['VoiceQueueId']||undefined,'CampaignId':_0x4c2885['actions'][_0x35fc41][_0x93ae('0xcf')]||undefined})[_0x93ae('0xa9')](loggerCatch(_0x93ae('0x1ea')));delete _0x4c2885[_0x93ae('0x1f')][_0x35fc41];}}else{return _0x4c2885[_0x93ae('0x164')](_0x59984f,_0x16f386);}}else{if(getDiff(_0x16f386[_0x93ae('0x1ed')])<_0x59984f['dialRecallMeTimeout']*0x3c){if(_0x16f386[_0x93ae('0x1ee')]&&!_0x16f386[_0x93ae('0x1ee')]['voicePause']){_0x4c2885[_0x93ae('0x134')][_0x93ae('0x1ef')](_0x16f386['id'])[_0x93ae('0x12d')](function(){_0x4c2885['updateOriginated'](_0x59984f);});}else{_0x4c2885[_0x93ae('0x1f0')]({'active':![]},_0x16f386['id'],0x1)[_0x93ae('0x12d')](function(){_0x4c2885[_0x93ae('0xab')](_0x59984f);});}}else{_0x59984f['outboundReCallsDay']+=0x1;_0x4c2885['updateOriginated'](_0x59984f);if(_0x59984f[_0x93ae('0x1f1')]){_0x4c2885['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x16f386[_0x93ae('0xcb')],'ListId':_0x16f386[_0x93ae('0xcc')],'VoiceQueueId':_0x16f386[_0x93ae('0xce')]||undefined,'CampaignId':_0x16f386[_0x93ae('0xcf')]||undefined})['catch'](loggerCatch(_0x93ae('0x1f2')));_0x4c2885[_0x93ae('0xc3')](createObjHistory(_0x59984f,_0x16f386,_0x93ae('0x1f3'),0x17,'RecallInQueue'))['catch'](loggerCatch(_0x93ae('0x1f4')));}else{_0x4c2885[_0x93ae('0xca')](createObjHistory(_0x59984f,_0x16f386,'RECALLFAILEDTIMEOUT',0x16,_0x93ae('0x1f5')),'[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]');}}}}else{_0x59984f[_0x93ae('0x59')]+=0x1;_0x4c2885[_0x93ae('0xca')](createObjHistory(_0x59984f,_0x16f386,_0x93ae('0x1f6'),0xd,_0x93ae('0x1f7')),_0x93ae('0x1f8'),'[Originate][MoveBlacklist]');throw _0x93ae('0x1f9');}};};Dialer[_0x93ae('0x15')][_0x93ae('0x15a')]=function(_0x3b913c){var _0x13f136=this;var _0x567de0=_0x3b913c[_0x93ae('0x1fa')]-_0x3b913c[_0x93ae('0x96')]-_0x3b913c[_0x93ae('0xbb')];emitCampaignSummary(_0x3b913c);if(_0x567de0>0x0){if(_0x567de0>this[_0x93ae('0x1d')]){_0x567de0=this[_0x93ae('0x1d')];}_0x3b913c[_0x93ae('0xbb')]+=_0x567de0;this[_0x93ae('0xbd')](_0x3b913c['id'],_0x567de0,_0x3b913c[_0x93ae('0x1fb')],_0x3b913c)[_0x93ae('0xb3')](function(_0xb5029f){_0x3b913c['temp']-=_0x567de0;_0x3b913c[_0x93ae('0xbb')]=_0x3b913c['temp']>0x0?_0x3b913c[_0x93ae('0xbb')]:0x0;if(!checkContactEmpty(_0xb5029f)){_0x3b913c[_0x93ae('0x38')]=_0x93ae('0x1fc');logger[_0x93ae('0x75')](_0x93ae('0x1fd')+_0x3b913c[_0x93ae('0x37')]);}else{_0x3b913c[_0x93ae('0x96')]+=_0xb5029f[_0x93ae('0x94')];_0x3b913c[_0x93ae('0x38')]=_0x93ae('0x1fe');for(var _0x5e9acb=0x0;_0x5e9acb<_0xb5029f[_0x93ae('0x94')];_0x5e9acb+=0x1){_0x3b913c[_0x93ae('0x1ff')]+=0x1;if(_['isNil'](_0xb5029f[_0x5e9acb])||_[_0x93ae('0xa6')](_0xb5029f[_0x5e9acb][_0x93ae('0x168')])||_['isNil'](_0xb5029f[_0x5e9acb][_0x93ae('0x168')][_0x93ae('0x169')])){_0x13f136[_0x93ae('0xc8')](_0x93ae('0x200'),_0x3b913c,_0xb5029f[_0x5e9acb]);}else{_0x13f136[_0x93ae('0xb5')](_[_0x93ae('0x127')](_0xb5029f[_0x5e9acb],['CampaignId','Contact.phone']))[_0x93ae('0xb3')](_0x13f136[_0x93ae('0x1e5')](_0x3b913c,_0xb5029f[_0x5e9acb]))[_0x93ae('0xa9')](_0x13f136[_0x93ae('0xc7')]('[actionOriginateIvr]\x20',_0x3b913c));}}}})[_0x93ae('0xa9')](loggerGetContactDialer(_0x93ae('0x201'),_0x3b913c,_0x567de0));}};Dialer['prototype'][_0x93ae('0x154')]=function(_0x56b25b,_0x5d3a4f){var _0x542489=this;var _0x8a40=[];var _0xc48e12=_0x5d3a4f>=0x1?_0x5d3a4f:0x1;if(_0x56b25b[_0x93ae('0x52')]==='booked'){_0xc48e12=0x1;}var _0x1d60ca=Math[_0x93ae('0x1e1')](_0x56b25b[_0x93ae('0x202')]*_0xc48e12)-_0x56b25b[_0x93ae('0x96')]-_0x56b25b[_0x93ae('0xbb')];emitVoiceQueueSummary(_0x56b25b);if(_0x56b25b[_0x93ae('0x203')]>0x0){var _0x44a1dc=_0x56b25b['dialLimitQueue']-_0x56b25b[_0x93ae('0x96')]-_0x56b25b[_0x93ae('0x4c')]-_0x56b25b[_0x93ae('0xbb')]-_0x56b25b['pTalking'];if(_0x1d60ca>_0x44a1dc){_0x1d60ca=_0x44a1dc;}}if(_0x1d60ca>0x0){if(_0x56b25b[_0x93ae('0x52')]===_0x93ae('0x157')){_0x1d60ca=0x1;}if(_0x1d60ca>this['maxNumberOriginate']){_0x1d60ca=this[_0x93ae('0x1d')];}_0x56b25b['temp']+=_0x1d60ca;for(var _0x95a710 in this['agents']){if(typeof this[_0x93ae('0x1b')][_0x95a710]!==_0x93ae('0x95')){if(this[_0x93ae('0x1b')][_0x95a710][_0x93ae('0xa1')]===_0x93ae('0x204')&&this[_0x93ae('0x1b')][_0x95a710][_0x93ae('0xa8')]===_0x93ae('0xd7')){_0x8a40['push'](this[_0x93ae('0x1b')][_0x95a710]['id']);}}}this[_0x93ae('0xba')](_0x56b25b['id'],_0x8a40,_0x1d60ca,_0x56b25b[_0x93ae('0x1fb')],_0x56b25b)[_0x93ae('0xb3')](function(_0x189cb5){_0x56b25b[_0x93ae('0xbb')]-=_0x1d60ca;_0x56b25b[_0x93ae('0xbb')]=_0x56b25b['temp']>0x0?_0x56b25b[_0x93ae('0xbb')]:0x0;if(!checkContactEmpty(_0x189cb5)){_0x542489[_0x93ae('0xb0')](_0x56b25b)[_0x93ae('0xb3')](sendMessageReschedule(_0x56b25b))[_0x93ae('0xa9')](loggerCatch(_0x93ae('0xb1')));}else{_0x56b25b[_0x93ae('0x96')]+=_0x189cb5['length'];_0x56b25b['message']=_0x56b25b[_0x93ae('0x52')]===_0x93ae('0x157')?_0x93ae('0x170'):_0x93ae('0x1fe');for(var _0x512272=0x0;_0x512272<_0x189cb5['length'];_0x512272+=0x1){if(_['isNil'](_0x189cb5[_0x512272])||_[_0x93ae('0xa6')](_0x189cb5[_0x512272][_0x93ae('0x168')])||_[_0x93ae('0xa6')](_0x189cb5[_0x512272][_0x93ae('0x168')][_0x93ae('0x169')])){_0x542489[_0x93ae('0xc8')](_0x93ae('0x200'),_0x56b25b,_0x189cb5[_0x512272]);}else{_0x542489[_0x93ae('0xb2')](_[_0x93ae('0x127')](_0x189cb5[_0x512272],[_0x93ae('0xce'),_0x93ae('0x205')]))[_0x93ae('0xb3')](_0x542489['checkContactBlack'](_0x56b25b,_0x189cb5[_0x512272]))[_0x93ae('0xa9')](_0x542489[_0x93ae('0xc7')](_0x93ae('0x200'),_0x56b25b));}}}})[_0x93ae('0xa9')](loggerGetContactDialer('[getContactDialer2]',_0x56b25b,_0x1d60ca));}};Dialer[_0x93ae('0x15')][_0x93ae('0x8c')]=function(_0xdecc1c){if(_0xdecc1c[_0x93ae('0x203')]>0x0){var _0x47bf87=_0xdecc1c[_0x93ae('0x203')]-_0xdecc1c[_0x93ae('0x96')]-_0xdecc1c[_0x93ae('0x4c')];if(_0x47bf87>0x0){this[_0x93ae('0x206')](_0xdecc1c);}else{loggerPredictiveCalls[_0x93ae('0x75')]('[handlePredictive][limitChannel]');}}else{this[_0x93ae('0x206')](_0xdecc1c);}};Dialer[_0x93ae('0x15')][_0x93ae('0x206')]=function(_0x157df5){var _0x5ee573=this;var _0x5e3c06=[];_0x157df5['originated']+=0x1;for(var _0x5e11e4 in this[_0x93ae('0x1b')]){if(typeof this['agents'][_0x5e11e4]!==_0x93ae('0x95')){if(this[_0x93ae('0x1b')][_0x5e11e4]['state']===_0x93ae('0x204')&&this[_0x93ae('0x1b')][_0x5e11e4][_0x93ae('0xa8')]==='reachable'){_0x5e3c06[_0x93ae('0x126')](this[_0x93ae('0x1b')][_0x5e11e4]['id']);}}}this[_0x93ae('0xba')](_0x157df5['id'],_0x5e3c06,0x1,_0x157df5[_0x93ae('0x1fb')],_0x157df5)['then'](function(_0x57b5af){if(!checkContactEmpty(_0x57b5af)){checkContactLowerLimitOriginate(_0x157df5,0x1,0x0);_0x5ee573[_0x93ae('0xb0')](_0x157df5)[_0x93ae('0xb3')](sendMessageReschedule(_0x157df5))[_0x93ae('0xa9')](loggerCatch(_0x93ae('0xb1')));}else{_0x157df5[_0x93ae('0x38')]=_0x93ae('0x1fe');if(_['isNil'](_0x57b5af[0x0])||_['isNil'](_0x57b5af[0x0][_0x93ae('0x168')])||_[_0x93ae('0xa6')](_0x57b5af[0x0]['Contact']['phone'])){_0x5ee573[_0x93ae('0xc8')](_0x93ae('0x200'),_0x157df5,_0x57b5af[0x0]);}else{_0x5ee573['checkIsBlackList'](_['pick'](_0x57b5af[0x0],[_0x93ae('0xce'),'Contact.phone']))[_0x93ae('0xb3')](_0x5ee573['checkContactBlack'](_0x157df5,_0x57b5af[0x0]))[_0x93ae('0xa9')](_0x5ee573[_0x93ae('0xc7')](_0x93ae('0x207'),_0x157df5));}}})[_0x93ae('0xa9')](loggerGetContactDialer(_0x93ae('0x208'),_0x157df5,0x1));emitVoiceQueueSummary(_0x157df5);};Dialer[_0x93ae('0x15')][_0x93ae('0x1d8')]=function(_0x42dc0c,_0x4da04b,_0x406c06,_0xb8848f,_0x2dda87,_0x3b2b1b){loggerPredictive[_0x93ae('0x75')](_0x93ae('0x209'));loggerPredictive[_0x93ae('0x75')]('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',_0x42dc0c);loggerPredictive[_0x93ae('0x75')](_0x93ae('0x20a'),_0x4da04b);loggerPredictive[_0x93ae('0x75')]('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',_0x406c06);loggerPredictive[_0x93ae('0x75')](_0x93ae('0x20b'),_0xb8848f);loggerPredictive[_0x93ae('0x75')](_0x93ae('0x20c'),_0x2dda87);loggerPredictive['info'](_0x93ae('0x7e'));return new BPromise(function(_0x635841,_0x1c8041){if(_0x42dc0c<=0x0||isNaN(_0x42dc0c)){return _0x1c8041(msgResponse(_0x93ae('0x20d'),_0x93ae('0x40'),_0x93ae('0x20e')+_0x42dc0c));}if(_0x406c06<=0x0||isNaN(_0x406c06)){return _0x1c8041(msgResponse(_0x93ae('0x20d'),_0x93ae('0x40'),_0x93ae('0x20f')+_0x406c06));}if(_0xb8848f<=0x0||isNaN(_0xb8848f)){return _0x1c8041(msgResponse(_0x93ae('0x20d'),_0x93ae('0x40'),_0x93ae('0x210')+_0xb8848f));}if(_0x4da04b<=0x0||isNaN(_0x4da04b)){return _0x1c8041(msgResponse(_0x93ae('0x20d'),'Error','interval\x20=\x20'+_0x4da04b));}if(_0x2dda87<=0x0||isNaN(_0x2dda87)){return _0x1c8041(msgResponse(_0x93ae('0x20d'),'Error',_0x93ae('0x211')+_0x2dda87));}_0x3b2b1b=_0x3b2b1b||0x0;var _0x355789=0x1/_0x406c06;var _0x48f59d=0x0;var _0x171e33=0x0;var _0x66b5e4=0x0;var _0x2eac6b=0x0;for(var _0x47d4c4=0x0;_0x66b5e4<_0x2dda87;_0x47d4c4+=0x1){_0x171e33=_0x47d4c4/_0x4da04b;_0x48f59d=(_0xb8848f*_0x171e33+_0x3b2b1b)/_0x355789;_0x66b5e4=erlangb(_0x48f59d,_0x42dc0c);_0x2eac6b=_0x48f59d/_0x42dc0c*(0x1-erlangb(_0x48f59d,_0x42dc0c));}return _0x635841({'erlangCalls':_0x47d4c4,'erlangCallToSecond':_0x4da04b/_0x47d4c4,'erlangAbandonmentRate':_0x66b5e4,'erlangBusyFactor':_0x2eac6b});});};Dialer[_0x93ae('0x15')]['busyFactor']=function(_0xe86224,_0x53eff3,_0x52fa58,_0x201d10,_0x5cfba2,_0x3fb84b){loggerPredictive[_0x93ae('0x75')](_0x93ae('0x212'));loggerPredictive['info'](_0x93ae('0x213'),_0xe86224);loggerPredictive[_0x93ae('0x75')](_0x93ae('0x20a'),_0x53eff3);loggerPredictive['info'](_0x93ae('0x214'),_0x52fa58);loggerPredictive['info'](_0x93ae('0x20b'),_0x201d10);loggerPredictive[_0x93ae('0x75')](_0x93ae('0x215'),_0x5cfba2);loggerPredictive['info'](_0x93ae('0x7e'));return new BPromise(function(_0x1659bc,_0x566de1){if(_0xe86224<=0x0||isNaN(_0xe86224)){return _0x566de1(msgResponse(_0x93ae('0x216'),_0x93ae('0x40'),_0x93ae('0x20e')+_0xe86224));}if(_0x52fa58<=0x0||isNaN(_0x52fa58)){return _0x566de1(msgResponse(_0x93ae('0x216'),_0x93ae('0x40'),_0x93ae('0x20f')+_0x52fa58));}if(_0x201d10<=0x0||isNaN(_0x201d10)){return _0x566de1(msgResponse(_0x93ae('0x216'),_0x93ae('0x40'),'p\x20=\x20'+_0x201d10));}if(_0x53eff3<=0x0||isNaN(_0x53eff3)){return _0x566de1(msgResponse(_0x93ae('0x216'),_0x93ae('0x40'),_0x93ae('0x217')+_0x53eff3));}if(_0x5cfba2<=0x0||isNaN(_0x5cfba2)){return _0x566de1(msgResponse(_0x93ae('0x216'),_0x93ae('0x40'),'Umin\x20=\x20'+_0x5cfba2));}_0x3fb84b=_0x3fb84b||0x0;var _0x1fe767=0x1/_0x52fa58;var _0x13eb9a=0x0;var _0x50752b=0x0;var _0x5d6167=0x0;var _0x53f8ab=0x0;for(var _0x272ebd=0x0;_0x53f8ab<_0x5cfba2;_0x272ebd+=0x1){_0x50752b=_0x272ebd/_0x53eff3;_0x13eb9a=(_0x201d10*_0x50752b+_0x3fb84b)/_0x1fe767;_0x5d6167=erlangb(_0x13eb9a,_0xe86224);_0x53f8ab=_0x13eb9a/_0xe86224*(0x1-erlangb(_0x13eb9a,_0xe86224));}return _0x1659bc({'erlangCalls':_0x272ebd,'erlangCallToSecond':_0x53eff3/_0x272ebd,'erlangAbandonmentRate':_0x5d6167,'erlangBusyFactor':_0x53f8ab});});};module[_0x93ae('0x218')]=Dialer; \ No newline at end of file +var _0x4de7=['campaigns','agents','trunks','maxNumberOriginate','channels','contactsId','uniqueId','optionPredictive','startPredictive','agentconnect','syncAgentConnect','syncQueueCallerAbandon','bind','originateresponse','custom:queuesummary','hangup','syncHangup','newexten','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','loopCampaigns','loopClearZombieChannels','isUndefined','message','AGENTS_NOT_LOGGED','name','NOT_ACTIVE','\x20NOT\x20Active','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Interval','Intervals','[ifTime][Action]','stringify','milliseconds','seconds','answered','available','loggedIn','sumDuration','sumHoldTime','talking','total','type','unmanaged','abandoned','waiting','loggedInDb','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCallToSecond','erlangAbandonmentRate','startProgressive','Trunk','active','callerid','format','voice:queue:%s','ivr','campaign:ivr:%s','campaign:save','isEmpty','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','merge','diff','handlePredictive','outbound','preview','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','length','originated','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','pTalking','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20disactive','state','statedesc','endtime','[uniqueid]','clearZombieChannels','actions','isNil','Action','status','channel','catch','updateOriginated','[Dialer][checkChannel]','queue','[Dialer][checkChannel][ivr]','resolve','countReScheduled','[countReScheduled]\x20','checkIsBlackList','then','[checkIsBlackListIvr]\x20','rescheduleContact','[rescheduleContact]\x20','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','loggerHandler','emptyContact','notFound','ContactId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','SIP/%s','unmonitored','saveInDb','uniqueid','variable','exten','xcally-motion-dialer','dialAMDActive','HANGUP','HangupInAMD','membername','custom:amd','buildObj','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','Machine','countglobal','amd','emit','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','ListId','value','AMD','[syncHangupInAMDIvr]','countagentrejectretry','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','cause-txt','syncAgentComplete','reason','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','Drop','TIMEOUT','dialDropMaxRetry','add','[rescheduleContact][Drop]','starttime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','CALLEREXIT','dialAbandonedRetryFrequency','[syncAgentComplete][createHistory][11]','strategy','roundrobin','actionid','stateinterface','locked','queueBooked','push','pick','idHopper','paused','[unlockQueueStatus][undefined]','queueStatusComplete','[booked][unlockQueueStatus]','syncQueueStatusComplete','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','queueBookedRR','_rr','unlockRR','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','isTrunkReachable','TrunkBackup','\x20trunk\x20is\x20not\x20reachable','checkIfTime','checkIfTimeIntervals','ifTime','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','Failure','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','command','iftime\x20%s,%s','content','indexOf','true','timezones','all','some','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','dialMethod','progressive','handlePower','method\x20not\x20recognized','handleIvr','dialActive','dialGlobalInterval','dialTimezone','[syncQueueSummary]','[syncCampaigns]','\x5cw{0,','pow','random','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-CAMPAIGNID','Contact','tags','createdAt','XMD-','toUpper','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','trim','dialCutDigit','substring','from-sip','OriginateError','[originate][error]','Error','originate\x20action\x20Error','syncOriginateResponse','callProgressDetecting','checkRetriveMax','dialNoAnswerMaxRetry','dialBusyMaxRetry','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialDropRetryFrequency','dialAbandonedMaxRetry','[rescheduleContact][Abandoned]','[rescheduleContact][Machine]','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','entity\x20is\x20undefine','evt\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','dialNoSuchNumberMaxRetry','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','noanswer','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','outboundAbandonedCallsDay','reason\x2011\x20abandoned','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','dialAgentRejectMaxRetry','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[callProgressDetecting]','Success','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','erlangCalls','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','averageHandleTime','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','dialPredictiveInterval','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[booked][checkContactBlack][else]','[unlockOriginate][syncQueueStatusComplete]','scheduledat','Agent','run','unlockContact','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','inBlackList','dialOrderByScheduledAt','RUNNING','ivrTotalCallsDays','checkIsBlackListIvr','Contact.phone','checkContactBlack','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','reachable','[actionOriginate]\x20','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','[getContactDialerPredictive]','abandonmentRate','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','p\x20=\x20','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]','Ts\x20=\x20','Umin\x20=\x20','exports','util','bluebird','uuid','moment','md5','ioredis','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','syncQueueSummary','../ami','redis','defaults','localhost','../rpc/cmHopper','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./history','./final','./agentComplete','./hangup','XCALLY_IP_AGI','127.0.0.1','rrmemory','prototype','enqueue','tail','finally','sequence','voiceQueues'];(function(_0x1ac77b,_0x10ee7a){var _0x161584=function(_0x5a810d){while(--_0x5a810d){_0x1ac77b['push'](_0x1ac77b['shift']());}};_0x161584(++_0x10ee7a);}(_0x4de7,0x1f3));var _0x74de=function(_0x267990,_0x50235b){_0x267990=_0x267990-0x0;var _0x334526=_0x4de7[_0x267990];return _0x334526;};'use strict';var util=require(_0x74de('0x0'));var _=require('lodash');var BPromise=require(_0x74de('0x1'));var uuid=require(_0x74de('0x2'));var moment=require(_0x74de('0x3'));var rr=require('rr');var md5=require(_0x74de('0x4'));var Redis=require(_0x74de('0x5'));var ut=require('../preview/util/util');var config=require(_0x74de('0x6'));var logger=require(_0x74de('0x7'))(_0x74de('0x8'));var loggerBooked=require('../../../config/logger')(_0x74de('0x9'));var loggerPredictive=require(_0x74de('0x7'))(_0x74de('0xa'));var loggerPredictiveCalls=require(_0x74de('0x7'))(_0x74de('0xb'));var loggerSyncQueueSummary=require(_0x74de('0x7'))(_0x74de('0xc'));var ami=require(_0x74de('0xd'));config[_0x74de('0xe')]=_[_0x74de('0xf')](config['redis'],{'host':_0x74de('0x10'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x74de('0xe')]));var cmHopper=require(_0x74de('0x11'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0x74de('0x12'));var voiceQueueRt=require(_0x74de('0x13'));var Action=require(_0x74de('0x14'));var History=require(_0x74de('0x15'));var Final=require(_0x74de('0x16'));var AgentComplete=require(_0x74de('0x17'));var QueueCallerAbandon=require('./queueCallerAbandon');var Hangup=require(_0x74de('0x18'));var ipAgi=process['env'][_0x74de('0x19')]||_0x74de('0x1a');var strategy={'rrmemory':_0x74de('0x1b'),'roundrobin':'roundrobin'};var Sequence=function(){};Sequence[_0x74de('0x1c')][_0x74de('0x1d')]=function(_0x560c60){this[_0x74de('0x1e')]=this[_0x74de('0x1e')]?this[_0x74de('0x1e')][_0x74de('0x1f')](_0x560c60):_0x560c60();};function Dialer(_0x380c9c,_0xc337af){this[_0x74de('0x20')]=new Sequence();this['preview']=_0xc337af;this['voiceQueues']=_0x380c9c[_0x74de('0x21')];this[_0x74de('0x22')]=_0x380c9c[_0x74de('0x22')];this[_0x74de('0x23')]=_0x380c9c[_0x74de('0x23')];this[_0x74de('0x24')]=_0x380c9c['trunks'];this[_0x74de('0x25')]=config[_0x74de('0x25')]||0x2;this[_0x74de('0x26')]={};this['actions']={};this[_0x74de('0x27')]={};this[_0x74de('0x28')]={};this[_0x74de('0x29')]={};this[_0x74de('0x2a')]={};this['startProgressive']={};this['ivrOriginated']={};this['queueBooked']={};this['queueBookedRR']={};ami['on'](_0x74de('0x2b'),this[_0x74de('0x2c')]['bind'](this));ami['on']('queuecallerabandon',this[_0x74de('0x2d')][_0x74de('0x2e')](this));ami['on'](_0x74de('0x2f'),this['syncOriginateResponse']['bind'](this));ami['on']('agentcomplete',this['syncAgentComplete'][_0x74de('0x2e')](this));ami['on'](_0x74de('0x30'),this[_0x74de('0xc')][_0x74de('0x2e')](this));ami['on'](_0x74de('0x31'),this[_0x74de('0x32')][_0x74de('0x2e')](this));ami['on'](_0x74de('0x33'),this[_0x74de('0x34')][_0x74de('0x2e')](this));ami['on'](_0x74de('0x35'),this[_0x74de('0x36')][_0x74de('0x2e')](this));ami['on'](_0x74de('0x37'),this[_0x74de('0x38')][_0x74de('0x2e')](this));ami['on']('queuestatuscomplete',this['syncQueueStatusComplete'][_0x74de('0x2e')](this));this[_0x74de('0x39')]();this[_0x74de('0x3a')]();}function isNotNull(_0x5766e2){return _0x5766e2!==null&&!_[_0x74de('0x3b')](_0x5766e2);}function checkIsLoggedIn(_0x144e73,_0x4f70e2){return function(){if(_0x4f70e2<=0x0){_0x144e73[_0x74de('0x3c')]=_0x74de('0x3d');throw _0x144e73[_0x74de('0x3e')]+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0x3193e1){return _0x3193e1;}function checkIsActive(_0x226e8d,_0x39c45c){return function(){if(!isActive(_0x39c45c)){_0x226e8d[_0x74de('0x3c')]=_0x74de('0x3f');throw _0x226e8d[_0x74de('0x3e')]+_0x74de('0x40');}};}function checkInterval(_0x47d140){return function(){if(!isNotNull(_0x47d140['Interval'])){_0x47d140[_0x74de('0x3c')]=_0x74de('0x41');throw _0x47d140[_0x74de('0x3e')]+_0x74de('0x42');}if(!isNotNull(_0x47d140[_0x74de('0x43')][_0x74de('0x44')])){_0x47d140[_0x74de('0x3c')]='INTERVAL_IS_NULL';throw _0x47d140[_0x74de('0x3e')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_['isEmpty'](_0x47d140[_0x74de('0x43')]['Intervals']))){_0x47d140[_0x74de('0x3c')]=_0x74de('0x41');throw _0x47d140[_0x74de('0x3e')]+'\x20INTERVAL_IS_NULL';}};}function msgResponse(_0x3b4778,_0xfaa91,_0x5a05bb){return{'action':_0x3b4778,'response':_0xfaa91,'message':_0x5a05bb,'stack':_0x5a05bb};}function myreject(_0x57c9fa){return function(_0x2283b1){return _0x57c9fa(msgResponse(_0x74de('0x45'),'Error',JSON[_0x74de('0x46')](_0x2283b1)));};}function getSeconds(_0x2bacf1,_0x5e0151){var _0x2c8b02=moment(_0x2bacf1)[_0x74de('0x47')](0x0);var _0x13ae0d=moment(_0x5e0151)[_0x74de('0x47')](0x0);return _0x2c8b02['diff'](_0x13ae0d,_0x74de('0x48'));}function emit(_0x4f6921,_0x3dc9fc,_0x5f2450){io['to'](_0x4f6921)['emit'](_0x3dc9fc,_0x5f2450);}function emitVoiceQueueSummary(_0xe9bea3){if(_0xe9bea3['type']==='outbound'){var _0x2cdfeb={'id':_0xe9bea3['id'],'name':_0xe9bea3[_0x74de('0x3e')],'strategy':_0xe9bea3['strategy'],'answered':_0xe9bea3[_0x74de('0x49')],'available':_0xe9bea3[_0x74de('0x4a')],'loggedIn':_0xe9bea3[_0x74de('0x4b')],'pTalking':_0xe9bea3['pTalking'],'sumBillable':_0xe9bea3['sumBillable'],'sumDuration':_0xe9bea3[_0x74de('0x4c')],'sumHoldTime':_0xe9bea3[_0x74de('0x4d')]||0x0,'talking':_0xe9bea3[_0x74de('0x4e')],'total':_0xe9bea3[_0x74de('0x4f')],'type':_0xe9bea3[_0x74de('0x50')],'unmanaged':_0xe9bea3[_0x74de('0x51')],'abandoned':_0xe9bea3[_0x74de('0x52')],'waiting':_0xe9bea3[_0x74de('0x53')],'loggedInDb':_0xe9bea3[_0x74de('0x54')],'dialActive':_0xe9bea3['dialActive'],'dialMethod':_0xe9bea3['dialMethod'],'dialOriginateCallerIdName':_0xe9bea3['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0xe9bea3[_0x74de('0x55')],'dialOriginateTimeout':_0xe9bea3[_0x74de('0x56')],'dialPrefix':_0xe9bea3[_0x74de('0x57')],'outboundAnswerAgiCallsDay':_0xe9bea3[_0x74de('0x58')],'outboundAnswerCallsDay':_0xe9bea3[_0x74de('0x59')],'outboundBlacklistCallsDay':_0xe9bea3[_0x74de('0x5a')],'outboundBusyCallsDay':_0xe9bea3[_0x74de('0x5b')],'outboundCongestionCallsDay':_0xe9bea3[_0x74de('0x5c')],'outboundDropCallsDayACS':_0xe9bea3[_0x74de('0x5d')],'outboundDropCallsDayCallersExit':_0xe9bea3[_0x74de('0x5e')],'outboundDropCallsDayTimeout':_0xe9bea3[_0x74de('0x5f')],'outboundNoAnswerCallsDay':_0xe9bea3[_0x74de('0x60')],'outboundNoSuchCallsDay':_0xe9bea3['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0xe9bea3[_0x74de('0x61')],'outboundReCallsDay':_0xe9bea3[_0x74de('0x62')],'outboundRejectCallsDay':_0xe9bea3[_0x74de('0x63')],'outboundUnknownCallsDay':_0xe9bea3[_0x74de('0x64')],'predictiveIntervalAnsweredCalls':_0xe9bea3[_0x74de('0x65')],'predictiveIntervalAvgHoldtime':_0xe9bea3[_0x74de('0x66')],'predictiveIntervalAvgTalktime':_0xe9bea3[_0x74de('0x67')],'predictiveIntervalDroppedCallsCallersExit':_0xe9bea3[_0x74de('0x68')],'predictiveIntervalDroppedCallsTimeout':_0xe9bea3[_0x74de('0x69')],'predictiveIntervalErlangCalls':_0xe9bea3['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0xe9bea3[_0x74de('0x6a')],'predictiveIntervalHitRate':_0xe9bea3[_0x74de('0x6b')],'predictiveIntervalMultiplicativeFactor':_0xe9bea3[_0x74de('0x6c')],'predictiveIntervalPauses':_0xe9bea3[_0x74de('0x6d')],'predictiveIntervalAvailable':_0xe9bea3[_0x74de('0x6e')],'predictiveIntervalTotalCalls':_0xe9bea3[_0x74de('0x6f')],'message':_0xe9bea3['message'],'originated':_0xe9bea3['originated'],'erlangCalls':_0xe9bea3['erlangCalls'],'erlangCallToSecond':_0xe9bea3[_0x74de('0x70')],'erlangAbandonmentRate':_0xe9bea3[_0x74de('0x71')],'erlangBusyFactor':_0xe9bea3['erlangBusyFactor'],'startPredictive':_0xe9bea3['startPredictive'],'startProgressive':_0xe9bea3[_0x74de('0x72')]};if(_0xe9bea3['Trunk']){_0x2cdfeb[_0x74de('0x73')]={'id':_0xe9bea3[_0x74de('0x73')]['id'],'name':_0xe9bea3[_0x74de('0x73')]['name'],'active':_0xe9bea3[_0x74de('0x73')][_0x74de('0x74')],'callerid':_0xe9bea3[_0x74de('0x73')][_0x74de('0x75')]};}if(_0xe9bea3[_0x74de('0x43')]){_0x2cdfeb[_0x74de('0x43')]={'id':_0xe9bea3[_0x74de('0x43')]['id'],'name':_0xe9bea3[_0x74de('0x43')]['name']};}var _0x364043=md5(JSON[_0x74de('0x46')](_0x2cdfeb));if(_0xe9bea3['md5']!==_0x364043){_0xe9bea3[_0x74de('0x4')]=_0x364043;emit(util[_0x74de('0x76')](_0x74de('0x77'),_0x2cdfeb[_0x74de('0x3e')]),'voice_queue:save',_0x2cdfeb);}}}function emitCampaignSummary(_0x590422){if(_0x590422['type']===_0x74de('0x78')){emit(util[_0x74de('0x76')](_0x74de('0x79'),_0x590422[_0x74de('0x3e')]),_0x74de('0x7a'),_0x590422);}}function checkGetDataPredictive(_0x16526a){if(isNotNull(_0x16526a)&&!_[_0x74de('0x7b')](_0x16526a)){loggerPredictive[_0x74de('0x7c')](_0x74de('0x7d'));loggerPredictive['info'](_0x74de('0x7e'),_0x16526a[_0x74de('0x6f')]);loggerPredictive[_0x74de('0x7c')](_0x74de('0x7f'),_0x16526a[_0x74de('0x65')]);loggerPredictive[_0x74de('0x7c')](_0x74de('0x80'),_0x16526a[_0x74de('0x69')]);loggerPredictive[_0x74de('0x7c')](_0x74de('0x81'),_0x16526a[_0x74de('0x68')]);loggerPredictive['info']('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x16526a[_0x74de('0x66')]);loggerPredictive[_0x74de('0x7c')]('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x16526a[_0x74de('0x67')]);loggerPredictive[_0x74de('0x7c')](_0x74de('0x82'));if(_0x16526a[_0x74de('0x6f')]>0x0){if(!_[_0x74de('0x3b')](_0x16526a[_0x74de('0x67')])&&_0x16526a[_0x74de('0x67')]>0x0){return!![];}loggerPredictive[_0x74de('0x7c')](_0x74de('0x83'));if(!_[_0x74de('0x3b')](_0x16526a[_0x74de('0x66')])&&_0x16526a[_0x74de('0x66')]>0x0){return!![];}loggerPredictive[_0x74de('0x7c')](_0x74de('0x84'));}else{loggerPredictive[_0x74de('0x7c')]('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0x74de('0x7c')](_0x74de('0x85'));}return![];}function mergeDataErlangB(_0x5c0da1){return function(_0x27b3f5){loggerPredictive[_0x74de('0x7c')](_0x74de('0x86'));loggerPredictive[_0x74de('0x7c')](_0x74de('0x87'),_0x27b3f5['erlangCalls']);loggerPredictive[_0x74de('0x7c')](_0x74de('0x88'),_0x27b3f5[_0x74de('0x70')]);loggerPredictive[_0x74de('0x7c')](_0x74de('0x89'),_0x27b3f5['erlangAbandonmentRate']);loggerPredictive[_0x74de('0x7c')](_0x74de('0x8a'),_0x27b3f5[_0x74de('0x8b')]);loggerPredictive['info'](_0x74de('0x89'),_0x27b3f5['erlangAbandonmentRate']);loggerPredictive['info'](_0x74de('0x82'));_[_0x74de('0x8c')](_0x5c0da1,_0x27b3f5);};}function getDiff(_0xc0a61d){var _0x58cb8e=moment()[_0x74de('0x47')](0x0);var _0x1b797b=moment(_0xc0a61d)[_0x74de('0x47')](0x0);return _0x58cb8e[_0x74de('0x8d')](_0x1b797b,_0x74de('0x48'));}function ifInterval(_0x502af4,_0x28f2b9){if(_[_0x74de('0x3b')](_0x28f2b9)){return![];}return getDiff(_0x28f2b9)<_0x502af4*0x3c;}function freeVariablesPredictive(_0x406c33){if(isNotNull(_0x406c33)){if(!_['isUndefined'](_0x406c33['startProgressive'])){_0x406c33[_0x74de('0x72')]=undefined;loggerPredictive[_0x74de('0x7c')](_0x406c33[_0x74de('0x3e')],'clearing\x20variable\x20start\x20progressive');}if(!_[_0x74de('0x3b')](_0x406c33[_0x74de('0x2a')])){_0x406c33[_0x74de('0x2a')]=undefined;loggerPredictive['info'](_0x406c33[_0x74de('0x3e')],'clearing\x20variable\x20start\x20predictive');}if(!_[_0x74de('0x3b')](_0x406c33[_0x74de('0x8e')])){clearInterval(_0x406c33[_0x74de('0x8e')]);_0x406c33[_0x74de('0x8e')]=undefined;loggerPredictive[_0x74de('0x7c')](_0x406c33[_0x74de('0x3e')],'clearing\x20variable\x20handle\x20predictive');}}}function erlangb(_0x27ee1f,_0x2c4971){if(_0x2c4971===0x0){return 0x0;}var _0x4b9a5f=0x1;for(var _0x3aaffc=0x1;_0x3aaffc<=_0x2c4971;_0x3aaffc+=0x1){_0x4b9a5f=0x1+_0x4b9a5f*_0x3aaffc/_0x27ee1f;}return 0x1/_0x4b9a5f;}function isVoiceQueueOutbound(_0x2e2d6c){return _0x2e2d6c===_0x74de('0x8f');}function isNotPreview(_0x222d78){return _0x222d78!==_0x74de('0x90');}function isCampaignIvr(_0x503367){return _0x503367===_0x74de('0x78');}function getCallerId(_0x14dfff,_0x3de36f,_0x114f02){if(!_[_0x74de('0x3b')](_0x114f02)&&typeof _0x114f02===_0x74de('0x91')&&!_[_0x74de('0x7b')](_0x114f02)){if(!_['isUndefined'](_0x3de36f)&&typeof _0x3de36f==='string'&&!_[_0x74de('0x7b')](_0x3de36f)){return util[_0x74de('0x76')](_0x74de('0x92'),_0x3de36f,_0x114f02);}return util[_0x74de('0x76')](_0x74de('0x92'),_0x114f02,_0x114f02);}if(!_[_0x74de('0x3b')](_0x14dfff)&&typeof _0x14dfff===_0x74de('0x91')&&!_[_0x74de('0x7b')](_0x14dfff)){return _0x14dfff;}return _0x74de('0x93');}function loggerCatchQueueSummary(_0x4ad149,_0x2fcd73){return function(_0x352f04){freeVariablesPredictive(_0x2fcd73);emitVoiceQueueSummary(_0x2fcd73);emitCampaignSummary(_0x2fcd73);loggerSyncQueueSummary[_0x74de('0x94')](_0x4ad149,util[_0x74de('0x95')](_0x352f04,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x159357,_0x5b060f){return function(_0x4f84cd){loggerPredictive[_0x74de('0x94')](_0x5b060f[_0x74de('0x3e')],_0x159357);loggerPredictive[_0x74de('0x94')](_0x4f84cd['stack']);freeVariablesPredictive(_0x5b060f);};}function loggerCatch(_0x5ce577){return function(_0x4292bd){logger['error'](_0x5ce577,util[_0x74de('0x95')](_0x4292bd,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x4e883e){return _0x4e883e&&!_['isUndefined'](_0x4e883e)&&_0x4e883e[_0x74de('0x96')]>0x0;}function decremetOriginate(_0x2278a3){if(!_[_0x74de('0x3b')](_0x2278a3)&&_0x2278a3!==null){if(typeof _0x2278a3[_0x74de('0x97')]!==_0x74de('0x98')){if(_0x2278a3[_0x74de('0x97')]>0x0){_0x2278a3[_0x74de('0x97')]-=0x1;}else{logger['error'](_0x74de('0x99'));}}}else{logger[_0x74de('0x94')](_0x74de('0x9a'));}}function checkContactLowerLimitOriginate(_0x440079,_0x205bf5,_0x4c39e3){if(_0x205bf5>_0x4c39e3){for(var _0xedb7e0=0x0;_0xedb7e0<_0x205bf5-_0x4c39e3;_0xedb7e0+=0x1){decremetOriginate(_0x440079);}}}function loggerGetContactDialer(_0x3f84fc,_0x2fb49f,_0x311bcd){return function(_0x467b87){checkContactLowerLimitOriginate(_0x2fb49f,_0x311bcd,0x0);logger[_0x74de('0x94')](_0x3f84fc,util[_0x74de('0x95')](_0x467b87,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x835ccc){return function(_0x45093d){if(isNotNull(_0x45093d)&&isNotNull(_0x45093d[0x0])){if(_0x45093d[0x0][_0x74de('0x9b')]>0x0){_0x835ccc[_0x74de('0x3c')]=_0x74de('0x9c');logger[_0x74de('0x7c')](_0x74de('0x9d')+_0x835ccc[_0x74de('0x3e')],_0x45093d[0x0][_0x74de('0x9b')],_0x74de('0x9e'));}else{_0x835ccc[_0x74de('0x3c')]=_0x74de('0x9f');logger[_0x74de('0x7c')](_0x74de('0xa0')+_0x835ccc['name']);}}};}function notSendMessagesQueue(_0x16bd8b){if(_0x16bd8b[_0x74de('0xa1')]){freeVariablesPredictive(_0x16bd8b);if(_0x16bd8b[_0x74de('0x97')]===0x0&&_0x16bd8b[_0x74de('0x4e')]===0x0&&_0x16bd8b[_0x74de('0x53')]===0x0&&(_0x16bd8b[_0x74de('0xa2')]||0x0)===0x0){_0x16bd8b[_0x74de('0xa1')]=![];_0x16bd8b[_0x74de('0x4a')]=0x0;_0x16bd8b[_0x74de('0x3c')]='NOT_ACTIVE';loggerSyncQueueSummary['error']('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x16bd8b[_0x74de('0x3e')],'is\x20not\x20active');}else{_0x16bd8b['message']=_0x74de('0xa3');loggerSyncQueueSummary[_0x74de('0x94')](_0x74de('0xa4'),_0x16bd8b[_0x74de('0x3e')],_0x74de('0xa5'));}emitVoiceQueueSummary(_0x16bd8b);}}function notSendMessagesCampaign(_0x1b2c02){if(_0x1b2c02[_0x74de('0xa1')]){if(_0x1b2c02['originated']===0x0){_0x1b2c02[_0x74de('0xa1')]=![];_0x1b2c02[_0x74de('0x3c')]='NOT_ACTIVE';loggerSyncQueueSummary[_0x74de('0x94')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x1b2c02[_0x74de('0x3e')],'is\x20not\x20active');}else{_0x1b2c02[_0x74de('0x3c')]='IS_DISACTIVED';loggerSyncQueueSummary[_0x74de('0x94')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x1b2c02[_0x74de('0x3e')],_0x74de('0xa5'));}emitCampaignSummary(_0x1b2c02);}}function createObjHistory(_0x57d43d,_0x9d6342,_0x524eff,_0x1ef8ab,_0x2f84ba){_0x57d43d[_0x74de('0x3c')]=_0x524eff;var _0x457f0a=new Action(_0x57d43d,_0x9d6342);var _0x25721=new History(_0x457f0a);_0x25721[_0x74de('0xa6')]=_0x1ef8ab;_0x25721[_0x74de('0xa7')]=_0x2f84ba;_0x25721[_0x74de('0xa8')]=_0x457f0a['starttime'];return _0x25721;}Dialer[_0x74de('0x1c')][_0x74de('0x3a')]=function(){var _0x255fd1=this;setInterval(function(){_0x255fd1['clearZombieChannels'](_0x255fd1['uniqueId'],_0x74de('0xa9'));_0x255fd1[_0x74de('0xaa')](_0x255fd1[_0x74de('0xab')],'[actions]');},0x32c8);};Dialer[_0x74de('0x1c')]['clearZombieChannels']=function(_0xc66941,_0x30d0d4){var _0x3155fc=this;for(var _0x1988b2 in _0xc66941){if(typeof _0xc66941[_0x1988b2]!==_0x74de('0x98')){this[_0x74de('0x20')][_0x74de('0x1d')](function(){if(!_[_0x74de('0xac')](_0xc66941[_0x1988b2])){return ami[_0x74de('0xad')]({'action':_0x74de('0xae'),'channel':_0xc66941[_0x1988b2][_0x74de('0xaf')]})[_0x74de('0xb0')](function(_0x3e62c1){if(_0x3e62c1[_0x74de('0x3c')]==='No\x20such\x20channel'){setTimeout(function(){if(_0xc66941[_0x1988b2]&&_0xc66941[_0x1988b2][_0x74de('0x50')]!=='ivr'){_0x3155fc[_0x74de('0xb1')](_0x3155fc[_0x74de('0x21')][_0xc66941[_0x1988b2]['queue']]);logger[_0x74de('0x94')](_0x74de('0xb2'),_0x30d0d4,_0x1988b2,_0xc66941[_0x1988b2][_0x74de('0xb3')]);delete _0xc66941[_0x1988b2];}if(_0xc66941[_0x1988b2]&&_0xc66941[_0x1988b2]['type']===_0x74de('0x78')){_0x3155fc[_0x74de('0xb1')](_0x3155fc[_0x74de('0x22')][_0xc66941[_0x1988b2][_0x74de('0xb3')]]);logger[_0x74de('0x94')](_0x74de('0xb4'),_0x30d0d4,_0x1988b2,_0xc66941[_0x1988b2][_0x74de('0xb3')]);delete _0xc66941[_0x1988b2];}},0x2328);}});}});}}};Dialer[_0x74de('0x1c')]['countReScheduled']=function(_0x37c52d){return BPromise[_0x74de('0xb5')]()['then'](cmHopper[_0x74de('0xb6')](_0x37c52d))[_0x74de('0xb0')](loggerCatch(_0x74de('0xb7')));};Dialer['prototype'][_0x74de('0xb8')]=function(_0x5569cf){return BPromise['resolve']()[_0x74de('0xb9')](cmHopperBlack[_0x74de('0xb8')](_0x5569cf))[_0x74de('0xb0')](loggerCatch('[checkIsBlackList]\x20'));};Dialer[_0x74de('0x1c')]['checkIsBlackListIvr']=function(_0x1b8ec5){return BPromise[_0x74de('0xb5')]()['then'](cmHopperBlack['checkIsBlackListIvr'](_0x1b8ec5))[_0x74de('0xb0')](loggerCatch(_0x74de('0xba')));};Dialer['prototype']['averageHandleTime']=function(_0x4d7a37){return BPromise[_0x74de('0xb5')]()[_0x74de('0xb9')](cmHopperHistory['avgHandleTime'](_0x4d7a37))[_0x74de('0xb0')](loggerCatch('[averageHandleTime]\x20'));};Dialer[_0x74de('0x1c')][_0x74de('0xbb')]=function(_0x1cf302){return BPromise[_0x74de('0xb5')]()[_0x74de('0xb9')](cmHopper['rescheduleContact'](_0x1cf302))[_0x74de('0xb0')](loggerCatch(_0x74de('0xbc')));};Dialer['prototype']['unlockContact']=function(_0x5e895d,_0xcadcc,_0x45a794){return BPromise[_0x74de('0xb5')]()[_0x74de('0xb9')](cmHopper['unlockContact'](_0x5e895d,_0xcadcc,_0x45a794))[_0x74de('0xb0')](loggerCatch(_0x74de('0xbd')));};Dialer['prototype']['getContactDialer']=function(_0x1ab161,_0x560512,_0x759dac,_0x39e71a,_0x443075){return BPromise[_0x74de('0xb5')]()[_0x74de('0xb9')](cmHopper[_0x74de('0xbe')](_0x1ab161,_0x560512,_0x759dac,_0x39e71a))[_0x74de('0xb0')](function(_0x7d9cb8){_0x443075[_0x74de('0xbf')]-=_0x759dac;_0x443075[_0x74de('0xbf')]=_0x443075[_0x74de('0xbf')]>0x0?_0x443075[_0x74de('0xbf')]:0x0;loggerCatch(_0x74de('0xc0'))(_0x7d9cb8);});};Dialer[_0x74de('0x1c')][_0x74de('0xc1')]=function(_0x3b398c,_0x37a4e9,_0x1dd0d9,_0x160c6a){return BPromise[_0x74de('0xb5')]()[_0x74de('0xb9')](cmHopper[_0x74de('0xc1')](_0x3b398c,_0x37a4e9,_0x1dd0d9))['catch'](function(_0xd8d046){_0x160c6a['temp']-=_0x37a4e9;_0x160c6a[_0x74de('0xbf')]=_0x160c6a['temp']>0x0?_0x160c6a[_0x74de('0xbf')]:0x0;loggerCatch(_0x74de('0xc2'))(_0xd8d046);});};Dialer['prototype'][_0x74de('0xc3')]=function(_0x629a06){return BPromise[_0x74de('0xb5')]()[_0x74de('0xb9')](voiceQueueRt[_0x74de('0xc3')](_0x629a06))[_0x74de('0xb0')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer['prototype'][_0x74de('0xc4')]=function(_0x294ded){return BPromise['resolve']()[_0x74de('0xb9')](cmHopper[_0x74de('0xc4')](_0x294ded))[_0x74de('0xb0')](loggerCatch(_0x74de('0xc5')));};Dialer[_0x74de('0x1c')]['createHistory']=function(_0x2fdea5){return BPromise[_0x74de('0xb5')]()[_0x74de('0xb9')](cmHopperHistory[_0x74de('0xc6')](_0x2fdea5))[_0x74de('0xb0')](loggerCatch(_0x74de('0xc7')));};Dialer[_0x74de('0x1c')][_0x74de('0xb1')]=function(_0x3ddcb6){if(!_['isUndefined'](_0x3ddcb6)&&_0x3ddcb6!==null){if(typeof _0x3ddcb6['originated']!==_0x74de('0x98')){if(_0x3ddcb6['originated']>0x0){_0x3ddcb6[_0x74de('0x97')]-=0x1;}else{logger[_0x74de('0x94')](_0x74de('0xc8'));}}}else{logger['error']('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer[_0x74de('0x1c')][_0x74de('0xc9')]=function(_0x313566,_0x247512){var _0x4a0472=this;return function(_0x31c17c){_0x4a0472[_0x74de('0xb1')](_0x247512);logger['error'](_0x313566,util['inspect'](_0x31c17c,{'showHidden':![],'depth':null}));};};Dialer[_0x74de('0x1c')][_0x74de('0xca')]=function(_0x5cea62,_0x138f75,_0x58535c){var _0x1d791c={'state':0x19,'statedesc':_0x74de('0xcb')};this[_0x74de('0xb1')](_0x138f75);this['saveInDb'](_[_0x74de('0x8c')](_0x1d791c,_['pick'](_0x58535c,[_0x74de('0xcc'),'ListId',_0x74de('0xcd'),_0x74de('0xce'),_0x74de('0xcf')])),_0x74de('0xd0'),_0x74de('0xd1'));logger[_0x74de('0x94')](_0x5cea62);};Dialer[_0x74de('0x1c')][_0x74de('0xd2')]=function(_0x1b61e6){return _0x1b61e6==='Success';};Dialer[_0x74de('0x1c')]['isTrunkReachable']=function(_0x4c4e4c){return!_[_0x74de('0x3b')](_0x4c4e4c)&&_0x4c4e4c&&!_['isUndefined'](_0x4c4e4c[_0x74de('0x3e')])&&!_['isUndefined'](_0x4c4e4c[_0x74de('0x74')])&&_0x4c4e4c[_0x74de('0x74')]&&(this[_0x74de('0x24')][util[_0x74de('0x76')](_0x74de('0xd3'),_0x4c4e4c[_0x74de('0x3e')])]['status']==='reachable'||this[_0x74de('0x24')][util[_0x74de('0x76')](_0x74de('0xd3'),_0x4c4e4c[_0x74de('0x3e')])][_0x74de('0xae')]===_0x74de('0xd4'));};Dialer['prototype'][_0x74de('0xd5')]=function(_0x18bb88,_0x1f5e9d,_0x377eaa){this[_0x74de('0xc6')](_0x18bb88)['catch'](loggerCatch(_0x1f5e9d));this[_0x74de('0xc4')](_0x18bb88)[_0x74de('0xb0')](loggerCatch(_0x377eaa));};Dialer[_0x74de('0x1c')][_0x74de('0x36')]=function(_0x5d2c2f){var _0x2c77bb=this['uniqueId'][_0x5d2c2f[_0x74de('0xd6')]];var _0x5b3232;if(!_['isNil'](_0x5d2c2f)&&!_[_0x74de('0xac')](_0x5d2c2f['variable'])&&!_[_0x74de('0xac')](_0x5d2c2f[_0x74de('0xd7')]['amdstatus'])&&_0x5d2c2f[_0x74de('0xd8')]===_0x74de('0xd9')&&_0x2c77bb){if(_0x2c77bb[_0x74de('0x50')]!==_0x74de('0x78')&&this[_0x74de('0x21')][_0x2c77bb['queue']][_0x74de('0xda')]&&_0x5d2c2f['value']===_0x74de('0xdb')){delete this[_0x74de('0x28')][_0x5d2c2f['uniqueid']];this['updateOriginated'](this['voiceQueues'][_0x2c77bb['queue']]);this[_0x74de('0x21')][_0x2c77bb[_0x74de('0xb3')]]['outboundAnswerCallsDay']+=0x1;this[_0x74de('0x21')][_0x2c77bb[_0x74de('0xb3')]]['outboundAnswerAgiCallsDay']+=0x1;_0x5b3232=new Hangup(_0x2c77bb,_0x5d2c2f);_0x5b3232[_0x74de('0xa6')]=0x12;_0x5b3232[_0x74de('0xa7')]=_0x74de('0xdc');_0x5b3232[_0x74de('0xdd')]='AMD';ami['emit'](_0x74de('0xde'),ut[_0x74de('0xdf')](_0x5b3232,'amd'));this[_0x74de('0xd5')](_0x5b3232,_0x74de('0xe0'),_0x74de('0xe1'));}if(_0x2c77bb[_0x74de('0x50')]!==_0x74de('0x78')&&this[_0x74de('0x21')][_0x2c77bb[_0x74de('0xb3')]]['dialAMDActive']&&_0x5d2c2f['value']===_0x74de('0xe2')){var _0x3237dc=this;return new BPromise(function(_0x151426,_0x58db46){delete _0x3237dc[_0x74de('0x28')][_0x5d2c2f[_0x74de('0xd6')]];_0x3237dc[_0x74de('0xb1')](_0x3237dc[_0x74de('0x21')][_0x2c77bb['queue']]);_0x3237dc[_0x74de('0x21')][_0x2c77bb[_0x74de('0xb3')]][_0x74de('0x59')]+=0x1;_0x3237dc[_0x74de('0x21')][_0x2c77bb[_0x74de('0xb3')]][_0x74de('0x58')]+=0x1;var _0x55c233=_0x3237dc[_0x74de('0x21')][_0x2c77bb[_0x74de('0xb3')]];var _0x44af51=new Hangup(_0x2c77bb,_0x5d2c2f);_0x44af51[_0x74de('0xa6')]=0x13;_0x44af51[_0x74de('0xa7')]=_0x74de('0xe3');_0x44af51[_0x74de('0xdd')]='AMD';_0x44af51['countmachineretry']+=0x1;_0x44af51[_0x74de('0xe4')]+=0x1;_0x44af51[_0x74de('0xe5')]=!![];ami[_0x74de('0xe6')]('custom:amd',ut[_0x74de('0xdf')](_0x44af51,_0x74de('0xe5')));_0x3237dc[_0x74de('0xc6')](_0x44af51)[_0x74de('0xb0')](loggerCatch(_0x74de('0xe7')));if(_0x44af51[_0x74de('0xe8')]+_0x44af51[_0x74de('0xe9')]+_0x44af51[_0x74de('0xea')]+_0x44af51[_0x74de('0xeb')]+_0x44af51[_0x74de('0xec')]+_0x44af51[_0x74de('0xed')]+_0x44af51[_0x74de('0xee')]+_0x44af51['countagentrejectretry']>=_0x55c233[_0x74de('0xef')]){_0x3237dc[_0x74de('0xf0')](_0x44af51,_0x151426,_0x58db46,_0x74de('0xf1'));}else{if(_0x44af51['countmachineretry']>=_0x55c233[_0x74de('0xf2')]){_0x3237dc[_0x74de('0xf3')](_0x44af51,_0x151426,_0x58db46,_0x74de('0xf4'));}else{_0x3237dc[_0x74de('0xbb')]({'active':![],'countmachineretry':_0x44af51[_0x74de('0xee')],'scheduledat':moment()['add'](_0x55c233[_0x74de('0xf5')],_0x74de('0xf6'))[_0x74de('0x76')](_0x74de('0xf7')),'ContactId':_0x44af51[_0x74de('0xcc')],'ListId':_0x44af51[_0x74de('0xf8')],'VoiceQueueId':_0x44af51[_0x74de('0xce')]||undefined,'CampaignId':_0x44af51[_0x74de('0xcf')]||undefined})[_0x74de('0xb0')](loggerCatch('[rescheduleContact][Machine]'));_0x151426({'reschedule':0x1});}}});}if(_0x2c77bb[_0x74de('0x50')]==='ivr'&&this[_0x74de('0x22')][_0x2c77bb[_0x74de('0xb3')]][_0x74de('0xda')]&&_0x5d2c2f[_0x74de('0xf9')]===_0x74de('0xdb')){delete this[_0x74de('0x28')][_0x5d2c2f['uniqueid']];this[_0x74de('0xb1')](this[_0x74de('0x22')][_0x2c77bb[_0x74de('0xb3')]]);_0x5b3232=new Hangup(_0x2c77bb,_0x5d2c2f);_0x5b3232['state']=0x12;_0x5b3232[_0x74de('0xa7')]=_0x74de('0xdc');_0x5b3232[_0x74de('0xdd')]=_0x74de('0xfa');ami['emit'](_0x74de('0xde'),ut[_0x74de('0xdf')](_0x5b3232,_0x74de('0xe5')));this[_0x74de('0xd5')](_0x5b3232,'[syncHangupInAMDIvr][createHistory]',_0x74de('0xfb'));}if(_0x2c77bb[_0x74de('0x50')]===_0x74de('0x78')&&this[_0x74de('0x22')][_0x2c77bb['queue']][_0x74de('0xda')]&&_0x5d2c2f[_0x74de('0xf9')]==='MACHINE'){var _0x3237dc=this;return new BPromise(function(_0x3be13f,_0x4cda29){delete _0x3237dc[_0x74de('0x28')][_0x5d2c2f[_0x74de('0xd6')]];_0x3237dc[_0x74de('0xb1')](_0x3237dc[_0x74de('0x22')][_0x2c77bb[_0x74de('0xb3')]]);_0x3237dc['campaigns'][_0x2c77bb['queue']][_0x74de('0x59')]+=0x1;_0x3237dc[_0x74de('0x22')][_0x2c77bb[_0x74de('0xb3')]][_0x74de('0x58')]+=0x1;var _0x54b661=_0x3237dc['campaigns'][_0x2c77bb[_0x74de('0xb3')]];var _0x31f27d=new Hangup(_0x2c77bb,_0x5d2c2f);_0x31f27d[_0x74de('0xa6')]=0x13;_0x31f27d[_0x74de('0xa7')]=_0x74de('0xe3');_0x31f27d[_0x74de('0xdd')]=_0x74de('0xfa');_0x31f27d['countmachineretry']+=0x1;_0x31f27d[_0x74de('0xe4')]+=0x1;_0x31f27d[_0x74de('0xe5')]=!![];ami[_0x74de('0xe6')](_0x74de('0xde'),ut[_0x74de('0xdf')](_0x31f27d,'amd'));_0x3237dc[_0x74de('0xc6')](_0x31f27d)['catch'](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x31f27d[_0x74de('0xe8')]+_0x31f27d['countcongestionretry']+_0x31f27d[_0x74de('0xea')]+_0x31f27d[_0x74de('0xeb')]+_0x31f27d[_0x74de('0xec')]+_0x31f27d[_0x74de('0xed')]+_0x31f27d[_0x74de('0xee')]+_0x31f27d[_0x74de('0xfc')]>=_0x54b661['dialGlobalMaxRetry']){_0x3237dc[_0x74de('0xf0')](_0x31f27d,_0x3be13f,_0x4cda29,_0x74de('0xf1'));}else{if(_0x31f27d['countmachineretry']>=_0x54b661[_0x74de('0xf2')]){_0x3237dc['createStateFinal'](_0x31f27d,_0x3be13f,_0x4cda29,_0x74de('0xf4'));}else{_0x3237dc[_0x74de('0xbb')]({'active':![],'countmachineretry':_0x31f27d[_0x74de('0xee')],'scheduledat':moment()['add'](_0x54b661[_0x74de('0xf5')],'minutes')[_0x74de('0x76')](_0x74de('0xf7')),'ContactId':_0x31f27d[_0x74de('0xcc')],'ListId':_0x31f27d[_0x74de('0xf8')],'VoiceQueueId':_0x31f27d[_0x74de('0xce')]||undefined,'CampaignId':_0x31f27d[_0x74de('0xcf')]||undefined})[_0x74de('0xb0')](loggerCatch('[rescheduleContact][Machine]'));_0x3be13f({'reschedule':0x1});}}});}}};Dialer[_0x74de('0x1c')][_0x74de('0x32')]=function(_0x6fa99c){var _0x2e0dc3=this[_0x74de('0x28')][_0x6fa99c['uniqueid']];var _0x717b51=this;var _0x1f3f52;if(_0x2e0dc3&&_0x2e0dc3[_0x74de('0x50')]===_0x74de('0x78')){delete this[_0x74de('0x28')][_0x6fa99c[_0x74de('0xd6')]];this[_0x74de('0xb1')](this[_0x74de('0x22')][_0x2e0dc3[_0x74de('0xb3')]]);this['campaigns'][_0x2e0dc3[_0x74de('0xb3')]][_0x74de('0xfd')]+=0x1;_0x1f3f52=new Hangup(_0x2e0dc3,_0x6fa99c);this[_0x74de('0xc6')](_0x1f3f52)[_0x74de('0xb0')](loggerCatch(_0x74de('0xfe')));this[_0x74de('0xc4')](_0x1f3f52)[_0x74de('0xb0')](loggerCatch(_0x74de('0xff')));}if(_0x2e0dc3&&_0x2e0dc3[_0x74de('0x50')]!==_0x74de('0x78')&&isNotNull(this['voiceQueues'][_0x2e0dc3[_0x74de('0xb3')]][_0x74de('0x100')])){delete this['uniqueId'][_0x6fa99c[_0x74de('0xd6')]];this[_0x74de('0xb1')](this['voiceQueues'][_0x2e0dc3['queue']]);this['voiceQueues'][_0x2e0dc3[_0x74de('0xb3')]][_0x74de('0x59')]+=0x1;this[_0x74de('0x21')][_0x2e0dc3['queue']][_0x74de('0x58')]+=0x1;_0x1f3f52=new Hangup(_0x2e0dc3,_0x6fa99c);_0x1f3f52[_0x74de('0xa6')]=0x10;_0x1f3f52[_0x74de('0xa7')]=_0x74de('0x101');_0x1f3f52[_0x74de('0xdd')]=_0x74de('0x102');this[_0x74de('0xc6')](_0x1f3f52)[_0x74de('0xb0')](loggerCatch(_0x74de('0xfe')));this[_0x74de('0xc4')](_0x1f3f52)[_0x74de('0xb0')](loggerCatch('[syncHangupIvr]'));}if(_0x2e0dc3&&_0x2e0dc3[_0x74de('0x50')]!==_0x74de('0x78')&&!isNotNull(this[_0x74de('0x21')][_0x2e0dc3[_0x74de('0xb3')]][_0x74de('0x100')])){delete this[_0x74de('0x28')][_0x6fa99c['uniqueid']];this['updateOriginated'](this[_0x74de('0x21')][_0x2e0dc3['queue']]);this[_0x74de('0x21')][_0x2e0dc3[_0x74de('0xb3')]][_0x74de('0x64')]+=0x1;_0x1f3f52=new Hangup(_0x2e0dc3,_0x6fa99c);_0x1f3f52[_0x74de('0xa6')]=0xc;_0x1f3f52[_0x74de('0xa7')]=_0x6fa99c[_0x74de('0x103')];_0x1f3f52[_0x74de('0xdd')]='Unknow';this['createHistory'](_0x1f3f52)['catch'](loggerCatch(_0x74de('0xfe')));this[_0x74de('0xc4')](_0x1f3f52)['catch'](loggerCatch(_0x74de('0xff')));}};Dialer['prototype'][_0x74de('0x104')]=function(_0x5c478f){var _0x405df9=this[_0x74de('0x28')][_0x5c478f[_0x74de('0xd6')]];var _0xfd9f4f=this;if(this[_0x74de('0x21')][_0x5c478f[_0x74de('0xb3')]]){if(_0x405df9&&_0x405df9['type']!==_0x74de('0x78')){delete this[_0x74de('0x28')][_0x5c478f[_0x74de('0xd6')]];this['voiceQueues'][_0x5c478f[_0x74de('0xb3')]][_0x74de('0x59')]+=0x1;var _0x47464f=new AgentComplete(_0x405df9,_0x5c478f);if(_0x5c478f[_0x74de('0x105')]==='agent'){_0x47464f[_0x74de('0x106')]=this[_0x74de('0x21')][_0x5c478f[_0x74de('0xb3')]][_0x74de('0x107')]&&this[_0x74de('0x21')][_0x5c478f[_0x74de('0xb3')]][_0x74de('0x108')]?moment()[_0x74de('0x76')](_0x74de('0xf7')):undefined;}this[_0x74de('0xc6')](_0x47464f)[_0x74de('0xb0')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0x74de('0xc4')](_0x47464f)[_0x74de('0xb0')](loggerCatch(_0x74de('0x109')));}}};Dialer[_0x74de('0x1c')][_0x74de('0x2c')]=function(_0x5de73b){if(this['voiceQueues'][_0x5de73b['queue']]){if(this[_0x74de('0x28')][_0x5de73b[_0x74de('0xd6')]]&&this[_0x74de('0x28')][_0x5de73b[_0x74de('0xd6')]][_0x74de('0x50')]!==_0x74de('0x78')){this[_0x74de('0xb1')](this[_0x74de('0x21')][_0x5de73b[_0x74de('0xb3')]]);this[_0x74de('0x28')][_0x5de73b[_0x74de('0xd6')]][_0x74de('0x10a')]=moment()[_0x74de('0x76')](_0x74de('0xf7'));}}};Dialer[_0x74de('0x1c')][_0x74de('0x10b')]=function(_0x540a7e){this[_0x74de('0xc6')](_0x540a7e)[_0x74de('0xb0')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0x74de('0xc4')](_0x540a7e)['catch'](loggerCatch(_0x74de('0x10c')));};Dialer[_0x74de('0x1c')]['syncQueueCallerAbandon']=function(_0x26242a){var _0x126cb1=this[_0x74de('0x28')][_0x26242a['uniqueid']];var _0x4052fb=this;if(this[_0x74de('0x21')][_0x26242a[_0x74de('0xb3')]]){if(_0x126cb1&&_0x126cb1[_0x74de('0x50')]!==_0x74de('0x78')){delete this[_0x74de('0x28')][_0x26242a[_0x74de('0xd6')]];this[_0x74de('0xb1')](this[_0x74de('0x21')][_0x26242a[_0x74de('0xb3')]]);_0x126cb1['droptime']=moment()[_0x74de('0x76')](_0x74de('0xf7'));var _0x5f2ac1=new QueueCallerAbandon(_0x126cb1,_0x26242a);if(getSeconds(_0x126cb1[_0x74de('0x10d')],_0x126cb1[_0x74de('0x10e')])>=_0x126cb1[_0x74de('0x10f')]){this[_0x74de('0x21')][_0x26242a[_0x74de('0xb3')]][_0x74de('0x69')]+=0x1;this['voiceQueues'][_0x26242a[_0x74de('0xb3')]][_0x74de('0x5f')]+=0x1;this[_0x74de('0x21')][_0x26242a[_0x74de('0xb3')]][_0x74de('0x6a')]+=0x1;_0x5f2ac1['state']=0xa;_0x5f2ac1['statedesc']=_0x74de('0x110');_0x5f2ac1['dropreason']=_0x74de('0x111');_0x5f2ac1['agiafterat']=this[_0x74de('0x21')][_0x26242a[_0x74de('0xb3')]]['dialQueueProject2']?moment()[_0x74de('0x76')](_0x74de('0xf7')):undefined;_0x5f2ac1['countdropretry']+=0x1;_0x5f2ac1['countglobal']+=0x1;if(_0x5f2ac1[_0x74de('0xec')]>=this['voiceQueues'][_0x26242a[_0x74de('0xb3')]][_0x74de('0x112')]){this[_0x74de('0x10b')](_0x5f2ac1);}else{this[_0x74de('0xbb')]({'active':![],'countdropretry':_0x5f2ac1[_0x74de('0xec')],'scheduledat':moment()[_0x74de('0x113')](this[_0x74de('0x21')][_0x26242a[_0x74de('0xb3')]]['dialDropRetryFrequency'],'minutes')[_0x74de('0x76')](_0x74de('0xf7')),'ContactId':_0x126cb1[_0x74de('0xcc')],'ListId':_0x126cb1[_0x74de('0xf8')],'VoiceQueueId':_0x126cb1['VoiceQueueId']||undefined,'CampaignId':_0x126cb1['CampaignId']||undefined})['catch'](loggerCatch(_0x74de('0x114')));var _0x2cad37=new History(_0x5f2ac1);_0x2cad37[_0x74de('0xa6')]=0xa;_0x2cad37[_0x74de('0xa7')]='Drop';_0x2cad37['starttime']=moment()[_0x74de('0x76')]('YYYY-MM-DD\x20HH:mm:ss');_0x2cad37[_0x74de('0xa8')]=_0x2cad37[_0x74de('0x115')];_0x2cad37[_0x74de('0x116')]=_0x5f2ac1[_0x74de('0x116')];_0x2cad37[_0x74de('0x117')]=_0x5f2ac1[_0x74de('0x117')];this[_0x74de('0xc6')](_0x2cad37)['catch'](loggerCatch(_0x74de('0x118')));}}else{this[_0x74de('0x21')][_0x26242a[_0x74de('0xb3')]][_0x74de('0x68')]+=0x1;this[_0x74de('0x21')][_0x26242a[_0x74de('0xb3')]][_0x74de('0x5e')]+=0x1;_0x5f2ac1[_0x74de('0xa6')]=0xb;_0x5f2ac1[_0x74de('0xa7')]=_0x74de('0x119');_0x5f2ac1['dropreason']=_0x74de('0x11a');_0x5f2ac1[_0x74de('0xed')]+=0x1;_0x5f2ac1[_0x74de('0xe4')]+=0x1;if(_0x5f2ac1[_0x74de('0xed')]>=this[_0x74de('0x21')][_0x26242a[_0x74de('0xb3')]]['dialAbandonedMaxRetry']){this[_0x74de('0x10b')](_0x5f2ac1);}else{this[_0x74de('0xbb')]({'active':![],'countabandonedretry':_0x5f2ac1[_0x74de('0xed')],'scheduledat':moment()['add'](this[_0x74de('0x21')][_0x26242a[_0x74de('0xb3')]][_0x74de('0x11b')],'minutes')[_0x74de('0x76')](_0x74de('0xf7')),'ContactId':_0x126cb1['ContactId'],'ListId':_0x126cb1[_0x74de('0xf8')],'VoiceQueueId':_0x126cb1['VoiceQueueId']||undefined,'CampaignId':_0x126cb1['CampaignId']||undefined})[_0x74de('0xb0')](loggerCatch('[rescheduleContact][Abandoned]'));var _0x2cad37=new History(_0x5f2ac1);_0x2cad37[_0x74de('0xa6')]=0xb;_0x2cad37['statedesc']=_0x74de('0x119');_0x2cad37['starttime']=moment()[_0x74de('0x76')](_0x74de('0xf7'));_0x2cad37['endtime']=_0x2cad37[_0x74de('0x115')];_0x2cad37[_0x74de('0x116')]=_0x5f2ac1[_0x74de('0x116')];_0x2cad37[_0x74de('0x117')]=_0x5f2ac1[_0x74de('0x117')];this[_0x74de('0xc6')](_0x2cad37)[_0x74de('0xb0')](loggerCatch(_0x74de('0x11c')));}}}}};Dialer[_0x74de('0x1c')]['syncNewExten']=function(_0x3fc3b4){if(this[_0x74de('0xab')][_0x3fc3b4[_0x74de('0xd6')]]){this[_0x74de('0xab')][_0x3fc3b4[_0x74de('0xd6')]][_0x74de('0xaf')]=_0x3fc3b4[_0x74de('0xaf')];}if(this['uniqueId'][_0x3fc3b4[_0x74de('0xd6')]]){this[_0x74de('0x28')][_0x3fc3b4[_0x74de('0xd6')]]['channel']=_0x3fc3b4[_0x74de('0xaf')];}};Dialer[_0x74de('0x1c')][_0x74de('0x38')]=function(_0xff0ac8){if(strategy[this[_0x74de('0x21')][this[_0x74de('0xab')][_0xff0ac8['actionid']][_0x74de('0xb3')]][_0x74de('0x11d')]]===_0x74de('0x11e')){if(this[_0x74de('0xab')][_0xff0ac8[_0x74de('0x11f')]]&&_['isNil'](this['actions'][_0xff0ac8['actionid']]['locked'])&&_0xff0ac8['status']==='1'&&_0xff0ac8['paused']==='0'){if(this[_0x74de('0x23')][_0xff0ac8[_0x74de('0x120')]]){if(!this[_0x74de('0x23')][_0xff0ac8[_0x74de('0x120')]][_0x74de('0x121')]){this[_0x74de('0x23')][_0xff0ac8[_0x74de('0x120')]][_0x74de('0x121')]=!![];this[_0x74de('0xab')][_0xff0ac8['actionid']][_0x74de('0x121')]=!![];this[_0x74de('0xab')][_0xff0ac8['actionid']][_0x74de('0x120')]=_0xff0ac8[_0x74de('0x120')];}}}}else if((strategy[this[_0x74de('0x21')][this[_0x74de('0xab')][_0xff0ac8[_0x74de('0x11f')]]['queue']][_0x74de('0x11d')]]||_0x74de('0x1b'))==='rrmemory'){if(this[_0x74de('0xab')][_0xff0ac8[_0x74de('0x11f')]]){if(this[_0x74de('0x23')][_0xff0ac8[_0x74de('0x120')]]){this[_0x74de('0xab')][_0xff0ac8[_0x74de('0x11f')]][_0x74de('0x120')]=_0xff0ac8[_0x74de('0x120')];if(_[_0x74de('0xac')](this[_0x74de('0x122')][this['actions'][_0xff0ac8[_0x74de('0x11f')]][_0x74de('0xb3')]])){this[_0x74de('0x122')][this['actions'][_0xff0ac8[_0x74de('0x11f')]][_0x74de('0xb3')]]=[];}this[_0x74de('0x122')][this[_0x74de('0xab')][_0xff0ac8[_0x74de('0x11f')]][_0x74de('0xb3')]][_0x74de('0x123')](_[_0x74de('0x8c')](_[_0x74de('0x124')](this[_0x74de('0xab')][_0xff0ac8[_0x74de('0x11f')]],[_0x74de('0x125'),_0x74de('0x120')]),{'status':_0xff0ac8[_0x74de('0xae')],'paused':_0xff0ac8[_0x74de('0x126')]}));}}}};function unlockQueueStatus(_0x72e410,_0x587e82){setTimeout(function(){if(_[_0x74de('0x3b')](_0x72e410['queueStatusComplete'])){loggerBooked[_0x74de('0x94')](_0x74de('0x127'),_0x587e82);}_0x72e410[_0x74de('0x128')]=!![];loggerBooked['info'](_0x74de('0x129'),_0x587e82,JSON[_0x74de('0x46')](_[_0x74de('0x124')](_0x72e410,[_0x74de('0x3e'),_0x74de('0x128')])));},0x1f3);}Dialer[_0x74de('0x1c')][_0x74de('0x12a')]=function(_0x4ea97b){var _0x378ca9=this;var _0xc6467=_0x378ca9['voiceQueues'][_0x378ca9[_0x74de('0xab')][_0x4ea97b[_0x74de('0x11f')]][_0x74de('0xb3')]];if(strategy[this[_0x74de('0x21')][this['actions'][_0x4ea97b[_0x74de('0x11f')]][_0x74de('0xb3')]][_0x74de('0x11d')]]===_0x74de('0x11e')){if(this[_0x74de('0xab')][_0x4ea97b['actionid']]&&this[_0x74de('0xab')][_0x4ea97b['actionid']][_0x74de('0x120')]){this[_0x74de('0x90')]['run'](this[_0x74de('0xab')][_0x4ea97b[_0x74de('0x11f')]][_0x74de('0x125')],this[_0x74de('0xab')][_0x4ea97b[_0x74de('0x11f')]]['stateinterface'])['catch'](function(_0x220abb){logger[_0x74de('0x94')](_0x74de('0x12b'),util[_0x74de('0x95')](_0x220abb,{'showHidden':![],'depth':null}));})[_0x74de('0x1f')](function(){_0x378ca9[_0x74de('0xb1')](_0x378ca9[_0x74de('0x21')][_0x378ca9[_0x74de('0xab')][_0x4ea97b['actionid']][_0x74de('0xb3')]]);_0x378ca9[_0x74de('0x23')][_0x378ca9[_0x74de('0xab')][_0x4ea97b[_0x74de('0x11f')]]['stateinterface']][_0x74de('0x121')]=![];delete _0x378ca9[_0x74de('0xab')][_0x4ea97b[_0x74de('0x11f')]];unlockQueueStatus(_0xc6467);});}else{this['updateOriginated'](this['voiceQueues'][this[_0x74de('0xab')][_0x4ea97b[_0x74de('0x11f')]]['queue']]);this[_0x74de('0xbb')]({'active':![],'ContactId':this[_0x74de('0xab')][_0x4ea97b[_0x74de('0x11f')]]['ContactId'],'ListId':this[_0x74de('0xab')][_0x4ea97b[_0x74de('0x11f')]][_0x74de('0xf8')],'VoiceQueueId':this[_0x74de('0xab')][_0x4ea97b[_0x74de('0x11f')]]['VoiceQueueId']||undefined,'CampaignId':this[_0x74de('0xab')][_0x4ea97b[_0x74de('0x11f')]]['CampaignId']||undefined})['catch'](loggerCatch(_0x74de('0x12c')));delete this['actions'][_0x4ea97b[_0x74de('0x11f')]];unlockQueueStatus(_0xc6467);}}else if((strategy[this[_0x74de('0x21')][this[_0x74de('0xab')][_0x4ea97b[_0x74de('0x11f')]][_0x74de('0xb3')]][_0x74de('0x11d')]]||'rrmemory')==='rrmemory'){var _0x2775ee;if(this[_0x74de('0xab')][_0x4ea97b[_0x74de('0x11f')]]&&!_[_0x74de('0x7b')](this['queueBooked'][this[_0x74de('0xab')][_0x4ea97b['actionid']][_0x74de('0xb3')]])){if(this[_0x74de('0x12d')][_0x378ca9['actions'][_0x4ea97b[_0x74de('0x11f')]]['queue']]){this[_0x74de('0x12d')][_0x378ca9[_0x74de('0xab')][_0x4ea97b[_0x74de('0x11f')]]['queue']]=this[_0x74de('0x12d')][this['actions'][_0x4ea97b[_0x74de('0x11f')]][_0x74de('0xb3')]]?this[_0x74de('0x12d')][this[_0x74de('0xab')][_0x4ea97b[_0x74de('0x11f')]]['queue']]:this[_0x74de('0x122')][this[_0x74de('0xab')][_0x4ea97b[_0x74de('0x11f')]][_0x74de('0xb3')]]?this[_0x74de('0x122')][this[_0x74de('0xab')][_0x4ea97b[_0x74de('0x11f')]][_0x74de('0xb3')]][_0x74de('0x12e')]||0x0:0x0;}this['queueBooked'][this['actions'][_0x4ea97b[_0x74de('0x11f')]][_0x74de('0xb3')]]['_rr']=this['queueBookedRR'][this[_0x74de('0xab')][_0x4ea97b[_0x74de('0x11f')]]['queue']];for(var _0xc815d9=0x0;_0xc815d9=0x0;})['catch'](myreject(_0x19f9df)));}}else{_0x3c3c23[_0x74de('0x123')](ami['Action']({'action':_0x74de('0x144'),'command':util['format'](_0x74de('0x145'),_0xa3ae02,!_[_0x74de('0x3b')](config[_0x74de('0x149')][_0x29078e])?_0x29078e:'')})[_0x74de('0xb9')](function(_0x20a0b0){return _0x20a0b0[_0x74de('0x146')][_0x74de('0x147')]('true')>=0x0;})[_0x74de('0xb0')](myreject(_0x19f9df)));}BPromise[_0x74de('0x14a')](_0x3c3c23)['then'](function(_0x2a9adf){var _0x3aad01=_[_0x74de('0x14b')](_0x2a9adf);if(_0x3aad01){return _0x4c754e(_0x3aad01);}else{_0x411b35['message']=_0x1f120a?'GLOBAL_INTERVAL_IS_OVERTIME':_0x74de('0x14c');return _0x19f9df(msgResponse(_0x74de('0x14d'),'Failure',_0x74de('0x14e')+_0x1f120a+'\x20'+_0x7148a6+_0x74de('0x14f')+util[_0x74de('0x95')](_0xa3ae02,{'showHidden':![],'depth':null})+_0x74de('0x150')+_0x29078e));}})['catch'](function(_0x5a2fd7){return _0x19f9df(msgResponse(_0x74de('0x13e'),_0x74de('0x141'),JSON[_0x74de('0x46')](_0x5a2fd7)));});});};Dialer[_0x74de('0x1c')][_0x74de('0x151')]=function(_0x42e087){var _0x3e9872=this;return function(){switch(_0x42e087[_0x74de('0x152')]){case _0x74de('0x153'):freeVariablesPredictive(_0x42e087);_0x3e9872[_0x74de('0x154')](_0x42e087,0x1);break;case'power':freeVariablesPredictive(_0x42e087);_0x3e9872[_0x74de('0x154')](_0x42e087,_0x42e087['dialPowerLevel']);break;case _0x74de('0xa'):_0x3e9872[_0x74de('0xa')](_0x42e087);break;case _0x74de('0x9'):freeVariablesPredictive(_0x42e087);_0x3e9872[_0x74de('0x154')](_0x42e087,0x1);break;default:freeVariablesPredictive(_0x42e087);logger[_0x74de('0x94')]('Queue',_0x42e087[_0x74de('0x3e')],_0x74de('0x155'));}};};Dialer[_0x74de('0x1c')]['launchHandleIvr']=function(_0x775e91){var _0x157072=this;return function(){_0x157072[_0x74de('0x156')](_0x775e91);};};Dialer[_0x74de('0x1c')][_0x74de('0xc')]=function(_0x19dd61){var _0x21a4dd=this;if(isNotPreview(_0x19dd61[_0x74de('0x152')])){if(isVoiceQueueOutbound(_0x19dd61[_0x74de('0x50')])&&isActive(_0x19dd61[_0x74de('0x157')])){_0x19dd61[_0x74de('0xa1')]=!![];BPromise['resolve']()[_0x74de('0xb9')](checkIsLoggedIn(_0x19dd61,_0x19dd61[_0x74de('0x4b')]))[_0x74de('0xb9')](checkIsActive(_0x19dd61,_0x19dd61[_0x74de('0x157')]))[_0x74de('0xb9')](checkInterval(_0x19dd61))['then'](_0x21a4dd[_0x74de('0x138')](_0x19dd61))['then'](_0x21a4dd[_0x74de('0x13c')](_0x19dd61[_0x74de('0x158')],_0x19dd61[_0x74de('0x159')],_0x19dd61['name'],_0x19dd61))['then'](_0x21a4dd[_0x74de('0x13d')](_0x19dd61[_0x74de('0x43')],_0x19dd61[_0x74de('0x159')],_0x19dd61[_0x74de('0x3e')],_0x19dd61))[_0x74de('0xb9')](_0x21a4dd[_0x74de('0x151')](_0x19dd61))[_0x74de('0xb0')](loggerCatchQueueSummary(_0x74de('0x15a'),_0x19dd61));}else{notSendMessagesQueue(_0x19dd61);}}else{freeVariablesPredictive(_0x19dd61);}};Dialer[_0x74de('0x1c')][_0x74de('0x137')]=function(){var _0x5b89b9=this;var _0xe5df01;for(var _0xe82b65 in this[_0x74de('0x22')]){if(typeof this[_0x74de('0x22')][_0xe82b65]!=='undefined'){_0xe5df01=this[_0x74de('0x22')][_0xe82b65];if(isCampaignIvr(_0xe5df01[_0x74de('0x50')])&&isActive(_0xe5df01[_0x74de('0x74')])){_0xe5df01['sendMessageOneNotActive']=!![];BPromise[_0x74de('0xb5')]()[_0x74de('0xb9')](checkIsActive(_0xe5df01,_0xe5df01[_0x74de('0x74')]))[_0x74de('0xb9')](checkInterval(_0xe5df01))[_0x74de('0xb9')](_0x5b89b9[_0x74de('0x138')](_0xe5df01))[_0x74de('0xb9')](_0x5b89b9['checkIfTime'](_0xe5df01['dialGlobalInterval'],_0xe5df01['dialTimezone'],_0xe5df01[_0x74de('0x3e')],_0xe5df01))[_0x74de('0xb9')](_0x5b89b9[_0x74de('0x13d')](_0xe5df01[_0x74de('0x43')],_0xe5df01['dialTimezone'],_0xe5df01[_0x74de('0x3e')],_0xe5df01))[_0x74de('0xb9')](_0x5b89b9['launchHandleIvr'](_0xe5df01))[_0x74de('0xb0')](loggerCatchQueueSummary(_0x74de('0x15b'),_0xe5df01));}else{notSendMessagesCampaign(_0xe5df01);}}}};function getCallerIdRandom(_0x512380,_0x286c34){var _0x49bac4;var _0x4397ae;var _0x5a40ca;if(_0x286c34<=0x0){_0x286c34=0x1;}_0x49bac4=new RegExp(_0x74de('0x15c')+_0x286c34+'}$');_0x4397ae=Math[_0x74de('0x15d')](0xa,_0x286c34-0x1);_0x5a40ca=Math['pow'](0xa,_0x286c34)-0x1;return util[_0x74de('0x76')]('%s',_['replace'](_0x512380,_0x49bac4,_[_0x74de('0x15e')](_0x4397ae,_0x5a40ca)));}function extractCalleridName(_0xf5aec3){var _0x2985d0=_0xf5aec3['match'](/"(.*?)"/);return _0x2985d0?_0x2985d0[0x1]:_0xf5aec3;}function extractCalleridNumber(_0x300551){var _0x5006ae=_0x300551['match'](/<(.*?)>/);return _0x5006ae?_0x5006ae[0x1]:_0x300551;}Dialer[_0x74de('0x1c')][_0x74de('0x15f')]=function(_0x114d43,_0x2b5215){var _0x10592f=this;var _0x5d3d27=uuid['v4']();this[_0x74de('0xab')][_0x5d3d27]=new Action(_0x114d43,_0x2b5215,_0x5d3d27);return new BPromise(function(_0x10c017,_0x3f483e){if(_[_0x74de('0x3b')](_0x114d43)&&typeof _0x114d43!==_0x74de('0x160')){return _0x3f483e(msgResponse(_0x74de('0x161'),_0x74de('0x141'),_0x74de('0x162')));}if(_[_0x74de('0x3b')](_0x2b5215['Contact'][_0x74de('0x163')])||_0x2b5215['Contact'][_0x74de('0x163')]===null){return _0x3f483e(msgResponse('originate','Failure',_0x74de('0x164')));}var _0xdbcc01={'XMD-CALLERID':_0x10592f[_0x74de('0xab')][_0x5d3d27][_0x74de('0x165')](),'XMD-AGI':_0x114d43['dialQueueProject']?util[_0x74de('0x76')](_0x74de('0x166'),ipAgi,_0x114d43[_0x74de('0x100')]):'NONE','XMD-AGIAFTER':_0x114d43[_0x74de('0x107')]?util[_0x74de('0x76')](_0x74de('0x166'),ipAgi,_0x114d43[_0x74de('0x107')]):_0x74de('0x167'),'XMD-QUEUE':_0x114d43[_0x74de('0x50')]==='outbound'?util[_0x74de('0x76')](_0x74de('0x168'),_0x114d43[_0x74de('0x3e')],_0x114d43['dialQueueOptions']||'',_0x114d43['dialAgiAfterHangupAgent']?'c':'',_0x114d43[_0x74de('0x10f')]||0x3):_0x74de('0x167'),'XMD-CONTACTID':_0x2b5215[_0x74de('0xcc')],'XMD-CDRTYPE':_0x74de('0x8'),'CALLERID(all)':_0x10592f[_0x74de('0xab')][_0x5d3d27][_0x74de('0x165')](),'XMD-AMD':_0x114d43['dialAMDActive']?_0x74de('0x169'):_0x74de('0x167'),'XMD-DESTINATION':_0x74de('0xd9')};if(_0x114d43['dialAMDActive']){_0xdbcc01[_0x74de('0x16a')]=_0x114d43[_0x74de('0x16b')]||0x9c4;_0xdbcc01['XMD-AMDGREETING']=_0x114d43[_0x74de('0x16c')]||0x5dc;_0xdbcc01[_0x74de('0x16d')]=_0x114d43['dialAMDAfterGreetingSilence']||0x320;_0xdbcc01['XMD-AMDTOTALANALYSISTIME']=_0x114d43['dialAMDTotalAnalysisTime']||0x1388;_0xdbcc01[_0x74de('0x16e')]=_0x114d43[_0x74de('0x16f')]||0x64;_0xdbcc01['XMD-AMDBETWEENWORDSSILENCE']=_0x114d43['dialAMDBetweenWordsSilence']||0x32;_0xdbcc01['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x114d43[_0x74de('0x170')]||0x3;_0xdbcc01[_0x74de('0x171')]=_0x114d43['dialAMDSilenceThreshold']||0x100;_0xdbcc01[_0x74de('0x172')]=_0x114d43[_0x74de('0x173')]||0x1388;}if(_0x114d43[_0x74de('0x50')]==='outbound'){_0xdbcc01['XMD-VOICEQUEUEID']=_0x2b5215[_0x74de('0xce')];}else{_0xdbcc01[_0x74de('0x174')]=_0x2b5215[_0x74de('0xcf')];}for(var _0x395216 in _0x2b5215[_0x74de('0x175')]){if(typeof _0x2b5215[_0x74de('0x175')][_0x395216]!==_0x74de('0x98')){if(isNotNull(_0x2b5215[_0x74de('0x175')][_0x395216])&&_0x395216!=='id'&&_0x395216!==_0x74de('0x176')&&_0x395216!==_0x74de('0x177')&&_0x395216!=='updatedAt'){_0xdbcc01[util[_0x74de('0x76')]('%s%s',_0x74de('0x178'),_[_0x74de('0x179')](_0x395216))]=_0x2b5215[_0x74de('0x175')][_0x395216];}}}var _0x3b1913=_0x10592f[_0x74de('0x139')](_0x114d43[_0x74de('0x73')])?getCallerId(_0x114d43[_0x74de('0x73')][_0x74de('0x75')],_0x114d43[_0x74de('0x17a')],_0x114d43[_0x74de('0x17b')]>0x0?getCallerIdRandom(_0x114d43[_0x74de('0x55')],_0x114d43['dialRandomLastDigitCallerIdNumber']):_0x114d43[_0x74de('0x55')]):getCallerId(_['isNil'](_0x114d43[_0x74de('0x13a')])?_0x114d43[_0x74de('0x73')][_0x74de('0x75')]:_0x114d43[_0x74de('0x13a')]['callerid'],_0x114d43[_0x74de('0x17a')],_0x114d43[_0x74de('0x17b')]>0x0?getCallerIdRandom(_0x114d43[_0x74de('0x55')],_0x114d43[_0x74de('0x17b')]):_0x114d43['dialOriginateCallerIdNumber']);if(_0x3b1913){_0xdbcc01[_0x74de('0x17c')]=_0x10592f['actions'][_0x5d3d27][_0x74de('0x17d')]=extractCalleridName(_0x3b1913);_0xdbcc01[_0x74de('0x17e')]=_0x10592f[_0x74de('0xab')][_0x5d3d27][_0x74de('0x17f')]=extractCalleridNumber(_0x3b1913);}return ami['Action']({'actionid':_0x5d3d27,'action':_0x74de('0x161'),'channel':_0x10592f[_0x74de('0x139')](_0x114d43[_0x74de('0x73')])?util[_0x74de('0x76')](_0x74de('0x180'),_0x114d43[_0x74de('0x73')][_0x74de('0x3e')],isNotNull(_0x114d43['dialPrefix'])?_0x114d43[_0x74de('0x57')][_0x74de('0x181')]()||'':'',_0x114d43[_0x74de('0x182')]>0x0?_0x2b5215[_0x74de('0x175')][_0x74de('0x163')][_0x74de('0x183')](_0x114d43[_0x74de('0x182')]):_0x2b5215[_0x74de('0x175')][_0x74de('0x163')]):util['format']('SIP/%s/%s%s',_[_0x74de('0xac')](_0x114d43['TrunkBackup'])?_0x114d43[_0x74de('0x73')][_0x74de('0x3e')]:_0x114d43[_0x74de('0x13a')]['name'],isNotNull(_0x114d43[_0x74de('0x57')])?_0x114d43[_0x74de('0x57')]['trim']()||'':'',_0x114d43['dialCutDigit']>0x0?_0x2b5215[_0x74de('0x175')][_0x74de('0x163')]['substring'](_0x114d43['dialCutDigit']):_0x2b5215[_0x74de('0x175')][_0x74de('0x163')]),'callerid':_0x3b1913,'Exten':_0x74de('0xd9'),'Context':_0x74de('0x184'),'Priority':'1','variable':_0xdbcc01,'timeout':(_0x114d43[_0x74de('0x56')]||0x1e)*0x3e8,'async':!![],'channelid':_0x5d3d27})[_0x74de('0xb9')](function(_0x2ba83f){return _0x10c017(_0x2ba83f);})[_0x74de('0xb0')](function(_0x1bb93a){_0x114d43['outboundOriginateFailureCallsDay']+=0x1;var _0x39d209=new History(_0x10592f[_0x74de('0xab')][_0x5d3d27]);logger[_0x74de('0x94')](util[_0x74de('0x76')]('[originateError]:\x20%s',JSON[_0x74de('0x46')](_0x1bb93a)));_0x39d209[_0x74de('0xa6')]=0xe;_0x39d209[_0x74de('0xa7')]=_0x74de('0x185');_0x39d209[_0x74de('0x115')]=moment()[_0x74de('0x76')](_0x74de('0xf7'));_0x39d209[_0x74de('0xa8')]=_0x39d209[_0x74de('0x115')];_0x10592f['createHistory'](_0x39d209)[_0x74de('0xb0')](loggerCatch(_0x74de('0x186')));_0x10592f[_0x74de('0xc4')](_0x39d209)[_0x74de('0xb0')](loggerCatch(_0x74de('0x186')))[_0x74de('0x1f')](function(){delete _0x10592f[_0x74de('0xab')][_0x5d3d27];return _0x3f483e(msgResponse(_0x74de('0x161'),_0x74de('0x187'),_0x74de('0x188')));});});});};Dialer[_0x74de('0x1c')][_0x74de('0x189')]=function(_0x5f142d){var _0xadb44c=this[_0x74de('0xab')][_0x5f142d[_0x74de('0x11f')]];if(_0xadb44c){delete this[_0x74de('0xab')][_0x5f142d['actionid']];_0xadb44c[_0x74de('0x10e')]=moment()[_0x74de('0x76')](_0x74de('0xf7'));var _0x3d446e=_0xadb44c[_0x74de('0x50')]===_0x74de('0x78')?this[_0x74de('0x22')][_0xadb44c[_0x74de('0xb3')]]:this[_0x74de('0x21')][_0xadb44c['getQueue']()];if(!this[_0x74de('0xd2')](_0x5f142d['response'])){this['updateOriginated'](_0x3d446e);return this[_0x74de('0x18a')](_0xadb44c,_0x3d446e,_0x5f142d)[_0x74de('0xb0')](loggerCatch('[callProgressDetecting]\x20'));}this[_0x74de('0x28')][_0x5f142d[_0x74de('0xd6')]]=_0xadb44c;}};Dialer[_0x74de('0x1c')][_0x74de('0x18b')]=function(_0x75cd04,_0x24950c,_0x58a564){var _0x6372d8=new History(_0x24950c);if(_0x6372d8[_0x74de('0xe8')]+_0x6372d8[_0x74de('0xe9')]+_0x6372d8['countnoanswerretry']+_0x6372d8[_0x74de('0xeb')]+_0x6372d8[_0x74de('0xec')]+_0x6372d8[_0x74de('0xed')]+_0x6372d8['countmachineretry']+_0x6372d8[_0x74de('0xfc')]>=_0x58a564['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x75cd04){case 0x3:if(_0x6372d8[_0x74de('0xea')]>=_0x58a564[_0x74de('0x18c')]-0x1){return!![];}this[_0x74de('0xbb')]({'active':![],'countnoanswerretry':_0x6372d8[_0x74de('0xea')]+=0x1,'scheduledat':moment()[_0x74de('0x113')](_0x58a564['dialNoAnswerRetryFrequency'],_0x74de('0xf6'))[_0x74de('0x76')](_0x74de('0xf7')),'ContactId':_0x6372d8['ContactId'],'ListId':_0x6372d8[_0x74de('0xf8')],'VoiceQueueId':_0x6372d8['VoiceQueueId']||undefined,'CampaignId':_0x6372d8[_0x74de('0xcf')]||undefined})[_0x74de('0xb0')](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0x6372d8[_0x74de('0xe8')]>=_0x58a564[_0x74de('0x18d')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countbusyretry':_0x6372d8[_0x74de('0xe8')]+=0x1,'scheduledat':moment()[_0x74de('0x113')](_0x58a564['dialBusyRetryFrequency'],_0x74de('0xf6'))['format'](_0x74de('0xf7')),'ContactId':_0x6372d8[_0x74de('0xcc')],'ListId':_0x6372d8[_0x74de('0xf8')],'VoiceQueueId':_0x6372d8[_0x74de('0xce')]||undefined,'CampaignId':_0x6372d8[_0x74de('0xcf')]||undefined})[_0x74de('0xb0')](loggerCatch(_0x74de('0x18e')));break;case 0x8:if(_0x6372d8['countcongestionretry']>=_0x58a564[_0x74de('0x18f')]-0x1){return!![];}this[_0x74de('0xbb')]({'active':![],'countcongestionretry':_0x6372d8['countcongestionretry']+=0x1,'scheduledat':moment()[_0x74de('0x113')](_0x58a564[_0x74de('0x190')],'minutes')[_0x74de('0x76')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x6372d8[_0x74de('0xcc')],'ListId':_0x6372d8[_0x74de('0xf8')],'VoiceQueueId':_0x6372d8['VoiceQueueId']||undefined,'CampaignId':_0x6372d8['CampaignId']||undefined})[_0x74de('0xb0')](loggerCatch(_0x74de('0x191')));break;case 0x0:if(_0x6372d8[_0x74de('0xeb')]>=_0x58a564['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{this[_0x74de('0xbb')]({'active':![],'countnosuchnumberretry':_0x6372d8[_0x74de('0xeb')]+=0x1,'scheduledat':moment()[_0x74de('0x113')](_0x58a564[_0x74de('0x192')],'minutes')['format'](_0x74de('0xf7')),'ContactId':_0x6372d8[_0x74de('0xcc')],'ListId':_0x6372d8[_0x74de('0xf8')],'VoiceQueueId':_0x6372d8[_0x74de('0xce')]||undefined,'CampaignId':_0x6372d8[_0x74de('0xcf')]||undefined})['catch'](loggerCatch(_0x74de('0x193')));}break;case 0xa:if(_0x6372d8[_0x74de('0xec')]>=_0x58a564['dialDropMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countdropretry':_0x6372d8[_0x74de('0xec')]+=0x1,'scheduledat':moment()['add'](_0x58a564[_0x74de('0x194')],_0x74de('0xf6'))[_0x74de('0x76')](_0x74de('0xf7')),'ContactId':_0x6372d8[_0x74de('0xcc')],'ListId':_0x6372d8[_0x74de('0xf8')],'VoiceQueueId':_0x6372d8[_0x74de('0xce')]||undefined,'CampaignId':_0x6372d8[_0x74de('0xcf')]||undefined})[_0x74de('0xb0')](loggerCatch(_0x74de('0x114')));break;case 0xb:if(_0x6372d8[_0x74de('0xed')]>=_0x58a564[_0x74de('0x195')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countabandonedretry':_0x6372d8['countabandonedretry']+=0x1,'scheduledat':moment()[_0x74de('0x113')](_0x58a564[_0x74de('0x11b')],_0x74de('0xf6'))[_0x74de('0x76')](_0x74de('0xf7')),'ContactId':_0x6372d8[_0x74de('0xcc')],'ListId':_0x6372d8[_0x74de('0xf8')],'VoiceQueueId':_0x6372d8[_0x74de('0xce')]||undefined,'CampaignId':_0x6372d8[_0x74de('0xcf')]||undefined})[_0x74de('0xb0')](loggerCatch(_0x74de('0x196')));break;case 0x13:if(_0x6372d8[_0x74de('0xee')]>=_0x58a564[_0x74de('0xf2')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countmachineretry':_0x6372d8['countmachineretry']+=0x1,'scheduledat':moment()[_0x74de('0x113')](_0x58a564[_0x74de('0xf5')],_0x74de('0xf6'))['format'](_0x74de('0xf7')),'ContactId':_0x6372d8[_0x74de('0xcc')],'ListId':_0x6372d8[_0x74de('0xf8')],'VoiceQueueId':_0x6372d8[_0x74de('0xce')]||undefined,'CampaignId':_0x6372d8[_0x74de('0xcf')]||undefined})[_0x74de('0xb0')](loggerCatch(_0x74de('0x197')));break;case 0x14:if(_0x6372d8['countagentrejectretry']>=_0x58a564['dialAgentRejectMaxRetry']-0x1){return!![];}this[_0x74de('0xbb')]({'active':![],'countagentrejectretry':_0x6372d8[_0x74de('0xfc')]+=0x1,'scheduledat':moment()[_0x74de('0x113')](_0x58a564[_0x74de('0x198')],_0x74de('0xf6'))['format'](_0x74de('0xf7')),'ContactId':_0x6372d8[_0x74de('0xcc')],'ListId':_0x6372d8[_0x74de('0xf8')],'VoiceQueueId':_0x6372d8['VoiceQueueId']||undefined,'CampaignId':_0x6372d8[_0x74de('0xcf')]||undefined})[_0x74de('0xb0')](loggerCatch(_0x74de('0x199')));break;default:return!![];}};Dialer['prototype'][_0x74de('0x18a')]=function(_0x480034,_0x5f03cf,_0xe894e5){var _0x3eccc1=this;var _0x1fc050=new History(_0x480034);return new BPromise(function(_0x235139,_0x40786a){if(_[_0x74de('0x3b')](_0x5f03cf)&&typeof _0x5f03cf!==_0x74de('0x160')){return _0x40786a(msgResponse('[callProgressDetecting]','Failure',_0x74de('0x19a')));}if(_[_0x74de('0x3b')](_0xe894e5)&&typeof _0xe894e5!=='object'){return _0x40786a(msgResponse('[callProgressDetecting]','Failure',_0x74de('0x19b')));}switch(_0xe894e5[_0x74de('0x105')]){case'0':_0x5f03cf[_0x74de('0x19c')]+=0x1;_0x1fc050[_0x74de('0xa6')]=0x0;_0x1fc050['statedesc']=_0x74de('0x19d');_0x1fc050['countnosuchnumberretry']+=0x1;_0x1fc050[_0x74de('0xe4')]+=0x1;ami[_0x74de('0xe6')](_0x74de('0x19e'),ut[_0x74de('0xdf')](_0x480034,_0x74de('0x19f')));_0x3eccc1[_0x74de('0xc6')](_0x1fc050)[_0x74de('0xb0')](loggerCatch(_0x74de('0xe7')));if(_0x3eccc1[_0x74de('0x18b')](0x0,_0x480034,_0x5f03cf)){if(_0x1fc050['countnosuchnumberretry']>=_0x5f03cf[_0x74de('0x1a0')]){_0x3eccc1[_0x74de('0xf3')](_0x1fc050,_0x235139,_0x40786a,_0x74de('0x1a1'));}else{_0x3eccc1[_0x74de('0xf0')](_0x1fc050,_0x235139,_0x40786a,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x5f03cf[_0x74de('0x60')]+=0x1;_0x1fc050[_0x74de('0xa6')]=0x3;_0x1fc050[_0x74de('0xa7')]=_0x74de('0x1a2');_0x1fc050[_0x74de('0xea')]+=0x1;_0x1fc050[_0x74de('0xe4')]+=0x1;ami[_0x74de('0xe6')](_0x74de('0x1a3'),ut[_0x74de('0xdf')](_0x480034,_0x74de('0x1a4')));_0x3eccc1[_0x74de('0xc6')](_0x1fc050)[_0x74de('0xb0')](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x3eccc1[_0x74de('0x18b')](0x3,_0x480034,_0x5f03cf)){if(_0x1fc050[_0x74de('0xea')]>=_0x5f03cf[_0x74de('0x18c')]){_0x3eccc1[_0x74de('0xf3')](_0x1fc050,_0x235139,_0x40786a,_0x74de('0x1a5'));}else{_0x3eccc1[_0x74de('0xf0')](_0x1fc050,_0x235139,_0x40786a,_0x74de('0x1a5'));}}break;case'5':_0x5f03cf['outboundBusyCallsDay']+=0x1;_0x1fc050['state']=0x5;_0x1fc050[_0x74de('0xa7')]=_0x74de('0x1a6');_0x1fc050[_0x74de('0xe8')]+=0x1;_0x1fc050[_0x74de('0xe4')]+=0x1;ami['emit'](_0x74de('0x1a7'),ut[_0x74de('0xdf')](_0x480034,_0x74de('0x1a8')));_0x3eccc1[_0x74de('0xc6')](_0x1fc050)[_0x74de('0xb0')](loggerCatch(_0x74de('0x1a9')));if(_0x3eccc1[_0x74de('0x18b')](0x5,_0x480034,_0x5f03cf)){if(_0x1fc050[_0x74de('0xe8')]>=_0x5f03cf['dialBusyMaxRetry']){_0x3eccc1['createStateFinal'](_0x1fc050,_0x235139,_0x40786a,'reason\x205\x20busy');}else{_0x3eccc1[_0x74de('0xf0')](_0x1fc050,_0x235139,_0x40786a,_0x74de('0x1aa'));}}break;case'8':_0x5f03cf[_0x74de('0x5c')]+=0x1;_0x1fc050[_0x74de('0xa6')]=0x8;_0x1fc050[_0x74de('0xa7')]=_0x74de('0x1ab');_0x1fc050[_0x74de('0xe9')]+=0x1;_0x1fc050[_0x74de('0xe4')]+=0x1;ami['emit'](_0x74de('0x1ac'),ut[_0x74de('0xdf')](_0x480034,_0x74de('0x1ad')));_0x3eccc1[_0x74de('0xc6')](_0x1fc050)[_0x74de('0xb0')](loggerCatch(_0x74de('0x1ae')));if(_0x3eccc1[_0x74de('0x18b')](0x8,_0x480034,_0x5f03cf)){if(_0x1fc050['countcongestionretry']>=_0x5f03cf['dialCongestionMaxRetry']){_0x3eccc1[_0x74de('0xf3')](_0x1fc050,_0x235139,_0x40786a,'reason\x208\x20congestion');}else{_0x3eccc1['stateGlobal'](_0x1fc050,_0x235139,_0x40786a,'reason\x208\x20congestion');}}break;case'11':_0x5f03cf[_0x74de('0x1af')]+=0x1;_0x1fc050[_0x74de('0xa6')]=0xb;_0x1fc050[_0x74de('0xa7')]='Abandoned';_0x1fc050['countabandonedretry']+=0x1;_0x1fc050['countglobal']+=0x1;_0x3eccc1['createHistory'](_0x1fc050)[_0x74de('0xb0')](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0x3eccc1[_0x74de('0x18b')](0xb,_0x480034,_0x5f03cf)){if(_0x1fc050[_0x74de('0xed')]>=_0x5f03cf[_0x74de('0x195')]){_0x3eccc1[_0x74de('0xf3')](_0x1fc050,_0x235139,_0x40786a,_0x74de('0x1b0'));}else{_0x3eccc1['stateGlobal'](_0x1fc050,_0x235139,_0x40786a,'reason\x2011\x20abandoned');}}break;case'20':_0x5f03cf['outboundRejectCallsDay']+=0x1;_0x1fc050[_0x74de('0xa6')]=0x14;_0x1fc050[_0x74de('0xa7')]='AgentReject';_0x1fc050['countagentrejectretry']+=0x1;_0x1fc050[_0x74de('0xe4')]+=0x1;ami[_0x74de('0xe6')](_0x74de('0x1b1'),ut['buildObj'](_0x480034,_0x74de('0x1b2')));_0x3eccc1[_0x74de('0xc6')](_0x1fc050)[_0x74de('0xb0')](loggerCatch(_0x74de('0x1b3')));if(_0x3eccc1[_0x74de('0x18b')](0x14,_0x480034,_0x5f03cf)){if(_0x1fc050[_0x74de('0xfc')]>=_0x5f03cf[_0x74de('0x1b4')]){_0x3eccc1[_0x74de('0xf3')](_0x1fc050,_0x235139,_0x40786a,_0x74de('0x1b5'));}else{_0x3eccc1[_0x74de('0xf0')](_0x1fc050,_0x235139,_0x40786a,_0x74de('0x1b5'));}}break;default:_0x5f03cf[_0x74de('0x64')]+=0x1;_0x1fc050[_0x74de('0xa6')]=0xc;_0x1fc050[_0x74de('0xa7')]=_0xe894e5['reason'];_0x3eccc1[_0x74de('0xc6')](_0x1fc050)[_0x74de('0xb0')](loggerCatch(_0x74de('0x1b6')));if(_0x3eccc1[_0x74de('0x18b')](_0xe894e5[_0x74de('0x105')],_0x480034,_0x5f03cf)){if(_0x1fc050[_0x74de('0xe8')]+_0x1fc050['countcongestionretry']+_0x1fc050[_0x74de('0xea')]+_0x1fc050[_0x74de('0xeb')]+_0x1fc050[_0x74de('0xec')]+_0x1fc050[_0x74de('0xed')]+_0x1fc050[_0x74de('0xee')]+_0x1fc050['countagentrejectretry']>=_0x5f03cf['dialGlobalMaxRetry']){_0x3eccc1[_0x74de('0xf0')](_0x1fc050,_0x235139,_0x40786a,_0xe894e5['reason']);}else{_0x3eccc1[_0x74de('0xf3')](_0x1fc050,_0x235139,_0x40786a,_0xe894e5[_0x74de('0x105')]);}}}});};Dialer[_0x74de('0x1c')][_0x74de('0xf0')]=function(_0x2cfb46,_0x340c14,_0x3b9f2f,_0x5efb8d){var _0x26e132=new Final(_0x2cfb46);_0x26e132[_0x74de('0xa6')]=0xf;_0x26e132[_0x74de('0xa7')]=_0x74de('0x1b7');this[_0x74de('0xf3')](_0x26e132,_0x340c14,_0x3b9f2f,_0x5efb8d);};Dialer[_0x74de('0x1c')][_0x74de('0xf3')]=function(_0x43c1d3,_0x3a96c4,_0x511777,_0xaa958e){this[_0x74de('0xc4')](_0x43c1d3)[_0x74de('0xb9')](function(){return _0x3a96c4(msgResponse(_0x74de('0x1b8'),_0x74de('0x1b9'),_0xaa958e));})['catch'](function(){return _0x511777(msgResponse('[moveContactManagedDialer][0]',_0x74de('0x141'),'contact\x20not\x20moved'));});};Dialer[_0x74de('0x1c')]['predictive']=function(_0x21dc9e){var _0x49c7db=_0x21dc9e[_0x74de('0x1ba')]/0x64;var _0x14706e=_0x21dc9e['outboundDropCallsDayTimeout']/(_0x21dc9e['outboundDropCallsDayTimeout']+_0x21dc9e['outboundAnswerCallsDay']);var _0x5a883a=Math[_0x74de('0x1bb')](_0x21dc9e[_0x74de('0x6e')]*(_0x21dc9e[_0x74de('0x1bc')]/0x64));var _0x13768d=Math['round'](_0x21dc9e[_0x74de('0x6e')]*(_0x21dc9e[_0x74de('0x1bd')]/0x64));var _0x2c15e5=_0x21dc9e[_0x74de('0x4a')]+_0x21dc9e[_0x74de('0x4e')];var _0x1486fc=Math['floor'](_0x21dc9e[_0x74de('0x1be')]*_0x21dc9e[_0x74de('0x71')]*_0x21dc9e[_0x74de('0x6b')]*_0x21dc9e['predictiveIntervalMultiplicativeFactor']);if(_[_0x74de('0x3b')](_0x21dc9e[_0x74de('0x72')])){if(!_['isUndefined'](_0x21dc9e['startPredictive'])){_0x21dc9e['startPredictive']=undefined;loggerPredictive[_0x74de('0x94')](_0x74de('0x1bf'),_0x74de('0x1c0'));}if(!_[_0x74de('0x3b')](_0x21dc9e[_0x74de('0x8e')])){loggerPredictive['error'](_0x74de('0x1bf'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x21dc9e[_0x74de('0x8e')]);_0x21dc9e[_0x74de('0x8e')]=undefined;}_0x21dc9e[_0x74de('0x72')]=moment()['format'](_0x74de('0xf7'));loggerPredictive[_0x74de('0x7c')](_0x21dc9e[_0x74de('0x3e')],_0x74de('0x1c1'),_0x21dc9e['startProgressive']);this[_0x74de('0x154')](_0x21dc9e,0x1);}else if(ifInterval(_0x21dc9e['dialPredictiveInterval'],_0x21dc9e[_0x74de('0x72')])){this[_0x74de('0x154')](_0x21dc9e,0x1);loggerPredictiveCalls[_0x74de('0x7c')](_0x74de('0x1c2'),_0x21dc9e['startProgressive'],_0x21dc9e[_0x74de('0x3e')]);_0x21dc9e['erlangCalls']=0x0;_0x21dc9e[_0x74de('0x6a')]=0x0;}else if(_0x49c7db<_0x14706e&&_0x21dc9e[_0x74de('0x1c3')]===_0x74de('0x1c4')){freeVariablesPredictive(_0x21dc9e);loggerPredictive['info'](_0x74de('0x1c5'),'Dropped\x20calls\x20day',_0x14706e,'startProgressive',_0x21dc9e[_0x74de('0x3e')]);}else if(_0x1486fc<_0x21dc9e[_0x74de('0x6a')]&&_0x21dc9e[_0x74de('0x1c3')]===_0x74de('0x1c4')){freeVariablesPredictive(_0x21dc9e);loggerPredictive[_0x74de('0x7c')](_0x74de('0x1c6'),_0x74de('0x1c7'),_0x1486fc,_0x74de('0x1c8'),_0x21dc9e[_0x74de('0x6a')],_0x74de('0x72'),_0x21dc9e[_0x74de('0x3e')]);}else if(!ifInterval(_0x21dc9e['dialPredictiveInterval'],_0x21dc9e['startProgressive'])&&_[_0x74de('0x3b')](_0x21dc9e[_0x74de('0x2a')])&&!_[_0x74de('0x3b')](_0x21dc9e[_0x74de('0x72')])){_0x21dc9e[_0x74de('0x2a')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x74de('0x7c')](_0x21dc9e[_0x74de('0x3e')],_0x74de('0x1c9'),_0x21dc9e['startPredictive']);this[_0x74de('0x1ca')](_0x21dc9e['dialPredictiveInterval'])['then'](this[_0x74de('0x1cb')](_0x21dc9e))[_0x74de('0xb9')](mergeDataErlangB(_0x21dc9e))[_0x74de('0xb9')](this[_0x74de('0x1cc')](_0x21dc9e))[_0x74de('0xb0')](loggerCatchPredictive(_0x74de('0x1cd'),_0x21dc9e));}else if(!ifInterval(_0x21dc9e[_0x74de('0x1ce')],_0x21dc9e['startPredictive'])){_0x21dc9e[_0x74de('0x6a')]=0x0;_0x21dc9e['startPredictive']=moment()['format'](_0x74de('0xf7'));loggerPredictive[_0x74de('0x7c')](_0x21dc9e[_0x74de('0x3e')],'recalculate\x20predictive\x20at',_0x21dc9e[_0x74de('0x2a')]);clearInterval(_0x21dc9e[_0x74de('0x8e')]);_0x21dc9e[_0x74de('0x8e')]=undefined;this['averageHandleTime'](_0x21dc9e[_0x74de('0x1ce')])['then'](this['getDataPredictive'](_0x21dc9e))[_0x74de('0xb9')](mergeDataErlangB(_0x21dc9e))[_0x74de('0xb9')](this[_0x74de('0x1cc')](_0x21dc9e))['catch'](loggerCatchPredictive(_0x74de('0x1cf'),_0x21dc9e));}else if(_0x21dc9e[_0x74de('0x6e')]&&_0x2c15e5<_0x21dc9e['predictiveIntervalAvailable']-_0x13768d){freeVariablesPredictive(_0x21dc9e);loggerPredictive[_0x74de('0x7c')](_0x21dc9e[_0x74de('0x3e')],_0x74de('0x1d0'),_0x2c15e5,')\x20are\x20less\x20than\x20threshold\x20(',_0x21dc9e['predictiveIntervalAvailable'],'-',_0x13768d,'=',_0x21dc9e['predictiveIntervalAvailable']-_0x13768d,')');}else if(_0x21dc9e[_0x74de('0x6e')]&&_0x2c15e5>_0x21dc9e[_0x74de('0x6e')]+_0x5a883a){freeVariablesPredictive(_0x21dc9e);loggerPredictive[_0x74de('0x7c')](_0x21dc9e[_0x74de('0x3e')],_0x74de('0x1d0'),_0x2c15e5,_0x74de('0x1d1'),_0x21dc9e[_0x74de('0x6e')],'+',_0x5a883a,'=',_0x21dc9e[_0x74de('0x6e')]+_0x5a883a,')');}};Dialer[_0x74de('0x1c')]['getDataPredictive']=function(_0x58de7c){var _0x16a510=this;return function(_0x49fcbb){return new BPromise(function(_0x57566c,_0x509a20){_[_0x74de('0x8c')](_0x58de7c,_0x49fcbb[0x0]);if(checkGetDataPredictive(_0x49fcbb[0x0])){var _0x155e47=_0x58de7c[_0x74de('0x6e')]=_0x58de7c[_0x74de('0x4e')]+_0x58de7c['available'];var _0x1d78a9=_0x58de7c[_0x74de('0x1ce')]*0x3c;var _0x38591f=_0x49fcbb[0x0]['predictiveIntervalAvgTalktime']+_0x49fcbb[0x0][_0x74de('0x66')];var _0x311e7e=(_0x49fcbb[0x0][_0x74de('0x65')]+_0x49fcbb[0x0][_0x74de('0x69')]+_0x49fcbb[0x0][_0x74de('0x68')])/_0x49fcbb[0x0]['predictiveIntervalTotalCalls'];_0x58de7c[_0x74de('0x6b')]=_0x311e7e>0x0?_0x311e7e:0x1;switch(_0x58de7c[_0x74de('0x1c3')]){case _0x74de('0x1c4'):var _0x1faf0d=_0x58de7c['dialPredictiveOptimizationPercentage']/0x64;return _0x16a510['abandonmentRate'](_0x155e47,_0x1d78a9,_0x38591f,_0x311e7e,_0x1faf0d)[_0x74de('0xb9')](function(_0x4ec5dd){return _0x57566c(_0x4ec5dd);});case _0x74de('0x1d2'):var _0x283b18=_0x58de7c[_0x74de('0x1ba')]/0x64;return _0x16a510[_0x74de('0x1d3')](_0x155e47,_0x1d78a9,_0x38591f,_0x311e7e,_0x283b18)[_0x74de('0xb9')](function(_0x29ea5c){return _0x57566c(_0x29ea5c);});default:return _0x509a20(msgResponse(_0x74de('0x1d4'),_0x74de('0x141'),_0x74de('0x1d5')));}}else{return _0x509a20(msgResponse('[getDataPredictive]','Failure',_0x74de('0x1d6')));}});};};Dialer[_0x74de('0x1c')][_0x74de('0x1d7')]=function(_0x196a86){var _0x4cb509=this;return function(_0x2d8b54){return new BPromise(function(_0x432d9c,_0x672b6d){_['merge'](_0x196a86,_0x2d8b54[0x0]);if(checkGetDataPredictive(_0x2d8b54[0x0])){loggerPredictive[_0x74de('0x7c')](JSON['stringify'](_0x2d8b54[0x0]));if(_0x196a86['dialPredictiveOptimization']===_0x74de('0x1c4')){return _0x4cb509[_0x74de('0xc3')](_0x196a86['id'])[_0x74de('0xb9')](function(_0x108751){var _0x1109e3=_0x196a86[_0x74de('0x4b')]-_0x108751[0x0]['outboundQueuePauses'];var _0xe7300e=_0x196a86[_0x74de('0x1ce')]*0x3c;var _0x596093=_0x2d8b54[0x0][_0x74de('0x67')]+_0x2d8b54[0x0][_0x74de('0x66')];var _0x10bdb6=(_0x2d8b54[0x0][_0x74de('0x65')]+_0x2d8b54[0x0][_0x74de('0x69')]+_0x2d8b54[0x0][_0x74de('0x68')])/_0x2d8b54[0x0][_0x74de('0x6f')];var _0x43dda8=_0x196a86[_0x74de('0x1ba')]/0x64;_0x196a86[_0x74de('0x6d')]=_0x108751[0x0][_0x74de('0x1d8')]||0x0;_0x196a86['predictiveIntervalHitRate']=_0x10bdb6>0x0?_0x10bdb6:0x1;return _0x4cb509['abandonmentRate'](_0x1109e3,_0xe7300e,_0x596093,_0x10bdb6,_0x43dda8);})['then'](function(_0x3afa68){return _0x432d9c(_0x3afa68);})[_0x74de('0xb0')](function(_0x287614){return _0x672b6d(msgResponse('[CatchErlangB]',_0x74de('0x141'),JSON[_0x74de('0x46')](_0x287614)));});}if(_0x196a86[_0x74de('0x1c3')]===_0x74de('0x1d2')){return _0x4cb509[_0x74de('0xc3')](_0x196a86['id'])[_0x74de('0xb9')](function(_0x1d06b3){var _0x16cf5c=_0x196a86[_0x74de('0x4b')]-_0x1d06b3[0x0]['outboundQueuePauses'];var _0x429f82=_0x196a86[_0x74de('0x1ce')]*0x3c;var _0x100901=_0x2d8b54[0x0]['predictiveIntervalAvgTalktime']+_0x2d8b54[0x0]['predictiveIntervalAvgHoldtime'];var _0x363c1e=(_0x2d8b54[0x0][_0x74de('0x65')]+_0x2d8b54[0x0][_0x74de('0x69')]+_0x2d8b54[0x0][_0x74de('0x68')])/_0x2d8b54[0x0][_0x74de('0x6f')];var _0x2db22b=_0x196a86['dialPredictiveOptimizationPercentage']/0x64;_0x196a86[_0x74de('0x6d')]=_0x1d06b3[0x0][_0x74de('0x1d8')]||0x0;_0x196a86['predictiveIntervalHitRate']=_0x363c1e>0x0?_0x363c1e:0x1;return _0x4cb509[_0x74de('0x1d3')](_0x16cf5c,_0x429f82,_0x100901,_0x363c1e,_0x2db22b);})['then'](function(_0x2d1d95){return _0x432d9c(_0x2d1d95);})['catch'](function(_0x5c1ef9){return _0x672b6d(msgResponse(_0x74de('0x1d9'),_0x74de('0x141'),JSON[_0x74de('0x46')](_0x5c1ef9)));});}}else{return _0x672b6d(msgResponse(_0x74de('0x1d4'),_0x74de('0x141'),_0x74de('0x1d6')));}});};};Dialer[_0x74de('0x1c')][_0x74de('0x1cc')]=function(_0x2f433a){var _0xcc15cb=this;return function(){var _0x5af2bf=0x0;var _0x4274e0=Math['floor'](_0x2f433a[_0x74de('0x70')]*0x3e8);if(_0x4274e0>0x0){_0x4274e0=_0x4274e0<0x64?0x64:_0x4274e0;loggerPredictive[_0x74de('0x7c')](_0x2f433a[_0x74de('0x3e')],_0x74de('0x1da'),_0x4274e0,_0x74de('0x47'));_0x2f433a[_0x74de('0x8e')]=setInterval(function(){_0xcc15cb[_0x74de('0x8e')](_0x2f433a);loggerPredictiveCalls[_0x74de('0x7c')](_0x74de('0x1db'),_0x5af2bf+=0x1);},_0x4274e0);}else{loggerPredictive[_0x74de('0x7c')](_0x2f433a[_0x74de('0x3e')],_0x74de('0x1dc'));}};};Dialer[_0x74de('0x1c')]['checkContactBlack']=function(_0x176a9e,_0x4f7e97){var _0x2500c3=this;return function(_0x2fd1c3){if(_[_0x74de('0x7b')](_0x2fd1c3)){if(_[_0x74de('0xac')](_0x4f7e97[_0x74de('0xcd')])||!_0x4f7e97[_0x74de('0x1dd')]){if(_0x176a9e[_0x74de('0x152')]===_0x74de('0x9')){_0x176a9e[_0x74de('0x128')]=_[_0x74de('0x3b')](_0x176a9e[_0x74de('0x128')])?!![]:_0x176a9e[_0x74de('0x128')];var _0x385904=uuid['v4']();_0x2500c3['actions'][_0x385904]=new Action(_0x176a9e,_0x4f7e97,_0x385904);loggerBooked[_0x74de('0x7c')](_0x74de('0x1de'),_0x385904,_0x74de('0x1df'),JSON[_0x74de('0x46')](_0x176a9e[_0x74de('0x128')]),_0x74de('0x1e0'),_0x176a9e['name']);if(_0x176a9e[_0x74de('0x128')]){_0x176a9e[_0x74de('0x128')]=![];_0x2500c3[_0x74de('0x122')][_0x2500c3[_0x74de('0xab')][_0x385904][_0x74de('0xb3')]]=[];ami[_0x74de('0xad')]({'actionid':_0x385904,'action':_0x74de('0x1e1'),'queue':_0x176a9e[_0x74de('0x3e')]})[_0x74de('0xb0')](function(){_0x2500c3[_0x74de('0xb1')](_0x176a9e);_0x2500c3[_0x74de('0xbb')]({'active':![],'ContactId':_0x2500c3[_0x74de('0xab')][_0x385904][_0x74de('0xcc')],'ListId':_0x2500c3[_0x74de('0xab')][_0x385904]['ListId'],'VoiceQueueId':_0x2500c3['actions'][_0x385904][_0x74de('0xce')]||undefined,'CampaignId':_0x2500c3[_0x74de('0xab')][_0x385904][_0x74de('0xcf')]||undefined})['catch'](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x2500c3[_0x74de('0xab')][_0x385904];});}else{loggerBooked['info'](_0x74de('0x1e2'),JSON[_0x74de('0x46')](_0x176a9e[_0x74de('0x128')]),_0x74de('0x1e0'),_0x176a9e['name']);_0x2500c3[_0x74de('0xb1')](_0x176a9e);_0x2500c3['rescheduleContact']({'active':![],'ContactId':_0x2500c3[_0x74de('0xab')][_0x385904][_0x74de('0xcc')],'ListId':_0x2500c3[_0x74de('0xab')][_0x385904]['ListId'],'VoiceQueueId':_0x2500c3[_0x74de('0xab')][_0x385904][_0x74de('0xce')]||undefined,'CampaignId':_0x2500c3[_0x74de('0xab')][_0x385904][_0x74de('0xcf')]||undefined})[_0x74de('0xb0')](loggerCatch(_0x74de('0x1e3')));delete _0x2500c3[_0x74de('0xab')][_0x385904];}}else{return _0x2500c3[_0x74de('0x15f')](_0x176a9e,_0x4f7e97);}}else{if(getDiff(_0x4f7e97[_0x74de('0x1e4')])<_0x176a9e['dialRecallMeTimeout']*0x3c){if(_0x4f7e97[_0x74de('0x1e5')]&&!_0x4f7e97[_0x74de('0x1e5')]['voicePause']){_0x2500c3['preview'][_0x74de('0x1e6')](_0x4f7e97['id'])['finally'](function(){_0x2500c3[_0x74de('0xb1')](_0x176a9e);});}else{_0x2500c3[_0x74de('0x1e7')]({'active':![]},_0x4f7e97['id'],0x1)[_0x74de('0x1f')](function(){_0x2500c3[_0x74de('0xb1')](_0x176a9e);});}}else{_0x176a9e[_0x74de('0x62')]+=0x1;_0x2500c3[_0x74de('0xb1')](_0x176a9e);if(_0x176a9e[_0x74de('0x1e8')]){_0x2500c3['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x4f7e97['ContactId'],'ListId':_0x4f7e97[_0x74de('0xf8')],'VoiceQueueId':_0x4f7e97[_0x74de('0xce')]||undefined,'CampaignId':_0x4f7e97[_0x74de('0xcf')]||undefined})[_0x74de('0xb0')](loggerCatch(_0x74de('0x1e9')));_0x2500c3[_0x74de('0xc6')](createObjHistory(_0x176a9e,_0x4f7e97,_0x74de('0x1ea'),0x17,_0x74de('0x1eb')))[_0x74de('0xb0')](loggerCatch(_0x74de('0x1ec')));}else{_0x2500c3[_0x74de('0xd5')](createObjHistory(_0x176a9e,_0x4f7e97,_0x74de('0x1ed'),0x16,'RecallFailedTimeout'),_0x74de('0x1ee'),_0x74de('0x1ef'));}}}}else{_0x176a9e[_0x74de('0x5a')]+=0x1;_0x2500c3[_0x74de('0xd5')](createObjHistory(_0x176a9e,_0x4f7e97,_0x74de('0x1f0'),0xd,_0x74de('0x1f1')),_0x74de('0x1f2'),'[Originate][MoveBlacklist]');throw _0x74de('0x1f3');}};};Dialer['prototype'][_0x74de('0x156')]=function(_0x42688b){var _0x231529=this;var _0x5ae790=_0x42688b['limitCalls']-_0x42688b[_0x74de('0x97')]-_0x42688b[_0x74de('0xbf')];emitCampaignSummary(_0x42688b);if(_0x5ae790>0x0){if(_0x5ae790>this[_0x74de('0x25')]){_0x5ae790=this[_0x74de('0x25')];}_0x42688b['temp']+=_0x5ae790;this[_0x74de('0xc1')](_0x42688b['id'],_0x5ae790,_0x42688b[_0x74de('0x1f4')],_0x42688b)[_0x74de('0xb9')](function(_0x4bc915){_0x42688b[_0x74de('0xbf')]-=_0x5ae790;_0x42688b[_0x74de('0xbf')]=_0x42688b[_0x74de('0xbf')]>0x0?_0x42688b[_0x74de('0xbf')]:0x0;if(!checkContactEmpty(_0x4bc915)){_0x42688b[_0x74de('0x3c')]=_0x74de('0x9f');logger[_0x74de('0x7c')]('[getContactCampaign2][Empty]'+_0x42688b[_0x74de('0x3e')]);}else{_0x42688b[_0x74de('0x97')]+=_0x4bc915[_0x74de('0x96')];_0x42688b[_0x74de('0x3c')]=_0x74de('0x1f5');for(var _0x1a2d6c=0x0;_0x1a2d6c<_0x4bc915['length'];_0x1a2d6c+=0x1){_0x42688b[_0x74de('0x1f6')]+=0x1;if(_['isNil'](_0x4bc915[_0x1a2d6c])||_[_0x74de('0xac')](_0x4bc915[_0x1a2d6c][_0x74de('0x175')])||_['isNil'](_0x4bc915[_0x1a2d6c][_0x74de('0x175')][_0x74de('0x163')])){_0x231529[_0x74de('0xca')]('[actionOriginate]\x20',_0x42688b,_0x4bc915[_0x1a2d6c]);}else{_0x231529[_0x74de('0x1f7')](_['pick'](_0x4bc915[_0x1a2d6c],[_0x74de('0xcf'),_0x74de('0x1f8')]))[_0x74de('0xb9')](_0x231529[_0x74de('0x1f9')](_0x42688b,_0x4bc915[_0x1a2d6c]))[_0x74de('0xb0')](_0x231529[_0x74de('0xc9')](_0x74de('0x1fa'),_0x42688b));}}}})[_0x74de('0xb0')](loggerGetContactDialer(_0x74de('0x1fb'),_0x42688b,_0x5ae790));}};Dialer[_0x74de('0x1c')][_0x74de('0x154')]=function(_0x2b06f1,_0x36b63d){var _0x2ef347=this;var _0x1f4617=[];var _0x3bf735=_0x36b63d>=0x1?_0x36b63d:0x1;if(_0x2b06f1[_0x74de('0x152')]==='booked'){_0x3bf735=0x1;}var _0x49e353=Math['floor'](_0x2b06f1[_0x74de('0x4a')]*_0x3bf735)-_0x2b06f1[_0x74de('0x97')]-_0x2b06f1[_0x74de('0xbf')];emitVoiceQueueSummary(_0x2b06f1);if(_0x2b06f1[_0x74de('0x1fc')]>0x0){var _0x153bae=_0x2b06f1[_0x74de('0x1fc')]-_0x2b06f1[_0x74de('0x97')]-_0x2b06f1[_0x74de('0x4e')]-_0x2b06f1[_0x74de('0xbf')]-_0x2b06f1['pTalking'];if(_0x49e353>_0x153bae){_0x49e353=_0x153bae;}}if(_0x49e353>0x0){if(_0x2b06f1['dialMethod']===_0x74de('0x9')){_0x49e353=0x1;}if(_0x49e353>this[_0x74de('0x25')]){_0x49e353=this['maxNumberOriginate'];}_0x2b06f1['temp']+=_0x49e353;for(var _0x518ad8 in this[_0x74de('0x23')]){if(typeof this['agents'][_0x518ad8]!==_0x74de('0x98')){if(this[_0x74de('0x23')][_0x518ad8][_0x74de('0xa6')]===_0x74de('0x1fd')&&this['agents'][_0x518ad8][_0x74de('0xae')]===_0x74de('0x1fe')){_0x1f4617['push'](this[_0x74de('0x23')][_0x518ad8]['id']);}}}this[_0x74de('0xbe')](_0x2b06f1['id'],_0x1f4617,_0x49e353,_0x2b06f1['dialOrderByScheduledAt'],_0x2b06f1)[_0x74de('0xb9')](function(_0x5d3630){_0x2b06f1['temp']-=_0x49e353;_0x2b06f1[_0x74de('0xbf')]=_0x2b06f1['temp']>0x0?_0x2b06f1[_0x74de('0xbf')]:0x0;if(!checkContactEmpty(_0x5d3630)){_0x2ef347['countReScheduled'](_0x2b06f1)[_0x74de('0xb9')](sendMessageReschedule(_0x2b06f1))[_0x74de('0xb0')](loggerCatch(_0x74de('0xb7')));}else{_0x2b06f1['originated']+=_0x5d3630[_0x74de('0x96')];_0x2b06f1[_0x74de('0x3c')]=_0x2b06f1[_0x74de('0x152')]===_0x74de('0x9')?_0x74de('0x169'):_0x74de('0x1f5');for(var _0x35ac7f=0x0;_0x35ac7f<_0x5d3630[_0x74de('0x96')];_0x35ac7f+=0x1){if(_[_0x74de('0xac')](_0x5d3630[_0x35ac7f])||_[_0x74de('0xac')](_0x5d3630[_0x35ac7f][_0x74de('0x175')])||_[_0x74de('0xac')](_0x5d3630[_0x35ac7f][_0x74de('0x175')][_0x74de('0x163')])){_0x2ef347[_0x74de('0xca')](_0x74de('0x1ff'),_0x2b06f1,_0x5d3630[_0x35ac7f]);}else{_0x2ef347[_0x74de('0xb8')](_[_0x74de('0x124')](_0x5d3630[_0x35ac7f],[_0x74de('0xce'),'Contact.phone']))[_0x74de('0xb9')](_0x2ef347[_0x74de('0x1f9')](_0x2b06f1,_0x5d3630[_0x35ac7f]))['catch'](_0x2ef347[_0x74de('0xc9')](_0x74de('0x1ff'),_0x2b06f1));}}}})[_0x74de('0xb0')](loggerGetContactDialer(_0x74de('0x200'),_0x2b06f1,_0x49e353));}};Dialer[_0x74de('0x1c')][_0x74de('0x8e')]=function(_0x5ac63b){if(_0x5ac63b[_0x74de('0x1fc')]>0x0){var _0x2b51f1=_0x5ac63b['dialLimitQueue']-_0x5ac63b[_0x74de('0x97')]-_0x5ac63b['talking'];if(_0x2b51f1>0x0){this[_0x74de('0x201')](_0x5ac63b);}else{loggerPredictiveCalls[_0x74de('0x7c')](_0x74de('0x202'));}}else{this[_0x74de('0x201')](_0x5ac63b);}};Dialer[_0x74de('0x1c')][_0x74de('0x201')]=function(_0x33a4d5){var _0x59ae4d=this;var _0x3f69fb=[];_0x33a4d5[_0x74de('0x97')]+=0x1;for(var _0x7c7668 in this['agents']){if(typeof this['agents'][_0x7c7668]!==_0x74de('0x98')){if(this['agents'][_0x7c7668][_0x74de('0xa6')]===_0x74de('0x1fd')&&this['agents'][_0x7c7668][_0x74de('0xae')]===_0x74de('0x1fe')){_0x3f69fb[_0x74de('0x123')](this[_0x74de('0x23')][_0x7c7668]['id']);}}}this['getContactDialer'](_0x33a4d5['id'],_0x3f69fb,0x1,_0x33a4d5[_0x74de('0x1f4')],_0x33a4d5)['then'](function(_0x3e2398){if(!checkContactEmpty(_0x3e2398)){checkContactLowerLimitOriginate(_0x33a4d5,0x1,0x0);_0x59ae4d[_0x74de('0xb6')](_0x33a4d5)['then'](sendMessageReschedule(_0x33a4d5))['catch'](loggerCatch(_0x74de('0xb7')));}else{_0x33a4d5[_0x74de('0x3c')]=_0x74de('0x1f5');if(_['isNil'](_0x3e2398[0x0])||_[_0x74de('0xac')](_0x3e2398[0x0][_0x74de('0x175')])||_['isNil'](_0x3e2398[0x0][_0x74de('0x175')][_0x74de('0x163')])){_0x59ae4d[_0x74de('0xca')](_0x74de('0x1ff'),_0x33a4d5,_0x3e2398[0x0]);}else{_0x59ae4d['checkIsBlackList'](_[_0x74de('0x124')](_0x3e2398[0x0],['VoiceQueueId',_0x74de('0x1f8')]))[_0x74de('0xb9')](_0x59ae4d[_0x74de('0x1f9')](_0x33a4d5,_0x3e2398[0x0]))[_0x74de('0xb0')](_0x59ae4d[_0x74de('0xc9')]('[actionOriginatePredictive]\x20',_0x33a4d5));}}})[_0x74de('0xb0')](loggerGetContactDialer(_0x74de('0x203'),_0x33a4d5,0x1));emitVoiceQueueSummary(_0x33a4d5);};Dialer[_0x74de('0x1c')][_0x74de('0x204')]=function(_0x311b9d,_0xdf7da3,_0x4f8cda,_0x15a8f8,_0x4667e6,_0x4a50e6){loggerPredictive[_0x74de('0x7c')](_0x74de('0x205'));loggerPredictive[_0x74de('0x7c')](_0x74de('0x206'),_0x311b9d);loggerPredictive[_0x74de('0x7c')](_0x74de('0x207'),_0xdf7da3);loggerPredictive[_0x74de('0x7c')]('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',_0x4f8cda);loggerPredictive['info'](_0x74de('0x208'),_0x15a8f8);loggerPredictive[_0x74de('0x7c')](_0x74de('0x209'),_0x4667e6);loggerPredictive['info'](_0x74de('0x82'));return new BPromise(function(_0x4cd317,_0xbbf91b){if(_0x311b9d<=0x0||isNaN(_0x311b9d)){return _0xbbf91b(msgResponse(_0x74de('0x20a'),_0x74de('0x187'),_0x74de('0x20b')+_0x311b9d));}if(_0x4f8cda<=0x0||isNaN(_0x4f8cda)){return _0xbbf91b(msgResponse(_0x74de('0x20a'),'Error','Ts\x20=\x20'+_0x4f8cda));}if(_0x15a8f8<=0x0||isNaN(_0x15a8f8)){return _0xbbf91b(msgResponse(_0x74de('0x20a'),_0x74de('0x187'),_0x74de('0x20c')+_0x15a8f8));}if(_0xdf7da3<=0x0||isNaN(_0xdf7da3)){return _0xbbf91b(msgResponse(_0x74de('0x20a'),_0x74de('0x187'),_0x74de('0x20d')+_0xdf7da3));}if(_0x4667e6<=0x0||isNaN(_0x4667e6)){return _0xbbf91b(msgResponse(_0x74de('0x20a'),_0x74de('0x187'),_0x74de('0x20e')+_0x4667e6));}_0x4a50e6=_0x4a50e6||0x0;var _0x321ac4=0x1/_0x4f8cda;var _0x193972=0x0;var _0x59179d=0x0;var _0xffdb67=0x0;var _0x1ba0e2=0x0;for(var _0x5844e3=0x0;_0xffdb67<_0x4667e6;_0x5844e3+=0x1){_0x59179d=_0x5844e3/_0xdf7da3;_0x193972=(_0x15a8f8*_0x59179d+_0x4a50e6)/_0x321ac4;_0xffdb67=erlangb(_0x193972,_0x311b9d);_0x1ba0e2=_0x193972/_0x311b9d*(0x1-erlangb(_0x193972,_0x311b9d));}return _0x4cd317({'erlangCalls':_0x5844e3,'erlangCallToSecond':_0xdf7da3/_0x5844e3,'erlangAbandonmentRate':_0xffdb67,'erlangBusyFactor':_0x1ba0e2});});};Dialer[_0x74de('0x1c')][_0x74de('0x1d3')]=function(_0x1a5983,_0x1b161b,_0x2edeb3,_0x41d198,_0x42307d,_0x57df10){loggerPredictive[_0x74de('0x7c')](_0x74de('0x20f'));loggerPredictive[_0x74de('0x7c')](_0x74de('0x206'),_0x1a5983);loggerPredictive[_0x74de('0x7c')](_0x74de('0x207'),_0x1b161b);loggerPredictive[_0x74de('0x7c')]('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',_0x2edeb3);loggerPredictive['info'](_0x74de('0x208'),_0x41d198);loggerPredictive[_0x74de('0x7c')](_0x74de('0x210'),_0x42307d);loggerPredictive[_0x74de('0x7c')]('---------------------------');return new BPromise(function(_0x372a9e,_0x985bc1){if(_0x1a5983<=0x0||isNaN(_0x1a5983)){return _0x985bc1(msgResponse(_0x74de('0x211'),'Error','m\x20=\x20'+_0x1a5983));}if(_0x2edeb3<=0x0||isNaN(_0x2edeb3)){return _0x985bc1(msgResponse(_0x74de('0x211'),_0x74de('0x187'),_0x74de('0x212')+_0x2edeb3));}if(_0x41d198<=0x0||isNaN(_0x41d198)){return _0x985bc1(msgResponse('[busyFactor]',_0x74de('0x187'),_0x74de('0x20c')+_0x41d198));}if(_0x1b161b<=0x0||isNaN(_0x1b161b)){return _0x985bc1(msgResponse(_0x74de('0x211'),_0x74de('0x187'),'interval\x20=\x20'+_0x1b161b));}if(_0x42307d<=0x0||isNaN(_0x42307d)){return _0x985bc1(msgResponse(_0x74de('0x211'),_0x74de('0x187'),_0x74de('0x213')+_0x42307d));}_0x57df10=_0x57df10||0x0;var _0x245c4e=0x1/_0x2edeb3;var _0x155f89=0x0;var _0x432a21=0x0;var _0x72aaec=0x0;var _0x5e7bb1=0x0;for(var _0x40fdf1=0x0;_0x5e7bb1<_0x42307d;_0x40fdf1+=0x1){_0x432a21=_0x40fdf1/_0x1b161b;_0x155f89=(_0x41d198*_0x432a21+_0x57df10)/_0x245c4e;_0x72aaec=erlangb(_0x155f89,_0x1a5983);_0x5e7bb1=_0x155f89/_0x1a5983*(0x1-erlangb(_0x155f89,_0x1a5983));}return _0x372a9e({'erlangCalls':_0x40fdf1,'erlangCallToSecond':_0x1b161b/_0x40fdf1,'erlangAbandonmentRate':_0x72aaec,'erlangBusyFactor':_0x5e7bb1});});};module[_0x74de('0x214')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index ce7b279..f20245f 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 _0xf7f7=['scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countabandonedretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','endtime','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds'];(function(_0x27fc6d,_0x138b22){var _0x1c7ece=function(_0x61d08){while(--_0x61d08){_0x27fc6d['push'](_0x27fc6d['shift']());}};_0x1c7ece(++_0x138b22);}(_0xf7f7,0xf6));var _0x7f7f=function(_0x35d8af,_0x14fd75){_0x35d8af=_0x35d8af-0x0;var _0x1d08b0=_0xf7f7[_0x35d8af];return _0x1d08b0;};'use strict';var util=require(_0x7f7f('0x0'));var _=require(_0x7f7f('0x1'));var moment=require(_0x7f7f('0x2'));function getSeconds(_0x1e9816,_0x580cd2){var _0x22087a=moment(_0x1e9816)[_0x7f7f('0x3')](0x0);var _0x52e9ae=moment(_0x580cd2)[_0x7f7f('0x3')](0x0);return _0x22087a[_0x7f7f('0x4')](_0x52e9ae,_0x7f7f('0x5'));}function QueueCallerAbandon(_0x53161b,_0x1ebb4a){this[_0x7f7f('0x6')]=_0x53161b['scheduledat'];this[_0x7f7f('0x7')]=_0x53161b[_0x7f7f('0x7')];this['campaigntype']=_0x53161b[_0x7f7f('0x7')]===_0x7f7f('0x8')?_0x7f7f('0x9'):_0x53161b[_0x7f7f('0x7')];this[_0x7f7f('0xa')]=_0x53161b[_0x7f7f('0xa')];this[_0x7f7f('0xb')]=_0x53161b[_0x7f7f('0xb')];this[_0x7f7f('0xc')]=_0x53161b[_0x7f7f('0xc')];this['countglobal']=_0x53161b['countbusyretry']+_0x53161b[_0x7f7f('0xb')]+_0x53161b['countnoanswerretry']+_0x53161b[_0x7f7f('0xd')]+_0x53161b[_0x7f7f('0xe')]+_0x53161b['countabandonedretry']+_0x53161b[_0x7f7f('0xf')]+_0x53161b['countagentrejectretry'];this[_0x7f7f('0xd')]=_0x53161b[_0x7f7f('0xd')];this['countdropretry']=_0x53161b[_0x7f7f('0xe')];this[_0x7f7f('0x10')]=_0x53161b[_0x7f7f('0x10')];this[_0x7f7f('0xf')]=_0x53161b[_0x7f7f('0xf')];this['countagentrejectretry']=_0x53161b['countagentrejectretry'];this['uniqueid']=_0x1ebb4a[_0x7f7f('0x11')];this[_0x7f7f('0x12')]=_0x53161b[_0x7f7f('0x13')];this[_0x7f7f('0x14')]=_0x53161b[_0x7f7f('0x15')];this[_0x7f7f('0x16')]=_0x53161b[_0x7f7f('0x16')];this[_0x7f7f('0x17')]=_0x53161b[_0x7f7f('0x17')];this[_0x7f7f('0x18')]=_0x53161b[_0x7f7f('0x18')];this[_0x7f7f('0x19')]=this[_0x7f7f('0x18')];this['ringtime']=getSeconds(_0x53161b[_0x7f7f('0x17')],_0x53161b[_0x7f7f('0x16')]);this['holdtime']=getSeconds(this[_0x7f7f('0x18')],_0x53161b[_0x7f7f('0x17')]);this[_0x7f7f('0x1a')]=0x0;this[_0x7f7f('0x9')]=_0x1ebb4a[_0x7f7f('0x9')];this[_0x7f7f('0x1b')]=_0x1ebb4a[_0x7f7f('0x1c')];this[_0x7f7f('0x1d')]=_0x1ebb4a[_0x7f7f('0x1d')];this[_0x7f7f('0x1e')]=_0x53161b[_0x7f7f('0x1e')];this[_0x7f7f('0x1f')]=_0x53161b[_0x7f7f('0x1f')];this[_0x7f7f('0x20')]=_0x53161b[_0x7f7f('0x20')];this[_0x7f7f('0x21')]=_0x53161b[_0x7f7f('0x21')];this[_0x7f7f('0x22')]=_0x53161b[_0x7f7f('0x22')];this[_0x7f7f('0x23')]=_0x53161b[_0x7f7f('0x23')];this[_0x7f7f('0x24')]=_0x53161b[_0x7f7f('0x24')];this[_0x7f7f('0x25')]=_0x53161b[_0x7f7f('0x25')];this[_0x7f7f('0x26')]=_0x53161b[_0x7f7f('0x26')];this[_0x7f7f('0x27')]=_0x53161b[_0x7f7f('0x27')]||'';this[_0x7f7f('0x28')]=_0x53161b[_0x7f7f('0x28')]||'';}module[_0x7f7f('0x29')]=QueueCallerAbandon; \ No newline at end of file +var _0x42fa=['exports','util','lodash','milliseconds','diff','seconds','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','endtime','ringtime','holdtime','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname'];(function(_0x3868ef,_0x3b86db){var _0x2ed3c6=function(_0x287c5d){while(--_0x287c5d){_0x3868ef['push'](_0x3868ef['shift']());}};_0x2ed3c6(++_0x3b86db);}(_0x42fa,0x161));var _0xa42f=function(_0x41b9df,_0x13ffa3){_0x41b9df=_0x41b9df-0x0;var _0x31c181=_0x42fa[_0x41b9df];return _0x31c181;};'use strict';var util=require(_0xa42f('0x0'));var _=require(_0xa42f('0x1'));var moment=require('moment');function getSeconds(_0x592b48,_0x406786){var _0x21d0ad=moment(_0x592b48)[_0xa42f('0x2')](0x0);var _0xe7cc95=moment(_0x406786)[_0xa42f('0x2')](0x0);return _0x21d0ad[_0xa42f('0x3')](_0xe7cc95,_0xa42f('0x4'));}function QueueCallerAbandon(_0x47037a,_0x4da108){this[_0xa42f('0x5')]=_0x47037a[_0xa42f('0x5')];this['type']=_0x47037a[_0xa42f('0x6')];this[_0xa42f('0x7')]=_0x47037a[_0xa42f('0x6')]===_0xa42f('0x8')?_0xa42f('0x9'):_0x47037a[_0xa42f('0x6')];this[_0xa42f('0xa')]=_0x47037a[_0xa42f('0xa')];this[_0xa42f('0xb')]=_0x47037a[_0xa42f('0xb')];this[_0xa42f('0xc')]=_0x47037a['countnoanswerretry'];this['countglobal']=_0x47037a[_0xa42f('0xa')]+_0x47037a[_0xa42f('0xb')]+_0x47037a[_0xa42f('0xc')]+_0x47037a['countnosuchnumberretry']+_0x47037a[_0xa42f('0xd')]+_0x47037a[_0xa42f('0xe')]+_0x47037a['countmachineretry']+_0x47037a[_0xa42f('0xf')];this['countnosuchnumberretry']=_0x47037a['countnosuchnumberretry'];this[_0xa42f('0xd')]=_0x47037a[_0xa42f('0xd')];this[_0xa42f('0xe')]=_0x47037a['countabandonedretry'];this[_0xa42f('0x10')]=_0x47037a['countmachineretry'];this[_0xa42f('0xf')]=_0x47037a['countagentrejectretry'];this[_0xa42f('0x11')]=_0x4da108[_0xa42f('0x11')];this[_0xa42f('0x12')]=_0x47037a[_0xa42f('0x13')];this[_0xa42f('0x14')]=_0x47037a[_0xa42f('0x15')];this['starttime']=_0x47037a[_0xa42f('0x16')];this[_0xa42f('0x17')]=_0x47037a[_0xa42f('0x17')];this['droptime']=_0x47037a[_0xa42f('0x18')];this[_0xa42f('0x19')]=this['droptime'];this[_0xa42f('0x1a')]=getSeconds(_0x47037a[_0xa42f('0x17')],_0x47037a[_0xa42f('0x16')]);this[_0xa42f('0x1b')]=getSeconds(this[_0xa42f('0x18')],_0x47037a[_0xa42f('0x17')]);this[_0xa42f('0x1c')]=0x0;this[_0xa42f('0x9')]=_0x4da108['queue'];this[_0xa42f('0x1d')]=_0x4da108[_0xa42f('0x1e')];this[_0xa42f('0x1f')]=_0x4da108[_0xa42f('0x1f')];this[_0xa42f('0x20')]=_0x47037a[_0xa42f('0x20')];this[_0xa42f('0x21')]=_0x47037a[_0xa42f('0x21')];this[_0xa42f('0x22')]=_0x47037a[_0xa42f('0x22')];this[_0xa42f('0x23')]=_0x47037a[_0xa42f('0x23')];this[_0xa42f('0x24')]=_0x47037a[_0xa42f('0x24')];this[_0xa42f('0x25')]=_0x47037a[_0xa42f('0x25')];this[_0xa42f('0x26')]=_0x47037a[_0xa42f('0x26')];this[_0xa42f('0x27')]=_0x47037a[_0xa42f('0x27')];this[_0xa42f('0x28')]=_0x47037a[_0xa42f('0x28')];this[_0xa42f('0x29')]=_0x47037a[_0xa42f('0x29')]||'';this[_0xa42f('0x2a')]=_0x47037a['originatecalleridname']||'';}module[_0xa42f('0x2b')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index f19f99c..0cb5be3 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(_0x31a303,_0x307f6b){var _0x3bc7a8=function(_0x3f374f){while(--_0x3f374f){_0x31a303['push'](_0x31a303['shift']());}};_0x3bc7a8(++_0x307f6b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xa9e0[_0x3a6efd];return _0x487b9a;};'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(_0x177803,_0x383358){var _0x55b3f8=function(_0x13bc67){while(--_0x13bc67){_0x177803['push'](_0x177803['shift']());}};_0x55b3f8(++_0x383358);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'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 170ffda..2d26332 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 _0x1563=['then','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','SENDING\x20FAILED:\x20','faxstatusstring','SENDING\x20FAILED','execOriginate','FaxAccountId','[Fax][execOriginate][success]','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','Trunk','isValid','Trunk\x20Reachable','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','format','status','reachable','unmonitored','checkTrunk','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','util','bluebird','path','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./channel','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','faxAccounts','trunks','actions','newchannel','varset','syncVarSet','bind','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','syncOriginateResponse','prototype','syncNewchannel','context','from-voip-provider','hasOwnProperty','exten','localstationid','channels','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','syncNewState','channelstate','channelstatedesc','operation','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','message','create','.pdf','notify','parse','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','response','reason','update','AttachmentId'];(function(_0x52f22c,_0x3a72f5){var _0x12e45d=function(_0x1cf56f){while(--_0x1cf56f){_0x52f22c['push'](_0x52f22c['shift']());}};_0x12e45d(++_0x3a72f5);}(_0x1563,0x129));var _0x3156=function(_0x173dd9,_0x4ecf44){_0x173dd9=_0x173dd9-0x0;var _0x5a0d5a=_0x1563[_0x173dd9];return _0x5a0d5a;};'use strict';var util=require(_0x3156('0x0'));var _=require('lodash');var BPromise=require(_0x3156('0x1'));var uuid=require('uuid');var moment=require('moment');var path=require(_0x3156('0x2'));var tiff2pdf=require('tiff2pdf');var gs=require(_0x3156('0x3'));var logger=require(_0x3156('0x4'))(_0x3156('0x5'));var ami=require(_0x3156('0x6'));var rpcDb=require(_0x3156('0x7'));var Channel=require(_0x3156('0x8'));var ut=require('./util/util');var Action=require(_0x3156('0x9'));var faxAccount=require(_0x3156('0xa'));var attachment=require(_0x3156('0xb'));var faxMessage=require(_0x3156('0xc'));function Fax(_0x517d0a){this['channels']={};this[_0x3156('0xd')]=_0x517d0a['faxAccounts'];this[_0x3156('0xe')]=_0x517d0a[_0x3156('0xe')];this[_0x3156('0xf')]={};ami['on'](_0x3156('0x10'),this['syncNewchannel']['bind'](this));ami['on'](_0x3156('0x11'),this[_0x3156('0x12')][_0x3156('0x13')](this));ami['on']('newstate',this['syncNewState'][_0x3156('0x13')](this));ami['on'](_0x3156('0x14'),this[_0x3156('0x15')][_0x3156('0x13')](this));ami['on'](_0x3156('0x16'),this[_0x3156('0x17')][_0x3156('0x13')](this));ami['on'](_0x3156('0x18'),this[_0x3156('0x19')][_0x3156('0x13')](this));ami['on'](_0x3156('0x1a'),this[_0x3156('0x1b')][_0x3156('0x13')](this));ami['on']('originateresponse',this[_0x3156('0x1c')][_0x3156('0x13')](this));}Fax[_0x3156('0x1d')][_0x3156('0x1e')]=function(_0x4b4f36){if(_0x4b4f36[_0x3156('0x1f')]===_0x3156('0x20')){for(var _0x3af1ac in this[_0x3156('0xd')]){if(this[_0x3156('0xd')][_0x3156('0x21')](_0x3af1ac)){if(_0x4b4f36[_0x3156('0x22')]===this['faxAccounts'][_0x3af1ac][_0x3156('0x23')]){this['channels'][_0x4b4f36['uniqueid']]={};this[_0x3156('0x24')][_0x4b4f36[_0x3156('0x25')]][_0x3156('0x26')]=_0x4b4f36[_0x3156('0x26')];this[_0x3156('0x24')][_0x4b4f36['uniqueid']]['id']=this[_0x3156('0xd')][_0x3af1ac]['id'];this[_0x3156('0x24')][_0x4b4f36[_0x3156('0x25')]][_0x3156('0x27')]=this[_0x3156('0xd')][_0x3af1ac][_0x3156('0x27')];logger[_0x3156('0x28')](_0x4b4f36[_0x3156('0x25')],_0x3156('0x29'));}}}}if(this['actions'][_0x4b4f36[_0x3156('0x25')]]){this[_0x3156('0x24')][_0x4b4f36[_0x3156('0x25')]]={};this[_0x3156('0x24')][_0x4b4f36['uniqueid']][_0x3156('0x26')]=_0x4b4f36[_0x3156('0x26')];logger[_0x3156('0x28')](_0x4b4f36[_0x3156('0x25')],'\x20syncNewchannel\x20');}};Fax[_0x3156('0x1d')]['syncVarSet']=function(_0x35ddaa){if(this[_0x3156('0x24')][_0x35ddaa[_0x3156('0x25')]]){for(var _0xc6e2a4 in _0x35ddaa['variable']){if(_0x35ddaa[_0x3156('0x2a')][_0x3156('0x21')](_0xc6e2a4)){this[_0x3156('0x24')][_0x35ddaa[_0x3156('0x25')]][_0xc6e2a4]=_0x35ddaa[_0x3156('0x2b')];}}}};Fax[_0x3156('0x1d')][_0x3156('0x2c')]=function(_0x5e5eb6){if(this[_0x3156('0x24')][_0x5e5eb6[_0x3156('0x25')]]){this[_0x3156('0x24')][_0x5e5eb6[_0x3156('0x25')]][_0x3156('0x2d')]=_0x5e5eb6['channelstate'];this[_0x3156('0x24')][_0x5e5eb6[_0x3156('0x25')]][_0x3156('0x2e')]=_0x5e5eb6[_0x3156('0x2e')];}};Fax[_0x3156('0x1d')][_0x3156('0x15')]=function(_0x3c524){if(this[_0x3156('0x24')][_0x3c524[_0x3156('0x25')]]){for(var _0x5e516c in _0x3c524[_0x3156('0x2a')]){if(_0x3c524[_0x3156('0x2a')]['hasOwnProperty'](_0x5e516c)){this[_0x3156('0x24')][_0x3c524[_0x3156('0x25')]][_0x5e516c]=_0x3c524[_0x3156('0x2b')];}}}};Fax['prototype']['syncFaxStatus']=function(_0x5add54){if(this[_0x3156('0x24')][_0x5add54[_0x3156('0x25')]]){this[_0x3156('0x24')][_0x5add54[_0x3156('0x25')]][_0x3156('0x2f')]=_0x5add54[_0x3156('0x2f')];this[_0x3156('0x24')][_0x5add54['uniqueid']]['status']=_0x5add54['status'];this['channels'][_0x5add54[_0x3156('0x25')]][_0x3156('0x23')]=_0x5add54[_0x3156('0x23')];this['channels'][_0x5add54[_0x3156('0x25')]][_0x3156('0x30')]=_0x5add54[_0x3156('0x30')];logger[_0x3156('0x28')](_0x5add54['uniqueid'],_0x3156('0x31'));}};Fax[_0x3156('0x1d')]['syncReceiveFax']=function(_0x2ea099){var _0x4082fb=this;if(this[_0x3156('0x24')][_0x2ea099[_0x3156('0x25')]]){var _0x5d7968=this[_0x3156('0x24')][_0x2ea099['uniqueid']]['id'];this[_0x3156('0x24')][_0x2ea099[_0x3156('0x25')]][_0x3156('0x32')]=_0x2ea099[_0x3156('0x32')];this['channels'][_0x2ea099['uniqueid']][_0x3156('0x33')]=_0x2ea099[_0x3156('0x33')];this[_0x3156('0x24')][_0x2ea099[_0x3156('0x25')]]['localstationid']=_0x2ea099[_0x3156('0x23')];this[_0x3156('0x24')][_0x2ea099[_0x3156('0x25')]][_0x3156('0x34')]=_0x2ea099[_0x3156('0x34')];this[_0x3156('0x24')][_0x2ea099['uniqueid']]['transferrate']=_0x2ea099[_0x3156('0x35')];this[_0x3156('0x24')][_0x2ea099[_0x3156('0x25')]]['filename']=_0x2ea099[_0x3156('0x30')];this[_0x3156('0x24')][_0x2ea099[_0x3156('0x25')]][_0x3156('0x36')]=_0x2ea099[_0x3156('0x36')];if(this[_0x3156('0x24')][_0x2ea099[_0x3156('0x25')]][_0x3156('0x33')]>0x0){tiff2pdf(_0x2ea099[_0x3156('0x30')],'/var/opt/motion2/server/files/attachments/',function(_0x4d5615){logger['info'](_0x2ea099[_0x3156('0x25')],'\x20result\x20conversion\x20file\x20',_0x4d5615[_0x3156('0x37')]);attachment[_0x3156('0x38')]({'name':path['parse'](_0x2ea099[_0x3156('0x30')])[_0x3156('0x27')],'basename':path['parse'](_0x2ea099[_0x3156('0x30')])[_0x3156('0x27')]+_0x3156('0x39'),'type':'application/pdf'})['then'](function(_0x5522e2){faxAccount[_0x3156('0x3a')](_0x5d7968,{'from':_0x2ea099[_0x3156('0x36')],'mapKey':_0x3156('0x5'),'body':path[_0x3156('0x3b')](_0x2ea099[_0x3156('0x30')])[_0x3156('0x27')]+_0x3156('0x39'),'AttachmentId':_0x5522e2['id']})[_0x3156('0x3c')](function(_0x6786ec){logger[_0x3156('0x3d')](_0x2ea099[_0x3156('0x25')],_0x3156('0x3e'),JSON[_0x3156('0x3f')](_0x6786ec));});})[_0x3156('0x3c')](function(_0x3b93a3){logger['error'](_0x2ea099[_0x3156('0x25')],_0x3156('0x40'),JSON[_0x3156('0x3f')](_0x3b93a3));});});}logger['info'](_0x2ea099[_0x3156('0x25')],_0x3156('0x40'));}};Fax[_0x3156('0x1d')][_0x3156('0x1c')]=function(_0x491ccb){if(this[_0x3156('0xf')][_0x491ccb['uniqueid']]){_['merge'](this[_0x3156('0x24')][_0x491ccb[_0x3156('0x25')]],_['pick'](_0x491ccb,[_0x3156('0x41'),_0x3156('0x42')]));}};function updateStatus(_0x13d7bf){if(_0x13d7bf['AttachmentId']){faxMessage[_0x3156('0x43')](_0x13d7bf[_0x3156('0x44')],{'failMessage':'SENDING\x20FAILED\x20'})[_0x3156('0x45')](function(_0x19e5eb){ut[_0x3156('0x46')]('[Fax][Message][Error][Updated]',_0x19e5eb);})[_0x3156('0x3c')](function(_0x2aa956){ut['logger'](_0x3156('0x47'),_0x2aa956);});}else{ut[_0x3156('0x46')](_0x3156('0x48'));}}Fax[_0x3156('0x1d')][_0x3156('0x49')]=function(_0x2fb630,_0x3b6fe7,_0x363fb2){var _0xc31f3a=this;var _0xda4878={};if(_0x3b6fe7){_0xda4878={'read':_0x3b6fe7};}else{_0xda4878={'failMessage':_0x363fb2};}if(this[_0x3156('0xf')][_0x2fb630][_0x3156('0x44')]){faxMessage[_0x3156('0x43')](this[_0x3156('0xf')][_0x2fb630][_0x3156('0x44')],_0xda4878)[_0x3156('0x45')](function(_0xddd658){ut[_0x3156('0x46')](_0x3156('0x4a'),_0xddd658);})[_0x3156('0x3c')](function(_0x4e08d7){ut['logger'](_0x3156('0x4b'),_0x4e08d7);})[_0x3156('0x4c')](function(){delete _0xc31f3a['channels'][_0x2fb630];delete _0xc31f3a[_0x3156('0xf')][_0x2fb630];});}else{ut[_0x3156('0x46')](_0x3156('0x4d'));delete this['channels'][_0x2fb630];delete this['actions'][_0x2fb630];}};Fax[_0x3156('0x1d')][_0x3156('0x1b')]=function(_0x9f58b8){var _0x5d2a1e=this;if(this[_0x3156('0x24')][_0x9f58b8[_0x3156('0x25')]]){if(this[_0x3156('0xf')][_0x9f58b8[_0x3156('0x25')]]){this[_0x3156('0x24')][_0x9f58b8[_0x3156('0x25')]]['id']=this[_0x3156('0xf')][_0x9f58b8['uniqueid']]['id'];this[_0x3156('0x24')][_0x9f58b8[_0x3156('0x25')]]['name']=this[_0x3156('0xf')][_0x9f58b8[_0x3156('0x25')]][_0x3156('0x27')];}logger[_0x3156('0x28')](_0x9f58b8['uniqueid'],this[_0x3156('0xf')][_0x9f58b8[_0x3156('0x25')]]?_0x3156('0x4e'):_0x3156('0x4f'),JSON[_0x3156('0x3f')](this[_0x3156('0x24')][_0x9f58b8[_0x3156('0x25')]]));if(this['actions'][_0x9f58b8[_0x3156('0x25')]]){if(this['channels'][_0x9f58b8[_0x3156('0x25')]][_0x3156('0x50')]>0x0&&this[_0x3156('0x24')][_0x9f58b8[_0x3156('0x25')]][_0x3156('0x16')]===_0x3156('0x51')){this[_0x3156('0x49')](_0x9f58b8[_0x3156('0x25')],!![]);}else{this[_0x3156('0x49')](_0x9f58b8[_0x3156('0x25')],![],this[_0x3156('0x24')][_0x9f58b8[_0x3156('0x25')]]['faxstatusstring']?_0x3156('0x52')+this['channels'][_0x9f58b8[_0x3156('0x25')]][_0x3156('0x53')]:_0x3156('0x54'));}}}};Fax[_0x3156('0x1d')]['send']=function(_0xc0a51b){var _0x1e0b4a=this;return new BPromise(function(_0x2a3602,_0x18c789){_0x1e0b4a[_0x3156('0x55')](_0xc0a51b,_0x1e0b4a[_0x3156('0xd')][_0xc0a51b[_0x3156('0x56')]])[_0x3156('0x45')](function(_0x5774d3){ut[_0x3156('0x46')](_0x3156('0x57'),_0x5774d3);_0x2a3602(ut[_0x3156('0x37')]('Fax\x20received'));})[_0x3156('0x3c')](function(_0x4566a1){ut[_0x3156('0x46')](_0x3156('0x58'),_0x4566a1);updateStatus(_0xc0a51b);_0x18c789(ut[_0x3156('0x37')](_0x3156('0x59')));});});};Fax[_0x3156('0x1d')][_0x3156('0x5a')]=function(_0x8a04e){var _0x49d6dd=this;return new BPromise(function(_0x363c57,_0x3e4594){var _0x2b65ba=_0x49d6dd['checkTrunk'](_0x49d6dd[_0x3156('0xd')][_0x8a04e[_0x3156('0x56')]][_0x3156('0x5b')],_0x8a04e);if(_0x2b65ba[_0x3156('0x5c')]){_0x363c57(ut[_0x3156('0x37')](_0x3156('0x5d')));}else{_0x3e4594(ut[_0x3156('0x37')](_0x2b65ba[_0x3156('0x37')]));}});};function originate(_0x45ef56,_0x2b0d2c,_0x123e3c){return new BPromise(function(_0x1b0ad7,_0x1d20a5){if(_0x123e3c){var _0x43428c=util['format'](_0x3156('0x5e'),path['parse'](_0x45ef56['path'])[_0x3156('0x27')],_0x45ef56[_0x3156('0x2')]);gs[_0x3156('0x5f')](_0x43428c)['then'](function(){_0x45ef56[_0x3156('0x2')]=util['format'](_0x3156('0x60'),path[_0x3156('0x3b')](_0x45ef56[_0x3156('0x2')])[_0x3156('0x61')],path['parse'](_0x45ef56[_0x3156('0x2')])['name']);_0x2b0d2c[_0x3156('0x62')]=_0x45ef56[_0x3156('0x2')];ut['logger'](_0x3156('0x63'),'');ami[_0x3156('0x64')](ut[_0x3156('0x65')](_0x45ef56,_0x2b0d2c))[_0x3156('0x45')](function(_0x16d487){_0x1b0ad7(_0x16d487);})['catch'](function(_0x831b5a){_0x1d20a5(_0x831b5a);});})[_0x3156('0x3c')](function(_0x5bf83d){_0x1d20a5(_0x5bf83d);});}else{ami[_0x3156('0x64')](ut[_0x3156('0x65')](_0x45ef56,_0x2b0d2c))[_0x3156('0x45')](function(_0x11bc26){_0x1b0ad7(_0x11bc26);})[_0x3156('0x3c')](function(_0x360def){_0x1d20a5(_0x360def);});}});}Fax[_0x3156('0x1d')]['execOriginate']=function(_0x17c957,_0x3625da){var _0x218546=this;return new BPromise(function(_0xa17b38,_0x55ba55){var _0x11bdf4=uuid['v4']();var _0xd92b35=ut[_0x3156('0x66')](_0x17c957,_0x3625da);_0x218546[_0x3156('0xf')][_0x11bdf4]=new Action(_0x11bdf4,_0x3625da,_0x17c957);var _0xe30657=_0x218546[_0x3156('0xf')][_0x11bdf4];if(path['parse'](_0x17c957[_0x3156('0x2')])[_0x3156('0x67')]===_0x3156('0x39')){originate(_0xe30657,_0xd92b35,!![])['then'](function(_0x1151e5){_0xa17b38(_0x1151e5);})['catch'](function(_0x3a0049){_0x55ba55(_0x3a0049);});}else{originate(_0xe30657,_0xd92b35,![])[_0x3156('0x45')](function(_0x5edcfa){_0xa17b38(_0x5edcfa);})[_0x3156('0x3c')](function(_0x223f1c){_0x55ba55(_0x223f1c);});}});};Fax[_0x3156('0x1d')][_0x3156('0x68')]=function(_0x303dce){return!_['isNil'](_0x303dce)&&!_[_0x3156('0x69')](_0x303dce['name'])&&!_['isNil'](_0x303dce['active'])&&_0x303dce[_0x3156('0x6a')]&&!_['isNil'](this[_0x3156('0xe')][util['format'](_0x3156('0x6b'),_0x303dce[_0x3156('0x27')])])&&!_['isNil'](this[_0x3156('0xe')][util[_0x3156('0x6c')](_0x3156('0x6b'),_0x303dce['name'])][_0x3156('0x6d')])&&(this[_0x3156('0xe')][util[_0x3156('0x6c')](_0x3156('0x6b'),_0x303dce['name'])][_0x3156('0x6d')]===_0x3156('0x6e')||this[_0x3156('0xe')][util[_0x3156('0x6c')](_0x3156('0x6b'),_0x303dce[_0x3156('0x27')])]['status']===_0x3156('0x6f'));};Fax[_0x3156('0x1d')][_0x3156('0x70')]=function(_0x20d40d,_0x3d7d78){if(!this[_0x3156('0x68')](_0x20d40d)){ut['logger'](_0x3156('0x71'),_[_0x3156('0x69')](_0x20d40d)?'':_0x20d40d[_0x3156('0x27')]+_0x3156('0x72'));return{'isValid':![],'message':_0x3156('0x73')};}if(_['isNil'](_0x3d7d78['fax'])){ut[_0x3156('0x46')](_0x3156('0x74'),JSON['stringify'](_0x3d7d78));return{'isValid':![],'message':_0x3156('0x75')};}if(_['isNil'](_0x3d7d78['path'])){ut[_0x3156('0x46')](_0x3156('0x76'),JSON[_0x3156('0x3f')](_0x3d7d78));return{'isValid':![],'message':_0x3156('0x77')};}return{'isValid':!![],'message':_0x3156('0x78')};};module[_0x3156('0x79')]=Fax; \ No newline at end of file +var _0x02f9=['update','SENDING\x20FAILED\x20','then','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','SENDING\x20FAILED:\x20','faxstatusstring','SENDING\x20FAILED','send','FaxAccountId','[Fax][execOriginate][success]','[Fax][execOriginate][failure]','checkAfterSend','checkTrunk','Trunk','isValid','message','path','execute','%s/%s.tif','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','execOriginate','addVariables','ext','isNil','active','format','SIP/%s','reachable','isTrunkReachable','[Fax][checkTrunk][Trunk\x20not\x20work]','fax','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','exports','lodash','bluebird','uuid','moment','tiff2pdf','./util/gs','../ami','./rpcDb','./util/util','./action','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','syncVarSet','newstate','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','syncReceiveFax','hangup','syncHangup','syncOriginateResponse','prototype','context','from-voip-provider','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','\x20result\x20conversion\x20file\x20','create','parse','application/pdf','calleridnum','error','\x20notify\x20','stringify','catch','\x20receiveFax\x20','merge','pick','response','AttachmentId'];(function(_0x5212ad,_0x35e4ac){var _0x66e95b=function(_0x421cb6){while(--_0x421cb6){_0x5212ad['push'](_0x5212ad['shift']());}};_0x66e95b(++_0x35e4ac);}(_0x02f9,0x11c));var _0x902f=function(_0x4d6e03,_0x532829){_0x4d6e03=_0x4d6e03-0x0;var _0x4ab28c=_0x02f9[_0x4d6e03];return _0x4ab28c;};'use strict';var util=require('util');var _=require(_0x902f('0x0'));var BPromise=require(_0x902f('0x1'));var uuid=require(_0x902f('0x2'));var moment=require(_0x902f('0x3'));var path=require('path');var tiff2pdf=require(_0x902f('0x4'));var gs=require(_0x902f('0x5'));var logger=require('../../../config/logger')('fax');var ami=require(_0x902f('0x6'));var rpcDb=require(_0x902f('0x7'));var Channel=require('./channel');var ut=require(_0x902f('0x8'));var Action=require(_0x902f('0x9'));var faxAccount=require('../rpc/faxAccount');var attachment=require('../rpc/attachment');var faxMessage=require(_0x902f('0xa'));function Fax(_0x2ac1c2){this[_0x902f('0xb')]={};this[_0x902f('0xc')]=_0x2ac1c2['faxAccounts'];this[_0x902f('0xd')]=_0x2ac1c2[_0x902f('0xd')];this[_0x902f('0xe')]={};ami['on'](_0x902f('0xf'),this[_0x902f('0x10')][_0x902f('0x11')](this));ami['on'](_0x902f('0x12'),this[_0x902f('0x13')]['bind'](this));ami['on'](_0x902f('0x14'),this[_0x902f('0x15')][_0x902f('0x11')](this));ami['on'](_0x902f('0x16'),this[_0x902f('0x17')][_0x902f('0x11')](this));ami['on'](_0x902f('0x18'),this[_0x902f('0x19')]['bind'](this));ami['on']('receivefax',this[_0x902f('0x1a')]['bind'](this));ami['on'](_0x902f('0x1b'),this[_0x902f('0x1c')][_0x902f('0x11')](this));ami['on']('originateresponse',this[_0x902f('0x1d')][_0x902f('0x11')](this));}Fax[_0x902f('0x1e')][_0x902f('0x10')]=function(_0x36a609){if(_0x36a609[_0x902f('0x1f')]===_0x902f('0x20')){for(var _0x21688a in this['faxAccounts']){if(this['faxAccounts'][_0x902f('0x21')](_0x21688a)){if(_0x36a609[_0x902f('0x22')]===this[_0x902f('0xc')][_0x21688a][_0x902f('0x23')]){this[_0x902f('0xb')][_0x36a609[_0x902f('0x24')]]={};this['channels'][_0x36a609[_0x902f('0x24')]][_0x902f('0x25')]=_0x36a609[_0x902f('0x25')];this[_0x902f('0xb')][_0x36a609[_0x902f('0x24')]]['id']=this[_0x902f('0xc')][_0x21688a]['id'];this[_0x902f('0xb')][_0x36a609[_0x902f('0x24')]][_0x902f('0x26')]=this[_0x902f('0xc')][_0x21688a]['name'];logger[_0x902f('0x27')](_0x36a609[_0x902f('0x24')],_0x902f('0x28'));}}}}if(this['actions'][_0x36a609['uniqueid']]){this['channels'][_0x36a609['uniqueid']]={};this[_0x902f('0xb')][_0x36a609[_0x902f('0x24')]][_0x902f('0x25')]=_0x36a609[_0x902f('0x25')];logger[_0x902f('0x27')](_0x36a609[_0x902f('0x24')],_0x902f('0x28'));}};Fax[_0x902f('0x1e')][_0x902f('0x13')]=function(_0x1cb0ad){if(this[_0x902f('0xb')][_0x1cb0ad[_0x902f('0x24')]]){for(var _0x2dfaf in _0x1cb0ad[_0x902f('0x29')]){if(_0x1cb0ad[_0x902f('0x29')][_0x902f('0x21')](_0x2dfaf)){this[_0x902f('0xb')][_0x1cb0ad[_0x902f('0x24')]][_0x2dfaf]=_0x1cb0ad[_0x902f('0x2a')];}}}};Fax[_0x902f('0x1e')]['syncNewState']=function(_0x310216){if(this['channels'][_0x310216[_0x902f('0x24')]]){this[_0x902f('0xb')][_0x310216[_0x902f('0x24')]]['channelstate']=_0x310216[_0x902f('0x2b')];this[_0x902f('0xb')][_0x310216[_0x902f('0x24')]]['channelstatedesc']=_0x310216[_0x902f('0x2c')];}};Fax[_0x902f('0x1e')][_0x902f('0x17')]=function(_0x525ad9){if(this[_0x902f('0xb')][_0x525ad9[_0x902f('0x24')]]){for(var _0x68d78a in _0x525ad9[_0x902f('0x29')]){if(_0x525ad9['variable'][_0x902f('0x21')](_0x68d78a)){this['channels'][_0x525ad9[_0x902f('0x24')]][_0x68d78a]=_0x525ad9[_0x902f('0x2a')];}}}};Fax['prototype'][_0x902f('0x19')]=function(_0x366681){if(this['channels'][_0x366681[_0x902f('0x24')]]){this[_0x902f('0xb')][_0x366681[_0x902f('0x24')]][_0x902f('0x2d')]=_0x366681[_0x902f('0x2d')];this[_0x902f('0xb')][_0x366681[_0x902f('0x24')]]['status']=_0x366681[_0x902f('0x2e')];this[_0x902f('0xb')][_0x366681[_0x902f('0x24')]][_0x902f('0x23')]=_0x366681[_0x902f('0x23')];this[_0x902f('0xb')][_0x366681[_0x902f('0x24')]][_0x902f('0x2f')]=_0x366681[_0x902f('0x2f')];logger[_0x902f('0x27')](_0x366681['uniqueid'],_0x902f('0x30'));}};Fax[_0x902f('0x1e')][_0x902f('0x1a')]=function(_0x371a18){var _0x5c4685=this;if(this[_0x902f('0xb')][_0x371a18['uniqueid']]){var _0x25f0db=this[_0x902f('0xb')][_0x371a18[_0x902f('0x24')]]['id'];this[_0x902f('0xb')][_0x371a18[_0x902f('0x24')]][_0x902f('0x31')]=_0x371a18[_0x902f('0x31')];this[_0x902f('0xb')][_0x371a18[_0x902f('0x24')]][_0x902f('0x32')]=_0x371a18[_0x902f('0x32')];this['channels'][_0x371a18[_0x902f('0x24')]]['localstationid']=_0x371a18[_0x902f('0x23')];this[_0x902f('0xb')][_0x371a18[_0x902f('0x24')]][_0x902f('0x33')]=_0x371a18[_0x902f('0x33')];this['channels'][_0x371a18[_0x902f('0x24')]][_0x902f('0x34')]=_0x371a18['transferrate'];this['channels'][_0x371a18[_0x902f('0x24')]][_0x902f('0x2f')]=_0x371a18['filename'];this[_0x902f('0xb')][_0x371a18[_0x902f('0x24')]]['calleridnum']=_0x371a18['calleridnum'];if(this[_0x902f('0xb')][_0x371a18['uniqueid']][_0x902f('0x32')]>0x0){tiff2pdf(_0x371a18['filename'],'/var/opt/motion2/server/files/attachments/',function(_0x59f9a7){logger['info'](_0x371a18[_0x902f('0x24')],_0x902f('0x35'),_0x59f9a7['message']);attachment[_0x902f('0x36')]({'name':path[_0x902f('0x37')](_0x371a18[_0x902f('0x2f')])['name'],'basename':path[_0x902f('0x37')](_0x371a18[_0x902f('0x2f')])[_0x902f('0x26')]+'.pdf','type':_0x902f('0x38')})['then'](function(_0x54e36b){faxAccount['notify'](_0x25f0db,{'from':_0x371a18[_0x902f('0x39')],'mapKey':'fax','body':path[_0x902f('0x37')](_0x371a18['filename'])[_0x902f('0x26')]+'.pdf','AttachmentId':_0x54e36b['id']})['catch'](function(_0x34301a){logger[_0x902f('0x3a')](_0x371a18[_0x902f('0x24')],_0x902f('0x3b'),JSON[_0x902f('0x3c')](_0x34301a));});})[_0x902f('0x3d')](function(_0x2c90d1){logger[_0x902f('0x3a')](_0x371a18[_0x902f('0x24')],'\x20receiveFax\x20',JSON[_0x902f('0x3c')](_0x2c90d1));});});}logger['info'](_0x371a18[_0x902f('0x24')],_0x902f('0x3e'));}};Fax[_0x902f('0x1e')][_0x902f('0x1d')]=function(_0x688a7){if(this[_0x902f('0xe')][_0x688a7[_0x902f('0x24')]]){_[_0x902f('0x3f')](this['channels'][_0x688a7[_0x902f('0x24')]],_[_0x902f('0x40')](_0x688a7,[_0x902f('0x41'),'reason']));}};function updateStatus(_0x1afa05){if(_0x1afa05[_0x902f('0x42')]){faxMessage[_0x902f('0x43')](_0x1afa05[_0x902f('0x42')],{'failMessage':_0x902f('0x44')})[_0x902f('0x45')](function(_0x332b75){ut[_0x902f('0x46')](_0x902f('0x47'),_0x332b75);})[_0x902f('0x3d')](function(_0x5eb56c){ut[_0x902f('0x46')](_0x902f('0x48'),_0x5eb56c);});}else{ut['logger'](_0x902f('0x49'));}}Fax[_0x902f('0x1e')][_0x902f('0x4a')]=function(_0x157dd8,_0x52f45f,_0x3d3ce0){var _0x2dafeb=this;var _0x1eef99={};if(_0x52f45f){_0x1eef99={'read':_0x52f45f};}else{_0x1eef99={'failMessage':_0x3d3ce0};}if(this[_0x902f('0xe')][_0x157dd8]['AttachmentId']){faxMessage[_0x902f('0x43')](this['actions'][_0x157dd8][_0x902f('0x42')],_0x1eef99)[_0x902f('0x45')](function(_0x54c0e1){ut[_0x902f('0x46')](_0x902f('0x4b'),_0x54c0e1);})[_0x902f('0x3d')](function(_0x2621f1){ut[_0x902f('0x46')]('[Fax][Message][NoUpdate1]',_0x2621f1);})[_0x902f('0x4c')](function(){delete _0x2dafeb[_0x902f('0xb')][_0x157dd8];delete _0x2dafeb[_0x902f('0xe')][_0x157dd8];});}else{ut[_0x902f('0x46')](_0x902f('0x4d'));delete this[_0x902f('0xb')][_0x157dd8];delete this['actions'][_0x157dd8];}};Fax[_0x902f('0x1e')]['syncHangup']=function(_0x501211){var _0x2cd2c3=this;if(this[_0x902f('0xb')][_0x501211[_0x902f('0x24')]]){if(this[_0x902f('0xe')][_0x501211[_0x902f('0x24')]]){this['channels'][_0x501211[_0x902f('0x24')]]['id']=this[_0x902f('0xe')][_0x501211['uniqueid']]['id'];this['channels'][_0x501211[_0x902f('0x24')]][_0x902f('0x26')]=this[_0x902f('0xe')][_0x501211[_0x902f('0x24')]][_0x902f('0x26')];}logger[_0x902f('0x27')](_0x501211['uniqueid'],this['actions'][_0x501211['uniqueid']]?_0x902f('0x4e'):_0x902f('0x4f'),JSON[_0x902f('0x3c')](this[_0x902f('0xb')][_0x501211[_0x902f('0x24')]]));if(this[_0x902f('0xe')][_0x501211[_0x902f('0x24')]]){if(this['channels'][_0x501211['uniqueid']][_0x902f('0x50')]>0x0&&this[_0x902f('0xb')][_0x501211[_0x902f('0x24')]][_0x902f('0x18')]===_0x902f('0x51')){this[_0x902f('0x4a')](_0x501211[_0x902f('0x24')],!![]);}else{this['updateStatus'](_0x501211[_0x902f('0x24')],![],this['channels'][_0x501211['uniqueid']]['faxstatusstring']?_0x902f('0x52')+this[_0x902f('0xb')][_0x501211[_0x902f('0x24')]][_0x902f('0x53')]:_0x902f('0x54'));}}}};Fax[_0x902f('0x1e')][_0x902f('0x55')]=function(_0x2a1bfd){var _0x184000=this;return new BPromise(function(_0x49ae4c,_0x1f997a){_0x184000['execOriginate'](_0x2a1bfd,_0x184000['faxAccounts'][_0x2a1bfd[_0x902f('0x56')]])[_0x902f('0x45')](function(_0x34f09a){ut['logger'](_0x902f('0x57'),_0x34f09a);_0x49ae4c(ut['message']('Fax\x20received'));})['catch'](function(_0x5e0b94){ut[_0x902f('0x46')](_0x902f('0x58'),_0x5e0b94);updateStatus(_0x2a1bfd);_0x1f997a(ut['message']('Fax\x20failed'));});});};Fax[_0x902f('0x1e')][_0x902f('0x59')]=function(_0x3630d6){var _0x52ffbb=this;return new BPromise(function(_0x229820,_0x4d4670){var _0x53ecd1=_0x52ffbb[_0x902f('0x5a')](_0x52ffbb['faxAccounts'][_0x3630d6[_0x902f('0x56')]][_0x902f('0x5b')],_0x3630d6);if(_0x53ecd1[_0x902f('0x5c')]){_0x229820(ut[_0x902f('0x5d')]('Trunk\x20Reachable'));}else{_0x4d4670(ut[_0x902f('0x5d')](_0x53ecd1[_0x902f('0x5d')]));}});};function originate(_0x1cd085,_0x4cad96,_0x4a77f4){return new BPromise(function(_0x115f2d,_0x361068){if(_0x4a77f4){var _0x5a323c=util['format']('gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit',path[_0x902f('0x37')](_0x1cd085[_0x902f('0x5e')])[_0x902f('0x26')],_0x1cd085[_0x902f('0x5e')]);gs[_0x902f('0x5f')](_0x5a323c)[_0x902f('0x45')](function(){_0x1cd085[_0x902f('0x5e')]=util['format'](_0x902f('0x60'),path[_0x902f('0x37')](_0x1cd085[_0x902f('0x5e')])['dir'],path['parse'](_0x1cd085[_0x902f('0x5e')])[_0x902f('0x26')]);_0x4cad96[_0x902f('0x61')]=_0x1cd085['path'];ut[_0x902f('0x46')](_0x902f('0x62'),'');ami[_0x902f('0x63')](ut[_0x902f('0x64')](_0x1cd085,_0x4cad96))[_0x902f('0x45')](function(_0x447cd3){_0x115f2d(_0x447cd3);})[_0x902f('0x3d')](function(_0x4cdcbe){_0x361068(_0x4cdcbe);});})[_0x902f('0x3d')](function(_0x41fc3a){_0x361068(_0x41fc3a);});}else{ami[_0x902f('0x63')](ut[_0x902f('0x64')](_0x1cd085,_0x4cad96))[_0x902f('0x45')](function(_0x37c403){_0x115f2d(_0x37c403);})[_0x902f('0x3d')](function(_0x55fce1){_0x361068(_0x55fce1);});}});}Fax['prototype'][_0x902f('0x65')]=function(_0x3917c3,_0x3187cb){var _0xb942c9=this;return new BPromise(function(_0x3a7405,_0x333a85){var _0x4c7f7e=uuid['v4']();var _0x72b0a1=ut[_0x902f('0x66')](_0x3917c3,_0x3187cb);_0xb942c9['actions'][_0x4c7f7e]=new Action(_0x4c7f7e,_0x3187cb,_0x3917c3);var _0x1bd6fd=_0xb942c9['actions'][_0x4c7f7e];if(path[_0x902f('0x37')](_0x3917c3['path'])[_0x902f('0x67')]==='.pdf'){originate(_0x1bd6fd,_0x72b0a1,!![])['then'](function(_0x367f62){_0x3a7405(_0x367f62);})[_0x902f('0x3d')](function(_0x36f562){_0x333a85(_0x36f562);});}else{originate(_0x1bd6fd,_0x72b0a1,![])[_0x902f('0x45')](function(_0x577ca2){_0x3a7405(_0x577ca2);})[_0x902f('0x3d')](function(_0x4f7206){_0x333a85(_0x4f7206);});}});};Fax[_0x902f('0x1e')]['isTrunkReachable']=function(_0x1a42ae){return!_[_0x902f('0x68')](_0x1a42ae)&&!_['isNil'](_0x1a42ae['name'])&&!_['isNil'](_0x1a42ae[_0x902f('0x69')])&&_0x1a42ae['active']&&!_['isNil'](this['trunks'][util[_0x902f('0x6a')](_0x902f('0x6b'),_0x1a42ae[_0x902f('0x26')])])&&!_[_0x902f('0x68')](this[_0x902f('0xd')][util[_0x902f('0x6a')](_0x902f('0x6b'),_0x1a42ae[_0x902f('0x26')])][_0x902f('0x2e')])&&(this[_0x902f('0xd')][util['format']('SIP/%s',_0x1a42ae['name'])]['status']===_0x902f('0x6c')||this['trunks'][util['format'](_0x902f('0x6b'),_0x1a42ae['name'])][_0x902f('0x2e')]==='unmonitored');};Fax[_0x902f('0x1e')][_0x902f('0x5a')]=function(_0x5eee18,_0x301136){if(!this[_0x902f('0x6d')](_0x5eee18)){ut[_0x902f('0x46')](_0x902f('0x6e'),_[_0x902f('0x68')](_0x5eee18)?'':_0x5eee18[_0x902f('0x26')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':'Trunk\x20not\x20working'};}if(_[_0x902f('0x68')](_0x301136[_0x902f('0x6f')])){ut['logger'](_0x902f('0x70'),JSON[_0x902f('0x3c')](_0x301136));return{'isValid':![],'message':_0x902f('0x71')};}if(_[_0x902f('0x68')](_0x301136['path'])){ut[_0x902f('0x46')](_0x902f('0x72'),JSON[_0x902f('0x3c')](_0x301136));return{'isValid':![],'message':_0x902f('0x73')};}return{'isValid':!![],'message':'Is\x20Valid'};};module[_0x902f('0x74')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index e520073..bacc340 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 _0xadf0=['../../../config/logger','preview','lodash','../rpc/faxAccount','error','inspect','notify','then','util','bluebird'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xadf0,0xc6));var _0x0adf=function(_0x1aef30,_0x3a46ef){_0x1aef30=_0x1aef30-0x0;var _0x5be9a9=_0xadf0[_0x1aef30];return _0x5be9a9;};'use strict';var util=require(_0x0adf('0x0'));var BPromise=require(_0x0adf('0x1'));var logger=require(_0x0adf('0x2'))(_0x0adf('0x3'));var _=require(_0x0adf('0x4'));var faxAccount=require(_0x0adf('0x5'));function loggerCatch(_0x4fea85){return function(_0x793365){logger[_0x0adf('0x6')](_0x4fea85,util[_0x0adf('0x7')](_0x793365,{'showHidden':![],'depth':null}));};}exports[_0x0adf('0x8')]=function(_0xf4663c,_0x1ed20a){return BPromise['resolve']()[_0x0adf('0x9')](faxAccount['notify'](_0xf4663c,_0x1ed20a))['catch'](loggerCatch('[Notify]\x20'));}; \ No newline at end of file +var _0xf812=['notify','resolve','catch','[Notify]\x20','../../../config/logger','preview','lodash','../rpc/faxAccount','error','inspect'];(function(_0xbe85b3,_0x26463c){var _0x185798=function(_0x173fd8){while(--_0x173fd8){_0xbe85b3['push'](_0xbe85b3['shift']());}};_0x185798(++_0x26463c);}(_0xf812,0xfe));var _0x2f81=function(_0x5a9405,_0x52b2aa){_0x5a9405=_0x5a9405-0x0;var _0x3ae14d=_0xf812[_0x5a9405];return _0x3ae14d;};'use strict';var util=require('util');var BPromise=require('bluebird');var logger=require(_0x2f81('0x0'))(_0x2f81('0x1'));var _=require(_0x2f81('0x2'));var faxAccount=require(_0x2f81('0x3'));function loggerCatch(_0x43e1f8){return function(_0x7fd2c7){logger[_0x2f81('0x4')](_0x43e1f8,util[_0x2f81('0x5')](_0x7fd2c7,{'showHidden':![],'depth':null}));};}exports[_0x2f81('0x6')]=function(_0x3c77a4,_0x41ec1c){return BPromise[_0x2f81('0x7')]()['then'](faxAccount[_0x2f81('0x6')](_0x3c77a4,_0x41ec1c))[_0x2f81('0x8')](loggerCatch(_0x2f81('0x9')));}; \ No newline at end of file diff --git a/server/services/ami/fax/util/gs.js b/server/services/ami/fax/util/gs.js index fca066d..5051009 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 _0xad20=['exec','execute','info','Exec\x20gs','util','../../../../config/logger','bluebird','child_process'];(function(_0x4e1fe7,_0x30004d){var _0x3d0874=function(_0x269d67){while(--_0x269d67){_0x4e1fe7['push'](_0x4e1fe7['shift']());}};_0x3d0874(++_0x30004d);}(_0xad20,0x94));var _0x0ad2=function(_0x399b6e,_0x3ef3fd){_0x399b6e=_0x399b6e-0x0;var _0x145cf3=_0xad20[_0x399b6e];return _0x145cf3;};'use strict';var util=require(_0x0ad2('0x0'));var logger=require(_0x0ad2('0x1'))('fax');var BPromise=require(_0x0ad2('0x2'));var exec=require(_0x0ad2('0x3'))[_0x0ad2('0x4')];exports[_0x0ad2('0x5')]=function(_0x1d66e0){return new BPromise(function(_0xc26489,_0x3db641){exec(_0x1d66e0,function(_0x16a764,_0x27abca,_0xca6add){logger[_0x0ad2('0x6')](_0x0ad2('0x7'),_0x27abca);if(_0x16a764){logger['info'](_0x0ad2('0x7'),'\x20Error\x20:',util['inspect'](_0x16a764,{'showHidden':![],'depth':null}),_0x27abca,_0xca6add);_0x3db641(_0x16a764);}_0xc26489(_0x27abca);});});}; \ No newline at end of file +var _0x0ecf=['Exec\x20gs','info','\x20Error\x20:','inspect','../../../../config/logger','bluebird','child_process','exec','execute'];(function(_0x269a18,_0x281cdc){var _0x49969b=function(_0x11f7d4){while(--_0x11f7d4){_0x269a18['push'](_0x269a18['shift']());}};_0x49969b(++_0x281cdc);}(_0x0ecf,0xd3));var _0xf0ec=function(_0x2c5aee,_0x5da9ec){_0x2c5aee=_0x2c5aee-0x0;var _0x2aca83=_0x0ecf[_0x2c5aee];return _0x2aca83;};'use strict';var util=require('util');var logger=require(_0xf0ec('0x0'))('fax');var BPromise=require(_0xf0ec('0x1'));var exec=require(_0xf0ec('0x2'))[_0xf0ec('0x3')];exports[_0xf0ec('0x4')]=function(_0x4817b0){return new BPromise(function(_0x3dc540,_0x5c4811){exec(_0x4817b0,function(_0x3d3338,_0x1249e6,_0x37dc66){logger['info'](_0xf0ec('0x5'),_0x1249e6);if(_0x3d3338){logger[_0xf0ec('0x6')](_0xf0ec('0x5'),_0xf0ec('0x7'),util[_0xf0ec('0x8')](_0x3d3338,{'showHidden':![],'depth':null}),_0x1249e6,_0x37dc66);_0x5c4811(_0x3d3338);}_0x3dc540(_0x1249e6);});});}; \ 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 e17cfb9..4629179 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 _0x7f28=['format','\x22%s\x22\x20<%s>','localstationid','util','lodash','moment','../../../../config/logger','fax','message','logger','info','addVariables','headerinfo','maxrate','\x22%s\x22','gateway','t38timeout','path','variablesAction','uniqueid','channel','xcally-motion-fax'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0x7f28,0x1e7));var _0x87f2=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x7f28[_0xa464c9];return _0x3d73c4;};'use strict';var util=require(_0x87f2('0x0'));var _=require(_0x87f2('0x1'));var moment=require(_0x87f2('0x2'));var logger=require(_0x87f2('0x3'))(_0x87f2('0x4'));exports[_0x87f2('0x5')]=function(_0x3f9cf0){return{'message':_0x3f9cf0};};exports[_0x87f2('0x6')]=function(_0x54931a,_0x30a236){logger[_0x87f2('0x7')](_0x54931a,util['inspect'](_0x30a236,{'showHidden':![],'depth':null}));};exports[_0x87f2('0x8')]=function(_0x326820,_0x37de8c){var _0x5254be={'XMF-ECM':_0x37de8c['ecm'],'XMF-HEADERINFO':_0x37de8c[_0x87f2('0x9')],'XMF-MINRATE':_0x37de8c['minrate'],'XMF-MAXRATE':_0x37de8c[_0x87f2('0xa')],'XMF-MODEM':util['format'](_0x87f2('0xb'),_0x37de8c['modem']),'XMF-GATEWAY':_0x37de8c[_0x87f2('0xc')],'XMF-FAXDETECT':_0x37de8c['faxdetect'],'XMF-T38TIMEOUT':_0x37de8c[_0x87f2('0xd')],'XMF-LOCALSTATIONID':_0x37de8c['localstationid'],'XMF-PATH':_0x326820[_0x87f2('0xe')]};return _0x5254be;};exports[_0x87f2('0xf')]=function(_0x318949,_0x525712){return{'actionid':_0x318949[_0x87f2('0x10')],'action':'originate','channel':_0x318949[_0x87f2('0x11')],'Exten':_0x87f2('0x12'),'Context':'from-sip','Priority':'1','callerid':util[_0x87f2('0x13')](_0x87f2('0x14'),_0x318949['headerinfo']?_0x318949[_0x87f2('0x9')]:'',_0x318949[_0x87f2('0x15')]),'variable':_0x525712,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x318949[_0x87f2('0x10')]};}; \ No newline at end of file +var _0x6cc0=['fax','message','info','addVariables','ecm','headerinfo','minrate','maxrate','\x22%s\x22','modem','faxdetect','t38timeout','localstationid','path','variablesAction','originate','channel','xcally-motion-fax','from-sip','uniqueid','../../../../config/logger'];(function(_0x165834,_0x49e6d7){var _0x2f8df1=function(_0x224230){while(--_0x224230){_0x165834['push'](_0x165834['shift']());}};_0x2f8df1(++_0x49e6d7);}(_0x6cc0,0xd1));var _0x06cc=function(_0x33e61d,_0x182628){_0x33e61d=_0x33e61d-0x0;var _0x185b31=_0x6cc0[_0x33e61d];return _0x185b31;};'use strict';var util=require('util');var _=require('lodash');var moment=require('moment');var logger=require(_0x06cc('0x0'))(_0x06cc('0x1'));exports[_0x06cc('0x2')]=function(_0x14087c){return{'message':_0x14087c};};exports['logger']=function(_0x4ecad4,_0x49b0b9){logger[_0x06cc('0x3')](_0x4ecad4,util['inspect'](_0x49b0b9,{'showHidden':![],'depth':null}));};exports[_0x06cc('0x4')]=function(_0xbcc478,_0x52dd84){var _0x1dec5b={'XMF-ECM':_0x52dd84[_0x06cc('0x5')],'XMF-HEADERINFO':_0x52dd84[_0x06cc('0x6')],'XMF-MINRATE':_0x52dd84[_0x06cc('0x7')],'XMF-MAXRATE':_0x52dd84[_0x06cc('0x8')],'XMF-MODEM':util['format'](_0x06cc('0x9'),_0x52dd84[_0x06cc('0xa')]),'XMF-GATEWAY':_0x52dd84['gateway'],'XMF-FAXDETECT':_0x52dd84[_0x06cc('0xb')],'XMF-T38TIMEOUT':_0x52dd84[_0x06cc('0xc')],'XMF-LOCALSTATIONID':_0x52dd84[_0x06cc('0xd')],'XMF-PATH':_0xbcc478[_0x06cc('0xe')]};return _0x1dec5b;};exports[_0x06cc('0xf')]=function(_0x38e7de,_0x11bd23){return{'actionid':_0x38e7de['uniqueid'],'action':_0x06cc('0x10'),'channel':_0x38e7de[_0x06cc('0x11')],'Exten':_0x06cc('0x12'),'Context':_0x06cc('0x13'),'Priority':'1','callerid':util['format']('\x22%s\x22\x20<%s>',_0x38e7de['headerinfo']?_0x38e7de[_0x06cc('0x6')]:'',_0x38e7de[_0x06cc('0xd')]),'variable':_0x11bd23,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x38e7de[_0x06cc('0x14')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index f31eaf7..4cf39a5 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 _0x52c3=['getAgents','initAgents','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTemplates','getZendeskAccounts','initZendeskAccounts','initSalesforceAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','initZohoAccounts','getVtigerAccounts','initFreshsalesAccounts','initServicenowAccounts','getDynamics365Accounts','initCampaigns','initVoiceExtensions','initFaxAccounts','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','initVoiceCallReports','catch','log','listen','bluebird','moment','./server','./realtime','./report','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','get','hour','resolve','then'];(function(_0x4bc5d2,_0x32286c){var _0x322e78=function(_0x59975a){while(--_0x59975a){_0x4bc5d2['push'](_0x4bc5d2['shift']());}};_0x322e78(++_0x32286c);}(_0x52c3,0x11d));var _0x352c=function(_0x2543d6,_0x3a5e78){_0x2543d6=_0x2543d6-0x0;var _0x55213c=_0x52c3[_0x2543d6];return _0x55213c;};'use strict';var BPromise=require(_0x352c('0x0'));var util=require('util');var moment=require(_0x352c('0x1'));var server=require(_0x352c('0x2'));var Realtime=require(_0x352c('0x3'));var Report=require(_0x352c('0x4'));var Acw=require('./acw');var Trigger=require('./trigger');var Dialer=require(_0x352c('0x5'));var Preview=require(_0x352c('0x6'));var Fax=require(_0x352c('0x7'));var user=require(_0x352c('0x8'));var voiceQueue=require(_0x352c('0x9'));var voiceQueueReport=require(_0x352c('0xa'));var voiceCallReport=require(_0x352c('0xb'));var trunk=require(_0x352c('0xc'));var trigger=require(_0x352c('0xd'));var template=require(_0x352c('0xe'));var cmHopperHistory=require(_0x352c('0xf'));var campaign=require('./rpc/campaign');var voiceExtension=require(_0x352c('0x10'));var faxAccount=require(_0x352c('0x11'));var zendesk=require('./rpc/integrations/zendesk');var salesforce=require(_0x352c('0x12'));var sugarcrm=require(_0x352c('0x13'));var freshdesk=require(_0x352c('0x14'));var desk=require(_0x352c('0x15'));var zoho=require('./rpc/integrations/zoho');var vtiger=require(_0x352c('0x16'));var freshsales=require(_0x352c('0x17'));var servicenow=require(_0x352c('0x18'));var dynamics365=require(_0x352c('0x19'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x352c('0x1a')](_0x352c('0x1b'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x352c('0x1a')](_0x352c('0x1b'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x352c('0x1c')]()[_0x352c('0x1d')](user[_0x352c('0x1e')]())[_0x352c('0x1d')](realtime[_0x352c('0x1f')]())['then'](user['getTelephones']())[_0x352c('0x1d')](realtime['initTelephones']())['then'](trunk[_0x352c('0x20')]())[_0x352c('0x1d')](realtime[_0x352c('0x21')]())[_0x352c('0x1d')](voiceQueue[_0x352c('0x22')]())[_0x352c('0x1d')](realtime[_0x352c('0x23')]())[_0x352c('0x1d')](trigger[_0x352c('0x24')]())[_0x352c('0x1d')](realtime['initTriggers']())[_0x352c('0x1d')](template['getTemplates']())[_0x352c('0x1d')](realtime[_0x352c('0x25')]())['then'](zendesk[_0x352c('0x26')]())[_0x352c('0x1d')](realtime[_0x352c('0x27')]())[_0x352c('0x1d')](salesforce['getSalesforceAccounts']())[_0x352c('0x1d')](realtime[_0x352c('0x28')]())['then'](sugarcrm['getSugarcrmAccounts']())['then'](realtime[_0x352c('0x29')]())[_0x352c('0x1d')](freshdesk[_0x352c('0x2a')]())[_0x352c('0x1d')](realtime[_0x352c('0x2b')]())['then'](desk[_0x352c('0x2c')]())[_0x352c('0x1d')](realtime[_0x352c('0x2d')]())[_0x352c('0x1d')](zoho['getZohoAccounts']())[_0x352c('0x1d')](realtime[_0x352c('0x2e')]())[_0x352c('0x1d')](vtiger[_0x352c('0x2f')]())[_0x352c('0x1d')](realtime['initVtigerAccounts']())[_0x352c('0x1d')](freshsales['getFreshsalesAccounts']())['then'](realtime[_0x352c('0x30')]())[_0x352c('0x1d')](servicenow['getServicenowAccounts']())[_0x352c('0x1d')](realtime[_0x352c('0x31')]())[_0x352c('0x1d')](dynamics365[_0x352c('0x32')]())[_0x352c('0x1d')](realtime['initDynamics365Accounts']())[_0x352c('0x1d')](campaign['getCampaigns']())['then'](realtime[_0x352c('0x33')]())[_0x352c('0x1d')](voiceExtension['getVoiceExtensions']())[_0x352c('0x1d')](realtime[_0x352c('0x34')]())[_0x352c('0x1d')](faxAccount['getFaxAccounts']())['then'](realtime[_0x352c('0x35')]())['then'](function(){return realtime;});}function initParams(){return BPromise[_0x352c('0x1c')]()[_0x352c('0x1d')](voiceQueueReport['getVoiceQueueReports']())[_0x352c('0x1d')](realtime[_0x352c('0x36')]())[_0x352c('0x1d')](cmHopperHistory[_0x352c('0x37')]())[_0x352c('0x1d')](realtime[_0x352c('0x38')]())[_0x352c('0x1d')](cmHopperHistory[_0x352c('0x39')]())['then'](realtime[_0x352c('0x3a')]())[_0x352c('0x1d')](voiceCallReport['getVoiceCallReports']())[_0x352c('0x1d')](realtime[_0x352c('0x3b')]())[_0x352c('0x1d')](function(_0x2e5da1){})[_0x352c('0x3c')](function(_0x5ed9aa){console[_0x352c('0x3d')](_0x5ed9aa);});}function main(){return server[_0x352c('0x3e')](realtime,preview,fax)[_0x352c('0x1d')](function(_0x2e7a7f){return initRealtime();})[_0x352c('0x1d')](function(){return initParams();})['then'](function(){report['sync']();setInterval(initRealtime,0x1388);})['catch'](function(_0x2e7dc7){console[_0x352c('0x3d')](_0x2e7dc7);});}main(); \ No newline at end of file +var _0x3792=['./rpc/integrations/freshsales','resolve','getAgents','initAgents','then','getTelephones','getTrunks','initTrunks','getVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getDynamics365Accounts','initCampaigns','getVoiceExtensions','getFaxAccounts','initFaxAccounts','initVoiceQueueHopperHistory','getCampaignHopperHistory','getVoiceCallReports','catch','log','listen','sync','bluebird','util','moment','./server','./report','./acw','./trigger','./preview','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/desk','./rpc/integrations/vtiger'];(function(_0x3267ae,_0x26e950){var _0x23bd42=function(_0x287a1d){while(--_0x287a1d){_0x3267ae['push'](_0x3267ae['shift']());}};_0x23bd42(++_0x26e950);}(_0x3792,0xe2));var _0x2379=function(_0x1fe303,_0x2eecd1){_0x1fe303=_0x1fe303-0x0;var _0x59bb23=_0x3792[_0x1fe303];return _0x59bb23;};'use strict';var BPromise=require(_0x2379('0x0'));var util=require(_0x2379('0x1'));var moment=require(_0x2379('0x2'));var server=require(_0x2379('0x3'));var Realtime=require('./realtime');var Report=require(_0x2379('0x4'));var Acw=require(_0x2379('0x5'));var Trigger=require(_0x2379('0x6'));var Dialer=require('./dialer');var Preview=require(_0x2379('0x7'));var Fax=require('./fax');var user=require(_0x2379('0x8'));var voiceQueue=require(_0x2379('0x9'));var voiceQueueReport=require(_0x2379('0xa'));var voiceCallReport=require(_0x2379('0xb'));var trunk=require(_0x2379('0xc'));var trigger=require(_0x2379('0xd'));var template=require(_0x2379('0xe'));var cmHopperHistory=require(_0x2379('0xf'));var campaign=require(_0x2379('0x10'));var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require('./rpc/faxAccount');var zendesk=require(_0x2379('0x11'));var salesforce=require(_0x2379('0x12'));var sugarcrm=require(_0x2379('0x13'));var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0x2379('0x14'));var zoho=require('./rpc/integrations/zoho');var vtiger=require(_0x2379('0x15'));var freshsales=require(_0x2379('0x16'));var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require('./rpc/integrations/dynamics365');var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get']('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get']('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x2379('0x17')]()['then'](user[_0x2379('0x18')]())['then'](realtime[_0x2379('0x19')]())[_0x2379('0x1a')](user[_0x2379('0x1b')]())[_0x2379('0x1a')](realtime['initTelephones']())[_0x2379('0x1a')](trunk[_0x2379('0x1c')]())[_0x2379('0x1a')](realtime[_0x2379('0x1d')]())[_0x2379('0x1a')](voiceQueue[_0x2379('0x1e')]())['then'](realtime['initVoiceQueues']())['then'](trigger[_0x2379('0x1f')]())['then'](realtime[_0x2379('0x20')]())[_0x2379('0x1a')](template[_0x2379('0x21')]())[_0x2379('0x1a')](realtime[_0x2379('0x22')]())[_0x2379('0x1a')](zendesk[_0x2379('0x23')]())[_0x2379('0x1a')](realtime[_0x2379('0x24')]())[_0x2379('0x1a')](salesforce[_0x2379('0x25')]())[_0x2379('0x1a')](realtime[_0x2379('0x26')]())[_0x2379('0x1a')](sugarcrm[_0x2379('0x27')]())[_0x2379('0x1a')](realtime[_0x2379('0x28')]())['then'](freshdesk[_0x2379('0x29')]())[_0x2379('0x1a')](realtime['initFreshdeskAccounts']())['then'](desk[_0x2379('0x2a')]())['then'](realtime[_0x2379('0x2b')]())['then'](zoho[_0x2379('0x2c')]())[_0x2379('0x1a')](realtime[_0x2379('0x2d')]())[_0x2379('0x1a')](vtiger[_0x2379('0x2e')]())[_0x2379('0x1a')](realtime[_0x2379('0x2f')]())['then'](freshsales[_0x2379('0x30')]())[_0x2379('0x1a')](realtime[_0x2379('0x31')]())['then'](servicenow['getServicenowAccounts']())['then'](realtime['initServicenowAccounts']())['then'](dynamics365[_0x2379('0x32')]())[_0x2379('0x1a')](realtime['initDynamics365Accounts']())[_0x2379('0x1a')](campaign['getCampaigns']())[_0x2379('0x1a')](realtime[_0x2379('0x33')]())[_0x2379('0x1a')](voiceExtension[_0x2379('0x34')]())[_0x2379('0x1a')](realtime['initVoiceExtensions']())[_0x2379('0x1a')](faxAccount[_0x2379('0x35')]())[_0x2379('0x1a')](realtime[_0x2379('0x36')]())[_0x2379('0x1a')](function(){return realtime;});}function initParams(){return BPromise[_0x2379('0x17')]()[_0x2379('0x1a')](voiceQueueReport['getVoiceQueueReports']())[_0x2379('0x1a')](realtime['initVoiceQueueReports']())[_0x2379('0x1a')](cmHopperHistory['getVoiceQueueHopperHistory']())[_0x2379('0x1a')](realtime[_0x2379('0x37')]())[_0x2379('0x1a')](cmHopperHistory[_0x2379('0x38')]())[_0x2379('0x1a')](realtime['initCampaignHopperHistory']())[_0x2379('0x1a')](voiceCallReport[_0x2379('0x39')]())[_0x2379('0x1a')](realtime['initVoiceCallReports']())[_0x2379('0x1a')](function(_0x85059e){})[_0x2379('0x3a')](function(_0x1fd8c1){console[_0x2379('0x3b')](_0x1fd8c1);});}function main(){return server[_0x2379('0x3c')](realtime,preview,fax)[_0x2379('0x1a')](function(_0xd47e30){return initRealtime();})[_0x2379('0x1a')](function(){return initParams();})[_0x2379('0x1a')](function(){report[_0x2379('0x3d')]();setInterval(initRealtime,0x1388);})[_0x2379('0x3a')](function(_0x217896){console[_0x2379('0x3b')](_0x217896);});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index 7d8fc0f..3372de7 100644 --- a/server/services/ami/model/agent.js +++ b/server/services/ami/model/agent.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['stateTime','status','address','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','local','md5','prototype','updateStatusRealtime','not_inuse','inuse','talking','statePause','toNumber','format','fullname','stringify','user:%s','emit','user:save','user:presence','exports','lodash','util','moment','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','email','accountcode','state','unknown'];(function(_0x51bfa7,_0x51c8e0){var _0x1cf7ae=function(_0x5e5625){while(--_0x5e5625){_0x51bfa7['push'](_0x51bfa7['shift']());}};_0x1cf7ae(++_0x51c8e0);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa9e0[_0xf50820];return _0x2a9b10;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x0a9e('0x3'));config['redis']=_[_0x0a9e('0x4')](config[_0x0a9e('0x5')],{'host':_0x0a9e('0x6'),'port':0x18eb});var io=require(_0x0a9e('0x7'))(new Redis(config[_0x0a9e('0x5')]));function Agent(_0x57b080){this['id']=_0x57b080['id']||0x0;this[_0x0a9e('0x8')]=_0x57b080[_0x0a9e('0x8')]||'';this[_0x0a9e('0x9')]=_0x57b080['email']||'';this['accountcode']=_0x57b080[_0x0a9e('0xa')]||'';this['fullname']=_0x57b080['fullname']||'';this[_0x0a9e('0xb')]=_0x0a9e('0xc');this[_0x0a9e('0xd')]=0x0;this[_0x0a9e('0xe')]=_0x0a9e('0xc');this[_0x0a9e('0xf')]='';this['phone']='';this['mobile']='';this['interface']='';this['online']=_0x57b080[_0x0a9e('0x10')]||![];this[_0x0a9e('0x11')]=_0x0a9e('0xc');this[_0x0a9e('0x12')]=0x0;this[_0x0a9e('0x13')]='';this[_0x0a9e('0x14')]='';this['onhold']=![];this[_0x0a9e('0x15')]=![];this[_0x0a9e('0x16')]='';}Agent[_0x0a9e('0x17')][_0x0a9e('0x18')]=function(_0x44dcfd){var _0x4d5611;if(_0x44dcfd&&_0x44dcfd['state']){_0x4d5611=_0x44dcfd[_0x0a9e('0xb')]['toLowerCase']();switch(_0x4d5611){case _0x0a9e('0x19'):_0x4d5611='idle';break;case _0x0a9e('0x1a'):_0x4d5611=_0x0a9e('0x1b');break;}}if(_0x4d5611&&this['voiceStatus']!==_0x4d5611||_0x44dcfd[_0x0a9e('0x1c')]){this['voiceStatusTime']=_[_0x0a9e('0x1d')](moment()[_0x0a9e('0x1e')]('x'));}if(_0x4d5611){this[_0x0a9e('0x11')]=_0x4d5611;}var _0x205fd6={'id':this['id'],'name':this[_0x0a9e('0x8')],'email':this[_0x0a9e('0x9')],'accountcode':this[_0x0a9e('0xa')],'fullname':this[_0x0a9e('0x1f')],'state':this[_0x0a9e('0xb')],'stateTime':this[_0x0a9e('0xd')],'status':this[_0x0a9e('0xe')],'address':this[_0x0a9e('0xf')],'online':this['online'],'voiceStatus':this[_0x0a9e('0x11')],'voiceStatusTime':this[_0x0a9e('0x12')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x0a9e('0x14')],'interface':this['interface'],'onhold':this['onhold']};var _0x3a02e1=md5(JSON[_0x0a9e('0x20')](_0x205fd6));if(this[_0x0a9e('0x16')]!==_0x3a02e1){this[_0x0a9e('0x16')]=_0x3a02e1;io['to'](util['format'](_0x0a9e('0x21'),_0x205fd6[_0x0a9e('0x8')]))[_0x0a9e('0x22')](_0x0a9e('0x23'),_0x205fd6);io[_0x0a9e('0x22')](_0x0a9e('0x24'),_0x205fd6);}};module[_0x0a9e('0x25')]=Agent; \ No newline at end of file +var _0x70e0=['name','voiceStatusQueue','onhold','stringify','md5','user:%s','user:save','emit','user:presence','lodash','util','moment','../../../config/environment','redis','defaults','socket.io-emitter','email','accountcode','fullname','state','unknown','address','phone','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','local','toLowerCase','not_inuse','idle','inuse','statePause','toNumber','format'];(function(_0x49e882,_0x281a5b){var _0x2f21e3=function(_0x23bf08){while(--_0x23bf08){_0x49e882['push'](_0x49e882['shift']());}};_0x2f21e3(++_0x281a5b);}(_0x70e0,0x17b));var _0x070e=function(_0x46b28f,_0x2ba163){_0x46b28f=_0x46b28f-0x0;var _0x1140ab=_0x70e0[_0x46b28f];return _0x1140ab;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x070e('0x3'));config[_0x070e('0x4')]=_[_0x070e('0x5')](config[_0x070e('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x070e('0x6'))(new Redis(config['redis']));function Agent(_0x46fe68){this['id']=_0x46fe68['id']||0x0;this['name']=_0x46fe68['name']||'';this['email']=_0x46fe68[_0x070e('0x7')]||'';this[_0x070e('0x8')]=_0x46fe68[_0x070e('0x8')]||'';this[_0x070e('0x9')]=_0x46fe68[_0x070e('0x9')]||'';this[_0x070e('0xa')]=_0x070e('0xb');this['stateTime']=0x0;this['status']=_0x070e('0xb');this[_0x070e('0xc')]='';this[_0x070e('0xd')]='';this[_0x070e('0xe')]='';this[_0x070e('0xf')]='';this[_0x070e('0x10')]=_0x46fe68[_0x070e('0x10')]||![];this[_0x070e('0x11')]=_0x070e('0xb');this[_0x070e('0x12')]=0x0;this[_0x070e('0x13')]='';this['voiceStatusQueue']='';this['onhold']=![];this[_0x070e('0x14')]=![];this['md5']='';}Agent['prototype']['updateStatusRealtime']=function(_0x11d2ce){var _0x14c3fd;if(_0x11d2ce&&_0x11d2ce['state']){_0x14c3fd=_0x11d2ce['state'][_0x070e('0x15')]();switch(_0x14c3fd){case _0x070e('0x16'):_0x14c3fd=_0x070e('0x17');break;case _0x070e('0x18'):_0x14c3fd='talking';break;}}if(_0x14c3fd&&this['voiceStatus']!==_0x14c3fd||_0x11d2ce[_0x070e('0x19')]){this[_0x070e('0x12')]=_[_0x070e('0x1a')](moment()[_0x070e('0x1b')]('x'));}if(_0x14c3fd){this[_0x070e('0x11')]=_0x14c3fd;}var _0x5037eb={'id':this['id'],'name':this[_0x070e('0x1c')],'email':this[_0x070e('0x7')],'accountcode':this[_0x070e('0x8')],'fullname':this[_0x070e('0x9')],'state':this[_0x070e('0xa')],'stateTime':this['stateTime'],'status':this['status'],'address':this['address'],'online':this[_0x070e('0x10')],'voiceStatus':this[_0x070e('0x11')],'voiceStatusTime':this[_0x070e('0x12')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x070e('0x1d')],'interface':this['interface'],'onhold':this[_0x070e('0x1e')]};var _0x3f6985=md5(JSON[_0x070e('0x1f')](_0x5037eb));if(this[_0x070e('0x20')]!==_0x3f6985){this[_0x070e('0x20')]=_0x3f6985;io['to'](util[_0x070e('0x1b')](_0x070e('0x21'),_0x5037eb[_0x070e('0x1c')]))['emit'](_0x070e('0x22'),_0x5037eb);io[_0x070e('0x23')](_0x070e('0x24'),_0x5037eb);}};module['exports']=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 836b6bf..d98c1db 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 _0xbd35=['type','campaign','temp','ivrAnswerCallsDay','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','name'];(function(_0x3aac5d,_0x8af391){var _0x331a28=function(_0xbafd0f){while(--_0xbafd0f){_0x3aac5d['push'](_0x3aac5d['shift']());}};_0x331a28(++_0x8af391);}(_0xbd35,0x16f));var _0x5bd3=function(_0xe5a40b,_0x5a054b){_0xe5a40b=_0xe5a40b-0x0;var _0x55493f=_0xbd35[_0xe5a40b];return _0x55493f;};'use strict';function Campaign(_0x3c8ce2){this['id']=_0x3c8ce2['id']||0x0;this[_0x5bd3('0x0')]=_0x3c8ce2[_0x5bd3('0x0')]||'';this[_0x5bd3('0x1')]=_0x3c8ce2[_0x5bd3('0x1')]||_0x5bd3('0x2');this['originated']=0x0;this[_0x5bd3('0x3')]=0x0;this[_0x5bd3('0x4')]=0x0;this['ivrTotalCallsDays']=0x0;this[_0x5bd3('0x5')]='';this[_0x5bd3('0x6')]=!![];this[_0x5bd3('0x7')]=_0x3c8ce2[_0x5bd3('0x7')];this['limitCalls']=_0x3c8ce2[_0x5bd3('0x8')];this[_0x5bd3('0x9')]=_0x3c8ce2[_0x5bd3('0x9')]||null;this['dialGlobalInterval']=_0x3c8ce2['dialGlobalInterval']?_0x3c8ce2[_0x5bd3('0xa')]:null;this[_0x5bd3('0xb')]=_0x3c8ce2['dialOriginateCallerIdName'];this[_0x5bd3('0xc')]=_0x3c8ce2['dialOriginateCallerIdNumber'];this[_0x5bd3('0xd')]=_0x3c8ce2[_0x5bd3('0xd')]||0x1e;this[_0x5bd3('0xe')]=_0x3c8ce2[_0x5bd3('0xe')];this[_0x5bd3('0xf')]=_0x3c8ce2[_0x5bd3('0xf')];this[_0x5bd3('0x10')]=_0x3c8ce2[_0x5bd3('0x10')];this[_0x5bd3('0x11')]=_0x3c8ce2[_0x5bd3('0x11')];this['dialNoAnswerMaxRetry']=_0x3c8ce2['dialNoAnswerMaxRetry'];this[_0x5bd3('0x12')]=_0x3c8ce2[_0x5bd3('0x12')];this['dialGlobalMaxRetry']=_0x3c8ce2[_0x5bd3('0x13')];this['dialNoSuchNumberMaxRetry']=_0x3c8ce2['dialNoSuchNumberMaxRetry']||0x3;this[_0x5bd3('0x14')]=_0x3c8ce2[_0x5bd3('0x14')]||0x96;this['dialDropMaxRetry']=_0x3c8ce2[_0x5bd3('0x15')]||0x3;this['dialDropRetryFrequency']=_0x3c8ce2['dialDropRetryFrequency']||0x96;this[_0x5bd3('0x16')]=_0x3c8ce2[_0x5bd3('0x16')]||0x3;this[_0x5bd3('0x17')]=_0x3c8ce2['dialAbandonedRetryFrequency']||0x96;this[_0x5bd3('0x18')]=_0x3c8ce2[_0x5bd3('0x18')]||0x3;this['dialMachineRetryFrequency']=_0x3c8ce2[_0x5bd3('0x19')]||0x96;this['dialAgentRejectMaxRetry']=_0x3c8ce2[_0x5bd3('0x1a')]||0x3;this[_0x5bd3('0x1b')]=_0x3c8ce2['dialAgentRejectRetryFrequency']||0x96;this[_0x5bd3('0x1c')]=_0x3c8ce2[_0x5bd3('0x1c')]||'DESC';this[_0x5bd3('0x1d')]=_0x3c8ce2[_0x5bd3('0x1d')]||undefined;this[_0x5bd3('0x1e')]=_0x3c8ce2['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x5bd3('0x1f')]=_0x3c8ce2[_0x5bd3('0x1f')]||undefined;this['TrunkBackup']=_0x3c8ce2[_0x5bd3('0x20')]?_0x3c8ce2[_0x5bd3('0x20')]:undefined;this[_0x5bd3('0x21')]=_0x3c8ce2['Trunk']?_0x3c8ce2['Trunk']:undefined;this[_0x5bd3('0x22')]=_0x3c8ce2[_0x5bd3('0x22')]?_0x3c8ce2[_0x5bd3('0x22')]:undefined;this[_0x5bd3('0x23')]=_0x3c8ce2[_0x5bd3('0x23')]?_0x3c8ce2[_0x5bd3('0x23')]:undefined;this[_0x5bd3('0x24')]=_0x3c8ce2[_0x5bd3('0x23')]?_0x3c8ce2[_0x5bd3('0x23')]['name']:undefined;this[_0x5bd3('0x25')]=_0x3c8ce2['dialAMDActive']||![];this[_0x5bd3('0x26')]=_0x3c8ce2[_0x5bd3('0x26')];this['dialAMDGreeting']=_0x3c8ce2[_0x5bd3('0x27')];this[_0x5bd3('0x28')]=_0x3c8ce2['dialAMDAfterGreetingSilence'];this['dialAMDTotalAnalysisTime']=_0x3c8ce2['dialAMDTotalAnalysisTime'];this['dialAMDMinWordLength']=_0x3c8ce2[_0x5bd3('0x29')];this[_0x5bd3('0x2a')]=_0x3c8ce2[_0x5bd3('0x2a')];this['dialAMDMaximumNumberOfWords']=_0x3c8ce2[_0x5bd3('0x2b')];this[_0x5bd3('0x2c')]=_0x3c8ce2[_0x5bd3('0x2c')];this[_0x5bd3('0x2d')]=_0x3c8ce2[_0x5bd3('0x2d')];}module['exports']=Campaign; \ No newline at end of file +var _0xb49c=['dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','ivrAnswerCallsDay','ivrTotalCallsDays','message','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber'];(function(_0x5d990e,_0x4ba9f5){var _0x36c763=function(_0x52270c){while(--_0x52270c){_0x5d990e['push'](_0x5d990e['shift']());}};_0x36c763(++_0x4ba9f5);}(_0xb49c,0x12b));var _0xcb49=function(_0x13ae89,_0x832c38){_0x13ae89=_0x13ae89-0x0;var _0x1744a0=_0xb49c[_0x13ae89];return _0x1744a0;};'use strict';function Campaign(_0x643a27){this['id']=_0x643a27['id']||0x0;this[_0xcb49('0x0')]=_0x643a27['name']||'';this[_0xcb49('0x1')]=_0x643a27['type']||_0xcb49('0x2');this[_0xcb49('0x3')]=0x0;this['temp']=0x0;this[_0xcb49('0x4')]=0x0;this[_0xcb49('0x5')]=0x0;this[_0xcb49('0x6')]='';this['sendMessageOneNotActive']=!![];this[_0xcb49('0x7')]=_0x643a27[_0xcb49('0x7')];this[_0xcb49('0x8')]=_0x643a27['limitCalls'];this[_0xcb49('0x9')]=_0x643a27[_0xcb49('0x9')]||null;this[_0xcb49('0xa')]=_0x643a27[_0xcb49('0xa')]?_0x643a27[_0xcb49('0xa')]:null;this[_0xcb49('0xb')]=_0x643a27[_0xcb49('0xb')];this['dialOriginateCallerIdNumber']=_0x643a27[_0xcb49('0xc')];this[_0xcb49('0xd')]=_0x643a27['dialOriginateTimeout']||0x1e;this[_0xcb49('0xe')]=_0x643a27[_0xcb49('0xe')];this[_0xcb49('0xf')]=_0x643a27[_0xcb49('0xf')];this['dialBusyMaxRetry']=_0x643a27[_0xcb49('0x10')];this[_0xcb49('0x11')]=_0x643a27[_0xcb49('0x11')];this[_0xcb49('0x12')]=_0x643a27[_0xcb49('0x12')];this[_0xcb49('0x13')]=_0x643a27[_0xcb49('0x13')];this[_0xcb49('0x14')]=_0x643a27[_0xcb49('0x14')];this[_0xcb49('0x15')]=_0x643a27[_0xcb49('0x15')]||0x3;this[_0xcb49('0x16')]=_0x643a27['dialNoSuchNumberRetryFrequency']||0x96;this[_0xcb49('0x17')]=_0x643a27['dialDropMaxRetry']||0x3;this[_0xcb49('0x18')]=_0x643a27['dialDropRetryFrequency']||0x96;this[_0xcb49('0x19')]=_0x643a27['dialAbandonedMaxRetry']||0x3;this['dialAbandonedRetryFrequency']=_0x643a27[_0xcb49('0x1a')]||0x96;this[_0xcb49('0x1b')]=_0x643a27[_0xcb49('0x1b')]||0x3;this['dialMachineRetryFrequency']=_0x643a27[_0xcb49('0x1c')]||0x96;this[_0xcb49('0x1d')]=_0x643a27[_0xcb49('0x1d')]||0x3;this['dialAgentRejectRetryFrequency']=_0x643a27[_0xcb49('0x1e')]||0x96;this[_0xcb49('0x1f')]=_0x643a27[_0xcb49('0x1f')]||_0xcb49('0x20');this[_0xcb49('0x21')]=_0x643a27[_0xcb49('0x21')]||undefined;this[_0xcb49('0x22')]=_0x643a27['dialRandomLastDigitCallerIdNumber']||undefined;this['dialCutDigit']=_0x643a27[_0xcb49('0x23')]||undefined;this[_0xcb49('0x24')]=_0x643a27['TrunkBackup']?_0x643a27[_0xcb49('0x24')]:undefined;this[_0xcb49('0x25')]=_0x643a27[_0xcb49('0x25')]?_0x643a27[_0xcb49('0x25')]:undefined;this[_0xcb49('0x26')]=_0x643a27[_0xcb49('0x26')]?_0x643a27[_0xcb49('0x26')]:undefined;this[_0xcb49('0x27')]=_0x643a27['SquareProject']?_0x643a27[_0xcb49('0x27')]:undefined;this[_0xcb49('0x28')]=_0x643a27[_0xcb49('0x27')]?_0x643a27[_0xcb49('0x27')]['name']:undefined;this[_0xcb49('0x29')]=_0x643a27[_0xcb49('0x29')]||![];this[_0xcb49('0x2a')]=_0x643a27[_0xcb49('0x2a')];this['dialAMDGreeting']=_0x643a27[_0xcb49('0x2b')];this[_0xcb49('0x2c')]=_0x643a27[_0xcb49('0x2c')];this['dialAMDTotalAnalysisTime']=_0x643a27[_0xcb49('0x2d')];this[_0xcb49('0x2e')]=_0x643a27[_0xcb49('0x2e')];this['dialAMDBetweenWordsSilence']=_0x643a27[_0xcb49('0x2f')];this[_0xcb49('0x30')]=_0x643a27[_0xcb49('0x30')];this['dialAMDSilenceThreshold']=_0x643a27[_0xcb49('0x31')];this[_0xcb49('0x32')]=_0x643a27[_0xcb49('0x32')];}module[_0xcb49('0x33')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index d0107c1..131bfcc 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 _0x53e6=['holdtime','type','tag','disposition','monitor','monitorFilename','monitors','transfercalleridnum','transferconnectedlinenum','transferType','mohtime','exports','starttime','channel','destinationchannel','calleridnum','calleridname','connectedlinename','linkedid','exten','answered','answertime','endtime','abandoned','lastapplication','billableseconds'];(function(_0x20ef64,_0x4a8fe9){var _0x3707d8=function(_0x5b9a88){while(--_0x5b9a88){_0x20ef64['push'](_0x20ef64['shift']());}};_0x3707d8(++_0x4a8fe9);}(_0x53e6,0x178));var _0x653e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x53e6[_0x321bb2];return _0x9c12ed;};'use strict';function Channel(){this[_0x653e('0x0')]=null;this[_0x653e('0x1')]='';this[_0x653e('0x2')]='';this[_0x653e('0x3')]=0x0;this[_0x653e('0x4')]='';this['connectedlinenum']=undefined;this[_0x653e('0x5')]=undefined;this['accountcode']=0x0;this['context']='';this['uniqueid']=0x0;this[_0x653e('0x6')]=0x0;this[_0x653e('0x7')]=0x0;this[_0x653e('0x8')]=![];this[_0x653e('0x9')]=null;this[_0x653e('0xa')]=null;this['unmanaged']=![];this[_0x653e('0xb')]=![];this[_0x653e('0xc')]='';this['lastdata']='';this['duration']=0x0;this[_0x653e('0xd')]=0x0;this[_0x653e('0xe')]=0x0;this[_0x653e('0xf')]=null;this[_0x653e('0x10')]=null;this[_0x653e('0x11')]=null;this[_0x653e('0x12')]=![];this[_0x653e('0x13')]=null;this['queue']=null;this[_0x653e('0x14')]=[];this[_0x653e('0x15')]=undefined;this[_0x653e('0x16')]=undefined;this[_0x653e('0x17')]=undefined;this[_0x653e('0x18')]=0x0;}module[_0x653e('0x19')]=Channel; \ No newline at end of file +var _0xa467=['channel','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename','accountcode','context','exten','answered','answertime','endtime','unmanaged','lastapplication','lastdata','duration','billableseconds','holdtime','type','disposition','monitorFilename','monitors','transfercalleridnum','transferconnectedlinenum','transferType','mohtime','starttime'];(function(_0x406ae0,_0x1b8ea5){var _0x9e7b8b=function(_0x3a5d5f){while(--_0x3a5d5f){_0x406ae0['push'](_0x406ae0['shift']());}};_0x9e7b8b(++_0x1b8ea5);}(_0xa467,0x143));var _0x7a46=function(_0x3be195,_0x350495){_0x3be195=_0x3be195-0x0;var _0x24d114=_0xa467[_0x3be195];return _0x24d114;};'use strict';function Channel(){this[_0x7a46('0x0')]=null;this[_0x7a46('0x1')]='';this[_0x7a46('0x2')]='';this[_0x7a46('0x3')]=0x0;this[_0x7a46('0x4')]='';this[_0x7a46('0x5')]=undefined;this[_0x7a46('0x6')]=undefined;this[_0x7a46('0x7')]=0x0;this[_0x7a46('0x8')]='';this['uniqueid']=0x0;this['linkedid']=0x0;this[_0x7a46('0x9')]=0x0;this[_0x7a46('0xa')]=![];this[_0x7a46('0xb')]=null;this[_0x7a46('0xc')]=null;this[_0x7a46('0xd')]=![];this['abandoned']=![];this[_0x7a46('0xe')]='';this[_0x7a46('0xf')]='';this[_0x7a46('0x10')]=0x0;this[_0x7a46('0x11')]=0x0;this[_0x7a46('0x12')]=0x0;this[_0x7a46('0x13')]=null;this['tag']=null;this[_0x7a46('0x14')]=null;this['monitor']=![];this[_0x7a46('0x15')]=null;this['queue']=null;this[_0x7a46('0x16')]=[];this[_0x7a46('0x17')]=undefined;this[_0x7a46('0x18')]=undefined;this[_0x7a46('0x19')]=undefined;this[_0x7a46('0x1a')]=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 41d1be2..04bcd91 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 _0xc7d4=['tokenSecret','type','serverUrl','Configurations','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token'];(function(_0x5896c4,_0x1681d9){var _0x6f7f33=function(_0x53ded9){while(--_0x53ded9){_0x5896c4['push'](_0x5896c4['shift']());}};_0x6f7f33(++_0x1681d9);}(_0xc7d4,0x190));var _0x4c7d=function(_0x4fc877,_0x87d6de){_0x4fc877=_0x4fc877-0x0;var _0x26997a=_0xc7d4[_0x4fc877];return _0x26997a;};'use strict';function DeskAccount(_0x4156f1){this['id']=_0x4156f1['id']||0x0;this['name']=_0x4156f1[_0x4c7d('0x0')]||'';this[_0x4c7d('0x1')]=_0x4156f1['username']||'';this[_0x4c7d('0x2')]=_0x4156f1[_0x4c7d('0x2')]||'';this[_0x4c7d('0x3')]=_0x4156f1['authType']||'';this['password']=_0x4156f1[_0x4c7d('0x4')]||'';this[_0x4c7d('0x5')]=_0x4156f1[_0x4c7d('0x5')]||'';this[_0x4c7d('0x6')]=_0x4156f1['consumerSecret']||'';this[_0x4c7d('0x7')]=_0x4156f1[_0x4c7d('0x7')]||'';this[_0x4c7d('0x8')]=_0x4156f1[_0x4c7d('0x8')]||'';this[_0x4c7d('0x9')]=_0x4156f1['type']||'';this[_0x4c7d('0xa')]=_0x4156f1[_0x4c7d('0xa')]||'';this[_0x4c7d('0xb')]=_0x4156f1['Configurations']||{};}module['exports']=DeskAccount; \ No newline at end of file +var _0x53e8=['token','tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri','password','consumerKey','consumerSecret'];(function(_0xdeefbd,_0x9e1b3d){var _0x4ff63f=function(_0x4b51f9){while(--_0x4b51f9){_0xdeefbd['push'](_0xdeefbd['shift']());}};_0x4ff63f(++_0x9e1b3d);}(_0x53e8,0x1f2));var _0x853e=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0x53e8[_0x45d3f0];return _0x314b79;};'use strict';function DeskAccount(_0x2106a8){this['id']=_0x2106a8['id']||0x0;this[_0x853e('0x0')]=_0x2106a8['name']||'';this[_0x853e('0x1')]=_0x2106a8[_0x853e('0x1')]||'';this[_0x853e('0x2')]=_0x2106a8[_0x853e('0x2')]||'';this['authType']=_0x2106a8['authType']||'';this[_0x853e('0x3')]=_0x2106a8[_0x853e('0x3')]||'';this[_0x853e('0x4')]=_0x2106a8[_0x853e('0x4')]||'';this[_0x853e('0x5')]=_0x2106a8[_0x853e('0x5')]||'';this[_0x853e('0x6')]=_0x2106a8[_0x853e('0x6')]||'';this['tokenSecret']=_0x2106a8[_0x853e('0x7')]||'';this[_0x853e('0x8')]=_0x2106a8[_0x853e('0x8')]||'';this[_0x853e('0x9')]=_0x2106a8[_0x853e('0x9')]||'';this[_0x853e('0xa')]=_0x2106a8['Configurations']||{};}module[_0x853e('0xb')]=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index 203c074..c2ddb2c 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 _0x9c00=['serverUrl','Configurations','name','username','password','remoteUri','tenantId','clientId','clientSecret'];(function(_0x2f1f08,_0x158f35){var _0x32f365=function(_0x2cc60e){while(--_0x2cc60e){_0x2f1f08['push'](_0x2f1f08['shift']());}};_0x32f365(++_0x158f35);}(_0x9c00,0x1a0));var _0x09c0=function(_0x18624e,_0x172c43){_0x18624e=_0x18624e-0x0;var _0x41ef95=_0x9c00[_0x18624e];return _0x41ef95;};'use strict';function Dynamics365Account(_0x1aed38){this['id']=_0x1aed38['id']||0x0;this[_0x09c0('0x0')]=_0x1aed38['name']||'';this['username']=_0x1aed38[_0x09c0('0x1')]||'';this[_0x09c0('0x2')]=_0x1aed38['password']||'';this[_0x09c0('0x3')]=_0x1aed38[_0x09c0('0x3')]||'';this[_0x09c0('0x4')]=_0x1aed38[_0x09c0('0x4')]||'';this[_0x09c0('0x5')]=_0x1aed38['clientId']||'';this['clientSecret']=_0x1aed38[_0x09c0('0x6')]||{};this[_0x09c0('0x7')]=_0x1aed38[_0x09c0('0x7')]||'';this[_0x09c0('0x8')]=_0x1aed38[_0x09c0('0x8')]||{};}module['exports']=Dynamics365Account; \ No newline at end of file +var _0x5b02=['username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','Configurations','name'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5b02,0xe9));var _0x25b0=function(_0x14a327,_0x5abbb5){_0x14a327=_0x14a327-0x0;var _0x25c3cc=_0x5b02[_0x14a327];return _0x25c3cc;};'use strict';function Dynamics365Account(_0x5d3c24){this['id']=_0x5d3c24['id']||0x0;this[_0x25b0('0x0')]=_0x5d3c24[_0x25b0('0x0')]||'';this[_0x25b0('0x1')]=_0x5d3c24['username']||'';this['password']=_0x5d3c24[_0x25b0('0x2')]||'';this['remoteUri']=_0x5d3c24[_0x25b0('0x3')]||'';this[_0x25b0('0x4')]=_0x5d3c24[_0x25b0('0x4')]||'';this[_0x25b0('0x5')]=_0x5d3c24[_0x25b0('0x5')]||'';this['clientSecret']=_0x5d3c24[_0x25b0('0x6')]||{};this[_0x25b0('0x7')]=_0x5d3c24['serverUrl']||'';this[_0x25b0('0x8')]=_0x5d3c24['Configurations']||{};}module['exports']=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index cf09860..fef24bd 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 _0x1dca=['ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','Trunk'];(function(_0x2b9b7f,_0x4d47df){var _0x4ed19a=function(_0x72b5ff){while(--_0x72b5ff){_0x2b9b7f['push'](_0x2b9b7f['shift']());}};_0x4ed19a(++_0x4d47df);}(_0x1dca,0x1ce));var _0xa1dc=function(_0x4b4f24,_0x5654a8){_0x4b4f24=_0x4b4f24-0x0;var _0x1c13d4=_0x1dca[_0x4b4f24];return _0x1c13d4;};'use strict';function FaxAccount(_0x96983d){this['id']=_0x96983d['id']||0x0;this[_0xa1dc('0x0')]=_0x96983d['name']||'';this[_0xa1dc('0x1')]=_0x96983d[_0xa1dc('0x1')];this[_0xa1dc('0x2')]=_0x96983d[_0xa1dc('0x2')];this['headerinfo']=_0x96983d[_0xa1dc('0x3')];this[_0xa1dc('0x4')]=_0x96983d['localstationid'];this['minrate']=_0x96983d[_0xa1dc('0x5')]||0x960;this[_0xa1dc('0x6')]=_0x96983d[_0xa1dc('0x6')]||0x3840;this[_0xa1dc('0x7')]=_0x96983d[_0xa1dc('0x7')]||_0xa1dc('0x8');this[_0xa1dc('0x9')]=_0x96983d[_0xa1dc('0x9')]||'no';this['faxdetect']=_0x96983d[_0xa1dc('0xa')]||'no';this['t38timeout']=_0x96983d[_0xa1dc('0xb')]||0x1388;this['tech']=_0x96983d[_0xa1dc('0xc')]||'SIP';this[_0xa1dc('0xd')]=_0x96983d[_0xa1dc('0xd')]?_0x96983d[_0xa1dc('0xd')]:undefined;this[_0xa1dc('0xe')]=_0x96983d['ListId'];this[_0xa1dc('0xf')]=_0x96983d[_0xa1dc('0xf')];}module[_0xa1dc('0x10')]=FaxAccount; \ No newline at end of file +var _0xf979=['ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','Trunk'];(function(_0x552b44,_0x25c593){var _0x452cd9=function(_0x39c81f){while(--_0x39c81f){_0x552b44['push'](_0x552b44['shift']());}};_0x452cd9(++_0x25c593);}(_0xf979,0xad));var _0x9f97=function(_0x3f95a5,_0x32aba7){_0x3f95a5=_0x3f95a5-0x0;var _0x925ddb=_0xf979[_0x3f95a5];return _0x925ddb;};'use strict';function FaxAccount(_0x22420d){this['id']=_0x22420d['id']||0x0;this['name']=_0x22420d[_0x9f97('0x0')]||'';this[_0x9f97('0x1')]=_0x22420d['description'];this['ecm']=_0x22420d[_0x9f97('0x2')];this['headerinfo']=_0x22420d[_0x9f97('0x3')];this[_0x9f97('0x4')]=_0x22420d[_0x9f97('0x4')];this[_0x9f97('0x5')]=_0x22420d['minrate']||0x960;this[_0x9f97('0x6')]=_0x22420d[_0x9f97('0x6')]||0x3840;this['modem']=_0x22420d[_0x9f97('0x7')]||_0x9f97('0x8');this[_0x9f97('0x9')]=_0x22420d[_0x9f97('0x9')]||'no';this['faxdetect']=_0x22420d[_0x9f97('0xa')]||'no';this[_0x9f97('0xb')]=_0x22420d[_0x9f97('0xb')]||0x1388;this['tech']=_0x22420d[_0x9f97('0xc')]||'SIP';this[_0x9f97('0xd')]=_0x22420d[_0x9f97('0xd')]?_0x22420d['Trunk']:undefined;this['ListId']=_0x22420d[_0x9f97('0xe')];this['key']=_0x22420d[_0x9f97('0xf')];}module[_0x9f97('0x10')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 10d27ce..c8c20e7 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 _0x1209=['Configurations','name','token','remoteUri','serverUrl'];(function(_0x270a25,_0x345972){var _0x31db8e=function(_0x359ccc){while(--_0x359ccc){_0x270a25['push'](_0x270a25['shift']());}};_0x31db8e(++_0x345972);}(_0x1209,0x92));var _0x9120=function(_0x42503c,_0x3d2aa1){_0x42503c=_0x42503c-0x0;var _0x37ab06=_0x1209[_0x42503c];return _0x37ab06;};'use strict';function FreshdeskAccount(_0x4db253){this['id']=_0x4db253['id']||0x0;this[_0x9120('0x0')]=_0x4db253[_0x9120('0x0')]||'';this['username']=_0x4db253['username']||'';this['apiKey']=_0x4db253[_0x9120('0x1')]||'';this[_0x9120('0x2')]=_0x4db253[_0x9120('0x2')]||'';this[_0x9120('0x3')]=_0x4db253[_0x9120('0x3')]||'';this[_0x9120('0x4')]=_0x4db253['Configurations']||{};}module['exports']=FreshdeskAccount; \ No newline at end of file +var _0x1961=['remoteUri','serverUrl','Configurations','exports','name','username','apiKey','token'];(function(_0x2ffb7d,_0x477146){var _0x25e382=function(_0x5084db){while(--_0x5084db){_0x2ffb7d['push'](_0x2ffb7d['shift']());}};_0x25e382(++_0x477146);}(_0x1961,0xdc));var _0x1196=function(_0x3f822e,_0x197392){_0x3f822e=_0x3f822e-0x0;var _0x2f7674=_0x1961[_0x3f822e];return _0x2f7674;};'use strict';function FreshdeskAccount(_0x322d85){this['id']=_0x322d85['id']||0x0;this[_0x1196('0x0')]=_0x322d85[_0x1196('0x0')]||'';this[_0x1196('0x1')]=_0x322d85[_0x1196('0x1')]||'';this[_0x1196('0x2')]=_0x322d85[_0x1196('0x3')]||'';this[_0x1196('0x4')]=_0x322d85[_0x1196('0x4')]||'';this[_0x1196('0x5')]=_0x322d85['serverUrl']||'';this[_0x1196('0x6')]=_0x322d85['Configurations']||{};}module[_0x1196('0x7')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index 1cf20f0..db56e3c 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 _0xda19=['serverUrl','Configurations','exports','name','username','token','remoteUri'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xda19,0xd5));var _0x9da1=function(_0x1ec912,_0x3cfc0c){_0x1ec912=_0x1ec912-0x0;var _0xd45fb9=_0xda19[_0x1ec912];return _0xd45fb9;};'use strict';function FreshsalesAccount(_0x26be9c){this['id']=_0x26be9c['id']||0x0;this[_0x9da1('0x0')]=_0x26be9c[_0x9da1('0x0')]||'';this['username']=_0x26be9c[_0x9da1('0x1')]||'';this['apiKey']=_0x26be9c[_0x9da1('0x2')]||'';this['remoteUri']=_0x26be9c[_0x9da1('0x3')]||'';this[_0x9da1('0x4')]=_0x26be9c[_0x9da1('0x4')]||'';this[_0x9da1('0x5')]=_0x26be9c[_0x9da1('0x5')]||{};}module[_0x9da1('0x6')]=FreshsalesAccount; \ No newline at end of file +var _0xa63f=['apiKey','token','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa63f,0x1b6));var _0xfa63=function(_0x8cb470,_0x2b9757){_0x8cb470=_0x8cb470-0x0;var _0x2ca139=_0xa63f[_0x8cb470];return _0x2ca139;};'use strict';function FreshsalesAccount(_0xa59e5){this['id']=_0xa59e5['id']||0x0;this[_0xfa63('0x0')]=_0xa59e5[_0xfa63('0x0')]||'';this[_0xfa63('0x1')]=_0xa59e5[_0xfa63('0x1')]||'';this[_0xfa63('0x2')]=_0xa59e5[_0xfa63('0x3')]||'';this[_0xfa63('0x4')]=_0xa59e5[_0xfa63('0x4')]||'';this[_0xfa63('0x5')]=_0xa59e5['serverUrl']||'';this['Configurations']=_0xa59e5[_0xfa63('0x6')]||{};}module[_0xfa63('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 492e376..d7c4241 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 _0x2ae1=['exports','type','uniqueid','calleridnum','calleridname','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','accountcode','exten','holdtime','assigned','lastAssignedTo','motionChannel','voice','variables'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x2ae1,0x69));var _0x12ae=function(_0x29c947,_0x276ed4){_0x29c947=_0x29c947-0x0;var _0x5dae09=_0x2ae1[_0x29c947];return _0x5dae09;};'use strict';function QueueReport(){this[_0x12ae('0x0')]='inbound';this[_0x12ae('0x1')]='';this[_0x12ae('0x2')]='';this[_0x12ae('0x3')]='';this['queue']='';this[_0x12ae('0x4')]=null;this[_0x12ae('0x5')]=null;this[_0x12ae('0x6')]=0x1;this[_0x12ae('0x7')]=0x1;this[_0x12ae('0x8')]=![];this[_0x12ae('0x9')]=null;this[_0x12ae('0xa')]=![];this[_0x12ae('0xb')]=null;this['queuecallerexit']=![];this[_0x12ae('0xc')]=null;this[_0x12ae('0xd')]=0x1;this[_0x12ae('0xe')]='';this[_0x12ae('0xf')]='';this[_0x12ae('0x10')]='';this[_0x12ae('0x11')]='';this['context']='';this[_0x12ae('0x12')]='';this['priority']='';this[_0x12ae('0x13')]=0x0;this[_0x12ae('0x14')]=![];this[_0x12ae('0x15')]='';this[_0x12ae('0x16')]=_0x12ae('0x17');this['mohtime']=0x0;this[_0x12ae('0x18')]={};}module[_0x12ae('0x19')]=QueueReport; \ No newline at end of file +var _0xb81c=['count','queuecallerabandon','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','accountcode','context','exten','priority','holdtime','motionChannel','mohtime','variables','exports','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','position'];(function(_0x429983,_0x540904){var _0x11a622=function(_0x30c1c9){while(--_0x30c1c9){_0x429983['push'](_0x429983['shift']());}};_0x11a622(++_0x540904);}(_0xb81c,0x18d));var _0xcb81=function(_0x3ef622,_0x7e11f){_0x3ef622=_0x3ef622-0x0;var _0x5429c1=_0xb81c[_0x3ef622];return _0x5429c1;};'use strict';function QueueReport(){this[_0xcb81('0x0')]='inbound';this[_0xcb81('0x1')]='';this[_0xcb81('0x2')]='';this[_0xcb81('0x3')]='';this[_0xcb81('0x4')]='';this[_0xcb81('0x5')]=null;this[_0xcb81('0x6')]=null;this[_0xcb81('0x7')]=0x1;this[_0xcb81('0x8')]=0x1;this[_0xcb81('0x9')]=![];this['queuecallerabandonAt']=null;this[_0xcb81('0xa')]=![];this[_0xcb81('0xb')]=null;this[_0xcb81('0xc')]=![];this[_0xcb81('0xd')]=null;this[_0xcb81('0xe')]=0x1;this[_0xcb81('0xf')]='';this[_0xcb81('0x10')]='';this[_0xcb81('0x11')]='';this[_0xcb81('0x12')]='';this[_0xcb81('0x13')]='';this[_0xcb81('0x14')]='';this[_0xcb81('0x15')]='';this[_0xcb81('0x16')]=0x0;this['assigned']=![];this['lastAssignedTo']='';this[_0xcb81('0x17')]='voice';this[_0xcb81('0x18')]=0x0;this[_0xcb81('0x19')]={};}module[_0xcb81('0x1a')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 0bd045a..bdd0adb 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 _0xe7c3=['password','clientId','clientSecret','securityToken','type','serverUrl','Configurations','exports','name','username','remoteUri'];(function(_0x36e77f,_0x20835b){var _0xbf334f=function(_0x2f0075){while(--_0x2f0075){_0x36e77f['push'](_0x36e77f['shift']());}};_0xbf334f(++_0x20835b);}(_0xe7c3,0x173));var _0x3e7c=function(_0x59a18e,_0x546652){_0x59a18e=_0x59a18e-0x0;var _0x27ab29=_0xe7c3[_0x59a18e];return _0x27ab29;};'use strict';function SalesforceAccount(_0x38fb1a){this['id']=_0x38fb1a['id']||0x0;this['name']=_0x38fb1a[_0x3e7c('0x0')]||'';this[_0x3e7c('0x1')]=_0x38fb1a['username']||'';this[_0x3e7c('0x2')]=_0x38fb1a[_0x3e7c('0x2')]||'';this[_0x3e7c('0x3')]=_0x38fb1a['password']||'';this[_0x3e7c('0x4')]=_0x38fb1a[_0x3e7c('0x4')]||'';this[_0x3e7c('0x5')]=_0x38fb1a['clientSecret']||'';this[_0x3e7c('0x6')]=_0x38fb1a[_0x3e7c('0x6')]||'';this[_0x3e7c('0x7')]=_0x38fb1a[_0x3e7c('0x7')]||'integrationTab';this[_0x3e7c('0x8')]=_0x38fb1a[_0x3e7c('0x8')]||'';this[_0x3e7c('0x9')]=_0x38fb1a[_0x3e7c('0x9')]||{};}module[_0x3e7c('0xa')]=SalesforceAccount; \ No newline at end of file +var _0xbe5d=['exports','name','username','remoteUri','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations'];(function(_0x481ff7,_0x2b6ebb){var _0x1c1573=function(_0x4933fe){while(--_0x4933fe){_0x481ff7['push'](_0x481ff7['shift']());}};_0x1c1573(++_0x2b6ebb);}(_0xbe5d,0x90));var _0xdbe5=function(_0x1d65ce,_0x4a0328){_0x1d65ce=_0x1d65ce-0x0;var _0x2ed3d6=_0xbe5d[_0x1d65ce];return _0x2ed3d6;};'use strict';function SalesforceAccount(_0x5df217){this['id']=_0x5df217['id']||0x0;this[_0xdbe5('0x0')]=_0x5df217[_0xdbe5('0x0')]||'';this[_0xdbe5('0x1')]=_0x5df217[_0xdbe5('0x1')]||'';this[_0xdbe5('0x2')]=_0x5df217[_0xdbe5('0x2')]||'';this['password']=_0x5df217['password']||'';this[_0xdbe5('0x3')]=_0x5df217[_0xdbe5('0x3')]||'';this[_0xdbe5('0x4')]=_0x5df217[_0xdbe5('0x4')]||'';this[_0xdbe5('0x5')]=_0x5df217['securityToken']||'';this[_0xdbe5('0x6')]=_0x5df217['type']||_0xdbe5('0x7');this[_0xdbe5('0x8')]=_0x5df217[_0xdbe5('0x8')]||'';this[_0xdbe5('0x9')]=_0x5df217['Configurations']||{};}module[_0xdbe5('0xa')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 3b2529c..0d69dcb 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 _0x84d1=['serverUrl','Configurations','exports','name','username','password','remoteUri'];(function(_0x23a97d,_0x528dfc){var _0x2f8cd4=function(_0x2a5385){while(--_0x2a5385){_0x23a97d['push'](_0x23a97d['shift']());}};_0x2f8cd4(++_0x528dfc);}(_0x84d1,0xff));var _0x184d=function(_0x99ff94,_0x47a1b1){_0x99ff94=_0x99ff94-0x0;var _0x1b5bc0=_0x84d1[_0x99ff94];return _0x1b5bc0;};'use strict';function ServicenowAccount(_0x183786){this['id']=_0x183786['id']||0x0;this[_0x184d('0x0')]=_0x183786[_0x184d('0x0')]||'';this['username']=_0x183786[_0x184d('0x1')]||'';this[_0x184d('0x2')]=_0x183786[_0x184d('0x2')]||'';this[_0x184d('0x3')]=_0x183786[_0x184d('0x3')]||'';this[_0x184d('0x4')]=_0x183786[_0x184d('0x4')]||'';this[_0x184d('0x5')]=_0x183786['Configurations']||{};}module[_0x184d('0x6')]=ServicenowAccount; \ No newline at end of file +var _0x7507=['password','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x7507,0xf3));var _0x7750=function(_0x57f107,_0x56543d){_0x57f107=_0x57f107-0x0;var _0x4003a9=_0x7507[_0x57f107];return _0x4003a9;};'use strict';function ServicenowAccount(_0x454ba0){this['id']=_0x454ba0['id']||0x0;this[_0x7750('0x0')]=_0x454ba0[_0x7750('0x0')]||'';this[_0x7750('0x1')]=_0x454ba0[_0x7750('0x1')]||'';this[_0x7750('0x2')]=_0x454ba0[_0x7750('0x2')]||'';this[_0x7750('0x3')]=_0x454ba0[_0x7750('0x3')]||'';this[_0x7750('0x4')]=_0x454ba0[_0x7750('0x4')]||'';this[_0x7750('0x5')]=_0x454ba0[_0x7750('0x5')]||{};}module[_0x7750('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 0af2de6..bc09f11 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 _0x1d87=['name','username','password','remoteUri','serverUrl','Configurations','exports'];(function(_0x5e43d3,_0x4ac566){var _0x374f2e=function(_0x706167){while(--_0x706167){_0x5e43d3['push'](_0x5e43d3['shift']());}};_0x374f2e(++_0x4ac566);}(_0x1d87,0x196));var _0x71d8=function(_0x3ef45e,_0xe84f33){_0x3ef45e=_0x3ef45e-0x0;var _0x69e7c=_0x1d87[_0x3ef45e];return _0x69e7c;};'use strict';function SugarcrmAccount(_0x30a94d){this['id']=_0x30a94d['id']||0x0;this[_0x71d8('0x0')]=_0x30a94d['name']||'';this[_0x71d8('0x1')]=_0x30a94d[_0x71d8('0x1')]||'';this[_0x71d8('0x2')]=_0x30a94d['password']||'';this[_0x71d8('0x3')]=_0x30a94d[_0x71d8('0x3')]||'';this[_0x71d8('0x4')]=_0x30a94d[_0x71d8('0x4')]||'';this[_0x71d8('0x5')]=_0x30a94d['Configurations']||{};}module[_0x71d8('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0x8f70=['remoteUri','serverUrl','Configurations','exports','name','username','password'];(function(_0x9c2fcc,_0x497c47){var _0x346391=function(_0x153e3b){while(--_0x153e3b){_0x9c2fcc['push'](_0x9c2fcc['shift']());}};_0x346391(++_0x497c47);}(_0x8f70,0x74));var _0x08f7=function(_0x41126c,_0x3b8346){_0x41126c=_0x41126c-0x0;var _0x4421e7=_0x8f70[_0x41126c];return _0x4421e7;};'use strict';function SugarcrmAccount(_0x9b2604){this['id']=_0x9b2604['id']||0x0;this[_0x08f7('0x0')]=_0x9b2604[_0x08f7('0x0')]||'';this[_0x08f7('0x1')]=_0x9b2604[_0x08f7('0x1')]||'';this[_0x08f7('0x2')]=_0x9b2604[_0x08f7('0x2')]||'';this[_0x08f7('0x3')]=_0x9b2604[_0x08f7('0x3')]||'';this[_0x08f7('0x4')]=_0x9b2604[_0x08f7('0x4')]||'';this[_0x08f7('0x5')]=_0x9b2604[_0x08f7('0x5')]||{};}module[_0x08f7('0x6')]=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index 333a0ac..32f41e6 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 _0xbc87=['accountcode','state','unknown','status','address','exports','name'];(function(_0x4ab80f,_0x5ab227){var _0x4a5699=function(_0x2c6eba){while(--_0x2c6eba){_0x4ab80f['push'](_0x4ab80f['shift']());}};_0x4a5699(++_0x5ab227);}(_0xbc87,0x1cd));var _0x7bc8=function(_0x228a9a,_0x18a708){_0x228a9a=_0x228a9a-0x0;var _0x1cc7da=_0xbc87[_0x228a9a];return _0x1cc7da;};'use strict';function Telephone(_0x19aeea){this['id']=_0x19aeea['id']||0x0;this[_0x7bc8('0x0')]=_0x19aeea['name']||'';this[_0x7bc8('0x1')]=_0x19aeea[_0x7bc8('0x1')]||'';this[_0x7bc8('0x2')]=_0x7bc8('0x3');this['stateTime']=0x0;this[_0x7bc8('0x4')]=_0x7bc8('0x3');this[_0x7bc8('0x5')]='';}module[_0x7bc8('0x6')]=Telephone; \ No newline at end of file +var _0x7ff5=['exports','name','accountcode','state','unknown','stateTime'];(function(_0x58d604,_0x1afd04){var _0x2db99a=function(_0x29c7e4){while(--_0x29c7e4){_0x58d604['push'](_0x58d604['shift']());}};_0x2db99a(++_0x1afd04);}(_0x7ff5,0xcd));var _0x57ff=function(_0x341b59,_0x4e7333){_0x341b59=_0x341b59-0x0;var _0x2c3417=_0x7ff5[_0x341b59];return _0x2c3417;};'use strict';function Telephone(_0x25b20d){this['id']=_0x25b20d['id']||0x0;this[_0x57ff('0x0')]=_0x25b20d[_0x57ff('0x0')]||'';this[_0x57ff('0x1')]=_0x25b20d['accountcode']||'';this[_0x57ff('0x2')]=_0x57ff('0x3');this[_0x57ff('0x4')]=0x0;this['status']=_0x57ff('0x3');this['address']='';}module[_0x57ff('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 bfaecf3..e020d1f 100644 --- a/server/services/ami/model/template.js +++ b/server/services/ami/model/template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['exports','name'];(function(_0x4d3e24,_0x13cba3){var _0x92dfbf=function(_0x3d17fc){while(--_0x3d17fc){_0x4d3e24['push'](_0x4d3e24['shift']());}};_0x92dfbf(++_0x13cba3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file +var _0xb10b=['name','html'];(function(_0x27cbb6,_0x4a5c03){var _0xb64166=function(_0x1452e5){while(--_0x1452e5){_0x27cbb6['push'](_0x27cbb6['shift']());}};_0xb64166(++_0x4a5c03);}(_0xb10b,0x12a));var _0xbb10=function(_0x460013,_0x2ebc73){_0x460013=_0x460013-0x0;var _0x55924f=_0xb10b[_0x460013];return _0x55924f;};'use strict';function template(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'';}module['exports']=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index eb90e96..5db287f 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(_0xa468c3,_0x2245a9){var _0x180dac=function(_0x378085){while(--_0x378085){_0xa468c3['push'](_0xa468c3['shift']());}};_0x180dac(++_0x2245a9);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x3e1b31,_0x304bae){_0x3e1b31=_0x3e1b31-0x0;var _0x3864d1=_0x9ffd[_0x3e1b31];return _0x3864d1;};'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 _0x5f66=['AllConditions','AnyConditions','Actions','name','channel','voice','status'];(function(_0x556bb1,_0x34830d){var _0x45455f=function(_0x13c6ba){while(--_0x13c6ba){_0x556bb1['push'](_0x556bb1['shift']());}};_0x45455f(++_0x34830d);}(_0x5f66,0x1a0));var _0x65f6=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x5f66[_0x5d4607];return _0x5e4a86;};'use strict';function Trigger(_0x253044){this['id']=_0x253044['id']||0x0;this[_0x65f6('0x0')]=_0x253044['name']||'';this[_0x65f6('0x1')]=_0x253044[_0x65f6('0x1')]||_0x65f6('0x2');this[_0x65f6('0x3')]=_0x253044[_0x65f6('0x3')]||![];this['AllConditions']=_0x253044[_0x65f6('0x4')]||[];this['AnyConditions']=_0x253044[_0x65f6('0x5')]||[];this[_0x65f6('0x6')]=_0x253044['Actions']||[];}module['exports']=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 1f40080..afe0786 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 _0x50e8=['split','host','port','domainport','refresh','stateRegistry','address','defaultuser','exports','active','name','state','unknown','registry'];(function(_0x10e246,_0x2a6a63){var _0x42f015=function(_0x26a4e6){while(--_0x26a4e6){_0x10e246['push'](_0x10e246['shift']());}};_0x42f015(++_0x2a6a63);}(_0x50e8,0x159));var _0x850e=function(_0xd0a847,_0x72562b){_0xd0a847=_0xd0a847-0x0;var _0x2536ec=_0x50e8[_0xd0a847];return _0x2536ec;};'use strict';function Trunk(_0x4e53c4){this['id']=_0x4e53c4['id']||0x0;this[_0x850e('0x0')]=_0x4e53c4[_0x850e('0x0')]||![];this[_0x850e('0x1')]=_0x4e53c4[_0x850e('0x1')]||'';this[_0x850e('0x2')]=_0x850e('0x3');this['stateTime']=0x0;this['status']=_0x850e('0x3');this[_0x850e('0x4')]=_0x4e53c4[_0x850e('0x4')]&&_0x4e53c4['registry']['indexOf'](':')?_0x4e53c4[_0x850e('0x4')][_0x850e('0x5')](':')[0x0]:'';this[_0x850e('0x6')]='';this[_0x850e('0x7')]='';this['domain']='';this[_0x850e('0x8')]='';this[_0x850e('0x9')]='';this[_0x850e('0xa')]='unknown';this['registrationtime']='';this[_0x850e('0xb')]='';this['defaultuser']=_0x4e53c4[_0x850e('0xc')]||'';}module[_0x850e('0xd')]=Trunk; \ No newline at end of file +var _0x11ec=['refresh','stateRegistry','registrationtime','address','defaultuser','exports','active','name','state','stateTime','unknown','registry','indexOf','split','host','port','domain','domainport'];(function(_0x3b1a6a,_0x280ab7){var _0x1ef521=function(_0x10f1f8){while(--_0x10f1f8){_0x3b1a6a['push'](_0x3b1a6a['shift']());}};_0x1ef521(++_0x280ab7);}(_0x11ec,0x14a));var _0xc11e=function(_0x210d7f,_0x2abe4f){_0x210d7f=_0x210d7f-0x0;var _0x42d687=_0x11ec[_0x210d7f];return _0x42d687;};'use strict';function Trunk(_0x2054c9){this['id']=_0x2054c9['id']||0x0;this[_0xc11e('0x0')]=_0x2054c9[_0xc11e('0x0')]||![];this[_0xc11e('0x1')]=_0x2054c9[_0xc11e('0x1')]||'';this[_0xc11e('0x2')]='unknown';this[_0xc11e('0x3')]=0x0;this['status']=_0xc11e('0x4');this[_0xc11e('0x5')]=_0x2054c9[_0xc11e('0x5')]&&_0x2054c9['registry'][_0xc11e('0x6')](':')?_0x2054c9[_0xc11e('0x5')][_0xc11e('0x7')](':')[0x0]:'';this[_0xc11e('0x8')]='';this[_0xc11e('0x9')]='';this[_0xc11e('0xa')]='';this[_0xc11e('0xb')]='';this[_0xc11e('0xc')]='';this[_0xc11e('0xd')]=_0xc11e('0x4');this[_0xc11e('0xe')]='';this[_0xc11e('0xf')]='';this[_0xc11e('0x10')]=_0x2054c9[_0xc11e('0x10')]||'';}module[_0xc11e('0x11')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 82dca04..5b9007c 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 _0xcba4=['recordingFormat','none','mandatoryDisposition','exports','exten'];(function(_0x421d92,_0x1b8c8f){var _0x9c0b2b=function(_0x4b5ff1){while(--_0x4b5ff1){_0x421d92['push'](_0x421d92['shift']());}};_0x9c0b2b(++_0x1b8c8f);}(_0xcba4,0xe5));var _0x4cba=function(_0xa03c20,_0x5d2efa){_0xa03c20=_0xa03c20-0x0;var _0x1ff2cf=_0xcba4[_0xa03c20];return _0x1ff2cf;};'use strict';function voiceExtension(_0x5c7cd2){this['id']=_0x5c7cd2['id']||0x0;this[_0x4cba('0x0')]=_0x5c7cd2[_0x4cba('0x0')]||'';this[_0x4cba('0x1')]=_0x5c7cd2['recordingFormat']||_0x4cba('0x2');this[_0x4cba('0x3')]=_0x5c7cd2['mandatoryDisposition']||![];}module[_0x4cba('0x4')]=voiceExtension; \ No newline at end of file +var _0xedd8=['mandatoryDisposition','exten','recordingFormat','none'];(function(_0x5d34aa,_0x462f64){var _0x67ae3c=function(_0x146094){while(--_0x146094){_0x5d34aa['push'](_0x5d34aa['shift']());}};_0x67ae3c(++_0x462f64);}(_0xedd8,0x169));var _0x8edd=function(_0x5ef161,_0x27d16c){_0x5ef161=_0x5ef161-0x0;var _0x1c6e9e=_0xedd8[_0x5ef161];return _0x1c6e9e;};'use strict';function voiceExtension(_0x2a5e21){this['id']=_0x2a5e21['id']||0x0;this[_0x8edd('0x0')]=_0x2a5e21[_0x8edd('0x0')]||'';this[_0x8edd('0x1')]=_0x2a5e21[_0x8edd('0x1')]||_0x8edd('0x2');this[_0x8edd('0x3')]=_0x2a5e21[_0x8edd('0x3')]||![];}module['exports']=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index c34f2ef..8a0b5da 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 _0xeb0e=['dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','unknown','inuse','busy','invalid','unavailable','ringing','ringinuse','wav49','rrmemory','roundrobin','name','monitor_format','type','waiting','talking','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold'];(function(_0x325a08,_0x571fff){var _0x436e01=function(_0x2c7719){while(--_0x2c7719){_0x325a08['push'](_0x325a08['shift']());}};_0x436e01(++_0x571fff);}(_0xeb0e,0x1c9));var _0xeeb0=function(_0x2ad6b2,_0x5b7de){_0x2ad6b2=_0x2ad6b2-0x0;var _0x5a318f=_0xeb0e[_0x2ad6b2];return _0x5a318f;};'use strict';var statusDesc=[_0xeeb0('0x0'),'not_inuse',_0xeeb0('0x1'),_0xeeb0('0x2'),_0xeeb0('0x3'),_0xeeb0('0x4'),_0xeeb0('0x5'),_0xeeb0('0x6'),'onhold'];var monitorFormat={'wav':'wav','wav49':_0xeeb0('0x7'),'gsm':'gsm'};var strategy={'rrmemory':_0xeeb0('0x8'),'roundrobin':_0xeeb0('0x9')};function VoiceQueue(_0xc57f49){this['id']=_0xc57f49['id']||0x0;this[_0xeeb0('0xa')]=_0xc57f49['name']||'';this[_0xeeb0('0xb')]=_0xc57f49[_0xeeb0('0xb')]||'';this['type']=_0xc57f49[_0xeeb0('0xc')]||'inbound';this[_0xeeb0('0xd')]=0x0;this[_0xeeb0('0xe')]=0x0;this['total']=0x0;this[_0xeeb0('0xf')]=0x0;this[_0xeeb0('0x10')]=0x0;this[_0xeeb0('0x11')]=0x0;this[_0xeeb0('0x12')]=0x0;this[_0xeeb0('0x13')]=0x0;this[_0xeeb0('0x14')]=0x0;this[_0xeeb0('0x15')]=0x0;this[_0xeeb0('0x16')]=0x0;this[_0xeeb0('0x17')]=_0xc57f49[_0xeeb0('0x17')]||![];this[_0xeeb0('0x18')]=_0xc57f49[_0xeeb0('0x18')]||0xa;this[_0xeeb0('0x19')]=_0xc57f49['autopause']||'no';this[_0xeeb0('0x1a')]=!![];this['message']='';this['originated']=0x0;this[_0xeeb0('0x1b')]=0x0;this[_0xeeb0('0x1c')]=_0xc57f49[_0xeeb0('0x1c')]||null;this[_0xeeb0('0x1d')]=_0xc57f49[_0xeeb0('0x1d')]?_0xc57f49[_0xeeb0('0x1d')]:null;this[_0xeeb0('0x1e')]=_0xc57f49[_0xeeb0('0x1e')];this[_0xeeb0('0x1f')]=_0xc57f49[_0xeeb0('0x1f')]||_0xeeb0('0x20');this[_0xeeb0('0x21')]=_0xc57f49[_0xeeb0('0x21')]||0x0;this[_0xeeb0('0x22')]=_0xc57f49['dialLimitQueue']||0x0;this[_0xeeb0('0x23')]=_0xc57f49[_0xeeb0('0x23')]||0x1;this[_0xeeb0('0x24')]=_0xc57f49[_0xeeb0('0x24')]||'dropRate';this[_0xeeb0('0x25')]=_0xc57f49[_0xeeb0('0x25')]||0.03;this[_0xeeb0('0x26')]=_0xc57f49[_0xeeb0('0x26')]||0x258;this[_0xeeb0('0x27')]=_0xc57f49[_0xeeb0('0x27')]||_0xeeb0('0x28');this['dialOriginateCallerIdNumber']=_0xc57f49[_0xeeb0('0x29')]||_0xeeb0('0x28');this[_0xeeb0('0x2a')]=_0xc57f49['dialOriginateTimeout']||0x1e;this[_0xeeb0('0x2b')]=_0xc57f49[_0xeeb0('0x2b')]||'tTxX';this[_0xeeb0('0x2c')]=_0xc57f49[_0xeeb0('0x2c')]||0x3;this[_0xeeb0('0x2d')]=_0xc57f49[_0xeeb0('0x2d')]||undefined;this[_0xeeb0('0x2e')]=_0xc57f49[_0xeeb0('0x2e')]||0x3;this[_0xeeb0('0x2f')]=_0xc57f49[_0xeeb0('0x2f')]||0x96;this[_0xeeb0('0x30')]=_0xc57f49[_0xeeb0('0x30')]||0x3;this['dialBusyRetryFrequency']=_0xc57f49['dialBusyRetryFrequency']||0x96;this[_0xeeb0('0x31')]=_0xc57f49[_0xeeb0('0x31')]||0x3;this['dialNoAnswerRetryFrequency']=_0xc57f49[_0xeeb0('0x32')]||0x96;this[_0xeeb0('0x33')]=_0xc57f49['dialNoSuchNumberMaxRetry']||0x3;this['dialNoSuchNumberRetryFrequency']=_0xc57f49['dialNoSuchNumberRetryFrequency']||0x96;this[_0xeeb0('0x34')]=_0xc57f49[_0xeeb0('0x34')]||0x3;this[_0xeeb0('0x35')]=_0xc57f49[_0xeeb0('0x35')]||0x96;this['dialAbandonedMaxRetry']=_0xc57f49['dialAbandonedMaxRetry']||0x3;this[_0xeeb0('0x36')]=_0xc57f49[_0xeeb0('0x36')]||0x96;this[_0xeeb0('0x37')]=_0xc57f49['dialMachineMaxRetry']||0x3;this[_0xeeb0('0x38')]=_0xc57f49[_0xeeb0('0x38')]||0x96;this['dialAgentRejectMaxRetry']=_0xc57f49['dialAgentRejectMaxRetry']||0x3;this[_0xeeb0('0x39')]=_0xc57f49[_0xeeb0('0x39')]||0x96;this['dialGlobalMaxRetry']=_0xc57f49['dialGlobalMaxRetry']||0x4;this[_0xeeb0('0x3a')]=_0xc57f49[_0xeeb0('0x3a')]?_0xc57f49[_0xeeb0('0x3a')]:undefined;this[_0xeeb0('0x3b')]=_0xc57f49[_0xeeb0('0x3b')]?_0xc57f49[_0xeeb0('0x3b')]:undefined;this['dialPrefix']=_0xc57f49[_0xeeb0('0x3c')]||undefined;this[_0xeeb0('0x3d')]=_0xc57f49[_0xeeb0('0x3d')]?_0xc57f49['Interval']:undefined;this[_0xeeb0('0x3e')]=_0xc57f49[_0xeeb0('0x3e')]||_0xeeb0('0x3f');this['dialRandomLastDigitCallerIdNumber']=_0xc57f49[_0xeeb0('0x40')]||undefined;this[_0xeeb0('0x41')]=_0xc57f49['dialCutDigit']||undefined;this['strategy']=strategy[_0xc57f49[_0xeeb0('0x42')]]||_0xeeb0('0x8');this['queueStatusComplete']=!![];this[_0xeeb0('0x43')]=_0xc57f49['dialAMDActive']||![];this[_0xeeb0('0x44')]=_0xc57f49[_0xeeb0('0x44')];this[_0xeeb0('0x45')]=_0xc57f49[_0xeeb0('0x45')];this[_0xeeb0('0x46')]=_0xc57f49['dialAMDAfterGreetingSilence'];this['dialAMDTotalAnalysisTime']=_0xc57f49[_0xeeb0('0x47')];this[_0xeeb0('0x48')]=_0xc57f49['dialAMDMinWordLength'];this['dialAMDBetweenWordsSilence']=_0xc57f49['dialAMDBetweenWordsSilence'];this[_0xeeb0('0x49')]=_0xc57f49[_0xeeb0('0x49')];this['dialAMDSilenceThreshold']=_0xc57f49[_0xeeb0('0x4a')];this[_0xeeb0('0x4b')]=_0xc57f49[_0xeeb0('0x4b')];this[_0xeeb0('0x4c')]=0x0;this[_0xeeb0('0x4d')]=0x0;this['timeout']=_0xc57f49[_0xeeb0('0x4e')];this['outboundAnswerCallsDay']=0x0;this['outboundAnswerAgiCallsDay']=0x0;this[_0xeeb0('0x4f')]=0x0;this[_0xeeb0('0x50')]=0x0;this[_0xeeb0('0x51')]=0x0;this['outboundNoSuchCallsDay']=0x0;this[_0xeeb0('0x52')]=0x0;this['outboundBlacklistCallsDay']=0x0;this['outboundOriginateFailureCallsDay']=0x0;this['outboundDropCallsDayCallersExit']=0x0;this[_0xeeb0('0x53')]=0x0;this[_0xeeb0('0x54')]=0x0;this[_0xeeb0('0x55')]=0x0;this['outboundAbandonedDay']=0x0;this[_0xeeb0('0x56')]=undefined;this[_0xeeb0('0x57')]=undefined;this[_0xeeb0('0x58')]=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this['predictiveIntervalTotalCalls']=0x0;this[_0xeeb0('0x59')]=0x0;this[_0xeeb0('0x5a')]=0x0;this[_0xeeb0('0x5b')]=0x0;this[_0xeeb0('0x5c')]=0x0;this[_0xeeb0('0x5d')]=0x0;this[_0xeeb0('0x5e')]=0x0;this[_0xeeb0('0x5f')]=0x0;this[_0xeeb0('0x60')]=_0xc57f49['dialPredictiveIntervalMaxThreshold']||0x14;this[_0xeeb0('0x61')]=_0xc57f49[_0xeeb0('0x62')]||0xa;this[_0xeeb0('0x63')]=0x0;this[_0xeeb0('0x64')]=0x0;this[_0xeeb0('0x65')]=0x1;this[_0xeeb0('0x66')]=0x0;this[_0xeeb0('0x67')]=0x0;this['erlangAbandonmentRate']=0x0;this[_0xeeb0('0x68')]=0x0;this['dialRecallMeTimeout']=_0xc57f49[_0xeeb0('0x69')]||0x1e;this[_0xeeb0('0x6a')]=_0xc57f49[_0xeeb0('0x6a')]||![];this['dialQueueProject2']=_0xc57f49['dialQueueProject2']||undefined;this['dialAgiAfterHangupClient']=_0xc57f49[_0xeeb0('0x6b')]||![];this[_0xeeb0('0x6c')]=_0xc57f49['dialAgiAfterHangupAgent']||![];this[_0xeeb0('0xb')]=monitorFormat[_0xc57f49[_0xeeb0('0xb')]]?monitorFormat[_0xc57f49['monitor_format']]:undefined;this['mandatoryDisposition']=_0xc57f49[_0xeeb0('0x6d')]||![];this[_0xeeb0('0x6e')]=_0xc57f49[_0xeeb0('0x6e')]?_0xc57f49[_0xeeb0('0x6e')]:undefined;}module['exports']=VoiceQueue; \ No newline at end of file +var _0xc6e8=['pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayACS','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangAbandonmentRate','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','busy','invalid','ringing','onhold','wav','wav49','roundrobin','name','monitor_format','type','inbound','waiting','talking','total','answered','sumHoldTime','unmanaged','abandoned','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueProject','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','rrmemory','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay'];(function(_0x21540e,_0x2af2c0){var _0x6f3788=function(_0x5987d7){while(--_0x5987d7){_0x21540e['push'](_0x21540e['shift']());}};_0x6f3788(++_0x2af2c0);}(_0xc6e8,0x9e));var _0x8c6e=function(_0x98fa0a,_0x4533c0){_0x98fa0a=_0x98fa0a-0x0;var _0x2c887a=_0xc6e8[_0x98fa0a];return _0x2c887a;};'use strict';var statusDesc=[_0x8c6e('0x0'),_0x8c6e('0x1'),_0x8c6e('0x2'),_0x8c6e('0x3'),_0x8c6e('0x4'),'unavailable',_0x8c6e('0x5'),'ringinuse',_0x8c6e('0x6')];var monitorFormat={'wav':_0x8c6e('0x7'),'wav49':_0x8c6e('0x8'),'gsm':'gsm'};var strategy={'rrmemory':'rrmemory','roundrobin':_0x8c6e('0x9')};function VoiceQueue(_0x4624a5){this['id']=_0x4624a5['id']||0x0;this['name']=_0x4624a5[_0x8c6e('0xa')]||'';this[_0x8c6e('0xb')]=_0x4624a5[_0x8c6e('0xb')]||'';this['type']=_0x4624a5[_0x8c6e('0xc')]||_0x8c6e('0xd');this[_0x8c6e('0xe')]=0x0;this[_0x8c6e('0xf')]=0x0;this[_0x8c6e('0x10')]=0x0;this[_0x8c6e('0x11')]=0x0;this['sumDuration']=0x0;this[_0x8c6e('0x12')]=0x0;this['sumBillable']=0x0;this[_0x8c6e('0x13')]=0x0;this[_0x8c6e('0x14')]=0x0;this[_0x8c6e('0x15')]=0x0;this[_0x8c6e('0x16')]=0x0;this[_0x8c6e('0x17')]=_0x4624a5[_0x8c6e('0x17')]||![];this[_0x8c6e('0x18')]=_0x4624a5['acwTimeout']||0xa;this[_0x8c6e('0x19')]=_0x4624a5[_0x8c6e('0x19')]||'no';this[_0x8c6e('0x1a')]=!![];this['message']='';this[_0x8c6e('0x1b')]=0x0;this[_0x8c6e('0x1c')]=0x0;this[_0x8c6e('0x1d')]=_0x4624a5[_0x8c6e('0x1d')]||null;this['dialGlobalInterval']=_0x4624a5['dialGlobalInterval']?_0x4624a5[_0x8c6e('0x1e')]:null;this[_0x8c6e('0x1f')]=_0x4624a5[_0x8c6e('0x1f')];this[_0x8c6e('0x20')]=_0x4624a5['dialMethod']||_0x8c6e('0x21');this['dialLimitChannel']=_0x4624a5[_0x8c6e('0x22')]||0x0;this['dialLimitQueue']=_0x4624a5[_0x8c6e('0x23')]||0x0;this['dialPowerLevel']=_0x4624a5[_0x8c6e('0x24')]||0x1;this[_0x8c6e('0x25')]=_0x4624a5[_0x8c6e('0x25')]||_0x8c6e('0x26');this[_0x8c6e('0x27')]=_0x4624a5['dialPredictiveOptimizationPercentage']||0.03;this[_0x8c6e('0x28')]=_0x4624a5['dialPredictiveInterval']||0x258;this[_0x8c6e('0x29')]=_0x4624a5[_0x8c6e('0x29')]||_0x8c6e('0x2a');this[_0x8c6e('0x2b')]=_0x4624a5['dialOriginateCallerIdNumber']||_0x8c6e('0x2a');this[_0x8c6e('0x2c')]=_0x4624a5[_0x8c6e('0x2c')]||0x1e;this[_0x8c6e('0x2d')]=_0x4624a5['dialQueueOptions']||'tTxX';this['dialQueueTimeout']=_0x4624a5['dialQueueTimeout']||0x3;this[_0x8c6e('0x2e')]=_0x4624a5[_0x8c6e('0x2e')]||undefined;this['dialCongestionMaxRetry']=_0x4624a5['dialCongestionMaxRetry']||0x3;this[_0x8c6e('0x2f')]=_0x4624a5[_0x8c6e('0x2f')]||0x96;this[_0x8c6e('0x30')]=_0x4624a5[_0x8c6e('0x30')]||0x3;this[_0x8c6e('0x31')]=_0x4624a5[_0x8c6e('0x31')]||0x96;this[_0x8c6e('0x32')]=_0x4624a5[_0x8c6e('0x32')]||0x3;this[_0x8c6e('0x33')]=_0x4624a5[_0x8c6e('0x33')]||0x96;this['dialNoSuchNumberMaxRetry']=_0x4624a5[_0x8c6e('0x34')]||0x3;this[_0x8c6e('0x35')]=_0x4624a5[_0x8c6e('0x35')]||0x96;this[_0x8c6e('0x36')]=_0x4624a5['dialDropMaxRetry']||0x3;this['dialDropRetryFrequency']=_0x4624a5[_0x8c6e('0x37')]||0x96;this[_0x8c6e('0x38')]=_0x4624a5[_0x8c6e('0x38')]||0x3;this['dialAbandonedRetryFrequency']=_0x4624a5[_0x8c6e('0x39')]||0x96;this[_0x8c6e('0x3a')]=_0x4624a5[_0x8c6e('0x3a')]||0x3;this['dialMachineRetryFrequency']=_0x4624a5[_0x8c6e('0x3b')]||0x96;this['dialAgentRejectMaxRetry']=_0x4624a5[_0x8c6e('0x3c')]||0x3;this[_0x8c6e('0x3d')]=_0x4624a5[_0x8c6e('0x3d')]||0x96;this[_0x8c6e('0x3e')]=_0x4624a5['dialGlobalMaxRetry']||0x4;this[_0x8c6e('0x3f')]=_0x4624a5[_0x8c6e('0x3f')]?_0x4624a5[_0x8c6e('0x3f')]:undefined;this[_0x8c6e('0x40')]=_0x4624a5[_0x8c6e('0x40')]?_0x4624a5['TrunkBackup']:undefined;this[_0x8c6e('0x41')]=_0x4624a5[_0x8c6e('0x41')]||undefined;this[_0x8c6e('0x42')]=_0x4624a5[_0x8c6e('0x42')]?_0x4624a5[_0x8c6e('0x42')]:undefined;this[_0x8c6e('0x43')]=_0x4624a5[_0x8c6e('0x43')]||'DESC';this['dialRandomLastDigitCallerIdNumber']=_0x4624a5[_0x8c6e('0x44')]||undefined;this['dialCutDigit']=_0x4624a5[_0x8c6e('0x45')]||undefined;this[_0x8c6e('0x46')]=strategy[_0x4624a5[_0x8c6e('0x46')]]||_0x8c6e('0x47');this['queueStatusComplete']=!![];this[_0x8c6e('0x48')]=_0x4624a5[_0x8c6e('0x48')]||![];this['dialAMDInitialSilence']=_0x4624a5['dialAMDInitialSilence'];this[_0x8c6e('0x49')]=_0x4624a5['dialAMDGreeting'];this[_0x8c6e('0x4a')]=_0x4624a5['dialAMDAfterGreetingSilence'];this[_0x8c6e('0x4b')]=_0x4624a5[_0x8c6e('0x4b')];this['dialAMDMinWordLength']=_0x4624a5[_0x8c6e('0x4c')];this['dialAMDBetweenWordsSilence']=_0x4624a5[_0x8c6e('0x4d')];this[_0x8c6e('0x4e')]=_0x4624a5[_0x8c6e('0x4e')];this[_0x8c6e('0x4f')]=_0x4624a5['dialAMDSilenceThreshold'];this['dialAMDMaximumWordLength']=_0x4624a5[_0x8c6e('0x50')];this[_0x8c6e('0x51')]=0x0;this[_0x8c6e('0x52')]=0x0;this['timeout']=_0x4624a5[_0x8c6e('0x53')];this[_0x8c6e('0x54')]=0x0;this[_0x8c6e('0x55')]=0x0;this['outboundNoAnswerCallsDay']=0x0;this[_0x8c6e('0x56')]=0x0;this[_0x8c6e('0x57')]=0x0;this[_0x8c6e('0x58')]=0x0;this[_0x8c6e('0x59')]=0x0;this[_0x8c6e('0x5a')]=0x0;this[_0x8c6e('0x5b')]=0x0;this[_0x8c6e('0x5c')]=0x0;this['outboundDropCallsDayTimeout']=0x0;this[_0x8c6e('0x5d')]=0x0;this['outboundReCallsDay']=0x0;this[_0x8c6e('0x5e')]=0x0;this[_0x8c6e('0x5f')]=undefined;this[_0x8c6e('0x60')]=undefined;this[_0x8c6e('0x61')]=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this[_0x8c6e('0x62')]=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this[_0x8c6e('0x63')]=0x0;this[_0x8c6e('0x64')]=0x0;this[_0x8c6e('0x65')]=0x0;this[_0x8c6e('0x66')]=0x0;this[_0x8c6e('0x67')]=0x0;this['predictiveIntervalAvailable']=0x0;this[_0x8c6e('0x68')]=_0x4624a5['dialPredictiveIntervalMaxThreshold']||0x14;this[_0x8c6e('0x69')]=_0x4624a5[_0x8c6e('0x6a')]||0xa;this[_0x8c6e('0x6b')]=0x0;this[_0x8c6e('0x6c')]=0x0;this[_0x8c6e('0x6d')]=0x1;this[_0x8c6e('0x6e')]=0x0;this['erlangCallToSecond']=0x0;this[_0x8c6e('0x6f')]=0x0;this['erlangBusyFactor']=0x0;this['dialRecallMeTimeout']=_0x4624a5[_0x8c6e('0x70')]||0x1e;this[_0x8c6e('0x71')]=_0x4624a5[_0x8c6e('0x71')]||![];this[_0x8c6e('0x72')]=_0x4624a5[_0x8c6e('0x72')]||undefined;this['dialAgiAfterHangupClient']=_0x4624a5[_0x8c6e('0x73')]||![];this[_0x8c6e('0x74')]=_0x4624a5[_0x8c6e('0x74')]||![];this[_0x8c6e('0xb')]=monitorFormat[_0x4624a5['monitor_format']]?monitorFormat[_0x4624a5['monitor_format']]:undefined;this[_0x8c6e('0x75')]=_0x4624a5[_0x8c6e('0x75')]||![];this[_0x8c6e('0x76')]=_0x4624a5[_0x8c6e('0x76')]?_0x4624a5[_0x8c6e('0x76')]:undefined;}module[_0x8c6e('0x77')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index d65d582..eb06477 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 _0x1cc7=['name','username','accessKey','remoteUri','serverUrl','Configurations'];(function(_0x4ba534,_0x236e83){var _0x191c1b=function(_0x264958){while(--_0x264958){_0x4ba534['push'](_0x4ba534['shift']());}};_0x191c1b(++_0x236e83);}(_0x1cc7,0x12c));var _0x71cc=function(_0x3c8a4b,_0x732955){_0x3c8a4b=_0x3c8a4b-0x0;var _0x11ff97=_0x1cc7[_0x3c8a4b];return _0x11ff97;};'use strict';function VtigerAccount(_0x407af4){this['id']=_0x407af4['id']||0x0;this[_0x71cc('0x0')]=_0x407af4[_0x71cc('0x0')]||'';this[_0x71cc('0x1')]=_0x407af4[_0x71cc('0x1')]||'';this['accessKey']=_0x407af4[_0x71cc('0x2')]||'';this[_0x71cc('0x3')]=_0x407af4['remoteUri']||'';this[_0x71cc('0x4')]=_0x407af4['serverUrl']||'';this[_0x71cc('0x5')]=_0x407af4[_0x71cc('0x5')]||{};}module['exports']=VtigerAccount; \ No newline at end of file +var _0x6b33=['exports','name','username','accessKey','remoteUri','serverUrl','Configurations'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6b33,0x182));var _0x36b3=function(_0x35df7f,_0x3d985e){_0x35df7f=_0x35df7f-0x0;var _0x16a116=_0x6b33[_0x35df7f];return _0x16a116;};'use strict';function VtigerAccount(_0x53ea03){this['id']=_0x53ea03['id']||0x0;this[_0x36b3('0x0')]=_0x53ea03[_0x36b3('0x0')]||'';this[_0x36b3('0x1')]=_0x53ea03[_0x36b3('0x1')]||'';this['accessKey']=_0x53ea03[_0x36b3('0x2')]||'';this[_0x36b3('0x3')]=_0x53ea03[_0x36b3('0x3')]||'';this[_0x36b3('0x4')]=_0x53ea03[_0x36b3('0x4')]||'';this[_0x36b3('0x5')]=_0x53ea03[_0x36b3('0x5')]||{};}module[_0x36b3('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 acde24d..1d15d82 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 _0xa073=['type','serverUrl','Configurations','name','username','password','token','remoteUri','authType'];(function(_0xaac2fd,_0x5357a7){var _0x57c27a=function(_0x28293f){while(--_0x28293f){_0xaac2fd['push'](_0xaac2fd['shift']());}};_0x57c27a(++_0x5357a7);}(_0xa073,0x123));var _0x3a07=function(_0x1e9fb1,_0x33df1b){_0x1e9fb1=_0x1e9fb1-0x0;var _0x48fdde=_0xa073[_0x1e9fb1];return _0x48fdde;};'use strict';function ZendeskAccount(_0x508105){this['id']=_0x508105['id']||0x0;this[_0x3a07('0x0')]=_0x508105[_0x3a07('0x0')]||'';this[_0x3a07('0x1')]=_0x508105[_0x3a07('0x1')]||'';this[_0x3a07('0x2')]=_0x508105[_0x3a07('0x2')]||'';this[_0x3a07('0x3')]=_0x508105[_0x3a07('0x3')]||'';this[_0x3a07('0x4')]=_0x508105[_0x3a07('0x4')]||'';this[_0x3a07('0x5')]=_0x508105['authType']||'';this['type']=_0x508105[_0x3a07('0x6')]||'integrationTab';this[_0x3a07('0x7')]=_0x508105['serverUrl']||'';this['Configurations']=_0x508105[_0x3a07('0x8')]||{};}module['exports']=ZendeskAccount; \ No newline at end of file +var _0x05cb=['type','integrationTab','serverUrl','Configurations','exports','name','username','password','token','remoteUri','authType'];(function(_0x472d3d,_0x1996ad){var _0x30553b=function(_0x12f7b8){while(--_0x12f7b8){_0x472d3d['push'](_0x472d3d['shift']());}};_0x30553b(++_0x1996ad);}(_0x05cb,0x68));var _0xb05c=function(_0x6b8b28,_0x27c185){_0x6b8b28=_0x6b8b28-0x0;var _0x5141f4=_0x05cb[_0x6b8b28];return _0x5141f4;};'use strict';function ZendeskAccount(_0x756e9d){this['id']=_0x756e9d['id']||0x0;this[_0xb05c('0x0')]=_0x756e9d['name']||'';this[_0xb05c('0x1')]=_0x756e9d[_0xb05c('0x1')]||'';this[_0xb05c('0x2')]=_0x756e9d['password']||'';this[_0xb05c('0x3')]=_0x756e9d[_0xb05c('0x3')]||'';this[_0xb05c('0x4')]=_0x756e9d['remoteUri']||'';this[_0xb05c('0x5')]=_0x756e9d['authType']||'';this['type']=_0x756e9d[_0xb05c('0x6')]||_0xb05c('0x7');this[_0xb05c('0x8')]=_0x756e9d[_0xb05c('0x8')]||'';this[_0xb05c('0x9')]=_0x756e9d['Configurations']||{};}module[_0xb05c('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 6936631..cf63791 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 _0xa923=['refreshToken','Configurations','exports','name','description','host','zone','clientId','clientSecret','serverUrl','code'];(function(_0x131349,_0x27819a){var _0x576eaa=function(_0x31bd45){while(--_0x31bd45){_0x131349['push'](_0x131349['shift']());}};_0x576eaa(++_0x27819a);}(_0xa923,0x92));var _0x3a92=function(_0x195638,_0x2d3805){_0x195638=_0x195638-0x0;var _0x52b3f6=_0xa923[_0x195638];return _0x52b3f6;};'use strict';function ZohoAccount(_0x4719c7){this['id']=_0x4719c7['id']||0x0;this[_0x3a92('0x0')]=_0x4719c7[_0x3a92('0x0')]||'';this[_0x3a92('0x1')]=_0x4719c7[_0x3a92('0x1')]||'';this['host']=_0x4719c7[_0x3a92('0x2')]||'';this[_0x3a92('0x3')]=_0x4719c7[_0x3a92('0x3')]||'';this[_0x3a92('0x4')]=_0x4719c7[_0x3a92('0x4')]||'';this[_0x3a92('0x5')]=_0x4719c7[_0x3a92('0x5')]||'';this[_0x3a92('0x6')]=_0x4719c7[_0x3a92('0x6')]||'';this['code']=_0x4719c7[_0x3a92('0x7')]||'';this[_0x3a92('0x8')]=_0x4719c7[_0x3a92('0x8')]||'';this['Configurations']=_0x4719c7[_0x3a92('0x9')]||{};}module[_0x3a92('0xa')]=ZohoAccount; \ No newline at end of file +var _0x837d=['code','refreshToken','Configurations','exports','name','description','host','zone','clientId','clientSecret','serverUrl'];(function(_0x2c8141,_0x4e8cdc){var _0x3e11a3=function(_0x597abe){while(--_0x597abe){_0x2c8141['push'](_0x2c8141['shift']());}};_0x3e11a3(++_0x4e8cdc);}(_0x837d,0xa9));var _0xd837=function(_0x4f206,_0x1578d4){_0x4f206=_0x4f206-0x0;var _0xcf49bb=_0x837d[_0x4f206];return _0xcf49bb;};'use strict';function ZohoAccount(_0x21118e){this['id']=_0x21118e['id']||0x0;this[_0xd837('0x0')]=_0x21118e[_0xd837('0x0')]||'';this[_0xd837('0x1')]=_0x21118e[_0xd837('0x1')]||'';this[_0xd837('0x2')]=_0x21118e[_0xd837('0x2')]||'';this[_0xd837('0x3')]=_0x21118e[_0xd837('0x3')]||'';this['clientId']=_0x21118e[_0xd837('0x4')]||'';this[_0xd837('0x5')]=_0x21118e[_0xd837('0x5')]||'';this['serverUrl']=_0x21118e[_0xd837('0x6')]||'';this[_0xd837('0x7')]=_0x21118e['code']||'';this[_0xd837('0x8')]=_0x21118e[_0xd837('0x8')]||'';this[_0xd837('0x9')]=_0x21118e[_0xd837('0x9')]||{};}module[_0xd837('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 c19dc92..3ec98d4 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 _0xd085=['format','SIP/%s','calleridname','phone','Contact','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','number','exports','lodash','moment','isNil','string','idContact','queue','type','campaigntype','dialAnswer','membername','Agent','name','channelAgent'];(function(_0x218972,_0x1f9794){var _0x1bb1a8=function(_0x3fb962){while(--_0x3fb962){_0x218972['push'](_0x218972['shift']());}};_0x1bb1a8(++_0x1f9794);}(_0xd085,0x12e));var _0x5d08=function(_0xca1f0e,_0x2713d5){_0xca1f0e=_0xca1f0e-0x0;var _0x35e4ef=_0xd085[_0xca1f0e];return _0x35e4ef;};'use strict';var util=require('util');var _=require(_0x5d08('0x0'));var moment=require(_0x5d08('0x1'));function checkNameSurname(_0x2292eb,_0x1991db,_0x27c950){var _0x4a1a52='';if(!_[_0x5d08('0x2')](_0x1991db)&&_0x5d08('0x3')===typeof _0x1991db){_0x4a1a52+=_0x1991db;}if(!_[_0x5d08('0x2')](_0x27c950)&&'string'===typeof _0x27c950){_0x4a1a52+='\x20'+_0x27c950;}if(_0x4a1a52!==''){return _0x4a1a52;}return _0x2292eb;}function Action(_0x9739e,_0x4fe78b,_0x5ab935,_0x25f0f7,_0x3b7b96){this['uniqueid']=_0x5ab935||undefined;this[_0x5d08('0x4')]=_0x9739e['id'];this[_0x5d08('0x5')]=_0x4fe78b['name'];this['type']=_0x4fe78b[_0x5d08('0x6')];this[_0x5d08('0x7')]=_0x5d08('0x5');this[_0x5d08('0x8')]=![];this[_0x5d08('0x9')]=_[_0x5d08('0x2')](_0x9739e[_0x5d08('0xa')])?undefined:_0x9739e[_0x5d08('0xa')][_0x5d08('0xb')];this[_0x5d08('0xc')]=this[_0x5d08('0x9')]?util[_0x5d08('0xd')](_0x5d08('0xe'),this[_0x5d08('0x9')]):_0x25f0f7||undefined;this[_0x5d08('0xf')]=checkNameSurname(_0x9739e['Contact'][_0x5d08('0x10')],_0x9739e[_0x5d08('0x11')]['firstName'],_0x9739e['Contact']['lastName']);this[_0x5d08('0x12')]=_0x9739e[_0x5d08('0x12')]||![];this[_0x5d08('0x13')]=_0x9739e['Contact']['phone'];this[_0x5d08('0x14')]=_0x9739e['scheduledat'];this[_0x5d08('0x15')]=_0x9739e['countbusyretry']||0x0;this['countcongestionretry']=_0x9739e[_0x5d08('0x16')]||0x0;this[_0x5d08('0x17')]=_0x9739e['countnoanswerretry']||0x0;this[_0x5d08('0x18')]=(_0x9739e['countbusyretry']||0x0)+(_0x9739e['countcongestionretry']||0x0)+(_0x9739e['countnoanswerretry']||0x0)+(_0x9739e[_0x5d08('0x19')]||0x0)+(_0x9739e[_0x5d08('0x1a')]||0x0)+(_0x9739e[_0x5d08('0x1b')]||0x0)+(_0x9739e[_0x5d08('0x1c')]||0x0)+(_0x9739e[_0x5d08('0x1d')]||0x0);this['countnosuchnumberretry']=_0x9739e[_0x5d08('0x19')]||0x0;this[_0x5d08('0x1a')]=_0x9739e[_0x5d08('0x1a')]||0x0;this['countabandonedretry']=_0x9739e['countabandonedretry']||0x0;this[_0x5d08('0x1c')]=_0x9739e[_0x5d08('0x1c')]||0x0;this[_0x5d08('0x1d')]=_0x9739e['countagentrejectretry']||0x0;this[_0x5d08('0x1e')]=_0x9739e[_0x5d08('0x1e')];this[_0x5d08('0x1f')]=_0x9739e[_0x5d08('0x1f')];this['callbackat']=_0x9739e[_0x5d08('0x20')];this['recallme']=_0x9739e[_0x5d08('0x21')];this[_0x5d08('0x22')]=_0x9739e[_0x5d08('0x22')];this[_0x5d08('0x23')]=_0x9739e[_0x5d08('0x23')];this[_0x5d08('0x24')]=_[_0x5d08('0x2')](_0x9739e[_0x5d08('0xa')])?_0x9739e['UserId']:_0x9739e[_0x5d08('0xa')]['id'];this[_0x5d08('0x25')]=_0x9739e[_0x5d08('0x25')];this[_0x5d08('0x26')]='';this[_0x5d08('0x27')]='';}Action[_0x5d08('0x28')][_0x5d08('0x29')]=function(){return util['format'](_0x5d08('0x2a'),this['calleridname'],this[_0x5d08('0x2b')]);};module[_0x5d08('0x2c')]=Action; \ No newline at end of file +var _0x2454=['Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','callback','callbackat','recallme','ListId','UserId','VoiceQueueId','originatecalleridnum','prototype','getCaller','\x22%s\x22\x20<%s>','number','exports','util','lodash','moment','isNil','string','idContact','name','type','campaigntype','queue','dialAnswer','membername','Agent','channelAgent','format','SIP/%s','calleridname'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x2454,0xcb));var _0x4245=function(_0x4ac1a1,_0x1b823c){_0x4ac1a1=_0x4ac1a1-0x0;var _0x357b76=_0x2454[_0x4ac1a1];return _0x357b76;};'use strict';var util=require(_0x4245('0x0'));var _=require(_0x4245('0x1'));var moment=require(_0x4245('0x2'));function checkNameSurname(_0xc7794a,_0x52d4d9,_0x5e7859){var _0x51eed8='';if(!_[_0x4245('0x3')](_0x52d4d9)&&_0x4245('0x4')===typeof _0x52d4d9){_0x51eed8+=_0x52d4d9;}if(!_['isNil'](_0x5e7859)&&'string'===typeof _0x5e7859){_0x51eed8+='\x20'+_0x5e7859;}if(_0x51eed8!==''){return _0x51eed8;}return _0xc7794a;}function Action(_0x4a81ec,_0x9a3995,_0x4baa7d,_0x44a6ed,_0x35b823){this['uniqueid']=_0x4baa7d||undefined;this[_0x4245('0x5')]=_0x4a81ec['id'];this['queue']=_0x9a3995[_0x4245('0x6')];this[_0x4245('0x7')]=_0x9a3995[_0x4245('0x7')];this[_0x4245('0x8')]=_0x4245('0x9');this[_0x4245('0xa')]=![];this[_0x4245('0xb')]=_[_0x4245('0x3')](_0x4a81ec['Agent'])?undefined:_0x4a81ec[_0x4245('0xc')][_0x4245('0x6')];this[_0x4245('0xd')]=this[_0x4245('0xb')]?util[_0x4245('0xe')](_0x4245('0xf'),this['membername']):_0x44a6ed||undefined;this[_0x4245('0x10')]=checkNameSurname(_0x4a81ec[_0x4245('0x11')][_0x4245('0x12')],_0x4a81ec[_0x4245('0x11')][_0x4245('0x13')],_0x4a81ec['Contact'][_0x4245('0x14')]);this[_0x4245('0x15')]=_0x4a81ec['active']||![];this[_0x4245('0x16')]=_0x4a81ec[_0x4245('0x11')][_0x4245('0x12')];this[_0x4245('0x17')]=_0x4a81ec[_0x4245('0x17')];this['countbusyretry']=_0x4a81ec[_0x4245('0x18')]||0x0;this[_0x4245('0x19')]=_0x4a81ec[_0x4245('0x19')]||0x0;this[_0x4245('0x1a')]=_0x4a81ec['countnoanswerretry']||0x0;this['countglobal']=(_0x4a81ec[_0x4245('0x18')]||0x0)+(_0x4a81ec[_0x4245('0x19')]||0x0)+(_0x4a81ec[_0x4245('0x1a')]||0x0)+(_0x4a81ec[_0x4245('0x1b')]||0x0)+(_0x4a81ec[_0x4245('0x1c')]||0x0)+(_0x4a81ec[_0x4245('0x1d')]||0x0)+(_0x4a81ec['countmachineretry']||0x0)+(_0x4a81ec[_0x4245('0x1e')]||0x0);this[_0x4245('0x1b')]=_0x4a81ec[_0x4245('0x1b')]||0x0;this[_0x4245('0x1c')]=_0x4a81ec[_0x4245('0x1c')]||0x0;this[_0x4245('0x1d')]=_0x4a81ec[_0x4245('0x1d')]||0x0;this['countmachineretry']=_0x4a81ec[_0x4245('0x1f')]||0x0;this['countagentrejectretry']=_0x4a81ec[_0x4245('0x1e')]||0x0;this['callback']=_0x4a81ec[_0x4245('0x20')];this['callbackuniqueid']=_0x4a81ec['callbackuniqueid'];this[_0x4245('0x21')]=_0x4a81ec[_0x4245('0x21')];this['recallme']=_0x4a81ec[_0x4245('0x22')];this['ContactId']=_0x4a81ec['ContactId'];this[_0x4245('0x23')]=_0x4a81ec[_0x4245('0x23')];this[_0x4245('0x24')]=_[_0x4245('0x3')](_0x4a81ec[_0x4245('0xc')])?_0x4a81ec[_0x4245('0x24')]:_0x4a81ec[_0x4245('0xc')]['id'];this[_0x4245('0x25')]=_0x4a81ec[_0x4245('0x25')];this[_0x4245('0x26')]='';this['originatecalleridname']='';}Action[_0x4245('0x27')][_0x4245('0x28')]=function(){return util[_0x4245('0xe')](_0x4245('0x29'),this[_0x4245('0x10')],this[_0x4245('0x2a')]);};module[_0x4245('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 063ab3b..2bf7f62 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 _0xd127=['countagentrejectretry','AgentReject','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','dialAgentRejectRetryFrequency','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','dialAbandonedRetryFrequency','cause-txt','dialstatus','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','amd','[callProgressDetectingCustomer][machine]','[default]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','originated:\x20','destlinkedid','isUndefined','object','reason','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','logAgent','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','Contact','phone','VoiceQueueId','Contact\x20is\x20undefined','[Preview][execCall][success]','Queue:\x20','idContact','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','createHistory','[Blacklist][error]','SIP/%s','reachable','unmonitored','run','execRun','unlock','unlockContact','getContactPreview','recallme','validateContact','checkIsBlackList','Contact.phone','checkInBlack','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','isEmpty','[Preview][validateContact][Empty\x20Contact]','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','Trunk\x20not\x20work','\x20Not\x20Active','Is\x20Valid','dialPrefix','dialCutDigit','substring','SIP/%s/%s%s','TrunkBackup','getCallerId','callerid','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','extractCalleridName','extractCalleridNumber','addVariables','merge','toLowerVariables','channelAgent','calleridnum','user:%s','user:agentconnect','accountcode','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','lookAgent','clone','isFailure','custom:agentringnoanswer','rejected','[callProgressDetectingAgent][logAnswer]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','variables','filterKey','keys','variable','addVariable','value','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','bluebird','ioredis','../../../config/environment','preview','../../../config/logger','actionPreview','./rpcDb','./action','defaults','redis','localhost','socket.io-emitter','enqueue','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','agents','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','dialend','syncDialEnd','newexten','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','type','outbound','strategy','answered','available','pTalking','sumBillable','sumDuration','sumHoldTime','total','unmanaged','abandoned','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','name','active','Interval','md5','format','voice:queue:%s','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','paused','message','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','\x20is\x20disactive','prototype','clockClearZombieChannels','hasOwnProperty','booked','clearZombieChannels','recallMe','isNil','Queue','actions','queue','stringify','pTalking:\x20','pick','ListId','Action','status','channel','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','dialAnswer','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','size','clearZombieChannel','getContactRecallMe','agentReadyId','then','length','getDiff','Agent','voicePause','logger2','[RecallMe]','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','[HistoryDialRecallInQueue][historyCatch]','[HistoryRecallClose]','createCustomerFinal','catch','setMessage','IsNotLoggedIn','loggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','dialNoSuchNumberRetryFrequency','activeContact','linkedid','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','custom:agentconnect','connect','acw','custom:agentConnectPreview','custom:agentcomplete','complete','outboundAnswerCallsDay','[16]','Answer','createCustomerHistory','[callProgressDetectingCustomer][logAnswer]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','\x20Queue','BUSY','countbusyretry','Busy','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','cloneAction','[callProgressDetectingCustomer][logBusyGlobal]','scheduledAt','unlockAgent','NOANSWER','outboundNoAnswerCallsDay','countnoanswerretry','NoAnswer','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','CONGESTION','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialBusyRetryFrequency','CANCEL'];(function(_0x5641d9,_0x1de53b){var _0x1b1f89=function(_0x27b5b3){while(--_0x27b5b3){_0x5641d9['push'](_0x5641d9['shift']());}};_0x1b1f89(++_0x1de53b);}(_0xd127,0x79));var _0x7d12=function(_0x2e1ef2,_0xcc4033){_0x2e1ef2=_0x2e1ef2-0x0;var _0x1aa955=_0xd127[_0x2e1ef2];return _0x1aa955;};'use strict';var util=require(_0x7d12('0x0'));var _=require('lodash');var BPromise=require(_0x7d12('0x1'));var uuid=require('uuid');var moment=require('moment');var md5=require('md5');var Redis=require(_0x7d12('0x2'));var config=require(_0x7d12('0x3'));var logger=require('../../../config/logger')(_0x7d12('0x4'));var loggerAction=require(_0x7d12('0x5'))(_0x7d12('0x6'));var ami=require('../ami');var rpcDb=require(_0x7d12('0x7'));var Action=require(_0x7d12('0x8'));var ut=require('./util/util');config['redis']=_[_0x7d12('0x9')](config[_0x7d12('0xa')],{'host':_0x7d12('0xb'),'port':0x18eb});var io=require(_0x7d12('0xc'))(new Redis(config[_0x7d12('0xa')]));var Sequence=function(){};Sequence['prototype'][_0x7d12('0xd')]=function(_0x448e4e){this[_0x7d12('0xe')]=this['tail']?this[_0x7d12('0xe')][_0x7d12('0xf')](_0x448e4e):_0x448e4e();};function Preview(_0x4102df){this[_0x7d12('0x10')]=new Sequence();this[_0x7d12('0x11')]=_0x4102df[_0x7d12('0x12')];this['trunks']=_0x4102df[_0x7d12('0x13')];this['actions']={};this[_0x7d12('0x14')]=_0x4102df[_0x7d12('0x14')];this['clockClearZombieChannels']=0x0;ami['on'](_0x7d12('0x15'),this[_0x7d12('0x16')][_0x7d12('0x17')](this));ami['on'](_0x7d12('0x18'),this[_0x7d12('0x19')][_0x7d12('0x17')](this));ami['on'](_0x7d12('0x1a'),this['syncHangupRequest']['bind'](this));ami['on'](_0x7d12('0x1b'),this[_0x7d12('0x1c')][_0x7d12('0x17')](this));ami['on'](_0x7d12('0x1d'),this[_0x7d12('0x1e')]['bind'](this));ami['on'](_0x7d12('0x1f'),this[_0x7d12('0x20')]['bind'](this));ami['on'](_0x7d12('0x21'),this[_0x7d12('0x22')][_0x7d12('0x17')](this));ami['on'](_0x7d12('0x23'),this[_0x7d12('0x24')][_0x7d12('0x17')](this));this[_0x7d12('0x25')](this[_0x7d12('0x11')]);}function emit(_0x19e67e,_0x101b73,_0x11d6bb){io['to'](_0x19e67e)[_0x7d12('0x26')](_0x101b73,_0x11d6bb);}function emitCampaignPreview(_0x3dbbe6){if(_0x3dbbe6[_0x7d12('0x27')]===_0x7d12('0x28')){var _0x587f36={'id':_0x3dbbe6['id'],'name':_0x3dbbe6['name'],'strategy':_0x3dbbe6[_0x7d12('0x29')],'answered':_0x3dbbe6[_0x7d12('0x2a')],'available':_0x3dbbe6[_0x7d12('0x2b')],'loggedIn':_0x3dbbe6['loggedIn'],'pTalking':_0x3dbbe6[_0x7d12('0x2c')],'sumBillable':_0x3dbbe6[_0x7d12('0x2d')],'sumDuration':_0x3dbbe6[_0x7d12('0x2e')],'sumHoldTime':_0x3dbbe6[_0x7d12('0x2f')]||0x0,'talking':_0x3dbbe6['talking'],'total':_0x3dbbe6[_0x7d12('0x30')],'type':_0x3dbbe6['type'],'unmanaged':_0x3dbbe6[_0x7d12('0x31')],'abandoned':_0x3dbbe6[_0x7d12('0x32')],'waiting':_0x3dbbe6['waiting'],'loggedInDb':_0x3dbbe6['loggedInDb'],'dialActive':_0x3dbbe6[_0x7d12('0x33')],'dialMethod':_0x3dbbe6[_0x7d12('0x34')],'dialOriginateCallerIdName':_0x3dbbe6[_0x7d12('0x35')],'dialOriginateCallerIdNumber':_0x3dbbe6[_0x7d12('0x36')],'dialOriginateTimeout':_0x3dbbe6['dialOriginateTimeout'],'dialPrefix':_0x3dbbe6['dialPrefix'],'outboundAnswerAgiCallsDay':_0x3dbbe6[_0x7d12('0x37')],'outboundAnswerCallsDay':_0x3dbbe6['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x3dbbe6[_0x7d12('0x38')],'outboundBusyCallsDay':_0x3dbbe6[_0x7d12('0x39')],'outboundCongestionCallsDay':_0x3dbbe6['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x3dbbe6[_0x7d12('0x3a')],'outboundDropCallsDayCallersExit':_0x3dbbe6[_0x7d12('0x3b')],'outboundDropCallsDayTimeout':_0x3dbbe6[_0x7d12('0x3c')],'outboundNoAnswerCallsDay':_0x3dbbe6['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x3dbbe6[_0x7d12('0x3d')],'outboundOriginateFailureCallsDay':_0x3dbbe6['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x3dbbe6['outboundReCallsDay'],'outboundRejectCallsDay':_0x3dbbe6[_0x7d12('0x3e')],'outboundUnknownCallsDay':_0x3dbbe6[_0x7d12('0x3f')],'outboundAbandonedCallsDay':_0x3dbbe6[_0x7d12('0x40')],'predictiveIntervalAnsweredCalls':_0x3dbbe6['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x3dbbe6[_0x7d12('0x41')],'predictiveIntervalAvgTalktime':_0x3dbbe6[_0x7d12('0x42')],'predictiveIntervalDroppedCallsCallersExit':_0x3dbbe6[_0x7d12('0x43')],'predictiveIntervalDroppedCallsTimeout':_0x3dbbe6['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x3dbbe6[_0x7d12('0x44')],'predictiveIntervalErlangCallsDroppedCalls':_0x3dbbe6[_0x7d12('0x45')],'predictiveIntervalHitRate':_0x3dbbe6[_0x7d12('0x46')],'predictiveIntervalMultiplicativeFactor':_0x3dbbe6[_0x7d12('0x47')],'predictiveIntervalPauses':_0x3dbbe6[_0x7d12('0x48')],'predictiveIntervalAvailable':_0x3dbbe6[_0x7d12('0x49')],'predictiveIntervalTotalCalls':_0x3dbbe6['predictiveIntervalTotalCalls'],'message':_0x3dbbe6['message'],'originated':_0x3dbbe6[_0x7d12('0x4a')],'erlangCalls':_0x3dbbe6[_0x7d12('0x4b')],'erlangCallToSecond':_0x3dbbe6[_0x7d12('0x4c')],'erlangAbandonmentRate':_0x3dbbe6[_0x7d12('0x4d')],'erlangBusyFactor':_0x3dbbe6[_0x7d12('0x4e')],'startPredictive':_0x3dbbe6[_0x7d12('0x4f')],'startProgressive':_0x3dbbe6[_0x7d12('0x50')]};if(_0x3dbbe6[_0x7d12('0x51')]){_0x587f36['Trunk']={'id':_0x3dbbe6['Trunk']['id'],'name':_0x3dbbe6[_0x7d12('0x51')][_0x7d12('0x52')],'active':_0x3dbbe6[_0x7d12('0x51')][_0x7d12('0x53')],'callerid':_0x3dbbe6[_0x7d12('0x51')]['callerid']};}if(_0x3dbbe6[_0x7d12('0x54')]){_0x587f36[_0x7d12('0x54')]={'id':_0x3dbbe6['Interval']['id'],'name':_0x3dbbe6[_0x7d12('0x54')][_0x7d12('0x52')]};}var _0x3620da=md5(JSON['stringify'](_0x587f36));if(_0x3dbbe6['md5']!==_0x3620da){_0x3dbbe6[_0x7d12('0x55')]=_0x3620da;emit(util[_0x7d12('0x56')](_0x7d12('0x57'),_0x587f36['name']),_0x7d12('0x58'),_0x587f36);}}}function emitVoiceQueueChannelRemove(_0x1538ee){logger[_0x7d12('0x59')](_0x7d12('0x5a'),JSON['stringify'](_0x1538ee));emit(util[_0x7d12('0x56')](_0x7d12('0x57'),_0x1538ee[_0x7d12('0x52')]),_0x7d12('0x5b'),_0x1538ee);io['emit'](_0x7d12('0x5c'),_0x1538ee);}function notSendMessagesQueue(_0xd40b18){if(_0xd40b18[_0x7d12('0x5d')]){if(_0xd40b18[_0x7d12('0x4a')]===0x0&&_0xd40b18[_0x7d12('0x2c')]===0x0){_0xd40b18[_0x7d12('0x5d')]=![];_0xd40b18[_0x7d12('0x2b')]=0x0;_0xd40b18[_0x7d12('0x5e')]=0x0;_0xd40b18[_0x7d12('0x5f')]='NOT_ACTIVE';ut[_0x7d12('0x60')](_0x7d12('0x61'),_0xd40b18[_0x7d12('0x52')]+_0x7d12('0x62'));}else{_0xd40b18[_0x7d12('0x5f')]='IS_DISACTIVED';ut[_0x7d12('0x60')](_0x7d12('0x61'),_0xd40b18[_0x7d12('0x52')]+_0x7d12('0x63'));}emitCampaignPreview(_0xd40b18);}}Preview[_0x7d12('0x64')][_0x7d12('0x25')]=function(){var _0x57abb0=this;setInterval(function(){_0x57abb0['syncCampaigns']();},0x7cf);};Preview[_0x7d12('0x64')]['syncCampaigns']=function(){var _0x4f2493=this[_0x7d12('0x11')];this[_0x7d12('0x65')]+=0x1;for(var _0x2bd480 in _0x4f2493){if(_0x4f2493[_0x7d12('0x66')](_0x2bd480)&&(_0x4f2493[_0x2bd480]['dialMethod']===_0x7d12('0x4')||_0x4f2493[_0x2bd480][_0x7d12('0x34')]===_0x7d12('0x67'))&&_0x4f2493[_0x2bd480][_0x7d12('0x27')]==='outbound'){if(this[_0x7d12('0x65')]>0x7){this[_0x7d12('0x65')]=0x0;this[_0x7d12('0x68')]();}}if(_0x4f2493['hasOwnProperty'](_0x2bd480)&&_0x4f2493[_0x2bd480]['dialMethod']===_0x7d12('0x4')&&_0x4f2493[_0x2bd480][_0x7d12('0x27')]==='outbound'){if(_0x4f2493[_0x2bd480]['dialActive']){this['setMessage'](_0x4f2493[_0x2bd480]);this[_0x7d12('0x69')](_0x4f2493[_0x2bd480]);}else{notSendMessagesQueue(_0x4f2493[_0x2bd480]);}}}};Preview[_0x7d12('0x64')]['clearZombieChannel']=function(_0x20c800){var _0x23a9a0=this;this[_0x7d12('0x10')][_0x7d12('0xd')](function(){if(!_[_0x7d12('0x6a')](_0x23a9a0['actions'][_0x20c800])){loggerAction['info']('[clearZombieChannels][talking]',_0x20c800,_0x7d12('0x6b'),_0x23a9a0[_0x7d12('0x6c')][_0x20c800][_0x7d12('0x6d')],'originated:\x20',JSON[_0x7d12('0x6e')](_0x23a9a0[_0x7d12('0x11')][_0x23a9a0['actions'][_0x20c800][_0x7d12('0x6d')]][_0x7d12('0x4a')]),_0x7d12('0x6f'),JSON[_0x7d12('0x6e')](_0x23a9a0[_0x7d12('0x11')][_0x23a9a0[_0x7d12('0x6c')][_0x20c800][_0x7d12('0x6d')]][_0x7d12('0x2c')]),JSON[_0x7d12('0x6e')](_0x23a9a0[_0x7d12('0x6c')][_0x20c800]['dialAnswer']),JSON[_0x7d12('0x6e')](_[_0x7d12('0x70')](_0x23a9a0[_0x7d12('0x6c')][_0x20c800],['contactId','UserId','VoiceQueueId',_0x7d12('0x71')])));return ami[_0x7d12('0x72')]({'action':_0x7d12('0x73'),'channel':_0x23a9a0[_0x7d12('0x6c')][_0x20c800][_0x7d12('0x74')]})['catch'](function(_0x4a5c76){if(_0x4a5c76[_0x7d12('0x5f')]===_0x7d12('0x75')){setTimeout(function(){if(_0x23a9a0[_0x7d12('0x6c')][_0x20c800]){ut[_0x7d12('0x76')](_0x23a9a0[_0x7d12('0x11')][_0x23a9a0[_0x7d12('0x6c')][_0x20c800]['queue']],_0x7d12('0x77'));if(_0x23a9a0[_0x7d12('0x6c')][_0x20c800][_0x7d12('0x78')]===!![]){ut[_0x7d12('0x79')](_0x23a9a0[_0x7d12('0x11')][_0x23a9a0['actions'][_0x20c800][_0x7d12('0x6d')]],_0x7d12('0x77'));ut[_0x7d12('0x7a')](_0x7d12('0x7b')+_0x20c800,_0x23a9a0['actions'][_0x20c800]['queue']);}ut[_0x7d12('0x7a')](_0x7d12('0x7c')+_0x20c800,_0x23a9a0[_0x7d12('0x6c')][_0x20c800][_0x7d12('0x6d')]);delete _0x23a9a0['actions'][_0x20c800];}},0x2328);}});}});};Preview[_0x7d12('0x64')]['clearZombieChannels']=function(){var _0x403802=this;loggerAction[_0x7d12('0x59')](_0x7d12('0x7d'),_[_0x7d12('0x7e')](this[_0x7d12('0x6c')]));for(var _0x15f39c in this[_0x7d12('0x6c')]){if(_0x403802['actions']['hasOwnProperty'](_0x15f39c)){_0x403802[_0x7d12('0x7f')](_0x15f39c);}}};Preview[_0x7d12('0x64')][_0x7d12('0x69')]=function(_0x259a02){var _0x307e09=this;rpcDb[_0x7d12('0x80')](_0x259a02['id'],ut[_0x7d12('0x81')](this[_0x7d12('0x14')]))[_0x7d12('0x82')](function(_0x24b7d3){if(!_['isNil'](_0x24b7d3)){for(var _0x4722fc=0x0;_0x4722fc<_0x24b7d3[_0x7d12('0x83')];_0x4722fc+=0x1){if(ut[_0x7d12('0x84')](_0x24b7d3[_0x4722fc]['scheduledat'])<_0x259a02['dialRecallMeTimeout']*0x3c){if(_0x24b7d3[_0x4722fc]['Agent']&&!_0x24b7d3[_0x4722fc][_0x7d12('0x85')][_0x7d12('0x86')]){_0x307e09['run'](_0x24b7d3[_0x4722fc]['id'])['then'](ut['logger2']('[RecallMe]'))['catch'](ut[_0x7d12('0x87')](_0x7d12('0x88')));}else{rpcDb[_0x7d12('0x89')](_0x24b7d3[_0x4722fc]['id']);}}else{var _0x155357=new Action(_0x24b7d3[_0x4722fc],_0x259a02);_0x155357[_0x7d12('0x8a')]=moment()['format'](_0x7d12('0x8b'));_0x259a02[_0x7d12('0x8c')]+=0x1;ut[_0x7d12('0x8d')](_0x155357,0x17,_0x7d12('0x8e'));if(_0x259a02[_0x7d12('0x8f')]){rpcDb[_0x7d12('0x90')](ut[_0x7d12('0x91')](_0x24b7d3[_0x4722fc]));rpcDb['createCustomerHistory'](_0x155357,_0x7d12('0x92'));}else{ut[_0x7d12('0x8d')](_0x155357,0x16,'RecallFailedTimeout');rpcDb['createCustomerHistory'](_0x155357,_0x7d12('0x93'));rpcDb[_0x7d12('0x94')](_0x155357,_0x7d12('0x93'));}}}}})[_0x7d12('0x95')](ut[_0x7d12('0x87')]('[getContactRecallMe]'));};Preview[_0x7d12('0x64')][_0x7d12('0x96')]=function(_0x4a4f50){_0x4a4f50[_0x7d12('0x5d')]=!![];if(ut[_0x7d12('0x97')](_0x4a4f50[_0x7d12('0x98')])){_0x4a4f50[_0x7d12('0x5f')]=_0x7d12('0x99');}else if(!ut[_0x7d12('0x9a')](_0x4a4f50['dialActive'])){_0x4a4f50[_0x7d12('0x5f')]='NOT_ACTIVE';}else if(!this[_0x7d12('0x9b')](_0x4a4f50[_0x7d12('0x51')])){if(!this[_0x7d12('0x9b')](_0x4a4f50['TrunkBackup'])){_0x4a4f50['message']='TRUNK_IS_NOT_REACHABLE';}else{_0x4a4f50['message']=_0x7d12('0x9c');}}else{_0x4a4f50[_0x7d12('0x5f')]='ACTIVE';}emitCampaignPreview(_0x4a4f50);};Preview['prototype'][_0x7d12('0x9d')]=function(_0xd99493,_0x1127a7,_0x19316c){var _0x5c7156=this;var _0x3dc7f8=this[_0x7d12('0x6c')][_0x1127a7];var _0x4459c4=this[_0x7d12('0x11')][_0x3dc7f8['queue']];var _0x34c339;if(_0x4459c4){switch(_0x19316c){case'1':_0x4459c4[_0x7d12('0x3d')]+=0x1;_0x3dc7f8[_0x7d12('0x9e')]+=0x1;_0x3dc7f8[_0x7d12('0x9f')]=ut[_0x7d12('0xa0')](_0x3dc7f8);ut[_0x7d12('0x8d')](_0x3dc7f8,0x0,_0x7d12('0xa1'));ami[_0x7d12('0x26')](_0x7d12('0xa2'),ut[_0x7d12('0xa3')](_0x3dc7f8,_0x7d12('0xa4')));rpcDb['createCustomerHistory'](_0x3dc7f8,_0x7d12('0xa5'));if(ut[_0x7d12('0xa0')](_0x3dc7f8)>=_0x4459c4[_0x7d12('0xa6')]){_0x34c339=ut['cloneAction'](_0x3dc7f8,0xf,_0x7d12('0xa7'));rpcDb['createCustomerFinal'](_0x34c339,_0x7d12('0xa8'));}else{if(_0x3dc7f8[_0x7d12('0x9e')]>=_0x4459c4[_0x7d12('0xa9')]){rpcDb[_0x7d12('0x94')](_0x3dc7f8,_0x7d12('0xa8'));}else{rpcDb[_0x7d12('0xaa')](ut['scheduledAt'](_0x3dc7f8,'countnosuchnumberretry',_0x4459c4[_0x7d12('0xab')]),_0x3dc7f8['unlockAgent'],_0x3dc7f8[_0x7d12('0xac')]);}}delete this[_0x7d12('0x6c')][_0xd99493[_0x7d12('0xad')]];break;case'ANSWER':var _0x2801ef=moment()[_0x7d12('0x56')](_0x7d12('0x8b'));_0x3dc7f8[_0x7d12('0xae')]=_0x2801ef;_0x3dc7f8[_0x7d12('0xaf')]=_0x2801ef;_0x3dc7f8[_0x7d12('0x78')]=!![];_0x4459c4[_0x7d12('0x2c')]+=0x1;logger['info'](_0x7d12('0xb0'),_0x3dc7f8[_0x7d12('0xb1')],'\x20Queue',_0x4459c4[_0x7d12('0x52')],_0x7d12('0x6f'),_0x4459c4[_0x7d12('0x2c')]);ami[_0x7d12('0x26')](_0x7d12('0xb2'),ut['buildObj'](_0x3dc7f8,_0x7d12('0xb3'),this[_0x7d12('0x11')][_0x3dc7f8[_0x7d12('0x6d')]]));if(_0x4459c4[_0x7d12('0xb4')]){ami[_0x7d12('0x26')](_0x7d12('0xb5'),ut['buildAcw'](_0x3dc7f8));}break;case'16':ami[_0x7d12('0x26')](_0x7d12('0xb6'),ut[_0x7d12('0xa3')](_0x3dc7f8,'complete',this[_0x7d12('0x11')][_0x3dc7f8['queue']]));emitVoiceQueueChannelRemove(ut[_0x7d12('0xa3')](_0x3dc7f8,_0x7d12('0xb7')));_0x4459c4[_0x7d12('0xb8')]+=0x1;_0x4459c4[_0x7d12('0x30')]+=0x1;_0x4459c4[_0x7d12('0x2a')]+=0x1;ut[_0x7d12('0x79')](_0x4459c4,_0x7d12('0xb9'));_0x3dc7f8[_0x7d12('0x9f')]=ut[_0x7d12('0xa0')](_0x3dc7f8);ut[_0x7d12('0x8d')](_0x3dc7f8,0x4,_0x7d12('0xba'));rpcDb[_0x7d12('0xbb')](_0x3dc7f8,_0x7d12('0xbc'));rpcDb['createCustomerFinal'](_0x3dc7f8,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb[_0x7d12('0xbd')](_0x3dc7f8);_0x4459c4['sumDuration']+=_0x3dc7f8[_0x7d12('0xbe')];_0x4459c4[_0x7d12('0x2d')]+=_0x3dc7f8[_0x7d12('0xbe')];logger[_0x7d12('0x59')](_0x7d12('0xbf'),_0x3dc7f8['uniqueid'],_0x7d12('0xc0'),_0x4459c4['name'],_0x7d12('0x6f'),_0x4459c4[_0x7d12('0x2c')]);delete this[_0x7d12('0x6c')][_0xd99493[_0x7d12('0xad')]];break;case _0x7d12('0xc1'):_0x4459c4[_0x7d12('0x39')]+=0x1;_0x3dc7f8[_0x7d12('0xc2')]+=0x1;_0x3dc7f8[_0x7d12('0x9f')]=ut[_0x7d12('0xa0')](_0x3dc7f8);ut[_0x7d12('0x8d')](_0x3dc7f8,0x5,_0x7d12('0xc3'));ami['emit'](_0x7d12('0xc4'),ut[_0x7d12('0xa3')](_0x3dc7f8,_0x7d12('0xc5')));rpcDb[_0x7d12('0xbb')](_0x3dc7f8,_0x7d12('0xc6'));if(ut[_0x7d12('0xa0')](_0x3dc7f8)>=_0x4459c4['dialGlobalMaxRetry']){_0x34c339=ut[_0x7d12('0xc7')](_0x3dc7f8,0xf,'Global');rpcDb[_0x7d12('0x94')](_0x34c339,_0x7d12('0xc8'));}else{if(_0x3dc7f8[_0x7d12('0xc2')]>=_0x4459c4['dialBusyMaxRetry']){rpcDb['createCustomerFinal'](_0x3dc7f8,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0x7d12('0xaa')](ut[_0x7d12('0xc9')](_0x3dc7f8,_0x7d12('0xc2'),_0x4459c4['dialBusyRetryFrequency']),_0x3dc7f8[_0x7d12('0xca')],_0x3dc7f8['activeContact']);}}break;case _0x7d12('0xcb'):_0x4459c4[_0x7d12('0xcc')]+=0x1;_0x3dc7f8[_0x7d12('0xcd')]+=0x1;_0x3dc7f8['countglobal']=ut[_0x7d12('0xa0')](_0x3dc7f8);ut[_0x7d12('0x8d')](_0x3dc7f8,0x3,_0x7d12('0xce'));ami[_0x7d12('0x26')](_0x7d12('0xcf'),ut[_0x7d12('0xa3')](_0x3dc7f8,'noanswer'));rpcDb['createCustomerHistory'](_0x3dc7f8,_0x7d12('0xd0'));if(ut[_0x7d12('0xa0')](_0x3dc7f8)>=_0x4459c4[_0x7d12('0xa6')]){_0x34c339=ut[_0x7d12('0xc7')](_0x3dc7f8,0xf,_0x7d12('0xa7'));rpcDb[_0x7d12('0x94')](_0x34c339,_0x7d12('0xd1'));}else{if(_0x3dc7f8[_0x7d12('0xcd')]>=_0x4459c4[_0x7d12('0xd2')]){rpcDb[_0x7d12('0x94')](_0x3dc7f8,_0x7d12('0xd0'));}else{rpcDb[_0x7d12('0xaa')](ut[_0x7d12('0xc9')](_0x3dc7f8,_0x7d12('0xcd'),_0x4459c4[_0x7d12('0xd3')]),_0x3dc7f8[_0x7d12('0xca')],_0x3dc7f8[_0x7d12('0xac')]);}}break;case _0x7d12('0xd4'):_0x4459c4['outboundCongestionCallsDay']+=0x1;_0x3dc7f8[_0x7d12('0xd5')]+=0x1;_0x3dc7f8[_0x7d12('0x9f')]=ut[_0x7d12('0xa0')](_0x3dc7f8);ut[_0x7d12('0x8d')](_0x3dc7f8,0x8,_0x7d12('0xd6'));ami[_0x7d12('0x26')](_0x7d12('0xd7'),ut[_0x7d12('0xa3')](_0x3dc7f8,_0x7d12('0xd8')));rpcDb[_0x7d12('0xbb')](_0x3dc7f8,_0x7d12('0xd9'));if(ut[_0x7d12('0xa0')](_0x3dc7f8)>=_0x4459c4[_0x7d12('0xa6')]){_0x34c339=ut[_0x7d12('0xc7')](_0x3dc7f8,0xf,'Global');rpcDb['createCustomerFinal'](_0x34c339,_0x7d12('0xda'));}else{if(_0x3dc7f8[_0x7d12('0xd5')]>=_0x4459c4['dialCongestionMaxRetry']){rpcDb[_0x7d12('0x94')](_0x3dc7f8,_0x7d12('0xd9'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x3dc7f8,'countcongestionretry',_0x4459c4[_0x7d12('0xdb')]),_0x3dc7f8[_0x7d12('0xca')],_0x3dc7f8[_0x7d12('0xac')]);}}break;case _0x7d12('0xdc'):_0x4459c4[_0x7d12('0x3e')]+=0x1;_0x3dc7f8[_0x7d12('0xdd')]+=0x1;_0x3dc7f8[_0x7d12('0x9f')]=ut[_0x7d12('0xa0')](_0x3dc7f8);ut[_0x7d12('0x8d')](_0x3dc7f8,0x14,_0x7d12('0xde'));ami[_0x7d12('0x26')](_0x7d12('0xdf'),ut[_0x7d12('0xa3')](_0x3dc7f8,_0x7d12('0xe0')));rpcDb[_0x7d12('0xbb')](_0x3dc7f8,_0x7d12('0xe1'));if(ut['totalGlobal'](_0x3dc7f8)>=_0x4459c4[_0x7d12('0xa6')]){_0x34c339=ut[_0x7d12('0xc7')](_0x3dc7f8,0x14,_0x7d12('0xde'));rpcDb[_0x7d12('0x94')](_0x34c339,'[callProgressDetectingCustomer][logAgentReject]');}else{if(_0x3dc7f8[_0x7d12('0xdd')]>=_0x4459c4['dialAgentRejectMaxRetry']){rpcDb[_0x7d12('0x94')](_0x3dc7f8,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0x7d12('0xaa')](ut[_0x7d12('0xc9')](_0x3dc7f8,_0x7d12('0xdd'),_0x4459c4[_0x7d12('0xe2')]),_0x3dc7f8[_0x7d12('0xca')],_0x3dc7f8[_0x7d12('0xac')]);}}break;case'ABANDONED':_0x4459c4[_0x7d12('0x40')]+=0x1;_0x3dc7f8[_0x7d12('0xe3')]+=0x1;_0x3dc7f8['countglobal']=ut['totalGlobal'](_0x3dc7f8);ut[_0x7d12('0x8d')](_0x3dc7f8,0xb,_0x7d12('0xe4'));rpcDb['createCustomerHistory'](_0x3dc7f8,_0x7d12('0xe5'));if(ut['totalGlobal'](_0x3dc7f8)>=_0x4459c4['dialGlobalMaxRetry']){_0x34c339=ut[_0x7d12('0xc7')](_0x3dc7f8,0xf,_0x7d12('0xa7'));rpcDb['createCustomerFinal'](_0x34c339,_0x7d12('0xe5'));}else{if(_0x3dc7f8['countabandonedetry']>=_0x4459c4[_0x7d12('0xe6')]){rpcDb['createCustomerFinal'](_0x3dc7f8,_0x7d12('0xe5'));}else{rpcDb[_0x7d12('0xaa')](ut['scheduledAt'](_0x3dc7f8,_0x7d12('0xe3'),_0x4459c4[_0x7d12('0xe7')]),_0x3dc7f8[_0x7d12('0xca')],_0x3dc7f8[_0x7d12('0xac')]);}}break;case'18':_0x4459c4['outboundUnknownCallsDay']+=0x1;_0x3dc7f8['countmachineretry']+=0x1;_0x3dc7f8[_0x7d12('0x9f')]=ut[_0x7d12('0xa0')](_0x3dc7f8);ut[_0x7d12('0x8d')](_0x3dc7f8,0x12,_0xd99493[_0x7d12('0xe8')]||_0xd99493[_0x7d12('0xe9')]);ami[_0x7d12('0x26')](_0x7d12('0xea'),ut[_0x7d12('0xa3')](_0x3dc7f8,'amd'));rpcDb[_0x7d12('0xbb')](_0x3dc7f8,'[callProgressDetectingCustomer][hangupInAMD]');if(ut[_0x7d12('0xa0')](_0x3dc7f8)>=_0x4459c4[_0x7d12('0xa6')]){_0x34c339=ut[_0x7d12('0xc7')](_0x3dc7f8,0xf,_0x7d12('0xa7'));rpcDb['createCustomerFinal'](_0x34c339,_0x7d12('0xeb'));}else{rpcDb[_0x7d12('0x94')](_0x3dc7f8,_0x7d12('0xeb'));}delete this[_0x7d12('0x6c')][_0xd99493['linkedid']];break;case'19':_0x4459c4[_0x7d12('0x3f')]+=0x1;_0x3dc7f8['countglobal']=ut[_0x7d12('0xa0')](_0x3dc7f8);ut[_0x7d12('0x8d')](_0x3dc7f8,0x13,_0xd99493[_0x7d12('0xe8')]||_0xd99493[_0x7d12('0xe9')]);ami['emit'](_0x7d12('0xea'),ut['buildObj'](_0x3dc7f8,_0x7d12('0xec')));rpcDb[_0x7d12('0xbb')](_0x3dc7f8,_0x7d12('0xed'));if(ut[_0x7d12('0xa0')](_0x3dc7f8)>=_0x4459c4[_0x7d12('0xa6')]){_0x34c339=ut[_0x7d12('0xc7')](_0x3dc7f8,0xf,_0x7d12('0xa7'));rpcDb[_0x7d12('0x94')](_0x34c339,_0x7d12('0xed'));}else{rpcDb['createCustomerFinal'](_0x3dc7f8,_0x7d12('0xed'));}delete this['actions'][_0xd99493[_0x7d12('0xad')]];break;default:if(_0x3dc7f8['dialAnswer']){ut[_0x7d12('0x79')](_0x4459c4,_0x7d12('0xee'));ut['loggerError']('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x4459c4[_0x7d12('0x52')],_0xd99493);}_0x4459c4[_0x7d12('0x3f')]+=0x1;_0x3dc7f8[_0x7d12('0x9f')]=ut[_0x7d12('0xa0')](_0x3dc7f8);ut[_0x7d12('0x8d')](_0x3dc7f8,0xc,_0xd99493['cause-txt']||_0xd99493['dialstatus']);rpcDb['createCustomerHistory'](_0x3dc7f8,_0x7d12('0xef'));if(ut[_0x7d12('0xa0')](_0x3dc7f8)>=_0x4459c4[_0x7d12('0xa6')]){_0x34c339=ut[_0x7d12('0xc7')](_0x3dc7f8,0xf,_0x7d12('0xa7'));rpcDb[_0x7d12('0x94')](_0x34c339,_0x7d12('0xf0'));}else{rpcDb[_0x7d12('0x94')](_0x3dc7f8,_0x7d12('0xf0'));}delete this['actions'][_0xd99493[_0x7d12('0xad')]];}if(!(_0x3dc7f8[_0x7d12('0x78')]&&_0x19316c==='16')){ut[_0x7d12('0x76')](_0x4459c4,_0x7d12('0xf1'));logger[_0x7d12('0x59')](_0x7d12('0xf2'),_0x3dc7f8[_0x7d12('0xb1')],_0x7d12('0xc0'),_0x4459c4[_0x7d12('0x52')],_0x7d12('0xf3'),_0x4459c4[_0x7d12('0x4a')]);}if(_0x19316c!=='ANSWER'){delete this['actions'][_0xd99493[_0x7d12('0xad')]];delete this[_0x7d12('0x6c')][_0xd99493[_0x7d12('0xf4')]];}}};Preview[_0x7d12('0x64')]['callProgressDetectingAgent']=function(_0x2a14cf,_0x21b993,_0x4f34b1){if(_[_0x7d12('0xf5')](_0x21b993)&&_0x7d12('0xf6')!==typeof _0x21b993){return;}if(_[_0x7d12('0xf5')](_0x4f34b1)&&_0x7d12('0xf6')!==typeof _0x4f34b1){return;}switch(_0x4f34b1[_0x7d12('0xf7')]){case'0':ut['logAgent'](_0x2a14cf,0x0,_0x7d12('0xa1'));rpcDb[_0x7d12('0xf8')](_0x2a14cf,_0x7d12('0xf9'));break;case'3':ut[_0x7d12('0xfa')](_0x2a14cf,0x3,_0x7d12('0xce'));rpcDb[_0x7d12('0xf8')](_0x2a14cf,_0x7d12('0xfb'));break;case'5':ut[_0x7d12('0xfa')](_0x2a14cf,0x5,'Busy');rpcDb[_0x7d12('0xf8')](_0x2a14cf,_0x7d12('0xfc'));break;case'8':ut[_0x7d12('0xfa')](_0x2a14cf,0x8,_0x7d12('0xd6'));rpcDb['createAgentHistory'](_0x2a14cf,_0x7d12('0xfd'));break;case'22':ut['logAgent'](_0x2a14cf,0x16,_0x7d12('0xfe'));rpcDb[_0x7d12('0xf8')](_0x2a14cf,_0x7d12('0xff'));break;default:ut[_0x7d12('0xfa')](_0x2a14cf,0xc,_0x4f34b1[_0x7d12('0xf7')]);rpcDb[_0x7d12('0xf8')](_0x2a14cf,_0x7d12('0xfd'));}ut['updateOriginated'](_0x21b993,_0x7d12('0x100'));logger[_0x7d12('0x59')]('[originated][decrement][callProgressDetectingAgent]',_0x2a14cf[_0x7d12('0xb1')],_0x7d12('0xc0'),_0x21b993['name'],_0x7d12('0xf3'),_0x21b993['originated']);delete this[_0x7d12('0x6c')][_0x2a14cf[_0x7d12('0xb1')]];};Preview['prototype']['checkInBlack']=function(_0x22ebe4,_0x28970e,_0x1f94e6,_0x580201,_0x5990be){var _0x508778=this;return new BPromise(function(_0x4d02c3,_0x42a1a9){if(_['isNil'](_0x28970e)||_['isNil'](_0x28970e[_0x7d12('0x101')])||_['isNil'](_0x28970e[_0x7d12('0x101')][_0x7d12('0x102')])||_[_0x7d12('0x6a')](_0x28970e[_0x7d12('0x103')])){_0x42a1a9(ut[_0x7d12('0x5f')](_0x7d12('0x104'),_0x580201,_0x5990be));return;}var _0x4ea1a1=uuid['v4']();var _0x27505a=_0x508778[_0x7d12('0x11')][_0x28970e[_0x7d12('0x6b')][_0x7d12('0x52')]];var _0xba5bf9=_0x1f94e6?_0x508778[_0x7d12('0x14')][_0x1f94e6]['id']:undefined;_0x508778[_0x7d12('0x6c')][_0x4ea1a1]=new Action(_0x28970e,_0x27505a,_0x4ea1a1,_0x1f94e6,_0xba5bf9);var _0x4e72e0=_0x508778[_0x7d12('0x6c')][_0x4ea1a1];_0x4e72e0[_0x7d12('0xca')]=_0x580201;_0x4e72e0[_0x7d12('0xac')]=_0x5990be;_0x4e72e0['lookAgent']=_0x1f94e6;if(_['isEmpty'](_0x22ebe4)){_0x508778['execCall'](_0x4e72e0,_0x27505a,_0x28970e,_0x1f94e6)[_0x7d12('0x82')](function(_0x40b65f){logger['info'](_0x7d12('0x105'),_0x7d12('0x106')+_0x4e72e0[_0x7d12('0x6d')]+'\x20IdHopper:\x20'+_0x4e72e0[_0x7d12('0x107')],JSON[_0x7d12('0x6e')](_0x40b65f));ami[_0x7d12('0x26')]('custom:agentcalled',ut[_0x7d12('0xa3')](_0x4e72e0,_0x7d12('0x108'),_0x508778[_0x7d12('0x11')][_0x4e72e0[_0x7d12('0x6d')]]));_0x4d02c3(ut[_0x7d12('0x5f')](_0x7d12('0x109')));})[_0x7d12('0x95')](function(_0x592093){ut[_0x7d12('0x60')](_0x7d12('0x10a'),_0x592093);_0x42a1a9(ut['message'](_0x7d12('0x10b'),_0x580201,_0x5990be));});}else{_0x27505a[_0x7d12('0x38')]+=0x1;ut[_0x7d12('0x10c')](_0x4e72e0);rpcDb[_0x7d12('0x10d')](_0x4e72e0,_0x7d12('0x10e'));delete _0x508778[_0x7d12('0x6c')][_0x4ea1a1];_0x42a1a9(ut['message']('Contact\x20in\x20black\x20List',_0x580201,_0x5990be));}});};Preview[_0x7d12('0x64')][_0x7d12('0x9b')]=function(_0x58ca81){return!_['isNil'](_0x58ca81)&&!_['isNil'](_0x58ca81['name'])&&!_['isNil'](_0x58ca81[_0x7d12('0x53')])&&_0x58ca81[_0x7d12('0x53')]&&!_['isNil'](this[_0x7d12('0x13')][util[_0x7d12('0x56')](_0x7d12('0x10f'),_0x58ca81['name'])])&&!_[_0x7d12('0x6a')](this['trunks'][util[_0x7d12('0x56')](_0x7d12('0x10f'),_0x58ca81['name'])][_0x7d12('0x73')])&&(this['trunks'][util[_0x7d12('0x56')](_0x7d12('0x10f'),_0x58ca81[_0x7d12('0x52')])][_0x7d12('0x73')]===_0x7d12('0x110')||this[_0x7d12('0x13')][util[_0x7d12('0x56')]('SIP/%s',_0x58ca81[_0x7d12('0x52')])]['status']===_0x7d12('0x111'));};Preview[_0x7d12('0x64')][_0x7d12('0x112')]=function(_0x3c0bb1,_0x2e26e2){var _0x1057ad=this;return new BPromise(function(_0x294fb9,_0x1d0a4b){_0x1057ad[_0x7d12('0x113')](_0x3c0bb1,_0x2e26e2)[_0x7d12('0x82')](function(_0x2af1b5){_0x294fb9(_[_0x7d12('0x70')](_0x2af1b5,[_0x7d12('0x5f')]));})[_0x7d12('0x95')](function(_0x2fb7a9){if(_0x2fb7a9[_0x7d12('0x114')]){rpcDb[_0x7d12('0x115')](_0x3c0bb1);}if(_0x2fb7a9[_0x7d12('0x53')]){rpcDb[_0x7d12('0x89')](_0x3c0bb1);}_0x1d0a4b(_[_0x7d12('0x70')](_0x2fb7a9,[_0x7d12('0x5f')]));});});};Preview[_0x7d12('0x64')][_0x7d12('0x113')]=function(_0x143883,_0x243c25){var _0x5716df=this;return new BPromise(function(_0x399722,_0x3df8a4){var _0x5f2ce0,_0x3e31e4;rpcDb[_0x7d12('0x116')](_0x143883)[_0x7d12('0x82')](function(_0x330234){if(!_['isNil'](_0x330234[0x0])){_0x3e31e4=_0x330234[0x0][_0x7d12('0x117')]?![]:!![];_0x5f2ce0=_0x330234[0x0][_0x7d12('0x117')]?!![]:![];_0x5f2ce0=_0x243c25?!![]:_0x5f2ce0;}var _0x15e61d=_0x5716df[_0x7d12('0x118')](_0x330234);if(_0x15e61d['isValid']){rpcDb[_0x7d12('0x119')](_[_0x7d12('0x70')](_0x330234[0x0],[_0x7d12('0x103'),_0x7d12('0x11a')]))['then'](function(_0x125db3){_0x5716df[_0x7d12('0x11b')](_0x125db3,_0x330234[0x0],_0x243c25,_0x3e31e4,_0x5f2ce0)[_0x7d12('0x82')](function(_0x37ef02){_0x399722(_0x37ef02);})['catch'](function(_0x45d284){_0x3df8a4(_0x45d284);});})[_0x7d12('0x95')](function(_0x5022d1){ut[_0x7d12('0x60')](_0x7d12('0x11c'),_0x5022d1);_0x3df8a4(ut[_0x7d12('0x5f')](_0x7d12('0x11d'),_0x3e31e4,_0x5f2ce0));});}else{_0x3df8a4(ut[_0x7d12('0x5f')](_0x15e61d[_0x7d12('0x5f')],_0x3e31e4,_0x5f2ce0));}})[_0x7d12('0x95')](function(_0x36e577){ut[_0x7d12('0x60')](_0x7d12('0x11e'),_0x36e577);_0x3df8a4(ut[_0x7d12('0x5f')](_0x7d12('0x11d'),![],!![]));});});};Preview[_0x7d12('0x64')]['validateContact']=function(_0x29531c){if(_[_0x7d12('0x6a')](_0x29531c)||_[_0x7d12('0x11f')](_0x29531c)||!_['isNil'](_0x29531c[0x0][_0x7d12('0x85')])&&_[_0x7d12('0x6a')](_0x29531c[0x0]['Agent'][_0x7d12('0x52')])){ut[_0x7d12('0x60')](_0x7d12('0x120'),_0x29531c);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x110cf1=this[_0x7d12('0x11')][_0x29531c[0x0]['Queue'][_0x7d12('0x52')]];_0x110cf1[_0x7d12('0x5f')]=_0x7d12('0x9c');if(_['isNil'](_0x110cf1)){ut[_0x7d12('0x60')]('[Preview][validateContact][Empty\x20Campaign]',_0x110cf1);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this[_0x7d12('0x9b')](_0x110cf1[_0x7d12('0x51')])){ut[_0x7d12('0x60')](_0x7d12('0x121'),_0x7d12('0x122')+_0x110cf1[_0x7d12('0x52')]+'\x20Trunk\x20is\x20not\x20active');if(!this['isTrunkReachable'](_0x110cf1['TrunkBackup'])){ut[_0x7d12('0x60')](_0x7d12('0x121'),_0x110cf1[_0x7d12('0x52')]+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0x7d12('0x123')};}}if(!ut[_0x7d12('0x9a')](_0x110cf1[_0x7d12('0x33')])){ut[_0x7d12('0x60')]('[Preview][validateContact][Campaign\x20Active]',_0x110cf1[_0x7d12('0x52')]+_0x7d12('0x124'));return{'isValid':![],'message':_0x7d12('0x122')+_0x110cf1[_0x7d12('0x52')]+_0x7d12('0x124')};}return{'isValid':!![],'message':_0x7d12('0x125')};};Preview['prototype']['execCall']=function(_0x2a15c9,_0x3935d8,_0x45a3df,_0x169736){var _0x318dc3=this;return new BPromise(function(_0x51942d,_0x30b990){var _0x5c9726=_0x2a15c9[_0x7d12('0xb1')];var _0x3d50e2=_0x318dc3['isTrunkReachable'](_0x3935d8['Trunk'])?util[_0x7d12('0x56')]('SIP/%s/%s%s',_0x3935d8[_0x7d12('0x51')][_0x7d12('0x52')],_[_0x7d12('0x6a')](_0x3935d8[_0x7d12('0x126')])?'':_0x3935d8['dialPrefix']['trim']()||'',_0x3935d8[_0x7d12('0x127')]>0x0?_0x45a3df[_0x7d12('0x101')][_0x7d12('0x102')][_0x7d12('0x128')](_0x3935d8[_0x7d12('0x127')]):_0x45a3df[_0x7d12('0x101')]['phone']):util[_0x7d12('0x56')](_0x7d12('0x129'),_[_0x7d12('0x6a')](_0x3935d8[_0x7d12('0x12a')])?_0x3935d8[_0x7d12('0x51')][_0x7d12('0x52')]:_0x3935d8[_0x7d12('0x12a')][_0x7d12('0x52')],_[_0x7d12('0x6a')](_0x3935d8[_0x7d12('0x126')])?'':_0x3935d8[_0x7d12('0x126')]['trim']()||'',_0x3935d8['dialCutDigit']>0x0?_0x45a3df[_0x7d12('0x101')][_0x7d12('0x102')][_0x7d12('0x128')](_0x3935d8[_0x7d12('0x127')]):_0x45a3df['Contact']['phone']);var _0x2cbf88=_0x318dc3[_0x7d12('0x9b')](_0x3935d8[_0x7d12('0x51')])?ut[_0x7d12('0x12b')](_0x3935d8[_0x7d12('0x51')][_0x7d12('0x12c')],_0x3935d8[_0x7d12('0x35')],_0x3935d8[_0x7d12('0x12d')]>0x0?ut[_0x7d12('0x12e')](_0x3935d8[_0x7d12('0x36')],_0x3935d8[_0x7d12('0x12d')]):_0x3935d8[_0x7d12('0x36')]):ut[_0x7d12('0x12b')](_[_0x7d12('0x6a')](_0x3935d8[_0x7d12('0x12a')])?_0x3935d8[_0x7d12('0x51')][_0x7d12('0x12c')]:_0x3935d8[_0x7d12('0x12a')][_0x7d12('0x12c')],_0x3935d8['dialOriginateCallerIdName'],_0x3935d8[_0x7d12('0x12d')]>0x0?ut[_0x7d12('0x12e')](_0x3935d8[_0x7d12('0x36')],_0x3935d8['dialRandomLastDigitCallerIdNumber']):_0x3935d8[_0x7d12('0x36')]);if(_0x2cbf88){_0x2a15c9[_0x7d12('0x12f')]=ut[_0x7d12('0x130')](_0x2cbf88);_0x2a15c9['originatecalleridnum']=ut[_0x7d12('0x131')](_0x2cbf88);}var _0x22d58f=ut[_0x7d12('0x132')](_0x3935d8,_0x45a3df,_0x3d50e2,_0x2cbf88,_0x5c9726,_0x2a15c9);_[_0x7d12('0x133')](_0x2a15c9,ut[_0x7d12('0x134')](_0x22d58f));_0x2a15c9['starttime']=moment()[_0x7d12('0x56')](_0x7d12('0x8b'));ami[_0x7d12('0x72')](ut['variablesAction'](_0x2a15c9,_0x3935d8,_0x22d58f,_0x2a15c9[_0x7d12('0xac')],_0x169736))[_0x7d12('0x82')](function(_0x6911c0){var _0x39d1f8=_0x2a15c9[_0x7d12('0x135')];if(!_[_0x7d12('0x6a')](_0x39d1f8)){if(!_['isNil'](_0x318dc3[_0x7d12('0x14')][_0x39d1f8])){_0x318dc3[_0x7d12('0x14')][_0x39d1f8]['destconnectedlinenum']=_0x2a15c9[_0x7d12('0x136')];emit(util[_0x7d12('0x56')](_0x7d12('0x137'),_0x318dc3['agents'][_0x39d1f8][_0x7d12('0x52')]),_0x7d12('0x138'),{'destaccountcode':_0x318dc3[_0x7d12('0x14')][_0x39d1f8][_0x7d12('0x139')],'destconnectedlinenum':_0x2a15c9[_0x7d12('0x136')]});}}_0x3935d8[_0x7d12('0x4a')]+=0x1;logger[_0x7d12('0x59')](_0x7d12('0x13a'),_0x5c9726,_0x7d12('0xc0'),_0x3935d8[_0x7d12('0x52')],_0x7d12('0xf3'),_0x3935d8[_0x7d12('0x4a')]);_0x51942d(_0x6911c0);})[_0x7d12('0x95')](function(_0x1ef593){ut[_0x7d12('0xfa')](_0x2a15c9,0xe,_0x7d12('0x13b'));rpcDb['createAgentHistory'](_0x2a15c9,_0x7d12('0x13c'));_0x30b990(_0x1ef593);});});};Preview['prototype'][_0x7d12('0x1e')]=function(_0x1db15b){if(this[_0x7d12('0x6c')][_0x1db15b[_0x7d12('0xad')]]){this['actions'][_0x1db15b[_0x7d12('0xad')]]['channel']=_0x1db15b[_0x7d12('0x74')];}};Preview[_0x7d12('0x64')][_0x7d12('0x16')]=function(_0x26273f){var _0x1f5e89=this;var _0x56b36c=this[_0x7d12('0x6c')][_0x26273f[_0x7d12('0x13d')]];if(_0x56b36c){if(_0x56b36c[_0x7d12('0x13e')]&&this['agents'][_0x56b36c[_0x7d12('0x13e')]]){ut['logLookAgent'](_0x56b36c,this['agents'][_0x56b36c['lookAgent']]['name'],this[_0x7d12('0x14')][_0x56b36c[_0x7d12('0x13e')]]['id']);}var _0x4fe95e=_[_0x7d12('0x13f')](_0x56b36c);_0x4fe95e[_0x7d12('0xae')]=moment()[_0x7d12('0x56')]('YYYY-MM-DD\x20HH:mm:ss');var _0x339e38=_0x1f5e89['campaignsPreview'][_0x56b36c[_0x7d12('0x6d')]];if(ut[_0x7d12('0x140')](_0x26273f['response'])){if(_0x56b36c[_0x7d12('0xca')]){rpcDb[_0x7d12('0x115')](_0x56b36c[_0x7d12('0x107')]);}if(_0x56b36c[_0x7d12('0xac')]){rpcDb[_0x7d12('0x89')](_0x56b36c[_0x7d12('0x107')]);}ami[_0x7d12('0x26')](_0x7d12('0x141'),ut[_0x7d12('0xa3')](_0x56b36c,_0x7d12('0x142'),this[_0x7d12('0x11')][_0x56b36c[_0x7d12('0x6d')]]));this['callProgressDetectingAgent'](_0x4fe95e,_0x339e38,_0x26273f);}else{_0x56b36c['starttime']=moment()[_0x7d12('0x56')](_0x7d12('0x8b'));ut['logAgent'](_0x4fe95e,0x4,'Answer');rpcDb[_0x7d12('0xf8')](_0x4fe95e,_0x7d12('0x143'));}}};Preview[_0x7d12('0x64')][_0x7d12('0x19')]=function(_0x480e29){var _0x5f1e92=this;var _0x2dd2a5=this['actions'][_0x480e29[_0x7d12('0xad')]];var _0xaf2c13;if(_0x2dd2a5){_0xaf2c13=this[_0x7d12('0x11')][_0x2dd2a5['queue']];logger[_0x7d12('0x59')]('[syncHangup][talking]',_0x480e29[_0x7d12('0xad')],_0x7d12('0xc0'),_0xaf2c13[_0x7d12('0x52')],_0x7d12('0x6f'),_0xaf2c13[_0x7d12('0x2c')]);}if(this[_0x7d12('0x6c')][_0x480e29[_0x7d12('0xad')]]&&_0x480e29[_0x7d12('0xad')]!==_0x480e29[_0x7d12('0xb1')]){if(_0x480e29[_0x7d12('0x144')]==='16'&&this[_0x7d12('0x6c')][_0x480e29[_0x7d12('0xad')]]['dialAnswer']){this[_0x7d12('0x9d')](_0x480e29,_0x480e29[_0x7d12('0xad')],_0x480e29[_0x7d12('0x144')]);}else if(this['actions'][_0x480e29[_0x7d12('0xad')]][_0x7d12('0x78')]){logger['info'](_0x7d12('0x145'),_0x480e29[_0x7d12('0xad')],_0x480e29['cause'],_0x7d12('0xc0'),_0xaf2c13[_0x7d12('0x52')],'pTalking:\x20',_0xaf2c13[_0x7d12('0x2c')]);this[_0x7d12('0x9d')](_0x480e29,_0x480e29[_0x7d12('0xad')],_0x480e29['cause']);}}else if(_0x2dd2a5&&_[_0x7d12('0x6a')](_0x2dd2a5[_0x7d12('0x146')])&&_0xaf2c13[_0x7d12('0x147')]&&_0x480e29[_0x7d12('0xad')]===_0x480e29[_0x7d12('0xb1')]&&_['isNil'](_0x480e29[_0x7d12('0xf7')])&&_0x480e29[_0x7d12('0x144')]==='16'&&_0x480e29[_0x7d12('0x148')]==='6'&&_[_0x7d12('0xf5')](_0x2dd2a5[_0x7d12('0x149')])){if(_0x2dd2a5[_0x7d12('0xca')]){rpcDb[_0x7d12('0x115')](_0x2dd2a5[_0x7d12('0x107')]);}if(_0x2dd2a5[_0x7d12('0xac')]){rpcDb[_0x7d12('0x89')](_0x2dd2a5[_0x7d12('0x107')]);}_0x480e29[_0x7d12('0xf7')]='22';this['callProgressDetectingAgent'](_0x2dd2a5,_0xaf2c13,_0x480e29);}else if(_0x2dd2a5&&_0x2dd2a5[_0x7d12('0x149')]){if(_0x480e29[_0x7d12('0x144')]==='16'&&this[_0x7d12('0x6c')][_0x480e29[_0x7d12('0xad')]][_0x7d12('0x78')]){logger[_0x7d12('0x59')](_0x7d12('0x14a'),_0x480e29[_0x7d12('0xad')],_0x480e29[_0x7d12('0x144')],_0x7d12('0xc0'),_0xaf2c13[_0x7d12('0x52')],'pTalking:\x20',_0xaf2c13[_0x7d12('0x2c')]);this[_0x7d12('0x9d')](_0x480e29,_0x480e29['linkedid'],_0x480e29[_0x7d12('0x144')]);}else if(this[_0x7d12('0x6c')][_0x480e29[_0x7d12('0xad')]]['dialAnswer']){logger['info']('[syncHangup][talking][cause]',_0x480e29['linkedid'],_0x480e29[_0x7d12('0x144')],'\x20Queue',_0xaf2c13['name'],_0x7d12('0x6f'),_0xaf2c13[_0x7d12('0x2c')]);this['callProgressDetectingCustomer'](_0x480e29,_0x480e29[_0x7d12('0xad')],_0x480e29[_0x7d12('0x144')]);}}};Preview[_0x7d12('0x64')][_0x7d12('0x1c')]=function(_0x448d91){if(this[_0x7d12('0x6c')][_0x448d91[_0x7d12('0xf4')]]&&_0x448d91[_0x7d12('0xf4')]!==_0x448d91['destuniqueid']){this[_0x7d12('0x9d')](_0x448d91,_0x448d91[_0x7d12('0xf4')],_0x448d91[_0x7d12('0xe9')]);}};Preview[_0x7d12('0x64')]['syncHangupRequest']=function(_0x561694){if(this[_0x7d12('0x6c')][_0x561694[_0x7d12('0xad')]]&&_0x561694[_0x7d12('0xad')]!==_0x561694[_0x7d12('0xb1')]&&!this[_0x7d12('0x6c')][_0x561694['linkedid']][_0x7d12('0x78')]){if(_0x561694[_0x7d12('0x144')]==='1'){this[_0x7d12('0x9d')](_0x561694,_0x561694[_0x7d12('0xad')],_0x561694[_0x7d12('0x144')]);}}};Preview[_0x7d12('0x64')]['addVariable']=function(_0x3ee858,_0x2408ea,_0x408939){if(this[_0x7d12('0x6c')][_0x3ee858]){if(_[_0x7d12('0x6a')](this[_0x7d12('0x6c')][_0x3ee858][_0x7d12('0x14b')])){this[_0x7d12('0x6c')][_0x3ee858][_0x7d12('0x14b')]={};}this[_0x7d12('0x6c')][_0x3ee858]['variables'][_0x2408ea]=_0x408939;}};Preview[_0x7d12('0x64')][_0x7d12('0x20')]=function(_0x54483e){try{if(!_[_0x7d12('0x6a')](_0x54483e)){if(ut[_0x7d12('0x14c')](_[_0x7d12('0x14d')](_0x54483e[_0x7d12('0x14e')])[0x0])){this[_0x7d12('0x14f')](_0x54483e[_0x7d12('0xb1')],_[_0x7d12('0x14d')](_0x54483e['variable'])[0x0],_0x54483e[_0x7d12('0x150')]);}}}catch(_0x1e3a3d){logger['error'](_0x7d12('0x151'),util[_0x7d12('0x152')](_0x1e3a3d,{'showHidden':![],'depth':null}));}};Preview[_0x7d12('0x64')]['syncAttendedTransfer']=function(_0x57b7c4){if(_0x57b7c4){if(this[_0x7d12('0x6c')][_0x57b7c4[_0x7d12('0x153')]]){this['actions'][_0x57b7c4['transfertargetlinkedid']]['transfer']=!![];}}};Preview[_0x7d12('0x64')][_0x7d12('0x24')]=function(_0x52a43b){if(_0x52a43b){if(this['actions'][_0x52a43b[_0x7d12('0x154')]]){this[_0x7d12('0x6c')][_0x52a43b[_0x7d12('0x154')]][_0x7d12('0x149')]=!![];}}};module[_0x7d12('0x155')]=Preview; \ No newline at end of file +var _0xdbf8=['dialCutDigit','substring','callerid','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','starttime','Action','variablesAction','channelAgent','destconnectedlinenum','calleridnum','user:%s','accountcode','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','lookAgent','logLookAgent','clone','response','custom:agentringnoanswer','rejected','callProgressDetectingAgent','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','statedesc','dialQueueProject','channelstate','transfer','[syncHangup][talking][cause]','syncDialEnd','destuniqueid','syncHangupRequest','addVariable','variables','syncVarSet','filterKey','keys','variable','value','[syncVarSet][Preview]','transfertargetlinkedid','transfererlinkedid','util','bluebird','uuid','md5','../../../config/logger','preview','../ami','./rpcDb','./util/util','redis','socket.io-emitter','prototype','enqueue','tail','sequence','voiceQueues','trunks','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','hangup','syncHangup','bind','dialend','newexten','syncNewExten','varset','syncAttendedTransfer','syncBlindTransfer','emit','type','name','strategy','answered','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialOriginateCallerIdName','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','startProgressive','Trunk','active','Interval','stringify','format','voice_queue:save','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice:queue:%s','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','available','paused','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','\x20is\x20disactive','loopCampaigns','syncCampaigns','booked','outbound','clearZombieChannels','hasOwnProperty','dialMethod','setMessage','recallMe','clearZombieChannel','actions','[clearZombieChannels][talking]','Queue','queue','originated:\x20','pTalking:\x20','campaignsPreview','pick','UserId','VoiceQueueId','ListId','status','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','dialAnswer','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','info','[action]','getContactRecallMe','agentReadyId','then','isNil','length','Agent','voicePause','logger2','[RecallMe]','disableContact','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','isActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','dialGlobalMaxRetry','cloneAction','Global','dialNoSuchNumberMaxRetry','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberRetryFrequency','unlockAgent','activeContact','ANSWER','responsetime','answertime','[syncHangup][talking][increment]','custom:agentconnect','custom:agentConnectPreview','complete','total','[16]','Answer','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','uniqueid','BUSY','countbusyretry','countglobal','Busy','custom:agentbusy','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','[callProgressDetectingCustomer][logBusy]','rescheduleContact','scheduledAt','dialBusyRetryFrequency','NOANSWER','NoAnswer','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','countnoanswerretry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','CONGESTION','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','countagentrejectretry','AgentReject','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','ABANDONED','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','countmachineretry','amd','[callProgressDetectingCustomer][hangupInAMD]','linkedid','custom:amd','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','cause-txt','dialstatus','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','\x20Queue','destlinkedid','isUndefined','object','reason','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','logAgent','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','phone','Contact\x20is\x20undefined','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','idContact','custom:agentcalled','Calling','[Preview][execCall][failure]','logBlacklist','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','reachable','run','execRun','unlock','unlockContact','recallme','validateContact','isValid','checkIsBlackList','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','[Preview][validateContact][Empty\x20Contact]','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20Backup\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','trim'];(function(_0x256973,_0x3cdbd4){var _0x4bf1d8=function(_0x4b6fb6){while(--_0x4b6fb6){_0x256973['push'](_0x256973['shift']());}};_0x4bf1d8(++_0x3cdbd4);}(_0xdbf8,0x18a));var _0x8dbf=function(_0x96d481,_0x25f047){_0x96d481=_0x96d481-0x0;var _0x181a2a=_0xdbf8[_0x96d481];return _0x181a2a;};'use strict';var util=require(_0x8dbf('0x0'));var _=require('lodash');var BPromise=require(_0x8dbf('0x1'));var uuid=require(_0x8dbf('0x2'));var moment=require('moment');var md5=require(_0x8dbf('0x3'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x8dbf('0x4'))(_0x8dbf('0x5'));var loggerAction=require(_0x8dbf('0x4'))('actionPreview');var ami=require(_0x8dbf('0x6'));var rpcDb=require(_0x8dbf('0x7'));var Action=require('./action');var ut=require(_0x8dbf('0x8'));config[_0x8dbf('0x9')]=_['defaults'](config[_0x8dbf('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x8dbf('0xa'))(new Redis(config['redis']));var Sequence=function(){};Sequence[_0x8dbf('0xb')][_0x8dbf('0xc')]=function(_0x4b359f){this[_0x8dbf('0xd')]=this[_0x8dbf('0xd')]?this['tail']['finally'](_0x4b359f):_0x4b359f();};function Preview(_0x34be6a){this[_0x8dbf('0xe')]=new Sequence();this['campaignsPreview']=_0x34be6a[_0x8dbf('0xf')];this['trunks']=_0x34be6a[_0x8dbf('0x10')];this['actions']={};this['agents']=_0x34be6a[_0x8dbf('0x11')];this[_0x8dbf('0x12')]=0x0;ami['on'](_0x8dbf('0x13'),this[_0x8dbf('0x14')]['bind'](this));ami['on'](_0x8dbf('0x15'),this[_0x8dbf('0x16')][_0x8dbf('0x17')](this));ami['on']('hanguprequest',this['syncHangupRequest'][_0x8dbf('0x17')](this));ami['on'](_0x8dbf('0x18'),this['syncDialEnd'][_0x8dbf('0x17')](this));ami['on'](_0x8dbf('0x19'),this[_0x8dbf('0x1a')]['bind'](this));ami['on'](_0x8dbf('0x1b'),this['syncVarSet'][_0x8dbf('0x17')](this));ami['on']('attendedtransfer',this[_0x8dbf('0x1c')][_0x8dbf('0x17')](this));ami['on']('blindtransfer',this[_0x8dbf('0x1d')][_0x8dbf('0x17')](this));this['loopCampaigns'](this['campaignsPreview']);}function emit(_0x246a6b,_0x47f610,_0x41b27d){io['to'](_0x246a6b)[_0x8dbf('0x1e')](_0x47f610,_0x41b27d);}function emitCampaignPreview(_0x1be09f){if(_0x1be09f[_0x8dbf('0x1f')]==='outbound'){var _0x48fb12={'id':_0x1be09f['id'],'name':_0x1be09f[_0x8dbf('0x20')],'strategy':_0x1be09f[_0x8dbf('0x21')],'answered':_0x1be09f[_0x8dbf('0x22')],'available':_0x1be09f['available'],'loggedIn':_0x1be09f[_0x8dbf('0x23')],'pTalking':_0x1be09f[_0x8dbf('0x24')],'sumBillable':_0x1be09f[_0x8dbf('0x25')],'sumDuration':_0x1be09f[_0x8dbf('0x26')],'sumHoldTime':_0x1be09f[_0x8dbf('0x27')]||0x0,'talking':_0x1be09f[_0x8dbf('0x28')],'total':_0x1be09f['total'],'type':_0x1be09f['type'],'unmanaged':_0x1be09f[_0x8dbf('0x29')],'abandoned':_0x1be09f[_0x8dbf('0x2a')],'waiting':_0x1be09f[_0x8dbf('0x2b')],'loggedInDb':_0x1be09f[_0x8dbf('0x2c')],'dialActive':_0x1be09f[_0x8dbf('0x2d')],'dialMethod':_0x1be09f['dialMethod'],'dialOriginateCallerIdName':_0x1be09f[_0x8dbf('0x2e')],'dialOriginateCallerIdNumber':_0x1be09f['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x1be09f[_0x8dbf('0x2f')],'dialPrefix':_0x1be09f[_0x8dbf('0x30')],'outboundAnswerAgiCallsDay':_0x1be09f[_0x8dbf('0x31')],'outboundAnswerCallsDay':_0x1be09f[_0x8dbf('0x32')],'outboundBlacklistCallsDay':_0x1be09f[_0x8dbf('0x33')],'outboundBusyCallsDay':_0x1be09f[_0x8dbf('0x34')],'outboundCongestionCallsDay':_0x1be09f[_0x8dbf('0x35')],'outboundDropCallsDayACS':_0x1be09f[_0x8dbf('0x36')],'outboundDropCallsDayCallersExit':_0x1be09f['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x1be09f['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x1be09f[_0x8dbf('0x37')],'outboundNoSuchCallsDay':_0x1be09f[_0x8dbf('0x38')],'outboundOriginateFailureCallsDay':_0x1be09f[_0x8dbf('0x39')],'outboundReCallsDay':_0x1be09f[_0x8dbf('0x3a')],'outboundRejectCallsDay':_0x1be09f[_0x8dbf('0x3b')],'outboundUnknownCallsDay':_0x1be09f[_0x8dbf('0x3c')],'outboundAbandonedCallsDay':_0x1be09f[_0x8dbf('0x3d')],'predictiveIntervalAnsweredCalls':_0x1be09f['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x1be09f['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x1be09f[_0x8dbf('0x3e')],'predictiveIntervalDroppedCallsCallersExit':_0x1be09f[_0x8dbf('0x3f')],'predictiveIntervalDroppedCallsTimeout':_0x1be09f[_0x8dbf('0x40')],'predictiveIntervalErlangCalls':_0x1be09f[_0x8dbf('0x41')],'predictiveIntervalErlangCallsDroppedCalls':_0x1be09f['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x1be09f[_0x8dbf('0x42')],'predictiveIntervalMultiplicativeFactor':_0x1be09f[_0x8dbf('0x43')],'predictiveIntervalPauses':_0x1be09f[_0x8dbf('0x44')],'predictiveIntervalAvailable':_0x1be09f[_0x8dbf('0x45')],'predictiveIntervalTotalCalls':_0x1be09f[_0x8dbf('0x46')],'message':_0x1be09f[_0x8dbf('0x47')],'originated':_0x1be09f[_0x8dbf('0x48')],'erlangCalls':_0x1be09f[_0x8dbf('0x49')],'erlangCallToSecond':_0x1be09f[_0x8dbf('0x4a')],'erlangAbandonmentRate':_0x1be09f[_0x8dbf('0x4b')],'erlangBusyFactor':_0x1be09f['erlangBusyFactor'],'startPredictive':_0x1be09f['startPredictive'],'startProgressive':_0x1be09f[_0x8dbf('0x4c')]};if(_0x1be09f[_0x8dbf('0x4d')]){_0x48fb12[_0x8dbf('0x4d')]={'id':_0x1be09f[_0x8dbf('0x4d')]['id'],'name':_0x1be09f[_0x8dbf('0x4d')][_0x8dbf('0x20')],'active':_0x1be09f['Trunk'][_0x8dbf('0x4e')],'callerid':_0x1be09f['Trunk']['callerid']};}if(_0x1be09f['Interval']){_0x48fb12[_0x8dbf('0x4f')]={'id':_0x1be09f[_0x8dbf('0x4f')]['id'],'name':_0x1be09f[_0x8dbf('0x4f')][_0x8dbf('0x20')]};}var _0x5354ca=md5(JSON[_0x8dbf('0x50')](_0x48fb12));if(_0x1be09f[_0x8dbf('0x3')]!==_0x5354ca){_0x1be09f[_0x8dbf('0x3')]=_0x5354ca;emit(util[_0x8dbf('0x51')]('voice:queue:%s',_0x48fb12[_0x8dbf('0x20')]),_0x8dbf('0x52'),_0x48fb12);}}}function emitVoiceQueueChannelRemove(_0x278477){logger['info'](_0x8dbf('0x53'),JSON[_0x8dbf('0x50')](_0x278477));emit(util[_0x8dbf('0x51')](_0x8dbf('0x54'),_0x278477[_0x8dbf('0x20')]),_0x8dbf('0x55'),_0x278477);io[_0x8dbf('0x1e')](_0x8dbf('0x56'),_0x278477);}function notSendMessagesQueue(_0x2df347){if(_0x2df347[_0x8dbf('0x57')]){if(_0x2df347[_0x8dbf('0x48')]===0x0&&_0x2df347['pTalking']===0x0){_0x2df347[_0x8dbf('0x57')]=![];_0x2df347[_0x8dbf('0x58')]=0x0;_0x2df347[_0x8dbf('0x59')]=0x0;_0x2df347[_0x8dbf('0x47')]=_0x8dbf('0x5a');ut[_0x8dbf('0x5b')](_0x8dbf('0x5c'),_0x2df347[_0x8dbf('0x20')]+_0x8dbf('0x5d'));}else{_0x2df347[_0x8dbf('0x47')]=_0x8dbf('0x5e');ut['logger'](_0x8dbf('0x5c'),_0x2df347['name']+_0x8dbf('0x5f'));}emitCampaignPreview(_0x2df347);}}Preview[_0x8dbf('0xb')][_0x8dbf('0x60')]=function(){var _0x3b7bb5=this;setInterval(function(){_0x3b7bb5[_0x8dbf('0x61')]();},0x7cf);};Preview[_0x8dbf('0xb')][_0x8dbf('0x61')]=function(){var _0x24856f=this['campaignsPreview'];this['clockClearZombieChannels']+=0x1;for(var _0x3b3d10 in _0x24856f){if(_0x24856f['hasOwnProperty'](_0x3b3d10)&&(_0x24856f[_0x3b3d10]['dialMethod']===_0x8dbf('0x5')||_0x24856f[_0x3b3d10]['dialMethod']===_0x8dbf('0x62'))&&_0x24856f[_0x3b3d10][_0x8dbf('0x1f')]===_0x8dbf('0x63')){if(this[_0x8dbf('0x12')]>0x7){this[_0x8dbf('0x12')]=0x0;this[_0x8dbf('0x64')]();}}if(_0x24856f[_0x8dbf('0x65')](_0x3b3d10)&&_0x24856f[_0x3b3d10][_0x8dbf('0x66')]==='preview'&&_0x24856f[_0x3b3d10][_0x8dbf('0x1f')]===_0x8dbf('0x63')){if(_0x24856f[_0x3b3d10]['dialActive']){this[_0x8dbf('0x67')](_0x24856f[_0x3b3d10]);this[_0x8dbf('0x68')](_0x24856f[_0x3b3d10]);}else{notSendMessagesQueue(_0x24856f[_0x3b3d10]);}}}};Preview[_0x8dbf('0xb')][_0x8dbf('0x69')]=function(_0x340389){var _0x4b7773=this;this[_0x8dbf('0xe')][_0x8dbf('0xc')](function(){if(!_['isNil'](_0x4b7773[_0x8dbf('0x6a')][_0x340389])){loggerAction['info'](_0x8dbf('0x6b'),_0x340389,_0x8dbf('0x6c'),_0x4b7773[_0x8dbf('0x6a')][_0x340389][_0x8dbf('0x6d')],_0x8dbf('0x6e'),JSON[_0x8dbf('0x50')](_0x4b7773['campaignsPreview'][_0x4b7773[_0x8dbf('0x6a')][_0x340389][_0x8dbf('0x6d')]][_0x8dbf('0x48')]),_0x8dbf('0x6f'),JSON[_0x8dbf('0x50')](_0x4b7773[_0x8dbf('0x70')][_0x4b7773[_0x8dbf('0x6a')][_0x340389][_0x8dbf('0x6d')]][_0x8dbf('0x24')]),JSON['stringify'](_0x4b7773['actions'][_0x340389]['dialAnswer']),JSON['stringify'](_[_0x8dbf('0x71')](_0x4b7773[_0x8dbf('0x6a')][_0x340389],['contactId',_0x8dbf('0x72'),_0x8dbf('0x73'),_0x8dbf('0x74')])));return ami['Action']({'action':_0x8dbf('0x75'),'channel':_0x4b7773[_0x8dbf('0x6a')][_0x340389][_0x8dbf('0x76')]})[_0x8dbf('0x77')](function(_0x58604c){if(_0x58604c[_0x8dbf('0x47')]===_0x8dbf('0x78')){setTimeout(function(){if(_0x4b7773['actions'][_0x340389]){ut[_0x8dbf('0x79')](_0x4b7773['campaignsPreview'][_0x4b7773[_0x8dbf('0x6a')][_0x340389]['queue']],_0x8dbf('0x7a'));if(_0x4b7773[_0x8dbf('0x6a')][_0x340389][_0x8dbf('0x7b')]===!![]){ut[_0x8dbf('0x7c')](_0x4b7773[_0x8dbf('0x70')][_0x4b7773[_0x8dbf('0x6a')][_0x340389]['queue']],'[clearZombieChannel]');ut[_0x8dbf('0x7d')](_0x8dbf('0x7e')+_0x340389,_0x4b7773[_0x8dbf('0x6a')][_0x340389][_0x8dbf('0x6d')]);}ut['loggerError']('[Dialer][checkChannel][Preview]'+_0x340389,_0x4b7773[_0x8dbf('0x6a')][_0x340389]['queue']);delete _0x4b7773[_0x8dbf('0x6a')][_0x340389];}},0x2328);}});}});};Preview['prototype'][_0x8dbf('0x64')]=function(){var _0x468303=this;loggerAction[_0x8dbf('0x7f')](_0x8dbf('0x80'),_['size'](this[_0x8dbf('0x6a')]));for(var _0x3dc8f1 in this[_0x8dbf('0x6a')]){if(_0x468303[_0x8dbf('0x6a')][_0x8dbf('0x65')](_0x3dc8f1)){_0x468303[_0x8dbf('0x69')](_0x3dc8f1);}}};Preview[_0x8dbf('0xb')][_0x8dbf('0x68')]=function(_0x5a88b3){var _0x3d4bca=this;rpcDb[_0x8dbf('0x81')](_0x5a88b3['id'],ut[_0x8dbf('0x82')](this[_0x8dbf('0x11')]))[_0x8dbf('0x83')](function(_0x4a9669){if(!_[_0x8dbf('0x84')](_0x4a9669)){for(var _0x2fc296=0x0;_0x2fc296<_0x4a9669[_0x8dbf('0x85')];_0x2fc296+=0x1){if(ut['getDiff'](_0x4a9669[_0x2fc296]['scheduledat'])<_0x5a88b3['dialRecallMeTimeout']*0x3c){if(_0x4a9669[_0x2fc296]['Agent']&&!_0x4a9669[_0x2fc296][_0x8dbf('0x86')][_0x8dbf('0x87')]){_0x3d4bca['run'](_0x4a9669[_0x2fc296]['id'])[_0x8dbf('0x83')](ut[_0x8dbf('0x88')]('[RecallMe]'))[_0x8dbf('0x77')](ut[_0x8dbf('0x88')](_0x8dbf('0x89')));}else{rpcDb[_0x8dbf('0x8a')](_0x4a9669[_0x2fc296]['id']);}}else{var _0x1d02d4=new Action(_0x4a9669[_0x2fc296],_0x5a88b3);_0x1d02d4['starttime']=moment()[_0x8dbf('0x51')](_0x8dbf('0x8b'));_0x5a88b3[_0x8dbf('0x3a')]+=0x1;ut[_0x8dbf('0x8c')](_0x1d02d4,0x17,_0x8dbf('0x8d'));if(_0x5a88b3[_0x8dbf('0x8e')]){rpcDb[_0x8dbf('0x8f')](ut[_0x8dbf('0x90')](_0x4a9669[_0x2fc296]));rpcDb[_0x8dbf('0x91')](_0x1d02d4,_0x8dbf('0x92'));}else{ut[_0x8dbf('0x8c')](_0x1d02d4,0x16,'RecallFailedTimeout');rpcDb[_0x8dbf('0x91')](_0x1d02d4,_0x8dbf('0x93'));rpcDb[_0x8dbf('0x94')](_0x1d02d4,_0x8dbf('0x93'));}}}}})['catch'](ut[_0x8dbf('0x88')](_0x8dbf('0x95')));};Preview['prototype'][_0x8dbf('0x67')]=function(_0x1d813b){_0x1d813b[_0x8dbf('0x57')]=!![];if(ut[_0x8dbf('0x96')](_0x1d813b['loggedIn'])){_0x1d813b[_0x8dbf('0x47')]='AGENTS_NOT_LOGGED';}else if(!ut[_0x8dbf('0x97')](_0x1d813b[_0x8dbf('0x2d')])){_0x1d813b[_0x8dbf('0x47')]=_0x8dbf('0x5a');}else if(!this['isTrunkReachable'](_0x1d813b['Trunk'])){if(!this[_0x8dbf('0x98')](_0x1d813b[_0x8dbf('0x99')])){_0x1d813b[_0x8dbf('0x47')]=_0x8dbf('0x9a');}else{_0x1d813b[_0x8dbf('0x47')]=_0x8dbf('0x9b');}}else{_0x1d813b['message']=_0x8dbf('0x9b');}emitCampaignPreview(_0x1d813b);};Preview[_0x8dbf('0xb')][_0x8dbf('0x9c')]=function(_0x3c1580,_0x4a267c,_0x556d21){var _0x430649=this;var _0x3c33a3=this[_0x8dbf('0x6a')][_0x4a267c];var _0x1f202f=this[_0x8dbf('0x70')][_0x3c33a3['queue']];var _0x55b2b7;if(_0x1f202f){switch(_0x556d21){case'1':_0x1f202f[_0x8dbf('0x38')]+=0x1;_0x3c33a3[_0x8dbf('0x9d')]+=0x1;_0x3c33a3['countglobal']=ut[_0x8dbf('0x9e')](_0x3c33a3);ut[_0x8dbf('0x8c')](_0x3c33a3,0x0,_0x8dbf('0x9f'));ami['emit'](_0x8dbf('0xa0'),ut[_0x8dbf('0xa1')](_0x3c33a3,'nosuchnumber'));rpcDb[_0x8dbf('0x91')](_0x3c33a3,'[callProgressDetectingCustomer][logNoSuch]');if(ut[_0x8dbf('0x9e')](_0x3c33a3)>=_0x1f202f[_0x8dbf('0xa2')]){_0x55b2b7=ut[_0x8dbf('0xa3')](_0x3c33a3,0xf,_0x8dbf('0xa4'));rpcDb[_0x8dbf('0x94')](_0x55b2b7,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x3c33a3['countnosuchnumberretry']>=_0x1f202f[_0x8dbf('0xa5')]){rpcDb[_0x8dbf('0x94')](_0x3c33a3,_0x8dbf('0xa6'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x3c33a3,_0x8dbf('0x9d'),_0x1f202f[_0x8dbf('0xa7')]),_0x3c33a3[_0x8dbf('0xa8')],_0x3c33a3[_0x8dbf('0xa9')]);}}delete this[_0x8dbf('0x6a')][_0x3c1580['linkedid']];break;case _0x8dbf('0xaa'):var _0x22a722=moment()[_0x8dbf('0x51')](_0x8dbf('0x8b'));_0x3c33a3[_0x8dbf('0xab')]=_0x22a722;_0x3c33a3[_0x8dbf('0xac')]=_0x22a722;_0x3c33a3[_0x8dbf('0x7b')]=!![];_0x1f202f['pTalking']+=0x1;logger['info'](_0x8dbf('0xad'),_0x3c33a3['uniqueid'],'\x20Queue',_0x1f202f[_0x8dbf('0x20')],_0x8dbf('0x6f'),_0x1f202f[_0x8dbf('0x24')]);ami[_0x8dbf('0x1e')](_0x8dbf('0xae'),ut[_0x8dbf('0xa1')](_0x3c33a3,'connect',this['campaignsPreview'][_0x3c33a3['queue']]));if(_0x1f202f['acw']){ami[_0x8dbf('0x1e')](_0x8dbf('0xaf'),ut['buildAcw'](_0x3c33a3));}break;case'16':ami[_0x8dbf('0x1e')]('custom:agentcomplete',ut[_0x8dbf('0xa1')](_0x3c33a3,_0x8dbf('0xb0'),this[_0x8dbf('0x70')][_0x3c33a3[_0x8dbf('0x6d')]]));emitVoiceQueueChannelRemove(ut[_0x8dbf('0xa1')](_0x3c33a3,_0x8dbf('0xb0')));_0x1f202f['outboundAnswerCallsDay']+=0x1;_0x1f202f[_0x8dbf('0xb1')]+=0x1;_0x1f202f[_0x8dbf('0x22')]+=0x1;ut['decrementTalkink'](_0x1f202f,_0x8dbf('0xb2'));_0x3c33a3['countglobal']=ut[_0x8dbf('0x9e')](_0x3c33a3);ut[_0x8dbf('0x8c')](_0x3c33a3,0x4,_0x8dbf('0xb3'));rpcDb['createCustomerHistory'](_0x3c33a3,'[callProgressDetectingCustomer][logAnswer]');rpcDb[_0x8dbf('0x94')](_0x3c33a3,_0x8dbf('0xb4'));rpcDb[_0x8dbf('0xb5')](_0x3c33a3);_0x1f202f[_0x8dbf('0x26')]+=_0x3c33a3[_0x8dbf('0xb6')];_0x1f202f[_0x8dbf('0x25')]+=_0x3c33a3[_0x8dbf('0xb6')];logger[_0x8dbf('0x7f')](_0x8dbf('0xb7'),_0x3c33a3[_0x8dbf('0xb8')],'\x20Queue',_0x1f202f['name'],_0x8dbf('0x6f'),_0x1f202f[_0x8dbf('0x24')]);delete this['actions'][_0x3c1580['linkedid']];break;case _0x8dbf('0xb9'):_0x1f202f[_0x8dbf('0x34')]+=0x1;_0x3c33a3[_0x8dbf('0xba')]+=0x1;_0x3c33a3[_0x8dbf('0xbb')]=ut[_0x8dbf('0x9e')](_0x3c33a3);ut[_0x8dbf('0x8c')](_0x3c33a3,0x5,_0x8dbf('0xbc'));ami[_0x8dbf('0x1e')](_0x8dbf('0xbd'),ut[_0x8dbf('0xa1')](_0x3c33a3,'busy'));rpcDb[_0x8dbf('0x91')](_0x3c33a3,'[callProgressDetectingCustomer][logBusy]');if(ut['totalGlobal'](_0x3c33a3)>=_0x1f202f[_0x8dbf('0xa2')]){_0x55b2b7=ut[_0x8dbf('0xa3')](_0x3c33a3,0xf,_0x8dbf('0xa4'));rpcDb['createCustomerFinal'](_0x55b2b7,_0x8dbf('0xbe'));}else{if(_0x3c33a3[_0x8dbf('0xba')]>=_0x1f202f[_0x8dbf('0xbf')]){rpcDb[_0x8dbf('0x94')](_0x3c33a3,_0x8dbf('0xc0'));}else{rpcDb[_0x8dbf('0xc1')](ut[_0x8dbf('0xc2')](_0x3c33a3,_0x8dbf('0xba'),_0x1f202f[_0x8dbf('0xc3')]),_0x3c33a3[_0x8dbf('0xa8')],_0x3c33a3['activeContact']);}}break;case _0x8dbf('0xc4'):_0x1f202f[_0x8dbf('0x37')]+=0x1;_0x3c33a3['countnoanswerretry']+=0x1;_0x3c33a3[_0x8dbf('0xbb')]=ut[_0x8dbf('0x9e')](_0x3c33a3);ut[_0x8dbf('0x8c')](_0x3c33a3,0x3,_0x8dbf('0xc5'));ami[_0x8dbf('0x1e')](_0x8dbf('0xc6'),ut[_0x8dbf('0xa1')](_0x3c33a3,_0x8dbf('0xc7')));rpcDb[_0x8dbf('0x91')](_0x3c33a3,_0x8dbf('0xc8'));if(ut[_0x8dbf('0x9e')](_0x3c33a3)>=_0x1f202f[_0x8dbf('0xa2')]){_0x55b2b7=ut['cloneAction'](_0x3c33a3,0xf,_0x8dbf('0xa4'));rpcDb[_0x8dbf('0x94')](_0x55b2b7,_0x8dbf('0xc9'));}else{if(_0x3c33a3[_0x8dbf('0xca')]>=_0x1f202f[_0x8dbf('0xcb')]){rpcDb['createCustomerFinal'](_0x3c33a3,_0x8dbf('0xc8'));}else{rpcDb[_0x8dbf('0xc1')](ut[_0x8dbf('0xc2')](_0x3c33a3,_0x8dbf('0xca'),_0x1f202f[_0x8dbf('0xcc')]),_0x3c33a3['unlockAgent'],_0x3c33a3[_0x8dbf('0xa9')]);}}break;case _0x8dbf('0xcd'):_0x1f202f[_0x8dbf('0x35')]+=0x1;_0x3c33a3[_0x8dbf('0xce')]+=0x1;_0x3c33a3['countglobal']=ut['totalGlobal'](_0x3c33a3);ut[_0x8dbf('0x8c')](_0x3c33a3,0x8,_0x8dbf('0xcf'));ami[_0x8dbf('0x1e')](_0x8dbf('0xd0'),ut[_0x8dbf('0xa1')](_0x3c33a3,_0x8dbf('0xd1')));rpcDb[_0x8dbf('0x91')](_0x3c33a3,'[callProgressDetectingCustomer][logCongestion]');if(ut[_0x8dbf('0x9e')](_0x3c33a3)>=_0x1f202f[_0x8dbf('0xa2')]){_0x55b2b7=ut[_0x8dbf('0xa3')](_0x3c33a3,0xf,_0x8dbf('0xa4'));rpcDb[_0x8dbf('0x94')](_0x55b2b7,_0x8dbf('0xd2'));}else{if(_0x3c33a3[_0x8dbf('0xce')]>=_0x1f202f[_0x8dbf('0xd3')]){rpcDb[_0x8dbf('0x94')](_0x3c33a3,_0x8dbf('0xd4'));}else{rpcDb[_0x8dbf('0xc1')](ut['scheduledAt'](_0x3c33a3,_0x8dbf('0xce'),_0x1f202f[_0x8dbf('0xc3')]),_0x3c33a3[_0x8dbf('0xa8')],_0x3c33a3[_0x8dbf('0xa9')]);}}break;case'CANCEL':_0x1f202f[_0x8dbf('0x3b')]+=0x1;_0x3c33a3[_0x8dbf('0xd5')]+=0x1;_0x3c33a3[_0x8dbf('0xbb')]=ut[_0x8dbf('0x9e')](_0x3c33a3);ut[_0x8dbf('0x8c')](_0x3c33a3,0x14,_0x8dbf('0xd6'));ami[_0x8dbf('0x1e')](_0x8dbf('0xd7'),ut[_0x8dbf('0xa1')](_0x3c33a3,_0x8dbf('0xd8')));rpcDb[_0x8dbf('0x91')](_0x3c33a3,_0x8dbf('0xd9'));if(ut['totalGlobal'](_0x3c33a3)>=_0x1f202f[_0x8dbf('0xa2')]){_0x55b2b7=ut['cloneAction'](_0x3c33a3,0x14,_0x8dbf('0xd6'));rpcDb[_0x8dbf('0x94')](_0x55b2b7,_0x8dbf('0xda'));}else{if(_0x3c33a3[_0x8dbf('0xd5')]>=_0x1f202f[_0x8dbf('0xdb')]){rpcDb[_0x8dbf('0x94')](_0x3c33a3,_0x8dbf('0xda'));}else{rpcDb[_0x8dbf('0xc1')](ut[_0x8dbf('0xc2')](_0x3c33a3,_0x8dbf('0xd5'),_0x1f202f['dialAgentRejectRetryFrequency']),_0x3c33a3[_0x8dbf('0xa8')],_0x3c33a3[_0x8dbf('0xa9')]);}}break;case _0x8dbf('0xdc'):_0x1f202f[_0x8dbf('0x3d')]+=0x1;_0x3c33a3['countabandonedretry']+=0x1;_0x3c33a3[_0x8dbf('0xbb')]=ut[_0x8dbf('0x9e')](_0x3c33a3);ut['logCustomer'](_0x3c33a3,0xb,'Abandoned');rpcDb['createCustomerHistory'](_0x3c33a3,'[callProgressDetectingCustomer][logAbandoned]');if(ut['totalGlobal'](_0x3c33a3)>=_0x1f202f[_0x8dbf('0xa2')]){_0x55b2b7=ut['cloneAction'](_0x3c33a3,0xf,'Global');rpcDb['createCustomerFinal'](_0x55b2b7,_0x8dbf('0xdd'));}else{if(_0x3c33a3[_0x8dbf('0xde')]>=_0x1f202f[_0x8dbf('0xdf')]){rpcDb[_0x8dbf('0x94')](_0x3c33a3,_0x8dbf('0xdd'));}else{rpcDb[_0x8dbf('0xc1')](ut[_0x8dbf('0xc2')](_0x3c33a3,'countabandonedretry',_0x1f202f[_0x8dbf('0xe0')]),_0x3c33a3[_0x8dbf('0xa8')],_0x3c33a3['activeContact']);}}break;case'18':_0x1f202f[_0x8dbf('0x3c')]+=0x1;_0x3c33a3[_0x8dbf('0xe1')]+=0x1;_0x3c33a3[_0x8dbf('0xbb')]=ut['totalGlobal'](_0x3c33a3);ut[_0x8dbf('0x8c')](_0x3c33a3,0x12,_0x3c1580['cause-txt']||_0x3c1580['dialstatus']);ami[_0x8dbf('0x1e')]('custom:amd',ut[_0x8dbf('0xa1')](_0x3c33a3,_0x8dbf('0xe2')));rpcDb[_0x8dbf('0x91')](_0x3c33a3,_0x8dbf('0xe3'));if(ut[_0x8dbf('0x9e')](_0x3c33a3)>=_0x1f202f[_0x8dbf('0xa2')]){_0x55b2b7=ut[_0x8dbf('0xa3')](_0x3c33a3,0xf,'Global');rpcDb[_0x8dbf('0x94')](_0x55b2b7,_0x8dbf('0xe3'));}else{rpcDb['createCustomerFinal'](_0x3c33a3,_0x8dbf('0xe3'));}delete this[_0x8dbf('0x6a')][_0x3c1580[_0x8dbf('0xe4')]];break;case'19':_0x1f202f[_0x8dbf('0x3c')]+=0x1;_0x3c33a3[_0x8dbf('0xbb')]=ut[_0x8dbf('0x9e')](_0x3c33a3);ut['logCustomer'](_0x3c33a3,0x13,_0x3c1580['cause-txt']||_0x3c1580['dialstatus']);ami['emit'](_0x8dbf('0xe5'),ut[_0x8dbf('0xa1')](_0x3c33a3,_0x8dbf('0xe2')));rpcDb[_0x8dbf('0x91')](_0x3c33a3,_0x8dbf('0xe6'));if(ut[_0x8dbf('0x9e')](_0x3c33a3)>=_0x1f202f[_0x8dbf('0xa2')]){_0x55b2b7=ut[_0x8dbf('0xa3')](_0x3c33a3,0xf,'Global');rpcDb[_0x8dbf('0x94')](_0x55b2b7,_0x8dbf('0xe6'));}else{rpcDb[_0x8dbf('0x94')](_0x3c33a3,_0x8dbf('0xe6'));}delete this['actions'][_0x3c1580[_0x8dbf('0xe4')]];break;default:if(_0x3c33a3[_0x8dbf('0x7b')]){ut[_0x8dbf('0x7c')](_0x1f202f,_0x8dbf('0xe7'));ut[_0x8dbf('0x7d')](_0x8dbf('0xe8')+_0x1f202f[_0x8dbf('0x20')],_0x3c1580);}_0x1f202f[_0x8dbf('0x3c')]+=0x1;_0x3c33a3[_0x8dbf('0xbb')]=ut[_0x8dbf('0x9e')](_0x3c33a3);ut[_0x8dbf('0x8c')](_0x3c33a3,0xc,_0x3c1580[_0x8dbf('0xe9')]||_0x3c1580[_0x8dbf('0xea')]);rpcDb[_0x8dbf('0x91')](_0x3c33a3,_0x8dbf('0xeb'));if(ut[_0x8dbf('0x9e')](_0x3c33a3)>=_0x1f202f[_0x8dbf('0xa2')]){_0x55b2b7=ut[_0x8dbf('0xa3')](_0x3c33a3,0xf,_0x8dbf('0xa4'));rpcDb[_0x8dbf('0x94')](_0x55b2b7,_0x8dbf('0xec'));}else{rpcDb['createCustomerFinal'](_0x3c33a3,_0x8dbf('0xec'));}delete this[_0x8dbf('0x6a')][_0x3c1580[_0x8dbf('0xe4')]];}if(!(_0x3c33a3[_0x8dbf('0x7b')]&&_0x556d21==='16')){ut['updateOriginated'](_0x1f202f,_0x8dbf('0xed'));logger[_0x8dbf('0x7f')](_0x8dbf('0xee'),_0x3c33a3[_0x8dbf('0xb8')],_0x8dbf('0xef'),_0x1f202f['name'],'originated:\x20',_0x1f202f[_0x8dbf('0x48')]);}if(_0x556d21!=='ANSWER'){delete this[_0x8dbf('0x6a')][_0x3c1580[_0x8dbf('0xe4')]];delete this[_0x8dbf('0x6a')][_0x3c1580[_0x8dbf('0xf0')]];}}};Preview[_0x8dbf('0xb')]['callProgressDetectingAgent']=function(_0x578590,_0x599544,_0x92418b){if(_[_0x8dbf('0xf1')](_0x599544)&&_0x8dbf('0xf2')!==typeof _0x599544){return;}if(_['isUndefined'](_0x92418b)&&_0x8dbf('0xf2')!==typeof _0x92418b){return;}switch(_0x92418b[_0x8dbf('0xf3')]){case'0':ut['logAgent'](_0x578590,0x0,_0x8dbf('0x9f'));rpcDb[_0x8dbf('0xf4')](_0x578590,_0x8dbf('0xf5'));break;case'3':ut[_0x8dbf('0xf6')](_0x578590,0x3,_0x8dbf('0xc5'));rpcDb[_0x8dbf('0xf4')](_0x578590,_0x8dbf('0xf7'));break;case'5':ut[_0x8dbf('0xf6')](_0x578590,0x5,_0x8dbf('0xbc'));rpcDb[_0x8dbf('0xf4')](_0x578590,'[callProgressDetectingAgent][logBusy]');break;case'8':ut[_0x8dbf('0xf6')](_0x578590,0x8,_0x8dbf('0xcf'));rpcDb[_0x8dbf('0xf4')](_0x578590,_0x8dbf('0xf8'));break;case'22':ut[_0x8dbf('0xf6')](_0x578590,0x16,_0x8dbf('0xf9'));rpcDb[_0x8dbf('0xf4')](_0x578590,_0x8dbf('0xfa'));break;default:ut['logAgent'](_0x578590,0xc,_0x92418b[_0x8dbf('0xf3')]);rpcDb[_0x8dbf('0xf4')](_0x578590,_0x8dbf('0xf8'));}ut[_0x8dbf('0x79')](_0x599544,_0x8dbf('0xfb'));logger[_0x8dbf('0x7f')](_0x8dbf('0xfc'),_0x578590[_0x8dbf('0xb8')],_0x8dbf('0xef'),_0x599544[_0x8dbf('0x20')],'originated:\x20',_0x599544[_0x8dbf('0x48')]);delete this[_0x8dbf('0x6a')][_0x578590[_0x8dbf('0xb8')]];};Preview[_0x8dbf('0xb')][_0x8dbf('0xfd')]=function(_0x48489d,_0xd69ae4,_0x178667,_0x18d4c3,_0x2b2f47){var _0x576d0a=this;return new BPromise(function(_0x5d15b1,_0x387804){if(_[_0x8dbf('0x84')](_0xd69ae4)||_[_0x8dbf('0x84')](_0xd69ae4[_0x8dbf('0xfe')])||_['isNil'](_0xd69ae4[_0x8dbf('0xfe')][_0x8dbf('0xff')])||_[_0x8dbf('0x84')](_0xd69ae4['VoiceQueueId'])){_0x387804(ut[_0x8dbf('0x47')](_0x8dbf('0x100'),_0x18d4c3,_0x2b2f47));return;}var _0x1850ab=uuid['v4']();var _0x3f713b=_0x576d0a[_0x8dbf('0x70')][_0xd69ae4[_0x8dbf('0x6c')][_0x8dbf('0x20')]];var _0x34f21a=_0x178667?_0x576d0a[_0x8dbf('0x11')][_0x178667]['id']:undefined;_0x576d0a['actions'][_0x1850ab]=new Action(_0xd69ae4,_0x3f713b,_0x1850ab,_0x178667,_0x34f21a);var _0x252045=_0x576d0a[_0x8dbf('0x6a')][_0x1850ab];_0x252045[_0x8dbf('0xa8')]=_0x18d4c3;_0x252045[_0x8dbf('0xa9')]=_0x2b2f47;_0x252045['lookAgent']=_0x178667;if(_[_0x8dbf('0x101')](_0x48489d)){_0x576d0a[_0x8dbf('0x102')](_0x252045,_0x3f713b,_0xd69ae4,_0x178667)['then'](function(_0x5a5165){logger[_0x8dbf('0x7f')](_0x8dbf('0x103'),_0x8dbf('0x104')+_0x252045['queue']+'\x20IdHopper:\x20'+_0x252045[_0x8dbf('0x105')],JSON[_0x8dbf('0x50')](_0x5a5165));ami[_0x8dbf('0x1e')](_0x8dbf('0x106'),ut[_0x8dbf('0xa1')](_0x252045,'called',_0x576d0a[_0x8dbf('0x70')][_0x252045[_0x8dbf('0x6d')]]));_0x5d15b1(ut[_0x8dbf('0x47')](_0x8dbf('0x107')));})[_0x8dbf('0x77')](function(_0x2dc7d6){ut[_0x8dbf('0x5b')](_0x8dbf('0x108'),_0x2dc7d6);_0x387804(ut[_0x8dbf('0x47')]('Call\x20failed',_0x18d4c3,_0x2b2f47));});}else{_0x3f713b[_0x8dbf('0x33')]+=0x1;ut[_0x8dbf('0x109')](_0x252045);rpcDb['createHistory'](_0x252045,_0x8dbf('0x10a'));delete _0x576d0a[_0x8dbf('0x6a')][_0x1850ab];_0x387804(ut[_0x8dbf('0x47')](_0x8dbf('0x10b'),_0x18d4c3,_0x2b2f47));}});};Preview['prototype']['isTrunkReachable']=function(_0x24114b){return!_[_0x8dbf('0x84')](_0x24114b)&&!_[_0x8dbf('0x84')](_0x24114b[_0x8dbf('0x20')])&&!_['isNil'](_0x24114b['active'])&&_0x24114b[_0x8dbf('0x4e')]&&!_[_0x8dbf('0x84')](this[_0x8dbf('0x10')][util[_0x8dbf('0x51')]('SIP/%s',_0x24114b[_0x8dbf('0x20')])])&&!_[_0x8dbf('0x84')](this[_0x8dbf('0x10')][util[_0x8dbf('0x51')](_0x8dbf('0x10c'),_0x24114b[_0x8dbf('0x20')])]['status'])&&(this[_0x8dbf('0x10')][util[_0x8dbf('0x51')]('SIP/%s',_0x24114b['name'])][_0x8dbf('0x75')]===_0x8dbf('0x10d')||this['trunks'][util['format'](_0x8dbf('0x10c'),_0x24114b[_0x8dbf('0x20')])]['status']==='unmonitored');};Preview[_0x8dbf('0xb')][_0x8dbf('0x10e')]=function(_0x21453c,_0x53d1ad){var _0x1a92ba=this;return new BPromise(function(_0x316569,_0x1dd806){_0x1a92ba[_0x8dbf('0x10f')](_0x21453c,_0x53d1ad)[_0x8dbf('0x83')](function(_0xba0761){_0x316569(_[_0x8dbf('0x71')](_0xba0761,['message']));})[_0x8dbf('0x77')](function(_0x1bb09f){if(_0x1bb09f[_0x8dbf('0x110')]){rpcDb[_0x8dbf('0x111')](_0x21453c);}if(_0x1bb09f[_0x8dbf('0x4e')]){rpcDb['disableContact'](_0x21453c);}_0x1dd806(_['pick'](_0x1bb09f,['message']));});});};Preview['prototype'][_0x8dbf('0x10f')]=function(_0x45e4b6,_0x2d1136){var _0x46a2ad=this;return new BPromise(function(_0x77587f,_0xe6f310){var _0x41e713,_0x308709;rpcDb['getContactPreview'](_0x45e4b6)['then'](function(_0x591c6e){if(!_[_0x8dbf('0x84')](_0x591c6e[0x0])){_0x308709=_0x591c6e[0x0][_0x8dbf('0x112')]?![]:!![];_0x41e713=_0x591c6e[0x0]['recallme']?!![]:![];_0x41e713=_0x2d1136?!![]:_0x41e713;}var _0x53885d=_0x46a2ad[_0x8dbf('0x113')](_0x591c6e);if(_0x53885d[_0x8dbf('0x114')]){rpcDb[_0x8dbf('0x115')](_['pick'](_0x591c6e[0x0],[_0x8dbf('0x73'),'Contact.phone']))[_0x8dbf('0x83')](function(_0x1e7a32){_0x46a2ad[_0x8dbf('0xfd')](_0x1e7a32,_0x591c6e[0x0],_0x2d1136,_0x308709,_0x41e713)['then'](function(_0x2466dc){_0x77587f(_0x2466dc);})[_0x8dbf('0x77')](function(_0x4998c6){_0xe6f310(_0x4998c6);});})[_0x8dbf('0x77')](function(_0x40254b){ut[_0x8dbf('0x5b')](_0x8dbf('0x116'),_0x40254b);_0xe6f310(ut[_0x8dbf('0x47')](_0x8dbf('0x117'),_0x308709,_0x41e713));});}else{_0xe6f310(ut[_0x8dbf('0x47')](_0x53885d[_0x8dbf('0x47')],_0x308709,_0x41e713));}})[_0x8dbf('0x77')](function(_0x328ade){ut['logger'](_0x8dbf('0x118'),_0x328ade);_0xe6f310(ut[_0x8dbf('0x47')]('Call\x20unsuccessful',![],!![]));});});};Preview['prototype'][_0x8dbf('0x113')]=function(_0x55f492){if(_['isNil'](_0x55f492)||_[_0x8dbf('0x101')](_0x55f492)||!_[_0x8dbf('0x84')](_0x55f492[0x0][_0x8dbf('0x86')])&&_[_0x8dbf('0x84')](_0x55f492[0x0]['Agent'][_0x8dbf('0x20')])){ut[_0x8dbf('0x5b')](_0x8dbf('0x119'),_0x55f492);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x859c62=this[_0x8dbf('0x70')][_0x55f492[0x0][_0x8dbf('0x6c')][_0x8dbf('0x20')]];_0x859c62[_0x8dbf('0x47')]=_0x8dbf('0x9b');if(_[_0x8dbf('0x84')](_0x859c62)){ut[_0x8dbf('0x5b')](_0x8dbf('0x11a'),_0x859c62);return{'isValid':![],'message':_0x8dbf('0x11b')};}if(!this[_0x8dbf('0x98')](_0x859c62[_0x8dbf('0x4d')])){ut[_0x8dbf('0x5b')](_0x8dbf('0x11c'),_0x8dbf('0x11d')+_0x859c62[_0x8dbf('0x20')]+'\x20Trunk\x20is\x20not\x20active');if(!this[_0x8dbf('0x98')](_0x859c62[_0x8dbf('0x99')])){ut['logger']('[Preview][validateContact][Trunk\x20not\x20work]',_0x859c62[_0x8dbf('0x20')]+_0x8dbf('0x11e'));return{'isValid':![],'message':'Trunk\x20not\x20work'};}}if(!ut['isActive'](_0x859c62[_0x8dbf('0x2d')])){ut[_0x8dbf('0x5b')](_0x8dbf('0x11f'),_0x859c62[_0x8dbf('0x20')]+_0x8dbf('0x120'));return{'isValid':![],'message':_0x8dbf('0x11d')+_0x859c62[_0x8dbf('0x20')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':_0x8dbf('0x121')};};Preview[_0x8dbf('0xb')][_0x8dbf('0x102')]=function(_0x230df6,_0x1a4876,_0x53e039,_0x1e0153){var _0x3d2479=this;return new BPromise(function(_0xcab0e,_0xe8eb62){var _0x20eef1=_0x230df6[_0x8dbf('0xb8')];var _0x3b9c59=_0x3d2479['isTrunkReachable'](_0x1a4876[_0x8dbf('0x4d')])?util['format'](_0x8dbf('0x122'),_0x1a4876[_0x8dbf('0x4d')]['name'],_['isNil'](_0x1a4876[_0x8dbf('0x30')])?'':_0x1a4876[_0x8dbf('0x30')][_0x8dbf('0x123')]()||'',_0x1a4876[_0x8dbf('0x124')]>0x0?_0x53e039[_0x8dbf('0xfe')]['phone'][_0x8dbf('0x125')](_0x1a4876[_0x8dbf('0x124')]):_0x53e039[_0x8dbf('0xfe')][_0x8dbf('0xff')]):util[_0x8dbf('0x51')](_0x8dbf('0x122'),_[_0x8dbf('0x84')](_0x1a4876[_0x8dbf('0x99')])?_0x1a4876[_0x8dbf('0x4d')][_0x8dbf('0x20')]:_0x1a4876[_0x8dbf('0x99')][_0x8dbf('0x20')],_[_0x8dbf('0x84')](_0x1a4876[_0x8dbf('0x30')])?'':_0x1a4876['dialPrefix']['trim']()||'',_0x1a4876[_0x8dbf('0x124')]>0x0?_0x53e039['Contact'][_0x8dbf('0xff')]['substring'](_0x1a4876[_0x8dbf('0x124')]):_0x53e039[_0x8dbf('0xfe')][_0x8dbf('0xff')]);var _0x55c39b=_0x3d2479['isTrunkReachable'](_0x1a4876[_0x8dbf('0x4d')])?ut['getCallerId'](_0x1a4876[_0x8dbf('0x4d')][_0x8dbf('0x126')],_0x1a4876[_0x8dbf('0x2e')],_0x1a4876[_0x8dbf('0x127')]>0x0?ut[_0x8dbf('0x128')](_0x1a4876[_0x8dbf('0x129')],_0x1a4876[_0x8dbf('0x127')]):_0x1a4876[_0x8dbf('0x129')]):ut['getCallerId'](_[_0x8dbf('0x84')](_0x1a4876[_0x8dbf('0x99')])?_0x1a4876[_0x8dbf('0x4d')]['callerid']:_0x1a4876['TrunkBackup']['callerid'],_0x1a4876[_0x8dbf('0x2e')],_0x1a4876['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x8dbf('0x128')](_0x1a4876[_0x8dbf('0x129')],_0x1a4876['dialRandomLastDigitCallerIdNumber']):_0x1a4876[_0x8dbf('0x129')]);if(_0x55c39b){_0x230df6['originatecalleridname']=ut[_0x8dbf('0x12a')](_0x55c39b);_0x230df6[_0x8dbf('0x12b')]=ut[_0x8dbf('0x12c')](_0x55c39b);}var _0x58369f=ut[_0x8dbf('0x12d')](_0x1a4876,_0x53e039,_0x3b9c59,_0x55c39b,_0x20eef1,_0x230df6);_[_0x8dbf('0x12e')](_0x230df6,ut['toLowerVariables'](_0x58369f));_0x230df6[_0x8dbf('0x12f')]=moment()[_0x8dbf('0x51')](_0x8dbf('0x8b'));ami[_0x8dbf('0x130')](ut[_0x8dbf('0x131')](_0x230df6,_0x1a4876,_0x58369f,_0x230df6[_0x8dbf('0xa9')],_0x1e0153))['then'](function(_0x1f3d49){var _0x374a36=_0x230df6[_0x8dbf('0x132')];if(!_['isNil'](_0x374a36)){if(!_[_0x8dbf('0x84')](_0x3d2479[_0x8dbf('0x11')][_0x374a36])){_0x3d2479[_0x8dbf('0x11')][_0x374a36][_0x8dbf('0x133')]=_0x230df6[_0x8dbf('0x134')];emit(util[_0x8dbf('0x51')](_0x8dbf('0x135'),_0x3d2479[_0x8dbf('0x11')][_0x374a36]['name']),'user:agentconnect',{'destaccountcode':_0x3d2479['agents'][_0x374a36][_0x8dbf('0x136')],'destconnectedlinenum':_0x230df6[_0x8dbf('0x134')]});}}_0x1a4876[_0x8dbf('0x48')]+=0x1;logger['info'](_0x8dbf('0x137'),_0x20eef1,_0x8dbf('0xef'),_0x1a4876[_0x8dbf('0x20')],_0x8dbf('0x6e'),_0x1a4876[_0x8dbf('0x48')]);_0xcab0e(_0x1f3d49);})[_0x8dbf('0x77')](function(_0x48a23f){ut[_0x8dbf('0xf6')](_0x230df6,0xe,_0x8dbf('0x138'));rpcDb[_0x8dbf('0xf4')](_0x230df6,_0x8dbf('0x139'));_0xe8eb62(_0x48a23f);});});};Preview[_0x8dbf('0xb')]['syncNewExten']=function(_0x8bce3){if(this[_0x8dbf('0x6a')][_0x8bce3['linkedid']]){this[_0x8dbf('0x6a')][_0x8bce3[_0x8dbf('0xe4')]][_0x8dbf('0x76')]=_0x8bce3[_0x8dbf('0x76')];}};Preview[_0x8dbf('0xb')][_0x8dbf('0x14')]=function(_0x36b78d){var _0x9a8c9e=this;var _0x160489=this['actions'][_0x36b78d[_0x8dbf('0x13a')]];if(_0x160489){if(_0x160489[_0x8dbf('0x13b')]&&this[_0x8dbf('0x11')][_0x160489[_0x8dbf('0x13b')]]){ut[_0x8dbf('0x13c')](_0x160489,this['agents'][_0x160489[_0x8dbf('0x13b')]][_0x8dbf('0x20')],this[_0x8dbf('0x11')][_0x160489[_0x8dbf('0x13b')]]['id']);}var _0x3eb6d8=_[_0x8dbf('0x13d')](_0x160489);_0x3eb6d8[_0x8dbf('0xab')]=moment()[_0x8dbf('0x51')](_0x8dbf('0x8b'));var _0x10b983=_0x9a8c9e[_0x8dbf('0x70')][_0x160489[_0x8dbf('0x6d')]];if(ut['isFailure'](_0x36b78d[_0x8dbf('0x13e')])){if(_0x160489[_0x8dbf('0xa8')]){rpcDb[_0x8dbf('0x111')](_0x160489[_0x8dbf('0x105')]);}if(_0x160489['activeContact']){rpcDb[_0x8dbf('0x8a')](_0x160489[_0x8dbf('0x105')]);}ami[_0x8dbf('0x1e')](_0x8dbf('0x13f'),ut[_0x8dbf('0xa1')](_0x160489,_0x8dbf('0x140'),this['campaignsPreview'][_0x160489[_0x8dbf('0x6d')]]));this[_0x8dbf('0x141')](_0x3eb6d8,_0x10b983,_0x36b78d);}else{_0x160489[_0x8dbf('0x12f')]=moment()[_0x8dbf('0x51')]('YYYY-MM-DD\x20HH:mm:ss');ut[_0x8dbf('0xf6')](_0x3eb6d8,0x4,_0x8dbf('0xb3'));rpcDb[_0x8dbf('0xf4')](_0x3eb6d8,_0x8dbf('0x142'));}}};Preview[_0x8dbf('0xb')][_0x8dbf('0x16')]=function(_0xa2130b){var _0x518f24=this;var _0x5ecee3=this[_0x8dbf('0x6a')][_0xa2130b['linkedid']];var _0x42e25e;if(_0x5ecee3){_0x42e25e=this['campaignsPreview'][_0x5ecee3[_0x8dbf('0x6d')]];logger[_0x8dbf('0x7f')](_0x8dbf('0x143'),_0xa2130b['linkedid'],_0x8dbf('0xef'),_0x42e25e[_0x8dbf('0x20')],_0x8dbf('0x6f'),_0x42e25e[_0x8dbf('0x24')]);}if(this[_0x8dbf('0x6a')][_0xa2130b['linkedid']]&&_0xa2130b[_0x8dbf('0xe4')]!==_0xa2130b[_0x8dbf('0xb8')]){if(_0xa2130b[_0x8dbf('0x144')]==='16'&&this[_0x8dbf('0x6a')][_0xa2130b[_0x8dbf('0xe4')]]['dialAnswer']){this[_0x8dbf('0x9c')](_0xa2130b,_0xa2130b[_0x8dbf('0xe4')],_0xa2130b[_0x8dbf('0x144')]);}else if(this['actions'][_0xa2130b['linkedid']]['dialAnswer']){logger[_0x8dbf('0x7f')]('[syncHangup][talking][cause]',_0xa2130b['linkedid'],_0xa2130b[_0x8dbf('0x144')],_0x8dbf('0xef'),_0x42e25e['name'],'pTalking:\x20',_0x42e25e[_0x8dbf('0x24')]);this['callProgressDetectingCustomer'](_0xa2130b,_0xa2130b[_0x8dbf('0xe4')],_0xa2130b[_0x8dbf('0x144')]);}}else if(_0x5ecee3&&_[_0x8dbf('0x84')](_0x5ecee3[_0x8dbf('0x145')])&&_0x42e25e[_0x8dbf('0x146')]&&_0xa2130b[_0x8dbf('0xe4')]===_0xa2130b[_0x8dbf('0xb8')]&&_['isNil'](_0xa2130b[_0x8dbf('0xf3')])&&_0xa2130b[_0x8dbf('0x144')]==='16'&&_0xa2130b[_0x8dbf('0x147')]==='6'&&_[_0x8dbf('0xf1')](_0x5ecee3['transfer'])){if(_0x5ecee3[_0x8dbf('0xa8')]){rpcDb['unlockContact'](_0x5ecee3[_0x8dbf('0x105')]);}if(_0x5ecee3[_0x8dbf('0xa9')]){rpcDb[_0x8dbf('0x8a')](_0x5ecee3[_0x8dbf('0x105')]);}_0xa2130b[_0x8dbf('0xf3')]='22';this[_0x8dbf('0x141')](_0x5ecee3,_0x42e25e,_0xa2130b);}else if(_0x5ecee3&&_0x5ecee3[_0x8dbf('0x148')]){if(_0xa2130b[_0x8dbf('0x144')]==='16'&&this[_0x8dbf('0x6a')][_0xa2130b[_0x8dbf('0xe4')]][_0x8dbf('0x7b')]){logger[_0x8dbf('0x7f')]('[syncHangup][talking][transfer]',_0xa2130b[_0x8dbf('0xe4')],_0xa2130b[_0x8dbf('0x144')],'\x20Queue',_0x42e25e[_0x8dbf('0x20')],_0x8dbf('0x6f'),_0x42e25e[_0x8dbf('0x24')]);this[_0x8dbf('0x9c')](_0xa2130b,_0xa2130b[_0x8dbf('0xe4')],_0xa2130b[_0x8dbf('0x144')]);}else if(this[_0x8dbf('0x6a')][_0xa2130b['linkedid']][_0x8dbf('0x7b')]){logger[_0x8dbf('0x7f')](_0x8dbf('0x149'),_0xa2130b[_0x8dbf('0xe4')],_0xa2130b[_0x8dbf('0x144')],_0x8dbf('0xef'),_0x42e25e[_0x8dbf('0x20')],'pTalking:\x20',_0x42e25e[_0x8dbf('0x24')]);this[_0x8dbf('0x9c')](_0xa2130b,_0xa2130b[_0x8dbf('0xe4')],_0xa2130b[_0x8dbf('0x144')]);}}};Preview[_0x8dbf('0xb')][_0x8dbf('0x14a')]=function(_0x455480){if(this[_0x8dbf('0x6a')][_0x455480[_0x8dbf('0xf0')]]&&_0x455480[_0x8dbf('0xf0')]!==_0x455480[_0x8dbf('0x14b')]){this[_0x8dbf('0x9c')](_0x455480,_0x455480['destlinkedid'],_0x455480[_0x8dbf('0xea')]);}};Preview[_0x8dbf('0xb')][_0x8dbf('0x14c')]=function(_0x207da7){if(this[_0x8dbf('0x6a')][_0x207da7[_0x8dbf('0xe4')]]&&_0x207da7[_0x8dbf('0xe4')]!==_0x207da7[_0x8dbf('0xb8')]&&!this[_0x8dbf('0x6a')][_0x207da7[_0x8dbf('0xe4')]][_0x8dbf('0x7b')]){if(_0x207da7[_0x8dbf('0x144')]==='1'){this[_0x8dbf('0x9c')](_0x207da7,_0x207da7[_0x8dbf('0xe4')],_0x207da7['cause']);}}};Preview[_0x8dbf('0xb')][_0x8dbf('0x14d')]=function(_0x4cb8eb,_0x48eedf,_0xd13474){if(this['actions'][_0x4cb8eb]){if(_[_0x8dbf('0x84')](this['actions'][_0x4cb8eb]['variables'])){this[_0x8dbf('0x6a')][_0x4cb8eb][_0x8dbf('0x14e')]={};}this[_0x8dbf('0x6a')][_0x4cb8eb][_0x8dbf('0x14e')][_0x48eedf]=_0xd13474;}};Preview[_0x8dbf('0xb')][_0x8dbf('0x14f')]=function(_0x25d397){try{if(!_[_0x8dbf('0x84')](_0x25d397)){if(ut[_0x8dbf('0x150')](_[_0x8dbf('0x151')](_0x25d397[_0x8dbf('0x152')])[0x0])){this['addVariable'](_0x25d397[_0x8dbf('0xb8')],_[_0x8dbf('0x151')](_0x25d397['variable'])[0x0],_0x25d397[_0x8dbf('0x153')]);}}}catch(_0x162945){logger['error'](_0x8dbf('0x154'),util['inspect'](_0x162945,{'showHidden':![],'depth':null}));}};Preview[_0x8dbf('0xb')][_0x8dbf('0x1c')]=function(_0x49ee92){if(_0x49ee92){if(this['actions'][_0x49ee92['transfertargetlinkedid']]){this[_0x8dbf('0x6a')][_0x49ee92[_0x8dbf('0x155')]]['transfer']=!![];}}};Preview[_0x8dbf('0xb')][_0x8dbf('0x1d')]=function(_0x2f2f40){if(_0x2f2f40){if(this['actions'][_0x2f2f40[_0x8dbf('0x156')]]){this[_0x8dbf('0x6a')][_0x2f2f40[_0x8dbf('0x156')]][_0x8dbf('0x148')]=!![];}}};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 5b87ccc..e79d956 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 _0x834a=['checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerFinal','rescheduleContact','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','answertime','queuecallercomplete','queuecallercompleteAt','connectedlinename','membername','context','from-sip','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','error','inspect','resolve','then','createHistory','[createHistory]\x20','catch','[moveContactManagedDialer]\x20'];(function(_0x3aabb4,_0x3d20d2){var _0x4281a6=function(_0x4cb805){while(--_0x4cb805){_0x3aabb4['push'](_0x3aabb4['shift']());}};_0x4281a6(++_0x3d20d2);}(_0x834a,0x9d));var _0xa834=function(_0x427189,_0x2b9b30){_0x427189=_0x427189-0x0;var _0x5e33ba=_0x834a[_0x427189];return _0x5e33ba;};'use strict';var util=require(_0xa834('0x0'));var BPromise=require(_0xa834('0x1'));var logger=require(_0xa834('0x2'))('preview');var _=require(_0xa834('0x3'));var cmHopper=require(_0xa834('0x4'));var cmHopperFinal=require(_0xa834('0x5'));var cmHopperHistory=require(_0xa834('0x6'));var cmHopperBlack=require(_0xa834('0x7'));var voiceQueueRt=require(_0xa834('0x8'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x4ab96c){return function(_0x4bb722){logger[_0xa834('0x9')](_0x4ab96c,util[_0xa834('0xa')](_0x4bb722,{'showHidden':![],'depth':null}));};}function create(_0x2a68e2){return BPromise[_0xa834('0xb')]()[_0xa834('0xc')](cmHopperHistory[_0xa834('0xd')](_0x2a68e2))['catch'](loggerCatch('[createHistory]\x20'));}function createAgent(_0x4c9667){return BPromise[_0xa834('0xb')]()[_0xa834('0xc')](agentReportPreview['createHistory'](_0x4c9667))['catch'](loggerCatch(_0xa834('0xe')));}function moveContact(_0x2fe9fe){return BPromise[_0xa834('0xb')]()['then'](cmHopper['moveContactManagedDialer'](_0x2fe9fe,!![]))[_0xa834('0xf')](loggerCatch(_0xa834('0x10')));}exports[_0xa834('0x11')]=function(_0x1791fc){return BPromise[_0xa834('0xb')]()[_0xa834('0xc')](cmHopperBlack[_0xa834('0x11')](_0x1791fc))[_0xa834('0xf')](loggerCatch(_0xa834('0x12')));};exports[_0xa834('0x13')]=function(_0xa9723d){return BPromise[_0xa834('0xb')]()[_0xa834('0xc')](cmHopper[_0xa834('0x13')](_0xa9723d))[_0xa834('0xf')](loggerCatch(_0xa834('0x14')));};exports[_0xa834('0xd')]=function(_0x5bbcea,_0x51ed3e){create(_0x5bbcea)[_0xa834('0xf')](loggerCatch(_0x51ed3e));moveContact(_0x5bbcea)['catch'](loggerCatch(_0x51ed3e));};exports[_0xa834('0x15')]=function(_0x2c91b0,_0x50ab5e){createAgent(_0x2c91b0)[_0xa834('0xf')](loggerCatch(_0x50ab5e));};exports['createCustomerHistory']=function(_0x16e840,_0x3f9491){create(_0x16e840)['catch'](loggerCatch(_0x3f9491));};exports[_0xa834('0x16')]=function(_0x449987,_0x4406b2){moveContact(_0x449987)['catch'](loggerCatch(_0x4406b2));};exports[_0xa834('0x17')]=function(_0x3d0583,_0x1e04b4,_0x420d27){if(_0x1e04b4){_0x3d0583['UserId']=null;}if(_0x420d27){_0x3d0583['active']=![];}return BPromise[_0xa834('0xb')]()[_0xa834('0xc')](cmHopper[_0xa834('0x17')](_0x3d0583))[_0xa834('0xf')](loggerCatch(_0xa834('0x18')));};exports[_0xa834('0x19')]=function(_0x317af3){return BPromise['resolve']()['then'](cmHopper['countReScheduled'](_0x317af3))['catch'](loggerCatch(_0xa834('0x1a')));};exports[_0xa834('0x1b')]=function(_0x55ca3e){return BPromise[_0xa834('0xb')]()[_0xa834('0xc')](cmHopper['unlockContact']({'UserId':null},_0x55ca3e,0x1))[_0xa834('0xf')](loggerCatch(_0xa834('0x1c')));};exports['disableContact']=function(_0x3d628f){return BPromise[_0xa834('0xb')]()['then'](cmHopper['unlockContact']({'active':![]},_0x3d628f,0x1))['catch'](loggerCatch(_0xa834('0x1d')));};exports[_0xa834('0x1e')]=function(_0x1d2adf){var _0x1c03f7={};_0x1c03f7[_0xa834('0x1f')]=_0x1d2adf[_0xa834('0x1f')];_0x1c03f7[_0xa834('0x20')]=_0x1d2adf['uniqueid'];_0x1c03f7[_0xa834('0x21')]=_0x1d2adf[_0xa834('0x21')];_0x1c03f7[_0xa834('0x22')]=_0x1d2adf[_0xa834('0x22')];_0x1c03f7['queue']=_0x1d2adf[_0xa834('0x23')];_0x1c03f7[_0xa834('0x24')]=_0x1d2adf['answertime'];_0x1c03f7[_0xa834('0x25')]=_0x1d2adf[_0xa834('0x26')];_0x1c03f7[_0xa834('0x27')]=0x1;_0x1c03f7[_0xa834('0x28')]=_0x1d2adf['endtime'];_0x1c03f7[_0xa834('0x29')]=_0x1d2adf[_0xa834('0x2a')];_0x1c03f7[_0xa834('0x2b')]=_0xa834('0x2c');_0x1c03f7[_0xa834('0x2d')]=_0xa834('0x2e');_0x1c03f7[_0xa834('0x2f')]=0x0;_0x1c03f7[_0xa834('0x30')]=0x1;_0x1c03f7[_0xa834('0x31')]=_0x1d2adf[_0xa834('0x2a')];_0x1c03f7[_0xa834('0x32')]=_0xa834('0x33');return BPromise[_0xa834('0xb')]()[_0xa834('0xc')](voiceQueueReport[_0xa834('0x34')](_0x1c03f7))[_0xa834('0xf')](loggerCatch(_0xa834('0x35')));};exports[_0xa834('0x36')]=function(_0x487e28,_0x206239){return BPromise[_0xa834('0xb')]()[_0xa834('0xc')](cmHopper[_0xa834('0x36')](_0x487e28,_0x206239))[_0xa834('0xf')](loggerCatch(_0xa834('0x37')));};exports[_0xa834('0x38')]=function(_0x5df7cc){return BPromise[_0xa834('0xb')]()[_0xa834('0xc')](cmHopper['rescheduleContact'](_0x5df7cc,!![],!![]))[_0xa834('0xf')](loggerCatch(_0xa834('0x39')));}; \ No newline at end of file +var _0x429c=['type','uniqueid','calleridnum','calleridname','queuecallerjoinAt','queuecallerleaveAt','endtime','membername','context','from-sip','xcally-motion-preview','holdtime','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','bluebird','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/voiceQueueReport','error','inspect','resolve','catch','[createHistory]\x20','then','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerFinal','rescheduleContact','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','disableContact','[activeContact]\x20','crateCustomerReportQueue'];(function(_0x1382be,_0x49bc15){var _0x1cdb85=function(_0x5b14cc){while(--_0x5b14cc){_0x1382be['push'](_0x1382be['shift']());}};_0x1cdb85(++_0x49bc15);}(_0x429c,0x147));var _0xc429=function(_0x521134,_0x22ebad){_0x521134=_0x521134-0x0;var _0x523c1c=_0x429c[_0x521134];return _0x523c1c;};'use strict';var util=require('util');var BPromise=require(_0xc429('0x0'));var logger=require(_0xc429('0x1'))(_0xc429('0x2'));var _=require(_0xc429('0x3'));var cmHopper=require(_0xc429('0x4'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0xc429('0x5'));var cmHopperBlack=require(_0xc429('0x6'));var voiceQueueRt=require(_0xc429('0x7'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0xc429('0x8'));function loggerCatch(_0x4f1f11){return function(_0x2e0122){logger[_0xc429('0x9')](_0x4f1f11,util[_0xc429('0xa')](_0x2e0122,{'showHidden':![],'depth':null}));};}function create(_0x28717e){return BPromise[_0xc429('0xb')]()['then'](cmHopperHistory['createHistory'](_0x28717e))[_0xc429('0xc')](loggerCatch(_0xc429('0xd')));}function createAgent(_0x549613){return BPromise['resolve']()[_0xc429('0xe')](agentReportPreview['createHistory'](_0x549613))[_0xc429('0xc')](loggerCatch(_0xc429('0xd')));}function moveContact(_0x6d5080){return BPromise[_0xc429('0xb')]()[_0xc429('0xe')](cmHopper['moveContactManagedDialer'](_0x6d5080,!![]))[_0xc429('0xc')](loggerCatch('[moveContactManagedDialer]\x20'));}exports['checkIsBlackList']=function(_0x3999b8){return BPromise[_0xc429('0xb')]()[_0xc429('0xe')](cmHopperBlack[_0xc429('0xf')](_0x3999b8))[_0xc429('0xc')](loggerCatch(_0xc429('0x10')));};exports['getContactPreview']=function(_0x53673f){return BPromise[_0xc429('0xb')]()[_0xc429('0xe')](cmHopper[_0xc429('0x11')](_0x53673f))[_0xc429('0xc')](loggerCatch(_0xc429('0x12')));};exports['createHistory']=function(_0x8ec1b,_0x2ef499){create(_0x8ec1b)['catch'](loggerCatch(_0x2ef499));moveContact(_0x8ec1b)['catch'](loggerCatch(_0x2ef499));};exports[_0xc429('0x13')]=function(_0x4d9cfa,_0x4079eb){createAgent(_0x4d9cfa)[_0xc429('0xc')](loggerCatch(_0x4079eb));};exports['createCustomerHistory']=function(_0x3773c3,_0x25a300){create(_0x3773c3)[_0xc429('0xc')](loggerCatch(_0x25a300));};exports[_0xc429('0x14')]=function(_0x2000a2,_0x2f6ccb){moveContact(_0x2000a2)[_0xc429('0xc')](loggerCatch(_0x2f6ccb));};exports[_0xc429('0x15')]=function(_0x77f80,_0x36a207,_0x51c047){if(_0x36a207){_0x77f80['UserId']=null;}if(_0x51c047){_0x77f80[_0xc429('0x16')]=![];}return BPromise[_0xc429('0xb')]()['then'](cmHopper[_0xc429('0x15')](_0x77f80))[_0xc429('0xc')](loggerCatch(_0xc429('0x17')));};exports[_0xc429('0x18')]=function(_0x3f91d0){return BPromise['resolve']()[_0xc429('0xe')](cmHopper[_0xc429('0x18')](_0x3f91d0))['catch'](loggerCatch(_0xc429('0x19')));};exports['unlockContact']=function(_0x4c9633){return BPromise[_0xc429('0xb')]()[_0xc429('0xe')](cmHopper[_0xc429('0x1a')]({'UserId':null},_0x4c9633,0x1))[_0xc429('0xc')](loggerCatch('[unlockContact]\x20'));};exports[_0xc429('0x1b')]=function(_0x4fbc4a){return BPromise[_0xc429('0xb')]()['then'](cmHopper[_0xc429('0x1a')]({'active':![]},_0x4fbc4a,0x1))[_0xc429('0xc')](loggerCatch(_0xc429('0x1c')));};exports[_0xc429('0x1d')]=function(_0x43f663){var _0xcf1470={};_0xcf1470[_0xc429('0x1e')]=_0x43f663[_0xc429('0x1e')];_0xcf1470['uniqueid']=_0x43f663[_0xc429('0x1f')];_0xcf1470[_0xc429('0x20')]=_0x43f663['calleridnum'];_0xcf1470[_0xc429('0x21')]=_0x43f663[_0xc429('0x21')];_0xcf1470['queue']=_0x43f663['queue'];_0xcf1470[_0xc429('0x22')]=_0x43f663['answertime'];_0xcf1470[_0xc429('0x23')]=_0x43f663['answertime'];_0xcf1470['queuecallercomplete']=0x1;_0xcf1470['queuecallercompleteAt']=_0x43f663[_0xc429('0x24')];_0xcf1470['connectedlinename']=_0x43f663[_0xc429('0x25')];_0xcf1470[_0xc429('0x26')]=_0xc429('0x27');_0xcf1470['exten']=_0xc429('0x28');_0xcf1470[_0xc429('0x29')]=0x0;_0xcf1470[_0xc429('0x2a')]=0x1;_0xcf1470[_0xc429('0x2b')]=_0x43f663[_0xc429('0x25')];_0xcf1470[_0xc429('0x2c')]=_0xc429('0x2d');return BPromise[_0xc429('0xb')]()[_0xc429('0xe')](voiceQueueReport[_0xc429('0x2e')](_0xcf1470))[_0xc429('0xc')](loggerCatch(_0xc429('0x2f')));};exports['getContactRecallMe']=function(_0x3fdfd1,_0x32dce7){return BPromise[_0xc429('0xb')]()[_0xc429('0xe')](cmHopper['getContactRecallMe'](_0x3fdfd1,_0x32dce7))[_0xc429('0xc')](loggerCatch(_0xc429('0x30')));};exports[_0xc429('0x31')]=function(_0xaf4073){return BPromise[_0xc429('0xb')]()['then'](cmHopper[_0xc429('0x15')](_0xaf4073,!![],!![]))[_0xc429('0xc')](loggerCatch(_0xc429('0x32')));}; \ 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 80f9cdf..6c9627c 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 _0xdec8=['string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isNil','addVariables','Queue','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','dialQueueProject2','U(xcally-mixmonitor-context)','dialQueueProject','NONE','\x22agi://%s/square,%s\x22','originatecalleridnum','originatecalleridname','xcally-motion-preview','monitor_format','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','updatedAt','%s%s','XMD-','toUpper','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','logAgent','ringtime','logLookAgent','membername','UserId','logCustomer','responsetime','endtime','talktime','answertime','isFailure','RECALL','BOOKED','uniqueid','originate','channelAgent','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','scheduledAt','active','add','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','lastevent','interface','voice','mandatoryDisposition','buildAcw','queue','not_inuse','status','reachable','push','getDiff','createBody','CampaignId','filterKey','idContact','campaigntype','dialAnswer','countglobal','callback','callbackuniqueid','callbackat','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-cdrtype','xmd-callerid','xmd-agi','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosrttbridged','rtpaudioqosbridged','rtpaudioqosloss','rtpaudioqoslossbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','match','extractCalleridNumber','util','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','loggerCatch','error','inspect','info','loggerError','logger2','message','getCallerId','isUndefined'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xdec8,0x10c));var _0x8dec=function(_0x3de8a4,_0x289a5c){_0x3de8a4=_0x3de8a4-0x0;var _0x4635cf=_0xdec8[_0x3de8a4];return _0x4635cf;};'use strict';var util=require(_0x8dec('0x0'));var _=require('lodash');var moment=require('moment');var logger=require(_0x8dec('0x1'))(_0x8dec('0x2'));var ipAgi=process[_0x8dec('0x3')][_0x8dec('0x4')]||_0x8dec('0x5');function getSeconds(_0x2156ff,_0x2336cf){var _0x1bb590=moment(_0x2156ff)[_0x8dec('0x6')](0x0);var _0x55d909=moment(_0x2336cf)['milliseconds'](0x0);return _0x1bb590[_0x8dec('0x7')](_0x55d909,_0x8dec('0x8'));}exports[_0x8dec('0x9')]=function(_0x4507d8){return function(_0x273c6f){logger[_0x8dec('0xa')](_0x4507d8,util[_0x8dec('0xb')](_0x273c6f,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x3c77bf,_0x317d46){logger[_0x8dec('0xc')](_0x3c77bf,util['inspect'](_0x317d46,{'showHidden':![],'depth':null}));};exports[_0x8dec('0xd')]=function(_0x1b7f0c,_0x398407){logger[_0x8dec('0xa')](_0x1b7f0c,util[_0x8dec('0xb')](_0x398407,{'showHidden':![],'depth':null}));};exports[_0x8dec('0xe')]=function(_0x550f09){return function(_0x512f22){logger[_0x8dec('0xc')](_0x550f09,util[_0x8dec('0xb')](_0x512f22,{'showHidden':![],'depth':null}));};};exports[_0x8dec('0xf')]=function(_0x461c8d,_0x2fbf12,_0x4fd9a6){return{'message':_0x461c8d,'unlock':_0x2fbf12,'active':_0x4fd9a6};};exports[_0x8dec('0x10')]=function(_0x29f002,_0x17a809,_0x21425e){if(!_[_0x8dec('0x11')](_0x21425e)&&_0x8dec('0x12')===typeof _0x21425e&&!_[_0x8dec('0x13')](_0x21425e)){if(!_[_0x8dec('0x11')](_0x17a809)&&_0x8dec('0x12')===typeof _0x17a809&&!_[_0x8dec('0x13')](_0x17a809)){return util[_0x8dec('0x14')](_0x8dec('0x15'),_0x17a809,_0x21425e);}return util['format'](_0x8dec('0x15'),_0x21425e,_0x21425e);}if(!_['isUndefined'](_0x29f002)&&_0x8dec('0x12')===typeof _0x29f002&&!_[_0x8dec('0x13')](_0x29f002)){return _0x29f002;}return _0x8dec('0x16');};exports['isActive']=function(_0x462fe6){if(_[_0x8dec('0x17')](_0x462fe6)){return![];}return _0x462fe6;};exports[_0x8dec('0x18')]=function(_0x39d0a1,_0x2b14a5,_0x4424c0,_0x5395a4,_0x335d76,_0x13186d){var _0x3b30ce={'XMD-QUEUE':_0x2b14a5[_0x8dec('0x19')]?_0x2b14a5[_0x8dec('0x19')]['name']:'','XMD-CALLERID':_0x5395a4,'XMD-CALLERID-PREVIEW':_0x13186d?util[_0x8dec('0x14')](_0x8dec('0x15'),_0x13186d[_0x8dec('0x1a')],_0x13186d[_0x8dec('0x1b')]):_0x5395a4,'XMD-DIALID':_0x335d76,'XMD-CONTACTID':_0x2b14a5[_0x8dec('0x1c')],'XMD-CDRTYPE':_0x8dec('0x1d'),'CALLERID(all)':_0x5395a4,'XMD-VOICEQUEUEID':_0x2b14a5[_0x8dec('0x1e')],'XMD-DIALCHANNEL':_0x4424c0,'XMD-DIALTIMEOUT':_0x39d0a1[_0x8dec('0x1f')]||0x1e,'XMD-DIALOPTIONS':util[_0x8dec('0x14')]('\x22rtTxX%s%s\x22',_0x39d0a1[_0x8dec('0x20')]?'g':'',_[_0x8dec('0x13')](_0x39d0a1['monitor_format'])?'':_0x8dec('0x21')),'XMD-DIALURL':_0x39d0a1['dialPreviewUrl']||'','XMD-AGI':_0x39d0a1[_0x8dec('0x22')]?util[_0x8dec('0x14')]('\x22agi://%s/square,%s\x22',ipAgi,_0x39d0a1['dialQueueProject']):_0x8dec('0x23'),'XMD-AGIAFTER':_0x39d0a1['dialQueueProject2']?util[_0x8dec('0x14')](_0x8dec('0x24'),ipAgi,_0x39d0a1['dialQueueProject2']):_0x8dec('0x23'),'XMD-ORIGINATECALLERIDNUM':_0x13186d?_0x13186d[_0x8dec('0x25')]:'','XMD-ORIGINATECALLERIDNAME':_0x13186d?_0x13186d[_0x8dec('0x26')]:'','XMD-DESTINATION':_0x8dec('0x27')};if(!_[_0x8dec('0x13')](_0x39d0a1[_0x8dec('0x28')])){_0x3b30ce[util[_0x8dec('0x14')]('%s',_0x8dec('0x29'))]=_0x39d0a1[_0x8dec('0x28')];_0x3b30ce[util[_0x8dec('0x14')]('%s',_0x8dec('0x2a'))]=_0x335d76;}if(_0x2b14a5&&_0x2b14a5[_0x8dec('0x2b')]){for(var _0x5a0e08 in _0x2b14a5['Contact']){if(_0x2b14a5[_0x8dec('0x2b')][_0x8dec('0x2c')](_0x5a0e08)){if(!_['isNil'](_0x2b14a5[_0x8dec('0x2b')][_0x5a0e08])&&_0x5a0e08!=='id'&&_0x5a0e08!==_0x8dec('0x2d')&&_0x5a0e08!=='createdAt'&&_0x5a0e08!==_0x8dec('0x2e')){_0x3b30ce[util[_0x8dec('0x14')](_0x8dec('0x2f'),_0x8dec('0x30'),_[_0x8dec('0x31')](_0x5a0e08))]=_0x2b14a5[_0x8dec('0x2b')][_0x5a0e08];}}}}return _0x3b30ce;};exports['toLowerVariables']=function(_0x4cea3a){var _0xe04fba={};for(var _0x4d2416 in _0x4cea3a){if(_0x4cea3a[_0x8dec('0x2c')](_0x4d2416)){_0xe04fba[util[_0x8dec('0x14')]('%s',_['toLower'](_0x4d2416))]=_0x4cea3a[_0x4d2416];}}return{'variables':_0xe04fba};};exports[_0x8dec('0x32')]=function(_0x1235c9,_0x32f784){if(!_[_0x8dec('0x17')](_0x1235c9)){if(_0x1235c9[_0x8dec('0x2c')](_0x8dec('0x33'))){if(_0x1235c9[_0x8dec('0x33')]>0x0){_0x1235c9[_0x8dec('0x33')]-=0x1;}else{logger['error'](_0x8dec('0x34'),_0x32f784);}}}else{logger[_0x8dec('0xa')](_0x8dec('0x35'),_0x32f784);}};exports[_0x8dec('0x36')]=function(_0x310e0e){var _0x582c6d=moment()[_0x8dec('0x14')](_0x8dec('0x37'));_0x310e0e[_0x8dec('0x38')]=0xd;_0x310e0e[_0x8dec('0x39')]=_0x8dec('0x3a');_0x310e0e[_0x8dec('0x3b')]=_0x582c6d;_0x310e0e['responsetime']=_0x582c6d;_0x310e0e['endtime']=_0x582c6d;};exports[_0x8dec('0x3c')]=function(_0x3c7297,_0x544fb8,_0x2d23ed){var _0x1cf200=moment()[_0x8dec('0x14')](_0x8dec('0x37'));_0x3c7297[_0x8dec('0x38')]=_0x544fb8;_0x3c7297[_0x8dec('0x39')]=_0x2d23ed;_0x3c7297['responsetime']=_0x1cf200;_0x3c7297[_0x8dec('0x3d')]=getSeconds(_0x3c7297['responsetime'],_0x3c7297[_0x8dec('0x3b')]);};exports[_0x8dec('0x3e')]=function(_0xbfea93,_0x2ef086,_0xcc6043){_0xbfea93[_0x8dec('0x3f')]=_0x2ef086;_0xbfea93[_0x8dec('0x40')]=_0xcc6043;};exports[_0x8dec('0x41')]=function(_0x458d10,_0x1dd825,_0x516c21){var _0x594543=moment()['format'](_0x8dec('0x37'));_0x458d10[_0x8dec('0x38')]=_0x1dd825;_0x458d10['statedesc']=_0x516c21;_0x458d10['responsetime']=_0x458d10[_0x8dec('0x42')]?_0x458d10[_0x8dec('0x42')]:_0x594543;_0x458d10[_0x8dec('0x43')]=_0x458d10[_0x8dec('0x43')]?_0x458d10['endtime']:_0x594543;_0x458d10['ringtime']=getSeconds(_0x458d10['responsetime']||0x0,_0x458d10[_0x8dec('0x3b')]||0x0);_0x458d10[_0x8dec('0x44')]=_0x458d10[_0x8dec('0x45')]?getSeconds(_0x458d10['endtime'],_0x458d10[_0x8dec('0x45')]):0x0;};exports[_0x8dec('0x46')]=function(_0x5b8f15){return _0x5b8f15==='Failure';};exports['variablesAction']=function(_0x2ce18d,_0xbb6ef7,_0x900465,_0x416b83,_0x419d26){var _0x269c0d=_0x416b83?_0x8dec('0x47'):_0x2ce18d[_0x8dec('0x1a')];_0x269c0d=_0x419d26?_0x8dec('0x48'):_0x269c0d;return{'actionid':_0x2ce18d[_0x8dec('0x49')],'action':_0x8dec('0x4a'),'channel':_0x2ce18d[_0x8dec('0x4b')],'callerid':util['format'](_0x8dec('0x15'),_0x269c0d,_0x2ce18d[_0x8dec('0x1b')]),'Exten':_0x8dec('0x27'),'Context':_0x8dec('0x4c'),'Priority':'1','variable':_0x900465,'timeout':(_0xbb6ef7[_0x8dec('0x4d')]||0x1e)*0x3e8,'async':!![],'channelid':_0x2ce18d[_0x8dec('0x49')]};};exports[_0x8dec('0x4e')]=function(_0x365ce7){return _0x365ce7[_0x8dec('0x4f')]+_0x365ce7[_0x8dec('0x50')]+_0x365ce7[_0x8dec('0x51')]+_0x365ce7[_0x8dec('0x52')]+_0x365ce7[_0x8dec('0x53')];};exports[_0x8dec('0x54')]=function(_0x487a5a){var _0x52d4f4=_[_0x8dec('0x55')](_0x487a5a);_0x52d4f4[_0x8dec('0x38')]=0xf;_0x52d4f4['statedesc']='Global';return _0x52d4f4;};exports[_0x8dec('0x56')]=function(_0x4d9117,_0x34bae3,_0x22271a){var _0x9a1400={};_0x9a1400[_0x34bae3]=_0x4d9117[_0x34bae3];_0x9a1400[_0x8dec('0x57')]=![];_0x9a1400['scheduledat']=moment()[_0x8dec('0x58')](_0x22271a,'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss');_0x9a1400[_0x8dec('0x1c')]=_0x4d9117['ContactId'];_0x9a1400[_0x8dec('0x59')]=_0x4d9117[_0x8dec('0x59')];_0x9a1400[_0x8dec('0x1e')]=_0x4d9117[_0x8dec('0x1e')]||undefined;return _0x9a1400;};exports[_0x8dec('0x5a')]=function(_0x14a723,_0x521104){if(!_['isNil'](_0x14a723)){if(_0x14a723[_0x8dec('0x5b')]>0x0){_0x14a723[_0x8dec('0x5b')]-=0x1;}else{logger['error'](_0x521104,_0x8dec('0x5c'));}}else{logger[_0x8dec('0xa')](_0x521104,_0x8dec('0x5d'));}};exports[_0x8dec('0x5e')]=function(_0x40ac7c){if(_0x40ac7c<=0x0){return!![];}return![];};exports[_0x8dec('0x5f')]=function(_0x252202,_0xdbda5f,_0x202275){_0x252202[_0x8dec('0x60')]=_0xdbda5f;_0x252202['name']=_0x252202['queue'];_0x252202[_0x8dec('0x61')]=_0x252202['channelAgent'];_0x252202['motionChannel']=_0x8dec('0x62');if(_0x202275){_0x252202[_0x8dec('0x63')]=_0x202275[_0x8dec('0x63')];}return _0x252202;};exports[_0x8dec('0x64')]=function(_0xe29ea1){var _0x195de0={};_0x195de0[_0x8dec('0x65')]=_0xe29ea1[_0x8dec('0x65')];_0x195de0[_0x8dec('0x61')]=_0xe29ea1[_0x8dec('0x4b')];_0x195de0[_0x8dec('0x49')]=_0xe29ea1[_0x8dec('0x49')];return _0x195de0;};exports['agentReadyId']=function(_0x44570e){var _0x5975cf=[];for(var _0x29ef69 in _0x44570e){if(_0x44570e[_0x8dec('0x2c')](_0x29ef69)){if(!_[_0x8dec('0x17')](_0x44570e[_0x29ef69])&&_0x44570e[_0x29ef69]['state']===_0x8dec('0x66')&&_0x44570e[_0x29ef69][_0x8dec('0x67')]===_0x8dec('0x68')){_0x5975cf[_0x8dec('0x69')](_0x44570e[_0x29ef69]['id']);}}}return _0x5975cf;};exports[_0x8dec('0x6a')]=function(_0x4daa60){var _0x6c556a=moment()[_0x8dec('0x6')](0x0);var _0xd9a04d=moment(_0x4daa60)[_0x8dec('0x6')](0x0);return _0x6c556a[_0x8dec('0x7')](_0xd9a04d,'seconds');};exports[_0x8dec('0x6b')]=function(_0x38e300){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x38e300['ContactId'],'ListId':_0x38e300[_0x8dec('0x59')],'VoiceQueueId':_0x38e300[_0x8dec('0x1e')]||undefined,'CampaignId':_0x38e300[_0x8dec('0x6c')]||undefined};};exports[_0x8dec('0x6d')]=function(_0x526d0d){if(_0x526d0d===_0x8dec('0x49')||_0x526d0d===_0x8dec('0x6e')||_0x526d0d===_0x8dec('0x65')||_0x526d0d==='type'||_0x526d0d===_0x8dec('0x6f')||_0x526d0d===_0x8dec('0x70')||_0x526d0d===_0x8dec('0x3f')||_0x526d0d===_0x8dec('0x4b')||_0x526d0d===_0x8dec('0x1a')||_0x526d0d==='active'||_0x526d0d===_0x8dec('0x1b')||_0x526d0d==='scheduledat'||_0x526d0d===_0x8dec('0x4f')||_0x526d0d==='countcongestionretry'||_0x526d0d===_0x8dec('0x51')||_0x526d0d===_0x8dec('0x71')||_0x526d0d===_0x8dec('0x72')||_0x526d0d===_0x8dec('0x73')||_0x526d0d===_0x8dec('0x74')||_0x526d0d==='recallme'||_0x526d0d===_0x8dec('0x1c')||_0x526d0d===_0x8dec('0x59')||_0x526d0d===_0x8dec('0x40')||_0x526d0d===_0x8dec('0x1e')||_0x526d0d==='sipcallid'||_0x526d0d===_0x8dec('0x75')||_0x526d0d===_0x8dec('0x76')||_0x526d0d===_0x8dec('0x77')||_0x526d0d===_0x8dec('0x78')||_0x526d0d===_0x8dec('0x79')||_0x526d0d==='xmd-dialtimeout'||_0x526d0d===_0x8dec('0x7a')||_0x526d0d===_0x8dec('0x7b')||_0x526d0d===_0x8dec('0x7c')||_0x526d0d==='xmd-contactid'||_0x526d0d===_0x8dec('0x7d')||_0x526d0d===_0x8dec('0x7e')||_0x526d0d==='xmd-agiafter'||_0x526d0d===_0x8dec('0x7f')||_0x526d0d===_0x8dec('0x80')||_0x526d0d==='rtpaudioqosbridged'||_0x526d0d===_0x8dec('0x81')||_0x526d0d===_0x8dec('0x82')||_0x526d0d==='rtpaudioqosloss'||_0x526d0d==='rtpaudioqoslossbridged'||_0x526d0d==='rtpaudioqosrtt'||_0x526d0d===_0x8dec('0x83')||_0x526d0d===_0x8dec('0x80')||_0x526d0d===_0x8dec('0x84')||_0x526d0d===_0x8dec('0x81')||_0x526d0d==='rtpaudioqosjitterbridged'||_0x526d0d===_0x8dec('0x85')||_0x526d0d===_0x8dec('0x86')||_0x526d0d==='rtpaudioqosrtt'||_0x526d0d===_0x8dec('0x83')||_0x526d0d===_0x8dec('0x87')||_0x526d0d===_0x8dec('0x88')||_0x526d0d===_0x8dec('0x38')||_0x526d0d===_0x8dec('0x39')){return![];}return!![];};exports[_0x8dec('0x89')]=function(_0x2fa8d6,_0x7259dd){var _0x2b4e56,_0x5a2e32,_0x101ae3;if(_0x7259dd<=0x0){_0x7259dd=0x1;}_0x2b4e56=new RegExp(_0x8dec('0x8a')+_0x7259dd+'}$');_0x5a2e32=Math[_0x8dec('0x8b')](0xa,_0x7259dd-0x1);_0x101ae3=Math[_0x8dec('0x8b')](0xa,_0x7259dd)-0x1;return util['format']('%s',_[_0x8dec('0x8c')](_0x2fa8d6,_0x2b4e56,_['random'](_0x5a2e32,_0x101ae3)));};exports['extractCalleridName']=function(_0x3911f1){var _0x13ffbe=_0x3911f1[_0x8dec('0x8d')](/"(.*?)"/);return _0x13ffbe?_0x13ffbe[0x1]:_0x3911f1;};exports[_0x8dec('0x8e')]=function(_0x4e5ea1){var _0x361fe2=_0x4e5ea1[_0x8dec('0x8d')](/<(.*?)>/);return _0x361fe2?_0x361fe2[0x1]:_0x4e5ea1;}; \ No newline at end of file +var _0x366c=['channelAgent','from-sip','timeout','uniqueid','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','cloneAction','clone','Global','active','add','minutes','ContactId','ListId','VoiceQueueId','decrementTalkink','pTalking','[decrementTalkink]\x20is\x20null\x20or\x20undefined','buildObj','lastevent','queue','interface','motionChannel','mandatoryDisposition','agentReadyId','not_inuse','status','reachable','push','getDiff','diff','CampaignId','filterKey','countglobal','callback','callbackuniqueid','callbackat','recallme','sipcallid','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialchannel','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','\x5cw{0,','pow','replace','random','extractCalleridName','match','extractCalleridNumber','util','../../../../config/logger','preview','XCALLY_IP_AGI','milliseconds','seconds','error','inspect','logger','info','loggerError','logger2','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','name','calleridname','calleridnum','dialer','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','originatecalleridname','xcally-motion-preview','monitor_format','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','tags','XMD-','toLowerVariables','hasOwnProperty','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','Blacklist','starttime','endtime','logAgent','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','responsetime','logLookAgent','membername','UserId','logCustomer','ringtime','talktime','answertime','isFailure','RECALL','BOOKED','originate'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x366c,0x14e));var _0xc366=function(_0x56ca15,_0x1f7c73){_0x56ca15=_0x56ca15-0x0;var _0x38ea85=_0x366c[_0x56ca15];return _0x38ea85;};'use strict';var util=require(_0xc366('0x0'));var _=require('lodash');var moment=require('moment');var logger=require(_0xc366('0x1'))(_0xc366('0x2'));var ipAgi=process['env'][_0xc366('0x3')]||'127.0.0.1';function getSeconds(_0x23b62e,_0x1a8cfc){var _0x1b8cf2=moment(_0x23b62e)[_0xc366('0x4')](0x0);var _0x2621e8=moment(_0x1a8cfc)['milliseconds'](0x0);return _0x1b8cf2['diff'](_0x2621e8,_0xc366('0x5'));}exports['loggerCatch']=function(_0x7ef15){return function(_0x216bca){logger[_0xc366('0x6')](_0x7ef15,util[_0xc366('0x7')](_0x216bca,{'showHidden':![],'depth':null}));};};exports[_0xc366('0x8')]=function(_0x2d040a,_0x1b86f6){logger[_0xc366('0x9')](_0x2d040a,util[_0xc366('0x7')](_0x1b86f6,{'showHidden':![],'depth':null}));};exports[_0xc366('0xa')]=function(_0x3d2f41,_0xe9aa31){logger[_0xc366('0x6')](_0x3d2f41,util[_0xc366('0x7')](_0xe9aa31,{'showHidden':![],'depth':null}));};exports[_0xc366('0xb')]=function(_0x4b3020){return function(_0x2ef77d){logger['info'](_0x4b3020,util['inspect'](_0x2ef77d,{'showHidden':![],'depth':null}));};};exports[_0xc366('0xc')]=function(_0x118328,_0x3cb2c8,_0x43c3a4){return{'message':_0x118328,'unlock':_0x3cb2c8,'active':_0x43c3a4};};exports[_0xc366('0xd')]=function(_0x462241,_0x218eff,_0x9c6e9e){if(!_[_0xc366('0xe')](_0x9c6e9e)&&_0xc366('0xf')===typeof _0x9c6e9e&&!_[_0xc366('0x10')](_0x9c6e9e)){if(!_[_0xc366('0xe')](_0x218eff)&&_0xc366('0xf')===typeof _0x218eff&&!_[_0xc366('0x10')](_0x218eff)){return util[_0xc366('0x11')]('\x22%s\x22\x20<%s>',_0x218eff,_0x9c6e9e);}return util[_0xc366('0x11')](_0xc366('0x12'),_0x9c6e9e,_0x9c6e9e);}if(!_[_0xc366('0xe')](_0x462241)&&'string'===typeof _0x462241&&!_['isEmpty'](_0x462241)){return _0x462241;}return _0xc366('0x13');};exports[_0xc366('0x14')]=function(_0x25bd6a){if(_[_0xc366('0x15')](_0x25bd6a)){return![];}return _0x25bd6a;};exports[_0xc366('0x16')]=function(_0x54c1cb,_0x53fb82,_0x48cb52,_0x73431f,_0x5828c2,_0x3e98a0){var _0x1e99eb={'XMD-QUEUE':_0x53fb82[_0xc366('0x17')]?_0x53fb82[_0xc366('0x17')][_0xc366('0x18')]:'','XMD-CALLERID':_0x73431f,'XMD-CALLERID-PREVIEW':_0x3e98a0?util['format'](_0xc366('0x12'),_0x3e98a0[_0xc366('0x19')],_0x3e98a0[_0xc366('0x1a')]):_0x73431f,'XMD-DIALID':_0x5828c2,'XMD-CONTACTID':_0x53fb82['ContactId'],'XMD-CDRTYPE':_0xc366('0x1b'),'CALLERID(all)':_0x73431f,'XMD-VOICEQUEUEID':_0x53fb82['VoiceQueueId'],'XMD-DIALCHANNEL':_0x48cb52,'XMD-DIALTIMEOUT':_0x54c1cb[_0xc366('0x1c')]||0x1e,'XMD-DIALOPTIONS':util['format'](_0xc366('0x1d'),_0x54c1cb[_0xc366('0x1e')]?'g':'',_[_0xc366('0x10')](_0x54c1cb['monitor_format'])?'':_0xc366('0x1f')),'XMD-DIALURL':_0x54c1cb[_0xc366('0x20')]||'','XMD-AGI':_0x54c1cb['dialQueueProject']?util[_0xc366('0x11')]('\x22agi://%s/square,%s\x22',ipAgi,_0x54c1cb[_0xc366('0x21')]):'NONE','XMD-AGIAFTER':_0x54c1cb[_0xc366('0x1e')]?util[_0xc366('0x11')](_0xc366('0x22'),ipAgi,_0x54c1cb[_0xc366('0x1e')]):'NONE','XMD-ORIGINATECALLERIDNUM':_0x3e98a0?_0x3e98a0['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x3e98a0?_0x3e98a0[_0xc366('0x23')]:'','XMD-DESTINATION':_0xc366('0x24')};if(!_[_0xc366('0x10')](_0x54c1cb[_0xc366('0x25')])){_0x1e99eb[util[_0xc366('0x11')]('%s',_0xc366('0x26'))]=_0x54c1cb[_0xc366('0x25')];_0x1e99eb[util['format']('%s',_0xc366('0x27'))]=_0x5828c2;}if(_0x53fb82&&_0x53fb82[_0xc366('0x28')]){for(var _0x571679 in _0x53fb82['Contact']){if(_0x53fb82[_0xc366('0x28')]['hasOwnProperty'](_0x571679)){if(!_[_0xc366('0x15')](_0x53fb82[_0xc366('0x28')][_0x571679])&&_0x571679!=='id'&&_0x571679!==_0xc366('0x29')&&_0x571679!=='createdAt'&&_0x571679!=='updatedAt'){_0x1e99eb[util['format']('%s%s',_0xc366('0x2a'),_['toUpper'](_0x571679))]=_0x53fb82[_0xc366('0x28')][_0x571679];}}}}return _0x1e99eb;};exports[_0xc366('0x2b')]=function(_0x38f837){var _0x3c5258={};for(var _0x673a6b in _0x38f837){if(_0x38f837[_0xc366('0x2c')](_0x673a6b)){_0x3c5258[util['format']('%s',_[_0xc366('0x2d')](_0x673a6b))]=_0x38f837[_0x673a6b];}}return{'variables':_0x3c5258};};exports[_0xc366('0x2e')]=function(_0x2b3af0,_0x448d9d){if(!_[_0xc366('0x15')](_0x2b3af0)){if(_0x2b3af0['hasOwnProperty'](_0xc366('0x2f'))){if(_0x2b3af0[_0xc366('0x2f')]>0x0){_0x2b3af0[_0xc366('0x2f')]-=0x1;}else{logger['error'](_0xc366('0x30'),_0x448d9d);}}}else{logger['error']('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x448d9d);}};exports['logBlacklist']=function(_0x209db0){var _0x3b6be3=moment()[_0xc366('0x11')]('YYYY-MM-DD\x20HH:mm:ss');_0x209db0['state']=0xd;_0x209db0['statedesc']=_0xc366('0x31');_0x209db0[_0xc366('0x32')]=_0x3b6be3;_0x209db0['responsetime']=_0x3b6be3;_0x209db0[_0xc366('0x33')]=_0x3b6be3;};exports[_0xc366('0x34')]=function(_0x3147a6,_0x464517,_0x308151){var _0x4dff4c=moment()['format'](_0xc366('0x35'));_0x3147a6[_0xc366('0x36')]=_0x464517;_0x3147a6[_0xc366('0x37')]=_0x308151;_0x3147a6[_0xc366('0x38')]=_0x4dff4c;_0x3147a6['ringtime']=getSeconds(_0x3147a6[_0xc366('0x38')],_0x3147a6[_0xc366('0x32')]);};exports[_0xc366('0x39')]=function(_0x593bd9,_0x2792b1,_0x4de0c0){_0x593bd9[_0xc366('0x3a')]=_0x2792b1;_0x593bd9[_0xc366('0x3b')]=_0x4de0c0;};exports[_0xc366('0x3c')]=function(_0xf33cd9,_0x440890,_0x241c04){var _0x9e2912=moment()[_0xc366('0x11')](_0xc366('0x35'));_0xf33cd9[_0xc366('0x36')]=_0x440890;_0xf33cd9['statedesc']=_0x241c04;_0xf33cd9[_0xc366('0x38')]=_0xf33cd9[_0xc366('0x38')]?_0xf33cd9[_0xc366('0x38')]:_0x9e2912;_0xf33cd9[_0xc366('0x33')]=_0xf33cd9['endtime']?_0xf33cd9['endtime']:_0x9e2912;_0xf33cd9[_0xc366('0x3d')]=getSeconds(_0xf33cd9['responsetime']||0x0,_0xf33cd9[_0xc366('0x32')]||0x0);_0xf33cd9[_0xc366('0x3e')]=_0xf33cd9['answertime']?getSeconds(_0xf33cd9[_0xc366('0x33')],_0xf33cd9[_0xc366('0x3f')]):0x0;};exports[_0xc366('0x40')]=function(_0x89b75c){return _0x89b75c==='Failure';};exports['variablesAction']=function(_0x58e7fd,_0x558087,_0x5aedf4,_0x4184a9,_0x4cb5af){var _0xce36b7=_0x4184a9?_0xc366('0x41'):_0x58e7fd[_0xc366('0x19')];_0xce36b7=_0x4cb5af?_0xc366('0x42'):_0xce36b7;return{'actionid':_0x58e7fd['uniqueid'],'action':_0xc366('0x43'),'channel':_0x58e7fd[_0xc366('0x44')],'callerid':util[_0xc366('0x11')](_0xc366('0x12'),_0xce36b7,_0x58e7fd['calleridnum']),'Exten':'xcally-motion-preview','Context':_0xc366('0x45'),'Priority':'1','variable':_0x5aedf4,'timeout':(_0x558087[_0xc366('0x46')]||0x1e)*0x3e8,'async':!![],'channelid':_0x58e7fd[_0xc366('0x47')]};};exports[_0xc366('0x48')]=function(_0x48f21e){return _0x48f21e[_0xc366('0x49')]+_0x48f21e[_0xc366('0x4a')]+_0x48f21e[_0xc366('0x4b')]+_0x48f21e[_0xc366('0x4c')]+_0x48f21e['countnosuchnumberretry'];};exports[_0xc366('0x4d')]=function(_0x10a03e){var _0x4d68bc=_[_0xc366('0x4e')](_0x10a03e);_0x4d68bc[_0xc366('0x36')]=0xf;_0x4d68bc['statedesc']=_0xc366('0x4f');return _0x4d68bc;};exports['scheduledAt']=function(_0x217bca,_0x482f18,_0xd48579){var _0x422a47={};_0x422a47[_0x482f18]=_0x217bca[_0x482f18];_0x422a47[_0xc366('0x50')]=![];_0x422a47['scheduledat']=moment()[_0xc366('0x51')](_0xd48579,_0xc366('0x52'))[_0xc366('0x11')]('YYYY-MM-DD\x20HH:mm:ss');_0x422a47[_0xc366('0x53')]=_0x217bca[_0xc366('0x53')];_0x422a47[_0xc366('0x54')]=_0x217bca[_0xc366('0x54')];_0x422a47[_0xc366('0x55')]=_0x217bca[_0xc366('0x55')]||undefined;return _0x422a47;};exports[_0xc366('0x56')]=function(_0x13b1c6,_0x5bce9e){if(!_['isNil'](_0x13b1c6)){if(_0x13b1c6[_0xc366('0x57')]>0x0){_0x13b1c6['pTalking']-=0x1;}else{logger['error'](_0x5bce9e,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0xc366('0x6')](_0x5bce9e,_0xc366('0x58'));}};exports['IsNotLoggedIn']=function(_0x16e1fd){if(_0x16e1fd<=0x0){return!![];}return![];};exports[_0xc366('0x59')]=function(_0x308b7a,_0x31ae88,_0x2d7c36){_0x308b7a[_0xc366('0x5a')]=_0x31ae88;_0x308b7a['name']=_0x308b7a[_0xc366('0x5b')];_0x308b7a[_0xc366('0x5c')]=_0x308b7a[_0xc366('0x44')];_0x308b7a[_0xc366('0x5d')]='voice';if(_0x2d7c36){_0x308b7a[_0xc366('0x5e')]=_0x2d7c36[_0xc366('0x5e')];}return _0x308b7a;};exports['buildAcw']=function(_0x4647a4){var _0x11889c={};_0x11889c[_0xc366('0x5b')]=_0x4647a4['queue'];_0x11889c[_0xc366('0x5c')]=_0x4647a4['channelAgent'];_0x11889c[_0xc366('0x47')]=_0x4647a4['uniqueid'];return _0x11889c;};exports[_0xc366('0x5f')]=function(_0x25c1be){var _0x6096d6=[];for(var _0x4d3474 in _0x25c1be){if(_0x25c1be[_0xc366('0x2c')](_0x4d3474)){if(!_[_0xc366('0x15')](_0x25c1be[_0x4d3474])&&_0x25c1be[_0x4d3474][_0xc366('0x36')]===_0xc366('0x60')&&_0x25c1be[_0x4d3474][_0xc366('0x61')]===_0xc366('0x62')){_0x6096d6[_0xc366('0x63')](_0x25c1be[_0x4d3474]['id']);}}}return _0x6096d6;};exports[_0xc366('0x64')]=function(_0x5dad91){var _0x449c45=moment()[_0xc366('0x4')](0x0);var _0x56ffa8=moment(_0x5dad91)['milliseconds'](0x0);return _0x449c45[_0xc366('0x65')](_0x56ffa8,_0xc366('0x5'));};exports['createBody']=function(_0x2ae975){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x2ae975[_0xc366('0x53')],'ListId':_0x2ae975['ListId'],'VoiceQueueId':_0x2ae975[_0xc366('0x55')]||undefined,'CampaignId':_0x2ae975[_0xc366('0x66')]||undefined};};exports[_0xc366('0x67')]=function(_0x4a001c){if(_0x4a001c===_0xc366('0x47')||_0x4a001c==='idContact'||_0x4a001c===_0xc366('0x5b')||_0x4a001c==='type'||_0x4a001c==='campaigntype'||_0x4a001c==='dialAnswer'||_0x4a001c===_0xc366('0x3a')||_0x4a001c===_0xc366('0x44')||_0x4a001c===_0xc366('0x19')||_0x4a001c===_0xc366('0x50')||_0x4a001c===_0xc366('0x1a')||_0x4a001c==='scheduledat'||_0x4a001c==='countbusyretry'||_0x4a001c==='countcongestionretry'||_0x4a001c==='countnoanswerretry'||_0x4a001c===_0xc366('0x68')||_0x4a001c===_0xc366('0x69')||_0x4a001c===_0xc366('0x6a')||_0x4a001c===_0xc366('0x6b')||_0x4a001c===_0xc366('0x6c')||_0x4a001c===_0xc366('0x53')||_0x4a001c==='ListId'||_0x4a001c==='UserId'||_0x4a001c===_0xc366('0x55')||_0x4a001c===_0xc366('0x6d')||_0x4a001c==='xmd-voicequeueid'||_0x4a001c==='xmd-queue'||_0x4a001c==='xmd-phone'||_0x4a001c===_0xc366('0x6e')||_0x4a001c===_0xc366('0x6f')||_0x4a001c===_0xc366('0x70')||_0x4a001c===_0xc366('0x71')||_0x4a001c==='xmd-dialid'||_0x4a001c===_0xc366('0x72')||_0x4a001c==='xmd-contactid'||_0x4a001c===_0xc366('0x73')||_0x4a001c===_0xc366('0x74')||_0x4a001c===_0xc366('0x75')||_0x4a001c===_0xc366('0x76')||_0x4a001c===_0xc366('0x77')||_0x4a001c===_0xc366('0x78')||_0x4a001c==='rtpaudioqosjitter'||_0x4a001c==='rtpaudioqosjitterbridged'||_0x4a001c===_0xc366('0x79')||_0x4a001c===_0xc366('0x7a')||_0x4a001c===_0xc366('0x7b')||_0x4a001c===_0xc366('0x7c')||_0x4a001c==='rtpaudioqos'||_0x4a001c===_0xc366('0x78')||_0x4a001c==='rtpaudioqosjitter'||_0x4a001c==='rtpaudioqosjitterbridged'||_0x4a001c===_0xc366('0x79')||_0x4a001c===_0xc366('0x7a')||_0x4a001c===_0xc366('0x7b')||_0x4a001c===_0xc366('0x7c')||_0x4a001c===_0xc366('0x7d')||_0x4a001c===_0xc366('0x7e')||_0x4a001c===_0xc366('0x36')||_0x4a001c===_0xc366('0x37')){return![];}return!![];};exports['getCallerIdRandom']=function(_0x45164a,_0x241173){var _0x10816c,_0x150953,_0x368629;if(_0x241173<=0x0){_0x241173=0x1;}_0x10816c=new RegExp(_0xc366('0x7f')+_0x241173+'}$');_0x150953=Math[_0xc366('0x80')](0xa,_0x241173-0x1);_0x368629=Math[_0xc366('0x80')](0xa,_0x241173)-0x1;return util['format']('%s',_[_0xc366('0x81')](_0x45164a,_0x10816c,_[_0xc366('0x82')](_0x150953,_0x368629)));};exports[_0xc366('0x83')]=function(_0x2250ce){var _0x2e5005=_0x2250ce[_0xc366('0x84')](/"(.*?)"/);return _0x2e5005?_0x2e5005[0x1]:_0x2250ce;};exports[_0xc366('0x85')]=function(_0x3bf6c4){var _0x5e177a=_0x3bf6c4[_0xc366('0x84')](/<(.*?)>/);return _0x5e177a?_0x5e177a[0x1]:_0x3bf6c4;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 103085b..71d21c0 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 _0x36e3=['string','number','boolean','queueremove','queuepause','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect'];(function(_0x19a4a1,_0x19bba6){var _0x3b6c2c=function(_0x552fc8){while(--_0x552fc8){_0x19a4a1['push'](_0x19a4a1['shift']());}};_0x3b6c2c(++_0x19bba6);}(_0x36e3,0x64));var _0x336e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0x36e3[_0x5783f4];return _0x28e380;};'use strict';exports['queueadd']={'queue':{'type':_0x336e('0x0'),'required':!![]},'interface':{'type':'string','required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':_0x336e('0x1'),'required':![]},'paused':{'type':_0x336e('0x2'),'required':![]}};exports[_0x336e('0x3')]={'queue':{'type':_0x336e('0x0'),'required':!![]},'interface':{'type':_0x336e('0x0'),'required':!![]}};exports[_0x336e('0x4')]={'interface':{'type':_0x336e('0x0'),'required':!![]},'paused':{'type':'boolean'},'reason':{'type':_0x336e('0x0'),'required':![]}};exports[_0x336e('0x5')]={'module':{'type':_0x336e('0x0'),'required':![]}};exports[_0x336e('0x6')]={'uniqueid':{'type':_0x336e('0x0'),'required':!![]}};exports[_0x336e('0x7')]={'uniqueid':{'type':'string','required':!![]},'filename':{'type':'string'},'format':{'type':_0x336e('0x0')},'mixmonitorid':{'type':_0x336e('0x0')}};exports[_0x336e('0x8')]={'uniqueid':{'type':_0x336e('0x0'),'required':!![]}};exports[_0x336e('0x9')]={'uniqueid':{'type':'string','required':!![]},'exten':{'type':_0x336e('0x0'),'required':!![]},'context':{'type':'string'}}; \ No newline at end of file +var _0x0ef7=['queueadd','string','number','boolean','queuepause','reload','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect'];(function(_0x62c958,_0x2bfdbc){var _0x57ec61=function(_0x5c0094){while(--_0x5c0094){_0x62c958['push'](_0x62c958['shift']());}};_0x57ec61(++_0x2bfdbc);}(_0x0ef7,0x132));var _0x70ef=function(_0x45b29d,_0x44ce43){_0x45b29d=_0x45b29d-0x0;var _0x32d74=_0x0ef7[_0x45b29d];return _0x32d74;};'use strict';exports[_0x70ef('0x0')]={'queue':{'type':_0x70ef('0x1'),'required':!![]},'interface':{'type':_0x70ef('0x1'),'required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':_0x70ef('0x2'),'required':![]},'paused':{'type':_0x70ef('0x3'),'required':![]}};exports['queueremove']={'queue':{'type':_0x70ef('0x1'),'required':!![]},'interface':{'type':'string','required':!![]}};exports[_0x70ef('0x4')]={'interface':{'type':_0x70ef('0x1'),'required':!![]},'paused':{'type':_0x70ef('0x3')},'reason':{'type':_0x70ef('0x1'),'required':![]}};exports[_0x70ef('0x5')]={'module':{'type':_0x70ef('0x1'),'required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':'string','required':!![]}};exports[_0x70ef('0x6')]={'uniqueid':{'type':_0x70ef('0x1'),'required':!![]},'filename':{'type':'string'},'format':{'type':_0x70ef('0x1')},'mixmonitorid':{'type':_0x70ef('0x1')}};exports[_0x70ef('0x7')]={'uniqueid':{'type':_0x70ef('0x1'),'required':!![]}};exports[_0x70ef('0x8')]={'uniqueid':{'type':_0x70ef('0x1'),'required':!![]},'exten':{'type':_0x70ef('0x1'),'required':!![]},'context':{'type':_0x70ef('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 06c6092..6543629 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 _0xc35c=['queuecallerexit','queuecallerabandon','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','disposition','ANSWERED','duration','billableseconds','initCampaigns','SquareProject','initVoiceExtensions','voiceExtensions','initCampaignHopperHistory','merge','exports','bluebird','../model/agent','../model/telephone','../model/trunk','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/servicenowAccount','../model/freshsalesAccount','agents','telephones','trunks','voiceQueues','triggers','campaigns','templates','outbound','channels','queueChannels','settings','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','deskAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','format','SIP/%s','name','hasOwnProperty','isNil','interface','total','answered','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','abandoned','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','length','isUndefined','initTelephones','initVoiceQueues','initTriggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initZohoAccounts','zohoAccounts','initDeskAccounts','initVtigerAccounts','vtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueReports','groupBy','uniqueid'];(function(_0x3f3519,_0xd53cae){var _0x23b6bf=function(_0x3b3e52){while(--_0x3b3e52){_0x3f3519['push'](_0x3f3519['shift']());}};_0x23b6bf(++_0xd53cae);}(_0xc35c,0x1c1));var _0xcc35=function(_0x100fa7,_0xcc26aa){_0x100fa7=_0x100fa7-0x0;var _0x2f4242=_0xc35c[_0x100fa7];return _0x2f4242;};'use strict';var BPromise=require(_0xcc35('0x0'));var util=require('util');var _=require('lodash');var moment=require('moment');var Agent=require(_0xcc35('0x1'));var Telephone=require(_0xcc35('0x2'));var Trunk=require(_0xcc35('0x3'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require(_0xcc35('0x4'));var Template=require(_0xcc35('0x5'));var Campaign=require(_0xcc35('0x6'));var VoiceExtension=require(_0xcc35('0x7'));var ZendeskAccount=require(_0xcc35('0x8'));var SalesforceAccount=require(_0xcc35('0x9'));var FreshdeskAccount=require(_0xcc35('0xa'));var SugarcrmAccount=require(_0xcc35('0xb'));var ZohoAccount=require(_0xcc35('0xc'));var DeskAccount=require(_0xcc35('0xd'));var VtigerAccount=require('../model/vtigerAccount');var ServicenowAccount=require(_0xcc35('0xe'));var Dynamics365Account=require('../model/dynamics365Account');var FreshsalesAccount=require(_0xcc35('0xf'));var FaxAccount=require('../model/faxAccount');var Realtime=function(){this[_0xcc35('0x10')]={};this[_0xcc35('0x11')]={};this[_0xcc35('0x12')]={};this[_0xcc35('0x13')]={};this[_0xcc35('0x14')]={};this[_0xcc35('0x15')]={};this[_0xcc35('0x16')]={};this[_0xcc35('0x17')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0xcc35('0x18')]={};this[_0xcc35('0x19')]={};this['outboundChannels']={};this['timers']={};this[_0xcc35('0x1a')]={};this[_0xcc35('0x1b')]={};this[_0xcc35('0x1c')]={};this[_0xcc35('0x1d')]={};this[_0xcc35('0x1e')]={};this['zohoAccounts']={};this[_0xcc35('0x1f')]={};this['vtigerAccounts']={};this[_0xcc35('0x20')]={};this[_0xcc35('0x21')]={};this[_0xcc35('0x22')]={};this[_0xcc35('0x23')]={};};function freeIsNotKey(_0xa24e55,_0x283ac2,_0x1cec7e){var _0x336dd5=_[_0xcc35('0x24')](_0xa24e55,function(_0x2f229e,_0x25bcbf){return _0x2f229e[_0x1cec7e];});for(var _0x2fb3c7 in _0x283ac2){if(_0x283ac2['hasOwnProperty'](_0x2fb3c7)){if(!_0x336dd5[_0x2fb3c7]){delete _0x283ac2[_0x2fb3c7];}}}}function freeIsNotKeySip(_0x3cbb45,_0x4c4905){var _0x276add=_[_0xcc35('0x24')](_0x3cbb45,function(_0x5f3e4d,_0x1bff9d){return util[_0xcc35('0x25')](_0xcc35('0x26'),_0x5f3e4d[_0xcc35('0x27')]);});for(var _0x189326 in _0x4c4905){if(_0x4c4905[_0xcc35('0x28')](_0x189326)){if(!_0x276add[_0x189326]){delete _0x4c4905[_0x189326];}}}}function freeIsNotKeyAgent(_0x57fcc5,_0x319d58){var _0x3e6ab5=_[_0xcc35('0x24')](_0x57fcc5,function(_0x182dad,_0x106b16){var _0x1b03b4=_[_0xcc35('0x29')](_0x182dad[_0xcc35('0x2a')])?util[_0xcc35('0x25')]('SIP/%s',_0x182dad[_0xcc35('0x27')]):_0x182dad[_0xcc35('0x2a')];return _0x1b03b4;});for(var _0x112de6 in _0x319d58){if(_0x319d58[_0xcc35('0x28')](_0x112de6)){if(!_0x3e6ab5[_0x112de6]){delete _0x319d58[_0x112de6];}}}}function clearVoiceCallReports(_0x173a5b){_0x173a5b[_0xcc35('0x2b')]=0x0;_0x173a5b[_0xcc35('0x2c')]=0x0;_0x173a5b[_0xcc35('0x2d')]=0x0;_0x173a5b[_0xcc35('0x2e')]=0x0;_0x173a5b[_0xcc35('0x2f')]=0x0;}function clearCampaigns(_0xee7f14){if(!_[_0xcc35('0x30')](_0xee7f14)){for(var _0x48e4df in _0xee7f14){if(_0xee7f14[_0xcc35('0x28')](_0x48e4df)){_0xee7f14[_0x48e4df][_0xcc35('0x31')]=0x0;_0xee7f14[_0x48e4df][_0xcc35('0x32')]=0x0;}}}}function clearVoiceQueues(_0x1da4a9){if(!_['isEmpty'](_0x1da4a9)){for(var _0x2640b4 in _0x1da4a9){if(_0x1da4a9[_0xcc35('0x28')](_0x2640b4)){_0x1da4a9[_0x2640b4][_0xcc35('0x2b')]=0x0;_0x1da4a9[_0x2640b4][_0xcc35('0x2c')]=0x0;_0x1da4a9[_0x2640b4][_0xcc35('0x33')]=0x0;_0x1da4a9[_0x2640b4][_0xcc35('0x34')]=0x0;_0x1da4a9[_0x2640b4][_0xcc35('0x2d')]=0x0;_0x1da4a9[_0x2640b4]['sumDuration']=0x0;_0x1da4a9[_0x2640b4][_0xcc35('0x2f')]=0x0;_0x1da4a9[_0x2640b4]['outboundAnswerAgiCallsDay']=0x0;_0x1da4a9[_0x2640b4][_0xcc35('0x35')]=0x0;_0x1da4a9[_0x2640b4][_0xcc35('0x36')]=0x0;_0x1da4a9[_0x2640b4]['outboundCongestionCallsDay']=0x0;_0x1da4a9[_0x2640b4][_0xcc35('0x37')]=0x0;_0x1da4a9[_0x2640b4][_0xcc35('0x38')]=0x0;_0x1da4a9[_0x2640b4]['outboundDropCallsDayTimeout']=0x0;_0x1da4a9[_0x2640b4][_0xcc35('0x39')]=0x0;_0x1da4a9[_0x2640b4][_0xcc35('0x3a')]=0x0;_0x1da4a9[_0x2640b4][_0xcc35('0x3b')]=0x0;_0x1da4a9[_0x2640b4][_0xcc35('0x3c')]=0x0;_0x1da4a9[_0x2640b4]['outboundReCallsDay']=0x0;_0x1da4a9[_0x2640b4]['outboundAnswerAgiCallsDay']=0x0;_0x1da4a9[_0x2640b4][_0xcc35('0x3d')]=0x0;_0x1da4a9[_0x2640b4][_0xcc35('0x3e')]=!![];}}}}Realtime[_0xcc35('0x3f')][_0xcc35('0x40')]=function(_0x5259d0,_0x4373f2){for(var _0x464011 in _0x4373f2){if(_0x5259d0[_0xcc35('0x28')](_0x464011)){_0x5259d0[_0x464011]=_0x4373f2[_0x464011];}}};Realtime[_0xcc35('0x3f')][_0xcc35('0x41')]=function(){var _0x2de297=this;return function(_0x429659){if(_0x429659){freeIsNotKeyAgent(_0x429659,_0x2de297['agents']);for(var _0x485509=0x0,_0x46cdf7={},_0x5d323d={};_0x485509<_0x429659[_0xcc35('0x42')];_0x485509+=0x1){_0x46cdf7=_0x429659[_0x485509];var _0x414360=_[_0xcc35('0x29')](_0x46cdf7[_0xcc35('0x2a')])?util[_0xcc35('0x25')]('SIP/%s',_0x46cdf7['name']):_0x46cdf7[_0xcc35('0x2a')];if(_[_0xcc35('0x43')](_0x2de297[_0xcc35('0x10')][_0x414360])){_0x2de297[_0xcc35('0x10')][_0x414360]=new Agent(_0x46cdf7);}else{_0x2de297[_0xcc35('0x40')](_0x2de297[_0xcc35('0x10')][_0x414360],_0x46cdf7);}}}return _0x2de297[_0xcc35('0x10')];};};Realtime[_0xcc35('0x3f')][_0xcc35('0x44')]=function(){var _0x532cd4=this;return function(_0x12e0c5){if(_0x12e0c5){freeIsNotKeySip(_0x12e0c5,_0x532cd4[_0xcc35('0x11')]);for(var _0x6232ae=0x0,_0x27b863={},_0x4a7bb2={};_0x6232ae<_0x12e0c5['length'];_0x6232ae+=0x1){_0x27b863=_0x12e0c5[_0x6232ae];if(_[_0xcc35('0x43')](_0x532cd4[_0xcc35('0x11')][util[_0xcc35('0x25')](_0xcc35('0x26'),_0x27b863[_0xcc35('0x27')])])){_0x532cd4[_0xcc35('0x11')][util[_0xcc35('0x25')]('SIP/%s',_0x27b863['name'])]=new Telephone(_0x27b863);}else{_0x532cd4[_0xcc35('0x40')](_0x532cd4[_0xcc35('0x11')][util[_0xcc35('0x25')](_0xcc35('0x26'),_0x27b863[_0xcc35('0x27')])],_0x27b863);}}}return _0x532cd4['telephones'];};};Realtime[_0xcc35('0x3f')]['initTrunks']=function(){var _0x323392=this;return function(_0x3e18de){if(_0x3e18de){freeIsNotKeySip(_0x3e18de,_0x323392[_0xcc35('0x12')]);for(var _0x45898a=0x0,_0x3cd638={},_0x1251f8={};_0x45898a<_0x3e18de[_0xcc35('0x42')];_0x45898a+=0x1){_0x3cd638=_0x3e18de[_0x45898a];if(_['isUndefined'](_0x323392[_0xcc35('0x12')][util[_0xcc35('0x25')]('SIP/%s',_0x3cd638[_0xcc35('0x27')])])){_0x323392[_0xcc35('0x12')][util[_0xcc35('0x25')]('SIP/%s',_0x3cd638[_0xcc35('0x27')])]=new Trunk(_0x3cd638);}else{_0x323392[_0xcc35('0x40')](_0x323392[_0xcc35('0x12')][util[_0xcc35('0x25')]('SIP/%s',_0x3cd638[_0xcc35('0x27')])],_0x3cd638);}}}return _0x323392[_0xcc35('0x12')];};};Realtime[_0xcc35('0x3f')][_0xcc35('0x45')]=function(){var _0x196248=this;return function(_0x3ce91e){if(_0x3ce91e){freeIsNotKey(_0x3ce91e,_0x196248[_0xcc35('0x13')],_0xcc35('0x27'));for(var _0x2b01cc=0x0,_0x2c2203={},_0xc6104={};_0x2b01cc<_0x3ce91e[_0xcc35('0x42')];_0x2b01cc+=0x1){_0x2c2203=_0x3ce91e[_0x2b01cc];if(_[_0xcc35('0x43')](_0x196248[_0xcc35('0x13')][_0x2c2203[_0xcc35('0x27')]])){_0x196248[_0xcc35('0x13')][_0x2c2203[_0xcc35('0x27')]]=new VoiceQueue(_0x2c2203);}else{_0x196248[_0xcc35('0x40')](_0x196248[_0xcc35('0x13')][_0x2c2203[_0xcc35('0x27')]],_0x2c2203);}}}return _0x196248['voiceQueues'];};};Realtime[_0xcc35('0x3f')][_0xcc35('0x46')]=function(){var _0x33619d=this;return function(_0x3ff852){if(_0x3ff852){freeIsNotKey(_0x3ff852,_0x33619d['triggers'],'id');for(var _0x2a844a=0x0,_0x5f0927={},_0x49c3d0={};_0x2a844a<_0x3ff852['length'];_0x2a844a+=0x1){_0x5f0927=_0x3ff852[_0x2a844a];if(_[_0xcc35('0x43')](_0x33619d[_0xcc35('0x14')][_0x5f0927['id']])){_0x33619d[_0xcc35('0x14')][_0x5f0927['id']]=new Trigger(_0x5f0927);}else{_0x33619d[_0xcc35('0x40')](_0x33619d[_0xcc35('0x14')][_0x5f0927['id']],_0x5f0927);}}}return _0x33619d['triggers'];};};Realtime[_0xcc35('0x3f')][_0xcc35('0x47')]=function(){var _0x390734=this;return function(_0x24197b){if(_0x24197b){freeIsNotKey(_0x24197b,_0x390734[_0xcc35('0x16')],'id');for(var _0x238b01=0x0,_0x377942={},_0xd7010a={};_0x238b01<_0x24197b[_0xcc35('0x42')];_0x238b01+=0x1){_0x377942=_0x24197b[_0x238b01];if(_['isUndefined'](_0x390734[_0xcc35('0x16')][_0x377942['id']])){_0x390734[_0xcc35('0x16')][_0x377942['id']]=new Template(_0x377942);}else{_0x390734['mergeFromDatabase'](_0x390734[_0xcc35('0x16')][_0x377942['id']],_0x377942);}}}return _0x390734[_0xcc35('0x16')];};};Realtime[_0xcc35('0x3f')][_0xcc35('0x48')]=function(){var _0x4af885=this;return function(_0x52e2b4){if(_0x52e2b4){freeIsNotKey(_0x52e2b4,_0x4af885['zendeskAccounts'],'id');for(var _0x219887=0x0,_0x18981d={},_0x353557={};_0x219887<_0x52e2b4[_0xcc35('0x42')];_0x219887+=0x1){_0x18981d=_0x52e2b4[_0x219887];if(_['isUndefined'](_0x4af885[_0xcc35('0x1b')][_0x18981d['id']])){_0x4af885[_0xcc35('0x1b')][_0x18981d['id']]=new ZendeskAccount(_0x18981d);}else{_0x4af885[_0xcc35('0x40')](_0x4af885[_0xcc35('0x1b')][_0x18981d['id']],_0x18981d);}}}return _0x4af885['zendeskAccounts'];};};Realtime['prototype'][_0xcc35('0x49')]=function(){var _0x270f48=this;return function(_0x101051){if(_0x101051){freeIsNotKey(_0x101051,_0x270f48[_0xcc35('0x1c')],'id');for(var _0x39fa1b=0x0,_0x9b922e={},_0x59c7fc={};_0x39fa1b<_0x101051[_0xcc35('0x42')];_0x39fa1b+=0x1){_0x9b922e=_0x101051[_0x39fa1b];if(_['isUndefined'](_0x270f48[_0xcc35('0x1c')][_0x9b922e['id']])){_0x270f48['salesforceAccounts'][_0x9b922e['id']]=new SalesforceAccount(_0x9b922e);}else{_0x270f48[_0xcc35('0x40')](_0x270f48['salesforceAccounts'][_0x9b922e['id']],_0x9b922e);}}}return _0x270f48['salesforceAccounts'];};};Realtime[_0xcc35('0x3f')][_0xcc35('0x4a')]=function(){var _0x5b7c5f=this;return function(_0x3d7287){if(_0x3d7287){freeIsNotKey(_0x3d7287,_0x5b7c5f[_0xcc35('0x1e')],'id');for(var _0x1cfe63=0x0,_0x323e99={},_0x20c9b4={};_0x1cfe63<_0x3d7287[_0xcc35('0x42')];_0x1cfe63+=0x1){_0x323e99=_0x3d7287[_0x1cfe63];if(_[_0xcc35('0x43')](_0x5b7c5f['freshdeskAccounts'][_0x323e99['id']])){_0x5b7c5f[_0xcc35('0x1e')][_0x323e99['id']]=new FreshdeskAccount(_0x323e99);}else{_0x5b7c5f[_0xcc35('0x40')](_0x5b7c5f['freshdeskAccounts'][_0x323e99['id']],_0x323e99);}}}return _0x5b7c5f[_0xcc35('0x1e')];};};Realtime[_0xcc35('0x3f')][_0xcc35('0x4b')]=function(){var _0x1b315e=this;return function(_0x44a005){if(_0x44a005){freeIsNotKey(_0x44a005,_0x1b315e['zohoAccounts'],'id');for(var _0x5172ef=0x0,_0x273ab0={},_0x2f9901={};_0x5172ef<_0x44a005[_0xcc35('0x42')];_0x5172ef+=0x1){_0x273ab0=_0x44a005[_0x5172ef];if(_[_0xcc35('0x43')](_0x1b315e[_0xcc35('0x4c')][_0x273ab0['id']])){_0x1b315e[_0xcc35('0x4c')][_0x273ab0['id']]=new ZohoAccount(_0x273ab0);}else{_0x1b315e[_0xcc35('0x40')](_0x1b315e[_0xcc35('0x4c')][_0x273ab0['id']],_0x273ab0);}}}return _0x1b315e[_0xcc35('0x4c')];};};Realtime[_0xcc35('0x3f')][_0xcc35('0x4d')]=function(){var _0x17a969=this;return function(_0x3de74a){if(_0x3de74a){freeIsNotKey(_0x3de74a,_0x17a969['deskAccounts'],'id');for(var _0x2f655f=0x0,_0x5a5ace={},_0x42df7a={};_0x2f655f<_0x3de74a[_0xcc35('0x42')];_0x2f655f+=0x1){_0x5a5ace=_0x3de74a[_0x2f655f];if(_[_0xcc35('0x43')](_0x17a969[_0xcc35('0x1f')][_0x5a5ace['id']])){_0x17a969[_0xcc35('0x1f')][_0x5a5ace['id']]=new DeskAccount(_0x5a5ace);}else{_0x17a969[_0xcc35('0x40')](_0x17a969['deskAccounts'][_0x5a5ace['id']],_0x5a5ace);}}}return _0x17a969['deskAccounts'];};};Realtime['prototype']['initSugarcrmAccounts']=function(){var _0x5d76c4=this;return function(_0x1e7c40){if(_0x1e7c40){freeIsNotKey(_0x1e7c40,_0x5d76c4[_0xcc35('0x1d')],'id');for(var _0x4f9f5b=0x0,_0x2af0fc={},_0xec291={};_0x4f9f5b<_0x1e7c40['length'];_0x4f9f5b+=0x1){_0x2af0fc=_0x1e7c40[_0x4f9f5b];if(_[_0xcc35('0x43')](_0x5d76c4[_0xcc35('0x1d')][_0x2af0fc['id']])){_0x5d76c4[_0xcc35('0x1d')][_0x2af0fc['id']]=new SugarcrmAccount(_0x2af0fc);}else{_0x5d76c4[_0xcc35('0x40')](_0x5d76c4[_0xcc35('0x1d')][_0x2af0fc['id']],_0x2af0fc);}}}return _0x5d76c4['sugarcrmAccounts'];};};Realtime[_0xcc35('0x3f')][_0xcc35('0x4e')]=function(){var _0x42baf1=this;return function(_0x490754){if(_0x490754){freeIsNotKey(_0x490754,_0x42baf1[_0xcc35('0x4f')],'id');for(var _0x13fee2=0x0,_0x37b0f3={},_0xd0ff2a={};_0x13fee2<_0x490754[_0xcc35('0x42')];_0x13fee2+=0x1){_0x37b0f3=_0x490754[_0x13fee2];if(_[_0xcc35('0x43')](_0x42baf1[_0xcc35('0x4f')][_0x37b0f3['id']])){_0x42baf1[_0xcc35('0x4f')][_0x37b0f3['id']]=new VtigerAccount(_0x37b0f3);}else{_0x42baf1[_0xcc35('0x40')](_0x42baf1[_0xcc35('0x4f')][_0x37b0f3['id']],_0x37b0f3);}}}return _0x42baf1[_0xcc35('0x4f')];};};Realtime[_0xcc35('0x3f')][_0xcc35('0x50')]=function(){var _0x4dc669=this;return function(_0x3b024f){if(_0x3b024f){freeIsNotKey(_0x3b024f,_0x4dc669[_0xcc35('0x20')],'id');for(var _0x1d7ed5=0x0,_0x460db6={},_0x1fc96e={};_0x1d7ed5<_0x3b024f[_0xcc35('0x42')];_0x1d7ed5+=0x1){_0x460db6=_0x3b024f[_0x1d7ed5];if(_['isUndefined'](_0x4dc669['servicenowAccounts'][_0x460db6['id']])){_0x4dc669[_0xcc35('0x20')][_0x460db6['id']]=new ServicenowAccount(_0x460db6);}else{_0x4dc669[_0xcc35('0x40')](_0x4dc669['servicenowAccounts'][_0x460db6['id']],_0x460db6);}}}return _0x4dc669[_0xcc35('0x20')];};};Realtime[_0xcc35('0x3f')][_0xcc35('0x51')]=function(){var _0x8abba1=this;return function(_0x2ef1aa){if(_0x2ef1aa){freeIsNotKey(_0x2ef1aa,_0x8abba1[_0xcc35('0x21')],'id');for(var _0x30bf9b=0x0,_0x128003={},_0x444117={};_0x30bf9b<_0x2ef1aa[_0xcc35('0x42')];_0x30bf9b+=0x1){_0x128003=_0x2ef1aa[_0x30bf9b];if(_[_0xcc35('0x43')](_0x8abba1[_0xcc35('0x21')][_0x128003['id']])){_0x8abba1['dynamics365Accounts'][_0x128003['id']]=new Dynamics365Account(_0x128003);}else{_0x8abba1[_0xcc35('0x40')](_0x8abba1[_0xcc35('0x21')][_0x128003['id']],_0x128003);}}}return _0x8abba1[_0xcc35('0x21')];};};Realtime[_0xcc35('0x3f')][_0xcc35('0x52')]=function(){var _0xf5984f=this;return function(_0x22bd30){if(_0x22bd30){freeIsNotKey(_0x22bd30,_0xf5984f['freshsalesAccounts'],'id');for(var _0xd9f354=0x0,_0x219c2a={},_0x2664ba={};_0xd9f354<_0x22bd30[_0xcc35('0x42')];_0xd9f354+=0x1){_0x219c2a=_0x22bd30[_0xd9f354];if(_[_0xcc35('0x43')](_0xf5984f[_0xcc35('0x22')][_0x219c2a['id']])){_0xf5984f['freshsalesAccounts'][_0x219c2a['id']]=new FreshsalesAccount(_0x219c2a);}else{_0xf5984f['mergeFromDatabase'](_0xf5984f['freshsalesAccounts'][_0x219c2a['id']],_0x219c2a);}}}return _0xf5984f[_0xcc35('0x22')];};};Realtime[_0xcc35('0x3f')]['initVoiceQueueHopperHistory']=function(){var _0x39d543=this;return function(_0xb82d5c){for(var _0x56f112=0x0;_0x56f112<_0xb82d5c[_0xcc35('0x42')];_0x56f112+=0x1){_['merge'](_0x39d543[_0xcc35('0x13')][_0xb82d5c[_0x56f112][_0xcc35('0x27')]],_0xb82d5c[_0x56f112]);}return _0x39d543['voiceQueues'];};};Realtime[_0xcc35('0x3f')][_0xcc35('0x53')]=function(){var _0x944436=this;return function(_0x209578){clearVoiceQueues(_0x944436['voiceQueues']);if(_0x209578){_0x209578=_[_0xcc35('0x54')](_0x209578,_0xcc35('0x55'));for(var _0x1ee82c in _0x209578){if(_0x209578[_0xcc35('0x28')](_0x1ee82c)){var _0x40bfdc={};for(var _0x1b66a4=0x0;_0x1b66a4<_0x209578[_0x1ee82c][_0xcc35('0x42')];_0x1b66a4+=0x1){var _0x8ecbf4=_0x209578[_0x1ee82c][_0x1b66a4]['queue'];if(_0x944436[_0xcc35('0x13')][_0x8ecbf4]){if(_0x209578[_0x1ee82c][_0x1b66a4][_0xcc35('0x56')]){_0x944436['voiceQueues'][_0x8ecbf4][_0xcc35('0x33')]+=0x1;}if(_0x209578[_0x1ee82c][_0x1b66a4][_0xcc35('0x57')]){_0x944436['voiceQueues'][_0x8ecbf4][_0xcc35('0x34')]+=0x1;}_0x944436[_0xcc35('0x13')][_0x8ecbf4][_0xcc35('0x2d')]+=moment(_0x209578[_0x1ee82c][_0x1b66a4][_0xcc35('0x58')])[_0xcc35('0x59')](moment(_0x209578[_0x1ee82c][_0x1b66a4][_0xcc35('0x5a')]),_0xcc35('0x5b'))||0x0;if(_0x1b66a4===_0x209578[_0x1ee82c][_0xcc35('0x42')]-0x1){_0x944436[_0xcc35('0x13')][_0x8ecbf4][_0xcc35('0x2e')]+=moment(_0x209578[_0x1ee82c][_0x1b66a4][_0xcc35('0x5c')]||_0x209578[_0x1ee82c][_0x1b66a4]['queuecallerabandonAt']||_0x209578[_0x1ee82c][_0x1b66a4][_0xcc35('0x5d')])[_0xcc35('0x59')](moment(_0x209578[_0x1ee82c][_0x1b66a4][_0xcc35('0x5a')]),_0xcc35('0x5b'))||0x0;_0x944436[_0xcc35('0x13')][_0x8ecbf4][_0xcc35('0x2b')]+=0x1;if(_0x209578[_0x1ee82c][_0x1b66a4][_0xcc35('0x5e')]){_0x944436[_0xcc35('0x13')][_0x8ecbf4]['answered']+=0x1;_0x944436[_0xcc35('0x13')][_0x8ecbf4]['sumBillable']+=moment(_0x209578[_0x1ee82c][_0x1b66a4][_0xcc35('0x5c')])['diff'](moment(_0x209578[_0x1ee82c][_0x1b66a4][_0xcc35('0x58')]),_0xcc35('0x5b'))||0x0;}}else{_0x944436[_0xcc35('0x13')][_0x8ecbf4][_0xcc35('0x2e')]+=_0x944436[_0xcc35('0x13')][_0x8ecbf4][_0xcc35('0x2d')]||0x0;}}}}}}return _0x944436[_0xcc35('0x13')];};};Realtime[_0xcc35('0x3f')][_0xcc35('0x5f')]=function(){var _0x2e6f7d=this;return function(_0x282c96){clearVoiceCallReports(_0x2e6f7d[_0xcc35('0x17')]);if(_0x282c96){for(var _0x45dfb6=0x0;_0x45dfb6<_0x282c96[_0xcc35('0x42')];_0x45dfb6+=0x1){_0x2e6f7d['outbound']['total']+=0x1;_0x2e6f7d['outbound'][_0xcc35('0x2e')]+=_0x282c96[_0x45dfb6]['duration'];if(_0x282c96[_0x45dfb6][_0xcc35('0x60')]===_0xcc35('0x61')){_0x2e6f7d[_0xcc35('0x17')][_0xcc35('0x2c')]+=0x1;_0x2e6f7d[_0xcc35('0x17')][_0xcc35('0x2d')]+=_0x282c96[_0x45dfb6][_0xcc35('0x62')]-_0x282c96[_0x45dfb6][_0xcc35('0x63')]||0x0;_0x2e6f7d[_0xcc35('0x17')][_0xcc35('0x2f')]+=_0x282c96[_0x45dfb6][_0xcc35('0x63')];}}}return _0x2e6f7d[_0xcc35('0x17')];};};Realtime['prototype'][_0xcc35('0x64')]=function(){var _0x1ca06c=this;return function(_0x32956c){if(_0x32956c){freeIsNotKey(_0x32956c,_0x1ca06c[_0xcc35('0x15')],_0xcc35('0x27'));for(var _0x2ea0e9=0x0,_0x4ef50b={};_0x2ea0e9<_0x32956c['length'];_0x2ea0e9+=0x1){_0x4ef50b=_0x32956c[_0x2ea0e9];if(_[_0xcc35('0x43')](_0x1ca06c[_0xcc35('0x15')][_0x4ef50b[_0xcc35('0x27')]])){_0x1ca06c['campaigns'][_0x4ef50b[_0xcc35('0x27')]]=new Campaign(_0x4ef50b);}else{_0x1ca06c[_0xcc35('0x40')](_0x1ca06c[_0xcc35('0x15')][_0x4ef50b[_0xcc35('0x27')]],_0x4ef50b);_0x1ca06c[_0xcc35('0x15')][_0x4ef50b[_0xcc35('0x27')]]['dialQueueProject']=_0x4ef50b[_0xcc35('0x65')]?_0x4ef50b[_0xcc35('0x65')][_0xcc35('0x27')]:undefined;}}}return _0x1ca06c[_0xcc35('0x15')];};};Realtime[_0xcc35('0x3f')][_0xcc35('0x66')]=function(){var _0x3044fe=this;return function(_0xc36124){if(_0xc36124){freeIsNotKey(_0xc36124,_0x3044fe['voiceExtensions'],'id');for(var _0x598ce7=0x0,_0x1fe2a7={};_0x598ce7<_0xc36124[_0xcc35('0x42')];_0x598ce7+=0x1){_0x1fe2a7=_0xc36124[_0x598ce7];if(_['isUndefined'](_0x3044fe[_0xcc35('0x67')][_0x1fe2a7['id']])){_0x3044fe[_0xcc35('0x67')][_0x1fe2a7['id']]=new VoiceExtension(_0x1fe2a7);}else{_0x3044fe[_0xcc35('0x40')](_0x3044fe['voiceExtensions'][_0x1fe2a7['id']],_0x1fe2a7);}}}return _0x3044fe[_0xcc35('0x67')];};};Realtime[_0xcc35('0x3f')][_0xcc35('0x68')]=function(){var _0x3b0d8a=this;return function(_0x526a20){clearCampaigns(_0x3b0d8a[_0xcc35('0x15')]);for(var _0x48e5ba=0x0;_0x48e5ba<_0x526a20[_0xcc35('0x42')];_0x48e5ba+=0x1){_[_0xcc35('0x69')](_0x3b0d8a[_0xcc35('0x15')][_0x526a20[_0x48e5ba]['name']],_0x526a20[_0x48e5ba]);}return _0x3b0d8a['campaigns'];};};Realtime[_0xcc35('0x3f')]['initFaxAccounts']=function(){var _0x2e4495=this;return function(_0x413c44){if(_0x413c44){freeIsNotKey(_0x413c44,_0x2e4495[_0xcc35('0x23')],'id');for(var _0x3048c7=0x0,_0x402565={},_0x55e56c={};_0x3048c7<_0x413c44[_0xcc35('0x42')];_0x3048c7+=0x1){_0x402565=_0x413c44[_0x3048c7];if(_[_0xcc35('0x43')](_0x2e4495[_0xcc35('0x23')][_0x402565['id']])){_0x2e4495[_0xcc35('0x23')][_0x402565['id']]=new FaxAccount(_0x402565);}else{_0x2e4495[_0xcc35('0x40')](_0x2e4495[_0xcc35('0x23')][_0x402565['id']],_0x402565);}}}return _0x2e4495[_0xcc35('0x23')];};};module[_0xcc35('0x6a')]=Realtime; \ No newline at end of file +var _0xef14=['hasOwnProperty','mapKeys','format','name','isNil','interface','SIP/%s','total','answered','sumHoldTime','sumBillable','isEmpty','ivrAnswerCallsDay','sumDuration','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','initAgents','length','isUndefined','mergeFromDatabase','initTelephones','telephones','initTrunks','initVoiceQueues','initTemplates','initZendeskAccounts','initFreshdeskAccounts','initZohoAccounts','initDeskAccounts','deskAccounts','initSugarcrmAccounts','initVtigerAccounts','initDynamics365Accounts','initVoiceQueueHopperHistory','merge','groupBy','queuecallerexit','unmanaged','queuecallerabandon','abandoned','queuecallerleaveAt','queuecallerjoinAt','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','seconds','queuecallercomplete','initVoiceCallReports','outbound','disposition','ANSWERED','billableseconds','initCampaigns','dialQueueProject','SquareProject','initCampaignHopperHistory','bluebird','util','lodash','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/zendeskAccount','../model/salesforceAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/freshsalesAccount','agents','trunks','voiceQueues','triggers','campaigns','templates','voiceExtensions','channels','outboundChannels','timers','settings','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts'];(function(_0x10ddb0,_0xce8826){var _0x238105=function(_0xc376b7){while(--_0xc376b7){_0x10ddb0['push'](_0x10ddb0['shift']());}};_0x238105(++_0xce8826);}(_0xef14,0x10e));var _0x4ef1=function(_0x235a88,_0x4fca20){_0x235a88=_0x235a88-0x0;var _0x1d8323=_0xef14[_0x235a88];return _0x1d8323;};'use strict';var BPromise=require(_0x4ef1('0x0'));var util=require(_0x4ef1('0x1'));var _=require(_0x4ef1('0x2'));var moment=require('moment');var Agent=require(_0x4ef1('0x3'));var Telephone=require(_0x4ef1('0x4'));var Trunk=require(_0x4ef1('0x5'));var VoiceQueue=require(_0x4ef1('0x6'));var Trigger=require(_0x4ef1('0x7'));var Template=require(_0x4ef1('0x8'));var Campaign=require(_0x4ef1('0x9'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require(_0x4ef1('0xa'));var SalesforceAccount=require(_0x4ef1('0xb'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require(_0x4ef1('0xc'));var ZohoAccount=require(_0x4ef1('0xd'));var DeskAccount=require(_0x4ef1('0xe'));var VtigerAccount=require(_0x4ef1('0xf'));var ServicenowAccount=require(_0x4ef1('0x10'));var Dynamics365Account=require('../model/dynamics365Account');var FreshsalesAccount=require(_0x4ef1('0x11'));var FaxAccount=require('../model/faxAccount');var Realtime=function(){this[_0x4ef1('0x12')]={};this['telephones']={};this[_0x4ef1('0x13')]={};this[_0x4ef1('0x14')]={};this[_0x4ef1('0x15')]={};this[_0x4ef1('0x16')]={};this[_0x4ef1('0x17')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x4ef1('0x18')]={};this[_0x4ef1('0x19')]={};this['queueChannels']={};this[_0x4ef1('0x1a')]={};this[_0x4ef1('0x1b')]={};this[_0x4ef1('0x1c')]={};this[_0x4ef1('0x1d')]={};this[_0x4ef1('0x1e')]={};this[_0x4ef1('0x1f')]={};this[_0x4ef1('0x20')]={};this[_0x4ef1('0x21')]={};this['deskAccounts']={};this[_0x4ef1('0x22')]={};this[_0x4ef1('0x23')]={};this[_0x4ef1('0x24')]={};this[_0x4ef1('0x25')]={};this[_0x4ef1('0x26')]={};};function freeIsNotKey(_0x3e5890,_0x29b33d,_0x5add7f){var _0x2f8d6f=_['mapKeys'](_0x3e5890,function(_0xf1cd7b,_0x10d10e){return _0xf1cd7b[_0x5add7f];});for(var _0x324e13 in _0x29b33d){if(_0x29b33d[_0x4ef1('0x27')](_0x324e13)){if(!_0x2f8d6f[_0x324e13]){delete _0x29b33d[_0x324e13];}}}}function freeIsNotKeySip(_0x23717,_0x17e10b){var _0x3f8149=_[_0x4ef1('0x28')](_0x23717,function(_0xa18bf7,_0x597d49){return util[_0x4ef1('0x29')]('SIP/%s',_0xa18bf7[_0x4ef1('0x2a')]);});for(var _0x217f9b in _0x17e10b){if(_0x17e10b['hasOwnProperty'](_0x217f9b)){if(!_0x3f8149[_0x217f9b]){delete _0x17e10b[_0x217f9b];}}}}function freeIsNotKeyAgent(_0x28566e,_0x439690){var _0x5ede48=_[_0x4ef1('0x28')](_0x28566e,function(_0x325770,_0x18d2e2){var _0x553560=_[_0x4ef1('0x2b')](_0x325770[_0x4ef1('0x2c')])?util['format'](_0x4ef1('0x2d'),_0x325770[_0x4ef1('0x2a')]):_0x325770['interface'];return _0x553560;});for(var _0x14156c in _0x439690){if(_0x439690[_0x4ef1('0x27')](_0x14156c)){if(!_0x5ede48[_0x14156c]){delete _0x439690[_0x14156c];}}}}function clearVoiceCallReports(_0x3fd491){_0x3fd491[_0x4ef1('0x2e')]=0x0;_0x3fd491[_0x4ef1('0x2f')]=0x0;_0x3fd491[_0x4ef1('0x30')]=0x0;_0x3fd491['sumDuration']=0x0;_0x3fd491[_0x4ef1('0x31')]=0x0;}function clearCampaigns(_0x4862c8){if(!_[_0x4ef1('0x32')](_0x4862c8)){for(var _0x357b60 in _0x4862c8){if(_0x4862c8['hasOwnProperty'](_0x357b60)){_0x4862c8[_0x357b60]['ivrTotalCallsDays']=0x0;_0x4862c8[_0x357b60][_0x4ef1('0x33')]=0x0;}}}}function clearVoiceQueues(_0x4875ba){if(!_[_0x4ef1('0x32')](_0x4875ba)){for(var _0x29a089 in _0x4875ba){if(_0x4875ba['hasOwnProperty'](_0x29a089)){_0x4875ba[_0x29a089]['total']=0x0;_0x4875ba[_0x29a089][_0x4ef1('0x2f')]=0x0;_0x4875ba[_0x29a089]['unmanaged']=0x0;_0x4875ba[_0x29a089]['abandoned']=0x0;_0x4875ba[_0x29a089][_0x4ef1('0x30')]=0x0;_0x4875ba[_0x29a089][_0x4ef1('0x34')]=0x0;_0x4875ba[_0x29a089][_0x4ef1('0x31')]=0x0;_0x4875ba[_0x29a089][_0x4ef1('0x35')]=0x0;_0x4875ba[_0x29a089][_0x4ef1('0x36')]=0x0;_0x4875ba[_0x29a089]['outboundBusyCallsDay']=0x0;_0x4875ba[_0x29a089][_0x4ef1('0x37')]=0x0;_0x4875ba[_0x29a089]['outboundNoSuchCallsDay']=0x0;_0x4875ba[_0x29a089][_0x4ef1('0x38')]=0x0;_0x4875ba[_0x29a089][_0x4ef1('0x39')]=0x0;_0x4875ba[_0x29a089]['outboundDropCallsDayCallersExit']=0x0;_0x4875ba[_0x29a089]['outboundBlacklistCallsDay']=0x0;_0x4875ba[_0x29a089][_0x4ef1('0x3a')]=0x0;_0x4875ba[_0x29a089][_0x4ef1('0x3b')]=0x0;_0x4875ba[_0x29a089]['outboundReCallsDay']=0x0;_0x4875ba[_0x29a089]['outboundAnswerAgiCallsDay']=0x0;_0x4875ba[_0x29a089][_0x4ef1('0x3c')]=0x0;_0x4875ba[_0x29a089][_0x4ef1('0x3d')]=!![];}}}}Realtime[_0x4ef1('0x3e')]['mergeFromDatabase']=function(_0x466a59,_0x3da146){for(var _0x3699a7 in _0x3da146){if(_0x466a59[_0x4ef1('0x27')](_0x3699a7)){_0x466a59[_0x3699a7]=_0x3da146[_0x3699a7];}}};Realtime['prototype'][_0x4ef1('0x3f')]=function(){var _0x19f13f=this;return function(_0x548a0d){if(_0x548a0d){freeIsNotKeyAgent(_0x548a0d,_0x19f13f[_0x4ef1('0x12')]);for(var _0x5b5624=0x0,_0x57a98a={},_0xa5f7b3={};_0x5b5624<_0x548a0d[_0x4ef1('0x40')];_0x5b5624+=0x1){_0x57a98a=_0x548a0d[_0x5b5624];var _0x86b9f1=_['isNil'](_0x57a98a['interface'])?util[_0x4ef1('0x29')](_0x4ef1('0x2d'),_0x57a98a[_0x4ef1('0x2a')]):_0x57a98a[_0x4ef1('0x2c')];if(_[_0x4ef1('0x41')](_0x19f13f[_0x4ef1('0x12')][_0x86b9f1])){_0x19f13f[_0x4ef1('0x12')][_0x86b9f1]=new Agent(_0x57a98a);}else{_0x19f13f[_0x4ef1('0x42')](_0x19f13f['agents'][_0x86b9f1],_0x57a98a);}}}return _0x19f13f[_0x4ef1('0x12')];};};Realtime[_0x4ef1('0x3e')][_0x4ef1('0x43')]=function(){var _0x520c87=this;return function(_0x12c7e5){if(_0x12c7e5){freeIsNotKeySip(_0x12c7e5,_0x520c87[_0x4ef1('0x44')]);for(var _0x2659e8=0x0,_0x464d91={},_0x1ef1bb={};_0x2659e8<_0x12c7e5[_0x4ef1('0x40')];_0x2659e8+=0x1){_0x464d91=_0x12c7e5[_0x2659e8];if(_[_0x4ef1('0x41')](_0x520c87[_0x4ef1('0x44')][util[_0x4ef1('0x29')](_0x4ef1('0x2d'),_0x464d91['name'])])){_0x520c87[_0x4ef1('0x44')][util[_0x4ef1('0x29')](_0x4ef1('0x2d'),_0x464d91[_0x4ef1('0x2a')])]=new Telephone(_0x464d91);}else{_0x520c87['mergeFromDatabase'](_0x520c87[_0x4ef1('0x44')][util['format'](_0x4ef1('0x2d'),_0x464d91[_0x4ef1('0x2a')])],_0x464d91);}}}return _0x520c87[_0x4ef1('0x44')];};};Realtime[_0x4ef1('0x3e')][_0x4ef1('0x45')]=function(){var _0x4e69ef=this;return function(_0x926cdd){if(_0x926cdd){freeIsNotKeySip(_0x926cdd,_0x4e69ef[_0x4ef1('0x13')]);for(var _0x5c6855=0x0,_0x426ed5={},_0x20e71d={};_0x5c6855<_0x926cdd[_0x4ef1('0x40')];_0x5c6855+=0x1){_0x426ed5=_0x926cdd[_0x5c6855];if(_[_0x4ef1('0x41')](_0x4e69ef[_0x4ef1('0x13')][util[_0x4ef1('0x29')](_0x4ef1('0x2d'),_0x426ed5[_0x4ef1('0x2a')])])){_0x4e69ef[_0x4ef1('0x13')][util[_0x4ef1('0x29')](_0x4ef1('0x2d'),_0x426ed5[_0x4ef1('0x2a')])]=new Trunk(_0x426ed5);}else{_0x4e69ef[_0x4ef1('0x42')](_0x4e69ef['trunks'][util[_0x4ef1('0x29')](_0x4ef1('0x2d'),_0x426ed5[_0x4ef1('0x2a')])],_0x426ed5);}}}return _0x4e69ef['trunks'];};};Realtime['prototype'][_0x4ef1('0x46')]=function(){var _0x1e37d6=this;return function(_0x2d0ad8){if(_0x2d0ad8){freeIsNotKey(_0x2d0ad8,_0x1e37d6[_0x4ef1('0x14')],_0x4ef1('0x2a'));for(var _0x228bd5=0x0,_0x44877a={},_0x1fa7ff={};_0x228bd5<_0x2d0ad8['length'];_0x228bd5+=0x1){_0x44877a=_0x2d0ad8[_0x228bd5];if(_['isUndefined'](_0x1e37d6[_0x4ef1('0x14')][_0x44877a['name']])){_0x1e37d6['voiceQueues'][_0x44877a[_0x4ef1('0x2a')]]=new VoiceQueue(_0x44877a);}else{_0x1e37d6['mergeFromDatabase'](_0x1e37d6[_0x4ef1('0x14')][_0x44877a[_0x4ef1('0x2a')]],_0x44877a);}}}return _0x1e37d6['voiceQueues'];};};Realtime['prototype']['initTriggers']=function(){var _0x13bb8b=this;return function(_0x3ce712){if(_0x3ce712){freeIsNotKey(_0x3ce712,_0x13bb8b['triggers'],'id');for(var _0x174d50=0x0,_0x4e26ed={},_0x7042bd={};_0x174d50<_0x3ce712[_0x4ef1('0x40')];_0x174d50+=0x1){_0x4e26ed=_0x3ce712[_0x174d50];if(_['isUndefined'](_0x13bb8b['triggers'][_0x4e26ed['id']])){_0x13bb8b[_0x4ef1('0x15')][_0x4e26ed['id']]=new Trigger(_0x4e26ed);}else{_0x13bb8b['mergeFromDatabase'](_0x13bb8b['triggers'][_0x4e26ed['id']],_0x4e26ed);}}}return _0x13bb8b['triggers'];};};Realtime['prototype'][_0x4ef1('0x47')]=function(){var _0x21d8b0=this;return function(_0x3acabc){if(_0x3acabc){freeIsNotKey(_0x3acabc,_0x21d8b0['templates'],'id');for(var _0x6cccf4=0x0,_0x3f5a78={},_0x5d679a={};_0x6cccf4<_0x3acabc['length'];_0x6cccf4+=0x1){_0x3f5a78=_0x3acabc[_0x6cccf4];if(_['isUndefined'](_0x21d8b0[_0x4ef1('0x17')][_0x3f5a78['id']])){_0x21d8b0[_0x4ef1('0x17')][_0x3f5a78['id']]=new Template(_0x3f5a78);}else{_0x21d8b0[_0x4ef1('0x42')](_0x21d8b0[_0x4ef1('0x17')][_0x3f5a78['id']],_0x3f5a78);}}}return _0x21d8b0[_0x4ef1('0x17')];};};Realtime[_0x4ef1('0x3e')][_0x4ef1('0x48')]=function(){var _0x5a4444=this;return function(_0x199453){if(_0x199453){freeIsNotKey(_0x199453,_0x5a4444[_0x4ef1('0x1d')],'id');for(var _0x51bae5=0x0,_0x4337af={},_0x771994={};_0x51bae5<_0x199453['length'];_0x51bae5+=0x1){_0x4337af=_0x199453[_0x51bae5];if(_[_0x4ef1('0x41')](_0x5a4444['zendeskAccounts'][_0x4337af['id']])){_0x5a4444[_0x4ef1('0x1d')][_0x4337af['id']]=new ZendeskAccount(_0x4337af);}else{_0x5a4444[_0x4ef1('0x42')](_0x5a4444[_0x4ef1('0x1d')][_0x4337af['id']],_0x4337af);}}}return _0x5a4444[_0x4ef1('0x1d')];};};Realtime[_0x4ef1('0x3e')]['initSalesforceAccounts']=function(){var _0x302dd1=this;return function(_0x1f2595){if(_0x1f2595){freeIsNotKey(_0x1f2595,_0x302dd1[_0x4ef1('0x1e')],'id');for(var _0x1024d6=0x0,_0x2e46e6={},_0x289981={};_0x1024d6<_0x1f2595[_0x4ef1('0x40')];_0x1024d6+=0x1){_0x2e46e6=_0x1f2595[_0x1024d6];if(_['isUndefined'](_0x302dd1[_0x4ef1('0x1e')][_0x2e46e6['id']])){_0x302dd1[_0x4ef1('0x1e')][_0x2e46e6['id']]=new SalesforceAccount(_0x2e46e6);}else{_0x302dd1[_0x4ef1('0x42')](_0x302dd1['salesforceAccounts'][_0x2e46e6['id']],_0x2e46e6);}}}return _0x302dd1[_0x4ef1('0x1e')];};};Realtime[_0x4ef1('0x3e')][_0x4ef1('0x49')]=function(){var _0x8d025e=this;return function(_0x2cead7){if(_0x2cead7){freeIsNotKey(_0x2cead7,_0x8d025e[_0x4ef1('0x20')],'id');for(var _0x15a3a3=0x0,_0x5e2f43={},_0x26c686={};_0x15a3a3<_0x2cead7['length'];_0x15a3a3+=0x1){_0x5e2f43=_0x2cead7[_0x15a3a3];if(_[_0x4ef1('0x41')](_0x8d025e[_0x4ef1('0x20')][_0x5e2f43['id']])){_0x8d025e[_0x4ef1('0x20')][_0x5e2f43['id']]=new FreshdeskAccount(_0x5e2f43);}else{_0x8d025e[_0x4ef1('0x42')](_0x8d025e[_0x4ef1('0x20')][_0x5e2f43['id']],_0x5e2f43);}}}return _0x8d025e['freshdeskAccounts'];};};Realtime[_0x4ef1('0x3e')][_0x4ef1('0x4a')]=function(){var _0x44b0f9=this;return function(_0x1bf72b){if(_0x1bf72b){freeIsNotKey(_0x1bf72b,_0x44b0f9[_0x4ef1('0x21')],'id');for(var _0x1a280c=0x0,_0x4c88ef={},_0x447d73={};_0x1a280c<_0x1bf72b[_0x4ef1('0x40')];_0x1a280c+=0x1){_0x4c88ef=_0x1bf72b[_0x1a280c];if(_['isUndefined'](_0x44b0f9[_0x4ef1('0x21')][_0x4c88ef['id']])){_0x44b0f9['zohoAccounts'][_0x4c88ef['id']]=new ZohoAccount(_0x4c88ef);}else{_0x44b0f9[_0x4ef1('0x42')](_0x44b0f9[_0x4ef1('0x21')][_0x4c88ef['id']],_0x4c88ef);}}}return _0x44b0f9['zohoAccounts'];};};Realtime[_0x4ef1('0x3e')][_0x4ef1('0x4b')]=function(){var _0x5c6336=this;return function(_0x1fc6c0){if(_0x1fc6c0){freeIsNotKey(_0x1fc6c0,_0x5c6336[_0x4ef1('0x4c')],'id');for(var _0x32681a=0x0,_0x4913b1={},_0x2c176f={};_0x32681a<_0x1fc6c0[_0x4ef1('0x40')];_0x32681a+=0x1){_0x4913b1=_0x1fc6c0[_0x32681a];if(_[_0x4ef1('0x41')](_0x5c6336['deskAccounts'][_0x4913b1['id']])){_0x5c6336[_0x4ef1('0x4c')][_0x4913b1['id']]=new DeskAccount(_0x4913b1);}else{_0x5c6336[_0x4ef1('0x42')](_0x5c6336[_0x4ef1('0x4c')][_0x4913b1['id']],_0x4913b1);}}}return _0x5c6336[_0x4ef1('0x4c')];};};Realtime['prototype'][_0x4ef1('0x4d')]=function(){var _0x8c5a7d=this;return function(_0x4329e5){if(_0x4329e5){freeIsNotKey(_0x4329e5,_0x8c5a7d[_0x4ef1('0x1f')],'id');for(var _0x5d2243=0x0,_0x4d2d8a={},_0x455dab={};_0x5d2243<_0x4329e5[_0x4ef1('0x40')];_0x5d2243+=0x1){_0x4d2d8a=_0x4329e5[_0x5d2243];if(_[_0x4ef1('0x41')](_0x8c5a7d[_0x4ef1('0x1f')][_0x4d2d8a['id']])){_0x8c5a7d[_0x4ef1('0x1f')][_0x4d2d8a['id']]=new SugarcrmAccount(_0x4d2d8a);}else{_0x8c5a7d[_0x4ef1('0x42')](_0x8c5a7d[_0x4ef1('0x1f')][_0x4d2d8a['id']],_0x4d2d8a);}}}return _0x8c5a7d[_0x4ef1('0x1f')];};};Realtime[_0x4ef1('0x3e')][_0x4ef1('0x4e')]=function(){var _0x3d0f51=this;return function(_0x38d1c7){if(_0x38d1c7){freeIsNotKey(_0x38d1c7,_0x3d0f51['vtigerAccounts'],'id');for(var _0x6ada96=0x0,_0x23d8d2={},_0x388578={};_0x6ada96<_0x38d1c7[_0x4ef1('0x40')];_0x6ada96+=0x1){_0x23d8d2=_0x38d1c7[_0x6ada96];if(_[_0x4ef1('0x41')](_0x3d0f51[_0x4ef1('0x22')][_0x23d8d2['id']])){_0x3d0f51[_0x4ef1('0x22')][_0x23d8d2['id']]=new VtigerAccount(_0x23d8d2);}else{_0x3d0f51[_0x4ef1('0x42')](_0x3d0f51[_0x4ef1('0x22')][_0x23d8d2['id']],_0x23d8d2);}}}return _0x3d0f51[_0x4ef1('0x22')];};};Realtime[_0x4ef1('0x3e')]['initServicenowAccounts']=function(){var _0x180389=this;return function(_0x519574){if(_0x519574){freeIsNotKey(_0x519574,_0x180389['servicenowAccounts'],'id');for(var _0x2d01b9=0x0,_0x2a9d6d={},_0x273739={};_0x2d01b9<_0x519574['length'];_0x2d01b9+=0x1){_0x2a9d6d=_0x519574[_0x2d01b9];if(_[_0x4ef1('0x41')](_0x180389[_0x4ef1('0x23')][_0x2a9d6d['id']])){_0x180389[_0x4ef1('0x23')][_0x2a9d6d['id']]=new ServicenowAccount(_0x2a9d6d);}else{_0x180389[_0x4ef1('0x42')](_0x180389['servicenowAccounts'][_0x2a9d6d['id']],_0x2a9d6d);}}}return _0x180389[_0x4ef1('0x23')];};};Realtime[_0x4ef1('0x3e')][_0x4ef1('0x4f')]=function(){var _0x2cbb59=this;return function(_0x5a9845){if(_0x5a9845){freeIsNotKey(_0x5a9845,_0x2cbb59[_0x4ef1('0x24')],'id');for(var _0x9472bd=0x0,_0x20334c={},_0x5e15fd={};_0x9472bd<_0x5a9845[_0x4ef1('0x40')];_0x9472bd+=0x1){_0x20334c=_0x5a9845[_0x9472bd];if(_[_0x4ef1('0x41')](_0x2cbb59[_0x4ef1('0x24')][_0x20334c['id']])){_0x2cbb59[_0x4ef1('0x24')][_0x20334c['id']]=new Dynamics365Account(_0x20334c);}else{_0x2cbb59[_0x4ef1('0x42')](_0x2cbb59[_0x4ef1('0x24')][_0x20334c['id']],_0x20334c);}}}return _0x2cbb59[_0x4ef1('0x24')];};};Realtime[_0x4ef1('0x3e')]['initFreshsalesAccounts']=function(){var _0x5e284a=this;return function(_0x28048d){if(_0x28048d){freeIsNotKey(_0x28048d,_0x5e284a['freshsalesAccounts'],'id');for(var _0x4f954a=0x0,_0x46e2d7={},_0x2fc6b5={};_0x4f954a<_0x28048d[_0x4ef1('0x40')];_0x4f954a+=0x1){_0x46e2d7=_0x28048d[_0x4f954a];if(_[_0x4ef1('0x41')](_0x5e284a[_0x4ef1('0x25')][_0x46e2d7['id']])){_0x5e284a[_0x4ef1('0x25')][_0x46e2d7['id']]=new FreshsalesAccount(_0x46e2d7);}else{_0x5e284a[_0x4ef1('0x42')](_0x5e284a[_0x4ef1('0x25')][_0x46e2d7['id']],_0x46e2d7);}}}return _0x5e284a[_0x4ef1('0x25')];};};Realtime[_0x4ef1('0x3e')][_0x4ef1('0x50')]=function(){var _0x476713=this;return function(_0x397ee0){for(var _0x21058f=0x0;_0x21058f<_0x397ee0[_0x4ef1('0x40')];_0x21058f+=0x1){_[_0x4ef1('0x51')](_0x476713[_0x4ef1('0x14')][_0x397ee0[_0x21058f]['name']],_0x397ee0[_0x21058f]);}return _0x476713['voiceQueues'];};};Realtime[_0x4ef1('0x3e')]['initVoiceQueueReports']=function(){var _0x3803be=this;return function(_0x3e10b8){clearVoiceQueues(_0x3803be[_0x4ef1('0x14')]);if(_0x3e10b8){_0x3e10b8=_[_0x4ef1('0x52')](_0x3e10b8,'uniqueid');for(var _0x2c8d69 in _0x3e10b8){if(_0x3e10b8['hasOwnProperty'](_0x2c8d69)){var _0x2b898b={};for(var _0xbcf936=0x0;_0xbcf936<_0x3e10b8[_0x2c8d69][_0x4ef1('0x40')];_0xbcf936+=0x1){var _0xfa3e1c=_0x3e10b8[_0x2c8d69][_0xbcf936]['queue'];if(_0x3803be[_0x4ef1('0x14')][_0xfa3e1c]){if(_0x3e10b8[_0x2c8d69][_0xbcf936][_0x4ef1('0x53')]){_0x3803be['voiceQueues'][_0xfa3e1c][_0x4ef1('0x54')]+=0x1;}if(_0x3e10b8[_0x2c8d69][_0xbcf936][_0x4ef1('0x55')]){_0x3803be[_0x4ef1('0x14')][_0xfa3e1c][_0x4ef1('0x56')]+=0x1;}_0x3803be[_0x4ef1('0x14')][_0xfa3e1c][_0x4ef1('0x30')]+=moment(_0x3e10b8[_0x2c8d69][_0xbcf936][_0x4ef1('0x57')])['diff'](moment(_0x3e10b8[_0x2c8d69][_0xbcf936][_0x4ef1('0x58')]),'seconds')||0x0;if(_0xbcf936===_0x3e10b8[_0x2c8d69][_0x4ef1('0x40')]-0x1){_0x3803be['voiceQueues'][_0xfa3e1c][_0x4ef1('0x34')]+=moment(_0x3e10b8[_0x2c8d69][_0xbcf936][_0x4ef1('0x59')]||_0x3e10b8[_0x2c8d69][_0xbcf936][_0x4ef1('0x5a')]||_0x3e10b8[_0x2c8d69][_0xbcf936][_0x4ef1('0x5b')])['diff'](moment(_0x3e10b8[_0x2c8d69][_0xbcf936]['queuecallerjoinAt']),_0x4ef1('0x5c'))||0x0;_0x3803be[_0x4ef1('0x14')][_0xfa3e1c]['total']+=0x1;if(_0x3e10b8[_0x2c8d69][_0xbcf936][_0x4ef1('0x5d')]){_0x3803be[_0x4ef1('0x14')][_0xfa3e1c][_0x4ef1('0x2f')]+=0x1;_0x3803be[_0x4ef1('0x14')][_0xfa3e1c]['sumBillable']+=moment(_0x3e10b8[_0x2c8d69][_0xbcf936]['queuecallercompleteAt'])['diff'](moment(_0x3e10b8[_0x2c8d69][_0xbcf936][_0x4ef1('0x57')]),'seconds')||0x0;}}else{_0x3803be[_0x4ef1('0x14')][_0xfa3e1c]['sumDuration']+=_0x3803be['voiceQueues'][_0xfa3e1c][_0x4ef1('0x30')]||0x0;}}}}}}return _0x3803be[_0x4ef1('0x14')];};};Realtime['prototype'][_0x4ef1('0x5e')]=function(){var _0x10fa38=this;return function(_0x43cf9a){clearVoiceCallReports(_0x10fa38['outbound']);if(_0x43cf9a){for(var _0x4c77dc=0x0;_0x4c77dc<_0x43cf9a[_0x4ef1('0x40')];_0x4c77dc+=0x1){_0x10fa38[_0x4ef1('0x5f')]['total']+=0x1;_0x10fa38[_0x4ef1('0x5f')][_0x4ef1('0x34')]+=_0x43cf9a[_0x4c77dc]['duration'];if(_0x43cf9a[_0x4c77dc][_0x4ef1('0x60')]===_0x4ef1('0x61')){_0x10fa38['outbound'][_0x4ef1('0x2f')]+=0x1;_0x10fa38['outbound'][_0x4ef1('0x30')]+=_0x43cf9a[_0x4c77dc]['duration']-_0x43cf9a[_0x4c77dc][_0x4ef1('0x62')]||0x0;_0x10fa38['outbound'][_0x4ef1('0x31')]+=_0x43cf9a[_0x4c77dc][_0x4ef1('0x62')];}}}return _0x10fa38['outbound'];};};Realtime[_0x4ef1('0x3e')][_0x4ef1('0x63')]=function(){var _0x4d5a8f=this;return function(_0x4f08bb){if(_0x4f08bb){freeIsNotKey(_0x4f08bb,_0x4d5a8f[_0x4ef1('0x16')],_0x4ef1('0x2a'));for(var _0x39462a=0x0,_0x3ff848={};_0x39462a<_0x4f08bb[_0x4ef1('0x40')];_0x39462a+=0x1){_0x3ff848=_0x4f08bb[_0x39462a];if(_[_0x4ef1('0x41')](_0x4d5a8f[_0x4ef1('0x16')][_0x3ff848[_0x4ef1('0x2a')]])){_0x4d5a8f[_0x4ef1('0x16')][_0x3ff848['name']]=new Campaign(_0x3ff848);}else{_0x4d5a8f[_0x4ef1('0x42')](_0x4d5a8f[_0x4ef1('0x16')][_0x3ff848[_0x4ef1('0x2a')]],_0x3ff848);_0x4d5a8f[_0x4ef1('0x16')][_0x3ff848['name']][_0x4ef1('0x64')]=_0x3ff848[_0x4ef1('0x65')]?_0x3ff848[_0x4ef1('0x65')]['name']:undefined;}}}return _0x4d5a8f['campaigns'];};};Realtime[_0x4ef1('0x3e')]['initVoiceExtensions']=function(){var _0x1371ce=this;return function(_0x33ccb2){if(_0x33ccb2){freeIsNotKey(_0x33ccb2,_0x1371ce[_0x4ef1('0x18')],'id');for(var _0x3db1f4=0x0,_0x250f0d={};_0x3db1f4<_0x33ccb2[_0x4ef1('0x40')];_0x3db1f4+=0x1){_0x250f0d=_0x33ccb2[_0x3db1f4];if(_[_0x4ef1('0x41')](_0x1371ce[_0x4ef1('0x18')][_0x250f0d['id']])){_0x1371ce['voiceExtensions'][_0x250f0d['id']]=new VoiceExtension(_0x250f0d);}else{_0x1371ce[_0x4ef1('0x42')](_0x1371ce[_0x4ef1('0x18')][_0x250f0d['id']],_0x250f0d);}}}return _0x1371ce[_0x4ef1('0x18')];};};Realtime['prototype'][_0x4ef1('0x66')]=function(){var _0x3d9ffd=this;return function(_0x234300){clearCampaigns(_0x3d9ffd['campaigns']);for(var _0x3de117=0x0;_0x3de117<_0x234300[_0x4ef1('0x40')];_0x3de117+=0x1){_[_0x4ef1('0x51')](_0x3d9ffd[_0x4ef1('0x16')][_0x234300[_0x3de117][_0x4ef1('0x2a')]],_0x234300[_0x3de117]);}return _0x3d9ffd[_0x4ef1('0x16')];};};Realtime[_0x4ef1('0x3e')]['initFaxAccounts']=function(){var _0x242668=this;return function(_0x49bc55){if(_0x49bc55){freeIsNotKey(_0x49bc55,_0x242668[_0x4ef1('0x26')],'id');for(var _0x26df63=0x0,_0x225ccb={},_0x56d051={};_0x26df63<_0x49bc55[_0x4ef1('0x40')];_0x26df63+=0x1){_0x225ccb=_0x49bc55[_0x26df63];if(_[_0x4ef1('0x41')](_0x242668[_0x4ef1('0x26')][_0x225ccb['id']])){_0x242668[_0x4ef1('0x26')][_0x225ccb['id']]=new FaxAccount(_0x225ccb);}else{_0x242668['mergeFromDatabase'](_0x242668[_0x4ef1('0x26')][_0x225ccb['id']],_0x225ccb);}}}return _0x242668[_0x4ef1('0x26')];};};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 7ad0754..ac1b0db 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 _0xac6f=['find','agents','accountcode','name','isNil','interface','format','length','assigned','lastAssignedTo','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','YYYY-MM-DD\x20HH:mm:ss','create','match','voiceCallReport','destination','exten','type','lastapplication','queue','lastdata','context','from-voip-provider','callerid','from-sip','xcally-motion-preview','calleridnum','destinationchannel','channel','calleridpreview','originatecalleridnum','disposition','ANSWERED','connectedlinenum','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','monitor','monitors','monitorFilename','createdAt','connectedlinename','xcally-motion-dialer','isArray','forEach','substring','indexOf','mobile','phone','lastIndexOf','SIP/%s','transfererlinkedid','exports','lodash','moment','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceAgentReport','./voiceDialReport','telephones','prototype','sync','realtime','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','custom:voiceCallReport','bind','custom:voiceAgentReport','voiceAgentReport','voiceDialReport','blindTransfer','attendedTransfer','findAgent'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0xac6f,0x91));var _0xfac6=function(_0x3833f4,_0x5bfad2){_0x3833f4=_0x3833f4-0x0;var _0x4eadfb=_0xac6f[_0x3833f4];return _0x4eadfb;};'use strict';var _=require(_0xfac6('0x0'));var moment=require(_0xfac6('0x1'));var util=require(_0xfac6('0x2'));var config=require(_0xfac6('0x3'));var ami=require(_0xfac6('0x4'));var RpcVoiceAgentReport=require(_0xfac6('0x5'));var RpcVoiceCallReport=require(_0xfac6('0x6'));var RpcVoiceDialReport=require(_0xfac6('0x7'));var RpcMemberReport=require(_0xfac6('0x8'));var RpcVoiceQueueReport=require(_0xfac6('0x9'));var RpcVoiceRecording=require(_0xfac6('0xa'));var RpcVoiceTransferReport=require(_0xfac6('0xb'));var VoiceQueueReport=require(_0xfac6('0xc'));var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require(_0xfac6('0xd'));var VoiceDialReport=require(_0xfac6('0xe'));var UserReport=require('./userReport');function Report(_0xa3fb1b){this['realtime']=_0xa3fb1b;this['agents']=_0xa3fb1b['agents'];this[_0xfac6('0xf')]=_0xa3fb1b['telephones'];}Report[_0xfac6('0x10')][_0xfac6('0x11')]=function(_0x5d7ac2){var _0x21548b=new VoiceQueueReport(this[_0xfac6('0x12')]);var _0x11e787=new VoiceAgentReport(this[_0xfac6('0x12')]);var _0x1c044a=new VoiceDialReport(this['realtime']);var _0x23c429=new VoiceCallReport(this[_0xfac6('0x12')]);var _0x5ac912=new UserReport(this[_0xfac6('0x12')]);if(config[_0xfac6('0x13')]&&config['xdr'][_0xfac6('0x14')]){ami['on'](_0xfac6('0x15'),this[_0xfac6('0x16')]['bind'](this));ami['on'](_0xfac6('0x17'),this['voiceCallReport'][_0xfac6('0x18')](this));ami['on'](_0xfac6('0x19'),this[_0xfac6('0x1a')][_0xfac6('0x18')](this));ami['on']('custom:voiceDialReport',this[_0xfac6('0x1b')]['bind'](this));ami['on']('blindtransfer',this[_0xfac6('0x1c')][_0xfac6('0x18')](this));ami['on']('attendedtransfer',this[_0xfac6('0x1d')][_0xfac6('0x18')](this));}};Report[_0xfac6('0x10')][_0xfac6('0x1e')]=function(_0x356fdd){var _0x1eee3b;_0x1eee3b=_[_0xfac6('0x1f')](this[_0xfac6('0x20')],function(_0x125dba){return _0x125dba[_0xfac6('0x21')]==_0x356fdd||_0x125dba[_0xfac6('0x22')]==_0x356fdd;});if(_[_0xfac6('0x23')](_0x1eee3b)){var _0x1325f6=_[_0xfac6('0x1f')](this['telephones'],function(_0x14ab69){return _0x14ab69[_0xfac6('0x21')]==_0x356fdd||_0x14ab69['name']==_0x356fdd;});if(_0x1325f6){_0x1eee3b=_[_0xfac6('0x1f')](this[_0xfac6('0x20')],function(_0xa7dbee){return _0xa7dbee[_0xfac6('0x24')]==util[_0xfac6('0x25')]('SIP/%s',_0x1325f6[_0xfac6('0x22')]);});}}return _0x1eee3b;};Report[_0xfac6('0x10')]['voiceQueueReport']=function(_0x4815d6){for(var _0x4b59cf=0x0;_0x4b59cf<_0x4815d6[_0xfac6('0x26')];_0x4b59cf+=0x1){var _0x5a36f6=this[_0xfac6('0x1e')](_0x4815d6[_0x4b59cf]['connectedlinenum']);if(_0x5a36f6){_0x4815d6[_0x4b59cf]['accountcode']=_0x5a36f6['accountcode'];_0x4815d6[_0x4b59cf][_0xfac6('0x27')]=!![];_0x4815d6[_0x4b59cf][_0xfac6('0x28')]=_0x5a36f6[_0xfac6('0x22')];_0x4815d6[_0x4b59cf]['interface']=_[_0xfac6('0x23')](_0x5a36f6[_0xfac6('0x24')])?util[_0xfac6('0x25')]('SIP/%s',_0x5a36f6[_0xfac6('0x22')]):_0x5a36f6['interface'];if(_0x4815d6[_0x4b59cf]['queuecallercomplete']){_0x4815d6[_0x4b59cf][_0xfac6('0x29')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}if(_0x4815d6[_0x4b59cf][_0xfac6('0x2a')]){_0x4815d6[_0x4b59cf][_0xfac6('0x2b')]=moment()[_0xfac6('0x25')](_0xfac6('0x2c'));}RpcMemberReport[_0xfac6('0x16')](_0x4815d6[_0x4b59cf]);}RpcVoiceQueueReport[_0xfac6('0x2d')](_0x4815d6[_0x4b59cf]);}};function extractCalleridNumber(_0x31bd8a){var _0x2fe707=_0x31bd8a[_0xfac6('0x2e')](/<(.*?)>/);return _0x2fe707?_0x2fe707[0x1]:_0x31bd8a;}Report[_0xfac6('0x10')][_0xfac6('0x2f')]=function(_0x237a77){_0x237a77[_0xfac6('0x30')]=_0x237a77[_0xfac6('0x30')]||_0x237a77[_0xfac6('0x31')];if(_0x237a77[_0xfac6('0x32')]=='dialer'){_0x237a77[_0xfac6('0x33')]=_0xfac6('0x34');_0x237a77[_0xfac6('0x35')]=_0x237a77['queue'];if(_0x237a77[_0xfac6('0x36')]==_0xfac6('0x37')){_0x237a77['accountcode']='';_0x237a77['destination']=extractCalleridNumber(_0x237a77[_0xfac6('0x38')]);}else if(_0x237a77[_0xfac6('0x36')]==_0xfac6('0x39')){if(_0x237a77[_0xfac6('0x30')]==_0xfac6('0x3a')){_0x237a77[_0xfac6('0x30')]=extractCalleridNumber(_0x237a77['calleridpreview']);_0x237a77[_0xfac6('0x3b')]=_0x237a77['originatecalleridnum'];_0x237a77[_0xfac6('0x3c')]=[_0x237a77[_0xfac6('0x3d')],_0x237a77[_0xfac6('0x3d')]=_0x237a77[_0xfac6('0x3c')]][0x0];_0x237a77['callerid']=_0x237a77[_0xfac6('0x3e')];}else{_0x237a77[_0xfac6('0x30')]=_0x237a77[_0xfac6('0x3b')];_0x237a77['calleridnum']=_0x237a77[_0xfac6('0x3f')];if(_0x237a77[_0xfac6('0x40')]==_0xfac6('0x41')){_0x237a77[_0xfac6('0x21')]=_0x237a77[_0xfac6('0x42')];}else{_0x237a77[_0xfac6('0x21')]='';}}}}else{_0x237a77[_0xfac6('0x38')]=util[_0xfac6('0x25')]('\x22%s\x22\x20<%s>',_0x237a77[_0xfac6('0x43')],_0x237a77[_0xfac6('0x3b')]);}if(RpcVoiceTransferReport[_0xfac6('0x44')][_0x237a77['linkedid']]){var _0x36015b=RpcVoiceTransferReport[_0xfac6('0x44')][_0x237a77[_0xfac6('0x45')]];_0x36015b[_0xfac6('0x46')]=_0x237a77[_0xfac6('0x47')];RpcVoiceTransferReport[_0xfac6('0x1c')](_0x36015b);delete RpcVoiceTransferReport['transfers'][_0x237a77[_0xfac6('0x45')]];}RpcVoiceCallReport['create'](_0x237a77);if(_0x237a77[_0xfac6('0x48')]){for(var _0x56be1d=0x0;_0x56be1d<_0x237a77[_0xfac6('0x49')][_0xfac6('0x26')];_0x56be1d+=0x1){_0x237a77[_0xfac6('0x4a')]=_0x237a77['monitors'][_0x56be1d]['filename'];_0x237a77[_0xfac6('0x4b')]=_0x237a77[_0xfac6('0x49')][_0x56be1d]['createdAt'];if(_0x237a77[_0xfac6('0x31')]=='xcally-motion-preview'){_0x237a77[_0xfac6('0x3b')]=_0x237a77['connectedlinenum'];_0x237a77['calleridname']=_0x237a77[_0xfac6('0x4c')];_0x237a77[_0xfac6('0x42')]=_0x237a77['accountcode'];_0x237a77[_0xfac6('0x4c')]=_0x237a77['membername'];_0x237a77[_0xfac6('0x31')]=_0x237a77['originatecalleridnum'];}else if(_0x237a77[_0xfac6('0x31')]==_0xfac6('0x4d')){_0x237a77[_0xfac6('0x3b')]=_0x237a77[_0xfac6('0x30')];_0x237a77[_0xfac6('0x31')]=_0x237a77[_0xfac6('0x3f')];}RpcVoiceRecording[_0xfac6('0x2d')](_0x237a77);}}};Report['prototype'][_0xfac6('0x1a')]=function(_0x163ade){if(_[_0xfac6('0x4e')](_0x163ade)){_0x163ade[_0xfac6('0x4f')](function(_0x159ec4){RpcVoiceAgentReport['create'](_0x159ec4);});}else{RpcVoiceAgentReport[_0xfac6('0x2d')](_0x163ade);}};Report[_0xfac6('0x10')][_0xfac6('0x1b')]=function(_0x52e365){RpcVoiceDialReport[_0xfac6('0x2d')](_0x52e365);var _0x3308f3;var _0x1f095b;var _0x1d3905=_0x52e365[_0xfac6('0x3d')];if(_['startsWith'](_0x1d3905,'Local')){_0x1f095b=_0x1d3905[_0xfac6('0x50')](_0x1d3905[_0xfac6('0x51')]('/')+0x1,_0x1d3905[_0xfac6('0x51')]('@'));_0x3308f3=_[_0xfac6('0x1f')](this['agents'],function(_0x311674){return _0x311674[_0xfac6('0x52')]==_0x1f095b||_0x311674[_0xfac6('0x53')]==_0x1f095b||_0x311674[_0xfac6('0x21')]==_0x1f095b;});}else{_0x1f095b=_0x1d3905[_0xfac6('0x50')](_0x1d3905[_0xfac6('0x51')]('/')+0x1,_0x1d3905[_0xfac6('0x54')]('-'));_0x3308f3=this[_0xfac6('0x1e')](_0x1f095b);}if(_0x3308f3){_0x52e365[_0xfac6('0x24')]=_[_0xfac6('0x23')](_0x3308f3[_0xfac6('0x24')])?util[_0xfac6('0x25')](_0xfac6('0x55'),_0x3308f3['name']):_0x3308f3[_0xfac6('0x24')];_0x52e365['membername']=_0x3308f3['name'];_0x52e365[_0xfac6('0x21')]=_0x3308f3['accountcode'];RpcMemberReport['voiceDialReport'](_0x52e365);}};Report['prototype']['blindTransfer']=function(_0x3b8541){RpcVoiceTransferReport[_0xfac6('0x44')][_0x3b8541[_0xfac6('0x56')]]=_0x3b8541;};Report[_0xfac6('0x10')][_0xfac6('0x1d')]=function(_0xc0d663){RpcVoiceTransferReport['attendedTransfer'](_0xc0d663);};module[_0xfac6('0x57')]=Report; \ No newline at end of file +var _0x6f4e=['queuecallerexit','create','match','voiceCallReport','destination','exten','dialer','lastapplication','queue','lastdata','context','callerid','from-sip','xcally-motion-preview','calleridpreview','destinationchannel','channel','calleridnum','originatecalleridnum','disposition','connectedlinenum','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','monitor','monitors','monitorFilename','createdAt','connectedlinename','membername','xcally-motion-dialer','startsWith','Local','substring','indexOf','mobile','phone','exports','moment','util','../../../config/environment','../ami','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','realtime','agents','telephones','prototype','sync','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedTransfer','findAgent','accountcode','name','isNil','find','interface','format','SIP/%s','length','assigned','lastAssignedTo','queuecallercomplete','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x6f4e,0x7a));var _0xe6f4=function(_0x4d7cc7,_0xe2f8a3){_0x4d7cc7=_0x4d7cc7-0x0;var _0x56bfca=_0x6f4e[_0x4d7cc7];return _0x56bfca;};'use strict';var _=require('lodash');var moment=require(_0xe6f4('0x0'));var util=require(_0xe6f4('0x1'));var config=require(_0xe6f4('0x2'));var ami=require(_0xe6f4('0x3'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0xe6f4('0x4'));var RpcMemberReport=require(_0xe6f4('0x5'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require(_0xe6f4('0x6'));var RpcVoiceTransferReport=require(_0xe6f4('0x7'));var VoiceQueueReport=require(_0xe6f4('0x8'));var VoiceCallReport=require(_0xe6f4('0x9'));var VoiceAgentReport=require(_0xe6f4('0xa'));var VoiceDialReport=require('./voiceDialReport');var UserReport=require('./userReport');function Report(_0x24318f){this[_0xe6f4('0xb')]=_0x24318f;this[_0xe6f4('0xc')]=_0x24318f[_0xe6f4('0xc')];this[_0xe6f4('0xd')]=_0x24318f[_0xe6f4('0xd')];}Report[_0xe6f4('0xe')][_0xe6f4('0xf')]=function(_0x57eabb){var _0x56242b=new VoiceQueueReport(this['realtime']);var _0x33cf8c=new VoiceAgentReport(this['realtime']);var _0x1763e4=new VoiceDialReport(this[_0xe6f4('0xb')]);var _0x1e737c=new VoiceCallReport(this[_0xe6f4('0xb')]);var _0x258002=new UserReport(this[_0xe6f4('0xb')]);if(config['xdr']&&config[_0xe6f4('0x10')][_0xe6f4('0x11')]){ami['on'](_0xe6f4('0x12'),this[_0xe6f4('0x13')][_0xe6f4('0x14')](this));ami['on'](_0xe6f4('0x15'),this['voiceCallReport'][_0xe6f4('0x14')](this));ami['on'](_0xe6f4('0x16'),this[_0xe6f4('0x17')][_0xe6f4('0x14')](this));ami['on'](_0xe6f4('0x18'),this[_0xe6f4('0x19')][_0xe6f4('0x14')](this));ami['on'](_0xe6f4('0x1a'),this[_0xe6f4('0x1b')][_0xe6f4('0x14')](this));ami['on']('attendedtransfer',this[_0xe6f4('0x1c')][_0xe6f4('0x14')](this));}};Report[_0xe6f4('0xe')][_0xe6f4('0x1d')]=function(_0x58365c){var _0x3c197c;_0x3c197c=_['find'](this['agents'],function(_0x11e16e){return _0x11e16e[_0xe6f4('0x1e')]==_0x58365c||_0x11e16e[_0xe6f4('0x1f')]==_0x58365c;});if(_[_0xe6f4('0x20')](_0x3c197c)){var _0x248546=_[_0xe6f4('0x21')](this[_0xe6f4('0xd')],function(_0x3b2572){return _0x3b2572[_0xe6f4('0x1e')]==_0x58365c||_0x3b2572[_0xe6f4('0x1f')]==_0x58365c;});if(_0x248546){_0x3c197c=_[_0xe6f4('0x21')](this[_0xe6f4('0xc')],function(_0x267f42){return _0x267f42[_0xe6f4('0x22')]==util[_0xe6f4('0x23')](_0xe6f4('0x24'),_0x248546[_0xe6f4('0x1f')]);});}}return _0x3c197c;};Report[_0xe6f4('0xe')][_0xe6f4('0x13')]=function(_0x47c988){for(var _0x52572b=0x0;_0x52572b<_0x47c988[_0xe6f4('0x25')];_0x52572b+=0x1){var _0x445080=this['findAgent'](_0x47c988[_0x52572b]['connectedlinenum']);if(_0x445080){_0x47c988[_0x52572b][_0xe6f4('0x1e')]=_0x445080[_0xe6f4('0x1e')];_0x47c988[_0x52572b][_0xe6f4('0x26')]=!![];_0x47c988[_0x52572b][_0xe6f4('0x27')]=_0x445080[_0xe6f4('0x1f')];_0x47c988[_0x52572b]['interface']=_['isNil'](_0x445080[_0xe6f4('0x22')])?util[_0xe6f4('0x23')]('SIP/%s',_0x445080['name']):_0x445080[_0xe6f4('0x22')];if(_0x47c988[_0x52572b][_0xe6f4('0x28')]){_0x47c988[_0x52572b]['queuecallercompleteAt']=moment()['format'](_0xe6f4('0x29'));}if(_0x47c988[_0x52572b][_0xe6f4('0x2a')]){_0x47c988[_0x52572b]['queuecallerexitAt']=moment()[_0xe6f4('0x23')](_0xe6f4('0x29'));}RpcMemberReport['voiceQueueReport'](_0x47c988[_0x52572b]);}RpcVoiceQueueReport[_0xe6f4('0x2b')](_0x47c988[_0x52572b]);}};function extractCalleridNumber(_0x3d4170){var _0x521d31=_0x3d4170[_0xe6f4('0x2c')](/<(.*?)>/);return _0x521d31?_0x521d31[0x1]:_0x3d4170;}Report[_0xe6f4('0xe')][_0xe6f4('0x2d')]=function(_0x3ee315){_0x3ee315['destination']=_0x3ee315[_0xe6f4('0x2e')]||_0x3ee315[_0xe6f4('0x2f')];if(_0x3ee315['type']==_0xe6f4('0x30')){_0x3ee315[_0xe6f4('0x31')]=_0xe6f4('0x32');_0x3ee315[_0xe6f4('0x33')]=_0x3ee315['queue'];if(_0x3ee315[_0xe6f4('0x34')]=='from-voip-provider'){_0x3ee315['accountcode']='';_0x3ee315[_0xe6f4('0x2e')]=extractCalleridNumber(_0x3ee315[_0xe6f4('0x35')]);}else if(_0x3ee315[_0xe6f4('0x34')]==_0xe6f4('0x36')){if(_0x3ee315['destination']==_0xe6f4('0x37')){_0x3ee315[_0xe6f4('0x2e')]=extractCalleridNumber(_0x3ee315[_0xe6f4('0x38')]);_0x3ee315['calleridnum']=_0x3ee315['originatecalleridnum'];_0x3ee315[_0xe6f4('0x39')]=[_0x3ee315[_0xe6f4('0x3a')],_0x3ee315['channel']=_0x3ee315[_0xe6f4('0x39')]][0x0];_0x3ee315['callerid']=_0x3ee315[_0xe6f4('0x38')];}else{_0x3ee315[_0xe6f4('0x2e')]=_0x3ee315['calleridnum'];_0x3ee315[_0xe6f4('0x3b')]=_0x3ee315[_0xe6f4('0x3c')];if(_0x3ee315[_0xe6f4('0x3d')]=='ANSWERED'){_0x3ee315[_0xe6f4('0x1e')]=_0x3ee315[_0xe6f4('0x3e')];}else{_0x3ee315[_0xe6f4('0x1e')]='';}}}}else{_0x3ee315[_0xe6f4('0x35')]=util[_0xe6f4('0x23')](_0xe6f4('0x3f'),_0x3ee315[_0xe6f4('0x40')],_0x3ee315[_0xe6f4('0x3b')]);}if(RpcVoiceTransferReport[_0xe6f4('0x41')][_0x3ee315[_0xe6f4('0x42')]]){var _0x5b8c1c=RpcVoiceTransferReport[_0xe6f4('0x41')][_0x3ee315[_0xe6f4('0x42')]];_0x5b8c1c[_0xe6f4('0x43')]=_0x3ee315['uniqueid'];RpcVoiceTransferReport[_0xe6f4('0x1b')](_0x5b8c1c);delete RpcVoiceTransferReport['transfers'][_0x3ee315[_0xe6f4('0x42')]];}RpcVoiceCallReport[_0xe6f4('0x2b')](_0x3ee315);if(_0x3ee315[_0xe6f4('0x44')]){for(var _0x2ce3a9=0x0;_0x2ce3a9<_0x3ee315[_0xe6f4('0x45')][_0xe6f4('0x25')];_0x2ce3a9+=0x1){_0x3ee315[_0xe6f4('0x46')]=_0x3ee315['monitors'][_0x2ce3a9]['filename'];_0x3ee315[_0xe6f4('0x47')]=_0x3ee315['monitors'][_0x2ce3a9][_0xe6f4('0x47')];if(_0x3ee315['exten']==_0xe6f4('0x37')){_0x3ee315[_0xe6f4('0x3b')]=_0x3ee315[_0xe6f4('0x3e')];_0x3ee315[_0xe6f4('0x40')]=_0x3ee315[_0xe6f4('0x48')];_0x3ee315[_0xe6f4('0x3e')]=_0x3ee315['accountcode'];_0x3ee315[_0xe6f4('0x48')]=_0x3ee315[_0xe6f4('0x49')];_0x3ee315[_0xe6f4('0x2f')]=_0x3ee315[_0xe6f4('0x3c')];}else if(_0x3ee315['exten']==_0xe6f4('0x4a')){_0x3ee315['calleridnum']=_0x3ee315[_0xe6f4('0x2e')];_0x3ee315[_0xe6f4('0x2f')]=_0x3ee315['originatecalleridnum'];}RpcVoiceRecording[_0xe6f4('0x2b')](_0x3ee315);}}};Report[_0xe6f4('0xe')][_0xe6f4('0x17')]=function(_0x3a7853){if(_['isArray'](_0x3a7853)){_0x3a7853['forEach'](function(_0x14cb61){RpcVoiceAgentReport[_0xe6f4('0x2b')](_0x14cb61);});}else{RpcVoiceAgentReport['create'](_0x3a7853);}};Report[_0xe6f4('0xe')]['voiceDialReport']=function(_0x3c4d8d){RpcVoiceDialReport[_0xe6f4('0x2b')](_0x3c4d8d);var _0x37d40b;var _0x35ac65;var _0x5894a2=_0x3c4d8d[_0xe6f4('0x3a')];if(_[_0xe6f4('0x4b')](_0x5894a2,_0xe6f4('0x4c'))){_0x35ac65=_0x5894a2[_0xe6f4('0x4d')](_0x5894a2['indexOf']('/')+0x1,_0x5894a2[_0xe6f4('0x4e')]('@'));_0x37d40b=_['find'](this[_0xe6f4('0xc')],function(_0x2cdc75){return _0x2cdc75[_0xe6f4('0x4f')]==_0x35ac65||_0x2cdc75[_0xe6f4('0x50')]==_0x35ac65||_0x2cdc75['accountcode']==_0x35ac65;});}else{_0x35ac65=_0x5894a2['substring'](_0x5894a2[_0xe6f4('0x4e')]('/')+0x1,_0x5894a2['lastIndexOf']('-'));_0x37d40b=this[_0xe6f4('0x1d')](_0x35ac65);}if(_0x37d40b){_0x3c4d8d[_0xe6f4('0x22')]=_[_0xe6f4('0x20')](_0x37d40b[_0xe6f4('0x22')])?util[_0xe6f4('0x23')]('SIP/%s',_0x37d40b[_0xe6f4('0x1f')]):_0x37d40b[_0xe6f4('0x22')];_0x3c4d8d['membername']=_0x37d40b[_0xe6f4('0x1f')];_0x3c4d8d[_0xe6f4('0x1e')]=_0x37d40b[_0xe6f4('0x1e')];RpcMemberReport[_0xe6f4('0x19')](_0x3c4d8d);}};Report[_0xe6f4('0xe')][_0xe6f4('0x1b')]=function(_0x28722b){RpcVoiceTransferReport['transfers'][_0x28722b['transfererlinkedid']]=_0x28722b;};Report[_0xe6f4('0xe')][_0xe6f4('0x1c')]=function(_0x2cb9ce){RpcVoiceTransferReport['attendedTransfer'](_0x2cb9ce);};module[_0xe6f4('0x51')]=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index ef410d7..8293612 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 _0x5f18=['[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','exports','lodash','ioredis','bluebird','../../../config/environment','../ami','redis','localhost','socket.io-emitter','trunks','telephones','registryentry','syncRegistry','bind','registry','devicestatechange','syncDeviceState','peerstatus','syncPeerStatus','syncRealtimeShow','resolve','then','actionSipShowRegistry','catch','actionDeviceStateList','error','inspect','actionSipPeerStatus','prototype','isNotNull','isUndefined','emit','info','[userReport][registry]\x20registry:%s\x20state:%s','username','state','debug','omit','event','actionid','[userReport][registry]\x20sending\x20trunk:save\x20event:','format','trunk:%s','name','trunk:save','[userReport][registry]','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','[userReport][devicestatechange]','agents','local','toLowerCase','inuse','updateStatusRealtime','stateTime','toNumber','telephone:%s','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','indexOf','find','mobile','phone','accountcode','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','address','[userReport][peerstatus]','status'];(function(_0xaa3341,_0x2edfde){var _0x376555=function(_0x38d2a6){while(--_0x38d2a6){_0xaa3341['push'](_0xaa3341['shift']());}};_0x376555(++_0x2edfde);}(_0x5f18,0x1f4));var _0x85f1=function(_0x4ab887,_0x222b28){_0x4ab887=_0x4ab887-0x0;var _0x2f2f71=_0x5f18[_0x4ab887];return _0x2f2f71;};'use strict';var _=require(_0x85f1('0x0'));var moment=require('moment');var util=require('util');var Redis=require(_0x85f1('0x1'));var BPromise=require(_0x85f1('0x2'));var config=require(_0x85f1('0x3'));var logger=require('../../../config/logger')('ami');var ami=require(_0x85f1('0x4'));config[_0x85f1('0x5')]=_['defaults'](config[_0x85f1('0x5')],{'host':_0x85f1('0x6'),'port':0x18eb});var io=require(_0x85f1('0x7'))(new Redis(config[_0x85f1('0x5')]));function UserReport(_0x26a06a){this[_0x85f1('0x8')]=_0x26a06a[_0x85f1('0x8')];this['agents']=_0x26a06a['agents'];this[_0x85f1('0x9')]=_0x26a06a[_0x85f1('0x9')];ami['on'](_0x85f1('0xa'),this[_0x85f1('0xb')][_0x85f1('0xc')](this));ami['on'](_0x85f1('0xd'),this['syncRegistry'][_0x85f1('0xc')](this));ami['on'](_0x85f1('0xe'),this[_0x85f1('0xf')][_0x85f1('0xc')](this));ami['on'](_0x85f1('0x10'),this[_0x85f1('0x11')][_0x85f1('0xc')](this));return this[_0x85f1('0x12')]();}function showSipRegistrations(){Promise[_0x85f1('0x13')]()[_0x85f1('0x14')](ami[_0x85f1('0x15')]())[_0x85f1('0x16')](function(_0x3ebab9){logger['error']('[userReport][sipshowregistry]',util['inspect'](_0x3ebab9,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x85f1('0x13')]()[_0x85f1('0x14')](ami[_0x85f1('0x17')]())[_0x85f1('0x16')](function(_0x15ac8f){logger[_0x85f1('0x18')]('[userReport][devicestatelist]',util[_0x85f1('0x19')](_0x15ac8f,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x85f1('0x13')]()['then'](ami[_0x85f1('0x1a')]())[_0x85f1('0x16')](function(_0x418f65){logger[_0x85f1('0x18')]('[userReport][sippeerstatus]',util[_0x85f1('0x19')](_0x418f65,{'showHidden':![],'depth':null}));});}UserReport[_0x85f1('0x1b')]['syncRealtimeShow']=function(){setInterval(function(){BPromise[_0x85f1('0x13')]()['then'](showSipRegistrations())['then'](listDeviceStates())[_0x85f1('0x14')](showPeersStatus());},0x32c8);};UserReport[_0x85f1('0x1b')][_0x85f1('0x1c')]=function(_0x57ea46){return _0x57ea46!==null&&!_[_0x85f1('0x1d')](_0x57ea46);};UserReport[_0x85f1('0x1b')][_0x85f1('0x1e')]=function(_0x1e4a38,_0x581194,_0x2211e1){io['to'](_0x1e4a38)[_0x85f1('0x1e')](_0x581194,_0x2211e1);};UserReport[_0x85f1('0x1b')]['syncRegistry']=function(_0xedbae8){try{if(this[_0x85f1('0x1c')](_0xedbae8)){logger[_0x85f1('0x1f')](_0x85f1('0x20'),_0xedbae8[_0x85f1('0x21')],_0xedbae8[_0x85f1('0x22')]);logger[_0x85f1('0x23')]('[userReport][registry]',util[_0x85f1('0x19')](_0xedbae8,{'showHidden':![],'depth':null}));var _0x5858bc=_['find'](this[_0x85f1('0x8')],{'defaultuser':_0xedbae8[_0x85f1('0x21')]});if(_0x5858bc){_0xedbae8['stateRegistry']=_0xedbae8['state'];_['merge'](_0x5858bc,_[_0x85f1('0x24')](_0xedbae8,[_0x85f1('0x25'),_0x85f1('0x26'),_0x85f1('0x21'),'state']));logger[_0x85f1('0x23')](_0x85f1('0x27'),util[_0x85f1('0x19')](_0x5858bc,{'showHidden':![],'depth':null}));this[_0x85f1('0x1e')](util[_0x85f1('0x28')](_0x85f1('0x29'),_0x5858bc[_0x85f1('0x2a')]),_0x85f1('0x2b'),_0x5858bc);}}}catch(_0x210a44){logger[_0x85f1('0x18')](_0x85f1('0x2c'),util['inspect'](_0x210a44,{'showHidden':![],'depth':null}));}};UserReport[_0x85f1('0x1b')][_0x85f1('0xf')]=function(_0x60b871){try{if(this['isNotNull'](_0x60b871)){logger[_0x85f1('0x1f')](_0x85f1('0x2d'),_0x60b871[_0x85f1('0x2e')],_0x60b871['state']);logger[_0x85f1('0x23')](_0x85f1('0x2f'),util['inspect'](_0x60b871,{'showHidden':![],'depth':null}));if(this[_0x85f1('0x30')][_0x60b871[_0x85f1('0x2e')]]){if(!this[_0x85f1('0x30')][_0x60b871[_0x85f1('0x2e')]][_0x85f1('0x31')]||_0x60b871[_0x85f1('0x22')][_0x85f1('0x32')]()==_0x85f1('0x33')){this[_0x85f1('0x30')][_0x60b871['device']][_0x85f1('0x31')]=![];if(this['agents'][_0x60b871['device']]['state']!==_0x60b871[_0x85f1('0x22')]['toLowerCase']()){this[_0x85f1('0x30')][_0x60b871[_0x85f1('0x2e')]]['stateTime']=_['toNumber'](moment()[_0x85f1('0x28')]('x'));}this[_0x85f1('0x30')][_0x60b871[_0x85f1('0x2e')]][_0x85f1('0x22')]=_0x60b871['state'][_0x85f1('0x32')]();this['agents'][_0x60b871[_0x85f1('0x2e')]][_0x85f1('0x34')](_0x60b871);}}else if(this[_0x85f1('0x9')][_0x60b871[_0x85f1('0x2e')]]){if(this['telephones'][_0x60b871[_0x85f1('0x2e')]][_0x85f1('0x22')]!==_0x60b871[_0x85f1('0x22')][_0x85f1('0x32')]()){this[_0x85f1('0x9')][_0x60b871[_0x85f1('0x2e')]][_0x85f1('0x35')]=_[_0x85f1('0x36')](moment()[_0x85f1('0x28')]('x'));}this['telephones'][_0x60b871[_0x85f1('0x2e')]][_0x85f1('0x22')]=_0x60b871['state'][_0x85f1('0x32')]();logger[_0x85f1('0x23')]('[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:',util[_0x85f1('0x19')](this[_0x85f1('0x9')][_0x60b871[_0x85f1('0x2e')]],{'showHidden':![],'depth':null}));this[_0x85f1('0x1e')](util['format'](_0x85f1('0x37'),this[_0x85f1('0x9')][_0x60b871['device']]['name']),_0x85f1('0x38'),this[_0x85f1('0x9')][_0x60b871['device']]);}else if(this[_0x85f1('0x8')][_0x60b871['device']]){if(this[_0x85f1('0x8')][_0x60b871[_0x85f1('0x2e')]]['state']!==_0x60b871[_0x85f1('0x22')][_0x85f1('0x32')]()){this['trunks'][_0x60b871[_0x85f1('0x2e')]][_0x85f1('0x35')]=_[_0x85f1('0x36')](moment()[_0x85f1('0x28')]('x'));}this[_0x85f1('0x8')][_0x60b871[_0x85f1('0x2e')]][_0x85f1('0x22')]=_0x60b871[_0x85f1('0x22')]['toLowerCase']();logger['debug'](_0x85f1('0x39'),util[_0x85f1('0x19')](this[_0x85f1('0x8')][_0x60b871[_0x85f1('0x2e')]],{'showHidden':![],'depth':null}));this[_0x85f1('0x1e')](util[_0x85f1('0x28')]('trunk:%s',this['trunks'][_0x60b871[_0x85f1('0x2e')]][_0x85f1('0x2a')]),_0x85f1('0x2b'),this['trunks'][_0x60b871[_0x85f1('0x2e')]]);}else if(_['startsWith'](_0x60b871[_0x85f1('0x2e')],'Local')){var _0x344b7b=_0x60b871[_0x85f1('0x2e')];var _0x2cd3fa=_0x344b7b['substring'](_0x344b7b[_0x85f1('0x3a')]('/')+0x1,_0x344b7b[_0x85f1('0x3a')]('@'));var _0x4af3db=_[_0x85f1('0x3b')](this['agents'],function(_0x163c49){return _0x163c49[_0x85f1('0x3c')]==_0x2cd3fa||_0x163c49[_0x85f1('0x3d')]==_0x2cd3fa||_0x163c49[_0x85f1('0x3e')]==_0x2cd3fa;});if(_0x4af3db){if(_0x4af3db['state']!==_0x60b871[_0x85f1('0x22')][_0x85f1('0x32')]()){_0x4af3db[_0x85f1('0x35')]=_[_0x85f1('0x36')](moment()[_0x85f1('0x28')]('x'));}_0x4af3db[_0x85f1('0x22')]=_0x60b871[_0x85f1('0x22')]['toLowerCase']();_0x4af3db[_0x85f1('0x31')]=!![];_0x4af3db[_0x85f1('0x34')](_0x60b871);}}}}catch(_0x589997){logger[_0x85f1('0x18')](_0x85f1('0x2f'),util['inspect'](_0x589997,{'showHidden':![],'depth':null}));}};UserReport[_0x85f1('0x1b')][_0x85f1('0x11')]=function(_0x576a03){try{if(this[_0x85f1('0x1c')](_0x576a03)&&this['isNotNull'](_0x576a03[_0x85f1('0x10')])){logger['info'](_0x85f1('0x3f'),_0x576a03[_0x85f1('0x40')],_0x576a03[_0x85f1('0x41')],_0x576a03['peerstatus']);logger[_0x85f1('0x23')](_0x85f1('0x42'),util[_0x85f1('0x19')](_0x576a03,{'showHidden':![],'depth':null}));if(this['agents'][_0x576a03[_0x85f1('0x40')]]){if(!this[_0x85f1('0x30')][_0x576a03['peer']]['local']||_0x576a03[_0x85f1('0x10')]['toLowerCase']()=='registered'){this[_0x85f1('0x30')][_0x576a03[_0x85f1('0x40')]][_0x85f1('0x31')]=![];this['agents'][_0x576a03['peer']][_0x85f1('0x43')]=_0x576a03[_0x85f1('0x10')]['toLowerCase']();this[_0x85f1('0x30')][_0x576a03[_0x85f1('0x40')]]['address']=_0x576a03[_0x85f1('0x41')];this[_0x85f1('0x30')][_0x576a03[_0x85f1('0x40')]][_0x85f1('0x34')](_0x576a03);}}else if(this['telephones'][_0x576a03[_0x85f1('0x40')]]){this[_0x85f1('0x9')][_0x576a03[_0x85f1('0x40')]][_0x85f1('0x43')]=_0x576a03['peerstatus'][_0x85f1('0x32')]();this[_0x85f1('0x9')][_0x576a03[_0x85f1('0x40')]][_0x85f1('0x41')]=_0x576a03[_0x85f1('0x41')];logger[_0x85f1('0x23')](_0x85f1('0x44'),util[_0x85f1('0x19')](this[_0x85f1('0x9')][_0x576a03[_0x85f1('0x40')]],{'showHidden':![],'depth':null}));this['emit'](util['format']('telephone:%s',this[_0x85f1('0x9')][_0x576a03['peer']]['name']),_0x85f1('0x38'),this[_0x85f1('0x9')][_0x576a03[_0x85f1('0x40')]]);}else if(this['trunks'][_0x576a03['peer']]){this[_0x85f1('0x8')][_0x576a03[_0x85f1('0x40')]][_0x85f1('0x43')]=_0x576a03[_0x85f1('0x10')]['toLowerCase']();this[_0x85f1('0x8')][_0x576a03[_0x85f1('0x40')]][_0x85f1('0x41')]=_0x576a03[_0x85f1('0x41')];logger[_0x85f1('0x23')](_0x85f1('0x45'),util['inspect'](this[_0x85f1('0x8')][_0x576a03[_0x85f1('0x40')]],{'showHidden':![],'depth':null}));this[_0x85f1('0x1e')](util['format'](_0x85f1('0x29'),this['trunks'][_0x576a03[_0x85f1('0x40')]][_0x85f1('0x2a')]),_0x85f1('0x2b'),this[_0x85f1('0x8')][_0x576a03[_0x85f1('0x40')]]);}}}catch(_0x235704){logger[_0x85f1('0x18')](_0x85f1('0x42'),util[_0x85f1('0x19')](_0x235704,{'showHidden':![],'depth':null}));}};module[_0x85f1('0x46')]=UserReport; \ No newline at end of file +var _0xfa07=['Local','substring','indexOf','phone','[userReport][devicestatechange]','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','address','[userReport][peerstatus]','peerstatus','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','telephone:%s','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','exports','lodash','moment','util','bluebird','../../../config/environment','../ami','redis','localhost','socket.io-emitter','trunks','agents','telephones','syncRegistry','bind','registry','devicestatechange','syncDeviceState','syncPeerStatus','syncRealtimeShow','catch','error','[userReport][sipshowregistry]','inspect','resolve','then','actionDeviceStateList','actionSipPeerStatus','[userReport][sippeerstatus]','prototype','isNotNull','emit','info','username','state','[userReport][registry]','find','stateRegistry','omit','actionid','debug','[userReport][registry]\x20sending\x20trunk:save\x20event:','format','trunk:%s','name','trunk:save','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','local','toLowerCase','inuse','updateStatusRealtime','stateTime','toNumber','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','startsWith'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xfa07,0x177));var _0x7fa0=function(_0x2dcf1e,_0x2238d5){_0x2dcf1e=_0x2dcf1e-0x0;var _0x53899e=_0xfa07[_0x2dcf1e];return _0x53899e;};'use strict';var _=require(_0x7fa0('0x0'));var moment=require(_0x7fa0('0x1'));var util=require(_0x7fa0('0x2'));var Redis=require('ioredis');var BPromise=require(_0x7fa0('0x3'));var config=require(_0x7fa0('0x4'));var logger=require('../../../config/logger')('ami');var ami=require(_0x7fa0('0x5'));config[_0x7fa0('0x6')]=_['defaults'](config[_0x7fa0('0x6')],{'host':_0x7fa0('0x7'),'port':0x18eb});var io=require(_0x7fa0('0x8'))(new Redis(config[_0x7fa0('0x6')]));function UserReport(_0x48005a){this[_0x7fa0('0x9')]=_0x48005a['trunks'];this['agents']=_0x48005a[_0x7fa0('0xa')];this[_0x7fa0('0xb')]=_0x48005a[_0x7fa0('0xb')];ami['on']('registryentry',this[_0x7fa0('0xc')][_0x7fa0('0xd')](this));ami['on'](_0x7fa0('0xe'),this[_0x7fa0('0xc')][_0x7fa0('0xd')](this));ami['on'](_0x7fa0('0xf'),this[_0x7fa0('0x10')][_0x7fa0('0xd')](this));ami['on']('peerstatus',this[_0x7fa0('0x11')][_0x7fa0('0xd')](this));return this[_0x7fa0('0x12')]();}function showSipRegistrations(){Promise['resolve']()['then'](ami['actionSipShowRegistry']())[_0x7fa0('0x13')](function(_0x480dbb){logger[_0x7fa0('0x14')](_0x7fa0('0x15'),util[_0x7fa0('0x16')](_0x480dbb,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x7fa0('0x17')]()[_0x7fa0('0x18')](ami[_0x7fa0('0x19')]())[_0x7fa0('0x13')](function(_0x5e016c){logger[_0x7fa0('0x14')]('[userReport][devicestatelist]',util[_0x7fa0('0x16')](_0x5e016c,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x7fa0('0x17')]()[_0x7fa0('0x18')](ami[_0x7fa0('0x1a')]())[_0x7fa0('0x13')](function(_0x3dc4d9){logger['error'](_0x7fa0('0x1b'),util[_0x7fa0('0x16')](_0x3dc4d9,{'showHidden':![],'depth':null}));});}UserReport[_0x7fa0('0x1c')][_0x7fa0('0x12')]=function(){setInterval(function(){BPromise[_0x7fa0('0x17')]()['then'](showSipRegistrations())['then'](listDeviceStates())[_0x7fa0('0x18')](showPeersStatus());},0x32c8);};UserReport['prototype'][_0x7fa0('0x1d')]=function(_0x4cb4cc){return _0x4cb4cc!==null&&!_['isUndefined'](_0x4cb4cc);};UserReport[_0x7fa0('0x1c')][_0x7fa0('0x1e')]=function(_0x3cc494,_0x48a08d,_0x397c47){io['to'](_0x3cc494)[_0x7fa0('0x1e')](_0x48a08d,_0x397c47);};UserReport['prototype'][_0x7fa0('0xc')]=function(_0x411cf5){try{if(this[_0x7fa0('0x1d')](_0x411cf5)){logger[_0x7fa0('0x1f')]('[userReport][registry]\x20registry:%s\x20state:%s',_0x411cf5[_0x7fa0('0x20')],_0x411cf5[_0x7fa0('0x21')]);logger['debug'](_0x7fa0('0x22'),util[_0x7fa0('0x16')](_0x411cf5,{'showHidden':![],'depth':null}));var _0x5e52df=_[_0x7fa0('0x23')](this[_0x7fa0('0x9')],{'defaultuser':_0x411cf5[_0x7fa0('0x20')]});if(_0x5e52df){_0x411cf5[_0x7fa0('0x24')]=_0x411cf5[_0x7fa0('0x21')];_['merge'](_0x5e52df,_[_0x7fa0('0x25')](_0x411cf5,['event',_0x7fa0('0x26'),'username','state']));logger[_0x7fa0('0x27')](_0x7fa0('0x28'),util[_0x7fa0('0x16')](_0x5e52df,{'showHidden':![],'depth':null}));this[_0x7fa0('0x1e')](util[_0x7fa0('0x29')](_0x7fa0('0x2a'),_0x5e52df[_0x7fa0('0x2b')]),_0x7fa0('0x2c'),_0x5e52df);}}}catch(_0x25c83e){logger[_0x7fa0('0x14')](_0x7fa0('0x22'),util[_0x7fa0('0x16')](_0x25c83e,{'showHidden':![],'depth':null}));}};UserReport[_0x7fa0('0x1c')][_0x7fa0('0x10')]=function(_0x4c8565){try{if(this[_0x7fa0('0x1d')](_0x4c8565)){logger[_0x7fa0('0x1f')](_0x7fa0('0x2d'),_0x4c8565[_0x7fa0('0x2e')],_0x4c8565[_0x7fa0('0x21')]);logger[_0x7fa0('0x27')]('[userReport][devicestatechange]',util[_0x7fa0('0x16')](_0x4c8565,{'showHidden':![],'depth':null}));if(this[_0x7fa0('0xa')][_0x4c8565[_0x7fa0('0x2e')]]){if(!this[_0x7fa0('0xa')][_0x4c8565[_0x7fa0('0x2e')]][_0x7fa0('0x2f')]||_0x4c8565[_0x7fa0('0x21')][_0x7fa0('0x30')]()==_0x7fa0('0x31')){this['agents'][_0x4c8565[_0x7fa0('0x2e')]]['local']=![];if(this[_0x7fa0('0xa')][_0x4c8565[_0x7fa0('0x2e')]][_0x7fa0('0x21')]!==_0x4c8565[_0x7fa0('0x21')][_0x7fa0('0x30')]()){this[_0x7fa0('0xa')][_0x4c8565['device']]['stateTime']=_['toNumber'](moment()[_0x7fa0('0x29')]('x'));}this[_0x7fa0('0xa')][_0x4c8565[_0x7fa0('0x2e')]][_0x7fa0('0x21')]=_0x4c8565[_0x7fa0('0x21')]['toLowerCase']();this['agents'][_0x4c8565[_0x7fa0('0x2e')]][_0x7fa0('0x32')](_0x4c8565);}}else if(this[_0x7fa0('0xb')][_0x4c8565[_0x7fa0('0x2e')]]){if(this[_0x7fa0('0xb')][_0x4c8565[_0x7fa0('0x2e')]][_0x7fa0('0x21')]!==_0x4c8565[_0x7fa0('0x21')]['toLowerCase']()){this[_0x7fa0('0xb')][_0x4c8565[_0x7fa0('0x2e')]][_0x7fa0('0x33')]=_[_0x7fa0('0x34')](moment()[_0x7fa0('0x29')]('x'));}this[_0x7fa0('0xb')][_0x4c8565[_0x7fa0('0x2e')]][_0x7fa0('0x21')]=_0x4c8565[_0x7fa0('0x21')][_0x7fa0('0x30')]();logger['debug'](_0x7fa0('0x35'),util[_0x7fa0('0x16')](this[_0x7fa0('0xb')][_0x4c8565[_0x7fa0('0x2e')]],{'showHidden':![],'depth':null}));this[_0x7fa0('0x1e')](util[_0x7fa0('0x29')]('telephone:%s',this[_0x7fa0('0xb')][_0x4c8565[_0x7fa0('0x2e')]][_0x7fa0('0x2b')]),_0x7fa0('0x36'),this['telephones'][_0x4c8565[_0x7fa0('0x2e')]]);}else if(this[_0x7fa0('0x9')][_0x4c8565[_0x7fa0('0x2e')]]){if(this[_0x7fa0('0x9')][_0x4c8565[_0x7fa0('0x2e')]]['state']!==_0x4c8565[_0x7fa0('0x21')]['toLowerCase']()){this['trunks'][_0x4c8565[_0x7fa0('0x2e')]][_0x7fa0('0x33')]=_[_0x7fa0('0x34')](moment()['format']('x'));}this[_0x7fa0('0x9')][_0x4c8565[_0x7fa0('0x2e')]][_0x7fa0('0x21')]=_0x4c8565[_0x7fa0('0x21')]['toLowerCase']();logger[_0x7fa0('0x27')](_0x7fa0('0x37'),util['inspect'](this[_0x7fa0('0x9')][_0x4c8565[_0x7fa0('0x2e')]],{'showHidden':![],'depth':null}));this[_0x7fa0('0x1e')](util['format'](_0x7fa0('0x2a'),this[_0x7fa0('0x9')][_0x4c8565[_0x7fa0('0x2e')]][_0x7fa0('0x2b')]),_0x7fa0('0x2c'),this[_0x7fa0('0x9')][_0x4c8565[_0x7fa0('0x2e')]]);}else if(_[_0x7fa0('0x38')](_0x4c8565[_0x7fa0('0x2e')],_0x7fa0('0x39'))){var _0x5525eb=_0x4c8565[_0x7fa0('0x2e')];var _0x420144=_0x5525eb[_0x7fa0('0x3a')](_0x5525eb[_0x7fa0('0x3b')]('/')+0x1,_0x5525eb[_0x7fa0('0x3b')]('@'));var _0x2297df=_['find'](this[_0x7fa0('0xa')],function(_0x52534e){return _0x52534e['mobile']==_0x420144||_0x52534e[_0x7fa0('0x3c')]==_0x420144||_0x52534e['accountcode']==_0x420144;});if(_0x2297df){if(_0x2297df[_0x7fa0('0x21')]!==_0x4c8565['state'][_0x7fa0('0x30')]()){_0x2297df[_0x7fa0('0x33')]=_['toNumber'](moment()[_0x7fa0('0x29')]('x'));}_0x2297df[_0x7fa0('0x21')]=_0x4c8565[_0x7fa0('0x21')][_0x7fa0('0x30')]();_0x2297df['local']=!![];_0x2297df[_0x7fa0('0x32')](_0x4c8565);}}}}catch(_0x803412){logger['error'](_0x7fa0('0x3d'),util['inspect'](_0x803412,{'showHidden':![],'depth':null}));}};UserReport[_0x7fa0('0x1c')][_0x7fa0('0x11')]=function(_0x1d7c7b){try{if(this[_0x7fa0('0x1d')](_0x1d7c7b)&&this[_0x7fa0('0x1d')](_0x1d7c7b['peerstatus'])){logger[_0x7fa0('0x1f')](_0x7fa0('0x3e'),_0x1d7c7b[_0x7fa0('0x3f')],_0x1d7c7b[_0x7fa0('0x40')],_0x1d7c7b['peerstatus']);logger[_0x7fa0('0x27')](_0x7fa0('0x41'),util[_0x7fa0('0x16')](_0x1d7c7b,{'showHidden':![],'depth':null}));if(this['agents'][_0x1d7c7b[_0x7fa0('0x3f')]]){if(!this[_0x7fa0('0xa')][_0x1d7c7b[_0x7fa0('0x3f')]][_0x7fa0('0x2f')]||_0x1d7c7b[_0x7fa0('0x42')][_0x7fa0('0x30')]()=='registered'){this['agents'][_0x1d7c7b[_0x7fa0('0x3f')]]['local']=![];this[_0x7fa0('0xa')][_0x1d7c7b[_0x7fa0('0x3f')]]['status']=_0x1d7c7b[_0x7fa0('0x42')][_0x7fa0('0x30')]();this[_0x7fa0('0xa')][_0x1d7c7b[_0x7fa0('0x3f')]][_0x7fa0('0x40')]=_0x1d7c7b[_0x7fa0('0x40')];this[_0x7fa0('0xa')][_0x1d7c7b['peer']][_0x7fa0('0x32')](_0x1d7c7b);}}else if(this[_0x7fa0('0xb')][_0x1d7c7b[_0x7fa0('0x3f')]]){this[_0x7fa0('0xb')][_0x1d7c7b[_0x7fa0('0x3f')]][_0x7fa0('0x43')]=_0x1d7c7b['peerstatus'][_0x7fa0('0x30')]();this[_0x7fa0('0xb')][_0x1d7c7b['peer']][_0x7fa0('0x40')]=_0x1d7c7b[_0x7fa0('0x40')];logger[_0x7fa0('0x27')](_0x7fa0('0x44'),util['inspect'](this[_0x7fa0('0xb')][_0x1d7c7b[_0x7fa0('0x3f')]],{'showHidden':![],'depth':null}));this[_0x7fa0('0x1e')](util[_0x7fa0('0x29')](_0x7fa0('0x45'),this['telephones'][_0x1d7c7b[_0x7fa0('0x3f')]][_0x7fa0('0x2b')]),_0x7fa0('0x36'),this[_0x7fa0('0xb')][_0x1d7c7b['peer']]);}else if(this[_0x7fa0('0x9')][_0x1d7c7b['peer']]){this[_0x7fa0('0x9')][_0x1d7c7b[_0x7fa0('0x3f')]][_0x7fa0('0x43')]=_0x1d7c7b[_0x7fa0('0x42')][_0x7fa0('0x30')]();this[_0x7fa0('0x9')][_0x1d7c7b[_0x7fa0('0x3f')]][_0x7fa0('0x40')]=_0x1d7c7b[_0x7fa0('0x40')];logger[_0x7fa0('0x27')](_0x7fa0('0x46'),util[_0x7fa0('0x16')](this[_0x7fa0('0x9')][_0x1d7c7b[_0x7fa0('0x3f')]],{'showHidden':![],'depth':null}));this[_0x7fa0('0x1e')](util[_0x7fa0('0x29')](_0x7fa0('0x2a'),this['trunks'][_0x1d7c7b[_0x7fa0('0x3f')]][_0x7fa0('0x2b')]),_0x7fa0('0x2c'),this[_0x7fa0('0x9')][_0x1d7c7b[_0x7fa0('0x3f')]]);}}}catch(_0x15e71e){logger[_0x7fa0('0x14')](_0x7fa0('0x41'),util['inspect'](_0x15e71e,{'showHidden':![],'depth':null}));}};module[_0x7fa0('0x47')]=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index 89152d5..087138e 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 _0x3cdc=['[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','user:agentconnect','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answeredelsewheredestinationuniqueid','answeredelsewheremembername','lastevent','reason','answered_elsewhere','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','[%s][voiceAgentReport][agentconnect]','[%s][voiceAgentReport][agentringnoanswer]\x20event:','rejected','custom:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','custom:agentqueuecallerabandon','syncAgentComplete','agentconnectAt','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','agent','talktime','acwtime','acwTimeout','agentacw','interface','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','[%s][voiceAgentReport][agentcomplete]','[%s][voiceAgentReport][varset]\x20event:','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','variables','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','memberdynamic','memberlastcall','memberpenalty','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','transfer','[%s][voiceAgentReport][hangup]\x20destuniqueid:%s','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','[%s][voiceAgentReport][hangup]','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','substring','lastIndexOf','onhold','[%s][voiceAgentReport][musiconholdstart]','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','[%s][voiceAgentReport][musiconholdstop]','exports','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','channels','voiceChannels','agents','agentcalled','syncAgentCalled','bind','agentconnect','agentringnoanswer','syncAgentRingNoAnswer','syncQueueCallerAbandon','agentcomplete','syncVarSet','hangup','syncHangup','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','emit','prototype','isNotNull','isUndefined','info','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','uniqueid','destuniqueid','format','called','voiceQueues','queue','mandatoryDisposition','type','inbound','voice','merge','omit','event','privilege','debug','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','inspect','user:%s','user:called','error','[%s][voiceAgentReport][agentconnect]\x20event:','hasOwnProperty','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','membername','YYYY-MM-DD\x20HH:mm:ss','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','routealias','pick','custom:agentconnect'];(function(_0x399c0c,_0x44b8e2){var _0x491d0a=function(_0x2065d9){while(--_0x2065d9){_0x399c0c['push'](_0x399c0c['shift']());}};_0x491d0a(++_0x44b8e2);}(_0x3cdc,0x18b));var _0xc3cd=function(_0x3ea360,_0x4a3b9e){_0x3ea360=_0x3ea360-0x0;var _0x330457=_0x3cdc[_0x3ea360];return _0x330457;};'use strict';var _=require('lodash');var moment=require(_0xc3cd('0x0'));var util=require(_0xc3cd('0x1'));var Redis=require(_0xc3cd('0x2'));var config=require(_0xc3cd('0x3'));var logger=require(_0xc3cd('0x4'))(_0xc3cd('0x5'));var ami=require(_0xc3cd('0x6'));config[_0xc3cd('0x7')]=_[_0xc3cd('0x8')](config[_0xc3cd('0x7')],{'host':_0xc3cd('0x9'),'port':0x18eb});var io=require(_0xc3cd('0xa'))(new Redis(config['redis']));function VoiceAgentReport(_0x55436c){this[_0xc3cd('0xb')]={};this[_0xc3cd('0xc')]=_0x55436c['channels'];this['voiceQueues']=_0x55436c['voiceQueues'];this['agents']=_0x55436c[_0xc3cd('0xd')];this['variables']={};ami['on'](_0xc3cd('0xe'),this[_0xc3cd('0xf')][_0xc3cd('0x10')](this));ami['on'](_0xc3cd('0x11'),this['syncAgentConnect'][_0xc3cd('0x10')](this));ami['on'](_0xc3cd('0x12'),this[_0xc3cd('0x13')][_0xc3cd('0x10')](this));ami['on']('queuecallerabandon',this[_0xc3cd('0x14')]['bind'](this));ami['on'](_0xc3cd('0x15'),this['syncAgentComplete']['bind'](this));ami['on']('varset',this[_0xc3cd('0x16')][_0xc3cd('0x10')](this));ami['on'](_0xc3cd('0x17'),this[_0xc3cd('0x18')][_0xc3cd('0x10')](this));ami['on'](_0xc3cd('0x19'),this[_0xc3cd('0x1a')][_0xc3cd('0x10')](this));ami['on'](_0xc3cd('0x1b'),this[_0xc3cd('0x1c')][_0xc3cd('0x10')](this));ami['on'](_0xc3cd('0x1d'),this[_0xc3cd('0x1e')]['bind'](this));ami['on']('blindtransfer',this[_0xc3cd('0x1f')][_0xc3cd('0x10')](this));}VoiceAgentReport['prototype'][_0xc3cd('0x20')]=function(_0x52bf01,_0x219a6c,_0xb93ac8){io['to'](_0x52bf01)[_0xc3cd('0x20')](_0x219a6c,_0xb93ac8);};VoiceAgentReport[_0xc3cd('0x21')][_0xc3cd('0x22')]=function(_0x46c6be){return _0x46c6be!==null&&!_[_0xc3cd('0x23')](_0x46c6be);};VoiceAgentReport[_0xc3cd('0x21')]['syncAgentCalled']=function(_0x378ff7){try{if(this[_0xc3cd('0x22')](_0x378ff7)){logger[_0xc3cd('0x24')](_0xc3cd('0x25'),_0x378ff7[_0xc3cd('0x26')],_0x378ff7['membername'],_0x378ff7[_0xc3cd('0x27')]);logger['debug']('[%s][voiceAgentReport][agentcalled]\x20event:',_0x378ff7[_0xc3cd('0x26')],util['inspect'](_0x378ff7,{'showHidden':![],'depth':null}));if(_[_0xc3cd('0x23')](this[_0xc3cd('0xb')][_0x378ff7[_0xc3cd('0x26')]])){this[_0xc3cd('0xb')][_0x378ff7['uniqueid']]={};}if(_[_0xc3cd('0x23')](this[_0xc3cd('0xb')][_0x378ff7[_0xc3cd('0x26')]][_0x378ff7['destuniqueid']])){this[_0xc3cd('0xb')][_0x378ff7[_0xc3cd('0x26')]][_0x378ff7[_0xc3cd('0x27')]]={'agentcalledAt':moment()[_0xc3cd('0x28')]('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':_0xc3cd('0x29'),'mandatoryDisposition':this[_0xc3cd('0x2a')][_0x378ff7[_0xc3cd('0x2b')]]?this[_0xc3cd('0x2a')][_0x378ff7[_0xc3cd('0x2b')]][_0xc3cd('0x2c')]||![]:![],'type':this[_0xc3cd('0x2a')][_0x378ff7[_0xc3cd('0x2b')]]?this[_0xc3cd('0x2a')][_0x378ff7[_0xc3cd('0x2b')]][_0xc3cd('0x2d')]||_0xc3cd('0x2e'):_0xc3cd('0x2e'),'variables':this['variables'][_0x378ff7[_0xc3cd('0x26')]],'motionChannel':_0xc3cd('0x2f')};}_[_0xc3cd('0x30')](this[_0xc3cd('0xb')][_0x378ff7[_0xc3cd('0x26')]][_0x378ff7[_0xc3cd('0x27')]],_[_0xc3cd('0x31')](_0x378ff7,[_0xc3cd('0x32'),_0xc3cd('0x33')]));logger[_0xc3cd('0x34')](_0xc3cd('0x35'),_0x378ff7['uniqueid'],util[_0xc3cd('0x36')](this[_0xc3cd('0xb')][_0x378ff7['uniqueid']][_0x378ff7['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0xc3cd('0x20')]('custom:agentcalled',this[_0xc3cd('0xb')][_0x378ff7[_0xc3cd('0x26')]][_0x378ff7[_0xc3cd('0x27')]]);logger[_0xc3cd('0x34')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:',_0x378ff7[_0xc3cd('0x26')],util[_0xc3cd('0x36')](this['channels'][_0x378ff7['uniqueid']][_0x378ff7[_0xc3cd('0x27')]],{'showHidden':![],'depth':null}));this[_0xc3cd('0x20')](util[_0xc3cd('0x28')](_0xc3cd('0x37'),_0x378ff7['membername']),_0xc3cd('0x38'),this[_0xc3cd('0xb')][_0x378ff7[_0xc3cd('0x26')]][_0x378ff7[_0xc3cd('0x27')]]);}}catch(_0xe3747f){logger[_0xc3cd('0x39')]('[%s][voiceAgentReport][agentcalled]',_0x378ff7[_0xc3cd('0x26')],util[_0xc3cd('0x36')](_0xe3747f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc3cd('0x21')]['syncAgentConnect']=function(_0x100789){try{if(this[_0xc3cd('0x22')](_0x100789)){if(this[_0xc3cd('0xb')][_0x100789[_0xc3cd('0x26')]]){logger[_0xc3cd('0x34')](_0xc3cd('0x3a'),_0x100789[_0xc3cd('0x26')],util[_0xc3cd('0x36')](_0x100789,{'showHidden':![],'depth':null}));for(var _0x4c7de8 in this['channels'][_0x100789[_0xc3cd('0x26')]]){if(this[_0xc3cd('0xb')][_0x100789[_0xc3cd('0x26')]][_0xc3cd('0x3b')](_0x4c7de8)){if(_0x100789['destuniqueid']===_0x4c7de8){logger[_0xc3cd('0x24')](_0xc3cd('0x3c'),_0x100789[_0xc3cd('0x26')],_0x100789[_0xc3cd('0x3d')],_0x100789[_0xc3cd('0x27')]);this[_0xc3cd('0xb')][_0x100789[_0xc3cd('0x26')]][_0x4c7de8]['agentconnectAt']=moment()[_0xc3cd('0x28')](_0xc3cd('0x3e'));this[_0xc3cd('0xb')][_0x100789[_0xc3cd('0x26')]][_0x4c7de8][_0xc3cd('0x3f')]=_0x100789[_0xc3cd('0x3f')];this['channels'][_0x100789[_0xc3cd('0x26')]][_0x4c7de8][_0xc3cd('0x40')]=_0x100789[_0xc3cd('0x40')];this[_0xc3cd('0xb')][_0x100789[_0xc3cd('0x26')]][_0x4c7de8][_0xc3cd('0x41')]=_0x100789[_0xc3cd('0x41')];this[_0xc3cd('0xb')][_0x100789[_0xc3cd('0x26')]][_0x4c7de8]['destchannelstatedesc']=_0x100789[_0xc3cd('0x42')];this[_0xc3cd('0xb')][_0x100789['uniqueid']][_0x4c7de8]['holdtime']=_0x100789['holdtime'];this[_0xc3cd('0xb')][_0x100789['uniqueid']][_0x4c7de8]['lastevent']='connect';if(this[_0xc3cd('0xc')][this[_0xc3cd('0xb')][_0x100789[_0xc3cd('0x26')]][_0x4c7de8][_0xc3cd('0x26')]]){var _0x1339ca=this[_0xc3cd('0xc')][this[_0xc3cd('0xb')][_0x100789['uniqueid']][_0x4c7de8][_0xc3cd('0x26')]][_0xc3cd('0x43')];this[_0xc3cd('0xb')][_0x100789[_0xc3cd('0x26')]][_0x4c7de8]['routealias']=_0x1339ca;_0x100789[_0xc3cd('0x43')]=_0x1339ca;}_['merge'](this[_0xc3cd('0xd')][_0x100789['interface']],_[_0xc3cd('0x44')](_0x100789,[_0xc3cd('0x2b'),'destconnectedlinenum','routealias']));logger[_0xc3cd('0x34')]('[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:',_0x100789[_0xc3cd('0x26')],util[_0xc3cd('0x36')](this[_0xc3cd('0xb')][_0x100789[_0xc3cd('0x26')]][_0x100789['destuniqueid']],{'showHidden':![],'depth':null}));ami['emit'](_0xc3cd('0x45'),this[_0xc3cd('0xb')][_0x100789[_0xc3cd('0x26')]][_0x100789['destuniqueid']]);logger[_0xc3cd('0x34')](_0xc3cd('0x46'),_0x100789[_0xc3cd('0x26')],util['inspect'](this[_0xc3cd('0xb')][_0x100789[_0xc3cd('0x26')]][_0x100789[_0xc3cd('0x27')]],{'showHidden':![],'depth':null}));this['emit'](util[_0xc3cd('0x28')](_0xc3cd('0x37'),_0x100789[_0xc3cd('0x3d')]),_0xc3cd('0x47'),this[_0xc3cd('0xb')][_0x100789[_0xc3cd('0x26')]][_0x100789[_0xc3cd('0x27')]]);}else if(!this[_0xc3cd('0xb')][_0x100789[_0xc3cd('0x26')]][_0x4c7de8][_0xc3cd('0x12')]&&!this[_0xc3cd('0xb')][_0x100789[_0xc3cd('0x26')]][_0x4c7de8][_0xc3cd('0x15')]){logger[_0xc3cd('0x24')](_0xc3cd('0x48'),_0x100789['uniqueid'],this[_0xc3cd('0xb')][_0x100789[_0xc3cd('0x26')]][_0x4c7de8]['membername'],_0x4c7de8);this[_0xc3cd('0xb')][_0x100789[_0xc3cd('0x26')]][_0x4c7de8][_0xc3cd('0x12')]=!![];this['channels'][_0x100789[_0xc3cd('0x26')]][_0x4c7de8][_0xc3cd('0x49')]=moment()['format'](_0xc3cd('0x3e'));this[_0xc3cd('0xb')][_0x100789[_0xc3cd('0x26')]][_0x4c7de8][_0xc3cd('0x4a')]=_0x100789[_0xc3cd('0x27')];this[_0xc3cd('0xb')][_0x100789['uniqueid']][_0x4c7de8][_0xc3cd('0x4b')]=_0x100789[_0xc3cd('0x3d')];this[_0xc3cd('0xb')][_0x100789[_0xc3cd('0x26')]][_0x4c7de8][_0xc3cd('0x4c')]='answered_elsewhere';this[_0xc3cd('0xb')][_0x100789[_0xc3cd('0x26')]][_0x4c7de8][_0xc3cd('0x4d')]=_0xc3cd('0x4e');logger[_0xc3cd('0x34')](_0xc3cd('0x4f'),_0x100789[_0xc3cd('0x26')],util['inspect'](this[_0xc3cd('0xb')][_0x100789[_0xc3cd('0x26')]][_0x4c7de8],{'showHidden':![],'depth':null}));ami['emit'](_0xc3cd('0x50'),this['channels'][_0x100789[_0xc3cd('0x26')]][_0x4c7de8]);}}}}}}catch(_0x265b3c){logger[_0xc3cd('0x39')](_0xc3cd('0x51'),_0x100789[_0xc3cd('0x26')],util[_0xc3cd('0x36')](_0x265b3c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc3cd('0x21')]['syncAgentRingNoAnswer']=function(_0x4008ea){try{if(this[_0xc3cd('0x22')](_0x4008ea)){logger['debug'](_0xc3cd('0x52'),_0x4008ea[_0xc3cd('0x26')],util[_0xc3cd('0x36')](_0x4008ea,{'showHidden':![],'depth':null}));if(this[_0xc3cd('0xb')][_0x4008ea[_0xc3cd('0x26')]]&&this[_0xc3cd('0xb')][_0x4008ea[_0xc3cd('0x26')]][_0x4008ea['destuniqueid']]){logger[_0xc3cd('0x24')]('[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected',_0x4008ea[_0xc3cd('0x26')],_0x4008ea['membername'],_0x4008ea['destuniqueid']);this[_0xc3cd('0xb')][_0x4008ea[_0xc3cd('0x26')]][_0x4008ea[_0xc3cd('0x27')]]['agentringnoanswer']=!![];this[_0xc3cd('0xb')][_0x4008ea[_0xc3cd('0x26')]][_0x4008ea['destuniqueid']]['agentringnoanswerAt']=moment()[_0xc3cd('0x28')](_0xc3cd('0x3e'));this[_0xc3cd('0xb')][_0x4008ea[_0xc3cd('0x26')]][_0x4008ea[_0xc3cd('0x27')]][_0xc3cd('0x4c')]=_0xc3cd('0x53');this[_0xc3cd('0xb')][_0x4008ea['uniqueid']][_0x4008ea[_0xc3cd('0x27')]][_0xc3cd('0x4d')]=_0xc3cd('0x53');logger[_0xc3cd('0x34')]('[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:',_0x4008ea[_0xc3cd('0x26')],util[_0xc3cd('0x36')](this[_0xc3cd('0xb')][_0x4008ea[_0xc3cd('0x26')]][_0x4008ea[_0xc3cd('0x27')]],{'showHidden':![],'depth':null}));ami[_0xc3cd('0x20')](_0xc3cd('0x54'),this['channels'][_0x4008ea[_0xc3cd('0x26')]][_0x4008ea[_0xc3cd('0x27')]]);}}}catch(_0x1279c2){logger[_0xc3cd('0x39')](_0xc3cd('0x55'),_0x4008ea['uniqueid'],util[_0xc3cd('0x36')](_0x1279c2,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc3cd('0x21')][_0xc3cd('0x14')]=function(_0x5013cf){try{if(this[_0xc3cd('0x22')](_0x5013cf)){logger['debug'](_0xc3cd('0x56'),_0x5013cf['uniqueid'],util[_0xc3cd('0x36')](_0x5013cf,{'showHidden':![],'depth':null}));if(this[_0xc3cd('0xb')][_0x5013cf[_0xc3cd('0x26')]]){for(var _0x1369bf in this['channels'][_0x5013cf[_0xc3cd('0x26')]]){if(this[_0xc3cd('0xb')][_0x5013cf[_0xc3cd('0x26')]][_0xc3cd('0x3b')](_0x1369bf)&&!this[_0xc3cd('0xb')][_0x5013cf[_0xc3cd('0x26')]][_0x1369bf][_0xc3cd('0x12')]&&!this[_0xc3cd('0xb')][_0x5013cf[_0xc3cd('0x26')]][_0x1369bf][_0xc3cd('0x15')]){logger[_0xc3cd('0x24')](_0xc3cd('0x57'),_0x5013cf[_0xc3cd('0x26')],this[_0xc3cd('0xb')][_0x5013cf[_0xc3cd('0x26')]][_0x1369bf][_0xc3cd('0x3d')],_0x1369bf);this[_0xc3cd('0xb')][_0x5013cf['uniqueid']][_0x1369bf][_0xc3cd('0x12')]=!![];this[_0xc3cd('0xb')][_0x5013cf['uniqueid']][_0x1369bf][_0xc3cd('0x49')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x5013cf[_0xc3cd('0x26')]][_0x1369bf][_0xc3cd('0x4c')]='abandoned';this['channels'][_0x5013cf[_0xc3cd('0x26')]][_0x1369bf][_0xc3cd('0x4d')]=_0xc3cd('0x58');logger[_0xc3cd('0x34')]('[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:',_0x5013cf[_0xc3cd('0x26')],util['inspect'](this[_0xc3cd('0xb')][_0x5013cf[_0xc3cd('0x26')]][_0x1369bf],{'showHidden':![],'depth':null}));ami[_0xc3cd('0x20')](_0xc3cd('0x59'),this[_0xc3cd('0xb')][_0x5013cf[_0xc3cd('0x26')]][_0x1369bf]);}}}}}catch(_0x4d0a7c){logger['error']('[%s][voiceAgentReport][queuecallerabandon]',_0x5013cf[_0xc3cd('0x26')],util[_0xc3cd('0x36')](_0x4d0a7c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc3cd('0x21')][_0xc3cd('0x5a')]=function(_0x4e04a7){try{if(this[_0xc3cd('0x22')](_0x4e04a7)){logger[_0xc3cd('0x34')]('[%s][voiceAgentReport][agentcomplete]\x20event:',_0x4e04a7[_0xc3cd('0x26')],util['inspect'](_0x4e04a7,{'showHidden':![],'depth':null}));if(this['channels'][_0x4e04a7['uniqueid']]){for(var _0x56f75d in this[_0xc3cd('0xb')][_0x4e04a7[_0xc3cd('0x26')]]){if(this['channels'][_0x4e04a7[_0xc3cd('0x26')]][_0xc3cd('0x3b')](_0x56f75d)){if(this['channels'][_0x4e04a7['uniqueid']][_0x56f75d][_0xc3cd('0x5b')]&&!this[_0xc3cd('0xb')][_0x4e04a7['uniqueid']][_0x56f75d][_0xc3cd('0x15')]){logger[_0xc3cd('0x24')](_0xc3cd('0x5c'),_0x4e04a7[_0xc3cd('0x26')],this[_0xc3cd('0xb')][_0x4e04a7[_0xc3cd('0x26')]][_0x56f75d]['membername'],_0x56f75d);this[_0xc3cd('0xb')][_0x4e04a7[_0xc3cd('0x26')]][_0x56f75d][_0xc3cd('0x15')]=!![];this[_0xc3cd('0xb')][_0x4e04a7[_0xc3cd('0x26')]][_0x56f75d][_0xc3cd('0x5d')]=moment()[_0xc3cd('0x28')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xc3cd('0xb')][_0x4e04a7[_0xc3cd('0x26')]][_0x56f75d]['lastevent']=_0xc3cd('0x5e');this['channels'][_0x4e04a7['uniqueid']][_0x56f75d][_0xc3cd('0x4d')]=_0x4e04a7[_0xc3cd('0x4d')]=='transfer'?_0xc3cd('0x5f'):_0x4e04a7[_0xc3cd('0x4d')];this[_0xc3cd('0xb')][_0x4e04a7['uniqueid']][_0x56f75d]['talktime']=_0x4e04a7[_0xc3cd('0x60')];if(this[_0xc3cd('0x2a')][_0x4e04a7[_0xc3cd('0x2b')]]&&this['voiceQueues'][_0x4e04a7[_0xc3cd('0x2b')]]['acw']){this['channels'][_0x4e04a7['uniqueid']][_0x56f75d][_0xc3cd('0x61')]=this['voiceQueues'][_0x4e04a7[_0xc3cd('0x2b')]][_0xc3cd('0x62')];this['channels'][_0x4e04a7[_0xc3cd('0x26')]][_0x56f75d][_0xc3cd('0x63')]=!![];}this[_0xc3cd('0xd')][_0x4e04a7['interface']]=_[_0xc3cd('0x31')](this[_0xc3cd('0xd')][_0x4e04a7[_0xc3cd('0x64')]],[_0xc3cd('0x2b'),'destconnectedlinenum']);logger[_0xc3cd('0x34')](_0xc3cd('0x65'),_0x4e04a7[_0xc3cd('0x26')],util[_0xc3cd('0x36')](this[_0xc3cd('0xb')][_0x4e04a7[_0xc3cd('0x26')]][_0x56f75d],{'showHidden':![],'depth':null}));ami['emit'](_0xc3cd('0x66'),this[_0xc3cd('0xb')][_0x4e04a7['uniqueid']][_0x56f75d]);logger[_0xc3cd('0x34')](_0xc3cd('0x67'),_0x4e04a7[_0xc3cd('0x26')],util[_0xc3cd('0x36')](this[_0xc3cd('0xb')][_0x4e04a7[_0xc3cd('0x26')]][_0x56f75d],{'showHidden':![],'depth':null}));this[_0xc3cd('0x20')](util['format'](_0xc3cd('0x37'),_0x4e04a7[_0xc3cd('0x3d')]),'user:agentcomplete',this[_0xc3cd('0xb')][_0x4e04a7[_0xc3cd('0x26')]][_0x56f75d]);}}}}}}catch(_0x4558cc){logger[_0xc3cd('0x39')](_0xc3cd('0x68'),_0x4e04a7[_0xc3cd('0x26')],util[_0xc3cd('0x36')](_0x4558cc,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc3cd('0x21')][_0xc3cd('0x16')]=function(_0x5893bd){try{if(this[_0xc3cd('0x22')](_0x5893bd)){logger[_0xc3cd('0x34')](_0xc3cd('0x69'),_0x5893bd['uniqueid'],util[_0xc3cd('0x36')](_0x5893bd,{'showHidden':![],'depth':null}));this['addVariable'](_0x5893bd[_0xc3cd('0x26')],_[_0xc3cd('0x6a')](_0x5893bd[_0xc3cd('0x6b')])[0x0],_0x5893bd[_0xc3cd('0x6c')]);if(this[_0xc3cd('0xb')][_0x5893bd[_0xc3cd('0x26')]]){for(var _0x271b98 in this[_0xc3cd('0xb')][_0x5893bd[_0xc3cd('0x26')]]){if(this['channels'][_0x5893bd[_0xc3cd('0x26')]][_0xc3cd('0x3b')](_0x271b98)){logger['info'](_0xc3cd('0x6d'),_0x5893bd['uniqueid'],_0x271b98,_[_0xc3cd('0x6a')](_0x5893bd[_0xc3cd('0x6b')])[0x0],_0x5893bd[_0xc3cd('0x6c')]);if(_[_0xc3cd('0x23')](this['channels'][_0x5893bd[_0xc3cd('0x26')]][_0x271b98][_0xc3cd('0x6e')])){this[_0xc3cd('0xb')][_0x5893bd[_0xc3cd('0x26')]][_0x271b98][_0xc3cd('0x6e')]={};}this[_0xc3cd('0xb')][_0x5893bd[_0xc3cd('0x26')]][_0x271b98][_0xc3cd('0x6e')]=this[_0xc3cd('0x6e')][_0x5893bd[_0xc3cd('0x26')]];}}}}}catch(_0x3385f7){logger[_0xc3cd('0x39')](_0xc3cd('0x6f'),_0x5893bd[_0xc3cd('0x26')],util[_0xc3cd('0x36')](_0x3385f7,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['addVariable']=function(_0x1710aa,_0x383e0c,_0x270c5c){var _0x525060=[_0xc3cd('0x70'),_0xc3cd('0x71'),_0xc3cd('0x72'),_0xc3cd('0x73'),_0xc3cd('0x74'),'rtpaudioqoslossbridged',_0xc3cd('0x75'),_0xc3cd('0x76'),_0xc3cd('0x77'),_0xc3cd('0x78'),_0xc3cd('0x79'),_0xc3cd('0x7a'),'membercalls',_0xc3cd('0x7b'),'memberinterface',_0xc3cd('0x7c'),_0xc3cd('0x3d'),_0xc3cd('0x7d'),'memberrealtime'];if(!_[_0xc3cd('0x7e')](_0x383e0c)&&!_[_0xc3cd('0x7f')](_0x525060,_0x383e0c)){if(_[_0xc3cd('0x23')](this[_0xc3cd('0x6e')][_0x1710aa])){this[_0xc3cd('0x6e')][_0x1710aa]={};}this[_0xc3cd('0x6e')][_0x1710aa][_0x383e0c]=_0x270c5c;}};VoiceAgentReport[_0xc3cd('0x21')][_0xc3cd('0x18')]=function(_0x1616c7){try{if(this[_0xc3cd('0x22')](_0x1616c7)){logger[_0xc3cd('0x34')](_0xc3cd('0x80'),_0x1616c7['uniqueid'],util[_0xc3cd('0x36')](_0x1616c7,{'showHidden':![],'depth':null}));if(this[_0xc3cd('0xb')][_0x1616c7[_0xc3cd('0x26')]]){for(var _0x10b13b in this[_0xc3cd('0xb')][_0x1616c7['uniqueid']]){if(this[_0xc3cd('0xb')][_0x1616c7[_0xc3cd('0x26')]][_0xc3cd('0x3b')](_0x10b13b)){if(this[_0xc3cd('0xb')][_0x1616c7['uniqueid']][_0x10b13b]['reason']==_0xc3cd('0x81')&&this[_0xc3cd('0xb')][_0x1616c7[_0xc3cd('0x26')]][_0x10b13b][_0xc3cd('0x15')]){logger[_0xc3cd('0x24')](_0xc3cd('0x82'),_0x1616c7[_0xc3cd('0x26')],_0x10b13b);this['channels'][_0x1616c7[_0xc3cd('0x26')]][_0x10b13b][_0xc3cd('0x5d')]=moment()['format'](_0xc3cd('0x3e'));}}}logger[_0xc3cd('0x34')](_0xc3cd('0x83'),_0x1616c7[_0xc3cd('0x26')],util['inspect'](_[_0xc3cd('0x84')](this['channels'][_0x1616c7[_0xc3cd('0x26')]]),{'showHidden':![],'depth':null}));ami['emit'](_0xc3cd('0x85'),_[_0xc3cd('0x84')](this['channels'][_0x1616c7[_0xc3cd('0x26')]]));delete this[_0xc3cd('0xb')][_0x1616c7[_0xc3cd('0x26')]];}if(this[_0xc3cd('0x6e')][_0x1616c7[_0xc3cd('0x26')]]){delete this[_0xc3cd('0x6e')][_0x1616c7[_0xc3cd('0x26')]];}}}catch(_0x553ce4){logger['error'](_0xc3cd('0x86'),_0x1616c7[_0xc3cd('0x26')],util[_0xc3cd('0x36')](_0x553ce4,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xc3cd('0x1e')]=function(_0x539a93){try{if(this[_0xc3cd('0x22')](_0x539a93)){logger['debug'](_0xc3cd('0x87'),_0x539a93['uniqueid'],util[_0xc3cd('0x36')](_0x539a93,{'showHidden':![],'depth':null}));if(this[_0xc3cd('0xb')][_0x539a93[_0xc3cd('0x88')]]){for(var _0x583bc0 in this[_0xc3cd('0xb')][_0x539a93['transfereeuniqueid']]){if(this[_0xc3cd('0xb')][_0x539a93['transfereeuniqueid']]['hasOwnProperty'](_0x583bc0)){if(_0x539a93['origtransfereruniqueid']===_0x583bc0){logger[_0xc3cd('0x24')](_0xc3cd('0x89'),_0x539a93[_0xc3cd('0x26')],this[_0xc3cd('0xb')][_0x539a93[_0xc3cd('0x88')]][_0x583bc0]['membername'],_0x583bc0);var _0x3b78d7=moment();this[_0xc3cd('0xb')][_0x539a93['transfereeuniqueid']][_0x583bc0][_0xc3cd('0x15')]=!![];this[_0xc3cd('0xb')][_0x539a93[_0xc3cd('0x88')]][_0x583bc0]['agentcompleteAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x539a93[_0xc3cd('0x88')]][_0x583bc0][_0xc3cd('0x4c')]=_0xc3cd('0x5e');this[_0xc3cd('0xb')][_0x539a93[_0xc3cd('0x88')]][_0x583bc0][_0xc3cd('0x4d')]=_0xc3cd('0x81');this[_0xc3cd('0xb')][_0x539a93[_0xc3cd('0x88')]][_0x583bc0]['talktime']=_0x3b78d7[_0xc3cd('0x8a')](this['channels'][_0x539a93['transfereeuniqueid']][_0x583bc0][_0xc3cd('0x5b')],_0xc3cd('0x8b'));}}}}if(this[_0xc3cd('0xb')][_0x539a93['secondtransfereruniqueid']]){var _0x36a975=this[_0xc3cd('0xb')][_0x539a93[_0xc3cd('0x8c')]];this[_0xc3cd('0xb')][_0x539a93[_0xc3cd('0x8c')]]=this[_0xc3cd('0xb')][_0x539a93['transfereeuniqueid']];this[_0xc3cd('0xb')][_0x539a93[_0xc3cd('0x88')]]=_0x36a975;}}}catch(_0x2dfe05){logger[_0xc3cd('0x39')](_0xc3cd('0x8d'),_0x539a93[_0xc3cd('0x26')],util[_0xc3cd('0x36')](_0x2dfe05,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc3cd('0x21')][_0xc3cd('0x1f')]=function(_0x3d3c29){try{if(this[_0xc3cd('0x22')](_0x3d3c29)){logger['debug'](_0xc3cd('0x8e'),_0x3d3c29['uniqueid'],util[_0xc3cd('0x36')](_0x3d3c29,{'showHidden':![],'depth':null}));if(this[_0xc3cd('0xb')][_0x3d3c29['transfereeuniqueid']]){for(var _0x5b5a69 in this[_0xc3cd('0xb')][_0x3d3c29['transfereeuniqueid']]){if(this[_0xc3cd('0xb')][_0x3d3c29[_0xc3cd('0x88')]][_0xc3cd('0x3b')](_0x5b5a69)){if(_0x3d3c29[_0xc3cd('0x8f')]===_0x5b5a69){logger[_0xc3cd('0x24')](_0xc3cd('0x90'),_0x3d3c29[_0xc3cd('0x26')],this[_0xc3cd('0xb')][_0x3d3c29['transfereeuniqueid']][_0x5b5a69][_0xc3cd('0x3d')],_0x5b5a69);var _0x36706d=moment();this[_0xc3cd('0xb')][_0x3d3c29[_0xc3cd('0x88')]][_0x5b5a69][_0xc3cd('0x15')]=!![];this['channels'][_0x3d3c29[_0xc3cd('0x88')]][_0x5b5a69][_0xc3cd('0x5d')]=_0x36706d;this[_0xc3cd('0xb')][_0x3d3c29['transfereeuniqueid']][_0x5b5a69]['lastevent']=_0xc3cd('0x5e');this[_0xc3cd('0xb')][_0x3d3c29['transfereeuniqueid']][_0x5b5a69][_0xc3cd('0x4d')]=_0xc3cd('0x81');this[_0xc3cd('0xb')][_0x3d3c29[_0xc3cd('0x88')]][_0x5b5a69][_0xc3cd('0x60')]=_0x36706d[_0xc3cd('0x8a')](this[_0xc3cd('0xb')][_0x3d3c29[_0xc3cd('0x88')]][_0x5b5a69]['agentconnectAt'],_0xc3cd('0x8b'));}}}}}}catch(_0x11ec3c){logger[_0xc3cd('0x39')](_0xc3cd('0x91'),_0x3d3c29[_0xc3cd('0x26')],util[_0xc3cd('0x36')](_0x11ec3c,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xc3cd('0x1a')]=function(_0x4f7ee7){var _0x52ea8b='';try{if(this['isNotNull'](_0x4f7ee7)){logger[_0xc3cd('0x34')](_0xc3cd('0x92'),_0x4f7ee7[_0xc3cd('0x26')],util[_0xc3cd('0x36')](_0x4f7ee7,{'showHidden':![],'depth':null}));if(_0x4f7ee7[_0xc3cd('0x93')]){_0x52ea8b=_0x4f7ee7[_0xc3cd('0x93')][_0xc3cd('0x94')](0x0,_0x4f7ee7[_0xc3cd('0x93')][_0xc3cd('0x95')]('-'));if(this[_0xc3cd('0xd')][_0x52ea8b]){logger[_0xc3cd('0x24')]('[%s][voiceAgentReport][musiconholdstart]\x20interface:%s',_0x4f7ee7['uniqueid'],_0x52ea8b);this['agents'][_0x52ea8b][_0xc3cd('0x96')]=!![];}}}}catch(_0x434ee2){logger[_0xc3cd('0x39')](_0xc3cd('0x97'),_0x4f7ee7['uniqueid'],util['inspect'](_0x434ee2,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc3cd('0x21')]['syncMusicOnHoldStop']=function(_0x4b716e){var _0x33e0e9='';try{if(this[_0xc3cd('0x22')](_0x4b716e)){logger[_0xc3cd('0x34')]('[%s][voiceAgentReport][musiconholdstop]\x20event:',_0x4b716e[_0xc3cd('0x26')],util[_0xc3cd('0x36')](_0x4b716e,{'showHidden':![],'depth':null}));if(_0x4b716e['channel']){_0x33e0e9=_0x4b716e['channel']['substring'](0x0,_0x4b716e[_0xc3cd('0x93')][_0xc3cd('0x95')]('-'));if(this['agents'][_0x33e0e9]){logger[_0xc3cd('0x24')](_0xc3cd('0x98'),_0x4b716e[_0xc3cd('0x26')],_0x33e0e9);this[_0xc3cd('0xd')][_0x33e0e9][_0xc3cd('0x96')]=![];}}}}catch(_0x115e97){logger['error'](_0xc3cd('0x99'),_0x4b716e[_0xc3cd('0x26')],util[_0xc3cd('0x36')](_0x115e97,{'showHidden':![],'depth':null}));}};module[_0xc3cd('0x9a')]=VoiceAgentReport; \ No newline at end of file +var _0x1365=['format','YYYY-MM-DD\x20HH:mm:ss','queue','mandatoryDisposition','type','inbound','voice','omit','event','privilege','custom:agentcalled','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','user:%s','membername','user:called','error','[%s][voiceAgentReport][agentcalled]','syncAgentConnect','isNotNull','[%s][voiceAgentReport][agentconnect]\x20event:','hasOwnProperty','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','lastevent','routealias','pick','destconnectedlinenum','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','user:agentconnect','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answeredelsewheredestinationuniqueid','answeredelsewheremembername','answered_elsewhere','reason','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','[%s][voiceAgentReport][agentconnect]','[%s][voiceAgentReport][agentringnoanswer]\x20event:','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','custom:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','complete','talktime','acwtime','acwTimeout','agentacw','interface','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','variables','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberrealtime','isNil','syncHangup','[%s][voiceAgentReport][hangup]\x20event:','transfer','[%s][voiceAgentReport][hangup]\x20destuniqueid:%s','agentcompleteAt','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','custom:voiceAgentReport','[%s][voiceAgentReport][hangup]','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','syncMusicOnHoldStart','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','substring','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','onhold','lodash','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','voiceChannels','channels','voiceQueues','agents','agentcalled','syncAgentCalled','agentconnect','bind','agentringnoanswer','syncAgentRingNoAnswer','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','musiconholdstart','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','prototype','emit','isUndefined','info','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','destuniqueid','debug','uniqueid','inspect'];(function(_0x3553ed,_0x6c8f7e){var _0x57a16f=function(_0x3a8010){while(--_0x3a8010){_0x3553ed['push'](_0x3553ed['shift']());}};_0x57a16f(++_0x6c8f7e);}(_0x1365,0x1a4));var _0x5136=function(_0x505241,_0x54a73d){_0x505241=_0x505241-0x0;var _0x1a1fcb=_0x1365[_0x505241];return _0x1a1fcb;};'use strict';var _=require(_0x5136('0x0'));var moment=require(_0x5136('0x1'));var util=require(_0x5136('0x2'));var Redis=require(_0x5136('0x3'));var config=require(_0x5136('0x4'));var logger=require(_0x5136('0x5'))(_0x5136('0x6'));var ami=require(_0x5136('0x7'));config[_0x5136('0x8')]=_[_0x5136('0x9')](config['redis'],{'host':_0x5136('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function VoiceAgentReport(_0x3fa26f){this['channels']={};this[_0x5136('0xb')]=_0x3fa26f[_0x5136('0xc')];this[_0x5136('0xd')]=_0x3fa26f[_0x5136('0xd')];this[_0x5136('0xe')]=_0x3fa26f[_0x5136('0xe')];this['variables']={};ami['on'](_0x5136('0xf'),this[_0x5136('0x10')]['bind'](this));ami['on'](_0x5136('0x11'),this['syncAgentConnect'][_0x5136('0x12')](this));ami['on'](_0x5136('0x13'),this[_0x5136('0x14')]['bind'](this));ami['on'](_0x5136('0x15'),this[_0x5136('0x16')][_0x5136('0x12')](this));ami['on'](_0x5136('0x17'),this[_0x5136('0x18')][_0x5136('0x12')](this));ami['on'](_0x5136('0x19'),this[_0x5136('0x1a')]['bind'](this));ami['on']('hangup',this['syncHangup']['bind'](this));ami['on'](_0x5136('0x1b'),this['syncMusicOnHoldStart']['bind'](this));ami['on']('musiconholdstop',this[_0x5136('0x1c')][_0x5136('0x12')](this));ami['on'](_0x5136('0x1d'),this[_0x5136('0x1e')][_0x5136('0x12')](this));ami['on'](_0x5136('0x1f'),this[_0x5136('0x20')]['bind'](this));}VoiceAgentReport[_0x5136('0x21')]['emit']=function(_0x22ec2a,_0x75f774,_0x56b054){io['to'](_0x22ec2a)[_0x5136('0x22')](_0x75f774,_0x56b054);};VoiceAgentReport['prototype']['isNotNull']=function(_0x5de7e9){return _0x5de7e9!==null&&!_[_0x5136('0x23')](_0x5de7e9);};VoiceAgentReport['prototype'][_0x5136('0x10')]=function(_0x5cfd2e){try{if(this['isNotNull'](_0x5cfd2e)){logger[_0x5136('0x24')](_0x5136('0x25'),_0x5cfd2e['uniqueid'],_0x5cfd2e['membername'],_0x5cfd2e[_0x5136('0x26')]);logger[_0x5136('0x27')]('[%s][voiceAgentReport][agentcalled]\x20event:',_0x5cfd2e[_0x5136('0x28')],util[_0x5136('0x29')](_0x5cfd2e,{'showHidden':![],'depth':null}));if(_[_0x5136('0x23')](this[_0x5136('0xc')][_0x5cfd2e[_0x5136('0x28')]])){this[_0x5136('0xc')][_0x5cfd2e[_0x5136('0x28')]]={};}if(_['isUndefined'](this[_0x5136('0xc')][_0x5cfd2e['uniqueid']][_0x5cfd2e[_0x5136('0x26')]])){this['channels'][_0x5cfd2e[_0x5136('0x28')]][_0x5cfd2e[_0x5136('0x26')]]={'agentcalledAt':moment()[_0x5136('0x2a')](_0x5136('0x2b')),'lastevent':'called','mandatoryDisposition':this['voiceQueues'][_0x5cfd2e[_0x5136('0x2c')]]?this[_0x5136('0xd')][_0x5cfd2e[_0x5136('0x2c')]][_0x5136('0x2d')]||![]:![],'type':this[_0x5136('0xd')][_0x5cfd2e[_0x5136('0x2c')]]?this[_0x5136('0xd')][_0x5cfd2e[_0x5136('0x2c')]][_0x5136('0x2e')]||_0x5136('0x2f'):_0x5136('0x2f'),'variables':this['variables'][_0x5cfd2e['uniqueid']],'motionChannel':_0x5136('0x30')};}_['merge'](this['channels'][_0x5cfd2e['uniqueid']][_0x5cfd2e[_0x5136('0x26')]],_[_0x5136('0x31')](_0x5cfd2e,[_0x5136('0x32'),_0x5136('0x33')]));logger[_0x5136('0x27')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:',_0x5cfd2e['uniqueid'],util['inspect'](this[_0x5136('0xc')][_0x5cfd2e['uniqueid']][_0x5cfd2e['destuniqueid']],{'showHidden':![],'depth':null}));ami['emit'](_0x5136('0x34'),this['channels'][_0x5cfd2e['uniqueid']][_0x5cfd2e[_0x5136('0x26')]]);logger[_0x5136('0x27')](_0x5136('0x35'),_0x5cfd2e['uniqueid'],util[_0x5136('0x29')](this[_0x5136('0xc')][_0x5cfd2e[_0x5136('0x28')]][_0x5cfd2e[_0x5136('0x26')]],{'showHidden':![],'depth':null}));this['emit'](util[_0x5136('0x2a')](_0x5136('0x36'),_0x5cfd2e[_0x5136('0x37')]),_0x5136('0x38'),this['channels'][_0x5cfd2e[_0x5136('0x28')]][_0x5cfd2e[_0x5136('0x26')]]);}}catch(_0x1a1878){logger[_0x5136('0x39')](_0x5136('0x3a'),_0x5cfd2e[_0x5136('0x28')],util[_0x5136('0x29')](_0x1a1878,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x5136('0x3b')]=function(_0x5c7f43){try{if(this[_0x5136('0x3c')](_0x5c7f43)){if(this[_0x5136('0xc')][_0x5c7f43[_0x5136('0x28')]]){logger['debug'](_0x5136('0x3d'),_0x5c7f43[_0x5136('0x28')],util[_0x5136('0x29')](_0x5c7f43,{'showHidden':![],'depth':null}));for(var _0x49b10e in this[_0x5136('0xc')][_0x5c7f43[_0x5136('0x28')]]){if(this[_0x5136('0xc')][_0x5c7f43[_0x5136('0x28')]][_0x5136('0x3e')](_0x49b10e)){if(_0x5c7f43[_0x5136('0x26')]===_0x49b10e){logger[_0x5136('0x24')](_0x5136('0x3f'),_0x5c7f43[_0x5136('0x28')],_0x5c7f43[_0x5136('0x37')],_0x5c7f43[_0x5136('0x26')]);this['channels'][_0x5c7f43[_0x5136('0x28')]][_0x49b10e][_0x5136('0x40')]=moment()['format'](_0x5136('0x2b'));this[_0x5136('0xc')][_0x5c7f43['uniqueid']][_0x49b10e][_0x5136('0x41')]=_0x5c7f43[_0x5136('0x41')];this[_0x5136('0xc')][_0x5c7f43[_0x5136('0x28')]][_0x49b10e][_0x5136('0x42')]=_0x5c7f43[_0x5136('0x42')];this[_0x5136('0xc')][_0x5c7f43[_0x5136('0x28')]][_0x49b10e][_0x5136('0x43')]=_0x5c7f43[_0x5136('0x43')];this[_0x5136('0xc')][_0x5c7f43[_0x5136('0x28')]][_0x49b10e][_0x5136('0x44')]=_0x5c7f43['destchannelstatedesc'];this['channels'][_0x5c7f43['uniqueid']][_0x49b10e][_0x5136('0x45')]=_0x5c7f43['holdtime'];this[_0x5136('0xc')][_0x5c7f43['uniqueid']][_0x49b10e][_0x5136('0x46')]='connect';if(this[_0x5136('0xb')][this[_0x5136('0xc')][_0x5c7f43[_0x5136('0x28')]][_0x49b10e][_0x5136('0x28')]]){var _0x2754c9=this[_0x5136('0xb')][this['channels'][_0x5c7f43[_0x5136('0x28')]][_0x49b10e][_0x5136('0x28')]][_0x5136('0x47')];this['channels'][_0x5c7f43[_0x5136('0x28')]][_0x49b10e][_0x5136('0x47')]=_0x2754c9;_0x5c7f43[_0x5136('0x47')]=_0x2754c9;}_['merge'](this['agents'][_0x5c7f43['interface']],_[_0x5136('0x48')](_0x5c7f43,[_0x5136('0x2c'),_0x5136('0x49'),_0x5136('0x47')]));logger[_0x5136('0x27')](_0x5136('0x4a'),_0x5c7f43[_0x5136('0x28')],util[_0x5136('0x29')](this['channels'][_0x5c7f43[_0x5136('0x28')]][_0x5c7f43[_0x5136('0x26')]],{'showHidden':![],'depth':null}));ami[_0x5136('0x22')]('custom:agentconnect',this['channels'][_0x5c7f43[_0x5136('0x28')]][_0x5c7f43[_0x5136('0x26')]]);logger[_0x5136('0x27')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:',_0x5c7f43[_0x5136('0x28')],util[_0x5136('0x29')](this['channels'][_0x5c7f43[_0x5136('0x28')]][_0x5c7f43[_0x5136('0x26')]],{'showHidden':![],'depth':null}));this[_0x5136('0x22')](util['format'](_0x5136('0x36'),_0x5c7f43[_0x5136('0x37')]),_0x5136('0x4b'),this['channels'][_0x5c7f43[_0x5136('0x28')]][_0x5c7f43[_0x5136('0x26')]]);}else if(!this['channels'][_0x5c7f43['uniqueid']][_0x49b10e][_0x5136('0x13')]&&!this[_0x5136('0xc')][_0x5c7f43['uniqueid']][_0x49b10e][_0x5136('0x17')]){logger['info'](_0x5136('0x4c'),_0x5c7f43[_0x5136('0x28')],this[_0x5136('0xc')][_0x5c7f43['uniqueid']][_0x49b10e]['membername'],_0x49b10e);this[_0x5136('0xc')][_0x5c7f43['uniqueid']][_0x49b10e][_0x5136('0x13')]=!![];this[_0x5136('0xc')][_0x5c7f43[_0x5136('0x28')]][_0x49b10e][_0x5136('0x4d')]=moment()[_0x5136('0x2a')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x5136('0xc')][_0x5c7f43[_0x5136('0x28')]][_0x49b10e][_0x5136('0x4e')]=_0x5c7f43[_0x5136('0x26')];this[_0x5136('0xc')][_0x5c7f43['uniqueid']][_0x49b10e][_0x5136('0x4f')]=_0x5c7f43[_0x5136('0x37')];this['channels'][_0x5c7f43['uniqueid']][_0x49b10e]['lastevent']=_0x5136('0x50');this[_0x5136('0xc')][_0x5c7f43[_0x5136('0x28')]][_0x49b10e][_0x5136('0x51')]=_0x5136('0x50');logger['debug'](_0x5136('0x52'),_0x5c7f43['uniqueid'],util[_0x5136('0x29')](this[_0x5136('0xc')][_0x5c7f43['uniqueid']][_0x49b10e],{'showHidden':![],'depth':null}));ami[_0x5136('0x22')](_0x5136('0x53'),this[_0x5136('0xc')][_0x5c7f43['uniqueid']][_0x49b10e]);}}}}}}catch(_0x5aec84){logger[_0x5136('0x39')](_0x5136('0x54'),_0x5c7f43[_0x5136('0x28')],util[_0x5136('0x29')](_0x5aec84,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x5136('0x21')][_0x5136('0x14')]=function(_0x27d139){try{if(this[_0x5136('0x3c')](_0x27d139)){logger[_0x5136('0x27')](_0x5136('0x55'),_0x27d139[_0x5136('0x28')],util[_0x5136('0x29')](_0x27d139,{'showHidden':![],'depth':null}));if(this[_0x5136('0xc')][_0x27d139['uniqueid']]&&this[_0x5136('0xc')][_0x27d139[_0x5136('0x28')]][_0x27d139[_0x5136('0x26')]]){logger['info'](_0x5136('0x56'),_0x27d139[_0x5136('0x28')],_0x27d139['membername'],_0x27d139[_0x5136('0x26')]);this[_0x5136('0xc')][_0x27d139[_0x5136('0x28')]][_0x27d139[_0x5136('0x26')]]['agentringnoanswer']=!![];this[_0x5136('0xc')][_0x27d139[_0x5136('0x28')]][_0x27d139[_0x5136('0x26')]][_0x5136('0x4d')]=moment()['format'](_0x5136('0x2b'));this[_0x5136('0xc')][_0x27d139['uniqueid']][_0x27d139[_0x5136('0x26')]]['lastevent']=_0x5136('0x57');this[_0x5136('0xc')][_0x27d139[_0x5136('0x28')]][_0x27d139[_0x5136('0x26')]][_0x5136('0x51')]=_0x5136('0x57');logger[_0x5136('0x27')](_0x5136('0x58'),_0x27d139[_0x5136('0x28')],util[_0x5136('0x29')](this[_0x5136('0xc')][_0x27d139[_0x5136('0x28')]][_0x27d139[_0x5136('0x26')]],{'showHidden':![],'depth':null}));ami[_0x5136('0x22')](_0x5136('0x59'),this[_0x5136('0xc')][_0x27d139[_0x5136('0x28')]][_0x27d139[_0x5136('0x26')]]);}}}catch(_0x4da91f){logger[_0x5136('0x39')](_0x5136('0x5a'),_0x27d139[_0x5136('0x28')],util[_0x5136('0x29')](_0x4da91f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x5136('0x21')][_0x5136('0x16')]=function(_0x5b1e71){try{if(this[_0x5136('0x3c')](_0x5b1e71)){logger[_0x5136('0x27')](_0x5136('0x5b'),_0x5b1e71['uniqueid'],util[_0x5136('0x29')](_0x5b1e71,{'showHidden':![],'depth':null}));if(this['channels'][_0x5b1e71[_0x5136('0x28')]]){for(var _0x414d3b in this[_0x5136('0xc')][_0x5b1e71[_0x5136('0x28')]]){if(this[_0x5136('0xc')][_0x5b1e71[_0x5136('0x28')]][_0x5136('0x3e')](_0x414d3b)&&!this[_0x5136('0xc')][_0x5b1e71['uniqueid']][_0x414d3b][_0x5136('0x13')]&&!this[_0x5136('0xc')][_0x5b1e71[_0x5136('0x28')]][_0x414d3b][_0x5136('0x17')]){logger[_0x5136('0x24')](_0x5136('0x5c'),_0x5b1e71[_0x5136('0x28')],this[_0x5136('0xc')][_0x5b1e71[_0x5136('0x28')]][_0x414d3b][_0x5136('0x37')],_0x414d3b);this[_0x5136('0xc')][_0x5b1e71['uniqueid']][_0x414d3b][_0x5136('0x13')]=!![];this['channels'][_0x5b1e71[_0x5136('0x28')]][_0x414d3b][_0x5136('0x4d')]=moment()[_0x5136('0x2a')](_0x5136('0x2b'));this[_0x5136('0xc')][_0x5b1e71[_0x5136('0x28')]][_0x414d3b]['lastevent']=_0x5136('0x5d');this['channels'][_0x5b1e71[_0x5136('0x28')]][_0x414d3b]['reason']=_0x5136('0x5d');logger[_0x5136('0x27')](_0x5136('0x5e'),_0x5b1e71[_0x5136('0x28')],util[_0x5136('0x29')](this[_0x5136('0xc')][_0x5b1e71[_0x5136('0x28')]][_0x414d3b],{'showHidden':![],'depth':null}));ami[_0x5136('0x22')](_0x5136('0x5f'),this[_0x5136('0xc')][_0x5b1e71[_0x5136('0x28')]][_0x414d3b]);}}}}}catch(_0x5295a8){logger[_0x5136('0x39')](_0x5136('0x60'),_0x5b1e71['uniqueid'],util[_0x5136('0x29')](_0x5295a8,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x5136('0x21')][_0x5136('0x18')]=function(_0x2266f2){try{if(this[_0x5136('0x3c')](_0x2266f2)){logger['debug']('[%s][voiceAgentReport][agentcomplete]\x20event:',_0x2266f2[_0x5136('0x28')],util[_0x5136('0x29')](_0x2266f2,{'showHidden':![],'depth':null}));if(this[_0x5136('0xc')][_0x2266f2[_0x5136('0x28')]]){for(var _0x57b6b5 in this[_0x5136('0xc')][_0x2266f2[_0x5136('0x28')]]){if(this[_0x5136('0xc')][_0x2266f2[_0x5136('0x28')]]['hasOwnProperty'](_0x57b6b5)){if(this[_0x5136('0xc')][_0x2266f2[_0x5136('0x28')]][_0x57b6b5][_0x5136('0x40')]&&!this['channels'][_0x2266f2['uniqueid']][_0x57b6b5][_0x5136('0x17')]){logger[_0x5136('0x24')](_0x5136('0x61'),_0x2266f2[_0x5136('0x28')],this[_0x5136('0xc')][_0x2266f2[_0x5136('0x28')]][_0x57b6b5][_0x5136('0x37')],_0x57b6b5);this[_0x5136('0xc')][_0x2266f2['uniqueid']][_0x57b6b5][_0x5136('0x17')]=!![];this[_0x5136('0xc')][_0x2266f2['uniqueid']][_0x57b6b5]['agentcompleteAt']=moment()[_0x5136('0x2a')](_0x5136('0x2b'));this[_0x5136('0xc')][_0x2266f2['uniqueid']][_0x57b6b5][_0x5136('0x46')]=_0x5136('0x62');this[_0x5136('0xc')][_0x2266f2[_0x5136('0x28')]][_0x57b6b5][_0x5136('0x51')]=_0x2266f2['reason']=='transfer'?'agent':_0x2266f2[_0x5136('0x51')];this[_0x5136('0xc')][_0x2266f2['uniqueid']][_0x57b6b5][_0x5136('0x63')]=_0x2266f2['talktime'];if(this[_0x5136('0xd')][_0x2266f2[_0x5136('0x2c')]]&&this['voiceQueues'][_0x2266f2['queue']]['acw']){this[_0x5136('0xc')][_0x2266f2[_0x5136('0x28')]][_0x57b6b5][_0x5136('0x64')]=this[_0x5136('0xd')][_0x2266f2[_0x5136('0x2c')]][_0x5136('0x65')];this[_0x5136('0xc')][_0x2266f2[_0x5136('0x28')]][_0x57b6b5][_0x5136('0x66')]=!![];}this[_0x5136('0xe')][_0x2266f2[_0x5136('0x67')]]=_['omit'](this[_0x5136('0xe')][_0x2266f2['interface']],[_0x5136('0x2c'),_0x5136('0x49')]);logger[_0x5136('0x27')](_0x5136('0x68'),_0x2266f2[_0x5136('0x28')],util[_0x5136('0x29')](this['channels'][_0x2266f2[_0x5136('0x28')]][_0x57b6b5],{'showHidden':![],'depth':null}));ami[_0x5136('0x22')]('custom:agentcomplete',this[_0x5136('0xc')][_0x2266f2[_0x5136('0x28')]][_0x57b6b5]);logger[_0x5136('0x27')](_0x5136('0x69'),_0x2266f2['uniqueid'],util['inspect'](this[_0x5136('0xc')][_0x2266f2['uniqueid']][_0x57b6b5],{'showHidden':![],'depth':null}));this[_0x5136('0x22')](util[_0x5136('0x2a')](_0x5136('0x36'),_0x2266f2['membername']),'user:agentcomplete',this[_0x5136('0xc')][_0x2266f2[_0x5136('0x28')]][_0x57b6b5]);}}}}}}catch(_0x2ca2fd){logger[_0x5136('0x39')]('[%s][voiceAgentReport][agentcomplete]',_0x2266f2['uniqueid'],util[_0x5136('0x29')](_0x2ca2fd,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x5136('0x21')][_0x5136('0x1a')]=function(_0x10aff9){try{if(this[_0x5136('0x3c')](_0x10aff9)){logger['debug'](_0x5136('0x6a'),_0x10aff9[_0x5136('0x28')],util[_0x5136('0x29')](_0x10aff9,{'showHidden':![],'depth':null}));this[_0x5136('0x6b')](_0x10aff9['uniqueid'],_[_0x5136('0x6c')](_0x10aff9[_0x5136('0x6d')])[0x0],_0x10aff9[_0x5136('0x6e')]);if(this[_0x5136('0xc')][_0x10aff9[_0x5136('0x28')]]){for(var _0x115e42 in this[_0x5136('0xc')][_0x10aff9[_0x5136('0x28')]]){if(this[_0x5136('0xc')][_0x10aff9[_0x5136('0x28')]][_0x5136('0x3e')](_0x115e42)){logger[_0x5136('0x24')](_0x5136('0x6f'),_0x10aff9[_0x5136('0x28')],_0x115e42,_[_0x5136('0x6c')](_0x10aff9[_0x5136('0x6d')])[0x0],_0x10aff9[_0x5136('0x6e')]);if(_['isUndefined'](this['channels'][_0x10aff9[_0x5136('0x28')]][_0x115e42][_0x5136('0x70')])){this[_0x5136('0xc')][_0x10aff9[_0x5136('0x28')]][_0x115e42][_0x5136('0x70')]={};}this[_0x5136('0xc')][_0x10aff9[_0x5136('0x28')]][_0x115e42][_0x5136('0x70')]=this['variables'][_0x10aff9[_0x5136('0x28')]];}}}}}catch(_0x17ca4f){logger[_0x5136('0x39')](_0x5136('0x71'),_0x10aff9['uniqueid'],util[_0x5136('0x29')](_0x17ca4f,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x5136('0x6b')]=function(_0x39ef99,_0xca38d0,_0x412a54){var _0x400489=[_0x5136('0x72'),_0x5136('0x73'),_0x5136('0x74'),_0x5136('0x75'),_0x5136('0x76'),'rtpaudioqoslossbridged','rtpaudioqosrtt',_0x5136('0x77'),_0x5136('0x78'),_0x5136('0x79'),'bridgepeer',_0x5136('0x7a'),_0x5136('0x7b'),_0x5136('0x7c'),_0x5136('0x7d'),_0x5136('0x7e'),_0x5136('0x37'),'memberpenalty',_0x5136('0x7f')];if(!_[_0x5136('0x80')](_0xca38d0)&&!_['includes'](_0x400489,_0xca38d0)){if(_['isUndefined'](this[_0x5136('0x70')][_0x39ef99])){this[_0x5136('0x70')][_0x39ef99]={};}this[_0x5136('0x70')][_0x39ef99][_0xca38d0]=_0x412a54;}};VoiceAgentReport['prototype'][_0x5136('0x81')]=function(_0x159e02){try{if(this[_0x5136('0x3c')](_0x159e02)){logger['debug'](_0x5136('0x82'),_0x159e02[_0x5136('0x28')],util['inspect'](_0x159e02,{'showHidden':![],'depth':null}));if(this[_0x5136('0xc')][_0x159e02[_0x5136('0x28')]]){for(var _0x1dabed in this[_0x5136('0xc')][_0x159e02['uniqueid']]){if(this['channels'][_0x159e02['uniqueid']][_0x5136('0x3e')](_0x1dabed)){if(this[_0x5136('0xc')][_0x159e02[_0x5136('0x28')]][_0x1dabed][_0x5136('0x51')]==_0x5136('0x83')&&this[_0x5136('0xc')][_0x159e02[_0x5136('0x28')]][_0x1dabed][_0x5136('0x17')]){logger[_0x5136('0x24')](_0x5136('0x84'),_0x159e02['uniqueid'],_0x1dabed);this[_0x5136('0xc')][_0x159e02[_0x5136('0x28')]][_0x1dabed][_0x5136('0x85')]=moment()[_0x5136('0x2a')]('YYYY-MM-DD\x20HH:mm:ss');}}}logger[_0x5136('0x27')](_0x5136('0x86'),_0x159e02[_0x5136('0x28')],util[_0x5136('0x29')](_['values'](this[_0x5136('0xc')][_0x159e02[_0x5136('0x28')]]),{'showHidden':![],'depth':null}));ami[_0x5136('0x22')](_0x5136('0x87'),_['values'](this[_0x5136('0xc')][_0x159e02[_0x5136('0x28')]]));delete this[_0x5136('0xc')][_0x159e02[_0x5136('0x28')]];}if(this[_0x5136('0x70')][_0x159e02[_0x5136('0x28')]]){delete this[_0x5136('0x70')][_0x159e02[_0x5136('0x28')]];}}}catch(_0x24fbfa){logger[_0x5136('0x39')](_0x5136('0x88'),_0x159e02[_0x5136('0x28')],util['inspect'](_0x24fbfa,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x5136('0x21')][_0x5136('0x1e')]=function(_0x2352fe){try{if(this[_0x5136('0x3c')](_0x2352fe)){logger['debug'](_0x5136('0x89'),_0x2352fe[_0x5136('0x28')],util['inspect'](_0x2352fe,{'showHidden':![],'depth':null}));if(this[_0x5136('0xc')][_0x2352fe[_0x5136('0x8a')]]){for(var _0x289b7a in this[_0x5136('0xc')][_0x2352fe[_0x5136('0x8a')]]){if(this[_0x5136('0xc')][_0x2352fe[_0x5136('0x8a')]][_0x5136('0x3e')](_0x289b7a)){if(_0x2352fe[_0x5136('0x8b')]===_0x289b7a){logger[_0x5136('0x24')]('[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x2352fe[_0x5136('0x28')],this[_0x5136('0xc')][_0x2352fe[_0x5136('0x8a')]][_0x289b7a][_0x5136('0x37')],_0x289b7a);var _0x3168da=moment();this[_0x5136('0xc')][_0x2352fe[_0x5136('0x8a')]][_0x289b7a][_0x5136('0x17')]=!![];this['channels'][_0x2352fe[_0x5136('0x8a')]][_0x289b7a][_0x5136('0x85')]=moment()[_0x5136('0x2a')](_0x5136('0x2b'));this['channels'][_0x2352fe[_0x5136('0x8a')]][_0x289b7a][_0x5136('0x46')]='complete';this[_0x5136('0xc')][_0x2352fe[_0x5136('0x8a')]][_0x289b7a][_0x5136('0x51')]=_0x5136('0x83');this[_0x5136('0xc')][_0x2352fe['transfereeuniqueid']][_0x289b7a][_0x5136('0x63')]=_0x3168da[_0x5136('0x8c')](this[_0x5136('0xc')][_0x2352fe[_0x5136('0x8a')]][_0x289b7a]['agentconnectAt'],_0x5136('0x8d'));}}}}if(this[_0x5136('0xc')][_0x2352fe['secondtransfereruniqueid']]){var _0x5215d2=this['channels'][_0x2352fe[_0x5136('0x8e')]];this[_0x5136('0xc')][_0x2352fe[_0x5136('0x8e')]]=this[_0x5136('0xc')][_0x2352fe[_0x5136('0x8a')]];this[_0x5136('0xc')][_0x2352fe[_0x5136('0x8a')]]=_0x5215d2;}}}catch(_0x260dcf){logger['error'](_0x5136('0x8f'),_0x2352fe[_0x5136('0x28')],util[_0x5136('0x29')](_0x260dcf,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x5136('0x21')][_0x5136('0x20')]=function(_0x5b1abe){try{if(this[_0x5136('0x3c')](_0x5b1abe)){logger[_0x5136('0x27')]('[%s][voiceAgentReport][blindtransfer]\x20event:',_0x5b1abe[_0x5136('0x28')],util[_0x5136('0x29')](_0x5b1abe,{'showHidden':![],'depth':null}));if(this[_0x5136('0xc')][_0x5b1abe[_0x5136('0x8a')]]){for(var _0x2b3ced in this[_0x5136('0xc')][_0x5b1abe['transfereeuniqueid']]){if(this[_0x5136('0xc')][_0x5b1abe['transfereeuniqueid']]['hasOwnProperty'](_0x2b3ced)){if(_0x5b1abe['transfereruniqueid']===_0x2b3ced){logger['info'](_0x5136('0x90'),_0x5b1abe['uniqueid'],this['channels'][_0x5b1abe[_0x5136('0x8a')]][_0x2b3ced]['membername'],_0x2b3ced);var _0x374319=moment();this[_0x5136('0xc')][_0x5b1abe[_0x5136('0x8a')]][_0x2b3ced][_0x5136('0x17')]=!![];this['channels'][_0x5b1abe[_0x5136('0x8a')]][_0x2b3ced]['agentcompleteAt']=_0x374319;this[_0x5136('0xc')][_0x5b1abe['transfereeuniqueid']][_0x2b3ced][_0x5136('0x46')]=_0x5136('0x62');this[_0x5136('0xc')][_0x5b1abe['transfereeuniqueid']][_0x2b3ced][_0x5136('0x51')]=_0x5136('0x83');this[_0x5136('0xc')][_0x5b1abe['transfereeuniqueid']][_0x2b3ced][_0x5136('0x63')]=_0x374319['diff'](this[_0x5136('0xc')][_0x5b1abe[_0x5136('0x8a')]][_0x2b3ced]['agentconnectAt'],_0x5136('0x8d'));}}}}}}catch(_0x12c9f9){logger[_0x5136('0x39')](_0x5136('0x91'),_0x5b1abe[_0x5136('0x28')],util[_0x5136('0x29')](_0x12c9f9,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x5136('0x21')][_0x5136('0x92')]=function(_0x5287eb){var _0x1edb42='';try{if(this[_0x5136('0x3c')](_0x5287eb)){logger[_0x5136('0x27')](_0x5136('0x93'),_0x5287eb[_0x5136('0x28')],util['inspect'](_0x5287eb,{'showHidden':![],'depth':null}));if(_0x5287eb[_0x5136('0x94')]){_0x1edb42=_0x5287eb[_0x5136('0x94')][_0x5136('0x95')](0x0,_0x5287eb['channel'][_0x5136('0x96')]('-'));if(this[_0x5136('0xe')][_0x1edb42]){logger[_0x5136('0x24')](_0x5136('0x97'),_0x5287eb['uniqueid'],_0x1edb42);this[_0x5136('0xe')][_0x1edb42]['onhold']=!![];}}}}catch(_0x10fc21){logger[_0x5136('0x39')]('[%s][voiceAgentReport][musiconholdstart]',_0x5287eb[_0x5136('0x28')],util[_0x5136('0x29')](_0x10fc21,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncMusicOnHoldStop']=function(_0x29e8b2){var _0xe530b8='';try{if(this[_0x5136('0x3c')](_0x29e8b2)){logger['debug']('[%s][voiceAgentReport][musiconholdstop]\x20event:',_0x29e8b2[_0x5136('0x28')],util[_0x5136('0x29')](_0x29e8b2,{'showHidden':![],'depth':null}));if(_0x29e8b2['channel']){_0xe530b8=_0x29e8b2[_0x5136('0x94')][_0x5136('0x95')](0x0,_0x29e8b2[_0x5136('0x94')][_0x5136('0x96')]('-'));if(this[_0x5136('0xe')][_0xe530b8]){logger[_0x5136('0x24')](_0x5136('0x98'),_0x29e8b2['uniqueid'],_0xe530b8);this[_0x5136('0xe')][_0xe530b8][_0x5136('0x99')]=![];}}}}catch(_0x376dfc){logger['error']('[%s][voiceAgentReport][musiconholdstop]',_0x29e8b2[_0x5136('0x28')],util[_0x5136('0x29')](_0x376dfc,{'showHidden':![],'depth':null}));}};module['exports']=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index 78f037f..2bdab72 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 _0xfdc6=['xcally-motion-preview','channel','destconnectedlinenum','user:%s','name','user:agentconnect','accountcode','[%s][voiceCallReport][newcallerid]','syncNewChannel','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','format','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','channelstate','merge','pick','debug','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newchannel]','[%s][voiceCallReport][newexten]\x20event:','application','toLowerCase','appdata','CDR(routeAlias)','applicationdata','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','starttime','duration','subtract','seconds','includes','lastapplication','lastdata','startsWith','match','queue','[%s][voiceCallReport][newexten]','syncNewState','[%s][voiceCallReport][newstate]\x20event:','answered','answertime','diff','connectedlinename','destinationchannel','UserId','membername','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','.wav49','replace','find','monitors','push','[%s][voiceCallReport][mixMonitorFilename]','[%s][voiceCallReport][varset]\x20event:','variable','mixmonitor_filename','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','xmd-phone','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','type','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','xmd-originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','destination','xmd-callerid-preview','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','calleridpreview','xmcs-queue','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','syncHangup','cause-txt','billableseconds','holdtime','omit','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','resolve','then','transferType','undefined','isEmpty','getSettings','StopMixMonitor','catch','Action','event','BlindTransfer','blindTransfers','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','custom:voiceCallReport','[%s][voiceCallReport][hangup]','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','origtransferercalleridnum','transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','transfertargetuniqueid','transferconnectedlinenum','origtransfereruniqueid','routeid','origtransfererlinkedid','ATTENDED','secondtransfereruniqueid','[%s][voiceCallReport][attendedtransfer]','syncBlindTransfer','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereecalleridnum','extension','[%s][voiceCallReport][blindtransfer]\x20event:','BLIND','transfereruniqueid','[%s][voiceCallReport][blindtransfer]','[%s][voiceCallReport][musiconholdstart]\x20event:','isNil','mohstarttime','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','[%s][voiceCallReport][musiconholdstop]','exports','bluebird','lodash','util','path','ioredis','../../../config/environment','ami','../ami','../model/channel','../rpc/setting','unknown','not_inuse','busy','invalid','unavailable','ringinuse','onhold','set','voicemail','NO\x20ANSWER','BUSY','FAILED','defaults','redis','localhost','socket.io-emitter','channels','agents','syncNewExten','bind','newexten','newchannel','newstate','syncVarSet','hangup','newcallerid','attendedtransfer','syncAttendedTransfer','blindtransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','info','[voiceCallReport][coreshowchannels]\x20started','actionCoreShowChannels','error','[voiceCallReport][coreshowchannels]','inspect','prototype','isNotNull','isUndefined','emit','syncNewCallerId','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','calleridname','calleridnum','[%s][voiceCallReport][newcallerid]\x20event:','linkedid','keys','context','from-sip','split','exten'];(function(_0x49253a,_0x4883d1){var _0x471008=function(_0x2c6210){while(--_0x2c6210){_0x49253a['push'](_0x49253a['shift']());}};_0x471008(++_0x4883d1);}(_0xfdc6,0x88));var _0x6fdc=function(_0x4d7241,_0x32aa1f){_0x4d7241=_0x4d7241-0x0;var _0x59d9e2=_0xfdc6[_0x4d7241];return _0x59d9e2;};'use strict';var BPromise=require(_0x6fdc('0x0'));var _=require(_0x6fdc('0x1'));var moment=require('moment');var util=require(_0x6fdc('0x2'));var path=require(_0x6fdc('0x3'));var Redis=require(_0x6fdc('0x4'));var config=require(_0x6fdc('0x5'));var logger=require('../../../config/logger')(_0x6fdc('0x6'));var ami=require(_0x6fdc('0x7'));var Channel=require(_0x6fdc('0x8'));var RpcSetting=require(_0x6fdc('0x9'));var statusDesc=[_0x6fdc('0xa'),_0x6fdc('0xb'),'inuse',_0x6fdc('0xc'),_0x6fdc('0xd'),_0x6fdc('0xe'),'ringing',_0x6fdc('0xf'),_0x6fdc('0x10')];var applications=[_0x6fdc('0x11'),'queue','agi','dial','playback',_0x6fdc('0x12')];var dispositions=[_0x6fdc('0x13'),'FAILED','FAILED',_0x6fdc('0x13'),_0x6fdc('0x13'),_0x6fdc('0x13'),'ANSWERED',_0x6fdc('0x14'),'FAILED',_0x6fdc('0x15'),'FAILED'];var actions={};config['redis']=_[_0x6fdc('0x16')](config[_0x6fdc('0x17')],{'host':_0x6fdc('0x18'),'port':0x18eb});var io=require(_0x6fdc('0x19'))(new Redis(config[_0x6fdc('0x17')]));function VoiceCallReport(_0x319128){this[_0x6fdc('0x1a')]=_0x319128[_0x6fdc('0x1a')];this[_0x6fdc('0x1b')]=_0x319128[_0x6fdc('0x1b')];this['blindTransfers']={};ami['on']('coreshowchannel',this[_0x6fdc('0x1c')][_0x6fdc('0x1d')](this));ami['on'](_0x6fdc('0x1e'),this[_0x6fdc('0x1c')]['bind'](this));ami['on'](_0x6fdc('0x1f'),this['syncNewChannel'][_0x6fdc('0x1d')](this));ami['on'](_0x6fdc('0x20'),this['syncNewState'][_0x6fdc('0x1d')](this));ami['on']('varset',this[_0x6fdc('0x21')][_0x6fdc('0x1d')](this));ami['on'](_0x6fdc('0x22'),this['syncHangup'][_0x6fdc('0x1d')](this));ami['on'](_0x6fdc('0x23'),this['syncNewCallerId'][_0x6fdc('0x1d')](this));ami['on'](_0x6fdc('0x24'),this[_0x6fdc('0x25')][_0x6fdc('0x1d')](this));ami['on'](_0x6fdc('0x26'),this['syncBlindTransfer'][_0x6fdc('0x1d')](this));ami['on'](_0x6fdc('0x27'),this[_0x6fdc('0x28')][_0x6fdc('0x1d')](this));ami['on'](_0x6fdc('0x29'),this[_0x6fdc('0x2a')]['bind'](this));try{logger[_0x6fdc('0x2b')](_0x6fdc('0x2c'));ami[_0x6fdc('0x2d')]();}catch(_0x56f60d){logger[_0x6fdc('0x2e')](_0x6fdc('0x2f'),util[_0x6fdc('0x30')](_0x56f60d,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0x6fdc('0x31')][_0x6fdc('0x32')]=function(_0x39f222){return _0x39f222!==null&&!_[_0x6fdc('0x33')](_0x39f222);};VoiceCallReport[_0x6fdc('0x31')][_0x6fdc('0x34')]=function(_0x2ed5b5,_0x7c54b8,_0x5c8f68){io['to'](_0x2ed5b5)[_0x6fdc('0x34')](_0x7c54b8,_0x5c8f68);};VoiceCallReport[_0x6fdc('0x31')][_0x6fdc('0x35')]=function(_0x5a4da0){try{if(this[_0x6fdc('0x32')](_0x5a4da0)){logger['info'](_0x6fdc('0x36'),_0x5a4da0[_0x6fdc('0x37')],_0x5a4da0[_0x6fdc('0x38')],_0x5a4da0[_0x6fdc('0x39')]);logger['debug'](_0x6fdc('0x3a'),_0x5a4da0[_0x6fdc('0x37')],util[_0x6fdc('0x30')](_0x5a4da0,{'showHidden':![],'depth':null}));if(_0x5a4da0[_0x6fdc('0x37')]===_0x5a4da0[_0x6fdc('0x3b')]){if(!_[_0x6fdc('0x33')](this[_0x6fdc('0x1a')][_0x5a4da0[_0x6fdc('0x37')]])){_['merge'](this['channels'][_0x5a4da0['uniqueid']],_['pick'](_0x5a4da0,_[_0x6fdc('0x3c')](this[_0x6fdc('0x1a')][_0x5a4da0[_0x6fdc('0x37')]])));}}if(_0x5a4da0[_0x6fdc('0x3d')]===_0x6fdc('0x3e')){if(this[_0x6fdc('0x1b')][_0x5a4da0['channel'][_0x6fdc('0x3f')]('-')[0x0]]){if(_0x5a4da0[_0x6fdc('0x40')]==_0x6fdc('0x41')){this[_0x6fdc('0x1b')][_0x5a4da0[_0x6fdc('0x42')][_0x6fdc('0x3f')]('-')[0x0]][_0x6fdc('0x43')]=_0x5a4da0['connectedlinenum'];this[_0x6fdc('0x34')](util['format'](_0x6fdc('0x44'),this['agents'][_0x5a4da0['channel'][_0x6fdc('0x3f')]('-')[0x0]][_0x6fdc('0x45')]),_0x6fdc('0x46'),{'destaccountcode':this[_0x6fdc('0x1b')][_0x5a4da0['channel'][_0x6fdc('0x3f')]('-')[0x0]][_0x6fdc('0x47')],'destconnectedlinenum':_0x5a4da0['connectedlinenum']});}}}}}catch(_0x28e3e9){logger[_0x6fdc('0x2e')](_0x6fdc('0x48'),_0x5a4da0[_0x6fdc('0x37')],util[_0x6fdc('0x30')](_0x28e3e9,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x6fdc('0x31')][_0x6fdc('0x49')]=function(_0x1bf739){try{if(this[_0x6fdc('0x32')](_0x1bf739)){logger['debug']('[%s][voiceCallReport][newchannel]\x20event:',_0x1bf739[_0x6fdc('0x37')],util[_0x6fdc('0x30')](_0x1bf739,{'showHidden':![],'depth':null}));if(_0x1bf739[_0x6fdc('0x37')]===_0x1bf739[_0x6fdc('0x3b')]&&_0x1bf739[_0x6fdc('0x42')]!=_0x6fdc('0x4a')){if(_[_0x6fdc('0x33')](this['channels'][_0x1bf739['uniqueid']])){logger[_0x6fdc('0x2b')](_0x6fdc('0x4b'),_0x1bf739[_0x6fdc('0x37')],_0x1bf739[_0x6fdc('0x3d')],_0x1bf739[_0x6fdc('0x40')]);this[_0x6fdc('0x1a')][_0x1bf739[_0x6fdc('0x37')]]=new Channel();this['channels'][_0x1bf739[_0x6fdc('0x37')]]['starttime']=moment()[_0x6fdc('0x4c')](_0x6fdc('0x4d'));this[_0x6fdc('0x1a')][_0x1bf739[_0x6fdc('0x37')]][_0x6fdc('0x4e')]=dispositions[_[_0x6fdc('0x4f')](_0x1bf739[_0x6fdc('0x50')])];_[_0x6fdc('0x51')](this[_0x6fdc('0x1a')][_0x1bf739[_0x6fdc('0x37')]],_[_0x6fdc('0x52')](_0x1bf739,_[_0x6fdc('0x3c')](this[_0x6fdc('0x1a')][_0x1bf739[_0x6fdc('0x37')]])));if(_0x1bf739[_0x6fdc('0x3d')]==='from-sip'){if(this['agents'][_0x1bf739[_0x6fdc('0x42')]['split']('-')[0x0]]){if(_[_0x6fdc('0x33')](this[_0x6fdc('0x1b')][_0x1bf739[_0x6fdc('0x42')][_0x6fdc('0x3f')]('-')[0x0]][_0x6fdc('0x43')])){this[_0x6fdc('0x1b')][_0x1bf739[_0x6fdc('0x42')]['split']('-')[0x0]][_0x6fdc('0x43')]=_0x1bf739[_0x6fdc('0x40')];logger[_0x6fdc('0x53')](_0x6fdc('0x54'),_0x1bf739[_0x6fdc('0x37')],util[_0x6fdc('0x30')]({'destaccountcode':this[_0x6fdc('0x1b')][_0x1bf739[_0x6fdc('0x42')]['split']('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x1bf739[_0x6fdc('0x40')]},{'showHidden':![],'depth':null}));this['emit'](util['format'](_0x6fdc('0x44'),this[_0x6fdc('0x1b')][_0x1bf739[_0x6fdc('0x42')][_0x6fdc('0x3f')]('-')[0x0]]['name']),_0x6fdc('0x46'),{'destaccountcode':this['agents'][_0x1bf739[_0x6fdc('0x42')][_0x6fdc('0x3f')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x1bf739[_0x6fdc('0x40')]});}}}}}}}catch(_0x4b2986){logger[_0x6fdc('0x2e')](_0x6fdc('0x55'),_0x1bf739[_0x6fdc('0x37')],util[_0x6fdc('0x30')](_0x4b2986,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x6fdc('0x31')][_0x6fdc('0x1c')]=function(_0x48a065){try{if(this['isNotNull'](_0x48a065)){logger[_0x6fdc('0x53')](_0x6fdc('0x56'),_0x48a065[_0x6fdc('0x37')],util[_0x6fdc('0x30')](_0x48a065,{'showHidden':![],'depth':null}));if(_0x48a065[_0x6fdc('0x37')]===_0x48a065[_0x6fdc('0x3b')]&&_0x48a065['exten']!='h'&&_0x48a065[_0x6fdc('0x42')]!=_0x6fdc('0x4a')){_0x48a065[_0x6fdc('0x57')]=_0x48a065[_0x6fdc('0x57')][_0x6fdc('0x58')]();_0x48a065['applicationdata']=_0x48a065[_0x6fdc('0x59')]&&_0x48a065['appdata']['startsWith'](_0x6fdc('0x5a'))?_0x48a065[_0x6fdc('0x59')]:(_0x48a065[_0x6fdc('0x59')]||_0x48a065[_0x6fdc('0x5b')])[_0x6fdc('0x58')]();logger[_0x6fdc('0x2b')](_0x6fdc('0x5c'),_0x48a065[_0x6fdc('0x37')],_0x48a065[_0x6fdc('0x57')],_0x48a065[_0x6fdc('0x5b')]);if(_[_0x6fdc('0x33')](this[_0x6fdc('0x1a')][_0x48a065[_0x6fdc('0x37')]])){this[_0x6fdc('0x1a')][_0x48a065['uniqueid']]=new Channel();this['channels'][_0x48a065[_0x6fdc('0x37')]][_0x6fdc('0x5d')]=_0x48a065[_0x6fdc('0x5e')]?moment()[_0x6fdc('0x5f')](moment['duration'](_0x48a065[_0x6fdc('0x5e')])[_0x6fdc('0x60')](),_0x6fdc('0x60'))[_0x6fdc('0x4c')](_0x6fdc('0x4d')):moment()['format'](_0x6fdc('0x4d'));this[_0x6fdc('0x1a')][_0x48a065[_0x6fdc('0x37')]][_0x6fdc('0x4e')]=_0x6fdc('0x13');}_[_0x6fdc('0x51')](this[_0x6fdc('0x1a')][_0x48a065[_0x6fdc('0x37')]],_[_0x6fdc('0x52')](_0x48a065,_[_0x6fdc('0x3c')](this[_0x6fdc('0x1a')][_0x48a065[_0x6fdc('0x37')]])));if(_[_0x6fdc('0x61')](applications,_0x48a065[_0x6fdc('0x57')])){this['channels'][_0x48a065['uniqueid']][_0x6fdc('0x62')]=_0x48a065[_0x6fdc('0x57')];this[_0x6fdc('0x1a')][_0x48a065['uniqueid']][_0x6fdc('0x63')]=_0x48a065[_0x6fdc('0x5b')];if(_0x48a065['application']===_0x6fdc('0x11')&&_[_0x6fdc('0x64')](_0x48a065[_0x6fdc('0x5b')][_0x6fdc('0x58')](),'cdr(')){var _0x1f7769=_0x48a065[_0x6fdc('0x5b')][_0x6fdc('0x3f')]('=');var _0x34a96f=_0x1f7769[0x0][_0x6fdc('0x58')]()[_0x6fdc('0x65')](/cdr\((.*)\)/);if(_0x34a96f){this['channels'][_0x48a065['uniqueid']][_0x34a96f[0x1]]=_0x1f7769[0x1];}}else if(_0x48a065[_0x6fdc('0x57')]===_0x6fdc('0x66')){this[_0x6fdc('0x1a')][_0x48a065['uniqueid']]['queue']=_0x48a065['applicationdata'][_0x6fdc('0x3f')](',')[0x0];}}}}}catch(_0x526318){logger[_0x6fdc('0x2e')](_0x6fdc('0x67'),_0x48a065[_0x6fdc('0x37')],util['inspect'](_0x526318,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x6fdc('0x68')]=function(_0x4b4fb2){try{if(this[_0x6fdc('0x32')](_0x4b4fb2)){logger['info']('[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s',_0x4b4fb2['uniqueid'],_0x4b4fb2[_0x6fdc('0x3b')],_0x4b4fb2[_0x6fdc('0x38')],_0x4b4fb2[_0x6fdc('0x39')]);logger['debug'](_0x6fdc('0x69'),_0x4b4fb2[_0x6fdc('0x37')],util[_0x6fdc('0x30')](_0x4b4fb2,{'showHidden':![],'depth':null}));if(_0x4b4fb2[_0x6fdc('0x37')]!==_0x4b4fb2[_0x6fdc('0x3b')]){if(this[_0x6fdc('0x1a')][_0x4b4fb2[_0x6fdc('0x3b')]]){if(_0x4b4fb2['channelstate']==='6'){if(!this[_0x6fdc('0x1a')][_0x4b4fb2['linkedid']]['answered']){var _0x4e1cd4=moment();this['channels'][_0x4b4fb2['linkedid']][_0x6fdc('0x6a')]=!![];this[_0x6fdc('0x1a')][_0x4b4fb2[_0x6fdc('0x3b')]][_0x6fdc('0x6b')]=_0x4e1cd4[_0x6fdc('0x4c')]('YYYY-MM-DD\x20HH:mm:ss');if(this[_0x6fdc('0x1a')][_0x4b4fb2['linkedid']][_0x6fdc('0x5d')]){this['channels'][_0x4b4fb2[_0x6fdc('0x3b')]]['holdtime']=_0x4e1cd4[_0x6fdc('0x6c')](this[_0x6fdc('0x1a')][_0x4b4fb2[_0x6fdc('0x3b')]][_0x6fdc('0x5d')],_0x6fdc('0x60'));}}this[_0x6fdc('0x1a')][_0x4b4fb2[_0x6fdc('0x3b')]][_0x6fdc('0x3b')]=_0x4b4fb2[_0x6fdc('0x37')];if(_0x4b4fb2['calleridnum']!==_0x6fdc('0x41')){this[_0x6fdc('0x1a')][_0x4b4fb2[_0x6fdc('0x3b')]]['connectedlinenum']=_0x4b4fb2[_0x6fdc('0x39')];}this['channels'][_0x4b4fb2[_0x6fdc('0x3b')]][_0x6fdc('0x6d')]=_0x4b4fb2[_0x6fdc('0x38')];this[_0x6fdc('0x1a')][_0x4b4fb2[_0x6fdc('0x3b')]][_0x6fdc('0x6e')]=_0x4b4fb2['channel'];this[_0x6fdc('0x1a')][_0x4b4fb2[_0x6fdc('0x3b')]][_0x6fdc('0x4e')]=dispositions[_[_0x6fdc('0x4f')](_0x4b4fb2[_0x6fdc('0x50')])];if(this[_0x6fdc('0x1b')][_0x4b4fb2['channel'][_0x6fdc('0x3f')]('-')[0x0]]){this[_0x6fdc('0x1a')][_0x4b4fb2[_0x6fdc('0x3b')]][_0x6fdc('0x6f')]=this[_0x6fdc('0x1b')][_0x4b4fb2[_0x6fdc('0x42')][_0x6fdc('0x3f')]('-')[0x0]]['id'];this[_0x6fdc('0x1a')][_0x4b4fb2['linkedid']][_0x6fdc('0x70')]=this['agents'][_0x4b4fb2[_0x6fdc('0x42')][_0x6fdc('0x3f')]('-')[0x0]][_0x6fdc('0x45')];}}}}else{if(this['channels'][_0x4b4fb2[_0x6fdc('0x37')]]){if(_0x4b4fb2['channelstate']==='6'){if(this[_0x6fdc('0x1b')][_0x4b4fb2[_0x6fdc('0x42')][_0x6fdc('0x3f')]('-')[0x0]]){this['channels'][_0x4b4fb2[_0x6fdc('0x37')]][_0x6fdc('0x6f')]=this[_0x6fdc('0x1b')][_0x4b4fb2[_0x6fdc('0x42')][_0x6fdc('0x3f')]('-')[0x0]]['id'];this[_0x6fdc('0x1a')][_0x4b4fb2[_0x6fdc('0x37')]][_0x6fdc('0x70')]=this['agents'][_0x4b4fb2[_0x6fdc('0x42')]['split']('-')[0x0]][_0x6fdc('0x45')];}}}}if(_0x4b4fb2[_0x6fdc('0x50')]==='6'&&_0x4b4fb2[_0x6fdc('0x3d')]===_0x6fdc('0x3e')){if(this['agents'][_0x4b4fb2[_0x6fdc('0x42')]['split']('-')[0x0]]){this['agents'][_0x4b4fb2[_0x6fdc('0x42')]['split']('-')[0x0]][_0x6fdc('0x43')]=_0x4b4fb2[_0x6fdc('0x40')];var _0x4e135f;if(this[_0x6fdc('0x1a')][_0x4b4fb2['uniqueid']])_0x4e135f=this['channels'][_0x4b4fb2[_0x6fdc('0x37')]]['routealias'];else if(this[_0x6fdc('0x1a')][_0x4b4fb2[_0x6fdc('0x3b')]])_0x4e135f=this[_0x6fdc('0x1a')][_0x4b4fb2[_0x6fdc('0x3b')]][_0x6fdc('0x71')];logger[_0x6fdc('0x53')](_0x6fdc('0x72'),_0x4b4fb2[_0x6fdc('0x37')],util[_0x6fdc('0x30')]({'destaccountcode':this[_0x6fdc('0x1b')][_0x4b4fb2[_0x6fdc('0x42')][_0x6fdc('0x3f')]('-')[0x0]][_0x6fdc('0x47')],'destconnectedlinenum':_0x4b4fb2['exten'],'routealias':_0x4e135f},{'showHidden':![],'depth':null}));this[_0x6fdc('0x34')](util['format'](_0x6fdc('0x44'),this[_0x6fdc('0x1b')][_0x4b4fb2[_0x6fdc('0x42')][_0x6fdc('0x3f')]('-')[0x0]][_0x6fdc('0x45')]),'user:agentconnect',{'destaccountcode':this[_0x6fdc('0x1b')][_0x4b4fb2[_0x6fdc('0x42')]['split']('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x4b4fb2['exten'],'routealias':_0x4e135f});}}}}catch(_0x6e0108){logger[_0x6fdc('0x2e')](_0x6fdc('0x73'),_0x4b4fb2[_0x6fdc('0x37')],util[_0x6fdc('0x30')](_0x6e0108,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x6fdc('0x74')]=function(_0x1e63a2,_0x492530){try{if(this[_0x6fdc('0x1a')][_0x1e63a2]){logger[_0x6fdc('0x2b')](_0x6fdc('0x75'),_0x1e63a2,_0x492530);this['channels'][_0x1e63a2][_0x6fdc('0x76')]=!![];if(_['endsWith'](_0x492530,_0x6fdc('0x77'))){_0x492530=_0x492530[_0x6fdc('0x78')]('.wav49','.WAV');}this[_0x6fdc('0x1a')][_0x1e63a2]['monitorFilename']=_0x492530;var _0x5337c9=_[_0x6fdc('0x79')](this[_0x6fdc('0x1a')][_0x1e63a2][_0x6fdc('0x7a')],{'filename':_0x492530});if(_['isNil'](_0x5337c9)){this[_0x6fdc('0x1a')][_0x1e63a2][_0x6fdc('0x7a')][_0x6fdc('0x7b')]({'filename':_0x492530,'createdAt':moment()[_0x6fdc('0x4c')](_0x6fdc('0x4d')),'mixmonitorid':'','status':'rec'});}}}catch(_0x3cef9f){logger[_0x6fdc('0x2e')](_0x6fdc('0x7c'),_0x1e63a2,util[_0x6fdc('0x30')](_0x3cef9f,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x6fdc('0x31')][_0x6fdc('0x21')]=function(_0x16abef){try{if(this['isNotNull'](_0x16abef)){logger[_0x6fdc('0x53')](_0x6fdc('0x7d'),_0x16abef[_0x6fdc('0x37')],util['inspect'](_0x16abef,{'showHidden':![],'depth':null}));if(this[_0x6fdc('0x1a')][_0x16abef[_0x6fdc('0x37')]]&&_0x16abef[_0x6fdc('0x42')]!='OutgoingSpoolFailed'){if(this[_0x6fdc('0x32')](_0x16abef['variable'])){if(this['isNotNull'](_0x16abef[_0x6fdc('0x7e')][_0x6fdc('0x7f')])){logger[_0x6fdc('0x2b')](_0x6fdc('0x80'),_0x16abef[_0x6fdc('0x37')],_0x16abef[_0x6fdc('0x81')]);this[_0x6fdc('0x74')](_0x16abef['uniqueid'],_0x16abef[_0x6fdc('0x81')]);}else if(this[_0x6fdc('0x32')](_0x16abef[_0x6fdc('0x7e')][_0x6fdc('0x82')])){logger[_0x6fdc('0x2b')](_0x6fdc('0x83'),_0x16abef[_0x6fdc('0x37')],_0x16abef['value']);this[_0x6fdc('0x1a')][_0x16abef['uniqueid']][_0x6fdc('0x39')]=_0x16abef[_0x6fdc('0x81')];}else if(this['isNotNull'](_0x16abef[_0x6fdc('0x7e')]['xmd-callerid'])){logger['info'](_0x6fdc('0x84'),_0x16abef[_0x6fdc('0x37')],_0x16abef[_0x6fdc('0x81')]);this[_0x6fdc('0x1a')][_0x16abef[_0x6fdc('0x37')]]['callerid']=_0x16abef[_0x6fdc('0x81')];}else if(this[_0x6fdc('0x32')](_0x16abef[_0x6fdc('0x7e')][_0x6fdc('0x85')])){logger['info'](_0x6fdc('0x86'),_0x16abef['uniqueid'],_0x16abef[_0x6fdc('0x81')]);this[_0x6fdc('0x1a')][_0x16abef['uniqueid']][_0x6fdc('0x87')]=_0x16abef[_0x6fdc('0x81')];}else if(this['isNotNull'](_0x16abef['variable']['xmd-queue'])){logger[_0x6fdc('0x2b')](_0x6fdc('0x88'),_0x16abef['uniqueid'],_0x16abef[_0x6fdc('0x81')][_0x6fdc('0x3f')](',')[0x0]);this[_0x6fdc('0x1a')][_0x16abef[_0x6fdc('0x37')]][_0x6fdc('0x66')]=_0x16abef[_0x6fdc('0x81')][_0x6fdc('0x3f')](',')[0x0];}else if(this['isNotNull'](_0x16abef[_0x6fdc('0x7e')][_0x6fdc('0x89')])){logger[_0x6fdc('0x2b')](_0x6fdc('0x8a'),_0x16abef['uniqueid'],_0x16abef[_0x6fdc('0x81')]);this[_0x6fdc('0x1a')][_0x16abef[_0x6fdc('0x37')]]['originatecalleridnum']=_0x16abef[_0x6fdc('0x81')];}else if(this['isNotNull'](_0x16abef[_0x6fdc('0x7e')]['xmd-destination'])){logger[_0x6fdc('0x2b')](_0x6fdc('0x8b'),_0x16abef['uniqueid'],_0x16abef[_0x6fdc('0x81')]);this[_0x6fdc('0x1a')][_0x16abef[_0x6fdc('0x37')]][_0x6fdc('0x8c')]=_0x16abef['value'];}else if(this[_0x6fdc('0x32')](_0x16abef['variable'][_0x6fdc('0x8d')])){logger[_0x6fdc('0x2b')](_0x6fdc('0x8e'),_0x16abef[_0x6fdc('0x37')],_0x16abef['value']);this[_0x6fdc('0x1a')][_0x16abef[_0x6fdc('0x37')]][_0x6fdc('0x8f')]=_0x16abef[_0x6fdc('0x81')];}else if(this[_0x6fdc('0x32')](_0x16abef[_0x6fdc('0x7e')][_0x6fdc('0x90')])){logger[_0x6fdc('0x2b')](_0x6fdc('0x91'),_0x16abef[_0x6fdc('0x37')],_0x16abef['value']);this[_0x6fdc('0x1a')][_0x16abef['uniqueid']][_0x6fdc('0x66')]=_0x16abef['value'];}else if(this[_0x6fdc('0x32')](_0x16abef[_0x6fdc('0x7e')]['sipcallid'])){logger['info'](_0x6fdc('0x92'),_0x16abef[_0x6fdc('0x37')],_0x16abef[_0x6fdc('0x81')]);this[_0x6fdc('0x1a')][_0x16abef[_0x6fdc('0x37')]]['sipcalluniqueid']=_0x16abef[_0x6fdc('0x81')];}}}else if(this[_0x6fdc('0x32')](_0x16abef['variable'][_0x6fdc('0x7f')])){if(_0x16abef[_0x6fdc('0x81')]){var _0x2c9885=path['parse'](_0x16abef[_0x6fdc('0x81')])[_0x6fdc('0x45')];logger[_0x6fdc('0x2b')](_0x6fdc('0x80'),_0x2c9885,_0x16abef[_0x6fdc('0x81')]);this['syncMixMonitorFilename'](_0x2c9885,_0x16abef[_0x6fdc('0x81')]);}}else if(this['channels'][_0x16abef[_0x6fdc('0x3b')]]){if(this[_0x6fdc('0x32')](_0x16abef[_0x6fdc('0x7e')])){if(this[_0x6fdc('0x32')](_0x16abef[_0x6fdc('0x7e')]['sipcallid'])){logger[_0x6fdc('0x2b')](_0x6fdc('0x92'),_0x16abef[_0x6fdc('0x3b')],_0x16abef[_0x6fdc('0x81')]);this['channels'][_0x16abef[_0x6fdc('0x3b')]]['sipcalllinkedid']=_0x16abef[_0x6fdc('0x81')];}}}}}catch(_0x5dbd1f){logger[_0x6fdc('0x2e')]('[%s][voiceCallReport][varset]',_0x16abef[_0x6fdc('0x37')],util[_0x6fdc('0x30')](_0x5dbd1f,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x6fdc('0x93')]=function(_0x325652){try{if(this[_0x6fdc('0x32')](_0x325652)){logger[_0x6fdc('0x53')]('[%s][voiceCallReport][hangup]\x20event:',_0x325652[_0x6fdc('0x37')],util['inspect'](_0x325652,{'showHidden':![],'depth':null}));if(this[_0x6fdc('0x1a')][_0x325652[_0x6fdc('0x37')]]){logger[_0x6fdc('0x2b')]('[%s][voiceCallReport][hangup]\x20reason:%s',_0x325652[_0x6fdc('0x37')],_0x325652[_0x6fdc('0x94')]);var _0x1d384d=moment();this[_0x6fdc('0x1a')][_0x325652[_0x6fdc('0x37')]]['endtime']=_0x1d384d[_0x6fdc('0x4c')](_0x6fdc('0x4d'));this[_0x6fdc('0x1a')][_0x325652[_0x6fdc('0x37')]][_0x6fdc('0x5e')]=_0x1d384d[_0x6fdc('0x6c')](this[_0x6fdc('0x1a')][_0x325652['uniqueid']][_0x6fdc('0x5d')],_0x6fdc('0x60'));if(this[_0x6fdc('0x1a')][_0x325652['uniqueid']][_0x6fdc('0x6a')]){this['channels'][_0x325652[_0x6fdc('0x37')]][_0x6fdc('0x95')]=_0x1d384d[_0x6fdc('0x6c')](this[_0x6fdc('0x1a')][_0x325652[_0x6fdc('0x37')]]['answertime'],_0x6fdc('0x60'));this['channels'][_0x325652['uniqueid']][_0x6fdc('0x96')]=this['channels'][_0x325652[_0x6fdc('0x37')]]['duration']-this[_0x6fdc('0x1a')][_0x325652[_0x6fdc('0x37')]][_0x6fdc('0x95')];}if(_0x325652[_0x6fdc('0x3d')]===_0x6fdc('0x3e')){if(this[_0x6fdc('0x1b')][_0x325652[_0x6fdc('0x42')][_0x6fdc('0x3f')]('-')[0x0]]){this[_0x6fdc('0x1b')][_0x325652[_0x6fdc('0x42')][_0x6fdc('0x3f')]('-')[0x0]]=_[_0x6fdc('0x97')](this[_0x6fdc('0x1b')][_0x325652[_0x6fdc('0x42')][_0x6fdc('0x3f')]('-')[0x0]],['destconnectedlinenum']);logger[_0x6fdc('0x53')](_0x6fdc('0x98'),_0x325652[_0x6fdc('0x37')],util[_0x6fdc('0x30')]({'id':this[_0x6fdc('0x1b')][_0x325652[_0x6fdc('0x42')][_0x6fdc('0x3f')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x325652[_0x6fdc('0x42')][_0x6fdc('0x3f')]('-')[0x0]][_0x6fdc('0x47')]},{'showHidden':![],'depth':null}));this[_0x6fdc('0x34')](util[_0x6fdc('0x4c')]('user:%s',this[_0x6fdc('0x1b')][_0x325652[_0x6fdc('0x42')][_0x6fdc('0x3f')]('-')[0x0]][_0x6fdc('0x45')]),_0x6fdc('0x99'),{'id':this[_0x6fdc('0x1b')][_0x325652[_0x6fdc('0x42')][_0x6fdc('0x3f')]('-')[0x0]]['id'],'destaccountcode':this[_0x6fdc('0x1b')][_0x325652[_0x6fdc('0x42')][_0x6fdc('0x3f')]('-')[0x0]][_0x6fdc('0x47')]});}}var _0x3727dc=this;Promise[_0x6fdc('0x9a')]()[_0x6fdc('0x9b')](function(){var _0x4c47da=_0x3727dc[_0x6fdc('0x1a')][_0x325652[_0x6fdc('0x37')]];if(typeof _0x4c47da[_0x6fdc('0x9c')]===_0x6fdc('0x9d'))return;if(_[_0x6fdc('0x9e')](_0x4c47da[_0x6fdc('0x7a')]))return;return RpcSetting[_0x6fdc('0x9f')]()[_0x6fdc('0x9b')](function(_0x3af731){if(!_0x3af731['stopRecordingOnTransfer'])return;return Promise[_0x6fdc('0x9a')]()['then'](function(){return ami['Action']({'action':_0x6fdc('0xa0'),'channel':_0x4c47da[_0x6fdc('0x42')]})[_0x6fdc('0xa1')](function(){});})['then'](function(){return ami[_0x6fdc('0xa2')]({'action':_0x6fdc('0xa0'),'channel':_0x4c47da[_0x6fdc('0x6e')]})[_0x6fdc('0xa1')](function(){})['finally'](function(){var _0x14b9de=_0x3727dc[_0x6fdc('0x1b')][_0x4c47da['destinationchannel'][_0x6fdc('0x3f')]('-')[0x0]];if(!_0x14b9de)return;io[_0x6fdc('0x34')]('webbar:stopmonitors',{'agentId':_0x14b9de['id'],'uniqueid':_0x4c47da['uniqueid']});});});});})['then'](function(){if(_0x325652[_0x6fdc('0xa3')]===_0x6fdc('0xa4')){_0x3727dc[_0x6fdc('0xa5')][_0x325652['uniqueid']]=_0x3727dc[_0x6fdc('0x1a')][_0x325652[_0x6fdc('0x37')]];}else{if(_0x3727dc['channels'][_0x325652[_0x6fdc('0x37')]][_0x6fdc('0x87')]==='outbound'&&_0x3727dc[_0x6fdc('0xa5')][_0x325652[_0x6fdc('0x37')]]){_0x3727dc['channels'][_0x325652[_0x6fdc('0x37')]]['uniqueid']=[_0x3727dc['channels'][_0x325652['uniqueid']]['linkedid'],_0x3727dc['channels'][_0x325652[_0x6fdc('0x37')]][_0x6fdc('0x3b')]=_0x3727dc[_0x6fdc('0x1a')][_0x325652['uniqueid']][_0x6fdc('0x37')]][0x0];delete _0x3727dc['blindTransfers'][_0x325652[_0x6fdc('0x37')]];}}logger[_0x6fdc('0x53')](_0x6fdc('0xa6'),_0x325652[_0x6fdc('0x37')],util[_0x6fdc('0x30')](_0x3727dc[_0x6fdc('0x1a')][_0x325652[_0x6fdc('0x37')]],{'showHidden':![],'depth':null}));ami['emit'](_0x6fdc('0xa7'),_0x3727dc[_0x6fdc('0x1a')][_0x325652[_0x6fdc('0x37')]]);delete _0x3727dc[_0x6fdc('0x1a')][_0x325652[_0x6fdc('0x37')]];});}}}catch(_0x5dc64f){logger['error'](_0x6fdc('0xa8'),_0x325652[_0x6fdc('0x37')],util['inspect'](_0x5dc64f,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x6fdc('0x31')][_0x6fdc('0x25')]=function(_0x4bee15){try{if(this[_0x6fdc('0x32')](_0x4bee15)){logger[_0x6fdc('0x2b')](_0x6fdc('0xa9'),_0x4bee15[_0x6fdc('0x37')],_0x4bee15[_0x6fdc('0xaa')],_0x4bee15[_0x6fdc('0xab')]);logger['debug'](_0x6fdc('0xac'),_0x4bee15[_0x6fdc('0x37')],util['inspect'](_0x4bee15,{'showHidden':![],'depth':null}));if(this[_0x6fdc('0x1a')][_0x4bee15[_0x6fdc('0xad')]]){this[_0x6fdc('0x1a')][_0x4bee15[_0x6fdc('0xad')]][_0x6fdc('0xae')]=_0x4bee15[_0x6fdc('0xaa')];this[_0x6fdc('0x1a')][_0x4bee15['transfereeuniqueid']]['transferconnectedlinenum']=_0x4bee15[_0x6fdc('0xab')];if(this[_0x6fdc('0x1a')][_0x4bee15['secondtransfereruniqueid']]){var _0x36f713=this[_0x6fdc('0x1a')][_0x4bee15['secondtransfereruniqueid']];this['channels'][_0x4bee15['secondtransfereruniqueid']]=this[_0x6fdc('0x1a')][_0x4bee15[_0x6fdc('0xad')]];this[_0x6fdc('0x1a')][_0x4bee15[_0x6fdc('0xad')]]=_0x36f713;}}else if(this[_0x6fdc('0x1a')][_0x4bee15[_0x6fdc('0xaf')]]){this[_0x6fdc('0x1a')][_0x4bee15[_0x6fdc('0xaf')]][_0x6fdc('0xae')]=_0x4bee15[_0x6fdc('0xaa')];this[_0x6fdc('0x1a')][_0x4bee15['transfertargetuniqueid']][_0x6fdc('0xb0')]=_0x4bee15[_0x6fdc('0xab')];if(this['channels'][_0x4bee15[_0x6fdc('0xb1')]]){var _0x36f713=this[_0x6fdc('0x1a')][_0x4bee15[_0x6fdc('0xb1')]];this[_0x6fdc('0x1a')][_0x4bee15['origtransfereruniqueid']]=this['channels'][_0x4bee15[_0x6fdc('0xaf')]];this[_0x6fdc('0x1a')][_0x4bee15[_0x6fdc('0xaf')]]=_0x36f713;}}if((this['channels'][_0x4bee15['origtransfereruniqueid']]||this['channels'][_0x4bee15['origtransfererlinkedid']])&&this[_0x6fdc('0x1a')][_0x4bee15['secondtransfereruniqueid']]){var _0xa71676=_['some']([this[_0x6fdc('0x1a')][_0x4bee15['origtransfereruniqueid']],this[_0x6fdc('0x1a')][_0x4bee15['origtransfererlinkedid']],this[_0x6fdc('0x1a')][_0x4bee15['secondtransfereruniqueid']]],function(_0x21110c){return _0x21110c&&_0x21110c[_0x6fdc('0x87')]==='outbound'&&_0x21110c[_0x6fdc('0xb2')];});if(_0xa71676){if(this[_0x6fdc('0x1a')][_0x4bee15[_0x6fdc('0xb1')]])this[_0x6fdc('0x1a')][_0x4bee15['origtransfereruniqueid']][_0x6fdc('0x9c')]='ATTENDED';if(this[_0x6fdc('0x1a')][_0x4bee15[_0x6fdc('0xb3')]])this[_0x6fdc('0x1a')][_0x4bee15[_0x6fdc('0xb3')]][_0x6fdc('0x9c')]=_0x6fdc('0xb4');this[_0x6fdc('0x1a')][_0x4bee15[_0x6fdc('0xb5')]][_0x6fdc('0x9c')]=_0x6fdc('0xb4');}}}}catch(_0x2f643c){logger[_0x6fdc('0x2e')](_0x6fdc('0xb6'),_0x4bee15['uniqueid'],util['inspect'](_0x2f643c,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x6fdc('0x31')][_0x6fdc('0xb7')]=function(_0x444d66){try{if(this[_0x6fdc('0x32')](_0x444d66)){logger['info'](_0x6fdc('0xb8'),_0x444d66[_0x6fdc('0x37')],_0x444d66[_0x6fdc('0xb9')],_0x444d66[_0x6fdc('0xba')]);logger[_0x6fdc('0x53')](_0x6fdc('0xbb'),_0x444d66[_0x6fdc('0x37')],util['inspect'](_0x444d66,{'showHidden':![],'depth':null}));if(this[_0x6fdc('0x1a')][_0x444d66[_0x6fdc('0xad')]]){this[_0x6fdc('0x1a')][_0x444d66[_0x6fdc('0xad')]][_0x6fdc('0xae')]=_0x444d66[_0x6fdc('0xb9')];this['channels'][_0x444d66[_0x6fdc('0xad')]][_0x6fdc('0xb0')]=_0x444d66[_0x6fdc('0xba')];this[_0x6fdc('0x1a')][_0x444d66[_0x6fdc('0xad')]]['transferType']=_0x6fdc('0xbc');this[_0x6fdc('0x93')]({'event':'BlindTransfer','uniqueid':_0x444d66[_0x6fdc('0xad')],'context':_0x444d66[_0x6fdc('0x3d')],'channel':_0x444d66['transfererchannel']});}else{this['channels'][_0x444d66[_0x6fdc('0xbd')]][_0x6fdc('0x9c')]=_0x6fdc('0xbc');}}}catch(_0x2dfe9b){logger['error'](_0x6fdc('0xbe'),_0x444d66[_0x6fdc('0x37')],util['inspect'](_0x2dfe9b,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x6fdc('0x31')][_0x6fdc('0x28')]=function(_0x16a2df){try{if(this[_0x6fdc('0x32')](_0x16a2df)){logger[_0x6fdc('0x53')](_0x6fdc('0xbf'),_0x16a2df[_0x6fdc('0x37')],util['inspect'](_0x16a2df,{'showHidden':![],'depth':null}));if(this[_0x6fdc('0x1a')][_0x16a2df[_0x6fdc('0x37')]]){if(!_[_0x6fdc('0xc0')](this['channels'][_0x16a2df[_0x6fdc('0x37')]]['answertime'])){this[_0x6fdc('0x1a')][_0x16a2df[_0x6fdc('0x37')]][_0x6fdc('0xc1')]=moment()[_0x6fdc('0x4c')]('YYYY-MM-DD\x20HH:mm:ss');logger[_0x6fdc('0x2b')](_0x6fdc('0xc2'),_0x16a2df[_0x6fdc('0x37')],this[_0x6fdc('0x1a')][_0x16a2df[_0x6fdc('0x37')]]['mohstarttime']);}}}}catch(_0x3461d4){logger[_0x6fdc('0x2e')](_0x6fdc('0xc3'),_0x16a2df[_0x6fdc('0x37')],util['inspect'](_0x3461d4,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x6fdc('0x31')][_0x6fdc('0x2a')]=function(_0xa2e07b){try{if(this['isNotNull'](_0xa2e07b)){logger[_0x6fdc('0x53')](_0x6fdc('0xc4'),_0xa2e07b[_0x6fdc('0x37')],util[_0x6fdc('0x30')](_0xa2e07b,{'showHidden':![],'depth':null}));if(this[_0x6fdc('0x1a')][_0xa2e07b['uniqueid']]){if(!_['isNil'](this['channels'][_0xa2e07b['uniqueid']]['mohstarttime'])){this[_0x6fdc('0x1a')][_0xa2e07b['uniqueid']][_0x6fdc('0xc5')]+=moment()['milliseconds'](0x0)[_0x6fdc('0x6c')](this[_0x6fdc('0x1a')][_0xa2e07b[_0x6fdc('0x37')]][_0x6fdc('0xc1')],_0x6fdc('0x60'));logger[_0x6fdc('0x2b')](_0x6fdc('0xc6'),_0xa2e07b['uniqueid'],this['channels'][_0xa2e07b[_0x6fdc('0x37')]][_0x6fdc('0xc5')]);delete this[_0x6fdc('0x1a')][_0xa2e07b[_0x6fdc('0x37')]]['mohstarttime'];}}}}catch(_0x22ba9e){logger['error'](_0x6fdc('0xc7'),_0xa2e07b[_0x6fdc('0x37')],util['inspect'](_0x22ba9e,{'showHidden':![],'depth':null}));}};module[_0x6fdc('0xc8')]=VoiceCallReport; \ No newline at end of file +var _0x4f4d=['blindTransfers','custom:voiceCallReport','[%s][voiceCallReport][hangup]','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','origtransferercalleridnum','transfertargetcalleridnum','transfereeuniqueid','transfercalleridnum','transferconnectedlinenum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','origtransfererlinkedid','some','ATTENDED','[%s][voiceCallReport][attendedtransfer]','syncBlindTransfer','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereecalleridnum','extension','BLIND','syncHangup','transfererchannel','transfereruniqueid','[%s][voiceCallReport][blindtransfer]','[%s][voiceCallReport][musiconholdstart]\x20event:','isNil','mohstarttime','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','milliseconds','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','[%s][voiceCallReport][musiconholdstop]','bluebird','lodash','moment','util','path','ioredis','../../../config/environment','../../../config/logger','ami','../ami','../rpc/setting','not_inuse','inuse','busy','invalid','unavailable','ringing','ringinuse','onhold','set','queue','agi','dial','playback','voicemail','NO\x20ANSWER','FAILED','BUSY','defaults','redis','localhost','socket.io-emitter','channels','agents','coreshowchannel','syncNewExten','bind','newexten','newchannel','newstate','syncNewState','varset','syncVarSet','syncNewCallerId','attendedtransfer','syncAttendedTransfer','blindtransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','info','[voiceCallReport][coreshowchannels]\x20started','actionCoreShowChannels','error','[voiceCallReport][coreshowchannels]','inspect','isNotNull','isUndefined','prototype','calleridname','[%s][voiceCallReport][newcallerid]\x20event:','uniqueid','merge','pick','keys','context','from-sip','split','exten','xcally-motion-preview','channel','destconnectedlinenum','connectedlinenum','emit','format','user:%s','name','[%s][voiceCallReport][newcallerid]','debug','[%s][voiceCallReport][newchannel]\x20event:','linkedid','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','starttime','toNumber','channelstate','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','user:agentconnect','[%s][voiceCallReport][newexten]\x20event:','application','toLowerCase','applicationdata','appdata','CDR(routeAlias)','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','duration','subtract','seconds','YYYY-MM-DD\x20HH:mm:ss','disposition','includes','lastdata','startsWith','cdr(','[%s][voiceCallReport][newexten]','calleridnum','answertime','holdtime','diff','connectedlinename','destinationchannel','UserId','membername','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','accountcode','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','endsWith','.wav49','monitorFilename','find','monitors','push','rec','[%s][voiceCallReport][varset]\x20event:','variable','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','xmd-phone','value','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','type','xmd-queue','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','originatecalleridnum','xmd-destination','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','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','sipcalllinkedid','[%s][voiceCallReport][hangup]\x20event:','[%s][voiceCallReport][hangup]\x20reason:%s','endtime','billableseconds','omit','user:agentcomplete','resolve','then','transferType','isEmpty','getSettings','stopRecordingOnTransfer','Action','StopMixMonitor','catch','webbar:stopmonitors','BlindTransfer','outbound'];(function(_0x17f63b,_0x510722){var _0x363418=function(_0x200f2c){while(--_0x200f2c){_0x17f63b['push'](_0x17f63b['shift']());}};_0x363418(++_0x510722);}(_0x4f4d,0xf3));var _0xd4f4=function(_0x4c12c1,_0x41926c){_0x4c12c1=_0x4c12c1-0x0;var _0x40bc9d=_0x4f4d[_0x4c12c1];return _0x40bc9d;};'use strict';var BPromise=require(_0xd4f4('0x0'));var _=require(_0xd4f4('0x1'));var moment=require(_0xd4f4('0x2'));var util=require(_0xd4f4('0x3'));var path=require(_0xd4f4('0x4'));var Redis=require(_0xd4f4('0x5'));var config=require(_0xd4f4('0x6'));var logger=require(_0xd4f4('0x7'))(_0xd4f4('0x8'));var ami=require(_0xd4f4('0x9'));var Channel=require('../model/channel');var RpcSetting=require(_0xd4f4('0xa'));var statusDesc=['unknown',_0xd4f4('0xb'),_0xd4f4('0xc'),_0xd4f4('0xd'),_0xd4f4('0xe'),_0xd4f4('0xf'),_0xd4f4('0x10'),_0xd4f4('0x11'),_0xd4f4('0x12')];var applications=[_0xd4f4('0x13'),_0xd4f4('0x14'),_0xd4f4('0x15'),_0xd4f4('0x16'),_0xd4f4('0x17'),_0xd4f4('0x18')];var dispositions=[_0xd4f4('0x19'),'FAILED',_0xd4f4('0x1a'),_0xd4f4('0x19'),'NO\x20ANSWER','NO\x20ANSWER','ANSWERED',_0xd4f4('0x1b'),'FAILED',_0xd4f4('0x1a'),_0xd4f4('0x1a')];var actions={};config['redis']=_[_0xd4f4('0x1c')](config[_0xd4f4('0x1d')],{'host':_0xd4f4('0x1e'),'port':0x18eb});var io=require(_0xd4f4('0x1f'))(new Redis(config['redis']));function VoiceCallReport(_0x339d30){this[_0xd4f4('0x20')]=_0x339d30[_0xd4f4('0x20')];this['agents']=_0x339d30[_0xd4f4('0x21')];this['blindTransfers']={};ami['on'](_0xd4f4('0x22'),this[_0xd4f4('0x23')][_0xd4f4('0x24')](this));ami['on'](_0xd4f4('0x25'),this['syncNewExten'][_0xd4f4('0x24')](this));ami['on'](_0xd4f4('0x26'),this['syncNewChannel'][_0xd4f4('0x24')](this));ami['on'](_0xd4f4('0x27'),this[_0xd4f4('0x28')]['bind'](this));ami['on'](_0xd4f4('0x29'),this[_0xd4f4('0x2a')][_0xd4f4('0x24')](this));ami['on']('hangup',this['syncHangup'][_0xd4f4('0x24')](this));ami['on']('newcallerid',this[_0xd4f4('0x2b')]['bind'](this));ami['on'](_0xd4f4('0x2c'),this[_0xd4f4('0x2d')]['bind'](this));ami['on'](_0xd4f4('0x2e'),this['syncBlindTransfer'][_0xd4f4('0x24')](this));ami['on'](_0xd4f4('0x2f'),this[_0xd4f4('0x30')][_0xd4f4('0x24')](this));ami['on'](_0xd4f4('0x31'),this[_0xd4f4('0x32')][_0xd4f4('0x24')](this));try{logger[_0xd4f4('0x33')](_0xd4f4('0x34'));ami[_0xd4f4('0x35')]();}catch(_0x5011eb){logger[_0xd4f4('0x36')](_0xd4f4('0x37'),util[_0xd4f4('0x38')](_0x5011eb,{'showHidden':![],'depth':null}));}}VoiceCallReport['prototype'][_0xd4f4('0x39')]=function(_0x57c05){return _0x57c05!==null&&!_[_0xd4f4('0x3a')](_0x57c05);};VoiceCallReport[_0xd4f4('0x3b')]['emit']=function(_0x3f97f5,_0xd8b1a7,_0x4cf7dd){io['to'](_0x3f97f5)['emit'](_0xd8b1a7,_0x4cf7dd);};VoiceCallReport[_0xd4f4('0x3b')][_0xd4f4('0x2b')]=function(_0x567e5b){try{if(this[_0xd4f4('0x39')](_0x567e5b)){logger['info']('[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s',_0x567e5b['uniqueid'],_0x567e5b[_0xd4f4('0x3c')],_0x567e5b['calleridnum']);logger['debug'](_0xd4f4('0x3d'),_0x567e5b[_0xd4f4('0x3e')],util[_0xd4f4('0x38')](_0x567e5b,{'showHidden':![],'depth':null}));if(_0x567e5b[_0xd4f4('0x3e')]===_0x567e5b['linkedid']){if(!_[_0xd4f4('0x3a')](this[_0xd4f4('0x20')][_0x567e5b[_0xd4f4('0x3e')]])){_[_0xd4f4('0x3f')](this[_0xd4f4('0x20')][_0x567e5b[_0xd4f4('0x3e')]],_[_0xd4f4('0x40')](_0x567e5b,_[_0xd4f4('0x41')](this[_0xd4f4('0x20')][_0x567e5b[_0xd4f4('0x3e')]])));}}if(_0x567e5b[_0xd4f4('0x42')]===_0xd4f4('0x43')){if(this[_0xd4f4('0x21')][_0x567e5b['channel'][_0xd4f4('0x44')]('-')[0x0]]){if(_0x567e5b[_0xd4f4('0x45')]==_0xd4f4('0x46')){this[_0xd4f4('0x21')][_0x567e5b[_0xd4f4('0x47')]['split']('-')[0x0]][_0xd4f4('0x48')]=_0x567e5b[_0xd4f4('0x49')];this[_0xd4f4('0x4a')](util[_0xd4f4('0x4b')](_0xd4f4('0x4c'),this[_0xd4f4('0x21')][_0x567e5b[_0xd4f4('0x47')][_0xd4f4('0x44')]('-')[0x0]][_0xd4f4('0x4d')]),'user:agentconnect',{'destaccountcode':this[_0xd4f4('0x21')][_0x567e5b[_0xd4f4('0x47')][_0xd4f4('0x44')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x567e5b[_0xd4f4('0x49')]});}}}}}catch(_0x2475e0){logger['error'](_0xd4f4('0x4e'),_0x567e5b[_0xd4f4('0x3e')],util[_0xd4f4('0x38')](_0x2475e0,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xd4f4('0x3b')]['syncNewChannel']=function(_0x1a395c){try{if(this[_0xd4f4('0x39')](_0x1a395c)){logger[_0xd4f4('0x4f')](_0xd4f4('0x50'),_0x1a395c[_0xd4f4('0x3e')],util[_0xd4f4('0x38')](_0x1a395c,{'showHidden':![],'depth':null}));if(_0x1a395c['uniqueid']===_0x1a395c[_0xd4f4('0x51')]&&_0x1a395c[_0xd4f4('0x47')]!=_0xd4f4('0x52')){if(_[_0xd4f4('0x3a')](this[_0xd4f4('0x20')][_0x1a395c[_0xd4f4('0x3e')]])){logger[_0xd4f4('0x33')](_0xd4f4('0x53'),_0x1a395c[_0xd4f4('0x3e')],_0x1a395c[_0xd4f4('0x42')],_0x1a395c[_0xd4f4('0x45')]);this[_0xd4f4('0x20')][_0x1a395c['uniqueid']]=new Channel();this[_0xd4f4('0x20')][_0x1a395c[_0xd4f4('0x3e')]][_0xd4f4('0x54')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0xd4f4('0x20')][_0x1a395c[_0xd4f4('0x3e')]]['disposition']=dispositions[_[_0xd4f4('0x55')](_0x1a395c[_0xd4f4('0x56')])];_[_0xd4f4('0x3f')](this[_0xd4f4('0x20')][_0x1a395c[_0xd4f4('0x3e')]],_[_0xd4f4('0x40')](_0x1a395c,_[_0xd4f4('0x41')](this['channels'][_0x1a395c[_0xd4f4('0x3e')]])));if(_0x1a395c[_0xd4f4('0x42')]==='from-sip'){if(this[_0xd4f4('0x21')][_0x1a395c[_0xd4f4('0x47')][_0xd4f4('0x44')]('-')[0x0]]){if(_['isUndefined'](this[_0xd4f4('0x21')][_0x1a395c[_0xd4f4('0x47')][_0xd4f4('0x44')]('-')[0x0]][_0xd4f4('0x48')])){this[_0xd4f4('0x21')][_0x1a395c[_0xd4f4('0x47')]['split']('-')[0x0]][_0xd4f4('0x48')]=_0x1a395c[_0xd4f4('0x45')];logger[_0xd4f4('0x4f')](_0xd4f4('0x57'),_0x1a395c[_0xd4f4('0x3e')],util[_0xd4f4('0x38')]({'destaccountcode':this[_0xd4f4('0x21')][_0x1a395c[_0xd4f4('0x47')]['split']('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x1a395c[_0xd4f4('0x45')]},{'showHidden':![],'depth':null}));this['emit'](util[_0xd4f4('0x4b')](_0xd4f4('0x4c'),this[_0xd4f4('0x21')][_0x1a395c[_0xd4f4('0x47')][_0xd4f4('0x44')]('-')[0x0]][_0xd4f4('0x4d')]),_0xd4f4('0x58'),{'destaccountcode':this['agents'][_0x1a395c['channel'][_0xd4f4('0x44')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x1a395c['exten']});}}}}}}}catch(_0x480919){logger[_0xd4f4('0x36')]('[%s][voiceCallReport][newchannel]',_0x1a395c[_0xd4f4('0x3e')],util['inspect'](_0x480919,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xd4f4('0x23')]=function(_0x5048d9){try{if(this[_0xd4f4('0x39')](_0x5048d9)){logger[_0xd4f4('0x4f')](_0xd4f4('0x59'),_0x5048d9['uniqueid'],util[_0xd4f4('0x38')](_0x5048d9,{'showHidden':![],'depth':null}));if(_0x5048d9['uniqueid']===_0x5048d9[_0xd4f4('0x51')]&&_0x5048d9[_0xd4f4('0x45')]!='h'&&_0x5048d9[_0xd4f4('0x47')]!=_0xd4f4('0x52')){_0x5048d9[_0xd4f4('0x5a')]=_0x5048d9[_0xd4f4('0x5a')][_0xd4f4('0x5b')]();_0x5048d9[_0xd4f4('0x5c')]=_0x5048d9[_0xd4f4('0x5d')]&&_0x5048d9[_0xd4f4('0x5d')]['startsWith'](_0xd4f4('0x5e'))?_0x5048d9[_0xd4f4('0x5d')]:(_0x5048d9['appdata']||_0x5048d9['applicationdata'])[_0xd4f4('0x5b')]();logger[_0xd4f4('0x33')](_0xd4f4('0x5f'),_0x5048d9[_0xd4f4('0x3e')],_0x5048d9['application'],_0x5048d9['applicationdata']);if(_[_0xd4f4('0x3a')](this['channels'][_0x5048d9[_0xd4f4('0x3e')]])){this['channels'][_0x5048d9[_0xd4f4('0x3e')]]=new Channel();this['channels'][_0x5048d9[_0xd4f4('0x3e')]][_0xd4f4('0x54')]=_0x5048d9[_0xd4f4('0x60')]?moment()[_0xd4f4('0x61')](moment[_0xd4f4('0x60')](_0x5048d9['duration'])[_0xd4f4('0x62')](),_0xd4f4('0x62'))[_0xd4f4('0x4b')]('YYYY-MM-DD\x20HH:mm:ss'):moment()['format'](_0xd4f4('0x63'));this[_0xd4f4('0x20')][_0x5048d9[_0xd4f4('0x3e')]][_0xd4f4('0x64')]=_0xd4f4('0x19');}_[_0xd4f4('0x3f')](this['channels'][_0x5048d9[_0xd4f4('0x3e')]],_[_0xd4f4('0x40')](_0x5048d9,_[_0xd4f4('0x41')](this[_0xd4f4('0x20')][_0x5048d9['uniqueid']])));if(_[_0xd4f4('0x65')](applications,_0x5048d9[_0xd4f4('0x5a')])){this[_0xd4f4('0x20')][_0x5048d9[_0xd4f4('0x3e')]]['lastapplication']=_0x5048d9[_0xd4f4('0x5a')];this[_0xd4f4('0x20')][_0x5048d9[_0xd4f4('0x3e')]][_0xd4f4('0x66')]=_0x5048d9['applicationdata'];if(_0x5048d9[_0xd4f4('0x5a')]==='set'&&_[_0xd4f4('0x67')](_0x5048d9[_0xd4f4('0x5c')][_0xd4f4('0x5b')](),_0xd4f4('0x68'))){var _0x53b5cd=_0x5048d9[_0xd4f4('0x5c')][_0xd4f4('0x44')]('=');var _0x5be8d7=_0x53b5cd[0x0][_0xd4f4('0x5b')]()['match'](/cdr\((.*)\)/);if(_0x5be8d7){this['channels'][_0x5048d9[_0xd4f4('0x3e')]][_0x5be8d7[0x1]]=_0x53b5cd[0x1];}}else if(_0x5048d9[_0xd4f4('0x5a')]===_0xd4f4('0x14')){this[_0xd4f4('0x20')][_0x5048d9[_0xd4f4('0x3e')]][_0xd4f4('0x14')]=_0x5048d9['applicationdata'][_0xd4f4('0x44')](',')[0x0];}}}}}catch(_0x1f6d55){logger[_0xd4f4('0x36')](_0xd4f4('0x69'),_0x5048d9[_0xd4f4('0x3e')],util[_0xd4f4('0x38')](_0x1f6d55,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xd4f4('0x3b')][_0xd4f4('0x28')]=function(_0x51fcee){try{if(this[_0xd4f4('0x39')](_0x51fcee)){logger['info']('[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s',_0x51fcee[_0xd4f4('0x3e')],_0x51fcee[_0xd4f4('0x51')],_0x51fcee[_0xd4f4('0x3c')],_0x51fcee[_0xd4f4('0x6a')]);logger['debug']('[%s][voiceCallReport][newstate]\x20event:',_0x51fcee['uniqueid'],util[_0xd4f4('0x38')](_0x51fcee,{'showHidden':![],'depth':null}));if(_0x51fcee[_0xd4f4('0x3e')]!==_0x51fcee[_0xd4f4('0x51')]){if(this[_0xd4f4('0x20')][_0x51fcee[_0xd4f4('0x51')]]){if(_0x51fcee[_0xd4f4('0x56')]==='6'){if(!this[_0xd4f4('0x20')][_0x51fcee[_0xd4f4('0x51')]]['answered']){var _0x31aca2=moment();this[_0xd4f4('0x20')][_0x51fcee['linkedid']]['answered']=!![];this[_0xd4f4('0x20')][_0x51fcee[_0xd4f4('0x51')]][_0xd4f4('0x6b')]=_0x31aca2['format']('YYYY-MM-DD\x20HH:mm:ss');if(this['channels'][_0x51fcee[_0xd4f4('0x51')]][_0xd4f4('0x54')]){this[_0xd4f4('0x20')][_0x51fcee[_0xd4f4('0x51')]][_0xd4f4('0x6c')]=_0x31aca2[_0xd4f4('0x6d')](this['channels'][_0x51fcee[_0xd4f4('0x51')]]['starttime'],_0xd4f4('0x62'));}}this[_0xd4f4('0x20')][_0x51fcee[_0xd4f4('0x51')]][_0xd4f4('0x51')]=_0x51fcee['uniqueid'];if(_0x51fcee['calleridnum']!==_0xd4f4('0x46')){this[_0xd4f4('0x20')][_0x51fcee[_0xd4f4('0x51')]][_0xd4f4('0x49')]=_0x51fcee[_0xd4f4('0x6a')];}this[_0xd4f4('0x20')][_0x51fcee[_0xd4f4('0x51')]][_0xd4f4('0x6e')]=_0x51fcee['calleridname'];this[_0xd4f4('0x20')][_0x51fcee[_0xd4f4('0x51')]][_0xd4f4('0x6f')]=_0x51fcee[_0xd4f4('0x47')];this[_0xd4f4('0x20')][_0x51fcee[_0xd4f4('0x51')]][_0xd4f4('0x64')]=dispositions[_[_0xd4f4('0x55')](_0x51fcee[_0xd4f4('0x56')])];if(this[_0xd4f4('0x21')][_0x51fcee[_0xd4f4('0x47')][_0xd4f4('0x44')]('-')[0x0]]){this['channels'][_0x51fcee[_0xd4f4('0x51')]][_0xd4f4('0x70')]=this[_0xd4f4('0x21')][_0x51fcee['channel'][_0xd4f4('0x44')]('-')[0x0]]['id'];this[_0xd4f4('0x20')][_0x51fcee[_0xd4f4('0x51')]][_0xd4f4('0x71')]=this[_0xd4f4('0x21')][_0x51fcee[_0xd4f4('0x47')][_0xd4f4('0x44')]('-')[0x0]][_0xd4f4('0x4d')];}}}}else{if(this[_0xd4f4('0x20')][_0x51fcee['uniqueid']]){if(_0x51fcee[_0xd4f4('0x56')]==='6'){if(this['agents'][_0x51fcee[_0xd4f4('0x47')][_0xd4f4('0x44')]('-')[0x0]]){this[_0xd4f4('0x20')][_0x51fcee['uniqueid']][_0xd4f4('0x70')]=this[_0xd4f4('0x21')][_0x51fcee[_0xd4f4('0x47')][_0xd4f4('0x44')]('-')[0x0]]['id'];this[_0xd4f4('0x20')][_0x51fcee[_0xd4f4('0x3e')]][_0xd4f4('0x71')]=this[_0xd4f4('0x21')][_0x51fcee[_0xd4f4('0x47')][_0xd4f4('0x44')]('-')[0x0]][_0xd4f4('0x4d')];}}}}if(_0x51fcee[_0xd4f4('0x56')]==='6'&&_0x51fcee[_0xd4f4('0x42')]===_0xd4f4('0x43')){if(this[_0xd4f4('0x21')][_0x51fcee[_0xd4f4('0x47')][_0xd4f4('0x44')]('-')[0x0]]){this[_0xd4f4('0x21')][_0x51fcee['channel'][_0xd4f4('0x44')]('-')[0x0]]['destconnectedlinenum']=_0x51fcee['exten'];var _0x42f060;if(this[_0xd4f4('0x20')][_0x51fcee[_0xd4f4('0x3e')]])_0x42f060=this[_0xd4f4('0x20')][_0x51fcee[_0xd4f4('0x3e')]][_0xd4f4('0x72')];else if(this[_0xd4f4('0x20')][_0x51fcee[_0xd4f4('0x51')]])_0x42f060=this[_0xd4f4('0x20')][_0x51fcee[_0xd4f4('0x51')]]['routealias'];logger[_0xd4f4('0x4f')](_0xd4f4('0x73'),_0x51fcee['uniqueid'],util[_0xd4f4('0x38')]({'destaccountcode':this['agents'][_0x51fcee[_0xd4f4('0x47')][_0xd4f4('0x44')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x51fcee['exten'],'routealias':_0x42f060},{'showHidden':![],'depth':null}));this[_0xd4f4('0x4a')](util[_0xd4f4('0x4b')](_0xd4f4('0x4c'),this[_0xd4f4('0x21')][_0x51fcee[_0xd4f4('0x47')][_0xd4f4('0x44')]('-')[0x0]][_0xd4f4('0x4d')]),_0xd4f4('0x58'),{'destaccountcode':this[_0xd4f4('0x21')][_0x51fcee[_0xd4f4('0x47')][_0xd4f4('0x44')]('-')[0x0]][_0xd4f4('0x74')],'destconnectedlinenum':_0x51fcee['exten'],'routealias':_0x42f060});}}}}catch(_0x59f87b){logger[_0xd4f4('0x36')](_0xd4f4('0x75'),_0x51fcee['uniqueid'],util['inspect'](_0x59f87b,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xd4f4('0x3b')][_0xd4f4('0x76')]=function(_0x14bb47,_0xca933f){try{if(this['channels'][_0x14bb47]){logger['info'](_0xd4f4('0x77'),_0x14bb47,_0xca933f);this['channels'][_0x14bb47][_0xd4f4('0x78')]=!![];if(_[_0xd4f4('0x79')](_0xca933f,_0xd4f4('0x7a'))){_0xca933f=_0xca933f['replace'](_0xd4f4('0x7a'),'.WAV');}this[_0xd4f4('0x20')][_0x14bb47][_0xd4f4('0x7b')]=_0xca933f;var _0x88ebcc=_[_0xd4f4('0x7c')](this['channels'][_0x14bb47]['monitors'],{'filename':_0xca933f});if(_['isNil'](_0x88ebcc)){this['channels'][_0x14bb47][_0xd4f4('0x7d')][_0xd4f4('0x7e')]({'filename':_0xca933f,'createdAt':moment()[_0xd4f4('0x4b')](_0xd4f4('0x63')),'mixmonitorid':'','status':_0xd4f4('0x7f')});}}}catch(_0x3557cd){logger['error']('[%s][voiceCallReport][mixMonitorFilename]',_0x14bb47,util['inspect'](_0x3557cd,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xd4f4('0x3b')][_0xd4f4('0x2a')]=function(_0x13cdfa){try{if(this['isNotNull'](_0x13cdfa)){logger[_0xd4f4('0x4f')](_0xd4f4('0x80'),_0x13cdfa[_0xd4f4('0x3e')],util[_0xd4f4('0x38')](_0x13cdfa,{'showHidden':![],'depth':null}));if(this['channels'][_0x13cdfa[_0xd4f4('0x3e')]]&&_0x13cdfa[_0xd4f4('0x47')]!=_0xd4f4('0x52')){if(this['isNotNull'](_0x13cdfa[_0xd4f4('0x81')])){if(this[_0xd4f4('0x39')](_0x13cdfa['variable']['mixmonitor_filename'])){logger['info'](_0xd4f4('0x82'),_0x13cdfa[_0xd4f4('0x3e')],_0x13cdfa['value']);this[_0xd4f4('0x76')](_0x13cdfa['uniqueid'],_0x13cdfa['value']);}else if(this[_0xd4f4('0x39')](_0x13cdfa['variable'][_0xd4f4('0x83')])){logger[_0xd4f4('0x33')]('[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s',_0x13cdfa[_0xd4f4('0x3e')],_0x13cdfa[_0xd4f4('0x84')]);this['channels'][_0x13cdfa[_0xd4f4('0x3e')]][_0xd4f4('0x6a')]=_0x13cdfa[_0xd4f4('0x84')];}else if(this[_0xd4f4('0x39')](_0x13cdfa[_0xd4f4('0x81')][_0xd4f4('0x85')])){logger[_0xd4f4('0x33')](_0xd4f4('0x86'),_0x13cdfa['uniqueid'],_0x13cdfa[_0xd4f4('0x84')]);this['channels'][_0x13cdfa[_0xd4f4('0x3e')]]['callerid']=_0x13cdfa[_0xd4f4('0x84')];}else if(this[_0xd4f4('0x39')](_0x13cdfa['variable'][_0xd4f4('0x87')])){logger['info'](_0xd4f4('0x88'),_0x13cdfa[_0xd4f4('0x3e')],_0x13cdfa[_0xd4f4('0x84')]);this[_0xd4f4('0x20')][_0x13cdfa['uniqueid']][_0xd4f4('0x89')]=_0x13cdfa[_0xd4f4('0x84')];}else if(this[_0xd4f4('0x39')](_0x13cdfa['variable'][_0xd4f4('0x8a')])){logger[_0xd4f4('0x33')](_0xd4f4('0x8b'),_0x13cdfa['uniqueid'],_0x13cdfa[_0xd4f4('0x84')][_0xd4f4('0x44')](',')[0x0]);this['channels'][_0x13cdfa[_0xd4f4('0x3e')]]['queue']=_0x13cdfa[_0xd4f4('0x84')][_0xd4f4('0x44')](',')[0x0];}else if(this[_0xd4f4('0x39')](_0x13cdfa[_0xd4f4('0x81')]['xmd-originatecalleridnum'])){logger[_0xd4f4('0x33')](_0xd4f4('0x8c'),_0x13cdfa['uniqueid'],_0x13cdfa[_0xd4f4('0x84')]);this['channels'][_0x13cdfa[_0xd4f4('0x3e')]][_0xd4f4('0x8d')]=_0x13cdfa['value'];}else if(this[_0xd4f4('0x39')](_0x13cdfa[_0xd4f4('0x81')][_0xd4f4('0x8e')])){logger[_0xd4f4('0x33')](_0xd4f4('0x8f'),_0x13cdfa[_0xd4f4('0x3e')],_0x13cdfa[_0xd4f4('0x84')]);this[_0xd4f4('0x20')][_0x13cdfa[_0xd4f4('0x3e')]][_0xd4f4('0x90')]=_0x13cdfa[_0xd4f4('0x84')];}else if(this[_0xd4f4('0x39')](_0x13cdfa[_0xd4f4('0x81')][_0xd4f4('0x91')])){logger[_0xd4f4('0x33')](_0xd4f4('0x92'),_0x13cdfa[_0xd4f4('0x3e')],_0x13cdfa['value']);this[_0xd4f4('0x20')][_0x13cdfa[_0xd4f4('0x3e')]][_0xd4f4('0x93')]=_0x13cdfa[_0xd4f4('0x84')];}else if(this[_0xd4f4('0x39')](_0x13cdfa[_0xd4f4('0x81')][_0xd4f4('0x94')])){logger[_0xd4f4('0x33')](_0xd4f4('0x95'),_0x13cdfa[_0xd4f4('0x3e')],_0x13cdfa[_0xd4f4('0x84')]);this[_0xd4f4('0x20')][_0x13cdfa[_0xd4f4('0x3e')]][_0xd4f4('0x14')]=_0x13cdfa['value'];}else if(this[_0xd4f4('0x39')](_0x13cdfa[_0xd4f4('0x81')][_0xd4f4('0x96')])){logger[_0xd4f4('0x33')](_0xd4f4('0x97'),_0x13cdfa['uniqueid'],_0x13cdfa['value']);this[_0xd4f4('0x20')][_0x13cdfa[_0xd4f4('0x3e')]][_0xd4f4('0x98')]=_0x13cdfa[_0xd4f4('0x84')];}}}else if(this[_0xd4f4('0x39')](_0x13cdfa[_0xd4f4('0x81')][_0xd4f4('0x99')])){if(_0x13cdfa['value']){var _0x378c12=path['parse'](_0x13cdfa[_0xd4f4('0x84')])[_0xd4f4('0x4d')];logger[_0xd4f4('0x33')](_0xd4f4('0x82'),_0x378c12,_0x13cdfa[_0xd4f4('0x84')]);this[_0xd4f4('0x76')](_0x378c12,_0x13cdfa[_0xd4f4('0x84')]);}}else if(this[_0xd4f4('0x20')][_0x13cdfa[_0xd4f4('0x51')]]){if(this[_0xd4f4('0x39')](_0x13cdfa['variable'])){if(this[_0xd4f4('0x39')](_0x13cdfa[_0xd4f4('0x81')][_0xd4f4('0x96')])){logger[_0xd4f4('0x33')](_0xd4f4('0x97'),_0x13cdfa[_0xd4f4('0x51')],_0x13cdfa[_0xd4f4('0x84')]);this[_0xd4f4('0x20')][_0x13cdfa['linkedid']][_0xd4f4('0x9a')]=_0x13cdfa['value'];}}}}}catch(_0x17085d){logger[_0xd4f4('0x36')]('[%s][voiceCallReport][varset]',_0x13cdfa[_0xd4f4('0x3e')],util['inspect'](_0x17085d,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xd4f4('0x3b')]['syncHangup']=function(_0x46cced){try{if(this['isNotNull'](_0x46cced)){logger[_0xd4f4('0x4f')](_0xd4f4('0x9b'),_0x46cced[_0xd4f4('0x3e')],util['inspect'](_0x46cced,{'showHidden':![],'depth':null}));if(this[_0xd4f4('0x20')][_0x46cced[_0xd4f4('0x3e')]]){logger[_0xd4f4('0x33')](_0xd4f4('0x9c'),_0x46cced[_0xd4f4('0x3e')],_0x46cced['cause-txt']);var _0x36d66e=moment();this[_0xd4f4('0x20')][_0x46cced[_0xd4f4('0x3e')]][_0xd4f4('0x9d')]=_0x36d66e[_0xd4f4('0x4b')](_0xd4f4('0x63'));this['channels'][_0x46cced[_0xd4f4('0x3e')]][_0xd4f4('0x60')]=_0x36d66e[_0xd4f4('0x6d')](this[_0xd4f4('0x20')][_0x46cced[_0xd4f4('0x3e')]][_0xd4f4('0x54')],'seconds');if(this[_0xd4f4('0x20')][_0x46cced['uniqueid']]['answered']){this['channels'][_0x46cced[_0xd4f4('0x3e')]][_0xd4f4('0x9e')]=_0x36d66e[_0xd4f4('0x6d')](this[_0xd4f4('0x20')][_0x46cced[_0xd4f4('0x3e')]][_0xd4f4('0x6b')],_0xd4f4('0x62'));this['channels'][_0x46cced[_0xd4f4('0x3e')]]['holdtime']=this[_0xd4f4('0x20')][_0x46cced[_0xd4f4('0x3e')]][_0xd4f4('0x60')]-this['channels'][_0x46cced[_0xd4f4('0x3e')]][_0xd4f4('0x9e')];}if(_0x46cced[_0xd4f4('0x42')]===_0xd4f4('0x43')){if(this[_0xd4f4('0x21')][_0x46cced['channel'][_0xd4f4('0x44')]('-')[0x0]]){this[_0xd4f4('0x21')][_0x46cced['channel'][_0xd4f4('0x44')]('-')[0x0]]=_[_0xd4f4('0x9f')](this['agents'][_0x46cced[_0xd4f4('0x47')][_0xd4f4('0x44')]('-')[0x0]],[_0xd4f4('0x48')]);logger[_0xd4f4('0x4f')]('[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:',_0x46cced[_0xd4f4('0x3e')],util[_0xd4f4('0x38')]({'id':this[_0xd4f4('0x21')][_0x46cced[_0xd4f4('0x47')][_0xd4f4('0x44')]('-')[0x0]]['id'],'destaccountcode':this[_0xd4f4('0x21')][_0x46cced[_0xd4f4('0x47')][_0xd4f4('0x44')]('-')[0x0]][_0xd4f4('0x74')]},{'showHidden':![],'depth':null}));this[_0xd4f4('0x4a')](util[_0xd4f4('0x4b')](_0xd4f4('0x4c'),this[_0xd4f4('0x21')][_0x46cced[_0xd4f4('0x47')][_0xd4f4('0x44')]('-')[0x0]][_0xd4f4('0x4d')]),_0xd4f4('0xa0'),{'id':this[_0xd4f4('0x21')][_0x46cced['channel'][_0xd4f4('0x44')]('-')[0x0]]['id'],'destaccountcode':this[_0xd4f4('0x21')][_0x46cced[_0xd4f4('0x47')][_0xd4f4('0x44')]('-')[0x0]][_0xd4f4('0x74')]});}}var _0x5e7af2=this;Promise[_0xd4f4('0xa1')]()[_0xd4f4('0xa2')](function(){var _0x345b1f=_0x5e7af2[_0xd4f4('0x20')][_0x46cced['uniqueid']];if(typeof _0x345b1f[_0xd4f4('0xa3')]==='undefined')return;if(_[_0xd4f4('0xa4')](_0x345b1f[_0xd4f4('0x7d')]))return;return RpcSetting[_0xd4f4('0xa5')]()[_0xd4f4('0xa2')](function(_0x1a258f){if(!_0x1a258f[_0xd4f4('0xa6')])return;return Promise['resolve']()[_0xd4f4('0xa2')](function(){return ami[_0xd4f4('0xa7')]({'action':_0xd4f4('0xa8'),'channel':_0x345b1f[_0xd4f4('0x47')]})[_0xd4f4('0xa9')](function(){});})[_0xd4f4('0xa2')](function(){return ami[_0xd4f4('0xa7')]({'action':_0xd4f4('0xa8'),'channel':_0x345b1f[_0xd4f4('0x6f')]})[_0xd4f4('0xa9')](function(){})['finally'](function(){var _0x2723fc=_0x5e7af2[_0xd4f4('0x21')][_0x345b1f[_0xd4f4('0x6f')]['split']('-')[0x0]];if(!_0x2723fc)return;io[_0xd4f4('0x4a')](_0xd4f4('0xaa'),{'agentId':_0x2723fc['id'],'uniqueid':_0x345b1f['uniqueid']});});});});})[_0xd4f4('0xa2')](function(){if(_0x46cced['event']===_0xd4f4('0xab')){_0x5e7af2['blindTransfers'][_0x46cced[_0xd4f4('0x3e')]]=_0x5e7af2[_0xd4f4('0x20')][_0x46cced['uniqueid']];}else{if(_0x5e7af2[_0xd4f4('0x20')][_0x46cced['uniqueid']][_0xd4f4('0x89')]===_0xd4f4('0xac')&&_0x5e7af2[_0xd4f4('0xad')][_0x46cced[_0xd4f4('0x3e')]]){_0x5e7af2[_0xd4f4('0x20')][_0x46cced[_0xd4f4('0x3e')]][_0xd4f4('0x3e')]=[_0x5e7af2[_0xd4f4('0x20')][_0x46cced[_0xd4f4('0x3e')]][_0xd4f4('0x51')],_0x5e7af2['channels'][_0x46cced['uniqueid']][_0xd4f4('0x51')]=_0x5e7af2['channels'][_0x46cced[_0xd4f4('0x3e')]][_0xd4f4('0x3e')]][0x0];delete _0x5e7af2[_0xd4f4('0xad')][_0x46cced[_0xd4f4('0x3e')]];}}logger['debug']('[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:',_0x46cced[_0xd4f4('0x3e')],util[_0xd4f4('0x38')](_0x5e7af2[_0xd4f4('0x20')][_0x46cced[_0xd4f4('0x3e')]],{'showHidden':![],'depth':null}));ami[_0xd4f4('0x4a')](_0xd4f4('0xae'),_0x5e7af2['channels'][_0x46cced['uniqueid']]);delete _0x5e7af2[_0xd4f4('0x20')][_0x46cced[_0xd4f4('0x3e')]];});}}}catch(_0xde7bab){logger['error'](_0xd4f4('0xaf'),_0x46cced['uniqueid'],util[_0xd4f4('0x38')](_0xde7bab,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xd4f4('0x3b')][_0xd4f4('0x2d')]=function(_0x4afc59){try{if(this[_0xd4f4('0x39')](_0x4afc59)){logger[_0xd4f4('0x33')](_0xd4f4('0xb0'),_0x4afc59['uniqueid'],_0x4afc59[_0xd4f4('0xb1')],_0x4afc59[_0xd4f4('0xb2')]);logger[_0xd4f4('0x4f')]('[%s][voiceCallReport][attendedtransfer]\x20event:',_0x4afc59['uniqueid'],util['inspect'](_0x4afc59,{'showHidden':![],'depth':null}));if(this['channels'][_0x4afc59[_0xd4f4('0xb3')]]){this[_0xd4f4('0x20')][_0x4afc59['transfereeuniqueid']][_0xd4f4('0xb4')]=_0x4afc59[_0xd4f4('0xb1')];this[_0xd4f4('0x20')][_0x4afc59[_0xd4f4('0xb3')]][_0xd4f4('0xb5')]=_0x4afc59[_0xd4f4('0xb2')];if(this[_0xd4f4('0x20')][_0x4afc59[_0xd4f4('0xb6')]]){var _0x4d7a42=this[_0xd4f4('0x20')][_0x4afc59[_0xd4f4('0xb6')]];this[_0xd4f4('0x20')][_0x4afc59[_0xd4f4('0xb6')]]=this[_0xd4f4('0x20')][_0x4afc59[_0xd4f4('0xb3')]];this['channels'][_0x4afc59[_0xd4f4('0xb3')]]=_0x4d7a42;}}else if(this[_0xd4f4('0x20')][_0x4afc59[_0xd4f4('0xb7')]]){this[_0xd4f4('0x20')][_0x4afc59[_0xd4f4('0xb7')]][_0xd4f4('0xb4')]=_0x4afc59['origtransferercalleridnum'];this[_0xd4f4('0x20')][_0x4afc59[_0xd4f4('0xb7')]][_0xd4f4('0xb5')]=_0x4afc59['transfertargetcalleridnum'];if(this[_0xd4f4('0x20')][_0x4afc59[_0xd4f4('0xb8')]]){var _0x4d7a42=this[_0xd4f4('0x20')][_0x4afc59[_0xd4f4('0xb8')]];this[_0xd4f4('0x20')][_0x4afc59['origtransfereruniqueid']]=this[_0xd4f4('0x20')][_0x4afc59[_0xd4f4('0xb7')]];this[_0xd4f4('0x20')][_0x4afc59[_0xd4f4('0xb7')]]=_0x4d7a42;}}if((this[_0xd4f4('0x20')][_0x4afc59[_0xd4f4('0xb8')]]||this['channels'][_0x4afc59[_0xd4f4('0xb9')]])&&this[_0xd4f4('0x20')][_0x4afc59[_0xd4f4('0xb6')]]){var _0x1adb75=_[_0xd4f4('0xba')]([this[_0xd4f4('0x20')][_0x4afc59[_0xd4f4('0xb8')]],this[_0xd4f4('0x20')][_0x4afc59[_0xd4f4('0xb9')]],this['channels'][_0x4afc59[_0xd4f4('0xb6')]]],function(_0x1d02b3){return _0x1d02b3&&_0x1d02b3['type']===_0xd4f4('0xac')&&_0x1d02b3['routeid'];});if(_0x1adb75){if(this[_0xd4f4('0x20')][_0x4afc59[_0xd4f4('0xb8')]])this[_0xd4f4('0x20')][_0x4afc59[_0xd4f4('0xb8')]][_0xd4f4('0xa3')]=_0xd4f4('0xbb');if(this[_0xd4f4('0x20')][_0x4afc59[_0xd4f4('0xb9')]])this[_0xd4f4('0x20')][_0x4afc59[_0xd4f4('0xb9')]][_0xd4f4('0xa3')]=_0xd4f4('0xbb');this[_0xd4f4('0x20')][_0x4afc59[_0xd4f4('0xb6')]][_0xd4f4('0xa3')]=_0xd4f4('0xbb');}}}}catch(_0x88eaa0){logger[_0xd4f4('0x36')](_0xd4f4('0xbc'),_0x4afc59[_0xd4f4('0x3e')],util[_0xd4f4('0x38')](_0x88eaa0,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xd4f4('0xbd')]=function(_0x1e8147){try{if(this[_0xd4f4('0x39')](_0x1e8147)){logger['info'](_0xd4f4('0xbe'),_0x1e8147[_0xd4f4('0x3e')],_0x1e8147[_0xd4f4('0xbf')],_0x1e8147[_0xd4f4('0xc0')]);logger[_0xd4f4('0x4f')]('[%s][voiceCallReport][blindtransfer]\x20event:',_0x1e8147['uniqueid'],util[_0xd4f4('0x38')](_0x1e8147,{'showHidden':![],'depth':null}));if(this[_0xd4f4('0x20')][_0x1e8147[_0xd4f4('0xb3')]]){this[_0xd4f4('0x20')][_0x1e8147[_0xd4f4('0xb3')]][_0xd4f4('0xb4')]=_0x1e8147[_0xd4f4('0xbf')];this[_0xd4f4('0x20')][_0x1e8147['transfereeuniqueid']][_0xd4f4('0xb5')]=_0x1e8147['extension'];this[_0xd4f4('0x20')][_0x1e8147[_0xd4f4('0xb3')]]['transferType']=_0xd4f4('0xc1');this[_0xd4f4('0xc2')]({'event':_0xd4f4('0xab'),'uniqueid':_0x1e8147['transfereeuniqueid'],'context':_0x1e8147[_0xd4f4('0x42')],'channel':_0x1e8147[_0xd4f4('0xc3')]});}else{this[_0xd4f4('0x20')][_0x1e8147[_0xd4f4('0xc4')]][_0xd4f4('0xa3')]=_0xd4f4('0xc1');}}}catch(_0x52fcc9){logger[_0xd4f4('0x36')](_0xd4f4('0xc5'),_0x1e8147[_0xd4f4('0x3e')],util['inspect'](_0x52fcc9,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xd4f4('0x3b')]['syncMusicOnHoldStart']=function(_0x64ae1d){try{if(this['isNotNull'](_0x64ae1d)){logger[_0xd4f4('0x4f')](_0xd4f4('0xc6'),_0x64ae1d[_0xd4f4('0x3e')],util['inspect'](_0x64ae1d,{'showHidden':![],'depth':null}));if(this[_0xd4f4('0x20')][_0x64ae1d[_0xd4f4('0x3e')]]){if(!_[_0xd4f4('0xc7')](this[_0xd4f4('0x20')][_0x64ae1d[_0xd4f4('0x3e')]]['answertime'])){this[_0xd4f4('0x20')][_0x64ae1d[_0xd4f4('0x3e')]][_0xd4f4('0xc8')]=moment()[_0xd4f4('0x4b')](_0xd4f4('0x63'));logger[_0xd4f4('0x33')](_0xd4f4('0xc9'),_0x64ae1d[_0xd4f4('0x3e')],this[_0xd4f4('0x20')][_0x64ae1d[_0xd4f4('0x3e')]][_0xd4f4('0xc8')]);}}}}catch(_0x158311){logger[_0xd4f4('0x36')](_0xd4f4('0xca'),_0x64ae1d[_0xd4f4('0x3e')],util[_0xd4f4('0x38')](_0x158311,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xd4f4('0x3b')][_0xd4f4('0x32')]=function(_0x586ec6){try{if(this[_0xd4f4('0x39')](_0x586ec6)){logger[_0xd4f4('0x4f')](_0xd4f4('0xcb'),_0x586ec6[_0xd4f4('0x3e')],util[_0xd4f4('0x38')](_0x586ec6,{'showHidden':![],'depth':null}));if(this[_0xd4f4('0x20')][_0x586ec6[_0xd4f4('0x3e')]]){if(!_[_0xd4f4('0xc7')](this[_0xd4f4('0x20')][_0x586ec6[_0xd4f4('0x3e')]][_0xd4f4('0xc8')])){this['channels'][_0x586ec6[_0xd4f4('0x3e')]][_0xd4f4('0xcc')]+=moment()[_0xd4f4('0xcd')](0x0)['diff'](this['channels'][_0x586ec6[_0xd4f4('0x3e')]][_0xd4f4('0xc8')],'seconds');logger[_0xd4f4('0x33')](_0xd4f4('0xce'),_0x586ec6['uniqueid'],this[_0xd4f4('0x20')][_0x586ec6['uniqueid']][_0xd4f4('0xcc')]);delete this[_0xd4f4('0x20')][_0x586ec6[_0xd4f4('0x3e')]][_0xd4f4('0xc8')];}}}}catch(_0x14f335){logger['error'](_0xd4f4('0xcf'),_0x586ec6[_0xd4f4('0x3e')],util['inspect'](_0x14f335,{'showHidden':![],'depth':null}));}};module['exports']=VoiceCallReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceDialReport.js b/server/services/ami/report/voiceDialReport.js index 9ba009a..8be3766 100644 --- a/server/services/ami/report/voiceDialReport.js +++ b/server/services/ami/report/voiceDialReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4743=['privilege','info','[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called','membername','interface','[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:','inspect','merge','voice:outbound','voice_outbound_channel:save','custom:dialbegin','error','[%s][voiceDialReport][dialbegin]','[%s][voiceDialReport][dialend]\x20event:','dialstatus','ANSWER','connectedlinenum','connectedlinename','lastevent','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','substring','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','custom:dialconnect','[%s][voiceDialReport][varset]\x20event:','variable','outboundrouteid','value','voice','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','keys','[%s][voiceDialReport][varset]','addVariable','rtpaudioqos','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','isNil','includes','[%s][voiceDialReport][hangup]\x20event:','endtime','duration','diff','starttime','seconds','complete','answertime','answered','billableseconds','sumHoldTime','holdtime','sumBillable','sumDuration','[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:','custom:voiceDialReport','custom:dialend','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:','voice_outbound:save','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','linkedid','destuniqueid','[%s][voiceDialReport][hangup]','set','applicationdata','appdata','startsWith','cdr(','split','match','[%s][voiceDialReport][newexten]','exports','lodash','util','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','socket.io-emitter','outboundChannels','outbound','applications','variables','syncDialBegin','bind','dialend','syncDialEnd','varset','syncVarSet','syncNewExten','hangup','syncHangup','prototype','isUndefined','emit','isNotNull','debug','uniqueid','channels','format','YYYY-MM-DD\x20HH:mm:ss','called','channel','lastIndexOf','event'];(function(_0x865937,_0x1d5b8a){var _0xc70696=function(_0x124f2b){while(--_0x124f2b){_0x865937['push'](_0x865937['shift']());}};_0xc70696(++_0x1d5b8a);}(_0x4743,0xc7));var _0x3474=function(_0xf32c6d,_0x372704){_0xf32c6d=_0xf32c6d-0x0;var _0x156c11=_0x4743[_0xf32c6d];return _0x156c11;};'use strict';var _=require(_0x3474('0x0'));var moment=require('moment');var util=require(_0x3474('0x1'));var Redis=require('ioredis');var config=require(_0x3474('0x2'));var logger=require(_0x3474('0x3'))(_0x3474('0x4'));var ami=require(_0x3474('0x5'));config[_0x3474('0x6')]=_[_0x3474('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x3474('0x8'))(new Redis(config['redis']));function VoiceDialReport(_0x3be84c){this['channels']=_0x3be84c[_0x3474('0x9')];this[_0x3474('0xa')]=_0x3be84c['outbound'];this[_0x3474('0xb')]={};this[_0x3474('0xc')]={};ami['on']('dialbegin',this[_0x3474('0xd')][_0x3474('0xe')](this));ami['on'](_0x3474('0xf'),this[_0x3474('0x10')][_0x3474('0xe')](this));ami['on'](_0x3474('0x11'),this[_0x3474('0x12')][_0x3474('0xe')](this));ami['on']('newexten',this[_0x3474('0x13')][_0x3474('0xe')](this));ami['on'](_0x3474('0x14'),this[_0x3474('0x15')][_0x3474('0xe')](this));}VoiceDialReport[_0x3474('0x16')]['isNotNull']=function(_0x15b4bf){return _0x15b4bf!==null&&!_[_0x3474('0x17')](_0x15b4bf);};VoiceDialReport[_0x3474('0x16')]['emit']=function(_0x1414ec,_0x44124e,_0x1bf483){io['to'](_0x1414ec)[_0x3474('0x18')](_0x44124e,_0x1bf483);};VoiceDialReport[_0x3474('0x16')][_0x3474('0xd')]=function(_0x1a7447){try{if(this[_0x3474('0x19')](_0x1a7447)){logger[_0x3474('0x1a')]('[%s][voiceDialReport][dialbegin]\x20event:',_0x1a7447[_0x3474('0x1b')],util['inspect'](_0x1a7447,{'showHidden':![],'depth':null}));if(this['channels'][_0x1a7447[_0x3474('0x1b')]]){_['merge'](this[_0x3474('0x1c')][_0x1a7447['uniqueid']],{'starttime':moment()[_0x3474('0x1d')](_0x3474('0x1e')),'lastevent':_0x3474('0x1f'),'interface':_0x1a7447[_0x3474('0x20')]['substring'](0x0,_0x1a7447[_0x3474('0x20')]['lastIndexOf']('-')),'membername':_0x1a7447[_0x3474('0x20')]['substring'](_0x1a7447[_0x3474('0x20')][_0x3474('0x21')]('/')+0x1,_0x1a7447[_0x3474('0x20')]['lastIndexOf']('-'))},_['omit'](_0x1a7447,[_0x3474('0x22'),_0x3474('0x23')]));logger[_0x3474('0x24')](_0x3474('0x25'),_0x1a7447[_0x3474('0x1b')],this[_0x3474('0x1c')][_0x1a7447[_0x3474('0x1b')]][_0x3474('0x26')],this[_0x3474('0x1c')][_0x1a7447[_0x3474('0x1b')]][_0x3474('0x27')]);logger['debug'](_0x3474('0x28'),_0x1a7447[_0x3474('0x1b')],util[_0x3474('0x29')](this['channels'][_0x1a7447[_0x3474('0x1b')]],{'showHidden':![],'depth':null}));if(this[_0x3474('0xb')][_0x1a7447[_0x3474('0x1b')]])_[_0x3474('0x2a')](this[_0x3474('0x1c')][_0x1a7447[_0x3474('0x1b')]],this[_0x3474('0xb')][_0x1a7447[_0x3474('0x1b')]]);this[_0x3474('0x18')](_0x3474('0x2b'),_0x3474('0x2c'),this[_0x3474('0x1c')][_0x1a7447[_0x3474('0x1b')]]);logger[_0x3474('0x1a')]('[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:',_0x1a7447[_0x3474('0x1b')],util[_0x3474('0x29')](this[_0x3474('0x1c')][_0x1a7447['uniqueid']],{'showHidden':![],'depth':null}));ami[_0x3474('0x18')](_0x3474('0x2d'),this[_0x3474('0x1c')][_0x1a7447[_0x3474('0x1b')]]);}}}catch(_0x16f410){logger[_0x3474('0x2e')](_0x3474('0x2f'),_0x1a7447['uniqueid'],util[_0x3474('0x29')](_0x16f410,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0x3474('0x10')]=function(_0x49aa91){try{if(this[_0x3474('0x19')](_0x49aa91)){logger['debug'](_0x3474('0x30'),_0x49aa91[_0x3474('0x1b')],util[_0x3474('0x29')](_0x49aa91,{'showHidden':![],'depth':null}));if(this['channels'][_0x49aa91[_0x3474('0x1b')]]){this[_0x3474('0x1c')][_0x49aa91[_0x3474('0x1b')]]['dialstatus']=_0x49aa91['dialstatus'];if(_0x49aa91[_0x3474('0x31')]===_0x3474('0x32')){this[_0x3474('0x1c')][_0x49aa91['uniqueid']][_0x3474('0x33')]=_0x49aa91['connectedlinenum'];this[_0x3474('0x1c')][_0x49aa91[_0x3474('0x1b')]]['connectedlinename']=_0x49aa91[_0x3474('0x34')];this[_0x3474('0x1c')][_0x49aa91[_0x3474('0x1b')]]['answertime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x3474('0x1c')][_0x49aa91['uniqueid']][_0x3474('0x35')]='connect';logger[_0x3474('0x24')](_0x3474('0x36'),_0x49aa91[_0x3474('0x1b')],_0x49aa91['channel'][_0x3474('0x37')](_0x49aa91[_0x3474('0x20')][_0x3474('0x21')]('/')+0x1,_0x49aa91[_0x3474('0x20')]['lastIndexOf']('-')));logger[_0x3474('0x1a')](_0x3474('0x38'),_0x49aa91[_0x3474('0x1b')],util[_0x3474('0x29')](this[_0x3474('0x1c')][_0x49aa91[_0x3474('0x1b')]],{'showHidden':![],'depth':null}));ami['emit'](_0x3474('0x39'),this[_0x3474('0x1c')][_0x49aa91[_0x3474('0x1b')]]);}logger[_0x3474('0x1a')]('[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:',_0x49aa91['uniqueid'],util[_0x3474('0x29')](this['channels'][_0x49aa91[_0x3474('0x1b')]],{'showHidden':![],'depth':null}));this[_0x3474('0x18')](_0x3474('0x2b'),_0x3474('0x2c'),this[_0x3474('0x1c')][_0x49aa91[_0x3474('0x1b')]]);}}}catch(_0x11a9a8){logger[_0x3474('0x2e')]('[%s][voiceDialReport][dialend]',_0x49aa91[_0x3474('0x1b')],util[_0x3474('0x29')](_0x11a9a8,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x3474('0x16')][_0x3474('0x12')]=function(_0x2fe9e2){try{if(this[_0x3474('0x19')](_0x2fe9e2)){logger[_0x3474('0x1a')](_0x3474('0x3a'),_0x2fe9e2[_0x3474('0x1b')],util[_0x3474('0x29')](_0x2fe9e2,{'showHidden':![],'depth':null}));this['addVariable'](_0x2fe9e2[_0x3474('0x1b')],_['keys'](_0x2fe9e2['variable'])[0x0],_0x2fe9e2['value']);if(this[_0x3474('0x19')](_0x2fe9e2[_0x3474('0x3b')])&&this[_0x3474('0x19')](_0x2fe9e2[_0x3474('0x3b')][_0x3474('0x3c')])){if(_['isUndefined'](this[_0x3474('0x1c')][_0x2fe9e2[_0x3474('0x1b')]])){this['channels'][_0x2fe9e2[_0x3474('0x1b')]]={'routeId':_0x2fe9e2[_0x3474('0x3d')],'variables':this['variables'][_0x2fe9e2['uniqueid']],'motionChannel':_0x3474('0x3e')};logger[_0x3474('0x24')](_0x3474('0x3f'),_0x2fe9e2[_0x3474('0x1b')],_0x2fe9e2[_0x3474('0x3b')]['outboundrouteid'],_[_0x3474('0x40')](_0x2fe9e2[_0x3474('0x3b')])[0x0],_0x2fe9e2['value']);logger[_0x3474('0x1a')]('[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:',_0x2fe9e2['uniqueid'],util[_0x3474('0x29')](this[_0x3474('0x1c')][_0x2fe9e2[_0x3474('0x1b')]],{'showHidden':![],'depth':null}));this[_0x3474('0x18')](_0x3474('0x2b'),_0x3474('0x2c'),this[_0x3474('0x1c')][_0x2fe9e2['uniqueid']]);}}}}catch(_0x347c11){logger[_0x3474('0x2e')](_0x3474('0x41'),_0x2fe9e2[_0x3474('0x1b')],util[_0x3474('0x29')](_0x347c11,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x3474('0x16')][_0x3474('0x42')]=function(_0x2e4fcd,_0x4b692b,_0x1c583d){var _0x224c06=[_0x3474('0x43'),'rtpaudioqosbridged','rtpaudioqosjitter',_0x3474('0x44'),_0x3474('0x45'),_0x3474('0x46'),_0x3474('0x47'),_0x3474('0x48'),_0x3474('0x49'),_0x3474('0x4a'),_0x3474('0x4b'),_0x3474('0x4c'),_0x3474('0x4d'),_0x3474('0x4e'),_0x3474('0x4f'),_0x3474('0x50'),_0x3474('0x26'),_0x3474('0x51'),_0x3474('0x52')];if(!_[_0x3474('0x53')](_0x4b692b)&&!_[_0x3474('0x54')](_0x224c06,_0x4b692b)){if(_[_0x3474('0x17')](this['variables'][_0x2e4fcd])){this[_0x3474('0xc')][_0x2e4fcd]={};}this[_0x3474('0xc')][_0x2e4fcd][_0x4b692b]=_0x1c583d;}};VoiceDialReport[_0x3474('0x16')][_0x3474('0x15')]=function(_0x32d817){try{if(this[_0x3474('0x19')](_0x32d817)){logger[_0x3474('0x1a')](_0x3474('0x55'),_0x32d817[_0x3474('0x1b')],util[_0x3474('0x29')](_0x32d817,{'showHidden':![],'depth':null}));if(this[_0x3474('0x1c')][_0x32d817['uniqueid']]){logger[_0x3474('0x24')]('[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete',_0x32d817['uniqueid'],_0x32d817['cause-txt']);this[_0x3474('0x1c')][_0x32d817[_0x3474('0x1b')]][_0x3474('0x56')]=moment()['format'](_0x3474('0x1e'));this[_0x3474('0x1c')][_0x32d817[_0x3474('0x1b')]][_0x3474('0x57')]=moment(this[_0x3474('0x1c')][_0x32d817['uniqueid']]['endtime'])[_0x3474('0x58')](this[_0x3474('0x1c')][_0x32d817[_0x3474('0x1b')]][_0x3474('0x59')],_0x3474('0x5a'));this[_0x3474('0x1c')][_0x32d817[_0x3474('0x1b')]][_0x3474('0x35')]=_0x3474('0x5b');this[_0x3474('0xa')]['total']+=0x1;if(this[_0x3474('0x1c')][_0x32d817[_0x3474('0x1b')]][_0x3474('0x5c')]){this[_0x3474('0xa')][_0x3474('0x5d')]+=0x1;this[_0x3474('0x1c')][_0x32d817['uniqueid']]['holdtime']=moment(this[_0x3474('0x1c')][_0x32d817[_0x3474('0x1b')]]['answertime'])[_0x3474('0x58')](this[_0x3474('0x1c')][_0x32d817['uniqueid']]['starttime'],_0x3474('0x5a'));this[_0x3474('0x1c')][_0x32d817[_0x3474('0x1b')]][_0x3474('0x5e')]=moment(this[_0x3474('0x1c')][_0x32d817[_0x3474('0x1b')]][_0x3474('0x56')])[_0x3474('0x58')](this['channels'][_0x32d817[_0x3474('0x1b')]][_0x3474('0x5c')],_0x3474('0x5a'));this[_0x3474('0xa')][_0x3474('0x5f')]+=this[_0x3474('0x1c')][_0x32d817[_0x3474('0x1b')]][_0x3474('0x60')]||0x0;this[_0x3474('0xa')][_0x3474('0x61')]+=this[_0x3474('0x1c')][_0x32d817[_0x3474('0x1b')]]['billableseconds'];}this[_0x3474('0xa')][_0x3474('0x62')]+=this[_0x3474('0x1c')][_0x32d817[_0x3474('0x1b')]][_0x3474('0x57')];logger['debug'](_0x3474('0x63'),_0x32d817[_0x3474('0x1b')],util[_0x3474('0x29')](this[_0x3474('0x1c')][_0x32d817[_0x3474('0x1b')]],{'showHidden':![],'depth':null}));ami[_0x3474('0x18')](_0x3474('0x64'),this[_0x3474('0x1c')][_0x32d817[_0x3474('0x1b')]]);logger[_0x3474('0x1a')]('[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:',_0x32d817[_0x3474('0x1b')],util[_0x3474('0x29')](this[_0x3474('0x1c')][_0x32d817[_0x3474('0x1b')]],{'showHidden':![],'depth':null}));ami[_0x3474('0x18')](_0x3474('0x65'),this[_0x3474('0x1c')][_0x32d817[_0x3474('0x1b')]]);logger['debug'](_0x3474('0x66'),_0x32d817[_0x3474('0x1b')],util[_0x3474('0x29')](this['channels'][_0x32d817[_0x3474('0x1b')]],{'showHidden':![],'depth':null}));this[_0x3474('0x18')](_0x3474('0x2b'),_0x3474('0x67'),this[_0x3474('0xa')]);logger[_0x3474('0x24')](_0x3474('0x68'),JSON['stringify'](this[_0x3474('0x1c')][_0x32d817[_0x3474('0x1b')]]));logger[_0x3474('0x1a')]('[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:',_0x32d817[_0x3474('0x1b')],util['inspect'](this[_0x3474('0x1c')][_0x32d817[_0x3474('0x1b')]],{'showHidden':![],'depth':null}));this['emit'](_0x3474('0x2b'),'voice_outbound_channel:remove',this[_0x3474('0x1c')][_0x32d817[_0x3474('0x1b')]]);delete this['channels'][_0x32d817[_0x3474('0x1b')]];}else if(this[_0x3474('0x1c')][_0x32d817[_0x3474('0x69')]]){this[_0x3474('0x1c')][_0x32d817[_0x3474('0x69')]][_0x3474('0x1b')]=this['channels'][_0x32d817[_0x3474('0x69')]][_0x3474('0x6a')];}if(this[_0x3474('0xc')][_0x32d817['uniqueid']]){delete this[_0x3474('0xc')][_0x32d817[_0x3474('0x1b')]];}}}catch(_0x266060){logger['error'](_0x3474('0x6b'),_0x32d817[_0x3474('0x1b')],util[_0x3474('0x29')](_0x266060,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x3474('0x16')][_0x3474('0x13')]=function(_0x6b6a7a){try{if(this[_0x3474('0x19')](_0x6b6a7a)){logger[_0x3474('0x1a')]('[%s][voiceDialReport][newexten]\x20event:',_0x6b6a7a['uniqueid'],util[_0x3474('0x29')](_0x6b6a7a,{'showHidden':![],'depth':null}));if(_0x6b6a7a['application']['toLowerCase']()===_0x3474('0x6c')){_0x6b6a7a[_0x3474('0x6d')]=(_0x6b6a7a[_0x3474('0x6e')]||_0x6b6a7a['applicationdata'])['toLowerCase']();if(_[_0x3474('0x6f')](_0x6b6a7a['applicationdata'],_0x3474('0x70'))){if(_['isUndefined'](this[_0x3474('0xb')][_0x6b6a7a[_0x3474('0x1b')]]))this['applications'][_0x6b6a7a[_0x3474('0x1b')]]={};logger[_0x3474('0x24')]('[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s',_0x6b6a7a[_0x3474('0x1b')],_0x6b6a7a['application'],_0x6b6a7a[_0x3474('0x6d')]);var _0x5837e1=_0x6b6a7a['applicationdata'][_0x3474('0x71')]('=');var _0x5cbe65=_0x5837e1[0x0][_0x3474('0x72')](/cdr\((.*)\)/);if(_0x5cbe65)this['applications'][_0x6b6a7a[_0x3474('0x1b')]][_0x5cbe65[0x1]]=_0x5837e1[0x1];}}}}catch(_0x2af95a){logger[_0x3474('0x2e')](_0x3474('0x73'),_0x6b6a7a['uniqueid'],util[_0x3474('0x29')](_0x2af95a,{'showHidden':![],'depth':null}));}};module[_0x3474('0x74')]=VoiceDialReport; \ No newline at end of file +var _0xb417=['voice_outbound:save','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','stringify','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:','linkedid','destuniqueid','[%s][voiceDialReport][hangup]','syncNewExten','toLowerCase','set','applicationdata','appdata','startsWith','cdr(','[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s','application','split','match','exports','moment','util','ioredis','../../../config/environment','../../../config/logger','redis','defaults','socket.io-emitter','channels','outboundChannels','applications','dialbegin','syncDialBegin','dialend','syncDialEnd','bind','varset','syncVarSet','newexten','syncHangup','isUndefined','prototype','emit','isNotNull','debug','[%s][voiceDialReport][dialbegin]\x20event:','uniqueid','merge','substring','channel','lastIndexOf','omit','event','privilege','[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called','membername','interface','inspect','voice:outbound','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','[%s][voiceDialReport][dialbegin]','[%s][voiceDialReport][dialend]\x20event:','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','format','lastevent','info','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','custom:dialconnect','voice_outbound_channel:save','error','[%s][voiceDialReport][dialend]','[%s][voiceDialReport][varset]\x20event:','addVariable','keys','variable','value','outboundrouteid','voice','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:','[%s][voiceDialReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberpenalty','includes','variables','[%s][voiceDialReport][hangup]\x20event:','[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete','cause-txt','endtime','YYYY-MM-DD\x20HH:mm:ss','starttime','seconds','complete','answered','holdtime','diff','billableseconds','outbound','sumBillable','sumDuration','duration','[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:','custom:dialend'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0xb417,0x175));var _0x7b41=function(_0x13c0d2,_0x51d02b){_0x13c0d2=_0x13c0d2-0x0;var _0x386057=_0xb417[_0x13c0d2];return _0x386057;};'use strict';var _=require('lodash');var moment=require(_0x7b41('0x0'));var util=require(_0x7b41('0x1'));var Redis=require(_0x7b41('0x2'));var config=require(_0x7b41('0x3'));var logger=require(_0x7b41('0x4'))('ami');var ami=require('../ami');config[_0x7b41('0x5')]=_[_0x7b41('0x6')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x7b41('0x7'))(new Redis(config[_0x7b41('0x5')]));function VoiceDialReport(_0x48a100){this[_0x7b41('0x8')]=_0x48a100[_0x7b41('0x9')];this['outbound']=_0x48a100['outbound'];this[_0x7b41('0xa')]={};this['variables']={};ami['on'](_0x7b41('0xb'),this[_0x7b41('0xc')]['bind'](this));ami['on'](_0x7b41('0xd'),this[_0x7b41('0xe')][_0x7b41('0xf')](this));ami['on'](_0x7b41('0x10'),this[_0x7b41('0x11')][_0x7b41('0xf')](this));ami['on'](_0x7b41('0x12'),this['syncNewExten'][_0x7b41('0xf')](this));ami['on']('hangup',this[_0x7b41('0x13')][_0x7b41('0xf')](this));}VoiceDialReport['prototype']['isNotNull']=function(_0x3c45aa){return _0x3c45aa!==null&&!_[_0x7b41('0x14')](_0x3c45aa);};VoiceDialReport[_0x7b41('0x15')][_0x7b41('0x16')]=function(_0x3d9f00,_0x5de998,_0x208af7){io['to'](_0x3d9f00)['emit'](_0x5de998,_0x208af7);};VoiceDialReport['prototype']['syncDialBegin']=function(_0x392959){try{if(this[_0x7b41('0x17')](_0x392959)){logger[_0x7b41('0x18')](_0x7b41('0x19'),_0x392959[_0x7b41('0x1a')],util['inspect'](_0x392959,{'showHidden':![],'depth':null}));if(this[_0x7b41('0x8')][_0x392959[_0x7b41('0x1a')]]){_[_0x7b41('0x1b')](this[_0x7b41('0x8')][_0x392959[_0x7b41('0x1a')]],{'starttime':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':'called','interface':_0x392959['channel'][_0x7b41('0x1c')](0x0,_0x392959[_0x7b41('0x1d')][_0x7b41('0x1e')]('-')),'membername':_0x392959[_0x7b41('0x1d')][_0x7b41('0x1c')](_0x392959[_0x7b41('0x1d')][_0x7b41('0x1e')]('/')+0x1,_0x392959[_0x7b41('0x1d')][_0x7b41('0x1e')]('-'))},_[_0x7b41('0x1f')](_0x392959,[_0x7b41('0x20'),_0x7b41('0x21')]));logger['info'](_0x7b41('0x22'),_0x392959[_0x7b41('0x1a')],this['channels'][_0x392959[_0x7b41('0x1a')]][_0x7b41('0x23')],this[_0x7b41('0x8')][_0x392959[_0x7b41('0x1a')]][_0x7b41('0x24')]);logger['debug']('[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:',_0x392959['uniqueid'],util[_0x7b41('0x25')](this[_0x7b41('0x8')][_0x392959[_0x7b41('0x1a')]],{'showHidden':![],'depth':null}));if(this[_0x7b41('0xa')][_0x392959[_0x7b41('0x1a')]])_[_0x7b41('0x1b')](this['channels'][_0x392959[_0x7b41('0x1a')]],this[_0x7b41('0xa')][_0x392959[_0x7b41('0x1a')]]);this[_0x7b41('0x16')](_0x7b41('0x26'),'voice_outbound_channel:save',this[_0x7b41('0x8')][_0x392959[_0x7b41('0x1a')]]);logger['debug'](_0x7b41('0x27'),_0x392959[_0x7b41('0x1a')],util[_0x7b41('0x25')](this[_0x7b41('0x8')][_0x392959[_0x7b41('0x1a')]],{'showHidden':![],'depth':null}));ami['emit']('custom:dialbegin',this['channels'][_0x392959[_0x7b41('0x1a')]]);}}}catch(_0xed38f1){logger['error'](_0x7b41('0x28'),_0x392959['uniqueid'],util[_0x7b41('0x25')](_0xed38f1,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype']['syncDialEnd']=function(_0x54eba8){try{if(this['isNotNull'](_0x54eba8)){logger['debug'](_0x7b41('0x29'),_0x54eba8[_0x7b41('0x1a')],util[_0x7b41('0x25')](_0x54eba8,{'showHidden':![],'depth':null}));if(this[_0x7b41('0x8')][_0x54eba8[_0x7b41('0x1a')]]){this['channels'][_0x54eba8[_0x7b41('0x1a')]][_0x7b41('0x2a')]=_0x54eba8[_0x7b41('0x2a')];if(_0x54eba8[_0x7b41('0x2a')]===_0x7b41('0x2b')){this[_0x7b41('0x8')][_0x54eba8[_0x7b41('0x1a')]][_0x7b41('0x2c')]=_0x54eba8['connectedlinenum'];this[_0x7b41('0x8')][_0x54eba8[_0x7b41('0x1a')]][_0x7b41('0x2d')]=_0x54eba8[_0x7b41('0x2d')];this[_0x7b41('0x8')][_0x54eba8['uniqueid']][_0x7b41('0x2e')]=moment()[_0x7b41('0x2f')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x7b41('0x8')][_0x54eba8[_0x7b41('0x1a')]][_0x7b41('0x30')]='connect';logger[_0x7b41('0x31')](_0x7b41('0x32'),_0x54eba8[_0x7b41('0x1a')],_0x54eba8[_0x7b41('0x1d')][_0x7b41('0x1c')](_0x54eba8[_0x7b41('0x1d')][_0x7b41('0x1e')]('/')+0x1,_0x54eba8['channel'][_0x7b41('0x1e')]('-')));logger['debug'](_0x7b41('0x33'),_0x54eba8['uniqueid'],util[_0x7b41('0x25')](this[_0x7b41('0x8')][_0x54eba8[_0x7b41('0x1a')]],{'showHidden':![],'depth':null}));ami[_0x7b41('0x16')](_0x7b41('0x34'),this[_0x7b41('0x8')][_0x54eba8['uniqueid']]);}logger[_0x7b41('0x18')]('[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:',_0x54eba8[_0x7b41('0x1a')],util[_0x7b41('0x25')](this[_0x7b41('0x8')][_0x54eba8[_0x7b41('0x1a')]],{'showHidden':![],'depth':null}));this['emit'](_0x7b41('0x26'),_0x7b41('0x35'),this[_0x7b41('0x8')][_0x54eba8['uniqueid']]);}}}catch(_0x1233f5){logger[_0x7b41('0x36')](_0x7b41('0x37'),_0x54eba8[_0x7b41('0x1a')],util[_0x7b41('0x25')](_0x1233f5,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x7b41('0x15')]['syncVarSet']=function(_0x32b8a2){try{if(this[_0x7b41('0x17')](_0x32b8a2)){logger['debug'](_0x7b41('0x38'),_0x32b8a2['uniqueid'],util['inspect'](_0x32b8a2,{'showHidden':![],'depth':null}));this[_0x7b41('0x39')](_0x32b8a2['uniqueid'],_[_0x7b41('0x3a')](_0x32b8a2[_0x7b41('0x3b')])[0x0],_0x32b8a2[_0x7b41('0x3c')]);if(this[_0x7b41('0x17')](_0x32b8a2[_0x7b41('0x3b')])&&this[_0x7b41('0x17')](_0x32b8a2[_0x7b41('0x3b')][_0x7b41('0x3d')])){if(_[_0x7b41('0x14')](this[_0x7b41('0x8')][_0x32b8a2[_0x7b41('0x1a')]])){this[_0x7b41('0x8')][_0x32b8a2[_0x7b41('0x1a')]]={'routeId':_0x32b8a2['value'],'variables':this['variables'][_0x32b8a2[_0x7b41('0x1a')]],'motionChannel':_0x7b41('0x3e')};logger[_0x7b41('0x31')](_0x7b41('0x3f'),_0x32b8a2[_0x7b41('0x1a')],_0x32b8a2[_0x7b41('0x3b')][_0x7b41('0x3d')],_['keys'](_0x32b8a2['variable'])[0x0],_0x32b8a2[_0x7b41('0x3c')]);logger[_0x7b41('0x18')](_0x7b41('0x40'),_0x32b8a2[_0x7b41('0x1a')],util[_0x7b41('0x25')](this[_0x7b41('0x8')][_0x32b8a2[_0x7b41('0x1a')]],{'showHidden':![],'depth':null}));this[_0x7b41('0x16')](_0x7b41('0x26'),_0x7b41('0x35'),this[_0x7b41('0x8')][_0x32b8a2[_0x7b41('0x1a')]]);}}}}catch(_0xf5e52e){logger[_0x7b41('0x36')](_0x7b41('0x41'),_0x32b8a2[_0x7b41('0x1a')],util[_0x7b41('0x25')](_0xf5e52e,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x7b41('0x15')][_0x7b41('0x39')]=function(_0x58a998,_0x3df676,_0x32acd4){var _0x5ab798=[_0x7b41('0x42'),_0x7b41('0x43'),_0x7b41('0x44'),'rtpaudioqosjitterbridged',_0x7b41('0x45'),_0x7b41('0x46'),'rtpaudioqosrtt',_0x7b41('0x47'),'sipcallid',_0x7b41('0x48'),_0x7b41('0x49'),_0x7b41('0x4a'),_0x7b41('0x4b'),_0x7b41('0x4c'),_0x7b41('0x4d'),'memberlastcall',_0x7b41('0x23'),_0x7b41('0x4e'),'memberrealtime'];if(!_['isNil'](_0x3df676)&&!_[_0x7b41('0x4f')](_0x5ab798,_0x3df676)){if(_[_0x7b41('0x14')](this[_0x7b41('0x50')][_0x58a998])){this[_0x7b41('0x50')][_0x58a998]={};}this['variables'][_0x58a998][_0x3df676]=_0x32acd4;}};VoiceDialReport[_0x7b41('0x15')][_0x7b41('0x13')]=function(_0x11f9dd){try{if(this[_0x7b41('0x17')](_0x11f9dd)){logger[_0x7b41('0x18')](_0x7b41('0x51'),_0x11f9dd[_0x7b41('0x1a')],util[_0x7b41('0x25')](_0x11f9dd,{'showHidden':![],'depth':null}));if(this[_0x7b41('0x8')][_0x11f9dd[_0x7b41('0x1a')]]){logger[_0x7b41('0x31')](_0x7b41('0x52'),_0x11f9dd[_0x7b41('0x1a')],_0x11f9dd[_0x7b41('0x53')]);this[_0x7b41('0x8')][_0x11f9dd[_0x7b41('0x1a')]][_0x7b41('0x54')]=moment()[_0x7b41('0x2f')](_0x7b41('0x55'));this[_0x7b41('0x8')][_0x11f9dd[_0x7b41('0x1a')]]['duration']=moment(this[_0x7b41('0x8')][_0x11f9dd[_0x7b41('0x1a')]][_0x7b41('0x54')])['diff'](this[_0x7b41('0x8')][_0x11f9dd[_0x7b41('0x1a')]][_0x7b41('0x56')],_0x7b41('0x57'));this[_0x7b41('0x8')][_0x11f9dd[_0x7b41('0x1a')]][_0x7b41('0x30')]=_0x7b41('0x58');this['outbound']['total']+=0x1;if(this['channels'][_0x11f9dd[_0x7b41('0x1a')]][_0x7b41('0x2e')]){this['outbound'][_0x7b41('0x59')]+=0x1;this[_0x7b41('0x8')][_0x11f9dd[_0x7b41('0x1a')]][_0x7b41('0x5a')]=moment(this['channels'][_0x11f9dd[_0x7b41('0x1a')]][_0x7b41('0x2e')])[_0x7b41('0x5b')](this[_0x7b41('0x8')][_0x11f9dd['uniqueid']]['starttime'],_0x7b41('0x57'));this[_0x7b41('0x8')][_0x11f9dd[_0x7b41('0x1a')]][_0x7b41('0x5c')]=moment(this[_0x7b41('0x8')][_0x11f9dd[_0x7b41('0x1a')]]['endtime'])[_0x7b41('0x5b')](this['channels'][_0x11f9dd[_0x7b41('0x1a')]][_0x7b41('0x2e')],_0x7b41('0x57'));this['outbound']['sumHoldTime']+=this[_0x7b41('0x8')][_0x11f9dd['uniqueid']]['holdtime']||0x0;this[_0x7b41('0x5d')][_0x7b41('0x5e')]+=this[_0x7b41('0x8')][_0x11f9dd[_0x7b41('0x1a')]][_0x7b41('0x5c')];}this[_0x7b41('0x5d')][_0x7b41('0x5f')]+=this[_0x7b41('0x8')][_0x11f9dd[_0x7b41('0x1a')]][_0x7b41('0x60')];logger[_0x7b41('0x18')](_0x7b41('0x61'),_0x11f9dd[_0x7b41('0x1a')],util['inspect'](this[_0x7b41('0x8')][_0x11f9dd[_0x7b41('0x1a')]],{'showHidden':![],'depth':null}));ami[_0x7b41('0x16')]('custom:voiceDialReport',this[_0x7b41('0x8')][_0x11f9dd[_0x7b41('0x1a')]]);logger['debug']('[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:',_0x11f9dd[_0x7b41('0x1a')],util[_0x7b41('0x25')](this[_0x7b41('0x8')][_0x11f9dd[_0x7b41('0x1a')]],{'showHidden':![],'depth':null}));ami['emit'](_0x7b41('0x62'),this['channels'][_0x11f9dd[_0x7b41('0x1a')]]);logger['debug']('[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:',_0x11f9dd[_0x7b41('0x1a')],util[_0x7b41('0x25')](this[_0x7b41('0x8')][_0x11f9dd['uniqueid']],{'showHidden':![],'depth':null}));this[_0x7b41('0x16')]('voice:outbound',_0x7b41('0x63'),this[_0x7b41('0x5d')]);logger[_0x7b41('0x31')](_0x7b41('0x64'),JSON[_0x7b41('0x65')](this[_0x7b41('0x8')][_0x11f9dd['uniqueid']]));logger[_0x7b41('0x18')](_0x7b41('0x66'),_0x11f9dd['uniqueid'],util[_0x7b41('0x25')](this[_0x7b41('0x8')][_0x11f9dd[_0x7b41('0x1a')]],{'showHidden':![],'depth':null}));this['emit'](_0x7b41('0x26'),'voice_outbound_channel:remove',this[_0x7b41('0x8')][_0x11f9dd[_0x7b41('0x1a')]]);delete this['channels'][_0x11f9dd[_0x7b41('0x1a')]];}else if(this[_0x7b41('0x8')][_0x11f9dd[_0x7b41('0x67')]]){this[_0x7b41('0x8')][_0x11f9dd[_0x7b41('0x67')]][_0x7b41('0x1a')]=this[_0x7b41('0x8')][_0x11f9dd[_0x7b41('0x67')]][_0x7b41('0x68')];}if(this[_0x7b41('0x50')][_0x11f9dd[_0x7b41('0x1a')]]){delete this[_0x7b41('0x50')][_0x11f9dd[_0x7b41('0x1a')]];}}}catch(_0x213cc7){logger[_0x7b41('0x36')](_0x7b41('0x69'),_0x11f9dd[_0x7b41('0x1a')],util[_0x7b41('0x25')](_0x213cc7,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0x7b41('0x6a')]=function(_0x2bfa2b){try{if(this[_0x7b41('0x17')](_0x2bfa2b)){logger[_0x7b41('0x18')]('[%s][voiceDialReport][newexten]\x20event:',_0x2bfa2b[_0x7b41('0x1a')],util[_0x7b41('0x25')](_0x2bfa2b,{'showHidden':![],'depth':null}));if(_0x2bfa2b['application'][_0x7b41('0x6b')]()===_0x7b41('0x6c')){_0x2bfa2b[_0x7b41('0x6d')]=(_0x2bfa2b[_0x7b41('0x6e')]||_0x2bfa2b[_0x7b41('0x6d')])[_0x7b41('0x6b')]();if(_[_0x7b41('0x6f')](_0x2bfa2b[_0x7b41('0x6d')],_0x7b41('0x70'))){if(_[_0x7b41('0x14')](this[_0x7b41('0xa')][_0x2bfa2b[_0x7b41('0x1a')]]))this['applications'][_0x2bfa2b[_0x7b41('0x1a')]]={};logger['info'](_0x7b41('0x71'),_0x2bfa2b['uniqueid'],_0x2bfa2b[_0x7b41('0x72')],_0x2bfa2b[_0x7b41('0x6d')]);var _0xfa0960=_0x2bfa2b[_0x7b41('0x6d')][_0x7b41('0x73')]('=');var _0x3c4960=_0xfa0960[0x0][_0x7b41('0x74')](/cdr\((.*)\)/);if(_0x3c4960)this[_0x7b41('0xa')][_0x2bfa2b[_0x7b41('0x1a')]][_0x3c4960[0x1]]=_0xfa0960[0x1];}}}}catch(_0x2d740e){logger[_0x7b41('0x36')]('[%s][voiceDialReport][newexten]',_0x2bfa2b[_0x7b41('0x1a')],util[_0x7b41('0x25')](_0x2d740e,{'showHidden':![],'depth':null}));}};module[_0x7b41('0x75')]=VoiceDialReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceQueueReport.js b/server/services/ami/report/voiceQueueReport.js index 7b87123..7176e9f 100644 --- a/server/services/ami/report/voiceQueueReport.js +++ b/server/services/ami/report/voiceQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4746=['newexten','syncNewExten','musiconholdstart','syncMusicOnHoldStart','syncMusicOnHoldStop','attendedtransfer','syncBlindTransfer','loopQueueSummary','loopQueueShow','hasOwnProperty','isEmpty','originated','waiting','queueStatusComplete','unlockRR','clearZombieChannels','channels','switch','Action','status','catch','message','error','inspect','[%s][voiceQueueReport][checkQueueReport]','variables','[%s][voiceQueueReport][checkVariables]','clearQueueReport','emitVoiceQueueChannelRemove','emit','emitVoiceQueueChannelSave','debug',']\x20sending\x20voice_queue_channel:save\x20event:','uniqueid','format','voice:queue:%s','name','voice_queue_presence:save','[%s][voiceQueueReport][','voice_queue_presence:remove','emitVoiceQueueSummary','type','inbound','answered','available','pTalking','sumBillable','unmanaged','abandoned','Trunk','active','callerid','Interval','stringify','[voiceQueueReport][',']\x20sending\x20voice_queue:save\x20event:','isNotNull','queues','[voiceQueueReport][queues]','then','queue','[voiceQueueReport][queuesummary]\x20event:','info','[voiceQueueReport][queuesummary]\x20name:%s','countBy','callers','toNumber','loggedIn','talking','loggedin','custom:queuesummary','[voiceQueueReport][queuesummary]','[voiceQueueReport][queuesummarycomplete]\x20event:','isUndefined','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','routealias','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','merge','pick','keys','push','[%s][voiceQueueReport][queuecallerjoin]','queuecallercomplete','queuecallercompleteAt','originalposition','queuecallerabandon','queuecallerabandonAt','queuecallerexitreason','ABANDONED','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','[%s][voiceQueueReport][queuecallerabandon]','queuecallerleaveAt','connectedlinenum','connectedlinename','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','[%s][voiceQueueReport][queuecallerleave]','[%s][voiceQueueReport][agentconnect]','COMPLETEDBYAGENT','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','last','lastAssignedTo','membername','holdtime','queuecallerexitAt','transfer','COMPLETED','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','startsWith','channel','toLowerCase','local/','linkedid','queuecallerexit','seconds','FORWARDTRANSFER','transfertype','transferexten','destexten','COMPLETEDBY','reason','toUpperCase','[%s][voiceQueueReport][agentcomplete]','[%s][voiceQueueReport][varset]','value','variable','CONTINUE','TIMEOUT','lastevent','timeout','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','custom:timeout','queueposition','EXITWITHKEY','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','addVariable','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberrealtime','isNil','includes','[%s][voiceQueueReport][hangup]','length','sumHoldTime','diff','milliseconds','total','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s','cause-txt','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','custom:voiceQueueReport','syncAttendedTransfer','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','transferuniqueid','secondtransfereruniqueid','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','BLINDTRANSFER','BLIND','extension','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','BlindTransfer','context','transfererchannel','[%s][voiceQueueReport][blindtransfer]','[%s][voiceQueueReport][musiconholdstart]','mohstarttime','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceQueueReport][musiconholdstop]','mohtime','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','application','set','applicationdata','appdata','CDR(routeAlias)','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','[%s][voiceQueueReport][newexten]','exports','lodash','moment','md5','../../../config/environment','../../../config/logger','ami','../ami','../model/queueReport','defaults','redis','socket.io-emitter','prototype','enqueue','tail','sequence','queueReports','agents','queueChannels','voiceQueues','flagQueueSummary','queuesummary','syncQueueSummary','bind','queuesummarycomplete','syncQueueSummaryComplete','queuecallerjoin','syncQueueCallerJoin','queuecallerleave','syncQueueCallerLeave','agentcomplete','syncAgentComplete','agentconnect','syncAgentConnect','varset','syncVarSet','hangup','syncHangup','fullybooted'];(function(_0x4b73a2,_0x40b5fe){var _0x383c66=function(_0x3917ae){while(--_0x3917ae){_0x4b73a2['push'](_0x4b73a2['shift']());}};_0x383c66(++_0x40b5fe);}(_0x4746,0xc6));var _0x6474=function(_0x3c9cd3,_0x49667a){_0x3c9cd3=_0x3c9cd3-0x0;var _0x20b52e=_0x4746[_0x3c9cd3];return _0x20b52e;};'use strict';var _=require(_0x6474('0x0'));var moment=require(_0x6474('0x1'));var util=require('util');var md5=require(_0x6474('0x2'));var Redis=require('ioredis');var config=require(_0x6474('0x3'));var logger=require(_0x6474('0x4'))(_0x6474('0x5'));var ami=require(_0x6474('0x6'));var QueueReport=require(_0x6474('0x7'));config['redis']=_[_0x6474('0x8')](config[_0x6474('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x6474('0xa'))(new Redis(config[_0x6474('0x9')]));var Sequence=function(){};Sequence[_0x6474('0xb')][_0x6474('0xc')]=function(_0x15d4c2){this[_0x6474('0xd')]=this['tail']?this[_0x6474('0xd')]['finally'](_0x15d4c2):_0x15d4c2();};function VoiceQueueReport(_0x5335ac){this[_0x6474('0xe')]=new Sequence();this[_0x6474('0xf')]={};this['agents']=_0x5335ac[_0x6474('0x10')];this['channels']=_0x5335ac[_0x6474('0x11')];this['voiceQueues']=_0x5335ac[_0x6474('0x12')];this[_0x6474('0x13')]=!![];this['campaigns']=_0x5335ac['campaigns'];this['variables']={};ami['on'](_0x6474('0x14'),this[_0x6474('0x15')][_0x6474('0x16')](this));ami['on'](_0x6474('0x17'),this[_0x6474('0x18')][_0x6474('0x16')](this));ami['on'](_0x6474('0x19'),this[_0x6474('0x1a')][_0x6474('0x16')](this));ami['on']('queuecallerabandon',this['syncQueueCallerAbandon']['bind'](this));ami['on'](_0x6474('0x1b'),this[_0x6474('0x1c')][_0x6474('0x16')](this));ami['on'](_0x6474('0x1d'),this[_0x6474('0x1e')]['bind'](this));ami['on'](_0x6474('0x1f'),this[_0x6474('0x20')][_0x6474('0x16')](this));ami['on'](_0x6474('0x21'),this[_0x6474('0x22')][_0x6474('0x16')](this));ami['on'](_0x6474('0x23'),this[_0x6474('0x24')]['bind'](this));ami['on'](_0x6474('0x25'),this['syncFullyBooted'][_0x6474('0x16')](this));ami['on'](_0x6474('0x26'),this[_0x6474('0x27')][_0x6474('0x16')](this));ami['on'](_0x6474('0x28'),this[_0x6474('0x29')][_0x6474('0x16')](this));ami['on']('musiconholdstop',this[_0x6474('0x2a')]['bind'](this));ami['on'](_0x6474('0x2b'),this['syncAttendedTransfer']['bind'](this));ami['on']('blindtransfer',this[_0x6474('0x2c')][_0x6474('0x16')](this));this[_0x6474('0x2d')]();this[_0x6474('0x2e')]();}function clearChannels(_0x38b3d2){if(!_['isEmpty'](_0x38b3d2)){for(var _0x7020fb in _0x38b3d2){if(_0x38b3d2[_0x6474('0x2f')](_0x7020fb)){delete _0x38b3d2[_0x7020fb];}}}}function clearCampaigns(_0x46bf4f){if(!_[_0x6474('0x30')](_0x46bf4f)){for(var _0x559b33 in _0x46bf4f){if(_0x46bf4f['hasOwnProperty'](_0x559b33)){_0x46bf4f[_0x559b33][_0x6474('0x31')]=0x0;}}}}function clearVoiceQueues(_0x12d05f){if(!_[_0x6474('0x30')](_0x12d05f)){for(var _0x39a591 in _0x12d05f){if(_0x12d05f['hasOwnProperty'](_0x39a591)){_0x12d05f[_0x39a591]['originated']=0x0;_0x12d05f[_0x39a591]['talking']=0x0;_0x12d05f[_0x39a591]['pTalking']=0x0;_0x12d05f[_0x39a591][_0x6474('0x32')]=0x0;_0x12d05f[_0x39a591][_0x6474('0x33')]=!![];}}}}function clearAgentBooked(_0x1751bc){if(!_[_0x6474('0x30')](_0x1751bc)){for(var _0x52e64b in _0x1751bc){if(_0x1751bc[_0x6474('0x2f')](_0x52e64b)){_0x1751bc[_0x52e64b][_0x6474('0x34')]=!![];}}}}VoiceQueueReport[_0x6474('0xb')][_0x6474('0x35')]=function(){var _0x2a3ad0=this;for(var _0x443f8c in this[_0x6474('0x36')]){if(this['channels'][_0x6474('0x2f')](_0x443f8c)&&!this[_0x6474('0x36')][_0x443f8c][_0x6474('0x37')]){this[_0x6474('0xe')]['enqueue'](function(){if(!_['isNil'](_0x2a3ad0['channels'][_0x443f8c])){return ami[_0x6474('0x38')]({'action':_0x6474('0x39'),'channel':_0x2a3ad0[_0x6474('0x36')][_0x443f8c]['channel']})[_0x6474('0x3a')](function(_0x11c0ca){if(_0x11c0ca[_0x6474('0x3b')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x2a3ad0[_0x6474('0x36')][_0x443f8c]){delete _0x2a3ad0[_0x6474('0x36')][_0x443f8c];logger[_0x6474('0x3c')]('[%s][voiceQueueReport][checkChannel]',_0x443f8c,util[_0x6474('0x3d')](_0x11c0ca,{'showHidden':![],'depth':null}));}if(_0x2a3ad0[_0x6474('0xf')][_0x443f8c]){delete _0x2a3ad0['queueReports'][_0x443f8c];logger[_0x6474('0x3c')](_0x6474('0x3e'),_0x443f8c,util[_0x6474('0x3d')](_0x11c0ca,{'showHidden':![],'depth':null}));}if(_0x2a3ad0[_0x6474('0x3f')][_0x443f8c]){delete _0x2a3ad0[_0x6474('0x3f')][_0x443f8c];logger['error'](_0x6474('0x40'),_0x443f8c,util[_0x6474('0x3d')](_0x11c0ca,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport['prototype']['syncFullyBooted']=function(){logger[_0x6474('0x3c')]('[FullyBooted]\x20clear\x20realtime');clearChannels(this[_0x6474('0x36')]);this[_0x6474('0x41')](this[_0x6474('0xf')]);clearAgentBooked(this[_0x6474('0x10')]);clearVoiceQueues(this[_0x6474('0x12')]);clearCampaigns(this['campaigns']);};VoiceQueueReport['prototype'][_0x6474('0x41')]=function(_0x21f687){var _0x16df3d=this;if(!_['isEmpty'](_0x21f687)){for(var _0x2a99e8 in _0x21f687){if(_0x21f687['hasOwnProperty'](_0x2a99e8)){_0x16df3d[_0x6474('0x42')](_0x21f687[_0x2a99e8],'clearqueuereport');delete _0x21f687[_0x2a99e8];}}}};VoiceQueueReport['prototype']['emit']=function(_0x16f910,_0x12d863,_0x2879c7){io['to'](_0x16f910)[_0x6474('0x43')](_0x12d863,_0x2879c7);};VoiceQueueReport[_0x6474('0xb')][_0x6474('0x44')]=function(_0x52497f,_0x2c5534){logger[_0x6474('0x45')]('[%s][voiceQueueReport]['+_0x2c5534+_0x6474('0x46'),_0x52497f[_0x6474('0x47')],util[_0x6474('0x3d')](_0x52497f,{'showHidden':![],'depth':null}));this['emit'](util[_0x6474('0x48')](_0x6474('0x49'),_0x52497f[_0x6474('0x4a')]),'voice_queue_channel:save',_0x52497f);io['emit'](_0x6474('0x4b'),_0x52497f);};VoiceQueueReport[_0x6474('0xb')]['emitVoiceQueueChannelRemove']=function(_0x22835c,_0x44ed73){logger[_0x6474('0x45')](_0x6474('0x4c')+_0x44ed73+']\x20sending\x20voice_queue_channel:remove\x20event:',_0x22835c['uniqueid'],util[_0x6474('0x3d')](_0x22835c,{'showHidden':![],'depth':null}));this['emit'](util[_0x6474('0x48')](_0x6474('0x49'),_0x22835c[_0x6474('0x4a')]),'voice_queue_channel:remove',_0x22835c);io[_0x6474('0x43')](_0x6474('0x4d'),_0x22835c);};VoiceQueueReport['prototype'][_0x6474('0x4e')]=function(_0x30250b,_0x366344){if(_0x30250b[_0x6474('0x4f')]===_0x6474('0x50')){var _0x357486={'id':_0x30250b['id'],'name':_0x30250b[_0x6474('0x4a')],'strategy':_0x30250b['strategy'],'answered':_0x30250b[_0x6474('0x51')],'available':_0x30250b[_0x6474('0x52')],'loggedIn':_0x30250b['loggedIn'],'pTalking':_0x30250b[_0x6474('0x53')],'sumBillable':_0x30250b[_0x6474('0x54')],'sumDuration':_0x30250b['sumDuration'],'sumHoldTime':_0x30250b['sumHoldTime']||0x0,'talking':_0x30250b['talking'],'total':_0x30250b['total'],'type':_0x30250b[_0x6474('0x4f')],'unmanaged':_0x30250b[_0x6474('0x55')],'abandoned':_0x30250b[_0x6474('0x56')],'waiting':_0x30250b[_0x6474('0x32')]};if(_0x30250b['Trunk']){_0x357486[_0x6474('0x57')]={'id':_0x30250b[_0x6474('0x57')]['id'],'name':_0x30250b[_0x6474('0x57')][_0x6474('0x4a')],'active':_0x30250b[_0x6474('0x57')][_0x6474('0x58')],'callerid':_0x30250b['Trunk'][_0x6474('0x59')]};}if(_0x30250b[_0x6474('0x5a')]){_0x357486[_0x6474('0x5a')]={'id':_0x30250b['Interval']['id'],'name':_0x30250b[_0x6474('0x5a')][_0x6474('0x4a')]};}var _0x59f569=md5(JSON[_0x6474('0x5b')](_0x357486));if(_0x30250b[_0x6474('0x2')]!==_0x59f569){_0x30250b[_0x6474('0x2')]=_0x59f569;logger[_0x6474('0x45')](_0x6474('0x5c')+_0x366344+_0x6474('0x5d'),util[_0x6474('0x3d')](_0x357486,{'showHidden':![],'depth':null}));this['emit'](util[_0x6474('0x48')](_0x6474('0x49'),_0x357486[_0x6474('0x4a')]),'voice_queue:save',_0x357486);}}};VoiceQueueReport[_0x6474('0xb')][_0x6474('0x5e')]=function(_0xc13b35){return _0xc13b35!==null&&!_['isUndefined'](_0xc13b35);};VoiceQueueReport['prototype'][_0x6474('0x2e')]=function(){var _0x3cc8ad=this;setInterval(function(){_0x3cc8ad['clearZombieChannels']();ami['Action']({'action':_0x6474('0x5f')})['catch'](function(_0x9b3bc0){logger[_0x6474('0x3c')](_0x6474('0x60'),util[_0x6474('0x3d')](_0x9b3bc0,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0x6474('0xb')][_0x6474('0x2d')]=function(){var _0x2ebdce=this;setInterval(function(){if(_0x2ebdce[_0x6474('0x13')]){return ami[_0x6474('0x38')]({'action':_0x6474('0x14')})[_0x6474('0x61')](function(_0x40cf2e){_0x2ebdce[_0x6474('0x13')]=![];})['catch'](function(_0x1c10c8){logger['error']('[voiceQueueReport][queuesummary]',util[_0x6474('0x3d')](_0x1c10c8,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0x6474('0xb')][_0x6474('0x15')]=function(_0x2a79d4){try{if(this['isNotNull'](_0x2a79d4)&&this[_0x6474('0x5e')](_0x2a79d4[_0x6474('0x62')])){logger[_0x6474('0x45')](_0x6474('0x63'),util[_0x6474('0x3d')](_0x2a79d4,{'showHidden':![],'depth':null}));if(this[_0x6474('0x12')][_0x2a79d4[_0x6474('0x62')]]){logger[_0x6474('0x64')](_0x6474('0x65'),_0x2a79d4[_0x6474('0x62')]);var _0x3d50ac=_[_0x6474('0x66')](this['channels'],'queue')[_0x2a79d4[_0x6474('0x62')]]||0x0;var _0x4b4f14=_0x3d50ac-_0x2a79d4[_0x6474('0x67')];if(this[_0x6474('0x12')][_0x2a79d4[_0x6474('0x62')]][_0x6474('0x32')]!==_[_0x6474('0x68')](_0x2a79d4['callers'])||this['voiceQueues'][_0x2a79d4[_0x6474('0x62')]][_0x6474('0x69')]!==_[_0x6474('0x68')](_0x2a79d4['loggedin'])||this[_0x6474('0x12')][_0x2a79d4[_0x6474('0x62')]]['available']!==_[_0x6474('0x68')](_0x2a79d4['available'])||this[_0x6474('0x12')][_0x2a79d4[_0x6474('0x62')]][_0x6474('0x6a')]!==_0x4b4f14){this[_0x6474('0x12')][_0x2a79d4['queue']][_0x6474('0x32')]=_[_0x6474('0x68')](_0x2a79d4[_0x6474('0x67')]);this[_0x6474('0x12')][_0x2a79d4[_0x6474('0x62')]][_0x6474('0x69')]=_[_0x6474('0x68')](_0x2a79d4[_0x6474('0x6b')]);this[_0x6474('0x12')][_0x2a79d4[_0x6474('0x62')]]['available']=_[_0x6474('0x68')](_0x2a79d4['available']);this[_0x6474('0x12')][_0x2a79d4[_0x6474('0x62')]][_0x6474('0x6a')]=_0x4b4f14>0x0?_0x4b4f14:0x0;this[_0x6474('0x12')][_0x2a79d4[_0x6474('0x62')]][_0x6474('0x6a')]=this[_0x6474('0x12')][_0x2a79d4[_0x6474('0x62')]]['talking']>_[_0x6474('0x68')](_0x2a79d4['loggedin'])?_[_0x6474('0x68')](_0x2a79d4[_0x6474('0x6b')]):this[_0x6474('0x12')][_0x2a79d4['queue']]['talking'];this[_0x6474('0x4e')](this[_0x6474('0x12')][_0x2a79d4[_0x6474('0x62')]],'queuesummary');}logger[_0x6474('0x45')]('[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:',util[_0x6474('0x3d')](this['voiceQueues'][_0x2a79d4['queue']],{'showHidden':![],'depth':null}));ami['emit'](_0x6474('0x6c'),this[_0x6474('0x12')][_0x2a79d4[_0x6474('0x62')]]);}}}catch(_0x3fde0e){logger['error'](_0x6474('0x6d'),util['inspect'](_0x3fde0e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x6474('0xb')][_0x6474('0x18')]=function(_0x54e211){logger['debug'](_0x6474('0x6e'),util[_0x6474('0x3d')](_0x54e211,{'showHidden':![],'depth':null}));this[_0x6474('0x13')]=!![];};VoiceQueueReport[_0x6474('0xb')]['syncQueueCallerJoin']=function(_0x5786f1){try{if(this[_0x6474('0x5e')](_0x5786f1)){logger[_0x6474('0x45')]('[%s][voiceQueueReport][queuecallerjoin]',_0x5786f1[_0x6474('0x47')],util[_0x6474('0x3d')](_0x5786f1,{'showHidden':![],'depth':null}));if(_[_0x6474('0x6f')](this[_0x6474('0xf')][_0x5786f1[_0x6474('0x47')]]))this['queueReports'][_0x5786f1['uniqueid']]=[];if(_[_0x6474('0x6f')](this[_0x6474('0x36')][_0x5786f1['uniqueid']]))this['channels'][_0x5786f1[_0x6474('0x47')]]={};var _0x55537a=new QueueReport();_0x55537a[_0x6474('0x4a')]=_0x5786f1[_0x6474('0x62')];_0x55537a[_0x6474('0x4f')]=this[_0x6474('0x12')][_0x55537a[_0x6474('0x4a')]]&&this[_0x6474('0x12')][_0x55537a['name']][_0x6474('0x4f')]?this[_0x6474('0x12')][_0x55537a[_0x6474('0x4a')]][_0x6474('0x4f')]||_0x6474('0x50'):_0x6474('0x50');_0x55537a[_0x6474('0x62')]=_0x5786f1[_0x6474('0x62')];_0x55537a[_0x6474('0x70')]=moment()['format'](_0x6474('0x71'));_0x55537a[_0x6474('0x72')]=_0x5786f1['position'];_0x55537a[_0x6474('0x73')]=_0x5786f1[_0x6474('0x73')];_0x55537a[_0x6474('0x47')]=_0x5786f1[_0x6474('0x47')];_0x55537a[_0x6474('0x74')]=this[_0x6474('0x36')][_0x5786f1[_0x6474('0x47')]][_0x6474('0x74')];logger[_0x6474('0x64')](_0x6474('0x75'),_0x55537a[_0x6474('0x4a')],_0x55537a[_0x6474('0x4f')]);_[_0x6474('0x76')](_0x55537a,_[_0x6474('0x77')](_0x5786f1,_[_0x6474('0x78')](_0x55537a)));this[_0x6474('0xf')][_0x5786f1[_0x6474('0x47')]][_0x6474('0x79')](_0x55537a);this[_0x6474('0x36')][_0x5786f1[_0x6474('0x47')]]=_0x55537a;this['emitVoiceQueueChannelSave'](_0x55537a,_0x6474('0x19'));}}catch(_0x3f049d){logger[_0x6474('0x3c')](_0x6474('0x7a'),_0x5786f1[_0x6474('0x47')],util[_0x6474('0x3d')](_0x3f049d,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueCallerAbandon']=function(_0x3a7657){try{if(this[_0x6474('0x5e')](_0x3a7657)){logger[_0x6474('0x45')]('[%s][voiceQueueReport][queuecallerabandon]',_0x3a7657[_0x6474('0x47')],util[_0x6474('0x3d')](_0x3a7657,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x3a7657['uniqueid']]){var _0xee5d6f=_['last'](this[_0x6474('0xf')][_0x3a7657[_0x6474('0x47')]]);_0xee5d6f[_0x6474('0x7b')]=![];_0xee5d6f[_0x6474('0x7c')]=null;_0xee5d6f['holdtime']=_0x3a7657['holdtime'];_0xee5d6f[_0x6474('0x7d')]=_0x3a7657[_0x6474('0x7d')];_0xee5d6f[_0x6474('0x7e')]=!![];_0xee5d6f[_0x6474('0x7f')]=moment()[_0x6474('0x48')](_0x6474('0x71'));_0xee5d6f[_0x6474('0x80')]=_0x6474('0x81');_0xee5d6f['lastAssignedTo']=null;logger['info'](_0x6474('0x82'),_0xee5d6f[_0x6474('0x4a')],_0xee5d6f[_0x6474('0x4f')]);this[_0x6474('0x36')][_0x3a7657[_0x6474('0x47')]]=_0xee5d6f;this['emitVoiceQueueChannelRemove'](_0xee5d6f,_0x6474('0x7e'));}}}catch(_0x49116c){logger['error'](_0x6474('0x83'),_0x3a7657[_0x6474('0x47')],util[_0x6474('0x3d')](_0x49116c,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x6474('0x1c')]=function(_0x1de164){try{if(this[_0x6474('0x5e')](_0x1de164)){logger[_0x6474('0x45')]('[%s][voiceQueueReport][queuecallerleave]',_0x1de164[_0x6474('0x47')],util[_0x6474('0x3d')](_0x1de164,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x1de164[_0x6474('0x47')]]){var _0x4bce6b=_['last'](this['queueReports'][_0x1de164[_0x6474('0x47')]]);_0x4bce6b[_0x6474('0x84')]=moment()[_0x6474('0x48')](_0x6474('0x71'));_0x4bce6b[_0x6474('0x85')]=_0x1de164[_0x6474('0x85')];_0x4bce6b[_0x6474('0x86')]=_0x1de164[_0x6474('0x86')];logger[_0x6474('0x64')](_0x6474('0x87'),_0x4bce6b[_0x6474('0x4a')],_0x4bce6b['type'],_0x1de164[_0x6474('0x85')],_0x1de164[_0x6474('0x86')]);this[_0x6474('0x36')][_0x1de164['uniqueid']]=_0x4bce6b;this[_0x6474('0x44')](_0x4bce6b,_0x6474('0x1b'));}}}catch(_0x160f09){logger['error'](_0x6474('0x88'),_0x1de164['uniqueid'],util[_0x6474('0x3d')](_0x160f09,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x6474('0xb')][_0x6474('0x20')]=function(_0x3e1e5e){try{if(this[_0x6474('0x5e')](_0x3e1e5e)){logger[_0x6474('0x45')](_0x6474('0x89'),_0x3e1e5e[_0x6474('0x47')],util['inspect'](_0x3e1e5e,{'showHidden':![],'depth':null}));if(this[_0x6474('0xf')][_0x3e1e5e[_0x6474('0x47')]]){var _0x1153d4=_['last'](this[_0x6474('0xf')][_0x3e1e5e[_0x6474('0x47')]]);_0x1153d4['queuecallercomplete']=!![];_0x1153d4[_0x6474('0x80')]=_0x6474('0x8a');logger[_0x6474('0x64')](_0x6474('0x8b'),_0x1153d4[_0x6474('0x4a')],_0x1153d4['type']);}}}catch(_0x1871b5){logger['error'](_0x6474('0x89'),_0x3e1e5e[_0x6474('0x47')],util[_0x6474('0x3d')](_0x1871b5,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x6474('0x1e')]=function(_0x352e2a){try{if(this[_0x6474('0x5e')](_0x352e2a)){logger[_0x6474('0x45')]('[%s][voiceQueueReport][agentcomplete]',_0x352e2a[_0x6474('0x47')],util[_0x6474('0x3d')](_0x352e2a,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x352e2a[_0x6474('0x47')]]){var _0x53911f=_[_0x6474('0x8c')](this[_0x6474('0xf')][_0x352e2a[_0x6474('0x47')]]);_0x53911f[_0x6474('0x7e')]=![];_0x53911f[_0x6474('0x7f')]=null;_0x53911f['assigned']=!![];_0x53911f[_0x6474('0x8d')]=_0x352e2a[_0x6474('0x8e')];_0x53911f[_0x6474('0x8f')]=_0x352e2a[_0x6474('0x8f')];_0x53911f[_0x6474('0x7b')]=!![];_0x53911f['queuecallerexit']=![];_0x53911f[_0x6474('0x90')]=null;if(!_0x53911f[_0x6474('0x91')]){if(_0x352e2a['reason']==_0x6474('0x91')){_0x53911f[_0x6474('0x80')]=_0x6474('0x92');logger['info'](_0x6474('0x93'),_0x53911f[_0x6474('0x4a')],_0x53911f[_0x6474('0x4f')]);}else{if(_[_0x6474('0x94')](_0x352e2a[_0x6474('0x95')][_0x6474('0x96')](),_0x6474('0x97'))){if(this[_0x6474('0xf')][_0x352e2a[_0x6474('0x98')]]){var _0x3d8cc0=_[_0x6474('0x8c')](this['queueReports'][_0x352e2a[_0x6474('0x98')]]);_0x3d8cc0[_0x6474('0x7b')]=![];_0x3d8cc0[_0x6474('0x99')]=!![];_0x3d8cc0[_0x6474('0x90')]=moment(_0x53911f[_0x6474('0x70')])['add'](_0x352e2a[_0x6474('0x8f')],_0x6474('0x9a'))['format']('YYYY-MM-DD\x20HH:mm:ss');_0x3d8cc0['queuecallerexitreason']=_0x6474('0x9b');_0x3d8cc0['transfer']=!![];_0x3d8cc0[_0x6474('0x9c')]='FORWARD';_0x3d8cc0[_0x6474('0x9d')]=_0x352e2a[_0x6474('0x9e')];_0x3d8cc0['transferuniqueid']=_0x352e2a[_0x6474('0x47')];logger[_0x6474('0x64')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x3d8cc0[_0x6474('0x4a')],_0x3d8cc0['type']);var _0xdd8966=this[_0x6474('0xf')][_0x352e2a['linkedid']];this[_0x6474('0xf')][_0x352e2a[_0x6474('0x98')]]=this[_0x6474('0xf')][_0x352e2a['uniqueid']];this[_0x6474('0xf')][_0x352e2a[_0x6474('0x47')]]=_0xdd8966;}}else{_0x53911f['queuecallerexitreason']=_0x6474('0x9f')+_0x352e2a[_0x6474('0xa0')][_0x6474('0xa1')]();logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x53911f[_0x6474('0x4a')],_0x53911f[_0x6474('0x4f')],_0x53911f['queuecallerexitreason']);}}}this[_0x6474('0x36')][_0x352e2a[_0x6474('0x47')]]=_0x53911f;this[_0x6474('0x42')](_0x53911f,'agentcomplete');}}}catch(_0x445b85){logger[_0x6474('0x3c')](_0x6474('0xa2'),_0x352e2a['uniqueid'],util[_0x6474('0x3d')](_0x445b85,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x6474('0xb')]['syncVarSet']=function(_0x528400){try{if(this[_0x6474('0x5e')](_0x528400)){logger[_0x6474('0x45')](_0x6474('0xa3'),_0x528400['uniqueid'],util[_0x6474('0x3d')](_0x528400,{'showHidden':![],'depth':null}));this['addVariable'](_0x528400[_0x6474('0x47')],_[_0x6474('0x78')](_0x528400['variable'])[0x0],_0x528400[_0x6474('0xa4')]);if(this['queueReports'][_0x528400[_0x6474('0x47')]]){var _0x530fcb=_['last'](this[_0x6474('0xf')][_0x528400[_0x6474('0x47')]]);if(_0x530fcb){if(this[_0x6474('0x5e')](_0x528400[_0x6474('0xa5')])&&this[_0x6474('0x5e')](_0x528400['variable']['queuestatus'])){switch(_0x528400[_0x6474('0xa4')]){case _0x6474('0xa6'):_0x530fcb[_0x6474('0x99')]=![];_0x530fcb[_0x6474('0x90')]=null;break;case _0x6474('0xa7'):_0x530fcb[_0x6474('0xa8')]=_0x6474('0xa9');_0x530fcb[_0x6474('0x99')]=!![];_0x530fcb[_0x6474('0x90')]=moment()[_0x6474('0x48')]('YYYY-MM-DD\x20HH:mm:ss');_0x530fcb[_0x6474('0x84')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');logger[_0x6474('0x45')](_0x6474('0xaa'),_0x528400[_0x6474('0x47')],util[_0x6474('0x3d')](_0x530fcb,{'showHidden':![],'depth':null}));ami['emit'](_0x6474('0xab'),_0x530fcb);break;default:_0x530fcb[_0x6474('0x99')]=!![];_0x530fcb['queuecallerexitAt']=moment()[_0x6474('0x48')](_0x6474('0x71'));_0x530fcb[_0x6474('0x84')]=moment()[_0x6474('0x48')](_0x6474('0x71'));}_0x530fcb[_0x6474('0x7e')]=![];_0x530fcb[_0x6474('0x7f')]=null;_0x530fcb['queuecallerexitreason']=_0x528400[_0x6474('0xa4')];this[_0x6474('0x36')][_0x528400['uniqueid']]=_0x530fcb;this[_0x6474('0x42')](_0x530fcb,'varset');}else if(this['isNotNull'](_0x528400['variable'])&&this[_0x6474('0x5e')](_0x528400['variable'][_0x6474('0xac')])){if(!_0x530fcb[_0x6474('0x7e')]){_0x530fcb[_0x6474('0x99')]=!![];_0x530fcb['queuecallerexitAt']=moment()[_0x6474('0x48')](_0x6474('0x71'));_0x530fcb['queuecallerexitreason']=_0x6474('0xad');_0x530fcb[_0x6474('0x84')]=moment()[_0x6474('0x48')](_0x6474('0x71'));this['channels'][_0x528400[_0x6474('0x47')]]=_0x530fcb;}}logger[_0x6474('0x64')](_0x6474('0xae'),_0x528400[_0x6474('0x47')],_0x530fcb[_0x6474('0x4a')],_0x530fcb['type'],_['keys'](_0x528400[_0x6474('0xa5')])[0x0],_0x528400[_0x6474('0xa4')]);_0x530fcb[_0x6474('0x3f')]=this[_0x6474('0x3f')][_0x528400['uniqueid']];}}}}catch(_0xca8e47){logger[_0x6474('0x3c')](_0x6474('0xa3'),_0x528400[_0x6474('0x47')],util[_0x6474('0x3d')](_0xca8e47,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x6474('0xb')][_0x6474('0xaf')]=function(_0x2589f2,_0x20076c,_0x1d8cee){var _0x121389=[_0x6474('0xb0'),_0x6474('0xb1'),_0x6474('0xb2'),_0x6474('0xb3'),_0x6474('0xb4'),'rtpaudioqoslossbridged',_0x6474('0xb5'),_0x6474('0xb6'),_0x6474('0xb7'),_0x6474('0xb8'),_0x6474('0xb9'),_0x6474('0xba'),_0x6474('0xbb'),_0x6474('0xbc'),_0x6474('0xbd'),_0x6474('0xbe'),_0x6474('0x8e'),'memberpenalty',_0x6474('0xbf')];if(!_[_0x6474('0xc0')](_0x20076c)&&!_[_0x6474('0xc1')](_0x121389,_0x20076c)){if(_[_0x6474('0x6f')](this[_0x6474('0x3f')][_0x2589f2])){this[_0x6474('0x3f')][_0x2589f2]={};}this[_0x6474('0x3f')][_0x2589f2][_0x20076c]=_0x1d8cee;}};VoiceQueueReport[_0x6474('0xb')]['syncHangup']=function(_0x5df8db){try{if(this[_0x6474('0x5e')](_0x5df8db)){logger[_0x6474('0x45')](_0x6474('0xc2'),_0x5df8db['uniqueid'],util[_0x6474('0x3d')](_0x5df8db,{'showHidden':![],'depth':null}));if(this[_0x6474('0xf')][_0x5df8db[_0x6474('0x47')]]){for(var _0x20feb4=0x0,_0x13d308={};_0x20feb40x0?_0x2e978c:0x0;this[_0x2d38('0x14')][_0x1348f8[_0x2d38('0x6e')]]['talking']=this[_0x2d38('0x14')][_0x1348f8['queue']][_0x2d38('0x34')]>_[_0x2d38('0x72')](_0x1348f8['loggedin'])?_['toNumber'](_0x1348f8[_0x2d38('0x73')]):this[_0x2d38('0x14')][_0x1348f8[_0x2d38('0x6e')]][_0x2d38('0x34')];this['emitVoiceQueueSummary'](this[_0x2d38('0x14')][_0x1348f8['queue']],'queuesummary');}logger[_0x2d38('0x49')](_0x2d38('0x74'),util[_0x2d38('0x3f')](this[_0x2d38('0x14')][_0x1348f8['queue']],{'showHidden':![],'depth':null}));ami[_0x2d38('0x47')](_0x2d38('0x75'),this[_0x2d38('0x14')][_0x1348f8[_0x2d38('0x6e')]]);}}}catch(_0x55a3fe){logger['error']('[voiceQueueReport][queuesummary]',util['inspect'](_0x55a3fe,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueSummaryComplete']=function(_0x2cd7b3){logger[_0x2d38('0x49')](_0x2d38('0x76'),util[_0x2d38('0x3f')](_0x2cd7b3,{'showHidden':![],'depth':null}));this[_0x2d38('0x15')]=!![];};VoiceQueueReport['prototype'][_0x2d38('0x1d')]=function(_0x4229d7){try{if(this[_0x2d38('0x67')](_0x4229d7)){logger[_0x2d38('0x49')]('[%s][voiceQueueReport][queuecallerjoin]',_0x4229d7[_0x2d38('0x4b')],util[_0x2d38('0x3f')](_0x4229d7,{'showHidden':![],'depth':null}));if(_[_0x2d38('0x68')](this[_0x2d38('0x10')][_0x4229d7[_0x2d38('0x4b')]]))this[_0x2d38('0x10')][_0x4229d7[_0x2d38('0x4b')]]=[];if(_[_0x2d38('0x68')](this[_0x2d38('0x12')][_0x4229d7['uniqueid']]))this[_0x2d38('0x12')][_0x4229d7[_0x2d38('0x4b')]]={};var _0x266d0c=new QueueReport();_0x266d0c['name']=_0x4229d7[_0x2d38('0x6e')];_0x266d0c[_0x2d38('0x54')]=this[_0x2d38('0x14')][_0x266d0c[_0x2d38('0x4d')]]&&this[_0x2d38('0x14')][_0x266d0c[_0x2d38('0x4d')]]['type']?this[_0x2d38('0x14')][_0x266d0c[_0x2d38('0x4d')]][_0x2d38('0x54')]||_0x2d38('0x55'):_0x2d38('0x55');_0x266d0c['queue']=_0x4229d7[_0x2d38('0x6e')];_0x266d0c['queuecallerjoinAt']=moment()[_0x2d38('0x65')]('YYYY-MM-DD\x20HH:mm:ss');_0x266d0c[_0x2d38('0x77')]=_0x4229d7[_0x2d38('0x77')];_0x266d0c['count']=_0x4229d7[_0x2d38('0x78')];_0x266d0c[_0x2d38('0x4b')]=_0x4229d7[_0x2d38('0x4b')];_0x266d0c[_0x2d38('0x79')]=this[_0x2d38('0x12')][_0x4229d7[_0x2d38('0x4b')]][_0x2d38('0x79')];logger[_0x2d38('0x6f')](_0x2d38('0x7a'),_0x266d0c[_0x2d38('0x4d')],_0x266d0c[_0x2d38('0x54')]);_[_0x2d38('0x7b')](_0x266d0c,_[_0x2d38('0x7c')](_0x4229d7,_[_0x2d38('0x7d')](_0x266d0c)));this[_0x2d38('0x10')][_0x4229d7['uniqueid']][_0x2d38('0x7e')](_0x266d0c);this[_0x2d38('0x12')][_0x4229d7[_0x2d38('0x4b')]]=_0x266d0c;this[_0x2d38('0x48')](_0x266d0c,_0x2d38('0x1c'));}}catch(_0x42e905){logger[_0x2d38('0x3d')](_0x2d38('0x7f'),_0x4229d7[_0x2d38('0x4b')],util[_0x2d38('0x3f')](_0x42e905,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2d38('0xc')][_0x2d38('0x1f')]=function(_0x1412d0){try{if(this['isNotNull'](_0x1412d0)){logger[_0x2d38('0x49')](_0x2d38('0x80'),_0x1412d0[_0x2d38('0x4b')],util[_0x2d38('0x3f')](_0x1412d0,{'showHidden':![],'depth':null}));if(this[_0x2d38('0x10')][_0x1412d0[_0x2d38('0x4b')]]){var _0x45f29e=_[_0x2d38('0x81')](this[_0x2d38('0x10')][_0x1412d0[_0x2d38('0x4b')]]);_0x45f29e[_0x2d38('0x82')]=![];_0x45f29e['queuecallercompleteAt']=null;_0x45f29e['holdtime']=_0x1412d0[_0x2d38('0x83')];_0x45f29e[_0x2d38('0x84')]=_0x1412d0[_0x2d38('0x84')];_0x45f29e[_0x2d38('0x1e')]=!![];_0x45f29e[_0x2d38('0x85')]=moment()[_0x2d38('0x65')](_0x2d38('0x86'));_0x45f29e[_0x2d38('0x87')]='ABANDONED';_0x45f29e['lastAssignedTo']=null;logger['info'](_0x2d38('0x88'),_0x45f29e[_0x2d38('0x4d')],_0x45f29e[_0x2d38('0x54')]);this[_0x2d38('0x12')][_0x1412d0[_0x2d38('0x4b')]]=_0x45f29e;this[_0x2d38('0x45')](_0x45f29e,_0x2d38('0x1e'));}}}catch(_0x3e072f){logger[_0x2d38('0x3d')](_0x2d38('0x80'),_0x1412d0['uniqueid'],util[_0x2d38('0x3f')](_0x3e072f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2d38('0xc')][_0x2d38('0x21')]=function(_0x5c6526){try{if(this['isNotNull'](_0x5c6526)){logger['debug'](_0x2d38('0x89'),_0x5c6526[_0x2d38('0x4b')],util[_0x2d38('0x3f')](_0x5c6526,{'showHidden':![],'depth':null}));if(this[_0x2d38('0x10')][_0x5c6526[_0x2d38('0x4b')]]){var _0x257c00=_['last'](this['queueReports'][_0x5c6526[_0x2d38('0x4b')]]);_0x257c00[_0x2d38('0x8a')]=moment()['format'](_0x2d38('0x86'));_0x257c00[_0x2d38('0x8b')]=_0x5c6526[_0x2d38('0x8b')];_0x257c00[_0x2d38('0x8c')]=_0x5c6526[_0x2d38('0x8c')];logger['info'](_0x2d38('0x8d'),_0x257c00['name'],_0x257c00[_0x2d38('0x54')],_0x5c6526[_0x2d38('0x8b')],_0x5c6526['connectedlinename']);this[_0x2d38('0x12')][_0x5c6526[_0x2d38('0x4b')]]=_0x257c00;this[_0x2d38('0x48')](_0x257c00,_0x2d38('0x20'));}}}catch(_0x8bb6c9){logger[_0x2d38('0x3d')](_0x2d38('0x89'),_0x5c6526[_0x2d38('0x4b')],util['inspect'](_0x8bb6c9,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x2d38('0x25')]=function(_0x2f1a82){try{if(this[_0x2d38('0x67')](_0x2f1a82)){logger[_0x2d38('0x49')](_0x2d38('0x8e'),_0x2f1a82[_0x2d38('0x4b')],util[_0x2d38('0x3f')](_0x2f1a82,{'showHidden':![],'depth':null}));if(this[_0x2d38('0x10')][_0x2f1a82[_0x2d38('0x4b')]]){var _0x3293c5=_[_0x2d38('0x81')](this[_0x2d38('0x10')][_0x2f1a82['uniqueid']]);_0x3293c5[_0x2d38('0x82')]=!![];_0x3293c5[_0x2d38('0x87')]='COMPLETEDBYAGENT';logger[_0x2d38('0x6f')](_0x2d38('0x8f'),_0x3293c5[_0x2d38('0x4d')],_0x3293c5[_0x2d38('0x54')]);}}}catch(_0x456ad0){logger[_0x2d38('0x3d')](_0x2d38('0x8e'),_0x2f1a82[_0x2d38('0x4b')],util['inspect'](_0x456ad0,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2d38('0xc')][_0x2d38('0x23')]=function(_0x2870c8){try{if(this[_0x2d38('0x67')](_0x2870c8)){logger['debug'](_0x2d38('0x90'),_0x2870c8['uniqueid'],util['inspect'](_0x2870c8,{'showHidden':![],'depth':null}));if(this[_0x2d38('0x10')][_0x2870c8[_0x2d38('0x4b')]]){var _0x5eb21e=_[_0x2d38('0x81')](this[_0x2d38('0x10')][_0x2870c8['uniqueid']]);_0x5eb21e[_0x2d38('0x1e')]=![];_0x5eb21e['queuecallerabandonAt']=null;_0x5eb21e[_0x2d38('0x91')]=!![];_0x5eb21e[_0x2d38('0x92')]=_0x2870c8[_0x2d38('0x93')];_0x5eb21e[_0x2d38('0x83')]=_0x2870c8['holdtime'];_0x5eb21e[_0x2d38('0x82')]=!![];_0x5eb21e[_0x2d38('0x94')]=![];_0x5eb21e[_0x2d38('0x95')]=null;if(!_0x5eb21e['transfer']){if(_0x2870c8[_0x2d38('0x96')]=='transfer'){_0x5eb21e[_0x2d38('0x87')]=_0x2d38('0x97');logger[_0x2d38('0x6f')](_0x2d38('0x98'),_0x5eb21e['name'],_0x5eb21e[_0x2d38('0x54')]);}else{if(_[_0x2d38('0x99')](_0x2870c8['channel'][_0x2d38('0x9a')](),_0x2d38('0x9b'))){if(this[_0x2d38('0x10')][_0x2870c8[_0x2d38('0x9c')]]){var _0x2a4fed=_['last'](this[_0x2d38('0x10')][_0x2870c8[_0x2d38('0x9c')]]);_0x2a4fed[_0x2d38('0x82')]=![];_0x2a4fed[_0x2d38('0x94')]=!![];_0x2a4fed[_0x2d38('0x95')]=moment(_0x5eb21e[_0x2d38('0x9d')])[_0x2d38('0x9e')](_0x2870c8[_0x2d38('0x83')],'seconds')[_0x2d38('0x65')](_0x2d38('0x86'));_0x2a4fed['queuecallerexitreason']='FORWARDTRANSFER';_0x2a4fed[_0x2d38('0x9f')]=!![];_0x2a4fed[_0x2d38('0xa0')]=_0x2d38('0xa1');_0x2a4fed['transferexten']=_0x2870c8['destexten'];_0x2a4fed[_0x2d38('0xa2')]=_0x2870c8['uniqueid'];logger[_0x2d38('0x6f')](_0x2d38('0xa3'),_0x2a4fed['name'],_0x2a4fed[_0x2d38('0x54')]);var _0x35b656=this[_0x2d38('0x10')][_0x2870c8[_0x2d38('0x9c')]];this[_0x2d38('0x10')][_0x2870c8[_0x2d38('0x9c')]]=this['queueReports'][_0x2870c8[_0x2d38('0x4b')]];this[_0x2d38('0x10')][_0x2870c8[_0x2d38('0x4b')]]=_0x35b656;}}else{_0x5eb21e['queuecallerexitreason']=_0x2d38('0xa4')+_0x2870c8[_0x2d38('0x96')]['toUpperCase']();logger[_0x2d38('0x6f')](_0x2d38('0xa5'),_0x5eb21e[_0x2d38('0x4d')],_0x5eb21e[_0x2d38('0x54')],_0x5eb21e[_0x2d38('0x87')]);}}}this['channels'][_0x2870c8[_0x2d38('0x4b')]]=_0x5eb21e;this['emitVoiceQueueChannelRemove'](_0x5eb21e,_0x2d38('0x22'));}}}catch(_0x3bd1b7){logger['error'](_0x2d38('0x90'),_0x2870c8[_0x2d38('0x4b')],util[_0x2d38('0x3f')](_0x3bd1b7,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncVarSet']=function(_0x5c8fb3){try{if(this[_0x2d38('0x67')](_0x5c8fb3)){logger[_0x2d38('0x49')](_0x2d38('0xa6'),_0x5c8fb3[_0x2d38('0x4b')],util['inspect'](_0x5c8fb3,{'showHidden':![],'depth':null}));this[_0x2d38('0xa7')](_0x5c8fb3[_0x2d38('0x4b')],_[_0x2d38('0x7d')](_0x5c8fb3[_0x2d38('0xa8')])[0x0],_0x5c8fb3[_0x2d38('0xa9')]);if(this[_0x2d38('0x10')][_0x5c8fb3[_0x2d38('0x4b')]]){var _0x4ba0c5=_[_0x2d38('0x81')](this[_0x2d38('0x10')][_0x5c8fb3['uniqueid']]);if(_0x4ba0c5){if(this['isNotNull'](_0x5c8fb3['variable'])&&this[_0x2d38('0x67')](_0x5c8fb3[_0x2d38('0xa8')][_0x2d38('0xaa')])){switch(_0x5c8fb3[_0x2d38('0xa9')]){case _0x2d38('0xab'):_0x4ba0c5[_0x2d38('0x94')]=![];_0x4ba0c5['queuecallerexitAt']=null;break;case _0x2d38('0xac'):_0x4ba0c5['lastevent']=_0x2d38('0xad');_0x4ba0c5['queuecallerexit']=!![];_0x4ba0c5[_0x2d38('0x95')]=moment()[_0x2d38('0x65')](_0x2d38('0x86'));_0x4ba0c5['queuecallerleaveAt']=moment()[_0x2d38('0x65')]('YYYY-MM-DD\x20HH:mm:ss');logger[_0x2d38('0x49')](_0x2d38('0xae'),_0x5c8fb3[_0x2d38('0x4b')],util[_0x2d38('0x3f')](_0x4ba0c5,{'showHidden':![],'depth':null}));ami['emit'](_0x2d38('0xaf'),_0x4ba0c5);break;default:_0x4ba0c5[_0x2d38('0x94')]=!![];_0x4ba0c5['queuecallerexitAt']=moment()[_0x2d38('0x65')](_0x2d38('0x86'));_0x4ba0c5[_0x2d38('0x8a')]=moment()[_0x2d38('0x65')](_0x2d38('0x86'));}_0x4ba0c5[_0x2d38('0x1e')]=![];_0x4ba0c5[_0x2d38('0x85')]=null;_0x4ba0c5[_0x2d38('0x87')]=_0x5c8fb3[_0x2d38('0xa9')];this['channels'][_0x5c8fb3[_0x2d38('0x4b')]]=_0x4ba0c5;this[_0x2d38('0x45')](_0x4ba0c5,_0x2d38('0xb0'));}else if(this[_0x2d38('0x67')](_0x5c8fb3[_0x2d38('0xa8')])&&this[_0x2d38('0x67')](_0x5c8fb3[_0x2d38('0xa8')]['queueposition'])){if(!_0x4ba0c5[_0x2d38('0x1e')]){_0x4ba0c5[_0x2d38('0x94')]=!![];_0x4ba0c5[_0x2d38('0x95')]=moment()[_0x2d38('0x65')]('YYYY-MM-DD\x20HH:mm:ss');_0x4ba0c5[_0x2d38('0x87')]=_0x2d38('0xb1');_0x4ba0c5['queuecallerleaveAt']=moment()[_0x2d38('0x65')](_0x2d38('0x86'));this['channels'][_0x5c8fb3[_0x2d38('0x4b')]]=_0x4ba0c5;}}logger[_0x2d38('0x6f')]('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x5c8fb3[_0x2d38('0x4b')],_0x4ba0c5[_0x2d38('0x4d')],_0x4ba0c5['type'],_['keys'](_0x5c8fb3[_0x2d38('0xa8')])[0x0],_0x5c8fb3[_0x2d38('0xa9')]);_0x4ba0c5[_0x2d38('0x17')]=this[_0x2d38('0x17')][_0x5c8fb3['uniqueid']];}}}}catch(_0x22672e){logger[_0x2d38('0x3d')](_0x2d38('0xa6'),_0x5c8fb3[_0x2d38('0x4b')],util['inspect'](_0x22672e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2d38('0xc')][_0x2d38('0xa7')]=function(_0x1ae97f,_0x20cbc9,_0x3c8e92){var _0x3c62d9=[_0x2d38('0xb2'),_0x2d38('0xb3'),_0x2d38('0xb4'),_0x2d38('0xb5'),_0x2d38('0xb6'),'rtpaudioqoslossbridged','rtpaudioqosrtt',_0x2d38('0xb7'),_0x2d38('0xb8'),_0x2d38('0xb9'),_0x2d38('0xba'),_0x2d38('0xbb'),_0x2d38('0xbc'),_0x2d38('0xbd'),_0x2d38('0xbe'),_0x2d38('0xbf'),'membername',_0x2d38('0xc0'),_0x2d38('0xc1')];if(!_['isNil'](_0x20cbc9)&&!_[_0x2d38('0xc2')](_0x3c62d9,_0x20cbc9)){if(_['isUndefined'](this['variables'][_0x1ae97f])){this[_0x2d38('0x17')][_0x1ae97f]={};}this[_0x2d38('0x17')][_0x1ae97f][_0x20cbc9]=_0x3c8e92;}};VoiceQueueReport[_0x2d38('0xc')][_0x2d38('0x27')]=function(_0x254ff4){try{if(this['isNotNull'](_0x254ff4)){logger['debug']('[%s][voiceQueueReport][hangup]',_0x254ff4[_0x2d38('0x4b')],util['inspect'](_0x254ff4,{'showHidden':![],'depth':null}));if(this[_0x2d38('0x10')][_0x254ff4[_0x2d38('0x4b')]]){for(var _0x432692=0x0,_0x195424={};_0x432692=0x0?moment(_0xafb7de[_0x2629('0x17')])[_0x2629('0xa')](_0xafb7de[_0x2629('0x16')],_0x2629('0x18')):null,'data1':_0x2629('0x19'),'data2':_0xafb7de[_0x2629('0x11')],'data3':_0xafb7de['exten'],'data4':_0xafb7de['dialstring']||null,'role':_0x2629('0x10'),'internal':_0xafb7de[_0x2629('0x11')]?_[_0x2629('0x12')](_0xafb7de[_0x2629('0x11')]):undefined,'uniqueid':_0xafb7de[_0x2629('0x13')]},'log':_0x2629('0x2')});}; \ No newline at end of file +var _0x705c=['starttime','endtime','diff','outbound','uniqueid','moment','lodash','util','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','Request','CreateMemberReport','voice','lastAssignedTo','isNil','interface','format','SIP/%s','queuecallerleaveAt','seconds','inbound','calleridnum','exten','agent','accountcode','toNumber','voiceDialReport','TALKING'];(function(_0x506002,_0x17ad62){var _0x5a020c=function(_0xf907bc){while(--_0xf907bc){_0x506002['push'](_0x506002['shift']());}};_0x5a020c(++_0x17ad62);}(_0x705c,0x96));var _0xc705=function(_0x45fabb,_0xb5d945){_0x45fabb=_0x45fabb-0x0;var _0x3776f1=_0x705c[_0x45fabb];return _0x3776f1;};'use strict';var moment=require(_0xc705('0x0'));var _=require(_0xc705('0x1'));var util=require(_0xc705('0x2'));var client=require('../client');exports[_0xc705('0x3')]=function(_0x2c5eef){var _0x34df9f=_0x2c5eef[_0xc705('0x4')]||_0x2c5eef[_0xc705('0x5')];return client[_0xc705('0x6')](_0xc705('0x7'),{'body':{'channel':_0xc705('0x8'),'membername':_0x2c5eef[_0xc705('0x9')],'interface':_[_0xc705('0xa')](_0x2c5eef[_0xc705('0xb')])?util[_0xc705('0xc')](_0xc705('0xd'),_0x2c5eef['lastAssignedTo']):_0x2c5eef[_0xc705('0xb')],'type':'TALKING','enterAt':_0x2c5eef[_0xc705('0xe')],'exitAt':_0x34df9f,'duration':moment(_0x34df9f)['diff'](_0x2c5eef[_0xc705('0xe')],_0xc705('0xf')),'data1':_0xc705('0x10'),'data2':_0x2c5eef[_0xc705('0x11')],'data3':_0x2c5eef[_0xc705('0x12')],'data4':null,'data5':_0x2c5eef['queue'],'role':_0xc705('0x13'),'internal':_0x2c5eef[_0xc705('0x14')]?_[_0xc705('0x15')](_0x2c5eef[_0xc705('0x14')]):undefined,'uniqueid':_0x2c5eef['uniqueid']},'log':_0xc705('0x7')});};exports[_0xc705('0x16')]=function(_0x30bcf8){return client[_0xc705('0x6')]('CreateMemberReport',{'body':{'channel':'voice','membername':_0x30bcf8['membername'],'interface':_0x30bcf8['interface'],'type':_0xc705('0x17'),'enterAt':_0x30bcf8[_0xc705('0x18')],'exitAt':_0x30bcf8[_0xc705('0x19')],'duration':moment(_0x30bcf8[_0xc705('0x19')])['diff'](_0x30bcf8[_0xc705('0x18')],_0xc705('0xf'))>=0x0?moment(_0x30bcf8['endtime'])[_0xc705('0x1a')](_0x30bcf8[_0xc705('0x18')],_0xc705('0xf')):null,'data1':_0xc705('0x1b'),'data2':_0x30bcf8['accountcode'],'data3':_0x30bcf8[_0xc705('0x12')],'data4':_0x30bcf8['dialstring']||null,'role':_0xc705('0x13'),'internal':_0x30bcf8[_0xc705('0x14')]?_['toNumber'](_0x30bcf8[_0xc705('0x14')]):undefined,'uniqueid':_0x30bcf8[_0xc705('0x1c')]},'log':_0xc705('0x7')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 5fb9ffa..546851b 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 _0x9802=['GetSettings','../client','ShowSetting'];(function(_0x376095,_0xb8eb66){var _0x5ecd37=function(_0x149d59){while(--_0x149d59){_0x376095['push'](_0x376095['shift']());}};_0x5ecd37(++_0xb8eb66);}(_0x9802,0x112));var _0x2980=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x9802[_0x1caf6a];return _0x1bf493;};'use strict';var client=require(_0x2980('0x0'));exports['getSettings']=function(){return client['Request'](_0x2980('0x1'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer']},'log':_0x2980('0x2')});}; \ No newline at end of file +var _0xb077=['ShowSetting','GetSettings','../client'];(function(_0x7c0351,_0x4ae2ec){var _0x1f4d2f=function(_0x3c660b){while(--_0x3c660b){_0x7c0351['push'](_0x7c0351['shift']());}};_0x1f4d2f(++_0x4ae2ec);}(_0xb077,0x7a));var _0x7b07=function(_0x45be32,_0x1b1e3d){_0x45be32=_0x45be32-0x0;var _0xd73a59=_0xb077[_0x45be32];return _0xd73a59;};'use strict';var client=require(_0x7b07('0x0'));exports['getSettings']=function(){return client['Request'](_0x7b07('0x1'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer']},'log':_0x7b07('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 96557e8..8282510 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 _0x4148=['GetTemplate','name','html','../client','getTemplates','Request'];(function(_0x973433,_0x2ff98c){var _0x364851=function(_0x12569e){while(--_0x12569e){_0x973433['push'](_0x973433['shift']());}};_0x364851(++_0x2ff98c);}(_0x4148,0x75));var _0x8414=function(_0x57ebed,_0xfac0ac){_0x57ebed=_0x57ebed-0x0;var _0x3a0874=_0x4148[_0x57ebed];return _0x3a0874;};'use strict';var client=require(_0x8414('0x0'));exports[_0x8414('0x1')]=function(_0x4842f5){return function(_0x5473b1){return client[_0x8414('0x2')](_0x8414('0x3'),{'options':{'raw':!![],'attributes':['id',_0x8414('0x4'),_0x8414('0x5')]},'log':_0x8414('0x3')});};}; \ No newline at end of file +var _0xd2c2=['getTemplates','Request','html'];(function(_0x45f951,_0x2750c8){var _0x24756c=function(_0x31c931){while(--_0x31c931){_0x45f951['push'](_0x45f951['shift']());}};_0x24756c(++_0x2750c8);}(_0xd2c2,0x1ce));var _0x2d2c=function(_0x375428,_0x540c99){_0x375428=_0x375428-0x0;var _0x358569=_0xd2c2[_0x375428];return _0x358569;};'use strict';var client=require('../client');exports[_0x2d2c('0x0')]=function(_0x6c213){return function(_0x4e9e6a){return client[_0x2d2c('0x1')]('GetTemplate',{'options':{'raw':!![],'attributes':['id','name',_0x2d2c('0x2')]},'log':'GetTemplate'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 7a1d82a..9d2d816 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 _0xf421=['name','channel','Condition','AllConditions','operator','value','AnyConditions','field','Action','Actions','action','data1','data4','data5','data6','getTriggers','GetTrigger'];(function(_0x410010,_0x5af3d6){var _0x56d362=function(_0x549bc3){while(--_0x549bc3){_0x410010['push'](_0x410010['shift']());}};_0x56d362(++_0x5af3d6);}(_0xf421,0x185));var _0x1f42=function(_0x4acf20,_0x3f4636){_0x4acf20=_0x4acf20-0x0;var _0x50eabc=_0xf421[_0x4acf20];return _0x50eabc;};'use strict';var client=require('../client');exports[_0x1f42('0x0')]=function(_0x1d00ee){return function(_0x57d568){return client['Request'](_0x1f42('0x1'),{'options':{'raw':![],'attributes':['id',_0x1f42('0x2'),_0x1f42('0x3'),'status'],'include':[{'model':_0x1f42('0x4'),'as':_0x1f42('0x5'),'attributes':['id','field',_0x1f42('0x6'),_0x1f42('0x7')]},{'model':_0x1f42('0x4'),'as':_0x1f42('0x8'),'attributes':['id',_0x1f42('0x9'),_0x1f42('0x6'),_0x1f42('0x7')]},{'model':_0x1f42('0xa'),'as':_0x1f42('0xb'),'attributes':['id',_0x1f42('0xc'),_0x1f42('0xd'),'data2','data3',_0x1f42('0xe'),_0x1f42('0xf'),_0x1f42('0x10'),'data7']}]},'log':_0x1f42('0x1')});};}; \ No newline at end of file +var _0xe1ac=['value','AnyConditions','operator','Action','Actions','action','data2','data3','data5','data6','data7','Request','GetTrigger','name','channel','Condition','AllConditions','field'];(function(_0xe600a,_0x4ff849){var _0x26bc9c=function(_0x26a751){while(--_0x26a751){_0xe600a['push'](_0xe600a['shift']());}};_0x26bc9c(++_0x4ff849);}(_0xe1ac,0x1df));var _0xce1a=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xe1ac[_0x19e35c];return _0x3e1fe8;};'use strict';var client=require('../client');exports['getTriggers']=function(_0x1709f8){return function(_0x1e9250){return client[_0xce1a('0x0')](_0xce1a('0x1'),{'options':{'raw':![],'attributes':['id',_0xce1a('0x2'),_0xce1a('0x3'),'status'],'include':[{'model':_0xce1a('0x4'),'as':_0xce1a('0x5'),'attributes':['id',_0xce1a('0x6'),'operator',_0xce1a('0x7')]},{'model':_0xce1a('0x4'),'as':_0xce1a('0x8'),'attributes':['id',_0xce1a('0x6'),_0xce1a('0x9'),'value']},{'model':_0xce1a('0xa'),'as':_0xce1a('0xb'),'attributes':['id',_0xce1a('0xc'),'data1',_0xce1a('0xd'),_0xce1a('0xe'),'data4',_0xce1a('0xf'),_0xce1a('0x10'),_0xce1a('0x11')]}]},'log':_0xce1a('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 32d8e55..b1ec4ab 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 _0x3663=['defaultuser','../client','getTrunks','Request','GetTrunk','registry'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3663,0x1cf));var _0x3366=function(_0x4663cf,_0x4045b2){_0x4663cf=_0x4663cf-0x0;var _0x5e7f76=_0x3663[_0x4663cf];return _0x5e7f76;};'use strict';var client=require(_0x3366('0x0'));exports[_0x3366('0x1')]=function(_0x164564){return function(_0x54bb91){return client[_0x3366('0x2')](_0x3366('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0x3366('0x4'),_0x3366('0x5')]},'log':_0x3366('0x3')});};}; \ No newline at end of file +var _0x24ca=['../client','Request','name','registry','defaultuser','GetTrunk'];(function(_0x40b74c,_0x2f1fc1){var _0x5e0420=function(_0x1f0b21){while(--_0x1f0b21){_0x40b74c['push'](_0x40b74c['shift']());}};_0x5e0420(++_0x2f1fc1);}(_0x24ca,0x1bc));var _0xa24c=function(_0x202d24,_0x5e8641){_0x202d24=_0x202d24-0x0;var _0x2b3a8e=_0x24ca[_0x202d24];return _0x2b3a8e;};'use strict';var client=require(_0xa24c('0x0'));exports['getTrunks']=function(_0x2cf7df){return function(_0x4ebab4){return client[_0xa24c('0x1')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xa24c('0x2'),_0xa24c('0x3'),_0xa24c('0x4')]},'log':_0xa24c('0x5')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index b3c6164..99ffe3d 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 _0xedd9=['mobile','getTelephones','internal','PauseUser','savePause','saveUnpause','UnpauseUser','ShowUser','interface','getAgent','getAgents','Request','GetUser','agent','name','email','accountcode','fullname','lastLoginAt','pauseType','lastPauseAt','voicePause'];(function(_0x34c94e,_0x8e575b){var _0x14a7b3=function(_0x6e12ae){while(--_0x6e12ae){_0x34c94e['push'](_0x34c94e['shift']());}};_0x14a7b3(++_0x8e575b);}(_0xedd9,0xfc));var _0x9edd=function(_0x18bdce,_0x46effc){_0x18bdce=_0x18bdce-0x0;var _0x178198=_0xedd9[_0x18bdce];return _0x178198;};'use strict';var client=require('../client');exports[_0x9edd('0x0')]=function(){return function(){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'options':{'raw':![],'where':{'role':_0x9edd('0x3')},'attributes':['id',_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6'),_0x9edd('0x7'),'online',_0x9edd('0x8'),_0x9edd('0x9'),_0x9edd('0xa'),_0x9edd('0xb'),'phone',_0x9edd('0xc'),'interface']},'log':_0x9edd('0x0')});};};exports[_0x9edd('0xd')]=function(){return function(){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x9edd('0x4'),'accountcode',_0x9edd('0xe')]},'log':_0x9edd('0xd')});};};exports['savePause']=function(_0xbf9da6,_0x13dc4f,_0x5b6c00){return client[_0x9edd('0x1')](_0x9edd('0xf'),{'body':{'type':_0x13dc4f,'uniqueid':_0x5b6c00},'options':{'where':{'id':_0xbf9da6['id']}},'log':_0x9edd('0x10')});};exports[_0x9edd('0x11')]=function(_0x287ddd){return client[_0x9edd('0x1')](_0x9edd('0x12'),{'body':{},'options':{'where':{'id':_0x287ddd['id']}},'log':_0x9edd('0x10')});};exports['getAgent']=function(_0x176bfa){return client[_0x9edd('0x1')](_0x9edd('0x13'),{'options':{'raw':![],'where':{'role':_0x9edd('0x3'),'id':_0x176bfa},'attributes':['id',_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6'),_0x9edd('0x7'),'online',_0x9edd('0x8'),_0x9edd('0x9'),_0x9edd('0xa'),'voicePause',_0x9edd('0x14')]},'log':_0x9edd('0x15')});}; \ No newline at end of file +var _0x34e8=['../client','getAgents','Request','GetUser','name','email','accountcode','fullname','online','lastLoginAt','pauseType','voicePause','mobile','interface','getTelephones','telephone','internal','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','ShowUser','agent','lastPauseAt'];(function(_0x5592c7,_0x3ab141){var _0x420128=function(_0x1e2ca8){while(--_0x1e2ca8){_0x5592c7['push'](_0x5592c7['shift']());}};_0x420128(++_0x3ab141);}(_0x34e8,0x12c));var _0x834e=function(_0x1b5875,_0x35feb8){_0x1b5875=_0x1b5875-0x0;var _0x104722=_0x34e8[_0x1b5875];return _0x104722;};'use strict';var client=require(_0x834e('0x0'));exports[_0x834e('0x1')]=function(){return function(){return client[_0x834e('0x2')](_0x834e('0x3'),{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6'),_0x834e('0x7'),_0x834e('0x8'),_0x834e('0x9'),_0x834e('0xa'),'lastPauseAt',_0x834e('0xb'),'phone',_0x834e('0xc'),_0x834e('0xd')]},'log':_0x834e('0x1')});};};exports[_0x834e('0xe')]=function(){return function(){return client[_0x834e('0x2')](_0x834e('0x3'),{'options':{'raw':!![],'where':{'role':_0x834e('0xf')},'attributes':['id',_0x834e('0x4'),_0x834e('0x6'),_0x834e('0x10')]},'log':_0x834e('0xe')});};};exports[_0x834e('0x11')]=function(_0x14038b,_0x2e1a37,_0x293514){return client[_0x834e('0x2')](_0x834e('0x12'),{'body':{'type':_0x2e1a37,'uniqueid':_0x293514},'options':{'where':{'id':_0x14038b['id']}},'log':'savePause'});};exports[_0x834e('0x13')]=function(_0x6cd9b9){return client['Request'](_0x834e('0x14'),{'body':{},'options':{'where':{'id':_0x6cd9b9['id']}},'log':_0x834e('0x11')});};exports[_0x834e('0x15')]=function(_0x21cc0a){return client['Request'](_0x834e('0x16'),{'options':{'raw':![],'where':{'role':_0x834e('0x17'),'id':_0x21cc0a},'attributes':['id','name',_0x834e('0x5'),'accountcode',_0x834e('0x7'),_0x834e('0x8'),'lastLoginAt',_0x834e('0xa'),_0x834e('0x18'),_0x834e('0xb'),'interface']},'log':_0x834e('0x15')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 48e5d59..26887e0 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 _0x42aa=['update','UpdateVoiceAgentReport','../client','create','Request'];(function(_0x59eacf,_0x56ec4a){var _0x5d74f2=function(_0x5476ed){while(--_0x5476ed){_0x59eacf['push'](_0x59eacf['shift']());}};_0x5d74f2(++_0x56ec4a);}(_0x42aa,0xd4));var _0xa42a=function(_0x2d8a65,_0x1aa855){_0x2d8a65=_0x2d8a65-0x0;var _0x10ab06=_0x42aa[_0x2d8a65];return _0x10ab06;};'use strict';var client=require(_0xa42a('0x0'));exports[_0xa42a('0x1')]=function(_0x38b6dd){return client[_0xa42a('0x2')]('CreateVoiceAgentReport',{'body':_0x38b6dd,'log':'CreateVoiceAgentReport'});};exports[_0xa42a('0x3')]=function(_0xbbb3c1,_0x24c08a,_0x2f83b3){return client[_0xa42a('0x2')]('UpdateVoiceAgentReport',{'body':_0xbbb3c1,'options':{'where':{'uniqueid':_0x24c08a,'interface':_0x2f83b3,'agentcomplete':!![]}},'log':_0xa42a('0x4')});}; \ No newline at end of file +var _0x0c07=['Request','CreateVoiceAgentReport','update'];(function(_0x1c9140,_0x215c11){var _0x21d8f9=function(_0x193c9f){while(--_0x193c9f){_0x1c9140['push'](_0x1c9140['shift']());}};_0x21d8f9(++_0x215c11);}(_0x0c07,0x171));var _0x70c0=function(_0xf8baeb,_0x4c83e8){_0xf8baeb=_0xf8baeb-0x0;var _0x5997a4=_0x0c07[_0xf8baeb];return _0x5997a4;};'use strict';var client=require('../client');exports['create']=function(_0x395dd6){return client[_0x70c0('0x0')]('CreateVoiceAgentReport',{'body':_0x395dd6,'log':_0x70c0('0x1')});};exports[_0x70c0('0x2')]=function(_0x34e137,_0x4d232c,_0x85756e){return client[_0x70c0('0x0')]('UpdateVoiceAgentReport',{'body':_0x34e137,'options':{'where':{'uniqueid':_0x4d232c,'interface':_0x85756e,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 9a4d549..3b6ee3e 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 _0xadc3=['DOCUMENTATION','GetVoiceCallReport','outbound','startOf','format','YYYY-MM-DD\x20HH:mm:ss','endOf','day','type','duration','billableseconds','moment','util','lodash','../client','create','Request','CreateVoiceCallReport','context','callerid'];(function(_0x475835,_0x3dd122){var _0x496aed=function(_0x24ab63){while(--_0x24ab63){_0x475835['push'](_0x475835['shift']());}};_0x496aed(++_0x3dd122);}(_0xadc3,0x15f));var _0x3adc=function(_0x206bd1,_0x4d72cd){_0x206bd1=_0x206bd1-0x0;var _0x5ca7ec=_0xadc3[_0x206bd1];return _0x5ca7ec;};'use strict';var moment=require(_0x3adc('0x0'));var util=require(_0x3adc('0x1'));var _=require(_0x3adc('0x2'));var client=require(_0x3adc('0x3'));exports[_0x3adc('0x4')]=function(_0x22988f){return client[_0x3adc('0x5')](_0x3adc('0x6'),{'body':_['merge'](_0x22988f,{'source':_0x22988f['calleridnum'],'destinationcontext':_0x22988f[_0x3adc('0x7')],'callerid':_0x22988f[_0x3adc('0x8')],'amaflags':_0x3adc('0x9')}),'log':_0x3adc('0x6')});};exports['getVoiceCallReports']=function(){return function(){return client[_0x3adc('0x5')](_0x3adc('0xa'),{'options':{'where':{'type':[_0x3adc('0xb')],'createdAt':{'$between':[moment()[_0x3adc('0xc')]('day')[_0x3adc('0xd')](_0x3adc('0xe')),moment()[_0x3adc('0xf')](_0x3adc('0x10'))[_0x3adc('0xd')](_0x3adc('0xe'))]}},'attributes':[_0x3adc('0x11'),'disposition',_0x3adc('0x12'),_0x3adc('0x13')]},'log':'GetVoiceCallReports'});};}; \ No newline at end of file +var _0x9682=['endOf','type','disposition','duration','GetVoiceCallReports','moment','lodash','../client','create','Request','CreateVoiceCallReport','calleridnum','context','DOCUMENTATION','outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x1bf055,_0x381586){var _0xd70b6d=function(_0x462a53){while(--_0x462a53){_0x1bf055['push'](_0x1bf055['shift']());}};_0xd70b6d(++_0x381586);}(_0x9682,0x122));var _0x2968=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x9682[_0x397e5f];return _0x5302b8;};'use strict';var moment=require(_0x2968('0x0'));var util=require('util');var _=require(_0x2968('0x1'));var client=require(_0x2968('0x2'));exports[_0x2968('0x3')]=function(_0x25b086){return client[_0x2968('0x4')](_0x2968('0x5'),{'body':_['merge'](_0x25b086,{'source':_0x25b086[_0x2968('0x6')],'destinationcontext':_0x25b086[_0x2968('0x7')],'callerid':_0x25b086['callerid'],'amaflags':_0x2968('0x8')}),'log':_0x2968('0x5')});};exports['getVoiceCallReports']=function(){return function(){return client[_0x2968('0x4')]('GetVoiceCallReport',{'options':{'where':{'type':[_0x2968('0x9')],'createdAt':{'$between':[moment()[_0x2968('0xa')](_0x2968('0xb'))[_0x2968('0xc')](_0x2968('0xd')),moment()[_0x2968('0xe')](_0x2968('0xb'))[_0x2968('0xc')]('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':[_0x2968('0xf'),_0x2968('0x10'),_0x2968('0x11'),'billableseconds']},'log':_0x2968('0x12')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 69ed773..1dc3093 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 _0xb930=['CreateVoiceDialReport','../client','create'];(function(_0x5229b6,_0xef9d44){var _0x2f6d75=function(_0x379580){while(--_0x379580){_0x5229b6['push'](_0x5229b6['shift']());}};_0x2f6d75(++_0xef9d44);}(_0xb930,0x1bd));var _0x0b93=function(_0x1358a6,_0x11dfed){_0x1358a6=_0x1358a6-0x0;var _0x41cf1d=_0xb930[_0x1358a6];return _0x41cf1d;};'use strict';var client=require(_0x0b93('0x0'));exports[_0x0b93('0x1')]=function(_0x3a9565){return client['Request'](_0x0b93('0x2'),{'body':_0x3a9565,'log':_0x0b93('0x2')});}; \ No newline at end of file +var _0x4791=['CreateVoiceDialReport','../client','create','Request'];(function(_0x5243d6,_0x365800){var _0x3cd8dd=function(_0x1cb9c9){while(--_0x1cb9c9){_0x5243d6['push'](_0x5243d6['shift']());}};_0x3cd8dd(++_0x365800);}(_0x4791,0x155));var _0x1479=function(_0x1c470d,_0x81d66b){_0x1c470d=_0x1c470d-0x0;var _0x12141b=_0x4791[_0x1c470d];return _0x12141b;};'use strict';var client=require(_0x1479('0x0'));exports[_0x1479('0x1')]=function(_0x39c14a){return client[_0x1479('0x2')](_0x1479('0x3'),{'body':_0x39c14a,'log':_0x1479('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 732a321..40f3c08 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 _0xd757=['GetVoiceExtension','../client','getVoiceExtensions','Request'];(function(_0x256e71,_0x9e30cc){var _0x112a23=function(_0x3fd5e3){while(--_0x3fd5e3){_0x256e71['push'](_0x256e71['shift']());}};_0x112a23(++_0x9e30cc);}(_0xd757,0x1e5));var _0x7d75=function(_0x252423,_0x1f8c71){_0x252423=_0x252423-0x0;var _0x30daea=_0xd757[_0x252423];return _0x30daea;};'use strict';var client=require(_0x7d75('0x0'));exports[_0x7d75('0x1')]=function(){return function(){return client[_0x7d75('0x2')](_0x7d75('0x3'),{'options':{'raw':!![],'attributes':['id','exten','recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0x7d75('0x1')});};}; \ No newline at end of file +var _0x3276=['GetVoiceExtension','exten','recordingFormat','getVoiceExtensions','../client'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x3276,0xc7));var _0x6327=function(_0x5bd255,_0xcd13ad){_0x5bd255=_0x5bd255-0x0;var _0x5332d2=_0x3276[_0x5bd255];return _0x5332d2;};'use strict';var client=require(_0x6327('0x0'));exports['getVoiceExtensions']=function(){return function(){return client['Request'](_0x6327('0x1'),{'options':{'raw':!![],'attributes':['id',_0x6327('0x2'),_0x6327('0x3')],'where':{'VoiceExtensionId':null}},'log':_0x6327('0x4')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index d86af04..f3c7ae6 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 _0x5638=['strategy','dialRandomLastDigitCallerIdNumber','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk','callerid','active','Interval','Intervals','interval','../client','getVoiceQueues','GetVoiceQueue','name','acw','autopause','monitor_format','type','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialOriginateCallerIdNumber','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent'];(function(_0x400812,_0x2a8006){var _0x34b883=function(_0x498a83){while(--_0x498a83){_0x400812['push'](_0x400812['shift']());}};_0x34b883(++_0x2a8006);}(_0x5638,0x7e));var _0x8563=function(_0xdc4b10,_0x25ac09){_0xdc4b10=_0xdc4b10-0x0;var _0x58e361=_0x5638[_0xdc4b10];return _0x58e361;};'use strict';var client=require(_0x8563('0x0'));exports[_0x8563('0x1')]=function(){return function(){return client['Request'](_0x8563('0x2'),{'options':{'raw':![],'attributes':['id',_0x8563('0x3'),_0x8563('0x4'),'acwTimeout',_0x8563('0x5'),_0x8563('0x6'),_0x8563('0x7'),'dialActive',_0x8563('0x8'),_0x8563('0x9'),_0x8563('0xa'),_0x8563('0xb'),_0x8563('0xc'),_0x8563('0xd'),'dialPredictiveInterval','dialOriginateCallerIdName',_0x8563('0xe'),'dialOriginateTimeout',_0x8563('0xf'),_0x8563('0x10'),_0x8563('0x11'),_0x8563('0x12'),'dialCongestionRetryFrequency',_0x8563('0x13'),_0x8563('0x14'),_0x8563('0x15'),'dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval',_0x8563('0x16'),_0x8563('0x17'),_0x8563('0x18'),_0x8563('0x19'),_0x8563('0x1a'),_0x8563('0x1b'),_0x8563('0x1c'),_0x8563('0x1d'),'dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords',_0x8563('0x1e'),_0x8563('0x1f'),_0x8563('0x20'),'dialRecallMeTimeout',_0x8563('0x21'),_0x8563('0x22'),_0x8563('0x23'),'dialAgiAfterHangupClient','dialQueueProject2',_0x8563('0x6'),_0x8563('0x24'),_0x8563('0x25'),'dialCutDigit',_0x8563('0x26'),_0x8563('0x27'),_0x8563('0x28'),'dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency',_0x8563('0x29'),_0x8563('0x2a'),_0x8563('0x2b'),_0x8563('0x2c'),_0x8563('0x2d'),_0x8563('0x2e'),_0x8563('0x2f')],'include':[{'model':_0x8563('0x30'),'as':_0x8563('0x30'),'attributes':['id','name',_0x8563('0x31'),_0x8563('0x32')]},{'model':'Pause','as':'mandatoryDispositionPause','attributes':['id','name']},{'model':'Trunk','as':'TrunkBackup','attributes':['id',_0x8563('0x3'),_0x8563('0x31'),'active']},{'model':_0x8563('0x33'),'as':_0x8563('0x33'),'attributes':['id',_0x8563('0x3')],'include':[{'model':_0x8563('0x33'),'as':_0x8563('0x34'),'attributes':['id',_0x8563('0x3'),_0x8563('0x35')]}]}]},'log':_0x8563('0x1')});};}; \ No newline at end of file +var _0x3126=['dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMinThreshold','Trunk','callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','../client','Request','GetVoiceQueue','name','acw','autopause','monitor_format','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveInterval','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0x3126,0x1c3));var _0x6312=function(_0x718143,_0x5c668e){_0x718143=_0x718143-0x0;var _0x498601=_0x3126[_0x718143];return _0x498601;};'use strict';var client=require(_0x6312('0x0'));exports['getVoiceQueues']=function(){return function(){return client[_0x6312('0x1')](_0x6312('0x2'),{'options':{'raw':![],'attributes':['id',_0x6312('0x3'),_0x6312('0x4'),'acwTimeout',_0x6312('0x5'),_0x6312('0x6'),'type',_0x6312('0x7'),_0x6312('0x8'),_0x6312('0x9'),_0x6312('0xa'),_0x6312('0xb'),_0x6312('0xc'),'dialPredictiveOptimizationPercentage',_0x6312('0xd'),'dialOriginateCallerIdName',_0x6312('0xe'),_0x6312('0xf'),_0x6312('0x10'),_0x6312('0x11'),_0x6312('0x12'),_0x6312('0x13'),_0x6312('0x14'),_0x6312('0x15'),'dialBusyRetryFrequency',_0x6312('0x16'),_0x6312('0x17'),_0x6312('0x18'),_0x6312('0x19'),_0x6312('0x1a'),'dialPrefix','dialCheckDuplicateType',_0x6312('0x1b'),_0x6312('0x1c'),_0x6312('0x1d'),'dialAMDAfterGreetingSilence',_0x6312('0x1e'),_0x6312('0x1f'),_0x6312('0x20'),_0x6312('0x21'),_0x6312('0x22'),_0x6312('0x23'),'timeout','dialRecallMeTimeout',_0x6312('0x24'),_0x6312('0x25'),_0x6312('0x26'),_0x6312('0x27'),_0x6312('0x28'),_0x6312('0x6'),_0x6312('0x29'),_0x6312('0x2a'),_0x6312('0x2b'),_0x6312('0x2c'),_0x6312('0x2d'),'dialDropMaxRetry',_0x6312('0x2e'),_0x6312('0x2f'),_0x6312('0x30'),_0x6312('0x31'),_0x6312('0x32'),'dialAgentRejectMaxRetry',_0x6312('0x33'),_0x6312('0x34'),'dialPredictiveIntervalMaxThreshold',_0x6312('0x35')],'include':[{'model':_0x6312('0x36'),'as':_0x6312('0x36'),'attributes':['id',_0x6312('0x3'),_0x6312('0x37'),_0x6312('0x38')]},{'model':_0x6312('0x39'),'as':_0x6312('0x3a'),'attributes':['id',_0x6312('0x3')]},{'model':_0x6312('0x36'),'as':_0x6312('0x3b'),'attributes':['id',_0x6312('0x3'),'callerid',_0x6312('0x38')]},{'model':_0x6312('0x3c'),'as':'Interval','attributes':['id',_0x6312('0x3')],'include':[{'model':'Interval','as':_0x6312('0x3d'),'attributes':['id',_0x6312('0x3'),'interval']}]}]},'log':'getVoiceQueues'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 9823258..70f39c2 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(_0x550f53,_0x4885d8){var _0x291e6a=function(_0x450524){while(--_0x450524){_0x550f53['push'](_0x550f53['shift']());}};_0x291e6a(++_0x4885d8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'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(_0x2ff980,_0xf5e589){var _0x3e4a63=function(_0xd40f69){while(--_0xd40f69){_0x2ff980['push'](_0x2ff980['shift']());}};_0x3e4a63(++_0xf5e589);}(_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 66c4a8b..9af3b9d 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 _0x97c2=['GetVoiceQueueRtPauses','getVoiceQueueRtPauses','Request'];(function(_0x4e8178,_0x212652){var _0x1f69b3=function(_0x31560e){while(--_0x31560e){_0x4e8178['push'](_0x4e8178['shift']());}};_0x1f69b3(++_0x212652);}(_0x97c2,0x6d));var _0x297c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x97c2[_0x14add3];return _0x4a174f;};'use strict';var client=require('../client');exports[_0x297c('0x0')]=function(_0x49e9c7){return function(){return client[_0x297c('0x1')](_0x297c('0x2'),{'options':{'where':{'VoiceQueueId':_0x49e9c7,'paused':!![]},'raw':!![]},'log':_0x297c('0x0')});};}; \ No newline at end of file +var _0x2a9c=['GetVoiceQueueRtPauses','../client','getVoiceQueueRtPauses','Request'];(function(_0x54b6d5,_0x1f21ed){var _0x34e56d=function(_0x26a1c0){while(--_0x26a1c0){_0x54b6d5['push'](_0x54b6d5['shift']());}};_0x34e56d(++_0x1f21ed);}(_0x2a9c,0xdd));var _0xc2a9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2a9c[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xc2a9('0x0'));exports[_0xc2a9('0x1')]=function(_0x4016e7){return function(){return client[_0xc2a9('0x2')](_0xc2a9('0x3'),{'options':{'where':{'VoiceQueueId':_0x4016e7,'paused':!![]},'raw':!![]},'log':_0xc2a9('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 01aaa04..0bb846d 100644 --- a/server/services/ami/rpc/voiceRecording.js +++ b/server/services/ami/rpc/voiceRecording.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x436f61,_0x232837){var _0x1b355e=function(_0x1e387d){while(--_0x1e387d){_0x436f61['push'](_0x436f61['shift']());}};_0x1b355e(++_0x232837);}(_0x7a54,0x106));var _0x47a5=function(_0x40876e,_0x23924e){_0x40876e=_0x40876e-0x0;var _0x54d073=_0x7a54[_0x40876e];return _0x54d073;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});}; \ No newline at end of file +var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x5f1696,_0x51ff8e){var _0x50894b=function(_0x1b8238){while(--_0x1b8238){_0x5f1696['push'](_0x5f1696['shift']());}};_0x50894b(++_0x51ff8e);}(_0x7a54,0x106));var _0x47a5=function(_0x380299,_0x438874){_0x380299=_0x380299-0x0;var _0x1ff983=_0x7a54[_0x380299];return _0x1ff983;};'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 497b2be..7e47c27 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 _0xd789=['Request','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetcontext','transfertargetlinkedid','isexternal','origtransferercontext','origtransfererexten','attended','../client','transfers','blindTransfer','CreateVoiceTransferReport','result','transfererconnectedlinenum','transfereraccountcode','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereeconnectedlinenum','transfereeconnectedlinename','transfereecontext','transfereelinkedid','extension','blind','attendedTransfer'];(function(_0x56a095,_0x2c7dd8){var _0x15beb4=function(_0x36079f){while(--_0x36079f){_0x56a095['push'](_0x56a095['shift']());}};_0x15beb4(++_0x2c7dd8);}(_0xd789,0x16f));var _0x9d78=function(_0x16c7d4,_0x1fd6a5){_0x16c7d4=_0x16c7d4-0x0;var _0x54c042=_0xd789[_0x16c7d4];return _0x54c042;};'use strict';var client=require(_0x9d78('0x0'));exports[_0x9d78('0x1')]={};exports[_0x9d78('0x2')]=function(_0x49ad16){return client['Request'](_0x9d78('0x3'),{'body':{'result':_0x49ad16[_0x9d78('0x4')],'transfererchannel':_0x49ad16['transfererchannel'],'transferercalleridnum':_0x49ad16['transferercalleridnum'],'transferercalleridname':_0x49ad16['transferercalleridname'],'transfererconnectedlinenum':_0x49ad16[_0x9d78('0x5')],'transfererconnectedlinename':_0x49ad16['transfererconnectedlinename'],'transfereraccountcode':_0x49ad16[_0x9d78('0x6')],'transferercontext':_0x49ad16['transferercontext'],'transfererexten':_0x49ad16[_0x9d78('0x7')],'transfererlinkedid':_0x49ad16[_0x9d78('0x8')],'transfereechannel':_0x49ad16[_0x9d78('0x9')],'transfereecalleridnum':_0x49ad16[_0x9d78('0xa')],'transfereecalleridname':_0x49ad16['transfereecalleridname'],'transfereeconnectedlinenum':_0x49ad16[_0x9d78('0xb')],'transfereeconnectedlinename':_0x49ad16[_0x9d78('0xc')],'transfereeaccountcode':_0x49ad16['transfereeaccountcode'],'transfereecontext':_0x49ad16[_0x9d78('0xd')],'transfereeexten':_0x49ad16['transfereeexten'],'transfereelinkedid':_0x49ad16[_0x9d78('0xe')],'isexternal':_0x49ad16['isexternal'],'context':_0x49ad16['context'],'extension':_0x49ad16[_0x9d78('0xf')],'type':_0x9d78('0x10')},'log':_0x9d78('0x3')});};exports[_0x9d78('0x11')]=function(_0x336181){return client[_0x9d78('0x12')]('CreateVoiceTransferReport',{'body':{'result':_0x336181[_0x9d78('0x4')],'transfererchannel':_0x336181[_0x9d78('0x13')],'transferercalleridnum':_0x336181['origtransferercalleridnum'],'transferercalleridname':_0x336181[_0x9d78('0x14')],'transfererconnectedlinenum':_0x336181[_0x9d78('0x15')],'transfererconnectedlinename':_0x336181[_0x9d78('0x16')],'transfereraccountcode':_0x336181[_0x9d78('0x17')],'transferercontext':_0x336181['secondtransferercontext'],'transfererexten':_0x336181[_0x9d78('0x18')],'transfererlinkedid':_0x336181[_0x9d78('0x19')],'transfereechannel':_0x336181[_0x9d78('0x1a')],'transfereecalleridnum':_0x336181['transfertargetcalleridnum'],'transfereecalleridname':_0x336181['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x336181[_0x9d78('0x1b')],'transfereeconnectedlinename':_0x336181['transfertargetconnectedlinename'],'transfereeaccountcode':_0x336181[_0x9d78('0x1c')],'transfereecontext':_0x336181[_0x9d78('0x1d')],'transfereeexten':_0x336181['transfertargetexten'],'transfereelinkedid':_0x336181[_0x9d78('0x1e')],'isexternal':_0x336181[_0x9d78('0x1f')],'context':_0x336181[_0x9d78('0x20')],'extension':_0x336181[_0x9d78('0x21')],'type':_0x9d78('0x22')},'log':_0x9d78('0x3')});}; \ No newline at end of file +var _0xef18=['secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','../client','transfers','blindTransfer','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereeexten','isexternal','blind','attendedTransfer','origtransfererchannel','origtransferercalleridnum','secondtransfererconnectedlinenum'];(function(_0x3abf9a,_0x417e69){var _0x258ac7=function(_0x133f65){while(--_0x133f65){_0x3abf9a['push'](_0x3abf9a['shift']());}};_0x258ac7(++_0x417e69);}(_0xef18,0xe1));var _0x8ef1=function(_0x580647,_0x43d2c3){_0x580647=_0x580647-0x0;var _0x5f0792=_0xef18[_0x580647];return _0x5f0792;};'use strict';var client=require(_0x8ef1('0x0'));exports[_0x8ef1('0x1')]={};exports[_0x8ef1('0x2')]=function(_0x2f4a59){return client[_0x8ef1('0x3')](_0x8ef1('0x4'),{'body':{'result':_0x2f4a59[_0x8ef1('0x5')],'transfererchannel':_0x2f4a59[_0x8ef1('0x6')],'transferercalleridnum':_0x2f4a59[_0x8ef1('0x7')],'transferercalleridname':_0x2f4a59[_0x8ef1('0x8')],'transfererconnectedlinenum':_0x2f4a59[_0x8ef1('0x9')],'transfererconnectedlinename':_0x2f4a59[_0x8ef1('0xa')],'transfereraccountcode':_0x2f4a59[_0x8ef1('0xb')],'transferercontext':_0x2f4a59[_0x8ef1('0xc')],'transfererexten':_0x2f4a59['transfererexten'],'transfererlinkedid':_0x2f4a59[_0x8ef1('0xd')],'transfereechannel':_0x2f4a59[_0x8ef1('0xe')],'transfereecalleridnum':_0x2f4a59[_0x8ef1('0xf')],'transfereecalleridname':_0x2f4a59[_0x8ef1('0x10')],'transfereeconnectedlinenum':_0x2f4a59[_0x8ef1('0x11')],'transfereeconnectedlinename':_0x2f4a59[_0x8ef1('0x12')],'transfereeaccountcode':_0x2f4a59[_0x8ef1('0x13')],'transfereecontext':_0x2f4a59['transfereecontext'],'transfereeexten':_0x2f4a59[_0x8ef1('0x14')],'transfereelinkedid':_0x2f4a59['transfereelinkedid'],'isexternal':_0x2f4a59[_0x8ef1('0x15')],'context':_0x2f4a59['context'],'extension':_0x2f4a59['extension'],'type':_0x8ef1('0x16')},'log':_0x8ef1('0x4')});};exports[_0x8ef1('0x17')]=function(_0x5d35cd){return client[_0x8ef1('0x3')](_0x8ef1('0x4'),{'body':{'result':_0x5d35cd[_0x8ef1('0x5')],'transfererchannel':_0x5d35cd[_0x8ef1('0x18')],'transferercalleridnum':_0x5d35cd[_0x8ef1('0x19')],'transferercalleridname':_0x5d35cd['origtransferercalleridname'],'transfererconnectedlinenum':_0x5d35cd[_0x8ef1('0x1a')],'transfererconnectedlinename':_0x5d35cd[_0x8ef1('0x1b')],'transfereraccountcode':_0x5d35cd[_0x8ef1('0x1c')],'transferercontext':_0x5d35cd[_0x8ef1('0x1d')],'transfererexten':_0x5d35cd[_0x8ef1('0x1e')],'transfererlinkedid':_0x5d35cd[_0x8ef1('0x1f')],'transfereechannel':_0x5d35cd[_0x8ef1('0x20')],'transfereecalleridnum':_0x5d35cd[_0x8ef1('0x21')],'transfereecalleridname':_0x5d35cd[_0x8ef1('0x22')],'transfereeconnectedlinenum':_0x5d35cd[_0x8ef1('0x23')],'transfereeconnectedlinename':_0x5d35cd[_0x8ef1('0x24')],'transfereeaccountcode':_0x5d35cd['transfertargetaccountcode'],'transfereecontext':_0x5d35cd[_0x8ef1('0x25')],'transfereeexten':_0x5d35cd['transfertargetexten'],'transfereelinkedid':_0x5d35cd[_0x8ef1('0x26')],'isexternal':_0x5d35cd[_0x8ef1('0x15')],'context':_0x5d35cd[_0x8ef1('0x27')],'extension':_0x5d35cd[_0x8ef1('0x28')],'type':_0x8ef1('0x29')},'log':_0x8ef1('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 015fde3..972504e 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 _0x0af5=['predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','length','omit','undefined','voicechannel','map','channels','uniqueid','channel','MixMonitor','ai(mixmonitorid)','find','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','stop','filename','wav','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','voicequeuechannelhangup','Redirect','exten','context','values','telephones','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:','util','jayson/promise','validate','bluebird','moment','../../../config/environment','../properties','../ami','listen','format','name','timers','timer','updateAcw','agents','updateStatusRealtime','pause','QueuePause','error','asterisk','username','pick','keys','Reload','Action','then','message','catch','isConnected','ami\x20disconnected','join','command','action','Command','content','voiceQueues','hasOwnProperty','strategy','answered','available','loggedIn','pTalking','sumBillable','sumHoldTime','talking','total','unmanaged','waiting','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0af5,0x158));var _0x50af=function(_0x5378a9,_0xd87d76){_0x5378a9=_0x5378a9-0x0;var _0x4dfee1=_0x0af5[_0x5378a9];return _0x4dfee1;};'use strict';var _=require('lodash');var util=require(_0x50af('0x0'));var jayson=require(_0x50af('0x1'));var schema=require(_0x50af('0x2'));var BPromise=require(_0x50af('0x3'));var moment=require(_0x50af('0x4'));var config=require(_0x50af('0x5'));var properties=require(_0x50af('0x6'));var ami=require(_0x50af('0x7'));exports[_0x50af('0x8')]=function(_0x1cfefa,_0x4c7210,_0xe37b1){return new BPromise(function(_0x5e94f8,_0x5a5c0a){var _0x3724ed={'QueuePause':function(_0x120038){return new Promise(function(_0x4dc2b9,_0x49814d){var _0x4770ec=util[_0x50af('0x9')]('%s/%s','SIP',_0x120038[_0x50af('0xa')]);if(_0x1cfefa[_0x50af('0xb')]&&_0x1cfefa['timers'][_0x4770ec]&&_0x1cfefa[_0x50af('0xb')][_0x4770ec][_0x50af('0xc')]){_0x1cfefa[_0x50af('0xb')][_0x4770ec][_0x50af('0xd')]();}if(_0x1cfefa['agents'][_0x4770ec]){_0x1cfefa[_0x50af('0xe')][_0x4770ec][_0x50af('0xf')]({'statePause':_0x120038[_0x50af('0x10')]?!![]:![]});}_0x4dc2b9({'code':0xc8,'message':_0x50af('0x11')});});},'Reload':function(_0x252a02){var _0x38bac0=this;return new Promise(function(_0x534589,_0x5eadd5){if(ami['isConnected']()==![]){return _0x5eadd5(_0x38bac0[_0x50af('0x12')](0x1f4,[config['asterisk']['ip'],config[_0x50af('0x13')][_0x50af('0x14')],'ami\x20disconnected']['join']('\x20')));}_0x252a02=_[_0x50af('0x15')](_0x252a02,_[_0x50af('0x16')](properties['module']));_0x252a02['action']=_0x50af('0x17');return ami[_0x50af('0x18')](_0x252a02)[_0x50af('0x19')](function(_0x30e2ec){_0x534589({'code':0xc8,'message':_0x30e2ec[_0x50af('0x1a')]});})[_0x50af('0x1b')](function(_0x23bad2){_0x5eadd5(_0x38bac0[_0x50af('0x12')](0x1f5,_0x23bad2[_0x50af('0x1a')]));});});},'Command':function(_0xaee5cf){var _0x5c6f8e=this;return new Promise(function(_0x3f1dbe,_0x2fbf20){if(ami[_0x50af('0x1c')]()==![]){return _0x2fbf20(_0x5c6f8e[_0x50af('0x12')](0x1f4,[config['asterisk']['ip'],config[_0x50af('0x13')][_0x50af('0x14')],_0x50af('0x1d')][_0x50af('0x1e')]('\x20')));}_0xaee5cf=_[_0x50af('0x15')](_0xaee5cf,_0x50af('0x1f'));_0xaee5cf[_0x50af('0x20')]=_0x50af('0x21');return ami[_0x50af('0x18')](_0xaee5cf)[_0x50af('0x19')](function(_0x53e362){_0x3f1dbe({'code':0xc8,'message':_0x53e362[_0x50af('0x22')]});})[_0x50af('0x1b')](function(_0x3c6388){_0x2fbf20(_0x5c6f8e[_0x50af('0x12')](0x1f5,_0x3c6388[_0x50af('0x1a')]));});});},'VoiceQueues':function(_0xb3c17c){return new Promise(function(_0x4db72d,_0xb3c15a){var _0x1550ee=[];for(var _0x5e096d in _0x1cfefa[_0x50af('0x23')]){if(_0x1cfefa[_0x50af('0x23')][_0x50af('0x24')](_0x5e096d)){var _0x5dc58a=_0x1cfefa['voiceQueues'][_0x5e096d];var _0x26dbae={'id':_0x5dc58a['id'],'name':_0x5dc58a[_0x50af('0xa')],'strategy':_0x5dc58a[_0x50af('0x25')],'answered':_0x5dc58a[_0x50af('0x26')],'available':_0x5dc58a[_0x50af('0x27')],'loggedIn':_0x5dc58a[_0x50af('0x28')],'pTalking':_0x5dc58a[_0x50af('0x29')],'sumBillable':_0x5dc58a[_0x50af('0x2a')],'sumDuration':_0x5dc58a['sumDuration'],'sumHoldTime':_0x5dc58a[_0x50af('0x2b')]||0x0,'talking':_0x5dc58a[_0x50af('0x2c')],'total':_0x5dc58a[_0x50af('0x2d')],'type':_0x5dc58a['type'],'unmanaged':_0x5dc58a[_0x50af('0x2e')],'abandoned':_0x5dc58a['abandoned'],'waiting':_0x5dc58a[_0x50af('0x2f')],'loggedInDb':_0x5dc58a['loggedInDb']};if(_0x5dc58a['type']==='outbound'){_0x26dbae[_0x50af('0x30')]=_0x5dc58a[_0x50af('0x30')];_0x26dbae[_0x50af('0x31')]=_0x5dc58a[_0x50af('0x31')];_0x26dbae[_0x50af('0x32')]=_0x5dc58a[_0x50af('0x32')];_0x26dbae[_0x50af('0x33')]=_0x5dc58a[_0x50af('0x33')];_0x26dbae[_0x50af('0x34')]=_0x5dc58a[_0x50af('0x34')];_0x26dbae['dialPrefix']=_0x5dc58a[_0x50af('0x35')];_0x26dbae[_0x50af('0x36')]=_0x5dc58a[_0x50af('0x36')];_0x26dbae[_0x50af('0x37')]=_0x5dc58a[_0x50af('0x37')];_0x26dbae['outboundAnswerCallsDay']=_0x5dc58a[_0x50af('0x38')];_0x26dbae['outboundBlacklistCallsDay']=_0x5dc58a['outboundBlacklistCallsDay'];_0x26dbae['outboundBusyCallsDay']=_0x5dc58a[_0x50af('0x39')];_0x26dbae[_0x50af('0x3a')]=_0x5dc58a[_0x50af('0x3a')];_0x26dbae[_0x50af('0x3b')]=_0x5dc58a[_0x50af('0x3b')];_0x26dbae['outboundDropCallsDayCallersExit']=_0x5dc58a['outboundDropCallsDayCallersExit'];_0x26dbae[_0x50af('0x3c')]=_0x5dc58a[_0x50af('0x3c')];_0x26dbae[_0x50af('0x3d')]=_0x5dc58a[_0x50af('0x3d')];_0x26dbae[_0x50af('0x3e')]=_0x5dc58a['outboundNoSuchCallsDay'];_0x26dbae[_0x50af('0x3f')]=_0x5dc58a[_0x50af('0x3f')];_0x26dbae[_0x50af('0x40')]=_0x5dc58a[_0x50af('0x40')];_0x26dbae['outboundRejectCallsDay']=_0x5dc58a[_0x50af('0x41')];_0x26dbae[_0x50af('0x42')]=_0x5dc58a[_0x50af('0x42')];_0x26dbae[_0x50af('0x43')]=_0x5dc58a[_0x50af('0x43')];_0x26dbae['predictiveIntervalAvgHoldtime']=_0x5dc58a['predictiveIntervalAvgHoldtime'];_0x26dbae['predictiveIntervalAvgTalktime']=_0x5dc58a[_0x50af('0x44')];_0x26dbae[_0x50af('0x45')]=_0x5dc58a[_0x50af('0x45')];_0x26dbae[_0x50af('0x46')]=_0x5dc58a[_0x50af('0x46')];_0x26dbae[_0x50af('0x47')]=_0x5dc58a[_0x50af('0x47')];_0x26dbae[_0x50af('0x48')]=_0x5dc58a[_0x50af('0x48')];_0x26dbae[_0x50af('0x49')]=_0x5dc58a[_0x50af('0x49')];_0x26dbae[_0x50af('0x4a')]=_0x5dc58a[_0x50af('0x4a')];_0x26dbae[_0x50af('0x4b')]=_0x5dc58a[_0x50af('0x4b')];_0x26dbae[_0x50af('0x4c')]=_0x5dc58a['predictiveIntervalAvailable'];_0x26dbae[_0x50af('0x4d')]=_0x5dc58a[_0x50af('0x4d')];_0x26dbae[_0x50af('0x1a')]=_0x5dc58a['message'];_0x26dbae['originated']=_0x5dc58a[_0x50af('0x4e')];_0x26dbae[_0x50af('0x4f')]=_0x5dc58a[_0x50af('0x4f')];_0x26dbae[_0x50af('0x50')]=_0x5dc58a[_0x50af('0x50')];_0x26dbae[_0x50af('0x51')]=_0x5dc58a[_0x50af('0x51')];_0x26dbae[_0x50af('0x52')]=_0x5dc58a['erlangBusyFactor'];_0x26dbae['startPredictive']=_0x5dc58a[_0x50af('0x53')];_0x26dbae[_0x50af('0x54')]=_0x5dc58a['startProgressive'];}if(_0x5dc58a['Trunk']){_0x26dbae[_0x50af('0x55')]={'id':_0x5dc58a[_0x50af('0x55')]['id'],'name':_0x5dc58a[_0x50af('0x55')]['name'],'active':_0x5dc58a[_0x50af('0x55')][_0x50af('0x56')],'callerid':_0x5dc58a[_0x50af('0x55')][_0x50af('0x57')]};}if(_0x5dc58a[_0x50af('0x58')]){_0x26dbae[_0x50af('0x58')]={'id':_0x5dc58a[_0x50af('0x58')]['id'],'name':_0x5dc58a[_0x50af('0x58')][_0x50af('0xa')]};}_0x1550ee['push'](_0x26dbae);}}_0x4db72d({'count':_0x1550ee[_0x50af('0x59')],'rows':_0x1550ee});});},'UpdateVoiceQueue':function(_0x460567){return new Promise(function(_0x36cda0,_0x304400){var _0x5c562c=_['find'](_0x1cfefa['voiceQueues'],{'id':parseInt(_0x460567['id'])});var _0xf9ed7=_[_0x50af('0x5a')](_0x460567,['id']);if(_0x5c562c){for(var _0x567c42 in _0xf9ed7){if(typeof _0xf9ed7[_0x567c42]!==_0x50af('0x5b')&&typeof _0x5c562c[_0x567c42]!==_0x50af('0x5b')){_0x5c562c[_0x567c42]=_0xf9ed7[_0x567c42];}}_0x36cda0(_0x5c562c);}else{_0x304400();}});},'VoiceChannels':function(_0x398dad){return new Promise(function(_0x3f1397,_0x41f029){var _0xb64bed=_['values'](_0x1cfefa['channels']);_0x3f1397({'count':_0xb64bed[_0x50af('0x59')],'rows':_0xb64bed});});},'VoiceChannelMixMonitor':function(_0x1afbb9){var _0x26c466=this;return new Promise(function(_0x32efe9,_0x3a2f8e){if(ami[_0x50af('0x1c')]()==![]){return _0x3a2f8e(_0x26c466['error'](0x1f4,[config[_0x50af('0x13')]['ip'],config[_0x50af('0x13')]['username'],'ami\x20disconnected'][_0x50af('0x1e')]('\x20')));}var _0x1e4095=schema(properties[_0x50af('0x5c')])[_0x50af('0x2')](_0x1afbb9);if(_0x1e4095[_0x50af('0x59')]>0x0){return _0x3a2f8e(_0x26c466[_0x50af('0x12')](0x1f4,_[_0x50af('0x5d')](_0x1e4095,_0x50af('0x1a'))[_0x50af('0x1e')](',\x20')));}var _0x37ce38=_['find'](_0x1cfefa[_0x50af('0x5e')],{'uniqueid':_0x1afbb9[_0x50af('0x5f')]});if(_0x37ce38&&_0x37ce38[_0x50af('0x60')]){var _0x118031=util[_0x50af('0x9')]('%s.%s',_0x1afbb9['filename']||_0x1afbb9['uniqueid'],_0x1afbb9[_0x50af('0x9')]||'wav');return ami[_0x50af('0x18')]({'action':_0x50af('0x61'),'channel':_0x37ce38[_0x50af('0x60')],'file':_0x118031,'options':_0x50af('0x62')})[_0x50af('0x19')](function(_0x4fd3e8){var _0xf485ed=_[_0x50af('0x63')](_0x37ce38[_0x50af('0x64')],{'filename':_0x50af('0x65')+_0x118031[_0x50af('0x66')]()});if(_[_0x50af('0x67')](_0xf485ed)){_0x37ce38[_0x50af('0x64')]['push']({'filename':_0x50af('0x65')+_0x118031['toLowerCase'](),'createdAt':moment()[_0x50af('0x9')](_0x50af('0x68')),'mixmonitorid':_0x4fd3e8[_0x50af('0x69')],'status':_0x50af('0x6a')});}else{_0xf485ed['mixmonitorid']=_0x4fd3e8[_0x50af('0x69')];_0xf485ed[_0x50af('0x6b')]=_0x50af('0x6a');}_0x32efe9({'code':0xc8,'message':[_0x1afbb9[_0x50af('0x5f')],_0x50af('0x6c'),_0x4fd3e8[_0x50af('0x69')]]['join']('\x20'),'mixmonitorid':_0x4fd3e8[_0x50af('0x69')]});})[_0x50af('0x1b')](function(_0x453867){_0x3a2f8e(_0x26c466[_0x50af('0x12')](0x1f5,[_0x1afbb9[_0x50af('0x5f')],_0x453867[_0x50af('0x1a')][_0x50af('0x66')]()][_0x50af('0x1e')]('\x20')));});}else{return _0x3a2f8e(_0x26c466[_0x50af('0x12')](0x1f5,_0x50af('0x6d')));}});},'VoiceChannelStopMixMonitor':function(_0x4212cd){var _0x47ac0e=this;return new Promise(function(_0xba741a,_0x2a4d1e){if(ami[_0x50af('0x1c')]()==![]){return _0x2a4d1e(_0x47ac0e[_0x50af('0x12')](0x1f4,[config[_0x50af('0x13')]['ip'],config['asterisk'][_0x50af('0x14')],_0x50af('0x1d')][_0x50af('0x1e')]('\x20')));}var _0x241380=schema(properties[_0x50af('0x5c')])[_0x50af('0x2')](_0x4212cd);if(_0x241380[_0x50af('0x59')]>0x0){return _0x2a4d1e(_0x47ac0e[_0x50af('0x12')](0x1f4,_[_0x50af('0x5d')](_0x241380,_0x50af('0x1a'))[_0x50af('0x1e')](',\x20')));}var _0xf1fc63=_[_0x50af('0x63')](_0x1cfefa[_0x50af('0x5e')],{'uniqueid':_0x4212cd[_0x50af('0x5f')]});if(_0xf1fc63){return BPromise[_0x50af('0x6e')]()[_0x50af('0x19')](function(){if(_0xf1fc63['channel']){return ami[_0x50af('0x18')]({'action':_0x50af('0x6f'),'channel':_0xf1fc63[_0x50af('0x60')],'mixmonitorid':_0x4212cd[_0x50af('0x69')]})[_0x50af('0x1b')](function(_0x1d9153){});}})[_0x50af('0x19')](function(){if(_0xf1fc63['destinationchannel']){return ami[_0x50af('0x18')]({'action':_0x50af('0x6f'),'channel':_0xf1fc63[_0x50af('0x70')],'mixmonitorid':_0x4212cd['mixmonitorid']})[_0x50af('0x1b')](function(_0x13e742){});}})[_0x50af('0x19')](function(_0x641c96){var _0x5606a7=_[_0x50af('0x63')](_0xf1fc63[_0x50af('0x64')],{'mixmonitorid':_0x4212cd[_0x50af('0x69')]});if(_0x5606a7){_0x5606a7['status']=_0x50af('0x71');}})[_0x50af('0x19')](function(){var _0xe02b97=util[_0x50af('0x9')]('%s.%s',_0x4212cd[_0x50af('0x72')]||_0x4212cd[_0x50af('0x5f')],_0x4212cd[_0x50af('0x9')]||_0x50af('0x73'));var _0x1a7a10=_['find'](_0xf1fc63[_0x50af('0x64')],{'filename':_0x50af('0x65')+_0xe02b97['toLowerCase']()});if(_0x1a7a10){_0x1a7a10[_0x50af('0x6b')]='stop';}})[_0x50af('0x19')](function(){_0xba741a({'code':0xc8,'message':[_0x4212cd[_0x50af('0x5f')],_0x50af('0x74')][_0x50af('0x1e')]('\x20')});})[_0x50af('0x1b')](function(_0x446b42){_0x2a4d1e(_0x47ac0e[_0x50af('0x12')](0x1f5,[_0x4212cd[_0x50af('0x5f')],_0x446b42[_0x50af('0x1a')][_0x50af('0x66')]()][_0x50af('0x1e')]('\x20')));});}else{return _0x2a4d1e(_0x47ac0e[_0x50af('0x12')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannels':function(_0x205ccd){return new Promise(function(_0x110afa,_0x263dff){var _0x33bcfa=_['values'](_0x1cfefa[_0x50af('0x75')]);_0x110afa({'count':_0x33bcfa['length'],'rows':_0x33bcfa});});},'VoiceQueuesChannel':function(_0x28ce74){var _0x12d478=this;return new Promise(function(_0x2915b8,_0x58528a){var _0x56a577=schema(properties[_0x50af('0x76')])[_0x50af('0x2')](_0x28ce74);if(_0x56a577[_0x50af('0x59')]>0x0){return _0x58528a(_0x12d478['error'](0x1f4,_['map'](_0x56a577,_0x50af('0x1a'))[_0x50af('0x1e')](',\x20')));}var _0x3b71e0=_[_0x50af('0x63')](_0x1cfefa[_0x50af('0x75')],{'uniqueid':_0x28ce74[_0x50af('0x5f')]});if(_0x3b71e0){_0x2915b8(_0x3b71e0);}else{return _0x58528a(_0x12d478[_0x50af('0x12')](0x1f5,_0x50af('0x6d')));}});},'VoiceQueuesChannelHangup':function(_0x3e1b2a){var _0x5aebe7=this;return new Promise(function(_0x6d1ec,_0xe685c8){if(ami['isConnected']()==![]){return _0xe685c8(_0x5aebe7[_0x50af('0x12')](0x1f4,[config[_0x50af('0x13')]['ip'],config['asterisk'][_0x50af('0x14')],_0x50af('0x1d')]['join']('\x20')));}var _0x3502e0=schema(properties[_0x50af('0x77')])['validate'](_0x3e1b2a);if(_0x3502e0['length']>0x0){return _0xe685c8(_0x5aebe7[_0x50af('0x12')](0x1f4,_['map'](_0x3502e0,'message')[_0x50af('0x1e')](',\x20')));}var _0x5b4dcd=_[_0x50af('0x63')](_0x1cfefa['queueChannels'],{'uniqueid':_0x3e1b2a['uniqueid']});if(_0x5b4dcd&&_0x5b4dcd[_0x50af('0x60')]){return ami[_0x50af('0x18')]({'action':'Hangup','channel':_0x5b4dcd[_0x50af('0x60')]})[_0x50af('0x19')](function(_0x122605){_0x6d1ec({'code':0xc8,'message':[_0x3e1b2a[_0x50af('0x5f')],_0x122605[_0x50af('0x1a')]['toLowerCase']()][_0x50af('0x1e')]('\x20')});})[_0x50af('0x1b')](function(_0x57f096){_0xe685c8(_0x5aebe7[_0x50af('0x12')](0x1f5,[_0x3e1b2a[_0x50af('0x5f')],_0x57f096[_0x50af('0x1a')][_0x50af('0x66')]()]['join']('\x20')));});}else{return _0xe685c8(_0x5aebe7[_0x50af('0x12')](0x1f5,_0x50af('0x6d')));}});},'VoiceQueuesChannelRedirect':function(_0x4bd0b1){var _0x2ad059=this;return new Promise(function(_0x47227c,_0x2eeeb3){if(ami[_0x50af('0x1c')]()==![]){return _0x2eeeb3(_0x2ad059['error'](0x1f4,[config[_0x50af('0x13')]['ip'],config[_0x50af('0x13')]['username'],_0x50af('0x1d')]['join']('\x20')));}var _0x34cb1a=schema(properties['voicequeuechannelredirect'])[_0x50af('0x2')](_0x4bd0b1);if(_0x34cb1a[_0x50af('0x59')]>0x0){return _0x2eeeb3(_0x2ad059[_0x50af('0x12')](0x1f4,_[_0x50af('0x5d')](_0x34cb1a,_0x50af('0x1a'))[_0x50af('0x1e')](',\x20')));}var _0xe9f5ed=_[_0x50af('0x63')](_0x1cfefa[_0x50af('0x75')],{'uniqueid':_0x4bd0b1[_0x50af('0x5f')]});if(_0xe9f5ed&&_0xe9f5ed[_0x50af('0x60')]){return ami[_0x50af('0x18')]({'action':_0x50af('0x78'),'channel':_0xe9f5ed['channel'],'exten':_0x4bd0b1[_0x50af('0x79')],'context':_0x4bd0b1[_0x50af('0x7a')]||_0xe9f5ed[_0x50af('0x7a')],'priority':0x1})[_0x50af('0x19')](function(_0x2b3d4b){_0x47227c({'code':0xc8,'message':[_0x4bd0b1[_0x50af('0x5f')],_0x2b3d4b['message']['toLowerCase']()]['join']('\x20')});})['catch'](function(_0x2851ab){_0x2eeeb3(_0x2ad059['error'](0x1f5,[_0x4bd0b1[_0x50af('0x5f')],_0x2851ab[_0x50af('0x1a')][_0x50af('0x66')]()][_0x50af('0x1e')]('\x20')));});}else{return _0x2eeeb3(_0x2ad059[_0x50af('0x12')](0x1f5,_0x50af('0x6d')));}});},'Agents':function(_0x3758ba){return new Promise(function(_0x4d2c1a,_0x47eb2b){var _0x5605c8=_[_0x50af('0x7b')](_0x1cfefa[_0x50af('0xe')]);_0x4d2c1a({'count':_0x5605c8['length'],'rows':_0x5605c8});});},'Telephones':function(_0x1d5b0e){return new Promise(function(_0x1cfb8e,_0x39e945){var _0x61d448=_[_0x50af('0x7b')](_0x1cfefa[_0x50af('0x7c')]);_0x1cfb8e({'count':_0x61d448['length'],'rows':_0x61d448});});},'Trunks':function(_0x1b02da){return new Promise(function(_0xa4459a,_0x3d86d2){var _0x265acd=_[_0x50af('0x7b')](_0x1cfefa['trunks']);_0xa4459a({'count':_0x265acd[_0x50af('0x59')],'rows':_0x265acd});});},'OutboundChannels':function(_0x4a99c1){return new Promise(function(_0x199105,_0x43591d){var _0x3928d8=_[_0x50af('0x7b')](_0x1cfefa[_0x50af('0x7d')]);_0x199105({'count':_0x3928d8[_0x50af('0x59')],'rows':_0x3928d8});});},'Outbound':function(_0x4e06a5){return new Promise(function(_0x56a41b,_0x2d88e2){_0x56a41b(_0x1cfefa[_0x50af('0x7e')]);});},'Campaigns':function(_0x4bd935){return new Promise(function(_0x3ca112,_0x18ce7c){var _0x2ee04b=_[_0x50af('0x7b')](_0x1cfefa[_0x50af('0x7f')]);_0x3ca112({'count':_0x2ee04b['length'],'rows':_0x2ee04b});});},'VoiceQueuesPreview':function(_0x4b7b41){var _0x1b0660=this;return new Promise(function(_0x2d3516,_0x56c177){_0x4c7210[_0x50af('0x80')](_0x4b7b41['id'])[_0x50af('0x19')](function(_0x207bf8){_0x2d3516({'code':0xc8,'message':_0x207bf8[_0x50af('0x1a')]});})['catch'](function(_0x225ff4){_0x56c177(_0x1b0660[_0x50af('0x12')](0x1f4,_0x225ff4[_0x50af('0x1a')]));});});},'EventManager':function(_0x3a52d1){var _0xa38bfe=this;return new Promise(function(_0x5ca675,_0x121a36){if(!_0x3a52d1[_0x50af('0x81')]){return _0x121a36(_0xa38bfe[_0x50af('0x12')](0x1f4,'Event\x20name\x20mandatory'));}ami[_0x50af('0x82')](_0x50af('0x83')+_0x3a52d1[_0x50af('0x81')],_0x3a52d1[_0x50af('0x1a')]);_0x5ca675({'code':0xc8,'message':_0x3a52d1});});},'FaxAccounts':function(_0x58212a){return new Promise(function(_0x2f283a,_0x48e889){var _0x42ba29=_['values'](_0x1cfefa['faxAccounts']);_0x2f283a({'count':_0x42ba29[_0x50af('0x59')],'rows':_0x42ba29});});},'SendFax':function(_0x382037){var _0x5fa2f8=this;return new Promise(function(_0x2f7b7a,_0x4ac687){_0xe37b1[_0x50af('0x84')](_0x382037)['then'](function(_0x2e4571){_0x2f7b7a({'code':0xc8,'message':_0x2e4571[_0x50af('0x1a')]});})['catch'](function(_0x398aef){_0x4ac687(_0x5fa2f8[_0x50af('0x12')](0x1f4,_0x398aef[_0x50af('0x1a')]));});});},'CheckAfterSend':function(_0x30106e){var _0x2675e2=this;return new Promise(function(_0xea8e86,_0x2fbe8a){_0xe37b1[_0x50af('0x85')](_0x30106e)[_0x50af('0x19')](function(_0x5ac0b7){_0xea8e86({'code':0xc8,'message':_0x5ac0b7[_0x50af('0x1a')]});})[_0x50af('0x1b')](function(_0xc1c462){_0x2fbe8a(_0x2675e2['error'](0x1f4,_0xc1c462[_0x50af('0x1a')]));});});}};var _0x1fcc23=jayson[_0x50af('0x86')](_0x3724ed)[_0x50af('0x87')]();_0x1fcc23['on'](_0x50af('0x12'),function(_0x3ae264){return _0x5a5c0a(_0x3ae264);});_0x1fcc23[_0x50af('0x8')](0x232a,_0x50af('0x88'),function(){console['log'](_0x50af('0x89'),0x232a);return _0x5e94f8(_0x50af('0x8a')+0x232a);});});}; \ No newline at end of file +var _0x4fb4=['format','%s/%s','SIP','name','timers','timer','updateAcw','agents','updateStatusRealtime','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','Action','then','message','catch','Command','content','voiceQueues','strategy','answered','available','loggedIn','pTalking','sumBillable','total','unmanaged','abandoned','loggedInDb','type','outbound','dialActive','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','Interval','find','omit','undefined','channels','uniqueid','channel','%s.%s','filename','wav','MixMonitor','isNil','monitors','push','/var/spool/asterisk/monitor/','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','voicechannel','length','map','StopMixMonitor','destinationchannel','stop','StopMixMonitor\x20Success','values','queueChannels','voicequeuechannelhangup','Redirect','exten','context','trunks','campaigns','run','event','Event\x20name\x20mandatory','emit','custom:','faxAccounts','send','server','http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','util','jayson/promise','validate','bluebird','moment','../../../config/environment','../ami','listen'];(function(_0x592804,_0x335584){var _0x4a4a0f=function(_0xea45a7){while(--_0xea45a7){_0x592804['push'](_0x592804['shift']());}};_0x4a4a0f(++_0x335584);}(_0x4fb4,0x190));var _0x44fb=function(_0x1cae94,_0x131b14){_0x1cae94=_0x1cae94-0x0;var _0x1b2988=_0x4fb4[_0x1cae94];return _0x1b2988;};'use strict';var _=require('lodash');var util=require(_0x44fb('0x0'));var jayson=require(_0x44fb('0x1'));var schema=require(_0x44fb('0x2'));var BPromise=require(_0x44fb('0x3'));var moment=require(_0x44fb('0x4'));var config=require(_0x44fb('0x5'));var properties=require('../properties');var ami=require(_0x44fb('0x6'));exports[_0x44fb('0x7')]=function(_0x308b96,_0x26fbd6,_0x375d33){return new BPromise(function(_0x173e70,_0x464af5){var _0x2a4d75={'QueuePause':function(_0x59aa6d){return new Promise(function(_0x87f716,_0xd4ead0){var _0x5405a8=util[_0x44fb('0x8')](_0x44fb('0x9'),_0x44fb('0xa'),_0x59aa6d[_0x44fb('0xb')]);if(_0x308b96[_0x44fb('0xc')]&&_0x308b96[_0x44fb('0xc')][_0x5405a8]&&_0x308b96[_0x44fb('0xc')][_0x5405a8][_0x44fb('0xd')]){_0x308b96[_0x44fb('0xc')][_0x5405a8][_0x44fb('0xe')]();}if(_0x308b96['agents'][_0x5405a8]){_0x308b96[_0x44fb('0xf')][_0x5405a8][_0x44fb('0x10')]({'statePause':_0x59aa6d[_0x44fb('0x11')]?!![]:![]});}_0x87f716({'code':0xc8,'message':_0x44fb('0x12')});});},'Reload':function(_0x1c1cbc){var _0x47c87b=this;return new Promise(function(_0x1fc8fa,_0xaedd7f){if(ami[_0x44fb('0x13')]()==![]){return _0xaedd7f(_0x47c87b[_0x44fb('0x14')](0x1f4,[config[_0x44fb('0x15')]['ip'],config['asterisk'][_0x44fb('0x16')],_0x44fb('0x17')][_0x44fb('0x18')]('\x20')));}_0x1c1cbc=_[_0x44fb('0x19')](_0x1c1cbc,_[_0x44fb('0x1a')](properties[_0x44fb('0x1b')]));_0x1c1cbc[_0x44fb('0x1c')]='Reload';return ami[_0x44fb('0x1d')](_0x1c1cbc)[_0x44fb('0x1e')](function(_0x2e0efd){_0x1fc8fa({'code':0xc8,'message':_0x2e0efd[_0x44fb('0x1f')]});})[_0x44fb('0x20')](function(_0x22c2eb){_0xaedd7f(_0x47c87b[_0x44fb('0x14')](0x1f5,_0x22c2eb[_0x44fb('0x1f')]));});});},'Command':function(_0x44e6de){var _0x1fc48c=this;return new Promise(function(_0x5eafcb,_0x4bd157){if(ami['isConnected']()==![]){return _0x4bd157(_0x1fc48c[_0x44fb('0x14')](0x1f4,[config[_0x44fb('0x15')]['ip'],config[_0x44fb('0x15')]['username'],_0x44fb('0x17')][_0x44fb('0x18')]('\x20')));}_0x44e6de=_[_0x44fb('0x19')](_0x44e6de,'command');_0x44e6de['action']=_0x44fb('0x21');return ami[_0x44fb('0x1d')](_0x44e6de)[_0x44fb('0x1e')](function(_0x4fc66d){_0x5eafcb({'code':0xc8,'message':_0x4fc66d[_0x44fb('0x22')]});})[_0x44fb('0x20')](function(_0x1f3d5c){_0x4bd157(_0x1fc48c['error'](0x1f5,_0x1f3d5c['message']));});});},'VoiceQueues':function(_0x105b88){return new Promise(function(_0xa50a49,_0x1c831e){var _0x733c=[];for(var _0x5e7116 in _0x308b96[_0x44fb('0x23')]){if(_0x308b96[_0x44fb('0x23')]['hasOwnProperty'](_0x5e7116)){var _0x5b6ce5=_0x308b96[_0x44fb('0x23')][_0x5e7116];var _0x2611d6={'id':_0x5b6ce5['id'],'name':_0x5b6ce5[_0x44fb('0xb')],'strategy':_0x5b6ce5[_0x44fb('0x24')],'answered':_0x5b6ce5[_0x44fb('0x25')],'available':_0x5b6ce5[_0x44fb('0x26')],'loggedIn':_0x5b6ce5[_0x44fb('0x27')],'pTalking':_0x5b6ce5[_0x44fb('0x28')],'sumBillable':_0x5b6ce5[_0x44fb('0x29')],'sumDuration':_0x5b6ce5['sumDuration'],'sumHoldTime':_0x5b6ce5['sumHoldTime']||0x0,'talking':_0x5b6ce5['talking'],'total':_0x5b6ce5[_0x44fb('0x2a')],'type':_0x5b6ce5['type'],'unmanaged':_0x5b6ce5[_0x44fb('0x2b')],'abandoned':_0x5b6ce5[_0x44fb('0x2c')],'waiting':_0x5b6ce5['waiting'],'loggedInDb':_0x5b6ce5[_0x44fb('0x2d')]};if(_0x5b6ce5[_0x44fb('0x2e')]===_0x44fb('0x2f')){_0x2611d6[_0x44fb('0x30')]=_0x5b6ce5[_0x44fb('0x30')];_0x2611d6['dialMethod']=_0x5b6ce5['dialMethod'];_0x2611d6[_0x44fb('0x31')]=_0x5b6ce5['dialOriginateCallerIdName'];_0x2611d6[_0x44fb('0x32')]=_0x5b6ce5[_0x44fb('0x32')];_0x2611d6[_0x44fb('0x33')]=_0x5b6ce5[_0x44fb('0x33')];_0x2611d6[_0x44fb('0x34')]=_0x5b6ce5[_0x44fb('0x34')];_0x2611d6[_0x44fb('0x35')]=_0x5b6ce5[_0x44fb('0x35')];_0x2611d6[_0x44fb('0x36')]=_0x5b6ce5[_0x44fb('0x36')];_0x2611d6[_0x44fb('0x37')]=_0x5b6ce5[_0x44fb('0x37')];_0x2611d6[_0x44fb('0x38')]=_0x5b6ce5[_0x44fb('0x38')];_0x2611d6[_0x44fb('0x39')]=_0x5b6ce5['outboundBusyCallsDay'];_0x2611d6['outboundCongestionCallsDay']=_0x5b6ce5['outboundCongestionCallsDay'];_0x2611d6[_0x44fb('0x3a')]=_0x5b6ce5[_0x44fb('0x3a')];_0x2611d6[_0x44fb('0x3b')]=_0x5b6ce5[_0x44fb('0x3b')];_0x2611d6['outboundDropCallsDayTimeout']=_0x5b6ce5[_0x44fb('0x3c')];_0x2611d6[_0x44fb('0x3d')]=_0x5b6ce5['outboundNoAnswerCallsDay'];_0x2611d6[_0x44fb('0x3e')]=_0x5b6ce5['outboundNoSuchCallsDay'];_0x2611d6[_0x44fb('0x3f')]=_0x5b6ce5['outboundOriginateFailureCallsDay'];_0x2611d6[_0x44fb('0x40')]=_0x5b6ce5['outboundReCallsDay'];_0x2611d6[_0x44fb('0x41')]=_0x5b6ce5['outboundRejectCallsDay'];_0x2611d6['outboundUnknownCallsDay']=_0x5b6ce5[_0x44fb('0x42')];_0x2611d6[_0x44fb('0x43')]=_0x5b6ce5[_0x44fb('0x43')];_0x2611d6[_0x44fb('0x44')]=_0x5b6ce5[_0x44fb('0x44')];_0x2611d6[_0x44fb('0x45')]=_0x5b6ce5[_0x44fb('0x45')];_0x2611d6[_0x44fb('0x46')]=_0x5b6ce5[_0x44fb('0x46')];_0x2611d6[_0x44fb('0x47')]=_0x5b6ce5['predictiveIntervalDroppedCallsTimeout'];_0x2611d6[_0x44fb('0x48')]=_0x5b6ce5[_0x44fb('0x48')];_0x2611d6[_0x44fb('0x49')]=_0x5b6ce5[_0x44fb('0x49')];_0x2611d6[_0x44fb('0x4a')]=_0x5b6ce5['predictiveIntervalHitRate'];_0x2611d6[_0x44fb('0x4b')]=_0x5b6ce5[_0x44fb('0x4b')];_0x2611d6['predictiveIntervalPauses']=_0x5b6ce5['predictiveIntervalPauses'];_0x2611d6[_0x44fb('0x4c')]=_0x5b6ce5[_0x44fb('0x4c')];_0x2611d6[_0x44fb('0x4d')]=_0x5b6ce5['predictiveIntervalTotalCalls'];_0x2611d6[_0x44fb('0x1f')]=_0x5b6ce5[_0x44fb('0x1f')];_0x2611d6[_0x44fb('0x4e')]=_0x5b6ce5[_0x44fb('0x4e')];_0x2611d6[_0x44fb('0x4f')]=_0x5b6ce5[_0x44fb('0x4f')];_0x2611d6['erlangCallToSecond']=_0x5b6ce5[_0x44fb('0x50')];_0x2611d6['erlangAbandonmentRate']=_0x5b6ce5[_0x44fb('0x51')];_0x2611d6[_0x44fb('0x52')]=_0x5b6ce5[_0x44fb('0x52')];_0x2611d6[_0x44fb('0x53')]=_0x5b6ce5['startPredictive'];_0x2611d6[_0x44fb('0x54')]=_0x5b6ce5[_0x44fb('0x54')];}if(_0x5b6ce5[_0x44fb('0x55')]){_0x2611d6[_0x44fb('0x55')]={'id':_0x5b6ce5[_0x44fb('0x55')]['id'],'name':_0x5b6ce5['Trunk'][_0x44fb('0xb')],'active':_0x5b6ce5[_0x44fb('0x55')][_0x44fb('0x56')],'callerid':_0x5b6ce5[_0x44fb('0x55')]['callerid']};}if(_0x5b6ce5['Interval']){_0x2611d6[_0x44fb('0x57')]={'id':_0x5b6ce5[_0x44fb('0x57')]['id'],'name':_0x5b6ce5['Interval'][_0x44fb('0xb')]};}_0x733c['push'](_0x2611d6);}}_0xa50a49({'count':_0x733c['length'],'rows':_0x733c});});},'UpdateVoiceQueue':function(_0x5519d9){return new Promise(function(_0x5d5317,_0x396bdc){var _0x1a7acd=_[_0x44fb('0x58')](_0x308b96[_0x44fb('0x23')],{'id':parseInt(_0x5519d9['id'])});var _0x48fc96=_[_0x44fb('0x59')](_0x5519d9,['id']);if(_0x1a7acd){for(var _0x2bf1e0 in _0x48fc96){if(typeof _0x48fc96[_0x2bf1e0]!==_0x44fb('0x5a')&&typeof _0x1a7acd[_0x2bf1e0]!==_0x44fb('0x5a')){_0x1a7acd[_0x2bf1e0]=_0x48fc96[_0x2bf1e0];}}_0x5d5317(_0x1a7acd);}else{_0x396bdc();}});},'VoiceChannels':function(_0x1b6495){return new Promise(function(_0x204d54,_0x3eb4a1){var _0x15084d=_['values'](_0x308b96[_0x44fb('0x5b')]);_0x204d54({'count':_0x15084d['length'],'rows':_0x15084d});});},'VoiceChannelMixMonitor':function(_0x484529){var _0x304a0f=this;return new Promise(function(_0x16d8c2,_0x174e33){if(ami['isConnected']()==![]){return _0x174e33(_0x304a0f[_0x44fb('0x14')](0x1f4,[config[_0x44fb('0x15')]['ip'],config[_0x44fb('0x15')][_0x44fb('0x16')],_0x44fb('0x17')][_0x44fb('0x18')]('\x20')));}var _0x24eb8a=schema(properties['voicechannel'])[_0x44fb('0x2')](_0x484529);if(_0x24eb8a['length']>0x0){return _0x174e33(_0x304a0f[_0x44fb('0x14')](0x1f4,_['map'](_0x24eb8a,_0x44fb('0x1f'))[_0x44fb('0x18')](',\x20')));}var _0xf56878=_[_0x44fb('0x58')](_0x308b96['channels'],{'uniqueid':_0x484529[_0x44fb('0x5c')]});if(_0xf56878&&_0xf56878[_0x44fb('0x5d')]){var _0x247266=util[_0x44fb('0x8')](_0x44fb('0x5e'),_0x484529[_0x44fb('0x5f')]||_0x484529[_0x44fb('0x5c')],_0x484529[_0x44fb('0x8')]||_0x44fb('0x60'));return ami[_0x44fb('0x1d')]({'action':_0x44fb('0x61'),'channel':_0xf56878[_0x44fb('0x5d')],'file':_0x247266,'options':'ai(mixmonitorid)'})[_0x44fb('0x1e')](function(_0x4d0803){var _0x13a799=_[_0x44fb('0x58')](_0xf56878['monitors'],{'filename':'/var/spool/asterisk/monitor/'+_0x247266['toLowerCase']()});if(_[_0x44fb('0x62')](_0x13a799)){_0xf56878[_0x44fb('0x63')][_0x44fb('0x64')]({'filename':_0x44fb('0x65')+_0x247266[_0x44fb('0x66')](),'createdAt':moment()[_0x44fb('0x8')](_0x44fb('0x67')),'mixmonitorid':_0x4d0803[_0x44fb('0x68')],'status':_0x44fb('0x69')});}else{_0x13a799[_0x44fb('0x68')]=_0x4d0803[_0x44fb('0x68')];_0x13a799[_0x44fb('0x6a')]=_0x44fb('0x69');}_0x16d8c2({'code':0xc8,'message':[_0x484529[_0x44fb('0x5c')],_0x44fb('0x6b'),_0x4d0803[_0x44fb('0x68')]][_0x44fb('0x18')]('\x20'),'mixmonitorid':_0x4d0803[_0x44fb('0x68')]});})[_0x44fb('0x20')](function(_0x4dfba3){_0x174e33(_0x304a0f['error'](0x1f5,[_0x484529[_0x44fb('0x5c')],_0x4dfba3['message']['toLowerCase']()]['join']('\x20')));});}else{return _0x174e33(_0x304a0f[_0x44fb('0x14')](0x1f5,_0x44fb('0x6c')));}});},'VoiceChannelStopMixMonitor':function(_0x174fcf){var _0x55f28f=this;return new Promise(function(_0x986ca,_0x5ad3af){if(ami[_0x44fb('0x13')]()==![]){return _0x5ad3af(_0x55f28f['error'](0x1f4,[config[_0x44fb('0x15')]['ip'],config[_0x44fb('0x15')][_0x44fb('0x16')],'ami\x20disconnected'][_0x44fb('0x18')]('\x20')));}var _0x14cfc4=schema(properties[_0x44fb('0x6d')])['validate'](_0x174fcf);if(_0x14cfc4[_0x44fb('0x6e')]>0x0){return _0x5ad3af(_0x55f28f[_0x44fb('0x14')](0x1f4,_[_0x44fb('0x6f')](_0x14cfc4,'message')['join'](',\x20')));}var _0x1ed4a0=_[_0x44fb('0x58')](_0x308b96[_0x44fb('0x5b')],{'uniqueid':_0x174fcf[_0x44fb('0x5c')]});if(_0x1ed4a0){return BPromise['resolve']()['then'](function(){if(_0x1ed4a0[_0x44fb('0x5d')]){return ami[_0x44fb('0x1d')]({'action':_0x44fb('0x70'),'channel':_0x1ed4a0[_0x44fb('0x5d')],'mixmonitorid':_0x174fcf[_0x44fb('0x68')]})[_0x44fb('0x20')](function(_0x5a7d27){});}})[_0x44fb('0x1e')](function(){if(_0x1ed4a0[_0x44fb('0x71')]){return ami[_0x44fb('0x1d')]({'action':_0x44fb('0x70'),'channel':_0x1ed4a0['destinationchannel'],'mixmonitorid':_0x174fcf['mixmonitorid']})[_0x44fb('0x20')](function(_0xf0c095){});}})[_0x44fb('0x1e')](function(_0x5edbb9){var _0x269270=_['find'](_0x1ed4a0[_0x44fb('0x63')],{'mixmonitorid':_0x174fcf[_0x44fb('0x68')]});if(_0x269270){_0x269270[_0x44fb('0x6a')]=_0x44fb('0x72');}})[_0x44fb('0x1e')](function(){var _0x4796b1=util[_0x44fb('0x8')](_0x44fb('0x5e'),_0x174fcf[_0x44fb('0x5f')]||_0x174fcf[_0x44fb('0x5c')],_0x174fcf['format']||_0x44fb('0x60'));var _0x26a86e=_[_0x44fb('0x58')](_0x1ed4a0[_0x44fb('0x63')],{'filename':_0x44fb('0x65')+_0x4796b1[_0x44fb('0x66')]()});if(_0x26a86e){_0x26a86e[_0x44fb('0x6a')]=_0x44fb('0x72');}})[_0x44fb('0x1e')](function(){_0x986ca({'code':0xc8,'message':[_0x174fcf[_0x44fb('0x5c')],_0x44fb('0x73')][_0x44fb('0x18')]('\x20')});})[_0x44fb('0x20')](function(_0x2cb5c5){_0x5ad3af(_0x55f28f[_0x44fb('0x14')](0x1f5,[_0x174fcf[_0x44fb('0x5c')],_0x2cb5c5[_0x44fb('0x1f')][_0x44fb('0x66')]()][_0x44fb('0x18')]('\x20')));});}else{return _0x5ad3af(_0x55f28f['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannels':function(_0x3d51db){return new Promise(function(_0x3cc62c,_0x3781a9){var _0x1feabd=_[_0x44fb('0x74')](_0x308b96[_0x44fb('0x75')]);_0x3cc62c({'count':_0x1feabd['length'],'rows':_0x1feabd});});},'VoiceQueuesChannel':function(_0x56e968){var _0x40a471=this;return new Promise(function(_0x443b6b,_0x149e96){var _0x25d64f=schema(properties['voicequeuechannel'])[_0x44fb('0x2')](_0x56e968);if(_0x25d64f[_0x44fb('0x6e')]>0x0){return _0x149e96(_0x40a471[_0x44fb('0x14')](0x1f4,_[_0x44fb('0x6f')](_0x25d64f,_0x44fb('0x1f'))[_0x44fb('0x18')](',\x20')));}var _0xf77a1a=_[_0x44fb('0x58')](_0x308b96[_0x44fb('0x75')],{'uniqueid':_0x56e968[_0x44fb('0x5c')]});if(_0xf77a1a){_0x443b6b(_0xf77a1a);}else{return _0x149e96(_0x40a471['error'](0x1f5,_0x44fb('0x6c')));}});},'VoiceQueuesChannelHangup':function(_0x2d1bb9){var _0x5b9ba8=this;return new Promise(function(_0x4395ae,_0x443e66){if(ami['isConnected']()==![]){return _0x443e66(_0x5b9ba8[_0x44fb('0x14')](0x1f4,[config[_0x44fb('0x15')]['ip'],config[_0x44fb('0x15')]['username'],'ami\x20disconnected']['join']('\x20')));}var _0x1e506a=schema(properties[_0x44fb('0x76')])[_0x44fb('0x2')](_0x2d1bb9);if(_0x1e506a[_0x44fb('0x6e')]>0x0){return _0x443e66(_0x5b9ba8[_0x44fb('0x14')](0x1f4,_[_0x44fb('0x6f')](_0x1e506a,_0x44fb('0x1f'))[_0x44fb('0x18')](',\x20')));}var _0x55905f=_[_0x44fb('0x58')](_0x308b96[_0x44fb('0x75')],{'uniqueid':_0x2d1bb9[_0x44fb('0x5c')]});if(_0x55905f&&_0x55905f[_0x44fb('0x5d')]){return ami[_0x44fb('0x1d')]({'action':'Hangup','channel':_0x55905f[_0x44fb('0x5d')]})[_0x44fb('0x1e')](function(_0x31d02d){_0x4395ae({'code':0xc8,'message':[_0x2d1bb9['uniqueid'],_0x31d02d[_0x44fb('0x1f')][_0x44fb('0x66')]()][_0x44fb('0x18')]('\x20')});})[_0x44fb('0x20')](function(_0xcc7787){_0x443e66(_0x5b9ba8[_0x44fb('0x14')](0x1f5,[_0x2d1bb9[_0x44fb('0x5c')],_0xcc7787[_0x44fb('0x1f')][_0x44fb('0x66')]()][_0x44fb('0x18')]('\x20')));});}else{return _0x443e66(_0x5b9ba8[_0x44fb('0x14')](0x1f5,_0x44fb('0x6c')));}});},'VoiceQueuesChannelRedirect':function(_0x3d1f34){var _0x650ea9=this;return new Promise(function(_0x5aef90,_0x45045e){if(ami[_0x44fb('0x13')]()==![]){return _0x45045e(_0x650ea9[_0x44fb('0x14')](0x1f4,[config[_0x44fb('0x15')]['ip'],config[_0x44fb('0x15')][_0x44fb('0x16')],_0x44fb('0x17')][_0x44fb('0x18')]('\x20')));}var _0x34268f=schema(properties['voicequeuechannelredirect'])[_0x44fb('0x2')](_0x3d1f34);if(_0x34268f['length']>0x0){return _0x45045e(_0x650ea9[_0x44fb('0x14')](0x1f4,_[_0x44fb('0x6f')](_0x34268f,'message')['join'](',\x20')));}var _0x358042=_[_0x44fb('0x58')](_0x308b96['queueChannels'],{'uniqueid':_0x3d1f34[_0x44fb('0x5c')]});if(_0x358042&&_0x358042['channel']){return ami['Action']({'action':_0x44fb('0x77'),'channel':_0x358042[_0x44fb('0x5d')],'exten':_0x3d1f34[_0x44fb('0x78')],'context':_0x3d1f34[_0x44fb('0x79')]||_0x358042[_0x44fb('0x79')],'priority':0x1})['then'](function(_0x57191f){_0x5aef90({'code':0xc8,'message':[_0x3d1f34['uniqueid'],_0x57191f[_0x44fb('0x1f')][_0x44fb('0x66')]()][_0x44fb('0x18')]('\x20')});})[_0x44fb('0x20')](function(_0x2be4c5){_0x45045e(_0x650ea9[_0x44fb('0x14')](0x1f5,[_0x3d1f34[_0x44fb('0x5c')],_0x2be4c5[_0x44fb('0x1f')][_0x44fb('0x66')]()][_0x44fb('0x18')]('\x20')));});}else{return _0x45045e(_0x650ea9[_0x44fb('0x14')](0x1f5,_0x44fb('0x6c')));}});},'Agents':function(_0xf37376){return new Promise(function(_0x26c134,_0x55f5c8){var _0x8b4613=_['values'](_0x308b96[_0x44fb('0xf')]);_0x26c134({'count':_0x8b4613[_0x44fb('0x6e')],'rows':_0x8b4613});});},'Telephones':function(_0x5e1c14){return new Promise(function(_0x1792e7,_0x152963){var _0x2b5583=_[_0x44fb('0x74')](_0x308b96['telephones']);_0x1792e7({'count':_0x2b5583['length'],'rows':_0x2b5583});});},'Trunks':function(_0x173b35){return new Promise(function(_0x385c6b,_0x4a88bd){var _0x399142=_[_0x44fb('0x74')](_0x308b96[_0x44fb('0x7a')]);_0x385c6b({'count':_0x399142[_0x44fb('0x6e')],'rows':_0x399142});});},'OutboundChannels':function(_0x3fac48){return new Promise(function(_0x37db10,_0x1e7329){var _0x4f5c7f=_['values'](_0x308b96['outboundChannels']);_0x37db10({'count':_0x4f5c7f[_0x44fb('0x6e')],'rows':_0x4f5c7f});});},'Outbound':function(_0x4fd096){return new Promise(function(_0x385e5e,_0x2f677f){_0x385e5e(_0x308b96[_0x44fb('0x2f')]);});},'Campaigns':function(_0x15c6ee){return new Promise(function(_0x1294c1,_0x55a021){var _0x498fff=_['values'](_0x308b96[_0x44fb('0x7b')]);_0x1294c1({'count':_0x498fff[_0x44fb('0x6e')],'rows':_0x498fff});});},'VoiceQueuesPreview':function(_0x5ee6e1){var _0x268197=this;return new Promise(function(_0x55be2f,_0x4e7074){_0x26fbd6[_0x44fb('0x7c')](_0x5ee6e1['id'])[_0x44fb('0x1e')](function(_0x4c4843){_0x55be2f({'code':0xc8,'message':_0x4c4843[_0x44fb('0x1f')]});})[_0x44fb('0x20')](function(_0x214496){_0x4e7074(_0x268197[_0x44fb('0x14')](0x1f4,_0x214496['message']));});});},'EventManager':function(_0x20a3ec){var _0x35b928=this;return new Promise(function(_0x145f21,_0x11f460){if(!_0x20a3ec[_0x44fb('0x7d')]){return _0x11f460(_0x35b928[_0x44fb('0x14')](0x1f4,_0x44fb('0x7e')));}ami[_0x44fb('0x7f')](_0x44fb('0x80')+_0x20a3ec[_0x44fb('0x7d')],_0x20a3ec[_0x44fb('0x1f')]);_0x145f21({'code':0xc8,'message':_0x20a3ec});});},'FaxAccounts':function(_0x127bec){return new Promise(function(_0x10c4c9,_0x172fba){var _0x167293=_[_0x44fb('0x74')](_0x308b96[_0x44fb('0x81')]);_0x10c4c9({'count':_0x167293['length'],'rows':_0x167293});});},'SendFax':function(_0x3607a7){var _0x4bf099=this;return new Promise(function(_0x50f5bd,_0x215272){_0x375d33[_0x44fb('0x82')](_0x3607a7)[_0x44fb('0x1e')](function(_0x5a6ac3){_0x50f5bd({'code':0xc8,'message':_0x5a6ac3[_0x44fb('0x1f')]});})[_0x44fb('0x20')](function(_0x2a7f1a){_0x215272(_0x4bf099[_0x44fb('0x14')](0x1f4,_0x2a7f1a[_0x44fb('0x1f')]));});});},'CheckAfterSend':function(_0x158bfd){var _0x37aa8c=this;return new Promise(function(_0x45f8d3,_0x190e04){_0x375d33['checkAfterSend'](_0x158bfd)[_0x44fb('0x1e')](function(_0x41726c){_0x45f8d3({'code':0xc8,'message':_0x41726c['message']});})[_0x44fb('0x20')](function(_0x1a0c70){_0x190e04(_0x37aa8c[_0x44fb('0x14')](0x1f4,_0x1a0c70['message']));});});}};var _0x404e4a=jayson[_0x44fb('0x83')](_0x2a4d75)[_0x44fb('0x84')]();_0x404e4a['on'](_0x44fb('0x14'),function(_0x2257be){return _0x464af5(_0x2257be);});_0x404e4a[_0x44fb('0x7')](0x232a,_0x44fb('0x85'),function(){console[_0x44fb('0x86')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x173e70(_0x44fb('0x87')+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 cbd0ffd..fdc22f0 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 _0x75ec=['[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','isNil','calleridname','Unknown','destcalleridname','','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','format','user:%s','name','trigger:%s','action','toLowerCase','merge','bluebird','util','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults','socket.io-emitter','stringify','emit','exec','data2','xmd-contactid','ListId','data3','phone','$or','routeId','destcalleridnum','calleridnum','firstName','lastName','mobile','scheduledAt','union','resolve','then','getContacts','length','info','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','map','join'];(function(_0x10a630,_0x4fce3d){var _0x2df530=function(_0x380b7c){while(--_0x380b7c){_0x10a630['push'](_0x10a630['shift']());}};_0x2df530(++_0x4fce3d);}(_0x75ec,0x1cb));var _0xc75e=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0x75ec[_0x45d55e];return _0x29812a;};'use strict';var _=require('lodash');var BPromise=require(_0xc75e('0x0'));var Redis=require('ioredis');var util=require(_0xc75e('0x1'));var config=require(_0xc75e('0x2'));var logger=require(_0xc75e('0x3'))(_0xc75e('0x4'));var cmContactRpc=require(_0xc75e('0x5'));config[_0xc75e('0x6')]=_[_0xc75e('0x7')](config[_0xc75e('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0xc75e('0x8'))(new Redis(config[_0xc75e('0x6')]));function emit(_0x12b922,_0x26f760,_0x90c672,_0x16f6fd,_0x59d6a6){logger['info']('[CM][%s][%s]',_0x12b922,_0x26f760['id'],_0x90c672,_0x16f6fd,JSON[_0xc75e('0x9')](_0x59d6a6));io['to'](_0x90c672)[_0xc75e('0xa')](_0x16f6fd,_0x59d6a6);}exports[_0xc75e('0xb')]=function(_0x37a75a,_0x45ea31,_0x48d1fb,_0xaaf538){var _0x28411a,_0x3b8c55;var _0x5fefcc={};var _0x130145=Number(_0x48d1fb['data1']);var _0x39f600=_0x48d1fb[_0xc75e('0xc')]?Boolean(Number(_0x48d1fb[_0xc75e('0xc')])):![];var _0x321207;if(_0xaaf538[_0xc75e('0xd')]){_0x5fefcc['id']=_0xaaf538['xmd-contactid'];}if(!_0x5fefcc['id']){_0x5fefcc[_0xc75e('0xe')]=_0x130145;_0x321207=_0x48d1fb[_0xc75e('0xf')]&&_0x48d1fb['data3']!=='0'?_0x48d1fb['data3']['split'](','):[_0xc75e('0x10')];_0x5fefcc[_0xc75e('0x11')]=_['map'](_0x321207,function(_0x4749b4){var _0x1d8597={};_0x1d8597[_0x4749b4]=_0xaaf538[_0xc75e('0x12')]?_0xaaf538[_0xc75e('0x13')]:_0xaaf538[_0xc75e('0x14')];return _0x1d8597;});}var _0x352778=['id',_0xc75e('0x15'),_0xc75e('0x16'),'phone',_0xc75e('0x17'),'fax',_0xc75e('0xe'),'createdAt',_0xc75e('0x18'),'updatedAt'];var _0x1b71de=_[_0xc75e('0x19')](_0x352778,_0x321207);BPromise[_0xc75e('0x1a')]()[_0xc75e('0x1b')](cmContactRpc[_0xc75e('0x1c')]({'attributes':_0x1b71de,'where':_0x5fefcc}))[_0xc75e('0x1b')](function(_0x35f975){_0x3b8c55=_0x35f975;if(!_['isEmpty'](_0x3b8c55)){if(_0x3b8c55[_0xc75e('0x1d')]===0x1){_0x28411a=_0x3b8c55[0x0];logger[_0xc75e('0x1e')](_0xc75e('0x1f'),_0xaaf538[_0xc75e('0x20')],_0x45ea31['id'],_0x28411a['id']);}else{logger[_0xc75e('0x1e')](_0xc75e('0x21'),_0xaaf538['uniqueid'],_0x45ea31['id'],_[_0xc75e('0x22')](_0x3b8c55,'id')[_0xc75e('0x23')](','));}return;}else{logger[_0xc75e('0x1e')](_0xc75e('0x24'),_0xaaf538['uniqueid'],_0x45ea31['id']);var _0x3e1eca={'ListId':_0x130145};var _0x39e513=_0x48d1fb[_0xc75e('0x25')]&&_0x48d1fb[_0xc75e('0x25')]!=='0'?_0x48d1fb[_0xc75e('0x25')]:_0xc75e('0x10');if(_0x39f600){logger[_0xc75e('0x1e')](_0xc75e('0x26'),_0xaaf538[_0xc75e('0x20')],_0x45ea31['id']);_0x3e1eca[_0x39e513]=_[_0xc75e('0x27')](_0xaaf538[_0xc75e('0x12')])?_0xaaf538[_0xc75e('0x14')]:_0xaaf538[_0xc75e('0x13')];if(_[_0xc75e('0x27')](_0xaaf538[_0xc75e('0x12')])){_0x3e1eca['firstName']=_0xaaf538[_0xc75e('0x28')]&&_0xaaf538[_0xc75e('0x28')]!==''?_0xaaf538[_0xc75e('0x28')]:_0xc75e('0x29');}else{_0x3e1eca[_0xc75e('0x15')]=_0xaaf538[_0xc75e('0x2a')]&&_0xaaf538[_0xc75e('0x2a')]!==_0xc75e('0x2b')?_0xaaf538[_0xc75e('0x2a')]:_0xc75e('0x29');}return BPromise[_0xc75e('0x1a')]()['then'](cmContactRpc[_0xc75e('0x2c')](_0x3e1eca))['then'](function(_0xfed2e){_0x28411a=_0xfed2e;_0x3b8c55[_0xc75e('0x2d')](_0xfed2e);if(_0x28411a){logger[_0xc75e('0x1e')](_0xc75e('0x2e'),_0xaaf538[_0xc75e('0x20')],_0x45ea31['id'],_0x28411a['id']);}return;});}else{logger['info'](_0xc75e('0x2f'),_0xaaf538[_0xc75e('0x20')],_0x45ea31['id']);_0x3e1eca[_0x39e513]=_[_0xc75e('0x27')](_0xaaf538[_0xc75e('0x12')])?_0xaaf538[_0xc75e('0x14')]:_0xaaf538[_0xc75e('0x13')];if(_[_0xc75e('0x27')](_0xaaf538[_0xc75e('0x12')])){_0x3e1eca['firstName']=_0xaaf538['calleridname']&&_0xaaf538['calleridname']!==_0xc75e('0x2b')?_0xaaf538['calleridname']:_0xc75e('0x29');}else{_0x3e1eca[_0xc75e('0x15')]=_0xaaf538[_0xc75e('0x2a')]&&_0xaaf538[_0xc75e('0x2a')]!==_0xc75e('0x2b')?_0xaaf538[_0xc75e('0x2a')]:_0xc75e('0x29');}_0x28411a=_0x3e1eca;_0x3b8c55[_0xc75e('0x2d')](_0x3e1eca);return;}}})[_0xc75e('0x1b')](function(){if(_0x37a75a){emit(_0xaaf538[_0xc75e('0x20')],_0x45ea31,util[_0xc75e('0x30')](_0xc75e('0x31'),_0x37a75a[_0xc75e('0x32')]),util[_0xc75e('0x30')](_0xc75e('0x33'),_0x48d1fb[_0xc75e('0x34')][_0xc75e('0x35')]()),{'evt':_[_0xc75e('0x36')](_0xaaf538,{'autoCreate':_0x39f600}),'contact':_0x28411a===undefined?{}:_0x28411a,'contacts':_0x3b8c55[_0xc75e('0x1d')]===0x0?undefined:_0x3b8c55});}});}; \ No newline at end of file +var _0x752d=['toLowerCase','merge','lodash','bluebird','../../../../config/logger','trigger','../../rpc/cmContact','localhost','redis','info','[CM][%s][%s]','stringify','emit','data1','data2','xmd-contactid','ListId','data3','split','$or','map','routeId','destcalleridnum','calleridnum','firstName','lastName','phone','mobile','fax','createdAt','scheduledAt','updatedAt','union','resolve','then','getContacts','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','data4','[CM][%s][%s]\x20Autocreate\x20enabled','isNil','','calleridname','destcalleridname','Unknown','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','format','user:%s','trigger:%s','action'];(function(_0x2485f0,_0x4c7e92){var _0x541fb1=function(_0x59f00e){while(--_0x59f00e){_0x2485f0['push'](_0x2485f0['shift']());}};_0x541fb1(++_0x4c7e92);}(_0x752d,0xaa));var _0xd752=function(_0x2bb94b,_0x39ebc2){_0x2bb94b=_0x2bb94b-0x0;var _0x203521=_0x752d[_0x2bb94b];return _0x203521;};'use strict';var _=require(_0xd752('0x0'));var BPromise=require(_0xd752('0x1'));var Redis=require('ioredis');var util=require('util');var config=require('../../../../config/environment');var logger=require(_0xd752('0x2'))(_0xd752('0x3'));var cmContactRpc=require(_0xd752('0x4'));config['redis']=_['defaults'](config['redis'],{'host':_0xd752('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xd752('0x6')]));function emit(_0x22da26,_0x58e748,_0x3ab286,_0x15e3cd,_0x54229a){logger[_0xd752('0x7')](_0xd752('0x8'),_0x22da26,_0x58e748['id'],_0x3ab286,_0x15e3cd,JSON[_0xd752('0x9')](_0x54229a));io['to'](_0x3ab286)[_0xd752('0xa')](_0x15e3cd,_0x54229a);}exports['exec']=function(_0x19cca5,_0x29d7d1,_0x49e602,_0x40ebf2){var _0x8c0019,_0x4ef51a;var _0x41becf={};var _0x4842ca=Number(_0x49e602[_0xd752('0xb')]);var _0x54b2bf=_0x49e602[_0xd752('0xc')]?Boolean(Number(_0x49e602[_0xd752('0xc')])):![];var _0x50840a;if(_0x40ebf2['xmd-contactid']){_0x41becf['id']=_0x40ebf2[_0xd752('0xd')];}if(!_0x41becf['id']){_0x41becf[_0xd752('0xe')]=_0x4842ca;_0x50840a=_0x49e602[_0xd752('0xf')]&&_0x49e602[_0xd752('0xf')]!=='0'?_0x49e602['data3'][_0xd752('0x10')](','):['phone'];_0x41becf[_0xd752('0x11')]=_[_0xd752('0x12')](_0x50840a,function(_0x337a5b){var _0x1e9635={};_0x1e9635[_0x337a5b]=_0x40ebf2[_0xd752('0x13')]?_0x40ebf2[_0xd752('0x14')]:_0x40ebf2[_0xd752('0x15')];return _0x1e9635;});}var _0x3d940c=['id',_0xd752('0x16'),_0xd752('0x17'),_0xd752('0x18'),_0xd752('0x19'),_0xd752('0x1a'),_0xd752('0xe'),_0xd752('0x1b'),_0xd752('0x1c'),_0xd752('0x1d')];var _0x57fed1=_[_0xd752('0x1e')](_0x3d940c,_0x50840a);BPromise[_0xd752('0x1f')]()[_0xd752('0x20')](cmContactRpc[_0xd752('0x21')]({'attributes':_0x57fed1,'where':_0x41becf}))['then'](function(_0x50a254){_0x4ef51a=_0x50a254;if(!_['isEmpty'](_0x4ef51a)){if(_0x4ef51a[_0xd752('0x22')]===0x1){_0x8c0019=_0x4ef51a[0x0];logger[_0xd752('0x7')](_0xd752('0x23'),_0x40ebf2[_0xd752('0x24')],_0x29d7d1['id'],_0x8c0019['id']);}else{logger['info'](_0xd752('0x25'),_0x40ebf2['uniqueid'],_0x29d7d1['id'],_[_0xd752('0x12')](_0x4ef51a,'id')[_0xd752('0x26')](','));}return;}else{logger[_0xd752('0x7')]('[CM][%s][%s]\x20Contact\x20not\x20found',_0x40ebf2[_0xd752('0x24')],_0x29d7d1['id']);var _0x5bb4d3={'ListId':_0x4842ca};var _0x3ef683=_0x49e602[_0xd752('0x27')]&&_0x49e602[_0xd752('0x27')]!=='0'?_0x49e602[_0xd752('0x27')]:_0xd752('0x18');if(_0x54b2bf){logger[_0xd752('0x7')](_0xd752('0x28'),_0x40ebf2['uniqueid'],_0x29d7d1['id']);_0x5bb4d3[_0x3ef683]=_[_0xd752('0x29')](_0x40ebf2[_0xd752('0x13')])?_0x40ebf2['calleridnum']:_0x40ebf2[_0xd752('0x14')];if(_[_0xd752('0x29')](_0x40ebf2['routeId'])){_0x5bb4d3[_0xd752('0x16')]=_0x40ebf2['calleridname']&&_0x40ebf2['calleridname']!==_0xd752('0x2a')?_0x40ebf2[_0xd752('0x2b')]:'Unknown';}else{_0x5bb4d3['firstName']=_0x40ebf2['destcalleridname']&&_0x40ebf2['destcalleridname']!==_0xd752('0x2a')?_0x40ebf2[_0xd752('0x2c')]:_0xd752('0x2d');}return BPromise[_0xd752('0x1f')]()[_0xd752('0x20')](cmContactRpc[_0xd752('0x2e')](_0x5bb4d3))[_0xd752('0x20')](function(_0x130718){_0x8c0019=_0x130718;_0x4ef51a[_0xd752('0x2f')](_0x130718);if(_0x8c0019){logger[_0xd752('0x7')](_0xd752('0x30'),_0x40ebf2['uniqueid'],_0x29d7d1['id'],_0x8c0019['id']);}return;});}else{logger[_0xd752('0x7')](_0xd752('0x31'),_0x40ebf2['uniqueid'],_0x29d7d1['id']);_0x5bb4d3[_0x3ef683]=_['isNil'](_0x40ebf2[_0xd752('0x13')])?_0x40ebf2['calleridnum']:_0x40ebf2[_0xd752('0x14')];if(_['isNil'](_0x40ebf2[_0xd752('0x13')])){_0x5bb4d3['firstName']=_0x40ebf2[_0xd752('0x2b')]&&_0x40ebf2['calleridname']!==_0xd752('0x2a')?_0x40ebf2[_0xd752('0x2b')]:_0xd752('0x2d');}else{_0x5bb4d3['firstName']=_0x40ebf2['destcalleridname']&&_0x40ebf2[_0xd752('0x2c')]!==_0xd752('0x2a')?_0x40ebf2[_0xd752('0x2c')]:_0xd752('0x2d');}_0x8c0019=_0x5bb4d3;_0x4ef51a['push'](_0x5bb4d3);return;}}})[_0xd752('0x20')](function(){if(_0x19cca5){emit(_0x40ebf2[_0xd752('0x24')],_0x29d7d1,util[_0xd752('0x32')](_0xd752('0x33'),_0x19cca5['name']),util[_0xd752('0x32')](_0xd752('0x34'),_0x49e602[_0xd752('0x35')][_0xd752('0x36')]()),{'evt':_[_0xd752('0x37')](_0x40ebf2,{'autoCreate':_0x54b2bf}),'contact':_0x8c0019===undefined?{}:_0x8c0019,'contacts':_0x4ef51a[_0xd752('0x22')]===0x0?undefined:_0x4ef51a});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 7dbcf21..e41ad44 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 _0x26f5=['html','data2','render','template\x20not\x20found','buildUri','isNil','data3','data4','location','uriLocation','windowWidth','data5','windowHeight','data6','winApplication','winArguments','format','user:%s','interface','name','trigger:%s:%s','data1','merge','jscripty','exec','accounts','queue','urlforward','script','query','search','replace','channel','motionChannel','AllConditions','every','checkConditions','AnyConditions','field','account','chat','ChatWebsiteId','operator','value','AccountId','interaction','message','event','agent','membername','lastevent','routeId','exports','util','lodash','url','ioredis','./urlforward','./integration','./cmContact','../../../config/logger','trigger','../ami','localhost','socket.io-emitter','redis','popup','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','vtigerAccounts','custom:agentcalled','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:amd','custom:queuecallerabandon','syncAgentDial','custom:dialconnect','custom:newinteraction','custom:closedinteraction','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','prototype','emit','stringify','clone','voice','checkTriggers','hasOwnProperty','status','checkTrigger','variables','Actions','length','action','toLowerCase','contactmanager','motionbar','browser','TemplateId'];(function(_0x2d0bdc,_0x4b757f){var _0x2a95e0=function(_0x506486){while(--_0x506486){_0x2d0bdc['push'](_0x2d0bdc['shift']());}};_0x2a95e0(++_0x4b757f);}(_0x26f5,0x127));var _0x526f=function(_0xf19b33,_0x11c258){_0xf19b33=_0xf19b33-0x0;var _0xf5f5d2=_0x26f5[_0xf19b33];return _0xf5f5d2;};'use strict';var util=require(_0x526f('0x0'));var _=require(_0x526f('0x1'));var url=require(_0x526f('0x2'));var Mustache=require('mustache');var Redis=require(_0x526f('0x3'));var urlforward=require(_0x526f('0x4'));var integration=require(_0x526f('0x5'));var cmContact=require(_0x526f('0x6'));var script=require('./script');var config=require('../../../config/environment');var logger=require(_0x526f('0x7'))(_0x526f('0x8'));var ami=require(_0x526f('0x9'));config['redis']=_['defaults'](config['redis'],{'host':_0x526f('0xa'),'port':0x18eb});var io=require(_0x526f('0xb'))(new Redis(config[_0x526f('0xc')]));var operators={'equals':function(_0x16be15,_0x423e11){return _0x16be15==_0x423e11;},'not_equals':function(_0xa5c8d4,_0x423f6b){return _0xa5c8d4!=_0x423f6b;}};var barAndWebActions=[_0x526f('0xd'),_0x526f('0x2'),_0x526f('0xe')];function Trigger(_0xf29f4f){this['triggers']=_0xf29f4f[_0x526f('0xf')];this['agents']=_0xf29f4f[_0x526f('0x10')];this[_0x526f('0x11')]=_0xf29f4f[_0x526f('0x11')];this[_0x526f('0x12')]=_0xf29f4f[_0x526f('0x12')];this[_0x526f('0x13')]=_0xf29f4f[_0x526f('0x13')];this[_0x526f('0x14')]=_0xf29f4f[_0x526f('0x14')];this['freshdeskAccounts']=_0xf29f4f[_0x526f('0x15')];this[_0x526f('0x16')]=_0xf29f4f[_0x526f('0x16')];this[_0x526f('0x17')]=_0xf29f4f[_0x526f('0x17')];this[_0x526f('0x18')]=_0xf29f4f[_0x526f('0x18')];this[_0x526f('0x19')]=_0xf29f4f[_0x526f('0x19')];this['vtigerAccounts']=_0xf29f4f['vtigerAccounts'];this[_0x526f('0x1a')]=_0xf29f4f['servicenowAccounts'];this[_0x526f('0x1b')]=_0xf29f4f[_0x526f('0x1b')];this['freshsalesAccounts']=_0xf29f4f[_0x526f('0x1c')];this['accounts']={'zendesk':this[_0x526f('0x14')],'salesforce':this['salesforceAccounts'],'freshdesk':this[_0x526f('0x15')],'sugarcrm':this[_0x526f('0x17')],'zoho':this['zohoAccounts'],'desk':this[_0x526f('0x19')],'vtiger':this[_0x526f('0x1d')],'dynamics365':this[_0x526f('0x1b')],'freshsales':this[_0x526f('0x1c')],'servicenow':this['servicenowAccounts']};ami['on'](_0x526f('0x1e'),this[_0x526f('0x1f')][_0x526f('0x20')](this));ami['on'](_0x526f('0x21'),this[_0x526f('0x1f')][_0x526f('0x20')](this));ami['on'](_0x526f('0x22'),this[_0x526f('0x1f')][_0x526f('0x20')](this));ami['on'](_0x526f('0x23'),this[_0x526f('0x1f')][_0x526f('0x20')](this));ami['on'](_0x526f('0x24'),this['syncCustomEvent'][_0x526f('0x20')](this));ami['on'](_0x526f('0x25'),this[_0x526f('0x1f')]['bind'](this));ami['on'](_0x526f('0x26'),this[_0x526f('0x1f')][_0x526f('0x20')](this));ami['on'](_0x526f('0x27'),this[_0x526f('0x1f')][_0x526f('0x20')](this));ami['on']('custom:agentreject',this['syncCustomEvent'][_0x526f('0x20')](this));ami['on'](_0x526f('0x28'),this['syncCustomEvent'][_0x526f('0x20')](this));ami['on'](_0x526f('0x29'),this['syncCustomEvent'][_0x526f('0x20')](this));ami['on']('custom:timeout',this[_0x526f('0x1f')][_0x526f('0x20')](this));ami['on']('custom:dialbegin',this[_0x526f('0x2a')][_0x526f('0x20')](this));ami['on'](_0x526f('0x2b'),this['syncAgentDial'][_0x526f('0x20')](this));ami['on']('custom:dialend',this[_0x526f('0x2a')][_0x526f('0x20')](this));ami['on'](_0x526f('0x2c'),this[_0x526f('0x1f')][_0x526f('0x20')](this));ami['on'](_0x526f('0x2d'),this[_0x526f('0x1f')][_0x526f('0x20')](this));ami['on'](_0x526f('0x2e'),this[_0x526f('0x1f')]['bind'](this));ami['on'](_0x526f('0x2f'),this[_0x526f('0x1f')]['bind'](this));ami['on'](_0x526f('0x30'),this[_0x526f('0x1f')][_0x526f('0x20')](this));ami['on'](_0x526f('0x31'),this[_0x526f('0x1f')][_0x526f('0x20')](this));}Trigger[_0x526f('0x32')][_0x526f('0x33')]=function(_0x1200a5,_0x5dd58c,_0x4bd665){logger['info'](_0x1200a5,_0x5dd58c,JSON[_0x526f('0x34')](_0x4bd665));io['to'](_0x1200a5)['emit'](_0x5dd58c,_0x4bd665);};Trigger[_0x526f('0x32')]['syncCustomEvent']=function(_0x2006e2){var _0x2904ba=_[_0x526f('0x35')](_0x2006e2);if(typeof _0x2904ba['motionChannel']==='undefined'){_0x2904ba['motionChannel']=_0x526f('0x36');}this[_0x526f('0x37')](_0x2904ba);};Trigger[_0x526f('0x32')][_0x526f('0x2a')]=function(_0xb5b13d){if(this['agents'][_0xb5b13d['interface']]){this[_0x526f('0x1f')](_0xb5b13d);}};Trigger[_0x526f('0x32')][_0x526f('0x37')]=function(_0x35484d){var _0x57376e;for(var _0x21aac5 in this[_0x526f('0xf')]){if(this['triggers'][_0x526f('0x38')](_0x21aac5)){if(this['triggers'][_0x21aac5][_0x526f('0x39')]){_0x57376e=this[_0x526f('0x3a')](this[_0x526f('0xf')][_0x21aac5],_0x35484d);if(_0x57376e){_['merge'](_0x35484d,_0x35484d[_0x526f('0x3b')]);for(var _0x3277de=0x0,_0x144a15,_0x374569,_0x3339b8;_0x3277de0x0){_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 _0x55ca=['debug','[HTTP]','stringify','GET','authType','basic','%s:%s','username','token','%s/token:%s','toString','base64','Searching\x20enduser\x20with\x20phone','Enduser\x20found!','_embedded','entries','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','length','forEach','includes','picklist','type','nameField','customField','toLowerCase','content','string','idField','custom_fields','variable','variableName','customVariable','Variable','name','priority','merge','xCALLY','Motion','CTI','concat','Tags','getString','Descriptions','/api/v2/users/%d','user','Fields','stripTrailingSlash','serverUrl','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','calleridname','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','integrationTab','user:%s','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','error','Desk\x20account\x20type\x20not\x20recognized','outbound','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','%s/agent/tickets/%s','catch','unmanaged','monitor_format','lastevent','toUpperCase','Recording\x20is\x20enabled!','lodash','request-promise','./util','../../../../config/environment','desk','redis','defaults','localhost','socket.io-emitter','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','format','%s/users','remoteUri','then','total_entries','find','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me'];(function(_0x3dc969,_0x224fea){var _0x52725a=function(_0x49aec2){while(--_0x49aec2){_0x3dc969['push'](_0x3dc969['shift']());}};_0x52725a(++_0x224fea);}(_0x55ca,0x126));var _0xa55c=function(_0x3212cc,_0x3bfe46){_0x3212cc=_0x3212cc-0x0;var _0x3ecd2c=_0x55ca[_0x3212cc];return _0x3ecd2c;};'use strict';var _=require(_0xa55c('0x0'));var rp=require(_0xa55c('0x1'));var md5=require('md5');var util=require('util');var Redis=require('ioredis');var intUtil=require(_0xa55c('0x2'));var config=require(_0xa55c('0x3'));var logger=require('../../../../config/logger')(_0xa55c('0x4'));config[_0xa55c('0x5')]=_[_0xa55c('0x6')](config[_0xa55c('0x5')],{'host':_0xa55c('0x7'),'port':0x18eb});var io=require(_0xa55c('0x8'))(new Redis(config[_0xa55c('0x5')]));function emit(_0x4d0624,_0x2121fd,_0x2537f0){io['to'](_0x4d0624)['emit'](_0x2121fd,_0x2537f0);}var headers={'Content-Type':_0xa55c('0x9'),'Accept':_0xa55c('0x9')};function getUser(_0x52a3bc,_0x5849ad){if(intUtil[_0xa55c('0xa')](_0x5849ad)===!![]){logger[_0xa55c('0xb')](_0xa55c('0xc'),_0x5849ad);return request({'uri':util[_0xa55c('0xd')](_0xa55c('0xe'),_0x52a3bc[_0xa55c('0xf')])})[_0xa55c('0x10')](function(_0x70c2de){if(_0x70c2de[_0xa55c('0x11')]){return _[_0xa55c('0x12')](_0x70c2de['_embedded']['entries'],{'email':_0x5849ad});}})[_0xa55c('0x10')](function(_0x576044){if(_0x576044){logger['info']('Agent\x20found!');return _0x576044;}else{logger[_0xa55c('0xb')](_0xa55c('0x13'));return request({'uri':util[_0xa55c('0xd')](_0xa55c('0x14'),_0x52a3bc[_0xa55c('0xf')])});}});}else{logger[_0xa55c('0xb')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xa55c('0xd')](_0xa55c('0x14'),_0x52a3bc[_0xa55c('0xf')])});}}function request(_0x31e10d){logger[_0xa55c('0x15')](_0xa55c('0x16'),JSON[_0xa55c('0x17')](_0x31e10d));return rp(_[_0xa55c('0x6')](_0x31e10d,{'method':_0xa55c('0x18'),'headers':headers,'json':!![]}));}function getAuth(_0x4cee3c){var _0x3d4c9e;if(_0x4cee3c[_0xa55c('0x19')]===_0xa55c('0x1a')){_0x3d4c9e=util[_0xa55c('0xd')](_0xa55c('0x1b'),_0x4cee3c[_0xa55c('0x1c')],_0x4cee3c['password']);}else if(_0x4cee3c['authType']===_0xa55c('0x1d')){_0x3d4c9e=util[_0xa55c('0xd')](_0xa55c('0x1e'),_0x4cee3c['username'],_0x4cee3c[_0xa55c('0x1d')]);}return util[_0xa55c('0xd')]('Basic\x20%s',new Buffer(_0x3d4c9e)[_0xa55c('0x1f')](_0xa55c('0x20')));}function getEndUser(_0x940f28,_0x1965f1,_0x234372){logger['info'](_0xa55c('0x21'),_0x234372);return request({'uri':util['format']('%s/customers/search',_0x940f28['remoteUri']),'qs':{'phone':_0x234372}})[_0xa55c('0x10')](function(_0x54b038){if(_0x54b038[_0xa55c('0x11')]){logger[_0xa55c('0xb')](_0xa55c('0x22'));return _0x54b038[_0xa55c('0x23')][_0xa55c('0x24')][0x0];}else{logger[_0xa55c('0xb')](_0xa55c('0x25'));return request({'uri':util[_0xa55c('0xd')](_0xa55c('0x26'),_0x940f28[_0xa55c('0xf')]),'method':_0xa55c('0x27'),'body':{'first_name':_0x1965f1,'title':_0x1965f1,'phone_numbers':[{'type':'work','value':_0x234372}]}});}});}function getTags(_0x430d55,_0x28814f){var _0x1c9f6b=[];if(_0x430d55&&_0x430d55[_0xa55c('0x28')]>0x0){_0x1c9f6b=_['map'](_0x430d55,_0x28814f);}return _0x1c9f6b;}function getCustomFields(_0x1377b0,_0x22f6b6){var _0x1b8388=[];var _0x201941={'custom_fields':{}};if(_0x1377b0[_0xa55c('0x28')]>0x0){_[_0xa55c('0x29')](_0x1377b0,function(_0x52d37f){if(_[_0xa55c('0x2a')](['string',_0xa55c('0x2b')],_0x52d37f[_0xa55c('0x2c')])&&_0x52d37f[_0xa55c('0x2d')]&&!_0x52d37f[_0xa55c('0x2e')]){_0x201941[_0x52d37f['nameField'][_0xa55c('0x2f')]()]=_0x52d37f[_0xa55c('0x30')][_0xa55c('0x1f')]();}else if(_[_0xa55c('0x2a')]([_0xa55c('0x31'),_0xa55c('0x2b')],_0x52d37f[_0xa55c('0x2c')])&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x201941[_0xa55c('0x33')][_0x52d37f[_0xa55c('0x32')]]=_0x52d37f['content']['toString']();}else if(_0x52d37f[_0xa55c('0x2c')]===_0xa55c('0x34')&&_0x52d37f['variableName']&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x22f6b6[_0x52d37f[_0xa55c('0x35')]]&&(_0x201941[_0xa55c('0x33')][_0x52d37f[_0xa55c('0x32')]]=_0x22f6b6[_0x52d37f[_0xa55c('0x35')]][_0xa55c('0x1f')]());}else if(_0x52d37f[_0xa55c('0x2c')]===_0xa55c('0x36')&&_0x52d37f['Variable']&&_0x52d37f['Variable']['name']&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x22f6b6[_0x52d37f[_0xa55c('0x37')]['name'][_0xa55c('0x2f')]()]&&(_0x201941['custom_fields'][_0x52d37f[_0xa55c('0x32')]]=_0x22f6b6[_0x52d37f['Variable'][_0xa55c('0x38')][_0xa55c('0x2f')]()][_0xa55c('0x1f')]());}});}if(_0x201941['priority']){_0x201941[_0xa55c('0x39')]=Number(_0x201941[_0xa55c('0x39')]);}return _0x201941;}function getTicket(_0x47e93c,_0x6f9c4c,_0x194e78,_0x4d9083,_0x529ff8){logger[_0xa55c('0xb')]('Creating\x20new\x20ticket...');var _0x1e75dc=_[_0xa55c('0x3a')]({'subject':intUtil['getString'](_0x4d9083['Subjects'],_0x529ff8,'\x20'),'type':'phone','status':'new','labels':[_0xa55c('0x3b'),_0xa55c('0x3c'),_0xa55c('0x3d')][_0xa55c('0x3e')](getTags(_0x4d9083[_0xa55c('0x3f')],'name')),'description':intUtil[_0xa55c('0x40')](_0x4d9083[_0xa55c('0x41')],_0x529ff8,'\x0a'),'_links':{'assigned_user':{'href':util[_0xa55c('0xd')](_0xa55c('0x42'),_0x6f9c4c['id']),'class':_0xa55c('0x43')}},'message':{'direction':'in','body':intUtil[_0xa55c('0x40')](_0x4d9083['Descriptions'],_0x529ff8,'\x0a')}},getCustomFields(_0x4d9083[_0xa55c('0x44')],_0x529ff8));return request({'uri':util['format']('%s/customers/%d/cases',_0x47e93c[_0xa55c('0xf')],_0x194e78['id']),'method':_0xa55c('0x27'),'body':_0x1e75dc});}exports['queue']=function(_0x2bd98b,_0x508bd3,_0x5f25f7,_0x2f8449,_0x3fea03,_0x1630ac){var _0x540337,_0x1b2708;_0x1630ac[_0xa55c('0xf')]=intUtil['stripTrailingSlash'](_0x1630ac[_0xa55c('0xf')]);_0x1630ac['serverUrl']=intUtil[_0xa55c('0x45')](_0x1630ac[_0xa55c('0x46')]);if(_0x3fea03&&_0x3fea03['monitor_format']){logger[_0xa55c('0xb')](_0xa55c('0x47'),'Recording\x20is\x20enabled!');_0x508bd3[_0xa55c('0x48')]=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x1630ac['serverUrl'],_0x508bd3[_0xa55c('0x4a')],md5(_0x508bd3['uniqueid']));}else{_0x508bd3[_0xa55c('0x48')]='';}headers[_0xa55c('0x4b')]=getAuth(_0x1630ac);return getUser(_0x1630ac,_0x2f8449[_0xa55c('0x4c')])['then'](function(_0x41eab1){_0x540337=_0x41eab1;logger[_0xa55c('0xb')]('The\x20User\x20ID\x20is:',_0x540337['id']);return getEndUser(_0x1630ac,_0x508bd3[_0xa55c('0x4d')],_0x508bd3[_0xa55c('0x4e')]);})['then'](function(_0x11ff1d){_0x1b2708=_0x11ff1d;logger[_0xa55c('0xb')]('The\x20Enduser\x20ID\x20is:',_0x1b2708['id']);return getTicket(_0x1630ac,_0x540337,_0x1b2708,_0x5f25f7,_0x508bd3);})[_0xa55c('0x10')](function(_0x81cee8){if(_0x81cee8){logger[_0xa55c('0xb')](_0xa55c('0x4f'));logger['info'](_0xa55c('0x50'),_0x81cee8['id']);switch(_0x1630ac['type']){case _0xa55c('0x51'):logger[_0xa55c('0xb')](_0xa55c('0x47'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2f8449['name']),_0xa55c('0x53'),{'recordId':_0x81cee8['id']});break;case _0xa55c('0x54'):logger[_0xa55c('0xb')](_0xa55c('0x47'),_0xa55c('0x55'));emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2f8449[_0xa55c('0x38')]),_0xa55c('0x56'),{'uri':util[_0xa55c('0xd')]('https://xcally.desk.com/web/agent/case/%d',_0x81cee8['id'])});break;default:logger[_0xa55c('0x57')](_0xa55c('0x47'),_0xa55c('0x58'));}}})['catch'](function(_0x4c3095){console[_0xa55c('0x57')](_0x4c3095);logger['error'](_0xa55c('0x47'),JSON['stringify'](_0x4c3095));});};exports[_0xa55c('0x59')]=function(_0x228df4,_0x181802,_0x3f9313,_0x2ecf79,_0x5b1cf3,_0x44b7c1,_0x4607ca){var _0x4b85cc,_0x3929a6;_0x44b7c1[_0xa55c('0xf')]=intUtil[_0xa55c('0x45')](_0x44b7c1[_0xa55c('0xf')]);_0x44b7c1['serverUrl']=intUtil['stripTrailingSlash'](_0x44b7c1[_0xa55c('0x46')]);if(_0x4607ca&&_0x4607ca[_0xa55c('0x5a')]&&_0x4607ca[_0xa55c('0x5a')]!==_0xa55c('0x5b')){logger['info'](_0xa55c('0x5c'),'Recording\x20is\x20enabled!');_0x181802[_0xa55c('0x48')]=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x44b7c1[_0xa55c('0x46')],_0x181802[_0xa55c('0x4a')],md5(_0x181802['uniqueid']));}headers[_0xa55c('0x4b')]=getAuth(_0x44b7c1);return getUser(_0x44b7c1,_0x2ecf79['email'])[_0xa55c('0x10')](function(_0x157afe){_0x4b85cc=_0x157afe;logger[_0xa55c('0xb')](_0xa55c('0x5d'),_0x4b85cc['id']);return getEndUser(_0x44b7c1,_0x181802[_0xa55c('0x5e')],_0x181802[_0xa55c('0x5f')]);})[_0xa55c('0x10')](function(_0x53e2be){_0x3929a6=_0x53e2be;logger[_0xa55c('0xb')](_0xa55c('0x60'),_0x3929a6['id']);return getTicket(_0x44b7c1,_0x4b85cc,_0x3929a6,_0x3f9313,_0x181802);})[_0xa55c('0x10')](function(_0x23a30e){if(_0x23a30e){logger[_0xa55c('0xb')]('Ticket\x20created!');logger[_0xa55c('0xb')](_0xa55c('0x50'),_0x23a30e['id']);switch(_0x44b7c1[_0xa55c('0x2c')]){case _0xa55c('0x51'):logger[_0xa55c('0xb')]('[QUEUE]',_0xa55c('0x61'));emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2ecf79[_0xa55c('0x38')]),_0xa55c('0x53'),{'recordId':_0x23a30e['id']});break;case'newTab':logger[_0xa55c('0xb')]('[QUEUE]',_0xa55c('0x55'));emit(util['format'](_0xa55c('0x52'),_0x2ecf79['name']),_0xa55c('0x56'),{'uri':util[_0xa55c('0xd')](_0xa55c('0x62'),_0x44b7c1[_0xa55c('0xf')],_0x23a30e['id'])});break;default:logger[_0xa55c('0x57')](_0xa55c('0x5c'),_0xa55c('0x58'));}}})[_0xa55c('0x63')](function(_0x14b515){logger[_0xa55c('0x57')]('[OUTBOUND]',JSON[_0xa55c('0x17')](_0x14b515));});};exports[_0xa55c('0x64')]=function(_0x4ef914,_0x18b928,_0x2b8b88,_0x3e3b4b,_0x9fe234,_0x1b8b06){var _0xa38271,_0x3cef1f;_0x1b8b06[_0xa55c('0xf')]=intUtil['stripTrailingSlash'](_0x1b8b06[_0xa55c('0xf')]);_0x1b8b06[_0xa55c('0x46')]=intUtil[_0xa55c('0x45')](_0x1b8b06[_0xa55c('0x46')]);if(_0x9fe234&&_0x9fe234[_0xa55c('0x65')]){logger[_0xa55c('0xb')]('['+_0x18b928[_0xa55c('0x66')][_0xa55c('0x67')]()+']',_0xa55c('0x68'));_0x18b928['recordingURL']=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x1b8b06[_0xa55c('0x46')],_0x18b928[_0xa55c('0x4a')],md5(_0x18b928[_0xa55c('0x4a')]));}else{_0x18b928[_0xa55c('0x48')]='';}headers[_0xa55c('0x4b')]=getAuth(_0x1b8b06);return getUser(_0x1b8b06)[_0xa55c('0x10')](function(_0x2e4cf7){_0xa38271=_0x2e4cf7;logger[_0xa55c('0xb')](_0xa55c('0x5d'),_0xa38271['id']);return getEndUser(_0x1b8b06,_0x18b928['calleridname'],_0x18b928[_0xa55c('0x4e')]);})['then'](function(_0x1228a4){_0x3cef1f=_0x1228a4;logger[_0xa55c('0xb')](_0xa55c('0x60'),_0x3cef1f['id']);return getTicket(_0x1b8b06,_0xa38271,_0x3cef1f,_0x2b8b88,_0x18b928);})['then'](function(_0x4d9722){if(_0x4d9722){logger[_0xa55c('0xb')](_0xa55c('0x4f'));logger[_0xa55c('0xb')](_0xa55c('0x50'),_0x4d9722['id']);}})['catch'](function(_0x149cb9){logger[_0xa55c('0x57')]('['+_0x18b928[_0xa55c('0x66')][_0xa55c('0x67')]()+']',JSON[_0xa55c('0x17')](_0x149cb9));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js index c492775..8beba4e 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 _0xe5f8=[']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','catch','outbound','destcalleridnum','calleridnum','contacts','/systemusers(','headers','odata-entityid','substring','lastIndexOf','enduserId','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','replace','value','telephone1',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','forEach','string','picklist','nameField','customField','idField','indexOf','content','ticketType','incidents','assign','getString','Descriptions','/contacts(','phonecall','callDirection','queue','Fields','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','https://login.microsoftonline.com/%s/oauth2/token','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','recordingURL','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!',']\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','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...','ticketId','error','inspect','lodash','bluebird','util','./util','md5','../../../../config/logger','dynamics365','defaults','redis','localhost','POST','clientId','remoteUri','username','password','clientSecret','then','access_token','toUpperCase','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','isNil','validateEmail','email','userEmail','length','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','userId'];(function(_0x77d286,_0x1ddc6d){var _0x5446a5=function(_0x45e2cf){while(--_0x45e2cf){_0x77d286['push'](_0x77d286['shift']());}};_0x5446a5(++_0x1ddc6d);}(_0xe5f8,0x165));var _0x8e5f=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xe5f8[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x8e5f('0x0'));var BPromise=require(_0x8e5f('0x1'));var rp=require('request-promise');var util=require(_0x8e5f('0x2'));var intUtil=require(_0x8e5f('0x3'));var md5=require(_0x8e5f('0x4'));var Redis=require('ioredis');var logger=require(_0x8e5f('0x5'))(_0x8e5f('0x6'));var config=require('../../../../config/environment');config['redis']=_[_0x8e5f('0x7')](config[_0x8e5f('0x8')],{'host':_0x8e5f('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function getAuthToken(_0x580569,_0xdcc93d,_0x3adf38){var _0x3e7c06={'method':_0x8e5f('0xa'),'uri':_0xdcc93d,'form':{'client_id':_0x580569[_0x8e5f('0xb')],'resource':_0x580569[_0x8e5f('0xc')],'username':_0x580569[_0x8e5f('0xd')],'password':_0x580569[_0x8e5f('0xe')],'grant_type':_0x8e5f('0xe'),'client_secret':_0x580569[_0x8e5f('0xf')]},'json':!![]};return rp(_0x3e7c06)[_0x8e5f('0x10')](function(_0xe22478){return _0xe22478[_0x8e5f('0x11')];})['catch'](function(_0x3145ce){logger['error']('['+[_0x3adf38[_0x8e5f('0x12')]()]+']\x20Wrong\x20credentials!');return _0x3145ce[_0x8e5f('0x13')];});}function getUser(_0x2e8662,_0x4986cc,_0x4d0b41,_0x174d77,_0x38f27c,_0x1cd67e){return new BPromise(function(_0x57ce37,_0x198062){return getAuthToken(_0x4986cc,_0x174d77,_0x1cd67e)['then'](function(_0x407e98){var _0x31f0dc={'method':_0x8e5f('0x14'),'uri':_0x38f27c+_0x8e5f('0x15'),'headers':{'Authorization':_0x8e5f('0x16')+_0x407e98,'OData-Version':_0x8e5f('0x17')},'json':!![]};return rp(_0x31f0dc);})['then'](function(_0x2ec2d2){var _0x13aebc=_0x2ec2d2['value'];var _0x11f295=![];var _0x2149ec=null;if(!_[_0x8e5f('0x18')](_0x4d0b41)){if(intUtil[_0x8e5f('0x19')](_0x4d0b41[_0x8e5f('0x1a')])){_0x2e8662[_0x8e5f('0x1b')]=_0x4d0b41[_0x8e5f('0x1a')];for(_0x2149ec=0x0;_0x2149ec<_0x13aebc[_0x8e5f('0x1c')];_0x2149ec++){if(_0x13aebc[_0x2149ec][_0x8e5f('0x1d')]===_0x4d0b41[_0x8e5f('0x1a')]&&!_0x13aebc[_0x2149ec][_0x8e5f('0x1e')]){_0x11f295=!![];logger[_0x8e5f('0x1f')]('['+[_0x1cd67e[_0x8e5f('0x12')]()]+_0x8e5f('0x20')+_0x13aebc[_0x2149ec][_0x8e5f('0x21')]+'!');_0x2e8662[_0x8e5f('0x22')]=_0x13aebc[_0x2149ec][_0x8e5f('0x21')];}}}}if(!_0x11f295){logger[_0x8e5f('0x1f')]('['+[_0x1cd67e[_0x8e5f('0x12')]()]+_0x8e5f('0x23'));_0x2e8662[_0x8e5f('0x1b')]=_0x4986cc[_0x8e5f('0xd')];for(_0x2149ec=0x0;_0x2149ec<_0x13aebc['length'];_0x2149ec++){if(_0x13aebc[_0x2149ec]['internalemailaddress']===_0x4986cc[_0x8e5f('0xd')]){_0x2e8662[_0x8e5f('0x22')]=_0x13aebc[_0x2149ec]['systemuserid'];}}}_0x57ce37(_0x2e8662);})[_0x8e5f('0x24')](function(_0x24a11e){_0x198062(_0x24a11e['message']);});});}function createEndUser(_0x564141,_0x5a2258,_0x4e702a,_0x260080,_0x1b0554,_0x3b3245){return new BPromise(function(_0x2521e6,_0xeda36a){return getAuthToken(_0x5a2258,_0x4e702a,_0x3b3245)[_0x8e5f('0x10')](function(_0x42eb41){var _0x9e2055=_0x3b3245['toLowerCase']()===_0x8e5f('0x25')?_0x1b0554[_0x8e5f('0x26')]:_0x1b0554[_0x8e5f('0x27')];var _0x2cf6fc={'method':_0x8e5f('0xa'),'uri':_0x260080+_0x8e5f('0x28'),'body':{'telephone1':_0x9e2055,'fullname':_0x9e2055,'firstname':_0x9e2055,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x8e5f('0x29')+_0x564141['userId']+')'},'headers':{'Authorization':_0x8e5f('0x16')+_0x42eb41,'OData-Version':_0x8e5f('0x17')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x2cf6fc);})['then'](function(_0x2d099b){var _0x348849=_0x2d099b[_0x8e5f('0x2a')][_0x8e5f('0x2b')];var _0x27b882=_0x348849[_0x8e5f('0x2c')](_0x348849['lastIndexOf']('(')+0x1,_0x348849[_0x8e5f('0x2d')](')'));_0x564141[_0x8e5f('0x2e')]=_0x27b882;_0x2521e6(_0x564141);})[_0x8e5f('0x24')](function(_0x597c6b){_0xeda36a(_0x597c6b[_0x8e5f('0x13')]);});});}function getEndUser(_0x5ab93f,_0x4fa3c3,_0x81616e,_0x52679f,_0x5dc474,_0x59e8bc){return new BPromise(function(_0x5824de,_0x10d3fc){var _0x3b7f3f=_0x59e8bc['toLowerCase']()==='outbound'?_0x5dc474[_0x8e5f('0x26')]:_0x5dc474[_0x8e5f('0x27')];return getAuthToken(_0x4fa3c3,_0x81616e,_0x59e8bc)[_0x8e5f('0x10')](function(_0x379f74){var _0x5ccb9f={'method':'GET','uri':_0x52679f+_0x8e5f('0x2f')+_0x3b7f3f[_0x8e5f('0x30')]('+','%2b')+'\x27','headers':{'Authorization':'Bearer\x20'+_0x379f74,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x5ccb9f);})['then'](function(_0x1a697f){var _0x299a05=null;if(_0x1a697f){var _0x309952=_0x1a697f[_0x8e5f('0x31')];var _0x594ec0=![];for(_0x299a05=0x0;_0x299a05<_0x309952[_0x8e5f('0x1c')];_0x299a05++){if(_0x309952[_0x299a05][_0x8e5f('0x32')]===_0x3b7f3f){_0x594ec0=!![];_0x5ab93f['enduserId']=_0x309952[_0x299a05]['contactid'];}}if(_0x594ec0){_0x5824de(_0x5ab93f);}else{return createEndUser(_0x5ab93f,_0x4fa3c3,_0x81616e,_0x52679f,_0x5dc474,_0x59e8bc)[_0x8e5f('0x10')](function(_0x302e06){logger[_0x8e5f('0x1f')]('['+[_0x59e8bc[_0x8e5f('0x12')]()]+_0x8e5f('0x33'),_0x302e06[_0x8e5f('0x2e')]);_0x5824de(_0x302e06);});}}else{return createEndUser(_0x5ab93f,_0x4fa3c3,_0x81616e,_0x52679f,_0x5dc474,_0x59e8bc)[_0x8e5f('0x10')](function(_0x25489a){logger['info']('['+[_0x59e8bc['toUpperCase']()]+_0x8e5f('0x34'),_0x25489a[_0x8e5f('0x2e')]);_0x5824de(_0x25489a);});}});});}function getCustomFields(_0x3275b7,_0x405114,_0x15098d){var _0x5f198c={};if(_0x3275b7[_0x8e5f('0x1c')]>0x0){_[_0x8e5f('0x35')](_0x3275b7,function(_0x415541){if(_['includes']([_0x8e5f('0x36'),_0x8e5f('0x37')],_0x415541['type'])&&_0x415541[_0x8e5f('0x38')]&&!_0x415541[_0x8e5f('0x39')]){var _0x544bf3=_0x415541[_0x8e5f('0x3a')]['toLowerCase']();var _0x2fe89a=_0x544bf3[_0x8e5f('0x2c')](0x0,_0x544bf3[_0x8e5f('0x3b')]('_'));var _0x919f4d=_0x544bf3['substring'](_0x544bf3[_0x8e5f('0x3b')]('_')+0x1);if(_0x2fe89a===_0x15098d){_0x5f198c[_0x919f4d]=_0x415541[_0x8e5f('0x3c')];}}});}return _0x5f198c;}function getTicket(_0x96ada7,_0x47b8a9,_0x104f9a,_0x4a04a5,_0x289404,_0x27ffdc,_0x3f9c0f){return new BPromise(function(_0x20afa3,_0x112fb3){var _0x26d6fc;return getAuthToken(_0x47b8a9,_0x104f9a,_0x3f9c0f)[_0x8e5f('0x10')](function(_0x3ac3ec){if(_0x27ffdc[_0x8e5f('0x3d')]==='incident'){_0x26d6fc={'method':_0x8e5f('0xa'),'uri':_0x4a04a5+_0x8e5f('0x3e'),'body':Object[_0x8e5f('0x3f')]({},{'title':intUtil[_0x8e5f('0x40')](_0x27ffdc['Subjects'],_0x289404,'\x20'),'description':intUtil[_0x8e5f('0x40')](_0x27ffdc[_0x8e5f('0x41')],_0x289404,'\x0a'),'customerid_contact@odata.bind':_0x8e5f('0x42')+_0x96ada7[_0x8e5f('0x2e')]+')','ownerid@odata.bind':_0x8e5f('0x29')+_0x96ada7['userId']+')','caseorigincode':'1'},getCustomFields(_0x27ffdc['Fields'],_0x289404,_0x27ffdc[_0x8e5f('0x3d')])),'headers':{'Authorization':_0x8e5f('0x16')+_0x3ac3ec,'OData-Version':_0x8e5f('0x17')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x27ffdc[_0x8e5f('0x3d')]===_0x8e5f('0x43')){_0x26d6fc={'method':_0x8e5f('0xa'),'uri':_0x4a04a5+'phonecalls','body':Object[_0x8e5f('0x3f')]({},{'subject':intUtil[_0x8e5f('0x40')](_0x27ffdc['Subjects'],_0x289404,'\x20'),'phonenumber':String(_0x289404['calleridnum']),'description':intUtil[_0x8e5f('0x40')](_0x27ffdc['Descriptions'],_0x289404,'\x0a'),'regardingobjectid_contact@odata.bind':_0x8e5f('0x42')+_0x96ada7[_0x8e5f('0x2e')]+')','ownerid@odata.bind':'/systemusers('+_0x96ada7['userId']+')','directioncode':_0x96ada7[_0x8e5f('0x44')]===_0x8e5f('0x45')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x8e5f('0x29')+_0x96ada7[_0x8e5f('0x22')]+')','participationtypemask':_0x96ada7[_0x8e5f('0x44')]===_0x8e5f('0x45')?0x2:0x1},{'partyid_contact@odata.bind':_0x8e5f('0x42')+_0x96ada7[_0x8e5f('0x2e')]+')','participationtypemask':_0x96ada7['callDirection']===_0x8e5f('0x45')?0x1:0x2}]},getCustomFields(_0x27ffdc[_0x8e5f('0x46')],_0x289404,_0x27ffdc[_0x8e5f('0x3d')])),'headers':{'Authorization':_0x8e5f('0x16')+_0x3ac3ec,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x26d6fc);})[_0x8e5f('0x10')](function(_0x530c92){var _0x560f53=_0x530c92[_0x8e5f('0x2a')]['odata-entityid'];var _0x33e00d=_0x560f53[_0x8e5f('0x2c')](_0x560f53['lastIndexOf']('(')+0x1,_0x560f53[_0x8e5f('0x2d')](')'));_0x96ada7['ticketId']=_0x33e00d;_0x20afa3(_0x96ada7);})[_0x8e5f('0x24')](function(_0x392b22){_0x112fb3(_0x392b22[_0x8e5f('0x13')]);});});}function emit(_0x3e233f,_0x25d49f,_0x2c6143,_0x5ab7cc){var _0xfea86f={'uri':util[_0x8e5f('0x47')](_0x8e5f('0x48'),_0x3e233f,_0x2c6143,_0x5ab7cc)};io['to'](util['format'](_0x8e5f('0x49'),_0x25d49f))[_0x8e5f('0x4a')](_0x8e5f('0x4b'),_0xfea86f);}exports['cs']=function(_0x561902,_0x102ad8,_0x18db0a,_0x4ca516,_0x45d41c,_0x188d9e,_0x41d099,_0xaebd4f){var _0x13c857={};_0x188d9e[_0x8e5f('0xc')]=intUtil[_0x8e5f('0x4c')](_0x188d9e[_0x8e5f('0xc')]);_0x188d9e[_0x8e5f('0x4d')]=intUtil[_0x8e5f('0x4c')](_0x188d9e['serverUrl']);_0x13c857[_0x8e5f('0x44')]=_0xaebd4f==='queue'||_0xaebd4f==='unmanaged'?'queue':_0x8e5f('0x25');var _0x15cec9=util[_0x8e5f('0x47')]('%s/api/data/v9.0/',_0x188d9e[_0x8e5f('0xc')]);var _0x2355c6=util['format'](_0x8e5f('0x4e'),_0x188d9e[_0x8e5f('0x4f')]);var _0x31aafd=util[_0x8e5f('0x47')](_0x8e5f('0x50'),_0x188d9e[_0x8e5f('0x4d')],_0x102ad8['uniqueid'],md5(_0x102ad8[_0x8e5f('0x51')]));if(_0x45d41c&&_0x45d41c[_0x8e5f('0x52')]){logger[_0x8e5f('0x1f')]('[QUEUE]','Recording\x20is\x20enabled!');_0x102ad8[_0x8e5f('0x53')]=_0x31aafd;}else if(_0x41d099&&_0x41d099[_0x8e5f('0x54')]&&_0x41d099[_0x8e5f('0x54')]!=='none'){logger[_0x8e5f('0x1f')](_0x8e5f('0x55'),_0x8e5f('0x56'));_0x102ad8['recordingURL']=_0x31aafd;}else{_0x102ad8[_0x8e5f('0x53')]='';}return getUser(_0x13c857,_0x188d9e,_0x4ca516,_0x2355c6,_0x15cec9,_0xaebd4f)[_0x8e5f('0x10')](function(_0x10f9a0){logger['info']('['+_0xaebd4f[_0x8e5f('0x12')]()+_0x8e5f('0x57'),_0x10f9a0[_0x8e5f('0x22')]);logger[_0x8e5f('0x1f')]('['+_0xaebd4f[_0x8e5f('0x12')]()+_0x8e5f('0x58'),_0x10f9a0[_0x8e5f('0x1b')]);return getEndUser(_0x10f9a0,_0x188d9e,_0x2355c6,_0x15cec9,_0x102ad8,_0xaebd4f);})['then'](function(_0x4dec3e){logger[_0x8e5f('0x1f')]('['+_0xaebd4f[_0x8e5f('0x12')]()+_0x8e5f('0x59'),_0x4dec3e[_0x8e5f('0x2e')]);logger[_0x8e5f('0x1f')]('['+_0xaebd4f[_0x8e5f('0x12')]()+_0x8e5f('0x5a'),_0x102ad8['calleridnum']);return getTicket(_0x4dec3e,_0x188d9e,_0x2355c6,_0x15cec9,_0x102ad8,_0x18db0a,_0xaebd4f);})['then'](function(_0x5a33fb){logger[_0x8e5f('0x1f')](util['format']('['+_0xaebd4f[_0x8e5f('0x12')]()+_0x8e5f('0x5b'),_0x18db0a[_0x8e5f('0x3d')],_0x5a33fb['ticketId']));logger[_0x8e5f('0x1f')](util[_0x8e5f('0x47')]('['+_0xaebd4f[_0x8e5f('0x12')]()+_0x8e5f('0x5c'),_0xaebd4f));if(_0xaebd4f!==_0x8e5f('0x5d')){logger[_0x8e5f('0x1f')]('['+_0xaebd4f[_0x8e5f('0x12')]()+']',_0x8e5f('0x5e'));emit(_0x188d9e[_0x8e5f('0xc')],_0x4ca516['name'],_0x18db0a[_0x8e5f('0x3d')],_0x5a33fb[_0x8e5f('0x5f')]);}})[_0x8e5f('0x24')](function(_0x1540a1){logger[_0x8e5f('0x60')]('['+_0xaebd4f['toUpperCase']()+']\x20Error\x20running\x20Dynamics365\x20integration',util[_0x8e5f('0x61')](_0x1540a1,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x99b0=['content','ticketType','incident','incidents','assign','getString','Subjects','Descriptions','phonecall','phonecalls','/contacts(','callDirection','queue','Fields','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','lodash','bluebird','util','./util','md5','ioredis','../../../../config/logger','../../../../config/environment','redis','localhost','POST','clientId','remoteUri','username','password','clientSecret','then','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','validateEmail','email','internalemailaddress','info',']\x20Agent\x20found\x20','userId','systemuserid',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userEmail','length','outbound','destcalleridnum','calleridnum','contacts','/systemusers(','headers','odata-entityid','substring','lastIndexOf','toLowerCase','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','replace','%2b','telephone1','enduserId','contactid','forEach','includes','string','nameField','customField','indexOf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x99b0,0xf0));var _0x099b=function(_0x3afb31,_0x324f2a){_0x3afb31=_0x3afb31-0x0;var _0x4a0a8b=_0x99b0[_0x3afb31];return _0x4a0a8b;};'use strict';var _=require(_0x099b('0x0'));var BPromise=require(_0x099b('0x1'));var rp=require('request-promise');var util=require(_0x099b('0x2'));var intUtil=require(_0x099b('0x3'));var md5=require(_0x099b('0x4'));var Redis=require(_0x099b('0x5'));var logger=require(_0x099b('0x6'))('dynamics365');var config=require(_0x099b('0x7'));config[_0x099b('0x8')]=_['defaults'](config[_0x099b('0x8')],{'host':_0x099b('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x099b('0x8')]));function getAuthToken(_0x1359e0,_0x4bfc94,_0xdc76d3){var _0x5a8f69={'method':_0x099b('0xa'),'uri':_0x4bfc94,'form':{'client_id':_0x1359e0[_0x099b('0xb')],'resource':_0x1359e0[_0x099b('0xc')],'username':_0x1359e0[_0x099b('0xd')],'password':_0x1359e0[_0x099b('0xe')],'grant_type':_0x099b('0xe'),'client_secret':_0x1359e0[_0x099b('0xf')]},'json':!![]};return rp(_0x5a8f69)[_0x099b('0x10')](function(_0x26744c){return _0x26744c['access_token'];})[_0x099b('0x11')](function(_0x7ff466){logger[_0x099b('0x12')]('['+[_0xdc76d3[_0x099b('0x13')]()]+_0x099b('0x14'));return _0x7ff466[_0x099b('0x15')];});}function getUser(_0x1e1ace,_0x3a858e,_0xec72,_0x633ce7,_0x4ce5c9,_0x70a6b4){return new BPromise(function(_0xd7b250,_0x5f2ba9){return getAuthToken(_0x3a858e,_0x633ce7,_0x70a6b4)[_0x099b('0x10')](function(_0x1f1802){var _0x5cb141={'method':_0x099b('0x16'),'uri':_0x4ce5c9+_0x099b('0x17'),'headers':{'Authorization':_0x099b('0x18')+_0x1f1802,'OData-Version':_0x099b('0x19')},'json':!![]};return rp(_0x5cb141);})[_0x099b('0x10')](function(_0x12e0cc){var _0x15a833=_0x12e0cc[_0x099b('0x1a')];var _0x5591b3=![];var _0x263fa3=null;if(!_[_0x099b('0x1b')](_0xec72)){if(intUtil[_0x099b('0x1c')](_0xec72[_0x099b('0x1d')])){_0x1e1ace['userEmail']=_0xec72[_0x099b('0x1d')];for(_0x263fa3=0x0;_0x263fa3<_0x15a833['length'];_0x263fa3++){if(_0x15a833[_0x263fa3][_0x099b('0x1e')]===_0xec72[_0x099b('0x1d')]&&!_0x15a833[_0x263fa3]['isdisabled']){_0x5591b3=!![];logger[_0x099b('0x1f')]('['+[_0x70a6b4[_0x099b('0x13')]()]+_0x099b('0x20')+_0x15a833[_0x263fa3]['systemuserid']+'!');_0x1e1ace[_0x099b('0x21')]=_0x15a833[_0x263fa3][_0x099b('0x22')];}}}}if(!_0x5591b3){logger[_0x099b('0x1f')]('['+[_0x70a6b4[_0x099b('0x13')]()]+_0x099b('0x23'));_0x1e1ace[_0x099b('0x24')]=_0x3a858e[_0x099b('0xd')];for(_0x263fa3=0x0;_0x263fa3<_0x15a833[_0x099b('0x25')];_0x263fa3++){if(_0x15a833[_0x263fa3][_0x099b('0x1e')]===_0x3a858e[_0x099b('0xd')]){_0x1e1ace['userId']=_0x15a833[_0x263fa3][_0x099b('0x22')];}}}_0xd7b250(_0x1e1ace);})[_0x099b('0x11')](function(_0x3d834b){_0x5f2ba9(_0x3d834b[_0x099b('0x15')]);});});}function createEndUser(_0x347984,_0x29ac41,_0x4f3de6,_0x51661b,_0x4ef86d,_0x5724b6){return new BPromise(function(_0x431e82,_0x35e21c){return getAuthToken(_0x29ac41,_0x4f3de6,_0x5724b6)[_0x099b('0x10')](function(_0x4af4ea){var _0x5f4b24=_0x5724b6['toLowerCase']()===_0x099b('0x26')?_0x4ef86d[_0x099b('0x27')]:_0x4ef86d[_0x099b('0x28')];var _0x4370a0={'method':_0x099b('0xa'),'uri':_0x51661b+_0x099b('0x29'),'body':{'telephone1':_0x5f4b24,'fullname':_0x5f4b24,'firstname':_0x5f4b24,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x099b('0x2a')+_0x347984['userId']+')'},'headers':{'Authorization':_0x099b('0x18')+_0x4af4ea,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x4370a0);})['then'](function(_0x31f698){var _0x1bdea5=_0x31f698[_0x099b('0x2b')][_0x099b('0x2c')];var _0x17c106=_0x1bdea5[_0x099b('0x2d')](_0x1bdea5['lastIndexOf']('(')+0x1,_0x1bdea5[_0x099b('0x2e')](')'));_0x347984['enduserId']=_0x17c106;_0x431e82(_0x347984);})[_0x099b('0x11')](function(_0x781bf7){_0x35e21c(_0x781bf7[_0x099b('0x15')]);});});}function getEndUser(_0x506f1e,_0x333120,_0xc09192,_0x31dca6,_0xc9f5bd,_0x16a40e){return new BPromise(function(_0x5b00ba,_0x1d310f){var _0x48013b=_0x16a40e[_0x099b('0x2f')]()===_0x099b('0x26')?_0xc9f5bd[_0x099b('0x27')]:_0xc9f5bd[_0x099b('0x28')];return getAuthToken(_0x333120,_0xc09192,_0x16a40e)['then'](function(_0x315b27){var _0x3975d3={'method':_0x099b('0x16'),'uri':_0x31dca6+_0x099b('0x30')+_0x48013b[_0x099b('0x31')]('+',_0x099b('0x32'))+'\x27','headers':{'Authorization':'Bearer\x20'+_0x315b27,'If-None-Match':null,'OData-Version':_0x099b('0x19')},'json':!![]};return rp(_0x3975d3);})[_0x099b('0x10')](function(_0xb4ac74){var _0x5074b6=null;if(_0xb4ac74){var _0x262799=_0xb4ac74[_0x099b('0x1a')];var _0x26a4ed=![];for(_0x5074b6=0x0;_0x5074b6<_0x262799['length'];_0x5074b6++){if(_0x262799[_0x5074b6][_0x099b('0x33')]===_0x48013b){_0x26a4ed=!![];_0x506f1e[_0x099b('0x34')]=_0x262799[_0x5074b6][_0x099b('0x35')];}}if(_0x26a4ed){_0x5b00ba(_0x506f1e);}else{return createEndUser(_0x506f1e,_0x333120,_0xc09192,_0x31dca6,_0xc9f5bd,_0x16a40e)[_0x099b('0x10')](function(_0xc5a14e){logger[_0x099b('0x1f')]('['+[_0x16a40e[_0x099b('0x13')]()]+']\x20Enduser\x20created!',_0xc5a14e['enduserId']);_0x5b00ba(_0xc5a14e);});}}else{return createEndUser(_0x506f1e,_0x333120,_0xc09192,_0x31dca6,_0xc9f5bd,_0x16a40e)[_0x099b('0x10')](function(_0x48a998){logger[_0x099b('0x1f')]('['+[_0x16a40e[_0x099b('0x13')]()]+']\x20Enduser\x20Created!',_0x48a998['enduserId']);_0x5b00ba(_0x48a998);});}});});}function getCustomFields(_0x421e74,_0x3271fb,_0xf88e0e){var _0x2ac009={};if(_0x421e74[_0x099b('0x25')]>0x0){_[_0x099b('0x36')](_0x421e74,function(_0x1346ed){if(_[_0x099b('0x37')]([_0x099b('0x38'),'picklist'],_0x1346ed['type'])&&_0x1346ed[_0x099b('0x39')]&&!_0x1346ed[_0x099b('0x3a')]){var _0x277964=_0x1346ed['idField'][_0x099b('0x2f')]();var _0x5ab559=_0x277964[_0x099b('0x2d')](0x0,_0x277964['indexOf']('_'));var _0x5efc63=_0x277964[_0x099b('0x2d')](_0x277964[_0x099b('0x3b')]('_')+0x1);if(_0x5ab559===_0xf88e0e){_0x2ac009[_0x5efc63]=_0x1346ed[_0x099b('0x3c')];}}});}return _0x2ac009;}function getTicket(_0x2e056d,_0xf6f08,_0x4279ea,_0x598588,_0x368acc,_0x138a2c,_0x4b1858){return new BPromise(function(_0x278c4e,_0x25906a){var _0x1c3eef;return getAuthToken(_0xf6f08,_0x4279ea,_0x4b1858)[_0x099b('0x10')](function(_0x5e44ea){if(_0x138a2c[_0x099b('0x3d')]===_0x099b('0x3e')){_0x1c3eef={'method':_0x099b('0xa'),'uri':_0x598588+_0x099b('0x3f'),'body':Object[_0x099b('0x40')]({},{'title':intUtil[_0x099b('0x41')](_0x138a2c[_0x099b('0x42')],_0x368acc,'\x20'),'description':intUtil['getString'](_0x138a2c[_0x099b('0x43')],_0x368acc,'\x0a'),'customerid_contact@odata.bind':'/contacts('+_0x2e056d[_0x099b('0x34')]+')','ownerid@odata.bind':_0x099b('0x2a')+_0x2e056d[_0x099b('0x21')]+')','caseorigincode':'1'},getCustomFields(_0x138a2c['Fields'],_0x368acc,_0x138a2c[_0x099b('0x3d')])),'headers':{'Authorization':_0x099b('0x18')+_0x5e44ea,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x138a2c[_0x099b('0x3d')]===_0x099b('0x44')){_0x1c3eef={'method':_0x099b('0xa'),'uri':_0x598588+_0x099b('0x45'),'body':Object[_0x099b('0x40')]({},{'subject':intUtil['getString'](_0x138a2c[_0x099b('0x42')],_0x368acc,'\x20'),'phonenumber':String(_0x368acc[_0x099b('0x28')]),'description':intUtil[_0x099b('0x41')](_0x138a2c['Descriptions'],_0x368acc,'\x0a'),'regardingobjectid_contact@odata.bind':_0x099b('0x46')+_0x2e056d[_0x099b('0x34')]+')','ownerid@odata.bind':'/systemusers('+_0x2e056d[_0x099b('0x21')]+')','directioncode':_0x2e056d[_0x099b('0x47')]===_0x099b('0x48')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x099b('0x2a')+_0x2e056d['userId']+')','participationtypemask':_0x2e056d[_0x099b('0x47')]===_0x099b('0x48')?0x2:0x1},{'partyid_contact@odata.bind':_0x099b('0x46')+_0x2e056d[_0x099b('0x34')]+')','participationtypemask':_0x2e056d[_0x099b('0x47')]===_0x099b('0x48')?0x1:0x2}]},getCustomFields(_0x138a2c[_0x099b('0x49')],_0x368acc,_0x138a2c[_0x099b('0x3d')])),'headers':{'Authorization':'Bearer\x20'+_0x5e44ea,'OData-Version':_0x099b('0x19')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x1c3eef);})[_0x099b('0x10')](function(_0x27a9dc){var _0x3ae028=_0x27a9dc['headers']['odata-entityid'];var _0x2024ae=_0x3ae028[_0x099b('0x2d')](_0x3ae028['lastIndexOf']('(')+0x1,_0x3ae028[_0x099b('0x2e')](')'));_0x2e056d[_0x099b('0x4a')]=_0x2024ae;_0x278c4e(_0x2e056d);})[_0x099b('0x11')](function(_0x595947){_0x25906a(_0x595947['message']);});});}function emit(_0x586026,_0x1a8694,_0x39ffe3,_0x18129d){var _0xa4c561={'uri':util[_0x099b('0x4b')](_0x099b('0x4c'),_0x586026,_0x39ffe3,_0x18129d)};io['to'](util['format'](_0x099b('0x4d'),_0x1a8694))[_0x099b('0x4e')]('trigger:browser:url',_0xa4c561);}exports['cs']=function(_0x5ecd51,_0x319309,_0x51febd,_0x271ef7,_0x1df1ac,_0x18185c,_0x266330,_0x196e5a){var _0x23f681={};_0x18185c[_0x099b('0xc')]=intUtil[_0x099b('0x4f')](_0x18185c[_0x099b('0xc')]);_0x18185c[_0x099b('0x50')]=intUtil['stripTrailingSlash'](_0x18185c[_0x099b('0x50')]);_0x23f681[_0x099b('0x47')]=_0x196e5a===_0x099b('0x48')||_0x196e5a===_0x099b('0x51')?_0x099b('0x48'):_0x099b('0x26');var _0xc04e8b=util['format'](_0x099b('0x52'),_0x18185c[_0x099b('0xc')]);var _0x56d91f=util[_0x099b('0x4b')](_0x099b('0x53'),_0x18185c[_0x099b('0x54')]);var _0x2fb14b=util[_0x099b('0x4b')](_0x099b('0x55'),_0x18185c[_0x099b('0x50')],_0x319309['uniqueid'],md5(_0x319309[_0x099b('0x56')]));if(_0x1df1ac&&_0x1df1ac[_0x099b('0x57')]){logger[_0x099b('0x1f')](_0x099b('0x58'),_0x099b('0x59'));_0x319309[_0x099b('0x5a')]=_0x2fb14b;}else if(_0x266330&&_0x266330[_0x099b('0x5b')]&&_0x266330[_0x099b('0x5b')]!==_0x099b('0x5c')){logger['info'](_0x099b('0x5d'),_0x099b('0x59'));_0x319309['recordingURL']=_0x2fb14b;}else{_0x319309[_0x099b('0x5a')]='';}return getUser(_0x23f681,_0x18185c,_0x271ef7,_0x56d91f,_0xc04e8b,_0x196e5a)[_0x099b('0x10')](function(_0x27f49f){logger[_0x099b('0x1f')]('['+_0x196e5a['toUpperCase']()+']\x20The\x20User\x20ID\x20is:',_0x27f49f['userId']);logger['info']('['+_0x196e5a[_0x099b('0x13')]()+_0x099b('0x5e'),_0x27f49f[_0x099b('0x24')]);return getEndUser(_0x27f49f,_0x18185c,_0x56d91f,_0xc04e8b,_0x319309,_0x196e5a);})[_0x099b('0x10')](function(_0x25ad41){logger[_0x099b('0x1f')]('['+_0x196e5a[_0x099b('0x13')]()+']\x20The\x20Enduser\x20ID\x20is:',_0x25ad41[_0x099b('0x34')]);logger['info']('['+_0x196e5a['toUpperCase']()+_0x099b('0x5f'),_0x319309[_0x099b('0x28')]);return getTicket(_0x25ad41,_0x18185c,_0x56d91f,_0xc04e8b,_0x319309,_0x51febd,_0x196e5a);})[_0x099b('0x10')](function(_0x3ba939){logger[_0x099b('0x1f')](util[_0x099b('0x4b')]('['+_0x196e5a[_0x099b('0x13')]()+_0x099b('0x60'),_0x51febd[_0x099b('0x3d')],_0x3ba939['ticketId']));logger['info'](util[_0x099b('0x4b')]('['+_0x196e5a[_0x099b('0x13')]()+']\x20Call\x20direction:\x20%s',_0x196e5a));if(_0x196e5a!=='unmanaged'){logger['info']('['+_0x196e5a[_0x099b('0x13')]()+']',_0x099b('0x61'));emit(_0x18185c[_0x099b('0xc')],_0x271ef7[_0x099b('0x62')],_0x51febd[_0x099b('0x3d')],_0x3ba939['ticketId']);}})['catch'](function(_0x146c8a){logger[_0x099b('0x12')]('['+_0x196e5a[_0x099b('0x13')]()+_0x099b('0x63'),util['inspect'](_0x146c8a,{'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 34a34d8..45168ad 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 _0x20c5=['The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','outbound','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridnum','catch','lastevent','toUpperCase','error','lodash','request-promise','md5','util','ioredis','./util','../../../../config/logger','freshdesk','localhost','socket.io-emitter','redis','application/json','emit','info','merge','format','calleridnum','getString','Subjects','
','name','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','POST','then','validateEmail','%s/api/v2/agents','remoteUri','length','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','base64','debug','[HTTP]','stringify','GET','map','forEach','includes','picklist','type','nameField','customField','toLowerCase','content','toString','string','push','variable','variableName','idField','customVariable','Variable','queue','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization'];(function(_0x5cd50b,_0x2949f7){var _0x3cd3ac=function(_0x317771){while(--_0x317771){_0x5cd50b['push'](_0x5cd50b['shift']());}};_0x3cd3ac(++_0x2949f7);}(_0x20c5,0x18b));var _0x520c=function(_0x46334d,_0x5b066e){_0x46334d=_0x46334d-0x0;var _0xb4e8fa=_0x20c5[_0x46334d];return _0xb4e8fa;};'use strict';var _=require(_0x520c('0x0'));var rp=require(_0x520c('0x1'));var md5=require(_0x520c('0x2'));var util=require(_0x520c('0x3'));var Redis=require(_0x520c('0x4'));var intUtil=require(_0x520c('0x5'));var config=require('../../../../config/environment');var logger=require(_0x520c('0x6'))(_0x520c('0x7'));config['redis']=_['defaults'](config['redis'],{'host':_0x520c('0x8'),'port':0x18eb});var io=require(_0x520c('0x9'))(new Redis(config[_0x520c('0xa')]));var headers={'Content-Type':_0x520c('0xb'),'Accept':_0x520c('0xb')};function emit(_0x5bff89,_0x58da8d,_0xff8bfe){io['to'](_0x5bff89)[_0x520c('0xc')](_0x58da8d,_0xff8bfe);}function getTicket(_0x2216c5,_0x5092ce,_0x2f8b28,_0x4fdf9e,_0x210c09){logger[_0x520c('0xd')]('Creating\x20new\x20ticket...');var _0x5ee158=_[_0x520c('0xe')]({'responder_id':_0x5092ce['id'],'requester_id':_0x2f8b28['id'],'name':util[_0x520c('0xf')]('Caller\x20-\x20%s',_0x210c09['calleridname']),'phone':_0x210c09[_0x520c('0x10')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x520c('0x11')](_0x4fdf9e[_0x520c('0x12')],_0x210c09,'\x20'),'description':intUtil['getString'](_0x4fdf9e['Descriptions'],_0x210c09,_0x520c('0x13')),'tags':getTags(_0x4fdf9e['Tags'],_0x520c('0x14'))},getCustomFields(_0x4fdf9e['Fields'],_0x210c09));_0x5ee158[_0x520c('0x15')]=_[_0x520c('0x16')](_[_0x520c('0x17')](_0x5ee158[_0x520c('0x15')],'id'),_0x520c('0x18'));return request({'uri':util[_0x520c('0xf')](_0x520c('0x19'),_0x2216c5['remoteUri']),'method':_0x520c('0x1a'),'body':_0x5ee158})[_0x520c('0x1b')](function(_0x37fd84){logger[_0x520c('0xd')]('Ticket\x20created!');return _0x37fd84;});}function getUser(_0x5dc8c2,_0x2b0646){if(intUtil[_0x520c('0x1c')](_0x2b0646)){return request({'uri':util[_0x520c('0xf')](_0x520c('0x1d'),_0x5dc8c2[_0x520c('0x1e')]),'qs':{'email':_0x2b0646}})[_0x520c('0x1b')](function(_0x26a296){if(_0x26a296[_0x520c('0x1f')]){logger['info'](_0x520c('0x20'));return _[_0x520c('0x21')](_0x26a296,function(_0x337f21){return _0x337f21[_0x520c('0x22')][_0x520c('0x23')]===_0x2b0646;});}else{logger['info'](_0x520c('0x24'));return request({'uri':util['format'](_0x520c('0x25'),_0x5dc8c2[_0x520c('0x1e')])})[_0x520c('0x1b')](function(_0x12ee20){logger[_0x520c('0xd')](_0x520c('0x26'));return _0x12ee20;});}});}else{logger['info'](_0x520c('0x27'));return request({'uri':util['format'](_0x520c('0x25'),_0x5dc8c2[_0x520c('0x1e')])})[_0x520c('0x1b')](function(_0x3e17f2){logger[_0x520c('0xd')](_0x520c('0x26'));return _0x3e17f2;});}}function getEndUser(_0x46622a,_0x3d0677,_0x1f61bb){logger['info'](_0x520c('0x28'),_0x1f61bb);return request({'uri':util[_0x520c('0xf')](_0x520c('0x29'),_0x46622a['remoteUri']),'qs':{'phone':_0x1f61bb}})['then'](function(_0xf5f28c){if(_0xf5f28c['length']){logger['info']('Enduser\x20found!');return _[_0x520c('0x21')](_0xf5f28c,{'phone':_0x1f61bb});}else{logger[_0x520c('0xd')](_0x520c('0x2a'));return request({'uri':util[_0x520c('0xf')](_0x520c('0x29'),_0x46622a[_0x520c('0x1e')]),'method':'POST','body':{'name':_0x3d0677,'phone':_0x1f61bb}})['then'](function(_0x27bfbe){logger[_0x520c('0xd')](_0x520c('0x2b'));return _0x27bfbe;});}});}function getAuth(_0x8d188f){return util[_0x520c('0xf')](_0x520c('0x2c'),new Buffer(_0x8d188f['apiKey']+':X')['toString'](_0x520c('0x2d')));}function request(_0x5a248a){logger[_0x520c('0x2e')](_0x520c('0x2f'),JSON[_0x520c('0x30')](_0x5a248a));return rp(_['defaults'](_0x5a248a,{'method':_0x520c('0x31'),'headers':headers,'json':!![]}));}function getTags(_0x519049,_0x4a17f3){var _0x180fca=[];if(_0x519049&&_0x519049[_0x520c('0x1f')]>0x0){_0x180fca=_[_0x520c('0x32')](_0x519049,_0x4a17f3);}return _0x180fca;}function getCustomFields(_0x280d70,_0x3871a5){var _0x4d7ddb=[];var _0x59dc33={'custom_fields':[]};if(_0x280d70[_0x520c('0x1f')]>0x0){_[_0x520c('0x33')](_0x280d70,function(_0x4db5c9){if(_[_0x520c('0x34')](['string',_0x520c('0x35')],_0x4db5c9[_0x520c('0x36')])&&_0x4db5c9[_0x520c('0x37')]&&!_0x4db5c9[_0x520c('0x38')]){_0x59dc33[_0x4db5c9[_0x520c('0x37')][_0x520c('0x39')]()]=_0x4db5c9[_0x520c('0x3a')][_0x520c('0x3b')]();}else if(_[_0x520c('0x34')]([_0x520c('0x3c'),_0x520c('0x35')],_0x4db5c9[_0x520c('0x36')])&&_0x4db5c9['idField']&&_0x4db5c9[_0x520c('0x38')]){_0x59dc33[_0x520c('0x15')][_0x520c('0x3d')]({'id':_0x4db5c9['idField'],'value':_0x4db5c9[_0x520c('0x3a')][_0x520c('0x3b')]()});}else if(_0x4db5c9[_0x520c('0x36')]===_0x520c('0x3e')&&_0x4db5c9[_0x520c('0x3f')]&&_0x4db5c9[_0x520c('0x40')]&&_0x4db5c9['customField']){_0x3871a5[_0x4db5c9['variableName']]&&_0x59dc33[_0x520c('0x15')][_0x520c('0x3d')]({'id':_0x4db5c9['idField'],'value':_0x3871a5[_0x4db5c9[_0x520c('0x3f')]]['toString']()});}else if(_0x4db5c9[_0x520c('0x36')]===_0x520c('0x41')&&_0x4db5c9[_0x520c('0x42')]&&_0x4db5c9[_0x520c('0x42')][_0x520c('0x14')]&&_0x4db5c9[_0x520c('0x40')]&&_0x4db5c9['customField']){_0x3871a5[_0x4db5c9[_0x520c('0x42')][_0x520c('0x14')][_0x520c('0x39')]()]&&_0x59dc33[_0x520c('0x15')][_0x520c('0x3d')]({'id':_0x4db5c9[_0x520c('0x40')],'value':_0x3871a5[_0x4db5c9[_0x520c('0x42')][_0x520c('0x14')][_0x520c('0x39')]()][_0x520c('0x3b')]()});}});}return _0x59dc33;}exports[_0x520c('0x43')]=function(_0x261308,_0x38214c,_0x13e2bb,_0x4e24b7,_0xe6752a,_0x516ce0){var _0x34ac9f,_0x4af261;_0x516ce0['remoteUri']=intUtil['stripTrailingSlash'](_0x516ce0[_0x520c('0x1e')]);_0x516ce0['serverUrl']=intUtil['stripTrailingSlash'](_0x516ce0[_0x520c('0x44')]);if(_0xe6752a&&_0xe6752a[_0x520c('0x45')]){logger[_0x520c('0xd')](_0x520c('0x46'),_0x520c('0x47'));_0x38214c[_0x520c('0x48')]=util[_0x520c('0xf')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x516ce0['serverUrl'],_0x38214c[_0x520c('0x49')],md5(_0x38214c[_0x520c('0x49')]));}else{_0x38214c[_0x520c('0x48')]='';}headers[_0x520c('0x4a')]=getAuth(_0x516ce0);return getUser(_0x516ce0,_0x4e24b7[_0x520c('0x23')])['then'](function(_0x3c0907){_0x34ac9f=_0x3c0907;logger[_0x520c('0xd')](_0x520c('0x4b'),_0x34ac9f['id']);return getEndUser(_0x516ce0,_0x38214c[_0x520c('0x4c')],_0x38214c[_0x520c('0x10')]);})[_0x520c('0x1b')](function(_0x5184ff){_0x4af261=_0x5184ff;logger[_0x520c('0xd')](_0x520c('0x4d'),_0x4af261['id']);return getTicket(_0x516ce0,_0x34ac9f,_0x4af261,_0x13e2bb,_0x38214c);})[_0x520c('0x1b')](function(_0x21916e){if(_0x21916e&&_0x21916e['id']){logger[_0x520c('0xd')](_0x520c('0x4e'));logger['info'](_0x520c('0x4f'),_0x21916e['id']);logger[_0x520c('0xd')](_0x520c('0x46'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x520c('0xf')](_0x520c('0x50'),_0x4e24b7[_0x520c('0x14')]),_0x520c('0x51'),{'uri':util[_0x520c('0xf')](_0x520c('0x52'),_0x516ce0[_0x520c('0x1e')],_0x21916e['id'])});}})['catch'](function(_0x241d79){logger['error'](_0x520c('0x46'),JSON[_0x520c('0x30')](_0x241d79));});};exports[_0x520c('0x53')]=function(_0x54193b,_0x54fcea,_0x7a87c9,_0x465f7e,_0x277ede,_0x2a3b77,_0x477c2f){var _0x3e9164,_0x11f182;_0x2a3b77[_0x520c('0x1e')]=intUtil[_0x520c('0x54')](_0x2a3b77[_0x520c('0x1e')]);_0x2a3b77['serverUrl']=intUtil[_0x520c('0x54')](_0x2a3b77[_0x520c('0x44')]);if(_0x477c2f&&_0x477c2f['recordingFormat']&&_0x477c2f[_0x520c('0x55')]!==_0x520c('0x56')){logger[_0x520c('0xd')](_0x520c('0x57'),_0x520c('0x47'));_0x54fcea[_0x520c('0x48')]=util[_0x520c('0xf')](_0x520c('0x58'),_0x2a3b77[_0x520c('0x44')],_0x54fcea[_0x520c('0x49')],md5(_0x54fcea[_0x520c('0x49')]));}headers[_0x520c('0x4a')]=getAuth(_0x2a3b77);return getUser(_0x2a3b77,_0x465f7e[_0x520c('0x23')])[_0x520c('0x1b')](function(_0x560195){_0x3e9164=_0x560195;logger[_0x520c('0xd')]('The\x20User\x20ID\x20is:',_0x3e9164['id']);return getEndUser(_0x2a3b77,_0x54fcea['destcalleridname'],_0x54fcea[_0x520c('0x59')]);})[_0x520c('0x1b')](function(_0xacb84c){_0x11f182=_0xacb84c;logger['info']('The\x20Enduser\x20ID\x20is:',_0x11f182['id']);return getTicket(_0x2a3b77,_0x3e9164,_0x11f182,_0x7a87c9,_0x54fcea);})['then'](function(_0x8f258f){if(_0x8f258f&&_0x8f258f['id']){logger[_0x520c('0xd')](_0x520c('0x4e'));logger[_0x520c('0xd')](_0x520c('0x4f'),_0x8f258f['id']);logger[_0x520c('0xd')](_0x520c('0x57'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x520c('0xf')](_0x520c('0x50'),_0x465f7e[_0x520c('0x14')]),_0x520c('0x51'),{'uri':util[_0x520c('0xf')]('%s/helpdesk/tickets/%d',_0x2a3b77[_0x520c('0x1e')],_0x8f258f['id'])});}})[_0x520c('0x5a')](function(_0x19bfe6){logger['error'](_0x520c('0x57'),JSON[_0x520c('0x30')](_0x19bfe6));});};exports['unmanaged']=function(_0x3fe292,_0x545f2e,_0x5a6a77,_0x3385a7,_0xceea0a,_0x51a054){var _0x2e37d4,_0x4fa8a6;_0x51a054[_0x520c('0x1e')]=intUtil[_0x520c('0x54')](_0x51a054[_0x520c('0x1e')]);_0x51a054[_0x520c('0x44')]=intUtil[_0x520c('0x54')](_0x51a054[_0x520c('0x44')]);if(_0xceea0a&&_0xceea0a[_0x520c('0x45')]){logger[_0x520c('0xd')]('['+_0x545f2e[_0x520c('0x5b')][_0x520c('0x5c')]()+']',_0x520c('0x47'));_0x545f2e[_0x520c('0x48')]=util[_0x520c('0xf')](_0x520c('0x58'),_0x51a054['serverUrl'],_0x545f2e['uniqueid'],md5(_0x545f2e[_0x520c('0x49')]));}else{_0x545f2e['recordingURL']='';}headers[_0x520c('0x4a')]=getAuth(_0x51a054);return getUser(_0x51a054,'')['then'](function(_0x1ad560){_0x2e37d4=_0x1ad560;logger['info'](_0x520c('0x4b'),_0x2e37d4['id']);return getEndUser(_0x51a054,_0x545f2e[_0x520c('0x4c')],_0x545f2e[_0x520c('0x10')]);})[_0x520c('0x1b')](function(_0x36074a){_0x4fa8a6=_0x36074a;logger[_0x520c('0xd')](_0x520c('0x4d'),_0x4fa8a6['id']);return getTicket(_0x51a054,_0x2e37d4,_0x4fa8a6,_0x5a6a77,_0x545f2e);})[_0x520c('0x1b')](function(_0x194ade){if(_0x194ade){logger['info'](_0x520c('0x4e'));logger[_0x520c('0xd')](_0x520c('0x4f'),_0x194ade['id']);}})[_0x520c('0x5a')](function(_0x169f33){logger[_0x520c('0x5d')]('['+_0x545f2e[_0x520c('0x5b')][_0x520c('0x5c')]()+']',JSON[_0x520c('0x30')](_0x169f33));});}; \ No newline at end of file +var _0x0e24=['find','contact','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','%s/api/v2/agents/me','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','debug','[HTTP]','stringify','GET','map','forEach','string','picklist','type','nameField','toLowerCase','includes','idField','customField','content','variable','variableName','push','Variable','queue','serverUrl','stripTrailingSlash','recordingURL','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','%s/helpdesk/tickets/%d','error','[QUEUE]','none','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','[OUTBOUND]','user:%s','catch','monitor_format','lastevent','toUpperCase','lodash','request-promise','ioredis','./util','../../../../config/logger','freshdesk','redis','defaults','application/json','emit','info','Creating\x20new\x20ticket...','Caller\x20-\x20%s','calleridname','calleridnum','getString','Tags','name','custom_fields','mapValues','keyBy','value','format','%s/api/v2/tickets','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','remoteUri','length','Agent\x20found!'];(function(_0x238cff,_0x426708){var _0x13ed66=function(_0x28e0c9){while(--_0x28e0c9){_0x238cff['push'](_0x238cff['shift']());}};_0x13ed66(++_0x426708);}(_0x0e24,0x1eb));var _0x40e2=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x0e24[_0x5d2803];return _0xdcad2c;};'use strict';var _=require(_0x40e2('0x0'));var rp=require(_0x40e2('0x1'));var md5=require('md5');var util=require('util');var Redis=require(_0x40e2('0x2'));var intUtil=require(_0x40e2('0x3'));var config=require('../../../../config/environment');var logger=require(_0x40e2('0x4'))(_0x40e2('0x5'));config[_0x40e2('0x6')]=_[_0x40e2('0x7')](config[_0x40e2('0x6')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var headers={'Content-Type':_0x40e2('0x8'),'Accept':_0x40e2('0x8')};function emit(_0x2799e7,_0x289615,_0x598f41){io['to'](_0x2799e7)[_0x40e2('0x9')](_0x289615,_0x598f41);}function getTicket(_0x44cb64,_0x213183,_0x1658b0,_0x58aa17,_0x3a4edc){logger[_0x40e2('0xa')](_0x40e2('0xb'));var _0x2dbc31=_['merge']({'responder_id':_0x213183['id'],'requester_id':_0x1658b0['id'],'name':util['format'](_0x40e2('0xc'),_0x3a4edc[_0x40e2('0xd')]),'phone':_0x3a4edc[_0x40e2('0xe')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x40e2('0xf')](_0x58aa17['Subjects'],_0x3a4edc,'\x20'),'description':intUtil[_0x40e2('0xf')](_0x58aa17['Descriptions'],_0x3a4edc,'
'),'tags':getTags(_0x58aa17[_0x40e2('0x10')],_0x40e2('0x11'))},getCustomFields(_0x58aa17['Fields'],_0x3a4edc));_0x2dbc31[_0x40e2('0x12')]=_[_0x40e2('0x13')](_[_0x40e2('0x14')](_0x2dbc31[_0x40e2('0x12')],'id'),_0x40e2('0x15'));return request({'uri':util[_0x40e2('0x16')](_0x40e2('0x17'),_0x44cb64['remoteUri']),'method':'POST','body':_0x2dbc31})[_0x40e2('0x18')](function(_0x98220c){logger[_0x40e2('0xa')](_0x40e2('0x19'));return _0x98220c;});}function getUser(_0x2bb9fb,_0xd6f495){if(intUtil[_0x40e2('0x1a')](_0xd6f495)){return request({'uri':util['format'](_0x40e2('0x1b'),_0x2bb9fb[_0x40e2('0x1c')]),'qs':{'email':_0xd6f495}})[_0x40e2('0x18')](function(_0x22493f){if(_0x22493f[_0x40e2('0x1d')]){logger[_0x40e2('0xa')](_0x40e2('0x1e'));return _[_0x40e2('0x1f')](_0x22493f,function(_0x509ba3){return _0x509ba3[_0x40e2('0x20')]['email']===_0xd6f495;});}else{logger[_0x40e2('0xa')](_0x40e2('0x21'));return request({'uri':util[_0x40e2('0x16')]('%s/api/v2/agents/me',_0x2bb9fb[_0x40e2('0x1c')])})[_0x40e2('0x18')](function(_0x1dffa8){logger[_0x40e2('0xa')](_0x40e2('0x22'));return _0x1dffa8;});}});}else{logger[_0x40e2('0xa')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x40e2('0x16')](_0x40e2('0x23'),_0x2bb9fb[_0x40e2('0x1c')])})[_0x40e2('0x18')](function(_0x352af3){logger[_0x40e2('0xa')](_0x40e2('0x22'));return _0x352af3;});}}function getEndUser(_0x323083,_0x59794a,_0x49aad0){logger[_0x40e2('0xa')]('Searching\x20enduser\x20with\x20phone',_0x49aad0);return request({'uri':util[_0x40e2('0x16')](_0x40e2('0x24'),_0x323083['remoteUri']),'qs':{'phone':_0x49aad0}})['then'](function(_0x8242d){if(_0x8242d['length']){logger[_0x40e2('0xa')](_0x40e2('0x25'));return _[_0x40e2('0x1f')](_0x8242d,{'phone':_0x49aad0});}else{logger[_0x40e2('0xa')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x40e2('0x16')](_0x40e2('0x24'),_0x323083[_0x40e2('0x1c')]),'method':'POST','body':{'name':_0x59794a,'phone':_0x49aad0}})[_0x40e2('0x18')](function(_0x3ea86f){logger['info'](_0x40e2('0x26'));return _0x3ea86f;});}});}function getAuth(_0x6352f9){return util['format'](_0x40e2('0x27'),new Buffer(_0x6352f9[_0x40e2('0x28')]+':X')[_0x40e2('0x29')](_0x40e2('0x2a')));}function request(_0x201c9d){logger[_0x40e2('0x2b')](_0x40e2('0x2c'),JSON[_0x40e2('0x2d')](_0x201c9d));return rp(_[_0x40e2('0x7')](_0x201c9d,{'method':_0x40e2('0x2e'),'headers':headers,'json':!![]}));}function getTags(_0x26031f,_0x6740b8){var _0x475152=[];if(_0x26031f&&_0x26031f[_0x40e2('0x1d')]>0x0){_0x475152=_[_0x40e2('0x2f')](_0x26031f,_0x6740b8);}return _0x475152;}function getCustomFields(_0x5a15d4,_0x56f0ff){var _0x424b21=[];var _0x4e1c86={'custom_fields':[]};if(_0x5a15d4['length']>0x0){_[_0x40e2('0x30')](_0x5a15d4,function(_0x5187e5){if(_['includes']([_0x40e2('0x31'),_0x40e2('0x32')],_0x5187e5[_0x40e2('0x33')])&&_0x5187e5[_0x40e2('0x34')]&&!_0x5187e5['customField']){_0x4e1c86[_0x5187e5[_0x40e2('0x34')][_0x40e2('0x35')]()]=_0x5187e5['content']['toString']();}else if(_[_0x40e2('0x36')]([_0x40e2('0x31'),_0x40e2('0x32')],_0x5187e5[_0x40e2('0x33')])&&_0x5187e5[_0x40e2('0x37')]&&_0x5187e5[_0x40e2('0x38')]){_0x4e1c86[_0x40e2('0x12')]['push']({'id':_0x5187e5[_0x40e2('0x37')],'value':_0x5187e5[_0x40e2('0x39')][_0x40e2('0x29')]()});}else if(_0x5187e5[_0x40e2('0x33')]===_0x40e2('0x3a')&&_0x5187e5['variableName']&&_0x5187e5[_0x40e2('0x37')]&&_0x5187e5[_0x40e2('0x38')]){_0x56f0ff[_0x5187e5[_0x40e2('0x3b')]]&&_0x4e1c86['custom_fields'][_0x40e2('0x3c')]({'id':_0x5187e5['idField'],'value':_0x56f0ff[_0x5187e5[_0x40e2('0x3b')]][_0x40e2('0x29')]()});}else if(_0x5187e5['type']==='customVariable'&&_0x5187e5['Variable']&&_0x5187e5[_0x40e2('0x3d')][_0x40e2('0x11')]&&_0x5187e5[_0x40e2('0x37')]&&_0x5187e5[_0x40e2('0x38')]){_0x56f0ff[_0x5187e5[_0x40e2('0x3d')][_0x40e2('0x11')][_0x40e2('0x35')]()]&&_0x4e1c86[_0x40e2('0x12')][_0x40e2('0x3c')]({'id':_0x5187e5['idField'],'value':_0x56f0ff[_0x5187e5[_0x40e2('0x3d')][_0x40e2('0x11')][_0x40e2('0x35')]()][_0x40e2('0x29')]()});}});}return _0x4e1c86;}exports[_0x40e2('0x3e')]=function(_0x5cdcb7,_0x43edce,_0x1024df,_0x12b5d7,_0x4951b8,_0xd61a5a){var _0x21a55f,_0x114a5a;_0xd61a5a[_0x40e2('0x1c')]=intUtil['stripTrailingSlash'](_0xd61a5a[_0x40e2('0x1c')]);_0xd61a5a[_0x40e2('0x3f')]=intUtil[_0x40e2('0x40')](_0xd61a5a[_0x40e2('0x3f')]);if(_0x4951b8&&_0x4951b8['monitor_format']){logger[_0x40e2('0xa')]('[QUEUE]','Recording\x20is\x20enabled!');_0x43edce[_0x40e2('0x41')]=util[_0x40e2('0x16')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xd61a5a[_0x40e2('0x3f')],_0x43edce[_0x40e2('0x42')],md5(_0x43edce[_0x40e2('0x42')]));}else{_0x43edce[_0x40e2('0x41')]='';}headers[_0x40e2('0x43')]=getAuth(_0xd61a5a);return getUser(_0xd61a5a,_0x12b5d7[_0x40e2('0x44')])[_0x40e2('0x18')](function(_0x186130){_0x21a55f=_0x186130;logger['info'](_0x40e2('0x45'),_0x21a55f['id']);return getEndUser(_0xd61a5a,_0x43edce[_0x40e2('0xd')],_0x43edce[_0x40e2('0xe')]);})[_0x40e2('0x18')](function(_0x6096d8){_0x114a5a=_0x6096d8;logger[_0x40e2('0xa')]('The\x20Enduser\x20ID\x20is:',_0x114a5a['id']);return getTicket(_0xd61a5a,_0x21a55f,_0x114a5a,_0x1024df,_0x43edce);})[_0x40e2('0x18')](function(_0x59ba63){if(_0x59ba63&&_0x59ba63['id']){logger[_0x40e2('0xa')](_0x40e2('0x19'));logger[_0x40e2('0xa')](_0x40e2('0x46'),_0x59ba63['id']);logger[_0x40e2('0xa')]('[QUEUE]',_0x40e2('0x47'));emit(util[_0x40e2('0x16')]('user:%s',_0x12b5d7['name']),'trigger:browser:url',{'uri':util['format'](_0x40e2('0x48'),_0xd61a5a[_0x40e2('0x1c')],_0x59ba63['id'])});}})['catch'](function(_0x45281f){logger[_0x40e2('0x49')](_0x40e2('0x4a'),JSON[_0x40e2('0x2d')](_0x45281f));});};exports['outbound']=function(_0x29126c,_0x4ebff1,_0x4aa860,_0x5af268,_0x1cf69a,_0x5f3bd2,_0x2f11d8){var _0x1f2bd3,_0x53fee3;_0x5f3bd2['remoteUri']=intUtil[_0x40e2('0x40')](_0x5f3bd2[_0x40e2('0x1c')]);_0x5f3bd2[_0x40e2('0x3f')]=intUtil[_0x40e2('0x40')](_0x5f3bd2[_0x40e2('0x3f')]);if(_0x2f11d8&&_0x2f11d8['recordingFormat']&&_0x2f11d8['recordingFormat']!==_0x40e2('0x4b')){logger[_0x40e2('0xa')]('[OUTBOUND]',_0x40e2('0x4c'));_0x4ebff1[_0x40e2('0x41')]=util[_0x40e2('0x16')](_0x40e2('0x4d'),_0x5f3bd2[_0x40e2('0x3f')],_0x4ebff1[_0x40e2('0x42')],md5(_0x4ebff1[_0x40e2('0x42')]));}headers[_0x40e2('0x43')]=getAuth(_0x5f3bd2);return getUser(_0x5f3bd2,_0x5af268[_0x40e2('0x44')])['then'](function(_0x3b5711){_0x1f2bd3=_0x3b5711;logger['info'](_0x40e2('0x45'),_0x1f2bd3['id']);return getEndUser(_0x5f3bd2,_0x4ebff1[_0x40e2('0x4e')],_0x4ebff1[_0x40e2('0x4f')]);})['then'](function(_0x4bf13d){_0x53fee3=_0x4bf13d;logger[_0x40e2('0xa')](_0x40e2('0x50'),_0x53fee3['id']);return getTicket(_0x5f3bd2,_0x1f2bd3,_0x53fee3,_0x4aa860,_0x4ebff1);})['then'](function(_0x15367e){if(_0x15367e&&_0x15367e['id']){logger[_0x40e2('0xa')](_0x40e2('0x19'));logger[_0x40e2('0xa')](_0x40e2('0x46'),_0x15367e['id']);logger[_0x40e2('0xa')](_0x40e2('0x51'),_0x40e2('0x47'));emit(util[_0x40e2('0x16')](_0x40e2('0x52'),_0x5af268[_0x40e2('0x11')]),'trigger:browser:url',{'uri':util[_0x40e2('0x16')](_0x40e2('0x48'),_0x5f3bd2[_0x40e2('0x1c')],_0x15367e['id'])});}})[_0x40e2('0x53')](function(_0x34f3f3){logger[_0x40e2('0x49')](_0x40e2('0x51'),JSON[_0x40e2('0x2d')](_0x34f3f3));});};exports['unmanaged']=function(_0x2c4d90,_0x2985a6,_0x36ac16,_0x78f03e,_0x4ed44,_0x2c92c2){var _0x2d5874,_0x226634;_0x2c92c2[_0x40e2('0x1c')]=intUtil[_0x40e2('0x40')](_0x2c92c2['remoteUri']);_0x2c92c2[_0x40e2('0x3f')]=intUtil[_0x40e2('0x40')](_0x2c92c2[_0x40e2('0x3f')]);if(_0x4ed44&&_0x4ed44[_0x40e2('0x54')]){logger[_0x40e2('0xa')]('['+_0x2985a6[_0x40e2('0x55')][_0x40e2('0x56')]()+']',_0x40e2('0x4c'));_0x2985a6[_0x40e2('0x41')]=util[_0x40e2('0x16')](_0x40e2('0x4d'),_0x2c92c2[_0x40e2('0x3f')],_0x2985a6[_0x40e2('0x42')],md5(_0x2985a6[_0x40e2('0x42')]));}else{_0x2985a6[_0x40e2('0x41')]='';}headers[_0x40e2('0x43')]=getAuth(_0x2c92c2);return getUser(_0x2c92c2,'')[_0x40e2('0x18')](function(_0x4854b0){_0x2d5874=_0x4854b0;logger[_0x40e2('0xa')](_0x40e2('0x45'),_0x2d5874['id']);return getEndUser(_0x2c92c2,_0x2985a6[_0x40e2('0xd')],_0x2985a6['calleridnum']);})[_0x40e2('0x18')](function(_0x45a924){_0x226634=_0x45a924;logger[_0x40e2('0xa')](_0x40e2('0x50'),_0x226634['id']);return getTicket(_0x2c92c2,_0x2d5874,_0x226634,_0x36ac16,_0x2985a6);})[_0x40e2('0x18')](function(_0x488da9){if(_0x488da9){logger[_0x40e2('0xa')](_0x40e2('0x19'));logger['info'](_0x40e2('0x46'),_0x488da9['id']);}})['catch'](function(_0x5175ca){logger[_0x40e2('0x49')]('['+_0x2985a6[_0x40e2('0x55')][_0x40e2('0x56')]()+']',JSON[_0x40e2('0x2d')](_0x5175ca));});}; \ 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 ec7e5fc..2c00b8e 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 _0x9253=['GET','/api/selector/owners','info','Getting\x20admin\x20information','then','users','length','email','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userEmail','userId','User\x20found:','Admin\x20selected','&f=','&entities=contact','find','contacts','format','contactNumber','endUserId','Contact\x20found\x20mobile_number:','YYYY-MM-DDTHH:mm:ss','headers','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','getString','Contact','add','task','Task\x20created:','/contacts/','user:%s','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','adminEmail','username','outbound','destcalleridnum','calleridnum','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','ticketId','Displaying\x20task\x20in\x20a\x20new\x20tab...','name','lodash','request-promise','util','moment','ioredis','../../../../config/environment','../../../../config/logger','freshsales','redis','localhost','socket.io-emitter'];(function(_0x13f0f2,_0x2b3566){var _0xe733ed=function(_0x2c64e4){while(--_0x2c64e4){_0x13f0f2['push'](_0x13f0f2['shift']());}};_0xe733ed(++_0x2b3566);}(_0x9253,0x91));var _0x3925=function(_0x5d9d1e,_0x287c37){_0x5d9d1e=_0x5d9d1e-0x0;var _0x2fc272=_0x9253[_0x5d9d1e];return _0x2fc272;};'use strict';var _=require(_0x3925('0x0'));var rp=require(_0x3925('0x1'));var md5=require('md5');var util=require(_0x3925('0x2'));var moment=require(_0x3925('0x3'));var Promise=require('bluebird');var Redis=require(_0x3925('0x4'));var intUtil=require('./util');var config=require(_0x3925('0x5'));var logger=require(_0x3925('0x6'))(_0x3925('0x7'));config[_0x3925('0x8')]=_['defaults'](config[_0x3925('0x8')],{'host':_0x3925('0x9'),'port':0x18eb});var io=require(_0x3925('0xa'))(new Redis(config[_0x3925('0x8')]));function getAdminId(_0x751397,_0x27231a,_0x40aaa5,_0x5abfc6){return new Promise(function(_0x3b579d,_0x3d4dae){var _0x236a33=![];var _0x3d3f8e={'method':_0x3925('0xb'),'uri':_0x5abfc6+_0x3925('0xc'),'json':!![]};_0x3d3f8e['headers']=_0x40aaa5;logger[_0x3925('0xd')](_0x3925('0xe'));return rp(_0x3d3f8e)[_0x3925('0xf')](function(_0x117285){if(_0x117285){var _0x13572d=_0x117285[_0x3925('0x10')];var _0x448c90=null;for(_0x448c90=0x0;_0x448c90<_0x13572d[_0x3925('0x11')];_0x448c90++){if(_0x13572d[_0x448c90][_0x3925('0x12')]===_0x751397['adminEmail']){_0x751397[_0x3925('0x13')]=_0x13572d[_0x448c90]['id'];_0x236a33=!![];}}if(_0x236a33){logger[_0x3925('0xd')](_0x3925('0x14'),_0x751397[_0x3925('0x13')]);_0x3b579d(_0x751397);}else{_0x3d4dae({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x3d4dae({'statusCode':0x194,'message':_0x3925('0x15')});}})[_0x3925('0x16')](function(_0x595c79){logger[_0x3925('0x17')]('['+[_0x27231a[_0x3925('0x18')]()]+']',_0x595c79[_0x3925('0x19')]);_0x3d4dae(_0x595c79);});});}function getUser(_0xca5ebd,_0x6be7dc,_0x4fa243){return function(_0x3b5762){return new Promise(function(_0x3cdc2d,_0x2c68a4){var _0x56bd39={'method':_0x3925('0xb'),'uri':_0x4fa243+_0x3925('0xc'),'json':!![]};_0x56bd39['headers']=_0x6be7dc;logger[_0x3925('0xd')](_0x3925('0x1a'));return rp(_0x56bd39)[_0x3925('0xf')](function(_0x490580){if(_0x490580){var _0x2e920f=_0x490580['users'];var _0x391876=![];var _0x34fc24=null;if(_0x3b5762[_0x3925('0x1b')]!==null){logger[_0x3925('0xd')](_0x3925('0x1c'),_0x3b5762[_0x3925('0x1b')]);_0x3b5762[_0x3925('0x1d')]=_0x3b5762[_0x3925('0x1b')];for(_0x34fc24=0x0;_0x34fc24<_0x2e920f[_0x3925('0x11')];_0x34fc24++){if(_0x2e920f[_0x34fc24][_0x3925('0x12')]===_0x3b5762['agentEmail']){_0x391876=!![];_0x3b5762[_0x3925('0x1e')]=_0x2e920f[_0x34fc24]['id'];logger[_0x3925('0xd')](_0x3925('0x1f'),_0x3b5762[_0x3925('0x1e')]);}}}if(!_0x391876){logger[_0x3925('0xd')](_0x3925('0x20'));_0x3b5762[_0x3925('0x1d')]=_0x3b5762['adminEmail'];_0x3b5762['userId']=_0x3b5762[_0x3925('0x13')];_0x391876=!![];}if(_0x391876){_0x3cdc2d(_0x3b5762);}else{_0x2c68a4({'statusCode':0x194,'message':_0x3925('0x15')});}}else{_0x2c68a4({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})['catch'](function(_0x4ba265){logger[_0x3925('0x17')]('['+[_0xca5ebd[_0x3925('0x18')]()]+']',_0x4ba265['message']);_0x2c68a4(_0x4ba265);});});};}function searchContact(_0x530ba9,_0x3d32f6,_0x65b876,_0x106764){return new Promise(function(_0xc23320,_0x1ecc92){var _0x47d5c7={'method':_0x3925('0xb'),'headers':_0x3d32f6,'uri':_0x530ba9+'/api/lookup?q='+_0x106764+_0x3925('0x21')+_0x65b876+_0x3925('0x22'),'json':!![]};rp(_0x47d5c7)[_0x3925('0xf')](function(_0x1d6e73){var _0x19e095=_[_0x3925('0x23')](_0x1d6e73[_0x3925('0x24')][_0x3925('0x24')],[_0x65b876,_0x106764]);_0xc23320(_0x19e095);})[_0x3925('0x16')](function(_0x29ffb7){_0x1ecc92(_0x29ffb7);});});}function getEndUser(_0xbbdba6,_0x43addb,_0x33202a){return function(_0x499ed1){return new Promise(function(_0x2d0295,_0x2d3f94){logger[_0x3925('0xd')](util[_0x3925('0x25')]('Searching\x20contact\x20with\x20phone\x20%s',_0x499ed1[_0x3925('0x26')]));searchContact(_0x33202a,_0x43addb,'mobile_number',_0x499ed1[_0x3925('0x26')])[_0x3925('0xf')](function(_0x423e78){if(_0x423e78){_0x499ed1[_0x3925('0x27')]=_0x423e78['id'];logger[_0x3925('0xd')](_0x3925('0x28'),_0x499ed1['endUserId']);return _0x2d0295(_0x499ed1);}searchContact(_0x33202a,_0x43addb,'work_number',_0x499ed1['contactNumber'])[_0x3925('0xf')](function(_0x4fe878){if(_0x4fe878){_0x499ed1['endUserId']=_0x4fe878['id'];logger['info']('Contact\x20found\x20work_number:',_0x499ed1[_0x3925('0x27')]);return _0x2d0295(_0x499ed1);}createEndUser(_0x499ed1,_0xbbdba6,_0x43addb,_0x33202a)[_0x3925('0xf')](function(_0x289b95){logger[_0x3925('0xd')]('Contact\x20created:',_0x289b95[_0x3925('0x27')]);return _0x2d0295(_0x289b95);});});})['catch'](function(_0x1d6b86){_0x2d3f94(_0x1d6b86);});});};}function createEndUser(_0x307301,_0x552740,_0x3d230e,_0x57d65b){return new Promise(function(_0x4b42a6,_0x513cd7){var _0x493597=moment();var _0x5c6fad={'method':'POST','uri':_0x57d65b+'/api/contacts','body':{'contact':{'last_name':_0x307301[_0x3925('0x26')],'work_number':_0x307301[_0x3925('0x26')],'mobile_number':_0x307301[_0x3925('0x26')],'owner_id':_0x307301['userId'],'created_at':_0x493597[_0x3925('0x25')](_0x3925('0x29'))}},'json':!![]};_0x5c6fad[_0x3925('0x2a')]=_0x3d230e;logger[_0x3925('0xd')](_0x3925('0x2b'));return rp(_0x5c6fad)['then'](function(_0x5cda92){_0x307301[_0x3925('0x27')]=_0x5cda92[_0x3925('0x2c')]['id'];_0x4b42a6(_0x307301);})[_0x3925('0x16')](function(_0x2db867){logger[_0x3925('0x17')]('['+[_0x552740[_0x3925('0x18')]()]+']',_0x2db867[_0x3925('0x19')]);_0x513cd7(_0x2db867[_0x3925('0x19')]);});});}function getTicket(_0x41d48b,_0x38fcd8,_0xc60bcf,_0x4df68d,_0x3a2b62){return function(_0x4f9283){logger['info'](_0x3925('0x2d'));return new Promise(function(_0x1d8dd6,_0x3064ce){var _0x52afdf=moment();var _0x5ad46c={'method':'POST','uri':_0xc60bcf+_0x3925('0x2e'),'body':{'title':intUtil[_0x3925('0x2f')](_0x4df68d['Subjects'],_0x3a2b62,'\x20'),'description':intUtil[_0x3925('0x2f')](_0x4df68d['Descriptions'],_0x3a2b62,'\x0a'),'owner_id':_0x4f9283[_0x3925('0x1e')],'creater_id':_0x4f9283[_0x3925('0x13')],'targetable_id':_0x4f9283['endUserId'],'targetable_type':_0x3925('0x30'),'created_at':_0x52afdf[_0x3925('0x25')]('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x52afdf[_0x3925('0x31')](0x1e,'m')[_0x3925('0x25')](_0x3925('0x29'))},'json':!![]};_0x5ad46c['headers']=_0x38fcd8;return rp(_0x5ad46c)['then'](function(_0x5b07d9){_0x4f9283['ticketId']=_0x5b07d9[_0x3925('0x32')]['id'];logger[_0x3925('0xd')](_0x3925('0x33'),_0x4f9283['ticketId']);_0x1d8dd6(_0x4f9283);})[_0x3925('0x16')](function(_0x35fef7){logger[_0x3925('0x17')]('['+[_0x41d48b['toUpperCase']()]+']',_0x35fef7[_0x3925('0x19')]);_0x3064ce(_0x35fef7[_0x3925('0x19')]);});});};}function emit(_0x73cfc3,_0x4f9683,_0x2dba00){var _0x1fa0a4={'uri':_0x73cfc3+_0x3925('0x34')+_0x2dba00};io['to'](util[_0x3925('0x25')](_0x3925('0x35'),_0x4f9683))['emit'](_0x3925('0x36'),_0x1fa0a4);}exports['cs']=function(_0x2103cd,_0x30274b,_0x48e26c,_0x3c96bb,_0x3e7c88,_0x196a46,_0x43aa7b,_0x1e7b0a){var _0x49d741={};var _0x142ab7={'Authorization':_0x3925('0x37')+_0x196a46[_0x3925('0x38')]};_0x196a46[_0x3925('0x39')]=intUtil[_0x3925('0x3a')](_0x196a46[_0x3925('0x39')]);_0x196a46[_0x3925('0x3b')]=intUtil[_0x3925('0x3a')](_0x196a46[_0x3925('0x3b')]);var _0x4fb576=_0x196a46[_0x3925('0x39')];_0x49d741[_0x3925('0x3c')]=_0x196a46[_0x3925('0x3d')];_0x49d741[_0x3925('0x26')]=_0x1e7b0a['toLowerCase']()===_0x3925('0x3e')?_0x30274b[_0x3925('0x3f')]:_0x30274b[_0x3925('0x40')];_0x49d741['callDirection']=_0x1e7b0a===_0x3925('0x41')||_0x1e7b0a===_0x3925('0x42')?'queue':_0x3925('0x3e');if(_0x3c96bb){_0x49d741[_0x3925('0x1b')]=_0x3c96bb['email'];}var _0x105bec=util['format'](_0x3925('0x43'),_0x196a46[_0x3925('0x3b')],_0x30274b[_0x3925('0x44')],md5(_0x30274b['uniqueid']));if(_0x3e7c88&&_0x3e7c88[_0x3925('0x45')]){logger[_0x3925('0xd')]('[QUEUE]',_0x3925('0x46'));_0x30274b[_0x3925('0x47')]=_0x105bec;}else if(_0x43aa7b&&_0x43aa7b[_0x3925('0x48')]&&_0x43aa7b[_0x3925('0x48')]!=='none'){logger[_0x3925('0xd')](_0x3925('0x49'),_0x3925('0x46'));_0x30274b[_0x3925('0x47')]=_0x105bec;}else{_0x30274b[_0x3925('0x47')]='';}return getAdminId(_0x49d741,_0x1e7b0a,_0x142ab7,_0x4fb576)['then'](getUser(_0x1e7b0a,_0x142ab7,_0x4fb576))[_0x3925('0xf')](getEndUser(_0x1e7b0a,_0x142ab7,_0x4fb576))['then'](getTicket(_0x1e7b0a,_0x142ab7,_0x4fb576,_0x48e26c,_0x30274b))[_0x3925('0xf')](function(_0x186765){logger[_0x3925('0xd')](util[_0x3925('0x25')](_0x3925('0x4a'),_0x186765[_0x3925('0x4b')]));if(_0x1e7b0a!==_0x3925('0x42')){logger[_0x3925('0xd')]('['+[_0x1e7b0a[_0x3925('0x18')]()]+']',_0x3925('0x4c'));emit(_0x4fb576,_0x3c96bb[_0x3925('0x4d')],_0x186765['endUserId']);}})[_0x3925('0x16')](function(_0x5ef6cd){logger[_0x3925('0x17')]('['+[_0x1e7b0a[_0x3925('0x18')]()]+']\x20Error\x20running\x20Freshsales\x20integration',util['inspect'](_0x5ef6cd,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x8507=['lodash','md5','util','moment','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','freshsales','redis','localhost','GET','/api/selector/owners','info','Getting\x20admin\x20information','then','users','email','adminEmail','adminId','Requested\x20Resource\x20not\x20Found','catch','error','message','headers','Getting\x20user\x20list','agentEmail','length','userId','User\x20found:','userEmail','toUpperCase','/api/lookup?q=','&entities=contact','find','contacts','format','contactNumber','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','YYYY-MM-DDTHH:mm:ss','contact','/api/tasks','getString','Subjects','Descriptions','Contact','add','task','Task\x20created:','ticketId','/contacts/','user:%s','trigger:browser:url','apiKey','remoteUri','stripTrailingSlash','serverUrl','outbound','calleridnum','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Freshsales\x20integration','inspect'];(function(_0x4ede7f,_0x669555){var _0x2877d1=function(_0x27816b){while(--_0x27816b){_0x4ede7f['push'](_0x4ede7f['shift']());}};_0x2877d1(++_0x669555);}(_0x8507,0x9a));var _0x7850=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8507[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x7850('0x0'));var rp=require('request-promise');var md5=require(_0x7850('0x1'));var util=require(_0x7850('0x2'));var moment=require(_0x7850('0x3'));var Promise=require(_0x7850('0x4'));var Redis=require(_0x7850('0x5'));var intUtil=require(_0x7850('0x6'));var config=require(_0x7850('0x7'));var logger=require(_0x7850('0x8'))(_0x7850('0x9'));config[_0x7850('0xa')]=_['defaults'](config['redis'],{'host':_0x7850('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function getAdminId(_0x4767ad,_0x402b63,_0x527aee,_0x1806fc){return new Promise(function(_0x5921d0,_0x1b03df){var _0xd17f=![];var _0x3aebc6={'method':_0x7850('0xc'),'uri':_0x1806fc+_0x7850('0xd'),'json':!![]};_0x3aebc6['headers']=_0x527aee;logger[_0x7850('0xe')](_0x7850('0xf'));return rp(_0x3aebc6)[_0x7850('0x10')](function(_0x2ca75c){if(_0x2ca75c){var _0x3dbfee=_0x2ca75c[_0x7850('0x11')];var _0x517b9f=null;for(_0x517b9f=0x0;_0x517b9f<_0x3dbfee['length'];_0x517b9f++){if(_0x3dbfee[_0x517b9f][_0x7850('0x12')]===_0x4767ad[_0x7850('0x13')]){_0x4767ad[_0x7850('0x14')]=_0x3dbfee[_0x517b9f]['id'];_0xd17f=!![];}}if(_0xd17f){logger[_0x7850('0xe')]('Admin\x20found:',_0x4767ad[_0x7850('0x14')]);_0x5921d0(_0x4767ad);}else{_0x1b03df({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x1b03df({'statusCode':0x194,'message':_0x7850('0x15')});}})[_0x7850('0x16')](function(_0x1fd1c2){logger[_0x7850('0x17')]('['+[_0x402b63['toUpperCase']()]+']',_0x1fd1c2[_0x7850('0x18')]);_0x1b03df(_0x1fd1c2);});});}function getUser(_0x47e8a4,_0x115a6b,_0x1c3ebf){return function(_0x2431aa){return new Promise(function(_0x452edb,_0x2c36e0){var _0x3f7d06={'method':_0x7850('0xc'),'uri':_0x1c3ebf+'/api/selector/owners','json':!![]};_0x3f7d06[_0x7850('0x19')]=_0x115a6b;logger[_0x7850('0xe')](_0x7850('0x1a'));return rp(_0x3f7d06)['then'](function(_0x18fbe8){if(_0x18fbe8){var _0x79c380=_0x18fbe8[_0x7850('0x11')];var _0x50e304=![];var _0x2c703c=null;if(_0x2431aa[_0x7850('0x1b')]!==null){logger[_0x7850('0xe')]('Getting\x20user\x20with\x20email',_0x2431aa[_0x7850('0x1b')]);_0x2431aa['userEmail']=_0x2431aa[_0x7850('0x1b')];for(_0x2c703c=0x0;_0x2c703c<_0x79c380[_0x7850('0x1c')];_0x2c703c++){if(_0x79c380[_0x2c703c][_0x7850('0x12')]===_0x2431aa[_0x7850('0x1b')]){_0x50e304=!![];_0x2431aa[_0x7850('0x1d')]=_0x79c380[_0x2c703c]['id'];logger[_0x7850('0xe')](_0x7850('0x1e'),_0x2431aa[_0x7850('0x1d')]);}}}if(!_0x50e304){logger[_0x7850('0xe')]('Admin\x20selected');_0x2431aa[_0x7850('0x1f')]=_0x2431aa[_0x7850('0x13')];_0x2431aa[_0x7850('0x1d')]=_0x2431aa[_0x7850('0x14')];_0x50e304=!![];}if(_0x50e304){_0x452edb(_0x2431aa);}else{_0x2c36e0({'statusCode':0x194,'message':_0x7850('0x15')});}}else{_0x2c36e0({'statusCode':0x194,'message':_0x7850('0x15')});}})['catch'](function(_0x241398){logger[_0x7850('0x17')]('['+[_0x47e8a4[_0x7850('0x20')]()]+']',_0x241398[_0x7850('0x18')]);_0x2c36e0(_0x241398);});});};}function searchContact(_0x2cb3d0,_0x24b2bb,_0x573c9e,_0x28d648){return new Promise(function(_0x3c2869,_0x1c40fd){var _0x117c21={'method':'GET','headers':_0x24b2bb,'uri':_0x2cb3d0+_0x7850('0x21')+_0x28d648+'&f='+_0x573c9e+_0x7850('0x22'),'json':!![]};rp(_0x117c21)[_0x7850('0x10')](function(_0xe9f3cf){var _0x31496d=_[_0x7850('0x23')](_0xe9f3cf[_0x7850('0x24')][_0x7850('0x24')],[_0x573c9e,_0x28d648]);_0x3c2869(_0x31496d);})[_0x7850('0x16')](function(_0x5cd59e){_0x1c40fd(_0x5cd59e);});});}function getEndUser(_0x10355a,_0x4c3ca2,_0x4627ea){return function(_0x2e113e){return new Promise(function(_0x40d6a6,_0x4058a6){logger['info'](util[_0x7850('0x25')]('Searching\x20contact\x20with\x20phone\x20%s',_0x2e113e[_0x7850('0x26')]));searchContact(_0x4627ea,_0x4c3ca2,'mobile_number',_0x2e113e['contactNumber'])[_0x7850('0x10')](function(_0x21e43a){if(_0x21e43a){_0x2e113e[_0x7850('0x27')]=_0x21e43a['id'];logger['info'](_0x7850('0x28'),_0x2e113e[_0x7850('0x27')]);return _0x40d6a6(_0x2e113e);}searchContact(_0x4627ea,_0x4c3ca2,_0x7850('0x29'),_0x2e113e[_0x7850('0x26')])[_0x7850('0x10')](function(_0xf93901){if(_0xf93901){_0x2e113e[_0x7850('0x27')]=_0xf93901['id'];logger['info'](_0x7850('0x2a'),_0x2e113e[_0x7850('0x27')]);return _0x40d6a6(_0x2e113e);}createEndUser(_0x2e113e,_0x10355a,_0x4c3ca2,_0x4627ea)[_0x7850('0x10')](function(_0x108eb9){logger[_0x7850('0xe')](_0x7850('0x2b'),_0x108eb9[_0x7850('0x27')]);return _0x40d6a6(_0x108eb9);});});})[_0x7850('0x16')](function(_0x15d280){_0x4058a6(_0x15d280);});});};}function createEndUser(_0x57b61a,_0x11dd99,_0x544f15,_0x463242){return new Promise(function(_0x323f02,_0x1fa731){var _0x51253a=moment();var _0x2f004b={'method':_0x7850('0x2c'),'uri':_0x463242+'/api/contacts','body':{'contact':{'last_name':_0x57b61a['contactNumber'],'work_number':_0x57b61a[_0x7850('0x26')],'mobile_number':_0x57b61a[_0x7850('0x26')],'owner_id':_0x57b61a[_0x7850('0x1d')],'created_at':_0x51253a['format'](_0x7850('0x2d'))}},'json':!![]};_0x2f004b['headers']=_0x544f15;logger['info']('Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact');return rp(_0x2f004b)[_0x7850('0x10')](function(_0x5c5f4c){_0x57b61a[_0x7850('0x27')]=_0x5c5f4c[_0x7850('0x2e')]['id'];_0x323f02(_0x57b61a);})[_0x7850('0x16')](function(_0x5eb1fc){logger[_0x7850('0x17')]('['+[_0x11dd99['toUpperCase']()]+']',_0x5eb1fc[_0x7850('0x18')]);_0x1fa731(_0x5eb1fc[_0x7850('0x18')]);});});}function getTicket(_0x3821fb,_0x6299e5,_0x22f2d4,_0x25ad56,_0x577f8a){return function(_0x5c2482){logger['info']('Creating\x20new\x20task');return new Promise(function(_0x48db54,_0x457458){var _0x19f32c=moment();var _0x1b51ce={'method':_0x7850('0x2c'),'uri':_0x22f2d4+_0x7850('0x2f'),'body':{'title':intUtil[_0x7850('0x30')](_0x25ad56[_0x7850('0x31')],_0x577f8a,'\x20'),'description':intUtil[_0x7850('0x30')](_0x25ad56[_0x7850('0x32')],_0x577f8a,'\x0a'),'owner_id':_0x5c2482['userId'],'creater_id':_0x5c2482[_0x7850('0x14')],'targetable_id':_0x5c2482[_0x7850('0x27')],'targetable_type':_0x7850('0x33'),'created_at':_0x19f32c[_0x7850('0x25')]('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x19f32c[_0x7850('0x34')](0x1e,'m')[_0x7850('0x25')](_0x7850('0x2d'))},'json':!![]};_0x1b51ce[_0x7850('0x19')]=_0x6299e5;return rp(_0x1b51ce)[_0x7850('0x10')](function(_0x4d2eab){_0x5c2482['ticketId']=_0x4d2eab[_0x7850('0x35')]['id'];logger['info'](_0x7850('0x36'),_0x5c2482[_0x7850('0x37')]);_0x48db54(_0x5c2482);})[_0x7850('0x16')](function(_0xdf6a76){logger[_0x7850('0x17')]('['+[_0x3821fb[_0x7850('0x20')]()]+']',_0xdf6a76[_0x7850('0x18')]);_0x457458(_0xdf6a76[_0x7850('0x18')]);});});};}function emit(_0x10cd80,_0x2edfc8,_0xe71e33){var _0x4ac0c9={'uri':_0x10cd80+_0x7850('0x38')+_0xe71e33};io['to'](util[_0x7850('0x25')](_0x7850('0x39'),_0x2edfc8))['emit'](_0x7850('0x3a'),_0x4ac0c9);}exports['cs']=function(_0x4254ba,_0x3f5b39,_0x3ab0b3,_0xe791cd,_0xc47c46,_0x5a9338,_0x3d8bf2,_0x5b41f7){var _0x1f7d32={};var _0x58fe08={'Authorization':'Token\x20token='+_0x5a9338[_0x7850('0x3b')]};_0x5a9338[_0x7850('0x3c')]=intUtil[_0x7850('0x3d')](_0x5a9338[_0x7850('0x3c')]);_0x5a9338['serverUrl']=intUtil[_0x7850('0x3d')](_0x5a9338[_0x7850('0x3e')]);var _0x1a4f84=_0x5a9338[_0x7850('0x3c')];_0x1f7d32[_0x7850('0x13')]=_0x5a9338['username'];_0x1f7d32[_0x7850('0x26')]=_0x5b41f7['toLowerCase']()===_0x7850('0x3f')?_0x3f5b39['destcalleridnum']:_0x3f5b39[_0x7850('0x40')];_0x1f7d32['callDirection']=_0x5b41f7===_0x7850('0x41')||_0x5b41f7===_0x7850('0x42')?_0x7850('0x41'):_0x7850('0x3f');if(_0xe791cd){_0x1f7d32[_0x7850('0x1b')]=_0xe791cd[_0x7850('0x12')];}var _0x5073e0=util[_0x7850('0x25')](_0x7850('0x43'),_0x5a9338[_0x7850('0x3e')],_0x3f5b39[_0x7850('0x44')],md5(_0x3f5b39['uniqueid']));if(_0xc47c46&&_0xc47c46['monitor_format']){logger[_0x7850('0xe')]('[QUEUE]','Recording\x20is\x20enabled!');_0x3f5b39[_0x7850('0x45')]=_0x5073e0;}else if(_0x3d8bf2&&_0x3d8bf2['recordingFormat']&&_0x3d8bf2[_0x7850('0x46')]!==_0x7850('0x47')){logger[_0x7850('0xe')](_0x7850('0x48'),'Recording\x20is\x20enabled!');_0x3f5b39[_0x7850('0x45')]=_0x5073e0;}else{_0x3f5b39[_0x7850('0x45')]='';}return getAdminId(_0x1f7d32,_0x5b41f7,_0x58fe08,_0x1a4f84)[_0x7850('0x10')](getUser(_0x5b41f7,_0x58fe08,_0x1a4f84))['then'](getEndUser(_0x5b41f7,_0x58fe08,_0x1a4f84))[_0x7850('0x10')](getTicket(_0x5b41f7,_0x58fe08,_0x1a4f84,_0x3ab0b3,_0x3f5b39))[_0x7850('0x10')](function(_0x1c4080){logger[_0x7850('0xe')](util[_0x7850('0x25')](_0x7850('0x49'),_0x1c4080[_0x7850('0x37')]));if(_0x5b41f7!==_0x7850('0x42')){logger[_0x7850('0xe')]('['+[_0x5b41f7[_0x7850('0x20')]()]+']',_0x7850('0x4a'));emit(_0x1a4f84,_0xe791cd['name'],_0x1c4080[_0x7850('0x27')]);}})[_0x7850('0x16')](function(_0x418557){logger[_0x7850('0x17')]('['+[_0x5b41f7[_0x7850('0x20')]()]+_0x7850('0x4b'),util[_0x7850('0x4c')](_0x418557,{'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 28ca489..2cd058a 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 _0xffc5=['toLowerCase','find','Configurations','data3','queue','outbound','log','sugarcrm','freshdesk','zoho','unknown\x20integration','[EXEC]','format','../../../../config/logger','error','%s\x20account\x20#%s\x20not\x20found','data2','lodash','./zendesk','./salesforce','./freshdesk','./zoho','./desk','./vtiger','./freshsales','zendesk','desk','dynamics365','freshsales','servicenow','exec','data1'];(function(_0x1025a6,_0x246898){var _0x103306=function(_0x239807){while(--_0x239807){_0x1025a6['push'](_0x1025a6['shift']());}};_0x103306(++_0x246898);}(_0xffc5,0x151));var _0x5ffc=function(_0x50f392,_0x1d8441){_0x50f392=_0x50f392-0x0;var _0x5926f2=_0xffc5[_0x50f392];return _0x5926f2;};'use strict';var _=require(_0x5ffc('0x0'));var util=require('util');var zendesk=require(_0x5ffc('0x1'));var salesforce=require(_0x5ffc('0x2'));var sugarcrm=require('./sugarcrm');var freshdesk=require(_0x5ffc('0x3'));var zoho=require(_0x5ffc('0x4'));var desk=require(_0x5ffc('0x5'));var vtiger=require(_0x5ffc('0x6'));var servicenow=require('./servicenow');var dynamics365=require('./dynamics365');var freshsales=require(_0x5ffc('0x7'));var integrations=[_0x5ffc('0x8'),'salesforce','sugarcrm','freshdesk','zoho',_0x5ffc('0x9'),'vtiger',_0x5ffc('0xa'),_0x5ffc('0xb'),_0x5ffc('0xc')];exports[_0x5ffc('0xd')]=function(_0x31d0ba,_0x259405,_0x797dcc,_0x3d6428,_0x544c2e,_0x5f116e){if(_0x797dcc){if(_['includes'](integrations,_0x31d0ba[_0x5ffc('0xe')][_0x5ffc('0xf')]())){try{var _0x25a160=null;var _0x4e6d2e='';var _0x3aafc6=_0x797dcc[_0x31d0ba[_0x5ffc('0xe')][_0x5ffc('0xf')]()];if(_0x3aafc6){var _0x2af000=_0x3aafc6[_0x31d0ba['data2']];if(_0x2af000){var _0x49f3ed=_[_0x5ffc('0x10')](_0x2af000[_0x5ffc('0x11')],{'id':parseInt(_0x31d0ba[_0x5ffc('0x12')],0xa)});if(_0x49f3ed){if(_0x3d6428){if(_0x544c2e&&_0x259405[_0x5ffc('0x13')]){_0x4e6d2e=_0x5ffc('0x13');}else if(_0x259405['routeId']){_0x4e6d2e=_0x5ffc('0x14');}else{console[_0x5ffc('0x15')]('EVENT\x20UNKNOWN',_0x259405);}}else{_0x4e6d2e='unmanaged';}switch(_0x31d0ba[_0x5ffc('0xe')][_0x5ffc('0xf')]()){case'zendesk':zendesk[_0x4e6d2e](_0x31d0ba,_0x259405,_0x49f3ed,_0x3d6428,_0x544c2e,_0x2af000,_0x5f116e);break;case'salesforce':salesforce[_0x4e6d2e](_0x31d0ba,_0x259405,_0x49f3ed,_0x3d6428,_0x544c2e,_0x2af000,_0x5f116e);break;case _0x5ffc('0x16'):sugarcrm[_0x4e6d2e](_0x31d0ba,_0x259405,_0x49f3ed,_0x3d6428,_0x544c2e,_0x2af000,_0x5f116e);break;case _0x5ffc('0x17'):freshdesk[_0x4e6d2e](_0x31d0ba,_0x259405,_0x49f3ed,_0x3d6428,_0x544c2e,_0x2af000,_0x5f116e);break;case _0x5ffc('0x18'):zoho[_0x4e6d2e](_0x31d0ba,_0x259405,_0x49f3ed,_0x3d6428,_0x544c2e,_0x2af000,_0x5f116e);break;case _0x5ffc('0x9'):desk[_0x4e6d2e](_0x31d0ba,_0x259405,_0x49f3ed,_0x3d6428,_0x544c2e,_0x2af000,_0x5f116e);break;case'vtiger':vtiger[_0x4e6d2e](_0x31d0ba,_0x259405,_0x49f3ed,_0x3d6428,_0x544c2e,_0x2af000,_0x5f116e);break;case _0x5ffc('0xb'):freshsales['cs'](_0x31d0ba,_0x259405,_0x49f3ed,_0x3d6428,_0x544c2e,_0x2af000,_0x5f116e,_0x4e6d2e);break;case _0x5ffc('0xc'):servicenow['cs'](_0x31d0ba,_0x259405,_0x49f3ed,_0x3d6428,_0x544c2e,_0x2af000,_0x5f116e,_0x4e6d2e);break;case _0x5ffc('0xa'):dynamics365['cs'](_0x31d0ba,_0x259405,_0x49f3ed,_0x3d6428,_0x544c2e,_0x2af000,_0x5f116e,_0x4e6d2e);break;default:console['log'](_0x5ffc('0x19'));}}else{_0x25a160=require('../../../../config/logger')(_0x31d0ba[_0x5ffc('0xe')][_0x5ffc('0xf')]());_0x25a160['error'](_0x5ffc('0x1a'),util[_0x5ffc('0x1b')]('%s\x20configuration\x20#%s\x20not\x20found',_0x31d0ba['data1'][_0x5ffc('0xf')](),_0x31d0ba['data3']));}}else{_0x25a160=require(_0x5ffc('0x1c'))(_0x31d0ba[_0x5ffc('0xe')][_0x5ffc('0xf')]());_0x25a160[_0x5ffc('0x1d')]('[EXEC]',util[_0x5ffc('0x1b')](_0x5ffc('0x1e'),_0x31d0ba[_0x5ffc('0xe')][_0x5ffc('0xf')](),_0x31d0ba[_0x5ffc('0x1f')]));}}else{}}catch(_0x232232){console[_0x5ffc('0x1d')](_0x232232);}}}}; \ No newline at end of file +var _0x529f=['[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','lodash','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./vtiger','./servicenow','./dynamics365','./freshsales','zendesk','sugarcrm','freshdesk','zoho','desk','vtiger','dynamics365','freshsales','servicenow','exec','data1','toLowerCase','data2','Configurations','data3','queue','routeId','outbound','EVENT\x20UNKNOWN','salesforce','log','unknown\x20integration','../../../../config/logger','error'];(function(_0x4039e9,_0x1d7872){var _0x144a0a=function(_0x127c98){while(--_0x127c98){_0x4039e9['push'](_0x4039e9['shift']());}};_0x144a0a(++_0x1d7872);}(_0x529f,0x159));var _0xf529=function(_0x88533b,_0x5e3c97){_0x88533b=_0x88533b-0x0;var _0x275928=_0x529f[_0x88533b];return _0x275928;};'use strict';var _=require(_0xf529('0x0'));var util=require('util');var zendesk=require(_0xf529('0x1'));var salesforce=require(_0xf529('0x2'));var sugarcrm=require(_0xf529('0x3'));var freshdesk=require(_0xf529('0x4'));var zoho=require(_0xf529('0x5'));var desk=require(_0xf529('0x6'));var vtiger=require(_0xf529('0x7'));var servicenow=require(_0xf529('0x8'));var dynamics365=require(_0xf529('0x9'));var freshsales=require(_0xf529('0xa'));var integrations=[_0xf529('0xb'),'salesforce',_0xf529('0xc'),_0xf529('0xd'),_0xf529('0xe'),_0xf529('0xf'),_0xf529('0x10'),_0xf529('0x11'),_0xf529('0x12'),_0xf529('0x13')];exports[_0xf529('0x14')]=function(_0x125c0c,_0x21ba58,_0x144657,_0x463de4,_0x43caca,_0x1df300){if(_0x144657){if(_['includes'](integrations,_0x125c0c[_0xf529('0x15')][_0xf529('0x16')]())){try{var _0x499a99=null;var _0x3dd61d='';var _0x459139=_0x144657[_0x125c0c[_0xf529('0x15')]['toLowerCase']()];if(_0x459139){var _0x21881b=_0x459139[_0x125c0c[_0xf529('0x17')]];if(_0x21881b){var _0x11605c=_['find'](_0x21881b[_0xf529('0x18')],{'id':parseInt(_0x125c0c[_0xf529('0x19')],0xa)});if(_0x11605c){if(_0x463de4){if(_0x43caca&&_0x21ba58[_0xf529('0x1a')]){_0x3dd61d='queue';}else if(_0x21ba58[_0xf529('0x1b')]){_0x3dd61d=_0xf529('0x1c');}else{console['log'](_0xf529('0x1d'),_0x21ba58);}}else{_0x3dd61d='unmanaged';}switch(_0x125c0c[_0xf529('0x15')]['toLowerCase']()){case _0xf529('0xb'):zendesk[_0x3dd61d](_0x125c0c,_0x21ba58,_0x11605c,_0x463de4,_0x43caca,_0x21881b,_0x1df300);break;case _0xf529('0x1e'):salesforce[_0x3dd61d](_0x125c0c,_0x21ba58,_0x11605c,_0x463de4,_0x43caca,_0x21881b,_0x1df300);break;case'sugarcrm':sugarcrm[_0x3dd61d](_0x125c0c,_0x21ba58,_0x11605c,_0x463de4,_0x43caca,_0x21881b,_0x1df300);break;case _0xf529('0xd'):freshdesk[_0x3dd61d](_0x125c0c,_0x21ba58,_0x11605c,_0x463de4,_0x43caca,_0x21881b,_0x1df300);break;case _0xf529('0xe'):zoho[_0x3dd61d](_0x125c0c,_0x21ba58,_0x11605c,_0x463de4,_0x43caca,_0x21881b,_0x1df300);break;case'desk':desk[_0x3dd61d](_0x125c0c,_0x21ba58,_0x11605c,_0x463de4,_0x43caca,_0x21881b,_0x1df300);break;case _0xf529('0x10'):vtiger[_0x3dd61d](_0x125c0c,_0x21ba58,_0x11605c,_0x463de4,_0x43caca,_0x21881b,_0x1df300);break;case _0xf529('0x12'):freshsales['cs'](_0x125c0c,_0x21ba58,_0x11605c,_0x463de4,_0x43caca,_0x21881b,_0x1df300,_0x3dd61d);break;case _0xf529('0x13'):servicenow['cs'](_0x125c0c,_0x21ba58,_0x11605c,_0x463de4,_0x43caca,_0x21881b,_0x1df300,_0x3dd61d);break;case _0xf529('0x11'):dynamics365['cs'](_0x125c0c,_0x21ba58,_0x11605c,_0x463de4,_0x43caca,_0x21881b,_0x1df300,_0x3dd61d);break;default:console[_0xf529('0x1f')](_0xf529('0x20'));}}else{_0x499a99=require(_0xf529('0x21'))(_0x125c0c[_0xf529('0x15')][_0xf529('0x16')]());_0x499a99[_0xf529('0x22')](_0xf529('0x23'),util[_0xf529('0x24')](_0xf529('0x25'),_0x125c0c[_0xf529('0x15')][_0xf529('0x16')](),_0x125c0c[_0xf529('0x19')]));}}else{_0x499a99=require('../../../../config/logger')(_0x125c0c[_0xf529('0x15')]['toLowerCase']());_0x499a99[_0xf529('0x22')](_0xf529('0x23'),util[_0xf529('0x24')]('%s\x20account\x20#%s\x20not\x20found',_0x125c0c['data1'][_0xf529('0x16')](),_0x125c0c['data2']));}}else{}}catch(_0x348d82){console[_0xf529('0x22')](_0x348d82);}}}}; \ 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 c7590fe..35e2866 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 _0x60fa=['%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridnum','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','trigger:browser:url','Salesforce\x20account\x20type\x20not\x20recognized','[OUTBOUND]','unmanaged','monitor_format','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.','lodash','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','localhost','socket.io-emitter','assign','Subjects','getString','Descriptions','ticketType','Task','ActivityDate','utc','IsReminderSet','IsRecurrence','endUserType','contact','lead','WhoId','WhatId','Case','ContactId','account','AccountId','leadId','Association\x20between\x20Case\x20and\x20Lead\x20skipped','create','isNil','validateEmail','sobject','execute','then','find','Email','info','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','user_id','display_name','identity','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','Contact','length','additionalSearchLead','Lead','additionalSearchAccount','Account','first','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','picklist','idField','variable','variableName','toString','customVariable','Variable','name','password','concat','Connection','remoteUri','https://login.salesforce.com','clientSecret','Connection\x20established.','queue','serverUrl','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','email','calleridname','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','user:%s','trigger:salesforce:display','newTab','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','recordingFormat','none'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x60fa,0x10a));var _0xa60f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x60fa[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xa60f('0x0'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa60f('0x1'));var md5=require(_0xa60f('0x2'));var jsforce=require('jsforce');var util=require(_0xa60f('0x3'));var Redis=require(_0xa60f('0x4'));var intUtil=require(_0xa60f('0x5'));var config=require(_0xa60f('0x6'));var logger=require(_0xa60f('0x7'))(_0xa60f('0x8'));config[_0xa60f('0x9')]=_['defaults'](config[_0xa60f('0x9')],{'host':_0xa60f('0xa'),'port':0x18eb});var io=require(_0xa60f('0xb'))(new Redis(config[_0xa60f('0x9')]));function emit(_0x90b82d,_0x1eb593,_0x116611){io['to'](_0x90b82d)['emit'](_0x1eb593,_0x116611);}function getTicket(_0x221e3a,_0x2896eb,_0x15b508,_0x401cb9,_0x3614c4,_0x53b11f,_0x36879c,_0x90ef75){var _0x5ac8f8=Object[_0xa60f('0xc')]({},{'OwnerId':_0x2896eb['id'],'Subject':intUtil['getString'](_0x401cb9[_0xa60f('0xd')],_0x3614c4,'\x20'),'Description':intUtil[_0xa60f('0xe')](_0x401cb9[_0xa60f('0xf')],_0x3614c4,'\x0a')},getCustomFields(_0x53b11f,_0x3614c4));if(_0x15b508){if(_0x401cb9[_0xa60f('0x10')]===_0xa60f('0x11')){_0x5ac8f8[_0xa60f('0x12')]=moment[_0xa60f('0x13')]();_0x5ac8f8[_0xa60f('0x14')]=![];_0x5ac8f8[_0xa60f('0x15')]=![];if(_0x15b508[_0xa60f('0x16')]===_0xa60f('0x17')||_0x15b508[_0xa60f('0x16')]===_0xa60f('0x18')){_0x5ac8f8[_0xa60f('0x19')]=_0x15b508['id'];}else if(_0x15b508[_0xa60f('0x16')]==='account'){_0x5ac8f8[_0xa60f('0x1a')]=_0x15b508['id'];}}else if(_0x401cb9[_0xa60f('0x10')]===_0xa60f('0x1b')){if(_0x15b508['endUserType']===_0xa60f('0x17')){_0x5ac8f8[_0xa60f('0x1c')]=_0x15b508['id'];}else if(_0x15b508[_0xa60f('0x16')]===_0xa60f('0x1d')){_0x5ac8f8[_0xa60f('0x1e')]=_0x15b508['id'];}else if(_0x15b508[_0xa60f('0x16')]===_0xa60f('0x18')&&_0x401cb9[_0xa60f('0x1f')]){_0x5ac8f8[_0x401cb9[_0xa60f('0x1f')]]=_0x15b508['id'];}else{logger['info'](_0xa60f('0x20'));}}}return _0x36879c['sobject'](_0x401cb9[_0xa60f('0x10')])[_0xa60f('0x21')](_0x5ac8f8);}function getUser(_0xd13853,_0x339b6e,_0x1255d8){if(!_[_0xa60f('0x22')](_0x339b6e)&&intUtil[_0xa60f('0x23')](_0x339b6e)){var _0x1c37f9={'Email':_0x339b6e};var _0x2d210e={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x1255d8[_0xa60f('0x24')]('User')['find'](_0x1c37f9,_0x2d210e)[_0xa60f('0x25')]()[_0xa60f('0x26')](function(_0x33a179){if(_0x33a179['length']){var _0x2c8261=_[_0xa60f('0x27')](_0x33a179,function(_0x49da7e){return _0x49da7e[_0xa60f('0x28')]===_0x339b6e;});if(_0x2c8261){logger[_0xa60f('0x29')]('Agent\x20%s\x20found.',_0x339b6e);return BPromise[_0xa60f('0x2a')]({'id':_0x2c8261['Id'],'name':_0x2c8261[_0xa60f('0x2b')]});}}else{logger[_0xa60f('0x29')](_0xa60f('0x2c'),_0x339b6e);return _0x1255d8['identity']()[_0xa60f('0x26')](function(_0x465d3e){return BPromise[_0xa60f('0x2a')]({'id':_0x465d3e[_0xa60f('0x2d')],'name':_0x465d3e[_0xa60f('0x2e')]});});}});}else{logger['info'](_0xa60f('0x2c'),_0x339b6e);return _0x1255d8[_0xa60f('0x2f')]()[_0xa60f('0x26')](function(_0x4e95f8){return BPromise[_0xa60f('0x2a')]({'id':_0x4e95f8['user_id'],'name':_0x4e95f8['display_name']});});}}function getEndUser(_0xa97ad,_0x245ce0,_0x40c443,_0x56b612,_0x269616){var _0x3f29f7={'$or':{'Phone':_0x56b612}};var _0x29cca6={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xa60f('0x2a')]()[_0xa60f('0x26')](function(){logger[_0xa60f('0x29')]('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x56b612,_0x245ce0[_0xa60f('0x30')]);switch(_0x245ce0[_0xa60f('0x30')]){case _0xa60f('0x31'):var _0x1f2fea=_[_0xa60f('0x32')](_0x3f29f7);if(_0x245ce0[_0xa60f('0x33')]){var _0x5b7a8d={};_0x5b7a8d[_0x245ce0[_0xa60f('0x33')]]=_0x56b612;_[_0xa60f('0x34')](_0x1f2fea[_0xa60f('0x35')],_0x5b7a8d);}return _0x269616[_0xa60f('0x24')](_0xa60f('0x36'))[_0xa60f('0x27')](_0x1f2fea,_0x29cca6)[_0xa60f('0x25')]()['then'](function(_0x21e655){if(_0x21e655&&_0x21e655[_0xa60f('0x37')]){return _0x21e655;}else{var _0xaa7af4=_[_0xa60f('0x32')](_0x3f29f7);if(_0x245ce0[_0xa60f('0x38')]){var _0x3199fa={};_0x3199fa[_0x245ce0[_0xa60f('0x38')]]=_0x56b612;_[_0xa60f('0x34')](_0xaa7af4[_0xa60f('0x35')],_0x3199fa);}return _0x269616[_0xa60f('0x24')](_0xa60f('0x39'))[_0xa60f('0x27')](_0xaa7af4,_0x29cca6);}});case'account_contact_lead':var _0x4aeae8=_['cloneDeep'](_0x3f29f7);if(_0x245ce0[_0xa60f('0x3a')]){var _0x5b7a8d={};_0x5b7a8d[_0x245ce0[_0xa60f('0x3a')]]=_0x56b612;_[_0xa60f('0x34')](_0x4aeae8[_0xa60f('0x35')],_0x5b7a8d);}return _0x269616[_0xa60f('0x24')](_0xa60f('0x3b'))['find'](_0x4aeae8,_0x29cca6)[_0xa60f('0x25')]()[_0xa60f('0x26')](function(_0x34c975){if(_0x34c975&&_0x34c975['length']){return _0x34c975;}else{var _0x553ec8=_[_0xa60f('0x32')](_0x3f29f7);if(_0x245ce0['additionalSearchContact']){var _0x222351={};_0x222351[_0x245ce0[_0xa60f('0x33')]]=_0x56b612;_[_0xa60f('0x34')](_0x553ec8['$or'],_0x222351);}return _0x269616[_0xa60f('0x24')](_0xa60f('0x36'))['find'](_0x553ec8,_0x29cca6)[_0xa60f('0x26')](function(_0x1866f5){if(_0x1866f5&&_0x1866f5[_0xa60f('0x37')]){return _0x1866f5;}else{var _0x4ca4d0=_['cloneDeep'](_0x3f29f7);if(_0x245ce0[_0xa60f('0x38')]){var _0x5def93={};_0x5def93[_0x245ce0['additionalSearchLead']]=_0x56b612;_[_0xa60f('0x34')](_0x4ca4d0[_0xa60f('0x35')],_0x5def93);}return _0x269616[_0xa60f('0x24')]('Lead')[_0xa60f('0x27')](_0x4ca4d0,_0x29cca6);}});}});case _0xa60f('0x17'):var _0x1f2fea=_['cloneDeep'](_0x3f29f7);if(_0x245ce0[_0xa60f('0x33')]){var _0x5b7a8d={};_0x5b7a8d[_0x245ce0['additionalSearchContact']]=_0x56b612;_['merge'](_0x1f2fea[_0xa60f('0x35')],_0x5b7a8d);}return _0x269616['sobject'](_0xa60f('0x36'))[_0xa60f('0x27')](_0x1f2fea,_0x29cca6)[_0xa60f('0x25')]();case _0xa60f('0x18'):var _0x21e4e9=_[_0xa60f('0x32')](_0x3f29f7);if(_0x245ce0[_0xa60f('0x38')]){var _0x5b7a8d={};_0x5b7a8d[_0x245ce0[_0xa60f('0x38')]]=_0x56b612;_[_0xa60f('0x34')](_0x21e4e9[_0xa60f('0x35')],_0x5b7a8d);}return _0x269616[_0xa60f('0x24')](_0xa60f('0x39'))['find'](_0x21e4e9,_0x29cca6);case'account':var _0x4aeae8=_[_0xa60f('0x32')](_0x3f29f7);if(_0x245ce0[_0xa60f('0x3a')]){var _0x5b7a8d={};_0x5b7a8d[_0x245ce0[_0xa60f('0x3a')]]=_0x56b612;_[_0xa60f('0x34')](_0x4aeae8[_0xa60f('0x35')],_0x5b7a8d);}return _0x269616[_0xa60f('0x24')](_0xa60f('0x3b'))['find'](_0x4aeae8,_0x29cca6);default:return null;}})[_0xa60f('0x26')](function(_0x57538d){if(_0x57538d&&_0x57538d[_0xa60f('0x37')]){var _0x581e32=_[_0xa60f('0x3c')](_0x57538d);if(_0x581e32){return BPromise['resolve']({'id':_0x581e32['Id'],'name':_0x581e32[_0xa60f('0x2b')],'phone':_0x581e32[_0xa60f('0x3d')],'endUserType':_0x581e32[_0xa60f('0x3e')][_0xa60f('0x3f')][_0xa60f('0x40')]()});}}})[_0xa60f('0x26')](function(_0x2bcc3b){if(_0x2bcc3b){logger['info']('Enduser\x20(%s)\x20with\x20phone\x20%s\x20found',_0x2bcc3b[_0xa60f('0x16')],_0x56b612);return BPromise['resolve'](_0x2bcc3b);}else{logger[_0xa60f('0x29')](_0xa60f('0x41'),_0x56b612);var _0x3c38d9={'Phone':_0x56b612};if(_0x245ce0[_0xa60f('0x42')]){if(_0x245ce0[_0xa60f('0x42')]==='contact'){logger[_0xa60f('0x29')](_0xa60f('0x43'),_0x56b612,_0x245ce0[_0xa60f('0x42')]);_0x3c38d9[_0xa60f('0x44')]=_0x40c443!==_0xa60f('0x45')?_0x40c443:util[_0xa60f('0x46')](_0xa60f('0x47'),_0x56b612);}else if(_0x245ce0[_0xa60f('0x42')]===_0xa60f('0x18')){logger['info'](_0xa60f('0x43'),_0x56b612,_0x245ce0[_0xa60f('0x42')]);_0x3c38d9['LastName']=_0x40c443!==_0xa60f('0x45')?_0x40c443:util[_0xa60f('0x46')]('Caller\x20-\x20%s',_0x56b612);_0x3c38d9[_0xa60f('0x48')]=_0xa60f('0x49');}else if(_0x245ce0['moduleCreate']===_0xa60f('0x1d')){logger['info'](_0xa60f('0x43'),_0x56b612,_0x245ce0[_0xa60f('0x42')]);_0x3c38d9[_0xa60f('0x2b')]=_0x40c443!==_0xa60f('0x45')?_0x40c443:util[_0xa60f('0x46')]('Caller\x20-\x20%s',_0x56b612);}else{return null;}}return _0x269616[_0xa60f('0x24')](_[_0xa60f('0x4a')](_0x245ce0[_0xa60f('0x42')]))['create'](_0x3c38d9)[_0xa60f('0x26')](function(_0xcdb655){return BPromise['resolve']({'id':_0xcdb655['id'],'endUserType':_0x245ce0[_0xa60f('0x42')]});});}});}function getCustomFields(_0x4127b7,_0x2be249){var _0x4caaef={};if(_0x4127b7[_0xa60f('0x37')]>0x0){_[_0xa60f('0x4b')](_0x4127b7,function(_0x3ac617){if(_[_0xa60f('0x4c')](['string',_0xa60f('0x4d')],_0x3ac617[_0xa60f('0x3f')])&&_0x3ac617[_0xa60f('0x4e')]){_0x4caaef[_0x3ac617['idField']]=_0x3ac617['content']['toString']();}else if(_0x3ac617[_0xa60f('0x3f')]===_0xa60f('0x4f')&&_0x3ac617[_0xa60f('0x50')]&&_0x3ac617[_0xa60f('0x4e')]){_0x2be249[_0x3ac617[_0xa60f('0x50')]]&&(_0x4caaef[_0x3ac617[_0xa60f('0x4e')]]=_0x2be249[_0x3ac617[_0xa60f('0x50')]][_0xa60f('0x51')]());}else if(_0x3ac617['type']===_0xa60f('0x52')&&_0x3ac617['Variable']&&_0x3ac617[_0xa60f('0x53')][_0xa60f('0x54')]&&_0x3ac617[_0xa60f('0x4e')]){_0x2be249[_0x3ac617[_0xa60f('0x53')][_0xa60f('0x54')][_0xa60f('0x40')]()]&&(_0x4caaef[_0x3ac617[_0xa60f('0x4e')]]=_0x2be249[_0x3ac617[_0xa60f('0x53')][_0xa60f('0x54')][_0xa60f('0x40')]()][_0xa60f('0x51')]());}});}return _0x4caaef;}function getConnection(_0x3fe1f9){var _0x58fb86=_0x3fe1f9[_0xa60f('0x55')][_0xa60f('0x56')](_0x3fe1f9['securityToken']);var _0x6ba37d=new jsforce[(_0xa60f('0x57'))]({'oauth2':{'loginUrl':_0x3fe1f9[_0xa60f('0x58')]||_0xa60f('0x59'),'clientId':_0x3fe1f9['clientId'],'clientSecret':_0x3fe1f9[_0xa60f('0x5a')]}});return _0x6ba37d['login'](_0x3fe1f9['username'],_0x58fb86)[_0xa60f('0x26')](function(){logger[_0xa60f('0x29')](_0xa60f('0x5b'));return _0x6ba37d;});}exports[_0xa60f('0x5c')]=function(_0x38bbe5,_0x37c6f4,_0x83dfdd,_0xa5f639,_0x83358,_0x1de63a){var _0x58f8cc,_0x38f8f7,_0x3686b9,_0x38bc3f;_0x1de63a[_0xa60f('0x5d')]=intUtil[_0xa60f('0x5e')](_0x1de63a[_0xa60f('0x5d')]);_0x1de63a['remoteUri']=intUtil[_0xa60f('0x5e')](_0x1de63a[_0xa60f('0x58')]);if(_0x83358&&_0x83358['monitor_format']){logger[_0xa60f('0x29')](_0xa60f('0x5f'),_0xa60f('0x60'));_0x37c6f4[_0xa60f('0x61')]=util[_0xa60f('0x46')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1de63a[_0xa60f('0x5d')],_0x37c6f4[_0xa60f('0x62')],md5(_0x37c6f4['uniqueid']));}else{_0x37c6f4['recordingURL']='';}return getConnection(_0x1de63a)[_0xa60f('0x26')](function(_0x47884a){_0x38bc3f=_0x47884a;return getUser(_0x1de63a,_0xa5f639[_0xa60f('0x63')],_0x38bc3f);})[_0xa60f('0x26')](function(_0x22d040){_0x58f8cc=_0x22d040;return getEndUser(_0x1de63a,_0x83dfdd,_0x37c6f4[_0xa60f('0x64')],_0x37c6f4[_0xa60f('0x65')],_0x38bc3f);})['then'](function(_0x39df30){_0x38f8f7=_0x39df30;return getTicket(_0x1de63a,_0x58f8cc,_0x38f8f7,_0x83dfdd,_0x37c6f4,_0x83dfdd[_0xa60f('0x66')],_0x38bc3f,_0xa60f('0x5c'));})[_0xa60f('0x26')](function(_0x372019){_0x3686b9=_0x372019;logger[_0xa60f('0x29')](_0xa60f('0x67'),_0x3686b9['id']);logger[_0xa60f('0x29')]('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x3686b9['id'],_0xa5f639[_0xa60f('0x54')],_0x1de63a[_0xa60f('0x3f')]);switch(_0x1de63a[_0xa60f('0x3f')]){case'integrationTab':emit(util['format'](_0xa60f('0x68'),_0xa5f639['name']),_0xa60f('0x69'),{'recordId':_0x3686b9['id']});break;case _0xa60f('0x6a'):emit(util['format']('user:%s',_0xa5f639['name']),'trigger:browser:url',{'uri':util[_0xa60f('0x46')](_0xa60f('0x6b'),_0x38bc3f[_0xa60f('0x6c')],_0x3686b9['id'])});break;default:logger[_0xa60f('0x6d')](_0xa60f('0x6e'));}})[_0xa60f('0x6f')](function(_0x492790){logger[_0xa60f('0x6d')](_0xa60f('0x5f'),_0x492790);});};exports[_0xa60f('0x70')]=function(_0x28f839,_0x4042b5,_0x5aab35,_0x23c69e,_0xb6e2d8,_0x4f9579,_0x35f032){var _0x5e69a7,_0x44d62c,_0x5b8fe4,_0x560eff;_0x4f9579[_0xa60f('0x5d')]=intUtil[_0xa60f('0x5e')](_0x4f9579[_0xa60f('0x5d')]);_0x4f9579[_0xa60f('0x58')]=intUtil[_0xa60f('0x5e')](_0x4f9579[_0xa60f('0x58')]);if(_0x35f032&&_0x35f032[_0xa60f('0x71')]&&_0x35f032['recordingFormat']!==_0xa60f('0x72')){logger[_0xa60f('0x29')]('[OUTBOUND]',_0xa60f('0x60'));_0x4042b5[_0xa60f('0x61')]=util[_0xa60f('0x46')](_0xa60f('0x73'),_0x4f9579[_0xa60f('0x5d')],_0x4042b5[_0xa60f('0x62')],md5(_0x4042b5['uniqueid']));}return getConnection(_0x4f9579)[_0xa60f('0x26')](function(_0x43a775){_0x560eff=_0x43a775;return getUser(_0x4f9579,_0x23c69e['email'],_0x560eff);})['then'](function(_0x2986fa){_0x5e69a7=_0x2986fa;return getEndUser(_0x4f9579,_0x5aab35,_0x4042b5['destcalleridname'],_0x4042b5[_0xa60f('0x74')],_0x560eff);})[_0xa60f('0x26')](function(_0x49cc02){_0x44d62c=_0x49cc02;return getTicket(_0x4f9579,_0x5e69a7,_0x44d62c,_0x5aab35,_0x4042b5,_0x5aab35[_0xa60f('0x66')],_0x560eff,_0xa60f('0x70'));})['then'](function(_0x7b80ec){_0x5b8fe4=_0x7b80ec;logger[_0xa60f('0x29')]('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x5b8fe4['id']);logger['info'](_0xa60f('0x75'),_0x5b8fe4['id'],_0x23c69e[_0xa60f('0x54')],_0x4f9579[_0xa60f('0x3f')]);switch(_0x4f9579[_0xa60f('0x3f')]){case _0xa60f('0x76'):emit(util[_0xa60f('0x46')](_0xa60f('0x68'),_0x23c69e[_0xa60f('0x54')]),'trigger:salesforce:display',{'recordId':_0x5b8fe4['id']});break;case'newTab':emit(util['format'](_0xa60f('0x68'),_0x23c69e[_0xa60f('0x54')]),_0xa60f('0x77'),{'uri':util[_0xa60f('0x46')](_0xa60f('0x6b'),_0x560eff[_0xa60f('0x6c')],_0x5b8fe4['id'])});break;default:logger['error']('[OUTBOUND]',_0xa60f('0x78'));}})['catch'](function(_0x4e6595){logger[_0xa60f('0x6d')](_0xa60f('0x79'),_0x4e6595);});};exports[_0xa60f('0x7a')]=function(_0x2eee12,_0x447cb2,_0x117025,_0x3fa38c,_0x2a99ac,_0x1eb724){var _0x22f848,_0x3f97a7,_0x3ccd02,_0x2d34a8;_0x1eb724[_0xa60f('0x5d')]=intUtil[_0xa60f('0x5e')](_0x1eb724[_0xa60f('0x5d')]);_0x1eb724[_0xa60f('0x58')]=intUtil[_0xa60f('0x5e')](_0x1eb724[_0xa60f('0x58')]);if(_0x2a99ac&&_0x2a99ac[_0xa60f('0x7b')]){logger[_0xa60f('0x29')]('['+_0x447cb2['lastevent']['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x447cb2[_0xa60f('0x61')]=util[_0xa60f('0x46')](_0xa60f('0x73'),_0x1eb724['serverUrl'],_0x447cb2[_0xa60f('0x62')],md5(_0x447cb2[_0xa60f('0x62')]));}else{_0x447cb2[_0xa60f('0x61')]='';}return getConnection(_0x1eb724)['then'](function(_0x101581){_0x2d34a8=_0x101581;if(!_[_0xa60f('0x22')](_0x3fa38c)){return getUser(_0x1eb724,_0x3fa38c[_0xa60f('0x54')],_0x2d34a8);}else{return getUser(_0x1eb724,null,_0x2d34a8);}})[_0xa60f('0x26')](function(_0x484263){_0x22f848=_0x484263;return getEndUser(_0x1eb724,_0x117025,_0x447cb2[_0xa60f('0x64')],_0x447cb2[_0xa60f('0x65')],_0x2d34a8);})[_0xa60f('0x26')](function(_0x89422b){_0x3f97a7=_0x89422b;return getTicket(_0x1eb724,_0x22f848,_0x3f97a7,_0x117025,_0x447cb2,_0x117025['Fields'],_0x2d34a8);})[_0xa60f('0x26')](function(_0x21bbb6){_0x3ccd02=_0x21bbb6;logger[_0xa60f('0x29')]('['+_0x447cb2[_0xa60f('0x7c')][_0xa60f('0x7d')]()+_0xa60f('0x7e'),_0x3ccd02['id']);logger[_0xa60f('0x29')]('['+_0x447cb2[_0xa60f('0x7c')][_0xa60f('0x7d')]()+']\x20Integration\x20account\x20type\x20%s.',_0x1eb724[_0xa60f('0x3f')]);})['catch'](function(_0x294ed8){logger['error']('['+_0x447cb2[_0xa60f('0x7c')][_0xa60f('0x7d')]()+']',_0x294ed8);});}; \ No newline at end of file +var _0xff31=['integrationTab','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','instanceUrl','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','error','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Fields','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','Salesforce\x20account\x20type\x20not\x20recognized','catch','unmanaged','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','request-promise','moment','bluebird','md5','jsforce','util','ioredis','./util','salesforce','defaults','redis','localhost','socket.io-emitter','emit','assign','getString','Descriptions','ActivityDate','utc','IsReminderSet','IsRecurrence','endUserType','WhoId','account','ticketType','contact','ContactId','AccountId','lead','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','validateEmail','find','execute','then','length','Email','Agent\x20%s\x20found.','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','resolve','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','cloneDeep','additionalSearchContact','merge','$or','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','Account','Contact','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','moduleCreate','LastName','format','Caller\x20-\x20%s','Company','No\x20Company','upperFirst','includes','string','picklist','idField','content','toString','variableName','customVariable','Variable','name','password','concat','securityToken','Connection','remoteUri','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.'];(function(_0x3f88e5,_0x2119f1){var _0x1413d3=function(_0x27bc47){while(--_0x27bc47){_0x3f88e5['push'](_0x3f88e5['shift']());}};_0x1413d3(++_0x2119f1);}(_0xff31,0x98));var _0x1ff3=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xff31[_0x2bf141];return _0x48277b;};'use strict';var _=require('lodash');var rp=require(_0x1ff3('0x0'));var moment=require(_0x1ff3('0x1'));var BPromise=require(_0x1ff3('0x2'));var md5=require(_0x1ff3('0x3'));var jsforce=require(_0x1ff3('0x4'));var util=require(_0x1ff3('0x5'));var Redis=require(_0x1ff3('0x6'));var intUtil=require(_0x1ff3('0x7'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x1ff3('0x8'));config['redis']=_[_0x1ff3('0x9')](config[_0x1ff3('0xa')],{'host':_0x1ff3('0xb'),'port':0x18eb});var io=require(_0x1ff3('0xc'))(new Redis(config[_0x1ff3('0xa')]));function emit(_0x1f295a,_0x2598f1,_0x507957){io['to'](_0x1f295a)[_0x1ff3('0xd')](_0x2598f1,_0x507957);}function getTicket(_0x4f47da,_0x16b709,_0x528aff,_0x7651ac,_0x3de679,_0x167ce9,_0xf1dbbb,_0x215805){var _0x3b955a=Object[_0x1ff3('0xe')]({},{'OwnerId':_0x16b709['id'],'Subject':intUtil[_0x1ff3('0xf')](_0x7651ac['Subjects'],_0x3de679,'\x20'),'Description':intUtil[_0x1ff3('0xf')](_0x7651ac[_0x1ff3('0x10')],_0x3de679,'\x0a')},getCustomFields(_0x167ce9,_0x3de679));if(_0x528aff){if(_0x7651ac['ticketType']==='Task'){_0x3b955a[_0x1ff3('0x11')]=moment[_0x1ff3('0x12')]();_0x3b955a[_0x1ff3('0x13')]=![];_0x3b955a[_0x1ff3('0x14')]=![];if(_0x528aff[_0x1ff3('0x15')]==='contact'||_0x528aff[_0x1ff3('0x15')]==='lead'){_0x3b955a[_0x1ff3('0x16')]=_0x528aff['id'];}else if(_0x528aff[_0x1ff3('0x15')]===_0x1ff3('0x17')){_0x3b955a['WhatId']=_0x528aff['id'];}}else if(_0x7651ac[_0x1ff3('0x18')]==='Case'){if(_0x528aff[_0x1ff3('0x15')]===_0x1ff3('0x19')){_0x3b955a[_0x1ff3('0x1a')]=_0x528aff['id'];}else if(_0x528aff[_0x1ff3('0x15')]===_0x1ff3('0x17')){_0x3b955a[_0x1ff3('0x1b')]=_0x528aff['id'];}else if(_0x528aff[_0x1ff3('0x15')]===_0x1ff3('0x1c')&&_0x7651ac[_0x1ff3('0x1d')]){_0x3b955a[_0x7651ac[_0x1ff3('0x1d')]]=_0x528aff['id'];}else{logger[_0x1ff3('0x1e')](_0x1ff3('0x1f'));}}}return _0xf1dbbb[_0x1ff3('0x20')](_0x7651ac[_0x1ff3('0x18')])[_0x1ff3('0x21')](_0x3b955a);}function getUser(_0x38e1ee,_0x18f303,_0x13c73b){if(!_[_0x1ff3('0x22')](_0x18f303)&&intUtil[_0x1ff3('0x23')](_0x18f303)){var _0x2391a4={'Email':_0x18f303};var _0x5752fe={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x13c73b[_0x1ff3('0x20')]('User')[_0x1ff3('0x24')](_0x2391a4,_0x5752fe)[_0x1ff3('0x25')]()[_0x1ff3('0x26')](function(_0x433773){if(_0x433773[_0x1ff3('0x27')]){var _0x1b8395=_[_0x1ff3('0x24')](_0x433773,function(_0x10e240){return _0x10e240[_0x1ff3('0x28')]===_0x18f303;});if(_0x1b8395){logger[_0x1ff3('0x1e')](_0x1ff3('0x29'),_0x18f303);return BPromise['resolve']({'id':_0x1b8395['Id'],'name':_0x1b8395[_0x1ff3('0x2a')]});}}else{logger['info'](_0x1ff3('0x2b'),_0x18f303);return _0x13c73b[_0x1ff3('0x2c')]()[_0x1ff3('0x26')](function(_0x9eff5b){return BPromise['resolve']({'id':_0x9eff5b[_0x1ff3('0x2d')],'name':_0x9eff5b['display_name']});});}});}else{logger[_0x1ff3('0x1e')](_0x1ff3('0x2b'),_0x18f303);return _0x13c73b[_0x1ff3('0x2c')]()[_0x1ff3('0x26')](function(_0x5a259f){return BPromise[_0x1ff3('0x2e')]({'id':_0x5a259f[_0x1ff3('0x2d')],'name':_0x5a259f[_0x1ff3('0x2f')]});});}}function getEndUser(_0x5d03f0,_0x6bf9ef,_0x3a858b,_0x525227,_0x1aa80a){var _0x2d6b24={'$or':{'Phone':_0x525227}};var _0x51cd2d={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x1ff3('0x2e')]()[_0x1ff3('0x26')](function(){logger[_0x1ff3('0x1e')](_0x1ff3('0x30'),_0x525227,_0x6bf9ef[_0x1ff3('0x31')]);switch(_0x6bf9ef[_0x1ff3('0x31')]){case'contact_lead':var _0x440e3e=_[_0x1ff3('0x32')](_0x2d6b24);if(_0x6bf9ef[_0x1ff3('0x33')]){var _0x57e064={};_0x57e064[_0x6bf9ef[_0x1ff3('0x33')]]=_0x525227;_[_0x1ff3('0x34')](_0x440e3e[_0x1ff3('0x35')],_0x57e064);}return _0x1aa80a['sobject']('Contact')[_0x1ff3('0x24')](_0x440e3e,_0x51cd2d)[_0x1ff3('0x25')]()['then'](function(_0x275749){if(_0x275749&&_0x275749[_0x1ff3('0x27')]){return _0x275749;}else{var _0x60cc8=_['cloneDeep'](_0x2d6b24);if(_0x6bf9ef[_0x1ff3('0x36')]){var _0x467aba={};_0x467aba[_0x6bf9ef[_0x1ff3('0x36')]]=_0x525227;_[_0x1ff3('0x34')](_0x60cc8[_0x1ff3('0x35')],_0x467aba);}return _0x1aa80a['sobject'](_0x1ff3('0x37'))[_0x1ff3('0x24')](_0x60cc8,_0x51cd2d);}});case _0x1ff3('0x38'):var _0x4c99c9=_[_0x1ff3('0x32')](_0x2d6b24);if(_0x6bf9ef[_0x1ff3('0x39')]){var _0x57e064={};_0x57e064[_0x6bf9ef[_0x1ff3('0x39')]]=_0x525227;_[_0x1ff3('0x34')](_0x4c99c9[_0x1ff3('0x35')],_0x57e064);}return _0x1aa80a['sobject'](_0x1ff3('0x3a'))['find'](_0x4c99c9,_0x51cd2d)[_0x1ff3('0x25')]()[_0x1ff3('0x26')](function(_0x311828){if(_0x311828&&_0x311828[_0x1ff3('0x27')]){return _0x311828;}else{var _0x2a6bd9=_[_0x1ff3('0x32')](_0x2d6b24);if(_0x6bf9ef[_0x1ff3('0x33')]){var _0x1d922a={};_0x1d922a[_0x6bf9ef['additionalSearchContact']]=_0x525227;_[_0x1ff3('0x34')](_0x2a6bd9[_0x1ff3('0x35')],_0x1d922a);}return _0x1aa80a['sobject'](_0x1ff3('0x3b'))['find'](_0x2a6bd9,_0x51cd2d)[_0x1ff3('0x26')](function(_0x223d41){if(_0x223d41&&_0x223d41[_0x1ff3('0x27')]){return _0x223d41;}else{var _0x4b2d63=_['cloneDeep'](_0x2d6b24);if(_0x6bf9ef[_0x1ff3('0x36')]){var _0x259835={};_0x259835[_0x6bf9ef['additionalSearchLead']]=_0x525227;_[_0x1ff3('0x34')](_0x4b2d63['$or'],_0x259835);}return _0x1aa80a['sobject'](_0x1ff3('0x37'))['find'](_0x4b2d63,_0x51cd2d);}});}});case _0x1ff3('0x19'):var _0x440e3e=_[_0x1ff3('0x32')](_0x2d6b24);if(_0x6bf9ef['additionalSearchContact']){var _0x57e064={};_0x57e064[_0x6bf9ef[_0x1ff3('0x33')]]=_0x525227;_[_0x1ff3('0x34')](_0x440e3e[_0x1ff3('0x35')],_0x57e064);}return _0x1aa80a[_0x1ff3('0x20')]('Contact')[_0x1ff3('0x24')](_0x440e3e,_0x51cd2d)[_0x1ff3('0x25')]();case _0x1ff3('0x1c'):var _0x53aac8=_['cloneDeep'](_0x2d6b24);if(_0x6bf9ef[_0x1ff3('0x36')]){var _0x57e064={};_0x57e064[_0x6bf9ef['additionalSearchLead']]=_0x525227;_['merge'](_0x53aac8[_0x1ff3('0x35')],_0x57e064);}return _0x1aa80a[_0x1ff3('0x20')](_0x1ff3('0x37'))[_0x1ff3('0x24')](_0x53aac8,_0x51cd2d);case'account':var _0x4c99c9=_[_0x1ff3('0x32')](_0x2d6b24);if(_0x6bf9ef[_0x1ff3('0x39')]){var _0x57e064={};_0x57e064[_0x6bf9ef[_0x1ff3('0x39')]]=_0x525227;_[_0x1ff3('0x34')](_0x4c99c9[_0x1ff3('0x35')],_0x57e064);}return _0x1aa80a[_0x1ff3('0x20')](_0x1ff3('0x3a'))[_0x1ff3('0x24')](_0x4c99c9,_0x51cd2d);default:return null;}})['then'](function(_0x221bfe){if(_0x221bfe&&_0x221bfe[_0x1ff3('0x27')]){var _0x1c7e7d=_['first'](_0x221bfe);if(_0x1c7e7d){return BPromise[_0x1ff3('0x2e')]({'id':_0x1c7e7d['Id'],'name':_0x1c7e7d[_0x1ff3('0x2a')],'phone':_0x1c7e7d['Phone'],'endUserType':_0x1c7e7d[_0x1ff3('0x3c')][_0x1ff3('0x3d')][_0x1ff3('0x3e')]()});}}})[_0x1ff3('0x26')](function(_0x3dd4ba){if(_0x3dd4ba){logger[_0x1ff3('0x1e')](_0x1ff3('0x3f'),_0x3dd4ba[_0x1ff3('0x15')],_0x525227);return BPromise[_0x1ff3('0x2e')](_0x3dd4ba);}else{logger[_0x1ff3('0x1e')]('Enduser\x20with\x20phone\x20%s\x20not\x20found',_0x525227);var _0x185769={'Phone':_0x525227};if(_0x6bf9ef['moduleCreate']){if(_0x6bf9ef['moduleCreate']===_0x1ff3('0x19')){logger[_0x1ff3('0x1e')](_0x1ff3('0x40'),_0x525227,_0x6bf9ef[_0x1ff3('0x41')]);_0x185769[_0x1ff3('0x42')]=_0x3a858b!==''?_0x3a858b:util[_0x1ff3('0x43')]('Caller\x20-\x20%s',_0x525227);}else if(_0x6bf9ef[_0x1ff3('0x41')]===_0x1ff3('0x1c')){logger[_0x1ff3('0x1e')](_0x1ff3('0x40'),_0x525227,_0x6bf9ef[_0x1ff3('0x41')]);_0x185769[_0x1ff3('0x42')]=_0x3a858b!==''?_0x3a858b:util['format'](_0x1ff3('0x44'),_0x525227);_0x185769[_0x1ff3('0x45')]=_0x1ff3('0x46');}else if(_0x6bf9ef[_0x1ff3('0x41')]===_0x1ff3('0x17')){logger['info'](_0x1ff3('0x40'),_0x525227,_0x6bf9ef[_0x1ff3('0x41')]);_0x185769[_0x1ff3('0x2a')]=_0x3a858b!==''?_0x3a858b:util[_0x1ff3('0x43')](_0x1ff3('0x44'),_0x525227);}else{return null;}}return _0x1aa80a[_0x1ff3('0x20')](_[_0x1ff3('0x47')](_0x6bf9ef['moduleCreate']))[_0x1ff3('0x21')](_0x185769)[_0x1ff3('0x26')](function(_0x53d861){return BPromise['resolve']({'id':_0x53d861['id'],'endUserType':_0x6bf9ef[_0x1ff3('0x41')]});});}});}function getCustomFields(_0x1fcb5e,_0x9b04c1){var _0x2749cf={};if(_0x1fcb5e['length']>0x0){_['forEach'](_0x1fcb5e,function(_0x6070cd){if(_[_0x1ff3('0x48')]([_0x1ff3('0x49'),_0x1ff3('0x4a')],_0x6070cd[_0x1ff3('0x3d')])&&_0x6070cd[_0x1ff3('0x4b')]){_0x2749cf[_0x6070cd['idField']]=_0x6070cd[_0x1ff3('0x4c')][_0x1ff3('0x4d')]();}else if(_0x6070cd[_0x1ff3('0x3d')]==='variable'&&_0x6070cd['variableName']&&_0x6070cd['idField']){_0x9b04c1[_0x6070cd[_0x1ff3('0x4e')]]&&(_0x2749cf[_0x6070cd[_0x1ff3('0x4b')]]=_0x9b04c1[_0x6070cd['variableName']][_0x1ff3('0x4d')]());}else if(_0x6070cd[_0x1ff3('0x3d')]===_0x1ff3('0x4f')&&_0x6070cd[_0x1ff3('0x50')]&&_0x6070cd[_0x1ff3('0x50')][_0x1ff3('0x51')]&&_0x6070cd['idField']){_0x9b04c1[_0x6070cd[_0x1ff3('0x50')][_0x1ff3('0x51')]['toLowerCase']()]&&(_0x2749cf[_0x6070cd[_0x1ff3('0x4b')]]=_0x9b04c1[_0x6070cd[_0x1ff3('0x50')][_0x1ff3('0x51')]['toLowerCase']()]['toString']());}});}return _0x2749cf;}function getConnection(_0x332545){var _0x5106b0=_0x332545[_0x1ff3('0x52')][_0x1ff3('0x53')](_0x332545[_0x1ff3('0x54')]);var _0x1c807d=new jsforce[(_0x1ff3('0x55'))]({'oauth2':{'loginUrl':_0x332545[_0x1ff3('0x56')]||'https://login.salesforce.com','clientId':_0x332545['clientId'],'clientSecret':_0x332545['clientSecret']}});return _0x1c807d['login'](_0x332545['username'],_0x5106b0)[_0x1ff3('0x26')](function(){logger[_0x1ff3('0x1e')](_0x1ff3('0x57'));return _0x1c807d;});}exports[_0x1ff3('0x58')]=function(_0x1a328d,_0x2f882a,_0x1bbea5,_0xfec0d8,_0x28f965,_0x23e8b6){var _0x4f60f3,_0x49002a,_0x35dcc4,_0xf5bb55;_0x23e8b6[_0x1ff3('0x59')]=intUtil[_0x1ff3('0x5a')](_0x23e8b6['serverUrl']);_0x23e8b6[_0x1ff3('0x56')]=intUtil[_0x1ff3('0x5a')](_0x23e8b6[_0x1ff3('0x56')]);if(_0x28f965&&_0x28f965[_0x1ff3('0x5b')]){logger[_0x1ff3('0x1e')](_0x1ff3('0x5c'),_0x1ff3('0x5d'));_0x2f882a[_0x1ff3('0x5e')]=util[_0x1ff3('0x43')](_0x1ff3('0x5f'),_0x23e8b6[_0x1ff3('0x59')],_0x2f882a[_0x1ff3('0x60')],md5(_0x2f882a[_0x1ff3('0x60')]));}else{_0x2f882a[_0x1ff3('0x5e')]='';}return getConnection(_0x23e8b6)['then'](function(_0x28216b){_0xf5bb55=_0x28216b;return getUser(_0x23e8b6,_0xfec0d8[_0x1ff3('0x61')],_0xf5bb55);})[_0x1ff3('0x26')](function(_0x3cd998){_0x4f60f3=_0x3cd998;return getEndUser(_0x23e8b6,_0x1bbea5,_0x2f882a[_0x1ff3('0x62')],_0x2f882a[_0x1ff3('0x63')],_0xf5bb55);})[_0x1ff3('0x26')](function(_0x229c10){_0x49002a=_0x229c10;return getTicket(_0x23e8b6,_0x4f60f3,_0x49002a,_0x1bbea5,_0x2f882a,_0x1bbea5['Fields'],_0xf5bb55,_0x1ff3('0x58'));})['then'](function(_0x8dbae9){_0x35dcc4=_0x8dbae9;logger['info'](_0x1ff3('0x64'),_0x35dcc4['id']);logger[_0x1ff3('0x1e')](_0x1ff3('0x65'),_0x35dcc4['id'],_0xfec0d8['name'],_0x23e8b6['type']);switch(_0x23e8b6[_0x1ff3('0x3d')]){case _0x1ff3('0x66'):emit(util['format'](_0x1ff3('0x67'),_0xfec0d8['name']),_0x1ff3('0x68'),{'recordId':_0x35dcc4['id']});break;case _0x1ff3('0x69'):emit(util[_0x1ff3('0x43')](_0x1ff3('0x67'),_0xfec0d8[_0x1ff3('0x51')]),_0x1ff3('0x6a'),{'uri':util[_0x1ff3('0x43')](_0x1ff3('0x6b'),_0xf5bb55[_0x1ff3('0x6c')],_0x35dcc4['id'])});break;default:logger['error'](_0x1ff3('0x6d'));}})['catch'](function(_0xa1a7a9){logger[_0x1ff3('0x6e')](_0x1ff3('0x5c'),_0xa1a7a9);});};exports[_0x1ff3('0x6f')]=function(_0x6ab07d,_0xba27a4,_0xae702d,_0x33dda1,_0x50961a,_0x35db7e,_0x59b3bf){var _0x5b6a07,_0x3cbbff,_0x13a800,_0x5d1f88;_0x35db7e[_0x1ff3('0x59')]=intUtil[_0x1ff3('0x5a')](_0x35db7e[_0x1ff3('0x59')]);_0x35db7e['remoteUri']=intUtil['stripTrailingSlash'](_0x35db7e[_0x1ff3('0x56')]);if(_0x59b3bf&&_0x59b3bf[_0x1ff3('0x70')]&&_0x59b3bf[_0x1ff3('0x70')]!==_0x1ff3('0x71')){logger['info'](_0x1ff3('0x72'),_0x1ff3('0x5d'));_0xba27a4[_0x1ff3('0x5e')]=util[_0x1ff3('0x43')](_0x1ff3('0x5f'),_0x35db7e[_0x1ff3('0x59')],_0xba27a4[_0x1ff3('0x60')],md5(_0xba27a4['uniqueid']));}return getConnection(_0x35db7e)[_0x1ff3('0x26')](function(_0x466ad4){_0x5d1f88=_0x466ad4;return getUser(_0x35db7e,_0x33dda1[_0x1ff3('0x61')],_0x5d1f88);})[_0x1ff3('0x26')](function(_0x4e0102){_0x5b6a07=_0x4e0102;return getEndUser(_0x35db7e,_0xae702d,_0xba27a4[_0x1ff3('0x73')],_0xba27a4[_0x1ff3('0x74')],_0x5d1f88);})['then'](function(_0x1284b2){_0x3cbbff=_0x1284b2;return getTicket(_0x35db7e,_0x5b6a07,_0x3cbbff,_0xae702d,_0xba27a4,_0xae702d[_0x1ff3('0x75')],_0x5d1f88,_0x1ff3('0x6f'));})[_0x1ff3('0x26')](function(_0x32b065){_0x13a800=_0x32b065;logger[_0x1ff3('0x1e')](_0x1ff3('0x76'),_0x13a800['id']);logger[_0x1ff3('0x1e')](_0x1ff3('0x77'),_0x13a800['id'],_0x33dda1[_0x1ff3('0x51')],_0x35db7e[_0x1ff3('0x3d')]);switch(_0x35db7e['type']){case _0x1ff3('0x66'):emit(util[_0x1ff3('0x43')]('user:%s',_0x33dda1[_0x1ff3('0x51')]),_0x1ff3('0x68'),{'recordId':_0x13a800['id']});break;case _0x1ff3('0x69'):emit(util[_0x1ff3('0x43')](_0x1ff3('0x67'),_0x33dda1[_0x1ff3('0x51')]),_0x1ff3('0x6a'),{'uri':util[_0x1ff3('0x43')](_0x1ff3('0x6b'),_0x5d1f88['instanceUrl'],_0x13a800['id'])});break;default:logger['error'](_0x1ff3('0x72'),_0x1ff3('0x78'));}})[_0x1ff3('0x79')](function(_0x19c7e2){logger[_0x1ff3('0x6e')](_0x1ff3('0x72'),_0x19c7e2);});};exports[_0x1ff3('0x7a')]=function(_0x6cb0d0,_0x3b4801,_0x196109,_0x43aa3f,_0x20948b,_0x5eec28){var _0x31072d,_0x33dadd,_0x4dd975,_0x22f72e;_0x5eec28['serverUrl']=intUtil['stripTrailingSlash'](_0x5eec28[_0x1ff3('0x59')]);_0x5eec28[_0x1ff3('0x56')]=intUtil[_0x1ff3('0x5a')](_0x5eec28[_0x1ff3('0x56')]);if(_0x20948b&&_0x20948b[_0x1ff3('0x5b')]){logger[_0x1ff3('0x1e')]('['+_0x3b4801[_0x1ff3('0x7b')][_0x1ff3('0x7c')]()+']','Recording\x20is\x20enabled!');_0x3b4801[_0x1ff3('0x5e')]=util[_0x1ff3('0x43')](_0x1ff3('0x5f'),_0x5eec28[_0x1ff3('0x59')],_0x3b4801[_0x1ff3('0x60')],md5(_0x3b4801[_0x1ff3('0x60')]));}else{_0x3b4801[_0x1ff3('0x5e')]='';}return getConnection(_0x5eec28)[_0x1ff3('0x26')](function(_0x17038d){_0x22f72e=_0x17038d;if(!_['isNil'](_0x43aa3f)){return getUser(_0x5eec28,_0x43aa3f[_0x1ff3('0x51')],_0x22f72e);}else{return getUser(_0x5eec28,null,_0x22f72e);}})[_0x1ff3('0x26')](function(_0x4d1644){_0x31072d=_0x4d1644;return getEndUser(_0x5eec28,_0x196109,_0x3b4801[_0x1ff3('0x62')],_0x3b4801[_0x1ff3('0x63')],_0x22f72e);})[_0x1ff3('0x26')](function(_0x5a7882){_0x33dadd=_0x5a7882;return getTicket(_0x5eec28,_0x31072d,_0x33dadd,_0x196109,_0x3b4801,_0x196109[_0x1ff3('0x75')],_0x22f72e);})[_0x1ff3('0x26')](function(_0x3e95b8){_0x4dd975=_0x3e95b8;logger['info']('['+_0x3b4801['lastevent'][_0x1ff3('0x7c')]()+_0x1ff3('0x7d'),_0x4dd975['id']);logger[_0x1ff3('0x1e')]('['+_0x3b4801[_0x1ff3('0x7b')][_0x1ff3('0x7c')]()+_0x1ff3('0x7e'),_0x5eec28[_0x1ff3('0x3d')]);})[_0x1ff3('0x79')](function(_0x551559){logger[_0x1ff3('0x6e')]('['+_0x3b4801[_0x1ff3('0x7b')][_0x1ff3('0x7c')]()+']',_0x551559);});}; \ 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 59516af..9c0a93f 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 _0xffbf=['sys_user?sysparm_query=email%3D','userEmail','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','length','active','userId','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','true','then','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','string','type','nameField','customField','toLowerCase','picklist','idField','toString','variable','variableName','customVariable','Variable',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Subjects','Descriptions',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number','label','?sysparm_query=name%3D','label_entry','Incident','Incident\x20-\x20','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','name','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','emit','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','stripTrailingSlash','remoteUri','%s/api/now/table/','isNil','destcalleridnum','calleridnum','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...','inspect','lodash','bluebird','request-promise','util','md5','ioredis','./util','../../../../config/logger','servicenow','redis','defaults','GET','sys_user?sysparm_query=user_name%3Dadmin','result','adminId','sys_id','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','info','],\x20getUser\x20input\x20crm','validateEmail'];(function(_0x23ec06,_0x561142){var _0x2831d4=function(_0x3802bc){while(--_0x3802bc){_0x23ec06['push'](_0x23ec06['shift']());}};_0x2831d4(++_0x561142);}(_0xffbf,0x141));var _0xfffb=function(_0x55157d,_0x5e7e93){_0x55157d=_0x55157d-0x0;var _0x3e79af=_0xffbf[_0x55157d];return _0x3e79af;};'use strict';var _=require(_0xfffb('0x0'));var Promise=require(_0xfffb('0x1'));var rp=require(_0xfffb('0x2'));var util=require(_0xfffb('0x3'));var md5=require(_0xfffb('0x4'));var Redis=require(_0xfffb('0x5'));var intUtil=require(_0xfffb('0x6'));var config=require('../../../../config/environment');var logger=require(_0xfffb('0x7'))(_0xfffb('0x8'));config[_0xfffb('0x9')]=_[_0xfffb('0xa')](config[_0xfffb('0x9')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xfffb('0x9')]));function getAdminUser(_0x12fb4f,_0x19b280,_0x5d8b7e,_0x5f4909,_0x31e9c1,_0x4a88a3){return new Promise(function(_0x2b2db7,_0x2c486d){var _0x104733={'method':_0xfffb('0xb'),'uri':_0x5f4909+_0xfffb('0xc')+'&'+_0x31e9c1+'&'+_0x4a88a3,'auth':_0x19b280,'json':!![]};return rp(_0x104733)['then'](function(_0x39a19d){if(_0x39a19d[_0xfffb('0xd')]['length']>0x0){_0x5d8b7e[_0xfffb('0xe')]=_0x39a19d[_0xfffb('0xd')][0x0][_0xfffb('0xf')];}logger['info']('['+[_0x12fb4f[_0xfffb('0x10')]()]+_0xfffb('0x11'),_0x5d8b7e);_0x2b2db7(_0x5d8b7e);})[_0xfffb('0x12')](function(_0x5beeb7){logger[_0xfffb('0x13')]('['+[_0x12fb4f[_0xfffb('0x10')]()]+']',_0x5beeb7[_0xfffb('0x14')]);_0x2c486d(_0x5beeb7['message']);});});}function getUser(_0x25ddde,_0x3ed2fc,_0x2b8002,_0x17760a,_0x32bbbd){return function(_0x3fd2ea){logger[_0xfffb('0x15')]('['+[_0x25ddde[_0xfffb('0x10')]()]+_0xfffb('0x16'),_0x3fd2ea);return new Promise(function(_0x482609,_0x171e62){if(intUtil[_0xfffb('0x17')](_0x3fd2ea['userEmail'])){var _0xc8213c={'method':_0xfffb('0xb'),'uri':_0x2b8002+_0xfffb('0x18')+_0x3fd2ea[_0xfffb('0x19')]+'&'+_0x17760a+'&'+_0x32bbbd,'auth':_0x3ed2fc,'json':!![]};logger[_0xfffb('0x15')]('['+[_0x25ddde[_0xfffb('0x10')]()]+_0xfffb('0x1a'),_0xc8213c);return rp(_0xc8213c)['then'](function(_0x56b840){logger[_0xfffb('0x15')]('['+[_0x25ddde[_0xfffb('0x10')]()]+_0xfffb('0x1b'),_0x56b840);if(_0x56b840[_0xfffb('0xd')][_0xfffb('0x1c')]>0x0&&String(_0x56b840[_0xfffb('0xd')][0x0][_0xfffb('0x1d')])==='true'){_0x3fd2ea[_0xfffb('0x1e')]=_0x56b840[_0xfffb('0xd')][0x0][_0xfffb('0xf')];}else{_0x3fd2ea['userId']=_0x3fd2ea[_0xfffb('0xe')];_0x3fd2ea[_0xfffb('0x19')]=_0x3fd2ea[_0xfffb('0x1f')];}logger[_0xfffb('0x15')]('['+[_0x25ddde[_0xfffb('0x10')]()]+_0xfffb('0x20'),_0x3fd2ea);_0x482609(_0x3fd2ea);})[_0xfffb('0x12')](function(_0x9217f7){logger[_0xfffb('0x13')]('['+[_0x25ddde[_0xfffb('0x10')]()]+']',_0x9217f7[_0xfffb('0x14')]);_0x171e62(_0x9217f7[_0xfffb('0x14')]);});}else{logger[_0xfffb('0x15')]('['+[_0x25ddde['toUpperCase']()]+_0xfffb('0x21'));_0x3fd2ea[_0xfffb('0x1e')]=_0x3fd2ea['adminId'];_0x3fd2ea[_0xfffb('0x19')]=_0x3fd2ea[_0xfffb('0x1f')];_0x482609(_0x3fd2ea);}});};}function createEndUser(_0x40d319,_0x2ddc8f,_0x379d0f,_0x1c707c,_0x54819f){logger[_0xfffb('0x15')]('['+[_0x40d319[_0xfffb('0x10')]()]+_0xfffb('0x22'),_0x379d0f);return new Promise(function(_0x1c98f8,_0x1b1f49){var _0x36ef03={'method':_0xfffb('0x23'),'uri':_0x1c707c+_0xfffb('0x24')+_0x54819f,'body':{'user_name':_0x379d0f[_0xfffb('0x25')],'roles':_0xfffb('0x26'),'first_name':_0x379d0f[_0xfffb('0x25')],'active':_0xfffb('0x27'),'date_format':'System','phone':_0x379d0f[_0xfffb('0x25')]},'auth':_0x2ddc8f,'json':!![]};return rp(_0x36ef03)[_0xfffb('0x28')](function(_0x30cc41){logger[_0xfffb('0x15')]('['+[_0x40d319['toUpperCase']()]+_0xfffb('0x29'),_0x30cc41[_0xfffb('0xd')]);_0x379d0f[_0xfffb('0x2a')]=_0x30cc41[_0xfffb('0xd')][_0xfffb('0xf')];_0x1c98f8(_0x379d0f);})['catch'](function(_0x119dcf){logger[_0xfffb('0x13')]('['+[_0x40d319[_0xfffb('0x10')]()]+']',_0x119dcf[_0xfffb('0x14')]);_0x1b1f49(_0x119dcf[_0xfffb('0x14')]);});});}function getEndUser(_0x243ba9,_0x3ace5b,_0xc0735d,_0x4ebfdb,_0x11ea21){return function(_0x16d47e){logger[_0xfffb('0x15')]('['+[_0x243ba9['toUpperCase']()]+_0xfffb('0x2b'),_0x16d47e);return new Promise(function(_0x2b3795,_0x749bd0){var _0x5e4dc4={'method':_0xfffb('0xb'),'uri':_0xc0735d+'sys_user?sysparm_query=phone%3D'+_0x16d47e[_0xfffb('0x25')]+'&'+_0x4ebfdb+'&'+_0x11ea21,'auth':_0x3ace5b,'json':!![]};return rp(_0x5e4dc4)[_0xfffb('0x28')](function(_0x39fe27){if(_0x39fe27[_0xfffb('0xd')][_0xfffb('0x1c')]>0x0){_0x16d47e[_0xfffb('0x2a')]=_0x39fe27[_0xfffb('0xd')][0x0][_0xfffb('0xf')];logger['info']('['+[_0x243ba9[_0xfffb('0x10')]()]+_0xfffb('0x2c'),_0x16d47e);_0x2b3795(_0x16d47e);}else{return createEndUser(_0x243ba9,_0x3ace5b,_0x16d47e,_0xc0735d,_0x4ebfdb)['then'](function(_0x45716d){logger['info']('['+[_0x243ba9[_0xfffb('0x10')]()]+_0xfffb('0x2d'),_0x45716d);_0x2b3795(_0x45716d);});}})[_0xfffb('0x12')](function(_0x5edb92){logger[_0xfffb('0x13')]('['+[_0x243ba9['toUpperCase']()]+']',_0x5edb92[_0xfffb('0x14')]);_0x749bd0(_0x5edb92[_0xfffb('0x14')]);});});};}function getCustomFields(_0x4a23be,_0x5da5d1){var _0x25c21f={};if(_0x4a23be[_0xfffb('0x1c')]>0x0){_[_0xfffb('0x2e')](_0x4a23be,function(_0x53b072){if(_[_0xfffb('0x2f')]([_0xfffb('0x30'),'picklist'],_0x53b072[_0xfffb('0x31')])&&_0x53b072[_0xfffb('0x32')]&&!_0x53b072[_0xfffb('0x33')]){_0x25c21f[_0x53b072[_0xfffb('0x32')][_0xfffb('0x34')]()]=_0x53b072['content']['toString']();}else if(_['includes']([_0xfffb('0x30'),_0xfffb('0x35')],_0x53b072[_0xfffb('0x31')])&&_0x53b072[_0xfffb('0x36')]&&_0x53b072[_0xfffb('0x33')]){_0x25c21f[_0x53b072[_0xfffb('0x36')][_0xfffb('0x34')]()]=_0x53b072['content'][_0xfffb('0x37')]();}else if(_0x53b072['type']===_0xfffb('0x38')&&_0x53b072[_0xfffb('0x39')]&&_0x53b072[_0xfffb('0x36')]&&_0x53b072[_0xfffb('0x33')]){_0x25c21f[_0x53b072[_0xfffb('0x36')][_0xfffb('0x34')]()]=_0x5da5d1[_0x53b072[_0xfffb('0x39')]][_0xfffb('0x37')]();}else if(_0x53b072[_0xfffb('0x31')]===_0xfffb('0x3a')&&_0x53b072[_0xfffb('0x3b')]&&_0x53b072[_0xfffb('0x3b')]['name']&&_0x53b072[_0xfffb('0x36')]&&_0x53b072[_0xfffb('0x33')]){_0x25c21f[_0x53b072[_0xfffb('0x36')][_0xfffb('0x34')]()]=_0x5da5d1[_0x53b072[_0xfffb('0x3b')]['name'][_0xfffb('0x34')]()][_0xfffb('0x37')]();}});}return _0x25c21f;}function getTicket(_0xdc876c,_0xc923a8,_0x1cd3dc,_0x220816,_0x17d55d,_0x20052e){return function(_0x5a5a50){logger[_0xfffb('0x15')]('['+[_0xdc876c['toUpperCase']()]+_0xfffb('0x3c'),_0x5a5a50);return new Promise(function(_0x142a43,_0x1f488d){var _0x3e8bc0=_0xdc876c[_0xfffb('0x34')]()===_0xfffb('0x3d')?_0x5a5a50[_0xfffb('0x1e')]:_0x5a5a50[_0xfffb('0x2a')];var _0x56222f={'method':'POST','uri':_0x1cd3dc+_0xfffb('0x3e')+'?'+_0x20052e,'body':Object[_0xfffb('0x3f')]({},{'active':_0xfffb('0x27'),'caller_id':_0x3e8bc0,'assigned_to':_0x5a5a50[_0xfffb('0x1e')],'short_description':intUtil[_0xfffb('0x40')](_0x220816[_0xfffb('0x41')],_0x17d55d,'\x20'),'description':intUtil[_0xfffb('0x40')](_0x220816[_0xfffb('0x42')],_0x17d55d,'\x0a')},getCustomFields(_0x220816['Fields'],_0x17d55d)),'auth':_0xc923a8,'json':!![]};return rp(_0x56222f)[_0xfffb('0x28')](function(_0x10991c){logger[_0xfffb('0x15')]('['+[_0xdc876c['toUpperCase']()]+_0xfffb('0x43'),_0x10991c[_0xfffb('0xd')]);_0x5a5a50[_0xfffb('0x44')]=_0x10991c[_0xfffb('0xd')][_0xfffb('0xf')];_0x5a5a50[_0xfffb('0x45')]=_0x10991c[_0xfffb('0xd')][_0xfffb('0x46')];logger[_0xfffb('0x15')]('['+[_0xdc876c[_0xfffb('0x10')]()]+']\x20getTicket\x20crm',_0x5a5a50);_0x142a43(_0x5a5a50);})['catch'](function(_0x1fc20d){logger[_0xfffb('0x13')]('['+[_0xdc876c[_0xfffb('0x10')]()]+']',_0x1fc20d[_0xfffb('0x14')]);_0x1f488d(_0x1fc20d['message']);});});};}function createRemoteTag(_0xcd1af2,_0x1382e8,_0x1cbb17,_0x9c80e0){return new Promise(function(_0x4b68f7,_0x327eab){var _0x453ef3={'method':_0xfffb('0x23'),'uri':_0x1cbb17+_0xfffb('0x47')+'?'+_0x9c80e0,'body':{'short_description':_0xcd1af2,'global':!![],'active':!![],'name':_0xcd1af2},'auth':_0x1382e8,'json':!![]};return rp(_0x453ef3)[_0xfffb('0x28')](function(_0x3228cc){var _0x4deb4e=_0x3228cc[_0xfffb('0xd')]['sys_id'];_0x4b68f7(_0x4deb4e);});});}function getRemoteTag(_0x2baeec,_0x55a592,_0x9a63db,_0x1fc846,_0x2b5ff7){return new Promise(function(_0x5e9440,_0x31f33d){var _0x28c36={'method':'GET','uri':_0x9a63db+_0xfffb('0x47')+_0xfffb('0x48')+_0x2baeec+'&'+_0x1fc846,'auth':_0x55a592,'json':!![]};return rp(_0x28c36)[_0xfffb('0x28')](function(_0x630129){if(_0x630129[_0xfffb('0xd')][_0xfffb('0x1c')]>0x0){var _0x343781=_0x630129[_0xfffb('0xd')][0x0][_0xfffb('0xf')];_0x5e9440(_0x343781);}else{return createRemoteTag(_0x2baeec,_0x55a592,_0x9a63db,_0x1fc846)[_0xfffb('0x28')](function(_0xa3226e){_0x5e9440(_0xa3226e);});}});});}function assignTagToIncident(_0x41aa5d,_0x4c0c26,_0x39c59a,_0x2f61d3,_0x3d3502){return new Promise(function(_0x3e1042,_0x471ba2){var _0x54dca5={'method':_0xfffb('0x23'),'uri':_0x39c59a+_0xfffb('0x49')+'?'+_0x3d3502,'body':{'label':_0x41aa5d,'table':_0xfffb('0x3e'),'id_type':_0xfffb('0x4a'),'table_key':_0x2f61d3['ticketId'],'title':_0xfffb('0x4b')+_0x2f61d3['ticketNumber'],'id_display':_0x2f61d3[_0xfffb('0x45')]},'auth':_0x4c0c26,'json':!![]};return rp(_0x54dca5)['then'](function(_0x126f5c){_0x3e1042();})[_0xfffb('0x12')](function(){_0x3e1042();});});}function manageTags(_0xcd3763,_0x14557a,_0x499d57,_0x15d93f,_0xfe7f4a,_0x4759f2,_0x1404b4){return new Promise(function(_0x100e12,_0x20f484){var _0x235e1c=[];_0x14557a['forEach'](function(_0x32a683){_0x235e1c['push'](getRemoteTag(_0x32a683,_0x499d57,_0x15d93f,_0x4759f2,_0x1404b4));});return Promise[_0xfffb('0x4c')](_0x235e1c)['then'](function(_0x53bb85){if(_0x53bb85[_0xfffb('0x1c')]){logger[_0xfffb('0x15')]('['+[_0xcd3763[_0xfffb('0x10')]()]+_0xfffb('0x4d'),_0x53bb85);var _0x67834=[];_0x53bb85['forEach'](function(_0x129e31){_0x67834['push'](assignTagToIncident(_0x129e31,_0x499d57,_0x15d93f,_0xfe7f4a,_0x4759f2));});return Promise[_0xfffb('0x4c')](_0x67834)[_0xfffb('0x28')](function(){_0x100e12();})[_0xfffb('0x12')](function(){_0x100e12();});}else{_0x100e12();}});});}function getTags(_0x321cc1,_0x1cd507,_0x119238,_0x52ceff,_0x2be696,_0x3c0232){return function(_0x401538){return new Promise(function(_0x4b60a2,_0x11681b){var _0x2688f1=[];var _0x19e8ff=_0x52ceff[_0xfffb('0x4e')];if(_0x19e8ff&&_0x19e8ff[_0xfffb('0x1c')]>0x0){_0x2688f1=_[_0xfffb('0x4f')](_0x19e8ff,_0xfffb('0x50'));}if(_0x2688f1[_0xfffb('0x1c')]>0x0){return manageTags(_0x321cc1,_0x2688f1,_0x1cd507,_0x119238,_0x401538,_0x2be696,_0x3c0232)[_0xfffb('0x28')](function(){_0x4b60a2(_0x401538);});}else{_0x4b60a2(_0x401538);}});};}function emit(_0x4fd2d8,_0x508f91,_0x423ffc){var _0x346a29=_0xfffb('0x51')+_0xfffb('0x52')+_0xfffb('0x53')+_0xfffb('0x54');var _0xd0947c={'uri':_0x4fd2d8+_0xfffb('0x55')+_0x423ffc+_0x346a29};io['to'](util[_0xfffb('0x56')]('user:%s',_0x508f91))[_0xfffb('0x57')](_0xfffb('0x58'),_0xd0947c);}exports['cs']=function(_0x47e238,_0x11a89f,_0xde7a61,_0x7d2e95,_0x4c31df,_0x3a8e97,_0x3ccf85,_0x33913f){var _0x4757db={};var _0x8470e8={'user':_0x3a8e97[_0xfffb('0x59')],'pass':_0x3a8e97[_0xfffb('0x5a')]};var _0x2caac8=_0xfffb('0x5b');var _0xe9c2aa=_0xfffb('0x5c');_0x3a8e97['remoteUri']=intUtil[_0xfffb('0x5d')](_0x3a8e97[_0xfffb('0x5e')]);_0x3a8e97['serverUrl']=intUtil[_0xfffb('0x5d')](_0x3a8e97['serverUrl']);var _0x22cba7=util['format'](_0xfffb('0x5f'),_0x3a8e97[_0xfffb('0x5e')]);_0x4757db[_0xfffb('0x19')]=!_[_0xfffb('0x60')](_0x7d2e95)?_0x7d2e95['email']:null;_0x4757db[_0xfffb('0x1f')]=_0x3a8e97['email'];_0x4757db['endUserNumber']=_0x33913f['toLowerCase']()===_0xfffb('0x3d')?_0x11a89f[_0xfffb('0x61')]:_0x11a89f[_0xfffb('0x62')];_0x4757db['callDirection']=_0x33913f===_0xfffb('0x63')||_0x33913f==='unmanaged'?_0xfffb('0x63'):'outbound';var _0x22133c=util[_0xfffb('0x56')](_0xfffb('0x64'),_0x3a8e97[_0xfffb('0x65')],_0x11a89f[_0xfffb('0x66')],md5(_0x11a89f[_0xfffb('0x66')]));if(_0x4c31df&&_0x4c31df[_0xfffb('0x67')]){logger['info'](_0xfffb('0x68'),_0xfffb('0x69'));_0x11a89f[_0xfffb('0x6a')]=_0x22133c;}else if(_0x3ccf85&&_0x3ccf85[_0xfffb('0x6b')]&&_0x3ccf85[_0xfffb('0x6b')]!==_0xfffb('0x6c')){logger[_0xfffb('0x15')](_0xfffb('0x6d'),_0xfffb('0x69'));_0x11a89f[_0xfffb('0x6a')]=_0x22133c;}else{_0x11a89f[_0xfffb('0x6a')]='';}return getAdminUser(_0x33913f,_0x8470e8,_0x4757db,_0x22cba7,_0xe9c2aa,_0x2caac8)[_0xfffb('0x28')](getUser(_0x33913f,_0x8470e8,_0x22cba7,_0xe9c2aa,_0x2caac8))[_0xfffb('0x28')](getEndUser(_0x33913f,_0x8470e8,_0x22cba7,_0xe9c2aa,_0x2caac8))[_0xfffb('0x28')](getTicket(_0x33913f,_0x8470e8,_0x22cba7,_0xde7a61,_0x11a89f,_0xe9c2aa))[_0xfffb('0x28')](function(_0x47b1eb){logger['info'](util[_0xfffb('0x56')](_0xfffb('0x6e'),_0x47b1eb[_0xfffb('0x44')]));logger[_0xfffb('0x15')](util[_0xfffb('0x56')](_0xfffb('0x6f'),_0x33913f));if(_0x33913f!==_0xfffb('0x70')){logger[_0xfffb('0x15')]('['+[_0x33913f[_0xfffb('0x10')]()]+']',_0xfffb('0x71'));emit(_0x3a8e97[_0xfffb('0x5e')],_0x7d2e95[_0xfffb('0x50')],_0x47b1eb['ticketId']);}})['catch'](function(_0x1158ad){logger[_0xfffb('0x13')]('['+[_0x33913f[_0xfffb('0x10')]()]+']\x20Error\x20running\x20ServiceNow\x20integration',util[_0xfffb('0x72')](_0x1158ad,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xff24=['queue','%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','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','info','],\x20getAdminUser\x20crm','catch','error','toUpperCase','],\x20getUser\x20input\x20crm','userEmail','GET','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','true','sys_id','userId','adminEmail','],\x20getUser\x20crm','message',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','sys_user?','endUserNumber','user','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','],\x20createEndUser\x20crm','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','content','toString','variableName','idField','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','Subjects','Descriptions','Fields','ticketId','ticketNumber','POST','label','label_entry','Incident','Incident\x20-\x20','push',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','all','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','/nav_to.do?uri=incident.do?sys_id%3D','user:%s','emit','username','password','sysparm_limit=1','sysparm_display_value=true','stripTrailingSlash','remoteUri','serverUrl','format','%s/api/now/table/','isNil','email','destcalleridnum','calleridnum','unmanaged'];(function(_0x3e6da0,_0x15e80b){var _0xf9ed05=function(_0x2a2e48){while(--_0x2a2e48){_0x3e6da0['push'](_0x3e6da0['shift']());}};_0xf9ed05(++_0x15e80b);}(_0xff24,0xec));var _0x4ff2=function(_0x3878e6,_0x33ea78){_0x3878e6=_0x3878e6-0x0;var _0x33680e=_0xff24[_0x3878e6];return _0x33680e;};'use strict';var _=require(_0x4ff2('0x0'));var Promise=require(_0x4ff2('0x1'));var rp=require(_0x4ff2('0x2'));var util=require(_0x4ff2('0x3'));var md5=require('md5');var Redis=require(_0x4ff2('0x4'));var intUtil=require(_0x4ff2('0x5'));var config=require(_0x4ff2('0x6'));var logger=require(_0x4ff2('0x7'))(_0x4ff2('0x8'));config[_0x4ff2('0x9')]=_[_0x4ff2('0xa')](config[_0x4ff2('0x9')],{'host':_0x4ff2('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x4ff2('0x9')]));function getAdminUser(_0x2ab2b0,_0x3e1cf6,_0x2f497b,_0x46abbe,_0x3f3d71,_0x571b8b){return new Promise(function(_0x42e316,_0x10bdcc){var _0x4b4e78={'method':'GET','uri':_0x46abbe+_0x4ff2('0xc')+'&'+_0x3f3d71+'&'+_0x571b8b,'auth':_0x3e1cf6,'json':!![]};return rp(_0x4b4e78)[_0x4ff2('0xd')](function(_0x3a4f16){if(_0x3a4f16[_0x4ff2('0xe')][_0x4ff2('0xf')]>0x0){_0x2f497b[_0x4ff2('0x10')]=_0x3a4f16[_0x4ff2('0xe')][0x0]['sys_id'];}logger[_0x4ff2('0x11')]('['+[_0x2ab2b0['toUpperCase']()]+_0x4ff2('0x12'),_0x2f497b);_0x42e316(_0x2f497b);})[_0x4ff2('0x13')](function(_0x493867){logger[_0x4ff2('0x14')]('['+[_0x2ab2b0[_0x4ff2('0x15')]()]+']',_0x493867['message']);_0x10bdcc(_0x493867['message']);});});}function getUser(_0x510e39,_0xfce35b,_0x237b15,_0x5a41e8,_0x275780){return function(_0xf261b0){logger['info']('['+[_0x510e39[_0x4ff2('0x15')]()]+_0x4ff2('0x16'),_0xf261b0);return new Promise(function(_0x32158b,_0x5aa81c){if(intUtil['validateEmail'](_0xf261b0[_0x4ff2('0x17')])){var _0x27c568={'method':_0x4ff2('0x18'),'uri':_0x237b15+_0x4ff2('0x19')+_0xf261b0[_0x4ff2('0x17')]+'&'+_0x5a41e8+'&'+_0x275780,'auth':_0xfce35b,'json':!![]};logger[_0x4ff2('0x11')]('['+[_0x510e39['toUpperCase']()]+_0x4ff2('0x1a'),_0x27c568);return rp(_0x27c568)[_0x4ff2('0xd')](function(_0x3ec448){logger[_0x4ff2('0x11')]('['+[_0x510e39[_0x4ff2('0x15')]()]+_0x4ff2('0x1b'),_0x3ec448);if(_0x3ec448[_0x4ff2('0xe')][_0x4ff2('0xf')]>0x0&&String(_0x3ec448[_0x4ff2('0xe')][0x0]['active'])===_0x4ff2('0x1c')){_0xf261b0['userId']=_0x3ec448[_0x4ff2('0xe')][0x0][_0x4ff2('0x1d')];}else{_0xf261b0[_0x4ff2('0x1e')]=_0xf261b0['adminId'];_0xf261b0['userEmail']=_0xf261b0[_0x4ff2('0x1f')];}logger['info']('['+[_0x510e39[_0x4ff2('0x15')]()]+_0x4ff2('0x20'),_0xf261b0);_0x32158b(_0xf261b0);})[_0x4ff2('0x13')](function(_0x2b0b46){logger[_0x4ff2('0x14')]('['+[_0x510e39[_0x4ff2('0x15')]()]+']',_0x2b0b46[_0x4ff2('0x21')]);_0x5aa81c(_0x2b0b46[_0x4ff2('0x21')]);});}else{logger[_0x4ff2('0x11')]('['+[_0x510e39[_0x4ff2('0x15')]()]+_0x4ff2('0x22'));_0xf261b0[_0x4ff2('0x1e')]=_0xf261b0[_0x4ff2('0x10')];_0xf261b0[_0x4ff2('0x17')]=_0xf261b0[_0x4ff2('0x1f')];_0x32158b(_0xf261b0);}});};}function createEndUser(_0x4c123e,_0x2637b0,_0x15ea72,_0x31f202,_0x17d839){logger[_0x4ff2('0x11')]('['+[_0x4c123e[_0x4ff2('0x15')]()]+_0x4ff2('0x23'),_0x15ea72);return new Promise(function(_0x1d1c78,_0x19dbb6){var _0x673f4f={'method':'POST','uri':_0x31f202+_0x4ff2('0x24')+_0x17d839,'body':{'user_name':_0x15ea72[_0x4ff2('0x25')],'roles':_0x4ff2('0x26'),'first_name':_0x15ea72[_0x4ff2('0x25')],'active':_0x4ff2('0x1c'),'date_format':_0x4ff2('0x27'),'phone':_0x15ea72[_0x4ff2('0x25')]},'auth':_0x2637b0,'json':!![]};return rp(_0x673f4f)[_0x4ff2('0xd')](function(_0x39c7fe){logger[_0x4ff2('0x11')]('['+[_0x4c123e['toUpperCase']()]+_0x4ff2('0x28'),_0x39c7fe[_0x4ff2('0xe')]);_0x15ea72[_0x4ff2('0x29')]=_0x39c7fe[_0x4ff2('0xe')][_0x4ff2('0x1d')];_0x1d1c78(_0x15ea72);})[_0x4ff2('0x13')](function(_0x56d36f){logger['error']('['+[_0x4c123e[_0x4ff2('0x15')]()]+']',_0x56d36f[_0x4ff2('0x21')]);_0x19dbb6(_0x56d36f[_0x4ff2('0x21')]);});});}function getEndUser(_0x1958c5,_0xd17201,_0x4991d5,_0x3a76cd,_0x11daa8){return function(_0x1cd392){logger[_0x4ff2('0x11')]('['+[_0x1958c5['toUpperCase']()]+_0x4ff2('0x2a'),_0x1cd392);return new Promise(function(_0x7f5329,_0xb70c6c){var _0x31230c={'method':'GET','uri':_0x4991d5+'sys_user?sysparm_query=phone%3D'+_0x1cd392[_0x4ff2('0x25')]+'&'+_0x3a76cd+'&'+_0x11daa8,'auth':_0xd17201,'json':!![]};return rp(_0x31230c)[_0x4ff2('0xd')](function(_0x522762){if(_0x522762[_0x4ff2('0xe')][_0x4ff2('0xf')]>0x0){_0x1cd392['endUserId']=_0x522762['result'][0x0][_0x4ff2('0x1d')];logger[_0x4ff2('0x11')]('['+[_0x1958c5[_0x4ff2('0x15')]()]+'],\x20getEndUser\x20crm',_0x1cd392);_0x7f5329(_0x1cd392);}else{return createEndUser(_0x1958c5,_0xd17201,_0x1cd392,_0x4991d5,_0x3a76cd)[_0x4ff2('0xd')](function(_0x169d40){logger['info']('['+[_0x1958c5[_0x4ff2('0x15')]()]+_0x4ff2('0x2b'),_0x169d40);_0x7f5329(_0x169d40);});}})[_0x4ff2('0x13')](function(_0x570f47){logger['error']('['+[_0x1958c5[_0x4ff2('0x15')]()]+']',_0x570f47[_0x4ff2('0x21')]);_0xb70c6c(_0x570f47['message']);});});};}function getCustomFields(_0x3a1f54,_0x4565b1){var _0x2850a7={};if(_0x3a1f54[_0x4ff2('0xf')]>0x0){_[_0x4ff2('0x2c')](_0x3a1f54,function(_0xe4edd9){if(_[_0x4ff2('0x2d')]([_0x4ff2('0x2e'),_0x4ff2('0x2f')],_0xe4edd9[_0x4ff2('0x30')])&&_0xe4edd9[_0x4ff2('0x31')]&&!_0xe4edd9[_0x4ff2('0x32')]){_0x2850a7[_0xe4edd9[_0x4ff2('0x31')][_0x4ff2('0x33')]()]=_0xe4edd9[_0x4ff2('0x34')][_0x4ff2('0x35')]();}else if(_[_0x4ff2('0x2d')]([_0x4ff2('0x2e'),_0x4ff2('0x2f')],_0xe4edd9[_0x4ff2('0x30')])&&_0xe4edd9['idField']&&_0xe4edd9['customField']){_0x2850a7[_0xe4edd9['idField']['toLowerCase']()]=_0xe4edd9['content']['toString']();}else if(_0xe4edd9['type']==='variable'&&_0xe4edd9[_0x4ff2('0x36')]&&_0xe4edd9[_0x4ff2('0x37')]&&_0xe4edd9[_0x4ff2('0x32')]){_0x2850a7[_0xe4edd9['idField'][_0x4ff2('0x33')]()]=_0x4565b1[_0xe4edd9[_0x4ff2('0x36')]][_0x4ff2('0x35')]();}else if(_0xe4edd9[_0x4ff2('0x30')]===_0x4ff2('0x38')&&_0xe4edd9[_0x4ff2('0x39')]&&_0xe4edd9[_0x4ff2('0x39')][_0x4ff2('0x3a')]&&_0xe4edd9['idField']&&_0xe4edd9['customField']){_0x2850a7[_0xe4edd9['idField']['toLowerCase']()]=_0x4565b1[_0xe4edd9[_0x4ff2('0x39')]['name'][_0x4ff2('0x33')]()]['toString']();}});}return _0x2850a7;}function getTicket(_0x39c13c,_0x4dc8e8,_0x4fd732,_0x768575,_0x25a5f6,_0x341b57){return function(_0x290329){logger[_0x4ff2('0x11')]('['+[_0x39c13c['toUpperCase']()]+_0x4ff2('0x3b'),_0x290329);return new Promise(function(_0x3cb35f,_0xa2ffbd){var _0x391678=_0x39c13c[_0x4ff2('0x33')]()===_0x4ff2('0x3c')?_0x290329[_0x4ff2('0x1e')]:_0x290329[_0x4ff2('0x29')];var _0x30de8a={'method':'POST','uri':_0x4fd732+_0x4ff2('0x3d')+'?'+_0x341b57,'body':Object[_0x4ff2('0x3e')]({},{'active':_0x4ff2('0x1c'),'caller_id':_0x391678,'assigned_to':_0x290329[_0x4ff2('0x1e')],'short_description':intUtil['getString'](_0x768575[_0x4ff2('0x3f')],_0x25a5f6,'\x20'),'description':intUtil['getString'](_0x768575[_0x4ff2('0x40')],_0x25a5f6,'\x0a')},getCustomFields(_0x768575[_0x4ff2('0x41')],_0x25a5f6)),'auth':_0x4dc8e8,'json':!![]};return rp(_0x30de8a)[_0x4ff2('0xd')](function(_0x2ae8c5){logger[_0x4ff2('0x11')]('['+[_0x39c13c['toUpperCase']()]+']\x20POST\x20incident\x20entity\x20schema',_0x2ae8c5[_0x4ff2('0xe')]);_0x290329[_0x4ff2('0x42')]=_0x2ae8c5[_0x4ff2('0xe')][_0x4ff2('0x1d')];_0x290329[_0x4ff2('0x43')]=_0x2ae8c5[_0x4ff2('0xe')]['number'];logger[_0x4ff2('0x11')]('['+[_0x39c13c[_0x4ff2('0x15')]()]+']\x20getTicket\x20crm',_0x290329);_0x3cb35f(_0x290329);})['catch'](function(_0x3bf8db){logger[_0x4ff2('0x14')]('['+[_0x39c13c[_0x4ff2('0x15')]()]+']',_0x3bf8db[_0x4ff2('0x21')]);_0xa2ffbd(_0x3bf8db[_0x4ff2('0x21')]);});});};}function createRemoteTag(_0x3ef8f8,_0xe13ba5,_0x3623b9,_0x210460){return new Promise(function(_0x310ae2,_0x91a1f1){var _0x345a66={'method':_0x4ff2('0x44'),'uri':_0x3623b9+_0x4ff2('0x45')+'?'+_0x210460,'body':{'short_description':_0x3ef8f8,'global':!![],'active':!![],'name':_0x3ef8f8},'auth':_0xe13ba5,'json':!![]};return rp(_0x345a66)[_0x4ff2('0xd')](function(_0x3dd151){var _0x3c717b=_0x3dd151[_0x4ff2('0xe')][_0x4ff2('0x1d')];_0x310ae2(_0x3c717b);});});}function getRemoteTag(_0x317912,_0x4a5293,_0x307beb,_0x5490c2,_0x6cdad8){return new Promise(function(_0x50d459,_0x44434c){var _0x13e704={'method':_0x4ff2('0x18'),'uri':_0x307beb+'label'+'?sysparm_query=name%3D'+_0x317912+'&'+_0x5490c2,'auth':_0x4a5293,'json':!![]};return rp(_0x13e704)[_0x4ff2('0xd')](function(_0x378824){if(_0x378824[_0x4ff2('0xe')][_0x4ff2('0xf')]>0x0){var _0x340ddf=_0x378824[_0x4ff2('0xe')][0x0]['sys_id'];_0x50d459(_0x340ddf);}else{return createRemoteTag(_0x317912,_0x4a5293,_0x307beb,_0x5490c2)[_0x4ff2('0xd')](function(_0x8f0693){_0x50d459(_0x8f0693);});}});});}function assignTagToIncident(_0x382378,_0xeaf973,_0x4d6452,_0xef675c,_0x558aef){return new Promise(function(_0x26c51e,_0x3ad6af){var _0x1f0c25={'method':_0x4ff2('0x44'),'uri':_0x4d6452+_0x4ff2('0x46')+'?'+_0x558aef,'body':{'label':_0x382378,'table':_0x4ff2('0x3d'),'id_type':_0x4ff2('0x47'),'table_key':_0xef675c[_0x4ff2('0x42')],'title':_0x4ff2('0x48')+_0xef675c[_0x4ff2('0x43')],'id_display':_0xef675c[_0x4ff2('0x43')]},'auth':_0xeaf973,'json':!![]};return rp(_0x1f0c25)[_0x4ff2('0xd')](function(_0x2c21c1){_0x26c51e();})['catch'](function(){_0x26c51e();});});}function manageTags(_0x2de6ce,_0x4e21b4,_0x581590,_0xc1ff2c,_0x1f936a,_0x1190fd,_0x2a93d6){return new Promise(function(_0x57aa1e,_0x6a7c13){var _0xc4bdc3=[];_0x4e21b4[_0x4ff2('0x2c')](function(_0x51f828){_0xc4bdc3[_0x4ff2('0x49')](getRemoteTag(_0x51f828,_0x581590,_0xc1ff2c,_0x1190fd,_0x2a93d6));});return Promise['all'](_0xc4bdc3)['then'](function(_0x5a9545){if(_0x5a9545[_0x4ff2('0xf')]){logger[_0x4ff2('0x11')]('['+[_0x2de6ce[_0x4ff2('0x15')]()]+_0x4ff2('0x4a'),_0x5a9545);var _0x1a9c34=[];_0x5a9545[_0x4ff2('0x2c')](function(_0x21dc1e){_0x1a9c34[_0x4ff2('0x49')](assignTagToIncident(_0x21dc1e,_0x581590,_0xc1ff2c,_0x1f936a,_0x1190fd));});return Promise[_0x4ff2('0x4b')](_0x1a9c34)['then'](function(){_0x57aa1e();})[_0x4ff2('0x13')](function(){_0x57aa1e();});}else{_0x57aa1e();}});});}function getTags(_0x52b4cb,_0x3f65e9,_0xa6b426,_0x1f0894,_0x52f30a,_0x254177){return function(_0x38ad6d){return new Promise(function(_0x13465b,_0x233ad7){var _0x5b18d6=[];var _0x59d58c=_0x1f0894['Tags'];if(_0x59d58c&&_0x59d58c['length']>0x0){_0x5b18d6=_[_0x4ff2('0x4c')](_0x59d58c,_0x4ff2('0x3a'));}if(_0x5b18d6['length']>0x0){return manageTags(_0x52b4cb,_0x5b18d6,_0x3f65e9,_0xa6b426,_0x38ad6d,_0x52f30a,_0x254177)[_0x4ff2('0xd')](function(){_0x13465b(_0x38ad6d);});}else{_0x13465b(_0x38ad6d);}});};}function emit(_0x483377,_0x16aa9f,_0x1211b7){var _0x2b0f99=_0x4ff2('0x4d')+_0x4ff2('0x4e')+_0x4ff2('0x4f')+'%255EORDERBYDESCnumber';var _0x5027b9={'uri':_0x483377+_0x4ff2('0x50')+_0x1211b7+_0x2b0f99};io['to'](util['format'](_0x4ff2('0x51'),_0x16aa9f))[_0x4ff2('0x52')]('trigger:browser:url',_0x5027b9);}exports['cs']=function(_0x25ba36,_0x4817f5,_0x40e6b3,_0x17defd,_0x1c54f7,_0x496685,_0x2835c3,_0xd7fed1){var _0x1710cf={};var _0xd1953a={'user':_0x496685[_0x4ff2('0x53')],'pass':_0x496685[_0x4ff2('0x54')]};var _0x192bad=_0x4ff2('0x55');var _0xc2a0ef=_0x4ff2('0x56');_0x496685['remoteUri']=intUtil[_0x4ff2('0x57')](_0x496685[_0x4ff2('0x58')]);_0x496685[_0x4ff2('0x59')]=intUtil[_0x4ff2('0x57')](_0x496685[_0x4ff2('0x59')]);var _0x82018a=util[_0x4ff2('0x5a')](_0x4ff2('0x5b'),_0x496685[_0x4ff2('0x58')]);_0x1710cf[_0x4ff2('0x17')]=!_[_0x4ff2('0x5c')](_0x17defd)?_0x17defd['email']:null;_0x1710cf[_0x4ff2('0x1f')]=_0x496685[_0x4ff2('0x5d')];_0x1710cf['endUserNumber']=_0xd7fed1[_0x4ff2('0x33')]()===_0x4ff2('0x3c')?_0x4817f5[_0x4ff2('0x5e')]:_0x4817f5[_0x4ff2('0x5f')];_0x1710cf['callDirection']=_0xd7fed1==='queue'||_0xd7fed1===_0x4ff2('0x60')?_0x4ff2('0x61'):_0x4ff2('0x3c');var _0x3101b2=util[_0x4ff2('0x5a')](_0x4ff2('0x62'),_0x496685['serverUrl'],_0x4817f5['uniqueid'],md5(_0x4817f5['uniqueid']));if(_0x1c54f7&&_0x1c54f7[_0x4ff2('0x63')]){logger['info'](_0x4ff2('0x64'),_0x4ff2('0x65'));_0x4817f5[_0x4ff2('0x66')]=_0x3101b2;}else if(_0x2835c3&&_0x2835c3['recordingFormat']&&_0x2835c3[_0x4ff2('0x67')]!==_0x4ff2('0x68')){logger[_0x4ff2('0x11')](_0x4ff2('0x69'),_0x4ff2('0x65'));_0x4817f5[_0x4ff2('0x66')]=_0x3101b2;}else{_0x4817f5[_0x4ff2('0x66')]='';}return getAdminUser(_0xd7fed1,_0xd1953a,_0x1710cf,_0x82018a,_0xc2a0ef,_0x192bad)[_0x4ff2('0xd')](getUser(_0xd7fed1,_0xd1953a,_0x82018a,_0xc2a0ef,_0x192bad))[_0x4ff2('0xd')](getEndUser(_0xd7fed1,_0xd1953a,_0x82018a,_0xc2a0ef,_0x192bad))['then'](getTicket(_0xd7fed1,_0xd1953a,_0x82018a,_0x40e6b3,_0x4817f5,_0xc2a0ef))[_0x4ff2('0xd')](function(_0xb6948d){logger['info'](util['format'](_0x4ff2('0x6a'),_0xb6948d[_0x4ff2('0x42')]));logger[_0x4ff2('0x11')](util[_0x4ff2('0x5a')](_0x4ff2('0x6b'),_0xd7fed1));if(_0xd7fed1!==_0x4ff2('0x60')){logger['info']('['+[_0xd7fed1[_0x4ff2('0x15')]()]+']',_0x4ff2('0x6c'));emit(_0x496685[_0x4ff2('0x58')],_0x17defd[_0x4ff2('0x3a')],_0xb6948d[_0x4ff2('0x42')]);}})[_0x4ff2('0x13')](function(_0x27e094){logger[_0x4ff2('0x14')]('['+[_0xd7fed1['toUpperCase']()]+_0x4ff2('0x6d'),util[_0x4ff2('0x6e')](_0x27e094,{'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 26ab16b..b4ba6d2 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 _0x936a=['recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Outbound','charAt','catch','error','unmanaged','lastevent','toUpperCase','Inbound','Ticket\x20created!','lodash','md5','util','ioredis','./util','sugarcrm','redis','localhost','socket.io-emitter','POST','info','Creating\x20new\x20ticket...','Subjects','assigned_user_id','created_by','description','getString','Descriptions','date_start','toISOString','slice','replace','duration_hours','duration_minutes','Contacts','parent_name','name','direction','length','forEach','push','idField','variableName','set_entry','JSON','stringify','format','apiKey','toString','base64','isNil','get_entry_list','Employees','user_name','then','entry_list','find','name_value_list','value','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','Enduser\x20created.','[HTTP]','map','string','nameField','toLowerCase','type','customField','custom_fields','variable','Variable','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','Calls','queue','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','The\x20Ticket\x20ID\x20is:','users','contacts','version','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound'];(function(_0x77d286,_0x1ddc6d){var _0x5446a5=function(_0x45e2cf){while(--_0x45e2cf){_0x77d286['push'](_0x77d286['shift']());}};_0x5446a5(++_0x1ddc6d);}(_0x936a,0xfb));var _0xa936=function(_0x27e836,_0x3370bd){_0x27e836=_0x27e836-0x0;var _0x385d7f=_0x936a[_0x27e836];return _0x385d7f;};'use strict';var _=require(_0xa936('0x0'));var rp=require('request-promise');var BPromise=require('bluebird');var md5=require(_0xa936('0x1'));var util=require(_0xa936('0x2'));var Redis=require(_0xa936('0x3'));var intUtil=require(_0xa936('0x4'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0xa936('0x5'));config[_0xa936('0x6')]=_['defaults'](config[_0xa936('0x6')],{'host':_0xa936('0x7'),'port':0x18eb});var io=require(_0xa936('0x8'))(new Redis(config['redis']));var def={'method':_0xa936('0x9'),'json':!![]};function emit(_0x49b13e,_0x5c11e4,_0x56e56f){io['to'](_0x49b13e)['emit'](_0x5c11e4,_0x56e56f);}function getTicket(_0x3030e0,_0x11b6c0,_0x38911c,_0x44cb78,_0x35c362,_0x27900c,_0x5bca09,_0x4c0a70){logger[_0xa936('0xa')](_0xa936('0xb'));var _0x377d4d=new Date();var _0x53b70c=[{'name':'name','value':intUtil['getString'](_0x44cb78[_0xa936('0xc')],_0x35c362,'\x20')},{'name':_0xa936('0xd'),'value':_0x11b6c0['id']},{'name':_0xa936('0xe'),'value':_0x11b6c0['id']},{'name':_0xa936('0xf'),'value':intUtil[_0xa936('0x10')](_0x44cb78[_0xa936('0x11')],_0x35c362,'\x0a')},{'name':_0xa936('0x12'),'value':_0x377d4d[_0xa936('0x13')]()[_0xa936('0x14')](0x0,0x13)[_0xa936('0x15')]('T','\x20')},{'name':_0xa936('0x16'),'value':'0'},{'name':_0xa936('0x17'),'value':'15'},{'name':'parent_id','value':_0x38911c['id']},{'name':'parent_type','value':_0xa936('0x18')},{'name':_0xa936('0x19'),'value':_0x38911c[_0xa936('0x1a')]},{'name':_0xa936('0x1b'),'value':_0x4c0a70}];if(_0x27900c[_0xa936('0x1c')]){_[_0xa936('0x1d')](_0x27900c,function(_0x442688){if(_0x35c362[_0x442688['variableName']]){_0x53b70c[_0xa936('0x1e')]({'name':_0x442688[_0xa936('0x1f')],'value':_0x35c362[_0x442688[_0xa936('0x20')]]});}});}return request({'form':{'method':_0xa936('0x21'),'input_type':_0xa936('0x22'),'response_type':_0xa936('0x22'),'rest_data':JSON[_0xa936('0x23')]({'session':_0x5bca09['id'],'module_name':'Calls','name_value_list':_0x53b70c})}});}function getAuth(_0x5d8923){return util[_0xa936('0x24')]('Basic\x20%s',new Buffer(_0x5d8923[_0xa936('0x25')]+':X')[_0xa936('0x26')](_0xa936('0x27')));}function getServerInfo(_0x1b99b4){return request({'form':{'method':'get_server_info','input_type':_0xa936('0x22'),'response_type':_0xa936('0x22'),'rest_data':JSON['stringify']({'session':_0x1b99b4['id']})}});}function getUser(_0x25cf57,_0x1557a6,_0x2665a2){if(!_[_0xa936('0x28')](_0x1557a6)){logger[_0xa936('0xa')]('Getting\x20agent\x20with\x20name',_0x1557a6);return request({'form':{'method':_0xa936('0x29'),'input_type':_0xa936('0x22'),'response_type':_0xa936('0x22'),'rest_data':JSON[_0xa936('0x23')]({'session':_0x2665a2['id'],'module_name':_0xa936('0x2a'),'query':util['format']('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x1557a6),'order_by':'','offset':'0','select_fields':['id','name',_0xa936('0x2b')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xa936('0x2c')](function(_0x2ad622){if(_0x2ad622[_0xa936('0x2d')][_0xa936('0x1c')]){var _0xa393f7=_[_0xa936('0x2e')](_0x2ad622[_0xa936('0x2d')],function(_0x49a27a){return _0x49a27a[_0xa936('0x2f')][_0xa936('0x2b')][_0xa936('0x30')]===_0x1557a6;});if(_0xa393f7){logger['info']('Agent\x20found!');return BPromise[_0xa936('0x31')]({'id':_0xa393f7[_0xa936('0x2f')]['id'][_0xa936('0x30')],'name':_0xa393f7[_0xa936('0x2f')]['name'][_0xa936('0x30')]});}}logger['info'](_0xa936('0x32'));return BPromise[_0xa936('0x31')]({'id':_0x2665a2['name_value_list'][_0xa936('0x33')][_0xa936('0x30')],'name':_0x2665a2[_0xa936('0x2f')][_0xa936('0x2b')]['value']});});}else{logger[_0xa936('0xa')](_0xa936('0x34'));return BPromise['resolve']({'id':_0x2665a2[_0xa936('0x2f')][_0xa936('0x33')][_0xa936('0x30')],'name':_0x2665a2['name_value_list'][_0xa936('0x2b')]['value']});}}function getEndUser(_0xc605ec,_0x55b144,_0x37b032,_0x4fd0d1){logger[_0xa936('0xa')]('Searching\x20enduser\x20with\x20phone',_0x37b032);return request({'form':{'method':_0xa936('0x29'),'input_type':'JSON','response_type':_0xa936('0x22'),'rest_data':JSON['stringify']({'session':_0x4fd0d1['id'],'module_name':_0xa936('0x18'),'query':util[_0xa936('0x24')](_0xa936('0x35'),_0x37b032),'order_by':'','offset':'0','select_fields':['id',_0xa936('0x1a'),_0xa936('0x36')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xa936('0x2c')](function(_0x4468e5){if(_0x4468e5[_0xa936('0x2d')]['length']){var _0xb1637e=_[_0xa936('0x2e')](_0x4468e5[_0xa936('0x2d')],function(_0xad92a1){return _0xad92a1[_0xa936('0x2f')][_0xa936('0x36')][_0xa936('0x30')]===_0x37b032;});if(_0xb1637e){logger['info'](_0xa936('0x37'));return BPromise[_0xa936('0x31')]({'id':_0xb1637e['name_value_list']['id'][_0xa936('0x30')],'name':_0xb1637e['name_value_list'][_0xa936('0x1a')][_0xa936('0x30')],'phone':_0xb1637e['name_value_list'][_0xa936('0x36')][_0xa936('0x30')]});}}else{logger[_0xa936('0xa')](_0xa936('0x38'));return request({'form':{'method':_0xa936('0x21'),'input_type':_0xa936('0x22'),'response_type':_0xa936('0x22'),'rest_data':JSON[_0xa936('0x23')]({'session':_0x4fd0d1['id'],'module_name':_0xa936('0x18'),'name_value_list':[{'name':_0xa936('0x39'),'value':_0x55b144!==_0xa936('0x3a')?_0x55b144:util[_0xa936('0x24')](_0xa936('0x3b'),_0x37b032)},{'name':_0xa936('0x36'),'value':_0x37b032}]})}})['then'](function(_0x5b3958){logger['info'](_0xa936('0x3c'));return BPromise[_0xa936('0x31')]({'id':_0x5b3958['id'],'name':_0x5b3958[_0xa936('0x2d')][_0xa936('0x39')]['value'],'phone':_0x5b3958[_0xa936('0x2d')]['phone_home'][_0xa936('0x30')]});});}});}function request(_0x4cfdfc){logger['debug'](_0xa936('0x3d'),JSON[_0xa936('0x23')](_0x4cfdfc));return rp(_['merge'](def,_0x4cfdfc));}function getTags(_0x531d14,_0xe8c296){var _0x205668=[];if(_0x531d14&&_0x531d14[_0xa936('0x1c')]>0x0){_0x205668=_[_0xa936('0x3e')](_0x531d14,_0xe8c296);}return _0x205668;}function getCustomFields(_0x151ee2,_0x2a39ab){var _0x1683d0=[];var _0x1ef734={'custom_fields':[]};if(_0x151ee2['length']>0x0){_[_0xa936('0x1d')](_0x151ee2,function(_0x5e769c){if(_0x5e769c['type']===_0xa936('0x3f')&&_0x5e769c[_0xa936('0x40')]&&!_0x5e769c['customField']){_0x1ef734[_0x5e769c['nameField'][_0xa936('0x41')]()]=_0x5e769c['content']['toString']();}else if(_0x5e769c[_0xa936('0x42')]==='string'&&_0x5e769c[_0xa936('0x1f')]&&_0x5e769c[_0xa936('0x43')]){_0x1ef734[_0xa936('0x44')][_0xa936('0x1e')]({'id':_0x5e769c[_0xa936('0x1f')],'value':_0x5e769c['content'][_0xa936('0x26')]()});}else if(_0x5e769c[_0xa936('0x42')]===_0xa936('0x45')&&_0x5e769c['variableName']&&_0x5e769c[_0xa936('0x1f')]&&_0x5e769c['customField']){_0x2a39ab[_0x5e769c[_0xa936('0x20')]]&&_0x1ef734[_0xa936('0x44')][_0xa936('0x1e')]({'id':_0x5e769c[_0xa936('0x1f')],'value':_0x2a39ab[_0x5e769c[_0xa936('0x20')]][_0xa936('0x26')]()});}else if(_0x5e769c[_0xa936('0x42')]==='customVariable'&&_0x5e769c[_0xa936('0x46')]&&_0x5e769c['Variable'][_0xa936('0x1a')]&&_0x5e769c['idField']&&_0x5e769c[_0xa936('0x43')]){_0x2a39ab[_0x5e769c[_0xa936('0x46')][_0xa936('0x1a')][_0xa936('0x41')]()]&&_0x1ef734[_0xa936('0x44')][_0xa936('0x1e')]({'id':_0x5e769c[_0xa936('0x1f')],'value':_0x2a39ab[_0x5e769c[_0xa936('0x46')][_0xa936('0x1a')][_0xa936('0x41')]()]['toString']()});}});}return _0x1ef734;}function getConnection(_0x403f5e){return request({'method':_0xa936('0x9'),'form':{'method':_0xa936('0x47'),'input_type':_0xa936('0x22'),'response_type':_0xa936('0x22'),'rest_data':JSON[_0xa936('0x23')]({'user_auth':{'user_name':_0x403f5e[_0xa936('0x48')],'password':_0x403f5e[_0xa936('0x49')],'encryption':_0xa936('0x4a')},'application':_0xa936('0x4b')})}})[_0xa936('0x2c')](function(_0x18c85d){var _0x99565c=_0x18c85d;if(_0x99565c['id']){def[_0xa936('0x4c')]=_0x99565c['id'];return BPromise[_0xa936('0x31')](_0x99565c);}else{throw new Error(util[_0xa936('0x24')](_0xa936('0x4d'),_0x403f5e['id']));}});}function setRelationship(_0xa38f7a,_0x1b6593,_0x288a4f,_0x1812e5){return request({'form':{'method':_0xa936('0x4e'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0xa936('0x23')]({'session':_0xa38f7a['id'],'module_name':_0xa936('0x4f'),'module_id':_0x288a4f['id'],'link_field_name':_0x1812e5,'related_ids':[_0x1b6593['id']],'name_value_list':[],'delete':0x0})}});}exports[_0xa936('0x50')]=function(_0x1def78,_0xf7e7c8,_0x4ef2e0,_0x546888,_0x32a6ca,_0x25cdd7){var _0x11ada7,_0x57644d,_0x5f15e9,_0x5ec74f;_0x25cdd7[_0xa936('0x51')]=intUtil[_0xa936('0x52')](_0x25cdd7[_0xa936('0x51')]);_0x25cdd7[_0xa936('0x53')]=intUtil[_0xa936('0x52')](_0x25cdd7[_0xa936('0x53')]);def[_0xa936('0x54')]=util['format'](_0xa936('0x55'),_0x25cdd7[_0xa936('0x51')]);if(_0x32a6ca&&_0x32a6ca[_0xa936('0x56')]){logger['info'](_0xa936('0x57'),_0xa936('0x58'));_0xf7e7c8[_0xa936('0x59')]=util[_0xa936('0x24')](_0xa936('0x5a'),_0x25cdd7['serverUrl'],_0xf7e7c8[_0xa936('0x5b')],md5(_0xf7e7c8[_0xa936('0x5b')]));}else{_0xf7e7c8[_0xa936('0x59')]='';}return getConnection(_0x25cdd7)[_0xa936('0x2c')](function(_0x4560da){_0x5ec74f=_0x4560da;return getUser(_0x25cdd7,_0x546888['name'],_0x5ec74f);})['then'](function(_0x548487){_0x11ada7=_0x548487;logger['info']('The\x20User\x20ID\x20is:',_0x11ada7['id']);return getEndUser(_0x25cdd7,_0xf7e7c8[_0xa936('0x5c')],_0xf7e7c8[_0xa936('0x5d')],_0x5ec74f);})[_0xa936('0x2c')](function(_0x110aba){_0x57644d=_0x110aba;logger['info'](_0xa936('0x5e'),_0x57644d['id']);return getTicket(_0x25cdd7,_0x11ada7,_0x57644d,_0x4ef2e0,_0xf7e7c8,_0x4ef2e0[_0xa936('0x5f')],_0x5ec74f,'Inbound');})[_0xa936('0x2c')](function(_0xfa5078){_0x5f15e9=_0xfa5078;logger['info']('Ticket\x20created!');logger['info'](_0xa936('0x60'),_0x5f15e9['id']);return setRelationship(_0x5ec74f,_0x11ada7,_0x5f15e9,_0xa936('0x61'));})[_0xa936('0x2c')](function(){return setRelationship(_0x5ec74f,_0x57644d,_0x5f15e9,_0xa936('0x62'));})[_0xa936('0x2c')](function(){return getServerInfo(_0x5ec74f);})[_0xa936('0x2c')](function(_0x3e4487){var _0x148fb2=parseInt(_0x3e4487[_0xa936('0x63')]['charAt'](0x0));var _0x3f8735=util[_0xa936('0x24')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x25cdd7['remoteUri'],_0x5f15e9['id']);if(_0x148fb2>0x6){_0x3f8735=util[_0xa936('0x24')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x25cdd7['remoteUri'],_0x5f15e9['id']);}logger['info'](_0xa936('0x57'),_0xa936('0x64'));emit(util['format']('user:%s',_0x546888[_0xa936('0x1a')]),_0xa936('0x65'),{'uri':_0x3f8735});})['catch'](function(_0x37fea1){logger['error'](_0xa936('0x57'),JSON[_0xa936('0x23')](_0x37fea1));});};exports[_0xa936('0x66')]=function(_0x570061,_0x14f60b,_0x3d0ce6,_0x43bbe2,_0x12804c,_0x1e2722,_0x2481f0){var _0xca57e9,_0x2e7d3b,_0x5e14b0,_0x5ac9e5;_0x1e2722[_0xa936('0x51')]=intUtil[_0xa936('0x52')](_0x1e2722[_0xa936('0x51')]);_0x1e2722[_0xa936('0x53')]=intUtil[_0xa936('0x52')](_0x1e2722[_0xa936('0x53')]);def[_0xa936('0x54')]=util[_0xa936('0x24')](_0xa936('0x55'),_0x1e2722[_0xa936('0x51')]);if(_0x2481f0&&_0x2481f0['recordingFormat']&&_0x2481f0[_0xa936('0x67')]!==_0xa936('0x68')){logger[_0xa936('0xa')](_0xa936('0x69'),_0xa936('0x58'));_0x14f60b[_0xa936('0x59')]=util[_0xa936('0x24')](_0xa936('0x5a'),_0x1e2722['serverUrl'],_0x14f60b[_0xa936('0x5b')],md5(_0x14f60b['uniqueid']));}return getConnection(_0x1e2722)[_0xa936('0x2c')](function(_0x337c64){_0x5ac9e5=_0x337c64;return getUser(_0x1e2722,_0x43bbe2['name'],_0x5ac9e5);})['then'](function(_0x79e743){_0xca57e9=_0x79e743;logger[_0xa936('0xa')](_0xa936('0x6a'),_0xca57e9['id']);return getEndUser(_0x1e2722,_0x14f60b[_0xa936('0x6b')],_0x14f60b[_0xa936('0x6c')],_0x5ac9e5);})[_0xa936('0x2c')](function(_0x297868){_0x2e7d3b=_0x297868;logger[_0xa936('0xa')](_0xa936('0x5e'),_0x2e7d3b['id']);return getTicket(_0x1e2722,_0xca57e9,_0x2e7d3b,_0x3d0ce6,_0x14f60b,_0x3d0ce6[_0xa936('0x5f')],_0x5ac9e5,_0xa936('0x6d'));})[_0xa936('0x2c')](function(_0x5c9626){_0x5e14b0=_0x5c9626;logger[_0xa936('0xa')]('Ticket\x20created!');logger[_0xa936('0xa')](_0xa936('0x60'),_0x5e14b0['id']);return setRelationship(_0x5ac9e5,_0xca57e9,_0x5e14b0,_0xa936('0x61'));})[_0xa936('0x2c')](function(){return setRelationship(_0x5ac9e5,_0x2e7d3b,_0x5e14b0,'contacts');})[_0xa936('0x2c')](function(){return getServerInfo(_0x5ac9e5);})[_0xa936('0x2c')](function(_0x4d6fd8){var _0x5c583f=parseInt(_0x4d6fd8[_0xa936('0x63')][_0xa936('0x6e')](0x0));var _0x4a076b=util[_0xa936('0x24')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x1e2722[_0xa936('0x51')],_0x5e14b0['id']);if(_0x5c583f>0x6){_0x4a076b=util[_0xa936('0x24')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x1e2722['remoteUri'],_0x5e14b0['id']);}logger[_0xa936('0xa')]('[OUTBOUND]',_0xa936('0x64'));emit(util[_0xa936('0x24')]('user:%s',_0x43bbe2[_0xa936('0x1a')]),_0xa936('0x65'),{'uri':_0x4a076b});})[_0xa936('0x6f')](function(_0x4d229c){logger[_0xa936('0x70')](_0xa936('0x69'),JSON[_0xa936('0x23')](_0x4d229c));});};exports[_0xa936('0x71')]=function(_0x25f229,_0x138ee5,_0x46d79e,_0x2e0596,_0x11c1b0,_0x1aaa96){var _0x3ba871,_0x1ceb09,_0x509330,_0x592c9b;_0x1aaa96[_0xa936('0x51')]=intUtil[_0xa936('0x52')](_0x1aaa96[_0xa936('0x51')]);_0x1aaa96[_0xa936('0x53')]=intUtil[_0xa936('0x52')](_0x1aaa96[_0xa936('0x53')]);def[_0xa936('0x54')]=util[_0xa936('0x24')]('%s/service/v4_1/rest.php',_0x1aaa96[_0xa936('0x51')]);if(_0x11c1b0&&_0x11c1b0[_0xa936('0x56')]){logger[_0xa936('0xa')]('['+_0x138ee5[_0xa936('0x72')][_0xa936('0x73')]()+']',_0xa936('0x58'));_0x138ee5[_0xa936('0x59')]=util[_0xa936('0x24')](_0xa936('0x5a'),_0x1aaa96[_0xa936('0x53')],_0x138ee5['uniqueid'],md5(_0x138ee5[_0xa936('0x5b')]));}else{_0x138ee5['recordingURL']='';}return getConnection(_0x1aaa96)[_0xa936('0x2c')](function(_0x21aa29){_0x592c9b=_0x21aa29;if(!_[_0xa936('0x28')](_0x2e0596)){return getUser(_0x1aaa96,_0x2e0596['name'],_0x592c9b);}else{return getUser(_0x1aaa96,null,_0x592c9b);}})[_0xa936('0x2c')](function(_0x8a2227){_0x3ba871=_0x8a2227;logger['info']('The\x20User\x20ID\x20is:',_0x3ba871['id']);return getEndUser(_0x1aaa96,_0x138ee5['calleridname'],_0x138ee5[_0xa936('0x5d')],_0x592c9b);})[_0xa936('0x2c')](function(_0x1b6d77){_0x1ceb09=_0x1b6d77;logger[_0xa936('0xa')](_0xa936('0x5e'),_0x1ceb09['id']);return getTicket(_0x1aaa96,_0x3ba871,_0x1ceb09,_0x46d79e,_0x138ee5,_0x46d79e[_0xa936('0x5f')],_0x592c9b,_0xa936('0x74'));})[_0xa936('0x2c')](function(_0x5478c6){_0x509330=_0x5478c6;logger[_0xa936('0xa')](_0xa936('0x75'));logger['info'](_0xa936('0x60'),_0x509330['id']);return setRelationship(_0x592c9b,_0x3ba871,_0x509330,_0xa936('0x61'));})[_0xa936('0x2c')](function(){return setRelationship(_0x592c9b,_0x1ceb09,_0x509330,_0xa936('0x62'));})[_0xa936('0x2c')](function(){return getServerInfo(_0x592c9b);})['catch'](function(_0x10cc51){logger[_0xa936('0x70')]('['+_0x138ee5['lastevent'][_0xa936('0x73')]()+']',JSON['stringify'](_0x10cc51));});}; \ No newline at end of file +var _0x2729=['contacts','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','user:%s','catch','error','outbound','none','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20User\x20ID\x20is:','destcalleridname','The\x20Enduser\x20ID\x20is:','Outbound','Ticket\x20created!','charAt','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','unmanaged','lastevent','toUpperCase','Fields','request-promise','util','../../../../config/logger','sugarcrm','redis','defaults','socket.io-emitter','POST','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','created_by','description','Descriptions','toISOString','slice','duration_hours','duration_minutes','parent_type','Contacts','direction','length','forEach','push','idField','set_entry','JSON','Calls','format','Basic\x20%s','apiKey','toString','base64','get_server_info','stringify','isNil','info','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','find','name_value_list','value','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Searching\x20enduser\x20with\x20phone','phone_home','Enduser\x20found!','resolve','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Enduser\x20created.','debug','[HTTP]','map','nameField','customField','toLowerCase','content','string','custom_fields','type','variableName','customVariable','Variable','login','password','xCALLY\x20Motion\x20integration','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','calleridname','calleridnum','Inbound','The\x20Ticket\x20ID\x20is:','users'];(function(_0x2fd6cd,_0x5ae381){var _0x2cc3e9=function(_0x2a14a5){while(--_0x2a14a5){_0x2fd6cd['push'](_0x2fd6cd['shift']());}};_0x2cc3e9(++_0x5ae381);}(_0x2729,0x8b));var _0x9272=function(_0x582d5a,_0x3b57c0){_0x582d5a=_0x582d5a-0x0;var _0x5625ef=_0x2729[_0x582d5a];return _0x5625ef;};'use strict';var _=require('lodash');var rp=require(_0x9272('0x0'));var BPromise=require('bluebird');var md5=require('md5');var util=require(_0x9272('0x1'));var Redis=require('ioredis');var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x9272('0x2'))(_0x9272('0x3'));config[_0x9272('0x4')]=_[_0x9272('0x5')](config[_0x9272('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x9272('0x6'))(new Redis(config['redis']));var def={'method':_0x9272('0x7'),'json':!![]};function emit(_0x551498,_0x3584d1,_0x5e7a53){io['to'](_0x551498)['emit'](_0x3584d1,_0x5e7a53);}function getTicket(_0x180cb5,_0x4ae6b7,_0x3abcf5,_0x1fc3fa,_0x5a16df,_0x2defc6,_0x1db214,_0x43a7d1){logger['info'](_0x9272('0x8'));var _0xd4689b=new Date();var _0x226235=[{'name':_0x9272('0x9'),'value':intUtil[_0x9272('0xa')](_0x1fc3fa[_0x9272('0xb')],_0x5a16df,'\x20')},{'name':_0x9272('0xc'),'value':_0x4ae6b7['id']},{'name':_0x9272('0xd'),'value':_0x4ae6b7['id']},{'name':_0x9272('0xe'),'value':intUtil[_0x9272('0xa')](_0x1fc3fa[_0x9272('0xf')],_0x5a16df,'\x0a')},{'name':'date_start','value':_0xd4689b[_0x9272('0x10')]()[_0x9272('0x11')](0x0,0x13)['replace']('T','\x20')},{'name':_0x9272('0x12'),'value':'0'},{'name':_0x9272('0x13'),'value':'15'},{'name':'parent_id','value':_0x3abcf5['id']},{'name':_0x9272('0x14'),'value':_0x9272('0x15')},{'name':'parent_name','value':_0x3abcf5[_0x9272('0x9')]},{'name':_0x9272('0x16'),'value':_0x43a7d1}];if(_0x2defc6[_0x9272('0x17')]){_[_0x9272('0x18')](_0x2defc6,function(_0x162f89){if(_0x5a16df[_0x162f89['variableName']]){_0x226235[_0x9272('0x19')]({'name':_0x162f89[_0x9272('0x1a')],'value':_0x5a16df[_0x162f89['variableName']]});}});}return request({'form':{'method':_0x9272('0x1b'),'input_type':_0x9272('0x1c'),'response_type':_0x9272('0x1c'),'rest_data':JSON['stringify']({'session':_0x1db214['id'],'module_name':_0x9272('0x1d'),'name_value_list':_0x226235})}});}function getAuth(_0x486e97){return util[_0x9272('0x1e')](_0x9272('0x1f'),new Buffer(_0x486e97[_0x9272('0x20')]+':X')[_0x9272('0x21')](_0x9272('0x22')));}function getServerInfo(_0x49c856){return request({'form':{'method':_0x9272('0x23'),'input_type':_0x9272('0x1c'),'response_type':_0x9272('0x1c'),'rest_data':JSON[_0x9272('0x24')]({'session':_0x49c856['id']})}});}function getUser(_0x410283,_0x4ba66f,_0x26c93d){if(!_[_0x9272('0x25')](_0x4ba66f)){logger[_0x9272('0x26')](_0x9272('0x27'),_0x4ba66f);return request({'form':{'method':_0x9272('0x28'),'input_type':_0x9272('0x1c'),'response_type':_0x9272('0x1c'),'rest_data':JSON[_0x9272('0x24')]({'session':_0x26c93d['id'],'module_name':_0x9272('0x29'),'query':util[_0x9272('0x1e')](_0x9272('0x2a'),_0x4ba66f),'order_by':'','offset':'0','select_fields':['id',_0x9272('0x9'),_0x9272('0x2b')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x9272('0x2c')](function(_0x1efcdc){if(_0x1efcdc[_0x9272('0x2d')][_0x9272('0x17')]){var _0x24d8a8=_[_0x9272('0x2e')](_0x1efcdc['entry_list'],function(_0x59adc5){return _0x59adc5[_0x9272('0x2f')]['user_name'][_0x9272('0x30')]===_0x4ba66f;});if(_0x24d8a8){logger['info']('Agent\x20found!');return BPromise['resolve']({'id':_0x24d8a8[_0x9272('0x2f')]['id'][_0x9272('0x30')],'name':_0x24d8a8[_0x9272('0x2f')][_0x9272('0x9')][_0x9272('0x30')]});}}logger[_0x9272('0x26')](_0x9272('0x31'));return BPromise['resolve']({'id':_0x26c93d['name_value_list'][_0x9272('0x32')][_0x9272('0x30')],'name':_0x26c93d[_0x9272('0x2f')][_0x9272('0x2b')][_0x9272('0x30')]});});}else{logger[_0x9272('0x26')]('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise['resolve']({'id':_0x26c93d['name_value_list'][_0x9272('0x32')]['value'],'name':_0x26c93d['name_value_list'][_0x9272('0x2b')][_0x9272('0x30')]});}}function getEndUser(_0x256e89,_0x25fa0a,_0x261402,_0x327dad){logger[_0x9272('0x26')](_0x9272('0x33'),_0x261402);return request({'form':{'method':_0x9272('0x28'),'input_type':_0x9272('0x1c'),'response_type':_0x9272('0x1c'),'rest_data':JSON[_0x9272('0x24')]({'session':_0x327dad['id'],'module_name':_0x9272('0x15'),'query':util['format']('contacts.phone_home\x20=\x20\x22%s\x22',_0x261402),'order_by':'','offset':'0','select_fields':['id',_0x9272('0x9'),_0x9272('0x34')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x9272('0x2c')](function(_0x45fe1e){if(_0x45fe1e[_0x9272('0x2d')][_0x9272('0x17')]){var _0x246abe=_[_0x9272('0x2e')](_0x45fe1e[_0x9272('0x2d')],function(_0x5b99f0){return _0x5b99f0[_0x9272('0x2f')][_0x9272('0x34')][_0x9272('0x30')]===_0x261402;});if(_0x246abe){logger[_0x9272('0x26')](_0x9272('0x35'));return BPromise[_0x9272('0x36')]({'id':_0x246abe[_0x9272('0x2f')]['id']['value'],'name':_0x246abe[_0x9272('0x2f')][_0x9272('0x9')][_0x9272('0x30')],'phone':_0x246abe['name_value_list'][_0x9272('0x34')]['value']});}}else{logger[_0x9272('0x26')](_0x9272('0x37'));return request({'form':{'method':_0x9272('0x1b'),'input_type':_0x9272('0x1c'),'response_type':_0x9272('0x1c'),'rest_data':JSON[_0x9272('0x24')]({'session':_0x327dad['id'],'module_name':'Contacts','name_value_list':[{'name':_0x9272('0x38'),'value':_0x25fa0a!==_0x9272('0x39')?_0x25fa0a:util[_0x9272('0x1e')]('Caller\x20-\x20%s',_0x261402)},{'name':_0x9272('0x34'),'value':_0x261402}]})}})[_0x9272('0x2c')](function(_0x2a6792){logger[_0x9272('0x26')](_0x9272('0x3a'));return BPromise[_0x9272('0x36')]({'id':_0x2a6792['id'],'name':_0x2a6792[_0x9272('0x2d')]['first_name'][_0x9272('0x30')],'phone':_0x2a6792[_0x9272('0x2d')]['phone_home']['value']});});}});}function request(_0x2287ab){logger[_0x9272('0x3b')](_0x9272('0x3c'),JSON['stringify'](_0x2287ab));return rp(_['merge'](def,_0x2287ab));}function getTags(_0x2216e7,_0x344a70){var _0x42d3d3=[];if(_0x2216e7&&_0x2216e7['length']>0x0){_0x42d3d3=_[_0x9272('0x3d')](_0x2216e7,_0x344a70);}return _0x42d3d3;}function getCustomFields(_0x78f609,_0x3b13ca){var _0x4c8435=[];var _0x5e41c0={'custom_fields':[]};if(_0x78f609['length']>0x0){_[_0x9272('0x18')](_0x78f609,function(_0x37e880){if(_0x37e880['type']==='string'&&_0x37e880[_0x9272('0x3e')]&&!_0x37e880[_0x9272('0x3f')]){_0x5e41c0[_0x37e880[_0x9272('0x3e')][_0x9272('0x40')]()]=_0x37e880[_0x9272('0x41')][_0x9272('0x21')]();}else if(_0x37e880['type']===_0x9272('0x42')&&_0x37e880[_0x9272('0x1a')]&&_0x37e880[_0x9272('0x3f')]){_0x5e41c0[_0x9272('0x43')]['push']({'id':_0x37e880[_0x9272('0x1a')],'value':_0x37e880['content'][_0x9272('0x21')]()});}else if(_0x37e880[_0x9272('0x44')]==='variable'&&_0x37e880[_0x9272('0x45')]&&_0x37e880[_0x9272('0x1a')]&&_0x37e880['customField']){_0x3b13ca[_0x37e880[_0x9272('0x45')]]&&_0x5e41c0[_0x9272('0x43')][_0x9272('0x19')]({'id':_0x37e880[_0x9272('0x1a')],'value':_0x3b13ca[_0x37e880[_0x9272('0x45')]]['toString']()});}else if(_0x37e880[_0x9272('0x44')]===_0x9272('0x46')&&_0x37e880[_0x9272('0x47')]&&_0x37e880[_0x9272('0x47')][_0x9272('0x9')]&&_0x37e880[_0x9272('0x1a')]&&_0x37e880['customField']){_0x3b13ca[_0x37e880['Variable'][_0x9272('0x9')][_0x9272('0x40')]()]&&_0x5e41c0['custom_fields'][_0x9272('0x19')]({'id':_0x37e880[_0x9272('0x1a')],'value':_0x3b13ca[_0x37e880['Variable'][_0x9272('0x9')][_0x9272('0x40')]()][_0x9272('0x21')]()});}});}return _0x5e41c0;}function getConnection(_0x14a5c6){return request({'method':_0x9272('0x7'),'form':{'method':_0x9272('0x48'),'input_type':_0x9272('0x1c'),'response_type':_0x9272('0x1c'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x14a5c6['username'],'password':_0x14a5c6[_0x9272('0x49')],'encryption':'PLAIN'},'application':_0x9272('0x4a')})}})[_0x9272('0x2c')](function(_0x403662){var _0x284afd=_0x403662;if(_0x284afd['id']){def['sessionID']=_0x284afd['id'];return BPromise[_0x9272('0x36')](_0x284afd);}else{throw new Error(util[_0x9272('0x1e')](_0x9272('0x4b'),_0x14a5c6['id']));}});}function setRelationship(_0x1ca32e,_0x259436,_0x583105,_0xb5375b){return request({'form':{'method':_0x9272('0x4c'),'input_type':'JSON','response_type':_0x9272('0x1c'),'rest_data':JSON[_0x9272('0x24')]({'session':_0x1ca32e['id'],'module_name':_0x9272('0x1d'),'module_id':_0x583105['id'],'link_field_name':_0xb5375b,'related_ids':[_0x259436['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x9272('0x4d')]=function(_0xb90a06,_0xddfa40,_0x163df1,_0x437e2b,_0x37e115,_0x37932a){var _0xa3209f,_0x3df75f,_0x52c0b5,_0x2d3543;_0x37932a[_0x9272('0x4e')]=intUtil[_0x9272('0x4f')](_0x37932a['remoteUri']);_0x37932a[_0x9272('0x50')]=intUtil[_0x9272('0x4f')](_0x37932a['serverUrl']);def[_0x9272('0x51')]=util['format'](_0x9272('0x52'),_0x37932a[_0x9272('0x4e')]);if(_0x37e115&&_0x37e115[_0x9272('0x53')]){logger[_0x9272('0x26')](_0x9272('0x54'),'Recording\x20is\x20enabled!');_0xddfa40['recordingURL']=util[_0x9272('0x1e')](_0x9272('0x55'),_0x37932a[_0x9272('0x50')],_0xddfa40['uniqueid'],md5(_0xddfa40[_0x9272('0x56')]));}else{_0xddfa40[_0x9272('0x57')]='';}return getConnection(_0x37932a)[_0x9272('0x2c')](function(_0x5595ac){_0x2d3543=_0x5595ac;return getUser(_0x37932a,_0x437e2b[_0x9272('0x9')],_0x2d3543);})[_0x9272('0x2c')](function(_0x55e4a4){_0xa3209f=_0x55e4a4;logger[_0x9272('0x26')]('The\x20User\x20ID\x20is:',_0xa3209f['id']);return getEndUser(_0x37932a,_0xddfa40[_0x9272('0x58')],_0xddfa40[_0x9272('0x59')],_0x2d3543);})[_0x9272('0x2c')](function(_0x281b86){_0x3df75f=_0x281b86;logger[_0x9272('0x26')]('The\x20Enduser\x20ID\x20is:',_0x3df75f['id']);return getTicket(_0x37932a,_0xa3209f,_0x3df75f,_0x163df1,_0xddfa40,_0x163df1['Fields'],_0x2d3543,_0x9272('0x5a'));})[_0x9272('0x2c')](function(_0x1fc4f5){_0x52c0b5=_0x1fc4f5;logger[_0x9272('0x26')]('Ticket\x20created!');logger[_0x9272('0x26')](_0x9272('0x5b'),_0x52c0b5['id']);return setRelationship(_0x2d3543,_0xa3209f,_0x52c0b5,_0x9272('0x5c'));})['then'](function(){return setRelationship(_0x2d3543,_0x3df75f,_0x52c0b5,_0x9272('0x5d'));})[_0x9272('0x2c')](function(){return getServerInfo(_0x2d3543);})['then'](function(_0x12a3c4){var _0x295085=parseInt(_0x12a3c4[_0x9272('0x5e')]['charAt'](0x0));var _0x151265=util[_0x9272('0x1e')](_0x9272('0x5f'),_0x37932a['remoteUri'],_0x52c0b5['id']);if(_0x295085>0x6){_0x151265=util[_0x9272('0x1e')](_0x9272('0x60'),_0x37932a[_0x9272('0x4e')],_0x52c0b5['id']);}logger['info'](_0x9272('0x54'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x9272('0x1e')](_0x9272('0x61'),_0x437e2b[_0x9272('0x9')]),'trigger:browser:url',{'uri':_0x151265});})[_0x9272('0x62')](function(_0x46c79a){logger[_0x9272('0x63')]('[QUEUE]',JSON[_0x9272('0x24')](_0x46c79a));});};exports[_0x9272('0x64')]=function(_0x241532,_0x3dba8b,_0x310a76,_0x5949c8,_0x1000f4,_0x4f5ee4,_0xc8d086){var _0x1baf37,_0x35de00,_0x411ab6,_0x1557e1;_0x4f5ee4[_0x9272('0x4e')]=intUtil[_0x9272('0x4f')](_0x4f5ee4[_0x9272('0x4e')]);_0x4f5ee4[_0x9272('0x50')]=intUtil[_0x9272('0x4f')](_0x4f5ee4[_0x9272('0x50')]);def[_0x9272('0x51')]=util[_0x9272('0x1e')](_0x9272('0x52'),_0x4f5ee4[_0x9272('0x4e')]);if(_0xc8d086&&_0xc8d086['recordingFormat']&&_0xc8d086['recordingFormat']!==_0x9272('0x65')){logger[_0x9272('0x26')](_0x9272('0x66'),_0x9272('0x67'));_0x3dba8b['recordingURL']=util[_0x9272('0x1e')](_0x9272('0x55'),_0x4f5ee4[_0x9272('0x50')],_0x3dba8b[_0x9272('0x56')],md5(_0x3dba8b[_0x9272('0x56')]));}return getConnection(_0x4f5ee4)['then'](function(_0x5b35ab){_0x1557e1=_0x5b35ab;return getUser(_0x4f5ee4,_0x5949c8[_0x9272('0x9')],_0x1557e1);})['then'](function(_0x21b369){_0x1baf37=_0x21b369;logger[_0x9272('0x26')](_0x9272('0x68'),_0x1baf37['id']);return getEndUser(_0x4f5ee4,_0x3dba8b[_0x9272('0x69')],_0x3dba8b['destcalleridnum'],_0x1557e1);})['then'](function(_0x5d08be){_0x35de00=_0x5d08be;logger[_0x9272('0x26')](_0x9272('0x6a'),_0x35de00['id']);return getTicket(_0x4f5ee4,_0x1baf37,_0x35de00,_0x310a76,_0x3dba8b,_0x310a76['Fields'],_0x1557e1,_0x9272('0x6b'));})[_0x9272('0x2c')](function(_0xd33897){_0x411ab6=_0xd33897;logger[_0x9272('0x26')](_0x9272('0x6c'));logger[_0x9272('0x26')](_0x9272('0x5b'),_0x411ab6['id']);return setRelationship(_0x1557e1,_0x1baf37,_0x411ab6,_0x9272('0x5c'));})[_0x9272('0x2c')](function(){return setRelationship(_0x1557e1,_0x35de00,_0x411ab6,'contacts');})[_0x9272('0x2c')](function(){return getServerInfo(_0x1557e1);})[_0x9272('0x2c')](function(_0x5c8473){var _0x5d8d5=parseInt(_0x5c8473[_0x9272('0x5e')][_0x9272('0x6d')](0x0));var _0x39473c=util[_0x9272('0x1e')](_0x9272('0x5f'),_0x4f5ee4[_0x9272('0x4e')],_0x411ab6['id']);if(_0x5d8d5>0x6){_0x39473c=util[_0x9272('0x1e')](_0x9272('0x60'),_0x4f5ee4[_0x9272('0x4e')],_0x411ab6['id']);}logger[_0x9272('0x26')](_0x9272('0x66'),_0x9272('0x6e'));emit(util['format'](_0x9272('0x61'),_0x5949c8['name']),_0x9272('0x6f'),{'uri':_0x39473c});})[_0x9272('0x62')](function(_0x15e4ed){logger['error'](_0x9272('0x66'),JSON[_0x9272('0x24')](_0x15e4ed));});};exports[_0x9272('0x70')]=function(_0x54accb,_0x2e2723,_0x3a9160,_0x5488bc,_0x853ed7,_0x400949){var _0x50732b,_0x5f1008,_0x1650e9,_0x35749f;_0x400949[_0x9272('0x4e')]=intUtil['stripTrailingSlash'](_0x400949[_0x9272('0x4e')]);_0x400949[_0x9272('0x50')]=intUtil['stripTrailingSlash'](_0x400949['serverUrl']);def['uri']=util[_0x9272('0x1e')](_0x9272('0x52'),_0x400949[_0x9272('0x4e')]);if(_0x853ed7&&_0x853ed7[_0x9272('0x53')]){logger[_0x9272('0x26')]('['+_0x2e2723[_0x9272('0x71')][_0x9272('0x72')]()+']','Recording\x20is\x20enabled!');_0x2e2723[_0x9272('0x57')]=util[_0x9272('0x1e')](_0x9272('0x55'),_0x400949['serverUrl'],_0x2e2723[_0x9272('0x56')],md5(_0x2e2723[_0x9272('0x56')]));}else{_0x2e2723['recordingURL']='';}return getConnection(_0x400949)[_0x9272('0x2c')](function(_0x133b6e){_0x35749f=_0x133b6e;if(!_[_0x9272('0x25')](_0x5488bc)){return getUser(_0x400949,_0x5488bc[_0x9272('0x9')],_0x35749f);}else{return getUser(_0x400949,null,_0x35749f);}})[_0x9272('0x2c')](function(_0x33bd69){_0x50732b=_0x33bd69;logger[_0x9272('0x26')](_0x9272('0x68'),_0x50732b['id']);return getEndUser(_0x400949,_0x2e2723[_0x9272('0x58')],_0x2e2723[_0x9272('0x59')],_0x35749f);})['then'](function(_0x578ed2){_0x5f1008=_0x578ed2;logger[_0x9272('0x26')]('The\x20Enduser\x20ID\x20is:',_0x5f1008['id']);return getTicket(_0x400949,_0x50732b,_0x5f1008,_0x3a9160,_0x2e2723,_0x3a9160[_0x9272('0x73')],_0x35749f,_0x9272('0x5a'));})[_0x9272('0x2c')](function(_0x146b40){_0x1650e9=_0x146b40;logger[_0x9272('0x26')](_0x9272('0x6c'));logger[_0x9272('0x26')](_0x9272('0x5b'),_0x1650e9['id']);return setRelationship(_0x35749f,_0x50732b,_0x1650e9,_0x9272('0x5c'));})[_0x9272('0x2c')](function(){return setRelationship(_0x35749f,_0x5f1008,_0x1650e9,'contacts');})[_0x9272('0x2c')](function(){return getServerInfo(_0x35749f);})[_0x9272('0x62')](function(_0x56f58e){logger[_0x9272('0x63')]('['+_0x2e2723[_0x9272('0x71')][_0x9272('0x72')]()+']',JSON['stringify'](_0x56f58e));});}; \ 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 a68fc99..69d1422 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 _0x9a59=['isNil','lodash','util','getString','length','sortBy','type','string','push','content','variable','variableName','toString','name','Variable','toLowerCase','keyValue','keyType','key','%s:\x20%s','keyContent','customVariable','stripTrailingSlash','substring','lastIndexOf','validateEmail'];(function(_0x26e732,_0x4c70f7){var _0x477c09=function(_0x3ed9fd){while(--_0x3ed9fd){_0x26e732['push'](_0x26e732['shift']());}};_0x477c09(++_0x4c70f7);}(_0x9a59,0x9d));var _0x99a5=function(_0x3c6081,_0x41406e){_0x3c6081=_0x3c6081-0x0;var _0x52601d=_0x9a59[_0x3c6081];return _0x52601d;};'use strict';var _=require(_0x99a5('0x0'));var util=require(_0x99a5('0x1'));exports[_0x99a5('0x2')]=function(_0xa6197a,_0xb20c58,_0x4514b8){var _0x4fa9de=[];if(_0xa6197a[_0x99a5('0x3')]>0x0){var _0xe51ea7=_[_0x99a5('0x4')](_0xa6197a,['id']);for(var _0x53367d=0x0;_0x53367d<_0xe51ea7[_0x99a5('0x3')];_0x53367d++){var _0x566312=_0xe51ea7[_0x53367d];if(_0x566312[_0x99a5('0x5')]===_0x99a5('0x6')){_0x4fa9de[_0x99a5('0x7')](_0x566312[_0x99a5('0x8')]);}else if(_0x566312[_0x99a5('0x5')]===_0x99a5('0x9')&&_0x566312['variableName']){_0xb20c58[_0x566312[_0x99a5('0xa')]]&&_0x4fa9de['push'](_0xb20c58[_0x566312[_0x99a5('0xa')]][_0x99a5('0xb')]());}else if(_0x566312['type']==='customVariable'&&_0x566312['Variable']&&_0x566312['Variable'][_0x99a5('0xc')]){_0xb20c58[_0x566312[_0x99a5('0xd')][_0x99a5('0xc')][_0x99a5('0xe')]()]&&_0x4fa9de[_0x99a5('0x7')](_0xb20c58[_0x566312[_0x99a5('0xd')][_0x99a5('0xc')][_0x99a5('0xe')]()][_0x99a5('0xb')]());}else if(_0x566312[_0x99a5('0x5')]===_0x99a5('0xf')){if(_0x566312[_0x99a5('0x10')]===_0x99a5('0x6')&&_0x566312[_0x99a5('0x11')]){_0x4fa9de[_0x99a5('0x7')](util['format'](_0x99a5('0x12'),_0x566312[_0x99a5('0x11')],_0x566312[_0x99a5('0x13')]));}else if(_0x566312[_0x99a5('0x10')]===_0x99a5('0x9')&&_0x566312[_0x99a5('0xa')]&&_0x566312[_0x99a5('0x11')]){_0xb20c58[_0x566312[_0x99a5('0xa')]]&&_0x4fa9de[_0x99a5('0x7')](util['format'](_0x99a5('0x12'),_0x566312['key'],_0xb20c58[_0x566312[_0x99a5('0xa')]]));}else if(_0x566312['keyType']===_0x99a5('0x14')&&_0x566312['Variable']&&_0x566312[_0x99a5('0xd')][_0x99a5('0xc')]&&_0x566312[_0x99a5('0x11')]){_0xb20c58[_0x566312['Variable'][_0x99a5('0xc')][_0x99a5('0xe')]()]&&_0x4fa9de[_0x99a5('0x7')](util['format']('%s:\x20%s',_0x566312[_0x99a5('0x11')],_0xb20c58[_0x566312[_0x99a5('0xd')][_0x99a5('0xc')][_0x99a5('0xe')]()]));}}}}return _0x4fa9de['join'](_0x4514b8);};exports[_0x99a5('0x15')]=function(_0x50147f){var _0x3d0aa2=_0x50147f['slice'](-0x1);if(_0x3d0aa2==='/'){_0x50147f=_0x50147f[_0x99a5('0x16')](0x0,_0x50147f[_0x99a5('0x17')](_0x3d0aa2));}return _0x50147f;};exports[_0x99a5('0x18')]=function(_0x9125fd){if(!_[_0x99a5('0x19')](_0x9125fd)&&_0x9125fd!==''){var _0x274762=/^(([^<>()\[\]\\.,;:\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 _0x274762['test'](String(_0x9125fd)['toLowerCase']());}else{return![];}}; \ No newline at end of file +var _0xb03c=['content','variable','variableName','customVariable','Variable','name','toLowerCase','keyValue','%s:\x20%s','keyContent','keyType','key','format','join','lastIndexOf','validateEmail','isNil','test','lodash','getString','length','sortBy','type','string','push'];(function(_0x5cf137,_0x11d296){var _0x2ae93f=function(_0x147151){while(--_0x147151){_0x5cf137['push'](_0x5cf137['shift']());}};_0x2ae93f(++_0x11d296);}(_0xb03c,0x1a2));var _0xcb03=function(_0x421196,_0x1cbd94){_0x421196=_0x421196-0x0;var _0x2738af=_0xb03c[_0x421196];return _0x2738af;};'use strict';var _=require(_0xcb03('0x0'));var util=require('util');exports[_0xcb03('0x1')]=function(_0x230039,_0x4bb49c,_0x8d568f){var _0x43c7e1=[];if(_0x230039[_0xcb03('0x2')]>0x0){var _0x3aebb7=_[_0xcb03('0x3')](_0x230039,['id']);for(var _0x21232e=0x0;_0x21232e<_0x3aebb7[_0xcb03('0x2')];_0x21232e++){var _0x2de730=_0x3aebb7[_0x21232e];if(_0x2de730[_0xcb03('0x4')]===_0xcb03('0x5')){_0x43c7e1[_0xcb03('0x6')](_0x2de730[_0xcb03('0x7')]);}else if(_0x2de730['type']===_0xcb03('0x8')&&_0x2de730[_0xcb03('0x9')]){_0x4bb49c[_0x2de730[_0xcb03('0x9')]]&&_0x43c7e1[_0xcb03('0x6')](_0x4bb49c[_0x2de730['variableName']]['toString']());}else if(_0x2de730[_0xcb03('0x4')]===_0xcb03('0xa')&&_0x2de730['Variable']&&_0x2de730[_0xcb03('0xb')][_0xcb03('0xc')]){_0x4bb49c[_0x2de730[_0xcb03('0xb')][_0xcb03('0xc')][_0xcb03('0xd')]()]&&_0x43c7e1['push'](_0x4bb49c[_0x2de730[_0xcb03('0xb')][_0xcb03('0xc')][_0xcb03('0xd')]()]['toString']());}else if(_0x2de730[_0xcb03('0x4')]===_0xcb03('0xe')){if(_0x2de730['keyType']===_0xcb03('0x5')&&_0x2de730['key']){_0x43c7e1[_0xcb03('0x6')](util['format'](_0xcb03('0xf'),_0x2de730['key'],_0x2de730[_0xcb03('0x10')]));}else if(_0x2de730[_0xcb03('0x11')]===_0xcb03('0x8')&&_0x2de730[_0xcb03('0x9')]&&_0x2de730[_0xcb03('0x12')]){_0x4bb49c[_0x2de730[_0xcb03('0x9')]]&&_0x43c7e1[_0xcb03('0x6')](util[_0xcb03('0x13')](_0xcb03('0xf'),_0x2de730['key'],_0x4bb49c[_0x2de730[_0xcb03('0x9')]]));}else if(_0x2de730['keyType']==='customVariable'&&_0x2de730[_0xcb03('0xb')]&&_0x2de730[_0xcb03('0xb')][_0xcb03('0xc')]&&_0x2de730[_0xcb03('0x12')]){_0x4bb49c[_0x2de730['Variable'][_0xcb03('0xc')][_0xcb03('0xd')]()]&&_0x43c7e1['push'](util['format'](_0xcb03('0xf'),_0x2de730[_0xcb03('0x12')],_0x4bb49c[_0x2de730['Variable'][_0xcb03('0xc')][_0xcb03('0xd')]()]));}}}}return _0x43c7e1[_0xcb03('0x14')](_0x8d568f);};exports['stripTrailingSlash']=function(_0xa9fadf){var _0x1300bd=_0xa9fadf['slice'](-0x1);if(_0x1300bd==='/'){_0xa9fadf=_0xa9fadf['substring'](0x0,_0xa9fadf[_0xcb03('0x15')](_0x1300bd));}return _0xa9fadf;};exports[_0xcb03('0x16')]=function(_0x39cddc){if(!_[_0xcb03('0x17')](_0x39cddc)&&_0x39cddc!==''){var _0x17cb48=/^(([^<>()\[\]\\.,;:\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 _0x17cb48[_0xcb03('0x18')](String(_0x39cddc)[_0xcb03('0xd')]());}else{return![];}}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/vtiger.js b/server/services/ami/trigger/integration/vtiger.js index 35b4092..2a0722a 100644 --- a/server/services/ami/trigger/integration/vtiger.js +++ b/server/services/ami/trigger/integration/vtiger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['result','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','getUser','username','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','phone','catch','accessKey','getchallenge','token','Account\x20%d\x20is\x20not\x20valid','getConnection','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','unmanaged','lastevent','toUpperCase','lodash','request-promise','bluebird','util','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','emit','length','forEach','includes','string','idField','content','toString','type','variable','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','Subjects','getString','Descriptions','POST','format','%s/webservice.php','create','stringify','then','success','resolve','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s','validateEmail','Getting\x20agent\x20with\x20email','GET','query','sessionName','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;'];(function(_0x39589b,_0x20f8a8){var _0x589229=function(_0x1d676a){while(--_0x1d676a){_0x39589b['push'](_0x39589b['shift']());}};_0x589229(++_0x20f8a8);}(_0xe706,0xa3));var _0x6e70=function(_0x5bf82d,_0x290676){_0x5bf82d=_0x5bf82d-0x0;var _0x35122d=_0xe706[_0x5bf82d];return _0x35122d;};'use strict';var _=require(_0x6e70('0x0'));var rp=require(_0x6e70('0x1'));var BPromise=require(_0x6e70('0x2'));var md5=require('md5');var util=require(_0x6e70('0x3'));var Redis=require(_0x6e70('0x4'));var intUtil=require(_0x6e70('0x5'));var config=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));config[_0x6e70('0x9')]=_[_0x6e70('0xa')](config[_0x6e70('0x9')],{'host':_0x6e70('0xb'),'port':0x18eb});var io=require(_0x6e70('0xc'))(new Redis(config[_0x6e70('0x9')]));function emit(_0x45a2d4,_0x188ed3,_0x3c4843){io['to'](_0x45a2d4)[_0x6e70('0xd')](_0x188ed3,_0x3c4843);}function getCustomFields(_0x954545,_0x25e61c){var _0x100eb7={};if(_0x954545[_0x6e70('0xe')]>0x0){_[_0x6e70('0xf')](_0x954545,function(_0x3f474a){if(_[_0x6e70('0x10')]([_0x6e70('0x11'),'picklist'],_0x3f474a['type'])&&_0x3f474a[_0x6e70('0x12')]){_0x100eb7[_0x3f474a[_0x6e70('0x12')]]=_0x3f474a[_0x6e70('0x13')][_0x6e70('0x14')]();}else if(_0x3f474a[_0x6e70('0x15')]===_0x6e70('0x16')&&_0x3f474a[_0x6e70('0x17')]&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['variableName']]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['variableName']][_0x6e70('0x14')]();}else if(_0x3f474a['type']==='customVariable'&&_0x3f474a[_0x6e70('0x18')]&&_0x3f474a[_0x6e70('0x18')]['name']&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')][_0x6e70('0x1a')]()]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')]['toLowerCase']()][_0x6e70('0x14')]();}});}return _0x100eb7;}function createTicket(_0x173afe,_0x53acdc,_0x497d61,_0xc238ba,_0x208e21,_0x2368eb,_0x3a9978){logger[_0x6e70('0x1b')](_0x6e70('0x1c'));var _0x1b2453=_[_0x6e70('0x1d')]({'parent_id':'','assigned_user_id':_0x53acdc['id'],'ticketpriorities':_0x6e70('0x1e'),'ticketstatus':_0x6e70('0x1f'),'ticket_title':intUtil['getString'](_0xc238ba[_0x6e70('0x20')],_0x208e21,'\x20'),'description':intUtil[_0x6e70('0x21')](_0xc238ba[_0x6e70('0x22')],_0x208e21,'\x0a'),'contact_id':_0x497d61['id']},getCustomFields(_0x2368eb,_0x208e21));var _0x502b2d={'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x173afe['remoteUri']),'form':{'operation':_0x6e70('0x26'),'username':_0x173afe['username'],'sessionName':_0x3a9978['sessionName'],'elementType':'HelpDesk','element':JSON[_0x6e70('0x27')](_0x1b2453)},'json':!![]};return request(_0x502b2d)[_0x6e70('0x28')](function(_0x51d292){if(_0x51d292[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')]({'id':_0x51d292['result']['id']});}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x2b'),JSON[_0x6e70('0x27')](_0x51d292['error'])));}})['catch'](function(_0x2c4d37){var _0x3af17f=_0x2c4d37[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'createTicket',_0x3af17f,JSON[_0x6e70('0x27')](_0x2c4d37));});}function getUser(_0x406f29,_0xecf336,_0x2864a0){if(intUtil[_0x6e70('0x2f')](_0xecf336)){logger[_0x6e70('0x1b')](_0x6e70('0x30'),_0xecf336);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x406f29['remoteUri']),'qs':{'operation':_0x6e70('0x32'),'username':_0x406f29['username'],'sessionName':_0x2864a0[_0x6e70('0x33')],'query':util['format'](_0x6e70('0x34'),_0xecf336)},'json':!![]})[_0x6e70('0x28')](function(_0x30fa0b){if(_0x30fa0b['success']&&_0x30fa0b[_0x6e70('0x35')][_0x6e70('0xe')]){logger['info'](_0x6e70('0x36'));return BPromise[_0x6e70('0x2a')]({'id':_0x30fa0b['result'][0x0]['id'],'email':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x37')],'name':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x38')]+'\x20'+_0x30fa0b[_0x6e70('0x35')][_0x6e70('0x39')]});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29['username'],'name':_0x6e70('0x3c')});}})['catch'](function(_0x23cd1a){var _0x3222a2=_0x23cd1a[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x3222a2,JSON[_0x6e70('0x27')](_0x23cd1a));});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29[_0x6e70('0x3e')],'name':_0x6e70('0x3c')})['catch'](function(_0x5446a2){var _0x5424eb=_0x5446a2[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x5424eb,JSON[_0x6e70('0x27')](_0x5446a2));});}}function getEndUser(_0x3bdd87,_0x572a71,_0x3b508c,_0x9e7ad2){logger[_0x6e70('0x1b')](_0x6e70('0x3f'),_0x3b508c);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3bdd87[_0x6e70('0x40')]),'qs':{'operation':'query','username':_0x3bdd87[_0x6e70('0x3e')],'sessionName':_0x9e7ad2[_0x6e70('0x33')],'query':util[_0x6e70('0x24')](_0x6e70('0x41'),_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c)},'json':!![]})[_0x6e70('0x28')](function(_0x1de947){if(_0x1de947[_0x6e70('0x29')]&&_0x1de947['result']['length']){logger['info'](_0x6e70('0x42'));return BPromise[_0x6e70('0x2a')]({'id':_0x1de947[_0x6e70('0x35')][0x0]['id'],'name':_0x1de947[_0x6e70('0x35')][0x0][_0x6e70('0x43')]+'\x20'+_0x1de947['result'][0x0][_0x6e70('0x44')],'phone':_0x3b508c});}else{logger[_0x6e70('0x1b')](_0x6e70('0x45'));return request({'method':'POST','uri':util['format']('%s/webservice.php',_0x3bdd87[_0x6e70('0x40')]),'form':{'operation':'create','sessionName':_0x9e7ad2[_0x6e70('0x33')],'elementType':_0x6e70('0x46'),'element':JSON[_0x6e70('0x27')]({'lastname':_0x572a71,'phone':_0x3b508c,'assigned_user_id':'\x20'})},'json':!![]})[_0x6e70('0x28')](function(_0x59c87d){logger[_0x6e70('0x1b')]('Enduser\x20created.');return BPromise[_0x6e70('0x2a')]({'id':_0x59c87d[_0x6e70('0x35')]['id'],'name':_0x59c87d[_0x6e70('0x35')][_0x6e70('0x44')],'phone':_0x59c87d['result'][_0x6e70('0x47')]});})[_0x6e70('0x48')](function(_0x3d39c3){var _0xac87d6=_0x3d39c3[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'getEndUser',_0xac87d6,JSON[_0x6e70('0x27')](_0x3d39c3));});}});}function getConnection(_0x3884a4){var _0x10de2a=_0x3884a4[_0x6e70('0x3e')];var _0x3f86cf=_0x3884a4[_0x6e70('0x49')];return request({'method':_0x6e70('0x31'),'uri':util['format'](_0x6e70('0x25'),_0x3884a4['remoteUri']),'qs':{'operation':_0x6e70('0x4a'),'username':_0x10de2a},'json':!![]})[_0x6e70('0x28')](function(_0x4b351e){if(_0x4b351e['success']){return request({'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3884a4['remoteUri']),'form':{'operation':'login','username':_0x10de2a,'accessKey':md5(_0x4b351e[_0x6e70('0x35')][_0x6e70('0x4b')]+_0x3f86cf)},'json':!![]});}})[_0x6e70('0x28')](function(_0x79653){if(_0x79653[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')](_0x79653['result']);}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x4c'),_0x3884a4['id']));}})[_0x6e70('0x48')](function(_0x6ed023){var _0x2c3a7d=_0x6ed023['statusCode']||0x1f4;logger['error'](_0x6e70('0x2e'),_0x6e70('0x4d'),_0x2c3a7d,JSON[_0x6e70('0x27')](_0x6ed023));});}function request(_0x15f994){logger[_0x6e70('0x1b')]('[HTTP]',JSON[_0x6e70('0x27')](_0x15f994));return rp(_0x15f994);}exports[_0x6e70('0x4e')]=function(_0x1fa320,_0x23ebfb,_0x3aba34,_0x4a111a,_0x1142cd,_0x1dd242){var _0x2c20d3,_0x3fb0d3,_0x8ef4f7,_0x3fd03d;_0x1dd242['remoteUri']=intUtil[_0x6e70('0x4f')](_0x1dd242[_0x6e70('0x40')]);if(_0x1142cd&&_0x1142cd['monitor_format']){logger[_0x6e70('0x1b')](_0x6e70('0x50'),'Recording\x20is\x20enabled!');_0x23ebfb[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x1dd242[_0x6e70('0x53')],_0x23ebfb[_0x6e70('0x54')],md5(_0x23ebfb['uniqueid']));}else{_0x23ebfb[_0x6e70('0x51')]='';}return getConnection(_0x1dd242)[_0x6e70('0x28')](function(_0x10d655){_0x3fd03d=_0x10d655;return getUser(_0x1dd242,_0x4a111a[_0x6e70('0x55')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1fe13a){_0x2c20d3=_0x1fe13a;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x2c20d3['id']);return getEndUser(_0x1dd242,_0x23ebfb[_0x6e70('0x57')],_0x23ebfb[_0x6e70('0x58')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1b12a1){_0x3fb0d3=_0x1b12a1;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x3fb0d3['id']);return createTicket(_0x1dd242,_0x2c20d3,_0x3fb0d3,_0x3aba34,_0x23ebfb,_0x3aba34[_0x6e70('0x5a')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x324fa6){_0x8ef4f7=_0x324fa6;logger[_0x6e70('0x1b')](_0x6e70('0x5b'));logger[_0x6e70('0x1b')]('The\x20Ticket\x20ID\x20is:',_0x8ef4f7['id']);var _0x28898a=util[_0x6e70('0x24')](_0x6e70('0x5c'),_0x1dd242[_0x6e70('0x40')],_[_0x6e70('0x5d')](_0x8ef4f7['id'],'x')[0x1]);logger[_0x6e70('0x1b')]('[QUEUE]',_0x6e70('0x5e'));emit(util[_0x6e70('0x24')]('user:%s',_0x4a111a[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x28898a});})[_0x6e70('0x48')](function(_0x590f7f){logger['error'](_0x6e70('0x50'),JSON[_0x6e70('0x27')](_0x590f7f));});};exports[_0x6e70('0x60')]=function(_0x41a861,_0x10d299,_0x739946,_0x30cd88,_0x57bfe5,_0x4d47e1,_0x2c8dc6){var _0x1e23c5,_0x2bf9ec,_0x2ad395,_0x5b1e6f;_0x4d47e1['remoteUri']=intUtil[_0x6e70('0x4f')](_0x4d47e1[_0x6e70('0x40')]);_0x4d47e1['serverUrl']=intUtil['stripTrailingSlash'](_0x4d47e1[_0x6e70('0x53')]);if(_0x2c8dc6&&_0x2c8dc6['recordingFormat']&&_0x2c8dc6[_0x6e70('0x61')]!==_0x6e70('0x62')){logger[_0x6e70('0x1b')](_0x6e70('0x63'),_0x6e70('0x64'));_0x10d299[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x4d47e1['serverUrl'],_0x10d299[_0x6e70('0x54')],md5(_0x10d299[_0x6e70('0x54')]));}return getConnection(_0x4d47e1)[_0x6e70('0x28')](function(_0x346c79){_0x5b1e6f=_0x346c79;return getUser(_0x4d47e1,_0x30cd88[_0x6e70('0x55')],_0x5b1e6f);})['then'](function(_0x5f5b02){_0x1e23c5=_0x5f5b02;logger['info'](_0x6e70('0x56'),_0x1e23c5['id']);return getEndUser(_0x4d47e1,_0x10d299[_0x6e70('0x65')],_0x10d299[_0x6e70('0x66')],_0x5b1e6f);})['then'](function(_0x58cf1c){_0x2bf9ec=_0x58cf1c;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x2bf9ec['id']);return createTicket(_0x4d47e1,_0x1e23c5,_0x2bf9ec,_0x739946,_0x10d299,_0x739946[_0x6e70('0x5a')],_0x5b1e6f);})[_0x6e70('0x28')](function(_0x2285f1){_0x2ad395=_0x2285f1;logger[_0x6e70('0x1b')]('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x2ad395['id']);var _0x30d11b=util[_0x6e70('0x24')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x4d47e1[_0x6e70('0x40')],_['split'](_0x2ad395['id'],'x')[0x1]);logger['info'](_0x6e70('0x63'),_0x6e70('0x5e'));emit(util[_0x6e70('0x24')](_0x6e70('0x68'),_0x30cd88[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x30d11b});})['catch'](function(_0x370eeb){logger[_0x6e70('0x2d')](_0x6e70('0x63'),JSON[_0x6e70('0x27')](_0x370eeb));});};exports[_0x6e70('0x69')]=function(_0x13c092,_0x363722,_0xd9b4a9,_0x2f1362,_0x29621a,_0x575938){var _0x44c877,_0x303c5a,_0x577c3b,_0x5d398a;_0x575938['remoteUri']=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x40')]);_0x575938[_0x6e70('0x53')]=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x53')]);if(_0x29621a&&_0x29621a['monitor_format']){logger['info']('['+_0x363722[_0x6e70('0x6a')][_0x6e70('0x6b')]()+']','Recording\x20is\x20enabled!');_0x363722[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x575938[_0x6e70('0x53')],_0x363722[_0x6e70('0x54')],md5(_0x363722[_0x6e70('0x54')]));}else{_0x363722[_0x6e70('0x51')]='';}return getConnection(_0x575938)[_0x6e70('0x28')](function(_0x3650e9){_0x5d398a=_0x3650e9;return getUser(_0x575938,'',_0x5d398a);})[_0x6e70('0x28')](function(_0x347cc4){_0x44c877=_0x347cc4;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x44c877['id']);return getEndUser(_0x575938,_0x363722[_0x6e70('0x57')],_0x363722['calleridnum'],_0x5d398a);})['then'](function(_0x39ed95){_0x303c5a=_0x39ed95;logger['info'](_0x6e70('0x59'),_0x303c5a['id']);return createTicket(_0x575938,_0x44c877,_0x303c5a,_0xd9b4a9,_0x363722,_0xd9b4a9['Fields'],_0x5d398a);})['then'](function(_0x402f6f){_0x577c3b=_0x402f6f;logger['info']('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x577c3b['id']);})[_0x6e70('0x48')](function(_0x4e9fda){logger['error']('['+_0x363722['lastevent'][_0x6e70('0x6b')]()+']',JSON['stringify'](_0x4e9fda));});}; \ No newline at end of file +var _0xe706=['result','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','getUser','username','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','phone','catch','accessKey','getchallenge','token','Account\x20%d\x20is\x20not\x20valid','getConnection','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','unmanaged','lastevent','toUpperCase','lodash','request-promise','bluebird','util','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','emit','length','forEach','includes','string','idField','content','toString','type','variable','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','Subjects','getString','Descriptions','POST','format','%s/webservice.php','create','stringify','then','success','resolve','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s','validateEmail','Getting\x20agent\x20with\x20email','GET','query','sessionName','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;'];(function(_0x1faf67,_0x7ad662){var _0x387342=function(_0x25dd4a){while(--_0x25dd4a){_0x1faf67['push'](_0x1faf67['shift']());}};_0x387342(++_0x7ad662);}(_0xe706,0xa3));var _0x6e70=function(_0x5b3447,_0x52bef4){_0x5b3447=_0x5b3447-0x0;var _0x2c10bf=_0xe706[_0x5b3447];return _0x2c10bf;};'use strict';var _=require(_0x6e70('0x0'));var rp=require(_0x6e70('0x1'));var BPromise=require(_0x6e70('0x2'));var md5=require('md5');var util=require(_0x6e70('0x3'));var Redis=require(_0x6e70('0x4'));var intUtil=require(_0x6e70('0x5'));var config=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));config[_0x6e70('0x9')]=_[_0x6e70('0xa')](config[_0x6e70('0x9')],{'host':_0x6e70('0xb'),'port':0x18eb});var io=require(_0x6e70('0xc'))(new Redis(config[_0x6e70('0x9')]));function emit(_0x45a2d4,_0x188ed3,_0x3c4843){io['to'](_0x45a2d4)[_0x6e70('0xd')](_0x188ed3,_0x3c4843);}function getCustomFields(_0x954545,_0x25e61c){var _0x100eb7={};if(_0x954545[_0x6e70('0xe')]>0x0){_[_0x6e70('0xf')](_0x954545,function(_0x3f474a){if(_[_0x6e70('0x10')]([_0x6e70('0x11'),'picklist'],_0x3f474a['type'])&&_0x3f474a[_0x6e70('0x12')]){_0x100eb7[_0x3f474a[_0x6e70('0x12')]]=_0x3f474a[_0x6e70('0x13')][_0x6e70('0x14')]();}else if(_0x3f474a[_0x6e70('0x15')]===_0x6e70('0x16')&&_0x3f474a[_0x6e70('0x17')]&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['variableName']]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['variableName']][_0x6e70('0x14')]();}else if(_0x3f474a['type']==='customVariable'&&_0x3f474a[_0x6e70('0x18')]&&_0x3f474a[_0x6e70('0x18')]['name']&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')][_0x6e70('0x1a')]()]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')]['toLowerCase']()][_0x6e70('0x14')]();}});}return _0x100eb7;}function createTicket(_0x173afe,_0x53acdc,_0x497d61,_0xc238ba,_0x208e21,_0x2368eb,_0x3a9978){logger[_0x6e70('0x1b')](_0x6e70('0x1c'));var _0x1b2453=_[_0x6e70('0x1d')]({'parent_id':'','assigned_user_id':_0x53acdc['id'],'ticketpriorities':_0x6e70('0x1e'),'ticketstatus':_0x6e70('0x1f'),'ticket_title':intUtil['getString'](_0xc238ba[_0x6e70('0x20')],_0x208e21,'\x20'),'description':intUtil[_0x6e70('0x21')](_0xc238ba[_0x6e70('0x22')],_0x208e21,'\x0a'),'contact_id':_0x497d61['id']},getCustomFields(_0x2368eb,_0x208e21));var _0x502b2d={'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x173afe['remoteUri']),'form':{'operation':_0x6e70('0x26'),'username':_0x173afe['username'],'sessionName':_0x3a9978['sessionName'],'elementType':'HelpDesk','element':JSON[_0x6e70('0x27')](_0x1b2453)},'json':!![]};return request(_0x502b2d)[_0x6e70('0x28')](function(_0x51d292){if(_0x51d292[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')]({'id':_0x51d292['result']['id']});}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x2b'),JSON[_0x6e70('0x27')](_0x51d292['error'])));}})['catch'](function(_0x2c4d37){var _0x3af17f=_0x2c4d37[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'createTicket',_0x3af17f,JSON[_0x6e70('0x27')](_0x2c4d37));});}function getUser(_0x406f29,_0xecf336,_0x2864a0){if(intUtil[_0x6e70('0x2f')](_0xecf336)){logger[_0x6e70('0x1b')](_0x6e70('0x30'),_0xecf336);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x406f29['remoteUri']),'qs':{'operation':_0x6e70('0x32'),'username':_0x406f29['username'],'sessionName':_0x2864a0[_0x6e70('0x33')],'query':util['format'](_0x6e70('0x34'),_0xecf336)},'json':!![]})[_0x6e70('0x28')](function(_0x30fa0b){if(_0x30fa0b['success']&&_0x30fa0b[_0x6e70('0x35')][_0x6e70('0xe')]){logger['info'](_0x6e70('0x36'));return BPromise[_0x6e70('0x2a')]({'id':_0x30fa0b['result'][0x0]['id'],'email':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x37')],'name':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x38')]+'\x20'+_0x30fa0b[_0x6e70('0x35')][_0x6e70('0x39')]});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29['username'],'name':_0x6e70('0x3c')});}})['catch'](function(_0x23cd1a){var _0x3222a2=_0x23cd1a[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x3222a2,JSON[_0x6e70('0x27')](_0x23cd1a));});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29[_0x6e70('0x3e')],'name':_0x6e70('0x3c')})['catch'](function(_0x5446a2){var _0x5424eb=_0x5446a2[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x5424eb,JSON[_0x6e70('0x27')](_0x5446a2));});}}function getEndUser(_0x3bdd87,_0x572a71,_0x3b508c,_0x9e7ad2){logger[_0x6e70('0x1b')](_0x6e70('0x3f'),_0x3b508c);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3bdd87[_0x6e70('0x40')]),'qs':{'operation':'query','username':_0x3bdd87[_0x6e70('0x3e')],'sessionName':_0x9e7ad2[_0x6e70('0x33')],'query':util[_0x6e70('0x24')](_0x6e70('0x41'),_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c)},'json':!![]})[_0x6e70('0x28')](function(_0x1de947){if(_0x1de947[_0x6e70('0x29')]&&_0x1de947['result']['length']){logger['info'](_0x6e70('0x42'));return BPromise[_0x6e70('0x2a')]({'id':_0x1de947[_0x6e70('0x35')][0x0]['id'],'name':_0x1de947[_0x6e70('0x35')][0x0][_0x6e70('0x43')]+'\x20'+_0x1de947['result'][0x0][_0x6e70('0x44')],'phone':_0x3b508c});}else{logger[_0x6e70('0x1b')](_0x6e70('0x45'));return request({'method':'POST','uri':util['format']('%s/webservice.php',_0x3bdd87[_0x6e70('0x40')]),'form':{'operation':'create','sessionName':_0x9e7ad2[_0x6e70('0x33')],'elementType':_0x6e70('0x46'),'element':JSON[_0x6e70('0x27')]({'lastname':_0x572a71,'phone':_0x3b508c,'assigned_user_id':'\x20'})},'json':!![]})[_0x6e70('0x28')](function(_0x59c87d){logger[_0x6e70('0x1b')]('Enduser\x20created.');return BPromise[_0x6e70('0x2a')]({'id':_0x59c87d[_0x6e70('0x35')]['id'],'name':_0x59c87d[_0x6e70('0x35')][_0x6e70('0x44')],'phone':_0x59c87d['result'][_0x6e70('0x47')]});})[_0x6e70('0x48')](function(_0x3d39c3){var _0xac87d6=_0x3d39c3[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'getEndUser',_0xac87d6,JSON[_0x6e70('0x27')](_0x3d39c3));});}});}function getConnection(_0x3884a4){var _0x10de2a=_0x3884a4[_0x6e70('0x3e')];var _0x3f86cf=_0x3884a4[_0x6e70('0x49')];return request({'method':_0x6e70('0x31'),'uri':util['format'](_0x6e70('0x25'),_0x3884a4['remoteUri']),'qs':{'operation':_0x6e70('0x4a'),'username':_0x10de2a},'json':!![]})[_0x6e70('0x28')](function(_0x4b351e){if(_0x4b351e['success']){return request({'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3884a4['remoteUri']),'form':{'operation':'login','username':_0x10de2a,'accessKey':md5(_0x4b351e[_0x6e70('0x35')][_0x6e70('0x4b')]+_0x3f86cf)},'json':!![]});}})[_0x6e70('0x28')](function(_0x79653){if(_0x79653[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')](_0x79653['result']);}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x4c'),_0x3884a4['id']));}})[_0x6e70('0x48')](function(_0x6ed023){var _0x2c3a7d=_0x6ed023['statusCode']||0x1f4;logger['error'](_0x6e70('0x2e'),_0x6e70('0x4d'),_0x2c3a7d,JSON[_0x6e70('0x27')](_0x6ed023));});}function request(_0x15f994){logger[_0x6e70('0x1b')]('[HTTP]',JSON[_0x6e70('0x27')](_0x15f994));return rp(_0x15f994);}exports[_0x6e70('0x4e')]=function(_0x1fa320,_0x23ebfb,_0x3aba34,_0x4a111a,_0x1142cd,_0x1dd242){var _0x2c20d3,_0x3fb0d3,_0x8ef4f7,_0x3fd03d;_0x1dd242['remoteUri']=intUtil[_0x6e70('0x4f')](_0x1dd242[_0x6e70('0x40')]);if(_0x1142cd&&_0x1142cd['monitor_format']){logger[_0x6e70('0x1b')](_0x6e70('0x50'),'Recording\x20is\x20enabled!');_0x23ebfb[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x1dd242[_0x6e70('0x53')],_0x23ebfb[_0x6e70('0x54')],md5(_0x23ebfb['uniqueid']));}else{_0x23ebfb[_0x6e70('0x51')]='';}return getConnection(_0x1dd242)[_0x6e70('0x28')](function(_0x10d655){_0x3fd03d=_0x10d655;return getUser(_0x1dd242,_0x4a111a[_0x6e70('0x55')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1fe13a){_0x2c20d3=_0x1fe13a;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x2c20d3['id']);return getEndUser(_0x1dd242,_0x23ebfb[_0x6e70('0x57')],_0x23ebfb[_0x6e70('0x58')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1b12a1){_0x3fb0d3=_0x1b12a1;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x3fb0d3['id']);return createTicket(_0x1dd242,_0x2c20d3,_0x3fb0d3,_0x3aba34,_0x23ebfb,_0x3aba34[_0x6e70('0x5a')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x324fa6){_0x8ef4f7=_0x324fa6;logger[_0x6e70('0x1b')](_0x6e70('0x5b'));logger[_0x6e70('0x1b')]('The\x20Ticket\x20ID\x20is:',_0x8ef4f7['id']);var _0x28898a=util[_0x6e70('0x24')](_0x6e70('0x5c'),_0x1dd242[_0x6e70('0x40')],_[_0x6e70('0x5d')](_0x8ef4f7['id'],'x')[0x1]);logger[_0x6e70('0x1b')]('[QUEUE]',_0x6e70('0x5e'));emit(util[_0x6e70('0x24')]('user:%s',_0x4a111a[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x28898a});})[_0x6e70('0x48')](function(_0x590f7f){logger['error'](_0x6e70('0x50'),JSON[_0x6e70('0x27')](_0x590f7f));});};exports[_0x6e70('0x60')]=function(_0x41a861,_0x10d299,_0x739946,_0x30cd88,_0x57bfe5,_0x4d47e1,_0x2c8dc6){var _0x1e23c5,_0x2bf9ec,_0x2ad395,_0x5b1e6f;_0x4d47e1['remoteUri']=intUtil[_0x6e70('0x4f')](_0x4d47e1[_0x6e70('0x40')]);_0x4d47e1['serverUrl']=intUtil['stripTrailingSlash'](_0x4d47e1[_0x6e70('0x53')]);if(_0x2c8dc6&&_0x2c8dc6['recordingFormat']&&_0x2c8dc6[_0x6e70('0x61')]!==_0x6e70('0x62')){logger[_0x6e70('0x1b')](_0x6e70('0x63'),_0x6e70('0x64'));_0x10d299[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x4d47e1['serverUrl'],_0x10d299[_0x6e70('0x54')],md5(_0x10d299[_0x6e70('0x54')]));}return getConnection(_0x4d47e1)[_0x6e70('0x28')](function(_0x346c79){_0x5b1e6f=_0x346c79;return getUser(_0x4d47e1,_0x30cd88[_0x6e70('0x55')],_0x5b1e6f);})['then'](function(_0x5f5b02){_0x1e23c5=_0x5f5b02;logger['info'](_0x6e70('0x56'),_0x1e23c5['id']);return getEndUser(_0x4d47e1,_0x10d299[_0x6e70('0x65')],_0x10d299[_0x6e70('0x66')],_0x5b1e6f);})['then'](function(_0x58cf1c){_0x2bf9ec=_0x58cf1c;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x2bf9ec['id']);return createTicket(_0x4d47e1,_0x1e23c5,_0x2bf9ec,_0x739946,_0x10d299,_0x739946[_0x6e70('0x5a')],_0x5b1e6f);})[_0x6e70('0x28')](function(_0x2285f1){_0x2ad395=_0x2285f1;logger[_0x6e70('0x1b')]('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x2ad395['id']);var _0x30d11b=util[_0x6e70('0x24')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x4d47e1[_0x6e70('0x40')],_['split'](_0x2ad395['id'],'x')[0x1]);logger['info'](_0x6e70('0x63'),_0x6e70('0x5e'));emit(util[_0x6e70('0x24')](_0x6e70('0x68'),_0x30cd88[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x30d11b});})['catch'](function(_0x370eeb){logger[_0x6e70('0x2d')](_0x6e70('0x63'),JSON[_0x6e70('0x27')](_0x370eeb));});};exports[_0x6e70('0x69')]=function(_0x13c092,_0x363722,_0xd9b4a9,_0x2f1362,_0x29621a,_0x575938){var _0x44c877,_0x303c5a,_0x577c3b,_0x5d398a;_0x575938['remoteUri']=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x40')]);_0x575938[_0x6e70('0x53')]=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x53')]);if(_0x29621a&&_0x29621a['monitor_format']){logger['info']('['+_0x363722[_0x6e70('0x6a')][_0x6e70('0x6b')]()+']','Recording\x20is\x20enabled!');_0x363722[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x575938[_0x6e70('0x53')],_0x363722[_0x6e70('0x54')],md5(_0x363722[_0x6e70('0x54')]));}else{_0x363722[_0x6e70('0x51')]='';}return getConnection(_0x575938)[_0x6e70('0x28')](function(_0x3650e9){_0x5d398a=_0x3650e9;return getUser(_0x575938,'',_0x5d398a);})[_0x6e70('0x28')](function(_0x347cc4){_0x44c877=_0x347cc4;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x44c877['id']);return getEndUser(_0x575938,_0x363722[_0x6e70('0x57')],_0x363722['calleridnum'],_0x5d398a);})['then'](function(_0x39ed95){_0x303c5a=_0x39ed95;logger['info'](_0x6e70('0x59'),_0x303c5a['id']);return createTicket(_0x575938,_0x44c877,_0x303c5a,_0xd9b4a9,_0x363722,_0xd9b4a9['Fields'],_0x5d398a);})['then'](function(_0x402f6f){_0x577c3b=_0x402f6f;logger['info']('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x577c3b['id']);})[_0x6e70('0x48')](function(_0x4e9fda){logger['error']('['+_0x363722['lastevent'][_0x6e70('0x6b')]()+']',JSON['stringify'](_0x4e9fda));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js index 07a192f..27c0738 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 _0x64fc=['destcalleridname','destcalleridnum','integrationTab','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','unmanaged','lastevent','toUpperCase','md5','util','../../../../config/environment','zendesk','redis','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','%s/tickets.json','remoteUri','merge','Tags','name','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','format','type:user\x20role:agent\x20email:%s','count','find','results','agent','%s/users/me.json','Admin\x20account\x20selected.','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user','Searching\x20enduser\x20with\x20phone','length','filter','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','Caller\x20-\x20%s','authType','username','password','token','%s/token:%s','toString','base64','[HTTP]','GET','map','includes','string','picklist','type','nameField','customField','toLowerCase','content','idField','custom_fields','push','variable','variableName','customVariable','Variable','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','%s/channels/voice/agents/%d/tickets/%d/display.json','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','Authorization'];(function(_0x4ee554,_0x1d50a0){var _0x13a073=function(_0x186a40){while(--_0x186a40){_0x4ee554['push'](_0x4ee554['shift']());}};_0x13a073(++_0x1d50a0);}(_0x64fc,0x75));var _0xc64f=function(_0x1b5aea,_0x3f04b7){_0x1b5aea=_0x1b5aea-0x0;var _0x15cfc6=_0x64fc[_0x1b5aea];return _0x15cfc6;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0xc64f('0x0'));var util=require(_0xc64f('0x1'));var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0xc64f('0x2'));var logger=require('../../../../config/logger')(_0xc64f('0x3'));config[_0xc64f('0x4')]=_['defaults'](config[_0xc64f('0x4')],{'host':_0xc64f('0x5'),'port':0x18eb});var io=require(_0xc64f('0x6'))(new Redis(config[_0xc64f('0x4')]));function emit(_0x1f1438,_0x1d4321,_0x257e96){io['to'](_0x1f1438)[_0xc64f('0x7')](_0x1d4321,_0x257e96);}var headers={'Content-Type':_0xc64f('0x8'),'Accept':_0xc64f('0x8')};function getTicket(_0x1cf934,_0x1c2f03,_0x5063f8,_0x1eed0a,_0xa4b906){logger[_0xc64f('0x9')](_0xc64f('0xa'));return request({'uri':util['format'](_0xc64f('0xb'),_0x1cf934[_0xc64f('0xc')]),'method':'POST','body':{'ticket':_[_0xc64f('0xd')]({'requester_id':_0x5063f8['id'],'submitter_id':_0x1c2f03?_0x1c2f03['id']:undefined,'assignee_id':_0x1c2f03?_0x1c2f03['id']:undefined,'tags':getTags(_0x1eed0a[_0xc64f('0xe')],_0xc64f('0xf')),'subject':intUtil[_0xc64f('0x10')](_0x1eed0a[_0xc64f('0x11')],_0xa4b906,'\x20'),'description':intUtil['getString'](_0x1eed0a[_0xc64f('0x12')],_0xa4b906,'\x0a'),'comment':{'public':![],'body':intUtil[_0xc64f('0x10')](_0x1eed0a['Descriptions'],_0xa4b906,'\x0a')}},getCustomFields(_0x1eed0a[_0xc64f('0x13')],_0xa4b906))}})[_0xc64f('0x14')](function(_0x55371f){logger[_0xc64f('0x9')](_0xc64f('0x15'));return _0x55371f[_0xc64f('0x16')];});}function getUser(_0x46bf11,_0x2eba90){if(intUtil[_0xc64f('0x17')](_0x2eba90)){logger[_0xc64f('0x9')](_0xc64f('0x18'),_0x2eba90);return request({'uri':util['format'](_0xc64f('0x19'),_0x46bf11[_0xc64f('0xc')]),'qs':{'query':util[_0xc64f('0x1a')](_0xc64f('0x1b'),_0x2eba90)}})[_0xc64f('0x14')](function(_0xa7c996){if(_0xa7c996[_0xc64f('0x1c')]){logger[_0xc64f('0x9')]('Agent\x20found!');return _[_0xc64f('0x1d')](_0xa7c996[_0xc64f('0x1e')],{'email':_0x2eba90,'role':_0xc64f('0x1f')});}else{logger[_0xc64f('0x9')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0xc64f('0x20'),_0x46bf11['remoteUri'])})[_0xc64f('0x14')](function(_0x4ecc2a){logger[_0xc64f('0x9')](_0xc64f('0x21'));return _0x4ecc2a['user'];});}});}else{logger[_0xc64f('0x9')](_0xc64f('0x22'));return request({'uri':util[_0xc64f('0x1a')](_0xc64f('0x20'),_0x46bf11['remoteUri'])})[_0xc64f('0x14')](function(_0x1e5d03){logger[_0xc64f('0x9')](_0xc64f('0x21'));return _0x1e5d03[_0xc64f('0x23')];});}}function getEndUser(_0xab9fc5,_0x4357e1,_0x41fe2b){logger[_0xc64f('0x9')](_0xc64f('0x24'),_0x41fe2b);return request({'uri':util[_0xc64f('0x1a')]('%s/search.json',_0xab9fc5[_0xc64f('0xc')]),'qs':{'query':util[_0xc64f('0x1a')]('type:user\x20role:end-user\x20phone:%s',_0x41fe2b)}})[_0xc64f('0x14')](function(_0xb346c0){var _0x55f53e;if(_0xb346c0[_0xc64f('0x1e')][_0xc64f('0x25')]){_0xb346c0[_0xc64f('0x1e')]=_[_0xc64f('0x26')](_0xb346c0[_0xc64f('0x1e')],{'suspended':![],'role':_0xc64f('0x27')});if(_0xb346c0['results']['length']){_0x55f53e=_[_0xc64f('0x28')](_0xb346c0[_0xc64f('0x1e')]);}}if(_0x55f53e){logger[_0xc64f('0x9')](_0xc64f('0x29'));return _0x55f53e;}else{logger['info'](_0xc64f('0x2a'));return request({'uri':util[_0xc64f('0x1a')]('%s/users.json',_0xab9fc5['remoteUri']),'method':_0xc64f('0x2b'),'body':{'user':{'role':_0xc64f('0x27'),'name':util['format'](_0xc64f('0x2c'),_0x4357e1||_0x41fe2b),'phone':_0x41fe2b}}})[_0xc64f('0x14')](function(_0x189181){logger['info']('Enduser\x20created.');return _0x189181[_0xc64f('0x23')];});}});}function getAuth(_0xbd1ff1){var _0x2a6f6e;if(_0xbd1ff1[_0xc64f('0x2d')]==='password'){_0x2a6f6e=util[_0xc64f('0x1a')]('%s:%s',_0xbd1ff1[_0xc64f('0x2e')],_0xbd1ff1[_0xc64f('0x2f')]);}else if(_0xbd1ff1[_0xc64f('0x2d')]===_0xc64f('0x30')){_0x2a6f6e=util[_0xc64f('0x1a')](_0xc64f('0x31'),_0xbd1ff1[_0xc64f('0x2e')],_0xbd1ff1[_0xc64f('0x30')]);}return util[_0xc64f('0x1a')]('Basic\x20%s',new Buffer(_0x2a6f6e)[_0xc64f('0x32')](_0xc64f('0x33')));}function request(_0x1c4f3c){logger['debug'](_0xc64f('0x34'),JSON['stringify'](_0x1c4f3c));return rp(_['defaults'](_0x1c4f3c,{'method':_0xc64f('0x35'),'headers':headers,'json':!![]}));}function getTags(_0x3bc9f4,_0x357615){var _0x178d1c=[];if(_0x3bc9f4&&_0x3bc9f4['length']>0x0){_0x178d1c=_[_0xc64f('0x36')](_0x3bc9f4,_0x357615);}return _0x178d1c;}function getCustomFields(_0x14fcf5,_0x3d3244){var _0x3b5afb=[];var _0x4e0e96={'custom_fields':[]};if(_0x14fcf5['length']>0x0){_['forEach'](_0x14fcf5,function(_0x2cc9ef){if(_[_0xc64f('0x37')]([_0xc64f('0x38'),_0xc64f('0x39')],_0x2cc9ef[_0xc64f('0x3a')])&&_0x2cc9ef[_0xc64f('0x3b')]&&!_0x2cc9ef[_0xc64f('0x3c')]){_0x4e0e96[_0x2cc9ef[_0xc64f('0x3b')][_0xc64f('0x3d')]()]=_0x2cc9ef[_0xc64f('0x3e')]['toString']();}else if(_[_0xc64f('0x37')](['string',_0xc64f('0x39')],_0x2cc9ef[_0xc64f('0x3a')])&&_0x2cc9ef[_0xc64f('0x3f')]&&_0x2cc9ef['customField']){_0x4e0e96[_0xc64f('0x40')][_0xc64f('0x41')]({'id':_0x2cc9ef[_0xc64f('0x3f')],'value':_0x2cc9ef[_0xc64f('0x3e')][_0xc64f('0x32')]()});}else if(_0x2cc9ef['type']===_0xc64f('0x42')&&_0x2cc9ef[_0xc64f('0x43')]&&_0x2cc9ef[_0xc64f('0x3f')]&&_0x2cc9ef[_0xc64f('0x3c')]){_0x3d3244[_0x2cc9ef[_0xc64f('0x43')]]&&_0x4e0e96[_0xc64f('0x40')][_0xc64f('0x41')]({'id':_0x2cc9ef[_0xc64f('0x3f')],'value':_0x3d3244[_0x2cc9ef[_0xc64f('0x43')]]['toString']()});}else if(_0x2cc9ef[_0xc64f('0x3a')]===_0xc64f('0x44')&&_0x2cc9ef['Variable']&&_0x2cc9ef[_0xc64f('0x45')][_0xc64f('0xf')]&&_0x2cc9ef[_0xc64f('0x3f')]&&_0x2cc9ef[_0xc64f('0x3c')]){_0x3d3244[_0x2cc9ef[_0xc64f('0x45')]['name'][_0xc64f('0x3d')]()]&&_0x4e0e96[_0xc64f('0x40')]['push']({'id':_0x2cc9ef['idField'],'value':_0x3d3244[_0x2cc9ef[_0xc64f('0x45')]['name'][_0xc64f('0x3d')]()][_0xc64f('0x32')]()});}});}return _0x4e0e96;}exports['queue']=function(_0x513def,_0x2fcecf,_0x222170,_0x507973,_0x21ac1f,_0xd52759){var _0x3fae08,_0x525c0b;_0xd52759[_0xc64f('0xc')]=intUtil['stripTrailingSlash'](_0xd52759[_0xc64f('0xc')]);_0xd52759[_0xc64f('0x46')]=intUtil[_0xc64f('0x47')](_0xd52759[_0xc64f('0x46')]);if(_0x21ac1f&&_0x21ac1f[_0xc64f('0x48')]){logger[_0xc64f('0x9')](_0xc64f('0x49'),'Recording\x20is\x20enabled!');_0x2fcecf[_0xc64f('0x4a')]=util['format'](_0xc64f('0x4b'),_0xd52759['serverUrl'],_0x2fcecf['uniqueid'],md5(_0x2fcecf[_0xc64f('0x4c')]));}else{_0x2fcecf[_0xc64f('0x4a')]='';}headers['Authorization']=getAuth(_0xd52759);return getUser(_0xd52759,_0x507973[_0xc64f('0x4d')])[_0xc64f('0x14')](function(_0x300499){_0x3fae08=_0x300499;logger[_0xc64f('0x9')](_0xc64f('0x4e'),_0x3fae08['id']);return getEndUser(_0xd52759,_0x2fcecf[_0xc64f('0x4f')],_0x2fcecf[_0xc64f('0x50')]);})['then'](function(_0x57fd6c){_0x525c0b=_0x57fd6c;logger['info'](_0xc64f('0x51'),_0x525c0b['id']);return getTicket(_0xd52759,_0x3fae08,_0x525c0b,_0x222170,_0x2fcecf);})['then'](function(_0x195472){if(_0x195472){logger['info'](_0xc64f('0x52'),_0x195472['id']);switch(_0xd52759['type']){case'integrationTab':logger[_0xc64f('0x9')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0xc64f('0x1a')](_0xc64f('0x53'),_0xd52759[_0xc64f('0xc')],_0x3fae08['id'],_0x195472['id']),'method':_0xc64f('0x2b')});case'newTab':logger[_0xc64f('0x9')](_0xc64f('0x49'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xc64f('0x1a')]('user:%s',_0x507973[_0xc64f('0xf')]),_0xc64f('0x54'),{'uri':util[_0xc64f('0x1a')](_0xc64f('0x55'),_0xd52759[_0xc64f('0xc')][_0xc64f('0x56')](_0xc64f('0x57'),''),_0x195472['id'])});break;default:logger[_0xc64f('0x58')](_0xc64f('0x49'),_0xc64f('0x59'));}}})[_0xc64f('0x5a')](function(_0x3bbad6){logger[_0xc64f('0x58')](_0xc64f('0x5b'),util[_0xc64f('0x5c')](_0x3bbad6,{'showHidden':!![],'depth':null}));});};exports[_0xc64f('0x5d')]=function(_0x4a048a,_0xb303ff,_0xe6a316,_0x4a800f,_0x3e9d33,_0x3df5af,_0x1c0bb8){var _0x23b305,_0x2b0b4f;_0x3df5af['remoteUri']=intUtil[_0xc64f('0x47')](_0x3df5af[_0xc64f('0xc')]);_0x3df5af['serverUrl']=intUtil[_0xc64f('0x47')](_0x3df5af[_0xc64f('0x46')]);if(_0x1c0bb8&&_0x1c0bb8[_0xc64f('0x5e')]&&_0x1c0bb8[_0xc64f('0x5e')]!==_0xc64f('0x5f')){logger[_0xc64f('0x9')](_0xc64f('0x60'),_0xc64f('0x61'));_0xb303ff[_0xc64f('0x4a')]=util[_0xc64f('0x1a')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3df5af[_0xc64f('0x46')],_0xb303ff[_0xc64f('0x4c')],md5(_0xb303ff[_0xc64f('0x4c')]));}headers[_0xc64f('0x62')]=getAuth(_0x3df5af);return getUser(_0x3df5af,_0x4a800f[_0xc64f('0x4d')])[_0xc64f('0x14')](function(_0x5c281b){_0x23b305=_0x5c281b;logger['info']('The\x20User\x20ID\x20is:',_0x23b305['id']);return getEndUser(_0x3df5af,_0xb303ff[_0xc64f('0x63')],_0xb303ff[_0xc64f('0x64')]);})[_0xc64f('0x14')](function(_0x52e4d4){_0x2b0b4f=_0x52e4d4;logger['info'](_0xc64f('0x51'),_0x2b0b4f['id']);return getTicket(_0x3df5af,_0x23b305,_0x2b0b4f,_0xe6a316,_0xb303ff);})['then'](function(_0x5bc31f){if(_0x5bc31f){logger['info']('The\x20Ticket\x20ID\x20is:',_0x5bc31f['id']);switch(_0x3df5af['type']){case _0xc64f('0x65'):logger[_0xc64f('0x9')]('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0xc64f('0x1a')](_0xc64f('0x53'),_0x3df5af[_0xc64f('0xc')],_0x23b305['id'],_0x5bc31f['id']),'method':_0xc64f('0x2b')});case _0xc64f('0x66'):logger[_0xc64f('0x9')]('[OUTBOUND]',_0xc64f('0x67'));emit(util[_0xc64f('0x1a')](_0xc64f('0x68'),_0x4a800f['name']),_0xc64f('0x54'),{'uri':util['format'](_0xc64f('0x55'),_0x3df5af['remoteUri'][_0xc64f('0x56')]('/api/v2',''),_0x5bc31f['id'])});break;default:logger[_0xc64f('0x58')](_0xc64f('0x60'),_0xc64f('0x59'));}}})[_0xc64f('0x5a')](function(_0x4da17b){logger['error']('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util[_0xc64f('0x5c')](_0x4da17b,{'showHidden':!![],'depth':null}));});};exports[_0xc64f('0x69')]=function(_0x135e98,_0xe08f18,_0x1f57dc,_0x454a91,_0x1e4568,_0x231cba){var _0x5d4079,_0x105855;_0x231cba[_0xc64f('0xc')]=intUtil[_0xc64f('0x47')](_0x231cba[_0xc64f('0xc')]);_0x231cba[_0xc64f('0x46')]=intUtil[_0xc64f('0x47')](_0x231cba[_0xc64f('0x46')]);if(_0x1e4568&&_0x1e4568[_0xc64f('0x48')]){logger[_0xc64f('0x9')]('['+_0xe08f18['lastevent']['toUpperCase']()+']',_0xc64f('0x61'));_0xe08f18[_0xc64f('0x4a')]=util['format'](_0xc64f('0x4b'),_0x231cba[_0xc64f('0x46')],_0xe08f18['uniqueid'],md5(_0xe08f18[_0xc64f('0x4c')]));}else{_0xe08f18['recordingURL']='';}headers[_0xc64f('0x62')]=getAuth(_0x231cba);return getUser(_0x231cba)[_0xc64f('0x14')](function(_0x14aa3){_0x5d4079=_0x14aa3;logger[_0xc64f('0x9')]('The\x20User\x20ID\x20is:',_0x5d4079['id']);return getEndUser(_0x231cba,_0xe08f18['calleridname'],_0xe08f18[_0xc64f('0x50')]);})[_0xc64f('0x14')](function(_0x418797){_0x105855=_0x418797;logger['info'](_0xc64f('0x51'),_0x105855['id']);return getTicket(_0x231cba,_0x5d4079,_0x105855,_0x1f57dc,_0xe08f18);})['then'](function(_0x2c0870){if(_0x2c0870){logger[_0xc64f('0x9')](_0xc64f('0x52'),_0x2c0870['id']);}})[_0xc64f('0x5a')](function(_0x397394){logger[_0xc64f('0x58')]('['+_0xe08f18[_0xc64f('0x6a')][_0xc64f('0x6b')]()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util[_0xc64f('0x5c')](_0x397394,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x57b0=['The\x20User\x20ID\x20is:','calleridname','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','replace','Zendesk\x20account\x20type\x20not\x20recognized','catch','error','inspect','outbound','recordingFormat','none','[OUTBOUND]','recordingURL','email','destcalleridname','destcalleridnum','trigger:browser:url','%s/agent/tickets/%s','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','lastevent','toUpperCase','calleridnum','\x20Error\x20running\x20Zendesk\x20integration','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','localhost','socket.io-emitter','emit','application/json','Creating\x20new\x20ticket...','format','POST','Tags','name','getString','Subjects','Descriptions','Fields','then','info','Ticket\x20created!','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','remoteUri','type:user\x20role:agent\x20email:%s','Agent\x20found!','find','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','length','results','filter','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','user','authType','password','username','token','%s/token:%s','Basic\x20%s','base64','debug','defaults','GET','map','forEach','string','picklist','customField','nameField','toLowerCase','content','toString','includes','type','custom_fields','push','idField','variable','variableName','customVariable','Variable','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','uniqueid','Authorization'];(function(_0x1e8520,_0x535abc){var _0x1f39bf=function(_0x5d1e4d){while(--_0x5d1e4d){_0x1e8520['push'](_0x1e8520['shift']());}};_0x1f39bf(++_0x535abc);}(_0x57b0,0xfd));var _0x057b=function(_0x63a9ba,_0x126def){_0x63a9ba=_0x63a9ba-0x0;var _0x5f2285=_0x57b0[_0x63a9ba];return _0x5f2285;};'use strict';var _=require('lodash');var rp=require(_0x057b('0x0'));var md5=require('md5');var util=require(_0x057b('0x1'));var Redis=require(_0x057b('0x2'));var intUtil=require(_0x057b('0x3'));var config=require(_0x057b('0x4'));var logger=require(_0x057b('0x5'))(_0x057b('0x6'));config[_0x057b('0x7')]=_['defaults'](config[_0x057b('0x7')],{'host':_0x057b('0x8'),'port':0x18eb});var io=require(_0x057b('0x9'))(new Redis(config[_0x057b('0x7')]));function emit(_0xf79d56,_0x3bbfee,_0x338dd6){io['to'](_0xf79d56)[_0x057b('0xa')](_0x3bbfee,_0x338dd6);}var headers={'Content-Type':_0x057b('0xb'),'Accept':'application/json'};function getTicket(_0x11e663,_0x5bc77f,_0x38ff12,_0x2efe15,_0x3d4352){logger['info'](_0x057b('0xc'));return request({'uri':util[_0x057b('0xd')]('%s/tickets.json',_0x11e663['remoteUri']),'method':_0x057b('0xe'),'body':{'ticket':_['merge']({'requester_id':_0x38ff12['id'],'submitter_id':_0x5bc77f?_0x5bc77f['id']:undefined,'assignee_id':_0x5bc77f?_0x5bc77f['id']:undefined,'tags':getTags(_0x2efe15[_0x057b('0xf')],_0x057b('0x10')),'subject':intUtil[_0x057b('0x11')](_0x2efe15[_0x057b('0x12')],_0x3d4352,'\x20'),'description':intUtil[_0x057b('0x11')](_0x2efe15[_0x057b('0x13')],_0x3d4352,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x2efe15[_0x057b('0x13')],_0x3d4352,'\x0a')}},getCustomFields(_0x2efe15[_0x057b('0x14')],_0x3d4352))}})[_0x057b('0x15')](function(_0x4242bf){logger[_0x057b('0x16')](_0x057b('0x17'));return _0x4242bf['ticket'];});}function getUser(_0x315db5,_0x1f4de7){if(intUtil[_0x057b('0x18')](_0x1f4de7)){logger[_0x057b('0x16')](_0x057b('0x19'),_0x1f4de7);return request({'uri':util[_0x057b('0xd')](_0x057b('0x1a'),_0x315db5[_0x057b('0x1b')]),'qs':{'query':util[_0x057b('0xd')](_0x057b('0x1c'),_0x1f4de7)}})[_0x057b('0x15')](function(_0x2afa2f){if(_0x2afa2f['count']){logger[_0x057b('0x16')](_0x057b('0x1d'));return _[_0x057b('0x1e')](_0x2afa2f['results'],{'email':_0x1f4de7,'role':'agent'});}else{logger[_0x057b('0x16')](_0x057b('0x1f'));return request({'uri':util[_0x057b('0xd')](_0x057b('0x20'),_0x315db5[_0x057b('0x1b')])})[_0x057b('0x15')](function(_0x21656d){logger['info']('Admin\x20account\x20selected.');return _0x21656d['user'];});}});}else{logger[_0x057b('0x16')](_0x057b('0x1f'));return request({'uri':util['format'](_0x057b('0x20'),_0x315db5[_0x057b('0x1b')])})[_0x057b('0x15')](function(_0x5e0ed4){logger[_0x057b('0x16')](_0x057b('0x21'));return _0x5e0ed4['user'];});}}function getEndUser(_0x1a7691,_0x16ad6e,_0x23ceb3){logger['info'](_0x057b('0x22'),_0x23ceb3);return request({'uri':util[_0x057b('0xd')](_0x057b('0x1a'),_0x1a7691[_0x057b('0x1b')]),'qs':{'query':util[_0x057b('0xd')](_0x057b('0x23'),_0x23ceb3)}})[_0x057b('0x15')](function(_0xea46b3){var _0x1c4a3e;if(_0xea46b3['results'][_0x057b('0x24')]){_0xea46b3[_0x057b('0x25')]=_[_0x057b('0x26')](_0xea46b3[_0x057b('0x25')],{'suspended':![],'role':_0x057b('0x27')});if(_0xea46b3[_0x057b('0x25')][_0x057b('0x24')]){_0x1c4a3e=_[_0x057b('0x28')](_0xea46b3[_0x057b('0x25')]);}}if(_0x1c4a3e){logger[_0x057b('0x16')](_0x057b('0x29'));return _0x1c4a3e;}else{logger[_0x057b('0x16')](_0x057b('0x2a'));return request({'uri':util[_0x057b('0xd')](_0x057b('0x2b'),_0x1a7691['remoteUri']),'method':_0x057b('0xe'),'body':{'user':{'role':'end-user','name':util[_0x057b('0xd')](_0x057b('0x2c'),_0x16ad6e||_0x23ceb3),'phone':_0x23ceb3}}})[_0x057b('0x15')](function(_0x432422){logger[_0x057b('0x16')](_0x057b('0x2d'));return _0x432422[_0x057b('0x2e')];});}});}function getAuth(_0x25c01b){var _0x4a24d2;if(_0x25c01b[_0x057b('0x2f')]===_0x057b('0x30')){_0x4a24d2=util[_0x057b('0xd')]('%s:%s',_0x25c01b[_0x057b('0x31')],_0x25c01b[_0x057b('0x30')]);}else if(_0x25c01b[_0x057b('0x2f')]===_0x057b('0x32')){_0x4a24d2=util['format'](_0x057b('0x33'),_0x25c01b[_0x057b('0x31')],_0x25c01b[_0x057b('0x32')]);}return util[_0x057b('0xd')](_0x057b('0x34'),new Buffer(_0x4a24d2)['toString'](_0x057b('0x35')));}function request(_0x2076d7){logger[_0x057b('0x36')]('[HTTP]',JSON['stringify'](_0x2076d7));return rp(_[_0x057b('0x37')](_0x2076d7,{'method':_0x057b('0x38'),'headers':headers,'json':!![]}));}function getTags(_0x5cdbff,_0x478c5f){var _0x252e1f=[];if(_0x5cdbff&&_0x5cdbff[_0x057b('0x24')]>0x0){_0x252e1f=_[_0x057b('0x39')](_0x5cdbff,_0x478c5f);}return _0x252e1f;}function getCustomFields(_0x1fb929,_0x5ded4b){var _0x3e557f=[];var _0x4640ee={'custom_fields':[]};if(_0x1fb929['length']>0x0){_[_0x057b('0x3a')](_0x1fb929,function(_0x1a2da1){if(_['includes']([_0x057b('0x3b'),_0x057b('0x3c')],_0x1a2da1['type'])&&_0x1a2da1['nameField']&&!_0x1a2da1[_0x057b('0x3d')]){_0x4640ee[_0x1a2da1[_0x057b('0x3e')][_0x057b('0x3f')]()]=_0x1a2da1[_0x057b('0x40')][_0x057b('0x41')]();}else if(_[_0x057b('0x42')](['string',_0x057b('0x3c')],_0x1a2da1[_0x057b('0x43')])&&_0x1a2da1['idField']&&_0x1a2da1[_0x057b('0x3d')]){_0x4640ee[_0x057b('0x44')][_0x057b('0x45')]({'id':_0x1a2da1[_0x057b('0x46')],'value':_0x1a2da1['content'][_0x057b('0x41')]()});}else if(_0x1a2da1[_0x057b('0x43')]===_0x057b('0x47')&&_0x1a2da1[_0x057b('0x48')]&&_0x1a2da1[_0x057b('0x46')]&&_0x1a2da1[_0x057b('0x3d')]){_0x5ded4b[_0x1a2da1['variableName']]&&_0x4640ee[_0x057b('0x44')][_0x057b('0x45')]({'id':_0x1a2da1['idField'],'value':_0x5ded4b[_0x1a2da1[_0x057b('0x48')]][_0x057b('0x41')]()});}else if(_0x1a2da1['type']===_0x057b('0x49')&&_0x1a2da1[_0x057b('0x4a')]&&_0x1a2da1['Variable']['name']&&_0x1a2da1[_0x057b('0x46')]&&_0x1a2da1[_0x057b('0x3d')]){_0x5ded4b[_0x1a2da1[_0x057b('0x4a')][_0x057b('0x10')][_0x057b('0x3f')]()]&&_0x4640ee[_0x057b('0x44')][_0x057b('0x45')]({'id':_0x1a2da1[_0x057b('0x46')],'value':_0x5ded4b[_0x1a2da1[_0x057b('0x4a')][_0x057b('0x10')][_0x057b('0x3f')]()][_0x057b('0x41')]()});}});}return _0x4640ee;}exports[_0x057b('0x4b')]=function(_0x3236e5,_0x69801,_0x4b7cc2,_0x2aac75,_0x382922,_0x574f2c){var _0x47db27,_0x243597;_0x574f2c['remoteUri']=intUtil['stripTrailingSlash'](_0x574f2c[_0x057b('0x1b')]);_0x574f2c[_0x057b('0x4c')]=intUtil[_0x057b('0x4d')](_0x574f2c[_0x057b('0x4c')]);if(_0x382922&&_0x382922[_0x057b('0x4e')]){logger[_0x057b('0x16')](_0x057b('0x4f'),_0x057b('0x50'));_0x69801['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x574f2c[_0x057b('0x4c')],_0x69801[_0x057b('0x51')],md5(_0x69801['uniqueid']));}else{_0x69801['recordingURL']='';}headers[_0x057b('0x52')]=getAuth(_0x574f2c);return getUser(_0x574f2c,_0x2aac75['email'])[_0x057b('0x15')](function(_0xcada77){_0x47db27=_0xcada77;logger[_0x057b('0x16')](_0x057b('0x53'),_0x47db27['id']);return getEndUser(_0x574f2c,_0x69801[_0x057b('0x54')],_0x69801['calleridnum']);})[_0x057b('0x15')](function(_0x3ebf06){_0x243597=_0x3ebf06;logger[_0x057b('0x16')]('The\x20Enduser\x20ID\x20is:',_0x243597['id']);return getTicket(_0x574f2c,_0x47db27,_0x243597,_0x4b7cc2,_0x69801);})[_0x057b('0x15')](function(_0x2713bb){if(_0x2713bb){logger[_0x057b('0x16')](_0x057b('0x55'),_0x2713bb['id']);switch(_0x574f2c['type']){case _0x057b('0x56'):logger[_0x057b('0x16')](_0x057b('0x4f'),_0x057b('0x57'));return request({'uri':util['format'](_0x057b('0x58'),_0x574f2c[_0x057b('0x1b')],_0x47db27['id'],_0x2713bb['id']),'method':_0x057b('0xe')});case _0x057b('0x59'):logger[_0x057b('0x16')]('[QUEUE]',_0x057b('0x5a'));emit(util[_0x057b('0xd')](_0x057b('0x5b'),_0x2aac75[_0x057b('0x10')]),'trigger:browser:url',{'uri':util[_0x057b('0xd')]('%s/agent/tickets/%s',_0x574f2c[_0x057b('0x1b')][_0x057b('0x5c')]('/api/v2',''),_0x2713bb['id'])});break;default:logger['error']('[QUEUE]',_0x057b('0x5d'));}}})[_0x057b('0x5e')](function(_0x18e933){logger[_0x057b('0x5f')]('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util[_0x057b('0x60')](_0x18e933,{'showHidden':!![],'depth':null}));});};exports[_0x057b('0x61')]=function(_0x276b67,_0x4f2f12,_0x2b70da,_0x7f15bf,_0x30c3e2,_0x5ea794,_0x374c51){var _0x503846,_0x4f1c5e;_0x5ea794[_0x057b('0x1b')]=intUtil[_0x057b('0x4d')](_0x5ea794[_0x057b('0x1b')]);_0x5ea794[_0x057b('0x4c')]=intUtil[_0x057b('0x4d')](_0x5ea794['serverUrl']);if(_0x374c51&&_0x374c51[_0x057b('0x62')]&&_0x374c51[_0x057b('0x62')]!==_0x057b('0x63')){logger[_0x057b('0x16')](_0x057b('0x64'),'Recording\x20is\x20enabled!');_0x4f2f12[_0x057b('0x65')]=util[_0x057b('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5ea794['serverUrl'],_0x4f2f12['uniqueid'],md5(_0x4f2f12[_0x057b('0x51')]));}headers[_0x057b('0x52')]=getAuth(_0x5ea794);return getUser(_0x5ea794,_0x7f15bf[_0x057b('0x66')])[_0x057b('0x15')](function(_0x377e95){_0x503846=_0x377e95;logger[_0x057b('0x16')](_0x057b('0x53'),_0x503846['id']);return getEndUser(_0x5ea794,_0x4f2f12[_0x057b('0x67')],_0x4f2f12[_0x057b('0x68')]);})[_0x057b('0x15')](function(_0x420f6d){_0x4f1c5e=_0x420f6d;logger[_0x057b('0x16')]('The\x20Enduser\x20ID\x20is:',_0x4f1c5e['id']);return getTicket(_0x5ea794,_0x503846,_0x4f1c5e,_0x2b70da,_0x4f2f12);})[_0x057b('0x15')](function(_0x588755){if(_0x588755){logger['info'](_0x057b('0x55'),_0x588755['id']);switch(_0x5ea794[_0x057b('0x43')]){case _0x057b('0x56'):logger[_0x057b('0x16')](_0x057b('0x64'),_0x057b('0x57'));return request({'uri':util[_0x057b('0xd')](_0x057b('0x58'),_0x5ea794[_0x057b('0x1b')],_0x503846['id'],_0x588755['id']),'method':'POST'});case'newTab':logger[_0x057b('0x16')](_0x057b('0x64'),_0x057b('0x5a'));emit(util[_0x057b('0xd')]('user:%s',_0x7f15bf[_0x057b('0x10')]),_0x057b('0x69'),{'uri':util[_0x057b('0xd')](_0x057b('0x6a'),_0x5ea794['remoteUri'][_0x057b('0x5c')]('/api/v2',''),_0x588755['id'])});break;default:logger[_0x057b('0x5f')](_0x057b('0x64'),_0x057b('0x5d'));}}})[_0x057b('0x5e')](function(_0x1acc65){logger[_0x057b('0x5f')](_0x057b('0x6b'),util['inspect'](_0x1acc65,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x2ad639,_0x4057f0,_0x47f660,_0x196583,_0x3667c5,_0x8b44a6){var _0x1f369f,_0x55a683;_0x8b44a6[_0x057b('0x1b')]=intUtil[_0x057b('0x4d')](_0x8b44a6['remoteUri']);_0x8b44a6['serverUrl']=intUtil[_0x057b('0x4d')](_0x8b44a6[_0x057b('0x4c')]);if(_0x3667c5&&_0x3667c5[_0x057b('0x4e')]){logger['info']('['+_0x4057f0[_0x057b('0x6c')][_0x057b('0x6d')]()+']','Recording\x20is\x20enabled!');_0x4057f0['recordingURL']=util[_0x057b('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x8b44a6['serverUrl'],_0x4057f0[_0x057b('0x51')],md5(_0x4057f0[_0x057b('0x51')]));}else{_0x4057f0[_0x057b('0x65')]='';}headers[_0x057b('0x52')]=getAuth(_0x8b44a6);return getUser(_0x8b44a6)[_0x057b('0x15')](function(_0x5c5fad){_0x1f369f=_0x5c5fad;logger[_0x057b('0x16')](_0x057b('0x53'),_0x1f369f['id']);return getEndUser(_0x8b44a6,_0x4057f0[_0x057b('0x54')],_0x4057f0[_0x057b('0x6e')]);})['then'](function(_0x331b1e){_0x55a683=_0x331b1e;logger[_0x057b('0x16')]('The\x20Enduser\x20ID\x20is:',_0x55a683['id']);return getTicket(_0x8b44a6,_0x1f369f,_0x55a683,_0x47f660,_0x4057f0);})[_0x057b('0x15')](function(_0x368b20){if(_0x368b20){logger['info']('The\x20Ticket\x20ID\x20is:',_0x368b20['id']);}})['catch'](function(_0x3d7439){logger[_0x057b('0x5f')]('['+_0x4057f0[_0x057b('0x6c')][_0x057b('0x6d')]()+']'+_0x057b('0x6f'),util[_0x057b('0x60')](_0x3d7439,{'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 b34df48..b3699a1 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 _0x84fe=['Who_Id','First_Name','Last_Name','Full_Name','$se_module','utc','talktime','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','mm:ss','lastevent','called','Call_Result','Called','complete','connect','Answered','rejected','Abandoned','timeout','Timeout','Call_Start_Time','agentcalledAt','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','Call\x20created!','err','log','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','user:%s','trigger:browser:url','/crm/EntityInfo.do?module=Calls&id=','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Outbound','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','https://crm.','toUpperCase','lodash','request-promise','md5','util','./util','bluebird','../../../../config/environment','../../../../config/logger','redis','defaults','socket.io-emitter','debug','[HTTP]','stringify','length','forEach','string','picklist','type','toString','variable','variableName','customVariable','Variable','name','toLowerCase','idField','indexOf','split','isNil','expires_in','access_token','zone','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.in','POST','/oauth/v2/token','clientSecret','refresh_token','then','add','catch','error','stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','findIndex','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','user','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','The\x20failing\x20result\x20is','enduserType','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','data','code','SUCCESS','details','Error:\x20','CREATE\x20ERROR','moduleSearch','contact_lead','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','uri','Leads','nothing','contact','lead','/crm/v2/Leads/search?criteria=((Phone:equals:','Creating\x20new\x20call...','Owner','administrator','Subject','getString','Description'];(function(_0x2a74a5,_0x25d5e5){var _0x7de9ae=function(_0x46091f){while(--_0x46091f){_0x2a74a5['push'](_0x2a74a5['shift']());}};_0x7de9ae(++_0x25d5e5);}(_0x84fe,0xdb));var _0xe84f=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x84fe[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xe84f('0x0'));var rp=require(_0xe84f('0x1'));var md5=require(_0xe84f('0x2'));var util=require(_0xe84f('0x3'));var intUtil=require(_0xe84f('0x4'));var moment=require('moment');var Redis=require('ioredis');var BPromise=require(_0xe84f('0x5'));var config=require(_0xe84f('0x6'));var logger=require(_0xe84f('0x7'))('zoho');config[_0xe84f('0x8')]=_[_0xe84f('0x9')](config[_0xe84f('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xe84f('0xa'))(new Redis(config[_0xe84f('0x8')]));function emit(_0x5f399c,_0x4053e4,_0x5b8e90){io['to'](_0x5f399c)['emit'](_0x4053e4,_0x5b8e90);}function request(_0x4c1a36){logger[_0xe84f('0xb')](_0xe84f('0xc'),JSON[_0xe84f('0xd')](_0x4c1a36));return rp(_0x4c1a36);}function getCustomFields(_0x4bb110,_0xc390e6){var _0x2fdc6d={};if(_0x4bb110[_0xe84f('0xe')]>0x0){_[_0xe84f('0xf')](_0x4bb110,function(_0x120a5c){if(_['includes']([_0xe84f('0x10'),_0xe84f('0x11')],_0x120a5c[_0xe84f('0x12')])&&_0x120a5c['idField']){_0x2fdc6d[_0x120a5c['idField']]=_0x120a5c['content'][_0xe84f('0x13')]();}else if(_0x120a5c[_0xe84f('0x12')]===_0xe84f('0x14')&&_0x120a5c[_0xe84f('0x15')]&&_0x120a5c['idField']&&_0xc390e6[_0x120a5c['variableName']]){_0x2fdc6d[_0x120a5c['idField']]=_0xc390e6[_0x120a5c[_0xe84f('0x15')]][_0xe84f('0x13')]();}else if(_0x120a5c[_0xe84f('0x12')]===_0xe84f('0x16')&&_0x120a5c[_0xe84f('0x17')]&&_0x120a5c[_0xe84f('0x17')][_0xe84f('0x18')]&&_0x120a5c['idField']&&_0xc390e6[_0x120a5c[_0xe84f('0x17')][_0xe84f('0x18')][_0xe84f('0x19')]()]){_0x2fdc6d[_0x120a5c[_0xe84f('0x1a')]]=_0xc390e6[_0x120a5c[_0xe84f('0x17')][_0xe84f('0x18')][_0xe84f('0x19')]()]['toString']();}});}return _0x2fdc6d;}function getName(_0x118a9f){if(_0x118a9f[_0xe84f('0x1b')]('\x20')>0x0){var _0x1e11b0=_0x118a9f[_0xe84f('0x1c')](/ (.+)/);if(_0x1e11b0[0x1]){return _0x1e11b0;}}return[_0x118a9f,_0x118a9f];}var accountsTokens={};function getAccessToken(_0x1d9520){return new Promise(function(_0x224a2e,_0x2dca20){if(!_[_0xe84f('0x1d')](accountsTokens[_0x1d9520['id']])&&!_[_0xe84f('0x1d')](accountsTokens[_0x1d9520['id']]['access_token'])){if(moment()['isBefore'](accountsTokens[_0x1d9520['id']][_0xe84f('0x1e')])){_0x224a2e(accountsTokens[_0x1d9520['id']][_0xe84f('0x1f')]);}}var _0x2c304d;switch(_0x1d9520[_0xe84f('0x20')]){case'US':_0x2c304d=_0xe84f('0x21');break;case'AU':_0x2c304d='https://accounts.zoho.com.au';break;case'EU':_0x2c304d=_0xe84f('0x22');break;case'IN':_0x2c304d=_0xe84f('0x23');break;case'CN':_0x2c304d='https://accounts.zoho.com.cn';break;default:_0x2c304d=_0xe84f('0x22');break;}var _0x1a9686={'method':_0xe84f('0x24'),'uri':_0x2c304d+_0xe84f('0x25'),'qs':{'refresh_token':_0x1d9520['refreshToken'],'client_id':_0x1d9520['clientId'],'client_secret':_0x1d9520[_0xe84f('0x26')],'grant_type':_0xe84f('0x27')},'json':!![]};return rp(_0x1a9686)[_0xe84f('0x28')](function(_0x230422){accountsTokens[_0x1d9520['id']]={'access_token':_0x230422[_0xe84f('0x1f')],'expires_in':moment()[_0xe84f('0x29')](_0x230422[_0xe84f('0x1e')],'seconds')};_0x224a2e(_0x230422[_0xe84f('0x1f')]);})[_0xe84f('0x2a')](function(_0x1ac540){logger[_0xe84f('0x2b')]('Failing\x20creating\x20the\x20access_token',_0x1ac540[_0xe84f('0x2c')]);_0x2dca20(_0x1ac540);});});}function getUser(_0x8119ce,_0x34998f,_0x4d0aaf,_0x4742bb){logger[_0xe84f('0x2d')](_0xe84f('0x2e'));return request({'method':_0xe84f('0x2f'),'uri':util[_0xe84f('0x30')](_0xe84f('0x31'),_0x34998f),'qs':{'type':_0xe84f('0x32')},'headers':{'Authorization':_0xe84f('0x33')+_0x8119ce},'json':!![]})[_0xe84f('0x28')](function(_0xc024bb){if(_0xc024bb[_0xe84f('0x34')]){var _0x5b56a6=-0x1;if(_['isArrayLikeObject'](_0xc024bb[_0xe84f('0x34')])){if(!_[_0xe84f('0x1d')](_0x4742bb)){_0x5b56a6=_[_0xe84f('0x35')](_0xc024bb['users'],function(_0x3047b7){return _0x3047b7['email']===_0x4742bb;});}if(_0x5b56a6>=0x0){logger[_0xe84f('0x2d')](_0xe84f('0x36'));}else{logger[_0xe84f('0x2d')](_0xe84f('0x37'));_0x5b56a6=_['findIndex'](_0xc024bb['users'],function(_0xdc92d){return _0xdc92d[_0xe84f('0x38')]['name']===_0xe84f('0x39');});}return _0xc024bb[_0xe84f('0x34')][_0x5b56a6];}else{if(_0xc024bb[_0xe84f('0x3a')]['profile'][_0xe84f('0x18')]===_0xe84f('0x39')){logger[_0xe84f('0x2d')](_0xe84f('0x37'));user=_0xc024bb[_0xe84f('0x3a')];return user;}else{logger['error']('The\x20failing\x20result\x20is',JSON[_0xe84f('0xd')](_0xc024bb));throw new Error(_0xe84f('0x3b')+JSON['stringify'](_0xc024bb));}}}else{logger['error'](_0xe84f('0x3c'),JSON[_0xe84f('0xd')](_0xc024bb));throw new Error(_0xe84f('0x3b')+JSON[_0xe84f('0xd')](_0xc024bb));}})[_0xe84f('0x2a')](function(_0x208120){console[_0xe84f('0x2b')](_0x208120);});}function getZohoUser(_0x582764,_0x96f966){return new BPromise(function(_0x5c6c21,_0x1a755d){request(_0x582764)[_0xe84f('0x28')](function(_0x5b7fe0){var _0x3ed3e3=null;if(_0x5b7fe0){_0x3ed3e3=_0x5b7fe0['data'][0x0];_0x3ed3e3[_0xe84f('0x3d')]=_0x96f966;}_0x5c6c21(_0x3ed3e3);})[_0xe84f('0x2a')](function(_0x392b0c){_0x1a755d(_0x392b0c);});});}function createEndUser(_0x336f2b,_0x30a444,_0x2c5438,_0x1b59ec,_0x17c0f6,_0x147582){var _0x2c5438=getName(_0x2c5438);return request({'method':_0xe84f('0x24'),'uri':_0xe84f('0x3e')+_0x30a444+_0xe84f('0x3f')+_[_0xe84f('0x40')](_0x147582[_0xe84f('0x41')])+'s','body':{'data':[{'Last_Name':_0x2c5438[0x1],'First_Name':_0x2c5438[0x0],'Phone':_0x1b59ec,'Owner':{'name':!_[_0xe84f('0x1d')](_0x17c0f6[_0xe84f('0x42')]['name'])?_0x17c0f6[_0xe84f('0x42')][_0xe84f('0x18')]:!_['isNil'](_0x17c0f6[_0xe84f('0x43')])?_0x17c0f6[_0xe84f('0x43')]+'\x20'+_0x17c0f6[_0xe84f('0x44')]:_0x17c0f6['last_name'],'id':_0x17c0f6['id']}}]},'headers':{'Authorization':_0xe84f('0x33')+_0x336f2b},'json':!![]})[_0xe84f('0x28')](function(_0x19c03c){if(_0x19c03c&&_0x19c03c[_0xe84f('0x45')][0x0][_0xe84f('0x46')]===_0xe84f('0x47')){var _0x528346=_0x19c03c[_0xe84f('0x45')][0x0][_0xe84f('0x48')];_0x528346[_0xe84f('0x3d')]=_[_0xe84f('0x40')](_0x147582[_0xe84f('0x41')])+'s';return _0x528346;}logger['error'](_0xe84f('0x3c'),JSON[_0xe84f('0xd')](data));throw new Error(_0xe84f('0x49')+JSON['stringify'](data));})[_0xe84f('0x2a')](function(_0x4117e6){console['log'](_0xe84f('0x4a'),_0x4117e6);});}function getEndUser(_0x32e46c,_0x3d17c2,_0x21d0f3,_0x3b752f,_0x4cc5,_0x5e5316,_0x3820f8){var _0x505cb6={'method':_0xe84f('0x2f'),'uri':'','headers':{'Authorization':_0xe84f('0x33')+_0x32e46c},'json':!![]};switch(_0x3820f8[_0xe84f('0x4b')]){case _0xe84f('0x4c'):_0x505cb6['uri']=_0xe84f('0x3e')+_0x3d17c2+_0xe84f('0x4d')+_0x4cc5+'))';return getZohoUser(_0x505cb6,_0xe84f('0x4e'))['then'](function(_0x1dcf50){if(_0x1dcf50)return _0x1dcf50;_0x505cb6[_0xe84f('0x4f')]=_0xe84f('0x3e')+_0x3d17c2+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x4cc5+'))';return getZohoUser(_0x505cb6,_0xe84f('0x50'))['then'](function(_0x3b6369){if(_0x3b6369)return _0x3b6369;if(_0x3820f8[_0xe84f('0x41')]!=_0xe84f('0x51')){return createEndUser(_0x32e46c,_0x3d17c2,_0x3b752f,_0x4cc5,_0x5e5316,_0x3820f8);}else{return{};}});});break;case _0xe84f('0x52'):_0x505cb6[_0xe84f('0x4f')]='https://www.zohoapis.'+_0x3d17c2+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x4cc5+'))';return getZohoUser(_0x505cb6,'Contacts')[_0xe84f('0x28')](function(_0x31cf0c){if(_0x31cf0c)return _0x31cf0c;if(_0x3820f8[_0xe84f('0x41')]!=_0xe84f('0x51')){return createEndUser(_0x32e46c,_0x3d17c2,_0x3b752f,_0x4cc5,_0x5e5316,_0x3820f8);}else{return{};}});break;case _0xe84f('0x53'):_0x505cb6['uri']='https://www.zohoapis.'+_0x3d17c2+_0xe84f('0x54')+_0x4cc5+'))';return getZohoUser(_0x505cb6,_0xe84f('0x50'))[_0xe84f('0x28')](function(_0x48a28f){if(_0x48a28f)return _0x48a28f;if(_0x3820f8[_0xe84f('0x41')]!=_0xe84f('0x51')){return createEndUser(_0x32e46c,_0x3d17c2,_0x3b752f,_0x4cc5,_0x5e5316,_0x3820f8);}else{return{};}});break;}}function getCall(_0x4c8917,_0x23f332,_0x493509,_0x5b1eb9,_0x34d53e,_0x330aa4,_0x5a829e,_0x2297a5){logger[_0xe84f('0x2d')](_0xe84f('0x55'));var _0x3a421e={};_0x3a421e[_0xe84f('0x56')]={'name':!_[_0xe84f('0x1d')](_0x5b1eb9['role'][_0xe84f('0x18')])&&!_[_0xe84f('0x1d')](_0x5b1eb9[_0xe84f('0x38')][_0xe84f('0x18')])&&_0x5b1eb9[_0xe84f('0x38')]['name']===_0xe84f('0x57')?_0x5b1eb9[_0xe84f('0x42')]['name']:!_[_0xe84f('0x1d')](_0x5b1eb9[_0xe84f('0x43')])?_0x5b1eb9[_0xe84f('0x43')]+'\x20'+_0x5b1eb9['last_name']:_0x5b1eb9[_0xe84f('0x44')],'id':_0x5b1eb9['id']};_0x3a421e[_0xe84f('0x58')]=intUtil[_0xe84f('0x59')](_0x330aa4['Subjects'],_0x5a829e,'\x20');_0x3a421e[_0xe84f('0x5a')]=intUtil[_0xe84f('0x59')](_0x330aa4['Descriptions'],_0x5a829e,'\x0a');if(_0x34d53e['enduserType']===_0xe84f('0x4e')){_0x3a421e[_0xe84f('0x5b')]={'name':!_[_0xe84f('0x1d')](_0x34d53e['Full_Name'])?_0x34d53e['Full_Name']:!_['isNil'](_0x34d53e[_0xe84f('0x5c')])?_0x34d53e[_0xe84f('0x5c')]+'\x20'+_0x34d53e['Last_Name']:_0x34d53e[_0xe84f('0x5d')],'id':_0x34d53e['id']};}if(_0x34d53e[_0xe84f('0x3d')]===_0xe84f('0x50')){_0x3a421e['What_Id']={'name':!_['isNil'](_0x34d53e[_0xe84f('0x5e')])?_0x34d53e[_0xe84f('0x5e')]:!_[_0xe84f('0x1d')](_0x34d53e[_0xe84f('0x5c')])?_0x34d53e[_0xe84f('0x5c')]+'\x20'+_0x34d53e['Last_Name']:_0x34d53e[_0xe84f('0x5d')],'id':_0x34d53e['id']};_0x3a421e[_0xe84f('0x5f')]=_[_0xe84f('0x40')](_0x34d53e[_0xe84f('0x3d')]);}if(_0x5a829e['talktime']){_0x3a421e['Call_Duration']=moment[_0xe84f('0x60')](parseInt(_0x5a829e[_0xe84f('0x61')])*0x3e8)['format']('mm:ss');}else if(_0x5a829e['answertime']&&_0x5a829e[_0xe84f('0x62')]){_0x3a421e['Call_Duration']=moment[_0xe84f('0x60')](moment(_0x5a829e[_0xe84f('0x62')],_0xe84f('0x63'))[_0xe84f('0x64')](moment(_0x5a829e[_0xe84f('0x65')],_0xe84f('0x63'))))[_0xe84f('0x30')](_0xe84f('0x66'));}switch(_0x5a829e[_0xe84f('0x67')]){case _0xe84f('0x68'):_0x3a421e[_0xe84f('0x69')]=_0xe84f('0x6a');break;case _0xe84f('0x6b'):case _0xe84f('0x6c'):_0x3a421e['Call_Result']=_0xe84f('0x6d');break;case _0xe84f('0x6e'):_0x3a421e['Call_Result']='Rejected';break;case'abandoned':_0x3a421e['Call_Result']=_0xe84f('0x6f');break;case _0xe84f('0x70'):_0x3a421e[_0xe84f('0x69')]=_0xe84f('0x71');default:}_0x3a421e[_0xe84f('0x72')]=(_0x2297a5==='outbound'?moment(_0x5a829e[_0xe84f('0x65')])[_0xe84f('0x30')](_0xe84f('0x63')):moment(_0x5a829e[_0xe84f('0x73')])[_0xe84f('0x30')]('YYYY-MM-DDTHH:mm:ss'))||moment()[_0xe84f('0x30')](_0xe84f('0x63'));_0x3a421e[_0xe84f('0x74')]=_0x2297a5||_0xe84f('0x75');_0x3a421e=_[_0xe84f('0x76')](_0x3a421e,getCustomFields(_0x330aa4[_0xe84f('0x77')],_0x5a829e));return request({'method':_0xe84f('0x24'),'uri':_0xe84f('0x3e')+_0x23f332+_0xe84f('0x78'),'headers':{'Authorization':_0xe84f('0x33')+_0x4c8917},'body':{'data':[_0x3a421e]},'json':!![]})[_0xe84f('0x28')](function(_0x8fabea){if(_0x8fabea&&_0x8fabea[_0xe84f('0x45')][0x0]['code']==='SUCCESS'){logger['info'](_0xe84f('0x79'));return{'id':_0x8fabea[_0xe84f('0x45')][0x0][_0xe84f('0x48')]['id']};}})['catch'](function(_0x2211ba){logger[_0xe84f('0x2d')](_0xe84f('0x7a'),_0x2211ba[_0xe84f('0x2c')]);console[_0xe84f('0x7b')](_0xe84f('0x7a'),_0x2211ba);});}exports[_0xe84f('0x7c')]=function(_0x2b5d1e,_0x41f0a7,_0x5e6d4a,_0x48d513,_0x715e9f,_0x2506ef){var _0x48579e,_0xe1f9a9,_0x5d8a5b;_0x2506ef[_0xe84f('0x7d')]=intUtil[_0xe84f('0x7e')](_0x2506ef[_0xe84f('0x7d')]);_0x2506ef[_0xe84f('0x7f')]=intUtil[_0xe84f('0x7e')](_0x2506ef[_0xe84f('0x7f')]);if(_0x715e9f&&_0x715e9f[_0xe84f('0x80')]){logger['info'](_0xe84f('0x81'),_0xe84f('0x82'));_0x41f0a7[_0xe84f('0x83')]=_0x2506ef[_0xe84f('0x7f')]+_0xe84f('0x84')+_0x41f0a7[_0xe84f('0x85')]+_0xe84f('0x86')+md5(_0x41f0a7['uniqueid']);}else{_0x41f0a7[_0xe84f('0x83')]='';}var _0x4eb27d=_0x2506ef[_0xe84f('0x7d')]===_0xe84f('0x87')?'eu':_0xe84f('0x88');return getAccessToken(_0x2506ef)[_0xe84f('0x28')](function(_0x268d06){_0x5d8a5b=_0x268d06;return getUser(_0x5d8a5b,_0x4eb27d,_0x2506ef,_0x48d513[_0xe84f('0x89')]);})[_0xe84f('0x28')](function(_0x2cd3ba){_0x48579e=_0x2cd3ba;logger['info'](_0xe84f('0x8a'),_0x48579e['id']);return getEndUser(_0x5d8a5b,_0x4eb27d,_0x2506ef,_0x41f0a7[_0xe84f('0x8b')],_0x41f0a7[_0xe84f('0x8c')],_0x48579e,_0x5e6d4a);})[_0xe84f('0x28')](function(_0x634b95){_0xe1f9a9=_0x634b95;return getCall(_0x5d8a5b,_0x4eb27d,_0x2506ef,_0x48579e,_0xe1f9a9,_0x5e6d4a,_0x41f0a7,_0xe84f('0x75'));})[_0xe84f('0x28')](function(_0x36021d){if(_0x36021d){logger[_0xe84f('0x2d')](_0xe84f('0x8d'),_0x36021d['id']);logger[_0xe84f('0x2d')](_0xe84f('0x81'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0xe84f('0x8e'),_0x48d513['name']),_0xe84f('0x8f'),{'uri':'https://crm.'+_0x2506ef['host']+_0xe84f('0x90')+_0x36021d['id']});}})[_0xe84f('0x2a')](function(_0x49e46a){logger['error'](_0xe84f('0x81'),JSON['stringify'](_0x49e46a));});};exports[_0xe84f('0x91')]=function(_0x3a52c1,_0x1ba59a,_0x135dc2,_0x3782f8,_0x5efa69,_0x44b763,_0x134cd1){var _0x26ba46,_0x124105,_0x3c272c;_0x44b763[_0xe84f('0x7d')]=intUtil['stripTrailingSlash'](_0x44b763[_0xe84f('0x7d')]);_0x44b763[_0xe84f('0x7f')]=intUtil[_0xe84f('0x7e')](_0x44b763[_0xe84f('0x7f')]);if(_0x134cd1&&_0x134cd1[_0xe84f('0x92')]&&_0x134cd1[_0xe84f('0x92')]!==_0xe84f('0x93')){logger['info'](_0xe84f('0x94'),'Recording\x20is\x20enabled!');_0x1ba59a['recordingURL']=_0x44b763[_0xe84f('0x7f')]+_0xe84f('0x84')+_0x1ba59a[_0xe84f('0x85')]+_0xe84f('0x86')+md5(_0x1ba59a['uniqueid']);}var _0x1000a2=_0x44b763[_0xe84f('0x7d')]===_0xe84f('0x87')?'eu':_0xe84f('0x88');return getAccessToken(_0x44b763)[_0xe84f('0x28')](function(_0x4c6915){_0x3c272c=_0x4c6915;return getUser(_0x3c272c,_0x1000a2,_0x44b763,_0x3782f8['email']);})['then'](function(_0x3a7845){_0x26ba46=_0x3a7845;logger[_0xe84f('0x2d')]('The\x20User\x20ID\x20is:',_0x26ba46['id']);return getEndUser(_0x3c272c,_0x1000a2,_0x44b763,_0x1ba59a[_0xe84f('0x95')],_0x1ba59a[_0xe84f('0x96')],_0x26ba46,_0x135dc2);})[_0xe84f('0x28')](function(_0x1df1ea){_0x124105=_0x1df1ea;return getCall(_0x3c272c,_0x1000a2,_0x44b763,_0x26ba46,_0x124105,_0x135dc2,_0x1ba59a,_0xe84f('0x97'));})[_0xe84f('0x28')](function(_0x5842f5){if(_0x5842f5){logger[_0xe84f('0x2d')](_0xe84f('0x8d'),_0x5842f5['id']);logger['info'](_0xe84f('0x94'),_0xe84f('0x98'));emit(util[_0xe84f('0x30')]('user:%s',_0x3782f8[_0xe84f('0x18')]),_0xe84f('0x8f'),{'uri':_0xe84f('0x99')+_0x44b763[_0xe84f('0x7d')]+_0xe84f('0x90')+_0x5842f5['id']});}})[_0xe84f('0x2a')](function(_0x2e3b32){logger[_0xe84f('0x2b')]('[OUTBOUND]',JSON['stringify'](_0x2e3b32));});};exports['unmanaged']=function(_0x35ec8c,_0x59022b,_0x23045c,_0x11d63d,_0x2de7a5,_0x28ec7d){var _0x6052d0,_0x5edc0e,_0x2787ae;_0x28ec7d['host']=intUtil[_0xe84f('0x7e')](_0x28ec7d[_0xe84f('0x7d')]);_0x28ec7d[_0xe84f('0x7f')]=intUtil[_0xe84f('0x7e')](_0x28ec7d[_0xe84f('0x7f')]);if(_0x2de7a5&&_0x2de7a5['monitor_format']){logger[_0xe84f('0x2d')]('['+_0x59022b[_0xe84f('0x67')][_0xe84f('0x9a')]()+']',_0xe84f('0x82'));_0x59022b[_0xe84f('0x83')]=_0x28ec7d[_0xe84f('0x7f')]+_0xe84f('0x84')+_0x59022b['uniqueid']+_0xe84f('0x86')+md5(_0x59022b[_0xe84f('0x85')]);}else{_0x59022b[_0xe84f('0x83')]='';}var _0x730167=_0x28ec7d[_0xe84f('0x7d')]==='zoho.eu'?'eu':_0xe84f('0x88');return getAccessToken(_0x28ec7d)['then'](function(_0x4efc46){_0x2787ae=_0x4efc46;return getUser(_0x2787ae,_0x730167,_0x28ec7d);})[_0xe84f('0x28')](function(_0x2a3beb){_0x6052d0=_0x2a3beb;logger[_0xe84f('0x2d')]('The\x20User\x20ID\x20is:',_0x6052d0['id']);return getEndUser(_0x2787ae,_0x730167,_0x28ec7d,_0x59022b[_0xe84f('0x8b')],_0x59022b['calleridnum'],_0x6052d0,_0x23045c);})[_0xe84f('0x28')](function(_0x19a8a2){_0x5edc0e=_0x19a8a2;return getCall(_0x2787ae,_0x730167,_0x28ec7d,_0x6052d0,_0x5edc0e,_0x23045c,_0x59022b,_0xe84f('0x75'));})[_0xe84f('0x28')](function(_0x473739){if(_0x473739){logger[_0xe84f('0x2d')](_0xe84f('0x8d'),_0x473739['id']);}})[_0xe84f('0x2a')](function(_0x1db8a5){logger[_0xe84f('0x2b')]('['+_0x59022b['lastevent']['toUpperCase']()+']',JSON['stringify'](_0x1db8a5));});}; \ No newline at end of file +var _0x7024=['/downloads?type=uniqueid&token=','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','none','destcalleridnum','Outbound','The\x20Call\x20ID\x20is:','[OUTBOUND]','user:%s','unmanaged','lodash','request-promise','md5','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','localhost','emit','debug','[HTTP]','stringify','forEach','includes','string','type','toString','variableName','idField','customVariable','name','Variable','split','isNil','access_token','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','clientId','clientSecret','then','seconds','catch','stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','email','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','user','error','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','/crm/v2/','moduleCreate','role','first_name','last_name','code','details','startCase','Error:\x20','log','CREATE\x20ERROR','contact_lead','uri','https://www.zohoapis.','/crm/v2/Contacts/search?criteria=((Phone:equals:','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','Contacts','lead','Creating\x20new\x20call...','Subject','getString','Description','Full_Name','First_Name','Last_Name','enduserType','What_Id','$se_module','talktime','Call_Duration','utc','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','lastevent','called','Call_Result','connect','Answered','rejected','Rejected','abandoned','Abandoned','timeout','Timeout','outbound','agentcalledAt','Call_Type','Inbound','merge','/crm/v2/Calls','Call\x20created!','err','host','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid'];(function(_0x4f3b2d,_0x3bbf46){var _0x3dddfa=function(_0xb8179a){while(--_0xb8179a){_0x4f3b2d['push'](_0x4f3b2d['shift']());}};_0x3dddfa(++_0x3bbf46);}(_0x7024,0x139));var _0x4702=function(_0x1dbd12,_0x350419){_0x1dbd12=_0x1dbd12-0x0;var _0x22c075=_0x7024[_0x1dbd12];return _0x22c075;};'use strict';var _=require(_0x4702('0x0'));var rp=require(_0x4702('0x1'));var md5=require(_0x4702('0x2'));var util=require('util');var intUtil=require('./util');var moment=require(_0x4702('0x3'));var Redis=require(_0x4702('0x4'));var BPromise=require(_0x4702('0x5'));var config=require(_0x4702('0x6'));var logger=require(_0x4702('0x7'))(_0x4702('0x8'));config[_0x4702('0x9')]=_[_0x4702('0xa')](config['redis'],{'host':_0x4702('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x4702('0x9')]));function emit(_0x3858c2,_0x5a99cc,_0xfadffb){io['to'](_0x3858c2)[_0x4702('0xc')](_0x5a99cc,_0xfadffb);}function request(_0x497aeb){logger[_0x4702('0xd')](_0x4702('0xe'),JSON[_0x4702('0xf')](_0x497aeb));return rp(_0x497aeb);}function getCustomFields(_0x149443,_0x31a0b5){var _0x34171b={};if(_0x149443['length']>0x0){_[_0x4702('0x10')](_0x149443,function(_0x166367){if(_[_0x4702('0x11')]([_0x4702('0x12'),'picklist'],_0x166367[_0x4702('0x13')])&&_0x166367['idField']){_0x34171b[_0x166367['idField']]=_0x166367['content'][_0x4702('0x14')]();}else if(_0x166367[_0x4702('0x13')]==='variable'&&_0x166367[_0x4702('0x15')]&&_0x166367[_0x4702('0x16')]&&_0x31a0b5[_0x166367[_0x4702('0x15')]]){_0x34171b[_0x166367[_0x4702('0x16')]]=_0x31a0b5[_0x166367[_0x4702('0x15')]][_0x4702('0x14')]();}else if(_0x166367['type']===_0x4702('0x17')&&_0x166367['Variable']&&_0x166367['Variable'][_0x4702('0x18')]&&_0x166367[_0x4702('0x16')]&&_0x31a0b5[_0x166367['Variable'][_0x4702('0x18')]['toLowerCase']()]){_0x34171b[_0x166367[_0x4702('0x16')]]=_0x31a0b5[_0x166367[_0x4702('0x19')][_0x4702('0x18')]['toLowerCase']()][_0x4702('0x14')]();}});}return _0x34171b;}function getName(_0x576c54){if(_0x576c54['indexOf']('\x20')>0x0){var _0x3dee2b=_0x576c54[_0x4702('0x1a')](/ (.+)/);if(_0x3dee2b[0x1]){return _0x3dee2b;}}return[_0x576c54,_0x576c54];}var accountsTokens={};function getAccessToken(_0x2795a4){return new Promise(function(_0x5a2966,_0x53f584){if(!_['isNil'](accountsTokens[_0x2795a4['id']])&&!_[_0x4702('0x1b')](accountsTokens[_0x2795a4['id']][_0x4702('0x1c')])){if(moment()['isBefore'](accountsTokens[_0x2795a4['id']][_0x4702('0x1d')])){_0x5a2966(accountsTokens[_0x2795a4['id']][_0x4702('0x1c')]);}}var _0x4ef338;switch(_0x2795a4[_0x4702('0x1e')]){case'US':_0x4ef338=_0x4702('0x1f');break;case'AU':_0x4ef338=_0x4702('0x20');break;case'EU':_0x4ef338=_0x4702('0x21');break;case'IN':_0x4ef338=_0x4702('0x22');break;case'CN':_0x4ef338=_0x4702('0x23');break;default:_0x4ef338=_0x4702('0x21');break;}var _0x15218e={'method':_0x4702('0x24'),'uri':_0x4ef338+_0x4702('0x25'),'qs':{'refresh_token':_0x2795a4['refreshToken'],'client_id':_0x2795a4[_0x4702('0x26')],'client_secret':_0x2795a4[_0x4702('0x27')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x15218e)[_0x4702('0x28')](function(_0x5c7283){accountsTokens[_0x2795a4['id']]={'access_token':_0x5c7283[_0x4702('0x1c')],'expires_in':moment()['add'](_0x5c7283[_0x4702('0x1d')],_0x4702('0x29'))};_0x5a2966(_0x5c7283[_0x4702('0x1c')]);})[_0x4702('0x2a')](function(_0x1b13c6){logger['error']('Failing\x20creating\x20the\x20access_token',_0x1b13c6[_0x4702('0x2b')]);_0x53f584(_0x1b13c6);});});}function getUser(_0x5dde2f,_0xc0977,_0x1f0aa,_0xf88f0c){logger[_0x4702('0x2c')](_0x4702('0x2d'));return request({'method':_0x4702('0x2e'),'uri':util[_0x4702('0x2f')](_0x4702('0x30'),_0xc0977),'qs':{'type':_0x4702('0x31')},'headers':{'Authorization':_0x4702('0x32')+_0x5dde2f},'json':!![]})['then'](function(_0x15ba12){if(_0x15ba12[_0x4702('0x33')]){var _0x12c91d=-0x1;if(_[_0x4702('0x34')](_0x15ba12[_0x4702('0x33')])){if(!_[_0x4702('0x1b')](_0xf88f0c)){_0x12c91d=_[_0x4702('0x35')](_0x15ba12[_0x4702('0x33')],function(_0x186bf5){return _0x186bf5[_0x4702('0x36')]===_0xf88f0c;});}if(_0x12c91d>=0x0){logger[_0x4702('0x2c')](_0x4702('0x37'));}else{logger[_0x4702('0x2c')](_0x4702('0x38'));_0x12c91d=_[_0x4702('0x35')](_0x15ba12[_0x4702('0x33')],function(_0x12e70d){return _0x12e70d[_0x4702('0x39')][_0x4702('0x18')]==='Administrator';});}return _0x15ba12[_0x4702('0x33')][_0x12c91d];}else{if(_0x15ba12[_0x4702('0x3a')][_0x4702('0x39')]['name']==='Administrator'){logger[_0x4702('0x2c')](_0x4702('0x38'));user=_0x15ba12[_0x4702('0x3a')];return user;}else{logger[_0x4702('0x3b')](_0x4702('0x3c'),JSON[_0x4702('0xf')](_0x15ba12));throw new Error(_0x4702('0x3d')+JSON['stringify'](_0x15ba12));}}}else{logger[_0x4702('0x3b')](_0x4702('0x3c'),JSON[_0x4702('0xf')](_0x15ba12));throw new Error(_0x4702('0x3d')+JSON[_0x4702('0xf')](_0x15ba12));}})['catch'](function(_0x5e08f1){console[_0x4702('0x3b')](_0x5e08f1);});}function getZohoUser(_0x250966,_0x550033){return new BPromise(function(_0x2ab552,_0x34fab4){request(_0x250966)[_0x4702('0x28')](function(_0xacf309){var _0x49858b=null;if(_0xacf309){_0x49858b=_0xacf309[_0x4702('0x3e')][0x0];_0x49858b['enduserType']=_0x550033;}_0x2ab552(_0x49858b);})[_0x4702('0x2a')](function(_0x3803c8){_0x34fab4(_0x3803c8);});});}function createEndUser(_0x456924,_0x4c5cbc,_0x532e2e,_0x579e7f,_0x5166c5,_0xf9085d){var _0x532e2e=getName(_0x532e2e);return request({'method':'POST','uri':'https://www.zohoapis.'+_0x4c5cbc+_0x4702('0x3f')+_['startCase'](_0xf9085d[_0x4702('0x40')])+'s','body':{'data':[{'Last_Name':_0x532e2e[0x1],'First_Name':_0x532e2e[0x0],'Phone':_0x579e7f,'Owner':{'name':!_['isNil'](_0x5166c5[_0x4702('0x41')]['name'])?_0x5166c5[_0x4702('0x41')][_0x4702('0x18')]:!_['isNil'](_0x5166c5[_0x4702('0x42')])?_0x5166c5[_0x4702('0x42')]+'\x20'+_0x5166c5[_0x4702('0x43')]:_0x5166c5['last_name'],'id':_0x5166c5['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x456924},'json':!![]})[_0x4702('0x28')](function(_0x5d0de7){if(_0x5d0de7&&_0x5d0de7['data'][0x0][_0x4702('0x44')]==='SUCCESS'){var _0xfee159=_0x5d0de7[_0x4702('0x3e')][0x0][_0x4702('0x45')];_0xfee159['enduserType']=_[_0x4702('0x46')](_0xf9085d[_0x4702('0x40')])+'s';return _0xfee159;}logger[_0x4702('0x3b')](_0x4702('0x3c'),JSON[_0x4702('0xf')](data));throw new Error(_0x4702('0x47')+JSON[_0x4702('0xf')](data));})[_0x4702('0x2a')](function(_0x11bb88){console[_0x4702('0x48')](_0x4702('0x49'),_0x11bb88);});}function getEndUser(_0x22ba70,_0x51aa24,_0x2682a8,_0x255e35,_0x582d9e,_0x3b84ee,_0x3a8d7a){var _0x5cf851={'method':_0x4702('0x2e'),'uri':'','headers':{'Authorization':_0x4702('0x32')+_0x22ba70},'json':!![]};switch(_0x3a8d7a['moduleSearch']){case _0x4702('0x4a'):_0x5cf851[_0x4702('0x4b')]=_0x4702('0x4c')+_0x51aa24+_0x4702('0x4d')+_0x582d9e+'))';return getZohoUser(_0x5cf851,'Contacts')[_0x4702('0x28')](function(_0x50c0dd){if(_0x50c0dd)return _0x50c0dd;_0x5cf851[_0x4702('0x4b')]=_0x4702('0x4c')+_0x51aa24+_0x4702('0x4e')+_0x582d9e+'))';return getZohoUser(_0x5cf851,_0x4702('0x4f'))[_0x4702('0x28')](function(_0x54c5c4){if(_0x54c5c4)return _0x54c5c4;if(_0x3a8d7a[_0x4702('0x40')]!=_0x4702('0x50')){return createEndUser(_0x22ba70,_0x51aa24,_0x255e35,_0x582d9e,_0x3b84ee,_0x3a8d7a);}else{return{};}});});break;case _0x4702('0x51'):_0x5cf851[_0x4702('0x4b')]=_0x4702('0x4c')+_0x51aa24+_0x4702('0x4d')+_0x582d9e+'))';return getZohoUser(_0x5cf851,_0x4702('0x52'))[_0x4702('0x28')](function(_0x3d51d2){if(_0x3d51d2)return _0x3d51d2;if(_0x3a8d7a[_0x4702('0x40')]!='nothing'){return createEndUser(_0x22ba70,_0x51aa24,_0x255e35,_0x582d9e,_0x3b84ee,_0x3a8d7a);}else{return{};}});break;case _0x4702('0x53'):_0x5cf851['uri']='https://www.zohoapis.'+_0x51aa24+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x582d9e+'))';return getZohoUser(_0x5cf851,_0x4702('0x4f'))[_0x4702('0x28')](function(_0x47b470){if(_0x47b470)return _0x47b470;if(_0x3a8d7a['moduleCreate']!=_0x4702('0x50')){return createEndUser(_0x22ba70,_0x51aa24,_0x255e35,_0x582d9e,_0x3b84ee,_0x3a8d7a);}else{return{};}});break;}}function getCall(_0x158f3a,_0x6b7e5b,_0x2e680a,_0x3c306c,_0x997a18,_0x372921,_0x96fa36,_0x2b4129){logger['info'](_0x4702('0x54'));var _0x411015={};_0x411015['Owner']={'name':!_['isNil'](_0x3c306c[_0x4702('0x41')][_0x4702('0x18')])&&!_['isNil'](_0x3c306c['profile']['name'])&&_0x3c306c['profile'][_0x4702('0x18')]==='administrator'?_0x3c306c['role']['name']:!_[_0x4702('0x1b')](_0x3c306c[_0x4702('0x42')])?_0x3c306c[_0x4702('0x42')]+'\x20'+_0x3c306c[_0x4702('0x43')]:_0x3c306c['last_name'],'id':_0x3c306c['id']};_0x411015[_0x4702('0x55')]=intUtil[_0x4702('0x56')](_0x372921['Subjects'],_0x96fa36,'\x20');_0x411015[_0x4702('0x57')]=intUtil[_0x4702('0x56')](_0x372921['Descriptions'],_0x96fa36,'\x0a');if(_0x997a18['enduserType']==='Contacts'){_0x411015['Who_Id']={'name':!_[_0x4702('0x1b')](_0x997a18[_0x4702('0x58')])?_0x997a18['Full_Name']:!_[_0x4702('0x1b')](_0x997a18[_0x4702('0x59')])?_0x997a18[_0x4702('0x59')]+'\x20'+_0x997a18[_0x4702('0x5a')]:_0x997a18[_0x4702('0x5a')],'id':_0x997a18['id']};}if(_0x997a18[_0x4702('0x5b')]==='Leads'){_0x411015[_0x4702('0x5c')]={'name':!_['isNil'](_0x997a18['Full_Name'])?_0x997a18[_0x4702('0x58')]:!_[_0x4702('0x1b')](_0x997a18[_0x4702('0x59')])?_0x997a18['First_Name']+'\x20'+_0x997a18[_0x4702('0x5a')]:_0x997a18[_0x4702('0x5a')],'id':_0x997a18['id']};_0x411015[_0x4702('0x5d')]=_[_0x4702('0x46')](_0x997a18[_0x4702('0x5b')]);}if(_0x96fa36[_0x4702('0x5e')]){_0x411015[_0x4702('0x5f')]=moment[_0x4702('0x60')](parseInt(_0x96fa36[_0x4702('0x5e')])*0x3e8)[_0x4702('0x2f')](_0x4702('0x61'));}else if(_0x96fa36[_0x4702('0x62')]&&_0x96fa36[_0x4702('0x63')]){_0x411015['Call_Duration']=moment[_0x4702('0x60')](moment(_0x96fa36[_0x4702('0x63')],_0x4702('0x64'))[_0x4702('0x65')](moment(_0x96fa36[_0x4702('0x66')],_0x4702('0x64'))))[_0x4702('0x2f')]('mm:ss');}switch(_0x96fa36[_0x4702('0x67')]){case _0x4702('0x68'):_0x411015[_0x4702('0x69')]='Called';break;case'complete':case _0x4702('0x6a'):_0x411015[_0x4702('0x69')]=_0x4702('0x6b');break;case _0x4702('0x6c'):_0x411015[_0x4702('0x69')]=_0x4702('0x6d');break;case _0x4702('0x6e'):_0x411015[_0x4702('0x69')]=_0x4702('0x6f');break;case _0x4702('0x70'):_0x411015[_0x4702('0x69')]=_0x4702('0x71');default:}_0x411015['Call_Start_Time']=(_0x2b4129===_0x4702('0x72')?moment(_0x96fa36[_0x4702('0x66')])[_0x4702('0x2f')](_0x4702('0x64')):moment(_0x96fa36[_0x4702('0x73')])[_0x4702('0x2f')]('YYYY-MM-DDTHH:mm:ss'))||moment()[_0x4702('0x2f')](_0x4702('0x64'));_0x411015[_0x4702('0x74')]=_0x2b4129||_0x4702('0x75');_0x411015=_[_0x4702('0x76')](_0x411015,getCustomFields(_0x372921['Fields'],_0x96fa36));return request({'method':_0x4702('0x24'),'uri':_0x4702('0x4c')+_0x6b7e5b+_0x4702('0x77'),'headers':{'Authorization':_0x4702('0x32')+_0x158f3a},'body':{'data':[_0x411015]},'json':!![]})['then'](function(_0x1fb40a){if(_0x1fb40a&&_0x1fb40a[_0x4702('0x3e')][0x0][_0x4702('0x44')]==='SUCCESS'){logger['info'](_0x4702('0x78'));return{'id':_0x1fb40a[_0x4702('0x3e')][0x0][_0x4702('0x45')]['id']};}})['catch'](function(_0x3cd062){logger[_0x4702('0x2c')](_0x4702('0x79'),_0x3cd062['stack']);console[_0x4702('0x48')]('err',_0x3cd062);});}exports['queue']=function(_0x4aa8f8,_0x284caf,_0x4003c7,_0x1ff5a6,_0x4afe48,_0x1137af){var _0xe78925,_0x12d916,_0x1c30da;_0x1137af['host']=intUtil['stripTrailingSlash'](_0x1137af[_0x4702('0x7a')]);_0x1137af[_0x4702('0x7b')]=intUtil[_0x4702('0x7c')](_0x1137af['serverUrl']);if(_0x4afe48&&_0x4afe48[_0x4702('0x7d')]){logger[_0x4702('0x2c')](_0x4702('0x7e'),_0x4702('0x7f'));_0x284caf[_0x4702('0x80')]=_0x1137af[_0x4702('0x7b')]+_0x4702('0x81')+_0x284caf[_0x4702('0x82')]+_0x4702('0x83')+md5(_0x284caf[_0x4702('0x82')]);}else{_0x284caf[_0x4702('0x80')]='';}var _0x24eb12=_0x1137af[_0x4702('0x7a')]===_0x4702('0x84')?'eu':_0x4702('0x85');return getAccessToken(_0x1137af)[_0x4702('0x28')](function(_0x5f5b54){_0x1c30da=_0x5f5b54;return getUser(_0x1c30da,_0x24eb12,_0x1137af,_0x1ff5a6[_0x4702('0x36')]);})[_0x4702('0x28')](function(_0xf4a791){_0xe78925=_0xf4a791;logger[_0x4702('0x2c')](_0x4702('0x86'),_0xe78925['id']);return getEndUser(_0x1c30da,_0x24eb12,_0x1137af,_0x284caf[_0x4702('0x87')],_0x284caf[_0x4702('0x88')],_0xe78925,_0x4003c7);})[_0x4702('0x28')](function(_0x3bd445){_0x12d916=_0x3bd445;return getCall(_0x1c30da,_0x24eb12,_0x1137af,_0xe78925,_0x12d916,_0x4003c7,_0x284caf,_0x4702('0x75'));})[_0x4702('0x28')](function(_0x4b5fa9){if(_0x4b5fa9){logger[_0x4702('0x2c')]('The\x20Call\x20ID\x20is:',_0x4b5fa9['id']);logger[_0x4702('0x2c')](_0x4702('0x7e'),_0x4702('0x89'));emit(util[_0x4702('0x2f')]('user:%s',_0x1ff5a6[_0x4702('0x18')]),_0x4702('0x8a'),{'uri':_0x4702('0x8b')+_0x1137af[_0x4702('0x7a')]+_0x4702('0x8c')+_0x4b5fa9['id']});}})[_0x4702('0x2a')](function(_0xe2dc5d){logger[_0x4702('0x3b')]('[QUEUE]',JSON[_0x4702('0xf')](_0xe2dc5d));});};exports[_0x4702('0x72')]=function(_0x1c3aac,_0x1294f3,_0x3d3ea2,_0x94253,_0x4cbbd3,_0x2de4e6,_0x574e61){var _0x303299,_0x49e833,_0x1a9cbe;_0x2de4e6[_0x4702('0x7a')]=intUtil[_0x4702('0x7c')](_0x2de4e6[_0x4702('0x7a')]);_0x2de4e6[_0x4702('0x7b')]=intUtil[_0x4702('0x7c')](_0x2de4e6[_0x4702('0x7b')]);if(_0x574e61&&_0x574e61['recordingFormat']&&_0x574e61['recordingFormat']!==_0x4702('0x8d')){logger['info']('[OUTBOUND]',_0x4702('0x7f'));_0x1294f3[_0x4702('0x80')]=_0x2de4e6[_0x4702('0x7b')]+'/api/voice/recordings/'+_0x1294f3[_0x4702('0x82')]+'/downloads?type=uniqueid&token='+md5(_0x1294f3[_0x4702('0x82')]);}var _0x3eb663=_0x2de4e6[_0x4702('0x7a')]===_0x4702('0x84')?'eu':_0x4702('0x85');return getAccessToken(_0x2de4e6)['then'](function(_0x4186d8){_0x1a9cbe=_0x4186d8;return getUser(_0x1a9cbe,_0x3eb663,_0x2de4e6,_0x94253['email']);})[_0x4702('0x28')](function(_0x49fa5e){_0x303299=_0x49fa5e;logger[_0x4702('0x2c')](_0x4702('0x86'),_0x303299['id']);return getEndUser(_0x1a9cbe,_0x3eb663,_0x2de4e6,_0x1294f3['destcalleridname'],_0x1294f3[_0x4702('0x8e')],_0x303299,_0x3d3ea2);})[_0x4702('0x28')](function(_0x2009e1){_0x49e833=_0x2009e1;return getCall(_0x1a9cbe,_0x3eb663,_0x2de4e6,_0x303299,_0x49e833,_0x3d3ea2,_0x1294f3,_0x4702('0x8f'));})['then'](function(_0x4d9c2f){if(_0x4d9c2f){logger[_0x4702('0x2c')](_0x4702('0x90'),_0x4d9c2f['id']);logger['info'](_0x4702('0x91'),_0x4702('0x89'));emit(util[_0x4702('0x2f')](_0x4702('0x92'),_0x94253[_0x4702('0x18')]),_0x4702('0x8a'),{'uri':_0x4702('0x8b')+_0x2de4e6[_0x4702('0x7a')]+_0x4702('0x8c')+_0x4d9c2f['id']});}})['catch'](function(_0x43e16b){logger['error']('[OUTBOUND]',JSON[_0x4702('0xf')](_0x43e16b));});};exports[_0x4702('0x93')]=function(_0x1e6fba,_0x352185,_0x47d43f,_0x4d9828,_0x398fff,_0x25bc57){var _0x1e577a,_0xd3388d,_0x44ac2f;_0x25bc57[_0x4702('0x7a')]=intUtil[_0x4702('0x7c')](_0x25bc57['host']);_0x25bc57[_0x4702('0x7b')]=intUtil[_0x4702('0x7c')](_0x25bc57[_0x4702('0x7b')]);if(_0x398fff&&_0x398fff[_0x4702('0x7d')]){logger['info']('['+_0x352185['lastevent']['toUpperCase']()+']',_0x4702('0x7f'));_0x352185[_0x4702('0x80')]=_0x25bc57[_0x4702('0x7b')]+'/api/voice/recordings/'+_0x352185[_0x4702('0x82')]+_0x4702('0x83')+md5(_0x352185[_0x4702('0x82')]);}else{_0x352185[_0x4702('0x80')]='';}var _0x3836c0=_0x25bc57[_0x4702('0x7a')]===_0x4702('0x84')?'eu':_0x4702('0x85');return getAccessToken(_0x25bc57)[_0x4702('0x28')](function(_0x3b3ce6){_0x44ac2f=_0x3b3ce6;return getUser(_0x44ac2f,_0x3836c0,_0x25bc57);})[_0x4702('0x28')](function(_0x585556){_0x1e577a=_0x585556;logger['info'](_0x4702('0x86'),_0x1e577a['id']);return getEndUser(_0x44ac2f,_0x3836c0,_0x25bc57,_0x352185[_0x4702('0x87')],_0x352185['calleridnum'],_0x1e577a,_0x47d43f);})[_0x4702('0x28')](function(_0x3bdb00){_0xd3388d=_0x3bdb00;return getCall(_0x44ac2f,_0x3836c0,_0x25bc57,_0x1e577a,_0xd3388d,_0x47d43f,_0x352185,_0x4702('0x75'));})[_0x4702('0x28')](function(_0x510a41){if(_0x510a41){logger[_0x4702('0x2c')](_0x4702('0x90'),_0x510a41['id']);}})[_0x4702('0x2a')](function(_0x3e960b){logger['error']('['+_0x352185['lastevent']['toUpperCase']()+']',JSON['stringify'](_0x3e960b));});}; \ 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 78c1b49..4710305 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 _0x192b=['shelljs','mustache','trigger','exec','data2','Script','data3','error','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','format','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s'];(function(_0x31ca0a,_0x2c3573){var _0x2de3db=function(_0xe707e4){while(--_0xe707e4){_0x31ca0a['push'](_0x31ca0a['shift']());}};_0x2de3db(++_0x2c3573);}(_0x192b,0x1a4));var _0xb192=function(_0x1ef901,_0x3e39e3){_0x1ef901=_0x1ef901-0x0;var _0x333d2b=_0x192b[_0x1ef901];return _0x333d2b;};'use strict';var util=require('util');var sh=require(_0xb192('0x0'));var Mustache=require(_0xb192('0x1'));var logger=require('../../../../config/logger')(_0xb192('0x2'));exports[_0xb192('0x3')]=function(_0x368f18,_0x167f3d){var _0x47b90e=_0x368f18[_0xb192('0x4')]?_0x368f18[_0xb192('0x4')]:_0xb192('0x5');var _0x2342ef=_0x368f18[_0xb192('0x6')]?Mustache['render'](_0x368f18[_0xb192('0x6')],_0x167f3d):_0x167f3d;sh['exec'](_0x2342ef,function(_0x29a5e9,_0x14ed34,_0x55fc74){if(_0x29a5e9!==0x0){logger[_0xb192('0x7')](util['format'](_0xb192('0x8'),_0x47b90e,_0x2342ef,_0x29a5e9,_0x55fc74));}else{logger[_0xb192('0x9')](util[_0xb192('0xa')](_0xb192('0xb'),_0x47b90e,_0x2342ef,_0x14ed34));}});}; \ No newline at end of file +var _0xec82=['%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','util','shelljs','mustache','../../../../config/logger','exec','data2','Script','render','error','format'];(function(_0x1e288b,_0x5ed08c){var _0x47a4c0=function(_0xfe838f){while(--_0xfe838f){_0x1e288b['push'](_0x1e288b['shift']());}};_0x47a4c0(++_0x5ed08c);}(_0xec82,0xce));var _0x2ec8=function(_0x12bffa,_0x550ab0){_0x12bffa=_0x12bffa-0x0;var _0x34032f=_0xec82[_0x12bffa];return _0x34032f;};'use strict';var util=require(_0x2ec8('0x0'));var sh=require(_0x2ec8('0x1'));var Mustache=require(_0x2ec8('0x2'));var logger=require(_0x2ec8('0x3'))('trigger');exports[_0x2ec8('0x4')]=function(_0x3050bb,_0x285989){var _0x292113=_0x3050bb['data2']?_0x3050bb[_0x2ec8('0x5')]:_0x2ec8('0x6');var _0x230c01=_0x3050bb['data3']?Mustache[_0x2ec8('0x7')](_0x3050bb['data3'],_0x285989):_0x285989;sh[_0x2ec8('0x4')](_0x230c01,function(_0x203efc,_0x1e6e6b,_0x14eb51){if(_0x203efc!==0x0){logger[_0x2ec8('0x8')](util[_0x2ec8('0x9')](_0x2ec8('0xa'),_0x292113,_0x230c01,_0x203efc,_0x14eb51));}else{logger[_0x2ec8('0xb')](util[_0x2ec8('0x9')]('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0x292113,_0x230c01,_0x1e6e6b));}});}; \ 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 471ae4e..c0510aa 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 _0xdc1b=['POST','PUT','data7','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','stringify','then','isNil',',\x20request\x20body:\x20','object','statusCode','catch','name','message','request-promise','util','lodash','mustache','../../../../config/logger','trigger','exec','data1','render','data2','number','data5','headers','data6','parse','error','stack'];(function(_0x389cda,_0x31155c){var _0x5889bc=function(_0x32f473){while(--_0x32f473){_0x389cda['push'](_0x389cda['shift']());}};_0x5889bc(++_0x31155c);}(_0xdc1b,0x1bd));var _0xbdc1=function(_0x2fee96,_0x2f735d){_0x2fee96=_0x2fee96-0x0;var _0x2e6ad1=_0xdc1b[_0x2fee96];return _0x2e6ad1;};'use strict';var rp=require(_0xbdc1('0x0'));var util=require(_0xbdc1('0x1'));var _=require(_0xbdc1('0x2'));var Mustache=require(_0xbdc1('0x3'));var logger=require(_0xbdc1('0x4'))(_0xbdc1('0x5'));exports[_0xbdc1('0x6')]=function(_0x250c10,_0x41757d){var _0x339fb0,_0x5ab847;var _0xad188f={'method':_0x250c10[_0xbdc1('0x7')]['toUpperCase'](),'uri':Mustache[_0xbdc1('0x8')](_0x250c10[_0xbdc1('0x9')],_0x41757d),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x250c10['data5'])===_0xbdc1('0xa')&&parseInt(_0x250c10[_0xbdc1('0xb')])>=0x1&&parseInt(_0x250c10['data5'])<=0xa?parseInt(_0x250c10['data5'])*0x3e8:0x5*0x3e8};try{_0xad188f[_0xbdc1('0xc')]=_0x250c10[_0xbdc1('0xd')]?JSON[_0xbdc1('0xe')](Mustache[_0xbdc1('0x8')](_0x250c10[_0xbdc1('0xd')],_0x41757d)):{};}catch(_0x5bc1e4){logger[_0xbdc1('0xf')](_0x5bc1e4[_0xbdc1('0x10')]);}switch(_0x250c10[_0xbdc1('0x7')]['toUpperCase']()){case'GET':case'DELETE':_0x339fb0=null;_0xad188f['qs']=_0x41757d;break;case _0xbdc1('0x11'):case _0xbdc1('0x12'):if(_0x250c10[_0xbdc1('0x13')]){try{_0x339fb0=JSON['parse'](Mustache[_0xbdc1('0x8')](_0x250c10[_0xbdc1('0x13')],_0x41757d));_0xad188f[_0xbdc1('0x14')]=_0x339fb0;}catch(_0x4407ec){logger[_0xbdc1('0xf')](_0x4407ec['stack']);logger[_0xbdc1('0xf')](_0xbdc1('0x15'));}}else{_0x339fb0=_0x41757d;_0xad188f['body']=_0x339fb0;}break;}logger[_0xbdc1('0x16')](util[_0xbdc1('0x17')]('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x250c10[_0xbdc1('0x7')],_0x250c10[_0xbdc1('0x9')],JSON[_0xbdc1('0x18')](_0xad188f)));rp(_0xad188f)[_0xbdc1('0x19')](function(_0x1cec2c){_0x339fb0=!_[_0xbdc1('0x1a')](_0x339fb0)?_0xbdc1('0x1b')+_0x339fb0:'';_0x5ab847=typeof _0x1cec2c['body']===_0xbdc1('0x1c')?JSON[_0xbdc1('0x18')](_0x1cec2c[_0xbdc1('0x14')]):_0x1cec2c[_0xbdc1('0x14')];logger[_0xbdc1('0x16')](util[_0xbdc1('0x17')]('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0x250c10[_0xbdc1('0x7')],_0x250c10['data2'],_0x1cec2c[_0xbdc1('0x1d')],_0x5ab847));})[_0xbdc1('0x1e')](function(_0x10a369){logger[_0xbdc1('0xf')](util['format']('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x250c10[_0xbdc1('0x7')],_0x250c10[_0xbdc1('0x9')],_0x10a369['statusCode'],_0x10a369[_0xbdc1('0x1f')],_0x10a369[_0xbdc1('0x20')]));});}; \ No newline at end of file +var _0x4953=['data6','error','stack','DELETE','POST','PUT','data7','parse','body','format','stringify','then','isNil',',\x20request\x20body:\x20','object','info','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','name','message','request-promise','util','lodash','mustache','../../../../config/logger','trigger','exec','data1','toUpperCase','render','data2','data5','headers'];(function(_0x3c7e5e,_0x1e0698){var _0x9eef41=function(_0x594efd){while(--_0x594efd){_0x3c7e5e['push'](_0x3c7e5e['shift']());}};_0x9eef41(++_0x1e0698);}(_0x4953,0x98));var _0x3495=function(_0xcb5be4,_0x37a96f){_0xcb5be4=_0xcb5be4-0x0;var _0x21b73e=_0x4953[_0xcb5be4];return _0x21b73e;};'use strict';var rp=require(_0x3495('0x0'));var util=require(_0x3495('0x1'));var _=require(_0x3495('0x2'));var Mustache=require(_0x3495('0x3'));var logger=require(_0x3495('0x4'))(_0x3495('0x5'));exports[_0x3495('0x6')]=function(_0x103762,_0x4de34b){var _0x8da94c,_0x239fef;var _0x2143cf={'method':_0x103762[_0x3495('0x7')][_0x3495('0x8')](),'uri':Mustache[_0x3495('0x9')](_0x103762[_0x3495('0xa')],_0x4de34b),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x103762[_0x3495('0xb')])==='number'&&parseInt(_0x103762[_0x3495('0xb')])>=0x1&&parseInt(_0x103762[_0x3495('0xb')])<=0xa?parseInt(_0x103762[_0x3495('0xb')])*0x3e8:0x5*0x3e8};try{_0x2143cf[_0x3495('0xc')]=_0x103762[_0x3495('0xd')]?JSON['parse'](Mustache[_0x3495('0x9')](_0x103762['data6'],_0x4de34b)):{};}catch(_0x209dfd){logger[_0x3495('0xe')](_0x209dfd[_0x3495('0xf')]);}switch(_0x103762['data1'][_0x3495('0x8')]()){case'GET':case _0x3495('0x10'):_0x8da94c=null;_0x2143cf['qs']=_0x4de34b;break;case _0x3495('0x11'):case _0x3495('0x12'):if(_0x103762[_0x3495('0x13')]){try{_0x8da94c=JSON[_0x3495('0x14')](Mustache[_0x3495('0x9')](_0x103762[_0x3495('0x13')],_0x4de34b));_0x2143cf['body']=_0x8da94c;}catch(_0x3bde6a){logger[_0x3495('0xe')](_0x3bde6a[_0x3495('0xf')]);logger[_0x3495('0xe')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x8da94c=_0x4de34b;_0x2143cf[_0x3495('0x15')]=_0x8da94c;}break;}logger['info'](util[_0x3495('0x16')]('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x103762[_0x3495('0x7')],_0x103762[_0x3495('0xa')],JSON[_0x3495('0x17')](_0x2143cf)));rp(_0x2143cf)[_0x3495('0x18')](function(_0x494f7d){_0x8da94c=!_[_0x3495('0x19')](_0x8da94c)?_0x3495('0x1a')+_0x8da94c:'';_0x239fef=typeof _0x494f7d[_0x3495('0x15')]===_0x3495('0x1b')?JSON[_0x3495('0x17')](_0x494f7d['body']):_0x494f7d[_0x3495('0x15')];logger[_0x3495('0x1c')](util[_0x3495('0x16')](_0x3495('0x1d'),_0x103762[_0x3495('0x7')],_0x103762['data2'],_0x494f7d[_0x3495('0x1e')],_0x239fef));})['catch'](function(_0x295c00){logger[_0x3495('0xe')](util[_0x3495('0x16')]('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x103762[_0x3495('0x7')],_0x103762[_0x3495('0xa')],_0x295c00['statusCode'],_0x295c00[_0x3495('0x1f')],_0x295c00[_0x3495('0x20')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 619f47d..73ffaa1 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 _0x9d7b=['../../config/logger','http','request','then','rpc','error','routing','message','result','jayson/promise','bluebird'];(function(_0x1f5fb2,_0x4dee4b){var _0x536205=function(_0x3686a1){while(--_0x3686a1){_0x1f5fb2['push'](_0x1f5fb2['shift']());}};_0x536205(++_0x4dee4b);}(_0x9d7b,0xa3));var _0xb9d7=function(_0x428927,_0x1846dd){_0x428927=_0x428927-0x0;var _0x3edd01=_0x9d7b[_0x428927];return _0x3edd01;};'use strict';var jayson=require(_0xb9d7('0x0'));var BPromise=require(_0xb9d7('0x1'));var logger=require(_0xb9d7('0x2'))('routing');var client=jayson['client'][_0xb9d7('0x3')]({'port':0x2329});client['Request']=function(_0x1cfccb,_0x48c96c){return new BPromise(function(_0x5e00a4,_0x47d9e2){return client[_0xb9d7('0x4')](_0x1cfccb,_0x48c96c)[_0xb9d7('0x5')](function(_0x5a3a63){logger['debug'](_0xb9d7('0x6'),'routing',_0x1cfccb,_0x48c96c,_0x5a3a63);if(_0x5a3a63[_0xb9d7('0x7')]){logger['error']('rpc',_0xb9d7('0x8'),_0x1cfccb,_0x5a3a63['error'][_0xb9d7('0x9')],_0x48c96c);return _0x47d9e2(_0x5a3a63[_0xb9d7('0x7')]['message']);}else{return _0x5e00a4(_0x5a3a63[_0xb9d7('0xa')]);}})['catch'](function(_0x73fa7a){logger[_0xb9d7('0x7')](_0xb9d7('0x6'),'routing',_0x1cfccb,_0x73fa7a,_0x48c96c);return _0x47d9e2(_0x73fa7a);});});};module['exports']=client; \ No newline at end of file +var _0x2f4e=['error','message','result','exports','jayson/promise','../../config/logger','routing','client','http','Request','request','then','debug','rpc'];(function(_0x1bf860,_0x124062){var _0x21fedc=function(_0x411906){while(--_0x411906){_0x1bf860['push'](_0x1bf860['shift']());}};_0x21fedc(++_0x124062);}(_0x2f4e,0x1a8));var _0xe2f4=function(_0x1d5a88,_0x7bbb0a){_0x1d5a88=_0x1d5a88-0x0;var _0x2e84f3=_0x2f4e[_0x1d5a88];return _0x2e84f3;};'use strict';var jayson=require(_0xe2f4('0x0'));var BPromise=require('bluebird');var logger=require(_0xe2f4('0x1'))(_0xe2f4('0x2'));var client=jayson[_0xe2f4('0x3')][_0xe2f4('0x4')]({'port':0x2329});client[_0xe2f4('0x5')]=function(_0x2792ec,_0xccf1f6){return new BPromise(function(_0x1a11d8,_0x3bddf7){return client[_0xe2f4('0x6')](_0x2792ec,_0xccf1f6)[_0xe2f4('0x7')](function(_0x450f9c){logger[_0xe2f4('0x8')](_0xe2f4('0x9'),_0xe2f4('0x2'),_0x2792ec,_0xccf1f6,_0x450f9c);if(_0x450f9c[_0xe2f4('0xa')]){logger['error']('rpc','routing',_0x2792ec,_0x450f9c['error'][_0xe2f4('0xb')],_0xccf1f6);return _0x3bddf7(_0x450f9c[_0xe2f4('0xa')]['message']);}else{return _0x1a11d8(_0x450f9c[_0xe2f4('0xc')]);}})['catch'](function(_0x47131e){logger[_0xe2f4('0xa')](_0xe2f4('0x9'),'routing',_0x2792ec,_0x47131e,_0xccf1f6);return _0x3bddf7(_0x47131e);});});};module[_0xe2f4('0xd')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 4ee249c..fee983a 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 _0xf894=['./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','resolve','then','getMailAccounts','initMailAccounts','refresh','mailAccounts','listen','getSettings','loginMailFrequency','catch','log','bluebird','./server'];(function(_0x58281e,_0x33a14a){var _0x3cd045=function(_0x476217){while(--_0x476217){_0x58281e['push'](_0x58281e['shift']());}};_0x3cd045(++_0x33a14a);}(_0xf894,0xfd));var _0x4f89=function(_0xdbeee8,_0x28a2d7){_0xdbeee8=_0xdbeee8-0x0;var _0x4a6bfc=_0xf894[_0xdbeee8];return _0x4a6bfc;};'use strict';var BPromise=require(_0x4f89('0x0'));var server=require(_0x4f89('0x1'));var Realtime=require(_0x4f89('0x2'));var EmailChannel=require(_0x4f89('0x3'));var mailAccount=require(_0x4f89('0x4'));var setting=require(_0x4f89('0x5'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0x4f89('0x6')]()[_0x4f89('0x7')](mailAccount[_0x4f89('0x8')]())[_0x4f89('0x7')](realtime[_0x4f89('0x9')]())[_0x4f89('0x7')](function(){email[_0x4f89('0xa')](realtime[_0x4f89('0xb')]);return realtime;});}function main(){return server[_0x4f89('0xc')](realtime,email)[_0x4f89('0x7')](function(){return initRealtime();})[_0x4f89('0x7')](function(){return setting[_0x4f89('0xd')]();})['then'](function(_0x2f8cd8){return setInterval(initRealtime,_0x2f8cd8[_0x4f89('0xe')]*0x3e8);})[_0x4f89('0xf')](function(_0x3253fe){console[_0x4f89('0x10')](_0x3253fe);});}main(); \ No newline at end of file +var _0x7605=['initMailAccounts','refresh','loginMailFrequency','catch','./server','./realtime','./lib/email','./rpc/setting','resolve','then'];(function(_0x24562e,_0x2cc8af){var _0xab78e2=function(_0x4454f5){while(--_0x4454f5){_0x24562e['push'](_0x24562e['shift']());}};_0xab78e2(++_0x2cc8af);}(_0x7605,0xc2));var _0x5760=function(_0x472935,_0x4c7fae){_0x472935=_0x472935-0x0;var _0x1de59d=_0x7605[_0x472935];return _0x1de59d;};'use strict';var BPromise=require('bluebird');var server=require(_0x5760('0x0'));var Realtime=require(_0x5760('0x1'));var EmailChannel=require(_0x5760('0x2'));var mailAccount=require('./rpc/mailAccount');var setting=require(_0x5760('0x3'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0x5760('0x4')]()[_0x5760('0x5')](mailAccount['getMailAccounts']())[_0x5760('0x5')](realtime[_0x5760('0x6')]())[_0x5760('0x5')](function(){email[_0x5760('0x7')](realtime['mailAccounts']);return realtime;});}function main(){return server['listen'](realtime,email)[_0x5760('0x5')](function(){return initRealtime();})[_0x5760('0x5')](function(){return setting['getSettings']();})['then'](function(_0x1acd66){return setInterval(initRealtime,_0x1acd66[_0x5760('0x8')]*0x3e8);})[_0x5760('0x9')](function(_0x4d70ab){console['log'](_0x4d70ab);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 4792e98..a5caf9e 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 _0xc61a=['connected','messageStatus','firstName','lastName','from','notify','Mail\x20accepted\x20from\x20routing','catch','lastSync','sendMail','send','verifySmtp','Smtp','then','verified','verify','exports','lodash','moment','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','redis','defaults','socket.io-emitter','./imap','./smtp','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','emit','active','Imap','status','total','isNil','stringify','prototype','refresh','hasOwnProperty','email','box','handleImapBox','handleImapEmail','bind','handleImapEnd','error','handleImapError','disabled'];(function(_0x43190a,_0x358045){var _0x24b0d8=function(_0x1b2934){while(--_0x1b2934){_0x43190a['push'](_0x43190a['shift']());}};_0x24b0d8(++_0x358045);}(_0xc61a,0xe5));var _0xac61=function(_0x4896cd,_0x5d5055){_0x4896cd=_0x4896cd-0x0;var _0x339b5c=_0xc61a[_0x4896cd];return _0x339b5c;};'use strict';var _=require(_0xac61('0x0'));var moment=require(_0xac61('0x1'));var BPromise=require(_0xac61('0x2'));var md5=require(_0xac61('0x3'));var Redis=require(_0xac61('0x4'));var config=require(_0xac61('0x5'));var logger=require(_0xac61('0x6'))('email');config[_0xac61('0x7')]=_[_0xac61('0x8')](config[_0xac61('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0xac61('0x9'))(new Redis(config[_0xac61('0x7')]));var EmailImap=require(_0xac61('0xa'));var EmailSmtp=require(_0xac61('0xb'));var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x133c0a){logger[_0xac61('0xc')](_0xac61('0xd'));this[_0xac61('0xe')]=_0x133c0a['mailAccounts'];this[_0xac61('0xf')]={};this[_0xac61('0x10')]=new EmailSmtp();}EmailChannel['prototype'][_0xac61('0x11')]=function(_0x303fa7){var _0x13bf43=this[_0xac61('0xe')][_0x303fa7];var _0x5484ff={'id':_0x13bf43['id'],'name':_0x13bf43['name'],'key':_0x13bf43['key'],'active':_0x13bf43[_0xac61('0x12')],'Imap':{'status':_0x13bf43[_0xac61('0x13')][_0xac61('0x14')],'messageStatus':_0x13bf43[_0xac61('0x13')]['messageStatus'],'total':_0x13bf43[_0xac61('0x13')][_0xac61('0x15')]}};if(_[_0xac61('0x16')](md5Accounts[_0x303fa7])){md5Accounts[_0x303fa7]={};}var _0x137435=md5(JSON[_0xac61('0x17')](_0x5484ff));if(md5Accounts[_0x303fa7]['md5']!==_0x137435){md5Accounts[_0x303fa7][_0xac61('0x3')]=_0x137435;io[_0xac61('0x11')]('mailAccount:update',_0x5484ff);}};EmailChannel[_0xac61('0x18')][_0xac61('0x19')]=function(_0x29936e){for(var _0x1604d7 in _0x29936e){if(_0x29936e[_0xac61('0x1a')](_0x1604d7)){if(_0x29936e[_0x1604d7]['Imap']&&_0x29936e[_0x1604d7][_0xac61('0x12')]){var _0x1baf24=_0x29936e[_0x1604d7][_0xac61('0x13')];if(!this[_0xac61('0xf')][_0xac61('0x1a')](_0x1baf24['id'])){this[_0xac61('0xf')][_0x1baf24['id']]=new EmailImap(_0x1baf24,_0x29936e[_0x1604d7][_0xac61('0x1b')]);this[_0xac61('0xf')][_0x1baf24['id']]['on'](_0xac61('0x1c'),this[_0xac61('0x1d')]['bind'](this,_0x1604d7));this[_0xac61('0xf')][_0x1baf24['id']]['on']('email',this[_0xac61('0x1e')][_0xac61('0x1f')](this,_0x1604d7));this[_0xac61('0xf')][_0x1baf24['id']]['on']('end',this[_0xac61('0x20')][_0xac61('0x1f')](this,_0x1604d7));this['imapAccounts'][_0x1baf24['id']]['on'](_0xac61('0x21'),this[_0xac61('0x22')]['bind'](this,_0x1604d7));}}else{if(_[_0xac61('0x16')](this[_0xac61('0xe')][_0x1604d7]['Imap'])){this[_0xac61('0xe')][_0x1604d7][_0xac61('0x13')]={};}this[_0xac61('0xe')][_0x1604d7]['Imap'][_0xac61('0x14')]=_0xac61('0x23');this[_0xac61('0xe')][_0x1604d7]['Imap']['messageStatus']='';this[_0xac61('0x11')](_0x1604d7);}}}};EmailChannel[_0xac61('0x18')][_0xac61('0x1d')]=function(_0x2e2500,_0x1cd649){if(this[_0xac61('0xe')][_0x2e2500]){this['mailAccounts'][_0x2e2500][_0xac61('0x13')]['status']=_0xac61('0x24');this[_0xac61('0xe')][_0x2e2500]['Imap'][_0xac61('0x25')]=_0x1cd649['name'];if(_0x1cd649['messages']){this[_0xac61('0xe')][_0x2e2500][_0xac61('0x13')][_0xac61('0x15')]=_0x1cd649['messages']['total'];}return this[_0xac61('0x11')](_0x2e2500);}};EmailChannel[_0xac61('0x18')][_0xac61('0x1e')]=function(_0x230505,_0x49bea7){logger[_0xac61('0xc')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x49bea7[_0xac61('0x26')],_0x49bea7[_0xac61('0x27')],_0x49bea7[_0xac61('0x28')],_0x230505);if(this['mailAccounts'][_0x230505]){return mailAccount[_0xac61('0x29')](_0x230505,_0x49bea7)['then'](function(_0x43a20d){if(_0x43a20d){logger['info'](_0xac61('0x2a'));}})[_0xac61('0x2b')](function(_0x4aa61f){logger[_0xac61('0x21')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0xac61('0x17')](_0x4aa61f));});}};EmailChannel[_0xac61('0x18')]['handleImapEnd']=function(_0x518e1e){if(this[_0xac61('0xe')][_0x518e1e]&&this[_0xac61('0xe')][_0x518e1e][_0xac61('0x13')]){if(this[_0xac61('0xf')][this[_0xac61('0xe')][_0x518e1e][_0xac61('0x13')]['id']]){delete this[_0xac61('0xf')][this[_0xac61('0xe')][_0x518e1e][_0xac61('0x13')]['id']];}this[_0xac61('0xe')][_0x518e1e]['Imap'][_0xac61('0x2c')]=moment();this[_0xac61('0x11')](_0x518e1e);}};EmailChannel[_0xac61('0x18')][_0xac61('0x22')]=function(_0x10b79c,_0x1b4b65){if(this['mailAccounts'][_0x10b79c]){this['mailAccounts'][_0x10b79c][_0xac61('0x13')][_0xac61('0x14')]=_0xac61('0x21');this[_0xac61('0xe')][_0x10b79c][_0xac61('0x13')][_0xac61('0x25')]=_0x1b4b65;return this[_0xac61('0x11')](_0x10b79c);}};EmailChannel['prototype'][_0xac61('0x2d')]=function(_0x26251a,_0xfc8ea4){return this[_0xac61('0x10')][_0xac61('0x2e')](_0x26251a,_0xfc8ea4);};EmailChannel[_0xac61('0x18')][_0xac61('0x2f')]=function(_0x2d5417){var _0x9eb4d0=this;if(this[_0xac61('0xe')][_0x2d5417['id']]){if(_['isNil'](this['mailAccounts'][_0x2d5417['id']][_0xac61('0x30')])){this[_0xac61('0xe')][_0x2d5417['id']][_0xac61('0x30')]={};}this[_0xac61('0xe')][_0x2d5417['id']][_0xac61('0x30')][_0xac61('0x2c')]=moment();return new BPromise(function(_0x332766,_0x24240f){return _0x9eb4d0[_0xac61('0x10')]['verify'](_0x2d5417)[_0xac61('0x31')](function(_0x4a655b){_0x9eb4d0[_0xac61('0xe')][_0x2d5417['id']]['Smtp']['status']=_0xac61('0x32');_0x9eb4d0['mailAccounts'][_0x2d5417['id']]['Smtp'][_0xac61('0x25')]='';_0x9eb4d0[_0xac61('0x11')](_0x2d5417['id']);_0x332766(_0x4a655b);})[_0xac61('0x2b')](function(_0x36b894){_0x9eb4d0['mailAccounts'][_0x2d5417['id']]['Smtp'][_0xac61('0x14')]=_0xac61('0x21');_0x9eb4d0[_0xac61('0xe')][_0x2d5417['id']]['Smtp']['messageStatus']=_0x36b894;_0x9eb4d0[_0xac61('0x11')](_0x2d5417['id']);_0x24240f(_0x36b894);});});}return this[_0xac61('0x10')][_0xac61('0x33')](_0x2d5417);};module[_0xac61('0x34')]=EmailChannel; \ No newline at end of file +var _0x3f6a=['emit','prototype','refresh','hasOwnProperty','email','box','handleImapEmail','bind','handleImapEnd','error','disabled','handleImapBox','messages','info','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','from','notify','then','lastSync','verifySmtp','Smtp','verify','verified','catch','exports','lodash','bluebird','md5','../../../config/logger','redis','defaults','localhost','socket.io-emitter','./imap','../rpc/mailAccount','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','name','key','active','Imap','status','messageStatus','total','isNil','stringify'];(function(_0x386311,_0x2d6cb9){var _0x5b4878=function(_0xc46c30){while(--_0xc46c30){_0x386311['push'](_0x386311['shift']());}};_0x5b4878(++_0x2d6cb9);}(_0x3f6a,0x10f));var _0xa3f6=function(_0x4c389c,_0x20e533){_0x4c389c=_0x4c389c-0x0;var _0x375bd2=_0x3f6a[_0x4c389c];return _0x375bd2;};'use strict';var _=require(_0xa3f6('0x0'));var moment=require('moment');var BPromise=require(_0xa3f6('0x1'));var md5=require(_0xa3f6('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0xa3f6('0x3'))('email');config[_0xa3f6('0x4')]=_[_0xa3f6('0x5')](config[_0xa3f6('0x4')],{'host':_0xa3f6('0x6'),'port':0x18eb});var io=require(_0xa3f6('0x7'))(new Redis(config[_0xa3f6('0x4')]));var EmailImap=require(_0xa3f6('0x8'));var EmailSmtp=require('./smtp');var mailAccount=require(_0xa3f6('0x9'));var md5Accounts={};function EmailChannel(_0x35f7c6){logger['info'](_0xa3f6('0xa'));this['mailAccounts']=_0x35f7c6[_0xa3f6('0xb')];this[_0xa3f6('0xc')]={};this[_0xa3f6('0xd')]=new EmailSmtp();}EmailChannel['prototype']['emit']=function(_0x4dd9f5){var _0x1dc6cc=this['mailAccounts'][_0x4dd9f5];var _0x413c8a={'id':_0x1dc6cc['id'],'name':_0x1dc6cc[_0xa3f6('0xe')],'key':_0x1dc6cc[_0xa3f6('0xf')],'active':_0x1dc6cc[_0xa3f6('0x10')],'Imap':{'status':_0x1dc6cc[_0xa3f6('0x11')][_0xa3f6('0x12')],'messageStatus':_0x1dc6cc['Imap'][_0xa3f6('0x13')],'total':_0x1dc6cc[_0xa3f6('0x11')][_0xa3f6('0x14')]}};if(_[_0xa3f6('0x15')](md5Accounts[_0x4dd9f5])){md5Accounts[_0x4dd9f5]={};}var _0x4ee438=md5(JSON[_0xa3f6('0x16')](_0x413c8a));if(md5Accounts[_0x4dd9f5][_0xa3f6('0x2')]!==_0x4ee438){md5Accounts[_0x4dd9f5][_0xa3f6('0x2')]=_0x4ee438;io[_0xa3f6('0x17')]('mailAccount:update',_0x413c8a);}};EmailChannel[_0xa3f6('0x18')][_0xa3f6('0x19')]=function(_0x567142){for(var _0x4771bc in _0x567142){if(_0x567142[_0xa3f6('0x1a')](_0x4771bc)){if(_0x567142[_0x4771bc][_0xa3f6('0x11')]&&_0x567142[_0x4771bc]['active']){var _0xb3bbb3=_0x567142[_0x4771bc][_0xa3f6('0x11')];if(!this[_0xa3f6('0xc')]['hasOwnProperty'](_0xb3bbb3['id'])){this['imapAccounts'][_0xb3bbb3['id']]=new EmailImap(_0xb3bbb3,_0x567142[_0x4771bc][_0xa3f6('0x1b')]);this[_0xa3f6('0xc')][_0xb3bbb3['id']]['on'](_0xa3f6('0x1c'),this['handleImapBox']['bind'](this,_0x4771bc));this[_0xa3f6('0xc')][_0xb3bbb3['id']]['on'](_0xa3f6('0x1b'),this[_0xa3f6('0x1d')][_0xa3f6('0x1e')](this,_0x4771bc));this[_0xa3f6('0xc')][_0xb3bbb3['id']]['on']('end',this[_0xa3f6('0x1f')]['bind'](this,_0x4771bc));this[_0xa3f6('0xc')][_0xb3bbb3['id']]['on'](_0xa3f6('0x20'),this['handleImapError'][_0xa3f6('0x1e')](this,_0x4771bc));}}else{if(_[_0xa3f6('0x15')](this[_0xa3f6('0xb')][_0x4771bc][_0xa3f6('0x11')])){this[_0xa3f6('0xb')][_0x4771bc][_0xa3f6('0x11')]={};}this[_0xa3f6('0xb')][_0x4771bc][_0xa3f6('0x11')]['status']=_0xa3f6('0x21');this[_0xa3f6('0xb')][_0x4771bc]['Imap'][_0xa3f6('0x13')]='';this[_0xa3f6('0x17')](_0x4771bc);}}}};EmailChannel[_0xa3f6('0x18')][_0xa3f6('0x22')]=function(_0x1743d9,_0x113034){if(this[_0xa3f6('0xb')][_0x1743d9]){this[_0xa3f6('0xb')][_0x1743d9][_0xa3f6('0x11')][_0xa3f6('0x12')]='connected';this[_0xa3f6('0xb')][_0x1743d9][_0xa3f6('0x11')][_0xa3f6('0x13')]=_0x113034[_0xa3f6('0xe')];if(_0x113034['messages']){this[_0xa3f6('0xb')][_0x1743d9][_0xa3f6('0x11')][_0xa3f6('0x14')]=_0x113034[_0xa3f6('0x23')]['total'];}return this[_0xa3f6('0x17')](_0x1743d9);}};EmailChannel[_0xa3f6('0x18')][_0xa3f6('0x1d')]=function(_0x26a621,_0x2c902a){logger[_0xa3f6('0x24')](_0xa3f6('0x25'),_0x2c902a[_0xa3f6('0x26')],_0x2c902a['lastName'],_0x2c902a[_0xa3f6('0x27')],_0x26a621);if(this['mailAccounts'][_0x26a621]){return mailAccount[_0xa3f6('0x28')](_0x26a621,_0x2c902a)[_0xa3f6('0x29')](function(_0x3e6372){if(_0x3e6372){logger[_0xa3f6('0x24')]('Mail\x20accepted\x20from\x20routing');}})['catch'](function(_0x3c9df6){logger[_0xa3f6('0x20')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON['stringify'](_0x3c9df6));});}};EmailChannel[_0xa3f6('0x18')]['handleImapEnd']=function(_0x2b5146){if(this[_0xa3f6('0xb')][_0x2b5146]&&this[_0xa3f6('0xb')][_0x2b5146]['Imap']){if(this[_0xa3f6('0xc')][this[_0xa3f6('0xb')][_0x2b5146][_0xa3f6('0x11')]['id']]){delete this['imapAccounts'][this[_0xa3f6('0xb')][_0x2b5146][_0xa3f6('0x11')]['id']];}this['mailAccounts'][_0x2b5146]['Imap'][_0xa3f6('0x2a')]=moment();this[_0xa3f6('0x17')](_0x2b5146);}};EmailChannel[_0xa3f6('0x18')]['handleImapError']=function(_0x27705c,_0x1887c2){if(this[_0xa3f6('0xb')][_0x27705c]){this[_0xa3f6('0xb')][_0x27705c]['Imap'][_0xa3f6('0x12')]=_0xa3f6('0x20');this[_0xa3f6('0xb')][_0x27705c]['Imap'][_0xa3f6('0x13')]=_0x1887c2;return this[_0xa3f6('0x17')](_0x27705c);}};EmailChannel[_0xa3f6('0x18')]['sendMail']=function(_0x159800,_0x3648db){return this[_0xa3f6('0xd')]['send'](_0x159800,_0x3648db);};EmailChannel['prototype'][_0xa3f6('0x2b')]=function(_0x2ff41e){var _0x1ffe41=this;if(this['mailAccounts'][_0x2ff41e['id']]){if(_[_0xa3f6('0x15')](this[_0xa3f6('0xb')][_0x2ff41e['id']][_0xa3f6('0x2c')])){this['mailAccounts'][_0x2ff41e['id']][_0xa3f6('0x2c')]={};}this[_0xa3f6('0xb')][_0x2ff41e['id']][_0xa3f6('0x2c')][_0xa3f6('0x2a')]=moment();return new BPromise(function(_0x5bdf4c,_0x2e3d73){return _0x1ffe41[_0xa3f6('0xd')][_0xa3f6('0x2d')](_0x2ff41e)[_0xa3f6('0x29')](function(_0x1d662a){_0x1ffe41[_0xa3f6('0xb')][_0x2ff41e['id']][_0xa3f6('0x2c')][_0xa3f6('0x12')]=_0xa3f6('0x2e');_0x1ffe41[_0xa3f6('0xb')][_0x2ff41e['id']][_0xa3f6('0x2c')]['messageStatus']='';_0x1ffe41[_0xa3f6('0x17')](_0x2ff41e['id']);_0x5bdf4c(_0x1d662a);})[_0xa3f6('0x2f')](function(_0x4fb332){_0x1ffe41[_0xa3f6('0xb')][_0x2ff41e['id']][_0xa3f6('0x2c')][_0xa3f6('0x12')]=_0xa3f6('0x20');_0x1ffe41[_0xa3f6('0xb')][_0x2ff41e['id']][_0xa3f6('0x2c')][_0xa3f6('0x13')]=_0x4fb332;_0x1ffe41[_0xa3f6('0x17')](_0x2ff41e['id']);_0x2e3d73(_0x4fb332);});});}return this[_0xa3f6('0xd')][_0xa3f6('0x2d')](_0x2ff41e);};module[_0xa3f6('0x30')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 486b94f..feb3b78 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 _0x9e6f=['iconv','Iconv','events','EventEmitter','./utils','../../../config/logger','email','mailbox','INBOX','account','getAccount','once','bind','end','handleEnd','error','handleError','connect','inherits','connTimeout','authTimeout','isNil','service','authentication','user','password','host','port','tls','autotls','getHost','handleReady','openBox','handleOpenBox','box','readUnseen','prototype','handleCloseBox','search','UNSEEN','handleReadUnseen','fetch','message','handleFetchMessage','handleFetchEnd','closeBox','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','parser','emit','handleFetchError','stringify','textCode','upperFirst','path','imap','lodash','simpleParser'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0x9e6f,0x76));var _0xf9e6=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x9e6f[_0x18ab2a];return _0x16dcee;};'use strict';var fs=require('fs');var path=require(_0xf9e6('0x0'));var util=require('util');var Imap=require(_0xf9e6('0x1'));var _=require(_0xf9e6('0x2'));var rs=require('randomstring');var simpleParser=require('mailparser')[_0xf9e6('0x3')];var Iconv=require(_0xf9e6('0x4'))[_0xf9e6('0x5')];var EventEmitter=require(_0xf9e6('0x6'))[_0xf9e6('0x7')];var utils=require(_0xf9e6('0x8'));var logger=require(_0xf9e6('0x9'))(_0xf9e6('0xa'));function EmailImap(_0x594f5e,_0x357128){this[_0xf9e6('0xb')]=_0xf9e6('0xc');this[_0xf9e6('0xd')]=this[_0xf9e6('0xe')](_0x594f5e,_0x357128);this[_0xf9e6('0x1')]=new Imap(this[_0xf9e6('0xd')]);this['imap'][_0xf9e6('0xf')]('ready',this['handleReady'][_0xf9e6('0x10')](this));this[_0xf9e6('0x1')][_0xf9e6('0xf')](_0xf9e6('0x11'),this[_0xf9e6('0x12')][_0xf9e6('0x10')](this));this[_0xf9e6('0x1')]['on'](_0xf9e6('0x13'),this[_0xf9e6('0x14')][_0xf9e6('0x10')](this));this['imap'][_0xf9e6('0x15')]();}util[_0xf9e6('0x16')](EmailImap,EventEmitter);EmailImap['prototype'][_0xf9e6('0xe')]=function(_0xc375cf,_0x551068){var _0x2f63a4={'connTimeout':_0xc375cf['connTimeout']?_0xc375cf[_0xf9e6('0x17')]*0x3e8:0x2710,'authTimeout':_0xc375cf['authTimeout']?_0xc375cf[_0xf9e6('0x18')]*0x3e8:0x1388};if(_[_0xf9e6('0x19')](_0xc375cf[_0xf9e6('0x1a')])){if(_0xc375cf[_0xf9e6('0x1b')]){_0x2f63a4['user']=_0xc375cf[_0xf9e6('0x1c')];_0x2f63a4[_0xf9e6('0x1d')]=_0xc375cf[_0xf9e6('0x1d')];}_0x2f63a4[_0xf9e6('0x1e')]=_0xc375cf[_0xf9e6('0x1e')];_0x2f63a4[_0xf9e6('0x1f')]=_0xc375cf['port']||0x3e1;if(_0xc375cf[_0xf9e6('0x20')]){_0x2f63a4['tls']=!![];}else{_0x2f63a4[_0xf9e6('0x20')]=![];_0x2f63a4[_0xf9e6('0x21')]='required';}}else{_0x2f63a4['user']=_0xc375cf[_0xf9e6('0x1c')];_0x2f63a4[_0xf9e6('0x1d')]=_0xc375cf[_0xf9e6('0x1d')];_0x2f63a4[_0xf9e6('0x1e')]=utils[_0xf9e6('0x22')](_0xc375cf[_0xf9e6('0x1a')]);_0x2f63a4[_0xf9e6('0x1f')]=0x3e1;_0x2f63a4[_0xf9e6('0x20')]=!![];}_0x2f63a4[_0xf9e6('0xa')]=_0x551068||_0xc375cf[_0xf9e6('0x1c')]||'anonymous@xcally.com';return _0x2f63a4;};EmailImap['prototype'][_0xf9e6('0x23')]=function(){this[_0xf9e6('0x1')][_0xf9e6('0x24')](this[_0xf9e6('0xb')],![],this[_0xf9e6('0x25')][_0xf9e6('0x10')](this));};EmailImap['prototype'][_0xf9e6('0x25')]=function(_0x2f02f8,_0x144575){if(_0x2f02f8){this['handleError'](_0x2f02f8,!![]);}else{this['emit'](_0xf9e6('0x26'),_0x144575);this[_0xf9e6('0x27')]();}};EmailImap[_0xf9e6('0x28')][_0xf9e6('0x29')]=function(_0x181a60){if(_0x181a60){this['handleError'](_0x181a60,!![]);}else{this['imap'][_0xf9e6('0x11')]();}};EmailImap['prototype']['readUnseen']=function(){this[_0xf9e6('0x1')][_0xf9e6('0x2a')]([_0xf9e6('0x2b')],this[_0xf9e6('0x2c')][_0xf9e6('0x10')](this));};EmailImap[_0xf9e6('0x28')][_0xf9e6('0x2c')]=function(_0xf96f32,_0x3432e7){if(_0xf96f32){this[_0xf9e6('0x14')](_0xf96f32,!![]);}else{if(_0x3432e7['length']){try{var _0x160add=this[_0xf9e6('0x1')][_0xf9e6('0x2d')](_0x3432e7,{'bodies':'','markSeen':!![]});_0x160add['on'](_0xf9e6('0x2e'),this[_0xf9e6('0x2f')]['bind'](this));_0x160add[_0xf9e6('0xf')](_0xf9e6('0x13'),this['handleFetchError'][_0xf9e6('0x10')](this));_0x160add[_0xf9e6('0xf')](_0xf9e6('0x11'),this[_0xf9e6('0x30')][_0xf9e6('0x10')](this));}catch(_0x8e6432){logger[_0xf9e6('0x13')](_0x8e6432);}}else{this[_0xf9e6('0x1')][_0xf9e6('0x31')](!![],this['handleCloseBox'][_0xf9e6('0x10')](this));}}};EmailImap[_0xf9e6('0x28')][_0xf9e6('0x2f')]=function(_0x12a226,_0x4e4165){_0x12a226['on'](_0xf9e6('0x32'),this[_0xf9e6('0x33')][_0xf9e6('0x10')](this));_0x12a226['once'](_0xf9e6('0x34'),this['handleMessageAttributes'][_0xf9e6('0x10')](this));_0x12a226[_0xf9e6('0xf')]('end',this['handleMessageEnd'][_0xf9e6('0x10')](this));};EmailImap[_0xf9e6('0x28')][_0xf9e6('0x33')]=function(_0x18f35f,_0x589124){simpleParser(_0x18f35f,{'Iconv':Iconv},this['handleSimpleParser']['bind'](this));};EmailImap[_0xf9e6('0x28')][_0xf9e6('0x35')]=function(_0x470f84){};EmailImap[_0xf9e6('0x28')][_0xf9e6('0x36')]=function(){};EmailImap[_0xf9e6('0x28')]['handleSimpleParser']=function(_0x326e2b,_0x59c19c){if(_0x326e2b){logger[_0xf9e6('0x13')](_0x326e2b);}else{var _0x387e8b=this;utils[_0xf9e6('0x37')](this[_0xf9e6('0xd')],_0x59c19c,function(_0x325d8e){_0x387e8b[_0xf9e6('0x38')](_0xf9e6('0xa'),_0x325d8e);});}};EmailImap['prototype'][_0xf9e6('0x30')]=function(){this[_0xf9e6('0x1')][_0xf9e6('0x31')](!![],this[_0xf9e6('0x29')][_0xf9e6('0x10')](this));};EmailImap[_0xf9e6('0x28')][_0xf9e6('0x39')]=function(_0x343344){this[_0xf9e6('0x14')](_0x343344);this[_0xf9e6('0x1')]['closeBox'](!![],this[_0xf9e6('0x29')][_0xf9e6('0x10')](this));};EmailImap[_0xf9e6('0x28')]['handleEnd']=function(){this[_0xf9e6('0x38')](_0xf9e6('0x11'));};EmailImap[_0xf9e6('0x28')]['handleError']=function(_0x52d049,_0x3ee6ca){logger[_0xf9e6('0x13')]('handleError',this[_0xf9e6('0xd')][_0xf9e6('0xa')],JSON[_0xf9e6('0x3a')](_0x52d049));var _0x21635e='';if(_0x52d049){if(_0x52d049['textCode']){_0x21635e=_0x52d049[_0xf9e6('0x3b')];}else{for(var _0xc262a3 in _0x52d049){if(_0x52d049['hasOwnProperty'](_0xc262a3)){_0x21635e+=_[_0xf9e6('0x3c')](_0xc262a3)+':\x20'+_0x52d049[_0xc262a3]+'\x0a';}}}}if(_0x3ee6ca){this[_0xf9e6('0x1')][_0xf9e6('0x11')]();}else{this['emit'](_0xf9e6('0x13'),_0x21635e);this[_0xf9e6('0x38')](_0xf9e6('0x11'));}};module['exports']=EmailImap; \ No newline at end of file +var _0x4c33=['autotls','required','email','handleReady','handleOpenBox','emit','box','readUnseen','handleCloseBox','handleReadUnseen','message','handleFetchMessage','error','handleFetchError','end','handleFetchEnd','closeBox','body','handleMessageBody','attributes','handleSimpleParser','handleMessageAttributes','handleMessageEnd','parser','stringify','textCode','hasOwnProperty','upperFirst','exports','path','imap','lodash','randomstring','mailparser','iconv','Iconv','events','../../../config/logger','mailbox','INBOX','account','getAccount','once','ready','bind','handleEnd','handleError','inherits','prototype','connTimeout','authTimeout','isNil','service','authentication','user','password','host','port','tls'];(function(_0x5a27e8,_0x492a2f){var _0x4e38f7=function(_0x2a4048){while(--_0x2a4048){_0x5a27e8['push'](_0x5a27e8['shift']());}};_0x4e38f7(++_0x492a2f);}(_0x4c33,0x93));var _0x34c3=function(_0x3c394c,_0x261b54){_0x3c394c=_0x3c394c-0x0;var _0x28d1fd=_0x4c33[_0x3c394c];return _0x28d1fd;};'use strict';var fs=require('fs');var path=require(_0x34c3('0x0'));var util=require('util');var Imap=require(_0x34c3('0x1'));var _=require(_0x34c3('0x2'));var rs=require(_0x34c3('0x3'));var simpleParser=require(_0x34c3('0x4'))['simpleParser'];var Iconv=require(_0x34c3('0x5'))[_0x34c3('0x6')];var EventEmitter=require(_0x34c3('0x7'))['EventEmitter'];var utils=require('./utils');var logger=require(_0x34c3('0x8'))('email');function EmailImap(_0x2b6638,_0x162211){this[_0x34c3('0x9')]=_0x34c3('0xa');this[_0x34c3('0xb')]=this[_0x34c3('0xc')](_0x2b6638,_0x162211);this[_0x34c3('0x1')]=new Imap(this[_0x34c3('0xb')]);this[_0x34c3('0x1')][_0x34c3('0xd')](_0x34c3('0xe'),this['handleReady'][_0x34c3('0xf')](this));this[_0x34c3('0x1')]['once']('end',this[_0x34c3('0x10')][_0x34c3('0xf')](this));this[_0x34c3('0x1')]['on']('error',this[_0x34c3('0x11')][_0x34c3('0xf')](this));this[_0x34c3('0x1')]['connect']();}util[_0x34c3('0x12')](EmailImap,EventEmitter);EmailImap[_0x34c3('0x13')][_0x34c3('0xc')]=function(_0x398359,_0x5dc454){var _0x4c95e8={'connTimeout':_0x398359[_0x34c3('0x14')]?_0x398359[_0x34c3('0x14')]*0x3e8:0x2710,'authTimeout':_0x398359[_0x34c3('0x15')]?_0x398359[_0x34c3('0x15')]*0x3e8:0x1388};if(_[_0x34c3('0x16')](_0x398359[_0x34c3('0x17')])){if(_0x398359[_0x34c3('0x18')]){_0x4c95e8[_0x34c3('0x19')]=_0x398359[_0x34c3('0x19')];_0x4c95e8[_0x34c3('0x1a')]=_0x398359[_0x34c3('0x1a')];}_0x4c95e8['host']=_0x398359[_0x34c3('0x1b')];_0x4c95e8[_0x34c3('0x1c')]=_0x398359[_0x34c3('0x1c')]||0x3e1;if(_0x398359[_0x34c3('0x1d')]){_0x4c95e8[_0x34c3('0x1d')]=!![];}else{_0x4c95e8[_0x34c3('0x1d')]=![];_0x4c95e8[_0x34c3('0x1e')]=_0x34c3('0x1f');}}else{_0x4c95e8[_0x34c3('0x19')]=_0x398359['user'];_0x4c95e8[_0x34c3('0x1a')]=_0x398359[_0x34c3('0x1a')];_0x4c95e8[_0x34c3('0x1b')]=utils['getHost'](_0x398359[_0x34c3('0x17')]);_0x4c95e8[_0x34c3('0x1c')]=0x3e1;_0x4c95e8['tls']=!![];}_0x4c95e8[_0x34c3('0x20')]=_0x5dc454||_0x398359['user']||'anonymous@xcally.com';return _0x4c95e8;};EmailImap['prototype'][_0x34c3('0x21')]=function(){this[_0x34c3('0x1')]['openBox'](this[_0x34c3('0x9')],![],this['handleOpenBox'][_0x34c3('0xf')](this));};EmailImap[_0x34c3('0x13')][_0x34c3('0x22')]=function(_0x35a045,_0x3759f8){if(_0x35a045){this[_0x34c3('0x11')](_0x35a045,!![]);}else{this[_0x34c3('0x23')](_0x34c3('0x24'),_0x3759f8);this[_0x34c3('0x25')]();}};EmailImap['prototype'][_0x34c3('0x26')]=function(_0x591091){if(_0x591091){this['handleError'](_0x591091,!![]);}else{this[_0x34c3('0x1')]['end']();}};EmailImap[_0x34c3('0x13')][_0x34c3('0x25')]=function(){this[_0x34c3('0x1')]['search'](['UNSEEN'],this[_0x34c3('0x27')][_0x34c3('0xf')](this));};EmailImap[_0x34c3('0x13')][_0x34c3('0x27')]=function(_0x1a1812,_0x274b0e){if(_0x1a1812){this[_0x34c3('0x11')](_0x1a1812,!![]);}else{if(_0x274b0e['length']){try{var _0x45a7d9=this[_0x34c3('0x1')]['fetch'](_0x274b0e,{'bodies':'','markSeen':!![]});_0x45a7d9['on'](_0x34c3('0x28'),this[_0x34c3('0x29')][_0x34c3('0xf')](this));_0x45a7d9[_0x34c3('0xd')](_0x34c3('0x2a'),this[_0x34c3('0x2b')]['bind'](this));_0x45a7d9['once'](_0x34c3('0x2c'),this[_0x34c3('0x2d')][_0x34c3('0xf')](this));}catch(_0x28c6c2){logger['error'](_0x28c6c2);}}else{this[_0x34c3('0x1')][_0x34c3('0x2e')](!![],this[_0x34c3('0x26')][_0x34c3('0xf')](this));}}};EmailImap[_0x34c3('0x13')]['handleFetchMessage']=function(_0xb650ee,_0x30a563){_0xb650ee['on'](_0x34c3('0x2f'),this[_0x34c3('0x30')]['bind'](this));_0xb650ee[_0x34c3('0xd')](_0x34c3('0x31'),this['handleMessageAttributes']['bind'](this));_0xb650ee['once']('end',this['handleMessageEnd'][_0x34c3('0xf')](this));};EmailImap[_0x34c3('0x13')][_0x34c3('0x30')]=function(_0x45a410,_0x1d8208){simpleParser(_0x45a410,{'Iconv':Iconv},this[_0x34c3('0x32')][_0x34c3('0xf')](this));};EmailImap[_0x34c3('0x13')][_0x34c3('0x33')]=function(_0xfdfda7){};EmailImap[_0x34c3('0x13')][_0x34c3('0x34')]=function(){};EmailImap[_0x34c3('0x13')][_0x34c3('0x32')]=function(_0x521925,_0x1f352c){if(_0x521925){logger[_0x34c3('0x2a')](_0x521925);}else{var _0x5a7887=this;utils[_0x34c3('0x35')](this[_0x34c3('0xb')],_0x1f352c,function(_0x4fbdb8){_0x5a7887['emit'](_0x34c3('0x20'),_0x4fbdb8);});}};EmailImap['prototype'][_0x34c3('0x2d')]=function(){this['imap'][_0x34c3('0x2e')](!![],this[_0x34c3('0x26')][_0x34c3('0xf')](this));};EmailImap[_0x34c3('0x13')]['handleFetchError']=function(_0x2159f8){this[_0x34c3('0x11')](_0x2159f8);this[_0x34c3('0x1')][_0x34c3('0x2e')](!![],this['handleCloseBox'][_0x34c3('0xf')](this));};EmailImap[_0x34c3('0x13')][_0x34c3('0x10')]=function(){this[_0x34c3('0x23')](_0x34c3('0x2c'));};EmailImap[_0x34c3('0x13')][_0x34c3('0x11')]=function(_0x1ecefc,_0x4a532b){logger['error'](_0x34c3('0x11'),this['account'][_0x34c3('0x20')],JSON[_0x34c3('0x36')](_0x1ecefc));var _0x11dc0c='';if(_0x1ecefc){if(_0x1ecefc[_0x34c3('0x37')]){_0x11dc0c=_0x1ecefc[_0x34c3('0x37')];}else{for(var _0x2c648e in _0x1ecefc){if(_0x1ecefc[_0x34c3('0x38')](_0x2c648e)){_0x11dc0c+=_[_0x34c3('0x39')](_0x2c648e)+':\x20'+_0x1ecefc[_0x2c648e]+'\x0a';}}}}if(_0x4a532b){this[_0x34c3('0x1')][_0x34c3('0x2c')]();}else{this['emit'](_0x34c3('0x2a'),_0x11dc0c);this[_0x34c3('0x23')]('end');}};module[_0x34c3('0x3a')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index bf811c6..aa0d0a9 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 _0x3192=['exports','bluebird','nodemailer-plugin-inline-base64','prototype','send','use','compile','toString','verify','Not\x20verifired'];(function(_0x1e5413,_0x51f9ae){var _0x4bc406=function(_0x1682fc){while(--_0x1682fc){_0x1e5413['push'](_0x1e5413['shift']());}};_0x4bc406(++_0x51f9ae);}(_0x3192,0x191));var _0x2319=function(_0x225fd6,_0x4b0503){_0x225fd6=_0x225fd6-0x0;var _0x3f007e=_0x3192[_0x225fd6];return _0x3f007e;};'use strict';var nodemailer=require('nodemailer');var BPromise=require(_0x2319('0x0'));var inlineBase64=require(_0x2319('0x1'));function EmailSmtp(){}EmailSmtp[_0x2319('0x2')][_0x2319('0x3')]=function(_0x11b85c,_0x825067){return new BPromise(function(_0x4c2f40,_0x1b865d){var _0x1b2cc4=nodemailer['createTransport'](_0x11b85c);_0x1b2cc4[_0x2319('0x4')](_0x2319('0x5'),inlineBase64());_0x1b2cc4['sendMail'](_0x825067,function(_0x2407e9,_0x5f2127){if(_0x2407e9){_0x1b865d(_0x2407e9[_0x2319('0x6')]());}else{_0x4c2f40(_0x5f2127);}});});};EmailSmtp[_0x2319('0x2')][_0x2319('0x7')]=function(_0x307018){return new BPromise(function(_0xa4dcd2,_0x501cf5){var _0x4bd4c9=nodemailer['createTransport'](_0x307018);_0x4bd4c9[_0x2319('0x7')](function(_0x28597f,_0x41c1e0){if(_0x28597f){_0x501cf5(_0x28597f[_0x2319('0x6')]());}else{if(_0x41c1e0){_0xa4dcd2(_0x41c1e0);}else{_0x501cf5(_0x2319('0x8'));}}});});};module[_0x2319('0x9')]=EmailSmtp; \ No newline at end of file +var _0x8925=['createTransport','verify','Not\x20verifired','exports','nodemailer','bluebird','nodemailer-plugin-inline-base64','send','use','compile','sendMail','toString'];(function(_0x583b56,_0x192c84){var _0x11ed7a=function(_0x3d1768){while(--_0x3d1768){_0x583b56['push'](_0x583b56['shift']());}};_0x11ed7a(++_0x192c84);}(_0x8925,0x154));var _0x5892=function(_0xe9f4a2,_0x50f0c4){_0xe9f4a2=_0xe9f4a2-0x0;var _0x25e066=_0x8925[_0xe9f4a2];return _0x25e066;};'use strict';var nodemailer=require(_0x5892('0x0'));var BPromise=require(_0x5892('0x1'));var inlineBase64=require(_0x5892('0x2'));function EmailSmtp(){}EmailSmtp['prototype'][_0x5892('0x3')]=function(_0x29277f,_0x1f8b32){return new BPromise(function(_0x313301,_0x26b682){var _0x5eaf61=nodemailer['createTransport'](_0x29277f);_0x5eaf61[_0x5892('0x4')](_0x5892('0x5'),inlineBase64());_0x5eaf61[_0x5892('0x6')](_0x1f8b32,function(_0x53046a,_0x420d65){if(_0x53046a){_0x26b682(_0x53046a[_0x5892('0x7')]());}else{_0x313301(_0x420d65);}});});};EmailSmtp['prototype']['verify']=function(_0x1d48e9){return new BPromise(function(_0x52f206,_0x3089ff){var _0x5071fc=nodemailer[_0x5892('0x8')](_0x1d48e9);_0x5071fc[_0x5892('0x9')](function(_0x4acc9b,_0x151b18){if(_0x4acc9b){_0x3089ff(_0x4acc9b[_0x5892('0x7')]());}else{if(_0x151b18){_0x52f206(_0x151b18);}else{_0x3089ff(_0x5892('0xa'));}}});});};module[_0x5892('0xb')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 8a1a4c2..658a8cf 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 _0x32b6=['Data','getHost','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','outlook.office365.com','127.0.0.1','lodash','moment','path','util','email','../../../config/environment','head','value','address','anonymous','generate','name','indexOf','split','length','slice','join','pop','isEmpty','html','test','includes','\x20[Attachment:\x20','\x20]','body','textAsHtml','Empty\x20message

','Attachments','Title'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x32b6,0x1d1));var _0x632b=function(_0x2bb36d,_0x34f88d){_0x2bb36d=_0x2bb36d-0x0;var _0x283da3=_0x32b6[_0x2bb36d];return _0x283da3;};'use strict';var _=require(_0x632b('0x0'));var moment=require(_0x632b('0x1'));var random=require('randomstring');var fs=require('fs');var path=require(_0x632b('0x2'));var util=require(_0x632b('0x3'));var tnef=require('node-tnef');var logger=require('../../../config/logger')(_0x632b('0x4'));var config=require(_0x632b('0x5'));function getAddress(_0x3ba3a7){var _0x3a0e0e=_[_0x632b('0x6')](_0x3ba3a7[_0x632b('0x7')]);return _0x3a0e0e&&_0x3a0e0e[_0x632b('0x8')]?_0x3a0e0e[_0x632b('0x8')]:_0x632b('0x9')+random[_0x632b('0xa')](0x6)+'@xcally.com';}function getFirstName(_0x33d711){var _0x173270=_[_0x632b('0x6')](_0x33d711[_0x632b('0x7')]);if(_0x173270&&_0x173270['name']){if(_0x173270['name']==_0x173270['address']){return _0x173270[_0x632b('0xb')]['substring'](0x0,_0x173270[_0x632b('0xb')][_0x632b('0xc')]('@'));}var _0x2eca51=_0x173270[_0x632b('0xb')][_0x632b('0xd')](/\s+/);return _0x2eca51[_0x632b('0xe')]>0x1?_0x2eca51[_0x632b('0xf')](0x0,-0x1)[_0x632b('0x10')]('\x20'):_0x173270[_0x632b('0xb')];}return'Anonymous';}function getLastName(_0xb5416c){var _0x286f75=_[_0x632b('0x6')](_0xb5416c['value']);if(_0x286f75&&_0x286f75[_0x632b('0xb')]){var _0x1a3a60=_0x286f75[_0x632b('0xb')][_0x632b('0xd')](/\s+/);return _0x1a3a60[_0x632b('0xe')]>0x1?_0x1a3a60[_0x632b('0x11')]():'';}return'';}function getMails(_0x4efe39,_0x17ddc5){var _0x52f353='';for(var _0x4fdef2=0x0;_0x4fdef2<_0x17ddc5[_0x632b('0x7')]['length'];_0x4fdef2+=0x1){if(_0x17ddc5[_0x632b('0x7')][_0x4fdef2][_0x632b('0x8')]!==_0x4efe39){if(!_[_0x632b('0x12')](_0x52f353)){_0x52f353+=',';}_0x52f353+=_0x17ddc5['value'][_0x4fdef2][_0x632b('0xb')]||_0x17ddc5[_0x632b('0x7')][_0x4fdef2][_0x632b('0x8')]||'';_0x52f353+='\x20<';_0x52f353+=_0x17ddc5[_0x632b('0x7')][_0x4fdef2]['address']?_0x17ddc5[_0x632b('0x7')][_0x4fdef2][_0x632b('0x8')]:'anonymous'+random[_0x632b('0xa')](0x6)+'@xcally.com';_0x52f353+='>';}}return _0x52f353;}function parseEmail(_0x4b5618,_0x1b1092,_0x5ce3fa){if(_0x1b1092[_0x632b('0x13')]){var _0x1c4530=/)<[^<]*)*<\/script>/gi;while(_0x1c4530[_0x632b('0x14')](_0x1b1092['html'])){_0x1b1092[_0x632b('0x13')]=_0x1b1092[_0x632b('0x13')]['replace'](_0x1c4530,'');}if(_0x1b1092[_0x632b('0x13')][_0x632b('0x15')](_0x632b('0x16'))){var _0x1e448c=[];_0x1b1092[_0x632b('0x17')][_0x632b('0x18')](_0x5ec5ea=>{_0x1e448c['push'](_0x5ec5ea[_0x632b('0x19')]);});var _0x4d3a70=/]+>/g;var _0x4ebd26=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x954fa0=_0x1b1092['html'][_0x632b('0x1a')](_0x4ebd26,_0x632b('0x1b'));var _0x29d9aa=_0x954fa0[_0x632b('0x1a')](_0x4d3a70,_0x632b('0x1c'));for(let _0x515d74=0x0;_0x515d74<_0x1e448c[_0x632b('0xe')];_0x515d74++){var _0x1975ac=_0x29d9aa[_0x632b('0x1a')]('_IMG',_0x632b('0x1d')+_0x1e448c[_0x515d74]+_0x632b('0x1e'));_0x29d9aa=_0x1975ac;}_0x1b1092[_0x632b('0x13')]=_0x29d9aa;}_0x5ce3fa[_0x632b('0x1f')]=_0x1b1092[_0x632b('0x13')];}else{_0x5ce3fa[_0x632b('0x1f')]=_0x1b1092[_0x632b('0x20')];}if(_0x5ce3fa[_0x632b('0x1f')]){_0x5ce3fa[_0x632b('0x1f')]=_0x5ce3fa[_0x632b('0x1f')][_0x632b('0x1a')](/0x0){var _0x57f099=[_0x632b('0x31'),'X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply'];for(var _0x55b5f6=0x0;_0x55b5f6<_0x1b1092[_0x632b('0x32')][_0x632b('0xe')];_0x55b5f6++){var _0x417a30=_[_0x632b('0xc')](_0x57f099,_0x1b1092['headerLines'][_0x55b5f6][_0x632b('0x33')]);if(_0x417a30>=0x0){_0x5ce3fa[_0x632b('0x34')]=!![];}}}return _0x5ce3fa;}exports[_0x632b('0x35')]=function(_0x4dbe4b,_0x15bb30,_0x32fcc8){var _0x1225a4={'from':getAddress(_0x15bb30[_0x632b('0x36')]),'firstName':getFirstName(_0x15bb30[_0x632b('0x36')]),'lastName':getLastName(_0x15bb30[_0x632b('0x36')]),'mapKey':'email','message':{'from':getMails(_0x4dbe4b[_0x632b('0x4')],_0x15bb30[_0x632b('0x36')]),'to':_0x4dbe4b[_0x632b('0x4')],'cc':'','subject':_0x15bb30[_0x632b('0x37')]||'','messageId':_0x15bb30['messageId'],'inReplyTo':_0x15bb30['inReplyTo'],'sentAt':moment(_0x15bb30[_0x632b('0x38')])[_0x632b('0x29')](_0x632b('0x39')),'attach':![],'attachments':[]}};if(!_0x15bb30[_0x632b('0x13')]&&!_0x15bb30[_0x632b('0x20')]){var _0x1ec1c0=_['filter'](_0x15bb30[_0x632b('0x17')],{'contentType':_0x632b('0x3a')});if(_0x1ec1c0[_0x632b('0xe')]){logger[_0x632b('0x3b')](util[_0x632b('0x29')](_0x632b('0x3c'),_0x15bb30[_0x632b('0x3d')]));tnef[_0x632b('0x3e')](_['first'](_0x1ec1c0)[_0x632b('0x2f')],function(_0x56f254,_0x2a1f09){if(_0x2a1f09){_0x15bb30['html']=_0x2a1f09[_0x632b('0x3f')]||_0x632b('0x40');if(_0x2a1f09[_0x632b('0x41')]){for(var _0x2c4561=0x0;_0x2c4561<_0x2a1f09[_0x632b('0x41')]['length'];_0x2c4561++){var _0x3e582e=_0x2a1f09[_0x632b('0x41')][_0x2c4561];_0x1225a4[_0x632b('0x22')]['attachments'][_0x632b('0x30')]({'filename':_0x3e582e[_0x632b('0x42')],'content':Buffer[_0x632b('0x36')](_0x3e582e[_0x632b('0x43')])});}}}_0x32fcc8(parseEmail(_0x4dbe4b,_0x15bb30,_0x1225a4));});}else{_0x15bb30[_0x632b('0x13')]='

Empty\x20message

';_0x32fcc8(parseEmail(_0x4dbe4b,_0x15bb30,_0x1225a4));}}else{_0x32fcc8(parseEmail(_0x4dbe4b,_0x15bb30,_0x1225a4));}};exports[_0x632b('0x44')]=function(_0x50adc4){switch(_0x50adc4){case _0x632b('0x45'):return _0x632b('0x46');case _0x632b('0x47'):return _0x632b('0x48');case _0x632b('0x49'):return'imap-mail.outlook.com';case'outlook365':return _0x632b('0x4a');}return _0x632b('0x4b');}; \ No newline at end of file +var _0xceef=['line','isAutoreply','from','subject','messageId','inReplyTo','date','filter','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','first','BodyHTML','Attachments','Title','Data','getHost','gmail','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','127.0.0.1','randomstring','path','node-tnef','email','../../../config/environment','head','address','anonymous','generate','value','name','indexOf','split','length','slice','join','pop','@xcally.com','html','replace','includes','','body','textAsHtml','0x1?_0xbe2cc7[_0xfcee('0xe')](0x0,-0x1)[_0xfcee('0xf')]('\x20'):_0x2f8ae6[_0xfcee('0xa')];}return'Anonymous';}function getLastName(_0x364b51){var _0x3158e7=_['head'](_0x364b51['value']);if(_0x3158e7&&_0x3158e7[_0xfcee('0xa')]){var _0x39e61b=_0x3158e7[_0xfcee('0xa')][_0xfcee('0xc')](/\s+/);return _0x39e61b[_0xfcee('0xd')]>0x1?_0x39e61b[_0xfcee('0x10')]():'';}return'';}function getMails(_0x486334,_0x50543a){var _0xdec4d5='';for(var _0x38a971=0x0;_0x38a971<_0x50543a['value'][_0xfcee('0xd')];_0x38a971+=0x1){if(_0x50543a[_0xfcee('0x9')][_0x38a971][_0xfcee('0x6')]!==_0x486334){if(!_['isEmpty'](_0xdec4d5)){_0xdec4d5+=',';}_0xdec4d5+=_0x50543a[_0xfcee('0x9')][_0x38a971][_0xfcee('0xa')]||_0x50543a[_0xfcee('0x9')][_0x38a971][_0xfcee('0x6')]||'';_0xdec4d5+='\x20<';_0xdec4d5+=_0x50543a['value'][_0x38a971]['address']?_0x50543a[_0xfcee('0x9')][_0x38a971][_0xfcee('0x6')]:_0xfcee('0x7')+random[_0xfcee('0x8')](0x6)+_0xfcee('0x11');_0xdec4d5+='>';}}return _0xdec4d5;}function parseEmail(_0xb5f3db,_0x13d08d,_0x51eada){if(_0x13d08d[_0xfcee('0x12')]){var _0x513690=/)<[^<]*)*<\/script>/gi;while(_0x513690['test'](_0x13d08d[_0xfcee('0x12')])){_0x13d08d[_0xfcee('0x12')]=_0x13d08d[_0xfcee('0x12')][_0xfcee('0x13')](_0x513690,'');}if(_0x13d08d[_0xfcee('0x12')][_0xfcee('0x14')](_0xfcee('0x15'))){var _0x3cf678=[];_0x13d08d[_0xfcee('0x16')][_0xfcee('0x17')](_0x384a8f=>{_0x3cf678[_0xfcee('0x18')](_0x384a8f[_0xfcee('0x19')]);});var _0x37d46=/]+>/g;var _0xf3c76c=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x4f18c2=_0x13d08d['html']['replace'](_0xf3c76c,_0xfcee('0x1a'));var _0x271d4d=_0x4f18c2[_0xfcee('0x13')](_0x37d46,_0xfcee('0x1b'));for(let _0x20a81d=0x0;_0x20a81d<_0x3cf678[_0xfcee('0xd')];_0x20a81d++){var _0xb30144=_0x271d4d[_0xfcee('0x13')](_0xfcee('0x1b'),'\x20[Attachment:\x20'+_0x3cf678[_0x20a81d]+_0xfcee('0x1c'));_0x271d4d=_0xb30144;}_0x13d08d[_0xfcee('0x12')]=_0x271d4d;}_0x51eada[_0xfcee('0x1d')]=_0x13d08d[_0xfcee('0x12')];}else{_0x51eada[_0xfcee('0x1d')]=_0x13d08d[_0xfcee('0x1e')];}if(_0x51eada[_0xfcee('0x1d')]){_0x51eada['body']=_0x51eada[_0xfcee('0x1d')][_0xfcee('0x13')](/0x0){var _0x489f17=[_0xfcee('0x2f'),_0xfcee('0x30'),_0xfcee('0x31')];for(var _0x7c5d7=0x0;_0x7c5d7<_0x13d08d['headerLines'][_0xfcee('0xd')];_0x7c5d7++){var _0x7226f6=_[_0xfcee('0xb')](_0x489f17,_0x13d08d[_0xfcee('0x2e')][_0x7c5d7][_0xfcee('0x32')]);if(_0x7226f6>=0x0){_0x51eada[_0xfcee('0x33')]=!![];}}}return _0x51eada;}exports['parser']=function(_0x3ba3d1,_0x474ed9,_0x4b2bbf){var _0x3a0b77={'from':getAddress(_0x474ed9[_0xfcee('0x34')]),'firstName':getFirstName(_0x474ed9[_0xfcee('0x34')]),'lastName':getLastName(_0x474ed9['from']),'mapKey':_0xfcee('0x3'),'message':{'from':getMails(_0x3ba3d1[_0xfcee('0x3')],_0x474ed9[_0xfcee('0x34')]),'to':_0x3ba3d1['email'],'cc':'','subject':_0x474ed9[_0xfcee('0x35')]||'','messageId':_0x474ed9[_0xfcee('0x36')],'inReplyTo':_0x474ed9[_0xfcee('0x37')],'sentAt':moment(_0x474ed9[_0xfcee('0x38')])[_0xfcee('0x28')]('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x474ed9['html']&&!_0x474ed9[_0xfcee('0x1e')]){var _0x504417=_[_0xfcee('0x39')](_0x474ed9['attachments'],{'contentType':_0xfcee('0x3a')});if(_0x504417[_0xfcee('0xd')]){logger[_0xfcee('0x3b')](util[_0xfcee('0x28')](_0xfcee('0x3c'),_0x474ed9['messageId']));tnef[_0xfcee('0x3d')](_[_0xfcee('0x3e')](_0x504417)['content'],function(_0x15828c,_0x111077){if(_0x111077){_0x474ed9[_0xfcee('0x12')]=_0x111077[_0xfcee('0x3f')]||'

Empty\x20message

';if(_0x111077[_0xfcee('0x40')]){for(var _0x59f52e=0x0;_0x59f52e<_0x111077[_0xfcee('0x40')][_0xfcee('0xd')];_0x59f52e++){var _0x2c8334=_0x111077['Attachments'][_0x59f52e];_0x3a0b77[_0xfcee('0x20')]['attachments'][_0xfcee('0x18')]({'filename':_0x2c8334[_0xfcee('0x41')],'content':Buffer[_0xfcee('0x34')](_0x2c8334[_0xfcee('0x42')])});}}}_0x4b2bbf(parseEmail(_0x3ba3d1,_0x474ed9,_0x3a0b77));});}else{_0x474ed9[_0xfcee('0x12')]='

Empty\x20message

';_0x4b2bbf(parseEmail(_0x3ba3d1,_0x474ed9,_0x3a0b77));}}else{_0x4b2bbf(parseEmail(_0x3ba3d1,_0x474ed9,_0x3a0b77));}};exports[_0xfcee('0x43')]=function(_0x4d78a5){switch(_0x4d78a5){case _0xfcee('0x44'):return'imap.gmail.com';case'yahoo':return _0xfcee('0x45');case _0xfcee('0x46'):return _0xfcee('0x47');case _0xfcee('0x48'):return'outlook.office365.com';}return _0xfcee('0x49');}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 1b849bb..ac9c3fc 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 _0xf7af=['Smtp','name','Service','key','SERV','active','Imap'];(function(_0x117d83,_0x19c6c3){var _0xf26cf3=function(_0x30a17b){while(--_0x30a17b){_0x117d83['push'](_0x117d83['shift']());}};_0xf26cf3(++_0x19c6c3);}(_0xf7af,0x1e4));var _0xff7a=function(_0x5958a6,_0x34a283){_0x5958a6=_0x5958a6-0x0;var _0x33513f=_0xf7af[_0x5958a6];return _0x33513f;};'use strict';var _=require('lodash');function MailAccount(_0x3a7767){this['id']=_0x3a7767['id']||0x0;this[_0xff7a('0x0')]=_0x3a7767['name']||_0xff7a('0x1');this[_0xff7a('0x2')]=_0x3a7767[_0xff7a('0x2')]||_0xff7a('0x3');this['active']=_0x3a7767[_0xff7a('0x4')]||![];this[_0xff7a('0x5')]=_0x3a7767[_0xff7a('0x5')]||[];this['Smtp']=_0x3a7767[_0xff7a('0x6')]||[];}module['exports']=MailAccount; \ No newline at end of file +var _0x8142=['exports','lodash','name','key','SERV','active','Imap','Smtp'];(function(_0x41249e,_0x275d84){var _0x2bff48=function(_0x33a84d){while(--_0x33a84d){_0x41249e['push'](_0x41249e['shift']());}};_0x2bff48(++_0x275d84);}(_0x8142,0x131));var _0x2814=function(_0xa388a2,_0x40bde6){_0xa388a2=_0xa388a2-0x0;var _0x7ce7f6=_0x8142[_0xa388a2];return _0x7ce7f6;};'use strict';var _=require(_0x2814('0x0'));function MailAccount(_0x32a771){this['id']=_0x32a771['id']||0x0;this['name']=_0x32a771[_0x2814('0x1')]||'Service';this[_0x2814('0x2')]=_0x32a771[_0x2814('0x2')]||_0x2814('0x3');this[_0x2814('0x4')]=_0x32a771[_0x2814('0x4')]||![];this[_0x2814('0x5')]=_0x32a771[_0x2814('0x5')]||[];this[_0x2814('0x6')]=_0x32a771[_0x2814('0x6')]||[];}module[_0x2814('0x7')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index 9f95e7d..116b1b5 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 _0x359d=['prototype','mergeFromDatabase','initMailAccounts','length','isUndefined','merge','exports','lodash','mailAccounts','hasOwnProperty'];(function(_0x4b4568,_0x17ed10){var _0x4ba97a=function(_0x1567cb){while(--_0x1567cb){_0x4b4568['push'](_0x4b4568['shift']());}};_0x4ba97a(++_0x17ed10);}(_0x359d,0x6b));var _0xd359=function(_0x29e2af,_0x15e2b1){_0x29e2af=_0x29e2af-0x0;var _0x1ea06a=_0x359d[_0x29e2af];return _0x1ea06a;};'use strict';var _=require(_0xd359('0x0'));var MailAccount=require('../model/mailAccount');var Realtime=function(){this[_0xd359('0x1')]={};};function freeIsNotKey(_0x635f28,_0x27db60,_0x4eb9ab){var _0x35dbc6=_['mapKeys'](_0x635f28,function(_0x5a71a3,_0x4c1d3c){return _0x5a71a3[_0x4eb9ab];});for(var _0x183785 in _0x27db60){if(_0x27db60[_0xd359('0x2')](_0x183785)){if(!_0x35dbc6[_0x183785]){delete _0x27db60[_0x183785];}}}}Realtime[_0xd359('0x3')][_0xd359('0x4')]=function(_0x352578,_0x417c50){for(var _0x43ed01 in _0x417c50){if(_0x352578[_0xd359('0x2')](_0x43ed01)){_0x352578[_0x43ed01]=_0x417c50[_0x43ed01];}}};Realtime[_0xd359('0x3')][_0xd359('0x5')]=function(){var _0x27f9c5=this;return function(_0x3fe6f2){if(_0x3fe6f2){freeIsNotKey(_0x3fe6f2,_0x27f9c5[_0xd359('0x1')],'id');for(var _0x24b7c7=0x0,_0x22fa2d={},_0x465623={};_0x24b7c7<_0x3fe6f2[_0xd359('0x6')];_0x24b7c7+=0x1){_0x22fa2d=_0x3fe6f2[_0x24b7c7];if(_[_0xd359('0x7')](_0x27f9c5[_0xd359('0x1')][_0x22fa2d['id']])){_0x27f9c5['mailAccounts'][_0x22fa2d['id']]=new MailAccount(_0x22fa2d);}else{_[_0xd359('0x8')](_0x27f9c5['mailAccounts'][_0x22fa2d['id']],_0x22fa2d);}}}return _0x27f9c5[_0xd359('0x1')];};};module[_0xd359('0x9')]=Realtime; \ No newline at end of file +var _0xf886=['length','lodash','../model/mailAccount','mapKeys','hasOwnProperty','mergeFromDatabase','prototype','initMailAccounts','mailAccounts'];(function(_0x219e9b,_0x295d91){var _0x332e80=function(_0x567792){while(--_0x567792){_0x219e9b['push'](_0x219e9b['shift']());}};_0x332e80(++_0x295d91);}(_0xf886,0x17b));var _0x6f88=function(_0x18546c,_0x4daf94){_0x18546c=_0x18546c-0x0;var _0x46ef43=_0xf886[_0x18546c];return _0x46ef43;};'use strict';var _=require(_0x6f88('0x0'));var MailAccount=require(_0x6f88('0x1'));var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0x5323b6,_0x2f6f4c,_0x728cd2){var _0x310f78=_[_0x6f88('0x2')](_0x5323b6,function(_0x19adbe,_0x5282b9){return _0x19adbe[_0x728cd2];});for(var _0x1e86d1 in _0x2f6f4c){if(_0x2f6f4c[_0x6f88('0x3')](_0x1e86d1)){if(!_0x310f78[_0x1e86d1]){delete _0x2f6f4c[_0x1e86d1];}}}}Realtime['prototype'][_0x6f88('0x4')]=function(_0x53d45,_0x2c696f){for(var _0x5c6771 in _0x2c696f){if(_0x53d45[_0x6f88('0x3')](_0x5c6771)){_0x53d45[_0x5c6771]=_0x2c696f[_0x5c6771];}}};Realtime[_0x6f88('0x5')][_0x6f88('0x6')]=function(){var _0x5cdbc4=this;return function(_0x4082dc){if(_0x4082dc){freeIsNotKey(_0x4082dc,_0x5cdbc4[_0x6f88('0x7')],'id');for(var _0x13d604=0x0,_0x4d23d8={},_0x306d68={};_0x13d604<_0x4082dc[_0x6f88('0x8')];_0x13d604+=0x1){_0x4d23d8=_0x4082dc[_0x13d604];if(_['isUndefined'](_0x5cdbc4[_0x6f88('0x7')][_0x4d23d8['id']])){_0x5cdbc4[_0x6f88('0x7')][_0x4d23d8['id']]=new MailAccount(_0x4d23d8);}else{_['merge'](_0x5cdbc4[_0x6f88('0x7')][_0x4d23d8['id']],_0x4d23d8);}}}return _0x5cdbc4['mailAccounts'];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index be0b3f3..236ef67 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 _0x867e=['getMailAccount','notify','NotifyMailAccount','../client','getMailAccounts','Request','name','email','key','ListId','TemplateId','MailServerIn','Imap','MailServerOut','Smtp'];(function(_0x8a97a1,_0xaf1fdf){var _0x3daafa=function(_0x520cf5){while(--_0x520cf5){_0x8a97a1['push'](_0x8a97a1['shift']());}};_0x3daafa(++_0xaf1fdf);}(_0x867e,0x1c5));var _0xe867=function(_0xd945e8,_0x293e8f){_0xd945e8=_0xd945e8-0x0;var _0x385200=_0x867e[_0xd945e8];return _0x385200;};'use strict';var client=require(_0xe867('0x0'));exports[_0xe867('0x1')]=function(){return function(){return client[_0xe867('0x2')]('GetMailAccount',{'options':{'attributes':['id',_0xe867('0x3'),'service',_0xe867('0x4'),'active',_0xe867('0x5'),_0xe867('0x6'),_0xe867('0x7')],'raw':![],'include':[{'model':_0xe867('0x8'),'as':_0xe867('0x9')},{'model':_0xe867('0xa'),'as':_0xe867('0xb')}]},'log':_0xe867('0xc')});};};exports[_0xe867('0xd')]=function(_0x4f52f,_0x2a3cef){return client[_0xe867('0x2')](_0xe867('0xe'),{'account':{'id':_0x4f52f},'body':_0x2a3cef,'log':'NotifyMailAccount'});}; \ No newline at end of file +var _0xa1d2=['NotifyMailAccount','getMailAccounts','GetMailAccount','name','service','email','active','key','ListId','TemplateId','MailServerIn','MailServerOut','Smtp','getMailAccount','notify','Request'];(function(_0x3cd096,_0x116a5c){var _0x2e6df3=function(_0x42fc83){while(--_0x42fc83){_0x3cd096['push'](_0x3cd096['shift']());}};_0x2e6df3(++_0x116a5c);}(_0xa1d2,0x151));var _0x2a1d=function(_0x2655f1,_0x2bd462){_0x2655f1=_0x2655f1-0x0;var _0x4a492e=_0xa1d2[_0x2655f1];return _0x4a492e;};'use strict';var client=require('../client');exports[_0x2a1d('0x0')]=function(){return function(){return client['Request'](_0x2a1d('0x1'),{'options':{'attributes':['id',_0x2a1d('0x2'),_0x2a1d('0x3'),_0x2a1d('0x4'),_0x2a1d('0x5'),_0x2a1d('0x6'),_0x2a1d('0x7'),_0x2a1d('0x8')],'raw':![],'include':[{'model':_0x2a1d('0x9'),'as':'Imap'},{'model':_0x2a1d('0xa'),'as':_0x2a1d('0xb')}]},'log':_0x2a1d('0xc')});};};exports[_0x2a1d('0xd')]=function(_0x1ef91a,_0x3877e4){return client[_0x2a1d('0xe')](_0x2a1d('0xf'),{'account':{'id':_0x1ef91a},'body':_0x3877e4,'log':_0x2a1d('0xf')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 42202d0..d8e0edc 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 _0xf5c7=['../client','Request','loginMailFrequency','GetSettings'];(function(_0x4a5f6d,_0x1a6c58){var _0x1ee8c4=function(_0x2bd83b){while(--_0x2bd83b){_0x4a5f6d['push'](_0x4a5f6d['shift']());}};_0x1ee8c4(++_0x1a6c58);}(_0xf5c7,0x1ac));var _0x7f5c=function(_0x3a13cf,_0x478c62){_0x3a13cf=_0x3a13cf-0x0;var _0x4817c=_0xf5c7[_0x3a13cf];return _0x4817c;};'use strict';var client=require(_0x7f5c('0x0'));exports['getSettings']=function(){return client[_0x7f5c('0x1')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x7f5c('0x2')]},'log':_0x7f5c('0x3')});}; \ No newline at end of file +var _0x66b9=['../client','Request','loginMailFrequency'];(function(_0x19f55e,_0xd4ffc3){var _0x44cfee=function(_0x138a86){while(--_0x138a86){_0x19f55e['push'](_0x19f55e['shift']());}};_0x44cfee(++_0xd4ffc3);}(_0x66b9,0x135));var _0x966b=function(_0x532fae,_0x48fb05){_0x532fae=_0x532fae-0x0;var _0x37fbc9=_0x66b9[_0x532fae];return _0x37fbc9;};'use strict';var client=require(_0x966b('0x0'));exports['getSettings']=function(){return client[_0x966b('0x1')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x966b('0x2')]},'log':'GetSettings'});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index bff0c1b..487a38f 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(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});}; \ No newline at end of file +var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'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 c3adac9..762d4e1 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 _0xe319=['../../config/socketio','../../config/express','../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','lodash','http','express','sticky-session','ioredis','createServer','timeout','port','socket.io','websocket','redis','defaults','localhost','adapter','socket.io-redis','../../config/triggers','default'];(function(_0xbdf091,_0x35a06c){var _0x129fd5=function(_0x529abd){while(--_0x529abd){_0xbdf091['push'](_0xbdf091['shift']());}};_0x129fd5(++_0x35a06c);}(_0xe319,0xaf));var _0x9e31=function(_0x4c7238,_0x5af00b){_0x4c7238=_0x4c7238-0x0;var _0x168e6b=_0xe319[_0x4c7238];return _0x168e6b;};'use strict';var _=require(_0x9e31('0x0'));var http=require(_0x9e31('0x1'));var express=require(_0x9e31('0x2'));var sticky=require(_0x9e31('0x3'));var Redis=require(_0x9e31('0x4'));var config=require('../../config/environment');var app=express();var server=http[_0x9e31('0x5')](app);server[_0x9e31('0x6')]=0xdbba0;if(sticky['listen'](server,config[_0x9e31('0x7')])){var socketio=require(_0x9e31('0x8'))(server,{'transports':[_0x9e31('0x9'),'polling']});config[_0x9e31('0xa')]=_[_0x9e31('0xb')](config[_0x9e31('0xa')],{'host':_0x9e31('0xc'),'port':0x18eb});socketio[_0x9e31('0xd')](require(_0x9e31('0xe'))({'pubClient':new Redis(config[_0x9e31('0xa')]),'subClient':new Redis(config[_0x9e31('0xa')])}));require(_0x9e31('0xf'))[_0x9e31('0x10')]();require(_0x9e31('0x11'))[_0x9e31('0x10')](socketio);require(_0x9e31('0x12'))['default'](app);require(_0x9e31('0x13'))[_0x9e31('0x10')](app);}else{server[_0x9e31('0x14')](_0x9e31('0x15'),function(){console[_0x9e31('0x16')](_0x9e31('0x17'),config[_0x9e31('0x7')]);});}exports=module['exports']=app; \ No newline at end of file +var _0xaac1=['port','socket.io','websocket','redis','localhost','adapter','socket.io-redis','../../config/triggers','default','../../config/socketio','../../config/express','../../routes','once','listening','log','exports','lodash','http','express','sticky-session','ioredis','../../config/environment','createServer','listen'];(function(_0x9ba307,_0x570631){var _0x335d04=function(_0x3125d0){while(--_0x3125d0){_0x9ba307['push'](_0x9ba307['shift']());}};_0x335d04(++_0x570631);}(_0xaac1,0x1c0));var _0x1aac=function(_0x270aab,_0x30dbfa){_0x270aab=_0x270aab-0x0;var _0x3b4064=_0xaac1[_0x270aab];return _0x3b4064;};'use strict';var _=require(_0x1aac('0x0'));var http=require(_0x1aac('0x1'));var express=require(_0x1aac('0x2'));var sticky=require(_0x1aac('0x3'));var Redis=require(_0x1aac('0x4'));var config=require(_0x1aac('0x5'));var app=express();var server=http[_0x1aac('0x6')](app);server['timeout']=0xdbba0;if(sticky[_0x1aac('0x7')](server,config[_0x1aac('0x8')])){var socketio=require(_0x1aac('0x9'))(server,{'transports':[_0x1aac('0xa'),'polling']});config[_0x1aac('0xb')]=_['defaults'](config[_0x1aac('0xb')],{'host':_0x1aac('0xc'),'port':0x18eb});socketio[_0x1aac('0xd')](require(_0x1aac('0xe'))({'pubClient':new Redis(config[_0x1aac('0xb')]),'subClient':new Redis(config[_0x1aac('0xb')])}));require(_0x1aac('0xf'))[_0x1aac('0x10')]();require(_0x1aac('0x11'))[_0x1aac('0x10')](socketio);require(_0x1aac('0x12'))[_0x1aac('0x10')](app);require(_0x1aac('0x13'))[_0x1aac('0x10')](app);}else{server[_0x1aac('0x14')](_0x1aac('0x15'),function(){console[_0x1aac('0x16')]('Express\x20server\x20listening\x20on\x20port\x20%d!',config[_0x1aac('0x8')]);});}exports=module[_0x1aac('0x17')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index 33aa4fa..d279a6d 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 _0x94a5=['result','rpc','exports','jayson/promise','../../config/logger','client','http','Request','routing','error'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0x94a5,0x139));var _0x594a=function(_0x30e8b7,_0x5d8b02){_0x30e8b7=_0x30e8b7-0x0;var _0x47e83c=_0x94a5[_0x30e8b7];return _0x47e83c;};'use strict';var jayson=require(_0x594a('0x0'));var BPromise=require('bluebird');var logger=require(_0x594a('0x1'))('routing');var client=jayson[_0x594a('0x2')][_0x594a('0x3')]({'port':0x2329});client[_0x594a('0x4')]=function(_0x34c507,_0x45e833){return new BPromise(function(_0x1bb1d3,_0x2369c0){return client['request'](_0x34c507,_0x45e833)['then'](function(_0x111bf7){logger['debug']('rpc',_0x594a('0x5'),_0x34c507,_0x45e833,_0x111bf7);if(_0x111bf7[_0x594a('0x6')]){logger[_0x594a('0x6')]('rpc','routing',_0x34c507,_0x111bf7[_0x594a('0x6')]['message'],_0x45e833);return _0x2369c0(_0x111bf7['error']['message']);}else{return _0x1bb1d3(_0x111bf7[_0x594a('0x7')]);}})['catch'](function(_0x4e9cc6){logger[_0x594a('0x6')](_0x594a('0x8'),_0x594a('0x5'),_0x34c507,_0x4e9cc6,_0x45e833);return _0x2369c0(_0x4e9cc6);});});};module[_0x594a('0x9')]=client; \ No newline at end of file +var _0xfc4a=['routing','Request','request','debug','rpc','error','message','catch','exports','bluebird','../../config/logger'];(function(_0x117b1c,_0x4b02ae){var _0xa75073=function(_0x3dccc0){while(--_0x3dccc0){_0x117b1c['push'](_0x117b1c['shift']());}};_0xa75073(++_0x4b02ae);}(_0xfc4a,0x11c));var _0xafc4=function(_0x49ced3,_0x522155){_0x49ced3=_0x49ced3-0x0;var _0x58572b=_0xfc4a[_0x49ced3];return _0x58572b;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xafc4('0x0'));var logger=require(_0xafc4('0x1'))(_0xafc4('0x2'));var client=jayson['client']['http']({'port':0x2329});client[_0xafc4('0x3')]=function(_0x1eb5db,_0x4058ca){return new BPromise(function(_0x452d47,_0x33d6ee){return client[_0xafc4('0x4')](_0x1eb5db,_0x4058ca)['then'](function(_0x359c31){logger[_0xafc4('0x5')](_0xafc4('0x6'),_0xafc4('0x2'),_0x1eb5db,_0x4058ca,_0x359c31);if(_0x359c31[_0xafc4('0x7')]){logger[_0xafc4('0x7')](_0xafc4('0x6'),_0xafc4('0x2'),_0x1eb5db,_0x359c31['error']['message'],_0x4058ca);return _0x33d6ee(_0x359c31[_0xafc4('0x7')][_0xafc4('0x8')]);}else{return _0x452d47(_0x359c31['result']);}})[_0xafc4('0x9')](function(_0x258dbe){logger[_0xafc4('0x7')](_0xafc4('0x6'),_0xafc4('0x2'),_0x1eb5db,_0x258dbe,_0x4058ca);return _0x33d6ee(_0x258dbe);});});};module[_0xafc4('0xa')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 6391fc4..584d21c 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 _0x8da7=['getAgents','then','initAgents','getIntervals','initIntervals','getOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','listen','catch','log','./server','./realtime','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve'];(function(_0x6b985a,_0x42ef29){var _0x4be8c4=function(_0x331bf4){while(--_0x331bf4){_0x6b985a['push'](_0x6b985a['shift']());}};_0x4be8c4(++_0x42ef29);}(_0x8da7,0xfa));var _0x78da=function(_0x368ba4,_0x403dab){_0x368ba4=_0x368ba4-0x0;var _0x271d63=_0x8da7[_0x368ba4];return _0x271d63;};'use strict';var BPromise=require('bluebird');var server=require(_0x78da('0x0'));var Realtime=require(_0x78da('0x1'));var user=require('./rpc/user');var interval=require(_0x78da('0x2'));var openchannelQueue=require(_0x78da('0x3'));var chatQueue=require(_0x78da('0x4'));var smsQueue=require(_0x78da('0x5'));var mailQueue=require(_0x78da('0x6'));var faxQueue=require(_0x78da('0x7'));var whatsappQueue=require(_0x78da('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x78da('0x9')]()['then'](user[_0x78da('0xa')]())[_0x78da('0xb')](realtime[_0x78da('0xc')]())[_0x78da('0xb')](interval[_0x78da('0xd')]())[_0x78da('0xb')](realtime[_0x78da('0xe')]())[_0x78da('0xb')](openchannelQueue[_0x78da('0xf')]())[_0x78da('0xb')](realtime['initOpenchannelQueues']())['then'](chatQueue[_0x78da('0x10')]())[_0x78da('0xb')](realtime[_0x78da('0x11')]())[_0x78da('0xb')](smsQueue[_0x78da('0x12')]())[_0x78da('0xb')](realtime[_0x78da('0x13')]())[_0x78da('0xb')](mailQueue[_0x78da('0x14')]())[_0x78da('0xb')](realtime[_0x78da('0x15')]())[_0x78da('0xb')](faxQueue[_0x78da('0x16')]())['then'](realtime['initFaxQueues']())['then'](whatsappQueue['getWhatsappQueues']())['then'](realtime['initWhatsappQueues']())['then'](function(){return realtime;});}function main(){return server[_0x78da('0x17')](realtime)[_0x78da('0xb')](function(_0x105b76){return initRealtime();})[_0x78da('0xb')](function(_0xa77ff){return setInterval(initRealtime,0x1388);})[_0x78da('0x18')](function(_0x1d5a0f){console[_0x78da('0x19')](_0x1d5a0f);});}main(); \ No newline at end of file +var _0x4e8b=['./server','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','getAgents','initAgents','getIntervals','initIntervals','getOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues','initMailQueues','initFaxQueues','initWhatsappQueues','listen','catch','bluebird'];(function(_0x112030,_0x517d87){var _0x3754d0=function(_0x536435){while(--_0x536435){_0x112030['push'](_0x112030['shift']());}};_0x3754d0(++_0x517d87);}(_0x4e8b,0x1b9));var _0xb4e8=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x4e8b[_0x5c351c];return _0x26f3b3;};'use strict';var BPromise=require(_0xb4e8('0x0'));var server=require(_0xb4e8('0x1'));var Realtime=require('./realtime');var user=require(_0xb4e8('0x2'));var interval=require(_0xb4e8('0x3'));var openchannelQueue=require(_0xb4e8('0x4'));var chatQueue=require('./rpc/chatQueue');var smsQueue=require(_0xb4e8('0x5'));var mailQueue=require(_0xb4e8('0x6'));var faxQueue=require(_0xb4e8('0x7'));var whatsappQueue=require(_0xb4e8('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xb4e8('0x9')]()[_0xb4e8('0xa')](user[_0xb4e8('0xb')]())[_0xb4e8('0xa')](realtime[_0xb4e8('0xc')]())[_0xb4e8('0xa')](interval[_0xb4e8('0xd')]())[_0xb4e8('0xa')](realtime[_0xb4e8('0xe')]())['then'](openchannelQueue[_0xb4e8('0xf')]())[_0xb4e8('0xa')](realtime['initOpenchannelQueues']())[_0xb4e8('0xa')](chatQueue[_0xb4e8('0x10')]())[_0xb4e8('0xa')](realtime[_0xb4e8('0x11')]())[_0xb4e8('0xa')](smsQueue[_0xb4e8('0x12')]())[_0xb4e8('0xa')](realtime[_0xb4e8('0x13')]())[_0xb4e8('0xa')](mailQueue[_0xb4e8('0x14')]())[_0xb4e8('0xa')](realtime[_0xb4e8('0x15')]())[_0xb4e8('0xa')](faxQueue['getFaxQueues']())['then'](realtime[_0xb4e8('0x16')]())['then'](whatsappQueue['getWhatsappQueues']())[_0xb4e8('0xa')](realtime[_0xb4e8('0x17')]())[_0xb4e8('0xa')](function(){return realtime;});}function main(){return server[_0xb4e8('0x18')](realtime)['then'](function(_0xecb3d0){return initRealtime();})[_0xb4e8('0xa')](function(_0x475698){return setInterval(initRealtime,0x1388);})[_0xb4e8('0x19')](function(_0x3f8477){console['log'](_0x3f8477);});}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 d9d08c9..a739f1f 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 _0xe14b=['next','restart','condition','noop','findRules','matches','turn','length','prioritize','priority','toJSON','map','toString','fromJSON','isString','object','register','exports','lodash','util','isNil','ignoreFactChanges','inherits','prototype','init','rules','activeRules','isArray','concat','push','sync','filter','orderBy','asc','execute','result','clone','consequence','ruleRef','name','index_','nextTick','call'];(function(_0x33fdc8,_0x11dfc9){var _0x4479fe=function(_0x2cbccd){while(--_0x2cbccd){_0x33fdc8['push'](_0x33fdc8['shift']());}};_0x4479fe(++_0x11dfc9);}(_0xe14b,0x93));var _0xbe14=function(_0x24f1c1,_0x4b1296){_0x24f1c1=_0x24f1c1-0x0;var _0x55e0c2=_0xe14b[_0x24f1c1];return _0x55e0c2;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var EventEmitter=require('events')['EventEmitter'];function RuleEngine(_0x11c3a0,_0x36393a){this['init']();if(!_[_0xbe14('0x2')](_0x11c3a0)){this['register'](_0x11c3a0);}if(_0x36393a){this['ignoreFactChanges']=_0x36393a[_0xbe14('0x3')];}return this;}util[_0xbe14('0x4')](RuleEngine,EventEmitter);RuleEngine[_0xbe14('0x5')][_0xbe14('0x6')]=function(_0x1d9ade){this[_0xbe14('0x7')]=[];this[_0xbe14('0x8')]=[];};RuleEngine['prototype']['register']=function(_0x496063){if(Array[_0xbe14('0x9')](_0x496063)){this[_0xbe14('0x7')]=this[_0xbe14('0x7')][_0xbe14('0xa')](_0x496063);}else if(_0x496063!==null&&_['isObject'](_0x496063)){this['rules'][_0xbe14('0xb')](_0x496063);}this[_0xbe14('0xc')]();};RuleEngine['prototype'][_0xbe14('0xc')]=function(){this[_0xbe14('0x8')]=this[_0xbe14('0x7')][_0xbe14('0xd')](function(_0x27792f){if(_[_0xbe14('0x2')](_0x27792f['on'])){_0x27792f['on']=!![];}if(_0x27792f['on']===!![]){return _0x27792f;}});this[_0xbe14('0x8')]=_[_0xbe14('0xe')](this[_0xbe14('0x8')],['p'],[_0xbe14('0xf')]);};RuleEngine[_0xbe14('0x5')][_0xbe14('0x10')]=function(_0x813399,_0x530538){var _0x55b3a7=![];_0x813399[_0xbe14('0x11')]=!![];var _0x3dc4a9=_[_0xbe14('0x12')](_0x813399);var _0x37ce4e=_['clone'](_0x813399);var _0x21c789=this[_0xbe14('0x8')];var _0xfd7b8f=[];var _0x123ede=this[_0xbe14('0x3')];(function FnRuleLoop(_0x29ab73){var _0x17ae86={'rules':function(){return _0x21c789;},'rule':function(){return _0x21c789[_0x29ab73];},'when':function(_0x5ea1f8){if(_0x5ea1f8){var _0x137ee5=_0x21c789[_0x29ab73][_0xbe14('0x13')];_0x137ee5[_0xbe14('0x14')]=_0x21c789[_0x29ab73]['id']||_0x21c789[_0x29ab73][_0xbe14('0x15')]||_0xbe14('0x16')+_0x29ab73;process[_0xbe14('0x17')](function(){_0xfd7b8f['push'](_0x137ee5[_0xbe14('0x14')]);_0x137ee5[_0xbe14('0x18')](_0x3dc4a9,_0x17ae86);});}else{process[_0xbe14('0x17')](function(){_0x17ae86[_0xbe14('0x19')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x55b3a7=!![];return FnRuleLoop(0x0);},'next':function(_0x188ec4){if(!_0x123ede&&!_['isEqual'](_0x37ce4e,_0x3dc4a9)){_0x37ce4e=_[_0xbe14('0x12')](_0x3dc4a9);process['nextTick'](function(){_0x17ae86[_0xbe14('0x1a')]();});}else{process['nextTick'](function(){if(_[_0xbe14('0x2')](_0x188ec4)){return FnRuleLoop(_0x29ab73+0x1);}else{return FnRuleLoop(_0x188ec4);}});}}};if(_0x29ab73<_0x21c789['length']&&_0x55b3a7===![]){var _0x274018=_0x21c789[_0x29ab73][_0xbe14('0x1b')];_0x274018['call'](_0x3dc4a9,_0x17ae86);}else{process[_0xbe14('0x17')](function(){_0x3dc4a9['matchPath']=_0xfd7b8f;return _0x530538?_0x530538(_0x3dc4a9):_[_0xbe14('0x1c')]();});}}(0x0));};RuleEngine['prototype'][_0xbe14('0x1d')]=function(_0x5fa043){if(_[_0xbe14('0x2')](_0x5fa043)){return this[_0xbe14('0x7')];}else{var _0x15ef02=_[_0xbe14('0x1e')](_0x5fa043);return _['filter'](this[_0xbe14('0x7')],_0x15ef02);}};RuleEngine[_0xbe14('0x5')][_0xbe14('0x1f')]=function(_0x169369,_0x5dd475){var _0x16f884=_0x169369==='on'||_0x169369==='ON'?!![]:![];var _0x29fc64=this['findRules'](_0x5dd475);for(var _0x3c3613=0x0,_0x3b3e84=_0x29fc64[_0xbe14('0x20')];_0x3c3613<_0x3b3e84;_0x3c3613+=0x1){_0x29fc64[_0x3c3613]['on']=_0x16f884;}this[_0xbe14('0xc')]();};RuleEngine[_0xbe14('0x5')][_0xbe14('0x21')]=function(_0x31a664,_0x2b05cb){_0x31a664=parseInt(_0x31a664,0xa);var _0x4168c8=this[_0xbe14('0x1d')](_0x2b05cb);for(var _0x40538f=0x0,_0x3bf43c=_0x4168c8[_0xbe14('0x20')];_0x40538f<_0x3bf43c;_0x40538f+=0x1){_0x4168c8[_0x40538f][_0xbe14('0x22')]=_0x31a664;}this[_0xbe14('0xc')]();};RuleEngine[_0xbe14('0x5')][_0xbe14('0x23')]=function(){var _0x2ff48e=this[_0xbe14('0x7')];if(_0x2ff48e instanceof Array){_0x2ff48e=_0x2ff48e[_0xbe14('0x24')](function(_0x581e86){_0x581e86[_0xbe14('0x1b')]=_0x581e86['condition']['toString']();_0x581e86[_0xbe14('0x13')]=_0x581e86['consequence'][_0xbe14('0x25')]();return _0x581e86;});}else if(!_[_0xbe14('0x2')](_0x2ff48e)){_0x2ff48e['condition']=_0x2ff48e['condition']['toString']();_0x2ff48e[_0xbe14('0x13')]=_0x2ff48e[_0xbe14('0x13')]['toString']();}return _0x2ff48e;};RuleEngine[_0xbe14('0x5')][_0xbe14('0x26')]=function(_0x452635){this[_0xbe14('0x6')]();if(_[_0xbe14('0x27')](_0x452635)){_0x452635=JSON['parse'](_0x452635);}if(_0x452635 instanceof Array){_0x452635=_0x452635['map'](function(_0x15a997){_0x15a997['condition']=eval('('+_0x15a997['condition']+')');_0x15a997['consequence']=eval('('+_0x15a997[_0xbe14('0x13')]+')');return _0x15a997;});}else if(_0x452635!==null&&typeof _0x452635==_0xbe14('0x28')){_0x452635[_0xbe14('0x1b')]=eval('('+_0x452635[_0xbe14('0x1b')]+')');_0x452635[_0xbe14('0x13')]=eval('('+_0x452635[_0xbe14('0x13')]+')');}this[_0xbe14('0x29')](_0x452635);};module[_0xbe14('0x2a')]=RuleEngine; \ No newline at end of file +var _0x814b=['init','parse','map','object','lodash','util','events','EventEmitter','isNil','register','ignoreFactChanges','inherits','prototype','rules','isArray','concat','isObject','push','sync','filter','activeRules','orderBy','asc','execute','result','clone','name','ruleRef','call','next','isEqual','nextTick','restart','length','condition','matchPath','noop','findRules','matches','turn','prioritize','priority','toJSON','toString','consequence','fromJSON'];(function(_0x2b8f25,_0x494682){var _0xdb4d96=function(_0x1ea982){while(--_0x1ea982){_0x2b8f25['push'](_0x2b8f25['shift']());}};_0xdb4d96(++_0x494682);}(_0x814b,0x1a2));var _0xb814=function(_0x50bf5a,_0x807bba){_0x50bf5a=_0x50bf5a-0x0;var _0x4ddc1d=_0x814b[_0x50bf5a];return _0x4ddc1d;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var EventEmitter=require(_0xb814('0x2'))[_0xb814('0x3')];function RuleEngine(_0xfbb64b,_0x477725){this['init']();if(!_[_0xb814('0x4')](_0xfbb64b)){this[_0xb814('0x5')](_0xfbb64b);}if(_0x477725){this[_0xb814('0x6')]=_0x477725[_0xb814('0x6')];}return this;}util[_0xb814('0x7')](RuleEngine,EventEmitter);RuleEngine[_0xb814('0x8')]['init']=function(_0x3b0829){this[_0xb814('0x9')]=[];this['activeRules']=[];};RuleEngine[_0xb814('0x8')][_0xb814('0x5')]=function(_0x186d5a){if(Array[_0xb814('0xa')](_0x186d5a)){this[_0xb814('0x9')]=this[_0xb814('0x9')][_0xb814('0xb')](_0x186d5a);}else if(_0x186d5a!==null&&_[_0xb814('0xc')](_0x186d5a)){this[_0xb814('0x9')][_0xb814('0xd')](_0x186d5a);}this[_0xb814('0xe')]();};RuleEngine['prototype'][_0xb814('0xe')]=function(){this['activeRules']=this[_0xb814('0x9')][_0xb814('0xf')](function(_0x35b10d){if(_[_0xb814('0x4')](_0x35b10d['on'])){_0x35b10d['on']=!![];}if(_0x35b10d['on']===!![]){return _0x35b10d;}});this[_0xb814('0x10')]=_[_0xb814('0x11')](this[_0xb814('0x10')],['p'],[_0xb814('0x12')]);};RuleEngine[_0xb814('0x8')][_0xb814('0x13')]=function(_0x3f4881,_0x44fb96){var _0x17f5bd=![];_0x3f4881[_0xb814('0x14')]=!![];var _0x303aca=_[_0xb814('0x15')](_0x3f4881);var _0x45e0d0=_[_0xb814('0x15')](_0x3f4881);var _0x125ce2=this[_0xb814('0x10')];var _0x7a21ef=[];var _0x48c9df=this[_0xb814('0x6')];(function FnRuleLoop(_0x55ba16){var _0x270598={'rules':function(){return _0x125ce2;},'rule':function(){return _0x125ce2[_0x55ba16];},'when':function(_0xfac75b){if(_0xfac75b){var _0x4c3007=_0x125ce2[_0x55ba16]['consequence'];_0x4c3007['ruleRef']=_0x125ce2[_0x55ba16]['id']||_0x125ce2[_0x55ba16][_0xb814('0x16')]||'index_'+_0x55ba16;process['nextTick'](function(){_0x7a21ef[_0xb814('0xd')](_0x4c3007[_0xb814('0x17')]);_0x4c3007[_0xb814('0x18')](_0x303aca,_0x270598);});}else{process['nextTick'](function(){_0x270598[_0xb814('0x19')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x17f5bd=!![];return FnRuleLoop(0x0);},'next':function(_0x531032){if(!_0x48c9df&&!_[_0xb814('0x1a')](_0x45e0d0,_0x303aca)){_0x45e0d0=_[_0xb814('0x15')](_0x303aca);process[_0xb814('0x1b')](function(){_0x270598[_0xb814('0x1c')]();});}else{process[_0xb814('0x1b')](function(){if(_[_0xb814('0x4')](_0x531032)){return FnRuleLoop(_0x55ba16+0x1);}else{return FnRuleLoop(_0x531032);}});}}};if(_0x55ba16<_0x125ce2[_0xb814('0x1d')]&&_0x17f5bd===![]){var _0x594470=_0x125ce2[_0x55ba16][_0xb814('0x1e')];_0x594470['call'](_0x303aca,_0x270598);}else{process[_0xb814('0x1b')](function(){_0x303aca[_0xb814('0x1f')]=_0x7a21ef;return _0x44fb96?_0x44fb96(_0x303aca):_[_0xb814('0x20')]();});}}(0x0));};RuleEngine[_0xb814('0x8')][_0xb814('0x21')]=function(_0xb9e57d){if(_[_0xb814('0x4')](_0xb9e57d)){return this['rules'];}else{var _0x392222=_[_0xb814('0x22')](_0xb9e57d);return _[_0xb814('0xf')](this[_0xb814('0x9')],_0x392222);}};RuleEngine[_0xb814('0x8')][_0xb814('0x23')]=function(_0x3f0150,_0x1e4e89){var _0x5a6291=_0x3f0150==='on'||_0x3f0150==='ON'?!![]:![];var _0x271aa8=this[_0xb814('0x21')](_0x1e4e89);for(var _0x52ed64=0x0,_0x9008b2=_0x271aa8[_0xb814('0x1d')];_0x52ed64<_0x9008b2;_0x52ed64+=0x1){_0x271aa8[_0x52ed64]['on']=_0x5a6291;}this[_0xb814('0xe')]();};RuleEngine['prototype'][_0xb814('0x24')]=function(_0x2051d0,_0x58c3ca){_0x2051d0=parseInt(_0x2051d0,0xa);var _0x338a28=this['findRules'](_0x58c3ca);for(var _0x6efe9a=0x0,_0x5f3e9b=_0x338a28['length'];_0x6efe9a<_0x5f3e9b;_0x6efe9a+=0x1){_0x338a28[_0x6efe9a][_0xb814('0x25')]=_0x2051d0;}this['sync']();};RuleEngine[_0xb814('0x8')][_0xb814('0x26')]=function(){var _0x2b91bd=this['rules'];if(_0x2b91bd instanceof Array){_0x2b91bd=_0x2b91bd['map'](function(_0x26d3a9){_0x26d3a9[_0xb814('0x1e')]=_0x26d3a9['condition'][_0xb814('0x27')]();_0x26d3a9[_0xb814('0x28')]=_0x26d3a9[_0xb814('0x28')][_0xb814('0x27')]();return _0x26d3a9;});}else if(!_[_0xb814('0x4')](_0x2b91bd)){_0x2b91bd[_0xb814('0x1e')]=_0x2b91bd[_0xb814('0x1e')]['toString']();_0x2b91bd[_0xb814('0x28')]=_0x2b91bd[_0xb814('0x28')][_0xb814('0x27')]();}return _0x2b91bd;};RuleEngine[_0xb814('0x8')][_0xb814('0x29')]=function(_0x4ff31a){this[_0xb814('0x2a')]();if(_['isString'](_0x4ff31a)){_0x4ff31a=JSON[_0xb814('0x2b')](_0x4ff31a);}if(_0x4ff31a instanceof Array){_0x4ff31a=_0x4ff31a[_0xb814('0x2c')](function(_0xe0f509){_0xe0f509['condition']=eval('('+_0xe0f509[_0xb814('0x1e')]+')');_0xe0f509[_0xb814('0x28')]=eval('('+_0xe0f509['consequence']+')');return _0xe0f509;});}else if(_0x4ff31a!==null&&typeof _0x4ff31a==_0xb814('0x2d')){_0x4ff31a[_0xb814('0x1e')]=eval('('+_0x4ff31a[_0xb814('0x1e')]+')');_0x4ff31a[_0xb814('0x28')]=eval('('+_0x4ff31a[_0xb814('0x28')]+')');}this[_0xb814('0x5')](_0x4ff31a);};module['exports']=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 571d8cd..374e8b2 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 _0x7120=['error','message','result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','then'];(function(_0x556509,_0x125907){var _0x1e2ad5=function(_0xe00439){while(--_0xe00439){_0x556509['push'](_0x556509['shift']());}};_0x1e2ad5(++_0x125907);}(_0x7120,0x14a));var _0x0712=function(_0x4495d6,_0x28b28c){_0x4495d6=_0x4495d6-0x0;var _0x14428e=_0x7120[_0x4495d6];return _0x14428e;};'use strict';var BPromise=require(_0x0712('0x0'));var jayson=require(_0x0712('0x1'));var client=jayson[_0x0712('0x2')][_0x0712('0x3')]({'port':0x232b});function request(_0x2c83ad,_0x2525ac){return new BPromise(function(_0x21f4e9,_0x44a32d){return client[_0x0712('0x4')](_0x2c83ad,_0x2525ac)[_0x0712('0x5')](function(_0x18491d){if(_0x18491d['error']){return _0x44a32d(_0x18491d[_0x0712('0x6')][_0x0712('0x7')]);}else{return _0x21f4e9(_0x18491d[_0x0712('0x8')]);}})[_0x0712('0x9')](function(_0x25d6ba){return _0x44a32d(_0x25d6ba);});});}exports[_0x0712('0xa')]=function(_0x237824,_0x36176e){return request(_0x0712('0xb'),{'account':_0x237824,'message':_0x36176e});}; \ No newline at end of file +var _0x8260=['http','request','then','error','message','catch','sendMailMessage','SendMail','bluebird','client'];(function(_0x51db9d,_0x41161d){var _0x31f08b=function(_0x5c189a){while(--_0x5c189a){_0x51db9d['push'](_0x51db9d['shift']());}};_0x31f08b(++_0x41161d);}(_0x8260,0x1e8));var _0x0826=function(_0x2847d0,_0x10a787){_0x2847d0=_0x2847d0-0x0;var _0x1cc209=_0x8260[_0x2847d0];return _0x1cc209;};'use strict';var BPromise=require(_0x0826('0x0'));var jayson=require('jayson/promise');var client=jayson[_0x0826('0x1')][_0x0826('0x2')]({'port':0x232b});function request(_0x4553be,_0x2c1f05){return new BPromise(function(_0x42364f,_0x678569){return client[_0x0826('0x3')](_0x4553be,_0x2c1f05)[_0x0826('0x4')](function(_0x3a3f3c){if(_0x3a3f3c[_0x0826('0x5')]){return _0x678569(_0x3a3f3c[_0x0826('0x5')][_0x0826('0x6')]);}else{return _0x42364f(_0x3a3f3c['result']);}})[_0x0826('0x7')](function(_0x30411c){return _0x678569(_0x30411c);});});}exports[_0x0826('0x8')]=function(_0x11908c,_0x399026){return request(_0x0826('0x9'),{'account':_0x11908c,'message':_0x399026});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 5008683..a6faa10 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 _0x7996=['openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','updateRealtime','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','prototype','mail','chat','openchannel','fax','sms','whatsapp','length','Status','StatusTime','format','faxStatus','smsStatus','whatsappCurrentCapacity','busyQueue','stringify','emit','user:save','moment','md5','ioredis','../../../config/environment','redis','defaults','localhost','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatusTime','smsCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','openchannelStatus'];(function(_0x358f2e,_0x847fd7){var _0x8707ad=function(_0x1b5f99){while(--_0x1b5f99){_0x358f2e['push'](_0x358f2e['shift']());}};_0x8707ad(++_0x847fd7);}(_0x7996,0x14d));var _0x6799=function(_0x27a3cb,_0x4af597){_0x27a3cb=_0x27a3cb-0x0;var _0x54ff38=_0x7996[_0x27a3cb];return _0x54ff38;};'use strict';var _=require('lodash');var moment=require(_0x6799('0x0'));var md5=require(_0x6799('0x1'));var Redis=require(_0x6799('0x2'));var config=require(_0x6799('0x3'));config[_0x6799('0x4')]=_[_0x6799('0x5')](config[_0x6799('0x4')],{'host':_0x6799('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x6799('0x4')]));function Agent(_0x5b1fe6){this['id']=_0x5b1fe6['id']||0x0;this[_0x6799('0x7')]=_0x5b1fe6['name']||'';this[_0x6799('0x8')]=_0x5b1fe6['online']||!![];this[_0x6799('0x9')]=_0x5b1fe6[_0x6799('0x9')]||![];this[_0x6799('0xa')]=_0x5b1fe6[_0x6799('0xa')]||![];this[_0x6799('0xb')]=_0x5b1fe6[_0x6799('0xb')]||![];this[_0x6799('0xc')]=_0x5b1fe6['faxPause']||![];this[_0x6799('0xd')]=_0x5b1fe6['smsPause']||![];this[_0x6799('0xe')]=_0x5b1fe6['openchannelPause']||![];this[_0x6799('0xf')]=_0x6799('0x10');this[_0x6799('0x11')]=0x0;this[_0x6799('0x12')]=_0x5b1fe6[_0x6799('0x12')]||0x0;this[_0x6799('0x13')]=0x0;this[_0x6799('0x14')]=_0x6799('0x10');this[_0x6799('0x15')]=0x0;this[_0x6799('0x16')]=_0x5b1fe6[_0x6799('0x16')]||0x0;this[_0x6799('0x17')]=0x0;this['faxStatus']=_0x6799('0x10');this[_0x6799('0x18')]=0x0;this[_0x6799('0x19')]=_0x5b1fe6[_0x6799('0x19')]||0x0;this[_0x6799('0x1a')]=0x0;this['smsStatus']=_0x6799('0x10');this[_0x6799('0x1b')]=0x0;this[_0x6799('0x1c')]=_0x5b1fe6[_0x6799('0x1c')]||0x0;this['smsCurrentCapacity']=0x0;this[_0x6799('0x1d')]=_0x6799('0x10');this[_0x6799('0x1e')]=0x0;this[_0x6799('0x1f')]=_0x5b1fe6['whatsappCapacity']||0x0;this['whatsappCurrentCapacity']=0x0;this[_0x6799('0x20')]=_0x6799('0x10');this[_0x6799('0x21')]=0x0;this['openchannelCapacity']=_0x5b1fe6[_0x6799('0x22')]||0x0;this[_0x6799('0x23')]=0x0;this[_0x6799('0x24')]=![];this['busyQueue']=undefined;this[_0x6799('0x1')]='';this[_0x6799('0x25')]();}Agent['prototype'][_0x6799('0x26')]=function(_0x3f2e71){if(this[_0x3f2e71+_0x6799('0x27')]>0x0){if(this[_0x3f2e71+_0x6799('0x28')]>0x0&&this[_0x3f2e71+_0x6799('0x27')]>=this[_0x3f2e71+_0x6799('0x28')]){return _0x6799('0x29');}else{return _0x6799('0x2a');}}else{return'idle';}};Agent[_0x6799('0x2b')]['updateRealtime']=function(){var _0x219fae=[_0x6799('0x2c'),_0x6799('0x2d'),_0x6799('0x2e'),_0x6799('0x2f'),_0x6799('0x30'),_0x6799('0x31')];for(var _0x44bdb0=0x0;_0x44bdb0<_0x219fae[_0x6799('0x32')];_0x44bdb0+=0x1){var _0x166dd2=this['getChannelStatus'](_0x219fae[_0x44bdb0]);if(this[_0x219fae[_0x44bdb0]+_0x6799('0x33')]!==_0x166dd2){this[_0x219fae[_0x44bdb0]+_0x6799('0x34')]=_['toNumber'](moment()[_0x6799('0x35')]('x'));}this[_0x219fae[_0x44bdb0]+_0x6799('0x33')]=_0x166dd2;}var _0xa03314={'id':this['id'],'name':this[_0x6799('0x7')],'online':this[_0x6799('0x8')],'voicePause':this[_0x6799('0x9')],'chatPause':this['chatPause'],'mailPause':this[_0x6799('0xb')],'smsPause':this[_0x6799('0xd')],'faxPause':this[_0x6799('0xc')],'openchannelPause':this[_0x6799('0xe')],'chatStatus':this[_0x6799('0xf')],'chatStatusTime':this[_0x6799('0x11')],'chatCapacity':this[_0x6799('0x12')],'chatCurrentCapacity':this[_0x6799('0x13')],'mailStatus':this[_0x6799('0x14')],'mailStatusTime':this[_0x6799('0x15')],'mailCapacity':this[_0x6799('0x16')],'mailCurrentCapacity':this[_0x6799('0x17')],'faxStatus':this[_0x6799('0x36')],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0x6799('0x1a')],'smsStatus':this[_0x6799('0x37')],'smsStatusTime':this[_0x6799('0x1b')],'smsCapacity':this[_0x6799('0x1c')],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this[_0x6799('0x1d')],'whatsappStatusTime':this['whatsappStatusTime'],'whatsappCapacity':this[_0x6799('0x1f')],'whatsappCurrentCapacity':this[_0x6799('0x38')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0x6799('0x21')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this[_0x6799('0x23')],'busy':this[_0x6799('0x24')],'busyQueue':this[_0x6799('0x39')]};var _0xe80ca7=md5(JSON[_0x6799('0x3a')](_0xa03314));if(this[_0x6799('0x1')]!==_0xe80ca7){this[_0x6799('0x1')]=_0xe80ca7;io[_0x6799('0x3b')](_0x6799('0x3c'),_0xa03314);}};module['exports']=Agent; \ No newline at end of file +var _0xcf7e=['socket.io-emitter','name','online','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatusTime','mailCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','idle','mail','chat','openchannel','fax','whatsapp','length','Status','toNumber','format','voicePause','mailCurrentCapacity','smsStatus','emit','user:save','exports','md5','ioredis','../../../config/environment','defaults','redis'];(function(_0x1df6d5,_0x3d9b53){var _0x227597=function(_0x43f5e2){while(--_0x43f5e2){_0x1df6d5['push'](_0x1df6d5['shift']());}};_0x227597(++_0x3d9b53);}(_0xcf7e,0xaf));var _0xecf7=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xcf7e[_0x1035c1];return _0x308d67;};'use strict';var _=require('lodash');var moment=require('moment');var md5=require(_0xecf7('0x0'));var Redis=require(_0xecf7('0x1'));var config=require(_0xecf7('0x2'));config['redis']=_[_0xecf7('0x3')](config[_0xecf7('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0xecf7('0x5'))(new Redis(config[_0xecf7('0x4')]));function Agent(_0x535aa0){this['id']=_0x535aa0['id']||0x0;this[_0xecf7('0x6')]=_0x535aa0['name']||'';this[_0xecf7('0x7')]=_0x535aa0[_0xecf7('0x7')]||!![];this['voicePause']=_0x535aa0['voicePause']||![];this[_0xecf7('0x8')]=_0x535aa0['chatPause']||![];this[_0xecf7('0x9')]=_0x535aa0[_0xecf7('0x9')]||![];this[_0xecf7('0xa')]=_0x535aa0[_0xecf7('0xa')]||![];this[_0xecf7('0xb')]=_0x535aa0[_0xecf7('0xb')]||![];this[_0xecf7('0xc')]=_0x535aa0['openchannelPause']||![];this[_0xecf7('0xd')]=_0xecf7('0xe');this[_0xecf7('0xf')]=0x0;this[_0xecf7('0x10')]=_0x535aa0[_0xecf7('0x10')]||0x0;this[_0xecf7('0x11')]=0x0;this['mailStatus']='unknown';this[_0xecf7('0x12')]=0x0;this[_0xecf7('0x13')]=_0x535aa0[_0xecf7('0x13')]||0x0;this['mailCurrentCapacity']=0x0;this[_0xecf7('0x14')]='unknown';this[_0xecf7('0x15')]=0x0;this[_0xecf7('0x16')]=_0x535aa0['faxCapacity']||0x0;this[_0xecf7('0x17')]=0x0;this['smsStatus']='unknown';this[_0xecf7('0x18')]=0x0;this[_0xecf7('0x19')]=_0x535aa0[_0xecf7('0x19')]||0x0;this[_0xecf7('0x1a')]=0x0;this[_0xecf7('0x1b')]='unknown';this[_0xecf7('0x1c')]=0x0;this['whatsappCapacity']=_0x535aa0[_0xecf7('0x1d')]||0x0;this[_0xecf7('0x1e')]=0x0;this[_0xecf7('0x1f')]=_0xecf7('0xe');this[_0xecf7('0x20')]=0x0;this[_0xecf7('0x21')]=_0x535aa0[_0xecf7('0x21')]||0x0;this[_0xecf7('0x22')]=0x0;this[_0xecf7('0x23')]=![];this[_0xecf7('0x24')]=undefined;this[_0xecf7('0x0')]='';this[_0xecf7('0x25')]();}Agent[_0xecf7('0x26')][_0xecf7('0x27')]=function(_0x50e6ac){if(this[_0x50e6ac+'CurrentCapacity']>0x0){if(this[_0x50e6ac+'Capacity']>0x0&&this[_0x50e6ac+_0xecf7('0x28')]>=this[_0x50e6ac+_0xecf7('0x29')]){return _0xecf7('0x2a');}else{return _0xecf7('0x2b');}}else{return _0xecf7('0x2c');}};Agent[_0xecf7('0x26')][_0xecf7('0x25')]=function(){var _0x5579a6=[_0xecf7('0x2d'),_0xecf7('0x2e'),_0xecf7('0x2f'),_0xecf7('0x30'),'sms',_0xecf7('0x31')];for(var _0x118ab0=0x0;_0x118ab0<_0x5579a6[_0xecf7('0x32')];_0x118ab0+=0x1){var _0x183119=this[_0xecf7('0x27')](_0x5579a6[_0x118ab0]);if(this[_0x5579a6[_0x118ab0]+_0xecf7('0x33')]!==_0x183119){this[_0x5579a6[_0x118ab0]+'StatusTime']=_[_0xecf7('0x34')](moment()[_0xecf7('0x35')]('x'));}this[_0x5579a6[_0x118ab0]+_0xecf7('0x33')]=_0x183119;}var _0x567bf8={'id':this['id'],'name':this['name'],'online':this[_0xecf7('0x7')],'voicePause':this[_0xecf7('0x36')],'chatPause':this[_0xecf7('0x8')],'mailPause':this[_0xecf7('0x9')],'smsPause':this['smsPause'],'faxPause':this[_0xecf7('0xa')],'openchannelPause':this[_0xecf7('0xc')],'chatStatus':this['chatStatus'],'chatStatusTime':this[_0xecf7('0xf')],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this['mailStatus'],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this[_0xecf7('0x37')],'faxStatus':this[_0xecf7('0x14')],'faxStatusTime':this[_0xecf7('0x15')],'faxCapacity':this[_0xecf7('0x16')],'faxCurrentCapacity':this[_0xecf7('0x17')],'smsStatus':this[_0xecf7('0x38')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this[_0xecf7('0x1c')],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this[_0xecf7('0x1e')],'openchannelStatus':this[_0xecf7('0x1f')],'openchannelStatusTime':this[_0xecf7('0x20')],'openchannelCapacity':this[_0xecf7('0x21')],'openchannelCurrentCapacity':this[_0xecf7('0x22')],'busy':this[_0xecf7('0x23')],'busyQueue':this[_0xecf7('0x24')]};var _0x3c360c=md5(JSON['stringify'](_0x567bf8));if(this['md5']!==_0x3c360c){this[_0xecf7('0x0')]=_0x3c360c;io[_0xecf7('0x39')](_0xecf7('0x3a'),_0x567bf8);}};module[_0xecf7('0x3b')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index bc7fbfd..fe27215 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 _0xd81c=['_rr','map','prototype','paused','length','online','loggedIn','chatPause','available','stringify','format','emit','chat_queue:save','exports','md5','ioredis','redis','localhost','name','timeout','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime'];(function(_0xe10c3e,_0x336f40){var _0x5608e1=function(_0x3e8e27){while(--_0x3e8e27){_0xe10c3e['push'](_0xe10c3e['shift']());}};_0x5608e1(++_0x336f40);}(_0xd81c,0xaa));var _0xcd81=function(_0x1d3973,_0x42fa0c){_0x1d3973=_0x1d3973-0x0;var _0xd30a7a=_0xd81c[_0x1d3973];return _0xd30a7a;};'use strict';var _=require('lodash');var md5=require(_0xcd81('0x0'));var util=require('util');var Redis=require(_0xcd81('0x1'));var config=require('../../../config/environment');config[_0xcd81('0x2')]=_['defaults'](config['redis'],{'host':_0xcd81('0x3'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xcd81('0x2')]));function ChatQueue(_0x4a498b){this['id']=_0x4a498b['id']||0x0;this[_0xcd81('0x4')]=_0x4a498b[_0xcd81('0x4')]||'';this[_0xcd81('0x5')]=_0x4a498b[_0xcd81('0x5')]||0xa;this['strategy']=_0x4a498b['strategy']||_0xcd81('0x6');this[_0xcd81('0x7')]=_0x4a498b[_0xcd81('0x7')];this[_0xcd81('0x8')]={};this[_0xcd81('0x9')]=0x0;this['md5']='';this[_0xcd81('0xa')]();this[_0xcd81('0xb')]();}ChatQueue['prototype'][_0xcd81('0xa')]=function(){var _0x1fff0c=this[_0xcd81('0x8')][_0xcd81('0xc')];this[_0xcd81('0x8')]=_[_0xcd81('0xd')](this[_0xcd81('0x7')],'id');this[_0xcd81('0x8')][_0xcd81('0xc')]=_0x1fff0c;};ChatQueue[_0xcd81('0xe')][_0xcd81('0xb')]=function(){this['loggedIn']=0x0;this[_0xcd81('0xf')]=0x0;for(var _0x8dd410=0x0;_0x8dd410=0x0?this[_0xcd81('0x14')]:0x0;var _0x2ae069={'id':this['id'],'available':this[_0xcd81('0x14')],'loggedIn':this['loggedIn'],'name':this[_0xcd81('0x4')],'paused':this[_0xcd81('0xf')],'waiting':this[_0xcd81('0x9')]};var _0x384df4=md5(JSON[_0xcd81('0x15')](_0x2ae069));if(this[_0xcd81('0x0')]!==_0x384df4){this[_0xcd81('0x0')]=_0x384df4;io['to'](util[_0xcd81('0x16')]('chat:queue:%s',_0x2ae069[_0xcd81('0x4')]))[_0xcd81('0x17')](_0xcd81('0x18'),_0x2ae069);}};module[_0xcd81('0x19')]=ChatQueue; \ No newline at end of file +var _0xc25a=['prototype','loggedIn','length','online','chatPause','paused','available','stringify','format','emit','chat_queue:save','exports','md5','ioredis','../../../config/environment','redis','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','map'];(function(_0x25b78d,_0x347586){var _0x3d04f5=function(_0x1c0c81){while(--_0x1c0c81){_0x25b78d['push'](_0x25b78d['shift']());}};_0x3d04f5(++_0x347586);}(_0xc25a,0x15c));var _0xac25=function(_0x1da527,_0x2dc953){_0x1da527=_0x1da527-0x0;var _0x40fc7c=_0xc25a[_0x1da527];return _0x40fc7c;};'use strict';var _=require('lodash');var md5=require(_0xac25('0x0'));var util=require('util');var Redis=require(_0xac25('0x1'));var config=require(_0xac25('0x2'));config[_0xac25('0x3')]=_['defaults'](config[_0xac25('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0xac25('0x4'))(new Redis(config['redis']));function ChatQueue(_0x20c811){this['id']=_0x20c811['id']||0x0;this[_0xac25('0x5')]=_0x20c811[_0xac25('0x5')]||'';this[_0xac25('0x6')]=_0x20c811[_0xac25('0x6')]||0xa;this[_0xac25('0x7')]=_0x20c811['strategy']||_0xac25('0x8');this[_0xac25('0x9')]=_0x20c811[_0xac25('0x9')];this[_0xac25('0xa')]={};this[_0xac25('0xb')]=0x0;this[_0xac25('0x0')]='';this[_0xac25('0xc')]();this[_0xac25('0xd')]();}ChatQueue['prototype'][_0xac25('0xc')]=function(){var _0x10e7ed=this[_0xac25('0xa')][_0xac25('0xe')];this[_0xac25('0xa')]=_[_0xac25('0xf')](this[_0xac25('0x9')],'id');this['mapAgentsId'][_0xac25('0xe')]=_0x10e7ed;};ChatQueue[_0xac25('0x10')][_0xac25('0xd')]=function(){this[_0xac25('0x11')]=0x0;this['paused']=0x0;for(var _0x369d2f=0x0;_0x369d2f=0x0?this[_0xac25('0x16')]:0x0;var _0x43d12e={'id':this['id'],'available':this['available'],'loggedIn':this[_0xac25('0x11')],'name':this[_0xac25('0x5')],'paused':this[_0xac25('0x15')],'waiting':this[_0xac25('0xb')]};var _0x3f70ae=md5(JSON[_0xac25('0x17')](_0x43d12e));if(this[_0xac25('0x0')]!==_0x3f70ae){this[_0xac25('0x0')]=_0x3f70ae;io['to'](util[_0xac25('0x18')]('chat:queue:%s',_0x43d12e[_0xac25('0x5')]))[_0xac25('0x19')](_0xac25('0x1a'),_0x43d12e);}};module[_0xac25('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 296adcf..1735b73 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 _0xaab9=['map','loggedIn','faxPause','paused','available','stringify','format','emit','fax_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype'];(function(_0x4ecef4,_0x3a4db0){var _0x11f0a8=function(_0x5fed0e){while(--_0x5fed0e){_0x4ecef4['push'](_0x4ecef4['shift']());}};_0x11f0a8(++_0x3a4db0);}(_0xaab9,0xf3));var _0x9aab=function(_0x2bc642,_0x14ebe4){_0x2bc642=_0x2bc642-0x0;var _0x403c20=_0xaab9[_0x2bc642];return _0x403c20;};'use strict';var _=require(_0x9aab('0x0'));var md5=require(_0x9aab('0x1'));var util=require(_0x9aab('0x2'));var Redis=require(_0x9aab('0x3'));var config=require(_0x9aab('0x4'));config[_0x9aab('0x5')]=_[_0x9aab('0x6')](config[_0x9aab('0x5')],{'host':_0x9aab('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9aab('0x5')]));function FaxQueue(_0x5e2ad4){this['id']=_0x5e2ad4['id']||0x0;this[_0x9aab('0x8')]=_0x5e2ad4['name']||'';this[_0x9aab('0x9')]=_0x5e2ad4['timeout']||0xa;this[_0x9aab('0xa')]=_0x5e2ad4[_0x9aab('0xa')]||'beepall';this[_0x9aab('0xb')]=_0x5e2ad4[_0x9aab('0xb')];this[_0x9aab('0xc')]={};this[_0x9aab('0xd')]=0x0;this['md5']='';this[_0x9aab('0xe')]();this[_0x9aab('0xf')]();}FaxQueue[_0x9aab('0x10')]['updateRouting']=function(){var _0x4c4e54=this[_0x9aab('0xc')]['_rr'];this[_0x9aab('0xc')]=_[_0x9aab('0x11')](this[_0x9aab('0xb')],'id');this['mapAgentsId']['_rr']=_0x4c4e54;};FaxQueue[_0x9aab('0x10')][_0x9aab('0xf')]=function(){this[_0x9aab('0x12')]=0x0;this['paused']=0x0;for(var _0x4cb23b=0x0;_0x4cb23b=0x0?this[_0x9aab('0x15')]:0x0;var _0x394161={'id':this['id'],'available':this[_0x9aab('0x15')],'loggedIn':this[_0x9aab('0x12')],'name':this[_0x9aab('0x8')],'paused':this[_0x9aab('0x14')],'waiting':this['waiting']};var _0x4342f3=md5(JSON[_0x9aab('0x16')](_0x394161));if(this['md5']!==_0x4342f3){this[_0x9aab('0x1')]=_0x4342f3;io['to'](util[_0x9aab('0x17')]('fax:queue:%s',_0x394161[_0x9aab('0x8')]))[_0x9aab('0x18')](_0x9aab('0x19'),_0x394161);}};module['exports']=FaxQueue; \ No newline at end of file +var _0x0181=['format','emit','exports','lodash','md5','util','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','map','_rr','length','online','faxPause','paused','available','loggedIn','waiting'];(function(_0x3d0366,_0x50211a){var _0x5ce75e=function(_0xc70777){while(--_0xc70777){_0x3d0366['push'](_0x3d0366['shift']());}};_0x5ce75e(++_0x50211a);}(_0x0181,0x6f));var _0x1018=function(_0x265aa2,_0x220072){_0x265aa2=_0x265aa2-0x0;var _0x447a3a=_0x0181[_0x265aa2];return _0x447a3a;};'use strict';var _=require(_0x1018('0x0'));var md5=require(_0x1018('0x1'));var util=require(_0x1018('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x1018('0x3')]=_['defaults'](config[_0x1018('0x3')],{'host':_0x1018('0x4'),'port':0x18eb});var io=require(_0x1018('0x5'))(new Redis(config['redis']));function FaxQueue(_0x55625c){this['id']=_0x55625c['id']||0x0;this['name']=_0x55625c[_0x1018('0x6')]||'';this[_0x1018('0x7')]=_0x55625c[_0x1018('0x7')]||0xa;this[_0x1018('0x8')]=_0x55625c['strategy']||_0x1018('0x9');this[_0x1018('0xa')]=_0x55625c[_0x1018('0xa')];this[_0x1018('0xb')]={};this['waiting']=0x0;this[_0x1018('0x1')]='';this[_0x1018('0xc')]();this[_0x1018('0xd')]();}FaxQueue[_0x1018('0xe')]['updateRouting']=function(){var _0x1dac70=this['mapAgentsId']['_rr'];this['mapAgentsId']=_[_0x1018('0xf')](this[_0x1018('0xa')],'id');this[_0x1018('0xb')][_0x1018('0x10')]=_0x1dac70;};FaxQueue[_0x1018('0xe')][_0x1018('0xd')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x40b3eb=0x0;_0x40b3eb=0x0?this[_0x1018('0x15')]:0x0;var _0x3ae8b6={'id':this['id'],'available':this[_0x1018('0x15')],'loggedIn':this[_0x1018('0x16')],'name':this['name'],'paused':this[_0x1018('0x14')],'waiting':this[_0x1018('0x17')]};var _0x73b62e=md5(JSON['stringify'](_0x3ae8b6));if(this[_0x1018('0x1')]!==_0x73b62e){this[_0x1018('0x1')]=_0x73b62e;io['to'](util[_0x1018('0x18')]('fax:queue:%s',_0x3ae8b6['name']))[_0x1018('0x19')]('fax_queue:save',_0x3ae8b6);}};module[_0x1018('0x1a')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index d21c920..41c417f 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 _0x68c7=['name','Intervals','exports'];(function(_0x45e6cd,_0x29242a){var _0x36c489=function(_0x41a8e4){while(--_0x41a8e4){_0x45e6cd['push'](_0x45e6cd['shift']());}};_0x36c489(++_0x29242a);}(_0x68c7,0x1a7));var _0x768c=function(_0x31675b,_0x3b8236){_0x31675b=_0x31675b-0x0;var _0x33c84f=_0x68c7[_0x31675b];return _0x33c84f;};'use strict';function Interval(_0x2a404d){this['id']=_0x2a404d['id']||0x0;this[_0x768c('0x0')]=_0x2a404d[_0x768c('0x0')]||'';this['Intervals']=_0x2a404d[_0x768c('0x1')]||{};}module[_0x768c('0x2')]=Interval; \ No newline at end of file +var _0x5e3a=['name','Intervals'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x5e3a,0xd2));var _0xa5e3=function(_0x2c9cb7,_0xca7d5b){_0x2c9cb7=_0x2c9cb7-0x0;var _0x123110=_0x5e3a[_0x2c9cb7];return _0x123110;};'use strict';function Interval(_0xf6f679){this['id']=_0xf6f679['id']||0x0;this['name']=_0xf6f679[_0xa5e3('0x0')]||'';this[_0xa5e3('0x1')]=_0xf6f679[_0xa5e3('0x1')]||{};}module['exports']=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index 23f9229..843ac6c 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 _0x5f4f=['mail_queue:save','exports','lodash','util','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRouting','prototype','_rr','map','updateRealtime','paused','length','online','loggedIn','available','stringify','format','mail:queue:%s','emit'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x5f4f,0x157));var _0xf5f4=function(_0x22cc16,_0x1f4fa2){_0x22cc16=_0x22cc16-0x0;var _0x399b70=_0x5f4f[_0x22cc16];return _0x399b70;};'use strict';var _=require(_0xf5f4('0x0'));var md5=require('md5');var util=require(_0xf5f4('0x1'));var Redis=require(_0xf5f4('0x2'));var config=require(_0xf5f4('0x3'));config[_0xf5f4('0x4')]=_[_0xf5f4('0x5')](config[_0xf5f4('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0xf5f4('0x6'))(new Redis(config['redis']));function MailQueue(_0x5383f8){this['id']=_0x5383f8['id']||0x0;this['name']=_0x5383f8[_0xf5f4('0x7')]||'';this[_0xf5f4('0x8')]=_0x5383f8['timeout']||0xa;this[_0xf5f4('0x9')]=_0x5383f8[_0xf5f4('0x9')]||_0xf5f4('0xa');this[_0xf5f4('0xb')]=_0x5383f8[_0xf5f4('0xb')];this[_0xf5f4('0xc')]={};this[_0xf5f4('0xd')]=0x0;this[_0xf5f4('0xe')]='';this[_0xf5f4('0xf')]();this['updateRealtime']();}MailQueue[_0xf5f4('0x10')][_0xf5f4('0xf')]=function(){var _0x5cc9c6=this[_0xf5f4('0xc')][_0xf5f4('0x11')];this['mapAgentsId']=_[_0xf5f4('0x12')](this[_0xf5f4('0xb')],'id');this[_0xf5f4('0xc')][_0xf5f4('0x11')]=_0x5cc9c6;};MailQueue[_0xf5f4('0x10')][_0xf5f4('0x13')]=function(){this['loggedIn']=0x0;this[_0xf5f4('0x14')]=0x0;for(var _0x826bd2=0x0;_0x826bd2=0x0?this['available']:0x0;var _0x235057={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0xf5f4('0x7')],'paused':this[_0xf5f4('0x14')],'waiting':this[_0xf5f4('0xd')]};var _0x1d8c9f=md5(JSON[_0xf5f4('0x19')](_0x235057));if(this[_0xf5f4('0xe')]!==_0x1d8c9f){this['md5']=_0x1d8c9f;io['to'](util[_0xf5f4('0x1a')](_0xf5f4('0x1b'),_0x235057[_0xf5f4('0x7')]))[_0xf5f4('0x1c')](_0xf5f4('0x1d'),_0x235057);}};module[_0xf5f4('0x1e')]=MailQueue; \ No newline at end of file +var _0xc28b=['strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','prototype','map','loggedIn','length','available','paused','stringify','format','emit','mail_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout'];(function(_0x400016,_0x216c78){var _0x2679ec=function(_0x46882c){while(--_0x46882c){_0x400016['push'](_0x400016['shift']());}};_0x2679ec(++_0x216c78);}(_0xc28b,0x11f));var _0xbc28=function(_0x19077e,_0x1ae7cd){_0x19077e=_0x19077e-0x0;var _0x440fc3=_0xc28b[_0x19077e];return _0x440fc3;};'use strict';var _=require(_0xbc28('0x0'));var md5=require(_0xbc28('0x1'));var util=require('util');var Redis=require(_0xbc28('0x2'));var config=require(_0xbc28('0x3'));config[_0xbc28('0x4')]=_[_0xbc28('0x5')](config[_0xbc28('0x4')],{'host':_0xbc28('0x6'),'port':0x18eb});var io=require(_0xbc28('0x7'))(new Redis(config[_0xbc28('0x4')]));function MailQueue(_0x58212b){this['id']=_0x58212b['id']||0x0;this['name']=_0x58212b[_0xbc28('0x8')]||'';this['timeout']=_0x58212b[_0xbc28('0x9')]||0xa;this[_0xbc28('0xa')]=_0x58212b['strategy']||_0xbc28('0xb');this[_0xbc28('0xc')]=_0x58212b[_0xbc28('0xc')];this[_0xbc28('0xd')]={};this[_0xbc28('0xe')]=0x0;this[_0xbc28('0x1')]='';this[_0xbc28('0xf')]();this['updateRealtime']();}MailQueue[_0xbc28('0x10')][_0xbc28('0xf')]=function(){var _0x3a4827=this['mapAgentsId']['_rr'];this['mapAgentsId']=_[_0xbc28('0x11')](this[_0xbc28('0xc')],'id');this[_0xbc28('0xd')]['_rr']=_0x3a4827;};MailQueue['prototype']['updateRealtime']=function(){this[_0xbc28('0x12')]=0x0;this['paused']=0x0;for(var _0x34a897=0x0;_0x34a897=0x0?this[_0xbc28('0x14')]:0x0;var _0x139af0={'id':this['id'],'available':this[_0xbc28('0x14')],'loggedIn':this['loggedIn'],'name':this[_0xbc28('0x8')],'paused':this['paused'],'waiting':this[_0xbc28('0xe')]};var _0x152118=md5(JSON[_0xbc28('0x16')](_0x139af0));if(this[_0xbc28('0x1')]!==_0x152118){this[_0xbc28('0x1')]=_0x152118;io['to'](util[_0xbc28('0x17')]('mail:queue:%s',_0x139af0[_0xbc28('0x8')]))[_0xbc28('0x18')](_0xbc28('0x19'),_0x139af0);}};module[_0xbc28('0x1a')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 8214f6d..a390254 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 _0x5fc3=['format','openchannel:queue:%s','name','emit','openchannel_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','prototype','loggedIn','paused','openchannelPause','available'];(function(_0x4fc756,_0x5969c9){var _0x6b1861=function(_0x1d76e7){while(--_0x1d76e7){_0x4fc756['push'](_0x4fc756['shift']());}};_0x6b1861(++_0x5969c9);}(_0x5fc3,0xa8));var _0x35fc=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x5fc3[_0x273c39];return _0x46d6b5;};'use strict';var _=require(_0x35fc('0x0'));var md5=require(_0x35fc('0x1'));var util=require('util');var Redis=require(_0x35fc('0x2'));var config=require(_0x35fc('0x3'));config[_0x35fc('0x4')]=_[_0x35fc('0x5')](config[_0x35fc('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x35fc('0x6'))(new Redis(config[_0x35fc('0x4')]));function OpenchannelQueue(_0x186a06){this['id']=_0x186a06['id']||0x0;this['name']=_0x186a06['name']||'';this[_0x35fc('0x7')]=_0x186a06['timeout']||0xa;this[_0x35fc('0x8')]=_0x186a06[_0x35fc('0x8')]||_0x35fc('0x9');this[_0x35fc('0xa')]=_0x186a06[_0x35fc('0xa')];this[_0x35fc('0xb')]={};this[_0x35fc('0xc')]=0x0;this['md5']='';this[_0x35fc('0xd')]();this[_0x35fc('0xe')]();}OpenchannelQueue['prototype'][_0x35fc('0xd')]=function(){var _0x33f491=this['mapAgentsId'][_0x35fc('0xf')];this[_0x35fc('0xb')]=_['map'](this['Agents'],'id');this[_0x35fc('0xb')]['_rr']=_0x33f491;};OpenchannelQueue[_0x35fc('0x10')][_0x35fc('0xe')]=function(){this[_0x35fc('0x11')]=0x0;this[_0x35fc('0x12')]=0x0;for(var _0x38d9f2=0x0;_0x38d9f2=0x0?this['available']:0x0;var _0x41e165={'id':this['id'],'available':this[_0x35fc('0x14')],'loggedIn':this[_0x35fc('0x11')],'name':this['name'],'paused':this[_0x35fc('0x12')],'waiting':this[_0x35fc('0xc')]};var _0x465eb3=md5(JSON['stringify'](_0x41e165));if(this[_0x35fc('0x1')]!==_0x465eb3){this[_0x35fc('0x1')]=_0x465eb3;io['to'](util[_0x35fc('0x15')](_0x35fc('0x16'),_0x41e165[_0x35fc('0x17')]))[_0x35fc('0x18')](_0x35fc('0x19'),_0x41e165);}};module[_0x35fc('0x1a')]=OpenchannelQueue; \ No newline at end of file +var _0xc4aa=['strategy','Agents','mapAgentsId','updateRouting','updateRealtime','map','_rr','prototype','loggedIn','paused','length','online','available','waiting','stringify','format','openchannel:queue:%s','emit','openchannel_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','socket.io-emitter','name','timeout'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0xc4aa,0x1b7));var _0xac4a=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0xc4aa[_0xa148b7];return _0x51efd3;};'use strict';var _=require(_0xac4a('0x0'));var md5=require(_0xac4a('0x1'));var util=require(_0xac4a('0x2'));var Redis=require(_0xac4a('0x3'));var config=require(_0xac4a('0x4'));config[_0xac4a('0x5')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xac4a('0x6'))(new Redis(config[_0xac4a('0x5')]));function OpenchannelQueue(_0x730a38){this['id']=_0x730a38['id']||0x0;this[_0xac4a('0x7')]=_0x730a38[_0xac4a('0x7')]||'';this[_0xac4a('0x8')]=_0x730a38[_0xac4a('0x8')]||0xa;this[_0xac4a('0x9')]=_0x730a38['strategy']||'beepall';this[_0xac4a('0xa')]=_0x730a38[_0xac4a('0xa')];this[_0xac4a('0xb')]={};this['waiting']=0x0;this[_0xac4a('0x1')]='';this[_0xac4a('0xc')]();this[_0xac4a('0xd')]();}OpenchannelQueue['prototype'][_0xac4a('0xc')]=function(){var _0x488e3c=this[_0xac4a('0xb')]['_rr'];this[_0xac4a('0xb')]=_[_0xac4a('0xe')](this[_0xac4a('0xa')],'id');this['mapAgentsId'][_0xac4a('0xf')]=_0x488e3c;};OpenchannelQueue[_0xac4a('0x10')][_0xac4a('0xd')]=function(){this[_0xac4a('0x11')]=0x0;this[_0xac4a('0x12')]=0x0;for(var _0x3b71c0=0x0;_0x3b71c0=0x0?this[_0xac4a('0x15')]:0x0;var _0x44ec59={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0xac4a('0x7')],'paused':this[_0xac4a('0x12')],'waiting':this[_0xac4a('0x16')]};var _0x4d837c=md5(JSON[_0xac4a('0x17')](_0x44ec59));if(this[_0xac4a('0x1')]!==_0x4d837c){this[_0xac4a('0x1')]=_0x4d837c;io['to'](util[_0xac4a('0x18')](_0xac4a('0x19'),_0x44ec59[_0xac4a('0x7')]))[_0xac4a('0x1a')](_0xac4a('0x1b'),_0x44ec59);}};module['exports']=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index 26ab46d..a933e20 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 _0xb0b9=['localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','md5','updateRouting','prototype','map','updateRealtime','length','online','loggedIn','smsPause','paused','available','format','emit','sms_queue:save','exports','lodash','ioredis','../../../config/environment','redis','defaults'];(function(_0x3acee8,_0x5f3924){var _0x5046cc=function(_0x338def){while(--_0x338def){_0x3acee8['push'](_0x3acee8['shift']());}};_0x5046cc(++_0x5f3924);}(_0xb0b9,0x1f3));var _0x9b0b=function(_0x3a96c5,_0xf7eee3){_0x3a96c5=_0x3a96c5-0x0;var _0x42da29=_0xb0b9[_0x3a96c5];return _0x42da29;};'use strict';var _=require(_0x9b0b('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0x9b0b('0x1'));var config=require(_0x9b0b('0x2'));config[_0x9b0b('0x3')]=_[_0x9b0b('0x4')](config[_0x9b0b('0x3')],{'host':_0x9b0b('0x5'),'port':0x18eb});var io=require(_0x9b0b('0x6'))(new Redis(config[_0x9b0b('0x3')]));function SmsQueue(_0x2b89dc){this['id']=_0x2b89dc['id']||0x0;this[_0x9b0b('0x7')]=_0x2b89dc[_0x9b0b('0x7')]||'';this[_0x9b0b('0x8')]=_0x2b89dc[_0x9b0b('0x8')]||0xa;this[_0x9b0b('0x9')]=_0x2b89dc['strategy']||'beepall';this[_0x9b0b('0xa')]=_0x2b89dc[_0x9b0b('0xa')];this[_0x9b0b('0xb')]={};this[_0x9b0b('0xc')]=0x0;this[_0x9b0b('0xd')]='';this[_0x9b0b('0xe')]();this['updateRealtime']();}SmsQueue[_0x9b0b('0xf')][_0x9b0b('0xe')]=function(){var _0x2ae7a2=this[_0x9b0b('0xb')]['_rr'];this['mapAgentsId']=_[_0x9b0b('0x10')](this['Agents'],'id');this[_0x9b0b('0xb')]['_rr']=_0x2ae7a2;};SmsQueue[_0x9b0b('0xf')][_0x9b0b('0x11')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x5f0555=0x0;_0x5f0555=0x0?this[_0x9b0b('0x17')]:0x0;var _0x3f2733={'id':this['id'],'available':this[_0x9b0b('0x17')],'loggedIn':this[_0x9b0b('0x14')],'name':this['name'],'paused':this[_0x9b0b('0x16')],'waiting':this[_0x9b0b('0xc')]};var _0x7cf37c=md5(JSON['stringify'](_0x3f2733));if(this[_0x9b0b('0xd')]!==_0x7cf37c){this[_0x9b0b('0xd')]=_0x7cf37c;io['to'](util[_0x9b0b('0x18')]('sms:queue:%s',_0x3f2733[_0x9b0b('0x7')]))[_0x9b0b('0x19')](_0x9b0b('0x1a'),_0x3f2733);}};module[_0x9b0b('0x1b')]=SmsQueue; \ No newline at end of file +var _0x5636=['stringify','format','sms:queue:%s','emit','sms_queue:save','exports','lodash','md5','redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','_rr','map','prototype','paused','length','online','smsPause','available','waiting'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0x5636,0x102));var _0x6563=function(_0x40bad2,_0x2c4d52){_0x40bad2=_0x40bad2-0x0;var _0x451eee=_0x5636[_0x40bad2];return _0x451eee;};'use strict';var _=require(_0x6563('0x0'));var md5=require(_0x6563('0x1'));var util=require('util');var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x6563('0x2')]=_[_0x6563('0x3')](config[_0x6563('0x2')],{'host':'localhost','port':0x18eb});var io=require(_0x6563('0x4'))(new Redis(config[_0x6563('0x2')]));function SmsQueue(_0x453da9){this['id']=_0x453da9['id']||0x0;this[_0x6563('0x5')]=_0x453da9[_0x6563('0x5')]||'';this[_0x6563('0x6')]=_0x453da9[_0x6563('0x6')]||0xa;this[_0x6563('0x7')]=_0x453da9[_0x6563('0x7')]||_0x6563('0x8');this[_0x6563('0x9')]=_0x453da9[_0x6563('0x9')];this[_0x6563('0xa')]={};this['waiting']=0x0;this['md5']='';this[_0x6563('0xb')]();this[_0x6563('0xc')]();}SmsQueue['prototype']['updateRouting']=function(){var _0x5da960=this[_0x6563('0xa')][_0x6563('0xd')];this[_0x6563('0xa')]=_[_0x6563('0xe')](this[_0x6563('0x9')],'id');this[_0x6563('0xa')][_0x6563('0xd')]=_0x5da960;};SmsQueue[_0x6563('0xf')][_0x6563('0xc')]=function(){this['loggedIn']=0x0;this[_0x6563('0x10')]=0x0;for(var _0x5e9329=0x0;_0x5e9329=0x0?this['available']:0x0;var _0x14c6a6={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0x6563('0x5')],'paused':this[_0x6563('0x10')],'waiting':this[_0x6563('0x15')]};var _0x37f493=md5(JSON[_0x6563('0x16')](_0x14c6a6));if(this[_0x6563('0x1')]!==_0x37f493){this[_0x6563('0x1')]=_0x37f493;io['to'](util[_0x6563('0x17')](_0x6563('0x18'),_0x14c6a6['name']))[_0x6563('0x19')](_0x6563('0x1a'),_0x14c6a6);}};module[_0x6563('0x1b')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 4abf0c9..da5d7c5 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 _0xe1f4=['mapAgentsId','map','paused','length','online','loggedIn','available','stringify','format','whatsapp:queue:%s','emit','whatsapp_queue:save','lodash','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','md5','updateRouting','updateRealtime','prototype','_rr'];(function(_0x895e19,_0xe7f8c3){var _0x3c7a5e=function(_0x11acd4){while(--_0x11acd4){_0x895e19['push'](_0x895e19['shift']());}};_0x3c7a5e(++_0xe7f8c3);}(_0xe1f4,0x180));var _0x4e1f=function(_0x541f6e,_0x4d0c81){_0x541f6e=_0x541f6e-0x0;var _0x3ee0db=_0xe1f4[_0x541f6e];return _0x3ee0db;};'use strict';var _=require(_0x4e1f('0x0'));var md5=require('md5');var util=require(_0x4e1f('0x1'));var Redis=require(_0x4e1f('0x2'));var config=require(_0x4e1f('0x3'));config[_0x4e1f('0x4')]=_[_0x4e1f('0x5')](config[_0x4e1f('0x4')],{'host':_0x4e1f('0x6'),'port':0x18eb});var io=require(_0x4e1f('0x7'))(new Redis(config[_0x4e1f('0x4')]));function WhatsappQueue(_0x1b8bd8){this['id']=_0x1b8bd8['id']||0x0;this['name']=_0x1b8bd8[_0x4e1f('0x8')]||'';this[_0x4e1f('0x9')]=_0x1b8bd8[_0x4e1f('0x9')]||0xa;this[_0x4e1f('0xa')]=_0x1b8bd8[_0x4e1f('0xa')]||_0x4e1f('0xb');this[_0x4e1f('0xc')]=_0x1b8bd8[_0x4e1f('0xc')];this['mapAgentsId']={};this[_0x4e1f('0xd')]=0x0;this[_0x4e1f('0xe')]='';this[_0x4e1f('0xf')]();this[_0x4e1f('0x10')]();}WhatsappQueue[_0x4e1f('0x11')][_0x4e1f('0xf')]=function(){var _0x2840c7=this['mapAgentsId'][_0x4e1f('0x12')];this[_0x4e1f('0x13')]=_[_0x4e1f('0x14')](this[_0x4e1f('0xc')],'id');this['mapAgentsId'][_0x4e1f('0x12')]=_0x2840c7;};WhatsappQueue['prototype'][_0x4e1f('0x10')]=function(){this['loggedIn']=0x0;this[_0x4e1f('0x15')]=0x0;for(var _0x533c13=0x0;_0x533c13=0x0?this[_0x4e1f('0x19')]:0x0;var _0x3219bc={'id':this['id'],'available':this[_0x4e1f('0x19')],'loggedIn':this[_0x4e1f('0x18')],'name':this['name'],'paused':this[_0x4e1f('0x15')],'waiting':this[_0x4e1f('0xd')]};var _0x2e5413=md5(JSON[_0x4e1f('0x1a')](_0x3219bc));if(this[_0x4e1f('0xe')]!==_0x2e5413){this[_0x4e1f('0xe')]=_0x2e5413;io['to'](util[_0x4e1f('0x1b')](_0x4e1f('0x1c'),_0x3219bc['name']))[_0x4e1f('0x1d')](_0x4e1f('0x1e'),_0x3219bc);}};module['exports']=WhatsappQueue; \ No newline at end of file +var _0x2350=['loggedIn','paused','length','whatsappPause','available','stringify','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','lodash','md5','util','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','Agents','mapAgentsId','updateRouting','updateRealtime','map','_rr','prototype'];(function(_0x1f5fa0,_0x3c182d){var _0x17e40d=function(_0x15dfa6){while(--_0x15dfa6){_0x1f5fa0['push'](_0x1f5fa0['shift']());}};_0x17e40d(++_0x3c182d);}(_0x2350,0x133));var _0x0235=function(_0x5192de,_0x4e91cd){_0x5192de=_0x5192de-0x0;var _0x4e287e=_0x2350[_0x5192de];return _0x4e287e;};'use strict';var _=require(_0x0235('0x0'));var md5=require(_0x0235('0x1'));var util=require(_0x0235('0x2'));var Redis=require(_0x0235('0x3'));var config=require('../../../config/environment');config[_0x0235('0x4')]=_[_0x0235('0x5')](config[_0x0235('0x4')],{'host':_0x0235('0x6'),'port':0x18eb});var io=require(_0x0235('0x7'))(new Redis(config[_0x0235('0x4')]));function WhatsappQueue(_0x460b30){this['id']=_0x460b30['id']||0x0;this[_0x0235('0x8')]=_0x460b30[_0x0235('0x8')]||'';this['timeout']=_0x460b30[_0x0235('0x9')]||0xa;this['strategy']=_0x460b30['strategy']||'beepall';this[_0x0235('0xa')]=_0x460b30[_0x0235('0xa')];this[_0x0235('0xb')]={};this['waiting']=0x0;this[_0x0235('0x1')]='';this[_0x0235('0xc')]();this[_0x0235('0xd')]();}WhatsappQueue['prototype']['updateRouting']=function(){var _0x3b95ac=this[_0x0235('0xb')]['_rr'];this[_0x0235('0xb')]=_[_0x0235('0xe')](this[_0x0235('0xa')],'id');this[_0x0235('0xb')][_0x0235('0xf')]=_0x3b95ac;};WhatsappQueue[_0x0235('0x10')][_0x0235('0xd')]=function(){this[_0x0235('0x11')]=0x0;this[_0x0235('0x12')]=0x0;for(var _0x4fc353=0x0;_0x4fc353=0x0?this[_0x0235('0x15')]:0x0;var _0x18a4d4={'id':this['id'],'available':this['available'],'loggedIn':this[_0x0235('0x11')],'name':this[_0x0235('0x8')],'paused':this[_0x0235('0x12')],'waiting':this['waiting']};var _0x325168=md5(JSON[_0x0235('0x16')](_0x18a4d4));if(this['md5']!==_0x325168){this[_0x0235('0x1')]=_0x325168;io['to'](util['format'](_0x0235('0x17'),_0x18a4d4[_0x0235('0x8')]))[_0x0235('0x18')](_0x0235('0x19'),_0x18a4d4);}};module[_0x0235('0x1a')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 9909bd9..f31d3d3 100644 --- a/server/services/routing/realtime/index.js +++ b/server/services/routing/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file +var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xa9e0[_0x4709c0];return _0x13348b;};'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 9e5b91d..4000a8f 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 _0xe742=['addTagsToChatInteraction','../client','update','Request','UpdateChatInteraction','updateChatInteraction','addTags','AddTagsToChatInteraction'];(function(_0x36d28d,_0x5a9e25){var _0x361848=function(_0x569326){while(--_0x569326){_0x36d28d['push'](_0x36d28d['shift']());}};_0x361848(++_0x5a9e25);}(_0xe742,0x1c9));var _0x2e74=function(_0x4bddff,_0x51d2c6){_0x4bddff=_0x4bddff-0x0;var _0x22415f=_0xe742[_0x4bddff];return _0x22415f;};'use strict';var client=require(_0x2e74('0x0'));exports[_0x2e74('0x1')]=function(_0x3876e4,_0x8a8570){return client[_0x2e74('0x2')](_0x2e74('0x3'),{'body':_0x8a8570,'options':{'where':{'id':_0x3876e4}},'log':_0x2e74('0x4')});};exports[_0x2e74('0x5')]=function(_0x244baa,_0x50715c){return client['Request'](_0x2e74('0x6'),{'body':_0x50715c,'options':{'where':{'id':_0x244baa}},'log':_0x2e74('0x7')});}; \ No newline at end of file +var _0x9b29=['addTags','addTagsToChatInteraction','../client','update','Request','UpdateChatInteraction','updateChatInteraction'];(function(_0x2fd396,_0x15e495){var _0x2a4be2=function(_0x11c873){while(--_0x11c873){_0x2fd396['push'](_0x2fd396['shift']());}};_0x2a4be2(++_0x15e495);}(_0x9b29,0x1e5));var _0x99b2=function(_0x125145,_0x2154fd){_0x125145=_0x125145-0x0;var _0x5191ea=_0x9b29[_0x125145];return _0x5191ea;};'use strict';var client=require(_0x99b2('0x0'));exports[_0x99b2('0x1')]=function(_0x1d5c08,_0x52414b){return client[_0x99b2('0x2')](_0x99b2('0x3'),{'body':_0x52414b,'options':{'where':{'id':_0x1d5c08}},'log':_0x99b2('0x4')});};exports[_0x99b2('0x5')]=function(_0xe63a59,_0x4a5873){return client[_0x99b2('0x2')]('AddTagsToChatInteraction',{'body':_0x4a5873,'options':{'where':{'id':_0xe63a59}},'log':_0x99b2('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 0283f8d..5ade43d 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 _0x05c5=['CreateChatMessage','Request'];(function(_0x1830ce,_0x305798){var _0x2bce9f=function(_0x9ea7dc){while(--_0x9ea7dc){_0x1830ce['push'](_0x1830ce['shift']());}};_0x2bce9f(++_0x305798);}(_0x05c5,0x183));var _0x505c=function(_0x171bef,_0x4cba08){_0x171bef=_0x171bef-0x0;var _0x28828a=_0x05c5[_0x171bef];return _0x28828a;};'use strict';var client=require('../client');exports['create']=function(_0x258fec){return client[_0x505c('0x0')](_0x505c('0x1'),{'body':_0x258fec,'log':'createChatMessage'});}; \ No newline at end of file +var _0x158e=['CreateChatMessage','../client','Request'];(function(_0x4e7987,_0x2b665b){var _0x153cbe=function(_0x579a4d){while(--_0x579a4d){_0x4e7987['push'](_0x4e7987['shift']());}};_0x153cbe(++_0x2b665b);}(_0x158e,0xf7));var _0xe158=function(_0x7b5ee,_0x3d76c5){_0x7b5ee=_0x7b5ee-0x0;var _0x329085=_0x158e[_0x7b5ee];return _0x329085;};'use strict';var client=require(_0xe158('0x0'));exports['create']=function(_0x3ddb8a){return client[_0xe158('0x1')](_0xe158('0x2'),{'body':_0x3ddb8a,'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 bec5c04..575d8db 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 _0xe8f7=['getChatQueues','../client','Request','GetChatQueue','name','timeout','strategy','User','Agents','chatPause'];(function(_0x28ec22,_0x426685){var _0xabd1bf=function(_0x563e83){while(--_0x563e83){_0x28ec22['push'](_0x28ec22['shift']());}};_0xabd1bf(++_0x426685);}(_0xe8f7,0x137));var _0x7e8f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe8f7[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x7e8f('0x0'));exports['getChatQueues']=function(){return function(){return client[_0x7e8f('0x1')](_0x7e8f('0x2'),{'options':{'raw':![],'attributes':['id',_0x7e8f('0x3'),_0x7e8f('0x4'),_0x7e8f('0x5')],'include':[{'model':_0x7e8f('0x6'),'as':_0x7e8f('0x7'),'attributes':['id','name','online',_0x7e8f('0x8')]}]},'log':_0x7e8f('0x9')});};}; \ No newline at end of file +var _0xfb82=['timeout','User','Agents','online','chatPause','../client','getChatQueues','Request','name'];(function(_0x3b5685,_0x5d5060){var _0x192312=function(_0x519d95){while(--_0x519d95){_0x3b5685['push'](_0x3b5685['shift']());}};_0x192312(++_0x5d5060);}(_0xfb82,0x17f));var _0x2fb8=function(_0x176815,_0x3bd94a){_0x176815=_0x176815-0x0;var _0x573475=_0xfb82[_0x176815];return _0x573475;};'use strict';var client=require(_0x2fb8('0x0'));exports[_0x2fb8('0x1')]=function(){return function(){return client[_0x2fb8('0x2')]('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0x2fb8('0x3'),_0x2fb8('0x4'),'strategy'],'include':[{'model':_0x2fb8('0x5'),'as':_0x2fb8('0x6'),'attributes':['id',_0x2fb8('0x3'),_0x2fb8('0x7'),_0x2fb8('0x8')]}]},'log':_0x2fb8('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 9c5888a..0b4854d 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 _0xcb81=['../client','create','Request','UpdateChatQueueReport','DESC'];(function(_0x14cf75,_0x1e6552){var _0x64ec6a=function(_0x35968a){while(--_0x35968a){_0x14cf75['push'](_0x14cf75['shift']());}};_0x64ec6a(++_0x1e6552);}(_0xcb81,0x154));var _0x1cb8=function(_0x493a51,_0x45128c){_0x493a51=_0x493a51-0x0;var _0xc85756=_0xcb81[_0x493a51];return _0xc85756;};'use strict';var client=require(_0x1cb8('0x0'));exports[_0x1cb8('0x1')]=function(_0x5081c6){return client[_0x1cb8('0x2')]('CreateChatQueueReport',{'body':_0x5081c6,'log':'CreateChatQueueReport'});};exports['update']=function(_0x38c3ea,_0x33a8f2){return client[_0x1cb8('0x2')](_0x1cb8('0x3'),{'body':_0x33a8f2,'options':{'where':{'uniqueid':_0x38c3ea},'order':[['id',_0x1cb8('0x4')]],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file +var _0x4f17=['CreateChatQueueReport','update','UpdateChatQueueReport','../client','Request'];(function(_0x176789,_0x1463f8){var _0x3bf6c5=function(_0x1e22f3){while(--_0x1e22f3){_0x176789['push'](_0x176789['shift']());}};_0x3bf6c5(++_0x1463f8);}(_0x4f17,0x9e));var _0x74f1=function(_0x12a62c,_0xc9c41a){_0x12a62c=_0x12a62c-0x0;var _0x268a58=_0x4f17[_0x12a62c];return _0x268a58;};'use strict';var client=require(_0x74f1('0x0'));exports['create']=function(_0xc7f009){return client[_0x74f1('0x1')]('CreateChatQueueReport',{'body':_0xc7f009,'log':_0x74f1('0x2')});};exports[_0x74f1('0x3')]=function(_0x3f16b2,_0x62251d){return client[_0x74f1('0x1')]('UpdateChatQueueReport',{'body':_0x62251d,'options':{'where':{'uniqueid':_0x3f16b2},'order':[['id','DESC']],'limit':0x1},'log':_0x74f1('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index eeadc67..bf5ca3b 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(_0x3f5dca,_0x59472b){var _0x5b833a=function(_0x1cb84b){while(--_0x1cb84b){_0x3f5dca['push'](_0x3f5dca['shift']());}};_0x5b833a(++_0x59472b);}(_0x7a54,0x106));var _0x47a5=function(_0x40d140,_0x530c1f){_0x40d140=_0x40d140-0x0;var _0x26f33d=_0x7a54[_0x40d140];return _0x26f33d;};'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(_0x4605dc,_0x3f7ae5){var _0x5d3e81=function(_0x1d0375){while(--_0x1d0375){_0x4605dc['push'](_0x4605dc['shift']());}};_0x5d3e81(++_0x3f7ae5);}(_0x7a54,0x106));var _0x47a5=function(_0x1ec712,_0x4265ac){_0x1ec712=_0x1ec712-0x0;var _0x50d1ea=_0x7a54[_0x1ec712];return _0x50d1ea;};'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 8746ea5..c8f1065 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 _0x6468=['Request','CreateFaxMessage'];(function(_0x291f8b,_0x3b5591){var _0x275171=function(_0xb33d67){while(--_0xb33d67){_0x291f8b['push'](_0x291f8b['shift']());}};_0x275171(++_0x3b5591);}(_0x6468,0x19c));var _0x8646=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0x6468[_0x5447fd];return _0x15b28a;};'use strict';var client=require('../client');exports['create']=function(_0x6d748b){return client[_0x8646('0x0')](_0x8646('0x1'),{'body':_0x6d748b,'log':'createFaxMessage'});}; \ No newline at end of file +var _0x4534=['../client','create','Request','CreateFaxMessage','createFaxMessage'];(function(_0x362851,_0x4d3d0f){var _0x51f30e=function(_0x5dfccc){while(--_0x5dfccc){_0x362851['push'](_0x362851['shift']());}};_0x51f30e(++_0x4d3d0f);}(_0x4534,0x113));var _0x4453=function(_0x4be04c,_0x1371bc){_0x4be04c=_0x4be04c-0x0;var _0x5d3aab=_0x4534[_0x4be04c];return _0x5d3aab;};'use strict';var client=require(_0x4453('0x0'));exports[_0x4453('0x1')]=function(_0x572429){return client[_0x4453('0x2')](_0x4453('0x3'),{'body':_0x572429,'log':_0x4453('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 440c150..5fc02c4 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 _0x8eda=['getFaxQueues','Request','name','strategy','User','Agents','online','../client'];(function(_0x25b8ed,_0x334953){var _0x7924ae=function(_0x331eb2){while(--_0x331eb2){_0x25b8ed['push'](_0x25b8ed['shift']());}};_0x7924ae(++_0x334953);}(_0x8eda,0x107));var _0xa8ed=function(_0x12116e,_0x1fe29e){_0x12116e=_0x12116e-0x0;var _0x2f8c21=_0x8eda[_0x12116e];return _0x2f8c21;};'use strict';var client=require(_0xa8ed('0x0'));exports[_0xa8ed('0x1')]=function(){return function(){return client[_0xa8ed('0x2')]('GetFaxQueue',{'options':{'raw':![],'attributes':['id',_0xa8ed('0x3'),'timeout',_0xa8ed('0x4')],'include':[{'model':_0xa8ed('0x5'),'as':_0xa8ed('0x6'),'attributes':['id',_0xa8ed('0x3'),_0xa8ed('0x7'),'faxPause']}]},'log':_0xa8ed('0x1')});};}; \ No newline at end of file +var _0x5f47=['name','timeout','strategy','User','../client','getFaxQueues','GetFaxQueue'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x5f47,0xa5));var _0x75f4=function(_0x484e19,_0x5386da){_0x484e19=_0x484e19-0x0;var _0x1854c7=_0x5f47[_0x484e19];return _0x1854c7;};'use strict';var client=require(_0x75f4('0x0'));exports[_0x75f4('0x1')]=function(){return function(){return client['Request'](_0x75f4('0x2'),{'options':{'raw':![],'attributes':['id',_0x75f4('0x3'),_0x75f4('0x4'),_0x75f4('0x5')],'include':[{'model':_0x75f4('0x6'),'as':'Agents','attributes':['id',_0x75f4('0x3'),'online','faxPause']}]},'log':_0x75f4('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 4e4424c..72b5e79 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 _0x19fb=['../client','CreateFaxQueueReport','update','Request','UpdateFaxQueueReport','DESC'];(function(_0x50c4c2,_0x4df4bc){var _0x43d441=function(_0xe82920){while(--_0xe82920){_0x50c4c2['push'](_0x50c4c2['shift']());}};_0x43d441(++_0x4df4bc);}(_0x19fb,0x180));var _0xb19f=function(_0x409b58,_0x4904f3){_0x409b58=_0x409b58-0x0;var _0x15102d=_0x19fb[_0x409b58];return _0x15102d;};'use strict';var client=require(_0xb19f('0x0'));exports['create']=function(_0x29a7c8){return client['Request'](_0xb19f('0x1'),{'body':_0x29a7c8,'log':_0xb19f('0x1')});};exports[_0xb19f('0x2')]=function(_0x3d0638,_0x5bce6f){return client[_0xb19f('0x3')](_0xb19f('0x4'),{'body':_0x5bce6f,'options':{'where':{'uniqueid':_0x3d0638},'order':[['id',_0xb19f('0x5')]],'limit':0x1},'log':_0xb19f('0x4')});}; \ No newline at end of file +var _0x273e=['../client','create','Request','CreateFaxQueueReport','update','UpdateFaxQueueReport','DESC'];(function(_0x457c3f,_0x41c7f6){var _0xe71fc3=function(_0x3864be){while(--_0x3864be){_0x457c3f['push'](_0x457c3f['shift']());}};_0xe71fc3(++_0x41c7f6);}(_0x273e,0x9a));var _0xe273=function(_0x1fa3eb,_0x17df64){_0x1fa3eb=_0x1fa3eb-0x0;var _0x3ffa05=_0x273e[_0x1fa3eb];return _0x3ffa05;};'use strict';var client=require(_0xe273('0x0'));exports[_0xe273('0x1')]=function(_0x56de98){return client[_0xe273('0x2')](_0xe273('0x3'),{'body':_0x56de98,'log':'CreateFaxQueueReport'});};exports[_0xe273('0x4')]=function(_0x3e457b,_0x3deda8){return client[_0xe273('0x2')](_0xe273('0x5'),{'body':_0x3deda8,'options':{'where':{'uniqueid':_0x3e457b},'order':[['id',_0xe273('0x6')]],'limit':0x1},'log':_0xe273('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 154dd0d..540751d 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 _0xfaaa=['getIntervals','Request','name','Interval','../client'];(function(_0x2dd4e7,_0x35a133){var _0x13d76c=function(_0x22762d){while(--_0x22762d){_0x2dd4e7['push'](_0x2dd4e7['shift']());}};_0x13d76c(++_0x35a133);}(_0xfaaa,0x68));var _0xafaa=function(_0x4e3a83,_0x4b0d7e){_0x4e3a83=_0x4e3a83-0x0;var _0x372628=_0xfaaa[_0x4e3a83];return _0x372628;};'use strict';var client=require(_0xafaa('0x0'));exports[_0xafaa('0x1')]=function(){return function(){return client[_0xafaa('0x2')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xafaa('0x3')],'include':[{'model':_0xafaa('0x4'),'as':'Intervals','attributes':['id',_0xafaa('0x3'),'interval']}]},'log':_0xafaa('0x1')});};}; \ No newline at end of file +var _0x5450=['getIntervals','Request','name','Interval','Intervals','interval','../client'];(function(_0x5af565,_0xe531a7){var _0x2a311f=function(_0x59429a){while(--_0x59429a){_0x5af565['push'](_0x5af565['shift']());}};_0x2a311f(++_0xe531a7);}(_0x5450,0x84));var _0x0545=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x5450[_0x13b02f];return _0x12e9a6;};'use strict';var client=require(_0x0545('0x0'));exports[_0x0545('0x1')]=function(){return function(){return client[_0x0545('0x2')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x0545('0x3')],'include':[{'model':_0x0545('0x4'),'as':_0x0545('0x5'),'attributes':['id',_0x0545('0x3'),_0x0545('0x6')]}]},'log':_0x0545('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 5c13309..fe8fb17 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 _0x627e=['../client','update','Request','updateMailInteraction','addTags','addTagsToChatInteraction'];(function(_0xd1cf76,_0x1e667d){var _0x580cbf=function(_0x51dc24){while(--_0x51dc24){_0xd1cf76['push'](_0xd1cf76['shift']());}};_0x580cbf(++_0x1e667d);}(_0x627e,0x14a));var _0xe627=function(_0x2ec6a6,_0x23eb27){_0x2ec6a6=_0x2ec6a6-0x0;var _0x8e05eb=_0x627e[_0x2ec6a6];return _0x8e05eb;};'use strict';var client=require(_0xe627('0x0'));exports[_0xe627('0x1')]=function(_0x2cc4b4,_0x18dba3){return client[_0xe627('0x2')]('UpdateMailInteraction',{'body':_0x18dba3,'options':{'where':{'id':_0x2cc4b4}},'log':_0xe627('0x3')});};exports[_0xe627('0x4')]=function(_0x2abdc7,_0x59a2c8){return client['Request']('AddTagsToMailInteraction',{'body':_0x59a2c8,'options':{'where':{'id':_0x2abdc7}},'log':_0xe627('0x5')});}; \ No newline at end of file +var _0xa30a=['Request','UpdateMailInteraction','updateMailInteraction','addTags','addTagsToChatInteraction','../client','update'];(function(_0x5deae3,_0x52af2f){var _0x48f472=function(_0x58e9d2){while(--_0x58e9d2){_0x5deae3['push'](_0x5deae3['shift']());}};_0x48f472(++_0x52af2f);}(_0xa30a,0xd7));var _0xaa30=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa30a[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0xaa30('0x0'));exports[_0xaa30('0x1')]=function(_0x25634b,_0x4dfa7e){return client[_0xaa30('0x2')](_0xaa30('0x3'),{'body':_0x4dfa7e,'options':{'where':{'id':_0x25634b}},'log':_0xaa30('0x4')});};exports[_0xaa30('0x5')]=function(_0x2a9b06,_0x271425){return client[_0xaa30('0x2')]('AddTagsToMailInteraction',{'body':_0x271425,'options':{'where':{'id':_0x2a9b06}},'log':_0xaa30('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 1b8debc..9d8c3ef 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 _0x20b2=['../client','create','Request','CreateMailMessage'];(function(_0x1868b1,_0x74fb6e){var _0x58f512=function(_0x5c135e){while(--_0x5c135e){_0x1868b1['push'](_0x1868b1['shift']());}};_0x58f512(++_0x74fb6e);}(_0x20b2,0x148));var _0x220b=function(_0x117a7d,_0x41ccd4){_0x117a7d=_0x117a7d-0x0;var _0x13fcea=_0x20b2[_0x117a7d];return _0x13fcea;};'use strict';var client=require(_0x220b('0x0'));exports[_0x220b('0x1')]=function(_0x258fff){return client[_0x220b('0x2')](_0x220b('0x3'),{'body':_0x258fff,'log':'createMailMessage'});}; \ No newline at end of file +var _0xc4df=['Request','CreateMailMessage','createMailMessage','../client','create'];(function(_0x12533c,_0x8b53ae){var _0x5ee49e=function(_0x33e25c){while(--_0x33e25c){_0x12533c['push'](_0x12533c['shift']());}};_0x5ee49e(++_0x8b53ae);}(_0xc4df,0x1a7));var _0xfc4d=function(_0x40f9ef,_0x1bc8de){_0x40f9ef=_0x40f9ef-0x0;var _0x157001=_0xc4df[_0x40f9ef];return _0x157001;};'use strict';var client=require(_0xfc4d('0x0'));exports[_0xfc4d('0x1')]=function(_0x3ec053){return client[_0xfc4d('0x2')](_0xfc4d('0x3'),{'body':_0x3ec053,'log':_0xfc4d('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 9b622ba..85e387d 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 _0xaf73=['getMailQueues','Request','GetMailQueue','name','timeout','strategy','User','Agents','online','mailPause','../client'];(function(_0x26175f,_0x22b55c){var _0x2dd509=function(_0xa69659){while(--_0xa69659){_0x26175f['push'](_0x26175f['shift']());}};_0x2dd509(++_0x22b55c);}(_0xaf73,0x149));var _0x3af7=function(_0x35de22,_0x218217){_0x35de22=_0x35de22-0x0;var _0x11ae4b=_0xaf73[_0x35de22];return _0x11ae4b;};'use strict';var client=require(_0x3af7('0x0'));exports[_0x3af7('0x1')]=function(){return function(){return client[_0x3af7('0x2')](_0x3af7('0x3'),{'options':{'raw':![],'attributes':['id',_0x3af7('0x4'),_0x3af7('0x5'),_0x3af7('0x6')],'include':[{'model':_0x3af7('0x7'),'as':_0x3af7('0x8'),'attributes':['id',_0x3af7('0x4'),_0x3af7('0x9'),_0x3af7('0xa')]}]},'log':_0x3af7('0x1')});};}; \ No newline at end of file +var _0x0286=['Request','GetMailQueue','timeout','strategy','User','Agents','mailPause','../client','getMailQueues'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x0286,0x7c));var _0x6028=function(_0x257e19,_0x56fca0){_0x257e19=_0x257e19-0x0;var _0x3c1c4e=_0x0286[_0x257e19];return _0x3c1c4e;};'use strict';var client=require(_0x6028('0x0'));exports[_0x6028('0x1')]=function(){return function(){return client[_0x6028('0x2')](_0x6028('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x6028('0x4'),_0x6028('0x5')],'include':[{'model':_0x6028('0x6'),'as':_0x6028('0x7'),'attributes':['id','name','online',_0x6028('0x8')]}]},'log':'getMailQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index a841f9b..8f011fb 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 _0xf138=['create','Request','CreateMailQueueReport','update','UpdateMailQueueReport','../client'];(function(_0x2b12f7,_0x4033ac){var _0x8cb277=function(_0x713b37){while(--_0x713b37){_0x2b12f7['push'](_0x2b12f7['shift']());}};_0x8cb277(++_0x4033ac);}(_0xf138,0x15b));var _0x8f13=function(_0x327c2c,_0x591f08){_0x327c2c=_0x327c2c-0x0;var _0x1bbe00=_0xf138[_0x327c2c];return _0x1bbe00;};'use strict';var client=require(_0x8f13('0x0'));exports[_0x8f13('0x1')]=function(_0x3fd7ec){return client[_0x8f13('0x2')](_0x8f13('0x3'),{'body':_0x3fd7ec,'log':'CreateMailQueueReport'});};exports[_0x8f13('0x4')]=function(_0x2e3ae8,_0x4e57e2){return client['Request'](_0x8f13('0x5'),{'body':_0x4e57e2,'options':{'where':{'uniqueid':_0x2e3ae8},'order':[['id','DESC']],'limit':0x1},'log':_0x8f13('0x5')});}; \ No newline at end of file +var _0x9c51=['update','UpdateMailQueueReport','create','Request','CreateMailQueueReport'];(function(_0xfeb103,_0x395bf5){var _0x298dcc=function(_0x3d96e2){while(--_0x3d96e2){_0xfeb103['push'](_0xfeb103['shift']());}};_0x298dcc(++_0x395bf5);}(_0x9c51,0xc0));var _0x19c5=function(_0x3f429f,_0x2c0335){_0x3f429f=_0x3f429f-0x0;var _0x586356=_0x9c51[_0x3f429f];return _0x586356;};'use strict';var client=require('../client');exports[_0x19c5('0x0')]=function(_0x1646c8){return client[_0x19c5('0x1')](_0x19c5('0x2'),{'body':_0x1646c8,'log':'CreateMailQueueReport'});};exports[_0x19c5('0x3')]=function(_0x13383e,_0x31c127){return client[_0x19c5('0x1')](_0x19c5('0x4'),{'body':_0x31c127,'options':{'where':{'uniqueid':_0x13383e},'order':[['id','DESC']],'limit':0x1},'log':_0x19c5('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index f208596..b5971ec 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 _0xb99b=['addTagsToChatInteraction','update','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags'];(function(_0x33e566,_0x3e90f4){var _0x828b80=function(_0x2b67d2){while(--_0x2b67d2){_0x33e566['push'](_0x33e566['shift']());}};_0x828b80(++_0x3e90f4);}(_0xb99b,0x199));var _0xbb99=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb99b[_0x20a584];return _0x4b41a8;};'use strict';var client=require('../client');exports[_0xbb99('0x0')]=function(_0x113149,_0x123b47){return client[_0xbb99('0x1')](_0xbb99('0x2'),{'body':_0x123b47,'options':{'where':{'id':_0x113149}},'log':_0xbb99('0x3')});};exports[_0xbb99('0x4')]=function(_0x41590c,_0x31f213){return client[_0xbb99('0x1')]('AddTagsToOpenchannelInteraction',{'body':_0x31f213,'options':{'where':{'id':_0x41590c}},'log':_0xbb99('0x5')});}; \ No newline at end of file +var _0x4129=['updateOpenchannelInteraction','addTags','Request','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','update','UpdateOpenchannelInteraction'];(function(_0x389be7,_0x5f0569){var _0x3f7222=function(_0x536424){while(--_0x536424){_0x389be7['push'](_0x389be7['shift']());}};_0x3f7222(++_0x5f0569);}(_0x4129,0x15c));var _0x9412=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4129[_0x20a584];return _0x4b41a8;};'use strict';var client=require('../client');exports[_0x9412('0x0')]=function(_0x3c04a1,_0x3a0471){return client['Request'](_0x9412('0x1'),{'body':_0x3a0471,'options':{'where':{'id':_0x3c04a1}},'log':_0x9412('0x2')});};exports[_0x9412('0x3')]=function(_0x190106,_0x41655b){return client[_0x9412('0x4')](_0x9412('0x5'),{'body':_0x41655b,'options':{'where':{'id':_0x190106}},'log':_0x9412('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 7aad66d..59c2400 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 _0x0488=['create','Request','createOpenchannelMessage'];(function(_0x291f8b,_0x3b5591){var _0x275171=function(_0xb33d67){while(--_0xb33d67){_0x291f8b['push'](_0x291f8b['shift']());}};_0x275171(++_0x3b5591);}(_0x0488,0x1dd));var _0x8048=function(_0x203748,_0x210a2d){_0x203748=_0x203748-0x0;var _0x54839c=_0x0488[_0x203748];return _0x54839c;};'use strict';var client=require('../client');exports[_0x8048('0x0')]=function(_0x194676){return client[_0x8048('0x1')]('CreateOpenchannelMessage',{'body':_0x194676,'log':_0x8048('0x2')});}; \ No newline at end of file +var _0xfd4e=['../client','create','CreateOpenchannelMessage','createOpenchannelMessage'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xfd4e,0x98));var _0xefd4=function(_0x552bd9,_0x57e2b9){_0x552bd9=_0x552bd9-0x0;var _0x529e83=_0xfd4e[_0x552bd9];return _0x529e83;};'use strict';var client=require(_0xefd4('0x0'));exports[_0xefd4('0x1')]=function(_0x246439){return client['Request'](_0xefd4('0x2'),{'body':_0x246439,'log':_0xefd4('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index ea940e3..a39afa6 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 _0x2567=['openchannelPause','GetOpenchannelQueue','name','online'];(function(_0x129e27,_0x4f87d3){var _0x802f6b=function(_0x1f257f){while(--_0x1f257f){_0x129e27['push'](_0x129e27['shift']());}};_0x802f6b(++_0x4f87d3);}(_0x2567,0xdd));var _0x7256=function(_0x3d2f63,_0x590356){_0x3d2f63=_0x3d2f63-0x0;var _0x35979c=_0x2567[_0x3d2f63];return _0x35979c;};'use strict';var client=require('../client');exports['getOpenchannelQueues']=function(){return function(){return client['Request'](_0x7256('0x0'),{'options':{'raw':![],'attributes':['id',_0x7256('0x1'),'timeout','strategy'],'include':[{'model':'User','as':'Agents','attributes':['id',_0x7256('0x1'),_0x7256('0x2'),_0x7256('0x3')]}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file +var _0x75bb=['online','../client','getOpenchannelQueues','Request','GetOpenchannelQueue','name','timeout','strategy','User','Agents'];(function(_0x4a228f,_0x44e160){var _0x13787a=function(_0x53b4cc){while(--_0x53b4cc){_0x4a228f['push'](_0x4a228f['shift']());}};_0x13787a(++_0x44e160);}(_0x75bb,0xb5));var _0xb75b=function(_0x36f797,_0x351603){_0x36f797=_0x36f797-0x0;var _0x44ba30=_0x75bb[_0x36f797];return _0x44ba30;};'use strict';var client=require(_0xb75b('0x0'));exports[_0xb75b('0x1')]=function(){return function(){return client[_0xb75b('0x2')](_0xb75b('0x3'),{'options':{'raw':![],'attributes':['id',_0xb75b('0x4'),_0xb75b('0x5'),_0xb75b('0x6')],'include':[{'model':_0xb75b('0x7'),'as':_0xb75b('0x8'),'attributes':['id',_0xb75b('0x4'),_0xb75b('0x9'),'openchannelPause']}]},'log':_0xb75b('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 46771a4..33c7867 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 _0x2953=['../client','Request','update','UpdateOpenchannelQueueReport'];(function(_0x54cab8,_0x342a7e){var _0x435855=function(_0x3f7993){while(--_0x3f7993){_0x54cab8['push'](_0x54cab8['shift']());}};_0x435855(++_0x342a7e);}(_0x2953,0x1cc));var _0x3295=function(_0x225d09,_0x527675){_0x225d09=_0x225d09-0x0;var _0x5b5c09=_0x2953[_0x225d09];return _0x5b5c09;};'use strict';var client=require(_0x3295('0x0'));exports['create']=function(_0x3e50a1){return client[_0x3295('0x1')]('CreateOpenchannelQueueReport',{'body':_0x3e50a1,'log':'CreateOpenchannelQueueReport'});};exports[_0x3295('0x2')]=function(_0x37469c,_0x33502b){return client[_0x3295('0x1')](_0x3295('0x3'),{'body':_0x33502b,'options':{'where':{'uniqueid':_0x37469c},'order':[['id','DESC']],'limit':0x1},'log':_0x3295('0x3')});}; \ No newline at end of file +var _0x1cc5=['../client','create','Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1cc5,0x132));var _0x51cc=function(_0x572438,_0x1b94fe){_0x572438=_0x572438-0x0;var _0xc6e9a7=_0x1cc5[_0x572438];return _0xc6e9a7;};'use strict';var client=require(_0x51cc('0x0'));exports[_0x51cc('0x1')]=function(_0x21b330){return client[_0x51cc('0x2')](_0x51cc('0x3'),{'body':_0x21b330,'log':_0x51cc('0x3')});};exports[_0x51cc('0x4')]=function(_0x26ed12,_0x194c58){return client['Request'](_0x51cc('0x5'),{'body':_0x194c58,'options':{'where':{'uniqueid':_0x26ed12},'order':[['id','DESC']],'limit':0x1},'log':_0x51cc('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 02b14aa..68f538a 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 _0xe292=['updateSmsInteraction','addTags','Request'];(function(_0x56c1b5,_0x13328f){var _0x11e97b=function(_0x110dad){while(--_0x110dad){_0x56c1b5['push'](_0x56c1b5['shift']());}};_0x11e97b(++_0x13328f);}(_0xe292,0x19e));var _0x2e29=function(_0x1cfa09,_0x68311b){_0x1cfa09=_0x1cfa09-0x0;var _0x467061=_0xe292[_0x1cfa09];return _0x467061;};'use strict';var client=require('../client');exports['update']=function(_0x325ad7,_0x2f1736){return client['Request']('UpdateSmsInteraction',{'body':_0x2f1736,'options':{'where':{'id':_0x325ad7}},'log':_0x2e29('0x0')});};exports[_0x2e29('0x1')]=function(_0x4fec69,_0x59d723){return client[_0x2e29('0x2')]('AddTagsToSmsInteraction',{'body':_0x59d723,'options':{'where':{'id':_0x4fec69}},'log':'addTagsToSmsInteraction'});}; \ No newline at end of file +var _0xcb57=['../client','update','UpdateSmsInteraction','addTags','Request','AddTagsToSmsInteraction','addTagsToSmsInteraction'];(function(_0x2b85d5,_0x3115b7){var _0xe8c96f=function(_0x4bc25b){while(--_0x4bc25b){_0x2b85d5['push'](_0x2b85d5['shift']());}};_0xe8c96f(++_0x3115b7);}(_0xcb57,0xa1));var _0x7cb5=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xcb57[_0x59ee6f];return _0x4c0979;};'use strict';var client=require(_0x7cb5('0x0'));exports[_0x7cb5('0x1')]=function(_0x5df18a,_0x21a4c6){return client['Request'](_0x7cb5('0x2'),{'body':_0x21a4c6,'options':{'where':{'id':_0x5df18a}},'log':'updateSmsInteraction'});};exports[_0x7cb5('0x3')]=function(_0x1b1ef7,_0x4850d6){return client[_0x7cb5('0x4')](_0x7cb5('0x5'),{'body':_0x4850d6,'options':{'where':{'id':_0x1b1ef7}},'log':_0x7cb5('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index e6bf775..d6cc2ef 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 _0x2825=['CreateSmsMessage','createSmsMessage','create','Request'];(function(_0x3c6a9a,_0x4efaed){var _0x23f1a6=function(_0xa7905f){while(--_0xa7905f){_0x3c6a9a['push'](_0x3c6a9a['shift']());}};_0x23f1a6(++_0x4efaed);}(_0x2825,0xa2));var _0x5282=function(_0x550ac2,_0x3dbbab){_0x550ac2=_0x550ac2-0x0;var _0x95d7e=_0x2825[_0x550ac2];return _0x95d7e;};'use strict';var client=require('../client');exports[_0x5282('0x0')]=function(_0x455871){return client[_0x5282('0x1')](_0x5282('0x2'),{'body':_0x455871,'log':_0x5282('0x3')});}; \ No newline at end of file +var _0x08d1=['Request','CreateSmsMessage','createSmsMessage','../client'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x08d1,0x12b));var _0x108d=function(_0x1ebd30,_0x48ca2f){_0x1ebd30=_0x1ebd30-0x0;var _0x33c6c9=_0x08d1[_0x1ebd30];return _0x33c6c9;};'use strict';var client=require(_0x108d('0x0'));exports['create']=function(_0x25c355){return client[_0x108d('0x1')](_0x108d('0x2'),{'body':_0x25c355,'log':_0x108d('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index bf90bd0..892d036 100644 --- a/server/services/routing/rpc/smsQueue.js +++ b/server/services/routing/rpc/smsQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['name','online','smsPause','../client','getSmsQueues','Request','timeout','User','Agents'];(function(_0x15215a,_0x513ba9){var _0x404125=function(_0x5e4d05){while(--_0x5e4d05){_0x15215a['push'](_0x15215a['shift']());}};_0x404125(++_0x513ba9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x0a9e('0x3'),'strategy'],'include':[{'model':_0x0a9e('0x4'),'as':_0x0a9e('0x5'),'attributes':['id',_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8')]}]},'log':'getSmsQueues'});};}; \ No newline at end of file +var _0x0713=['getSmsQueues','Request','GetSmsQueue','name','timeout','strategy','Agents','online','smsPause'];(function(_0x1e172a,_0x52102b){var _0x96338b=function(_0x307313){while(--_0x307313){_0x1e172a['push'](_0x1e172a['shift']());}};_0x96338b(++_0x52102b);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':![],'attributes':['id',_0x3071('0x2'),_0x3071('0x3'),_0x3071('0x4')],'include':[{'model':'User','as':_0x3071('0x5'),'attributes':['id',_0x3071('0x2'),_0x3071('0x6'),_0x3071('0x7')]}]},'log':_0x3071('0x8')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index e657731..57e1e2b 100644 --- a/server/services/routing/rpc/smsQueueReport.js +++ b/server/services/routing/rpc/smsQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['Request','CreateSmsQueueReport','update','UpdateSmsQueueReport'];(function(_0x5080af,_0x3cbca9){var _0x368f2c=function(_0x59c498){while(--_0x59c498){_0x5080af['push'](_0x5080af['shift']());}};_0x368f2c(++_0x3cbca9);}(_0x9c44,0x178));var _0x49c4=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x9c44[_0x4b055c];return _0x4b62bb;};'use strict';var client=require('../client');exports['create']=function(_0x1ffbbf){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'body':_0x1ffbbf,'log':_0x49c4('0x1')});};exports[_0x49c4('0x2')]=function(_0x2ad237,_0x4e0313){return client['Request'](_0x49c4('0x3'),{'body':_0x4e0313,'options':{'where':{'uniqueid':_0x2ad237},'order':[['id','DESC']],'limit':0x1},'log':_0x49c4('0x3')});}; \ No newline at end of file +var _0xedd9=['create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x284bc3,_0x22dffe){var _0x41ac81=function(_0x47031f){while(--_0x47031f){_0x284bc3['push'](_0x284bc3['shift']());}};_0x41ac81(++_0x22dffe);}(_0xedd9,0xfc));var _0x9edd=function(_0x5b0cee,_0x4f8539){_0x5b0cee=_0x5b0cee-0x0;var _0x1ff7d7=_0xedd9[_0x5b0cee];return _0x1ff7d7;};'use strict';var client=require('../client');exports[_0x9edd('0x0')]=function(_0x2d7989){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'body':_0x2d7989,'log':_0x9edd('0x2')});};exports[_0x9edd('0x3')]=function(_0x3e6d3a,_0x36b53f){return client['Request'](_0x9edd('0x4'),{'body':_0x36b53f,'options':{'where':{'uniqueid':_0x3e6d3a},'order':[['id',_0x9edd('0x5')]],'limit':0x1},'log':_0x9edd('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 96bea8b..60ae75e 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(_0x318554,_0x22a74a){var _0x4e5233=function(_0x4d82cd){while(--_0x4d82cd){_0x318554['push'](_0x318554['shift']());}};_0x4e5233(++_0x22a74a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xa9e0[_0x3a6efd];return _0x487b9a;};'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(_0x28744c,_0x250ee4){var _0x4c1545=function(_0x212a45){while(--_0x212a45){_0x28744c['push'](_0x28744c['shift']());}};_0x4c1545(++_0x250ee4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa9e0[_0x220dbb];return _0x2b77de;};'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 5cdf9d8..3d5a63b 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 _0xa93e=['addTags','Request','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','UpdateWhatsappInteraction'];(function(_0x36a217,_0x4a7a90){var _0x186433=function(_0x2d6151){while(--_0x2d6151){_0x36a217['push'](_0x36a217['shift']());}};_0x186433(++_0x4a7a90);}(_0xa93e,0x1df));var _0xea93=function(_0x1fea51,_0x217ccd){_0x1fea51=_0x1fea51-0x0;var _0x235184=_0xa93e[_0x1fea51];return _0x235184;};'use strict';var client=require('../client');exports['update']=function(_0x25877f,_0x302cc5){return client['Request'](_0xea93('0x0'),{'body':_0x302cc5,'options':{'where':{'id':_0x25877f}},'log':'updateWhatsappInteraction'});};exports[_0xea93('0x1')]=function(_0x5b5341,_0x5398ba){return client[_0xea93('0x2')](_0xea93('0x3'),{'body':_0x5398ba,'options':{'where':{'id':_0x5b5341}},'log':_0xea93('0x4')});}; \ No newline at end of file +var _0x3595=['Request','UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','addTagsToWhatsappInteraction','../client','update'];(function(_0x30a31e,_0x31f766){var _0x170879=function(_0x313ee7){while(--_0x313ee7){_0x30a31e['push'](_0x30a31e['shift']());}};_0x170879(++_0x31f766);}(_0x3595,0x147));var _0x5359=function(_0x2f567a,_0xe22d76){_0x2f567a=_0x2f567a-0x0;var _0x884ecf=_0x3595[_0x2f567a];return _0x884ecf;};'use strict';var client=require(_0x5359('0x0'));exports[_0x5359('0x1')]=function(_0xa74118,_0x52b0f5){return client[_0x5359('0x2')](_0x5359('0x3'),{'body':_0x52b0f5,'options':{'where':{'id':_0xa74118}},'log':_0x5359('0x4')});};exports[_0x5359('0x5')]=function(_0x1fa814,_0x125c76){return client['Request']('AddTagsToWhatsappInteraction',{'body':_0x125c76,'options':{'where':{'id':_0x1fa814}},'log':_0x5359('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index c48c6d9..bf56740 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 _0xc5f2=['Request','CreateWhatsappMessage','createWhatsappMessage'];(function(_0x348681,_0x486a1d){var _0x30d4b7=function(_0x4b6cb1){while(--_0x4b6cb1){_0x348681['push'](_0x348681['shift']());}};_0x30d4b7(++_0x486a1d);}(_0xc5f2,0x198));var _0x2c5f=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xc5f2[_0x42cae2];return _0x5f256f;};'use strict';var client=require('../client');exports['create']=function(_0x41ba97){return client[_0x2c5f('0x0')](_0x2c5f('0x1'),{'body':_0x41ba97,'log':_0x2c5f('0x2')});}; \ No newline at end of file +var _0x0cfe=['CreateWhatsappMessage','createWhatsappMessage','create','Request'];(function(_0x451cb7,_0x17d7bf){var _0x2acd4e=function(_0x3a6b31){while(--_0x3a6b31){_0x451cb7['push'](_0x451cb7['shift']());}};_0x2acd4e(++_0x17d7bf);}(_0x0cfe,0x1ca));var _0xe0cf=function(_0x12290e,_0x230849){_0x12290e=_0x12290e-0x0;var _0x24d496=_0x0cfe[_0x12290e];return _0x24d496;};'use strict';var client=require('../client');exports[_0xe0cf('0x0')]=function(_0x411521){return client[_0xe0cf('0x1')](_0xe0cf('0x2'),{'body':_0x411521,'log':_0xe0cf('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 3c2f5b6..892bbdd 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 _0x398b=['name','timeout','strategy','User','Agents','getWhatsappQueues','Request'];(function(_0x247423,_0x512406){var _0x28ee60=function(_0x19fea2){while(--_0x19fea2){_0x247423['push'](_0x247423['shift']());}};_0x28ee60(++_0x512406);}(_0x398b,0x1c6));var _0xb398=function(_0x5eb24d,_0xa71a6f){_0x5eb24d=_0x5eb24d-0x0;var _0x4d4507=_0x398b[_0x5eb24d];return _0x4d4507;};'use strict';var client=require('../client');exports['getWhatsappQueues']=function(){return function(){return client[_0xb398('0x0')]('GetWhatsappQueue',{'options':{'raw':![],'attributes':['id',_0xb398('0x1'),_0xb398('0x2'),_0xb398('0x3')],'include':[{'model':_0xb398('0x4'),'as':_0xb398('0x5'),'attributes':['id',_0xb398('0x1'),'online','whatsappPause']}]},'log':_0xb398('0x6')});};}; \ No newline at end of file +var _0x01b2=['getWhatsappQueues','Request','GetWhatsappQueue','name','timeout','strategy','User'];(function(_0x1c6a53,_0x3356eb){var _0xdfedd=function(_0x1e3aa0){while(--_0x1e3aa0){_0x1c6a53['push'](_0x1c6a53['shift']());}};_0xdfedd(++_0x3356eb);}(_0x01b2,0xa8));var _0x201b=function(_0x19115e,_0x507bab){_0x19115e=_0x19115e-0x0;var _0x45bbd4=_0x01b2[_0x19115e];return _0x45bbd4;};'use strict';var client=require('../client');exports[_0x201b('0x0')]=function(){return function(){return client[_0x201b('0x1')](_0x201b('0x2'),{'options':{'raw':![],'attributes':['id',_0x201b('0x3'),_0x201b('0x4'),_0x201b('0x5')],'include':[{'model':_0x201b('0x6'),'as':'Agents','attributes':['id',_0x201b('0x3'),'online','whatsappPause']}]},'log':_0x201b('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index a060899..f80cf42 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 _0x5879=['Request','CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','DESC','../client','create'];(function(_0x6bb511,_0x1196aa){var _0x573820=function(_0x3c8258){while(--_0x3c8258){_0x6bb511['push'](_0x6bb511['shift']());}};_0x573820(++_0x1196aa);}(_0x5879,0x1da));var _0x9587=function(_0xe0185f,_0x1ce304){_0xe0185f=_0xe0185f-0x0;var _0x294204=_0x5879[_0xe0185f];return _0x294204;};'use strict';var client=require(_0x9587('0x0'));exports[_0x9587('0x1')]=function(_0x20c408){return client[_0x9587('0x2')]('CreateWhatsappQueueReport',{'body':_0x20c408,'log':_0x9587('0x3')});};exports[_0x9587('0x4')]=function(_0x4aafa4,_0x401312){return client[_0x9587('0x2')](_0x9587('0x5'),{'body':_0x401312,'options':{'where':{'uniqueid':_0x4aafa4},'order':[['id',_0x9587('0x6')]],'limit':0x1},'log':'UpdateWhatsappQueueReport'});}; \ No newline at end of file +var _0x1970=['create','CreateWhatsappQueueReport','update','Request','DESC','UpdateWhatsappQueueReport'];(function(_0xe14332,_0x12d828){var _0xd781c=function(_0x2c2c8a){while(--_0x2c2c8a){_0xe14332['push'](_0xe14332['shift']());}};_0xd781c(++_0x12d828);}(_0x1970,0x14a));var _0x0197=function(_0x46fc28,_0x1f03b5){_0x46fc28=_0x46fc28-0x0;var _0x45f9ae=_0x1970[_0x46fc28];return _0x45f9ae;};'use strict';var client=require('../client');exports[_0x0197('0x0')]=function(_0x4e223a){return client['Request']('CreateWhatsappQueueReport',{'body':_0x4e223a,'log':_0x0197('0x1')});};exports[_0x0197('0x2')]=function(_0x2dcfc7,_0x507b60){return client[_0x0197('0x3')]('UpdateWhatsappQueueReport',{'body':_0x507b60,'options':{'where':{'uniqueid':_0x2dcfc7},'order':[['id',_0x0197('0x4')]],'limit':0x1},'log':_0x0197('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/server/applications/agent.js b/server/services/routing/server/applications/agent.js index c5c5745..4fb0877 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 _0x0974=['timeout\x20is\x20a\x20number','format','name','toLowerCase','consequence','validate','length','error','[%s][AGENT]\x20%s','map','message','stop','createQueue','atimeout','channel','START:%s','rules','end','info','[%s][AGENT]\x20ROUTING\x20STOPPED','close','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','seq-queue','../../../../config/logger','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number'];(function(_0x10c0c0,_0x40b99c){var _0x5c7850=function(_0x267d6f){while(--_0x267d6f){_0x10c0c0['push'](_0x10c0c0['shift']());}};_0x5c7850(++_0x40b99c);}(_0x0974,0xb0));var _0x4097=function(_0x1789b0,_0x289727){_0x1789b0=_0x1789b0-0x0;var _0x125916=_0x0974[_0x1789b0];return _0x125916;};'use strict';var schema=require('validate');var _=require('lodash');var util=require('util');var seqqueue=require(_0x4097('0x0'));var logger=require(_0x4097('0x1'))('routing');var strategy=require('./strategy');var queue=schema({'name':{'type':'string','required':!![],'message':_0x4097('0x2')},'timeout':{'type':_0x4097('0x3'),'message':_0x4097('0x4')}});function writeLog(_0x56a501,_0x446955,_0x14ff1e){return logger['info'](util[_0x4097('0x5')]('[%s][AGENT][NAME:%s][STATUS:%s]',_0x56a501,_0x446955['name'],_0x14ff1e));}function handleFindAgent(_0x5d63eb){return function(_0x48a341){return _0x48a341[_0x4097('0x6')][_0x4097('0x7')]()===_0x5d63eb[_0x4097('0x7')]();};}exports[_0x4097('0x8')]=function(_0x107328,_0xf4b2df,_0x390e09,_0x5cf9b7){return function(_0x3cd9ba){try{var _0x1629e2={'name':_0xf4b2df[0x0],'timeout':_0xf4b2df[0x1]};var _0x4dd1aa=queue[_0x4097('0x9')](_0x1629e2,{'typecast':!![]});if(_0x4dd1aa[_0x4097('0xa')]){logger[_0x4097('0xb')](_0x4097('0xc'),_0x107328,_[_0x4097('0xd')](_0x4dd1aa,_0x4097('0xe'))['join'](',\x20'));_0x3cd9ba[_0x4097('0xf')]();}else{var _0x57ad91=_['find'](_0x390e09['agents'],handleFindAgent(_0x1629e2[_0x4097('0x6')]));if(_0x57ad91){var _0x347137=(_0x1629e2['timeout']||0xa)*0x3e8;var _0x2596a7,_0x3e5af7;var _0x21d810=seqqueue[_0x4097('0x10')](_0x347137);_0x21d810['id']=_0x107328;_0x21d810[_0x4097('0x11')]=_0x347137;_0x21d810[_0x4097('0x12')]=_0x5cf9b7[_0x4097('0x12')];writeLog(_0x107328,_0x57ad91,util[_0x4097('0x5')](_0x4097('0x13'),_0x347137));_0x390e09[_0x4097('0x14')][_0x107328]['on'](_0x4097('0x15'),function(){logger[_0x4097('0x16')](_0x4097('0x17'),_0x107328);clearTimeout(_0x3e5af7);_0x3e5af7=undefined;_0x21d810[_0x4097('0x18')]();if(_0x390e09[_0x4097('0x14')][_0x107328]){delete _0x390e09[_0x4097('0x14')][_0x107328];}_0x3cd9ba[_0x4097('0xf')]();});_0x390e09[_0x4097('0x14')][_0x107328]['on']('complete',function(){if(_0x390e09[_0x4097('0x14')][_0x107328]){delete _0x390e09[_0x4097('0x14')][_0x107328];}});_0x3e5af7=setTimeout(function(){logger['info']('[%s][AGENT]\x20ROUTING\x20END',_0x107328);clearTimeout(_0x3e5af7);_0x21d810[_0x4097('0x18')]();_0x3cd9ba[_0x4097('0x19')]();},_0x347137);strategy[_0x4097('0x1a')](_0x21d810,_0x57ad91,_0x390e09,_0x5cf9b7);}else{logger[_0x4097('0xb')](_0x4097('0x1b'),_0x107328,_0x1629e2[_0x4097('0x6')]);_0x3cd9ba[_0x4097('0xf')]();}}}catch(_0x195b2a){console[_0x4097('0x1c')](_0x195b2a);logger[_0x4097('0xb')](_0x4097('0x1d'),_0x107328,_0x195b2a['stack']);_0x3cd9ba[_0x4097('0xf')]();}};}; \ No newline at end of file +var _0x8838=['stop','agents','timeout','atimeout','channel','format','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','agent','error','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','validate','util','../../../../config/logger','routing','./strategy','number','info','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','[%s][AGENT]\x20%s','map','message'];(function(_0x321989,_0x47a57a){var _0x2ecfa9=function(_0x4db0c2){while(--_0x4db0c2){_0x321989['push'](_0x321989['shift']());}};_0x2ecfa9(++_0x47a57a);}(_0x8838,0xcb));var _0x8883=function(_0x1b693f,_0xb446b6){_0x1b693f=_0x1b693f-0x0;var _0x17938a=_0x8838[_0x1b693f];return _0x17938a;};'use strict';var schema=require(_0x8883('0x0'));var _=require('lodash');var util=require(_0x8883('0x1'));var seqqueue=require('seq-queue');var logger=require(_0x8883('0x2'))(_0x8883('0x3'));var strategy=require(_0x8883('0x4'));var queue=schema({'name':{'type':'string','required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x8883('0x5'),'message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x9769ee,_0x1c148f,_0x4fa9d6){return logger[_0x8883('0x6')](util['format'](_0x8883('0x7'),_0x9769ee,_0x1c148f[_0x8883('0x8')],_0x4fa9d6));}function handleFindAgent(_0x3a6b24){return function(_0x471e62){return _0x471e62['name']['toLowerCase']()===_0x3a6b24[_0x8883('0x9')]();};}exports[_0x8883('0xa')]=function(_0x5a1a00,_0x19f01b,_0x49ef69,_0x31f5e6){return function(_0x3b29e2){try{var _0x60cecd={'name':_0x19f01b[0x0],'timeout':_0x19f01b[0x1]};var _0x31543d=queue['validate'](_0x60cecd,{'typecast':!![]});if(_0x31543d['length']){logger['error'](_0x8883('0xb'),_0x5a1a00,_[_0x8883('0xc')](_0x31543d,_0x8883('0xd'))['join'](',\x20'));_0x3b29e2[_0x8883('0xe')]();}else{var _0x5e9efa=_['find'](_0x49ef69[_0x8883('0xf')],handleFindAgent(_0x60cecd[_0x8883('0x8')]));if(_0x5e9efa){var _0x51b295=(_0x60cecd[_0x8883('0x10')]||0xa)*0x3e8;var _0x6a6540,_0x7ee1f3;var _0x54bcd8=seqqueue['createQueue'](_0x51b295);_0x54bcd8['id']=_0x5a1a00;_0x54bcd8[_0x8883('0x11')]=_0x51b295;_0x54bcd8['channel']=_0x31f5e6[_0x8883('0x12')];writeLog(_0x5a1a00,_0x5e9efa,util[_0x8883('0x13')](_0x8883('0x14'),_0x51b295));_0x49ef69[_0x8883('0x15')][_0x5a1a00]['on'](_0x8883('0x16'),function(){logger[_0x8883('0x6')](_0x8883('0x17'),_0x5a1a00);clearTimeout(_0x7ee1f3);_0x7ee1f3=undefined;_0x54bcd8[_0x8883('0x18')]();if(_0x49ef69[_0x8883('0x15')][_0x5a1a00]){delete _0x49ef69[_0x8883('0x15')][_0x5a1a00];}_0x3b29e2['stop']();});_0x49ef69[_0x8883('0x15')][_0x5a1a00]['on'](_0x8883('0x19'),function(){if(_0x49ef69[_0x8883('0x15')][_0x5a1a00]){delete _0x49ef69['rules'][_0x5a1a00];}});_0x7ee1f3=setTimeout(function(){logger[_0x8883('0x6')]('[%s][AGENT]\x20ROUTING\x20END',_0x5a1a00);clearTimeout(_0x7ee1f3);_0x54bcd8[_0x8883('0x18')]();_0x3b29e2['next']();},_0x51b295);strategy[_0x8883('0x1a')](_0x54bcd8,_0x5e9efa,_0x49ef69,_0x31f5e6);}else{logger[_0x8883('0x1b')](_0x8883('0x1c'),_0x5a1a00,_0x60cecd[_0x8883('0x8')]);_0x3b29e2[_0x8883('0xe')]();}}}catch(_0x54c6b2){console[_0x8883('0x1d')](_0x54c6b2);logger[_0x8883('0x1b')](_0x8883('0x1e'),_0x5a1a00,_0x54c6b2['stack']);_0x3b29e2[_0x8883('0xe')]();}};}; \ 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 70d77b7..e0d9efe 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 _0xe977=['UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','YYYY-MM-DD\x20HH:mm:ss','channel','sms','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','InteractionId','created','isEmpty','body','create','then','catch','error','finally','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','toString','message','next','amazonlex','providerResponse','stringify','Message','dialogState','lodash','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','interaction'];(function(_0x2e9b83,_0x238187){var _0x569ce3=function(_0xbaf583){while(--_0xbaf583){_0x2e9b83['push'](_0x2e9b83['shift']());}};_0x569ce3(++_0x238187);}(_0xe977,0xd1));var _0x7e97=function(_0xfc98cb,_0x3aa3f5){_0xfc98cb=_0xfc98cb-0x0;var _0x256e19=_0xe977[_0xfc98cb];return _0x256e19;};'use strict';var _=require(_0x7e97('0x0'));var moment=require('moment');var AWS=require(_0x7e97('0x1'));var utils=require(_0x7e97('0x2'));var logger=require(_0x7e97('0x3'))(_0x7e97('0x4'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x7e97('0x5')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x7e97('0x6')),'faxMessage':require(_0x7e97('0x7')),'whatsappMessage':require(_0x7e97('0x8'))};exports[_0x7e97('0x9')]=function(_0x519cf2,_0x3ca53a){return function(_0x4168d2){try{if(!_['isNil'](this[_0x7e97('0xa')][_0x7e97('0xb')])){logger[_0x7e97('0xc')](_0x7e97('0xd'),_0x519cf2,_0x7e97('0xe'));return _0x4168d2['next']();}var _0x1b1a24={'ContactId':this[_0x7e97('0xf')]['id'],'sentAt':moment()['format'](_0x7e97('0x10')),'direction':'out'};if(this[_0x7e97('0x11')]===_0x7e97('0x12')||this[_0x7e97('0x11')]===_0x7e97('0x13')){_0x1b1a24[_0x7e97('0x14')]=this['interaction'][_0x7e97('0x14')];}var _0x315971=this[_0x7e97('0x11')];if(_0x315971===_0x7e97('0x15')){_0x1b1a24[_0x7e97('0x16')]=this[_0x7e97('0x17')]['id'];}else{_0x1b1a24[_[_0x7e97('0x18')](_0x315971)+'AccountId']=this[_0x7e97('0x17')]['id'];}_0x1b1a24[_[_0x7e97('0x18')](_0x315971)+_0x7e97('0x19')]=this['interaction']['id'];if(this[_0x7e97('0xa')][_0x7e97('0x1a')]){var _0x3c9971=_0x3ca53a[0x4];if(!_[_0x7e97('0x1b')](_0x3c9971)){_0x1b1a24[_0x7e97('0x1c')]=utils['getMustacheRender'](_0x3c9971,this);return rpc[_0x315971+'Message'][_0x7e97('0x1d')](_0x1b1a24)[_0x7e97('0x1e')](function(_0x49e8de){logger[_0x7e97('0xc')](_0x7e97('0xd'),_0x519cf2,_0x1b1a24[_0x7e97('0x1c')]);})[_0x7e97('0x1f')](function(_0xc739b0){logger[_0x7e97('0x20')](_0x7e97('0xd'),_0x519cf2,JSON['stringify'](_0xc739b0));})[_0x7e97('0x21')](function(){logger[_0x7e97('0xc')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x519cf2);_0x4168d2[_0x7e97('0x22')]();});}else{logger[_0x7e97('0xc')](_0x7e97('0x23'),_0x519cf2);_0x4168d2['stop']();}}else{var _0x55c099=this;var _0xd7d207=new AWS['LexRuntime']({'accessKeyId':_0x3ca53a[0x0],'secretAccessKey':_0x3ca53a[0x1],'region':_0x3ca53a[0x2]});var _0x1d886d={'botAlias':'$LATEST','botName':_0x3ca53a[0x3],'inputText':this['message'][_0x7e97('0x1c')],'userId':this[_0x7e97('0x11')]+':'+this[_0x7e97('0xa')]['id'][_0x7e97('0x24')]()};_0xd7d207['postText'](_0x1d886d,function(_0x4587f9,_0x4cf8c8){if(_0x4587f9){logger[_0x7e97('0x20')](_0x7e97('0xd'),_0x519cf2,_0x4587f9[_0x7e97('0x25')]);_0x4168d2[_0x7e97('0x26')]();}else if(_0x4cf8c8&&_0x4cf8c8['message']){_0x55c099[_0x7e97('0x1c')]['amazonlex']=_0x4cf8c8;_0x1b1a24['body']=_0x4cf8c8[_0x7e97('0x25')];_0x1b1a24['providerName']=_0x7e97('0x27');_0x1b1a24[_0x7e97('0x28')]=JSON[_0x7e97('0x29')](_0x4cf8c8);return rpc[_0x315971+_0x7e97('0x2a')]['create'](_0x1b1a24)[_0x7e97('0x1e')](function(_0x14c264){logger[_0x7e97('0xc')](_0x7e97('0xd'),_0x519cf2,_0x1b1a24[_0x7e97('0x1c')]);if(_0x4cf8c8[_0x7e97('0x2b')]=='Failed'){_0x4168d2[_0x7e97('0x26')]();}else{_0x4168d2['stop']();}})[_0x7e97('0x1f')](function(_0x5e0d60){logger[_0x7e97('0x20')](_0x7e97('0xd'),_0x519cf2,JSON[_0x7e97('0x29')](_0x5e0d60));_0x4168d2[_0x7e97('0x26')]();});}else{_0x4168d2['next']();}});}}catch(_0x440d94){logger['error']('[%s][AMAZONLEX]\x20%s',_0x519cf2,JSON[_0x7e97('0x29')](_0x440d94));_0x4168d2[_0x7e97('0x22')]();}};}; \ No newline at end of file +var _0x5421=['InteractionId','created','body','getMustacheRender','Message','create','then','catch','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','LexRuntime','$LATEST','message','toString','postText','next','amazonlex','providerName','providerResponse','dialogState','lodash','moment','aws-sdk','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','isNil','interaction','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','YYYY-MM-DD\x20HH:mm:ss','channel','sms','whatsapp','phone','chat','ChatWebsiteId','upperFirst','AccountId','account'];(function(_0xe0be82,_0x11d5a3){var _0x3297ee=function(_0x1779b7){while(--_0x1779b7){_0xe0be82['push'](_0xe0be82['shift']());}};_0x3297ee(++_0x11d5a3);}(_0x5421,0x1af));var _0x1542=function(_0x20c757,_0xf1f53b){_0x20c757=_0x20c757-0x0;var _0x2720f3=_0x5421[_0x20c757];return _0x2720f3;};'use strict';var _=require(_0x1542('0x0'));var moment=require(_0x1542('0x1'));var AWS=require(_0x1542('0x2'));var utils=require(_0x1542('0x3'));var logger=require(_0x1542('0x4'))('routing');var rpc={'chatMessage':require(_0x1542('0x5')),'openchannelMessage':require(_0x1542('0x6')),'mailMessage':require(_0x1542('0x7')),'smsMessage':require(_0x1542('0x8')),'faxMessage':require(_0x1542('0x9')),'whatsappMessage':require(_0x1542('0xa'))};exports['consequence']=function(_0x401bcd,_0x36eacf){return function(_0x359494){try{if(!_[_0x1542('0xb')](this[_0x1542('0xc')]['UserId'])){logger[_0x1542('0xd')](_0x1542('0xe'),_0x401bcd,_0x1542('0xf'));return _0x359494['next']();}var _0x5cf9f8={'ContactId':this[_0x1542('0x10')]['id'],'sentAt':moment()[_0x1542('0x11')](_0x1542('0x12')),'direction':'out'};if(this[_0x1542('0x13')]===_0x1542('0x14')||this['channel']===_0x1542('0x15')){_0x5cf9f8[_0x1542('0x16')]=this[_0x1542('0xc')][_0x1542('0x16')];}var _0x4fc7db=this[_0x1542('0x13')];if(_0x4fc7db===_0x1542('0x17')){_0x5cf9f8[_0x1542('0x18')]=this['account']['id'];}else{_0x5cf9f8[_[_0x1542('0x19')](_0x4fc7db)+_0x1542('0x1a')]=this[_0x1542('0x1b')]['id'];}_0x5cf9f8[_[_0x1542('0x19')](_0x4fc7db)+_0x1542('0x1c')]=this['interaction']['id'];if(this[_0x1542('0xc')][_0x1542('0x1d')]){var _0x139ab5=_0x36eacf[0x4];if(!_['isEmpty'](_0x139ab5)){_0x5cf9f8[_0x1542('0x1e')]=utils[_0x1542('0x1f')](_0x139ab5,this);return rpc[_0x4fc7db+_0x1542('0x20')][_0x1542('0x21')](_0x5cf9f8)[_0x1542('0x22')](function(_0x5c2bfb){logger[_0x1542('0xd')](_0x1542('0xe'),_0x401bcd,_0x5cf9f8[_0x1542('0x1e')]);})[_0x1542('0x23')](function(_0x459a75){logger[_0x1542('0x24')](_0x1542('0xe'),_0x401bcd,JSON[_0x1542('0x25')](_0x459a75));})[_0x1542('0x26')](function(){logger[_0x1542('0xd')](_0x1542('0x27'),_0x401bcd);_0x359494['stop']();});}else{logger[_0x1542('0xd')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x401bcd);_0x359494[_0x1542('0x28')]();}}else{var _0xc7c9ca=this;var _0x28cc0a=new AWS[(_0x1542('0x29'))]({'accessKeyId':_0x36eacf[0x0],'secretAccessKey':_0x36eacf[0x1],'region':_0x36eacf[0x2]});var _0x3fd6ca={'botAlias':_0x1542('0x2a'),'botName':_0x36eacf[0x3],'inputText':this[_0x1542('0x2b')][_0x1542('0x1e')],'userId':this[_0x1542('0x13')]+':'+this[_0x1542('0xc')]['id'][_0x1542('0x2c')]()};_0x28cc0a[_0x1542('0x2d')](_0x3fd6ca,function(_0x37c69e,_0x6094e4){if(_0x37c69e){logger[_0x1542('0x24')](_0x1542('0xe'),_0x401bcd,_0x37c69e[_0x1542('0x2b')]);_0x359494[_0x1542('0x2e')]();}else if(_0x6094e4&&_0x6094e4[_0x1542('0x2b')]){_0xc7c9ca[_0x1542('0x1e')][_0x1542('0x2f')]=_0x6094e4;_0x5cf9f8[_0x1542('0x1e')]=_0x6094e4[_0x1542('0x2b')];_0x5cf9f8[_0x1542('0x30')]=_0x1542('0x2f');_0x5cf9f8[_0x1542('0x31')]=JSON[_0x1542('0x25')](_0x6094e4);return rpc[_0x4fc7db+'Message'][_0x1542('0x21')](_0x5cf9f8)[_0x1542('0x22')](function(_0x305636){logger[_0x1542('0xd')]('[%s][AMAZONLEX]\x20%s',_0x401bcd,_0x5cf9f8[_0x1542('0x1e')]);if(_0x6094e4[_0x1542('0x32')]=='Failed'){_0x359494[_0x1542('0x2e')]();}else{_0x359494[_0x1542('0x28')]();}})['catch'](function(_0x398bc9){logger[_0x1542('0x24')]('[%s][AMAZONLEX]\x20%s',_0x401bcd,JSON[_0x1542('0x25')](_0x398bc9));_0x359494[_0x1542('0x2e')]();});}else{_0x359494[_0x1542('0x2e')]();}});}}catch(_0x48bb55){logger[_0x1542('0x24')]('[%s][AMAZONLEX]\x20%s',_0x401bcd,JSON[_0x1542('0x25')](_0x48bb55));_0x359494[_0x1542('0x28')]();}};}; \ 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 1ba74dd..55687c6 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 _0x7f3f=['../../rpc/smsInteraction','../../rpc/faxInteraction','consequence','channel','mail','info','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','[%s][AUTOREPLY]\x20%s','Autoreply\x20already\x20sent','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','body','getMustacheRender','message','from','phone','read','subject','startsWith','Re:','chat','account','upperFirst','AccountId','InteractionId','Smtp','service','port','secure','auth','user','pass','inReplyTo','messageId','','replace','','headers','auto-replied','All','auto_reply','sendMailMessage','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','then','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','autoreplyExecuted','Interaction','update','Message','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','lodash','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/mailInteraction'];(function(_0xd8b89f,_0x6312f4){var _0x3c6e90=function(_0x182d8a){while(--_0x182d8a){_0xd8b89f['push'](_0xd8b89f['shift']());}};_0x3c6e90(++_0x6312f4);}(_0x7f3f,0x169));var _0xf7f3=function(_0x4aa4af,_0x210cde){_0x4aa4af=_0x4aa4af-0x0;var _0x3bf44a=_0x7f3f[_0x4aa4af];return _0x3bf44a;};'use strict';var _=require(_0xf7f3('0x0'));var moment=require('moment');var utils=require(_0xf7f3('0x1'));var logger=require(_0xf7f3('0x2'))('routing');var rpc={'chatMessage':require(_0xf7f3('0x3')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xf7f3('0x4')),'smsMessage':require(_0xf7f3('0x5')),'faxMessage':require(_0xf7f3('0x6')),'whatsappMessage':require(_0xf7f3('0x7')),'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require(_0xf7f3('0x8')),'smsInteraction':require(_0xf7f3('0x9')),'faxInteraction':require(_0xf7f3('0xa')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var mailRpc=require('../../mailRpc');exports[_0xf7f3('0xb')]=function(_0x879269,_0x27b8d2,_0x47445f,_0x1b6fb6){return function(_0x4a1292){try{var _0x28e352=this[_0xf7f3('0xc')];if(_0x28e352===_0xf7f3('0xd')&&_0x1b6fb6['body']['isAutoreply']){logger[_0xf7f3('0xe')]('[%s][AUTOREPLY]\x20%s',_0x879269,_0xf7f3('0xf'));return _0x4a1292[_0xf7f3('0x10')]();}if(_0x27b8d2[0x0]==='1'&&(_[_0xf7f3('0x11')](this[_0xf7f3('0x12')][_0xf7f3('0x13')])||!this['interaction'][_0xf7f3('0x13')])){logger[_0xf7f3('0xe')](_0xf7f3('0x14'),_0x879269,_0xf7f3('0x15'));return _0x4a1292[_0xf7f3('0x10')]();}if(_0x27b8d2[0x0]==='2'&&this[_0xf7f3('0x12')]['autoreplyExecuted']){logger[_0xf7f3('0xe')](_0xf7f3('0x16'),_0x879269,_0xf7f3('0x17'));return _0x4a1292['next']();}var _0x3870a8={'ContactId':this[_0xf7f3('0x18')]['id'],'sentAt':moment()[_0xf7f3('0x19')](_0xf7f3('0x1a')),'direction':_0xf7f3('0x1b')};if(this[_0xf7f3('0xc')]===_0xf7f3('0xd')){_0x3870a8[_0xf7f3('0x1c')]=utils[_0xf7f3('0x1d')](_0x27b8d2[0x2],this);}else{_0x3870a8[_0xf7f3('0x1c')]=utils[_0xf7f3('0x1d')](_0x27b8d2[0x1],this);}if(this[_0xf7f3('0x1e')]){_0x3870a8['to']=this[_0xf7f3('0x1e')][_0xf7f3('0x1f')]||'';if(this[_0xf7f3('0xc')]===_0xf7f3('0xd')&&_0x27b8d2[0x1]==='1'){_0x3870a8['cc']=this[_0xf7f3('0x1e')]['cc']||'';}_0x3870a8['from']=this['message']['to']||'';_0x3870a8[_0xf7f3('0x20')]=this['message']['phone']||'';_0x3870a8[_0xf7f3('0x21')]=!![];if(this['message'][_0xf7f3('0x22')]){_0x3870a8[_0xf7f3('0x22')]='';_0x3870a8[_0xf7f3('0x22')]+=_[_0xf7f3('0x23')](this[_0xf7f3('0x1e')]['subject'],_0xf7f3('0x24'))?'':'Re:\x20';_0x3870a8[_0xf7f3('0x22')]+=this[_0xf7f3('0x1e')][_0xf7f3('0x22')];}}if(this['channel']===_0xf7f3('0x25')){_0x3870a8['ChatWebsiteId']=this[_0xf7f3('0x26')]['id'];}else{_0x3870a8[_[_0xf7f3('0x27')](this[_0xf7f3('0xc')])+_0xf7f3('0x28')]=this[_0xf7f3('0x26')]['id'];}_0x3870a8[_[_0xf7f3('0x27')](this[_0xf7f3('0xc')])+_0xf7f3('0x29')]=this[_0xf7f3('0x12')]['id'];var _0x4532a6=this[_0xf7f3('0x12')];if(rpc[this[_0xf7f3('0xc')]+'Message']){if(this[_0xf7f3('0xc')]==='mail'){var _0x19a011={'tls':{'rejectUnauthorized':![]}};if(this['account'][_0xf7f3('0x2a')][_0xf7f3('0x2b')]){_0x19a011[_0xf7f3('0x2b')]=this['account']['Smtp'][_0xf7f3('0x2b')];}else{_0x19a011['host']=this['account']['Smtp']['host'];_0x19a011[_0xf7f3('0x2c')]=this[_0xf7f3('0x26')][_0xf7f3('0x2a')][_0xf7f3('0x2c')];_0x19a011[_0xf7f3('0x2d')]=this['account']['Smtp'][_0xf7f3('0x2d')];}if(this['account']['Smtp']['authentication']){_0x19a011[_0xf7f3('0x2e')]={'user':this['account'][_0xf7f3('0x2a')][_0xf7f3('0x2f')],'pass':this[_0xf7f3('0x26')][_0xf7f3('0x2a')][_0xf7f3('0x30')]};}_0x3870a8[_0xf7f3('0x31')]=this[_0xf7f3('0x1e')][_0xf7f3('0x32')];_0x3870a8['html']=_0xf7f3('0x33')+_[_0xf7f3('0x34')](_0x3870a8[_0xf7f3('0x1c')],'','headers','auto-replied','All','sendMailMessage','[%s][AUTOREPLY]\x20SMTP\x20SENT','stringify','catch','[RPC][%s][AUTOREPLY]\x20%s','finally','then','Interaction','update','error','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','create','lodash','moment','./utils','../../rpc/chatMessage','../../rpc/smsMessage'];(function(_0x214991,_0x1fc255){var _0x13c48a=function(_0x1476d4){while(--_0x1476d4){_0x214991['push'](_0x214991['shift']());}};_0x13c48a(++_0x1fc255);}(_0xc9d9,0xd6));var _0x9c9d=function(_0x12d9f0,_0x59181d){_0x12d9f0=_0x12d9f0-0x0;var _0x473fb6=_0xc9d9[_0x12d9f0];return _0x473fb6;};'use strict';var _=require(_0x9c9d('0x0'));var moment=require(_0x9c9d('0x1'));var utils=require(_0x9c9d('0x2'));var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require(_0x9c9d('0x3')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x9c9d('0x4')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x9c9d('0x5')),'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x9c9d('0x6')),'mailInteraction':require(_0x9c9d('0x7')),'smsInteraction':require(_0x9c9d('0x8')),'faxInteraction':require(_0x9c9d('0x9')),'whatsappInteraction':require(_0x9c9d('0xa'))};var mailRpc=require(_0x9c9d('0xb'));exports[_0x9c9d('0xc')]=function(_0x426909,_0x222f48,_0x44f28d,_0x698649){return function(_0x52f30b){try{var _0x357d01=this['channel'];if(_0x357d01===_0x9c9d('0xd')&&_0x698649[_0x9c9d('0xe')]['isAutoreply']){logger[_0x9c9d('0xf')](_0x9c9d('0x10'),_0x426909,_0x9c9d('0x11'));return _0x52f30b['next']();}if(_0x222f48[0x0]==='1'&&(_['isNil'](this[_0x9c9d('0x12')]['created'])||!this['interaction'][_0x9c9d('0x13')])){logger[_0x9c9d('0xf')]('[%s][AUTOREPLY]\x20%s',_0x426909,_0x9c9d('0x14'));return _0x52f30b['next']();}if(_0x222f48[0x0]==='2'&&this[_0x9c9d('0x12')][_0x9c9d('0x15')]){logger[_0x9c9d('0xf')](_0x9c9d('0x16'),_0x426909,_0x9c9d('0x17'));return _0x52f30b[_0x9c9d('0x18')]();}var _0x285115={'ContactId':this[_0x9c9d('0x19')]['id'],'sentAt':moment()[_0x9c9d('0x1a')](_0x9c9d('0x1b')),'direction':_0x9c9d('0x1c')};if(this['channel']==='mail'){_0x285115['body']=utils[_0x9c9d('0x1d')](_0x222f48[0x2],this);}else{_0x285115[_0x9c9d('0xe')]=utils['getMustacheRender'](_0x222f48[0x1],this);}if(this[_0x9c9d('0x1e')]){_0x285115['to']=this[_0x9c9d('0x1e')][_0x9c9d('0x1f')]||'';if(this[_0x9c9d('0x20')]===_0x9c9d('0xd')&&_0x222f48[0x1]==='1'){_0x285115['cc']=this[_0x9c9d('0x1e')]['cc']||'';}_0x285115[_0x9c9d('0x1f')]=this[_0x9c9d('0x1e')]['to']||'';_0x285115['phone']=this[_0x9c9d('0x1e')][_0x9c9d('0x21')]||'';_0x285115[_0x9c9d('0x22')]=!![];if(this['message'][_0x9c9d('0x23')]){_0x285115['subject']='';_0x285115[_0x9c9d('0x23')]+=_[_0x9c9d('0x24')](this[_0x9c9d('0x1e')]['subject'],'Re:')?'':'Re:\x20';_0x285115['subject']+=this[_0x9c9d('0x1e')]['subject'];}}if(this['channel']===_0x9c9d('0x25')){_0x285115[_0x9c9d('0x26')]=this[_0x9c9d('0x27')]['id'];}else{_0x285115[_[_0x9c9d('0x28')](this[_0x9c9d('0x20')])+_0x9c9d('0x29')]=this[_0x9c9d('0x27')]['id'];}_0x285115[_[_0x9c9d('0x28')](this[_0x9c9d('0x20')])+_0x9c9d('0x2a')]=this[_0x9c9d('0x12')]['id'];var _0x13efc1=this[_0x9c9d('0x12')];if(rpc[this[_0x9c9d('0x20')]+_0x9c9d('0x2b')]){if(this[_0x9c9d('0x20')]===_0x9c9d('0xd')){var _0x279b88={'tls':{'rejectUnauthorized':![]}};if(this[_0x9c9d('0x27')][_0x9c9d('0x2c')][_0x9c9d('0x2d')]){_0x279b88[_0x9c9d('0x2d')]=this[_0x9c9d('0x27')][_0x9c9d('0x2c')][_0x9c9d('0x2d')];}else{_0x279b88[_0x9c9d('0x2e')]=this[_0x9c9d('0x27')]['Smtp'][_0x9c9d('0x2e')];_0x279b88[_0x9c9d('0x2f')]=this[_0x9c9d('0x27')]['Smtp'][_0x9c9d('0x2f')];_0x279b88[_0x9c9d('0x30')]=this[_0x9c9d('0x27')][_0x9c9d('0x2c')][_0x9c9d('0x30')];}if(this[_0x9c9d('0x27')][_0x9c9d('0x2c')][_0x9c9d('0x31')]){_0x279b88[_0x9c9d('0x32')]={'user':this[_0x9c9d('0x27')][_0x9c9d('0x2c')][_0x9c9d('0x33')],'pass':this['account'][_0x9c9d('0x2c')]['pass']};}_0x285115['inReplyTo']=this[_0x9c9d('0x1e')][_0x9c9d('0x34')];_0x285115[_0x9c9d('0x35')]=''+_[_0x9c9d('0x36')](_0x285115[_0x9c9d('0xe')],_0x9c9d('0x37'),_0x9c9d('0x38'))+_0x9c9d('0x39');_0x285115[_0x9c9d('0x3a')]={'Auto-Submitted':_0x9c9d('0x3b'),'X-Auto-Response-Suppress':_0x9c9d('0x3c'),'Precedence':'auto_reply'};return mailRpc[_0x9c9d('0x3d')](_0x279b88,_0x285115)['then'](function(_0x16f58e){logger['info'](_0x9c9d('0x3e'),_0x426909);_0x285115['messageId']=_0x16f58e[_0x9c9d('0x1e')][_0x9c9d('0x34')];return rpc[_0x357d01+_0x9c9d('0x2b')]['create'](_0x285115);})['then'](function(_0x39aae5){logger[_0x9c9d('0xf')](_0x9c9d('0x10'),_0x426909,JSON[_0x9c9d('0x3f')](_0x39aae5));})[_0x9c9d('0x40')](function(_0x30ba61){logger['error'](_0x9c9d('0x41'),_0x426909,JSON[_0x9c9d('0x3f')](_0x30ba61));})[_0x9c9d('0x42')](function(){Promise['resolve']()[_0x9c9d('0x43')](function(){if(_0x222f48[0x0]!=='2'||_0x13efc1[_0x9c9d('0x15')])return;return rpc[_0x357d01+_0x9c9d('0x44')][_0x9c9d('0x45')](_0x13efc1['id'],{'autoreplyExecuted':!![]})['then'](function(_0x11e0bc){logger[_0x9c9d('0xf')](_0x9c9d('0x16'),_0x426909,JSON[_0x9c9d('0x3f')](_0x11e0bc));})['catch'](function(_0x1bda1b){logger[_0x9c9d('0x46')](_0x9c9d('0x47'),_0x426909,JSON[_0x9c9d('0x3f')](_0x1bda1b));});})['then'](function(){_0x52f30b[_0x9c9d('0x18')]();});});}else{return rpc[this[_0x9c9d('0x20')]+_0x9c9d('0x2b')][_0x9c9d('0x48')](_0x285115)['then'](function(_0x5107a9){logger['info'](_0x9c9d('0x10'),_0x426909,_0x285115[_0x9c9d('0xe')]);})[_0x9c9d('0x40')](function(_0x24317c){logger[_0x9c9d('0x46')](_0x9c9d('0x10'),_0x426909,JSON[_0x9c9d('0x3f')](_0x24317c));})[_0x9c9d('0x42')](function(){Promise['resolve']()['then'](function(){if(_0x222f48[0x0]!=='2'||_0x13efc1[_0x9c9d('0x15')])return;return rpc[_0x357d01+_0x9c9d('0x44')][_0x9c9d('0x45')](_0x13efc1['id'],{'autoreplyExecuted':!![]})[_0x9c9d('0x43')](function(_0x4d4826){logger[_0x9c9d('0xf')](_0x9c9d('0x16'),_0x426909,JSON[_0x9c9d('0x3f')](_0x4d4826));})[_0x9c9d('0x40')](function(_0x2a044a){logger[_0x9c9d('0x46')]('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x426909,JSON['stringify'](_0x2a044a));});})[_0x9c9d('0x43')](function(){_0x52f30b[_0x9c9d('0x18')]();});});}}}catch(_0x1df718){logger[_0x9c9d('0x46')]('[%s][AUTOREPLY]\x20%s',_0x426909,JSON[_0x9c9d('0x3f')](_0x1df718));_0x52f30b['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/close.js b/server/services/routing/server/applications/close.js index 0897aaf..6f2e29a 100644 --- a/server/services/routing/server/applications/close.js +++ b/server/services/routing/server/applications/close.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x62ab=['interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','[%s][CLOSE]\x20%s','stringify','stop','routing','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','info','[%s][CLOSE]\x20reason\x20%s','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction'];(function(_0x25fb9a,_0x70e0d0){var _0x1cacd9=function(_0x647f5){while(--_0x647f5){_0x25fb9a['push'](_0x25fb9a['shift']());}};_0x1cacd9(++_0x70e0d0);}(_0x62ab,0x198));var _0xb62a=function(_0x1b3ae6,_0x9ef20c){_0x1b3ae6=_0x1b3ae6-0x0;var _0x5c14cd=_0x62ab[_0x1b3ae6];return _0x5c14cd;};'use strict';var moment=require('moment');var logger=require('../../../../config/logger')(_0xb62a('0x0'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0xb62a('0x1')),'smsInteraction':require(_0xb62a('0x2')),'mailInteraction':require(_0xb62a('0x3')),'faxInteraction':require(_0xb62a('0x4')),'whatsappInteraction':require(_0xb62a('0x5'))};exports['consequence']=function(_0x5eaf0c,_0x2e48e6,_0x2b2e6d,_0x4772f5){return function(_0x57688b){try{logger[_0xb62a('0x6')](_0xb62a('0x7'),_0x5eaf0c,_0x2e48e6[0x0]);var _0x9c8b63={'closed':0x1,'closedAt':moment()['format'](_0xb62a('0x8')),'closeReason':_0xb62a('0x9'),'disposition':_0x2e48e6[0x0]};if(rpc[_0x4772f5[_0xb62a('0xa')]+'Interaction']){rpc[_0x4772f5[_0xb62a('0xa')]+_0xb62a('0xb')]['update'](_0x4772f5[_0xb62a('0xc')]['id'],_0x9c8b63)[_0xb62a('0xd')](function(_0x272034){logger[_0xb62a('0x6')](_0xb62a('0xe'),_0x5eaf0c,_0x4772f5['interaction']['id']);})[_0xb62a('0xf')](function(_0x4b621d){logger[_0xb62a('0x10')](_0xb62a('0x11'),_0x5eaf0c,JSON[_0xb62a('0x12')](_0x4b621d));})['finally'](function(){_0x57688b[_0xb62a('0x13')]();});}}catch(_0x56d226){logger[_0xb62a('0x10')](_0xb62a('0x11'),_0x5eaf0c,JSON[_0xb62a('0x12')](_0x56d226));_0x57688b[_0xb62a('0x13')]();}};}; \ No newline at end of file +var _0xefed=['moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','YYYY-MM-DD\x20HH:mm:ss','Interaction','channel','update','interaction','then','catch','error','stringify','finally','stop','[%s][CLOSE]\x20%s'];(function(_0xf42eac,_0x5a74c7){var _0xc22667=function(_0x3dfbe3){while(--_0x3dfbe3){_0xf42eac['push'](_0xf42eac['shift']());}};_0xc22667(++_0x5a74c7);}(_0xefed,0x176));var _0xdefe=function(_0x39c734,_0x2f3e06){_0x39c734=_0x39c734-0x0;var _0xb2a2f9=_0xefed[_0x39c734];return _0xb2a2f9;};'use strict';var moment=require(_0xdefe('0x0'));var logger=require(_0xdefe('0x1'))(_0xdefe('0x2'));var rpc={'chatInteraction':require(_0xdefe('0x3')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0xdefe('0x4')),'mailInteraction':require(_0xdefe('0x5')),'faxInteraction':require(_0xdefe('0x6')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};exports[_0xdefe('0x7')]=function(_0x1d5f81,_0x4b4879,_0x171979,_0x525534){return function(_0x21427b){try{logger[_0xdefe('0x8')](_0xdefe('0x9'),_0x1d5f81,_0x4b4879[0x0]);var _0x29cba4={'closed':0x1,'closedAt':moment()['format'](_0xdefe('0xa')),'closeReason':'system','disposition':_0x4b4879[0x0]};if(rpc[_0x525534['channel']+_0xdefe('0xb')]){rpc[_0x525534[_0xdefe('0xc')]+_0xdefe('0xb')][_0xdefe('0xd')](_0x525534[_0xdefe('0xe')]['id'],_0x29cba4)[_0xdefe('0xf')](function(_0x42f559){logger[_0xdefe('0x8')]('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0x1d5f81,_0x525534[_0xdefe('0xe')]['id']);})[_0xdefe('0x10')](function(_0x111f35){logger[_0xdefe('0x11')]('[%s][CLOSE]\x20%s',_0x1d5f81,JSON[_0xdefe('0x12')](_0x111f35));})[_0xdefe('0x13')](function(){_0x21427b[_0xdefe('0x14')]();});}}catch(_0x427437){logger[_0xdefe('0x11')](_0xdefe('0x15'),_0x1d5f81,JSON[_0xdefe('0x12')](_0x427437));_0x21427b['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflow.js b/server/services/routing/server/applications/dialogflow.js index 85319ba..b012c04 100644 --- a/server/services/routing/server/applications/dialogflow.js +++ b/server/services/routing/server/applications/dialogflow.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x855f=['YYYY-MM-DD\x20HH:mm:ss','channel','sms','phone','chat','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','isEmpty','body','getMustacheRender','create','then','catch','error','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','result','speech','providerName','dialogflow','providerResponse','metadata','endConversation','message','lodash','apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format'];(function(_0xd854e5,_0x1759ab){var _0x1a7038=function(_0x2108a0){while(--_0x2108a0){_0xd854e5['push'](_0xd854e5['shift']());}};_0x1a7038(++_0x1759ab);}(_0x855f,0x145));var _0xf855=function(_0x17dea0,_0x4443b5){_0x17dea0=_0x17dea0-0x0;var _0x3a87d1=_0x855f[_0x17dea0];return _0x3a87d1;};'use strict';var _=require(_0xf855('0x0'));var moment=require('moment');var apiai=require(_0xf855('0x1'));var md5=require(_0xf855('0x2'));var utils=require(_0xf855('0x3'));var logger=require(_0xf855('0x4'))(_0xf855('0x5'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xf855('0x6')),'mailMessage':require(_0xf855('0x7')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xf855('0x8'))};exports[_0xf855('0x9')]=function(_0x41e1ac,_0x35cc05){return function(_0xe6470d){try{if(!_[_0xf855('0xa')](this[_0xf855('0xb')]['UserId'])){logger[_0xf855('0xc')](_0xf855('0xd'),_0x41e1ac,_0xf855('0xe'));return _0xe6470d[_0xf855('0xf')]();}var _0x88e71b={'ContactId':this[_0xf855('0x10')]['id'],'sentAt':moment()[_0xf855('0x11')](_0xf855('0x12')),'direction':'out'};if(this[_0xf855('0x13')]===_0xf855('0x14')||this[_0xf855('0x13')]==='whatsapp'){_0x88e71b[_0xf855('0x15')]=this[_0xf855('0xb')][_0xf855('0x15')];}var _0xc44fdb=this[_0xf855('0x13')];if(_0xc44fdb===_0xf855('0x16')){_0x88e71b[_0xf855('0x17')]=this['account']['id'];}else{_0x88e71b[_[_0xf855('0x18')](_0xc44fdb)+_0xf855('0x19')]=this[_0xf855('0x1a')]['id'];}_0x88e71b[_[_0xf855('0x18')](_0xc44fdb)+_0xf855('0x1b')]=this[_0xf855('0xb')]['id'];if(this[_0xf855('0xb')]['created']){var _0x5e7439=_0x35cc05[0x2];if(!_[_0xf855('0x1c')](_0x5e7439)){_0x88e71b[_0xf855('0x1d')]=utils[_0xf855('0x1e')](_0x5e7439,this);return rpc[_0xc44fdb+'Message'][_0xf855('0x1f')](_0x88e71b)[_0xf855('0x20')](function(_0x56438d){logger['info'](_0xf855('0xd'),_0x41e1ac,_0x88e71b[_0xf855('0x1d')]);})[_0xf855('0x21')](function(_0xd3e22f){logger[_0xf855('0x22')](_0xf855('0xd'),_0x41e1ac,JSON[_0xf855('0x23')](_0xd3e22f));})[_0xf855('0x24')](function(){logger[_0xf855('0xc')](_0xf855('0x25'),_0x41e1ac);_0xe6470d[_0xf855('0x26')]();});}else{logger[_0xf855('0xc')](_0xf855('0x27'),_0x41e1ac);_0xe6470d['stop']();}}else{var _0x343712=this;var _0x247345=apiai(_0x35cc05[0x0],{'language':_0x35cc05[0x1]||'en'});return _0x247345[_0xf855('0x28')](this['message'][_0xf855('0x1d')],{'sessionId':md5(this['interaction']['id'])})[_0xf855('0x20')](function(_0xffd637){_0x343712[_0xf855('0x1d')]['dialogflow']=_0xffd637;_0x88e71b[_0xf855('0x1d')]=_0xffd637[_0xf855('0x29')]['fulfillment'][_0xf855('0x2a')];_0x88e71b[_0xf855('0x2b')]=_0xf855('0x2c');_0x88e71b[_0xf855('0x2d')]=JSON[_0xf855('0x23')](_0xffd637);return rpc[_0xc44fdb+'Message']['create'](_0x88e71b)[_0xf855('0x20')](function(_0x482ae){logger['info'](_0xf855('0xd'),_0x41e1ac,_0x88e71b[_0xf855('0x1d')]);if(_0xffd637[_0xf855('0x29')][_0xf855('0x2e')][_0xf855('0x2f')]){_0xe6470d[_0xf855('0xf')]();}else{_0xe6470d[_0xf855('0x26')]();}})[_0xf855('0x21')](function(_0x8b8416){logger[_0xf855('0x22')](_0xf855('0xd'),_0x41e1ac,JSON['stringify'](_0x8b8416));_0xe6470d[_0xf855('0xf')]();});})['catch'](function(_0x515e32){logger['error'](_0xf855('0xd'),_0x41e1ac,_0x515e32[_0xf855('0x30')]);_0xe6470d[_0xf855('0xf')]();});}}catch(_0x2791ca){logger['error'](_0xf855('0xd'),_0x41e1ac,JSON[_0xf855('0x23')](_0x2791ca));_0xe6470d[_0xf855('0x26')]();}};}; \ No newline at end of file +var _0x3595=['format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','AccountId','account','upperFirst','InteractionId','isEmpty','body','Message','create','then','catch','stringify','finally','stop','textRequest','message','dialogflow','result','fulfillment','speech','providerName','providerResponse','endConversation','next','error','lodash','moment','apiai-promise','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s'];(function(_0x4baf73,_0x4d5f13){var _0x14299d=function(_0x5f0f0a){while(--_0x5f0f0a){_0x4baf73['push'](_0x4baf73['shift']());}};_0x14299d(++_0x4d5f13);}(_0x3595,0x147));var _0x5359=function(_0x52d7ac,_0x42eec5){_0x52d7ac=_0x52d7ac-0x0;var _0x83b94d=_0x3595[_0x52d7ac];return _0x83b94d;};'use strict';var _=require(_0x5359('0x0'));var moment=require(_0x5359('0x1'));var apiai=require(_0x5359('0x2'));var md5=require('md5');var utils=require(_0x5359('0x3'));var logger=require(_0x5359('0x4'))(_0x5359('0x5'));var rpc={'chatMessage':require(_0x5359('0x6')),'openchannelMessage':require(_0x5359('0x7')),'mailMessage':require(_0x5359('0x8')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x5359('0x9'))};exports[_0x5359('0xa')]=function(_0x1b6f48,_0x29a776){return function(_0x39fcd8){try{if(!_[_0x5359('0xb')](this[_0x5359('0xc')][_0x5359('0xd')])){logger[_0x5359('0xe')](_0x5359('0xf'),_0x1b6f48,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x39fcd8['next']();}var _0x4c70d7={'ContactId':this['contact']['id'],'sentAt':moment()[_0x5359('0x10')](_0x5359('0x11')),'direction':_0x5359('0x12')};if(this[_0x5359('0x13')]===_0x5359('0x14')||this[_0x5359('0x13')]===_0x5359('0x15')){_0x4c70d7[_0x5359('0x16')]=this[_0x5359('0xc')][_0x5359('0x16')];}var _0x272dbc=this[_0x5359('0x13')];if(_0x272dbc===_0x5359('0x17')){_0x4c70d7[_0x5359('0x18')]=this['account']['id'];}else{_0x4c70d7[_['upperFirst'](_0x272dbc)+_0x5359('0x19')]=this[_0x5359('0x1a')]['id'];}_0x4c70d7[_[_0x5359('0x1b')](_0x272dbc)+_0x5359('0x1c')]=this[_0x5359('0xc')]['id'];if(this[_0x5359('0xc')]['created']){var _0x5399bb=_0x29a776[0x2];if(!_[_0x5359('0x1d')](_0x5399bb)){_0x4c70d7[_0x5359('0x1e')]=utils['getMustacheRender'](_0x5399bb,this);return rpc[_0x272dbc+_0x5359('0x1f')][_0x5359('0x20')](_0x4c70d7)[_0x5359('0x21')](function(_0x2d0962){logger['info']('[%s][DIALOGFLOW]\x20%s',_0x1b6f48,_0x4c70d7['body']);})[_0x5359('0x22')](function(_0x3f5ec2){logger['error'](_0x5359('0xf'),_0x1b6f48,JSON[_0x5359('0x23')](_0x3f5ec2));})[_0x5359('0x24')](function(){logger[_0x5359('0xe')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x1b6f48);_0x39fcd8[_0x5359('0x25')]();});}else{logger[_0x5359('0xe')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x1b6f48);_0x39fcd8[_0x5359('0x25')]();}}else{var _0x27749e=this;var _0x3d3c0c=apiai(_0x29a776[0x0],{'language':_0x29a776[0x1]||'en'});return _0x3d3c0c[_0x5359('0x26')](this[_0x5359('0x27')]['body'],{'sessionId':md5(this['interaction']['id'])})[_0x5359('0x21')](function(_0xc2eb10){_0x27749e[_0x5359('0x1e')][_0x5359('0x28')]=_0xc2eb10;_0x4c70d7[_0x5359('0x1e')]=_0xc2eb10[_0x5359('0x29')][_0x5359('0x2a')][_0x5359('0x2b')];_0x4c70d7[_0x5359('0x2c')]='dialogflow';_0x4c70d7[_0x5359('0x2d')]=JSON[_0x5359('0x23')](_0xc2eb10);return rpc[_0x272dbc+_0x5359('0x1f')][_0x5359('0x20')](_0x4c70d7)[_0x5359('0x21')](function(_0x402bce){logger['info'](_0x5359('0xf'),_0x1b6f48,_0x4c70d7['body']);if(_0xc2eb10[_0x5359('0x29')]['metadata'][_0x5359('0x2e')]){_0x39fcd8[_0x5359('0x2f')]();}else{_0x39fcd8['stop']();}})[_0x5359('0x22')](function(_0x5766e3){logger[_0x5359('0x30')](_0x5359('0xf'),_0x1b6f48,JSON[_0x5359('0x23')](_0x5766e3));_0x39fcd8[_0x5359('0x2f')]();});})[_0x5359('0x22')](function(_0x3a2552){logger[_0x5359('0x30')](_0x5359('0xf'),_0x1b6f48,_0x3a2552[_0x5359('0x27')]);_0x39fcd8[_0x5359('0x2f')]();});}}catch(_0xf952d8){logger[_0x5359('0x30')](_0x5359('0xf'),_0x1b6f48,JSON[_0x5359('0x23')](_0xf952d8));_0x39fcd8[_0x5359('0x25')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflowV2.js b/server/services/routing/server/applications/dialogflowV2.js index 03807d9..c3ffcf8 100644 --- a/server/services/routing/server/applications/dialogflowV2.js +++ b/server/services/routing/server/applications/dialogflowV2.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe0e7=['catch','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','SessionsClient','sessionPath','message','detectIntent','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','boolValue','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_INTENTNAME','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerResponse','length','push','fulfillmentText','all','stringify','dialogflow','md5','moment','bluebird','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','clone','create','then','info','[%s][DIALOGFLOWV2]\x20%s','error','consequence','isNil','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','body','getMustacheRender'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xe0e7,0x1a2));var _0x7e0e=function(_0x44a75b,_0x3b156a){_0x44a75b=_0x44a75b-0x0;var _0x424fc0=_0xe0e7[_0x44a75b];return _0x424fc0;};'use strict';var _=require('lodash');var dialogflow=require(_0x7e0e('0x0'));var md5=require(_0x7e0e('0x1'));var moment=require(_0x7e0e('0x2'));var Promise=require(_0x7e0e('0x3'));var logger=require(_0x7e0e('0x4'))(_0x7e0e('0x5'));var utils=require('./utils');var rpc={'chatMessage':require(_0x7e0e('0x6')),'openchannelMessage':require(_0x7e0e('0x7')),'mailMessage':require(_0x7e0e('0x8')),'smsMessage':require(_0x7e0e('0x9')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x7e0e('0xa'))};function createMessage(_0x7fafd2,_0x146542,_0x48586b,_0x339444){return new Promise(function(_0x551c4f,_0x4619fd){var _0x479cd0=_[_0x7e0e('0xb')](_0x48586b);_0x479cd0['body']=_0x339444;return rpc[_0x146542+'Message'][_0x7e0e('0xc')](_0x479cd0)[_0x7e0e('0xd')](function(){logger[_0x7e0e('0xe')](_0x7e0e('0xf'),_0x7fafd2,_0x479cd0['body']);_0x551c4f();})['catch'](function(_0x11ba36){logger[_0x7e0e('0x10')](_0x7e0e('0xf'),_0x7fafd2,JSON['stringify'](_0x11ba36));_0x4619fd(_0x11ba36);});});}exports[_0x7e0e('0x11')]=function(_0x2bfaed,_0x4ff342){return function(_0x331b66){try{if(!_[_0x7e0e('0x12')](this[_0x7e0e('0x13')][_0x7e0e('0x14')])){logger['info'](_0x7e0e('0xf'),_0x2bfaed,_0x7e0e('0x15'));return _0x331b66[_0x7e0e('0x16')]();}var _0x2e2717={'ContactId':this['contact']['id'],'sentAt':moment()['format'](_0x7e0e('0x17')),'direction':_0x7e0e('0x18')};if(this[_0x7e0e('0x19')]==='sms'||this['channel']===_0x7e0e('0x1a')){_0x2e2717[_0x7e0e('0x1b')]=this[_0x7e0e('0x13')][_0x7e0e('0x1b')];}var _0x338bc5=this['channel'];if(_0x338bc5===_0x7e0e('0x1c')){_0x2e2717[_0x7e0e('0x1d')]=this[_0x7e0e('0x1e')]['id'];}else{_0x2e2717[_[_0x7e0e('0x1f')](_0x338bc5)+_0x7e0e('0x20')]=this[_0x7e0e('0x1e')]['id'];}_0x2e2717[_[_0x7e0e('0x1f')](_0x338bc5)+_0x7e0e('0x21')]=this[_0x7e0e('0x13')]['id'];if(this[_0x7e0e('0x13')][_0x7e0e('0x22')]){var _0x44e93b=_0x4ff342[0x4];if(!_[_0x7e0e('0x23')](_0x44e93b)){_0x2e2717[_0x7e0e('0x24')]=utils[_0x7e0e('0x25')](_0x44e93b,this);return rpc[_0x338bc5+'Message']['create'](_0x2e2717)[_0x7e0e('0xd')](function(_0x375061){logger['info'](_0x7e0e('0xf'),_0x2bfaed,_0x2e2717[_0x7e0e('0x24')]);})[_0x7e0e('0x26')](function(_0x4c1798){logger[_0x7e0e('0x10')](_0x7e0e('0xf'),_0x2bfaed,JSON['stringify'](_0x4c1798));})[_0x7e0e('0x27')](function(){logger[_0x7e0e('0xe')](_0x7e0e('0x28'),_0x2bfaed);_0x331b66[_0x7e0e('0x29')]();});}else{logger[_0x7e0e('0xe')](_0x7e0e('0x2a'),_0x2bfaed);_0x331b66[_0x7e0e('0x29')]();}}else{var _0x3411bb=this;var _0x2d556a=_0x4ff342[0x2][_0x7e0e('0x2b')](/\\n/g,'\x0a');var _0x1c5572={'credentials':{'private_key':_0x2d556a,'client_email':_0x4ff342[0x1]}};var _0x32344c=new dialogflow[(_0x7e0e('0x2c'))](_0x1c5572);var _0x76ad63=_0x32344c[_0x7e0e('0x2d')](_0x4ff342[0x0],md5(_0x3411bb[_0x7e0e('0x13')]['id']));var _0x2f2c9f={'session':_0x76ad63,'queryInput':{'text':{'text':_0x3411bb[_0x7e0e('0x2e')][_0x7e0e('0x24')],'languageCode':_0x4ff342[0x3]||'en'}}};return _0x32344c[_0x7e0e('0x2f')](_0x2f2c9f)[_0x7e0e('0xd')](function(_0x3304c2){if(_0x3304c2&&_0x3304c2['length']){_0x3411bb['body'][_0x7e0e('0x30')]=_0x3304c2;var _0x3daf0f=_0x3304c2[0x0];var _0x3f2094=_0x3daf0f[_0x7e0e('0x31')][_0x7e0e('0x32')]&&_0x3daf0f[_0x7e0e('0x31')]['diagnosticInfo'][_0x7e0e('0x33')]?_0x3daf0f['queryResult'][_0x7e0e('0x32')][_0x7e0e('0x33')][_0x7e0e('0x34')][_0x7e0e('0x35')]:![];_0x3411bb[_0x7e0e('0x24')][_0x7e0e('0x36')]=_0x3daf0f[_0x7e0e('0x31')][_0x7e0e('0x37')];_0x3411bb['body'][_0x7e0e('0x38')]=_0x3daf0f['queryResult'][_0x7e0e('0x39')];_0x3411bb[_0x7e0e('0x24')]['DIALOGFLOWV2_ENDCONVERSATION']=_0x3daf0f[_0x7e0e('0x31')][_0x7e0e('0x32')]&&_0x3daf0f['queryResult'][_0x7e0e('0x32')]['fields']?_0x3daf0f[_0x7e0e('0x31')][_0x7e0e('0x32')][_0x7e0e('0x33')][_0x7e0e('0x34')][_0x7e0e('0x35')]:![];_0x3411bb['body'][_0x7e0e('0x3a')]=_0x3daf0f[_0x7e0e('0x31')][_0x7e0e('0x3b')][_0x7e0e('0x3c')];_0x3411bb['body'][_0x7e0e('0x3d')]=_0x3daf0f['queryResult']['intent']['displayName'];_0x3411bb[_0x7e0e('0x24')][_0x7e0e('0x3e')]=_0x3daf0f[_0x7e0e('0x31')][_0x7e0e('0x3b')][_0x7e0e('0x3f')];_0x3411bb[_0x7e0e('0x24')][_0x7e0e('0x40')]=_0x3daf0f['queryResult'][_0x7e0e('0x41')];_0x3411bb[_0x7e0e('0x24')][_0x7e0e('0x42')]=_0x3daf0f['queryResult'][_0x7e0e('0x43')];_0x3411bb[_0x7e0e('0x24')][_0x7e0e('0x44')]=_0x3daf0f[_0x7e0e('0x31')][_0x7e0e('0x45')];_0x2e2717['providerName']=_0x7e0e('0x30');_0x2e2717[_0x7e0e('0x46')]=JSON['stringify'](_0x3304c2);var _0x1c467a=[];for(var _0x4637a2=0x0;_0x4637a2<_0x3304c2[_0x7e0e('0x47')];_0x4637a2++){var _0x2d75ed=_0x3304c2[_0x4637a2];if(_0x2d75ed&&_0x2d75ed[_0x7e0e('0x31')]&&_0x2d75ed[_0x7e0e('0x31')]['fulfillmentText']){_0x1c467a[_0x7e0e('0x48')](createMessage(_0x2bfaed,_0x338bc5,_0x2e2717,_0x2d75ed['queryResult'][_0x7e0e('0x49')]));}}return Promise[_0x7e0e('0x4a')](_0x1c467a)['then'](function(){if(_0x3f2094){_0x331b66[_0x7e0e('0x16')]();}else{_0x331b66['stop']();}})[_0x7e0e('0x26')](function(_0x5c768d){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0x2bfaed,JSON[_0x7e0e('0x4b')](_0x5c768d));_0x331b66[_0x7e0e('0x16')]();});}})['catch'](function(_0x562527){logger[_0x7e0e('0x10')]('[%s][DIALOGFLOWV2]\x20%s',_0x2bfaed,_0x562527['message']);_0x331b66[_0x7e0e('0x16')]();});}}catch(_0xd4ed6d){logger[_0x7e0e('0x10')](_0x7e0e('0xf'),_0x2bfaed,JSON[_0x7e0e('0x4b')](_0xd4ed6d));_0x331b66[_0x7e0e('0x29')]();}};}; \ No newline at end of file +var _0x52c1=['routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','clone','body','create','then','[%s][DIALOGFLOWV2]\x20%s','error','stringify','consequence','isNil','UserId','info','next','contact','out','channel','sms','phone','interaction','ChatWebsiteId','upperFirst','AccountId','created','isEmpty','getMustacheRender','Message','catch','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','SessionsClient','sessionPath','message','length','dialogflowV2','queryResult','fields','diagnosticInfo','end_conversation','boolValue','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerResponse','push','fulfillmentText','all','lodash','moment','bluebird','../../../../config/logger'];(function(_0x21c254,_0x51d2ff){var _0x442f28=function(_0x1ecbe7){while(--_0x1ecbe7){_0x21c254['push'](_0x21c254['shift']());}};_0x442f28(++_0x51d2ff);}(_0x52c1,0xce));var _0x152c=function(_0x477671,_0x247c67){_0x477671=_0x477671-0x0;var _0x467112=_0x52c1[_0x477671];return _0x467112;};'use strict';var _=require(_0x152c('0x0'));var dialogflow=require('dialogflow');var md5=require('md5');var moment=require(_0x152c('0x1'));var Promise=require(_0x152c('0x2'));var logger=require(_0x152c('0x3'))(_0x152c('0x4'));var utils=require(_0x152c('0x5'));var rpc={'chatMessage':require(_0x152c('0x6')),'openchannelMessage':require(_0x152c('0x7')),'mailMessage':require(_0x152c('0x8')),'smsMessage':require(_0x152c('0x9')),'faxMessage':require(_0x152c('0xa')),'whatsappMessage':require('../../rpc/whatsappMessage')};function createMessage(_0x507c6f,_0x11a673,_0x43217b,_0x4f032e){return new Promise(function(_0x255a67,_0x207885){var _0xb4a95f=_[_0x152c('0xb')](_0x43217b);_0xb4a95f[_0x152c('0xc')]=_0x4f032e;return rpc[_0x11a673+'Message'][_0x152c('0xd')](_0xb4a95f)[_0x152c('0xe')](function(){logger['info'](_0x152c('0xf'),_0x507c6f,_0xb4a95f['body']);_0x255a67();})['catch'](function(_0x5a8956){logger[_0x152c('0x10')]('[%s][DIALOGFLOWV2]\x20%s',_0x507c6f,JSON[_0x152c('0x11')](_0x5a8956));_0x207885(_0x5a8956);});});}exports[_0x152c('0x12')]=function(_0x1ae23e,_0x3a51ba){return function(_0x1fbb33){try{if(!_[_0x152c('0x13')](this['interaction'][_0x152c('0x14')])){logger[_0x152c('0x15')](_0x152c('0xf'),_0x1ae23e,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x1fbb33[_0x152c('0x16')]();}var _0x92508d={'ContactId':this[_0x152c('0x17')]['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x152c('0x18')};if(this[_0x152c('0x19')]===_0x152c('0x1a')||this['channel']==='whatsapp'){_0x92508d[_0x152c('0x1b')]=this[_0x152c('0x1c')][_0x152c('0x1b')];}var _0x563be4=this['channel'];if(_0x563be4==='chat'){_0x92508d[_0x152c('0x1d')]=this['account']['id'];}else{_0x92508d[_[_0x152c('0x1e')](_0x563be4)+_0x152c('0x1f')]=this['account']['id'];}_0x92508d[_[_0x152c('0x1e')](_0x563be4)+'InteractionId']=this[_0x152c('0x1c')]['id'];if(this[_0x152c('0x1c')][_0x152c('0x20')]){var _0xb14731=_0x3a51ba[0x4];if(!_[_0x152c('0x21')](_0xb14731)){_0x92508d[_0x152c('0xc')]=utils[_0x152c('0x22')](_0xb14731,this);return rpc[_0x563be4+_0x152c('0x23')]['create'](_0x92508d)[_0x152c('0xe')](function(_0x3c13c3){logger[_0x152c('0x15')](_0x152c('0xf'),_0x1ae23e,_0x92508d[_0x152c('0xc')]);})[_0x152c('0x24')](function(_0x36fb91){logger['error'](_0x152c('0xf'),_0x1ae23e,JSON[_0x152c('0x11')](_0x36fb91));})[_0x152c('0x25')](function(){logger[_0x152c('0x15')](_0x152c('0x26'),_0x1ae23e);_0x1fbb33[_0x152c('0x27')]();});}else{logger['info'](_0x152c('0x28'),_0x1ae23e);_0x1fbb33[_0x152c('0x27')]();}}else{var _0x59e1ba=this;var _0x2c6976=_0x3a51ba[0x2][_0x152c('0x29')](/\\n/g,'\x0a');var _0x4dd2e0={'credentials':{'private_key':_0x2c6976,'client_email':_0x3a51ba[0x1]}};var _0x424b9c=new dialogflow[(_0x152c('0x2a'))](_0x4dd2e0);var _0x4da55d=_0x424b9c[_0x152c('0x2b')](_0x3a51ba[0x0],md5(_0x59e1ba[_0x152c('0x1c')]['id']));var _0x1588d4={'session':_0x4da55d,'queryInput':{'text':{'text':_0x59e1ba[_0x152c('0x2c')][_0x152c('0xc')],'languageCode':_0x3a51ba[0x3]||'en'}}};return _0x424b9c['detectIntent'](_0x1588d4)[_0x152c('0xe')](function(_0x5a9467){if(_0x5a9467&&_0x5a9467[_0x152c('0x2d')]){_0x59e1ba[_0x152c('0xc')][_0x152c('0x2e')]=_0x5a9467;var _0x3cf7f1=_0x5a9467[0x0];var _0x4b5a3f=_0x3cf7f1[_0x152c('0x2f')]['diagnosticInfo']&&_0x3cf7f1[_0x152c('0x2f')]['diagnosticInfo'][_0x152c('0x30')]?_0x3cf7f1[_0x152c('0x2f')][_0x152c('0x31')][_0x152c('0x30')][_0x152c('0x32')][_0x152c('0x33')]:![];_0x59e1ba[_0x152c('0xc')][_0x152c('0x34')]=_0x3cf7f1[_0x152c('0x2f')][_0x152c('0x35')];_0x59e1ba[_0x152c('0xc')][_0x152c('0x36')]=_0x3cf7f1['queryResult'][_0x152c('0x37')];_0x59e1ba[_0x152c('0xc')]['DIALOGFLOWV2_ENDCONVERSATION']=_0x3cf7f1['queryResult'][_0x152c('0x31')]&&_0x3cf7f1[_0x152c('0x2f')][_0x152c('0x31')]['fields']?_0x3cf7f1[_0x152c('0x2f')][_0x152c('0x31')][_0x152c('0x30')]['end_conversation'][_0x152c('0x33')]:![];_0x59e1ba[_0x152c('0xc')]['DIALOGFLOWV2_INTENTNAME']=_0x3cf7f1[_0x152c('0x2f')][_0x152c('0x38')][_0x152c('0x39')];_0x59e1ba[_0x152c('0xc')][_0x152c('0x3a')]=_0x3cf7f1['queryResult']['intent'][_0x152c('0x3b')];_0x59e1ba[_0x152c('0xc')][_0x152c('0x3c')]=_0x3cf7f1[_0x152c('0x2f')]['intent']['isFallback'];_0x59e1ba[_0x152c('0xc')][_0x152c('0x3d')]=_0x3cf7f1[_0x152c('0x2f')][_0x152c('0x3e')];_0x59e1ba['body'][_0x152c('0x3f')]=_0x3cf7f1[_0x152c('0x2f')]['queryText'];_0x59e1ba[_0x152c('0xc')][_0x152c('0x40')]=_0x3cf7f1[_0x152c('0x2f')][_0x152c('0x41')];_0x92508d['providerName']=_0x152c('0x2e');_0x92508d[_0x152c('0x42')]=JSON['stringify'](_0x5a9467);var _0x50bb9e=[];for(var _0x1f6150=0x0;_0x1f6150<_0x5a9467[_0x152c('0x2d')];_0x1f6150++){var _0xf9324a=_0x5a9467[_0x1f6150];if(_0xf9324a&&_0xf9324a[_0x152c('0x2f')]&&_0xf9324a[_0x152c('0x2f')]['fulfillmentText']){_0x50bb9e[_0x152c('0x43')](createMessage(_0x1ae23e,_0x563be4,_0x92508d,_0xf9324a[_0x152c('0x2f')][_0x152c('0x44')]));}}return Promise[_0x152c('0x45')](_0x50bb9e)[_0x152c('0xe')](function(){if(_0x4b5a3f){_0x1fbb33[_0x152c('0x16')]();}else{_0x1fbb33[_0x152c('0x27')]();}})[_0x152c('0x24')](function(_0x17a5a3){logger[_0x152c('0x10')](_0x152c('0xf'),_0x1ae23e,JSON[_0x152c('0x11')](_0x17a5a3));_0x1fbb33[_0x152c('0x16')]();});}})[_0x152c('0x24')](function(_0x4cd09d){logger[_0x152c('0x10')](_0x152c('0xf'),_0x1ae23e,_0x4cd09d[_0x152c('0x2c')]);_0x1fbb33['next']();});}}catch(_0x4bdcae){logger[_0x152c('0x10')](_0x152c('0xf'),_0x1ae23e,JSON[_0x152c('0x11')](_0x4bdcae));_0x1fbb33['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotoif.js b/server/services/routing/server/applications/gotoif.js index 9152e16..00ed8f9 100644 --- a/server/services/routing/server/applications/gotoif.js +++ b/server/services/routing/server/applications/gotoif.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb604=['rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','stringify','validate','lodash','html-to-text','./utils','../../../../config/logger','routing','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','replace','length','error','[%s][GOTOIF]\x20%s','map','message','stop','condition','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex'];(function(_0x3b534c,_0x2c614f){var _0x449ef9=function(_0x285279){while(--_0x285279){_0x3b534c['push'](_0x3b534c['shift']());}};_0x449ef9(++_0x2c614f);}(_0xb604,0x143));var _0x4b60=function(_0x3e29c4,_0x22e6e9){_0x3e29c4=_0x3e29c4-0x0;var _0x5adaee=_0xb604[_0x3e29c4];return _0x5adaee;};'use strict';var schema=require(_0x4b60('0x0'));var _=require(_0x4b60('0x1'));var htmlToText=require(_0x4b60('0x2'));var utils=require(_0x4b60('0x3'));var logger=require(_0x4b60('0x4'))(_0x4b60('0x5'));var gotoif=schema({'condition':{'type':'string','required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':'number','message':_0x4b60('0x6')},'priorityFalse':{'type':'number','message':_0x4b60('0x7')}});exports[_0x4b60('0x8')]=function(_0x19d607,_0x4a8a93){return function(_0x29ce06){try{var _0x507f08={'condition':htmlToText[_0x4b60('0x9')](utils[_0x4b60('0xa')](_0x4a8a93[0x0],this),{'wordwrap':![]})[_0x4b60('0xb')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x4a8a93[0x1],'priorityFalse':_0x4a8a93[0x2]};var _0x57e6a4=gotoif['validate'](_0x507f08,{'typecast':!![]});if(_0x57e6a4[_0x4b60('0xc')]){logger[_0x4b60('0xd')](_0x4b60('0xe'),_0x19d607,_[_0x4b60('0xf')](_0x57e6a4,_0x4b60('0x10'))['join'](',\x20'));_0x29ce06[_0x4b60('0x11')]();}else{try{var _0x2fea2e=eval('('+_0x507f08[_0x4b60('0x12')]+')');var _0x4f9124=_0x2fea2e?_0x507f08[_0x4b60('0x13')]:_0x507f08[_0x4b60('0x14')];logger[_0x4b60('0x15')](_0x4b60('0x16'),_0x19d607,_0x507f08[_0x4b60('0x12')],_0x2fea2e,_0x4f9124||_0x4b60('0x17'));if(_0x4f9124){var _0x416180=_[_0x4b60('0x18')](_0x29ce06[_0x4b60('0x19')](),{'p':_0x4f9124});if(_0x416180>=0x0){logger[_0x4b60('0x15')](_0x4b60('0x1a'),_0x19d607,_0x4f9124||'next',_0x416180);_0x29ce06[_0x4b60('0x17')](_0x416180);}else{logger['info'](_0x4b60('0x1b'),_0x19d607,_0x4f9124||'next');_0x29ce06[_0x4b60('0x11')]();}}else{_0x29ce06['next']();}}catch(_0x54a1af){logger[_0x4b60('0xd')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x19d607,_0x54a1af[_0x4b60('0x10')]);_0x29ce06['stop']();}}}catch(_0x8b4bad){logger[_0x4b60('0xd')](_0x4b60('0xe'),_0x19d607,JSON[_0x4b60('0x1c')](_0x8b4bad));_0x29ce06[_0x4b60('0x11')]();}};}; \ No newline at end of file +var _0x103e=['[%s][GOTOIF]\x20%s','map','join','stop','priorityTrue','priorityFalse','info','next','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','message','stringify','lodash','html-to-text','./utils','../../../../config/logger','routing','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','fromString','getMustacheRender','replace','validate','length'];(function(_0x14f7fe,_0x5132c4){var _0x3d8309=function(_0x22f5c7){while(--_0x22f5c7){_0x14f7fe['push'](_0x14f7fe['shift']());}};_0x3d8309(++_0x5132c4);}(_0x103e,0x160));var _0xe103=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x103e[_0x3947c9];return _0x2e7871;};'use strict';var schema=require('validate');var _=require(_0xe103('0x0'));var htmlToText=require(_0xe103('0x1'));var utils=require(_0xe103('0x2'));var logger=require(_0xe103('0x3'))(_0xe103('0x4'));var gotoif=schema({'condition':{'type':'string','required':!![],'message':_0xe103('0x5')},'priorityTrue':{'type':'number','message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':'number','message':'priority\x20false\x20is\x20a\x20number'}});exports[_0xe103('0x6')]=function(_0x5ceb8e,_0x16c0f8){return function(_0x5d3484){try{var _0x359d6d={'condition':htmlToText[_0xe103('0x7')](utils[_0xe103('0x8')](_0x16c0f8[0x0],this),{'wordwrap':![]})[_0xe103('0x9')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x16c0f8[0x1],'priorityFalse':_0x16c0f8[0x2]};var _0x5b6c37=gotoif[_0xe103('0xa')](_0x359d6d,{'typecast':!![]});if(_0x5b6c37[_0xe103('0xb')]){logger['error'](_0xe103('0xc'),_0x5ceb8e,_[_0xe103('0xd')](_0x5b6c37,'message')[_0xe103('0xe')](',\x20'));_0x5d3484[_0xe103('0xf')]();}else{try{var _0x5aa1eb=eval('('+_0x359d6d['condition']+')');var _0x31f653=_0x5aa1eb?_0x359d6d[_0xe103('0x10')]:_0x359d6d[_0xe103('0x11')];logger[_0xe103('0x12')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x5ceb8e,_0x359d6d['condition'],_0x5aa1eb,_0x31f653||_0xe103('0x13'));if(_0x31f653){var _0x46be7c=_['findIndex'](_0x5d3484[_0xe103('0x14')](),{'p':_0x31f653});if(_0x46be7c>=0x0){logger['info'](_0xe103('0x15'),_0x5ceb8e,_0x31f653||_0xe103('0x13'),_0x46be7c);_0x5d3484[_0xe103('0x13')](_0x46be7c);}else{logger[_0xe103('0x12')](_0xe103('0x16'),_0x5ceb8e,_0x31f653||'next');_0x5d3484[_0xe103('0xf')]();}}else{_0x5d3484[_0xe103('0x13')]();}}catch(_0x5943a2){logger['error'](_0xe103('0x17'),_0x5ceb8e,_0x5943a2[_0xe103('0x18')]);_0x5d3484[_0xe103('0xf')]();}}}catch(_0x2b5ba3){logger['error'](_0xe103('0xc'),_0x5ceb8e,JSON[_0xe103('0x19')](_0x2b5ba3));_0x5d3484['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotop.js b/server/services/routing/server/applications/gotop.js index 1f92fdd..327a937 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 _0xb91f=['priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','map','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','[%s][GOTOP]\x20%s','stringify','validate','lodash','routing','number'];(function(_0x5dc4c1,_0x2756f2){var _0x3e3986=function(_0x2178fd){while(--_0x2178fd){_0x5dc4c1['push'](_0x5dc4c1['shift']());}};_0x3e3986(++_0x2756f2);}(_0xb91f,0xec));var _0xfb91=function(_0x2dd4f7,_0x47d7bb){_0x2dd4f7=_0x2dd4f7-0x0;var _0x5e6f11=_0xb91f[_0x2dd4f7];return _0x5e6f11;};'use strict';var schema=require(_0xfb91('0x0'));var _=require(_0xfb91('0x1'));var logger=require('../../../../config/logger')(_0xfb91('0x2'));var gotop=schema({'priority':{'type':_0xfb91('0x3'),'required':!![],'message':_0xfb91('0x4')}});exports[_0xfb91('0x5')]=function(_0x2041cc,_0x276a6f){return function(_0x24bbbb){try{var _0x5b65ff={'priority':_0x276a6f[0x0]};var _0x199790=gotop[_0xfb91('0x0')](_0x5b65ff,{'typecast':!![]});if(_0x199790[_0xfb91('0x6')]){logger[_0xfb91('0x7')]('[%s][GOTOP]\x20%s',_0x2041cc,_[_0xfb91('0x8')](_0x199790,'message')[_0xfb91('0x9')](',\x20'));_0x24bbbb[_0xfb91('0xa')]();}else{logger[_0xfb91('0xb')](_0xfb91('0xc'),_0x2041cc,_0x5b65ff['priority']);if(_0x5b65ff[_0xfb91('0xd')]){var _0x291d56=_['findIndex'](_0x24bbbb[_0xfb91('0xe')](),{'p':_0x5b65ff[_0xfb91('0xd')]});if(_0x291d56>=0x0){logger[_0xfb91('0xb')](_0xfb91('0xf'),_0x2041cc,_0x5b65ff[_0xfb91('0xd')]||_0xfb91('0x10'),_0x291d56);_0x24bbbb['next'](_0x291d56);}else{logger['info'](_0xfb91('0x11'),_0x2041cc,_0x5b65ff[_0xfb91('0xd')]||'next');_0x24bbbb[_0xfb91('0xa')]();}}else{_0x24bbbb[_0xfb91('0x10')]();}}}catch(_0x25d352){logger['error'](_0xfb91('0x12'),_0x2041cc,JSON[_0xfb91('0x13')](_0x25d352));_0x24bbbb[_0xfb91('0xa')]();}};}; \ No newline at end of file +var _0x6553=['message','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','validate','length','[%s][GOTOP]\x20%s','map'];(function(_0x1ace3e,_0x307801){var _0x5b92ac=function(_0x5ce841){while(--_0x5ce841){_0x1ace3e['push'](_0x1ace3e['shift']());}};_0x5b92ac(++_0x307801);}(_0x6553,0x1bc));var _0x3655=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x6553[_0x5b644e];return _0x49c6bf;};'use strict';var schema=require('validate');var _=require('lodash');var logger=require('../../../../config/logger')('routing');var gotop=schema({'priority':{'type':'number','required':!![],'message':_0x3655('0x0')}});exports[_0x3655('0x1')]=function(_0x320adf,_0x2e1ae2){return function(_0x3edcfe){try{var _0x32eeb9={'priority':_0x2e1ae2[0x0]};var _0x500be0=gotop[_0x3655('0x2')](_0x32eeb9,{'typecast':!![]});if(_0x500be0[_0x3655('0x3')]){logger['error'](_0x3655('0x4'),_0x320adf,_[_0x3655('0x5')](_0x500be0,_0x3655('0x6'))[_0x3655('0x7')](',\x20'));_0x3edcfe[_0x3655('0x8')]();}else{logger[_0x3655('0x9')](_0x3655('0xa'),_0x320adf,_0x32eeb9[_0x3655('0xb')]);if(_0x32eeb9[_0x3655('0xb')]){var _0x2240b0=_['findIndex'](_0x3edcfe['rules'](),{'p':_0x32eeb9[_0x3655('0xb')]});if(_0x2240b0>=0x0){logger[_0x3655('0x9')](_0x3655('0xc'),_0x320adf,_0x32eeb9[_0x3655('0xb')]||_0x3655('0xd'),_0x2240b0);_0x3edcfe[_0x3655('0xd')](_0x2240b0);}else{logger[_0x3655('0x9')](_0x3655('0xe'),_0x320adf,_0x32eeb9[_0x3655('0xb')]||_0x3655('0xd'));_0x3edcfe[_0x3655('0x8')]();}}else{_0x3edcfe[_0x3655('0xd')]();}}}catch(_0x13a155){logger['error'](_0x3655('0x4'),_0x320adf,JSON['stringify'](_0x13a155));_0x3edcfe[_0x3655('0x8')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/message.js b/server/services/routing/server/applications/message.js index 589ed7b..ba72e78 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 _0x7e1a=['contact','channel','chat','ChatWebsiteId','account','upperFirst','InteractionId','interaction','Message','create','then','[%s][MESSAGE]\x20%s','body','next','catch','error','stringify','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','getMustacheRender'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x7e1a,0x1c5));var _0xa7e1=function(_0x54096b,_0x335615){_0x54096b=_0x54096b-0x0;var _0x39dd37=_0x7e1a[_0x54096b];return _0x39dd37;};'use strict';var _=require(_0xa7e1('0x0'));var utils=require(_0xa7e1('0x1'));var logger=require(_0xa7e1('0x2'))(_0xa7e1('0x3'));var rpc={'chatMessage':require(_0xa7e1('0x4')),'openchannelMessage':require(_0xa7e1('0x5')),'mailMessage':require(_0xa7e1('0x6')),'smsMessage':require(_0xa7e1('0x7')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xa7e1('0x8'))};exports[_0xa7e1('0x9')]=function(_0x2cc9c3,_0x170590){return function(_0x5f20e5){try{var _0x22d066={'body':utils[_0xa7e1('0xa')](_0x170590[0x0],this),'ContactId':this[_0xa7e1('0xb')]['id']};if(this[_0xa7e1('0xc')]===_0xa7e1('0xd')){_0x22d066[_0xa7e1('0xe')]=this[_0xa7e1('0xf')]['id'];}else{_0x22d066[_['upperFirst'](this[_0xa7e1('0xc')])+'AccountId']=this['account']['id'];}_0x22d066[_[_0xa7e1('0x10')](this[_0xa7e1('0xc')])+_0xa7e1('0x11')]=this[_0xa7e1('0x12')]['id'];if(rpc[this['channel']+_0xa7e1('0x13')]){return rpc[this[_0xa7e1('0xc')]+_0xa7e1('0x13')][_0xa7e1('0x14')](_0x22d066)[_0xa7e1('0x15')](function(_0x57e823){logger['info'](_0xa7e1('0x16'),_0x2cc9c3,_0x22d066[_0xa7e1('0x17')]);_0x5f20e5[_0xa7e1('0x18')]();})[_0xa7e1('0x19')](function(_0x23fc30){logger[_0xa7e1('0x1a')](_0xa7e1('0x16'),_0x2cc9c3,JSON[_0xa7e1('0x1b')](_0x23fc30));_0x5f20e5[_0xa7e1('0x1c')]();});}}catch(_0x495ace){logger[_0xa7e1('0x1a')](_0xa7e1('0x16'),_0x2cc9c3,JSON[_0xa7e1('0x1b')](_0x495ace));_0x5f20e5[_0xa7e1('0x1c')]();}};}; \ No newline at end of file +var _0xe5fe=['[%s][MESSAGE]\x20%s','stringify','stop','lodash','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','contact','channel','chat','account','upperFirst','InteractionId','interaction','Message','create','then','body','error'];(function(_0x9729d7,_0x1b79a8){var _0x3c4ac6=function(_0x401ba6){while(--_0x401ba6){_0x9729d7['push'](_0x9729d7['shift']());}};_0x3c4ac6(++_0x1b79a8);}(_0xe5fe,0x93));var _0xee5f=function(_0x7c3c27,_0x16c034){_0x7c3c27=_0x7c3c27-0x0;var _0x4a2c4b=_0xe5fe[_0x7c3c27];return _0x4a2c4b;};'use strict';var _=require(_0xee5f('0x0'));var utils=require('./utils');var logger=require('../../../../config/logger')(_0xee5f('0x1'));var rpc={'chatMessage':require(_0xee5f('0x2')),'openchannelMessage':require(_0xee5f('0x3')),'mailMessage':require(_0xee5f('0x4')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xee5f('0x5')),'whatsappMessage':require(_0xee5f('0x6'))};exports[_0xee5f('0x7')]=function(_0x15d768,_0xc75f52){return function(_0x40124b){try{var _0x4490cf={'body':utils[_0xee5f('0x8')](_0xc75f52[0x0],this),'ContactId':this[_0xee5f('0x9')]['id']};if(this[_0xee5f('0xa')]===_0xee5f('0xb')){_0x4490cf['ChatWebsiteId']=this[_0xee5f('0xc')]['id'];}else{_0x4490cf[_[_0xee5f('0xd')](this[_0xee5f('0xa')])+'AccountId']=this['account']['id'];}_0x4490cf[_['upperFirst'](this['channel'])+_0xee5f('0xe')]=this[_0xee5f('0xf')]['id'];if(rpc[this[_0xee5f('0xa')]+_0xee5f('0x10')]){return rpc[this[_0xee5f('0xa')]+'Message'][_0xee5f('0x11')](_0x4490cf)[_0xee5f('0x12')](function(_0x189d37){logger['info']('[%s][MESSAGE]\x20%s',_0x15d768,_0x4490cf[_0xee5f('0x13')]);_0x40124b['next']();})['catch'](function(_0x5d3eda){logger[_0xee5f('0x14')](_0xee5f('0x15'),_0x15d768,JSON['stringify'](_0x5d3eda));_0x40124b['stop']();});}}catch(_0x3a730e){logger[_0xee5f('0x14')](_0xee5f('0x15'),_0x15d768,JSON[_0xee5f('0x16')](_0x3a730e));_0x40124b[_0xee5f('0x17')]();}};}; \ 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 3fac56d..76f9984 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 _0x5fa7=['error','stop','./utils','../../../../config/logger','routing','info','getMustacheRender','next'];(function(_0x4fac58,_0x213b99){var _0x10e5d1=function(_0x5d276f){while(--_0x5d276f){_0x4fac58['push'](_0x4fac58['shift']());}};_0x10e5d1(++_0x213b99);}(_0x5fa7,0x1da));var _0x75fa=function(_0x1f281e,_0x9ab6ed){_0x1f281e=_0x1f281e-0x0;var _0x4efe14=_0x5fa7[_0x1f281e];return _0x4efe14;};'use strict';var utils=require(_0x75fa('0x0'));var logger=require(_0x75fa('0x1'))(_0x75fa('0x2'));exports['consequence']=function(_0x457349,_0x49e3bf){return function(_0x3e6c79){try{logger[_0x75fa('0x3')]('[%s][NOOP]\x20%s',_0x457349,utils[_0x75fa('0x4')](_0x49e3bf[0x0],this));_0x3e6c79[_0x75fa('0x5')]();}catch(_0x430e56){logger[_0x75fa('0x6')]('[%s][NOOP]\x20%s',_0x457349,JSON['stringify'](_0x430e56));_0x3e6c79[_0x75fa('0x7')]();}};}; \ No newline at end of file +var _0x2b74=['[%s][NOOP]\x20%s','getMustacheRender','next','error','stringify','stop','./utils','routing','info'];(function(_0x450cd9,_0x60332f){var _0x513992=function(_0x2805b3){while(--_0x2805b3){_0x450cd9['push'](_0x450cd9['shift']());}};_0x513992(++_0x60332f);}(_0x2b74,0x10b));var _0x42b7=function(_0x4830db,_0x2c3aa9){_0x4830db=_0x4830db-0x0;var _0x49970e=_0x2b74[_0x4830db];return _0x49970e;};'use strict';var utils=require(_0x42b7('0x0'));var logger=require('../../../../config/logger')(_0x42b7('0x1'));exports['consequence']=function(_0xca8802,_0x3465ad){return function(_0x218d92){try{logger[_0x42b7('0x2')](_0x42b7('0x3'),_0xca8802,utils[_0x42b7('0x4')](_0x3465ad[0x0],this));_0x218d92[_0x42b7('0x5')]();}catch(_0x150a92){logger[_0x42b7('0x6')](_0x42b7('0x3'),_0xca8802,JSON[_0x42b7('0x7')](_0x150a92));_0x218d92[_0x42b7('0x8')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/queue.js b/server/services/routing/server/applications/queue.js index 491e7a0..cea7159 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 _0x0563=['./strategy','defaults','redis','localhost','socket.io-emitter','queue_id','account','from','clone','queue','format','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','waiting','body','contact','list','channel','QueueId','upperFirst','InteractionId','interaction','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','create\x20queue\x20report','YYYY-MM-DD\x20HH:mm:ss','[%s][STOP:QUEUE][NAME:%s]','update','error','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','[%s][QUEUE]\x20%s','join','stop','find','Queues','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','next','strategy','rrmemory','beepall','log','stack','validate','lodash','util','seq-queue','moment','../../../../config/environment','../../../../config/logger','routing'];(function(_0x38b789,_0x2d32f0){var _0x51143d=function(_0x434e67){while(--_0x434e67){_0x38b789['push'](_0x38b789['shift']());}};_0x51143d(++_0x2d32f0);}(_0x0563,0x1d2));var _0x3056=function(_0x13f054,_0xd90d91){_0x13f054=_0x13f054-0x0;var _0x253d46=_0x0563[_0x13f054];return _0x253d46;};'use strict';var schema=require(_0x3056('0x0'));var _=require(_0x3056('0x1'));var util=require(_0x3056('0x2'));var seqqueue=require(_0x3056('0x3'));var moment=require(_0x3056('0x4'));var Redis=require('ioredis');var config=require(_0x3056('0x5'));var logger=require(_0x3056('0x6'))(_0x3056('0x7'));var strategy=require(_0x3056('0x8'));config['redis']=_[_0x3056('0x9')](config[_0x3056('0xa')],{'host':_0x3056('0xb'),'port':0x18eb});var io=require(_0x3056('0xc'))(new Redis(config[_0x3056('0xa')]));var attributes=['id',_0x3056('0xd'),_0x3056('0xe'),'queue',_0x3056('0xf'),'joinAt'];function emit(_0x25b68d,_0x5845d9,_0x41f5d8){io['to'](_0x25b68d)['emit'](_0x5845d9,_0x41f5d8);}function emitChannelQueueInteraction(_0x312567,_0x1cd57d,_0x156f66,_0xec14e5,_0x2ada00,_0x29f441,_0x43e21e,_0x21c651){var _0xa2a49c=_[_0x3056('0x10')](_0x156f66);_0xa2a49c[_0x3056('0xd')]=_0x21c651;_0xa2a49c[_0x3056('0x11')]=_0x1cd57d;_0xa2a49c['account']=_0xec14e5;_0xa2a49c['id']=_0x2ada00;if(_0x29f441){_0x43e21e[util[_0x3056('0x12')]('%sQueuesWaitingInteractions',_0x312567)][_0x2ada00]=_[_0x3056('0x13')](_0xa2a49c,attributes);}else{delete _0x43e21e[util['format']('%sQueuesWaitingInteractions',_0x312567)][_0x2ada00];}emit(util[_0x3056('0x12')](_0x3056('0x14'),_0x312567,_0x1cd57d),util['format'](_0x3056('0x15'),_0x312567,_0x29f441?_0x3056('0x16'):_0x3056('0x17')),_['pick'](_0xa2a49c,attributes));}var rpc={'openchannelQueueReport':require(_0x3056('0x18')),'mailQueueReport':require(_0x3056('0x19')),'chatQueueReport':require(_0x3056('0x1a')),'smsQueueReport':require(_0x3056('0x1b')),'faxQueueReport':require(_0x3056('0x1c')),'whatsappQueueReport':require(_0x3056('0x1d'))};var queue=schema({'name':{'type':_0x3056('0x1e'),'required':!![],'message':_0x3056('0x1f')},'timeout':{'type':_0x3056('0x20'),'message':'timeout\x20is\x20a\x20number'}});function startRouting(_0x2f98eb,_0x42371b,_0x1deb20,_0x4d0e36){if(_0x2f98eb&&_0x42371b&&_0x1deb20){_0x42371b[_0x3056('0x21')]+=0x1;var _0x48dbdd={'uniqueid':_0x2f98eb,'from':_0x1deb20['body']?_0x1deb20[_0x3056('0x22')][_0x3056('0xf')]:'','joinAt':moment()[_0x3056('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1deb20[_0x3056('0x23')]?_0x1deb20[_0x3056('0x23')]['id']:null,'ListId':_0x1deb20[_0x3056('0x24')]?_0x1deb20['list']['id']:null};_0x48dbdd[_['upperFirst'](_0x1deb20[_0x3056('0x25')])+_0x3056('0x26')]=_0x42371b['id']||null;_0x48dbdd[_[_0x3056('0x27')](_0x1deb20[_0x3056('0x25')])+_0x3056('0x28')]=_0x1deb20[_0x3056('0x29')]?_0x1deb20[_0x3056('0x29')]['id']:null;_0x48dbdd[_['upperFirst'](_0x1deb20[_0x3056('0x25')])+'MessageId']=_0x1deb20['message']?_0x1deb20[_0x3056('0x2a')]['id']:null;_0x48dbdd[_[_0x3056('0x27')](_0x1deb20[_0x3056('0x25')])+(_0x1deb20['channel']!==_0x3056('0x2b')?_0x3056('0x2c'):_0x3056('0x2d'))]=_0x1deb20[_0x3056('0xe')]?_0x1deb20[_0x3056('0xe')]['id']:null;logger[_0x3056('0x2e')](util[_0x3056('0x12')](_0x3056('0x2f'),_0x2f98eb,_0x42371b['name']));emitChannelQueueInteraction(_0x1deb20[_0x3056('0x25')],_0x42371b[_0x3056('0x30')],_0x48dbdd,_0x1deb20[_0x3056('0xe')][_0x3056('0x30')],_0x1deb20[_0x3056('0x2a')]['id'],!![],_0x4d0e36,_0x42371b['id']);if(rpc[_0x1deb20[_0x3056('0x25')]+_0x3056('0x31')]){return rpc[_0x1deb20[_0x3056('0x25')]+'QueueReport'][_0x3056('0x32')](_0x48dbdd)[_0x3056('0x33')](function(_0x3a9aad){logger['error'](_0x3056('0x34'));});}}}function stopRouting(_0x34793a,_0x5e5169,_0x1d425a,_0x1a29f4){if(_0x34793a&&_0x5e5169){_0x5e5169[_0x3056('0x21')]-=0x1;var _0x5eb4ea={'leaveAt':moment()[_0x3056('0x12')](_0x3056('0x35')),'acceptAt':moment()[_0x3056('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':'accepted'};logger[_0x3056('0x2e')](util['format'](_0x3056('0x36'),_0x34793a,_0x5e5169[_0x3056('0x30')]));emitChannelQueueInteraction(_0x1d425a[_0x3056('0x25')],_0x5e5169[_0x3056('0x30')],_0x1d425a[_0x3056('0x22')],_0x1d425a[_0x3056('0xe')][_0x3056('0x30')],_0x1d425a['message']['id'],![],_0x1a29f4,_0x5e5169['id']);if(rpc[_0x1d425a[_0x3056('0x25')]+'QueueReport']){return rpc[_0x1d425a[_0x3056('0x25')]+'QueueReport'][_0x3056('0x37')](_0x34793a,_0x5eb4ea)[_0x3056('0x33')](function(_0x1de566){logger[_0x3056('0x38')](_0x3056('0x39'));});}}}function endRouting(_0x573330,_0xea96be,_0xbcd7b9,_0x43e7b9){if(_0x573330&&_0xea96be){_0xea96be['waiting']-=0x1;var _0x4c91c4={'leaveAt':moment()[_0x3056('0x12')](_0x3056('0x35')),'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x3056('0x3a')};logger[_0x3056('0x2e')](util['format'](_0x3056('0x3b'),_0x573330,_0xea96be[_0x3056('0x30')]));emitChannelQueueInteraction(_0xbcd7b9[_0x3056('0x25')],_0xea96be['name'],_0xbcd7b9[_0x3056('0x22')],_0xbcd7b9['account'][_0x3056('0x30')],_0xbcd7b9[_0x3056('0x2a')]['id'],![],_0x43e7b9);if(rpc[_0xbcd7b9[_0x3056('0x25')]+_0x3056('0x31')]){return rpc[_0xbcd7b9[_0x3056('0x25')]+_0x3056('0x31')][_0x3056('0x37')](_0x573330,_0x4c91c4)[_0x3056('0x33')](function(_0x256ed5){logger[_0x3056('0x38')](_0x3056('0x39'));});}}}function handleFindQueue(_0x1e4578){return function(_0x43ba29){return _0x43ba29[_0x3056('0x30')]['toLowerCase']()===_0x1e4578[_0x3056('0x3c')]();};}exports[_0x3056('0x3d')]=function(_0x3b84d0,_0x57b226,_0x26b779,_0x1a574b){return function(_0x2530ee){try{var _0x2fbb45={'name':_0x57b226[0x0],'timeout':_0x57b226[0x1]};var _0xd29734=queue[_0x3056('0x0')](_0x2fbb45,{'typecast':!![]});if(_0xd29734['length']){logger[_0x3056('0x38')](_0x3056('0x3e'),_0x3b84d0,_['map'](_0xd29734,_0x3056('0x2a'))[_0x3056('0x3f')](',\x20'));_0x2530ee[_0x3056('0x40')]();}else{var _0x1dad2e=_[_0x3056('0x41')](_0x26b779[_0x1a574b[_0x3056('0x25')]+_0x3056('0x42')],handleFindQueue(_0x2fbb45[_0x3056('0x30')]));if(_0x1dad2e){startRouting(_0x3b84d0,_0x1dad2e,_0x1a574b,_0x26b779);var _0x12f386=(_0x1dad2e['timeout']||0xa)*0x3e8;var _0x56a909=(_0x2fbb45[_0x3056('0x3a')]||0x14)*0x3e8;var _0x550d25,_0x448382;if(_0x12f386>_0x56a909){_0x56a909=_0x12f386;}var _0xb9e0f9=seqqueue['createQueue'](_0x12f386);_0xb9e0f9['id']=_0x3b84d0;_0xb9e0f9[_0x3056('0x43')]=_0x12f386;_0xb9e0f9[_0x3056('0x44')]=_0x56a909;_0xb9e0f9[_0x3056('0x25')]=_0x1a574b[_0x3056('0x25')];_0x26b779[_0x3056('0x45')][_0x3b84d0]['on'](_0x3056('0x46'),function(){logger[_0x3056('0x2e')](_0x3056('0x47'),_0x3b84d0);stopRouting(_0x3b84d0,_0x1dad2e,_0x1a574b,_0x26b779);clearTimeout(_0x550d25);_0x550d25=undefined;_0xb9e0f9[_0x3056('0x48')](!![]);if(_0x26b779['rules'][_0x3b84d0]){delete _0x26b779[_0x3056('0x45')][_0x3b84d0];}_0x2530ee['stop']();});_0x26b779[_0x3056('0x45')][_0x3b84d0]['on']('complete',function(){if(_0x26b779['rules'][_0x3b84d0]){delete _0x26b779[_0x3056('0x45')][_0x3b84d0];}});_0x550d25=setTimeout(function(){logger['info']('[%s][QUEUE]\x20APPLICATION\x20END',_0x3b84d0);endRouting(_0x3b84d0,_0x1dad2e,_0x1a574b,_0x26b779);clearTimeout(_0x550d25);_0xb9e0f9[_0x3056('0x48')](!![]);_0x2530ee[_0x3056('0x49')]();},_0x56a909);switch(_0x1dad2e[_0x3056('0x4a')]){case _0x3056('0x4b'):strategy[_0x3056('0x4b')](_0xb9e0f9,_0x1dad2e,_0x26b779,_0x1a574b);break;default:strategy[_0x3056('0x4c')](_0xb9e0f9,_0x1dad2e,_0x26b779,_0x1a574b);}}else{logger[_0x3056('0x38')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x3b84d0,_0x2fbb45[_0x3056('0x30')]);_0x2530ee['stop']();}}}catch(_0x512514){console[_0x3056('0x4d')](_0x512514);logger['error'](_0x3056('0x3e'),_0x3b84d0,_0x512514[_0x3056('0x4e')]);_0x2530ee[_0x3056('0x40')]();}};}; \ No newline at end of file +var _0xa9cd=['format','%sQueuesWaitingInteractions','%s:queue:%s','save','remove','pick','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','channel','upperFirst','InteractionId','interaction','MessageId','message','chat','AccountId','WebsiteId','account','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','error','create\x20queue\x20report','accepted','update','catch','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','length','map','join','stop','find','Queues','createQueue','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','complete','[%s][QUEUE]\x20APPLICATION\x20END','close','next','strategy','rrmemory','beepall','log','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','./strategy','redis','defaults','localhost','socket.io-emitter','queue','from','joinAt','emit','clone','queue_id'];(function(_0x2ab9e8,_0x525d53){var _0x153708=function(_0x3f0425){while(--_0x3f0425){_0x2ab9e8['push'](_0x2ab9e8['shift']());}};_0x153708(++_0x525d53);}(_0xa9cd,0x187));var _0xda9c=function(_0x37c653,_0x4427b1){_0x37c653=_0x37c653-0x0;var _0x3d45cf=_0xa9cd[_0x37c653];return _0x3d45cf;};'use strict';var schema=require(_0xda9c('0x0'));var _=require(_0xda9c('0x1'));var util=require(_0xda9c('0x2'));var seqqueue=require(_0xda9c('0x3'));var moment=require(_0xda9c('0x4'));var Redis=require(_0xda9c('0x5'));var config=require(_0xda9c('0x6'));var logger=require(_0xda9c('0x7'))('routing');var strategy=require(_0xda9c('0x8'));config[_0xda9c('0x9')]=_[_0xda9c('0xa')](config[_0xda9c('0x9')],{'host':_0xda9c('0xb'),'port':0x18eb});var io=require(_0xda9c('0xc'))(new Redis(config['redis']));var attributes=['id','queue_id','account',_0xda9c('0xd'),_0xda9c('0xe'),_0xda9c('0xf')];function emit(_0x208997,_0x59b9e5,_0x2debf6){io['to'](_0x208997)[_0xda9c('0x10')](_0x59b9e5,_0x2debf6);}function emitChannelQueueInteraction(_0x41898a,_0xd4578e,_0x17832b,_0x47fbe3,_0x449963,_0x2f2d0d,_0x5e1ba2,_0x4d12da){var _0x28c0a6=_[_0xda9c('0x11')](_0x17832b);_0x28c0a6[_0xda9c('0x12')]=_0x4d12da;_0x28c0a6[_0xda9c('0xd')]=_0xd4578e;_0x28c0a6['account']=_0x47fbe3;_0x28c0a6['id']=_0x449963;if(_0x2f2d0d){_0x5e1ba2[util[_0xda9c('0x13')]('%sQueuesWaitingInteractions',_0x41898a)][_0x449963]=_['pick'](_0x28c0a6,attributes);}else{delete _0x5e1ba2[util[_0xda9c('0x13')](_0xda9c('0x14'),_0x41898a)][_0x449963];}emit(util[_0xda9c('0x13')](_0xda9c('0x15'),_0x41898a,_0xd4578e),util[_0xda9c('0x13')]('%s_queue_waiting_interaction:%s',_0x41898a,_0x2f2d0d?_0xda9c('0x16'):_0xda9c('0x17')),_[_0xda9c('0x18')](_0x28c0a6,attributes));}var rpc={'openchannelQueueReport':require(_0xda9c('0x19')),'mailQueueReport':require(_0xda9c('0x1a')),'chatQueueReport':require(_0xda9c('0x1b')),'smsQueueReport':require(_0xda9c('0x1c')),'faxQueueReport':require(_0xda9c('0x1d')),'whatsappQueueReport':require('../../rpc/whatsappQueueReport')};var queue=schema({'name':{'type':_0xda9c('0x1e'),'required':!![],'message':_0xda9c('0x1f')},'timeout':{'type':'number','message':_0xda9c('0x20')}});function startRouting(_0x5bc4e1,_0x114e59,_0x5fd257,_0x1c6671){if(_0x5bc4e1&&_0x114e59&&_0x5fd257){_0x114e59[_0xda9c('0x21')]+=0x1;var _0xb42584={'uniqueid':_0x5bc4e1,'from':_0x5fd257['body']?_0x5fd257[_0xda9c('0x22')]['from']:'','joinAt':moment()[_0xda9c('0x13')](_0xda9c('0x23')),'ContactId':_0x5fd257[_0xda9c('0x24')]?_0x5fd257[_0xda9c('0x24')]['id']:null,'ListId':_0x5fd257[_0xda9c('0x25')]?_0x5fd257[_0xda9c('0x25')]['id']:null};_0xb42584[_['upperFirst'](_0x5fd257[_0xda9c('0x26')])+'QueueId']=_0x114e59['id']||null;_0xb42584[_[_0xda9c('0x27')](_0x5fd257[_0xda9c('0x26')])+_0xda9c('0x28')]=_0x5fd257[_0xda9c('0x29')]?_0x5fd257['interaction']['id']:null;_0xb42584[_['upperFirst'](_0x5fd257[_0xda9c('0x26')])+_0xda9c('0x2a')]=_0x5fd257[_0xda9c('0x2b')]?_0x5fd257[_0xda9c('0x2b')]['id']:null;_0xb42584[_['upperFirst'](_0x5fd257[_0xda9c('0x26')])+(_0x5fd257[_0xda9c('0x26')]!==_0xda9c('0x2c')?_0xda9c('0x2d'):_0xda9c('0x2e'))]=_0x5fd257[_0xda9c('0x2f')]?_0x5fd257['account']['id']:null;logger[_0xda9c('0x30')](util['format'](_0xda9c('0x31'),_0x5bc4e1,_0x114e59['name']));emitChannelQueueInteraction(_0x5fd257[_0xda9c('0x26')],_0x114e59[_0xda9c('0x32')],_0xb42584,_0x5fd257[_0xda9c('0x2f')][_0xda9c('0x32')],_0x5fd257['message']['id'],!![],_0x1c6671,_0x114e59['id']);if(rpc[_0x5fd257[_0xda9c('0x26')]+_0xda9c('0x33')]){return rpc[_0x5fd257[_0xda9c('0x26')]+'QueueReport']['create'](_0xb42584)['catch'](function(_0x467250){logger[_0xda9c('0x34')](_0xda9c('0x35'));});}}}function stopRouting(_0x272ae2,_0x20082d,_0x192ecd,_0x1b1515){if(_0x272ae2&&_0x20082d){_0x20082d[_0xda9c('0x21')]-=0x1;var _0x24fee1={'leaveAt':moment()[_0xda9c('0x13')](_0xda9c('0x23')),'acceptAt':moment()[_0xda9c('0x13')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0xda9c('0x36')};logger['info'](util[_0xda9c('0x13')]('[%s][STOP:QUEUE][NAME:%s]',_0x272ae2,_0x20082d['name']));emitChannelQueueInteraction(_0x192ecd[_0xda9c('0x26')],_0x20082d['name'],_0x192ecd[_0xda9c('0x22')],_0x192ecd[_0xda9c('0x2f')][_0xda9c('0x32')],_0x192ecd['message']['id'],![],_0x1b1515,_0x20082d['id']);if(rpc[_0x192ecd[_0xda9c('0x26')]+_0xda9c('0x33')]){return rpc[_0x192ecd[_0xda9c('0x26')]+_0xda9c('0x33')][_0xda9c('0x37')](_0x272ae2,_0x24fee1)[_0xda9c('0x38')](function(_0x2d3985){logger[_0xda9c('0x34')](_0xda9c('0x39'));});}}}function endRouting(_0x28a282,_0x23ac40,_0x37c84c,_0x4d7f25){if(_0x28a282&&_0x23ac40){_0x23ac40['waiting']-=0x1;var _0x50c264={'leaveAt':moment()[_0xda9c('0x13')](_0xda9c('0x23')),'exitAt':moment()['format'](_0xda9c('0x23')),'reason':_0xda9c('0x3a')};logger[_0xda9c('0x30')](util[_0xda9c('0x13')](_0xda9c('0x3b'),_0x28a282,_0x23ac40[_0xda9c('0x32')]));emitChannelQueueInteraction(_0x37c84c[_0xda9c('0x26')],_0x23ac40[_0xda9c('0x32')],_0x37c84c[_0xda9c('0x22')],_0x37c84c[_0xda9c('0x2f')][_0xda9c('0x32')],_0x37c84c[_0xda9c('0x2b')]['id'],![],_0x4d7f25);if(rpc[_0x37c84c[_0xda9c('0x26')]+_0xda9c('0x33')]){return rpc[_0x37c84c[_0xda9c('0x26')]+_0xda9c('0x33')][_0xda9c('0x37')](_0x28a282,_0x50c264)[_0xda9c('0x38')](function(_0x513ad4){logger[_0xda9c('0x34')]('update\x20queue\x20report');});}}}function handleFindQueue(_0x38df31){return function(_0x3b847e){return _0x3b847e[_0xda9c('0x32')]['toLowerCase']()===_0x38df31['toLowerCase']();};}exports['consequence']=function(_0x508d47,_0x15a44c,_0x4ee27e,_0x1e0d75){return function(_0x35178f){try{var _0x1e2fcb={'name':_0x15a44c[0x0],'timeout':_0x15a44c[0x1]};var _0x14f760=queue['validate'](_0x1e2fcb,{'typecast':!![]});if(_0x14f760[_0xda9c('0x3c')]){logger[_0xda9c('0x34')]('[%s][QUEUE]\x20%s',_0x508d47,_[_0xda9c('0x3d')](_0x14f760,_0xda9c('0x2b'))[_0xda9c('0x3e')](',\x20'));_0x35178f[_0xda9c('0x3f')]();}else{var _0x4927e5=_[_0xda9c('0x40')](_0x4ee27e[_0x1e0d75[_0xda9c('0x26')]+_0xda9c('0x41')],handleFindQueue(_0x1e2fcb[_0xda9c('0x32')]));if(_0x4927e5){startRouting(_0x508d47,_0x4927e5,_0x1e0d75,_0x4ee27e);var _0x10c25a=(_0x4927e5[_0xda9c('0x3a')]||0xa)*0x3e8;var _0x43f293=(_0x1e2fcb[_0xda9c('0x3a')]||0x14)*0x3e8;var _0x40a2dc,_0x5b70a5;if(_0x10c25a>_0x43f293){_0x43f293=_0x10c25a;}var _0x452187=seqqueue[_0xda9c('0x42')](_0x10c25a);_0x452187['id']=_0x508d47;_0x452187[_0xda9c('0x43')]=_0x10c25a;_0x452187[_0xda9c('0x44')]=_0x43f293;_0x452187['channel']=_0x1e0d75[_0xda9c('0x26')];_0x4ee27e[_0xda9c('0x45')][_0x508d47]['on'](_0xda9c('0x46'),function(){logger[_0xda9c('0x30')](_0xda9c('0x47'),_0x508d47);stopRouting(_0x508d47,_0x4927e5,_0x1e0d75,_0x4ee27e);clearTimeout(_0x40a2dc);_0x40a2dc=undefined;_0x452187['close'](!![]);if(_0x4ee27e['rules'][_0x508d47]){delete _0x4ee27e['rules'][_0x508d47];}_0x35178f[_0xda9c('0x3f')]();});_0x4ee27e[_0xda9c('0x45')][_0x508d47]['on'](_0xda9c('0x48'),function(){if(_0x4ee27e[_0xda9c('0x45')][_0x508d47]){delete _0x4ee27e[_0xda9c('0x45')][_0x508d47];}});_0x40a2dc=setTimeout(function(){logger[_0xda9c('0x30')](_0xda9c('0x49'),_0x508d47);endRouting(_0x508d47,_0x4927e5,_0x1e0d75,_0x4ee27e);clearTimeout(_0x40a2dc);_0x452187[_0xda9c('0x4a')](!![]);_0x35178f[_0xda9c('0x4b')]();},_0x43f293);switch(_0x4927e5[_0xda9c('0x4c')]){case _0xda9c('0x4d'):strategy[_0xda9c('0x4d')](_0x452187,_0x4927e5,_0x4ee27e,_0x1e0d75);break;default:strategy[_0xda9c('0x4e')](_0x452187,_0x4927e5,_0x4ee27e,_0x1e0d75);}}else{logger['error']('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x508d47,_0x1e2fcb['name']);_0x35178f[_0xda9c('0x3f')]();}}}catch(_0x4e627f){console[_0xda9c('0x4f')](_0x4e627f);logger[_0xda9c('0x34')](_0xda9c('0x50'),_0x508d47,_0x4e627f[_0xda9c('0x51')]);_0x35178f[_0xda9c('0x3f')]();}};}; \ 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 2f43468..8cabee0 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 _0x3819=['lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','agent','realtime','push','bind','timeout','handleTimeout','handleDrained','prototype','handleRun','info','[%s][AGENT]\x20try\x20with\x20%s','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','agents','busy','busyQueue','showNotification','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','isNil','hideNotification','STOP','TIMEOUT'];(function(_0x47764f,_0x399708){var _0x53e5d6=function(_0x32b4f6){while(--_0x32b4f6){_0x47764f['push'](_0x47764f['shift']());}};_0x53e5d6(++_0x399708);}(_0x3819,0x1a0));var _0x9381=function(_0x5ef726,_0x3ccc9d){_0x5ef726=_0x5ef726-0x0;var _0xaf928f=_0x3819[_0x5ef726];return _0xaf928f;};'use strict';var _=require(_0x9381('0x0'));var uuid=require(_0x9381('0x1'));var util=require(_0x9381('0x2'));var logger=require(_0x9381('0x3'))(_0x9381('0x4'));var Agent=function(_0x4ac071,_0x12f7f1,_0xeede0e,_0x400e39){this[_0x9381('0x5')]=uuid['v4']();this[_0x9381('0x6')]=_0x4ac071;this[_0x9381('0x7')]=_0x12f7f1;this[_0x9381('0x8')]=_0xeede0e;this[_0x9381('0x4')]=_0x400e39;this[_0x9381('0x6')][_0x9381('0x9')](this['handleRun']['bind'](this),this['handleTimeout'][_0x9381('0xa')](this));this[_0x9381('0x6')]['on'](_0x9381('0xb'),this[_0x9381('0xc')]['bind'](this));this['squeue']['on']('drained',this[_0x9381('0xd')][_0x9381('0xa')](this));};Agent[_0x9381('0xe')][_0x9381('0x9')]=function(){this['squeue'][_0x9381('0x9')](this[_0x9381('0xf')][_0x9381('0xa')](this),this[_0x9381('0xc')]['bind'](this));};Agent[_0x9381('0xe')][_0x9381('0xd')]=function(){this['handleTimeout'](!![]);};Agent[_0x9381('0xe')]['handleRun']=function(_0xb25a7){logger[_0x9381('0x10')](_0x9381('0x11'),this[_0x9381('0x6')]['id'],this[_0x9381('0x7')]['id']);if(_['isNil'](this[_0x9381('0x8')]['agents'][this[_0x9381('0x7')]['id']])){logger['info'](_0x9381('0x12'),this[_0x9381('0x6')]['id'],this[_0x9381('0x7')]['id']);setTimeout(this[_0x9381('0x9')][_0x9381('0xa')](this),0x3e8);}else{if(this['routing'][_0x9381('0x13')]||util['isAgentAvailable'](this[_0x9381('0x6')]['id'],this[_0x9381('0x8')][_0x9381('0x14')][this[_0x9381('0x7')]['id']],this['squeue']['channel'],![])){this[_0x9381('0x8')]['agents'][this[_0x9381('0x7')]['id']][_0x9381('0x15')]=!![];this['realtime'][_0x9381('0x14')][this[_0x9381('0x7')]['id']][_0x9381('0x16')]=undefined;util[_0x9381('0x17')](this[_0x9381('0x5')],this[_0x9381('0x6')]['id'],this[_0x9381('0x8')][_0x9381('0x14')][this[_0x9381('0x7')]['id']],null,this[_0x9381('0x4')]);util[_0x9381('0x18')](this[_0x9381('0x6')]['id'],this[_0x9381('0x8')][_0x9381('0x14')][this[_0x9381('0x7')]['id']],_0x9381('0x19')+(this[_0x9381('0x4')]['forcedOwnership']?_0x9381('0x1a'):''));}else{logger[_0x9381('0x10')](_0x9381('0x1b'),this[_0x9381('0x6')]['id'],this[_0x9381('0x7')]['id']);setTimeout(this[_0x9381('0x9')][_0x9381('0xa')](this),0x3e8);}}};Agent[_0x9381('0xe')][_0x9381('0xc')]=function(_0x4174a3){if(_[_0x9381('0x1c')](this['realtime'][_0x9381('0x14')][this[_0x9381('0x7')]['id']])){return logger['info'](_0x9381('0x12'),this[_0x9381('0x6')]['id'],this[_0x9381('0x7')]['id']);}else{logger['info']('[%s][AGENT]\x20timeout\x20with\x20%s',this['squeue']['id'],this[_0x9381('0x7')]['id']);util[_0x9381('0x1d')](this[_0x9381('0x5')],this[_0x9381('0x6')]['id'],this[_0x9381('0x8')][_0x9381('0x14')][this[_0x9381('0x7')]['id']],null,this[_0x9381('0x4')]);this[_0x9381('0x8')][_0x9381('0x14')][this[_0x9381('0x7')]['id']][_0x9381('0x15')]=![];this[_0x9381('0x8')]['agents'][this[_0x9381('0x7')]['id']][_0x9381('0x16')]=undefined;util[_0x9381('0x18')](this[_0x9381('0x6')]['id'],this['realtime'][_0x9381('0x14')][this['agent']['id']],_0x4174a3?_0x9381('0x1e'):_0x9381('0x1f'));}if(!_0x4174a3){setTimeout(this[_0x9381('0x9')][_0x9381('0xa')](this),0x3e8);}};function agent(_0x4f02df,_0x5d86ae,_0x1b71fd,_0x40d6cc){return new Agent(_0x4f02df,_0x5d86ae,_0x1b71fd,_0x40d6cc);}module['exports']=agent; \ No newline at end of file +var _0xe06a=['isAgentAvailable','busy','busyQueue','showNotification','writeLog','forcedOwnership','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','STOP','TIMEOUT','exports','lodash','uuid','./util','../../../../../config/logger','notificationId','squeue','agent','realtime','routing','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','push','info','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s'];(function(_0x4dad84,_0x49c097){var _0x3420c3=function(_0x354dd3){while(--_0x354dd3){_0x4dad84['push'](_0x4dad84['shift']());}};_0x3420c3(++_0x49c097);}(_0xe06a,0x1ab));var _0xae06=function(_0x24f217,_0x5d5013){_0x24f217=_0x24f217-0x0;var _0xeec426=_0xe06a[_0x24f217];return _0xeec426;};'use strict';var _=require(_0xae06('0x0'));var uuid=require(_0xae06('0x1'));var util=require(_0xae06('0x2'));var logger=require(_0xae06('0x3'))('routing');var Agent=function(_0x3bdb19,_0x3ed66b,_0x2fad53,_0x539c94){this[_0xae06('0x4')]=uuid['v4']();this[_0xae06('0x5')]=_0x3bdb19;this[_0xae06('0x6')]=_0x3ed66b;this[_0xae06('0x7')]=_0x2fad53;this[_0xae06('0x8')]=_0x539c94;this[_0xae06('0x5')]['push'](this[_0xae06('0x9')][_0xae06('0xa')](this),this[_0xae06('0xb')][_0xae06('0xa')](this));this[_0xae06('0x5')]['on'](_0xae06('0xc'),this['handleTimeout'][_0xae06('0xa')](this));this[_0xae06('0x5')]['on'](_0xae06('0xd'),this[_0xae06('0xe')]['bind'](this));};Agent[_0xae06('0xf')][_0xae06('0x10')]=function(){this[_0xae06('0x5')][_0xae06('0x10')](this[_0xae06('0x9')]['bind'](this),this[_0xae06('0xb')]['bind'](this));};Agent[_0xae06('0xf')]['handleDrained']=function(){this[_0xae06('0xb')](!![]);};Agent[_0xae06('0xf')][_0xae06('0x9')]=function(_0x423727){logger[_0xae06('0x11')]('[%s][AGENT]\x20try\x20with\x20%s',this[_0xae06('0x5')]['id'],this[_0xae06('0x6')]['id']);if(_[_0xae06('0x12')](this[_0xae06('0x7')][_0xae06('0x13')][this[_0xae06('0x6')]['id']])){logger['info'](_0xae06('0x14'),this[_0xae06('0x5')]['id'],this[_0xae06('0x6')]['id']);setTimeout(this['push'][_0xae06('0xa')](this),0x3e8);}else{if(this[_0xae06('0x8')]['forcedOwnership']||util[_0xae06('0x15')](this['squeue']['id'],this[_0xae06('0x7')][_0xae06('0x13')][this['agent']['id']],this[_0xae06('0x5')]['channel'],![])){this[_0xae06('0x7')]['agents'][this['agent']['id']][_0xae06('0x16')]=!![];this[_0xae06('0x7')][_0xae06('0x13')][this['agent']['id']][_0xae06('0x17')]=undefined;util[_0xae06('0x18')](this[_0xae06('0x4')],this[_0xae06('0x5')]['id'],this[_0xae06('0x7')][_0xae06('0x13')][this[_0xae06('0x6')]['id']],null,this[_0xae06('0x8')]);util[_0xae06('0x19')](this[_0xae06('0x5')]['id'],this[_0xae06('0x7')][_0xae06('0x13')][this[_0xae06('0x6')]['id']],'RINGING'+(this[_0xae06('0x8')][_0xae06('0x1a')]?':FORCED':''));}else{logger[_0xae06('0x11')](_0xae06('0x1b'),this['squeue']['id'],this[_0xae06('0x6')]['id']);setTimeout(this[_0xae06('0x10')][_0xae06('0xa')](this),0x3e8);}}};Agent['prototype'][_0xae06('0xb')]=function(_0x54c3ec){if(_[_0xae06('0x12')](this['realtime'][_0xae06('0x13')][this['agent']['id']])){return logger['info'](_0xae06('0x14'),this[_0xae06('0x5')]['id'],this[_0xae06('0x6')]['id']);}else{logger[_0xae06('0x11')](_0xae06('0x1c'),this['squeue']['id'],this[_0xae06('0x6')]['id']);util['hideNotification'](this[_0xae06('0x4')],this['squeue']['id'],this[_0xae06('0x7')][_0xae06('0x13')][this[_0xae06('0x6')]['id']],null,this['routing']);this[_0xae06('0x7')][_0xae06('0x13')][this[_0xae06('0x6')]['id']]['busy']=![];this['realtime'][_0xae06('0x13')][this[_0xae06('0x6')]['id']]['busyQueue']=undefined;util['writeLog'](this[_0xae06('0x5')]['id'],this[_0xae06('0x7')]['agents'][this[_0xae06('0x6')]['id']],_0x54c3ec?_0xae06('0x1d'):_0xae06('0x1e'));}if(!_0x54c3ec){setTimeout(this[_0xae06('0x10')][_0xae06('0xa')](this),0x3e8);}};function agent(_0x3c3c54,_0x419365,_0x3140a2,_0x4e1861){return new Agent(_0x3c3c54,_0x419365,_0x3140a2,_0x4e1861);}module[_0xae06('0x1f')]=agent; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/beepall.js b/server/services/routing/server/applications/strategy/beepall.js index 5ccdcf1..c572ed3 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 _0x0689=['bind','handleTimeout','timeout','drained','prototype','push','handleRun','handleDrained','isNil','Agents','length','agents','info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','RINGING','busy','busyQueue','name','showNotification','[%s][QUEUE]\x20EMPTY','STOP','TIMEOUT','uuid','../../../../../config/logger','routing','notificationId','squeue','queue','realtime'];(function(_0x44bdf,_0xb7c229){var _0x3bdc8b=function(_0x123e9e){while(--_0x123e9e){_0x44bdf['push'](_0x44bdf['shift']());}};_0x3bdc8b(++_0xb7c229);}(_0x0689,0x161));var _0x9068=function(_0x25f4dc,_0x59bec9){_0x25f4dc=_0x25f4dc-0x0;var _0x46ce50=_0x0689[_0x25f4dc];return _0x46ce50;};'use strict';var _=require('lodash');var uuid=require(_0x9068('0x0'));var util=require('./util');var logger=require(_0x9068('0x1'))(_0x9068('0x2'));var Beepall=function(_0x222292,_0x45c9e5,_0x44080a,_0x1c35ba){this[_0x9068('0x3')]=uuid['v4']();this[_0x9068('0x4')]=_0x222292;this[_0x9068('0x5')]=_0x45c9e5;this[_0x9068('0x6')]=_0x44080a;this['routing']=_0x1c35ba;this[_0x9068('0x4')]['push'](this['handleRun'][_0x9068('0x7')](this),this[_0x9068('0x8')][_0x9068('0x7')](this));this[_0x9068('0x4')]['on'](_0x9068('0x9'),this[_0x9068('0x8')][_0x9068('0x7')](this));this[_0x9068('0x4')]['on'](_0x9068('0xa'),this['handleDrained'][_0x9068('0x7')](this));};Beepall[_0x9068('0xb')][_0x9068('0xc')]=function(){this[_0x9068('0x4')]['push'](this[_0x9068('0xd')][_0x9068('0x7')](this),this[_0x9068('0x8')]['bind'](this));};Beepall[_0x9068('0xb')][_0x9068('0xe')]=function(_0x414054){this['handleTimeout'](!![]);};Beepall[_0x9068('0xb')][_0x9068('0xd')]=function(_0x57bc1a){var _0x2db941=!![];if(!_[_0x9068('0xf')](this['queue'])&&!_[_0x9068('0xf')](this[_0x9068('0x5')][_0x9068('0x10')])&&this[_0x9068('0x5')]['Agents'][_0x9068('0x11')]>0x0){for(var _0x376f6d=0x0,_0x3ab698;_0x376f6d0x0){for(var _0x4828a0=0x0,_0x517619;_0x4828a00x0&&_0x2402de[_0x3f80b9+_0x901d('0x24')]>=_0x2402de[_0x3f80b9+_0x901d('0x23')]){writeLog(_0x53ee69,_0x2402de,_0x3f80b9[_0x901d('0x25')]()+'\x20MAXCAPACITY');return![];}}return!![];};exports[_0x901d('0x26')]=function(_0xc52d0f,_0x14976e,_0x2f3ae9,_0x37158e,_0x3de9b9){return sendNotification(!![],_0xc52d0f,_0x14976e,_0x2f3ae9,_0x37158e,_0x3de9b9);};exports['hideNotification']=function(_0xae6dfe,_0x533038,_0x128830,_0x389fd9,_0x20dbc5){return sendNotification(![],_0xae6dfe,_0x533038,_0x128830,_0x389fd9,_0x20dbc5);};exports[_0x901d('0x27')]=writeLog; \ No newline at end of file +var _0x2542=['writeLog','lodash','util','../utils','mustache','../../../../../config/environment','routing','redis','defaults','localhost','emit','user:%s','name','user:save','split','\x20interaction','account','notificationSound','notificationShake','body','queue','getMustacheRender','notificationTemplate','msg','I\x20can\x27t\x20render\x20your\x20template','error','format','notification:%s','save','isAgentAvailable','OFFLINE','Pause','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','showNotification','hideNotification'];(function(_0x348860,_0x4531f6){var _0x2fc2ad=function(_0x3b449f){while(--_0x3b449f){_0x348860['push'](_0x348860['shift']());}};_0x2fc2ad(++_0x4531f6);}(_0x2542,0x169));var _0x2254=function(_0x45d5bc,_0x42fc1e){_0x45d5bc=_0x45d5bc-0x0;var _0xb512e3=_0x2542[_0x45d5bc];return _0xb512e3;};'use strict';var _=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var utils=require(_0x2254('0x2'));var Mustache=require(_0x2254('0x3'));var Redis=require('ioredis');var config=require(_0x2254('0x4'));var logger=require('../../../../../config/logger')(_0x2254('0x5'));config[_0x2254('0x6')]=_[_0x2254('0x7')](config[_0x2254('0x6')],{'host':_0x2254('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x2254('0x6')]));function emit(_0xe8ca50,_0x2ee7ee,_0x3c45ec){io['to'](_0xe8ca50)[_0x2254('0x9')](_0x2ee7ee,_0x3c45ec);}function sendNotification(_0x477b47,_0x263459,_0xbf1c18,_0xb395da,_0x1ae415,_0x38fb2b){io['to'](util['format'](_0x2254('0xa'),_0xb395da[_0x2254('0xb')]))[_0x2254('0x9')](_0x2254('0xc'),_0xb395da);var _0x575d58=_0x38fb2b||{};var _0x524fad=_0xbf1c18[_0x2254('0xd')]('.');var _0x3e4213={'uniqueid':_0x263459,'channel':_0x524fad[0x0],'id':_0x524fad[0x1],'title':_0x524fad[0x0]+_0x2254('0xe'),'interactionId':_0x524fad[0x2],'queue':_0x1ae415?_0x1ae415[_0x2254('0xb')]:null,'sound':_0x575d58[_0x2254('0xf')][_0x2254('0x10')],'shake':_0x575d58['account'][_0x2254('0x11')]};try{if(!_0x575d58[_0x2254('0x12')]){_0x575d58['body']={};}if(_0x1ae415){_0x575d58[_0x2254('0x12')][_0x2254('0x13')]=_0x1ae415;}else if(_0x575d58[_0x2254('0x12')][_0x2254('0x13')]){delete _0x575d58[_0x2254('0x12')][_0x2254('0x13')];}_0x3e4213['msg']=utils[_0x2254('0x14')](_0x575d58['account'][_0x2254('0x15')],_0x575d58);}catch(_0x2a2470){_0x3e4213[_0x2254('0x16')]=_0x2254('0x17');logger[_0x2254('0x18')](util[_0x2254('0x19')]('[%s][QUEUE]\x20%s',_0x263459,_0x2a2470['message']));}io['to'](util['format'](_0x2254('0xa'),_0xb395da[_0x2254('0xb')]))[_0x2254('0x9')](util[_0x2254('0x19')](_0x2254('0x1a'),_0x477b47?_0x2254('0x1b'):'remove'),_0x3e4213);}function writeLog(_0x28381e,_0x16148d,_0x906cde){return logger['info'](util['format']('[%s][QUEUE][AGENT:%s][STATUS:%s]',_0x28381e,_0x16148d[_0x2254('0xb')],_0x906cde));}exports[_0x2254('0x1c')]=function(_0xf88b56,_0x56b91e,_0x5713e4,_0x4d8faf){if(_0x56b91e['busy']){writeLog(_0xf88b56,_0x56b91e,'BUSY');return![];}if(!_0x56b91e['online']){writeLog(_0xf88b56,_0x56b91e,_0x2254('0x1d'));return![];}if(_0x56b91e[_0x5713e4+_0x2254('0x1e')]){writeLog(_0xf88b56,_0x56b91e,_0x2254('0x1f'));return![];}if(_0x4d8faf&&_0x56b91e[_0x2254('0x20')](_0x5713e4+_0x2254('0x21'))&&_0x56b91e[_0x2254('0x20')](_0x5713e4+'CurrentCapacity')){if(_0x56b91e[_0x5713e4+'Capacity']>0x0&&_0x56b91e[_0x5713e4+_0x2254('0x22')]>=_0x56b91e[_0x5713e4+'Capacity']){writeLog(_0xf88b56,_0x56b91e,_0x5713e4[_0x2254('0x23')]()+_0x2254('0x24'));return![];}}return!![];};exports[_0x2254('0x25')]=function(_0x3aa0bd,_0x19043b,_0x482688,_0x1a8a0d,_0x2a789b){return sendNotification(!![],_0x3aa0bd,_0x19043b,_0x482688,_0x1a8a0d,_0x2a789b);};exports[_0x2254('0x26')]=function(_0x37af8b,_0x13366a,_0x377c41,_0x3214a7,_0x22e791){return sendNotification(![],_0x37af8b,_0x13366a,_0x377c41,_0x3214a7,_0x22e791);};exports[_0x2254('0x27')]=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 4e5983f..c1e98ed 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 _0x6904=['message','join','info','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','isObject','stringify','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','validate','lodash','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','error','[%s][SYSTEM]\x20%s','map'];(function(_0x4181cd,_0x2f4500){var _0x52c494=function(_0x1b4c0a){while(--_0x1b4c0a){_0x4181cd['push'](_0x4181cd['shift']());}};_0x52c494(++_0x2f4500);}(_0x6904,0xd9));var _0x4690=function(_0x1bbc08,_0x444008){_0x1bbc08=_0x1bbc08-0x0;var _0x5d825b=_0x6904[_0x1bbc08];return _0x5d825b;};'use strict';var schema=require(_0x4690('0x0'));var sh=require('shelljs');var _=require(_0x4690('0x1'));var utils=require('./utils');var logger=require('../../../../config/logger')('routing');var system=schema({'command':{'type':_0x4690('0x2'),'required':!![],'message':_0x4690('0x3')}});exports[_0x4690('0x4')]=function(_0x52bcc5,_0x28de92){return function(_0x35dd4){try{var _0x50f994={'command':_0x28de92[0x0]};var _0x3cae20=system[_0x4690('0x0')](_0x50f994,{'typecast':!![]});if(_0x3cae20['length']){logger[_0x4690('0x5')](_0x4690('0x6'),_0x52bcc5,_[_0x4690('0x7')](_0x3cae20,_0x4690('0x8'))[_0x4690('0x9')](',\x20'));logger[_0x4690('0xa')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x52bcc5);_0x35dd4[_0x4690('0xb')]();}else{var _0x3d7ad4=this;var _0x3f375d=utils[_0x4690('0xc')](_0x28de92[0x0],this);logger['info'](_0x4690('0xd'),_0x52bcc5,_0x3f375d);sh[_0x4690('0xe')](_[_0x4690('0xf')](_0x3f375d),function(_0x593a46,_0x15576b){logger[_0x4690('0xa')](_0x4690('0x10'),_0x52bcc5,_0x593a46);if(_0x593a46==0x0){var _0x1cb1ac=_0x15576b[_0x4690('0x11')](/(\r\n|\n|\r)/gm,'');if(_[_0x4690('0x12')](_0x28de92[0x1])||_[_0x4690('0x13')](_0x28de92[0x1])){logger['info'](_0x4690('0x14'),_0x52bcc5);_0x3d7ad4[_0x4690('0x15')][_0x28de92[0x1]]=_0x1cb1ac;}else{logger[_0x4690('0xa')]('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x52bcc5,_0x28de92[0x1],_0x1cb1ac);_0x3d7ad4[_0x4690('0x15')][_0x28de92[0x1]]=_0x1cb1ac;}}_0x35dd4['next']();});}}catch(_0x596bc5){logger['error'](_0x4690('0x6'),_0x52bcc5,_[_0x4690('0x16')](_0x596bc5)?JSON[_0x4690('0x17')](_0x596bc5):_0x596bc5);logger[_0x4690('0xa')](_0x4690('0x18'),_0x52bcc5);_0x35dd4['next']();}};}; \ No newline at end of file +var _0x7a84=['command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','error','[%s][SYSTEM]\x20%s','map','join','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','info','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','stringify','validate','shelljs','lodash','./utils'];(function(_0x158f01,_0x12af3e){var _0x5ef74e=function(_0x5e7adc){while(--_0x5e7adc){_0x158f01['push'](_0x158f01['shift']());}};_0x5ef74e(++_0x12af3e);}(_0x7a84,0x182));var _0x47a8=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7a84[_0x20a584];return _0x4b41a8;};'use strict';var schema=require(_0x47a8('0x0'));var sh=require(_0x47a8('0x1'));var _=require(_0x47a8('0x2'));var utils=require(_0x47a8('0x3'));var logger=require('../../../../config/logger')('routing');var system=schema({'command':{'type':'string','required':!![],'message':_0x47a8('0x4')}});exports[_0x47a8('0x5')]=function(_0x19c7a0,_0x24595f){return function(_0x582413){try{var _0x431bc9={'command':_0x24595f[0x0]};var _0x259aca=system['validate'](_0x431bc9,{'typecast':!![]});if(_0x259aca['length']){logger[_0x47a8('0x6')](_0x47a8('0x7'),_0x19c7a0,_[_0x47a8('0x8')](_0x259aca,'message')[_0x47a8('0x9')](',\x20'));logger['info'](_0x47a8('0xa'),_0x19c7a0);_0x582413[_0x47a8('0xb')]();}else{var _0x48f142=this;var _0x1dc630=utils[_0x47a8('0xc')](_0x24595f[0x0],this);logger[_0x47a8('0xd')](_0x47a8('0xe'),_0x19c7a0,_0x1dc630);sh[_0x47a8('0xf')](_[_0x47a8('0x10')](_0x1dc630),function(_0x3bdda2,_0xc3b51){logger['info'](_0x47a8('0x11'),_0x19c7a0,_0x3bdda2);if(_0x3bdda2==0x0){var _0x1f646b=_0xc3b51[_0x47a8('0x12')](/(\r\n|\n|\r)/gm,'');if(_[_0x47a8('0x13')](_0x24595f[0x1])||_[_0x47a8('0x14')](_0x24595f[0x1])){logger[_0x47a8('0xd')](_0x47a8('0x15'),_0x19c7a0);_0x48f142[_0x47a8('0x16')][_0x24595f[0x1]]=_0x1f646b;}else{logger[_0x47a8('0xd')](_0x47a8('0x17'),_0x19c7a0,_0x24595f[0x1],_0x1f646b);_0x48f142['body'][_0x24595f[0x1]]=_0x1f646b;}}_0x582413[_0x47a8('0xb')]();});}}catch(_0x25b779){logger[_0x47a8('0x6')](_0x47a8('0x7'),_0x19c7a0,_[_0x47a8('0x18')](_0x25b779)?JSON[_0x47a8('0x19')](_0x25b779):_0x25b779);logger[_0x47a8('0xd')](_0x47a8('0xa'),_0x19c7a0);_0x582413[_0x47a8('0xb')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tag.js b/server/services/routing/server/applications/tag.js index c6e3e60..e2d10f5 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 _0x75ac=['stringify','finally','isObject','validate','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../../../config/logger','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','[%s][TAG]\x20%s','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','interaction','then','catch','error'];(function(_0x2a9bb2,_0xccdbcb){var _0x58c695=function(_0x3ef90a){while(--_0x3ef90a){_0x2a9bb2['push'](_0x2a9bb2['shift']());}};_0x58c695(++_0xccdbcb);}(_0x75ac,0xdb));var _0xc75a=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x75ac[_0x273c39];return _0x46d6b5;};'use strict';var schema=require(_0xc75a('0x0'));var _=require('lodash');var rpc={'chatInteraction':require(_0xc75a('0x1')),'openchannelInteraction':require(_0xc75a('0x2')),'smsInteraction':require(_0xc75a('0x3')),'mailInteraction':require(_0xc75a('0x4')),'faxInteraction':require(_0xc75a('0x5')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require(_0xc75a('0x6'))('routing');var tag=schema({'tag':{'type':_0xc75a('0x7'),'required':!![],'message':_0xc75a('0x8')}});exports[_0xc75a('0x9')]=function(_0x174923,_0x38b47d,_0x2c0b6d,_0x4b965e){return function(_0x896c9b){try{var _0x3fe1c7={'tag':_0x38b47d[0x0]};var _0x483eb5=tag[_0xc75a('0x0')](_0x3fe1c7,{'typecast':!![]});if(_0x483eb5[_0xc75a('0xa')]){logger['error'](_0xc75a('0xb'),_0x174923,_['map'](_0x483eb5,_0xc75a('0xc'))[_0xc75a('0xd')](',\x20'));logger[_0xc75a('0xe')](_0xc75a('0xf'),_0x174923);_0x896c9b[_0xc75a('0x10')]();}else{var _0x1246d8={'ids':[_0x38b47d[0x0]]};if(rpc[_0x4b965e[_0xc75a('0x11')]+'Interaction']){rpc[_0x4b965e[_0xc75a('0x11')]+_0xc75a('0x12')][_0xc75a('0x13')](_0x4b965e[_0xc75a('0x14')]['id'],_0x1246d8)[_0xc75a('0x15')](function(_0x7b93ed){logger[_0xc75a('0xe')]('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x174923,_0x38b47d[0x1],_0x4b965e[_0xc75a('0x11')],_0x4b965e['interaction']['id']);})[_0xc75a('0x16')](function(_0x42781a){logger[_0xc75a('0x17')](_0xc75a('0xb'),_0x174923,JSON[_0xc75a('0x18')](_0x42781a));logger[_0xc75a('0xe')](_0xc75a('0xf'),_0x174923);})[_0xc75a('0x19')](function(){_0x896c9b['next']();});}}}catch(_0x443c58){logger[_0xc75a('0x17')]('[%s][TAG]\x20%s',_0x174923,_[_0xc75a('0x1a')](_0x443c58)?JSON['stringify'](_0x443c58):_0x443c58);logger[_0xc75a('0xe')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x174923);_0x896c9b[_0xc75a('0x10')]();}};}; \ No newline at end of file +var _0xceec=['consequence','validate','error','map','message','info','channel','Interaction','addTags','interaction','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','finally','isObject','next','lodash','../../rpc/chatInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'];(function(_0x139cc2,_0x4f28c0){var _0x19f8c6=function(_0x46b58d){while(--_0x46b58d){_0x139cc2['push'](_0x139cc2['shift']());}};_0x19f8c6(++_0x4f28c0);}(_0xceec,0x178));var _0xccee=function(_0x4581d0,_0x22b8b1){_0x4581d0=_0x4581d0-0x0;var _0x4f9b64=_0xceec[_0x4581d0];return _0x4f9b64;};'use strict';var schema=require('validate');var _=require(_0xccee('0x0'));var rpc={'chatInteraction':require(_0xccee('0x1')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0xccee('0x2')),'faxInteraction':require(_0xccee('0x3')),'whatsappInteraction':require(_0xccee('0x4'))};var logger=require('../../../../config/logger')(_0xccee('0x5'));var tag=schema({'tag':{'type':_0xccee('0x6'),'required':!![],'message':_0xccee('0x7')}});exports[_0xccee('0x8')]=function(_0xd77cce,_0xd01291,_0x3055a1,_0x30dbd9){return function(_0x104c3b){try{var _0x486837={'tag':_0xd01291[0x0]};var _0x57bf1f=tag[_0xccee('0x9')](_0x486837,{'typecast':!![]});if(_0x57bf1f['length']){logger[_0xccee('0xa')]('[%s][TAG]\x20%s',_0xd77cce,_[_0xccee('0xb')](_0x57bf1f,_0xccee('0xc'))['join'](',\x20'));logger[_0xccee('0xd')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0xd77cce);_0x104c3b['next']();}else{var _0xa20546={'ids':[_0xd01291[0x0]]};if(rpc[_0x30dbd9[_0xccee('0xe')]+_0xccee('0xf')]){rpc[_0x30dbd9['channel']+_0xccee('0xf')][_0xccee('0x10')](_0x30dbd9[_0xccee('0x11')]['id'],_0xa20546)['then'](function(_0x9bba98){logger[_0xccee('0xd')](_0xccee('0x12'),_0xd77cce,_0xd01291[0x1],_0x30dbd9[_0xccee('0xe')],_0x30dbd9[_0xccee('0x11')]['id']);})[_0xccee('0x13')](function(_0x590ed1){logger[_0xccee('0xa')]('[%s][TAG]\x20%s',_0xd77cce,JSON['stringify'](_0x590ed1));logger[_0xccee('0xd')](_0xccee('0x14'),_0xd77cce);})[_0xccee('0x15')](function(){_0x104c3b['next']();});}}}catch(_0x2ae21f){logger[_0xccee('0xa')]('[%s][TAG]\x20%s',_0xd77cce,_[_0xccee('0x16')](_0x2ae21f)?JSON['stringify'](_0x2ae21f):_0x2ae21f);logger[_0xccee('0xd')](_0xccee('0x14'),_0xd77cce);_0x104c3b[_0xccee('0x17')]();}};}; \ 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 2a42a2e..959ad1a 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 _0xe706=['exports','render','merge','body','contact','message','account','interaction','list','mustache','lodash'];(function(_0x41f1b6,_0x41dd2a){var _0x34c1ca=function(_0x4f4951){while(--_0x4f4951){_0x41f1b6['push'](_0x41f1b6['shift']());}};_0x34c1ca(++_0x41dd2a);}(_0xe706,0xa3));var _0x6e70=function(_0x2f1908,_0x5d837d){_0x2f1908=_0x2f1908-0x0;var _0x357795=_0xe706[_0x2f1908];return _0x357795;};'use strict';var Mustache=require(_0x6e70('0x0'));var _=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'getMustacheRender':function(_0x5e8446,_0x2cae77){return Mustache[_0x6e70('0x3')](_0x5e8446,_[_0x6e70('0x4')](_0x2cae77[_0x6e70('0x5')],{'contact':_0x2cae77[_0x6e70('0x6')],'message':_0x2cae77[_0x6e70('0x7')],'account':_0x2cae77[_0x6e70('0x8')],'interaction':_0x2cae77[_0x6e70('0x9')],'list':_0x2cae77[_0x6e70('0xa')]}))||'';}}; \ No newline at end of file +var _0xd8b0=['merge','body','contact','message','list','mustache','lodash','render'];(function(_0x44c2eb,_0x3b5a6f){var _0x4a64b3=function(_0x14165e){while(--_0x14165e){_0x44c2eb['push'](_0x44c2eb['shift']());}};_0x4a64b3(++_0x3b5a6f);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'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 27864c8..621576d 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 _0xd898=['Push\x20new\x20rule','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','Applications\x20executed','stringify','rules','emit','complete','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','agents','busyQueue','end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','busy','message\x20is\x20empty','capacity','hasOwnProperty','CurrentCapacity','updateRealtime','values','chatQueues','available','loggedIn','paused','waiting','mailQueues','name','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','http','log','RPC\x20listening\x20on\x20port:','lodash','path','jayson/promise','bluebird','uuid','../../../config/environment','../../../config/logger','routing','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','isNil','IntervalId','Intervals','map','interval','listen','channel','message','interaction','applications','isArray','length','existsSync','join','app','.js','toLowerCase','autoreply','split','mail','push','slice','dialogflow','appdata','dialogflowv2','tag','TagId','format','%s:%s:%s','./interval','condition','intervals','./applications/','priority','info'];(function(_0xfe575e,_0x58ac73){var _0x31bcc2=function(_0xc2ed6e){while(--_0xc2ed6e){_0xfe575e['push'](_0xfe575e['shift']());}};_0x31bcc2(++_0x58ac73);}(_0xd898,0x91));var _0x8d89=function(_0x473d49,_0x3a4e16){_0x473d49=_0x473d49-0x0;var _0x424370=_0xd898[_0x473d49];return _0x424370;};'use strict';var _=require(_0x8d89('0x0'));var util=require('util');var path=require(_0x8d89('0x1'));var fs=require('fs');var jayson=require(_0x8d89('0x2'));var BPromise=require(_0x8d89('0x3'));var uuid=require(_0x8d89('0x4'));var config=require(_0x8d89('0x5'));var logger=require(_0x8d89('0x6'))(_0x8d89('0x7'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x8d89('0x8')),'chatQueueReport':require(_0x8d89('0x9')),'smsQueueReport':require(_0x8d89('0xa')),'faxQueueReport':require(_0x8d89('0xb')),'whatsappQueueReport':require(_0x8d89('0xc'))};var RuleEngine=require(_0x8d89('0xd'));function getId(_0x17bc61,_0x149bd6,_0x2834da){return util['format']('%s.%s.%s',_0x17bc61,_0x149bd6||0x0,_0x2834da||0x0);}function getIntervals(_0x50cfcd,_0x43299c){var _0x2ae0ef=[];if(!_[_0x8d89('0xe')](_0x43299c[_0x8d89('0xf')])&&!_[_0x8d89('0xe')](_0x50cfcd[_0x43299c[_0x8d89('0xf')]])&&!_[_0x8d89('0xe')](_0x50cfcd[_0x43299c[_0x8d89('0xf')]][_0x8d89('0x10')])){_0x2ae0ef=_[_0x8d89('0x11')](_0x50cfcd[_0x43299c['IntervalId']][_0x8d89('0x10')],_0x8d89('0x12'));}else if(!_[_0x8d89('0xe')](_0x43299c[_0x8d89('0x12')])){_0x2ae0ef=[_0x43299c[_0x8d89('0x12')]];}return _0x2ae0ef;}exports[_0x8d89('0x13')]=function(_0xe1bf11){_0xe1bf11['rules']={};return new BPromise(function(_0x5275cb,_0x29ab4d){var _0x819c83={'Start':function(_0x2d4307){var _0x5c2d35=this;return new Promise(function(_0x18e1f4,_0x812e90){if(_0x2d4307){try{var _0x943316=[];var _0x1c56ae=getId(_0x2d4307[_0x8d89('0x14')],_0x2d4307[_0x8d89('0x15')]?_0x2d4307[_0x8d89('0x15')]['id']:0x0,_0x2d4307[_0x8d89('0x16')]?_0x2d4307['interaction']['id']:0x0);if(_0x2d4307[_0x8d89('0x17')]&&_[_0x8d89('0x18')](_0x2d4307[_0x8d89('0x17')])&&_0x2d4307[_0x8d89('0x17')]['length']){for(var _0x1ee701=0x0;_0x1ee701<_0x2d4307[_0x8d89('0x17')][_0x8d89('0x19')];_0x1ee701+=0x1){var _0x1c5787=_0x2d4307[_0x8d89('0x17')][_0x1ee701];if(fs[_0x8d89('0x1a')](path[_0x8d89('0x1b')](__dirname,_0x8d89('0x17'),_0x1c5787[_0x8d89('0x1c')]+_0x8d89('0x1d')))){var _0x1341b7=[];switch(_0x1c5787[_0x8d89('0x1c')][_0x8d89('0x1e')]()){case _0x8d89('0x1f'):var _0x1882e4=_0x1c5787['appdata'][_0x8d89('0x20')](',');if(_0x2d4307[_0x8d89('0x14')]===_0x8d89('0x21')){_0x1341b7['push'](_0x1882e4[0x0]);_0x1341b7[_0x8d89('0x22')](_0x1882e4[0x1]);_0x1341b7[_0x8d89('0x22')](_0x1882e4['slice'](0x2,_0x1882e4[_0x8d89('0x19')])[_0x8d89('0x1b')](','));}else{_0x1341b7[_0x8d89('0x22')](_0x1882e4[0x0]);_0x1341b7[_0x8d89('0x22')](_0x1882e4[_0x8d89('0x23')](0x1,_0x1882e4['length'])[_0x8d89('0x1b')](','));}break;case _0x8d89('0x24'):var _0x273764=_0x1c5787[_0x8d89('0x25')][_0x8d89('0x20')](',');_0x1341b7[_0x8d89('0x22')](_0x273764[0x0]);_0x1341b7[_0x8d89('0x22')](_0x273764[0x1]);_0x1341b7[_0x8d89('0x22')](_0x273764[_0x8d89('0x23')](0x2,_0x273764[_0x8d89('0x19')])[_0x8d89('0x1b')](','));break;case _0x8d89('0x26'):var _0x3a8300=_0x1c5787[_0x8d89('0x25')][_0x8d89('0x20')](',');_0x1341b7[_0x8d89('0x22')](_0x3a8300[0x0]);_0x1341b7[_0x8d89('0x22')](_0x3a8300[0x1]);_0x1341b7[_0x8d89('0x22')](_0x3a8300[0x2]);_0x1341b7[_0x8d89('0x22')](_0x3a8300[0x3]);_0x1341b7['push'](_0x3a8300[_0x8d89('0x23')](0x4,_0x3a8300[_0x8d89('0x19')])[_0x8d89('0x1b')](','));break;case'amazonlex':var _0x196ca4=_0x1c5787[_0x8d89('0x25')]['split'](',');_0x1341b7[_0x8d89('0x22')](_0x196ca4[0x0]);_0x1341b7[_0x8d89('0x22')](_0x196ca4[0x1]);_0x1341b7[_0x8d89('0x22')](_0x196ca4[0x2]);_0x1341b7[_0x8d89('0x22')](_0x196ca4[0x3]);_0x1341b7[_0x8d89('0x22')](_0x196ca4[_0x8d89('0x23')](0x4,_0x196ca4[_0x8d89('0x19')])[_0x8d89('0x1b')](','));break;case _0x8d89('0x15'):_0x1341b7[_0x8d89('0x22')](_0x1c5787[_0x8d89('0x25')]);break;case _0x8d89('0x27'):_0x1341b7['push'](_0x1c5787[_0x8d89('0x28')]);_0x1341b7[_0x8d89('0x22')](_0x1c5787[_0x8d89('0x25')]);break;default:_0x1341b7=_['isNil'](_0x1c5787[_0x8d89('0x25')])?[]:_0x1c5787[_0x8d89('0x25')]['split'](',');}var _0x326747={'id':util[_0x8d89('0x29')](_0x8d89('0x2a'),_0x1c56ae,_0x1c5787['id'],_0x1c5787[_0x8d89('0x1c')]),'condition':require(_0x8d89('0x2b'))[_0x8d89('0x2c')](_0x1c56ae,getIntervals(_0xe1bf11[_0x8d89('0x2d')],_0x1c5787),_0xe1bf11),'consequence':require(_0x8d89('0x2e')+_0x1c5787[_0x8d89('0x1c')])['consequence'](_0x1c56ae,_0x1341b7,_0xe1bf11,_0x2d4307),'p':_0x1c5787[_0x8d89('0x2f')]||0x0};logger[_0x8d89('0x30')](_0x8d89('0x31'),_0x326747['id'],'on\x20interval',getIntervals(_0xe1bf11[_0x8d89('0x2d')],_0x1c5787)[_0x8d89('0x1b')](_0x8d89('0x32')));_0x943316[_0x8d89('0x22')](_0x326747);}else{logger[_0x8d89('0x33')](_0x8d89('0x34'),path[_0x8d89('0x1b')](__dirname,_0x8d89('0x17'),_0x1c5787['app']+'.js'));}}_0xe1bf11['rules'][_0x1c56ae]=new RuleEngine(_0x943316);_0xe1bf11['rules'][_0x1c56ae]['execute'](_0x2d4307,function(_0x4a49ca){logger['info'](_0x8d89('0x35'),JSON[_0x8d89('0x36')](_0x4a49ca['matchPath']));if(_0xe1bf11[_0x8d89('0x37')][_0x1c56ae]){_0xe1bf11[_0x8d89('0x37')][_0x1c56ae][_0x8d89('0x38')](_0x8d89('0x39'));}});return _0x18e1f4({'code':0xc8,'message':_0x2d4307});}else{logger['info'](_0x8d89('0x3a'));return _0x18e1f4({'code':0xc8,'message':_0x2d4307});}}catch(_0x3f76a5){logger[_0x8d89('0x33')](_0x3f76a5[_0x8d89('0x3b')]);return _0x812e90(_0x5c2d35['error'](0x1f4,_0x3f76a5));}}return _0x812e90(_0x8d89('0x3c'));});},'AcceptMessage':function(_0x12819b){var _0x4a6069=this;return new Promise(function(_0x3239f2,_0x40d30a){if(_0x12819b[_0x8d89('0x3d')]&&_0x12819b[_0x8d89('0x3d')]['id']){if(_0xe1bf11['agents'][_0x12819b[_0x8d89('0x3d')]['id']]){_0xe1bf11[_0x8d89('0x3e')][_0x12819b[_0x8d89('0x3d')]['id']]['busy']=![];_0xe1bf11[_0x8d89('0x3e')][_0x12819b[_0x8d89('0x3d')]['id']][_0x8d89('0x3f')]=undefined;}}if(_0x12819b[_0x8d89('0x15')]&&_0x12819b[_0x8d89('0x15')]['id']){try{var _0x42e0f4=getId(_0x12819b[_0x8d89('0x14')],_0x12819b[_0x8d89('0x15')]?_0x12819b[_0x8d89('0x15')]['id']:0x0,_0x12819b[_0x8d89('0x16')]?_0x12819b[_0x8d89('0x16')]['id']:0x0);if(_0xe1bf11['rules'][_0x42e0f4]){_0xe1bf11[_0x8d89('0x37')][_0x42e0f4]['emit'](_0x8d89('0x40'));if(rpc[_0x12819b['channel']+_0x8d89('0x41')]){rpc[_0x12819b[_0x8d89('0x14')]+'QueueReport'][_0x8d89('0x42')](_0x42e0f4,{'UserId':_0x12819b[_0x8d89('0x15')][_0x8d89('0x43')]})[_0x8d89('0x44')](function(_0x22c39c){logger['error'](_0x8d89('0x45'));});}}return _0x3239f2({'code':0xc8,'message':_0x12819b});}catch(_0x3f5f06){logger['error'](_0x3f5f06[_0x8d89('0x3b')]);return _0x40d30a(_0x4a6069[_0x8d89('0x33')](0x1f4,_0x3f5f06));}}logger[_0x8d89('0x33')]('message\x20is\x20empty');return _0x40d30a(_0x4a6069['error'](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x592bb3){var _0x2ef3ea=this;return new Promise(function(_0x4fbc14,_0x1b6f71){if(_0x592bb3[_0x8d89('0x3d')]&&_0x592bb3['agent']['id']){try{if(_0xe1bf11[_0x8d89('0x3e')][_0x592bb3[_0x8d89('0x3d')]['id']]){_0xe1bf11[_0x8d89('0x3e')][_0x592bb3['agent']['id']][_0x8d89('0x46')]=![];_0xe1bf11[_0x8d89('0x3e')][_0x592bb3[_0x8d89('0x3d')]['id']][_0x8d89('0x3f')]=undefined;}return _0x4fbc14({'code':0xc8,'message':_0x592bb3});}catch(_0x54d853){logger['error'](_0x54d853['stack']);return _0x1b6f71(_0x2ef3ea[_0x8d89('0x33')](0x1f4,_0x54d853));}}logger['error'](_0x8d89('0x47'));return _0x1b6f71(_0x2ef3ea[_0x8d89('0x33')](0x1f4,_0x8d89('0x47')));});},'AbandonInteraction':function(_0x51bc84){var _0x356cd9=this;return new Promise(function(_0x4cb030,_0xbe8801){if(_0x51bc84[_0x8d89('0x14')]&&_0x51bc84['interaction']&&_0x51bc84[_0x8d89('0x16')]['id']){try{var _0x4492c1=getId(_0x51bc84[_0x8d89('0x14')],_0x51bc84['message']?_0x51bc84[_0x8d89('0x15')]['id']:0x0,_0x51bc84['interaction']?_0x51bc84[_0x8d89('0x16')]['id']:0x0);if(_0xe1bf11['rules'][_0x4492c1]){_0xe1bf11[_0x8d89('0x37')][_0x4492c1][_0x8d89('0x38')](_0x8d89('0x40'));}return _0x4cb030({'code':0xc8,'message':_0x51bc84});}catch(_0x28c4d5){logger[_0x8d89('0x33')](_0x28c4d5['stack']);return _0xbe8801(_0x356cd9[_0x8d89('0x33')](0x1f4,_0x28c4d5));}}logger[_0x8d89('0x33')](_0x8d89('0x47'));return _0xbe8801(_0x356cd9[_0x8d89('0x33')](0x1f4,_0x8d89('0x47')));});},'AgentCapacity':function(_0x5e6d86){var _0x7ae6c=this;return new Promise(function(_0x10777c,_0x10c511){if(_0xe1bf11['agents']['hasOwnProperty'](_0x5e6d86['id'])){for(var _0x5dc634 in _0x5e6d86[_0x8d89('0x48')]){if(_0x5e6d86[_0x8d89('0x48')][_0x8d89('0x49')](_0x5dc634)){if(_0xe1bf11['agents'][_0x5e6d86['id']][_0x8d89('0x49')](_0x5dc634+'CurrentCapacity')){_0xe1bf11[_0x8d89('0x3e')][_0x5e6d86['id']][_0x5dc634+_0x8d89('0x4a')]=parseInt(_0x5e6d86[_0x8d89('0x48')][_0x5dc634],0xa);}}}_0xe1bf11['agents'][_0x5e6d86['id']][_0x8d89('0x4b')]();return _0x10777c({'code':0xc8,'message':_0xe1bf11[_0x8d89('0x3e')][_0x5e6d86['id']]});}else{return _0x10c511(_0x7ae6c[_0x8d89('0x33')](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x48d0a3){return new Promise(function(_0x32c9c9,_0xf4ab6e){var _0x2f6981=_[_0x8d89('0x4c')](_0xe1bf11[_0x8d89('0x3e')]);_0x32c9c9({'count':_0x2f6981[_0x8d89('0x19')],'rows':_0x2f6981});});},'ChatQueues':function(_0x225e7c){return new Promise(function(_0x51f834,_0x3a6db2){var _0x310f76=[];for(var _0x242c73 in _0xe1bf11[_0x8d89('0x4d')]){if(_0xe1bf11[_0x8d89('0x4d')][_0x8d89('0x49')](_0x242c73)){var _0x56e6b3=_0xe1bf11[_0x8d89('0x4d')][_0x242c73];var _0x3e58f7={'id':_0x56e6b3['id'],'available':_0x56e6b3[_0x8d89('0x4e')],'loggedIn':_0x56e6b3[_0x8d89('0x4f')],'name':_0x56e6b3['name'],'paused':_0x56e6b3[_0x8d89('0x50')],'waiting':_0x56e6b3[_0x8d89('0x51')]};_0x310f76[_0x8d89('0x22')](_0x3e58f7);}}_0x51f834({'count':_0x310f76['length'],'rows':_0x310f76});});},'MailQueues':function(_0x5aba3e){return new Promise(function(_0x1ca544,_0x3dd52d){var _0x2cb2ba=[];for(var _0x4b302b in _0xe1bf11[_0x8d89('0x52')]){if(_0xe1bf11[_0x8d89('0x52')][_0x8d89('0x49')](_0x4b302b)){var _0x428ba0=_0xe1bf11['mailQueues'][_0x4b302b];var _0x111ec7={'id':_0x428ba0['id'],'available':_0x428ba0[_0x8d89('0x4e')],'loggedIn':_0x428ba0[_0x8d89('0x4f')],'name':_0x428ba0[_0x8d89('0x53')],'paused':_0x428ba0['paused'],'waiting':_0x428ba0['waiting']};_0x2cb2ba[_0x8d89('0x22')](_0x111ec7);}}_0x1ca544({'count':_0x2cb2ba[_0x8d89('0x19')],'rows':_0x2cb2ba});});},'OpenchannelQueues':function(_0x54c8e3){return new Promise(function(_0x5a9e33,_0x32c0ac){var _0x55f23e=[];for(var _0x2ca38e in _0xe1bf11[_0x8d89('0x54')]){if(_0xe1bf11[_0x8d89('0x54')][_0x8d89('0x49')](_0x2ca38e)){var _0x804b50=_0xe1bf11[_0x8d89('0x54')][_0x2ca38e];var _0x4a3f90={'id':_0x804b50['id'],'available':_0x804b50[_0x8d89('0x4e')],'loggedIn':_0x804b50['loggedIn'],'name':_0x804b50[_0x8d89('0x53')],'paused':_0x804b50[_0x8d89('0x50')],'waiting':_0x804b50[_0x8d89('0x51')]};_0x55f23e[_0x8d89('0x22')](_0x4a3f90);}}_0x5a9e33({'count':_0x55f23e[_0x8d89('0x19')],'rows':_0x55f23e});});},'SmsQueues':function(_0x424fb3){return new Promise(function(_0x1cc7af,_0x3e18e4){var _0x5be9f1=[];for(var _0x3c0da3 in _0xe1bf11[_0x8d89('0x55')]){if(_0xe1bf11[_0x8d89('0x55')][_0x8d89('0x49')](_0x3c0da3)){var _0x129ea4=_0xe1bf11[_0x8d89('0x55')][_0x3c0da3];var _0x4ca716={'id':_0x129ea4['id'],'available':_0x129ea4['available'],'loggedIn':_0x129ea4[_0x8d89('0x4f')],'name':_0x129ea4[_0x8d89('0x53')],'paused':_0x129ea4[_0x8d89('0x50')],'waiting':_0x129ea4['waiting']};_0x5be9f1[_0x8d89('0x22')](_0x4ca716);}}_0x1cc7af({'count':_0x5be9f1[_0x8d89('0x19')],'rows':_0x5be9f1});});},'FaxQueues':function(_0x287b8d){return new Promise(function(_0x2bfb8e,_0x431375){var _0x19b4e9=[];for(var _0x2aa387 in _0xe1bf11[_0x8d89('0x56')]){if(_0xe1bf11[_0x8d89('0x56')][_0x8d89('0x49')](_0x2aa387)){var _0xed2c4e=_0xe1bf11['faxQueues'][_0x2aa387];var _0xeec0ec={'id':_0xed2c4e['id'],'available':_0xed2c4e[_0x8d89('0x4e')],'loggedIn':_0xed2c4e['loggedIn'],'name':_0xed2c4e[_0x8d89('0x53')],'paused':_0xed2c4e[_0x8d89('0x50')],'waiting':_0xed2c4e[_0x8d89('0x51')]};_0x19b4e9[_0x8d89('0x22')](_0xeec0ec);}}_0x2bfb8e({'count':_0x19b4e9[_0x8d89('0x19')],'rows':_0x19b4e9});});},'WhatsappQueues':function(_0x59bdc7){return new Promise(function(_0x41ffa5,_0x18287d){var _0x5af840=[];for(var _0x63bbfa in _0xe1bf11[_0x8d89('0x57')]){if(_0xe1bf11['whatsappQueues']['hasOwnProperty'](_0x63bbfa)){var _0x4e65ab=_0xe1bf11[_0x8d89('0x57')][_0x63bbfa];var _0x2447a1={'id':_0x4e65ab['id'],'available':_0x4e65ab[_0x8d89('0x4e')],'loggedIn':_0x4e65ab[_0x8d89('0x4f')],'name':_0x4e65ab[_0x8d89('0x53')],'paused':_0x4e65ab[_0x8d89('0x50')],'waiting':_0x4e65ab[_0x8d89('0x51')]};_0x5af840[_0x8d89('0x22')](_0x2447a1);}}_0x41ffa5({'count':_0x5af840[_0x8d89('0x19')],'rows':_0x5af840});});},'ChatQueuesWaitingInteractions':function(_0x178589){return new Promise(function(_0x4b12b2,_0x454baa){var _0x34329e=_[_0x8d89('0x4c')](_0xe1bf11[_0x8d89('0x58')]);_0x4b12b2({'count':_0x34329e[_0x8d89('0x19')],'rows':_0x34329e});});},'MailQueuesWaitingInteractions':function(_0x4e884a){return new Promise(function(_0x439468,_0x16c5e8){var _0x4a5a97=_[_0x8d89('0x4c')](_0xe1bf11[_0x8d89('0x59')]);_0x439468({'count':_0x4a5a97['length'],'rows':_0x4a5a97});});},'OpenchannelQueuesWaitingInteractions':function(_0x2992f6){return new Promise(function(_0x335556,_0x514cba){var _0x31000d=_[_0x8d89('0x4c')](_0xe1bf11[_0x8d89('0x5a')]);_0x335556({'count':_0x31000d[_0x8d89('0x19')],'rows':_0x31000d});});},'SmsQueuesWaitingInteractions':function(_0x35daa7){return new Promise(function(_0x38c4f9,_0x37c5ff){var _0x14e3bc=_[_0x8d89('0x4c')](_0xe1bf11[_0x8d89('0x5b')]);_0x38c4f9({'count':_0x14e3bc[_0x8d89('0x19')],'rows':_0x14e3bc});});},'FaxQueuesWaitingInteractions':function(_0xea1508){return new Promise(function(_0x4d92e4,_0x5d5f4c){var _0x3ae434=_[_0x8d89('0x4c')](_0xe1bf11[_0x8d89('0x5c')]);_0x4d92e4({'count':_0x3ae434[_0x8d89('0x19')],'rows':_0x3ae434});});},'WhatsappQueuesWaitingInteractions':function(_0x4fbefe){return new Promise(function(_0xfefefb,_0x1635ba){var _0xf0104b=_[_0x8d89('0x4c')](_0xe1bf11['whatsappQueuesWaitingInteractions']);_0xfefefb({'count':_0xf0104b['length'],'rows':_0xf0104b});});}};var _0x57e4ee=jayson[_0x8d89('0x5d')](_0x819c83)[_0x8d89('0x5e')]();_0x57e4ee['on'](_0x8d89('0x33'),function(_0x2ded67){logger[_0x8d89('0x33')](JSON['stringify'](_0x2ded67));return _0x29ab4d(_0x2ded67);});_0x57e4ee[_0x8d89('0x13')](0x232c,'127.0.0.1',function(){console[_0x8d89('0x5f')]('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x5275cb(_0x8d89('0x60')+0x232c);});});}; \ No newline at end of file +var _0xd1c9=['available','name','paused','waiting','mailQueues','openchannelQueues','loggedIn','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','stringify','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','uuid','../../../config/environment','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','%s.%s.%s','IntervalId','isNil','Intervals','map','interval','rules','channel','message','interaction','isArray','applications','length','existsSync','join','app','.js','autoreply','split','mail','slice','push','appdata','dialogflowv2','amazonlex','tag','TagId','format','%s:%s:%s','./interval','condition','./applications/','consequence','Push\x20new\x20rule','on\x20interval','intervals','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','emit','complete','info','No\x20applications\x20to\x20execute','routing\x20is\x20empty','agent','agents','busy','busyQueue','end','QueueReport','UserId','catch','error\x20update\x20queue\x20report','stack','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xd1c9,0x7c));var _0x9d1c=function(_0x4a209a,_0x575ff9){_0x4a209a=_0x4a209a-0x0;var _0x4b3c20=_0xd1c9[_0x4a209a];return _0x4b3c20;};'use strict';var _=require(_0x9d1c('0x0'));var util=require(_0x9d1c('0x1'));var path=require(_0x9d1c('0x2'));var fs=require('fs');var jayson=require(_0x9d1c('0x3'));var BPromise=require(_0x9d1c('0x4'));var uuid=require(_0x9d1c('0x5'));var config=require(_0x9d1c('0x6'));var logger=require(_0x9d1c('0x7'))(_0x9d1c('0x8'));var rpc={'openchannelQueueReport':require(_0x9d1c('0x9')),'mailQueueReport':require(_0x9d1c('0xa')),'chatQueueReport':require(_0x9d1c('0xb')),'smsQueueReport':require(_0x9d1c('0xc')),'faxQueueReport':require(_0x9d1c('0xd')),'whatsappQueueReport':require(_0x9d1c('0xe'))};var RuleEngine=require(_0x9d1c('0xf'));function getId(_0x83db27,_0xd908a4,_0x5ea6dc){return util['format'](_0x9d1c('0x10'),_0x83db27,_0xd908a4||0x0,_0x5ea6dc||0x0);}function getIntervals(_0x4ec974,_0x160ac1){var _0x27c498=[];if(!_['isNil'](_0x160ac1[_0x9d1c('0x11')])&&!_[_0x9d1c('0x12')](_0x4ec974[_0x160ac1[_0x9d1c('0x11')]])&&!_[_0x9d1c('0x12')](_0x4ec974[_0x160ac1[_0x9d1c('0x11')]][_0x9d1c('0x13')])){_0x27c498=_[_0x9d1c('0x14')](_0x4ec974[_0x160ac1[_0x9d1c('0x11')]][_0x9d1c('0x13')],_0x9d1c('0x15'));}else if(!_[_0x9d1c('0x12')](_0x160ac1[_0x9d1c('0x15')])){_0x27c498=[_0x160ac1[_0x9d1c('0x15')]];}return _0x27c498;}exports['listen']=function(_0x55428d){_0x55428d[_0x9d1c('0x16')]={};return new BPromise(function(_0x407aa9,_0x348b30){var _0x4eba82={'Start':function(_0x5141b1){var _0x429758=this;return new Promise(function(_0x4c0bfe,_0x233d21){if(_0x5141b1){try{var _0x19c0c7=[];var _0x4e9cd5=getId(_0x5141b1[_0x9d1c('0x17')],_0x5141b1['message']?_0x5141b1[_0x9d1c('0x18')]['id']:0x0,_0x5141b1[_0x9d1c('0x19')]?_0x5141b1['interaction']['id']:0x0);if(_0x5141b1['applications']&&_[_0x9d1c('0x1a')](_0x5141b1[_0x9d1c('0x1b')])&&_0x5141b1[_0x9d1c('0x1b')][_0x9d1c('0x1c')]){for(var _0x5e7086=0x0;_0x5e7086<_0x5141b1[_0x9d1c('0x1b')][_0x9d1c('0x1c')];_0x5e7086+=0x1){var _0x4bd142=_0x5141b1['applications'][_0x5e7086];if(fs[_0x9d1c('0x1d')](path[_0x9d1c('0x1e')](__dirname,_0x9d1c('0x1b'),_0x4bd142[_0x9d1c('0x1f')]+_0x9d1c('0x20')))){var _0x1158c7=[];switch(_0x4bd142[_0x9d1c('0x1f')]['toLowerCase']()){case _0x9d1c('0x21'):var _0x5bf36a=_0x4bd142['appdata'][_0x9d1c('0x22')](',');if(_0x5141b1['channel']===_0x9d1c('0x23')){_0x1158c7['push'](_0x5bf36a[0x0]);_0x1158c7['push'](_0x5bf36a[0x1]);_0x1158c7['push'](_0x5bf36a[_0x9d1c('0x24')](0x2,_0x5bf36a[_0x9d1c('0x1c')])[_0x9d1c('0x1e')](','));}else{_0x1158c7[_0x9d1c('0x25')](_0x5bf36a[0x0]);_0x1158c7[_0x9d1c('0x25')](_0x5bf36a[_0x9d1c('0x24')](0x1,_0x5bf36a[_0x9d1c('0x1c')])[_0x9d1c('0x1e')](','));}break;case'dialogflow':var _0x2f11bb=_0x4bd142[_0x9d1c('0x26')]['split'](',');_0x1158c7[_0x9d1c('0x25')](_0x2f11bb[0x0]);_0x1158c7['push'](_0x2f11bb[0x1]);_0x1158c7[_0x9d1c('0x25')](_0x2f11bb['slice'](0x2,_0x2f11bb[_0x9d1c('0x1c')])['join'](','));break;case _0x9d1c('0x27'):var _0x5664d2=_0x4bd142[_0x9d1c('0x26')][_0x9d1c('0x22')](',');_0x1158c7['push'](_0x5664d2[0x0]);_0x1158c7[_0x9d1c('0x25')](_0x5664d2[0x1]);_0x1158c7[_0x9d1c('0x25')](_0x5664d2[0x2]);_0x1158c7[_0x9d1c('0x25')](_0x5664d2[0x3]);_0x1158c7[_0x9d1c('0x25')](_0x5664d2[_0x9d1c('0x24')](0x4,_0x5664d2[_0x9d1c('0x1c')])[_0x9d1c('0x1e')](','));break;case _0x9d1c('0x28'):var _0x11baee=_0x4bd142[_0x9d1c('0x26')]['split'](',');_0x1158c7[_0x9d1c('0x25')](_0x11baee[0x0]);_0x1158c7[_0x9d1c('0x25')](_0x11baee[0x1]);_0x1158c7[_0x9d1c('0x25')](_0x11baee[0x2]);_0x1158c7['push'](_0x11baee[0x3]);_0x1158c7[_0x9d1c('0x25')](_0x11baee['slice'](0x4,_0x11baee[_0x9d1c('0x1c')])[_0x9d1c('0x1e')](','));break;case _0x9d1c('0x18'):_0x1158c7[_0x9d1c('0x25')](_0x4bd142[_0x9d1c('0x26')]);break;case _0x9d1c('0x29'):_0x1158c7[_0x9d1c('0x25')](_0x4bd142[_0x9d1c('0x2a')]);_0x1158c7['push'](_0x4bd142[_0x9d1c('0x26')]);break;default:_0x1158c7=_[_0x9d1c('0x12')](_0x4bd142[_0x9d1c('0x26')])?[]:_0x4bd142[_0x9d1c('0x26')][_0x9d1c('0x22')](',');}var _0x5626e7={'id':util[_0x9d1c('0x2b')](_0x9d1c('0x2c'),_0x4e9cd5,_0x4bd142['id'],_0x4bd142[_0x9d1c('0x1f')]),'condition':require(_0x9d1c('0x2d'))[_0x9d1c('0x2e')](_0x4e9cd5,getIntervals(_0x55428d['intervals'],_0x4bd142),_0x55428d),'consequence':require(_0x9d1c('0x2f')+_0x4bd142['app'])[_0x9d1c('0x30')](_0x4e9cd5,_0x1158c7,_0x55428d,_0x5141b1),'p':_0x4bd142['priority']||0x0};logger['info'](_0x9d1c('0x31'),_0x5626e7['id'],_0x9d1c('0x32'),getIntervals(_0x55428d[_0x9d1c('0x33')],_0x4bd142)[_0x9d1c('0x1e')](_0x9d1c('0x34')));_0x19c0c7[_0x9d1c('0x25')](_0x5626e7);}else{logger[_0x9d1c('0x35')](_0x9d1c('0x36'),path[_0x9d1c('0x1e')](__dirname,_0x9d1c('0x1b'),_0x4bd142[_0x9d1c('0x1f')]+_0x9d1c('0x20')));}}_0x55428d[_0x9d1c('0x16')][_0x4e9cd5]=new RuleEngine(_0x19c0c7);_0x55428d['rules'][_0x4e9cd5][_0x9d1c('0x37')](_0x5141b1,function(_0x5da86d){logger['info'](_0x9d1c('0x38'),JSON['stringify'](_0x5da86d['matchPath']));if(_0x55428d[_0x9d1c('0x16')][_0x4e9cd5]){_0x55428d[_0x9d1c('0x16')][_0x4e9cd5][_0x9d1c('0x39')](_0x9d1c('0x3a'));}});return _0x4c0bfe({'code':0xc8,'message':_0x5141b1});}else{logger[_0x9d1c('0x3b')](_0x9d1c('0x3c'));return _0x4c0bfe({'code':0xc8,'message':_0x5141b1});}}catch(_0x5cc523){logger[_0x9d1c('0x35')](_0x5cc523['stack']);return _0x233d21(_0x429758['error'](0x1f4,_0x5cc523));}}return _0x233d21(_0x9d1c('0x3d'));});},'AcceptMessage':function(_0x5ccb95){var _0x5ad23b=this;return new Promise(function(_0x796e0d,_0x2c6d19){if(_0x5ccb95[_0x9d1c('0x3e')]&&_0x5ccb95[_0x9d1c('0x3e')]['id']){if(_0x55428d[_0x9d1c('0x3f')][_0x5ccb95['agent']['id']]){_0x55428d[_0x9d1c('0x3f')][_0x5ccb95[_0x9d1c('0x3e')]['id']][_0x9d1c('0x40')]=![];_0x55428d[_0x9d1c('0x3f')][_0x5ccb95[_0x9d1c('0x3e')]['id']][_0x9d1c('0x41')]=undefined;}}if(_0x5ccb95[_0x9d1c('0x18')]&&_0x5ccb95[_0x9d1c('0x18')]['id']){try{var _0x53f912=getId(_0x5ccb95['channel'],_0x5ccb95[_0x9d1c('0x18')]?_0x5ccb95[_0x9d1c('0x18')]['id']:0x0,_0x5ccb95['interaction']?_0x5ccb95['interaction']['id']:0x0);if(_0x55428d['rules'][_0x53f912]){_0x55428d[_0x9d1c('0x16')][_0x53f912][_0x9d1c('0x39')](_0x9d1c('0x42'));if(rpc[_0x5ccb95['channel']+'QueueReport']){rpc[_0x5ccb95['channel']+_0x9d1c('0x43')]['update'](_0x53f912,{'UserId':_0x5ccb95[_0x9d1c('0x18')][_0x9d1c('0x44')]})[_0x9d1c('0x45')](function(_0x5e7fa3){logger[_0x9d1c('0x35')](_0x9d1c('0x46'));});}}return _0x796e0d({'code':0xc8,'message':_0x5ccb95});}catch(_0x23b4b8){logger[_0x9d1c('0x35')](_0x23b4b8[_0x9d1c('0x47')]);return _0x2c6d19(_0x5ad23b[_0x9d1c('0x35')](0x1f4,_0x23b4b8));}}logger[_0x9d1c('0x35')]('message\x20is\x20empty');return _0x2c6d19(_0x5ad23b[_0x9d1c('0x35')](0x1f4,_0x9d1c('0x48')));});},'RejectMessage':function(_0x27858c){var _0x2292b5=this;return new Promise(function(_0x4a8636,_0x57795d){if(_0x27858c[_0x9d1c('0x3e')]&&_0x27858c['agent']['id']){try{if(_0x55428d[_0x9d1c('0x3f')][_0x27858c[_0x9d1c('0x3e')]['id']]){_0x55428d[_0x9d1c('0x3f')][_0x27858c[_0x9d1c('0x3e')]['id']][_0x9d1c('0x40')]=![];_0x55428d[_0x9d1c('0x3f')][_0x27858c['agent']['id']][_0x9d1c('0x41')]=undefined;}return _0x4a8636({'code':0xc8,'message':_0x27858c});}catch(_0x558707){logger[_0x9d1c('0x35')](_0x558707[_0x9d1c('0x47')]);return _0x57795d(_0x2292b5[_0x9d1c('0x35')](0x1f4,_0x558707));}}logger[_0x9d1c('0x35')](_0x9d1c('0x48'));return _0x57795d(_0x2292b5['error'](0x1f4,_0x9d1c('0x48')));});},'AbandonInteraction':function(_0x22e2df){var _0x324d4d=this;return new Promise(function(_0x16ad77,_0x59d8ac){if(_0x22e2df['channel']&&_0x22e2df['interaction']&&_0x22e2df['interaction']['id']){try{var _0x5835d6=getId(_0x22e2df[_0x9d1c('0x17')],_0x22e2df[_0x9d1c('0x18')]?_0x22e2df[_0x9d1c('0x18')]['id']:0x0,_0x22e2df['interaction']?_0x22e2df['interaction']['id']:0x0);if(_0x55428d['rules'][_0x5835d6]){_0x55428d['rules'][_0x5835d6]['emit']('end');}return _0x16ad77({'code':0xc8,'message':_0x22e2df});}catch(_0x232d45){logger[_0x9d1c('0x35')](_0x232d45[_0x9d1c('0x47')]);return _0x59d8ac(_0x324d4d[_0x9d1c('0x35')](0x1f4,_0x232d45));}}logger[_0x9d1c('0x35')](_0x9d1c('0x48'));return _0x59d8ac(_0x324d4d[_0x9d1c('0x35')](0x1f4,_0x9d1c('0x48')));});},'AgentCapacity':function(_0x48982e){var _0x3a5ed4=this;return new Promise(function(_0x4ec8da,_0x49089d){if(_0x55428d[_0x9d1c('0x3f')][_0x9d1c('0x49')](_0x48982e['id'])){for(var _0xd08b76 in _0x48982e['capacity']){if(_0x48982e[_0x9d1c('0x4a')]['hasOwnProperty'](_0xd08b76)){if(_0x55428d['agents'][_0x48982e['id']][_0x9d1c('0x49')](_0xd08b76+_0x9d1c('0x4b'))){_0x55428d[_0x9d1c('0x3f')][_0x48982e['id']][_0xd08b76+_0x9d1c('0x4b')]=parseInt(_0x48982e[_0x9d1c('0x4a')][_0xd08b76],0xa);}}}_0x55428d[_0x9d1c('0x3f')][_0x48982e['id']][_0x9d1c('0x4c')]();return _0x4ec8da({'code':0xc8,'message':_0x55428d[_0x9d1c('0x3f')][_0x48982e['id']]});}else{return _0x49089d(_0x3a5ed4['error'](0x1f4,_0x9d1c('0x4d')));}});},'Agents':function(_0x36a329){return new Promise(function(_0x27ce55,_0x34a2fd){var _0x3800bf=_[_0x9d1c('0x4e')](_0x55428d['agents']);_0x27ce55({'count':_0x3800bf[_0x9d1c('0x1c')],'rows':_0x3800bf});});},'ChatQueues':function(_0x315635){return new Promise(function(_0x510e20,_0x29b0d9){var _0x5a4730=[];for(var _0x4dd614 in _0x55428d['chatQueues']){if(_0x55428d['chatQueues'][_0x9d1c('0x49')](_0x4dd614)){var _0x13f9f4=_0x55428d[_0x9d1c('0x4f')][_0x4dd614];var _0x4f410d={'id':_0x13f9f4['id'],'available':_0x13f9f4[_0x9d1c('0x50')],'loggedIn':_0x13f9f4['loggedIn'],'name':_0x13f9f4[_0x9d1c('0x51')],'paused':_0x13f9f4[_0x9d1c('0x52')],'waiting':_0x13f9f4[_0x9d1c('0x53')]};_0x5a4730[_0x9d1c('0x25')](_0x4f410d);}}_0x510e20({'count':_0x5a4730['length'],'rows':_0x5a4730});});},'MailQueues':function(_0x530df4){return new Promise(function(_0x15bc5a,_0x2dabba){var _0x40daf0=[];for(var _0x3a6772 in _0x55428d[_0x9d1c('0x54')]){if(_0x55428d[_0x9d1c('0x54')][_0x9d1c('0x49')](_0x3a6772)){var _0x18bdab=_0x55428d[_0x9d1c('0x54')][_0x3a6772];var _0x2f57d0={'id':_0x18bdab['id'],'available':_0x18bdab[_0x9d1c('0x50')],'loggedIn':_0x18bdab['loggedIn'],'name':_0x18bdab['name'],'paused':_0x18bdab[_0x9d1c('0x52')],'waiting':_0x18bdab[_0x9d1c('0x53')]};_0x40daf0['push'](_0x2f57d0);}}_0x15bc5a({'count':_0x40daf0[_0x9d1c('0x1c')],'rows':_0x40daf0});});},'OpenchannelQueues':function(_0x3e08e6){return new Promise(function(_0x432c45,_0x5b7eb1){var _0x305580=[];for(var _0x5b71a7 in _0x55428d['openchannelQueues']){if(_0x55428d[_0x9d1c('0x55')][_0x9d1c('0x49')](_0x5b71a7)){var _0x446583=_0x55428d[_0x9d1c('0x55')][_0x5b71a7];var _0xab2eeb={'id':_0x446583['id'],'available':_0x446583['available'],'loggedIn':_0x446583[_0x9d1c('0x56')],'name':_0x446583[_0x9d1c('0x51')],'paused':_0x446583[_0x9d1c('0x52')],'waiting':_0x446583[_0x9d1c('0x53')]};_0x305580[_0x9d1c('0x25')](_0xab2eeb);}}_0x432c45({'count':_0x305580[_0x9d1c('0x1c')],'rows':_0x305580});});},'SmsQueues':function(_0x26a655){return new Promise(function(_0x116802,_0x2d2d94){var _0x2fdaf1=[];for(var _0xa840ea in _0x55428d[_0x9d1c('0x57')]){if(_0x55428d[_0x9d1c('0x57')][_0x9d1c('0x49')](_0xa840ea)){var _0x3574f7=_0x55428d[_0x9d1c('0x57')][_0xa840ea];var _0x379191={'id':_0x3574f7['id'],'available':_0x3574f7[_0x9d1c('0x50')],'loggedIn':_0x3574f7[_0x9d1c('0x56')],'name':_0x3574f7[_0x9d1c('0x51')],'paused':_0x3574f7[_0x9d1c('0x52')],'waiting':_0x3574f7[_0x9d1c('0x53')]};_0x2fdaf1[_0x9d1c('0x25')](_0x379191);}}_0x116802({'count':_0x2fdaf1[_0x9d1c('0x1c')],'rows':_0x2fdaf1});});},'FaxQueues':function(_0x51394d){return new Promise(function(_0x342dcb,_0x134bfc){var _0x36f16c=[];for(var _0x1e710c in _0x55428d[_0x9d1c('0x58')]){if(_0x55428d[_0x9d1c('0x58')][_0x9d1c('0x49')](_0x1e710c)){var _0x3a1ec4=_0x55428d['faxQueues'][_0x1e710c];var _0x59560e={'id':_0x3a1ec4['id'],'available':_0x3a1ec4[_0x9d1c('0x50')],'loggedIn':_0x3a1ec4['loggedIn'],'name':_0x3a1ec4[_0x9d1c('0x51')],'paused':_0x3a1ec4[_0x9d1c('0x52')],'waiting':_0x3a1ec4['waiting']};_0x36f16c[_0x9d1c('0x25')](_0x59560e);}}_0x342dcb({'count':_0x36f16c['length'],'rows':_0x36f16c});});},'WhatsappQueues':function(_0x5d3689){return new Promise(function(_0x3a2d16,_0x1646c8){var _0xf39767=[];for(var _0x2e7a17 in _0x55428d['whatsappQueues']){if(_0x55428d[_0x9d1c('0x59')][_0x9d1c('0x49')](_0x2e7a17)){var _0x18ae81=_0x55428d[_0x9d1c('0x59')][_0x2e7a17];var _0x16bb5e={'id':_0x18ae81['id'],'available':_0x18ae81[_0x9d1c('0x50')],'loggedIn':_0x18ae81[_0x9d1c('0x56')],'name':_0x18ae81[_0x9d1c('0x51')],'paused':_0x18ae81['paused'],'waiting':_0x18ae81[_0x9d1c('0x53')]};_0xf39767[_0x9d1c('0x25')](_0x16bb5e);}}_0x3a2d16({'count':_0xf39767[_0x9d1c('0x1c')],'rows':_0xf39767});});},'ChatQueuesWaitingInteractions':function(_0xa1c570){return new Promise(function(_0x9fbb48,_0xff4dc4){var _0x3179c8=_['values'](_0x55428d[_0x9d1c('0x5a')]);_0x9fbb48({'count':_0x3179c8[_0x9d1c('0x1c')],'rows':_0x3179c8});});},'MailQueuesWaitingInteractions':function(_0x166752){return new Promise(function(_0x3bc782,_0x5f4161){var _0x241ed3=_['values'](_0x55428d[_0x9d1c('0x5b')]);_0x3bc782({'count':_0x241ed3[_0x9d1c('0x1c')],'rows':_0x241ed3});});},'OpenchannelQueuesWaitingInteractions':function(_0x5c8c91){return new Promise(function(_0x5ba912,_0x4b527d){var _0x3fc60d=_[_0x9d1c('0x4e')](_0x55428d[_0x9d1c('0x5c')]);_0x5ba912({'count':_0x3fc60d[_0x9d1c('0x1c')],'rows':_0x3fc60d});});},'SmsQueuesWaitingInteractions':function(_0x4546a7){return new Promise(function(_0x223171,_0x5148cb){var _0x237606=_['values'](_0x55428d[_0x9d1c('0x5d')]);_0x223171({'count':_0x237606['length'],'rows':_0x237606});});},'FaxQueuesWaitingInteractions':function(_0x5cbd73){return new Promise(function(_0x40f76e,_0x560b71){var _0xac1f96=_['values'](_0x55428d['faxQueuesWaitingInteractions']);_0x40f76e({'count':_0xac1f96['length'],'rows':_0xac1f96});});},'WhatsappQueuesWaitingInteractions':function(_0x2d8c95){return new Promise(function(_0x1fa0f2,_0x3578ed){var _0xc6c7aa=_['values'](_0x55428d[_0x9d1c('0x5e')]);_0x1fa0f2({'count':_0xc6c7aa[_0x9d1c('0x1c')],'rows':_0xc6c7aa});});}};var _0x5420c0=jayson[_0x9d1c('0x5f')](_0x4eba82)[_0x9d1c('0x60')]();_0x5420c0['on'](_0x9d1c('0x35'),function(_0x54b061){logger[_0x9d1c('0x35')](JSON[_0x9d1c('0x61')](_0x54b061));return _0x348b30(_0x54b061);});_0x5420c0['listen'](0x232c,_0x9d1c('0x62'),function(){console[_0x9d1c('0x63')](_0x9d1c('0x64'),0x232c);return _0x407aa9(_0x9d1c('0x65')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 49da330..83154bf 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 _0x7a99=['result','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','Command','format','iftime\x20%s','indexOf','true','catch','all','some','join','\x20|\x20','[%s][INTERVAL]\x20%s\x20%s','stack','util','bluebird','../../../config/logger','http','request','then','error','message'];(function(_0x21fab4,_0x3659f8){var _0x18d7aa=function(_0x4efdbc){while(--_0x4efdbc){_0x21fab4['push'](_0x21fab4['shift']());}};_0x18d7aa(++_0x3659f8);}(_0x7a99,0x84));var _0x97a9=function(_0x14d3f8,_0x141863){_0x14d3f8=_0x14d3f8-0x0;var _0x109397=_0x7a99[_0x14d3f8];return _0x109397;};'use strict';var util=require(_0x97a9('0x0'));var BPromise=require(_0x97a9('0x1'));var jayson=require('jayson/promise');var _=require('lodash');var logger=require(_0x97a9('0x2'))('routing');var client=jayson['client'][_0x97a9('0x3')]({'port':0x232a});function request(_0xa7bdcf,_0x5cc954){return new BPromise(function(_0x4ded73,_0x4ae491){return client[_0x97a9('0x4')](_0xa7bdcf,_0x5cc954)[_0x97a9('0x5')](function(_0x5b2a68){if(_0x5b2a68[_0x97a9('0x6')]){return _0x4ae491(_0x5b2a68[_0x97a9('0x6')][_0x97a9('0x7')]);}else{return _0x4ded73(_0x5b2a68[_0x97a9('0x8')]);}})['catch'](function(_0x1d80a7){return _0x4ae491(_0x1d80a7);});});}exports[_0x97a9('0x9')]=function(_0x7596ef,_0x27f13f,_0x59639e){return function(_0x174a61){if(_0x59639e[_0x97a9('0xa')]&&!_0x59639e[_0x97a9('0xa')][_0x7596ef]){logger[_0x97a9('0xb')](_0x97a9('0xc'),_0x7596ef);return _0x174a61[_0x97a9('0xd')]();}var _0x11a8c5=[];for(var _0x383aff=0x0;_0x383aff<_0x27f13f[_0x97a9('0xe')];_0x383aff+=0x1){_0x11a8c5[_0x97a9('0xf')](request(_0x97a9('0x10'),{'command':util[_0x97a9('0x11')](_0x97a9('0x12'),_0x27f13f[_0x383aff])})[_0x97a9('0x5')](function(_0x24eb27){return _0x24eb27&&_0x24eb27[_0x97a9('0x7')]&&_0x24eb27['message'][_0x97a9('0x13')](_0x97a9('0x14'))>=0x0?!![]:![];})[_0x97a9('0x15')](function(_0x5b3567){logger[_0x97a9('0x6')]('[%s][INTERVAL]\x20%s',_0x7596ef,_0x27f13f[_0x383aff]);}));}BPromise[_0x97a9('0x16')](_0x11a8c5)[_0x97a9('0x5')](function(_0x8c6f63){var _0x479172=_[_0x97a9('0x17')](_0x8c6f63);logger[_0x97a9('0xb')]('[%s][INTERVAL]\x20%s\x20%s',_0x7596ef,_0x27f13f[_0x97a9('0x18')](_0x97a9('0x19')),_0x479172);_0x174a61['when'](_0x479172);})[_0x97a9('0x15')](function(_0x44c76e){console['log'](_0x44c76e);logger[_0x97a9('0x6')](_0x97a9('0x1a'),_0x7596ef,_0x27f13f[_0x97a9('0x18')](_0x97a9('0x19')),_0x44c76e[_0x97a9('0x1b')]);_0x174a61[_0x97a9('0xd')]();});};}; \ No newline at end of file +var _0x0b78=['rules','info','length','push','Command','format','iftime\x20%s','message','indexOf','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','log','stack','stop','util','jayson/promise','lodash','../../../config/logger','routing','client','http','request','then','error','result','catch','condition'];(function(_0x52e64,_0x6ba4e8){var _0x282b80=function(_0xc11939){while(--_0xc11939){_0x52e64['push'](_0x52e64['shift']());}};_0x282b80(++_0x6ba4e8);}(_0x0b78,0x73));var _0x80b7=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0b78[_0x321bb2];return _0x9c12ed;};'use strict';var util=require(_0x80b7('0x0'));var BPromise=require('bluebird');var jayson=require(_0x80b7('0x1'));var _=require(_0x80b7('0x2'));var logger=require(_0x80b7('0x3'))(_0x80b7('0x4'));var client=jayson[_0x80b7('0x5')][_0x80b7('0x6')]({'port':0x232a});function request(_0x3b7a90,_0x3f5343){return new BPromise(function(_0x288a22,_0xf63e0f){return client[_0x80b7('0x7')](_0x3b7a90,_0x3f5343)[_0x80b7('0x8')](function(_0x3d44a3){if(_0x3d44a3[_0x80b7('0x9')]){return _0xf63e0f(_0x3d44a3[_0x80b7('0x9')]['message']);}else{return _0x288a22(_0x3d44a3[_0x80b7('0xa')]);}})[_0x80b7('0xb')](function(_0x4df368){return _0xf63e0f(_0x4df368);});});}exports[_0x80b7('0xc')]=function(_0x1c0986,_0xcdd58e,_0x3433d8){return function(_0x206951){if(_0x3433d8['rules']&&!_0x3433d8[_0x80b7('0xd')][_0x1c0986]){logger[_0x80b7('0xe')]('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x1c0986);return _0x206951['stop']();}var _0x44355d=[];for(var _0x45d3e9=0x0;_0x45d3e9<_0xcdd58e[_0x80b7('0xf')];_0x45d3e9+=0x1){_0x44355d[_0x80b7('0x10')](request(_0x80b7('0x11'),{'command':util[_0x80b7('0x12')](_0x80b7('0x13'),_0xcdd58e[_0x45d3e9])})['then'](function(_0x4ae2fa){return _0x4ae2fa&&_0x4ae2fa[_0x80b7('0x14')]&&_0x4ae2fa['message'][_0x80b7('0x15')]('true')>=0x0?!![]:![];})['catch'](function(_0x2e5b03){logger[_0x80b7('0x9')](_0x80b7('0x16'),_0x1c0986,_0xcdd58e[_0x45d3e9]);}));}BPromise[_0x80b7('0x17')](_0x44355d)[_0x80b7('0x8')](function(_0x518c02){var _0x5dcff9=_[_0x80b7('0x18')](_0x518c02);logger[_0x80b7('0xe')](_0x80b7('0x19'),_0x1c0986,_0xcdd58e[_0x80b7('0x1a')](_0x80b7('0x1b')),_0x5dcff9);_0x206951[_0x80b7('0x1c')](_0x5dcff9);})[_0x80b7('0xb')](function(_0x2cf07f){console[_0x80b7('0x1d')](_0x2cf07f);logger['error'](_0x80b7('0x19'),_0x1c0986,_0xcdd58e['join'](_0x80b7('0x1b')),_0x2cf07f[_0x80b7('0x1e')]);_0x206951[_0x80b7('0x1f')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index d745612..ed4399a 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 _0x5c00=['queuecallerabandon','forIn','includes','agentringnoanswer','now','abandoned','[%s][agents][queuecallerabandon]','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','agentringnoanswerAt','answered_elsewhere','answeredelsewheremembername','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diffTime','agentcompleteAt','complete','[%s][agents][agentcomplete]','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','blind','transferexten','extension','transferuniqueid','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','transfer','transfertype','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererexten','transfertargetuniqueid','hangup','[%s][agents][hangup]','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','agent','lodash','util','./utils','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','membername','interface','calleridnum','connectedlinenum','queue','getVoiceQueueByName','type','agentacw','agentcomplete','acw','acwTimeout','CreateVoiceAgentReport','request','destuniqueid','debug','[%s][agents][agentcalled]','agentcalledAt','lastevent','called','connectedlinename','info','error','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','timeout','reason','holdtime','ringtime','talktime','push'];(function(_0x4ca922,_0x11f8d6){var _0x3feb75=function(_0x4e8db2){while(--_0x4e8db2){_0x4ca922['push'](_0x4ca922['shift']());}};_0x3feb75(++_0x11f8d6);}(_0x5c00,0x17e));var _0x05c0=function(_0x39b51c,_0x40010d){_0x39b51c=_0x39b51c-0x0;var _0x146312=_0x5c00[_0x39b51c];return _0x146312;};'use strict';var _=require(_0x05c0('0x0'));var util=require(_0x05c0('0x1'));var utils=require(_0x05c0('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x4e54ec,_0x1e76da){utils['info'](util[_0x05c0('0x3')](_0x05c0('0x4'),_0x4e54ec[_0x05c0('0x5')],_0x4e54ec[_0x05c0('0x6')],_0x4e54ec['queue'],_0x4e54ec[_0x05c0('0x7')],_0x4e54ec[_0x05c0('0x8')],_0x4e54ec[_0x05c0('0x9')],_0x4e54ec[_0x05c0('0xa')],_0x4e54ec['lastevent']));if(_0x4e54ec[_0x05c0('0xb')]){utils[_0x05c0('0xc')](_0x4e54ec[_0x05c0('0xb')])['then'](function(_0x32a795){if(_0x32a795){_0x4e54ec[_0x05c0('0xd')]=_0x32a795[_0x05c0('0xd')];_0x4e54ec[_0x05c0('0xe')]=_0x4e54ec[_0x05c0('0xf')]?_0x32a795[_0x05c0('0x10')]:![];_0x4e54ec['acwtime']=_0x4e54ec['agentacw']?_0x32a795[_0x05c0('0x11')]:0x0;}utils['request'](_0x05c0('0x12'),_0x4e54ec);});}else{utils[_0x05c0('0x13')](_0x05c0('0x12'),_0x4e54ec);}if(_0x1e76da){delete transfers[_0x4e54ec['uniqueid']];}else{delete agents[_0x4e54ec[_0x05c0('0x14')]];}}exports['agentcalled']=function(_0x16a290){try{utils[_0x05c0('0x15')](util[_0x05c0('0x3')](_0x05c0('0x16'),_0x16a290[_0x05c0('0x5')]),_0x16a290);agents[_0x16a290[_0x05c0('0x14')]]=_0x16a290;agents[_0x16a290[_0x05c0('0x14')]][_0x05c0('0x17')]=utils['now']();agents[_0x16a290[_0x05c0('0x14')]][_0x05c0('0x18')]=_0x05c0('0x19');agents[_0x16a290[_0x05c0('0x14')]][_0x05c0('0xa')]=null;agents[_0x16a290[_0x05c0('0x14')]][_0x05c0('0x1a')]=null;utils[_0x05c0('0x1b')](util[_0x05c0('0x3')]('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x16a290[_0x05c0('0x5')],agents[_0x16a290[_0x05c0('0x14')]][_0x05c0('0x7')],_0x16a290['destuniqueid']));}catch(_0x40d905){utils[_0x05c0('0x1c')](util[_0x05c0('0x3')](_0x05c0('0x16'),_0x16a290[_0x05c0('0x5')]),_0x40d905);}};exports['agentringnoanswer']=function(_0x407c1f){try{if(!_[_0x05c0('0x1d')](agents[_0x407c1f['destuniqueid']])){utils['debug'](util['format'](_0x05c0('0x1e'),_0x407c1f[_0x05c0('0x5')]),_0x407c1f);utils[_0x05c0('0x1b')](util[_0x05c0('0x3')](_0x05c0('0x1f'),_0x407c1f[_0x05c0('0x5')],agents[_0x407c1f[_0x05c0('0x14')]]['membername'],_0x407c1f[_0x05c0('0x14')]));agents[_0x407c1f[_0x05c0('0x14')]]['agentringnoanswer']=!![];agents[_0x407c1f['destuniqueid']]['agentringnoanswerAt']=utils['now']();agents[_0x407c1f['destuniqueid']][_0x05c0('0x18')]=_0x05c0('0x20');agents[_0x407c1f['destuniqueid']][_0x05c0('0x21')]=_0x05c0('0x20');agents[_0x407c1f[_0x05c0('0x14')]][_0x05c0('0x22')]=_0x407c1f['ringtime']?parseInt(_0x407c1f[_0x05c0('0x23')])/0x3e8:0x0;agents[_0x407c1f[_0x05c0('0x14')]][_0x05c0('0x24')]=0x0;unanswered[_0x05c0('0x25')](_0x407c1f[_0x05c0('0x14')]);}}catch(_0x5d12e0){utils['error'](util['format'](_0x05c0('0x1e'),_0x407c1f[_0x05c0('0x5')]),_0x5d12e0);}};exports[_0x05c0('0x26')]=function(_0xd6574e){try{_[_0x05c0('0x27')](agents,function(_0x1e00c5,_0x1c4c8f){if(_0x1e00c5[_0x05c0('0x5')]==_0xd6574e[_0x05c0('0x5')]&&!_[_0x05c0('0x28')](unanswered,_0x1e00c5[_0x05c0('0x14')])){utils[_0x05c0('0x15')](util['format']('[%s][agents][queuecallerabandon]',_0xd6574e[_0x05c0('0x5')]),_0xd6574e);utils[_0x05c0('0x1b')](util[_0x05c0('0x3')]('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0xd6574e[_0x05c0('0x5')],_0x1e00c5[_0x05c0('0x7')],_0x1e00c5['destuniqueid']));_0x1e00c5[_0x05c0('0x29')]=!![];_0x1e00c5['agentringnoanswerAt']=utils[_0x05c0('0x2a')]();_0x1e00c5[_0x05c0('0x18')]=_0x05c0('0x2b');_0x1e00c5[_0x05c0('0x21')]=_0x05c0('0x2b');_0x1e00c5[_0x05c0('0x22')]=_0xd6574e[_0x05c0('0x22')];_0x1e00c5[_0x05c0('0x24')]=0x0;writeDB(_0x1e00c5);}});}catch(_0x3d8d76){utils[_0x05c0('0x1c')](util[_0x05c0('0x3')](_0x05c0('0x2c'),_0xd6574e[_0x05c0('0x5')]),_0x3d8d76);}};exports[_0x05c0('0x2d')]=function(_0x185d05){try{if(agents[_0x185d05[_0x05c0('0x14')]]){utils[_0x05c0('0x15')](util[_0x05c0('0x3')](_0x05c0('0x2e'),_0x185d05[_0x05c0('0x5')]),_0x185d05);utils[_0x05c0('0x1b')](util[_0x05c0('0x3')](_0x05c0('0x2f'),_0x185d05[_0x05c0('0x5')],agents[_0x185d05[_0x05c0('0x14')]][_0x05c0('0x7')],_0x185d05[_0x05c0('0x14')]));agents[_0x185d05[_0x05c0('0x14')]][_0x05c0('0x30')]=utils[_0x05c0('0x2a')]();agents[_0x185d05[_0x05c0('0x14')]][_0x05c0('0xa')]=_0x185d05[_0x05c0('0xa')];agents[_0x185d05['destuniqueid']][_0x05c0('0x1a')]=_0x185d05[_0x05c0('0x1a')];agents[_0x185d05[_0x05c0('0x14')]][_0x05c0('0x22')]=_0x185d05['ringtime'];agents[_0x185d05['destuniqueid']][_0x05c0('0x18')]=_0x05c0('0x31');_[_0x05c0('0x27')](agents,function(_0x4ced8e,_0x29dc87){if(_0x4ced8e[_0x05c0('0x14')]!=_0x185d05[_0x05c0('0x14')]&&_0x4ced8e[_0x05c0('0x5')]==_0x185d05['uniqueid']){_0x4ced8e[_0x05c0('0x24')]=0x0;_0x4ced8e[_0x05c0('0x22')]=_0x185d05['ringtime'];_0x4ced8e[_0x05c0('0x29')]=!![];_0x4ced8e[_0x05c0('0x32')]=utils[_0x05c0('0x2a')]();_0x4ced8e[_0x05c0('0x18')]=_0x05c0('0x33');_0x4ced8e[_0x05c0('0x21')]=_0x05c0('0x33');_0x4ced8e['answeredelsewheredestinationuniqueid']=_0x185d05['destuniqueid'];_0x4ced8e[_0x05c0('0x34')]=_0x185d05[_0x05c0('0x7')];writeDB(_0x4ced8e);}});}}catch(_0xaa5d53){utils[_0x05c0('0x1c')](util[_0x05c0('0x3')]('[%s][agents][agentconnect]',_0x185d05[_0x05c0('0x5')]),_0xaa5d53);}};exports[_0x05c0('0xf')]=function(_0x2fdfe8){try{if(!_[_0x05c0('0x1d')](agents[_0x2fdfe8[_0x05c0('0x14')]])){utils[_0x05c0('0x15')](util[_0x05c0('0x3')]('[%s][agents][agentcomplete]',_0x2fdfe8[_0x05c0('0x5')]),_0x2fdfe8);utils[_0x05c0('0x1b')](util[_0x05c0('0x3')](_0x05c0('0x35'),_0x2fdfe8[_0x05c0('0x5')],agents[_0x2fdfe8[_0x05c0('0x14')]][_0x05c0('0x7')],_0x2fdfe8[_0x05c0('0x14')]));agents[_0x2fdfe8[_0x05c0('0x14')]][_0x05c0('0xf')]=!![];agents[_0x2fdfe8[_0x05c0('0x14')]]['agentcompleteAt']=utils['now']();agents[_0x2fdfe8[_0x05c0('0x14')]][_0x05c0('0x24')]=utils[_0x05c0('0x36')](agents[_0x2fdfe8[_0x05c0('0x14')]][_0x05c0('0x37')],agents[_0x2fdfe8[_0x05c0('0x14')]]['agentconnectAt']);agents[_0x2fdfe8[_0x05c0('0x14')]][_0x05c0('0x21')]=_0x2fdfe8[_0x05c0('0x21')];agents[_0x2fdfe8[_0x05c0('0x14')]]['lastevent']=_0x05c0('0x38');writeDB(agents[_0x2fdfe8[_0x05c0('0x14')]]);}}catch(_0x3ec0bf){utils[_0x05c0('0x1c')](util['format'](_0x05c0('0x39'),_0x2fdfe8[_0x05c0('0x5')]),_0x3ec0bf);}};exports[_0x05c0('0x3a')]=function(_0x9b521b){try{if(!_['isNil'](agents[_0x9b521b[_0x05c0('0x3b')]])){utils[_0x05c0('0x15')](util['format'](_0x05c0('0x3c'),_0x9b521b['uniqueid']),_0x9b521b);utils['info'](util[_0x05c0('0x3')]('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x9b521b[_0x05c0('0x5')],agents[_0x9b521b[_0x05c0('0x3b')]][_0x05c0('0x7')],agents[_0x9b521b[_0x05c0('0x3b')]][_0x05c0('0x5')]));agents[_0x9b521b[_0x05c0('0x3b')]]['transfer']=!![];agents[_0x9b521b[_0x05c0('0x3b')]]['transfertype']=_0x05c0('0x3d');agents[_0x9b521b[_0x05c0('0x3b')]][_0x05c0('0x3e')]=_0x9b521b[_0x05c0('0x3f')];agents[_0x9b521b[_0x05c0('0x3b')]][_0x05c0('0x40')]=agents[_0x9b521b[_0x05c0('0x3b')]]['uniqueid'];}}catch(_0x5215b4){utils['error'](util[_0x05c0('0x3')](_0x05c0('0x3c'),_0x9b521b['uniqueid']),_0x5215b4);}};exports['attendedtransfer']=function(_0xbfb9cb){try{utils[_0x05c0('0x15')](util[_0x05c0('0x3')](_0x05c0('0x41'),_0xbfb9cb[_0x05c0('0x42')]),_0xbfb9cb);if(_0xbfb9cb[_0x05c0('0x42')]==_0xbfb9cb[_0x05c0('0x43')]){if(!_['isNil'](agents[_0xbfb9cb[_0x05c0('0x44')]])){utils[_0x05c0('0x1b')](util[_0x05c0('0x3')](_0x05c0('0x45'),_0xbfb9cb['origtransfereruniqueid'],agents[_0xbfb9cb[_0x05c0('0x44')]]['membername']));agents[_0xbfb9cb[_0x05c0('0x44')]][_0x05c0('0x46')]=!![];agents[_0xbfb9cb['secondtransfereruniqueid']][_0x05c0('0x47')]='ATTENDED';agents[_0xbfb9cb[_0x05c0('0x44')]][_0x05c0('0x3e')]=_0xbfb9cb[_0x05c0('0x48')];agents[_0xbfb9cb[_0x05c0('0x44')]][_0x05c0('0x40')]=_0xbfb9cb[_0x05c0('0x42')];}if(_0xbfb9cb['transfereeuniqueid']&&agents[_0xbfb9cb[_0x05c0('0x49')]]){agents[_0xbfb9cb[_0x05c0('0x49')]][_0x05c0('0x4a')]=0x1;transfers[_0xbfb9cb[_0x05c0('0x49')]]=_[_0x05c0('0x4b')](agents[_0xbfb9cb[_0x05c0('0x49')]]);transfers[_0xbfb9cb['transfereeuniqueid']][_0x05c0('0x9')]=agents[_0xbfb9cb[_0x05c0('0x44')]][_0x05c0('0x9')];transfers[_0xbfb9cb[_0x05c0('0x49')]][_0x05c0('0x4c')]=agents[_0xbfb9cb[_0x05c0('0x44')]][_0x05c0('0x4c')];transfers[_0xbfb9cb[_0x05c0('0x49')]][_0x05c0('0x17')]=utils[_0x05c0('0x2a')]();transfers[_0xbfb9cb[_0x05c0('0x49')]][_0x05c0('0x30')]=utils['now']();transfers[_0xbfb9cb['transfereeuniqueid']]['holdtime']=0x0;transfers[_0xbfb9cb[_0x05c0('0x49')]][_0x05c0('0x4a')]=0x2;}}else if(_0xbfb9cb[_0x05c0('0x44')]==_0xbfb9cb['secondtransfererlinkedid']){if(!_[_0x05c0('0x1d')](agents[_0xbfb9cb[_0x05c0('0x42')]])){utils[_0x05c0('0x1b')](util[_0x05c0('0x3')](_0x05c0('0x45'),_0xbfb9cb[_0x05c0('0x42')],agents[_0xbfb9cb[_0x05c0('0x42')]]['membername']));agents[_0xbfb9cb[_0x05c0('0x42')]][_0x05c0('0x46')]=!![];agents[_0xbfb9cb[_0x05c0('0x42')]][_0x05c0('0x47')]='ATTENDED';agents[_0xbfb9cb['origtransfereruniqueid']]['transferexten']=_0xbfb9cb[_0x05c0('0x4d')];agents[_0xbfb9cb[_0x05c0('0x42')]][_0x05c0('0x40')]=_0xbfb9cb[_0x05c0('0x44')];}if(_0xbfb9cb[_0x05c0('0x4e')]&&agents[_0xbfb9cb[_0x05c0('0x4e')]]){agents[_0xbfb9cb[_0x05c0('0x4e')]]['agententerreason']=0x1;transfers[_0xbfb9cb[_0x05c0('0x4e')]]=_[_0x05c0('0x4b')](agents[_0xbfb9cb[_0x05c0('0x4e')]]);transfers[_0xbfb9cb[_0x05c0('0x4e')]][_0x05c0('0x9')]=agents[_0xbfb9cb['origtransfereruniqueid']]['calleridnum'];transfers[_0xbfb9cb[_0x05c0('0x4e')]][_0x05c0('0x4c')]=agents[_0xbfb9cb['origtransfereruniqueid']][_0x05c0('0x4c')];transfers[_0xbfb9cb['transfertargetuniqueid']]['agentcalledAt']=utils[_0x05c0('0x2a')]();transfers[_0xbfb9cb[_0x05c0('0x4e')]][_0x05c0('0x30')]=utils['now']();transfers[_0xbfb9cb['transfertargetuniqueid']][_0x05c0('0x22')]=0x0;transfers[_0xbfb9cb[_0x05c0('0x4e')]][_0x05c0('0x4a')]=0x2;}}}catch(_0x5b39cb){utils['error'](util['format']('[%s][agents][attendedtransfer]',_0xbfb9cb['origtransfereruniqueid']),_0x5b39cb);}};exports[_0x05c0('0x4f')]=function(_0x4f43ae){try{utils['debug'](util['format'](_0x05c0('0x50'),_0x4f43ae[_0x05c0('0x5')]),_0x4f43ae);if(agents[_0x4f43ae[_0x05c0('0x5')]]&&agents[_0x4f43ae['uniqueid']][_0x05c0('0x21')]===_0x05c0('0x20')){if(_0x4f43ae['cause']==='21'){agents[_0x4f43ae[_0x05c0('0x5')]][_0x05c0('0x21')]=_0x05c0('0x51');agents[_0x4f43ae[_0x05c0('0x5')]]['lastevent']=_0x05c0('0x51');}utils[_0x05c0('0x1b')](util[_0x05c0('0x3')](_0x05c0('0x52'),_0x4f43ae[_0x05c0('0x5')],agents[_0x4f43ae['uniqueid']]['membername'],agents[_0x4f43ae[_0x05c0('0x5')]]['reason'],agents[_0x4f43ae[_0x05c0('0x5')]][_0x05c0('0x18')]));writeDB(agents[_0x4f43ae['uniqueid']]);var _0x3135bd=unanswered['indexOf'](_0x4f43ae['uniqueid']);if(_0x3135bd>-0x1){unanswered['splice'](_0x3135bd,0x1);}}if(transfers[_0x4f43ae['uniqueid']]){transfers[_0x4f43ae[_0x05c0('0x5')]][_0x05c0('0xf')]=!![];transfers[_0x4f43ae[_0x05c0('0x5')]][_0x05c0('0x37')]=utils['now']();transfers[_0x4f43ae[_0x05c0('0x5')]][_0x05c0('0x24')]=utils[_0x05c0('0x36')](transfers[_0x4f43ae[_0x05c0('0x5')]][_0x05c0('0x37')],transfers[_0x4f43ae['uniqueid']][_0x05c0('0x30')]);transfers[_0x4f43ae['uniqueid']]['reason']=_0x05c0('0x53');transfers[_0x4f43ae[_0x05c0('0x5')]][_0x05c0('0x18')]=_0x05c0('0x38');utils[_0x05c0('0x1b')](util[_0x05c0('0x3')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x4f43ae['uniqueid'],transfers[_0x4f43ae[_0x05c0('0x5')]][_0x05c0('0x7')],transfers[_0x4f43ae[_0x05c0('0x5')]]['reason'],transfers[_0x4f43ae[_0x05c0('0x5')]][_0x05c0('0x18')]));writeDB(transfers[_0x4f43ae[_0x05c0('0x5')]],!![]);}if(agents[_0x4f43ae[_0x05c0('0x5')]]&&agents[_0x4f43ae[_0x05c0('0x5')]][_0x05c0('0x30')]){agents[_0x4f43ae['uniqueid']][_0x05c0('0xf')]=!![];agents[_0x4f43ae[_0x05c0('0x5')]]['agentcompleteAt']=utils[_0x05c0('0x2a')]();agents[_0x4f43ae[_0x05c0('0x5')]]['talktime']=utils[_0x05c0('0x36')](agents[_0x4f43ae[_0x05c0('0x5')]][_0x05c0('0x37')],agents[_0x4f43ae[_0x05c0('0x5')]][_0x05c0('0x30')]);agents[_0x4f43ae[_0x05c0('0x5')]]['reason']=agents[_0x4f43ae[_0x05c0('0x5')]]['transfer']?_0x05c0('0x46'):_0x05c0('0x53');agents[_0x4f43ae[_0x05c0('0x5')]][_0x05c0('0x18')]=_0x05c0('0x38');utils[_0x05c0('0x1b')](util[_0x05c0('0x3')](_0x05c0('0x52'),_0x4f43ae[_0x05c0('0x5')],agents[_0x4f43ae[_0x05c0('0x5')]]['membername'],agents[_0x4f43ae[_0x05c0('0x5')]]['reason'],agents[_0x4f43ae[_0x05c0('0x5')]]['lastevent']));writeDB(agents[_0x4f43ae[_0x05c0('0x5')]]);}}catch(_0x36f82a){utils[_0x05c0('0x1c')](util[_0x05c0('0x3')](_0x05c0('0x50'),_0x4f43ae[_0x05c0('0x5')]),_0x36f82a);}}; \ No newline at end of file +var _0x6c76=['answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diffTime','agentcompleteAt','agentconnectAt','complete','[%s][agents][agentcomplete]','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfertype','transferexten','extension','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','transfer','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','calleridnum','calleridname','agentcalledAt','secondtransfererexten','transfertargetuniqueid','clone','hangup','[%s][agents][hangup]','cause','rejected','splice','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','agent','lodash','util','./utils','info','uniqueid','channel','membername','interface','connectedlinenum','getVoiceQueueByName','queue','then','type','agentacw','agentcomplete','acwtime','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalled','debug','format','[%s][agents][agentcalled]','now','lastevent','called','error','isNil','[%s][agents][agentringnoanswer]','agentringnoanswer','timeout','holdtime','ringtime','talktime','push','queuecallerabandon','forIn','[%s][agents][queuecallerabandon]','agentringnoanswerAt','abandoned','reason','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','connectedlinename','answered_elsewhere'];(function(_0x5dbbbc,_0x5f3b29){var _0x66461=function(_0x4030d2){while(--_0x4030d2){_0x5dbbbc['push'](_0x5dbbbc['shift']());}};_0x66461(++_0x5f3b29);}(_0x6c76,0x184));var _0x66c7=function(_0x20a137,_0x4d9549){_0x20a137=_0x20a137-0x0;var _0x3dc414=_0x6c76[_0x20a137];return _0x3dc414;};'use strict';var _=require(_0x66c7('0x0'));var util=require(_0x66c7('0x1'));var utils=require(_0x66c7('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x55604c,_0x203e75){utils[_0x66c7('0x3')](util['format']('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x55604c[_0x66c7('0x4')],_0x55604c[_0x66c7('0x5')],_0x55604c['queue'],_0x55604c[_0x66c7('0x6')],_0x55604c[_0x66c7('0x7')],_0x55604c['calleridnum'],_0x55604c[_0x66c7('0x8')],_0x55604c['lastevent']));if(_0x55604c['queue']){utils[_0x66c7('0x9')](_0x55604c[_0x66c7('0xa')])[_0x66c7('0xb')](function(_0x53a81c){if(_0x53a81c){_0x55604c[_0x66c7('0xc')]=_0x53a81c[_0x66c7('0xc')];_0x55604c[_0x66c7('0xd')]=_0x55604c[_0x66c7('0xe')]?_0x53a81c['acw']:![];_0x55604c[_0x66c7('0xf')]=_0x55604c[_0x66c7('0xd')]?_0x53a81c[_0x66c7('0x10')]:0x0;}utils[_0x66c7('0x11')](_0x66c7('0x12'),_0x55604c);});}else{utils[_0x66c7('0x11')](_0x66c7('0x12'),_0x55604c);}if(_0x203e75){delete transfers[_0x55604c['uniqueid']];}else{delete agents[_0x55604c[_0x66c7('0x13')]];}}exports[_0x66c7('0x14')]=function(_0x35cbc2){try{utils[_0x66c7('0x15')](util[_0x66c7('0x16')](_0x66c7('0x17'),_0x35cbc2[_0x66c7('0x4')]),_0x35cbc2);agents[_0x35cbc2[_0x66c7('0x13')]]=_0x35cbc2;agents[_0x35cbc2[_0x66c7('0x13')]]['agentcalledAt']=utils[_0x66c7('0x18')]();agents[_0x35cbc2['destuniqueid']][_0x66c7('0x19')]=_0x66c7('0x1a');agents[_0x35cbc2[_0x66c7('0x13')]][_0x66c7('0x8')]=null;agents[_0x35cbc2[_0x66c7('0x13')]]['connectedlinename']=null;utils['info'](util['format']('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x35cbc2[_0x66c7('0x4')],agents[_0x35cbc2[_0x66c7('0x13')]]['membername'],_0x35cbc2['destuniqueid']));}catch(_0x256b0a){utils[_0x66c7('0x1b')](util[_0x66c7('0x16')](_0x66c7('0x17'),_0x35cbc2['uniqueid']),_0x256b0a);}};exports['agentringnoanswer']=function(_0x1853b2){try{if(!_[_0x66c7('0x1c')](agents[_0x1853b2[_0x66c7('0x13')]])){utils[_0x66c7('0x15')](util[_0x66c7('0x16')](_0x66c7('0x1d'),_0x1853b2['uniqueid']),_0x1853b2);utils[_0x66c7('0x3')](util[_0x66c7('0x16')]('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0x1853b2[_0x66c7('0x4')],agents[_0x1853b2[_0x66c7('0x13')]][_0x66c7('0x6')],_0x1853b2[_0x66c7('0x13')]));agents[_0x1853b2['destuniqueid']][_0x66c7('0x1e')]=!![];agents[_0x1853b2[_0x66c7('0x13')]]['agentringnoanswerAt']=utils[_0x66c7('0x18')]();agents[_0x1853b2[_0x66c7('0x13')]][_0x66c7('0x19')]=_0x66c7('0x1f');agents[_0x1853b2[_0x66c7('0x13')]]['reason']='timeout';agents[_0x1853b2['destuniqueid']][_0x66c7('0x20')]=_0x1853b2[_0x66c7('0x21')]?parseInt(_0x1853b2['ringtime'])/0x3e8:0x0;agents[_0x1853b2[_0x66c7('0x13')]][_0x66c7('0x22')]=0x0;unanswered[_0x66c7('0x23')](_0x1853b2[_0x66c7('0x13')]);}}catch(_0x36a830){utils[_0x66c7('0x1b')](util['format'](_0x66c7('0x1d'),_0x1853b2[_0x66c7('0x4')]),_0x36a830);}};exports[_0x66c7('0x24')]=function(_0x33be23){try{_[_0x66c7('0x25')](agents,function(_0x592f0e,_0x263b48){if(_0x592f0e['uniqueid']==_0x33be23[_0x66c7('0x4')]&&!_['includes'](unanswered,_0x592f0e[_0x66c7('0x13')])){utils[_0x66c7('0x15')](util[_0x66c7('0x16')](_0x66c7('0x26'),_0x33be23[_0x66c7('0x4')]),_0x33be23);utils[_0x66c7('0x3')](util['format']('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x33be23[_0x66c7('0x4')],_0x592f0e[_0x66c7('0x6')],_0x592f0e[_0x66c7('0x13')]));_0x592f0e[_0x66c7('0x1e')]=!![];_0x592f0e[_0x66c7('0x27')]=utils[_0x66c7('0x18')]();_0x592f0e[_0x66c7('0x19')]=_0x66c7('0x28');_0x592f0e[_0x66c7('0x29')]=_0x66c7('0x28');_0x592f0e[_0x66c7('0x20')]=_0x33be23[_0x66c7('0x20')];_0x592f0e['talktime']=0x0;writeDB(_0x592f0e);}});}catch(_0x562283){utils[_0x66c7('0x1b')](util[_0x66c7('0x16')](_0x66c7('0x26'),_0x33be23[_0x66c7('0x4')]),_0x562283);}};exports[_0x66c7('0x2a')]=function(_0x2bf7c2){try{if(agents[_0x2bf7c2[_0x66c7('0x13')]]){utils['debug'](util[_0x66c7('0x16')](_0x66c7('0x2b'),_0x2bf7c2[_0x66c7('0x4')]),_0x2bf7c2);utils[_0x66c7('0x3')](util[_0x66c7('0x16')](_0x66c7('0x2c'),_0x2bf7c2[_0x66c7('0x4')],agents[_0x2bf7c2[_0x66c7('0x13')]][_0x66c7('0x6')],_0x2bf7c2[_0x66c7('0x13')]));agents[_0x2bf7c2[_0x66c7('0x13')]]['agentconnectAt']=utils['now']();agents[_0x2bf7c2[_0x66c7('0x13')]][_0x66c7('0x8')]=_0x2bf7c2[_0x66c7('0x8')];agents[_0x2bf7c2['destuniqueid']]['connectedlinename']=_0x2bf7c2[_0x66c7('0x2d')];agents[_0x2bf7c2[_0x66c7('0x13')]]['holdtime']=_0x2bf7c2[_0x66c7('0x21')];agents[_0x2bf7c2[_0x66c7('0x13')]][_0x66c7('0x19')]='connect';_[_0x66c7('0x25')](agents,function(_0x16b754,_0x9f6ca8){if(_0x16b754[_0x66c7('0x13')]!=_0x2bf7c2[_0x66c7('0x13')]&&_0x16b754[_0x66c7('0x4')]==_0x2bf7c2[_0x66c7('0x4')]){_0x16b754[_0x66c7('0x22')]=0x0;_0x16b754[_0x66c7('0x20')]=_0x2bf7c2['ringtime'];_0x16b754[_0x66c7('0x1e')]=!![];_0x16b754[_0x66c7('0x27')]=utils[_0x66c7('0x18')]();_0x16b754[_0x66c7('0x19')]=_0x66c7('0x2e');_0x16b754[_0x66c7('0x29')]=_0x66c7('0x2e');_0x16b754[_0x66c7('0x2f')]=_0x2bf7c2[_0x66c7('0x13')];_0x16b754[_0x66c7('0x30')]=_0x2bf7c2['membername'];writeDB(_0x16b754);}});}}catch(_0x5bb5fc){utils['error'](util[_0x66c7('0x16')](_0x66c7('0x2b'),_0x2bf7c2['uniqueid']),_0x5bb5fc);}};exports['agentcomplete']=function(_0x34d002){try{if(!_[_0x66c7('0x1c')](agents[_0x34d002[_0x66c7('0x13')]])){utils[_0x66c7('0x15')](util[_0x66c7('0x16')]('[%s][agents][agentcomplete]',_0x34d002[_0x66c7('0x4')]),_0x34d002);utils['info'](util['format'](_0x66c7('0x31'),_0x34d002[_0x66c7('0x4')],agents[_0x34d002[_0x66c7('0x13')]][_0x66c7('0x6')],_0x34d002['destuniqueid']));agents[_0x34d002['destuniqueid']][_0x66c7('0xe')]=!![];agents[_0x34d002['destuniqueid']]['agentcompleteAt']=utils[_0x66c7('0x18')]();agents[_0x34d002[_0x66c7('0x13')]][_0x66c7('0x22')]=utils[_0x66c7('0x32')](agents[_0x34d002['destuniqueid']][_0x66c7('0x33')],agents[_0x34d002[_0x66c7('0x13')]][_0x66c7('0x34')]);agents[_0x34d002['destuniqueid']][_0x66c7('0x29')]=_0x34d002[_0x66c7('0x29')];agents[_0x34d002[_0x66c7('0x13')]][_0x66c7('0x19')]=_0x66c7('0x35');writeDB(agents[_0x34d002[_0x66c7('0x13')]]);}}catch(_0x2e3f06){utils[_0x66c7('0x1b')](util['format'](_0x66c7('0x36'),_0x34d002[_0x66c7('0x4')]),_0x2e3f06);}};exports[_0x66c7('0x37')]=function(_0x1386a2){try{if(!_[_0x66c7('0x1c')](agents[_0x1386a2[_0x66c7('0x38')]])){utils[_0x66c7('0x15')](util[_0x66c7('0x16')](_0x66c7('0x39'),_0x1386a2[_0x66c7('0x4')]),_0x1386a2);utils[_0x66c7('0x3')](util[_0x66c7('0x16')](_0x66c7('0x3a'),_0x1386a2[_0x66c7('0x4')],agents[_0x1386a2['transfereruniqueid']][_0x66c7('0x6')],agents[_0x1386a2[_0x66c7('0x38')]][_0x66c7('0x4')]));agents[_0x1386a2[_0x66c7('0x38')]]['transfer']=!![];agents[_0x1386a2[_0x66c7('0x38')]][_0x66c7('0x3b')]='blind';agents[_0x1386a2[_0x66c7('0x38')]][_0x66c7('0x3c')]=_0x1386a2[_0x66c7('0x3d')];agents[_0x1386a2[_0x66c7('0x38')]][_0x66c7('0x3e')]=agents[_0x1386a2[_0x66c7('0x38')]][_0x66c7('0x4')];}}catch(_0x5cd4e9){utils[_0x66c7('0x1b')](util[_0x66c7('0x16')]('[%s][agents][blindtransfer]',_0x1386a2[_0x66c7('0x4')]),_0x5cd4e9);}};exports[_0x66c7('0x3f')]=function(_0x3ef4cf){try{utils['debug'](util[_0x66c7('0x16')](_0x66c7('0x40'),_0x3ef4cf[_0x66c7('0x41')]),_0x3ef4cf);if(_0x3ef4cf[_0x66c7('0x41')]==_0x3ef4cf[_0x66c7('0x42')]){if(!_[_0x66c7('0x1c')](agents[_0x3ef4cf[_0x66c7('0x43')]])){utils[_0x66c7('0x3')](util['format'](_0x66c7('0x44'),_0x3ef4cf[_0x66c7('0x41')],agents[_0x3ef4cf['secondtransfereruniqueid']][_0x66c7('0x6')]));agents[_0x3ef4cf[_0x66c7('0x43')]][_0x66c7('0x45')]=!![];agents[_0x3ef4cf['secondtransfereruniqueid']]['transfertype']=_0x66c7('0x46');agents[_0x3ef4cf['secondtransfereruniqueid']][_0x66c7('0x3c')]=_0x3ef4cf[_0x66c7('0x47')];agents[_0x3ef4cf[_0x66c7('0x43')]][_0x66c7('0x3e')]=_0x3ef4cf[_0x66c7('0x41')];}if(_0x3ef4cf[_0x66c7('0x48')]&&agents[_0x3ef4cf['transfereeuniqueid']]){agents[_0x3ef4cf['transfereeuniqueid']][_0x66c7('0x49')]=0x1;transfers[_0x3ef4cf[_0x66c7('0x48')]]=_['clone'](agents[_0x3ef4cf['transfereeuniqueid']]);transfers[_0x3ef4cf[_0x66c7('0x48')]]['calleridnum']=agents[_0x3ef4cf[_0x66c7('0x43')]][_0x66c7('0x4a')];transfers[_0x3ef4cf[_0x66c7('0x48')]][_0x66c7('0x4b')]=agents[_0x3ef4cf['secondtransfereruniqueid']][_0x66c7('0x4b')];transfers[_0x3ef4cf[_0x66c7('0x48')]][_0x66c7('0x4c')]=utils[_0x66c7('0x18')]();transfers[_0x3ef4cf[_0x66c7('0x48')]][_0x66c7('0x34')]=utils['now']();transfers[_0x3ef4cf[_0x66c7('0x48')]][_0x66c7('0x20')]=0x0;transfers[_0x3ef4cf[_0x66c7('0x48')]]['agententerreason']=0x2;}}else if(_0x3ef4cf[_0x66c7('0x43')]==_0x3ef4cf['secondtransfererlinkedid']){if(!_[_0x66c7('0x1c')](agents[_0x3ef4cf[_0x66c7('0x41')]])){utils[_0x66c7('0x3')](util[_0x66c7('0x16')](_0x66c7('0x44'),_0x3ef4cf[_0x66c7('0x41')],agents[_0x3ef4cf['origtransfereruniqueid']][_0x66c7('0x6')]));agents[_0x3ef4cf[_0x66c7('0x41')]][_0x66c7('0x45')]=!![];agents[_0x3ef4cf[_0x66c7('0x41')]][_0x66c7('0x3b')]='ATTENDED';agents[_0x3ef4cf[_0x66c7('0x41')]][_0x66c7('0x3c')]=_0x3ef4cf[_0x66c7('0x4d')];agents[_0x3ef4cf[_0x66c7('0x41')]][_0x66c7('0x3e')]=_0x3ef4cf[_0x66c7('0x43')];}if(_0x3ef4cf[_0x66c7('0x4e')]&&agents[_0x3ef4cf[_0x66c7('0x4e')]]){agents[_0x3ef4cf[_0x66c7('0x4e')]][_0x66c7('0x49')]=0x1;transfers[_0x3ef4cf[_0x66c7('0x4e')]]=_[_0x66c7('0x4f')](agents[_0x3ef4cf['transfertargetuniqueid']]);transfers[_0x3ef4cf[_0x66c7('0x4e')]][_0x66c7('0x4a')]=agents[_0x3ef4cf[_0x66c7('0x41')]][_0x66c7('0x4a')];transfers[_0x3ef4cf[_0x66c7('0x4e')]][_0x66c7('0x4b')]=agents[_0x3ef4cf[_0x66c7('0x41')]]['calleridname'];transfers[_0x3ef4cf[_0x66c7('0x4e')]][_0x66c7('0x4c')]=utils[_0x66c7('0x18')]();transfers[_0x3ef4cf[_0x66c7('0x4e')]][_0x66c7('0x34')]=utils[_0x66c7('0x18')]();transfers[_0x3ef4cf[_0x66c7('0x4e')]][_0x66c7('0x20')]=0x0;transfers[_0x3ef4cf[_0x66c7('0x4e')]][_0x66c7('0x49')]=0x2;}}}catch(_0x21eb0a){utils[_0x66c7('0x1b')](util[_0x66c7('0x16')](_0x66c7('0x40'),_0x3ef4cf[_0x66c7('0x41')]),_0x21eb0a);}};exports[_0x66c7('0x50')]=function(_0x5bca99){try{utils[_0x66c7('0x15')](util[_0x66c7('0x16')](_0x66c7('0x51'),_0x5bca99[_0x66c7('0x4')]),_0x5bca99);if(agents[_0x5bca99[_0x66c7('0x4')]]&&agents[_0x5bca99[_0x66c7('0x4')]][_0x66c7('0x29')]===_0x66c7('0x1f')){if(_0x5bca99[_0x66c7('0x52')]==='21'){agents[_0x5bca99[_0x66c7('0x4')]][_0x66c7('0x29')]=_0x66c7('0x53');agents[_0x5bca99[_0x66c7('0x4')]][_0x66c7('0x19')]=_0x66c7('0x53');}utils[_0x66c7('0x3')](util[_0x66c7('0x16')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x5bca99[_0x66c7('0x4')],agents[_0x5bca99[_0x66c7('0x4')]][_0x66c7('0x6')],agents[_0x5bca99[_0x66c7('0x4')]][_0x66c7('0x29')],agents[_0x5bca99[_0x66c7('0x4')]]['lastevent']));writeDB(agents[_0x5bca99['uniqueid']]);var _0x34d4f7=unanswered['indexOf'](_0x5bca99[_0x66c7('0x4')]);if(_0x34d4f7>-0x1){unanswered[_0x66c7('0x54')](_0x34d4f7,0x1);}}if(transfers[_0x5bca99[_0x66c7('0x4')]]){transfers[_0x5bca99[_0x66c7('0x4')]][_0x66c7('0xe')]=!![];transfers[_0x5bca99[_0x66c7('0x4')]][_0x66c7('0x33')]=utils[_0x66c7('0x18')]();transfers[_0x5bca99[_0x66c7('0x4')]][_0x66c7('0x22')]=utils[_0x66c7('0x32')](transfers[_0x5bca99[_0x66c7('0x4')]]['agentcompleteAt'],transfers[_0x5bca99[_0x66c7('0x4')]][_0x66c7('0x34')]);transfers[_0x5bca99[_0x66c7('0x4')]][_0x66c7('0x29')]='agent';transfers[_0x5bca99[_0x66c7('0x4')]][_0x66c7('0x19')]='complete';utils[_0x66c7('0x3')](util[_0x66c7('0x16')](_0x66c7('0x55'),_0x5bca99[_0x66c7('0x4')],transfers[_0x5bca99[_0x66c7('0x4')]][_0x66c7('0x6')],transfers[_0x5bca99['uniqueid']]['reason'],transfers[_0x5bca99[_0x66c7('0x4')]]['lastevent']));writeDB(transfers[_0x5bca99['uniqueid']],!![]);}if(agents[_0x5bca99[_0x66c7('0x4')]]&&agents[_0x5bca99[_0x66c7('0x4')]][_0x66c7('0x34')]){agents[_0x5bca99[_0x66c7('0x4')]][_0x66c7('0xe')]=!![];agents[_0x5bca99[_0x66c7('0x4')]][_0x66c7('0x33')]=utils[_0x66c7('0x18')]();agents[_0x5bca99['uniqueid']][_0x66c7('0x22')]=utils[_0x66c7('0x32')](agents[_0x5bca99[_0x66c7('0x4')]][_0x66c7('0x33')],agents[_0x5bca99[_0x66c7('0x4')]][_0x66c7('0x34')]);agents[_0x5bca99[_0x66c7('0x4')]][_0x66c7('0x29')]=agents[_0x5bca99[_0x66c7('0x4')]][_0x66c7('0x45')]?_0x66c7('0x45'):_0x66c7('0x56');agents[_0x5bca99[_0x66c7('0x4')]][_0x66c7('0x19')]=_0x66c7('0x35');utils[_0x66c7('0x3')](util[_0x66c7('0x16')](_0x66c7('0x55'),_0x5bca99[_0x66c7('0x4')],agents[_0x5bca99[_0x66c7('0x4')]][_0x66c7('0x6')],agents[_0x5bca99[_0x66c7('0x4')]][_0x66c7('0x29')],agents[_0x5bca99[_0x66c7('0x4')]][_0x66c7('0x19')]));writeDB(agents[_0x5bca99[_0x66c7('0x4')]]);}}catch(_0x331acc){utils['error'](util[_0x66c7('0x16')](_0x66c7('0x51'),_0x5bca99[_0x66c7('0x4')]),_0x331acc);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 3049fc5..7d528ba 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 _0xbf3d=['cdr','split','substring','includes','noop','execif','set','lastapplication','lodash','util','./utils','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','BUSY','uniqueid','blinds','info','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','queue','interface','connectedlinenum','lastevent','accountcode','getUserByInternal','then','UserId','CreateVoiceCallReport','request','newchannel','debug','format','[%s][calls][newchannel]','linkedid','channel','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','calleridnum','exten','DOCUMENTATION','error','[%s][calls][newstate]','[%s][calls][newstate]\x20context:%s\x20channel:%s','isNil','systemanswertime','now','channelstate','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','toNumber','hangup','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','duration','diffTime','endtime','attendedtransfer','localtwolinkedid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','_attended','transfertargetchannel','origtransfereruniqueid','origtransfererchannel','userfield','[%s][calls][attendedtransfer]','musiconholdstart','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstartAt','[%s][calls][musiconholdstart]','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][varset]','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','source','value','variable','xmd-phone','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid-preview','xmd-queue','xmcs-queue','lastdata','xmd-contactid','ContactId','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','sipcallid','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','startsWith','toLowerCase'];(function(_0x214f8f,_0x26ccef){var _0x34fefa=function(_0x26451){while(--_0x26451){_0x214f8f['push'](_0x214f8f['shift']());}};_0x34fefa(++_0x26ccef);}(_0xbf3d,0xe2));var _0xdbf3=function(_0x47d47e,_0x516bfc){_0x47d47e=_0x47d47e-0x0;var _0x244840=_0xbf3d[_0x47d47e];return _0x244840;};'use strict';var _=require(_0xdbf3('0x0'));var util=require(_0xdbf3('0x1'));var utils=require(_0xdbf3('0x2'));var transfers=require(_0xdbf3('0x3'));var dispositions=[_0xdbf3('0x4'),_0xdbf3('0x5'),_0xdbf3('0x5'),_0xdbf3('0x4'),_0xdbf3('0x4'),_0xdbf3('0x4'),_0xdbf3('0x6'),_0xdbf3('0x7'),_0xdbf3('0x5'),_0xdbf3('0x5'),'FAILED'];var channels={};function writeDB(_0x2a9dfb){var _0x56514e;if(transfers['blinds'][_0x2a9dfb[_0xdbf3('0x8')]]){_0x56514e=_0x2a9dfb[_0xdbf3('0x8')];_0x2a9dfb[_0xdbf3('0x8')]=transfers[_0xdbf3('0x9')][_0x2a9dfb['uniqueid']]['transfereeuniqueid'];}utils[_0xdbf3('0xa')](util['format'](_0xdbf3('0xb'),_0x2a9dfb[_0xdbf3('0x8')],_0x2a9dfb['channel'],_0x2a9dfb[_0xdbf3('0xc')],_0x2a9dfb['membername'],_0x2a9dfb[_0xdbf3('0xd')],_0x2a9dfb['calleridnum'],_0x2a9dfb[_0xdbf3('0xe')],_0x2a9dfb[_0xdbf3('0xf')]));if(_0x2a9dfb[_0xdbf3('0x10')]){utils[_0xdbf3('0x11')](_0x2a9dfb[_0xdbf3('0x10')])[_0xdbf3('0x12')](function(_0x2d4caa){if(_0x2d4caa){_0x2a9dfb[_0xdbf3('0x13')]=_0x2d4caa['id'];}utils['request'](_0xdbf3('0x14'),_0x2a9dfb);});}else{utils[_0xdbf3('0x15')](_0xdbf3('0x14'),_0x2a9dfb);}if(channels[_0x2a9dfb[_0xdbf3('0x8')]]){delete channels[_0x2a9dfb[_0xdbf3('0x8')]];}else if(_0x56514e&&channels[_0x56514e]){delete transfers[_0xdbf3('0x9')][_0x56514e];delete channels[_0x56514e];}}exports[_0xdbf3('0x16')]=function(_0x4998ad){try{utils[_0xdbf3('0x17')](util[_0xdbf3('0x18')](_0xdbf3('0x19'),_0x4998ad[_0xdbf3('0x8')]),_0x4998ad);if(_0x4998ad[_0xdbf3('0x8')]==_0x4998ad[_0xdbf3('0x1a')]&&_0x4998ad[_0xdbf3('0x1b')]!=_0xdbf3('0x1c')){utils[_0xdbf3('0xa')](util['format'](_0xdbf3('0x1d'),_0x4998ad[_0xdbf3('0x8')],_0x4998ad[_0xdbf3('0x1e')],_0x4998ad['exten']));channels[_0x4998ad[_0xdbf3('0x8')]]={'uniqueid':_0x4998ad[_0xdbf3('0x8')],'accountcode':_0x4998ad[_0xdbf3('0x10')],'source':_0x4998ad[_0xdbf3('0x1f')],'destination':_0x4998ad[_0xdbf3('0x20')],'destinationcontext':_0x4998ad[_0xdbf3('0x1e')],'channel':_0x4998ad[_0xdbf3('0x1b')],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xdbf3('0x4'),'amaflags':_0xdbf3('0x21')};}}catch(_0x140fe3){utils[_0xdbf3('0x22')](util[_0xdbf3('0x18')](_0xdbf3('0x19'),_0x4998ad[_0xdbf3('0x8')]),_0x140fe3);}};exports['newstate']=function(_0x473964){try{utils[_0xdbf3('0x17')](util[_0xdbf3('0x18')](_0xdbf3('0x23'),_0x473964['uniqueid']),_0x473964);if(!_['isNil'](channels[_0x473964[_0xdbf3('0x8')]])&&_0x473964['channelstate']==0x6){utils[_0xdbf3('0xa')](util[_0xdbf3('0x18')](_0xdbf3('0x24'),_0x473964[_0xdbf3('0x8')],_0x473964[_0xdbf3('0x1e')],_0x473964[_0xdbf3('0x1b')]));if(_[_0xdbf3('0x25')](channels[_0x473964[_0xdbf3('0x8')]][_0xdbf3('0x26')])){channels[_0x473964['uniqueid']][_0xdbf3('0x26')]=utils[_0xdbf3('0x27')]();}}else if(!_['isNil'](channels[_0x473964[_0xdbf3('0x1a')]])&&_0x473964[_0xdbf3('0x28')]==0x6&&_0x473964[_0xdbf3('0x1e')]!='transfer'){utils[_0xdbf3('0xa')](util['format'](_0xdbf3('0x29'),_0x473964[_0xdbf3('0x8')],_0x473964['linkedid'],_0x473964[_0xdbf3('0x1e')],_0x473964[_0xdbf3('0x1b')]));channels[_0x473964[_0xdbf3('0x1a')]][_0xdbf3('0x10')]=_0x473964['accountcode'];channels[_0x473964[_0xdbf3('0x1a')]][_0xdbf3('0x2a')]=_0x473964[_0xdbf3('0x1b')];if(_[_0xdbf3('0x25')](channels[_0x473964[_0xdbf3('0x1a')]][_0xdbf3('0x2b')])){channels[_0x473964[_0xdbf3('0x1a')]][_0xdbf3('0x2b')]=utils['now']();}channels[_0x473964[_0xdbf3('0x1a')]][_0xdbf3('0x2c')]=dispositions[_[_0xdbf3('0x2d')](_0x473964[_0xdbf3('0x28')])]||_0xdbf3('0x6');}}catch(_0x13e95c){utils[_0xdbf3('0x22')](util[_0xdbf3('0x18')](_0xdbf3('0x23'),_0x473964[_0xdbf3('0x8')]),_0x13e95c);}};exports[_0xdbf3('0x2e')]=function(_0x4c1a4e){try{if(!_['isNil'](channels[_0x4c1a4e[_0xdbf3('0x8')]])){utils['debug'](util[_0xdbf3('0x18')](_0xdbf3('0x2f'),_0x4c1a4e[_0xdbf3('0x8')]),_0x4c1a4e);if(_['isNil'](channels[_0x4c1a4e[_0xdbf3('0x8')]][_0xdbf3('0x30')])){channels[_0x4c1a4e[_0xdbf3('0x8')]][_0xdbf3('0x30')]=_0x4c1a4e[_0xdbf3('0x31')]+'\x20<'+_0x4c1a4e[_0xdbf3('0x1f')]+'>';}utils[_0xdbf3('0xa')](util[_0xdbf3('0x18')](_0xdbf3('0x32'),_0x4c1a4e[_0xdbf3('0x8')],channels[_0x4c1a4e[_0xdbf3('0x8')]][_0xdbf3('0x30')],_0x4c1a4e['cause-txt']));channels[_0x4c1a4e['uniqueid']]['endtime']=utils[_0xdbf3('0x27')]();channels[_0x4c1a4e[_0xdbf3('0x8')]][_0xdbf3('0x33')]=utils[_0xdbf3('0x34')](channels[_0x4c1a4e[_0xdbf3('0x8')]][_0xdbf3('0x35')],channels[_0x4c1a4e[_0xdbf3('0x8')]]['starttime']);channels[_0x4c1a4e[_0xdbf3('0x8')]]['billableseconds']=channels[_0x4c1a4e[_0xdbf3('0x8')]][_0xdbf3('0x2b')]?utils[_0xdbf3('0x34')](channels[_0x4c1a4e['uniqueid']][_0xdbf3('0x35')],channels[_0x4c1a4e[_0xdbf3('0x8')]][_0xdbf3('0x2b')]):0x0;writeDB(channels[_0x4c1a4e['uniqueid']]);}}catch(_0x3a7ddf){utils['error'](util[_0xdbf3('0x18')]('[%s][calls][hangup]',_0x4c1a4e['uniqueid']),_0x3a7ddf);}};exports[_0xdbf3('0x36')]=function(_0x24862e){try{if(!_[_0xdbf3('0x25')](channels[_0x24862e['localtwolinkedid']])){utils[_0xdbf3('0x17')](util[_0xdbf3('0x18')]('[%s][calls][attendedtransfer]',_0x24862e['origtransfereruniqueid']),_0x24862e);if(channels[_0x24862e[_0xdbf3('0x37')]][_0xdbf3('0x1b')]==_0x24862e[_0xdbf3('0x38')]){utils[_0xdbf3('0xa')](util[_0xdbf3('0x18')](_0xdbf3('0x39'),_0x24862e['origtransfereruniqueid'],_0x24862e[_0xdbf3('0x37')],_0x24862e[_0xdbf3('0x3a')]));channels[_0x24862e[_0xdbf3('0x37')]][_0xdbf3('0x2a')]=_0x24862e['secondtransfererchannel'];channels[_0x24862e[_0xdbf3('0x37')]]['userfield']=_0xdbf3('0x3b');}else if(channels[_0x24862e[_0xdbf3('0x37')]][_0xdbf3('0x1b')]=_0x24862e[_0xdbf3('0x3c')]){utils[_0xdbf3('0xa')](util[_0xdbf3('0x18')](_0xdbf3('0x39'),_0x24862e[_0xdbf3('0x3d')],_0x24862e['localtwolinkedid'],_0x24862e[_0xdbf3('0x3e')]));channels[_0x24862e[_0xdbf3('0x37')]][_0xdbf3('0x2a')]=_0x24862e[_0xdbf3('0x3e')];channels[_0x24862e[_0xdbf3('0x37')]][_0xdbf3('0x3f')]=_0xdbf3('0x3b');}}}catch(_0x3aec89){utils[_0xdbf3('0x22')](util[_0xdbf3('0x18')](_0xdbf3('0x40'),_0x24862e[_0xdbf3('0x3d')]),_0x3aec89);}};exports[_0xdbf3('0x41')]=function(_0x493a69){try{if(!_[_0xdbf3('0x25')](channels[_0x493a69[_0xdbf3('0x8')]])){utils[_0xdbf3('0x17')](util[_0xdbf3('0x18')]('[%s][calls][musiconholdstart]',_0x493a69[_0xdbf3('0x8')]),_0x493a69);channels[_0x493a69['uniqueid']]['musiconholdstartAt']=utils[_0xdbf3('0x27')]();utils[_0xdbf3('0xa')](util[_0xdbf3('0x18')](_0xdbf3('0x42'),_0x493a69[_0xdbf3('0x8')],channels[_0x493a69[_0xdbf3('0x8')]][_0xdbf3('0x43')]));}}catch(_0x53c203){utils[_0xdbf3('0x22')](util[_0xdbf3('0x18')](_0xdbf3('0x44'),_0x493a69[_0xdbf3('0x8')]),_0x53c203);}};exports[_0xdbf3('0x45')]=function(_0xbed6e1){try{if(!_['isNil'](channels[_0xbed6e1[_0xdbf3('0x8')]])){utils[_0xdbf3('0x17')](util[_0xdbf3('0x18')](_0xdbf3('0x46'),_0xbed6e1[_0xdbf3('0x8')]),_0xbed6e1);if(!_[_0xdbf3('0x25')](channels[_0xbed6e1[_0xdbf3('0x8')]][_0xdbf3('0x43')])){channels[_0xbed6e1[_0xdbf3('0x8')]][_0xdbf3('0x47')]+=utils[_0xdbf3('0x34')](utils[_0xdbf3('0x27')](),channels[_0xbed6e1[_0xdbf3('0x8')]][_0xdbf3('0x43')]);utils[_0xdbf3('0xa')](util[_0xdbf3('0x18')](_0xdbf3('0x48'),_0xbed6e1[_0xdbf3('0x8')],channels[_0xbed6e1['uniqueid']][_0xdbf3('0x47')]));delete channels[_0xbed6e1['uniqueid']][_0xdbf3('0x43')];}}}catch(_0x494eac){utils[_0xdbf3('0x22')](util[_0xdbf3('0x18')]('[%s][calls][musiconholdstop]',_0xbed6e1[_0xdbf3('0x8')]),_0x494eac);}};exports['varset']=function(_0x48be97){try{if(!_[_0xdbf3('0x25')](channels[_0x48be97[_0xdbf3('0x8')]])){utils['debug'](util[_0xdbf3('0x18')](_0xdbf3('0x49'),_0x48be97[_0xdbf3('0x8')]),_0x48be97);if(!_[_0xdbf3('0x25')](_0x48be97['variable'][_0xdbf3('0x4a')])){utils[_0xdbf3('0xa')](util[_0xdbf3('0x18')](_0xdbf3('0x4b'),_0x48be97['uniqueid'],_0x48be97['value']));channels[_0x48be97['uniqueid']][_0xdbf3('0x4c')]=_0x48be97[_0xdbf3('0x4d')];}if(!_[_0xdbf3('0x25')](_0x48be97[_0xdbf3('0x4e')][_0xdbf3('0x4f')])){utils[_0xdbf3('0xa')](util['format']('[%s][calls][varset]\x20variable:xmd-phone\x20value:%s',_0x48be97[_0xdbf3('0x8')],_0x48be97['value']));channels[_0x48be97[_0xdbf3('0x8')]]['destination']=_0x48be97['value'];channels[_0x48be97[_0xdbf3('0x8')]][_0xdbf3('0x30')]='\x22'+_0x48be97[_0xdbf3('0x4d')]+'\x22\x20<'+_0x48be97[_0xdbf3('0x4d')]+'>';}if(!_[_0xdbf3('0x25')](_0x48be97[_0xdbf3('0x4e')]['xmd-callerid-preview'])||!_[_0xdbf3('0x25')](_0x48be97[_0xdbf3('0x4e')][_0xdbf3('0x50')])){utils[_0xdbf3('0xa')](util[_0xdbf3('0x18')](_0xdbf3('0x51'),_0x48be97[_0xdbf3('0x8')],!_[_0xdbf3('0x25')](_0x48be97['variable'][_0xdbf3('0x52')])?'xmd-callerid-preview':_0xdbf3('0x50'),_0x48be97[_0xdbf3('0x4d')]));channels[_0x48be97[_0xdbf3('0x8')]][_0xdbf3('0x30')]=_0x48be97['value'];}if(!_['isNil'](_0x48be97['variable'][_0xdbf3('0x53')])||!_[_0xdbf3('0x25')](_0x48be97[_0xdbf3('0x4e')][_0xdbf3('0x54')])){utils['info'](util[_0xdbf3('0x18')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x48be97[_0xdbf3('0x8')],!_[_0xdbf3('0x25')](_0x48be97[_0xdbf3('0x4e')][_0xdbf3('0x53')])?_0xdbf3('0x53'):'xmcs-queue',_0x48be97['value']));channels[_0x48be97[_0xdbf3('0x8')]]['lastapplication']='Queue';channels[_0x48be97[_0xdbf3('0x8')]][_0xdbf3('0x55')]=_0x48be97[_0xdbf3('0x4d')];channels[_0x48be97['uniqueid']]['queue']=!![];}if(!_[_0xdbf3('0x25')](_0x48be97[_0xdbf3('0x4e')][_0xdbf3('0x56')])){utils['info'](util['format']('[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s',_0x48be97[_0xdbf3('0x8')],_0x48be97[_0xdbf3('0x4d')]));channels[_0x48be97[_0xdbf3('0x8')]][_0xdbf3('0x57')]=_0x48be97[_0xdbf3('0x4d')];}if(!_[_0xdbf3('0x25')](_0x48be97['variable']['xmd-cdrtype'])){utils[_0xdbf3('0xa')](util[_0xdbf3('0x18')](_0xdbf3('0x58'),_0x48be97[_0xdbf3('0x8')],_0x48be97[_0xdbf3('0x4d')]));channels[_0x48be97[_0xdbf3('0x8')]][_0xdbf3('0x59')]=_0x48be97[_0xdbf3('0x4d')];}if(!_[_0xdbf3('0x25')](_0x48be97[_0xdbf3('0x4e')][_0xdbf3('0x5a')])){utils[_0xdbf3('0xa')](util[_0xdbf3('0x18')](_0xdbf3('0x5b'),_0x48be97[_0xdbf3('0x8')],_0x48be97['value']));channels[_0x48be97['uniqueid']]['routeid']=_0x48be97['value'];}if(!_[_0xdbf3('0x25')](_0x48be97[_0xdbf3('0x4e')]['sipcallid'])){utils[_0xdbf3('0xa')](util[_0xdbf3('0x18')](_0xdbf3('0x5c'),_0x48be97[_0xdbf3('0x8')],_0x48be97[_0xdbf3('0x4d')]));channels[_0x48be97[_0xdbf3('0x8')]][_0xdbf3('0x5d')]=_0x48be97[_0xdbf3('0x4d')];}}}catch(_0x2e444f){utils[_0xdbf3('0x22')](util[_0xdbf3('0x18')](_0xdbf3('0x49'),_0x48be97[_0xdbf3('0x8')]),_0x2e444f);}};exports[_0xdbf3('0x5e')]=function(_0x59d137){try{if(!_[_0xdbf3('0x25')](channels[_0x59d137[_0xdbf3('0x8')]])){utils[_0xdbf3('0x17')](util[_0xdbf3('0x18')](_0xdbf3('0x5f'),_0x59d137[_0xdbf3('0x8')]),_0x59d137);utils[_0xdbf3('0xa')](util['format'](_0xdbf3('0x60'),_0x59d137[_0xdbf3('0x8')],_0x59d137[_0xdbf3('0x61')],_0x59d137[_0xdbf3('0x62')]));if(_0x59d137['application']['toLowerCase']()=='set'&&_[_0xdbf3('0x63')](_0x59d137[_0xdbf3('0x62')][_0xdbf3('0x64')](),_0xdbf3('0x65'))){var _0x1b95b0=_0x59d137['appdata'][_0xdbf3('0x66')]('=');var _0x2e5671=_0x1b95b0[0x0][_0xdbf3('0x67')](_0x1b95b0[0x0]['lastIndexOf']('(')+0x1,_0x1b95b0[0x0]['lastIndexOf'](')'));var _0x35e166=_0x1b95b0[0x1];channels[_0x59d137[_0xdbf3('0x8')]][_0x2e5671]=_0x35e166;}if(!_[_0xdbf3('0x68')]([_0xdbf3('0x2e'),_0xdbf3('0x69'),_0xdbf3('0x6a'),_0xdbf3('0x6b'),'gotoif'],_0x59d137[_0xdbf3('0x61')][_0xdbf3('0x64')]())){channels[_0x59d137['uniqueid']][_0xdbf3('0x6c')]=_0x59d137[_0xdbf3('0x61')];channels[_0x59d137['uniqueid']][_0xdbf3('0x55')]=_0x59d137[_0xdbf3('0x62')];}}}catch(_0x12e1e0){utils[_0xdbf3('0x22')](util[_0xdbf3('0x18')](_0xdbf3('0x5f'),_0x59d137[_0xdbf3('0x8')]),_0x12e1e0);}}; \ No newline at end of file +var _0x223b=['queue','membername','interface','connectedlinenum','lastevent','accountcode','getUserByInternal','then','UserId','request','CreateVoiceCallReport','newchannel','debug','format','[%s][calls][newchannel]','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','DOCUMENTATION','[%s][calls][newstate]','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','isNil','systemanswertime','linkedid','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','error','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','diffTime','starttime','billableseconds','[%s][calls][hangup]','attendedtransfer','[%s][calls][attendedtransfer]','origtransfereruniqueid','localtwolinkedid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','transfertargetchannel','origtransfererchannel','userfield','_attended','[%s][calls][musiconholdstart]','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstartAt','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','xmd-contactid','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','appdata','application','toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','gotoif','lastdata','lodash','util','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','BUSY','uniqueid','blinds','info','channel'];(function(_0x493e27,_0x5ede0b){var _0x5e2080=function(_0x23057c){while(--_0x23057c){_0x493e27['push'](_0x493e27['shift']());}};_0x5e2080(++_0x5ede0b);}(_0x223b,0xcd));var _0xb223=function(_0x1960df,_0x438ca5){_0x1960df=_0x1960df-0x0;var _0xd2c5aa=_0x223b[_0x1960df];return _0xd2c5aa;};'use strict';var _=require(_0xb223('0x0'));var util=require(_0xb223('0x1'));var utils=require('./utils');var transfers=require(_0xb223('0x2'));var dispositions=[_0xb223('0x3'),_0xb223('0x4'),'FAILED',_0xb223('0x3'),'NO\x20ANSWER',_0xb223('0x3'),_0xb223('0x5'),_0xb223('0x6'),_0xb223('0x4'),_0xb223('0x4'),_0xb223('0x4')];var channels={};function writeDB(_0x3ed323){var _0x3e2201;if(transfers['blinds'][_0x3ed323[_0xb223('0x7')]]){_0x3e2201=_0x3ed323[_0xb223('0x7')];_0x3ed323['uniqueid']=transfers[_0xb223('0x8')][_0x3ed323[_0xb223('0x7')]]['transfereeuniqueid'];}utils[_0xb223('0x9')](util['format']('[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x3ed323[_0xb223('0x7')],_0x3ed323[_0xb223('0xa')],_0x3ed323[_0xb223('0xb')],_0x3ed323[_0xb223('0xc')],_0x3ed323[_0xb223('0xd')],_0x3ed323['calleridnum'],_0x3ed323[_0xb223('0xe')],_0x3ed323[_0xb223('0xf')]));if(_0x3ed323[_0xb223('0x10')]){utils[_0xb223('0x11')](_0x3ed323[_0xb223('0x10')])[_0xb223('0x12')](function(_0xd1fa6d){if(_0xd1fa6d){_0x3ed323[_0xb223('0x13')]=_0xd1fa6d['id'];}utils[_0xb223('0x14')]('CreateVoiceCallReport',_0x3ed323);});}else{utils[_0xb223('0x14')](_0xb223('0x15'),_0x3ed323);}if(channels[_0x3ed323['uniqueid']]){delete channels[_0x3ed323['uniqueid']];}else if(_0x3e2201&&channels[_0x3e2201]){delete transfers['blinds'][_0x3e2201];delete channels[_0x3e2201];}}exports[_0xb223('0x16')]=function(_0x22f6f5){try{utils[_0xb223('0x17')](util[_0xb223('0x18')](_0xb223('0x19'),_0x22f6f5[_0xb223('0x7')]),_0x22f6f5);if(_0x22f6f5[_0xb223('0x7')]==_0x22f6f5['linkedid']&&_0x22f6f5[_0xb223('0xa')]!='OutgoingSpoolFailed'){utils['info'](util[_0xb223('0x18')](_0xb223('0x1a'),_0x22f6f5[_0xb223('0x7')],_0x22f6f5[_0xb223('0x1b')],_0x22f6f5[_0xb223('0x1c')]));channels[_0x22f6f5[_0xb223('0x7')]]={'uniqueid':_0x22f6f5[_0xb223('0x7')],'accountcode':_0x22f6f5[_0xb223('0x10')],'source':_0x22f6f5['calleridnum'],'destination':_0x22f6f5[_0xb223('0x1c')],'destinationcontext':_0x22f6f5[_0xb223('0x1b')],'channel':_0x22f6f5[_0xb223('0xa')],'starttime':utils[_0xb223('0x1d')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xb223('0x3'),'amaflags':_0xb223('0x1e')};}}catch(_0x12e41b){utils['error'](util[_0xb223('0x18')]('[%s][calls][newchannel]',_0x22f6f5['uniqueid']),_0x12e41b);}};exports['newstate']=function(_0x35a196){try{utils[_0xb223('0x17')](util[_0xb223('0x18')](_0xb223('0x1f'),_0x35a196['uniqueid']),_0x35a196);if(!_['isNil'](channels[_0x35a196[_0xb223('0x7')]])&&_0x35a196[_0xb223('0x20')]==0x6){utils['info'](util[_0xb223('0x18')](_0xb223('0x21'),_0x35a196[_0xb223('0x7')],_0x35a196[_0xb223('0x1b')],_0x35a196[_0xb223('0xa')]));if(_[_0xb223('0x22')](channels[_0x35a196[_0xb223('0x7')]]['systemanswertime'])){channels[_0x35a196[_0xb223('0x7')]][_0xb223('0x23')]=utils[_0xb223('0x1d')]();}}else if(!_['isNil'](channels[_0x35a196[_0xb223('0x24')]])&&_0x35a196['channelstate']==0x6&&_0x35a196[_0xb223('0x1b')]!=_0xb223('0x25')){utils[_0xb223('0x9')](util[_0xb223('0x18')](_0xb223('0x26'),_0x35a196['uniqueid'],_0x35a196['linkedid'],_0x35a196['context'],_0x35a196[_0xb223('0xa')]));channels[_0x35a196[_0xb223('0x24')]][_0xb223('0x10')]=_0x35a196['accountcode'];channels[_0x35a196['linkedid']][_0xb223('0x27')]=_0x35a196['channel'];if(_[_0xb223('0x22')](channels[_0x35a196[_0xb223('0x24')]][_0xb223('0x28')])){channels[_0x35a196['linkedid']][_0xb223('0x28')]=utils[_0xb223('0x1d')]();}channels[_0x35a196[_0xb223('0x24')]][_0xb223('0x29')]=dispositions[_['toNumber'](_0x35a196[_0xb223('0x20')])]||_0xb223('0x5');}}catch(_0x2184ca){utils[_0xb223('0x2a')](util['format']('[%s][calls][newstate]',_0x35a196[_0xb223('0x7')]),_0x2184ca);}};exports['hangup']=function(_0x206263){try{if(!_['isNil'](channels[_0x206263['uniqueid']])){utils[_0xb223('0x17')](util[_0xb223('0x18')]('[%s][calls][hangup]',_0x206263[_0xb223('0x7')]),_0x206263);if(_[_0xb223('0x22')](channels[_0x206263[_0xb223('0x7')]]['callerid'])){channels[_0x206263[_0xb223('0x7')]][_0xb223('0x2b')]=_0x206263[_0xb223('0x2c')]+'\x20<'+_0x206263['calleridnum']+'>';}utils[_0xb223('0x9')](util[_0xb223('0x18')](_0xb223('0x2d'),_0x206263[_0xb223('0x7')],channels[_0x206263[_0xb223('0x7')]][_0xb223('0x2b')],_0x206263[_0xb223('0x2e')]));channels[_0x206263[_0xb223('0x7')]][_0xb223('0x2f')]=utils['now']();channels[_0x206263['uniqueid']][_0xb223('0x30')]=utils[_0xb223('0x31')](channels[_0x206263['uniqueid']][_0xb223('0x2f')],channels[_0x206263[_0xb223('0x7')]][_0xb223('0x32')]);channels[_0x206263[_0xb223('0x7')]][_0xb223('0x33')]=channels[_0x206263[_0xb223('0x7')]][_0xb223('0x28')]?utils[_0xb223('0x31')](channels[_0x206263[_0xb223('0x7')]]['endtime'],channels[_0x206263['uniqueid']][_0xb223('0x28')]):0x0;writeDB(channels[_0x206263[_0xb223('0x7')]]);}}catch(_0x5e3ba1){utils[_0xb223('0x2a')](util[_0xb223('0x18')](_0xb223('0x34'),_0x206263[_0xb223('0x7')]),_0x5e3ba1);}};exports[_0xb223('0x35')]=function(_0x4026d6){try{if(!_['isNil'](channels[_0x4026d6['localtwolinkedid']])){utils['debug'](util[_0xb223('0x18')](_0xb223('0x36'),_0x4026d6[_0xb223('0x37')]),_0x4026d6);if(channels[_0x4026d6[_0xb223('0x38')]][_0xb223('0xa')]==_0x4026d6[_0xb223('0x39')]){utils['info'](util[_0xb223('0x18')](_0xb223('0x3a'),_0x4026d6[_0xb223('0x37')],_0x4026d6['localtwolinkedid'],_0x4026d6[_0xb223('0x3b')]));channels[_0x4026d6['localtwolinkedid']][_0xb223('0x27')]=_0x4026d6[_0xb223('0x3b')];channels[_0x4026d6[_0xb223('0x38')]]['userfield']='_attended';}else if(channels[_0x4026d6[_0xb223('0x38')]][_0xb223('0xa')]=_0x4026d6[_0xb223('0x3c')]){utils[_0xb223('0x9')](util['format']('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x4026d6[_0xb223('0x37')],_0x4026d6['localtwolinkedid'],_0x4026d6[_0xb223('0x3d')]));channels[_0x4026d6[_0xb223('0x38')]][_0xb223('0x27')]=_0x4026d6[_0xb223('0x3d')];channels[_0x4026d6['localtwolinkedid']][_0xb223('0x3e')]=_0xb223('0x3f');}}}catch(_0x36b7fd){utils[_0xb223('0x2a')](util[_0xb223('0x18')](_0xb223('0x36'),_0x4026d6[_0xb223('0x37')]),_0x36b7fd);}};exports['musiconholdstart']=function(_0x30dc51){try{if(!_[_0xb223('0x22')](channels[_0x30dc51[_0xb223('0x7')]])){utils[_0xb223('0x17')](util['format'](_0xb223('0x40'),_0x30dc51[_0xb223('0x7')]),_0x30dc51);channels[_0x30dc51[_0xb223('0x7')]]['musiconholdstartAt']=utils['now']();utils[_0xb223('0x9')](util[_0xb223('0x18')](_0xb223('0x41'),_0x30dc51[_0xb223('0x7')],channels[_0x30dc51[_0xb223('0x7')]][_0xb223('0x42')]));}}catch(_0x43f5a0){utils[_0xb223('0x2a')](util[_0xb223('0x18')](_0xb223('0x40'),_0x30dc51[_0xb223('0x7')]),_0x43f5a0);}};exports[_0xb223('0x43')]=function(_0x3f6a3b){try{if(!_[_0xb223('0x22')](channels[_0x3f6a3b[_0xb223('0x7')]])){utils['debug'](util[_0xb223('0x18')](_0xb223('0x44'),_0x3f6a3b[_0xb223('0x7')]),_0x3f6a3b);if(!_['isNil'](channels[_0x3f6a3b[_0xb223('0x7')]][_0xb223('0x42')])){channels[_0x3f6a3b[_0xb223('0x7')]][_0xb223('0x45')]+=utils[_0xb223('0x31')](utils[_0xb223('0x1d')](),channels[_0x3f6a3b[_0xb223('0x7')]][_0xb223('0x42')]);utils[_0xb223('0x9')](util[_0xb223('0x18')](_0xb223('0x46'),_0x3f6a3b['uniqueid'],channels[_0x3f6a3b['uniqueid']][_0xb223('0x45')]));delete channels[_0x3f6a3b[_0xb223('0x7')]][_0xb223('0x42')];}}}catch(_0x29c877){utils[_0xb223('0x2a')](util[_0xb223('0x18')](_0xb223('0x44'),_0x3f6a3b[_0xb223('0x7')]),_0x29c877);}};exports['varset']=function(_0x42d768){try{if(!_[_0xb223('0x22')](channels[_0x42d768[_0xb223('0x7')]])){utils[_0xb223('0x17')](util[_0xb223('0x18')](_0xb223('0x47'),_0x42d768[_0xb223('0x7')]),_0x42d768);if(!_[_0xb223('0x22')](_0x42d768[_0xb223('0x48')][_0xb223('0x49')])){utils[_0xb223('0x9')](util[_0xb223('0x18')](_0xb223('0x4a'),_0x42d768[_0xb223('0x7')],_0x42d768[_0xb223('0x4b')]));channels[_0x42d768[_0xb223('0x7')]]['source']=_0x42d768['value'];}if(!_[_0xb223('0x22')](_0x42d768[_0xb223('0x48')][_0xb223('0x4c')])){utils[_0xb223('0x9')](util['format'](_0xb223('0x4d'),_0x42d768[_0xb223('0x7')],_0x42d768[_0xb223('0x4b')]));channels[_0x42d768['uniqueid']][_0xb223('0x4e')]=_0x42d768['value'];channels[_0x42d768[_0xb223('0x7')]][_0xb223('0x2b')]='\x22'+_0x42d768[_0xb223('0x4b')]+'\x22\x20<'+_0x42d768[_0xb223('0x4b')]+'>';}if(!_[_0xb223('0x22')](_0x42d768[_0xb223('0x48')][_0xb223('0x4f')])||!_[_0xb223('0x22')](_0x42d768[_0xb223('0x48')][_0xb223('0x50')])){utils['info'](util[_0xb223('0x18')](_0xb223('0x51'),_0x42d768[_0xb223('0x7')],!_[_0xb223('0x22')](_0x42d768[_0xb223('0x48')][_0xb223('0x4f')])?_0xb223('0x4f'):_0xb223('0x50'),_0x42d768[_0xb223('0x4b')]));channels[_0x42d768[_0xb223('0x7')]][_0xb223('0x2b')]=_0x42d768[_0xb223('0x4b')];}if(!_[_0xb223('0x22')](_0x42d768[_0xb223('0x48')][_0xb223('0x52')])||!_[_0xb223('0x22')](_0x42d768[_0xb223('0x48')]['xmcs-queue'])){utils[_0xb223('0x9')](util[_0xb223('0x18')](_0xb223('0x51'),_0x42d768[_0xb223('0x7')],!_[_0xb223('0x22')](_0x42d768['variable'][_0xb223('0x52')])?_0xb223('0x52'):_0xb223('0x53'),_0x42d768[_0xb223('0x4b')]));channels[_0x42d768[_0xb223('0x7')]][_0xb223('0x54')]='Queue';channels[_0x42d768[_0xb223('0x7')]]['lastdata']=_0x42d768[_0xb223('0x4b')];channels[_0x42d768[_0xb223('0x7')]][_0xb223('0xb')]=!![];}if(!_['isNil'](_0x42d768['variable'][_0xb223('0x55')])){utils[_0xb223('0x9')](util['format']('[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s',_0x42d768[_0xb223('0x7')],_0x42d768['value']));channels[_0x42d768[_0xb223('0x7')]][_0xb223('0x56')]=_0x42d768[_0xb223('0x4b')];}if(!_['isNil'](_0x42d768[_0xb223('0x48')][_0xb223('0x57')])){utils[_0xb223('0x9')](util[_0xb223('0x18')](_0xb223('0x58'),_0x42d768['uniqueid'],_0x42d768[_0xb223('0x4b')]));channels[_0x42d768[_0xb223('0x7')]][_0xb223('0x59')]=_0x42d768['value'];}if(!_[_0xb223('0x22')](_0x42d768[_0xb223('0x48')][_0xb223('0x5a')])){utils[_0xb223('0x9')](util['format'](_0xb223('0x5b'),_0x42d768[_0xb223('0x7')],_0x42d768[_0xb223('0x4b')]));channels[_0x42d768[_0xb223('0x7')]][_0xb223('0x5c')]=_0x42d768[_0xb223('0x4b')];}if(!_['isNil'](_0x42d768[_0xb223('0x48')][_0xb223('0x5d')])){utils['info'](util[_0xb223('0x18')](_0xb223('0x5e'),_0x42d768['uniqueid'],_0x42d768[_0xb223('0x4b')]));channels[_0x42d768[_0xb223('0x7')]][_0xb223('0x5d')]=_0x42d768['value'];}}}catch(_0x5d693f){utils[_0xb223('0x2a')](util['format'](_0xb223('0x47'),_0x42d768[_0xb223('0x7')]),_0x5d693f);}};exports['newexten']=function(_0x2849cf){try{if(!_['isNil'](channels[_0x2849cf[_0xb223('0x7')]])){utils[_0xb223('0x17')](util[_0xb223('0x18')](_0xb223('0x5f'),_0x2849cf[_0xb223('0x7')]),_0x2849cf);utils[_0xb223('0x9')](util[_0xb223('0x18')](_0xb223('0x60'),_0x2849cf[_0xb223('0x7')],_0x2849cf['application'],_0x2849cf[_0xb223('0x61')]));if(_0x2849cf[_0xb223('0x62')][_0xb223('0x63')]()==_0xb223('0x64')&&_[_0xb223('0x65')](_0x2849cf[_0xb223('0x61')][_0xb223('0x63')](),_0xb223('0x66'))){var _0x1045d6=_0x2849cf[_0xb223('0x61')][_0xb223('0x67')]('=');var _0x53f3f9=_0x1045d6[0x0][_0xb223('0x68')](_0x1045d6[0x0][_0xb223('0x69')]('(')+0x1,_0x1045d6[0x0][_0xb223('0x69')](')'));var _0x56a069=_0x1045d6[0x1];channels[_0x2849cf['uniqueid']][_0x53f3f9]=_0x56a069;}if(!_['includes'](['hangup','noop','execif','set',_0xb223('0x6a')],_0x2849cf[_0xb223('0x62')][_0xb223('0x63')]())){channels[_0x2849cf[_0xb223('0x7')]][_0xb223('0x54')]=_0x2849cf[_0xb223('0x62')];channels[_0x2849cf[_0xb223('0x7')]][_0xb223('0x6b')]=_0x2849cf[_0xb223('0x61')];}}}catch(_0x1d72f3){utils['error'](util[_0xb223('0x18')]('[%s][calls][newexten]',_0x2849cf[_0xb223('0x7')]),_0x1d72f3);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 51f06fc..d6eac7f 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 _0x7d55=['error','[core]\x20error','close','./utils','connect','info','[core]\x20connected','[core]\x20shutdown','fullybooted'];(function(_0x13b593,_0x85a736){var _0x1d2958=function(_0x371387){while(--_0x371387){_0x13b593['push'](_0x13b593['shift']());}};_0x1d2958(++_0x85a736);}(_0x7d55,0x1bc));var _0x57d5=function(_0x11f427,_0x15b6e5){_0x11f427=_0x11f427-0x0;var _0x147811=_0x7d55[_0x11f427];return _0x147811;};'use strict';var utils=require(_0x57d5('0x0'));exports[_0x57d5('0x1')]=function(){utils[_0x57d5('0x2')](_0x57d5('0x3'));};exports['shutdown']=function(){utils['info'](_0x57d5('0x4'));};exports[_0x57d5('0x5')]=function(){utils[_0x57d5('0x2')]('[core]\x20fullybooted');};exports[_0x57d5('0x6')]=function(_0x2d9ad2){utils[_0x57d5('0x6')](_0x57d5('0x7'),_0x2d9ad2);};exports[_0x57d5('0x8')]=function(){utils[_0x57d5('0x2')]('[core]\x20close');};exports['managerevent']=function(_0x59e164){}; \ No newline at end of file +var _0x687d=['fullybooted','[core]\x20fullybooted','close','[core]\x20close','managerevent','connect','info','[core]\x20connected','shutdown'];(function(_0x57628c,_0x22c548){var _0x1ebbec=function(_0x4aa354){while(--_0x4aa354){_0x57628c['push'](_0x57628c['shift']());}};_0x1ebbec(++_0x22c548);}(_0x687d,0x191));var _0xd687=function(_0x42fe9c,_0x8ea8df){_0x42fe9c=_0x42fe9c-0x0;var _0xe8737f=_0x687d[_0x42fe9c];return _0xe8737f;};'use strict';var utils=require('./utils');exports[_0xd687('0x0')]=function(){utils[_0xd687('0x1')](_0xd687('0x2'));};exports[_0xd687('0x3')]=function(){utils[_0xd687('0x1')]('[core]\x20shutdown');};exports[_0xd687('0x4')]=function(){utils[_0xd687('0x1')](_0xd687('0x5'));};exports['error']=function(_0xdc8183){utils['error']('[core]\x20error',_0xdc8183);};exports[_0xd687('0x6')]=function(){utils[_0xd687('0x1')](_0xd687('0x7'));};exports[_0xd687('0x8')]=function(_0x5c23b4){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 87b9192..e383fc7 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 _0x7d54=['hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','complete','duration','holdtime','diffTime','endtime','billableseconds','answertime','lodash','./utils','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','channel','dialstring','calleridnum','connectedlinenum','CreateVoiceDialReport','uniqueid','info','appdata','application','toLowerCase','split','error','[%s][dials][newexten]','varset','[%s][dials][varset]','isNil','outboundrouteid','value','dialbegin','debug','starttime','now','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','[%s][dials][dialbegin]','dialstatus','assign','lastevent','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][dialend]'];(function(_0x2eea36,_0x4e796c){var _0x25e063=function(_0x55e0eb){while(--_0x55e0eb){_0x2eea36['push'](_0x2eea36['shift']());}};_0x25e063(++_0x4e796c);}(_0x7d54,0x125));var _0x47d5=function(_0x12f036,_0x27e401){_0x12f036=_0x12f036-0x0;var _0xf0be1b=_0x7d54[_0x12f036];return _0xf0be1b;};'use strict';var _=require(_0x47d5('0x0'));var util=require('util');var utils=require(_0x47d5('0x1'));var dials={};function writeDB(_0x3f0f03){utils['info'](util[_0x47d5('0x2')](_0x47d5('0x3'),_0x3f0f03['uniqueid'],_0x3f0f03[_0x47d5('0x4')],_0x3f0f03[_0x47d5('0x5')],_0x3f0f03[_0x47d5('0x6')],_0x3f0f03[_0x47d5('0x7')],_0x3f0f03['dialstatus']));utils['request'](_0x47d5('0x8'),_0x3f0f03);delete dials[_0x3f0f03[_0x47d5('0x9')]];}exports['newexten']=function(_0x51bf5a){try{utils['debug'](util[_0x47d5('0x2')]('[%s][dials][newexten]',_0x51bf5a[_0x47d5('0x9')]),_0x51bf5a);utils[_0x47d5('0xa')](util[_0x47d5('0x2')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x51bf5a['uniqueid'],_0x51bf5a['application'],_0x51bf5a[_0x47d5('0xb')]));if(_0x51bf5a[_0x47d5('0xc')][_0x47d5('0xd')]()=='set'&&_['startsWith'](_0x51bf5a[_0x47d5('0xb')][_0x47d5('0xd')](),'cdr(routeid)')){var _0x235729=_0x51bf5a[_0x47d5('0xb')][_0x47d5('0xe')]('=');dials[_0x51bf5a['uniqueid']]={'routeId':_0x235729[0x1]};}}catch(_0x4da628){utils[_0x47d5('0xf')](util['format'](_0x47d5('0x10'),_0x51bf5a[_0x47d5('0x9')]),_0x4da628);}};exports[_0x47d5('0x11')]=function(_0x63a093){try{utils['debug'](util[_0x47d5('0x2')](_0x47d5('0x12'),_0x63a093[_0x47d5('0x9')]),_0x63a093);if(!_[_0x47d5('0x13')](_0x63a093['variable'][_0x47d5('0x14')])){utils[_0x47d5('0xa')](util[_0x47d5('0x2')]('[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s',_0x63a093['uniqueid'],_0x63a093[_0x47d5('0x15')]));dials[_0x63a093[_0x47d5('0x9')]]={'routeId':_0x63a093['value']};}}catch(_0x4444c3){utils['error'](util[_0x47d5('0x2')](_0x47d5('0x12'),_0x63a093[_0x47d5('0x9')]),_0x4444c3);}};exports[_0x47d5('0x16')]=function(_0x35b56b){try{if(!_['isNil'](dials[_0x35b56b['uniqueid']])){utils[_0x47d5('0x17')](util[_0x47d5('0x2')]('[%s][dials][dialbegin]',_0x35b56b[_0x47d5('0x9')]),_0x35b56b);dials[_0x35b56b[_0x47d5('0x9')]]=_['assign'](dials[_0x35b56b[_0x47d5('0x9')]],_0x35b56b);dials[_0x35b56b[_0x47d5('0x9')]][_0x47d5('0x18')]=utils[_0x47d5('0x19')]();dials[_0x35b56b[_0x47d5('0x9')]]['lastevent']=_0x47d5('0x1a');utils[_0x47d5('0xa')](util['format'](_0x47d5('0x1b'),_0x35b56b[_0x47d5('0x9')],dials[_0x35b56b[_0x47d5('0x9')]][_0x47d5('0x18')]));}}catch(_0x57f5ed){utils[_0x47d5('0xf')](util[_0x47d5('0x2')](_0x47d5('0x1c'),_0x35b56b[_0x47d5('0x9')]),_0x57f5ed);}};exports['dialend']=function(_0x3dc7a0){try{if(!_[_0x47d5('0x13')](dials[_0x3dc7a0['uniqueid']])){utils[_0x47d5('0x17')](util['format']('[%s][dials][dialend]',_0x3dc7a0[_0x47d5('0x9')]),_0x3dc7a0);dials[_0x3dc7a0[_0x47d5('0x9')]][_0x47d5('0x1d')]=_0x3dc7a0[_0x47d5('0x1d')];if(_0x3dc7a0['dialstatus']=='ANSWER'){dials[_0x3dc7a0['uniqueid']]=_[_0x47d5('0x1e')](dials[_0x3dc7a0[_0x47d5('0x9')]],_0x3dc7a0);dials[_0x3dc7a0['uniqueid']]['answertime']=utils['now']();dials[_0x3dc7a0[_0x47d5('0x9')]][_0x47d5('0x1f')]=_0x47d5('0x20');utils[_0x47d5('0xa')](util['format'](_0x47d5('0x21'),_0x3dc7a0[_0x47d5('0x9')],_0x3dc7a0[_0x47d5('0x1d')],dials[_0x3dc7a0[_0x47d5('0x9')]]['answertime']));}else{utils[_0x47d5('0xa')](util[_0x47d5('0x2')](_0x47d5('0x22'),_0x3dc7a0[_0x47d5('0x9')],_0x3dc7a0[_0x47d5('0x1d')]));}}}catch(_0x1f0829){utils[_0x47d5('0xf')](util[_0x47d5('0x2')](_0x47d5('0x23'),_0x3dc7a0['uniqueid']),_0x1f0829);}};exports[_0x47d5('0x24')]=function(_0x34ed88){try{if(!_[_0x47d5('0x13')](dials[_0x34ed88['uniqueid']])){utils[_0x47d5('0x17')](util['format'](_0x47d5('0x25'),_0x34ed88[_0x47d5('0x9')]),_0x34ed88);utils[_0x47d5('0xa')](util[_0x47d5('0x2')](_0x47d5('0x26'),_0x34ed88['uniqueid'],_0x34ed88[_0x47d5('0x6')],_0x34ed88[_0x47d5('0x27')],_0x34ed88['cause-txt']));dials[_0x34ed88[_0x47d5('0x9')]]=_[_0x47d5('0x1e')](dials[_0x34ed88[_0x47d5('0x9')]],{'endtime':utils['now'](),'lastevent':_0x47d5('0x28')});dials[_0x34ed88['uniqueid']][_0x47d5('0x29')]=utils['diffTime'](dials[_0x34ed88[_0x47d5('0x9')]]['endtime'],dials[_0x34ed88[_0x47d5('0x9')]][_0x47d5('0x18')]);dials[_0x34ed88['uniqueid']][_0x47d5('0x2a')]=utils[_0x47d5('0x2b')](dials[_0x34ed88[_0x47d5('0x9')]]['answertime']||dials[_0x34ed88[_0x47d5('0x9')]][_0x47d5('0x2c')],dials[_0x34ed88[_0x47d5('0x9')]][_0x47d5('0x18')]);dials[_0x34ed88[_0x47d5('0x9')]][_0x47d5('0x2d')]=dials[_0x34ed88['uniqueid']][_0x47d5('0x2e')]?utils[_0x47d5('0x2b')](dials[_0x34ed88[_0x47d5('0x9')]]['endtime'],dials[_0x34ed88[_0x47d5('0x9')]][_0x47d5('0x2e')]):0x0;writeDB(dials[_0x34ed88[_0x47d5('0x9')]]);}}catch(_0x1f9096){utils[_0x47d5('0xf')](util[_0x47d5('0x2')](_0x47d5('0x25'),_0x34ed88[_0x47d5('0x9')]),_0x1f9096);}}; \ No newline at end of file +var _0x64aa=['varset','[%s][dials][varset]','isNil','variable','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','error','assign','starttime','now','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialstatus','answertime','lastevent','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][dialend]','hangup','calleridname','complete','duration','diffTime','holdtime','endtime','billableseconds','[%s][dials][hangup]','lodash','util','./utils','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','channel','dialstring','calleridnum','connectedlinenum','request','CreateVoiceDialReport','debug','info','[%s][dials][newexten]\x20application:%s\x20appdata:%s','appdata','toLowerCase','set','startsWith','cdr(routeid)','split','uniqueid'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x64aa,0x1cb));var _0xa64a=function(_0x1b658,_0x344b6a){_0x1b658=_0x1b658-0x0;var _0x1d17e5=_0x64aa[_0x1b658];return _0x1d17e5;};'use strict';var _=require(_0xa64a('0x0'));var util=require(_0xa64a('0x1'));var utils=require(_0xa64a('0x2'));var dials={};function writeDB(_0x24ac02){utils['info'](util[_0xa64a('0x3')](_0xa64a('0x4'),_0x24ac02['uniqueid'],_0x24ac02[_0xa64a('0x5')],_0x24ac02[_0xa64a('0x6')],_0x24ac02[_0xa64a('0x7')],_0x24ac02[_0xa64a('0x8')],_0x24ac02['dialstatus']));utils[_0xa64a('0x9')](_0xa64a('0xa'),_0x24ac02);delete dials[_0x24ac02['uniqueid']];}exports['newexten']=function(_0x1355bb){try{utils[_0xa64a('0xb')](util[_0xa64a('0x3')]('[%s][dials][newexten]',_0x1355bb['uniqueid']),_0x1355bb);utils[_0xa64a('0xc')](util[_0xa64a('0x3')](_0xa64a('0xd'),_0x1355bb['uniqueid'],_0x1355bb['application'],_0x1355bb[_0xa64a('0xe')]));if(_0x1355bb['application'][_0xa64a('0xf')]()==_0xa64a('0x10')&&_[_0xa64a('0x11')](_0x1355bb[_0xa64a('0xe')][_0xa64a('0xf')](),_0xa64a('0x12'))){var _0x1d5862=_0x1355bb[_0xa64a('0xe')][_0xa64a('0x13')]('=');dials[_0x1355bb[_0xa64a('0x14')]]={'routeId':_0x1d5862[0x1]};}}catch(_0x1e31da){utils['error'](util[_0xa64a('0x3')]('[%s][dials][newexten]',_0x1355bb[_0xa64a('0x14')]),_0x1e31da);}};exports[_0xa64a('0x15')]=function(_0x12fa94){try{utils[_0xa64a('0xb')](util[_0xa64a('0x3')](_0xa64a('0x16'),_0x12fa94['uniqueid']),_0x12fa94);if(!_[_0xa64a('0x17')](_0x12fa94[_0xa64a('0x18')]['outboundrouteid'])){utils[_0xa64a('0xc')](util[_0xa64a('0x3')](_0xa64a('0x19'),_0x12fa94[_0xa64a('0x14')],_0x12fa94[_0xa64a('0x1a')]));dials[_0x12fa94[_0xa64a('0x14')]]={'routeId':_0x12fa94[_0xa64a('0x1a')]};}}catch(_0x321aae){utils[_0xa64a('0x1b')](util[_0xa64a('0x3')]('[%s][dials][varset]',_0x12fa94['uniqueid']),_0x321aae);}};exports['dialbegin']=function(_0x386082){try{if(!_[_0xa64a('0x17')](dials[_0x386082[_0xa64a('0x14')]])){utils['debug'](util[_0xa64a('0x3')]('[%s][dials][dialbegin]',_0x386082['uniqueid']),_0x386082);dials[_0x386082['uniqueid']]=_[_0xa64a('0x1c')](dials[_0x386082[_0xa64a('0x14')]],_0x386082);dials[_0x386082[_0xa64a('0x14')]][_0xa64a('0x1d')]=utils[_0xa64a('0x1e')]();dials[_0x386082['uniqueid']]['lastevent']=_0xa64a('0x1f');utils[_0xa64a('0xc')](util['format'](_0xa64a('0x20'),_0x386082[_0xa64a('0x14')],dials[_0x386082[_0xa64a('0x14')]][_0xa64a('0x1d')]));}}catch(_0x2529c7){utils[_0xa64a('0x1b')](util['format']('[%s][dials][dialbegin]',_0x386082[_0xa64a('0x14')]),_0x2529c7);}};exports['dialend']=function(_0x48a7c0){try{if(!_[_0xa64a('0x17')](dials[_0x48a7c0['uniqueid']])){utils[_0xa64a('0xb')](util[_0xa64a('0x3')]('[%s][dials][dialend]',_0x48a7c0[_0xa64a('0x14')]),_0x48a7c0);dials[_0x48a7c0['uniqueid']]['dialstatus']=_0x48a7c0['dialstatus'];if(_0x48a7c0[_0xa64a('0x21')]=='ANSWER'){dials[_0x48a7c0[_0xa64a('0x14')]]=_['assign'](dials[_0x48a7c0['uniqueid']],_0x48a7c0);dials[_0x48a7c0[_0xa64a('0x14')]][_0xa64a('0x22')]=utils[_0xa64a('0x1e')]();dials[_0x48a7c0['uniqueid']][_0xa64a('0x23')]='connect';utils[_0xa64a('0xc')](util[_0xa64a('0x3')](_0xa64a('0x24'),_0x48a7c0[_0xa64a('0x14')],_0x48a7c0['dialstatus'],dials[_0x48a7c0[_0xa64a('0x14')]][_0xa64a('0x22')]));}else{utils[_0xa64a('0xc')](util[_0xa64a('0x3')](_0xa64a('0x25'),_0x48a7c0[_0xa64a('0x14')],_0x48a7c0[_0xa64a('0x21')]));}}}catch(_0x124c3f){utils[_0xa64a('0x1b')](util[_0xa64a('0x3')](_0xa64a('0x26'),_0x48a7c0['uniqueid']),_0x124c3f);}};exports[_0xa64a('0x27')]=function(_0x29b464){try{if(!_['isNil'](dials[_0x29b464[_0xa64a('0x14')]])){utils[_0xa64a('0xb')](util[_0xa64a('0x3')]('[%s][dials][hangup]',_0x29b464[_0xa64a('0x14')]),_0x29b464);utils[_0xa64a('0xc')](util['format']('[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s',_0x29b464['uniqueid'],_0x29b464[_0xa64a('0x7')],_0x29b464[_0xa64a('0x28')],_0x29b464['cause-txt']));dials[_0x29b464[_0xa64a('0x14')]]=_[_0xa64a('0x1c')](dials[_0x29b464[_0xa64a('0x14')]],{'endtime':utils[_0xa64a('0x1e')](),'lastevent':_0xa64a('0x29')});dials[_0x29b464[_0xa64a('0x14')]][_0xa64a('0x2a')]=utils[_0xa64a('0x2b')](dials[_0x29b464[_0xa64a('0x14')]]['endtime'],dials[_0x29b464[_0xa64a('0x14')]][_0xa64a('0x1d')]);dials[_0x29b464[_0xa64a('0x14')]][_0xa64a('0x2c')]=utils['diffTime'](dials[_0x29b464[_0xa64a('0x14')]][_0xa64a('0x22')]||dials[_0x29b464['uniqueid']][_0xa64a('0x2d')],dials[_0x29b464['uniqueid']][_0xa64a('0x1d')]);dials[_0x29b464[_0xa64a('0x14')]][_0xa64a('0x2e')]=dials[_0x29b464[_0xa64a('0x14')]]['answertime']?utils['diffTime'](dials[_0x29b464[_0xa64a('0x14')]]['endtime'],dials[_0x29b464[_0xa64a('0x14')]][_0xa64a('0x22')]):0x0;writeDB(dials[_0x29b464[_0xa64a('0x14')]]);}}catch(_0x7349c5){utils[_0xa64a('0x1b')](util[_0xa64a('0x3')](_0xa64a('0x2f'),_0x29b464[_0xa64a('0x14')]),_0x7349c5);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 084990f..46bb001 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 _0xf34b=['./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device','agentcalled','uniqueid','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','[%s][index][hangup]','hangup','cdr','[%s][index][cdr]','[%s][index][blindtransfer]','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','../../config/environment','./utils','util','port','asterisk','password','keepConnected','xdr','disabled','XDR\x20DISABLED','./calls.controller','./queues.controller','./recordings.controller','./members.controller'];(function(_0x26165a,_0x468cfe){var _0x1e9a2f=function(_0x2a58bb){while(--_0x2a58bb){_0x26165a['push'](_0x26165a['shift']());}};_0x1e9a2f(++_0x468cfe);}(_0xf34b,0x17d));var _0xbf34=function(_0xf47070,_0xb31c1e){_0xf47070=_0xf47070-0x0;var _0x336c4b=_0xf34b[_0xf47070];return _0x336c4b;};var AsteriskManager=require(_0xbf34('0x0'));var config=require(_0xbf34('0x1'));var utils=require(_0xbf34('0x2'));var util=require(_0xbf34('0x3'));var ami=new AsteriskManager(config['asterisk'][_0xbf34('0x4')],config['asterisk']['ip'],config[_0xbf34('0x5')]['username'],config[_0xbf34('0x5')][_0xbf34('0x6')],!![]);ami[_0xbf34('0x7')]();if(config[_0xbf34('0x8')]&&config[_0xbf34('0x8')][_0xbf34('0x9')]){utils['info'](_0xbf34('0xa'));}else{var agents=require('./agents.controller');var calls=require(_0xbf34('0xb'));var queues=require(_0xbf34('0xc'));var recordings=require(_0xbf34('0xd'));var members=require(_0xbf34('0xe'));var dials=require('./dials.controller');var transfers=require(_0xbf34('0xf'));var core=require(_0xbf34('0x10'));ami['on'](_0xbf34('0x11'),core[_0xbf34('0x11')]);ami['on'](_0xbf34('0x12'),core['shutdown']);ami['on'](_0xbf34('0x13'),core['fullybooted']);ami['on'](_0xbf34('0x14'),core[_0xbf34('0x14')]);ami['on'](_0xbf34('0x15'),core[_0xbf34('0x15')]);ami['on'](_0xbf34('0x16'),core[_0xbf34('0x16')]);ami['on'](_0xbf34('0x17'),function(_0x51e8b8){try{utils[_0xbf34('0x18')](util[_0xbf34('0x19')](_0xbf34('0x1a'),_0x51e8b8['device']),_0x51e8b8);members[_0xbf34('0x17')](_0x51e8b8);}catch(_0x2c6e82){utils['error'](util['format'](_0xbf34('0x1a'),_0x51e8b8[_0xbf34('0x1b')]),_0x2c6e82);}});ami['on'](_0xbf34('0x1c'),function(_0x15c435){try{utils[_0xbf34('0x18')](util[_0xbf34('0x19')]('[%s][index][agentcalled]',_0x15c435[_0xbf34('0x1d')]),_0x15c435);agents[_0xbf34('0x1c')](_0x15c435);}catch(_0x4e371c){utils[_0xbf34('0x14')](util[_0xbf34('0x19')]('[%s][index][agentcalled]',_0x15c435['uniqueid']),_0x4e371c);}});ami['on']('agentringnoanswer',function(_0x4364f7){try{utils[_0xbf34('0x18')](util[_0xbf34('0x19')]('[%s][index][agentringnoanswer]',_0x4364f7[_0xbf34('0x1d')]),_0x4364f7);agents['agentringnoanswer'](_0x4364f7);}catch(_0x348eaa){utils[_0xbf34('0x14')](util[_0xbf34('0x19')](_0xbf34('0x1e'),_0x4364f7[_0xbf34('0x1d')]),_0x348eaa);}});ami['on'](_0xbf34('0x1f'),function(_0x31ad4d){try{utils[_0xbf34('0x18')](util[_0xbf34('0x19')](_0xbf34('0x20'),_0x31ad4d['uniqueid']),_0x31ad4d);agents[_0xbf34('0x1f')](_0x31ad4d);queues[_0xbf34('0x1f')](_0x31ad4d);}catch(_0x151d5a){utils[_0xbf34('0x14')](util['format'](_0xbf34('0x20'),_0x31ad4d[_0xbf34('0x1d')]),_0x151d5a);}});ami['on'](_0xbf34('0x21'),function(_0x38e50a){try{utils['debug'](util['format']('[%s][index][agentcomplete]',_0x38e50a[_0xbf34('0x1d')]),_0x38e50a);agents[_0xbf34('0x21')](_0x38e50a);queues[_0xbf34('0x21')](_0x38e50a);members['agentcomplete'](_0x38e50a);}catch(_0x4a77b5){utils['error'](util['format'](_0xbf34('0x22'),_0x38e50a[_0xbf34('0x1d')]),_0x4a77b5);}});ami['on'](_0xbf34('0x23'),function(_0x412f94){try{utils[_0xbf34('0x18')](util[_0xbf34('0x19')](_0xbf34('0x24'),_0x412f94[_0xbf34('0x1d')]),_0x412f94);agents[_0xbf34('0x23')](_0x412f94);queues[_0xbf34('0x23')](_0x412f94);}catch(_0x456041){utils['error'](util['format']('[%s][index][queuecallerabandon]',_0x412f94['uniqueid']),_0x456041);}});ami['on']('queuecallerjoin',function(_0x1e1513){try{utils[_0xbf34('0x18')](util[_0xbf34('0x19')]('[%s][index][queuecallerjoin]',_0x1e1513[_0xbf34('0x1d')]),_0x1e1513);queues['queuecallerjoin'](_0x1e1513);recordings[_0xbf34('0x25')](_0x1e1513);}catch(_0x39fb46){utils[_0xbf34('0x14')](util[_0xbf34('0x19')]('[%s][index][queuecallerjoin]',_0x1e1513['uniqueid']),_0x39fb46);}});ami['on'](_0xbf34('0x26'),function(_0xdfd904){try{utils['debug'](util[_0xbf34('0x19')](_0xbf34('0x27'),_0xdfd904[_0xbf34('0x1d')]),_0xdfd904);queues['queuecallerleave'](_0xdfd904);}catch(_0x28dbde){utils['error'](util[_0xbf34('0x19')](_0xbf34('0x27'),_0xdfd904['uniqueid']),_0x28dbde);}});ami['on']('musiconholdstart',function(_0x4f0c8d){try{utils['debug'](util[_0xbf34('0x19')]('[%s][index][musiconholdstart]',_0x4f0c8d['uniqueid']),_0x4f0c8d);queues[_0xbf34('0x28')](_0x4f0c8d);calls[_0xbf34('0x28')](_0x4f0c8d);}catch(_0xa8bed9){utils[_0xbf34('0x14')](util[_0xbf34('0x19')](_0xbf34('0x29'),_0x4f0c8d[_0xbf34('0x1d')]),_0xa8bed9);}});ami['on'](_0xbf34('0x2a'),function(_0x37777f){try{utils[_0xbf34('0x18')](util[_0xbf34('0x19')](_0xbf34('0x2b'),_0x37777f[_0xbf34('0x1d')]),_0x37777f);queues[_0xbf34('0x2a')](_0x37777f);calls[_0xbf34('0x2a')](_0x37777f);}catch(_0x8d4d49){utils['error'](util[_0xbf34('0x19')]('[%s][index][musiconholdstop]',_0x37777f[_0xbf34('0x1d')]),_0x8d4d49);}});ami['on']('newstate',function(_0x57d152){try{utils[_0xbf34('0x18')](util[_0xbf34('0x19')]('[%s][index][newstate]',_0x57d152[_0xbf34('0x1d')]),_0x57d152);calls[_0xbf34('0x2c')](_0x57d152);recordings['newstate'](_0x57d152);}catch(_0x4089fd){utils[_0xbf34('0x14')](util[_0xbf34('0x19')](_0xbf34('0x2d'),_0x57d152[_0xbf34('0x1d')]),_0x4089fd);}});ami['on']('hangup',function(_0x4cb3b6){try{utils['debug'](util[_0xbf34('0x19')](_0xbf34('0x2e'),_0x4cb3b6['uniqueid']),_0x4cb3b6);calls[_0xbf34('0x2f')](_0x4cb3b6);recordings[_0xbf34('0x2f')](_0x4cb3b6);dials[_0xbf34('0x2f')](_0x4cb3b6);agents[_0xbf34('0x2f')](_0x4cb3b6);queues[_0xbf34('0x2f')](_0x4cb3b6);}catch(_0x8d4b0b){utils[_0xbf34('0x14')](util[_0xbf34('0x19')]('[%s][index][hangup]',_0x4cb3b6[_0xbf34('0x1d')]),_0x8d4b0b);}});ami['on'](_0xbf34('0x30'),function(_0x22e446){try{utils[_0xbf34('0x18')](util[_0xbf34('0x19')](_0xbf34('0x31'),_0x22e446[_0xbf34('0x1d')]),_0x22e446);members['cdr'](_0x22e446);}catch(_0xa03fcc){utils[_0xbf34('0x14')](util['format'](_0xbf34('0x31'),_0x22e446[_0xbf34('0x1d')]),_0xa03fcc);}});ami['on']('blindtransfer',function(_0x5dde73){try{utils['debug'](util[_0xbf34('0x19')](_0xbf34('0x32'),_0x5dde73['uniqueid']),_0x5dde73);queues['blindtransfer'](_0x5dde73);agents[_0xbf34('0x33')](_0x5dde73);transfers[_0xbf34('0x33')](_0x5dde73);}catch(_0x419351){utils['error'](util[_0xbf34('0x19')](_0xbf34('0x32'),_0x5dde73[_0xbf34('0x1d')]),_0x419351);}});ami['on'](_0xbf34('0x34'),function(_0x4e287e){try{utils[_0xbf34('0x18')](util['format'](_0xbf34('0x35'),_0x4e287e['origtransfereruniqueid']),_0x4e287e);queues[_0xbf34('0x34')](_0x4e287e);transfers[_0xbf34('0x34')](_0x4e287e);agents[_0xbf34('0x34')](_0x4e287e);calls['attendedtransfer'](_0x4e287e);}catch(_0xb5052){utils[_0xbf34('0x14')](util[_0xbf34('0x19')](_0xbf34('0x35'),_0x4e287e[_0xbf34('0x36')]),_0xb5052);}});ami['on'](_0xbf34('0x37'),function(_0x8ca9a5){try{utils[_0xbf34('0x18')](util[_0xbf34('0x19')](_0xbf34('0x38'),_0x8ca9a5[_0xbf34('0x1d')]),_0x8ca9a5);queues['varset'](_0x8ca9a5);recordings[_0xbf34('0x37')](_0x8ca9a5);calls[_0xbf34('0x37')](_0x8ca9a5);dials['varset'](_0x8ca9a5);}catch(_0x5d349b){utils[_0xbf34('0x14')](util['format'](_0xbf34('0x38'),_0x8ca9a5['uniqueid']),_0x5d349b);}});ami['on'](_0xbf34('0x39'),function(_0x4e99f4){try{utils[_0xbf34('0x18')](util[_0xbf34('0x19')](_0xbf34('0x3a'),_0x4e99f4[_0xbf34('0x1d')]),_0x4e99f4);calls[_0xbf34('0x39')](_0x4e99f4);recordings['newexten'](_0x4e99f4);dials[_0xbf34('0x39')](_0x4e99f4);}catch(_0x3da431){utils[_0xbf34('0x14')](util[_0xbf34('0x19')](_0xbf34('0x3a'),_0x4e99f4[_0xbf34('0x1d')]),_0x3da431);}});ami['on'](_0xbf34('0x3b'),function(_0x505acb){try{utils[_0xbf34('0x18')](util[_0xbf34('0x19')](_0xbf34('0x3c'),_0x505acb['uniqueid']),_0x505acb);calls['newchannel'](_0x505acb);recordings['newchannel'](_0x505acb);}catch(_0x295bf8){utils['error'](util[_0xbf34('0x19')](_0xbf34('0x3c'),_0x505acb[_0xbf34('0x1d')]),_0x295bf8);}});ami['on']('dialbegin',function(_0x1d8d5b){try{utils['debug'](util['format'](_0xbf34('0x3d'),_0x1d8d5b[_0xbf34('0x1d')]),_0x1d8d5b);dials[_0xbf34('0x3e')](_0x1d8d5b);}catch(_0xdf97a1){utils[_0xbf34('0x14')](util[_0xbf34('0x19')](_0xbf34('0x3f'),_0x1d8d5b['uniqueid']),_0xdf97a1);}});ami['on'](_0xbf34('0x40'),function(_0xd33437){try{utils[_0xbf34('0x18')](util[_0xbf34('0x19')](_0xbf34('0x41'),_0xd33437['uniqueid']),_0xd33437);dials[_0xbf34('0x40')](_0xd33437);}catch(_0xa8d4c0){utils['error'](util[_0xbf34('0x19')](_0xbf34('0x41'),_0xd33437['uniqueid']),_0xa8d4c0);}});} \ No newline at end of file +var _0x3585=['shutdown','fullybooted','close','managerevent','format','device','devicestatechange','error','[%s][index][devicestatechange]','agentcalled','debug','uniqueid','[%s][index][agentringnoanswer]','agentconnect','agentcomplete','[%s][index][agentcomplete]','[%s][index][queuecallerabandon]','queuecallerabandon','queuecallerjoin','[%s][index][queuecallerjoin]','[%s][index][queuecallerleave]','queuecallerleave','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','[%s][index][varset]','varset','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','util','asterisk','username','password','keepConnected','xdr','info','XDR\x20DISABLED','./calls.controller','./members.controller','./dials.controller','./transfers.controller','connect'];(function(_0x1a538f,_0x26124a){var _0x391040=function(_0xa0dad7){while(--_0xa0dad7){_0x1a538f['push'](_0x1a538f['shift']());}};_0x391040(++_0x26124a);}(_0x3585,0x6e));var _0x5358=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3585[_0x3dd15e];return _0x231fd0;};var AsteriskManager=require(_0x5358('0x0'));var config=require(_0x5358('0x1'));var utils=require(_0x5358('0x2'));var util=require(_0x5358('0x3'));var ami=new AsteriskManager(config['asterisk']['port'],config['asterisk']['ip'],config[_0x5358('0x4')][_0x5358('0x5')],config[_0x5358('0x4')][_0x5358('0x6')],!![]);ami[_0x5358('0x7')]();if(config[_0x5358('0x8')]&&config[_0x5358('0x8')]['disabled']){utils[_0x5358('0x9')](_0x5358('0xa'));}else{var agents=require('./agents.controller');var calls=require(_0x5358('0xb'));var queues=require('./queues.controller');var recordings=require('./recordings.controller');var members=require(_0x5358('0xc'));var dials=require(_0x5358('0xd'));var transfers=require(_0x5358('0xe'));var core=require('./core.controller');ami['on'](_0x5358('0xf'),core[_0x5358('0xf')]);ami['on'](_0x5358('0x10'),core[_0x5358('0x10')]);ami['on'](_0x5358('0x11'),core[_0x5358('0x11')]);ami['on']('error',core['error']);ami['on'](_0x5358('0x12'),core['close']);ami['on'](_0x5358('0x13'),core['managerevent']);ami['on']('devicestatechange',function(_0x1c4a7d){try{utils['debug'](util[_0x5358('0x14')]('[%s][index][devicestatechange]',_0x1c4a7d[_0x5358('0x15')]),_0x1c4a7d);members[_0x5358('0x16')](_0x1c4a7d);}catch(_0x218197){utils[_0x5358('0x17')](util[_0x5358('0x14')](_0x5358('0x18'),_0x1c4a7d[_0x5358('0x15')]),_0x218197);}});ami['on'](_0x5358('0x19'),function(_0x1a0f5e){try{utils[_0x5358('0x1a')](util[_0x5358('0x14')]('[%s][index][agentcalled]',_0x1a0f5e[_0x5358('0x1b')]),_0x1a0f5e);agents['agentcalled'](_0x1a0f5e);}catch(_0xc26d52){utils[_0x5358('0x17')](util[_0x5358('0x14')]('[%s][index][agentcalled]',_0x1a0f5e[_0x5358('0x1b')]),_0xc26d52);}});ami['on']('agentringnoanswer',function(_0x4257fa){try{utils['debug'](util[_0x5358('0x14')]('[%s][index][agentringnoanswer]',_0x4257fa['uniqueid']),_0x4257fa);agents['agentringnoanswer'](_0x4257fa);}catch(_0x1ff3c8){utils[_0x5358('0x17')](util[_0x5358('0x14')](_0x5358('0x1c'),_0x4257fa['uniqueid']),_0x1ff3c8);}});ami['on'](_0x5358('0x1d'),function(_0x2f0086){try{utils[_0x5358('0x1a')](util[_0x5358('0x14')]('[%s][index][agentconnect]',_0x2f0086[_0x5358('0x1b')]),_0x2f0086);agents[_0x5358('0x1d')](_0x2f0086);queues[_0x5358('0x1d')](_0x2f0086);}catch(_0x2b4726){utils[_0x5358('0x17')](util[_0x5358('0x14')]('[%s][index][agentconnect]',_0x2f0086[_0x5358('0x1b')]),_0x2b4726);}});ami['on'](_0x5358('0x1e'),function(_0x2cce3d){try{utils['debug'](util[_0x5358('0x14')](_0x5358('0x1f'),_0x2cce3d['uniqueid']),_0x2cce3d);agents[_0x5358('0x1e')](_0x2cce3d);queues[_0x5358('0x1e')](_0x2cce3d);members[_0x5358('0x1e')](_0x2cce3d);}catch(_0x2f7a3){utils['error'](util[_0x5358('0x14')](_0x5358('0x1f'),_0x2cce3d[_0x5358('0x1b')]),_0x2f7a3);}});ami['on']('queuecallerabandon',function(_0x57459a){try{utils['debug'](util['format'](_0x5358('0x20'),_0x57459a[_0x5358('0x1b')]),_0x57459a);agents['queuecallerabandon'](_0x57459a);queues[_0x5358('0x21')](_0x57459a);}catch(_0x1bd805){utils[_0x5358('0x17')](util[_0x5358('0x14')]('[%s][index][queuecallerabandon]',_0x57459a[_0x5358('0x1b')]),_0x1bd805);}});ami['on'](_0x5358('0x22'),function(_0x3c894b){try{utils['debug'](util[_0x5358('0x14')](_0x5358('0x23'),_0x3c894b[_0x5358('0x1b')]),_0x3c894b);queues[_0x5358('0x22')](_0x3c894b);recordings[_0x5358('0x22')](_0x3c894b);}catch(_0xb8ff96){utils[_0x5358('0x17')](util[_0x5358('0x14')](_0x5358('0x23'),_0x3c894b['uniqueid']),_0xb8ff96);}});ami['on']('queuecallerleave',function(_0x244bc7){try{utils[_0x5358('0x1a')](util[_0x5358('0x14')](_0x5358('0x24'),_0x244bc7[_0x5358('0x1b')]),_0x244bc7);queues[_0x5358('0x25')](_0x244bc7);}catch(_0x310dd8){utils[_0x5358('0x17')](util[_0x5358('0x14')](_0x5358('0x24'),_0x244bc7['uniqueid']),_0x310dd8);}});ami['on'](_0x5358('0x26'),function(_0x500524){try{utils[_0x5358('0x1a')](util[_0x5358('0x14')](_0x5358('0x27'),_0x500524['uniqueid']),_0x500524);queues[_0x5358('0x26')](_0x500524);calls[_0x5358('0x26')](_0x500524);}catch(_0x303528){utils['error'](util[_0x5358('0x14')](_0x5358('0x27'),_0x500524[_0x5358('0x1b')]),_0x303528);}});ami['on'](_0x5358('0x28'),function(_0x392223){try{utils['debug'](util[_0x5358('0x14')]('[%s][index][musiconholdstop]',_0x392223[_0x5358('0x1b')]),_0x392223);queues[_0x5358('0x28')](_0x392223);calls[_0x5358('0x28')](_0x392223);}catch(_0x561d48){utils['error'](util['format'](_0x5358('0x29'),_0x392223[_0x5358('0x1b')]),_0x561d48);}});ami['on'](_0x5358('0x2a'),function(_0x24930b){try{utils[_0x5358('0x1a')](util[_0x5358('0x14')]('[%s][index][newstate]',_0x24930b[_0x5358('0x1b')]),_0x24930b);calls[_0x5358('0x2a')](_0x24930b);recordings[_0x5358('0x2a')](_0x24930b);}catch(_0x555d39){utils['error'](util[_0x5358('0x14')](_0x5358('0x2b'),_0x24930b[_0x5358('0x1b')]),_0x555d39);}});ami['on'](_0x5358('0x2c'),function(_0x18881d){try{utils['debug'](util[_0x5358('0x14')]('[%s][index][hangup]',_0x18881d[_0x5358('0x1b')]),_0x18881d);calls[_0x5358('0x2c')](_0x18881d);recordings[_0x5358('0x2c')](_0x18881d);dials[_0x5358('0x2c')](_0x18881d);agents['hangup'](_0x18881d);queues['hangup'](_0x18881d);}catch(_0x467640){utils[_0x5358('0x17')](util[_0x5358('0x14')](_0x5358('0x2d'),_0x18881d[_0x5358('0x1b')]),_0x467640);}});ami['on']('cdr',function(_0x2be617){try{utils['debug'](util[_0x5358('0x14')]('[%s][index][cdr]',_0x2be617['uniqueid']),_0x2be617);members[_0x5358('0x2e')](_0x2be617);}catch(_0x3748dd){utils[_0x5358('0x17')](util['format'](_0x5358('0x2f'),_0x2be617['uniqueid']),_0x3748dd);}});ami['on'](_0x5358('0x30'),function(_0x4ed76e){try{utils['debug'](util[_0x5358('0x14')]('[%s][index][blindtransfer]',_0x4ed76e['uniqueid']),_0x4ed76e);queues[_0x5358('0x30')](_0x4ed76e);agents[_0x5358('0x30')](_0x4ed76e);transfers[_0x5358('0x30')](_0x4ed76e);}catch(_0x3781ab){utils['error'](util[_0x5358('0x14')](_0x5358('0x31'),_0x4ed76e[_0x5358('0x1b')]),_0x3781ab);}});ami['on'](_0x5358('0x32'),function(_0x1d42e3){try{utils['debug'](util[_0x5358('0x14')](_0x5358('0x33'),_0x1d42e3[_0x5358('0x34')]),_0x1d42e3);queues[_0x5358('0x32')](_0x1d42e3);transfers['attendedtransfer'](_0x1d42e3);agents[_0x5358('0x32')](_0x1d42e3);calls[_0x5358('0x32')](_0x1d42e3);}catch(_0x52d48f){utils[_0x5358('0x17')](util[_0x5358('0x14')](_0x5358('0x33'),_0x1d42e3[_0x5358('0x34')]),_0x52d48f);}});ami['on']('varset',function(_0x1967fc){try{utils[_0x5358('0x1a')](util[_0x5358('0x14')](_0x5358('0x35'),_0x1967fc[_0x5358('0x1b')]),_0x1967fc);queues[_0x5358('0x36')](_0x1967fc);recordings[_0x5358('0x36')](_0x1967fc);calls[_0x5358('0x36')](_0x1967fc);dials['varset'](_0x1967fc);}catch(_0x4b20fc){utils['error'](util[_0x5358('0x14')](_0x5358('0x35'),_0x1967fc[_0x5358('0x1b')]),_0x4b20fc);}});ami['on'](_0x5358('0x37'),function(_0x306a90){try{utils[_0x5358('0x1a')](util['format'](_0x5358('0x38'),_0x306a90[_0x5358('0x1b')]),_0x306a90);calls[_0x5358('0x37')](_0x306a90);recordings[_0x5358('0x37')](_0x306a90);dials[_0x5358('0x37')](_0x306a90);}catch(_0x419246){utils[_0x5358('0x17')](util['format'](_0x5358('0x38'),_0x306a90[_0x5358('0x1b')]),_0x419246);}});ami['on'](_0x5358('0x39'),function(_0x858c38){try{utils[_0x5358('0x1a')](util[_0x5358('0x14')](_0x5358('0x3a'),_0x858c38['uniqueid']),_0x858c38);calls[_0x5358('0x39')](_0x858c38);recordings[_0x5358('0x39')](_0x858c38);}catch(_0xfb3581){utils[_0x5358('0x17')](util['format'](_0x5358('0x3a'),_0x858c38[_0x5358('0x1b')]),_0xfb3581);}});ami['on'](_0x5358('0x3b'),function(_0x1b1c1f){try{utils[_0x5358('0x1a')](util[_0x5358('0x14')]('[%s][index][dialbegin]',_0x1b1c1f[_0x5358('0x1b')]),_0x1b1c1f);dials[_0x5358('0x3b')](_0x1b1c1f);}catch(_0x341047){utils[_0x5358('0x17')](util['format'](_0x5358('0x3c'),_0x1b1c1f['uniqueid']),_0x341047);}});ami['on'](_0x5358('0x3d'),function(_0x4364d5){try{utils[_0x5358('0x1a')](util[_0x5358('0x14')](_0x5358('0x3e'),_0x4364d5[_0x5358('0x1b')]),_0x4364d5);dials[_0x5358('0x3d')](_0x4364d5);}catch(_0x4f0f3f){utils[_0x5358('0x17')](util[_0x5358('0x14')]('[%s][index][dialend]',_0x4364d5[_0x5358('0x1b')]),_0x4f0f3f);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 253ba03..c1f1779 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 _0x435a=['state','INUSE','BUSY','now','agent','NOT_INUSE','isNil','exitAt','duration','diffTime','enterAt','[%s][members][devicestatechange]','agentcomplete','debug','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','cdr','channel','data1','data2','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','assign','[%s][members][cdr]','lodash','util','./utils','Local/_attended@transfer','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','membername','type','then','name','internal','request','CreateMemberReport','split','error','[%s][members][writeDB]','some','startsWith','devicestatechange','device','info'];(function(_0x55fac4,_0x25d6d9){var _0x5e13a9=function(_0x1d9cc5){while(--_0x1d9cc5){_0x55fac4['push'](_0x55fac4['shift']());}};_0x5e13a9(++_0x25d6d9);}(_0x435a,0x181));var _0xa435=function(_0xb51ff2,_0x1b6283){_0xb51ff2=_0xb51ff2-0x0;var _0x565ad7=_0x435a[_0xb51ff2];return _0x565ad7;};'use strict';var _=require(_0xa435('0x0'));var util=require(_0xa435('0x1'));var utils=require(_0xa435('0x2'));var members={};var exclude=[_0xa435('0x3'),'Queue:'];function writeDB(_0x5c211b){utils['info'](util[_0xa435('0x4')](_0xa435('0x5'),_0x5c211b[_0xa435('0x6')],_0x5c211b[_0xa435('0x7')],_0x5c211b['channel'],_0x5c211b['data2'],_0x5c211b[_0xa435('0x8')],_0x5c211b[_0xa435('0x9')]));if(_0x5c211b[_0xa435('0x7')]){utils['getUserByInterface'](_0x5c211b[_0xa435('0x7')])[_0xa435('0xa')](function(_0x1d881d){if(_0x1d881d){_0x5c211b[_0xa435('0x8')]=_0x1d881d[_0xa435('0xb')];_0x5c211b[_0xa435('0xc')]=_0x1d881d[_0xa435('0xc')];utils[_0xa435('0xd')](_0xa435('0xe'),_0x5c211b);}else{utils['getUserByName'](_0x5c211b[_0xa435('0x7')][_0xa435('0xf')]('/')[0x1])[_0xa435('0xa')](function(_0x37bf82){if(_0x37bf82){_0x5c211b[_0xa435('0x8')]=_0x37bf82[_0xa435('0xb')];_0x5c211b[_0xa435('0xc')]=_0x37bf82[_0xa435('0xc')];utils[_0xa435('0xd')](_0xa435('0xe'),_0x5c211b);}});}})['catch'](function(_0x33639d){utils[_0xa435('0x10')](util[_0xa435('0x4')](_0xa435('0x11'),_0x5c211b['uniqueid']),_0x33639d);});}delete members[_0x5c211b[_0xa435('0x7')]];}function startsWith(_0x1b75f5,_0x437b6f){return _[_0xa435('0x12')](_0x1b75f5,function(_0x56c2df){return _[_0xa435('0x13')](_0x437b6f,_0x56c2df);});}exports[_0xa435('0x14')]=function(_0x4f2743){try{utils['debug'](util['format']('[%s][members][devicestatechange]',members[_0x4f2743[_0xa435('0x15')]]?members[_0x4f2743[_0xa435('0x15')]][_0xa435('0x6')]:_0x4f2743['device']),_0x4f2743);utils[_0xa435('0x16')](util[_0xa435('0x4')]('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x4f2743[_0xa435('0x15')]]?members[_0x4f2743['device']][_0xa435('0x6')]:_0x4f2743[_0xa435('0x15')],_0x4f2743[_0xa435('0x17')],_0x4f2743[_0xa435('0x15')]));switch(_0x4f2743[_0xa435('0x17')]){case _0xa435('0x18'):case _0xa435('0x19'):if(!startsWith(exclude,_0x4f2743['device'])){members[_0x4f2743[_0xa435('0x15')]]={'channel':'voice','interface':_0x4f2743[_0xa435('0x15')],'type':'TALKING','enterAt':utils[_0xa435('0x1a')](),'role':_0xa435('0x1b')};}break;case _0xa435('0x1c'):if(!_[_0xa435('0x1d')](members[_0x4f2743[_0xa435('0x15')]])){members[_0x4f2743[_0xa435('0x15')]][_0xa435('0x1e')]=utils[_0xa435('0x1a')]();members[_0x4f2743['device']][_0xa435('0x1f')]=utils[_0xa435('0x20')](members[_0x4f2743['device']][_0xa435('0x1e')],members[_0x4f2743['device']][_0xa435('0x21')]);if(members[_0x4f2743['device']][_0xa435('0x6')]){writeDB(members[_0x4f2743[_0xa435('0x15')]]);}}break;default:break;}}catch(_0x11a50f){utils[_0xa435('0x10')](util['format'](_0xa435('0x22'),members[_0x4f2743[_0xa435('0x15')]]?members[_0x4f2743['device']][_0xa435('0x6')]:_0x4f2743[_0xa435('0x15')]),_0x11a50f);}};exports[_0xa435('0x23')]=function(_0x3255de){try{if(!_[_0xa435('0x1d')](members[_0x3255de[_0xa435('0x7')]])){utils[_0xa435('0x24')](util['format'](_0xa435('0x25'),_0x3255de[_0xa435('0x6')]),_0x3255de);utils[_0xa435('0x16')](util[_0xa435('0x4')](_0xa435('0x26'),_0x3255de[_0xa435('0x6')],_0x3255de[_0xa435('0x7')],_0x3255de[_0xa435('0x27')]));members[_0x3255de[_0xa435('0x7')]]=_['assign'](members[_0x3255de[_0xa435('0x7')]],{'data4':_0x3255de[_0xa435('0x27')],'uniqueid':_0x3255de[_0xa435('0x6')]});}}catch(_0x547aaf){utils[_0xa435('0x10')](util[_0xa435('0x4')](_0xa435('0x25'),_0x3255de['uniqueid']),_0x547aaf);}};exports[_0xa435('0x28')]=function(_0x47eea5){try{utils[_0xa435('0x24')](util[_0xa435('0x4')]('[%s][members][cdr]',_0x47eea5[_0xa435('0x6')]),_0x47eea5);if(_0x47eea5[_0xa435('0x29')]){var _0x5c8334=_0x47eea5['channel'][_0xa435('0xf')]('-')[0x0];if(!_[_0xa435('0x1d')](members[_0x5c8334])){members[_0x5c8334]=_['assign'](members[_0x5c8334],{'data1':members[_0x5c8334][_0xa435('0x2a')]||_0x47eea5[_0xa435('0x9')],'data2':members[_0x5c8334][_0xa435('0x2b')]||_0x47eea5[_0xa435('0x2c')],'data3':members[_0x5c8334][_0xa435('0x2d')]||_0x47eea5[_0xa435('0x2e')],'uniqueid':members[_0x5c8334][_0xa435('0x6')]||_0x47eea5['uniqueid']});utils[_0xa435('0x16')](util['format'](_0xa435('0x2f'),_0x47eea5[_0xa435('0x6')],members[_0x5c8334]['data1'],members[_0x5c8334][_0xa435('0x2b')],members[_0x5c8334]['data3']));if(members[_0x5c8334]['exitAt']){writeDB(members[_0x5c8334]);}}}if(_0x47eea5[_0xa435('0x30')]){var _0x57e25a=_0x47eea5[_0xa435('0x30')][_0xa435('0xf')]('-')[0x0];if(!_[_0xa435('0x1d')](members[_0x57e25a])){members[_0x57e25a]=_[_0xa435('0x31')](members[_0x57e25a],{'data1':members[_0x57e25a][_0xa435('0x2a')]||_0x47eea5['type'],'data2':members[_0x57e25a]['data2']||_0x47eea5[_0xa435('0x2c')],'data3':members[_0x57e25a]['data3']||_0x47eea5[_0xa435('0x2e')],'uniqueid':members[_0x57e25a]['uniqueid']||_0x47eea5[_0xa435('0x6')]});utils[_0xa435('0x16')](util[_0xa435('0x4')](_0xa435('0x2f'),_0x47eea5[_0xa435('0x6')],members[_0x57e25a]['data1'],members[_0x57e25a][_0xa435('0x2b')],members[_0x57e25a][_0xa435('0x2d')]));if(members[_0x57e25a][_0xa435('0x1e')]){writeDB(members[_0x57e25a]);}}}}catch(_0x281413){utils[_0xa435('0x10')](util[_0xa435('0x4')](_0xa435('0x32'),_0x47eea5[_0xa435('0x6')]),_0x281413);}}; \ No newline at end of file +var _0x2242=['queue','error','[%s][members][agentcomplete]','cdr','[%s][members][cdr]','assign','data1','data3','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','destination','lodash','util','./utils','Queue:','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','interface','channel','data2','type','getUserByInterface','then','membername','name','internal','request','CreateMemberReport','getUserByName','split','catch','[%s][members][writeDB]','some','startsWith','devicestatechange','debug','[%s][members][devicestatechange]','device','uniqueid','info','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','voice','TALKING','now','agent','NOT_INUSE','isNil','exitAt','agentcomplete','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x2242,0x1a3));var _0x2224=function(_0x31b023,_0x33f225){_0x31b023=_0x31b023-0x0;var _0x1498f9=_0x2242[_0x31b023];return _0x1498f9;};'use strict';var _=require(_0x2224('0x0'));var util=require(_0x2224('0x1'));var utils=require(_0x2224('0x2'));var members={};var exclude=['Local/_attended@transfer',_0x2224('0x3')];function writeDB(_0x317565){utils['info'](util[_0x2224('0x4')](_0x2224('0x5'),_0x317565['uniqueid'],_0x317565[_0x2224('0x6')],_0x317565[_0x2224('0x7')],_0x317565[_0x2224('0x8')],_0x317565['membername'],_0x317565[_0x2224('0x9')]));if(_0x317565[_0x2224('0x6')]){utils[_0x2224('0xa')](_0x317565[_0x2224('0x6')])[_0x2224('0xb')](function(_0x1d3c0e){if(_0x1d3c0e){_0x317565[_0x2224('0xc')]=_0x1d3c0e[_0x2224('0xd')];_0x317565[_0x2224('0xe')]=_0x1d3c0e[_0x2224('0xe')];utils[_0x2224('0xf')](_0x2224('0x10'),_0x317565);}else{utils[_0x2224('0x11')](_0x317565[_0x2224('0x6')][_0x2224('0x12')]('/')[0x1])['then'](function(_0x54e6da){if(_0x54e6da){_0x317565[_0x2224('0xc')]=_0x54e6da[_0x2224('0xd')];_0x317565[_0x2224('0xe')]=_0x54e6da[_0x2224('0xe')];utils['request'](_0x2224('0x10'),_0x317565);}});}})[_0x2224('0x13')](function(_0x4bee99){utils['error'](util[_0x2224('0x4')](_0x2224('0x14'),_0x317565['uniqueid']),_0x4bee99);});}delete members[_0x317565['interface']];}function startsWith(_0x2a5845,_0x2596e0){return _[_0x2224('0x15')](_0x2a5845,function(_0x28956b){return _[_0x2224('0x16')](_0x2596e0,_0x28956b);});}exports[_0x2224('0x17')]=function(_0x34d045){try{utils[_0x2224('0x18')](util['format'](_0x2224('0x19'),members[_0x34d045[_0x2224('0x1a')]]?members[_0x34d045[_0x2224('0x1a')]][_0x2224('0x1b')]:_0x34d045[_0x2224('0x1a')]),_0x34d045);utils[_0x2224('0x1c')](util[_0x2224('0x4')](_0x2224('0x1d'),members[_0x34d045[_0x2224('0x1a')]]?members[_0x34d045[_0x2224('0x1a')]][_0x2224('0x1b')]:_0x34d045[_0x2224('0x1a')],_0x34d045[_0x2224('0x1e')],_0x34d045[_0x2224('0x1a')]));switch(_0x34d045[_0x2224('0x1e')]){case'INUSE':case'BUSY':if(!startsWith(exclude,_0x34d045[_0x2224('0x1a')])){members[_0x34d045[_0x2224('0x1a')]]={'channel':_0x2224('0x1f'),'interface':_0x34d045[_0x2224('0x1a')],'type':_0x2224('0x20'),'enterAt':utils[_0x2224('0x21')](),'role':_0x2224('0x22')};}break;case _0x2224('0x23'):if(!_[_0x2224('0x24')](members[_0x34d045[_0x2224('0x1a')]])){members[_0x34d045[_0x2224('0x1a')]][_0x2224('0x25')]=utils['now']();members[_0x34d045[_0x2224('0x1a')]]['duration']=utils['diffTime'](members[_0x34d045[_0x2224('0x1a')]][_0x2224('0x25')],members[_0x34d045['device']]['enterAt']);if(members[_0x34d045[_0x2224('0x1a')]][_0x2224('0x1b')]){writeDB(members[_0x34d045['device']]);}}break;default:break;}}catch(_0x408521){utils['error'](util[_0x2224('0x4')](_0x2224('0x19'),members[_0x34d045[_0x2224('0x1a')]]?members[_0x34d045[_0x2224('0x1a')]][_0x2224('0x1b')]:_0x34d045['device']),_0x408521);}};exports[_0x2224('0x26')]=function(_0x5bb00f){try{if(!_['isNil'](members[_0x5bb00f[_0x2224('0x6')]])){utils['debug'](util[_0x2224('0x4')]('[%s][members][agentcomplete]',_0x5bb00f['uniqueid']),_0x5bb00f);utils['info'](util[_0x2224('0x4')](_0x2224('0x27'),_0x5bb00f[_0x2224('0x1b')],_0x5bb00f[_0x2224('0x6')],_0x5bb00f['queue']));members[_0x5bb00f[_0x2224('0x6')]]=_['assign'](members[_0x5bb00f[_0x2224('0x6')]],{'data4':_0x5bb00f[_0x2224('0x28')],'uniqueid':_0x5bb00f[_0x2224('0x1b')]});}}catch(_0x53d0a4){utils[_0x2224('0x29')](util[_0x2224('0x4')](_0x2224('0x2a'),_0x5bb00f[_0x2224('0x1b')]),_0x53d0a4);}};exports[_0x2224('0x2b')]=function(_0x101900){try{utils['debug'](util[_0x2224('0x4')](_0x2224('0x2c'),_0x101900['uniqueid']),_0x101900);if(_0x101900[_0x2224('0x7')]){var _0x14540a=_0x101900[_0x2224('0x7')][_0x2224('0x12')]('-')[0x0];if(!_[_0x2224('0x24')](members[_0x14540a])){members[_0x14540a]=_[_0x2224('0x2d')](members[_0x14540a],{'data1':members[_0x14540a][_0x2224('0x2e')]||_0x101900['type'],'data2':members[_0x14540a][_0x2224('0x8')]||_0x101900['source'],'data3':members[_0x14540a][_0x2224('0x2f')]||_0x101900['destination'],'uniqueid':members[_0x14540a][_0x2224('0x1b')]||_0x101900[_0x2224('0x1b')]});utils['info'](util[_0x2224('0x4')](_0x2224('0x30'),_0x101900['uniqueid'],members[_0x14540a][_0x2224('0x2e')],members[_0x14540a][_0x2224('0x8')],members[_0x14540a]['data3']));if(members[_0x14540a][_0x2224('0x25')]){writeDB(members[_0x14540a]);}}}if(_0x101900[_0x2224('0x31')]){var _0x52a29f=_0x101900[_0x2224('0x31')]['split']('-')[0x0];if(!_[_0x2224('0x24')](members[_0x52a29f])){members[_0x52a29f]=_[_0x2224('0x2d')](members[_0x52a29f],{'data1':members[_0x52a29f][_0x2224('0x2e')]||_0x101900['type'],'data2':members[_0x52a29f][_0x2224('0x8')]||_0x101900['source'],'data3':members[_0x52a29f][_0x2224('0x2f')]||_0x101900[_0x2224('0x32')],'uniqueid':members[_0x52a29f][_0x2224('0x1b')]||_0x101900[_0x2224('0x1b')]});utils['info'](util[_0x2224('0x4')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x101900[_0x2224('0x1b')],members[_0x52a29f][_0x2224('0x2e')],members[_0x52a29f]['data2'],members[_0x52a29f]['data3']));if(members[_0x52a29f][_0x2224('0x25')]){writeDB(members[_0x52a29f]);}}}}catch(_0x54f8ce){utils[_0x2224('0x29')](util[_0x2224('0x4')]('[%s][members][cdr]',_0x101900[_0x2224('0x1b')]),_0x54f8ce);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 32dc8f7..e534e7a 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 _0x7a78=['[%s][queues][varset]','variable','queuestatus','value','CONTINUE','queuecallerabandonAt','queuecallerexitAt','toUpperCase','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','[%s][queues][queuecallerabandon]','ABANDONED','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','holdtime','diffTime','queuecallerjoinAt','count','connectedlinename','agentconnect','[%s][queues][agentconnect]','membername','destaccountcode','assigned','agentcomplete','[%s][queues][agentcomplete]','queuecallercompleteAt','reason','transfer','TRANSFER','COMPLETEDBY','blindtransfer','transfereeuniqueid','BLIND','transferexten','extension','transferuniqueid','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','[%s][queues][blindtransfer]','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','transfertype','transfereelinkedid','transfertargetuniqueid','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','secondtransfererexten','ATTENDEDTRANSFER','transfertargetlinkedid','clone','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]','util','./utils','info','format','uniqueid','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','queue','then','type','request','CreateVoiceQueueReport','transfereduniqueid','debug','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','assign','position','now','error','[%s][queues][queuecallerjoin]','hangup','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','varset'];(function(_0x5581ba,_0x268887){var _0x1e927f=function(_0x1803b2){while(--_0x1803b2){_0x5581ba['push'](_0x5581ba['shift']());}};_0x1e927f(++_0x268887);}(_0x7a78,0x1da));var _0x87a7=function(_0x45016e,_0x9517fb){_0x45016e=_0x45016e-0x0;var _0x260948=_0x7a78[_0x45016e];return _0x260948;};'use strict';var _=require('lodash');var util=require(_0x87a7('0x0'));var utils=require(_0x87a7('0x1'));var queues={};function writeDB(_0x4fa3d7){utils[_0x87a7('0x2')](util[_0x87a7('0x3')]('[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s',_0x4fa3d7[_0x87a7('0x4')],_0x4fa3d7['channel'],_0x4fa3d7['queue'],_0x4fa3d7[_0x87a7('0x5')],_0x4fa3d7[_0x87a7('0x6')],_0x4fa3d7[_0x87a7('0x7')],_0x4fa3d7[_0x87a7('0x8')]));if(_0x4fa3d7['queue']){utils[_0x87a7('0x9')](_0x4fa3d7[_0x87a7('0xa')])[_0x87a7('0xb')](function(_0x3a243a){if(_0x3a243a){_0x4fa3d7[_0x87a7('0xc')]=_0x3a243a[_0x87a7('0xc')];}utils[_0x87a7('0xd')](_0x87a7('0xe'),_0x4fa3d7);});}else{utils[_0x87a7('0xd')]('CreateVoiceQueueReport',_0x4fa3d7);}if(_0x4fa3d7[_0x87a7('0xf')]){delete queues[_0x4fa3d7['transfereduniqueid']];}else{delete queues[_0x4fa3d7[_0x87a7('0x4')]];}}exports['queuecallerjoin']=function(_0x2246a8){try{utils[_0x87a7('0x10')](util[_0x87a7('0x3')]('[%s][queues][queuecallerjoin]',_0x2246a8['uniqueid']),_0x2246a8);utils[_0x87a7('0x2')](util['format'](_0x87a7('0x11'),_0x2246a8[_0x87a7('0x4')],_0x2246a8[_0x87a7('0xa')],_0x2246a8['position']));queues[_0x2246a8['uniqueid']]=_[_0x87a7('0x12')](_0x2246a8,{'originalposition':_0x2246a8[_0x87a7('0x13')],'queuecallerjoinAt':utils[_0x87a7('0x14')](),'mohtime':0x0});}catch(_0x503b08){utils[_0x87a7('0x15')](util[_0x87a7('0x3')](_0x87a7('0x16'),_0x2246a8[_0x87a7('0x4')]),_0x503b08);}};exports[_0x87a7('0x17')]=function(_0x4f6205){try{if(!_[_0x87a7('0x18')](queues[_0x4f6205[_0x87a7('0x4')]])){utils['debug'](util[_0x87a7('0x3')](_0x87a7('0x19'),_0x4f6205[_0x87a7('0x4')]),_0x4f6205);if(queues[_0x4f6205[_0x87a7('0x4')]][_0x87a7('0x1a')]){if(!queues[_0x4f6205[_0x87a7('0x4')]][_0x87a7('0x1b')]&&!queues[_0x4f6205['uniqueid']][_0x87a7('0x1c')]){queues[_0x4f6205['uniqueid']][_0x87a7('0x1d')]=!![];queues[_0x4f6205['uniqueid']]['queuecallercompleteAt']=utils[_0x87a7('0x14')]();queues[_0x4f6205[_0x87a7('0x4')]][_0x87a7('0x8')]=_0x87a7('0x1e');}utils[_0x87a7('0x2')](util[_0x87a7('0x3')](_0x87a7('0x1f'),_0x4f6205[_0x87a7('0x4')],queues[_0x4f6205[_0x87a7('0x4')]][_0x87a7('0x20')],queues[_0x4f6205[_0x87a7('0x4')]][_0x87a7('0x8')]));writeDB(queues[_0x4f6205[_0x87a7('0x4')]]);}else if(queues[_0x4f6205['uniqueid']][_0x87a7('0xf')]){utils[_0x87a7('0x2')](util[_0x87a7('0x3')](_0x87a7('0x21'),_0x4f6205[_0x87a7('0x4')],queues[_0x4f6205[_0x87a7('0x4')]][_0x87a7('0x20')],queues[_0x4f6205[_0x87a7('0x4')]][_0x87a7('0xf')]));queues[queues[_0x4f6205[_0x87a7('0x4')]][_0x87a7('0xf')]]=queues[_0x4f6205[_0x87a7('0x4')]];queues[queues[_0x4f6205[_0x87a7('0x4')]]['transfereduniqueid']][_0x87a7('0x22')]=0x2;delete queues[_0x4f6205[_0x87a7('0x4')]];}}}catch(_0x214946){utils[_0x87a7('0x15')](util[_0x87a7('0x3')]('[%s][queues][hangup]',_0x4f6205[_0x87a7('0x4')]),_0x214946);}};exports[_0x87a7('0x23')]=function(_0x4d01d1){try{utils[_0x87a7('0x10')](util['format'](_0x87a7('0x24'),_0x4d01d1['uniqueid']),_0x4d01d1);if(!_[_0x87a7('0x18')](_0x4d01d1[_0x87a7('0x25')][_0x87a7('0x26')])&&_0x4d01d1[_0x87a7('0x27')]['toUpperCase']()!==_0x87a7('0x28')){if(!_[_0x87a7('0x18')](queues[_0x4d01d1[_0x87a7('0x4')]])){queues[_0x4d01d1[_0x87a7('0x4')]][_0x87a7('0x1b')]=![];queues[_0x4d01d1['uniqueid']][_0x87a7('0x29')]=null;queues[_0x4d01d1['uniqueid']][_0x87a7('0x1c')]=!![];queues[_0x4d01d1['uniqueid']][_0x87a7('0x2a')]=utils[_0x87a7('0x14')]();queues[_0x4d01d1[_0x87a7('0x4')]][_0x87a7('0x8')]=_0x4d01d1[_0x87a7('0x27')][_0x87a7('0x2b')]();utils['info'](util[_0x87a7('0x3')](_0x87a7('0x2c'),_0x4d01d1[_0x87a7('0x4')],queues[_0x4d01d1[_0x87a7('0x4')]]['name'],_0x4d01d1[_0x87a7('0x27')],queues[_0x4d01d1[_0x87a7('0x4')]][_0x87a7('0x8')]));writeDB(queues[_0x4d01d1[_0x87a7('0x4')]]);}}else if(!_[_0x87a7('0x18')](_0x4d01d1[_0x87a7('0x25')][_0x87a7('0x2d')])){if(!_['isNil'](queues[_0x4d01d1['uniqueid']])&&!queues[_0x4d01d1[_0x87a7('0x4')]][_0x87a7('0x1b')]){queues[_0x4d01d1[_0x87a7('0x4')]][_0x87a7('0x1b')]=![];queues[_0x4d01d1[_0x87a7('0x4')]][_0x87a7('0x29')]=null;queues[_0x4d01d1[_0x87a7('0x4')]][_0x87a7('0x1c')]=!![];queues[_0x4d01d1[_0x87a7('0x4')]][_0x87a7('0x2a')]=utils[_0x87a7('0x14')]();queues[_0x4d01d1[_0x87a7('0x4')]]['queuecallerexitreason']='EXITWITHKEY';utils[_0x87a7('0x2')](util['format']('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x4d01d1[_0x87a7('0x4')],queues[_0x4d01d1[_0x87a7('0x4')]][_0x87a7('0x20')],_0x4d01d1[_0x87a7('0x27')],queues[_0x4d01d1[_0x87a7('0x4')]][_0x87a7('0x8')]));}}}catch(_0x59276e){utils['error'](util[_0x87a7('0x3')](_0x87a7('0x24'),_0x4d01d1['uniqueid']),_0x59276e);}};exports['queuecallerabandon']=function(_0x2b7a90){try{if(!_[_0x87a7('0x18')](queues[_0x2b7a90['uniqueid']])){utils[_0x87a7('0x10')](util[_0x87a7('0x3')](_0x87a7('0x2e'),_0x2b7a90[_0x87a7('0x4')]),_0x2b7a90);queues[_0x2b7a90[_0x87a7('0x4')]][_0x87a7('0x1c')]=![];queues[_0x2b7a90[_0x87a7('0x4')]][_0x87a7('0x2a')]=null;queues[_0x2b7a90['uniqueid']][_0x87a7('0x1b')]=!![];queues[_0x2b7a90[_0x87a7('0x4')]][_0x87a7('0x29')]=utils[_0x87a7('0x14')]();queues[_0x2b7a90[_0x87a7('0x4')]][_0x87a7('0x8')]=_0x87a7('0x2f');utils[_0x87a7('0x2')](util[_0x87a7('0x3')]('[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s',_0x2b7a90[_0x87a7('0x4')],queues[_0x2b7a90[_0x87a7('0x4')]][_0x87a7('0x20')],queues[_0x2b7a90[_0x87a7('0x4')]][_0x87a7('0x8')]));}}catch(_0x480102){utils[_0x87a7('0x15')](util[_0x87a7('0x3')](_0x87a7('0x2e'),_0x2b7a90['uniqueid']),_0x480102);}};exports[_0x87a7('0x30')]=function(_0x5e8687){try{if(!_[_0x87a7('0x18')](queues[_0x5e8687[_0x87a7('0x4')]])){utils[_0x87a7('0x10')](util[_0x87a7('0x3')](_0x87a7('0x31'),_0x5e8687['uniqueid']),_0x5e8687);utils[_0x87a7('0x2')](util[_0x87a7('0x3')](_0x87a7('0x32'),_0x5e8687[_0x87a7('0x4')],queues[_0x5e8687[_0x87a7('0x4')]][_0x87a7('0x20')],_0x5e8687[_0x87a7('0x33')],_0x5e8687['connectedlinename']));queues[_0x5e8687[_0x87a7('0x4')]][_0x87a7('0x30')]=!![];queues[_0x5e8687['uniqueid']]['queuecallerleaveAt']=utils['now']();queues[_0x5e8687[_0x87a7('0x4')]][_0x87a7('0x34')]=utils[_0x87a7('0x35')](queues[_0x5e8687[_0x87a7('0x4')]]['queuecallerleaveAt'],queues[_0x5e8687[_0x87a7('0x4')]][_0x87a7('0x36')]);queues[_0x5e8687['uniqueid']][_0x87a7('0x13')]=_0x5e8687['position'];queues[_0x5e8687[_0x87a7('0x4')]][_0x87a7('0x37')]=_0x5e8687['count'];queues[_0x5e8687['uniqueid']][_0x87a7('0x33')]=_0x5e8687['connectedlinenum'];queues[_0x5e8687['uniqueid']]['connectedlinename']=_0x5e8687[_0x87a7('0x38')];}}catch(_0x8a15d){utils[_0x87a7('0x15')](util[_0x87a7('0x3')](_0x87a7('0x31'),_0x5e8687[_0x87a7('0x4')]),_0x8a15d);}};exports[_0x87a7('0x39')]=function(_0x35a646){try{if(!_[_0x87a7('0x18')](queues[_0x35a646[_0x87a7('0x4')]])){utils[_0x87a7('0x10')](util[_0x87a7('0x3')](_0x87a7('0x3a'),_0x35a646['uniqueid']),_0x35a646);utils['info'](util[_0x87a7('0x3')]('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x35a646['uniqueid'],queues[_0x35a646[_0x87a7('0x4')]][_0x87a7('0x20')],_0x35a646[_0x87a7('0x3b')],_0x35a646[_0x87a7('0x3c')]));queues[_0x35a646[_0x87a7('0x4')]]['queuecallerabandon']=![];queues[_0x35a646[_0x87a7('0x4')]][_0x87a7('0x1b')]=![];queues[_0x35a646[_0x87a7('0x4')]][_0x87a7('0x29')]=null;queues[_0x35a646[_0x87a7('0x4')]][_0x87a7('0x1c')]=![];queues[_0x35a646['uniqueid']][_0x87a7('0x8')]=null;queues[_0x35a646['uniqueid']][_0x87a7('0x2a')]=null;queues[_0x35a646[_0x87a7('0x4')]][_0x87a7('0x3d')]=!![];queues[_0x35a646[_0x87a7('0x4')]]['accountcode']=_0x35a646[_0x87a7('0x3c')];queues[_0x35a646[_0x87a7('0x4')]][_0x87a7('0x5')]=_0x35a646[_0x87a7('0x3b')];}}catch(_0x589d3b){utils[_0x87a7('0x15')](util[_0x87a7('0x3')]('[%s][queues][agentconnect]',_0x35a646[_0x87a7('0x4')]),_0x589d3b);}};exports[_0x87a7('0x3e')]=function(_0x372908){try{if(!_['isNil'](queues[_0x372908[_0x87a7('0x4')]])){if(queues[_0x372908[_0x87a7('0x4')]][_0x87a7('0x1a')]){utils['debug'](util[_0x87a7('0x3')](_0x87a7('0x3f'),_0x372908[_0x87a7('0x4')]),_0x372908);queues[_0x372908[_0x87a7('0x4')]][_0x87a7('0x1b')]=![];queues[_0x372908[_0x87a7('0x4')]][_0x87a7('0x1b')]=![];queues[_0x372908[_0x87a7('0x4')]][_0x87a7('0x29')]=null;queues[_0x372908['uniqueid']]['queuecallerexit']=![];queues[_0x372908[_0x87a7('0x4')]]['queuecallerexitAt']=null;queues[_0x372908[_0x87a7('0x4')]][_0x87a7('0x3d')]=!![];queues[_0x372908['uniqueid']][_0x87a7('0x5')]=_0x372908[_0x87a7('0x3b')];queues[_0x372908[_0x87a7('0x4')]][_0x87a7('0x1d')]=!![];queues[_0x372908[_0x87a7('0x4')]][_0x87a7('0x40')]=utils['now']();if(_0x372908[_0x87a7('0x41')]=='transfer'){if(!queues[_0x372908[_0x87a7('0x4')]][_0x87a7('0x42')]){queues[_0x372908['uniqueid']]['queuecallerexitreason']=_0x87a7('0x43');}}else{queues[_0x372908['uniqueid']][_0x87a7('0x8')]=_0x87a7('0x44')+_0x372908[_0x87a7('0x41')][_0x87a7('0x2b')]();}utils[_0x87a7('0x2')](util[_0x87a7('0x3')]('[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s',_0x372908[_0x87a7('0x4')],queues[_0x372908[_0x87a7('0x4')]][_0x87a7('0x20')],_0x372908[_0x87a7('0x3b')],queues[_0x372908[_0x87a7('0x4')]][_0x87a7('0x8')]));writeDB(queues[_0x372908[_0x87a7('0x4')]]);}}}catch(_0x3cfb3d){utils['error'](util[_0x87a7('0x3')](_0x87a7('0x3f'),_0x372908[_0x87a7('0x4')]),_0x3cfb3d);}};exports[_0x87a7('0x45')]=function(_0xcac62d){try{if(!_[_0x87a7('0x18')](queues[_0xcac62d[_0x87a7('0x46')]])){utils[_0x87a7('0x10')](util['format']('[%s][queues][blindtransfer]',_0xcac62d[_0x87a7('0x4')]),_0xcac62d);queues[_0xcac62d[_0x87a7('0x46')]][_0x87a7('0x42')]=!![];queues[_0xcac62d[_0x87a7('0x46')]]['transfertype']=_0x87a7('0x47');queues[_0xcac62d['transfereeuniqueid']][_0x87a7('0x48')]=_0xcac62d[_0x87a7('0x49')];queues[_0xcac62d[_0x87a7('0x46')]][_0x87a7('0x4a')]=_0xcac62d[_0x87a7('0x46')];queues[_0xcac62d[_0x87a7('0x46')]]['queuecallerexitreason']='BLINDTRANSFER';utils['info'](util[_0x87a7('0x3')](_0x87a7('0x4b'),_0xcac62d[_0x87a7('0x4')],queues[_0xcac62d[_0x87a7('0x46')]][_0x87a7('0x20')],_0xcac62d['transfereeuniqueid'],_0xcac62d['extension']));}}catch(_0x38900a){utils[_0x87a7('0x15')](util[_0x87a7('0x3')](_0x87a7('0x4c'),_0xcac62d[_0x87a7('0x4')]),_0x38900a);}};exports[_0x87a7('0x4d')]=function(_0x5aa0e4){try{utils[_0x87a7('0x10')](util[_0x87a7('0x3')](_0x87a7('0x4e'),_0x5aa0e4[_0x87a7('0x4f')]),_0x5aa0e4);if(_0x5aa0e4['origtransfereruniqueid']==_0x5aa0e4[_0x87a7('0x50')]){if(!_[_0x87a7('0x18')](queues[_0x5aa0e4[_0x87a7('0x51')]])){utils['info'](util[_0x87a7('0x3')](_0x87a7('0x52'),_0x5aa0e4[_0x87a7('0x4f')],queues[_0x5aa0e4['secondtransfererlinkedid']][_0x87a7('0x20')],_0x5aa0e4[_0x87a7('0x53')]));queues[_0x5aa0e4[_0x87a7('0x51')]][_0x87a7('0x42')]=!![];queues[_0x5aa0e4[_0x87a7('0x51')]][_0x87a7('0x54')]='ATTENDED';queues[_0x5aa0e4[_0x87a7('0x51')]]['transferexten']=_0x5aa0e4['origtransfererexten'];queues[_0x5aa0e4[_0x87a7('0x51')]][_0x87a7('0x4a')]=_0x5aa0e4[_0x87a7('0x4f')];queues[_0x5aa0e4['secondtransfererlinkedid']][_0x87a7('0x8')]='ATTENDEDTRANSFER';}if(!_[_0x87a7('0x18')](queues[_0x5aa0e4[_0x87a7('0x50')]])){if(_0x5aa0e4[_0x87a7('0x55')]&&queues[_0x5aa0e4[_0x87a7('0x55')]]){queues[_0x5aa0e4[_0x87a7('0x55')]][_0x87a7('0x22')]=0x1;queues[_0x5aa0e4['transfereeuniqueid']]=_['clone'](queues[_0x5aa0e4[_0x87a7('0x55')]]);queues[_0x5aa0e4[_0x87a7('0x46')]][_0x87a7('0xf')]=_0x5aa0e4[_0x87a7('0x56')];queues[_0x5aa0e4['transfereeuniqueid']][_0x87a7('0x22')]=0x2;queues[_0x5aa0e4['transfereeuniqueid']][_0x87a7('0x6')]=queues[_0x5aa0e4['secondtransfererlinkedid']][_0x87a7('0x6')];queues[_0x5aa0e4['transfereeuniqueid']][_0x87a7('0x57')]=queues[_0x5aa0e4[_0x87a7('0x51')]][_0x87a7('0x57')];queues[_0x5aa0e4[_0x87a7('0x46')]][_0x87a7('0x36')]=utils[_0x87a7('0x14')]();queues[_0x5aa0e4[_0x87a7('0x46')]][_0x87a7('0x1a')]=utils[_0x87a7('0x14')]();queues[_0x5aa0e4[_0x87a7('0x46')]]['holdtime']=0x0;queues[_0x5aa0e4[_0x87a7('0x46')]][_0x87a7('0x58')]=0x0;utils[_0x87a7('0x2')](util[_0x87a7('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0x5aa0e4[_0x87a7('0x4f')],queues[_0x5aa0e4[_0x87a7('0x46')]][_0x87a7('0x20')],queues[_0x5aa0e4['transfereeuniqueid']]['calleridnum'],queues[_0x5aa0e4[_0x87a7('0x46')]][_0x87a7('0x57')]));}else{utils[_0x87a7('0x2')](util[_0x87a7('0x3')](_0x87a7('0x59'),_0x5aa0e4['origtransfereruniqueid'],queues[_0x5aa0e4[_0x87a7('0x50')]]['name'],_0x5aa0e4[_0x87a7('0x51')]));queues[_0x5aa0e4['origtransfererlinkedid']]['transfereduniqueid']=_0x5aa0e4[_0x87a7('0x51')];}}}else if(_0x5aa0e4['secondtransfereruniqueid']==_0x5aa0e4[_0x87a7('0x51')]){if(!_['isNil'](queues[_0x5aa0e4[_0x87a7('0x50')]])){utils[_0x87a7('0x2')](util[_0x87a7('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x5aa0e4[_0x87a7('0x4f')],queues[_0x5aa0e4[_0x87a7('0x50')]][_0x87a7('0x20')],_0x5aa0e4[_0x87a7('0x5a')],_0x5aa0e4[_0x87a7('0x5b')]));queues[_0x5aa0e4[_0x87a7('0x50')]][_0x87a7('0x42')]=!![];queues[_0x5aa0e4['origtransfererlinkedid']]['transfertype']='ATTENDED';queues[_0x5aa0e4[_0x87a7('0x50')]][_0x87a7('0x48')]=_0x5aa0e4[_0x87a7('0x5b')];queues[_0x5aa0e4['origtransfererlinkedid']][_0x87a7('0x4a')]=_0x5aa0e4['secondtransfereruniqueid'];queues[_0x5aa0e4['origtransfererlinkedid']][_0x87a7('0x8')]=_0x87a7('0x5c');}if(!_[_0x87a7('0x18')](queues[_0x5aa0e4[_0x87a7('0x51')]])){if(_0x5aa0e4[_0x87a7('0x5d')]&&queues[_0x5aa0e4[_0x87a7('0x5d')]]){queues[_0x5aa0e4[_0x87a7('0x5d')]]['queuecallerenterreason']=0x1;queues[_0x5aa0e4[_0x87a7('0x56')]]=_[_0x87a7('0x5e')](queues[_0x5aa0e4[_0x87a7('0x5d')]]);queues[_0x5aa0e4[_0x87a7('0x56')]][_0x87a7('0xf')]=_0x5aa0e4[_0x87a7('0x56')];queues[_0x5aa0e4[_0x87a7('0x56')]][_0x87a7('0x22')]=0x2;queues[_0x5aa0e4['transfertargetuniqueid']][_0x87a7('0x6')]=queues[_0x5aa0e4[_0x87a7('0x50')]][_0x87a7('0x6')];queues[_0x5aa0e4[_0x87a7('0x56')]][_0x87a7('0x57')]=queues[_0x5aa0e4['origtransfererlinkedid']][_0x87a7('0x57')];queues[_0x5aa0e4[_0x87a7('0x56')]][_0x87a7('0x36')]=utils[_0x87a7('0x14')]();queues[_0x5aa0e4[_0x87a7('0x56')]][_0x87a7('0x1a')]=utils[_0x87a7('0x14')]();queues[_0x5aa0e4[_0x87a7('0x56')]][_0x87a7('0x34')]=0x0;queues[_0x5aa0e4[_0x87a7('0x56')]][_0x87a7('0x58')]=0x0;utils[_0x87a7('0x2')](util['format'](_0x87a7('0x5f'),_0x5aa0e4[_0x87a7('0x4f')],queues[_0x5aa0e4[_0x87a7('0x56')]][_0x87a7('0x20')],queues[_0x5aa0e4['transfertargetuniqueid']]['transfereduniqueid'],queues[_0x5aa0e4[_0x87a7('0x56')]][_0x87a7('0x6')],queues[_0x5aa0e4[_0x87a7('0x56')]][_0x87a7('0x57')]));}else{utils[_0x87a7('0x2')](util[_0x87a7('0x3')](_0x87a7('0x59'),_0x5aa0e4[_0x87a7('0x4f')],queues[_0x5aa0e4[_0x87a7('0x51')]][_0x87a7('0x20')],_0x5aa0e4[_0x87a7('0x50')]));queues[_0x5aa0e4['secondtransfererlinkedid']]['transfereduniqueid']=_0x5aa0e4[_0x87a7('0x50')];}}}}catch(_0x56a8cd){utils[_0x87a7('0x15')](util[_0x87a7('0x3')](_0x87a7('0x4e'),_0x5aa0e4['origtransfereruniqueid']),_0x56a8cd);}};exports[_0x87a7('0x60')]=function(_0x469bb0){try{if(!_[_0x87a7('0x18')](queues[_0x469bb0[_0x87a7('0x4')]])){utils[_0x87a7('0x10')](util[_0x87a7('0x3')](_0x87a7('0x61'),_0x469bb0[_0x87a7('0x4')]),_0x469bb0);queues[_0x469bb0[_0x87a7('0x4')]][_0x87a7('0x62')]=utils[_0x87a7('0x14')]();utils['info'](util[_0x87a7('0x3')](_0x87a7('0x63'),_0x469bb0[_0x87a7('0x4')],queues[_0x469bb0[_0x87a7('0x4')]][_0x87a7('0x20')],queues[_0x469bb0['uniqueid']][_0x87a7('0x62')]));}}catch(_0x4233b9){utils[_0x87a7('0x15')](util[_0x87a7('0x3')]('[%s][queues][musiconholdstart]',_0x469bb0[_0x87a7('0x4')]),_0x4233b9);}};exports[_0x87a7('0x64')]=function(_0x49b5f3){try{if(!_['isNil'](queues[_0x49b5f3[_0x87a7('0x4')]])){if(!_[_0x87a7('0x18')](queues[_0x49b5f3[_0x87a7('0x4')]][_0x87a7('0x62')])){utils[_0x87a7('0x10')](util['format'](_0x87a7('0x65'),_0x49b5f3[_0x87a7('0x4')]),_0x49b5f3);queues[_0x49b5f3[_0x87a7('0x4')]]['mohtime']+=utils[_0x87a7('0x35')](utils['now'](),queues[_0x49b5f3[_0x87a7('0x4')]][_0x87a7('0x62')]);utils[_0x87a7('0x2')](util[_0x87a7('0x3')]('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0x49b5f3[_0x87a7('0x4')],queues[_0x49b5f3[_0x87a7('0x4')]]['name'],queues[_0x49b5f3[_0x87a7('0x4')]][_0x87a7('0x58')]));delete queues[_0x49b5f3[_0x87a7('0x4')]][_0x87a7('0x62')];}}}catch(_0x9d527c){utils['error'](util[_0x87a7('0x3')](_0x87a7('0x65'),_0x49b5f3[_0x87a7('0x4')]),_0x9d527c);}}; \ No newline at end of file +var _0xa219=['secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','[%s][queues][attendedtransfer]','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','[%s][queues][musiconholdstop]','diffTime','[%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','uniqueid','queue','lastAssignedTo','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','[%s][queues][queuecallerjoin]','info','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','error','hangup','isNil','debug','[%s][queues][hangup]','queuecallerexit','queuecallercompleteAt','now','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','varset','[%s][queues][varset]','variable','toUpperCase','CONTINUE','queuecallerexitAt','value','queueposition','queuecallerabandon','queuecallerabandonAt','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','queuecallerleaveAt','holdtime','count','[%s][queues][agentconnect]','membername','agentcomplete','assigned','reason','transfer','TRANSFER','[%s][queues][agentcomplete]','blindtransfer','transfereeuniqueid','transfertype','BLIND','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','[%s][queues][blindtransfer]','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','transferexten','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridnum','calleridname','queuecallerjoinAt','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa219,0x70));var _0x9a21=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xa219[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0x9a21('0x0'));var util=require(_0x9a21('0x1'));var utils=require(_0x9a21('0x2'));var queues={};function writeDB(_0x1a6cd2){utils['info'](util[_0x9a21('0x3')](_0x9a21('0x4'),_0x1a6cd2[_0x9a21('0x5')],_0x1a6cd2['channel'],_0x1a6cd2[_0x9a21('0x6')],_0x1a6cd2[_0x9a21('0x7')],_0x1a6cd2['calleridnum'],_0x1a6cd2[_0x9a21('0x8')],_0x1a6cd2[_0x9a21('0x9')]));if(_0x1a6cd2[_0x9a21('0x6')]){utils[_0x9a21('0xa')](_0x1a6cd2[_0x9a21('0x6')])[_0x9a21('0xb')](function(_0x447cde){if(_0x447cde){_0x1a6cd2[_0x9a21('0xc')]=_0x447cde[_0x9a21('0xc')];}utils[_0x9a21('0xd')](_0x9a21('0xe'),_0x1a6cd2);});}else{utils['request'](_0x9a21('0xe'),_0x1a6cd2);}if(_0x1a6cd2[_0x9a21('0xf')]){delete queues[_0x1a6cd2[_0x9a21('0xf')]];}else{delete queues[_0x1a6cd2[_0x9a21('0x5')]];}}exports[_0x9a21('0x10')]=function(_0x50e36b){try{utils['debug'](util[_0x9a21('0x3')](_0x9a21('0x11'),_0x50e36b['uniqueid']),_0x50e36b);utils[_0x9a21('0x12')](util[_0x9a21('0x3')](_0x9a21('0x13'),_0x50e36b[_0x9a21('0x5')],_0x50e36b[_0x9a21('0x6')],_0x50e36b[_0x9a21('0x14')]));queues[_0x50e36b['uniqueid']]=_[_0x9a21('0x15')](_0x50e36b,{'originalposition':_0x50e36b[_0x9a21('0x14')],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});}catch(_0x29c49b){utils[_0x9a21('0x16')](util[_0x9a21('0x3')](_0x9a21('0x11'),_0x50e36b[_0x9a21('0x5')]),_0x29c49b);}};exports[_0x9a21('0x17')]=function(_0x4433f7){try{if(!_[_0x9a21('0x18')](queues[_0x4433f7[_0x9a21('0x5')]])){utils[_0x9a21('0x19')](util[_0x9a21('0x3')](_0x9a21('0x1a'),_0x4433f7[_0x9a21('0x5')]),_0x4433f7);if(queues[_0x4433f7[_0x9a21('0x5')]]['queuecallerleaveAt']){if(!queues[_0x4433f7[_0x9a21('0x5')]]['queuecallerabandon']&&!queues[_0x4433f7['uniqueid']][_0x9a21('0x1b')]){queues[_0x4433f7[_0x9a21('0x5')]]['queuecallercomplete']=!![];queues[_0x4433f7[_0x9a21('0x5')]][_0x9a21('0x1c')]=utils[_0x9a21('0x1d')]();queues[_0x4433f7[_0x9a21('0x5')]][_0x9a21('0x9')]=_0x9a21('0x1e');}utils['info'](util[_0x9a21('0x3')](_0x9a21('0x1f'),_0x4433f7['uniqueid'],queues[_0x4433f7[_0x9a21('0x5')]][_0x9a21('0x20')],queues[_0x4433f7[_0x9a21('0x5')]][_0x9a21('0x9')]));writeDB(queues[_0x4433f7[_0x9a21('0x5')]]);}else if(queues[_0x4433f7[_0x9a21('0x5')]][_0x9a21('0xf')]){utils[_0x9a21('0x12')](util[_0x9a21('0x3')](_0x9a21('0x21'),_0x4433f7['uniqueid'],queues[_0x4433f7['uniqueid']][_0x9a21('0x20')],queues[_0x4433f7[_0x9a21('0x5')]][_0x9a21('0xf')]));queues[queues[_0x4433f7['uniqueid']][_0x9a21('0xf')]]=queues[_0x4433f7[_0x9a21('0x5')]];queues[queues[_0x4433f7['uniqueid']][_0x9a21('0xf')]][_0x9a21('0x22')]=0x2;delete queues[_0x4433f7[_0x9a21('0x5')]];}}}catch(_0x27da6c){utils[_0x9a21('0x16')](util[_0x9a21('0x3')](_0x9a21('0x1a'),_0x4433f7[_0x9a21('0x5')]),_0x27da6c);}};exports[_0x9a21('0x23')]=function(_0x40d0f5){try{utils[_0x9a21('0x19')](util[_0x9a21('0x3')](_0x9a21('0x24'),_0x40d0f5[_0x9a21('0x5')]),_0x40d0f5);if(!_['isNil'](_0x40d0f5[_0x9a21('0x25')]['queuestatus'])&&_0x40d0f5['value'][_0x9a21('0x26')]()!==_0x9a21('0x27')){if(!_[_0x9a21('0x18')](queues[_0x40d0f5[_0x9a21('0x5')]])){queues[_0x40d0f5[_0x9a21('0x5')]]['queuecallerabandon']=![];queues[_0x40d0f5['uniqueid']]['queuecallerabandonAt']=null;queues[_0x40d0f5[_0x9a21('0x5')]][_0x9a21('0x1b')]=!![];queues[_0x40d0f5[_0x9a21('0x5')]][_0x9a21('0x28')]=utils[_0x9a21('0x1d')]();queues[_0x40d0f5[_0x9a21('0x5')]][_0x9a21('0x9')]=_0x40d0f5[_0x9a21('0x29')][_0x9a21('0x26')]();utils[_0x9a21('0x12')](util[_0x9a21('0x3')]('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0x40d0f5[_0x9a21('0x5')],queues[_0x40d0f5[_0x9a21('0x5')]][_0x9a21('0x20')],_0x40d0f5['value'],queues[_0x40d0f5[_0x9a21('0x5')]]['queuecallerexitreason']));writeDB(queues[_0x40d0f5['uniqueid']]);}}else if(!_['isNil'](_0x40d0f5[_0x9a21('0x25')][_0x9a21('0x2a')])){if(!_[_0x9a21('0x18')](queues[_0x40d0f5[_0x9a21('0x5')]])&&!queues[_0x40d0f5[_0x9a21('0x5')]][_0x9a21('0x2b')]){queues[_0x40d0f5[_0x9a21('0x5')]][_0x9a21('0x2b')]=![];queues[_0x40d0f5[_0x9a21('0x5')]][_0x9a21('0x2c')]=null;queues[_0x40d0f5[_0x9a21('0x5')]][_0x9a21('0x1b')]=!![];queues[_0x40d0f5[_0x9a21('0x5')]][_0x9a21('0x28')]=utils['now']();queues[_0x40d0f5['uniqueid']][_0x9a21('0x9')]=_0x9a21('0x2d');utils[_0x9a21('0x12')](util['format'](_0x9a21('0x2e'),_0x40d0f5[_0x9a21('0x5')],queues[_0x40d0f5[_0x9a21('0x5')]][_0x9a21('0x20')],_0x40d0f5['value'],queues[_0x40d0f5['uniqueid']]['queuecallerexitreason']));}}}catch(_0x37139b){utils['error'](util[_0x9a21('0x3')](_0x9a21('0x24'),_0x40d0f5[_0x9a21('0x5')]),_0x37139b);}};exports[_0x9a21('0x2b')]=function(_0x3efee9){try{if(!_['isNil'](queues[_0x3efee9[_0x9a21('0x5')]])){utils[_0x9a21('0x19')](util[_0x9a21('0x3')](_0x9a21('0x2f'),_0x3efee9['uniqueid']),_0x3efee9);queues[_0x3efee9['uniqueid']][_0x9a21('0x1b')]=![];queues[_0x3efee9['uniqueid']][_0x9a21('0x28')]=null;queues[_0x3efee9[_0x9a21('0x5')]][_0x9a21('0x2b')]=!![];queues[_0x3efee9['uniqueid']][_0x9a21('0x2c')]=utils[_0x9a21('0x1d')]();queues[_0x3efee9[_0x9a21('0x5')]][_0x9a21('0x9')]='ABANDONED';utils[_0x9a21('0x12')](util['format']('[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s',_0x3efee9['uniqueid'],queues[_0x3efee9[_0x9a21('0x5')]][_0x9a21('0x20')],queues[_0x3efee9['uniqueid']][_0x9a21('0x9')]));}}catch(_0x283c82){utils[_0x9a21('0x16')](util[_0x9a21('0x3')](_0x9a21('0x2f'),_0x3efee9[_0x9a21('0x5')]),_0x283c82);}};exports[_0x9a21('0x30')]=function(_0x5b23b4){try{if(!_[_0x9a21('0x18')](queues[_0x5b23b4['uniqueid']])){utils['debug'](util[_0x9a21('0x3')](_0x9a21('0x31'),_0x5b23b4[_0x9a21('0x5')]),_0x5b23b4);utils[_0x9a21('0x12')](util[_0x9a21('0x3')](_0x9a21('0x32'),_0x5b23b4[_0x9a21('0x5')],queues[_0x5b23b4[_0x9a21('0x5')]][_0x9a21('0x20')],_0x5b23b4[_0x9a21('0x33')],_0x5b23b4[_0x9a21('0x34')]));queues[_0x5b23b4['uniqueid']][_0x9a21('0x30')]=!![];queues[_0x5b23b4[_0x9a21('0x5')]][_0x9a21('0x35')]=utils[_0x9a21('0x1d')]();queues[_0x5b23b4[_0x9a21('0x5')]][_0x9a21('0x36')]=utils['diffTime'](queues[_0x5b23b4[_0x9a21('0x5')]][_0x9a21('0x35')],queues[_0x5b23b4[_0x9a21('0x5')]]['queuecallerjoinAt']);queues[_0x5b23b4[_0x9a21('0x5')]]['position']=_0x5b23b4[_0x9a21('0x14')];queues[_0x5b23b4[_0x9a21('0x5')]][_0x9a21('0x37')]=_0x5b23b4[_0x9a21('0x37')];queues[_0x5b23b4[_0x9a21('0x5')]][_0x9a21('0x33')]=_0x5b23b4[_0x9a21('0x33')];queues[_0x5b23b4[_0x9a21('0x5')]][_0x9a21('0x34')]=_0x5b23b4[_0x9a21('0x34')];}}catch(_0x5e0931){utils['error'](util[_0x9a21('0x3')](_0x9a21('0x31'),_0x5b23b4[_0x9a21('0x5')]),_0x5e0931);}};exports['agentconnect']=function(_0x5204b6){try{if(!_[_0x9a21('0x18')](queues[_0x5204b6[_0x9a21('0x5')]])){utils[_0x9a21('0x19')](util[_0x9a21('0x3')](_0x9a21('0x38'),_0x5204b6[_0x9a21('0x5')]),_0x5204b6);utils[_0x9a21('0x12')](util[_0x9a21('0x3')]('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x5204b6[_0x9a21('0x5')],queues[_0x5204b6[_0x9a21('0x5')]]['name'],_0x5204b6['membername'],_0x5204b6['destaccountcode']));queues[_0x5204b6[_0x9a21('0x5')]]['queuecallerabandon']=![];queues[_0x5204b6['uniqueid']][_0x9a21('0x2b')]=![];queues[_0x5204b6[_0x9a21('0x5')]][_0x9a21('0x2c')]=null;queues[_0x5204b6['uniqueid']][_0x9a21('0x1b')]=![];queues[_0x5204b6[_0x9a21('0x5')]]['queuecallerexitreason']=null;queues[_0x5204b6['uniqueid']]['queuecallerexitAt']=null;queues[_0x5204b6[_0x9a21('0x5')]]['assigned']=!![];queues[_0x5204b6[_0x9a21('0x5')]][_0x9a21('0x8')]=_0x5204b6['destaccountcode'];queues[_0x5204b6['uniqueid']][_0x9a21('0x7')]=_0x5204b6[_0x9a21('0x39')];}}catch(_0x42d801){utils['error'](util[_0x9a21('0x3')]('[%s][queues][agentconnect]',_0x5204b6[_0x9a21('0x5')]),_0x42d801);}};exports[_0x9a21('0x3a')]=function(_0x1d97ed){try{if(!_['isNil'](queues[_0x1d97ed[_0x9a21('0x5')]])){if(queues[_0x1d97ed[_0x9a21('0x5')]][_0x9a21('0x35')]){utils[_0x9a21('0x19')](util['format']('[%s][queues][agentcomplete]',_0x1d97ed[_0x9a21('0x5')]),_0x1d97ed);queues[_0x1d97ed[_0x9a21('0x5')]]['queuecallerabandon']=![];queues[_0x1d97ed[_0x9a21('0x5')]][_0x9a21('0x2b')]=![];queues[_0x1d97ed[_0x9a21('0x5')]][_0x9a21('0x2c')]=null;queues[_0x1d97ed[_0x9a21('0x5')]][_0x9a21('0x1b')]=![];queues[_0x1d97ed[_0x9a21('0x5')]][_0x9a21('0x28')]=null;queues[_0x1d97ed['uniqueid']][_0x9a21('0x3b')]=!![];queues[_0x1d97ed[_0x9a21('0x5')]][_0x9a21('0x7')]=_0x1d97ed['membername'];queues[_0x1d97ed[_0x9a21('0x5')]]['queuecallercomplete']=!![];queues[_0x1d97ed[_0x9a21('0x5')]][_0x9a21('0x1c')]=utils['now']();if(_0x1d97ed[_0x9a21('0x3c')]==_0x9a21('0x3d')){if(!queues[_0x1d97ed[_0x9a21('0x5')]][_0x9a21('0x3d')]){queues[_0x1d97ed['uniqueid']][_0x9a21('0x9')]=_0x9a21('0x3e');}}else{queues[_0x1d97ed['uniqueid']]['queuecallerexitreason']='COMPLETEDBY'+_0x1d97ed[_0x9a21('0x3c')][_0x9a21('0x26')]();}utils[_0x9a21('0x12')](util[_0x9a21('0x3')]('[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s',_0x1d97ed[_0x9a21('0x5')],queues[_0x1d97ed['uniqueid']][_0x9a21('0x20')],_0x1d97ed[_0x9a21('0x39')],queues[_0x1d97ed['uniqueid']][_0x9a21('0x9')]));writeDB(queues[_0x1d97ed[_0x9a21('0x5')]]);}}}catch(_0x8ef55f){utils['error'](util[_0x9a21('0x3')](_0x9a21('0x3f'),_0x1d97ed[_0x9a21('0x5')]),_0x8ef55f);}};exports[_0x9a21('0x40')]=function(_0x222b0f){try{if(!_[_0x9a21('0x18')](queues[_0x222b0f[_0x9a21('0x41')]])){utils[_0x9a21('0x19')](util[_0x9a21('0x3')]('[%s][queues][blindtransfer]',_0x222b0f[_0x9a21('0x5')]),_0x222b0f);queues[_0x222b0f[_0x9a21('0x41')]]['transfer']=!![];queues[_0x222b0f['transfereeuniqueid']][_0x9a21('0x42')]=_0x9a21('0x43');queues[_0x222b0f[_0x9a21('0x41')]]['transferexten']=_0x222b0f[_0x9a21('0x44')];queues[_0x222b0f[_0x9a21('0x41')]][_0x9a21('0x45')]=_0x222b0f[_0x9a21('0x41')];queues[_0x222b0f[_0x9a21('0x41')]][_0x9a21('0x9')]=_0x9a21('0x46');utils['info'](util[_0x9a21('0x3')](_0x9a21('0x47'),_0x222b0f['uniqueid'],queues[_0x222b0f[_0x9a21('0x41')]][_0x9a21('0x20')],_0x222b0f[_0x9a21('0x41')],_0x222b0f[_0x9a21('0x44')]));}}catch(_0x203155){utils['error'](util[_0x9a21('0x3')](_0x9a21('0x48'),_0x222b0f[_0x9a21('0x5')]),_0x203155);}};exports[_0x9a21('0x49')]=function(_0x1f5363){try{utils['debug'](util[_0x9a21('0x3')]('[%s][queues][attendedtransfer]',_0x1f5363[_0x9a21('0x4a')]),_0x1f5363);if(_0x1f5363['origtransfereruniqueid']==_0x1f5363[_0x9a21('0x4b')]){if(!_[_0x9a21('0x18')](queues[_0x1f5363[_0x9a21('0x4c')]])){utils[_0x9a21('0x12')](util['format'](_0x9a21('0x4d'),_0x1f5363[_0x9a21('0x4a')],queues[_0x1f5363[_0x9a21('0x4c')]][_0x9a21('0x20')],_0x1f5363[_0x9a21('0x4e')]));queues[_0x1f5363['secondtransfererlinkedid']][_0x9a21('0x3d')]=!![];queues[_0x1f5363[_0x9a21('0x4c')]][_0x9a21('0x42')]='ATTENDED';queues[_0x1f5363['secondtransfererlinkedid']][_0x9a21('0x4f')]=_0x1f5363[_0x9a21('0x4e')];queues[_0x1f5363[_0x9a21('0x4c')]][_0x9a21('0x45')]=_0x1f5363[_0x9a21('0x4a')];queues[_0x1f5363[_0x9a21('0x4c')]][_0x9a21('0x9')]=_0x9a21('0x50');}if(!_[_0x9a21('0x18')](queues[_0x1f5363[_0x9a21('0x4b')]])){if(_0x1f5363['transfereelinkedid']&&queues[_0x1f5363['transfereelinkedid']]){queues[_0x1f5363[_0x9a21('0x51')]][_0x9a21('0x22')]=0x1;queues[_0x1f5363['transfereeuniqueid']]=_[_0x9a21('0x52')](queues[_0x1f5363[_0x9a21('0x51')]]);queues[_0x1f5363[_0x9a21('0x41')]][_0x9a21('0xf')]=_0x1f5363[_0x9a21('0x53')];queues[_0x1f5363[_0x9a21('0x41')]][_0x9a21('0x22')]=0x2;queues[_0x1f5363[_0x9a21('0x41')]][_0x9a21('0x54')]=queues[_0x1f5363[_0x9a21('0x4c')]]['calleridnum'];queues[_0x1f5363[_0x9a21('0x41')]][_0x9a21('0x55')]=queues[_0x1f5363['secondtransfererlinkedid']][_0x9a21('0x55')];queues[_0x1f5363[_0x9a21('0x41')]][_0x9a21('0x56')]=utils['now']();queues[_0x1f5363[_0x9a21('0x41')]]['queuecallerleaveAt']=utils[_0x9a21('0x1d')]();queues[_0x1f5363[_0x9a21('0x41')]][_0x9a21('0x36')]=0x0;queues[_0x1f5363[_0x9a21('0x41')]][_0x9a21('0x57')]=0x0;utils[_0x9a21('0x12')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0x1f5363['origtransfereruniqueid'],queues[_0x1f5363[_0x9a21('0x41')]][_0x9a21('0x20')],queues[_0x1f5363[_0x9a21('0x41')]][_0x9a21('0x54')],queues[_0x1f5363[_0x9a21('0x41')]][_0x9a21('0x55')]));}else{utils[_0x9a21('0x12')](util[_0x9a21('0x3')](_0x9a21('0x58'),_0x1f5363[_0x9a21('0x4a')],queues[_0x1f5363['origtransfererlinkedid']]['name'],_0x1f5363['secondtransfererlinkedid']));queues[_0x1f5363[_0x9a21('0x4b')]][_0x9a21('0xf')]=_0x1f5363[_0x9a21('0x4c')];}}}else if(_0x1f5363['secondtransfereruniqueid']==_0x1f5363[_0x9a21('0x4c')]){if(!_[_0x9a21('0x18')](queues[_0x1f5363[_0x9a21('0x4b')]])){utils['info'](util[_0x9a21('0x3')](_0x9a21('0x59'),_0x1f5363[_0x9a21('0x4a')],queues[_0x1f5363['origtransfererlinkedid']][_0x9a21('0x20')],_0x1f5363[_0x9a21('0x5a')],_0x1f5363[_0x9a21('0x5b')]));queues[_0x1f5363[_0x9a21('0x4b')]][_0x9a21('0x3d')]=!![];queues[_0x1f5363[_0x9a21('0x4b')]][_0x9a21('0x42')]='ATTENDED';queues[_0x1f5363[_0x9a21('0x4b')]][_0x9a21('0x4f')]=_0x1f5363[_0x9a21('0x5b')];queues[_0x1f5363['origtransfererlinkedid']][_0x9a21('0x45')]=_0x1f5363[_0x9a21('0x5a')];queues[_0x1f5363[_0x9a21('0x4b')]]['queuecallerexitreason']=_0x9a21('0x50');}if(!_[_0x9a21('0x18')](queues[_0x1f5363['secondtransfererlinkedid']])){if(_0x1f5363['transfertargetlinkedid']&&queues[_0x1f5363['transfertargetlinkedid']]){queues[_0x1f5363[_0x9a21('0x5c')]]['queuecallerenterreason']=0x1;queues[_0x1f5363[_0x9a21('0x53')]]=_['clone'](queues[_0x1f5363[_0x9a21('0x5c')]]);queues[_0x1f5363['transfertargetuniqueid']][_0x9a21('0xf')]=_0x1f5363[_0x9a21('0x53')];queues[_0x1f5363[_0x9a21('0x53')]]['queuecallerenterreason']=0x2;queues[_0x1f5363['transfertargetuniqueid']][_0x9a21('0x54')]=queues[_0x1f5363[_0x9a21('0x4b')]][_0x9a21('0x54')];queues[_0x1f5363[_0x9a21('0x53')]][_0x9a21('0x55')]=queues[_0x1f5363[_0x9a21('0x4b')]][_0x9a21('0x55')];queues[_0x1f5363[_0x9a21('0x53')]][_0x9a21('0x56')]=utils[_0x9a21('0x1d')]();queues[_0x1f5363[_0x9a21('0x53')]][_0x9a21('0x35')]=utils[_0x9a21('0x1d')]();queues[_0x1f5363[_0x9a21('0x53')]][_0x9a21('0x36')]=0x0;queues[_0x1f5363[_0x9a21('0x53')]][_0x9a21('0x57')]=0x0;utils[_0x9a21('0x12')](util[_0x9a21('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s',_0x1f5363[_0x9a21('0x4a')],queues[_0x1f5363[_0x9a21('0x53')]][_0x9a21('0x20')],queues[_0x1f5363[_0x9a21('0x53')]]['transfereduniqueid'],queues[_0x1f5363[_0x9a21('0x53')]]['calleridnum'],queues[_0x1f5363[_0x9a21('0x53')]][_0x9a21('0x55')]));}else{utils[_0x9a21('0x12')](util['format'](_0x9a21('0x58'),_0x1f5363[_0x9a21('0x4a')],queues[_0x1f5363[_0x9a21('0x4c')]]['name'],_0x1f5363[_0x9a21('0x4b')]));queues[_0x1f5363['secondtransfererlinkedid']][_0x9a21('0xf')]=_0x1f5363[_0x9a21('0x4b')];}}}}catch(_0x5789c4){utils['error'](util[_0x9a21('0x3')](_0x9a21('0x5d'),_0x1f5363['origtransfereruniqueid']),_0x5789c4);}};exports[_0x9a21('0x5e')]=function(_0x1979bb){try{if(!_['isNil'](queues[_0x1979bb[_0x9a21('0x5')]])){utils[_0x9a21('0x19')](util['format'](_0x9a21('0x5f'),_0x1979bb[_0x9a21('0x5')]),_0x1979bb);queues[_0x1979bb[_0x9a21('0x5')]][_0x9a21('0x60')]=utils[_0x9a21('0x1d')]();utils[_0x9a21('0x12')](util[_0x9a21('0x3')](_0x9a21('0x61'),_0x1979bb[_0x9a21('0x5')],queues[_0x1979bb['uniqueid']]['name'],queues[_0x1979bb[_0x9a21('0x5')]][_0x9a21('0x60')]));}}catch(_0x15872b){utils['error'](util['format']('[%s][queues][musiconholdstart]',_0x1979bb[_0x9a21('0x5')]),_0x15872b);}};exports['musiconholdstop']=function(_0x2cc646){try{if(!_[_0x9a21('0x18')](queues[_0x2cc646[_0x9a21('0x5')]])){if(!_['isNil'](queues[_0x2cc646[_0x9a21('0x5')]]['musiconholdstartAt'])){utils[_0x9a21('0x19')](util['format'](_0x9a21('0x62'),_0x2cc646[_0x9a21('0x5')]),_0x2cc646);queues[_0x2cc646[_0x9a21('0x5')]][_0x9a21('0x57')]+=utils[_0x9a21('0x63')](utils[_0x9a21('0x1d')](),queues[_0x2cc646['uniqueid']][_0x9a21('0x60')]);utils[_0x9a21('0x12')](util[_0x9a21('0x3')](_0x9a21('0x64'),_0x2cc646[_0x9a21('0x5')],queues[_0x2cc646[_0x9a21('0x5')]]['name'],queues[_0x2cc646[_0x9a21('0x5')]]['mohtime']));delete queues[_0x2cc646[_0x9a21('0x5')]][_0x9a21('0x60')];}}}catch(_0xb22b92){utils[_0x9a21('0x16')](util[_0x9a21('0x3')](_0x9a21('0x62'),_0x2cc646[_0x9a21('0x5')]),_0xb22b92);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index b806231..b8046ee 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 _0xcb9c=['[%s][recordings][newchannel]','uniqueid','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','newstate','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','[%s][recordings][newstate]','varset','variable','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','endsWith','value','.wav49','replace','find','monitors','hangup','[%s][recordings][hangup]','calleridname','calleridnum','connectedlinenum','connectedlinename','type','outbound','clone','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','set','toLowerCase','split','substring','[%s][recordings][queuecallerjoin]','queue','lodash','util','info','format','[%s][recordings][writeDB]','accountcode','getUserByInternal','then','membername','name','UserId','CreateVoiceRecording','request','debug'];(function(_0x2e0378,_0x2154bd){var _0x232451=function(_0x372e02){while(--_0x372e02){_0x2e0378['push'](_0x2e0378['shift']());}};_0x232451(++_0x2154bd);}(_0xcb9c,0x154));var _0xccb9=function(_0x3da018,_0x417d66){_0x3da018=_0x3da018-0x0;var _0x348d57=_0xcb9c[_0x3da018];return _0x348d57;};'use strict';var _=require(_0xccb9('0x0'));var util=require(_0xccb9('0x1'));var utils=require('./utils');var recordings={};function writeDB(_0xa140e2){utils[_0xccb9('0x2')](util[_0xccb9('0x3')](_0xccb9('0x4'),_0xa140e2['uniqueid']));if(_0xa140e2[_0xccb9('0x5')]){utils[_0xccb9('0x6')](_0xa140e2[_0xccb9('0x5')])[_0xccb9('0x7')](function(_0x5957ae){if(_0x5957ae){_0xa140e2[_0xccb9('0x8')]=_0x5957ae[_0xccb9('0x9')];_0xa140e2[_0xccb9('0xa')]=_0x5957ae['id'];}utils['request'](_0xccb9('0xb'),_0xa140e2);});}else{utils[_0xccb9('0xc')](_0xccb9('0xb'),_0xa140e2);}}exports['newchannel']=function(_0x123751){try{utils[_0xccb9('0xd')](util[_0xccb9('0x3')](_0xccb9('0xe'),_0x123751[_0xccb9('0xf')]),_0x123751);if(_0x123751[_0xccb9('0xf')]==_0x123751[_0xccb9('0x10')]){utils[_0xccb9('0x2')](util['format'](_0xccb9('0x11'),_0x123751[_0xccb9('0xf')],_0x123751[_0xccb9('0x12')],_0x123751['exten']));recordings[_0x123751[_0xccb9('0xf')]]={'uniqueid':_0x123751[_0xccb9('0xf')],'accountcode':_0x123751[_0xccb9('0x5')],'exten':_0x123751[_0xccb9('0x13')],'context':_0x123751[_0xccb9('0x12')],'channel':_0x123751[_0xccb9('0x14')],'monitors':[]};}}catch(_0x289da2){utils[_0xccb9('0x15')](util[_0xccb9('0x3')](_0xccb9('0xe'),_0x123751[_0xccb9('0xf')]),_0x289da2);}};exports[_0xccb9('0x16')]=function(_0x4629ae){try{utils['debug'](util['format']('[%s][recordings][newstate]',_0x4629ae[_0xccb9('0xf')]),_0x4629ae);if(!_[_0xccb9('0x17')](recordings[_0x4629ae['uniqueid']])&&_0x4629ae[_0xccb9('0x18')]==0x6){utils['info'](util['format'](_0xccb9('0x19'),_0x4629ae['uniqueid'],_0x4629ae[_0xccb9('0x12')],_0x4629ae['channel']));}else if(!_[_0xccb9('0x17')](recordings[_0x4629ae[_0xccb9('0x10')]])&&_0x4629ae[_0xccb9('0x18')]==0x6&&_0x4629ae[_0xccb9('0x12')]!=_0xccb9('0x1a')){utils[_0xccb9('0x2')](util[_0xccb9('0x3')](_0xccb9('0x1b'),_0x4629ae[_0xccb9('0xf')],_0x4629ae[_0xccb9('0x10')],_0x4629ae[_0xccb9('0x12')],_0x4629ae[_0xccb9('0x14')]));recordings[_0x4629ae[_0xccb9('0x10')]][_0xccb9('0x5')]=_0x4629ae[_0xccb9('0x5')];}}catch(_0x1a8579){utils[_0xccb9('0x15')](util[_0xccb9('0x3')](_0xccb9('0x1c'),_0x4629ae['uniqueid']),_0x1a8579);}};exports[_0xccb9('0x1d')]=function(_0x1ea63d){try{if(!_['isNil'](_0x1ea63d[_0xccb9('0x1e')])&&!_[_0xccb9('0x17')](_0x1ea63d[_0xccb9('0x1e')]['mixmonitor_filename'])){utils[_0xccb9('0xd')](util[_0xccb9('0x3')](_0xccb9('0x1f'),_0x1ea63d['uniqueid']),_0x1ea63d);utils[_0xccb9('0x2')](util[_0xccb9('0x3')](_0xccb9('0x20'),_0x1ea63d[_0xccb9('0xf')],_0x1ea63d[_0xccb9('0x1e')],_0x1ea63d['value']));if(_[_0xccb9('0x21')](_0x1ea63d[_0xccb9('0x22')],_0xccb9('0x23'))){_0x1ea63d[_0xccb9('0x22')]=_0x1ea63d['value'][_0xccb9('0x24')](_0xccb9('0x23'),'.WAV');}if(recordings[_0x1ea63d['linkedid']]){var _0x50fddd=_[_0xccb9('0x25')](recordings[_0x1ea63d[_0xccb9('0x10')]][_0xccb9('0x26')],{'value':_0x1ea63d['value']});if(_[_0xccb9('0x17')](_0x50fddd)){recordings[_0x1ea63d[_0xccb9('0x10')]][_0xccb9('0x26')]['push']({'value':_0x1ea63d['value']});}}}}catch(_0x1de6e2){utils[_0xccb9('0x15')](util[_0xccb9('0x3')](_0xccb9('0x1f'),_0x1ea63d[_0xccb9('0xf')]),_0x1de6e2);}};exports[_0xccb9('0x27')]=function(_0x54a649){try{if(!_['isNil'](recordings[_0x54a649[_0xccb9('0xf')]])){utils[_0xccb9('0xd')](util[_0xccb9('0x3')](_0xccb9('0x28'),_0x54a649[_0xccb9('0xf')]),_0x54a649);utils[_0xccb9('0x2')](util[_0xccb9('0x3')]('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x54a649[_0xccb9('0xf')],_0x54a649['calleridnum'],_0x54a649[_0xccb9('0x29')],_0x54a649['cause-txt']));recordings[_0x54a649['uniqueid']][_0xccb9('0x2a')]=_0x54a649[_0xccb9('0x2a')];recordings[_0x54a649[_0xccb9('0xf')]][_0xccb9('0x29')]=_0x54a649['calleridname'];recordings[_0x54a649[_0xccb9('0xf')]][_0xccb9('0x2b')]=_0x54a649[_0xccb9('0x2b')];recordings[_0x54a649[_0xccb9('0xf')]]['connectedlinename']=_0x54a649[_0xccb9('0x2c')];if(recordings[_0x54a649[_0xccb9('0xf')]][_0xccb9('0x2d')]==_0xccb9('0x2e')&&recordings[_0x54a649[_0xccb9('0xf')]][_0xccb9('0x5')]){recordings[_0x54a649[_0xccb9('0xf')]]['connectedlinenum']=recordings[_0x54a649[_0xccb9('0xf')]][_0xccb9('0x5')];recordings[_0x54a649['uniqueid']][_0xccb9('0x2c')]='';}recordings[_0x54a649[_0xccb9('0xf')]][_0xccb9('0x26')]['forEach'](function(_0x21b890){var _0x3013e4=_[_0xccb9('0x2f')](recordings[_0x54a649[_0xccb9('0xf')]]);_0x3013e4[_0xccb9('0x22')]=_0x21b890[_0xccb9('0x22')];writeDB(_0x3013e4);});delete recordings[_0x54a649['uniqueid']];}}catch(_0x196862){utils[_0xccb9('0x15')](util['format'](_0xccb9('0x28'),_0x54a649[_0xccb9('0xf')]),_0x196862);}};exports[_0xccb9('0x30')]=function(_0x5b215c){try{if(!_[_0xccb9('0x17')](recordings[_0x5b215c[_0xccb9('0xf')]])){utils['debug'](util[_0xccb9('0x3')](_0xccb9('0x31'),_0x5b215c[_0xccb9('0xf')]),_0x5b215c);utils[_0xccb9('0x2')](util[_0xccb9('0x3')](_0xccb9('0x32'),_0x5b215c[_0xccb9('0xf')],_0x5b215c[_0xccb9('0x33')],_0x5b215c[_0xccb9('0x34')]));if(_0x5b215c[_0xccb9('0x33')]['toLowerCase']()==_0xccb9('0x35')&&_['startsWith'](_0x5b215c[_0xccb9('0x34')][_0xccb9('0x36')](),'cdr')){var _0x5cbf8f=_0x5b215c[_0xccb9('0x34')][_0xccb9('0x37')]('=');var _0x305678=_0x5cbf8f[0x0][_0xccb9('0x38')](_0x5cbf8f[0x0]['lastIndexOf']('(')+0x1,_0x5cbf8f[0x0]['lastIndexOf'](')'));var _0x52094f=_0x5cbf8f[0x1];recordings[_0x5b215c[_0xccb9('0xf')]][_0x305678]=_0x52094f;}}}catch(_0x64e9ac){utils['error'](util[_0xccb9('0x3')](_0xccb9('0x31'),_0x5b215c[_0xccb9('0xf')]),_0x64e9ac);}};exports['queuecallerjoin']=function(_0x11c1b2){try{if(!_[_0xccb9('0x17')](recordings[_0x11c1b2[_0xccb9('0xf')]])){utils[_0xccb9('0xd')](util[_0xccb9('0x3')](_0xccb9('0x39'),_0x11c1b2['uniqueid']),_0x11c1b2);utils[_0xccb9('0x2')](util[_0xccb9('0x3')]('[%s][recordings][queuecallerjoin]\x20queue:%s',_0x11c1b2[_0xccb9('0xf')],_0x11c1b2['queue']));recordings[_0x11c1b2[_0xccb9('0xf')]]['queue']=_0x11c1b2[_0xccb9('0x3a')];}}catch(_0x5e8eb0){utils[_0xccb9('0x15')](util['format'](_0xccb9('0x39'),_0x11c1b2['uniqueid']),_0x5e8eb0);}}; \ No newline at end of file +var _0xa767=['.WAV','find','monitors','push','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','connectedlinenum','connectedlinename','type','outbound','forEach','clone','[%s][recordings][newexten]','application','appdata','toLowerCase','startsWith','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','[%s][recordings][queuecallerjoin]','util','./utils','info','format','[%s][recordings][writeDB]','uniqueid','accountcode','getUserByInternal','then','membername','name','UserId','request','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','exten','context','channel','error','newstate','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','variable','[%s][recordings][varset]','value','.wav49'];(function(_0x2cf2e9,_0xd58ea1){var _0xd3670d=function(_0x272868){while(--_0x272868){_0x2cf2e9['push'](_0x2cf2e9['shift']());}};_0xd3670d(++_0xd58ea1);}(_0xa767,0x8e));var _0x7a76=function(_0x441ac4,_0x934d4){_0x441ac4=_0x441ac4-0x0;var _0x1f19f1=_0xa767[_0x441ac4];return _0x1f19f1;};'use strict';var _=require('lodash');var util=require(_0x7a76('0x0'));var utils=require(_0x7a76('0x1'));var recordings={};function writeDB(_0x33eb24){utils[_0x7a76('0x2')](util[_0x7a76('0x3')](_0x7a76('0x4'),_0x33eb24[_0x7a76('0x5')]));if(_0x33eb24[_0x7a76('0x6')]){utils[_0x7a76('0x7')](_0x33eb24[_0x7a76('0x6')])[_0x7a76('0x8')](function(_0x337f35){if(_0x337f35){_0x33eb24[_0x7a76('0x9')]=_0x337f35[_0x7a76('0xa')];_0x33eb24[_0x7a76('0xb')]=_0x337f35['id'];}utils[_0x7a76('0xc')](_0x7a76('0xd'),_0x33eb24);});}else{utils[_0x7a76('0xc')](_0x7a76('0xd'),_0x33eb24);}}exports[_0x7a76('0xe')]=function(_0x45805c){try{utils[_0x7a76('0xf')](util['format'](_0x7a76('0x10'),_0x45805c[_0x7a76('0x5')]),_0x45805c);if(_0x45805c[_0x7a76('0x5')]==_0x45805c[_0x7a76('0x11')]){utils[_0x7a76('0x2')](util[_0x7a76('0x3')](_0x7a76('0x12'),_0x45805c[_0x7a76('0x5')],_0x45805c['context'],_0x45805c['exten']));recordings[_0x45805c[_0x7a76('0x5')]]={'uniqueid':_0x45805c['uniqueid'],'accountcode':_0x45805c['accountcode'],'exten':_0x45805c[_0x7a76('0x13')],'context':_0x45805c[_0x7a76('0x14')],'channel':_0x45805c[_0x7a76('0x15')],'monitors':[]};}}catch(_0x2eff47){utils[_0x7a76('0x16')](util['format'](_0x7a76('0x10'),_0x45805c[_0x7a76('0x5')]),_0x2eff47);}};exports[_0x7a76('0x17')]=function(_0x378c51){try{utils['debug'](util[_0x7a76('0x3')](_0x7a76('0x18'),_0x378c51[_0x7a76('0x5')]),_0x378c51);if(!_[_0x7a76('0x19')](recordings[_0x378c51['uniqueid']])&&_0x378c51[_0x7a76('0x1a')]==0x6){utils[_0x7a76('0x2')](util['format']('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x378c51[_0x7a76('0x5')],_0x378c51[_0x7a76('0x14')],_0x378c51[_0x7a76('0x15')]));}else if(!_[_0x7a76('0x19')](recordings[_0x378c51['linkedid']])&&_0x378c51[_0x7a76('0x1a')]==0x6&&_0x378c51[_0x7a76('0x14')]!='transfer'){utils[_0x7a76('0x2')](util[_0x7a76('0x3')](_0x7a76('0x1b'),_0x378c51[_0x7a76('0x5')],_0x378c51[_0x7a76('0x11')],_0x378c51['context'],_0x378c51[_0x7a76('0x15')]));recordings[_0x378c51[_0x7a76('0x11')]]['accountcode']=_0x378c51['accountcode'];}}catch(_0x2458bf){utils[_0x7a76('0x16')](util[_0x7a76('0x3')](_0x7a76('0x18'),_0x378c51[_0x7a76('0x5')]),_0x2458bf);}};exports['varset']=function(_0x1f5786){try{if(!_[_0x7a76('0x19')](_0x1f5786['variable'])&&!_[_0x7a76('0x19')](_0x1f5786[_0x7a76('0x1c')]['mixmonitor_filename'])){utils[_0x7a76('0xf')](util[_0x7a76('0x3')](_0x7a76('0x1d'),_0x1f5786['uniqueid']),_0x1f5786);utils[_0x7a76('0x2')](util[_0x7a76('0x3')]('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0x1f5786[_0x7a76('0x5')],_0x1f5786[_0x7a76('0x1c')],_0x1f5786[_0x7a76('0x1e')]));if(_['endsWith'](_0x1f5786[_0x7a76('0x1e')],_0x7a76('0x1f'))){_0x1f5786['value']=_0x1f5786[_0x7a76('0x1e')]['replace'](_0x7a76('0x1f'),_0x7a76('0x20'));}if(recordings[_0x1f5786['linkedid']]){var _0x80803f=_[_0x7a76('0x21')](recordings[_0x1f5786['linkedid']][_0x7a76('0x22')],{'value':_0x1f5786[_0x7a76('0x1e')]});if(_[_0x7a76('0x19')](_0x80803f)){recordings[_0x1f5786['linkedid']]['monitors'][_0x7a76('0x23')]({'value':_0x1f5786[_0x7a76('0x1e')]});}}}}catch(_0xbe3f59){utils[_0x7a76('0x16')](util[_0x7a76('0x3')](_0x7a76('0x1d'),_0x1f5786[_0x7a76('0x5')]),_0xbe3f59);}};exports[_0x7a76('0x24')]=function(_0x35bbc8){try{if(!_[_0x7a76('0x19')](recordings[_0x35bbc8[_0x7a76('0x5')]])){utils['debug'](util[_0x7a76('0x3')](_0x7a76('0x25'),_0x35bbc8[_0x7a76('0x5')]),_0x35bbc8);utils[_0x7a76('0x2')](util[_0x7a76('0x3')](_0x7a76('0x26'),_0x35bbc8[_0x7a76('0x5')],_0x35bbc8[_0x7a76('0x27')],_0x35bbc8[_0x7a76('0x28')],_0x35bbc8['cause-txt']));recordings[_0x35bbc8[_0x7a76('0x5')]][_0x7a76('0x27')]=_0x35bbc8['calleridnum'];recordings[_0x35bbc8['uniqueid']][_0x7a76('0x28')]=_0x35bbc8[_0x7a76('0x28')];recordings[_0x35bbc8[_0x7a76('0x5')]]['connectedlinenum']=_0x35bbc8[_0x7a76('0x29')];recordings[_0x35bbc8[_0x7a76('0x5')]][_0x7a76('0x2a')]=_0x35bbc8[_0x7a76('0x2a')];if(recordings[_0x35bbc8['uniqueid']][_0x7a76('0x2b')]==_0x7a76('0x2c')&&recordings[_0x35bbc8[_0x7a76('0x5')]][_0x7a76('0x6')]){recordings[_0x35bbc8[_0x7a76('0x5')]][_0x7a76('0x29')]=recordings[_0x35bbc8[_0x7a76('0x5')]][_0x7a76('0x6')];recordings[_0x35bbc8[_0x7a76('0x5')]][_0x7a76('0x2a')]='';}recordings[_0x35bbc8[_0x7a76('0x5')]][_0x7a76('0x22')][_0x7a76('0x2d')](function(_0x268f0e){var _0x5f50a0=_[_0x7a76('0x2e')](recordings[_0x35bbc8[_0x7a76('0x5')]]);_0x5f50a0[_0x7a76('0x1e')]=_0x268f0e[_0x7a76('0x1e')];writeDB(_0x5f50a0);});delete recordings[_0x35bbc8['uniqueid']];}}catch(_0x30d5bd){utils['error'](util['format'](_0x7a76('0x25'),_0x35bbc8[_0x7a76('0x5')]),_0x30d5bd);}};exports['newexten']=function(_0x26c50c){try{if(!_[_0x7a76('0x19')](recordings[_0x26c50c[_0x7a76('0x5')]])){utils[_0x7a76('0xf')](util[_0x7a76('0x3')](_0x7a76('0x2f'),_0x26c50c[_0x7a76('0x5')]),_0x26c50c);utils[_0x7a76('0x2')](util[_0x7a76('0x3')]('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x26c50c[_0x7a76('0x5')],_0x26c50c[_0x7a76('0x30')],_0x26c50c[_0x7a76('0x31')]));if(_0x26c50c[_0x7a76('0x30')][_0x7a76('0x32')]()=='set'&&_[_0x7a76('0x33')](_0x26c50c[_0x7a76('0x31')][_0x7a76('0x32')](),'cdr')){var _0x3f954e=_0x26c50c[_0x7a76('0x31')]['split']('=');var _0x31fe95=_0x3f954e[0x0][_0x7a76('0x34')](_0x3f954e[0x0][_0x7a76('0x35')]('(')+0x1,_0x3f954e[0x0][_0x7a76('0x35')](')'));var _0x51d2fa=_0x3f954e[0x1];recordings[_0x26c50c['uniqueid']][_0x31fe95]=_0x51d2fa;}}}catch(_0x44cdd0){utils['error'](util['format'](_0x7a76('0x2f'),_0x26c50c[_0x7a76('0x5')]),_0x44cdd0);}};exports[_0x7a76('0x36')]=function(_0x4057a5){try{if(!_[_0x7a76('0x19')](recordings[_0x4057a5[_0x7a76('0x5')]])){utils[_0x7a76('0xf')](util['format']('[%s][recordings][queuecallerjoin]',_0x4057a5[_0x7a76('0x5')]),_0x4057a5);utils['info'](util[_0x7a76('0x3')](_0x7a76('0x37'),_0x4057a5[_0x7a76('0x5')],_0x4057a5[_0x7a76('0x38')]));recordings[_0x4057a5[_0x7a76('0x5')]]['queue']=_0x4057a5[_0x7a76('0x38')];}}catch(_0xb3b37b){utils[_0x7a76('0x16')](util[_0x7a76('0x3')](_0x7a76('0x39'),_0x4057a5[_0x7a76('0x5')]),_0xb3b37b);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 027926b..8384138 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 _0x9fe0=['type','CreateVoiceTransferReport','blinds','debug','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridname','transfereecalleridnum','blind','transfereruniqueid','attendedtransfer','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','origtransfererchannel','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','origtransferercontext','isNil','transfereechannel','assign','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetlinkedid','error','[%s][transfers][attendedtransfer]','lodash','util','./utils','info','format','attended','origtransfereruniqueid','uniqueid'];(function(_0x54d4a8,_0x585a59){var _0x3b321b=function(_0x245c6a){while(--_0x245c6a){_0x54d4a8['push'](_0x54d4a8['shift']());}};_0x3b321b(++_0x585a59);}(_0x9fe0,0x110));var _0x09fe=function(_0xc51d6d,_0x4eeadc){_0xc51d6d=_0xc51d6d-0x0;var _0x386ef3=_0x9fe0[_0xc51d6d];return _0x386ef3;};'use strict';var _=require(_0x09fe('0x0'));var util=require(_0x09fe('0x1'));var utils=require(_0x09fe('0x2'));function writeDB(_0x3b40b7){utils[_0x09fe('0x3')](util[_0x09fe('0x4')]('[%s][transfers][writeDB]\x20type:%s',_0x3b40b7['type']===_0x09fe('0x5')?_0x3b40b7[_0x09fe('0x6')]:_0x3b40b7[_0x09fe('0x7')],_0x3b40b7[_0x09fe('0x8')]));utils['request'](_0x09fe('0x9'),_0x3b40b7);}exports[_0x09fe('0xa')]={};exports['blindtransfer']=function(_0x3c2823){try{utils[_0x09fe('0xb')](util[_0x09fe('0x4')](_0x09fe('0xc'),_0x3c2823[_0x09fe('0x7')]),_0x3c2823);utils[_0x09fe('0x3')](util[_0x09fe('0x4')](_0x09fe('0xd'),_0x3c2823[_0x09fe('0x7')],_0x3c2823['transferercalleridnum'],_0x3c2823[_0x09fe('0xe')],_0x3c2823[_0x09fe('0xf')],_0x3c2823['transfereecalleridname']));_0x3c2823['type']=_0x09fe('0x10');exports[_0x09fe('0xa')][_0x3c2823[_0x09fe('0x11')]]=_0x3c2823;writeDB(_0x3c2823);}catch(_0x399936){utils['error'](util[_0x09fe('0x4')](_0x09fe('0xc'),_0x3c2823[_0x09fe('0x7')]),_0x399936);}};exports[_0x09fe('0x12')]=function(_0x2cacb7){try{utils[_0x09fe('0xb')](util[_0x09fe('0x4')]('[%s][transfers][attendedtransfer]',_0x2cacb7[_0x09fe('0x6')]),_0x2cacb7);utils[_0x09fe('0x3')](util[_0x09fe('0x4')](_0x09fe('0x13'),_0x2cacb7['origtransfereruniqueid'],_0x2cacb7[_0x09fe('0x14')],_0x2cacb7[_0x09fe('0x15')],_0x2cacb7[_0x09fe('0x16')],_0x2cacb7['transfertargetcalleridname']));_0x2cacb7=_['assign'](_0x2cacb7,{'transfererchannel':_0x2cacb7[_0x09fe('0x17')],'transferercalleridnum':_0x2cacb7[_0x09fe('0x14')],'transferercalleridname':_0x2cacb7[_0x09fe('0x15')],'transfererconnectedlinenum':_0x2cacb7['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x2cacb7[_0x09fe('0x18')],'transfereraccountcode':_0x2cacb7[_0x09fe('0x19')],'transferercontext':_0x2cacb7['secondtransferercontext'],'transfererexten':_0x2cacb7[_0x09fe('0x1a')],'transfererlinkedid':_0x2cacb7['origtransfererlinkedid'],'context':_0x2cacb7[_0x09fe('0x1b')],'extension':_0x2cacb7['origtransfererexten'],'type':_0x09fe('0x5')});if(_[_0x09fe('0x1c')](_0x2cacb7[_0x09fe('0x1d')])){_0x2cacb7=_[_0x09fe('0x1e')](_0x2cacb7,{'transfereechannel':_0x2cacb7[_0x09fe('0x1f')],'transfereecalleridnum':_0x2cacb7[_0x09fe('0x16')],'transfereecalleridname':_0x2cacb7[_0x09fe('0x20')],'transfereeconnectedlinenum':_0x2cacb7[_0x09fe('0x21')],'transfereeconnectedlinename':_0x2cacb7[_0x09fe('0x22')],'transfereeaccountcode':_0x2cacb7[_0x09fe('0x23')],'transfereecontext':_0x2cacb7[_0x09fe('0x24')],'transfereeexten':_0x2cacb7['transfertargetexten'],'transfereelinkedid':_0x2cacb7[_0x09fe('0x25')]});}writeDB(_0x2cacb7);}catch(_0x5de837){utils[_0x09fe('0x26')](util[_0x09fe('0x4')](_0x09fe('0x27'),_0x2cacb7[_0x09fe('0x6')]),_0x5de837);}}; \ No newline at end of file +var _0x5348=['blinds','blindtransfer','[%s][transfers][blindtransfer]','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','transfereruniqueid','error','attendedtransfer','debug','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','attended','isNil','transfereechannel','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','util','./utils','info','format','type','origtransfereruniqueid','uniqueid','request'];(function(_0x185c8a,_0x15b86a){var _0x5be29a=function(_0x7a2df2){while(--_0x7a2df2){_0x185c8a['push'](_0x185c8a['shift']());}};_0x5be29a(++_0x15b86a);}(_0x5348,0x81));var _0x8534=function(_0x2ebc06,_0x2f480e){_0x2ebc06=_0x2ebc06-0x0;var _0x57ded5=_0x5348[_0x2ebc06];return _0x57ded5;};'use strict';var _=require(_0x8534('0x0'));var util=require(_0x8534('0x1'));var utils=require(_0x8534('0x2'));function writeDB(_0x378d5b){utils[_0x8534('0x3')](util[_0x8534('0x4')]('[%s][transfers][writeDB]\x20type:%s',_0x378d5b[_0x8534('0x5')]==='attended'?_0x378d5b[_0x8534('0x6')]:_0x378d5b[_0x8534('0x7')],_0x378d5b[_0x8534('0x5')]));utils[_0x8534('0x8')]('CreateVoiceTransferReport',_0x378d5b);}exports[_0x8534('0x9')]={};exports[_0x8534('0xa')]=function(_0x335c5b){try{utils['debug'](util[_0x8534('0x4')](_0x8534('0xb'),_0x335c5b['uniqueid']),_0x335c5b);utils['info'](util[_0x8534('0x4')]('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x335c5b[_0x8534('0x7')],_0x335c5b[_0x8534('0xc')],_0x335c5b[_0x8534('0xd')],_0x335c5b[_0x8534('0xe')],_0x335c5b[_0x8534('0xf')]));_0x335c5b[_0x8534('0x5')]=_0x8534('0x10');exports['blinds'][_0x335c5b[_0x8534('0x11')]]=_0x335c5b;writeDB(_0x335c5b);}catch(_0x243422){utils[_0x8534('0x12')](util[_0x8534('0x4')](_0x8534('0xb'),_0x335c5b[_0x8534('0x7')]),_0x243422);}};exports[_0x8534('0x13')]=function(_0x13bbf1){try{utils[_0x8534('0x14')](util[_0x8534('0x4')](_0x8534('0x15'),_0x13bbf1[_0x8534('0x6')]),_0x13bbf1);utils[_0x8534('0x3')](util[_0x8534('0x4')](_0x8534('0x16'),_0x13bbf1[_0x8534('0x6')],_0x13bbf1[_0x8534('0x17')],_0x13bbf1[_0x8534('0x18')],_0x13bbf1[_0x8534('0x19')],_0x13bbf1[_0x8534('0x1a')]));_0x13bbf1=_[_0x8534('0x1b')](_0x13bbf1,{'transfererchannel':_0x13bbf1[_0x8534('0x1c')],'transferercalleridnum':_0x13bbf1[_0x8534('0x17')],'transferercalleridname':_0x13bbf1[_0x8534('0x18')],'transfererconnectedlinenum':_0x13bbf1['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x13bbf1[_0x8534('0x1d')],'transfereraccountcode':_0x13bbf1[_0x8534('0x1e')],'transferercontext':_0x13bbf1[_0x8534('0x1f')],'transfererexten':_0x13bbf1[_0x8534('0x20')],'transfererlinkedid':_0x13bbf1[_0x8534('0x21')],'context':_0x13bbf1[_0x8534('0x22')],'extension':_0x13bbf1[_0x8534('0x23')],'type':_0x8534('0x24')});if(_[_0x8534('0x25')](_0x13bbf1[_0x8534('0x26')])){_0x13bbf1=_[_0x8534('0x1b')](_0x13bbf1,{'transfereechannel':_0x13bbf1[_0x8534('0x27')],'transfereecalleridnum':_0x13bbf1['transfertargetcalleridnum'],'transfereecalleridname':_0x13bbf1['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x13bbf1[_0x8534('0x28')],'transfereeconnectedlinename':_0x13bbf1[_0x8534('0x29')],'transfereeaccountcode':_0x13bbf1[_0x8534('0x2a')],'transfereecontext':_0x13bbf1[_0x8534('0x2b')],'transfereeexten':_0x13bbf1[_0x8534('0x2c')],'transfereelinkedid':_0x13bbf1[_0x8534('0x2d')]});}writeDB(_0x13bbf1);}catch(_0x4ed87f){utils[_0x8534('0x12')](util[_0x8534('0x4')]('[%s][transfers][attendedtransfer]',_0x13bbf1[_0x8534('0x6')]),_0x4ed87f);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index dfedc97..189c32d 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 _0x8c7a=['util','client','info','debug','inspect','error','request','then','[utils][request]\x20name:%s','catch','[utils][getUser]\x20where:%s','stringify','result','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','name','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','length','[utils][getVoiceQueueByName]','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtract','diff','isAfter','isBefore','bluebird','jayson/promise','moment'];(function(_0x3e9790,_0xdb8c53){var _0x463864=function(_0x248684){while(--_0x248684){_0x3e9790['push'](_0x3e9790['shift']());}};_0x463864(++_0xdb8c53);}(_0x8c7a,0x197));var _0xa8c7=function(_0x21bb91,_0x58d317){_0x21bb91=_0x21bb91-0x0;var _0x126672=_0x8c7a[_0x21bb91];return _0x126672;};'use strict';var BPromise=require(_0xa8c7('0x0'));var jayson=require(_0xa8c7('0x1'));var moment=require(_0xa8c7('0x2'));var util=require(_0xa8c7('0x3'));var client=jayson[_0xa8c7('0x4')]['http']({'port':0x2329});var logger=require('../../config/logger')('xdr');exports[_0xa8c7('0x5')]=function(_0x44d295,_0x40d483){logger[_0xa8c7('0x5')](_0x44d295,_0x40d483?util['inspect'](_0x40d483,{'showHidden':![],'depth':null}):'');};exports[_0xa8c7('0x6')]=function(_0x373404,_0x1ecf2d){logger[_0xa8c7('0x6')](_0x373404,_0x1ecf2d?util[_0xa8c7('0x7')](_0x1ecf2d,{'showHidden':![],'depth':null}):'');};exports['error']=function(_0xa2cd18,_0x46ed47){logger[_0xa8c7('0x8')](_0xa2cd18,_0x46ed47?util[_0xa8c7('0x7')](_0x46ed47,{'showHidden':![],'depth':null}):'');};exports[_0xa8c7('0x9')]=function(_0x12a837,_0x45efd3){return client[_0xa8c7('0x9')](_0x12a837,{'body':_0x45efd3})[_0xa8c7('0xa')](function(_0x16079e){logger[_0xa8c7('0x6')](_0xa8c7('0xb'),_0x12a837,_0x16079e?util['inspect'](_0x16079e,{'showHidden':![],'depth':null}):'');})[_0xa8c7('0xc')](function(_0x4bf0b9){logger[_0xa8c7('0x8')]('[utils][request]\x20name:%s',_0x12a837,_0x4bf0b9?util[_0xa8c7('0x7')](_0x4bf0b9,{'showHidden':![],'depth':null}):'');});};function getUser(_0x4eef96){return client[_0xa8c7('0x9')]('GetUser',{'options':{'raw':!![],'attributes':['id','internal','name','interface'],'where':_0x4eef96,'limit':0x1}})[_0xa8c7('0xa')](function(_0x4bb8e6){logger[_0xa8c7('0x6')](_0xa8c7('0xd'),JSON[_0xa8c7('0xe')](_0x4eef96),_0x4bb8e6?util['inspect'](_0x4bb8e6,{'showHidden':![],'depth':null}):'');return _0x4bb8e6[_0xa8c7('0xf')]['length']?_0x4bb8e6['result'][0x0]:null;});}exports[_0xa8c7('0x10')]=function(_0x55bfa6){return new BPromise(function(_0x34ba74,_0x4a6db0){if(_0x55bfa6){return getUser({'internal':_0x55bfa6})[_0xa8c7('0xa')](function(_0x42ef56){logger[_0xa8c7('0x5')](_0xa8c7('0x11'),_0x55bfa6,_0x42ef56?_0xa8c7('0x12'):_0xa8c7('0x13'));return _0x34ba74(_0x42ef56);})[_0xa8c7('0xc')](function(_0x4bf821){logger['error']('[utils][getUserByInternal]',_0x4bf821?util[_0xa8c7('0x7')](_0x4bf821,{'showHidden':![],'depth':null}):'');return _0x34ba74(null);});}return _0x34ba74(null);});};exports[_0xa8c7('0x14')]=function(_0x38ca4e){return new BPromise(function(_0x4b0b7e,_0x4c71b4){if(_0x38ca4e){return getUser({'interface':_0x38ca4e})[_0xa8c7('0xa')](function(_0x5badb2){logger[_0xa8c7('0x5')](_0xa8c7('0x15'),_0x38ca4e,_0x5badb2?'found':'notfound');return _0x4b0b7e(_0x5badb2);})[_0xa8c7('0xc')](function(_0x530b84){logger[_0xa8c7('0x8')](_0xa8c7('0x16'),_0x530b84?util[_0xa8c7('0x7')](_0x530b84,{'showHidden':![],'depth':null}):'');return _0x4b0b7e(null);});}return _0x4b0b7e(null);});};exports[_0xa8c7('0x17')]=function(_0x53aabb){return new BPromise(function(_0x384a8d,_0x1ee770){if(_0x53aabb){return getUser({'name':_0x53aabb})[_0xa8c7('0xa')](function(_0x26c23d){logger[_0xa8c7('0x5')](_0xa8c7('0x18'),_0x53aabb,_0x26c23d?_0xa8c7('0x12'):'notfound');return _0x384a8d(_0x26c23d);})[_0xa8c7('0xc')](function(_0x2cb8b2){logger[_0xa8c7('0x8')](_0xa8c7('0x19'),_0x2cb8b2?util[_0xa8c7('0x7')](_0x2cb8b2,{'showHidden':![],'depth':null}):'');return _0x384a8d(null);});}return _0x384a8d(null);});};exports['getVoiceQueueByName']=function(_0x1161d7){return new BPromise(function(_0x5d2c4b,_0x3bc365){if(_0x1161d7){return client[_0xa8c7('0x9')]('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id',_0xa8c7('0x1a'),'type',_0xa8c7('0x1b'),_0xa8c7('0x1c')],'where':{'name':_0x1161d7},'limit':0x1}})['then'](function(_0x344e96){logger[_0xa8c7('0x6')](_0xa8c7('0x1d'),_0x1161d7,_0x344e96?util['inspect'](_0x344e96,{'showHidden':![],'depth':null}):'');logger[_0xa8c7('0x5')](_0xa8c7('0x1e'),_0x1161d7,_0x344e96?'found':_0xa8c7('0x13'));return _0x5d2c4b(_0x344e96['result'][_0xa8c7('0x1f')]?_0x344e96[_0xa8c7('0xf')][0x0]:null);})[_0xa8c7('0xc')](function(_0x1e8154){logger[_0xa8c7('0x8')](_0xa8c7('0x20'),_0x1e8154?util[_0xa8c7('0x7')](_0x1e8154,{'showHidden':![],'depth':null}):'');return _0x5d2c4b(null);});}return _0x5d2c4b(null);});};exports['addTime']=function(_0x1a6e4e,_0x258c3a){return moment(_0x1a6e4e)[_0xa8c7('0x21')](_0x258c3a,_0xa8c7('0x22'))[_0xa8c7('0x23')](_0xa8c7('0x24'));};exports['subtractTime']=function(_0x2250e7,_0x474a05){return moment(_0x2250e7)[_0xa8c7('0x25')](_0x474a05,_0xa8c7('0x22'))[_0xa8c7('0x23')](_0xa8c7('0x24'));};exports['diffTime']=function(_0x14833c,_0x423a28){return moment(_0x14833c)[_0xa8c7('0x26')](moment(_0x423a28),'seconds');};exports['sumTime']=function(_0x3ec927,_0xc5d163){return parseInt(_0x3ec927,0xa)+parseInt(_0xc5d163,0xa);};exports['now']=function(){return moment()[_0xa8c7('0x23')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xa8c7('0x27')]=function(_0x345618,_0x2f6d59){if(_0x2f6d59){return moment(_0x345618)[_0xa8c7('0x27')](_0x2f6d59);}return!![];};exports[_0xa8c7('0x28')]=function(_0x56e252,_0x7b0db8){if(_0x7b0db8){return moment(_0x56e252)['isBefore'](_0x7b0db8);}else if(_0x56e252){return!![];}return![];}; \ No newline at end of file +var _0x1228=['getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInternal]','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','length','[utils][getVoiceQueueByName]','addTime','add','seconds','subtractTime','subtract','YYYY-MM-DD\x20HH:mm:ss','diffTime','isAfter','isBefore','bluebird','moment','client','http','../../config/logger','info','inspect','error','request','debug','[utils][request]\x20name:%s','catch','GetUser','internal','name','interface','then','stringify','result'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x1228,0x12f));var _0x8122=function(_0x11eb9a,_0x22d3e1){_0x11eb9a=_0x11eb9a-0x0;var _0x3b98fc=_0x1228[_0x11eb9a];return _0x3b98fc;};'use strict';var BPromise=require(_0x8122('0x0'));var jayson=require('jayson/promise');var moment=require(_0x8122('0x1'));var util=require('util');var client=jayson[_0x8122('0x2')][_0x8122('0x3')]({'port':0x2329});var logger=require(_0x8122('0x4'))('xdr');exports[_0x8122('0x5')]=function(_0xf4d3e5,_0x4de3a0){logger[_0x8122('0x5')](_0xf4d3e5,_0x4de3a0?util[_0x8122('0x6')](_0x4de3a0,{'showHidden':![],'depth':null}):'');};exports['debug']=function(_0x21987a,_0x139c44){logger['debug'](_0x21987a,_0x139c44?util[_0x8122('0x6')](_0x139c44,{'showHidden':![],'depth':null}):'');};exports[_0x8122('0x7')]=function(_0x55078d,_0x2bfe98){logger[_0x8122('0x7')](_0x55078d,_0x2bfe98?util['inspect'](_0x2bfe98,{'showHidden':![],'depth':null}):'');};exports['request']=function(_0x4fa7b3,_0x52f48b){return client[_0x8122('0x8')](_0x4fa7b3,{'body':_0x52f48b})['then'](function(_0x352ba1){logger[_0x8122('0x9')](_0x8122('0xa'),_0x4fa7b3,_0x352ba1?util['inspect'](_0x352ba1,{'showHidden':![],'depth':null}):'');})[_0x8122('0xb')](function(_0x565f6e){logger[_0x8122('0x7')](_0x8122('0xa'),_0x4fa7b3,_0x565f6e?util[_0x8122('0x6')](_0x565f6e,{'showHidden':![],'depth':null}):'');});};function getUser(_0x2d2560){return client[_0x8122('0x8')](_0x8122('0xc'),{'options':{'raw':!![],'attributes':['id',_0x8122('0xd'),_0x8122('0xe'),_0x8122('0xf')],'where':_0x2d2560,'limit':0x1}})[_0x8122('0x10')](function(_0xfa15a2){logger[_0x8122('0x9')]('[utils][getUser]\x20where:%s',JSON[_0x8122('0x11')](_0x2d2560),_0xfa15a2?util['inspect'](_0xfa15a2,{'showHidden':![],'depth':null}):'');return _0xfa15a2[_0x8122('0x12')]['length']?_0xfa15a2[_0x8122('0x12')][0x0]:null;});}exports[_0x8122('0x13')]=function(_0x394b27){return new BPromise(function(_0x4bfb9e,_0x4e932f){if(_0x394b27){return getUser({'internal':_0x394b27})['then'](function(_0x5c93f6){logger['info'](_0x8122('0x14'),_0x394b27,_0x5c93f6?_0x8122('0x15'):_0x8122('0x16'));return _0x4bfb9e(_0x5c93f6);})['catch'](function(_0x5df55f){logger[_0x8122('0x7')](_0x8122('0x17'),_0x5df55f?util[_0x8122('0x6')](_0x5df55f,{'showHidden':![],'depth':null}):'');return _0x4bfb9e(null);});}return _0x4bfb9e(null);});};exports['getUserByInterface']=function(_0x15e635){return new BPromise(function(_0x1c0189,_0x27f204){if(_0x15e635){return getUser({'interface':_0x15e635})[_0x8122('0x10')](function(_0x3c6226){logger[_0x8122('0x5')](_0x8122('0x18'),_0x15e635,_0x3c6226?_0x8122('0x15'):'notfound');return _0x1c0189(_0x3c6226);})[_0x8122('0xb')](function(_0x5cfa77){logger[_0x8122('0x7')](_0x8122('0x19'),_0x5cfa77?util[_0x8122('0x6')](_0x5cfa77,{'showHidden':![],'depth':null}):'');return _0x1c0189(null);});}return _0x1c0189(null);});};exports[_0x8122('0x1a')]=function(_0x1c80f9){return new BPromise(function(_0x240a6d,_0x40e945){if(_0x1c80f9){return getUser({'name':_0x1c80f9})[_0x8122('0x10')](function(_0x22f094){logger['info'](_0x8122('0x1b'),_0x1c80f9,_0x22f094?_0x8122('0x15'):_0x8122('0x16'));return _0x240a6d(_0x22f094);})[_0x8122('0xb')](function(_0x2f8d73){logger[_0x8122('0x7')](_0x8122('0x1c'),_0x2f8d73?util[_0x8122('0x6')](_0x2f8d73,{'showHidden':![],'depth':null}):'');return _0x240a6d(null);});}return _0x240a6d(null);});};exports[_0x8122('0x1d')]=function(_0x4610b1){return new BPromise(function(_0x4c70f4,_0x49531a){if(_0x4610b1){return client[_0x8122('0x8')](_0x8122('0x1e'),{'options':{'raw':!![],'attributes':['id','name','type',_0x8122('0x1f'),_0x8122('0x20')],'where':{'name':_0x4610b1},'limit':0x1}})[_0x8122('0x10')](function(_0x552910){logger['debug'](_0x8122('0x21'),_0x4610b1,_0x552910?util[_0x8122('0x6')](_0x552910,{'showHidden':![],'depth':null}):'');logger[_0x8122('0x5')](_0x8122('0x22'),_0x4610b1,_0x552910?_0x8122('0x15'):_0x8122('0x16'));return _0x4c70f4(_0x552910[_0x8122('0x12')][_0x8122('0x23')]?_0x552910[_0x8122('0x12')][0x0]:null);})[_0x8122('0xb')](function(_0x51af4d){logger[_0x8122('0x7')](_0x8122('0x24'),_0x51af4d?util[_0x8122('0x6')](_0x51af4d,{'showHidden':![],'depth':null}):'');return _0x4c70f4(null);});}return _0x4c70f4(null);});};exports[_0x8122('0x25')]=function(_0x24481a,_0x5aeb14){return moment(_0x24481a)[_0x8122('0x26')](_0x5aeb14,_0x8122('0x27'))['format']('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x8122('0x28')]=function(_0x4b4a3b,_0x5362fe){return moment(_0x4b4a3b)[_0x8122('0x29')](_0x5362fe,'seconds')['format'](_0x8122('0x2a'));};exports[_0x8122('0x2b')]=function(_0x5e2ffe,_0x3e9114){return moment(_0x5e2ffe)['diff'](moment(_0x3e9114),_0x8122('0x27'));};exports['sumTime']=function(_0x1fe9de,_0x4f1d9){return parseInt(_0x1fe9de,0xa)+parseInt(_0x4f1d9,0xa);};exports['now']=function(){return moment()['format']('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x8122('0x2c')]=function(_0x119719,_0x54e826){if(_0x54e826){return moment(_0x119719)[_0x8122('0x2c')](_0x54e826);}return!![];};exports[_0x8122('0x2d')]=function(_0x373b17,_0x21dfce){if(_0x21dfce){return moment(_0x373b17)['isBefore'](_0x21dfce);}else if(_0x373b17){return!![];}return![];}; \ No newline at end of file -- 1.7.1